diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 43c9871b..88d1a3ee 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -1,63 +1,8 @@ { "permissions": { "allow": [ - "Bash(__NEW_LINE__ echo \"=== Test /api/v1/referral/me (referral-service) ===\")", - "Bash(git -C \"c:\\Users\\dong\\Desktop\\rwadurian\" push)", - "Bash(__NEW_LINE__ echo \"=== Test /api/v1/authorizations/my (authorization-service on port 3002) ===\")", - "Bash(__NEW_LINE__ echo \"=== Test /api/v1/authorizations/my (authorization-service on port 3009) ===\")", - "Bash(backend/api-gateway/kong.yml )", - "Bash(frontend/mobile-app/lib/core/constants/api_endpoints.dart )", - "Bash(frontend/mobile-app/lib/core/di/injection_container.dart )", - "Bash(frontend/mobile-app/lib/core/services/referral_service.dart )", - "Bash(frontend/mobile-app/lib/core/services/authorization_service.dart )", - "Bash(frontend/mobile-app/lib/features/profile/presentation/pages/profile_page.dart )", - "Bash(backend/services/authorization-service/package.json )", - "Bash(backend/services/authorization-service/package-lock.json )", - "Bash(backend/services/authorization-service/src/shared/strategies/jwt.strategy.ts )", - "Bash(backend/services/authorization-service/src/infrastructure/persistence/repositories/system-account.repository.impl.ts)", - "Bash(DATABASE_URL=\"postgresql://rwauser:rwapass123@localhost:5432/rwa_authorization\" npx prisma migrate:*)", - "Bash(backend/services/authorization-service/.gitignore )", - "Bash(backend/services/authorization-service/prisma/migrations/00000000000000_init/migration.sql )", - "Bash(git fetch:*)", - "Bash(backend/services/blockchain-service/package.json )", - "Bash(backend/services/blockchain-service/package-lock.json )", - "Bash(backend/services/blockchain-service/src/api/api.module.ts )", - "Bash(backend/services/blockchain-service/src/api/controllers/index.ts )", - "Bash(backend/services/blockchain-service/src/api/controllers/deposit.controller.ts )", - "Bash(backend/services/blockchain-service/src/shared/index.ts )", - "Bash(backend/services/blockchain-service/src/shared/decorators/ )", - "Bash(backend/services/blockchain-service/src/shared/guards/ )", - "Bash(backend/services/blockchain-service/src/shared/strategies/ )", - "Bash(backend/services/wallet-service/src/api/api.module.ts )", - "Bash(backend/services/wallet-service/src/infrastructure/kafka/ )", - "Bash(backend/services/wallet-service/src/application/event-handlers/ )", - "Bash(backend/services/docker-compose.yml )", - "Bash(frontend/mobile-app/lib/core/services/deposit_service.dart)", - "Bash(backend/services/authorization-service/prisma/schema.prisma )", - "Bash(backend/services/authorization-service/src/application/services/ )", - "Bash(backend/services/authorization-service/src/domain/ )", - "Bash(backend/services/authorization-service/src/infrastructure/persistence/repositories/ )", - "Bash(backend/services/planting-service/src/application/services/planting-application.service.ts )", - "Bash(backend/services/planting-service/src/domain/services/fund-allocation.service.ts )", - "Bash(backend/services/planting-service/src/infrastructure/external/ )", - "Bash(backend/services/planting-service/src/infrastructure/infrastructure.module.ts )", - "Bash(backend/services/planting-service/src/infrastructure/persistence/prisma/prisma.service.ts )", - "Bash(backend/services/planting-service/src/infrastructure/persistence/unit-of-work.ts )", - "Bash(backend/services/referral-service/src/modules/api.module.ts )", - "Bash(backend/services/reward-service/src/infrastructure/external/authorization-service/authorization-service.client.ts )", - "Bash(backend/services/wallet-service/package.json )", - "Bash(backend/services/wallet-service/prisma/schema.prisma )", - "Bash(backend/services/wallet-service/src/)", - "Bash(git status:*)", - "Bash(git check-ignore:*)", - "Bash(docker inspect:*)", - "Bash(python -m json.tool:*)", - "Bash(docker logs:*)", - "Bash(curl:*)", - "Bash(git add:*)", - "Bash(git commit:*)", - "Bash(git push)", - "Bash(cat:*)" + "Bash(git -C \"c:\\Users\\dong\\Desktop\\rwadurian\" commit -m \"$(cat <<''EOF''\nfix(mobile-app): skip backup mnemonic page for MPC wallet mode\n\n- Fix mnemonic parsing: empty string \"\" now correctly becomes empty list\n- MPC mode (no mnemonic) skips backup page and navigates directly to home\n- Apply fix to both initial load and polling logic\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n\nCo-Authored-By: Claude \nEOF\n)\")", + "Bash(npx prisma:*)" ], "deny": [], "ask": [] diff --git a/backend/infrastructure/minio/.env b/backend/infrastructure/minio/.env deleted file mode 100644 index b7fc2018..00000000 --- a/backend/infrastructure/minio/.env +++ /dev/null @@ -1,102 +0,0 @@ -# ============================================================================= -# MinIO Object Storage - 环境配置 -# ============================================================================= -# -# 部署位置: 与 Kong, Nginx 同一服务器 (Server A: 192.168.1.100) -# 用途: 用户头像、文档、资源文件的对象存储 -# -# 网络拓扑: -# ┌─────────────────────────────────────────────────────────────────────────────┐ -# │ Server A (192.168.1.100) - Gateway & Storage │ -# ├─────────────────────────────────────────────────────────────────────────────┤ -# │ Nginx :80/443 - 反向代理 (SSL 终止) │ -# │ Kong :8000 - API 网关 │ -# │ MinIO API :9000 - S3 兼容 API │ -# │ MinIO Console:9001 - Web 管理控制台 │ -# └─────────────────────────────────────────────────────────────────────────────┘ -# -# 设置步骤: -# 1. 复制配置: cp .env.example .env -# 2. 修改密码: 必须修改 MINIO_ROOT_PASSWORD -# 3. 创建数据目录: sudo mkdir -p /data/minio && sudo chown -R 1000:1000 /data/minio -# 4. 启动服务: ./deploy.sh up -# -# ============================================================================= - -# ============================================================================= -# MinIO 认证配置 -# ============================================================================= -# 管理员用户名 (至少 3 个字符) -MINIO_ROOT_USER=admin - -# 管理员密码 (至少 8 个字符) -# ⚠️ 安全警告: 生产环境必须修改此密码! -# 生成安全密码: openssl rand -base64 32 -MINIO_ROOT_PASSWORD=change_me_to_secure_password - -# ============================================================================= -# MinIO 服务端口 -# ============================================================================= -# S3 API 端口 - 应用程序通过此端口上传下载文件 -MINIO_API_PORT=9000 - -# Web 控制台端口 - 管理员通过此端口管理 MinIO -MINIO_CONSOLE_PORT=9001 - -# ============================================================================= -# MinIO 服务器配置 -# ============================================================================= -# 区域设置 (用于 S3 兼容性) -MINIO_REGION=cn-east-1 - -# 控制台外部访问 URL (用于 Nginx 反向代理场景) -# 内网访问: http://192.168.1.100:9001 -# 外网访问: https://minio.szaiai.com -MINIO_CONSOLE_URL=http://localhost:9001 - -# ============================================================================= -# 数据存储配置 -# ============================================================================= -# 数据存储路径 (确保有足够的磁盘空间) -# 建议使用独立的数据盘 -MINIO_DATA_PATH=/data/minio - -# ============================================================================= -# 默认存储桶配置 -# ============================================================================= -# 用户头像存储桶 (公开读取) -BUCKET_AVATARS=avatars - -# 用户文档存储桶 (需要认证) -BUCKET_DOCUMENTS=documents - -# 应用资源文件存储桶 (公开读取) -BUCKET_RESOURCES=resources - -# 备份文件存储桶 (私有) -BUCKET_BACKUPS=backups - -# ============================================================================= -# 服务间通信配置 (供后端服务使用) -# ============================================================================= -# MinIO 内部端点 (后端服务访问) -# 在同一服务器: http://localhost:9000 -# 在不同服务器: http://192.168.1.100:9000 -MINIO_ENDPOINT=http://localhost:9000 - -# 公开访问 URL (前端直接访问静态资源) -# 通过 Nginx 代理: https://cdn.szaiai.com -# 直接访问: http://192.168.1.100:9000 -MINIO_PUBLIC_URL=http://localhost:9000 - -# ============================================================================= -# 网络配置 -# ============================================================================= -# 本机 IP (供其他服务连接) -MINIO_HOST_IP=192.168.1.100 - -# ============================================================================= -# 日志配置 -# ============================================================================= -# 日志级别: DEBUG, INFO, WARNING, ERROR -MINIO_LOG_LEVEL=INFO diff --git a/backend/infrastructure/minio/docker-compose.yml b/backend/infrastructure/minio/docker-compose.yml index ca4429bc..f721df9f 100644 --- a/backend/infrastructure/minio/docker-compose.yml +++ b/backend/infrastructure/minio/docker-compose.yml @@ -110,6 +110,10 @@ services: volumes: minio_data: driver: local + driver_opts: + type: none + o: bind + device: ${MINIO_DATA_PATH:-/data/minio} # ============================================================================= # Networks diff --git a/backend/services/.env.example b/backend/services/.env.example index fbfe9606..d40a7950 100644 --- a/backend/services/.env.example +++ b/backend/services/.env.example @@ -100,25 +100,6 @@ MPC_ACCOUNT_SERVICE_URL=http://192.168.1.111:4000 # SECURITY: Generate with: openssl rand -base64 48 MPC_JWT_SECRET=change_this_jwt_secret_key_to_random_value_min_32_chars -# ============================================================================= -# Blockchain Network Configuration -# ============================================================================= -# Network mode: mainnet or testnet -# - mainnet: Production networks (KAVA mainnet, BSC mainnet) -# - testnet: Test networks (KAVA testnet, BSC testnet) -NETWORK_MODE=mainnet - -# BSC Testnet faucet: https://testnet.bnbchain.org/faucet-smart -# KAVA Testnet faucet: https://faucet.kava.io - -# Optional: Override specific chain settings -# KAVA_RPC_URL=https://evm.kava.io -# KAVA_CHAIN_ID=2222 -# KAVA_USDT_CONTRACT=0x919C1c267BC06a7039e03fcc2eF738525769109c -# BSC_RPC_URL=https://bsc-dataseed.binance.org -# BSC_CHAIN_ID=56 -# BSC_USDT_CONTRACT=0x55d398326f99059fF775485246999027B3197955 - # ============================================================================= # MinIO Object Storage (Server A: 192.168.1.100) # ============================================================================= diff --git a/backend/services/mpc-service/src/application/services/event-consumer-starter.service.ts b/backend/services/mpc-service/src/application/services/event-consumer-starter.service.ts index f80f7f57..e7d4f092 100644 --- a/backend/services/mpc-service/src/application/services/event-consumer-starter.service.ts +++ b/backend/services/mpc-service/src/application/services/event-consumer-starter.service.ts @@ -14,12 +14,12 @@ export class EventConsumerStarterService implements OnApplicationBootstrap { constructor(private readonly eventConsumer: EventConsumerService) {} - onApplicationBootstrap() { - // Don't await - consumer.run() blocks until rebalance completes - // Let it run in background while HTTP server starts immediately - this.eventConsumer.startConsuming().catch((error) => { + async onApplicationBootstrap() { + try { + await this.eventConsumer.startConsuming(); + this.logger.log('MPC event consumers started successfully'); + } catch (error) { this.logger.error('Failed to start MPC event consumers', error); - }); - this.logger.log('MPC event consumers starting in background'); + } } } diff --git a/backend/services/referral-service/package-lock.json b/backend/services/referral-service/package-lock.json index 992179d3..e1e73d85 100644 --- a/backend/services/referral-service/package-lock.json +++ b/backend/services/referral-service/package-lock.json @@ -247,7 +247,6 @@ "integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/code-frame": "^7.27.1", "@babel/generator": "^7.28.5", diff --git a/tools/e2e_wallet_test.ps1 b/tools/e2e_wallet_test.ps1 deleted file mode 100644 index b7ae4e3a..00000000 --- a/tools/e2e_wallet_test.ps1 +++ /dev/null @@ -1,168 +0,0 @@ -# ============================================================================= -# E2E Test: Create Account and Wait for Wallet Ready (PowerShell) -# ============================================================================= -# -# This script simulates the mobile app flow: -# 1. Call POST /user/auto-create to create a new account -# 2. Poll GET /user/wallet until wallet is ready (has mnemonic and 3 addresses) -# -# Usage: .\e2e_wallet_test.ps1 [-BaseUrl "http://localhost:3000/api/v1"] -# ============================================================================= - -param( - [string]$BaseUrl = "http://localhost:3000/api/v1" -) - -$ErrorActionPreference = "Stop" - -# Configuration -$DeviceId = "test-device-$(Get-Date -Format 'yyyyMMddHHmmss')" -$MaxRetries = 60 -$RetryInterval = 5 - -Write-Host "==============================================" -Write-Host "E2E Wallet Creation Test" -Write-Host "==============================================" -Write-Host "Base URL: $BaseUrl" -Write-Host "Device ID: $DeviceId" -Write-Host "==============================================" -Write-Host "" - -# Step 1: Create Account -Write-Host "[Step 1] Creating account..." - -$CreateBody = @{ - deviceId = $DeviceId - deviceName = @{ - brand = "Test" - model = "E2E-Device" - platform = "android" - osVersion = "14" - } -} | ConvertTo-Json -Depth 3 - -try { - $CreateResponse = Invoke-RestMethod -Uri "$BaseUrl/user/auto-create" ` - -Method Post ` - -ContentType "application/json" ` - -Body $CreateBody -} catch { - Write-Host "❌ Failed to create account!" -ForegroundColor Red - Write-Host "Error: $($_.Exception.Message)" - exit 1 -} - -if (-not $CreateResponse.success) { - Write-Host "❌ Failed to create account!" -ForegroundColor Red - Write-Host "Error: $($CreateResponse.message)" - exit 1 -} - -$AccessToken = $CreateResponse.data.accessToken -$UserSerialNum = $CreateResponse.data.userSerialNum -$Username = $CreateResponse.data.username -$ReferralCode = $CreateResponse.data.referralCode - -Write-Host "✅ Account created successfully!" -ForegroundColor Green -Write-Host " User Serial Number: $UserSerialNum" -Write-Host " Username: $Username" -Write-Host " Referral Code: $ReferralCode" -Write-Host "" - -# Step 2: Poll Wallet Status -Write-Host "[Step 2] Polling wallet status..." -Write-Host " Max retries: $MaxRetries" -Write-Host " Retry interval: ${RetryInterval}s" -Write-Host "" - -$Headers = @{ - "Authorization" = "Bearer $AccessToken" - "Content-Type" = "application/json" -} - -$WalletReady = $false -$WalletResponse = $null - -for ($i = 1; $i -le $MaxRetries; $i++) { - try { - $WalletResponse = Invoke-RestMethod -Uri "$BaseUrl/user/wallet" ` - -Method Get ` - -Headers $Headers - } catch { - Write-Host "[Attempt $i/$MaxRetries] Error: $($_.Exception.Message)" -ForegroundColor Yellow - Start-Sleep -Seconds $RetryInterval - continue - } - - $WalletStatus = $WalletResponse.data.status - - Write-Host "[Attempt $i/$MaxRetries] Wallet status: $WalletStatus" - - if ($WalletStatus -eq "ready") { - $WalletReady = $true - break - } elseif ($WalletStatus -eq "failed") { - Write-Host "❌ Wallet generation failed!" -ForegroundColor Red - Write-Host "Error: $($WalletResponse.data.error)" - exit 1 - } - - # Still generating, wait and retry - Start-Sleep -Seconds $RetryInterval -} - -if (-not $WalletReady) { - Write-Host "❌ Timeout waiting for wallet to be ready!" -ForegroundColor Red - exit 1 -} - -Write-Host "" -Write-Host "==============================================" -Write-Host "✅ WALLET READY!" -ForegroundColor Green -Write-Host "==============================================" -Write-Host "" - -# Extract wallet data -$Mnemonic = $WalletResponse.data.mnemonic -$KavaAddress = $WalletResponse.data.walletAddresses.kava -$DstAddress = $WalletResponse.data.walletAddresses.dst -$BscAddress = $WalletResponse.data.walletAddresses.bsc - -Write-Host "📝 Mnemonic (12 words):" -ForegroundColor Cyan -Write-Host " $Mnemonic" -Write-Host "" -Write-Host "💰 Wallet Addresses:" -ForegroundColor Cyan -Write-Host " KAVA: $KavaAddress" -Write-Host " DST: $DstAddress" -Write-Host " BSC: $BscAddress" -Write-Host "" -Write-Host "==============================================" -Write-Host "Test completed successfully!" -ForegroundColor Green -Write-Host "==============================================" - -# Validate results -if ([string]::IsNullOrEmpty($Mnemonic)) { - Write-Host "⚠️ Warning: Mnemonic is empty" -ForegroundColor Yellow -} else { - $WordCount = ($Mnemonic -split '\s+').Count - if ($WordCount -ne 12) { - Write-Host "⚠️ Warning: Mnemonic word count is $WordCount (expected 12)" -ForegroundColor Yellow - } -} - -if ([string]::IsNullOrEmpty($KavaAddress) -or [string]::IsNullOrEmpty($DstAddress) -or [string]::IsNullOrEmpty($BscAddress)) { - Write-Host "⚠️ Warning: Some wallet addresses are missing" -ForegroundColor Yellow -} - -# Return summary object -return @{ - UserSerialNum = $UserSerialNum - Username = $Username - ReferralCode = $ReferralCode - Mnemonic = $Mnemonic - WalletAddresses = @{ - Kava = $KavaAddress - Dst = $DstAddress - Bsc = $BscAddress - } -} diff --git a/tools/e2e_wallet_test.sh b/tools/e2e_wallet_test.sh deleted file mode 100644 index d97a0abd..00000000 --- a/tools/e2e_wallet_test.sh +++ /dev/null @@ -1,140 +0,0 @@ -#!/bin/bash -# ============================================================================= -# E2E Test: Create Account and Wait for Wallet Ready -# ============================================================================= -# -# This script simulates the mobile app flow: -# 1. Call POST /user/auto-create to create a new account -# 2. Poll GET /user/wallet until wallet is ready (has mnemonic and 3 addresses) -# -# Usage: ./e2e_wallet_test.sh [BASE_URL] -# Default BASE_URL: http://localhost:3000/api/v1 -# ============================================================================= - -set -e - -# Configuration -BASE_URL="${1:-http://localhost:3000/api/v1}" -DEVICE_ID="test-device-$(date +%s)" -MAX_RETRIES=60 -RETRY_INTERVAL=5 - -echo "==============================================" -echo "E2E Wallet Creation Test" -echo "==============================================" -echo "Base URL: $BASE_URL" -echo "Device ID: $DEVICE_ID" -echo "==============================================" -echo "" - -# Step 1: Create Account -echo "[Step 1] Creating account..." -CREATE_RESPONSE=$(curl -s -X POST "${BASE_URL}/user/auto-create" \ - -H "Content-Type: application/json" \ - -d "{ - \"deviceId\": \"${DEVICE_ID}\", - \"deviceName\": { - \"brand\": \"Test\", - \"model\": \"E2E-Device\", - \"platform\": \"android\", - \"osVersion\": \"14\" - } - }") - -echo "Response: $CREATE_RESPONSE" -echo "" - -# Parse response -SUCCESS=$(echo "$CREATE_RESPONSE" | jq -r '.success // false') -if [ "$SUCCESS" != "true" ]; then - echo "❌ Failed to create account!" - echo "Error: $(echo "$CREATE_RESPONSE" | jq -r '.message // .error // "Unknown error"')" - exit 1 -fi - -ACCESS_TOKEN=$(echo "$CREATE_RESPONSE" | jq -r '.data.accessToken') -USER_SERIAL_NUM=$(echo "$CREATE_RESPONSE" | jq -r '.data.userSerialNum') -USERNAME=$(echo "$CREATE_RESPONSE" | jq -r '.data.username') -REFERRAL_CODE=$(echo "$CREATE_RESPONSE" | jq -r '.data.referralCode') - -echo "✅ Account created successfully!" -echo " User Serial Number: $USER_SERIAL_NUM" -echo " Username: $USERNAME" -echo " Referral Code: $REFERRAL_CODE" -echo "" - -# Step 2: Poll Wallet Status -echo "[Step 2] Polling wallet status..." -echo " Max retries: $MAX_RETRIES" -echo " Retry interval: ${RETRY_INTERVAL}s" -echo "" - -RETRY_COUNT=0 -WALLET_READY=false - -while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do - RETRY_COUNT=$((RETRY_COUNT + 1)) - - WALLET_RESPONSE=$(curl -s -X GET "${BASE_URL}/user/wallet" \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer ${ACCESS_TOKEN}") - - WALLET_STATUS=$(echo "$WALLET_RESPONSE" | jq -r '.data.status // "unknown"') - - echo "[Attempt $RETRY_COUNT/$MAX_RETRIES] Wallet status: $WALLET_STATUS" - - if [ "$WALLET_STATUS" == "ready" ]; then - WALLET_READY=true - break - elif [ "$WALLET_STATUS" == "failed" ]; then - echo "❌ Wallet generation failed!" - echo "Error: $(echo "$WALLET_RESPONSE" | jq -r '.data.error // "Unknown error"')" - exit 1 - fi - - # Still generating, wait and retry - sleep $RETRY_INTERVAL -done - -if [ "$WALLET_READY" != "true" ]; then - echo "❌ Timeout waiting for wallet to be ready!" - exit 1 -fi - -echo "" -echo "==============================================" -echo "✅ WALLET READY!" -echo "==============================================" -echo "" - -# Extract wallet data -MNEMONIC=$(echo "$WALLET_RESPONSE" | jq -r '.data.mnemonic // "N/A"') -KAVA_ADDRESS=$(echo "$WALLET_RESPONSE" | jq -r '.data.walletAddresses.kava // "N/A"') -DST_ADDRESS=$(echo "$WALLET_RESPONSE" | jq -r '.data.walletAddresses.dst // "N/A"') -BSC_ADDRESS=$(echo "$WALLET_RESPONSE" | jq -r '.data.walletAddresses.bsc // "N/A"') - -echo "📝 Mnemonic (12 words):" -echo " $MNEMONIC" -echo "" -echo "💰 Wallet Addresses:" -echo " KAVA: $KAVA_ADDRESS" -echo " DST: $DST_ADDRESS" -echo " BSC: $BSC_ADDRESS" -echo "" -echo "==============================================" -echo "Test completed successfully!" -echo "==============================================" - -# Validate results -if [ "$MNEMONIC" == "N/A" ] || [ -z "$MNEMONIC" ]; then - echo "⚠️ Warning: Mnemonic is empty or N/A" -fi - -WORD_COUNT=$(echo "$MNEMONIC" | wc -w) -if [ "$WORD_COUNT" -ne 12 ] && [ "$MNEMONIC" != "N/A" ] && [ -n "$MNEMONIC" ]; then - echo "⚠️ Warning: Mnemonic word count is $WORD_COUNT (expected 12)" -fi - -if [ "$KAVA_ADDRESS" == "N/A" ] || [ "$DST_ADDRESS" == "N/A" ] || [ "$BSC_ADDRESS" == "N/A" ]; then - echo "⚠️ Warning: Some wallet addresses are missing" -fi diff --git a/tools/mnemonic-test/node_modules/.package-lock.json b/tools/mnemonic-test/node_modules/.package-lock.json deleted file mode 100644 index 6522bb86..00000000 --- a/tools/mnemonic-test/node_modules/.package-lock.json +++ /dev/null @@ -1,305 +0,0 @@ -{ - "name": "mnemonic-test", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "node_modules/@adraffy/ens-normalize": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz", - "integrity": "sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==", - "license": "MIT" - }, - "node_modules/@cosmjs/crypto": { - "version": "0.37.0", - "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.37.0.tgz", - "integrity": "sha512-rjnU7SEgNTUQAUotG686m7ahYSWgHh3J6n2JXoWoHJz0uVv4o4P+pbAFklyQ1PcPIR7u6LezCKDB5tP5Y5PeYQ==", - "license": "Apache-2.0", - "dependencies": { - "@cosmjs/encoding": "^0.37.0", - "@cosmjs/math": "^0.37.0", - "@cosmjs/utils": "^0.37.0", - "@noble/ciphers": "^1.3.0", - "@noble/curves": "^1.9.2", - "@noble/hashes": "^1.8.0", - "@scure/bip39": "^1.6.0", - "hash-wasm": "^4.12.0" - } - }, - "node_modules/@cosmjs/encoding": { - "version": "0.37.0", - "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.37.0.tgz", - "integrity": "sha512-xtdC0w+iVFOrod9a5RLJULUECv+6AvZr5FkD8AFr2vD853n7Z89/AVuEiJzd4GdUwlPzxcaamhAtmI+IB9DYvg==", - "license": "Apache-2.0", - "dependencies": { - "@scure/base": "^2.0.0", - "base64-js": "^1.3.0", - "readonly-date": "^1.0.0" - } - }, - "node_modules/@cosmjs/math": { - "version": "0.37.0", - "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.37.0.tgz", - "integrity": "sha512-FI+Tq8mhW0tuDawRvPdyX3K7qDZD2v1keRhiK/zHisvtQVzqoRRoOS1g5P9Pc7gWLQ1jPS15gDMYBu5+UYJ1+g==", - "license": "Apache-2.0" - }, - "node_modules/@cosmjs/utils": { - "version": "0.37.0", - "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.37.0.tgz", - "integrity": "sha512-j46yZg+cLBpANGc5sCxtQHJgPGBt5zSKlU+KX9FlDS6JU6q2vZYCpKgucFFpjekEiMagU1eu8cDSCRjTthEM6w==", - "license": "Apache-2.0" - }, - "node_modules/@noble/ciphers": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-1.3.0.tgz", - "integrity": "sha512-2I0gnIVPtfnMw9ee9h1dJG7tp81+8Ob3OJb3Mv37rx5L40/b0i7djjCVvGOVqc9AEIQyvyu1i6ypKdFw8R8gQw==", - "license": "MIT", - "engines": { - "node": "^14.21.3 || >=16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "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/@scure/base": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@scure/base/-/base-2.0.0.tgz", - "integrity": "sha512-3E1kpuZginKkek01ovG8krQ0Z44E3DHPjc5S2rjJw9lZn3KSQOs8S7wqikF/AH7iRanHypj85uGyxk0XAyC37w==", - "license": "MIT", - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@scure/bip32": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-2.0.1.tgz", - "integrity": "sha512-4Md1NI5BzoVP+bhyJaY3K6yMesEFzNS1sE/cP+9nuvE7p/b0kx9XbpDHHFl8dHtufcbdHRUUQdRqLIPHN/s7yA==", - "license": "MIT", - "dependencies": { - "@noble/curves": "2.0.1", - "@noble/hashes": "2.0.1", - "@scure/base": "2.0.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@scure/bip32/node_modules/@noble/curves": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-2.0.1.tgz", - "integrity": "sha512-vs1Az2OOTBiP4q0pwjW5aF0xp9n4MxVrmkFBxc6EKZc6ddYx5gaZiAsZoq0uRRXWbi3AT/sBqn05eRPtn1JCPw==", - "license": "MIT", - "dependencies": { - "@noble/hashes": "2.0.1" - }, - "engines": { - "node": ">= 20.19.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@scure/bip32/node_modules/@noble/hashes": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-2.0.1.tgz", - "integrity": "sha512-XlOlEbQcE9fmuXxrVTXCTlG2nlRXa9Rj3rr5Ue/+tX+nmkgbX720YHh0VR3hBF9xDvwnb8D2shVGOwNx+ulArw==", - "license": "MIT", - "engines": { - "node": ">= 20.19.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@scure/bip39": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.6.0.tgz", - "integrity": "sha512-+lF0BbLiJNwVlev4eKelw1WWLaiKXw7sSl8T6FvBlWkdX+94aGJ4o8XjUdlyhTCjd8c+B3KT3JfS8P0bLRNU6A==", - "license": "MIT", - "dependencies": { - "@noble/hashes": "~1.8.0", - "@scure/base": "~1.2.5" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@scure/bip39/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/@types/node": { - "version": "22.7.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz", - "integrity": "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==", - "license": "MIT", - "dependencies": { - "undici-types": "~6.19.2" - } - }, - "node_modules/aes-js": { - "version": "4.0.0-beta.5", - "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-4.0.0-beta.5.tgz", - "integrity": "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==", - "license": "MIT" - }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "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/bip39": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/bip39/-/bip39-3.1.0.tgz", - "integrity": "sha512-c9kiwdk45Do5GL0vJMe7tS95VjCii65mYAH7DfWl3uW8AVzXKQVUm64i3hzVybBDMp9r7j9iNxR85+ul8MdN/A==", - "license": "ISC", - "dependencies": { - "@noble/hashes": "^1.2.0" - } - }, - "node_modules/ethers": { - "version": "6.16.0", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.16.0.tgz", - "integrity": "sha512-U1wulmetNymijEhpSEQ7Ct/P/Jw9/e7R1j5XIbPRydgV2DjLVMsULDlNksq3RQnFgKoLlZf88ijYtWEXcPa07A==", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/ethers-io/" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@adraffy/ens-normalize": "1.10.1", - "@noble/curves": "1.2.0", - "@noble/hashes": "1.3.2", - "@types/node": "22.7.5", - "aes-js": "4.0.0-beta.5", - "tslib": "2.7.0", - "ws": "8.17.1" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/ethers/node_modules/@noble/curves": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", - "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", - "license": "MIT", - "dependencies": { - "@noble/hashes": "1.3.2" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/ethers/node_modules/@noble/hashes": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", - "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", - "license": "MIT", - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/hash-wasm": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/hash-wasm/-/hash-wasm-4.12.0.tgz", - "integrity": "sha512-+/2B2rYLb48I/evdOIhP+K/DD2ca2fgBjp6O+GBEnCDk2e4rpeXIK8GvIyRPjTezgmWn9gmKwkQjjx6BtqDHVQ==", - "license": "MIT" - }, - "node_modules/readonly-date": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/readonly-date/-/readonly-date-1.0.0.tgz", - "integrity": "sha512-tMKIV7hlk0h4mO3JTmmVuIlJVXjKk3Sep9Bf5OH0O+758ruuVkUy2J9SttDLm91IEX/WHlXPSpxMGjPj4beMIQ==", - "license": "Apache-2.0" - }, - "node_modules/tslib": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", - "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", - "license": "0BSD" - }, - "node_modules/undici-types": { - "version": "6.19.8", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", - "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", - "license": "MIT" - }, - "node_modules/ws": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", - "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", - "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/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/LICENSE b/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/LICENSE deleted file mode 100644 index c8a213d0..00000000 --- a/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 Andrew Raffensperger - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/README.md b/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/README.md deleted file mode 100644 index 8cfe2b7e..00000000 --- a/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/README.md +++ /dev/null @@ -1,206 +0,0 @@ -# ens-normalize.js -0-dependancy [Ethereum Name Service](https://ens.domains/) (ENS) Name Normalizer. - -* 🏛️ Follows [ENSIP-15: ENS Name Normalization Standard](https://docs.ens.domains/ens-improvement-proposals/ensip-15-normalization-standard) - * Other implementations: - * Python — [namehash/ens-normalize-python](https://github.com/namehash/ens-normalize-python) - * C# — [adraffy/ENSNormalize.cs](https://github.com/adraffy/ENSNormalize.cs) - * Java — [adraffy/ENSNormalize.java](https://github.com/adraffy/ENSNormalize.java) - * Javascript — [ensdomains/eth-ens-namehash](https://github.com/ensdomains/eth-ens-namehash) - * [Breakdown Reports from ENSIP-1](https://adraffy.github.io/ens-norm-tests/test-breakdown/output-20230226/) -* ✅️ Passes **100%** [ENSIP-15 Validation Tests](https://adraffy.github.io/ens-normalize.js/test/validate.html) -* ✅️ Passes **100%** [Unicode Normalization Tests](https://adraffy.github.io/ens-normalize.js/test/report-nf.html) -* Minified File Sizes: - * [`28KB`](./dist/index-xnf.min.js) — native `NFC` via [nf-native.js](./src/nf-native.js) using `String.normalize()` ⚠️ - * [`37KB` **Default**](./dist/index.min.js) — custom `NFC` via [nf.js](./src/nf.js) - * [`43KB`](./dist/all.min.js) *Everything!* — custom `NFC` + sub-libraries: [parts.js](./src/parts.js), [utils.js](./src/utils.js) -* Included Apps: - * [**Resolver Demo**](https://adraffy.github.io/ens-normalize.js/test/resolver.html) ⭐ - * [Supported Emoji](https://adraffy.github.io/ens-normalize.js/test/emoji.html) - * [Character Viewer](https://adraffy.github.io/ens-normalize.js/test/chars.html) - * [Confused Explainer](https://adraffy.github.io/ens-normalize.js/test/confused.html) -* Related Projects: - * [Recent .eth Registrations](https://raffy.antistupid.com/eth/ens-regs.html) • [.eth Renews](https://raffy.antistupid.com/eth/ens-renews.html) - * [.eth Expirations](https://raffy.antistupid.com/eth/ens-exp.html) - * [Emoji Frequency Explorer](https://raffy.antistupid.com/eth/ens-emoji-freq.html) - * [ENS+NFT Matcher](https://raffy.antistupid.com/eth/ens-nft-matcher.html) - * [Batch Resolver](https://raffy.antistupid.com/eth/ens-batch-resolver.html) - * [Label Database](https://github.com/adraffy/ens-labels/) • [Labelhash⁻¹](https://adraffy.github.io/ens-labels/demo.html) - * [adraffy/punycode.js](https://github.com/adraffy/punycode.js/) • [Punycode Coder](https://adraffy.github.io/punycode.js/test/demo.html) - * [adraffy/keccak.js](https://github.com/adraffy/keccak.js/) • [Keccak Hasher](https://adraffy.github.io/keccak.js/test/demo.html) - * [adraffy/emoji.js](https://github.com/adraffy/emoji.js/) • [Emoji Parser](https://adraffy.github.io/emoji.js/test/demo.html) - -```js -import {ens_normalize} from '@adraffy/ens-normalize'; // or require() -// npm i @adraffy/ens-normalize -// browser: https://cdn.jsdelivr.net/npm/@adraffy/ens-normalize@latest/dist/index.min.mjs (or .cjs) - -// *** ALL errors thrown by this library are safe to print *** -// - characters are shown as {HEX} if should_escape() -// - potentially different bidi directions inside "quotes" -// - 200E is used near "quotes" to prevent spillover -// - an "error type" can be extracted by slicing up to the first (:) -// - labels are middle-truncated with ellipsis (…) at 63 cps - -// string -> string -// throws on invalid names -// output ready for namehash -let normalized = ens_normalize('RaFFY🚴‍♂️.eTh'); -// => "raffy🚴‍♂.eth" - -// note: does not enforce .eth registrar 3-character minimum -``` - -Format names with fully-qualified emoji: -```js -// works like ens_normalize() -// output ready for display -let pretty = ens_beautify('1⃣2⃣.eth'); -// => "1️⃣2️⃣.eth" - -// note: normalization is unchanged: -// ens_normalize(ens_beautify(x)) == ens_normalize(x) -``` - -Normalize name fragments for [substring search](./test/fragment.js): -```js -// these fragments fail ens_normalize() -// but will normalize fine as fragments -let frag1 = ens_normalize_fragment('AB--'); // expected error: label ext -let frag2 = ens_normalize_fragment('\u{303}'); // expected error: leading cm -let frag3 = ens_normalize_fragment('οо'); // expected error: mixture -``` - -Input-based tokenization: -```js -// string -> Token[] -// never throws -let tokens = ens_tokenize('_R💩\u{FE0F}a\u{FE0F}\u{304}\u{AD}./'); -// [ -// { type: 'valid', cp: [ 95 ] }, // valid (as-is) -// { -// type: 'mapped', -// cp: 82, // input -// cps: [ 114 ] // output -// }, -// { -// type: 'emoji', -// input: Emoji(2) [ 128169, 65039 ], // input -// emoji: [ 128169, 65039 ], // fully-qualified -// cps: Emoji(1) [ 128169 ] // output (normalized) -// }, -// { -// type: 'nfc', -// input: [ 97, 772 ], // input (before nfc) -// tokens0: [ // tokens (before nfc) -// { type: 'valid', cps: [ 97 ] }, -// { type: 'ignored', cp: 65039 }, -// { type: 'valid', cps: [ 772 ] } -// ], -// cps: [ 257 ], // output (after nfc) -// tokens: [ // tokens (after nfc) -// { type: 'valid', cps: [ 257 ] } -// ] -// }, -// { type: 'ignored', cp: 173 }, -// { type: 'stop', cp: 46 }, -// { type: 'disallowed', cp: 47 } -// ] - -// note: if name is normalizable, then: -// ens_normalize(ens_tokenize(name).map(token => { -// ** convert valid/mapped/nfc/stop to string ** -// }).join('')) == ens_normalize(name) -``` - -Output-based tokenization: -```js -// string -> Label[] -// never throws -let labels = ens_split('💩Raffy.eth_'); -// [ -// { -// input: [ 128169, 82, 97, 102, 102, 121 ], -// offset: 0, // index of codepoint, not substring index! -// // (corresponding length can be inferred from input) -// tokens: [ -// Emoji(2) [ 128169, 65039 ], // emoji -// [ 114, 97, 102, 102, 121 ] // nfc-text -// ], -// output: [ 128169, 114, 97, 102, 102, 121 ], -// emoji: true, -// type: 'Latin' -// }, -// { -// input: [ 101, 116, 104, 95 ], -// offset: 7, -// tokens: [ [ 101, 116, 104, 95 ] ], -// output: [ 101, 116, 104, 95 ], -// error: Error('underscore allowed only at start') -// } -// ] -``` - -Generate a sorted array of (beautified) supported emoji codepoints: -```js -// () -> number[][] -let emojis = ens_emoji(); -// [ -// [ 2764 ], -// [ 128169, 65039 ], -// [ 128105, 127997, 8205, 9877, 65039 ], -// ... -// ] -``` - -Determine if a character shouldn't be printed directly: -```js -// number -> bool -should_escape(0x202E); // eg. RIGHT-TO-LEFT OVERRIDE => true -``` - -Determine if a character is a combining mark: -```js -// number -> bool -is_combining_mark(0x20E3); // eg. COMBINING ENCLOSING KEYCAP => true -``` - -Format codepoints as print-safe string: -```js -// number[] -> string -safe_str_from_cps([0x300, 0, 32, 97]); // "◌̀{00} a" -safe_str_from_cps(Array(100).fill(97), 4); // "aa…aa" => middle-truncated -``` - -## Build - -* `git clone` this repo, then `npm install` -* Follow instructions in [/derive/](./derive/) to generate data files - * `npm run derive` - * [spec.json](./derive/output/spec.json) - * [nf.json](./derive/output/nf.json) - * [nf-tests.json](./derive/output/nf-tests.json) -* `npm run make` — compress data files from [/derive/output/](./derive/output/) - * [include-ens.js](./src/include-ens.js) - * [include-nf.js](./src/include-nf.js) - * [include-versions.js](./src/include-versions.js) -* Follow instructions in [/validate/](./validate/) to generate validation tests - * `npm run validate` - * [tests.json](./validate/tests.json) -* `npm run test` — perform validation tests -* `npm run build` — create [/dist/](./dist/) -* `npm run rebuild` — run all the commands above -* `npm run order` — create optimal group ordering and rebuild again - -### Publishing to NPM - -This project uses `.js` instead of `.mjs` so [package.json](./package.json) uses `type: module`. To avoid bundling issues, `type` is [dropped during packing](./src/prepost.js). `pre/post` hooks aren't used because they're buggy. -* `npm run pack` instead of `npm pack` -* `npm run pub` instead of `npm publish` - -## Security - -* [Build](#build) and compare against [include-versions.js](./src/include-versions.js) - * `spec_hash` — SHA-256 of [spec.json](./derive/output/spec.json) bytes - * `base64_ens_hash` — SHA-256 of [include-ens.js](./src/include-ens.js) base64 literal - * `base64_nf_hash` — SHA-256 of [include-nf.js](./src/include-nf.js) base64 literal diff --git a/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/dist/all.js b/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/dist/all.js deleted file mode 100644 index 95742105..00000000 --- a/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/dist/all.js +++ /dev/null @@ -1,1611 +0,0 @@ -// created 2023-09-25T01:01:55.148Z -// compressed base64-encoded blob for include-ens data -// source: https://github.com/adraffy/ens-normalize.js/blob/main/src/make.js -// see: https://github.com/adraffy/ens-normalize.js#security -// SHA-256: 0565ed049b9cf1614bb9e11ba7d8ac6a6fb96c893253d890f7e2b2884b9ded32 -var COMPRESSED$1 = 'AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0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otkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI'; -const FENCED = new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]); -const NSM_MAX = 4; - -function decode_arithmetic(bytes) { - let pos = 0; - function u16() { return (bytes[pos++] << 8) | bytes[pos++]; } - - // decode the frequency table - let symbol_count = u16(); - let total = 1; - let acc = [0, 1]; // first symbol has frequency 1 - for (let i = 1; i < symbol_count; i++) { - acc.push(total += u16()); - } - - // skip the sized-payload that the last 3 symbols index into - let skip = u16(); - let pos_payload = pos; - pos += skip; - - let read_width = 0; - let read_buffer = 0; - function read_bit() { - if (read_width == 0) { - // this will read beyond end of buffer - // but (undefined|0) => zero pad - read_buffer = (read_buffer << 8) | bytes[pos++]; - read_width = 8; - } - return (read_buffer >> --read_width) & 1; - } - - const N = 31; - const FULL = 2**N; - const HALF = FULL >>> 1; - const QRTR = HALF >> 1; - const MASK = FULL - 1; - - // fill register - let register = 0; - for (let i = 0; i < N; i++) register = (register << 1) | read_bit(); - - let symbols = []; - let low = 0; - let range = FULL; // treat like a float - while (true) { - let value = Math.floor((((register - low + 1) * total) - 1) / range); - let start = 0; - let end = symbol_count; - while (end - start > 1) { // binary search - let mid = (start + end) >>> 1; - if (value < acc[mid]) { - end = mid; - } else { - start = mid; - } - } - if (start == 0) break; // first symbol is end mark - symbols.push(start); - let a = low + Math.floor(range * acc[start] / total); - let b = low + Math.floor(range * acc[start+1] / total) - 1; - while (((a ^ b) & HALF) == 0) { - register = (register << 1) & MASK | read_bit(); - a = (a << 1) & MASK; - b = (b << 1) & MASK | 1; - } - while (a & ~b & QRTR) { - register = (register & HALF) | ((register << 1) & (MASK >>> 1)) | read_bit(); - a = (a << 1) ^ HALF; - b = ((b ^ HALF) << 1) | HALF | 1; - } - low = a; - range = 1 + b - a; - } - let offset = symbol_count - 4; - return symbols.map(x => { // index into payload - switch (x - offset) { - case 3: return offset + 0x10100 + ((bytes[pos_payload++] << 16) | (bytes[pos_payload++] << 8) | bytes[pos_payload++]); - case 2: return offset + 0x100 + ((bytes[pos_payload++] << 8) | bytes[pos_payload++]); - case 1: return offset + bytes[pos_payload++]; - default: return x - 1; - } - }); -} - -// returns an iterator which returns the next symbol -function read_payload(v) { - let pos = 0; - return () => v[pos++]; -} -function read_compressed_payload(s) { - return read_payload(decode_arithmetic(unsafe_atob(s))); -} - -// unsafe in the sense: -// expected well-formed Base64 w/o padding -// 20220922: added for https://github.com/adraffy/ens-normalize.js/issues/4 -function unsafe_atob(s) { - let lookup = []; - [...'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'].forEach((c, i) => lookup[c.charCodeAt(0)] = i); - let n = s.length; - let ret = new Uint8Array((6 * n) >> 3); - for (let i = 0, pos = 0, width = 0, carry = 0; i < n; i++) { - carry = (carry << 6) | lookup[s.charCodeAt(i)]; - width += 6; - if (width >= 8) { - ret[pos++] = (carry >> (width -= 8)); - } - } - return ret; -} - -// eg. [0,1,2,3...] => [0,-1,1,-2,...] -function signed(i) { - return (i & 1) ? (~i >> 1) : (i >> 1); -} - -function read_deltas(n, next) { - let v = Array(n); - for (let i = 0, x = 0; i < n; i++) v[i] = x += signed(next()); - return v; -} - -// [123][5] => [0 3] [1 1] [0 0] -function read_sorted(next, prev = 0) { - let ret = []; - while (true) { - let x = next(); - let n = next(); - if (!n) break; - prev += x; - for (let i = 0; i < n; i++) { - ret.push(prev + i); - } - prev += n + 1; - } - return ret; -} - -function read_sorted_arrays(next) { - return read_array_while(() => { - let v = read_sorted(next); - if (v.length) return v; - }); -} - -// returns map of x => ys -function read_mapped(next) { - let ret = []; - while (true) { - let w = next(); - if (w == 0) break; - ret.push(read_linear_table(w, next)); - } - while (true) { - let w = next() - 1; - if (w < 0) break; - ret.push(read_replacement_table(w, next)); - } - return ret.flat(); -} - -// read until next is falsy -// return array of read values -function read_array_while(next) { - let v = []; - while (true) { - let x = next(v.length); - if (!x) break; - v.push(x); - } - return v; -} - -// read w columns of length n -// return as n rows of length w -function read_transposed(n, w, next) { - let m = Array(n).fill().map(() => []); - for (let i = 0; i < w; i++) { - read_deltas(n, next).forEach((x, j) => m[j].push(x)); - } - return m; -} - -// returns [[x, ys], [x+dx, ys+dy], [x+2*dx, ys+2*dy], ...] -// where dx/dy = steps, n = run size, w = length of y -function read_linear_table(w, next) { - let dx = 1 + next(); - let dy = next(); - let vN = read_array_while(next); - let m = read_transposed(vN.length, 1+w, next); - return m.flatMap((v, i) => { - let [x, ...ys] = v; - return Array(vN[i]).fill().map((_, j) => { - let j_dy = j * dy; - return [x + j * dx, ys.map(y => y + j_dy)]; - }); - }); -} - -// return [[x, ys...], ...] -// where w = length of y -function read_replacement_table(w, next) { - let n = 1 + next(); - let m = read_transposed(n, 1+w, next); - return m.map(v => [v[0], v.slice(1)]); -} - - -function read_trie(next) { - let ret = []; - let sorted = read_sorted(next); - expand(decode([]), []); - return ret; // not sorted - function decode(Q) { // characters that lead into this node - let S = next(); // state: valid, save, check - let B = read_array_while(() => { // buckets leading to new nodes - let cps = read_sorted(next).map(i => sorted[i]); - if (cps.length) return decode(cps); - }); - return {S, B, Q}; - } - function expand({S, B}, cps, saved) { - if (S & 4 && saved === cps[cps.length-1]) return; - if (S & 2) saved = cps[cps.length-1]; - if (S & 1) ret.push(cps); - for (let br of B) { - for (let cp of br.Q) { - expand(br, [...cps, cp], saved); - } - } - } -} - -function hex_cp(cp) { - return cp.toString(16).toUpperCase().padStart(2, '0'); -} - -function quote_cp(cp) { - return `{${hex_cp(cp)}}`; // raffy convention: like "\u{X}" w/o the "\u" -} - -/* -export function explode_cp(s) { - return [...s].map(c => c.codePointAt(0)); -} -*/ -function explode_cp(s) { // this is about 2x faster - let cps = []; - for (let pos = 0, len = s.length; pos < len; ) { - let cp = s.codePointAt(pos); - pos += cp < 0x10000 ? 1 : 2; - cps.push(cp); - } - return cps; -} - -function str_from_cps(cps) { - const chunk = 4096; - let len = cps.length; - if (len < chunk) return String.fromCodePoint(...cps); - let buf = []; - for (let i = 0; i < len; ) { - buf.push(String.fromCodePoint(...cps.slice(i, i += chunk))); - } - return buf.join(''); -} - -function compare_arrays(a, b) { - let n = a.length; - let c = n - b.length; - for (let i = 0; c == 0 && i < n; i++) c = a[i] - b[i]; - return c; -} - -function random_choice(v, rng = Math.random) { - return v[rng() * v.length|0]; -} - -function random_sample(v, n, rng = Math.random) { - v = v.slice(); // make copy - if (v.length > n) { - for (let i = 0; i < n; i++) { // shuffle prefix n - let temp = v[i]; - let j = Math.floor(i + rng() * (v.length - i)); - v[i] = v[j]; - v[j] = temp; - } - v = v.slice(0, n); // truncate - } - return v; -} - -function run_tests(fn, tests) { - let errors = []; - for (let test of tests) { - let {name, norm, error} = test; - if (typeof norm !== 'string') norm = name; - try { - let result = fn(name); - if (error) { - errors.push({type: 'expected error', result, ...test}); - } else if (result != norm) { - errors.push({type: 'wrong norm', result, ...test}); - } - } catch (err) { - if (!error) { - errors.push({type: 'unexpected error', result: err.message, ...test}); - } - } - } - return errors; -} - -// created 2023-09-25T01:01:55.148Z -// compressed base64-encoded blob for include-nf data -// source: https://github.com/adraffy/ens-normalize.js/blob/main/src/make.js -// see: https://github.com/adraffy/ens-normalize.js#security -// SHA-256: a974b6f8541fc29d919bc85118af0a44015851fab5343f8679cb31be2bdb209e -var COMPRESSED = 'AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26PTQyy8FfEQ8AY8IPAGcEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiACnwRZEkkVsS7tANAsBG0RuAQLEPABv9HICTUBXigPZwRBApMDOwAamhtaABqEAY8KvKx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7eIRZUA6k3RYR3iFSK9c4iDdNwJuZL2FKz/IK5VimcNWEqdXjSoxSgmF0UPlDoUlNrPcM7ftmA8Y9gKiqKEHuWN+AZRIwtVSxye2Kf8rM3lhJ5XcBXU9n4v0Oy1RU2M+4qM8AQPVwse8ErNSob5oFPWxuqZnVzo1qB/IBxkM3EVUKFUUlO3e51259GgNcJbCmlvrdjtoTW7rChm1wyCKzpCTwozUUEOIcWLneRLgMXh+SjGSFkAllzbGS5HK7LlfCMRNRDSvbQPjcXaenNYxCvu2Qyznz6StuxVj66SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g'; - -// https://unicode.org/reports/tr15/ -// for reference implementation -// see: /derive/nf.js - - -// algorithmic hangul -// https://www.unicode.org/versions/Unicode15.0.0/ch03.pdf (page 144) -const S0 = 0xAC00; -const L0 = 0x1100; -const V0 = 0x1161; -const T0 = 0x11A7; -const L_COUNT = 19; -const V_COUNT = 21; -const T_COUNT = 28; -const N_COUNT = V_COUNT * T_COUNT; -const S_COUNT = L_COUNT * N_COUNT; -const S1 = S0 + S_COUNT; -const L1 = L0 + L_COUNT; -const V1 = V0 + V_COUNT; -const T1 = T0 + T_COUNT; - -function unpack_cc(packed) { - return (packed >> 24) & 0xFF; -} -function unpack_cp(packed) { - return packed & 0xFFFFFF; -} - -let SHIFTED_RANK, EXCLUSIONS, DECOMP, RECOMP; - -function init$1() { - //console.time('nf'); - let r = read_compressed_payload(COMPRESSED); - SHIFTED_RANK = new Map(read_sorted_arrays(r).flatMap((v, i) => v.map(x => [x, (i+1) << 24]))); // pre-shifted - EXCLUSIONS = new Set(read_sorted(r)); - DECOMP = new Map(); - RECOMP = new Map(); - for (let [cp, cps] of read_mapped(r)) { - if (!EXCLUSIONS.has(cp) && cps.length == 2) { - let [a, b] = cps; - let bucket = RECOMP.get(a); - if (!bucket) { - bucket = new Map(); - RECOMP.set(a, bucket); - } - bucket.set(b, cp); - } - DECOMP.set(cp, cps.reverse()); // stored reversed - } - //console.timeEnd('nf'); - // 20230905: 11ms -} - -function is_hangul(cp) { - return cp >= S0 && cp < S1; -} - -function compose_pair(a, b) { - if (a >= L0 && a < L1 && b >= V0 && b < V1) { - return S0 + (a - L0) * N_COUNT + (b - V0) * T_COUNT; - } else if (is_hangul(a) && b > T0 && b < T1 && (a - S0) % T_COUNT == 0) { - return a + (b - T0); - } else { - let recomp = RECOMP.get(a); - if (recomp) { - recomp = recomp.get(b); - if (recomp) { - return recomp; - } - } - return -1; - } -} - -function decomposed(cps) { - if (!SHIFTED_RANK) init$1(); - let ret = []; - let buf = []; - let check_order = false; - function add(cp) { - let cc = SHIFTED_RANK.get(cp); - if (cc) { - check_order = true; - cp |= cc; - } - ret.push(cp); - } - for (let cp of cps) { - while (true) { - if (cp < 0x80) { - ret.push(cp); - } else if (is_hangul(cp)) { - let s_index = cp - S0; - let l_index = s_index / N_COUNT | 0; - let v_index = (s_index % N_COUNT) / T_COUNT | 0; - let t_index = s_index % T_COUNT; - add(L0 + l_index); - add(V0 + v_index); - if (t_index > 0) add(T0 + t_index); - } else { - let mapped = DECOMP.get(cp); - if (mapped) { - buf.push(...mapped); - } else { - add(cp); - } - } - if (!buf.length) break; - cp = buf.pop(); - } - } - if (check_order && ret.length > 1) { - let prev_cc = unpack_cc(ret[0]); - for (let i = 1; i < ret.length; i++) { - let cc = unpack_cc(ret[i]); - if (cc == 0 || prev_cc <= cc) { - prev_cc = cc; - continue; - } - let j = i-1; - while (true) { - let tmp = ret[j+1]; - ret[j+1] = ret[j]; - ret[j] = tmp; - if (!j) break; - prev_cc = unpack_cc(ret[--j]); - if (prev_cc <= cc) break; - } - prev_cc = unpack_cc(ret[i]); - } - } - return ret; -} - -function composed_from_decomposed(v) { - let ret = []; - let stack = []; - let prev_cp = -1; - let prev_cc = 0; - for (let packed of v) { - let cc = unpack_cc(packed); - let cp = unpack_cp(packed); - if (prev_cp == -1) { - if (cc == 0) { - prev_cp = cp; - } else { - ret.push(cp); - } - } else if (prev_cc > 0 && prev_cc >= cc) { - if (cc == 0) { - ret.push(prev_cp, ...stack); - stack.length = 0; - prev_cp = cp; - } else { - stack.push(cp); - } - prev_cc = cc; - } else { - let composed = compose_pair(prev_cp, cp); - if (composed >= 0) { - prev_cp = composed; - } else if (prev_cc == 0 && cc == 0) { - ret.push(prev_cp); - prev_cp = cp; - } else { - stack.push(cp); - prev_cc = cc; - } - } - } - if (prev_cp >= 0) { - ret.push(prev_cp, ...stack); - } - return ret; -} - -// note: cps can be iterable -function nfd(cps) { - return decomposed(cps).map(unpack_cp); -} -function nfc(cps) { - return composed_from_decomposed(decomposed(cps)); -} - -const HYPHEN = 0x2D; -const STOP = 0x2E; -const STOP_CH = '.'; -const FE0F = 0xFE0F; -const UNIQUE_PH = 1; - -// 20230913: replace [...v] with Array_from(v) to avoid large spreads -const Array_from = x => Array.from(x); // Array.from.bind(Array); - -function group_has_cp(g, cp) { - // 20230913: keep primary and secondary distinct instead of creating valid union - return g.P.has(cp) || g.Q.has(cp); -} - -class Emoji extends Array { - get is_emoji() { return true; } // free tagging system -} - -let MAPPED, IGNORED, CM, NSM, ESCAPE, NFC_CHECK, GROUPS, WHOLE_VALID, WHOLE_MAP, VALID, EMOJI_LIST, EMOJI_ROOT; - -function init() { - if (MAPPED) return; - - let r = read_compressed_payload(COMPRESSED$1); - const read_sorted_array = () => read_sorted(r); - const read_sorted_set = () => new Set(read_sorted_array()); - const set_add_many = (set, v) => v.forEach(x => set.add(x)); - - MAPPED = new Map(read_mapped(r)); - IGNORED = read_sorted_set(); // ignored characters are not valid, so just read raw codepoints - - /* - // direct include from payload is smaller than the decompression code - const FENCED = new Map(read_array_while(() => { - let cp = r(); - if (cp) return [cp, read_str(r())]; - })); - */ - // 20230217: we still need all CM for proper error formatting - // but norm only needs NSM subset that are potentially-valid - CM = read_sorted_array(); - NSM = new Set(read_sorted_array().map(i => CM[i])); - CM = new Set(CM); - - ESCAPE = read_sorted_set(); // characters that should not be printed - NFC_CHECK = read_sorted_set(); // only needed to illustrate ens_tokenize() transformations - - let chunks = read_sorted_arrays(r); - let unrestricted = r(); - //const read_chunked = () => new Set(read_sorted_array().flatMap(i => chunks[i]).concat(read_sorted_array())); - const read_chunked = () => { - // 20230921: build set in parts, 2x faster - let set = new Set(); - read_sorted_array().forEach(i => set_add_many(set, chunks[i])); - set_add_many(set, read_sorted_array()); - return set; - }; - GROUPS = read_array_while(i => { - // minifier property mangling seems unsafe - // so these are manually renamed to single chars - let N = read_array_while(r).map(x => x+0x60); - if (N.length) { - let R = i >= unrestricted; // unrestricted then restricted - N[0] -= 32; // capitalize - N = str_from_cps(N); - if (R) N=`Restricted[${N}]`; - let P = read_chunked(); // primary - let Q = read_chunked(); // secondary - let M = !r(); // not-whitelisted, check for NSM - // *** this code currently isn't needed *** - /* - let V = [...P, ...Q].sort((a, b) => a-b); // derive: sorted valid - let M = r()-1; // number of combining mark - if (M < 0) { // whitelisted - M = new Map(read_array_while(() => { - let i = r(); - if (i) return [V[i-1], read_array_while(() => { - let v = read_array_while(r); - if (v.length) return v.map(x => x-1); - })]; - })); - }*/ - return {N, P, Q, M, R}; - } - }); - - // decode compressed wholes - WHOLE_VALID = read_sorted_set(); - WHOLE_MAP = new Map(); - let wholes = read_sorted_array().concat(Array_from(WHOLE_VALID)).sort((a, b) => a-b); // must be sorted - wholes.forEach((cp, i) => { - let d = r(); - let w = wholes[i] = d ? wholes[i-d] : {V: [], M: new Map()}; - w.V.push(cp); // add to member set - if (!WHOLE_VALID.has(cp)) { - WHOLE_MAP.set(cp, w); // register with whole map - } - }); - - // compute confusable-extent complements - // usage: WHOLE_MAP.get(cp).M.get(cp) = complement set - for (let {V, M} of new Set(WHOLE_MAP.values())) { - // connect all groups that have each whole character - let recs = []; - for (let cp of V) { - let gs = GROUPS.filter(g => group_has_cp(g, cp)); - let rec = recs.find(({G}) => gs.some(g => G.has(g))); - if (!rec) { - rec = {G: new Set(), V: []}; - recs.push(rec); - } - rec.V.push(cp); - set_add_many(rec.G, gs); - } - // per character cache groups which are not a member of the extent - let union = recs.flatMap(x => Array_from(x.G)); // all of the groups used by this whole - for (let {G, V} of recs) { - let complement = new Set(union.filter(g => !G.has(g))); // groups not covered by the extent - for (let cp of V) { - M.set(cp, complement); // this is the same reference - } - } - } - - // compute valid set - // 20230924: VALID was union but can be re-used - VALID = new Set(); // exists in 1+ groups - let multi = new Set(); // exists in 2+ groups - const add_to_union = cp => VALID.has(cp) ? multi.add(cp) : VALID.add(cp); - for (let g of GROUPS) { - for (let cp of g.P) add_to_union(cp); - for (let cp of g.Q) add_to_union(cp); - } - // dual purpose WHOLE_MAP: return placeholder if unique non-confusable - for (let cp of VALID) { - if (!WHOLE_MAP.has(cp) && !multi.has(cp)) { - WHOLE_MAP.set(cp, UNIQUE_PH); - } - } - // add all decomposed parts - // see derive: "Valid is Closed (via Brute-force)" - set_add_many(VALID, nfd(VALID)); - - // decode emoji - // 20230719: emoji are now fully-expanded to avoid quirk logic - EMOJI_LIST = read_trie(r).map(v => Emoji.from(v)).sort(compare_arrays); - EMOJI_ROOT = new Map(); // this has approx 7K nodes (2+ per emoji) - for (let cps of EMOJI_LIST) { - // 20230719: change to *slightly* stricter algorithm which disallows - // insertion of misplaced FE0F in emoji sequences (matching ENSIP-15) - // example: beautified [A B] (eg. flag emoji) - // before: allow: [A FE0F B], error: [A FE0F FE0F B] - // after: error: both - // note: this code now matches ENSNormalize.{cs,java} logic - let prev = [EMOJI_ROOT]; - for (let cp of cps) { - let next = prev.map(node => { - let child = node.get(cp); - if (!child) { - // should this be object? - // (most have 1-2 items, few have many) - // 20230719: no, v8 default map is 4? - child = new Map(); - node.set(cp, child); - } - return child; - }); - if (cp === FE0F) { - prev.push(...next); // less than 20 elements - } else { - prev = next; - } - } - for (let x of prev) { - x.V = cps; - } - } -} - -// if escaped: {HEX} -// else: "x" {HEX} -function quoted_cp(cp) { - return (should_escape(cp) ? '' : `${bidi_qq(safe_str_from_cps([cp]))} `) + quote_cp(cp); -} - -// 20230211: some messages can be mixed-directional and result in spillover -// use 200E after a quoted string to force the remainder of a string from -// acquring the direction of the quote -// https://www.w3.org/International/questions/qa-bidi-unicode-controls#exceptions -function bidi_qq(s) { - return `"${s}"\u200E`; // strong LTR -} - -function check_label_extension(cps) { - if (cps.length >= 4 && cps[2] == HYPHEN && cps[3] == HYPHEN) { - throw new Error(`invalid label extension: "${str_from_cps(cps.slice(0, 4))}"`); // this can only be ascii so cant be bidi - } -} -function check_leading_underscore(cps) { - const UNDERSCORE = 0x5F; - for (let i = cps.lastIndexOf(UNDERSCORE); i > 0; ) { - if (cps[--i] !== UNDERSCORE) { - throw new Error('underscore allowed only at start'); - } - } -} -// check that a fenced cp is not leading, trailing, or touching another fenced cp -function check_fenced(cps) { - let cp = cps[0]; - let prev = FENCED.get(cp); - if (prev) throw error_placement(`leading ${prev}`); - let n = cps.length; - let last = -1; // prevents trailing from throwing - for (let i = 1; i < n; i++) { - cp = cps[i]; - let match = FENCED.get(cp); - if (match) { - // since cps[0] isn't fenced, cps[1] cannot throw - if (last == i) throw error_placement(`${prev} + ${match}`); - last = i + 1; - prev = match; - } - } - if (last == n) throw error_placement(`trailing ${prev}`); -} - -// create a safe to print string -// invisibles are escaped -// leading cm uses placeholder -// if cps exceed max, middle truncate with ellipsis -// quoter(cp) => string, eg. 3000 => "{3000}" -// note: in html, you'd call this function then replace [<>&] with entities -function safe_str_from_cps(cps, max = Infinity, quoter = quote_cp) { - //if (Number.isInteger(cps)) cps = [cps]; - //if (!Array.isArray(cps)) throw new TypeError(`expected codepoints`); - let buf = []; - if (is_combining_mark(cps[0])) buf.push('◌'); - if (cps.length > max) { - max >>= 1; - cps = [...cps.slice(0, max), 0x2026, ...cps.slice(-max)]; - } - let prev = 0; - let n = cps.length; - for (let i = 0; i < n; i++) { - let cp = cps[i]; - if (should_escape(cp)) { - buf.push(str_from_cps(cps.slice(prev, i))); - buf.push(quoter(cp)); - prev = i + 1; - } - } - buf.push(str_from_cps(cps.slice(prev, n))); - return buf.join(''); -} - -// note: set(s) cannot be exposed because they can be modified -// note: Object.freeze() doesn't work -function is_combining_mark(cp) { - init(); - return CM.has(cp); -} -function should_escape(cp) { - init(); - return ESCAPE.has(cp); -} - -// return all supported emoji as fully-qualified emoji -// ordered by length then lexicographic -function ens_emoji() { - init(); - return EMOJI_LIST.map(x => x.slice()); // emoji are exposed so copy -} - -function ens_normalize_fragment(frag, decompose) { - init(); - let nf = decompose ? nfd : nfc; - return frag.split(STOP_CH).map(label => str_from_cps(tokens_from_str(explode_cp(label), nf, filter_fe0f).flat())).join(STOP_CH); -} - -function ens_normalize(name) { - return flatten(split(name, nfc, filter_fe0f)); -} - -function ens_beautify(name) { - let labels = split(name, nfc, x => x); // emoji not exposed - for (let {type, output, error} of labels) { - if (error) break; // flatten will throw - - // replace leading/trailing hyphen - // 20230121: consider beautifing all or leading/trailing hyphen to unicode variant - // not exactly the same in every font, but very similar: "-" vs "‐" - /* - const UNICODE_HYPHEN = 0x2010; - // maybe this should replace all for visual consistancy? - // `node tools/reg-count.js regex ^-\{2,\}` => 592 - //for (let i = 0; i < output.length; i++) if (output[i] == 0x2D) output[i] = 0x2010; - if (output[0] == HYPHEN) output[0] = UNICODE_HYPHEN; - let end = output.length-1; - if (output[end] == HYPHEN) output[end] = UNICODE_HYPHEN; - */ - // 20230123: WHATWG URL uses "CheckHyphens" false - // https://url.spec.whatwg.org/#idna - - // update ethereum symbol - // ξ => Ξ if not greek - if (type !== 'Greek') array_replace(output, 0x3BE, 0x39E); - - // 20221213: fixes bidi subdomain issue, but breaks invariant (200E is disallowed) - // could be fixed with special case for: 2D (.) + 200E (LTR) - // https://discuss.ens.domains/t/bidi-label-ordering-spoof/15824 - //output.splice(0, 0, 0x200E); - } - return flatten(labels); -} - -function array_replace(v, a, b) { - let prev = 0; - while (true) { - let next = v.indexOf(a, prev); - if (next < 0) break; - v[next] = b; - prev = next + 1; - } -} - -function ens_split(name, preserve_emoji) { - return split(name, nfc, preserve_emoji ? x => x.slice() : filter_fe0f); // emoji are exposed so copy -} - -function split(name, nf, ef) { - if (!name) return []; // 20230719: empty name allowance - init(); - let offset = 0; - // https://unicode.org/reports/tr46/#Validity_Criteria - // 4.) "The label must not contain a U+002E ( . ) FULL STOP." - return name.split(STOP_CH).map(label => { - let input = explode_cp(label); - let info = { - input, - offset, // codepoint, not substring! - }; - offset += input.length + 1; // + stop - try { - // 1.) "The label must be in Unicode Normalization Form NFC" - let tokens = info.tokens = tokens_from_str(input, nf, ef); - let token_count = tokens.length; - let type; - if (!token_count) { // the label was effectively empty (could of had ignored characters) - //norm = []; - //type = 'None'; // use this instead of next match, "ASCII" - // 20230120: change to strict - // https://discuss.ens.domains/t/ens-name-normalization-2nd/14564/59 - throw new Error(`empty label`); - } - let norm = info.output = tokens.flat(); - check_leading_underscore(norm); - let emoji = info.emoji = token_count > 1 || tokens[0].is_emoji; // same as: tokens.some(x => x.is_emoji); - if (!emoji && norm.every(cp => cp < 0x80)) { // special case for ascii - // 20230123: matches matches WHATWG, see note 3.3 - check_label_extension(norm); // only needed for ascii - // cant have fenced - // cant have cm - // cant have wholes - // see derive: "Fastpath ASCII" - type = 'ASCII'; - } else { - let chars = tokens.flatMap(x => x.is_emoji ? [] : x); // all of the nfc tokens concat together - if (!chars.length) { // theres no text, just emoji - type = 'Emoji'; - } else { - // 5.) "The label must not begin with a combining mark, that is: General_Category=Mark." - if (CM.has(norm[0])) throw error_placement('leading combining mark'); - for (let i = 1; i < token_count; i++) { // we've already checked the first token - let cps = tokens[i]; - if (!cps.is_emoji && CM.has(cps[0])) { // every text token has emoji neighbors, eg. EtEEEtEt... - // bidi_qq() not needed since emoji is LTR and cps is a CM - throw error_placement(`emoji + combining mark: "${str_from_cps(tokens[i-1])} + ${safe_str_from_cps([cps[0]])}"`); - } - } - check_fenced(norm); - let unique = Array_from(new Set(chars)); - let [g] = determine_group(unique); // take the first match - // see derive: "Matching Groups have Same CM Style" - // alternative: could form a hybrid type: Latin/Japanese/... - check_group(g, chars); // need text in order - check_whole(g, unique); // only need unique text (order would be required for multiple-char confusables) - type = g.N; - // 20230121: consider exposing restricted flag - // it's simpler to just check for 'Restricted' - // or even better: type.endsWith(']') - //if (g.R) info.restricted = true; - } - } - info.type = type; - } catch (err) { - info.error = err; // use full error object - } - return info; - }); -} - -function check_whole(group, unique) { - let maker; - let shared = []; - for (let cp of unique) { - let whole = WHOLE_MAP.get(cp); - if (whole === UNIQUE_PH) return; // unique, non-confusable - if (whole) { - let set = whole.M.get(cp); // groups which have a character that look-like this character - maker = maker ? maker.filter(g => set.has(g)) : Array_from(set); - if (!maker.length) return; // confusable intersection is empty - } else { - shared.push(cp); - } - } - if (maker) { - // we have 1+ confusable - // check if any of the remaining groups - // contain the shared characters too - for (let g of maker) { - if (shared.every(cp => group_has_cp(g, cp))) { - throw new Error(`whole-script confusable: ${group.N}/${g.N}`); - } - } - } -} - -// assumption: unique.size > 0 -// returns list of matching groups -function determine_group(unique) { - let groups = GROUPS; - for (let cp of unique) { - // note: we need to dodge CM that are whitelisted - // but that code isn't currently necessary - let gs = groups.filter(g => group_has_cp(g, cp)); - if (!gs.length) { - if (!GROUPS.some(g => group_has_cp(g, cp))) { - // the character was composed of valid parts - // but it's NFC form is invalid - // 20230716: change to more exact statement, see: ENSNormalize.{cs,java} - // note: this doesn't have to be a composition - // 20230720: change to full check - throw error_disallowed(cp); // this should be rare - } else { - // there is no group that contains all these characters - // throw using the highest priority group that matched - // https://www.unicode.org/reports/tr39/#mixed_script_confusables - throw error_group_member(groups[0], cp); - } - } - groups = gs; - if (gs.length == 1) break; // there is only one group left - } - // there are at least 1 group(s) with all of these characters - return groups; -} - -// throw on first error -function flatten(split) { - return split.map(({input, error, output}) => { - if (error) { - // don't print label again if just a single label - let msg = error.message; - // bidi_qq() only necessary if msg is digits - throw new Error(split.length == 1 ? msg : `Invalid label ${bidi_qq(safe_str_from_cps(input, 63))}: ${msg}`); - } - return str_from_cps(output); - }).join(STOP_CH); -} - -function error_disallowed(cp) { - // TODO: add cp to error? - return new Error(`disallowed character: ${quoted_cp(cp)}`); -} -function error_group_member(g, cp) { - let quoted = quoted_cp(cp); - let gg = GROUPS.find(g => g.P.has(cp)); // only check primary - if (gg) { - quoted = `${gg.N} ${quoted}`; - } - return new Error(`illegal mixture: ${g.N} + ${quoted}`); -} -function error_placement(where) { - return new Error(`illegal placement: ${where}`); -} - -// assumption: cps.length > 0 -// assumption: cps[0] isn't a CM -// assumption: the previous character isn't an emoji -function check_group(g, cps) { - for (let cp of cps) { - if (!group_has_cp(g, cp)) { - // for whitelisted scripts, this will throw illegal mixture on invalid cm, eg. "e{300}{300}" - // at the moment, it's unnecessary to introduce an extra error type - // until there exists a whitelisted multi-character - // eg. if (M < 0 && is_combining_mark(cp)) { ... } - // there are 3 cases: - // 1. illegal cm for wrong group => mixture error - // 2. illegal cm for same group => cm error - // requires set of whitelist cm per group: - // eg. new Set([...g.P, ...g.Q].flatMap(nfc).filter(cp => CM.has(cp))) - // 3. wrong group => mixture error - throw error_group_member(g, cp); - } - } - //if (M >= 0) { // we have a known fixed cm count - if (g.M) { // we need to check for NSM - let decomposed = nfd(cps); - for (let i = 1, e = decomposed.length; i < e; i++) { // see: assumption - // 20230210: bugfix: using cps instead of decomposed h/t Carbon225 - /* - if (CM.has(decomposed[i])) { - let j = i + 1; - while (j < e && CM.has(decomposed[j])) j++; - if (j - i > M) { - throw new Error(`too many combining marks: ${g.N} ${bidi_qq(str_from_cps(decomposed.slice(i-1, j)))} (${j-i}/${M})`); - } - i = j; - } - */ - // 20230217: switch to NSM counting - // https://www.unicode.org/reports/tr39/#Optional_Detection - if (NSM.has(decomposed[i])) { - let j = i + 1; - for (let cp; j < e && NSM.has(cp = decomposed[j]); j++) { - // a. Forbid sequences of the same nonspacing mark. - for (let k = i; k < j; k++) { // O(n^2) but n < 100 - if (decomposed[k] == cp) { - throw new Error(`duplicate non-spacing marks: ${quoted_cp(cp)}`); - } - } - } - // parse to end so we have full nsm count - // b. Forbid sequences of more than 4 nonspacing marks (gc=Mn or gc=Me). - if (j - i > NSM_MAX) { - // note: this slice starts with a base char or spacing-mark cm - throw new Error(`excessive non-spacing marks: ${bidi_qq(safe_str_from_cps(decomposed.slice(i-1, j)))} (${j-i}/${NSM_MAX})`); - } - i = j; - } - } - } - // *** this code currently isn't needed *** - /* - let cm_whitelist = M instanceof Map; - for (let i = 0, e = cps.length; i < e; ) { - let cp = cps[i++]; - let seqs = cm_whitelist && M.get(cp); - if (seqs) { - // list of codepoints that can follow - // if this exists, this will always be 1+ - let j = i; - while (j < e && CM.has(cps[j])) j++; - let cms = cps.slice(i, j); - let match = seqs.find(seq => !compare_arrays(seq, cms)); - if (!match) throw new Error(`disallowed combining mark sequence: "${safe_str_from_cps([cp, ...cms])}"`); - i = j; - } else if (!V.has(cp)) { - // https://www.unicode.org/reports/tr39/#mixed_script_confusables - let quoted = quoted_cp(cp); - for (let cp of cps) { - let u = UNIQUE.get(cp); - if (u && u !== g) { - // if both scripts are restricted this error is confusing - // because we don't differentiate RestrictedA from RestrictedB - if (!u.R) quoted = `${quoted} is ${u.N}`; - break; - } - } - throw new Error(`disallowed ${g.N} character: ${quoted}`); - //throw new Error(`disallowed character: ${quoted} (expected ${g.N})`); - //throw new Error(`${g.N} does not allow: ${quoted}`); - } - } - if (!cm_whitelist) { - let decomposed = nfd(cps); - for (let i = 1, e = decomposed.length; i < e; i++) { // we know it can't be cm leading - if (CM.has(decomposed[i])) { - let j = i + 1; - while (j < e && CM.has(decomposed[j])) j++; - if (j - i > M) { - throw new Error(`too many combining marks: "${str_from_cps(decomposed.slice(i-1, j))}" (${j-i}/${M})`); - } - i = j; - } - } - } - */ -} - -// given a list of codepoints -// returns a list of lists, where emoji are a fully-qualified (as Array subclass) -// eg. explode_cp("abc💩d") => [[61, 62, 63], Emoji[1F4A9, FE0F], [64]] -// 20230818: rename for 'process' name collision h/t Javarome -// https://github.com/adraffy/ens-normalize.js/issues/23 -function tokens_from_str(input, nf, ef) { - let ret = []; - let chars = []; - input = input.slice().reverse(); // flip so we can pop - while (input.length) { - let emoji = consume_emoji_reversed(input); - if (emoji) { - if (chars.length) { - ret.push(nf(chars)); - chars = []; - } - ret.push(ef(emoji)); - } else { - let cp = input.pop(); - if (VALID.has(cp)) { - chars.push(cp); - } else { - let cps = MAPPED.get(cp); - if (cps) { - chars.push(...cps); // less than 10 elements - } else if (!IGNORED.has(cp)) { - // 20230912: unicode 15.1 changed the order of processing such that - // disallowed parts are only rejected after NFC - // https://unicode.org/reports/tr46/#Validity_Criteria - // this doesn't impact normalization as of today - // technically, this error can be removed as the group logic will apply similar logic - // however the error type might be less clear - throw error_disallowed(cp); - } - } - } - } - if (chars.length) { - ret.push(nf(chars)); - } - return ret; -} - -function filter_fe0f(cps) { - return cps.filter(cp => cp != FE0F); -} - -// given array of codepoints -// returns the longest valid emoji sequence (or undefined if no match) -// *MUTATES* the supplied array -// disallows interleaved ignored characters -// fills (optional) eaten array with matched codepoints -function consume_emoji_reversed(cps, eaten) { - let node = EMOJI_ROOT; - let emoji; - let pos = cps.length; - while (pos) { - node = node.get(cps[--pos]); - if (!node) break; - let {V} = node; - if (V) { // this is a valid emoji (so far) - emoji = V; - if (eaten) eaten.push(...cps.slice(pos).reverse()); // (optional) copy input, used for ens_tokenize() - cps.length = pos; // truncate - } - } - return emoji; -} - -// ************************************************************ -// tokenizer - -const TY_VALID = 'valid'; -const TY_MAPPED = 'mapped'; -const TY_IGNORED = 'ignored'; -const TY_DISALLOWED = 'disallowed'; -const TY_EMOJI = 'emoji'; -const TY_NFC = 'nfc'; -const TY_STOP = 'stop'; - -function ens_tokenize(name, { - nf = true, // collapse unnormalized runs into a single token -} = {}) { - init(); - let input = explode_cp(name).reverse(); - let eaten = []; - let tokens = []; - while (input.length) { - let emoji = consume_emoji_reversed(input, eaten); - if (emoji) { - tokens.push({ - type: TY_EMOJI, - emoji: emoji.slice(), // copy emoji - input: eaten, - cps: filter_fe0f(emoji) - }); - eaten = []; // reset buffer - } else { - let cp = input.pop(); - if (cp == STOP) { - tokens.push({type: TY_STOP, cp}); - } else if (VALID.has(cp)) { - tokens.push({type: TY_VALID, cps: [cp]}); - } else if (IGNORED.has(cp)) { - tokens.push({type: TY_IGNORED, cp}); - } else { - let cps = MAPPED.get(cp); - if (cps) { - tokens.push({type: TY_MAPPED, cp, cps: cps.slice()}); - } else { - tokens.push({type: TY_DISALLOWED, cp}); - } - } - } - } - if (nf) { - for (let i = 0, start = -1; i < tokens.length; i++) { - let token = tokens[i]; - if (is_valid_or_mapped(token.type)) { - if (requires_check(token.cps)) { // normalization might be needed - let end = i + 1; - for (let pos = end; pos < tokens.length; pos++) { // find adjacent text - let {type, cps} = tokens[pos]; - if (is_valid_or_mapped(type)) { - if (!requires_check(cps)) break; - end = pos + 1; - } else if (type !== TY_IGNORED) { // || type !== TY_DISALLOWED) { - break; - } - } - if (start < 0) start = i; - let slice = tokens.slice(start, end); - let cps0 = slice.flatMap(x => is_valid_or_mapped(x.type) ? x.cps : []); // strip junk tokens - let cps = nfc(cps0); - if (compare_arrays(cps, cps0)) { // bundle into an nfc token - tokens.splice(start, end - start, { - type: TY_NFC, - input: cps0, // there are 3 states: tokens0 ==(process)=> input ==(nfc)=> tokens/cps - cps, - tokens0: collapse_valid_tokens(slice), - tokens: ens_tokenize(str_from_cps(cps), {nf: false}) - }); - i = start; - } else { - i = end - 1; // skip to end of slice - } - start = -1; // reset - } else { - start = i; // remember last - } - } else if (token.type !== TY_IGNORED) { // 20221024: is this correct? - start = -1; // reset - } - } - } - return collapse_valid_tokens(tokens); -} - -function is_valid_or_mapped(type) { - return type == TY_VALID || type == TY_MAPPED; -} - -function requires_check(cps) { - return cps.some(cp => NFC_CHECK.has(cp)); -} - -function collapse_valid_tokens(tokens) { - for (let i = 0; i < tokens.length; i++) { - if (tokens[i].type == TY_VALID) { - let j = i + 1; - while (j < tokens.length && tokens[j].type == TY_VALID) j++; - tokens.splice(i, j - i, {type: TY_VALID, cps: tokens.slice(i, j).flatMap(x => x.cps)}); - } - } - return tokens; -} - -function hex_seq(cps) { - return cps.map(hex_cp).join(' '); -} - -function create_arrow_span() { - let span = document.createElement('span'); - span.classList.add('arrow'); - span.innerHTML = '➔'; // '→'; - return span; -} - -function span_from_cp(cp, in_emoji) { - let span = document.createElement('span'); - if (cp == 0x200D) { - span.classList.add('mod', 'zwj'); - span.innerText = 'ZWJ'; - } else if (cp == 0x200C) { - span.classList.add('mod', 'zwj'); - span.innerText = 'ZWNJ'; - } else if (cp == 0xFE0F) { - span.classList.add('mod', 'dropped', 'style'); - span.innerText = 'FE0F'; - } else if (cp == 0x20E3) { - span.classList.add('mod', 'keycap'); - span.innerText = 'Keycap'; - } else if (cp >= 0xE0021 && cp <= 0xE007E) { // printable ascii tag - span.classList.add('mod', 'tag'); - span.innerText = String.fromCodePoint(cp - 0xE0000); - } else if (cp == 0xE007F) { // tag end - span.classList.add('mod', 'tag', 'end'); - span.innerText = '⌫'; // 🏷️ - } else if (!in_emoji && should_escape(cp)) { - span.classList.add('code'); - span.innerText = hex_cp(cp); - } else { - span.innerText = safe_str_from_cps([cp]); - } - return span; -} - -// idea -//export function dom_from_token(token) { - -function format_tooltip(obj, extra) { - let lines = Object.entries(obj).map(([k, v]) => `${k}: ${v}`); - if (Array.isArray(extra)) lines.push(...extra); - return lines.join('\n'); -} - -function isolated_safe(cps) { - return cps.map(cp => safe_str_from_cps([cp])).join('\u{200B}') -} - -// TODO: these options are shit, fix this -function dom_from_tokens(tokens, { - before = false, - tld_class = true, - components = false, - emoji_url = 'https://emojipedia.org/%s', - extra = () => {}, -} = {}) { - let div = document.createElement('div'); - div.classList.add('tokens'); - /* - if (before) { - // dont use normalized form unless its simple - tokens = tokens.flatMap(token => { - if (token.type === 'nfc' && !token.tokens.every(t => t.type == 'valid')) { - return token.tokens; - } else { - return token; - } - }); - } - */ - div.append(...tokens.map((token, i) => { - let el; - switch (token.type) { - case 'emoji': { - el = document.createElement(emoji_url ? 'a' : 'span'); - if (emoji_url) el.href = emoji_url.replace('%s', String.fromCodePoint(...token.emoji)); - let cps = before ? token.input : token.cps; - if (components) { - el.append(...cps.map(cp => span_from_cp(cp, true))); - } else { - el.innerText = String.fromCodePoint(...token.emoji); // use fully-qualified form - } - el.title = format_tooltip({ - Type: 'Emoji', - Hex: hex_seq(cps), - Beautified: hex_seq(token.emoji), - }, extra(token.type, cps)); - break; - } - case 'nfc': { - el = document.createElement('div'); - // get the cps from the original tokens - let cps0 = token.tokens0.flatMap(t => t.type === 'valid' ? t.cps : t.cp); // this can only be mapped/ignored/valid - // break every valid token into individual characters - let lhs = dom_from_tokens(token.tokens0.flatMap(t => t.type === 'valid' ? t.cps.map(cp => ({type: 'valid', cps: [cp]})) : t), {components, before, emoji_url, extra}); - lhs.title = format_tooltip({ - Type: 'NFC (Unnormalized)', - Hex: hex_seq(cps0), - }, extra(token.type, cps0)); - el.append(lhs); - if (!before) { - let rhs = dom_from_tokens(token.tokens, {components, emoji_url, extra}); - rhs.title = format_tooltip({ - Type: 'NFC (Normalized)', - Hex: hex_seq(token.cps), - }, extra(token.type, token.cps)); - el.append(create_arrow_span(), rhs); - } - break; - } - case 'valid': { - el = document.createElement('span'); - let form = safe_str_from_cps(token.cps); - if (tld_class && (tokens.length == 1 || (i === tokens.length-1 && tokens[i-1].type === 'stop')) && /[a-z]/.test(form)) { - // theres just 1 token/or we're the last token with a stop before us - //el.classList.add(form); - // 20230909: this triggered for stupid things - el.dataset.tld = form; - } - el.innerText = form; - el.title = format_tooltip({ - Type: 'Valid', - Hex: hex_seq(token.cps), - }, extra(token.type, token.cps)); - break; - } - case 'mapped': { - el = document.createElement('div'); - let span_src = document.createElement('span'); - span_src.classList.add('before'); - span_src.innerText = safe_str_from_cps([token.cp]); // isolate ? isolated_safe([token.cp]) : - span_src.title = format_tooltip({ - Type: 'Mapped (Match)', - Hex: hex_cp(token.cp), - }, extra(token.type, [token.cp])); - el.append(span_src); - if (!before) { - let span_dst = document.createElement('span'); - span_dst.innerText = isolated_safe(token.cps); // safe_str_from_cps(token.cps); - span_dst.title = format_tooltip({ - Type: 'Mapped (Replacement)', - Hex: hex_seq(token.cps), - }, extra(token.type, token.cps)); - el.append(create_arrow_span(), span_dst); - } - break; - } - case 'stop': - case 'ignored': - case 'disallowed': { - el = span_from_cp(token.cp); - el.title = format_tooltip({ - Type: token.type, - Hex: hex_cp(token.cp), - }, extra(token.type, [token.cp])); - break; - } - default: throw new TypeError(`unknown token type: ${token.type}`); - } - el.classList.add(token.type); - return el; - })); - return div; -} - -function use_default_style() { - let style = document.createElement('style'); - style.innerText = ` - .tokens { - display: flex; - flex-wrap: wrap; - gap: 2px; - } - .tokens > * { - padding: 2px 4px; - display: flex; - align-items: center; - gap: 4px; - border-radius: 5px; - overflow: hidden; - } - .tokens a { - text-decoration: none; - } - .tokens a:hover { - border-color: #00f; - } - .tokens .valid { - background: #cfc; - border: 2px solid #0a0; - line-break: anywhere; - } - .tokens [data-tld="eth"].valid { - color: #fff; - background: #58f; - border-color: #58f; - } - .tokens [data-tld="art"].valid { - color: #fff; - background: #333; - border-color: #333; - } - .tokens [data-tld="box"].valid { - color: #fff; - background: #666; - border-color: #666; - } - .tokens [data-tld="com"].valid, - .tokens [data-tld="net"].valid, - .tokens [data-tld="org"].valid, - .tokens [data-tld="io"].valid, - .tokens [data-tld="cash"].valid, - .tokens [data-tld="xyz"].valid { - color: #fff; - background: #0a0; - border-color: #0a0; - } - .tokens .ignored { - color: #fff; - background: #aaa; - font-size: 75%; - font-family: monospace; - } - .tokens .disallowed { - background: #c00; - min-width: 5px; - min-height: 1em; - border-radius: 5px; - color: #fff; - } - .tokens .disallowed.code { - font-size: 75%; - background: #800; - } - .tokens .disallowed.mod { - border: 2px solid #800; - font-size: 80%; - } - .tokens .disallowed.mod.tag { - background: #f00; - color: #000; - } - .tokens .mapped { - display: flex; - border: 2px solid #66f; - background: #ccf; - } - .tokens .mapped span:first-child { - margin-bottom: -4px; - border-bottom: 4px solid #000; - text-align: center; - min-width: 0.5rem; - } - .tokens .stop { - font-weight: bold; - background: linear-gradient(#fff, #ff0); - padding-bottom: 0; - border: 1px solid #ccc; - } - .tokens .emoji { - border: 2px solid #0aa; - background: #cff; - color: #000; - } - .tokens .mod { - color: #fff; - } - .tokens * .mod { - font-size: 70%; - padding: 2px; - border-radius: 3px; - } - .tokens .emoji .mod { - background: #333; - } - .tokens .emoji .mod.zwj { - background: #0aa; - } - .tokens .emoji .mod.tag { - background: #0aa; - } - .tokens .emoji .mod.tag.end { - background: #066; - } - .tokens .emoji .mod.dropped { - background: #aaa; - } - .tokens .arrow { - color: rgba(0, 0, 0, 0.35); - user-select: none; - margin: 0 -2px; - } - .tokens .code { - font-family: monospace; - } - .tokens .nfc { - display: flex; - border: 2px solid #c80; - background: #fd8; - border-radius: 5px; - padding: 2px; - }`; - document.body.append(style); -} - -// see: https://github.com/adraffy/ens-normalize.js#security -const derived = "2023-09-06T06:00:29.074Z"; -const unicode = "15.1.0 (2023-09-06T02:58:19.261Z)"; -const cldr = "43.1 (2023-09-03T21:58:22.687Z)"; -const base64_ens_hash = "0565ed049b9cf1614bb9e11ba7d8ac6a6fb96c893253d890f7e2b2884b9ded32"; -const base64_nf_hash = "a974b6f8541fc29d919bc85118af0a44015851fab5343f8679cb31be2bdb209e"; -const spec_hash = "1f6d3bdb7a724fe3b91f6d73ab14defcb719e0f4ab79022089c940e7e9c56b9c"; -const built = "2023-09-25T01:01:55.148Z"; -const version = "1.10.1"; - -var includeVersions = /*#__PURE__*/Object.freeze({ - __proto__: null, - base64_ens_hash: base64_ens_hash, - base64_nf_hash: base64_nf_hash, - built: built, - cldr: cldr, - derived: derived, - spec_hash: spec_hash, - unicode: unicode, - version: version -}); - -export { compare_arrays, dom_from_tokens, ens_beautify, ens_emoji, ens_normalize, ens_normalize_fragment, ens_split, ens_tokenize, explode_cp, hex_cp, is_combining_mark, nfc, nfd, quote_cp, random_choice, random_sample, run_tests, safe_str_from_cps, should_escape, str_from_cps, use_default_style, includeVersions as versions }; diff --git a/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/dist/all.min.js b/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/dist/all.min.js deleted file mode 100644 index c4402427..00000000 --- a/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/dist/all.min.js +++ /dev/null @@ -1 +0,0 @@ -var A="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyU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voeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const t=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),e=4;function n(A){return function(A){let t=0;return()=>A[t++]}(function(A){let t=0;function e(){return A[t++]<<8|A[t++]}let n=e(),o=1,r=[0,1];for(let A=1;A>--c&1}const p=2**31,a=p>>>1,w=p-1;let C=0;for(let A=0;A<31;A++)C=C<<1|f();let g=[],B=0,Q=p;for(;;){let A=Math.floor(((C-B+1)*o-1)/Q),t=0,e=n;for(;e-t>1;){let n=t+e>>>1;A>>1|f(),l=l<<1^a,s=(s^a)<<1|a|1;B=l,Q=1+s-l}let d=n-4;return g.map((t=>{switch(t-d){case 3:return d+65792+(A[s++]<<16|A[s++]<<8|A[s++]);case 2:return d+256+(A[s++]<<8|A[s++]);case 1:return d+A[s++];default:return t-1}}))}(function(A){let t=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach(((A,e)=>t[A.charCodeAt(0)]=e));let e=A.length,n=new Uint8Array(6*e>>3);for(let o=0,r=0,l=0,s=0;o=8&&(n[r++]=s>>(l-=8));return n}(A)))}function o(A){return 1&A?~A>>1:A>>1}function r(A,t){let e=Array(A);for(let n=0,r=0;n{let t=l(A);if(t.length)return t}))}function c(A){let t=[];for(;;){let e=A();if(0==e)break;t.push(p(e,A))}for(;;){let e=A()-1;if(e<0)break;t.push(a(e,A))}return t.flat()}function i(A){let t=[];for(;;){let e=A(t.length);if(!e)break;t.push(e)}return t}function f(A,t,e){let n=Array(A).fill().map((()=>[]));for(let o=0;on[t].push(A)));return n}function p(A,t){let e=1+t(),n=t(),o=i(t);return f(o.length,1+A,t).flatMap(((A,t)=>{let[r,...l]=A;return Array(o[t]).fill().map(((A,t)=>{let o=t*n;return[r+t*e,l.map((A=>A+o))]}))}))}function a(A,t){return f(1+t(),1+A,t).map((A=>[A[0],A.slice(1)]))}function w(A){return A.toString(16).toUpperCase().padStart(2,"0")}function C(A){return`{${w(A)}}`}function g(A){let t=[];for(let e=0,n=A.length;et){for(let n=0;n>24&255}function H(A){return 16777215&A}let F,G,O,L;function P(A){return A>=D&&A=h&&A=k&&tm&&tA.map((A=>[A,t+1<<24]))))),G=new Set(l(A)),O=new Map,L=new Map;for(let[t,e]of c(A)){if(!G.has(t)&&2==e.length){let[A,n]=e,o=L.get(A);o||(o=new Map,L.set(A,o)),o.set(n,t)}O.set(t,e.reverse())}}();let t=[],e=[],o=!1;function r(A){let e=F.get(A);e&&(o=!0,A|=e),t.push(A)}for(let n of A)for(;;){if(n<128)t.push(n);else if(P(n)){let A=n-D,t=A%b/I|0,e=A%I;r(h+(A/b|0)),r(k+t),e>0&&r(m+e)}else{let A=O.get(n);A?e.push(...A):r(n)}if(!e.length)break;n=e.pop()}if(o&&t.length>1){let A=x(t[0]);for(let e=1;e0&&o>=A)0==A?(t.push(n,...e),e.length=0,n=l):e.push(l),o=A;else{let r=S(n,l);r>=0?n=r:0==o&&0==A?(t.push(n),n=l):(e.push(l),o=A)}}return n>=0&&t.push(n,...e),t}(V(A))}const j=45,T=46,Z=".",Y=65039,y=1,v=A=>Array.from(A);function X(A,t){return A.P.has(t)||A.Q.has(t)}class W extends Array{get is_emoji(){return!0}}let q,$,_,AA,tA,eA,nA,oA,rA,lA,sA,cA;function iA(){if(q)return;let t=n(A);const e=()=>l(t),o=()=>new Set(e()),r=(A,t)=>t.forEach((t=>A.add(t)));q=new Map(c(t)),$=o(),_=e(),AA=new Set(e().map((A=>_[A]))),_=new Set(_),tA=o(),eA=o();let f=s(t),p=t();const a=()=>{let A=new Set;return e().forEach((t=>r(A,f[t]))),r(A,e()),A};nA=i((A=>{let e=i(t).map((A=>A+96));if(e.length){let n=A>=p;return e[0]-=32,e=B(e),n&&(e=`Restricted[${e}]`),{N:e,P:a(),Q:a(),M:!t(),R:n}}})),oA=o(),rA=new Map;let w=e().concat(v(oA)).sort(((A,t)=>A-t));w.forEach(((A,e)=>{let n=t(),o=w[e]=n?w[e-n]:{V:[],M:new Map};o.V.push(A),oA.has(A)||rA.set(A,o)}));for(let{V:A,M:t}of new Set(rA.values())){let e=[];for(let t of A){let A=nA.filter((A=>X(A,t))),n=e.find((({G:t})=>A.some((A=>t.has(A)))));n||(n={G:new Set,V:[]},e.push(n)),n.V.push(t),r(n.G,A)}let n=e.flatMap((A=>v(A.G)));for(let{G:A,V:o}of e){let e=new Set(n.filter((t=>!A.has(t))));for(let A of o)t.set(A,e)}}lA=new Set;let C=new Set;const g=A=>lA.has(A)?C.add(A):lA.add(A);for(let A of nA){for(let t of A.P)g(t);for(let t of A.Q)g(t)}for(let A of lA)rA.has(A)||C.has(A)||rA.set(A,y);r(lA,K(lA)),sA=function(A){let t=[],e=l(A);return function A({S:e,B:n},o,r){if(!(4&e&&r===o[o.length-1])){2&e&&(r=o[o.length-1]),1&e&&t.push(o);for(let t of n)for(let e of t.Q)A(t,[...o,e],r)}}(function t(n){return{S:A(),B:i((()=>{let n=l(A).map((A=>e[A]));if(n.length)return t(n)})),Q:n}}([]),[]),t}(t).map((A=>W.from(A))).sort(Q),cA=new Map;for(let A of sA){let t=[cA];for(let e of A){let A=t.map((A=>{let t=A.get(e);return t||(t=new Map,A.set(e,t)),t}));e===Y?t.push(...A):t=A}for(let e of t)e.V=A}}function fA(A){return(CA(A)?"":`${pA(aA([A]))} `)+C(A)}function pA(A){return`"${A}"‎`}function aA(A,t=1/0,e=C){let n=[];wA(A[0])&&n.push("◌"),A.length>t&&(t>>=1,A=[...A.slice(0,t),8230,...A.slice(-t)]);let o=0,r=A.length;for(let t=0;tA.slice()))}function BA(A,t){iA();let e=t?K:z;return A.split(Z).map((A=>B(IA(g(A),e,bA).flat()))).join(Z)}function QA(A){return DA(MA(A,z,bA))}function dA(A){let t=MA(A,z,(A=>A));for(let{type:A,output:e,error:n}of t){if(n)break;"Greek"!==A&&uA(e,958,926)}return DA(t)}function uA(A,t,e){let n=0;for(;;){let o=A.indexOf(t,n);if(o<0)break;A[o]=e,n=o+1}}function EA(A,t){return MA(A,z,t?A=>A.slice():bA)}function MA(A,n,o){if(!A)return[];iA();let r=0;return A.split(Z).map((A=>{let l=g(A),s={input:l,offset:r};r+=l.length+1;try{let A,r=s.tokens=IA(l,n,o),c=r.length;if(!c)throw new Error("empty label");let i=s.output=r.flat();if(function(A){for(let t=A.lastIndexOf(95);t>0;)if(95!==A[--t])throw new Error("underscore allowed only at start")}(i),!(s.emoji=c>1||r[0].is_emoji)&&i.every((A=>A<128)))!function(A){if(A.length>=4&&A[2]==j&&A[3]==j)throw new Error(`invalid label extension: "${B(A.slice(0,4))}"`)}(i),A="ASCII";else{let n=r.flatMap((A=>A.is_emoji?[]:A));if(n.length){if(_.has(i[0]))throw mA("leading combining mark");for(let A=1;AX(A,e)));if(!A.length)throw nA.some((A=>X(A,e)))?kA(t[0],e):hA(e);if(t=A,1==A.length)break}return t}(o);!function(A,t){for(let e of t)if(!X(A,e))throw kA(A,e);if(A.M){let A=K(t);for(let t=1,n=A.length;te)throw new Error(`excessive non-spacing marks: ${pA(aA(A.slice(t-1,o)))} (${o-t}/${e})`);t=o}}}(l,n),function(A,t){let e,n=[];for(let A of t){let t=rA.get(A);if(t===y)return;if(t){let n=t.M.get(A);if(e=e?e.filter((A=>n.has(A))):v(n),!e.length)return}else n.push(A)}if(e)for(let t of e)if(n.every((A=>X(t,A))))throw new Error(`whole-script confusable: ${A.N}/${t.N}`)}(l,o),A=l.N}else A="Emoji"}s.type=A}catch(A){s.error=A}return s}))}function DA(A){return A.map((({input:t,error:e,output:n})=>{if(e){let n=e.message;throw new Error(1==A.length?n:`Invalid label ${pA(aA(t,63))}: ${n}`)}return B(n)})).join(Z)}function hA(A){return new Error(`disallowed character: ${fA(A)}`)}function kA(A,t){let e=fA(t),n=nA.find((A=>A.P.has(t)));return n&&(e=`${n.N} ${e}`),new Error(`illegal mixture: ${A.N} + ${e}`)}function mA(A){return new Error(`illegal placement: ${A}`)}function IA(A,t,e){let n=[],o=[];for(A=A.slice().reverse();A.length;){let r=RA(A);if(r)o.length&&(n.push(t(o)),o=[]),n.push(e(r));else{let t=A.pop();if(lA.has(t))o.push(t);else{let A=q.get(t);if(A)o.push(...A);else if(!$.has(t))throw hA(t)}}}return o.length&&n.push(t(o)),n}function bA(A){return A.filter((A=>A!=Y))}function RA(A,t){let e,n=cA,o=A.length;for(;o&&(n=n.get(A[--o]),n);){let{V:r}=n;r&&(e=r,t&&t.push(...A.slice(o).reverse()),A.length=o)}return e}const UA="valid",NA="mapped",JA="ignored",xA="disallowed",HA="emoji",FA="nfc",GA="stop";function OA(A,{nf:t=!0}={}){iA();let e=g(A).reverse(),n=[],o=[];for(;e.length;){let A=RA(e,n);if(A)o.push({type:HA,emoji:A.slice(),input:n,cps:bA(A)}),n=[];else{let A=e.pop();if(A==T)o.push({type:GA,cp:A});else if(lA.has(A))o.push({type:UA,cps:[A]});else if($.has(A))o.push({type:JA,cp:A});else{let t=q.get(A);t?o.push({type:NA,cp:A,cps:t.slice()}):o.push({type:xA,cp:A})}}}if(t)for(let A=0,t=-1;ALA(A.type)?A.cps:[])),l=z(r);Q(l,r)?(o.splice(t,e-t,{type:FA,input:r,cps:l,tokens0:SA(n),tokens:OA(B(l),{nf:!1})}),A=t):A=e-1,t=-1}else t=A;else e.type!==JA&&(t=-1)}return SA(o)}function LA(A){return A==UA||A==NA}function PA(A){return A.some((A=>eA.has(A)))}function SA(A){for(let t=0;tA.cps))})}return A}function VA(A){return A.map(w).join(" ")}function KA(){let A=document.createElement("span");return A.classList.add("arrow"),A.innerHTML="➔",A}function zA(A,t){let e=document.createElement("span");return 8205==A?(e.classList.add("mod","zwj"),e.innerText="ZWJ"):8204==A?(e.classList.add("mod","zwj"),e.innerText="ZWNJ"):65039==A?(e.classList.add("mod","dropped","style"),e.innerText="FE0F"):8419==A?(e.classList.add("mod","keycap"),e.innerText="Keycap"):A>=917537&&A<=917630?(e.classList.add("mod","tag"),e.innerText=String.fromCodePoint(A-917504)):917631==A?(e.classList.add("mod","tag","end"),e.innerText="⌫"):!t&&CA(A)?(e.classList.add("code"),e.innerText=w(A)):e.innerText=aA([A]),e}function jA(A,t){let e=Object.entries(A).map((([A,t])=>`${A}: ${t}`));return Array.isArray(t)&&e.push(...t),e.join("\n")}function TA(A,{before:t=!1,tld_class:e=!0,components:n=!1,emoji_url:o="https://emojipedia.org/%s",extra:r=(()=>{})}={}){let l=document.createElement("div");return l.classList.add("tokens"),l.append(...A.map(((l,s)=>{let c;switch(l.type){case"emoji":{c=document.createElement(o?"a":"span"),o&&(c.href=o.replace("%s",String.fromCodePoint(...l.emoji)));let A=t?l.input:l.cps;n?c.append(...A.map((A=>zA(A,!0)))):c.innerText=String.fromCodePoint(...l.emoji),c.title=jA({Type:"Emoji",Hex:VA(A),Beautified:VA(l.emoji)},r(l.type,A));break}case"nfc":{c=document.createElement("div");let A=l.tokens0.flatMap((A=>"valid"===A.type?A.cps:A.cp)),e=TA(l.tokens0.flatMap((A=>"valid"===A.type?A.cps.map((A=>({type:"valid",cps:[A]}))):A)),{components:n,before:t,emoji_url:o,extra:r});if(e.title=jA({Type:"NFC (Unnormalized)",Hex:VA(A)},r(l.type,A)),c.append(e),!t){let A=TA(l.tokens,{components:n,emoji_url:o,extra:r});A.title=jA({Type:"NFC (Normalized)",Hex:VA(l.cps)},r(l.type,l.cps)),c.append(KA(),A)}break}case"valid":{c=document.createElement("span");let t=aA(l.cps);e&&(1==A.length||s===A.length-1&&"stop"===A[s-1].type)&&/[a-z]/.test(t)&&(c.dataset.tld=t),c.innerText=t,c.title=jA({Type:"Valid",Hex:VA(l.cps)},r(l.type,l.cps));break}case"mapped":{c=document.createElement("div");let A=document.createElement("span");if(A.classList.add("before"),A.innerText=aA([l.cp]),A.title=jA({Type:"Mapped (Match)",Hex:w(l.cp)},r(l.type,[l.cp])),c.append(A),!t){let A=document.createElement("span");A.innerText=l.cps.map((A=>aA([A]))).join("​"),A.title=jA({Type:"Mapped (Replacement)",Hex:VA(l.cps)},r(l.type,l.cps)),c.append(KA(),A)}break}case"stop":case"ignored":case"disallowed":c=zA(l.cp),c.title=jA({Type:l.type,Hex:w(l.cp)},r(l.type,[l.cp]));break;default:throw new TypeError(`unknown token type: ${l.type}`)}return c.classList.add(l.type),c}))),l}function ZA(){let A=document.createElement("style");A.innerText='\n\t.tokens {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tgap: 2px;\n\t}\n\t.tokens > * {\n\t\tpadding: 2px 4px;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 4px;\n\t\tborder-radius: 5px;\n\t\toverflow: hidden;\n\t}\n\t.tokens a {\n\t\ttext-decoration: none;\n\t}\n\t.tokens a:hover {\n\t\tborder-color: #00f;\n\t}\n\t.tokens .valid {\n\t\tbackground: #cfc;\n\t\tborder: 2px solid #0a0;\n\t\tline-break: anywhere;\n\t}\n\t.tokens [data-tld="eth"].valid {\n\t\tcolor: #fff;\n\t\tbackground: #58f;\n\t\tborder-color: #58f;\n\t}\n\t.tokens [data-tld="art"].valid {\n\t\tcolor: #fff;\n\t\tbackground: #333;\n\t\tborder-color: #333;\n\t}\n\t.tokens [data-tld="box"].valid {\n\t\tcolor: #fff;\n\t\tbackground: #666;\n\t\tborder-color: #666;\n\t}\n\t.tokens [data-tld="com"].valid,\n\t.tokens [data-tld="net"].valid,\n\t.tokens [data-tld="org"].valid,\n\t.tokens [data-tld="io"].valid,\n\t.tokens [data-tld="cash"].valid,\n\t.tokens [data-tld="xyz"].valid {\n\t\tcolor: #fff;\n\t\tbackground: #0a0;\n\t\tborder-color: #0a0;\n\t}\n\t.tokens .ignored {\n\t\tcolor: #fff;\n\t\tbackground: #aaa;\n\t\tfont-size: 75%;\n\t\tfont-family: monospace;\n\t}\n\t.tokens .disallowed {\n\t\tbackground: #c00;\t\n\t\tmin-width: 5px;\n\t\tmin-height: 1em;\n\t\tborder-radius: 5px;\n\t\tcolor: #fff;\n\t}\n\t.tokens .disallowed.code {\n\t\tfont-size: 75%;\n\t\tbackground: #800;\n\t}\n\t.tokens .disallowed.mod {\n\t\tborder: 2px solid #800;\n\t\tfont-size: 80%;\n\t}\n\t.tokens .disallowed.mod.tag {\n\t\tbackground: #f00;\n\t\tcolor: #000;\n\t}\n\t.tokens .mapped {\n\t\tdisplay: flex;\n\t\tborder: 2px solid #66f;\n\t\tbackground: #ccf;\n\t}\n\t.tokens .mapped span:first-child {\n\t\tmargin-bottom: -4px;\n\t\tborder-bottom: 4px solid #000;\n\t\ttext-align: center;\n\t\tmin-width: 0.5rem;\n\t}\n\t.tokens .stop {\n\t\tfont-weight: bold;\n\t\tbackground: linear-gradient(#fff, #ff0);\n\t\tpadding-bottom: 0;\n\t\tborder: 1px solid #ccc;\n\t}\n\t.tokens .emoji {\n\t\tborder: 2px solid #0aa;\n\t\tbackground: #cff;\n\t\tcolor: #000;\n\t}\n\t.tokens .mod {\n\t\tcolor: #fff;\n\t}\n\t.tokens * .mod {\n\t\tfont-size: 70%;\n\t\tpadding: 2px;\n\t\tborder-radius: 3px;\n\t}\n\t.tokens .emoji .mod {\n\t\tbackground: #333;\n\t}\n\t.tokens .emoji .mod.zwj {\n\t\tbackground: #0aa;\n\t}\n\t.tokens .emoji .mod.tag {\n\t\tbackground: #0aa;\n\t}\n\t.tokens .emoji .mod.tag.end {\n\t\tbackground: #066;\n\t}\n\t.tokens .emoji .mod.dropped {\n\t\tbackground: #aaa;\t\t\n\t}\n\t.tokens .arrow {\n\t\tcolor: rgba(0, 0, 0, 0.35);\n\t\tuser-select: none;\n\t\tmargin: 0 -2px;\n\t}\n\t.tokens .code {\n\t\tfont-family: monospace;\n\t}\n\t.tokens .nfc {\n\t\tdisplay: flex;\n\t\tborder: 2px solid #c80;\n\t\tbackground: #fd8;\n\t\tborder-radius: 5px;\n\t\tpadding: 2px;\n\t}',document.body.append(A)}var YA=Object.freeze({__proto__:null,base64_ens_hash:"0565ed049b9cf1614bb9e11ba7d8ac6a6fb96c893253d890f7e2b2884b9ded32",base64_nf_hash:"a974b6f8541fc29d919bc85118af0a44015851fab5343f8679cb31be2bdb209e",built:"2023-09-25T01:01:55.148Z",cldr:"43.1 (2023-09-03T21:58:22.687Z)",derived:"2023-09-06T06:00:29.074Z",spec_hash:"1f6d3bdb7a724fe3b91f6d73ab14defcb719e0f4ab79022089c940e7e9c56b9c",unicode:"15.1.0 (2023-09-06T02:58:19.261Z)",version:"1.10.1"});export{Q as compare_arrays,TA as dom_from_tokens,dA as ens_beautify,gA as ens_emoji,QA as ens_normalize,BA as ens_normalize_fragment,EA as ens_split,OA as ens_tokenize,g as explode_cp,w as hex_cp,wA as is_combining_mark,z as nfc,K as nfd,C as quote_cp,d as random_choice,u as random_sample,E as run_tests,aA as safe_str_from_cps,CA as should_escape,B as str_from_cps,ZA as use_default_style,YA as versions}; diff --git a/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/dist/index-xnf.cjs b/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/dist/index-xnf.cjs deleted file mode 100644 index 0e4a25eb..00000000 --- a/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/dist/index-xnf.cjs +++ /dev/null @@ -1,1077 +0,0 @@ -'use strict'; - -// created 2023-09-25T01:01:55.148Z -// compressed base64-encoded blob for include-ens data -// source: https://github.com/adraffy/ens-normalize.js/blob/main/src/make.js -// see: https://github.com/adraffy/ens-normalize.js#security -// SHA-256: 0565ed049b9cf1614bb9e11ba7d8ac6a6fb96c893253d890f7e2b2884b9ded32 -var COMPRESSED = 'AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQB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oWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI'; -const FENCED = new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]); -const NSM_MAX = 4; - -function decode_arithmetic(bytes) { - let pos = 0; - function u16() { return (bytes[pos++] << 8) | bytes[pos++]; } - - // decode the frequency table - let symbol_count = u16(); - let total = 1; - let acc = [0, 1]; // first symbol has frequency 1 - for (let i = 1; i < symbol_count; i++) { - acc.push(total += u16()); - } - - // skip the sized-payload that the last 3 symbols index into - let skip = u16(); - let pos_payload = pos; - pos += skip; - - let read_width = 0; - let read_buffer = 0; - function read_bit() { - if (read_width == 0) { - // this will read beyond end of buffer - // but (undefined|0) => zero pad - read_buffer = (read_buffer << 8) | bytes[pos++]; - read_width = 8; - } - return (read_buffer >> --read_width) & 1; - } - - const N = 31; - const FULL = 2**N; - const HALF = FULL >>> 1; - const QRTR = HALF >> 1; - const MASK = FULL - 1; - - // fill register - let register = 0; - for (let i = 0; i < N; i++) register = (register << 1) | read_bit(); - - let symbols = []; - let low = 0; - let range = FULL; // treat like a float - while (true) { - let value = Math.floor((((register - low + 1) * total) - 1) / range); - let start = 0; - let end = symbol_count; - while (end - start > 1) { // binary search - let mid = (start + end) >>> 1; - if (value < acc[mid]) { - end = mid; - } else { - start = mid; - } - } - if (start == 0) break; // first symbol is end mark - symbols.push(start); - let a = low + Math.floor(range * acc[start] / total); - let b = low + Math.floor(range * acc[start+1] / total) - 1; - while (((a ^ b) & HALF) == 0) { - register = (register << 1) & MASK | read_bit(); - a = (a << 1) & MASK; - b = (b << 1) & MASK | 1; - } - while (a & ~b & QRTR) { - register = (register & HALF) | ((register << 1) & (MASK >>> 1)) | read_bit(); - a = (a << 1) ^ HALF; - b = ((b ^ HALF) << 1) | HALF | 1; - } - low = a; - range = 1 + b - a; - } - let offset = symbol_count - 4; - return symbols.map(x => { // index into payload - switch (x - offset) { - case 3: return offset + 0x10100 + ((bytes[pos_payload++] << 16) | (bytes[pos_payload++] << 8) | bytes[pos_payload++]); - case 2: return offset + 0x100 + ((bytes[pos_payload++] << 8) | bytes[pos_payload++]); - case 1: return offset + bytes[pos_payload++]; - default: return x - 1; - } - }); -} - -// returns an iterator which returns the next symbol -function read_payload(v) { - let pos = 0; - return () => v[pos++]; -} -function read_compressed_payload(s) { - return read_payload(decode_arithmetic(unsafe_atob(s))); -} - -// unsafe in the sense: -// expected well-formed Base64 w/o padding -// 20220922: added for https://github.com/adraffy/ens-normalize.js/issues/4 -function unsafe_atob(s) { - let lookup = []; - [...'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'].forEach((c, i) => lookup[c.charCodeAt(0)] = i); - let n = s.length; - let ret = new Uint8Array((6 * n) >> 3); - for (let i = 0, pos = 0, width = 0, carry = 0; i < n; i++) { - carry = (carry << 6) | lookup[s.charCodeAt(i)]; - width += 6; - if (width >= 8) { - ret[pos++] = (carry >> (width -= 8)); - } - } - return ret; -} - -// eg. [0,1,2,3...] => [0,-1,1,-2,...] -function signed(i) { - return (i & 1) ? (~i >> 1) : (i >> 1); -} - -function read_deltas(n, next) { - let v = Array(n); - for (let i = 0, x = 0; i < n; i++) v[i] = x += signed(next()); - return v; -} - -// [123][5] => [0 3] [1 1] [0 0] -function read_sorted(next, prev = 0) { - let ret = []; - while (true) { - let x = next(); - let n = next(); - if (!n) break; - prev += x; - for (let i = 0; i < n; i++) { - ret.push(prev + i); - } - prev += n + 1; - } - return ret; -} - -function read_sorted_arrays(next) { - return read_array_while(() => { - let v = read_sorted(next); - if (v.length) return v; - }); -} - -// returns map of x => ys -function read_mapped(next) { - let ret = []; - while (true) { - let w = next(); - if (w == 0) break; - ret.push(read_linear_table(w, next)); - } - while (true) { - let w = next() - 1; - if (w < 0) break; - ret.push(read_replacement_table(w, next)); - } - return ret.flat(); -} - -// read until next is falsy -// return array of read values -function read_array_while(next) { - let v = []; - while (true) { - let x = next(v.length); - if (!x) break; - v.push(x); - } - return v; -} - -// read w columns of length n -// return as n rows of length w -function read_transposed(n, w, next) { - let m = Array(n).fill().map(() => []); - for (let i = 0; i < w; i++) { - read_deltas(n, next).forEach((x, j) => m[j].push(x)); - } - return m; -} - -// returns [[x, ys], [x+dx, ys+dy], [x+2*dx, ys+2*dy], ...] -// where dx/dy = steps, n = run size, w = length of y -function read_linear_table(w, next) { - let dx = 1 + next(); - let dy = next(); - let vN = read_array_while(next); - let m = read_transposed(vN.length, 1+w, next); - return m.flatMap((v, i) => { - let [x, ...ys] = v; - return Array(vN[i]).fill().map((_, j) => { - let j_dy = j * dy; - return [x + j * dx, ys.map(y => y + j_dy)]; - }); - }); -} - -// return [[x, ys...], ...] -// where w = length of y -function read_replacement_table(w, next) { - let n = 1 + next(); - let m = read_transposed(n, 1+w, next); - return m.map(v => [v[0], v.slice(1)]); -} - - -function read_trie(next) { - let ret = []; - let sorted = read_sorted(next); - expand(decode([]), []); - return ret; // not sorted - function decode(Q) { // characters that lead into this node - let S = next(); // state: valid, save, check - let B = read_array_while(() => { // buckets leading to new nodes - let cps = read_sorted(next).map(i => sorted[i]); - if (cps.length) return decode(cps); - }); - return {S, B, Q}; - } - function expand({S, B}, cps, saved) { - if (S & 4 && saved === cps[cps.length-1]) return; - if (S & 2) saved = cps[cps.length-1]; - if (S & 1) ret.push(cps); - for (let br of B) { - for (let cp of br.Q) { - expand(br, [...cps, cp], saved); - } - } - } -} - -function hex_cp(cp) { - return cp.toString(16).toUpperCase().padStart(2, '0'); -} - -function quote_cp(cp) { - return `{${hex_cp(cp)}}`; // raffy convention: like "\u{X}" w/o the "\u" -} - -/* -export function explode_cp(s) { - return [...s].map(c => c.codePointAt(0)); -} -*/ -function explode_cp(s) { // this is about 2x faster - let cps = []; - for (let pos = 0, len = s.length; pos < len; ) { - let cp = s.codePointAt(pos); - pos += cp < 0x10000 ? 1 : 2; - cps.push(cp); - } - return cps; -} - -function str_from_cps(cps) { - const chunk = 4096; - let len = cps.length; - if (len < chunk) return String.fromCodePoint(...cps); - let buf = []; - for (let i = 0; i < len; ) { - buf.push(String.fromCodePoint(...cps.slice(i, i += chunk))); - } - return buf.join(''); -} - -function compare_arrays(a, b) { - let n = a.length; - let c = n - b.length; - for (let i = 0; c == 0 && i < n; i++) c = a[i] - b[i]; - return c; -} - -// reverse polyfill -// replace custom nf implementation with system implementation -// (saves approximately 6KB) - - -function nf(cps, form) { - return explode_cp(str_from_cps(cps).normalize(form)); -} - -function nfc(cps) { - return nf(cps, 'NFC'); -} -function nfd(cps) { - return nf(cps, 'NFD'); -} - -const HYPHEN = 0x2D; -const STOP = 0x2E; -const STOP_CH = '.'; -const FE0F = 0xFE0F; -const UNIQUE_PH = 1; - -// 20230913: replace [...v] with Array_from(v) to avoid large spreads -const Array_from = x => Array.from(x); // Array.from.bind(Array); - -function group_has_cp(g, cp) { - // 20230913: keep primary and secondary distinct instead of creating valid union - return g.P.has(cp) || g.Q.has(cp); -} - -class Emoji extends Array { - get is_emoji() { return true; } // free tagging system -} - -let MAPPED, IGNORED, CM, NSM, ESCAPE, NFC_CHECK, GROUPS, WHOLE_VALID, WHOLE_MAP, VALID, EMOJI_LIST, EMOJI_ROOT; - -function init() { - if (MAPPED) return; - - let r = read_compressed_payload(COMPRESSED); - const read_sorted_array = () => read_sorted(r); - const read_sorted_set = () => new Set(read_sorted_array()); - const set_add_many = (set, v) => v.forEach(x => set.add(x)); - - MAPPED = new Map(read_mapped(r)); - IGNORED = read_sorted_set(); // ignored characters are not valid, so just read raw codepoints - - /* - // direct include from payload is smaller than the decompression code - const FENCED = new Map(read_array_while(() => { - let cp = r(); - if (cp) return [cp, read_str(r())]; - })); - */ - // 20230217: we still need all CM for proper error formatting - // but norm only needs NSM subset that are potentially-valid - CM = read_sorted_array(); - NSM = new Set(read_sorted_array().map(i => CM[i])); - CM = new Set(CM); - - ESCAPE = read_sorted_set(); // characters that should not be printed - NFC_CHECK = read_sorted_set(); // only needed to illustrate ens_tokenize() transformations - - let chunks = read_sorted_arrays(r); - let unrestricted = r(); - //const read_chunked = () => new Set(read_sorted_array().flatMap(i => chunks[i]).concat(read_sorted_array())); - const read_chunked = () => { - // 20230921: build set in parts, 2x faster - let set = new Set(); - read_sorted_array().forEach(i => set_add_many(set, chunks[i])); - set_add_many(set, read_sorted_array()); - return set; - }; - GROUPS = read_array_while(i => { - // minifier property mangling seems unsafe - // so these are manually renamed to single chars - let N = read_array_while(r).map(x => x+0x60); - if (N.length) { - let R = i >= unrestricted; // unrestricted then restricted - N[0] -= 32; // capitalize - N = str_from_cps(N); - if (R) N=`Restricted[${N}]`; - let P = read_chunked(); // primary - let Q = read_chunked(); // secondary - let M = !r(); // not-whitelisted, check for NSM - // *** this code currently isn't needed *** - /* - let V = [...P, ...Q].sort((a, b) => a-b); // derive: sorted valid - let M = r()-1; // number of combining mark - if (M < 0) { // whitelisted - M = new Map(read_array_while(() => { - let i = r(); - if (i) return [V[i-1], read_array_while(() => { - let v = read_array_while(r); - if (v.length) return v.map(x => x-1); - })]; - })); - }*/ - return {N, P, Q, M, R}; - } - }); - - // decode compressed wholes - WHOLE_VALID = read_sorted_set(); - WHOLE_MAP = new Map(); - let wholes = read_sorted_array().concat(Array_from(WHOLE_VALID)).sort((a, b) => a-b); // must be sorted - wholes.forEach((cp, i) => { - let d = r(); - let w = wholes[i] = d ? wholes[i-d] : {V: [], M: new Map()}; - w.V.push(cp); // add to member set - if (!WHOLE_VALID.has(cp)) { - WHOLE_MAP.set(cp, w); // register with whole map - } - }); - - // compute confusable-extent complements - // usage: WHOLE_MAP.get(cp).M.get(cp) = complement set - for (let {V, M} of new Set(WHOLE_MAP.values())) { - // connect all groups that have each whole character - let recs = []; - for (let cp of V) { - let gs = GROUPS.filter(g => group_has_cp(g, cp)); - let rec = recs.find(({G}) => gs.some(g => G.has(g))); - if (!rec) { - rec = {G: new Set(), V: []}; - recs.push(rec); - } - rec.V.push(cp); - set_add_many(rec.G, gs); - } - // per character cache groups which are not a member of the extent - let union = recs.flatMap(x => Array_from(x.G)); // all of the groups used by this whole - for (let {G, V} of recs) { - let complement = new Set(union.filter(g => !G.has(g))); // groups not covered by the extent - for (let cp of V) { - M.set(cp, complement); // this is the same reference - } - } - } - - // compute valid set - // 20230924: VALID was union but can be re-used - VALID = new Set(); // exists in 1+ groups - let multi = new Set(); // exists in 2+ groups - const add_to_union = cp => VALID.has(cp) ? multi.add(cp) : VALID.add(cp); - for (let g of GROUPS) { - for (let cp of g.P) add_to_union(cp); - for (let cp of g.Q) add_to_union(cp); - } - // dual purpose WHOLE_MAP: return placeholder if unique non-confusable - for (let cp of VALID) { - if (!WHOLE_MAP.has(cp) && !multi.has(cp)) { - WHOLE_MAP.set(cp, UNIQUE_PH); - } - } - // add all decomposed parts - // see derive: "Valid is Closed (via Brute-force)" - set_add_many(VALID, nfd(VALID)); - - // decode emoji - // 20230719: emoji are now fully-expanded to avoid quirk logic - EMOJI_LIST = read_trie(r).map(v => Emoji.from(v)).sort(compare_arrays); - EMOJI_ROOT = new Map(); // this has approx 7K nodes (2+ per emoji) - for (let cps of EMOJI_LIST) { - // 20230719: change to *slightly* stricter algorithm which disallows - // insertion of misplaced FE0F in emoji sequences (matching ENSIP-15) - // example: beautified [A B] (eg. flag emoji) - // before: allow: [A FE0F B], error: [A FE0F FE0F B] - // after: error: both - // note: this code now matches ENSNormalize.{cs,java} logic - let prev = [EMOJI_ROOT]; - for (let cp of cps) { - let next = prev.map(node => { - let child = node.get(cp); - if (!child) { - // should this be object? - // (most have 1-2 items, few have many) - // 20230719: no, v8 default map is 4? - child = new Map(); - node.set(cp, child); - } - return child; - }); - if (cp === FE0F) { - prev.push(...next); // less than 20 elements - } else { - prev = next; - } - } - for (let x of prev) { - x.V = cps; - } - } -} - -// if escaped: {HEX} -// else: "x" {HEX} -function quoted_cp(cp) { - return (should_escape(cp) ? '' : `${bidi_qq(safe_str_from_cps([cp]))} `) + quote_cp(cp); -} - -// 20230211: some messages can be mixed-directional and result in spillover -// use 200E after a quoted string to force the remainder of a string from -// acquring the direction of the quote -// https://www.w3.org/International/questions/qa-bidi-unicode-controls#exceptions -function bidi_qq(s) { - return `"${s}"\u200E`; // strong LTR -} - -function check_label_extension(cps) { - if (cps.length >= 4 && cps[2] == HYPHEN && cps[3] == HYPHEN) { - throw new Error(`invalid label extension: "${str_from_cps(cps.slice(0, 4))}"`); // this can only be ascii so cant be bidi - } -} -function check_leading_underscore(cps) { - const UNDERSCORE = 0x5F; - for (let i = cps.lastIndexOf(UNDERSCORE); i > 0; ) { - if (cps[--i] !== UNDERSCORE) { - throw new Error('underscore allowed only at start'); - } - } -} -// check that a fenced cp is not leading, trailing, or touching another fenced cp -function check_fenced(cps) { - let cp = cps[0]; - let prev = FENCED.get(cp); - if (prev) throw error_placement(`leading ${prev}`); - let n = cps.length; - let last = -1; // prevents trailing from throwing - for (let i = 1; i < n; i++) { - cp = cps[i]; - let match = FENCED.get(cp); - if (match) { - // since cps[0] isn't fenced, cps[1] cannot throw - if (last == i) throw error_placement(`${prev} + ${match}`); - last = i + 1; - prev = match; - } - } - if (last == n) throw error_placement(`trailing ${prev}`); -} - -// create a safe to print string -// invisibles are escaped -// leading cm uses placeholder -// if cps exceed max, middle truncate with ellipsis -// quoter(cp) => string, eg. 3000 => "{3000}" -// note: in html, you'd call this function then replace [<>&] with entities -function safe_str_from_cps(cps, max = Infinity, quoter = quote_cp) { - //if (Number.isInteger(cps)) cps = [cps]; - //if (!Array.isArray(cps)) throw new TypeError(`expected codepoints`); - let buf = []; - if (is_combining_mark(cps[0])) buf.push('◌'); - if (cps.length > max) { - max >>= 1; - cps = [...cps.slice(0, max), 0x2026, ...cps.slice(-max)]; - } - let prev = 0; - let n = cps.length; - for (let i = 0; i < n; i++) { - let cp = cps[i]; - if (should_escape(cp)) { - buf.push(str_from_cps(cps.slice(prev, i))); - buf.push(quoter(cp)); - prev = i + 1; - } - } - buf.push(str_from_cps(cps.slice(prev, n))); - return buf.join(''); -} - -// note: set(s) cannot be exposed because they can be modified -// note: Object.freeze() doesn't work -function is_combining_mark(cp) { - init(); - return CM.has(cp); -} -function should_escape(cp) { - init(); - return ESCAPE.has(cp); -} - -// return all supported emoji as fully-qualified emoji -// ordered by length then lexicographic -function ens_emoji() { - init(); - return EMOJI_LIST.map(x => x.slice()); // emoji are exposed so copy -} - -function ens_normalize_fragment(frag, decompose) { - init(); - let nf = decompose ? nfd : nfc; - return frag.split(STOP_CH).map(label => str_from_cps(tokens_from_str(explode_cp(label), nf, filter_fe0f).flat())).join(STOP_CH); -} - -function ens_normalize(name) { - return flatten(split(name, nfc, filter_fe0f)); -} - -function ens_beautify(name) { - let labels = split(name, nfc, x => x); // emoji not exposed - for (let {type, output, error} of labels) { - if (error) break; // flatten will throw - - // replace leading/trailing hyphen - // 20230121: consider beautifing all or leading/trailing hyphen to unicode variant - // not exactly the same in every font, but very similar: "-" vs "‐" - /* - const UNICODE_HYPHEN = 0x2010; - // maybe this should replace all for visual consistancy? - // `node tools/reg-count.js regex ^-\{2,\}` => 592 - //for (let i = 0; i < output.length; i++) if (output[i] == 0x2D) output[i] = 0x2010; - if (output[0] == HYPHEN) output[0] = UNICODE_HYPHEN; - let end = output.length-1; - if (output[end] == HYPHEN) output[end] = UNICODE_HYPHEN; - */ - // 20230123: WHATWG URL uses "CheckHyphens" false - // https://url.spec.whatwg.org/#idna - - // update ethereum symbol - // ξ => Ξ if not greek - if (type !== 'Greek') array_replace(output, 0x3BE, 0x39E); - - // 20221213: fixes bidi subdomain issue, but breaks invariant (200E is disallowed) - // could be fixed with special case for: 2D (.) + 200E (LTR) - // https://discuss.ens.domains/t/bidi-label-ordering-spoof/15824 - //output.splice(0, 0, 0x200E); - } - return flatten(labels); -} - -function array_replace(v, a, b) { - let prev = 0; - while (true) { - let next = v.indexOf(a, prev); - if (next < 0) break; - v[next] = b; - prev = next + 1; - } -} - -function ens_split(name, preserve_emoji) { - return split(name, nfc, preserve_emoji ? x => x.slice() : filter_fe0f); // emoji are exposed so copy -} - -function split(name, nf, ef) { - if (!name) return []; // 20230719: empty name allowance - init(); - let offset = 0; - // https://unicode.org/reports/tr46/#Validity_Criteria - // 4.) "The label must not contain a U+002E ( . ) FULL STOP." - return name.split(STOP_CH).map(label => { - let input = explode_cp(label); - let info = { - input, - offset, // codepoint, not substring! - }; - offset += input.length + 1; // + stop - try { - // 1.) "The label must be in Unicode Normalization Form NFC" - let tokens = info.tokens = tokens_from_str(input, nf, ef); - let token_count = tokens.length; - let type; - if (!token_count) { // the label was effectively empty (could of had ignored characters) - //norm = []; - //type = 'None'; // use this instead of next match, "ASCII" - // 20230120: change to strict - // https://discuss.ens.domains/t/ens-name-normalization-2nd/14564/59 - throw new Error(`empty label`); - } - let norm = info.output = tokens.flat(); - check_leading_underscore(norm); - let emoji = info.emoji = token_count > 1 || tokens[0].is_emoji; // same as: tokens.some(x => x.is_emoji); - if (!emoji && norm.every(cp => cp < 0x80)) { // special case for ascii - // 20230123: matches matches WHATWG, see note 3.3 - check_label_extension(norm); // only needed for ascii - // cant have fenced - // cant have cm - // cant have wholes - // see derive: "Fastpath ASCII" - type = 'ASCII'; - } else { - let chars = tokens.flatMap(x => x.is_emoji ? [] : x); // all of the nfc tokens concat together - if (!chars.length) { // theres no text, just emoji - type = 'Emoji'; - } else { - // 5.) "The label must not begin with a combining mark, that is: General_Category=Mark." - if (CM.has(norm[0])) throw error_placement('leading combining mark'); - for (let i = 1; i < token_count; i++) { // we've already checked the first token - let cps = tokens[i]; - if (!cps.is_emoji && CM.has(cps[0])) { // every text token has emoji neighbors, eg. EtEEEtEt... - // bidi_qq() not needed since emoji is LTR and cps is a CM - throw error_placement(`emoji + combining mark: "${str_from_cps(tokens[i-1])} + ${safe_str_from_cps([cps[0]])}"`); - } - } - check_fenced(norm); - let unique = Array_from(new Set(chars)); - let [g] = determine_group(unique); // take the first match - // see derive: "Matching Groups have Same CM Style" - // alternative: could form a hybrid type: Latin/Japanese/... - check_group(g, chars); // need text in order - check_whole(g, unique); // only need unique text (order would be required for multiple-char confusables) - type = g.N; - // 20230121: consider exposing restricted flag - // it's simpler to just check for 'Restricted' - // or even better: type.endsWith(']') - //if (g.R) info.restricted = true; - } - } - info.type = type; - } catch (err) { - info.error = err; // use full error object - } - return info; - }); -} - -function check_whole(group, unique) { - let maker; - let shared = []; - for (let cp of unique) { - let whole = WHOLE_MAP.get(cp); - if (whole === UNIQUE_PH) return; // unique, non-confusable - if (whole) { - let set = whole.M.get(cp); // groups which have a character that look-like this character - maker = maker ? maker.filter(g => set.has(g)) : Array_from(set); - if (!maker.length) return; // confusable intersection is empty - } else { - shared.push(cp); - } - } - if (maker) { - // we have 1+ confusable - // check if any of the remaining groups - // contain the shared characters too - for (let g of maker) { - if (shared.every(cp => group_has_cp(g, cp))) { - throw new Error(`whole-script confusable: ${group.N}/${g.N}`); - } - } - } -} - -// assumption: unique.size > 0 -// returns list of matching groups -function determine_group(unique) { - let groups = GROUPS; - for (let cp of unique) { - // note: we need to dodge CM that are whitelisted - // but that code isn't currently necessary - let gs = groups.filter(g => group_has_cp(g, cp)); - if (!gs.length) { - if (!GROUPS.some(g => group_has_cp(g, cp))) { - // the character was composed of valid parts - // but it's NFC form is invalid - // 20230716: change to more exact statement, see: ENSNormalize.{cs,java} - // note: this doesn't have to be a composition - // 20230720: change to full check - throw error_disallowed(cp); // this should be rare - } else { - // there is no group that contains all these characters - // throw using the highest priority group that matched - // https://www.unicode.org/reports/tr39/#mixed_script_confusables - throw error_group_member(groups[0], cp); - } - } - groups = gs; - if (gs.length == 1) break; // there is only one group left - } - // there are at least 1 group(s) with all of these characters - return groups; -} - -// throw on first error -function flatten(split) { - return split.map(({input, error, output}) => { - if (error) { - // don't print label again if just a single label - let msg = error.message; - // bidi_qq() only necessary if msg is digits - throw new Error(split.length == 1 ? msg : `Invalid label ${bidi_qq(safe_str_from_cps(input, 63))}: ${msg}`); - } - return str_from_cps(output); - }).join(STOP_CH); -} - -function error_disallowed(cp) { - // TODO: add cp to error? - return new Error(`disallowed character: ${quoted_cp(cp)}`); -} -function error_group_member(g, cp) { - let quoted = quoted_cp(cp); - let gg = GROUPS.find(g => g.P.has(cp)); // only check primary - if (gg) { - quoted = `${gg.N} ${quoted}`; - } - return new Error(`illegal mixture: ${g.N} + ${quoted}`); -} -function error_placement(where) { - return new Error(`illegal placement: ${where}`); -} - -// assumption: cps.length > 0 -// assumption: cps[0] isn't a CM -// assumption: the previous character isn't an emoji -function check_group(g, cps) { - for (let cp of cps) { - if (!group_has_cp(g, cp)) { - // for whitelisted scripts, this will throw illegal mixture on invalid cm, eg. "e{300}{300}" - // at the moment, it's unnecessary to introduce an extra error type - // until there exists a whitelisted multi-character - // eg. if (M < 0 && is_combining_mark(cp)) { ... } - // there are 3 cases: - // 1. illegal cm for wrong group => mixture error - // 2. illegal cm for same group => cm error - // requires set of whitelist cm per group: - // eg. new Set([...g.P, ...g.Q].flatMap(nfc).filter(cp => CM.has(cp))) - // 3. wrong group => mixture error - throw error_group_member(g, cp); - } - } - //if (M >= 0) { // we have a known fixed cm count - if (g.M) { // we need to check for NSM - let decomposed = nfd(cps); - for (let i = 1, e = decomposed.length; i < e; i++) { // see: assumption - // 20230210: bugfix: using cps instead of decomposed h/t Carbon225 - /* - if (CM.has(decomposed[i])) { - let j = i + 1; - while (j < e && CM.has(decomposed[j])) j++; - if (j - i > M) { - throw new Error(`too many combining marks: ${g.N} ${bidi_qq(str_from_cps(decomposed.slice(i-1, j)))} (${j-i}/${M})`); - } - i = j; - } - */ - // 20230217: switch to NSM counting - // https://www.unicode.org/reports/tr39/#Optional_Detection - if (NSM.has(decomposed[i])) { - let j = i + 1; - for (let cp; j < e && NSM.has(cp = decomposed[j]); j++) { - // a. Forbid sequences of the same nonspacing mark. - for (let k = i; k < j; k++) { // O(n^2) but n < 100 - if (decomposed[k] == cp) { - throw new Error(`duplicate non-spacing marks: ${quoted_cp(cp)}`); - } - } - } - // parse to end so we have full nsm count - // b. Forbid sequences of more than 4 nonspacing marks (gc=Mn or gc=Me). - if (j - i > NSM_MAX) { - // note: this slice starts with a base char or spacing-mark cm - throw new Error(`excessive non-spacing marks: ${bidi_qq(safe_str_from_cps(decomposed.slice(i-1, j)))} (${j-i}/${NSM_MAX})`); - } - i = j; - } - } - } - // *** this code currently isn't needed *** - /* - let cm_whitelist = M instanceof Map; - for (let i = 0, e = cps.length; i < e; ) { - let cp = cps[i++]; - let seqs = cm_whitelist && M.get(cp); - if (seqs) { - // list of codepoints that can follow - // if this exists, this will always be 1+ - let j = i; - while (j < e && CM.has(cps[j])) j++; - let cms = cps.slice(i, j); - let match = seqs.find(seq => !compare_arrays(seq, cms)); - if (!match) throw new Error(`disallowed combining mark sequence: "${safe_str_from_cps([cp, ...cms])}"`); - i = j; - } else if (!V.has(cp)) { - // https://www.unicode.org/reports/tr39/#mixed_script_confusables - let quoted = quoted_cp(cp); - for (let cp of cps) { - let u = UNIQUE.get(cp); - if (u && u !== g) { - // if both scripts are restricted this error is confusing - // because we don't differentiate RestrictedA from RestrictedB - if (!u.R) quoted = `${quoted} is ${u.N}`; - break; - } - } - throw new Error(`disallowed ${g.N} character: ${quoted}`); - //throw new Error(`disallowed character: ${quoted} (expected ${g.N})`); - //throw new Error(`${g.N} does not allow: ${quoted}`); - } - } - if (!cm_whitelist) { - let decomposed = nfd(cps); - for (let i = 1, e = decomposed.length; i < e; i++) { // we know it can't be cm leading - if (CM.has(decomposed[i])) { - let j = i + 1; - while (j < e && CM.has(decomposed[j])) j++; - if (j - i > M) { - throw new Error(`too many combining marks: "${str_from_cps(decomposed.slice(i-1, j))}" (${j-i}/${M})`); - } - i = j; - } - } - } - */ -} - -// given a list of codepoints -// returns a list of lists, where emoji are a fully-qualified (as Array subclass) -// eg. explode_cp("abc💩d") => [[61, 62, 63], Emoji[1F4A9, FE0F], [64]] -// 20230818: rename for 'process' name collision h/t Javarome -// https://github.com/adraffy/ens-normalize.js/issues/23 -function tokens_from_str(input, nf, ef) { - let ret = []; - let chars = []; - input = input.slice().reverse(); // flip so we can pop - while (input.length) { - let emoji = consume_emoji_reversed(input); - if (emoji) { - if (chars.length) { - ret.push(nf(chars)); - chars = []; - } - ret.push(ef(emoji)); - } else { - let cp = input.pop(); - if (VALID.has(cp)) { - chars.push(cp); - } else { - let cps = MAPPED.get(cp); - if (cps) { - chars.push(...cps); // less than 10 elements - } else if (!IGNORED.has(cp)) { - // 20230912: unicode 15.1 changed the order of processing such that - // disallowed parts are only rejected after NFC - // https://unicode.org/reports/tr46/#Validity_Criteria - // this doesn't impact normalization as of today - // technically, this error can be removed as the group logic will apply similar logic - // however the error type might be less clear - throw error_disallowed(cp); - } - } - } - } - if (chars.length) { - ret.push(nf(chars)); - } - return ret; -} - -function filter_fe0f(cps) { - return cps.filter(cp => cp != FE0F); -} - -// given array of codepoints -// returns the longest valid emoji sequence (or undefined if no match) -// *MUTATES* the supplied array -// disallows interleaved ignored characters -// fills (optional) eaten array with matched codepoints -function consume_emoji_reversed(cps, eaten) { - let node = EMOJI_ROOT; - let emoji; - let pos = cps.length; - while (pos) { - node = node.get(cps[--pos]); - if (!node) break; - let {V} = node; - if (V) { // this is a valid emoji (so far) - emoji = V; - if (eaten) eaten.push(...cps.slice(pos).reverse()); // (optional) copy input, used for ens_tokenize() - cps.length = pos; // truncate - } - } - return emoji; -} - -// ************************************************************ -// tokenizer - -const TY_VALID = 'valid'; -const TY_MAPPED = 'mapped'; -const TY_IGNORED = 'ignored'; -const TY_DISALLOWED = 'disallowed'; -const TY_EMOJI = 'emoji'; -const TY_NFC = 'nfc'; -const TY_STOP = 'stop'; - -function ens_tokenize(name, { - nf = true, // collapse unnormalized runs into a single token -} = {}) { - init(); - let input = explode_cp(name).reverse(); - let eaten = []; - let tokens = []; - while (input.length) { - let emoji = consume_emoji_reversed(input, eaten); - if (emoji) { - tokens.push({ - type: TY_EMOJI, - emoji: emoji.slice(), // copy emoji - input: eaten, - cps: filter_fe0f(emoji) - }); - eaten = []; // reset buffer - } else { - let cp = input.pop(); - if (cp == STOP) { - tokens.push({type: TY_STOP, cp}); - } else if (VALID.has(cp)) { - tokens.push({type: TY_VALID, cps: [cp]}); - } else if (IGNORED.has(cp)) { - tokens.push({type: TY_IGNORED, cp}); - } else { - let cps = MAPPED.get(cp); - if (cps) { - tokens.push({type: TY_MAPPED, cp, cps: cps.slice()}); - } else { - tokens.push({type: TY_DISALLOWED, cp}); - } - } - } - } - if (nf) { - for (let i = 0, start = -1; i < tokens.length; i++) { - let token = tokens[i]; - if (is_valid_or_mapped(token.type)) { - if (requires_check(token.cps)) { // normalization might be needed - let end = i + 1; - for (let pos = end; pos < tokens.length; pos++) { // find adjacent text - let {type, cps} = tokens[pos]; - if (is_valid_or_mapped(type)) { - if (!requires_check(cps)) break; - end = pos + 1; - } else if (type !== TY_IGNORED) { // || type !== TY_DISALLOWED) { - break; - } - } - if (start < 0) start = i; - let slice = tokens.slice(start, end); - let cps0 = slice.flatMap(x => is_valid_or_mapped(x.type) ? x.cps : []); // strip junk tokens - let cps = nfc(cps0); - if (compare_arrays(cps, cps0)) { // bundle into an nfc token - tokens.splice(start, end - start, { - type: TY_NFC, - input: cps0, // there are 3 states: tokens0 ==(process)=> input ==(nfc)=> tokens/cps - cps, - tokens0: collapse_valid_tokens(slice), - tokens: ens_tokenize(str_from_cps(cps), {nf: false}) - }); - i = start; - } else { - i = end - 1; // skip to end of slice - } - start = -1; // reset - } else { - start = i; // remember last - } - } else if (token.type !== TY_IGNORED) { // 20221024: is this correct? - start = -1; // reset - } - } - } - return collapse_valid_tokens(tokens); -} - -function is_valid_or_mapped(type) { - return type == TY_VALID || type == TY_MAPPED; -} - -function requires_check(cps) { - return cps.some(cp => NFC_CHECK.has(cp)); -} - -function collapse_valid_tokens(tokens) { - for (let i = 0; i < tokens.length; i++) { - if (tokens[i].type == TY_VALID) { - let j = i + 1; - while (j < tokens.length && tokens[j].type == TY_VALID) j++; - tokens.splice(i, j - i, {type: TY_VALID, cps: tokens.slice(i, j).flatMap(x => x.cps)}); - } - } - return tokens; -} - -exports.ens_beautify = ens_beautify; -exports.ens_emoji = ens_emoji; -exports.ens_normalize = ens_normalize; -exports.ens_normalize_fragment = ens_normalize_fragment; -exports.ens_split = ens_split; -exports.ens_tokenize = ens_tokenize; -exports.is_combining_mark = is_combining_mark; -exports.nfc = nfc; -exports.nfd = nfd; -exports.safe_str_from_cps = safe_str_from_cps; -exports.should_escape = should_escape; diff --git a/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/dist/index-xnf.min.js b/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/dist/index-xnf.min.js deleted file mode 100644 index 58198e67..00000000 --- a/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/dist/index-xnf.min.js +++ /dev/null @@ -1 +0,0 @@ -var A="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDX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lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const e=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),t=4;function n(A){return 1&A?~A>>1:A>>1}function r(A,e){let t=Array(A);for(let r=0,l=0;r[]));for(let l=0;ln[e].push(A)));return n}function s(A,e){let t=1+e(),n=e(),r=o(e);return f(r.length,1+A,e).flatMap(((A,e)=>{let[l,...o]=A;return Array(r[e]).fill().map(((A,e)=>{let r=e*n;return[l+e*t,o.map((A=>A+r))]}))}))}function w(A,e){return f(1+e(),1+A,e).map((A=>[A[0],A.slice(1)]))}function i(A){return`{${function(A){return A.toString(16).toUpperCase().padStart(2,"0")}(A)}}`}function B(A){let e=[];for(let t=0,n=A.length;tArray.from(A);function a(A,e){return A.P.has(e)||A.Q.has(e)}class R extends Array{get is_emoji(){return!0}}let G,k,F,U,H,J,K,N,O,m,Y,V;function P(){if(G)return;let e=function(A){let e=0;return()=>A[e++]}(function(A){let e=0;function t(){return A[e++]<<8|A[e++]}let n=t(),r=1,l=[0,1];for(let A=1;A>--s&1}const B=2**31,Q=B>>>1,g=B-1;let D=0;for(let A=0;A<31;A++)D=D<<1|i();let C=[],c=0,M=B;for(;;){let A=Math.floor(((D-c+1)*r-1)/M),e=0,t=n;for(;t-e>1;){let n=e+t>>>1;A>>1|i(),o=o<<1^Q,f=(f^Q)<<1|Q|1;c=o,M=1+f-o}let p=n-4;return C.map((e=>{switch(e-p){case 3:return p+65792+(A[f++]<<16|A[f++]<<8|A[f++]);case 2:return p+256+(A[f++]<<8|A[f++]);case 1:return p+A[f++];default:return e-1}}))}(function(A){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach(((A,t)=>e[A.charCodeAt(0)]=t));let t=A.length,n=new Uint8Array(6*t>>3);for(let r=0,l=0,o=0,f=0;r=8&&(n[l++]=f>>(o-=8));return n}(A)));const t=()=>l(e),n=()=>new Set(t()),r=(A,e)=>e.forEach((e=>A.add(e)));G=new Map(function(A){let e=[];for(;;){let t=A();if(0==t)break;e.push(s(t,A))}for(;;){let t=A()-1;if(t<0)break;e.push(w(t,A))}return e.flat()}(e)),k=n(),F=t(),U=new Set(t().map((A=>F[A]))),F=new Set(F),H=n(),J=n();let f=(i=e,o((()=>{let A=l(i);if(A.length)return A})));var i;let B=e();const D=()=>{let A=new Set;return t().forEach((e=>r(A,f[e]))),r(A,t()),A};K=o((A=>{let t=o(e).map((A=>A+96));if(t.length){let n=A>=B;return t[0]-=32,t=Q(t),n&&(t=`Restricted[${t}]`),{N:t,P:D(),Q:D(),M:!e(),R:n}}})),N=n(),O=new Map;let C=t().concat(I(N)).sort(((A,e)=>A-e));C.forEach(((A,t)=>{let n=e(),r=C[t]=n?C[t-n]:{V:[],M:new Map};r.V.push(A),N.has(A)||O.set(A,r)}));for(let{V:A,M:e}of new Set(O.values())){let t=[];for(let e of A){let A=K.filter((A=>a(A,e))),n=t.find((({G:e})=>A.some((A=>e.has(A)))));n||(n={G:new Set,V:[]},t.push(n)),n.V.push(e),r(n.G,A)}let n=t.flatMap((A=>I(A.G)));for(let{G:A,V:r}of t){let t=new Set(n.filter((e=>!A.has(e))));for(let A of r)e.set(A,t)}}m=new Set;let M=new Set;const p=A=>m.has(A)?M.add(A):m.add(A);for(let A of K){for(let e of A.P)p(e);for(let e of A.Q)p(e)}for(let A of m)O.has(A)||M.has(A)||O.set(A,h);r(m,c(m)),Y=function(A){let e=[],t=l(A);return function A({S:t,B:n},r,l){if(!(4&t&&l===r[r.length-1])){2&t&&(l=r[r.length-1]),1&t&&e.push(r);for(let e of n)for(let t of e.Q)A(e,[...r,t],l)}}(function e(n){return{S:A(),B:o((()=>{let n=l(A).map((A=>t[A]));if(n.length)return e(n)})),Q:n}}([]),[]),e}(e).map((A=>R.from(A))).sort(g),V=new Map;for(let A of Y){let e=[V];for(let t of A){let A=e.map((A=>{let e=A.get(t);return e||(e=new Map,A.set(t,e)),e}));t===E?e.push(...A):e=A}for(let t of e)t.V=A}}function d(A){return(y(A)?"":`${z(S([A]))} `)+i(A)}function z(A){return`"${A}"‎`}function S(A,e=1/0,t=i){let n=[];Z(A[0])&&n.push("◌"),A.length>e&&(e>>=1,A=[...A.slice(0,e),8230,...A.slice(-e)]);let r=0,l=A.length;for(let e=0;eA.slice()))}function j(A,e){P();let t=e?c:C;return A.split(u).map((A=>Q(AA(B(A),t,eA).flat()))).join(u)}function L(A){return W(q(A,C,eA))}function X(A){let e=q(A,C,(A=>A));for(let{type:A,output:t,error:n}of e){if(n)break;"Greek"!==A&&v(t,958,926)}return W(e)}function v(A,e,t){let n=0;for(;;){let r=A.indexOf(e,n);if(r<0)break;A[r]=t,n=r+1}}function x(A,e){return q(A,C,e?A=>A.slice():eA)}function q(A,n,r){if(!A)return[];P();let l=0;return A.split(u).map((A=>{let o=B(A),f={input:o,offset:l};l+=o.length+1;try{let A,l=f.tokens=AA(o,n,r),s=l.length;if(!s)throw new Error("empty label");let w=f.output=l.flat();if(function(A){for(let e=A.lastIndexOf(95);e>0;)if(95!==A[--e])throw new Error("underscore allowed only at start")}(w),!(f.emoji=s>1||l[0].is_emoji)&&w.every((A=>A<128)))!function(A){if(A.length>=4&&A[2]==M&&A[3]==M)throw new Error(`invalid label extension: "${Q(A.slice(0,4))}"`)}(w),A="ASCII";else{let n=l.flatMap((A=>A.is_emoji?[]:A));if(n.length){if(F.has(w[0]))throw _("leading combining mark");for(let A=1;Aa(A,t)));if(!A.length)throw K.some((A=>a(A,t)))?$(e[0],t):T(t);if(e=A,1==A.length)break}return e}(r);!function(A,e){for(let t of e)if(!a(A,t))throw $(A,t);if(A.M){let A=c(e);for(let e=1,n=A.length;et)throw new Error(`excessive non-spacing marks: ${z(S(A.slice(e-1,r)))} (${r-e}/${t})`);e=r}}}(o,n),function(A,e){let t,n=[];for(let A of e){let e=O.get(A);if(e===h)return;if(e){let n=e.M.get(A);if(t=t?t.filter((A=>n.has(A))):I(n),!t.length)return}else n.push(A)}if(t)for(let e of t)if(n.every((A=>a(e,A))))throw new Error(`whole-script confusable: ${A.N}/${e.N}`)}(o,r),A=o.N}else A="Emoji"}f.type=A}catch(A){f.error=A}return f}))}function W(A){return A.map((({input:e,error:t,output:n})=>{if(t){let n=t.message;throw new Error(1==A.length?n:`Invalid label ${z(S(e,63))}: ${n}`)}return Q(n)})).join(u)}function T(A){return new Error(`disallowed character: ${d(A)}`)}function $(A,e){let t=d(e),n=K.find((A=>A.P.has(e)));return n&&(t=`${n.N} ${t}`),new Error(`illegal mixture: ${A.N} + ${t}`)}function _(A){return new Error(`illegal placement: ${A}`)}function AA(A,e,t){let n=[],r=[];for(A=A.slice().reverse();A.length;){let l=tA(A);if(l)r.length&&(n.push(e(r)),r=[]),n.push(t(l));else{let e=A.pop();if(m.has(e))r.push(e);else{let A=G.get(e);if(A)r.push(...A);else if(!k.has(e))throw T(e)}}}return r.length&&n.push(e(r)),n}function eA(A){return A.filter((A=>A!=E))}function tA(A,e){let t,n=V,r=A.length;for(;r&&(n=n.get(A[--r]),n);){let{V:l}=n;l&&(t=l,e&&e.push(...A.slice(r).reverse()),A.length=r)}return t}const nA="valid",rA="mapped",lA="ignored",oA="disallowed",fA="emoji",sA="nfc",wA="stop";function iA(A,{nf:e=!0}={}){P();let t=B(A).reverse(),n=[],r=[];for(;t.length;){let A=tA(t,n);if(A)r.push({type:fA,emoji:A.slice(),input:n,cps:eA(A)}),n=[];else{let A=t.pop();if(A==p)r.push({type:wA,cp:A});else if(m.has(A))r.push({type:nA,cps:[A]});else if(k.has(A))r.push({type:lA,cp:A});else{let e=G.get(A);e?r.push({type:rA,cp:A,cps:e.slice()}):r.push({type:oA,cp:A})}}}if(e)for(let A=0,e=-1;ABA(A.type)?A.cps:[])),o=C(l);g(o,l)?(r.splice(e,t-e,{type:sA,input:l,cps:o,tokens0:gA(n),tokens:iA(Q(o),{nf:!1})}),A=e):A=t-1,e=-1}else e=A;else t.type!==lA&&(e=-1)}return gA(r)}function BA(A){return A==nA||A==rA}function QA(A){return A.some((A=>J.has(A)))}function gA(A){for(let e=0;eA.cps))})}return A}export{X as ens_beautify,b as ens_emoji,L as ens_normalize,j as ens_normalize_fragment,x as ens_split,iA as ens_tokenize,Z as is_combining_mark,C as nfc,c as nfd,S as safe_str_from_cps,y as should_escape}; diff --git a/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/dist/index-xnf.mjs b/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/dist/index-xnf.mjs deleted file mode 100644 index 75c7fe13..00000000 --- a/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/dist/index-xnf.mjs +++ /dev/null @@ -1,1065 +0,0 @@ -// created 2023-09-25T01:01:55.148Z -// compressed base64-encoded blob for include-ens data -// source: https://github.com/adraffy/ens-normalize.js/blob/main/src/make.js -// see: https://github.com/adraffy/ens-normalize.js#security -// SHA-256: 0565ed049b9cf1614bb9e11ba7d8ac6a6fb96c893253d890f7e2b2884b9ded32 -var COMPRESSED = 'AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQ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xTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI'; -const FENCED = new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]); -const NSM_MAX = 4; - -function decode_arithmetic(bytes) { - let pos = 0; - function u16() { return (bytes[pos++] << 8) | bytes[pos++]; } - - // decode the frequency table - let symbol_count = u16(); - let total = 1; - let acc = [0, 1]; // first symbol has frequency 1 - for (let i = 1; i < symbol_count; i++) { - acc.push(total += u16()); - } - - // skip the sized-payload that the last 3 symbols index into - let skip = u16(); - let pos_payload = pos; - pos += skip; - - let read_width = 0; - let read_buffer = 0; - function read_bit() { - if (read_width == 0) { - // this will read beyond end of buffer - // but (undefined|0) => zero pad - read_buffer = (read_buffer << 8) | bytes[pos++]; - read_width = 8; - } - return (read_buffer >> --read_width) & 1; - } - - const N = 31; - const FULL = 2**N; - const HALF = FULL >>> 1; - const QRTR = HALF >> 1; - const MASK = FULL - 1; - - // fill register - let register = 0; - for (let i = 0; i < N; i++) register = (register << 1) | read_bit(); - - let symbols = []; - let low = 0; - let range = FULL; // treat like a float - while (true) { - let value = Math.floor((((register - low + 1) * total) - 1) / range); - let start = 0; - let end = symbol_count; - while (end - start > 1) { // binary search - let mid = (start + end) >>> 1; - if (value < acc[mid]) { - end = mid; - } else { - start = mid; - } - } - if (start == 0) break; // first symbol is end mark - symbols.push(start); - let a = low + Math.floor(range * acc[start] / total); - let b = low + Math.floor(range * acc[start+1] / total) - 1; - while (((a ^ b) & HALF) == 0) { - register = (register << 1) & MASK | read_bit(); - a = (a << 1) & MASK; - b = (b << 1) & MASK | 1; - } - while (a & ~b & QRTR) { - register = (register & HALF) | ((register << 1) & (MASK >>> 1)) | read_bit(); - a = (a << 1) ^ HALF; - b = ((b ^ HALF) << 1) | HALF | 1; - } - low = a; - range = 1 + b - a; - } - let offset = symbol_count - 4; - return symbols.map(x => { // index into payload - switch (x - offset) { - case 3: return offset + 0x10100 + ((bytes[pos_payload++] << 16) | (bytes[pos_payload++] << 8) | bytes[pos_payload++]); - case 2: return offset + 0x100 + ((bytes[pos_payload++] << 8) | bytes[pos_payload++]); - case 1: return offset + bytes[pos_payload++]; - default: return x - 1; - } - }); -} - -// returns an iterator which returns the next symbol -function read_payload(v) { - let pos = 0; - return () => v[pos++]; -} -function read_compressed_payload(s) { - return read_payload(decode_arithmetic(unsafe_atob(s))); -} - -// unsafe in the sense: -// expected well-formed Base64 w/o padding -// 20220922: added for https://github.com/adraffy/ens-normalize.js/issues/4 -function unsafe_atob(s) { - let lookup = []; - [...'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'].forEach((c, i) => lookup[c.charCodeAt(0)] = i); - let n = s.length; - let ret = new Uint8Array((6 * n) >> 3); - for (let i = 0, pos = 0, width = 0, carry = 0; i < n; i++) { - carry = (carry << 6) | lookup[s.charCodeAt(i)]; - width += 6; - if (width >= 8) { - ret[pos++] = (carry >> (width -= 8)); - } - } - return ret; -} - -// eg. [0,1,2,3...] => [0,-1,1,-2,...] -function signed(i) { - return (i & 1) ? (~i >> 1) : (i >> 1); -} - -function read_deltas(n, next) { - let v = Array(n); - for (let i = 0, x = 0; i < n; i++) v[i] = x += signed(next()); - return v; -} - -// [123][5] => [0 3] [1 1] [0 0] -function read_sorted(next, prev = 0) { - let ret = []; - while (true) { - let x = next(); - let n = next(); - if (!n) break; - prev += x; - for (let i = 0; i < n; i++) { - ret.push(prev + i); - } - prev += n + 1; - } - return ret; -} - -function read_sorted_arrays(next) { - return read_array_while(() => { - let v = read_sorted(next); - if (v.length) return v; - }); -} - -// returns map of x => ys -function read_mapped(next) { - let ret = []; - while (true) { - let w = next(); - if (w == 0) break; - ret.push(read_linear_table(w, next)); - } - while (true) { - let w = next() - 1; - if (w < 0) break; - ret.push(read_replacement_table(w, next)); - } - return ret.flat(); -} - -// read until next is falsy -// return array of read values -function read_array_while(next) { - let v = []; - while (true) { - let x = next(v.length); - if (!x) break; - v.push(x); - } - return v; -} - -// read w columns of length n -// return as n rows of length w -function read_transposed(n, w, next) { - let m = Array(n).fill().map(() => []); - for (let i = 0; i < w; i++) { - read_deltas(n, next).forEach((x, j) => m[j].push(x)); - } - return m; -} - -// returns [[x, ys], [x+dx, ys+dy], [x+2*dx, ys+2*dy], ...] -// where dx/dy = steps, n = run size, w = length of y -function read_linear_table(w, next) { - let dx = 1 + next(); - let dy = next(); - let vN = read_array_while(next); - let m = read_transposed(vN.length, 1+w, next); - return m.flatMap((v, i) => { - let [x, ...ys] = v; - return Array(vN[i]).fill().map((_, j) => { - let j_dy = j * dy; - return [x + j * dx, ys.map(y => y + j_dy)]; - }); - }); -} - -// return [[x, ys...], ...] -// where w = length of y -function read_replacement_table(w, next) { - let n = 1 + next(); - let m = read_transposed(n, 1+w, next); - return m.map(v => [v[0], v.slice(1)]); -} - - -function read_trie(next) { - let ret = []; - let sorted = read_sorted(next); - expand(decode([]), []); - return ret; // not sorted - function decode(Q) { // characters that lead into this node - let S = next(); // state: valid, save, check - let B = read_array_while(() => { // buckets leading to new nodes - let cps = read_sorted(next).map(i => sorted[i]); - if (cps.length) return decode(cps); - }); - return {S, B, Q}; - } - function expand({S, B}, cps, saved) { - if (S & 4 && saved === cps[cps.length-1]) return; - if (S & 2) saved = cps[cps.length-1]; - if (S & 1) ret.push(cps); - for (let br of B) { - for (let cp of br.Q) { - expand(br, [...cps, cp], saved); - } - } - } -} - -function hex_cp(cp) { - return cp.toString(16).toUpperCase().padStart(2, '0'); -} - -function quote_cp(cp) { - return `{${hex_cp(cp)}}`; // raffy convention: like "\u{X}" w/o the "\u" -} - -/* -export function explode_cp(s) { - return [...s].map(c => c.codePointAt(0)); -} -*/ -function explode_cp(s) { // this is about 2x faster - let cps = []; - for (let pos = 0, len = s.length; pos < len; ) { - let cp = s.codePointAt(pos); - pos += cp < 0x10000 ? 1 : 2; - cps.push(cp); - } - return cps; -} - -function str_from_cps(cps) { - const chunk = 4096; - let len = cps.length; - if (len < chunk) return String.fromCodePoint(...cps); - let buf = []; - for (let i = 0; i < len; ) { - buf.push(String.fromCodePoint(...cps.slice(i, i += chunk))); - } - return buf.join(''); -} - -function compare_arrays(a, b) { - let n = a.length; - let c = n - b.length; - for (let i = 0; c == 0 && i < n; i++) c = a[i] - b[i]; - return c; -} - -// reverse polyfill -// replace custom nf implementation with system implementation -// (saves approximately 6KB) - - -function nf(cps, form) { - return explode_cp(str_from_cps(cps).normalize(form)); -} - -function nfc(cps) { - return nf(cps, 'NFC'); -} -function nfd(cps) { - return nf(cps, 'NFD'); -} - -const HYPHEN = 0x2D; -const STOP = 0x2E; -const STOP_CH = '.'; -const FE0F = 0xFE0F; -const UNIQUE_PH = 1; - -// 20230913: replace [...v] with Array_from(v) to avoid large spreads -const Array_from = x => Array.from(x); // Array.from.bind(Array); - -function group_has_cp(g, cp) { - // 20230913: keep primary and secondary distinct instead of creating valid union - return g.P.has(cp) || g.Q.has(cp); -} - -class Emoji extends Array { - get is_emoji() { return true; } // free tagging system -} - -let MAPPED, IGNORED, CM, NSM, ESCAPE, NFC_CHECK, GROUPS, WHOLE_VALID, WHOLE_MAP, VALID, EMOJI_LIST, EMOJI_ROOT; - -function init() { - if (MAPPED) return; - - let r = read_compressed_payload(COMPRESSED); - const read_sorted_array = () => read_sorted(r); - const read_sorted_set = () => new Set(read_sorted_array()); - const set_add_many = (set, v) => v.forEach(x => set.add(x)); - - MAPPED = new Map(read_mapped(r)); - IGNORED = read_sorted_set(); // ignored characters are not valid, so just read raw codepoints - - /* - // direct include from payload is smaller than the decompression code - const FENCED = new Map(read_array_while(() => { - let cp = r(); - if (cp) return [cp, read_str(r())]; - })); - */ - // 20230217: we still need all CM for proper error formatting - // but norm only needs NSM subset that are potentially-valid - CM = read_sorted_array(); - NSM = new Set(read_sorted_array().map(i => CM[i])); - CM = new Set(CM); - - ESCAPE = read_sorted_set(); // characters that should not be printed - NFC_CHECK = read_sorted_set(); // only needed to illustrate ens_tokenize() transformations - - let chunks = read_sorted_arrays(r); - let unrestricted = r(); - //const read_chunked = () => new Set(read_sorted_array().flatMap(i => chunks[i]).concat(read_sorted_array())); - const read_chunked = () => { - // 20230921: build set in parts, 2x faster - let set = new Set(); - read_sorted_array().forEach(i => set_add_many(set, chunks[i])); - set_add_many(set, read_sorted_array()); - return set; - }; - GROUPS = read_array_while(i => { - // minifier property mangling seems unsafe - // so these are manually renamed to single chars - let N = read_array_while(r).map(x => x+0x60); - if (N.length) { - let R = i >= unrestricted; // unrestricted then restricted - N[0] -= 32; // capitalize - N = str_from_cps(N); - if (R) N=`Restricted[${N}]`; - let P = read_chunked(); // primary - let Q = read_chunked(); // secondary - let M = !r(); // not-whitelisted, check for NSM - // *** this code currently isn't needed *** - /* - let V = [...P, ...Q].sort((a, b) => a-b); // derive: sorted valid - let M = r()-1; // number of combining mark - if (M < 0) { // whitelisted - M = new Map(read_array_while(() => { - let i = r(); - if (i) return [V[i-1], read_array_while(() => { - let v = read_array_while(r); - if (v.length) return v.map(x => x-1); - })]; - })); - }*/ - return {N, P, Q, M, R}; - } - }); - - // decode compressed wholes - WHOLE_VALID = read_sorted_set(); - WHOLE_MAP = new Map(); - let wholes = read_sorted_array().concat(Array_from(WHOLE_VALID)).sort((a, b) => a-b); // must be sorted - wholes.forEach((cp, i) => { - let d = r(); - let w = wholes[i] = d ? wholes[i-d] : {V: [], M: new Map()}; - w.V.push(cp); // add to member set - if (!WHOLE_VALID.has(cp)) { - WHOLE_MAP.set(cp, w); // register with whole map - } - }); - - // compute confusable-extent complements - // usage: WHOLE_MAP.get(cp).M.get(cp) = complement set - for (let {V, M} of new Set(WHOLE_MAP.values())) { - // connect all groups that have each whole character - let recs = []; - for (let cp of V) { - let gs = GROUPS.filter(g => group_has_cp(g, cp)); - let rec = recs.find(({G}) => gs.some(g => G.has(g))); - if (!rec) { - rec = {G: new Set(), V: []}; - recs.push(rec); - } - rec.V.push(cp); - set_add_many(rec.G, gs); - } - // per character cache groups which are not a member of the extent - let union = recs.flatMap(x => Array_from(x.G)); // all of the groups used by this whole - for (let {G, V} of recs) { - let complement = new Set(union.filter(g => !G.has(g))); // groups not covered by the extent - for (let cp of V) { - M.set(cp, complement); // this is the same reference - } - } - } - - // compute valid set - // 20230924: VALID was union but can be re-used - VALID = new Set(); // exists in 1+ groups - let multi = new Set(); // exists in 2+ groups - const add_to_union = cp => VALID.has(cp) ? multi.add(cp) : VALID.add(cp); - for (let g of GROUPS) { - for (let cp of g.P) add_to_union(cp); - for (let cp of g.Q) add_to_union(cp); - } - // dual purpose WHOLE_MAP: return placeholder if unique non-confusable - for (let cp of VALID) { - if (!WHOLE_MAP.has(cp) && !multi.has(cp)) { - WHOLE_MAP.set(cp, UNIQUE_PH); - } - } - // add all decomposed parts - // see derive: "Valid is Closed (via Brute-force)" - set_add_many(VALID, nfd(VALID)); - - // decode emoji - // 20230719: emoji are now fully-expanded to avoid quirk logic - EMOJI_LIST = read_trie(r).map(v => Emoji.from(v)).sort(compare_arrays); - EMOJI_ROOT = new Map(); // this has approx 7K nodes (2+ per emoji) - for (let cps of EMOJI_LIST) { - // 20230719: change to *slightly* stricter algorithm which disallows - // insertion of misplaced FE0F in emoji sequences (matching ENSIP-15) - // example: beautified [A B] (eg. flag emoji) - // before: allow: [A FE0F B], error: [A FE0F FE0F B] - // after: error: both - // note: this code now matches ENSNormalize.{cs,java} logic - let prev = [EMOJI_ROOT]; - for (let cp of cps) { - let next = prev.map(node => { - let child = node.get(cp); - if (!child) { - // should this be object? - // (most have 1-2 items, few have many) - // 20230719: no, v8 default map is 4? - child = new Map(); - node.set(cp, child); - } - return child; - }); - if (cp === FE0F) { - prev.push(...next); // less than 20 elements - } else { - prev = next; - } - } - for (let x of prev) { - x.V = cps; - } - } -} - -// if escaped: {HEX} -// else: "x" {HEX} -function quoted_cp(cp) { - return (should_escape(cp) ? '' : `${bidi_qq(safe_str_from_cps([cp]))} `) + quote_cp(cp); -} - -// 20230211: some messages can be mixed-directional and result in spillover -// use 200E after a quoted string to force the remainder of a string from -// acquring the direction of the quote -// https://www.w3.org/International/questions/qa-bidi-unicode-controls#exceptions -function bidi_qq(s) { - return `"${s}"\u200E`; // strong LTR -} - -function check_label_extension(cps) { - if (cps.length >= 4 && cps[2] == HYPHEN && cps[3] == HYPHEN) { - throw new Error(`invalid label extension: "${str_from_cps(cps.slice(0, 4))}"`); // this can only be ascii so cant be bidi - } -} -function check_leading_underscore(cps) { - const UNDERSCORE = 0x5F; - for (let i = cps.lastIndexOf(UNDERSCORE); i > 0; ) { - if (cps[--i] !== UNDERSCORE) { - throw new Error('underscore allowed only at start'); - } - } -} -// check that a fenced cp is not leading, trailing, or touching another fenced cp -function check_fenced(cps) { - let cp = cps[0]; - let prev = FENCED.get(cp); - if (prev) throw error_placement(`leading ${prev}`); - let n = cps.length; - let last = -1; // prevents trailing from throwing - for (let i = 1; i < n; i++) { - cp = cps[i]; - let match = FENCED.get(cp); - if (match) { - // since cps[0] isn't fenced, cps[1] cannot throw - if (last == i) throw error_placement(`${prev} + ${match}`); - last = i + 1; - prev = match; - } - } - if (last == n) throw error_placement(`trailing ${prev}`); -} - -// create a safe to print string -// invisibles are escaped -// leading cm uses placeholder -// if cps exceed max, middle truncate with ellipsis -// quoter(cp) => string, eg. 3000 => "{3000}" -// note: in html, you'd call this function then replace [<>&] with entities -function safe_str_from_cps(cps, max = Infinity, quoter = quote_cp) { - //if (Number.isInteger(cps)) cps = [cps]; - //if (!Array.isArray(cps)) throw new TypeError(`expected codepoints`); - let buf = []; - if (is_combining_mark(cps[0])) buf.push('◌'); - if (cps.length > max) { - max >>= 1; - cps = [...cps.slice(0, max), 0x2026, ...cps.slice(-max)]; - } - let prev = 0; - let n = cps.length; - for (let i = 0; i < n; i++) { - let cp = cps[i]; - if (should_escape(cp)) { - buf.push(str_from_cps(cps.slice(prev, i))); - buf.push(quoter(cp)); - prev = i + 1; - } - } - buf.push(str_from_cps(cps.slice(prev, n))); - return buf.join(''); -} - -// note: set(s) cannot be exposed because they can be modified -// note: Object.freeze() doesn't work -function is_combining_mark(cp) { - init(); - return CM.has(cp); -} -function should_escape(cp) { - init(); - return ESCAPE.has(cp); -} - -// return all supported emoji as fully-qualified emoji -// ordered by length then lexicographic -function ens_emoji() { - init(); - return EMOJI_LIST.map(x => x.slice()); // emoji are exposed so copy -} - -function ens_normalize_fragment(frag, decompose) { - init(); - let nf = decompose ? nfd : nfc; - return frag.split(STOP_CH).map(label => str_from_cps(tokens_from_str(explode_cp(label), nf, filter_fe0f).flat())).join(STOP_CH); -} - -function ens_normalize(name) { - return flatten(split(name, nfc, filter_fe0f)); -} - -function ens_beautify(name) { - let labels = split(name, nfc, x => x); // emoji not exposed - for (let {type, output, error} of labels) { - if (error) break; // flatten will throw - - // replace leading/trailing hyphen - // 20230121: consider beautifing all or leading/trailing hyphen to unicode variant - // not exactly the same in every font, but very similar: "-" vs "‐" - /* - const UNICODE_HYPHEN = 0x2010; - // maybe this should replace all for visual consistancy? - // `node tools/reg-count.js regex ^-\{2,\}` => 592 - //for (let i = 0; i < output.length; i++) if (output[i] == 0x2D) output[i] = 0x2010; - if (output[0] == HYPHEN) output[0] = UNICODE_HYPHEN; - let end = output.length-1; - if (output[end] == HYPHEN) output[end] = UNICODE_HYPHEN; - */ - // 20230123: WHATWG URL uses "CheckHyphens" false - // https://url.spec.whatwg.org/#idna - - // update ethereum symbol - // ξ => Ξ if not greek - if (type !== 'Greek') array_replace(output, 0x3BE, 0x39E); - - // 20221213: fixes bidi subdomain issue, but breaks invariant (200E is disallowed) - // could be fixed with special case for: 2D (.) + 200E (LTR) - // https://discuss.ens.domains/t/bidi-label-ordering-spoof/15824 - //output.splice(0, 0, 0x200E); - } - return flatten(labels); -} - -function array_replace(v, a, b) { - let prev = 0; - while (true) { - let next = v.indexOf(a, prev); - if (next < 0) break; - v[next] = b; - prev = next + 1; - } -} - -function ens_split(name, preserve_emoji) { - return split(name, nfc, preserve_emoji ? x => x.slice() : filter_fe0f); // emoji are exposed so copy -} - -function split(name, nf, ef) { - if (!name) return []; // 20230719: empty name allowance - init(); - let offset = 0; - // https://unicode.org/reports/tr46/#Validity_Criteria - // 4.) "The label must not contain a U+002E ( . ) FULL STOP." - return name.split(STOP_CH).map(label => { - let input = explode_cp(label); - let info = { - input, - offset, // codepoint, not substring! - }; - offset += input.length + 1; // + stop - try { - // 1.) "The label must be in Unicode Normalization Form NFC" - let tokens = info.tokens = tokens_from_str(input, nf, ef); - let token_count = tokens.length; - let type; - if (!token_count) { // the label was effectively empty (could of had ignored characters) - //norm = []; - //type = 'None'; // use this instead of next match, "ASCII" - // 20230120: change to strict - // https://discuss.ens.domains/t/ens-name-normalization-2nd/14564/59 - throw new Error(`empty label`); - } - let norm = info.output = tokens.flat(); - check_leading_underscore(norm); - let emoji = info.emoji = token_count > 1 || tokens[0].is_emoji; // same as: tokens.some(x => x.is_emoji); - if (!emoji && norm.every(cp => cp < 0x80)) { // special case for ascii - // 20230123: matches matches WHATWG, see note 3.3 - check_label_extension(norm); // only needed for ascii - // cant have fenced - // cant have cm - // cant have wholes - // see derive: "Fastpath ASCII" - type = 'ASCII'; - } else { - let chars = tokens.flatMap(x => x.is_emoji ? [] : x); // all of the nfc tokens concat together - if (!chars.length) { // theres no text, just emoji - type = 'Emoji'; - } else { - // 5.) "The label must not begin with a combining mark, that is: General_Category=Mark." - if (CM.has(norm[0])) throw error_placement('leading combining mark'); - for (let i = 1; i < token_count; i++) { // we've already checked the first token - let cps = tokens[i]; - if (!cps.is_emoji && CM.has(cps[0])) { // every text token has emoji neighbors, eg. EtEEEtEt... - // bidi_qq() not needed since emoji is LTR and cps is a CM - throw error_placement(`emoji + combining mark: "${str_from_cps(tokens[i-1])} + ${safe_str_from_cps([cps[0]])}"`); - } - } - check_fenced(norm); - let unique = Array_from(new Set(chars)); - let [g] = determine_group(unique); // take the first match - // see derive: "Matching Groups have Same CM Style" - // alternative: could form a hybrid type: Latin/Japanese/... - check_group(g, chars); // need text in order - check_whole(g, unique); // only need unique text (order would be required for multiple-char confusables) - type = g.N; - // 20230121: consider exposing restricted flag - // it's simpler to just check for 'Restricted' - // or even better: type.endsWith(']') - //if (g.R) info.restricted = true; - } - } - info.type = type; - } catch (err) { - info.error = err; // use full error object - } - return info; - }); -} - -function check_whole(group, unique) { - let maker; - let shared = []; - for (let cp of unique) { - let whole = WHOLE_MAP.get(cp); - if (whole === UNIQUE_PH) return; // unique, non-confusable - if (whole) { - let set = whole.M.get(cp); // groups which have a character that look-like this character - maker = maker ? maker.filter(g => set.has(g)) : Array_from(set); - if (!maker.length) return; // confusable intersection is empty - } else { - shared.push(cp); - } - } - if (maker) { - // we have 1+ confusable - // check if any of the remaining groups - // contain the shared characters too - for (let g of maker) { - if (shared.every(cp => group_has_cp(g, cp))) { - throw new Error(`whole-script confusable: ${group.N}/${g.N}`); - } - } - } -} - -// assumption: unique.size > 0 -// returns list of matching groups -function determine_group(unique) { - let groups = GROUPS; - for (let cp of unique) { - // note: we need to dodge CM that are whitelisted - // but that code isn't currently necessary - let gs = groups.filter(g => group_has_cp(g, cp)); - if (!gs.length) { - if (!GROUPS.some(g => group_has_cp(g, cp))) { - // the character was composed of valid parts - // but it's NFC form is invalid - // 20230716: change to more exact statement, see: ENSNormalize.{cs,java} - // note: this doesn't have to be a composition - // 20230720: change to full check - throw error_disallowed(cp); // this should be rare - } else { - // there is no group that contains all these characters - // throw using the highest priority group that matched - // https://www.unicode.org/reports/tr39/#mixed_script_confusables - throw error_group_member(groups[0], cp); - } - } - groups = gs; - if (gs.length == 1) break; // there is only one group left - } - // there are at least 1 group(s) with all of these characters - return groups; -} - -// throw on first error -function flatten(split) { - return split.map(({input, error, output}) => { - if (error) { - // don't print label again if just a single label - let msg = error.message; - // bidi_qq() only necessary if msg is digits - throw new Error(split.length == 1 ? msg : `Invalid label ${bidi_qq(safe_str_from_cps(input, 63))}: ${msg}`); - } - return str_from_cps(output); - }).join(STOP_CH); -} - -function error_disallowed(cp) { - // TODO: add cp to error? - return new Error(`disallowed character: ${quoted_cp(cp)}`); -} -function error_group_member(g, cp) { - let quoted = quoted_cp(cp); - let gg = GROUPS.find(g => g.P.has(cp)); // only check primary - if (gg) { - quoted = `${gg.N} ${quoted}`; - } - return new Error(`illegal mixture: ${g.N} + ${quoted}`); -} -function error_placement(where) { - return new Error(`illegal placement: ${where}`); -} - -// assumption: cps.length > 0 -// assumption: cps[0] isn't a CM -// assumption: the previous character isn't an emoji -function check_group(g, cps) { - for (let cp of cps) { - if (!group_has_cp(g, cp)) { - // for whitelisted scripts, this will throw illegal mixture on invalid cm, eg. "e{300}{300}" - // at the moment, it's unnecessary to introduce an extra error type - // until there exists a whitelisted multi-character - // eg. if (M < 0 && is_combining_mark(cp)) { ... } - // there are 3 cases: - // 1. illegal cm for wrong group => mixture error - // 2. illegal cm for same group => cm error - // requires set of whitelist cm per group: - // eg. new Set([...g.P, ...g.Q].flatMap(nfc).filter(cp => CM.has(cp))) - // 3. wrong group => mixture error - throw error_group_member(g, cp); - } - } - //if (M >= 0) { // we have a known fixed cm count - if (g.M) { // we need to check for NSM - let decomposed = nfd(cps); - for (let i = 1, e = decomposed.length; i < e; i++) { // see: assumption - // 20230210: bugfix: using cps instead of decomposed h/t Carbon225 - /* - if (CM.has(decomposed[i])) { - let j = i + 1; - while (j < e && CM.has(decomposed[j])) j++; - if (j - i > M) { - throw new Error(`too many combining marks: ${g.N} ${bidi_qq(str_from_cps(decomposed.slice(i-1, j)))} (${j-i}/${M})`); - } - i = j; - } - */ - // 20230217: switch to NSM counting - // https://www.unicode.org/reports/tr39/#Optional_Detection - if (NSM.has(decomposed[i])) { - let j = i + 1; - for (let cp; j < e && NSM.has(cp = decomposed[j]); j++) { - // a. Forbid sequences of the same nonspacing mark. - for (let k = i; k < j; k++) { // O(n^2) but n < 100 - if (decomposed[k] == cp) { - throw new Error(`duplicate non-spacing marks: ${quoted_cp(cp)}`); - } - } - } - // parse to end so we have full nsm count - // b. Forbid sequences of more than 4 nonspacing marks (gc=Mn or gc=Me). - if (j - i > NSM_MAX) { - // note: this slice starts with a base char or spacing-mark cm - throw new Error(`excessive non-spacing marks: ${bidi_qq(safe_str_from_cps(decomposed.slice(i-1, j)))} (${j-i}/${NSM_MAX})`); - } - i = j; - } - } - } - // *** this code currently isn't needed *** - /* - let cm_whitelist = M instanceof Map; - for (let i = 0, e = cps.length; i < e; ) { - let cp = cps[i++]; - let seqs = cm_whitelist && M.get(cp); - if (seqs) { - // list of codepoints that can follow - // if this exists, this will always be 1+ - let j = i; - while (j < e && CM.has(cps[j])) j++; - let cms = cps.slice(i, j); - let match = seqs.find(seq => !compare_arrays(seq, cms)); - if (!match) throw new Error(`disallowed combining mark sequence: "${safe_str_from_cps([cp, ...cms])}"`); - i = j; - } else if (!V.has(cp)) { - // https://www.unicode.org/reports/tr39/#mixed_script_confusables - let quoted = quoted_cp(cp); - for (let cp of cps) { - let u = UNIQUE.get(cp); - if (u && u !== g) { - // if both scripts are restricted this error is confusing - // because we don't differentiate RestrictedA from RestrictedB - if (!u.R) quoted = `${quoted} is ${u.N}`; - break; - } - } - throw new Error(`disallowed ${g.N} character: ${quoted}`); - //throw new Error(`disallowed character: ${quoted} (expected ${g.N})`); - //throw new Error(`${g.N} does not allow: ${quoted}`); - } - } - if (!cm_whitelist) { - let decomposed = nfd(cps); - for (let i = 1, e = decomposed.length; i < e; i++) { // we know it can't be cm leading - if (CM.has(decomposed[i])) { - let j = i + 1; - while (j < e && CM.has(decomposed[j])) j++; - if (j - i > M) { - throw new Error(`too many combining marks: "${str_from_cps(decomposed.slice(i-1, j))}" (${j-i}/${M})`); - } - i = j; - } - } - } - */ -} - -// given a list of codepoints -// returns a list of lists, where emoji are a fully-qualified (as Array subclass) -// eg. explode_cp("abc💩d") => [[61, 62, 63], Emoji[1F4A9, FE0F], [64]] -// 20230818: rename for 'process' name collision h/t Javarome -// https://github.com/adraffy/ens-normalize.js/issues/23 -function tokens_from_str(input, nf, ef) { - let ret = []; - let chars = []; - input = input.slice().reverse(); // flip so we can pop - while (input.length) { - let emoji = consume_emoji_reversed(input); - if (emoji) { - if (chars.length) { - ret.push(nf(chars)); - chars = []; - } - ret.push(ef(emoji)); - } else { - let cp = input.pop(); - if (VALID.has(cp)) { - chars.push(cp); - } else { - let cps = MAPPED.get(cp); - if (cps) { - chars.push(...cps); // less than 10 elements - } else if (!IGNORED.has(cp)) { - // 20230912: unicode 15.1 changed the order of processing such that - // disallowed parts are only rejected after NFC - // https://unicode.org/reports/tr46/#Validity_Criteria - // this doesn't impact normalization as of today - // technically, this error can be removed as the group logic will apply similar logic - // however the error type might be less clear - throw error_disallowed(cp); - } - } - } - } - if (chars.length) { - ret.push(nf(chars)); - } - return ret; -} - -function filter_fe0f(cps) { - return cps.filter(cp => cp != FE0F); -} - -// given array of codepoints -// returns the longest valid emoji sequence (or undefined if no match) -// *MUTATES* the supplied array -// disallows interleaved ignored characters -// fills (optional) eaten array with matched codepoints -function consume_emoji_reversed(cps, eaten) { - let node = EMOJI_ROOT; - let emoji; - let pos = cps.length; - while (pos) { - node = node.get(cps[--pos]); - if (!node) break; - let {V} = node; - if (V) { // this is a valid emoji (so far) - emoji = V; - if (eaten) eaten.push(...cps.slice(pos).reverse()); // (optional) copy input, used for ens_tokenize() - cps.length = pos; // truncate - } - } - return emoji; -} - -// ************************************************************ -// tokenizer - -const TY_VALID = 'valid'; -const TY_MAPPED = 'mapped'; -const TY_IGNORED = 'ignored'; -const TY_DISALLOWED = 'disallowed'; -const TY_EMOJI = 'emoji'; -const TY_NFC = 'nfc'; -const TY_STOP = 'stop'; - -function ens_tokenize(name, { - nf = true, // collapse unnormalized runs into a single token -} = {}) { - init(); - let input = explode_cp(name).reverse(); - let eaten = []; - let tokens = []; - while (input.length) { - let emoji = consume_emoji_reversed(input, eaten); - if (emoji) { - tokens.push({ - type: TY_EMOJI, - emoji: emoji.slice(), // copy emoji - input: eaten, - cps: filter_fe0f(emoji) - }); - eaten = []; // reset buffer - } else { - let cp = input.pop(); - if (cp == STOP) { - tokens.push({type: TY_STOP, cp}); - } else if (VALID.has(cp)) { - tokens.push({type: TY_VALID, cps: [cp]}); - } else if (IGNORED.has(cp)) { - tokens.push({type: TY_IGNORED, cp}); - } else { - let cps = MAPPED.get(cp); - if (cps) { - tokens.push({type: TY_MAPPED, cp, cps: cps.slice()}); - } else { - tokens.push({type: TY_DISALLOWED, cp}); - } - } - } - } - if (nf) { - for (let i = 0, start = -1; i < tokens.length; i++) { - let token = tokens[i]; - if (is_valid_or_mapped(token.type)) { - if (requires_check(token.cps)) { // normalization might be needed - let end = i + 1; - for (let pos = end; pos < tokens.length; pos++) { // find adjacent text - let {type, cps} = tokens[pos]; - if (is_valid_or_mapped(type)) { - if (!requires_check(cps)) break; - end = pos + 1; - } else if (type !== TY_IGNORED) { // || type !== TY_DISALLOWED) { - break; - } - } - if (start < 0) start = i; - let slice = tokens.slice(start, end); - let cps0 = slice.flatMap(x => is_valid_or_mapped(x.type) ? x.cps : []); // strip junk tokens - let cps = nfc(cps0); - if (compare_arrays(cps, cps0)) { // bundle into an nfc token - tokens.splice(start, end - start, { - type: TY_NFC, - input: cps0, // there are 3 states: tokens0 ==(process)=> input ==(nfc)=> tokens/cps - cps, - tokens0: collapse_valid_tokens(slice), - tokens: ens_tokenize(str_from_cps(cps), {nf: false}) - }); - i = start; - } else { - i = end - 1; // skip to end of slice - } - start = -1; // reset - } else { - start = i; // remember last - } - } else if (token.type !== TY_IGNORED) { // 20221024: is this correct? - start = -1; // reset - } - } - } - return collapse_valid_tokens(tokens); -} - -function is_valid_or_mapped(type) { - return type == TY_VALID || type == TY_MAPPED; -} - -function requires_check(cps) { - return cps.some(cp => NFC_CHECK.has(cp)); -} - -function collapse_valid_tokens(tokens) { - for (let i = 0; i < tokens.length; i++) { - if (tokens[i].type == TY_VALID) { - let j = i + 1; - while (j < tokens.length && tokens[j].type == TY_VALID) j++; - tokens.splice(i, j - i, {type: TY_VALID, cps: tokens.slice(i, j).flatMap(x => x.cps)}); - } - } - return tokens; -} - -export { ens_beautify, ens_emoji, ens_normalize, ens_normalize_fragment, ens_split, ens_tokenize, is_combining_mark, nfc, nfd, safe_str_from_cps, should_escape }; diff --git a/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/dist/index.cjs b/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/dist/index.cjs deleted file mode 100644 index 86c839ca..00000000 --- a/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/dist/index.cjs +++ /dev/null @@ -1,1252 +0,0 @@ -'use strict'; - -// created 2023-09-25T01:01:55.148Z -// compressed base64-encoded blob for include-ens data -// source: https://github.com/adraffy/ens-normalize.js/blob/main/src/make.js -// see: https://github.com/adraffy/ens-normalize.js#security -// SHA-256: 0565ed049b9cf1614bb9e11ba7d8ac6a6fb96c893253d890f7e2b2884b9ded32 -var COMPRESSED$1 = 'AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGw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mnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI'; -const FENCED = new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]); -const NSM_MAX = 4; - -function decode_arithmetic(bytes) { - let pos = 0; - function u16() { return (bytes[pos++] << 8) | bytes[pos++]; } - - // decode the frequency table - let symbol_count = u16(); - let total = 1; - let acc = [0, 1]; // first symbol has frequency 1 - for (let i = 1; i < symbol_count; i++) { - acc.push(total += u16()); - } - - // skip the sized-payload that the last 3 symbols index into - let skip = u16(); - let pos_payload = pos; - pos += skip; - - let read_width = 0; - let read_buffer = 0; - function read_bit() { - if (read_width == 0) { - // this will read beyond end of buffer - // but (undefined|0) => zero pad - read_buffer = (read_buffer << 8) | bytes[pos++]; - read_width = 8; - } - return (read_buffer >> --read_width) & 1; - } - - const N = 31; - const FULL = 2**N; - const HALF = FULL >>> 1; - const QRTR = HALF >> 1; - const MASK = FULL - 1; - - // fill register - let register = 0; - for (let i = 0; i < N; i++) register = (register << 1) | read_bit(); - - let symbols = []; - let low = 0; - let range = FULL; // treat like a float - while (true) { - let value = Math.floor((((register - low + 1) * total) - 1) / range); - let start = 0; - let end = symbol_count; - while (end - start > 1) { // binary search - let mid = (start + end) >>> 1; - if (value < acc[mid]) { - end = mid; - } else { - start = mid; - } - } - if (start == 0) break; // first symbol is end mark - symbols.push(start); - let a = low + Math.floor(range * acc[start] / total); - let b = low + Math.floor(range * acc[start+1] / total) - 1; - while (((a ^ b) & HALF) == 0) { - register = (register << 1) & MASK | read_bit(); - a = (a << 1) & MASK; - b = (b << 1) & MASK | 1; - } - while (a & ~b & QRTR) { - register = (register & HALF) | ((register << 1) & (MASK >>> 1)) | read_bit(); - a = (a << 1) ^ HALF; - b = ((b ^ HALF) << 1) | HALF | 1; - } - low = a; - range = 1 + b - a; - } - let offset = symbol_count - 4; - return symbols.map(x => { // index into payload - switch (x - offset) { - case 3: return offset + 0x10100 + ((bytes[pos_payload++] << 16) | (bytes[pos_payload++] << 8) | bytes[pos_payload++]); - case 2: return offset + 0x100 + ((bytes[pos_payload++] << 8) | bytes[pos_payload++]); - case 1: return offset + bytes[pos_payload++]; - default: return x - 1; - } - }); -} - -// returns an iterator which returns the next symbol -function read_payload(v) { - let pos = 0; - return () => v[pos++]; -} -function read_compressed_payload(s) { - return read_payload(decode_arithmetic(unsafe_atob(s))); -} - -// unsafe in the sense: -// expected well-formed Base64 w/o padding -// 20220922: added for https://github.com/adraffy/ens-normalize.js/issues/4 -function unsafe_atob(s) { - let lookup = []; - [...'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'].forEach((c, i) => lookup[c.charCodeAt(0)] = i); - let n = s.length; - let ret = new Uint8Array((6 * n) >> 3); - for (let i = 0, pos = 0, width = 0, carry = 0; i < n; i++) { - carry = (carry << 6) | lookup[s.charCodeAt(i)]; - width += 6; - if (width >= 8) { - ret[pos++] = (carry >> (width -= 8)); - } - } - return ret; -} - -// eg. [0,1,2,3...] => [0,-1,1,-2,...] -function signed(i) { - return (i & 1) ? (~i >> 1) : (i >> 1); -} - -function read_deltas(n, next) { - let v = Array(n); - for (let i = 0, x = 0; i < n; i++) v[i] = x += signed(next()); - return v; -} - -// [123][5] => [0 3] [1 1] [0 0] -function read_sorted(next, prev = 0) { - let ret = []; - while (true) { - let x = next(); - let n = next(); - if (!n) break; - prev += x; - for (let i = 0; i < n; i++) { - ret.push(prev + i); - } - prev += n + 1; - } - return ret; -} - -function read_sorted_arrays(next) { - return read_array_while(() => { - let v = read_sorted(next); - if (v.length) return v; - }); -} - -// returns map of x => ys -function read_mapped(next) { - let ret = []; - while (true) { - let w = next(); - if (w == 0) break; - ret.push(read_linear_table(w, next)); - } - while (true) { - let w = next() - 1; - if (w < 0) break; - ret.push(read_replacement_table(w, next)); - } - return ret.flat(); -} - -// read until next is falsy -// return array of read values -function read_array_while(next) { - let v = []; - while (true) { - let x = next(v.length); - if (!x) break; - v.push(x); - } - return v; -} - -// read w columns of length n -// return as n rows of length w -function read_transposed(n, w, next) { - let m = Array(n).fill().map(() => []); - for (let i = 0; i < w; i++) { - read_deltas(n, next).forEach((x, j) => m[j].push(x)); - } - return m; -} - -// returns [[x, ys], [x+dx, ys+dy], [x+2*dx, ys+2*dy], ...] -// where dx/dy = steps, n = run size, w = length of y -function read_linear_table(w, next) { - let dx = 1 + next(); - let dy = next(); - let vN = read_array_while(next); - let m = read_transposed(vN.length, 1+w, next); - return m.flatMap((v, i) => { - let [x, ...ys] = v; - return Array(vN[i]).fill().map((_, j) => { - let j_dy = j * dy; - return [x + j * dx, ys.map(y => y + j_dy)]; - }); - }); -} - -// return [[x, ys...], ...] -// where w = length of y -function read_replacement_table(w, next) { - let n = 1 + next(); - let m = read_transposed(n, 1+w, next); - return m.map(v => [v[0], v.slice(1)]); -} - - -function read_trie(next) { - let ret = []; - let sorted = read_sorted(next); - expand(decode([]), []); - return ret; // not sorted - function decode(Q) { // characters that lead into this node - let S = next(); // state: valid, save, check - let B = read_array_while(() => { // buckets leading to new nodes - let cps = read_sorted(next).map(i => sorted[i]); - if (cps.length) return decode(cps); - }); - return {S, B, Q}; - } - function expand({S, B}, cps, saved) { - if (S & 4 && saved === cps[cps.length-1]) return; - if (S & 2) saved = cps[cps.length-1]; - if (S & 1) ret.push(cps); - for (let br of B) { - for (let cp of br.Q) { - expand(br, [...cps, cp], saved); - } - } - } -} - -function hex_cp(cp) { - return cp.toString(16).toUpperCase().padStart(2, '0'); -} - -function quote_cp(cp) { - return `{${hex_cp(cp)}}`; // raffy convention: like "\u{X}" w/o the "\u" -} - -/* -export function explode_cp(s) { - return [...s].map(c => c.codePointAt(0)); -} -*/ -function explode_cp(s) { // this is about 2x faster - let cps = []; - for (let pos = 0, len = s.length; pos < len; ) { - let cp = s.codePointAt(pos); - pos += cp < 0x10000 ? 1 : 2; - cps.push(cp); - } - return cps; -} - -function str_from_cps(cps) { - const chunk = 4096; - let len = cps.length; - if (len < chunk) return String.fromCodePoint(...cps); - let buf = []; - for (let i = 0; i < len; ) { - buf.push(String.fromCodePoint(...cps.slice(i, i += chunk))); - } - return buf.join(''); -} - -function compare_arrays(a, b) { - let n = a.length; - let c = n - b.length; - for (let i = 0; c == 0 && i < n; i++) c = a[i] - b[i]; - return c; -} - -// created 2023-09-25T01:01:55.148Z -// compressed base64-encoded blob for include-nf data -// source: https://github.com/adraffy/ens-normalize.js/blob/main/src/make.js -// see: https://github.com/adraffy/ens-normalize.js#security -// SHA-256: a974b6f8541fc29d919bc85118af0a44015851fab5343f8679cb31be2bdb209e -var COMPRESSED = 'AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26PTQyy8FfEQ8AY8IPAGcEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiACnwRZEkkVsS7tANAsBG0RuAQLEPABv9HICTUBXigPZwRBApMDOwAamhtaABqEAY8KvKx3LQ4ArAB8UhwEBAVSagD8AEFZADkBIadVj2UMUgx5Il4ANQC9AxIB1BlbEPMAs30CGxlXAhwZKQIECBc6EbsCoxngzv7UzRQA8M0BawL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2Kf8rM3lhJ5XcBXU9n4v0Oy1RU2M+4qM8AQPVwse8ErNSob5oFPWxuqZnVzo1qB/IBxkM3EVUKFUUlO3e51259GgNcJbCmlvrdjtoTW7rChm1wyCKzpCTwozUUEOIcWLneRLgMXh+SjGSFkAllzbGS5HK7LlfCMRNRDSvbQPjcXaenNYxCvu2Qyznz6StuxVj66SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g'; - -// https://unicode.org/reports/tr15/ -// for reference implementation -// see: /derive/nf.js - - -// algorithmic hangul -// https://www.unicode.org/versions/Unicode15.0.0/ch03.pdf (page 144) -const S0 = 0xAC00; -const L0 = 0x1100; -const V0 = 0x1161; -const T0 = 0x11A7; -const L_COUNT = 19; -const V_COUNT = 21; -const T_COUNT = 28; -const N_COUNT = V_COUNT * T_COUNT; -const S_COUNT = L_COUNT * N_COUNT; -const S1 = S0 + S_COUNT; -const L1 = L0 + L_COUNT; -const V1 = V0 + V_COUNT; -const T1 = T0 + T_COUNT; - -function unpack_cc(packed) { - return (packed >> 24) & 0xFF; -} -function unpack_cp(packed) { - return packed & 0xFFFFFF; -} - -let SHIFTED_RANK, EXCLUSIONS, DECOMP, RECOMP; - -function init$1() { - //console.time('nf'); - let r = read_compressed_payload(COMPRESSED); - SHIFTED_RANK = new Map(read_sorted_arrays(r).flatMap((v, i) => v.map(x => [x, (i+1) << 24]))); // pre-shifted - EXCLUSIONS = new Set(read_sorted(r)); - DECOMP = new Map(); - RECOMP = new Map(); - for (let [cp, cps] of read_mapped(r)) { - if (!EXCLUSIONS.has(cp) && cps.length == 2) { - let [a, b] = cps; - let bucket = RECOMP.get(a); - if (!bucket) { - bucket = new Map(); - RECOMP.set(a, bucket); - } - bucket.set(b, cp); - } - DECOMP.set(cp, cps.reverse()); // stored reversed - } - //console.timeEnd('nf'); - // 20230905: 11ms -} - -function is_hangul(cp) { - return cp >= S0 && cp < S1; -} - -function compose_pair(a, b) { - if (a >= L0 && a < L1 && b >= V0 && b < V1) { - return S0 + (a - L0) * N_COUNT + (b - V0) * T_COUNT; - } else if (is_hangul(a) && b > T0 && b < T1 && (a - S0) % T_COUNT == 0) { - return a + (b - T0); - } else { - let recomp = RECOMP.get(a); - if (recomp) { - recomp = recomp.get(b); - if (recomp) { - return recomp; - } - } - return -1; - } -} - -function decomposed(cps) { - if (!SHIFTED_RANK) init$1(); - let ret = []; - let buf = []; - let check_order = false; - function add(cp) { - let cc = SHIFTED_RANK.get(cp); - if (cc) { - check_order = true; - cp |= cc; - } - ret.push(cp); - } - for (let cp of cps) { - while (true) { - if (cp < 0x80) { - ret.push(cp); - } else if (is_hangul(cp)) { - let s_index = cp - S0; - let l_index = s_index / N_COUNT | 0; - let v_index = (s_index % N_COUNT) / T_COUNT | 0; - let t_index = s_index % T_COUNT; - add(L0 + l_index); - add(V0 + v_index); - if (t_index > 0) add(T0 + t_index); - } else { - let mapped = DECOMP.get(cp); - if (mapped) { - buf.push(...mapped); - } else { - add(cp); - } - } - if (!buf.length) break; - cp = buf.pop(); - } - } - if (check_order && ret.length > 1) { - let prev_cc = unpack_cc(ret[0]); - for (let i = 1; i < ret.length; i++) { - let cc = unpack_cc(ret[i]); - if (cc == 0 || prev_cc <= cc) { - prev_cc = cc; - continue; - } - let j = i-1; - while (true) { - let tmp = ret[j+1]; - ret[j+1] = ret[j]; - ret[j] = tmp; - if (!j) break; - prev_cc = unpack_cc(ret[--j]); - if (prev_cc <= cc) break; - } - prev_cc = unpack_cc(ret[i]); - } - } - return ret; -} - -function composed_from_decomposed(v) { - let ret = []; - let stack = []; - let prev_cp = -1; - let prev_cc = 0; - for (let packed of v) { - let cc = unpack_cc(packed); - let cp = unpack_cp(packed); - if (prev_cp == -1) { - if (cc == 0) { - prev_cp = cp; - } else { - ret.push(cp); - } - } else if (prev_cc > 0 && prev_cc >= cc) { - if (cc == 0) { - ret.push(prev_cp, ...stack); - stack.length = 0; - prev_cp = cp; - } else { - stack.push(cp); - } - prev_cc = cc; - } else { - let composed = compose_pair(prev_cp, cp); - if (composed >= 0) { - prev_cp = composed; - } else if (prev_cc == 0 && cc == 0) { - ret.push(prev_cp); - prev_cp = cp; - } else { - stack.push(cp); - prev_cc = cc; - } - } - } - if (prev_cp >= 0) { - ret.push(prev_cp, ...stack); - } - return ret; -} - -// note: cps can be iterable -function nfd(cps) { - return decomposed(cps).map(unpack_cp); -} -function nfc(cps) { - return composed_from_decomposed(decomposed(cps)); -} - -const HYPHEN = 0x2D; -const STOP = 0x2E; -const STOP_CH = '.'; -const FE0F = 0xFE0F; -const UNIQUE_PH = 1; - -// 20230913: replace [...v] with Array_from(v) to avoid large spreads -const Array_from = x => Array.from(x); // Array.from.bind(Array); - -function group_has_cp(g, cp) { - // 20230913: keep primary and secondary distinct instead of creating valid union - return g.P.has(cp) || g.Q.has(cp); -} - -class Emoji extends Array { - get is_emoji() { return true; } // free tagging system -} - -let MAPPED, IGNORED, CM, NSM, ESCAPE, NFC_CHECK, GROUPS, WHOLE_VALID, WHOLE_MAP, VALID, EMOJI_LIST, EMOJI_ROOT; - -function init() { - if (MAPPED) return; - - let r = read_compressed_payload(COMPRESSED$1); - const read_sorted_array = () => read_sorted(r); - const read_sorted_set = () => new Set(read_sorted_array()); - const set_add_many = (set, v) => v.forEach(x => set.add(x)); - - MAPPED = new Map(read_mapped(r)); - IGNORED = read_sorted_set(); // ignored characters are not valid, so just read raw codepoints - - /* - // direct include from payload is smaller than the decompression code - const FENCED = new Map(read_array_while(() => { - let cp = r(); - if (cp) return [cp, read_str(r())]; - })); - */ - // 20230217: we still need all CM for proper error formatting - // but norm only needs NSM subset that are potentially-valid - CM = read_sorted_array(); - NSM = new Set(read_sorted_array().map(i => CM[i])); - CM = new Set(CM); - - ESCAPE = read_sorted_set(); // characters that should not be printed - NFC_CHECK = read_sorted_set(); // only needed to illustrate ens_tokenize() transformations - - let chunks = read_sorted_arrays(r); - let unrestricted = r(); - //const read_chunked = () => new Set(read_sorted_array().flatMap(i => chunks[i]).concat(read_sorted_array())); - const read_chunked = () => { - // 20230921: build set in parts, 2x faster - let set = new Set(); - read_sorted_array().forEach(i => set_add_many(set, chunks[i])); - set_add_many(set, read_sorted_array()); - return set; - }; - GROUPS = read_array_while(i => { - // minifier property mangling seems unsafe - // so these are manually renamed to single chars - let N = read_array_while(r).map(x => x+0x60); - if (N.length) { - let R = i >= unrestricted; // unrestricted then restricted - N[0] -= 32; // capitalize - N = str_from_cps(N); - if (R) N=`Restricted[${N}]`; - let P = read_chunked(); // primary - let Q = read_chunked(); // secondary - let M = !r(); // not-whitelisted, check for NSM - // *** this code currently isn't needed *** - /* - let V = [...P, ...Q].sort((a, b) => a-b); // derive: sorted valid - let M = r()-1; // number of combining mark - if (M < 0) { // whitelisted - M = new Map(read_array_while(() => { - let i = r(); - if (i) return [V[i-1], read_array_while(() => { - let v = read_array_while(r); - if (v.length) return v.map(x => x-1); - })]; - })); - }*/ - return {N, P, Q, M, R}; - } - }); - - // decode compressed wholes - WHOLE_VALID = read_sorted_set(); - WHOLE_MAP = new Map(); - let wholes = read_sorted_array().concat(Array_from(WHOLE_VALID)).sort((a, b) => a-b); // must be sorted - wholes.forEach((cp, i) => { - let d = r(); - let w = wholes[i] = d ? wholes[i-d] : {V: [], M: new Map()}; - w.V.push(cp); // add to member set - if (!WHOLE_VALID.has(cp)) { - WHOLE_MAP.set(cp, w); // register with whole map - } - }); - - // compute confusable-extent complements - // usage: WHOLE_MAP.get(cp).M.get(cp) = complement set - for (let {V, M} of new Set(WHOLE_MAP.values())) { - // connect all groups that have each whole character - let recs = []; - for (let cp of V) { - let gs = GROUPS.filter(g => group_has_cp(g, cp)); - let rec = recs.find(({G}) => gs.some(g => G.has(g))); - if (!rec) { - rec = {G: new Set(), V: []}; - recs.push(rec); - } - rec.V.push(cp); - set_add_many(rec.G, gs); - } - // per character cache groups which are not a member of the extent - let union = recs.flatMap(x => Array_from(x.G)); // all of the groups used by this whole - for (let {G, V} of recs) { - let complement = new Set(union.filter(g => !G.has(g))); // groups not covered by the extent - for (let cp of V) { - M.set(cp, complement); // this is the same reference - } - } - } - - // compute valid set - // 20230924: VALID was union but can be re-used - VALID = new Set(); // exists in 1+ groups - let multi = new Set(); // exists in 2+ groups - const add_to_union = cp => VALID.has(cp) ? multi.add(cp) : VALID.add(cp); - for (let g of GROUPS) { - for (let cp of g.P) add_to_union(cp); - for (let cp of g.Q) add_to_union(cp); - } - // dual purpose WHOLE_MAP: return placeholder if unique non-confusable - for (let cp of VALID) { - if (!WHOLE_MAP.has(cp) && !multi.has(cp)) { - WHOLE_MAP.set(cp, UNIQUE_PH); - } - } - // add all decomposed parts - // see derive: "Valid is Closed (via Brute-force)" - set_add_many(VALID, nfd(VALID)); - - // decode emoji - // 20230719: emoji are now fully-expanded to avoid quirk logic - EMOJI_LIST = read_trie(r).map(v => Emoji.from(v)).sort(compare_arrays); - EMOJI_ROOT = new Map(); // this has approx 7K nodes (2+ per emoji) - for (let cps of EMOJI_LIST) { - // 20230719: change to *slightly* stricter algorithm which disallows - // insertion of misplaced FE0F in emoji sequences (matching ENSIP-15) - // example: beautified [A B] (eg. flag emoji) - // before: allow: [A FE0F B], error: [A FE0F FE0F B] - // after: error: both - // note: this code now matches ENSNormalize.{cs,java} logic - let prev = [EMOJI_ROOT]; - for (let cp of cps) { - let next = prev.map(node => { - let child = node.get(cp); - if (!child) { - // should this be object? - // (most have 1-2 items, few have many) - // 20230719: no, v8 default map is 4? - child = new Map(); - node.set(cp, child); - } - return child; - }); - if (cp === FE0F) { - prev.push(...next); // less than 20 elements - } else { - prev = next; - } - } - for (let x of prev) { - x.V = cps; - } - } -} - -// if escaped: {HEX} -// else: "x" {HEX} -function quoted_cp(cp) { - return (should_escape(cp) ? '' : `${bidi_qq(safe_str_from_cps([cp]))} `) + quote_cp(cp); -} - -// 20230211: some messages can be mixed-directional and result in spillover -// use 200E after a quoted string to force the remainder of a string from -// acquring the direction of the quote -// https://www.w3.org/International/questions/qa-bidi-unicode-controls#exceptions -function bidi_qq(s) { - return `"${s}"\u200E`; // strong LTR -} - -function check_label_extension(cps) { - if (cps.length >= 4 && cps[2] == HYPHEN && cps[3] == HYPHEN) { - throw new Error(`invalid label extension: "${str_from_cps(cps.slice(0, 4))}"`); // this can only be ascii so cant be bidi - } -} -function check_leading_underscore(cps) { - const UNDERSCORE = 0x5F; - for (let i = cps.lastIndexOf(UNDERSCORE); i > 0; ) { - if (cps[--i] !== UNDERSCORE) { - throw new Error('underscore allowed only at start'); - } - } -} -// check that a fenced cp is not leading, trailing, or touching another fenced cp -function check_fenced(cps) { - let cp = cps[0]; - let prev = FENCED.get(cp); - if (prev) throw error_placement(`leading ${prev}`); - let n = cps.length; - let last = -1; // prevents trailing from throwing - for (let i = 1; i < n; i++) { - cp = cps[i]; - let match = FENCED.get(cp); - if (match) { - // since cps[0] isn't fenced, cps[1] cannot throw - if (last == i) throw error_placement(`${prev} + ${match}`); - last = i + 1; - prev = match; - } - } - if (last == n) throw error_placement(`trailing ${prev}`); -} - -// create a safe to print string -// invisibles are escaped -// leading cm uses placeholder -// if cps exceed max, middle truncate with ellipsis -// quoter(cp) => string, eg. 3000 => "{3000}" -// note: in html, you'd call this function then replace [<>&] with entities -function safe_str_from_cps(cps, max = Infinity, quoter = quote_cp) { - //if (Number.isInteger(cps)) cps = [cps]; - //if (!Array.isArray(cps)) throw new TypeError(`expected codepoints`); - let buf = []; - if (is_combining_mark(cps[0])) buf.push('◌'); - if (cps.length > max) { - max >>= 1; - cps = [...cps.slice(0, max), 0x2026, ...cps.slice(-max)]; - } - let prev = 0; - let n = cps.length; - for (let i = 0; i < n; i++) { - let cp = cps[i]; - if (should_escape(cp)) { - buf.push(str_from_cps(cps.slice(prev, i))); - buf.push(quoter(cp)); - prev = i + 1; - } - } - buf.push(str_from_cps(cps.slice(prev, n))); - return buf.join(''); -} - -// note: set(s) cannot be exposed because they can be modified -// note: Object.freeze() doesn't work -function is_combining_mark(cp) { - init(); - return CM.has(cp); -} -function should_escape(cp) { - init(); - return ESCAPE.has(cp); -} - -// return all supported emoji as fully-qualified emoji -// ordered by length then lexicographic -function ens_emoji() { - init(); - return EMOJI_LIST.map(x => x.slice()); // emoji are exposed so copy -} - -function ens_normalize_fragment(frag, decompose) { - init(); - let nf = decompose ? nfd : nfc; - return frag.split(STOP_CH).map(label => str_from_cps(tokens_from_str(explode_cp(label), nf, filter_fe0f).flat())).join(STOP_CH); -} - -function ens_normalize(name) { - return flatten(split(name, nfc, filter_fe0f)); -} - -function ens_beautify(name) { - let labels = split(name, nfc, x => x); // emoji not exposed - for (let {type, output, error} of labels) { - if (error) break; // flatten will throw - - // replace leading/trailing hyphen - // 20230121: consider beautifing all or leading/trailing hyphen to unicode variant - // not exactly the same in every font, but very similar: "-" vs "‐" - /* - const UNICODE_HYPHEN = 0x2010; - // maybe this should replace all for visual consistancy? - // `node tools/reg-count.js regex ^-\{2,\}` => 592 - //for (let i = 0; i < output.length; i++) if (output[i] == 0x2D) output[i] = 0x2010; - if (output[0] == HYPHEN) output[0] = UNICODE_HYPHEN; - let end = output.length-1; - if (output[end] == HYPHEN) output[end] = UNICODE_HYPHEN; - */ - // 20230123: WHATWG URL uses "CheckHyphens" false - // https://url.spec.whatwg.org/#idna - - // update ethereum symbol - // ξ => Ξ if not greek - if (type !== 'Greek') array_replace(output, 0x3BE, 0x39E); - - // 20221213: fixes bidi subdomain issue, but breaks invariant (200E is disallowed) - // could be fixed with special case for: 2D (.) + 200E (LTR) - // https://discuss.ens.domains/t/bidi-label-ordering-spoof/15824 - //output.splice(0, 0, 0x200E); - } - return flatten(labels); -} - -function array_replace(v, a, b) { - let prev = 0; - while (true) { - let next = v.indexOf(a, prev); - if (next < 0) break; - v[next] = b; - prev = next + 1; - } -} - -function ens_split(name, preserve_emoji) { - return split(name, nfc, preserve_emoji ? x => x.slice() : filter_fe0f); // emoji are exposed so copy -} - -function split(name, nf, ef) { - if (!name) return []; // 20230719: empty name allowance - init(); - let offset = 0; - // https://unicode.org/reports/tr46/#Validity_Criteria - // 4.) "The label must not contain a U+002E ( . ) FULL STOP." - return name.split(STOP_CH).map(label => { - let input = explode_cp(label); - let info = { - input, - offset, // codepoint, not substring! - }; - offset += input.length + 1; // + stop - try { - // 1.) "The label must be in Unicode Normalization Form NFC" - let tokens = info.tokens = tokens_from_str(input, nf, ef); - let token_count = tokens.length; - let type; - if (!token_count) { // the label was effectively empty (could of had ignored characters) - //norm = []; - //type = 'None'; // use this instead of next match, "ASCII" - // 20230120: change to strict - // https://discuss.ens.domains/t/ens-name-normalization-2nd/14564/59 - throw new Error(`empty label`); - } - let norm = info.output = tokens.flat(); - check_leading_underscore(norm); - let emoji = info.emoji = token_count > 1 || tokens[0].is_emoji; // same as: tokens.some(x => x.is_emoji); - if (!emoji && norm.every(cp => cp < 0x80)) { // special case for ascii - // 20230123: matches matches WHATWG, see note 3.3 - check_label_extension(norm); // only needed for ascii - // cant have fenced - // cant have cm - // cant have wholes - // see derive: "Fastpath ASCII" - type = 'ASCII'; - } else { - let chars = tokens.flatMap(x => x.is_emoji ? [] : x); // all of the nfc tokens concat together - if (!chars.length) { // theres no text, just emoji - type = 'Emoji'; - } else { - // 5.) "The label must not begin with a combining mark, that is: General_Category=Mark." - if (CM.has(norm[0])) throw error_placement('leading combining mark'); - for (let i = 1; i < token_count; i++) { // we've already checked the first token - let cps = tokens[i]; - if (!cps.is_emoji && CM.has(cps[0])) { // every text token has emoji neighbors, eg. EtEEEtEt... - // bidi_qq() not needed since emoji is LTR and cps is a CM - throw error_placement(`emoji + combining mark: "${str_from_cps(tokens[i-1])} + ${safe_str_from_cps([cps[0]])}"`); - } - } - check_fenced(norm); - let unique = Array_from(new Set(chars)); - let [g] = determine_group(unique); // take the first match - // see derive: "Matching Groups have Same CM Style" - // alternative: could form a hybrid type: Latin/Japanese/... - check_group(g, chars); // need text in order - check_whole(g, unique); // only need unique text (order would be required for multiple-char confusables) - type = g.N; - // 20230121: consider exposing restricted flag - // it's simpler to just check for 'Restricted' - // or even better: type.endsWith(']') - //if (g.R) info.restricted = true; - } - } - info.type = type; - } catch (err) { - info.error = err; // use full error object - } - return info; - }); -} - -function check_whole(group, unique) { - let maker; - let shared = []; - for (let cp of unique) { - let whole = WHOLE_MAP.get(cp); - if (whole === UNIQUE_PH) return; // unique, non-confusable - if (whole) { - let set = whole.M.get(cp); // groups which have a character that look-like this character - maker = maker ? maker.filter(g => set.has(g)) : Array_from(set); - if (!maker.length) return; // confusable intersection is empty - } else { - shared.push(cp); - } - } - if (maker) { - // we have 1+ confusable - // check if any of the remaining groups - // contain the shared characters too - for (let g of maker) { - if (shared.every(cp => group_has_cp(g, cp))) { - throw new Error(`whole-script confusable: ${group.N}/${g.N}`); - } - } - } -} - -// assumption: unique.size > 0 -// returns list of matching groups -function determine_group(unique) { - let groups = GROUPS; - for (let cp of unique) { - // note: we need to dodge CM that are whitelisted - // but that code isn't currently necessary - let gs = groups.filter(g => group_has_cp(g, cp)); - if (!gs.length) { - if (!GROUPS.some(g => group_has_cp(g, cp))) { - // the character was composed of valid parts - // but it's NFC form is invalid - // 20230716: change to more exact statement, see: ENSNormalize.{cs,java} - // note: this doesn't have to be a composition - // 20230720: change to full check - throw error_disallowed(cp); // this should be rare - } else { - // there is no group that contains all these characters - // throw using the highest priority group that matched - // https://www.unicode.org/reports/tr39/#mixed_script_confusables - throw error_group_member(groups[0], cp); - } - } - groups = gs; - if (gs.length == 1) break; // there is only one group left - } - // there are at least 1 group(s) with all of these characters - return groups; -} - -// throw on first error -function flatten(split) { - return split.map(({input, error, output}) => { - if (error) { - // don't print label again if just a single label - let msg = error.message; - // bidi_qq() only necessary if msg is digits - throw new Error(split.length == 1 ? msg : `Invalid label ${bidi_qq(safe_str_from_cps(input, 63))}: ${msg}`); - } - return str_from_cps(output); - }).join(STOP_CH); -} - -function error_disallowed(cp) { - // TODO: add cp to error? - return new Error(`disallowed character: ${quoted_cp(cp)}`); -} -function error_group_member(g, cp) { - let quoted = quoted_cp(cp); - let gg = GROUPS.find(g => g.P.has(cp)); // only check primary - if (gg) { - quoted = `${gg.N} ${quoted}`; - } - return new Error(`illegal mixture: ${g.N} + ${quoted}`); -} -function error_placement(where) { - return new Error(`illegal placement: ${where}`); -} - -// assumption: cps.length > 0 -// assumption: cps[0] isn't a CM -// assumption: the previous character isn't an emoji -function check_group(g, cps) { - for (let cp of cps) { - if (!group_has_cp(g, cp)) { - // for whitelisted scripts, this will throw illegal mixture on invalid cm, eg. "e{300}{300}" - // at the moment, it's unnecessary to introduce an extra error type - // until there exists a whitelisted multi-character - // eg. if (M < 0 && is_combining_mark(cp)) { ... } - // there are 3 cases: - // 1. illegal cm for wrong group => mixture error - // 2. illegal cm for same group => cm error - // requires set of whitelist cm per group: - // eg. new Set([...g.P, ...g.Q].flatMap(nfc).filter(cp => CM.has(cp))) - // 3. wrong group => mixture error - throw error_group_member(g, cp); - } - } - //if (M >= 0) { // we have a known fixed cm count - if (g.M) { // we need to check for NSM - let decomposed = nfd(cps); - for (let i = 1, e = decomposed.length; i < e; i++) { // see: assumption - // 20230210: bugfix: using cps instead of decomposed h/t Carbon225 - /* - if (CM.has(decomposed[i])) { - let j = i + 1; - while (j < e && CM.has(decomposed[j])) j++; - if (j - i > M) { - throw new Error(`too many combining marks: ${g.N} ${bidi_qq(str_from_cps(decomposed.slice(i-1, j)))} (${j-i}/${M})`); - } - i = j; - } - */ - // 20230217: switch to NSM counting - // https://www.unicode.org/reports/tr39/#Optional_Detection - if (NSM.has(decomposed[i])) { - let j = i + 1; - for (let cp; j < e && NSM.has(cp = decomposed[j]); j++) { - // a. Forbid sequences of the same nonspacing mark. - for (let k = i; k < j; k++) { // O(n^2) but n < 100 - if (decomposed[k] == cp) { - throw new Error(`duplicate non-spacing marks: ${quoted_cp(cp)}`); - } - } - } - // parse to end so we have full nsm count - // b. Forbid sequences of more than 4 nonspacing marks (gc=Mn or gc=Me). - if (j - i > NSM_MAX) { - // note: this slice starts with a base char or spacing-mark cm - throw new Error(`excessive non-spacing marks: ${bidi_qq(safe_str_from_cps(decomposed.slice(i-1, j)))} (${j-i}/${NSM_MAX})`); - } - i = j; - } - } - } - // *** this code currently isn't needed *** - /* - let cm_whitelist = M instanceof Map; - for (let i = 0, e = cps.length; i < e; ) { - let cp = cps[i++]; - let seqs = cm_whitelist && M.get(cp); - if (seqs) { - // list of codepoints that can follow - // if this exists, this will always be 1+ - let j = i; - while (j < e && CM.has(cps[j])) j++; - let cms = cps.slice(i, j); - let match = seqs.find(seq => !compare_arrays(seq, cms)); - if (!match) throw new Error(`disallowed combining mark sequence: "${safe_str_from_cps([cp, ...cms])}"`); - i = j; - } else if (!V.has(cp)) { - // https://www.unicode.org/reports/tr39/#mixed_script_confusables - let quoted = quoted_cp(cp); - for (let cp of cps) { - let u = UNIQUE.get(cp); - if (u && u !== g) { - // if both scripts are restricted this error is confusing - // because we don't differentiate RestrictedA from RestrictedB - if (!u.R) quoted = `${quoted} is ${u.N}`; - break; - } - } - throw new Error(`disallowed ${g.N} character: ${quoted}`); - //throw new Error(`disallowed character: ${quoted} (expected ${g.N})`); - //throw new Error(`${g.N} does not allow: ${quoted}`); - } - } - if (!cm_whitelist) { - let decomposed = nfd(cps); - for (let i = 1, e = decomposed.length; i < e; i++) { // we know it can't be cm leading - if (CM.has(decomposed[i])) { - let j = i + 1; - while (j < e && CM.has(decomposed[j])) j++; - if (j - i > M) { - throw new Error(`too many combining marks: "${str_from_cps(decomposed.slice(i-1, j))}" (${j-i}/${M})`); - } - i = j; - } - } - } - */ -} - -// given a list of codepoints -// returns a list of lists, where emoji are a fully-qualified (as Array subclass) -// eg. explode_cp("abc💩d") => [[61, 62, 63], Emoji[1F4A9, FE0F], [64]] -// 20230818: rename for 'process' name collision h/t Javarome -// https://github.com/adraffy/ens-normalize.js/issues/23 -function tokens_from_str(input, nf, ef) { - let ret = []; - let chars = []; - input = input.slice().reverse(); // flip so we can pop - while (input.length) { - let emoji = consume_emoji_reversed(input); - if (emoji) { - if (chars.length) { - ret.push(nf(chars)); - chars = []; - } - ret.push(ef(emoji)); - } else { - let cp = input.pop(); - if (VALID.has(cp)) { - chars.push(cp); - } else { - let cps = MAPPED.get(cp); - if (cps) { - chars.push(...cps); // less than 10 elements - } else if (!IGNORED.has(cp)) { - // 20230912: unicode 15.1 changed the order of processing such that - // disallowed parts are only rejected after NFC - // https://unicode.org/reports/tr46/#Validity_Criteria - // this doesn't impact normalization as of today - // technically, this error can be removed as the group logic will apply similar logic - // however the error type might be less clear - throw error_disallowed(cp); - } - } - } - } - if (chars.length) { - ret.push(nf(chars)); - } - return ret; -} - -function filter_fe0f(cps) { - return cps.filter(cp => cp != FE0F); -} - -// given array of codepoints -// returns the longest valid emoji sequence (or undefined if no match) -// *MUTATES* the supplied array -// disallows interleaved ignored characters -// fills (optional) eaten array with matched codepoints -function consume_emoji_reversed(cps, eaten) { - let node = EMOJI_ROOT; - let emoji; - let pos = cps.length; - while (pos) { - node = node.get(cps[--pos]); - if (!node) break; - let {V} = node; - if (V) { // this is a valid emoji (so far) - emoji = V; - if (eaten) eaten.push(...cps.slice(pos).reverse()); // (optional) copy input, used for ens_tokenize() - cps.length = pos; // truncate - } - } - return emoji; -} - -// ************************************************************ -// tokenizer - -const TY_VALID = 'valid'; -const TY_MAPPED = 'mapped'; -const TY_IGNORED = 'ignored'; -const TY_DISALLOWED = 'disallowed'; -const TY_EMOJI = 'emoji'; -const TY_NFC = 'nfc'; -const TY_STOP = 'stop'; - -function ens_tokenize(name, { - nf = true, // collapse unnormalized runs into a single token -} = {}) { - init(); - let input = explode_cp(name).reverse(); - let eaten = []; - let tokens = []; - while (input.length) { - let emoji = consume_emoji_reversed(input, eaten); - if (emoji) { - tokens.push({ - type: TY_EMOJI, - emoji: emoji.slice(), // copy emoji - input: eaten, - cps: filter_fe0f(emoji) - }); - eaten = []; // reset buffer - } else { - let cp = input.pop(); - if (cp == STOP) { - tokens.push({type: TY_STOP, cp}); - } else if (VALID.has(cp)) { - tokens.push({type: TY_VALID, cps: [cp]}); - } else if (IGNORED.has(cp)) { - tokens.push({type: TY_IGNORED, cp}); - } else { - let cps = MAPPED.get(cp); - if (cps) { - tokens.push({type: TY_MAPPED, cp, cps: cps.slice()}); - } else { - tokens.push({type: TY_DISALLOWED, cp}); - } - } - } - } - if (nf) { - for (let i = 0, start = -1; i < tokens.length; i++) { - let token = tokens[i]; - if (is_valid_or_mapped(token.type)) { - if (requires_check(token.cps)) { // normalization might be needed - let end = i + 1; - for (let pos = end; pos < tokens.length; pos++) { // find adjacent text - let {type, cps} = tokens[pos]; - if (is_valid_or_mapped(type)) { - if (!requires_check(cps)) break; - end = pos + 1; - } else if (type !== TY_IGNORED) { // || type !== TY_DISALLOWED) { - break; - } - } - if (start < 0) start = i; - let slice = tokens.slice(start, end); - let cps0 = slice.flatMap(x => is_valid_or_mapped(x.type) ? x.cps : []); // strip junk tokens - let cps = nfc(cps0); - if (compare_arrays(cps, cps0)) { // bundle into an nfc token - tokens.splice(start, end - start, { - type: TY_NFC, - input: cps0, // there are 3 states: tokens0 ==(process)=> input ==(nfc)=> tokens/cps - cps, - tokens0: collapse_valid_tokens(slice), - tokens: ens_tokenize(str_from_cps(cps), {nf: false}) - }); - i = start; - } else { - i = end - 1; // skip to end of slice - } - start = -1; // reset - } else { - start = i; // remember last - } - } else if (token.type !== TY_IGNORED) { // 20221024: is this correct? - start = -1; // reset - } - } - } - return collapse_valid_tokens(tokens); -} - -function is_valid_or_mapped(type) { - return type == TY_VALID || type == TY_MAPPED; -} - -function requires_check(cps) { - return cps.some(cp => NFC_CHECK.has(cp)); -} - -function collapse_valid_tokens(tokens) { - for (let i = 0; i < tokens.length; i++) { - if (tokens[i].type == TY_VALID) { - let j = i + 1; - while (j < tokens.length && tokens[j].type == TY_VALID) j++; - tokens.splice(i, j - i, {type: TY_VALID, cps: tokens.slice(i, j).flatMap(x => x.cps)}); - } - } - return tokens; -} - -exports.ens_beautify = ens_beautify; -exports.ens_emoji = ens_emoji; -exports.ens_normalize = ens_normalize; -exports.ens_normalize_fragment = ens_normalize_fragment; -exports.ens_split = ens_split; -exports.ens_tokenize = ens_tokenize; -exports.is_combining_mark = is_combining_mark; -exports.nfc = nfc; -exports.nfd = nfd; -exports.safe_str_from_cps = safe_str_from_cps; -exports.should_escape = should_escape; diff --git a/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/dist/index.d.ts b/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/dist/index.d.ts deleted file mode 100644 index d629ff6f..00000000 --- a/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/dist/index.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -interface DisallowedToken { - type: 'disallowed'; - cp: number; -} -interface IgnoredToken { - type: 'ignored'; - cp: number; -} -interface ValidToken { - type: 'valid'; - cps: number[]; -} -interface MappedToken { - type: 'mapped'; - cp: number; - cps: number[]; -} -type TextToken = DisallowedToken | IgnoredToken | ValidToken | MappedToken; -interface EmojiToken { - type: 'emoji'; - input: number[]; - emoji: number[]; - cps: number[]; -} -interface NFCToken { - type: 'nfc'; - input: number[]; - cps: number[]; - tokens: TextToken[]; -} -interface StopToken { - type: 'stop'; -} -type Token = TextToken | EmojiToken | NFCToken | StopToken; - -interface Label { - input: number[]; - offset: number; - error?: Error; - tokens?: number[][]; - output?: number[]; - emoji?: boolean; - type?: string; -} - -export function ens_normalize(name: string): string; -export function ens_normalize_fragment(frag: string, decompose?: boolean): string; -export function ens_beautify(name: string): string; -export function ens_tokenize(name: string, options?: {nf?: boolean}): Token[]; -export function ens_split(name: string, preserve_emoji?: boolean): Label[]; - -export function ens_emoji(): number[][]; - -export function should_escape(cp: number): boolean; -export function is_combining_mark(cp: number): boolean; -export function safe_str_from_cps(cps: number[]): string; - -export function nfd(cps: number[]): number[]; -export function nfc(cps: number[]): number[]; diff --git a/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/dist/index.min.js b/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/dist/index.min.js deleted file mode 100644 index a6ca31b9..00000000 --- a/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/dist/index.min.js +++ /dev/null @@ -1 +0,0 @@ -var A="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQ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B4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const e=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),t=4;function n(A){return function(A){let e=0;return()=>A[e++]}(function(A){let e=0;function t(){return A[e++]<<8|A[e++]}let n=t(),l=1,o=[0,1];for(let A=1;A>--C&1}const s=2**31,f=s>>>1,g=s-1;let E=0;for(let A=0;A<31;A++)E=E<<1|Q();let M=[],c=0,i=s;for(;;){let A=Math.floor(((E-c+1)*l-1)/i),e=0,t=n;for(;t-e>1;){let n=e+t>>>1;A>>1|Q(),r=r<<1^f,w=(w^f)<<1|f|1;c=r,i=1+w-r}let D=n-4;return M.map((e=>{switch(e-D){case 3:return D+65792+(A[w++]<<16|A[w++]<<8|A[w++]);case 2:return D+256+(A[w++]<<8|A[w++]);case 1:return D+A[w++];default:return e-1}}))}(function(A){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach(((A,t)=>e[A.charCodeAt(0)]=t));let t=A.length,n=new Uint8Array(6*t>>3);for(let l=0,o=0,r=0,w=0;l=8&&(n[o++]=w>>(r-=8));return n}(A)))}function l(A){return 1&A?~A>>1:A>>1}function o(A,e){let t=Array(A);for(let n=0,o=0;n{let e=r(A);if(e.length)return e}))}function C(A){let e=[];for(;;){let t=A();if(0==t)break;e.push(s(t,A))}for(;;){let t=A()-1;if(t<0)break;e.push(f(t,A))}return e.flat()}function B(A){let e=[];for(;;){let t=A(e.length);if(!t)break;e.push(t)}return e}function Q(A,e,t){let n=Array(A).fill().map((()=>[]));for(let l=0;ln[e].push(A)));return n}function s(A,e){let t=1+e(),n=e(),l=B(e);return Q(l.length,1+A,e).flatMap(((A,e)=>{let[o,...r]=A;return Array(l[e]).fill().map(((A,e)=>{let l=e*n;return[o+e*t,r.map((A=>A+l))]}))}))}function f(A,e){return Q(1+e(),1+A,e).map((A=>[A[0],A.slice(1)]))}function g(A){return`{${function(A){return A.toString(16).toUpperCase().padStart(2,"0")}(A)}}`}function E(A){let e=[];for(let t=0,n=A.length;t>24&255}function F(A){return 16777215&A}let G,H,O,P;function V(A){return A>=D&&A=p&&A=u&&eh&&eA.map((A=>[A,e+1<<24]))))),H=new Set(r(A)),O=new Map,P=new Map;for(let[e,t]of C(A)){if(!H.has(e)&&2==t.length){let[A,n]=t,l=P.get(A);l||(l=new Map,P.set(A,l)),l.set(n,e)}O.set(e,t.reverse())}}();let e=[],t=[],l=!1;function o(A){let t=G.get(A);t&&(l=!0,A|=t),e.push(A)}for(let n of A)for(;;){if(n<128)e.push(n);else if(V(n)){let A=n-D,e=A%R/I|0,t=A%I;o(p+(A/R|0)),o(u+e),t>0&&o(h+t)}else{let A=O.get(n);A?t.push(...A):o(n)}if(!t.length)break;n=t.pop()}if(l&&e.length>1){let A=k(e[0]);for(let t=1;t0&&l>=A)0==A?(e.push(n,...t),t.length=0,n=r):t.push(r),l=A;else{let o=S(n,r);o>=0?n=o:0==l&&0==A?(e.push(n),n=r):(t.push(r),l=A)}}return n>=0&&e.push(n,...t),e}(K(A))}const z=45,Y=46,Z=".",m=65039,x=1,b=A=>Array.from(A);function j(A,e){return A.P.has(e)||A.Q.has(e)}class X extends Array{get is_emoji(){return!0}}let T,W,v,y,q,$,_,AA,eA,tA,nA,lA;function oA(){if(T)return;let e=n(A);const t=()=>r(e),l=()=>new Set(t()),o=(A,e)=>e.forEach((e=>A.add(e)));T=new Map(C(e)),W=l(),v=t(),y=new Set(t().map((A=>v[A]))),v=new Set(v),q=l(),$=l();let Q=w(e),s=e();const f=()=>{let A=new Set;return t().forEach((e=>o(A,Q[e]))),o(A,t()),A};_=B((A=>{let t=B(e).map((A=>A+96));if(t.length){let n=A>=s;return t[0]-=32,t=M(t),n&&(t=`Restricted[${t}]`),{N:t,P:f(),Q:f(),M:!e(),R:n}}})),AA=l(),eA=new Map;let g=t().concat(b(AA)).sort(((A,e)=>A-e));g.forEach(((A,t)=>{let n=e(),l=g[t]=n?g[t-n]:{V:[],M:new Map};l.V.push(A),AA.has(A)||eA.set(A,l)}));for(let{V:A,M:e}of new Set(eA.values())){let t=[];for(let e of A){let A=_.filter((A=>j(A,e))),n=t.find((({G:e})=>A.some((A=>e.has(A)))));n||(n={G:new Set,V:[]},t.push(n)),n.V.push(e),o(n.G,A)}let n=t.flatMap((A=>b(A.G)));for(let{G:A,V:l}of t){let t=new Set(n.filter((e=>!A.has(e))));for(let A of l)e.set(A,t)}}tA=new Set;let E=new Set;const i=A=>tA.has(A)?E.add(A):tA.add(A);for(let A of _){for(let e of A.P)i(e);for(let e of A.Q)i(e)}for(let A of tA)eA.has(A)||E.has(A)||eA.set(A,x);o(tA,L(tA)),nA=function(A){let e=[],t=r(A);return function A({S:t,B:n},l,o){if(!(4&t&&o===l[l.length-1])){2&t&&(o=l[l.length-1]),1&t&&e.push(l);for(let e of n)for(let t of e.Q)A(e,[...l,t],o)}}(function e(n){return{S:A(),B:B((()=>{let n=r(A).map((A=>t[A]));if(n.length)return e(n)})),Q:n}}([]),[]),e}(e).map((A=>X.from(A))).sort(c),lA=new Map;for(let A of nA){let e=[lA];for(let t of A){let A=e.map((A=>{let e=A.get(t);return e||(e=new Map,A.set(t,e)),e}));t===m?e.push(...A):e=A}for(let t of e)t.V=A}}function rA(A){return(QA(A)?"":`${wA(CA([A]))} `)+g(A)}function wA(A){return`"${A}"‎`}function CA(A,e=1/0,t=g){let n=[];BA(A[0])&&n.push("◌"),A.length>e&&(e>>=1,A=[...A.slice(0,e),8230,...A.slice(-e)]);let l=0,o=A.length;for(let e=0;eA.slice()))}function fA(A,e){oA();let t=e?L:d;return A.split(Z).map((A=>M(IA(E(A),t,RA).flat()))).join(Z)}function gA(A){return DA(iA(A,d,RA))}function EA(A){let e=iA(A,d,(A=>A));for(let{type:A,output:t,error:n}of e){if(n)break;"Greek"!==A&&MA(t,958,926)}return DA(e)}function MA(A,e,t){let n=0;for(;;){let l=A.indexOf(e,n);if(l<0)break;A[l]=t,n=l+1}}function cA(A,e){return iA(A,d,e?A=>A.slice():RA)}function iA(A,n,l){if(!A)return[];oA();let o=0;return A.split(Z).map((A=>{let r=E(A),w={input:r,offset:o};o+=r.length+1;try{let A,o=w.tokens=IA(r,n,l),C=o.length;if(!C)throw new Error("empty label");let B=w.output=o.flat();if(function(A){for(let e=A.lastIndexOf(95);e>0;)if(95!==A[--e])throw new Error("underscore allowed only at start")}(B),!(w.emoji=C>1||o[0].is_emoji)&&B.every((A=>A<128)))!function(A){if(A.length>=4&&A[2]==z&&A[3]==z)throw new Error(`invalid label extension: "${M(A.slice(0,4))}"`)}(B),A="ASCII";else{let n=o.flatMap((A=>A.is_emoji?[]:A));if(n.length){if(v.has(B[0]))throw hA("leading combining mark");for(let A=1;Aj(A,t)));if(!A.length)throw _.some((A=>j(A,t)))?uA(e[0],t):pA(t);if(e=A,1==A.length)break}return e}(l);!function(A,e){for(let t of e)if(!j(A,t))throw uA(A,t);if(A.M){let A=L(e);for(let e=1,n=A.length;et)throw new Error(`excessive non-spacing marks: ${wA(CA(A.slice(e-1,l)))} (${l-e}/${t})`);e=l}}}(r,n),function(A,e){let t,n=[];for(let A of e){let e=eA.get(A);if(e===x)return;if(e){let n=e.M.get(A);if(t=t?t.filter((A=>n.has(A))):b(n),!t.length)return}else n.push(A)}if(t)for(let e of t)if(n.every((A=>j(e,A))))throw new Error(`whole-script confusable: ${A.N}/${e.N}`)}(r,l),A=r.N}else A="Emoji"}w.type=A}catch(A){w.error=A}return w}))}function DA(A){return A.map((({input:e,error:t,output:n})=>{if(t){let n=t.message;throw new Error(1==A.length?n:`Invalid label ${wA(CA(e,63))}: ${n}`)}return M(n)})).join(Z)}function pA(A){return new Error(`disallowed character: ${rA(A)}`)}function uA(A,e){let t=rA(e),n=_.find((A=>A.P.has(e)));return n&&(t=`${n.N} ${t}`),new Error(`illegal mixture: ${A.N} + ${t}`)}function hA(A){return new Error(`illegal placement: ${A}`)}function IA(A,e,t){let n=[],l=[];for(A=A.slice().reverse();A.length;){let o=UA(A);if(o)l.length&&(n.push(e(l)),l=[]),n.push(t(o));else{let e=A.pop();if(tA.has(e))l.push(e);else{let A=T.get(e);if(A)l.push(...A);else if(!W.has(e))throw pA(e)}}}return l.length&&n.push(e(l)),n}function RA(A){return A.filter((A=>A!=m))}function UA(A,e){let t,n=lA,l=A.length;for(;l&&(n=n.get(A[--l]),n);){let{V:o}=n;o&&(t=o,e&&e.push(...A.slice(l).reverse()),A.length=l)}return t}const NA="valid",aA="mapped",JA="ignored",kA="disallowed",FA="emoji",GA="nfc",HA="stop";function OA(A,{nf:e=!0}={}){oA();let t=E(A).reverse(),n=[],l=[];for(;t.length;){let A=UA(t,n);if(A)l.push({type:FA,emoji:A.slice(),input:n,cps:RA(A)}),n=[];else{let A=t.pop();if(A==Y)l.push({type:HA,cp:A});else if(tA.has(A))l.push({type:NA,cps:[A]});else if(W.has(A))l.push({type:JA,cp:A});else{let e=T.get(A);e?l.push({type:aA,cp:A,cps:e.slice()}):l.push({type:kA,cp:A})}}}if(e)for(let A=0,e=-1;APA(A.type)?A.cps:[])),r=d(o);c(r,o)?(l.splice(e,t-e,{type:GA,input:o,cps:r,tokens0:SA(n),tokens:OA(M(r),{nf:!1})}),A=e):A=t-1,e=-1}else e=A;else t.type!==JA&&(e=-1)}return SA(l)}function PA(A){return A==NA||A==aA}function VA(A){return A.some((A=>$.has(A)))}function SA(A){for(let e=0;eA.cps))})}return A}export{EA as ens_beautify,sA as ens_emoji,gA as ens_normalize,fA as ens_normalize_fragment,cA as ens_split,OA as ens_tokenize,BA as is_combining_mark,d as nfc,L as nfd,CA as safe_str_from_cps,QA as should_escape}; diff --git a/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/dist/index.mjs b/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/dist/index.mjs deleted file mode 100644 index 0fa5e412..00000000 --- a/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/dist/index.mjs +++ /dev/null @@ -1,1240 +0,0 @@ -// created 2023-09-25T01:01:55.148Z -// compressed base64-encoded blob for include-ens data -// source: https://github.com/adraffy/ens-normalize.js/blob/main/src/make.js -// see: https://github.com/adraffy/ens-normalize.js#security -// SHA-256: 0565ed049b9cf1614bb9e11ba7d8ac6a6fb96c893253d890f7e2b2884b9ded32 -var COMPRESSED$1 = 'AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQ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mRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI'; -const FENCED = new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]); -const NSM_MAX = 4; - -function decode_arithmetic(bytes) { - let pos = 0; - function u16() { return (bytes[pos++] << 8) | bytes[pos++]; } - - // decode the frequency table - let symbol_count = u16(); - let total = 1; - let acc = [0, 1]; // first symbol has frequency 1 - for (let i = 1; i < symbol_count; i++) { - acc.push(total += u16()); - } - - // skip the sized-payload that the last 3 symbols index into - let skip = u16(); - let pos_payload = pos; - pos += skip; - - let read_width = 0; - let read_buffer = 0; - function read_bit() { - if (read_width == 0) { - // this will read beyond end of buffer - // but (undefined|0) => zero pad - read_buffer = (read_buffer << 8) | bytes[pos++]; - read_width = 8; - } - return (read_buffer >> --read_width) & 1; - } - - const N = 31; - const FULL = 2**N; - const HALF = FULL >>> 1; - const QRTR = HALF >> 1; - const MASK = FULL - 1; - - // fill register - let register = 0; - for (let i = 0; i < N; i++) register = (register << 1) | read_bit(); - - let symbols = []; - let low = 0; - let range = FULL; // treat like a float - while (true) { - let value = Math.floor((((register - low + 1) * total) - 1) / range); - let start = 0; - let end = symbol_count; - while (end - start > 1) { // binary search - let mid = (start + end) >>> 1; - if (value < acc[mid]) { - end = mid; - } else { - start = mid; - } - } - if (start == 0) break; // first symbol is end mark - symbols.push(start); - let a = low + Math.floor(range * acc[start] / total); - let b = low + Math.floor(range * acc[start+1] / total) - 1; - while (((a ^ b) & HALF) == 0) { - register = (register << 1) & MASK | read_bit(); - a = (a << 1) & MASK; - b = (b << 1) & MASK | 1; - } - while (a & ~b & QRTR) { - register = (register & HALF) | ((register << 1) & (MASK >>> 1)) | read_bit(); - a = (a << 1) ^ HALF; - b = ((b ^ HALF) << 1) | HALF | 1; - } - low = a; - range = 1 + b - a; - } - let offset = symbol_count - 4; - return symbols.map(x => { // index into payload - switch (x - offset) { - case 3: return offset + 0x10100 + ((bytes[pos_payload++] << 16) | (bytes[pos_payload++] << 8) | bytes[pos_payload++]); - case 2: return offset + 0x100 + ((bytes[pos_payload++] << 8) | bytes[pos_payload++]); - case 1: return offset + bytes[pos_payload++]; - default: return x - 1; - } - }); -} - -// returns an iterator which returns the next symbol -function read_payload(v) { - let pos = 0; - return () => v[pos++]; -} -function read_compressed_payload(s) { - return read_payload(decode_arithmetic(unsafe_atob(s))); -} - -// unsafe in the sense: -// expected well-formed Base64 w/o padding -// 20220922: added for https://github.com/adraffy/ens-normalize.js/issues/4 -function unsafe_atob(s) { - let lookup = []; - [...'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'].forEach((c, i) => lookup[c.charCodeAt(0)] = i); - let n = s.length; - let ret = new Uint8Array((6 * n) >> 3); - for (let i = 0, pos = 0, width = 0, carry = 0; i < n; i++) { - carry = (carry << 6) | lookup[s.charCodeAt(i)]; - width += 6; - if (width >= 8) { - ret[pos++] = (carry >> (width -= 8)); - } - } - return ret; -} - -// eg. [0,1,2,3...] => [0,-1,1,-2,...] -function signed(i) { - return (i & 1) ? (~i >> 1) : (i >> 1); -} - -function read_deltas(n, next) { - let v = Array(n); - for (let i = 0, x = 0; i < n; i++) v[i] = x += signed(next()); - return v; -} - -// [123][5] => [0 3] [1 1] [0 0] -function read_sorted(next, prev = 0) { - let ret = []; - while (true) { - let x = next(); - let n = next(); - if (!n) break; - prev += x; - for (let i = 0; i < n; i++) { - ret.push(prev + i); - } - prev += n + 1; - } - return ret; -} - -function read_sorted_arrays(next) { - return read_array_while(() => { - let v = read_sorted(next); - if (v.length) return v; - }); -} - -// returns map of x => ys -function read_mapped(next) { - let ret = []; - while (true) { - let w = next(); - if (w == 0) break; - ret.push(read_linear_table(w, next)); - } - while (true) { - let w = next() - 1; - if (w < 0) break; - ret.push(read_replacement_table(w, next)); - } - return ret.flat(); -} - -// read until next is falsy -// return array of read values -function read_array_while(next) { - let v = []; - while (true) { - let x = next(v.length); - if (!x) break; - v.push(x); - } - return v; -} - -// read w columns of length n -// return as n rows of length w -function read_transposed(n, w, next) { - let m = Array(n).fill().map(() => []); - for (let i = 0; i < w; i++) { - read_deltas(n, next).forEach((x, j) => m[j].push(x)); - } - return m; -} - -// returns [[x, ys], [x+dx, ys+dy], [x+2*dx, ys+2*dy], ...] -// where dx/dy = steps, n = run size, w = length of y -function read_linear_table(w, next) { - let dx = 1 + next(); - let dy = next(); - let vN = read_array_while(next); - let m = read_transposed(vN.length, 1+w, next); - return m.flatMap((v, i) => { - let [x, ...ys] = v; - return Array(vN[i]).fill().map((_, j) => { - let j_dy = j * dy; - return [x + j * dx, ys.map(y => y + j_dy)]; - }); - }); -} - -// return [[x, ys...], ...] -// where w = length of y -function read_replacement_table(w, next) { - let n = 1 + next(); - let m = read_transposed(n, 1+w, next); - return m.map(v => [v[0], v.slice(1)]); -} - - -function read_trie(next) { - let ret = []; - let sorted = read_sorted(next); - expand(decode([]), []); - return ret; // not sorted - function decode(Q) { // characters that lead into this node - let S = next(); // state: valid, save, check - let B = read_array_while(() => { // buckets leading to new nodes - let cps = read_sorted(next).map(i => sorted[i]); - if (cps.length) return decode(cps); - }); - return {S, B, Q}; - } - function expand({S, B}, cps, saved) { - if (S & 4 && saved === cps[cps.length-1]) return; - if (S & 2) saved = cps[cps.length-1]; - if (S & 1) ret.push(cps); - for (let br of B) { - for (let cp of br.Q) { - expand(br, [...cps, cp], saved); - } - } - } -} - -function hex_cp(cp) { - return cp.toString(16).toUpperCase().padStart(2, '0'); -} - -function quote_cp(cp) { - return `{${hex_cp(cp)}}`; // raffy convention: like "\u{X}" w/o the "\u" -} - -/* -export function explode_cp(s) { - return [...s].map(c => c.codePointAt(0)); -} -*/ -function explode_cp(s) { // this is about 2x faster - let cps = []; - for (let pos = 0, len = s.length; pos < len; ) { - let cp = s.codePointAt(pos); - pos += cp < 0x10000 ? 1 : 2; - cps.push(cp); - } - return cps; -} - -function str_from_cps(cps) { - const chunk = 4096; - let len = cps.length; - if (len < chunk) return String.fromCodePoint(...cps); - let buf = []; - for (let i = 0; i < len; ) { - buf.push(String.fromCodePoint(...cps.slice(i, i += chunk))); - } - return buf.join(''); -} - -function compare_arrays(a, b) { - let n = a.length; - let c = n - b.length; - for (let i = 0; c == 0 && i < n; i++) c = a[i] - b[i]; - return c; -} - -// created 2023-09-25T01:01:55.148Z -// compressed base64-encoded blob for include-nf data -// source: https://github.com/adraffy/ens-normalize.js/blob/main/src/make.js -// see: https://github.com/adraffy/ens-normalize.js#security -// SHA-256: a974b6f8541fc29d919bc85118af0a44015851fab5343f8679cb31be2bdb209e -var COMPRESSED = 'AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwAB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LLc4vpXci8VidLxzm7qFBe7s+quuJs6ETYmnpgS3LwSZxPIltgBDXz8M1k/W2ySNv2f9/NPhxLGK2D21dkHeSGmenRT3Yqcdl0m/h3OYr8V+lXNYGf8aCCpd4bWjE4QIPj7vUKN4Nrfs7ML6Y2OyS830JCnofg/k7lpFpt4SqZc5HGg1HCOrHvOdC8bP6FGDbE/VV0mX4IakzbdS/op+Kt3G24/8QbBV7y86sGSQ/vZzU8FXs7u6jIvwchsEP2BpIhW3G8uWNwa3HmjfH/ZjhhCWvluAcF+nMf14ClKg5hGgtPLJ98ueNAkc5Hs2WZlk2QHvfreCK1CCGO6nMZVSb99VM/ajr8WHTte9JSmkXq/i/U943HEbdzW6Re/S88dKgg8pGOLlAeNiqrcLkUR3/aClFpMXcOUP3rmETcWSfMXZE3TUOi8i+fqRnTYLflVx/Vb/6GJ7eIRZUA6k3RYR3iFSK9c4iDdNwJuZL2FKz/IK5VimcNWEqdXjSoxSgmF0UPlDoUlNrPcM7ftmA8Y9gKiqKEHuWN+AZRIwtVSxye2Kf8rM3lhJ5XcBXU9n4v0Oy1RU2M+4qM8AQPVwse8ErNSob5oFPWxuqZnVzo1qB/IBxkM3EVUKFUUlO3e51259GgNcJbCmlvrdjtoTW7rChm1wyCKzpCTwozUUEOIcWLneRLgMXh+SjGSFkAllzbGS5HK7LlfCMRNRDSvbQPjcXaenNYxCvu2Qyznz6StuxVj66SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g'; - -// https://unicode.org/reports/tr15/ -// for reference implementation -// see: /derive/nf.js - - -// algorithmic hangul -// https://www.unicode.org/versions/Unicode15.0.0/ch03.pdf (page 144) -const S0 = 0xAC00; -const L0 = 0x1100; -const V0 = 0x1161; -const T0 = 0x11A7; -const L_COUNT = 19; -const V_COUNT = 21; -const T_COUNT = 28; -const N_COUNT = V_COUNT * T_COUNT; -const S_COUNT = L_COUNT * N_COUNT; -const S1 = S0 + S_COUNT; -const L1 = L0 + L_COUNT; -const V1 = V0 + V_COUNT; -const T1 = T0 + T_COUNT; - -function unpack_cc(packed) { - return (packed >> 24) & 0xFF; -} -function unpack_cp(packed) { - return packed & 0xFFFFFF; -} - -let SHIFTED_RANK, EXCLUSIONS, DECOMP, RECOMP; - -function init$1() { - //console.time('nf'); - let r = read_compressed_payload(COMPRESSED); - SHIFTED_RANK = new Map(read_sorted_arrays(r).flatMap((v, i) => v.map(x => [x, (i+1) << 24]))); // pre-shifted - EXCLUSIONS = new Set(read_sorted(r)); - DECOMP = new Map(); - RECOMP = new Map(); - for (let [cp, cps] of read_mapped(r)) { - if (!EXCLUSIONS.has(cp) && cps.length == 2) { - let [a, b] = cps; - let bucket = RECOMP.get(a); - if (!bucket) { - bucket = new Map(); - RECOMP.set(a, bucket); - } - bucket.set(b, cp); - } - DECOMP.set(cp, cps.reverse()); // stored reversed - } - //console.timeEnd('nf'); - // 20230905: 11ms -} - -function is_hangul(cp) { - return cp >= S0 && cp < S1; -} - -function compose_pair(a, b) { - if (a >= L0 && a < L1 && b >= V0 && b < V1) { - return S0 + (a - L0) * N_COUNT + (b - V0) * T_COUNT; - } else if (is_hangul(a) && b > T0 && b < T1 && (a - S0) % T_COUNT == 0) { - return a + (b - T0); - } else { - let recomp = RECOMP.get(a); - if (recomp) { - recomp = recomp.get(b); - if (recomp) { - return recomp; - } - } - return -1; - } -} - -function decomposed(cps) { - if (!SHIFTED_RANK) init$1(); - let ret = []; - let buf = []; - let check_order = false; - function add(cp) { - let cc = SHIFTED_RANK.get(cp); - if (cc) { - check_order = true; - cp |= cc; - } - ret.push(cp); - } - for (let cp of cps) { - while (true) { - if (cp < 0x80) { - ret.push(cp); - } else if (is_hangul(cp)) { - let s_index = cp - S0; - let l_index = s_index / N_COUNT | 0; - let v_index = (s_index % N_COUNT) / T_COUNT | 0; - let t_index = s_index % T_COUNT; - add(L0 + l_index); - add(V0 + v_index); - if (t_index > 0) add(T0 + t_index); - } else { - let mapped = DECOMP.get(cp); - if (mapped) { - buf.push(...mapped); - } else { - add(cp); - } - } - if (!buf.length) break; - cp = buf.pop(); - } - } - if (check_order && ret.length > 1) { - let prev_cc = unpack_cc(ret[0]); - for (let i = 1; i < ret.length; i++) { - let cc = unpack_cc(ret[i]); - if (cc == 0 || prev_cc <= cc) { - prev_cc = cc; - continue; - } - let j = i-1; - while (true) { - let tmp = ret[j+1]; - ret[j+1] = ret[j]; - ret[j] = tmp; - if (!j) break; - prev_cc = unpack_cc(ret[--j]); - if (prev_cc <= cc) break; - } - prev_cc = unpack_cc(ret[i]); - } - } - return ret; -} - -function composed_from_decomposed(v) { - let ret = []; - let stack = []; - let prev_cp = -1; - let prev_cc = 0; - for (let packed of v) { - let cc = unpack_cc(packed); - let cp = unpack_cp(packed); - if (prev_cp == -1) { - if (cc == 0) { - prev_cp = cp; - } else { - ret.push(cp); - } - } else if (prev_cc > 0 && prev_cc >= cc) { - if (cc == 0) { - ret.push(prev_cp, ...stack); - stack.length = 0; - prev_cp = cp; - } else { - stack.push(cp); - } - prev_cc = cc; - } else { - let composed = compose_pair(prev_cp, cp); - if (composed >= 0) { - prev_cp = composed; - } else if (prev_cc == 0 && cc == 0) { - ret.push(prev_cp); - prev_cp = cp; - } else { - stack.push(cp); - prev_cc = cc; - } - } - } - if (prev_cp >= 0) { - ret.push(prev_cp, ...stack); - } - return ret; -} - -// note: cps can be iterable -function nfd(cps) { - return decomposed(cps).map(unpack_cp); -} -function nfc(cps) { - return composed_from_decomposed(decomposed(cps)); -} - -const HYPHEN = 0x2D; -const STOP = 0x2E; -const STOP_CH = '.'; -const FE0F = 0xFE0F; -const UNIQUE_PH = 1; - -// 20230913: replace [...v] with Array_from(v) to avoid large spreads -const Array_from = x => Array.from(x); // Array.from.bind(Array); - -function group_has_cp(g, cp) { - // 20230913: keep primary and secondary distinct instead of creating valid union - return g.P.has(cp) || g.Q.has(cp); -} - -class Emoji extends Array { - get is_emoji() { return true; } // free tagging system -} - -let MAPPED, IGNORED, CM, NSM, ESCAPE, NFC_CHECK, GROUPS, WHOLE_VALID, WHOLE_MAP, VALID, EMOJI_LIST, EMOJI_ROOT; - -function init() { - if (MAPPED) return; - - let r = read_compressed_payload(COMPRESSED$1); - const read_sorted_array = () => read_sorted(r); - const read_sorted_set = () => new Set(read_sorted_array()); - const set_add_many = (set, v) => v.forEach(x => set.add(x)); - - MAPPED = new Map(read_mapped(r)); - IGNORED = read_sorted_set(); // ignored characters are not valid, so just read raw codepoints - - /* - // direct include from payload is smaller than the decompression code - const FENCED = new Map(read_array_while(() => { - let cp = r(); - if (cp) return [cp, read_str(r())]; - })); - */ - // 20230217: we still need all CM for proper error formatting - // but norm only needs NSM subset that are potentially-valid - CM = read_sorted_array(); - NSM = new Set(read_sorted_array().map(i => CM[i])); - CM = new Set(CM); - - ESCAPE = read_sorted_set(); // characters that should not be printed - NFC_CHECK = read_sorted_set(); // only needed to illustrate ens_tokenize() transformations - - let chunks = read_sorted_arrays(r); - let unrestricted = r(); - //const read_chunked = () => new Set(read_sorted_array().flatMap(i => chunks[i]).concat(read_sorted_array())); - const read_chunked = () => { - // 20230921: build set in parts, 2x faster - let set = new Set(); - read_sorted_array().forEach(i => set_add_many(set, chunks[i])); - set_add_many(set, read_sorted_array()); - return set; - }; - GROUPS = read_array_while(i => { - // minifier property mangling seems unsafe - // so these are manually renamed to single chars - let N = read_array_while(r).map(x => x+0x60); - if (N.length) { - let R = i >= unrestricted; // unrestricted then restricted - N[0] -= 32; // capitalize - N = str_from_cps(N); - if (R) N=`Restricted[${N}]`; - let P = read_chunked(); // primary - let Q = read_chunked(); // secondary - let M = !r(); // not-whitelisted, check for NSM - // *** this code currently isn't needed *** - /* - let V = [...P, ...Q].sort((a, b) => a-b); // derive: sorted valid - let M = r()-1; // number of combining mark - if (M < 0) { // whitelisted - M = new Map(read_array_while(() => { - let i = r(); - if (i) return [V[i-1], read_array_while(() => { - let v = read_array_while(r); - if (v.length) return v.map(x => x-1); - })]; - })); - }*/ - return {N, P, Q, M, R}; - } - }); - - // decode compressed wholes - WHOLE_VALID = read_sorted_set(); - WHOLE_MAP = new Map(); - let wholes = read_sorted_array().concat(Array_from(WHOLE_VALID)).sort((a, b) => a-b); // must be sorted - wholes.forEach((cp, i) => { - let d = r(); - let w = wholes[i] = d ? wholes[i-d] : {V: [], M: new Map()}; - w.V.push(cp); // add to member set - if (!WHOLE_VALID.has(cp)) { - WHOLE_MAP.set(cp, w); // register with whole map - } - }); - - // compute confusable-extent complements - // usage: WHOLE_MAP.get(cp).M.get(cp) = complement set - for (let {V, M} of new Set(WHOLE_MAP.values())) { - // connect all groups that have each whole character - let recs = []; - for (let cp of V) { - let gs = GROUPS.filter(g => group_has_cp(g, cp)); - let rec = recs.find(({G}) => gs.some(g => G.has(g))); - if (!rec) { - rec = {G: new Set(), V: []}; - recs.push(rec); - } - rec.V.push(cp); - set_add_many(rec.G, gs); - } - // per character cache groups which are not a member of the extent - let union = recs.flatMap(x => Array_from(x.G)); // all of the groups used by this whole - for (let {G, V} of recs) { - let complement = new Set(union.filter(g => !G.has(g))); // groups not covered by the extent - for (let cp of V) { - M.set(cp, complement); // this is the same reference - } - } - } - - // compute valid set - // 20230924: VALID was union but can be re-used - VALID = new Set(); // exists in 1+ groups - let multi = new Set(); // exists in 2+ groups - const add_to_union = cp => VALID.has(cp) ? multi.add(cp) : VALID.add(cp); - for (let g of GROUPS) { - for (let cp of g.P) add_to_union(cp); - for (let cp of g.Q) add_to_union(cp); - } - // dual purpose WHOLE_MAP: return placeholder if unique non-confusable - for (let cp of VALID) { - if (!WHOLE_MAP.has(cp) && !multi.has(cp)) { - WHOLE_MAP.set(cp, UNIQUE_PH); - } - } - // add all decomposed parts - // see derive: "Valid is Closed (via Brute-force)" - set_add_many(VALID, nfd(VALID)); - - // decode emoji - // 20230719: emoji are now fully-expanded to avoid quirk logic - EMOJI_LIST = read_trie(r).map(v => Emoji.from(v)).sort(compare_arrays); - EMOJI_ROOT = new Map(); // this has approx 7K nodes (2+ per emoji) - for (let cps of EMOJI_LIST) { - // 20230719: change to *slightly* stricter algorithm which disallows - // insertion of misplaced FE0F in emoji sequences (matching ENSIP-15) - // example: beautified [A B] (eg. flag emoji) - // before: allow: [A FE0F B], error: [A FE0F FE0F B] - // after: error: both - // note: this code now matches ENSNormalize.{cs,java} logic - let prev = [EMOJI_ROOT]; - for (let cp of cps) { - let next = prev.map(node => { - let child = node.get(cp); - if (!child) { - // should this be object? - // (most have 1-2 items, few have many) - // 20230719: no, v8 default map is 4? - child = new Map(); - node.set(cp, child); - } - return child; - }); - if (cp === FE0F) { - prev.push(...next); // less than 20 elements - } else { - prev = next; - } - } - for (let x of prev) { - x.V = cps; - } - } -} - -// if escaped: {HEX} -// else: "x" {HEX} -function quoted_cp(cp) { - return (should_escape(cp) ? '' : `${bidi_qq(safe_str_from_cps([cp]))} `) + quote_cp(cp); -} - -// 20230211: some messages can be mixed-directional and result in spillover -// use 200E after a quoted string to force the remainder of a string from -// acquring the direction of the quote -// https://www.w3.org/International/questions/qa-bidi-unicode-controls#exceptions -function bidi_qq(s) { - return `"${s}"\u200E`; // strong LTR -} - -function check_label_extension(cps) { - if (cps.length >= 4 && cps[2] == HYPHEN && cps[3] == HYPHEN) { - throw new Error(`invalid label extension: "${str_from_cps(cps.slice(0, 4))}"`); // this can only be ascii so cant be bidi - } -} -function check_leading_underscore(cps) { - const UNDERSCORE = 0x5F; - for (let i = cps.lastIndexOf(UNDERSCORE); i > 0; ) { - if (cps[--i] !== UNDERSCORE) { - throw new Error('underscore allowed only at start'); - } - } -} -// check that a fenced cp is not leading, trailing, or touching another fenced cp -function check_fenced(cps) { - let cp = cps[0]; - let prev = FENCED.get(cp); - if (prev) throw error_placement(`leading ${prev}`); - let n = cps.length; - let last = -1; // prevents trailing from throwing - for (let i = 1; i < n; i++) { - cp = cps[i]; - let match = FENCED.get(cp); - if (match) { - // since cps[0] isn't fenced, cps[1] cannot throw - if (last == i) throw error_placement(`${prev} + ${match}`); - last = i + 1; - prev = match; - } - } - if (last == n) throw error_placement(`trailing ${prev}`); -} - -// create a safe to print string -// invisibles are escaped -// leading cm uses placeholder -// if cps exceed max, middle truncate with ellipsis -// quoter(cp) => string, eg. 3000 => "{3000}" -// note: in html, you'd call this function then replace [<>&] with entities -function safe_str_from_cps(cps, max = Infinity, quoter = quote_cp) { - //if (Number.isInteger(cps)) cps = [cps]; - //if (!Array.isArray(cps)) throw new TypeError(`expected codepoints`); - let buf = []; - if (is_combining_mark(cps[0])) buf.push('◌'); - if (cps.length > max) { - max >>= 1; - cps = [...cps.slice(0, max), 0x2026, ...cps.slice(-max)]; - } - let prev = 0; - let n = cps.length; - for (let i = 0; i < n; i++) { - let cp = cps[i]; - if (should_escape(cp)) { - buf.push(str_from_cps(cps.slice(prev, i))); - buf.push(quoter(cp)); - prev = i + 1; - } - } - buf.push(str_from_cps(cps.slice(prev, n))); - return buf.join(''); -} - -// note: set(s) cannot be exposed because they can be modified -// note: Object.freeze() doesn't work -function is_combining_mark(cp) { - init(); - return CM.has(cp); -} -function should_escape(cp) { - init(); - return ESCAPE.has(cp); -} - -// return all supported emoji as fully-qualified emoji -// ordered by length then lexicographic -function ens_emoji() { - init(); - return EMOJI_LIST.map(x => x.slice()); // emoji are exposed so copy -} - -function ens_normalize_fragment(frag, decompose) { - init(); - let nf = decompose ? nfd : nfc; - return frag.split(STOP_CH).map(label => str_from_cps(tokens_from_str(explode_cp(label), nf, filter_fe0f).flat())).join(STOP_CH); -} - -function ens_normalize(name) { - return flatten(split(name, nfc, filter_fe0f)); -} - -function ens_beautify(name) { - let labels = split(name, nfc, x => x); // emoji not exposed - for (let {type, output, error} of labels) { - if (error) break; // flatten will throw - - // replace leading/trailing hyphen - // 20230121: consider beautifing all or leading/trailing hyphen to unicode variant - // not exactly the same in every font, but very similar: "-" vs "‐" - /* - const UNICODE_HYPHEN = 0x2010; - // maybe this should replace all for visual consistancy? - // `node tools/reg-count.js regex ^-\{2,\}` => 592 - //for (let i = 0; i < output.length; i++) if (output[i] == 0x2D) output[i] = 0x2010; - if (output[0] == HYPHEN) output[0] = UNICODE_HYPHEN; - let end = output.length-1; - if (output[end] == HYPHEN) output[end] = UNICODE_HYPHEN; - */ - // 20230123: WHATWG URL uses "CheckHyphens" false - // https://url.spec.whatwg.org/#idna - - // update ethereum symbol - // ξ => Ξ if not greek - if (type !== 'Greek') array_replace(output, 0x3BE, 0x39E); - - // 20221213: fixes bidi subdomain issue, but breaks invariant (200E is disallowed) - // could be fixed with special case for: 2D (.) + 200E (LTR) - // https://discuss.ens.domains/t/bidi-label-ordering-spoof/15824 - //output.splice(0, 0, 0x200E); - } - return flatten(labels); -} - -function array_replace(v, a, b) { - let prev = 0; - while (true) { - let next = v.indexOf(a, prev); - if (next < 0) break; - v[next] = b; - prev = next + 1; - } -} - -function ens_split(name, preserve_emoji) { - return split(name, nfc, preserve_emoji ? x => x.slice() : filter_fe0f); // emoji are exposed so copy -} - -function split(name, nf, ef) { - if (!name) return []; // 20230719: empty name allowance - init(); - let offset = 0; - // https://unicode.org/reports/tr46/#Validity_Criteria - // 4.) "The label must not contain a U+002E ( . ) FULL STOP." - return name.split(STOP_CH).map(label => { - let input = explode_cp(label); - let info = { - input, - offset, // codepoint, not substring! - }; - offset += input.length + 1; // + stop - try { - // 1.) "The label must be in Unicode Normalization Form NFC" - let tokens = info.tokens = tokens_from_str(input, nf, ef); - let token_count = tokens.length; - let type; - if (!token_count) { // the label was effectively empty (could of had ignored characters) - //norm = []; - //type = 'None'; // use this instead of next match, "ASCII" - // 20230120: change to strict - // https://discuss.ens.domains/t/ens-name-normalization-2nd/14564/59 - throw new Error(`empty label`); - } - let norm = info.output = tokens.flat(); - check_leading_underscore(norm); - let emoji = info.emoji = token_count > 1 || tokens[0].is_emoji; // same as: tokens.some(x => x.is_emoji); - if (!emoji && norm.every(cp => cp < 0x80)) { // special case for ascii - // 20230123: matches matches WHATWG, see note 3.3 - check_label_extension(norm); // only needed for ascii - // cant have fenced - // cant have cm - // cant have wholes - // see derive: "Fastpath ASCII" - type = 'ASCII'; - } else { - let chars = tokens.flatMap(x => x.is_emoji ? [] : x); // all of the nfc tokens concat together - if (!chars.length) { // theres no text, just emoji - type = 'Emoji'; - } else { - // 5.) "The label must not begin with a combining mark, that is: General_Category=Mark." - if (CM.has(norm[0])) throw error_placement('leading combining mark'); - for (let i = 1; i < token_count; i++) { // we've already checked the first token - let cps = tokens[i]; - if (!cps.is_emoji && CM.has(cps[0])) { // every text token has emoji neighbors, eg. EtEEEtEt... - // bidi_qq() not needed since emoji is LTR and cps is a CM - throw error_placement(`emoji + combining mark: "${str_from_cps(tokens[i-1])} + ${safe_str_from_cps([cps[0]])}"`); - } - } - check_fenced(norm); - let unique = Array_from(new Set(chars)); - let [g] = determine_group(unique); // take the first match - // see derive: "Matching Groups have Same CM Style" - // alternative: could form a hybrid type: Latin/Japanese/... - check_group(g, chars); // need text in order - check_whole(g, unique); // only need unique text (order would be required for multiple-char confusables) - type = g.N; - // 20230121: consider exposing restricted flag - // it's simpler to just check for 'Restricted' - // or even better: type.endsWith(']') - //if (g.R) info.restricted = true; - } - } - info.type = type; - } catch (err) { - info.error = err; // use full error object - } - return info; - }); -} - -function check_whole(group, unique) { - let maker; - let shared = []; - for (let cp of unique) { - let whole = WHOLE_MAP.get(cp); - if (whole === UNIQUE_PH) return; // unique, non-confusable - if (whole) { - let set = whole.M.get(cp); // groups which have a character that look-like this character - maker = maker ? maker.filter(g => set.has(g)) : Array_from(set); - if (!maker.length) return; // confusable intersection is empty - } else { - shared.push(cp); - } - } - if (maker) { - // we have 1+ confusable - // check if any of the remaining groups - // contain the shared characters too - for (let g of maker) { - if (shared.every(cp => group_has_cp(g, cp))) { - throw new Error(`whole-script confusable: ${group.N}/${g.N}`); - } - } - } -} - -// assumption: unique.size > 0 -// returns list of matching groups -function determine_group(unique) { - let groups = GROUPS; - for (let cp of unique) { - // note: we need to dodge CM that are whitelisted - // but that code isn't currently necessary - let gs = groups.filter(g => group_has_cp(g, cp)); - if (!gs.length) { - if (!GROUPS.some(g => group_has_cp(g, cp))) { - // the character was composed of valid parts - // but it's NFC form is invalid - // 20230716: change to more exact statement, see: ENSNormalize.{cs,java} - // note: this doesn't have to be a composition - // 20230720: change to full check - throw error_disallowed(cp); // this should be rare - } else { - // there is no group that contains all these characters - // throw using the highest priority group that matched - // https://www.unicode.org/reports/tr39/#mixed_script_confusables - throw error_group_member(groups[0], cp); - } - } - groups = gs; - if (gs.length == 1) break; // there is only one group left - } - // there are at least 1 group(s) with all of these characters - return groups; -} - -// throw on first error -function flatten(split) { - return split.map(({input, error, output}) => { - if (error) { - // don't print label again if just a single label - let msg = error.message; - // bidi_qq() only necessary if msg is digits - throw new Error(split.length == 1 ? msg : `Invalid label ${bidi_qq(safe_str_from_cps(input, 63))}: ${msg}`); - } - return str_from_cps(output); - }).join(STOP_CH); -} - -function error_disallowed(cp) { - // TODO: add cp to error? - return new Error(`disallowed character: ${quoted_cp(cp)}`); -} -function error_group_member(g, cp) { - let quoted = quoted_cp(cp); - let gg = GROUPS.find(g => g.P.has(cp)); // only check primary - if (gg) { - quoted = `${gg.N} ${quoted}`; - } - return new Error(`illegal mixture: ${g.N} + ${quoted}`); -} -function error_placement(where) { - return new Error(`illegal placement: ${where}`); -} - -// assumption: cps.length > 0 -// assumption: cps[0] isn't a CM -// assumption: the previous character isn't an emoji -function check_group(g, cps) { - for (let cp of cps) { - if (!group_has_cp(g, cp)) { - // for whitelisted scripts, this will throw illegal mixture on invalid cm, eg. "e{300}{300}" - // at the moment, it's unnecessary to introduce an extra error type - // until there exists a whitelisted multi-character - // eg. if (M < 0 && is_combining_mark(cp)) { ... } - // there are 3 cases: - // 1. illegal cm for wrong group => mixture error - // 2. illegal cm for same group => cm error - // requires set of whitelist cm per group: - // eg. new Set([...g.P, ...g.Q].flatMap(nfc).filter(cp => CM.has(cp))) - // 3. wrong group => mixture error - throw error_group_member(g, cp); - } - } - //if (M >= 0) { // we have a known fixed cm count - if (g.M) { // we need to check for NSM - let decomposed = nfd(cps); - for (let i = 1, e = decomposed.length; i < e; i++) { // see: assumption - // 20230210: bugfix: using cps instead of decomposed h/t Carbon225 - /* - if (CM.has(decomposed[i])) { - let j = i + 1; - while (j < e && CM.has(decomposed[j])) j++; - if (j - i > M) { - throw new Error(`too many combining marks: ${g.N} ${bidi_qq(str_from_cps(decomposed.slice(i-1, j)))} (${j-i}/${M})`); - } - i = j; - } - */ - // 20230217: switch to NSM counting - // https://www.unicode.org/reports/tr39/#Optional_Detection - if (NSM.has(decomposed[i])) { - let j = i + 1; - for (let cp; j < e && NSM.has(cp = decomposed[j]); j++) { - // a. Forbid sequences of the same nonspacing mark. - for (let k = i; k < j; k++) { // O(n^2) but n < 100 - if (decomposed[k] == cp) { - throw new Error(`duplicate non-spacing marks: ${quoted_cp(cp)}`); - } - } - } - // parse to end so we have full nsm count - // b. Forbid sequences of more than 4 nonspacing marks (gc=Mn or gc=Me). - if (j - i > NSM_MAX) { - // note: this slice starts with a base char or spacing-mark cm - throw new Error(`excessive non-spacing marks: ${bidi_qq(safe_str_from_cps(decomposed.slice(i-1, j)))} (${j-i}/${NSM_MAX})`); - } - i = j; - } - } - } - // *** this code currently isn't needed *** - /* - let cm_whitelist = M instanceof Map; - for (let i = 0, e = cps.length; i < e; ) { - let cp = cps[i++]; - let seqs = cm_whitelist && M.get(cp); - if (seqs) { - // list of codepoints that can follow - // if this exists, this will always be 1+ - let j = i; - while (j < e && CM.has(cps[j])) j++; - let cms = cps.slice(i, j); - let match = seqs.find(seq => !compare_arrays(seq, cms)); - if (!match) throw new Error(`disallowed combining mark sequence: "${safe_str_from_cps([cp, ...cms])}"`); - i = j; - } else if (!V.has(cp)) { - // https://www.unicode.org/reports/tr39/#mixed_script_confusables - let quoted = quoted_cp(cp); - for (let cp of cps) { - let u = UNIQUE.get(cp); - if (u && u !== g) { - // if both scripts are restricted this error is confusing - // because we don't differentiate RestrictedA from RestrictedB - if (!u.R) quoted = `${quoted} is ${u.N}`; - break; - } - } - throw new Error(`disallowed ${g.N} character: ${quoted}`); - //throw new Error(`disallowed character: ${quoted} (expected ${g.N})`); - //throw new Error(`${g.N} does not allow: ${quoted}`); - } - } - if (!cm_whitelist) { - let decomposed = nfd(cps); - for (let i = 1, e = decomposed.length; i < e; i++) { // we know it can't be cm leading - if (CM.has(decomposed[i])) { - let j = i + 1; - while (j < e && CM.has(decomposed[j])) j++; - if (j - i > M) { - throw new Error(`too many combining marks: "${str_from_cps(decomposed.slice(i-1, j))}" (${j-i}/${M})`); - } - i = j; - } - } - } - */ -} - -// given a list of codepoints -// returns a list of lists, where emoji are a fully-qualified (as Array subclass) -// eg. explode_cp("abc💩d") => [[61, 62, 63], Emoji[1F4A9, FE0F], [64]] -// 20230818: rename for 'process' name collision h/t Javarome -// https://github.com/adraffy/ens-normalize.js/issues/23 -function tokens_from_str(input, nf, ef) { - let ret = []; - let chars = []; - input = input.slice().reverse(); // flip so we can pop - while (input.length) { - let emoji = consume_emoji_reversed(input); - if (emoji) { - if (chars.length) { - ret.push(nf(chars)); - chars = []; - } - ret.push(ef(emoji)); - } else { - let cp = input.pop(); - if (VALID.has(cp)) { - chars.push(cp); - } else { - let cps = MAPPED.get(cp); - if (cps) { - chars.push(...cps); // less than 10 elements - } else if (!IGNORED.has(cp)) { - // 20230912: unicode 15.1 changed the order of processing such that - // disallowed parts are only rejected after NFC - // https://unicode.org/reports/tr46/#Validity_Criteria - // this doesn't impact normalization as of today - // technically, this error can be removed as the group logic will apply similar logic - // however the error type might be less clear - throw error_disallowed(cp); - } - } - } - } - if (chars.length) { - ret.push(nf(chars)); - } - return ret; -} - -function filter_fe0f(cps) { - return cps.filter(cp => cp != FE0F); -} - -// given array of codepoints -// returns the longest valid emoji sequence (or undefined if no match) -// *MUTATES* the supplied array -// disallows interleaved ignored characters -// fills (optional) eaten array with matched codepoints -function consume_emoji_reversed(cps, eaten) { - let node = EMOJI_ROOT; - let emoji; - let pos = cps.length; - while (pos) { - node = node.get(cps[--pos]); - if (!node) break; - let {V} = node; - if (V) { // this is a valid emoji (so far) - emoji = V; - if (eaten) eaten.push(...cps.slice(pos).reverse()); // (optional) copy input, used for ens_tokenize() - cps.length = pos; // truncate - } - } - return emoji; -} - -// ************************************************************ -// tokenizer - -const TY_VALID = 'valid'; -const TY_MAPPED = 'mapped'; -const TY_IGNORED = 'ignored'; -const TY_DISALLOWED = 'disallowed'; -const TY_EMOJI = 'emoji'; -const TY_NFC = 'nfc'; -const TY_STOP = 'stop'; - -function ens_tokenize(name, { - nf = true, // collapse unnormalized runs into a single token -} = {}) { - init(); - let input = explode_cp(name).reverse(); - let eaten = []; - let tokens = []; - while (input.length) { - let emoji = consume_emoji_reversed(input, eaten); - if (emoji) { - tokens.push({ - type: TY_EMOJI, - emoji: emoji.slice(), // copy emoji - input: eaten, - cps: filter_fe0f(emoji) - }); - eaten = []; // reset buffer - } else { - let cp = input.pop(); - if (cp == STOP) { - tokens.push({type: TY_STOP, cp}); - } else if (VALID.has(cp)) { - tokens.push({type: TY_VALID, cps: [cp]}); - } else if (IGNORED.has(cp)) { - tokens.push({type: TY_IGNORED, cp}); - } else { - let cps = MAPPED.get(cp); - if (cps) { - tokens.push({type: TY_MAPPED, cp, cps: cps.slice()}); - } else { - tokens.push({type: TY_DISALLOWED, cp}); - } - } - } - } - if (nf) { - for (let i = 0, start = -1; i < tokens.length; i++) { - let token = tokens[i]; - if (is_valid_or_mapped(token.type)) { - if (requires_check(token.cps)) { // normalization might be needed - let end = i + 1; - for (let pos = end; pos < tokens.length; pos++) { // find adjacent text - let {type, cps} = tokens[pos]; - if (is_valid_or_mapped(type)) { - if (!requires_check(cps)) break; - end = pos + 1; - } else if (type !== TY_IGNORED) { // || type !== TY_DISALLOWED) { - break; - } - } - if (start < 0) start = i; - let slice = tokens.slice(start, end); - let cps0 = slice.flatMap(x => is_valid_or_mapped(x.type) ? x.cps : []); // strip junk tokens - let cps = nfc(cps0); - if (compare_arrays(cps, cps0)) { // bundle into an nfc token - tokens.splice(start, end - start, { - type: TY_NFC, - input: cps0, // there are 3 states: tokens0 ==(process)=> input ==(nfc)=> tokens/cps - cps, - tokens0: collapse_valid_tokens(slice), - tokens: ens_tokenize(str_from_cps(cps), {nf: false}) - }); - i = start; - } else { - i = end - 1; // skip to end of slice - } - start = -1; // reset - } else { - start = i; // remember last - } - } else if (token.type !== TY_IGNORED) { // 20221024: is this correct? - start = -1; // reset - } - } - } - return collapse_valid_tokens(tokens); -} - -function is_valid_or_mapped(type) { - return type == TY_VALID || type == TY_MAPPED; -} - -function requires_check(cps) { - return cps.some(cp => NFC_CHECK.has(cp)); -} - -function collapse_valid_tokens(tokens) { - for (let i = 0; i < tokens.length; i++) { - if (tokens[i].type == TY_VALID) { - let j = i + 1; - while (j < tokens.length && tokens[j].type == TY_VALID) j++; - tokens.splice(i, j - i, {type: TY_VALID, cps: tokens.slice(i, j).flatMap(x => x.cps)}); - } - } - return tokens; -} - -export { ens_beautify, ens_emoji, ens_normalize, ens_normalize_fragment, ens_split, ens_tokenize, is_combining_mark, nfc, nfd, safe_str_from_cps, should_escape }; diff --git a/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/dist/nf.min.js b/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/dist/nf.min.js deleted file mode 100644 index b8151fa8..00000000 --- a/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/dist/nf.min.js +++ /dev/null @@ -1 +0,0 @@ -var A="AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMn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dC8bP6FGDbE/VV0mX4IakzbdS/op+Kt3G24/8QbBV7y86sGSQ/vZzU8FXs7u6jIvwchsEP2BpIhW3G8uWNwa3HmjfH/ZjhhCWvluAcF+nMf14ClKg5hGgtPLJ98ueNAkc5Hs2WZlk2QHvfreCK1CCGO6nMZVSb99VM/ajr8WHTte9JSmkXq/i/U943HEbdzW6Re/S88dKgg8pGOLlAeNiqrcLkUR3/aClFpMXcOUP3rmETcWSfMXZE3TUOi8i+fqRnTYLflVx/Vb/6GJ7eIRZUA6k3RYR3iFSK9c4iDdNwJuZL2FKz/IK5VimcNWEqdXjSoxSgmF0UPlDoUlNrPcM7ftmA8Y9gKiqKEHuWN+AZRIwtVSxye2Kf8rM3lhJ5XcBXU9n4v0Oy1RU2M+4qM8AQPVwse8ErNSob5oFPWxuqZnVzo1qB/IBxkM3EVUKFUUlO3e51259GgNcJbCmlvrdjtoTW7rChm1wyCKzpCTwozUUEOIcWLneRLgMXh+SjGSFkAllzbGS5HK7LlfCMRNRDSvbQPjcXaenNYxCvu2Qyznz6StuxVj66SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g";function e(A){return 1&A?~A>>1:A>>1}function t(A,t){let C=Array(A);for(let l=0,n=0;l[]));for(let n=0;nl[e].push(A)));return l}function B(A,e){let t=1+e(),C=e(),B=l(e);return n(B.length,1+A,e).flatMap(((A,e)=>{let[l,...n]=A;return Array(B[e]).fill().map(((A,e)=>{let B=e*C;return[l+e*t,n.map((A=>A+B))]}))}))}function Q(A,e){return n(1+e(),1+A,e).map((A=>[A[0],A.slice(1)]))}const r=44032,w=4352,E=4449,c=4519,o=28,f=21*o,u=r+19*f,g=w+19,M=E+21,s=c+o;function N(A){return A>>24&255}function i(A){return 16777215&A}let D,U,p,I;function a(){let e=function(A){let e=0;return()=>A[e++]}(function(A){let e=0;function t(){return A[e++]<<8|A[e++]}let C=t(),l=1,n=[0,1];for(let A=1;A>--r&1}const c=2**31,o=c>>>1,f=c-1;let u=0;for(let A=0;A<31;A++)u=u<<1|E();let g=[],M=0,s=c;for(;;){let A=Math.floor(((u-M+1)*l-1)/s),e=0,t=C;for(;t-e>1;){let C=e+t>>>1;A>>1|E(),B=B<<1^o,Q=(Q^o)<<1|o|1;M=B,s=1+Q-B}let N=C-4;return g.map((e=>{switch(e-N){case 3:return N+65792+(A[Q++]<<16|A[Q++]<<8|A[Q++]);case 2:return N+256+(A[Q++]<<8|A[Q++]);case 1:return N+A[Q++];default:return e-1}}))}(function(A){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach(((A,t)=>e[A.charCodeAt(0)]=t));let t=A.length,C=new Uint8Array(6*t>>3);for(let l=0,n=0,B=0,Q=0;l=8&&(C[n++]=Q>>(B-=8));return C}(A)));var t;D=new Map((t=e,l((()=>{let A=C(t);if(A.length)return A}))).flatMap(((A,e)=>A.map((A=>[A,e+1<<24]))))),U=new Set(C(e)),p=new Map,I=new Map;for(let[A,t]of function(A){let e=[];for(;;){let t=A();if(0==t)break;e.push(B(t,A))}for(;;){let t=A()-1;if(t<0)break;e.push(Q(t,A))}return e.flat()}(e)){if(!U.has(A)&&2==t.length){let[e,C]=t,l=I.get(e);l||(l=new Map,I.set(e,l)),l.set(C,A)}p.set(A,t.reverse())}}function h(A){return A>=r&&A=w&&A=E&&ec&&e0&&l(c+t)}else{let A=p.get(C);A?t.push(...A):l(C)}if(!t.length)break;C=t.pop()}if(C&&e.length>1){let A=N(e[0]);for(let t=1;t0&&l>=A)0==A?(e.push(C,...t),t.length=0,C=B):t.push(B),l=A;else{let n=L(C,B);n>=0?C=n:0==l&&0==A?(e.push(C),C=B):(t.push(B),l=A)}}return C>=0&&e.push(C,...t),e}(S(A))}export{R as nfc,J as nfd}; diff --git a/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/package.json b/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/package.json deleted file mode 100644 index c865a004..00000000 --- a/tools/mnemonic-test/node_modules/@adraffy/ens-normalize/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "name": "@adraffy/ens-normalize", - "version": "1.10.1", - "description": "Ethereum Name Service (ENS) Name Normalizer", - "keywords": [ - "ENS", - "ENSIP-1", - "ENSIP-15", - "Ethereum", - "UTS-46", - "UTS-51", - "IDNA", - "Name", - "Normalize", - "Normalization", - "NFC", - "NFD" - ], - "exports": { - ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "default": "./dist/index.cjs" - }, - "./xnf": { - "types": "./dist/index.d.ts", - "import": "./dist/index-xnf.mjs", - "default": "./dist/index-xnf.cjs" - } - }, - "types": "./dist/index.d.ts", - "typesVersions": { - "*": { - "*": [ - "./dist/index.d.ts" - ] - } - }, - "main": "./dist/index.cjs", - "module": "./dist/index.mjs", - "files": [ - "./dist" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/adraffy/ens-normalize.js.git" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/adraffy/ens-normalize.js/issues" - }, - "homepage": "https://github.com/adraffy/ens-normalize.js#readme", - "author": { - "name": "raffy.eth", - "email": "raffy@me.com", - "url": "http://raffy.antistupid.com" - }, - "scripts": { - "unicode": "node derive/download.js", - "labels": "node validate/download-labels.js", - "derive": "node derive/make.js", - "make": "node src/make.js", - "validate": "node validate/make.js", - "test": "node test/coder.js && node test/nf.js && node test/validate.js && node test/init.js", - "build": "rollup -c", - "rebuild": "npm run derive && npm run make && npm run validate && npm run test && npm run build", - "order": "node validate/dump-group-order.js save && npm run rebuild", - "pack": "node ./src/prepost.js pack", - "pub": "node ./src/prepost.js publish" - }, - "devDependencies": { - "@rollup/plugin-alias": "^5.0.0", - "@rollup/plugin-terser": "^0.4.0", - "rollup": "^3.24.1" - } -} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/README.md b/tools/mnemonic-test/node_modules/@cosmjs/crypto/README.md deleted file mode 100644 index 288e7fce..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# @cosmjs/crypto - -![typescript](https://img.shields.io/npm/types/@cosmjs/crypto.svg) -[![npm version](https://img.shields.io/npm/v/@cosmjs/crypto.svg)](https://www.npmjs.com/package/@cosmjs/crypto) -[![license](https://img.shields.io/npm/l/@cosmjs/crypto.svg)](https://github.com/cosmos/cosmjs/blob/v0.35.0/LICENSE) -![minimum node version](https://img.shields.io/node/v/@cosmjs/crypto.svg) -![minified size](https://img.shields.io/bundlephobia/min/@cosmjs/crypto.svg) -![monthly downloads](https://img.shields.io/npm/dm/@cosmjs/crypto.svg) - -This package contains low-level cryptographic functionality used in other -@cosmjs libraries. Little of it is implemented here, but mainly it is a curation -of external libraries along with correctness tests. We add type safety, some -more checks, and a simple API to these libraries. This can also be freely -imported outside of CosmJS based applications. - -## License - -This package is part of the cosmjs repository, licensed under the Apache License -2.0 (see [NOTICE](https://github.com/cosmos/cosmjs/blob/main/NOTICE) and -[LICENSE](https://github.com/cosmos/cosmjs/blob/main/LICENSE)). diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/bip39.d.ts b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/bip39.d.ts deleted file mode 100644 index 00538e6a..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/bip39.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -export declare class EnglishMnemonic { - static readonly wordlist: readonly string[]; - private readonly data; - constructor(mnemonic: string); - toString(): string; -} -export declare class Bip39 { - /** - * Encodes raw entropy of length 16, 20, 24, 28 or 32 bytes as an English mnemonic between 12 and 24 words. - * - * | Entropy | Words | - * |--------------------|-------| - * | 128 bit (16 bytes) | 12 | - * | 160 bit (20 bytes) | 15 | - * | 192 bit (24 bytes) | 18 | - * | 224 bit (28 bytes) | 21 | - * | 256 bit (32 bytes) | 24 | - * - * - * @see https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki#generating-the-mnemonic - * @param entropy The entropy to be encoded. This must be cryptographically secure. - */ - static encode(entropy: Uint8Array): EnglishMnemonic; - static decode(mnemonic: EnglishMnemonic): Uint8Array; - static mnemonicToSeed(mnemonic: EnglishMnemonic, password?: string): Promise; -} diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/bip39.js b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/bip39.js deleted file mode 100644 index d4aed9b5..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/bip39.js +++ /dev/null @@ -1,46 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Bip39 = exports.EnglishMnemonic = void 0; -const bip39_1 = require("@scure/bip39"); -const english_1 = require("@scure/bip39/wordlists/english"); -class EnglishMnemonic { - static wordlist = english_1.wordlist; - data; - constructor(mnemonic) { - // throws an error if mnemonic is invalid - const _ = (0, bip39_1.mnemonicToEntropy)(mnemonic, english_1.wordlist); - this.data = mnemonic; - } - toString() { - return this.data; - } -} -exports.EnglishMnemonic = EnglishMnemonic; -class Bip39 { - /** - * Encodes raw entropy of length 16, 20, 24, 28 or 32 bytes as an English mnemonic between 12 and 24 words. - * - * | Entropy | Words | - * |--------------------|-------| - * | 128 bit (16 bytes) | 12 | - * | 160 bit (20 bytes) | 15 | - * | 192 bit (24 bytes) | 18 | - * | 224 bit (28 bytes) | 21 | - * | 256 bit (32 bytes) | 24 | - * - * - * @see https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki#generating-the-mnemonic - * @param entropy The entropy to be encoded. This must be cryptographically secure. - */ - static encode(entropy) { - return new EnglishMnemonic((0, bip39_1.entropyToMnemonic)(entropy, english_1.wordlist)); - } - static decode(mnemonic) { - return (0, bip39_1.mnemonicToEntropy)(mnemonic.toString(), english_1.wordlist); - } - static async mnemonicToSeed(mnemonic, password) { - return await (0, bip39_1.mnemonicToSeed)(mnemonic.toString(), password); - } -} -exports.Bip39 = Bip39; -//# sourceMappingURL=bip39.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/bip39.js.map b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/bip39.js.map deleted file mode 100644 index d5b6e68d..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/bip39.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bip39.js","sourceRoot":"","sources":["../src/bip39.ts"],"names":[],"mappings":";;;AAAA,wCAAoF;AACpF,4DAA0D;AAE1D,MAAa,eAAe;IACnB,MAAM,CAAU,QAAQ,GAAsB,kBAAQ,CAAC;IAE7C,IAAI,CAAS;IAE9B,YAAmB,QAAgB;QACjC,yCAAyC;QACzC,MAAM,CAAC,GAAG,IAAA,yBAAiB,EAAC,QAAQ,EAAE,kBAAQ,CAAC,CAAC;QAEhD,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC;IACvB,CAAC;IAEM,QAAQ;QACb,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;;AAdH,0CAeC;AAED,MAAa,KAAK;IAChB;;;;;;;;;;;;;;OAcG;IACI,MAAM,CAAC,MAAM,CAAC,OAAmB;QACtC,OAAO,IAAI,eAAe,CAAC,IAAA,yBAAiB,EAAC,OAAO,EAAE,kBAAQ,CAAC,CAAC,CAAC;IACnE,CAAC;IAEM,MAAM,CAAC,MAAM,CAAC,QAAyB;QAC5C,OAAO,IAAA,yBAAiB,EAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,kBAAQ,CAAC,CAAC;IAC1D,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,QAAyB,EAAE,QAAiB;QAC7E,OAAO,MAAM,IAAA,sBAAc,EAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,QAAQ,CAAC,CAAC;IAC7D,CAAC;CACF;AA3BD,sBA2BC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/hash.d.ts b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/hash.d.ts deleted file mode 100644 index 00c136c6..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/hash.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface HashFunction { - readonly blockSize: number; - readonly update: (_: Uint8Array) => HashFunction; - readonly digest: () => Uint8Array; -} diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/hash.js b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/hash.js deleted file mode 100644 index 6032c199..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/hash.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=hash.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/hash.js.map b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/hash.js.map deleted file mode 100644 index 1159d990..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/hash.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hash.js","sourceRoot":"","sources":["../src/hash.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/hmac.d.ts b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/hmac.d.ts deleted file mode 100644 index 26210557..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/hmac.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { HashFunction } from "./hash"; -export declare class Hmac implements HashFunction { - readonly blockSize: number; - private readonly messageHasher; - private readonly oKeyPad; - private readonly iKeyPad; - private readonly hash; - constructor(hashFunctionConstructor: new () => H, originalKey: Uint8Array); - update(data: Uint8Array): this; - digest(): Uint8Array; -} diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/hmac.js b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/hmac.js deleted file mode 100644 index 3afbe7de..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/hmac.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Hmac = void 0; -class Hmac { - blockSize; - messageHasher; - oKeyPad; - iKeyPad; - hash; - constructor(hashFunctionConstructor, originalKey) { - // This implementation is based on https://en.wikipedia.org/wiki/HMAC#Implementation - // with the addition of incremental hashing support. Thus part of the algorithm - // is in the constructor and the rest in digest(). - const blockSize = new hashFunctionConstructor().blockSize; - this.hash = (data) => new hashFunctionConstructor().update(data).digest(); - let key = originalKey; - if (key.length > blockSize) { - key = this.hash(key); - } - if (key.length < blockSize) { - const zeroPadding = new Uint8Array(blockSize - key.length); - key = new Uint8Array([...key, ...zeroPadding]); - } - // eslint-disable-next-line no-bitwise - this.oKeyPad = key.map((keyByte) => keyByte ^ 0x5c); - // eslint-disable-next-line no-bitwise - this.iKeyPad = key.map((keyByte) => keyByte ^ 0x36); - this.messageHasher = new hashFunctionConstructor(); - this.blockSize = blockSize; - this.update(this.iKeyPad); - } - update(data) { - this.messageHasher.update(data); - return this; - } - digest() { - const innerHash = this.messageHasher.digest(); - return this.hash(new Uint8Array([...this.oKeyPad, ...innerHash])); - } -} -exports.Hmac = Hmac; -//# sourceMappingURL=hmac.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/hmac.js.map b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/hmac.js.map deleted file mode 100644 index 18793205..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/hmac.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hmac.js","sourceRoot":"","sources":["../src/hmac.ts"],"names":[],"mappings":";;;AAEA,MAAa,IAAI;IACC,SAAS,CAAS;IAEjB,aAAa,CAAI;IACjB,OAAO,CAAa;IACpB,OAAO,CAAa;IACpB,IAAI,CAAmC;IAExD,YAAmB,uBAAo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X,MAAM,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC;QAC9C,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;IACpE,CAAC;CACF;AA9CD,oBA8CC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/index.d.ts b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/index.d.ts deleted file mode 100644 index c6c4430e..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/index.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -export { Bip39, EnglishMnemonic } from "./bip39"; -export type { HashFunction } from "./hash"; -export { Hmac } from "./hmac"; -export { Keccak256, keccak256 } from "./keccak"; -export { type Argon2idOptions, Argon2id, Ed25519, Ed25519Keypair, isArgon2idOptions, xchacha20NonceLength, Xchacha20poly1305Ietf, } from "./libsodium"; -export { Random } from "./random"; -export { Ripemd160, ripemd160 } from "./ripemd"; -export { type Secp256k1Keypair, Secp256k1 } from "./secp256k1"; -export { ExtendedSecp256k1Signature, Secp256k1Signature } from "./secp256k1signature"; -export { Sha256, sha256, Sha512, sha512 } from "./sha"; -export type { HdPath, Slip10Result } from "./slip10"; -export { pathToString, Slip10, Slip10Curve, slip10CurveFromString, Slip10RawIndex, stringToPath, } from "./slip10"; diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/index.js b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/index.js deleted file mode 100644 index efe4954e..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/index.js +++ /dev/null @@ -1,41 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.stringToPath = exports.Slip10RawIndex = exports.slip10CurveFromString = exports.Slip10Curve = exports.Slip10 = exports.pathToString = exports.sha512 = exports.Sha512 = exports.sha256 = exports.Sha256 = exports.Secp256k1Signature = exports.ExtendedSecp256k1Signature = exports.Secp256k1 = exports.ripemd160 = exports.Ripemd160 = exports.Random = exports.Xchacha20poly1305Ietf = exports.xchacha20NonceLength = exports.isArgon2idOptions = exports.Ed25519Keypair = exports.Ed25519 = exports.Argon2id = exports.keccak256 = exports.Keccak256 = exports.Hmac = exports.EnglishMnemonic = exports.Bip39 = void 0; -var bip39_1 = require("./bip39"); -Object.defineProperty(exports, "Bip39", { enumerable: true, get: function () { return bip39_1.Bip39; } }); -Object.defineProperty(exports, "EnglishMnemonic", { enumerable: true, get: function () { return bip39_1.EnglishMnemonic; } }); -var hmac_1 = require("./hmac"); -Object.defineProperty(exports, "Hmac", { enumerable: true, get: function () { return hmac_1.Hmac; } }); -var keccak_1 = require("./keccak"); -Object.defineProperty(exports, "Keccak256", { enumerable: true, get: function () { return keccak_1.Keccak256; } }); -Object.defineProperty(exports, "keccak256", { enumerable: true, get: function () { return keccak_1.keccak256; } }); -var libsodium_1 = require("./libsodium"); -Object.defineProperty(exports, "Argon2id", { enumerable: true, get: function () { return libsodium_1.Argon2id; } }); -Object.defineProperty(exports, "Ed25519", { enumerable: true, get: function () { return libsodium_1.Ed25519; } }); -Object.defineProperty(exports, "Ed25519Keypair", { enumerable: true, get: function () { return libsodium_1.Ed25519Keypair; } }); -Object.defineProperty(exports, "isArgon2idOptions", { enumerable: true, get: function () { return libsodium_1.isArgon2idOptions; } }); -Object.defineProperty(exports, "xchacha20NonceLength", { enumerable: true, get: function () { return libsodium_1.xchacha20NonceLength; } }); -Object.defineProperty(exports, "Xchacha20poly1305Ietf", { enumerable: true, get: function () { return libsodium_1.Xchacha20poly1305Ietf; } }); -var random_1 = require("./random"); -Object.defineProperty(exports, "Random", { enumerable: true, get: function () { return random_1.Random; } }); -var ripemd_1 = require("./ripemd"); -Object.defineProperty(exports, "Ripemd160", { enumerable: true, get: function () { return ripemd_1.Ripemd160; } }); -Object.defineProperty(exports, "ripemd160", { enumerable: true, get: function () { return ripemd_1.ripemd160; } }); -var secp256k1_1 = require("./secp256k1"); -Object.defineProperty(exports, "Secp256k1", { enumerable: true, get: function () { return secp256k1_1.Secp256k1; } }); -var secp256k1signature_1 = require("./secp256k1signature"); -Object.defineProperty(exports, "ExtendedSecp256k1Signature", { enumerable: true, get: function () { return secp256k1signature_1.ExtendedSecp256k1Signature; } }); -Object.defineProperty(exports, "Secp256k1Signature", { enumerable: true, get: function () { return secp256k1signature_1.Secp256k1Signature; } }); -var sha_1 = require("./sha"); -Object.defineProperty(exports, "Sha256", { enumerable: true, get: function () { return sha_1.Sha256; } }); -Object.defineProperty(exports, "sha256", { enumerable: true, get: function () { return sha_1.sha256; } }); -Object.defineProperty(exports, "Sha512", { enumerable: true, get: function () { return sha_1.Sha512; } }); -Object.defineProperty(exports, "sha512", { enumerable: true, get: function () { return sha_1.sha512; } }); -var slip10_1 = require("./slip10"); -Object.defineProperty(exports, "pathToString", { enumerable: true, get: function () { return slip10_1.pathToString; } }); -Object.defineProperty(exports, "Slip10", { enumerable: true, get: function () { return slip10_1.Slip10; } }); -Object.defineProperty(exports, "Slip10Curve", { enumerable: true, get: function () { return slip10_1.Slip10Curve; } }); -Object.defineProperty(exports, "slip10CurveFromString", { enumerable: true, get: function () { return slip10_1.slip10CurveFromString; } }); -Object.defineProperty(exports, "Slip10RawIndex", { enumerable: true, get: function () { return slip10_1.Slip10RawIndex; } }); -Object.defineProperty(exports, "stringToPath", { enumerable: true, get: function () { return slip10_1.stringToPath; } }); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/index.js.map b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/index.js.map deleted file mode 100644 index 465826a9..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,iCAAiD;AAAxC,8FAAA,KAAK,OAAA;AAAE,wGAAA,eAAe,OAAA;AAE/B,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,mCAAgD;AAAvC,mGAAA,SAAS,OAAA;AAAE,mGAAA,SAAS,OAAA;AAC7B,yCAQqB;AANnB,qGAAA,QAAQ,OAAA;AACR,oGAAA,OAAO,OAAA;AACP,2GAAA,cAAc,OAAA;AACd,8GAAA,iBAAiB,OAAA;AACjB,iHAAA,oBAAoB,OAAA;AACpB,kHAAA,qBAAqB,OAAA;AAEvB,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,mCAAgD;AAAvC,mGAAA,SAAS,OAAA;AAAE,mGAAA,SAAS,OAAA;AAC7B,yCAA+D;AAA/B,sGAAA,SAAS,OAAA;AACzC,2DAAsF;AAA7E,gIAAA,0BAA0B,OAAA;AAAE,wHAAA,kBAAkB,OAAA;AACvD,6BAAuD;AAA9C,6FAAA,MAAM,OAAA;AAAE,6FAAA,MAAM,OAAA;AAAE,6FAAA,MAAM,OAAA;AAAE,6FAAA,MAAM,OAAA;AAEvC,mCAOkB;AANhB,sGAAA,YAAY,OAAA;AACZ,gGAAA,MAAM,OAAA;AACN,qGAAA,WAAW,OAAA;AACX,+GAAA,qBAAqB,OAAA;AACrB,wGAAA,cAAc,OAAA;AACd,sGAAA,YAAY,OAAA"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/keccak.d.ts b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/keccak.d.ts deleted file mode 100644 index 7b749e1f..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/keccak.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { HashFunction } from "./hash"; -export declare class Keccak256 implements HashFunction { - readonly blockSize: number; - private readonly impl; - constructor(firstData?: Uint8Array); - update(data: Uint8Array): this; - digest(): Uint8Array; -} -/** Convenience function equivalent to `new Keccak256(data).digest()` */ -export declare function keccak256(data: Uint8Array): Uint8Array; diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/keccak.js b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/keccak.js deleted file mode 100644 index c72cf5ad..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/keccak.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Keccak256 = void 0; -exports.keccak256 = keccak256; -const sha3_js_1 = require("@noble/hashes/sha3.js"); -const utils_1 = require("./utils"); -class Keccak256 { - blockSize = 512 / 8; - impl = sha3_js_1.keccak_256.create(); - constructor(firstData) { - if (firstData) { - this.update(firstData); - } - } - update(data) { - this.impl.update((0, utils_1.toRealUint8Array)(data)); - return this; - } - digest() { - return this.impl.digest(); - } -} -exports.Keccak256 = Keccak256; -/** Convenience function equivalent to `new Keccak256(data).digest()` */ -function keccak256(data) { - return new Keccak256(data).digest(); -} -//# sourceMappingURL=keccak.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/keccak.js.map b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/keccak.js.map deleted file mode 100644 index f4a77755..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/keccak.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"keccak.js","sourceRoot":"","sources":["../src/keccak.ts"],"names":[],"mappings":";;;AA2BA,8BAEC;AA7BD,mDAAmD;AAGnD,mCAA2C;AAE3C,MAAa,SAAS;IACJ,SAAS,GAAG,GAAG,GAAG,CAAC,CAAC;IAEnB,IAAI,GAAG,oBAAU,CAAC,MAAM,EAAE,CAAC;IAE5C,YAAmB,SAAsB;QACvC,IAAI,SAAS,EAAE,CAAC;YACd,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACzB,CAAC;IACH,CAAC;IAEM,MAAM,CAAC,IAAgB;QAC5B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAA,wBAAgB,EAAC,IAAI,CAAC,CAAC,CAAC;QACzC,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,MAAM;QACX,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IAC5B,CAAC;CACF;AAnBD,8BAmBC;AAED,wEAAwE;AACxE,SAAgB,SAAS,CAAC,IAAgB;IACxC,OAAO,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;AACtC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/libsodium.d.ts b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/libsodium.d.ts deleted file mode 100644 index f3f1b505..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/libsodium.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -export interface Argon2idOptions { - /** Output length in bytes */ - readonly outputLength: number; - /** - * An integer between 1 and 4294967295 representing the computational difficulty. - * - * @see https://libsodium.gitbook.io/doc/password_hashing/default_phf#key-derivation - */ - readonly opsLimit: number; - /** - * Memory limit measured in KiB (like argon2 command line tool) - * - * Note: only approximately 16 MiB of memory are available using the non-sumo version of libsodium.js - * - * @see https://libsodium.gitbook.io/doc/password_hashing/default_phf#key-derivation - */ - readonly memLimitKib: number; -} -export declare function isArgon2idOptions(thing: unknown): thing is Argon2idOptions; -export declare class Argon2id { - static execute(password: string, salt: Uint8Array, options: Argon2idOptions): Promise; -} -export declare class Ed25519Keypair { - static fromLibsodiumPrivkey(libsodiumPrivkey: Uint8Array): Ed25519Keypair; - readonly privkey: Uint8Array; - readonly pubkey: Uint8Array; - constructor(privkey: Uint8Array, pubkey: Uint8Array); - toLibsodiumPrivkey(): Uint8Array; -} -export declare class Ed25519 { - /** - * Generates a keypair deterministically from a given 32 bytes seed. - * - * This seed equals the Ed25519 private key. - * For implementation details see crypto_sign_seed_keypair in - * https://download.libsodium.org/doc/public-key_cryptography/public-key_signatures.html - * and diagram on https://blog.mozilla.org/warner/2011/11/29/ed25519-keys/ - */ - static makeKeypair(privKey: Uint8Array): Promise; - static createSignature(message: Uint8Array, keyPair: Ed25519Keypair): Promise; - static verifySignature(signature: Uint8Array, message: Uint8Array, pubkey: Uint8Array): Promise; -} -/** - * Nonce length in bytes for all flavours of XChaCha20. - * - * @see https://libsodium.gitbook.io/doc/advanced/stream_ciphers/xchacha20#notes - */ -export declare const xchacha20NonceLength = 24; -export declare class Xchacha20poly1305Ietf { - static encrypt(message: Uint8Array, key: Uint8Array, nonce: Uint8Array): Promise; - static decrypt(ciphertext: Uint8Array, key: Uint8Array, nonce: Uint8Array): Promise; -} diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/libsodium.js b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/libsodium.js deleted file mode 100644 index ebcb407f..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/libsodium.js +++ /dev/null @@ -1,100 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Xchacha20poly1305Ietf = exports.xchacha20NonceLength = exports.Ed25519 = exports.Ed25519Keypair = exports.Argon2id = void 0; -exports.isArgon2idOptions = isArgon2idOptions; -const utils_1 = require("@cosmjs/utils"); -const chacha_js_1 = require("@noble/ciphers/chacha.js"); -const ed25519_js_1 = require("@noble/curves/ed25519.js"); -const hash_wasm_1 = require("hash-wasm"); -function isArgon2idOptions(thing) { - if (!(0, utils_1.isNonNullObject)(thing)) - return false; - if (typeof thing.outputLength !== "number") - return false; - if (typeof thing.opsLimit !== "number") - return false; - if (typeof thing.memLimitKib !== "number") - return false; - return true; -} -class Argon2id { - static async execute(password, salt, options) { - const opts = { - password, - salt, - outputType: "binary", - iterations: options.opsLimit, - memorySize: options.memLimitKib, - parallelism: 1, // no parallelism allowed, just like libsodium - hashLength: options.outputLength, - }; - if (salt.length !== 16) { - throw new Error(`Got invalid salt length ${salt.length}. Must be 16.`); - } - const hash = await (0, hash_wasm_1.argon2id)(opts); - // guaranteed by outputType: 'binary' - (0, utils_1.assert)(typeof hash !== "string"); - return hash; - } -} -exports.Argon2id = Argon2id; -class Ed25519Keypair { - // a libsodium privkey has the format ` + ` - static fromLibsodiumPrivkey(libsodiumPrivkey) { - if (libsodiumPrivkey.length !== 64) { - throw new Error(`Unexpected key length ${libsodiumPrivkey.length}. Must be 64.`); - } - return new Ed25519Keypair(libsodiumPrivkey.slice(0, 32), libsodiumPrivkey.slice(32, 64)); - } - privkey; - pubkey; - constructor(privkey, pubkey) { - this.privkey = privkey; - this.pubkey = pubkey; - } - toLibsodiumPrivkey() { - return new Uint8Array([...this.privkey, ...this.pubkey]); - } -} -exports.Ed25519Keypair = Ed25519Keypair; -class Ed25519 { - /** - * Generates a keypair deterministically from a given 32 bytes seed. - * - * This seed equals the Ed25519 private key. - * For implementation details see crypto_sign_seed_keypair in - * https://download.libsodium.org/doc/public-key_cryptography/public-key_signatures.html - * and diagram on https://blog.mozilla.org/warner/2011/11/29/ed25519-keys/ - */ - static async makeKeypair(privKey) { - const pubKey = ed25519_js_1.ed25519.getPublicKey(privKey); - return new Ed25519Keypair(privKey, pubKey); - } - static async createSignature(message, keyPair) { - return ed25519_js_1.ed25519.sign(message, keyPair.privkey); - } - static async verifySignature(signature, message, pubkey) { - return ed25519_js_1.ed25519.verify(signature, message, pubkey); - } -} -exports.Ed25519 = Ed25519; -/** - * Nonce length in bytes for all flavours of XChaCha20. - * - * @see https://libsodium.gitbook.io/doc/advanced/stream_ciphers/xchacha20#notes - */ -exports.xchacha20NonceLength = 24; -class Xchacha20poly1305Ietf { - static async encrypt(message, key, nonce) { - const additionalAuthenticatedData = undefined; - const cipher = (0, chacha_js_1.xchacha20poly1305)(key, nonce, additionalAuthenticatedData); - return cipher.encrypt(message); - } - static async decrypt(ciphertext, key, nonce) { - const additionalAuthenticatedData = undefined; - const cipher = (0, chacha_js_1.xchacha20poly1305)(key, nonce, additionalAuthenticatedData); - return cipher.decrypt(ciphertext); - } -} -exports.Xchacha20poly1305Ietf = Xchacha20poly1305Ietf; -//# sourceMappingURL=libsodium.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/libsodium.js.map b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/libsodium.js.map deleted file mode 100644 index e6050cf7..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/libsodium.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"libsodium.js","sourceRoot":"","sources":["../src/libsodium.ts"],"names":[],"mappings":";;;AAwBA,8CAMC;AA9BD,yCAAwD;AACxD,wDAA6D;AAC7D,yDAAmD;AACnD,yCAA0D;AAqB1D,SAAgB,iBAAiB,CAAC,KAAc;IAC9C,IAAI,CAAC,IAAA,uBAAe,EAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAC1C,IAAI,OAAQ,KAAyB,CAAC,YAAY,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC9E,IAAI,OAAQ,KAAyB,CAAC,QAAQ,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC1E,IAAI,OAAQ,KAAyB,CAAC,WAAW,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC7E,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAa,QAAQ;IACZ,MAAM,CAAC,KAAK,CAAC,OAAO,CACzB,QAAgB,EAChB,IAAgB,EAChB,OAAwB;QAExB,MAAM,IAAI,GAAmB;YAC3B,QAAQ;YACR,IAAI;YACJ,UAAU,EAAE,QAAQ;YACpB,UAAU,EAAE,OAAO,CAAC,QAAQ;YAC5B,UAAU,EAAE,OAAO,CAAC,WAAW;YAC/B,WAAW,EAAE,CAAC,EAAE,8CAA8C;YAC9D,UAAU,EAAE,OAAO,CAAC,YAAY;SACjC,CAAC;QAEF,IAAI,IAAI,CAAC,MAAM,KAAK,EAAE,EAAE,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,2BAA2B,IAAI,CAAC,MAAM,eAAe,CAAC,CAAC;QACzE,CAAC;QAED,M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E,OAAO,CAAC,OAAO,CAAC,CAAC;IAChD,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,eAAe,CACjC,SAAqB,EACrB,OAAmB,EACnB,MAAkB;QAElB,OAAO,oBAAO,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACpD,CAAC;CACF;AAzBD,0BAyBC;AAED;;;;GAIG;AACU,QAAA,oBAAoB,GAAG,EAAE,CAAC;AAEvC,MAAa,qBAAqB;IACzB,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,OAAmB,EAAE,GAAe,EAAE,KAAiB;QACjF,MAAM,2BAA2B,GAAG,SAAS,CAAC;QAE9C,MAAM,MAAM,GAAG,IAAA,6BAAiB,EAAC,GAAG,EAAE,KAAK,EAAE,2BAA2B,CAAC,CAAC;QAE1E,OAAO,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACjC,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,OAAO,CACzB,UAAsB,EACtB,GAAe,EACf,KAAiB;QAEjB,MAAM,2BAA2B,GAAG,SAAS,CAAC;QAE9C,MAAM,MAAM,GAAG,IAAA,6BAAiB,EAAC,GAAG,EAAE,KAAK,EAAE,2BAA2B,CAAC,CAAC;QAE1E,OAAO,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACpC,CAAC;CACF;AApBD,sDAoBC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/pbkdf2.d.ts b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/pbkdf2.d.ts deleted file mode 100644 index 73156bb6..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/pbkdf2.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Returns the SubtleCrypto API for this environment if present. - * - * Right now (CosmJS 0.35), all supported environments we are aware of have - * SubtleCrypto. However, we keep the optional return type just in case as we can - * use the pure-JS fallback. - */ -export declare function getSubtle(): Promise; -export declare function pbkdf2Sha512Subtle(subtle: typeof crypto.subtle, secret: Uint8Array, salt: Uint8Array, iterations: number, keylen: number): Promise; -export declare function pbkdf2Sha512Noble(secret: Uint8Array, salt: Uint8Array, iterations: number, keylen: number): Promise; -/** - * A pbkdf2 implementation for BIP39. This is not exported at package level and thus a private API. - */ -export declare function pbkdf2Sha512(secret: Uint8Array, salt: Uint8Array, iterations: number, keylen: number): Promise; diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/pbkdf2.js b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/pbkdf2.js deleted file mode 100644 index 98bf5614..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/pbkdf2.js +++ /dev/null @@ -1,55 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getSubtle = getSubtle; -exports.pbkdf2Sha512Subtle = pbkdf2Sha512Subtle; -exports.pbkdf2Sha512Noble = pbkdf2Sha512Noble; -exports.pbkdf2Sha512 = pbkdf2Sha512; -const utils_1 = require("@cosmjs/utils"); -const pbkdf2_js_1 = require("@noble/hashes/pbkdf2.js"); -const sha2_js_1 = require("@noble/hashes/sha2.js"); -/** - * Returns the SubtleCrypto API for this environment if present. - * - * Right now (CosmJS 0.35), all supported environments we are aware of have - * SubtleCrypto. However, we keep the optional return type just in case as we can - * use the pure-JS fallback. - */ -async function getSubtle() { - // From Node.js 15 onwards, webcrypto is available in globalThis. - // In version 15 and 16 this was stored under the webcrypto key. - // With Node.js 17 it was moved to the same locations where browsers - // make it available. - // Loading `require("crypto")` here seems unnecessary since it only - // causes issues with bundlers and does not increase compatibility. - return globalThis?.crypto?.subtle; -} -async function pbkdf2Sha512Subtle(subtle, secret, salt, iterations, keylen) { - (0, utils_1.assert)(subtle, "Argument subtle is falsy"); - (0, utils_1.assert)(typeof subtle === "object", "Argument subtle is not of type object"); - (0, utils_1.assert)(typeof subtle.importKey === "function", "subtle.importKey is not a function"); - (0, utils_1.assert)(typeof subtle.deriveBits === "function", "subtle.deriveBits is not a function"); - return subtle.importKey("raw", secret, { name: "PBKDF2" }, false, ["deriveBits"]).then((key) => subtle - .deriveBits({ - name: "PBKDF2", - salt: salt, - iterations: iterations, - hash: { name: "SHA-512" }, - }, key, keylen * 8) - .then((buffer) => new Uint8Array(buffer))); -} -async function pbkdf2Sha512Noble(secret, salt, iterations, keylen) { - return (0, pbkdf2_js_1.pbkdf2Async)(sha2_js_1.sha512, secret, salt, { c: iterations, dkLen: keylen }); -} -/** - * A pbkdf2 implementation for BIP39. This is not exported at package level and thus a private API. - */ -async function pbkdf2Sha512(secret, salt, iterations, keylen) { - const subtle = await getSubtle(); - if (subtle) { - return pbkdf2Sha512Subtle(subtle, secret, salt, iterations, keylen); - } - else { - return pbkdf2Sha512Noble(secret, salt, iterations, keylen); - } -} -//# sourceMappingURL=pbkdf2.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/pbkdf2.js.map b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/pbkdf2.js.map deleted file mode 100644 index cd31f6b0..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/pbkdf2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pbkdf2.js","sourceRoot":"","sources":["../src/pbkdf2.ts"],"names":[],"mappings":";;AAWA,8BAQC;AAED,gDA0BC;AAED,8CAOC;AAKD,oCAYC;AAzED,yCAAuC;AACvC,uDAA0E;AAC1E,mDAA8D;AAE9D;;;;;;GAMG;AACI,KAAK,UAAU,SAAS;IAC7B,iEAAiE;IACjE,gEAAgE;IAChE,oEAAoE;IACpE,qBAAqB;IACrB,mEAAmE;IACnE,mEAAmE;IACnE,OAAQ,UAAkB,EAAE,MAAM,EAAE,MAAM,CAAC;AAC7C,CAAC;AAEM,KAAK,UAAU,kBAAkB,CACtC,MAA4B,EAC5B,MAAkB,EAClB,IAAgB,EAChB,UAAkB,EAClB,MAAc;IAEd,IAAA,cAAM,EAAC,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CAAC,CAAC;IACtE,CAAC;SAAM,CAAC;QACN,OAAO,iBAAiB,CAAC,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;IAC7D,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/random.d.ts b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/random.d.ts deleted file mode 100644 index 71ac08a7..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/random.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare class Random { - /** - * Returns `count` cryptographically secure random bytes - */ - static getBytes(count: number): Uint8Array; -} diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/random.js b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/random.js deleted file mode 100644 index dcd9553e..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/random.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Random = void 0; -class Random { - /** - * Returns `count` cryptographically secure random bytes - */ - static getBytes(count) { - const out = new Uint8Array(count); - globalThis.crypto.getRandomValues(out); - return out; - } -} -exports.Random = Random; -//# sourceMappingURL=random.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/random.js.map b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/random.js.map deleted file mode 100644 index f25b8b83..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/random.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"random.js","sourceRoot":"","sources":["../src/random.ts"],"names":[],"mappings":";;;AAAA,MAAa,MAAM;IACjB;;OAEG;IACI,MAAM,CAAC,QAAQ,CAAC,KAAa;QAClC,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC;QAClC,UAAU,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;QACvC,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AATD,wBASC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/ripemd.d.ts b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/ripemd.d.ts deleted file mode 100644 index 45364557..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/ripemd.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { HashFunction } from "./hash"; -export declare class Ripemd160 implements HashFunction { - readonly blockSize: number; - private readonly impl; - constructor(firstData?: Uint8Array); - update(data: Uint8Array): this; - digest(): Uint8Array; -} -/** Convenience function equivalent to `new Ripemd160(data).digest()` */ -export declare function ripemd160(data: Uint8Array): Uint8Array; diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/ripemd.js b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/ripemd.js deleted file mode 100644 index 0d4a1d82..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/ripemd.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Ripemd160 = void 0; -exports.ripemd160 = ripemd160; -const legacy_js_1 = require("@noble/hashes/legacy.js"); -const utils_1 = require("./utils"); -class Ripemd160 { - blockSize = 512 / 8; - impl = legacy_js_1.ripemd160.create(); - constructor(firstData) { - if (firstData) { - this.update(firstData); - } - } - update(data) { - this.impl.update((0, utils_1.toRealUint8Array)(data)); - return this; - } - digest() { - return this.impl.digest(); - } -} -exports.Ripemd160 = Ripemd160; -/** Convenience function equivalent to `new Ripemd160(data).digest()` */ -function ripemd160(data) { - return new Ripemd160(data).digest(); -} -//# sourceMappingURL=ripemd.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/ripemd.js.map b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/ripemd.js.map deleted file mode 100644 index 45e84556..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/ripemd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ripemd.js","sourceRoot":"","sources":["../src/ripemd.ts"],"names":[],"mappings":";;;AA2BA,8BAEC;AA7BD,uDAAsE;AAGtE,mCAA2C;AAE3C,MAAa,SAAS;IACJ,SAAS,GAAG,GAAG,GAAG,CAAC,CAAC;IAEnB,IAAI,GAAG,qBAAc,CAAC,MAAM,EAAE,CAAC;IAEhD,YAAmB,SAAsB;QACvC,IAAI,SAAS,EAAE,CAAC;YACd,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACzB,CAAC;IACH,CAAC;IAEM,MAAM,CAAC,IAAgB;QAC5B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAA,wBAAgB,EAAC,IAAI,CAAC,CAAC,CAAC;QACzC,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,MAAM;QACX,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IAC5B,CAAC;CACF;AAnBD,8BAmBC;AAED,wEAAwE;AACxE,SAAgB,SAAS,CAAC,IAAgB;IACxC,OAAO,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;AACtC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/secp256k1.d.ts b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/secp256k1.d.ts deleted file mode 100644 index a86f5196..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/secp256k1.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { ExtendedSecp256k1Signature, Secp256k1Signature } from "./secp256k1signature"; -export interface Secp256k1Keypair { - /** A 32 byte private key */ - readonly pubkey: Uint8Array; - /** - * A raw secp256k1 public key. - * - * The type itself does not give you any guarantee if this is - * compressed or uncompressed. If you are unsure where the data - * is coming from, use `Secp256k1.compressPubkey` or - * `Secp256k1.uncompressPubkey` (both idempotent) before processing it. - */ - readonly privkey: Uint8Array; -} -export declare class Secp256k1 { - /** - * Takes a 32 byte private key and returns a privkey/pubkey pair. - * - * The resulting pubkey is uncompressed. For the use in Cosmos it should - * be compressed first using `Secp256k1.compressPubkey`. - */ - static makeKeypair(privkey: Uint8Array): Promise; - /** - * Creates a signature that is - * - deterministic (RFC 6979) - * - lowS signature - * - DER encoded - */ - static createSignature(messageHash: Uint8Array, privkey: Uint8Array): Promise; - static verifySignature(signature: Secp256k1Signature, messageHash: Uint8Array, pubkey: Uint8Array): Promise; - static recoverPubkey(signature: ExtendedSecp256k1Signature, messageHash: Uint8Array): Uint8Array; - /** - * Takes a compressed or uncompressed pubkey and return a compressed one. - * - * This function is idempotent. - */ - static compressPubkey(pubkey: Uint8Array): Uint8Array; - /** - * Takes a compressed or uncompressed pubkey and returns an uncompressed one. - * - * This function is idempotent. - */ - static uncompressPubkey(pubkey: Uint8Array): Uint8Array; - static trimRecoveryByte(signature: Uint8Array): Uint8Array; -} diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/secp256k1.js b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/secp256k1.js deleted file mode 100644 index e5b7df8d..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/secp256k1.js +++ /dev/null @@ -1,119 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Secp256k1 = void 0; -const encoding_1 = require("@cosmjs/encoding"); -const utils_1 = require("@cosmjs/utils"); -const secp256k1_1 = require("@noble/curves/secp256k1"); -const secp256k1signature_1 = require("./secp256k1signature"); -function unsignedBigIntToBytes(a) { - (0, utils_1.assert)(a >= 0n); - let hex = a.toString(16); - if (hex.length % 2) - hex = "0" + hex; - return (0, encoding_1.fromHex)(hex); -} -function bytesToUnsignedBigInt(a) { - return BigInt("0x" + (0, encoding_1.toHex)(a)); -} -class Secp256k1 { - /** - * Takes a 32 byte private key and returns a privkey/pubkey pair. - * - * The resulting pubkey is uncompressed. For the use in Cosmos it should - * be compressed first using `Secp256k1.compressPubkey`. - */ - static async makeKeypair(privkey) { - if (privkey.length !== 32) { - throw new Error("input data is not a valid secp256k1 private key"); - } - if (!secp256k1_1.secp256k1.utils.isValidPrivateKey(privkey)) { - // not strictly smaller than N - throw new Error("input data is not a valid secp256k1 private key"); - } - const out = { - privkey: privkey, - // encodes uncompressed as - // - 1-byte prefix "04" - // - 32-byte x coordinate - // - 32-byte y coordinate - pubkey: secp256k1_1.secp256k1.getPublicKey(privkey, false), - }; - return out; - } - /** - * Creates a signature that is - * - deterministic (RFC 6979) - * - lowS signature - * - DER encoded - */ - static async createSignature(messageHash, privkey) { - if (messageHash.length === 0) { - throw new Error("Message hash must not be empty"); - } - if (messageHash.length > 32) { - throw new Error("Message hash length must not exceed 32 bytes"); - } - const { recovery, r, s } = secp256k1_1.secp256k1.sign(messageHash, privkey, { - lowS: true, - }); - if (typeof recovery !== "number") - throw new Error("Recovery param missing"); - return new secp256k1signature_1.ExtendedSecp256k1Signature(unsignedBigIntToBytes(r), unsignedBigIntToBytes(s), recovery); - } - static async verifySignature(signature, messageHash, pubkey) { - if (messageHash.length === 0) { - throw new Error("Message hash must not be empty"); - } - if (messageHash.length > 32) { - throw new Error("Message hash length must not exceed 32 bytes"); - } - const encodedSig = secp256k1_1.secp256k1.Signature.fromDER(signature.toDer()); - return secp256k1_1.secp256k1.verify(encodedSig, messageHash, pubkey, { lowS: false }); - } - static recoverPubkey(signature, messageHash) { - const pk = new secp256k1_1.secp256k1.Signature(bytesToUnsignedBigInt(signature.r()), bytesToUnsignedBigInt(signature.s()), signature.recovery).recoverPublicKey(messageHash); - return pk.toBytes(false); - } - /** - * Takes a compressed or uncompressed pubkey and return a compressed one. - * - * This function is idempotent. - */ - static compressPubkey(pubkey) { - switch (pubkey.length) { - case 33: - return pubkey; - case 65: - return secp256k1_1.secp256k1.Point.fromBytes(pubkey).toBytes(true); - default: - throw new Error("Invalid pubkey length"); - } - } - /** - * Takes a compressed or uncompressed pubkey and returns an uncompressed one. - * - * This function is idempotent. - */ - static uncompressPubkey(pubkey) { - switch (pubkey.length) { - case 33: - return secp256k1_1.secp256k1.Point.fromBytes(pubkey).toBytes(false); - case 65: - return pubkey; - default: - throw new Error("Invalid pubkey length"); - } - } - static trimRecoveryByte(signature) { - switch (signature.length) { - case 64: - return signature; - case 65: - return signature.slice(0, 64); - default: - throw new Error("Invalid signature length"); - } - } -} -exports.Secp256k1 = Secp256k1; -//# sourceMappingURL=secp256k1.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/secp256k1.js.map b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/secp256k1.js.map deleted file mode 100644 index 710e5756..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/secp256k1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"secp256k1.js","sourceRoot":"","sources":["../src/secp256k1.ts"],"names":[],"mappings":";;;AAAA,+CAAkD;AAClD,yCAAuC;AACvC,uDAAoD;AAEpD,6DAAsF;AAgBtF,SAAS,qBAAqB,CAAC,CAAS;IACtC,IAAA,cAAM,EAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAChB,IAAI,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACzB,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC;QAAE,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IACpC,OAAO,IAAA,kBAAO,EAAC,GAAG,CAAC,CAAC;AACtB,CAAC;AAED,SAAS,qBAAqB,CAAC,CAAa;IAC1C,OAAO,MAAM,CAAC,IAAI,GAAG,IAAA,gBAAK,EAAC,CAAC,CAAC,CAAC,CAAC;AACjC,CAAC;AAED,MAAa,SAAS;IACpB;;;;;OAKG;IACI,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,OAAmB;QACjD,IAAI,OAAO,CAAC,MAAM,KAAK,EAAE,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CAAC,iDAAiD,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M,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAC1D,KAAK,EAAE;gBACL,OAAO,MAAM,CAAC;YAChB;gBACE,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC;IAEM,MAAM,CAAC,gBAAgB,CAAC,SAAqB;QAClD,QAAQ,SAAS,CAAC,MAAM,EAAE,CAAC;YACzB,KAAK,EAAE;gBACL,OAAO,SAAS,CAAC;YACnB,KAAK,EAAE;gBACL,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAChC;gBACE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;QAChD,CAAC;IACH,CAAC;CACF;AAvHD,8BAuHC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/secp256k1signature.d.ts b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/secp256k1signature.d.ts deleted file mode 100644 index 8d914b18..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/secp256k1signature.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -export declare class Secp256k1Signature { - /** - * Takes the pair of integers (r, s) as 2x32 byte of binary data. - * - * Note: This is the format Cosmos SDK uses natively. - * - * @param data a 64 byte value containing integers r and s. - */ - static fromFixedLength(data: Uint8Array): Secp256k1Signature; - static fromDer(data: Uint8Array): Secp256k1Signature; - private readonly data; - constructor(r: Uint8Array, s: Uint8Array); - r(length?: number): Uint8Array; - s(length?: number): Uint8Array; - toFixedLength(): Uint8Array; - toDer(): Uint8Array; -} -/** - * A Secp256k1Signature plus the recovery parameter - */ -export declare class ExtendedSecp256k1Signature extends Secp256k1Signature { - /** - * Decode extended signature from the simple fixed length encoding - * described in toFixedLength(). - */ - static fromFixedLength(data: Uint8Array): ExtendedSecp256k1Signature; - readonly recovery: number; - constructor(r: Uint8Array, s: Uint8Array, recovery: number); - /** - * A simple custom encoding that encodes the extended signature as - * r (32 bytes) | s (32 bytes) | recovery param (1 byte) - * where | denotes concatenation of bonary data. - */ - toFixedLength(): Uint8Array; -} diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/secp256k1signature.js b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/secp256k1signature.js deleted file mode 100644 index 2a2841ef..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/secp256k1signature.js +++ /dev/null @@ -1,155 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ExtendedSecp256k1Signature = exports.Secp256k1Signature = void 0; -function trimLeadingNullBytes(inData) { - let numberOfLeadingNullBytes = 0; - for (const byte of inData) { - if (byte === 0x00) { - numberOfLeadingNullBytes++; - } - else { - break; - } - } - return inData.slice(numberOfLeadingNullBytes); -} -const derTagInteger = 0x02; -class Secp256k1Signature { - /** - * Takes the pair of integers (r, s) as 2x32 byte of binary data. - * - * Note: This is the format Cosmos SDK uses natively. - * - * @param data a 64 byte value containing integers r and s. - */ - static fromFixedLength(data) { - if (data.length !== 64) { - throw new Error(`Got invalid data length: ${data.length}. Expected 2x 32 bytes for the pair (r, s)`); - } - return new Secp256k1Signature(trimLeadingNullBytes(data.slice(0, 32)), trimLeadingNullBytes(data.slice(32, 64))); - } - static fromDer(data) { - let pos = 0; - if (data[pos++] !== 0x30) { - throw new Error("Prefix 0x30 expected"); - } - const bodyLength = data[pos++]; - if (data.length - pos !== bodyLength) { - throw new Error("Data length mismatch detected"); - } - // r - const rTag = data[pos++]; - if (rTag !== derTagInteger) { - throw new Error("INTEGER tag expected"); - } - const rLength = data[pos++]; - if (rLength >= 0x80) { - throw new Error("Decoding length values above 127 not supported"); - } - const rData = data.slice(pos, pos + rLength); - pos += rLength; - // s - const sTag = data[pos++]; - if (sTag !== derTagInteger) { - throw new Error("INTEGER tag expected"); - } - const sLength = data[pos++]; - if (sLength >= 0x80) { - throw new Error("Decoding length values above 127 not supported"); - } - const sData = data.slice(pos, pos + sLength); - pos += sLength; - return new Secp256k1Signature( - // r/s data can contain leading 0 bytes to express integers being non-negative in DER - trimLeadingNullBytes(rData), trimLeadingNullBytes(sData)); - } - data; - constructor(r, s) { - if (r.length > 32 || r.length === 0 || r[0] === 0x00) { - throw new Error("Unsigned integer r must be encoded as unpadded big endian."); - } - if (s.length > 32 || s.length === 0 || s[0] === 0x00) { - throw new Error("Unsigned integer s must be encoded as unpadded big endian."); - } - this.data = { - r: r, - s: s, - }; - } - r(length) { - if (length === undefined) { - return this.data.r; - } - else { - const paddingLength = length - this.data.r.length; - if (paddingLength < 0) { - throw new Error("Length too small to hold parameter r"); - } - const padding = new Uint8Array(paddingLength); - return new Uint8Array([...padding, ...this.data.r]); - } - } - s(length) { - if (length === undefined) { - return this.data.s; - } - else { - const paddingLength = length - this.data.s.length; - if (paddingLength < 0) { - throw new Error("Length too small to hold parameter s"); - } - const padding = new Uint8Array(paddingLength); - return new Uint8Array([...padding, ...this.data.s]); - } - } - toFixedLength() { - return new Uint8Array([...this.r(32), ...this.s(32)]); - } - toDer() { - // DER supports negative integers but our data is unsigned. Thus we need to prepend - // a leading 0 byte when the highest bit is set to differentiate negative values - const rEncoded = this.data.r[0] >= 0x80 ? new Uint8Array([0, ...this.data.r]) : this.data.r; - const sEncoded = this.data.s[0] >= 0x80 ? new Uint8Array([0, ...this.data.s]) : this.data.s; - const rLength = rEncoded.length; - const sLength = sEncoded.length; - const data = new Uint8Array([derTagInteger, rLength, ...rEncoded, derTagInteger, sLength, ...sEncoded]); - return new Uint8Array([0x30, data.length, ...data]); - } -} -exports.Secp256k1Signature = Secp256k1Signature; -/** - * A Secp256k1Signature plus the recovery parameter - */ -class ExtendedSecp256k1Signature extends Secp256k1Signature { - /** - * Decode extended signature from the simple fixed length encoding - * described in toFixedLength(). - */ - static fromFixedLength(data) { - if (data.length !== 65) { - throw new Error(`Got invalid data length ${data.length}. Expected 32 + 32 + 1`); - } - return new ExtendedSecp256k1Signature(trimLeadingNullBytes(data.slice(0, 32)), trimLeadingNullBytes(data.slice(32, 64)), data[64]); - } - recovery; - constructor(r, s, recovery) { - super(r, s); - if (!Number.isInteger(recovery)) { - throw new Error("The recovery parameter must be an integer."); - } - if (recovery < 0 || recovery > 4) { - throw new Error("The recovery parameter must be one of 0, 1, 2, 3."); - } - this.recovery = recovery; - } - /** - * A simple custom encoding that encodes the extended signature as - * r (32 bytes) | s (32 bytes) | recovery param (1 byte) - * where | denotes concatenation of bonary data. - */ - toFixedLength() { - return new Uint8Array([...this.r(32), ...this.s(32), this.recovery]); - } -} -exports.ExtendedSecp256k1Signature = ExtendedSecp256k1Signature; -//# sourceMappingURL=secp256k1signature.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/secp256k1signature.js.map b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/secp256k1signature.js.map deleted file mode 100644 index a8006a87..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/secp256k1signature.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"secp256k1signature.js","sourceRoot":"","sources":["../src/secp256k1signature.ts"],"names":[],"mappings":";;;AAAA,SAAS,oBAAoB,CAAC,MAAkB;IAC9C,IAAI,wBAAwB,GAAG,CAAC,CAAC;IACjC,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QAC1B,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAClB,wBAAwB,EAAE,CAAC;QAC7B,CAAC;aAAM,CAAC;YACN,MAAM;QACR,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;AAChD,CAAC;AAED,MAAM,aAAa,GAAG,IAAI,CAAC;AAE3B,MAAa,kBAAkB;IAC7B;;;;;;OAMG;IACI,MAAM,CAAC,eAAe,CAAC,IAAgB;QAC5C,IAAI,IAAI,CAAC,MAAM,KAAK,EAAE,EAAE,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,4BAA4B,IAAI,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,CAAC;QAEZ,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;QAChE,CAAC;QAED,IAAI,QAAQ,GAAG,CAAC,IAAI,QAAQ,GAAG,CAAC,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;QACvE,CAAC;QAED,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACa,aAAa;QAC3B,OAAO,IAAI,UAAU,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IACvE,CAAC;CACF;AAxCD,gEAwCC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/sha.d.ts b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/sha.d.ts deleted file mode 100644 index 6972cabc..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/sha.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { HashFunction } from "./hash"; -export declare class Sha256 implements HashFunction { - readonly blockSize: number; - private readonly impl; - constructor(firstData?: Uint8Array); - update(data: Uint8Array): this; - digest(): Uint8Array; -} -/** Convenience function equivalent to `new Sha256(data).digest()` */ -export declare function sha256(data: Uint8Array): Uint8Array; -export declare class Sha512 implements HashFunction { - readonly blockSize: number; - private readonly impl; - constructor(firstData?: Uint8Array); - update(data: Uint8Array): this; - digest(): Uint8Array; -} -/** Convenience function equivalent to `new Sha512(data).digest()` */ -export declare function sha512(data: Uint8Array): Uint8Array; diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/sha.js b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/sha.js deleted file mode 100644 index d1c420a9..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/sha.js +++ /dev/null @@ -1,50 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Sha512 = exports.Sha256 = void 0; -exports.sha256 = sha256; -exports.sha512 = sha512; -const sha2_js_1 = require("@noble/hashes/sha2.js"); -const utils_1 = require("./utils"); -class Sha256 { - blockSize = 512 / 8; - impl = sha2_js_1.sha256.create(); - constructor(firstData) { - if (firstData) { - this.update(firstData); - } - } - update(data) { - this.impl.update((0, utils_1.toRealUint8Array)(data)); - return this; - } - digest() { - return this.impl.digest(); - } -} -exports.Sha256 = Sha256; -/** Convenience function equivalent to `new Sha256(data).digest()` */ -function sha256(data) { - return new Sha256(data).digest(); -} -class Sha512 { - blockSize = 1024 / 8; - impl = sha2_js_1.sha512.create(); - constructor(firstData) { - if (firstData) { - this.update(firstData); - } - } - update(data) { - this.impl.update((0, utils_1.toRealUint8Array)(data)); - return this; - } - digest() { - return this.impl.digest(); - } -} -exports.Sha512 = Sha512; -/** Convenience function equivalent to `new Sha512(data).digest()` */ -function sha512(data) { - return new Sha512(data).digest(); -} -//# sourceMappingURL=sha.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/sha.js.map b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/sha.js.map deleted file mode 100644 index e490996a..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/sha.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha.js","sourceRoot":"","sources":["../src/sha.ts"],"names":[],"mappings":";;;AA2BA,wBAEC;AAwBD,wBAEC;AAvDD,mDAAqF;AAGrF,mCAA2C;AAE3C,MAAa,MAAM;IACD,SAAS,GAAG,GAAG,GAAG,CAAC,CAAC;IAEnB,IAAI,GAAG,gBAAW,CAAC,MAAM,EAAE,CAAC;IAE7C,YAAmB,SAAsB;QACvC,IAAI,SAAS,EAAE,CAAC;YACd,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACzB,CAAC;IACH,CAAC;IAEM,MAAM,CAAC,IAAgB;QAC5B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAA,wBAAgB,EAAC,IAAI,CAAC,CAAC,CAAC;QACzC,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,MAAM;QACX,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IAC5B,CAAC;CACF;AAnBD,wBAmBC;AAED,qEAAqE;AACrE,SAAgB,MAAM,CAAC,IAAgB;IACrC,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;AACnC,CAAC;AAED,MAAa,MAAM;IACD,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC;IAEpB,IAAI,GAAG,gBAAW,CAAC,MAAM,EAAE,CAAC;IAE7C,YAAmB,SAAsB;QACvC,IAAI,SAAS,EAAE,CAAC;YACd,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACzB,CAAC;IACH,CAAC;IAEM,MAAM,CAAC,IAAgB;QAC5B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAA,wBAAgB,EAAC,IAAI,CAAC,CAAC,CAAC;QACzC,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,MAAM;QACX,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IAC5B,CAAC;CACF;AAnBD,wBAmBC;AAED,qEAAqE;AACrE,SAAgB,MAAM,CAAC,IAAgB;IACrC,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;AACnC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/slip10.d.ts b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/slip10.d.ts deleted file mode 100644 index 11687600..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/slip10.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { Uint32 } from "@cosmjs/math"; -export interface Slip10Result { - readonly chainCode: Uint8Array; - readonly privkey: Uint8Array; -} -/** - * Raw values must match the curve string in SLIP-0010 master key generation - * - * @see https://github.com/satoshilabs/slips/blob/master/slip-0010.md#master-key-generation - */ -export declare enum Slip10Curve { - Secp256k1 = "Bitcoin seed", - Ed25519 = "ed25519 seed" -} -/** - * Reverse mapping of Slip10Curve - */ -export declare function slip10CurveFromString(curveString: string): Slip10Curve; -export declare class Slip10RawIndex extends Uint32 { - static hardened(hardenedIndex: number): Slip10RawIndex; - static normal(normalIndex: number): Slip10RawIndex; - isHardened(): boolean; -} -/** - * An array of raw SLIP10 indices. - * - * This can be constructed via string parsing: - * - * ```ts - * import { stringToPath } from "@cosmjs/crypto"; - * - * const path = stringToPath("m/0'/1/2'/2/1000000000"); - * ``` - * - * or manually: - * - * ```ts - * import { HdPath, Slip10RawIndex } from "@cosmjs/crypto"; - * - * // m/0'/1/2'/2/1000000000 - * const path: HdPath = [ - * Slip10RawIndex.hardened(0), - * Slip10RawIndex.normal(1), - * Slip10RawIndex.hardened(2), - * Slip10RawIndex.normal(2), - * Slip10RawIndex.normal(1000000000), - * ]; - * ``` - */ -export type HdPath = readonly Slip10RawIndex[]; -export declare class Slip10 { - static derivePath(curve: Slip10Curve, seed: Uint8Array, path: HdPath): Slip10Result; - private static master; - private static child; - /** - * Implementation of ser_P(point(k_par)) from BIP-0032 - * - * @see https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki - */ - private static serializedPoint; - private static childImpl; - private static isZero; - private static isGteN; - private static n; -} -export declare function pathToString(path: HdPath): string; -export declare function stringToPath(input: string): HdPath; diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/slip10.js b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/slip10.js deleted file mode 100644 index 78e6f2b0..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/slip10.js +++ /dev/null @@ -1,193 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Slip10 = exports.Slip10RawIndex = exports.Slip10Curve = void 0; -exports.slip10CurveFromString = slip10CurveFromString; -exports.pathToString = pathToString; -exports.stringToPath = stringToPath; -const encoding_1 = require("@cosmjs/encoding"); -const math_1 = require("@cosmjs/math"); -const utils_1 = require("@cosmjs/utils"); -const secp256k1_1 = require("@noble/curves/secp256k1"); -const hmac_1 = require("./hmac"); -const sha_1 = require("./sha"); -/** - * Raw values must match the curve string in SLIP-0010 master key generation - * - * @see https://github.com/satoshilabs/slips/blob/master/slip-0010.md#master-key-generation - */ -var Slip10Curve; -(function (Slip10Curve) { - Slip10Curve["Secp256k1"] = "Bitcoin seed"; - Slip10Curve["Ed25519"] = "ed25519 seed"; -})(Slip10Curve || (exports.Slip10Curve = Slip10Curve = {})); -function bytesToUnsignedBigInt(a) { - return BigInt("0x" + (0, encoding_1.toHex)(a)); -} -function intTo32be(n) { - (0, utils_1.assert)(n >= 0n); - (0, utils_1.assert)(n < 2n ** (32n * 8n)); - // 32 bytes is 64 hexadecimal characters - const hex = n.toString(16).padStart(64, "0"); - return (0, encoding_1.fromHex)(hex); -} -/* eslint-disable @typescript-eslint/no-unsafe-enum-comparison */ -/** - * Reverse mapping of Slip10Curve - */ -function slip10CurveFromString(curveString) { - switch (curveString) { - case Slip10Curve.Ed25519: - return Slip10Curve.Ed25519; - case Slip10Curve.Secp256k1: - return Slip10Curve.Secp256k1; - default: - throw new Error(`Unknown curve string: '${curveString}'`); - } -} -class Slip10RawIndex extends math_1.Uint32 { - static hardened(hardenedIndex) { - return new Slip10RawIndex(hardenedIndex + 2 ** 31); - } - static normal(normalIndex) { - return new Slip10RawIndex(normalIndex); - } - isHardened() { - return this.data >= 2 ** 31; - } -} -exports.Slip10RawIndex = Slip10RawIndex; -// Universal private key derivation according to -// https://github.com/satoshilabs/slips/blob/master/slip-0010.md -class Slip10 { - static derivePath(curve, seed, path) { - let result = this.master(curve, seed); - for (const rawIndex of path) { - result = this.child(curve, result.privkey, result.chainCode, rawIndex); - } - return result; - } - static master(curve, seed) { - const i = new hmac_1.Hmac(sha_1.Sha512, (0, encoding_1.toAscii)(curve)).update(seed).digest(); - const il = i.slice(0, 32); - const ir = i.slice(32, 64); - if (curve !== Slip10Curve.Ed25519 && (this.isZero(il) || this.isGteN(curve, il))) { - return this.master(curve, i); - } - return { - chainCode: ir, - privkey: il, - }; - } - static child(curve, parentPrivkey, parentChainCode, rawIndex) { - let i; - if (rawIndex.isHardened()) { - const payload = new Uint8Array([0x00, ...parentPrivkey, ...rawIndex.toBytesBigEndian()]); - i = new hmac_1.Hmac(sha_1.Sha512, parentChainCode).update(payload).digest(); - } - else { - if (curve === Slip10Curve.Ed25519) { - throw new Error("Normal keys are not allowed with ed25519"); - } - else { - // Step 1 of https://github.com/satoshilabs/slips/blob/master/slip-0010.md#private-parent-key--private-child-key - // Calculate I = HMAC-SHA512(Key = c_par, Data = ser_P(point(k_par)) || ser_32(i)). - // where the functions point() and ser_p() are defined in BIP-0032 - const data = new Uint8Array([ - ...Slip10.serializedPoint(curve, bytesToUnsignedBigInt(parentPrivkey)), - ...rawIndex.toBytesBigEndian(), - ]); - i = new hmac_1.Hmac(sha_1.Sha512, parentChainCode).update(data).digest(); - } - } - return this.childImpl(curve, parentPrivkey, parentChainCode, rawIndex, i); - } - /** - * Implementation of ser_P(point(k_par)) from BIP-0032 - * - * @see https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki - */ - static serializedPoint(curve, p) { - switch (curve) { - case Slip10Curve.Secp256k1: - return secp256k1_1.secp256k1.Point.BASE.multiply(p).toBytes(true); - default: - throw new Error("curve not supported"); - } - } - static childImpl(curve, parentPrivkey, parentChainCode, rawIndex, i) { - // step 2 (of the Private parent key → private child key algorithm) - const il = i.slice(0, 32); - const ir = i.slice(32, 64); - // step 3 - const returnChainCode = ir; - // step 4 - if (curve === Slip10Curve.Ed25519) { - return { - chainCode: returnChainCode, - privkey: il, - }; - } - // step 5 - const n = this.n(curve); - const returnChildKeyAsNumber = (bytesToUnsignedBigInt(il) + bytesToUnsignedBigInt(parentPrivkey)) % n; - const returnChildKey = intTo32be(returnChildKeyAsNumber); - // step 6 - if (this.isGteN(curve, il) || this.isZero(returnChildKey)) { - const newI = new hmac_1.Hmac(sha_1.Sha512, parentChainCode) - .update(new Uint8Array([0x01, ...ir, ...rawIndex.toBytesBigEndian()])) - .digest(); - return this.childImpl(curve, parentPrivkey, parentChainCode, rawIndex, newI); - } - // step 7 - return { - chainCode: returnChainCode, - privkey: returnChildKey, - }; - } - static isZero(privkey) { - return privkey.every((byte) => byte === 0); - } - static isGteN(curve, privkey) { - const keyAsNumber = bytesToUnsignedBigInt(privkey); - return keyAsNumber >= this.n(curve); - } - static n(curve) { - switch (curve) { - case Slip10Curve.Secp256k1: - return 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n; - default: - throw new Error("curve not supported"); - } - } -} -exports.Slip10 = Slip10; -function pathToString(path) { - return path.reduce((current, component) => { - const componentString = component.isHardened() - ? `${component.toNumber() - 2 ** 31}'` - : component.toString(); - return current + "/" + componentString; - }, "m"); -} -function stringToPath(input) { - if (!input.startsWith("m")) - throw new Error("Path string must start with 'm'"); - let rest = input.slice(1); - const out = new Array(); - while (rest) { - const match = rest.match(/^\/([0-9]+)('?)/); - if (!match) - throw new Error("Syntax error while reading path component"); - const [fullMatch, numberString, apostrophe] = match; - const value = math_1.Uint53.fromString(numberString).toNumber(); - if (value >= 2 ** 31) - throw new Error("Component value too high. Must not exceed 2**31-1."); - if (apostrophe) - out.push(Slip10RawIndex.hardened(value)); - else - out.push(Slip10RawIndex.normal(value)); - rest = rest.slice(fullMatch.length); - } - return out; -} -//# sourceMappingURL=slip10.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/slip10.js.map b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/slip10.js.map deleted file mode 100644 index ab2d4e41..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs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G,CAAC,CAAC;AACV,CAAC;AAED,SAAgB,YAAY,CAAC,KAAa;IACxC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IAC/E,IAAI,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAE1B,MAAM,GAAG,GAAG,IAAI,KAAK,EAAkB,CAAC;IACxC,OAAO,IAAI,EAAE,CAAC;QACZ,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;QAC5C,IAAI,CAAC,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;QACzE,MAAM,CAAC,SAAS,EAAE,YAAY,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC;QACpD,MAAM,KAAK,GAAG,aAAM,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE,CAAC;QACzD,IAAI,KAAK,IAAI,CAAC,IAAI,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;QAC5F,IAAI,UAAU;YAAE,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;;YACpD,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC5C,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/utils.d.ts b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/utils.d.ts deleted file mode 100644 index 93de3b0a..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/utils.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function toRealUint8Array(data: ArrayLike): Uint8Array; diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/utils.js b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/utils.js deleted file mode 100644 index b66eb7e2..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/utils.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.toRealUint8Array = toRealUint8Array; -// See https://github.com/paulmillr/noble-hashes/issues/25 for why this is needed -function toRealUint8Array(data) { - if (data instanceof Uint8Array) - return data; - else - return Uint8Array.from(data); -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/utils.js.map b/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/utils.js.map deleted file mode 100644 index c3f03002..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/build/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;AACA,4CAGC;AAJD,iFAAiF;AACjF,SAAgB,gBAAgB,CAAC,IAAuB;IACtD,IAAI,IAAI,YAAY,UAAU;QAAE,OAAO,IAAI,CAAC;;QACvC,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACpC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/crypto/package.json b/tools/mnemonic-test/node_modules/@cosmjs/crypto/package.json deleted file mode 100644 index 18e12e02..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/crypto/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "name": "@cosmjs/crypto", - "version": "0.37.0", - "description": "Cryptography resources for blockchain projects", - "contributors": [ - "IOV SAS ", - "Simon Warta" - ], - "license": "Apache-2.0", - "exports": { - "types": "./build/index.d.ts", - "default": "./build/index.js" - }, - "files": [ - "build/", - "*.md", - "!*.spec.*", - "!**/testdata/" - ], - "repository": { - "type": "git", - "url": "https://github.com/cosmos/cosmjs/tree/main/packages/crypto" - }, - "publishConfig": { - "access": "public", - "registry": "https://registry.npmjs.org" - }, - "scripts": { - "docs": "typedoc", - "format": "prettier --write --log-level warn \"./src/**/*.ts\"", - "format-text": "prettier --write \"./*.md\"", - "test-node": "yarn node jasmine-testrunner.cjs", - "test-firefox": "yarn pack-web && karma start --single-run --browsers Firefox karma.conf.cjs", - "test-chrome": "yarn pack-web && karma start --single-run --browsers ChromeHeadless karma.conf.cjs", - "test": "yarn build-or-skip && yarn test-node", - "coverage": "nyc --reporter=text --reporter=lcov yarn test --quiet", - "build": "rm -rf ./build && tsc", - "build-or-skip": "[ -n \"${SKIP_BUILD:-}\" ] || yarn build", - "pack-web": "yarn build-or-skip && webpack --mode development --config webpack.web.config.cjs" - }, - "dependencies": { - "@cosmjs/encoding": "^0.37.0", - "@cosmjs/math": "^0.37.0", - "@cosmjs/utils": "^0.37.0", - "@noble/ciphers": "^1.3.0", - "@noble/curves": "^1.9.2", - "@noble/hashes": "^1.8.0", - "@scure/bip39": "^1.6.0", - "hash-wasm": "^4.12.0" - }, - "devDependencies": { - "@istanbuljs/nyc-config-typescript": "^1.0.1", - "@types/jasmine": "^4", - "@types/karma-firefox-launcher": "^2", - "@types/karma-jasmine": "^4", - "@types/karma-jasmine-html-reporter": "^1", - "@types/node": "*", - "glob": "^11", - "jasmine": "^4", - "jasmine-spec-reporter": "^6", - "karma": "^6.3.14", - "karma-chrome-launcher": "^3.1.0", - "karma-firefox-launcher": "^2.1.0", - "karma-jasmine": "^5", - "karma-jasmine-html-reporter": "^1.5.4", - "nyc": "^17.1.0", - "prettier": "^3.6.2", - "ses": "^1.13.0", - "source-map-support": "^0.5.19", - "typedoc": "^0.28", - "typescript": "~5.9", - "webpack": "^5.76.0", - "webpack-cli": "^4.6.0" - } -} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/encoding/README.md b/tools/mnemonic-test/node_modules/@cosmjs/encoding/README.md deleted file mode 100644 index 4602af80..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/encoding/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# @cosmjs/encoding - -![typescript](https://img.shields.io/npm/types/@cosmjs/encoding.svg) -[![npm version](https://img.shields.io/npm/v/@cosmjs/encoding.svg)](https://www.npmjs.com/package/@cosmjs/encoding) -[![license](https://img.shields.io/npm/l/@cosmjs/encoding.svg)](https://github.com/cosmos/cosmjs/blob/v0.35.0/LICENSE) -![minimum node version](https://img.shields.io/node/v/@cosmjs/encoding.svg) -![minified size](https://img.shields.io/bundlephobia/min/@cosmjs/encoding.svg) -![monthly downloads](https://img.shields.io/npm/dm/@cosmjs/encoding.svg) - -This package is an extension to the JavaScript standard library that is not -bound to blockchain products. It provides basic hex/base64/ascii encoding to -Uint8Array that doesn't rely on Buffer and also provides better error messages -on invalid input. - -## Convert between bech32 and hex addresses - -``` ->> toBech32("tiov", fromHex("1234ABCD0000AA0000FFFF0000AA00001234ABCD")) -'tiov1zg62hngqqz4qqq8lluqqp2sqqqfrf27dzrrmea' ->> toHex(fromBech32("tiov1zg62hngqqz4qqq8lluqqp2sqqqfrf27dzrrmea").data) -'1234abcd0000aa0000ffff0000aa00001234abcd' -``` - -## License - -This package is part of the cosmjs repository, licensed under the Apache License -2.0 (see [NOTICE](https://github.com/cosmos/cosmjs/blob/main/NOTICE) and -[LICENSE](https://github.com/cosmos/cosmjs/blob/main/LICENSE)). diff --git a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/ascii.d.ts b/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/ascii.d.ts deleted file mode 100644 index 42d32698..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/ascii.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function toAscii(input: string): Uint8Array; -export declare function fromAscii(data: Uint8Array): string; diff --git a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/ascii.js b/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/ascii.js deleted file mode 100644 index 5180d1f2..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/ascii.js +++ /dev/null @@ -1,32 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.toAscii = toAscii; -exports.fromAscii = fromAscii; -function toAscii(input) { - const toNums = (str) => str.split("").map((x) => { - const charCode = x.charCodeAt(0); - // 0x00–0x1F control characters - // 0x20–0x7E printable characters - // 0x7F delete character - // 0x80–0xFF out of 7 bit ascii range - if (charCode < 0x20 || charCode > 0x7e) { - throw new Error(`Cannot encode character that is out of printable ASCII range: ${charCode}`); - } - return charCode; - }); - return Uint8Array.from(toNums(input)); -} -function fromAscii(data) { - const fromNums = (listOfNumbers) => listOfNumbers.map((x) => { - // 0x00–0x1F control characters - // 0x20–0x7E printable characters - // 0x7F delete character - // 0x80–0xFF out of 7 bit ascii range - if (x < 0x20 || x > 0x7e) { - throw new Error(`Cannot decode character that is out of printable ASCII range: ${x}`); - } - return String.fromCharCode(x); - }); - return fromNums(Array.from(data)).join(""); -} -//# sourceMappingURL=ascii.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/ascii.js.map b/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/ascii.js.map deleted file mode 100644 index 82bbf773..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/ascii.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ascii.js","sourceRoot":"","sources":["../src/ascii.ts"],"names":[],"mappings":";;AAAA,0BAcC;AAED,8BAcC;AA9BD,SAAgB,OAAO,CAAC,KAAa;IACnC,MAAM,MAAM,GAAG,CAAC,GAAW,EAAqB,EAAE,CAChD,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAS,EAAE,EAAE;QAC9B,MAAM,QAAQ,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QACjC,+BAA+B;QAC/B,iCAAiC;QACjC,wBAAwB;QACxB,qCAAqC;QACrC,IAAI,QAAQ,GAAG,IAAI,IAAI,QAAQ,GAAG,IAAI,EAAE,CAAC;YACvC,MAAM,IAAI,KAAK,CAAC,iEAAiE,QAAQ,EAAE,CAAC,CAAC;QAC/F,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC,CAAC;IACL,OAAO,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AACxC,CAAC;AAED,SAAgB,SAAS,CAAC,IAAgB;IACxC,MAAM,QAAQ,GAAG,CAAC,aAAgC,EAAqB,EAAE,CACvE,aAAa,CAAC,GAAG,CAAC,CAAC,CAAS,EAAU,EAAE;QACtC,+BAA+B;QAC/B,iCAAiC;QACjC,wBAAwB;QACxB,qCAAqC;QACrC,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,iEAAiE,CAAC,EAAE,CAAC,CAAC;QACxF,CAAC;QACD,OAAO,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;IAEL,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC7C,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/base64.d.ts b/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/base64.d.ts deleted file mode 100644 index 3eb3915c..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/base64.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function toBase64(data: Uint8Array): string; -export declare function fromBase64(base64String: string): Uint8Array; diff --git a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/base64.js b/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/base64.js deleted file mode 100644 index 030f7eb1..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/base64.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -exports.toBase64 = toBase64; -exports.fromBase64 = fromBase64; -const base64js = __importStar(require("base64-js")); -function toBase64(data) { - return base64js.fromByteArray(data); -} -function fromBase64(base64String) { - if (!base64String.match(/^[a-zA-Z0-9+/]*={0,2}$/)) { - throw new Error("Invalid base64 string format"); - } - return base64js.toByteArray(base64String); -} -//# sourceMappingURL=base64.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/base64.js.map b/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/base64.js.map deleted file mode 100644 index fa47ce8e..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/base64.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base64.js","sourceRoot":"","sources":["../src/base64.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,4BAEC;AAED,gCAKC;AAXD,oDAAsC;AAEtC,SAAgB,QAAQ,CAAC,IAAgB;IACvC,OAAO,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;AACtC,CAAC;AAED,SAAgB,UAAU,CAAC,YAAoB;IAC7C,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,wBAAwB,CAAC,EAAE,CAAC;QAClD,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,QAAQ,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;AAC5C,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/bech32.d.ts b/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/bech32.d.ts deleted file mode 100644 index cf4222d7..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/bech32.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -export declare function toBech32(prefix: string, data: Uint8Array, limit?: number): string; -export declare function fromBech32(address: string, limit?: number): { - readonly prefix: string; - readonly data: Uint8Array; -}; -/** - * Takes a bech32 address and returns a normalized (i.e. lower case) representation of it. - * - * The input is validated along the way, which makes this significantly safer than - * using `address.toLowerCase()`. - */ -export declare function normalizeBech32(address: string): string; diff --git a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/bech32.js b/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/bech32.js deleted file mode 100644 index 9c6c663a..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/bech32.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.toBech32 = toBech32; -exports.fromBech32 = fromBech32; -exports.normalizeBech32 = normalizeBech32; -const base_1 = require("@scure/base"); -function toBech32(prefix, data, limit) { - const address = base_1.bech32.encode(prefix, base_1.bech32.toWords(data), limit); - return address; -} -function hasBech32Separator(input) { - return input.indexOf("1") !== -1; -} -function fromBech32(address, limit = Infinity) { - // This extra check can be removed once - // https://github.com/paulmillr/scure-base/pull/45 is merged and published. - if (!hasBech32Separator(address)) - throw new Error(`No bech32 separator found`); - const decodedAddress = base_1.bech32.decode(address, limit); - return { - prefix: decodedAddress.prefix, - data: new Uint8Array(base_1.bech32.fromWords(decodedAddress.words)), - }; -} -/** - * Takes a bech32 address and returns a normalized (i.e. lower case) representation of it. - * - * The input is validated along the way, which makes this significantly safer than - * using `address.toLowerCase()`. - */ -function normalizeBech32(address) { - const { prefix, data } = fromBech32(address); - return toBech32(prefix, data); -} -//# sourceMappingURL=bech32.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/bech32.js.map b/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/bech32.js.map deleted file mode 100644 index daab4786..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/bech32.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bech32.js","sourceRoot":"","sources":["../src/bech32.ts"],"names":[],"mappings":";;AAEA,4BAGC;AAMD,gCAaC;AAQD,0CAGC;AAnCD,sCAAqC;AAErC,SAAgB,QAAQ,CAAC,MAAc,EAAE,IAAgB,EAAE,KAAc;IACvE,MAAM,OAAO,GAAG,aAAM,CAAC,MAAM,CAAC,MAAM,EAAE,aAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;IACnE,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAa;IACvC,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;AACnC,CAAC;AAED,SAAgB,UAAU,CACxB,OAAe,EACf,KAAK,GAAG,QAAQ;IAEhB,uCAAuC;IACvC,2EAA2E;IAC3E,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IAE/E,MAAM,cAAc,GAAG,aAAM,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACrD,OAAO;QACL,MAAM,EAAE,cAAc,CAAC,MAAM;QAC7B,IAAI,EAAE,IAAI,UAAU,CAAC,aAAM,CAAC,SAAS,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;KAC7D,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,OAAe;IAC7C,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IAC7C,OAAO,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AAChC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/hex.d.ts b/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/hex.d.ts deleted file mode 100644 index a337851f..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/hex.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function toHex(data: Uint8Array): string; -export declare function fromHex(hexstring: string): Uint8Array; diff --git a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/hex.js b/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/hex.js deleted file mode 100644 index 06504175..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/hex.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.toHex = toHex; -exports.fromHex = fromHex; -function toHex(data) { - let out = ""; - for (const byte of data) { - out += ("0" + byte.toString(16)).slice(-2); - } - return out; -} -function fromHex(hexstring) { - if (hexstring.length % 2 !== 0) { - throw new Error("hex string length must be a multiple of 2"); - } - const out = new Uint8Array(hexstring.length / 2); - for (let i = 0; i < out.length; i++) { - const j = 2 * i; - const hexByteAsString = hexstring.slice(j, j + 2); - if (!hexByteAsString.match(/[0-9a-f]{2}/i)) { - throw new Error("hex string contains invalid characters"); - } - out[i] = parseInt(hexByteAsString, 16); - } - return out; -} -//# sourceMappingURL=hex.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/hex.js.map b/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/hex.js.map deleted file mode 100644 index 04038cbe..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/hex.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hex.js","sourceRoot":"","sources":["../src/hex.ts"],"names":[],"mappings":";;AAAA,sBAMC;AAED,0BAeC;AAvBD,SAAgB,KAAK,CAAC,IAAgB;IACpC,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;QACxB,GAAG,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAgB,OAAO,CAAC,SAAiB;IACvC,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC/D,CAAC;IAED,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACjD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACpC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAChB,MAAM,eAAe,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QAClD,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE,CAAC;YAC3C,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;QAC5D,CAAC;QACD,GAAG,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/index.d.ts b/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/index.d.ts deleted file mode 100644 index a2dc4771..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export { fromAscii, toAscii } from "./ascii"; -export { fromBase64, toBase64 } from "./base64"; -export { fromBech32, normalizeBech32, toBech32 } from "./bech32"; -export { fromHex, toHex } from "./hex"; -export { fromRfc3339, toRfc3339 } from "./rfc3339"; -export { fromUtf8, toUtf8 } from "./utf8"; diff --git a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/index.js b/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/index.js deleted file mode 100644 index 0506f526..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/index.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.toUtf8 = exports.fromUtf8 = exports.toRfc3339 = exports.fromRfc3339 = exports.toHex = exports.fromHex = exports.toBech32 = exports.normalizeBech32 = exports.fromBech32 = exports.toBase64 = exports.fromBase64 = exports.toAscii = exports.fromAscii = void 0; -var ascii_1 = require("./ascii"); -Object.defineProperty(exports, "fromAscii", { enumerable: true, get: function () { return ascii_1.fromAscii; } }); -Object.defineProperty(exports, "toAscii", { enumerable: true, get: function () { return ascii_1.toAscii; } }); -var base64_1 = require("./base64"); -Object.defineProperty(exports, "fromBase64", { enumerable: true, get: function () { return base64_1.fromBase64; } }); -Object.defineProperty(exports, "toBase64", { enumerable: true, get: function () { return base64_1.toBase64; } }); -var bech32_1 = require("./bech32"); -Object.defineProperty(exports, "fromBech32", { enumerable: true, get: function () { return bech32_1.fromBech32; } }); -Object.defineProperty(exports, "normalizeBech32", { enumerable: true, get: function () { return bech32_1.normalizeBech32; } }); -Object.defineProperty(exports, "toBech32", { enumerable: true, get: function () { return bech32_1.toBech32; } }); -var hex_1 = require("./hex"); -Object.defineProperty(exports, "fromHex", { enumerable: true, get: function () { return hex_1.fromHex; } }); -Object.defineProperty(exports, "toHex", { enumerable: true, get: function () { return hex_1.toHex; } }); -var rfc3339_1 = require("./rfc3339"); -Object.defineProperty(exports, "fromRfc3339", { enumerable: true, get: function () { return rfc3339_1.fromRfc3339; } }); -Object.defineProperty(exports, "toRfc3339", { enumerable: true, get: function () { return rfc3339_1.toRfc3339; } }); -var utf8_1 = require("./utf8"); -Object.defineProperty(exports, "fromUtf8", { enumerable: true, get: function () { return utf8_1.fromUtf8; } }); -Object.defineProperty(exports, "toUtf8", { enumerable: true, get: function () { return utf8_1.toUtf8; } }); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/index.js.map b/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/index.js.map deleted file mode 100644 index 8ffe3ef1..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,iCAA6C;AAApC,kGAAA,SAAS,OAAA;AAAE,gGAAA,OAAO,OAAA;AAC3B,mCAAgD;AAAvC,oGAAA,UAAU,OAAA;AAAE,kGAAA,QAAQ,OAAA;AAC7B,mCAAiE;AAAxD,oGAAA,UAAU,OAAA;AAAE,yGAAA,eAAe,OAAA;AAAE,kGAAA,QAAQ,OAAA;AAC9C,6BAAuC;AAA9B,8FAAA,OAAO,OAAA;AAAE,4FAAA,KAAK,OAAA;AACvB,qCAAmD;AAA1C,sGAAA,WAAW,OAAA;AAAE,oGAAA,SAAS,OAAA;AAC/B,+BAA0C;AAAjC,gGAAA,QAAQ,OAAA;AAAE,8FAAA,MAAM,OAAA"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/rfc3339.d.ts b/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/rfc3339.d.ts deleted file mode 100644 index 759db985..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/rfc3339.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ReadonlyDate } from "readonly-date"; -export declare function fromRfc3339(str: string): Date; -export declare function toRfc3339(date: Date | ReadonlyDate): string; diff --git a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/rfc3339.js b/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/rfc3339.js deleted file mode 100644 index 8dff6c19..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/rfc3339.js +++ /dev/null @@ -1,52 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.fromRfc3339 = fromRfc3339; -exports.toRfc3339 = toRfc3339; -const rfc3339Matcher = /^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(\.\d{1,9})?((?:[+-]\d{2}:\d{2})|Z)$/; -function padded(integer, length = 2) { - return integer.toString().padStart(length, "0"); -} -function fromRfc3339(str) { - const matches = rfc3339Matcher.exec(str); - if (!matches) { - throw new Error("Date string is not in RFC3339 format"); - } - const year = +matches[1]; - const month = +matches[2]; - const day = +matches[3]; - const hour = +matches[4]; - const minute = +matches[5]; - const second = +matches[6]; - // fractional seconds match either undefined or a string like ".1", ".123456789" - const milliSeconds = matches[7] ? Math.floor(+matches[7] * 1000) : 0; - let tzOffsetSign; - let tzOffsetHours; - let tzOffsetMinutes; - // if timezone is undefined, it must be Z or nothing (otherwise the group would have captured). - if (matches[8] === "Z") { - tzOffsetSign = 1; - tzOffsetHours = 0; - tzOffsetMinutes = 0; - } - else { - tzOffsetSign = matches[8].substring(0, 1) === "-" ? -1 : 1; - tzOffsetHours = +matches[8].substring(1, 3); - tzOffsetMinutes = +matches[8].substring(4, 6); - } - const tzOffset = tzOffsetSign * (tzOffsetHours * 60 + tzOffsetMinutes) * 60; // seconds - const date = new Date(); - date.setUTCFullYear(year, month - 1, day); - date.setUTCHours(hour, minute, second, milliSeconds); - return new Date(date.getTime() - tzOffset * 1000); -} -function toRfc3339(date) { - const year = date.getUTCFullYear(); - const month = padded(date.getUTCMonth() + 1); - const day = padded(date.getUTCDate()); - const hour = padded(date.getUTCHours()); - const minute = padded(date.getUTCMinutes()); - const second = padded(date.getUTCSeconds()); - const ms = padded(date.getUTCMilliseconds(), 3); - return `${year}-${month}-${day}T${hour}:${minute}:${second}.${ms}Z`; -} -//# sourceMappingURL=rfc3339.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/rfc3339.js.map b/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/rfc3339.js.map deleted file mode 100644 index c2b2f7ab..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/rfc3339.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rfc3339.js","sourceRoot":"","sources":["../src/rfc3339.ts"],"names":[],"mappings":";;AASA,kCAsCC;AAED,8BAUC;AAzDD,MAAM,cAAc,GAClB,yFAAyF,CAAC;AAE5F,SAAS,MAAM,CAAC,OAAe,EAAE,MAAM,GAAG,CAAC;IACzC,OAAO,OAAO,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAClD,CAAC;AAED,SAAgB,WAAW,CAAC,GAAW;IACrC,MAAM,OAAO,GAAG,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACzC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,C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AAC,aAAa,GAAG,EAAE,GAAG,eAAe,CAAC,GAAG,EAAE,CAAC,CAAC,UAAU;IAEvF,MAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;IACxB,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;IAC1C,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;IAErD,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,QAAQ,GAAG,IAAI,CAAC,CAAC;AACpD,CAAC;AAED,SAAgB,SAAS,CAAC,IAAyB;IACjD,MAAM,IAAI,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;IACnC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,CAAC;IAC7C,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;IACtC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;IACxC,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;IAC5C,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;IAC5C,MAAM,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC,CAAC;IAEhD,OAAO,GAAG,IAAI,IAAI,KAAK,IAAI,GAAG,IAAI,IAAI,IAAI,MAAM,IAAI,MAAM,IAAI,EAAE,GAAG,CAAC;AACtE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/utf8.d.ts b/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/utf8.d.ts deleted file mode 100644 index 8c66c1a6..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/utf8.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export declare function toUtf8(str: string): Uint8Array; -/** - * Takes UTF-8 data and decodes it to a string. - * - * In lossy mode, the [REPLACEMENT CHARACTER](https://en.wikipedia.org/wiki/Specials_(Unicode_block)) - * is used to substitute invalid encodings. - * By default lossy mode is off and invalid data will lead to exceptions. - */ -export declare function fromUtf8(data: Uint8Array, lossy?: boolean): string; diff --git a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/utf8.js b/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/utf8.js deleted file mode 100644 index 4b6c883f..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/utf8.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.toUtf8 = toUtf8; -exports.fromUtf8 = fromUtf8; -function toUtf8(str) { - return new TextEncoder().encode(str); -} -/** - * Takes UTF-8 data and decodes it to a string. - * - * In lossy mode, the [REPLACEMENT CHARACTER](https://en.wikipedia.org/wiki/Specials_(Unicode_block)) - * is used to substitute invalid encodings. - * By default lossy mode is off and invalid data will lead to exceptions. - */ -function fromUtf8(data, lossy = false) { - const fatal = !lossy; - return new TextDecoder("utf-8", { fatal }).decode(data); -} -//# sourceMappingURL=utf8.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/utf8.js.map b/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/utf8.js.map deleted file mode 100644 index 52a6ed87..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/encoding/build/utf8.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utf8.js","sourceRoot":"","sources":["../src/utf8.ts"],"names":[],"mappings":";;AAAA,wBAEC;AASD,4BAGC;AAdD,SAAgB,MAAM,CAAC,GAAW;IAChC,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AACvC,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,QAAQ,CAAC,IAAgB,EAAE,KAAK,GAAG,KAAK;IACtD,MAAM,KAAK,GAAG,CAAC,KAAK,CAAC;IACrB,OAAO,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAC1D,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/encoding/package.json b/tools/mnemonic-test/node_modules/@cosmjs/encoding/package.json deleted file mode 100644 index 04f71e5b..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/encoding/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "@cosmjs/encoding", - "version": "0.37.0", - "description": "Encoding helpers for blockchain projects", - "contributors": [ - "IOV SAS " - ], - "license": "Apache-2.0", - "exports": { - "types": "./build/index.d.ts", - "default": "./build/index.js" - }, - "files": [ - "build/", - "*.md", - "!*.spec.*", - "!**/testdata/" - ], - "repository": { - "type": "git", - "url": "https://github.com/cosmos/cosmjs/tree/main/packages/encoding" - }, - "publishConfig": { - "access": "public", - "registry": "https://registry.npmjs.org" - }, - "scripts": { - "docs": "typedoc", - "format": "prettier --write --log-level warn \"./src/**/*.ts\"", - "format-text": "prettier --write \"./*.md\"", - "test-node": "yarn node jasmine-testrunner.cjs", - "test-firefox": "yarn pack-web && karma start --single-run --browsers Firefox karma.conf.cjs", - "test-chrome": "yarn pack-web && karma start --single-run --browsers ChromeHeadless karma.conf.cjs", - "test": "yarn build-or-skip && yarn test-node", - "coverage": "nyc --reporter=text --reporter=lcov yarn test --quiet", - "build": "rm -rf ./build && tsc", - "build-or-skip": "[ -n \"${SKIP_BUILD:-}\" ] || yarn build", - "pack-web": "yarn build-or-skip && webpack --mode development --config webpack.web.config.cjs" - }, - "dependencies": { - "@scure/base": "^2.0.0", - "base64-js": "^1.3.0", - "readonly-date": "^1.0.0" - }, - "devDependencies": { - "@istanbuljs/nyc-config-typescript": "^1.0.1", - "@types/base64-js": "^1.2.5", - "@types/jasmine": "^4", - "@types/karma-firefox-launcher": "^2", - "@types/karma-jasmine": "^4", - "@types/karma-jasmine-html-reporter": "^1", - "@types/node": "*", - "glob": "^11", - "jasmine": "^4", - "jasmine-spec-reporter": "^6", - "karma": "^6.3.14", - "karma-chrome-launcher": "^3.1.0", - "karma-firefox-launcher": "^2.1.0", - "karma-jasmine": "^5", - "karma-jasmine-html-reporter": "^1.5.4", - "nyc": "^17.1.0", - "prettier": "^3.6.2", - "ses": "^1.13.0", - "source-map-support": "^0.5.19", - "typedoc": "^0.28", - "typescript": "~5.9", - "webpack": "^5.76.0", - "webpack-cli": "^4.6.0" - } -} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/math/README.md b/tools/mnemonic-test/node_modules/@cosmjs/math/README.md deleted file mode 100644 index 591ca23c..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/math/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# @cosmjs/math - -![typescript](https://img.shields.io/npm/types/@cosmjs/math.svg) -[![npm version](https://img.shields.io/npm/v/@cosmjs/math.svg)](https://www.npmjs.com/package/@cosmjs/math) -[![license](https://img.shields.io/npm/l/@cosmjs/math.svg)](https://github.com/cosmos/cosmjs/blob/v0.35.0/LICENSE) -![minimum node version](https://img.shields.io/node/v/@cosmjs/math.svg) -![minified size](https://img.shields.io/bundlephobia/min/@cosmjs/math.svg) -![monthly downloads](https://img.shields.io/npm/dm/@cosmjs/math.svg) - -## License - -This package is part of the cosmjs repository, licensed under the Apache License -2.0 (see [NOTICE](https://github.com/cosmos/cosmjs/blob/main/NOTICE) and -[LICENSE](https://github.com/cosmos/cosmjs/blob/main/LICENSE)). diff --git a/tools/mnemonic-test/node_modules/@cosmjs/math/build/decimal.d.ts b/tools/mnemonic-test/node_modules/@cosmjs/math/build/decimal.d.ts deleted file mode 100644 index ba3afbb9..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/math/build/decimal.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { Uint32, Uint53, Uint64 } from "./integers"; -/** - * A type for arbitrary precision, non-negative decimals. - * - * Instances of this class are immutable. - */ -export declare class Decimal { - static fromUserInput(input: string, fractionalDigits: number): Decimal; - static fromAtomics(atomics: string, fractionalDigits: number): Decimal; - /** - * Creates a Decimal with value 0.0 and the given number of fractional digits. - * - * Fractional digits are not relevant for the value but needed to be able - * to perform arithmetic operations with other decimals. - */ - static zero(fractionalDigits: number): Decimal; - /** - * Creates a Decimal with value 1.0 and the given number of fractional digits. - * - * Fractional digits are not relevant for the value but needed to be able - * to perform arithmetic operations with other decimals. - */ - static one(fractionalDigits: number): Decimal; - private static verifyFractionalDigits; - static compare(a: Decimal, b: Decimal): number; - get atomics(): string; - get fractionalDigits(): number; - private readonly data; - private constructor(); - /** Creates a new instance with the same value */ - private clone; - /** Returns the greatest decimal <= this which has no fractional part (rounding down) */ - floor(): Decimal; - /** Returns the smallest decimal >= this which has no fractional part (rounding up) */ - ceil(): Decimal; - toString(): string; - /** - * Returns an approximation as a float type. Only use this if no - * exact calculation is required. - */ - toFloatApproximation(): number; - /** - * a.plus(b) returns a+b. - * - * Both values need to have the same fractional digits. - */ - plus(b: Decimal): Decimal; - /** - * a.minus(b) returns a-b. - * - * Both values need to have the same fractional digits. - * The resulting difference needs to be non-negative. - */ - minus(b: Decimal): Decimal; - /** - * a.multiply(b) returns a*b. - * - * We only allow multiplication by unsigned integers to avoid rounding errors. - */ - multiply(b: Uint32 | Uint53 | Uint64): Decimal; - equals(b: Decimal): boolean; - isLessThan(b: Decimal): boolean; - isLessThanOrEqual(b: Decimal): boolean; - isGreaterThan(b: Decimal): boolean; - isGreaterThanOrEqual(b: Decimal): boolean; -} diff --git a/tools/mnemonic-test/node_modules/@cosmjs/math/build/decimal.js b/tools/mnemonic-test/node_modules/@cosmjs/math/build/decimal.js deleted file mode 100644 index 26f43ba6..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/math/build/decimal.js +++ /dev/null @@ -1,214 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Decimal = void 0; -// Too large values lead to massive memory usage. Limit to something sensible. -// The largest value we need is 18 (Ether). -const maxFractionalDigits = 100; -/** - * A type for arbitrary precision, non-negative decimals. - * - * Instances of this class are immutable. - */ -class Decimal { - static fromUserInput(input, fractionalDigits) { - Decimal.verifyFractionalDigits(fractionalDigits); - const badCharacter = input.match(/[^0-9.]/); - if (badCharacter) { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - throw new Error(`Invalid character at position ${badCharacter.index + 1}`); - } - let whole; - let fractional; - if (input === "") { - whole = "0"; - fractional = ""; - } - else if (input.search(/\./) === -1) { - // integer format, no separator - whole = input; - fractional = ""; - } - else { - const parts = input.split("."); - switch (parts.length) { - case 0: - case 1: - throw new Error("Fewer than two elements in split result. This must not happen here."); - case 2: - if (!parts[1]) - throw new Error("Fractional part missing"); - whole = parts[0]; - fractional = parts[1].replace(/0+$/, ""); - break; - default: - throw new Error("More than one separator found"); - } - } - if (fractional.length > fractionalDigits) { - throw new Error("Got more fractional digits than supported"); - } - const quantity = `${whole}${fractional.padEnd(fractionalDigits, "0")}`; - return new Decimal(quantity, fractionalDigits); - } - static fromAtomics(atomics, fractionalDigits) { - Decimal.verifyFractionalDigits(fractionalDigits); - return new Decimal(atomics, fractionalDigits); - } - /** - * Creates a Decimal with value 0.0 and the given number of fractional digits. - * - * Fractional digits are not relevant for the value but needed to be able - * to perform arithmetic operations with other decimals. - */ - static zero(fractionalDigits) { - Decimal.verifyFractionalDigits(fractionalDigits); - return new Decimal("0", fractionalDigits); - } - /** - * Creates a Decimal with value 1.0 and the given number of fractional digits. - * - * Fractional digits are not relevant for the value but needed to be able - * to perform arithmetic operations with other decimals. - */ - static one(fractionalDigits) { - Decimal.verifyFractionalDigits(fractionalDigits); - return new Decimal("1" + "0".repeat(fractionalDigits), fractionalDigits); - } - static verifyFractionalDigits(fractionalDigits) { - if (!Number.isInteger(fractionalDigits)) - throw new Error("Fractional digits is not an integer"); - if (fractionalDigits < 0) - throw new Error("Fractional digits must not be negative"); - if (fractionalDigits > maxFractionalDigits) { - throw new Error(`Fractional digits must not exceed ${maxFractionalDigits}`); - } - } - static compare(a, b) { - if (a.fractionalDigits !== b.fractionalDigits) - throw new Error("Fractional digits do not match"); - const difference = a.data.atomics - b.data.atomics; - if (difference < 0n) - return -1; - if (difference > 0n) - return 1; - return 0; - } - get atomics() { - return this.data.atomics.toString(); - } - get fractionalDigits() { - return this.data.fractionalDigits; - } - data; - constructor(atomics, fractionalDigits) { - if (!atomics.match(/^[0-9]+$/)) { - throw new Error("Invalid string format. Only non-negative integers in decimal representation supported."); - } - this.data = { - atomics: BigInt(atomics), - fractionalDigits: fractionalDigits, - }; - } - /** Creates a new instance with the same value */ - clone() { - return new Decimal(this.atomics, this.fractionalDigits); - } - /** Returns the greatest decimal <= this which has no fractional part (rounding down) */ - floor() { - const factor = 10n ** BigInt(this.data.fractionalDigits); - const whole = this.data.atomics / factor; - const fractional = this.data.atomics % factor; - if (fractional === 0n) { - return this.clone(); - } - else { - return Decimal.fromAtomics((whole * factor).toString(), this.fractionalDigits); - } - } - /** Returns the smallest decimal >= this which has no fractional part (rounding up) */ - ceil() { - const factor = 10n ** BigInt(this.data.fractionalDigits); - const whole = this.data.atomics / factor; - const fractional = this.data.atomics % factor; - if (fractional === 0n) { - return this.clone(); - } - else { - return Decimal.fromAtomics(((whole + 1n) * factor).toString(), this.fractionalDigits); - } - } - toString() { - const factor = 10n ** BigInt(this.data.fractionalDigits); - const whole = this.data.atomics / factor; - const fractional = this.data.atomics % factor; - if (fractional === 0n) { - return whole.toString(); - } - else { - const fullFractionalPart = fractional.toString().padStart(this.data.fractionalDigits, "0"); - const trimmedFractionalPart = fullFractionalPart.replace(/0+$/, ""); - return `${whole.toString()}.${trimmedFractionalPart}`; - } - } - /** - * Returns an approximation as a float type. Only use this if no - * exact calculation is required. - */ - toFloatApproximation() { - const out = Number(this.toString()); - if (Number.isNaN(out)) - throw new Error("Conversion to number failed"); - return out; - } - /** - * a.plus(b) returns a+b. - * - * Both values need to have the same fractional digits. - */ - plus(b) { - if (this.fractionalDigits !== b.fractionalDigits) - throw new Error("Fractional digits do not match"); - const sum = this.data.atomics + b.data.atomics; - return new Decimal(sum.toString(), this.fractionalDigits); - } - /** - * a.minus(b) returns a-b. - * - * Both values need to have the same fractional digits. - * The resulting difference needs to be non-negative. - */ - minus(b) { - if (this.fractionalDigits !== b.fractionalDigits) - throw new Error("Fractional digits do not match"); - const difference = this.data.atomics - b.data.atomics; - if (difference < 0n) - throw new Error("Difference must not be negative"); - return new Decimal(difference.toString(), this.fractionalDigits); - } - /** - * a.multiply(b) returns a*b. - * - * We only allow multiplication by unsigned integers to avoid rounding errors. - */ - multiply(b) { - const product = this.data.atomics * b.toBigInt(); - return new Decimal(product.toString(), this.fractionalDigits); - } - equals(b) { - return Decimal.compare(this, b) === 0; - } - isLessThan(b) { - return Decimal.compare(this, b) < 0; - } - isLessThanOrEqual(b) { - return Decimal.compare(this, b) <= 0; - } - isGreaterThan(b) { - return Decimal.compare(this, b) > 0; - } - isGreaterThanOrEqual(b) { - return Decimal.compare(this, b) >= 0; - } -} -exports.Decimal = Decimal; -//# sourceMappingURL=decimal.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/math/build/decimal.js.map b/tools/mnemonic-test/node_modules/@cosmjs/math/build/decimal.js.map deleted file mode 100644 index cb4373af..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/math/build/decimal.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decimal.js","sourceRoot":"","sources":["../src/decimal.ts"],"names":[],"mappings":";;;AAEA,8EAA8E;AAC9E,2CAA2C;AAC3C,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEhC;;;;GAIG;AACH,MAAa,OAAO;IACX,MAAM,CAAC,aAAa,CAAC,KAAa,EAAE,gBAAwB;QACjE,OAAO,CAAC,sBAAsB,CAA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AQ,CAAC,CAA2B;QACzC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC;QACjD,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAChE,CAAC;IAEM,MAAM,CAAC,CAAU;QACtB,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;IAEM,UAAU,CAAC,CAAU;QAC1B,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;IACtC,CAAC;IAEM,iBAAiB,CAAC,CAAU;QACjC,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IAEM,aAAa,CAAC,CAAU;QAC7B,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;IACtC,CAAC;IAEM,oBAAoB,CAAC,CAAU;QACpC,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;CACF;AA9ND,0BA8NC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/math/build/index.d.ts b/tools/mnemonic-test/node_modules/@cosmjs/math/build/index.d.ts deleted file mode 100644 index b888136f..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/math/build/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { Decimal } from "./decimal"; -export { Int53, Uint32, Uint53, Uint64 } from "./integers"; diff --git a/tools/mnemonic-test/node_modules/@cosmjs/math/build/index.js b/tools/mnemonic-test/node_modules/@cosmjs/math/build/index.js deleted file mode 100644 index 1f812f63..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/math/build/index.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Uint64 = exports.Uint53 = exports.Uint32 = exports.Int53 = exports.Decimal = void 0; -var decimal_1 = require("./decimal"); -Object.defineProperty(exports, "Decimal", { enumerable: true, get: function () { return decimal_1.Decimal; } }); -var integers_1 = require("./integers"); -Object.defineProperty(exports, "Int53", { enumerable: true, get: function () { return integers_1.Int53; } }); -Object.defineProperty(exports, "Uint32", { enumerable: true, get: function () { return integers_1.Uint32; } }); -Object.defineProperty(exports, "Uint53", { enumerable: true, get: function () { return integers_1.Uint53; } }); -Object.defineProperty(exports, "Uint64", { enumerable: true, get: function () { return integers_1.Uint64; } }); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/math/build/index.js.map b/tools/mnemonic-test/node_modules/@cosmjs/math/build/index.js.map deleted file mode 100644 index 5a0926b2..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/math/build/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qCAAoC;AAA3B,kGAAA,OAAO,OAAA;AAChB,uCAA2D;AAAlD,iGAAA,KAAK,OAAA;AAAE,kGAAA,MAAM,OAAA;AAAE,kGAAA,MAAM,OAAA;AAAE,kGAAA,MAAM,OAAA"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/math/build/integers.d.ts b/tools/mnemonic-test/node_modules/@cosmjs/math/build/integers.d.ts deleted file mode 100644 index 22e1e8e5..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/math/build/integers.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -/** Internal interface to ensure all integer types can be used equally */ -interface Integer { - readonly toNumber: () => number; - readonly toBigInt: () => bigint; - readonly toString: () => string; -} -interface WithByteConverters { - readonly toBytesBigEndian: () => Uint8Array; - readonly toBytesLittleEndian: () => Uint8Array; -} -export declare class Uint32 implements Integer, WithByteConverters { - /** @deprecated use Uint32.fromBytes */ - static fromBigEndianBytes(bytes: ArrayLike): Uint32; - /** - * Creates a Uint32 from a fixed length byte array. - * - * @param bytes a list of exactly 4 bytes - * @param endianness defaults to big endian - */ - static fromBytes(bytes: ArrayLike, endianness?: "be" | "le"): Uint32; - static fromString(str: string): Uint32; - protected readonly data: number; - constructor(input: number); - toBytesBigEndian(): Uint8Array; - toBytesLittleEndian(): Uint8Array; - toNumber(): number; - toBigInt(): bigint; - toString(): string; -} -export declare class Int53 implements Integer { - static fromString(str: string): Int53; - protected readonly data: number; - constructor(input: number); - toNumber(): number; - toBigInt(): bigint; - toString(): string; -} -export declare class Uint53 implements Integer { - static fromString(str: string): Uint53; - protected readonly data: Int53; - constructor(input: number); - toNumber(): number; - toBigInt(): bigint; - toString(): string; -} -export declare class Uint64 implements Integer, WithByteConverters { - /** @deprecated use Uint64.fromBytes */ - static fromBytesBigEndian(bytes: ArrayLike): Uint64; - /** - * Creates a Uint64 from a fixed length byte array. - * - * @param bytes a list of exactly 8 bytes - * @param endianness defaults to big endian - */ - static fromBytes(bytes: ArrayLike, endianness?: "be" | "le"): Uint64; - static fromString(str: string): Uint64; - static fromNumber(input: number): Uint64; - private readonly data; - private constructor(); - toBytesBigEndian(): Uint8Array; - toBytesLittleEndian(): Uint8Array; - toString(): string; - toBigInt(): bigint; - toNumber(): number; -} -export {}; diff --git a/tools/mnemonic-test/node_modules/@cosmjs/math/build/integers.js b/tools/mnemonic-test/node_modules/@cosmjs/math/build/integers.js deleted file mode 100644 index a1f28ec5..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/math/build/integers.js +++ /dev/null @@ -1,224 +0,0 @@ -"use strict"; -/* eslint-disable no-bitwise */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Uint64 = exports.Uint53 = exports.Int53 = exports.Uint32 = void 0; -const uint64MaxValue = 18446744073709551615n; -class Uint32 { - /** @deprecated use Uint32.fromBytes */ - static fromBigEndianBytes(bytes) { - return Uint32.fromBytes(bytes); - } - /** - * Creates a Uint32 from a fixed length byte array. - * - * @param bytes a list of exactly 4 bytes - * @param endianness defaults to big endian - */ - static fromBytes(bytes, endianness = "be") { - if (bytes.length !== 4) { - throw new Error("Invalid input length. Expected 4 bytes."); - } - for (let i = 0; i < bytes.length; ++i) { - if (!Number.isInteger(bytes[i]) || bytes[i] > 255 || bytes[i] < 0) { - throw new Error(`Invalid value in byte. Found: ${bytes[i]}`); - } - } - const beBytes = endianness === "be" ? bytes : Array.from(bytes).reverse(); - // Use multiplication instead of shifting since bitwise operators are defined - // on SIGNED int32 in JavaScript and we don't want to risk surprises - return new Uint32(beBytes[0] * 2 ** 24 + beBytes[1] * 2 ** 16 + beBytes[2] * 2 ** 8 + beBytes[3]); - } - static fromString(str) { - if (!str.match(/^[0-9]+$/)) { - throw new Error("Invalid string format"); - } - return new Uint32(Number.parseInt(str, 10)); - } - data; - constructor(input) { - if (Number.isNaN(input)) { - throw new Error("Input is not a number"); - } - if (!Number.isInteger(input)) { - throw new Error("Input is not an integer"); - } - if (input < 0 || input > 4294967295) { - throw new Error("Input not in uint32 range: " + input.toString()); - } - this.data = input; - } - toBytesBigEndian() { - // Use division instead of shifting since bitwise operators are defined - // on SIGNED int32 in JavaScript and we don't want to risk surprises - return new Uint8Array([ - Math.floor(this.data / 2 ** 24) & 0xff, - Math.floor(this.data / 2 ** 16) & 0xff, - Math.floor(this.data / 2 ** 8) & 0xff, - Math.floor(this.data / 2 ** 0) & 0xff, - ]); - } - toBytesLittleEndian() { - // Use division instead of shifting since bitwise operators are defined - // on SIGNED int32 in JavaScript and we don't want to risk surprises - return new Uint8Array([ - Math.floor(this.data / 2 ** 0) & 0xff, - Math.floor(this.data / 2 ** 8) & 0xff, - Math.floor(this.data / 2 ** 16) & 0xff, - Math.floor(this.data / 2 ** 24) & 0xff, - ]); - } - toNumber() { - return this.data; - } - toBigInt() { - return BigInt(this.toNumber()); - } - toString() { - return this.data.toString(); - } -} -exports.Uint32 = Uint32; -class Int53 { - static fromString(str) { - if (!str.match(/^-?[0-9]+$/)) { - throw new Error("Invalid string format"); - } - return new Int53(Number.parseInt(str, 10)); - } - data; - constructor(input) { - if (Number.isNaN(input)) { - throw new Error("Input is not a number"); - } - if (!Number.isInteger(input)) { - throw new Error("Input is not an integer"); - } - if (input < Number.MIN_SAFE_INTEGER || input > Number.MAX_SAFE_INTEGER) { - throw new Error("Input not in int53 range: " + input.toString()); - } - this.data = input; - } - toNumber() { - return this.data; - } - toBigInt() { - return BigInt(this.toNumber()); - } - toString() { - return this.data.toString(); - } -} -exports.Int53 = Int53; -class Uint53 { - static fromString(str) { - const signed = Int53.fromString(str); - return new Uint53(signed.toNumber()); - } - data; - constructor(input) { - const signed = new Int53(input); - if (signed.toNumber() < 0) { - throw new Error("Input is negative"); - } - this.data = signed; - } - toNumber() { - return this.data.toNumber(); - } - toBigInt() { - return BigInt(this.toNumber()); - } - toString() { - return this.data.toString(); - } -} -exports.Uint53 = Uint53; -class Uint64 { - /** @deprecated use Uint64.fromBytes */ - static fromBytesBigEndian(bytes) { - return Uint64.fromBytes(bytes); - } - /** - * Creates a Uint64 from a fixed length byte array. - * - * @param bytes a list of exactly 8 bytes - * @param endianness defaults to big endian - */ - static fromBytes(bytes, endianness = "be") { - if (bytes.length !== 8) { - throw new Error("Invalid input length. Expected 8 bytes."); - } - const beBytes = endianness === "be" ? Array.from(bytes) : Array.from(bytes).reverse(); - let value = 0n; - for (const byte of beBytes) { - value *= 256n; - if (!Number.isInteger(byte) || byte > 255 || byte < 0) { - throw new Error(`Invalid value in byte. Found: ${byte}`); - } - value += BigInt(byte); - } - return new Uint64(value); - } - static fromString(str) { - if (!str.match(/^[0-9]+$/)) { - throw new Error("Invalid string format"); - } - return new Uint64(BigInt(str)); - } - static fromNumber(input) { - if (Number.isNaN(input)) { - throw new Error("Input is not a number"); - } - if (!Number.isInteger(input)) { - throw new Error("Input is not an integer"); - } - if (!Number.isSafeInteger(input)) { - throw new Error("Input is not a safe integer"); - } - const bigint = BigInt(input); - return new Uint64(bigint); - } - data; - constructor(data) { - if (data < 0n) { - throw new Error("Input is negative"); - } - if (data > uint64MaxValue) { - throw new Error("Input exceeds uint64 range"); - } - this.data = data; - } - toBytesBigEndian() { - return this.toBytesLittleEndian().reverse(); - } - toBytesLittleEndian() { - const bytes = new Uint8Array(8); - let value = this.data; - for (let i = 0; i < bytes.length; i++) { - bytes[i] = Number(value % 256n); - value /= 256n; - } - return bytes; - } - toString() { - return this.data.toString(10); - } - toBigInt() { - return this.data; - } - toNumber() { - if (this.data > BigInt(Number.MAX_SAFE_INTEGER)) { - throw new Error("number can only safely store up to 53 bits"); - } - const num = Number(this.data); - return num; - } -} -exports.Uint64 = Uint64; -// Assign classes to unused variables in order to verify static interface conformance at compile time. -// Workaround for https://github.com/microsoft/TypeScript/issues/33892 -const _int53Class = Int53; -const _uint53Class = Uint53; -const _uint32Class = Uint32; -const _uint64Class = Uint64; -//# sourceMappingURL=integers.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/math/build/integers.js.map b/tools/mnemonic-test/node_modules/@cosmjs/math/build/integers.js.map deleted file mode 100644 index 7656ae00..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/math/build/integers.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"integers.js","sourceRoot":"","sources":["../src/integers.ts"],"names":[],"mappings":";AAAA,+BAA+B;;;AAE/B,MAAM,cAAc,GAAG,qBAAqB,CAAC;AAsB7C,MAAa,MAAM;IACjB,uCAAuC;IAChC,MAAM,CAAC,kBAAkB,CAAC,KAAwB;QACvD,OAAO,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,SAAS,CAAC,KAAwB,EAAE,aAA0B,IAAI;QAC9E,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,yCAA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MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9B,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AAjGD,wBAiGC;AAED,sGAAsG;AACtG,sEAAsE;AACtE,MAAM,WAAW,GAAyB,KAAK,CAAC;AAChD,MAAM,YAAY,GAA0B,MAAM,CAAC;AACnD,MAAM,YAAY,GAA6D,MAAM,CAAC;AACtF,MAAM,YAAY,GAA6D,MAAM,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/math/package.json b/tools/mnemonic-test/node_modules/@cosmjs/math/package.json deleted file mode 100644 index 900e3cf8..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/math/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "@cosmjs/math", - "version": "0.37.0", - "description": "Math helpers for blockchain projects", - "contributors": [ - "IOV SAS " - ], - "license": "Apache-2.0", - "exports": { - "types": "./build/index.d.ts", - "default": "./build/index.js" - }, - "files": [ - "build/", - "*.md", - "!*.spec.*", - "!**/testdata/" - ], - "repository": { - "type": "git", - "url": "https://github.com/cosmos/cosmjs/tree/main/packages/math" - }, - "publishConfig": { - "access": "public", - "registry": "https://registry.npmjs.org" - }, - "scripts": { - "docs": "typedoc", - "format": "prettier --write --log-level warn \"./src/**/*.ts\"", - "format-text": "prettier --write \"./*.md\"", - "test-node": "yarn node jasmine-testrunner.cjs", - "test-firefox": "yarn pack-web && karma start --single-run --browsers Firefox karma.conf.cjs", - "test-chrome": "yarn pack-web && karma start --single-run --browsers ChromeHeadless karma.conf.cjs", - "test": "yarn build-or-skip && yarn test-node", - "coverage": "nyc --reporter=text --reporter=lcov yarn test --quiet", - "build": "rm -rf ./build && tsc", - "build-or-skip": "[ -n \"${SKIP_BUILD:-}\" ] || yarn build", - "pack-web": "yarn build-or-skip && webpack --mode development --config webpack.web.config.cjs" - }, - "devDependencies": { - "@istanbuljs/nyc-config-typescript": "^1.0.1", - "@types/jasmine": "^4", - "@types/karma-firefox-launcher": "^2", - "@types/karma-jasmine": "^4", - "@types/karma-jasmine-html-reporter": "^1", - "glob": "^11", - "jasmine": "^4", - "jasmine-spec-reporter": "^6", - "karma": "^6.3.14", - "karma-chrome-launcher": "^3.1.0", - "karma-firefox-launcher": "^2.1.0", - "karma-jasmine": "^5", - "karma-jasmine-html-reporter": "^1.5.4", - "nyc": "^17.1.0", - "prettier": "^3.6.2", - "ses": "^1.13.0", - "source-map-support": "^0.5.19", - "typedoc": "^0.28", - "typescript": "~5.9", - "webpack": "^5.76.0", - "webpack-cli": "^4.6.0" - } -} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/utils/README.md b/tools/mnemonic-test/node_modules/@cosmjs/utils/README.md deleted file mode 100644 index e868932e..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/utils/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# @cosmjs/utils - -![typescript](https://img.shields.io/npm/types/@cosmjs/utils.svg) -[![npm version](https://img.shields.io/npm/v/@cosmjs/utils.svg)](https://www.npmjs.com/package/@cosmjs/utils) -[![license](https://img.shields.io/npm/l/@cosmjs/utils.svg)](https://github.com/cosmos/cosmjs/blob/v0.35.0/LICENSE) -![minimum node version](https://img.shields.io/node/v/@cosmjs/utils.svg) -![minified size](https://img.shields.io/bundlephobia/min/@cosmjs/utils.svg) -![monthly downloads](https://img.shields.io/npm/dm/@cosmjs/utils.svg) - -Utility functions independent of blockchain applications. Primarily used for -testing but stuff like `sleep` can also be useful at runtime. - -## License - -This package is part of the cosmjs repository, licensed under the Apache License -2.0 (see [NOTICE](https://github.com/cosmos/cosmjs/blob/main/NOTICE) and -[LICENSE](https://github.com/cosmos/cosmjs/blob/main/LICENSE)). diff --git a/tools/mnemonic-test/node_modules/@cosmjs/utils/build/arrays.d.ts b/tools/mnemonic-test/node_modules/@cosmjs/utils/build/arrays.d.ts deleted file mode 100644 index b2017871..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/utils/build/arrays.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Compares the content of two arrays-like objects for equality. - * - * Equality is defined as having equal length and element values, where element equality means `===` returning `true`. - * - * This allows you to compare the content of a Buffer, Uint8Array or number[], ignoring the specific type. - * As a consequence, this returns different results than Jasmine's `toEqual`, which ensures elements have the same type. - */ -export declare function arrayContentEquals(a: ArrayLike, b: ArrayLike): boolean; -/** - * Checks if `a` starts with the contents of `b`. - * - * This requires equality of the element values, where element equality means `===` returning `true`. - * - * This allows you to compare the content of a Buffer, Uint8Array or number[], ignoring the specific type. - * As a consequence, this returns different results than Jasmine's `toEqual`, which ensures elements have the same type. - */ -export declare function arrayContentStartsWith(a: ArrayLike, b: ArrayLike): boolean; diff --git a/tools/mnemonic-test/node_modules/@cosmjs/utils/build/arrays.js b/tools/mnemonic-test/node_modules/@cosmjs/utils/build/arrays.js deleted file mode 100644 index 5216f299..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/utils/build/arrays.js +++ /dev/null @@ -1,39 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.arrayContentEquals = arrayContentEquals; -exports.arrayContentStartsWith = arrayContentStartsWith; -/** - * Compares the content of two arrays-like objects for equality. - * - * Equality is defined as having equal length and element values, where element equality means `===` returning `true`. - * - * This allows you to compare the content of a Buffer, Uint8Array or number[], ignoring the specific type. - * As a consequence, this returns different results than Jasmine's `toEqual`, which ensures elements have the same type. - */ -function arrayContentEquals(a, b) { - if (a.length !== b.length) - return false; - for (let i = 0; i < a.length; ++i) { - if (a[i] !== b[i]) - return false; - } - return true; -} -/** - * Checks if `a` starts with the contents of `b`. - * - * This requires equality of the element values, where element equality means `===` returning `true`. - * - * This allows you to compare the content of a Buffer, Uint8Array or number[], ignoring the specific type. - * As a consequence, this returns different results than Jasmine's `toEqual`, which ensures elements have the same type. - */ -function arrayContentStartsWith(a, b) { - if (a.length < b.length) - return false; - for (let i = 0; i < b.length; ++i) { - if (a[i] !== b[i]) - return false; - } - return true; -} -//# sourceMappingURL=arrays.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/utils/build/arrays.js.map b/tools/mnemonic-test/node_modules/@cosmjs/utils/build/arrays.js.map deleted file mode 100644 index 0355d1e6..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/utils/build/arrays.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"arrays.js","sourceRoot":"","sources":["../src/arrays.ts"],"names":[],"mappings":";;AAQA,gDASC;AAUD,wDASC;AApCD;;;;;;;GAOG;AACH,SAAgB,kBAAkB,CAChC,CAAe,EACf,CAAe;IAEf,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IACxC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC;QAClC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAAE,OAAO,KAAK,CAAC;IAClC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,sBAAsB,CACpC,CAAe,EACf,CAAe;IAEf,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IACtC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC;QAClC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAAE,OAAO,KAAK,CAAC;IAClC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/utils/build/assert.d.ts b/tools/mnemonic-test/node_modules/@cosmjs/utils/build/assert.d.ts deleted file mode 100644 index 428d5b48..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/utils/build/assert.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare function assert(condition: any, msg?: string): asserts condition; -export declare function assertDefined(value: T | undefined, msg?: string): asserts value is T; -export declare function assertDefinedAndNotNull(value: T | undefined | null, msg?: string): asserts value is T; diff --git a/tools/mnemonic-test/node_modules/@cosmjs/utils/build/assert.js b/tools/mnemonic-test/node_modules/@cosmjs/utils/build/assert.js deleted file mode 100644 index fd34e2e7..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/utils/build/assert.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.assert = assert; -exports.assertDefined = assertDefined; -exports.assertDefinedAndNotNull = assertDefinedAndNotNull; -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types -function assert(condition, msg) { - if (!condition) { - throw new Error(msg || "condition is not truthy"); - } -} -function assertDefined(value, msg) { - if (value === undefined) { - throw new Error(msg ?? "value is undefined"); - } -} -function assertDefinedAndNotNull(value, msg) { - if (value === undefined || value === null) { - throw new Error(msg ?? "value is undefined or null"); - } -} -//# sourceMappingURL=assert.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/utils/build/assert.js.map b/tools/mnemonic-test/node_modules/@cosmjs/utils/build/assert.js.map deleted file mode 100644 index 57a15996..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/utils/build/assert.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"assert.js","sourceRoot":"","sources":["../src/assert.ts"],"names":[],"mappings":";;AACA,wBAIC;AAED,sCAIC;AAED,0DAIC;AAjBD,6EAA6E;AAC7E,SAAgB,MAAM,CAAC,SAAc,EAAE,GAAY;IACjD,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,yBAAyB,CAAC,CAAC;IACpD,CAAC;AACH,CAAC;AAED,SAAgB,aAAa,CAAI,KAAoB,EAAE,GAAY;IACjE,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,oBAAoB,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC;AAED,SAAgB,uBAAuB,CAAI,KAA2B,EAAE,GAAY;IAClF,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAC1C,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,4BAA4B,CAAC,CAAC;IACvD,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/utils/build/index.d.ts b/tools/mnemonic-test/node_modules/@cosmjs/utils/build/index.d.ts deleted file mode 100644 index 62434818..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/utils/build/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { arrayContentEquals, arrayContentStartsWith } from "./arrays"; -export { assert, assertDefined, assertDefinedAndNotNull } from "./assert"; -export { sleep } from "./sleep"; -export { isDefined, isNonNullObject, isUint8Array } from "./typechecks"; diff --git a/tools/mnemonic-test/node_modules/@cosmjs/utils/build/index.js b/tools/mnemonic-test/node_modules/@cosmjs/utils/build/index.js deleted file mode 100644 index 8888737f..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/utils/build/index.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.isUint8Array = exports.isNonNullObject = exports.isDefined = exports.sleep = exports.assertDefinedAndNotNull = exports.assertDefined = exports.assert = exports.arrayContentStartsWith = exports.arrayContentEquals = void 0; -var arrays_1 = require("./arrays"); -Object.defineProperty(exports, "arrayContentEquals", { enumerable: true, get: function () { return arrays_1.arrayContentEquals; } }); -Object.defineProperty(exports, "arrayContentStartsWith", { enumerable: true, get: function () { return arrays_1.arrayContentStartsWith; } }); -var assert_1 = require("./assert"); -Object.defineProperty(exports, "assert", { enumerable: true, get: function () { return assert_1.assert; } }); -Object.defineProperty(exports, "assertDefined", { enumerable: true, get: function () { return assert_1.assertDefined; } }); -Object.defineProperty(exports, "assertDefinedAndNotNull", { enumerable: true, get: function () { return assert_1.assertDefinedAndNotNull; } }); -var sleep_1 = require("./sleep"); -Object.defineProperty(exports, "sleep", { enumerable: true, get: function () { return sleep_1.sleep; } }); -var typechecks_1 = require("./typechecks"); -Object.defineProperty(exports, "isDefined", { enumerable: true, get: function () { return typechecks_1.isDefined; } }); -Object.defineProperty(exports, "isNonNullObject", { enumerable: true, get: function () { return typechecks_1.isNonNullObject; } }); -Object.defineProperty(exports, "isUint8Array", { enumerable: true, get: function () { return typechecks_1.isUint8Array; } }); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/utils/build/index.js.map b/tools/mnemonic-test/node_modules/@cosmjs/utils/build/index.js.map deleted file mode 100644 index 1bfe43e1..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/utils/build/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mCAAsE;AAA7D,4GAAA,kBAAkB,OAAA;AAAE,gHAAA,sBAAsB,OAAA;AACnD,mCAA0E;AAAjE,gGAAA,MAAM,OAAA;AAAE,uGAAA,aAAa,OAAA;AAAE,iHAAA,uBAAuB,OAAA;AACvD,iCAAgC;AAAvB,8FAAA,KAAK,OAAA;AACd,2CAAwE;AAA/D,uGAAA,SAAS,OAAA;AAAE,6GAAA,eAAe,OAAA;AAAE,0GAAA,YAAY,OAAA"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/utils/build/sleep.d.ts b/tools/mnemonic-test/node_modules/@cosmjs/utils/build/sleep.d.ts deleted file mode 100644 index deb121ba..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/utils/build/sleep.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function sleep(ms: number): Promise; diff --git a/tools/mnemonic-test/node_modules/@cosmjs/utils/build/sleep.js b/tools/mnemonic-test/node_modules/@cosmjs/utils/build/sleep.js deleted file mode 100644 index 71d97cdd..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/utils/build/sleep.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.sleep = sleep; -async function sleep(ms) { - return new Promise((resolve) => setTimeout(resolve, ms)); -} -//# sourceMappingURL=sleep.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/utils/build/sleep.js.map b/tools/mnemonic-test/node_modules/@cosmjs/utils/build/sleep.js.map deleted file mode 100644 index 0209d991..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/utils/build/sleep.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sleep.js","sourceRoot":"","sources":["../src/sleep.ts"],"names":[],"mappings":";;AAAA,sBAEC;AAFM,KAAK,UAAU,KAAK,CAAC,EAAU;IACpC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/utils/build/typechecks.d.ts b/tools/mnemonic-test/node_modules/@cosmjs/utils/build/typechecks.d.ts deleted file mode 100644 index d33cb9b7..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/utils/build/typechecks.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Checks if data is a non-null object (i.e. matches the TypeScript object type). - * - * Note: this returns true for arrays, which are objects in JavaScript - * even though array and object are different types in JSON. - * - * @see https://www.typescriptlang.org/docs/handbook/basic-types.html#object - */ -export declare function isNonNullObject(data: unknown): data is object; -/** - * Checks if data is an Uint8Array. Note: Buffer is treated as not a Uint8Array - */ -export declare function isUint8Array(data: unknown): data is Uint8Array; -/** - * Checks if input is not undefined in a TypeScript-friendly way. - * - * This is convenient to use in e.g. `Array.filter` as it will convert - * the type of a `Array` to `Array`. - */ -export declare function isDefined(value: X | undefined): value is X; diff --git a/tools/mnemonic-test/node_modules/@cosmjs/utils/build/typechecks.js b/tools/mnemonic-test/node_modules/@cosmjs/utils/build/typechecks.js deleted file mode 100644 index ab8248ef..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/utils/build/typechecks.js +++ /dev/null @@ -1,44 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.isNonNullObject = isNonNullObject; -exports.isUint8Array = isUint8Array; -exports.isDefined = isDefined; -/** - * Checks if data is a non-null object (i.e. matches the TypeScript object type). - * - * Note: this returns true for arrays, which are objects in JavaScript - * even though array and object are different types in JSON. - * - * @see https://www.typescriptlang.org/docs/handbook/basic-types.html#object - */ -function isNonNullObject(data) { - return typeof data === "object" && data !== null; -} -/** - * Checks if data is an Uint8Array. Note: Buffer is treated as not a Uint8Array - */ -function isUint8Array(data) { - if (!isNonNullObject(data)) - return false; - // Avoid instanceof check which is unreliable in some JS environments - // https://medium.com/@simonwarta/limitations-of-the-instanceof-operator-f4bcdbe7a400 - // Use check that was discussed in https://github.com/crypto-browserify/pbkdf2/pull/81 - if (Object.prototype.toString.call(data) !== "[object Uint8Array]") - return false; - if (typeof Buffer !== "undefined" && typeof Buffer.isBuffer !== "undefined") { - // Buffer.isBuffer is available at runtime - if (Buffer.isBuffer(data)) - return false; - } - return true; -} -/** - * Checks if input is not undefined in a TypeScript-friendly way. - * - * This is convenient to use in e.g. `Array.filter` as it will convert - * the type of a `Array` to `Array`. - */ -function isDefined(value) { - return value !== undefined; -} -//# sourceMappingURL=typechecks.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/utils/build/typechecks.js.map b/tools/mnemonic-test/node_modules/@cosmjs/utils/build/typechecks.js.map deleted file mode 100644 index c0b42d3d..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/utils/build/typechecks.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"typechecks.js","sourceRoot":"","sources":["../src/typechecks.ts"],"names":[],"mappings":";;AAQA,0CAEC;AAKD,oCAeC;AAQD,8BAEC;AAxCD;;;;;;;GAOG;AACH,SAAgB,eAAe,CAAC,IAAa;IAC3C,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,CAAC;AACnD,CAAC;AAED;;GAEG;AACH,SAAgB,YAAY,CAAC,IAAa;IACxC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IAEzC,qEAAqE;IACrE,qFAAqF;IAErF,sFAAsF;IACtF,IAAI,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,qBAAqB;QAAE,OAAO,KAAK,CAAC;IAEjF,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,QAAQ,KAAK,WAAW,EAAE,CAAC;QAC5E,0CAA0C;QAC1C,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;YAAE,OAAO,KAAK,CAAC;IAC1C,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,SAAgB,SAAS,CAAI,KAAoB;IAC/C,OAAO,KAAK,KAAK,SAAS,CAAC;AAC7B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@cosmjs/utils/package.json b/tools/mnemonic-test/node_modules/@cosmjs/utils/package.json deleted file mode 100644 index b06b91be..00000000 --- a/tools/mnemonic-test/node_modules/@cosmjs/utils/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "@cosmjs/utils", - "version": "0.37.0", - "description": "Utility tools, primarily for testing code", - "contributors": [ - "IOV SAS " - ], - "license": "Apache-2.0", - "exports": { - "types": "./build/index.d.ts", - "default": "./build/index.js" - }, - "files": [ - "build/", - "*.md", - "!*.spec.*", - "!**/testdata/" - ], - "repository": { - "type": "git", - "url": "https://github.com/cosmos/cosmjs/tree/main/packages/utils" - }, - "publishConfig": { - "access": "public", - "registry": "https://registry.npmjs.org" - }, - "scripts": { - "docs": "typedoc", - "format": "prettier --write --log-level warn \"./src/**/*.ts\"", - "format-text": "prettier --write \"./*.md\"", - "build": "rm -rf ./build && tsc", - "build-or-skip": "[ -n \"${SKIP_BUILD:-}\" ] || yarn build", - "test-node": "yarn node jasmine-testrunner.cjs", - "test": "yarn build-or-skip && yarn test-node", - "coverage": "nyc --reporter=text --reporter=lcov yarn test --quiet", - "pack-web": "yarn build-or-skip && webpack --mode development --config webpack.web.config.cjs", - "test-firefox": "yarn pack-web && karma start --single-run --browsers Firefox karma.conf.cjs", - "test-chrome": "yarn pack-web && karma start --single-run --browsers ChromeHeadless karma.conf.cjs" - }, - "devDependencies": { - "@istanbuljs/nyc-config-typescript": "^1.0.1", - "@types/jasmine": "^4", - "@types/karma-firefox-launcher": "^2", - "@types/karma-jasmine": "^4", - "@types/karma-jasmine-html-reporter": "^1", - "@types/node": "*", - "glob": "^11", - "jasmine": "^4", - "jasmine-spec-reporter": "^6", - "karma": "^6.3.14", - "karma-chrome-launcher": "^3.1.0", - "karma-firefox-launcher": "^2.1.0", - "karma-jasmine": "^5", - "karma-jasmine-html-reporter": "^1.5.4", - "nyc": "^17.1.0", - "prettier": "^3.6.2", - "ses": "^1.13.0", - "source-map-support": "^0.5.19", - "typedoc": "^0.28", - "typescript": "~5.9", - "webpack": "^5.76.0", - "webpack-cli": "^4.6.0" - } -} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/LICENSE b/tools/mnemonic-test/node_modules/@noble/ciphers/LICENSE deleted file mode 100644 index 5a53d5f1..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2022 Paul Miller (https://paulmillr.com) -Copyright (c) 2016 Thomas Pornin - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the “Software”), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/README.md b/tools/mnemonic-test/node_modules/@noble/ciphers/README.md deleted file mode 100644 index f6761da5..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/README.md +++ /dev/null @@ -1,543 +0,0 @@ -# noble-ciphers - -Audited & minimal JS implementation of Salsa20, ChaCha and AES. - -- 🔒 [**Audited**](#security) by an independent security firm -- 🔻 Tree-shakeable: unused code is excluded from your builds -- 🏎 Fast: hand-optimized for caveats of JS engines -- 🔍 Reliable: property-based / cross-library / wycheproof tests ensure correctness -- 💼 AES: ECB, CBC, CTR, CFB, GCM, SIV (nonce misuse-resistant), AESKW, AESKWP -- 💃 Salsa20, ChaCha, XSalsa20, XChaCha, ChaCha8, ChaCha12, Poly1305 -- 🥈 Two AES implementations: pure JS or friendly wrapper around webcrypto -- 🪶 29KB (11KB gzipped) for everything, 7KB (3KB gzipped) for ChaCha build - -Take a glance at [GitHub Discussions](https://github.com/paulmillr/noble-ciphers/discussions) for questions and support. - -### This library belongs to _noble_ cryptography - -> **noble cryptography** — high-security, easily auditable set of contained cryptographic libraries and tools. - -- Zero or minimal dependencies -- Highly readable TypeScript / JS code -- PGP-signed releases and transparent NPM builds -- All libraries: - [ciphers](https://github.com/paulmillr/noble-ciphers), - [curves](https://github.com/paulmillr/noble-curves), - [hashes](https://github.com/paulmillr/noble-hashes), - [post-quantum](https://github.com/paulmillr/noble-post-quantum), - 4kb [secp256k1](https://github.com/paulmillr/noble-secp256k1) / - [ed25519](https://github.com/paulmillr/noble-ed25519) -- [Check out homepage](https://paulmillr.com/noble/) - for reading resources, documentation and apps built with noble - -## Usage - -> `npm install @noble/ciphers` - -> `deno add jsr:@noble/ciphers` - -> `deno doc jsr:@noble/ciphers` # command-line documentation - -We support all major platforms and runtimes. -For React Native, you may need a -[polyfill for getRandomValues](https://github.com/LinusU/react-native-get-random-values). -A standalone file -[noble-ciphers.js](https://github.com/paulmillr/noble-ciphers/releases) is also available. - -```ts -// import * from '@noble/ciphers'; // Error: use sub-imports, to ensure small app size -import { gcm, siv } from '@noble/ciphers/aes'; -import { chacha20poly1305, xchacha20poly1305 } from '@noble/ciphers/chacha'; -import { xsalsa20poly1305, secretbox } from '@noble/ciphers/salsa'; - -// Unauthenticated encryption: make sure to use HMAC or similar -import { ctr, cfb, cbc, ecb } from '@noble/ciphers/aes'; -import { salsa20, xsalsa20 } from '@noble/ciphers/salsa'; -import { chacha20, xchacha20, chacha8, chacha12 } from '@noble/ciphers/chacha'; -import { aeskw, aeskwp } from '@noble/ciphers/aes'; // KW -import { bytesToHex, hexToBytes, bytesToUtf8, utf8ToBytes } from '@noble/ciphers/utils'; -import { managedNonce, randomBytes } from '@noble/ciphers/webcrypto'; -``` - -- [Examples](#examples) - - [XChaCha20-Poly1305 encryption](#xchacha20-poly1305-encryption) - - [AES-256-GCM encryption](#aes-256-gcm-encryption) - - [AES: gcm, siv, ctr, cfb, cbc, ecb](#aes-gcm-siv-ctr-cfb-cbc-ecb) - - [Friendly WebCrypto AES](#friendly-webcrypto-aes) - - [AESKW and AESKWP](#aeskw-and-aeskwp) - - [Auto-handle nonces](#auto-handle-nonces) - - [Reuse array for input and output](#reuse-array-for-input-and-output) -- [Internals](#internals) - - [Implemented primitives](#implemented-primitives) - - [Which cipher should I pick?](#which-cipher-should-i-pick) - - [How to encrypt properly](#how-to-encrypt-properly) - - [Nonces](#nonces) - - [Encryption limits](#encryption-limits) - - [AES internals and block modes](#aes-internals-and-block-modes) -- [Security](#security) -- [Speed](#speed) -- [Upgrading](#upgrading) -- [Contributing & testing](#contributing--testing) -- [License](#license) - -## Examples - -> [!NOTE] -> Use different nonce every time `encrypt()` is done. - -#### XChaCha20-Poly1305 encryption - -```js -import { xchacha20poly1305 } from '@noble/ciphers/chacha'; -import { utf8ToBytes } from '@noble/ciphers/utils'; -import { randomBytes } from '@noble/ciphers/webcrypto'; -const key = randomBytes(32); // random key -// const key = new Uint8Array([ // existing key -// 169, 88, 160, 139, 168, 29, 147, 196, 14, 88, 237, 76, 243, 177, 109, 140, -// 195, 140, 80, 10, 216, 134, 215, 71, 191, 48, 20, 104, 189, 37, 38, 55, -// ]); -// import { hexToBytes } from '@noble/ciphers/utils'; // hex key -// const key = hexToBytes('4b7f89bac90a1086fef73f5da2cbe93b2fae9dfbf7678ae1f3e75fd118ddf999'); -const nonce = randomBytes(24); -const chacha = xchacha20poly1305(key, nonce); -const data = utf8ToBytes('hello, noble'); -const ciphertext = chacha.encrypt(data); -const data_ = chacha.decrypt(ciphertext); // utils.bytesToUtf8(data_) === data -``` - -#### AES-256-GCM encryption - -```js -import { gcm } from '@noble/ciphers/aes'; -import { utf8ToBytes } from '@noble/ciphers/utils'; -import { randomBytes } from '@noble/ciphers/webcrypto'; -const key = randomBytes(32); -const nonce = randomBytes(24); -const data = utf8ToBytes('hello, noble'); -const aes = gcm(key, nonce); -const ciphertext = aes.encrypt(data); -const data_ = aes.decrypt(ciphertext); // utils.bytesToUtf8(data_) === data -``` - -#### AES: gcm, siv, ctr, cfb, cbc, ecb - -```js -import { gcm, siv, ctr, cfb, cbc, ecb } from '@noble/ciphers/aes'; -import { randomBytes } from '@noble/ciphers/webcrypto'; -const plaintext = new Uint8Array(32).fill(16); -for (let cipher of [gcm, siv]) { - const key = randomBytes(32); // 24 for AES-192, 16 for AES-128 - const nonce = randomBytes(12); - const ciphertext_ = cipher(key, nonce).encrypt(plaintext); - const plaintext_ = cipher(key, nonce).decrypt(ciphertext_); -} -for (const cipher of [ctr, cbc, cfb]) { - const key = randomBytes(32); // 24 for AES-192, 16 for AES-128 - const nonce = randomBytes(16); - const ciphertext_ = cipher(key, nonce).encrypt(plaintext); - const plaintext_ = cipher(key, nonce).decrypt(ciphertext_); -} -for (const cipher of [ecb]) { - const key = randomBytes(32); // 24 for AES-192, 16 for AES-128 - const ciphertext_ = cipher(key).encrypt(plaintext); - const plaintext_ = cipher(key).decrypt(ciphertext_); -} -``` - -#### Friendly WebCrypto AES - -Noble implements AES. Sometimes people want to use built-in `crypto.subtle` instead. However, it has terrible API. We simplify access to built-ins. - -> [!NOTE] -> Webcrypto methods are always async. - -```js -import { gcm, ctr, cbc, randomBytes } from '@noble/ciphers/webcrypto'; -const plaintext = new Uint8Array(32).fill(16); -const key = randomBytes(32); -for (const cipher of [gcm]) { - const nonce = randomBytes(12); - const ciphertext_ = await cipher(key, nonce).encrypt(plaintext); - const plaintext_ = await cipher(key, nonce).decrypt(ciphertext_); -} -for (const cipher of [ctr, cbc]) { - const nonce = randomBytes(16); - const ciphertext_ = await cipher(key, nonce).encrypt(plaintext); - const plaintext_ = await cipher(key, nonce).decrypt(ciphertext_); -} -``` - -#### AESKW and AESKWP - -```ts -import { aeskw, aeskwp } from '@noble/ciphers/aes'; -import { hexToBytes } from '@noble/ciphers/utils'; - -const kek = hexToBytes('000102030405060708090A0B0C0D0E0F'); -const keyData = hexToBytes('00112233445566778899AABBCCDDEEFF'); -const ciphertext = aeskw(kek).encrypt(keyData); -``` - -#### Auto-handle nonces - -We provide API that manages nonce internally instead of exposing them to library's user. - -For `encrypt`, a `nonceBytes`-length buffer is fetched from CSPRNG and prenended to encrypted ciphertext. - -For `decrypt`, first `nonceBytes` of ciphertext are treated as nonce. - -```js -import { xchacha20poly1305 } from '@noble/ciphers/chacha'; -import { managedNonce } from '@noble/ciphers/webcrypto'; -import { hexToBytes, utf8ToBytes } from '@noble/ciphers/utils'; -const key = hexToBytes('fa686bfdffd3758f6377abbc23bf3d9bdc1a0dda4a6e7f8dbdd579fa1ff6d7e1'); -const chacha = managedNonce(xchacha20poly1305)(key); // manages nonces for you -const data = utf8ToBytes('hello, noble'); -const ciphertext = chacha.encrypt(data); -const data_ = chacha.decrypt(ciphertext); -``` - -#### Reuse array for input and output - -To avoid additional allocations, Uint8Array can be reused -between encryption and decryption calls. - -> [!NOTE] -> Some ciphers don't support unaligned (`byteOffset % 4 !== 0`) Uint8Array as -> destination. It can decrease performance, making the optimization pointless. - -```js -import { chacha20poly1305 } from '@noble/ciphers/chacha'; -import { utf8ToBytes } from '@noble/ciphers/utils'; -import { randomBytes } from '@noble/ciphers/webcrypto'; - -const key = randomBytes(32); -const nonce = randomBytes(12); -const chacha = chacha20poly1305(key, nonce); - -const input = utf8ToBytes('hello, noble'); // length == 12 -const inputLength = input.length; -const tagLength = 16; - -const buf = new Uint8Array(inputLength + tagLength); -const start = buf.subarray(0, inputLength); -start.set(input); // copy input to buf - -chacha.encrypt(start, buf); // encrypt into `buf` -chacha.decrypt(buf, start); // decrypt into `start` -``` - -xsalsa20poly1305 also supports this, but requires 32 additional bytes for encryption / decryption, -due to its inner workings. - -## Internals - -### Implemented primitives - -- [Salsa20](https://cr.yp.to/snuffle.html) stream cipher, released in 2005. - Salsa's goal was to implement AES replacement that does not rely on S-Boxes, - which are hard to implement in a constant-time manner. - Salsa20 is usually faster than AES, a big deal on slow, budget mobile phones. - - [XSalsa20](https://cr.yp.to/snuffle/xsalsa-20110204.pdf), extended-nonce - variant was released in 2008. It switched nonces from 96-bit to 192-bit, - and became safe to be picked at random. - Nacl / Libsodium popularized term "secretbox", a simple black-box - authenticated encryption. Secretbox is just xsalsa20-poly1305. We provide the - alias and corresponding seal / open methods. We don't provide "box" or "sealedbox". - - Check out [PDF](https://cr.yp.to/snuffle/salsafamily-20071225.pdf) and - [wiki](https://en.wikipedia.org/wiki/Salsa20). -- [ChaCha20](https://cr.yp.to/chacha.html) stream cipher, released - in 2008. Developed after Salsa20, ChaCha aims to increase diffusion per round. - It was standardized in [RFC 8439](https://datatracker.ietf.org/doc/html/rfc8439) - and is now used in TLS 1.3. - - [XChaCha20](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-xchacha) - extended-nonce variant is also provided. Similar to XSalsa, it's safe to use with - randomly-generated nonces. - - Check out [PDF](http://cr.yp.to/chacha/chacha-20080128.pdf) and [wiki](https://en.wikipedia.org/wiki/Salsa20). -- [AES](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard) - is a variant of Rijndael block cipher, standardized by NIST in 2001. - We provide the fastest available pure JS implementation. - - We support AES-128, AES-192 and AES-256: the mode is selected dynamically, - based on key length (16, 24, 32). - - [AES-GCM-SIV](https://en.wikipedia.org/wiki/AES-GCM-SIV) - nonce-misuse-resistant mode is also provided. It's recommended to use it, - to prevent catastrophic consequences of nonce reuse. Our implementation of SIV - has the same speed as GCM: there is no performance hit. - - We also have AESKW and AESKWP from - [RFC 3394](https://datatracker.ietf.org/doc/html/rfc3394) / [RFC 5649](https://datatracker.ietf.org/doc/html/rfc5649) - - Check out [AES internals and block modes](#aes-internals-and-block-modes). -- We expose polynomial-evaluation MACs: [Poly1305](https://cr.yp.to/mac.html), AES-GCM's [GHash](https://en.wikipedia.org/wiki/Galois/Counter_Mode) and - AES-SIV's [Polyval](https://en.wikipedia.org/wiki/AES-GCM-SIV). - - Poly1305 ([PDF](https://cr.yp.to/mac/poly1305-20050329.pdf), - [wiki](https://en.wikipedia.org/wiki/Poly1305)) - is a fast and parallel secret-key message-authentication code suitable for - a wide variety of applications. It was standardized in - [RFC 8439](https://datatracker.ietf.org/doc/html/rfc8439) and is now used in TLS 1.3. - - Polynomial MACs are not perfect for every situation: - they lack Random Key Robustness: the MAC can be forged, and can't - be used in PAKE schemes. See - [invisible salamanders attack](https://keymaterial.net/2020/09/07/invisible-salamanders-in-aes-gcm-siv/). - To combat invisible salamanders, `hash(key)` can be included in ciphertext, - however, this would violate ciphertext indistinguishability: - an attacker would know which key was used - so `HKDF(key, i)` - could be used instead. -- Format-preserving encryption algorithm (FPE-FF1) specified in NIST Special Publication 800-38G. - [See more info](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-38G.pdf). - -### Which cipher should I pick? - -We suggest to use XChaCha20-Poly1305. -If you can't use it, prefer AES-GCM-SIV, or AES-GCM. - -### How to encrypt properly - -- Use unpredictable key with enough entropy - - Random key must be using cryptographically secure random number generator (CSPRNG), not `Math.random` etc. - - Non-random key generated from KDF is fine - - Re-using key is fine, but be aware of rules for cryptographic key wear-out and [encryption limits](#encryption-limits) -- Use new nonce every time and [don't repeat it](#nonces) - - chacha and salsa20 are fine for sequential counters that _never_ repeat: `01, 02...` - - xchacha and xsalsa20 should use random nonces instead - - AES-GCM should use 12-byte nonces: smaller nonces are security risk -- Prefer authenticated encryption (AEAD) - - chacha20poly1305 / aes-gcm / ChaCha + HMAC / AES + HMAC is good - - chacha20 / aes-ctr / aes-cbc without poly1305 or hmac is bad - - Flipping bits or ciphertext substitution won't be detected in unauthenticated ciphers -- Don't re-use keys between different protocols - - For example, using secp256k1 key in AES can be bad - - Use hkdf or, at least, a hash function to create sub-key instead -- If you need AES, only use AES-256 for new protocols - - For post-quantum security - -### Nonces - -Most ciphers need a key and a nonce (aka initialization vector / IV) to encrypt a data: - - ciphertext = encrypt(plaintext, key, nonce) - -Repeating (key, nonce) pair with different plaintexts would allow an attacker to decrypt it: - - ciphertext_a = encrypt(plaintext_a, key, nonce) - ciphertext_b = encrypt(plaintext_b, key, nonce) - stream_diff = xor(ciphertext_a, ciphertext_b) # Break encryption - -So, you can't repeat nonces. One way of doing so is using counters: - - for i in 0..: - ciphertext[i] = encrypt(plaintexts[i], key, i) - -Another is generating random nonce every time: - - for i in 0..: - rand_nonces[i] = random() - ciphertext[i] = encrypt(plaintexts[i], key, rand_nonces[i]) - -Counters are OK, but it's not always possible to store current counter value: -e.g. in decentralized, unsyncable systems. - -Randomness is OK, but there's a catch: -ChaCha20 and AES-GCM use 96-bit / 12-byte nonces, which implies higher chance of collision. -In the example above, `random()` can collide and produce repeating nonce. -Chance is even higher for 64-bit nonces, which GCM allows - don't use them. - -To safely use random nonces, utilize XSalsa20 or XChaCha: -they increased nonce length to 192-bit, minimizing a chance of collision. -AES-SIV is also fine. In situations where you can't use eXtended-nonce -algorithms, key rotation is advised. hkdf would work great for this case. - -### Encryption limits - -A "protected message" would mean a probability of `2**-50` that a passive attacker -successfully distinguishes the ciphertext outputs of the AEAD scheme from the outputs -of a random function. See [draft-irtf-cfrg-aead-limits](https://datatracker.ietf.org/doc/draft-irtf-cfrg-aead-limits/) for details. - -- Max message size: - - AES-GCM: ~68GB, `2**36-256` - - Salsa, ChaCha, XSalsa, XChaCha: ~256GB, `2**38-64` -- Max amount of protected messages, under same key: - - AES-GCM: `2**32.5` - - Salsa, ChaCha: `2**46`, but only integrity is affected, not confidentiality - - XSalsa, XChaCha: `2**72` -- Max amount of protected messages, across all keys: - - AES-GCM: `2**69/B` where B is max blocks encrypted by a key. Meaning - `2**59` for 1KB, `2**49` for 1MB, `2**39` for 1GB - - Salsa, ChaCha, XSalsa, XChaCha: `2**100` - -##### AES internals and block modes - -`cipher = encrypt(block, key)`. Data is split into 128-bit blocks. Encrypted in 10/12/14 rounds (128/192/256bit). Every round does: - -1. **S-box**, table substitution -2. **Shift rows**, cyclic shift left of all rows of data array -3. **Mix columns**, multiplying every column by fixed polynomial -4. **Add round key**, round_key xor i-th column of array - -For non-deterministic (not ECB) schemes, initialization vector (IV) is mixed to block/key; -and each new round either depends on previous block's key, or on some counter. - -- ECB (Electronic Codebook): Deterministic encryption; identical plaintext blocks yield identical ciphertexts. Insecure due to pattern leakage. - See [AES Penguin](https://words.filippo.io/the-ecb-penguin/) -- CBC (Cipher Block Chaining): Each plaintext block is XORed with the previous ciphertext block before encryption. - Hard to use: requires proper padding and an IV. Needs a separate MAC. -- CTR (Counter Mode): Turns a block cipher into a stream cipher using a counter and IV (nonce). - Efficient and parallelizable. Requires a unique nonce per encryption. Better, but still needs a separate MAC. -- GCM (Galois/Counter Mode): Combines CTR mode with polynomial MAC. Efficient and widely used. -- SIV (Synthetic IV): Nonce-misuse-resistant mode; repeating nonces reveal only if plaintexts are identical. - Maintains security even if nonces are reused. -- XTS: Designed for disk encryption. - Similar to ECB (deterministic), but has `[i][j]` tweak arguments corresponding to sector i and 16-byte block (part of sector) j. - Lacks MAC. - -GCM / SIV are not ideal: - -- Conservative key wear-out is `2**32` (4B) msgs -- MAC can be forged: see Poly1305 section above. Same for SIV - -## Security - -The library has been independently audited: - -- at version 1.0.0, in Sep 2024, by [cure53](https://cure53.de) - - PDFs: [website](https://cure53.de/audit-report_noble-crypto-libs.pdf), [in-repo](./audit/2024-09-cure53-audit-nbl4.pdf) - - [Changes since audit](https://github.com/paulmillr/noble-ciphers/compare/1.0.0..main) - - Scope: everything - - The audit has been funded by [OpenSats](https://opensats.org) - -It is tested against property-based, cross-library and Wycheproof vectors, -and is being fuzzed in [the separate repo](https://github.com/paulmillr/fuzzing). - -If you see anything unusual: investigate and report. - -### Constant-timeness - -We're targetting algorithmic constant time. _JIT-compiler_ and _Garbage Collector_ make "constant time" -extremely hard to achieve [timing attack](https://en.wikipedia.org/wiki/Timing_attack) resistance -in a scripting language. Which means _any other JS library can't have -constant-timeness_. Even statically typed Rust, a language without GC, -[makes it harder to achieve constant-time](https://www.chosenplaintext.ca/open-source/rust-timing-shield/security) -for some cases. If your goal is absolute security, don't use any JS lib — including bindings to native ones. -Use low-level libraries & languages. - -The library uses T-tables for AES, which -[leak access timings](https://cr.yp.to/antiforgery/cachetiming-20050414.pdf). -This is also done in [OpenSSL](https://github.com/openssl/openssl/blob/2f33265039cdbd0e4589c80970e02e208f3f94d2/crypto/aes/aes_core.c#L706) and -[Go stdlib](https://cs.opensource.google/go/go/+/refs/tags/go1.22.6:src/crypto/aes/const.go;l=90) for performance reasons. -The analysis was mentioned in [hal-04652991](https://hal.science/hal-04652991/document). - -### Supply chain security - -- **Commits** are signed with PGP keys, to prevent forgery. Make sure to verify commit signatures -- **Releases** are transparent and built on GitHub CI. Make sure to verify [provenance](https://docs.npmjs.com/generating-provenance-statements) logs - - Use GitHub CLI to verify single-file builds: - `gh attestation verify --owner paulmillr noble-ciphers.js` -- **Rare releasing** is followed to ensure less re-audit need for end-users -- **Dependencies** are minimized and locked-down: any dependency could get hacked and users will be downloading malware with every install. - - We make sure to use as few dependencies as possible - - Automatic dep updates are prevented by locking-down version ranges; diffs are checked with `npm-diff` -- **Dev Dependencies** are disabled for end-users; they are only used to develop / build the source code - -For this package, there are 0 dependencies; and a few dev dependencies: - -- micro-bmark, micro-should and jsbt are used for benchmarking / testing / build tooling and developed by the same author -- prettier, fast-check and typescript are used for code quality / test generation / ts compilation. It's hard to audit their source code thoroughly and fully because of their size - -### Randomness - -We're deferring to built-in -[crypto.getRandomValues](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues) -which is considered cryptographically secure (CSPRNG). - -In the past, browsers had bugs that made it weak: it may happen again. -Implementing a userspace CSPRNG to get resilient to the weakness -is even worse: there is no reliable userspace source of quality entropy. - -## Speed - -To summarize, noble is the fastest JS implementation of Salsa, ChaCha and AES. - -You can gain additional speed-up and -avoid memory allocations by passing `output` -uint8array into encrypt / decrypt methods. - -Benchmark results on Apple M4: - -``` -64B -xsalsa20poly1305 x 675,675 ops/sec @ 1μs/op -chacha20poly1305 x 568,181 ops/sec @ 1μs/op -xchacha20poly1305 x 460,617 ops/sec @ 2μs/op -aes-256-gcm x 201,126 ops/sec @ 4μs/op -aes-256-gcm-siv x 162,284 ops/sec @ 6μs/op -# Unauthenticated encryption -salsa20 x 1,655,629 ops/sec @ 604ns/op -xsalsa20 x 1,400,560 ops/sec @ 714ns/op -chacha20 x 1,996,007 ops/sec @ 501ns/op -xchacha20 x 1,404,494 ops/sec @ 712ns/op -chacha8 x 2,145,922 ops/sec @ 466ns/op -chacha12 x 2,036,659 ops/sec @ 491ns/op -aes-ecb-256 x 1,019,367 ops/sec @ 981ns/op -aes-cbc-256 x 931,966 ops/sec @ 1μs/op -aes-ctr-256 x 954,198 ops/sec @ 1μs/op - -1MB -xsalsa20poly1305 x 322 ops/sec @ 3ms/op -chacha20poly1305 x 327 ops/sec @ 3ms/op -xchacha20poly1305 x 331 ops/sec @ 3ms/op -aes-256-gcm x 94 ops/sec @ 10ms/op -aes-256-gcm-siv x 90 ops/sec @ 11ms/op -# Unauthenticated encryption -salsa20 x 791 ops/sec @ 1ms/op -xsalsa20 x 801 ops/sec @ 1ms/op -chacha20 x 787 ops/sec @ 1ms/op -xchacha20 x 781 ops/sec @ 1ms/op -chacha8 x 1,457 ops/sec @ 686μs/op -chacha12 x 1,130 ops/sec @ 884μs/op -aes-ecb-256 x 289 ops/sec @ 3ms/op -aes-cbc-256 x 114 ops/sec @ 8ms/op -aes-ctr-256 x 127 ops/sec @ 7ms/op -# Wrapper over built-in webcrypto -webcrypto ctr-256 x 6,508 ops/sec @ 153μs/op -webcrypto cbc-256 x 1,820 ops/sec @ 549μs/op -webcrypto gcm-256 x 5,106 ops/sec @ 195μs/op -``` - -Compare to other implementations: - -``` -xsalsa20poly1305 (encrypt, 1MB) -├─tweetnacl x 196 ops/sec -└─noble x 305 ops/sec - -chacha20poly1305 (encrypt, 1MB) -├─node x 1,668 ops/sec -├─stablelib x 202 ops/sec -└─noble x 319 ops/sec - -aes-ctr-256 (encrypt, 1MB) -├─stablelib x 123 ops/sec -├─aesjs x 42 ops/sec -├─noble-webcrypto x 5,965 ops/sec -└─noble x 124 ops/sec -``` - -## Contributing & testing - -- `npm install && npm run build && npm test` will build the code and run tests. -- `npm run lint` / `npm run format` will run linter / fix linter issues. -- `npm run bench` will run benchmarks, which may need their deps first (`npm run bench:install`) -- `npm run build:release` will build single file - -Check out [github.com/paulmillr/guidelines](https://github.com/paulmillr/guidelines) -for general coding practices and rules. - -See [paulmillr.com/noble](https://paulmillr.com/noble/) -for useful resources, articles, documentation and demos -related to the library. - -## License - -The MIT License (MIT) - -Copyright (c) 2023 Paul Miller [(https://paulmillr.com)](https://paulmillr.com) -Copyright (c) 2016 Thomas Pornin - -See LICENSE file. diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/_arx.d.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/_arx.d.ts deleted file mode 100644 index 9b54727a..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/_arx.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Basic utils for ARX (add-rotate-xor) salsa and chacha ciphers. - -RFC8439 requires multi-step cipher stream, where -authKey starts with counter: 0, actual msg with counter: 1. - -For this, we need a way to re-use nonce / counter: - - const counter = new Uint8Array(4); - chacha(..., counter, ...); // counter is now 1 - chacha(..., counter, ...); // counter is now 2 - -This is complicated: - -- 32-bit counters are enough, no need for 64-bit: max ArrayBuffer size in JS is 4GB -- Original papers don't allow mutating counters -- Counter overflow is undefined [^1] -- Idea A: allow providing (nonce | counter) instead of just nonce, re-use it -- Caveat: Cannot be re-used through all cases: -- * chacha has (counter | nonce) -- * xchacha has (nonce16 | counter | nonce16) -- Idea B: separate nonce / counter and provide separate API for counter re-use -- Caveat: there are different counter sizes depending on an algorithm. -- salsa & chacha also differ in structures of key & sigma: - salsa20: s[0] | k(4) | s[1] | nonce(2) | ctr(2) | s[2] | k(4) | s[3] - chacha: s(4) | k(8) | ctr(1) | nonce(3) - chacha20orig: s(4) | k(8) | ctr(2) | nonce(2) -- Idea C: helper method such as `setSalsaState(key, nonce, sigma, data)` -- Caveat: we can't re-use counter array - -xchacha [^2] uses the subkey and remaining 8 byte nonce with ChaCha20 as normal -(prefixed by 4 NUL bytes, since [RFC8439] specifies a 12-byte nonce). - -[^1]: https://mailarchive.ietf.org/arch/msg/cfrg/gsOnTJzcbgG6OqD8Sc0GO5aR_tU/ -[^2]: https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-xchacha#appendix-A.2 - - * @module - */ -import { type XorStream } from './utils.ts'; -export declare function rotl(a: number, b: number): number; -/** Ciphers must use u32 for efficiency. */ -export type CipherCoreFn = (sigma: Uint32Array, key: Uint32Array, nonce: Uint32Array, output: Uint32Array, counter: number, rounds?: number) => void; -/** Method which extends key + short nonce into larger nonce / diff key. */ -export type ExtendNonceFn = (sigma: Uint32Array, key: Uint32Array, input: Uint32Array, output: Uint32Array) => void; -/** ARX cipher options. - * * `allowShortKeys` for 16-byte keys - * * `counterLength` in bytes - * * `counterRight`: right: `nonce|counter`; left: `counter|nonce` - * */ -export type CipherOpts = { - allowShortKeys?: boolean; - extendNonceFn?: ExtendNonceFn; - counterLength?: number; - counterRight?: boolean; - rounds?: number; -}; -/** Creates ARX-like (ChaCha, Salsa) cipher stream from core function. */ -export declare function createCipher(core: CipherCoreFn, opts: CipherOpts): XorStream; -//# sourceMappingURL=_arx.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/_arx.d.ts.map b/tools/mnemonic-test/node_modules/@noble/ciphers/_arx.d.ts.map deleted file mode 100644 index 73c68bbf..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/_arx.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_arx.d.ts","sourceRoot":"","sources":["src/_arx.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,EACL,KAAK,SAAS,EACf,MAAM,YAAY,CAAC;AAUpB,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,2CAA2C;AAC3C,MAAM,MAAM,YAAY,GAAG,CACzB,KAAK,EAAE,WAAW,EAClB,GAAG,EAAE,WAAW,EAChB,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,MAAM,KACZ,IAAI,CAAC;AAEV,2EAA2E;AAC3E,MAAM,MAAM,aAAa,GAAG,CAC1B,KAAK,EAAE,WAAW,EAClB,GAAG,EAAE,WAAW,EAChB,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,WAAW,KAChB,IAAI,CAAC;AAEV;;;;KAIK;AACL,MAAM,MAAM,UAAU,GAAG;IACvB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAwDF,yEAAyE;AACzE,wBAAgB,YAAY,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,SAAS,CAkF5E"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/_arx.js b/tools/mnemonic-test/node_modules/@noble/ciphers/_arx.js deleted file mode 100644 index c82d5bc8..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/_arx.js +++ /dev/null @@ -1,175 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.rotl = rotl; -exports.createCipher = createCipher; -/** - * Basic utils for ARX (add-rotate-xor) salsa and chacha ciphers. - -RFC8439 requires multi-step cipher stream, where -authKey starts with counter: 0, actual msg with counter: 1. - -For this, we need a way to re-use nonce / counter: - - const counter = new Uint8Array(4); - chacha(..., counter, ...); // counter is now 1 - chacha(..., counter, ...); // counter is now 2 - -This is complicated: - -- 32-bit counters are enough, no need for 64-bit: max ArrayBuffer size in JS is 4GB -- Original papers don't allow mutating counters -- Counter overflow is undefined [^1] -- Idea A: allow providing (nonce | counter) instead of just nonce, re-use it -- Caveat: Cannot be re-used through all cases: -- * chacha has (counter | nonce) -- * xchacha has (nonce16 | counter | nonce16) -- Idea B: separate nonce / counter and provide separate API for counter re-use -- Caveat: there are different counter sizes depending on an algorithm. -- salsa & chacha also differ in structures of key & sigma: - salsa20: s[0] | k(4) | s[1] | nonce(2) | ctr(2) | s[2] | k(4) | s[3] - chacha: s(4) | k(8) | ctr(1) | nonce(3) - chacha20orig: s(4) | k(8) | ctr(2) | nonce(2) -- Idea C: helper method such as `setSalsaState(key, nonce, sigma, data)` -- Caveat: we can't re-use counter array - -xchacha [^2] uses the subkey and remaining 8 byte nonce with ChaCha20 as normal -(prefixed by 4 NUL bytes, since [RFC8439] specifies a 12-byte nonce). - -[^1]: https://mailarchive.ietf.org/arch/msg/cfrg/gsOnTJzcbgG6OqD8Sc0GO5aR_tU/ -[^2]: https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-xchacha#appendix-A.2 - - * @module - */ -// prettier-ignore -const utils_ts_1 = require("./utils.js"); -// We can't make top-level var depend on utils.utf8ToBytes -// because it's not present in all envs. Creating a similar fn here -const _utf8ToBytes = (str) => Uint8Array.from(str.split('').map((c) => c.charCodeAt(0))); -const sigma16 = _utf8ToBytes('expand 16-byte k'); -const sigma32 = _utf8ToBytes('expand 32-byte k'); -const sigma16_32 = (0, utils_ts_1.u32)(sigma16); -const sigma32_32 = (0, utils_ts_1.u32)(sigma32); -function rotl(a, b) { - return (a << b) | (a >>> (32 - b)); -} -// Is byte array aligned to 4 byte offset (u32)? -function isAligned32(b) { - return b.byteOffset % 4 === 0; -} -// Salsa and Chacha block length is always 512-bit -const BLOCK_LEN = 64; -const BLOCK_LEN32 = 16; -// new Uint32Array([2**32]) // => Uint32Array(1) [ 0 ] -// new Uint32Array([2**32-1]) // => Uint32Array(1) [ 4294967295 ] -const MAX_COUNTER = 2 ** 32 - 1; -const U32_EMPTY = new Uint32Array(); -function runCipher(core, sigma, key, nonce, data, output, counter, rounds) { - const len = data.length; - const block = new Uint8Array(BLOCK_LEN); - const b32 = (0, utils_ts_1.u32)(block); - // Make sure that buffers aligned to 4 bytes - const isAligned = isAligned32(data) && isAligned32(output); - const d32 = isAligned ? (0, utils_ts_1.u32)(data) : U32_EMPTY; - const o32 = isAligned ? (0, utils_ts_1.u32)(output) : U32_EMPTY; - for (let pos = 0; pos < len; counter++) { - core(sigma, key, nonce, b32, counter, rounds); - if (counter >= MAX_COUNTER) - throw new Error('arx: counter overflow'); - const take = Math.min(BLOCK_LEN, len - pos); - // aligned to 4 bytes - if (isAligned && take === BLOCK_LEN) { - const pos32 = pos / 4; - if (pos % 4 !== 0) - throw new Error('arx: invalid block position'); - for (let j = 0, posj; j < BLOCK_LEN32; j++) { - posj = pos32 + j; - o32[posj] = d32[posj] ^ b32[j]; - } - pos += BLOCK_LEN; - continue; - } - for (let j = 0, posj; j < take; j++) { - posj = pos + j; - output[posj] = data[posj] ^ block[j]; - } - pos += take; - } -} -/** Creates ARX-like (ChaCha, Salsa) cipher stream from core function. */ -function createCipher(core, opts) { - const { allowShortKeys, extendNonceFn, counterLength, counterRight, rounds } = (0, utils_ts_1.checkOpts)({ allowShortKeys: false, counterLength: 8, counterRight: false, rounds: 20 }, opts); - if (typeof core !== 'function') - throw new Error('core must be a function'); - (0, utils_ts_1.anumber)(counterLength); - (0, utils_ts_1.anumber)(rounds); - (0, utils_ts_1.abool)(counterRight); - (0, utils_ts_1.abool)(allowShortKeys); - return (key, nonce, data, output, counter = 0) => { - (0, utils_ts_1.abytes)(key); - (0, utils_ts_1.abytes)(nonce); - (0, utils_ts_1.abytes)(data); - const len = data.length; - if (output === undefined) - output = new Uint8Array(len); - (0, utils_ts_1.abytes)(output); - (0, utils_ts_1.anumber)(counter); - if (counter < 0 || counter >= MAX_COUNTER) - throw new Error('arx: counter overflow'); - if (output.length < len) - throw new Error(`arx: output (${output.length}) is shorter than data (${len})`); - const toClean = []; - // Key & sigma - // key=16 -> sigma16, k=key|key - // key=32 -> sigma32, k=key - let l = key.length; - let k; - let sigma; - if (l === 32) { - toClean.push((k = (0, utils_ts_1.copyBytes)(key))); - sigma = sigma32_32; - } - else if (l === 16 && allowShortKeys) { - k = new Uint8Array(32); - k.set(key); - k.set(key, 16); - sigma = sigma16_32; - toClean.push(k); - } - else { - throw new Error(`arx: invalid 32-byte key, got length=${l}`); - } - // Nonce - // salsa20: 8 (8-byte counter) - // chacha20orig: 8 (8-byte counter) - // chacha20: 12 (4-byte counter) - // xsalsa20: 24 (16 -> hsalsa, 8 -> old nonce) - // xchacha20: 24 (16 -> hchacha, 8 -> old nonce) - // Align nonce to 4 bytes - if (!isAligned32(nonce)) - toClean.push((nonce = (0, utils_ts_1.copyBytes)(nonce))); - const k32 = (0, utils_ts_1.u32)(k); - // hsalsa & hchacha: handle extended nonce - if (extendNonceFn) { - if (nonce.length !== 24) - throw new Error(`arx: extended nonce must be 24 bytes`); - extendNonceFn(sigma, k32, (0, utils_ts_1.u32)(nonce.subarray(0, 16)), k32); - nonce = nonce.subarray(16); - } - // Handle nonce counter - const nonceNcLen = 16 - counterLength; - if (nonceNcLen !== nonce.length) - throw new Error(`arx: nonce must be ${nonceNcLen} or 16 bytes`); - // Pad counter when nonce is 64 bit - if (nonceNcLen !== 12) { - const nc = new Uint8Array(12); - nc.set(nonce, counterRight ? 0 : 12 - nonce.length); - nonce = nc; - toClean.push(nonce); - } - const n32 = (0, utils_ts_1.u32)(nonce); - runCipher(core, sigma, k32, n32, data, output, counter, rounds); - (0, utils_ts_1.clean)(...toClean); - return output; - }; -} -//# sourceMappingURL=_arx.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/_arx.js.map b/tools/mnemonic-test/node_modules/@noble/ciphers/_arx.js.map deleted file mode 100644 index bb3482ff..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/_arx.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_arx.js","sourceRoot":"","sources":["src/_arx.ts"],"names":[],"mappings":";;AAmDA,oBAEC;AAwFD,oC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MAAM,CAAC,CAAC;QAChE,IAAA,gBAAK,EAAC,GAAG,OAAO,CAAC,CAAC;QAClB,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/_assert.d.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/_assert.d.ts deleted file mode 100644 index 5faec8e0..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/_assert.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Internal assertion helpers. - * @module - * @deprecated - */ -import { abytes as ab, abool as abool_, aexists as ae, anumber as an, aoutput as ao, type IHash as H } from './utils.ts'; -/** @deprecated Use import from `noble/hashes/utils` module */ -export declare const abool: typeof abool_; -/** @deprecated Use import from `noble/hashes/utils` module */ -export declare const abytes: typeof ab; -/** @deprecated Use import from `noble/hashes/utils` module */ -export declare const aexists: typeof ae; -/** @deprecated Use import from `noble/hashes/utils` module */ -export declare const anumber: typeof an; -/** @deprecated Use import from `noble/hashes/utils` module */ -export declare const aoutput: typeof ao; -/** @deprecated Use import from `noble/hashes/utils` module */ -export type Hash = H; -//# sourceMappingURL=_assert.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/_assert.d.ts.map b/tools/mnemonic-test/node_modules/@noble/ciphers/_assert.d.ts.map deleted file mode 100644 index 29b88c44..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/_assert.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_assert.d.ts","sourceRoot":"","sources":["src/_assert.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,MAAM,IAAI,EAAE,EACZ,KAAK,IAAI,MAAM,EACf,OAAO,IAAI,EAAE,EACb,OAAO,IAAI,EAAE,EACb,OAAO,IAAI,EAAE,EACb,KAAK,KAAK,IAAI,CAAC,EAChB,MAAM,YAAY,CAAC;AACpB,8DAA8D;AAC9D,eAAO,MAAM,KAAK,EAAE,OAAO,MAAe,CAAC;AAC3C,8DAA8D;AAC9D,eAAO,MAAM,MAAM,EAAE,OAAO,EAAO,CAAC;AACpC,8DAA8D;AAC9D,eAAO,MAAM,OAAO,EAAE,OAAO,EAAO,CAAC;AACrC,8DAA8D;AAC9D,eAAO,MAAM,OAAO,EAAE,OAAO,EAAO,CAAC;AACrC,8DAA8D;AAC9D,eAAO,MAAM,OAAO,EAAE,OAAO,EAAO,CAAC;AACrC,8DAA8D;AAC9D,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/_assert.js b/tools/mnemonic-test/node_modules/@noble/ciphers/_assert.js deleted file mode 100644 index 1e5788de..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/_assert.js +++ /dev/null @@ -1,20 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.aoutput = exports.anumber = exports.aexists = exports.abytes = exports.abool = void 0; -/** - * Internal assertion helpers. - * @module - * @deprecated - */ -const utils_ts_1 = require("./utils.js"); -/** @deprecated Use import from `noble/hashes/utils` module */ -exports.abool = utils_ts_1.abool; -/** @deprecated Use import from `noble/hashes/utils` module */ -exports.abytes = utils_ts_1.abytes; -/** @deprecated Use import from `noble/hashes/utils` module */ -exports.aexists = utils_ts_1.aexists; -/** @deprecated Use import from `noble/hashes/utils` module */ -exports.anumber = utils_ts_1.anumber; -/** @deprecated Use import from `noble/hashes/utils` module */ -exports.aoutput = utils_ts_1.aoutput; -//# sourceMappingURL=_assert.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/_assert.js.map b/tools/mnemonic-test/node_modules/@noble/ciphers/_assert.js.map deleted file mode 100644 index b377f349..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/_assert.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_assert.js","sourceRoot":"","sources":["src/_assert.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,yCAOoB;AACpB,8DAA8D;AACjD,QAAA,KAAK,GAAkB,gBAAM,CAAC;AAC3C,8DAA8D;AACjD,QAAA,MAAM,GAAc,iBAAE,CAAC;AACpC,8DAA8D;AACjD,QAAA,OAAO,GAAc,kBAAE,CAAC;AACrC,8DAA8D;AACjD,QAAA,OAAO,GAAc,kBAAE,CAAC;AACrC,8DAA8D;AACjD,QAAA,OAAO,GAAc,kBAAE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/_micro.d.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/_micro.d.ts deleted file mode 100644 index 6673e9e7..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/_micro.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { type Cipher, type XorStream } from './utils.ts'; -export type ARXCipherN = ((key: Uint8Array, nonce: Uint8Array, AAD?: Uint8Array) => Cipher) & { - blockSize: number; - nonceLength: number; - tagLength: number; -}; -/** hsalsa hashes key and nonce into key' and nonce'. */ -export declare function hsalsa(s: Uint32Array, k: Uint32Array, i: Uint32Array, o32: Uint32Array): void; -/** hchacha hashes key and nonce into key' and nonce'. */ -export declare function hchacha(s: Uint32Array, k: Uint32Array, i: Uint32Array, o32: Uint32Array): void; -/** salsa20, 12-byte nonce. */ -export declare const salsa20: XorStream; -/** xsalsa20, 24-byte nonce. */ -export declare const xsalsa20: XorStream; -/** chacha20 non-RFC, original version by djb. 8-byte nonce, 8-byte counter. */ -export declare const chacha20orig: XorStream; -/** chacha20 RFC 8439 (IETF / TLS). 12-byte nonce, 4-byte counter. */ -export declare const chacha20: XorStream; -/** xchacha20 eXtended-nonce. https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-xchacha */ -export declare const xchacha20: XorStream; -/** 8-round chacha from the original paper. */ -export declare const chacha8: XorStream; -/** 12-round chacha from the original paper. */ -export declare const chacha12: XorStream; -/** Poly1305 polynomial MAC. Can be speed-up using BigUint64Array, at the cost of complexity. */ -export declare function poly1305(msg: Uint8Array, key: Uint8Array): Uint8Array; -/** xsalsa20-poly1305 eXtended-nonce (24 bytes) salsa. */ -export declare const xsalsa20poly1305: ARXCipherN; -/** Alias to `xsalsa20poly1305`. */ -export declare function secretbox(key: Uint8Array, nonce: Uint8Array): { - seal: (plaintext: Uint8Array) => Uint8Array; - open: (ciphertext: Uint8Array) => Uint8Array; -}; -export declare const _poly1305_aead: (fn: XorStream) => (key: Uint8Array, nonce: Uint8Array, AAD?: Uint8Array) => Cipher; -/** chacha20-poly1305 12-byte-nonce chacha. */ -export declare const chacha20poly1305: ARXCipherN; -/** - * XChaCha20-Poly1305 extended-nonce chacha. Can be safely used with random nonces (CSPRNG). - */ -export declare const xchacha20poly1305: ARXCipherN; -//# sourceMappingURL=_micro.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/_micro.d.ts.map b/tools/mnemonic-test/node_modules/@noble/ciphers/_micro.d.ts.map deleted file mode 100644 index 71935edf..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/_micro.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_micro.d.ts","sourceRoot":"","sources":["src/_micro.ts"],"names":[],"mappings":"AASA,OAAO,EACL,KAAK,MAAM,EACX,KAAK,SAAS,EASf,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,CAAC,EAAE,UAAU,KAAK,MAAM,CAAC,GAAG;IAC5F,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAuEF,wDAAwD;AAExD,wBAAgB,MAAM,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,EAAE,GAAG,EAAE,WAAW,GAAG,IAAI,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/@noble/ciphers/_micro.js b/tools/mnemonic-test/node_modules/@noble/ciphers/_micro.js deleted file mode 100644 index 165ef95f..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/_micro.js +++ /dev/null @@ -1,260 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.xchacha20poly1305 = exports.chacha20poly1305 = exports._poly1305_aead = exports.xsalsa20poly1305 = exports.chacha12 = exports.chacha8 = exports.xchacha20 = exports.chacha20 = exports.chacha20orig = exports.xsalsa20 = exports.salsa20 = void 0; -exports.hsalsa = hsalsa; -exports.hchacha = hchacha; -exports.poly1305 = poly1305; -exports.secretbox = secretbox; -/** - * noble-ciphers-micro: more auditable, but 4x slower version of salsa20, chacha & poly1305. - * Implements the same algorithms that are present in other files, but without - * unrolled loops (https://en.wikipedia.org/wiki/Loop_unrolling). - * @module - */ -/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */ -// prettier-ignore -const _arx_ts_1 = require("./_arx.js"); -const utils_ts_1 = require("./utils.js"); -function bytesToNumberLE(bytes) { - (0, utils_ts_1.abytes)(bytes); - return (0, utils_ts_1.hexToNumber)((0, utils_ts_1.bytesToHex)(Uint8Array.from(bytes).reverse())); -} -function numberToBytesLE(n, len) { - return (0, utils_ts_1.numberToBytesBE)(n, len).reverse(); -} -function salsaQR(x, a, b, c, d) { - x[b] ^= (0, _arx_ts_1.rotl)((x[a] + x[d]) | 0, 7); - x[c] ^= (0, _arx_ts_1.rotl)((x[b] + x[a]) | 0, 9); - x[d] ^= (0, _arx_ts_1.rotl)((x[c] + x[b]) | 0, 13); - x[a] ^= (0, _arx_ts_1.rotl)((x[d] + x[c]) | 0, 18); -} -// prettier-ignore -function chachaQR(x, a, b, c, d) { - x[a] = (x[a] + x[b]) | 0; - x[d] = (0, _arx_ts_1.rotl)(x[d] ^ x[a], 16); - x[c] = (x[c] + x[d]) | 0; - x[b] = (0, _arx_ts_1.rotl)(x[b] ^ x[c], 12); - x[a] = (x[a] + x[b]) | 0; - x[d] = (0, _arx_ts_1.rotl)(x[d] ^ x[a], 8); - x[c] = (x[c] + x[d]) | 0; - x[b] = (0, _arx_ts_1.rotl)(x[b] ^ x[c], 7); -} -function salsaRound(x, rounds = 20) { - for (let r = 0; r < rounds; r += 2) { - salsaQR(x, 0, 4, 8, 12); - salsaQR(x, 5, 9, 13, 1); - salsaQR(x, 10, 14, 2, 6); - salsaQR(x, 15, 3, 7, 11); - salsaQR(x, 0, 1, 2, 3); - salsaQR(x, 5, 6, 7, 4); - salsaQR(x, 10, 11, 8, 9); - salsaQR(x, 15, 12, 13, 14); - } -} -function chachaRound(x, rounds = 20) { - for (let r = 0; r < rounds; r += 2) { - chachaQR(x, 0, 4, 8, 12); - chachaQR(x, 1, 5, 9, 13); - chachaQR(x, 2, 6, 10, 14); - chachaQR(x, 3, 7, 11, 15); - chachaQR(x, 0, 5, 10, 15); - chachaQR(x, 1, 6, 11, 12); - chachaQR(x, 2, 7, 8, 13); - chachaQR(x, 3, 4, 9, 14); - } -} -function salsaCore(s, k, n, out, cnt, rounds = 20) { - // prettier-ignore - const y = new Uint32Array([ - s[0], k[0], k[1], k[2], // "expa" Key Key Key - k[3], s[1], n[0], n[1], // Key "nd 3" Nonce Nonce - cnt, 0, s[2], k[4], // Pos. Pos. "2-by" Key - k[5], k[6], k[7], s[3], // Key Key Key "te k" - ]); - const x = y.slice(); - salsaRound(x, rounds); - for (let i = 0; i < 16; i++) - out[i] = (y[i] + x[i]) | 0; -} -/** hsalsa hashes key and nonce into key' and nonce'. */ -// prettier-ignore -function hsalsa(s, k, i, o32) { - const x = new Uint32Array([ - s[0], k[0], k[1], k[2], - k[3], s[1], i[0], i[1], - i[2], i[3], s[2], k[4], - k[5], k[6], k[7], s[3] - ]); - salsaRound(x, 20); - let oi = 0; - o32[oi++] = x[0]; - o32[oi++] = x[5]; - o32[oi++] = x[10]; - o32[oi++] = x[15]; - o32[oi++] = x[6]; - o32[oi++] = x[7]; - o32[oi++] = x[8]; - o32[oi++] = x[9]; -} -function chachaCore(s, k, n, out, cnt, rounds = 20) { - // prettier-ignore - const y = new Uint32Array([ - s[0], s[1], s[2], s[3], // "expa" "nd 3" "2-by" "te k" - k[0], k[1], k[2], k[3], // Key Key Key Key - k[4], k[5], k[6], k[7], // Key Key Key Key - cnt, n[0], n[1], n[2], // Counter Counter Nonce Nonce - ]); - const x = y.slice(); - chachaRound(x, rounds); - for (let i = 0; i < 16; i++) - out[i] = (y[i] + x[i]) | 0; -} -/** hchacha hashes key and nonce into key' and nonce'. */ -// prettier-ignore -function hchacha(s, k, i, o32) { - const x = new Uint32Array([ - s[0], s[1], s[2], s[3], - k[0], k[1], k[2], k[3], - k[4], k[5], k[6], k[7], - i[0], i[1], i[2], i[3], - ]); - chachaRound(x, 20); - let oi = 0; - o32[oi++] = x[0]; - o32[oi++] = x[1]; - o32[oi++] = x[2]; - o32[oi++] = x[3]; - o32[oi++] = x[12]; - o32[oi++] = x[13]; - o32[oi++] = x[14]; - o32[oi++] = x[15]; -} -/** salsa20, 12-byte nonce. */ -exports.salsa20 = (0, _arx_ts_1.createCipher)(salsaCore, { - allowShortKeys: true, - counterRight: true, -}); -/** xsalsa20, 24-byte nonce. */ -exports.xsalsa20 = (0, _arx_ts_1.createCipher)(salsaCore, { - counterRight: true, - extendNonceFn: hsalsa, -}); -/** chacha20 non-RFC, original version by djb. 8-byte nonce, 8-byte counter. */ -exports.chacha20orig = (0, _arx_ts_1.createCipher)(chachaCore, { - allowShortKeys: true, - counterRight: false, - counterLength: 8, -}); -/** chacha20 RFC 8439 (IETF / TLS). 12-byte nonce, 4-byte counter. */ -exports.chacha20 = (0, _arx_ts_1.createCipher)(chachaCore, { - counterRight: false, - counterLength: 4, -}); -/** xchacha20 eXtended-nonce. https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-xchacha */ -exports.xchacha20 = (0, _arx_ts_1.createCipher)(chachaCore, { - counterRight: false, - counterLength: 8, - extendNonceFn: hchacha, -}); -/** 8-round chacha from the original paper. */ -exports.chacha8 = (0, _arx_ts_1.createCipher)(chachaCore, { - counterRight: false, - counterLength: 4, - rounds: 8, -}); -/** 12-round chacha from the original paper. */ -exports.chacha12 = (0, _arx_ts_1.createCipher)(chachaCore, { - counterRight: false, - counterLength: 4, - rounds: 12, -}); -const POW_2_130_5 = BigInt(2) ** BigInt(130) - BigInt(5); -const POW_2_128_1 = BigInt(2) ** BigInt(16 * 8) - BigInt(1); -const CLAMP_R = BigInt('0x0ffffffc0ffffffc0ffffffc0fffffff'); -const _0 = BigInt(0); -const _1 = BigInt(1); -/** Poly1305 polynomial MAC. Can be speed-up using BigUint64Array, at the cost of complexity. */ -function poly1305(msg, key) { - (0, utils_ts_1.abytes)(msg); - (0, utils_ts_1.abytes)(key, 32); - let acc = _0; - const r = bytesToNumberLE(key.subarray(0, 16)) & CLAMP_R; - const s = bytesToNumberLE(key.subarray(16)); - // Process by 16 byte chunks - for (let i = 0; i < msg.length; i += 16) { - const m = msg.subarray(i, i + 16); - const n = bytesToNumberLE(m) | (_1 << BigInt(8 * m.length)); - acc = ((acc + n) * r) % POW_2_130_5; - } - const res = (acc + s) & POW_2_128_1; - return numberToBytesLE(res, 16); -} -function computeTag(fn, key, nonce, ciphertext, AAD) { - const res = []; - if (AAD) { - res.push(AAD); - const leftover = AAD.length % 16; - if (leftover > 0) - res.push(new Uint8Array(16 - leftover)); - } - res.push(ciphertext); - const leftover = ciphertext.length % 16; - if (leftover > 0) - res.push(new Uint8Array(16 - leftover)); - res.push((0, utils_ts_1.u64Lengths)(ciphertext.length, AAD ? AAD.length : 0, true)); - const authKey = fn(key, nonce, new Uint8Array(32)); - return poly1305((0, utils_ts_1.concatBytes)(...res), authKey); -} -/** xsalsa20-poly1305 eXtended-nonce (24 bytes) salsa. */ -exports.xsalsa20poly1305 = (0, utils_ts_1.wrapCipher)({ blockSize: 64, nonceLength: 24, tagLength: 16 }, function xsalsapoly(key, nonce) { - return { - encrypt(plaintext) { - const m = (0, utils_ts_1.concatBytes)(new Uint8Array(32), plaintext); - const c = (0, exports.xsalsa20)(key, nonce, m); - const authKey = c.subarray(0, 32); - const data = c.subarray(32); - const tag = poly1305(data, authKey); - return (0, utils_ts_1.concatBytes)(tag, data); - }, - decrypt(ciphertext) { - const c = (0, utils_ts_1.concatBytes)(new Uint8Array(16), ciphertext); - const passedTag = c.subarray(16, 32); - const authKey = (0, exports.xsalsa20)(key, nonce, new Uint8Array(32)); - const tag = poly1305(c.subarray(32), authKey); - if (!(0, utils_ts_1.equalBytes)(tag, passedTag)) - throw new Error('invalid poly1305 tag'); - return (0, exports.xsalsa20)(key, nonce, c).subarray(32); - }, - }; -}); -/** Alias to `xsalsa20poly1305`. */ -function secretbox(key, nonce) { - const xs = (0, exports.xsalsa20poly1305)(key, nonce); - return { seal: xs.encrypt, open: xs.decrypt }; -} -const _poly1305_aead = (fn) => (key, nonce, AAD) => { - const tagLength = 16; - return { - encrypt(plaintext) { - const data = fn(key, nonce, plaintext, undefined, 1); // stream from i=1 - const tag = computeTag(fn, key, nonce, data, AAD); - return (0, utils_ts_1.concatBytes)(data, tag); - }, - decrypt(ciphertext) { - const passedTag = ciphertext.subarray(-tagLength); - const data = ciphertext.subarray(0, -tagLength); - const tag = computeTag(fn, key, nonce, data, AAD); - if (!(0, utils_ts_1.equalBytes)(tag, passedTag)) - throw new Error('invalid poly1305 tag'); - return fn(key, nonce, data, undefined, 1); // stream from i=1 - }, - }; -}; -exports._poly1305_aead = _poly1305_aead; -/** chacha20-poly1305 12-byte-nonce chacha. */ -exports.chacha20poly1305 = (0, utils_ts_1.wrapCipher)({ blockSize: 64, nonceLength: 12, tagLength: 16 }, (0, exports._poly1305_aead)(exports.chacha20)); -/** - * XChaCha20-Poly1305 extended-nonce chacha. Can be safely used with random nonces (CSPRNG). - */ -exports.xchacha20poly1305 = (0, utils_ts_1.wrapCipher)({ blockSize: 64, nonceLength: 24, tagLength: 16 }, (0, exports._poly1305_aead)(exports.xchacha20)); -//# sourceMappingURL=_micro.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/_micro.js.map b/tools/mnemonic-test/node_modules/@noble/ciphers/_micro.js.map deleted file mode 100644 index 152ccf66..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/_micro.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_micro.js","sourceRoot":"","sources":["src/_micro.ts"],"names":[],"mappings":";;;AAmGA,wBAaC;AAwBD,0BAaC;AAuDD,4BAcC;AAiDD,8BASC;AApRD;;;;;GAKG;AACH,uEAAuE;AACvE,kBAAkB;AAClB,uCAA+C;AAC/C,yCAWoB;AAQpB,SAAS,eAAe,CAAC,KAAiB;IACxC,IAAA,iBAAM,EAAC,KAAK,CAAC,CAAC;IACd,OAAO,IAAA,sBAAW,EAAC,IAAA,qBAAU,EAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;AACnE,CAAC;AAED,SAAS,eAAe,CAAC,CAAkB,EAAE,GAAW;IACtD,OAAO,IAAA,0BAAe,EAAC,CAAC,EAAE,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC;AAC3C,CAAC;AAED,SAAS,OAAO,CAAC,CAAc,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS;IACzE,CAAC,CAAC,CAAC,CAAC,IAAI,IAAA,cAAI,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC,CAAC,IAAI,IAAA,cAAI,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC,CAAC,IAAI,IAAA,cAAI,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAA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C,sBAAsB,CAAC,CAAC;YACzE,OAAO,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC,kBAAkB;QAC/D,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAlBS,QAAA,cAAc,kBAkBvB;AAEJ,8CAA8C;AACjC,QAAA,gBAAgB,GAA+B,IAAA,qBAAU,EACpE,EAAE,SAAS,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,EACjD,IAAA,sBAAc,EAAC,gBAAQ,CAAC,CACzB,CAAC;AAEF;;GAEG;AACU,QAAA,iBAAiB,GAA+B,IAAA,qBAAU,EACrE,EAAE,SAAS,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,EACjD,IAAA,sBAAc,EAAC,iBAAS,CAAC,CAC1B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/_poly1305.d.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/_poly1305.d.ts deleted file mode 100644 index 921dd3bb..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/_poly1305.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Poly1305 ([PDF](https://cr.yp.to/mac/poly1305-20050329.pdf), - * [wiki](https://en.wikipedia.org/wiki/Poly1305)) - * is a fast and parallel secret-key message-authentication code suitable for - * a wide variety of applications. It was standardized in - * [RFC 8439](https://datatracker.ietf.org/doc/html/rfc8439) and is now used in TLS 1.3. - * - * Polynomial MACs are not perfect for every situation: - * they lack Random Key Robustness: the MAC can be forged, and can't be used in PAKE schemes. - * See [invisible salamanders attack](https://keymaterial.net/2020/09/07/invisible-salamanders-in-aes-gcm-siv/). - * To combat invisible salamanders, `hash(key)` can be included in ciphertext, - * however, this would violate ciphertext indistinguishability: - * an attacker would know which key was used - so `HKDF(key, i)` - * could be used instead. - * - * Check out [original website](https://cr.yp.to/mac.html). - * @module - */ -import { Hash, type Input } from './utils.ts'; -export type CHash = ReturnType; -export declare function wrapConstructorWithKey>(hashCons: (key: Input) => Hash): { - (msg: Input, key: Input): Uint8Array; - outputLen: number; - blockLen: number; - create(key: Input): Hash; -}; -/** Poly1305 MAC from RFC 8439. */ -export declare const poly1305: CHash; -//# sourceMappingURL=_poly1305.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/_poly1305.d.ts.map b/tools/mnemonic-test/node_modules/@noble/ciphers/_poly1305.d.ts.map deleted file mode 100644 index 2c3597ee..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/_poly1305.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_poly1305.d.ts","sourceRoot":"","sources":["src/_poly1305.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,IAAI,EAAE,KAAK,KAAK,EAA4C,MAAM,YAAY,CAAC;AA4QxF,MAAM,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAC9D,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,CAAC,EACtD,QAAQ,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,GAChC;IACD,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,GAAG,UAAU,CAAC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;CAC7B,CAOA;AAED,kCAAkC;AAClC,eAAO,MAAM,QAAQ,EAAE,KAA0D,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/_poly1305.js b/tools/mnemonic-test/node_modules/@noble/ciphers/_poly1305.js deleted file mode 100644 index 2e6a5b2a..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/_poly1305.js +++ /dev/null @@ -1,281 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.poly1305 = void 0; -exports.wrapConstructorWithKey = wrapConstructorWithKey; -/** - * Poly1305 ([PDF](https://cr.yp.to/mac/poly1305-20050329.pdf), - * [wiki](https://en.wikipedia.org/wiki/Poly1305)) - * is a fast and parallel secret-key message-authentication code suitable for - * a wide variety of applications. It was standardized in - * [RFC 8439](https://datatracker.ietf.org/doc/html/rfc8439) and is now used in TLS 1.3. - * - * Polynomial MACs are not perfect for every situation: - * they lack Random Key Robustness: the MAC can be forged, and can't be used in PAKE schemes. - * See [invisible salamanders attack](https://keymaterial.net/2020/09/07/invisible-salamanders-in-aes-gcm-siv/). - * To combat invisible salamanders, `hash(key)` can be included in ciphertext, - * however, this would violate ciphertext indistinguishability: - * an attacker would know which key was used - so `HKDF(key, i)` - * could be used instead. - * - * Check out [original website](https://cr.yp.to/mac.html). - * @module - */ -const utils_ts_1 = require("./utils.js"); -// Based on Public Domain poly1305-donna https://github.com/floodyberry/poly1305-donna -const u8to16 = (a, i) => (a[i++] & 0xff) | ((a[i++] & 0xff) << 8); -class Poly1305 { - constructor(key) { - this.blockLen = 16; - this.outputLen = 16; - this.buffer = new Uint8Array(16); - this.r = new Uint16Array(10); - this.h = new Uint16Array(10); - this.pad = new Uint16Array(8); - this.pos = 0; - this.finished = false; - key = (0, utils_ts_1.toBytes)(key); - (0, utils_ts_1.abytes)(key, 32); - const t0 = u8to16(key, 0); - const t1 = u8to16(key, 2); - const t2 = u8to16(key, 4); - const t3 = u8to16(key, 6); - const t4 = u8to16(key, 8); - const t5 = u8to16(key, 10); - const t6 = u8to16(key, 12); - const t7 = u8to16(key, 14); - // https://github.com/floodyberry/poly1305-donna/blob/e6ad6e091d30d7f4ec2d4f978be1fcfcbce72781/poly1305-donna-16.h#L47 - this.r[0] = t0 & 0x1fff; - this.r[1] = ((t0 >>> 13) | (t1 << 3)) & 0x1fff; - this.r[2] = ((t1 >>> 10) | (t2 << 6)) & 0x1f03; - this.r[3] = ((t2 >>> 7) | (t3 << 9)) & 0x1fff; - this.r[4] = ((t3 >>> 4) | (t4 << 12)) & 0x00ff; - this.r[5] = (t4 >>> 1) & 0x1ffe; - this.r[6] = ((t4 >>> 14) | (t5 << 2)) & 0x1fff; - this.r[7] = ((t5 >>> 11) | (t6 << 5)) & 0x1f81; - this.r[8] = ((t6 >>> 8) | (t7 << 8)) & 0x1fff; - this.r[9] = (t7 >>> 5) & 0x007f; - for (let i = 0; i < 8; i++) - this.pad[i] = u8to16(key, 16 + 2 * i); - } - process(data, offset, isLast = false) { - const hibit = isLast ? 0 : 1 << 11; - const { h, r } = this; - const r0 = r[0]; - const r1 = r[1]; - const r2 = r[2]; - const r3 = r[3]; - const r4 = r[4]; - const r5 = r[5]; - const r6 = r[6]; - const r7 = r[7]; - const r8 = r[8]; - const r9 = r[9]; - const t0 = u8to16(data, offset + 0); - const t1 = u8to16(data, offset + 2); - const t2 = u8to16(data, offset + 4); - const t3 = u8to16(data, offset + 6); - const t4 = u8to16(data, offset + 8); - const t5 = u8to16(data, offset + 10); - const t6 = u8to16(data, offset + 12); - const t7 = u8to16(data, offset + 14); - let h0 = h[0] + (t0 & 0x1fff); - let h1 = h[1] + (((t0 >>> 13) | (t1 << 3)) & 0x1fff); - let h2 = h[2] + (((t1 >>> 10) | (t2 << 6)) & 0x1fff); - let h3 = h[3] + (((t2 >>> 7) | (t3 << 9)) & 0x1fff); - let h4 = h[4] + (((t3 >>> 4) | (t4 << 12)) & 0x1fff); - let h5 = h[5] + ((t4 >>> 1) & 0x1fff); - let h6 = h[6] + (((t4 >>> 14) | (t5 << 2)) & 0x1fff); - let h7 = h[7] + (((t5 >>> 11) | (t6 << 5)) & 0x1fff); - let h8 = h[8] + (((t6 >>> 8) | (t7 << 8)) & 0x1fff); - let h9 = h[9] + ((t7 >>> 5) | hibit); - let c = 0; - let d0 = c + h0 * r0 + h1 * (5 * r9) + h2 * (5 * r8) + h3 * (5 * r7) + h4 * (5 * r6); - c = d0 >>> 13; - d0 &= 0x1fff; - d0 += h5 * (5 * r5) + h6 * (5 * r4) + h7 * (5 * r3) + h8 * (5 * r2) + h9 * (5 * r1); - c += d0 >>> 13; - d0 &= 0x1fff; - let d1 = c + h0 * r1 + h1 * r0 + h2 * (5 * r9) + h3 * (5 * r8) + h4 * (5 * r7); - c = d1 >>> 13; - d1 &= 0x1fff; - d1 += h5 * (5 * r6) + h6 * (5 * r5) + h7 * (5 * r4) + h8 * (5 * r3) + h9 * (5 * r2); - c += d1 >>> 13; - d1 &= 0x1fff; - let d2 = c + h0 * r2 + h1 * r1 + h2 * r0 + h3 * (5 * r9) + h4 * (5 * r8); - c = d2 >>> 13; - d2 &= 0x1fff; - d2 += h5 * (5 * r7) + h6 * (5 * r6) + h7 * (5 * r5) + h8 * (5 * r4) + h9 * (5 * r3); - c += d2 >>> 13; - d2 &= 0x1fff; - let d3 = c + h0 * r3 + h1 * r2 + h2 * r1 + h3 * r0 + h4 * (5 * r9); - c = d3 >>> 13; - d3 &= 0x1fff; - d3 += h5 * (5 * r8) + h6 * (5 * r7) + h7 * (5 * r6) + h8 * (5 * r5) + h9 * (5 * r4); - c += d3 >>> 13; - d3 &= 0x1fff; - let d4 = c + h0 * r4 + h1 * r3 + h2 * r2 + h3 * r1 + h4 * r0; - c = d4 >>> 13; - d4 &= 0x1fff; - d4 += h5 * (5 * r9) + h6 * (5 * r8) + h7 * (5 * r7) + h8 * (5 * r6) + h9 * (5 * r5); - c += d4 >>> 13; - d4 &= 0x1fff; - let d5 = c + h0 * r5 + h1 * r4 + h2 * r3 + h3 * r2 + h4 * r1; - c = d5 >>> 13; - d5 &= 0x1fff; - d5 += h5 * r0 + h6 * (5 * r9) + h7 * (5 * r8) + h8 * (5 * r7) + h9 * (5 * r6); - c += d5 >>> 13; - d5 &= 0x1fff; - let d6 = c + h0 * r6 + h1 * r5 + h2 * r4 + h3 * r3 + h4 * r2; - c = d6 >>> 13; - d6 &= 0x1fff; - d6 += h5 * r1 + h6 * r0 + h7 * (5 * r9) + h8 * (5 * r8) + h9 * (5 * r7); - c += d6 >>> 13; - d6 &= 0x1fff; - let d7 = c + h0 * r7 + h1 * r6 + h2 * r5 + h3 * r4 + h4 * r3; - c = d7 >>> 13; - d7 &= 0x1fff; - d7 += h5 * r2 + h6 * r1 + h7 * r0 + h8 * (5 * r9) + h9 * (5 * r8); - c += d7 >>> 13; - d7 &= 0x1fff; - let d8 = c + h0 * r8 + h1 * r7 + h2 * r6 + h3 * r5 + h4 * r4; - c = d8 >>> 13; - d8 &= 0x1fff; - d8 += h5 * r3 + h6 * r2 + h7 * r1 + h8 * r0 + h9 * (5 * r9); - c += d8 >>> 13; - d8 &= 0x1fff; - let d9 = c + h0 * r9 + h1 * r8 + h2 * r7 + h3 * r6 + h4 * r5; - c = d9 >>> 13; - d9 &= 0x1fff; - d9 += h5 * r4 + h6 * r3 + h7 * r2 + h8 * r1 + h9 * r0; - c += d9 >>> 13; - d9 &= 0x1fff; - c = ((c << 2) + c) | 0; - c = (c + d0) | 0; - d0 = c & 0x1fff; - c = c >>> 13; - d1 += c; - h[0] = d0; - h[1] = d1; - h[2] = d2; - h[3] = d3; - h[4] = d4; - h[5] = d5; - h[6] = d6; - h[7] = d7; - h[8] = d8; - h[9] = d9; - } - finalize() { - const { h, pad } = this; - const g = new Uint16Array(10); - let c = h[1] >>> 13; - h[1] &= 0x1fff; - for (let i = 2; i < 10; i++) { - h[i] += c; - c = h[i] >>> 13; - h[i] &= 0x1fff; - } - h[0] += c * 5; - c = h[0] >>> 13; - h[0] &= 0x1fff; - h[1] += c; - c = h[1] >>> 13; - h[1] &= 0x1fff; - h[2] += c; - g[0] = h[0] + 5; - c = g[0] >>> 13; - g[0] &= 0x1fff; - for (let i = 1; i < 10; i++) { - g[i] = h[i] + c; - c = g[i] >>> 13; - g[i] &= 0x1fff; - } - g[9] -= 1 << 13; - let mask = (c ^ 1) - 1; - for (let i = 0; i < 10; i++) - g[i] &= mask; - mask = ~mask; - for (let i = 0; i < 10; i++) - h[i] = (h[i] & mask) | g[i]; - h[0] = (h[0] | (h[1] << 13)) & 0xffff; - h[1] = ((h[1] >>> 3) | (h[2] << 10)) & 0xffff; - h[2] = ((h[2] >>> 6) | (h[3] << 7)) & 0xffff; - h[3] = ((h[3] >>> 9) | (h[4] << 4)) & 0xffff; - h[4] = ((h[4] >>> 12) | (h[5] << 1) | (h[6] << 14)) & 0xffff; - h[5] = ((h[6] >>> 2) | (h[7] << 11)) & 0xffff; - h[6] = ((h[7] >>> 5) | (h[8] << 8)) & 0xffff; - h[7] = ((h[8] >>> 8) | (h[9] << 5)) & 0xffff; - let f = h[0] + pad[0]; - h[0] = f & 0xffff; - for (let i = 1; i < 8; i++) { - f = (((h[i] + pad[i]) | 0) + (f >>> 16)) | 0; - h[i] = f & 0xffff; - } - (0, utils_ts_1.clean)(g); - } - update(data) { - (0, utils_ts_1.aexists)(this); - data = (0, utils_ts_1.toBytes)(data); - (0, utils_ts_1.abytes)(data); - const { buffer, blockLen } = this; - const len = data.length; - for (let pos = 0; pos < len;) { - const take = Math.min(blockLen - this.pos, len - pos); - // Fast path: we have at least one block in input - if (take === blockLen) { - for (; blockLen <= len - pos; pos += blockLen) - this.process(data, pos); - continue; - } - buffer.set(data.subarray(pos, pos + take), this.pos); - this.pos += take; - pos += take; - if (this.pos === blockLen) { - this.process(buffer, 0, false); - this.pos = 0; - } - } - return this; - } - destroy() { - (0, utils_ts_1.clean)(this.h, this.r, this.buffer, this.pad); - } - digestInto(out) { - (0, utils_ts_1.aexists)(this); - (0, utils_ts_1.aoutput)(out, this); - this.finished = true; - const { buffer, h } = this; - let { pos } = this; - if (pos) { - buffer[pos++] = 1; - for (; pos < 16; pos++) - buffer[pos] = 0; - this.process(buffer, 0, true); - } - this.finalize(); - let opos = 0; - for (let i = 0; i < 8; i++) { - out[opos++] = h[i] >>> 0; - out[opos++] = h[i] >>> 8; - } - return out; - } - digest() { - const { buffer, outputLen } = this; - this.digestInto(buffer); - const res = buffer.slice(0, outputLen); - this.destroy(); - return res; - } -} -function wrapConstructorWithKey(hashCons) { - const hashC = (msg, key) => hashCons(key).update((0, utils_ts_1.toBytes)(msg)).digest(); - const tmp = hashCons(new Uint8Array(32)); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = (key) => hashCons(key); - return hashC; -} -/** Poly1305 MAC from RFC 8439. */ -exports.poly1305 = wrapConstructorWithKey((key) => new Poly1305(key)); -//# sourceMappingURL=_poly1305.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/_poly1305.js.map b/tools/mnemonic-test/node_modules/@noble/ciphers/_poly1305.js.map deleted file mode 100644 index 4bcbc2d3..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/_poly1305.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_poly1305.js","sourceRoot":"","sources":["src/_poly1305.ts"],"names":[],"mappings":";;;AA+RA,wDAcC;AA7SD;;;;;;;;;;;;;;;;;GAiBG;AACH,yCAAwF;AAExF,sFAAsF;AACtF,MAAM,MAAM,GAAG,CAAC,CAAa,EAAE,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AACtF,MAAM,QAAQ;IAUZ,YAAY,GAAU;QATb,aAAQ,GAAG,EAAE,CAAC;QACd,cAAS,GAAG,EAAE,CAAC;QAChB,WAAM,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;QAC5B,MAAC,GAAG,IAAI,WAAW,CAAC,EAAE,CAAC,CAAC;QACxB,MAAC,GAAG,IAAI,WAAW,CAAC,EAAE,CAAC,CAAC;QACxB,QAAG,GAAG,IAAI,WAAW,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;IACD,MAAM;QACJ,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;QACnC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACxB,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;QACvC,IAAI,CAAC,OAAO,EAAE,CAAC;QACf,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AAGD,SAAgB,sBAAsB,CACpC,QAAiC;IAOjC,MAAM,KAAK,GAAG,CAAC,GAAU,EAAE,GAAU,EAAc,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,IAAA,kBAAO,EAAC,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAClG,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC;IACzC,KAAK,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC;IAChC,KAAK,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;IAC9B,KAAK,CAAC,MAAM,GAAG,CAAC,GAAU,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC7C,OAAO,KAAK,CAAC;AACf,CAAC;AAED,kCAAkC;AACrB,QAAA,QAAQ,GAAU,sBAAsB,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/_polyval.d.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/_polyval.d.ts deleted file mode 100644 index df7d9de7..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/_polyval.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * GHash from AES-GCM and its little-endian "mirror image" Polyval from AES-SIV. - * - * Implemented in terms of GHash with conversion function for keys - * GCM GHASH from - * [NIST SP800-38d](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf), - * SIV from - * [RFC 8452](https://datatracker.ietf.org/doc/html/rfc8452). - * - * GHASH modulo: x^128 + x^7 + x^2 + x + 1 - * POLYVAL modulo: x^128 + x^127 + x^126 + x^121 + 1 - * - * @module - */ -import { Hash, type Input } from './utils.ts'; -/** - * `mulX_POLYVAL(ByteReverse(H))` from spec - * @param k mutated in place - */ -export declare function _toGHASHKey(k: Uint8Array): Uint8Array; -export type CHashPV = ReturnType; -declare function wrapConstructorWithKey>(hashCons: (key: Input, expectedLength?: number) => Hash): { - (msg: Input, key: Input): Uint8Array; - outputLen: number; - blockLen: number; - create(key: Input, expectedLength?: number): Hash; -}; -/** GHash MAC for AES-GCM. */ -export declare const ghash: CHashPV; -/** Polyval MAC for AES-SIV. */ -export declare const polyval: CHashPV; -export {}; -//# sourceMappingURL=_polyval.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/_polyval.d.ts.map b/tools/mnemonic-test/node_modules/@noble/ciphers/_polyval.d.ts.map deleted file mode 100644 index 2b69670c..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/_polyval.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_polyval.d.ts","sourceRoot":"","sources":["src/_polyval.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAEyB,IAAI,EAAE,KAAK,KAAK,EAC/C,MAAM,YAAY,CAAC;AA6BpB;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,UAAU,GAAG,UAAU,CAYrD;AAiLD,MAAM,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAChE,iBAAS,sBAAsB,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,CAAC,EAC/C,QAAQ,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,cAAc,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,GACzD;IACD,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,GAAG,UAAU,CAAC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;CACtD,CAQA;AAED,6BAA6B;AAC7B,eAAO,MAAM,KAAK,EAAE,OAEnB,CAAC;AAEF,+BAA+B;AAC/B,eAAO,MAAM,OAAO,EAAE,OAErB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/_polyval.js b/tools/mnemonic-test/node_modules/@noble/ciphers/_polyval.js deleted file mode 100644 index 3cee4390..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/_polyval.js +++ /dev/null @@ -1,233 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.polyval = exports.ghash = void 0; -exports._toGHASHKey = _toGHASHKey; -/** - * GHash from AES-GCM and its little-endian "mirror image" Polyval from AES-SIV. - * - * Implemented in terms of GHash with conversion function for keys - * GCM GHASH from - * [NIST SP800-38d](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf), - * SIV from - * [RFC 8452](https://datatracker.ietf.org/doc/html/rfc8452). - * - * GHASH modulo: x^128 + x^7 + x^2 + x + 1 - * POLYVAL modulo: x^128 + x^127 + x^126 + x^121 + 1 - * - * @module - */ -// prettier-ignore -const utils_ts_1 = require("./utils.js"); -const BLOCK_SIZE = 16; -// TODO: rewrite -// temporary padding buffer -const ZEROS16 = /* @__PURE__ */ new Uint8Array(16); -const ZEROS32 = (0, utils_ts_1.u32)(ZEROS16); -const POLY = 0xe1; // v = 2*v % POLY -// v = 2*v % POLY -// NOTE: because x + x = 0 (add/sub is same), mul2(x) != x+x -// We can multiply any number using montgomery ladder and this function (works as double, add is simple xor) -const mul2 = (s0, s1, s2, s3) => { - const hiBit = s3 & 1; - return { - s3: (s2 << 31) | (s3 >>> 1), - s2: (s1 << 31) | (s2 >>> 1), - s1: (s0 << 31) | (s1 >>> 1), - s0: (s0 >>> 1) ^ ((POLY << 24) & -(hiBit & 1)), // reduce % poly - }; -}; -const swapLE = (n) => (((n >>> 0) & 0xff) << 24) | - (((n >>> 8) & 0xff) << 16) | - (((n >>> 16) & 0xff) << 8) | - ((n >>> 24) & 0xff) | - 0; -/** - * `mulX_POLYVAL(ByteReverse(H))` from spec - * @param k mutated in place - */ -function _toGHASHKey(k) { - k.reverse(); - const hiBit = k[15] & 1; - // k >>= 1 - let carry = 0; - for (let i = 0; i < k.length; i++) { - const t = k[i]; - k[i] = (t >>> 1) | carry; - carry = (t & 1) << 7; - } - k[0] ^= -hiBit & 0xe1; // if (hiBit) n ^= 0xe1000000000000000000000000000000; - return k; -} -const estimateWindow = (bytes) => { - if (bytes > 64 * 1024) - return 8; - if (bytes > 1024) - return 4; - return 2; -}; -class GHASH { - // We select bits per window adaptively based on expectedLength - constructor(key, expectedLength) { - this.blockLen = BLOCK_SIZE; - this.outputLen = BLOCK_SIZE; - this.s0 = 0; - this.s1 = 0; - this.s2 = 0; - this.s3 = 0; - this.finished = false; - key = (0, utils_ts_1.toBytes)(key); - (0, utils_ts_1.abytes)(key, 16); - const kView = (0, utils_ts_1.createView)(key); - let k0 = kView.getUint32(0, false); - let k1 = kView.getUint32(4, false); - let k2 = kView.getUint32(8, false); - let k3 = kView.getUint32(12, false); - // generate table of doubled keys (half of montgomery ladder) - const doubles = []; - for (let i = 0; i < 128; i++) { - doubles.push({ s0: swapLE(k0), s1: swapLE(k1), s2: swapLE(k2), s3: swapLE(k3) }); - ({ s0: k0, s1: k1, s2: k2, s3: k3 } = mul2(k0, k1, k2, k3)); - } - const W = estimateWindow(expectedLength || 1024); - if (![1, 2, 4, 8].includes(W)) - throw new Error('ghash: invalid window size, expected 2, 4 or 8'); - this.W = W; - const bits = 128; // always 128 bits; - const windows = bits / W; - const windowSize = (this.windowSize = 2 ** W); - const items = []; - // Create precompute table for window of W bits - for (let w = 0; w < windows; w++) { - // truth table: 00, 01, 10, 11 - for (let byte = 0; byte < windowSize; byte++) { - // prettier-ignore - let s0 = 0, s1 = 0, s2 = 0, s3 = 0; - for (let j = 0; j < W; j++) { - const bit = (byte >>> (W - j - 1)) & 1; - if (!bit) - continue; - const { s0: d0, s1: d1, s2: d2, s3: d3 } = doubles[W * w + j]; - (s0 ^= d0), (s1 ^= d1), (s2 ^= d2), (s3 ^= d3); - } - items.push({ s0, s1, s2, s3 }); - } - } - this.t = items; - } - _updateBlock(s0, s1, s2, s3) { - (s0 ^= this.s0), (s1 ^= this.s1), (s2 ^= this.s2), (s3 ^= this.s3); - const { W, t, windowSize } = this; - // prettier-ignore - let o0 = 0, o1 = 0, o2 = 0, o3 = 0; - const mask = (1 << W) - 1; // 2**W will kill performance. - let w = 0; - for (const num of [s0, s1, s2, s3]) { - for (let bytePos = 0; bytePos < 4; bytePos++) { - const byte = (num >>> (8 * bytePos)) & 0xff; - for (let bitPos = 8 / W - 1; bitPos >= 0; bitPos--) { - const bit = (byte >>> (W * bitPos)) & mask; - const { s0: e0, s1: e1, s2: e2, s3: e3 } = t[w * windowSize + bit]; - (o0 ^= e0), (o1 ^= e1), (o2 ^= e2), (o3 ^= e3); - w += 1; - } - } - } - this.s0 = o0; - this.s1 = o1; - this.s2 = o2; - this.s3 = o3; - } - update(data) { - (0, utils_ts_1.aexists)(this); - data = (0, utils_ts_1.toBytes)(data); - (0, utils_ts_1.abytes)(data); - const b32 = (0, utils_ts_1.u32)(data); - const blocks = Math.floor(data.length / BLOCK_SIZE); - const left = data.length % BLOCK_SIZE; - for (let i = 0; i < blocks; i++) { - this._updateBlock(b32[i * 4 + 0], b32[i * 4 + 1], b32[i * 4 + 2], b32[i * 4 + 3]); - } - if (left) { - ZEROS16.set(data.subarray(blocks * BLOCK_SIZE)); - this._updateBlock(ZEROS32[0], ZEROS32[1], ZEROS32[2], ZEROS32[3]); - (0, utils_ts_1.clean)(ZEROS32); // clean tmp buffer - } - return this; - } - destroy() { - const { t } = this; - // clean precompute table - for (const elm of t) { - (elm.s0 = 0), (elm.s1 = 0), (elm.s2 = 0), (elm.s3 = 0); - } - } - digestInto(out) { - (0, utils_ts_1.aexists)(this); - (0, utils_ts_1.aoutput)(out, this); - this.finished = true; - const { s0, s1, s2, s3 } = this; - const o32 = (0, utils_ts_1.u32)(out); - o32[0] = s0; - o32[1] = s1; - o32[2] = s2; - o32[3] = s3; - return out; - } - digest() { - const res = new Uint8Array(BLOCK_SIZE); - this.digestInto(res); - this.destroy(); - return res; - } -} -class Polyval extends GHASH { - constructor(key, expectedLength) { - key = (0, utils_ts_1.toBytes)(key); - (0, utils_ts_1.abytes)(key); - const ghKey = _toGHASHKey((0, utils_ts_1.copyBytes)(key)); - super(ghKey, expectedLength); - (0, utils_ts_1.clean)(ghKey); - } - update(data) { - data = (0, utils_ts_1.toBytes)(data); - (0, utils_ts_1.aexists)(this); - const b32 = (0, utils_ts_1.u32)(data); - const left = data.length % BLOCK_SIZE; - const blocks = Math.floor(data.length / BLOCK_SIZE); - for (let i = 0; i < blocks; i++) { - this._updateBlock(swapLE(b32[i * 4 + 3]), swapLE(b32[i * 4 + 2]), swapLE(b32[i * 4 + 1]), swapLE(b32[i * 4 + 0])); - } - if (left) { - ZEROS16.set(data.subarray(blocks * BLOCK_SIZE)); - this._updateBlock(swapLE(ZEROS32[3]), swapLE(ZEROS32[2]), swapLE(ZEROS32[1]), swapLE(ZEROS32[0])); - (0, utils_ts_1.clean)(ZEROS32); - } - return this; - } - digestInto(out) { - (0, utils_ts_1.aexists)(this); - (0, utils_ts_1.aoutput)(out, this); - this.finished = true; - // tmp ugly hack - const { s0, s1, s2, s3 } = this; - const o32 = (0, utils_ts_1.u32)(out); - o32[0] = s0; - o32[1] = s1; - o32[2] = s2; - o32[3] = s3; - return out.reverse(); - } -} -function wrapConstructorWithKey(hashCons) { - const hashC = (msg, key) => hashCons(key, msg.length).update((0, utils_ts_1.toBytes)(msg)).digest(); - const tmp = hashCons(new Uint8Array(16), 0); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = (key, expectedLength) => hashCons(key, expectedLength); - return hashC; -} -/** GHash MAC for AES-GCM. */ -exports.ghash = wrapConstructorWithKey((key, expectedLength) => new GHASH(key, expectedLength)); -/** Polyval MAC for AES-SIV. */ -exports.polyval = wrapConstructorWithKey((key, expectedLength) => new Polyval(key, expectedLength)); -//# sourceMappingURL=_polyval.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/_polyval.js.map b/tools/mnemonic-test/node_modules/@noble/ciphers/_polyval.js.map deleted file mode 100644 index 4f2b9ffb..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/_polyval.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_polyval.js","sourceRoot":"","sources":["src/_polyval.ts"],"names":[],"mappings":";;;AAmDA,kCAYC;AA/DD;;;;;;;;;;;;;GAaG;AACH,kBAAkB;AAClB,yCAGoB;AAEpB,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,gBAAgB;AAChB,2BAA2B;AAC3B,MAAM,OAAO,GAAG,eAAe,CAAC,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;AACnD,MAAM,OAAO,GAAG,IAAA,cAAG,EAAC,OAAO,CAAC,CAAC;AAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,iBAAiB;AAEpC,iBAAiB;AACjB,4DAA4D;AAC5D,4GAA4G;AAC5G,MAAM,IAAI,GAAG,CAAC,EAAU,EAAE,EAAU,EAAE,EAAU,EAAE,EAAU,EAAE,EAAE;IAC9D,MAAM,KAAK,GAAG,EAAE,GAAG,CAAC,CAAC;IACrB,OAAO;QACL,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,CAA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EAAE,CAAC,IAAI,KAAK,CAAC,GAAG,EAAE,cAAc,CAAC,CACxD,CAAC;AAEF,+BAA+B;AAClB,QAAA,OAAO,GAAY,sBAAsB,CACpD,CAAC,GAAG,EAAE,cAAc,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,GAAG,EAAE,cAAc,CAAC,CAC1D,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/aes.d.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/aes.d.ts deleted file mode 100644 index 010a88a6..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/aes.d.ts +++ /dev/null @@ -1,117 +0,0 @@ -import { type Cipher, type CipherWithOutput } from './utils.ts'; -/** Key expansion used in CTR. */ -declare function expandKeyLE(key: Uint8Array): Uint32Array; -declare function expandKeyDecLE(key: Uint8Array): Uint32Array; -declare function encrypt(xk: Uint32Array, s0: number, s1: number, s2: number, s3: number): { - s0: number; - s1: number; - s2: number; - s3: number; -}; -declare function decrypt(xk: Uint32Array, s0: number, s1: number, s2: number, s3: number): { - s0: number; - s1: number; - s2: number; - s3: number; -}; -declare function ctrCounter(xk: Uint32Array, nonce: Uint8Array, src: Uint8Array, dst?: Uint8Array): Uint8Array; -declare function ctr32(xk: Uint32Array, isLE: boolean, nonce: Uint8Array, src: Uint8Array, dst?: Uint8Array): Uint8Array; -/** - * CTR: counter mode. Creates stream cipher. - * Requires good IV. Parallelizable. OK, but no MAC. - */ -export declare const ctr: ((key: Uint8Array, nonce: Uint8Array) => CipherWithOutput) & { - blockSize: number; - nonceLength: number; -}; -/** Options for ECB and CBC. */ -export type BlockOpts = { - disablePadding?: boolean; -}; -/** - * ECB: Electronic CodeBook. Simple deterministic replacement. - * Dangerous: always map x to y. See [AES Penguin](https://words.filippo.io/the-ecb-penguin/). - */ -export declare const ecb: ((key: Uint8Array, opts?: BlockOpts) => CipherWithOutput) & { - blockSize: number; -}; -/** - * CBC: Cipher-Block-Chaining. Key is previous round’s block. - * Fragile: needs proper padding. Unauthenticated: needs MAC. - */ -export declare const cbc: ((key: Uint8Array, iv: Uint8Array, opts?: BlockOpts) => CipherWithOutput) & { - blockSize: number; - nonceLength: number; -}; -/** - * CFB: Cipher Feedback Mode. The input for the block cipher is the previous cipher output. - * Unauthenticated: needs MAC. - */ -export declare const cfb: ((key: Uint8Array, iv: Uint8Array) => CipherWithOutput) & { - blockSize: number; - nonceLength: number; -}; -/** - * GCM: Galois/Counter Mode. - * Modern, parallel version of CTR, with MAC. - * Be careful: MACs can be forged. - * Unsafe to use random nonces under the same key, due to collision chance. - * As for nonce size, prefer 12-byte, instead of 8-byte. - */ -export declare const gcm: ((key: Uint8Array, nonce: Uint8Array, AAD?: Uint8Array) => Cipher) & { - blockSize: number; - nonceLength: number; - tagLength: number; - varSizeNonce: true; -}; -/** - * AES-GCM-SIV: classic AES-GCM with nonce-misuse resistance. - * Guarantees that, when a nonce is repeated, the only security loss is that identical - * plaintexts will produce identical ciphertexts. - * RFC 8452, https://datatracker.ietf.org/doc/html/rfc8452 - */ -export declare const gcmsiv: ((key: Uint8Array, nonce: Uint8Array, AAD?: Uint8Array) => Cipher) & { - blockSize: number; - nonceLength: number; - tagLength: number; - varSizeNonce: true; -}; -/** - * AES-GCM-SIV, not AES-SIV. - * This is legace name, use `gcmsiv` export instead. - * @deprecated - */ -export declare const siv: typeof gcmsiv; -declare function encryptBlock(xk: Uint32Array, block: Uint8Array): Uint8Array; -declare function decryptBlock(xk: Uint32Array, block: Uint8Array): Uint8Array; -/** - * AES-KW (key-wrap). Injects static IV into plaintext, adds counter, encrypts 6 times. - * Reduces block size from 16 to 8 bytes. - * For padded version, use aeskwp. - * [RFC 3394](https://datatracker.ietf.org/doc/rfc3394/), - * [NIST.SP.800-38F](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-38F.pdf). - */ -export declare const aeskw: ((kek: Uint8Array) => Cipher) & { - blockSize: number; -}; -/** - * AES-KW, but with padding and allows random keys. - * Second u32 of IV is used as counter for length. - * [RFC 5649](https://www.rfc-editor.org/rfc/rfc5649) - */ -export declare const aeskwp: ((kek: Uint8Array) => Cipher) & { - blockSize: number; -}; -/** Unsafe low-level internal methods. May change at any time. */ -export declare const unsafe: { - expandKeyLE: typeof expandKeyLE; - expandKeyDecLE: typeof expandKeyDecLE; - encrypt: typeof encrypt; - decrypt: typeof decrypt; - encryptBlock: typeof encryptBlock; - decryptBlock: typeof decryptBlock; - ctrCounter: typeof ctrCounter; - ctr32: typeof ctr32; -}; -export {}; -//# sourceMappingURL=aes.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/aes.d.ts.map b/tools/mnemonic-test/node_modules/@noble/ciphers/aes.d.ts.map deleted file mode 100644 index b6623747..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/aes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"aes.d.ts","sourceRoot":"","sources":["src/aes.ts"],"names":[],"mappings":"AAkBA,OAAO,EAIL,KAAK,MAAM,EAAE,KAAK,gBAAgB,EACnC,MAAM,YAAY,CAAC;AA0FpB,iCAAiC;AACjC,iBAAS,WAAW,CAAC,GAAG,EAAE,UAAU,GAAG,WAAW,CAsBjD;AAED,iBAAS,cAAc,CAAC,GAAG,EAAE,UAAU,GAAG,WAAW,CAkBpD;AAwBD,iBAAS,OAAO,CACd,EAAE,EAAE,WAAW,EACf,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,GACT;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAkBpD;AAGD,iBAAS,OAAO,CACd,EAAE,EAAE,WAAW,EACf,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAA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,eAAO,MAAM,MAAM,EAAE;IACnB,WAAW,EAAE,OAAO,WAAW,CAAC;IAChC,cAAc,EAAE,OAAO,cAAc,CAAC;IACtC,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,YAAY,EAAE,OAAO,YAAY,CAAC;IAClC,YAAY,EAAE,OAAO,YAAY,CAAC;IAClC,UAAU,EAAE,OAAO,UAAU,CAAC;IAC9B,KAAK,EAAE,OAAO,KAAK,CAAC;CAUrB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/aes.js b/tools/mnemonic-test/node_modules/@noble/ciphers/aes.js deleted file mode 100644 index f3bea92a..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/aes.js +++ /dev/null @@ -1,906 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.unsafe = exports.aeskwp = exports.aeskw = exports.siv = exports.gcmsiv = exports.gcm = exports.cfb = exports.cbc = exports.ecb = exports.ctr = void 0; -/** - * [AES](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard) - * a.k.a. Advanced Encryption Standard - * is a variant of Rijndael block cipher, standardized by NIST in 2001. - * We provide the fastest available pure JS implementation. - * - * Data is split into 128-bit blocks. Encrypted in 10/12/14 rounds (128/192/256 bits). In every round: - * 1. **S-box**, table substitution - * 2. **Shift rows**, cyclic shift left of all rows of data array - * 3. **Mix columns**, multiplying every column by fixed polynomial - * 4. **Add round key**, round_key xor i-th column of array - * - * Check out [FIPS-197](https://csrc.nist.gov/files/pubs/fips/197/final/docs/fips-197.pdf) - * and [original proposal](https://csrc.nist.gov/csrc/media/projects/cryptographic-standards-and-guidelines/documents/aes-development/rijndael-ammended.pdf) - * @module - */ -const _polyval_ts_1 = require("./_polyval.js"); -// prettier-ignore -const utils_ts_1 = require("./utils.js"); -const BLOCK_SIZE = 16; -const BLOCK_SIZE32 = 4; -const EMPTY_BLOCK = /* @__PURE__ */ new Uint8Array(BLOCK_SIZE); -const POLY = 0x11b; // 1 + x + x**3 + x**4 + x**8 -// TODO: remove multiplication, binary ops only -function mul2(n) { - return (n << 1) ^ (POLY & -(n >> 7)); -} -function mul(a, b) { - let res = 0; - for (; b > 0; b >>= 1) { - // Montgomery ladder - res ^= a & -(b & 1); // if (b&1) res ^=a (but const-time). - a = mul2(a); // a = 2*a - } - return res; -} -// AES S-box is generated using finite field inversion, -// an affine transform, and xor of a constant 0x63. -const sbox = /* @__PURE__ */ (() => { - const t = new Uint8Array(256); - for (let i = 0, x = 1; i < 256; i++, x ^= mul2(x)) - t[i] = x; - const box = new Uint8Array(256); - box[0] = 0x63; // first elm - for (let i = 0; i < 255; i++) { - let x = t[255 - i]; - x |= x << 8; - box[t[i]] = (x ^ (x >> 4) ^ (x >> 5) ^ (x >> 6) ^ (x >> 7) ^ 0x63) & 0xff; - } - (0, utils_ts_1.clean)(t); - return box; -})(); -// Inverted S-box -const invSbox = /* @__PURE__ */ sbox.map((_, j) => sbox.indexOf(j)); -// Rotate u32 by 8 -const rotr32_8 = (n) => (n << 24) | (n >>> 8); -const rotl32_8 = (n) => (n << 8) | (n >>> 24); -// The byte swap operation for uint32 (LE<->BE) -const byteSwap = (word) => ((word << 24) & 0xff000000) | - ((word << 8) & 0xff0000) | - ((word >>> 8) & 0xff00) | - ((word >>> 24) & 0xff); -// T-table is optimization suggested in 5.2 of original proposal (missed from FIPS-197). Changes: -// - LE instead of BE -// - bigger tables: T0 and T1 are merged into T01 table and T2 & T3 into T23; -// so index is u16, instead of u8. This speeds up things, unexpectedly -function genTtable(sbox, fn) { - if (sbox.length !== 256) - throw new Error('Wrong sbox length'); - const T0 = new Uint32Array(256).map((_, j) => fn(sbox[j])); - const T1 = T0.map(rotl32_8); - const T2 = T1.map(rotl32_8); - const T3 = T2.map(rotl32_8); - const T01 = new Uint32Array(256 * 256); - const T23 = new Uint32Array(256 * 256); - const sbox2 = new Uint16Array(256 * 256); - for (let i = 0; i < 256; i++) { - for (let j = 0; j < 256; j++) { - const idx = i * 256 + j; - T01[idx] = T0[i] ^ T1[j]; - T23[idx] = T2[i] ^ T3[j]; - sbox2[idx] = (sbox[i] << 8) | sbox[j]; - } - } - return { sbox, sbox2, T0, T1, T2, T3, T01, T23 }; -} -const tableEncoding = /* @__PURE__ */ genTtable(sbox, (s) => (mul(s, 3) << 24) | (s << 16) | (s << 8) | mul(s, 2)); -const tableDecoding = /* @__PURE__ */ genTtable(invSbox, (s) => (mul(s, 11) << 24) | (mul(s, 13) << 16) | (mul(s, 9) << 8) | mul(s, 14)); -const xPowers = /* @__PURE__ */ (() => { - const p = new Uint8Array(16); - for (let i = 0, x = 1; i < 16; i++, x = mul2(x)) - p[i] = x; - return p; -})(); -/** Key expansion used in CTR. */ -function expandKeyLE(key) { - (0, utils_ts_1.abytes)(key); - const len = key.length; - if (![16, 24, 32].includes(len)) - throw new Error('aes: invalid key size, should be 16, 24 or 32, got ' + len); - const { sbox2 } = tableEncoding; - const toClean = []; - if (!(0, utils_ts_1.isAligned32)(key)) - toClean.push((key = (0, utils_ts_1.copyBytes)(key))); - const k32 = (0, utils_ts_1.u32)(key); - const Nk = k32.length; - const subByte = (n) => applySbox(sbox2, n, n, n, n); - const xk = new Uint32Array(len + 28); // expanded key - xk.set(k32); - // 4.3.1 Key expansion - for (let i = Nk; i < xk.length; i++) { - let t = xk[i - 1]; - if (i % Nk === 0) - t = subByte(rotr32_8(t)) ^ xPowers[i / Nk - 1]; - else if (Nk > 6 && i % Nk === 4) - t = subByte(t); - xk[i] = xk[i - Nk] ^ t; - } - (0, utils_ts_1.clean)(...toClean); - return xk; -} -function expandKeyDecLE(key) { - const encKey = expandKeyLE(key); - const xk = encKey.slice(); - const Nk = encKey.length; - const { sbox2 } = tableEncoding; - const { T0, T1, T2, T3 } = tableDecoding; - // Inverse key by chunks of 4 (rounds) - for (let i = 0; i < Nk; i += 4) { - for (let j = 0; j < 4; j++) - xk[i + j] = encKey[Nk - i - 4 + j]; - } - (0, utils_ts_1.clean)(encKey); - // apply InvMixColumn except first & last round - for (let i = 4; i < Nk - 4; i++) { - const x = xk[i]; - const w = applySbox(sbox2, x, x, x, x); - xk[i] = T0[w & 0xff] ^ T1[(w >>> 8) & 0xff] ^ T2[(w >>> 16) & 0xff] ^ T3[w >>> 24]; - } - return xk; -} -// Apply tables -function apply0123(T01, T23, s0, s1, s2, s3) { - return (T01[((s0 << 8) & 0xff00) | ((s1 >>> 8) & 0xff)] ^ - T23[((s2 >>> 8) & 0xff00) | ((s3 >>> 24) & 0xff)]); -} -function applySbox(sbox2, s0, s1, s2, s3) { - return (sbox2[(s0 & 0xff) | (s1 & 0xff00)] | - (sbox2[((s2 >>> 16) & 0xff) | ((s3 >>> 16) & 0xff00)] << 16)); -} -function encrypt(xk, s0, s1, s2, s3) { - const { sbox2, T01, T23 } = tableEncoding; - let k = 0; - (s0 ^= xk[k++]), (s1 ^= xk[k++]), (s2 ^= xk[k++]), (s3 ^= xk[k++]); - const rounds = xk.length / 4 - 2; - for (let i = 0; i < rounds; i++) { - const t0 = xk[k++] ^ apply0123(T01, T23, s0, s1, s2, s3); - const t1 = xk[k++] ^ apply0123(T01, T23, s1, s2, s3, s0); - const t2 = xk[k++] ^ apply0123(T01, T23, s2, s3, s0, s1); - const t3 = xk[k++] ^ apply0123(T01, T23, s3, s0, s1, s2); - (s0 = t0), (s1 = t1), (s2 = t2), (s3 = t3); - } - // last round (without mixcolumns, so using SBOX2 table) - const t0 = xk[k++] ^ applySbox(sbox2, s0, s1, s2, s3); - const t1 = xk[k++] ^ applySbox(sbox2, s1, s2, s3, s0); - const t2 = xk[k++] ^ applySbox(sbox2, s2, s3, s0, s1); - const t3 = xk[k++] ^ applySbox(sbox2, s3, s0, s1, s2); - return { s0: t0, s1: t1, s2: t2, s3: t3 }; -} -// Can't be merged with encrypt: arg positions for apply0123 / applySbox are different -function decrypt(xk, s0, s1, s2, s3) { - const { sbox2, T01, T23 } = tableDecoding; - let k = 0; - (s0 ^= xk[k++]), (s1 ^= xk[k++]), (s2 ^= xk[k++]), (s3 ^= xk[k++]); - const rounds = xk.length / 4 - 2; - for (let i = 0; i < rounds; i++) { - const t0 = xk[k++] ^ apply0123(T01, T23, s0, s3, s2, s1); - const t1 = xk[k++] ^ apply0123(T01, T23, s1, s0, s3, s2); - const t2 = xk[k++] ^ apply0123(T01, T23, s2, s1, s0, s3); - const t3 = xk[k++] ^ apply0123(T01, T23, s3, s2, s1, s0); - (s0 = t0), (s1 = t1), (s2 = t2), (s3 = t3); - } - // Last round - const t0 = xk[k++] ^ applySbox(sbox2, s0, s3, s2, s1); - const t1 = xk[k++] ^ applySbox(sbox2, s1, s0, s3, s2); - const t2 = xk[k++] ^ applySbox(sbox2, s2, s1, s0, s3); - const t3 = xk[k++] ^ applySbox(sbox2, s3, s2, s1, s0); - return { s0: t0, s1: t1, s2: t2, s3: t3 }; -} -// TODO: investigate merging with ctr32 -function ctrCounter(xk, nonce, src, dst) { - (0, utils_ts_1.abytes)(nonce, BLOCK_SIZE); - (0, utils_ts_1.abytes)(src); - const srcLen = src.length; - dst = (0, utils_ts_1.getOutput)(srcLen, dst); - (0, utils_ts_1.complexOverlapBytes)(src, dst); - const ctr = nonce; - const c32 = (0, utils_ts_1.u32)(ctr); - // Fill block (empty, ctr=0) - let { s0, s1, s2, s3 } = encrypt(xk, c32[0], c32[1], c32[2], c32[3]); - const src32 = (0, utils_ts_1.u32)(src); - const dst32 = (0, utils_ts_1.u32)(dst); - // process blocks - for (let i = 0; i + 4 <= src32.length; i += 4) { - dst32[i + 0] = src32[i + 0] ^ s0; - dst32[i + 1] = src32[i + 1] ^ s1; - dst32[i + 2] = src32[i + 2] ^ s2; - dst32[i + 3] = src32[i + 3] ^ s3; - // Full 128 bit counter with wrap around - let carry = 1; - for (let i = ctr.length - 1; i >= 0; i--) { - carry = (carry + (ctr[i] & 0xff)) | 0; - ctr[i] = carry & 0xff; - carry >>>= 8; - } - ({ s0, s1, s2, s3 } = encrypt(xk, c32[0], c32[1], c32[2], c32[3])); - } - // leftovers (less than block) - // It's possible to handle > u32 fast, but is it worth it? - const start = BLOCK_SIZE * Math.floor(src32.length / BLOCK_SIZE32); - if (start < srcLen) { - const b32 = new Uint32Array([s0, s1, s2, s3]); - const buf = (0, utils_ts_1.u8)(b32); - for (let i = start, pos = 0; i < srcLen; i++, pos++) - dst[i] = src[i] ^ buf[pos]; - (0, utils_ts_1.clean)(b32); - } - return dst; -} -// AES CTR with overflowing 32 bit counter -// It's possible to do 32le significantly simpler (and probably faster) by using u32. -// But, we need both, and perf bottleneck is in ghash anyway. -function ctr32(xk, isLE, nonce, src, dst) { - (0, utils_ts_1.abytes)(nonce, BLOCK_SIZE); - (0, utils_ts_1.abytes)(src); - dst = (0, utils_ts_1.getOutput)(src.length, dst); - const ctr = nonce; // write new value to nonce, so it can be re-used - const c32 = (0, utils_ts_1.u32)(ctr); - const view = (0, utils_ts_1.createView)(ctr); - const src32 = (0, utils_ts_1.u32)(src); - const dst32 = (0, utils_ts_1.u32)(dst); - const ctrPos = isLE ? 0 : 12; - const srcLen = src.length; - // Fill block (empty, ctr=0) - let ctrNum = view.getUint32(ctrPos, isLE); // read current counter value - let { s0, s1, s2, s3 } = encrypt(xk, c32[0], c32[1], c32[2], c32[3]); - // process blocks - for (let i = 0; i + 4 <= src32.length; i += 4) { - dst32[i + 0] = src32[i + 0] ^ s0; - dst32[i + 1] = src32[i + 1] ^ s1; - dst32[i + 2] = src32[i + 2] ^ s2; - dst32[i + 3] = src32[i + 3] ^ s3; - ctrNum = (ctrNum + 1) >>> 0; // u32 wrap - view.setUint32(ctrPos, ctrNum, isLE); - ({ s0, s1, s2, s3 } = encrypt(xk, c32[0], c32[1], c32[2], c32[3])); - } - // leftovers (less than a block) - const start = BLOCK_SIZE * Math.floor(src32.length / BLOCK_SIZE32); - if (start < srcLen) { - const b32 = new Uint32Array([s0, s1, s2, s3]); - const buf = (0, utils_ts_1.u8)(b32); - for (let i = start, pos = 0; i < srcLen; i++, pos++) - dst[i] = src[i] ^ buf[pos]; - (0, utils_ts_1.clean)(b32); - } - return dst; -} -/** - * CTR: counter mode. Creates stream cipher. - * Requires good IV. Parallelizable. OK, but no MAC. - */ -exports.ctr = (0, utils_ts_1.wrapCipher)({ blockSize: 16, nonceLength: 16 }, function aesctr(key, nonce) { - function processCtr(buf, dst) { - (0, utils_ts_1.abytes)(buf); - if (dst !== undefined) { - (0, utils_ts_1.abytes)(dst); - if (!(0, utils_ts_1.isAligned32)(dst)) - throw new Error('unaligned destination'); - } - const xk = expandKeyLE(key); - const n = (0, utils_ts_1.copyBytes)(nonce); // align + avoid changing - const toClean = [xk, n]; - if (!(0, utils_ts_1.isAligned32)(buf)) - toClean.push((buf = (0, utils_ts_1.copyBytes)(buf))); - const out = ctrCounter(xk, n, buf, dst); - (0, utils_ts_1.clean)(...toClean); - return out; - } - return { - encrypt: (plaintext, dst) => processCtr(plaintext, dst), - decrypt: (ciphertext, dst) => processCtr(ciphertext, dst), - }; -}); -function validateBlockDecrypt(data) { - (0, utils_ts_1.abytes)(data); - if (data.length % BLOCK_SIZE !== 0) { - throw new Error('aes-(cbc/ecb).decrypt ciphertext should consist of blocks with size ' + BLOCK_SIZE); - } -} -function validateBlockEncrypt(plaintext, pcks5, dst) { - (0, utils_ts_1.abytes)(plaintext); - let outLen = plaintext.length; - const remaining = outLen % BLOCK_SIZE; - if (!pcks5 && remaining !== 0) - throw new Error('aec/(cbc-ecb): unpadded plaintext with disabled padding'); - if (!(0, utils_ts_1.isAligned32)(plaintext)) - plaintext = (0, utils_ts_1.copyBytes)(plaintext); - const b = (0, utils_ts_1.u32)(plaintext); - if (pcks5) { - let left = BLOCK_SIZE - remaining; - if (!left) - left = BLOCK_SIZE; // if no bytes left, create empty padding block - outLen = outLen + left; - } - dst = (0, utils_ts_1.getOutput)(outLen, dst); - (0, utils_ts_1.complexOverlapBytes)(plaintext, dst); - const o = (0, utils_ts_1.u32)(dst); - return { b, o, out: dst }; -} -function validatePCKS(data, pcks5) { - if (!pcks5) - return data; - const len = data.length; - if (!len) - throw new Error('aes/pcks5: empty ciphertext not allowed'); - const lastByte = data[len - 1]; - if (lastByte <= 0 || lastByte > 16) - throw new Error('aes/pcks5: wrong padding'); - const out = data.subarray(0, -lastByte); - for (let i = 0; i < lastByte; i++) - if (data[len - i - 1] !== lastByte) - throw new Error('aes/pcks5: wrong padding'); - return out; -} -function padPCKS(left) { - const tmp = new Uint8Array(16); - const tmp32 = (0, utils_ts_1.u32)(tmp); - tmp.set(left); - const paddingByte = BLOCK_SIZE - left.length; - for (let i = BLOCK_SIZE - paddingByte; i < BLOCK_SIZE; i++) - tmp[i] = paddingByte; - return tmp32; -} -/** - * ECB: Electronic CodeBook. Simple deterministic replacement. - * Dangerous: always map x to y. See [AES Penguin](https://words.filippo.io/the-ecb-penguin/). - */ -exports.ecb = (0, utils_ts_1.wrapCipher)({ blockSize: 16 }, function aesecb(key, opts = {}) { - const pcks5 = !opts.disablePadding; - return { - encrypt(plaintext, dst) { - const { b, o, out: _out } = validateBlockEncrypt(plaintext, pcks5, dst); - const xk = expandKeyLE(key); - let i = 0; - for (; i + 4 <= b.length;) { - const { s0, s1, s2, s3 } = encrypt(xk, b[i + 0], b[i + 1], b[i + 2], b[i + 3]); - (o[i++] = s0), (o[i++] = s1), (o[i++] = s2), (o[i++] = s3); - } - if (pcks5) { - const tmp32 = padPCKS(plaintext.subarray(i * 4)); - const { s0, s1, s2, s3 } = encrypt(xk, tmp32[0], tmp32[1], tmp32[2], tmp32[3]); - (o[i++] = s0), (o[i++] = s1), (o[i++] = s2), (o[i++] = s3); - } - (0, utils_ts_1.clean)(xk); - return _out; - }, - decrypt(ciphertext, dst) { - validateBlockDecrypt(ciphertext); - const xk = expandKeyDecLE(key); - dst = (0, utils_ts_1.getOutput)(ciphertext.length, dst); - const toClean = [xk]; - if (!(0, utils_ts_1.isAligned32)(ciphertext)) - toClean.push((ciphertext = (0, utils_ts_1.copyBytes)(ciphertext))); - (0, utils_ts_1.complexOverlapBytes)(ciphertext, dst); - const b = (0, utils_ts_1.u32)(ciphertext); - const o = (0, utils_ts_1.u32)(dst); - for (let i = 0; i + 4 <= b.length;) { - const { s0, s1, s2, s3 } = decrypt(xk, b[i + 0], b[i + 1], b[i + 2], b[i + 3]); - (o[i++] = s0), (o[i++] = s1), (o[i++] = s2), (o[i++] = s3); - } - (0, utils_ts_1.clean)(...toClean); - return validatePCKS(dst, pcks5); - }, - }; -}); -/** - * CBC: Cipher-Block-Chaining. Key is previous round’s block. - * Fragile: needs proper padding. Unauthenticated: needs MAC. - */ -exports.cbc = (0, utils_ts_1.wrapCipher)({ blockSize: 16, nonceLength: 16 }, function aescbc(key, iv, opts = {}) { - const pcks5 = !opts.disablePadding; - return { - encrypt(plaintext, dst) { - const xk = expandKeyLE(key); - const { b, o, out: _out } = validateBlockEncrypt(plaintext, pcks5, dst); - let _iv = iv; - const toClean = [xk]; - if (!(0, utils_ts_1.isAligned32)(_iv)) - toClean.push((_iv = (0, utils_ts_1.copyBytes)(_iv))); - const n32 = (0, utils_ts_1.u32)(_iv); - // prettier-ignore - let s0 = n32[0], s1 = n32[1], s2 = n32[2], s3 = n32[3]; - let i = 0; - for (; i + 4 <= b.length;) { - (s0 ^= b[i + 0]), (s1 ^= b[i + 1]), (s2 ^= b[i + 2]), (s3 ^= b[i + 3]); - ({ s0, s1, s2, s3 } = encrypt(xk, s0, s1, s2, s3)); - (o[i++] = s0), (o[i++] = s1), (o[i++] = s2), (o[i++] = s3); - } - if (pcks5) { - const tmp32 = padPCKS(plaintext.subarray(i * 4)); - (s0 ^= tmp32[0]), (s1 ^= tmp32[1]), (s2 ^= tmp32[2]), (s3 ^= tmp32[3]); - ({ s0, s1, s2, s3 } = encrypt(xk, s0, s1, s2, s3)); - (o[i++] = s0), (o[i++] = s1), (o[i++] = s2), (o[i++] = s3); - } - (0, utils_ts_1.clean)(...toClean); - return _out; - }, - decrypt(ciphertext, dst) { - validateBlockDecrypt(ciphertext); - const xk = expandKeyDecLE(key); - let _iv = iv; - const toClean = [xk]; - if (!(0, utils_ts_1.isAligned32)(_iv)) - toClean.push((_iv = (0, utils_ts_1.copyBytes)(_iv))); - const n32 = (0, utils_ts_1.u32)(_iv); - dst = (0, utils_ts_1.getOutput)(ciphertext.length, dst); - if (!(0, utils_ts_1.isAligned32)(ciphertext)) - toClean.push((ciphertext = (0, utils_ts_1.copyBytes)(ciphertext))); - (0, utils_ts_1.complexOverlapBytes)(ciphertext, dst); - const b = (0, utils_ts_1.u32)(ciphertext); - const o = (0, utils_ts_1.u32)(dst); - // prettier-ignore - let s0 = n32[0], s1 = n32[1], s2 = n32[2], s3 = n32[3]; - for (let i = 0; i + 4 <= b.length;) { - // prettier-ignore - const ps0 = s0, ps1 = s1, ps2 = s2, ps3 = s3; - (s0 = b[i + 0]), (s1 = b[i + 1]), (s2 = b[i + 2]), (s3 = b[i + 3]); - const { s0: o0, s1: o1, s2: o2, s3: o3 } = decrypt(xk, s0, s1, s2, s3); - (o[i++] = o0 ^ ps0), (o[i++] = o1 ^ ps1), (o[i++] = o2 ^ ps2), (o[i++] = o3 ^ ps3); - } - (0, utils_ts_1.clean)(...toClean); - return validatePCKS(dst, pcks5); - }, - }; -}); -/** - * CFB: Cipher Feedback Mode. The input for the block cipher is the previous cipher output. - * Unauthenticated: needs MAC. - */ -exports.cfb = (0, utils_ts_1.wrapCipher)({ blockSize: 16, nonceLength: 16 }, function aescfb(key, iv) { - function processCfb(src, isEncrypt, dst) { - (0, utils_ts_1.abytes)(src); - const srcLen = src.length; - dst = (0, utils_ts_1.getOutput)(srcLen, dst); - if ((0, utils_ts_1.overlapBytes)(src, dst)) - throw new Error('overlapping src and dst not supported.'); - const xk = expandKeyLE(key); - let _iv = iv; - const toClean = [xk]; - if (!(0, utils_ts_1.isAligned32)(_iv)) - toClean.push((_iv = (0, utils_ts_1.copyBytes)(_iv))); - if (!(0, utils_ts_1.isAligned32)(src)) - toClean.push((src = (0, utils_ts_1.copyBytes)(src))); - const src32 = (0, utils_ts_1.u32)(src); - const dst32 = (0, utils_ts_1.u32)(dst); - const next32 = isEncrypt ? dst32 : src32; - const n32 = (0, utils_ts_1.u32)(_iv); - // prettier-ignore - let s0 = n32[0], s1 = n32[1], s2 = n32[2], s3 = n32[3]; - for (let i = 0; i + 4 <= src32.length;) { - const { s0: e0, s1: e1, s2: e2, s3: e3 } = encrypt(xk, s0, s1, s2, s3); - dst32[i + 0] = src32[i + 0] ^ e0; - dst32[i + 1] = src32[i + 1] ^ e1; - dst32[i + 2] = src32[i + 2] ^ e2; - dst32[i + 3] = src32[i + 3] ^ e3; - (s0 = next32[i++]), (s1 = next32[i++]), (s2 = next32[i++]), (s3 = next32[i++]); - } - // leftovers (less than block) - const start = BLOCK_SIZE * Math.floor(src32.length / BLOCK_SIZE32); - if (start < srcLen) { - ({ s0, s1, s2, s3 } = encrypt(xk, s0, s1, s2, s3)); - const buf = (0, utils_ts_1.u8)(new Uint32Array([s0, s1, s2, s3])); - for (let i = start, pos = 0; i < srcLen; i++, pos++) - dst[i] = src[i] ^ buf[pos]; - (0, utils_ts_1.clean)(buf); - } - (0, utils_ts_1.clean)(...toClean); - return dst; - } - return { - encrypt: (plaintext, dst) => processCfb(plaintext, true, dst), - decrypt: (ciphertext, dst) => processCfb(ciphertext, false, dst), - }; -}); -// TODO: merge with chacha, however gcm has bitLen while chacha has byteLen -function computeTag(fn, isLE, key, data, AAD) { - const aadLength = AAD ? AAD.length : 0; - const h = fn.create(key, data.length + aadLength); - if (AAD) - h.update(AAD); - const num = (0, utils_ts_1.u64Lengths)(8 * data.length, 8 * aadLength, isLE); - h.update(data); - h.update(num); - const res = h.digest(); - (0, utils_ts_1.clean)(num); - return res; -} -/** - * GCM: Galois/Counter Mode. - * Modern, parallel version of CTR, with MAC. - * Be careful: MACs can be forged. - * Unsafe to use random nonces under the same key, due to collision chance. - * As for nonce size, prefer 12-byte, instead of 8-byte. - */ -exports.gcm = (0, utils_ts_1.wrapCipher)({ blockSize: 16, nonceLength: 12, tagLength: 16, varSizeNonce: true }, function aesgcm(key, nonce, AAD) { - // NIST 800-38d doesn't enforce minimum nonce length. - // We enforce 8 bytes for compat with openssl. - // 12 bytes are recommended. More than 12 bytes would be converted into 12. - if (nonce.length < 8) - throw new Error('aes/gcm: invalid nonce length'); - const tagLength = 16; - function _computeTag(authKey, tagMask, data) { - const tag = computeTag(_polyval_ts_1.ghash, false, authKey, data, AAD); - for (let i = 0; i < tagMask.length; i++) - tag[i] ^= tagMask[i]; - return tag; - } - function deriveKeys() { - const xk = expandKeyLE(key); - const authKey = EMPTY_BLOCK.slice(); - const counter = EMPTY_BLOCK.slice(); - ctr32(xk, false, counter, counter, authKey); - // NIST 800-38d, page 15: different behavior for 96-bit and non-96-bit nonces - if (nonce.length === 12) { - counter.set(nonce); - } - else { - const nonceLen = EMPTY_BLOCK.slice(); - const view = (0, utils_ts_1.createView)(nonceLen); - (0, utils_ts_1.setBigUint64)(view, 8, BigInt(nonce.length * 8), false); - // ghash(nonce || u64be(0) || u64be(nonceLen*8)) - const g = _polyval_ts_1.ghash.create(authKey).update(nonce).update(nonceLen); - g.digestInto(counter); // digestInto doesn't trigger '.destroy' - g.destroy(); - } - const tagMask = ctr32(xk, false, counter, EMPTY_BLOCK); - return { xk, authKey, counter, tagMask }; - } - return { - encrypt(plaintext) { - const { xk, authKey, counter, tagMask } = deriveKeys(); - const out = new Uint8Array(plaintext.length + tagLength); - const toClean = [xk, authKey, counter, tagMask]; - if (!(0, utils_ts_1.isAligned32)(plaintext)) - toClean.push((plaintext = (0, utils_ts_1.copyBytes)(plaintext))); - ctr32(xk, false, counter, plaintext, out.subarray(0, plaintext.length)); - const tag = _computeTag(authKey, tagMask, out.subarray(0, out.length - tagLength)); - toClean.push(tag); - out.set(tag, plaintext.length); - (0, utils_ts_1.clean)(...toClean); - return out; - }, - decrypt(ciphertext) { - const { xk, authKey, counter, tagMask } = deriveKeys(); - const toClean = [xk, authKey, tagMask, counter]; - if (!(0, utils_ts_1.isAligned32)(ciphertext)) - toClean.push((ciphertext = (0, utils_ts_1.copyBytes)(ciphertext))); - const data = ciphertext.subarray(0, -tagLength); - const passedTag = ciphertext.subarray(-tagLength); - const tag = _computeTag(authKey, tagMask, data); - toClean.push(tag); - if (!(0, utils_ts_1.equalBytes)(tag, passedTag)) - throw new Error('aes/gcm: invalid ghash tag'); - const out = ctr32(xk, false, counter, data); - (0, utils_ts_1.clean)(...toClean); - return out; - }, - }; -}); -const limit = (name, min, max) => (value) => { - if (!Number.isSafeInteger(value) || min > value || value > max) { - const minmax = '[' + min + '..' + max + ']'; - throw new Error('' + name + ': expected value in range ' + minmax + ', got ' + value); - } -}; -/** - * AES-GCM-SIV: classic AES-GCM with nonce-misuse resistance. - * Guarantees that, when a nonce is repeated, the only security loss is that identical - * plaintexts will produce identical ciphertexts. - * RFC 8452, https://datatracker.ietf.org/doc/html/rfc8452 - */ -exports.gcmsiv = (0, utils_ts_1.wrapCipher)({ blockSize: 16, nonceLength: 12, tagLength: 16, varSizeNonce: true }, function aessiv(key, nonce, AAD) { - const tagLength = 16; - // From RFC 8452: Section 6 - const AAD_LIMIT = limit('AAD', 0, 2 ** 36); - const PLAIN_LIMIT = limit('plaintext', 0, 2 ** 36); - const NONCE_LIMIT = limit('nonce', 12, 12); - const CIPHER_LIMIT = limit('ciphertext', 16, 2 ** 36 + 16); - (0, utils_ts_1.abytes)(key, 16, 24, 32); - NONCE_LIMIT(nonce.length); - if (AAD !== undefined) - AAD_LIMIT(AAD.length); - function deriveKeys() { - const xk = expandKeyLE(key); - const encKey = new Uint8Array(key.length); - const authKey = new Uint8Array(16); - const toClean = [xk, encKey]; - let _nonce = nonce; - if (!(0, utils_ts_1.isAligned32)(_nonce)) - toClean.push((_nonce = (0, utils_ts_1.copyBytes)(_nonce))); - const n32 = (0, utils_ts_1.u32)(_nonce); - // prettier-ignore - let s0 = 0, s1 = n32[0], s2 = n32[1], s3 = n32[2]; - let counter = 0; - for (const derivedKey of [authKey, encKey].map(utils_ts_1.u32)) { - const d32 = (0, utils_ts_1.u32)(derivedKey); - for (let i = 0; i < d32.length; i += 2) { - // aes(u32le(0) || nonce)[:8] || aes(u32le(1) || nonce)[:8] ... - const { s0: o0, s1: o1 } = encrypt(xk, s0, s1, s2, s3); - d32[i + 0] = o0; - d32[i + 1] = o1; - s0 = ++counter; // increment counter inside state - } - } - const res = { authKey, encKey: expandKeyLE(encKey) }; - // Cleanup - (0, utils_ts_1.clean)(...toClean); - return res; - } - function _computeTag(encKey, authKey, data) { - const tag = computeTag(_polyval_ts_1.polyval, true, authKey, data, AAD); - // Compute the expected tag by XORing S_s and the nonce, clearing the - // most significant bit of the last byte and encrypting with the - // message-encryption key. - for (let i = 0; i < 12; i++) - tag[i] ^= nonce[i]; - tag[15] &= 0x7f; // Clear the highest bit - // encrypt tag as block - const t32 = (0, utils_ts_1.u32)(tag); - // prettier-ignore - let s0 = t32[0], s1 = t32[1], s2 = t32[2], s3 = t32[3]; - ({ s0, s1, s2, s3 } = encrypt(encKey, s0, s1, s2, s3)); - (t32[0] = s0), (t32[1] = s1), (t32[2] = s2), (t32[3] = s3); - return tag; - } - // actual decrypt/encrypt of message. - function processSiv(encKey, tag, input) { - let block = (0, utils_ts_1.copyBytes)(tag); - block[15] |= 0x80; // Force highest bit - const res = ctr32(encKey, true, block, input); - // Cleanup - (0, utils_ts_1.clean)(block); - return res; - } - return { - encrypt(plaintext) { - PLAIN_LIMIT(plaintext.length); - const { encKey, authKey } = deriveKeys(); - const tag = _computeTag(encKey, authKey, plaintext); - const toClean = [encKey, authKey, tag]; - if (!(0, utils_ts_1.isAligned32)(plaintext)) - toClean.push((plaintext = (0, utils_ts_1.copyBytes)(plaintext))); - const out = new Uint8Array(plaintext.length + tagLength); - out.set(tag, plaintext.length); - out.set(processSiv(encKey, tag, plaintext)); - // Cleanup - (0, utils_ts_1.clean)(...toClean); - return out; - }, - decrypt(ciphertext) { - CIPHER_LIMIT(ciphertext.length); - const tag = ciphertext.subarray(-tagLength); - const { encKey, authKey } = deriveKeys(); - const toClean = [encKey, authKey]; - if (!(0, utils_ts_1.isAligned32)(ciphertext)) - toClean.push((ciphertext = (0, utils_ts_1.copyBytes)(ciphertext))); - const plaintext = processSiv(encKey, tag, ciphertext.subarray(0, -tagLength)); - const expectedTag = _computeTag(encKey, authKey, plaintext); - toClean.push(expectedTag); - if (!(0, utils_ts_1.equalBytes)(tag, expectedTag)) { - (0, utils_ts_1.clean)(...toClean); - throw new Error('invalid polyval tag'); - } - // Cleanup - (0, utils_ts_1.clean)(...toClean); - return plaintext; - }, - }; -}); -/** - * AES-GCM-SIV, not AES-SIV. - * This is legace name, use `gcmsiv` export instead. - * @deprecated - */ -exports.siv = exports.gcmsiv; -function isBytes32(a) { - return (a instanceof Uint32Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint32Array')); -} -function encryptBlock(xk, block) { - (0, utils_ts_1.abytes)(block, 16); - if (!isBytes32(xk)) - throw new Error('_encryptBlock accepts result of expandKeyLE'); - const b32 = (0, utils_ts_1.u32)(block); - let { s0, s1, s2, s3 } = encrypt(xk, b32[0], b32[1], b32[2], b32[3]); - (b32[0] = s0), (b32[1] = s1), (b32[2] = s2), (b32[3] = s3); - return block; -} -function decryptBlock(xk, block) { - (0, utils_ts_1.abytes)(block, 16); - if (!isBytes32(xk)) - throw new Error('_decryptBlock accepts result of expandKeyLE'); - const b32 = (0, utils_ts_1.u32)(block); - let { s0, s1, s2, s3 } = decrypt(xk, b32[0], b32[1], b32[2], b32[3]); - (b32[0] = s0), (b32[1] = s1), (b32[2] = s2), (b32[3] = s3); - return block; -} -/** - * AES-W (base for AESKW/AESKWP). - * Specs: [SP800-38F](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-38F.pdf), - * [RFC 3394](https://datatracker.ietf.org/doc/rfc3394/), - * [RFC 5649](https://datatracker.ietf.org/doc/rfc5649/). - */ -const AESW = { - /* - High-level pseudocode: - ``` - A: u64 = IV - out = [] - for (let i=0, ctr = 0; i<6; i++) { - for (const chunk of chunks(plaintext, 8)) { - A ^= swapEndianess(ctr++) - [A, res] = chunks(encrypt(A || chunk), 8); - out ||= res - } - } - out = A || out - ``` - Decrypt is the same, but reversed. - */ - encrypt(kek, out) { - // Size is limited to 4GB, otherwise ctr will overflow and we'll need to switch to bigints. - // If you need it larger, open an issue. - if (out.length >= 2 ** 32) - throw new Error('plaintext should be less than 4gb'); - const xk = expandKeyLE(kek); - if (out.length === 16) - encryptBlock(xk, out); - else { - const o32 = (0, utils_ts_1.u32)(out); - // prettier-ignore - let a0 = o32[0], a1 = o32[1]; // A - for (let j = 0, ctr = 1; j < 6; j++) { - for (let pos = 2; pos < o32.length; pos += 2, ctr++) { - const { s0, s1, s2, s3 } = encrypt(xk, a0, a1, o32[pos], o32[pos + 1]); - // A = MSB(64, B) ^ t where t = (n*j)+i - (a0 = s0), (a1 = s1 ^ byteSwap(ctr)), (o32[pos] = s2), (o32[pos + 1] = s3); - } - } - (o32[0] = a0), (o32[1] = a1); // out = A || out - } - xk.fill(0); - }, - decrypt(kek, out) { - if (out.length - 8 >= 2 ** 32) - throw new Error('ciphertext should be less than 4gb'); - const xk = expandKeyDecLE(kek); - const chunks = out.length / 8 - 1; // first chunk is IV - if (chunks === 1) - decryptBlock(xk, out); - else { - const o32 = (0, utils_ts_1.u32)(out); - // prettier-ignore - let a0 = o32[0], a1 = o32[1]; // A - for (let j = 0, ctr = chunks * 6; j < 6; j++) { - for (let pos = chunks * 2; pos >= 1; pos -= 2, ctr--) { - a1 ^= byteSwap(ctr); - const { s0, s1, s2, s3 } = decrypt(xk, a0, a1, o32[pos], o32[pos + 1]); - (a0 = s0), (a1 = s1), (o32[pos] = s2), (o32[pos + 1] = s3); - } - } - (o32[0] = a0), (o32[1] = a1); - } - xk.fill(0); - }, -}; -const AESKW_IV = /* @__PURE__ */ new Uint8Array(8).fill(0xa6); // A6A6A6A6A6A6A6A6 -/** - * AES-KW (key-wrap). Injects static IV into plaintext, adds counter, encrypts 6 times. - * Reduces block size from 16 to 8 bytes. - * For padded version, use aeskwp. - * [RFC 3394](https://datatracker.ietf.org/doc/rfc3394/), - * [NIST.SP.800-38F](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-38F.pdf). - */ -exports.aeskw = (0, utils_ts_1.wrapCipher)({ blockSize: 8 }, (kek) => ({ - encrypt(plaintext) { - if (!plaintext.length || plaintext.length % 8 !== 0) - throw new Error('invalid plaintext length'); - if (plaintext.length === 8) - throw new Error('8-byte keys not allowed in AESKW, use AESKWP instead'); - const out = (0, utils_ts_1.concatBytes)(AESKW_IV, plaintext); - AESW.encrypt(kek, out); - return out; - }, - decrypt(ciphertext) { - // ciphertext must be at least 24 bytes and a multiple of 8 bytes - // 24 because should have at least two block (1 iv + 2). - // Replace with 16 to enable '8-byte keys' - if (ciphertext.length % 8 !== 0 || ciphertext.length < 3 * 8) - throw new Error('invalid ciphertext length'); - const out = (0, utils_ts_1.copyBytes)(ciphertext); - AESW.decrypt(kek, out); - if (!(0, utils_ts_1.equalBytes)(out.subarray(0, 8), AESKW_IV)) - throw new Error('integrity check failed'); - out.subarray(0, 8).fill(0); // ciphertext.subarray(0, 8) === IV, but we clean it anyway - return out.subarray(8); - }, -})); -/* -We don't support 8-byte keys. The rabbit hole: - -- Wycheproof says: "NIST SP 800-38F does not define the wrapping of 8 byte keys. - RFC 3394 Section 2 on the other hand specifies that 8 byte keys are wrapped - by directly encrypting one block with AES." - - https://github.com/C2SP/wycheproof/blob/master/doc/key_wrap.md - - "RFC 3394 specifies in Section 2, that the input for the key wrap - algorithm must be at least two blocks and otherwise the constant - field and key are simply encrypted with ECB as a single block" -- What RFC 3394 actually says (in Section 2): - - "Before being wrapped, the key data is parsed into n blocks of 64 bits. - The only restriction the key wrap algorithm places on n is that n be - at least two" - - "For key data with length less than or equal to 64 bits, the constant - field used in this specification and the key data form a single - 128-bit codebook input making this key wrap unnecessary." -- Which means "assert(n >= 2)" and "use something else for 8 byte keys" -- NIST SP800-38F actually prohibits 8-byte in "5.3.1 Mandatory Limits". - It states that plaintext for KW should be "2 to 2^54 -1 semiblocks". -- So, where does "directly encrypt single block with AES" come from? - - Not RFC 3394. Pseudocode of key wrap in 2.2 explicitly uses - loop of 6 for any code path - - There is a weird W3C spec: - https://www.w3.org/TR/2002/REC-xmlenc-core-20021210/Overview.html#kw-aes128 - - This spec is outdated, as admitted by Wycheproof authors - - There is RFC 5649 for padded key wrap, which is padding construction on - top of AESKW. In '4.1.2' it says: "If the padded plaintext contains exactly - eight octets, then prepend the AIV as defined in Section 3 above to P[1] and - encrypt the resulting 128-bit block using AES in ECB mode [Modes] with key - K (the KEK). In this case, the output is two 64-bit blocks C[0] and C[1]:" - - Browser subtle crypto is actually crashes on wrapping keys less than 16 bytes: - `Error: error:1C8000E6:Provider routines::invalid input length] { opensslErrorStack: [ 'error:030000BD:digital envelope routines::update error' ]` - -In the end, seems like a bug in Wycheproof. -The 8-byte check can be easily disabled inside of AES_W. -*/ -const AESKWP_IV = 0xa65959a6; // single u32le value -/** - * AES-KW, but with padding and allows random keys. - * Second u32 of IV is used as counter for length. - * [RFC 5649](https://www.rfc-editor.org/rfc/rfc5649) - */ -exports.aeskwp = (0, utils_ts_1.wrapCipher)({ blockSize: 8 }, (kek) => ({ - encrypt(plaintext) { - if (!plaintext.length) - throw new Error('invalid plaintext length'); - const padded = Math.ceil(plaintext.length / 8) * 8; - const out = new Uint8Array(8 + padded); - out.set(plaintext, 8); - const out32 = (0, utils_ts_1.u32)(out); - out32[0] = AESKWP_IV; - out32[1] = byteSwap(plaintext.length); - AESW.encrypt(kek, out); - return out; - }, - decrypt(ciphertext) { - // 16 because should have at least one block - if (ciphertext.length < 16) - throw new Error('invalid ciphertext length'); - const out = (0, utils_ts_1.copyBytes)(ciphertext); - const o32 = (0, utils_ts_1.u32)(out); - AESW.decrypt(kek, out); - const len = byteSwap(o32[1]) >>> 0; - const padded = Math.ceil(len / 8) * 8; - if (o32[0] !== AESKWP_IV || out.length - 8 !== padded) - throw new Error('integrity check failed'); - for (let i = len; i < padded; i++) - if (out[8 + i] !== 0) - throw new Error('integrity check failed'); - out.subarray(0, 8).fill(0); // ciphertext.subarray(0, 8) === IV, but we clean it anyway - return out.subarray(8, 8 + len); - }, -})); -/** Unsafe low-level internal methods. May change at any time. */ -exports.unsafe = { - expandKeyLE, - expandKeyDecLE, - encrypt, - decrypt, - encryptBlock, - decryptBlock, - ctrCounter, - ctr32, -}; -//# sourceMappingURL=aes.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/aes.js.map b/tools/mnemonic-test/node_modules/@noble/ciphers/aes.js.map deleted file mode 100644 index cde20ae6..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/aes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"aes.js","sourceRoot":"","sources":["src/aes.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;GAeG;AACH,+CAA+C;AAC/C,kBAAkB;AAClB,yCAKoB;AAEpB,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,YAAY,GAAG,CAAC,CAAC;AACvB,MAAM,WAAW,GAAG,eAAe,CAAC,IAAI,UAAU,CAAC,UAAU,CAAC,CAAC;AAC/D,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,6BAA6B;AAEjD,+CAA+C;AAC/C,SAAS,IAAI,CAAC,CAAS;IACrB,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,SAAS,GAAG,CAAC,CAAS,EAAE,CAAS;IAC/B,IAAI,GAAG,GAAG,CAAC,CAAC;IACZ,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;QACtB,oBAAoB;QACpB,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,qCAA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G,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC;IAClC,CAAC;CACF,CAAC,CACH,CAAC;AAEF,iEAAiE;AACpD,QAAA,MAAM,GASf;IACF,WAAW;IACX,cAAc;IACd,OAAO;IACP,OAAO;IACP,YAAY;IACZ,YAAY;IACZ,UAAU;IACV,KAAK;CACN,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/chacha.d.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/chacha.d.ts deleted file mode 100644 index c521e9f7..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/chacha.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { type ARXCipher, type CipherWithOutput, type XorStream } from './utils.ts'; -/** - * hchacha helper method, used primarily in xchacha, to hash - * key and nonce into key' and nonce'. - * Same as chachaCore, but there doesn't seem to be a way to move the block - * out without 25% performance hit. - */ -export declare function hchacha(s: Uint32Array, k: Uint32Array, i: Uint32Array, o32: Uint32Array): void; -/** - * Original, non-RFC chacha20 from DJB. 8-byte nonce, 8-byte counter. - */ -export declare const chacha20orig: XorStream; -/** - * ChaCha stream cipher. Conforms to RFC 8439 (IETF, TLS). 12-byte nonce, 4-byte counter. - * With 12-byte nonce, it's not safe to use fill it with random (CSPRNG), due to collision chance. - */ -export declare const chacha20: XorStream; -/** - * XChaCha eXtended-nonce ChaCha. 24-byte nonce. - * With 24-byte nonce, it's safe to use fill it with random (CSPRNG). - * https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-xchacha - */ -export declare const xchacha20: XorStream; -/** - * Reduced 8-round chacha, described in original paper. - */ -export declare const chacha8: XorStream; -/** - * Reduced 12-round chacha, described in original paper. - */ -export declare const chacha12: XorStream; -/** - * AEAD algorithm from RFC 8439. - * Salsa20 and chacha (RFC 8439) use poly1305 differently. - * We could have composed them similar to: - * https://github.com/paulmillr/scure-base/blob/b266c73dde977b1dd7ef40ef7a23cc15aab526b3/index.ts#L250 - * But it's hard because of authKey: - * In salsa20, authKey changes position in salsa stream. - * In chacha, authKey can't be computed inside computeTag, it modifies the counter. - */ -export declare const _poly1305_aead: (xorStream: XorStream) => (key: Uint8Array, nonce: Uint8Array, AAD?: Uint8Array) => CipherWithOutput; -/** - * ChaCha20-Poly1305 from RFC 8439. - * - * Unsafe to use random nonces under the same key, due to collision chance. - * Prefer XChaCha instead. - */ -export declare const chacha20poly1305: ARXCipher; -/** - * XChaCha20-Poly1305 extended-nonce chacha. - * - * Can be safely used with random nonces (CSPRNG). - * See [IRTF draft](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-xchacha). - */ -export declare const xchacha20poly1305: ARXCipher; -//# sourceMappingURL=chacha.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/chacha.d.ts.map b/tools/mnemonic-test/node_modules/@noble/ciphers/chacha.d.ts.map deleted file mode 100644 index cec1ac82..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/chacha.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"chacha.d.ts","sourceRoot":"","sources":["src/chacha.ts"],"names":[],"mappings":"AAgBA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,SAAS,EAMf,MAAM,YAAY,CAAC;AAsEpB;;;;;GAKG;AAEH,wBAAgB,OAAO,CACrB,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,EAAE,GAAG,EAAE,WAAW,GAC/D,IAAI,CAmDN;AACD;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,SAIzB,CAAC;AACH;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,SAIrB,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,SAKtB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,SAIpB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,SAIrB,CAAC;AA6BH;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,GACxB,WAAW,SAAS,MACpB,KAAK,UAAU,EAAE,OAAO,UAAU,EAAE,MAAM,UAAU,KAAG,gBA0BvD,CAAC;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAG9B,CAAC;AACF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAG/B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/chacha.js b/tools/mnemonic-test/node_modules/@noble/ciphers/chacha.js deleted file mode 100644 index 9946c8ee..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/chacha.js +++ /dev/null @@ -1,320 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.xchacha20poly1305 = exports.chacha20poly1305 = exports._poly1305_aead = exports.chacha12 = exports.chacha8 = exports.xchacha20 = exports.chacha20 = exports.chacha20orig = void 0; -exports.hchacha = hchacha; -/** - * [ChaCha20](https://cr.yp.to/chacha.html) stream cipher, released - * in 2008. Developed after Salsa20, ChaCha aims to increase diffusion per round. - * It was standardized in [RFC 8439](https://datatracker.ietf.org/doc/html/rfc8439) and - * is now used in TLS 1.3. - * - * [XChaCha20](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-xchacha) - * extended-nonce variant is also provided. Similar to XSalsa, it's safe to use with - * randomly-generated nonces. - * - * Check out [PDF](http://cr.yp.to/chacha/chacha-20080128.pdf) and - * [wiki](https://en.wikipedia.org/wiki/Salsa20). - * @module - */ -const _arx_ts_1 = require("./_arx.js"); -const _poly1305_ts_1 = require("./_poly1305.js"); -const utils_ts_1 = require("./utils.js"); -/** - * ChaCha core function. - */ -// prettier-ignore -function chachaCore(s, k, n, out, cnt, rounds = 20) { - let y00 = s[0], y01 = s[1], y02 = s[2], y03 = s[3], // "expa" "nd 3" "2-by" "te k" - y04 = k[0], y05 = k[1], y06 = k[2], y07 = k[3], // Key Key Key Key - y08 = k[4], y09 = k[5], y10 = k[6], y11 = k[7], // Key Key Key Key - y12 = cnt, y13 = n[0], y14 = n[1], y15 = n[2]; // Counter Counter Nonce Nonce - // Save state to temporary variables - let x00 = y00, x01 = y01, x02 = y02, x03 = y03, x04 = y04, x05 = y05, x06 = y06, x07 = y07, x08 = y08, x09 = y09, x10 = y10, x11 = y11, x12 = y12, x13 = y13, x14 = y14, x15 = y15; - for (let r = 0; r < rounds; r += 2) { - x00 = (x00 + x04) | 0; - x12 = (0, _arx_ts_1.rotl)(x12 ^ x00, 16); - x08 = (x08 + x12) | 0; - x04 = (0, _arx_ts_1.rotl)(x04 ^ x08, 12); - x00 = (x00 + x04) | 0; - x12 = (0, _arx_ts_1.rotl)(x12 ^ x00, 8); - x08 = (x08 + x12) | 0; - x04 = (0, _arx_ts_1.rotl)(x04 ^ x08, 7); - x01 = (x01 + x05) | 0; - x13 = (0, _arx_ts_1.rotl)(x13 ^ x01, 16); - x09 = (x09 + x13) | 0; - x05 = (0, _arx_ts_1.rotl)(x05 ^ x09, 12); - x01 = (x01 + x05) | 0; - x13 = (0, _arx_ts_1.rotl)(x13 ^ x01, 8); - x09 = (x09 + x13) | 0; - x05 = (0, _arx_ts_1.rotl)(x05 ^ x09, 7); - x02 = (x02 + x06) | 0; - x14 = (0, _arx_ts_1.rotl)(x14 ^ x02, 16); - x10 = (x10 + x14) | 0; - x06 = (0, _arx_ts_1.rotl)(x06 ^ x10, 12); - x02 = (x02 + x06) | 0; - x14 = (0, _arx_ts_1.rotl)(x14 ^ x02, 8); - x10 = (x10 + x14) | 0; - x06 = (0, _arx_ts_1.rotl)(x06 ^ x10, 7); - x03 = (x03 + x07) | 0; - x15 = (0, _arx_ts_1.rotl)(x15 ^ x03, 16); - x11 = (x11 + x15) | 0; - x07 = (0, _arx_ts_1.rotl)(x07 ^ x11, 12); - x03 = (x03 + x07) | 0; - x15 = (0, _arx_ts_1.rotl)(x15 ^ x03, 8); - x11 = (x11 + x15) | 0; - x07 = (0, _arx_ts_1.rotl)(x07 ^ x11, 7); - x00 = (x00 + x05) | 0; - x15 = (0, _arx_ts_1.rotl)(x15 ^ x00, 16); - x10 = (x10 + x15) | 0; - x05 = (0, _arx_ts_1.rotl)(x05 ^ x10, 12); - x00 = (x00 + x05) | 0; - x15 = (0, _arx_ts_1.rotl)(x15 ^ x00, 8); - x10 = (x10 + x15) | 0; - x05 = (0, _arx_ts_1.rotl)(x05 ^ x10, 7); - x01 = (x01 + x06) | 0; - x12 = (0, _arx_ts_1.rotl)(x12 ^ x01, 16); - x11 = (x11 + x12) | 0; - x06 = (0, _arx_ts_1.rotl)(x06 ^ x11, 12); - x01 = (x01 + x06) | 0; - x12 = (0, _arx_ts_1.rotl)(x12 ^ x01, 8); - x11 = (x11 + x12) | 0; - x06 = (0, _arx_ts_1.rotl)(x06 ^ x11, 7); - x02 = (x02 + x07) | 0; - x13 = (0, _arx_ts_1.rotl)(x13 ^ x02, 16); - x08 = (x08 + x13) | 0; - x07 = (0, _arx_ts_1.rotl)(x07 ^ x08, 12); - x02 = (x02 + x07) | 0; - x13 = (0, _arx_ts_1.rotl)(x13 ^ x02, 8); - x08 = (x08 + x13) | 0; - x07 = (0, _arx_ts_1.rotl)(x07 ^ x08, 7); - x03 = (x03 + x04) | 0; - x14 = (0, _arx_ts_1.rotl)(x14 ^ x03, 16); - x09 = (x09 + x14) | 0; - x04 = (0, _arx_ts_1.rotl)(x04 ^ x09, 12); - x03 = (x03 + x04) | 0; - x14 = (0, _arx_ts_1.rotl)(x14 ^ x03, 8); - x09 = (x09 + x14) | 0; - x04 = (0, _arx_ts_1.rotl)(x04 ^ x09, 7); - } - // Write output - let oi = 0; - out[oi++] = (y00 + x00) | 0; - out[oi++] = (y01 + x01) | 0; - out[oi++] = (y02 + x02) | 0; - out[oi++] = (y03 + x03) | 0; - out[oi++] = (y04 + x04) | 0; - out[oi++] = (y05 + x05) | 0; - out[oi++] = (y06 + x06) | 0; - out[oi++] = (y07 + x07) | 0; - out[oi++] = (y08 + x08) | 0; - out[oi++] = (y09 + x09) | 0; - out[oi++] = (y10 + x10) | 0; - out[oi++] = (y11 + x11) | 0; - out[oi++] = (y12 + x12) | 0; - out[oi++] = (y13 + x13) | 0; - out[oi++] = (y14 + x14) | 0; - out[oi++] = (y15 + x15) | 0; -} -/** - * hchacha helper method, used primarily in xchacha, to hash - * key and nonce into key' and nonce'. - * Same as chachaCore, but there doesn't seem to be a way to move the block - * out without 25% performance hit. - */ -// prettier-ignore -function hchacha(s, k, i, o32) { - let x00 = s[0], x01 = s[1], x02 = s[2], x03 = s[3], x04 = k[0], x05 = k[1], x06 = k[2], x07 = k[3], x08 = k[4], x09 = k[5], x10 = k[6], x11 = k[7], x12 = i[0], x13 = i[1], x14 = i[2], x15 = i[3]; - for (let r = 0; r < 20; r += 2) { - x00 = (x00 + x04) | 0; - x12 = (0, _arx_ts_1.rotl)(x12 ^ x00, 16); - x08 = (x08 + x12) | 0; - x04 = (0, _arx_ts_1.rotl)(x04 ^ x08, 12); - x00 = (x00 + x04) | 0; - x12 = (0, _arx_ts_1.rotl)(x12 ^ x00, 8); - x08 = (x08 + x12) | 0; - x04 = (0, _arx_ts_1.rotl)(x04 ^ x08, 7); - x01 = (x01 + x05) | 0; - x13 = (0, _arx_ts_1.rotl)(x13 ^ x01, 16); - x09 = (x09 + x13) | 0; - x05 = (0, _arx_ts_1.rotl)(x05 ^ x09, 12); - x01 = (x01 + x05) | 0; - x13 = (0, _arx_ts_1.rotl)(x13 ^ x01, 8); - x09 = (x09 + x13) | 0; - x05 = (0, _arx_ts_1.rotl)(x05 ^ x09, 7); - x02 = (x02 + x06) | 0; - x14 = (0, _arx_ts_1.rotl)(x14 ^ x02, 16); - x10 = (x10 + x14) | 0; - x06 = (0, _arx_ts_1.rotl)(x06 ^ x10, 12); - x02 = (x02 + x06) | 0; - x14 = (0, _arx_ts_1.rotl)(x14 ^ x02, 8); - x10 = (x10 + x14) | 0; - x06 = (0, _arx_ts_1.rotl)(x06 ^ x10, 7); - x03 = (x03 + x07) | 0; - x15 = (0, _arx_ts_1.rotl)(x15 ^ x03, 16); - x11 = (x11 + x15) | 0; - x07 = (0, _arx_ts_1.rotl)(x07 ^ x11, 12); - x03 = (x03 + x07) | 0; - x15 = (0, _arx_ts_1.rotl)(x15 ^ x03, 8); - x11 = (x11 + x15) | 0; - x07 = (0, _arx_ts_1.rotl)(x07 ^ x11, 7); - x00 = (x00 + x05) | 0; - x15 = (0, _arx_ts_1.rotl)(x15 ^ x00, 16); - x10 = (x10 + x15) | 0; - x05 = (0, _arx_ts_1.rotl)(x05 ^ x10, 12); - x00 = (x00 + x05) | 0; - x15 = (0, _arx_ts_1.rotl)(x15 ^ x00, 8); - x10 = (x10 + x15) | 0; - x05 = (0, _arx_ts_1.rotl)(x05 ^ x10, 7); - x01 = (x01 + x06) | 0; - x12 = (0, _arx_ts_1.rotl)(x12 ^ x01, 16); - x11 = (x11 + x12) | 0; - x06 = (0, _arx_ts_1.rotl)(x06 ^ x11, 12); - x01 = (x01 + x06) | 0; - x12 = (0, _arx_ts_1.rotl)(x12 ^ x01, 8); - x11 = (x11 + x12) | 0; - x06 = (0, _arx_ts_1.rotl)(x06 ^ x11, 7); - x02 = (x02 + x07) | 0; - x13 = (0, _arx_ts_1.rotl)(x13 ^ x02, 16); - x08 = (x08 + x13) | 0; - x07 = (0, _arx_ts_1.rotl)(x07 ^ x08, 12); - x02 = (x02 + x07) | 0; - x13 = (0, _arx_ts_1.rotl)(x13 ^ x02, 8); - x08 = (x08 + x13) | 0; - x07 = (0, _arx_ts_1.rotl)(x07 ^ x08, 7); - x03 = (x03 + x04) | 0; - x14 = (0, _arx_ts_1.rotl)(x14 ^ x03, 16); - x09 = (x09 + x14) | 0; - x04 = (0, _arx_ts_1.rotl)(x04 ^ x09, 12); - x03 = (x03 + x04) | 0; - x14 = (0, _arx_ts_1.rotl)(x14 ^ x03, 8); - x09 = (x09 + x14) | 0; - x04 = (0, _arx_ts_1.rotl)(x04 ^ x09, 7); - } - let oi = 0; - o32[oi++] = x00; - o32[oi++] = x01; - o32[oi++] = x02; - o32[oi++] = x03; - o32[oi++] = x12; - o32[oi++] = x13; - o32[oi++] = x14; - o32[oi++] = x15; -} -/** - * Original, non-RFC chacha20 from DJB. 8-byte nonce, 8-byte counter. - */ -exports.chacha20orig = (0, _arx_ts_1.createCipher)(chachaCore, { - counterRight: false, - counterLength: 8, - allowShortKeys: true, -}); -/** - * ChaCha stream cipher. Conforms to RFC 8439 (IETF, TLS). 12-byte nonce, 4-byte counter. - * With 12-byte nonce, it's not safe to use fill it with random (CSPRNG), due to collision chance. - */ -exports.chacha20 = (0, _arx_ts_1.createCipher)(chachaCore, { - counterRight: false, - counterLength: 4, - allowShortKeys: false, -}); -/** - * XChaCha eXtended-nonce ChaCha. 24-byte nonce. - * With 24-byte nonce, it's safe to use fill it with random (CSPRNG). - * https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-xchacha - */ -exports.xchacha20 = (0, _arx_ts_1.createCipher)(chachaCore, { - counterRight: false, - counterLength: 8, - extendNonceFn: hchacha, - allowShortKeys: false, -}); -/** - * Reduced 8-round chacha, described in original paper. - */ -exports.chacha8 = (0, _arx_ts_1.createCipher)(chachaCore, { - counterRight: false, - counterLength: 4, - rounds: 8, -}); -/** - * Reduced 12-round chacha, described in original paper. - */ -exports.chacha12 = (0, _arx_ts_1.createCipher)(chachaCore, { - counterRight: false, - counterLength: 4, - rounds: 12, -}); -const ZEROS16 = /* @__PURE__ */ new Uint8Array(16); -// Pad to digest size with zeros -const updatePadded = (h, msg) => { - h.update(msg); - const left = msg.length % 16; - if (left) - h.update(ZEROS16.subarray(left)); -}; -const ZEROS32 = /* @__PURE__ */ new Uint8Array(32); -function computeTag(fn, key, nonce, data, AAD) { - const authKey = fn(key, nonce, ZEROS32); - const h = _poly1305_ts_1.poly1305.create(authKey); - if (AAD) - updatePadded(h, AAD); - updatePadded(h, data); - const num = (0, utils_ts_1.u64Lengths)(data.length, AAD ? AAD.length : 0, true); - h.update(num); - const res = h.digest(); - (0, utils_ts_1.clean)(authKey, num); - return res; -} -/** - * AEAD algorithm from RFC 8439. - * Salsa20 and chacha (RFC 8439) use poly1305 differently. - * We could have composed them similar to: - * https://github.com/paulmillr/scure-base/blob/b266c73dde977b1dd7ef40ef7a23cc15aab526b3/index.ts#L250 - * But it's hard because of authKey: - * In salsa20, authKey changes position in salsa stream. - * In chacha, authKey can't be computed inside computeTag, it modifies the counter. - */ -const _poly1305_aead = (xorStream) => (key, nonce, AAD) => { - const tagLength = 16; - return { - encrypt(plaintext, output) { - const plength = plaintext.length; - output = (0, utils_ts_1.getOutput)(plength + tagLength, output, false); - output.set(plaintext); - const oPlain = output.subarray(0, -tagLength); - xorStream(key, nonce, oPlain, oPlain, 1); - const tag = computeTag(xorStream, key, nonce, oPlain, AAD); - output.set(tag, plength); // append tag - (0, utils_ts_1.clean)(tag); - return output; - }, - decrypt(ciphertext, output) { - output = (0, utils_ts_1.getOutput)(ciphertext.length - tagLength, output, false); - const data = ciphertext.subarray(0, -tagLength); - const passedTag = ciphertext.subarray(-tagLength); - const tag = computeTag(xorStream, key, nonce, data, AAD); - if (!(0, utils_ts_1.equalBytes)(passedTag, tag)) - throw new Error('invalid tag'); - output.set(ciphertext.subarray(0, -tagLength)); - xorStream(key, nonce, output, output, 1); // start stream with i=1 - (0, utils_ts_1.clean)(tag); - return output; - }, - }; -}; -exports._poly1305_aead = _poly1305_aead; -/** - * ChaCha20-Poly1305 from RFC 8439. - * - * Unsafe to use random nonces under the same key, due to collision chance. - * Prefer XChaCha instead. - */ -exports.chacha20poly1305 = (0, utils_ts_1.wrapCipher)({ blockSize: 64, nonceLength: 12, tagLength: 16 }, (0, exports._poly1305_aead)(exports.chacha20)); -/** - * XChaCha20-Poly1305 extended-nonce chacha. - * - * Can be safely used with random nonces (CSPRNG). - * See [IRTF draft](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-xchacha). - */ -exports.xchacha20poly1305 = (0, utils_ts_1.wrapCipher)({ blockSize: 64, nonceLength: 24, tagLength: 16 }, (0, exports._poly1305_aead)(exports.xchacha20)); -//# sourceMappingURL=chacha.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/chacha.js.map b/tools/mnemonic-test/node_modules/@noble/ciphers/chacha.js.map deleted file mode 100644 index 52e9bdf6..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/chacha.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"chacha.js","sourceRoot":"","sources":["src/chacha.ts"],"names":[],"mappings":";;;AAsGA,0BAqDC;AA3JD;;;;;;;;;;;;;GAaG;AACH,uCAA+C;AAC/C,iDAA0C;AAC1C,yCASoB;AAEpB;;GAEG;AACH,kBAAkB;AAClB,SAAS,UAAU,CACjB,CAAc,EAAE,CAAc,EAAE,CAAc,EAAE,GAAgB,EAAE,GAAW,EAAE,MAAM,GAAG,EAAE;IAE1F,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,kCAAkC;IACpF,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAI,+BAA+B;IACjF,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAI,+BAA+B;IACjF,GAAG,GAAG,GAAG,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CA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Aa,CAAC,CAAC;YAChE,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;YAC/C,SAAS,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,wBAAwB;YAClE,IAAA,gBAAK,EAAC,GAAG,CAAC,CAAC;YACX,OAAO,MAAM,CAAC;QAChB,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AA5BS,QAAA,cAAc,kBA4BvB;AAEJ;;;;;GAKG;AACU,QAAA,gBAAgB,GAA8B,IAAA,qBAAU,EACnE,EAAE,SAAS,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,EACjD,IAAA,sBAAc,EAAC,gBAAQ,CAAC,CACzB,CAAC;AACF;;;;;GAKG;AACU,QAAA,iBAAiB,GAA8B,IAAA,qBAAU,EACpE,EAAE,SAAS,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,EACjD,IAAA,sBAAc,EAAC,iBAAS,CAAC,CAC1B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/crypto.d.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/crypto.d.ts deleted file mode 100644 index ac181a02..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/crypto.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const crypto: any; -//# sourceMappingURL=crypto.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/crypto.d.ts.map b/tools/mnemonic-test/node_modules/@noble/ciphers/crypto.d.ts.map deleted file mode 100644 index 4ecc6bca..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/crypto.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["src/crypto.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,MAAM,EAAE,GACqE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/crypto.js b/tools/mnemonic-test/node_modules/@noble/ciphers/crypto.js deleted file mode 100644 index 8226391f..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/crypto.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.crypto = void 0; -exports.crypto = typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined; -//# sourceMappingURL=crypto.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/crypto.js.map b/tools/mnemonic-test/node_modules/@noble/ciphers/crypto.js.map deleted file mode 100644 index 0bb417ce..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/crypto.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto.js","sourceRoot":"","sources":["src/crypto.ts"],"names":[],"mappings":";;;AAOa,QAAA,MAAM,GACjB,OAAO,UAAU,KAAK,QAAQ,IAAI,QAAQ,IAAI,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/cryptoNode.d.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/cryptoNode.d.ts deleted file mode 100644 index 98bda7be..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/cryptoNode.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const crypto: any; -//# sourceMappingURL=cryptoNode.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/cryptoNode.d.ts.map b/tools/mnemonic-test/node_modules/@noble/ciphers/cryptoNode.d.ts.map deleted file mode 100644 index 4303dc76..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/cryptoNode.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cryptoNode.d.ts","sourceRoot":"","sources":["src/cryptoNode.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,MAAM,EAAE,GAKJ,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/cryptoNode.js b/tools/mnemonic-test/node_modules/@noble/ciphers/cryptoNode.js deleted file mode 100644 index eba1a1ff..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/cryptoNode.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.crypto = void 0; -/** - * Internal webcrypto alias. - * We prefer WebCrypto aka globalThis.crypto, which exists in node.js 16+. - * Falls back to Node.js built-in crypto for Node.js <=v14. - * See utils.ts for details. - * @module - */ -// @ts-ignore -const nc = require("node:crypto"); -exports.crypto = nc && typeof nc === 'object' && 'webcrypto' in nc - ? nc.webcrypto - : nc && typeof nc === 'object' && 'randomBytes' in nc - ? nc - : undefined; -//# sourceMappingURL=cryptoNode.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/cryptoNode.js.map b/tools/mnemonic-test/node_modules/@noble/ciphers/cryptoNode.js.map deleted file mode 100644 index 14983d52..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/cryptoNode.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cryptoNode.js","sourceRoot":"","sources":["src/cryptoNode.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,aAAa;AACb,kCAAkC;AACrB,QAAA,MAAM,GACjB,EAAE,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,WAAW,IAAI,EAAE;IAC/C,CAAC,CAAE,EAAE,CAAC,SAAiB;IACvB,CAAC,CAAC,EAAE,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,aAAa,IAAI,EAAE;QACnD,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,SAAS,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_arx.d.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_arx.d.ts deleted file mode 100644 index 9b54727a..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_arx.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Basic utils for ARX (add-rotate-xor) salsa and chacha ciphers. - -RFC8439 requires multi-step cipher stream, where -authKey starts with counter: 0, actual msg with counter: 1. - -For this, we need a way to re-use nonce / counter: - - const counter = new Uint8Array(4); - chacha(..., counter, ...); // counter is now 1 - chacha(..., counter, ...); // counter is now 2 - -This is complicated: - -- 32-bit counters are enough, no need for 64-bit: max ArrayBuffer size in JS is 4GB -- Original papers don't allow mutating counters -- Counter overflow is undefined [^1] -- Idea A: allow providing (nonce | counter) instead of just nonce, re-use it -- Caveat: Cannot be re-used through all cases: -- * chacha has (counter | nonce) -- * xchacha has (nonce16 | counter | nonce16) -- Idea B: separate nonce / counter and provide separate API for counter re-use -- Caveat: there are different counter sizes depending on an algorithm. -- salsa & chacha also differ in structures of key & sigma: - salsa20: s[0] | k(4) | s[1] | nonce(2) | ctr(2) | s[2] | k(4) | s[3] - chacha: s(4) | k(8) | ctr(1) | nonce(3) - chacha20orig: s(4) | k(8) | ctr(2) | nonce(2) -- Idea C: helper method such as `setSalsaState(key, nonce, sigma, data)` -- Caveat: we can't re-use counter array - -xchacha [^2] uses the subkey and remaining 8 byte nonce with ChaCha20 as normal -(prefixed by 4 NUL bytes, since [RFC8439] specifies a 12-byte nonce). - -[^1]: https://mailarchive.ietf.org/arch/msg/cfrg/gsOnTJzcbgG6OqD8Sc0GO5aR_tU/ -[^2]: https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-xchacha#appendix-A.2 - - * @module - */ -import { type XorStream } from './utils.ts'; -export declare function rotl(a: number, b: number): number; -/** Ciphers must use u32 for efficiency. */ -export type CipherCoreFn = (sigma: Uint32Array, key: Uint32Array, nonce: Uint32Array, output: Uint32Array, counter: number, rounds?: number) => void; -/** Method which extends key + short nonce into larger nonce / diff key. */ -export type ExtendNonceFn = (sigma: Uint32Array, key: Uint32Array, input: Uint32Array, output: Uint32Array) => void; -/** ARX cipher options. - * * `allowShortKeys` for 16-byte keys - * * `counterLength` in bytes - * * `counterRight`: right: `nonce|counter`; left: `counter|nonce` - * */ -export type CipherOpts = { - allowShortKeys?: boolean; - extendNonceFn?: ExtendNonceFn; - counterLength?: number; - counterRight?: boolean; - rounds?: number; -}; -/** Creates ARX-like (ChaCha, Salsa) cipher stream from core function. */ -export declare function createCipher(core: CipherCoreFn, opts: CipherOpts): XorStream; -//# sourceMappingURL=_arx.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_arx.d.ts.map b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_arx.d.ts.map deleted file mode 100644 index e02f48cb..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_arx.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_arx.d.ts","sourceRoot":"","sources":["../src/_arx.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,EACL,KAAK,SAAS,EACf,MAAM,YAAY,CAAC;AAUpB,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,2CAA2C;AAC3C,MAAM,MAAM,YAAY,GAAG,CACzB,KAAK,EAAE,WAAW,EAClB,GAAG,EAAE,WAAW,EAChB,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,MAAM,KACZ,IAAI,CAAC;AAEV,2EAA2E;AAC3E,MAAM,MAAM,aAAa,GAAG,CAC1B,KAAK,EAAE,WAAW,EAClB,GAAG,EAAE,WAAW,EAChB,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,WAAW,KAChB,IAAI,CAAC;AAEV;;;;KAIK;AACL,MAAM,MAAM,UAAU,GAAG;IACvB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAwDF,yEAAyE;AACzE,wBAAgB,YAAY,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,SAAS,CAkF5E"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_arx.js b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_arx.js deleted file mode 100644 index 3b8daee6..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_arx.js +++ /dev/null @@ -1,171 +0,0 @@ -/** - * Basic utils for ARX (add-rotate-xor) salsa and chacha ciphers. - -RFC8439 requires multi-step cipher stream, where -authKey starts with counter: 0, actual msg with counter: 1. - -For this, we need a way to re-use nonce / counter: - - const counter = new Uint8Array(4); - chacha(..., counter, ...); // counter is now 1 - chacha(..., counter, ...); // counter is now 2 - -This is complicated: - -- 32-bit counters are enough, no need for 64-bit: max ArrayBuffer size in JS is 4GB -- Original papers don't allow mutating counters -- Counter overflow is undefined [^1] -- Idea A: allow providing (nonce | counter) instead of just nonce, re-use it -- Caveat: Cannot be re-used through all cases: -- * chacha has (counter | nonce) -- * xchacha has (nonce16 | counter | nonce16) -- Idea B: separate nonce / counter and provide separate API for counter re-use -- Caveat: there are different counter sizes depending on an algorithm. -- salsa & chacha also differ in structures of key & sigma: - salsa20: s[0] | k(4) | s[1] | nonce(2) | ctr(2) | s[2] | k(4) | s[3] - chacha: s(4) | k(8) | ctr(1) | nonce(3) - chacha20orig: s(4) | k(8) | ctr(2) | nonce(2) -- Idea C: helper method such as `setSalsaState(key, nonce, sigma, data)` -- Caveat: we can't re-use counter array - -xchacha [^2] uses the subkey and remaining 8 byte nonce with ChaCha20 as normal -(prefixed by 4 NUL bytes, since [RFC8439] specifies a 12-byte nonce). - -[^1]: https://mailarchive.ietf.org/arch/msg/cfrg/gsOnTJzcbgG6OqD8Sc0GO5aR_tU/ -[^2]: https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-xchacha#appendix-A.2 - - * @module - */ -// prettier-ignore -import { abool, abytes, anumber, checkOpts, clean, copyBytes, u32 } from "./utils.js"; -// We can't make top-level var depend on utils.utf8ToBytes -// because it's not present in all envs. Creating a similar fn here -const _utf8ToBytes = (str) => Uint8Array.from(str.split('').map((c) => c.charCodeAt(0))); -const sigma16 = _utf8ToBytes('expand 16-byte k'); -const sigma32 = _utf8ToBytes('expand 32-byte k'); -const sigma16_32 = u32(sigma16); -const sigma32_32 = u32(sigma32); -export function rotl(a, b) { - return (a << b) | (a >>> (32 - b)); -} -// Is byte array aligned to 4 byte offset (u32)? -function isAligned32(b) { - return b.byteOffset % 4 === 0; -} -// Salsa and Chacha block length is always 512-bit -const BLOCK_LEN = 64; -const BLOCK_LEN32 = 16; -// new Uint32Array([2**32]) // => Uint32Array(1) [ 0 ] -// new Uint32Array([2**32-1]) // => Uint32Array(1) [ 4294967295 ] -const MAX_COUNTER = 2 ** 32 - 1; -const U32_EMPTY = new Uint32Array(); -function runCipher(core, sigma, key, nonce, data, output, counter, rounds) { - const len = data.length; - const block = new Uint8Array(BLOCK_LEN); - const b32 = u32(block); - // Make sure that buffers aligned to 4 bytes - const isAligned = isAligned32(data) && isAligned32(output); - const d32 = isAligned ? u32(data) : U32_EMPTY; - const o32 = isAligned ? u32(output) : U32_EMPTY; - for (let pos = 0; pos < len; counter++) { - core(sigma, key, nonce, b32, counter, rounds); - if (counter >= MAX_COUNTER) - throw new Error('arx: counter overflow'); - const take = Math.min(BLOCK_LEN, len - pos); - // aligned to 4 bytes - if (isAligned && take === BLOCK_LEN) { - const pos32 = pos / 4; - if (pos % 4 !== 0) - throw new Error('arx: invalid block position'); - for (let j = 0, posj; j < BLOCK_LEN32; j++) { - posj = pos32 + j; - o32[posj] = d32[posj] ^ b32[j]; - } - pos += BLOCK_LEN; - continue; - } - for (let j = 0, posj; j < take; j++) { - posj = pos + j; - output[posj] = data[posj] ^ block[j]; - } - pos += take; - } -} -/** Creates ARX-like (ChaCha, Salsa) cipher stream from core function. */ -export function createCipher(core, opts) { - const { allowShortKeys, extendNonceFn, counterLength, counterRight, rounds } = checkOpts({ allowShortKeys: false, counterLength: 8, counterRight: false, rounds: 20 }, opts); - if (typeof core !== 'function') - throw new Error('core must be a function'); - anumber(counterLength); - anumber(rounds); - abool(counterRight); - abool(allowShortKeys); - return (key, nonce, data, output, counter = 0) => { - abytes(key); - abytes(nonce); - abytes(data); - const len = data.length; - if (output === undefined) - output = new Uint8Array(len); - abytes(output); - anumber(counter); - if (counter < 0 || counter >= MAX_COUNTER) - throw new Error('arx: counter overflow'); - if (output.length < len) - throw new Error(`arx: output (${output.length}) is shorter than data (${len})`); - const toClean = []; - // Key & sigma - // key=16 -> sigma16, k=key|key - // key=32 -> sigma32, k=key - let l = key.length; - let k; - let sigma; - if (l === 32) { - toClean.push((k = copyBytes(key))); - sigma = sigma32_32; - } - else if (l === 16 && allowShortKeys) { - k = new Uint8Array(32); - k.set(key); - k.set(key, 16); - sigma = sigma16_32; - toClean.push(k); - } - else { - throw new Error(`arx: invalid 32-byte key, got length=${l}`); - } - // Nonce - // salsa20: 8 (8-byte counter) - // chacha20orig: 8 (8-byte counter) - // chacha20: 12 (4-byte counter) - // xsalsa20: 24 (16 -> hsalsa, 8 -> old nonce) - // xchacha20: 24 (16 -> hchacha, 8 -> old nonce) - // Align nonce to 4 bytes - if (!isAligned32(nonce)) - toClean.push((nonce = copyBytes(nonce))); - const k32 = u32(k); - // hsalsa & hchacha: handle extended nonce - if (extendNonceFn) { - if (nonce.length !== 24) - throw new Error(`arx: extended nonce must be 24 bytes`); - extendNonceFn(sigma, k32, u32(nonce.subarray(0, 16)), k32); - nonce = nonce.subarray(16); - } - // Handle nonce counter - const nonceNcLen = 16 - counterLength; - if (nonceNcLen !== nonce.length) - throw new Error(`arx: nonce must be ${nonceNcLen} or 16 bytes`); - // Pad counter when nonce is 64 bit - if (nonceNcLen !== 12) { - const nc = new Uint8Array(12); - nc.set(nonce, counterRight ? 0 : 12 - nonce.length); - nonce = nc; - toClean.push(nonce); - } - const n32 = u32(nonce); - runCipher(core, sigma, k32, n32, data, output, counter, rounds); - clean(...toClean); - return output; - }; -} -//# sourceMappingURL=_arx.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_arx.js.map b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_arx.js.map deleted file mode 100644 index cddd51f7..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_arx.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_arx.js","sourceRoot":"","sources":["../src/_arx.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,kBAAkB;AAClB,OAAO,EACW,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EACzE,MAAM,YAAY,CAAC;AAEpB,0DAA0D;AAC1D,mEAAmE;AACnE,MAAM,YAAY,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACjG,MAAM,OAAO,GAAG,YAAY,CAAC,kBAAkB,CAAC,CAAC;AACjD,MAAM,OAAO,GAAG,YAAY,CAAC,kBAAkB,CAAC,CAAC;AACjD,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAA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a,CAAC;QACtC,IAAI,UAAU,KAAK,KAAK,CAAC,MAAM;YAC7B,MAAM,IAAI,KAAK,CAAC,sBAAsB,UAAU,cAAc,CAAC,CAAC;QAElE,mCAAmC;QACnC,IAAI,UAAU,KAAK,EAAE,EAAE,CAAC;YACtB,MAAM,EAAE,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;YAC9B,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;YACpD,KAAK,GAAG,EAAE,CAAC;YACX,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC;QACD,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC;QACvB,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QAChE,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC;QAClB,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_assert.d.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_assert.d.ts deleted file mode 100644 index 5faec8e0..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_assert.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Internal assertion helpers. - * @module - * @deprecated - */ -import { abytes as ab, abool as abool_, aexists as ae, anumber as an, aoutput as ao, type IHash as H } from './utils.ts'; -/** @deprecated Use import from `noble/hashes/utils` module */ -export declare const abool: typeof abool_; -/** @deprecated Use import from `noble/hashes/utils` module */ -export declare const abytes: typeof ab; -/** @deprecated Use import from `noble/hashes/utils` module */ -export declare const aexists: typeof ae; -/** @deprecated Use import from `noble/hashes/utils` module */ -export declare const anumber: typeof an; -/** @deprecated Use import from `noble/hashes/utils` module */ -export declare const aoutput: typeof ao; -/** @deprecated Use import from `noble/hashes/utils` module */ -export type Hash = H; -//# sourceMappingURL=_assert.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_assert.d.ts.map b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_assert.d.ts.map deleted file mode 100644 index 140a2419..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_assert.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_assert.d.ts","sourceRoot":"","sources":["../src/_assert.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,MAAM,IAAI,EAAE,EACZ,KAAK,IAAI,MAAM,EACf,OAAO,IAAI,EAAE,EACb,OAAO,IAAI,EAAE,EACb,OAAO,IAAI,EAAE,EACb,KAAK,KAAK,IAAI,CAAC,EAChB,MAAM,YAAY,CAAC;AACpB,8DAA8D;AAC9D,eAAO,MAAM,KAAK,EAAE,OAAO,MAAe,CAAC;AAC3C,8DAA8D;AAC9D,eAAO,MAAM,MAAM,EAAE,OAAO,EAAO,CAAC;AACpC,8DAA8D;AAC9D,eAAO,MAAM,OAAO,EAAE,OAAO,EAAO,CAAC;AACrC,8DAA8D;AAC9D,eAAO,MAAM,OAAO,EAAE,OAAO,EAAO,CAAC;AACrC,8DAA8D;AAC9D,eAAO,MAAM,OAAO,EAAE,OAAO,EAAO,CAAC;AACrC,8DAA8D;AAC9D,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_assert.js b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_assert.js deleted file mode 100644 index f99c5373..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_assert.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Internal assertion helpers. - * @module - * @deprecated - */ -import { abytes as ab, abool as abool_, aexists as ae, anumber as an, aoutput as ao, } from "./utils.js"; -/** @deprecated Use import from `noble/hashes/utils` module */ -export const abool = abool_; -/** @deprecated Use import from `noble/hashes/utils` module */ -export const abytes = ab; -/** @deprecated Use import from `noble/hashes/utils` module */ -export const aexists = ae; -/** @deprecated Use import from `noble/hashes/utils` module */ -export const anumber = an; -/** @deprecated Use import from `noble/hashes/utils` module */ -export const aoutput = ao; -//# sourceMappingURL=_assert.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_assert.js.map b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_assert.js.map deleted file mode 100644 index 69fe59b4..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_assert.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_assert.js","sourceRoot":"","sources":["../src/_assert.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,MAAM,IAAI,EAAE,EACZ,KAAK,IAAI,MAAM,EACf,OAAO,IAAI,EAAE,EACb,OAAO,IAAI,EAAE,EACb,OAAO,IAAI,EAAE,GAEd,MAAM,YAAY,CAAC;AACpB,8DAA8D;AAC9D,MAAM,CAAC,MAAM,KAAK,GAAkB,MAAM,CAAC;AAC3C,8DAA8D;AAC9D,MAAM,CAAC,MAAM,MAAM,GAAc,EAAE,CAAC;AACpC,8DAA8D;AAC9D,MAAM,CAAC,MAAM,OAAO,GAAc,EAAE,CAAC;AACrC,8DAA8D;AAC9D,MAAM,CAAC,MAAM,OAAO,GAAc,EAAE,CAAC;AACrC,8DAA8D;AAC9D,MAAM,CAAC,MAAM,OAAO,GAAc,EAAE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_micro.d.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_micro.d.ts deleted file mode 100644 index 6673e9e7..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_micro.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { type Cipher, type XorStream } from './utils.ts'; -export type ARXCipherN = ((key: Uint8Array, nonce: Uint8Array, AAD?: Uint8Array) => Cipher) & { - blockSize: number; - nonceLength: number; - tagLength: number; -}; -/** hsalsa hashes key and nonce into key' and nonce'. */ -export declare function hsalsa(s: Uint32Array, k: Uint32Array, i: Uint32Array, o32: Uint32Array): void; -/** hchacha hashes key and nonce into key' and nonce'. */ -export declare function hchacha(s: Uint32Array, k: Uint32Array, i: Uint32Array, o32: Uint32Array): void; -/** salsa20, 12-byte nonce. */ -export declare const salsa20: XorStream; -/** xsalsa20, 24-byte nonce. */ -export declare const xsalsa20: XorStream; -/** chacha20 non-RFC, original version by djb. 8-byte nonce, 8-byte counter. */ -export declare const chacha20orig: XorStream; -/** chacha20 RFC 8439 (IETF / TLS). 12-byte nonce, 4-byte counter. */ -export declare const chacha20: XorStream; -/** xchacha20 eXtended-nonce. https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-xchacha */ -export declare const xchacha20: XorStream; -/** 8-round chacha from the original paper. */ -export declare const chacha8: XorStream; -/** 12-round chacha from the original paper. */ -export declare const chacha12: XorStream; -/** Poly1305 polynomial MAC. Can be speed-up using BigUint64Array, at the cost of complexity. */ -export declare function poly1305(msg: Uint8Array, key: Uint8Array): Uint8Array; -/** xsalsa20-poly1305 eXtended-nonce (24 bytes) salsa. */ -export declare const xsalsa20poly1305: ARXCipherN; -/** Alias to `xsalsa20poly1305`. */ -export declare function secretbox(key: Uint8Array, nonce: Uint8Array): { - seal: (plaintext: Uint8Array) => Uint8Array; - open: (ciphertext: Uint8Array) => Uint8Array; -}; -export declare const _poly1305_aead: (fn: XorStream) => (key: Uint8Array, nonce: Uint8Array, AAD?: Uint8Array) => Cipher; -/** chacha20-poly1305 12-byte-nonce chacha. */ -export declare const chacha20poly1305: ARXCipherN; -/** - * XChaCha20-Poly1305 extended-nonce chacha. Can be safely used with random nonces (CSPRNG). - */ -export declare const xchacha20poly1305: ARXCipherN; -//# sourceMappingURL=_micro.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_micro.d.ts.map b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_micro.d.ts.map deleted file mode 100644 index 723f6ce0..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_micro.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_micro.d.ts","sourceRoot":"","sources":["../src/_micro.ts"],"names":[],"mappings":"AASA,OAAO,EACL,KAAK,MAAM,EACX,KAAK,SAAS,EASf,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,CAAC,EAAE,UAAU,KAAK,MAAM,CAAC,GAAG;IAC5F,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAuEF,wDAAwD;AAExD,wBAAgB,MAAM,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,EAAE,GAAG,EAAE,WAAW,GAAG,IAAI,CAa7F;AAsBD,yDAAyD;AAEzD,wBAAgB,OAAO,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,EAAE,GAAG,EAAE,WAAW,GAAG,IAAI,CAa9F;AAED,8BAA8B;AAC9B,eAAO,MAAM,OAAO,EAAE,SAGpB,CAAC;AAEH,+BAA+B;AAC/B,eAAO,MAAM,QAAQ,EAAE,SAGrB,CAAC;AAEH,+EAA+E;AAC/E,eAAO,MAAM,YAAY,EAAE,SAIzB,CAAC;AAEH,qEAAqE;AACrE,eAAO,MAAM,QAAQ,EAAE,SAGrB,CAAC;AAEH,8FAA8F;AAC9F,eAAO,MAAM,SAAS,EAAE,SAItB,CAAC;AAEH,8CAA8C;AAC9C,eAAO,MAAM,OAAO,EAAE,SAIpB,CAAC;AAEH,+CAA+C;AAC/C,eAAO,MAAM,QAAQ,EAAE,SAIrB,CAAC;AAQH,gGAAgG;AAChG,wBAAgB,QAAQ,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,UAAU,CAcrE;AAuBD,yDAAyD;AACzD,eAAO,MAAM,gBAAgB,EAAE,UAsB9B,CAAC;AAEF,mCAAmC;AACnC,wBAAgB,SAAS,CACvB,GAAG,EAAE,UAAU,EACf,KAAK,EAAE,UAAU,GAChB;IACD,IAAI,EAAE,CAAC,SAAS,EAAE,UAAU,KAAK,UAAU,CAAC;IAC5C,IAAI,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,UAAU,CAAC;CAC9C,CAGA;AAED,eAAO,MAAM,cAAc,GACxB,IAAI,SAAS,MACb,KAAK,UAAU,EAAE,OAAO,UAAU,EAAE,MAAM,UAAU,KAAG,MAgBvD,CAAC;AAEJ,8CAA8C;AAC9C,eAAO,MAAM,gBAAgB,EAAE,UAG9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,UAG/B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_micro.js b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_micro.js deleted file mode 100644 index 04157cbe..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_micro.js +++ /dev/null @@ -1,252 +0,0 @@ -/** - * noble-ciphers-micro: more auditable, but 4x slower version of salsa20, chacha & poly1305. - * Implements the same algorithms that are present in other files, but without - * unrolled loops (https://en.wikipedia.org/wiki/Loop_unrolling). - * @module - */ -/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */ -// prettier-ignore -import { createCipher, rotl } from "./_arx.js"; -import { abytes, bytesToHex, concatBytes, equalBytes, hexToNumber, numberToBytesBE, u64Lengths, wrapCipher, } from "./utils.js"; -function bytesToNumberLE(bytes) { - abytes(bytes); - return hexToNumber(bytesToHex(Uint8Array.from(bytes).reverse())); -} -function numberToBytesLE(n, len) { - return numberToBytesBE(n, len).reverse(); -} -function salsaQR(x, a, b, c, d) { - x[b] ^= rotl((x[a] + x[d]) | 0, 7); - x[c] ^= rotl((x[b] + x[a]) | 0, 9); - x[d] ^= rotl((x[c] + x[b]) | 0, 13); - x[a] ^= rotl((x[d] + x[c]) | 0, 18); -} -// prettier-ignore -function chachaQR(x, a, b, c, d) { - x[a] = (x[a] + x[b]) | 0; - x[d] = rotl(x[d] ^ x[a], 16); - x[c] = (x[c] + x[d]) | 0; - x[b] = rotl(x[b] ^ x[c], 12); - x[a] = (x[a] + x[b]) | 0; - x[d] = rotl(x[d] ^ x[a], 8); - x[c] = (x[c] + x[d]) | 0; - x[b] = rotl(x[b] ^ x[c], 7); -} -function salsaRound(x, rounds = 20) { - for (let r = 0; r < rounds; r += 2) { - salsaQR(x, 0, 4, 8, 12); - salsaQR(x, 5, 9, 13, 1); - salsaQR(x, 10, 14, 2, 6); - salsaQR(x, 15, 3, 7, 11); - salsaQR(x, 0, 1, 2, 3); - salsaQR(x, 5, 6, 7, 4); - salsaQR(x, 10, 11, 8, 9); - salsaQR(x, 15, 12, 13, 14); - } -} -function chachaRound(x, rounds = 20) { - for (let r = 0; r < rounds; r += 2) { - chachaQR(x, 0, 4, 8, 12); - chachaQR(x, 1, 5, 9, 13); - chachaQR(x, 2, 6, 10, 14); - chachaQR(x, 3, 7, 11, 15); - chachaQR(x, 0, 5, 10, 15); - chachaQR(x, 1, 6, 11, 12); - chachaQR(x, 2, 7, 8, 13); - chachaQR(x, 3, 4, 9, 14); - } -} -function salsaCore(s, k, n, out, cnt, rounds = 20) { - // prettier-ignore - const y = new Uint32Array([ - s[0], k[0], k[1], k[2], // "expa" Key Key Key - k[3], s[1], n[0], n[1], // Key "nd 3" Nonce Nonce - cnt, 0, s[2], k[4], // Pos. Pos. "2-by" Key - k[5], k[6], k[7], s[3], // Key Key Key "te k" - ]); - const x = y.slice(); - salsaRound(x, rounds); - for (let i = 0; i < 16; i++) - out[i] = (y[i] + x[i]) | 0; -} -/** hsalsa hashes key and nonce into key' and nonce'. */ -// prettier-ignore -export function hsalsa(s, k, i, o32) { - const x = new Uint32Array([ - s[0], k[0], k[1], k[2], - k[3], s[1], i[0], i[1], - i[2], i[3], s[2], k[4], - k[5], k[6], k[7], s[3] - ]); - salsaRound(x, 20); - let oi = 0; - o32[oi++] = x[0]; - o32[oi++] = x[5]; - o32[oi++] = x[10]; - o32[oi++] = x[15]; - o32[oi++] = x[6]; - o32[oi++] = x[7]; - o32[oi++] = x[8]; - o32[oi++] = x[9]; -} -function chachaCore(s, k, n, out, cnt, rounds = 20) { - // prettier-ignore - const y = new Uint32Array([ - s[0], s[1], s[2], s[3], // "expa" "nd 3" "2-by" "te k" - k[0], k[1], k[2], k[3], // Key Key Key Key - k[4], k[5], k[6], k[7], // Key Key Key Key - cnt, n[0], n[1], n[2], // Counter Counter Nonce Nonce - ]); - const x = y.slice(); - chachaRound(x, rounds); - for (let i = 0; i < 16; i++) - out[i] = (y[i] + x[i]) | 0; -} -/** hchacha hashes key and nonce into key' and nonce'. */ -// prettier-ignore -export function hchacha(s, k, i, o32) { - const x = new Uint32Array([ - s[0], s[1], s[2], s[3], - k[0], k[1], k[2], k[3], - k[4], k[5], k[6], k[7], - i[0], i[1], i[2], i[3], - ]); - chachaRound(x, 20); - let oi = 0; - o32[oi++] = x[0]; - o32[oi++] = x[1]; - o32[oi++] = x[2]; - o32[oi++] = x[3]; - o32[oi++] = x[12]; - o32[oi++] = x[13]; - o32[oi++] = x[14]; - o32[oi++] = x[15]; -} -/** salsa20, 12-byte nonce. */ -export const salsa20 = /* @__PURE__ */ createCipher(salsaCore, { - allowShortKeys: true, - counterRight: true, -}); -/** xsalsa20, 24-byte nonce. */ -export const xsalsa20 = /* @__PURE__ */ createCipher(salsaCore, { - counterRight: true, - extendNonceFn: hsalsa, -}); -/** chacha20 non-RFC, original version by djb. 8-byte nonce, 8-byte counter. */ -export const chacha20orig = /* @__PURE__ */ createCipher(chachaCore, { - allowShortKeys: true, - counterRight: false, - counterLength: 8, -}); -/** chacha20 RFC 8439 (IETF / TLS). 12-byte nonce, 4-byte counter. */ -export const chacha20 = /* @__PURE__ */ createCipher(chachaCore, { - counterRight: false, - counterLength: 4, -}); -/** xchacha20 eXtended-nonce. https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-xchacha */ -export const xchacha20 = /* @__PURE__ */ createCipher(chachaCore, { - counterRight: false, - counterLength: 8, - extendNonceFn: hchacha, -}); -/** 8-round chacha from the original paper. */ -export const chacha8 = /* @__PURE__ */ createCipher(chachaCore, { - counterRight: false, - counterLength: 4, - rounds: 8, -}); -/** 12-round chacha from the original paper. */ -export const chacha12 = /* @__PURE__ */ createCipher(chachaCore, { - counterRight: false, - counterLength: 4, - rounds: 12, -}); -const POW_2_130_5 = BigInt(2) ** BigInt(130) - BigInt(5); -const POW_2_128_1 = BigInt(2) ** BigInt(16 * 8) - BigInt(1); -const CLAMP_R = BigInt('0x0ffffffc0ffffffc0ffffffc0fffffff'); -const _0 = BigInt(0); -const _1 = BigInt(1); -/** Poly1305 polynomial MAC. Can be speed-up using BigUint64Array, at the cost of complexity. */ -export function poly1305(msg, key) { - abytes(msg); - abytes(key, 32); - let acc = _0; - const r = bytesToNumberLE(key.subarray(0, 16)) & CLAMP_R; - const s = bytesToNumberLE(key.subarray(16)); - // Process by 16 byte chunks - for (let i = 0; i < msg.length; i += 16) { - const m = msg.subarray(i, i + 16); - const n = bytesToNumberLE(m) | (_1 << BigInt(8 * m.length)); - acc = ((acc + n) * r) % POW_2_130_5; - } - const res = (acc + s) & POW_2_128_1; - return numberToBytesLE(res, 16); -} -function computeTag(fn, key, nonce, ciphertext, AAD) { - const res = []; - if (AAD) { - res.push(AAD); - const leftover = AAD.length % 16; - if (leftover > 0) - res.push(new Uint8Array(16 - leftover)); - } - res.push(ciphertext); - const leftover = ciphertext.length % 16; - if (leftover > 0) - res.push(new Uint8Array(16 - leftover)); - res.push(u64Lengths(ciphertext.length, AAD ? AAD.length : 0, true)); - const authKey = fn(key, nonce, new Uint8Array(32)); - return poly1305(concatBytes(...res), authKey); -} -/** xsalsa20-poly1305 eXtended-nonce (24 bytes) salsa. */ -export const xsalsa20poly1305 = /* @__PURE__ */ wrapCipher({ blockSize: 64, nonceLength: 24, tagLength: 16 }, function xsalsapoly(key, nonce) { - return { - encrypt(plaintext) { - const m = concatBytes(new Uint8Array(32), plaintext); - const c = xsalsa20(key, nonce, m); - const authKey = c.subarray(0, 32); - const data = c.subarray(32); - const tag = poly1305(data, authKey); - return concatBytes(tag, data); - }, - decrypt(ciphertext) { - const c = concatBytes(new Uint8Array(16), ciphertext); - const passedTag = c.subarray(16, 32); - const authKey = xsalsa20(key, nonce, new Uint8Array(32)); - const tag = poly1305(c.subarray(32), authKey); - if (!equalBytes(tag, passedTag)) - throw new Error('invalid poly1305 tag'); - return xsalsa20(key, nonce, c).subarray(32); - }, - }; -}); -/** Alias to `xsalsa20poly1305`. */ -export function secretbox(key, nonce) { - const xs = xsalsa20poly1305(key, nonce); - return { seal: xs.encrypt, open: xs.decrypt }; -} -export const _poly1305_aead = (fn) => (key, nonce, AAD) => { - const tagLength = 16; - return { - encrypt(plaintext) { - const data = fn(key, nonce, plaintext, undefined, 1); // stream from i=1 - const tag = computeTag(fn, key, nonce, data, AAD); - return concatBytes(data, tag); - }, - decrypt(ciphertext) { - const passedTag = ciphertext.subarray(-tagLength); - const data = ciphertext.subarray(0, -tagLength); - const tag = computeTag(fn, key, nonce, data, AAD); - if (!equalBytes(tag, passedTag)) - throw new Error('invalid poly1305 tag'); - return fn(key, nonce, data, undefined, 1); // stream from i=1 - }, - }; -}; -/** chacha20-poly1305 12-byte-nonce chacha. */ -export const chacha20poly1305 = /* @__PURE__ */ wrapCipher({ blockSize: 64, nonceLength: 12, tagLength: 16 }, _poly1305_aead(chacha20)); -/** - * XChaCha20-Poly1305 extended-nonce chacha. Can be safely used with random nonces (CSPRNG). - */ -export const xchacha20poly1305 = /* @__PURE__ */ wrapCipher({ blockSize: 64, nonceLength: 24, tagLength: 16 }, _poly1305_aead(xchacha20)); -//# sourceMappingURL=_micro.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_micro.js.map b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_micro.js.map deleted file mode 100644 index ece8975f..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_micro.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_micro.js","sourceRoot":"","sources":["../src/_micro.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,uEAAuE;AACvE,kBAAkB;AAClB,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAGL,MAAM,EACN,UAAU,EACV,WAAW,EACX,UAAU,EACV,WAAW,EACX,eAAe,EACf,UAAU,EACV,UAAU,GACX,MAAM,YAAY,CAAC;AAQpB,SAAS,eAAe,CAAC,KAAiB;IACxC,MAAM,CAAC,KAAK,CAAC,CAAC;IACd,OAAO,WAAW,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;AACnE,CAAC;AAED,SAAS,eAAe,CAAC,CAAkB,EAAE,GAAW;IACtD,OAAO,eAAe,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC;AAC3C,CAAC;AAED,SAAS,OAAO,CAAC,CAAc,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS;IACzE,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,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CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;YAChD,MAAM,GAAG,GAAG,UAAU,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;YAClD,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,SAAS,CAAC;gBAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;YACzE,OAAO,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC,kBAAkB;QAC/D,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAEJ,8CAA8C;AAC9C,MAAM,CAAC,MAAM,gBAAgB,GAAe,eAAe,CAAC,UAAU,CACpE,EAAE,SAAS,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,EACjD,cAAc,CAAC,QAAQ,CAAC,CACzB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAe,eAAe,CAAC,UAAU,CACrE,EAAE,SAAS,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,EACjD,cAAc,CAAC,SAAS,CAAC,CAC1B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_poly1305.d.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_poly1305.d.ts deleted file mode 100644 index 921dd3bb..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_poly1305.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Poly1305 ([PDF](https://cr.yp.to/mac/poly1305-20050329.pdf), - * [wiki](https://en.wikipedia.org/wiki/Poly1305)) - * is a fast and parallel secret-key message-authentication code suitable for - * a wide variety of applications. It was standardized in - * [RFC 8439](https://datatracker.ietf.org/doc/html/rfc8439) and is now used in TLS 1.3. - * - * Polynomial MACs are not perfect for every situation: - * they lack Random Key Robustness: the MAC can be forged, and can't be used in PAKE schemes. - * See [invisible salamanders attack](https://keymaterial.net/2020/09/07/invisible-salamanders-in-aes-gcm-siv/). - * To combat invisible salamanders, `hash(key)` can be included in ciphertext, - * however, this would violate ciphertext indistinguishability: - * an attacker would know which key was used - so `HKDF(key, i)` - * could be used instead. - * - * Check out [original website](https://cr.yp.to/mac.html). - * @module - */ -import { Hash, type Input } from './utils.ts'; -export type CHash = ReturnType; -export declare function wrapConstructorWithKey>(hashCons: (key: Input) => Hash): { - (msg: Input, key: Input): Uint8Array; - outputLen: number; - blockLen: number; - create(key: Input): Hash; -}; -/** Poly1305 MAC from RFC 8439. */ -export declare const poly1305: CHash; -//# sourceMappingURL=_poly1305.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_poly1305.d.ts.map b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_poly1305.d.ts.map deleted file mode 100644 index b7070c26..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_poly1305.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_poly1305.d.ts","sourceRoot":"","sources":["../src/_poly1305.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,IAAI,EAAE,KAAK,KAAK,EAA4C,MAAM,YAAY,CAAC;AA4QxF,MAAM,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAC9D,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,CAAC,EACtD,QAAQ,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,GAChC;IACD,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,GAAG,UAAU,CAAC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;CAC7B,CAOA;AAED,kCAAkC;AAClC,eAAO,MAAM,QAAQ,EAAE,KAA0D,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_poly1305.js b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_poly1305.js deleted file mode 100644 index 4762c5fe..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_poly1305.js +++ /dev/null @@ -1,277 +0,0 @@ -/** - * Poly1305 ([PDF](https://cr.yp.to/mac/poly1305-20050329.pdf), - * [wiki](https://en.wikipedia.org/wiki/Poly1305)) - * is a fast and parallel secret-key message-authentication code suitable for - * a wide variety of applications. It was standardized in - * [RFC 8439](https://datatracker.ietf.org/doc/html/rfc8439) and is now used in TLS 1.3. - * - * Polynomial MACs are not perfect for every situation: - * they lack Random Key Robustness: the MAC can be forged, and can't be used in PAKE schemes. - * See [invisible salamanders attack](https://keymaterial.net/2020/09/07/invisible-salamanders-in-aes-gcm-siv/). - * To combat invisible salamanders, `hash(key)` can be included in ciphertext, - * however, this would violate ciphertext indistinguishability: - * an attacker would know which key was used - so `HKDF(key, i)` - * could be used instead. - * - * Check out [original website](https://cr.yp.to/mac.html). - * @module - */ -import { Hash, abytes, aexists, aoutput, clean, toBytes } from "./utils.js"; -// Based on Public Domain poly1305-donna https://github.com/floodyberry/poly1305-donna -const u8to16 = (a, i) => (a[i++] & 0xff) | ((a[i++] & 0xff) << 8); -class Poly1305 { - constructor(key) { - this.blockLen = 16; - this.outputLen = 16; - this.buffer = new Uint8Array(16); - this.r = new Uint16Array(10); - this.h = new Uint16Array(10); - this.pad = new Uint16Array(8); - this.pos = 0; - this.finished = false; - key = toBytes(key); - abytes(key, 32); - const t0 = u8to16(key, 0); - const t1 = u8to16(key, 2); - const t2 = u8to16(key, 4); - const t3 = u8to16(key, 6); - const t4 = u8to16(key, 8); - const t5 = u8to16(key, 10); - const t6 = u8to16(key, 12); - const t7 = u8to16(key, 14); - // https://github.com/floodyberry/poly1305-donna/blob/e6ad6e091d30d7f4ec2d4f978be1fcfcbce72781/poly1305-donna-16.h#L47 - this.r[0] = t0 & 0x1fff; - this.r[1] = ((t0 >>> 13) | (t1 << 3)) & 0x1fff; - this.r[2] = ((t1 >>> 10) | (t2 << 6)) & 0x1f03; - this.r[3] = ((t2 >>> 7) | (t3 << 9)) & 0x1fff; - this.r[4] = ((t3 >>> 4) | (t4 << 12)) & 0x00ff; - this.r[5] = (t4 >>> 1) & 0x1ffe; - this.r[6] = ((t4 >>> 14) | (t5 << 2)) & 0x1fff; - this.r[7] = ((t5 >>> 11) | (t6 << 5)) & 0x1f81; - this.r[8] = ((t6 >>> 8) | (t7 << 8)) & 0x1fff; - this.r[9] = (t7 >>> 5) & 0x007f; - for (let i = 0; i < 8; i++) - this.pad[i] = u8to16(key, 16 + 2 * i); - } - process(data, offset, isLast = false) { - const hibit = isLast ? 0 : 1 << 11; - const { h, r } = this; - const r0 = r[0]; - const r1 = r[1]; - const r2 = r[2]; - const r3 = r[3]; - const r4 = r[4]; - const r5 = r[5]; - const r6 = r[6]; - const r7 = r[7]; - const r8 = r[8]; - const r9 = r[9]; - const t0 = u8to16(data, offset + 0); - const t1 = u8to16(data, offset + 2); - const t2 = u8to16(data, offset + 4); - const t3 = u8to16(data, offset + 6); - const t4 = u8to16(data, offset + 8); - const t5 = u8to16(data, offset + 10); - const t6 = u8to16(data, offset + 12); - const t7 = u8to16(data, offset + 14); - let h0 = h[0] + (t0 & 0x1fff); - let h1 = h[1] + (((t0 >>> 13) | (t1 << 3)) & 0x1fff); - let h2 = h[2] + (((t1 >>> 10) | (t2 << 6)) & 0x1fff); - let h3 = h[3] + (((t2 >>> 7) | (t3 << 9)) & 0x1fff); - let h4 = h[4] + (((t3 >>> 4) | (t4 << 12)) & 0x1fff); - let h5 = h[5] + ((t4 >>> 1) & 0x1fff); - let h6 = h[6] + (((t4 >>> 14) | (t5 << 2)) & 0x1fff); - let h7 = h[7] + (((t5 >>> 11) | (t6 << 5)) & 0x1fff); - let h8 = h[8] + (((t6 >>> 8) | (t7 << 8)) & 0x1fff); - let h9 = h[9] + ((t7 >>> 5) | hibit); - let c = 0; - let d0 = c + h0 * r0 + h1 * (5 * r9) + h2 * (5 * r8) + h3 * (5 * r7) + h4 * (5 * r6); - c = d0 >>> 13; - d0 &= 0x1fff; - d0 += h5 * (5 * r5) + h6 * (5 * r4) + h7 * (5 * r3) + h8 * (5 * r2) + h9 * (5 * r1); - c += d0 >>> 13; - d0 &= 0x1fff; - let d1 = c + h0 * r1 + h1 * r0 + h2 * (5 * r9) + h3 * (5 * r8) + h4 * (5 * r7); - c = d1 >>> 13; - d1 &= 0x1fff; - d1 += h5 * (5 * r6) + h6 * (5 * r5) + h7 * (5 * r4) + h8 * (5 * r3) + h9 * (5 * r2); - c += d1 >>> 13; - d1 &= 0x1fff; - let d2 = c + h0 * r2 + h1 * r1 + h2 * r0 + h3 * (5 * r9) + h4 * (5 * r8); - c = d2 >>> 13; - d2 &= 0x1fff; - d2 += h5 * (5 * r7) + h6 * (5 * r6) + h7 * (5 * r5) + h8 * (5 * r4) + h9 * (5 * r3); - c += d2 >>> 13; - d2 &= 0x1fff; - let d3 = c + h0 * r3 + h1 * r2 + h2 * r1 + h3 * r0 + h4 * (5 * r9); - c = d3 >>> 13; - d3 &= 0x1fff; - d3 += h5 * (5 * r8) + h6 * (5 * r7) + h7 * (5 * r6) + h8 * (5 * r5) + h9 * (5 * r4); - c += d3 >>> 13; - d3 &= 0x1fff; - let d4 = c + h0 * r4 + h1 * r3 + h2 * r2 + h3 * r1 + h4 * r0; - c = d4 >>> 13; - d4 &= 0x1fff; - d4 += h5 * (5 * r9) + h6 * (5 * r8) + h7 * (5 * r7) + h8 * (5 * r6) + h9 * (5 * r5); - c += d4 >>> 13; - d4 &= 0x1fff; - let d5 = c + h0 * r5 + h1 * r4 + h2 * r3 + h3 * r2 + h4 * r1; - c = d5 >>> 13; - d5 &= 0x1fff; - d5 += h5 * r0 + h6 * (5 * r9) + h7 * (5 * r8) + h8 * (5 * r7) + h9 * (5 * r6); - c += d5 >>> 13; - d5 &= 0x1fff; - let d6 = c + h0 * r6 + h1 * r5 + h2 * r4 + h3 * r3 + h4 * r2; - c = d6 >>> 13; - d6 &= 0x1fff; - d6 += h5 * r1 + h6 * r0 + h7 * (5 * r9) + h8 * (5 * r8) + h9 * (5 * r7); - c += d6 >>> 13; - d6 &= 0x1fff; - let d7 = c + h0 * r7 + h1 * r6 + h2 * r5 + h3 * r4 + h4 * r3; - c = d7 >>> 13; - d7 &= 0x1fff; - d7 += h5 * r2 + h6 * r1 + h7 * r0 + h8 * (5 * r9) + h9 * (5 * r8); - c += d7 >>> 13; - d7 &= 0x1fff; - let d8 = c + h0 * r8 + h1 * r7 + h2 * r6 + h3 * r5 + h4 * r4; - c = d8 >>> 13; - d8 &= 0x1fff; - d8 += h5 * r3 + h6 * r2 + h7 * r1 + h8 * r0 + h9 * (5 * r9); - c += d8 >>> 13; - d8 &= 0x1fff; - let d9 = c + h0 * r9 + h1 * r8 + h2 * r7 + h3 * r6 + h4 * r5; - c = d9 >>> 13; - d9 &= 0x1fff; - d9 += h5 * r4 + h6 * r3 + h7 * r2 + h8 * r1 + h9 * r0; - c += d9 >>> 13; - d9 &= 0x1fff; - c = ((c << 2) + c) | 0; - c = (c + d0) | 0; - d0 = c & 0x1fff; - c = c >>> 13; - d1 += c; - h[0] = d0; - h[1] = d1; - h[2] = d2; - h[3] = d3; - h[4] = d4; - h[5] = d5; - h[6] = d6; - h[7] = d7; - h[8] = d8; - h[9] = d9; - } - finalize() { - const { h, pad } = this; - const g = new Uint16Array(10); - let c = h[1] >>> 13; - h[1] &= 0x1fff; - for (let i = 2; i < 10; i++) { - h[i] += c; - c = h[i] >>> 13; - h[i] &= 0x1fff; - } - h[0] += c * 5; - c = h[0] >>> 13; - h[0] &= 0x1fff; - h[1] += c; - c = h[1] >>> 13; - h[1] &= 0x1fff; - h[2] += c; - g[0] = h[0] + 5; - c = g[0] >>> 13; - g[0] &= 0x1fff; - for (let i = 1; i < 10; i++) { - g[i] = h[i] + c; - c = g[i] >>> 13; - g[i] &= 0x1fff; - } - g[9] -= 1 << 13; - let mask = (c ^ 1) - 1; - for (let i = 0; i < 10; i++) - g[i] &= mask; - mask = ~mask; - for (let i = 0; i < 10; i++) - h[i] = (h[i] & mask) | g[i]; - h[0] = (h[0] | (h[1] << 13)) & 0xffff; - h[1] = ((h[1] >>> 3) | (h[2] << 10)) & 0xffff; - h[2] = ((h[2] >>> 6) | (h[3] << 7)) & 0xffff; - h[3] = ((h[3] >>> 9) | (h[4] << 4)) & 0xffff; - h[4] = ((h[4] >>> 12) | (h[5] << 1) | (h[6] << 14)) & 0xffff; - h[5] = ((h[6] >>> 2) | (h[7] << 11)) & 0xffff; - h[6] = ((h[7] >>> 5) | (h[8] << 8)) & 0xffff; - h[7] = ((h[8] >>> 8) | (h[9] << 5)) & 0xffff; - let f = h[0] + pad[0]; - h[0] = f & 0xffff; - for (let i = 1; i < 8; i++) { - f = (((h[i] + pad[i]) | 0) + (f >>> 16)) | 0; - h[i] = f & 0xffff; - } - clean(g); - } - update(data) { - aexists(this); - data = toBytes(data); - abytes(data); - const { buffer, blockLen } = this; - const len = data.length; - for (let pos = 0; pos < len;) { - const take = Math.min(blockLen - this.pos, len - pos); - // Fast path: we have at least one block in input - if (take === blockLen) { - for (; blockLen <= len - pos; pos += blockLen) - this.process(data, pos); - continue; - } - buffer.set(data.subarray(pos, pos + take), this.pos); - this.pos += take; - pos += take; - if (this.pos === blockLen) { - this.process(buffer, 0, false); - this.pos = 0; - } - } - return this; - } - destroy() { - clean(this.h, this.r, this.buffer, this.pad); - } - digestInto(out) { - aexists(this); - aoutput(out, this); - this.finished = true; - const { buffer, h } = this; - let { pos } = this; - if (pos) { - buffer[pos++] = 1; - for (; pos < 16; pos++) - buffer[pos] = 0; - this.process(buffer, 0, true); - } - this.finalize(); - let opos = 0; - for (let i = 0; i < 8; i++) { - out[opos++] = h[i] >>> 0; - out[opos++] = h[i] >>> 8; - } - return out; - } - digest() { - const { buffer, outputLen } = this; - this.digestInto(buffer); - const res = buffer.slice(0, outputLen); - this.destroy(); - return res; - } -} -export function wrapConstructorWithKey(hashCons) { - const hashC = (msg, key) => hashCons(key).update(toBytes(msg)).digest(); - const tmp = hashCons(new Uint8Array(32)); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = (key) => hashCons(key); - return hashC; -} -/** Poly1305 MAC from RFC 8439. */ -export const poly1305 = wrapConstructorWithKey((key) => new Poly1305(key)); -//# sourceMappingURL=_poly1305.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_poly1305.js.map b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_poly1305.js.map deleted file mode 100644 index acb72c17..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_poly1305.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_poly1305.js","sourceRoot":"","sources":["../src/_poly1305.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,IAAI,EAAc,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAExF,sFAAsF;AACtF,MAAM,MAAM,GAAG,CAAC,CAAa,EAAE,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AACtF,MAAM,QAAQ;IAUZ,YAAY,GAAU;QATb,aAAQ,GAAG,EAAE,CAAC;QACd,cAAS,GAAG,EAAE,CAAC;QAChB,WAAM,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;QAC5B,MAAC,GAAG,IAAI,WAAW,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C3B,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;IACD,MAAM;QACJ,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;QACnC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACxB,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;QACvC,IAAI,CAAC,OAAO,EAAE,CAAC;QACf,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AAGD,MAAM,UAAU,sBAAsB,CACpC,QAAiC;IAOjC,MAAM,KAAK,GAAG,CAAC,GAAU,EAAE,GAAU,EAAc,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAClG,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC;IACzC,KAAK,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC;IAChC,KAAK,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;IAC9B,KAAK,CAAC,MAAM,GAAG,CAAC,GAAU,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC7C,OAAO,KAAK,CAAC;AACf,CAAC;AAED,kCAAkC;AAClC,MAAM,CAAC,MAAM,QAAQ,GAAU,sBAAsB,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_polyval.d.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_polyval.d.ts deleted file mode 100644 index df7d9de7..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_polyval.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * GHash from AES-GCM and its little-endian "mirror image" Polyval from AES-SIV. - * - * Implemented in terms of GHash with conversion function for keys - * GCM GHASH from - * [NIST SP800-38d](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf), - * SIV from - * [RFC 8452](https://datatracker.ietf.org/doc/html/rfc8452). - * - * GHASH modulo: x^128 + x^7 + x^2 + x + 1 - * POLYVAL modulo: x^128 + x^127 + x^126 + x^121 + 1 - * - * @module - */ -import { Hash, type Input } from './utils.ts'; -/** - * `mulX_POLYVAL(ByteReverse(H))` from spec - * @param k mutated in place - */ -export declare function _toGHASHKey(k: Uint8Array): Uint8Array; -export type CHashPV = ReturnType; -declare function wrapConstructorWithKey>(hashCons: (key: Input, expectedLength?: number) => Hash): { - (msg: Input, key: Input): Uint8Array; - outputLen: number; - blockLen: number; - create(key: Input, expectedLength?: number): Hash; -}; -/** GHash MAC for AES-GCM. */ -export declare const ghash: CHashPV; -/** Polyval MAC for AES-SIV. */ -export declare const polyval: CHashPV; -export {}; -//# sourceMappingURL=_polyval.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_polyval.d.ts.map b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_polyval.d.ts.map deleted file mode 100644 index 2a538586..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_polyval.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_polyval.d.ts","sourceRoot":"","sources":["../src/_polyval.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAEyB,IAAI,EAAE,KAAK,KAAK,EAC/C,MAAM,YAAY,CAAC;AA6BpB;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,UAAU,GAAG,UAAU,CAYrD;AAiLD,MAAM,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAChE,iBAAS,sBAAsB,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,CAAC,EAC/C,QAAQ,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,cAAc,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,GACzD;IACD,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,GAAG,UAAU,CAAC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;CACtD,CAQA;AAED,6BAA6B;AAC7B,eAAO,MAAM,KAAK,EAAE,OAEnB,CAAC;AAEF,+BAA+B;AAC/B,eAAO,MAAM,OAAO,EAAE,OAErB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_polyval.js b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_polyval.js deleted file mode 100644 index 9bb2aecb..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_polyval.js +++ /dev/null @@ -1,229 +0,0 @@ -/** - * GHash from AES-GCM and its little-endian "mirror image" Polyval from AES-SIV. - * - * Implemented in terms of GHash with conversion function for keys - * GCM GHASH from - * [NIST SP800-38d](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf), - * SIV from - * [RFC 8452](https://datatracker.ietf.org/doc/html/rfc8452). - * - * GHASH modulo: x^128 + x^7 + x^2 + x + 1 - * POLYVAL modulo: x^128 + x^127 + x^126 + x^121 + 1 - * - * @module - */ -// prettier-ignore -import { abytes, aexists, aoutput, clean, copyBytes, createView, Hash, toBytes, u32, } from "./utils.js"; -const BLOCK_SIZE = 16; -// TODO: rewrite -// temporary padding buffer -const ZEROS16 = /* @__PURE__ */ new Uint8Array(16); -const ZEROS32 = u32(ZEROS16); -const POLY = 0xe1; // v = 2*v % POLY -// v = 2*v % POLY -// NOTE: because x + x = 0 (add/sub is same), mul2(x) != x+x -// We can multiply any number using montgomery ladder and this function (works as double, add is simple xor) -const mul2 = (s0, s1, s2, s3) => { - const hiBit = s3 & 1; - return { - s3: (s2 << 31) | (s3 >>> 1), - s2: (s1 << 31) | (s2 >>> 1), - s1: (s0 << 31) | (s1 >>> 1), - s0: (s0 >>> 1) ^ ((POLY << 24) & -(hiBit & 1)), // reduce % poly - }; -}; -const swapLE = (n) => (((n >>> 0) & 0xff) << 24) | - (((n >>> 8) & 0xff) << 16) | - (((n >>> 16) & 0xff) << 8) | - ((n >>> 24) & 0xff) | - 0; -/** - * `mulX_POLYVAL(ByteReverse(H))` from spec - * @param k mutated in place - */ -export function _toGHASHKey(k) { - k.reverse(); - const hiBit = k[15] & 1; - // k >>= 1 - let carry = 0; - for (let i = 0; i < k.length; i++) { - const t = k[i]; - k[i] = (t >>> 1) | carry; - carry = (t & 1) << 7; - } - k[0] ^= -hiBit & 0xe1; // if (hiBit) n ^= 0xe1000000000000000000000000000000; - return k; -} -const estimateWindow = (bytes) => { - if (bytes > 64 * 1024) - return 8; - if (bytes > 1024) - return 4; - return 2; -}; -class GHASH { - // We select bits per window adaptively based on expectedLength - constructor(key, expectedLength) { - this.blockLen = BLOCK_SIZE; - this.outputLen = BLOCK_SIZE; - this.s0 = 0; - this.s1 = 0; - this.s2 = 0; - this.s3 = 0; - this.finished = false; - key = toBytes(key); - abytes(key, 16); - const kView = createView(key); - let k0 = kView.getUint32(0, false); - let k1 = kView.getUint32(4, false); - let k2 = kView.getUint32(8, false); - let k3 = kView.getUint32(12, false); - // generate table of doubled keys (half of montgomery ladder) - const doubles = []; - for (let i = 0; i < 128; i++) { - doubles.push({ s0: swapLE(k0), s1: swapLE(k1), s2: swapLE(k2), s3: swapLE(k3) }); - ({ s0: k0, s1: k1, s2: k2, s3: k3 } = mul2(k0, k1, k2, k3)); - } - const W = estimateWindow(expectedLength || 1024); - if (![1, 2, 4, 8].includes(W)) - throw new Error('ghash: invalid window size, expected 2, 4 or 8'); - this.W = W; - const bits = 128; // always 128 bits; - const windows = bits / W; - const windowSize = (this.windowSize = 2 ** W); - const items = []; - // Create precompute table for window of W bits - for (let w = 0; w < windows; w++) { - // truth table: 00, 01, 10, 11 - for (let byte = 0; byte < windowSize; byte++) { - // prettier-ignore - let s0 = 0, s1 = 0, s2 = 0, s3 = 0; - for (let j = 0; j < W; j++) { - const bit = (byte >>> (W - j - 1)) & 1; - if (!bit) - continue; - const { s0: d0, s1: d1, s2: d2, s3: d3 } = doubles[W * w + j]; - (s0 ^= d0), (s1 ^= d1), (s2 ^= d2), (s3 ^= d3); - } - items.push({ s0, s1, s2, s3 }); - } - } - this.t = items; - } - _updateBlock(s0, s1, s2, s3) { - (s0 ^= this.s0), (s1 ^= this.s1), (s2 ^= this.s2), (s3 ^= this.s3); - const { W, t, windowSize } = this; - // prettier-ignore - let o0 = 0, o1 = 0, o2 = 0, o3 = 0; - const mask = (1 << W) - 1; // 2**W will kill performance. - let w = 0; - for (const num of [s0, s1, s2, s3]) { - for (let bytePos = 0; bytePos < 4; bytePos++) { - const byte = (num >>> (8 * bytePos)) & 0xff; - for (let bitPos = 8 / W - 1; bitPos >= 0; bitPos--) { - const bit = (byte >>> (W * bitPos)) & mask; - const { s0: e0, s1: e1, s2: e2, s3: e3 } = t[w * windowSize + bit]; - (o0 ^= e0), (o1 ^= e1), (o2 ^= e2), (o3 ^= e3); - w += 1; - } - } - } - this.s0 = o0; - this.s1 = o1; - this.s2 = o2; - this.s3 = o3; - } - update(data) { - aexists(this); - data = toBytes(data); - abytes(data); - const b32 = u32(data); - const blocks = Math.floor(data.length / BLOCK_SIZE); - const left = data.length % BLOCK_SIZE; - for (let i = 0; i < blocks; i++) { - this._updateBlock(b32[i * 4 + 0], b32[i * 4 + 1], b32[i * 4 + 2], b32[i * 4 + 3]); - } - if (left) { - ZEROS16.set(data.subarray(blocks * BLOCK_SIZE)); - this._updateBlock(ZEROS32[0], ZEROS32[1], ZEROS32[2], ZEROS32[3]); - clean(ZEROS32); // clean tmp buffer - } - return this; - } - destroy() { - const { t } = this; - // clean precompute table - for (const elm of t) { - (elm.s0 = 0), (elm.s1 = 0), (elm.s2 = 0), (elm.s3 = 0); - } - } - digestInto(out) { - aexists(this); - aoutput(out, this); - this.finished = true; - const { s0, s1, s2, s3 } = this; - const o32 = u32(out); - o32[0] = s0; - o32[1] = s1; - o32[2] = s2; - o32[3] = s3; - return out; - } - digest() { - const res = new Uint8Array(BLOCK_SIZE); - this.digestInto(res); - this.destroy(); - return res; - } -} -class Polyval extends GHASH { - constructor(key, expectedLength) { - key = toBytes(key); - abytes(key); - const ghKey = _toGHASHKey(copyBytes(key)); - super(ghKey, expectedLength); - clean(ghKey); - } - update(data) { - data = toBytes(data); - aexists(this); - const b32 = u32(data); - const left = data.length % BLOCK_SIZE; - const blocks = Math.floor(data.length / BLOCK_SIZE); - for (let i = 0; i < blocks; i++) { - this._updateBlock(swapLE(b32[i * 4 + 3]), swapLE(b32[i * 4 + 2]), swapLE(b32[i * 4 + 1]), swapLE(b32[i * 4 + 0])); - } - if (left) { - ZEROS16.set(data.subarray(blocks * BLOCK_SIZE)); - this._updateBlock(swapLE(ZEROS32[3]), swapLE(ZEROS32[2]), swapLE(ZEROS32[1]), swapLE(ZEROS32[0])); - clean(ZEROS32); - } - return this; - } - digestInto(out) { - aexists(this); - aoutput(out, this); - this.finished = true; - // tmp ugly hack - const { s0, s1, s2, s3 } = this; - const o32 = u32(out); - o32[0] = s0; - o32[1] = s1; - o32[2] = s2; - o32[3] = s3; - return out.reverse(); - } -} -function wrapConstructorWithKey(hashCons) { - const hashC = (msg, key) => hashCons(key, msg.length).update(toBytes(msg)).digest(); - const tmp = hashCons(new Uint8Array(16), 0); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = (key, expectedLength) => hashCons(key, expectedLength); - return hashC; -} -/** GHash MAC for AES-GCM. */ -export const ghash = wrapConstructorWithKey((key, expectedLength) => new GHASH(key, expectedLength)); -/** Polyval MAC for AES-SIV. */ -export const polyval = wrapConstructorWithKey((key, expectedLength) => new Polyval(key, expectedLength)); -//# sourceMappingURL=_polyval.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_polyval.js.map b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_polyval.js.map deleted file mode 100644 index 35ad2ee6..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/_polyval.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_polyval.js","sourceRoot":"","sources":["../src/_polyval.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,kBAAkB;AAClB,OAAO,EACL,MAAM,EAAE,OAAO,EAAE,OAAO,EACxB,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAc,OAAO,EAAE,GAAG,GAC7D,MAAM,YAAY,CAAC;AAEpB,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,gBAAgB;AAChB,2BAA2B;AAC3B,MAAM,OAAO,GAAG,eAAe,CAAC,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;AACnD,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC;AAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,iBAAiB;AAEpC,iBAAiB;AACjB,4DAA4D;AAC5D,4GAA4G;AAC5G,MAAM,IAAI,GAAG,CAAC,EAAU,EAAE,EAAU,EAAE,EAAU,EAAE,EAAU,EAAE,EAAE;IAC9D,MAAM,KAAK,GAAG,EAAE,GAAG,CAAC,CAAC;IACrB,OAAO;QACL,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;QAC3B,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;QAC3B,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;QAC3B,EAAE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ts deleted file mode 100644 index 010a88a6..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/aes.d.ts +++ /dev/null @@ -1,117 +0,0 @@ -import { type Cipher, type CipherWithOutput } from './utils.ts'; -/** Key expansion used in CTR. */ -declare function expandKeyLE(key: Uint8Array): Uint32Array; -declare function expandKeyDecLE(key: Uint8Array): Uint32Array; -declare function encrypt(xk: Uint32Array, s0: number, s1: number, s2: number, s3: number): { - s0: number; - s1: number; - s2: number; - s3: number; -}; -declare function decrypt(xk: Uint32Array, s0: number, s1: number, s2: number, s3: number): { - s0: number; - s1: number; - s2: number; - s3: number; -}; -declare function ctrCounter(xk: Uint32Array, nonce: Uint8Array, src: Uint8Array, dst?: Uint8Array): Uint8Array; -declare function ctr32(xk: Uint32Array, isLE: boolean, nonce: Uint8Array, src: Uint8Array, dst?: Uint8Array): Uint8Array; -/** - * CTR: counter mode. Creates stream cipher. - * Requires good IV. Parallelizable. OK, but no MAC. - */ -export declare const ctr: ((key: Uint8Array, nonce: Uint8Array) => CipherWithOutput) & { - blockSize: number; - nonceLength: number; -}; -/** Options for ECB and CBC. */ -export type BlockOpts = { - disablePadding?: boolean; -}; -/** - * ECB: Electronic CodeBook. Simple deterministic replacement. - * Dangerous: always map x to y. See [AES Penguin](https://words.filippo.io/the-ecb-penguin/). - */ -export declare const ecb: ((key: Uint8Array, opts?: BlockOpts) => CipherWithOutput) & { - blockSize: number; -}; -/** - * CBC: Cipher-Block-Chaining. Key is previous round’s block. - * Fragile: needs proper padding. Unauthenticated: needs MAC. - */ -export declare const cbc: ((key: Uint8Array, iv: Uint8Array, opts?: BlockOpts) => CipherWithOutput) & { - blockSize: number; - nonceLength: number; -}; -/** - * CFB: Cipher Feedback Mode. The input for the block cipher is the previous cipher output. - * Unauthenticated: needs MAC. - */ -export declare const cfb: ((key: Uint8Array, iv: Uint8Array) => CipherWithOutput) & { - blockSize: number; - nonceLength: number; -}; -/** - * GCM: Galois/Counter Mode. - * Modern, parallel version of CTR, with MAC. - * Be careful: MACs can be forged. - * Unsafe to use random nonces under the same key, due to collision chance. - * As for nonce size, prefer 12-byte, instead of 8-byte. - */ -export declare const gcm: ((key: Uint8Array, nonce: Uint8Array, AAD?: Uint8Array) => Cipher) & { - blockSize: number; - nonceLength: number; - tagLength: number; - varSizeNonce: true; -}; -/** - * AES-GCM-SIV: classic AES-GCM with nonce-misuse resistance. - * Guarantees that, when a nonce is repeated, the only security loss is that identical - * plaintexts will produce identical ciphertexts. - * RFC 8452, https://datatracker.ietf.org/doc/html/rfc8452 - */ -export declare const gcmsiv: ((key: Uint8Array, nonce: Uint8Array, AAD?: Uint8Array) => Cipher) & { - blockSize: number; - nonceLength: number; - tagLength: number; - varSizeNonce: true; -}; -/** - * AES-GCM-SIV, not AES-SIV. - * This is legace name, use `gcmsiv` export instead. - * @deprecated - */ -export declare const siv: typeof gcmsiv; -declare function encryptBlock(xk: Uint32Array, block: Uint8Array): Uint8Array; -declare function decryptBlock(xk: Uint32Array, block: Uint8Array): Uint8Array; -/** - * AES-KW (key-wrap). Injects static IV into plaintext, adds counter, encrypts 6 times. - * Reduces block size from 16 to 8 bytes. - * For padded version, use aeskwp. - * [RFC 3394](https://datatracker.ietf.org/doc/rfc3394/), - * [NIST.SP.800-38F](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-38F.pdf). - */ -export declare const aeskw: ((kek: Uint8Array) => Cipher) & { - blockSize: number; -}; -/** - * AES-KW, but with padding and allows random keys. - * Second u32 of IV is used as counter for length. - * [RFC 5649](https://www.rfc-editor.org/rfc/rfc5649) - */ -export declare const aeskwp: ((kek: Uint8Array) => Cipher) & { - blockSize: number; -}; -/** Unsafe low-level internal methods. May change at any time. */ -export declare const unsafe: { - expandKeyLE: typeof expandKeyLE; - expandKeyDecLE: typeof expandKeyDecLE; - encrypt: typeof encrypt; - decrypt: typeof decrypt; - encryptBlock: typeof encryptBlock; - decryptBlock: typeof decryptBlock; - ctrCounter: typeof ctrCounter; - ctr32: typeof ctr32; -}; -export {}; -//# sourceMappingURL=aes.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/aes.d.ts.map b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/aes.d.ts.map deleted file mode 100644 index 1d9898d6..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/aes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"aes.d.ts","sourceRoot":"","sources":["../src/aes.ts"],"names":[],"mappings":"AAkBA,OAAO,EAIL,KAAK,MAAM,EAAE,KAAK,gBAAgB,EACnC,MAAM,YAAY,CAAC;AA0FpB,iCAAiC;AACjC,iBAAS,WAAW,CAAC,GAAG,EAAE,UAAU,GAAG,WAAW,CAsBjD;AAED,iBAAS,cAAc,CAAC,GAAG,EAAE,UAAU,GAAG,WAAW,CAkBpD;AAwBD,iBAAS,OAAO,CACd,EAAE,EAAE,WAAW,EACf,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,GACT;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAkBpD;AAGD,iBAAS,OAAO,CACd,EAAE,EAAE,WAAW,EACf,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,GACT;IACD,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAkBA;AAGD,iBAAS,UAAU,CACjB,EAAE,EAAE,WAAW,EACf,KAAK,EAAE,UAAU,EACjB,GAAG,EAAE,UAAU,EACf,GAAG,CAAC,EAAE,UAAU,GACf,UAAU,CAqCZ;AAKD,iBAAS,K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E,OAAO,KAAK,CAAC;CAUrB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/aes.js b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/aes.js deleted file mode 100644 index 6bcc1810..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/aes.js +++ /dev/null @@ -1,903 +0,0 @@ -/** - * [AES](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard) - * a.k.a. Advanced Encryption Standard - * is a variant of Rijndael block cipher, standardized by NIST in 2001. - * We provide the fastest available pure JS implementation. - * - * Data is split into 128-bit blocks. Encrypted in 10/12/14 rounds (128/192/256 bits). In every round: - * 1. **S-box**, table substitution - * 2. **Shift rows**, cyclic shift left of all rows of data array - * 3. **Mix columns**, multiplying every column by fixed polynomial - * 4. **Add round key**, round_key xor i-th column of array - * - * Check out [FIPS-197](https://csrc.nist.gov/files/pubs/fips/197/final/docs/fips-197.pdf) - * and [original proposal](https://csrc.nist.gov/csrc/media/projects/cryptographic-standards-and-guidelines/documents/aes-development/rijndael-ammended.pdf) - * @module - */ -import { ghash, polyval } from "./_polyval.js"; -// prettier-ignore -import { abytes, clean, complexOverlapBytes, concatBytes, copyBytes, createView, equalBytes, getOutput, isAligned32, overlapBytes, setBigUint64, u32, u64Lengths, u8, wrapCipher, } from "./utils.js"; -const BLOCK_SIZE = 16; -const BLOCK_SIZE32 = 4; -const EMPTY_BLOCK = /* @__PURE__ */ new Uint8Array(BLOCK_SIZE); -const POLY = 0x11b; // 1 + x + x**3 + x**4 + x**8 -// TODO: remove multiplication, binary ops only -function mul2(n) { - return (n << 1) ^ (POLY & -(n >> 7)); -} -function mul(a, b) { - let res = 0; - for (; b > 0; b >>= 1) { - // Montgomery ladder - res ^= a & -(b & 1); // if (b&1) res ^=a (but const-time). - a = mul2(a); // a = 2*a - } - return res; -} -// AES S-box is generated using finite field inversion, -// an affine transform, and xor of a constant 0x63. -const sbox = /* @__PURE__ */ (() => { - const t = new Uint8Array(256); - for (let i = 0, x = 1; i < 256; i++, x ^= mul2(x)) - t[i] = x; - const box = new Uint8Array(256); - box[0] = 0x63; // first elm - for (let i = 0; i < 255; i++) { - let x = t[255 - i]; - x |= x << 8; - box[t[i]] = (x ^ (x >> 4) ^ (x >> 5) ^ (x >> 6) ^ (x >> 7) ^ 0x63) & 0xff; - } - clean(t); - return box; -})(); -// Inverted S-box -const invSbox = /* @__PURE__ */ sbox.map((_, j) => sbox.indexOf(j)); -// Rotate u32 by 8 -const rotr32_8 = (n) => (n << 24) | (n >>> 8); -const rotl32_8 = (n) => (n << 8) | (n >>> 24); -// The byte swap operation for uint32 (LE<->BE) -const byteSwap = (word) => ((word << 24) & 0xff000000) | - ((word << 8) & 0xff0000) | - ((word >>> 8) & 0xff00) | - ((word >>> 24) & 0xff); -// T-table is optimization suggested in 5.2 of original proposal (missed from FIPS-197). Changes: -// - LE instead of BE -// - bigger tables: T0 and T1 are merged into T01 table and T2 & T3 into T23; -// so index is u16, instead of u8. This speeds up things, unexpectedly -function genTtable(sbox, fn) { - if (sbox.length !== 256) - throw new Error('Wrong sbox length'); - const T0 = new Uint32Array(256).map((_, j) => fn(sbox[j])); - const T1 = T0.map(rotl32_8); - const T2 = T1.map(rotl32_8); - const T3 = T2.map(rotl32_8); - const T01 = new Uint32Array(256 * 256); - const T23 = new Uint32Array(256 * 256); - const sbox2 = new Uint16Array(256 * 256); - for (let i = 0; i < 256; i++) { - for (let j = 0; j < 256; j++) { - const idx = i * 256 + j; - T01[idx] = T0[i] ^ T1[j]; - T23[idx] = T2[i] ^ T3[j]; - sbox2[idx] = (sbox[i] << 8) | sbox[j]; - } - } - return { sbox, sbox2, T0, T1, T2, T3, T01, T23 }; -} -const tableEncoding = /* @__PURE__ */ genTtable(sbox, (s) => (mul(s, 3) << 24) | (s << 16) | (s << 8) | mul(s, 2)); -const tableDecoding = /* @__PURE__ */ genTtable(invSbox, (s) => (mul(s, 11) << 24) | (mul(s, 13) << 16) | (mul(s, 9) << 8) | mul(s, 14)); -const xPowers = /* @__PURE__ */ (() => { - const p = new Uint8Array(16); - for (let i = 0, x = 1; i < 16; i++, x = mul2(x)) - p[i] = x; - return p; -})(); -/** Key expansion used in CTR. */ -function expandKeyLE(key) { - abytes(key); - const len = key.length; - if (![16, 24, 32].includes(len)) - throw new Error('aes: invalid key size, should be 16, 24 or 32, got ' + len); - const { sbox2 } = tableEncoding; - const toClean = []; - if (!isAligned32(key)) - toClean.push((key = copyBytes(key))); - const k32 = u32(key); - const Nk = k32.length; - const subByte = (n) => applySbox(sbox2, n, n, n, n); - const xk = new Uint32Array(len + 28); // expanded key - xk.set(k32); - // 4.3.1 Key expansion - for (let i = Nk; i < xk.length; i++) { - let t = xk[i - 1]; - if (i % Nk === 0) - t = subByte(rotr32_8(t)) ^ xPowers[i / Nk - 1]; - else if (Nk > 6 && i % Nk === 4) - t = subByte(t); - xk[i] = xk[i - Nk] ^ t; - } - clean(...toClean); - return xk; -} -function expandKeyDecLE(key) { - const encKey = expandKeyLE(key); - const xk = encKey.slice(); - const Nk = encKey.length; - const { sbox2 } = tableEncoding; - const { T0, T1, T2, T3 } = tableDecoding; - // Inverse key by chunks of 4 (rounds) - for (let i = 0; i < Nk; i += 4) { - for (let j = 0; j < 4; j++) - xk[i + j] = encKey[Nk - i - 4 + j]; - } - clean(encKey); - // apply InvMixColumn except first & last round - for (let i = 4; i < Nk - 4; i++) { - const x = xk[i]; - const w = applySbox(sbox2, x, x, x, x); - xk[i] = T0[w & 0xff] ^ T1[(w >>> 8) & 0xff] ^ T2[(w >>> 16) & 0xff] ^ T3[w >>> 24]; - } - return xk; -} -// Apply tables -function apply0123(T01, T23, s0, s1, s2, s3) { - return (T01[((s0 << 8) & 0xff00) | ((s1 >>> 8) & 0xff)] ^ - T23[((s2 >>> 8) & 0xff00) | ((s3 >>> 24) & 0xff)]); -} -function applySbox(sbox2, s0, s1, s2, s3) { - return (sbox2[(s0 & 0xff) | (s1 & 0xff00)] | - (sbox2[((s2 >>> 16) & 0xff) | ((s3 >>> 16) & 0xff00)] << 16)); -} -function encrypt(xk, s0, s1, s2, s3) { - const { sbox2, T01, T23 } = tableEncoding; - let k = 0; - (s0 ^= xk[k++]), (s1 ^= xk[k++]), (s2 ^= xk[k++]), (s3 ^= xk[k++]); - const rounds = xk.length / 4 - 2; - for (let i = 0; i < rounds; i++) { - const t0 = xk[k++] ^ apply0123(T01, T23, s0, s1, s2, s3); - const t1 = xk[k++] ^ apply0123(T01, T23, s1, s2, s3, s0); - const t2 = xk[k++] ^ apply0123(T01, T23, s2, s3, s0, s1); - const t3 = xk[k++] ^ apply0123(T01, T23, s3, s0, s1, s2); - (s0 = t0), (s1 = t1), (s2 = t2), (s3 = t3); - } - // last round (without mixcolumns, so using SBOX2 table) - const t0 = xk[k++] ^ applySbox(sbox2, s0, s1, s2, s3); - const t1 = xk[k++] ^ applySbox(sbox2, s1, s2, s3, s0); - const t2 = xk[k++] ^ applySbox(sbox2, s2, s3, s0, s1); - const t3 = xk[k++] ^ applySbox(sbox2, s3, s0, s1, s2); - return { s0: t0, s1: t1, s2: t2, s3: t3 }; -} -// Can't be merged with encrypt: arg positions for apply0123 / applySbox are different -function decrypt(xk, s0, s1, s2, s3) { - const { sbox2, T01, T23 } = tableDecoding; - let k = 0; - (s0 ^= xk[k++]), (s1 ^= xk[k++]), (s2 ^= xk[k++]), (s3 ^= xk[k++]); - const rounds = xk.length / 4 - 2; - for (let i = 0; i < rounds; i++) { - const t0 = xk[k++] ^ apply0123(T01, T23, s0, s3, s2, s1); - const t1 = xk[k++] ^ apply0123(T01, T23, s1, s0, s3, s2); - const t2 = xk[k++] ^ apply0123(T01, T23, s2, s1, s0, s3); - const t3 = xk[k++] ^ apply0123(T01, T23, s3, s2, s1, s0); - (s0 = t0), (s1 = t1), (s2 = t2), (s3 = t3); - } - // Last round - const t0 = xk[k++] ^ applySbox(sbox2, s0, s3, s2, s1); - const t1 = xk[k++] ^ applySbox(sbox2, s1, s0, s3, s2); - const t2 = xk[k++] ^ applySbox(sbox2, s2, s1, s0, s3); - const t3 = xk[k++] ^ applySbox(sbox2, s3, s2, s1, s0); - return { s0: t0, s1: t1, s2: t2, s3: t3 }; -} -// TODO: investigate merging with ctr32 -function ctrCounter(xk, nonce, src, dst) { - abytes(nonce, BLOCK_SIZE); - abytes(src); - const srcLen = src.length; - dst = getOutput(srcLen, dst); - complexOverlapBytes(src, dst); - const ctr = nonce; - const c32 = u32(ctr); - // Fill block (empty, ctr=0) - let { s0, s1, s2, s3 } = encrypt(xk, c32[0], c32[1], c32[2], c32[3]); - const src32 = u32(src); - const dst32 = u32(dst); - // process blocks - for (let i = 0; i + 4 <= src32.length; i += 4) { - dst32[i + 0] = src32[i + 0] ^ s0; - dst32[i + 1] = src32[i + 1] ^ s1; - dst32[i + 2] = src32[i + 2] ^ s2; - dst32[i + 3] = src32[i + 3] ^ s3; - // Full 128 bit counter with wrap around - let carry = 1; - for (let i = ctr.length - 1; i >= 0; i--) { - carry = (carry + (ctr[i] & 0xff)) | 0; - ctr[i] = carry & 0xff; - carry >>>= 8; - } - ({ s0, s1, s2, s3 } = encrypt(xk, c32[0], c32[1], c32[2], c32[3])); - } - // leftovers (less than block) - // It's possible to handle > u32 fast, but is it worth it? - const start = BLOCK_SIZE * Math.floor(src32.length / BLOCK_SIZE32); - if (start < srcLen) { - const b32 = new Uint32Array([s0, s1, s2, s3]); - const buf = u8(b32); - for (let i = start, pos = 0; i < srcLen; i++, pos++) - dst[i] = src[i] ^ buf[pos]; - clean(b32); - } - return dst; -} -// AES CTR with overflowing 32 bit counter -// It's possible to do 32le significantly simpler (and probably faster) by using u32. -// But, we need both, and perf bottleneck is in ghash anyway. -function ctr32(xk, isLE, nonce, src, dst) { - abytes(nonce, BLOCK_SIZE); - abytes(src); - dst = getOutput(src.length, dst); - const ctr = nonce; // write new value to nonce, so it can be re-used - const c32 = u32(ctr); - const view = createView(ctr); - const src32 = u32(src); - const dst32 = u32(dst); - const ctrPos = isLE ? 0 : 12; - const srcLen = src.length; - // Fill block (empty, ctr=0) - let ctrNum = view.getUint32(ctrPos, isLE); // read current counter value - let { s0, s1, s2, s3 } = encrypt(xk, c32[0], c32[1], c32[2], c32[3]); - // process blocks - for (let i = 0; i + 4 <= src32.length; i += 4) { - dst32[i + 0] = src32[i + 0] ^ s0; - dst32[i + 1] = src32[i + 1] ^ s1; - dst32[i + 2] = src32[i + 2] ^ s2; - dst32[i + 3] = src32[i + 3] ^ s3; - ctrNum = (ctrNum + 1) >>> 0; // u32 wrap - view.setUint32(ctrPos, ctrNum, isLE); - ({ s0, s1, s2, s3 } = encrypt(xk, c32[0], c32[1], c32[2], c32[3])); - } - // leftovers (less than a block) - const start = BLOCK_SIZE * Math.floor(src32.length / BLOCK_SIZE32); - if (start < srcLen) { - const b32 = new Uint32Array([s0, s1, s2, s3]); - const buf = u8(b32); - for (let i = start, pos = 0; i < srcLen; i++, pos++) - dst[i] = src[i] ^ buf[pos]; - clean(b32); - } - return dst; -} -/** - * CTR: counter mode. Creates stream cipher. - * Requires good IV. Parallelizable. OK, but no MAC. - */ -export const ctr = /* @__PURE__ */ wrapCipher({ blockSize: 16, nonceLength: 16 }, function aesctr(key, nonce) { - function processCtr(buf, dst) { - abytes(buf); - if (dst !== undefined) { - abytes(dst); - if (!isAligned32(dst)) - throw new Error('unaligned destination'); - } - const xk = expandKeyLE(key); - const n = copyBytes(nonce); // align + avoid changing - const toClean = [xk, n]; - if (!isAligned32(buf)) - toClean.push((buf = copyBytes(buf))); - const out = ctrCounter(xk, n, buf, dst); - clean(...toClean); - return out; - } - return { - encrypt: (plaintext, dst) => processCtr(plaintext, dst), - decrypt: (ciphertext, dst) => processCtr(ciphertext, dst), - }; -}); -function validateBlockDecrypt(data) { - abytes(data); - if (data.length % BLOCK_SIZE !== 0) { - throw new Error('aes-(cbc/ecb).decrypt ciphertext should consist of blocks with size ' + BLOCK_SIZE); - } -} -function validateBlockEncrypt(plaintext, pcks5, dst) { - abytes(plaintext); - let outLen = plaintext.length; - const remaining = outLen % BLOCK_SIZE; - if (!pcks5 && remaining !== 0) - throw new Error('aec/(cbc-ecb): unpadded plaintext with disabled padding'); - if (!isAligned32(plaintext)) - plaintext = copyBytes(plaintext); - const b = u32(plaintext); - if (pcks5) { - let left = BLOCK_SIZE - remaining; - if (!left) - left = BLOCK_SIZE; // if no bytes left, create empty padding block - outLen = outLen + left; - } - dst = getOutput(outLen, dst); - complexOverlapBytes(plaintext, dst); - const o = u32(dst); - return { b, o, out: dst }; -} -function validatePCKS(data, pcks5) { - if (!pcks5) - return data; - const len = data.length; - if (!len) - throw new Error('aes/pcks5: empty ciphertext not allowed'); - const lastByte = data[len - 1]; - if (lastByte <= 0 || lastByte > 16) - throw new Error('aes/pcks5: wrong padding'); - const out = data.subarray(0, -lastByte); - for (let i = 0; i < lastByte; i++) - if (data[len - i - 1] !== lastByte) - throw new Error('aes/pcks5: wrong padding'); - return out; -} -function padPCKS(left) { - const tmp = new Uint8Array(16); - const tmp32 = u32(tmp); - tmp.set(left); - const paddingByte = BLOCK_SIZE - left.length; - for (let i = BLOCK_SIZE - paddingByte; i < BLOCK_SIZE; i++) - tmp[i] = paddingByte; - return tmp32; -} -/** - * ECB: Electronic CodeBook. Simple deterministic replacement. - * Dangerous: always map x to y. See [AES Penguin](https://words.filippo.io/the-ecb-penguin/). - */ -export const ecb = /* @__PURE__ */ wrapCipher({ blockSize: 16 }, function aesecb(key, opts = {}) { - const pcks5 = !opts.disablePadding; - return { - encrypt(plaintext, dst) { - const { b, o, out: _out } = validateBlockEncrypt(plaintext, pcks5, dst); - const xk = expandKeyLE(key); - let i = 0; - for (; i + 4 <= b.length;) { - const { s0, s1, s2, s3 } = encrypt(xk, b[i + 0], b[i + 1], b[i + 2], b[i + 3]); - (o[i++] = s0), (o[i++] = s1), (o[i++] = s2), (o[i++] = s3); - } - if (pcks5) { - const tmp32 = padPCKS(plaintext.subarray(i * 4)); - const { s0, s1, s2, s3 } = encrypt(xk, tmp32[0], tmp32[1], tmp32[2], tmp32[3]); - (o[i++] = s0), (o[i++] = s1), (o[i++] = s2), (o[i++] = s3); - } - clean(xk); - return _out; - }, - decrypt(ciphertext, dst) { - validateBlockDecrypt(ciphertext); - const xk = expandKeyDecLE(key); - dst = getOutput(ciphertext.length, dst); - const toClean = [xk]; - if (!isAligned32(ciphertext)) - toClean.push((ciphertext = copyBytes(ciphertext))); - complexOverlapBytes(ciphertext, dst); - const b = u32(ciphertext); - const o = u32(dst); - for (let i = 0; i + 4 <= b.length;) { - const { s0, s1, s2, s3 } = decrypt(xk, b[i + 0], b[i + 1], b[i + 2], b[i + 3]); - (o[i++] = s0), (o[i++] = s1), (o[i++] = s2), (o[i++] = s3); - } - clean(...toClean); - return validatePCKS(dst, pcks5); - }, - }; -}); -/** - * CBC: Cipher-Block-Chaining. Key is previous round’s block. - * Fragile: needs proper padding. Unauthenticated: needs MAC. - */ -export const cbc = /* @__PURE__ */ wrapCipher({ blockSize: 16, nonceLength: 16 }, function aescbc(key, iv, opts = {}) { - const pcks5 = !opts.disablePadding; - return { - encrypt(plaintext, dst) { - const xk = expandKeyLE(key); - const { b, o, out: _out } = validateBlockEncrypt(plaintext, pcks5, dst); - let _iv = iv; - const toClean = [xk]; - if (!isAligned32(_iv)) - toClean.push((_iv = copyBytes(_iv))); - const n32 = u32(_iv); - // prettier-ignore - let s0 = n32[0], s1 = n32[1], s2 = n32[2], s3 = n32[3]; - let i = 0; - for (; i + 4 <= b.length;) { - (s0 ^= b[i + 0]), (s1 ^= b[i + 1]), (s2 ^= b[i + 2]), (s3 ^= b[i + 3]); - ({ s0, s1, s2, s3 } = encrypt(xk, s0, s1, s2, s3)); - (o[i++] = s0), (o[i++] = s1), (o[i++] = s2), (o[i++] = s3); - } - if (pcks5) { - const tmp32 = padPCKS(plaintext.subarray(i * 4)); - (s0 ^= tmp32[0]), (s1 ^= tmp32[1]), (s2 ^= tmp32[2]), (s3 ^= tmp32[3]); - ({ s0, s1, s2, s3 } = encrypt(xk, s0, s1, s2, s3)); - (o[i++] = s0), (o[i++] = s1), (o[i++] = s2), (o[i++] = s3); - } - clean(...toClean); - return _out; - }, - decrypt(ciphertext, dst) { - validateBlockDecrypt(ciphertext); - const xk = expandKeyDecLE(key); - let _iv = iv; - const toClean = [xk]; - if (!isAligned32(_iv)) - toClean.push((_iv = copyBytes(_iv))); - const n32 = u32(_iv); - dst = getOutput(ciphertext.length, dst); - if (!isAligned32(ciphertext)) - toClean.push((ciphertext = copyBytes(ciphertext))); - complexOverlapBytes(ciphertext, dst); - const b = u32(ciphertext); - const o = u32(dst); - // prettier-ignore - let s0 = n32[0], s1 = n32[1], s2 = n32[2], s3 = n32[3]; - for (let i = 0; i + 4 <= b.length;) { - // prettier-ignore - const ps0 = s0, ps1 = s1, ps2 = s2, ps3 = s3; - (s0 = b[i + 0]), (s1 = b[i + 1]), (s2 = b[i + 2]), (s3 = b[i + 3]); - const { s0: o0, s1: o1, s2: o2, s3: o3 } = decrypt(xk, s0, s1, s2, s3); - (o[i++] = o0 ^ ps0), (o[i++] = o1 ^ ps1), (o[i++] = o2 ^ ps2), (o[i++] = o3 ^ ps3); - } - clean(...toClean); - return validatePCKS(dst, pcks5); - }, - }; -}); -/** - * CFB: Cipher Feedback Mode. The input for the block cipher is the previous cipher output. - * Unauthenticated: needs MAC. - */ -export const cfb = /* @__PURE__ */ wrapCipher({ blockSize: 16, nonceLength: 16 }, function aescfb(key, iv) { - function processCfb(src, isEncrypt, dst) { - abytes(src); - const srcLen = src.length; - dst = getOutput(srcLen, dst); - if (overlapBytes(src, dst)) - throw new Error('overlapping src and dst not supported.'); - const xk = expandKeyLE(key); - let _iv = iv; - const toClean = [xk]; - if (!isAligned32(_iv)) - toClean.push((_iv = copyBytes(_iv))); - if (!isAligned32(src)) - toClean.push((src = copyBytes(src))); - const src32 = u32(src); - const dst32 = u32(dst); - const next32 = isEncrypt ? dst32 : src32; - const n32 = u32(_iv); - // prettier-ignore - let s0 = n32[0], s1 = n32[1], s2 = n32[2], s3 = n32[3]; - for (let i = 0; i + 4 <= src32.length;) { - const { s0: e0, s1: e1, s2: e2, s3: e3 } = encrypt(xk, s0, s1, s2, s3); - dst32[i + 0] = src32[i + 0] ^ e0; - dst32[i + 1] = src32[i + 1] ^ e1; - dst32[i + 2] = src32[i + 2] ^ e2; - dst32[i + 3] = src32[i + 3] ^ e3; - (s0 = next32[i++]), (s1 = next32[i++]), (s2 = next32[i++]), (s3 = next32[i++]); - } - // leftovers (less than block) - const start = BLOCK_SIZE * Math.floor(src32.length / BLOCK_SIZE32); - if (start < srcLen) { - ({ s0, s1, s2, s3 } = encrypt(xk, s0, s1, s2, s3)); - const buf = u8(new Uint32Array([s0, s1, s2, s3])); - for (let i = start, pos = 0; i < srcLen; i++, pos++) - dst[i] = src[i] ^ buf[pos]; - clean(buf); - } - clean(...toClean); - return dst; - } - return { - encrypt: (plaintext, dst) => processCfb(plaintext, true, dst), - decrypt: (ciphertext, dst) => processCfb(ciphertext, false, dst), - }; -}); -// TODO: merge with chacha, however gcm has bitLen while chacha has byteLen -function computeTag(fn, isLE, key, data, AAD) { - const aadLength = AAD ? AAD.length : 0; - const h = fn.create(key, data.length + aadLength); - if (AAD) - h.update(AAD); - const num = u64Lengths(8 * data.length, 8 * aadLength, isLE); - h.update(data); - h.update(num); - const res = h.digest(); - clean(num); - return res; -} -/** - * GCM: Galois/Counter Mode. - * Modern, parallel version of CTR, with MAC. - * Be careful: MACs can be forged. - * Unsafe to use random nonces under the same key, due to collision chance. - * As for nonce size, prefer 12-byte, instead of 8-byte. - */ -export const gcm = /* @__PURE__ */ wrapCipher({ blockSize: 16, nonceLength: 12, tagLength: 16, varSizeNonce: true }, function aesgcm(key, nonce, AAD) { - // NIST 800-38d doesn't enforce minimum nonce length. - // We enforce 8 bytes for compat with openssl. - // 12 bytes are recommended. More than 12 bytes would be converted into 12. - if (nonce.length < 8) - throw new Error('aes/gcm: invalid nonce length'); - const tagLength = 16; - function _computeTag(authKey, tagMask, data) { - const tag = computeTag(ghash, false, authKey, data, AAD); - for (let i = 0; i < tagMask.length; i++) - tag[i] ^= tagMask[i]; - return tag; - } - function deriveKeys() { - const xk = expandKeyLE(key); - const authKey = EMPTY_BLOCK.slice(); - const counter = EMPTY_BLOCK.slice(); - ctr32(xk, false, counter, counter, authKey); - // NIST 800-38d, page 15: different behavior for 96-bit and non-96-bit nonces - if (nonce.length === 12) { - counter.set(nonce); - } - else { - const nonceLen = EMPTY_BLOCK.slice(); - const view = createView(nonceLen); - setBigUint64(view, 8, BigInt(nonce.length * 8), false); - // ghash(nonce || u64be(0) || u64be(nonceLen*8)) - const g = ghash.create(authKey).update(nonce).update(nonceLen); - g.digestInto(counter); // digestInto doesn't trigger '.destroy' - g.destroy(); - } - const tagMask = ctr32(xk, false, counter, EMPTY_BLOCK); - return { xk, authKey, counter, tagMask }; - } - return { - encrypt(plaintext) { - const { xk, authKey, counter, tagMask } = deriveKeys(); - const out = new Uint8Array(plaintext.length + tagLength); - const toClean = [xk, authKey, counter, tagMask]; - if (!isAligned32(plaintext)) - toClean.push((plaintext = copyBytes(plaintext))); - ctr32(xk, false, counter, plaintext, out.subarray(0, plaintext.length)); - const tag = _computeTag(authKey, tagMask, out.subarray(0, out.length - tagLength)); - toClean.push(tag); - out.set(tag, plaintext.length); - clean(...toClean); - return out; - }, - decrypt(ciphertext) { - const { xk, authKey, counter, tagMask } = deriveKeys(); - const toClean = [xk, authKey, tagMask, counter]; - if (!isAligned32(ciphertext)) - toClean.push((ciphertext = copyBytes(ciphertext))); - const data = ciphertext.subarray(0, -tagLength); - const passedTag = ciphertext.subarray(-tagLength); - const tag = _computeTag(authKey, tagMask, data); - toClean.push(tag); - if (!equalBytes(tag, passedTag)) - throw new Error('aes/gcm: invalid ghash tag'); - const out = ctr32(xk, false, counter, data); - clean(...toClean); - return out; - }, - }; -}); -const limit = (name, min, max) => (value) => { - if (!Number.isSafeInteger(value) || min > value || value > max) { - const minmax = '[' + min + '..' + max + ']'; - throw new Error('' + name + ': expected value in range ' + minmax + ', got ' + value); - } -}; -/** - * AES-GCM-SIV: classic AES-GCM with nonce-misuse resistance. - * Guarantees that, when a nonce is repeated, the only security loss is that identical - * plaintexts will produce identical ciphertexts. - * RFC 8452, https://datatracker.ietf.org/doc/html/rfc8452 - */ -export const gcmsiv = /* @__PURE__ */ wrapCipher({ blockSize: 16, nonceLength: 12, tagLength: 16, varSizeNonce: true }, function aessiv(key, nonce, AAD) { - const tagLength = 16; - // From RFC 8452: Section 6 - const AAD_LIMIT = limit('AAD', 0, 2 ** 36); - const PLAIN_LIMIT = limit('plaintext', 0, 2 ** 36); - const NONCE_LIMIT = limit('nonce', 12, 12); - const CIPHER_LIMIT = limit('ciphertext', 16, 2 ** 36 + 16); - abytes(key, 16, 24, 32); - NONCE_LIMIT(nonce.length); - if (AAD !== undefined) - AAD_LIMIT(AAD.length); - function deriveKeys() { - const xk = expandKeyLE(key); - const encKey = new Uint8Array(key.length); - const authKey = new Uint8Array(16); - const toClean = [xk, encKey]; - let _nonce = nonce; - if (!isAligned32(_nonce)) - toClean.push((_nonce = copyBytes(_nonce))); - const n32 = u32(_nonce); - // prettier-ignore - let s0 = 0, s1 = n32[0], s2 = n32[1], s3 = n32[2]; - let counter = 0; - for (const derivedKey of [authKey, encKey].map(u32)) { - const d32 = u32(derivedKey); - for (let i = 0; i < d32.length; i += 2) { - // aes(u32le(0) || nonce)[:8] || aes(u32le(1) || nonce)[:8] ... - const { s0: o0, s1: o1 } = encrypt(xk, s0, s1, s2, s3); - d32[i + 0] = o0; - d32[i + 1] = o1; - s0 = ++counter; // increment counter inside state - } - } - const res = { authKey, encKey: expandKeyLE(encKey) }; - // Cleanup - clean(...toClean); - return res; - } - function _computeTag(encKey, authKey, data) { - const tag = computeTag(polyval, true, authKey, data, AAD); - // Compute the expected tag by XORing S_s and the nonce, clearing the - // most significant bit of the last byte and encrypting with the - // message-encryption key. - for (let i = 0; i < 12; i++) - tag[i] ^= nonce[i]; - tag[15] &= 0x7f; // Clear the highest bit - // encrypt tag as block - const t32 = u32(tag); - // prettier-ignore - let s0 = t32[0], s1 = t32[1], s2 = t32[2], s3 = t32[3]; - ({ s0, s1, s2, s3 } = encrypt(encKey, s0, s1, s2, s3)); - (t32[0] = s0), (t32[1] = s1), (t32[2] = s2), (t32[3] = s3); - return tag; - } - // actual decrypt/encrypt of message. - function processSiv(encKey, tag, input) { - let block = copyBytes(tag); - block[15] |= 0x80; // Force highest bit - const res = ctr32(encKey, true, block, input); - // Cleanup - clean(block); - return res; - } - return { - encrypt(plaintext) { - PLAIN_LIMIT(plaintext.length); - const { encKey, authKey } = deriveKeys(); - const tag = _computeTag(encKey, authKey, plaintext); - const toClean = [encKey, authKey, tag]; - if (!isAligned32(plaintext)) - toClean.push((plaintext = copyBytes(plaintext))); - const out = new Uint8Array(plaintext.length + tagLength); - out.set(tag, plaintext.length); - out.set(processSiv(encKey, tag, plaintext)); - // Cleanup - clean(...toClean); - return out; - }, - decrypt(ciphertext) { - CIPHER_LIMIT(ciphertext.length); - const tag = ciphertext.subarray(-tagLength); - const { encKey, authKey } = deriveKeys(); - const toClean = [encKey, authKey]; - if (!isAligned32(ciphertext)) - toClean.push((ciphertext = copyBytes(ciphertext))); - const plaintext = processSiv(encKey, tag, ciphertext.subarray(0, -tagLength)); - const expectedTag = _computeTag(encKey, authKey, plaintext); - toClean.push(expectedTag); - if (!equalBytes(tag, expectedTag)) { - clean(...toClean); - throw new Error('invalid polyval tag'); - } - // Cleanup - clean(...toClean); - return plaintext; - }, - }; -}); -/** - * AES-GCM-SIV, not AES-SIV. - * This is legace name, use `gcmsiv` export instead. - * @deprecated - */ -export const siv = gcmsiv; -function isBytes32(a) { - return (a instanceof Uint32Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint32Array')); -} -function encryptBlock(xk, block) { - abytes(block, 16); - if (!isBytes32(xk)) - throw new Error('_encryptBlock accepts result of expandKeyLE'); - const b32 = u32(block); - let { s0, s1, s2, s3 } = encrypt(xk, b32[0], b32[1], b32[2], b32[3]); - (b32[0] = s0), (b32[1] = s1), (b32[2] = s2), (b32[3] = s3); - return block; -} -function decryptBlock(xk, block) { - abytes(block, 16); - if (!isBytes32(xk)) - throw new Error('_decryptBlock accepts result of expandKeyLE'); - const b32 = u32(block); - let { s0, s1, s2, s3 } = decrypt(xk, b32[0], b32[1], b32[2], b32[3]); - (b32[0] = s0), (b32[1] = s1), (b32[2] = s2), (b32[3] = s3); - return block; -} -/** - * AES-W (base for AESKW/AESKWP). - * Specs: [SP800-38F](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-38F.pdf), - * [RFC 3394](https://datatracker.ietf.org/doc/rfc3394/), - * [RFC 5649](https://datatracker.ietf.org/doc/rfc5649/). - */ -const AESW = { - /* - High-level pseudocode: - ``` - A: u64 = IV - out = [] - for (let i=0, ctr = 0; i<6; i++) { - for (const chunk of chunks(plaintext, 8)) { - A ^= swapEndianess(ctr++) - [A, res] = chunks(encrypt(A || chunk), 8); - out ||= res - } - } - out = A || out - ``` - Decrypt is the same, but reversed. - */ - encrypt(kek, out) { - // Size is limited to 4GB, otherwise ctr will overflow and we'll need to switch to bigints. - // If you need it larger, open an issue. - if (out.length >= 2 ** 32) - throw new Error('plaintext should be less than 4gb'); - const xk = expandKeyLE(kek); - if (out.length === 16) - encryptBlock(xk, out); - else { - const o32 = u32(out); - // prettier-ignore - let a0 = o32[0], a1 = o32[1]; // A - for (let j = 0, ctr = 1; j < 6; j++) { - for (let pos = 2; pos < o32.length; pos += 2, ctr++) { - const { s0, s1, s2, s3 } = encrypt(xk, a0, a1, o32[pos], o32[pos + 1]); - // A = MSB(64, B) ^ t where t = (n*j)+i - (a0 = s0), (a1 = s1 ^ byteSwap(ctr)), (o32[pos] = s2), (o32[pos + 1] = s3); - } - } - (o32[0] = a0), (o32[1] = a1); // out = A || out - } - xk.fill(0); - }, - decrypt(kek, out) { - if (out.length - 8 >= 2 ** 32) - throw new Error('ciphertext should be less than 4gb'); - const xk = expandKeyDecLE(kek); - const chunks = out.length / 8 - 1; // first chunk is IV - if (chunks === 1) - decryptBlock(xk, out); - else { - const o32 = u32(out); - // prettier-ignore - let a0 = o32[0], a1 = o32[1]; // A - for (let j = 0, ctr = chunks * 6; j < 6; j++) { - for (let pos = chunks * 2; pos >= 1; pos -= 2, ctr--) { - a1 ^= byteSwap(ctr); - const { s0, s1, s2, s3 } = decrypt(xk, a0, a1, o32[pos], o32[pos + 1]); - (a0 = s0), (a1 = s1), (o32[pos] = s2), (o32[pos + 1] = s3); - } - } - (o32[0] = a0), (o32[1] = a1); - } - xk.fill(0); - }, -}; -const AESKW_IV = /* @__PURE__ */ new Uint8Array(8).fill(0xa6); // A6A6A6A6A6A6A6A6 -/** - * AES-KW (key-wrap). Injects static IV into plaintext, adds counter, encrypts 6 times. - * Reduces block size from 16 to 8 bytes. - * For padded version, use aeskwp. - * [RFC 3394](https://datatracker.ietf.org/doc/rfc3394/), - * [NIST.SP.800-38F](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-38F.pdf). - */ -export const aeskw = /* @__PURE__ */ wrapCipher({ blockSize: 8 }, (kek) => ({ - encrypt(plaintext) { - if (!plaintext.length || plaintext.length % 8 !== 0) - throw new Error('invalid plaintext length'); - if (plaintext.length === 8) - throw new Error('8-byte keys not allowed in AESKW, use AESKWP instead'); - const out = concatBytes(AESKW_IV, plaintext); - AESW.encrypt(kek, out); - return out; - }, - decrypt(ciphertext) { - // ciphertext must be at least 24 bytes and a multiple of 8 bytes - // 24 because should have at least two block (1 iv + 2). - // Replace with 16 to enable '8-byte keys' - if (ciphertext.length % 8 !== 0 || ciphertext.length < 3 * 8) - throw new Error('invalid ciphertext length'); - const out = copyBytes(ciphertext); - AESW.decrypt(kek, out); - if (!equalBytes(out.subarray(0, 8), AESKW_IV)) - throw new Error('integrity check failed'); - out.subarray(0, 8).fill(0); // ciphertext.subarray(0, 8) === IV, but we clean it anyway - return out.subarray(8); - }, -})); -/* -We don't support 8-byte keys. The rabbit hole: - -- Wycheproof says: "NIST SP 800-38F does not define the wrapping of 8 byte keys. - RFC 3394 Section 2 on the other hand specifies that 8 byte keys are wrapped - by directly encrypting one block with AES." - - https://github.com/C2SP/wycheproof/blob/master/doc/key_wrap.md - - "RFC 3394 specifies in Section 2, that the input for the key wrap - algorithm must be at least two blocks and otherwise the constant - field and key are simply encrypted with ECB as a single block" -- What RFC 3394 actually says (in Section 2): - - "Before being wrapped, the key data is parsed into n blocks of 64 bits. - The only restriction the key wrap algorithm places on n is that n be - at least two" - - "For key data with length less than or equal to 64 bits, the constant - field used in this specification and the key data form a single - 128-bit codebook input making this key wrap unnecessary." -- Which means "assert(n >= 2)" and "use something else for 8 byte keys" -- NIST SP800-38F actually prohibits 8-byte in "5.3.1 Mandatory Limits". - It states that plaintext for KW should be "2 to 2^54 -1 semiblocks". -- So, where does "directly encrypt single block with AES" come from? - - Not RFC 3394. Pseudocode of key wrap in 2.2 explicitly uses - loop of 6 for any code path - - There is a weird W3C spec: - https://www.w3.org/TR/2002/REC-xmlenc-core-20021210/Overview.html#kw-aes128 - - This spec is outdated, as admitted by Wycheproof authors - - There is RFC 5649 for padded key wrap, which is padding construction on - top of AESKW. In '4.1.2' it says: "If the padded plaintext contains exactly - eight octets, then prepend the AIV as defined in Section 3 above to P[1] and - encrypt the resulting 128-bit block using AES in ECB mode [Modes] with key - K (the KEK). In this case, the output is two 64-bit blocks C[0] and C[1]:" - - Browser subtle crypto is actually crashes on wrapping keys less than 16 bytes: - `Error: error:1C8000E6:Provider routines::invalid input length] { opensslErrorStack: [ 'error:030000BD:digital envelope routines::update error' ]` - -In the end, seems like a bug in Wycheproof. -The 8-byte check can be easily disabled inside of AES_W. -*/ -const AESKWP_IV = 0xa65959a6; // single u32le value -/** - * AES-KW, but with padding and allows random keys. - * Second u32 of IV is used as counter for length. - * [RFC 5649](https://www.rfc-editor.org/rfc/rfc5649) - */ -export const aeskwp = /* @__PURE__ */ wrapCipher({ blockSize: 8 }, (kek) => ({ - encrypt(plaintext) { - if (!plaintext.length) - throw new Error('invalid plaintext length'); - const padded = Math.ceil(plaintext.length / 8) * 8; - const out = new Uint8Array(8 + padded); - out.set(plaintext, 8); - const out32 = u32(out); - out32[0] = AESKWP_IV; - out32[1] = byteSwap(plaintext.length); - AESW.encrypt(kek, out); - return out; - }, - decrypt(ciphertext) { - // 16 because should have at least one block - if (ciphertext.length < 16) - throw new Error('invalid ciphertext length'); - const out = copyBytes(ciphertext); - const o32 = u32(out); - AESW.decrypt(kek, out); - const len = byteSwap(o32[1]) >>> 0; - const padded = Math.ceil(len / 8) * 8; - if (o32[0] !== AESKWP_IV || out.length - 8 !== padded) - throw new Error('integrity check failed'); - for (let i = len; i < padded; i++) - if (out[8 + i] !== 0) - throw new Error('integrity check failed'); - out.subarray(0, 8).fill(0); // ciphertext.subarray(0, 8) === IV, but we clean it anyway - return out.subarray(8, 8 + len); - }, -})); -/** Unsafe low-level internal methods. May change at any time. */ -export const unsafe = { - expandKeyLE, - expandKeyDecLE, - encrypt, - decrypt, - encryptBlock, - decryptBlock, - ctrCounter, - ctr32, -}; -//# sourceMappingURL=aes.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/aes.js.map b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/aes.js.map deleted file mode 100644 index 434e843c..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/aes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"aes.js","sourceRoot":"","sources":["../src/aes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC/C,kBAAkB;AAClB,OAAO,EACL,MAAM,EAAE,KAAK,EAAE,mBAAmB,EAAE,WAAW,EAC/C,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EACvE,YAAY,EAAE,GAAG,EAAE,UAAU,EAAE,EAAE,E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AAG,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC;IAClC,CAAC;CACF,CAAC,CACH,CAAC;AAEF,iEAAiE;AACjE,MAAM,CAAC,MAAM,MAAM,GASf;IACF,WAAW;IACX,cAAc;IACd,OAAO;IACP,OAAO;IACP,YAAY;IACZ,YAAY;IACZ,UAAU;IACV,KAAK;CACN,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/chacha.d.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/chacha.d.ts deleted file mode 100644 index c521e9f7..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/chacha.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { type ARXCipher, type CipherWithOutput, type XorStream } from './utils.ts'; -/** - * hchacha helper method, used primarily in xchacha, to hash - * key and nonce into key' and nonce'. - * Same as chachaCore, but there doesn't seem to be a way to move the block - * out without 25% performance hit. - */ -export declare function hchacha(s: Uint32Array, k: Uint32Array, i: Uint32Array, o32: Uint32Array): void; -/** - * Original, non-RFC chacha20 from DJB. 8-byte nonce, 8-byte counter. - */ -export declare const chacha20orig: XorStream; -/** - * ChaCha stream cipher. Conforms to RFC 8439 (IETF, TLS). 12-byte nonce, 4-byte counter. - * With 12-byte nonce, it's not safe to use fill it with random (CSPRNG), due to collision chance. - */ -export declare const chacha20: XorStream; -/** - * XChaCha eXtended-nonce ChaCha. 24-byte nonce. - * With 24-byte nonce, it's safe to use fill it with random (CSPRNG). - * https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-xchacha - */ -export declare const xchacha20: XorStream; -/** - * Reduced 8-round chacha, described in original paper. - */ -export declare const chacha8: XorStream; -/** - * Reduced 12-round chacha, described in original paper. - */ -export declare const chacha12: XorStream; -/** - * AEAD algorithm from RFC 8439. - * Salsa20 and chacha (RFC 8439) use poly1305 differently. - * We could have composed them similar to: - * https://github.com/paulmillr/scure-base/blob/b266c73dde977b1dd7ef40ef7a23cc15aab526b3/index.ts#L250 - * But it's hard because of authKey: - * In salsa20, authKey changes position in salsa stream. - * In chacha, authKey can't be computed inside computeTag, it modifies the counter. - */ -export declare const _poly1305_aead: (xorStream: XorStream) => (key: Uint8Array, nonce: Uint8Array, AAD?: Uint8Array) => CipherWithOutput; -/** - * ChaCha20-Poly1305 from RFC 8439. - * - * Unsafe to use random nonces under the same key, due to collision chance. - * Prefer XChaCha instead. - */ -export declare const chacha20poly1305: ARXCipher; -/** - * XChaCha20-Poly1305 extended-nonce chacha. - * - * Can be safely used with random nonces (CSPRNG). - * See [IRTF draft](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-xchacha). - */ -export declare const xchacha20poly1305: ARXCipher; -//# sourceMappingURL=chacha.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/chacha.d.ts.map b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/chacha.d.ts.map deleted file mode 100644 index 6dfe0844..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/chacha.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"chacha.d.ts","sourceRoot":"","sources":["../src/chacha.ts"],"names":[],"mappings":"AAgBA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,SAAS,EAMf,MAAM,YAAY,CAAC;AAsEpB;;;;;GAKG;AAEH,wBAAgB,OAAO,CACrB,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,EAAE,GAAG,EAAE,WAAW,GAC/D,IAAI,CAmDN;AACD;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,SAIzB,CAAC;AACH;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,SAIrB,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,SAKtB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,SAIpB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,SAIrB,CAAC;AA6BH;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,GACxB,WAAW,SAAS,MACpB,KAAK,UAAU,EAAE,OAAO,UAAU,EAAE,MAAM,UAAU,KAAG,gBA0BvD,CAAC;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAG9B,CAAC;AACF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAG/B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/chacha.js b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/chacha.js deleted file mode 100644 index 5527ab6c..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/chacha.js +++ /dev/null @@ -1,315 +0,0 @@ -/** - * [ChaCha20](https://cr.yp.to/chacha.html) stream cipher, released - * in 2008. Developed after Salsa20, ChaCha aims to increase diffusion per round. - * It was standardized in [RFC 8439](https://datatracker.ietf.org/doc/html/rfc8439) and - * is now used in TLS 1.3. - * - * [XChaCha20](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-xchacha) - * extended-nonce variant is also provided. Similar to XSalsa, it's safe to use with - * randomly-generated nonces. - * - * Check out [PDF](http://cr.yp.to/chacha/chacha-20080128.pdf) and - * [wiki](https://en.wikipedia.org/wiki/Salsa20). - * @module - */ -import { createCipher, rotl } from "./_arx.js"; -import { poly1305 } from "./_poly1305.js"; -import { clean, equalBytes, getOutput, u64Lengths, wrapCipher, } from "./utils.js"; -/** - * ChaCha core function. - */ -// prettier-ignore -function chachaCore(s, k, n, out, cnt, rounds = 20) { - let y00 = s[0], y01 = s[1], y02 = s[2], y03 = s[3], // "expa" "nd 3" "2-by" "te k" - y04 = k[0], y05 = k[1], y06 = k[2], y07 = k[3], // Key Key Key Key - y08 = k[4], y09 = k[5], y10 = k[6], y11 = k[7], // Key Key Key Key - y12 = cnt, y13 = n[0], y14 = n[1], y15 = n[2]; // Counter Counter Nonce Nonce - // Save state to temporary variables - let x00 = y00, x01 = y01, x02 = y02, x03 = y03, x04 = y04, x05 = y05, x06 = y06, x07 = y07, x08 = y08, x09 = y09, x10 = y10, x11 = y11, x12 = y12, x13 = y13, x14 = y14, x15 = y15; - for (let r = 0; r < rounds; r += 2) { - x00 = (x00 + x04) | 0; - x12 = rotl(x12 ^ x00, 16); - x08 = (x08 + x12) | 0; - x04 = rotl(x04 ^ x08, 12); - x00 = (x00 + x04) | 0; - x12 = rotl(x12 ^ x00, 8); - x08 = (x08 + x12) | 0; - x04 = rotl(x04 ^ x08, 7); - x01 = (x01 + x05) | 0; - x13 = rotl(x13 ^ x01, 16); - x09 = (x09 + x13) | 0; - x05 = rotl(x05 ^ x09, 12); - x01 = (x01 + x05) | 0; - x13 = rotl(x13 ^ x01, 8); - x09 = (x09 + x13) | 0; - x05 = rotl(x05 ^ x09, 7); - x02 = (x02 + x06) | 0; - x14 = rotl(x14 ^ x02, 16); - x10 = (x10 + x14) | 0; - x06 = rotl(x06 ^ x10, 12); - x02 = (x02 + x06) | 0; - x14 = rotl(x14 ^ x02, 8); - x10 = (x10 + x14) | 0; - x06 = rotl(x06 ^ x10, 7); - x03 = (x03 + x07) | 0; - x15 = rotl(x15 ^ x03, 16); - x11 = (x11 + x15) | 0; - x07 = rotl(x07 ^ x11, 12); - x03 = (x03 + x07) | 0; - x15 = rotl(x15 ^ x03, 8); - x11 = (x11 + x15) | 0; - x07 = rotl(x07 ^ x11, 7); - x00 = (x00 + x05) | 0; - x15 = rotl(x15 ^ x00, 16); - x10 = (x10 + x15) | 0; - x05 = rotl(x05 ^ x10, 12); - x00 = (x00 + x05) | 0; - x15 = rotl(x15 ^ x00, 8); - x10 = (x10 + x15) | 0; - x05 = rotl(x05 ^ x10, 7); - x01 = (x01 + x06) | 0; - x12 = rotl(x12 ^ x01, 16); - x11 = (x11 + x12) | 0; - x06 = rotl(x06 ^ x11, 12); - x01 = (x01 + x06) | 0; - x12 = rotl(x12 ^ x01, 8); - x11 = (x11 + x12) | 0; - x06 = rotl(x06 ^ x11, 7); - x02 = (x02 + x07) | 0; - x13 = rotl(x13 ^ x02, 16); - x08 = (x08 + x13) | 0; - x07 = rotl(x07 ^ x08, 12); - x02 = (x02 + x07) | 0; - x13 = rotl(x13 ^ x02, 8); - x08 = (x08 + x13) | 0; - x07 = rotl(x07 ^ x08, 7); - x03 = (x03 + x04) | 0; - x14 = rotl(x14 ^ x03, 16); - x09 = (x09 + x14) | 0; - x04 = rotl(x04 ^ x09, 12); - x03 = (x03 + x04) | 0; - x14 = rotl(x14 ^ x03, 8); - x09 = (x09 + x14) | 0; - x04 = rotl(x04 ^ x09, 7); - } - // Write output - let oi = 0; - out[oi++] = (y00 + x00) | 0; - out[oi++] = (y01 + x01) | 0; - out[oi++] = (y02 + x02) | 0; - out[oi++] = (y03 + x03) | 0; - out[oi++] = (y04 + x04) | 0; - out[oi++] = (y05 + x05) | 0; - out[oi++] = (y06 + x06) | 0; - out[oi++] = (y07 + x07) | 0; - out[oi++] = (y08 + x08) | 0; - out[oi++] = (y09 + x09) | 0; - out[oi++] = (y10 + x10) | 0; - out[oi++] = (y11 + x11) | 0; - out[oi++] = (y12 + x12) | 0; - out[oi++] = (y13 + x13) | 0; - out[oi++] = (y14 + x14) | 0; - out[oi++] = (y15 + x15) | 0; -} -/** - * hchacha helper method, used primarily in xchacha, to hash - * key and nonce into key' and nonce'. - * Same as chachaCore, but there doesn't seem to be a way to move the block - * out without 25% performance hit. - */ -// prettier-ignore -export function hchacha(s, k, i, o32) { - let x00 = s[0], x01 = s[1], x02 = s[2], x03 = s[3], x04 = k[0], x05 = k[1], x06 = k[2], x07 = k[3], x08 = k[4], x09 = k[5], x10 = k[6], x11 = k[7], x12 = i[0], x13 = i[1], x14 = i[2], x15 = i[3]; - for (let r = 0; r < 20; r += 2) { - x00 = (x00 + x04) | 0; - x12 = rotl(x12 ^ x00, 16); - x08 = (x08 + x12) | 0; - x04 = rotl(x04 ^ x08, 12); - x00 = (x00 + x04) | 0; - x12 = rotl(x12 ^ x00, 8); - x08 = (x08 + x12) | 0; - x04 = rotl(x04 ^ x08, 7); - x01 = (x01 + x05) | 0; - x13 = rotl(x13 ^ x01, 16); - x09 = (x09 + x13) | 0; - x05 = rotl(x05 ^ x09, 12); - x01 = (x01 + x05) | 0; - x13 = rotl(x13 ^ x01, 8); - x09 = (x09 + x13) | 0; - x05 = rotl(x05 ^ x09, 7); - x02 = (x02 + x06) | 0; - x14 = rotl(x14 ^ x02, 16); - x10 = (x10 + x14) | 0; - x06 = rotl(x06 ^ x10, 12); - x02 = (x02 + x06) | 0; - x14 = rotl(x14 ^ x02, 8); - x10 = (x10 + x14) | 0; - x06 = rotl(x06 ^ x10, 7); - x03 = (x03 + x07) | 0; - x15 = rotl(x15 ^ x03, 16); - x11 = (x11 + x15) | 0; - x07 = rotl(x07 ^ x11, 12); - x03 = (x03 + x07) | 0; - x15 = rotl(x15 ^ x03, 8); - x11 = (x11 + x15) | 0; - x07 = rotl(x07 ^ x11, 7); - x00 = (x00 + x05) | 0; - x15 = rotl(x15 ^ x00, 16); - x10 = (x10 + x15) | 0; - x05 = rotl(x05 ^ x10, 12); - x00 = (x00 + x05) | 0; - x15 = rotl(x15 ^ x00, 8); - x10 = (x10 + x15) | 0; - x05 = rotl(x05 ^ x10, 7); - x01 = (x01 + x06) | 0; - x12 = rotl(x12 ^ x01, 16); - x11 = (x11 + x12) | 0; - x06 = rotl(x06 ^ x11, 12); - x01 = (x01 + x06) | 0; - x12 = rotl(x12 ^ x01, 8); - x11 = (x11 + x12) | 0; - x06 = rotl(x06 ^ x11, 7); - x02 = (x02 + x07) | 0; - x13 = rotl(x13 ^ x02, 16); - x08 = (x08 + x13) | 0; - x07 = rotl(x07 ^ x08, 12); - x02 = (x02 + x07) | 0; - x13 = rotl(x13 ^ x02, 8); - x08 = (x08 + x13) | 0; - x07 = rotl(x07 ^ x08, 7); - x03 = (x03 + x04) | 0; - x14 = rotl(x14 ^ x03, 16); - x09 = (x09 + x14) | 0; - x04 = rotl(x04 ^ x09, 12); - x03 = (x03 + x04) | 0; - x14 = rotl(x14 ^ x03, 8); - x09 = (x09 + x14) | 0; - x04 = rotl(x04 ^ x09, 7); - } - let oi = 0; - o32[oi++] = x00; - o32[oi++] = x01; - o32[oi++] = x02; - o32[oi++] = x03; - o32[oi++] = x12; - o32[oi++] = x13; - o32[oi++] = x14; - o32[oi++] = x15; -} -/** - * Original, non-RFC chacha20 from DJB. 8-byte nonce, 8-byte counter. - */ -export const chacha20orig = /* @__PURE__ */ createCipher(chachaCore, { - counterRight: false, - counterLength: 8, - allowShortKeys: true, -}); -/** - * ChaCha stream cipher. Conforms to RFC 8439 (IETF, TLS). 12-byte nonce, 4-byte counter. - * With 12-byte nonce, it's not safe to use fill it with random (CSPRNG), due to collision chance. - */ -export const chacha20 = /* @__PURE__ */ createCipher(chachaCore, { - counterRight: false, - counterLength: 4, - allowShortKeys: false, -}); -/** - * XChaCha eXtended-nonce ChaCha. 24-byte nonce. - * With 24-byte nonce, it's safe to use fill it with random (CSPRNG). - * https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-xchacha - */ -export const xchacha20 = /* @__PURE__ */ createCipher(chachaCore, { - counterRight: false, - counterLength: 8, - extendNonceFn: hchacha, - allowShortKeys: false, -}); -/** - * Reduced 8-round chacha, described in original paper. - */ -export const chacha8 = /* @__PURE__ */ createCipher(chachaCore, { - counterRight: false, - counterLength: 4, - rounds: 8, -}); -/** - * Reduced 12-round chacha, described in original paper. - */ -export const chacha12 = /* @__PURE__ */ createCipher(chachaCore, { - counterRight: false, - counterLength: 4, - rounds: 12, -}); -const ZEROS16 = /* @__PURE__ */ new Uint8Array(16); -// Pad to digest size with zeros -const updatePadded = (h, msg) => { - h.update(msg); - const left = msg.length % 16; - if (left) - h.update(ZEROS16.subarray(left)); -}; -const ZEROS32 = /* @__PURE__ */ new Uint8Array(32); -function computeTag(fn, key, nonce, data, AAD) { - const authKey = fn(key, nonce, ZEROS32); - const h = poly1305.create(authKey); - if (AAD) - updatePadded(h, AAD); - updatePadded(h, data); - const num = u64Lengths(data.length, AAD ? AAD.length : 0, true); - h.update(num); - const res = h.digest(); - clean(authKey, num); - return res; -} -/** - * AEAD algorithm from RFC 8439. - * Salsa20 and chacha (RFC 8439) use poly1305 differently. - * We could have composed them similar to: - * https://github.com/paulmillr/scure-base/blob/b266c73dde977b1dd7ef40ef7a23cc15aab526b3/index.ts#L250 - * But it's hard because of authKey: - * In salsa20, authKey changes position in salsa stream. - * In chacha, authKey can't be computed inside computeTag, it modifies the counter. - */ -export const _poly1305_aead = (xorStream) => (key, nonce, AAD) => { - const tagLength = 16; - return { - encrypt(plaintext, output) { - const plength = plaintext.length; - output = getOutput(plength + tagLength, output, false); - output.set(plaintext); - const oPlain = output.subarray(0, -tagLength); - xorStream(key, nonce, oPlain, oPlain, 1); - const tag = computeTag(xorStream, key, nonce, oPlain, AAD); - output.set(tag, plength); // append tag - clean(tag); - return output; - }, - decrypt(ciphertext, output) { - output = getOutput(ciphertext.length - tagLength, output, false); - const data = ciphertext.subarray(0, -tagLength); - const passedTag = ciphertext.subarray(-tagLength); - const tag = computeTag(xorStream, key, nonce, data, AAD); - if (!equalBytes(passedTag, tag)) - throw new Error('invalid tag'); - output.set(ciphertext.subarray(0, -tagLength)); - xorStream(key, nonce, output, output, 1); // start stream with i=1 - clean(tag); - return output; - }, - }; -}; -/** - * ChaCha20-Poly1305 from RFC 8439. - * - * Unsafe to use random nonces under the same key, due to collision chance. - * Prefer XChaCha instead. - */ -export const chacha20poly1305 = /* @__PURE__ */ wrapCipher({ blockSize: 64, nonceLength: 12, tagLength: 16 }, _poly1305_aead(chacha20)); -/** - * XChaCha20-Poly1305 extended-nonce chacha. - * - * Can be safely used with random nonces (CSPRNG). - * See [IRTF draft](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-xchacha). - */ -export const xchacha20poly1305 = /* @__PURE__ */ wrapCipher({ blockSize: 64, nonceLength: 24, tagLength: 16 }, _poly1305_aead(xchacha20)); -//# sourceMappingURL=chacha.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/chacha.js.map b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/chacha.js.map deleted file mode 100644 index d550fa23..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/chacha.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"chacha.js","sourceRoot":"","sources":["../src/chacha.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAIL,KAAK,EACL,UAAU,EACV,SAAS,EACT,UAAU,EACV,UAAU,GACX,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,kBAAkB;AAClB,SAAS,UAAU,CACjB,CAAc,EAAE,CAAc,EAAE,CAAc,EAAE,GAAgB,EAAE,GAAW,EAAE,MAAM,GAAG,EAAE;IAE1F,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,kCAAkC;IACpF,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAI,+BAA+B;IACjF,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAI,+BA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GAAG,CAAC,CAAC;YACX,OAAO,MAAM,CAAC;QAChB,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAEJ;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAc,eAAe,CAAC,UAAU,CACnE,EAAE,SAAS,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,EACjD,cAAc,CAAC,QAAQ,CAAC,CACzB,CAAC;AACF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAc,eAAe,CAAC,UAAU,CACpE,EAAE,SAAS,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,EACjD,cAAc,CAAC,SAAS,CAAC,CAC1B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/crypto.d.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/crypto.d.ts deleted file mode 100644 index ac181a02..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/crypto.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const crypto: any; -//# sourceMappingURL=crypto.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/crypto.d.ts.map b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/crypto.d.ts.map deleted file mode 100644 index 756d9820..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/crypto.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../src/crypto.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,MAAM,EAAE,GACqE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/crypto.js b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/crypto.js deleted file mode 100644 index 8d499a08..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/crypto.js +++ /dev/null @@ -1,2 +0,0 @@ -export const crypto = typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined; -//# sourceMappingURL=crypto.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/crypto.js.map b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/crypto.js.map deleted file mode 100644 index 9ad4f45b..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/crypto.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../src/crypto.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,MAAM,GACjB,OAAO,UAAU,KAAK,QAAQ,IAAI,QAAQ,IAAI,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/cryptoNode.d.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/cryptoNode.d.ts deleted file mode 100644 index 98bda7be..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/cryptoNode.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const crypto: any; -//# sourceMappingURL=cryptoNode.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/cryptoNode.d.ts.map b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/cryptoNode.d.ts.map deleted file mode 100644 index 90dcc444..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/cryptoNode.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cryptoNode.d.ts","sourceRoot":"","sources":["../src/cryptoNode.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,MAAM,EAAE,GAKJ,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/cryptoNode.js b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/cryptoNode.js deleted file mode 100644 index 4f77e8f4..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/cryptoNode.js +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Internal webcrypto alias. - * We prefer WebCrypto aka globalThis.crypto, which exists in node.js 16+. - * Falls back to Node.js built-in crypto for Node.js <=v14. - * See utils.ts for details. - * @module - */ -// @ts-ignore -import * as nc from 'node:crypto'; -export const crypto = nc && typeof nc === 'object' && 'webcrypto' in nc - ? nc.webcrypto - : nc && typeof nc === 'object' && 'randomBytes' in nc - ? nc - : undefined; -//# sourceMappingURL=cryptoNode.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/cryptoNode.js.map b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/cryptoNode.js.map deleted file mode 100644 index 6b07d8a6..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/cryptoNode.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cryptoNode.js","sourceRoot":"","sources":["../src/cryptoNode.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,aAAa;AACb,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,MAAM,CAAC,MAAM,MAAM,GACjB,EAAE,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,WAAW,IAAI,EAAE;IAC/C,CAAC,CAAE,EAAE,CAAC,SAAiB;IACvB,CAAC,CAAC,EAAE,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,aAAa,IAAI,EAAE;QACnD,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,SAAS,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/ff1.d.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/ff1.d.ts deleted file mode 100644 index 00e1a60d..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/ff1.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { type Cipher } from './utils.ts'; -/** FPE-FF1 format-preserving encryption */ -export declare function FF1(radix: number, key: Uint8Array, tweak?: Uint8Array): { - encrypt(x: number[]): number[]; - decrypt(x: number[]): number[]; -}; -/** Binary version of FPE-FF1 format-preserving encryption. */ -export declare function BinaryFF1(key: Uint8Array, tweak?: Uint8Array): Cipher; -//# sourceMappingURL=ff1.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/ff1.d.ts.map b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/ff1.d.ts.map deleted file mode 100644 index 806fc9c2..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/ff1.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ff1.d.ts","sourceRoot":"","sources":["../src/ff1.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,MAAM,EAA4D,MAAM,YAAY,CAAC;AA0FnG,2CAA2C;AAC3C,wBAAgB,GAAG,CACjB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,UAAU,EACf,KAAK,GAAE,UAAsB,GAC5B;IAAE,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;IAAC,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAA;CAAE,CAgCpE;AAqBD,8DAA8D;AAC9D,wBAAgB,SAAS,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,GAAE,UAAsB,GAAG,MAAM,CAMhF"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/ff1.js b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/ff1.js deleted file mode 100644 index b8d1ec10..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/ff1.js +++ /dev/null @@ -1,160 +0,0 @@ -/** - * FPE-FF1 (Format-preserving encryption algorithm) specified in - * [NIST 800-38G](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-38G.pdf). - * @module - */ -import { unsafe } from "./aes.js"; -import { abytes, anumber, bytesToNumberBE, clean, numberToBytesBE } from "./utils.js"; -// NOTE: no point in inlining encrypt instead of encryptBlock, since BigInt stuff will be slow -const { expandKeyLE, encryptBlock } = unsafe; -// Format-preserving encryption algorithm (FPE-FF1) specified in NIST Special Publication 800-38G. -// https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-38G.pdf -const BLOCK_LEN = 16; -function mod(a, b) { - const result = a % b; - return result >= 0 ? result : b + result; -} -function NUMradix(radix, data) { - let res = BigInt(0); - for (let i of data) - res = res * BigInt(radix) + BigInt(i); - return res; -} -function getRound(radix, key, tweak, x) { - if (radix > 2 ** 16 - 1) - throw new Error('invalid radix ' + radix); - // radix**minlen ≥ 100 - const minLen = Math.ceil(Math.log(100) / Math.log(radix)); - const maxLen = 2 ** 32 - 1; - // 2 ≤ minlen ≤ maxlen < 2**32 - if (2 > minLen || minLen > maxLen || maxLen >= 2 ** 32) - throw new Error('Invalid radix: 2 ≤ minlen ≤ maxlen < 2**32'); - if (!Array.isArray(x)) - throw new Error('invalid X'); - if (x.length < minLen || x.length > maxLen) - throw new Error('X is outside minLen..maxLen bounds'); - const u = Math.floor(x.length / 2); - const v = x.length - u; - const b = Math.ceil(Math.ceil(v * Math.log2(radix)) / 8); - const d = 4 * Math.ceil(b / 4) + 4; - const padding = mod(-tweak.length - b - 1, 16); - // P = [1]1 || [2]1 || [1]1 || [radix]3 || [10]1 || [u mod 256]1 || [n]4 || [t]4. - const P = Uint8Array.from([1, 2, 1, 0, 0, 0, 10, u, 0, 0, 0, 0, 0, 0, 0, 0]); - const view = new DataView(P.buffer); - view.setUint16(4, radix, false); - view.setUint32(8, x.length, false); - view.setUint32(12, tweak.length, false); - // Q = T || [0](−t−b−1) mod 16 || [i]1 || [NUMradix(B)]b. - const PQ = new Uint8Array(P.length + tweak.length + padding + 1 + b); - PQ.set(P); - clean(P); - PQ.set(tweak, P.length); - const xk = expandKeyLE(key); - const round = (A, B, i, decrypt = false) => { - // Q = ... || [i]1 || [NUMradix(B)]b. - PQ[PQ.length - b - 1] = i; - if (b) - PQ.set(numberToBytesBE(NUMradix(radix, B), b), PQ.length - b); - // PRF - let r = new Uint8Array(16); - for (let j = 0; j < PQ.length / BLOCK_LEN; j++) { - for (let i = 0; i < BLOCK_LEN; i++) - r[i] ^= PQ[j * BLOCK_LEN + i]; - encryptBlock(xk, r); - } - // Let S be the first d bytes of the following string of ⎡d/16⎤ blocks: - // R || CIPHK(R ⊕[1]16) || CIPHK(R ⊕[2]16) ...CIPHK(R ⊕[⎡d / 16⎤ – 1]16). - let s = Array.from(r); - for (let j = 1; s.length < d; j++) { - const block = numberToBytesBE(BigInt(j), 16); - for (let k = 0; k < BLOCK_LEN; k++) - block[k] ^= r[k]; - s.push(...Array.from(encryptBlock(xk, block))); - } - let y = bytesToNumberBE(Uint8Array.from(s.slice(0, d))); - s.fill(0); - if (decrypt) - y = -y; - const m = i % 2 === 0 ? u : v; - let c = mod(NUMradix(radix, A) + y, BigInt(radix) ** BigInt(m)); - // STR(radix, m, c) - const C = Array(m).fill(0); - for (let i = 0; i < m; i++, c /= BigInt(radix)) - C[m - 1 - i] = Number(c % BigInt(radix)); - A.fill(0); - A = B; - B = C; - return [A, B]; - }; - const destroy = () => { - clean(xk, PQ); - }; - return { u, round, destroy }; -} -const EMPTY_BUF = /* @__PURE__ */ Uint8Array.of(); -/** FPE-FF1 format-preserving encryption */ -export function FF1(radix, key, tweak = EMPTY_BUF) { - anumber(radix); - abytes(key); - abytes(tweak); - const PQ = getRound.bind(null, radix, key, tweak); - return { - encrypt(x) { - const { u, round, destroy } = PQ(x); - let [A, B] = [x.slice(0, u), x.slice(u)]; - for (let i = 0; i < 10; i++) - [A, B] = round(A, B, i); - destroy(); - const res = A.concat(B); - A.fill(0); - B.fill(0); - return res; - }, - decrypt(x) { - const { u, round, destroy } = PQ(x); - // The FF1.Decrypt algorithm is similar to the FF1.Encrypt algorithm; - // the differences are in Step 6, where: - // 1) the order of the indices is reversed, - // 2) the roles of A and B are swapped - // 3) modular addition is replaced by modular subtraction, in Step 6vi. - let [B, A] = [x.slice(0, u), x.slice(u)]; - for (let i = 9; i >= 0; i--) - [A, B] = round(A, B, i, true); - destroy(); - const res = B.concat(A); - A.fill(0); - B.fill(0); - return res; - }, - }; -} -// Binary string which encodes each byte in little-endian byte order -const binLE = { - encode(bytes) { - const x = []; - for (let i = 0; i < bytes.length; i++) { - for (let j = 0, tmp = bytes[i]; j < 8; j++, tmp >>= 1) - x.push(tmp & 1); - } - return x; - }, - decode(b) { - if (!Array.isArray(b) || b.length % 8) - throw new Error('Invalid binary string'); - const res = new Uint8Array(b.length / 8); - for (let i = 0, j = 0; i < res.length; i++) { - res[i] = b[j++] | (b[j++] << 1) | (b[j++] << 2) | (b[j++] << 3); - res[i] |= (b[j++] << 4) | (b[j++] << 5) | (b[j++] << 6) | (b[j++] << 7); - } - return res; - }, -}; -/** Binary version of FPE-FF1 format-preserving encryption. */ -export function BinaryFF1(key, tweak = EMPTY_BUF) { - const ff1 = FF1(2, key, tweak); - return { - encrypt: (x) => binLE.decode(ff1.encrypt(binLE.encode(x))), - decrypt: (x) => binLE.decode(ff1.decrypt(binLE.encode(x))), - }; -} -//# sourceMappingURL=ff1.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/ff1.js.map b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/ff1.js.map deleted file mode 100644 index 006b4f59..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/ff1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ff1.js","sourceRoot":"","sources":["../src/ff1.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAe,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;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AAe,EAAE,QAAoB,SAAS;IACtE,MAAM,GAAG,GAAG,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IAC/B,OAAO;QACL,OAAO,EAAE,CAAC,CAAa,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QACtE,OAAO,EAAE,CAAC,CAAa,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;KACvE,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/index.d.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/index.d.ts deleted file mode 100644 index e26a57a8..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/index.d.ts.map b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/index.d.ts.map deleted file mode 100644 index 535b86d2..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/index.js b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/index.js deleted file mode 100644 index 84961f27..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/index.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Audited & minimal JS implementation of Salsa20, ChaCha and AES. Check out individual modules. - * @example -```js -import { gcm, siv } from '@noble/ciphers/aes'; -import { xsalsa20poly1305 } from '@noble/ciphers/salsa'; -import { secretbox } from '@noble/ciphers/salsa'; // == xsalsa20poly1305 -import { chacha20poly1305, xchacha20poly1305 } from '@noble/ciphers/chacha'; - -// Unauthenticated encryption: make sure to use HMAC or similar -import { ctr, cfb, cbc, ecb } from '@noble/ciphers/aes'; -import { salsa20, xsalsa20 } from '@noble/ciphers/salsa'; -import { chacha20, xchacha20, chacha8, chacha12 } from '@noble/ciphers/chacha'; - -// KW -import { aeskw, aeskwp } from '@noble/ciphers/aes'; - -// Utilities -import { bytesToHex, hexToBytes, bytesToUtf8, utf8ToBytes } from '@noble/ciphers/utils'; -import { managedNonce, randomBytes } from '@noble/ciphers/webcrypto'; -import { poly1305 } from '@noble/ciphers/_poly1305'; -import { ghash, polyval } from '@noble/ciphers/_polyval'; -``` - * @module - */ -throw new Error('root module cannot be imported: import submodules instead. Check out README'); -export {}; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/index.js.map b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/index.js.map deleted file mode 100644 index bd1a66b3..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,IAAI,KAAK,CAAC,6EAA6E,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/package.json b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/package.json deleted file mode 100644 index f42e46b1..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "module", - "sideEffects": false, - "browser": { - "node:crypto": false - }, - "node": { - "./crypto": "./esm/cryptoNode.js" - } -} diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/salsa.d.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/salsa.d.ts deleted file mode 100644 index dc5931c6..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/salsa.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { type ARXCipher, type XorStream } from './utils.ts'; -/** - * hsalsa hashing function, used primarily in xsalsa, to hash - * key and nonce into key' and nonce'. - * Same as salsaCore, but there doesn't seem to be a way to move the block - * out without 25% performance hit. - */ -export declare function hsalsa(s: Uint32Array, k: Uint32Array, i: Uint32Array, o32: Uint32Array): void; -/** - * Salsa20 from original paper. - * Unsafe to use random nonces under the same key, due to collision chance. - * Prefer XSalsa instead. - */ -export declare const salsa20: XorStream; -/** - * xsalsa20 eXtended-nonce salsa. - * Can be safely used with random 24-byte nonces (CSPRNG). - */ -export declare const xsalsa20: XorStream; -/** - * xsalsa20-poly1305 eXtended-nonce salsa. - * Can be safely used with random 24-byte nonces (CSPRNG). - * Also known as secretbox from libsodium / nacl. - */ -export declare const xsalsa20poly1305: ARXCipher; -/** - * Alias to `xsalsa20poly1305`, for compatibility with libsodium / nacl - */ -export declare function secretbox(key: Uint8Array, nonce: Uint8Array): { - seal: (plaintext: Uint8Array, output?: Uint8Array) => Uint8Array; - open: (ciphertext: Uint8Array, output?: Uint8Array) => Uint8Array; -}; -//# sourceMappingURL=salsa.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/salsa.d.ts.map b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/salsa.d.ts.map deleted file mode 100644 index c7ad02ab..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/salsa.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"salsa.d.ts","sourceRoot":"","sources":["../src/salsa.ts"],"names":[],"mappings":"AAiBA,OAAO,EAEL,KAAK,SAAS,EAMd,KAAK,SAAS,EACf,MAAM,YAAY,CAAC;AA+CpB;;;;;GAKG;AAEH,wBAAgB,MAAM,CACpB,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,EAAE,GAAG,EAAE,WAAW,GAC/D,IAAI,CA4BN;AAED;;;;GAIG;AACH,eAAO,MAAM,OAAO,EAAE,SAGpB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,SAGrB,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAsC9B,CAAC;AAEF;;GAEG;AACH,wBAAgB,SAAS,CACvB,GAAG,EAAE,UAAU,EACf,KAAK,EAAE,UAAU,GAChB;IACD,IAAI,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,UAAU,KAAK,UAAU,CAAC;IACjE,IAAI,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,UAAU,KAAK,UAAU,CAAC;CACnE,CAGA"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/salsa.js b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/salsa.js deleted file mode 100644 index 744267e0..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/salsa.js +++ /dev/null @@ -1,201 +0,0 @@ -/** - * [Salsa20](https://cr.yp.to/snuffle.html) stream cipher, released in 2005. - * - * Salsa's goal was to implement AES replacement that does not rely on S-Boxes, - * which are hard to implement in a constant-time manner. - * Salsa20 is usually faster than AES, a big deal on slow, budget mobile phones. - * - * [XSalsa20](https://cr.yp.to/snuffle/xsalsa-20110204.pdf), extended-nonce - * variant was released in 2008. It switched nonces from 96-bit to 192-bit, - * and became safe to be picked at random. - * - * Check out [PDF](https://cr.yp.to/snuffle/salsafamily-20071225.pdf) and - * [wiki](https://en.wikipedia.org/wiki/Salsa20). - * @module - */ -import { createCipher, rotl } from "./_arx.js"; -import { poly1305 } from "./_poly1305.js"; -import { abytes, clean, equalBytes, getOutput, wrapCipher, } from "./utils.js"; -/** Salsa20 core function. */ -// prettier-ignore -function salsaCore(s, k, n, out, cnt, rounds = 20) { - // Based on https://cr.yp.to/salsa20.html - let y00 = s[0], y01 = k[0], y02 = k[1], y03 = k[2], // "expa" Key Key Key - y04 = k[3], y05 = s[1], y06 = n[0], y07 = n[1], // Key "nd 3" Nonce Nonce - y08 = cnt, y09 = 0, y10 = s[2], y11 = k[4], // Pos. Pos. "2-by" Key - y12 = k[5], y13 = k[6], y14 = k[7], y15 = s[3]; // Key Key Key "te k" - // Save state to temporary variables - let x00 = y00, x01 = y01, x02 = y02, x03 = y03, x04 = y04, x05 = y05, x06 = y06, x07 = y07, x08 = y08, x09 = y09, x10 = y10, x11 = y11, x12 = y12, x13 = y13, x14 = y14, x15 = y15; - for (let r = 0; r < rounds; r += 2) { - x04 ^= rotl(x00 + x12 | 0, 7); - x08 ^= rotl(x04 + x00 | 0, 9); - x12 ^= rotl(x08 + x04 | 0, 13); - x00 ^= rotl(x12 + x08 | 0, 18); - x09 ^= rotl(x05 + x01 | 0, 7); - x13 ^= rotl(x09 + x05 | 0, 9); - x01 ^= rotl(x13 + x09 | 0, 13); - x05 ^= rotl(x01 + x13 | 0, 18); - x14 ^= rotl(x10 + x06 | 0, 7); - x02 ^= rotl(x14 + x10 | 0, 9); - x06 ^= rotl(x02 + x14 | 0, 13); - x10 ^= rotl(x06 + x02 | 0, 18); - x03 ^= rotl(x15 + x11 | 0, 7); - x07 ^= rotl(x03 + x15 | 0, 9); - x11 ^= rotl(x07 + x03 | 0, 13); - x15 ^= rotl(x11 + x07 | 0, 18); - x01 ^= rotl(x00 + x03 | 0, 7); - x02 ^= rotl(x01 + x00 | 0, 9); - x03 ^= rotl(x02 + x01 | 0, 13); - x00 ^= rotl(x03 + x02 | 0, 18); - x06 ^= rotl(x05 + x04 | 0, 7); - x07 ^= rotl(x06 + x05 | 0, 9); - x04 ^= rotl(x07 + x06 | 0, 13); - x05 ^= rotl(x04 + x07 | 0, 18); - x11 ^= rotl(x10 + x09 | 0, 7); - x08 ^= rotl(x11 + x10 | 0, 9); - x09 ^= rotl(x08 + x11 | 0, 13); - x10 ^= rotl(x09 + x08 | 0, 18); - x12 ^= rotl(x15 + x14 | 0, 7); - x13 ^= rotl(x12 + x15 | 0, 9); - x14 ^= rotl(x13 + x12 | 0, 13); - x15 ^= rotl(x14 + x13 | 0, 18); - } - // Write output - let oi = 0; - out[oi++] = (y00 + x00) | 0; - out[oi++] = (y01 + x01) | 0; - out[oi++] = (y02 + x02) | 0; - out[oi++] = (y03 + x03) | 0; - out[oi++] = (y04 + x04) | 0; - out[oi++] = (y05 + x05) | 0; - out[oi++] = (y06 + x06) | 0; - out[oi++] = (y07 + x07) | 0; - out[oi++] = (y08 + x08) | 0; - out[oi++] = (y09 + x09) | 0; - out[oi++] = (y10 + x10) | 0; - out[oi++] = (y11 + x11) | 0; - out[oi++] = (y12 + x12) | 0; - out[oi++] = (y13 + x13) | 0; - out[oi++] = (y14 + x14) | 0; - out[oi++] = (y15 + x15) | 0; -} -/** - * hsalsa hashing function, used primarily in xsalsa, to hash - * key and nonce into key' and nonce'. - * Same as salsaCore, but there doesn't seem to be a way to move the block - * out without 25% performance hit. - */ -// prettier-ignore -export function hsalsa(s, k, i, o32) { - let x00 = s[0], x01 = k[0], x02 = k[1], x03 = k[2], x04 = k[3], x05 = s[1], x06 = i[0], x07 = i[1], x08 = i[2], x09 = i[3], x10 = s[2], x11 = k[4], x12 = k[5], x13 = k[6], x14 = k[7], x15 = s[3]; - for (let r = 0; r < 20; r += 2) { - x04 ^= rotl(x00 + x12 | 0, 7); - x08 ^= rotl(x04 + x00 | 0, 9); - x12 ^= rotl(x08 + x04 | 0, 13); - x00 ^= rotl(x12 + x08 | 0, 18); - x09 ^= rotl(x05 + x01 | 0, 7); - x13 ^= rotl(x09 + x05 | 0, 9); - x01 ^= rotl(x13 + x09 | 0, 13); - x05 ^= rotl(x01 + x13 | 0, 18); - x14 ^= rotl(x10 + x06 | 0, 7); - x02 ^= rotl(x14 + x10 | 0, 9); - x06 ^= rotl(x02 + x14 | 0, 13); - x10 ^= rotl(x06 + x02 | 0, 18); - x03 ^= rotl(x15 + x11 | 0, 7); - x07 ^= rotl(x03 + x15 | 0, 9); - x11 ^= rotl(x07 + x03 | 0, 13); - x15 ^= rotl(x11 + x07 | 0, 18); - x01 ^= rotl(x00 + x03 | 0, 7); - x02 ^= rotl(x01 + x00 | 0, 9); - x03 ^= rotl(x02 + x01 | 0, 13); - x00 ^= rotl(x03 + x02 | 0, 18); - x06 ^= rotl(x05 + x04 | 0, 7); - x07 ^= rotl(x06 + x05 | 0, 9); - x04 ^= rotl(x07 + x06 | 0, 13); - x05 ^= rotl(x04 + x07 | 0, 18); - x11 ^= rotl(x10 + x09 | 0, 7); - x08 ^= rotl(x11 + x10 | 0, 9); - x09 ^= rotl(x08 + x11 | 0, 13); - x10 ^= rotl(x09 + x08 | 0, 18); - x12 ^= rotl(x15 + x14 | 0, 7); - x13 ^= rotl(x12 + x15 | 0, 9); - x14 ^= rotl(x13 + x12 | 0, 13); - x15 ^= rotl(x14 + x13 | 0, 18); - } - let oi = 0; - o32[oi++] = x00; - o32[oi++] = x05; - o32[oi++] = x10; - o32[oi++] = x15; - o32[oi++] = x06; - o32[oi++] = x07; - o32[oi++] = x08; - o32[oi++] = x09; -} -/** - * Salsa20 from original paper. - * Unsafe to use random nonces under the same key, due to collision chance. - * Prefer XSalsa instead. - */ -export const salsa20 = /* @__PURE__ */ createCipher(salsaCore, { - allowShortKeys: true, - counterRight: true, -}); -/** - * xsalsa20 eXtended-nonce salsa. - * Can be safely used with random 24-byte nonces (CSPRNG). - */ -export const xsalsa20 = /* @__PURE__ */ createCipher(salsaCore, { - counterRight: true, - extendNonceFn: hsalsa, -}); -/** - * xsalsa20-poly1305 eXtended-nonce salsa. - * Can be safely used with random 24-byte nonces (CSPRNG). - * Also known as secretbox from libsodium / nacl. - */ -export const xsalsa20poly1305 = /* @__PURE__ */ wrapCipher({ blockSize: 64, nonceLength: 24, tagLength: 16 }, (key, nonce) => { - return { - encrypt(plaintext, output) { - // xsalsa20poly1305 optimizes by calculating auth key during the same call as encryption. - // Unfortunately, makes it hard to separate tag calculation & encryption itself, - // because 32 bytes is half-block of 64-byte salsa. - output = getOutput(plaintext.length + 32, output, false); // need 32 additional bytes, see above - const authKey = output.subarray(0, 32); // output[0..32] = poly1305 auth key - const ciphPlaintext = output.subarray(32); // output[32..] = plaintext, then ciphertext - output.set(plaintext, 32); - clean(authKey); // authKey is produced by xoring with zeros - xsalsa20(key, nonce, output, output); // output = stream ^ output; authKey = stream ^ zeros(32) - const tag = poly1305(ciphPlaintext, authKey); // calculate tag over ciphertext - output.set(tag, 16); // output[16..32] = tag - clean(output.subarray(0, 16), tag); // clean-up authKey remnants & copy of tag - return output.subarray(16); // return output[16..] - }, - decrypt(ciphertext, output) { - // tmp part passed tag ciphertext - // [0..32] [32..48] [48..] - abytes(ciphertext); - output = getOutput(ciphertext.length + 32, output, false); - const tmp = output.subarray(0, 32); // output[0..32] is used to calc authKey - const passedTag = output.subarray(32, 48); // output[32..48] = passed tag - const ciphPlaintext = output.subarray(48); // output[48..] = ciphertext, then plaintext - output.set(ciphertext, 32); // copy ciphertext into output - clean(tmp); // authKey is produced by xoring with zeros - const authKey = xsalsa20(key, nonce, tmp, tmp); // authKey = stream ^ zeros(32) - const tag = poly1305(ciphPlaintext, authKey); // calculate tag over ciphertext - if (!equalBytes(passedTag, tag)) - throw new Error('invalid tag'); - xsalsa20(key, nonce, output.subarray(16), output.subarray(16)); // output = stream ^ output[16..] - clean(tmp, passedTag, tag); - return ciphPlaintext; // return output[48..], skipping zeroized output[0..48] - }, - }; -}); -/** - * Alias to `xsalsa20poly1305`, for compatibility with libsodium / nacl - */ -export function secretbox(key, nonce) { - const xs = xsalsa20poly1305(key, nonce); - return { seal: xs.encrypt, open: xs.decrypt }; -} -//# sourceMappingURL=salsa.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/salsa.js.map b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/salsa.js.map deleted file mode 100644 index 48c6847d..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/salsa.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"salsa.js","sourceRoot":"","sources":["../src/salsa.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EACL,MAAM,EAGN,KAAK,EACL,UAAU,EACV,SAAS,EACT,UAAU,GAEX,MAAM,YAAY,CAAC;AAEpB,6BAA6B;AAC7B,kBAAkB;AAClB,SAAS,SAAS,CAChB,CAAc,EAAE,CAAc,EAAE,CAAc,EAAE,GAAgB,EAAE,GAAW,EAAE,MAAM,GAAG,EAAE;IAE1F,yCAAyC;IACzC,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,6BAA6B;IAC7E,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,+BAA+B;IAC/E,GAAG,GAAG,GAAG,EAAG,GAAG,GAAG,CAAC,EAAK,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,4BAA4B;IAC5E,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAA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AC,CAAC,gCAAgC;YAC9E,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,GAAG,CAAC;gBAAE,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAC;YAChE,QAAQ,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,iCAAiC;YACjG,KAAK,CAAC,GAAG,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;YAC3B,OAAO,aAAa,CAAC,CAAC,uDAAuD;QAC/E,CAAC;KACF,CAAC;AACJ,CAAC,CACF,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,SAAS,CACvB,GAAe,EACf,KAAiB;IAKjB,MAAM,EAAE,GAAG,gBAAgB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACxC,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC;AAChD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/utils.d.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/utils.d.ts deleted file mode 100644 index 5194ed08..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/utils.d.ts +++ /dev/null @@ -1,155 +0,0 @@ -/** - * Utilities for hex, bytes, CSPRNG. - * @module - */ -/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */ -/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */ -export declare function isBytes(a: unknown): a is Uint8Array; -/** Asserts something is boolean. */ -export declare function abool(b: boolean): void; -/** Asserts something is positive integer. */ -export declare function anumber(n: number): void; -/** Asserts something is Uint8Array. */ -export declare function abytes(b: Uint8Array | undefined, ...lengths: number[]): void; -/** - * Asserts something is hash - * TODO: remove - * @deprecated - */ -export declare function ahash(h: IHash): void; -/** Asserts a hash instance has not been destroyed / finished */ -export declare function aexists(instance: any, checkFinished?: boolean): void; -/** Asserts output is properly-sized byte array */ -export declare function aoutput(out: any, instance: any): void; -export type IHash = { - (data: string | Uint8Array): Uint8Array; - blockLen: number; - outputLen: number; - create: any; -}; -/** Generic type encompassing 8/16/32-byte arrays - but not 64-byte. */ -export type TypedArray = Int8Array | Uint8ClampedArray | Uint8Array | Uint16Array | Int16Array | Uint32Array | Int32Array; -/** Cast u8 / u16 / u32 to u8. */ -export declare function u8(arr: TypedArray): Uint8Array; -/** Cast u8 / u16 / u32 to u32. */ -export declare function u32(arr: TypedArray): Uint32Array; -/** Zeroize a byte array. Warning: JS provides no guarantees. */ -export declare function clean(...arrays: TypedArray[]): void; -/** Create DataView of an array for easy byte-level manipulation. */ -export declare function createView(arr: TypedArray): DataView; -/** Is current platform little-endian? Most are. Big-Endian platform: IBM */ -export declare const isLE: boolean; -/** - * Convert byte array to hex string. Uses built-in function, when available. - * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123' - */ -export declare function bytesToHex(bytes: Uint8Array): string; -/** - * Convert hex string to byte array. Uses built-in function, when available. - * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23]) - */ -export declare function hexToBytes(hex: string): Uint8Array; -export declare function hexToNumber(hex: string): bigint; -export declare function bytesToNumberBE(bytes: Uint8Array): bigint; -export declare function numberToBytesBE(n: number | bigint, len: number): Uint8Array; -export declare const nextTick: () => Promise; -/** - * Converts string to bytes using UTF8 encoding. - * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99]) - */ -export declare function utf8ToBytes(str: string): Uint8Array; -/** - * Converts bytes to string using UTF8 encoding. - * @example bytesToUtf8(new Uint8Array([97, 98, 99])) // 'abc' - */ -export declare function bytesToUtf8(bytes: Uint8Array): string; -export type Input = Uint8Array | string; -/** - * Normalizes (non-hex) string or Uint8Array to Uint8Array. - * Warning: when Uint8Array is passed, it would NOT get copied. - * Keep in mind for future mutable operations. - */ -export declare function toBytes(data: string | Uint8Array): Uint8Array; -/** - * Checks if two U8A use same underlying buffer and overlaps. - * This is invalid and can corrupt data. - */ -export declare function overlapBytes(a: Uint8Array, b: Uint8Array): boolean; -/** - * If input and output overlap and input starts before output, we will overwrite end of input before - * we start processing it, so this is not supported for most ciphers (except chacha/salse, which designed with this) - */ -export declare function complexOverlapBytes(input: Uint8Array, output: Uint8Array): void; -/** - * Copies several Uint8Arrays into one. - */ -export declare function concatBytes(...arrays: Uint8Array[]): Uint8Array; -type EmptyObj = {}; -export declare function checkOpts(defaults: T1, opts: T2): T1 & T2; -/** Compares 2 uint8array-s in kinda constant time. */ -export declare function equalBytes(a: Uint8Array, b: Uint8Array): boolean; -/** For runtime check if class implements interface. */ -export declare abstract class Hash> { - abstract blockLen: number; - abstract outputLen: number; - abstract update(buf: string | Uint8Array): this; - abstract digestInto(buf: Uint8Array): void; - abstract digest(): Uint8Array; - /** - * Resets internal state. Makes Hash instance unusable. - * Reset is impossible for keyed hashes if key is consumed into state. If digest is not consumed - * by user, they will need to manually call `destroy()` when zeroing is necessary. - */ - abstract destroy(): void; -} -/** Sync cipher: takes byte array and returns byte array. */ -export type Cipher = { - encrypt(plaintext: Uint8Array): Uint8Array; - decrypt(ciphertext: Uint8Array): Uint8Array; -}; -/** Async cipher e.g. from built-in WebCrypto. */ -export type AsyncCipher = { - encrypt(plaintext: Uint8Array): Promise; - decrypt(ciphertext: Uint8Array): Promise; -}; -/** Cipher with `output` argument which can optimize by doing 1 less allocation. */ -export type CipherWithOutput = Cipher & { - encrypt(plaintext: Uint8Array, output?: Uint8Array): Uint8Array; - decrypt(ciphertext: Uint8Array, output?: Uint8Array): Uint8Array; -}; -/** - * Params are outside of return type, so it is accessible before calling constructor. - * If function support multiple nonceLength's, we return the best one. - */ -export type CipherParams = { - blockSize: number; - nonceLength?: number; - tagLength?: number; - varSizeNonce?: boolean; -}; -/** ARX cipher, like salsa or chacha. */ -export type ARXCipher = ((key: Uint8Array, nonce: Uint8Array, AAD?: Uint8Array) => CipherWithOutput) & { - blockSize: number; - nonceLength: number; - tagLength: number; -}; -export type CipherCons = (key: Uint8Array, ...args: T) => Cipher; -/** - * Wraps a cipher: validates args, ensures encrypt() can only be called once. - * @__NO_SIDE_EFFECTS__ - */ -export declare const wrapCipher: , P extends CipherParams>(params: P, constructor: C) => C & P; -/** Represents salsa / chacha stream. */ -export type XorStream = (key: Uint8Array, nonce: Uint8Array, data: Uint8Array, output?: Uint8Array, counter?: number) => Uint8Array; -/** - * By default, returns u8a of length. - * When out is available, it checks it for validity and uses it. - */ -export declare function getOutput(expectedLength: number, out?: Uint8Array, onlyAligned?: boolean): Uint8Array; -/** Polyfill for Safari 14. */ -export declare function setBigUint64(view: DataView, byteOffset: number, value: bigint, isLE: boolean): void; -export declare function u64Lengths(dataLength: number, aadLength: number, isLE: boolean): Uint8Array; -export declare function isAligned32(bytes: Uint8Array): boolean; -export declare function copyBytes(bytes: Uint8Array): Uint8Array; -export {}; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/utils.d.ts.map b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/utils.d.ts.map deleted file mode 100644 index fe1a1ad9..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,uEAAuE;AAEvE,qFAAqF;AACrF,wBAAgB,OAAO,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,UAAU,CAEnD;AAED,oCAAoC;AACpC,wBAAgB,KAAK,CAAC,CAAC,EAAE,OAAO,GAAG,IAAI,CAEtC;AAED,6CAA6C;AAC7C,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAEvC;AAED,uCAAuC;AACvC,wBAAgB,MAAM,CA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ules/@noble/ciphers/esm/utils.js deleted file mode 100644 index 775865c3..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/utils.js +++ /dev/null @@ -1,339 +0,0 @@ -/** - * Utilities for hex, bytes, CSPRNG. - * @module - */ -/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */ -/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */ -export function isBytes(a) { - return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array'); -} -/** Asserts something is boolean. */ -export function abool(b) { - if (typeof b !== 'boolean') - throw new Error(`boolean expected, not ${b}`); -} -/** Asserts something is positive integer. */ -export function anumber(n) { - if (!Number.isSafeInteger(n) || n < 0) - throw new Error('positive integer expected, got ' + n); -} -/** Asserts something is Uint8Array. */ -export function abytes(b, ...lengths) { - if (!isBytes(b)) - throw new Error('Uint8Array expected'); - if (lengths.length > 0 && !lengths.includes(b.length)) - throw new Error('Uint8Array expected of length ' + lengths + ', got length=' + b.length); -} -/** - * Asserts something is hash - * TODO: remove - * @deprecated - */ -export function ahash(h) { - if (typeof h !== 'function' || typeof h.create !== 'function') - throw new Error('Hash should be wrapped by utils.createHasher'); - anumber(h.outputLen); - anumber(h.blockLen); -} -/** Asserts a hash instance has not been destroyed / finished */ -export function aexists(instance, checkFinished = true) { - if (instance.destroyed) - throw new Error('Hash instance has been destroyed'); - if (checkFinished && instance.finished) - throw new Error('Hash#digest() has already been called'); -} -/** Asserts output is properly-sized byte array */ -export function aoutput(out, instance) { - abytes(out); - const min = instance.outputLen; - if (out.length < min) { - throw new Error('digestInto() expects output buffer of length at least ' + min); - } -} -/** Cast u8 / u16 / u32 to u8. */ -export function u8(arr) { - return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength); -} -/** Cast u8 / u16 / u32 to u32. */ -export function u32(arr) { - return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); -} -/** Zeroize a byte array. Warning: JS provides no guarantees. */ -export function clean(...arrays) { - for (let i = 0; i < arrays.length; i++) { - arrays[i].fill(0); - } -} -/** Create DataView of an array for easy byte-level manipulation. */ -export function createView(arr) { - return new DataView(arr.buffer, arr.byteOffset, arr.byteLength); -} -/** Is current platform little-endian? Most are. Big-Endian platform: IBM */ -export const isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)(); -// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex -const hasHexBuiltin = /* @__PURE__ */ (() => -// @ts-ignore -typeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function')(); -// Array where index 0xf0 (240) is mapped to string 'f0' -const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0')); -/** - * Convert byte array to hex string. Uses built-in function, when available. - * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123' - */ -export function bytesToHex(bytes) { - abytes(bytes); - // @ts-ignore - if (hasHexBuiltin) - return bytes.toHex(); - // pre-caching improves the speed 6x - let hex = ''; - for (let i = 0; i < bytes.length; i++) { - hex += hexes[bytes[i]]; - } - return hex; -} -// We use optimized technique to convert hex string to byte array -const asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 }; -function asciiToBase16(ch) { - if (ch >= asciis._0 && ch <= asciis._9) - return ch - asciis._0; // '2' => 50-48 - if (ch >= asciis.A && ch <= asciis.F) - return ch - (asciis.A - 10); // 'B' => 66-(65-10) - if (ch >= asciis.a && ch <= asciis.f) - return ch - (asciis.a - 10); // 'b' => 98-(97-10) - return; -} -/** - * Convert hex string to byte array. Uses built-in function, when available. - * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23]) - */ -export function hexToBytes(hex) { - if (typeof hex !== 'string') - throw new Error('hex string expected, got ' + typeof hex); - // @ts-ignore - if (hasHexBuiltin) - return Uint8Array.fromHex(hex); - const hl = hex.length; - const al = hl / 2; - if (hl % 2) - throw new Error('hex string expected, got unpadded hex of length ' + hl); - const array = new Uint8Array(al); - for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) { - const n1 = asciiToBase16(hex.charCodeAt(hi)); - const n2 = asciiToBase16(hex.charCodeAt(hi + 1)); - if (n1 === undefined || n2 === undefined) { - const char = hex[hi] + hex[hi + 1]; - throw new Error('hex string expected, got non-hex character "' + char + '" at index ' + hi); - } - array[ai] = n1 * 16 + n2; // multiply first octet, e.g. 'a3' => 10*16+3 => 160 + 3 => 163 - } - return array; -} -// Used in micro -export function hexToNumber(hex) { - if (typeof hex !== 'string') - throw new Error('hex string expected, got ' + typeof hex); - return BigInt(hex === '' ? '0' : '0x' + hex); // Big Endian -} -// Used in ff1 -// BE: Big Endian, LE: Little Endian -export function bytesToNumberBE(bytes) { - return hexToNumber(bytesToHex(bytes)); -} -// Used in micro, ff1 -export function numberToBytesBE(n, len) { - return hexToBytes(n.toString(16).padStart(len * 2, '0')); -} -// TODO: remove -// There is no setImmediate in browser and setTimeout is slow. -// call of async fn will return Promise, which will be fullfiled only on -// next scheduler queue processing step and this is exactly what we need. -export const nextTick = async () => { }; -/** - * Converts string to bytes using UTF8 encoding. - * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99]) - */ -export function utf8ToBytes(str) { - if (typeof str !== 'string') - throw new Error('string expected'); - return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809 -} -/** - * Converts bytes to string using UTF8 encoding. - * @example bytesToUtf8(new Uint8Array([97, 98, 99])) // 'abc' - */ -export function bytesToUtf8(bytes) { - return new TextDecoder().decode(bytes); -} -/** - * Normalizes (non-hex) string or Uint8Array to Uint8Array. - * Warning: when Uint8Array is passed, it would NOT get copied. - * Keep in mind for future mutable operations. - */ -export function toBytes(data) { - if (typeof data === 'string') - data = utf8ToBytes(data); - else if (isBytes(data)) - data = copyBytes(data); - else - throw new Error('Uint8Array expected, got ' + typeof data); - return data; -} -/** - * Checks if two U8A use same underlying buffer and overlaps. - * This is invalid and can corrupt data. - */ -export function overlapBytes(a, b) { - return (a.buffer === b.buffer && // best we can do, may fail with an obscure Proxy - a.byteOffset < b.byteOffset + b.byteLength && // a starts before b end - b.byteOffset < a.byteOffset + a.byteLength // b starts before a end - ); -} -/** - * If input and output overlap and input starts before output, we will overwrite end of input before - * we start processing it, so this is not supported for most ciphers (except chacha/salse, which designed with this) - */ -export function complexOverlapBytes(input, output) { - // This is very cursed. It works somehow, but I'm completely unsure, - // reasoning about overlapping aligned windows is very hard. - if (overlapBytes(input, output) && input.byteOffset < output.byteOffset) - throw new Error('complex overlap of input and output is not supported'); -} -/** - * Copies several Uint8Arrays into one. - */ -export function concatBytes(...arrays) { - let sum = 0; - for (let i = 0; i < arrays.length; i++) { - const a = arrays[i]; - abytes(a); - sum += a.length; - } - const res = new Uint8Array(sum); - for (let i = 0, pad = 0; i < arrays.length; i++) { - const a = arrays[i]; - res.set(a, pad); - pad += a.length; - } - return res; -} -export function checkOpts(defaults, opts) { - if (opts == null || typeof opts !== 'object') - throw new Error('options must be defined'); - const merged = Object.assign(defaults, opts); - return merged; -} -/** Compares 2 uint8array-s in kinda constant time. */ -export function equalBytes(a, b) { - if (a.length !== b.length) - return false; - let diff = 0; - for (let i = 0; i < a.length; i++) - diff |= a[i] ^ b[i]; - return diff === 0; -} -// TODO: remove -/** For runtime check if class implements interface. */ -export class Hash { -} -/** - * Wraps a cipher: validates args, ensures encrypt() can only be called once. - * @__NO_SIDE_EFFECTS__ - */ -export const wrapCipher = (params, constructor) => { - function wrappedCipher(key, ...args) { - // Validate key - abytes(key); - // Big-Endian hardware is rare. Just in case someone still decides to run ciphers: - if (!isLE) - throw new Error('Non little-endian hardware is not yet supported'); - // Validate nonce if nonceLength is present - if (params.nonceLength !== undefined) { - const nonce = args[0]; - if (!nonce) - throw new Error('nonce / iv required'); - if (params.varSizeNonce) - abytes(nonce); - else - abytes(nonce, params.nonceLength); - } - // Validate AAD if tagLength present - const tagl = params.tagLength; - if (tagl && args[1] !== undefined) { - abytes(args[1]); - } - const cipher = constructor(key, ...args); - const checkOutput = (fnLength, output) => { - if (output !== undefined) { - if (fnLength !== 2) - throw new Error('cipher output not supported'); - abytes(output); - } - }; - // Create wrapped cipher with validation and single-use encryption - let called = false; - const wrCipher = { - encrypt(data, output) { - if (called) - throw new Error('cannot encrypt() twice with same key + nonce'); - called = true; - abytes(data); - checkOutput(cipher.encrypt.length, output); - return cipher.encrypt(data, output); - }, - decrypt(data, output) { - abytes(data); - if (tagl && data.length < tagl) - throw new Error('invalid ciphertext length: smaller than tagLength=' + tagl); - checkOutput(cipher.decrypt.length, output); - return cipher.decrypt(data, output); - }, - }; - return wrCipher; - } - Object.assign(wrappedCipher, params); - return wrappedCipher; -}; -/** - * By default, returns u8a of length. - * When out is available, it checks it for validity and uses it. - */ -export function getOutput(expectedLength, out, onlyAligned = true) { - if (out === undefined) - return new Uint8Array(expectedLength); - if (out.length !== expectedLength) - throw new Error('invalid output length, expected ' + expectedLength + ', got: ' + out.length); - if (onlyAligned && !isAligned32(out)) - throw new Error('invalid output, must be aligned'); - return out; -} -/** Polyfill for Safari 14. */ -export function setBigUint64(view, byteOffset, value, isLE) { - if (typeof view.setBigUint64 === 'function') - return view.setBigUint64(byteOffset, value, isLE); - const _32n = BigInt(32); - const _u32_max = BigInt(0xffffffff); - const wh = Number((value >> _32n) & _u32_max); - const wl = Number(value & _u32_max); - const h = isLE ? 4 : 0; - const l = isLE ? 0 : 4; - view.setUint32(byteOffset + h, wh, isLE); - view.setUint32(byteOffset + l, wl, isLE); -} -export function u64Lengths(dataLength, aadLength, isLE) { - abool(isLE); - const num = new Uint8Array(16); - const view = createView(num); - setBigUint64(view, 0, BigInt(aadLength), isLE); - setBigUint64(view, 8, BigInt(dataLength), isLE); - return num; -} -// Is byte array aligned to 4 byte offset (u32)? -export function isAligned32(bytes) { - return bytes.byteOffset % 4 === 0; -} -// copy bytes to new u8a (aligned). Because Buffer.slice is broken. -export function copyBytes(bytes) { - return Uint8Array.from(bytes); -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/utils.js.map b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/utils.js.map deleted file mode 100644 index 9ca248d5..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,uEAAuE;AAEvE,qFAAqF;AACrF,MAAM,UAAU,OAAO,CAAC,CAAU;IAChC,OAAO,CAAC,YAAY,UAAU,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC;AACnG,CAAC;AAED,oCAAoC;AACpC,MAAM,UAAU,KAAK,CAAC,CAAU;IAC9B,IAAI,OAAO,CAAC,KAAK,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,EAAE,CAAC,CAAC;AAC5E,CAAC;AAED,6CAA6C;AAC7C,MAAM,UAAU,OAAO,CAAC,CAAS;IAC/B,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,iCAAiC,GAAG,CAAC,CAAC,CAAC;AAChG,CAAC;AAED,uCAAuC;AACvC,MAAM,UAAU,MAAM,CAAC,CAAyB,EAAE,GAAG,OAAiB;IACpE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;IACxD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC;QACnD,MAAM,IAAI,KAAK,CAAC,gCAAgC,GAAG,OAAO,GAAG,eAAe,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ers/esm/webcrypto.d.ts deleted file mode 100644 index e79d0e4a..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/webcrypto.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { type AsyncCipher, type Cipher } from './utils.ts'; -/** - * Secure PRNG. Uses `crypto.getRandomValues`, which defers to OS. - */ -export declare function randomBytes(bytesLength?: number): Uint8Array; -export declare function getWebcryptoSubtle(): any; -type RemoveNonceInner = ((...args: T) => Ret) extends (arg0: any, arg1: any, ...rest: infer R) => any ? (key: Uint8Array, ...args: R) => Ret : never; -type RemoveNonce any> = RemoveNonceInner, ReturnType>; -type CipherWithNonce = ((key: Uint8Array, nonce: Uint8Array, ...args: any[]) => Cipher) & { - nonceLength: number; -}; -/** - * Uses CSPRG for nonce, nonce injected in ciphertext. - * @example - * const gcm = managedNonce(aes.gcm); - * const ciphr = gcm(key).encrypt(data); - * const plain = gcm(key).decrypt(ciph); - */ -export declare function managedNonce(fn: T): RemoveNonce; -export declare const utils: { - encrypt: (key: Uint8Array, ...all: any[]) => Promise; - decrypt: (key: Uint8Array, ...all: any[]) => Promise; -}; -/** AES-CBC, native webcrypto version */ -export declare const cbc: (key: Uint8Array, iv: Uint8Array) => AsyncCipher; -/** AES-CTR, native webcrypto version */ -export declare const ctr: (key: Uint8Array, nonce: Uint8Array) => AsyncCipher; -/** AES-GCM, native webcrypto version */ -export declare const gcm: (key: Uint8Array, nonce: Uint8Array, AAD?: Uint8Array) => AsyncCipher; -export {}; -//# sourceMappingURL=webcrypto.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/webcrypto.d.ts.map b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/webcrypto.d.ts.map deleted file mode 100644 index 9b5b9cef..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/webcrypto.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"webcrypto.d.ts","sourceRoot":"","sources":["../src/webcrypto.ts"],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AC;CAwBlE,CAAC;AA2CF,wCAAwC;AACxC,eAAO,MAAM,GAAG,EAAE,CAAC,GAAG,EAAE,UAAU,EAAE,EAAE,EAAE,UAAU,KAAK,WAChC,CAAC;AACxB,wCAAwC;AACxC,eAAO,MAAM,GAAG,EAAE,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,KAAK,WACnC,CAAC;AACxB,wCAAwC;AACxC,eAAO,MAAM,GAAG,EAAE,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,CAAC,EAAE,UAAU,KAAK,WAC9B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/webcrypto.js b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/webcrypto.js deleted file mode 100644 index 24ff38bc..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/webcrypto.js +++ /dev/null @@ -1,135 +0,0 @@ -/** - * WebCrypto-based AES gcm/ctr/cbc, `managedNonce` and `randomBytes`. - * We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+. - * node.js versions earlier than v19 don't declare it in global scope. - * For node.js, package.js on#exports field mapping rewrites import - * from `crypto` to `cryptoNode`, which imports native module. - * Makes the utils un-importable in browsers without a bundler. - * Once node.js 18 is deprecated, we can just drop the import. - * @module - */ -// Use full path so that Node.js can rewrite it to `cryptoNode.js`. -import { crypto } from '@noble/ciphers/crypto'; -import { abytes, anumber, concatBytes } from "./utils.js"; -/** - * Secure PRNG. Uses `crypto.getRandomValues`, which defers to OS. - */ -export function randomBytes(bytesLength = 32) { - if (crypto && typeof crypto.getRandomValues === 'function') { - return crypto.getRandomValues(new Uint8Array(bytesLength)); - } - // Legacy Node.js compatibility - if (crypto && typeof crypto.randomBytes === 'function') { - return Uint8Array.from(crypto.randomBytes(bytesLength)); - } - throw new Error('crypto.getRandomValues must be defined'); -} -export function getWebcryptoSubtle() { - if (crypto && typeof crypto.subtle === 'object' && crypto.subtle != null) - return crypto.subtle; - throw new Error('crypto.subtle must be defined'); -} -/** - * Uses CSPRG for nonce, nonce injected in ciphertext. - * @example - * const gcm = managedNonce(aes.gcm); - * const ciphr = gcm(key).encrypt(data); - * const plain = gcm(key).decrypt(ciph); - */ -export function managedNonce(fn) { - const { nonceLength } = fn; - anumber(nonceLength); - return ((key, ...args) => ({ - encrypt(plaintext, ...argsEnc) { - const nonce = randomBytes(nonceLength); - const ciphertext = fn(key, nonce, ...args).encrypt(plaintext, ...argsEnc); - const out = concatBytes(nonce, ciphertext); - ciphertext.fill(0); - return out; - }, - decrypt(ciphertext, ...argsDec) { - const nonce = ciphertext.subarray(0, nonceLength); - const data = ciphertext.subarray(nonceLength); - return fn(key, nonce, ...args).decrypt(data, ...argsDec); - }, - })); -} -// Overridable -// @TODO -export const utils = { - async encrypt(key, keyParams, cryptParams, plaintext) { - const cr = getWebcryptoSubtle(); - const iKey = await cr.importKey('raw', key, keyParams, true, ['encrypt']); - const ciphertext = await cr.encrypt(cryptParams, iKey, plaintext); - return new Uint8Array(ciphertext); - }, - async decrypt(key, keyParams, cryptParams, ciphertext) { - const cr = getWebcryptoSubtle(); - const iKey = await cr.importKey('raw', key, keyParams, true, ['decrypt']); - const plaintext = await cr.decrypt(cryptParams, iKey, ciphertext); - return new Uint8Array(plaintext); - }, -}; -const mode = { - CBC: 'AES-CBC', - CTR: 'AES-CTR', - GCM: 'AES-GCM', -}; -function getCryptParams(algo, nonce, AAD) { - if (algo === mode.CBC) - return { name: mode.CBC, iv: nonce }; - if (algo === mode.CTR) - return { name: mode.CTR, counter: nonce, length: 64 }; - if (algo === mode.GCM) { - if (AAD) - return { name: mode.GCM, iv: nonce, additionalData: AAD }; - else - return { name: mode.GCM, iv: nonce }; - } - throw new Error('unknown aes block mode'); -} -function generate(algo) { - return (key, nonce, AAD) => { - abytes(key); - abytes(nonce); - const keyParams = { name: algo, length: key.length * 8 }; - const cryptParams = getCryptParams(algo, nonce, AAD); - let consumed = false; - return { - // keyLength, - encrypt(plaintext) { - abytes(plaintext); - if (consumed) - throw new Error('Cannot encrypt() twice with same key / nonce'); - consumed = true; - return utils.encrypt(key, keyParams, cryptParams, plaintext); - }, - decrypt(ciphertext) { - abytes(ciphertext); - return utils.decrypt(key, keyParams, cryptParams, ciphertext); - }, - }; - }; -} -/** AES-CBC, native webcrypto version */ -export const cbc = /* @__PURE__ */ (() => generate(mode.CBC))(); -/** AES-CTR, native webcrypto version */ -export const ctr = /* @__PURE__ */ (() => generate(mode.CTR))(); -/** AES-GCM, native webcrypto version */ -export const gcm = -/* @__PURE__ */ (() => generate(mode.GCM))(); -// // Type tests -// import { siv, gcm, ctr, ecb, cbc } from '../aes.ts'; -// import { xsalsa20poly1305 } from '../salsa.ts'; -// import { chacha20poly1305, xchacha20poly1305 } from '../chacha.ts'; -// const wsiv = managedNonce(siv); -// const wgcm = managedNonce(gcm); -// const wctr = managedNonce(ctr); -// const wcbc = managedNonce(cbc); -// const wsalsapoly = managedNonce(xsalsa20poly1305); -// const wchacha = managedNonce(chacha20poly1305); -// const wxchacha = managedNonce(xchacha20poly1305); -// // should fail -// const wcbc2 = managedNonce(managedNonce(cbc)); -// const wctr = managedNonce(ctr); -//# sourceMappingURL=webcrypto.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/webcrypto.js.map b/tools/mnemonic-test/node_modules/@noble/ciphers/esm/webcrypto.js.map deleted file mode 100644 index 2af135d3..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/esm/webcrypto.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"webcrypto.js","sourceRoot":"","sources":["../src/webcrypto.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,mEAAmE;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,OAAO,EAAiC,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzF;;GAEG;AACH,MAA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,aAAa;YACb,OAAO,CAAC,SAAqB;gBAC3B,MAAM,CAAC,SAAS,CAAC,CAAC;gBAClB,IAAI,QAAQ;oBAAE,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;gBAC9E,QAAQ,GAAG,IAAI,CAAC;gBAChB,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;YAC/D,CAAC;YACD,OAAO,CAAC,UAAsB;gBAC5B,MAAM,CAAC,UAAU,CAAC,CAAC;gBACnB,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;YAChE,CAAC;SACF,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAED,wCAAwC;AACxC,MAAM,CAAC,MAAM,GAAG,GAAqD,eAAe,CAAC,CAAC,GAAG,EAAE,CACzF,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;AACxB,wCAAwC;AACxC,MAAM,CAAC,MAAM,GAAG,GAAwD,eAAe,CAAC,CAAC,GAAG,EAAE,CAC5F,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;AACxB,wCAAwC;AACxC,MAAM,CAAC,MAAM,GAAG;AACd,eAAe,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;AAE/C,gBAAgB;AAChB,uDAAuD;AACvD,kDAAkD;AAClD,sEAAsE;AAEtE,kCAAkC;AAClC,kCAAkC;AAClC,kCAAkC;AAClC,kCAAkC;AAClC,qDAAqD;AACrD,kDAAkD;AAClD,oDAAoD;AAEpD,iBAAiB;AACjB,iDAAiD;AACjD,kCAAkC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/ff1.d.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/ff1.d.ts deleted file mode 100644 index 00e1a60d..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/ff1.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { type Cipher } from './utils.ts'; -/** FPE-FF1 format-preserving encryption */ -export declare function FF1(radix: number, key: Uint8Array, tweak?: Uint8Array): { - encrypt(x: number[]): number[]; - decrypt(x: number[]): number[]; -}; -/** Binary version of FPE-FF1 format-preserving encryption. */ -export declare function BinaryFF1(key: Uint8Array, tweak?: Uint8Array): Cipher; -//# sourceMappingURL=ff1.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/ff1.d.ts.map b/tools/mnemonic-test/node_modules/@noble/ciphers/ff1.d.ts.map deleted file mode 100644 index 421d857a..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/ff1.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ff1.d.ts","sourceRoot":"","sources":["src/ff1.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,MAAM,EAA4D,MAAM,YAAY,CAAC;AA0FnG,2CAA2C;AAC3C,wBAAgB,GAAG,CACjB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,UAAU,EACf,KAAK,GAAE,UAAsB,GAC5B;IAAE,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;IAAC,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAA;CAAE,CAgCpE;AAqBD,8DAA8D;AAC9D,wBAAgB,SAAS,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,GAAE,UAAsB,GAAG,MAAM,CAMhF"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/ff1.js b/tools/mnemonic-test/node_modules/@noble/ciphers/ff1.js deleted file mode 100644 index 1f0d5798..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/ff1.js +++ /dev/null @@ -1,164 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FF1 = FF1; -exports.BinaryFF1 = BinaryFF1; -/** - * FPE-FF1 (Format-preserving encryption algorithm) specified in - * [NIST 800-38G](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-38G.pdf). - * @module - */ -const aes_ts_1 = require("./aes.js"); -const utils_ts_1 = require("./utils.js"); -// NOTE: no point in inlining encrypt instead of encryptBlock, since BigInt stuff will be slow -const { expandKeyLE, encryptBlock } = aes_ts_1.unsafe; -// Format-preserving encryption algorithm (FPE-FF1) specified in NIST Special Publication 800-38G. -// https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-38G.pdf -const BLOCK_LEN = 16; -function mod(a, b) { - const result = a % b; - return result >= 0 ? result : b + result; -} -function NUMradix(radix, data) { - let res = BigInt(0); - for (let i of data) - res = res * BigInt(radix) + BigInt(i); - return res; -} -function getRound(radix, key, tweak, x) { - if (radix > 2 ** 16 - 1) - throw new Error('invalid radix ' + radix); - // radix**minlen ≥ 100 - const minLen = Math.ceil(Math.log(100) / Math.log(radix)); - const maxLen = 2 ** 32 - 1; - // 2 ≤ minlen ≤ maxlen < 2**32 - if (2 > minLen || minLen > maxLen || maxLen >= 2 ** 32) - throw new Error('Invalid radix: 2 ≤ minlen ≤ maxlen < 2**32'); - if (!Array.isArray(x)) - throw new Error('invalid X'); - if (x.length < minLen || x.length > maxLen) - throw new Error('X is outside minLen..maxLen bounds'); - const u = Math.floor(x.length / 2); - const v = x.length - u; - const b = Math.ceil(Math.ceil(v * Math.log2(radix)) / 8); - const d = 4 * Math.ceil(b / 4) + 4; - const padding = mod(-tweak.length - b - 1, 16); - // P = [1]1 || [2]1 || [1]1 || [radix]3 || [10]1 || [u mod 256]1 || [n]4 || [t]4. - const P = Uint8Array.from([1, 2, 1, 0, 0, 0, 10, u, 0, 0, 0, 0, 0, 0, 0, 0]); - const view = new DataView(P.buffer); - view.setUint16(4, radix, false); - view.setUint32(8, x.length, false); - view.setUint32(12, tweak.length, false); - // Q = T || [0](−t−b−1) mod 16 || [i]1 || [NUMradix(B)]b. - const PQ = new Uint8Array(P.length + tweak.length + padding + 1 + b); - PQ.set(P); - (0, utils_ts_1.clean)(P); - PQ.set(tweak, P.length); - const xk = expandKeyLE(key); - const round = (A, B, i, decrypt = false) => { - // Q = ... || [i]1 || [NUMradix(B)]b. - PQ[PQ.length - b - 1] = i; - if (b) - PQ.set((0, utils_ts_1.numberToBytesBE)(NUMradix(radix, B), b), PQ.length - b); - // PRF - let r = new Uint8Array(16); - for (let j = 0; j < PQ.length / BLOCK_LEN; j++) { - for (let i = 0; i < BLOCK_LEN; i++) - r[i] ^= PQ[j * BLOCK_LEN + i]; - encryptBlock(xk, r); - } - // Let S be the first d bytes of the following string of ⎡d/16⎤ blocks: - // R || CIPHK(R ⊕[1]16) || CIPHK(R ⊕[2]16) ...CIPHK(R ⊕[⎡d / 16⎤ – 1]16). - let s = Array.from(r); - for (let j = 1; s.length < d; j++) { - const block = (0, utils_ts_1.numberToBytesBE)(BigInt(j), 16); - for (let k = 0; k < BLOCK_LEN; k++) - block[k] ^= r[k]; - s.push(...Array.from(encryptBlock(xk, block))); - } - let y = (0, utils_ts_1.bytesToNumberBE)(Uint8Array.from(s.slice(0, d))); - s.fill(0); - if (decrypt) - y = -y; - const m = i % 2 === 0 ? u : v; - let c = mod(NUMradix(radix, A) + y, BigInt(radix) ** BigInt(m)); - // STR(radix, m, c) - const C = Array(m).fill(0); - for (let i = 0; i < m; i++, c /= BigInt(radix)) - C[m - 1 - i] = Number(c % BigInt(radix)); - A.fill(0); - A = B; - B = C; - return [A, B]; - }; - const destroy = () => { - (0, utils_ts_1.clean)(xk, PQ); - }; - return { u, round, destroy }; -} -const EMPTY_BUF = /* @__PURE__ */ Uint8Array.of(); -/** FPE-FF1 format-preserving encryption */ -function FF1(radix, key, tweak = EMPTY_BUF) { - (0, utils_ts_1.anumber)(radix); - (0, utils_ts_1.abytes)(key); - (0, utils_ts_1.abytes)(tweak); - const PQ = getRound.bind(null, radix, key, tweak); - return { - encrypt(x) { - const { u, round, destroy } = PQ(x); - let [A, B] = [x.slice(0, u), x.slice(u)]; - for (let i = 0; i < 10; i++) - [A, B] = round(A, B, i); - destroy(); - const res = A.concat(B); - A.fill(0); - B.fill(0); - return res; - }, - decrypt(x) { - const { u, round, destroy } = PQ(x); - // The FF1.Decrypt algorithm is similar to the FF1.Encrypt algorithm; - // the differences are in Step 6, where: - // 1) the order of the indices is reversed, - // 2) the roles of A and B are swapped - // 3) modular addition is replaced by modular subtraction, in Step 6vi. - let [B, A] = [x.slice(0, u), x.slice(u)]; - for (let i = 9; i >= 0; i--) - [A, B] = round(A, B, i, true); - destroy(); - const res = B.concat(A); - A.fill(0); - B.fill(0); - return res; - }, - }; -} -// Binary string which encodes each byte in little-endian byte order -const binLE = { - encode(bytes) { - const x = []; - for (let i = 0; i < bytes.length; i++) { - for (let j = 0, tmp = bytes[i]; j < 8; j++, tmp >>= 1) - x.push(tmp & 1); - } - return x; - }, - decode(b) { - if (!Array.isArray(b) || b.length % 8) - throw new Error('Invalid binary string'); - const res = new Uint8Array(b.length / 8); - for (let i = 0, j = 0; i < res.length; i++) { - res[i] = b[j++] | (b[j++] << 1) | (b[j++] << 2) | (b[j++] << 3); - res[i] |= (b[j++] << 4) | (b[j++] << 5) | (b[j++] << 6) | (b[j++] << 7); - } - return res; - }, -}; -/** Binary version of FPE-FF1 format-preserving encryption. */ -function BinaryFF1(key, tweak = EMPTY_BUF) { - const ff1 = FF1(2, key, tweak); - return { - encrypt: (x) => binLE.decode(ff1.encrypt(binLE.encode(x))), - decrypt: (x) => binLE.decode(ff1.decrypt(binLE.encode(x))), - }; -} -//# sourceMappingURL=ff1.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/ff1.js.map b/tools/mnemonic-test/node_modules/@noble/ciphers/ff1.js.map deleted file mode 100644 index b0c842b7..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/ff1.js.map +++ /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AAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;QAC1E,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;CACF,CAAC;AAEF,8DAA8D;AAC9D,SAAgB,SAAS,CAAC,GAAe,EAAE,QAAoB,SAAS;IACtE,MAAM,GAAG,GAAG,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IAC/B,OAAO;QACL,OAAO,EAAE,CAAC,CAAa,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QACtE,OAAO,EAAE,CAAC,CAAa,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;KACvE,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/index.d.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/index.d.ts deleted file mode 100644 index f36479a7..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/index.d.ts.map b/tools/mnemonic-test/node_modules/@noble/ciphers/index.d.ts.map deleted file mode 100644 index 4e8c5816..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/index.js b/tools/mnemonic-test/node_modules/@noble/ciphers/index.js deleted file mode 100644 index 164152a1..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/index.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -/** - * Audited & minimal JS implementation of Salsa20, ChaCha and AES. Check out individual modules. - * @example -```js -import { gcm, siv } from '@noble/ciphers/aes'; -import { xsalsa20poly1305 } from '@noble/ciphers/salsa'; -import { secretbox } from '@noble/ciphers/salsa'; // == xsalsa20poly1305 -import { chacha20poly1305, xchacha20poly1305 } from '@noble/ciphers/chacha'; - -// Unauthenticated encryption: make sure to use HMAC or similar -import { ctr, cfb, cbc, ecb } from '@noble/ciphers/aes'; -import { salsa20, xsalsa20 } from '@noble/ciphers/salsa'; -import { chacha20, xchacha20, chacha8, chacha12 } from '@noble/ciphers/chacha'; - -// KW -import { aeskw, aeskwp } from '@noble/ciphers/aes'; - -// Utilities -import { bytesToHex, hexToBytes, bytesToUtf8, utf8ToBytes } from '@noble/ciphers/utils'; -import { managedNonce, randomBytes } from '@noble/ciphers/webcrypto'; -import { poly1305 } from '@noble/ciphers/_poly1305'; -import { ghash, polyval } from '@noble/ciphers/_polyval'; -``` - * @module - */ -throw new Error('root module cannot be imported: import submodules instead. Check out README'); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/index.js.map b/tools/mnemonic-test/node_modules/@noble/ciphers/index.js.map deleted file mode 100644 index f3c3c726..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,IAAI,KAAK,CAAC,6EAA6E,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/package.json b/tools/mnemonic-test/node_modules/@noble/ciphers/package.json deleted file mode 100644 index 8266948f..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/package.json +++ /dev/null @@ -1,177 +0,0 @@ -{ - "name": "@noble/ciphers", - "version": "1.3.0", - "description": "Audited & minimal JS implementation of Salsa20, ChaCha and AES", - "files": [ - "esm", - "src", - "*.js", - "*.js.map", - "*.d.ts", - "*.d.ts.map" - ], - "scripts": { - "bench": "node benchmark/noble.js", - "bench:compare": "node benchmark/compare.js", - "bench:install": "cd benchmark; npm install; npm install .. --install-links", - "build": "npm run build:clean; tsc && tsc -p tsconfig.cjs.json", - "build:release": "npx jsbt esbuild test/build", - "build:clean": "rm *.{js,d.ts,js.map,d.ts.map} esm/*.{js,d.ts,js.map,d.ts.map} 2> /dev/null", - "lint": "prettier --check 'src/**/*.{js,ts}' 'test/**/*.{js,ts,mjs}'", - "format": "prettier --write 'src/**/*.{js,ts}' 'test/**/*.{js,ts,mjs}'", - "test": "node --import ./test/esm-register.js test/index.js", - "test:bun": "bun test/index.js", - "test:deno": "deno --allow-env --allow-read --import-map=./test/import_map.json test/index.js", - "test:big": "node --import ./test/esm-register.js test/crosstest.test.js slow" - }, - "author": "Paul Miller (https://paulmillr.com)", - "homepage": "https://paulmillr.com/noble/", - "repository": { - "type": "git", - "url": "git+https://github.com/paulmillr/noble-ciphers.git" - }, - "license": "MIT", - "devDependencies": { - "@paulmillr/jsbt": "0.3.3", - "@scure/base": "1.2.5", - "fast-check": "3.0.0", - "micro-bmark": "0.4.1", - "micro-should": "0.5.2", - "prettier": "3.5.3", - "typescript": "5.8.3" - }, - "engines": { - "node": "^14.21.3 || >=16" - }, - "main": "index.js", - "exports": { - ".": { - "import": "./esm/index.js", - "require": "./index.js" - }, - "./_micro": { - "import": "./esm/_micro.js", - "require": "./_micro.js" - }, - "./_poly1305": { - "import": "./esm/_poly1305.js", - "require": "./_poly1305.js" - }, - "./_polyval": { - "import": "./esm/_polyval.js", - "require": "./_polyval.js" - }, - "./aes": { - "import": "./esm/aes.js", - "require": "./aes.js" - }, - "./chacha": { - "import": "./esm/chacha.js", - "require": "./chacha.js" - }, - "./crypto": { - "types": "./crypto.d.ts", - "node": { - "import": "./esm/cryptoNode.js", - "default": "./cryptoNode.js" - }, - "import": "./esm/crypto.js", - "default": "./crypto.js" - }, - "./ff1": { - "import": "./esm/ff1.js", - "require": "./ff1.js" - }, - "./index": { - "import": "./esm/index.js", - "require": "./index.js" - }, - "./salsa": { - "import": "./esm/salsa.js", - "require": "./salsa.js" - }, - "./utils": { - "import": "./esm/utils.js", - "require": "./utils.js" - }, - "./webcrypto": { - "import": "./esm/webcrypto.js", - "require": "./webcrypto.js" - }, - "./_micro.js": { - "import": "./esm/_micro.js", - "require": "./_micro.js" - }, - "./_poly1305.js": { - "import": "./esm/_poly1305.js", - "require": "./_poly1305.js" - }, - "./_polyval.js": { - "import": "./esm/_polyval.js", - "require": "./_polyval.js" - }, - "./aes.js": { - "import": "./esm/aes.js", - "require": "./aes.js" - }, - "./chacha.js": { - "import": "./esm/chacha.js", - "require": "./chacha.js" - }, - "./crypto.js": { - "types": "./crypto.d.ts", - "node": { - "import": "./esm/cryptoNode.js", - "default": "./cryptoNode.js" - }, - "import": "./esm/crypto.js", - "default": "./crypto.js" - }, - "./ff1.js": { - "import": "./esm/ff1.js", - "require": "./ff1.js" - }, - "./index.js": { - "import": "./esm/index.js", - "require": "./index.js" - }, - "./salsa.js": { - "import": "./esm/salsa.js", - "require": "./salsa.js" - }, - "./utils.js": { - "import": "./esm/utils.js", - "require": "./utils.js" - }, - "./webcrypto.js": { - "import": "./esm/webcrypto.js", - "require": "./webcrypto.js" - } - }, - "sideEffects": false, - "browser": { - "node:crypto": false, - "./crypto": "./crypto.js" - }, - "keywords": [ - "salsa20", - "chacha", - "aes", - "cryptography", - "crypto", - "noble", - "cipher", - "ciphers", - "xsalsa20", - "xchacha20", - "poly1305", - "xsalsa20poly1305", - "chacha20poly1305", - "xchacha20poly1305", - "secretbox", - "rijndael", - "siv", - "ff1" - ], - "funding": "https://paulmillr.com/funding/" -} diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/salsa.d.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/salsa.d.ts deleted file mode 100644 index dc5931c6..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/salsa.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { type ARXCipher, type XorStream } from './utils.ts'; -/** - * hsalsa hashing function, used primarily in xsalsa, to hash - * key and nonce into key' and nonce'. - * Same as salsaCore, but there doesn't seem to be a way to move the block - * out without 25% performance hit. - */ -export declare function hsalsa(s: Uint32Array, k: Uint32Array, i: Uint32Array, o32: Uint32Array): void; -/** - * Salsa20 from original paper. - * Unsafe to use random nonces under the same key, due to collision chance. - * Prefer XSalsa instead. - */ -export declare const salsa20: XorStream; -/** - * xsalsa20 eXtended-nonce salsa. - * Can be safely used with random 24-byte nonces (CSPRNG). - */ -export declare const xsalsa20: XorStream; -/** - * xsalsa20-poly1305 eXtended-nonce salsa. - * Can be safely used with random 24-byte nonces (CSPRNG). - * Also known as secretbox from libsodium / nacl. - */ -export declare const xsalsa20poly1305: ARXCipher; -/** - * Alias to `xsalsa20poly1305`, for compatibility with libsodium / nacl - */ -export declare function secretbox(key: Uint8Array, nonce: Uint8Array): { - seal: (plaintext: Uint8Array, output?: Uint8Array) => Uint8Array; - open: (ciphertext: Uint8Array, output?: Uint8Array) => Uint8Array; -}; -//# sourceMappingURL=salsa.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/salsa.d.ts.map b/tools/mnemonic-test/node_modules/@noble/ciphers/salsa.d.ts.map deleted file mode 100644 index 61c42f5d..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/salsa.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"salsa.d.ts","sourceRoot":"","sources":["src/salsa.ts"],"names":[],"mappings":"AAiBA,OAAO,EAEL,KAAK,SAAS,EAMd,KAAK,SAAS,EACf,MAAM,YAAY,CAAC;AA+CpB;;;;;GAKG;AAEH,wBAAgB,MAAM,CACpB,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,EAAE,GAAG,EAAE,WAAW,GAC/D,IAAI,CA4BN;AAED;;;;GAIG;AACH,eAAO,MAAM,OAAO,EAAE,SAGpB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,SAGrB,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAsC9B,CAAC;AAEF;;GAEG;AACH,wBAAgB,SAAS,CACvB,GAAG,EAAE,UAAU,EACf,KAAK,EAAE,UAAU,GAChB;IACD,IAAI,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,UAAU,KAAK,UAAU,CAAC;IACjE,IAAI,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,UAAU,KAAK,UAAU,CAAC;CACnE,CAGA"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/salsa.js b/tools/mnemonic-test/node_modules/@noble/ciphers/salsa.js deleted file mode 100644 index df6048b3..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/salsa.js +++ /dev/null @@ -1,206 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.xsalsa20poly1305 = exports.xsalsa20 = exports.salsa20 = void 0; -exports.hsalsa = hsalsa; -exports.secretbox = secretbox; -/** - * [Salsa20](https://cr.yp.to/snuffle.html) stream cipher, released in 2005. - * - * Salsa's goal was to implement AES replacement that does not rely on S-Boxes, - * which are hard to implement in a constant-time manner. - * Salsa20 is usually faster than AES, a big deal on slow, budget mobile phones. - * - * [XSalsa20](https://cr.yp.to/snuffle/xsalsa-20110204.pdf), extended-nonce - * variant was released in 2008. It switched nonces from 96-bit to 192-bit, - * and became safe to be picked at random. - * - * Check out [PDF](https://cr.yp.to/snuffle/salsafamily-20071225.pdf) and - * [wiki](https://en.wikipedia.org/wiki/Salsa20). - * @module - */ -const _arx_ts_1 = require("./_arx.js"); -const _poly1305_ts_1 = require("./_poly1305.js"); -const utils_ts_1 = require("./utils.js"); -/** Salsa20 core function. */ -// prettier-ignore -function salsaCore(s, k, n, out, cnt, rounds = 20) { - // Based on https://cr.yp.to/salsa20.html - let y00 = s[0], y01 = k[0], y02 = k[1], y03 = k[2], // "expa" Key Key Key - y04 = k[3], y05 = s[1], y06 = n[0], y07 = n[1], // Key "nd 3" Nonce Nonce - y08 = cnt, y09 = 0, y10 = s[2], y11 = k[4], // Pos. Pos. "2-by" Key - y12 = k[5], y13 = k[6], y14 = k[7], y15 = s[3]; // Key Key Key "te k" - // Save state to temporary variables - let x00 = y00, x01 = y01, x02 = y02, x03 = y03, x04 = y04, x05 = y05, x06 = y06, x07 = y07, x08 = y08, x09 = y09, x10 = y10, x11 = y11, x12 = y12, x13 = y13, x14 = y14, x15 = y15; - for (let r = 0; r < rounds; r += 2) { - x04 ^= (0, _arx_ts_1.rotl)(x00 + x12 | 0, 7); - x08 ^= (0, _arx_ts_1.rotl)(x04 + x00 | 0, 9); - x12 ^= (0, _arx_ts_1.rotl)(x08 + x04 | 0, 13); - x00 ^= (0, _arx_ts_1.rotl)(x12 + x08 | 0, 18); - x09 ^= (0, _arx_ts_1.rotl)(x05 + x01 | 0, 7); - x13 ^= (0, _arx_ts_1.rotl)(x09 + x05 | 0, 9); - x01 ^= (0, _arx_ts_1.rotl)(x13 + x09 | 0, 13); - x05 ^= (0, _arx_ts_1.rotl)(x01 + x13 | 0, 18); - x14 ^= (0, _arx_ts_1.rotl)(x10 + x06 | 0, 7); - x02 ^= (0, _arx_ts_1.rotl)(x14 + x10 | 0, 9); - x06 ^= (0, _arx_ts_1.rotl)(x02 + x14 | 0, 13); - x10 ^= (0, _arx_ts_1.rotl)(x06 + x02 | 0, 18); - x03 ^= (0, _arx_ts_1.rotl)(x15 + x11 | 0, 7); - x07 ^= (0, _arx_ts_1.rotl)(x03 + x15 | 0, 9); - x11 ^= (0, _arx_ts_1.rotl)(x07 + x03 | 0, 13); - x15 ^= (0, _arx_ts_1.rotl)(x11 + x07 | 0, 18); - x01 ^= (0, _arx_ts_1.rotl)(x00 + x03 | 0, 7); - x02 ^= (0, _arx_ts_1.rotl)(x01 + x00 | 0, 9); - x03 ^= (0, _arx_ts_1.rotl)(x02 + x01 | 0, 13); - x00 ^= (0, _arx_ts_1.rotl)(x03 + x02 | 0, 18); - x06 ^= (0, _arx_ts_1.rotl)(x05 + x04 | 0, 7); - x07 ^= (0, _arx_ts_1.rotl)(x06 + x05 | 0, 9); - x04 ^= (0, _arx_ts_1.rotl)(x07 + x06 | 0, 13); - x05 ^= (0, _arx_ts_1.rotl)(x04 + x07 | 0, 18); - x11 ^= (0, _arx_ts_1.rotl)(x10 + x09 | 0, 7); - x08 ^= (0, _arx_ts_1.rotl)(x11 + x10 | 0, 9); - x09 ^= (0, _arx_ts_1.rotl)(x08 + x11 | 0, 13); - x10 ^= (0, _arx_ts_1.rotl)(x09 + x08 | 0, 18); - x12 ^= (0, _arx_ts_1.rotl)(x15 + x14 | 0, 7); - x13 ^= (0, _arx_ts_1.rotl)(x12 + x15 | 0, 9); - x14 ^= (0, _arx_ts_1.rotl)(x13 + x12 | 0, 13); - x15 ^= (0, _arx_ts_1.rotl)(x14 + x13 | 0, 18); - } - // Write output - let oi = 0; - out[oi++] = (y00 + x00) | 0; - out[oi++] = (y01 + x01) | 0; - out[oi++] = (y02 + x02) | 0; - out[oi++] = (y03 + x03) | 0; - out[oi++] = (y04 + x04) | 0; - out[oi++] = (y05 + x05) | 0; - out[oi++] = (y06 + x06) | 0; - out[oi++] = (y07 + x07) | 0; - out[oi++] = (y08 + x08) | 0; - out[oi++] = (y09 + x09) | 0; - out[oi++] = (y10 + x10) | 0; - out[oi++] = (y11 + x11) | 0; - out[oi++] = (y12 + x12) | 0; - out[oi++] = (y13 + x13) | 0; - out[oi++] = (y14 + x14) | 0; - out[oi++] = (y15 + x15) | 0; -} -/** - * hsalsa hashing function, used primarily in xsalsa, to hash - * key and nonce into key' and nonce'. - * Same as salsaCore, but there doesn't seem to be a way to move the block - * out without 25% performance hit. - */ -// prettier-ignore -function hsalsa(s, k, i, o32) { - let x00 = s[0], x01 = k[0], x02 = k[1], x03 = k[2], x04 = k[3], x05 = s[1], x06 = i[0], x07 = i[1], x08 = i[2], x09 = i[3], x10 = s[2], x11 = k[4], x12 = k[5], x13 = k[6], x14 = k[7], x15 = s[3]; - for (let r = 0; r < 20; r += 2) { - x04 ^= (0, _arx_ts_1.rotl)(x00 + x12 | 0, 7); - x08 ^= (0, _arx_ts_1.rotl)(x04 + x00 | 0, 9); - x12 ^= (0, _arx_ts_1.rotl)(x08 + x04 | 0, 13); - x00 ^= (0, _arx_ts_1.rotl)(x12 + x08 | 0, 18); - x09 ^= (0, _arx_ts_1.rotl)(x05 + x01 | 0, 7); - x13 ^= (0, _arx_ts_1.rotl)(x09 + x05 | 0, 9); - x01 ^= (0, _arx_ts_1.rotl)(x13 + x09 | 0, 13); - x05 ^= (0, _arx_ts_1.rotl)(x01 + x13 | 0, 18); - x14 ^= (0, _arx_ts_1.rotl)(x10 + x06 | 0, 7); - x02 ^= (0, _arx_ts_1.rotl)(x14 + x10 | 0, 9); - x06 ^= (0, _arx_ts_1.rotl)(x02 + x14 | 0, 13); - x10 ^= (0, _arx_ts_1.rotl)(x06 + x02 | 0, 18); - x03 ^= (0, _arx_ts_1.rotl)(x15 + x11 | 0, 7); - x07 ^= (0, _arx_ts_1.rotl)(x03 + x15 | 0, 9); - x11 ^= (0, _arx_ts_1.rotl)(x07 + x03 | 0, 13); - x15 ^= (0, _arx_ts_1.rotl)(x11 + x07 | 0, 18); - x01 ^= (0, _arx_ts_1.rotl)(x00 + x03 | 0, 7); - x02 ^= (0, _arx_ts_1.rotl)(x01 + x00 | 0, 9); - x03 ^= (0, _arx_ts_1.rotl)(x02 + x01 | 0, 13); - x00 ^= (0, _arx_ts_1.rotl)(x03 + x02 | 0, 18); - x06 ^= (0, _arx_ts_1.rotl)(x05 + x04 | 0, 7); - x07 ^= (0, _arx_ts_1.rotl)(x06 + x05 | 0, 9); - x04 ^= (0, _arx_ts_1.rotl)(x07 + x06 | 0, 13); - x05 ^= (0, _arx_ts_1.rotl)(x04 + x07 | 0, 18); - x11 ^= (0, _arx_ts_1.rotl)(x10 + x09 | 0, 7); - x08 ^= (0, _arx_ts_1.rotl)(x11 + x10 | 0, 9); - x09 ^= (0, _arx_ts_1.rotl)(x08 + x11 | 0, 13); - x10 ^= (0, _arx_ts_1.rotl)(x09 + x08 | 0, 18); - x12 ^= (0, _arx_ts_1.rotl)(x15 + x14 | 0, 7); - x13 ^= (0, _arx_ts_1.rotl)(x12 + x15 | 0, 9); - x14 ^= (0, _arx_ts_1.rotl)(x13 + x12 | 0, 13); - x15 ^= (0, _arx_ts_1.rotl)(x14 + x13 | 0, 18); - } - let oi = 0; - o32[oi++] = x00; - o32[oi++] = x05; - o32[oi++] = x10; - o32[oi++] = x15; - o32[oi++] = x06; - o32[oi++] = x07; - o32[oi++] = x08; - o32[oi++] = x09; -} -/** - * Salsa20 from original paper. - * Unsafe to use random nonces under the same key, due to collision chance. - * Prefer XSalsa instead. - */ -exports.salsa20 = (0, _arx_ts_1.createCipher)(salsaCore, { - allowShortKeys: true, - counterRight: true, -}); -/** - * xsalsa20 eXtended-nonce salsa. - * Can be safely used with random 24-byte nonces (CSPRNG). - */ -exports.xsalsa20 = (0, _arx_ts_1.createCipher)(salsaCore, { - counterRight: true, - extendNonceFn: hsalsa, -}); -/** - * xsalsa20-poly1305 eXtended-nonce salsa. - * Can be safely used with random 24-byte nonces (CSPRNG). - * Also known as secretbox from libsodium / nacl. - */ -exports.xsalsa20poly1305 = (0, utils_ts_1.wrapCipher)({ blockSize: 64, nonceLength: 24, tagLength: 16 }, (key, nonce) => { - return { - encrypt(plaintext, output) { - // xsalsa20poly1305 optimizes by calculating auth key during the same call as encryption. - // Unfortunately, makes it hard to separate tag calculation & encryption itself, - // because 32 bytes is half-block of 64-byte salsa. - output = (0, utils_ts_1.getOutput)(plaintext.length + 32, output, false); // need 32 additional bytes, see above - const authKey = output.subarray(0, 32); // output[0..32] = poly1305 auth key - const ciphPlaintext = output.subarray(32); // output[32..] = plaintext, then ciphertext - output.set(plaintext, 32); - (0, utils_ts_1.clean)(authKey); // authKey is produced by xoring with zeros - (0, exports.xsalsa20)(key, nonce, output, output); // output = stream ^ output; authKey = stream ^ zeros(32) - const tag = (0, _poly1305_ts_1.poly1305)(ciphPlaintext, authKey); // calculate tag over ciphertext - output.set(tag, 16); // output[16..32] = tag - (0, utils_ts_1.clean)(output.subarray(0, 16), tag); // clean-up authKey remnants & copy of tag - return output.subarray(16); // return output[16..] - }, - decrypt(ciphertext, output) { - // tmp part passed tag ciphertext - // [0..32] [32..48] [48..] - (0, utils_ts_1.abytes)(ciphertext); - output = (0, utils_ts_1.getOutput)(ciphertext.length + 32, output, false); - const tmp = output.subarray(0, 32); // output[0..32] is used to calc authKey - const passedTag = output.subarray(32, 48); // output[32..48] = passed tag - const ciphPlaintext = output.subarray(48); // output[48..] = ciphertext, then plaintext - output.set(ciphertext, 32); // copy ciphertext into output - (0, utils_ts_1.clean)(tmp); // authKey is produced by xoring with zeros - const authKey = (0, exports.xsalsa20)(key, nonce, tmp, tmp); // authKey = stream ^ zeros(32) - const tag = (0, _poly1305_ts_1.poly1305)(ciphPlaintext, authKey); // calculate tag over ciphertext - if (!(0, utils_ts_1.equalBytes)(passedTag, tag)) - throw new Error('invalid tag'); - (0, exports.xsalsa20)(key, nonce, output.subarray(16), output.subarray(16)); // output = stream ^ output[16..] - (0, utils_ts_1.clean)(tmp, passedTag, tag); - return ciphPlaintext; // return output[48..], skipping zeroized output[0..48] - }, - }; -}); -/** - * Alias to `xsalsa20poly1305`, for compatibility with libsodium / nacl - */ -function secretbox(key, nonce) { - const xs = (0, exports.xsalsa20poly1305)(key, nonce); - return { seal: xs.encrypt, open: xs.decrypt }; -} -//# sourceMappingURL=salsa.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/salsa.js.map b/tools/mnemonic-test/node_modules/@noble/ciphers/salsa.js.map deleted file mode 100644 index 3aacd89a..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/salsa.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"salsa.js","sourceRoot":"","sources":["src/salsa.ts"],"names":[],"mappings":";;;AAgFA,wBA8BC;AAqED,8BASC;AA5LD;;;;;;;;;;;;;;GAcG;AACH,uCAA+C;AAC/C,iDAA0C;AAC1C,yCASoB;AAEpB,6BAA6B;AAC7B,kBAAkB;AAClB,SAAS,SAAS,CAChB,CAAc,EAAE,CAAc,EAAE,CAAc,EAAE,GAAgB,EAAE,GAAW,EAAE,MAAM,GAAG,EAAE;IAE1F,yCAAyC;IACzC,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,6BAA6B;IAC7E,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,+BAA+B;IAC/E,GAAG,GAAG,GAAG,EAAG,GAAG,GAAG,CAAC,EAAK,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,4BAA4B;IAC5E,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,gCAAgC;IACpF,oCAAoC;IACpC,IAAI,GAAG,GAAG,GAAG,EAAE,GAAG,GAAG,GA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AAU,EAAE,EAAE,CAAC,CAAC,CAAC,8BAA8B;YAC1D,IAAA,gBAAK,EAAC,GAAG,CAAC,CAAC,CAAC,2CAA2C;YACvD,MAAM,OAAO,GAAG,IAAA,gBAAQ,EAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,+BAA+B;YAC/E,MAAM,GAAG,GAAG,IAAA,uBAAQ,EAAC,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC,gCAAgC;YAC9E,IAAI,CAAC,IAAA,qBAAU,EAAC,SAAS,EAAE,GAAG,CAAC;gBAAE,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAC;YAChE,IAAA,gBAAQ,EAAC,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,iCAAiC;YACjG,IAAA,gBAAK,EAAC,GAAG,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;YAC3B,OAAO,aAAa,CAAC,CAAC,uDAAuD;QAC/E,CAAC;KACF,CAAC;AACJ,CAAC,CACF,CAAC;AAEF;;GAEG;AACH,SAAgB,SAAS,CACvB,GAAe,EACf,KAAiB;IAKjB,MAAM,EAAE,GAAG,IAAA,wBAAgB,EAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACxC,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC;AAChD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/src/_arx.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/src/_arx.ts deleted file mode 100644 index 79354bab..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/src/_arx.ts +++ /dev/null @@ -1,224 +0,0 @@ -/** - * Basic utils for ARX (add-rotate-xor) salsa and chacha ciphers. - -RFC8439 requires multi-step cipher stream, where -authKey starts with counter: 0, actual msg with counter: 1. - -For this, we need a way to re-use nonce / counter: - - const counter = new Uint8Array(4); - chacha(..., counter, ...); // counter is now 1 - chacha(..., counter, ...); // counter is now 2 - -This is complicated: - -- 32-bit counters are enough, no need for 64-bit: max ArrayBuffer size in JS is 4GB -- Original papers don't allow mutating counters -- Counter overflow is undefined [^1] -- Idea A: allow providing (nonce | counter) instead of just nonce, re-use it -- Caveat: Cannot be re-used through all cases: -- * chacha has (counter | nonce) -- * xchacha has (nonce16 | counter | nonce16) -- Idea B: separate nonce / counter and provide separate API for counter re-use -- Caveat: there are different counter sizes depending on an algorithm. -- salsa & chacha also differ in structures of key & sigma: - salsa20: s[0] | k(4) | s[1] | nonce(2) | ctr(2) | s[2] | k(4) | s[3] - chacha: s(4) | k(8) | ctr(1) | nonce(3) - chacha20orig: s(4) | k(8) | ctr(2) | nonce(2) -- Idea C: helper method such as `setSalsaState(key, nonce, sigma, data)` -- Caveat: we can't re-use counter array - -xchacha [^2] uses the subkey and remaining 8 byte nonce with ChaCha20 as normal -(prefixed by 4 NUL bytes, since [RFC8439] specifies a 12-byte nonce). - -[^1]: https://mailarchive.ietf.org/arch/msg/cfrg/gsOnTJzcbgG6OqD8Sc0GO5aR_tU/ -[^2]: https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-xchacha#appendix-A.2 - - * @module - */ -// prettier-ignore -import { - type XorStream, abool, abytes, anumber, checkOpts, clean, copyBytes, u32 -} from './utils.ts'; - -// We can't make top-level var depend on utils.utf8ToBytes -// because it's not present in all envs. Creating a similar fn here -const _utf8ToBytes = (str: string) => Uint8Array.from(str.split('').map((c) => c.charCodeAt(0))); -const sigma16 = _utf8ToBytes('expand 16-byte k'); -const sigma32 = _utf8ToBytes('expand 32-byte k'); -const sigma16_32 = u32(sigma16); -const sigma32_32 = u32(sigma32); - -export function rotl(a: number, b: number): number { - return (a << b) | (a >>> (32 - b)); -} - -/** Ciphers must use u32 for efficiency. */ -export type CipherCoreFn = ( - sigma: Uint32Array, - key: Uint32Array, - nonce: Uint32Array, - output: Uint32Array, - counter: number, - rounds?: number -) => void; - -/** Method which extends key + short nonce into larger nonce / diff key. */ -export type ExtendNonceFn = ( - sigma: Uint32Array, - key: Uint32Array, - input: Uint32Array, - output: Uint32Array -) => void; - -/** ARX cipher options. - * * `allowShortKeys` for 16-byte keys - * * `counterLength` in bytes - * * `counterRight`: right: `nonce|counter`; left: `counter|nonce` - * */ -export type CipherOpts = { - allowShortKeys?: boolean; // Original salsa / chacha allow 16-byte keys - extendNonceFn?: ExtendNonceFn; - counterLength?: number; - counterRight?: boolean; - rounds?: number; -}; - -// Is byte array aligned to 4 byte offset (u32)? -function isAligned32(b: Uint8Array) { - return b.byteOffset % 4 === 0; -} - -// Salsa and Chacha block length is always 512-bit -const BLOCK_LEN = 64; -const BLOCK_LEN32 = 16; - -// new Uint32Array([2**32]) // => Uint32Array(1) [ 0 ] -// new Uint32Array([2**32-1]) // => Uint32Array(1) [ 4294967295 ] -const MAX_COUNTER = 2 ** 32 - 1; - -const U32_EMPTY = new Uint32Array(); -function runCipher( - core: CipherCoreFn, - sigma: Uint32Array, - key: Uint32Array, - nonce: Uint32Array, - data: Uint8Array, - output: Uint8Array, - counter: number, - rounds: number -): void { - const len = data.length; - const block = new Uint8Array(BLOCK_LEN); - const b32 = u32(block); - // Make sure that buffers aligned to 4 bytes - const isAligned = isAligned32(data) && isAligned32(output); - const d32 = isAligned ? u32(data) : U32_EMPTY; - const o32 = isAligned ? u32(output) : U32_EMPTY; - for (let pos = 0; pos < len; counter++) { - core(sigma, key, nonce, b32, counter, rounds); - if (counter >= MAX_COUNTER) throw new Error('arx: counter overflow'); - const take = Math.min(BLOCK_LEN, len - pos); - // aligned to 4 bytes - if (isAligned && take === BLOCK_LEN) { - const pos32 = pos / 4; - if (pos % 4 !== 0) throw new Error('arx: invalid block position'); - for (let j = 0, posj: number; j < BLOCK_LEN32; j++) { - posj = pos32 + j; - o32[posj] = d32[posj] ^ b32[j]; - } - pos += BLOCK_LEN; - continue; - } - for (let j = 0, posj; j < take; j++) { - posj = pos + j; - output[posj] = data[posj] ^ block[j]; - } - pos += take; - } -} - -/** Creates ARX-like (ChaCha, Salsa) cipher stream from core function. */ -export function createCipher(core: CipherCoreFn, opts: CipherOpts): XorStream { - const { allowShortKeys, extendNonceFn, counterLength, counterRight, rounds } = checkOpts( - { allowShortKeys: false, counterLength: 8, counterRight: false, rounds: 20 }, - opts - ); - if (typeof core !== 'function') throw new Error('core must be a function'); - anumber(counterLength); - anumber(rounds); - abool(counterRight); - abool(allowShortKeys); - return ( - key: Uint8Array, - nonce: Uint8Array, - data: Uint8Array, - output?: Uint8Array, - counter = 0 - ): Uint8Array => { - abytes(key); - abytes(nonce); - abytes(data); - const len = data.length; - if (output === undefined) output = new Uint8Array(len); - abytes(output); - anumber(counter); - if (counter < 0 || counter >= MAX_COUNTER) throw new Error('arx: counter overflow'); - if (output.length < len) - throw new Error(`arx: output (${output.length}) is shorter than data (${len})`); - const toClean = []; - - // Key & sigma - // key=16 -> sigma16, k=key|key - // key=32 -> sigma32, k=key - let l = key.length; - let k: Uint8Array; - let sigma: Uint32Array; - if (l === 32) { - toClean.push((k = copyBytes(key))); - sigma = sigma32_32; - } else if (l === 16 && allowShortKeys) { - k = new Uint8Array(32); - k.set(key); - k.set(key, 16); - sigma = sigma16_32; - toClean.push(k); - } else { - throw new Error(`arx: invalid 32-byte key, got length=${l}`); - } - - // Nonce - // salsa20: 8 (8-byte counter) - // chacha20orig: 8 (8-byte counter) - // chacha20: 12 (4-byte counter) - // xsalsa20: 24 (16 -> hsalsa, 8 -> old nonce) - // xchacha20: 24 (16 -> hchacha, 8 -> old nonce) - // Align nonce to 4 bytes - if (!isAligned32(nonce)) toClean.push((nonce = copyBytes(nonce))); - - const k32 = u32(k); - // hsalsa & hchacha: handle extended nonce - if (extendNonceFn) { - if (nonce.length !== 24) throw new Error(`arx: extended nonce must be 24 bytes`); - extendNonceFn(sigma, k32, u32(nonce.subarray(0, 16)), k32); - nonce = nonce.subarray(16); - } - - // Handle nonce counter - const nonceNcLen = 16 - counterLength; - if (nonceNcLen !== nonce.length) - throw new Error(`arx: nonce must be ${nonceNcLen} or 16 bytes`); - - // Pad counter when nonce is 64 bit - if (nonceNcLen !== 12) { - const nc = new Uint8Array(12); - nc.set(nonce, counterRight ? 0 : 12 - nonce.length); - nonce = nc; - toClean.push(nonce); - } - const n32 = u32(nonce); - runCipher(core, sigma, k32, n32, data, output, counter, rounds); - clean(...toClean); - return output; - }; -} diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/src/_assert.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/src/_assert.ts deleted file mode 100644 index cc011678..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/src/_assert.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Internal assertion helpers. - * @module - * @deprecated - */ -import { - abytes as ab, - abool as abool_, - aexists as ae, - anumber as an, - aoutput as ao, - type IHash as H, -} from './utils.ts'; -/** @deprecated Use import from `noble/hashes/utils` module */ -export const abool: typeof abool_ = abool_; -/** @deprecated Use import from `noble/hashes/utils` module */ -export const abytes: typeof ab = ab; -/** @deprecated Use import from `noble/hashes/utils` module */ -export const aexists: typeof ae = ae; -/** @deprecated Use import from `noble/hashes/utils` module */ -export const anumber: typeof an = an; -/** @deprecated Use import from `noble/hashes/utils` module */ -export const aoutput: typeof ao = ao; -/** @deprecated Use import from `noble/hashes/utils` module */ -export type Hash = H; diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/src/_micro.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/src/_micro.ts deleted file mode 100644 index 01e1dbb8..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/src/_micro.ts +++ /dev/null @@ -1,311 +0,0 @@ -/** - * noble-ciphers-micro: more auditable, but 4x slower version of salsa20, chacha & poly1305. - * Implements the same algorithms that are present in other files, but without - * unrolled loops (https://en.wikipedia.org/wiki/Loop_unrolling). - * @module - */ -/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */ -// prettier-ignore -import { createCipher, rotl } from './_arx.ts'; -import { - type Cipher, - type XorStream, - abytes, - bytesToHex, - concatBytes, - equalBytes, - hexToNumber, - numberToBytesBE, - u64Lengths, - wrapCipher, -} from './utils.ts'; - -export type ARXCipherN = ((key: Uint8Array, nonce: Uint8Array, AAD?: Uint8Array) => Cipher) & { - blockSize: number; - nonceLength: number; - tagLength: number; -}; - -function bytesToNumberLE(bytes: Uint8Array): bigint { - abytes(bytes); - return hexToNumber(bytesToHex(Uint8Array.from(bytes).reverse())); -} - -function numberToBytesLE(n: number | bigint, len: number): Uint8Array { - return numberToBytesBE(n, len).reverse(); -} - -function salsaQR(x: Uint32Array, a: number, b: number, c: number, d: number) { - x[b] ^= rotl((x[a] + x[d]) | 0, 7); - x[c] ^= rotl((x[b] + x[a]) | 0, 9); - x[d] ^= rotl((x[c] + x[b]) | 0, 13); - x[a] ^= rotl((x[d] + x[c]) | 0, 18); -} -// prettier-ignore -function chachaQR(x: Uint32Array, a: number, b: number, c: number, d: number) { - x[a] = (x[a] + x[b]) | 0; x[d] = rotl(x[d] ^ x[a], 16); - x[c] = (x[c] + x[d]) | 0; x[b] = rotl(x[b] ^ x[c], 12); - x[a] = (x[a] + x[b]) | 0; x[d] = rotl(x[d] ^ x[a], 8); - x[c] = (x[c] + x[d]) | 0; x[b] = rotl(x[b] ^ x[c], 7); -} - -function salsaRound(x: Uint32Array, rounds = 20) { - for (let r = 0; r < rounds; r += 2) { - salsaQR(x, 0, 4, 8, 12); - salsaQR(x, 5, 9, 13, 1); - salsaQR(x, 10, 14, 2, 6); - salsaQR(x, 15, 3, 7, 11); - salsaQR(x, 0, 1, 2, 3); - salsaQR(x, 5, 6, 7, 4); - salsaQR(x, 10, 11, 8, 9); - salsaQR(x, 15, 12, 13, 14); - } -} - -function chachaRound(x: Uint32Array, rounds = 20) { - for (let r = 0; r < rounds; r += 2) { - chachaQR(x, 0, 4, 8, 12); - chachaQR(x, 1, 5, 9, 13); - chachaQR(x, 2, 6, 10, 14); - chachaQR(x, 3, 7, 11, 15); - chachaQR(x, 0, 5, 10, 15); - chachaQR(x, 1, 6, 11, 12); - chachaQR(x, 2, 7, 8, 13); - chachaQR(x, 3, 4, 9, 14); - } -} - -function salsaCore( - s: Uint32Array, - k: Uint32Array, - n: Uint32Array, - out: Uint32Array, - cnt: number, - rounds = 20 -): void { - // prettier-ignore - const y = new Uint32Array([ - s[0], k[0], k[1], k[2], // "expa" Key Key Key - k[3], s[1], n[0], n[1], // Key "nd 3" Nonce Nonce - cnt, 0, s[2], k[4], // Pos. Pos. "2-by" Key - k[5], k[6], k[7], s[3], // Key Key Key "te k" - ]); - const x = y.slice(); - salsaRound(x, rounds); - for (let i = 0; i < 16; i++) out[i] = (y[i] + x[i]) | 0; -} - -/** hsalsa hashes key and nonce into key' and nonce'. */ -// prettier-ignore -export function hsalsa(s: Uint32Array, k: Uint32Array, i: Uint32Array, o32: Uint32Array): void { - const x = new Uint32Array([ - s[0], k[0], k[1], k[2], - k[3], s[1], i[0], i[1], - i[2], i[3], s[2], k[4], - k[5], k[6], k[7], s[3] - ]); - salsaRound(x, 20); - let oi = 0; - o32[oi++] = x[0]; o32[oi++] = x[5]; - o32[oi++] = x[10]; o32[oi++] = x[15]; - o32[oi++] = x[6]; o32[oi++] = x[7]; - o32[oi++] = x[8]; o32[oi++] = x[9]; -} - -function chachaCore( - s: Uint32Array, - k: Uint32Array, - n: Uint32Array, - out: Uint32Array, - cnt: number, - rounds = 20 -): void { - // prettier-ignore - const y = new Uint32Array([ - s[0], s[1], s[2], s[3], // "expa" "nd 3" "2-by" "te k" - k[0], k[1], k[2], k[3], // Key Key Key Key - k[4], k[5], k[6], k[7], // Key Key Key Key - cnt, n[0], n[1], n[2], // Counter Counter Nonce Nonce - ]); - const x = y.slice(); - chachaRound(x, rounds); - for (let i = 0; i < 16; i++) out[i] = (y[i] + x[i]) | 0; -} - -/** hchacha hashes key and nonce into key' and nonce'. */ -// prettier-ignore -export function hchacha(s: Uint32Array, k: Uint32Array, i: Uint32Array, o32: Uint32Array): void { - const x = new Uint32Array([ - s[0], s[1], s[2], s[3], - k[0], k[1], k[2], k[3], - k[4], k[5], k[6], k[7], - i[0], i[1], i[2], i[3], - ]); - chachaRound(x, 20); - let oi = 0; - o32[oi++] = x[0]; o32[oi++] = x[1]; - o32[oi++] = x[2]; o32[oi++] = x[3]; - o32[oi++] = x[12]; o32[oi++] = x[13]; - o32[oi++] = x[14]; o32[oi++] = x[15]; -} - -/** salsa20, 12-byte nonce. */ -export const salsa20: XorStream = /* @__PURE__ */ createCipher(salsaCore, { - allowShortKeys: true, - counterRight: true, -}); - -/** xsalsa20, 24-byte nonce. */ -export const xsalsa20: XorStream = /* @__PURE__ */ createCipher(salsaCore, { - counterRight: true, - extendNonceFn: hsalsa, -}); - -/** chacha20 non-RFC, original version by djb. 8-byte nonce, 8-byte counter. */ -export const chacha20orig: XorStream = /* @__PURE__ */ createCipher(chachaCore, { - allowShortKeys: true, - counterRight: false, - counterLength: 8, -}); - -/** chacha20 RFC 8439 (IETF / TLS). 12-byte nonce, 4-byte counter. */ -export const chacha20: XorStream = /* @__PURE__ */ createCipher(chachaCore, { - counterRight: false, - counterLength: 4, -}); - -/** xchacha20 eXtended-nonce. https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-xchacha */ -export const xchacha20: XorStream = /* @__PURE__ */ createCipher(chachaCore, { - counterRight: false, - counterLength: 8, - extendNonceFn: hchacha, -}); - -/** 8-round chacha from the original paper. */ -export const chacha8: XorStream = /* @__PURE__ */ createCipher(chachaCore, { - counterRight: false, - counterLength: 4, - rounds: 8, -}); - -/** 12-round chacha from the original paper. */ -export const chacha12: XorStream = /* @__PURE__ */ createCipher(chachaCore, { - counterRight: false, - counterLength: 4, - rounds: 12, -}); - -const POW_2_130_5 = BigInt(2) ** BigInt(130) - BigInt(5); -const POW_2_128_1 = BigInt(2) ** BigInt(16 * 8) - BigInt(1); -const CLAMP_R = BigInt('0x0ffffffc0ffffffc0ffffffc0fffffff'); -const _0 = BigInt(0); -const _1 = BigInt(1); - -/** Poly1305 polynomial MAC. Can be speed-up using BigUint64Array, at the cost of complexity. */ -export function poly1305(msg: Uint8Array, key: Uint8Array): Uint8Array { - abytes(msg); - abytes(key, 32); - let acc = _0; - const r = bytesToNumberLE(key.subarray(0, 16)) & CLAMP_R; - const s = bytesToNumberLE(key.subarray(16)); - // Process by 16 byte chunks - for (let i = 0; i < msg.length; i += 16) { - const m = msg.subarray(i, i + 16); - const n = bytesToNumberLE(m) | (_1 << BigInt(8 * m.length)); - acc = ((acc + n) * r) % POW_2_130_5; - } - const res = (acc + s) & POW_2_128_1; - return numberToBytesLE(res, 16); -} - -function computeTag( - fn: XorStream, - key: Uint8Array, - nonce: Uint8Array, - ciphertext: Uint8Array, - AAD?: Uint8Array -): Uint8Array { - const res = []; - if (AAD) { - res.push(AAD); - const leftover = AAD.length % 16; - if (leftover > 0) res.push(new Uint8Array(16 - leftover)); - } - res.push(ciphertext); - const leftover = ciphertext.length % 16; - if (leftover > 0) res.push(new Uint8Array(16 - leftover)); - res.push(u64Lengths(ciphertext.length, AAD ? AAD.length : 0, true)); - const authKey = fn(key, nonce, new Uint8Array(32)); - return poly1305(concatBytes(...res), authKey); -} - -/** xsalsa20-poly1305 eXtended-nonce (24 bytes) salsa. */ -export const xsalsa20poly1305: ARXCipherN = /* @__PURE__ */ wrapCipher( - { blockSize: 64, nonceLength: 24, tagLength: 16 }, - function xsalsapoly(key: Uint8Array, nonce: Uint8Array) { - return { - encrypt(plaintext: Uint8Array) { - const m = concatBytes(new Uint8Array(32), plaintext); - const c = xsalsa20(key, nonce, m); - const authKey = c.subarray(0, 32); - const data = c.subarray(32); - const tag = poly1305(data, authKey); - return concatBytes(tag, data); - }, - decrypt(ciphertext: Uint8Array) { - const c = concatBytes(new Uint8Array(16), ciphertext); - const passedTag = c.subarray(16, 32); - const authKey = xsalsa20(key, nonce, new Uint8Array(32)); - const tag = poly1305(c.subarray(32), authKey); - if (!equalBytes(tag, passedTag)) throw new Error('invalid poly1305 tag'); - return xsalsa20(key, nonce, c).subarray(32); - }, - }; - } -); - -/** Alias to `xsalsa20poly1305`. */ -export function secretbox( - key: Uint8Array, - nonce: Uint8Array -): { - seal: (plaintext: Uint8Array) => Uint8Array; - open: (ciphertext: Uint8Array) => Uint8Array; -} { - const xs = xsalsa20poly1305(key, nonce); - return { seal: xs.encrypt, open: xs.decrypt }; -} - -export const _poly1305_aead = - (fn: XorStream) => - (key: Uint8Array, nonce: Uint8Array, AAD?: Uint8Array): Cipher => { - const tagLength = 16; - return { - encrypt(plaintext: Uint8Array) { - const data = fn(key, nonce, plaintext, undefined, 1); // stream from i=1 - const tag = computeTag(fn, key, nonce, data, AAD); - return concatBytes(data, tag); - }, - decrypt(ciphertext: Uint8Array) { - const passedTag = ciphertext.subarray(-tagLength); - const data = ciphertext.subarray(0, -tagLength); - const tag = computeTag(fn, key, nonce, data, AAD); - if (!equalBytes(tag, passedTag)) throw new Error('invalid poly1305 tag'); - return fn(key, nonce, data, undefined, 1); // stream from i=1 - }, - }; - }; - -/** chacha20-poly1305 12-byte-nonce chacha. */ -export const chacha20poly1305: ARXCipherN = /* @__PURE__ */ wrapCipher( - { blockSize: 64, nonceLength: 12, tagLength: 16 }, - _poly1305_aead(chacha20) -); - -/** - * XChaCha20-Poly1305 extended-nonce chacha. Can be safely used with random nonces (CSPRNG). - */ -export const xchacha20poly1305: ARXCipherN = /* @__PURE__ */ wrapCipher( - { blockSize: 64, nonceLength: 24, tagLength: 16 }, - _poly1305_aead(xchacha20) -); diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/src/_poly1305.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/src/_poly1305.ts deleted file mode 100644 index 110b4c32..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/src/_poly1305.ts +++ /dev/null @@ -1,305 +0,0 @@ -/** - * Poly1305 ([PDF](https://cr.yp.to/mac/poly1305-20050329.pdf), - * [wiki](https://en.wikipedia.org/wiki/Poly1305)) - * is a fast and parallel secret-key message-authentication code suitable for - * a wide variety of applications. It was standardized in - * [RFC 8439](https://datatracker.ietf.org/doc/html/rfc8439) and is now used in TLS 1.3. - * - * Polynomial MACs are not perfect for every situation: - * they lack Random Key Robustness: the MAC can be forged, and can't be used in PAKE schemes. - * See [invisible salamanders attack](https://keymaterial.net/2020/09/07/invisible-salamanders-in-aes-gcm-siv/). - * To combat invisible salamanders, `hash(key)` can be included in ciphertext, - * however, this would violate ciphertext indistinguishability: - * an attacker would know which key was used - so `HKDF(key, i)` - * could be used instead. - * - * Check out [original website](https://cr.yp.to/mac.html). - * @module - */ -import { Hash, type Input, abytes, aexists, aoutput, clean, toBytes } from './utils.ts'; - -// Based on Public Domain poly1305-donna https://github.com/floodyberry/poly1305-donna -const u8to16 = (a: Uint8Array, i: number) => (a[i++] & 0xff) | ((a[i++] & 0xff) << 8); -class Poly1305 implements Hash { - readonly blockLen = 16; - readonly outputLen = 16; - private buffer = new Uint8Array(16); - private r = new Uint16Array(10); - private h = new Uint16Array(10); - private pad = new Uint16Array(8); - private pos = 0; - protected finished = false; - - constructor(key: Input) { - key = toBytes(key); - abytes(key, 32); - const t0 = u8to16(key, 0); - const t1 = u8to16(key, 2); - const t2 = u8to16(key, 4); - const t3 = u8to16(key, 6); - const t4 = u8to16(key, 8); - const t5 = u8to16(key, 10); - const t6 = u8to16(key, 12); - const t7 = u8to16(key, 14); - - // https://github.com/floodyberry/poly1305-donna/blob/e6ad6e091d30d7f4ec2d4f978be1fcfcbce72781/poly1305-donna-16.h#L47 - this.r[0] = t0 & 0x1fff; - this.r[1] = ((t0 >>> 13) | (t1 << 3)) & 0x1fff; - this.r[2] = ((t1 >>> 10) | (t2 << 6)) & 0x1f03; - this.r[3] = ((t2 >>> 7) | (t3 << 9)) & 0x1fff; - this.r[4] = ((t3 >>> 4) | (t4 << 12)) & 0x00ff; - this.r[5] = (t4 >>> 1) & 0x1ffe; - this.r[6] = ((t4 >>> 14) | (t5 << 2)) & 0x1fff; - this.r[7] = ((t5 >>> 11) | (t6 << 5)) & 0x1f81; - this.r[8] = ((t6 >>> 8) | (t7 << 8)) & 0x1fff; - this.r[9] = (t7 >>> 5) & 0x007f; - for (let i = 0; i < 8; i++) this.pad[i] = u8to16(key, 16 + 2 * i); - } - - private process(data: Uint8Array, offset: number, isLast = false) { - const hibit = isLast ? 0 : 1 << 11; - const { h, r } = this; - const r0 = r[0]; - const r1 = r[1]; - const r2 = r[2]; - const r3 = r[3]; - const r4 = r[4]; - const r5 = r[5]; - const r6 = r[6]; - const r7 = r[7]; - const r8 = r[8]; - const r9 = r[9]; - - const t0 = u8to16(data, offset + 0); - const t1 = u8to16(data, offset + 2); - const t2 = u8to16(data, offset + 4); - const t3 = u8to16(data, offset + 6); - const t4 = u8to16(data, offset + 8); - const t5 = u8to16(data, offset + 10); - const t6 = u8to16(data, offset + 12); - const t7 = u8to16(data, offset + 14); - - let h0 = h[0] + (t0 & 0x1fff); - let h1 = h[1] + (((t0 >>> 13) | (t1 << 3)) & 0x1fff); - let h2 = h[2] + (((t1 >>> 10) | (t2 << 6)) & 0x1fff); - let h3 = h[3] + (((t2 >>> 7) | (t3 << 9)) & 0x1fff); - let h4 = h[4] + (((t3 >>> 4) | (t4 << 12)) & 0x1fff); - let h5 = h[5] + ((t4 >>> 1) & 0x1fff); - let h6 = h[6] + (((t4 >>> 14) | (t5 << 2)) & 0x1fff); - let h7 = h[7] + (((t5 >>> 11) | (t6 << 5)) & 0x1fff); - let h8 = h[8] + (((t6 >>> 8) | (t7 << 8)) & 0x1fff); - let h9 = h[9] + ((t7 >>> 5) | hibit); - - let c = 0; - - let d0 = c + h0 * r0 + h1 * (5 * r9) + h2 * (5 * r8) + h3 * (5 * r7) + h4 * (5 * r6); - c = d0 >>> 13; - d0 &= 0x1fff; - d0 += h5 * (5 * r5) + h6 * (5 * r4) + h7 * (5 * r3) + h8 * (5 * r2) + h9 * (5 * r1); - c += d0 >>> 13; - d0 &= 0x1fff; - - let d1 = c + h0 * r1 + h1 * r0 + h2 * (5 * r9) + h3 * (5 * r8) + h4 * (5 * r7); - c = d1 >>> 13; - d1 &= 0x1fff; - d1 += h5 * (5 * r6) + h6 * (5 * r5) + h7 * (5 * r4) + h8 * (5 * r3) + h9 * (5 * r2); - c += d1 >>> 13; - d1 &= 0x1fff; - - let d2 = c + h0 * r2 + h1 * r1 + h2 * r0 + h3 * (5 * r9) + h4 * (5 * r8); - c = d2 >>> 13; - d2 &= 0x1fff; - d2 += h5 * (5 * r7) + h6 * (5 * r6) + h7 * (5 * r5) + h8 * (5 * r4) + h9 * (5 * r3); - c += d2 >>> 13; - d2 &= 0x1fff; - - let d3 = c + h0 * r3 + h1 * r2 + h2 * r1 + h3 * r0 + h4 * (5 * r9); - c = d3 >>> 13; - d3 &= 0x1fff; - d3 += h5 * (5 * r8) + h6 * (5 * r7) + h7 * (5 * r6) + h8 * (5 * r5) + h9 * (5 * r4); - c += d3 >>> 13; - d3 &= 0x1fff; - - let d4 = c + h0 * r4 + h1 * r3 + h2 * r2 + h3 * r1 + h4 * r0; - c = d4 >>> 13; - d4 &= 0x1fff; - d4 += h5 * (5 * r9) + h6 * (5 * r8) + h7 * (5 * r7) + h8 * (5 * r6) + h9 * (5 * r5); - c += d4 >>> 13; - d4 &= 0x1fff; - - let d5 = c + h0 * r5 + h1 * r4 + h2 * r3 + h3 * r2 + h4 * r1; - c = d5 >>> 13; - d5 &= 0x1fff; - d5 += h5 * r0 + h6 * (5 * r9) + h7 * (5 * r8) + h8 * (5 * r7) + h9 * (5 * r6); - c += d5 >>> 13; - d5 &= 0x1fff; - - let d6 = c + h0 * r6 + h1 * r5 + h2 * r4 + h3 * r3 + h4 * r2; - c = d6 >>> 13; - d6 &= 0x1fff; - d6 += h5 * r1 + h6 * r0 + h7 * (5 * r9) + h8 * (5 * r8) + h9 * (5 * r7); - c += d6 >>> 13; - d6 &= 0x1fff; - - let d7 = c + h0 * r7 + h1 * r6 + h2 * r5 + h3 * r4 + h4 * r3; - c = d7 >>> 13; - d7 &= 0x1fff; - d7 += h5 * r2 + h6 * r1 + h7 * r0 + h8 * (5 * r9) + h9 * (5 * r8); - c += d7 >>> 13; - d7 &= 0x1fff; - - let d8 = c + h0 * r8 + h1 * r7 + h2 * r6 + h3 * r5 + h4 * r4; - c = d8 >>> 13; - d8 &= 0x1fff; - d8 += h5 * r3 + h6 * r2 + h7 * r1 + h8 * r0 + h9 * (5 * r9); - c += d8 >>> 13; - d8 &= 0x1fff; - - let d9 = c + h0 * r9 + h1 * r8 + h2 * r7 + h3 * r6 + h4 * r5; - c = d9 >>> 13; - d9 &= 0x1fff; - d9 += h5 * r4 + h6 * r3 + h7 * r2 + h8 * r1 + h9 * r0; - c += d9 >>> 13; - d9 &= 0x1fff; - - c = ((c << 2) + c) | 0; - c = (c + d0) | 0; - d0 = c & 0x1fff; - c = c >>> 13; - d1 += c; - - h[0] = d0; - h[1] = d1; - h[2] = d2; - h[3] = d3; - h[4] = d4; - h[5] = d5; - h[6] = d6; - h[7] = d7; - h[8] = d8; - h[9] = d9; - } - - private finalize() { - const { h, pad } = this; - const g = new Uint16Array(10); - let c = h[1] >>> 13; - h[1] &= 0x1fff; - for (let i = 2; i < 10; i++) { - h[i] += c; - c = h[i] >>> 13; - h[i] &= 0x1fff; - } - h[0] += c * 5; - c = h[0] >>> 13; - h[0] &= 0x1fff; - h[1] += c; - c = h[1] >>> 13; - h[1] &= 0x1fff; - h[2] += c; - - g[0] = h[0] + 5; - c = g[0] >>> 13; - g[0] &= 0x1fff; - for (let i = 1; i < 10; i++) { - g[i] = h[i] + c; - c = g[i] >>> 13; - g[i] &= 0x1fff; - } - g[9] -= 1 << 13; - - let mask = (c ^ 1) - 1; - for (let i = 0; i < 10; i++) g[i] &= mask; - mask = ~mask; - for (let i = 0; i < 10; i++) h[i] = (h[i] & mask) | g[i]; - h[0] = (h[0] | (h[1] << 13)) & 0xffff; - h[1] = ((h[1] >>> 3) | (h[2] << 10)) & 0xffff; - h[2] = ((h[2] >>> 6) | (h[3] << 7)) & 0xffff; - h[3] = ((h[3] >>> 9) | (h[4] << 4)) & 0xffff; - h[4] = ((h[4] >>> 12) | (h[5] << 1) | (h[6] << 14)) & 0xffff; - h[5] = ((h[6] >>> 2) | (h[7] << 11)) & 0xffff; - h[6] = ((h[7] >>> 5) | (h[8] << 8)) & 0xffff; - h[7] = ((h[8] >>> 8) | (h[9] << 5)) & 0xffff; - - let f = h[0] + pad[0]; - h[0] = f & 0xffff; - for (let i = 1; i < 8; i++) { - f = (((h[i] + pad[i]) | 0) + (f >>> 16)) | 0; - h[i] = f & 0xffff; - } - clean(g); - } - update(data: Input): this { - aexists(this); - data = toBytes(data); - abytes(data); - const { buffer, blockLen } = this; - const len = data.length; - - for (let pos = 0; pos < len; ) { - const take = Math.min(blockLen - this.pos, len - pos); - // Fast path: we have at least one block in input - if (take === blockLen) { - for (; blockLen <= len - pos; pos += blockLen) this.process(data, pos); - continue; - } - buffer.set(data.subarray(pos, pos + take), this.pos); - this.pos += take; - pos += take; - if (this.pos === blockLen) { - this.process(buffer, 0, false); - this.pos = 0; - } - } - return this; - } - destroy() { - clean(this.h, this.r, this.buffer, this.pad); - } - digestInto(out: Uint8Array) { - aexists(this); - aoutput(out, this); - this.finished = true; - const { buffer, h } = this; - let { pos } = this; - if (pos) { - buffer[pos++] = 1; - for (; pos < 16; pos++) buffer[pos] = 0; - this.process(buffer, 0, true); - } - this.finalize(); - let opos = 0; - for (let i = 0; i < 8; i++) { - out[opos++] = h[i] >>> 0; - out[opos++] = h[i] >>> 8; - } - return out; - } - digest(): Uint8Array { - const { buffer, outputLen } = this; - this.digestInto(buffer); - const res = buffer.slice(0, outputLen); - this.destroy(); - return res; - } -} - -export type CHash = ReturnType; -export function wrapConstructorWithKey>( - hashCons: (key: Input) => Hash -): { - (msg: Input, key: Input): Uint8Array; - outputLen: number; - blockLen: number; - create(key: Input): Hash; -} { - const hashC = (msg: Input, key: Input): Uint8Array => hashCons(key).update(toBytes(msg)).digest(); - const tmp = hashCons(new Uint8Array(32)); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = (key: Input) => hashCons(key); - return hashC; -} - -/** Poly1305 MAC from RFC 8439. */ -export const poly1305: CHash = wrapConstructorWithKey((key) => new Poly1305(key)); diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/src/_polyval.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/src/_polyval.ts deleted file mode 100644 index 74774e9d..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/src/_polyval.ts +++ /dev/null @@ -1,267 +0,0 @@ -/** - * GHash from AES-GCM and its little-endian "mirror image" Polyval from AES-SIV. - * - * Implemented in terms of GHash with conversion function for keys - * GCM GHASH from - * [NIST SP800-38d](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf), - * SIV from - * [RFC 8452](https://datatracker.ietf.org/doc/html/rfc8452). - * - * GHASH modulo: x^128 + x^7 + x^2 + x + 1 - * POLYVAL modulo: x^128 + x^127 + x^126 + x^121 + 1 - * - * @module - */ -// prettier-ignore -import { - abytes, aexists, aoutput, - clean, copyBytes, createView, Hash, type Input, toBytes, u32, -} from './utils.ts'; - -const BLOCK_SIZE = 16; -// TODO: rewrite -// temporary padding buffer -const ZEROS16 = /* @__PURE__ */ new Uint8Array(16); -const ZEROS32 = u32(ZEROS16); -const POLY = 0xe1; // v = 2*v % POLY - -// v = 2*v % POLY -// NOTE: because x + x = 0 (add/sub is same), mul2(x) != x+x -// We can multiply any number using montgomery ladder and this function (works as double, add is simple xor) -const mul2 = (s0: number, s1: number, s2: number, s3: number) => { - const hiBit = s3 & 1; - return { - s3: (s2 << 31) | (s3 >>> 1), - s2: (s1 << 31) | (s2 >>> 1), - s1: (s0 << 31) | (s1 >>> 1), - s0: (s0 >>> 1) ^ ((POLY << 24) & -(hiBit & 1)), // reduce % poly - }; -}; - -const swapLE = (n: number) => - (((n >>> 0) & 0xff) << 24) | - (((n >>> 8) & 0xff) << 16) | - (((n >>> 16) & 0xff) << 8) | - ((n >>> 24) & 0xff) | - 0; - -/** - * `mulX_POLYVAL(ByteReverse(H))` from spec - * @param k mutated in place - */ -export function _toGHASHKey(k: Uint8Array): Uint8Array { - k.reverse(); - const hiBit = k[15] & 1; - // k >>= 1 - let carry = 0; - for (let i = 0; i < k.length; i++) { - const t = k[i]; - k[i] = (t >>> 1) | carry; - carry = (t & 1) << 7; - } - k[0] ^= -hiBit & 0xe1; // if (hiBit) n ^= 0xe1000000000000000000000000000000; - return k; -} - -type Value = { s0: number; s1: number; s2: number; s3: number }; - -const estimateWindow = (bytes: number) => { - if (bytes > 64 * 1024) return 8; - if (bytes > 1024) return 4; - return 2; -}; - -class GHASH implements Hash { - readonly blockLen = BLOCK_SIZE; - readonly outputLen = BLOCK_SIZE; - protected s0 = 0; - protected s1 = 0; - protected s2 = 0; - protected s3 = 0; - protected finished = false; - protected t: Value[]; - private W: number; - private windowSize: number; - // We select bits per window adaptively based on expectedLength - constructor(key: Input, expectedLength?: number) { - key = toBytes(key); - abytes(key, 16); - const kView = createView(key); - let k0 = kView.getUint32(0, false); - let k1 = kView.getUint32(4, false); - let k2 = kView.getUint32(8, false); - let k3 = kView.getUint32(12, false); - // generate table of doubled keys (half of montgomery ladder) - const doubles: Value[] = []; - for (let i = 0; i < 128; i++) { - doubles.push({ s0: swapLE(k0), s1: swapLE(k1), s2: swapLE(k2), s3: swapLE(k3) }); - ({ s0: k0, s1: k1, s2: k2, s3: k3 } = mul2(k0, k1, k2, k3)); - } - const W = estimateWindow(expectedLength || 1024); - if (![1, 2, 4, 8].includes(W)) - throw new Error('ghash: invalid window size, expected 2, 4 or 8'); - this.W = W; - const bits = 128; // always 128 bits; - const windows = bits / W; - const windowSize = (this.windowSize = 2 ** W); - const items: Value[] = []; - // Create precompute table for window of W bits - for (let w = 0; w < windows; w++) { - // truth table: 00, 01, 10, 11 - for (let byte = 0; byte < windowSize; byte++) { - // prettier-ignore - let s0 = 0, s1 = 0, s2 = 0, s3 = 0; - for (let j = 0; j < W; j++) { - const bit = (byte >>> (W - j - 1)) & 1; - if (!bit) continue; - const { s0: d0, s1: d1, s2: d2, s3: d3 } = doubles[W * w + j]; - (s0 ^= d0), (s1 ^= d1), (s2 ^= d2), (s3 ^= d3); - } - items.push({ s0, s1, s2, s3 }); - } - } - this.t = items; - } - protected _updateBlock(s0: number, s1: number, s2: number, s3: number) { - (s0 ^= this.s0), (s1 ^= this.s1), (s2 ^= this.s2), (s3 ^= this.s3); - const { W, t, windowSize } = this; - // prettier-ignore - let o0 = 0, o1 = 0, o2 = 0, o3 = 0; - const mask = (1 << W) - 1; // 2**W will kill performance. - let w = 0; - for (const num of [s0, s1, s2, s3]) { - for (let bytePos = 0; bytePos < 4; bytePos++) { - const byte = (num >>> (8 * bytePos)) & 0xff; - for (let bitPos = 8 / W - 1; bitPos >= 0; bitPos--) { - const bit = (byte >>> (W * bitPos)) & mask; - const { s0: e0, s1: e1, s2: e2, s3: e3 } = t[w * windowSize + bit]; - (o0 ^= e0), (o1 ^= e1), (o2 ^= e2), (o3 ^= e3); - w += 1; - } - } - } - this.s0 = o0; - this.s1 = o1; - this.s2 = o2; - this.s3 = o3; - } - update(data: Input): this { - aexists(this); - data = toBytes(data); - abytes(data); - const b32 = u32(data); - const blocks = Math.floor(data.length / BLOCK_SIZE); - const left = data.length % BLOCK_SIZE; - for (let i = 0; i < blocks; i++) { - this._updateBlock(b32[i * 4 + 0], b32[i * 4 + 1], b32[i * 4 + 2], b32[i * 4 + 3]); - } - if (left) { - ZEROS16.set(data.subarray(blocks * BLOCK_SIZE)); - this._updateBlock(ZEROS32[0], ZEROS32[1], ZEROS32[2], ZEROS32[3]); - clean(ZEROS32); // clean tmp buffer - } - return this; - } - destroy() { - const { t } = this; - // clean precompute table - for (const elm of t) { - (elm.s0 = 0), (elm.s1 = 0), (elm.s2 = 0), (elm.s3 = 0); - } - } - digestInto(out: Uint8Array) { - aexists(this); - aoutput(out, this); - this.finished = true; - const { s0, s1, s2, s3 } = this; - const o32 = u32(out); - o32[0] = s0; - o32[1] = s1; - o32[2] = s2; - o32[3] = s3; - return out; - } - digest(): Uint8Array { - const res = new Uint8Array(BLOCK_SIZE); - this.digestInto(res); - this.destroy(); - return res; - } -} - -class Polyval extends GHASH { - constructor(key: Input, expectedLength?: number) { - key = toBytes(key); - abytes(key); - const ghKey = _toGHASHKey(copyBytes(key)); - super(ghKey, expectedLength); - clean(ghKey); - } - update(data: Input): this { - data = toBytes(data); - aexists(this); - const b32 = u32(data); - const left = data.length % BLOCK_SIZE; - const blocks = Math.floor(data.length / BLOCK_SIZE); - for (let i = 0; i < blocks; i++) { - this._updateBlock( - swapLE(b32[i * 4 + 3]), - swapLE(b32[i * 4 + 2]), - swapLE(b32[i * 4 + 1]), - swapLE(b32[i * 4 + 0]) - ); - } - if (left) { - ZEROS16.set(data.subarray(blocks * BLOCK_SIZE)); - this._updateBlock( - swapLE(ZEROS32[3]), - swapLE(ZEROS32[2]), - swapLE(ZEROS32[1]), - swapLE(ZEROS32[0]) - ); - clean(ZEROS32); - } - return this; - } - digestInto(out: Uint8Array) { - aexists(this); - aoutput(out, this); - this.finished = true; - // tmp ugly hack - const { s0, s1, s2, s3 } = this; - const o32 = u32(out); - o32[0] = s0; - o32[1] = s1; - o32[2] = s2; - o32[3] = s3; - return out.reverse(); - } -} - -export type CHashPV = ReturnType; -function wrapConstructorWithKey>( - hashCons: (key: Input, expectedLength?: number) => Hash -): { - (msg: Input, key: Input): Uint8Array; - outputLen: number; - blockLen: number; - create(key: Input, expectedLength?: number): Hash; -} { - const hashC = (msg: Input, key: Input): Uint8Array => - hashCons(key, msg.length).update(toBytes(msg)).digest(); - const tmp = hashCons(new Uint8Array(16), 0); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = (key: Input, expectedLength?: number) => hashCons(key, expectedLength); - return hashC; -} - -/** GHash MAC for AES-GCM. */ -export const ghash: CHashPV = wrapConstructorWithKey( - (key, expectedLength) => new GHASH(key, expectedLength) -); - -/** Polyval MAC for AES-SIV. */ -export const polyval: CHashPV = wrapConstructorWithKey( - (key, expectedLength) => new Polyval(key, expectedLength) -); diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/src/aes.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/src/aes.ts deleted file mode 100644 index ba89a243..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/src/aes.ts +++ /dev/null @@ -1,1016 +0,0 @@ -/** - * [AES](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard) - * a.k.a. Advanced Encryption Standard - * is a variant of Rijndael block cipher, standardized by NIST in 2001. - * We provide the fastest available pure JS implementation. - * - * Data is split into 128-bit blocks. Encrypted in 10/12/14 rounds (128/192/256 bits). In every round: - * 1. **S-box**, table substitution - * 2. **Shift rows**, cyclic shift left of all rows of data array - * 3. **Mix columns**, multiplying every column by fixed polynomial - * 4. **Add round key**, round_key xor i-th column of array - * - * Check out [FIPS-197](https://csrc.nist.gov/files/pubs/fips/197/final/docs/fips-197.pdf) - * and [original proposal](https://csrc.nist.gov/csrc/media/projects/cryptographic-standards-and-guidelines/documents/aes-development/rijndael-ammended.pdf) - * @module - */ -import { ghash, polyval } from './_polyval.ts'; -// prettier-ignore -import { - abytes, clean, complexOverlapBytes, concatBytes, - copyBytes, createView, equalBytes, getOutput, isAligned32, overlapBytes, - setBigUint64, u32, u64Lengths, u8, wrapCipher, - type Cipher, type CipherWithOutput, -} from './utils.ts'; - -const BLOCK_SIZE = 16; -const BLOCK_SIZE32 = 4; -const EMPTY_BLOCK = /* @__PURE__ */ new Uint8Array(BLOCK_SIZE); -const POLY = 0x11b; // 1 + x + x**3 + x**4 + x**8 - -// TODO: remove multiplication, binary ops only -function mul2(n: number) { - return (n << 1) ^ (POLY & -(n >> 7)); -} - -function mul(a: number, b: number) { - let res = 0; - for (; b > 0; b >>= 1) { - // Montgomery ladder - res ^= a & -(b & 1); // if (b&1) res ^=a (but const-time). - a = mul2(a); // a = 2*a - } - return res; -} - -// AES S-box is generated using finite field inversion, -// an affine transform, and xor of a constant 0x63. -const sbox = /* @__PURE__ */ (() => { - const t = new Uint8Array(256); - for (let i = 0, x = 1; i < 256; i++, x ^= mul2(x)) t[i] = x; - const box = new Uint8Array(256); - box[0] = 0x63; // first elm - for (let i = 0; i < 255; i++) { - let x = t[255 - i]; - x |= x << 8; - box[t[i]] = (x ^ (x >> 4) ^ (x >> 5) ^ (x >> 6) ^ (x >> 7) ^ 0x63) & 0xff; - } - clean(t); - return box; -})(); - -// Inverted S-box -const invSbox = /* @__PURE__ */ sbox.map((_, j) => sbox.indexOf(j)); - -// Rotate u32 by 8 -const rotr32_8 = (n: number) => (n << 24) | (n >>> 8); -const rotl32_8 = (n: number) => (n << 8) | (n >>> 24); -// The byte swap operation for uint32 (LE<->BE) -const byteSwap = (word: number) => - ((word << 24) & 0xff000000) | - ((word << 8) & 0xff0000) | - ((word >>> 8) & 0xff00) | - ((word >>> 24) & 0xff); - -// T-table is optimization suggested in 5.2 of original proposal (missed from FIPS-197). Changes: -// - LE instead of BE -// - bigger tables: T0 and T1 are merged into T01 table and T2 & T3 into T23; -// so index is u16, instead of u8. This speeds up things, unexpectedly -function genTtable(sbox: Uint8Array, fn: (n: number) => number) { - if (sbox.length !== 256) throw new Error('Wrong sbox length'); - const T0 = new Uint32Array(256).map((_, j) => fn(sbox[j])); - const T1 = T0.map(rotl32_8); - const T2 = T1.map(rotl32_8); - const T3 = T2.map(rotl32_8); - const T01 = new Uint32Array(256 * 256); - const T23 = new Uint32Array(256 * 256); - const sbox2 = new Uint16Array(256 * 256); - for (let i = 0; i < 256; i++) { - for (let j = 0; j < 256; j++) { - const idx = i * 256 + j; - T01[idx] = T0[i] ^ T1[j]; - T23[idx] = T2[i] ^ T3[j]; - sbox2[idx] = (sbox[i] << 8) | sbox[j]; - } - } - return { sbox, sbox2, T0, T1, T2, T3, T01, T23 }; -} - -const tableEncoding = /* @__PURE__ */ genTtable( - sbox, - (s: number) => (mul(s, 3) << 24) | (s << 16) | (s << 8) | mul(s, 2) -); -const tableDecoding = /* @__PURE__ */ genTtable( - invSbox, - (s) => (mul(s, 11) << 24) | (mul(s, 13) << 16) | (mul(s, 9) << 8) | mul(s, 14) -); - -const xPowers = /* @__PURE__ */ (() => { - const p = new Uint8Array(16); - for (let i = 0, x = 1; i < 16; i++, x = mul2(x)) p[i] = x; - return p; -})(); - -/** Key expansion used in CTR. */ -function expandKeyLE(key: Uint8Array): Uint32Array { - abytes(key); - const len = key.length; - if (![16, 24, 32].includes(len)) - throw new Error('aes: invalid key size, should be 16, 24 or 32, got ' + len); - const { sbox2 } = tableEncoding; - const toClean = []; - if (!isAligned32(key)) toClean.push((key = copyBytes(key))); - const k32 = u32(key); - const Nk = k32.length; - const subByte = (n: number) => applySbox(sbox2, n, n, n, n); - const xk = new Uint32Array(len + 28); // expanded key - xk.set(k32); - // 4.3.1 Key expansion - for (let i = Nk; i < xk.length; i++) { - let t = xk[i - 1]; - if (i % Nk === 0) t = subByte(rotr32_8(t)) ^ xPowers[i / Nk - 1]; - else if (Nk > 6 && i % Nk === 4) t = subByte(t); - xk[i] = xk[i - Nk] ^ t; - } - clean(...toClean); - return xk; -} - -function expandKeyDecLE(key: Uint8Array): Uint32Array { - const encKey = expandKeyLE(key); - const xk = encKey.slice(); - const Nk = encKey.length; - const { sbox2 } = tableEncoding; - const { T0, T1, T2, T3 } = tableDecoding; - // Inverse key by chunks of 4 (rounds) - for (let i = 0; i < Nk; i += 4) { - for (let j = 0; j < 4; j++) xk[i + j] = encKey[Nk - i - 4 + j]; - } - clean(encKey); - // apply InvMixColumn except first & last round - for (let i = 4; i < Nk - 4; i++) { - const x = xk[i]; - const w = applySbox(sbox2, x, x, x, x); - xk[i] = T0[w & 0xff] ^ T1[(w >>> 8) & 0xff] ^ T2[(w >>> 16) & 0xff] ^ T3[w >>> 24]; - } - return xk; -} - -// Apply tables -function apply0123( - T01: Uint32Array, - T23: Uint32Array, - s0: number, - s1: number, - s2: number, - s3: number -) { - return ( - T01[((s0 << 8) & 0xff00) | ((s1 >>> 8) & 0xff)] ^ - T23[((s2 >>> 8) & 0xff00) | ((s3 >>> 24) & 0xff)] - ); -} - -function applySbox(sbox2: Uint16Array, s0: number, s1: number, s2: number, s3: number) { - return ( - sbox2[(s0 & 0xff) | (s1 & 0xff00)] | - (sbox2[((s2 >>> 16) & 0xff) | ((s3 >>> 16) & 0xff00)] << 16) - ); -} - -function encrypt( - xk: Uint32Array, - s0: number, - s1: number, - s2: number, - s3: number -): { s0: number; s1: number; s2: number; s3: number } { - const { sbox2, T01, T23 } = tableEncoding; - let k = 0; - (s0 ^= xk[k++]), (s1 ^= xk[k++]), (s2 ^= xk[k++]), (s3 ^= xk[k++]); - const rounds = xk.length / 4 - 2; - for (let i = 0; i < rounds; i++) { - const t0 = xk[k++] ^ apply0123(T01, T23, s0, s1, s2, s3); - const t1 = xk[k++] ^ apply0123(T01, T23, s1, s2, s3, s0); - const t2 = xk[k++] ^ apply0123(T01, T23, s2, s3, s0, s1); - const t3 = xk[k++] ^ apply0123(T01, T23, s3, s0, s1, s2); - (s0 = t0), (s1 = t1), (s2 = t2), (s3 = t3); - } - // last round (without mixcolumns, so using SBOX2 table) - const t0 = xk[k++] ^ applySbox(sbox2, s0, s1, s2, s3); - const t1 = xk[k++] ^ applySbox(sbox2, s1, s2, s3, s0); - const t2 = xk[k++] ^ applySbox(sbox2, s2, s3, s0, s1); - const t3 = xk[k++] ^ applySbox(sbox2, s3, s0, s1, s2); - return { s0: t0, s1: t1, s2: t2, s3: t3 }; -} - -// Can't be merged with encrypt: arg positions for apply0123 / applySbox are different -function decrypt( - xk: Uint32Array, - s0: number, - s1: number, - s2: number, - s3: number -): { - s0: number; - s1: number; - s2: number; - s3: number; -} { - const { sbox2, T01, T23 } = tableDecoding; - let k = 0; - (s0 ^= xk[k++]), (s1 ^= xk[k++]), (s2 ^= xk[k++]), (s3 ^= xk[k++]); - const rounds = xk.length / 4 - 2; - for (let i = 0; i < rounds; i++) { - const t0 = xk[k++] ^ apply0123(T01, T23, s0, s3, s2, s1); - const t1 = xk[k++] ^ apply0123(T01, T23, s1, s0, s3, s2); - const t2 = xk[k++] ^ apply0123(T01, T23, s2, s1, s0, s3); - const t3 = xk[k++] ^ apply0123(T01, T23, s3, s2, s1, s0); - (s0 = t0), (s1 = t1), (s2 = t2), (s3 = t3); - } - // Last round - const t0: number = xk[k++] ^ applySbox(sbox2, s0, s3, s2, s1); - const t1: number = xk[k++] ^ applySbox(sbox2, s1, s0, s3, s2); - const t2: number = xk[k++] ^ applySbox(sbox2, s2, s1, s0, s3); - const t3: number = xk[k++] ^ applySbox(sbox2, s3, s2, s1, s0); - return { s0: t0, s1: t1, s2: t2, s3: t3 }; -} - -// TODO: investigate merging with ctr32 -function ctrCounter( - xk: Uint32Array, - nonce: Uint8Array, - src: Uint8Array, - dst?: Uint8Array -): Uint8Array { - abytes(nonce, BLOCK_SIZE); - abytes(src); - const srcLen = src.length; - dst = getOutput(srcLen, dst); - complexOverlapBytes(src, dst); - const ctr = nonce; - const c32 = u32(ctr); - // Fill block (empty, ctr=0) - let { s0, s1, s2, s3 } = encrypt(xk, c32[0], c32[1], c32[2], c32[3]); - const src32 = u32(src); - const dst32 = u32(dst); - // process blocks - for (let i = 0; i + 4 <= src32.length; i += 4) { - dst32[i + 0] = src32[i + 0] ^ s0; - dst32[i + 1] = src32[i + 1] ^ s1; - dst32[i + 2] = src32[i + 2] ^ s2; - dst32[i + 3] = src32[i + 3] ^ s3; - // Full 128 bit counter with wrap around - let carry = 1; - for (let i = ctr.length - 1; i >= 0; i--) { - carry = (carry + (ctr[i] & 0xff)) | 0; - ctr[i] = carry & 0xff; - carry >>>= 8; - } - ({ s0, s1, s2, s3 } = encrypt(xk, c32[0], c32[1], c32[2], c32[3])); - } - // leftovers (less than block) - // It's possible to handle > u32 fast, but is it worth it? - const start = BLOCK_SIZE * Math.floor(src32.length / BLOCK_SIZE32); - if (start < srcLen) { - const b32 = new Uint32Array([s0, s1, s2, s3]); - const buf = u8(b32); - for (let i = start, pos = 0; i < srcLen; i++, pos++) dst[i] = src[i] ^ buf[pos]; - clean(b32); - } - return dst; -} - -// AES CTR with overflowing 32 bit counter -// It's possible to do 32le significantly simpler (and probably faster) by using u32. -// But, we need both, and perf bottleneck is in ghash anyway. -function ctr32( - xk: Uint32Array, - isLE: boolean, - nonce: Uint8Array, - src: Uint8Array, - dst?: Uint8Array -): Uint8Array { - abytes(nonce, BLOCK_SIZE); - abytes(src); - dst = getOutput(src.length, dst); - const ctr = nonce; // write new value to nonce, so it can be re-used - const c32 = u32(ctr); - const view = createView(ctr); - const src32 = u32(src); - const dst32 = u32(dst); - const ctrPos = isLE ? 0 : 12; - const srcLen = src.length; - // Fill block (empty, ctr=0) - let ctrNum = view.getUint32(ctrPos, isLE); // read current counter value - let { s0, s1, s2, s3 } = encrypt(xk, c32[0], c32[1], c32[2], c32[3]); - // process blocks - for (let i = 0; i + 4 <= src32.length; i += 4) { - dst32[i + 0] = src32[i + 0] ^ s0; - dst32[i + 1] = src32[i + 1] ^ s1; - dst32[i + 2] = src32[i + 2] ^ s2; - dst32[i + 3] = src32[i + 3] ^ s3; - ctrNum = (ctrNum + 1) >>> 0; // u32 wrap - view.setUint32(ctrPos, ctrNum, isLE); - ({ s0, s1, s2, s3 } = encrypt(xk, c32[0], c32[1], c32[2], c32[3])); - } - // leftovers (less than a block) - const start = BLOCK_SIZE * Math.floor(src32.length / BLOCK_SIZE32); - if (start < srcLen) { - const b32 = new Uint32Array([s0, s1, s2, s3]); - const buf = u8(b32); - for (let i = start, pos = 0; i < srcLen; i++, pos++) dst[i] = src[i] ^ buf[pos]; - clean(b32); - } - return dst; -} - -/** - * CTR: counter mode. Creates stream cipher. - * Requires good IV. Parallelizable. OK, but no MAC. - */ -export const ctr: ((key: Uint8Array, nonce: Uint8Array) => CipherWithOutput) & { - blockSize: number; - nonceLength: number; -} = /* @__PURE__ */ wrapCipher( - { blockSize: 16, nonceLength: 16 }, - function aesctr(key: Uint8Array, nonce: Uint8Array): CipherWithOutput { - function processCtr(buf: Uint8Array, dst?: Uint8Array) { - abytes(buf); - if (dst !== undefined) { - abytes(dst); - if (!isAligned32(dst)) throw new Error('unaligned destination'); - } - const xk = expandKeyLE(key); - const n = copyBytes(nonce); // align + avoid changing - const toClean = [xk, n]; - if (!isAligned32(buf)) toClean.push((buf = copyBytes(buf))); - const out = ctrCounter(xk, n, buf, dst); - clean(...toClean); - return out; - } - return { - encrypt: (plaintext: Uint8Array, dst?: Uint8Array) => processCtr(plaintext, dst), - decrypt: (ciphertext: Uint8Array, dst?: Uint8Array) => processCtr(ciphertext, dst), - }; - } -); - -function validateBlockDecrypt(data: Uint8Array) { - abytes(data); - if (data.length % BLOCK_SIZE !== 0) { - throw new Error( - 'aes-(cbc/ecb).decrypt ciphertext should consist of blocks with size ' + BLOCK_SIZE - ); - } -} - -function validateBlockEncrypt(plaintext: Uint8Array, pcks5: boolean, dst?: Uint8Array) { - abytes(plaintext); - let outLen = plaintext.length; - const remaining = outLen % BLOCK_SIZE; - if (!pcks5 && remaining !== 0) - throw new Error('aec/(cbc-ecb): unpadded plaintext with disabled padding'); - if (!isAligned32(plaintext)) plaintext = copyBytes(plaintext); - const b = u32(plaintext); - if (pcks5) { - let left = BLOCK_SIZE - remaining; - if (!left) left = BLOCK_SIZE; // if no bytes left, create empty padding block - outLen = outLen + left; - } - dst = getOutput(outLen, dst); - complexOverlapBytes(plaintext, dst); - const o = u32(dst); - return { b, o, out: dst }; -} - -function validatePCKS(data: Uint8Array, pcks5: boolean) { - if (!pcks5) return data; - const len = data.length; - if (!len) throw new Error('aes/pcks5: empty ciphertext not allowed'); - const lastByte = data[len - 1]; - if (lastByte <= 0 || lastByte > 16) throw new Error('aes/pcks5: wrong padding'); - const out = data.subarray(0, -lastByte); - for (let i = 0; i < lastByte; i++) - if (data[len - i - 1] !== lastByte) throw new Error('aes/pcks5: wrong padding'); - return out; -} - -function padPCKS(left: Uint8Array) { - const tmp = new Uint8Array(16); - const tmp32 = u32(tmp); - tmp.set(left); - const paddingByte = BLOCK_SIZE - left.length; - for (let i = BLOCK_SIZE - paddingByte; i < BLOCK_SIZE; i++) tmp[i] = paddingByte; - return tmp32; -} - -/** Options for ECB and CBC. */ -export type BlockOpts = { disablePadding?: boolean }; - -/** - * ECB: Electronic CodeBook. Simple deterministic replacement. - * Dangerous: always map x to y. See [AES Penguin](https://words.filippo.io/the-ecb-penguin/). - */ -export const ecb: ((key: Uint8Array, opts?: BlockOpts) => CipherWithOutput) & { - blockSize: number; -} = /* @__PURE__ */ wrapCipher( - { blockSize: 16 }, - function aesecb(key: Uint8Array, opts: BlockOpts = {}): CipherWithOutput { - const pcks5 = !opts.disablePadding; - return { - encrypt(plaintext: Uint8Array, dst?: Uint8Array) { - const { b, o, out: _out } = validateBlockEncrypt(plaintext, pcks5, dst); - const xk = expandKeyLE(key); - let i = 0; - for (; i + 4 <= b.length; ) { - const { s0, s1, s2, s3 } = encrypt(xk, b[i + 0], b[i + 1], b[i + 2], b[i + 3]); - (o[i++] = s0), (o[i++] = s1), (o[i++] = s2), (o[i++] = s3); - } - if (pcks5) { - const tmp32 = padPCKS(plaintext.subarray(i * 4)); - const { s0, s1, s2, s3 } = encrypt(xk, tmp32[0], tmp32[1], tmp32[2], tmp32[3]); - (o[i++] = s0), (o[i++] = s1), (o[i++] = s2), (o[i++] = s3); - } - clean(xk); - return _out; - }, - decrypt(ciphertext: Uint8Array, dst?: Uint8Array) { - validateBlockDecrypt(ciphertext); - const xk = expandKeyDecLE(key); - dst = getOutput(ciphertext.length, dst); - const toClean: (Uint8Array | Uint32Array)[] = [xk]; - if (!isAligned32(ciphertext)) toClean.push((ciphertext = copyBytes(ciphertext))); - complexOverlapBytes(ciphertext, dst); - const b = u32(ciphertext); - const o = u32(dst); - for (let i = 0; i + 4 <= b.length; ) { - const { s0, s1, s2, s3 } = decrypt(xk, b[i + 0], b[i + 1], b[i + 2], b[i + 3]); - (o[i++] = s0), (o[i++] = s1), (o[i++] = s2), (o[i++] = s3); - } - clean(...toClean); - return validatePCKS(dst, pcks5); - }, - }; - } -); - -/** - * CBC: Cipher-Block-Chaining. Key is previous round’s block. - * Fragile: needs proper padding. Unauthenticated: needs MAC. - */ -export const cbc: ((key: Uint8Array, iv: Uint8Array, opts?: BlockOpts) => CipherWithOutput) & { - blockSize: number; - nonceLength: number; -} = /* @__PURE__ */ wrapCipher( - { blockSize: 16, nonceLength: 16 }, - function aescbc(key: Uint8Array, iv: Uint8Array, opts: BlockOpts = {}): CipherWithOutput { - const pcks5 = !opts.disablePadding; - return { - encrypt(plaintext: Uint8Array, dst?: Uint8Array) { - const xk = expandKeyLE(key); - const { b, o, out: _out } = validateBlockEncrypt(plaintext, pcks5, dst); - let _iv = iv; - const toClean: (Uint8Array | Uint32Array)[] = [xk]; - if (!isAligned32(_iv)) toClean.push((_iv = copyBytes(_iv))); - const n32 = u32(_iv); - // prettier-ignore - let s0 = n32[0], s1 = n32[1], s2 = n32[2], s3 = n32[3]; - let i = 0; - for (; i + 4 <= b.length; ) { - (s0 ^= b[i + 0]), (s1 ^= b[i + 1]), (s2 ^= b[i + 2]), (s3 ^= b[i + 3]); - ({ s0, s1, s2, s3 } = encrypt(xk, s0, s1, s2, s3)); - (o[i++] = s0), (o[i++] = s1), (o[i++] = s2), (o[i++] = s3); - } - if (pcks5) { - const tmp32 = padPCKS(plaintext.subarray(i * 4)); - (s0 ^= tmp32[0]), (s1 ^= tmp32[1]), (s2 ^= tmp32[2]), (s3 ^= tmp32[3]); - ({ s0, s1, s2, s3 } = encrypt(xk, s0, s1, s2, s3)); - (o[i++] = s0), (o[i++] = s1), (o[i++] = s2), (o[i++] = s3); - } - clean(...toClean); - return _out; - }, - decrypt(ciphertext: Uint8Array, dst?: Uint8Array) { - validateBlockDecrypt(ciphertext); - const xk = expandKeyDecLE(key); - let _iv = iv; - const toClean: (Uint8Array | Uint32Array)[] = [xk]; - if (!isAligned32(_iv)) toClean.push((_iv = copyBytes(_iv))); - const n32 = u32(_iv); - dst = getOutput(ciphertext.length, dst); - if (!isAligned32(ciphertext)) toClean.push((ciphertext = copyBytes(ciphertext))); - complexOverlapBytes(ciphertext, dst); - const b = u32(ciphertext); - const o = u32(dst); - // prettier-ignore - let s0 = n32[0], s1 = n32[1], s2 = n32[2], s3 = n32[3]; - for (let i = 0; i + 4 <= b.length; ) { - // prettier-ignore - const ps0 = s0, ps1 = s1, ps2 = s2, ps3 = s3; - (s0 = b[i + 0]), (s1 = b[i + 1]), (s2 = b[i + 2]), (s3 = b[i + 3]); - const { s0: o0, s1: o1, s2: o2, s3: o3 } = decrypt(xk, s0, s1, s2, s3); - (o[i++] = o0 ^ ps0), (o[i++] = o1 ^ ps1), (o[i++] = o2 ^ ps2), (o[i++] = o3 ^ ps3); - } - clean(...toClean); - return validatePCKS(dst, pcks5); - }, - }; - } -); - -/** - * CFB: Cipher Feedback Mode. The input for the block cipher is the previous cipher output. - * Unauthenticated: needs MAC. - */ -export const cfb: ((key: Uint8Array, iv: Uint8Array) => CipherWithOutput) & { - blockSize: number; - nonceLength: number; -} = /* @__PURE__ */ wrapCipher( - { blockSize: 16, nonceLength: 16 }, - function aescfb(key: Uint8Array, iv: Uint8Array): CipherWithOutput { - function processCfb(src: Uint8Array, isEncrypt: boolean, dst?: Uint8Array) { - abytes(src); - const srcLen = src.length; - dst = getOutput(srcLen, dst); - if (overlapBytes(src, dst)) throw new Error('overlapping src and dst not supported.'); - const xk = expandKeyLE(key); - let _iv = iv; - const toClean: (Uint8Array | Uint32Array)[] = [xk]; - if (!isAligned32(_iv)) toClean.push((_iv = copyBytes(_iv))); - if (!isAligned32(src)) toClean.push((src = copyBytes(src))); - const src32 = u32(src); - const dst32 = u32(dst); - const next32 = isEncrypt ? dst32 : src32; - const n32 = u32(_iv); - // prettier-ignore - let s0 = n32[0], s1 = n32[1], s2 = n32[2], s3 = n32[3]; - for (let i = 0; i + 4 <= src32.length; ) { - const { s0: e0, s1: e1, s2: e2, s3: e3 } = encrypt(xk, s0, s1, s2, s3); - dst32[i + 0] = src32[i + 0] ^ e0; - dst32[i + 1] = src32[i + 1] ^ e1; - dst32[i + 2] = src32[i + 2] ^ e2; - dst32[i + 3] = src32[i + 3] ^ e3; - (s0 = next32[i++]), (s1 = next32[i++]), (s2 = next32[i++]), (s3 = next32[i++]); - } - // leftovers (less than block) - const start = BLOCK_SIZE * Math.floor(src32.length / BLOCK_SIZE32); - if (start < srcLen) { - ({ s0, s1, s2, s3 } = encrypt(xk, s0, s1, s2, s3)); - const buf = u8(new Uint32Array([s0, s1, s2, s3])); - for (let i = start, pos = 0; i < srcLen; i++, pos++) dst[i] = src[i] ^ buf[pos]; - clean(buf); - } - clean(...toClean); - return dst; - } - return { - encrypt: (plaintext: Uint8Array, dst?: Uint8Array) => processCfb(plaintext, true, dst), - decrypt: (ciphertext: Uint8Array, dst?: Uint8Array) => processCfb(ciphertext, false, dst), - }; - } -); - -// TODO: merge with chacha, however gcm has bitLen while chacha has byteLen -function computeTag( - fn: typeof ghash, - isLE: boolean, - key: Uint8Array, - data: Uint8Array, - AAD?: Uint8Array -) { - const aadLength = AAD ? AAD.length : 0; - const h = fn.create(key, data.length + aadLength); - if (AAD) h.update(AAD); - const num = u64Lengths(8 * data.length, 8 * aadLength, isLE); - h.update(data); - h.update(num); - const res = h.digest(); - clean(num); - return res; -} - -/** - * GCM: Galois/Counter Mode. - * Modern, parallel version of CTR, with MAC. - * Be careful: MACs can be forged. - * Unsafe to use random nonces under the same key, due to collision chance. - * As for nonce size, prefer 12-byte, instead of 8-byte. - */ -export const gcm: ((key: Uint8Array, nonce: Uint8Array, AAD?: Uint8Array) => Cipher) & { - blockSize: number; - nonceLength: number; - tagLength: number; - varSizeNonce: true; -} = /* @__PURE__ */ wrapCipher( - { blockSize: 16, nonceLength: 12, tagLength: 16, varSizeNonce: true }, - function aesgcm(key: Uint8Array, nonce: Uint8Array, AAD?: Uint8Array): Cipher { - // NIST 800-38d doesn't enforce minimum nonce length. - // We enforce 8 bytes for compat with openssl. - // 12 bytes are recommended. More than 12 bytes would be converted into 12. - if (nonce.length < 8) throw new Error('aes/gcm: invalid nonce length'); - const tagLength = 16; - function _computeTag(authKey: Uint8Array, tagMask: Uint8Array, data: Uint8Array) { - const tag = computeTag(ghash, false, authKey, data, AAD); - for (let i = 0; i < tagMask.length; i++) tag[i] ^= tagMask[i]; - return tag; - } - function deriveKeys() { - const xk = expandKeyLE(key); - const authKey = EMPTY_BLOCK.slice(); - const counter = EMPTY_BLOCK.slice(); - ctr32(xk, false, counter, counter, authKey); - // NIST 800-38d, page 15: different behavior for 96-bit and non-96-bit nonces - if (nonce.length === 12) { - counter.set(nonce); - } else { - const nonceLen = EMPTY_BLOCK.slice(); - const view = createView(nonceLen); - setBigUint64(view, 8, BigInt(nonce.length * 8), false); - // ghash(nonce || u64be(0) || u64be(nonceLen*8)) - const g = ghash.create(authKey).update(nonce).update(nonceLen); - g.digestInto(counter); // digestInto doesn't trigger '.destroy' - g.destroy(); - } - const tagMask = ctr32(xk, false, counter, EMPTY_BLOCK); - return { xk, authKey, counter, tagMask }; - } - return { - encrypt(plaintext: Uint8Array) { - const { xk, authKey, counter, tagMask } = deriveKeys(); - const out = new Uint8Array(plaintext.length + tagLength); - const toClean: (Uint8Array | Uint32Array)[] = [xk, authKey, counter, tagMask]; - if (!isAligned32(plaintext)) toClean.push((plaintext = copyBytes(plaintext))); - ctr32(xk, false, counter, plaintext, out.subarray(0, plaintext.length)); - const tag = _computeTag(authKey, tagMask, out.subarray(0, out.length - tagLength)); - toClean.push(tag); - out.set(tag, plaintext.length); - clean(...toClean); - return out; - }, - decrypt(ciphertext: Uint8Array) { - const { xk, authKey, counter, tagMask } = deriveKeys(); - const toClean: (Uint8Array | Uint32Array)[] = [xk, authKey, tagMask, counter]; - if (!isAligned32(ciphertext)) toClean.push((ciphertext = copyBytes(ciphertext))); - const data = ciphertext.subarray(0, -tagLength); - const passedTag = ciphertext.subarray(-tagLength); - const tag = _computeTag(authKey, tagMask, data); - toClean.push(tag); - if (!equalBytes(tag, passedTag)) throw new Error('aes/gcm: invalid ghash tag'); - const out = ctr32(xk, false, counter, data); - clean(...toClean); - return out; - }, - }; - } -); - -const limit = (name: string, min: number, max: number) => (value: number) => { - if (!Number.isSafeInteger(value) || min > value || value > max) { - const minmax = '[' + min + '..' + max + ']'; - throw new Error('' + name + ': expected value in range ' + minmax + ', got ' + value); - } -}; - -/** - * AES-GCM-SIV: classic AES-GCM with nonce-misuse resistance. - * Guarantees that, when a nonce is repeated, the only security loss is that identical - * plaintexts will produce identical ciphertexts. - * RFC 8452, https://datatracker.ietf.org/doc/html/rfc8452 - */ -export const gcmsiv: ((key: Uint8Array, nonce: Uint8Array, AAD?: Uint8Array) => Cipher) & { - blockSize: number; - nonceLength: number; - tagLength: number; - varSizeNonce: true; -} = /* @__PURE__ */ wrapCipher( - { blockSize: 16, nonceLength: 12, tagLength: 16, varSizeNonce: true }, - function aessiv(key: Uint8Array, nonce: Uint8Array, AAD?: Uint8Array): Cipher { - const tagLength = 16; - // From RFC 8452: Section 6 - const AAD_LIMIT = limit('AAD', 0, 2 ** 36); - const PLAIN_LIMIT = limit('plaintext', 0, 2 ** 36); - const NONCE_LIMIT = limit('nonce', 12, 12); - const CIPHER_LIMIT = limit('ciphertext', 16, 2 ** 36 + 16); - abytes(key, 16, 24, 32); - NONCE_LIMIT(nonce.length); - if (AAD !== undefined) AAD_LIMIT(AAD.length); - function deriveKeys() { - const xk = expandKeyLE(key); - const encKey = new Uint8Array(key.length); - const authKey = new Uint8Array(16); - const toClean: (Uint8Array | Uint32Array)[] = [xk, encKey]; - let _nonce = nonce; - if (!isAligned32(_nonce)) toClean.push((_nonce = copyBytes(_nonce))); - const n32 = u32(_nonce); - // prettier-ignore - let s0 = 0, s1 = n32[0], s2 = n32[1], s3 = n32[2]; - let counter = 0; - for (const derivedKey of [authKey, encKey].map(u32)) { - const d32 = u32(derivedKey); - for (let i = 0; i < d32.length; i += 2) { - // aes(u32le(0) || nonce)[:8] || aes(u32le(1) || nonce)[:8] ... - const { s0: o0, s1: o1 } = encrypt(xk, s0, s1, s2, s3); - d32[i + 0] = o0; - d32[i + 1] = o1; - s0 = ++counter; // increment counter inside state - } - } - const res = { authKey, encKey: expandKeyLE(encKey) }; - // Cleanup - clean(...toClean); - return res; - } - function _computeTag(encKey: Uint32Array, authKey: Uint8Array, data: Uint8Array) { - const tag = computeTag(polyval, true, authKey, data, AAD); - // Compute the expected tag by XORing S_s and the nonce, clearing the - // most significant bit of the last byte and encrypting with the - // message-encryption key. - for (let i = 0; i < 12; i++) tag[i] ^= nonce[i]; - tag[15] &= 0x7f; // Clear the highest bit - // encrypt tag as block - const t32 = u32(tag); - // prettier-ignore - let s0 = t32[0], s1 = t32[1], s2 = t32[2], s3 = t32[3]; - ({ s0, s1, s2, s3 } = encrypt(encKey, s0, s1, s2, s3)); - (t32[0] = s0), (t32[1] = s1), (t32[2] = s2), (t32[3] = s3); - return tag; - } - // actual decrypt/encrypt of message. - function processSiv(encKey: Uint32Array, tag: Uint8Array, input: Uint8Array) { - let block = copyBytes(tag); - block[15] |= 0x80; // Force highest bit - const res = ctr32(encKey, true, block, input); - // Cleanup - clean(block); - return res; - } - return { - encrypt(plaintext: Uint8Array) { - PLAIN_LIMIT(plaintext.length); - const { encKey, authKey } = deriveKeys(); - const tag = _computeTag(encKey, authKey, plaintext); - const toClean: (Uint8Array | Uint32Array)[] = [encKey, authKey, tag]; - if (!isAligned32(plaintext)) toClean.push((plaintext = copyBytes(plaintext))); - const out = new Uint8Array(plaintext.length + tagLength); - out.set(tag, plaintext.length); - out.set(processSiv(encKey, tag, plaintext)); - // Cleanup - clean(...toClean); - return out; - }, - decrypt(ciphertext: Uint8Array) { - CIPHER_LIMIT(ciphertext.length); - const tag = ciphertext.subarray(-tagLength); - const { encKey, authKey } = deriveKeys(); - const toClean: (Uint8Array | Uint32Array)[] = [encKey, authKey]; - if (!isAligned32(ciphertext)) toClean.push((ciphertext = copyBytes(ciphertext))); - const plaintext = processSiv(encKey, tag, ciphertext.subarray(0, -tagLength)); - const expectedTag = _computeTag(encKey, authKey, plaintext); - toClean.push(expectedTag); - if (!equalBytes(tag, expectedTag)) { - clean(...toClean); - throw new Error('invalid polyval tag'); - } - // Cleanup - clean(...toClean); - return plaintext; - }, - }; - } -); - -/** - * AES-GCM-SIV, not AES-SIV. - * This is legace name, use `gcmsiv` export instead. - * @deprecated - */ -export const siv: typeof gcmsiv = gcmsiv; - -function isBytes32(a: unknown): a is Uint32Array { - return ( - a instanceof Uint32Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint32Array') - ); -} - -function encryptBlock(xk: Uint32Array, block: Uint8Array): Uint8Array { - abytes(block, 16); - if (!isBytes32(xk)) throw new Error('_encryptBlock accepts result of expandKeyLE'); - const b32 = u32(block); - let { s0, s1, s2, s3 } = encrypt(xk, b32[0], b32[1], b32[2], b32[3]); - (b32[0] = s0), (b32[1] = s1), (b32[2] = s2), (b32[3] = s3); - return block; -} - -function decryptBlock(xk: Uint32Array, block: Uint8Array): Uint8Array { - abytes(block, 16); - if (!isBytes32(xk)) throw new Error('_decryptBlock accepts result of expandKeyLE'); - const b32 = u32(block); - let { s0, s1, s2, s3 } = decrypt(xk, b32[0], b32[1], b32[2], b32[3]); - (b32[0] = s0), (b32[1] = s1), (b32[2] = s2), (b32[3] = s3); - return block; -} - -/** - * AES-W (base for AESKW/AESKWP). - * Specs: [SP800-38F](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-38F.pdf), - * [RFC 3394](https://datatracker.ietf.org/doc/rfc3394/), - * [RFC 5649](https://datatracker.ietf.org/doc/rfc5649/). - */ -const AESW = { - /* - High-level pseudocode: - ``` - A: u64 = IV - out = [] - for (let i=0, ctr = 0; i<6; i++) { - for (const chunk of chunks(plaintext, 8)) { - A ^= swapEndianess(ctr++) - [A, res] = chunks(encrypt(A || chunk), 8); - out ||= res - } - } - out = A || out - ``` - Decrypt is the same, but reversed. - */ - encrypt(kek: Uint8Array, out: Uint8Array) { - // Size is limited to 4GB, otherwise ctr will overflow and we'll need to switch to bigints. - // If you need it larger, open an issue. - if (out.length >= 2 ** 32) throw new Error('plaintext should be less than 4gb'); - const xk = expandKeyLE(kek); - if (out.length === 16) encryptBlock(xk, out); - else { - const o32 = u32(out); - // prettier-ignore - let a0 = o32[0], a1 = o32[1]; // A - for (let j = 0, ctr = 1; j < 6; j++) { - for (let pos = 2; pos < o32.length; pos += 2, ctr++) { - const { s0, s1, s2, s3 } = encrypt(xk, a0, a1, o32[pos], o32[pos + 1]); - // A = MSB(64, B) ^ t where t = (n*j)+i - (a0 = s0), (a1 = s1 ^ byteSwap(ctr)), (o32[pos] = s2), (o32[pos + 1] = s3); - } - } - (o32[0] = a0), (o32[1] = a1); // out = A || out - } - xk.fill(0); - }, - decrypt(kek: Uint8Array, out: Uint8Array) { - if (out.length - 8 >= 2 ** 32) throw new Error('ciphertext should be less than 4gb'); - const xk = expandKeyDecLE(kek); - const chunks = out.length / 8 - 1; // first chunk is IV - if (chunks === 1) decryptBlock(xk, out); - else { - const o32 = u32(out); - // prettier-ignore - let a0 = o32[0], a1 = o32[1]; // A - for (let j = 0, ctr = chunks * 6; j < 6; j++) { - for (let pos = chunks * 2; pos >= 1; pos -= 2, ctr--) { - a1 ^= byteSwap(ctr); - const { s0, s1, s2, s3 } = decrypt(xk, a0, a1, o32[pos], o32[pos + 1]); - (a0 = s0), (a1 = s1), (o32[pos] = s2), (o32[pos + 1] = s3); - } - } - (o32[0] = a0), (o32[1] = a1); - } - xk.fill(0); - }, -}; - -const AESKW_IV = /* @__PURE__ */ new Uint8Array(8).fill(0xa6); // A6A6A6A6A6A6A6A6 - -/** - * AES-KW (key-wrap). Injects static IV into plaintext, adds counter, encrypts 6 times. - * Reduces block size from 16 to 8 bytes. - * For padded version, use aeskwp. - * [RFC 3394](https://datatracker.ietf.org/doc/rfc3394/), - * [NIST.SP.800-38F](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-38F.pdf). - */ -export const aeskw: ((kek: Uint8Array) => Cipher) & { - blockSize: number; -} = /* @__PURE__ */ wrapCipher( - { blockSize: 8 }, - (kek: Uint8Array): Cipher => ({ - encrypt(plaintext: Uint8Array) { - if (!plaintext.length || plaintext.length % 8 !== 0) - throw new Error('invalid plaintext length'); - if (plaintext.length === 8) - throw new Error('8-byte keys not allowed in AESKW, use AESKWP instead'); - const out = concatBytes(AESKW_IV, plaintext); - AESW.encrypt(kek, out); - return out; - }, - decrypt(ciphertext: Uint8Array) { - // ciphertext must be at least 24 bytes and a multiple of 8 bytes - // 24 because should have at least two block (1 iv + 2). - // Replace with 16 to enable '8-byte keys' - if (ciphertext.length % 8 !== 0 || ciphertext.length < 3 * 8) - throw new Error('invalid ciphertext length'); - const out = copyBytes(ciphertext); - AESW.decrypt(kek, out); - if (!equalBytes(out.subarray(0, 8), AESKW_IV)) throw new Error('integrity check failed'); - out.subarray(0, 8).fill(0); // ciphertext.subarray(0, 8) === IV, but we clean it anyway - return out.subarray(8); - }, - }) -); - -/* -We don't support 8-byte keys. The rabbit hole: - -- Wycheproof says: "NIST SP 800-38F does not define the wrapping of 8 byte keys. - RFC 3394 Section 2 on the other hand specifies that 8 byte keys are wrapped - by directly encrypting one block with AES." - - https://github.com/C2SP/wycheproof/blob/master/doc/key_wrap.md - - "RFC 3394 specifies in Section 2, that the input for the key wrap - algorithm must be at least two blocks and otherwise the constant - field and key are simply encrypted with ECB as a single block" -- What RFC 3394 actually says (in Section 2): - - "Before being wrapped, the key data is parsed into n blocks of 64 bits. - The only restriction the key wrap algorithm places on n is that n be - at least two" - - "For key data with length less than or equal to 64 bits, the constant - field used in this specification and the key data form a single - 128-bit codebook input making this key wrap unnecessary." -- Which means "assert(n >= 2)" and "use something else for 8 byte keys" -- NIST SP800-38F actually prohibits 8-byte in "5.3.1 Mandatory Limits". - It states that plaintext for KW should be "2 to 2^54 -1 semiblocks". -- So, where does "directly encrypt single block with AES" come from? - - Not RFC 3394. Pseudocode of key wrap in 2.2 explicitly uses - loop of 6 for any code path - - There is a weird W3C spec: - https://www.w3.org/TR/2002/REC-xmlenc-core-20021210/Overview.html#kw-aes128 - - This spec is outdated, as admitted by Wycheproof authors - - There is RFC 5649 for padded key wrap, which is padding construction on - top of AESKW. In '4.1.2' it says: "If the padded plaintext contains exactly - eight octets, then prepend the AIV as defined in Section 3 above to P[1] and - encrypt the resulting 128-bit block using AES in ECB mode [Modes] with key - K (the KEK). In this case, the output is two 64-bit blocks C[0] and C[1]:" - - Browser subtle crypto is actually crashes on wrapping keys less than 16 bytes: - `Error: error:1C8000E6:Provider routines::invalid input length] { opensslErrorStack: [ 'error:030000BD:digital envelope routines::update error' ]` - -In the end, seems like a bug in Wycheproof. -The 8-byte check can be easily disabled inside of AES_W. -*/ - -const AESKWP_IV = 0xa65959a6; // single u32le value - -/** - * AES-KW, but with padding and allows random keys. - * Second u32 of IV is used as counter for length. - * [RFC 5649](https://www.rfc-editor.org/rfc/rfc5649) - */ -export const aeskwp: ((kek: Uint8Array) => Cipher) & { - blockSize: number; -} = /* @__PURE__ */ wrapCipher( - { blockSize: 8 }, - (kek: Uint8Array): Cipher => ({ - encrypt(plaintext: Uint8Array) { - if (!plaintext.length) throw new Error('invalid plaintext length'); - const padded = Math.ceil(plaintext.length / 8) * 8; - const out = new Uint8Array(8 + padded); - out.set(plaintext, 8); - const out32 = u32(out); - out32[0] = AESKWP_IV; - out32[1] = byteSwap(plaintext.length); - AESW.encrypt(kek, out); - return out; - }, - decrypt(ciphertext: Uint8Array) { - // 16 because should have at least one block - if (ciphertext.length < 16) throw new Error('invalid ciphertext length'); - const out = copyBytes(ciphertext); - const o32 = u32(out); - AESW.decrypt(kek, out); - const len = byteSwap(o32[1]) >>> 0; - const padded = Math.ceil(len / 8) * 8; - if (o32[0] !== AESKWP_IV || out.length - 8 !== padded) - throw new Error('integrity check failed'); - for (let i = len; i < padded; i++) - if (out[8 + i] !== 0) throw new Error('integrity check failed'); - out.subarray(0, 8).fill(0); // ciphertext.subarray(0, 8) === IV, but we clean it anyway - return out.subarray(8, 8 + len); - }, - }) -); - -/** Unsafe low-level internal methods. May change at any time. */ -export const unsafe: { - expandKeyLE: typeof expandKeyLE; - expandKeyDecLE: typeof expandKeyDecLE; - encrypt: typeof encrypt; - decrypt: typeof decrypt; - encryptBlock: typeof encryptBlock; - decryptBlock: typeof decryptBlock; - ctrCounter: typeof ctrCounter; - ctr32: typeof ctr32; -} = { - expandKeyLE, - expandKeyDecLE, - encrypt, - decrypt, - encryptBlock, - decryptBlock, - ctrCounter, - ctr32, -}; diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/src/chacha.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/src/chacha.ts deleted file mode 100644 index 7a0b8892..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/src/chacha.ts +++ /dev/null @@ -1,290 +0,0 @@ -/** - * [ChaCha20](https://cr.yp.to/chacha.html) stream cipher, released - * in 2008. Developed after Salsa20, ChaCha aims to increase diffusion per round. - * It was standardized in [RFC 8439](https://datatracker.ietf.org/doc/html/rfc8439) and - * is now used in TLS 1.3. - * - * [XChaCha20](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-xchacha) - * extended-nonce variant is also provided. Similar to XSalsa, it's safe to use with - * randomly-generated nonces. - * - * Check out [PDF](http://cr.yp.to/chacha/chacha-20080128.pdf) and - * [wiki](https://en.wikipedia.org/wiki/Salsa20). - * @module - */ -import { createCipher, rotl } from './_arx.ts'; -import { poly1305 } from './_poly1305.ts'; -import { - type ARXCipher, - type CipherWithOutput, - type XorStream, - clean, - equalBytes, - getOutput, - u64Lengths, - wrapCipher, -} from './utils.ts'; - -/** - * ChaCha core function. - */ -// prettier-ignore -function chachaCore( - s: Uint32Array, k: Uint32Array, n: Uint32Array, out: Uint32Array, cnt: number, rounds = 20 -): void { - let y00 = s[0], y01 = s[1], y02 = s[2], y03 = s[3], // "expa" "nd 3" "2-by" "te k" - y04 = k[0], y05 = k[1], y06 = k[2], y07 = k[3], // Key Key Key Key - y08 = k[4], y09 = k[5], y10 = k[6], y11 = k[7], // Key Key Key Key - y12 = cnt, y13 = n[0], y14 = n[1], y15 = n[2]; // Counter Counter Nonce Nonce - // Save state to temporary variables - let x00 = y00, x01 = y01, x02 = y02, x03 = y03, - x04 = y04, x05 = y05, x06 = y06, x07 = y07, - x08 = y08, x09 = y09, x10 = y10, x11 = y11, - x12 = y12, x13 = y13, x14 = y14, x15 = y15; - for (let r = 0; r < rounds; r += 2) { - x00 = (x00 + x04) | 0; x12 = rotl(x12 ^ x00, 16); - x08 = (x08 + x12) | 0; x04 = rotl(x04 ^ x08, 12); - x00 = (x00 + x04) | 0; x12 = rotl(x12 ^ x00, 8); - x08 = (x08 + x12) | 0; x04 = rotl(x04 ^ x08, 7); - - x01 = (x01 + x05) | 0; x13 = rotl(x13 ^ x01, 16); - x09 = (x09 + x13) | 0; x05 = rotl(x05 ^ x09, 12); - x01 = (x01 + x05) | 0; x13 = rotl(x13 ^ x01, 8); - x09 = (x09 + x13) | 0; x05 = rotl(x05 ^ x09, 7); - - x02 = (x02 + x06) | 0; x14 = rotl(x14 ^ x02, 16); - x10 = (x10 + x14) | 0; x06 = rotl(x06 ^ x10, 12); - x02 = (x02 + x06) | 0; x14 = rotl(x14 ^ x02, 8); - x10 = (x10 + x14) | 0; x06 = rotl(x06 ^ x10, 7); - - x03 = (x03 + x07) | 0; x15 = rotl(x15 ^ x03, 16); - x11 = (x11 + x15) | 0; x07 = rotl(x07 ^ x11, 12); - x03 = (x03 + x07) | 0; x15 = rotl(x15 ^ x03, 8) - x11 = (x11 + x15) | 0; x07 = rotl(x07 ^ x11, 7); - - x00 = (x00 + x05) | 0; x15 = rotl(x15 ^ x00, 16); - x10 = (x10 + x15) | 0; x05 = rotl(x05 ^ x10, 12); - x00 = (x00 + x05) | 0; x15 = rotl(x15 ^ x00, 8); - x10 = (x10 + x15) | 0; x05 = rotl(x05 ^ x10, 7); - - x01 = (x01 + x06) | 0; x12 = rotl(x12 ^ x01, 16); - x11 = (x11 + x12) | 0; x06 = rotl(x06 ^ x11, 12); - x01 = (x01 + x06) | 0; x12 = rotl(x12 ^ x01, 8); - x11 = (x11 + x12) | 0; x06 = rotl(x06 ^ x11, 7); - - x02 = (x02 + x07) | 0; x13 = rotl(x13 ^ x02, 16); - x08 = (x08 + x13) | 0; x07 = rotl(x07 ^ x08, 12); - x02 = (x02 + x07) | 0; x13 = rotl(x13 ^ x02, 8); - x08 = (x08 + x13) | 0; x07 = rotl(x07 ^ x08, 7); - - x03 = (x03 + x04) | 0; x14 = rotl(x14 ^ x03, 16) - x09 = (x09 + x14) | 0; x04 = rotl(x04 ^ x09, 12); - x03 = (x03 + x04) | 0; x14 = rotl(x14 ^ x03, 8); - x09 = (x09 + x14) | 0; x04 = rotl(x04 ^ x09, 7); - } - // Write output - let oi = 0; - out[oi++] = (y00 + x00) | 0; out[oi++] = (y01 + x01) | 0; - out[oi++] = (y02 + x02) | 0; out[oi++] = (y03 + x03) | 0; - out[oi++] = (y04 + x04) | 0; out[oi++] = (y05 + x05) | 0; - out[oi++] = (y06 + x06) | 0; out[oi++] = (y07 + x07) | 0; - out[oi++] = (y08 + x08) | 0; out[oi++] = (y09 + x09) | 0; - out[oi++] = (y10 + x10) | 0; out[oi++] = (y11 + x11) | 0; - out[oi++] = (y12 + x12) | 0; out[oi++] = (y13 + x13) | 0; - out[oi++] = (y14 + x14) | 0; out[oi++] = (y15 + x15) | 0; -} -/** - * hchacha helper method, used primarily in xchacha, to hash - * key and nonce into key' and nonce'. - * Same as chachaCore, but there doesn't seem to be a way to move the block - * out without 25% performance hit. - */ -// prettier-ignore -export function hchacha( - s: Uint32Array, k: Uint32Array, i: Uint32Array, o32: Uint32Array -): void { - let x00 = s[0], x01 = s[1], x02 = s[2], x03 = s[3], - x04 = k[0], x05 = k[1], x06 = k[2], x07 = k[3], - x08 = k[4], x09 = k[5], x10 = k[6], x11 = k[7], - x12 = i[0], x13 = i[1], x14 = i[2], x15 = i[3]; - for (let r = 0; r < 20; r += 2) { - x00 = (x00 + x04) | 0; x12 = rotl(x12 ^ x00, 16); - x08 = (x08 + x12) | 0; x04 = rotl(x04 ^ x08, 12); - x00 = (x00 + x04) | 0; x12 = rotl(x12 ^ x00, 8); - x08 = (x08 + x12) | 0; x04 = rotl(x04 ^ x08, 7); - - x01 = (x01 + x05) | 0; x13 = rotl(x13 ^ x01, 16); - x09 = (x09 + x13) | 0; x05 = rotl(x05 ^ x09, 12); - x01 = (x01 + x05) | 0; x13 = rotl(x13 ^ x01, 8); - x09 = (x09 + x13) | 0; x05 = rotl(x05 ^ x09, 7); - - x02 = (x02 + x06) | 0; x14 = rotl(x14 ^ x02, 16); - x10 = (x10 + x14) | 0; x06 = rotl(x06 ^ x10, 12); - x02 = (x02 + x06) | 0; x14 = rotl(x14 ^ x02, 8); - x10 = (x10 + x14) | 0; x06 = rotl(x06 ^ x10, 7); - - x03 = (x03 + x07) | 0; x15 = rotl(x15 ^ x03, 16); - x11 = (x11 + x15) | 0; x07 = rotl(x07 ^ x11, 12); - x03 = (x03 + x07) | 0; x15 = rotl(x15 ^ x03, 8) - x11 = (x11 + x15) | 0; x07 = rotl(x07 ^ x11, 7); - - x00 = (x00 + x05) | 0; x15 = rotl(x15 ^ x00, 16); - x10 = (x10 + x15) | 0; x05 = rotl(x05 ^ x10, 12); - x00 = (x00 + x05) | 0; x15 = rotl(x15 ^ x00, 8); - x10 = (x10 + x15) | 0; x05 = rotl(x05 ^ x10, 7); - - x01 = (x01 + x06) | 0; x12 = rotl(x12 ^ x01, 16); - x11 = (x11 + x12) | 0; x06 = rotl(x06 ^ x11, 12); - x01 = (x01 + x06) | 0; x12 = rotl(x12 ^ x01, 8); - x11 = (x11 + x12) | 0; x06 = rotl(x06 ^ x11, 7); - - x02 = (x02 + x07) | 0; x13 = rotl(x13 ^ x02, 16); - x08 = (x08 + x13) | 0; x07 = rotl(x07 ^ x08, 12); - x02 = (x02 + x07) | 0; x13 = rotl(x13 ^ x02, 8); - x08 = (x08 + x13) | 0; x07 = rotl(x07 ^ x08, 7); - - x03 = (x03 + x04) | 0; x14 = rotl(x14 ^ x03, 16) - x09 = (x09 + x14) | 0; x04 = rotl(x04 ^ x09, 12); - x03 = (x03 + x04) | 0; x14 = rotl(x14 ^ x03, 8); - x09 = (x09 + x14) | 0; x04 = rotl(x04 ^ x09, 7); - } - let oi = 0; - o32[oi++] = x00; o32[oi++] = x01; - o32[oi++] = x02; o32[oi++] = x03; - o32[oi++] = x12; o32[oi++] = x13; - o32[oi++] = x14; o32[oi++] = x15; -} -/** - * Original, non-RFC chacha20 from DJB. 8-byte nonce, 8-byte counter. - */ -export const chacha20orig: XorStream = /* @__PURE__ */ createCipher(chachaCore, { - counterRight: false, - counterLength: 8, - allowShortKeys: true, -}); -/** - * ChaCha stream cipher. Conforms to RFC 8439 (IETF, TLS). 12-byte nonce, 4-byte counter. - * With 12-byte nonce, it's not safe to use fill it with random (CSPRNG), due to collision chance. - */ -export const chacha20: XorStream = /* @__PURE__ */ createCipher(chachaCore, { - counterRight: false, - counterLength: 4, - allowShortKeys: false, -}); - -/** - * XChaCha eXtended-nonce ChaCha. 24-byte nonce. - * With 24-byte nonce, it's safe to use fill it with random (CSPRNG). - * https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-xchacha - */ -export const xchacha20: XorStream = /* @__PURE__ */ createCipher(chachaCore, { - counterRight: false, - counterLength: 8, - extendNonceFn: hchacha, - allowShortKeys: false, -}); - -/** - * Reduced 8-round chacha, described in original paper. - */ -export const chacha8: XorStream = /* @__PURE__ */ createCipher(chachaCore, { - counterRight: false, - counterLength: 4, - rounds: 8, -}); - -/** - * Reduced 12-round chacha, described in original paper. - */ -export const chacha12: XorStream = /* @__PURE__ */ createCipher(chachaCore, { - counterRight: false, - counterLength: 4, - rounds: 12, -}); - -const ZEROS16 = /* @__PURE__ */ new Uint8Array(16); -// Pad to digest size with zeros -const updatePadded = (h: ReturnType, msg: Uint8Array) => { - h.update(msg); - const left = msg.length % 16; - if (left) h.update(ZEROS16.subarray(left)); -}; - -const ZEROS32 = /* @__PURE__ */ new Uint8Array(32); -function computeTag( - fn: XorStream, - key: Uint8Array, - nonce: Uint8Array, - data: Uint8Array, - AAD?: Uint8Array -): Uint8Array { - const authKey = fn(key, nonce, ZEROS32); - const h = poly1305.create(authKey); - if (AAD) updatePadded(h, AAD); - updatePadded(h, data); - const num = u64Lengths(data.length, AAD ? AAD.length : 0, true); - h.update(num); - const res = h.digest(); - clean(authKey, num); - return res; -} - -/** - * AEAD algorithm from RFC 8439. - * Salsa20 and chacha (RFC 8439) use poly1305 differently. - * We could have composed them similar to: - * https://github.com/paulmillr/scure-base/blob/b266c73dde977b1dd7ef40ef7a23cc15aab526b3/index.ts#L250 - * But it's hard because of authKey: - * In salsa20, authKey changes position in salsa stream. - * In chacha, authKey can't be computed inside computeTag, it modifies the counter. - */ -export const _poly1305_aead = - (xorStream: XorStream) => - (key: Uint8Array, nonce: Uint8Array, AAD?: Uint8Array): CipherWithOutput => { - const tagLength = 16; - return { - encrypt(plaintext: Uint8Array, output?: Uint8Array) { - const plength = plaintext.length; - output = getOutput(plength + tagLength, output, false); - output.set(plaintext); - const oPlain = output.subarray(0, -tagLength); - xorStream(key, nonce, oPlain, oPlain, 1); - const tag = computeTag(xorStream, key, nonce, oPlain, AAD); - output.set(tag, plength); // append tag - clean(tag); - return output; - }, - decrypt(ciphertext: Uint8Array, output?: Uint8Array) { - output = getOutput(ciphertext.length - tagLength, output, false); - const data = ciphertext.subarray(0, -tagLength); - const passedTag = ciphertext.subarray(-tagLength); - const tag = computeTag(xorStream, key, nonce, data, AAD); - if (!equalBytes(passedTag, tag)) throw new Error('invalid tag'); - output.set(ciphertext.subarray(0, -tagLength)); - xorStream(key, nonce, output, output, 1); // start stream with i=1 - clean(tag); - return output; - }, - }; - }; - -/** - * ChaCha20-Poly1305 from RFC 8439. - * - * Unsafe to use random nonces under the same key, due to collision chance. - * Prefer XChaCha instead. - */ -export const chacha20poly1305: ARXCipher = /* @__PURE__ */ wrapCipher( - { blockSize: 64, nonceLength: 12, tagLength: 16 }, - _poly1305_aead(chacha20) -); -/** - * XChaCha20-Poly1305 extended-nonce chacha. - * - * Can be safely used with random nonces (CSPRNG). - * See [IRTF draft](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-xchacha). - */ -export const xchacha20poly1305: ARXCipher = /* @__PURE__ */ wrapCipher( - { blockSize: 64, nonceLength: 24, tagLength: 16 }, - _poly1305_aead(xchacha20) -); diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/src/crypto.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/src/crypto.ts deleted file mode 100644 index 61a59cff..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/src/crypto.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Internal webcrypto alias. - * We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+. - * See utils.ts for details. - * @module - */ -declare const globalThis: Record | undefined; -export const crypto: any = - typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined; diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/src/cryptoNode.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/src/cryptoNode.ts deleted file mode 100644 index 53a3cc71..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/src/cryptoNode.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Internal webcrypto alias. - * We prefer WebCrypto aka globalThis.crypto, which exists in node.js 16+. - * Falls back to Node.js built-in crypto for Node.js <=v14. - * See utils.ts for details. - * @module - */ -// @ts-ignore -import * as nc from 'node:crypto'; -export const crypto: any = - nc && typeof nc === 'object' && 'webcrypto' in nc - ? (nc.webcrypto as any) - : nc && typeof nc === 'object' && 'randomBytes' in nc - ? nc - : undefined; diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/src/ff1.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/src/ff1.ts deleted file mode 100644 index 2d4e7772..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/src/ff1.ts +++ /dev/null @@ -1,162 +0,0 @@ -/** - * FPE-FF1 (Format-preserving encryption algorithm) specified in - * [NIST 800-38G](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-38G.pdf). - * @module - */ -import { unsafe } from './aes.ts'; -import { type Cipher, abytes, anumber, bytesToNumberBE, clean, numberToBytesBE } from './utils.ts'; - -// NOTE: no point in inlining encrypt instead of encryptBlock, since BigInt stuff will be slow -const { expandKeyLE, encryptBlock } = unsafe; - -// Format-preserving encryption algorithm (FPE-FF1) specified in NIST Special Publication 800-38G. -// https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-38G.pdf - -const BLOCK_LEN = 16; - -// Calculates a modulo b -function mod(a: number, b: number): number; -function mod(a: bigint, b: bigint): bigint; -function mod(a: any, b: any): number | bigint { - const result = a % b; - return result >= 0 ? result : b + result; -} - -function NUMradix(radix: number, data: number[]): bigint { - let res = BigInt(0); - for (let i of data) res = res * BigInt(radix) + BigInt(i); - return res; -} - -function getRound(radix: number, key: Uint8Array, tweak: Uint8Array, x: number[]) { - if (radix > 2 ** 16 - 1) throw new Error('invalid radix ' + radix); - // radix**minlen ≥ 100 - const minLen = Math.ceil(Math.log(100) / Math.log(radix)); - const maxLen = 2 ** 32 - 1; - // 2 ≤ minlen ≤ maxlen < 2**32 - if (2 > minLen || minLen > maxLen || maxLen >= 2 ** 32) - throw new Error('Invalid radix: 2 ≤ minlen ≤ maxlen < 2**32'); - if (!Array.isArray(x)) throw new Error('invalid X'); - if (x.length < minLen || x.length > maxLen) throw new Error('X is outside minLen..maxLen bounds'); - const u = Math.floor(x.length / 2); - const v = x.length - u; - const b = Math.ceil(Math.ceil(v * Math.log2(radix)) / 8); - const d = 4 * Math.ceil(b / 4) + 4; - const padding = mod(-tweak.length - b - 1, 16); - // P = [1]1 || [2]1 || [1]1 || [radix]3 || [10]1 || [u mod 256]1 || [n]4 || [t]4. - const P = Uint8Array.from([1, 2, 1, 0, 0, 0, 10, u, 0, 0, 0, 0, 0, 0, 0, 0]); - const view = new DataView(P.buffer); - view.setUint16(4, radix, false); - view.setUint32(8, x.length, false); - view.setUint32(12, tweak.length, false); - // Q = T || [0](−t−b−1) mod 16 || [i]1 || [NUMradix(B)]b. - const PQ = new Uint8Array(P.length + tweak.length + padding + 1 + b); - PQ.set(P); - clean(P); - PQ.set(tweak, P.length); - const xk = expandKeyLE(key); - const round = (A: number[], B: number[], i: number, decrypt = false) => { - // Q = ... || [i]1 || [NUMradix(B)]b. - PQ[PQ.length - b - 1] = i; - if (b) PQ.set(numberToBytesBE(NUMradix(radix, B), b), PQ.length - b); - // PRF - let r = new Uint8Array(16); - for (let j = 0; j < PQ.length / BLOCK_LEN; j++) { - for (let i = 0; i < BLOCK_LEN; i++) r[i] ^= PQ[j * BLOCK_LEN + i]; - encryptBlock(xk, r); - } - // Let S be the first d bytes of the following string of ⎡d/16⎤ blocks: - // R || CIPHK(R ⊕[1]16) || CIPHK(R ⊕[2]16) ...CIPHK(R ⊕[⎡d / 16⎤ – 1]16). - let s = Array.from(r); - for (let j = 1; s.length < d; j++) { - const block = numberToBytesBE(BigInt(j), 16); - for (let k = 0; k < BLOCK_LEN; k++) block[k] ^= r[k]; - s.push(...Array.from(encryptBlock(xk, block))); - } - let y = bytesToNumberBE(Uint8Array.from(s.slice(0, d))); - s.fill(0); - if (decrypt) y = -y; - const m = i % 2 === 0 ? u : v; - let c = mod(NUMradix(radix, A) + y, BigInt(radix) ** BigInt(m)); - // STR(radix, m, c) - const C = Array(m).fill(0); - for (let i = 0; i < m; i++, c /= BigInt(radix)) C[m - 1 - i] = Number(c % BigInt(radix)); - A.fill(0); - A = B; - B = C; - return [A, B]; - }; - const destroy = () => { - clean(xk, PQ); - }; - return { u, round, destroy }; -} - -const EMPTY_BUF = /* @__PURE__ */ Uint8Array.of(); - -/** FPE-FF1 format-preserving encryption */ -export function FF1( - radix: number, - key: Uint8Array, - tweak: Uint8Array = EMPTY_BUF -): { encrypt(x: number[]): number[]; decrypt(x: number[]): number[] } { - anumber(radix); - abytes(key); - abytes(tweak); - const PQ = getRound.bind(null, radix, key, tweak); - return { - encrypt(x: number[]): number[] { - const { u, round, destroy } = PQ(x); - let [A, B] = [x.slice(0, u), x.slice(u)]; - for (let i = 0; i < 10; i++) [A, B] = round(A, B, i); - destroy(); - const res = A.concat(B); - A.fill(0); - B.fill(0); - return res; - }, - decrypt(x: number[]): number[] { - const { u, round, destroy } = PQ(x); - // The FF1.Decrypt algorithm is similar to the FF1.Encrypt algorithm; - // the differences are in Step 6, where: - // 1) the order of the indices is reversed, - // 2) the roles of A and B are swapped - // 3) modular addition is replaced by modular subtraction, in Step 6vi. - let [B, A] = [x.slice(0, u), x.slice(u)]; - for (let i = 9; i >= 0; i--) [A, B] = round(A, B, i, true); - destroy(); - const res = B.concat(A); - A.fill(0); - B.fill(0); - return res; - }, - }; -} -// Binary string which encodes each byte in little-endian byte order -const binLE = { - encode(bytes: Uint8Array): number[] { - const x = []; - for (let i = 0; i < bytes.length; i++) { - for (let j = 0, tmp = bytes[i]; j < 8; j++, tmp >>= 1) x.push(tmp & 1); - } - return x; - }, - decode(b: number[]): Uint8Array { - if (!Array.isArray(b) || b.length % 8) throw new Error('Invalid binary string'); - const res = new Uint8Array(b.length / 8); - for (let i = 0, j = 0; i < res.length; i++) { - res[i] = b[j++] | (b[j++] << 1) | (b[j++] << 2) | (b[j++] << 3); - res[i] |= (b[j++] << 4) | (b[j++] << 5) | (b[j++] << 6) | (b[j++] << 7); - } - return res; - }, -}; - -/** Binary version of FPE-FF1 format-preserving encryption. */ -export function BinaryFF1(key: Uint8Array, tweak: Uint8Array = EMPTY_BUF): Cipher { - const ff1 = FF1(2, key, tweak); - return { - encrypt: (x: Uint8Array) => binLE.decode(ff1.encrypt(binLE.encode(x))), - decrypt: (x: Uint8Array) => binLE.decode(ff1.decrypt(binLE.encode(x))), - }; -} diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/src/index.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/src/index.ts deleted file mode 100644 index 4919d69b..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/src/index.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Audited & minimal JS implementation of Salsa20, ChaCha and AES. Check out individual modules. - * @example -```js -import { gcm, siv } from '@noble/ciphers/aes'; -import { xsalsa20poly1305 } from '@noble/ciphers/salsa'; -import { secretbox } from '@noble/ciphers/salsa'; // == xsalsa20poly1305 -import { chacha20poly1305, xchacha20poly1305 } from '@noble/ciphers/chacha'; - -// Unauthenticated encryption: make sure to use HMAC or similar -import { ctr, cfb, cbc, ecb } from '@noble/ciphers/aes'; -import { salsa20, xsalsa20 } from '@noble/ciphers/salsa'; -import { chacha20, xchacha20, chacha8, chacha12 } from '@noble/ciphers/chacha'; - -// KW -import { aeskw, aeskwp } from '@noble/ciphers/aes'; - -// Utilities -import { bytesToHex, hexToBytes, bytesToUtf8, utf8ToBytes } from '@noble/ciphers/utils'; -import { managedNonce, randomBytes } from '@noble/ciphers/webcrypto'; -import { poly1305 } from '@noble/ciphers/_poly1305'; -import { ghash, polyval } from '@noble/ciphers/_polyval'; -``` - * @module - */ -throw new Error('root module cannot be imported: import submodules instead. Check out README'); diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/src/package.json b/tools/mnemonic-test/node_modules/@noble/ciphers/src/package.json deleted file mode 100644 index 3dbc1ca5..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/src/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "module" -} diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/src/salsa.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/src/salsa.ts deleted file mode 100644 index 02a568de..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/src/salsa.ts +++ /dev/null @@ -1,189 +0,0 @@ -/** - * [Salsa20](https://cr.yp.to/snuffle.html) stream cipher, released in 2005. - * - * Salsa's goal was to implement AES replacement that does not rely on S-Boxes, - * which are hard to implement in a constant-time manner. - * Salsa20 is usually faster than AES, a big deal on slow, budget mobile phones. - * - * [XSalsa20](https://cr.yp.to/snuffle/xsalsa-20110204.pdf), extended-nonce - * variant was released in 2008. It switched nonces from 96-bit to 192-bit, - * and became safe to be picked at random. - * - * Check out [PDF](https://cr.yp.to/snuffle/salsafamily-20071225.pdf) and - * [wiki](https://en.wikipedia.org/wiki/Salsa20). - * @module - */ -import { createCipher, rotl } from './_arx.ts'; -import { poly1305 } from './_poly1305.ts'; -import { - abytes, - type ARXCipher, - type CipherWithOutput, - clean, - equalBytes, - getOutput, - wrapCipher, - type XorStream, -} from './utils.ts'; - -/** Salsa20 core function. */ -// prettier-ignore -function salsaCore( - s: Uint32Array, k: Uint32Array, n: Uint32Array, out: Uint32Array, cnt: number, rounds = 20 -): void { - // Based on https://cr.yp.to/salsa20.html - let y00 = s[0], y01 = k[0], y02 = k[1], y03 = k[2], // "expa" Key Key Key - y04 = k[3], y05 = s[1], y06 = n[0], y07 = n[1], // Key "nd 3" Nonce Nonce - y08 = cnt, y09 = 0, y10 = s[2], y11 = k[4], // Pos. Pos. "2-by" Key - y12 = k[5], y13 = k[6], y14 = k[7], y15 = s[3]; // Key Key Key "te k" - // Save state to temporary variables - let x00 = y00, x01 = y01, x02 = y02, x03 = y03, - x04 = y04, x05 = y05, x06 = y06, x07 = y07, - x08 = y08, x09 = y09, x10 = y10, x11 = y11, - x12 = y12, x13 = y13, x14 = y14, x15 = y15; - for (let r = 0; r < rounds; r += 2) { - x04 ^= rotl(x00 + x12 | 0, 7); x08 ^= rotl(x04 + x00 | 0, 9); - x12 ^= rotl(x08 + x04 | 0, 13); x00 ^= rotl(x12 + x08 | 0, 18); - x09 ^= rotl(x05 + x01 | 0, 7); x13 ^= rotl(x09 + x05 | 0, 9); - x01 ^= rotl(x13 + x09 | 0, 13); x05 ^= rotl(x01 + x13 | 0, 18); - x14 ^= rotl(x10 + x06 | 0, 7); x02 ^= rotl(x14 + x10 | 0, 9); - x06 ^= rotl(x02 + x14 | 0, 13); x10 ^= rotl(x06 + x02 | 0, 18); - x03 ^= rotl(x15 + x11 | 0, 7); x07 ^= rotl(x03 + x15 | 0, 9); - x11 ^= rotl(x07 + x03 | 0, 13); x15 ^= rotl(x11 + x07 | 0, 18); - x01 ^= rotl(x00 + x03 | 0, 7); x02 ^= rotl(x01 + x00 | 0, 9); - x03 ^= rotl(x02 + x01 | 0, 13); x00 ^= rotl(x03 + x02 | 0, 18); - x06 ^= rotl(x05 + x04 | 0, 7); x07 ^= rotl(x06 + x05 | 0, 9); - x04 ^= rotl(x07 + x06 | 0, 13); x05 ^= rotl(x04 + x07 | 0, 18); - x11 ^= rotl(x10 + x09 | 0, 7); x08 ^= rotl(x11 + x10 | 0, 9); - x09 ^= rotl(x08 + x11 | 0, 13); x10 ^= rotl(x09 + x08 | 0, 18); - x12 ^= rotl(x15 + x14 | 0, 7); x13 ^= rotl(x12 + x15 | 0, 9); - x14 ^= rotl(x13 + x12 | 0, 13); x15 ^= rotl(x14 + x13 | 0, 18); - } - // Write output - let oi = 0; - out[oi++] = (y00 + x00) | 0; out[oi++] = (y01 + x01) | 0; - out[oi++] = (y02 + x02) | 0; out[oi++] = (y03 + x03) | 0; - out[oi++] = (y04 + x04) | 0; out[oi++] = (y05 + x05) | 0; - out[oi++] = (y06 + x06) | 0; out[oi++] = (y07 + x07) | 0; - out[oi++] = (y08 + x08) | 0; out[oi++] = (y09 + x09) | 0; - out[oi++] = (y10 + x10) | 0; out[oi++] = (y11 + x11) | 0; - out[oi++] = (y12 + x12) | 0; out[oi++] = (y13 + x13) | 0; - out[oi++] = (y14 + x14) | 0; out[oi++] = (y15 + x15) | 0; -} - -/** - * hsalsa hashing function, used primarily in xsalsa, to hash - * key and nonce into key' and nonce'. - * Same as salsaCore, but there doesn't seem to be a way to move the block - * out without 25% performance hit. - */ -// prettier-ignore -export function hsalsa( - s: Uint32Array, k: Uint32Array, i: Uint32Array, o32: Uint32Array -): void { - let x00 = s[0], x01 = k[0], x02 = k[1], x03 = k[2], - x04 = k[3], x05 = s[1], x06 = i[0], x07 = i[1], - x08 = i[2], x09 = i[3], x10 = s[2], x11 = k[4], - x12 = k[5], x13 = k[6], x14 = k[7], x15 = s[3]; - for (let r = 0; r < 20; r += 2) { - x04 ^= rotl(x00 + x12 | 0, 7); x08 ^= rotl(x04 + x00 | 0, 9); - x12 ^= rotl(x08 + x04 | 0, 13); x00 ^= rotl(x12 + x08 | 0, 18); - x09 ^= rotl(x05 + x01 | 0, 7); x13 ^= rotl(x09 + x05 | 0, 9); - x01 ^= rotl(x13 + x09 | 0, 13); x05 ^= rotl(x01 + x13 | 0, 18); - x14 ^= rotl(x10 + x06 | 0, 7); x02 ^= rotl(x14 + x10 | 0, 9); - x06 ^= rotl(x02 + x14 | 0, 13); x10 ^= rotl(x06 + x02 | 0, 18); - x03 ^= rotl(x15 + x11 | 0, 7); x07 ^= rotl(x03 + x15 | 0, 9); - x11 ^= rotl(x07 + x03 | 0, 13); x15 ^= rotl(x11 + x07 | 0, 18); - x01 ^= rotl(x00 + x03 | 0, 7); x02 ^= rotl(x01 + x00 | 0, 9); - x03 ^= rotl(x02 + x01 | 0, 13); x00 ^= rotl(x03 + x02 | 0, 18); - x06 ^= rotl(x05 + x04 | 0, 7); x07 ^= rotl(x06 + x05 | 0, 9); - x04 ^= rotl(x07 + x06 | 0, 13); x05 ^= rotl(x04 + x07 | 0, 18); - x11 ^= rotl(x10 + x09 | 0, 7); x08 ^= rotl(x11 + x10 | 0, 9); - x09 ^= rotl(x08 + x11 | 0, 13); x10 ^= rotl(x09 + x08 | 0, 18); - x12 ^= rotl(x15 + x14 | 0, 7); x13 ^= rotl(x12 + x15 | 0, 9); - x14 ^= rotl(x13 + x12 | 0, 13); x15 ^= rotl(x14 + x13 | 0, 18); - } - let oi = 0; - o32[oi++] = x00; o32[oi++] = x05; - o32[oi++] = x10; o32[oi++] = x15; - o32[oi++] = x06; o32[oi++] = x07; - o32[oi++] = x08; o32[oi++] = x09; -} - -/** - * Salsa20 from original paper. - * Unsafe to use random nonces under the same key, due to collision chance. - * Prefer XSalsa instead. - */ -export const salsa20: XorStream = /* @__PURE__ */ createCipher(salsaCore, { - allowShortKeys: true, - counterRight: true, -}); - -/** - * xsalsa20 eXtended-nonce salsa. - * Can be safely used with random 24-byte nonces (CSPRNG). - */ -export const xsalsa20: XorStream = /* @__PURE__ */ createCipher(salsaCore, { - counterRight: true, - extendNonceFn: hsalsa, -}); - -/** - * xsalsa20-poly1305 eXtended-nonce salsa. - * Can be safely used with random 24-byte nonces (CSPRNG). - * Also known as secretbox from libsodium / nacl. - */ -export const xsalsa20poly1305: ARXCipher = /* @__PURE__ */ wrapCipher( - { blockSize: 64, nonceLength: 24, tagLength: 16 }, - (key: Uint8Array, nonce: Uint8Array): CipherWithOutput => { - return { - encrypt(plaintext: Uint8Array, output?: Uint8Array) { - // xsalsa20poly1305 optimizes by calculating auth key during the same call as encryption. - // Unfortunately, makes it hard to separate tag calculation & encryption itself, - // because 32 bytes is half-block of 64-byte salsa. - output = getOutput(plaintext.length + 32, output, false); // need 32 additional bytes, see above - const authKey = output.subarray(0, 32); // output[0..32] = poly1305 auth key - const ciphPlaintext = output.subarray(32); // output[32..] = plaintext, then ciphertext - output.set(plaintext, 32); - clean(authKey); // authKey is produced by xoring with zeros - xsalsa20(key, nonce, output, output); // output = stream ^ output; authKey = stream ^ zeros(32) - const tag = poly1305(ciphPlaintext, authKey); // calculate tag over ciphertext - output.set(tag, 16); // output[16..32] = tag - clean(output.subarray(0, 16), tag); // clean-up authKey remnants & copy of tag - return output.subarray(16); // return output[16..] - }, - decrypt(ciphertext: Uint8Array, output?: Uint8Array) { - // tmp part passed tag ciphertext - // [0..32] [32..48] [48..] - abytes(ciphertext); - output = getOutput(ciphertext.length + 32, output, false); - const tmp = output.subarray(0, 32); // output[0..32] is used to calc authKey - const passedTag = output.subarray(32, 48); // output[32..48] = passed tag - const ciphPlaintext = output.subarray(48); // output[48..] = ciphertext, then plaintext - output.set(ciphertext, 32); // copy ciphertext into output - clean(tmp); // authKey is produced by xoring with zeros - const authKey = xsalsa20(key, nonce, tmp, tmp); // authKey = stream ^ zeros(32) - const tag = poly1305(ciphPlaintext, authKey); // calculate tag over ciphertext - if (!equalBytes(passedTag, tag)) throw new Error('invalid tag'); - xsalsa20(key, nonce, output.subarray(16), output.subarray(16)); // output = stream ^ output[16..] - clean(tmp, passedTag, tag); - return ciphPlaintext; // return output[48..], skipping zeroized output[0..48] - }, - }; - } -); - -/** - * Alias to `xsalsa20poly1305`, for compatibility with libsodium / nacl - */ -export function secretbox( - key: Uint8Array, - nonce: Uint8Array -): { - seal: (plaintext: Uint8Array, output?: Uint8Array) => Uint8Array; - open: (ciphertext: Uint8Array, output?: Uint8Array) => Uint8Array; -} { - const xs = xsalsa20poly1305(key, nonce); - return { seal: xs.encrypt, open: xs.decrypt }; -} diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/src/utils.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/src/utils.ts deleted file mode 100644 index 37b65418..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/src/utils.ts +++ /dev/null @@ -1,453 +0,0 @@ -/** - * Utilities for hex, bytes, CSPRNG. - * @module - */ -/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */ - -/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */ -export function isBytes(a: unknown): a is Uint8Array { - return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array'); -} - -/** Asserts something is boolean. */ -export function abool(b: boolean): void { - if (typeof b !== 'boolean') throw new Error(`boolean expected, not ${b}`); -} - -/** Asserts something is positive integer. */ -export function anumber(n: number): void { - if (!Number.isSafeInteger(n) || n < 0) throw new Error('positive integer expected, got ' + n); -} - -/** Asserts something is Uint8Array. */ -export function abytes(b: Uint8Array | undefined, ...lengths: number[]): void { - if (!isBytes(b)) throw new Error('Uint8Array expected'); - if (lengths.length > 0 && !lengths.includes(b.length)) - throw new Error('Uint8Array expected of length ' + lengths + ', got length=' + b.length); -} - -/** - * Asserts something is hash - * TODO: remove - * @deprecated - */ -export function ahash(h: IHash): void { - if (typeof h !== 'function' || typeof h.create !== 'function') - throw new Error('Hash should be wrapped by utils.createHasher'); - anumber(h.outputLen); - anumber(h.blockLen); -} - -/** Asserts a hash instance has not been destroyed / finished */ -export function aexists(instance: any, checkFinished = true): void { - if (instance.destroyed) throw new Error('Hash instance has been destroyed'); - if (checkFinished && instance.finished) throw new Error('Hash#digest() has already been called'); -} - -/** Asserts output is properly-sized byte array */ -export function aoutput(out: any, instance: any): void { - abytes(out); - const min = instance.outputLen; - if (out.length < min) { - throw new Error('digestInto() expects output buffer of length at least ' + min); - } -} - -export type IHash = { - (data: string | Uint8Array): Uint8Array; - blockLen: number; - outputLen: number; - create: any; -}; - -/** Generic type encompassing 8/16/32-byte arrays - but not 64-byte. */ -// prettier-ignore -export type TypedArray = Int8Array | Uint8ClampedArray | Uint8Array | - Uint16Array | Int16Array | Uint32Array | Int32Array; - -/** Cast u8 / u16 / u32 to u8. */ -export function u8(arr: TypedArray): Uint8Array { - return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength); -} - -/** Cast u8 / u16 / u32 to u32. */ -export function u32(arr: TypedArray): Uint32Array { - return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); -} - -/** Zeroize a byte array. Warning: JS provides no guarantees. */ -export function clean(...arrays: TypedArray[]): void { - for (let i = 0; i < arrays.length; i++) { - arrays[i].fill(0); - } -} - -/** Create DataView of an array for easy byte-level manipulation. */ -export function createView(arr: TypedArray): DataView { - return new DataView(arr.buffer, arr.byteOffset, arr.byteLength); -} - -/** Is current platform little-endian? Most are. Big-Endian platform: IBM */ -export const isLE: boolean = /* @__PURE__ */ (() => - new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)(); - -// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex -const hasHexBuiltin: boolean = /* @__PURE__ */ (() => - // @ts-ignore - typeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function')(); - -// Array where index 0xf0 (240) is mapped to string 'f0' -const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => - i.toString(16).padStart(2, '0') -); - -/** - * Convert byte array to hex string. Uses built-in function, when available. - * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123' - */ -export function bytesToHex(bytes: Uint8Array): string { - abytes(bytes); - // @ts-ignore - if (hasHexBuiltin) return bytes.toHex(); - // pre-caching improves the speed 6x - let hex = ''; - for (let i = 0; i < bytes.length; i++) { - hex += hexes[bytes[i]]; - } - return hex; -} - -// We use optimized technique to convert hex string to byte array -const asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 } as const; -function asciiToBase16(ch: number): number | undefined { - if (ch >= asciis._0 && ch <= asciis._9) return ch - asciis._0; // '2' => 50-48 - if (ch >= asciis.A && ch <= asciis.F) return ch - (asciis.A - 10); // 'B' => 66-(65-10) - if (ch >= asciis.a && ch <= asciis.f) return ch - (asciis.a - 10); // 'b' => 98-(97-10) - return; -} - -/** - * Convert hex string to byte array. Uses built-in function, when available. - * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23]) - */ -export function hexToBytes(hex: string): Uint8Array { - if (typeof hex !== 'string') throw new Error('hex string expected, got ' + typeof hex); - // @ts-ignore - if (hasHexBuiltin) return Uint8Array.fromHex(hex); - const hl = hex.length; - const al = hl / 2; - if (hl % 2) throw new Error('hex string expected, got unpadded hex of length ' + hl); - const array = new Uint8Array(al); - for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) { - const n1 = asciiToBase16(hex.charCodeAt(hi)); - const n2 = asciiToBase16(hex.charCodeAt(hi + 1)); - if (n1 === undefined || n2 === undefined) { - const char = hex[hi] + hex[hi + 1]; - throw new Error('hex string expected, got non-hex character "' + char + '" at index ' + hi); - } - array[ai] = n1 * 16 + n2; // multiply first octet, e.g. 'a3' => 10*16+3 => 160 + 3 => 163 - } - return array; -} - -// Used in micro -export function hexToNumber(hex: string): bigint { - if (typeof hex !== 'string') throw new Error('hex string expected, got ' + typeof hex); - return BigInt(hex === '' ? '0' : '0x' + hex); // Big Endian -} - -// Used in ff1 -// BE: Big Endian, LE: Little Endian -export function bytesToNumberBE(bytes: Uint8Array): bigint { - return hexToNumber(bytesToHex(bytes)); -} - -// Used in micro, ff1 -export function numberToBytesBE(n: number | bigint, len: number): Uint8Array { - return hexToBytes(n.toString(16).padStart(len * 2, '0')); -} - -// TODO: remove -// There is no setImmediate in browser and setTimeout is slow. -// call of async fn will return Promise, which will be fullfiled only on -// next scheduler queue processing step and this is exactly what we need. -export const nextTick = async (): Promise => {}; - -// Global symbols, but ts doesn't see them: https://github.com/microsoft/TypeScript/issues/31535 -declare const TextEncoder: any; -declare const TextDecoder: any; - -/** - * Converts string to bytes using UTF8 encoding. - * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99]) - */ -export function utf8ToBytes(str: string): Uint8Array { - if (typeof str !== 'string') throw new Error('string expected'); - return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809 -} - -/** - * Converts bytes to string using UTF8 encoding. - * @example bytesToUtf8(new Uint8Array([97, 98, 99])) // 'abc' - */ -export function bytesToUtf8(bytes: Uint8Array): string { - return new TextDecoder().decode(bytes); -} - -// TODO: remove -export type Input = Uint8Array | string; -/** - * Normalizes (non-hex) string or Uint8Array to Uint8Array. - * Warning: when Uint8Array is passed, it would NOT get copied. - * Keep in mind for future mutable operations. - */ -export function toBytes(data: string | Uint8Array): Uint8Array { - if (typeof data === 'string') data = utf8ToBytes(data); - else if (isBytes(data)) data = copyBytes(data); - else throw new Error('Uint8Array expected, got ' + typeof data); - return data; -} - -/** - * Checks if two U8A use same underlying buffer and overlaps. - * This is invalid and can corrupt data. - */ -export function overlapBytes(a: Uint8Array, b: Uint8Array): boolean { - return ( - a.buffer === b.buffer && // best we can do, may fail with an obscure Proxy - a.byteOffset < b.byteOffset + b.byteLength && // a starts before b end - b.byteOffset < a.byteOffset + a.byteLength // b starts before a end - ); -} - -/** - * If input and output overlap and input starts before output, we will overwrite end of input before - * we start processing it, so this is not supported for most ciphers (except chacha/salse, which designed with this) - */ -export function complexOverlapBytes(input: Uint8Array, output: Uint8Array): void { - // This is very cursed. It works somehow, but I'm completely unsure, - // reasoning about overlapping aligned windows is very hard. - if (overlapBytes(input, output) && input.byteOffset < output.byteOffset) - throw new Error('complex overlap of input and output is not supported'); -} - -/** - * Copies several Uint8Arrays into one. - */ -export function concatBytes(...arrays: Uint8Array[]): Uint8Array { - let sum = 0; - for (let i = 0; i < arrays.length; i++) { - const a = arrays[i]; - abytes(a); - sum += a.length; - } - const res = new Uint8Array(sum); - for (let i = 0, pad = 0; i < arrays.length; i++) { - const a = arrays[i]; - res.set(a, pad); - pad += a.length; - } - return res; -} - -// Used in ARX only -type EmptyObj = {}; -export function checkOpts( - defaults: T1, - opts: T2 -): T1 & T2 { - if (opts == null || typeof opts !== 'object') throw new Error('options must be defined'); - const merged = Object.assign(defaults, opts); - return merged as T1 & T2; -} - -/** Compares 2 uint8array-s in kinda constant time. */ -export function equalBytes(a: Uint8Array, b: Uint8Array): boolean { - if (a.length !== b.length) return false; - let diff = 0; - for (let i = 0; i < a.length; i++) diff |= a[i] ^ b[i]; - return diff === 0; -} - -// TODO: remove -/** For runtime check if class implements interface. */ -export abstract class Hash> { - abstract blockLen: number; // Bytes per block - abstract outputLen: number; // Bytes in output - abstract update(buf: string | Uint8Array): this; - // Writes digest into buf - abstract digestInto(buf: Uint8Array): void; - abstract digest(): Uint8Array; - /** - * Resets internal state. Makes Hash instance unusable. - * Reset is impossible for keyed hashes if key is consumed into state. If digest is not consumed - * by user, they will need to manually call `destroy()` when zeroing is necessary. - */ - abstract destroy(): void; -} - -// This will allow to re-use with composable things like packed & base encoders -// Also, we probably can make tags composable - -/** Sync cipher: takes byte array and returns byte array. */ -export type Cipher = { - encrypt(plaintext: Uint8Array): Uint8Array; - decrypt(ciphertext: Uint8Array): Uint8Array; -}; - -/** Async cipher e.g. from built-in WebCrypto. */ -export type AsyncCipher = { - encrypt(plaintext: Uint8Array): Promise; - decrypt(ciphertext: Uint8Array): Promise; -}; - -/** Cipher with `output` argument which can optimize by doing 1 less allocation. */ -export type CipherWithOutput = Cipher & { - encrypt(plaintext: Uint8Array, output?: Uint8Array): Uint8Array; - decrypt(ciphertext: Uint8Array, output?: Uint8Array): Uint8Array; -}; - -/** - * Params are outside of return type, so it is accessible before calling constructor. - * If function support multiple nonceLength's, we return the best one. - */ -export type CipherParams = { - blockSize: number; - nonceLength?: number; - tagLength?: number; - varSizeNonce?: boolean; -}; -/** ARX cipher, like salsa or chacha. */ -export type ARXCipher = (( - key: Uint8Array, - nonce: Uint8Array, - AAD?: Uint8Array -) => CipherWithOutput) & { - blockSize: number; - nonceLength: number; - tagLength: number; -}; -export type CipherCons = (key: Uint8Array, ...args: T) => Cipher; -/** - * Wraps a cipher: validates args, ensures encrypt() can only be called once. - * @__NO_SIDE_EFFECTS__ - */ -export const wrapCipher = , P extends CipherParams>( - params: P, - constructor: C -): C & P => { - function wrappedCipher(key: Uint8Array, ...args: any[]): CipherWithOutput { - // Validate key - abytes(key); - - // Big-Endian hardware is rare. Just in case someone still decides to run ciphers: - if (!isLE) throw new Error('Non little-endian hardware is not yet supported'); - - // Validate nonce if nonceLength is present - if (params.nonceLength !== undefined) { - const nonce = args[0]; - if (!nonce) throw new Error('nonce / iv required'); - if (params.varSizeNonce) abytes(nonce); - else abytes(nonce, params.nonceLength); - } - - // Validate AAD if tagLength present - const tagl = params.tagLength; - if (tagl && args[1] !== undefined) { - abytes(args[1]); - } - - const cipher = constructor(key, ...args); - const checkOutput = (fnLength: number, output?: Uint8Array) => { - if (output !== undefined) { - if (fnLength !== 2) throw new Error('cipher output not supported'); - abytes(output); - } - }; - // Create wrapped cipher with validation and single-use encryption - let called = false; - const wrCipher = { - encrypt(data: Uint8Array, output?: Uint8Array) { - if (called) throw new Error('cannot encrypt() twice with same key + nonce'); - called = true; - abytes(data); - checkOutput(cipher.encrypt.length, output); - return (cipher as CipherWithOutput).encrypt(data, output); - }, - decrypt(data: Uint8Array, output?: Uint8Array) { - abytes(data); - if (tagl && data.length < tagl) - throw new Error('invalid ciphertext length: smaller than tagLength=' + tagl); - checkOutput(cipher.decrypt.length, output); - return (cipher as CipherWithOutput).decrypt(data, output); - }, - }; - - return wrCipher; - } - - Object.assign(wrappedCipher, params); - return wrappedCipher as C & P; -}; - -/** Represents salsa / chacha stream. */ -export type XorStream = ( - key: Uint8Array, - nonce: Uint8Array, - data: Uint8Array, - output?: Uint8Array, - counter?: number -) => Uint8Array; - -/** - * By default, returns u8a of length. - * When out is available, it checks it for validity and uses it. - */ -export function getOutput( - expectedLength: number, - out?: Uint8Array, - onlyAligned = true -): Uint8Array { - if (out === undefined) return new Uint8Array(expectedLength); - if (out.length !== expectedLength) - throw new Error('invalid output length, expected ' + expectedLength + ', got: ' + out.length); - if (onlyAligned && !isAligned32(out)) throw new Error('invalid output, must be aligned'); - return out; -} - -/** Polyfill for Safari 14. */ -export function setBigUint64( - view: DataView, - byteOffset: number, - value: bigint, - isLE: boolean -): void { - if (typeof view.setBigUint64 === 'function') return view.setBigUint64(byteOffset, value, isLE); - const _32n = BigInt(32); - const _u32_max = BigInt(0xffffffff); - const wh = Number((value >> _32n) & _u32_max); - const wl = Number(value & _u32_max); - const h = isLE ? 4 : 0; - const l = isLE ? 0 : 4; - view.setUint32(byteOffset + h, wh, isLE); - view.setUint32(byteOffset + l, wl, isLE); -} - -export function u64Lengths(dataLength: number, aadLength: number, isLE: boolean): Uint8Array { - abool(isLE); - const num = new Uint8Array(16); - const view = createView(num); - setBigUint64(view, 0, BigInt(aadLength), isLE); - setBigUint64(view, 8, BigInt(dataLength), isLE); - return num; -} - -// Is byte array aligned to 4 byte offset (u32)? -export function isAligned32(bytes: Uint8Array): boolean { - return bytes.byteOffset % 4 === 0; -} - -// copy bytes to new u8a (aligned). Because Buffer.slice is broken. -export function copyBytes(bytes: Uint8Array): Uint8Array { - return Uint8Array.from(bytes); -} diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/src/webcrypto.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/src/webcrypto.ts deleted file mode 100644 index b82b4e7c..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/src/webcrypto.ts +++ /dev/null @@ -1,169 +0,0 @@ -/** - * WebCrypto-based AES gcm/ctr/cbc, `managedNonce` and `randomBytes`. - * We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+. - * node.js versions earlier than v19 don't declare it in global scope. - * For node.js, package.js on#exports field mapping rewrites import - * from `crypto` to `cryptoNode`, which imports native module. - * Makes the utils un-importable in browsers without a bundler. - * Once node.js 18 is deprecated, we can just drop the import. - * @module - */ -// Use full path so that Node.js can rewrite it to `cryptoNode.js`. -import { crypto } from '@noble/ciphers/crypto'; -import { abytes, anumber, type AsyncCipher, type Cipher, concatBytes } from './utils.ts'; - -/** - * Secure PRNG. Uses `crypto.getRandomValues`, which defers to OS. - */ -export function randomBytes(bytesLength = 32): Uint8Array { - if (crypto && typeof crypto.getRandomValues === 'function') { - return crypto.getRandomValues(new Uint8Array(bytesLength)); - } - // Legacy Node.js compatibility - if (crypto && typeof crypto.randomBytes === 'function') { - return Uint8Array.from(crypto.randomBytes(bytesLength)); - } - throw new Error('crypto.getRandomValues must be defined'); -} - -export function getWebcryptoSubtle(): any { - if (crypto && typeof crypto.subtle === 'object' && crypto.subtle != null) return crypto.subtle; - throw new Error('crypto.subtle must be defined'); -} - -type RemoveNonceInner = ((...args: T) => Ret) extends ( - arg0: any, - arg1: any, - ...rest: infer R -) => any - ? (key: Uint8Array, ...args: R) => Ret - : never; - -type RemoveNonce any> = RemoveNonceInner, ReturnType>; -type CipherWithNonce = ((key: Uint8Array, nonce: Uint8Array, ...args: any[]) => Cipher) & { - nonceLength: number; -}; - -/** - * Uses CSPRG for nonce, nonce injected in ciphertext. - * @example - * const gcm = managedNonce(aes.gcm); - * const ciphr = gcm(key).encrypt(data); - * const plain = gcm(key).decrypt(ciph); - */ -export function managedNonce(fn: T): RemoveNonce { - const { nonceLength } = fn; - anumber(nonceLength); - return ((key: Uint8Array, ...args: any[]): any => ({ - encrypt(plaintext: Uint8Array, ...argsEnc: any[]) { - const nonce = randomBytes(nonceLength); - const ciphertext = (fn(key, nonce, ...args).encrypt as any)(plaintext, ...argsEnc); - const out = concatBytes(nonce, ciphertext); - ciphertext.fill(0); - return out; - }, - decrypt(ciphertext: Uint8Array, ...argsDec: any[]) { - const nonce = ciphertext.subarray(0, nonceLength); - const data = ciphertext.subarray(nonceLength); - return (fn(key, nonce, ...args).decrypt as any)(data, ...argsDec); - }, - })) as RemoveNonce; -} - -// Overridable -// @TODO -export const utils: { - encrypt: (key: Uint8Array, ...all: any[]) => Promise; - decrypt: (key: Uint8Array, ...all: any[]) => Promise; -} = { - async encrypt( - key: Uint8Array, - keyParams: any, - cryptParams: any, - plaintext: Uint8Array - ): Promise { - const cr = getWebcryptoSubtle(); - const iKey = await cr.importKey('raw', key, keyParams, true, ['encrypt']); - const ciphertext = await cr.encrypt(cryptParams, iKey, plaintext); - return new Uint8Array(ciphertext); - }, - async decrypt( - key: Uint8Array, - keyParams: any, - cryptParams: any, - ciphertext: Uint8Array - ): Promise { - const cr = getWebcryptoSubtle(); - const iKey = await cr.importKey('raw', key, keyParams, true, ['decrypt']); - const plaintext = await cr.decrypt(cryptParams, iKey, ciphertext); - return new Uint8Array(plaintext); - }, -}; - -const mode = { - CBC: 'AES-CBC', - CTR: 'AES-CTR', - GCM: 'AES-GCM', -} as const; -type BlockMode = (typeof mode)[keyof typeof mode]; - -function getCryptParams(algo: BlockMode, nonce: Uint8Array, AAD?: Uint8Array) { - if (algo === mode.CBC) return { name: mode.CBC, iv: nonce }; - if (algo === mode.CTR) return { name: mode.CTR, counter: nonce, length: 64 }; - if (algo === mode.GCM) { - if (AAD) return { name: mode.GCM, iv: nonce, additionalData: AAD }; - else return { name: mode.GCM, iv: nonce }; - } - - throw new Error('unknown aes block mode'); -} - -function generate(algo: BlockMode) { - return (key: Uint8Array, nonce: Uint8Array, AAD?: Uint8Array): AsyncCipher => { - abytes(key); - abytes(nonce); - const keyParams = { name: algo, length: key.length * 8 }; - const cryptParams = getCryptParams(algo, nonce, AAD); - let consumed = false; - return { - // keyLength, - encrypt(plaintext: Uint8Array) { - abytes(plaintext); - if (consumed) throw new Error('Cannot encrypt() twice with same key / nonce'); - consumed = true; - return utils.encrypt(key, keyParams, cryptParams, plaintext); - }, - decrypt(ciphertext: Uint8Array) { - abytes(ciphertext); - return utils.decrypt(key, keyParams, cryptParams, ciphertext); - }, - }; - }; -} - -/** AES-CBC, native webcrypto version */ -export const cbc: (key: Uint8Array, iv: Uint8Array) => AsyncCipher = /* @__PURE__ */ (() => - generate(mode.CBC))(); -/** AES-CTR, native webcrypto version */ -export const ctr: (key: Uint8Array, nonce: Uint8Array) => AsyncCipher = /* @__PURE__ */ (() => - generate(mode.CTR))(); -/** AES-GCM, native webcrypto version */ -export const gcm: (key: Uint8Array, nonce: Uint8Array, AAD?: Uint8Array) => AsyncCipher = - /* @__PURE__ */ (() => generate(mode.GCM))(); - -// // Type tests -// import { siv, gcm, ctr, ecb, cbc } from '../aes.ts'; -// import { xsalsa20poly1305 } from '../salsa.ts'; -// import { chacha20poly1305, xchacha20poly1305 } from '../chacha.ts'; - -// const wsiv = managedNonce(siv); -// const wgcm = managedNonce(gcm); -// const wctr = managedNonce(ctr); -// const wcbc = managedNonce(cbc); -// const wsalsapoly = managedNonce(xsalsa20poly1305); -// const wchacha = managedNonce(chacha20poly1305); -// const wxchacha = managedNonce(xchacha20poly1305); - -// // should fail -// const wcbc2 = managedNonce(managedNonce(cbc)); -// const wctr = managedNonce(ctr); diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/utils.d.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/utils.d.ts deleted file mode 100644 index 5194ed08..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/utils.d.ts +++ /dev/null @@ -1,155 +0,0 @@ -/** - * Utilities for hex, bytes, CSPRNG. - * @module - */ -/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */ -/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */ -export declare function isBytes(a: unknown): a is Uint8Array; -/** Asserts something is boolean. */ -export declare function abool(b: boolean): void; -/** Asserts something is positive integer. */ -export declare function anumber(n: number): void; -/** Asserts something is Uint8Array. */ -export declare function abytes(b: Uint8Array | undefined, ...lengths: number[]): void; -/** - * Asserts something is hash - * TODO: remove - * @deprecated - */ -export declare function ahash(h: IHash): void; -/** Asserts a hash instance has not been destroyed / finished */ -export declare function aexists(instance: any, checkFinished?: boolean): void; -/** Asserts output is properly-sized byte array */ -export declare function aoutput(out: any, instance: any): void; -export type IHash = { - (data: string | Uint8Array): Uint8Array; - blockLen: number; - outputLen: number; - create: any; -}; -/** Generic type encompassing 8/16/32-byte arrays - but not 64-byte. */ -export type TypedArray = Int8Array | Uint8ClampedArray | Uint8Array | Uint16Array | Int16Array | Uint32Array | Int32Array; -/** Cast u8 / u16 / u32 to u8. */ -export declare function u8(arr: TypedArray): Uint8Array; -/** Cast u8 / u16 / u32 to u32. */ -export declare function u32(arr: TypedArray): Uint32Array; -/** Zeroize a byte array. Warning: JS provides no guarantees. */ -export declare function clean(...arrays: TypedArray[]): void; -/** Create DataView of an array for easy byte-level manipulation. */ -export declare function createView(arr: TypedArray): DataView; -/** Is current platform little-endian? Most are. Big-Endian platform: IBM */ -export declare const isLE: boolean; -/** - * Convert byte array to hex string. Uses built-in function, when available. - * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123' - */ -export declare function bytesToHex(bytes: Uint8Array): string; -/** - * Convert hex string to byte array. Uses built-in function, when available. - * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23]) - */ -export declare function hexToBytes(hex: string): Uint8Array; -export declare function hexToNumber(hex: string): bigint; -export declare function bytesToNumberBE(bytes: Uint8Array): bigint; -export declare function numberToBytesBE(n: number | bigint, len: number): Uint8Array; -export declare const nextTick: () => Promise; -/** - * Converts string to bytes using UTF8 encoding. - * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99]) - */ -export declare function utf8ToBytes(str: string): Uint8Array; -/** - * Converts bytes to string using UTF8 encoding. - * @example bytesToUtf8(new Uint8Array([97, 98, 99])) // 'abc' - */ -export declare function bytesToUtf8(bytes: Uint8Array): string; -export type Input = Uint8Array | string; -/** - * Normalizes (non-hex) string or Uint8Array to Uint8Array. - * Warning: when Uint8Array is passed, it would NOT get copied. - * Keep in mind for future mutable operations. - */ -export declare function toBytes(data: string | Uint8Array): Uint8Array; -/** - * Checks if two U8A use same underlying buffer and overlaps. - * This is invalid and can corrupt data. - */ -export declare function overlapBytes(a: Uint8Array, b: Uint8Array): boolean; -/** - * If input and output overlap and input starts before output, we will overwrite end of input before - * we start processing it, so this is not supported for most ciphers (except chacha/salse, which designed with this) - */ -export declare function complexOverlapBytes(input: Uint8Array, output: Uint8Array): void; -/** - * Copies several Uint8Arrays into one. - */ -export declare function concatBytes(...arrays: Uint8Array[]): Uint8Array; -type EmptyObj = {}; -export declare function checkOpts(defaults: T1, opts: T2): T1 & T2; -/** Compares 2 uint8array-s in kinda constant time. */ -export declare function equalBytes(a: Uint8Array, b: Uint8Array): boolean; -/** For runtime check if class implements interface. */ -export declare abstract class Hash> { - abstract blockLen: number; - abstract outputLen: number; - abstract update(buf: string | Uint8Array): this; - abstract digestInto(buf: Uint8Array): void; - abstract digest(): Uint8Array; - /** - * Resets internal state. Makes Hash instance unusable. - * Reset is impossible for keyed hashes if key is consumed into state. If digest is not consumed - * by user, they will need to manually call `destroy()` when zeroing is necessary. - */ - abstract destroy(): void; -} -/** Sync cipher: takes byte array and returns byte array. */ -export type Cipher = { - encrypt(plaintext: Uint8Array): Uint8Array; - decrypt(ciphertext: Uint8Array): Uint8Array; -}; -/** Async cipher e.g. from built-in WebCrypto. */ -export type AsyncCipher = { - encrypt(plaintext: Uint8Array): Promise; - decrypt(ciphertext: Uint8Array): Promise; -}; -/** Cipher with `output` argument which can optimize by doing 1 less allocation. */ -export type CipherWithOutput = Cipher & { - encrypt(plaintext: Uint8Array, output?: Uint8Array): Uint8Array; - decrypt(ciphertext: Uint8Array, output?: Uint8Array): Uint8Array; -}; -/** - * Params are outside of return type, so it is accessible before calling constructor. - * If function support multiple nonceLength's, we return the best one. - */ -export type CipherParams = { - blockSize: number; - nonceLength?: number; - tagLength?: number; - varSizeNonce?: boolean; -}; -/** ARX cipher, like salsa or chacha. */ -export type ARXCipher = ((key: Uint8Array, nonce: Uint8Array, AAD?: Uint8Array) => CipherWithOutput) & { - blockSize: number; - nonceLength: number; - tagLength: number; -}; -export type CipherCons = (key: Uint8Array, ...args: T) => Cipher; -/** - * Wraps a cipher: validates args, ensures encrypt() can only be called once. - * @__NO_SIDE_EFFECTS__ - */ -export declare const wrapCipher: , P extends CipherParams>(params: P, constructor: C) => C & P; -/** Represents salsa / chacha stream. */ -export type XorStream = (key: Uint8Array, nonce: Uint8Array, data: Uint8Array, output?: Uint8Array, counter?: number) => Uint8Array; -/** - * By default, returns u8a of length. - * When out is available, it checks it for validity and uses it. - */ -export declare function getOutput(expectedLength: number, out?: Uint8Array, onlyAligned?: boolean): Uint8Array; -/** Polyfill for Safari 14. */ -export declare function setBigUint64(view: DataView, byteOffset: number, value: bigint, isLE: boolean): void; -export declare function u64Lengths(dataLength: number, aadLength: number, isLE: boolean): Uint8Array; -export declare function isAligned32(bytes: Uint8Array): boolean; -export declare function copyBytes(bytes: Uint8Array): Uint8Array; -export {}; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/utils.d.ts.map b/tools/mnemonic-test/node_modules/@noble/ciphers/utils.d.ts.map deleted file mode 100644 index 69f34f02..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,uEAAuE;AAEvE,qFAAqF;AACrF,wBAAgB,OAAO,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,UAAU,CAEnD;AAED,oCAAoC;AACpC,wBAAgB,KAAK,CAAC,CAAC,EAAE,OAAO,GAAG,IAAI,CAEtC;AAED,6CAA6C;AAC7C,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAEvC;AAED,uCAAuC;AACvC,wBAAgB,MAAM,CAAC,CAAC,EAAE,UAAU,GAAG,SAAS,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAI5E;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI,CAKpC;AAED,gEAAgE;AAChE,wBAAgB,OAAO,CAAC,QAAQ,EAAE,GAAG,EAAE,aAAa,UAAO,GAAG,IAAI,CAGjE;AAED,kDAAkD;AAClD,wBAAgB,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,GAAG,IAAI,CAMrD;AAED,MAAM,MAAM,KAAK,GAAG;IAClB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,GAAG,CAAC;CACb,CAAC;AAEF,uEAAuE;AAEvE,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,iBAAiB,GAAG,UAAU,G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CAAC;AAEhB;;;GAGG;AACH,wBAAgB,SAAS,CACvB,cAAc,EAAE,MAAM,EACtB,GAAG,CAAC,EAAE,UAAU,EAChB,WAAW,UAAO,GACjB,UAAU,CAMZ;AAED,8BAA8B;AAC9B,wBAAgB,YAAY,CAC1B,IAAI,EAAE,QAAQ,EACd,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,OAAO,GACZ,IAAI,CAUN;AAED,wBAAgB,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,UAAU,CAO3F;AAGD,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAEtD;AAGD,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,CAEvD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/utils.js b/tools/mnemonic-test/node_modules/@noble/ciphers/utils.js deleted file mode 100644 index d6c8cd6f..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/utils.js +++ /dev/null @@ -1,374 +0,0 @@ -"use strict"; -/** - * Utilities for hex, bytes, CSPRNG. - * @module - */ -/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.wrapCipher = exports.Hash = exports.nextTick = exports.isLE = void 0; -exports.isBytes = isBytes; -exports.abool = abool; -exports.anumber = anumber; -exports.abytes = abytes; -exports.ahash = ahash; -exports.aexists = aexists; -exports.aoutput = aoutput; -exports.u8 = u8; -exports.u32 = u32; -exports.clean = clean; -exports.createView = createView; -exports.bytesToHex = bytesToHex; -exports.hexToBytes = hexToBytes; -exports.hexToNumber = hexToNumber; -exports.bytesToNumberBE = bytesToNumberBE; -exports.numberToBytesBE = numberToBytesBE; -exports.utf8ToBytes = utf8ToBytes; -exports.bytesToUtf8 = bytesToUtf8; -exports.toBytes = toBytes; -exports.overlapBytes = overlapBytes; -exports.complexOverlapBytes = complexOverlapBytes; -exports.concatBytes = concatBytes; -exports.checkOpts = checkOpts; -exports.equalBytes = equalBytes; -exports.getOutput = getOutput; -exports.setBigUint64 = setBigUint64; -exports.u64Lengths = u64Lengths; -exports.isAligned32 = isAligned32; -exports.copyBytes = copyBytes; -/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */ -function isBytes(a) { - return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array'); -} -/** Asserts something is boolean. */ -function abool(b) { - if (typeof b !== 'boolean') - throw new Error(`boolean expected, not ${b}`); -} -/** Asserts something is positive integer. */ -function anumber(n) { - if (!Number.isSafeInteger(n) || n < 0) - throw new Error('positive integer expected, got ' + n); -} -/** Asserts something is Uint8Array. */ -function abytes(b, ...lengths) { - if (!isBytes(b)) - throw new Error('Uint8Array expected'); - if (lengths.length > 0 && !lengths.includes(b.length)) - throw new Error('Uint8Array expected of length ' + lengths + ', got length=' + b.length); -} -/** - * Asserts something is hash - * TODO: remove - * @deprecated - */ -function ahash(h) { - if (typeof h !== 'function' || typeof h.create !== 'function') - throw new Error('Hash should be wrapped by utils.createHasher'); - anumber(h.outputLen); - anumber(h.blockLen); -} -/** Asserts a hash instance has not been destroyed / finished */ -function aexists(instance, checkFinished = true) { - if (instance.destroyed) - throw new Error('Hash instance has been destroyed'); - if (checkFinished && instance.finished) - throw new Error('Hash#digest() has already been called'); -} -/** Asserts output is properly-sized byte array */ -function aoutput(out, instance) { - abytes(out); - const min = instance.outputLen; - if (out.length < min) { - throw new Error('digestInto() expects output buffer of length at least ' + min); - } -} -/** Cast u8 / u16 / u32 to u8. */ -function u8(arr) { - return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength); -} -/** Cast u8 / u16 / u32 to u32. */ -function u32(arr) { - return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); -} -/** Zeroize a byte array. Warning: JS provides no guarantees. */ -function clean(...arrays) { - for (let i = 0; i < arrays.length; i++) { - arrays[i].fill(0); - } -} -/** Create DataView of an array for easy byte-level manipulation. */ -function createView(arr) { - return new DataView(arr.buffer, arr.byteOffset, arr.byteLength); -} -/** Is current platform little-endian? Most are. Big-Endian platform: IBM */ -exports.isLE = (() => new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)(); -// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex -const hasHexBuiltin = /* @__PURE__ */ (() => -// @ts-ignore -typeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function')(); -// Array where index 0xf0 (240) is mapped to string 'f0' -const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0')); -/** - * Convert byte array to hex string. Uses built-in function, when available. - * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123' - */ -function bytesToHex(bytes) { - abytes(bytes); - // @ts-ignore - if (hasHexBuiltin) - return bytes.toHex(); - // pre-caching improves the speed 6x - let hex = ''; - for (let i = 0; i < bytes.length; i++) { - hex += hexes[bytes[i]]; - } - return hex; -} -// We use optimized technique to convert hex string to byte array -const asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 }; -function asciiToBase16(ch) { - if (ch >= asciis._0 && ch <= asciis._9) - return ch - asciis._0; // '2' => 50-48 - if (ch >= asciis.A && ch <= asciis.F) - return ch - (asciis.A - 10); // 'B' => 66-(65-10) - if (ch >= asciis.a && ch <= asciis.f) - return ch - (asciis.a - 10); // 'b' => 98-(97-10) - return; -} -/** - * Convert hex string to byte array. Uses built-in function, when available. - * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23]) - */ -function hexToBytes(hex) { - if (typeof hex !== 'string') - throw new Error('hex string expected, got ' + typeof hex); - // @ts-ignore - if (hasHexBuiltin) - return Uint8Array.fromHex(hex); - const hl = hex.length; - const al = hl / 2; - if (hl % 2) - throw new Error('hex string expected, got unpadded hex of length ' + hl); - const array = new Uint8Array(al); - for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) { - const n1 = asciiToBase16(hex.charCodeAt(hi)); - const n2 = asciiToBase16(hex.charCodeAt(hi + 1)); - if (n1 === undefined || n2 === undefined) { - const char = hex[hi] + hex[hi + 1]; - throw new Error('hex string expected, got non-hex character "' + char + '" at index ' + hi); - } - array[ai] = n1 * 16 + n2; // multiply first octet, e.g. 'a3' => 10*16+3 => 160 + 3 => 163 - } - return array; -} -// Used in micro -function hexToNumber(hex) { - if (typeof hex !== 'string') - throw new Error('hex string expected, got ' + typeof hex); - return BigInt(hex === '' ? '0' : '0x' + hex); // Big Endian -} -// Used in ff1 -// BE: Big Endian, LE: Little Endian -function bytesToNumberBE(bytes) { - return hexToNumber(bytesToHex(bytes)); -} -// Used in micro, ff1 -function numberToBytesBE(n, len) { - return hexToBytes(n.toString(16).padStart(len * 2, '0')); -} -// TODO: remove -// There is no setImmediate in browser and setTimeout is slow. -// call of async fn will return Promise, which will be fullfiled only on -// next scheduler queue processing step and this is exactly what we need. -const nextTick = async () => { }; -exports.nextTick = nextTick; -/** - * Converts string to bytes using UTF8 encoding. - * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99]) - */ -function utf8ToBytes(str) { - if (typeof str !== 'string') - throw new Error('string expected'); - return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809 -} -/** - * Converts bytes to string using UTF8 encoding. - * @example bytesToUtf8(new Uint8Array([97, 98, 99])) // 'abc' - */ -function bytesToUtf8(bytes) { - return new TextDecoder().decode(bytes); -} -/** - * Normalizes (non-hex) string or Uint8Array to Uint8Array. - * Warning: when Uint8Array is passed, it would NOT get copied. - * Keep in mind for future mutable operations. - */ -function toBytes(data) { - if (typeof data === 'string') - data = utf8ToBytes(data); - else if (isBytes(data)) - data = copyBytes(data); - else - throw new Error('Uint8Array expected, got ' + typeof data); - return data; -} -/** - * Checks if two U8A use same underlying buffer and overlaps. - * This is invalid and can corrupt data. - */ -function overlapBytes(a, b) { - return (a.buffer === b.buffer && // best we can do, may fail with an obscure Proxy - a.byteOffset < b.byteOffset + b.byteLength && // a starts before b end - b.byteOffset < a.byteOffset + a.byteLength // b starts before a end - ); -} -/** - * If input and output overlap and input starts before output, we will overwrite end of input before - * we start processing it, so this is not supported for most ciphers (except chacha/salse, which designed with this) - */ -function complexOverlapBytes(input, output) { - // This is very cursed. It works somehow, but I'm completely unsure, - // reasoning about overlapping aligned windows is very hard. - if (overlapBytes(input, output) && input.byteOffset < output.byteOffset) - throw new Error('complex overlap of input and output is not supported'); -} -/** - * Copies several Uint8Arrays into one. - */ -function concatBytes(...arrays) { - let sum = 0; - for (let i = 0; i < arrays.length; i++) { - const a = arrays[i]; - abytes(a); - sum += a.length; - } - const res = new Uint8Array(sum); - for (let i = 0, pad = 0; i < arrays.length; i++) { - const a = arrays[i]; - res.set(a, pad); - pad += a.length; - } - return res; -} -function checkOpts(defaults, opts) { - if (opts == null || typeof opts !== 'object') - throw new Error('options must be defined'); - const merged = Object.assign(defaults, opts); - return merged; -} -/** Compares 2 uint8array-s in kinda constant time. */ -function equalBytes(a, b) { - if (a.length !== b.length) - return false; - let diff = 0; - for (let i = 0; i < a.length; i++) - diff |= a[i] ^ b[i]; - return diff === 0; -} -// TODO: remove -/** For runtime check if class implements interface. */ -class Hash { -} -exports.Hash = Hash; -/** - * Wraps a cipher: validates args, ensures encrypt() can only be called once. - * @__NO_SIDE_EFFECTS__ - */ -const wrapCipher = (params, constructor) => { - function wrappedCipher(key, ...args) { - // Validate key - abytes(key); - // Big-Endian hardware is rare. Just in case someone still decides to run ciphers: - if (!exports.isLE) - throw new Error('Non little-endian hardware is not yet supported'); - // Validate nonce if nonceLength is present - if (params.nonceLength !== undefined) { - const nonce = args[0]; - if (!nonce) - throw new Error('nonce / iv required'); - if (params.varSizeNonce) - abytes(nonce); - else - abytes(nonce, params.nonceLength); - } - // Validate AAD if tagLength present - const tagl = params.tagLength; - if (tagl && args[1] !== undefined) { - abytes(args[1]); - } - const cipher = constructor(key, ...args); - const checkOutput = (fnLength, output) => { - if (output !== undefined) { - if (fnLength !== 2) - throw new Error('cipher output not supported'); - abytes(output); - } - }; - // Create wrapped cipher with validation and single-use encryption - let called = false; - const wrCipher = { - encrypt(data, output) { - if (called) - throw new Error('cannot encrypt() twice with same key + nonce'); - called = true; - abytes(data); - checkOutput(cipher.encrypt.length, output); - return cipher.encrypt(data, output); - }, - decrypt(data, output) { - abytes(data); - if (tagl && data.length < tagl) - throw new Error('invalid ciphertext length: smaller than tagLength=' + tagl); - checkOutput(cipher.decrypt.length, output); - return cipher.decrypt(data, output); - }, - }; - return wrCipher; - } - Object.assign(wrappedCipher, params); - return wrappedCipher; -}; -exports.wrapCipher = wrapCipher; -/** - * By default, returns u8a of length. - * When out is available, it checks it for validity and uses it. - */ -function getOutput(expectedLength, out, onlyAligned = true) { - if (out === undefined) - return new Uint8Array(expectedLength); - if (out.length !== expectedLength) - throw new Error('invalid output length, expected ' + expectedLength + ', got: ' + out.length); - if (onlyAligned && !isAligned32(out)) - throw new Error('invalid output, must be aligned'); - return out; -} -/** Polyfill for Safari 14. */ -function setBigUint64(view, byteOffset, value, isLE) { - if (typeof view.setBigUint64 === 'function') - return view.setBigUint64(byteOffset, value, isLE); - const _32n = BigInt(32); - const _u32_max = BigInt(0xffffffff); - const wh = Number((value >> _32n) & _u32_max); - const wl = Number(value & _u32_max); - const h = isLE ? 4 : 0; - const l = isLE ? 0 : 4; - view.setUint32(byteOffset + h, wh, isLE); - view.setUint32(byteOffset + l, wl, isLE); -} -function u64Lengths(dataLength, aadLength, isLE) { - abool(isLE); - const num = new Uint8Array(16); - const view = createView(num); - setBigUint64(view, 0, BigInt(aadLength), isLE); - setBigUint64(view, 8, BigInt(dataLength), isLE); - return num; -} -// Is byte array aligned to 4 byte offset (u32)? -function isAligned32(bytes) { - return bytes.byteOffset % 4 === 0; -} -// copy bytes to new u8a (aligned). Because Buffer.slice is broken. -function copyBytes(bytes) { - return Uint8Array.from(bytes); -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/utils.js.map b/tools/mnemonic-test/node_modules/@noble/ciphers/utils.js.map deleted file mode 100644 index 7ceeae02..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["src/utils.ts"],"names":[],"mappings":";AAAA;;;GAGG;AACH,uEAAuE;;;AAGvE,0BAEC;AAGD,sBAEC;AAGD,0BAEC;AAGD,wBAIC;AAOD,sBAKC;AAGD,0BAGC;AAGD,0BAMC;AAeD,gBAEC;AAGD,kBAEC;AAGD,sBAIC;AAGD,gCAEC;AAoBD,gCAUC;AAeD,gCAkBC;AAGD,kCAGC;AAID,0CAEC;AAGD,0CAEC;AAgBD,kCAGC;AAMD,kCAEC;AASD,0BAKC;AAMD,oCAMC;AAMD,kDAKC;AAKD,kCAcC;AAID,8BAOC;AAGD,gCAKC;AAwID,8BAUC;AAGD,oCAeC;AAED,gCAOC;AAGD,kCAEC;AAGD,8BAEC;AA9bD,qFAAqF;AACrF,SAAgB,OAAO,CAAC,CAAU;IAChC,OAAO,CAAC,YAAY,UAAU,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC;AACnG,CAAC;AAED,oCAAoC;AACpC,SAAgB,KAAK,CAAC,CAAU;IAC9B,IAAI,OAAO,CAAC,KAAK,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,EAAE,CAAC,CAAC;AAC5E,CAAC;AAED,6CAA6C;AAC7C,SAAgB,OAAO,CAAC,CAAS;IAC/B,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,iCAAiC,GAA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U,GAAG,CAAC,KAAK,CAAC,CAAC;AACpC,CAAC;AAED,mEAAmE;AACnE,SAAgB,SAAS,CAAC,KAAiB;IACzC,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAChC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/webcrypto.d.ts b/tools/mnemonic-test/node_modules/@noble/ciphers/webcrypto.d.ts deleted file mode 100644 index e79d0e4a..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/webcrypto.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { type AsyncCipher, type Cipher } from './utils.ts'; -/** - * Secure PRNG. Uses `crypto.getRandomValues`, which defers to OS. - */ -export declare function randomBytes(bytesLength?: number): Uint8Array; -export declare function getWebcryptoSubtle(): any; -type RemoveNonceInner = ((...args: T) => Ret) extends (arg0: any, arg1: any, ...rest: infer R) => any ? (key: Uint8Array, ...args: R) => Ret : never; -type RemoveNonce any> = RemoveNonceInner, ReturnType>; -type CipherWithNonce = ((key: Uint8Array, nonce: Uint8Array, ...args: any[]) => Cipher) & { - nonceLength: number; -}; -/** - * Uses CSPRG for nonce, nonce injected in ciphertext. - * @example - * const gcm = managedNonce(aes.gcm); - * const ciphr = gcm(key).encrypt(data); - * const plain = gcm(key).decrypt(ciph); - */ -export declare function managedNonce(fn: T): RemoveNonce; -export declare const utils: { - encrypt: (key: Uint8Array, ...all: any[]) => Promise; - decrypt: (key: Uint8Array, ...all: any[]) => Promise; -}; -/** AES-CBC, native webcrypto version */ -export declare const cbc: (key: Uint8Array, iv: Uint8Array) => AsyncCipher; -/** AES-CTR, native webcrypto version */ -export declare const ctr: (key: Uint8Array, nonce: Uint8Array) => AsyncCipher; -/** AES-GCM, native webcrypto version */ -export declare const gcm: (key: Uint8Array, nonce: Uint8Array, AAD?: Uint8Array) => AsyncCipher; -export {}; -//# sourceMappingURL=webcrypto.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/webcrypto.d.ts.map b/tools/mnemonic-test/node_modules/@noble/ciphers/webcrypto.d.ts.map deleted file mode 100644 index cb8f8b97..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/webcrypto.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"webcrypto.d.ts","sourceRoot":"","sources":["src/webcrypto.ts"],"names":[],"mappings":"AAYA,OAAO,EAAmB,KAAK,WAAW,EAAE,KAAK,MAAM,EAAe,MAAM,YAAY,CAAC;AAEzF;;GAEG;AACH,wBAAgB,WAAW,CAAC,WAAW,SAAK,GAAG,UAAU,CASxD;AAED,wBAAgB,kBAAkB,IAAI,GAAG,CAGxC;AAED,KAAK,gBAAgB,CAAC,CAAC,SAAS,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,GAAG,CAAC,SAAS,CAC1E,IAAI,EAAE,GAAG,EACT,IAAI,EAAE,GAAG,EACT,GAAG,IAAI,EAAE,MAAM,CAAC,KACb,GAAG,GACJ,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,CAAC,KAAK,GAAG,GACpC,KAAK,CAAC;AAEV,KAAK,WAAW,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,IAAI,gBAAgB,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;AACnG,KAAK,eAAe,GAAG,CAAC,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,MAAM,CAAC,GAAG;IACxF,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,eAAe,EAAE,EAAE,EAAE,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAiB7E;AAID,eAAO,MAAM,KAAK,EAAE;IAClB,OAAO,EAAE,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,GAAG,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IACjE,OAAO,EAAE,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,GAAG,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;CAwBlE,CAAC;AA2CF,wCAAwC;AACxC,eAAO,MAAM,GAAG,EAAE,CAAC,GAAG,EAAE,UAAU,EAAE,EAAE,EAAE,UAAU,KAAK,WAChC,CAAC;AACxB,wCAAwC;AACxC,eAAO,MAAM,GAAG,EAAE,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,KAAK,WACnC,CAAC;AACxB,wCAAwC;AACxC,eAAO,MAAM,GAAG,EAAE,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,CAAC,EAAE,UAAU,KAAK,WAC9B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/webcrypto.js b/tools/mnemonic-test/node_modules/@noble/ciphers/webcrypto.js deleted file mode 100644 index 8848e7cf..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/webcrypto.js +++ /dev/null @@ -1,141 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.gcm = exports.ctr = exports.cbc = exports.utils = void 0; -exports.randomBytes = randomBytes; -exports.getWebcryptoSubtle = getWebcryptoSubtle; -exports.managedNonce = managedNonce; -/** - * WebCrypto-based AES gcm/ctr/cbc, `managedNonce` and `randomBytes`. - * We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+. - * node.js versions earlier than v19 don't declare it in global scope. - * For node.js, package.js on#exports field mapping rewrites import - * from `crypto` to `cryptoNode`, which imports native module. - * Makes the utils un-importable in browsers without a bundler. - * Once node.js 18 is deprecated, we can just drop the import. - * @module - */ -// Use full path so that Node.js can rewrite it to `cryptoNode.js`. -const crypto_1 = require("@noble/ciphers/crypto"); -const utils_ts_1 = require("./utils.js"); -/** - * Secure PRNG. Uses `crypto.getRandomValues`, which defers to OS. - */ -function randomBytes(bytesLength = 32) { - if (crypto_1.crypto && typeof crypto_1.crypto.getRandomValues === 'function') { - return crypto_1.crypto.getRandomValues(new Uint8Array(bytesLength)); - } - // Legacy Node.js compatibility - if (crypto_1.crypto && typeof crypto_1.crypto.randomBytes === 'function') { - return Uint8Array.from(crypto_1.crypto.randomBytes(bytesLength)); - } - throw new Error('crypto.getRandomValues must be defined'); -} -function getWebcryptoSubtle() { - if (crypto_1.crypto && typeof crypto_1.crypto.subtle === 'object' && crypto_1.crypto.subtle != null) - return crypto_1.crypto.subtle; - throw new Error('crypto.subtle must be defined'); -} -/** - * Uses CSPRG for nonce, nonce injected in ciphertext. - * @example - * const gcm = managedNonce(aes.gcm); - * const ciphr = gcm(key).encrypt(data); - * const plain = gcm(key).decrypt(ciph); - */ -function managedNonce(fn) { - const { nonceLength } = fn; - (0, utils_ts_1.anumber)(nonceLength); - return ((key, ...args) => ({ - encrypt(plaintext, ...argsEnc) { - const nonce = randomBytes(nonceLength); - const ciphertext = fn(key, nonce, ...args).encrypt(plaintext, ...argsEnc); - const out = (0, utils_ts_1.concatBytes)(nonce, ciphertext); - ciphertext.fill(0); - return out; - }, - decrypt(ciphertext, ...argsDec) { - const nonce = ciphertext.subarray(0, nonceLength); - const data = ciphertext.subarray(nonceLength); - return fn(key, nonce, ...args).decrypt(data, ...argsDec); - }, - })); -} -// Overridable -// @TODO -exports.utils = { - async encrypt(key, keyParams, cryptParams, plaintext) { - const cr = getWebcryptoSubtle(); - const iKey = await cr.importKey('raw', key, keyParams, true, ['encrypt']); - const ciphertext = await cr.encrypt(cryptParams, iKey, plaintext); - return new Uint8Array(ciphertext); - }, - async decrypt(key, keyParams, cryptParams, ciphertext) { - const cr = getWebcryptoSubtle(); - const iKey = await cr.importKey('raw', key, keyParams, true, ['decrypt']); - const plaintext = await cr.decrypt(cryptParams, iKey, ciphertext); - return new Uint8Array(plaintext); - }, -}; -const mode = { - CBC: 'AES-CBC', - CTR: 'AES-CTR', - GCM: 'AES-GCM', -}; -function getCryptParams(algo, nonce, AAD) { - if (algo === mode.CBC) - return { name: mode.CBC, iv: nonce }; - if (algo === mode.CTR) - return { name: mode.CTR, counter: nonce, length: 64 }; - if (algo === mode.GCM) { - if (AAD) - return { name: mode.GCM, iv: nonce, additionalData: AAD }; - else - return { name: mode.GCM, iv: nonce }; - } - throw new Error('unknown aes block mode'); -} -function generate(algo) { - return (key, nonce, AAD) => { - (0, utils_ts_1.abytes)(key); - (0, utils_ts_1.abytes)(nonce); - const keyParams = { name: algo, length: key.length * 8 }; - const cryptParams = getCryptParams(algo, nonce, AAD); - let consumed = false; - return { - // keyLength, - encrypt(plaintext) { - (0, utils_ts_1.abytes)(plaintext); - if (consumed) - throw new Error('Cannot encrypt() twice with same key / nonce'); - consumed = true; - return exports.utils.encrypt(key, keyParams, cryptParams, plaintext); - }, - decrypt(ciphertext) { - (0, utils_ts_1.abytes)(ciphertext); - return exports.utils.decrypt(key, keyParams, cryptParams, ciphertext); - }, - }; - }; -} -/** AES-CBC, native webcrypto version */ -exports.cbc = (() => generate(mode.CBC))(); -/** AES-CTR, native webcrypto version */ -exports.ctr = (() => generate(mode.CTR))(); -/** AES-GCM, native webcrypto version */ -exports.gcm = -/* @__PURE__ */ (() => generate(mode.GCM))(); -// // Type tests -// import { siv, gcm, ctr, ecb, cbc } from '../aes.ts'; -// import { xsalsa20poly1305 } from '../salsa.ts'; -// import { chacha20poly1305, xchacha20poly1305 } from '../chacha.ts'; -// const wsiv = managedNonce(siv); -// const wgcm = managedNonce(gcm); -// const wctr = managedNonce(ctr); -// const wcbc = managedNonce(cbc); -// const wsalsapoly = managedNonce(xsalsa20poly1305); -// const wchacha = managedNonce(chacha20poly1305); -// const wxchacha = managedNonce(xchacha20poly1305); -// // should fail -// const wcbc2 = managedNonce(managedNonce(cbc)); -// const wctr = managedNonce(ctr); -//# sourceMappingURL=webcrypto.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/ciphers/webcrypto.js.map b/tools/mnemonic-test/node_modules/@noble/ciphers/webcrypto.js.map deleted file mode 100644 index 758e137f..00000000 --- a/tools/mnemonic-test/node_modules/@noble/ciphers/webcrypto.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"webcrypto.js","sourceRoot":"","sources":["src/webcrypto.ts"],"names":[],"mappings":";;;AAiBA,kCASC;AAED,gDAGC;AAsBD,oCAiBC;AAtED;;;;;;;;;GASG;AACH,mEAAmE;AACnE,kDAA+C;AAC/C,yCAAyF;AAEzF;;GAEG;AACH,SAAgB,WAAW,CAAC,WAAW,GAAG,EAAE;IAC1C,IAAI,eAAM,IAAI,OAAO,eAAM,CAAC,eAAe,KAAK,UAAU,EAAE,CAAC;QAC3D,OAAO,eAAM,CAAC,eAAe,CAAC,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC;IAC7D,CAAC;IACD,+BAA+B;IAC/B,IAAI,eAAM,IAAI,OAAO,eAAM,CAAC,WAAW,KAAK,UAAU,EAAE,CAAC;QACvD,OAAO,UAAU,CAAC,IAAI,CAAC,eAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC;IAC1D,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;AAC5D,CAAC;AAED,SAAgB,kBAAkB;IAChC,IAAI,eAAM,IAAI,OAAO,eAAM,CAAC,MAAM,KAAK,QAAQ,IAAI,eAAM,CAAC,MAAM,IAAI,IAAI;QAAE,OAAO,eAAM,CAAC,MAAM,CAAC;IAC/F,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;AACnD,CAAC;AAeD;;;;;;GAMG;AACH,SAAgB,YAAY,CAA4B,EAAK;IAC3D,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC;IAC3B,IAAA,kBAAO,EAAC,WAAW,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CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;AAE/C,gBAAgB;AAChB,uDAAuD;AACvD,kDAAkD;AAClD,sEAAsE;AAEtE,kCAAkC;AAClC,kCAAkC;AAClC,kCAAkC;AAClC,kCAAkC;AAClC,qDAAqD;AACrD,kDAAkD;AAClD,oDAAoD;AAEpD,iBAAiB;AACjB,iDAAiD;AACjD,kCAAkC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/LICENSE b/tools/mnemonic-test/node_modules/@noble/curves/LICENSE deleted file mode 100644 index 9297a046..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2022 Paul Miller (https://paulmillr.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the “Software”), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/README.md b/tools/mnemonic-test/node_modules/@noble/curves/README.md deleted file mode 100644 index 925dd616..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/README.md +++ /dev/null @@ -1,1009 +0,0 @@ -# noble-curves - -Audited & minimal JS implementation of elliptic curve cryptography. - -- 🔒 [**Audited**](#security) by independent security firms -- 🔻 Tree-shakeable: unused code is excluded from your builds -- 🏎 Fast: hand-optimized for caveats of JS engines -- 🔍 Reliable: tested against cross-library, wycheproof and acvp vectors -- ➰ Weierstrass, Edwards, Montgomery curves; ECDSA, EdDSA, Schnorr, BLS signatures -- ✍️ ECDH, hash-to-curve, OPRF, Poseidon ZK-friendly hash -- 🔖 Non-repudiation (SUF-CMA, SBS) & consensus-friendliness (ZIP215) in ed25519, ed448 -- 🥈 Optional, friendly wrapper over native WebCrypto -- 🪶 36KB (gzipped) including bundled hashes, 11KB for single-curve build - -Curves have 4KB sister projects -[secp256k1](https://github.com/paulmillr/noble-secp256k1) & [ed25519](https://github.com/paulmillr/noble-ed25519). -They have smaller attack surface, but less features. - -Take a glance at [GitHub Discussions](https://github.com/paulmillr/noble-curves/discussions) for questions and support. - -### This library belongs to _noble_ cryptography - -> **noble cryptography** — high-security, easily auditable set of contained cryptographic libraries and tools. - -- Zero or minimal dependencies -- Highly readable TypeScript / JS code -- PGP-signed releases and transparent NPM builds -- All libraries: - [ciphers](https://github.com/paulmillr/noble-ciphers), - [curves](https://github.com/paulmillr/noble-curves), - [hashes](https://github.com/paulmillr/noble-hashes), - [post-quantum](https://github.com/paulmillr/noble-post-quantum), - 4kb [secp256k1](https://github.com/paulmillr/noble-secp256k1) / - [ed25519](https://github.com/paulmillr/noble-ed25519) -- [Check out homepage](https://paulmillr.com/noble/) - for reading resources, documentation and apps built with noble - -## Usage - -> `npm install @noble/curves` - -> `deno add jsr:@noble/curves` - -> `deno doc jsr:@noble/curves` # command-line documentation - -We support all major platforms and runtimes. -For React Native, you may need a [polyfill for getRandomValues](https://github.com/LinusU/react-native-get-random-values). -A standalone file [noble-curves.js](https://github.com/paulmillr/noble-curves/releases) is also available. - -```ts -// import * from '@noble/curves'; // Error: use sub-imports, to ensure small app size -import { secp256k1, schnorr } from '@noble/curves/secp256k1.js'; -import { ed25519, ed25519ph, ed25519ctx, x25519 } from '@noble/curves/ed25519.js'; -import { ed448, ed448ph, ed448ctx, x448 } from '@noble/curves/ed448.js'; -import { p256, p384, p521 } from '@noble/curves/nist.js'; -import { bls12_381 } from '@noble/curves/bls12-381.js'; -import { bn254 } from '@noble/curves/bn254.js'; -import { jubjub, babyjubjub } from '@noble/curves/misc.js'; -import { bytesToHex, hexToBytes, concatBytes, utf8ToBytes } from '@noble/curves/abstract/utils.js'; -``` - -- [ECDSA signatures over secp256k1 and others](#ecdsa-signatures-over-secp256k1-and-others) -- [Hedged ECDSA with noise](#hedged-ecdsa-with-noise) -- [ECDH: Diffie-Hellman shared secrets](#ecdh-diffie-hellman-shared-secrets) -- [secp256k1 Schnorr signatures from BIP340](#secp256k1-schnorr-signatures-from-bip340) -- [ed25519](#ed25519) / [X25519](#x25519) / [ristretto255](#ristretto255) -- [ed448](#ed448) / [X448](#x448) / [decaf448](#decaf448) -- [bls12-381](#bls12-381) -- [bn254 aka alt_bn128](#bn254-aka-alt_bn128) -- [misc curves](#misc-curves) -- [Low-level methods](#low-level-methods) -- [Abstract API](#abstract-api) - - [weierstrass](#weierstrass-short-weierstrass-curve), [Projective Point](#projective-weierstrass-point), [ECDSA signatures](#ecdsa-signatures) - - [edwards](#edwards-twisted-edwards-curve), [Extended Point](#extended-edwards-point), [EdDSA signatures](#eddsa-signatures) - - [montgomery](#montgomery-montgomery-curve) - - [bls](#bls-barreto-lynn-scott-curves) - - [hash-to-curve](#hash-to-curve-hashing-strings-to-curve-points) - - [poseidon](#poseidon-poseidon-hash) - - [modular](#modular-modular-arithmetics-utilities) - - [fft](#fft-fast-fourier-transform) - - [Creating private keys from hashes](#creating-private-keys-from-hashes) - - [utils](#utils-useful-utilities) -- [Security](#security) -- [Speed](#speed) -- [Upgrading](#upgrading) -- [Contributing & testing](#contributing--testing) -- [License](#license) - -### Implementations - -#### ECDSA signatures over secp256k1 and others - -```ts -import { secp256k1 } from '@noble/curves/secp256k1.js'; -// import { p256 } from '@noble/curves/nist.js'; // or p384 / p521 - -const priv = secp256k1.utils.randomPrivateKey(); -const pub = secp256k1.getPublicKey(priv); -const msg = new Uint8Array(32).fill(1); // message hash (not message) in ecdsa -const sig = secp256k1.sign(msg, priv); // `{prehash: true}` option is available -const isValid = secp256k1.verify(sig, msg, pub) === true; - -// hex strings are also supported besides Uint8Array-s: -const privHex = '46c930bc7bb4db7f55da20798697421b98c4175a52c630294d75a84b9c126236'; -const pub2 = secp256k1.getPublicKey(privHex); - -// public key recovery -// let sig = secp256k1.Signature.fromCompact(sigHex); // or .fromDER(sigDERHex) -// sig = sig.addRecoveryBit(bit); // bit is not serialized into compact / der format -sig.recoverPublicKey(msg).toRawBytes(); // === pub; // public key recovery -``` - -The same code would work for NIST P256 (secp256r1), P384 (secp384r1) & P521 (secp521r1). - -#### Hedged ECDSA with noise - -```ts -const noisySignature = secp256k1.sign(msg, priv, { extraEntropy: true }); -const ent = new Uint8Array(32).fill(3); // set custom entropy -const noisySignature2 = secp256k1.sign(msg, priv, { extraEntropy: ent }); -``` - -Hedged ECDSA is add-on, providing improved protection against fault attacks. -It adds noise to signatures. The technique is used by default in BIP340; we also implement them -optionally for ECDSA. Check out blog post -[Deterministic signatures are not your friends](https://paulmillr.com/posts/deterministic-signatures/) -and [spec draft](https://datatracker.ietf.org/doc/draft-irtf-cfrg-det-sigs-with-noise/). - -#### ECDH: Diffie-Hellman shared secrets - -```ts -const someonesPub = secp256k1.getPublicKey(secp256k1.utils.randomPrivateKey()); -const shared = secp256k1.getSharedSecret(priv, someonesPub); -// NOTE: -// - `shared` includes parity byte: strip it using shared.slice(1) -// - `shared` is not hashed: more secure way is sha256(shared) or hkdf(shared) -``` - -#### secp256k1 Schnorr signatures from BIP340 - -```ts -import { schnorr } from '@noble/curves/secp256k1.js'; -const priv = schnorr.utils.randomPrivateKey(); -const pub = schnorr.getPublicKey(priv); -const msg = new TextEncoder().encode('hello'); -const sig = schnorr.sign(msg, priv); -const isValid = schnorr.verify(sig, msg, pub); -``` - -#### ed25519 - -```ts -import { ed25519 } from '@noble/curves/ed25519.js'; -const priv = ed25519.utils.randomPrivateKey(); -const pub = ed25519.getPublicKey(priv); -const msg = new TextEncoder().encode('hello'); -const sig = ed25519.sign(msg, priv); -ed25519.verify(sig, msg, pub); // Default mode: follows ZIP215 -ed25519.verify(sig, msg, pub, { zip215: false }); // SBS / e-voting / RFC8032 / FIPS 186-5 - -// Variants from RFC8032: with context, prehashed -import { ed25519ctx, ed25519ph } from '@noble/curves/ed25519.js'; -``` - -Default `verify` behavior follows ZIP215 and -can be used in consensus-critical applications. -If you need SBS (Strongly Binding Signatures) and FIPS 186-5 compliance, -use `zip215: false`. Check out [Edwards Signatures section for more info](#edwards-twisted-edwards-curve). -Both options have SUF-CMA (strong unforgeability under chosen message attacks). - -#### X25519 - -```ts -// X25519 aka ECDH on Curve25519 from [RFC7748](https://www.rfc-editor.org/rfc/rfc7748) -import { x25519 } from '@noble/curves/ed25519.js'; -const priv = 'a546e36bf0527c9d3b16154b82465edd62144c0ac1fc5a18506a2244ba449ac4'; -const pub = 'e6db6867583030db3594c1a424b15f7c726624ec26b3353b10a903a6d0ab1c4c'; -x25519.getSharedSecret(priv, pub) === x25519.scalarMult(priv, pub); // aliases -x25519.getPublicKey(priv) === x25519.scalarMultBase(priv); -x25519.getPublicKey(x25519.utils.randomPrivateKey()); - -// ed25519 => x25519 conversion -import { edwardsToMontgomeryPub, edwardsToMontgomeryPriv } from '@noble/curves/ed25519.js'; -edwardsToMontgomeryPub(ed25519.getPublicKey(ed25519.utils.randomPrivateKey())); -edwardsToMontgomeryPriv(ed25519.utils.randomPrivateKey()); -``` - -#### ristretto255 - -```ts -import { sha512 } from '@noble/hashes/sha2.js'; -import { - hashToCurve, - encodeToCurve, - RistrettoPoint, - hashToRistretto255, -} from '@noble/curves/ed25519.js'; - -const msg = new TextEncoder().encode('Ristretto is traditionally a short shot of espresso coffee'); -hashToCurve(msg); - -const rp = RistrettoPoint.fromHex( - '6a493210f7499cd17fecb510ae0cea23a110e8d5b901f8acadd3095c73a3b919' -); -RistrettoPoint.BASE.multiply(2n).add(rp).subtract(RistrettoPoint.BASE).toRawBytes(); -RistrettoPoint.ZERO.equals(dp) === false; -// pre-hashed hash-to-curve -RistrettoPoint.hashToCurve(sha512(msg)); -// full hash-to-curve including domain separation tag -hashToRistretto255(msg, { DST: 'ristretto255_XMD:SHA-512_R255MAP_RO_' }); -``` - -Check out [RFC9496](https://www.rfc-editor.org/rfc/rfc9496) more info on ristretto255. - -#### ed448 - -```ts -import { ed448 } from '@noble/curves/ed448.js'; -const priv = ed448.utils.randomPrivateKey(); -const pub = ed448.getPublicKey(priv); -const msg = new TextEncoder().encode('whatsup'); -const sig = ed448.sign(msg, priv); -ed448.verify(sig, msg, pub); - -// Variants from RFC8032: prehashed -import { ed448ph } from '@noble/curves/ed448.js'; -``` - -#### X448 - -```ts -// X448 aka ECDH on Curve448 from [RFC7748](https://www.rfc-editor.org/rfc/rfc7748) -import { x448 } from '@noble/curves/ed448.js'; -x448.getSharedSecret(priv, pub) === x448.scalarMult(priv, pub); // aliases -x448.getPublicKey(priv) === x448.scalarMultBase(priv); - -// ed448 => x448 conversion -import { edwardsToMontgomeryPub } from '@noble/curves/ed448.js'; -edwardsToMontgomeryPub(ed448.getPublicKey(ed448.utils.randomPrivateKey())); -``` - -#### decaf448 - -```ts -// decaf448 from [RFC9496](https://www.rfc-editor.org/rfc/rfc9496) -import { shake256 } from '@noble/hashes/sha3.js'; -import { hashToCurve, encodeToCurve, DecafPoint, hashToDecaf448 } from '@noble/curves/ed448.js'; - -const msg = new TextEncoder().encode('Ristretto is traditionally a short shot of espresso coffee'); -hashToCurve(msg); - -const dp = DecafPoint.fromHex( - 'c898eb4f87f97c564c6fd61fc7e49689314a1f818ec85eeb3bd5514ac816d38778f69ef347a89fca817e66defdedce178c7cc709b2116e75' -); -DecafPoint.BASE.multiply(2n).add(dp).subtract(DecafPoint.BASE).toRawBytes(); -DecafPoint.ZERO.equals(dp) === false; -// pre-hashed hash-to-curve -DecafPoint.hashToCurve(shake256(msg, { dkLen: 112 })); -// full hash-to-curve including domain separation tag -hashToDecaf448(msg, { DST: 'decaf448_XOF:SHAKE256_D448MAP_RO_' }); -``` - -Check out [RFC9496](https://www.rfc-editor.org/rfc/rfc9496) more info on decaf448. - -#### bls12-381 - -```ts -import { bls12_381 } from '@noble/curves/bls12-381.js'; -import { hexToBytes } from '@noble/curves/abstract/utils.js'; - -// private keys are 32 bytes -const privKey = hexToBytes('67d53f170b908cabb9eb326c3c337762d59289a8fec79f7bc9254b584b73265c'); -// const privKey = bls12_381.utils.randomPrivateKey(); - -// Long signatures (G2), short public keys (G1) -const blsl = bls12_381.longSignatures; -const publicKey = blsl.getPublicKey(privateKey); -// Sign msg with custom (Ethereum) DST -const msg = new TextEncoder().encode('hello'); -const DST = 'BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_'; -const msgp = blsl.hash(msg, DST); -const signature = blsl.sign(msgp, privateKey); -const isValid = blsl.verify(signature, msgp, publicKey); -console.log({ publicKey, signature, isValid }); - -// Short signatures (G1), long public keys (G2) -const blss = bls12_381.shortSignatures; -const publicKey2 = blss.getPublicKey(privateKey); -const msgp2 = blss.hash(new TextEncoder().encode('hello'), 'BLS_SIG_BLS12381G1_XMD:SHA-256_SSWU_RO_NUL_') -const signature2 = blss.sign(msgp2, privateKey); -const isValid2 = blss.verify(signature2, msgp2, publicKey); -console.log({ publicKey2, signature2, isValid2 }); - -// Aggregation -const aggregatedKey = bls12_381.longSignatures.aggregatePublicKeys([ - bls12_381.utils.randomPrivateKey(), - bls12_381.utils.randomPrivateKey(), -]); -// const aggregatedSig = bls.aggregateSignatures(sigs) - -// Pairings, with and without final exponentiation -// bls.pairing(PointG1, PointG2); -// bls.pairing(PointG1, PointG2, false); -// bls.fields.Fp12.finalExponentiate(bls.fields.Fp12.mul(PointG1, PointG2)); - -// Others -// bls.G1.ProjectivePoint.BASE, bls.G2.ProjectivePoint.BASE; -// bls.fields.Fp, bls.fields.Fp2, bls.fields.Fp12, bls.fields.Fr; -``` - -See [abstract/bls](#bls-barreto-lynn-scott-curves). -For example usage, check out [the implementation of BLS EVM precompiles](https://github.com/ethereumjs/ethereumjs-monorepo/blob/361f4edbc239e795a411ac2da7e5567298b9e7e5/packages/evm/src/precompiles/bls12_381/noble.ts). - -#### bn254 aka alt_bn128 - -```ts -import { bn254 } from '@noble/curves/bn254.js'; - -console.log(bn254.G1, bn254.G2, bn254.pairing); -``` - -The API mirrors [BLS](#bls12-381). The curve was previously called alt_bn128. -The implementation is compatible with [EIP-196](https://eips.ethereum.org/EIPS/eip-196) and -[EIP-197](https://eips.ethereum.org/EIPS/eip-197). - -We don't implement Point methods toHex / toRawBytes. -To work around this limitation, has to initialize points on their own from BigInts. -Reason it's not implemented is because [there is no standard](https://github.com/privacy-scaling-explorations/halo2curves/issues/109). -Points of divergence: - -- Endianness: LE vs BE (byte-swapped) -- Flags as first hex bits (similar to BLS) vs no-flags -- Imaginary part last in G2 vs first (c0, c1 vs c1, c0) - -For example usage, check out [the implementation of bn254 EVM precompiles](https://github.com/paulmillr/noble-curves/blob/3ed792f8ad9932765b84d1064afea8663a255457/test/bn254.test.js#L697). - -#### misc curves - -```ts -import { jubjub, babyjubjub } from '@noble/curves/misc.js'; -``` - -Miscellaneous, rarely used curves are contained in the module. -Jubjub curves have Fp over scalar fields of other curves. They are friendly to ZK proofs. -jubjub Fp = bls n. babyjubjub Fp = bn254 n. - -## Abstract API - -Abstract API allows to define custom curves. All arithmetics is done with JS -bigints over finite fields, which is defined from `modular` sub-module. -For scalar multiplication, we use -[precomputed tables with w-ary non-adjacent form (wNAF)](https://paulmillr.com/posts/noble-secp256k1-fast-ecc/). -Precomputes are enabled for weierstrass and edwards BASE points of a curve. -Implementations use [noble-hashes](https://github.com/paulmillr/noble-hashes). -It's always possible to use different hashing library. - - -### weierstrass: Short Weierstrass curve - -```js -import { weierstrass } from '@noble/curves/abstract/weierstrass.js'; -// NIST secp192r1 aka p192. https://www.secg.org/sec2-v2.pdf -const p192_CURVE = { - p: 0xfffffffffffffffffffffffffffffffeffffffffffffffffn, - n: 0xffffffffffffffffffffffff99def836146bc9b1b4d22831n, - h: 1n, - a: 0xfffffffffffffffffffffffffffffffefffffffffffffffcn, - b: 0x64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1n, - Gx: 0x188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012n, - Gy: 0x07192b95ffc8da78631011ed6b24cdd573f977a11e794811n, -}; -const p192_Point = weierstrass(p192_CURVE); -``` - -Short Weierstrass curve's formula is `y² = x³ + ax + b`. `weierstrass` -expects arguments `a`, `b`, field characteristic `p`, curve order `n`, -cofactor `h` and coordinates `Gx`, `Gy` of generator point. - -#### Projective Weierstrass Point - -```js -// # weierstrass Point methods -// projective (homogeneous) coordinates: (x, y, z) ∋ (x=x/z, y=y/z) -// const p = new Point(x, y, z); -const p = Point.BASE; -// arithmetics -p.add(p).equals(p.double()); -p.subtract(p).equals(Point.ZERO); -p.negate(); -p.multiply(31415n); - -// decoding, encoding -const b = p.toBytes(); -const p2 = Point.fromBytes(b); -// affine conversion -const { x, y } = p.toAffine(); -const p3 = Point.fromAffine({ x, y }); - -// Multi-scalar-multiplication (MSM) is basically `(Pa + Qb + Rc + ...)`. -// It's 10-30x faster vs naive addition for large amount of points. -// Pippenger algorithm is used underneath. -const points = [Point.BASE, Point.BASE.multiply(2n), Point.BASE.multiply(4n), Point.BASE.multiply(8n)]; -Point.msm(points, [3n, 5n, 7n, 11n]).equals(Point.BASE.multiply(129n)); // 129*G -``` - -#### ECDSA signatures - -```js -import { ecdsa } from '@noble/curves/abstract/weierstrass.js'; -import { sha256 } from '@noble/hashes/sha2.js'; -const p192 = ecdsa(p192_Point, sha256); -const priv = p192.utils.randomPrivateKey(); -const pub = p192.getPublicKey(priv); -const msg = sha256(new TextEncoder().encode('custom curve')); -const sig = p192.sign(msg); -const isValid = p192.verify(sig, msg, pub); -``` - -ECDSA signatures: - -- Are represented by `Signature` instances with `r, s` and optional `recovery` properties -- Have `recoverPublicKey()`, `toBytes()` with optional `format: 'compact' | 'der'` -- Can be prehashed, or non-prehashed: - - `sign(msgHash, privKey)` (default, prehash: false) - you did hashing before - - `sign(msg, privKey, {prehash: true})` - curves will do hashing for you -- Are generated deterministically, following [RFC6979](https://www.rfc-editor.org/rfc/rfc6979). - - Consider [hedged ECDSA with noise](#hedged-ecdsa-with-noise) for adding randomness into - for signatures, to get improved security against fault attacks. - -### edwards: Twisted Edwards curve - -```ts -import { edwards } from '@noble/curves/abstract/edwards.js'; -const ed25519_CURVE = { - p: 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffedn, - n: 0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3edn, - h: 8n, - a: 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffecn, - d: 0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3n, - Gx: 0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51an, - Gy: 0x6666666666666666666666666666666666666666666666666666666666666658n, -}; -const ed25519_Point = edwards(ed25519_CURVE); -``` - -Twisted Edwards curve's formula is `ax² + y² = 1 + dx²y²`. -You must specify `a`, `d`, field characteristic `p`, curve order `n` (sometimes named as `L`), -cofactor `h` and coordinates `Gx`, `Gy` of generator point. - -#### Extended Edwards Point - -```js -const Point = ed25519_Point; -// extended coordinates: (x, y, z, t) ∋ (x=x/z, y=y/z) -// const p = new Point(x, y, z, t); - -const p = Point.BASE; -// arithmetics -p.add(p).equals(p.double()); -p.subtract(p).equals(Point.ZERO); -p.negate(); -p.multiply(31415n); - -// decoding, encoding -const b = p.toBytes(); -const p2 = Point.fromBytes(b); -// on-curve test -p.assertValidity(); -// affine conversion -const { x, y } = p.toAffine(); -const p3 = Point.fromAffine({ x, y }); -// misc -const pcl = p.clearCofactor(); -console.log(p.isTorsionFree(), p.isSmallOrder()); -``` - -#### EdDSA signatures - -```js -const ed25519 = eddsa(ed25519_Point, { hash: sha512 }); -// ed25519.getPublicKey(); -// ed25519.sign(); -// ed25519.verify(); -``` - -We define ed25519, ed448; user can use custom curves with EdDSA, -but EdDSA in general is not defined. Check out `edwards.ts` source code. - -For EdDSA signatures: - -- `zip215: true` is default behavior. It has slightly looser verification logic - to be [consensus-friendly](https://hdevalence.ca/blog/2020-10-04-its-25519am), following [ZIP215](https://zips.z.cash/zip-0215) rules -- `zip215: false` switches verification criteria to strict - [RFC8032](https://www.rfc-editor.org/rfc/rfc8032) / [FIPS 186-5](https://csrc.nist.gov/publications/detail/fips/186/5/final) - and additionally provides [non-repudiation with SBS](https://eprint.iacr.org/2020/1244), - which is useful for: - - Contract Signing: if A signed an agreement with B using key that allows repudiation, it can later claim that it signed a different contract - - E-voting: malicious voters may pick keys that allow repudiation in order to deny results - - Blockchains: transaction of amount X might also be valid for a different amount Y -- Both modes have SUF-CMA (strong unforgeability under chosen message attacks). - -### montgomery: Montgomery curve - -The module contains methods for x-only ECDH on Curve25519 / Curve448 from RFC7748. -Proper Elliptic Curve Points are not implemented yet. - -### bls: Barreto-Lynn-Scott curves - -The module abstracts BLS (Barreto-Lynn-Scott) pairing-friendly elliptic curve construction. -They allow to construct [zk-SNARKs](https://z.cash/technology/zksnarks/) and -use aggregated, batch-verifiable -[threshold signatures](https://medium.com/snigirev.stepan/bls-signatures-better-than-schnorr-5a7fe30ea716), -using Boneh-Lynn-Shacham signature scheme. - -The module doesn't expose `CURVE` property: use `G1.CURVE`, `G2.CURVE` instead. -Only BLS12-381 is currently implemented. -Defining BLS12-377 and BLS24 should be straightforward. - -The default BLS uses short public keys (with public keys in G1 and signatures in G2). -Short signatures (public keys in G2 and signatures in G1) are also supported. - -### hash-to-curve: Hashing strings to curve points - -The module allows to hash arbitrary strings to elliptic curve points. Implements [RFC 9380](https://www.rfc-editor.org/rfc/rfc9380). - -Every curve has exported `hashToCurve` and `encodeToCurve` methods. You should always prefer `hashToCurve` for security: - -```ts -import { hashToCurve, encodeToCurve } from '@noble/curves/secp256k1.js'; -import { randomBytes } from '@noble/hashes/utils.js'; -hashToCurve('0102abcd'); -console.log(hashToCurve(randomBytes())); -console.log(encodeToCurve(randomBytes())); - -import { bls12_381 } from '@noble/curves/bls12-381.js'; -bls12_381.G1.hashToCurve(randomBytes(), { DST: 'another' }); -bls12_381.G2.hashToCurve(randomBytes(), { DST: 'custom' }); -``` - -Low-level methods from the spec: - -```ts -// produces a uniformly random byte string using a cryptographic hash function H that outputs b bits. -function expand_message_xmd( - msg: Uint8Array, - DST: Uint8Array, - lenInBytes: number, - H: CHash // For CHash see abstract/weierstrass docs section -): Uint8Array; -// produces a uniformly random byte string using an extendable-output function (XOF) H. -function expand_message_xof( - msg: Uint8Array, - DST: Uint8Array, - lenInBytes: number, - k: number, - H: CHash -): Uint8Array; -// Hashes arbitrary-length byte strings to a list of one or more elements of a finite field F -function hash_to_field(msg: Uint8Array, count: number, options: Opts): bigint[][]; - -/** - * * `DST` is a domain separation tag, defined in section 2.2.5 - * * `p` characteristic of F, where F is a finite field of characteristic p and order q = p^m - * * `m` is extension degree (1 for prime fields) - * * `k` is the target security target in bits (e.g. 128), from section 5.1 - * * `expand` is `xmd` (SHA2, SHA3, BLAKE) or `xof` (SHAKE, BLAKE-XOF) - * * `hash` conforming to `utils.CHash` interface, with `outputLen` / `blockLen` props - */ -type UnicodeOrBytes = string | Uint8Array; -type Opts = { - DST: UnicodeOrBytes; - p: bigint; - m: number; - k: number; - expand?: 'xmd' | 'xof'; - hash: CHash; -}; -``` - -### poseidon: Poseidon hash - -Implements [Poseidon](https://www.poseidon-hash.info) ZK-friendly hash: -permutation and sponge. - -There are many poseidon variants with different constants. -We don't provide them: you should construct them manually. -Check out [scure-starknet](https://github.com/paulmillr/scure-starknet) package for a proper example. - -```ts -import { poseidon, poseidonSponge } from '@noble/curves/abstract/poseidon.js'; - -const rate = 2; -const capacity = 1; -const { mds, roundConstants } = poseidon.grainGenConstants({ - Fp, - t: rate + capacity, - roundsFull: 8, - roundsPartial: 31, -}); -const opts = { - Fp, - rate, - capacity, - sboxPower: 17, - mds, - roundConstants, - roundsFull: 8, - roundsPartial: 31, -}; -const permutation = poseidon.poseidon(opts); -const sponge = poseidon.poseidonSponge(opts); // use carefully, not specced -``` - -### modular: Modular arithmetics utilities - -```ts -import * as mod from '@noble/curves/abstract/modular.js'; - -// Finite Field utils -const fp = mod.Field(2n ** 255n - 19n); // Finite field over 2^255-19 -fp.mul(591n, 932n); // multiplication -fp.pow(481n, 11024858120n); // exponentiation -fp.div(5n, 17n); // division: 5/17 mod 2^255-19 == 5 * invert(17) -fp.inv(5n); // modular inverse -fp.sqrt(21n); // square root - -// Non-Field generic utils are also available -mod.mod(21n, 10n); // 21 mod 10 == 1n; fixed version of 21 % 10 -mod.invert(17n, 10n); // invert(17) mod 10; modular multiplicative inverse -mod.invertBatch([1n, 2n, 4n], 21n); // => [1n, 11n, 16n] in one inversion -``` - -Field operations are not constant-time: they are using JS bigints, see [security](#security). -The fact is mostly irrelevant, but the important method to keep in mind is `pow`, -which may leak exponent bits, when used naïvely. - -`mod.Field` is always **field over prime number**. Non-prime fields aren't supported for now. -We don't test for prime-ness for speed and because algorithms are probabilistic anyway. -Initializing a non-prime field could make your app suspectible to -DoS (infilite loop) on Tonelli-Shanks square root calculation. - -Unlike `mod.inv`, `mod.invertBatch` won't throw on `0`: make sure to throw an error yourself. - -### fft: Fast Fourier Transform - -Experimental implementation of NTT / FFT (Fast Fourier Transform) over finite fields. -API may change at any time. The code has not been audited. Feature requests are welcome. - -```ts -import * as fft from '@noble/curves/abstract/fft.js'; -``` - -#### Creating private keys from hashes - -You can't simply make a 32-byte private key from a 32-byte hash. -Doing so will make the key [biased](https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/). - -To make the bias negligible, we follow [FIPS 186-5 A.2](https://csrc.nist.gov/publications/detail/fips/186/5/final) -and [RFC 9380](https://www.rfc-editor.org/rfc/rfc9380#section-5.2). -This means, for 32-byte key, we would need 48-byte hash to get 2^-128 bias, which matches curve security level. - -`hashToPrivateScalar()` that hashes to **private key** was created for this purpose. -Use [abstract/hash-to-curve](#hash-to-curve-hashing-strings-to-curve-points) -if you need to hash to **public key**. - -```ts -import { p256 } from '@noble/curves/nist.js'; -import { sha256 } from '@noble/hashes/sha2.js'; -import { hkdf } from '@noble/hashes/hkdf.js'; -import * as mod from '@noble/curves/abstract/modular.js'; -const someKey = new Uint8Array(32).fill(2); // Needs to actually be random, not .fill(2) -const derived = hkdf(sha256, someKey, undefined, 'application', 48); // 48 bytes for 32-byte priv -const validPrivateKey = mod.hashToPrivateScalar(derived, p256.CURVE.n); -``` - -### utils: Useful utilities - -```ts -import * as utils from '@noble/curves/abstract/utils.js'; - -utils.bytesToHex(Uint8Array.from([0xde, 0xad, 0xbe, 0xef])); -utils.hexToBytes('deadbeef'); -utils.numberToHexUnpadded(123n); -utils.hexToNumber(); - -utils.bytesToNumberBE(Uint8Array.from([0xde, 0xad, 0xbe, 0xef])); -utils.bytesToNumberLE(Uint8Array.from([0xde, 0xad, 0xbe, 0xef])); -utils.numberToBytesBE(123n, 32); -utils.numberToBytesLE(123n, 64); - -utils.concatBytes(Uint8Array.from([0xde, 0xad]), Uint8Array.from([0xbe, 0xef])); -utils.nLength(255n); -utils.equalBytes(Uint8Array.from([0xde]), Uint8Array.from([0xde])); -``` - -### Unreleased bits - -- `test/unreleased-xeddsa.ts` contains implementation of XEd25519, defined by Signal -- `test/misc/endomorphism.js` contains tool for generation of endomorphism params for Koblitz curves - -## Security - -The library has been independently audited: - -- at version 1.6.0, in Sep 2024, by [Cure53](https://cure53.de) - - PDFs: [website](https://cure53.de/audit-report_noble-crypto-libs.pdf), [in-repo](./audit/2024-09-cure53-audit-nbl4.pdf) - - [Changes since audit](https://github.com/paulmillr/noble-curves/compare/1.6.0..main) - - Scope: ed25519, ed448, their add-ons, bls12-381, bn254, - hash-to-curve, low-level primitives bls, tower, edwards, montgomery. - - The audit has been funded by [OpenSats](https://opensats.org) -- at version 1.2.0, in Sep 2023, by [Kudelski Security](https://kudelskisecurity.com) - - PDFs: [in-repo](./audit/2023-09-kudelski-audit-starknet.pdf) - - [Changes since audit](https://github.com/paulmillr/noble-curves/compare/1.2.0..main) - - Scope: [scure-starknet](https://github.com/paulmillr/scure-starknet) and its related - abstract modules of noble-curves: `curve`, `modular`, `poseidon`, `weierstrass` - - The audit has been funded by [Starkware](https://starkware.co) -- at version 0.7.3, in Feb 2023, by [Trail of Bits](https://www.trailofbits.com) - - PDFs: [website](https://github.com/trailofbits/publications/blob/master/reviews/2023-01-ryanshea-noblecurveslibrary-securityreview.pdf), - [in-repo](./audit/2023-01-trailofbits-audit-curves.pdf) - - [Changes since audit](https://github.com/paulmillr/noble-curves/compare/0.7.3..main) - - Scope: abstract modules `curve`, `hash-to-curve`, `modular`, `poseidon`, `utils`, `weierstrass` and - top-level modules `_shortw_utils` and `secp256k1` - - The audit has been funded by [Ryan Shea](https://www.shea.io) - -It is tested against property-based, cross-library and Wycheproof vectors, -and is being fuzzed in [the separate repo](https://github.com/paulmillr/fuzzing). - -If you see anything unusual: investigate and report. - -### Constant-timeness - -We're targetting algorithmic constant time. _JIT-compiler_ and _Garbage Collector_ make "constant time" -extremely hard to achieve [timing attack](https://en.wikipedia.org/wiki/Timing_attack) resistance -in a scripting language. Which means _any other JS library can't have -constant-timeness_. Even statically typed Rust, a language without GC, -[makes it harder to achieve constant-time](https://www.chosenplaintext.ca/open-source/rust-timing-shield/security) -for some cases. If your goal is absolute security, don't use any JS lib — including bindings to native ones. -Use low-level libraries & languages. - -### Memory dumping - -Use low-level languages instead of JS / WASM if your goal is absolute security. - -The library mostly uses Uint8Arrays and bigints. - -- Uint8Arrays have `.fill(0)` which instructs to fill content with zeroes - but there are no guarantees in JS -- bigints are immutable and don't have a method to zeroize their content: - a user needs to wait until the next garbage collection cycle -- hex strings are also immutable: there is no way to zeroize them -- `await fn()` will write all internal variables to memory. With - async functions there are no guarantees when the code - chunk would be executed. Which means attacker can have - plenty of time to read data from memory. - -This means some secrets could stay in memory longer than anticipated. -However, if an attacker can read application memory, it's doomed anyway: -there is no way to guarantee anything about zeroizing sensitive data without -complex tests-suite which will dump process memory and verify that there is -no sensitive data left. For JS it means testing all browsers (including mobile). -And, of course, it will be useless without using the same -test-suite in the actual application that consumes the library. - -### Supply chain security - -- **Commits** are signed with PGP keys, to prevent forgery. Make sure to verify commit signatures -- **Releases** are transparent and built on GitHub CI. Make sure to verify [provenance](https://docs.npmjs.com/generating-provenance-statements) logs - - Use GitHub CLI to verify single-file builds: - `gh attestation verify --owner paulmillr noble-curves.js` -- **Rare releasing** is followed to ensure less re-audit need for end-users -- **Dependencies** are minimized and locked-down: any dependency could get hacked and users will be downloading malware with every install. - - We make sure to use as few dependencies as possible - - Automatic dep updates are prevented by locking-down version ranges; diffs are checked with `npm-diff` -- **Dev Dependencies** are disabled for end-users; they are only used to develop / build the source code - -For this package, there is 1 dependency; and a few dev dependencies: - -- [noble-hashes](https://github.com/paulmillr/noble-hashes) provides cryptographic hashing functionality -- micro-bmark, micro-should and jsbt are used for benchmarking / testing / build tooling and developed by the same author -- prettier, fast-check and typescript are used for code quality / test generation / ts compilation. It's hard to audit their source code thoroughly and fully because of their size - -### Randomness - -We're deferring to built-in -[crypto.getRandomValues](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues) -which is considered cryptographically secure (CSPRNG). - -In the past, browsers had bugs that made it weak: it may happen again. -Implementing a userspace CSPRNG to get resilient to the weakness -is even worse: there is no reliable userspace source of quality entropy. - -### Quantum computers - -Cryptographically relevant quantum computer, if built, will allow to -break elliptic curve cryptography (both ECDSA / EdDSA & ECDH) using Shor's algorithm. - -Consider switching to newer / hybrid algorithms, such as SPHINCS+. They are available in -[noble-post-quantum](https://github.com/paulmillr/noble-post-quantum). - -NIST prohibits classical cryptography (RSA, DSA, ECDSA, ECDH) [after 2035](https://nvlpubs.nist.gov/nistpubs/ir/2024/NIST.IR.8547.ipd.pdf). Australian ASD prohibits it [after 2030](https://www.cyber.gov.au/resources-business-and-government/essential-cyber-security/ism/cyber-security-guidelines/guidelines-cryptography). - -## Speed - -```sh -npm run bench:install && npm run bench -``` - -noble-curves spends 10+ ms to generate 20MB+ of base point precomputes. -This is done **one-time** per curve. - -The generation is deferred until any method (pubkey, sign, verify) is called. -User can force precompute generation by manually calling `Point.BASE.precompute(windowSize, false)`. -Check out the source code. - -Benchmark results on Apple M4: - -``` -# secp256k1 -init 10ms -getPublicKey x 9,099 ops/sec @ 109μs/op -sign x 7,182 ops/sec @ 139μs/op -verify x 1,188 ops/sec @ 841μs/op -getSharedSecret x 735 ops/sec @ 1ms/op -recoverPublicKey x 1,265 ops/sec @ 790μs/op -schnorr.sign x 957 ops/sec @ 1ms/op -schnorr.verify x 1,210 ops/sec @ 825μs/op - -# ed25519 -init 14ms -getPublicKey x 14,216 ops/sec @ 70μs/op -sign x 6,849 ops/sec @ 145μs/op -verify x 1,400 ops/sec @ 713μs/op - -# ed448 -init 37ms -getPublicKey x 5,273 ops/sec @ 189μs/op -sign x 2,494 ops/sec @ 400μs/op -verify x 476 ops/sec @ 2ms/op - -# p256 -init 17ms -getPublicKey x 8,977 ops/sec @ 111μs/op -sign x 7,236 ops/sec @ 138μs/op -verify x 877 ops/sec @ 1ms/op - -# p384 -init 42ms -getPublicKey x 4,084 ops/sec @ 244μs/op -sign x 3,247 ops/sec @ 307μs/op -verify x 331 ops/sec @ 3ms/op - -# p521 -init 83ms -getPublicKey x 2,049 ops/sec @ 487μs/op -sign x 1,748 ops/sec @ 571μs/op -verify x 170 ops/sec @ 5ms/op - -# ristretto255 -add x 931,966 ops/sec @ 1μs/op -multiply x 15,444 ops/sec @ 64μs/op -encode x 21,367 ops/sec @ 46μs/op -decode x 21,715 ops/sec @ 46μs/op - -# decaf448 -add x 478,011 ops/sec @ 2μs/op -multiply x 416 ops/sec @ 2ms/op -encode x 8,562 ops/sec @ 116μs/op -decode x 8,636 ops/sec @ 115μs/op - -# ECDH -x25519 x 1,981 ops/sec @ 504μs/op -x448 x 743 ops/sec @ 1ms/op -secp256k1 x 728 ops/sec @ 1ms/op -p256 x 705 ops/sec @ 1ms/op -p384 x 268 ops/sec @ 3ms/op -p521 x 137 ops/sec @ 7ms/op - -# hash-to-curve -hashToPrivateScalar x 1,754,385 ops/sec @ 570ns/op -hash_to_field x 135,703 ops/sec @ 7μs/op -hashToCurve secp256k1 x 3,194 ops/sec @ 313μs/op -hashToCurve p256 x 5,962 ops/sec @ 167μs/op -hashToCurve p384 x 2,230 ops/sec @ 448μs/op -hashToCurve p521 x 1,063 ops/sec @ 940μs/op -hashToCurve ed25519 x 4,047 ops/sec @ 247μs/op -hashToCurve ed448 x 1,691 ops/sec @ 591μs/op -hash_to_ristretto255 x 8,733 ops/sec @ 114μs/op -hash_to_decaf448 x 3,882 ops/sec @ 257μs/op - -# modular over secp256k1 P field -invert a x 866,551 ops/sec @ 1μs/op -invert b x 693,962 ops/sec @ 1μs/op -sqrt p = 3 mod 4 x 25,738 ops/sec @ 38μs/op -sqrt tonneli-shanks x 847 ops/sec @ 1ms/op - -# bls12-381 -init 22ms -getPublicKey x 1,325 ops/sec @ 754μs/op -sign x 80 ops/sec @ 12ms/op -verify x 62 ops/sec @ 15ms/op -pairing x 166 ops/sec @ 6ms/op -pairing10 x 54 ops/sec @ 18ms/op ± 23.48% (15ms..36ms) -MSM 4096 scalars x points 3286ms -aggregatePublicKeys/8 x 173 ops/sec @ 5ms/op -aggregatePublicKeys/32 x 46 ops/sec @ 21ms/op -aggregatePublicKeys/128 x 11 ops/sec @ 84ms/op -aggregatePublicKeys/512 x 2 ops/sec @ 335ms/op -aggregatePublicKeys/2048 x 0 ops/sec @ 1346ms/op -aggregateSignatures/8 x 82 ops/sec @ 12ms/op -aggregateSignatures/32 x 21 ops/sec @ 45ms/op -aggregateSignatures/128 x 5 ops/sec @ 178ms/op -aggregateSignatures/512 x 1 ops/sec @ 705ms/op -aggregateSignatures/2048 x 0 ops/sec @ 2823ms/op -``` - -## Upgrading - -Supported node.js versions: - -- v2: v20.19+ (ESM-only) -- v1: v14.21+ (ESM & CJS) - -### curves v1 => curves v2 - -WIP. Changelog of v2, when upgrading from curves v1. - -### noble-secp256k1 v1 => curves v1 - -Previously, the library was split into single-feature packages -[noble-secp256k1](https://github.com/paulmillr/noble-secp256k1), -[noble-ed25519](https://github.com/paulmillr/noble-ed25519) and -[noble-bls12-381](https://github.com/paulmillr/noble-bls12-381). - -Curves continue their original work. The single-feature packages changed their -direction towards providing minimal 4kb implementations of cryptography, -which means they have less features. - -- `getPublicKey` - - now produce 33-byte compressed signatures by default - - to use old behavior, which produced 65-byte uncompressed keys, set - argument `isCompressed` to `false`: `getPublicKey(priv, false)` -- `sign` - - is now sync - - now returns `Signature` instance with `{ r, s, recovery }` properties - - `canonical` option was renamed to `lowS` - - `recovered` option has been removed because recovery bit is always returned now - - `der` option has been removed. There are 2 options: - 1. Use compact encoding: `fromCompact`, `toCompactRawBytes`, `toCompactHex`. - Compact encoding is simply a concatenation of 32-byte r and 32-byte s. - 2. If you must use DER encoding, switch to noble-curves (see above). -- `verify` - - is now sync - - `strict` option was renamed to `lowS` -- `getSharedSecret` - - now produce 33-byte compressed signatures by default - - to use old behavior, which produced 65-byte uncompressed keys, set - argument `isCompressed` to `false`: `getSharedSecret(a, b, false)` -- `recoverPublicKey(msg, sig, rec)` was changed to `sig.recoverPublicKey(msg)` -- `number` type for private keys have been removed: use `bigint` instead -- `Point` (2d xy) has been changed to `ProjectivePoint` (3d xyz) -- `utils` were split into `utils` (same api as in noble-curves) and - `etc` (`hmacSha256Sync` and others) - -### noble-ed25519 v1 => curves v1 - -Upgrading from [@noble/ed25519](https://github.com/paulmillr/noble-ed25519) 1.7: - -- Methods are now sync by default -- `bigint` is no longer allowed in `getPublicKey`, `sign`, `verify`. Reason: ed25519 is LE, can lead to bugs -- `Point` (2d xy) has been changed to `ExtendedPoint` (xyzt) -- `Signature` was removed: just use raw bytes or hex now -- `utils` were split into `utils` (same api as in noble-curves) and - `etc` (`sha512Sync` and others) -- `getSharedSecret` was moved to `x25519` module -- `toX25519` has been moved to `edwardsToMontgomeryPub` and `edwardsToMontgomeryPriv` methods - -### noble-bls12-381 => curves v1 - -Upgrading from [@noble/bls12-381](https://github.com/paulmillr/noble-bls12-381): - -- Methods and classes were renamed: - - PointG1 -> G1.Point, PointG2 -> G2.Point - - PointG2.fromSignature -> Signature.decode, PointG2.toSignature -> Signature.encode -- Fp2 ORDER was corrected - -## Contributing & testing - -- `npm install && npm run build && npm test` will build the code and run tests. -- `npm run lint` / `npm run format` will run linter / fix linter issues. -- `npm run bench` will run benchmarks, which may need their deps first (`npm run bench:install`) -- `npm run build:release` will build single file - -Check out [github.com/paulmillr/guidelines](https://github.com/paulmillr/guidelines) -for general coding practices and rules. - -See [paulmillr.com/noble](https://paulmillr.com/noble/) -for useful resources, articles, documentation and demos -related to the library. - -MuSig2 signature scheme and BIP324 ElligatorSwift mapping for secp256k1 -are available [in a separate package](https://github.com/paulmillr/scure-btc-signer). - -## License - -The MIT License (MIT) - -Copyright (c) 2022 Paul Miller [(https://paulmillr.com)](https://paulmillr.com) - -See LICENSE file. diff --git a/tools/mnemonic-test/node_modules/@noble/curves/_shortw_utils.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/_shortw_utils.d.ts deleted file mode 100644 index e0cd1e0d..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/_shortw_utils.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Utilities for short weierstrass curves, combined with noble-hashes. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { type CurveFn, type CurveType } from './abstract/weierstrass.ts'; -import type { CHash } from './utils.ts'; -/** connects noble-curves to noble-hashes */ -export declare function getHash(hash: CHash): { - hash: CHash; -}; -/** Same API as @noble/hashes, with ability to create curve with custom hash */ -export type CurveDef = Readonly>; -export type CurveFnWithCreate = CurveFn & { - create: (hash: CHash) => CurveFn; -}; -/** @deprecated use new `weierstrass()` and `ecdsa()` methods */ -export declare function createCurve(curveDef: CurveDef, defHash: CHash): CurveFnWithCreate; -//# sourceMappingURL=_shortw_utils.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/_shortw_utils.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/_shortw_utils.d.ts.map deleted file mode 100644 index 51c5ab46..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/_shortw_utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_shortw_utils.d.ts","sourceRoot":"","sources":["src/_shortw_utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,sEAAsE;AACtE,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,SAAS,EAAe,MAAM,2BAA2B,CAAC;AACtF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,4CAA4C;AAC5C,wBAAgB,OAAO,CAAC,IAAI,EAAE,KAAK,GAAG;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE,CAEpD;AACD,+EAA+E;AAC/E,MAAM,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;AACzD,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG;IAAE,MAAM,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,OAAO,CAAA;CAAE,CAAC;AAE/E,gEAAgE;AAChE,wBAAgB,WAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,GAAG,iBAAiB,CAGjF"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/_shortw_utils.js b/tools/mnemonic-test/node_modules/@noble/curves/_shortw_utils.js deleted file mode 100644 index 112f6b5c..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/_shortw_utils.js +++ /dev/null @@ -1,20 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getHash = getHash; -exports.createCurve = createCurve; -/** - * Utilities for short weierstrass curves, combined with noble-hashes. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const weierstrass_ts_1 = require("./abstract/weierstrass.js"); -/** connects noble-curves to noble-hashes */ -function getHash(hash) { - return { hash }; -} -/** @deprecated use new `weierstrass()` and `ecdsa()` methods */ -function createCurve(curveDef, defHash) { - const create = (hash) => (0, weierstrass_ts_1.weierstrass)({ ...curveDef, hash: hash }); - return { ...create(defHash), create }; -} -//# sourceMappingURL=_shortw_utils.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/_shortw_utils.js.map b/tools/mnemonic-test/node_modules/@noble/curves/_shortw_utils.js.map deleted file mode 100644 index 6d91b036..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/_shortw_utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_shortw_utils.js","sourceRoot":"","sources":["src/_shortw_utils.ts"],"names":[],"mappings":";;AASA,0BAEC;AAMD,kCAGC;AApBD;;;GAGG;AACH,sEAAsE;AACtE,8DAAsF;AAGtF,4CAA4C;AAC5C,SAAgB,OAAO,CAAC,IAAW;IACjC,OAAO,EAAE,IAAI,EAAE,CAAC;AAClB,CAAC;AAKD,gEAAgE;AAChE,SAAgB,WAAW,CAAC,QAAkB,EAAE,OAAc;IAC5D,MAAM,MAAM,GAAG,CAAC,IAAW,EAAW,EAAE,CAAC,IAAA,4BAAW,EAAC,EAAE,GAAG,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IAClF,OAAO,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;AACxC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/bls.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/abstract/bls.d.ts deleted file mode 100644 index 8a8fd9c2..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/bls.d.ts +++ /dev/null @@ -1,190 +0,0 @@ -/** - * BLS != BLS. - * The file implements BLS (Boneh-Lynn-Shacham) signatures. - * Used in both BLS (Barreto-Lynn-Scott) and BN (Barreto-Naehrig) - * families of pairing-friendly curves. - * Consists of two curves: G1 and G2: - * - G1 is a subgroup of (x, y) E(Fq) over y² = x³ + 4. - * - G2 is a subgroup of ((x₁, x₂+i), (y₁, y₂+i)) E(Fq²) over y² = x³ + 4(1 + i) where i is √-1 - * - Gt, created by bilinear (ate) pairing e(G1, G2), consists of p-th roots of unity in - * Fq^k where k is embedding degree. Only degree 12 is currently supported, 24 is not. - * Pairing is used to aggregate and verify signatures. - * There are two modes of operation: - * - Long signatures: X-byte keys + 2X-byte sigs (G1 keys + G2 sigs). - * - Short signatures: 2X-byte keys + X-byte sigs (G2 keys + G1 sigs). - * @module - **/ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { type CHash, type Hex, type PrivKey } from '../utils.ts'; -import { type H2CHasher, type H2CHashOpts, type H2COpts, type htfBasicOpts, type MapToCurve } from './hash-to-curve.ts'; -import { type IField } from './modular.ts'; -import type { Fp12, Fp12Bls, Fp2, Fp2Bls, Fp6Bls } from './tower.ts'; -import { type CurvePointsRes, type CurvePointsType, type WeierstrassPoint, type WeierstrassPointCons } from './weierstrass.ts'; -type Fp = bigint; -export type TwistType = 'multiplicative' | 'divisive'; -export type ShortSignatureCoder = { - fromBytes(bytes: Uint8Array): WeierstrassPoint; - fromHex(hex: Hex): WeierstrassPoint; - toBytes(point: WeierstrassPoint): Uint8Array; - toHex(point: WeierstrassPoint): string; - /** @deprecated use `toBytes` */ - toRawBytes(point: WeierstrassPoint): Uint8Array; -}; -export type SignatureCoder = { - fromBytes(bytes: Uint8Array): WeierstrassPoint; - fromHex(hex: Hex): WeierstrassPoint; - toBytes(point: WeierstrassPoint): Uint8Array; - toHex(point: WeierstrassPoint): string; - /** @deprecated use `toBytes` */ - toRawBytes(point: WeierstrassPoint): Uint8Array; -}; -export type BlsFields = { - Fp: IField; - Fr: IField; - Fp2: Fp2Bls; - Fp6: Fp6Bls; - Fp12: Fp12Bls; -}; -export type PostPrecomputePointAddFn = (Rx: Fp2, Ry: Fp2, Rz: Fp2, Qx: Fp2, Qy: Fp2) => { - Rx: Fp2; - Ry: Fp2; - Rz: Fp2; -}; -export type PostPrecomputeFn = (Rx: Fp2, Ry: Fp2, Rz: Fp2, Qx: Fp2, Qy: Fp2, pointAdd: PostPrecomputePointAddFn) => void; -export type BlsPairing = { - Fp12: Fp12Bls; - calcPairingPrecomputes: (p: WeierstrassPoint) => Precompute; - millerLoopBatch: (pairs: [Precompute, Fp, Fp][]) => Fp12; - pairing: (P: WeierstrassPoint, Q: WeierstrassPoint, withFinalExponent?: boolean) => Fp12; - pairingBatch: (pairs: { - g1: WeierstrassPoint; - g2: WeierstrassPoint; - }[], withFinalExponent?: boolean) => Fp12; -}; -export type BlsPairingParams = { - ateLoopSize: bigint; - xNegative: boolean; - twistType: TwistType; - postPrecompute?: PostPrecomputeFn; -}; -export type CurveType = { - G1: CurvePointsType & { - ShortSignature: SignatureCoder; - mapToCurve: MapToCurve; - htfDefaults: H2COpts; - }; - G2: CurvePointsType & { - Signature: SignatureCoder; - mapToCurve: MapToCurve; - htfDefaults: H2COpts; - }; - fields: BlsFields; - params: { - ateLoopSize: BlsPairingParams['ateLoopSize']; - xNegative: BlsPairingParams['xNegative']; - r: bigint; - twistType: BlsPairingParams['twistType']; - }; - htfDefaults: H2COpts; - hash: CHash; - randomBytes?: (bytesLength?: number) => Uint8Array; - postPrecompute?: PostPrecomputeFn; -}; -type PrecomputeSingle = [Fp2, Fp2, Fp2][]; -type Precompute = PrecomputeSingle[]; -/** - * BLS consists of two curves: G1 and G2: - * - G1 is a subgroup of (x, y) E(Fq) over y² = x³ + 4. - * - G2 is a subgroup of ((x₁, x₂+i), (y₁, y₂+i)) E(Fq²) over y² = x³ + 4(1 + i) where i is √-1 - */ -export interface BLSCurvePair { - longSignatures: BLSSigs; - shortSignatures: BLSSigs; - millerLoopBatch: BlsPairing['millerLoopBatch']; - pairing: BlsPairing['pairing']; - pairingBatch: BlsPairing['pairingBatch']; - G1: { - Point: WeierstrassPointCons; - } & H2CHasher; - G2: { - Point: WeierstrassPointCons; - } & H2CHasher; - fields: { - Fp: IField; - Fp2: Fp2Bls; - Fp6: Fp6Bls; - Fp12: Fp12Bls; - Fr: IField; - }; - utils: { - randomSecretKey: () => Uint8Array; - /** @deprecated use randomSecretKey */ - randomPrivateKey: () => Uint8Array; - calcPairingPrecomputes: BlsPairing['calcPairingPrecomputes']; - }; -} -export type CurveFn = BLSCurvePair & { - /** @deprecated use `longSignatures.getPublicKey` */ - getPublicKey: (secretKey: PrivKey) => Uint8Array; - /** @deprecated use `shortSignatures.getPublicKey` */ - getPublicKeyForShortSignatures: (secretKey: PrivKey) => Uint8Array; - /** @deprecated use `longSignatures.sign` */ - sign: { - (message: Hex, secretKey: PrivKey, htfOpts?: htfBasicOpts): Uint8Array; - (message: WeierstrassPoint, secretKey: PrivKey, htfOpts?: htfBasicOpts): WeierstrassPoint; - }; - /** @deprecated use `shortSignatures.sign` */ - signShortSignature: { - (message: Hex, secretKey: PrivKey, htfOpts?: htfBasicOpts): Uint8Array; - (message: WeierstrassPoint, secretKey: PrivKey, htfOpts?: htfBasicOpts): WeierstrassPoint; - }; - /** @deprecated use `longSignatures.verify` */ - verify: (signature: Hex | WeierstrassPoint, message: Hex | WeierstrassPoint, publicKey: Hex | WeierstrassPoint, htfOpts?: htfBasicOpts) => boolean; - /** @deprecated use `shortSignatures.verify` */ - verifyShortSignature: (signature: Hex | WeierstrassPoint, message: Hex | WeierstrassPoint, publicKey: Hex | WeierstrassPoint, htfOpts?: htfBasicOpts) => boolean; - verifyBatch: (signature: Hex | WeierstrassPoint, messages: (Hex | WeierstrassPoint)[], publicKeys: (Hex | WeierstrassPoint)[], htfOpts?: htfBasicOpts) => boolean; - /** @deprecated use `longSignatures.aggregatePublicKeys` */ - aggregatePublicKeys: { - (publicKeys: Hex[]): Uint8Array; - (publicKeys: WeierstrassPoint[]): WeierstrassPoint; - }; - /** @deprecated use `longSignatures.aggregateSignatures` */ - aggregateSignatures: { - (signatures: Hex[]): Uint8Array; - (signatures: WeierstrassPoint[]): WeierstrassPoint; - }; - /** @deprecated use `shortSignatures.aggregateSignatures` */ - aggregateShortSignatures: { - (signatures: Hex[]): Uint8Array; - (signatures: WeierstrassPoint[]): WeierstrassPoint; - }; - G1: CurvePointsRes & H2CHasher; - G2: CurvePointsRes & H2CHasher; - /** @deprecated use `longSignatures.Signature` */ - Signature: SignatureCoder; - /** @deprecated use `shortSignatures.Signature` */ - ShortSignature: ShortSignatureCoder; - params: { - ateLoopSize: bigint; - r: bigint; - twistType: TwistType; - /** @deprecated */ - G1b: bigint; - /** @deprecated */ - G2b: Fp2; - }; -}; -type BLSInput = Hex | Uint8Array; -export interface BLSSigs { - getPublicKey(secretKey: PrivKey): WeierstrassPoint

; - sign(hashedMessage: WeierstrassPoint, secretKey: PrivKey): WeierstrassPoint; - verify(signature: WeierstrassPoint | BLSInput, message: WeierstrassPoint, publicKey: WeierstrassPoint

| BLSInput): boolean; - verifyBatch: (signature: WeierstrassPoint | BLSInput, messages: WeierstrassPoint[], publicKeys: (WeierstrassPoint

| BLSInput)[]) => boolean; - aggregatePublicKeys(publicKeys: (WeierstrassPoint

| BLSInput)[]): WeierstrassPoint

; - aggregateSignatures(signatures: (WeierstrassPoint | BLSInput)[]): WeierstrassPoint; - hash(message: Uint8Array, DST?: string | Uint8Array, hashOpts?: H2CHashOpts): WeierstrassPoint; - Signature: SignatureCoder; -} -export declare function bls(CURVE: CurveType): CurveFn; -export {}; -//# sourceMappingURL=bls.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/bls.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/abstract/bls.d.ts.map deleted file mode 100644 index 72828641..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/bls.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bls.d.ts","sourceRoot":"","sources":["../src/abstract/bls.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;IAeI;AACJ,sEAAsE;AACtE,OAAO,EAKL,KAAK,KAAK,EACV,KAAK,GAAG,EACR,KAAK,OAAO,EACb,MAAM,aAAa,CAAC;AAErB,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,OAAO,EAEZ,KAAK,YAAY,EACjB,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAoC,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACrE,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAC;AAE1B,KAAK,EAAE,GAAG,MAAM,CAAC;AAKjB,MAAM,MAAM,SAAS,GAAG,gBAAgB,GAAG,UAAU,CAAC;AAEtD,MAAM,MAAM,mBAAmB,CAAC,EAAE,IAAI;IACpC,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,gBAAgB,CAAC,EAAE,CAAC,CAAC;IACnD,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,gBAAgB,CAAC,EAAE,CAAC,CAAC;IACxC,OAAO,CAAC,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC;IACjD,KAAK,CAAC,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC;IAC3C,gCAAgC;IAChC,UAAU,CAAC,K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GAAG,QAAQ,CAAC,EAAE,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;IACzF,IAAI,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,UAAU,EAAE,QAAQ,CAAC,EAAE,WAAW,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAClG,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;CAC9B;AA6SD,wBAAgB,GAAG,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAiL7C"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/bls.js b/tools/mnemonic-test/node_modules/@noble/curves/abstract/bls.js deleted file mode 100644 index 3897c894..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/bls.js +++ /dev/null @@ -1,411 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.bls = bls; -/** - * BLS != BLS. - * The file implements BLS (Boneh-Lynn-Shacham) signatures. - * Used in both BLS (Barreto-Lynn-Scott) and BN (Barreto-Naehrig) - * families of pairing-friendly curves. - * Consists of two curves: G1 and G2: - * - G1 is a subgroup of (x, y) E(Fq) over y² = x³ + 4. - * - G2 is a subgroup of ((x₁, x₂+i), (y₁, y₂+i)) E(Fq²) over y² = x³ + 4(1 + i) where i is √-1 - * - Gt, created by bilinear (ate) pairing e(G1, G2), consists of p-th roots of unity in - * Fq^k where k is embedding degree. Only degree 12 is currently supported, 24 is not. - * Pairing is used to aggregate and verify signatures. - * There are two modes of operation: - * - Long signatures: X-byte keys + 2X-byte sigs (G1 keys + G2 sigs). - * - Short signatures: 2X-byte keys + X-byte sigs (G2 keys + G1 sigs). - * @module - **/ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const utils_ts_1 = require("../utils.js"); -const curve_ts_1 = require("./curve.js"); -const hash_to_curve_ts_1 = require("./hash-to-curve.js"); -const modular_ts_1 = require("./modular.js"); -const weierstrass_ts_1 = require("./weierstrass.js"); -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3); -// Not used with BLS12-381 (no sequential `11` in X). Useful for other curves. -function NAfDecomposition(a) { - const res = []; - // a>1 because of marker bit - for (; a > _1n; a >>= _1n) { - if ((a & _1n) === _0n) - res.unshift(0); - else if ((a & _3n) === _3n) { - res.unshift(-1); - a += _1n; - } - else - res.unshift(1); - } - return res; -} -function aNonEmpty(arr) { - if (!Array.isArray(arr) || arr.length === 0) - throw new Error('expected non-empty array'); -} -// This should be enough for bn254, no need to export full stuff? -function createBlsPairing(fields, G1, G2, params) { - const { Fp2, Fp12 } = fields; - const { twistType, ateLoopSize, xNegative, postPrecompute } = params; - // Applies sparse multiplication as line function - let lineFunction; - if (twistType === 'multiplicative') { - lineFunction = (c0, c1, c2, f, Px, Py) => Fp12.mul014(f, c0, Fp2.mul(c1, Px), Fp2.mul(c2, Py)); - } - else if (twistType === 'divisive') { - // NOTE: it should be [c0, c1, c2], but we use different order here to reduce complexity of - // precompute calculations. - lineFunction = (c0, c1, c2, f, Px, Py) => Fp12.mul034(f, Fp2.mul(c2, Py), Fp2.mul(c1, Px), c0); - } - else - throw new Error('bls: unknown twist type'); - const Fp2div2 = Fp2.div(Fp2.ONE, Fp2.mul(Fp2.ONE, _2n)); - function pointDouble(ell, Rx, Ry, Rz) { - const t0 = Fp2.sqr(Ry); // Ry² - const t1 = Fp2.sqr(Rz); // Rz² - const t2 = Fp2.mulByB(Fp2.mul(t1, _3n)); // 3 * T1 * B - const t3 = Fp2.mul(t2, _3n); // 3 * T2 - const t4 = Fp2.sub(Fp2.sub(Fp2.sqr(Fp2.add(Ry, Rz)), t1), t0); // (Ry + Rz)² - T1 - T0 - const c0 = Fp2.sub(t2, t0); // T2 - T0 (i) - const c1 = Fp2.mul(Fp2.sqr(Rx), _3n); // 3 * Rx² - const c2 = Fp2.neg(t4); // -T4 (-h) - ell.push([c0, c1, c2]); - Rx = Fp2.mul(Fp2.mul(Fp2.mul(Fp2.sub(t0, t3), Rx), Ry), Fp2div2); // ((T0 - T3) * Rx * Ry) / 2 - Ry = Fp2.sub(Fp2.sqr(Fp2.mul(Fp2.add(t0, t3), Fp2div2)), Fp2.mul(Fp2.sqr(t2), _3n)); // ((T0 + T3) / 2)² - 3 * T2² - Rz = Fp2.mul(t0, t4); // T0 * T4 - return { Rx, Ry, Rz }; - } - function pointAdd(ell, Rx, Ry, Rz, Qx, Qy) { - // Addition - const t0 = Fp2.sub(Ry, Fp2.mul(Qy, Rz)); // Ry - Qy * Rz - const t1 = Fp2.sub(Rx, Fp2.mul(Qx, Rz)); // Rx - Qx * Rz - const c0 = Fp2.sub(Fp2.mul(t0, Qx), Fp2.mul(t1, Qy)); // T0 * Qx - T1 * Qy == Ry * Qx - Rx * Qy - const c1 = Fp2.neg(t0); // -T0 == Qy * Rz - Ry - const c2 = t1; // == Rx - Qx * Rz - ell.push([c0, c1, c2]); - const t2 = Fp2.sqr(t1); // T1² - const t3 = Fp2.mul(t2, t1); // T2 * T1 - const t4 = Fp2.mul(t2, Rx); // T2 * Rx - const t5 = Fp2.add(Fp2.sub(t3, Fp2.mul(t4, _2n)), Fp2.mul(Fp2.sqr(t0), Rz)); // T3 - 2 * T4 + T0² * Rz - Rx = Fp2.mul(t1, t5); // T1 * T5 - Ry = Fp2.sub(Fp2.mul(Fp2.sub(t4, t5), t0), Fp2.mul(t3, Ry)); // (T4 - T5) * T0 - T3 * Ry - Rz = Fp2.mul(Rz, t3); // Rz * T3 - return { Rx, Ry, Rz }; - } - // Pre-compute coefficients for sparse multiplication - // Point addition and point double calculations is reused for coefficients - // pointAdd happens only if bit set, so wNAF is reasonable. Unfortunately we cannot combine - // add + double in windowed precomputes here, otherwise it would be single op (since X is static) - const ATE_NAF = NAfDecomposition(ateLoopSize); - const calcPairingPrecomputes = (0, utils_ts_1.memoized)((point) => { - const p = point; - const { x, y } = p.toAffine(); - // prettier-ignore - const Qx = x, Qy = y, negQy = Fp2.neg(y); - // prettier-ignore - let Rx = Qx, Ry = Qy, Rz = Fp2.ONE; - const ell = []; - for (const bit of ATE_NAF) { - const cur = []; - ({ Rx, Ry, Rz } = pointDouble(cur, Rx, Ry, Rz)); - if (bit) - ({ Rx, Ry, Rz } = pointAdd(cur, Rx, Ry, Rz, Qx, bit === -1 ? negQy : Qy)); - ell.push(cur); - } - if (postPrecompute) { - const last = ell[ell.length - 1]; - postPrecompute(Rx, Ry, Rz, Qx, Qy, pointAdd.bind(null, last)); - } - return ell; - }); - function millerLoopBatch(pairs, withFinalExponent = false) { - let f12 = Fp12.ONE; - if (pairs.length) { - const ellLen = pairs[0][0].length; - for (let i = 0; i < ellLen; i++) { - f12 = Fp12.sqr(f12); // This allows us to do sqr only one time for all pairings - // NOTE: we apply multiple pairings in parallel here - for (const [ell, Px, Py] of pairs) { - for (const [c0, c1, c2] of ell[i]) - f12 = lineFunction(c0, c1, c2, f12, Px, Py); - } - } - } - if (xNegative) - f12 = Fp12.conjugate(f12); - return withFinalExponent ? Fp12.finalExponentiate(f12) : f12; - } - // Calculates product of multiple pairings - // This up to x2 faster than just `map(({g1, g2})=>pairing({g1,g2}))` - function pairingBatch(pairs, withFinalExponent = true) { - const res = []; - // Cache precomputed toAffine for all points - (0, curve_ts_1.normalizeZ)(G1, pairs.map(({ g1 }) => g1)); - (0, curve_ts_1.normalizeZ)(G2, pairs.map(({ g2 }) => g2)); - for (const { g1, g2 } of pairs) { - if (g1.is0() || g2.is0()) - throw new Error('pairing is not available for ZERO point'); - // This uses toAffine inside - g1.assertValidity(); - g2.assertValidity(); - const Qa = g1.toAffine(); - res.push([calcPairingPrecomputes(g2), Qa.x, Qa.y]); - } - return millerLoopBatch(res, withFinalExponent); - } - // Calculates bilinear pairing - function pairing(Q, P, withFinalExponent = true) { - return pairingBatch([{ g1: Q, g2: P }], withFinalExponent); - } - return { - Fp12, // NOTE: we re-export Fp12 here because pairing results are Fp12! - millerLoopBatch, - pairing, - pairingBatch, - calcPairingPrecomputes, - }; -} -function createBlsSig(blsPairing, PubCurve, SigCurve, SignatureCoder, isSigG1) { - const { Fp12, pairingBatch } = blsPairing; - function normPub(point) { - return point instanceof PubCurve.Point ? point : PubCurve.Point.fromHex(point); - } - function normSig(point) { - return point instanceof SigCurve.Point ? point : SigCurve.Point.fromHex(point); - } - function amsg(m) { - if (!(m instanceof SigCurve.Point)) - throw new Error(`expected valid message hashed to ${!isSigG1 ? 'G2' : 'G1'} curve`); - return m; - } - // What matters here is what point pairing API accepts as G1 or G2, not actual size or names - const pair = !isSigG1 - ? (a, b) => ({ g1: a, g2: b }) - : (a, b) => ({ g1: b, g2: a }); - return { - // P = pk x G - getPublicKey(secretKey) { - // TODO: replace with - // const sec = PubCurve.Point.Fn.fromBytes(secretKey); - const sec = (0, weierstrass_ts_1._normFnElement)(PubCurve.Point.Fn, secretKey); - return PubCurve.Point.BASE.multiply(sec); - }, - // S = pk x H(m) - sign(message, secretKey, unusedArg) { - if (unusedArg != null) - throw new Error('sign() expects 2 arguments'); - // TODO: replace with - // PubCurve.Point.Fn.fromBytes(secretKey) - const sec = (0, weierstrass_ts_1._normFnElement)(PubCurve.Point.Fn, secretKey); - amsg(message).assertValidity(); - return message.multiply(sec); - }, - // Checks if pairing of public key & hash is equal to pairing of generator & signature. - // e(P, H(m)) == e(G, S) - // e(S, G) == e(H(m), P) - verify(signature, message, publicKey, unusedArg) { - if (unusedArg != null) - throw new Error('verify() expects 3 arguments'); - signature = normSig(signature); - publicKey = normPub(publicKey); - const P = publicKey.negate(); - const G = PubCurve.Point.BASE; - const Hm = amsg(message); - const S = signature; - // This code was changed in 1.9.x: - // Before it was G.negate() in G2, now it's always pubKey.negate - // e(P, -Q)===e(-P, Q)==e(P, Q)^-1. Negate can be done anywhere (as long it is done once per pair). - // We just moving sign, but since pairing is multiplicative, we doing X * X^-1 = 1 - const exp = pairingBatch([pair(P, Hm), pair(G, S)]); - return Fp12.eql(exp, Fp12.ONE); - }, - // https://ethresear.ch/t/fast-verification-of-multiple-bls-signatures/5407 - // e(G, S) = e(G, SUM(n)(Si)) = MUL(n)(e(G, Si)) - // TODO: maybe `{message: G2Hex, publicKey: G1Hex}[]` instead? - verifyBatch(signature, messages, publicKeys) { - aNonEmpty(messages); - if (publicKeys.length !== messages.length) - throw new Error('amount of public keys and messages should be equal'); - const sig = normSig(signature); - const nMessages = messages; - const nPublicKeys = publicKeys.map(normPub); - // NOTE: this works only for exact same object - const messagePubKeyMap = new Map(); - for (let i = 0; i < nPublicKeys.length; i++) { - const pub = nPublicKeys[i]; - const msg = nMessages[i]; - let keys = messagePubKeyMap.get(msg); - if (keys === undefined) { - keys = []; - messagePubKeyMap.set(msg, keys); - } - keys.push(pub); - } - const paired = []; - const G = PubCurve.Point.BASE; - try { - for (const [msg, keys] of messagePubKeyMap) { - const groupPublicKey = keys.reduce((acc, msg) => acc.add(msg)); - paired.push(pair(groupPublicKey, msg)); - } - paired.push(pair(G.negate(), sig)); - return Fp12.eql(pairingBatch(paired), Fp12.ONE); - } - catch { - return false; - } - }, - // Adds a bunch of public key points together. - // pk1 + pk2 + pk3 = pkA - aggregatePublicKeys(publicKeys) { - aNonEmpty(publicKeys); - publicKeys = publicKeys.map((pub) => normPub(pub)); - const agg = publicKeys.reduce((sum, p) => sum.add(p), PubCurve.Point.ZERO); - agg.assertValidity(); - return agg; - }, - // Adds a bunch of signature points together. - // pk1 + pk2 + pk3 = pkA - aggregateSignatures(signatures) { - aNonEmpty(signatures); - signatures = signatures.map((sig) => normSig(sig)); - const agg = signatures.reduce((sum, s) => sum.add(s), SigCurve.Point.ZERO); - agg.assertValidity(); - return agg; - }, - hash(messageBytes, DST) { - (0, utils_ts_1.abytes)(messageBytes); - const opts = DST ? { DST } : undefined; - return SigCurve.hashToCurve(messageBytes, opts); - }, - Signature: SignatureCoder, - }; -} -// G1_Point: ProjConstructor, G2_Point: ProjConstructor, -function bls(CURVE) { - // Fields are specific for curve, so for now we'll need to pass them with opts - const { Fp, Fr, Fp2, Fp6, Fp12 } = CURVE.fields; - // Point on G1 curve: (x, y) - const G1_ = (0, weierstrass_ts_1.weierstrassPoints)(CURVE.G1); - const G1 = Object.assign(G1_, (0, hash_to_curve_ts_1.createHasher)(G1_.Point, CURVE.G1.mapToCurve, { - ...CURVE.htfDefaults, - ...CURVE.G1.htfDefaults, - })); - // Point on G2 curve (complex numbers): (x₁, x₂+i), (y₁, y₂+i) - const G2_ = (0, weierstrass_ts_1.weierstrassPoints)(CURVE.G2); - const G2 = Object.assign(G2_, (0, hash_to_curve_ts_1.createHasher)(G2_.Point, CURVE.G2.mapToCurve, { - ...CURVE.htfDefaults, - ...CURVE.G2.htfDefaults, - })); - const pairingRes = createBlsPairing(CURVE.fields, G1.Point, G2.Point, { - ...CURVE.params, - postPrecompute: CURVE.postPrecompute, - }); - const { millerLoopBatch, pairing, pairingBatch, calcPairingPrecomputes } = pairingRes; - const longSignatures = createBlsSig(pairingRes, G1, G2, CURVE.G2.Signature, false); - const shortSignatures = createBlsSig(pairingRes, G2, G1, CURVE.G1.ShortSignature, true); - const rand = CURVE.randomBytes || utils_ts_1.randomBytes; - const randomSecretKey = () => { - const length = (0, modular_ts_1.getMinHashLength)(Fr.ORDER); - return (0, modular_ts_1.mapHashToField)(rand(length), Fr.ORDER); - }; - const utils = { - randomSecretKey, - randomPrivateKey: randomSecretKey, - calcPairingPrecomputes, - }; - const { ShortSignature } = CURVE.G1; - const { Signature } = CURVE.G2; - function normP1Hash(point, htfOpts) { - return point instanceof G1.Point - ? point - : shortSignatures.hash((0, utils_ts_1.ensureBytes)('point', point), htfOpts?.DST); - } - function normP2Hash(point, htfOpts) { - return point instanceof G2.Point - ? point - : longSignatures.hash((0, utils_ts_1.ensureBytes)('point', point), htfOpts?.DST); - } - function getPublicKey(privateKey) { - return longSignatures.getPublicKey(privateKey).toBytes(true); - } - function getPublicKeyForShortSignatures(privateKey) { - return shortSignatures.getPublicKey(privateKey).toBytes(true); - } - function sign(message, privateKey, htfOpts) { - const Hm = normP2Hash(message, htfOpts); - const S = longSignatures.sign(Hm, privateKey); - return message instanceof G2.Point ? S : Signature.toBytes(S); - } - function signShortSignature(message, privateKey, htfOpts) { - const Hm = normP1Hash(message, htfOpts); - const S = shortSignatures.sign(Hm, privateKey); - return message instanceof G1.Point ? S : ShortSignature.toBytes(S); - } - function verify(signature, message, publicKey, htfOpts) { - const Hm = normP2Hash(message, htfOpts); - return longSignatures.verify(signature, Hm, publicKey); - } - function verifyShortSignature(signature, message, publicKey, htfOpts) { - const Hm = normP1Hash(message, htfOpts); - return shortSignatures.verify(signature, Hm, publicKey); - } - function aggregatePublicKeys(publicKeys) { - const agg = longSignatures.aggregatePublicKeys(publicKeys); - return publicKeys[0] instanceof G1.Point ? agg : agg.toBytes(true); - } - function aggregateSignatures(signatures) { - const agg = longSignatures.aggregateSignatures(signatures); - return signatures[0] instanceof G2.Point ? agg : Signature.toBytes(agg); - } - function aggregateShortSignatures(signatures) { - const agg = shortSignatures.aggregateSignatures(signatures); - return signatures[0] instanceof G1.Point ? agg : ShortSignature.toBytes(agg); - } - function verifyBatch(signature, messages, publicKeys, htfOpts) { - const Hm = messages.map((m) => normP2Hash(m, htfOpts)); - return longSignatures.verifyBatch(signature, Hm, publicKeys); - } - G1.Point.BASE.precompute(4); - return { - longSignatures, - shortSignatures, - millerLoopBatch, - pairing, - pairingBatch, - verifyBatch, - fields: { - Fr, - Fp, - Fp2, - Fp6, - Fp12, - }, - params: { - ateLoopSize: CURVE.params.ateLoopSize, - twistType: CURVE.params.twistType, - // deprecated - r: CURVE.params.r, - G1b: CURVE.G1.b, - G2b: CURVE.G2.b, - }, - utils, - // deprecated - getPublicKey, - getPublicKeyForShortSignatures, - sign, - signShortSignature, - verify, - verifyShortSignature, - aggregatePublicKeys, - aggregateSignatures, - aggregateShortSignatures, - G1, - G2, - Signature, - ShortSignature, - }; -} -//# sourceMappingURL=bls.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/bls.js.map b/tools/mnemonic-test/node_modules/@noble/curves/abstract/bls.js.map deleted file mode 100644 index 7a62e8a7..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/bls.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bls.js","sourceRoot":"","sources":["../src/abstract/bls.ts"],"names":[],"mappings":";;AAyjBA,kBAiLC;AA1uBD;;;;;;;;;;;;;;;IAeI;AACJ,sEAAsE;AACtE,0CAQqB;AACrB,yCAAwC;AACxC,yDAQ4B;AAC5B,6CAA6E;AAE7E,qDAO0B;AAI1B,kBAAkB;AAClB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AA4NzE,8EAA8E;AAC9E,SAAS,gBAAgB,CAAC,CAAS;IACjC,MAAM,GAAG,GAAG,EAAE,CAAC;IACf,4BAA4B;IAC5B,OAAO,CAAC,GAAG,GAAG,EAAE,CAAC,KAAK,GAAG,EAAE,CAAC;QAC1B,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,KAAK,GAAG;YAAE,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;aACjC,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,KAAK,GAAG,EAAE,CAAC;YAC3B,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;YAChB,CAAC,IAAI,GAAG,CAAC;QACX,CAAC;;YAAM,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACxB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,SAAS,CAAC,GAAU;IAC3B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CA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AAW;QACX,MAAM,EAAE;YACN,EAAE;YACF,EAAE;YACF,GAAG;YACH,GAAG;YACH,IAAI;SACL;QACD,MAAM,EAAE;YACN,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,WAAW;YACrC,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS;YACjC,aAAa;YACb,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;YACjB,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;YACf,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;SAChB;QACD,KAAK;QAEL,aAAa;QACb,YAAY;QACZ,8BAA8B;QAC9B,IAAI;QACJ,kBAAkB;QAClB,MAAM;QACN,oBAAoB;QACpB,mBAAmB;QACnB,mBAAmB;QACnB,wBAAwB;QACxB,EAAE;QACF,EAAE;QACF,SAAS;QACT,cAAc;KACf,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/curve.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/abstract/curve.d.ts deleted file mode 100644 index b6029fbc..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/curve.d.ts +++ /dev/null @@ -1,231 +0,0 @@ -import { type IField } from './modular.ts'; -export type AffinePoint = { - x: T; - y: T; -} & { - Z?: never; -}; -export interface Group> { - double(): T; - negate(): T; - add(other: T): T; - subtract(other: T): T; - equals(other: T): boolean; - multiply(scalar: bigint): T; - toAffine?(invertedZ?: any): AffinePoint; -} -/** Base interface for all elliptic curve Points. */ -export interface CurvePoint> extends Group

{ - /** Affine x coordinate. Different from projective / extended X coordinate. */ - x: F; - /** Affine y coordinate. Different from projective / extended Y coordinate. */ - y: F; - Z?: F; - double(): P; - negate(): P; - add(other: P): P; - subtract(other: P): P; - equals(other: P): boolean; - multiply(scalar: bigint): P; - assertValidity(): void; - clearCofactor(): P; - is0(): boolean; - isTorsionFree(): boolean; - isSmallOrder(): boolean; - multiplyUnsafe(scalar: bigint): P; - /** - * Massively speeds up `p.multiply(n)` by using precompute tables (caching). See {@link wNAF}. - * @param isLazy calculate cache now. Default (true) ensures it's deferred to first `multiply()` - */ - precompute(windowSize?: number, isLazy?: boolean): P; - /** Converts point to 2D xy affine coordinates */ - toAffine(invertedZ?: F): AffinePoint; - toBytes(): Uint8Array; - toHex(): string; -} -/** Base interface for all elliptic curve Point constructors. */ -export interface CurvePointCons

> { - [Symbol.hasInstance]: (item: unknown) => boolean; - BASE: P; - ZERO: P; - /** Field for basic curve math */ - Fp: IField>; - /** Scalar field, for scalars in multiply and others */ - Fn: IField; - /** Creates point from x, y. Does NOT validate if the point is valid. Use `.assertValidity()`. */ - fromAffine(p: AffinePoint>): P; - fromBytes(bytes: Uint8Array): P; - fromHex(hex: Uint8Array | string): P; -} -/** Returns Fp type from Point (P_F

== P.F) */ -export type P_F

> = P extends CurvePoint ? F : never; -/** Returns Fp type from PointCons (PC_F == PC.P.F) */ -export type PC_F>> = PC['Fp']['ZERO']; -/** Returns Point type from PointCons (PC_P == PC.P) */ -export type PC_P>> = PC['ZERO']; -export type PC_ANY = CurvePointCons>>>>>>>>>>; -export interface CurveLengths { - secretKey?: number; - publicKey?: number; - publicKeyUncompressed?: number; - publicKeyHasPrefix?: boolean; - signature?: number; - seed?: number; -} -export type GroupConstructor = { - BASE: T; - ZERO: T; -}; -/** @deprecated */ -export type ExtendedGroupConstructor = GroupConstructor & { - Fp: IField; - Fn: IField; - fromAffine(ap: AffinePoint): T; -}; -export type Mapper = (i: T[]) => T[]; -export declare function negateCt T; -}>(condition: boolean, item: T): T; -/** - * Takes a bunch of Projective Points but executes only one - * inversion on all of them. Inversion is very slow operation, - * so this improves performance massively. - * Optimization: converts a list of projective points to a list of identical points with Z=1. - */ -export declare function normalizeZ

, PC extends CurvePointCons

>(c: PC, points: P[]): P[]; -/** Internal wNAF opts for specific W and scalarBits */ -export type WOpts = { - windows: number; - windowSize: number; - mask: bigint; - maxNumber: number; - shiftBy: bigint; -}; -/** - * Elliptic curve multiplication of Point by scalar. Fragile. - * Table generation takes **30MB of ram and 10ms on high-end CPU**, - * but may take much longer on slow devices. Actual generation will happen on - * first call of `multiply()`. By default, `BASE` point is precomputed. - * - * Scalars should always be less than curve order: this should be checked inside of a curve itself. - * Creates precomputation tables for fast multiplication: - * - private scalar is split by fixed size windows of W bits - * - every window point is collected from window's table & added to accumulator - * - since windows are different, same point inside tables won't be accessed more than once per calc - * - each multiplication is 'Math.ceil(CURVE_ORDER / 𝑊) + 1' point additions (fixed for any scalar) - * - +1 window is neccessary for wNAF - * - wNAF reduces table size: 2x less memory + 2x faster generation, but 10% slower multiplication - * - * @todo Research returning 2d JS array of windows, instead of a single window. - * This would allow windows to be in different memory locations - */ -export declare class wNAF { - private readonly BASE; - private readonly ZERO; - private readonly Fn; - readonly bits: number; - constructor(Point: PC, bits: number); - _unsafeLadder(elm: PC_P, n: bigint, p?: PC_P): PC_P; - /** - * Creates a wNAF precomputation window. Used for caching. - * Default window size is set by `utils.precompute()` and is equal to 8. - * Number of precomputed points depends on the curve size: - * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where: - * - 𝑊 is the window size - * - 𝑛 is the bitlength of the curve order. - * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224. - * @param point Point instance - * @param W window size - * @returns precomputed point tables flattened to a single array - */ - private precomputeWindow; - /** - * Implements ec multiplication using precomputed tables and w-ary non-adjacent form. - * More compact implementation: - * https://github.com/paulmillr/noble-secp256k1/blob/47cb1669b6e506ad66b35fe7d76132ae97465da2/index.ts#L502-L541 - * @returns real and fake (for const-time) points - */ - private wNAF; - /** - * Implements ec unsafe (non const-time) multiplication using precomputed tables and w-ary non-adjacent form. - * @param acc accumulator point to add result of multiplication - * @returns point - */ - private wNAFUnsafe; - private getPrecomputes; - cached(point: PC_P, scalar: bigint, transform?: Mapper>): { - p: PC_P; - f: PC_P; - }; - unsafe(point: PC_P, scalar: bigint, transform?: Mapper>, prev?: PC_P): PC_P; - createCache(P: PC_P, W: number): void; - hasCache(elm: PC_P): boolean; -} -/** - * Endomorphism-specific multiplication for Koblitz curves. - * Cost: 128 dbl, 0-256 adds. - */ -export declare function mulEndoUnsafe

, PC extends CurvePointCons

>(Point: PC, point: P, k1: bigint, k2: bigint): { - p1: P; - p2: P; -}; -/** - * Pippenger algorithm for multi-scalar multiplication (MSM, Pa + Qb + Rc + ...). - * 30x faster vs naive addition on L=4096, 10x faster than precomputes. - * For N=254bit, L=1, it does: 1024 ADD + 254 DBL. For L=5: 1536 ADD + 254 DBL. - * Algorithmically constant-time (for same L), even when 1 point + scalar, or when scalar = 0. - * @param c Curve Point constructor - * @param fieldN field over CURVE.N - important that it's not over CURVE.P - * @param points array of L curve points - * @param scalars array of L scalars (aka secret keys / bigints) - */ -export declare function pippenger

, PC extends CurvePointCons

>(c: PC, fieldN: IField, points: P[], scalars: bigint[]): P; -/** - * Precomputed multi-scalar multiplication (MSM, Pa + Qb + Rc + ...). - * @param c Curve Point constructor - * @param fieldN field over CURVE.N - important that it's not over CURVE.P - * @param points array of L curve points - * @returns function which multiplies points with scaars - */ -export declare function precomputeMSMUnsafe

, PC extends CurvePointCons

>(c: PC, fieldN: IField, points: P[], windowSize: number): (scalars: bigint[]) => P; -/** - * Generic BasicCurve interface: works even for polynomial fields (BLS): P, n, h would be ok. - * Though generator can be different (Fp2 / Fp6 for BLS). - */ -export type BasicCurve = { - Fp: IField; - n: bigint; - nBitLength?: number; - nByteLength?: number; - h: bigint; - hEff?: bigint; - Gx: T; - Gy: T; - allowInfinityPoint?: boolean; -}; -/** @deprecated */ -export declare function validateBasic(curve: BasicCurve & T): Readonly<{ - readonly nBitLength: number; - readonly nByteLength: number; -} & BasicCurve & T & { - p: bigint; -}>; -export type ValidCurveParams = { - p: bigint; - n: bigint; - h: bigint; - a: T; - b?: T; - d?: T; - Gx: T; - Gy: T; -}; -export type FpFn = { - Fp: IField; - Fn: IField; -}; -/** Validates CURVE opts and creates fields */ -export declare function _createCurveFields(type: 'weierstrass' | 'edwards', CURVE: ValidCurveParams, curveOpts?: Partial>, FpFnLE?: boolean): FpFn & { - CURVE: ValidCurveParams; -}; -//# sourceMappingURL=curve.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/curve.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/abstract/curve.d.ts.map deleted file mode 100644 index 940fba30..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/curve.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"curve.d.ts","sourceRoot":"","sources":["../src/abstract/curve.ts"],"names":[],"mappings":"AAOA,OAAO,EAAgD,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAKzF,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;IAC3B,CAAC,EAAE,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,CAAC;CACN,GAAG;IAAE,CAAC,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAIlB,MAAM,WAAW,KAAK,CAAC,CAAC,SAAS,KAAK,CAAC,CAAC,CAAC;IACvC,MAAM,IAAI,CAAC,CAAC;IACZ,MAAM,IAAI,CAAC,CAAC;IACZ,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC;IACjB,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC;IACtB,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,CAAC;IAC5B,QAAQ,CAAC,CAAC,SAAS,CAAC,EAAE,GAAG,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;CAC9C;AAUD,oDAAoD;AACpD,MAAM,WAAW,UAAU,CAAC,CAAC,EAAE,CAAC,SAAS,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAE,SAAQ,KAAK,CAAC,CAAC,CAAC;IACzE,8EAA8E;IAC9E,CAAC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E,EAAE,CAAC,EACjC,KAAK,EAAE,UAAU,CAAC,EAAE,CAAC,GAAG,CAAC,GACxB,QAAQ,CACT;IACE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B,GAAG,UAAU,CAAC,EAAE,CAAC,GAChB,CAAC,GAAG;IACF,CAAC,EAAE,MAAM,CAAC;CACX,CACJ,CAqBA;AAED,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI;IAChC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,CAAC,CAAC;IACL,CAAC,CAAC,EAAE,CAAC,CAAC;IACN,CAAC,CAAC,EAAE,CAAC,CAAC;IACN,EAAE,EAAE,CAAC,CAAC;IACN,EAAE,EAAE,CAAC,CAAC;CACP,CAAC;AAWF,MAAM,MAAM,IAAI,CAAC,CAAC,IAAI;IAAE,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC;AAE5D,8CAA8C;AAC9C,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,IAAI,EAAE,aAAa,GAAG,SAAS,EAC/B,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAC1B,SAAS,GAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAM,EAChC,MAAM,CAAC,EAAE,OAAO,GACf,IAAI,CAAC,CAAC,CAAC,GAAG;IAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAA;CAAE,CAmB1C"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/curve.js b/tools/mnemonic-test/node_modules/@noble/curves/abstract/curve.js deleted file mode 100644 index 1a75714f..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/curve.js +++ /dev/null @@ -1,476 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.wNAF = void 0; -exports.negateCt = negateCt; -exports.normalizeZ = normalizeZ; -exports.mulEndoUnsafe = mulEndoUnsafe; -exports.pippenger = pippenger; -exports.precomputeMSMUnsafe = precomputeMSMUnsafe; -exports.validateBasic = validateBasic; -exports._createCurveFields = _createCurveFields; -/** - * Methods for elliptic curve multiplication by scalars. - * Contains wNAF, pippenger. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const utils_ts_1 = require("../utils.js"); -const modular_ts_1 = require("./modular.js"); -const _0n = BigInt(0); -const _1n = BigInt(1); -function negateCt(condition, item) { - const neg = item.negate(); - return condition ? neg : item; -} -/** - * Takes a bunch of Projective Points but executes only one - * inversion on all of them. Inversion is very slow operation, - * so this improves performance massively. - * Optimization: converts a list of projective points to a list of identical points with Z=1. - */ -function normalizeZ(c, points) { - const invertedZs = (0, modular_ts_1.FpInvertBatch)(c.Fp, points.map((p) => p.Z)); - return points.map((p, i) => c.fromAffine(p.toAffine(invertedZs[i]))); -} -function validateW(W, bits) { - if (!Number.isSafeInteger(W) || W <= 0 || W > bits) - throw new Error('invalid window size, expected [1..' + bits + '], got W=' + W); -} -function calcWOpts(W, scalarBits) { - validateW(W, scalarBits); - const windows = Math.ceil(scalarBits / W) + 1; // W=8 33. Not 32, because we skip zero - const windowSize = 2 ** (W - 1); // W=8 128. Not 256, because we skip zero - const maxNumber = 2 ** W; // W=8 256 - const mask = (0, utils_ts_1.bitMask)(W); // W=8 255 == mask 0b11111111 - const shiftBy = BigInt(W); // W=8 8 - return { windows, windowSize, mask, maxNumber, shiftBy }; -} -function calcOffsets(n, window, wOpts) { - const { windowSize, mask, maxNumber, shiftBy } = wOpts; - let wbits = Number(n & mask); // extract W bits. - let nextN = n >> shiftBy; // shift number by W bits. - // What actually happens here: - // const highestBit = Number(mask ^ (mask >> 1n)); - // let wbits2 = wbits - 1; // skip zero - // if (wbits2 & highestBit) { wbits2 ^= Number(mask); // (~); - // split if bits > max: +224 => 256-32 - if (wbits > windowSize) { - // we skip zero, which means instead of `>= size-1`, we do `> size` - wbits -= maxNumber; // -32, can be maxNumber - wbits, but then we need to set isNeg here. - nextN += _1n; // +256 (carry) - } - const offsetStart = window * windowSize; - const offset = offsetStart + Math.abs(wbits) - 1; // -1 because we skip zero - const isZero = wbits === 0; // is current window slice a 0? - const isNeg = wbits < 0; // is current window slice negative? - const isNegF = window % 2 !== 0; // fake random statement for noise - const offsetF = offsetStart; // fake offset for noise - return { nextN, offset, isZero, isNeg, isNegF, offsetF }; -} -function validateMSMPoints(points, c) { - if (!Array.isArray(points)) - throw new Error('array expected'); - points.forEach((p, i) => { - if (!(p instanceof c)) - throw new Error('invalid point at index ' + i); - }); -} -function validateMSMScalars(scalars, field) { - if (!Array.isArray(scalars)) - throw new Error('array of scalars expected'); - scalars.forEach((s, i) => { - if (!field.isValid(s)) - throw new Error('invalid scalar at index ' + i); - }); -} -// Since points in different groups cannot be equal (different object constructor), -// we can have single place to store precomputes. -// Allows to make points frozen / immutable. -const pointPrecomputes = new WeakMap(); -const pointWindowSizes = new WeakMap(); -function getW(P) { - // To disable precomputes: - // return 1; - return pointWindowSizes.get(P) || 1; -} -function assert0(n) { - if (n !== _0n) - throw new Error('invalid wNAF'); -} -/** - * Elliptic curve multiplication of Point by scalar. Fragile. - * Table generation takes **30MB of ram and 10ms on high-end CPU**, - * but may take much longer on slow devices. Actual generation will happen on - * first call of `multiply()`. By default, `BASE` point is precomputed. - * - * Scalars should always be less than curve order: this should be checked inside of a curve itself. - * Creates precomputation tables for fast multiplication: - * - private scalar is split by fixed size windows of W bits - * - every window point is collected from window's table & added to accumulator - * - since windows are different, same point inside tables won't be accessed more than once per calc - * - each multiplication is 'Math.ceil(CURVE_ORDER / 𝑊) + 1' point additions (fixed for any scalar) - * - +1 window is neccessary for wNAF - * - wNAF reduces table size: 2x less memory + 2x faster generation, but 10% slower multiplication - * - * @todo Research returning 2d JS array of windows, instead of a single window. - * This would allow windows to be in different memory locations - */ -class wNAF { - // Parametrized with a given Point class (not individual point) - constructor(Point, bits) { - this.BASE = Point.BASE; - this.ZERO = Point.ZERO; - this.Fn = Point.Fn; - this.bits = bits; - } - // non-const time multiplication ladder - _unsafeLadder(elm, n, p = this.ZERO) { - let d = elm; - while (n > _0n) { - if (n & _1n) - p = p.add(d); - d = d.double(); - n >>= _1n; - } - return p; - } - /** - * Creates a wNAF precomputation window. Used for caching. - * Default window size is set by `utils.precompute()` and is equal to 8. - * Number of precomputed points depends on the curve size: - * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where: - * - 𝑊 is the window size - * - 𝑛 is the bitlength of the curve order. - * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224. - * @param point Point instance - * @param W window size - * @returns precomputed point tables flattened to a single array - */ - precomputeWindow(point, W) { - const { windows, windowSize } = calcWOpts(W, this.bits); - const points = []; - let p = point; - let base = p; - for (let window = 0; window < windows; window++) { - base = p; - points.push(base); - // i=1, bc we skip 0 - for (let i = 1; i < windowSize; i++) { - base = base.add(p); - points.push(base); - } - p = base.double(); - } - return points; - } - /** - * Implements ec multiplication using precomputed tables and w-ary non-adjacent form. - * More compact implementation: - * https://github.com/paulmillr/noble-secp256k1/blob/47cb1669b6e506ad66b35fe7d76132ae97465da2/index.ts#L502-L541 - * @returns real and fake (for const-time) points - */ - wNAF(W, precomputes, n) { - // Scalar should be smaller than field order - if (!this.Fn.isValid(n)) - throw new Error('invalid scalar'); - // Accumulators - let p = this.ZERO; - let f = this.BASE; - // This code was first written with assumption that 'f' and 'p' will never be infinity point: - // since each addition is multiplied by 2 ** W, it cannot cancel each other. However, - // there is negate now: it is possible that negated element from low value - // would be the same as high element, which will create carry into next window. - // It's not obvious how this can fail, but still worth investigating later. - const wo = calcWOpts(W, this.bits); - for (let window = 0; window < wo.windows; window++) { - // (n === _0n) is handled and not early-exited. isEven and offsetF are used for noise - const { nextN, offset, isZero, isNeg, isNegF, offsetF } = calcOffsets(n, window, wo); - n = nextN; - if (isZero) { - // bits are 0: add garbage to fake point - // Important part for const-time getPublicKey: add random "noise" point to f. - f = f.add(negateCt(isNegF, precomputes[offsetF])); - } - else { - // bits are 1: add to result point - p = p.add(negateCt(isNeg, precomputes[offset])); - } - } - assert0(n); - // Return both real and fake points: JIT won't eliminate f. - // At this point there is a way to F be infinity-point even if p is not, - // which makes it less const-time: around 1 bigint multiply. - return { p, f }; - } - /** - * Implements ec unsafe (non const-time) multiplication using precomputed tables and w-ary non-adjacent form. - * @param acc accumulator point to add result of multiplication - * @returns point - */ - wNAFUnsafe(W, precomputes, n, acc = this.ZERO) { - const wo = calcWOpts(W, this.bits); - for (let window = 0; window < wo.windows; window++) { - if (n === _0n) - break; // Early-exit, skip 0 value - const { nextN, offset, isZero, isNeg } = calcOffsets(n, window, wo); - n = nextN; - if (isZero) { - // Window bits are 0: skip processing. - // Move to next window. - continue; - } - else { - const item = precomputes[offset]; - acc = acc.add(isNeg ? item.negate() : item); // Re-using acc allows to save adds in MSM - } - } - assert0(n); - return acc; - } - getPrecomputes(W, point, transform) { - // Calculate precomputes on a first run, reuse them after - let comp = pointPrecomputes.get(point); - if (!comp) { - comp = this.precomputeWindow(point, W); - if (W !== 1) { - // Doing transform outside of if brings 15% perf hit - if (typeof transform === 'function') - comp = transform(comp); - pointPrecomputes.set(point, comp); - } - } - return comp; - } - cached(point, scalar, transform) { - const W = getW(point); - return this.wNAF(W, this.getPrecomputes(W, point, transform), scalar); - } - unsafe(point, scalar, transform, prev) { - const W = getW(point); - if (W === 1) - return this._unsafeLadder(point, scalar, prev); // For W=1 ladder is ~x2 faster - return this.wNAFUnsafe(W, this.getPrecomputes(W, point, transform), scalar, prev); - } - // We calculate precomputes for elliptic curve point multiplication - // using windowed method. This specifies window size and - // stores precomputed values. Usually only base point would be precomputed. - createCache(P, W) { - validateW(W, this.bits); - pointWindowSizes.set(P, W); - pointPrecomputes.delete(P); - } - hasCache(elm) { - return getW(elm) !== 1; - } -} -exports.wNAF = wNAF; -/** - * Endomorphism-specific multiplication for Koblitz curves. - * Cost: 128 dbl, 0-256 adds. - */ -function mulEndoUnsafe(Point, point, k1, k2) { - let acc = point; - let p1 = Point.ZERO; - let p2 = Point.ZERO; - while (k1 > _0n || k2 > _0n) { - if (k1 & _1n) - p1 = p1.add(acc); - if (k2 & _1n) - p2 = p2.add(acc); - acc = acc.double(); - k1 >>= _1n; - k2 >>= _1n; - } - return { p1, p2 }; -} -/** - * Pippenger algorithm for multi-scalar multiplication (MSM, Pa + Qb + Rc + ...). - * 30x faster vs naive addition on L=4096, 10x faster than precomputes. - * For N=254bit, L=1, it does: 1024 ADD + 254 DBL. For L=5: 1536 ADD + 254 DBL. - * Algorithmically constant-time (for same L), even when 1 point + scalar, or when scalar = 0. - * @param c Curve Point constructor - * @param fieldN field over CURVE.N - important that it's not over CURVE.P - * @param points array of L curve points - * @param scalars array of L scalars (aka secret keys / bigints) - */ -function pippenger(c, fieldN, points, scalars) { - // If we split scalars by some window (let's say 8 bits), every chunk will only - // take 256 buckets even if there are 4096 scalars, also re-uses double. - // TODO: - // - https://eprint.iacr.org/2024/750.pdf - // - https://tches.iacr.org/index.php/TCHES/article/view/10287 - // 0 is accepted in scalars - validateMSMPoints(points, c); - validateMSMScalars(scalars, fieldN); - const plength = points.length; - const slength = scalars.length; - if (plength !== slength) - throw new Error('arrays of points and scalars must have equal length'); - // if (plength === 0) throw new Error('array must be of length >= 2'); - const zero = c.ZERO; - const wbits = (0, utils_ts_1.bitLen)(BigInt(plength)); - let windowSize = 1; // bits - if (wbits > 12) - windowSize = wbits - 3; - else if (wbits > 4) - windowSize = wbits - 2; - else if (wbits > 0) - windowSize = 2; - const MASK = (0, utils_ts_1.bitMask)(windowSize); - const buckets = new Array(Number(MASK) + 1).fill(zero); // +1 for zero array - const lastBits = Math.floor((fieldN.BITS - 1) / windowSize) * windowSize; - let sum = zero; - for (let i = lastBits; i >= 0; i -= windowSize) { - buckets.fill(zero); - for (let j = 0; j < slength; j++) { - const scalar = scalars[j]; - const wbits = Number((scalar >> BigInt(i)) & MASK); - buckets[wbits] = buckets[wbits].add(points[j]); - } - let resI = zero; // not using this will do small speed-up, but will lose ct - // Skip first bucket, because it is zero - for (let j = buckets.length - 1, sumI = zero; j > 0; j--) { - sumI = sumI.add(buckets[j]); - resI = resI.add(sumI); - } - sum = sum.add(resI); - if (i !== 0) - for (let j = 0; j < windowSize; j++) - sum = sum.double(); - } - return sum; -} -/** - * Precomputed multi-scalar multiplication (MSM, Pa + Qb + Rc + ...). - * @param c Curve Point constructor - * @param fieldN field over CURVE.N - important that it's not over CURVE.P - * @param points array of L curve points - * @returns function which multiplies points with scaars - */ -function precomputeMSMUnsafe(c, fieldN, points, windowSize) { - /** - * Performance Analysis of Window-based Precomputation - * - * Base Case (256-bit scalar, 8-bit window): - * - Standard precomputation requires: - * - 31 additions per scalar × 256 scalars = 7,936 ops - * - Plus 255 summary additions = 8,191 total ops - * Note: Summary additions can be optimized via accumulator - * - * Chunked Precomputation Analysis: - * - Using 32 chunks requires: - * - 255 additions per chunk - * - 256 doublings - * - Total: (255 × 32) + 256 = 8,416 ops - * - * Memory Usage Comparison: - * Window Size | Standard Points | Chunked Points - * ------------|-----------------|--------------- - * 4-bit | 520 | 15 - * 8-bit | 4,224 | 255 - * 10-bit | 13,824 | 1,023 - * 16-bit | 557,056 | 65,535 - * - * Key Advantages: - * 1. Enables larger window sizes due to reduced memory overhead - * 2. More efficient for smaller scalar counts: - * - 16 chunks: (16 × 255) + 256 = 4,336 ops - * - ~2x faster than standard 8,191 ops - * - * Limitations: - * - Not suitable for plain precomputes (requires 256 constant doublings) - * - Performance degrades with larger scalar counts: - * - Optimal for ~256 scalars - * - Less efficient for 4096+ scalars (Pippenger preferred) - */ - validateW(windowSize, fieldN.BITS); - validateMSMPoints(points, c); - const zero = c.ZERO; - const tableSize = 2 ** windowSize - 1; // table size (without zero) - const chunks = Math.ceil(fieldN.BITS / windowSize); // chunks of item - const MASK = (0, utils_ts_1.bitMask)(windowSize); - const tables = points.map((p) => { - const res = []; - for (let i = 0, acc = p; i < tableSize; i++) { - res.push(acc); - acc = acc.add(p); - } - return res; - }); - return (scalars) => { - validateMSMScalars(scalars, fieldN); - if (scalars.length > points.length) - throw new Error('array of scalars must be smaller than array of points'); - let res = zero; - for (let i = 0; i < chunks; i++) { - // No need to double if accumulator is still zero. - if (res !== zero) - for (let j = 0; j < windowSize; j++) - res = res.double(); - const shiftBy = BigInt(chunks * windowSize - (i + 1) * windowSize); - for (let j = 0; j < scalars.length; j++) { - const n = scalars[j]; - const curr = Number((n >> shiftBy) & MASK); - if (!curr) - continue; // skip zero scalars chunks - res = res.add(tables[j][curr - 1]); - } - } - return res; - }; -} -// TODO: remove -/** @deprecated */ -function validateBasic(curve) { - (0, modular_ts_1.validateField)(curve.Fp); - (0, utils_ts_1.validateObject)(curve, { - n: 'bigint', - h: 'bigint', - Gx: 'field', - Gy: 'field', - }, { - nBitLength: 'isSafeInteger', - nByteLength: 'isSafeInteger', - }); - // Set defaults - return Object.freeze({ - ...(0, modular_ts_1.nLength)(curve.n, curve.nBitLength), - ...curve, - ...{ p: curve.Fp.ORDER }, - }); -} -function createField(order, field, isLE) { - if (field) { - if (field.ORDER !== order) - throw new Error('Field.ORDER must match order: Fp == p, Fn == n'); - (0, modular_ts_1.validateField)(field); - return field; - } - else { - return (0, modular_ts_1.Field)(order, { isLE }); - } -} -/** Validates CURVE opts and creates fields */ -function _createCurveFields(type, CURVE, curveOpts = {}, FpFnLE) { - if (FpFnLE === undefined) - FpFnLE = type === 'edwards'; - if (!CURVE || typeof CURVE !== 'object') - throw new Error(`expected valid ${type} CURVE object`); - for (const p of ['p', 'n', 'h']) { - const val = CURVE[p]; - if (!(typeof val === 'bigint' && val > _0n)) - throw new Error(`CURVE.${p} must be positive bigint`); - } - const Fp = createField(CURVE.p, curveOpts.Fp, FpFnLE); - const Fn = createField(CURVE.n, curveOpts.Fn, FpFnLE); - const _b = type === 'weierstrass' ? 'b' : 'd'; - const params = ['Gx', 'Gy', 'a', _b]; - for (const p of params) { - // @ts-ignore - if (!Fp.isValid(CURVE[p])) - throw new Error(`CURVE.${p} must be valid field element of CURVE.Fp`); - } - CURVE = Object.freeze(Object.assign({}, CURVE)); - return { CURVE, Fp, Fn }; -} -//# sourceMappingURL=curve.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/curve.js.map b/tools/mnemonic-test/node_modules/@noble/curves/abstract/curve.js.map deleted file mode 100644 index e13dbac8..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/curve.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"curve.js","sourceRoot":"","sources":["../src/abstract/curve.ts"],"names":[],"mappings":";;;AAoJA,4BAGC;AAQD,gCASC;AA2QD,sCAiBC;AAYD,8BA6CC;AAQD,kDAyEC;AAqBD,sCA+BC;AAyBD,gDAwBC;AAnrBD;;;;GAIG;AACH,sEAAsE;AACtE,0CAA8D;AAC9D,6CAAyF;AAEzF,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AA0ItB,SAAgB,QAAQ,CAAgC,SAAkB,EAAE,IAAO;IACjF,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;IAC1B,OAAO,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;AAChC,CAAC;AAED;;;;;GAKG;AACH,SAAgB,UAAU,CACxB,CAAK,EACL,MAAW;IAEX,MAAM,UAAU,GAAG,IAAA,0BAAa,EAC9B,CAAC,CAAC,EAAE,EACJ,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAE,CAAC,CACxB,CAAC;IACF,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE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AC,EAAE,EAAE,MAAM,CAAC,CAAC;IACtD,MAAM,EAAE,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IACtD,MAAM,EAAE,GAAc,IAAI,KAAK,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;IACzD,MAAM,MAAM,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,CAAU,CAAC;IAC9C,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;QACvB,aAAa;QACb,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,SAAS,CAAC,0CAA0C,CAAC,CAAC;IAC1E,CAAC;IACD,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;IAChD,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;AAC3B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/edwards.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/abstract/edwards.d.ts deleted file mode 100644 index ed651373..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/edwards.d.ts +++ /dev/null @@ -1,243 +0,0 @@ -/** - * Twisted Edwards curve. The formula is: ax² + y² = 1 + dx²y². - * For design rationale of types / exports, see weierstrass module documentation. - * Untwisted Edwards curves exist, but they aren't used in real-world protocols. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { type FHash, type Hex } from '../utils.ts'; -import { type AffinePoint, type BasicCurve, type CurveLengths, type CurvePoint, type CurvePointCons } from './curve.ts'; -import { type IField, type NLength } from './modular.ts'; -export type UVRatio = (u: bigint, v: bigint) => { - isValid: boolean; - value: bigint; -}; -/** Instance of Extended Point with coordinates in X, Y, Z, T. */ -export interface EdwardsPoint extends CurvePoint { - /** extended X coordinate. Different from affine x. */ - readonly X: bigint; - /** extended Y coordinate. Different from affine y. */ - readonly Y: bigint; - /** extended Z coordinate */ - readonly Z: bigint; - /** extended T coordinate */ - readonly T: bigint; - /** @deprecated use `toBytes` */ - toRawBytes(): Uint8Array; - /** @deprecated use `p.precompute(windowSize)` */ - _setWindowSize(windowSize: number): void; - /** @deprecated use .X */ - readonly ex: bigint; - /** @deprecated use .Y */ - readonly ey: bigint; - /** @deprecated use .Z */ - readonly ez: bigint; - /** @deprecated use .T */ - readonly et: bigint; -} -/** Static methods of Extended Point with coordinates in X, Y, Z, T. */ -export interface EdwardsPointCons extends CurvePointCons { - new (X: bigint, Y: bigint, Z: bigint, T: bigint): EdwardsPoint; - CURVE(): EdwardsOpts; - fromBytes(bytes: Uint8Array, zip215?: boolean): EdwardsPoint; - fromHex(hex: Hex, zip215?: boolean): EdwardsPoint; - /** @deprecated use `import { pippenger } from '@noble/curves/abstract/curve.js';` */ - msm(points: EdwardsPoint[], scalars: bigint[]): EdwardsPoint; -} -/** @deprecated use EdwardsPoint */ -export type ExtPointType = EdwardsPoint; -/** @deprecated use EdwardsPointCons */ -export type ExtPointConstructor = EdwardsPointCons; -/** - * Twisted Edwards curve options. - * - * * a: formula param - * * d: formula param - * * p: prime characteristic (order) of finite field, in which arithmetics is done - * * n: order of prime subgroup a.k.a total amount of valid curve points - * * h: cofactor. h*n is group order; n is subgroup order - * * Gx: x coordinate of generator point a.k.a. base point - * * Gy: y coordinate of generator point - */ -export type EdwardsOpts = Readonly<{ - p: bigint; - n: bigint; - h: bigint; - a: bigint; - d: bigint; - Gx: bigint; - Gy: bigint; -}>; -/** - * Extra curve options for Twisted Edwards. - * - * * Fp: redefined Field over curve.p - * * Fn: redefined Field over curve.n - * * uvRatio: helper function for decompression, calculating √(u/v) - */ -export type EdwardsExtraOpts = Partial<{ - Fp: IField; - Fn: IField; - FpFnLE: boolean; - uvRatio: (u: bigint, v: bigint) => { - isValid: boolean; - value: bigint; - }; -}>; -/** - * EdDSA (Edwards Digital Signature algorithm) options. - * - * * hash: hash function used to hash secret keys and messages - * * adjustScalarBytes: clears bits to get valid field element - * * domain: Used for hashing - * * mapToCurve: for hash-to-curve standard - * * prehash: RFC 8032 pre-hashing of messages to sign() / verify() - * * randomBytes: function generating random bytes, used for randomSecretKey - */ -export type EdDSAOpts = Partial<{ - adjustScalarBytes: (bytes: Uint8Array) => Uint8Array; - domain: (data: Uint8Array, ctx: Uint8Array, phflag: boolean) => Uint8Array; - mapToCurve: (scalar: bigint[]) => AffinePoint; - prehash: FHash; - randomBytes: (bytesLength?: number) => Uint8Array; -}>; -/** - * EdDSA (Edwards Digital Signature algorithm) interface. - * - * Allows to create and verify signatures, create public and secret keys. - */ -export interface EdDSA { - keygen: (seed?: Uint8Array) => { - secretKey: Uint8Array; - publicKey: Uint8Array; - }; - getPublicKey: (secretKey: Hex) => Uint8Array; - sign: (message: Hex, secretKey: Hex, options?: { - context?: Hex; - }) => Uint8Array; - verify: (sig: Hex, message: Hex, publicKey: Hex, options?: { - context?: Hex; - zip215: boolean; - }) => boolean; - Point: EdwardsPointCons; - utils: { - randomSecretKey: (seed?: Uint8Array) => Uint8Array; - isValidSecretKey: (secretKey: Uint8Array) => boolean; - isValidPublicKey: (publicKey: Uint8Array, zip215?: boolean) => boolean; - /** - * Converts ed public key to x public key. - * - * There is NO `fromMontgomery`: - * - There are 2 valid ed25519 points for every x25519, with flipped coordinate - * - Sometimes there are 0 valid ed25519 points, because x25519 *additionally* - * accepts inputs on the quadratic twist, which can't be moved to ed25519 - * - * @example - * ```js - * const someonesPub = ed25519.getPublicKey(ed25519.utils.randomSecretKey()); - * const aPriv = x25519.utils.randomSecretKey(); - * x25519.getSharedSecret(aPriv, ed25519.utils.toMontgomery(someonesPub)) - * ``` - */ - toMontgomery: (publicKey: Uint8Array) => Uint8Array; - /** - * Converts ed secret key to x secret key. - * @example - * ```js - * const someonesPub = x25519.getPublicKey(x25519.utils.randomSecretKey()); - * const aPriv = ed25519.utils.randomSecretKey(); - * x25519.getSharedSecret(ed25519.utils.toMontgomerySecret(aPriv), someonesPub) - * ``` - */ - toMontgomerySecret: (privateKey: Uint8Array) => Uint8Array; - getExtendedPublicKey: (key: Hex) => { - head: Uint8Array; - prefix: Uint8Array; - scalar: bigint; - point: EdwardsPoint; - pointBytes: Uint8Array; - }; - /** @deprecated use `randomSecretKey` */ - randomPrivateKey: (seed?: Uint8Array) => Uint8Array; - /** @deprecated use `point.precompute()` */ - precompute: (windowSize?: number, point?: EdwardsPoint) => EdwardsPoint; - }; - lengths: CurveLengths; -} -export declare function edwards(params: EdwardsOpts, extraOpts?: EdwardsExtraOpts): EdwardsPointCons; -/** - * Base class for prime-order points like Ristretto255 and Decaf448. - * These points eliminate cofactor issues by representing equivalence classes - * of Edwards curve points. - */ -export declare abstract class PrimeEdwardsPoint> implements CurvePoint { - static BASE: PrimeEdwardsPoint; - static ZERO: PrimeEdwardsPoint; - static Fp: IField; - static Fn: IField; - protected readonly ep: EdwardsPoint; - constructor(ep: EdwardsPoint); - abstract toBytes(): Uint8Array; - abstract equals(other: T): boolean; - static fromBytes(_bytes: Uint8Array): any; - static fromHex(_hex: Hex): any; - get x(): bigint; - get y(): bigint; - clearCofactor(): T; - assertValidity(): void; - toAffine(invertedZ?: bigint): AffinePoint; - toHex(): string; - toString(): string; - isTorsionFree(): boolean; - isSmallOrder(): boolean; - add(other: T): T; - subtract(other: T): T; - multiply(scalar: bigint): T; - multiplyUnsafe(scalar: bigint): T; - double(): T; - negate(): T; - precompute(windowSize?: number, isLazy?: boolean): T; - abstract is0(): boolean; - protected abstract assertSame(other: T): void; - protected abstract init(ep: EdwardsPoint): T; - /** @deprecated use `toBytes` */ - toRawBytes(): Uint8Array; -} -/** - * Initializes EdDSA signatures over given Edwards curve. - */ -export declare function eddsa(Point: EdwardsPointCons, cHash: FHash, eddsaOpts?: EdDSAOpts): EdDSA; -export type CurveType = BasicCurve & { - a: bigint; - d: bigint; - /** @deprecated the property will be removed in next release */ - hash: FHash; - randomBytes?: (bytesLength?: number) => Uint8Array; - adjustScalarBytes?: (bytes: Uint8Array) => Uint8Array; - domain?: (data: Uint8Array, ctx: Uint8Array, phflag: boolean) => Uint8Array; - uvRatio?: UVRatio; - prehash?: FHash; - mapToCurve?: (scalar: bigint[]) => AffinePoint; -}; -export type CurveTypeWithLength = Readonly>; -export type CurveFn = { - /** @deprecated the property will be removed in next release */ - CURVE: CurveType; - keygen: EdDSA['keygen']; - getPublicKey: EdDSA['getPublicKey']; - sign: EdDSA['sign']; - verify: EdDSA['verify']; - Point: EdwardsPointCons; - /** @deprecated use `Point` */ - ExtendedPoint: EdwardsPointCons; - utils: EdDSA['utils']; - lengths: CurveLengths; -}; -export type EdComposed = { - CURVE: EdwardsOpts; - curveOpts: EdwardsExtraOpts; - hash: FHash; - eddsaOpts: EdDSAOpts; -}; -export declare function twistedEdwards(c: CurveTypeWithLength): CurveFn; -//# sourceMappingURL=edwards.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/edwards.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/abstract/edwards.d.ts.map deleted file mode 100644 index f3471fb3..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/edwards.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"edwards.d.ts","sourceRoot":"","sources":["../src/abstract/edwards.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,sEAAsE;AACtE,OAAO,EAcL,KAAK,KAAK,EACV,KAAK,GAAG,EACT,MAAM,aAAa,CAAC;AACrB,OAAO,EAKL,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,cAAc,EACpB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAS,KAAK,MAAM,EAAE,KAAK,OAAO,EAAE,MAAM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,OAAO,KAAK,UAAU,CAAC;IAC5E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,KAAK,CAAC;IAChB,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,WAAW,CAAC,MAAM,CAAC,CAAC;CACxD,CAAC;AACF,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;AACzE,MAAM,MAAM,OAAO,GAAG;IACpB,+DAA+D;IAC/D,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IACxB,YAAY,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;IACpC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACpB,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IACxB,KAAK,EAAE,gBAAgB,CAAC;IACxB,8BAA8B;IAC9B,aAAa,EAAE,gBAAgB,CAAC;IAChC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IACtB,OAAO,EAAE,YAAY,CAAC;CACvB,CAAC;AACF,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,WAAW,CAAC;IACnB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,IAAI,EAAE,KAAK,CAAC;IACZ,SAAS,EAAE,SAAS,CAAC;CACtB,CAAC;AAkCF,wBAAgB,cAAc,CAAC,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAK9D"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/edwards.js b/tools/mnemonic-test/node_modules/@noble/curves/abstract/edwards.js deleted file mode 100644 index ca506901..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/edwards.js +++ /dev/null @@ -1,634 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.PrimeEdwardsPoint = void 0; -exports.edwards = edwards; -exports.eddsa = eddsa; -exports.twistedEdwards = twistedEdwards; -/** - * Twisted Edwards curve. The formula is: ax² + y² = 1 + dx²y². - * For design rationale of types / exports, see weierstrass module documentation. - * Untwisted Edwards curves exist, but they aren't used in real-world protocols. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const utils_ts_1 = require("../utils.js"); -const curve_ts_1 = require("./curve.js"); -const modular_ts_1 = require("./modular.js"); -// Be friendly to bad ECMAScript parsers by not using bigint literals -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _8n = BigInt(8); -function isEdValidXY(Fp, CURVE, x, y) { - const x2 = Fp.sqr(x); - const y2 = Fp.sqr(y); - const left = Fp.add(Fp.mul(CURVE.a, x2), y2); - const right = Fp.add(Fp.ONE, Fp.mul(CURVE.d, Fp.mul(x2, y2))); - return Fp.eql(left, right); -} -function edwards(params, extraOpts = {}) { - const validated = (0, curve_ts_1._createCurveFields)('edwards', params, extraOpts, extraOpts.FpFnLE); - const { Fp, Fn } = validated; - let CURVE = validated.CURVE; - const { h: cofactor } = CURVE; - (0, utils_ts_1._validateObject)(extraOpts, {}, { uvRatio: 'function' }); - // Important: - // There are some places where Fp.BYTES is used instead of nByteLength. - // So far, everything has been tested with curves of Fp.BYTES == nByteLength. - // TODO: test and find curves which behave otherwise. - const MASK = _2n << (BigInt(Fn.BYTES * 8) - _1n); - const modP = (n) => Fp.create(n); // Function overrides - // sqrt(u/v) - const uvRatio = extraOpts.uvRatio || - ((u, v) => { - try { - return { isValid: true, value: Fp.sqrt(Fp.div(u, v)) }; - } - catch (e) { - return { isValid: false, value: _0n }; - } - }); - // Validate whether the passed curve params are valid. - // equation ax² + y² = 1 + dx²y² should work for generator point. - if (!isEdValidXY(Fp, CURVE, CURVE.Gx, CURVE.Gy)) - throw new Error('bad curve params: generator point'); - /** - * Asserts coordinate is valid: 0 <= n < MASK. - * Coordinates >= Fp.ORDER are allowed for zip215. - */ - function acoord(title, n, banZero = false) { - const min = banZero ? _1n : _0n; - (0, utils_ts_1.aInRange)('coordinate ' + title, n, min, MASK); - return n; - } - function aextpoint(other) { - if (!(other instanceof Point)) - throw new Error('ExtendedPoint expected'); - } - // Converts Extended point to default (x, y) coordinates. - // Can accept precomputed Z^-1 - for example, from invertBatch. - const toAffineMemo = (0, utils_ts_1.memoized)((p, iz) => { - const { X, Y, Z } = p; - const is0 = p.is0(); - if (iz == null) - iz = is0 ? _8n : Fp.inv(Z); // 8 was chosen arbitrarily - const x = modP(X * iz); - const y = modP(Y * iz); - const zz = Fp.mul(Z, iz); - if (is0) - return { x: _0n, y: _1n }; - if (zz !== _1n) - throw new Error('invZ was invalid'); - return { x, y }; - }); - const assertValidMemo = (0, utils_ts_1.memoized)((p) => { - const { a, d } = CURVE; - if (p.is0()) - throw new Error('bad point: ZERO'); // TODO: optimize, with vars below? - // Equation in affine coordinates: ax² + y² = 1 + dx²y² - // Equation in projective coordinates (X/Z, Y/Z, Z): (aX² + Y²)Z² = Z⁴ + dX²Y² - const { X, Y, Z, T } = p; - const X2 = modP(X * X); // X² - const Y2 = modP(Y * Y); // Y² - const Z2 = modP(Z * Z); // Z² - const Z4 = modP(Z2 * Z2); // Z⁴ - const aX2 = modP(X2 * a); // aX² - const left = modP(Z2 * modP(aX2 + Y2)); // (aX² + Y²)Z² - const right = modP(Z4 + modP(d * modP(X2 * Y2))); // Z⁴ + dX²Y² - if (left !== right) - throw new Error('bad point: equation left != right (1)'); - // In Extended coordinates we also have T, which is x*y=T/Z: check X*Y == Z*T - const XY = modP(X * Y); - const ZT = modP(Z * T); - if (XY !== ZT) - throw new Error('bad point: equation left != right (2)'); - return true; - }); - // Extended Point works in extended coordinates: (X, Y, Z, T) ∋ (x=X/Z, y=Y/Z, T=xy). - // https://en.wikipedia.org/wiki/Twisted_Edwards_curve#Extended_coordinates - class Point { - constructor(X, Y, Z, T) { - this.X = acoord('x', X); - this.Y = acoord('y', Y); - this.Z = acoord('z', Z, true); - this.T = acoord('t', T); - Object.freeze(this); - } - static CURVE() { - return CURVE; - } - static fromAffine(p) { - if (p instanceof Point) - throw new Error('extended point not allowed'); - const { x, y } = p || {}; - acoord('x', x); - acoord('y', y); - return new Point(x, y, _1n, modP(x * y)); - } - // Uses algo from RFC8032 5.1.3. - static fromBytes(bytes, zip215 = false) { - const len = Fp.BYTES; - const { a, d } = CURVE; - bytes = (0, utils_ts_1.copyBytes)((0, utils_ts_1._abytes2)(bytes, len, 'point')); - (0, utils_ts_1._abool2)(zip215, 'zip215'); - const normed = (0, utils_ts_1.copyBytes)(bytes); // copy again, we'll manipulate it - const lastByte = bytes[len - 1]; // select last byte - normed[len - 1] = lastByte & ~0x80; // clear last bit - const y = (0, utils_ts_1.bytesToNumberLE)(normed); - // zip215=true is good for consensus-critical apps. =false follows RFC8032 / NIST186-5. - // RFC8032 prohibits >= p, but ZIP215 doesn't - // zip215=true: 0 <= y < MASK (2^256 for ed25519) - // zip215=false: 0 <= y < P (2^255-19 for ed25519) - const max = zip215 ? MASK : Fp.ORDER; - (0, utils_ts_1.aInRange)('point.y', y, _0n, max); - // Ed25519: x² = (y²-1)/(dy²+1) mod p. Ed448: x² = (y²-1)/(dy²-1) mod p. Generic case: - // ax²+y²=1+dx²y² => y²-1=dx²y²-ax² => y²-1=x²(dy²-a) => x²=(y²-1)/(dy²-a) - const y2 = modP(y * y); // denominator is always non-0 mod p. - const u = modP(y2 - _1n); // u = y² - 1 - const v = modP(d * y2 - a); // v = d y² + 1. - let { isValid, value: x } = uvRatio(u, v); // √(u/v) - if (!isValid) - throw new Error('bad point: invalid y coordinate'); - const isXOdd = (x & _1n) === _1n; // There are 2 square roots. Use x_0 bit to select proper - const isLastByteOdd = (lastByte & 0x80) !== 0; // x_0, last bit - if (!zip215 && x === _0n && isLastByteOdd) - // if x=0 and x_0 = 1, fail - throw new Error('bad point: x=0 and x_0=1'); - if (isLastByteOdd !== isXOdd) - x = modP(-x); // if x_0 != x mod 2, set x = p-x - return Point.fromAffine({ x, y }); - } - static fromHex(bytes, zip215 = false) { - return Point.fromBytes((0, utils_ts_1.ensureBytes)('point', bytes), zip215); - } - get x() { - return this.toAffine().x; - } - get y() { - return this.toAffine().y; - } - precompute(windowSize = 8, isLazy = true) { - wnaf.createCache(this, windowSize); - if (!isLazy) - this.multiply(_2n); // random number - return this; - } - // Useful in fromAffine() - not for fromBytes(), which always created valid points. - assertValidity() { - assertValidMemo(this); - } - // Compare one point to another. - equals(other) { - aextpoint(other); - const { X: X1, Y: Y1, Z: Z1 } = this; - const { X: X2, Y: Y2, Z: Z2 } = other; - const X1Z2 = modP(X1 * Z2); - const X2Z1 = modP(X2 * Z1); - const Y1Z2 = modP(Y1 * Z2); - const Y2Z1 = modP(Y2 * Z1); - return X1Z2 === X2Z1 && Y1Z2 === Y2Z1; - } - is0() { - return this.equals(Point.ZERO); - } - negate() { - // Flips point sign to a negative one (-x, y in affine coords) - return new Point(modP(-this.X), this.Y, this.Z, modP(-this.T)); - } - // Fast algo for doubling Extended Point. - // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-dbl-2008-hwcd - // Cost: 4M + 4S + 1*a + 6add + 1*2. - double() { - const { a } = CURVE; - const { X: X1, Y: Y1, Z: Z1 } = this; - const A = modP(X1 * X1); // A = X12 - const B = modP(Y1 * Y1); // B = Y12 - const C = modP(_2n * modP(Z1 * Z1)); // C = 2*Z12 - const D = modP(a * A); // D = a*A - const x1y1 = X1 + Y1; - const E = modP(modP(x1y1 * x1y1) - A - B); // E = (X1+Y1)2-A-B - const G = D + B; // G = D+B - const F = G - C; // F = G-C - const H = D - B; // H = D-B - const X3 = modP(E * F); // X3 = E*F - const Y3 = modP(G * H); // Y3 = G*H - const T3 = modP(E * H); // T3 = E*H - const Z3 = modP(F * G); // Z3 = F*G - return new Point(X3, Y3, Z3, T3); - } - // Fast algo for adding 2 Extended Points. - // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-add-2008-hwcd - // Cost: 9M + 1*a + 1*d + 7add. - add(other) { - aextpoint(other); - const { a, d } = CURVE; - const { X: X1, Y: Y1, Z: Z1, T: T1 } = this; - const { X: X2, Y: Y2, Z: Z2, T: T2 } = other; - const A = modP(X1 * X2); // A = X1*X2 - const B = modP(Y1 * Y2); // B = Y1*Y2 - const C = modP(T1 * d * T2); // C = T1*d*T2 - const D = modP(Z1 * Z2); // D = Z1*Z2 - const E = modP((X1 + Y1) * (X2 + Y2) - A - B); // E = (X1+Y1)*(X2+Y2)-A-B - const F = D - C; // F = D-C - const G = D + C; // G = D+C - const H = modP(B - a * A); // H = B-a*A - const X3 = modP(E * F); // X3 = E*F - const Y3 = modP(G * H); // Y3 = G*H - const T3 = modP(E * H); // T3 = E*H - const Z3 = modP(F * G); // Z3 = F*G - return new Point(X3, Y3, Z3, T3); - } - subtract(other) { - return this.add(other.negate()); - } - // Constant-time multiplication. - multiply(scalar) { - // 1 <= scalar < L - if (!Fn.isValidNot0(scalar)) - throw new Error('invalid scalar: expected 1 <= sc < curve.n'); - const { p, f } = wnaf.cached(this, scalar, (p) => (0, curve_ts_1.normalizeZ)(Point, p)); - return (0, curve_ts_1.normalizeZ)(Point, [p, f])[0]; - } - // Non-constant-time multiplication. Uses double-and-add algorithm. - // It's faster, but should only be used when you don't care about - // an exposed private key e.g. sig verification. - // Does NOT allow scalars higher than CURVE.n. - // Accepts optional accumulator to merge with multiply (important for sparse scalars) - multiplyUnsafe(scalar, acc = Point.ZERO) { - // 0 <= scalar < L - if (!Fn.isValid(scalar)) - throw new Error('invalid scalar: expected 0 <= sc < curve.n'); - if (scalar === _0n) - return Point.ZERO; - if (this.is0() || scalar === _1n) - return this; - return wnaf.unsafe(this, scalar, (p) => (0, curve_ts_1.normalizeZ)(Point, p), acc); - } - // Checks if point is of small order. - // If you add something to small order point, you will have "dirty" - // point with torsion component. - // Multiplies point by cofactor and checks if the result is 0. - isSmallOrder() { - return this.multiplyUnsafe(cofactor).is0(); - } - // Multiplies point by curve order and checks if the result is 0. - // Returns `false` is the point is dirty. - isTorsionFree() { - return wnaf.unsafe(this, CURVE.n).is0(); - } - // Converts Extended point to default (x, y) coordinates. - // Can accept precomputed Z^-1 - for example, from invertBatch. - toAffine(invertedZ) { - return toAffineMemo(this, invertedZ); - } - clearCofactor() { - if (cofactor === _1n) - return this; - return this.multiplyUnsafe(cofactor); - } - toBytes() { - const { x, y } = this.toAffine(); - // Fp.toBytes() allows non-canonical encoding of y (>= p). - const bytes = Fp.toBytes(y); - // Each y has 2 valid points: (x, y), (x,-y). - // When compressing, it's enough to store y and use the last byte to encode sign of x - bytes[bytes.length - 1] |= x & _1n ? 0x80 : 0; - return bytes; - } - toHex() { - return (0, utils_ts_1.bytesToHex)(this.toBytes()); - } - toString() { - return ``; - } - // TODO: remove - get ex() { - return this.X; - } - get ey() { - return this.Y; - } - get ez() { - return this.Z; - } - get et() { - return this.T; - } - static normalizeZ(points) { - return (0, curve_ts_1.normalizeZ)(Point, points); - } - static msm(points, scalars) { - return (0, curve_ts_1.pippenger)(Point, Fn, points, scalars); - } - _setWindowSize(windowSize) { - this.precompute(windowSize); - } - toRawBytes() { - return this.toBytes(); - } - } - // base / generator point - Point.BASE = new Point(CURVE.Gx, CURVE.Gy, _1n, modP(CURVE.Gx * CURVE.Gy)); - // zero / infinity / identity point - Point.ZERO = new Point(_0n, _1n, _1n, _0n); // 0, 1, 1, 0 - // math field - Point.Fp = Fp; - // scalar field - Point.Fn = Fn; - const wnaf = new curve_ts_1.wNAF(Point, Fn.BITS); - Point.BASE.precompute(8); // Enable precomputes. Slows down first publicKey computation by 20ms. - return Point; -} -/** - * Base class for prime-order points like Ristretto255 and Decaf448. - * These points eliminate cofactor issues by representing equivalence classes - * of Edwards curve points. - */ -class PrimeEdwardsPoint { - constructor(ep) { - this.ep = ep; - } - // Static methods that must be implemented by subclasses - static fromBytes(_bytes) { - (0, utils_ts_1.notImplemented)(); - } - static fromHex(_hex) { - (0, utils_ts_1.notImplemented)(); - } - get x() { - return this.toAffine().x; - } - get y() { - return this.toAffine().y; - } - // Common implementations - clearCofactor() { - // no-op for prime-order groups - return this; - } - assertValidity() { - this.ep.assertValidity(); - } - toAffine(invertedZ) { - return this.ep.toAffine(invertedZ); - } - toHex() { - return (0, utils_ts_1.bytesToHex)(this.toBytes()); - } - toString() { - return this.toHex(); - } - isTorsionFree() { - return true; - } - isSmallOrder() { - return false; - } - add(other) { - this.assertSame(other); - return this.init(this.ep.add(other.ep)); - } - subtract(other) { - this.assertSame(other); - return this.init(this.ep.subtract(other.ep)); - } - multiply(scalar) { - return this.init(this.ep.multiply(scalar)); - } - multiplyUnsafe(scalar) { - return this.init(this.ep.multiplyUnsafe(scalar)); - } - double() { - return this.init(this.ep.double()); - } - negate() { - return this.init(this.ep.negate()); - } - precompute(windowSize, isLazy) { - return this.init(this.ep.precompute(windowSize, isLazy)); - } - /** @deprecated use `toBytes` */ - toRawBytes() { - return this.toBytes(); - } -} -exports.PrimeEdwardsPoint = PrimeEdwardsPoint; -/** - * Initializes EdDSA signatures over given Edwards curve. - */ -function eddsa(Point, cHash, eddsaOpts = {}) { - if (typeof cHash !== 'function') - throw new Error('"hash" function param is required'); - (0, utils_ts_1._validateObject)(eddsaOpts, {}, { - adjustScalarBytes: 'function', - randomBytes: 'function', - domain: 'function', - prehash: 'function', - mapToCurve: 'function', - }); - const { prehash } = eddsaOpts; - const { BASE, Fp, Fn } = Point; - const randomBytes = eddsaOpts.randomBytes || utils_ts_1.randomBytes; - const adjustScalarBytes = eddsaOpts.adjustScalarBytes || ((bytes) => bytes); - const domain = eddsaOpts.domain || - ((data, ctx, phflag) => { - (0, utils_ts_1._abool2)(phflag, 'phflag'); - if (ctx.length || phflag) - throw new Error('Contexts/pre-hash are not supported'); - return data; - }); // NOOP - // Little-endian SHA512 with modulo n - function modN_LE(hash) { - return Fn.create((0, utils_ts_1.bytesToNumberLE)(hash)); // Not Fn.fromBytes: it has length limit - } - // Get the hashed private scalar per RFC8032 5.1.5 - function getPrivateScalar(key) { - const len = lengths.secretKey; - key = (0, utils_ts_1.ensureBytes)('private key', key, len); - // Hash private key with curve's hash function to produce uniformingly random input - // Check byte lengths: ensure(64, h(ensure(32, key))) - const hashed = (0, utils_ts_1.ensureBytes)('hashed private key', cHash(key), 2 * len); - const head = adjustScalarBytes(hashed.slice(0, len)); // clear first half bits, produce FE - const prefix = hashed.slice(len, 2 * len); // second half is called key prefix (5.1.6) - const scalar = modN_LE(head); // The actual private scalar - return { head, prefix, scalar }; - } - /** Convenience method that creates public key from scalar. RFC8032 5.1.5 */ - function getExtendedPublicKey(secretKey) { - const { head, prefix, scalar } = getPrivateScalar(secretKey); - const point = BASE.multiply(scalar); // Point on Edwards curve aka public key - const pointBytes = point.toBytes(); - return { head, prefix, scalar, point, pointBytes }; - } - /** Calculates EdDSA pub key. RFC8032 5.1.5. */ - function getPublicKey(secretKey) { - return getExtendedPublicKey(secretKey).pointBytes; - } - // int('LE', SHA512(dom2(F, C) || msgs)) mod N - function hashDomainToScalar(context = Uint8Array.of(), ...msgs) { - const msg = (0, utils_ts_1.concatBytes)(...msgs); - return modN_LE(cHash(domain(msg, (0, utils_ts_1.ensureBytes)('context', context), !!prehash))); - } - /** Signs message with privateKey. RFC8032 5.1.6 */ - function sign(msg, secretKey, options = {}) { - msg = (0, utils_ts_1.ensureBytes)('message', msg); - if (prehash) - msg = prehash(msg); // for ed25519ph etc. - const { prefix, scalar, pointBytes } = getExtendedPublicKey(secretKey); - const r = hashDomainToScalar(options.context, prefix, msg); // r = dom2(F, C) || prefix || PH(M) - const R = BASE.multiply(r).toBytes(); // R = rG - const k = hashDomainToScalar(options.context, R, pointBytes, msg); // R || A || PH(M) - const s = Fn.create(r + k * scalar); // S = (r + k * s) mod L - if (!Fn.isValid(s)) - throw new Error('sign failed: invalid s'); // 0 <= s < L - const rs = (0, utils_ts_1.concatBytes)(R, Fn.toBytes(s)); - return (0, utils_ts_1._abytes2)(rs, lengths.signature, 'result'); - } - // verification rule is either zip215 or rfc8032 / nist186-5. Consult fromHex: - const verifyOpts = { zip215: true }; - /** - * Verifies EdDSA signature against message and public key. RFC8032 5.1.7. - * An extended group equation is checked. - */ - function verify(sig, msg, publicKey, options = verifyOpts) { - const { context, zip215 } = options; - const len = lengths.signature; - sig = (0, utils_ts_1.ensureBytes)('signature', sig, len); - msg = (0, utils_ts_1.ensureBytes)('message', msg); - publicKey = (0, utils_ts_1.ensureBytes)('publicKey', publicKey, lengths.publicKey); - if (zip215 !== undefined) - (0, utils_ts_1._abool2)(zip215, 'zip215'); - if (prehash) - msg = prehash(msg); // for ed25519ph, etc - const mid = len / 2; - const r = sig.subarray(0, mid); - const s = (0, utils_ts_1.bytesToNumberLE)(sig.subarray(mid, len)); - let A, R, SB; - try { - // zip215=true is good for consensus-critical apps. =false follows RFC8032 / NIST186-5. - // zip215=true: 0 <= y < MASK (2^256 for ed25519) - // zip215=false: 0 <= y < P (2^255-19 for ed25519) - A = Point.fromBytes(publicKey, zip215); - R = Point.fromBytes(r, zip215); - SB = BASE.multiplyUnsafe(s); // 0 <= s < l is done inside - } - catch (error) { - return false; - } - if (!zip215 && A.isSmallOrder()) - return false; // zip215 allows public keys of small order - const k = hashDomainToScalar(context, R.toBytes(), A.toBytes(), msg); - const RkA = R.add(A.multiplyUnsafe(k)); - // Extended group equation - // [8][S]B = [8]R + [8][k]A' - return RkA.subtract(SB).clearCofactor().is0(); - } - const _size = Fp.BYTES; // 32 for ed25519, 57 for ed448 - const lengths = { - secretKey: _size, - publicKey: _size, - signature: 2 * _size, - seed: _size, - }; - function randomSecretKey(seed = randomBytes(lengths.seed)) { - return (0, utils_ts_1._abytes2)(seed, lengths.seed, 'seed'); - } - function keygen(seed) { - const secretKey = utils.randomSecretKey(seed); - return { secretKey, publicKey: getPublicKey(secretKey) }; - } - function isValidSecretKey(key) { - return (0, utils_ts_1.isBytes)(key) && key.length === Fn.BYTES; - } - function isValidPublicKey(key, zip215) { - try { - return !!Point.fromBytes(key, zip215); - } - catch (error) { - return false; - } - } - const utils = { - getExtendedPublicKey, - randomSecretKey, - isValidSecretKey, - isValidPublicKey, - /** - * Converts ed public key to x public key. Uses formula: - * - ed25519: - * - `(u, v) = ((1+y)/(1-y), sqrt(-486664)*u/x)` - * - `(x, y) = (sqrt(-486664)*u/v, (u-1)/(u+1))` - * - ed448: - * - `(u, v) = ((y-1)/(y+1), sqrt(156324)*u/x)` - * - `(x, y) = (sqrt(156324)*u/v, (1+u)/(1-u))` - */ - toMontgomery(publicKey) { - const { y } = Point.fromBytes(publicKey); - const size = lengths.publicKey; - const is25519 = size === 32; - if (!is25519 && size !== 57) - throw new Error('only defined for 25519 and 448'); - const u = is25519 ? Fp.div(_1n + y, _1n - y) : Fp.div(y - _1n, y + _1n); - return Fp.toBytes(u); - }, - toMontgomerySecret(secretKey) { - const size = lengths.secretKey; - (0, utils_ts_1._abytes2)(secretKey, size); - const hashed = cHash(secretKey.subarray(0, size)); - return adjustScalarBytes(hashed).subarray(0, size); - }, - /** @deprecated */ - randomPrivateKey: randomSecretKey, - /** @deprecated */ - precompute(windowSize = 8, point = Point.BASE) { - return point.precompute(windowSize, false); - }, - }; - return Object.freeze({ - keygen, - getPublicKey, - sign, - verify, - utils, - Point, - lengths, - }); -} -function _eddsa_legacy_opts_to_new(c) { - const CURVE = { - a: c.a, - d: c.d, - p: c.Fp.ORDER, - n: c.n, - h: c.h, - Gx: c.Gx, - Gy: c.Gy, - }; - const Fp = c.Fp; - const Fn = (0, modular_ts_1.Field)(CURVE.n, c.nBitLength, true); - const curveOpts = { Fp, Fn, uvRatio: c.uvRatio }; - const eddsaOpts = { - randomBytes: c.randomBytes, - adjustScalarBytes: c.adjustScalarBytes, - domain: c.domain, - prehash: c.prehash, - mapToCurve: c.mapToCurve, - }; - return { CURVE, curveOpts, hash: c.hash, eddsaOpts }; -} -function _eddsa_new_output_to_legacy(c, eddsa) { - const Point = eddsa.Point; - const legacy = Object.assign({}, eddsa, { - ExtendedPoint: Point, - CURVE: c, - nBitLength: Point.Fn.BITS, - nByteLength: Point.Fn.BYTES, - }); - return legacy; -} -// TODO: remove. Use eddsa -function twistedEdwards(c) { - const { CURVE, curveOpts, hash, eddsaOpts } = _eddsa_legacy_opts_to_new(c); - const Point = edwards(CURVE, curveOpts); - const EDDSA = eddsa(Point, hash, eddsaOpts); - return _eddsa_new_output_to_legacy(c, EDDSA); -} -//# sourceMappingURL=edwards.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/edwards.js.map b/tools/mnemonic-test/node_modules/@noble/curves/abstract/edwards.js.map deleted file mode 100644 index 5103561c..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/edwards.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"edwards.js","sourceRoot":"","sources":["../src/abstract/edwards.ts"],"names":[],"mappings":";;;AA6MA,0BA2UC;AAmHD,sBA6LC;AAoED,wCAKC;AAj5BD;;;;;GAKG;AACH,sEAAsE;AACtE,0CAgBqB;AACrB,yCAUoB;AACpB,6CAAgE;AAEhE,qEAAqE;AACrE,kBAAkB;AAClB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AA8JzE,SAAS,WAAW,CAAC,EAAkB,EAAE,KAAkB,EAAE,CAAS,EAAE,CAAS;IAC/E,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACrB,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACrB,MAAM,IAAI,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAC7C,MAAM,KAAK,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,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pB,KAAK,EAAE,CAAC;QACR,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI;QACzB,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK;KAC5B,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC;AACD,0BAA0B;AAC1B,SAAgB,cAAc,CAAC,CAAsB;IACnD,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,yBAAyB,CAAC,CAAC,CAAC,CAAC;IAC3E,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IACxC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;IAC5C,OAAO,2BAA2B,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AAC/C,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/fft.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/abstract/fft.d.ts deleted file mode 100644 index e1334ccb..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/fft.d.ts +++ /dev/null @@ -1,122 +0,0 @@ -/** - * Experimental implementation of NTT / FFT (Fast Fourier Transform) over finite fields. - * API may change at any time. The code has not been audited. Feature requests are welcome. - * @module - */ -import type { IField } from './modular.ts'; -export interface MutableArrayLike { - [index: number]: T; - length: number; - slice(start?: number, end?: number): this; - [Symbol.iterator](): Iterator; -} -/** Checks if integer is in form of `1 << X` */ -export declare function isPowerOfTwo(x: number): boolean; -export declare function nextPowerOfTwo(n: number): number; -export declare function reverseBits(n: number, bits: number): number; -/** Similar to `bitLen(x)-1` but much faster for small integers, like indices */ -export declare function log2(n: number): number; -/** - * Moves lowest bit to highest position, which at first step splits - * array on even and odd indices, then it applied again to each part, - * which is core of fft - */ -export declare function bitReversalInplace>(values: T): T; -export declare function bitReversalPermutation(values: T[]): T[]; -export type RootsOfUnity = { - roots: (bits: number) => bigint[]; - brp(bits: number): bigint[]; - inverse(bits: number): bigint[]; - omega: (bits: number) => bigint; - clear: () => void; -}; -/** We limit roots up to 2**31, which is a lot: 2-billion polynomimal should be rare. */ -export declare function rootsOfUnity(field: IField, generator?: bigint): RootsOfUnity; -export type Polynomial = MutableArrayLike; -/** - * Maps great to Field, but not to Group (EC points): - * - inv from scalar field - * - we need multiplyUnsafe here, instead of multiply for speed - * - multiplyUnsafe is safe in the context: we do mul(rootsOfUnity), which are public and sparse - */ -export type FFTOpts = { - add: (a: T, b: T) => T; - sub: (a: T, b: T) => T; - mul: (a: T, scalar: R) => T; - inv: (a: R) => R; -}; -export type FFTCoreOpts = { - N: number; - roots: Polynomial; - dit: boolean; - invertButterflies?: boolean; - skipStages?: number; - brp?: boolean; -}; -export type FFTCoreLoop =

>(values: P) => P; -/** - * Constructs different flavors of FFT. radix2 implementation of low level mutating API. Flavors: - * - * - DIT (Decimation-in-Time): Bottom-Up (leaves -> root), Cool-Turkey - * - DIF (Decimation-in-Frequency): Top-Down (root -> leaves), Gentleman–Sande - * - * DIT takes brp input, returns natural output. - * DIF takes natural input, returns brp output. - * - * The output is actually identical. Time / frequence distinction is not meaningful - * for Polynomial multiplication in fields. - * Which means if protocol supports/needs brp output/inputs, then we can skip this step. - * - * Cyclic NTT: Rq = Zq[x]/(x^n-1). butterfly_DIT+loop_DIT OR butterfly_DIF+loop_DIT, roots are omega - * Negacyclic NTT: Rq = Zq[x]/(x^n+1). butterfly_DIT+loop_DIF, at least for mlkem / mldsa - */ -export declare const FFTCore: (F: FFTOpts, coreOpts: FFTCoreOpts) => FFTCoreLoop; -export type FFTMethods = { - direct

>(values: P, brpInput?: boolean, brpOutput?: boolean): P; - inverse

>(values: P, brpInput?: boolean, brpOutput?: boolean): P; -}; -/** - * NTT aka FFT over finite field (NOT over complex numbers). - * Naming mirrors other libraries. - */ -export declare function FFT(roots: RootsOfUnity, opts: FFTOpts): FFTMethods; -export type CreatePolyFn

, T> = (len: number, elm?: T) => P; -export type PolyFn

, T> = { - roots: RootsOfUnity; - create: CreatePolyFn; - length?: number; - degree: (a: P) => number; - extend: (a: P, len: number) => P; - add: (a: P, b: P) => P; - sub: (a: P, b: P) => P; - mul: (a: P, b: P | T) => P; - dot: (a: P, b: P) => P; - convolve: (a: P, b: P) => P; - shift: (p: P, factor: bigint) => P; - clone: (a: P) => P; - eval: (a: P, basis: P) => T; - monomial: { - basis: (x: T, n: number) => P; - eval: (a: P, x: T) => T; - }; - lagrange: { - basis: (x: T, n: number, brp?: boolean) => P; - eval: (a: P, x: T, brp?: boolean) => T; - }; - vanishing: (roots: P) => P; -}; -/** - * Poly wants a cracker. - * - * Polynomials are functions like `y=f(x)`, which means when we multiply two polynomials, result is - * function `f3(x) = f1(x) * f2(x)`, we don't multiply values. Key takeaways: - * - * - **Polynomial** is an array of coefficients: `f(x) = sum(coeff[i] * basis[i](x))` - * - **Basis** is array of functions - * - **Monominal** is Polynomial where `basis[i](x) == x**i` (powers) - * - **Array size** is domain size - * - **Lattice** is matrix (Polynomial of Polynomials) - */ -export declare function poly(field: IField, roots: RootsOfUnity, create?: undefined, fft?: FFTMethods, length?: number): PolyFn; -export declare function poly>(field: IField, roots: RootsOfUnity, create: CreatePolyFn, fft?: FFTMethods, length?: number): PolyFn; -//# sourceMappingURL=fft.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/fft.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/abstract/fft.d.ts.map deleted file mode 100644 index 890ec829..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/fft.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fft.d.ts","sourceRoot":"","sources":["../src/abstract/fft.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC,CAAC,KAAK,EAAE,MAA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Y,EACnB,MAAM,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,EAC1B,GAAG,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,EACnB,MAAM,CAAC,EAAE,MAAM,GACd,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/fft.js b/tools/mnemonic-test/node_modules/@noble/curves/abstract/fft.js deleted file mode 100644 index 7886bb74..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/fft.js +++ /dev/null @@ -1,438 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FFTCore = void 0; -exports.isPowerOfTwo = isPowerOfTwo; -exports.nextPowerOfTwo = nextPowerOfTwo; -exports.reverseBits = reverseBits; -exports.log2 = log2; -exports.bitReversalInplace = bitReversalInplace; -exports.bitReversalPermutation = bitReversalPermutation; -exports.rootsOfUnity = rootsOfUnity; -exports.FFT = FFT; -exports.poly = poly; -function checkU32(n) { - // 0xff_ff_ff_ff - if (!Number.isSafeInteger(n) || n < 0 || n > 0xffffffff) - throw new Error('wrong u32 integer:' + n); - return n; -} -/** Checks if integer is in form of `1 << X` */ -function isPowerOfTwo(x) { - checkU32(x); - return (x & (x - 1)) === 0 && x !== 0; -} -function nextPowerOfTwo(n) { - checkU32(n); - if (n <= 1) - return 1; - return (1 << (log2(n - 1) + 1)) >>> 0; -} -function reverseBits(n, bits) { - checkU32(n); - let reversed = 0; - for (let i = 0; i < bits; i++, n >>>= 1) - reversed = (reversed << 1) | (n & 1); - return reversed; -} -/** Similar to `bitLen(x)-1` but much faster for small integers, like indices */ -function log2(n) { - checkU32(n); - return 31 - Math.clz32(n); -} -/** - * Moves lowest bit to highest position, which at first step splits - * array on even and odd indices, then it applied again to each part, - * which is core of fft - */ -function bitReversalInplace(values) { - const n = values.length; - if (n < 2 || !isPowerOfTwo(n)) - throw new Error('n must be a power of 2 and greater than 1. Got ' + n); - const bits = log2(n); - for (let i = 0; i < n; i++) { - const j = reverseBits(i, bits); - if (i < j) { - const tmp = values[i]; - values[i] = values[j]; - values[j] = tmp; - } - } - return values; -} -function bitReversalPermutation(values) { - return bitReversalInplace(values.slice()); -} -const _1n = /** @__PURE__ */ BigInt(1); -function findGenerator(field) { - let G = BigInt(2); - for (; field.eql(field.pow(G, field.ORDER >> _1n), field.ONE); G++) - ; - return G; -} -/** We limit roots up to 2**31, which is a lot: 2-billion polynomimal should be rare. */ -function rootsOfUnity(field, generator) { - // Factor field.ORDER-1 as oddFactor * 2^powerOfTwo - let oddFactor = field.ORDER - _1n; - let powerOfTwo = 0; - for (; (oddFactor & _1n) !== _1n; powerOfTwo++, oddFactor >>= _1n) - ; - // Find non quadratic residue - let G = generator !== undefined ? BigInt(generator) : findGenerator(field); - // Powers of generator - const omegas = new Array(powerOfTwo + 1); - omegas[powerOfTwo] = field.pow(G, oddFactor); - for (let i = powerOfTwo; i > 0; i--) - omegas[i - 1] = field.sqr(omegas[i]); - // Compute all roots of unity for powers up to maxPower - const rootsCache = []; - const checkBits = (bits) => { - checkU32(bits); - if (bits > 31 || bits > powerOfTwo) - throw new Error('rootsOfUnity: wrong bits ' + bits + ' powerOfTwo=' + powerOfTwo); - return bits; - }; - const precomputeRoots = (maxPower) => { - checkBits(maxPower); - for (let power = maxPower; power >= 0; power--) { - if (rootsCache[power]) - continue; // Skip if we've already computed roots for this power - const rootsAtPower = []; - for (let j = 0, cur = field.ONE; j < 2 ** power; j++, cur = field.mul(cur, omegas[power])) - rootsAtPower.push(cur); - rootsCache[power] = rootsAtPower; - } - return rootsCache[maxPower]; - }; - const brpCache = new Map(); - const inverseCache = new Map(); - // NOTE: we use bits instead of power, because power = 2**bits, - // but power is not neccesary isPowerOfTwo(power)! - return { - roots: (bits) => { - const b = checkBits(bits); - return precomputeRoots(b); - }, - brp(bits) { - const b = checkBits(bits); - if (brpCache.has(b)) - return brpCache.get(b); - else { - const res = bitReversalPermutation(this.roots(b)); - brpCache.set(b, res); - return res; - } - }, - inverse(bits) { - const b = checkBits(bits); - if (inverseCache.has(b)) - return inverseCache.get(b); - else { - const res = field.invertBatch(this.roots(b)); - inverseCache.set(b, res); - return res; - } - }, - omega: (bits) => omegas[checkBits(bits)], - clear: () => { - rootsCache.splice(0, rootsCache.length); - brpCache.clear(); - }, - }; -} -/** - * Constructs different flavors of FFT. radix2 implementation of low level mutating API. Flavors: - * - * - DIT (Decimation-in-Time): Bottom-Up (leaves -> root), Cool-Turkey - * - DIF (Decimation-in-Frequency): Top-Down (root -> leaves), Gentleman–Sande - * - * DIT takes brp input, returns natural output. - * DIF takes natural input, returns brp output. - * - * The output is actually identical. Time / frequence distinction is not meaningful - * for Polynomial multiplication in fields. - * Which means if protocol supports/needs brp output/inputs, then we can skip this step. - * - * Cyclic NTT: Rq = Zq[x]/(x^n-1). butterfly_DIT+loop_DIT OR butterfly_DIF+loop_DIT, roots are omega - * Negacyclic NTT: Rq = Zq[x]/(x^n+1). butterfly_DIT+loop_DIF, at least for mlkem / mldsa - */ -const FFTCore = (F, coreOpts) => { - const { N, roots, dit, invertButterflies = false, skipStages = 0, brp = true } = coreOpts; - const bits = log2(N); - if (!isPowerOfTwo(N)) - throw new Error('FFT: Polynomial size should be power of two'); - const isDit = dit !== invertButterflies; - isDit; - return (values) => { - if (values.length !== N) - throw new Error('FFT: wrong Polynomial length'); - if (dit && brp) - bitReversalInplace(values); - for (let i = 0, g = 1; i < bits - skipStages; i++) { - // For each stage s (sub-FFT length m = 2^s) - const s = dit ? i + 1 + skipStages : bits - i; - const m = 1 << s; - const m2 = m >> 1; - const stride = N >> s; - // Loop over each subarray of length m - for (let k = 0; k < N; k += m) { - // Loop over each butterfly within the subarray - for (let j = 0, grp = g++; j < m2; j++) { - const rootPos = invertButterflies ? (dit ? N - grp : grp) : j * stride; - const i0 = k + j; - const i1 = k + j + m2; - const omega = roots[rootPos]; - const b = values[i1]; - const a = values[i0]; - // Inlining gives us 10% perf in kyber vs functions - if (isDit) { - const t = F.mul(b, omega); // Standard DIT butterfly - values[i0] = F.add(a, t); - values[i1] = F.sub(a, t); - } - else if (invertButterflies) { - values[i0] = F.add(b, a); // DIT loop + inverted butterflies (Kyber decode) - values[i1] = F.mul(F.sub(b, a), omega); - } - else { - values[i0] = F.add(a, b); // Standard DIF butterfly - values[i1] = F.mul(F.sub(a, b), omega); - } - } - } - } - if (!dit && brp) - bitReversalInplace(values); - return values; - }; -}; -exports.FFTCore = FFTCore; -/** - * NTT aka FFT over finite field (NOT over complex numbers). - * Naming mirrors other libraries. - */ -function FFT(roots, opts) { - const getLoop = (N, roots, brpInput = false, brpOutput = false) => { - if (brpInput && brpOutput) { - // we cannot optimize this case, but lets support it anyway - return (values) => (0, exports.FFTCore)(opts, { N, roots, dit: false, brp: false })(bitReversalInplace(values)); - } - if (brpInput) - return (0, exports.FFTCore)(opts, { N, roots, dit: true, brp: false }); - if (brpOutput) - return (0, exports.FFTCore)(opts, { N, roots, dit: false, brp: false }); - return (0, exports.FFTCore)(opts, { N, roots, dit: true, brp: true }); // all natural - }; - return { - direct(values, brpInput = false, brpOutput = false) { - const N = values.length; - if (!isPowerOfTwo(N)) - throw new Error('FFT: Polynomial size should be power of two'); - const bits = log2(N); - return getLoop(N, roots.roots(bits), brpInput, brpOutput)(values.slice()); - }, - inverse(values, brpInput = false, brpOutput = false) { - const N = values.length; - const bits = log2(N); - const res = getLoop(N, roots.inverse(bits), brpInput, brpOutput)(values.slice()); - const ivm = opts.inv(BigInt(values.length)); // scale - // we can get brp output if we use dif instead of dit! - for (let i = 0; i < res.length; i++) - res[i] = opts.mul(res[i], ivm); - // Allows to re-use non-inverted roots, but is VERY fragile - // return [res[0]].concat(res.slice(1).reverse()); - // inverse calculated as pow(-1), which transforms into ω^{-kn} (-> reverses indices) - return res; - }, - }; -} -function poly(field, roots, create, fft, length) { - const F = field; - const _create = create || - ((len, elm) => new Array(len).fill(elm ?? F.ZERO)); - const isPoly = (x) => Array.isArray(x) || ArrayBuffer.isView(x); - const checkLength = (...lst) => { - if (!lst.length) - return 0; - for (const i of lst) - if (!isPoly(i)) - throw new Error('poly: not polynomial: ' + i); - const L = lst[0].length; - for (let i = 1; i < lst.length; i++) - if (lst[i].length !== L) - throw new Error(`poly: mismatched lengths ${L} vs ${lst[i].length}`); - if (length !== undefined && L !== length) - throw new Error(`poly: expected fixed length ${length}, got ${L}`); - return L; - }; - function findOmegaIndex(x, n, brp = false) { - const bits = log2(n); - const omega = brp ? roots.brp(bits) : roots.roots(bits); - for (let i = 0; i < n; i++) - if (F.eql(x, omega[i])) - return i; - return -1; - } - // TODO: mutating versions for mlkem/mldsa - return { - roots, - create: _create, - length, - extend: (a, len) => { - checkLength(a); - const out = _create(len, F.ZERO); - for (let i = 0; i < a.length; i++) - out[i] = a[i]; - return out; - }, - degree: (a) => { - checkLength(a); - for (let i = a.length - 1; i >= 0; i--) - if (!F.is0(a[i])) - return i; - return -1; - }, - add: (a, b) => { - const len = checkLength(a, b); - const out = _create(len); - for (let i = 0; i < len; i++) - out[i] = F.add(a[i], b[i]); - return out; - }, - sub: (a, b) => { - const len = checkLength(a, b); - const out = _create(len); - for (let i = 0; i < len; i++) - out[i] = F.sub(a[i], b[i]); - return out; - }, - dot: (a, b) => { - const len = checkLength(a, b); - const out = _create(len); - for (let i = 0; i < len; i++) - out[i] = F.mul(a[i], b[i]); - return out; - }, - mul: (a, b) => { - if (isPoly(b)) { - const len = checkLength(a, b); - if (fft) { - const A = fft.direct(a, false, true); - const B = fft.direct(b, false, true); - for (let i = 0; i < A.length; i++) - A[i] = F.mul(A[i], B[i]); - return fft.inverse(A, true, false); - } - else { - // NOTE: this is quadratic and mostly for compat tests with FFT - const res = _create(len); - for (let i = 0; i < len; i++) { - for (let j = 0; j < len; j++) { - const k = (i + j) % len; // wrap mod length - res[k] = F.add(res[k], F.mul(a[i], b[j])); - } - } - return res; - } - } - else { - const out = _create(checkLength(a)); - for (let i = 0; i < out.length; i++) - out[i] = F.mul(a[i], b); - return out; - } - }, - convolve(a, b) { - const len = nextPowerOfTwo(a.length + b.length - 1); - return this.mul(this.extend(a, len), this.extend(b, len)); - }, - shift(p, factor) { - const out = _create(checkLength(p)); - out[0] = p[0]; - for (let i = 1, power = F.ONE; i < p.length; i++) { - power = F.mul(power, factor); - out[i] = F.mul(p[i], power); - } - return out; - }, - clone: (a) => { - checkLength(a); - const out = _create(a.length); - for (let i = 0; i < a.length; i++) - out[i] = a[i]; - return out; - }, - eval: (a, basis) => { - checkLength(a); - let acc = F.ZERO; - for (let i = 0; i < a.length; i++) - acc = F.add(acc, F.mul(a[i], basis[i])); - return acc; - }, - monomial: { - basis: (x, n) => { - const out = _create(n); - let pow = F.ONE; - for (let i = 0; i < n; i++) { - out[i] = pow; - pow = F.mul(pow, x); - } - return out; - }, - eval: (a, x) => { - checkLength(a); - // Same as eval(a, monomialBasis(x, a.length)), but it is faster this way - let acc = F.ZERO; - for (let i = a.length - 1; i >= 0; i--) - acc = F.add(F.mul(acc, x), a[i]); - return acc; - }, - }, - lagrange: { - basis: (x, n, brp = false, weights) => { - const bits = log2(n); - const cache = weights || brp ? roots.brp(bits) : roots.roots(bits); // [ω⁰, ω¹, ..., ωⁿ⁻¹] - const out = _create(n); - // Fast Kronecker-δ shortcut - const idx = findOmegaIndex(x, n, brp); - if (idx !== -1) { - out[idx] = F.ONE; - return out; - } - const tm = F.pow(x, BigInt(n)); - const c = F.mul(F.sub(tm, F.ONE), F.inv(BigInt(n))); // c = (xⁿ - 1)/n - const denom = _create(n); - for (let i = 0; i < n; i++) - denom[i] = F.sub(x, cache[i]); - const inv = F.invertBatch(denom); - for (let i = 0; i < n; i++) - out[i] = F.mul(c, F.mul(cache[i], inv[i])); - return out; - }, - eval(a, x, brp = false) { - checkLength(a); - const idx = findOmegaIndex(x, a.length, brp); - if (idx !== -1) - return a[idx]; // fast path - const L = this.basis(x, a.length, brp); // Lᵢ(x) - let acc = F.ZERO; - for (let i = 0; i < a.length; i++) - if (!F.is0(a[i])) - acc = F.add(acc, F.mul(a[i], L[i])); - return acc; - }, - }, - vanishing(roots) { - checkLength(roots); - const out = _create(roots.length + 1, F.ZERO); - out[0] = F.ONE; - for (const r of roots) { - const neg = F.neg(r); - for (let j = out.length - 1; j > 0; j--) - out[j] = F.add(F.mul(out[j], neg), out[j - 1]); - out[0] = F.mul(out[0], neg); - } - return out; - }, - }; -} -//# sourceMappingURL=fft.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/fft.js.map b/tools/mnemonic-test/node_modules/@noble/curves/abstract/fft.js.map deleted file mode 100644 index eb71df40..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/fft.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fft.js","sourceRoot":"","sources":["../src/abstract/fft.ts"],"names":[],"mappings":";;;AAsBA,oCAGC;AAED,wCAIC;AAED,kCAKC;AAGD,oBAGC;AAOD,gDAcC;AAED,wDAEC;AAiBD,oCAiEC;AAkGD,kBAoCC;AA0DD,oBA+KC;AAxfD,SAAS,QAAQ,CAAC,CAAS;IACzB,gBAAgB;IAChB,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,UAAU;QACrD,MAAM,IAAI,KAAK,CAAC,oBAAoB,GAAG,CAAC,CAAC,CAAC;IAC5C,OAAO,CAAC,CAAC;AACX,CAAC;AAED,+CAA+C;AAC/C,SAAgB,YAAY,CAAC,CAAS;IACpC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACZ,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACxC,CAAC;AAED,SAAgB,cAAc,CAAC,CAAS;IACtC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACZ,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC;IACrB,OAAO,CA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CAAC,CAAC,MAAM,EAAE,CAAC,EAAE;oBAAE,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;wBAAE,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACzF,OAAO,GAAG,CAAC;YACb,CAAC;SACF;QACD,SAAS,CAAC,KAAQ;YAChB,WAAW,CAAC,KAAK,CAAC,CAAC;YACnB,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;YAC9C,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC;YACf,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;gBACtB,MAAM,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBACrB,KAAK,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;oBAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBACxF,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;YAC9B,CAAC;YACD,OAAO,GAAG,CAAC;QACb,CAAC;KACF,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/hash-to-curve.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/abstract/hash-to-curve.d.ts deleted file mode 100644 index 2bc50717..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/hash-to-curve.d.ts +++ /dev/null @@ -1,102 +0,0 @@ -/** - * hash-to-curve from RFC 9380. - * Hashes arbitrary-length byte strings to a list of one or more elements of a finite field F. - * https://www.rfc-editor.org/rfc/rfc9380 - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import type { CHash } from '../utils.ts'; -import type { AffinePoint, Group, GroupConstructor } from './curve.ts'; -import { type IField } from './modular.ts'; -export type UnicodeOrBytes = string | Uint8Array; -/** - * * `DST` is a domain separation tag, defined in section 2.2.5 - * * `p` characteristic of F, where F is a finite field of characteristic p and order q = p^m - * * `m` is extension degree (1 for prime fields) - * * `k` is the target security target in bits (e.g. 128), from section 5.1 - * * `expand` is `xmd` (SHA2, SHA3, BLAKE) or `xof` (SHAKE, BLAKE-XOF) - * * `hash` conforming to `utils.CHash` interface, with `outputLen` / `blockLen` props - */ -export type H2COpts = { - DST: UnicodeOrBytes; - expand: 'xmd' | 'xof'; - hash: CHash; - p: bigint; - m: number; - k: number; -}; -export type H2CHashOpts = { - expand: 'xmd' | 'xof'; - hash: CHash; -}; -export type Opts = H2COpts; -/** - * Produces a uniformly random byte string using a cryptographic hash function H that outputs b bits. - * [RFC 9380 5.3.1](https://www.rfc-editor.org/rfc/rfc9380#section-5.3.1). - */ -export declare function expand_message_xmd(msg: Uint8Array, DST: UnicodeOrBytes, lenInBytes: number, H: CHash): Uint8Array; -/** - * Produces a uniformly random byte string using an extendable-output function (XOF) H. - * 1. The collision resistance of H MUST be at least k bits. - * 2. H MUST be an XOF that has been proved indifferentiable from - * a random oracle under a reasonable cryptographic assumption. - * [RFC 9380 5.3.2](https://www.rfc-editor.org/rfc/rfc9380#section-5.3.2). - */ -export declare function expand_message_xof(msg: Uint8Array, DST: UnicodeOrBytes, lenInBytes: number, k: number, H: CHash): Uint8Array; -/** - * Hashes arbitrary-length byte strings to a list of one or more elements of a finite field F. - * [RFC 9380 5.2](https://www.rfc-editor.org/rfc/rfc9380#section-5.2). - * @param msg a byte string containing the message to hash - * @param count the number of elements of F to output - * @param options `{DST: string, p: bigint, m: number, k: number, expand: 'xmd' | 'xof', hash: H}`, see above - * @returns [u_0, ..., u_(count - 1)], a list of field elements. - */ -export declare function hash_to_field(msg: Uint8Array, count: number, options: H2COpts): bigint[][]; -export type XY = (x: T, y: T) => { - x: T; - y: T; -}; -export type XYRatio = [T[], T[], T[], T[]]; -export declare function isogenyMap>(field: F, map: XYRatio): XY; -/** Point interface, which curves must implement to work correctly with the module. */ -export interface H2CPoint extends Group> { - add(rhs: H2CPoint): H2CPoint; - toAffine(iz?: bigint): AffinePoint; - clearCofactor(): H2CPoint; - assertValidity(): void; -} -export interface H2CPointConstructor extends GroupConstructor> { - fromAffine(ap: AffinePoint): H2CPoint; -} -export type MapToCurve = (scalar: bigint[]) => AffinePoint; -export type htfBasicOpts = { - DST: UnicodeOrBytes; -}; -export type H2CMethod = (msg: Uint8Array, options?: htfBasicOpts) => H2CPoint; -export type HTFMethod = H2CMethod; -export type MapMethod = (scalars: bigint[]) => H2CPoint; -export type H2CHasherBase = { - hashToCurve: H2CMethod; - hashToScalar: (msg: Uint8Array, options: htfBasicOpts) => bigint; -}; -/** - * RFC 9380 methods, with cofactor clearing. See https://www.rfc-editor.org/rfc/rfc9380#section-3. - * - * * hashToCurve: `map(hash(input))`, encodes RANDOM bytes to curve (WITH hashing) - * * encodeToCurve: `map(hash(input))`, encodes NON-UNIFORM bytes to curve (WITH hashing) - * * mapToCurve: `map(scalars)`, encodes NON-UNIFORM scalars to curve (NO hashing) - */ -export type H2CHasher = H2CHasherBase & { - encodeToCurve: H2CMethod; - mapToCurve: MapMethod; - defaults: H2COpts & { - encodeDST?: UnicodeOrBytes; - }; -}; -export type Hasher = H2CHasher; -export declare const _DST_scalar: Uint8Array; -/** Creates hash-to-curve methods from EC Point and mapToCurve function. See {@link H2CHasher}. */ -export declare function createHasher(Point: H2CPointConstructor, mapToCurve: MapToCurve, defaults: H2COpts & { - encodeDST?: UnicodeOrBytes; -}): H2CHasher; -//# sourceMappingURL=hash-to-curve.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/hash-to-curve.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/abstract/hash-to-curve.d.ts.map deleted file mode 100644 index 1c33f7be..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/hash-to-curve.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hash-to-curve.d.ts","sourceRoot":"","sources":["../src/abstract/hash-to-curve.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,sEAAsE;AACtE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAUzC,OAAO,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,EAAsB,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAE/D,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,CAAC;AAEjD;;;;;;;GAOG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,GAAG,EAAE,cAAc,CAAC;IACpB,MAAM,EAAE,KAAK,GAAG,KAAK,CAAC;IACtB,IAAI,EAAE,KAAK,CAAC;IACZ,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AACF,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,KAAK,GAAG,KAAK,CAAC;IACtB,IAAI,EAAE,KAAK,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG,OAAO,CAAC;AAmC3B;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,UAAU,EACf,GAAG,EAAE,cAAc,EACnB,UAAU,EAAE,MAAM,EAClB,CAAC,EAAE,KAAK,GACP,UAAU,CAqB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gB,YAAY,CAAC,CAAC,EAC5B,KAAK,EAAE,mBAAmB,CAAC,CAAC,CAAC,EAC7B,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,EACzB,QAAQ,EAAE,OAAO,GAAG;IAAE,SAAS,CAAC,EAAE,cAAc,CAAA;CAAE,GACjD,SAAS,CAAC,CAAC,CAAC,CA8Cd"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/hash-to-curve.js b/tools/mnemonic-test/node_modules/@noble/curves/abstract/hash-to-curve.js deleted file mode 100644 index 113df8b2..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/hash-to-curve.js +++ /dev/null @@ -1,211 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports._DST_scalar = void 0; -exports.expand_message_xmd = expand_message_xmd; -exports.expand_message_xof = expand_message_xof; -exports.hash_to_field = hash_to_field; -exports.isogenyMap = isogenyMap; -exports.createHasher = createHasher; -const utils_ts_1 = require("../utils.js"); -const modular_ts_1 = require("./modular.js"); -// Octet Stream to Integer. "spec" implementation of os2ip is 2.5x slower vs bytesToNumberBE. -const os2ip = utils_ts_1.bytesToNumberBE; -// Integer to Octet Stream (numberToBytesBE) -function i2osp(value, length) { - anum(value); - anum(length); - if (value < 0 || value >= 1 << (8 * length)) - throw new Error('invalid I2OSP input: ' + value); - const res = Array.from({ length }).fill(0); - for (let i = length - 1; i >= 0; i--) { - res[i] = value & 0xff; - value >>>= 8; - } - return new Uint8Array(res); -} -function strxor(a, b) { - const arr = new Uint8Array(a.length); - for (let i = 0; i < a.length; i++) { - arr[i] = a[i] ^ b[i]; - } - return arr; -} -function anum(item) { - if (!Number.isSafeInteger(item)) - throw new Error('number expected'); -} -function normDST(DST) { - if (!(0, utils_ts_1.isBytes)(DST) && typeof DST !== 'string') - throw new Error('DST must be Uint8Array or string'); - return typeof DST === 'string' ? (0, utils_ts_1.utf8ToBytes)(DST) : DST; -} -/** - * Produces a uniformly random byte string using a cryptographic hash function H that outputs b bits. - * [RFC 9380 5.3.1](https://www.rfc-editor.org/rfc/rfc9380#section-5.3.1). - */ -function expand_message_xmd(msg, DST, lenInBytes, H) { - (0, utils_ts_1.abytes)(msg); - anum(lenInBytes); - DST = normDST(DST); - // https://www.rfc-editor.org/rfc/rfc9380#section-5.3.3 - if (DST.length > 255) - DST = H((0, utils_ts_1.concatBytes)((0, utils_ts_1.utf8ToBytes)('H2C-OVERSIZE-DST-'), DST)); - const { outputLen: b_in_bytes, blockLen: r_in_bytes } = H; - const ell = Math.ceil(lenInBytes / b_in_bytes); - if (lenInBytes > 65535 || ell > 255) - throw new Error('expand_message_xmd: invalid lenInBytes'); - const DST_prime = (0, utils_ts_1.concatBytes)(DST, i2osp(DST.length, 1)); - const Z_pad = i2osp(0, r_in_bytes); - const l_i_b_str = i2osp(lenInBytes, 2); // len_in_bytes_str - const b = new Array(ell); - const b_0 = H((0, utils_ts_1.concatBytes)(Z_pad, msg, l_i_b_str, i2osp(0, 1), DST_prime)); - b[0] = H((0, utils_ts_1.concatBytes)(b_0, i2osp(1, 1), DST_prime)); - for (let i = 1; i <= ell; i++) { - const args = [strxor(b_0, b[i - 1]), i2osp(i + 1, 1), DST_prime]; - b[i] = H((0, utils_ts_1.concatBytes)(...args)); - } - const pseudo_random_bytes = (0, utils_ts_1.concatBytes)(...b); - return pseudo_random_bytes.slice(0, lenInBytes); -} -/** - * Produces a uniformly random byte string using an extendable-output function (XOF) H. - * 1. The collision resistance of H MUST be at least k bits. - * 2. H MUST be an XOF that has been proved indifferentiable from - * a random oracle under a reasonable cryptographic assumption. - * [RFC 9380 5.3.2](https://www.rfc-editor.org/rfc/rfc9380#section-5.3.2). - */ -function expand_message_xof(msg, DST, lenInBytes, k, H) { - (0, utils_ts_1.abytes)(msg); - anum(lenInBytes); - DST = normDST(DST); - // https://www.rfc-editor.org/rfc/rfc9380#section-5.3.3 - // DST = H('H2C-OVERSIZE-DST-' || a_very_long_DST, Math.ceil((lenInBytes * k) / 8)); - if (DST.length > 255) { - const dkLen = Math.ceil((2 * k) / 8); - DST = H.create({ dkLen }).update((0, utils_ts_1.utf8ToBytes)('H2C-OVERSIZE-DST-')).update(DST).digest(); - } - if (lenInBytes > 65535 || DST.length > 255) - throw new Error('expand_message_xof: invalid lenInBytes'); - return (H.create({ dkLen: lenInBytes }) - .update(msg) - .update(i2osp(lenInBytes, 2)) - // 2. DST_prime = DST || I2OSP(len(DST), 1) - .update(DST) - .update(i2osp(DST.length, 1)) - .digest()); -} -/** - * Hashes arbitrary-length byte strings to a list of one or more elements of a finite field F. - * [RFC 9380 5.2](https://www.rfc-editor.org/rfc/rfc9380#section-5.2). - * @param msg a byte string containing the message to hash - * @param count the number of elements of F to output - * @param options `{DST: string, p: bigint, m: number, k: number, expand: 'xmd' | 'xof', hash: H}`, see above - * @returns [u_0, ..., u_(count - 1)], a list of field elements. - */ -function hash_to_field(msg, count, options) { - (0, utils_ts_1._validateObject)(options, { - p: 'bigint', - m: 'number', - k: 'number', - hash: 'function', - }); - const { p, k, m, hash, expand, DST } = options; - if (!(0, utils_ts_1.isHash)(options.hash)) - throw new Error('expected valid hash'); - (0, utils_ts_1.abytes)(msg); - anum(count); - const log2p = p.toString(2).length; - const L = Math.ceil((log2p + k) / 8); // section 5.1 of ietf draft link above - const len_in_bytes = count * m * L; - let prb; // pseudo_random_bytes - if (expand === 'xmd') { - prb = expand_message_xmd(msg, DST, len_in_bytes, hash); - } - else if (expand === 'xof') { - prb = expand_message_xof(msg, DST, len_in_bytes, k, hash); - } - else if (expand === '_internal_pass') { - // for internal tests only - prb = msg; - } - else { - throw new Error('expand must be "xmd" or "xof"'); - } - const u = new Array(count); - for (let i = 0; i < count; i++) { - const e = new Array(m); - for (let j = 0; j < m; j++) { - const elm_offset = L * (j + i * m); - const tv = prb.subarray(elm_offset, elm_offset + L); - e[j] = (0, modular_ts_1.mod)(os2ip(tv), p); - } - u[i] = e; - } - return u; -} -function isogenyMap(field, map) { - // Make same order as in spec - const coeff = map.map((i) => Array.from(i).reverse()); - return (x, y) => { - const [xn, xd, yn, yd] = coeff.map((val) => val.reduce((acc, i) => field.add(field.mul(acc, x), i))); - // 6.6.3 - // Exceptional cases of iso_map are inputs that cause the denominator of - // either rational function to evaluate to zero; such cases MUST return - // the identity point on E. - const [xd_inv, yd_inv] = (0, modular_ts_1.FpInvertBatch)(field, [xd, yd], true); - x = field.mul(xn, xd_inv); // xNum / xDen - y = field.mul(y, field.mul(yn, yd_inv)); // y * (yNum / yDev) - return { x, y }; - }; -} -exports._DST_scalar = (0, utils_ts_1.utf8ToBytes)('HashToScalar-'); -/** Creates hash-to-curve methods from EC Point and mapToCurve function. See {@link H2CHasher}. */ -function createHasher(Point, mapToCurve, defaults) { - if (typeof mapToCurve !== 'function') - throw new Error('mapToCurve() must be defined'); - function map(num) { - return Point.fromAffine(mapToCurve(num)); - } - function clear(initial) { - const P = initial.clearCofactor(); - if (P.equals(Point.ZERO)) - return Point.ZERO; // zero will throw in assert - P.assertValidity(); - return P; - } - return { - defaults, - hashToCurve(msg, options) { - const opts = Object.assign({}, defaults, options); - const u = hash_to_field(msg, 2, opts); - const u0 = map(u[0]); - const u1 = map(u[1]); - return clear(u0.add(u1)); - }, - encodeToCurve(msg, options) { - const optsDst = defaults.encodeDST ? { DST: defaults.encodeDST } : {}; - const opts = Object.assign({}, defaults, optsDst, options); - const u = hash_to_field(msg, 1, opts); - const u0 = map(u[0]); - return clear(u0); - }, - /** See {@link H2CHasher} */ - mapToCurve(scalars) { - if (!Array.isArray(scalars)) - throw new Error('expected array of bigints'); - for (const i of scalars) - if (typeof i !== 'bigint') - throw new Error('expected array of bigints'); - return clear(map(scalars)); - }, - // hash_to_scalar can produce 0: https://www.rfc-editor.org/errata/eid8393 - // RFC 9380, draft-irtf-cfrg-bbs-signatures-08 - hashToScalar(msg, options) { - // @ts-ignore - const N = Point.Fn.ORDER; - const opts = Object.assign({}, defaults, { p: N, m: 1, DST: exports._DST_scalar }, options); - return hash_to_field(msg, 1, opts)[0][0]; - }, - }; -} -//# sourceMappingURL=hash-to-curve.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/hash-to-curve.js.map b/tools/mnemonic-test/node_modules/@noble/curves/abstract/hash-to-curve.js.map deleted file mode 100644 index f9a0647f..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/hash-to-curve.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hash-to-curve.js","sourceRoot":"","sources":["../src/abstract/hash-to-curve.ts"],"names":[],"mappings":";;;AAkFA,gDA0BC;AASD,gDA2BC;AAUD,sCAoCC;AAID,gCAgBC;AA6CD,oCAkDC;AAzSD,0CAQqB;AAErB,6CAA+D;AA2B/D,6FAA6F;AAC7F,MAAM,KAAK,GAAG,0BAAe,CAAC;AAE9B,4CAA4C;AAC5C,SAAS,KAAK,CAAC,KAAa,EAAE,MAAc;IAC1C,IAAI,CAAC,KAAK,CAAC,CAAC;IACZ,IAAI,CAAC,MAAM,CAAC,CAAC;IACb,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,GAAG,KAAK,CAAC,CAAC;IAC9F,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAa,CAAC;IACvD,KAAK,IAAI,CAAC,GAAG,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC;QACtB,KAAK,MAAM,CAAC,CAAC;IACf,CAAC;IACD,OAAO,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC;AAC7B,CAAC;AAED,SAAS,MAAM,CAAC,CAAa,EAAE,CAAa;IAC1C,MAAM,GAAG,GAAG,IA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,CAAC;YACzB,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,mBAAW,EAAE,EAAE,OAAO,CAAC,CAAC;YACpF,OAAO,aAAa,CAAC,GAAG,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3C,CAAC;KACF,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/modular.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/abstract/modular.d.ts deleted file mode 100644 index 3eb9892a..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/modular.d.ts +++ /dev/null @@ -1,171 +0,0 @@ -export declare function mod(a: bigint, b: bigint): bigint; -/** - * Efficiently raise num to power and do modular division. - * Unsafe in some contexts: uses ladder, so can expose bigint bits. - * @example - * pow(2n, 6n, 11n) // 64n % 11n == 9n - */ -export declare function pow(num: bigint, power: bigint, modulo: bigint): bigint; -/** Does `x^(2^power)` mod p. `pow2(30, 4)` == `30^(2^4)` */ -export declare function pow2(x: bigint, power: bigint, modulo: bigint): bigint; -/** - * Inverses number over modulo. - * Implemented using [Euclidean GCD](https://brilliant.org/wiki/extended-euclidean-algorithm/). - */ -export declare function invert(number: bigint, modulo: bigint): bigint; -/** - * Tonelli-Shanks square root search algorithm. - * 1. https://eprint.iacr.org/2012/685.pdf (page 12) - * 2. Square Roots from 1; 24, 51, 10 to Dan Shanks - * @param P field order - * @returns function that takes field Fp (created from P) and number n - */ -export declare function tonelliShanks(P: bigint): (Fp: IField, n: T) => T; -/** - * Square root for a finite field. Will try optimized versions first: - * - * 1. P ≡ 3 (mod 4) - * 2. P ≡ 5 (mod 8) - * 3. P ≡ 9 (mod 16) - * 4. Tonelli-Shanks algorithm - * - * Different algorithms can give different roots, it is up to user to decide which one they want. - * For example there is FpSqrtOdd/FpSqrtEven to choice root based on oddness (used for hash-to-curve). - */ -export declare function FpSqrt(P: bigint): (Fp: IField, n: T) => T; -export declare const isNegativeLE: (num: bigint, modulo: bigint) => boolean; -/** Field is not always over prime: for example, Fp2 has ORDER(q)=p^m. */ -export interface IField { - ORDER: bigint; - isLE: boolean; - BYTES: number; - BITS: number; - MASK: bigint; - ZERO: T; - ONE: T; - create: (num: T) => T; - isValid: (num: T) => boolean; - is0: (num: T) => boolean; - isValidNot0: (num: T) => boolean; - neg(num: T): T; - inv(num: T): T; - sqrt(num: T): T; - sqr(num: T): T; - eql(lhs: T, rhs: T): boolean; - add(lhs: T, rhs: T): T; - sub(lhs: T, rhs: T): T; - mul(lhs: T, rhs: T | bigint): T; - pow(lhs: T, power: bigint): T; - div(lhs: T, rhs: T | bigint): T; - addN(lhs: T, rhs: T): T; - subN(lhs: T, rhs: T): T; - mulN(lhs: T, rhs: T | bigint): T; - sqrN(num: T): T; - isOdd?(num: T): boolean; - allowedLengths?: number[]; - invertBatch: (lst: T[]) => T[]; - toBytes(num: T): Uint8Array; - fromBytes(bytes: Uint8Array, skipValidation?: boolean): T; - cmov(a: T, b: T, c: boolean): T; -} -export declare function validateField(field: IField): IField; -/** - * Same as `pow` but for Fp: non-constant-time. - * Unsafe in some contexts: uses ladder, so can expose bigint bits. - */ -export declare function FpPow(Fp: IField, num: T, power: bigint): T; -/** - * Efficiently invert an array of Field elements. - * Exception-free. Will return `undefined` for 0 elements. - * @param passZero map 0 to 0 (instead of undefined) - */ -export declare function FpInvertBatch(Fp: IField, nums: T[], passZero?: boolean): T[]; -export declare function FpDiv(Fp: IField, lhs: T, rhs: T | bigint): T; -/** - * Legendre symbol. - * Legendre constant is used to calculate Legendre symbol (a | p) - * which denotes the value of a^((p-1)/2) (mod p). - * - * * (a | p) ≡ 1 if a is a square (mod p), quadratic residue - * * (a | p) ≡ -1 if a is not a square (mod p), quadratic non residue - * * (a | p) ≡ 0 if a ≡ 0 (mod p) - */ -export declare function FpLegendre(Fp: IField, n: T): -1 | 0 | 1; -export declare function FpIsSquare(Fp: IField, n: T): boolean; -export type NLength = { - nByteLength: number; - nBitLength: number; -}; -export declare function nLength(n: bigint, nBitLength?: number): NLength; -type FpField = IField & Required, 'isOdd'>>; -type SqrtFn = (n: bigint) => bigint; -type FieldOpts = Partial<{ - sqrt: SqrtFn; - isLE: boolean; - BITS: number; - modFromBytes: boolean; - allowedLengths?: readonly number[]; -}>; -/** - * Creates a finite field. Major performance optimizations: - * * 1. Denormalized operations like mulN instead of mul. - * * 2. Identical object shape: never add or remove keys. - * * 3. `Object.freeze`. - * Fragile: always run a benchmark on a change. - * Security note: operations don't check 'isValid' for all elements for performance reasons, - * it is caller responsibility to check this. - * This is low-level code, please make sure you know what you're doing. - * - * Note about field properties: - * * CHARACTERISTIC p = prime number, number of elements in main subgroup. - * * ORDER q = similar to cofactor in curves, may be composite `q = p^m`. - * - * @param ORDER field order, probably prime, or could be composite - * @param bitLen how many bits the field consumes - * @param isLE (default: false) if encoding / decoding should be in little-endian - * @param redef optional faster redefinitions of sqrt and other methods - */ -export declare function Field(ORDER: bigint, bitLenOrOpts?: number | FieldOpts, // TODO: use opts only in v2? -isLE?: boolean, opts?: { - sqrt?: SqrtFn; -}): Readonly; -export declare function FpSqrtOdd(Fp: IField, elm: T): T; -export declare function FpSqrtEven(Fp: IField, elm: T): T; -/** - * "Constant-time" private key generation utility. - * Same as mapKeyToField, but accepts less bytes (40 instead of 48 for 32-byte field). - * Which makes it slightly more biased, less secure. - * @deprecated use `mapKeyToField` instead - */ -export declare function hashToPrivateScalar(hash: string | Uint8Array, groupOrder: bigint, isLE?: boolean): bigint; -/** - * Returns total number of bytes consumed by the field element. - * For example, 32 bytes for usual 256-bit weierstrass curve. - * @param fieldOrder number of field elements, usually CURVE.n - * @returns byte length of field - */ -export declare function getFieldBytesLength(fieldOrder: bigint): number; -/** - * Returns minimal amount of bytes that can be safely reduced - * by field order. - * Should be 2^-128 for 128-bit curve such as P256. - * @param fieldOrder number of field elements, usually CURVE.n - * @returns byte length of target hash - */ -export declare function getMinHashLength(fieldOrder: bigint): number; -/** - * "Constant-time" private key generation utility. - * Can take (n + n/2) or more bytes of uniform input e.g. from CSPRNG or KDF - * and convert them into private scalar, with the modulo bias being negligible. - * Needs at least 48 bytes of input for 32-byte private key. - * https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/ - * FIPS 186-5, A.2 https://csrc.nist.gov/publications/detail/fips/186/5/final - * RFC 9380, https://www.rfc-editor.org/rfc/rfc9380#section-5 - * @param hash hash output from SHA3 or a similar function - * @param groupOrder size of subgroup - (e.g. secp256k1.CURVE.n) - * @param isLE interpret hash bytes as LE num - * @returns valid private scalar - */ -export declare function mapHashToField(key: Uint8Array, fieldOrder: bigint, isLE?: boolean): Uint8Array; -export {}; -//# sourceMappingURL=modular.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/modular.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/abstract/modular.d.ts.map deleted file mode 100644 index 11535353..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/modular.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"modular.d.ts","sourceRoot":"","sources":["../src/abstract/modular.ts"],"names":[],"mappings":"AA0BA,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAGhD;AACD;;;;;GAKG;AACH,wBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED,4DAA4D;AAC5D,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAOrE;AAED;;;GAGG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,M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C;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC,CAAC,CAAC;AACH;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,KAAK,CACnB,KAAK,EAAE,MAAM,EACb,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,EAAE,6BAA6B;AAChE,IAAI,UAAQ,EACZ,IAAI,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GAC3B,QAAQ,CAAC,OAAO,CAAC,CA6FnB;AAgBD,wBAAgB,SAAS,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAIrD;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAItD;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,GAAG,UAAU,EACzB,UAAU,EAAE,MAAM,EAClB,IAAI,UAAQ,GACX,MAAM,CAUR;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAI9D;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAG3D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,UAAQ,GAAG,UAAU,CAW5F"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/modular.js b/tools/mnemonic-test/node_modules/@noble/curves/abstract/modular.js deleted file mode 100644 index e946e3e1..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/modular.js +++ /dev/null @@ -1,554 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.isNegativeLE = void 0; -exports.mod = mod; -exports.pow = pow; -exports.pow2 = pow2; -exports.invert = invert; -exports.tonelliShanks = tonelliShanks; -exports.FpSqrt = FpSqrt; -exports.validateField = validateField; -exports.FpPow = FpPow; -exports.FpInvertBatch = FpInvertBatch; -exports.FpDiv = FpDiv; -exports.FpLegendre = FpLegendre; -exports.FpIsSquare = FpIsSquare; -exports.nLength = nLength; -exports.Field = Field; -exports.FpSqrtOdd = FpSqrtOdd; -exports.FpSqrtEven = FpSqrtEven; -exports.hashToPrivateScalar = hashToPrivateScalar; -exports.getFieldBytesLength = getFieldBytesLength; -exports.getMinHashLength = getMinHashLength; -exports.mapHashToField = mapHashToField; -/** - * Utils for modular division and fields. - * Field over 11 is a finite (Galois) field is integer number operations `mod 11`. - * There is no division: it is replaced by modular multiplicative inverse. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const utils_ts_1 = require("../utils.js"); -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = /* @__PURE__ */ BigInt(2), _3n = /* @__PURE__ */ BigInt(3); -// prettier-ignore -const _4n = /* @__PURE__ */ BigInt(4), _5n = /* @__PURE__ */ BigInt(5), _7n = /* @__PURE__ */ BigInt(7); -// prettier-ignore -const _8n = /* @__PURE__ */ BigInt(8), _9n = /* @__PURE__ */ BigInt(9), _16n = /* @__PURE__ */ BigInt(16); -// Calculates a modulo b -function mod(a, b) { - const result = a % b; - return result >= _0n ? result : b + result; -} -/** - * Efficiently raise num to power and do modular division. - * Unsafe in some contexts: uses ladder, so can expose bigint bits. - * @example - * pow(2n, 6n, 11n) // 64n % 11n == 9n - */ -function pow(num, power, modulo) { - return FpPow(Field(modulo), num, power); -} -/** Does `x^(2^power)` mod p. `pow2(30, 4)` == `30^(2^4)` */ -function pow2(x, power, modulo) { - let res = x; - while (power-- > _0n) { - res *= res; - res %= modulo; - } - return res; -} -/** - * Inverses number over modulo. - * Implemented using [Euclidean GCD](https://brilliant.org/wiki/extended-euclidean-algorithm/). - */ -function invert(number, modulo) { - if (number === _0n) - throw new Error('invert: expected non-zero number'); - if (modulo <= _0n) - throw new Error('invert: expected positive modulus, got ' + modulo); - // Fermat's little theorem "CT-like" version inv(n) = n^(m-2) mod m is 30x slower. - let a = mod(number, modulo); - let b = modulo; - // prettier-ignore - let x = _0n, y = _1n, u = _1n, v = _0n; - while (a !== _0n) { - // JIT applies optimization if those two lines follow each other - const q = b / a; - const r = b % a; - const m = x - u * q; - const n = y - v * q; - // prettier-ignore - b = a, a = r, x = u, y = v, u = m, v = n; - } - const gcd = b; - if (gcd !== _1n) - throw new Error('invert: does not exist'); - return mod(x, modulo); -} -function assertIsSquare(Fp, root, n) { - if (!Fp.eql(Fp.sqr(root), n)) - throw new Error('Cannot find square root'); -} -// Not all roots are possible! Example which will throw: -// const NUM = -// n = 72057594037927816n; -// Fp = Field(BigInt('0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab')); -function sqrt3mod4(Fp, n) { - const p1div4 = (Fp.ORDER + _1n) / _4n; - const root = Fp.pow(n, p1div4); - assertIsSquare(Fp, root, n); - return root; -} -function sqrt5mod8(Fp, n) { - const p5div8 = (Fp.ORDER - _5n) / _8n; - const n2 = Fp.mul(n, _2n); - const v = Fp.pow(n2, p5div8); - const nv = Fp.mul(n, v); - const i = Fp.mul(Fp.mul(nv, _2n), v); - const root = Fp.mul(nv, Fp.sub(i, Fp.ONE)); - assertIsSquare(Fp, root, n); - return root; -} -// Based on RFC9380, Kong algorithm -// prettier-ignore -function sqrt9mod16(P) { - const Fp_ = Field(P); - const tn = tonelliShanks(P); - const c1 = tn(Fp_, Fp_.neg(Fp_.ONE)); // 1. c1 = sqrt(-1) in F, i.e., (c1^2) == -1 in F - const c2 = tn(Fp_, c1); // 2. c2 = sqrt(c1) in F, i.e., (c2^2) == c1 in F - const c3 = tn(Fp_, Fp_.neg(c1)); // 3. c3 = sqrt(-c1) in F, i.e., (c3^2) == -c1 in F - const c4 = (P + _7n) / _16n; // 4. c4 = (q + 7) / 16 # Integer arithmetic - return (Fp, n) => { - let tv1 = Fp.pow(n, c4); // 1. tv1 = x^c4 - let tv2 = Fp.mul(tv1, c1); // 2. tv2 = c1 * tv1 - const tv3 = Fp.mul(tv1, c2); // 3. tv3 = c2 * tv1 - const tv4 = Fp.mul(tv1, c3); // 4. tv4 = c3 * tv1 - const e1 = Fp.eql(Fp.sqr(tv2), n); // 5. e1 = (tv2^2) == x - const e2 = Fp.eql(Fp.sqr(tv3), n); // 6. e2 = (tv3^2) == x - tv1 = Fp.cmov(tv1, tv2, e1); // 7. tv1 = CMOV(tv1, tv2, e1) # Select tv2 if (tv2^2) == x - tv2 = Fp.cmov(tv4, tv3, e2); // 8. tv2 = CMOV(tv4, tv3, e2) # Select tv3 if (tv3^2) == x - const e3 = Fp.eql(Fp.sqr(tv2), n); // 9. e3 = (tv2^2) == x - const root = Fp.cmov(tv1, tv2, e3); // 10. z = CMOV(tv1, tv2, e3) # Select sqrt from tv1 & tv2 - assertIsSquare(Fp, root, n); - return root; - }; -} -/** - * Tonelli-Shanks square root search algorithm. - * 1. https://eprint.iacr.org/2012/685.pdf (page 12) - * 2. Square Roots from 1; 24, 51, 10 to Dan Shanks - * @param P field order - * @returns function that takes field Fp (created from P) and number n - */ -function tonelliShanks(P) { - // Initialization (precomputation). - // Caching initialization could boost perf by 7%. - if (P < _3n) - throw new Error('sqrt is not defined for small field'); - // Factor P - 1 = Q * 2^S, where Q is odd - let Q = P - _1n; - let S = 0; - while (Q % _2n === _0n) { - Q /= _2n; - S++; - } - // Find the first quadratic non-residue Z >= 2 - let Z = _2n; - const _Fp = Field(P); - while (FpLegendre(_Fp, Z) === 1) { - // Basic primality test for P. After x iterations, chance of - // not finding quadratic non-residue is 2^x, so 2^1000. - if (Z++ > 1000) - throw new Error('Cannot find square root: probably non-prime P'); - } - // Fast-path; usually done before Z, but we do "primality test". - if (S === 1) - return sqrt3mod4; - // Slow-path - // TODO: test on Fp2 and others - let cc = _Fp.pow(Z, Q); // c = z^Q - const Q1div2 = (Q + _1n) / _2n; - return function tonelliSlow(Fp, n) { - if (Fp.is0(n)) - return n; - // Check if n is a quadratic residue using Legendre symbol - if (FpLegendre(Fp, n) !== 1) - throw new Error('Cannot find square root'); - // Initialize variables for the main loop - let M = S; - let c = Fp.mul(Fp.ONE, cc); // c = z^Q, move cc from field _Fp into field Fp - let t = Fp.pow(n, Q); // t = n^Q, first guess at the fudge factor - let R = Fp.pow(n, Q1div2); // R = n^((Q+1)/2), first guess at the square root - // Main loop - // while t != 1 - while (!Fp.eql(t, Fp.ONE)) { - if (Fp.is0(t)) - return Fp.ZERO; // if t=0 return R=0 - let i = 1; - // Find the smallest i >= 1 such that t^(2^i) ≡ 1 (mod P) - let t_tmp = Fp.sqr(t); // t^(2^1) - while (!Fp.eql(t_tmp, Fp.ONE)) { - i++; - t_tmp = Fp.sqr(t_tmp); // t^(2^2)... - if (i === M) - throw new Error('Cannot find square root'); - } - // Calculate the exponent for b: 2^(M - i - 1) - const exponent = _1n << BigInt(M - i - 1); // bigint is important - const b = Fp.pow(c, exponent); // b = 2^(M - i - 1) - // Update variables - M = i; - c = Fp.sqr(b); // c = b^2 - t = Fp.mul(t, c); // t = (t * b^2) - R = Fp.mul(R, b); // R = R*b - } - return R; - }; -} -/** - * Square root for a finite field. Will try optimized versions first: - * - * 1. P ≡ 3 (mod 4) - * 2. P ≡ 5 (mod 8) - * 3. P ≡ 9 (mod 16) - * 4. Tonelli-Shanks algorithm - * - * Different algorithms can give different roots, it is up to user to decide which one they want. - * For example there is FpSqrtOdd/FpSqrtEven to choice root based on oddness (used for hash-to-curve). - */ -function FpSqrt(P) { - // P ≡ 3 (mod 4) => √n = n^((P+1)/4) - if (P % _4n === _3n) - return sqrt3mod4; - // P ≡ 5 (mod 8) => Atkin algorithm, page 10 of https://eprint.iacr.org/2012/685.pdf - if (P % _8n === _5n) - return sqrt5mod8; - // P ≡ 9 (mod 16) => Kong algorithm, page 11 of https://eprint.iacr.org/2012/685.pdf (algorithm 4) - if (P % _16n === _9n) - return sqrt9mod16(P); - // Tonelli-Shanks algorithm - return tonelliShanks(P); -} -// Little-endian check for first LE bit (last BE bit); -const isNegativeLE = (num, modulo) => (mod(num, modulo) & _1n) === _1n; -exports.isNegativeLE = isNegativeLE; -// prettier-ignore -const FIELD_FIELDS = [ - 'create', 'isValid', 'is0', 'neg', 'inv', 'sqrt', 'sqr', - 'eql', 'add', 'sub', 'mul', 'pow', 'div', - 'addN', 'subN', 'mulN', 'sqrN' -]; -function validateField(field) { - const initial = { - ORDER: 'bigint', - MASK: 'bigint', - BYTES: 'number', - BITS: 'number', - }; - const opts = FIELD_FIELDS.reduce((map, val) => { - map[val] = 'function'; - return map; - }, initial); - (0, utils_ts_1._validateObject)(field, opts); - // const max = 16384; - // if (field.BYTES < 1 || field.BYTES > max) throw new Error('invalid field'); - // if (field.BITS < 1 || field.BITS > 8 * max) throw new Error('invalid field'); - return field; -} -// Generic field functions -/** - * Same as `pow` but for Fp: non-constant-time. - * Unsafe in some contexts: uses ladder, so can expose bigint bits. - */ -function FpPow(Fp, num, power) { - if (power < _0n) - throw new Error('invalid exponent, negatives unsupported'); - if (power === _0n) - return Fp.ONE; - if (power === _1n) - return num; - let p = Fp.ONE; - let d = num; - while (power > _0n) { - if (power & _1n) - p = Fp.mul(p, d); - d = Fp.sqr(d); - power >>= _1n; - } - return p; -} -/** - * Efficiently invert an array of Field elements. - * Exception-free. Will return `undefined` for 0 elements. - * @param passZero map 0 to 0 (instead of undefined) - */ -function FpInvertBatch(Fp, nums, passZero = false) { - const inverted = new Array(nums.length).fill(passZero ? Fp.ZERO : undefined); - // Walk from first to last, multiply them by each other MOD p - const multipliedAcc = nums.reduce((acc, num, i) => { - if (Fp.is0(num)) - return acc; - inverted[i] = acc; - return Fp.mul(acc, num); - }, Fp.ONE); - // Invert last element - const invertedAcc = Fp.inv(multipliedAcc); - // Walk from last to first, multiply them by inverted each other MOD p - nums.reduceRight((acc, num, i) => { - if (Fp.is0(num)) - return acc; - inverted[i] = Fp.mul(acc, inverted[i]); - return Fp.mul(acc, num); - }, invertedAcc); - return inverted; -} -// TODO: remove -function FpDiv(Fp, lhs, rhs) { - return Fp.mul(lhs, typeof rhs === 'bigint' ? invert(rhs, Fp.ORDER) : Fp.inv(rhs)); -} -/** - * Legendre symbol. - * Legendre constant is used to calculate Legendre symbol (a | p) - * which denotes the value of a^((p-1)/2) (mod p). - * - * * (a | p) ≡ 1 if a is a square (mod p), quadratic residue - * * (a | p) ≡ -1 if a is not a square (mod p), quadratic non residue - * * (a | p) ≡ 0 if a ≡ 0 (mod p) - */ -function FpLegendre(Fp, n) { - // We can use 3rd argument as optional cache of this value - // but seems unneeded for now. The operation is very fast. - const p1mod2 = (Fp.ORDER - _1n) / _2n; - const powered = Fp.pow(n, p1mod2); - const yes = Fp.eql(powered, Fp.ONE); - const zero = Fp.eql(powered, Fp.ZERO); - const no = Fp.eql(powered, Fp.neg(Fp.ONE)); - if (!yes && !zero && !no) - throw new Error('invalid Legendre symbol result'); - return yes ? 1 : zero ? 0 : -1; -} -// This function returns True whenever the value x is a square in the field F. -function FpIsSquare(Fp, n) { - const l = FpLegendre(Fp, n); - return l === 1; -} -// CURVE.n lengths -function nLength(n, nBitLength) { - // Bit size, byte size of CURVE.n - if (nBitLength !== undefined) - (0, utils_ts_1.anumber)(nBitLength); - const _nBitLength = nBitLength !== undefined ? nBitLength : n.toString(2).length; - const nByteLength = Math.ceil(_nBitLength / 8); - return { nBitLength: _nBitLength, nByteLength }; -} -/** - * Creates a finite field. Major performance optimizations: - * * 1. Denormalized operations like mulN instead of mul. - * * 2. Identical object shape: never add or remove keys. - * * 3. `Object.freeze`. - * Fragile: always run a benchmark on a change. - * Security note: operations don't check 'isValid' for all elements for performance reasons, - * it is caller responsibility to check this. - * This is low-level code, please make sure you know what you're doing. - * - * Note about field properties: - * * CHARACTERISTIC p = prime number, number of elements in main subgroup. - * * ORDER q = similar to cofactor in curves, may be composite `q = p^m`. - * - * @param ORDER field order, probably prime, or could be composite - * @param bitLen how many bits the field consumes - * @param isLE (default: false) if encoding / decoding should be in little-endian - * @param redef optional faster redefinitions of sqrt and other methods - */ -function Field(ORDER, bitLenOrOpts, // TODO: use opts only in v2? -isLE = false, opts = {}) { - if (ORDER <= _0n) - throw new Error('invalid field: expected ORDER > 0, got ' + ORDER); - let _nbitLength = undefined; - let _sqrt = undefined; - let modFromBytes = false; - let allowedLengths = undefined; - if (typeof bitLenOrOpts === 'object' && bitLenOrOpts != null) { - if (opts.sqrt || isLE) - throw new Error('cannot specify opts in two arguments'); - const _opts = bitLenOrOpts; - if (_opts.BITS) - _nbitLength = _opts.BITS; - if (_opts.sqrt) - _sqrt = _opts.sqrt; - if (typeof _opts.isLE === 'boolean') - isLE = _opts.isLE; - if (typeof _opts.modFromBytes === 'boolean') - modFromBytes = _opts.modFromBytes; - allowedLengths = _opts.allowedLengths; - } - else { - if (typeof bitLenOrOpts === 'number') - _nbitLength = bitLenOrOpts; - if (opts.sqrt) - _sqrt = opts.sqrt; - } - const { nBitLength: BITS, nByteLength: BYTES } = nLength(ORDER, _nbitLength); - if (BYTES > 2048) - throw new Error('invalid field: expected ORDER of <= 2048 bytes'); - let sqrtP; // cached sqrtP - const f = Object.freeze({ - ORDER, - isLE, - BITS, - BYTES, - MASK: (0, utils_ts_1.bitMask)(BITS), - ZERO: _0n, - ONE: _1n, - allowedLengths: allowedLengths, - create: (num) => mod(num, ORDER), - isValid: (num) => { - if (typeof num !== 'bigint') - throw new Error('invalid field element: expected bigint, got ' + typeof num); - return _0n <= num && num < ORDER; // 0 is valid element, but it's not invertible - }, - is0: (num) => num === _0n, - // is valid and invertible - isValidNot0: (num) => !f.is0(num) && f.isValid(num), - isOdd: (num) => (num & _1n) === _1n, - neg: (num) => mod(-num, ORDER), - eql: (lhs, rhs) => lhs === rhs, - sqr: (num) => mod(num * num, ORDER), - add: (lhs, rhs) => mod(lhs + rhs, ORDER), - sub: (lhs, rhs) => mod(lhs - rhs, ORDER), - mul: (lhs, rhs) => mod(lhs * rhs, ORDER), - pow: (num, power) => FpPow(f, num, power), - div: (lhs, rhs) => mod(lhs * invert(rhs, ORDER), ORDER), - // Same as above, but doesn't normalize - sqrN: (num) => num * num, - addN: (lhs, rhs) => lhs + rhs, - subN: (lhs, rhs) => lhs - rhs, - mulN: (lhs, rhs) => lhs * rhs, - inv: (num) => invert(num, ORDER), - sqrt: _sqrt || - ((n) => { - if (!sqrtP) - sqrtP = FpSqrt(ORDER); - return sqrtP(f, n); - }), - toBytes: (num) => (isLE ? (0, utils_ts_1.numberToBytesLE)(num, BYTES) : (0, utils_ts_1.numberToBytesBE)(num, BYTES)), - fromBytes: (bytes, skipValidation = true) => { - if (allowedLengths) { - if (!allowedLengths.includes(bytes.length) || bytes.length > BYTES) { - throw new Error('Field.fromBytes: expected ' + allowedLengths + ' bytes, got ' + bytes.length); - } - const padded = new Uint8Array(BYTES); - // isLE add 0 to right, !isLE to the left. - padded.set(bytes, isLE ? 0 : padded.length - bytes.length); - bytes = padded; - } - if (bytes.length !== BYTES) - throw new Error('Field.fromBytes: expected ' + BYTES + ' bytes, got ' + bytes.length); - let scalar = isLE ? (0, utils_ts_1.bytesToNumberLE)(bytes) : (0, utils_ts_1.bytesToNumberBE)(bytes); - if (modFromBytes) - scalar = mod(scalar, ORDER); - if (!skipValidation) - if (!f.isValid(scalar)) - throw new Error('invalid field element: outside of range 0..ORDER'); - // NOTE: we don't validate scalar here, please use isValid. This done such way because some - // protocol may allow non-reduced scalar that reduced later or changed some other way. - return scalar; - }, - // TODO: we don't need it here, move out to separate fn - invertBatch: (lst) => FpInvertBatch(f, lst), - // We can't move this out because Fp6, Fp12 implement it - // and it's unclear what to return in there. - cmov: (a, b, c) => (c ? b : a), - }); - return Object.freeze(f); -} -// Generic random scalar, we can do same for other fields if via Fp2.mul(Fp2.ONE, Fp2.random)? -// This allows unsafe methods like ignore bias or zero. These unsafe, but often used in different protocols (if deterministic RNG). -// which mean we cannot force this via opts. -// Not sure what to do with randomBytes, we can accept it inside opts if wanted. -// Probably need to export getMinHashLength somewhere? -// random(bytes?: Uint8Array, unsafeAllowZero = false, unsafeAllowBias = false) { -// const LEN = !unsafeAllowBias ? getMinHashLength(ORDER) : BYTES; -// if (bytes === undefined) bytes = randomBytes(LEN); // _opts.randomBytes? -// const num = isLE ? bytesToNumberLE(bytes) : bytesToNumberBE(bytes); -// // `mod(x, 11)` can sometimes produce 0. `mod(x, 10) + 1` is the same, but no 0 -// const reduced = unsafeAllowZero ? mod(num, ORDER) : mod(num, ORDER - _1n) + _1n; -// return reduced; -// }, -function FpSqrtOdd(Fp, elm) { - if (!Fp.isOdd) - throw new Error("Field doesn't have isOdd"); - const root = Fp.sqrt(elm); - return Fp.isOdd(root) ? root : Fp.neg(root); -} -function FpSqrtEven(Fp, elm) { - if (!Fp.isOdd) - throw new Error("Field doesn't have isOdd"); - const root = Fp.sqrt(elm); - return Fp.isOdd(root) ? Fp.neg(root) : root; -} -/** - * "Constant-time" private key generation utility. - * Same as mapKeyToField, but accepts less bytes (40 instead of 48 for 32-byte field). - * Which makes it slightly more biased, less secure. - * @deprecated use `mapKeyToField` instead - */ -function hashToPrivateScalar(hash, groupOrder, isLE = false) { - hash = (0, utils_ts_1.ensureBytes)('privateHash', hash); - const hashLen = hash.length; - const minLen = nLength(groupOrder).nByteLength + 8; - if (minLen < 24 || hashLen < minLen || hashLen > 1024) - throw new Error('hashToPrivateScalar: expected ' + minLen + '-1024 bytes of input, got ' + hashLen); - const num = isLE ? (0, utils_ts_1.bytesToNumberLE)(hash) : (0, utils_ts_1.bytesToNumberBE)(hash); - return mod(num, groupOrder - _1n) + _1n; -} -/** - * Returns total number of bytes consumed by the field element. - * For example, 32 bytes for usual 256-bit weierstrass curve. - * @param fieldOrder number of field elements, usually CURVE.n - * @returns byte length of field - */ -function getFieldBytesLength(fieldOrder) { - if (typeof fieldOrder !== 'bigint') - throw new Error('field order must be bigint'); - const bitLength = fieldOrder.toString(2).length; - return Math.ceil(bitLength / 8); -} -/** - * Returns minimal amount of bytes that can be safely reduced - * by field order. - * Should be 2^-128 for 128-bit curve such as P256. - * @param fieldOrder number of field elements, usually CURVE.n - * @returns byte length of target hash - */ -function getMinHashLength(fieldOrder) { - const length = getFieldBytesLength(fieldOrder); - return length + Math.ceil(length / 2); -} -/** - * "Constant-time" private key generation utility. - * Can take (n + n/2) or more bytes of uniform input e.g. from CSPRNG or KDF - * and convert them into private scalar, with the modulo bias being negligible. - * Needs at least 48 bytes of input for 32-byte private key. - * https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/ - * FIPS 186-5, A.2 https://csrc.nist.gov/publications/detail/fips/186/5/final - * RFC 9380, https://www.rfc-editor.org/rfc/rfc9380#section-5 - * @param hash hash output from SHA3 or a similar function - * @param groupOrder size of subgroup - (e.g. secp256k1.CURVE.n) - * @param isLE interpret hash bytes as LE num - * @returns valid private scalar - */ -function mapHashToField(key, fieldOrder, isLE = false) { - const len = key.length; - const fieldLen = getFieldBytesLength(fieldOrder); - const minLen = getMinHashLength(fieldOrder); - // No small numbers: need to understand bias story. No huge numbers: easier to detect JS timings. - if (len < 16 || len < minLen || len > 1024) - throw new Error('expected ' + minLen + '-1024 bytes of input, got ' + len); - const num = isLE ? (0, utils_ts_1.bytesToNumberLE)(key) : (0, utils_ts_1.bytesToNumberBE)(key); - // `mod(x, 11)` can sometimes produce 0. `mod(x, 10) + 1` is the same, but no 0 - const reduced = mod(num, fieldOrder - _1n) + _1n; - return isLE ? (0, utils_ts_1.numberToBytesLE)(reduced, fieldLen) : (0, utils_ts_1.numberToBytesBE)(reduced, fieldLen); -} -//# sourceMappingURL=modular.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/modular.js.map b/tools/mnemonic-test/node_modules/@noble/curves/abstract/modular.js.map deleted file mode 100644 index f7361eba..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/modular.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"modular.js","sourceRoot":"","sources":["../src/abstract/modular.ts"],"names":[],"mappings":";;;AA0BA,kBAGC;AAOD,kBAEC;AAGD,oBAOC;AAMD,wBAoBC;AA4DD,sCAgEC;AAaD,wBASC;AAwDD,sCAgBC;AAQD,sBAYC;AAOD,sCAiBC;AAGD,sBAEC;AAWD,gCAUC;AAGD,gCAGC;AAID,0BAMC;AA8BD,sBAkGC;AAgBD,8BAIC;AAED,gCAIC;AAQD,kDAcC;AAQD,kDAIC;AASD,4CAGC;AAeD,wCAWC;AA5lBD;;;;;GAKG;AACH,sEAAsE;AACtE,0CASqB;AAErB,kBAAkB;AAClB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACzG,kBAAkB;AAClB,MAAM,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACxG,kBAAkB;AAClB,MAAM,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,GAAG,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAE1G,wBAAwB;AACxB,SAAgB,GAAG,CAAC,CAAS,EAAE,CAAS;IACtC,MAAM,MAAM,GAAG,CAA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AC,MAAM,CAAC;IACvB,MAAM,QAAQ,GAAG,mBAAmB,CAAC,UAAU,CAAC,CAAC;IACjD,MAAM,MAAM,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC;IAC5C,iGAAiG;IACjG,IAAI,GAAG,GAAG,EAAE,IAAI,GAAG,GAAG,MAAM,IAAI,GAAG,GAAG,IAAI;QACxC,MAAM,IAAI,KAAK,CAAC,WAAW,GAAG,MAAM,GAAG,4BAA4B,GAAG,GAAG,CAAC,CAAC;IAC7E,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,IAAA,0BAAe,EAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAA,0BAAe,EAAC,GAAG,CAAC,CAAC;IAC/D,+EAA+E;IAC/E,MAAM,OAAO,GAAG,GAAG,CAAC,GAAG,EAAE,UAAU,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;IACjD,OAAO,IAAI,CAAC,CAAC,CAAC,IAAA,0BAAe,EAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAA,0BAAe,EAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AACxF,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/montgomery.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/abstract/montgomery.d.ts deleted file mode 100644 index 7615c2a8..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/montgomery.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type { CurveLengths } from './curve.ts'; -type Hex = string | Uint8Array; -export type CurveType = { - P: bigint; - type: 'x25519' | 'x448'; - adjustScalarBytes: (bytes: Uint8Array) => Uint8Array; - powPminus2: (x: bigint) => bigint; - randomBytes?: (bytesLength?: number) => Uint8Array; -}; -export type MontgomeryECDH = { - scalarMult: (scalar: Hex, u: Hex) => Uint8Array; - scalarMultBase: (scalar: Hex) => Uint8Array; - getSharedSecret: (secretKeyA: Hex, publicKeyB: Hex) => Uint8Array; - getPublicKey: (secretKey: Hex) => Uint8Array; - utils: { - randomSecretKey: () => Uint8Array; - /** @deprecated use `randomSecretKey` */ - randomPrivateKey: () => Uint8Array; - }; - GuBytes: Uint8Array; - lengths: CurveLengths; - keygen: (seed?: Uint8Array) => { - secretKey: Uint8Array; - publicKey: Uint8Array; - }; -}; -export type CurveFn = MontgomeryECDH; -export declare function montgomery(curveDef: CurveType): MontgomeryECDH; -export {}; -//# sourceMappingURL=montgomery.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/montgomery.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/abstract/montgomery.d.ts.map deleted file mode 100644 index 9ae77eff..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/montgomery.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"montgomery.d.ts","sourceRoot":"","sources":["../src/abstract/montgomery.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAM/C,KAAK,GAAG,GAAG,MAAM,GAAG,UAAU,CAAC;AAE/B,MAAM,MAAM,SAAS,GAAG;IACtB,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC;IACxB,iBAAiB,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,UAAU,CAAC;IACrD,UAAU,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAClC,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,EAAE,MAAM,KAAK,UAAU,CAAC;CACpD,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,KAAK,UAAU,CAAC;IAChD,cAAc,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,UAAU,CAAC;IAC5C,eAAe,EAAE,CAAC,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,KAAK,UAAU,CAAC;IAClE,YAAY,EAAE,CAAC,SAAS,EAAE,GAAG,KAAK,UAAU,CAAC;IAC7C,KAAK,EAAE;QACL,eAAe,EAAE,MAAM,UAAU,CAAC;QAClC,wCAAwC;QACxC,gBAAgB,EAAE,MAAM,UAAU,CAAC;KACpC,CAAC;IACF,OAAO,EAAE,UAAU,CAAC;IACpB,OAAO,EAAE,YAAY,CAAC;IACtB,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,UAAU,KAAK;QAAE,SAAS,EAAE,UAAU,CAAC;QAAC,SAAS,EAAE,UAAU,CAAA;KAAE,CAAC;CACjF,CAAC;AACF,MAAM,MAAM,OAAO,GAAG,cAAc,CAAC;AAUrC,wBAAgB,UAAU,CAAC,QAAQ,EAAE,SAAS,GAAG,cAAc,CAyI9D"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/montgomery.js b/tools/mnemonic-test/node_modules/@noble/curves/abstract/montgomery.js deleted file mode 100644 index 9fb6e18a..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/montgomery.js +++ /dev/null @@ -1,160 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.montgomery = montgomery; -/** - * Montgomery curve methods. It's not really whole montgomery curve, - * just bunch of very specific methods for X25519 / X448 from - * [RFC 7748](https://www.rfc-editor.org/rfc/rfc7748) - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const utils_ts_1 = require("../utils.js"); -const modular_ts_1 = require("./modular.js"); -const _0n = BigInt(0); -const _1n = BigInt(1); -const _2n = BigInt(2); -function validateOpts(curve) { - (0, utils_ts_1._validateObject)(curve, { - adjustScalarBytes: 'function', - powPminus2: 'function', - }); - return Object.freeze({ ...curve }); -} -function montgomery(curveDef) { - const CURVE = validateOpts(curveDef); - const { P, type, adjustScalarBytes, powPminus2, randomBytes: rand } = CURVE; - const is25519 = type === 'x25519'; - if (!is25519 && type !== 'x448') - throw new Error('invalid type'); - const randomBytes_ = rand || utils_ts_1.randomBytes; - const montgomeryBits = is25519 ? 255 : 448; - const fieldLen = is25519 ? 32 : 56; - const Gu = is25519 ? BigInt(9) : BigInt(5); - // RFC 7748 #5: - // The constant a24 is (486662 - 2) / 4 = 121665 for curve25519/X25519 and - // (156326 - 2) / 4 = 39081 for curve448/X448 - // const a = is25519 ? 156326n : 486662n; - const a24 = is25519 ? BigInt(121665) : BigInt(39081); - // RFC: x25519 "the resulting integer is of the form 2^254 plus - // eight times a value between 0 and 2^251 - 1 (inclusive)" - // x448: "2^447 plus four times a value between 0 and 2^445 - 1 (inclusive)" - const minScalar = is25519 ? _2n ** BigInt(254) : _2n ** BigInt(447); - const maxAdded = is25519 - ? BigInt(8) * _2n ** BigInt(251) - _1n - : BigInt(4) * _2n ** BigInt(445) - _1n; - const maxScalar = minScalar + maxAdded + _1n; // (inclusive) - const modP = (n) => (0, modular_ts_1.mod)(n, P); - const GuBytes = encodeU(Gu); - function encodeU(u) { - return (0, utils_ts_1.numberToBytesLE)(modP(u), fieldLen); - } - function decodeU(u) { - const _u = (0, utils_ts_1.ensureBytes)('u coordinate', u, fieldLen); - // RFC: When receiving such an array, implementations of X25519 - // (but not X448) MUST mask the most significant bit in the final byte. - if (is25519) - _u[31] &= 127; // 0b0111_1111 - // RFC: Implementations MUST accept non-canonical values and process them as - // if they had been reduced modulo the field prime. The non-canonical - // values are 2^255 - 19 through 2^255 - 1 for X25519 and 2^448 - 2^224 - // - 1 through 2^448 - 1 for X448. - return modP((0, utils_ts_1.bytesToNumberLE)(_u)); - } - function decodeScalar(scalar) { - return (0, utils_ts_1.bytesToNumberLE)(adjustScalarBytes((0, utils_ts_1.ensureBytes)('scalar', scalar, fieldLen))); - } - function scalarMult(scalar, u) { - const pu = montgomeryLadder(decodeU(u), decodeScalar(scalar)); - // Some public keys are useless, of low-order. Curve author doesn't think - // it needs to be validated, but we do it nonetheless. - // https://cr.yp.to/ecdh.html#validate - if (pu === _0n) - throw new Error('invalid private or public key received'); - return encodeU(pu); - } - // Computes public key from private. By doing scalar multiplication of base point. - function scalarMultBase(scalar) { - return scalarMult(scalar, GuBytes); - } - // cswap from RFC7748 "example code" - function cswap(swap, x_2, x_3) { - // dummy = mask(swap) AND (x_2 XOR x_3) - // Where mask(swap) is the all-1 or all-0 word of the same length as x_2 - // and x_3, computed, e.g., as mask(swap) = 0 - swap. - const dummy = modP(swap * (x_2 - x_3)); - x_2 = modP(x_2 - dummy); // x_2 = x_2 XOR dummy - x_3 = modP(x_3 + dummy); // x_3 = x_3 XOR dummy - return { x_2, x_3 }; - } - /** - * Montgomery x-only multiplication ladder. - * @param pointU u coordinate (x) on Montgomery Curve 25519 - * @param scalar by which the point would be multiplied - * @returns new Point on Montgomery curve - */ - function montgomeryLadder(u, scalar) { - (0, utils_ts_1.aInRange)('u', u, _0n, P); - (0, utils_ts_1.aInRange)('scalar', scalar, minScalar, maxScalar); - const k = scalar; - const x_1 = u; - let x_2 = _1n; - let z_2 = _0n; - let x_3 = u; - let z_3 = _1n; - let swap = _0n; - for (let t = BigInt(montgomeryBits - 1); t >= _0n; t--) { - const k_t = (k >> t) & _1n; - swap ^= k_t; - ({ x_2, x_3 } = cswap(swap, x_2, x_3)); - ({ x_2: z_2, x_3: z_3 } = cswap(swap, z_2, z_3)); - swap = k_t; - const A = x_2 + z_2; - const AA = modP(A * A); - const B = x_2 - z_2; - const BB = modP(B * B); - const E = AA - BB; - const C = x_3 + z_3; - const D = x_3 - z_3; - const DA = modP(D * A); - const CB = modP(C * B); - const dacb = DA + CB; - const da_cb = DA - CB; - x_3 = modP(dacb * dacb); - z_3 = modP(x_1 * modP(da_cb * da_cb)); - x_2 = modP(AA * BB); - z_2 = modP(E * (AA + modP(a24 * E))); - } - ({ x_2, x_3 } = cswap(swap, x_2, x_3)); - ({ x_2: z_2, x_3: z_3 } = cswap(swap, z_2, z_3)); - const z2 = powPminus2(z_2); // `Fp.pow(x, P - _2n)` is much slower equivalent - return modP(x_2 * z2); // Return x_2 * (z_2^(p - 2)) - } - const lengths = { - secretKey: fieldLen, - publicKey: fieldLen, - seed: fieldLen, - }; - const randomSecretKey = (seed = randomBytes_(fieldLen)) => { - (0, utils_ts_1.abytes)(seed, lengths.seed); - return seed; - }; - function keygen(seed) { - const secretKey = randomSecretKey(seed); - return { secretKey, publicKey: scalarMultBase(secretKey) }; - } - const utils = { - randomSecretKey, - randomPrivateKey: randomSecretKey, - }; - return { - keygen, - getSharedSecret: (secretKey, publicKey) => scalarMult(secretKey, publicKey), - getPublicKey: (secretKey) => scalarMultBase(secretKey), - scalarMult, - scalarMultBase, - utils, - GuBytes: GuBytes.slice(), - lengths, - }; -} -//# sourceMappingURL=montgomery.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/montgomery.js.map b/tools/mnemonic-test/node_modules/@noble/curves/abstract/montgomery.js.map deleted file mode 100644 index 4e568e6a..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/montgomery.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"montgomery.js","sourceRoot":"","sources":["../src/abstract/montgomery.ts"],"names":[],"mappings":";;AAwDA,gCAyIC;AAjMD;;;;;GAKG;AACH,sEAAsE;AACtE,0CAQqB;AAErB,6CAAmC;AAEnC,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AA2BtB,SAAS,YAAY,CAAC,KAAgB;IACpC,IAAA,0BAAe,EAAC,KAAK,EAAE;QACrB,iBAAiB,EAAE,UAAU;QAC7B,UAAU,EAAE,UAAU;KACvB,CAAC,CAAC;IACH,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,EAAW,CAAC,CAAC;AAC9C,CAAC;AAED,SAAgB,UAAU,CAAC,QAAm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ules/@noble/curves/abstract/poseidon.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/abstract/poseidon.d.ts deleted file mode 100644 index e0684efc..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/poseidon.d.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { type IField } from './modular.ts'; -export type PoseidonBasicOpts = { - Fp: IField; - t: number; - roundsFull: number; - roundsPartial: number; - isSboxInverse?: boolean; -}; -export type PoseidonGrainOpts = PoseidonBasicOpts & { - sboxPower?: number; -}; -type PoseidonConstants = { - mds: bigint[][]; - roundConstants: bigint[][]; -}; -export declare function grainGenConstants(opts: PoseidonGrainOpts, skipMDS?: number): PoseidonConstants; -export type PoseidonOpts = PoseidonBasicOpts & PoseidonConstants & { - sboxPower?: number; - reversePartialPowIdx?: boolean; -}; -export declare function validateOpts(opts: PoseidonOpts): Readonly<{ - rounds: number; - sboxFn: (n: bigint) => bigint; - roundConstants: bigint[][]; - mds: bigint[][]; - Fp: IField; - t: number; - roundsFull: number; - roundsPartial: number; - sboxPower?: number; - reversePartialPowIdx?: boolean; -}>; -export declare function splitConstants(rc: bigint[], t: number): bigint[][]; -export type PoseidonFn = { - (values: bigint[]): bigint[]; - roundConstants: bigint[][]; -}; -/** Poseidon NTT-friendly hash. */ -export declare function poseidon(opts: PoseidonOpts): PoseidonFn; -export declare class PoseidonSponge { - private Fp; - readonly rate: number; - readonly capacity: number; - readonly hash: PoseidonFn; - private state; - private pos; - private isAbsorbing; - constructor(Fp: IField, rate: number, capacity: number, hash: PoseidonFn); - private process; - absorb(input: bigint[]): void; - squeeze(count: number): bigint[]; - clean(): void; - clone(): PoseidonSponge; -} -export type PoseidonSpongeOpts = Omit & { - rate: number; - capacity: number; -}; -/** - * The method is not defined in spec, but nevertheless used often. - * Check carefully for compatibility: there are many edge cases, like absorbing an empty array. - * We cross-test against: - * - https://github.com/ProvableHQ/snarkVM/tree/staging/algorithms - * - https://github.com/arkworks-rs/crypto-primitives/tree/main - */ -export declare function poseidonSponge(opts: PoseidonSpongeOpts): () => PoseidonSponge; -export {}; -//# sourceMappingURL=poseidon.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/poseidon.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/abstract/poseidon.d.ts.map deleted file mode 100644 index 283df155..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/poseidon.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"poseidon.d.ts","sourceRoot":"","sources":["../src/abstract/poseidon.ts"],"names":[],"mappings":"AAUA,OAAO,EAAwB,KAAK,MAAM,EAAiB,MAAM,cAAc,CAAC;AAyBhF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACnB,CAAC,EAAE,MAAM,CAAC;IACV,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AA0DF,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,GAAG;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,KAAK,iBAAiB,GAAG;IAAE,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC;IAAC,cAAc,EAAE,MAAM,EAAE,EAAE,CAAA;CAAE,CAAC;AAIzE,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,EAAE,OAAO,GAAE,MAAU,GAAG,iBAAiB,CAuBjG;AAED,MAAM,MAAM,YAAY,GAAG,iBAAiB,GAC1C,iBAAiB,GAAG;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAEJ,wBAAgB,YAAY,CAAC,IAAI,EAAE,YAAY,GAAG,QAAQ,CAAC;IACzD,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,CAAC,CAAC,EAAE,MA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IAAI,cAAc;CAMxB;AAED,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,YAAY,EAAE,GAAG,CAAC,GAAG;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,kBAAkB,GAAG,MAAM,cAAc,CAW7E"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/poseidon.js b/tools/mnemonic-test/node_modules/@noble/curves/abstract/poseidon.js deleted file mode 100644 index e8707b32..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/poseidon.js +++ /dev/null @@ -1,305 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.PoseidonSponge = void 0; -exports.grainGenConstants = grainGenConstants; -exports.validateOpts = validateOpts; -exports.splitConstants = splitConstants; -exports.poseidon = poseidon; -exports.poseidonSponge = poseidonSponge; -/** - * Implements [Poseidon](https://www.poseidon-hash.info) ZK-friendly hash. - * - * There are many poseidon variants with different constants. - * We don't provide them: you should construct them manually. - * Check out [micro-starknet](https://github.com/paulmillr/micro-starknet) package for a proper example. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const utils_ts_1 = require("../utils.js"); -const modular_ts_1 = require("./modular.js"); -// Grain LFSR (Linear-Feedback Shift Register): https://eprint.iacr.org/2009/109.pdf -function grainLFSR(state) { - let pos = 0; - if (state.length !== 80) - throw new Error('grainLFRS: wrong state length, should be 80 bits'); - const getBit = () => { - const r = (offset) => state[(pos + offset) % 80]; - const bit = r(62) ^ r(51) ^ r(38) ^ r(23) ^ r(13) ^ r(0); - state[pos] = bit; - pos = ++pos % 80; - return !!bit; - }; - for (let i = 0; i < 160; i++) - getBit(); - return () => { - // https://en.wikipedia.org/wiki/Shrinking_generator - while (true) { - const b1 = getBit(); - const b2 = getBit(); - if (!b1) - continue; - return b2; - } - }; -} -function assertValidPosOpts(opts) { - const { Fp, roundsFull } = opts; - (0, modular_ts_1.validateField)(Fp); - (0, utils_ts_1._validateObject)(opts, { - t: 'number', - roundsFull: 'number', - roundsPartial: 'number', - }, { - isSboxInverse: 'boolean', - }); - for (const i of ['t', 'roundsFull', 'roundsPartial']) { - if (!Number.isSafeInteger(opts[i]) || opts[i] < 1) - throw new Error('invalid number ' + i); - } - if (roundsFull & 1) - throw new Error('roundsFull is not even' + roundsFull); -} -function poseidonGrain(opts) { - assertValidPosOpts(opts); - const { Fp } = opts; - const state = Array(80).fill(1); - let pos = 0; - const writeBits = (value, bitCount) => { - for (let i = bitCount - 1; i >= 0; i--) - state[pos++] = Number((0, utils_ts_1.bitGet)(value, i)); - }; - const _0n = BigInt(0); - const _1n = BigInt(1); - writeBits(_1n, 2); // prime field - writeBits(opts.isSboxInverse ? _1n : _0n, 4); // b2..b5 - writeBits(BigInt(Fp.BITS), 12); // b6..b17 - writeBits(BigInt(opts.t), 12); // b18..b29 - writeBits(BigInt(opts.roundsFull), 10); // b30..b39 - writeBits(BigInt(opts.roundsPartial), 10); // b40..b49 - const getBit = grainLFSR(state); - return (count, reject) => { - const res = []; - for (let i = 0; i < count; i++) { - while (true) { - let num = _0n; - for (let i = 0; i < Fp.BITS; i++) { - num <<= _1n; - if (getBit()) - num |= _1n; - } - if (reject && num >= Fp.ORDER) - continue; // rejection sampling - res.push(Fp.create(num)); - break; - } - } - return res; - }; -} -// NOTE: this is not standard but used often for constant generation for poseidon -// (grain LFRS-like structure) -function grainGenConstants(opts, skipMDS = 0) { - const { Fp, t, roundsFull, roundsPartial } = opts; - const rounds = roundsFull + roundsPartial; - const sample = poseidonGrain(opts); - const roundConstants = []; - for (let r = 0; r < rounds; r++) - roundConstants.push(sample(t, true)); - if (skipMDS > 0) - for (let i = 0; i < skipMDS; i++) - sample(2 * t, false); - const xs = sample(t, false); - const ys = sample(t, false); - // Construct MDS Matrix M[i][j] = 1 / (xs[i] + ys[j]) - const mds = []; - for (let i = 0; i < t; i++) { - const row = []; - for (let j = 0; j < t; j++) { - const xy = Fp.add(xs[i], ys[j]); - if (Fp.is0(xy)) - throw new Error(`Error generating MDS matrix: xs[${i}] + ys[${j}] resulted in zero.`); - row.push(xy); - } - mds.push((0, modular_ts_1.FpInvertBatch)(Fp, row)); - } - return { roundConstants, mds }; -} -function validateOpts(opts) { - assertValidPosOpts(opts); - const { Fp, mds, reversePartialPowIdx: rev, roundConstants: rc } = opts; - const { roundsFull, roundsPartial, sboxPower, t } = opts; - // MDS is TxT matrix - if (!Array.isArray(mds) || mds.length !== t) - throw new Error('Poseidon: invalid MDS matrix'); - const _mds = mds.map((mdsRow) => { - if (!Array.isArray(mdsRow) || mdsRow.length !== t) - throw new Error('invalid MDS matrix row: ' + mdsRow); - return mdsRow.map((i) => { - if (typeof i !== 'bigint') - throw new Error('invalid MDS matrix bigint: ' + i); - return Fp.create(i); - }); - }); - if (rev !== undefined && typeof rev !== 'boolean') - throw new Error('invalid param reversePartialPowIdx=' + rev); - if (roundsFull & 1) - throw new Error('roundsFull is not even' + roundsFull); - const rounds = roundsFull + roundsPartial; - if (!Array.isArray(rc) || rc.length !== rounds) - throw new Error('Poseidon: invalid round constants'); - const roundConstants = rc.map((rc) => { - if (!Array.isArray(rc) || rc.length !== t) - throw new Error('invalid round constants'); - return rc.map((i) => { - if (typeof i !== 'bigint' || !Fp.isValid(i)) - throw new Error('invalid round constant'); - return Fp.create(i); - }); - }); - if (!sboxPower || ![3, 5, 7, 17].includes(sboxPower)) - throw new Error('invalid sboxPower'); - const _sboxPower = BigInt(sboxPower); - let sboxFn = (n) => (0, modular_ts_1.FpPow)(Fp, n, _sboxPower); - // Unwrapped sbox power for common cases (195->142μs) - if (sboxPower === 3) - sboxFn = (n) => Fp.mul(Fp.sqrN(n), n); - else if (sboxPower === 5) - sboxFn = (n) => Fp.mul(Fp.sqrN(Fp.sqrN(n)), n); - return Object.freeze({ ...opts, rounds, sboxFn, roundConstants, mds: _mds }); -} -function splitConstants(rc, t) { - if (typeof t !== 'number') - throw new Error('poseidonSplitConstants: invalid t'); - if (!Array.isArray(rc) || rc.length % t) - throw new Error('poseidonSplitConstants: invalid rc'); - const res = []; - let tmp = []; - for (let i = 0; i < rc.length; i++) { - tmp.push(rc[i]); - if (tmp.length === t) { - res.push(tmp); - tmp = []; - } - } - return res; -} -/** Poseidon NTT-friendly hash. */ -function poseidon(opts) { - const _opts = validateOpts(opts); - const { Fp, mds, roundConstants, rounds: totalRounds, roundsPartial, sboxFn, t } = _opts; - const halfRoundsFull = _opts.roundsFull / 2; - const partialIdx = _opts.reversePartialPowIdx ? t - 1 : 0; - const poseidonRound = (values, isFull, idx) => { - values = values.map((i, j) => Fp.add(i, roundConstants[idx][j])); - if (isFull) - values = values.map((i) => sboxFn(i)); - else - values[partialIdx] = sboxFn(values[partialIdx]); - // Matrix multiplication - values = mds.map((i) => i.reduce((acc, i, j) => Fp.add(acc, Fp.mulN(i, values[j])), Fp.ZERO)); - return values; - }; - const poseidonHash = function poseidonHash(values) { - if (!Array.isArray(values) || values.length !== t) - throw new Error('invalid values, expected array of bigints with length ' + t); - values = values.map((i) => { - if (typeof i !== 'bigint') - throw new Error('invalid bigint=' + i); - return Fp.create(i); - }); - let lastRound = 0; - // Apply r_f/2 full rounds. - for (let i = 0; i < halfRoundsFull; i++) - values = poseidonRound(values, true, lastRound++); - // Apply r_p partial rounds. - for (let i = 0; i < roundsPartial; i++) - values = poseidonRound(values, false, lastRound++); - // Apply r_f/2 full rounds. - for (let i = 0; i < halfRoundsFull; i++) - values = poseidonRound(values, true, lastRound++); - if (lastRound !== totalRounds) - throw new Error('invalid number of rounds'); - return values; - }; - // For verification in tests - poseidonHash.roundConstants = roundConstants; - return poseidonHash; -} -class PoseidonSponge { - constructor(Fp, rate, capacity, hash) { - this.pos = 0; - this.isAbsorbing = true; - this.Fp = Fp; - this.hash = hash; - this.rate = rate; - this.capacity = capacity; - this.state = new Array(rate + capacity); - this.clean(); - } - process() { - this.state = this.hash(this.state); - } - absorb(input) { - for (const i of input) - if (typeof i !== 'bigint' || !this.Fp.isValid(i)) - throw new Error('invalid input: ' + i); - for (let i = 0; i < input.length;) { - if (!this.isAbsorbing || this.pos === this.rate) { - this.process(); - this.pos = 0; - this.isAbsorbing = true; - } - const chunk = Math.min(this.rate - this.pos, input.length - i); - for (let j = 0; j < chunk; j++) { - const idx = this.capacity + this.pos++; - this.state[idx] = this.Fp.add(this.state[idx], input[i++]); - } - } - } - squeeze(count) { - const res = []; - while (res.length < count) { - if (this.isAbsorbing || this.pos === this.rate) { - this.process(); - this.pos = 0; - this.isAbsorbing = false; - } - const chunk = Math.min(this.rate - this.pos, count - res.length); - for (let i = 0; i < chunk; i++) - res.push(this.state[this.capacity + this.pos++]); - } - return res; - } - clean() { - this.state.fill(this.Fp.ZERO); - this.isAbsorbing = true; - this.pos = 0; - } - clone() { - const c = new PoseidonSponge(this.Fp, this.rate, this.capacity, this.hash); - c.pos = this.pos; - c.state = [...this.state]; - return c; - } -} -exports.PoseidonSponge = PoseidonSponge; -/** - * The method is not defined in spec, but nevertheless used often. - * Check carefully for compatibility: there are many edge cases, like absorbing an empty array. - * We cross-test against: - * - https://github.com/ProvableHQ/snarkVM/tree/staging/algorithms - * - https://github.com/arkworks-rs/crypto-primitives/tree/main - */ -function poseidonSponge(opts) { - for (const i of ['rate', 'capacity']) { - if (typeof opts[i] !== 'number' || !Number.isSafeInteger(opts[i])) - throw new Error('invalid number ' + i); - } - const { rate, capacity } = opts; - const t = opts.rate + opts.capacity; - // Re-use hash instance between multiple instances - const hash = poseidon({ ...opts, t }); - const { Fp } = opts; - return () => new PoseidonSponge(Fp, rate, capacity, hash); -} -//# sourceMappingURL=poseidon.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/poseidon.js.map b/tools/mnemonic-test/node_modules/@noble/curves/abstract/poseidon.js.map deleted file mode 100644 index a75e00a9..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/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D,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/tower.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/abstract/tower.d.ts deleted file mode 100644 index 262e04ac..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/tower.d.ts +++ /dev/null @@ -1,95 +0,0 @@ -import * as mod from './modular.ts'; -import type { WeierstrassPoint, WeierstrassPointCons } from './weierstrass.ts'; -export type BigintTuple = [bigint, bigint]; -export type Fp = bigint; -export type Fp2 = { - c0: bigint; - c1: bigint; -}; -export type BigintSix = [bigint, bigint, bigint, bigint, bigint, bigint]; -export type Fp6 = { - c0: Fp2; - c1: Fp2; - c2: Fp2; -}; -export type Fp12 = { - c0: Fp6; - c1: Fp6; -}; -export type BigintTwelve = [ - bigint, - bigint, - bigint, - bigint, - bigint, - bigint, - bigint, - bigint, - bigint, - bigint, - bigint, - bigint -]; -export type Fp2Bls = mod.IField & { - Fp: mod.IField; - frobeniusMap(num: Fp2, power: number): Fp2; - fromBigTuple(num: BigintTuple): Fp2; - mulByB: (num: Fp2) => Fp2; - mulByNonresidue: (num: Fp2) => Fp2; - reim: (num: Fp2) => { - re: Fp; - im: Fp; - }; - Fp4Square: (a: Fp2, b: Fp2) => { - first: Fp2; - second: Fp2; - }; - NONRESIDUE: Fp2; -}; -export type Fp6Bls = mod.IField & { - Fp2: Fp2Bls; - frobeniusMap(num: Fp6, power: number): Fp6; - fromBigSix: (tuple: BigintSix) => Fp6; - mul1(num: Fp6, b1: Fp2): Fp6; - mul01(num: Fp6, b0: Fp2, b1: Fp2): Fp6; - mulByFp2(lhs: Fp6, rhs: Fp2): Fp6; - mulByNonresidue: (num: Fp6) => Fp6; -}; -export type Fp12Bls = mod.IField & { - Fp6: Fp6Bls; - frobeniusMap(num: Fp12, power: number): Fp12; - fromBigTwelve: (t: BigintTwelve) => Fp12; - mul014(num: Fp12, o0: Fp2, o1: Fp2, o4: Fp2): Fp12; - mul034(num: Fp12, o0: Fp2, o3: Fp2, o4: Fp2): Fp12; - mulByFp2(lhs: Fp12, rhs: Fp2): Fp12; - conjugate(num: Fp12): Fp12; - finalExponentiate(num: Fp12): Fp12; - _cyclotomicSquare(num: Fp12): Fp12; - _cyclotomicExp(num: Fp12, n: bigint): Fp12; -}; -export declare function psiFrobenius(Fp: mod.IField, Fp2: Fp2Bls, base: Fp2): { - psi: (x: Fp2, y: Fp2) => [Fp2, Fp2]; - psi2: (x: Fp2, y: Fp2) => [Fp2, Fp2]; - G2psi: (c: WeierstrassPointCons, P: WeierstrassPoint) => WeierstrassPoint; - G2psi2: (c: WeierstrassPointCons, P: WeierstrassPoint) => WeierstrassPoint; - PSI_X: Fp2; - PSI_Y: Fp2; - PSI2_X: Fp2; - PSI2_Y: Fp2; -}; -export type Tower12Opts = { - ORDER: bigint; - X_LEN: number; - NONRESIDUE?: Fp; - FP2_NONRESIDUE: BigintTuple; - Fp2sqrt?: (num: Fp2) => Fp2; - Fp2mulByB: (num: Fp2) => Fp2; - Fp12finalExponentiate: (num: Fp12) => Fp12; -}; -export declare function tower12(opts: Tower12Opts): { - Fp: Readonly & Required, 'isOdd'>>>; - Fp2: Fp2Bls; - Fp6: Fp6Bls; - Fp12: Fp12Bls; -}; -//# sourceMappingURL=tower.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/tower.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/abstract/tower.d.ts.map deleted file mode 100644 index d2abc87d..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/tower.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tower.d.ts","sourceRoot":"","sources":["../src/abstract/tower.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAO/E,MAAM,MAAM,WAAW,GAAG,CAAC,MAAM,EAAE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C;IAChB,cAAc,EAAE,WAAW,CAAC;IAC5B,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,CAAC;IAC5B,SAAS,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,CAAC;IAC7B,qBAAqB,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,IAAI,CAAC;CAC5C,CAAC;AAosBF,wBAAgB,OAAO,CAAC,IAAI,EAAE,WAAW,GAAG;IAC1C,EAAE,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAC/E,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,OAAO,CAAC;CACf,CAMA"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/tower.js b/tools/mnemonic-test/node_modules/@noble/curves/abstract/tower.js deleted file mode 100644 index ef5db379..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/tower.js +++ /dev/null @@ -1,718 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.psiFrobenius = psiFrobenius; -exports.tower12 = tower12; -/** - * Towered extension fields. - * Rather than implementing a massive 12th-degree extension directly, it is more efficient - * to build it up from smaller extensions: a tower of extensions. - * - * For BLS12-381, the Fp12 field is implemented as a quadratic (degree two) extension, - * on top of a cubic (degree three) extension, on top of a quadratic extension of Fp. - * - * For more info: "Pairings for beginners" by Costello, section 7.3. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const utils_ts_1 = require("../utils.js"); -const mod = require("./modular.js"); -// Be friendly to bad ECMAScript parsers by not using bigint literals -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3); -function calcFrobeniusCoefficients(Fp, nonResidue, modulus, degree, num = 1, divisor) { - const _divisor = BigInt(divisor === undefined ? degree : divisor); - const towerModulus = modulus ** BigInt(degree); - const res = []; - for (let i = 0; i < num; i++) { - const a = BigInt(i + 1); - const powers = []; - for (let j = 0, qPower = _1n; j < degree; j++) { - const power = ((a * qPower - a) / _divisor) % towerModulus; - powers.push(Fp.pow(nonResidue, power)); - qPower *= modulus; - } - res.push(powers); - } - return res; -} -// This works same at least for bls12-381, bn254 and bls12-377 -function psiFrobenius(Fp, Fp2, base) { - // GLV endomorphism Ψ(P) - const PSI_X = Fp2.pow(base, (Fp.ORDER - _1n) / _3n); // u^((p-1)/3) - const PSI_Y = Fp2.pow(base, (Fp.ORDER - _1n) / _2n); // u^((p-1)/2) - function psi(x, y) { - // This x10 faster than previous version in bls12-381 - const x2 = Fp2.mul(Fp2.frobeniusMap(x, 1), PSI_X); - const y2 = Fp2.mul(Fp2.frobeniusMap(y, 1), PSI_Y); - return [x2, y2]; - } - // Ψ²(P) endomorphism (psi2(x) = psi(psi(x))) - const PSI2_X = Fp2.pow(base, (Fp.ORDER ** _2n - _1n) / _3n); // u^((p^2 - 1)/3) - // This equals -1, which causes y to be Fp2.neg(y). - // But not sure if there are case when this is not true? - const PSI2_Y = Fp2.pow(base, (Fp.ORDER ** _2n - _1n) / _2n); // u^((p^2 - 1)/3) - if (!Fp2.eql(PSI2_Y, Fp2.neg(Fp2.ONE))) - throw new Error('psiFrobenius: PSI2_Y!==-1'); - function psi2(x, y) { - return [Fp2.mul(x, PSI2_X), Fp2.neg(y)]; - } - // Map points - const mapAffine = (fn) => (c, P) => { - const affine = P.toAffine(); - const p = fn(affine.x, affine.y); - return c.fromAffine({ x: p[0], y: p[1] }); - }; - const G2psi = mapAffine(psi); - const G2psi2 = mapAffine(psi2); - return { psi, psi2, G2psi, G2psi2, PSI_X, PSI_Y, PSI2_X, PSI2_Y }; -} -const Fp2fromBigTuple = (Fp, tuple) => { - if (tuple.length !== 2) - throw new Error('invalid tuple'); - const fps = tuple.map((n) => Fp.create(n)); - return { c0: fps[0], c1: fps[1] }; -}; -class _Field2 { - constructor(Fp, opts = {}) { - this.MASK = _1n; - const ORDER = Fp.ORDER; - const FP2_ORDER = ORDER * ORDER; - this.Fp = Fp; - this.ORDER = FP2_ORDER; - this.BITS = (0, utils_ts_1.bitLen)(FP2_ORDER); - this.BYTES = Math.ceil((0, utils_ts_1.bitLen)(FP2_ORDER) / 8); - this.isLE = Fp.isLE; - this.ZERO = { c0: Fp.ZERO, c1: Fp.ZERO }; - this.ONE = { c0: Fp.ONE, c1: Fp.ZERO }; - this.Fp_NONRESIDUE = Fp.create(opts.NONRESIDUE || BigInt(-1)); - this.Fp_div2 = Fp.div(Fp.ONE, _2n); // 1/2 - this.NONRESIDUE = Fp2fromBigTuple(Fp, opts.FP2_NONRESIDUE); - // const Fp2Nonresidue = Fp2fromBigTuple(opts.FP2_NONRESIDUE); - this.FROBENIUS_COEFFICIENTS = calcFrobeniusCoefficients(Fp, this.Fp_NONRESIDUE, Fp.ORDER, 2)[0]; - this.mulByB = opts.Fp2mulByB; - Object.seal(this); - } - fromBigTuple(tuple) { - return Fp2fromBigTuple(this.Fp, tuple); - } - create(num) { - return num; - } - isValid({ c0, c1 }) { - function isValidC(num, ORDER) { - return typeof num === 'bigint' && _0n <= num && num < ORDER; - } - return isValidC(c0, this.ORDER) && isValidC(c1, this.ORDER); - } - is0({ c0, c1 }) { - return this.Fp.is0(c0) && this.Fp.is0(c1); - } - isValidNot0(num) { - return !this.is0(num) && this.isValid(num); - } - eql({ c0, c1 }, { c0: r0, c1: r1 }) { - return this.Fp.eql(c0, r0) && this.Fp.eql(c1, r1); - } - neg({ c0, c1 }) { - return { c0: this.Fp.neg(c0), c1: this.Fp.neg(c1) }; - } - pow(num, power) { - return mod.FpPow(this, num, power); - } - invertBatch(nums) { - return mod.FpInvertBatch(this, nums); - } - // Normalized - add(f1, f2) { - const { c0, c1 } = f1; - const { c0: r0, c1: r1 } = f2; - return { - c0: this.Fp.add(c0, r0), - c1: this.Fp.add(c1, r1), - }; - } - sub({ c0, c1 }, { c0: r0, c1: r1 }) { - return { - c0: this.Fp.sub(c0, r0), - c1: this.Fp.sub(c1, r1), - }; - } - mul({ c0, c1 }, rhs) { - const { Fp } = this; - if (typeof rhs === 'bigint') - return { c0: Fp.mul(c0, rhs), c1: Fp.mul(c1, rhs) }; - // (a+bi)(c+di) = (ac−bd) + (ad+bc)i - const { c0: r0, c1: r1 } = rhs; - let t1 = Fp.mul(c0, r0); // c0 * o0 - let t2 = Fp.mul(c1, r1); // c1 * o1 - // (T1 - T2) + ((c0 + c1) * (r0 + r1) - (T1 + T2))*i - const o0 = Fp.sub(t1, t2); - const o1 = Fp.sub(Fp.mul(Fp.add(c0, c1), Fp.add(r0, r1)), Fp.add(t1, t2)); - return { c0: o0, c1: o1 }; - } - sqr({ c0, c1 }) { - const { Fp } = this; - const a = Fp.add(c0, c1); - const b = Fp.sub(c0, c1); - const c = Fp.add(c0, c0); - return { c0: Fp.mul(a, b), c1: Fp.mul(c, c1) }; - } - // NonNormalized stuff - addN(a, b) { - return this.add(a, b); - } - subN(a, b) { - return this.sub(a, b); - } - mulN(a, b) { - return this.mul(a, b); - } - sqrN(a) { - return this.sqr(a); - } - // Why inversion for bigint inside Fp instead of Fp2? it is even used in that context? - div(lhs, rhs) { - const { Fp } = this; - // @ts-ignore - return this.mul(lhs, typeof rhs === 'bigint' ? Fp.inv(Fp.create(rhs)) : this.inv(rhs)); - } - inv({ c0: a, c1: b }) { - // We wish to find the multiplicative inverse of a nonzero - // element a + bu in Fp2. We leverage an identity - // - // (a + bu)(a - bu) = a² + b² - // - // which holds because u² = -1. This can be rewritten as - // - // (a + bu)(a - bu)/(a² + b²) = 1 - // - // because a² + b² = 0 has no nonzero solutions for (a, b). - // This gives that (a - bu)/(a² + b²) is the inverse - // of (a + bu). Importantly, this can be computing using - // only a single inversion in Fp. - const { Fp } = this; - const factor = Fp.inv(Fp.create(a * a + b * b)); - return { c0: Fp.mul(factor, Fp.create(a)), c1: Fp.mul(factor, Fp.create(-b)) }; - } - sqrt(num) { - // This is generic for all quadratic extensions (Fp2) - const { Fp } = this; - const Fp2 = this; - const { c0, c1 } = num; - if (Fp.is0(c1)) { - // if c0 is quadratic residue - if (mod.FpLegendre(Fp, c0) === 1) - return Fp2.create({ c0: Fp.sqrt(c0), c1: Fp.ZERO }); - else - return Fp2.create({ c0: Fp.ZERO, c1: Fp.sqrt(Fp.div(c0, this.Fp_NONRESIDUE)) }); - } - const a = Fp.sqrt(Fp.sub(Fp.sqr(c0), Fp.mul(Fp.sqr(c1), this.Fp_NONRESIDUE))); - let d = Fp.mul(Fp.add(a, c0), this.Fp_div2); - const legendre = mod.FpLegendre(Fp, d); - // -1, Quadratic non residue - if (legendre === -1) - d = Fp.sub(d, a); - const a0 = Fp.sqrt(d); - const candidateSqrt = Fp2.create({ c0: a0, c1: Fp.div(Fp.mul(c1, this.Fp_div2), a0) }); - if (!Fp2.eql(Fp2.sqr(candidateSqrt), num)) - throw new Error('Cannot find square root'); - // Normalize root: at this point candidateSqrt ** 2 = num, but also -candidateSqrt ** 2 = num - const x1 = candidateSqrt; - const x2 = Fp2.neg(x1); - const { re: re1, im: im1 } = Fp2.reim(x1); - const { re: re2, im: im2 } = Fp2.reim(x2); - if (im1 > im2 || (im1 === im2 && re1 > re2)) - return x1; - return x2; - } - // Same as sgn0_m_eq_2 in RFC 9380 - isOdd(x) { - const { re: x0, im: x1 } = this.reim(x); - const sign_0 = x0 % _2n; - const zero_0 = x0 === _0n; - const sign_1 = x1 % _2n; - return BigInt(sign_0 || (zero_0 && sign_1)) == _1n; - } - // Bytes util - fromBytes(b) { - const { Fp } = this; - if (b.length !== this.BYTES) - throw new Error('fromBytes invalid length=' + b.length); - return { c0: Fp.fromBytes(b.subarray(0, Fp.BYTES)), c1: Fp.fromBytes(b.subarray(Fp.BYTES)) }; - } - toBytes({ c0, c1 }) { - return (0, utils_ts_1.concatBytes)(this.Fp.toBytes(c0), this.Fp.toBytes(c1)); - } - cmov({ c0, c1 }, { c0: r0, c1: r1 }, c) { - return { - c0: this.Fp.cmov(c0, r0, c), - c1: this.Fp.cmov(c1, r1, c), - }; - } - reim({ c0, c1 }) { - return { re: c0, im: c1 }; - } - Fp4Square(a, b) { - const Fp2 = this; - const a2 = Fp2.sqr(a); - const b2 = Fp2.sqr(b); - return { - first: Fp2.add(Fp2.mulByNonresidue(b2), a2), // b² * Nonresidue + a² - second: Fp2.sub(Fp2.sub(Fp2.sqr(Fp2.add(a, b)), a2), b2), // (a + b)² - a² - b² - }; - } - // multiply by u + 1 - mulByNonresidue({ c0, c1 }) { - return this.mul({ c0, c1 }, this.NONRESIDUE); - } - frobeniusMap({ c0, c1 }, power) { - return { - c0, - c1: this.Fp.mul(c1, this.FROBENIUS_COEFFICIENTS[power % 2]), - }; - } -} -class _Field6 { - constructor(Fp2) { - this.MASK = _1n; - this.Fp2 = Fp2; - this.ORDER = Fp2.ORDER; // TODO: unused, but need to verify - this.BITS = 3 * Fp2.BITS; - this.BYTES = 3 * Fp2.BYTES; - this.isLE = Fp2.isLE; - this.ZERO = { c0: Fp2.ZERO, c1: Fp2.ZERO, c2: Fp2.ZERO }; - this.ONE = { c0: Fp2.ONE, c1: Fp2.ZERO, c2: Fp2.ZERO }; - const { Fp } = Fp2; - const frob = calcFrobeniusCoefficients(Fp2, Fp2.NONRESIDUE, Fp.ORDER, 6, 2, 3); - this.FROBENIUS_COEFFICIENTS_1 = frob[0]; - this.FROBENIUS_COEFFICIENTS_2 = frob[1]; - Object.seal(this); - } - add({ c0, c1, c2 }, { c0: r0, c1: r1, c2: r2 }) { - const { Fp2 } = this; - return { - c0: Fp2.add(c0, r0), - c1: Fp2.add(c1, r1), - c2: Fp2.add(c2, r2), - }; - } - sub({ c0, c1, c2 }, { c0: r0, c1: r1, c2: r2 }) { - const { Fp2 } = this; - return { - c0: Fp2.sub(c0, r0), - c1: Fp2.sub(c1, r1), - c2: Fp2.sub(c2, r2), - }; - } - mul({ c0, c1, c2 }, rhs) { - const { Fp2 } = this; - if (typeof rhs === 'bigint') { - return { - c0: Fp2.mul(c0, rhs), - c1: Fp2.mul(c1, rhs), - c2: Fp2.mul(c2, rhs), - }; - } - const { c0: r0, c1: r1, c2: r2 } = rhs; - const t0 = Fp2.mul(c0, r0); // c0 * o0 - const t1 = Fp2.mul(c1, r1); // c1 * o1 - const t2 = Fp2.mul(c2, r2); // c2 * o2 - return { - // t0 + (c1 + c2) * (r1 * r2) - (T1 + T2) * (u + 1) - c0: Fp2.add(t0, Fp2.mulByNonresidue(Fp2.sub(Fp2.mul(Fp2.add(c1, c2), Fp2.add(r1, r2)), Fp2.add(t1, t2)))), - // (c0 + c1) * (r0 + r1) - (T0 + T1) + T2 * (u + 1) - c1: Fp2.add(Fp2.sub(Fp2.mul(Fp2.add(c0, c1), Fp2.add(r0, r1)), Fp2.add(t0, t1)), Fp2.mulByNonresidue(t2)), - // T1 + (c0 + c2) * (r0 + r2) - T0 + T2 - c2: Fp2.sub(Fp2.add(t1, Fp2.mul(Fp2.add(c0, c2), Fp2.add(r0, r2))), Fp2.add(t0, t2)), - }; - } - sqr({ c0, c1, c2 }) { - const { Fp2 } = this; - let t0 = Fp2.sqr(c0); // c0² - let t1 = Fp2.mul(Fp2.mul(c0, c1), _2n); // 2 * c0 * c1 - let t3 = Fp2.mul(Fp2.mul(c1, c2), _2n); // 2 * c1 * c2 - let t4 = Fp2.sqr(c2); // c2² - return { - c0: Fp2.add(Fp2.mulByNonresidue(t3), t0), // T3 * (u + 1) + T0 - c1: Fp2.add(Fp2.mulByNonresidue(t4), t1), // T4 * (u + 1) + T1 - // T1 + (c0 - c1 + c2)² + T3 - T0 - T4 - c2: Fp2.sub(Fp2.sub(Fp2.add(Fp2.add(t1, Fp2.sqr(Fp2.add(Fp2.sub(c0, c1), c2))), t3), t0), t4), - }; - } - addN(a, b) { - return this.add(a, b); - } - subN(a, b) { - return this.sub(a, b); - } - mulN(a, b) { - return this.mul(a, b); - } - sqrN(a) { - return this.sqr(a); - } - create(num) { - return num; - } - isValid({ c0, c1, c2 }) { - const { Fp2 } = this; - return Fp2.isValid(c0) && Fp2.isValid(c1) && Fp2.isValid(c2); - } - is0({ c0, c1, c2 }) { - const { Fp2 } = this; - return Fp2.is0(c0) && Fp2.is0(c1) && Fp2.is0(c2); - } - isValidNot0(num) { - return !this.is0(num) && this.isValid(num); - } - neg({ c0, c1, c2 }) { - const { Fp2 } = this; - return { c0: Fp2.neg(c0), c1: Fp2.neg(c1), c2: Fp2.neg(c2) }; - } - eql({ c0, c1, c2 }, { c0: r0, c1: r1, c2: r2 }) { - const { Fp2 } = this; - return Fp2.eql(c0, r0) && Fp2.eql(c1, r1) && Fp2.eql(c2, r2); - } - sqrt(_) { - return (0, utils_ts_1.notImplemented)(); - } - // Do we need division by bigint at all? Should be done via order: - div(lhs, rhs) { - const { Fp2 } = this; - const { Fp } = Fp2; - return this.mul(lhs, typeof rhs === 'bigint' ? Fp.inv(Fp.create(rhs)) : this.inv(rhs)); - } - pow(num, power) { - return mod.FpPow(this, num, power); - } - invertBatch(nums) { - return mod.FpInvertBatch(this, nums); - } - inv({ c0, c1, c2 }) { - const { Fp2 } = this; - let t0 = Fp2.sub(Fp2.sqr(c0), Fp2.mulByNonresidue(Fp2.mul(c2, c1))); // c0² - c2 * c1 * (u + 1) - let t1 = Fp2.sub(Fp2.mulByNonresidue(Fp2.sqr(c2)), Fp2.mul(c0, c1)); // c2² * (u + 1) - c0 * c1 - let t2 = Fp2.sub(Fp2.sqr(c1), Fp2.mul(c0, c2)); // c1² - c0 * c2 - // 1/(((c2 * T1 + c1 * T2) * v) + c0 * T0) - let t4 = Fp2.inv(Fp2.add(Fp2.mulByNonresidue(Fp2.add(Fp2.mul(c2, t1), Fp2.mul(c1, t2))), Fp2.mul(c0, t0))); - return { c0: Fp2.mul(t4, t0), c1: Fp2.mul(t4, t1), c2: Fp2.mul(t4, t2) }; - } - // Bytes utils - fromBytes(b) { - const { Fp2 } = this; - if (b.length !== this.BYTES) - throw new Error('fromBytes invalid length=' + b.length); - const B2 = Fp2.BYTES; - return { - c0: Fp2.fromBytes(b.subarray(0, B2)), - c1: Fp2.fromBytes(b.subarray(B2, B2 * 2)), - c2: Fp2.fromBytes(b.subarray(2 * B2)), - }; - } - toBytes({ c0, c1, c2 }) { - const { Fp2 } = this; - return (0, utils_ts_1.concatBytes)(Fp2.toBytes(c0), Fp2.toBytes(c1), Fp2.toBytes(c2)); - } - cmov({ c0, c1, c2 }, { c0: r0, c1: r1, c2: r2 }, c) { - const { Fp2 } = this; - return { - c0: Fp2.cmov(c0, r0, c), - c1: Fp2.cmov(c1, r1, c), - c2: Fp2.cmov(c2, r2, c), - }; - } - fromBigSix(t) { - const { Fp2 } = this; - if (!Array.isArray(t) || t.length !== 6) - throw new Error('invalid Fp6 usage'); - return { - c0: Fp2.fromBigTuple(t.slice(0, 2)), - c1: Fp2.fromBigTuple(t.slice(2, 4)), - c2: Fp2.fromBigTuple(t.slice(4, 6)), - }; - } - frobeniusMap({ c0, c1, c2 }, power) { - const { Fp2 } = this; - return { - c0: Fp2.frobeniusMap(c0, power), - c1: Fp2.mul(Fp2.frobeniusMap(c1, power), this.FROBENIUS_COEFFICIENTS_1[power % 6]), - c2: Fp2.mul(Fp2.frobeniusMap(c2, power), this.FROBENIUS_COEFFICIENTS_2[power % 6]), - }; - } - mulByFp2({ c0, c1, c2 }, rhs) { - const { Fp2 } = this; - return { - c0: Fp2.mul(c0, rhs), - c1: Fp2.mul(c1, rhs), - c2: Fp2.mul(c2, rhs), - }; - } - mulByNonresidue({ c0, c1, c2 }) { - const { Fp2 } = this; - return { c0: Fp2.mulByNonresidue(c2), c1: c0, c2: c1 }; - } - // Sparse multiplication - mul1({ c0, c1, c2 }, b1) { - const { Fp2 } = this; - return { - c0: Fp2.mulByNonresidue(Fp2.mul(c2, b1)), - c1: Fp2.mul(c0, b1), - c2: Fp2.mul(c1, b1), - }; - } - // Sparse multiplication - mul01({ c0, c1, c2 }, b0, b1) { - const { Fp2 } = this; - let t0 = Fp2.mul(c0, b0); // c0 * b0 - let t1 = Fp2.mul(c1, b1); // c1 * b1 - return { - // ((c1 + c2) * b1 - T1) * (u + 1) + T0 - c0: Fp2.add(Fp2.mulByNonresidue(Fp2.sub(Fp2.mul(Fp2.add(c1, c2), b1), t1)), t0), - // (b0 + b1) * (c0 + c1) - T0 - T1 - c1: Fp2.sub(Fp2.sub(Fp2.mul(Fp2.add(b0, b1), Fp2.add(c0, c1)), t0), t1), - // (c0 + c2) * b0 - T0 + T1 - c2: Fp2.add(Fp2.sub(Fp2.mul(Fp2.add(c0, c2), b0), t0), t1), - }; - } -} -class _Field12 { - constructor(Fp6, opts) { - this.MASK = _1n; - const { Fp2 } = Fp6; - const { Fp } = Fp2; - this.Fp6 = Fp6; - this.ORDER = Fp2.ORDER; // TODO: verify if it's unuesd - this.BITS = 2 * Fp6.BITS; - this.BYTES = 2 * Fp6.BYTES; - this.isLE = Fp6.isLE; - this.ZERO = { c0: Fp6.ZERO, c1: Fp6.ZERO }; - this.ONE = { c0: Fp6.ONE, c1: Fp6.ZERO }; - this.FROBENIUS_COEFFICIENTS = calcFrobeniusCoefficients(Fp2, Fp2.NONRESIDUE, Fp.ORDER, 12, 1, 6)[0]; - this.X_LEN = opts.X_LEN; - this.finalExponentiate = opts.Fp12finalExponentiate; - } - create(num) { - return num; - } - isValid({ c0, c1 }) { - const { Fp6 } = this; - return Fp6.isValid(c0) && Fp6.isValid(c1); - } - is0({ c0, c1 }) { - const { Fp6 } = this; - return Fp6.is0(c0) && Fp6.is0(c1); - } - isValidNot0(num) { - return !this.is0(num) && this.isValid(num); - } - neg({ c0, c1 }) { - const { Fp6 } = this; - return { c0: Fp6.neg(c0), c1: Fp6.neg(c1) }; - } - eql({ c0, c1 }, { c0: r0, c1: r1 }) { - const { Fp6 } = this; - return Fp6.eql(c0, r0) && Fp6.eql(c1, r1); - } - sqrt(_) { - (0, utils_ts_1.notImplemented)(); - } - inv({ c0, c1 }) { - const { Fp6 } = this; - let t = Fp6.inv(Fp6.sub(Fp6.sqr(c0), Fp6.mulByNonresidue(Fp6.sqr(c1)))); // 1 / (c0² - c1² * v) - return { c0: Fp6.mul(c0, t), c1: Fp6.neg(Fp6.mul(c1, t)) }; // ((C0 * T) * T) + (-C1 * T) * w - } - div(lhs, rhs) { - const { Fp6 } = this; - const { Fp2 } = Fp6; - const { Fp } = Fp2; - return this.mul(lhs, typeof rhs === 'bigint' ? Fp.inv(Fp.create(rhs)) : this.inv(rhs)); - } - pow(num, power) { - return mod.FpPow(this, num, power); - } - invertBatch(nums) { - return mod.FpInvertBatch(this, nums); - } - // Normalized - add({ c0, c1 }, { c0: r0, c1: r1 }) { - const { Fp6 } = this; - return { - c0: Fp6.add(c0, r0), - c1: Fp6.add(c1, r1), - }; - } - sub({ c0, c1 }, { c0: r0, c1: r1 }) { - const { Fp6 } = this; - return { - c0: Fp6.sub(c0, r0), - c1: Fp6.sub(c1, r1), - }; - } - mul({ c0, c1 }, rhs) { - const { Fp6 } = this; - if (typeof rhs === 'bigint') - return { c0: Fp6.mul(c0, rhs), c1: Fp6.mul(c1, rhs) }; - let { c0: r0, c1: r1 } = rhs; - let t1 = Fp6.mul(c0, r0); // c0 * r0 - let t2 = Fp6.mul(c1, r1); // c1 * r1 - return { - c0: Fp6.add(t1, Fp6.mulByNonresidue(t2)), // T1 + T2 * v - // (c0 + c1) * (r0 + r1) - (T1 + T2) - c1: Fp6.sub(Fp6.mul(Fp6.add(c0, c1), Fp6.add(r0, r1)), Fp6.add(t1, t2)), - }; - } - sqr({ c0, c1 }) { - const { Fp6 } = this; - let ab = Fp6.mul(c0, c1); // c0 * c1 - return { - // (c1 * v + c0) * (c0 + c1) - AB - AB * v - c0: Fp6.sub(Fp6.sub(Fp6.mul(Fp6.add(Fp6.mulByNonresidue(c1), c0), Fp6.add(c0, c1)), ab), Fp6.mulByNonresidue(ab)), - c1: Fp6.add(ab, ab), - }; // AB + AB - } - // NonNormalized stuff - addN(a, b) { - return this.add(a, b); - } - subN(a, b) { - return this.sub(a, b); - } - mulN(a, b) { - return this.mul(a, b); - } - sqrN(a) { - return this.sqr(a); - } - // Bytes utils - fromBytes(b) { - const { Fp6 } = this; - if (b.length !== this.BYTES) - throw new Error('fromBytes invalid length=' + b.length); - return { - c0: Fp6.fromBytes(b.subarray(0, Fp6.BYTES)), - c1: Fp6.fromBytes(b.subarray(Fp6.BYTES)), - }; - } - toBytes({ c0, c1 }) { - const { Fp6 } = this; - return (0, utils_ts_1.concatBytes)(Fp6.toBytes(c0), Fp6.toBytes(c1)); - } - cmov({ c0, c1 }, { c0: r0, c1: r1 }, c) { - const { Fp6 } = this; - return { - c0: Fp6.cmov(c0, r0, c), - c1: Fp6.cmov(c1, r1, c), - }; - } - // Utils - // toString() { - // return '' + 'Fp12(' + this.c0 + this.c1 + '* w'); - // }, - // fromTuple(c: [Fp6, Fp6]) { - // return new Fp12(...c); - // } - fromBigTwelve(t) { - const { Fp6 } = this; - return { - c0: Fp6.fromBigSix(t.slice(0, 6)), - c1: Fp6.fromBigSix(t.slice(6, 12)), - }; - } - // Raises to q**i -th power - frobeniusMap(lhs, power) { - const { Fp6 } = this; - const { Fp2 } = Fp6; - const { c0, c1, c2 } = Fp6.frobeniusMap(lhs.c1, power); - const coeff = this.FROBENIUS_COEFFICIENTS[power % 12]; - return { - c0: Fp6.frobeniusMap(lhs.c0, power), - c1: Fp6.create({ - c0: Fp2.mul(c0, coeff), - c1: Fp2.mul(c1, coeff), - c2: Fp2.mul(c2, coeff), - }), - }; - } - mulByFp2({ c0, c1 }, rhs) { - const { Fp6 } = this; - return { - c0: Fp6.mulByFp2(c0, rhs), - c1: Fp6.mulByFp2(c1, rhs), - }; - } - conjugate({ c0, c1 }) { - return { c0, c1: this.Fp6.neg(c1) }; - } - // Sparse multiplication - mul014({ c0, c1 }, o0, o1, o4) { - const { Fp6 } = this; - const { Fp2 } = Fp6; - let t0 = Fp6.mul01(c0, o0, o1); - let t1 = Fp6.mul1(c1, o4); - return { - c0: Fp6.add(Fp6.mulByNonresidue(t1), t0), // T1 * v + T0 - // (c1 + c0) * [o0, o1+o4] - T0 - T1 - c1: Fp6.sub(Fp6.sub(Fp6.mul01(Fp6.add(c1, c0), o0, Fp2.add(o1, o4)), t0), t1), - }; - } - mul034({ c0, c1 }, o0, o3, o4) { - const { Fp6 } = this; - const { Fp2 } = Fp6; - const a = Fp6.create({ - c0: Fp2.mul(c0.c0, o0), - c1: Fp2.mul(c0.c1, o0), - c2: Fp2.mul(c0.c2, o0), - }); - const b = Fp6.mul01(c1, o3, o4); - const e = Fp6.mul01(Fp6.add(c0, c1), Fp2.add(o0, o3), o4); - return { - c0: Fp6.add(Fp6.mulByNonresidue(b), a), - c1: Fp6.sub(e, Fp6.add(a, b)), - }; - } - // A cyclotomic group is a subgroup of Fp^n defined by - // GΦₙ(p) = {α ∈ Fpⁿ : α^Φₙ(p) = 1} - // The result of any pairing is in a cyclotomic subgroup - // https://eprint.iacr.org/2009/565.pdf - // https://eprint.iacr.org/2010/354.pdf - _cyclotomicSquare({ c0, c1 }) { - const { Fp6 } = this; - const { Fp2 } = Fp6; - const { c0: c0c0, c1: c0c1, c2: c0c2 } = c0; - const { c0: c1c0, c1: c1c1, c2: c1c2 } = c1; - const { first: t3, second: t4 } = Fp2.Fp4Square(c0c0, c1c1); - const { first: t5, second: t6 } = Fp2.Fp4Square(c1c0, c0c2); - const { first: t7, second: t8 } = Fp2.Fp4Square(c0c1, c1c2); - const t9 = Fp2.mulByNonresidue(t8); // T8 * (u + 1) - return { - c0: Fp6.create({ - c0: Fp2.add(Fp2.mul(Fp2.sub(t3, c0c0), _2n), t3), // 2 * (T3 - c0c0) + T3 - c1: Fp2.add(Fp2.mul(Fp2.sub(t5, c0c1), _2n), t5), // 2 * (T5 - c0c1) + T5 - c2: Fp2.add(Fp2.mul(Fp2.sub(t7, c0c2), _2n), t7), - }), // 2 * (T7 - c0c2) + T7 - c1: Fp6.create({ - c0: Fp2.add(Fp2.mul(Fp2.add(t9, c1c0), _2n), t9), // 2 * (T9 + c1c0) + T9 - c1: Fp2.add(Fp2.mul(Fp2.add(t4, c1c1), _2n), t4), // 2 * (T4 + c1c1) + T4 - c2: Fp2.add(Fp2.mul(Fp2.add(t6, c1c2), _2n), t6), - }), - }; // 2 * (T6 + c1c2) + T6 - } - // https://eprint.iacr.org/2009/565.pdf - _cyclotomicExp(num, n) { - let z = this.ONE; - for (let i = this.X_LEN - 1; i >= 0; i--) { - z = this._cyclotomicSquare(z); - if ((0, utils_ts_1.bitGet)(n, i)) - z = this.mul(z, num); - } - return z; - } -} -function tower12(opts) { - const Fp = mod.Field(opts.ORDER); - const Fp2 = new _Field2(Fp, opts); - const Fp6 = new _Field6(Fp2); - const Fp12 = new _Field12(Fp6, opts); - return { Fp, Fp2, Fp6, Fp12 }; -} -//# sourceMappingURL=tower.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/tower.js.map b/tools/mnemonic-test/node_modules/@noble/curves/abstract/tower.js.map deleted file mode 100644 index e541ff80..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/tower.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tower.js","sourceRoot":"","sources":["../src/abstract/tower.ts"],"names":[],"mappings":";;AA8FA,oCA2CC;AA8sBD,0BAWC;AAl2BD;;;;;;;;;;GAUG;AACH,sEAAsE;AACtE,0CAA0E;AAC1E,oCAAoC;AAGpC,qEAAqE;AACrE,kBAAkB;AAClB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAmDzE,SAAS,yBAAyB,CAChC,EAAiB,EACjB,UAAa,EACb,OAAe,EACf,MAAc,EACd,MAAc,CAAC,EACf,OAA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,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;AAChC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/utils.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/abstract/utils.d.ts deleted file mode 100644 index 930b4854..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/utils.d.ts +++ /dev/null @@ -1,78 +0,0 @@ -/** - * Deprecated module: moved from curves/abstract/utils.js to curves/utils.js - * @module - */ -import * as u from '../utils.ts'; -/** @deprecated moved to `@noble/curves/utils.js` */ -export type Hex = u.Hex; -/** @deprecated moved to `@noble/curves/utils.js` */ -export type PrivKey = u.PrivKey; -/** @deprecated moved to `@noble/curves/utils.js` */ -export type CHash = u.CHash; -/** @deprecated moved to `@noble/curves/utils.js` */ -export type FHash = u.FHash; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const abytes: typeof u.abytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const anumber: typeof u.anumber; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const bytesToHex: typeof u.bytesToHex; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const bytesToUtf8: typeof u.bytesToUtf8; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const concatBytes: typeof u.concatBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const hexToBytes: typeof u.hexToBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const isBytes: typeof u.isBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const randomBytes: typeof u.randomBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const utf8ToBytes: typeof u.utf8ToBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const abool: typeof u.abool; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const numberToHexUnpadded: typeof u.numberToHexUnpadded; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const hexToNumber: typeof u.hexToNumber; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const bytesToNumberBE: typeof u.bytesToNumberBE; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const bytesToNumberLE: typeof u.bytesToNumberLE; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const numberToBytesBE: typeof u.numberToBytesBE; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const numberToBytesLE: typeof u.numberToBytesLE; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const numberToVarBytesBE: typeof u.numberToVarBytesBE; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const ensureBytes: typeof u.ensureBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const equalBytes: typeof u.equalBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const copyBytes: typeof u.copyBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const asciiToBytes: typeof u.asciiToBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const inRange: typeof u.inRange; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const aInRange: typeof u.aInRange; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const bitLen: typeof u.bitLen; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const bitGet: typeof u.bitGet; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const bitSet: typeof u.bitSet; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const bitMask: typeof u.bitMask; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const createHmacDrbg: typeof u.createHmacDrbg; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const notImplemented: typeof u.notImplemented; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const memoized: typeof u.memoized; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const validateObject: typeof u.validateObject; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const isHash: typeof u.isHash; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/utils.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/abstract/utils.d.ts.map deleted file mode 100644 index 6ee74259..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/abstract/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AAEjC,oDAAoD;AACpD,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC;AACxB,oDAAoD;AACpD,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC;AAChC,oDAAoD;AACpD,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;AAC5B,oDAAoD;AACpD,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;AAE5B,oDAAoD;AACpD,eAAO,MAAM,MAAM,EAAE,OAAO,CAAC,CAAC,MAAiB,CAAC;AAChD,oDAAoD;AACpD,eAAO,MAAM,OAAO,EAAE,OAAO,CAAC,CAAC,OAAmB,CAAC;AACnD,oDAAoD;AACpD,eAAO,MAAM,UAAU,EAAE,OAAO,CAAC,CAAC,UAAyB,CAAC;AAC5D,oDAAoD;AACpD,eAAO,MAAM,WAAW,EAAE,OAAO,CAAC,CAAC,WAA2B,CAAC;AAC/D,oDAAoD;AACpD,eAAO,MAAM,WAAW,EAAE,OAAO,CAAC,CAAC,WAA2B,CAAC;AAC/D,oDAAoD;AACpD,eAAO,MAAM,UAAU,EAAE,OAAO,CAAC,CAAC,UAAyB,CAAC;AAC5D,oDAAoD;AACpD,eAAO,MAAM,OAAO,EAAE,OAAO,CAAC,CAAC,OAAmB,CAAC;AACnD,oDAAoD;AACpD,eAAO,MAAM,WAAW,EAAE,OAAO,CAAC,CAAC,WAA2B,CAAC;AAC/D,oDAAoD;AACpD,eAA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,MAAM,MAAM,EAAE,OAAO,CAAC,CAAC,MAAiB,CAAC;AAChD,oDAAoD;AACpD,eAAO,MAAM,MAAM,EAAE,OAAO,CAAC,CAAC,MAAiB,CAAC;AAChD,oDAAoD;AACpD,eAAO,MAAM,OAAO,EAAE,OAAO,CAAC,CAAC,OAAmB,CAAC;AACnD,oDAAoD;AACpD,eAAO,MAAM,cAAc,EAAE,OAAO,CAAC,CAAC,cAAiC,CAAC;AACxE,oDAAoD;AACpD,eAAO,MAAM,cAAc,EAAE,OAAO,CAAC,CAAC,cAAiC,CAAC;AACxE,oDAAoD;AACpD,eAAO,MAAM,QAAQ,EAAE,OAAO,CAAC,CAAC,QAAqB,CAAC;AACtD,oDAAoD;AACpD,eAAO,MAAM,cAAc,EAAE,OAAO,CAAC,CAAC,cAAiC,CAAC;AACxE,oDAAoD;AACpD,eAAO,MAAM,MAAM,EAAE,OAAO,CAAC,CAAC,MAAiB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/utils.js b/tools/mnemonic-test/node_modules/@noble/curves/abstract/utils.js deleted file mode 100644 index f7e6385a..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/utils.js +++ /dev/null @@ -1,73 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.isHash = exports.validateObject = exports.memoized = exports.notImplemented = exports.createHmacDrbg = exports.bitMask = exports.bitSet = exports.bitGet = exports.bitLen = exports.aInRange = exports.inRange = exports.asciiToBytes = exports.copyBytes = exports.equalBytes = exports.ensureBytes = exports.numberToVarBytesBE = exports.numberToBytesLE = exports.numberToBytesBE = exports.bytesToNumberLE = exports.bytesToNumberBE = exports.hexToNumber = exports.numberToHexUnpadded = exports.abool = exports.utf8ToBytes = exports.randomBytes = exports.isBytes = exports.hexToBytes = exports.concatBytes = exports.bytesToUtf8 = exports.bytesToHex = exports.anumber = exports.abytes = void 0; -/** - * Deprecated module: moved from curves/abstract/utils.js to curves/utils.js - * @module - */ -const u = require("../utils.js"); -/** @deprecated moved to `@noble/curves/utils.js` */ -exports.abytes = u.abytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -exports.anumber = u.anumber; -/** @deprecated moved to `@noble/curves/utils.js` */ -exports.bytesToHex = u.bytesToHex; -/** @deprecated moved to `@noble/curves/utils.js` */ -exports.bytesToUtf8 = u.bytesToUtf8; -/** @deprecated moved to `@noble/curves/utils.js` */ -exports.concatBytes = u.concatBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -exports.hexToBytes = u.hexToBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -exports.isBytes = u.isBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -exports.randomBytes = u.randomBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -exports.utf8ToBytes = u.utf8ToBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -exports.abool = u.abool; -/** @deprecated moved to `@noble/curves/utils.js` */ -exports.numberToHexUnpadded = u.numberToHexUnpadded; -/** @deprecated moved to `@noble/curves/utils.js` */ -exports.hexToNumber = u.hexToNumber; -/** @deprecated moved to `@noble/curves/utils.js` */ -exports.bytesToNumberBE = u.bytesToNumberBE; -/** @deprecated moved to `@noble/curves/utils.js` */ -exports.bytesToNumberLE = u.bytesToNumberLE; -/** @deprecated moved to `@noble/curves/utils.js` */ -exports.numberToBytesBE = u.numberToBytesBE; -/** @deprecated moved to `@noble/curves/utils.js` */ -exports.numberToBytesLE = u.numberToBytesLE; -/** @deprecated moved to `@noble/curves/utils.js` */ -exports.numberToVarBytesBE = u.numberToVarBytesBE; -/** @deprecated moved to `@noble/curves/utils.js` */ -exports.ensureBytes = u.ensureBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -exports.equalBytes = u.equalBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -exports.copyBytes = u.copyBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -exports.asciiToBytes = u.asciiToBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -exports.inRange = u.inRange; -/** @deprecated moved to `@noble/curves/utils.js` */ -exports.aInRange = u.aInRange; -/** @deprecated moved to `@noble/curves/utils.js` */ -exports.bitLen = u.bitLen; -/** @deprecated moved to `@noble/curves/utils.js` */ -exports.bitGet = u.bitGet; -/** @deprecated moved to `@noble/curves/utils.js` */ -exports.bitSet = u.bitSet; -/** @deprecated moved to `@noble/curves/utils.js` */ -exports.bitMask = u.bitMask; -/** @deprecated moved to `@noble/curves/utils.js` */ -exports.createHmacDrbg = u.createHmacDrbg; -/** @deprecated moved to `@noble/curves/utils.js` */ -exports.notImplemented = u.notImplemented; -/** @deprecated moved to `@noble/curves/utils.js` */ -exports.memoized = u.memoized; -/** @deprecated moved to `@noble/curves/utils.js` */ -exports.validateObject = u.validateObject; -/** @deprecated moved to `@noble/curves/utils.js` */ -exports.isHash = u.isHash; -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/utils.js.map b/tools/mnemonic-test/node_modules/@noble/curves/abstract/utils.js.map deleted file mode 100644 index a026f9b9..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/abstract/utils.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,iCAAiC;AAWjC,oDAAoD;AACvC,QAAA,MAAM,GAAoB,CAAC,CAAC,MAAM,CAAC;AAChD,oDAAoD;AACvC,QAAA,OAAO,GAAqB,CAAC,CAAC,OAAO,CAAC;AACnD,oDAAoD;AACvC,QAAA,UAAU,GAAwB,CAAC,CAAC,UAAU,CAAC;AAC5D,oDAAoD;AACvC,QAAA,WAAW,GAAyB,CAAC,CAAC,WAAW,CAAC;AAC/D,oDAAoD;AACvC,QAAA,WAAW,GAAyB,CAAC,CAAC,WAAW,CAAC;AAC/D,oDAAoD;AACvC,QAAA,UAAU,GAAwB,CAAC,CAAC,UAAU,CAA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,CAAC;AAChD,oDAAoD;AACvC,QAAA,MAAM,GAAoB,CAAC,CAAC,MAAM,CAAC;AAChD,oDAAoD;AACvC,QAAA,OAAO,GAAqB,CAAC,CAAC,OAAO,CAAC;AACnD,oDAAoD;AACvC,QAAA,cAAc,GAA4B,CAAC,CAAC,cAAc,CAAC;AACxE,oDAAoD;AACvC,QAAA,cAAc,GAA4B,CAAC,CAAC,cAAc,CAAC;AACxE,oDAAoD;AACvC,QAAA,QAAQ,GAAsB,CAAC,CAAC,QAAQ,CAAC;AACtD,oDAAoD;AACvC,QAAA,cAAc,GAA4B,CAAC,CAAC,cAAc,CAAC;AACxE,oDAAoD;AACvC,QAAA,MAAM,GAAoB,CAAC,CAAC,MAAM,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/weierstrass.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/abstract/weierstrass.d.ts deleted file mode 100644 index 9477038b..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/weierstrass.d.ts +++ /dev/null @@ -1,416 +0,0 @@ -import { type CHash, type Hex, type PrivKey } from '../utils.ts'; -import { type AffinePoint, type BasicCurve, type CurveLengths, type CurvePoint, type CurvePointCons } from './curve.ts'; -import { type IField, type NLength } from './modular.ts'; -export type { AffinePoint }; -export type HmacFnSync = (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array; -type EndoBasis = [[bigint, bigint], [bigint, bigint]]; -/** - * When Weierstrass curve has `a=0`, it becomes Koblitz curve. - * Koblitz curves allow using **efficiently-computable GLV endomorphism ψ**. - * Endomorphism uses 2x less RAM, speeds up precomputation by 2x and ECDH / key recovery by 20%. - * For precomputed wNAF it trades off 1/2 init time & 1/3 ram for 20% perf hit. - * - * Endomorphism consists of beta, lambda and splitScalar: - * - * 1. GLV endomorphism ψ transforms a point: `P = (x, y) ↦ ψ(P) = (β·x mod p, y)` - * 2. GLV scalar decomposition transforms a scalar: `k ≡ k₁ + k₂·λ (mod n)` - * 3. Then these are combined: `k·P = k₁·P + k₂·ψ(P)` - * 4. Two 128-bit point-by-scalar multiplications + one point addition is faster than - * one 256-bit multiplication. - * - * where - * * beta: β ∈ Fₚ with β³ = 1, β ≠ 1 - * * lambda: λ ∈ Fₙ with λ³ = 1, λ ≠ 1 - * * splitScalar decomposes k ↦ k₁, k₂, by using reduced basis vectors. - * Gauss lattice reduction calculates them from initial basis vectors `(n, 0), (-λ, 0)` - * - * Check out `test/misc/endomorphism.js` and - * [gist](https://gist.github.com/paulmillr/eb670806793e84df628a7c434a873066). - */ -export type EndomorphismOpts = { - beta: bigint; - basises?: EndoBasis; - splitScalar?: (k: bigint) => { - k1neg: boolean; - k1: bigint; - k2neg: boolean; - k2: bigint; - }; -}; -export type ScalarEndoParts = { - k1neg: boolean; - k1: bigint; - k2neg: boolean; - k2: bigint; -}; -/** - * Splits scalar for GLV endomorphism. - */ -export declare function _splitEndoScalar(k: bigint, basis: EndoBasis, n: bigint): ScalarEndoParts; -export type ECDSASigFormat = 'compact' | 'recovered' | 'der'; -export type ECDSARecoverOpts = { - prehash?: boolean; -}; -export type ECDSAVerifyOpts = { - prehash?: boolean; - lowS?: boolean; - format?: ECDSASigFormat; -}; -export type ECDSASignOpts = { - prehash?: boolean; - lowS?: boolean; - format?: ECDSASigFormat; - extraEntropy?: Uint8Array | boolean; -}; -/** Instance methods for 3D XYZ projective points. */ -export interface WeierstrassPoint extends CurvePoint> { - /** projective X coordinate. Different from affine x. */ - readonly X: T; - /** projective Y coordinate. Different from affine y. */ - readonly Y: T; - /** projective z coordinate */ - readonly Z: T; - /** affine x coordinate. Different from projective X. */ - get x(): T; - /** affine y coordinate. Different from projective Y. */ - get y(): T; - /** Encodes point using IEEE P1363 (DER) encoding. First byte is 2/3/4. Default = isCompressed. */ - toBytes(isCompressed?: boolean): Uint8Array; - toHex(isCompressed?: boolean): string; - /** @deprecated use `.X` */ - readonly px: T; - /** @deprecated use `.Y` */ - readonly py: T; - /** @deprecated use `.Z` */ - readonly pz: T; - /** @deprecated use `toBytes` */ - toRawBytes(isCompressed?: boolean): Uint8Array; - /** @deprecated use `multiplyUnsafe` */ - multiplyAndAddUnsafe(Q: WeierstrassPoint, a: bigint, b: bigint): WeierstrassPoint | undefined; - /** @deprecated use `p.y % 2n === 0n` */ - hasEvenY(): boolean; - /** @deprecated use `p.precompute(windowSize)` */ - _setWindowSize(windowSize: number): void; -} -/** Static methods for 3D XYZ projective points. */ -export interface WeierstrassPointCons extends CurvePointCons> { - /** Does NOT validate if the point is valid. Use `.assertValidity()`. */ - new (X: T, Y: T, Z: T): WeierstrassPoint; - CURVE(): WeierstrassOpts; - /** @deprecated use `Point.BASE.multiply(Point.Fn.fromBytes(privateKey))` */ - fromPrivateKey(privateKey: PrivKey): WeierstrassPoint; - /** @deprecated use `import { normalizeZ } from '@noble/curves/abstract/curve.js';` */ - normalizeZ(points: WeierstrassPoint[]): WeierstrassPoint[]; - /** @deprecated use `import { pippenger } from '@noble/curves/abstract/curve.js';` */ - msm(points: WeierstrassPoint[], scalars: bigint[]): WeierstrassPoint; -} -/** - * Weierstrass curve options. - * - * * p: prime characteristic (order) of finite field, in which arithmetics is done - * * n: order of prime subgroup a.k.a total amount of valid curve points - * * h: cofactor, usually 1. h*n is group order; n is subgroup order - * * a: formula param, must be in field of p - * * b: formula param, must be in field of p - * * Gx: x coordinate of generator point a.k.a. base point - * * Gy: y coordinate of generator point - */ -export type WeierstrassOpts = Readonly<{ - p: bigint; - n: bigint; - h: bigint; - a: T; - b: T; - Gx: T; - Gy: T; -}>; -export type WeierstrassExtraOpts = Partial<{ - Fp: IField; - Fn: IField; - allowInfinityPoint: boolean; - endo: EndomorphismOpts; - isTorsionFree: (c: WeierstrassPointCons, point: WeierstrassPoint) => boolean; - clearCofactor: (c: WeierstrassPointCons, point: WeierstrassPoint) => WeierstrassPoint; - fromBytes: (bytes: Uint8Array) => AffinePoint; - toBytes: (c: WeierstrassPointCons, point: WeierstrassPoint, isCompressed: boolean) => Uint8Array; -}>; -/** - * Options for ECDSA signatures over a Weierstrass curve. - * - * * lowS: (default: true) whether produced / verified signatures occupy low half of ecdsaOpts.p. Prevents malleability. - * * hmac: (default: noble-hashes hmac) function, would be used to init hmac-drbg for k generation. - * * randomBytes: (default: webcrypto os-level CSPRNG) custom method for fetching secure randomness. - * * bits2int, bits2int_modN: used in sigs, sometimes overridden by curves - */ -export type ECDSAOpts = Partial<{ - lowS: boolean; - hmac: HmacFnSync; - randomBytes: (bytesLength?: number) => Uint8Array; - bits2int: (bytes: Uint8Array) => bigint; - bits2int_modN: (bytes: Uint8Array) => bigint; -}>; -/** - * Elliptic Curve Diffie-Hellman interface. - * Provides keygen, secret-to-public conversion, calculating shared secrets. - */ -export interface ECDH { - keygen: (seed?: Uint8Array) => { - secretKey: Uint8Array; - publicKey: Uint8Array; - }; - getPublicKey: (secretKey: PrivKey, isCompressed?: boolean) => Uint8Array; - getSharedSecret: (secretKeyA: PrivKey, publicKeyB: Hex, isCompressed?: boolean) => Uint8Array; - Point: WeierstrassPointCons; - utils: { - isValidSecretKey: (secretKey: PrivKey) => boolean; - isValidPublicKey: (publicKey: Uint8Array, isCompressed?: boolean) => boolean; - randomSecretKey: (seed?: Uint8Array) => Uint8Array; - /** @deprecated use `randomSecretKey` */ - randomPrivateKey: (seed?: Uint8Array) => Uint8Array; - /** @deprecated use `isValidSecretKey` */ - isValidPrivateKey: (secretKey: PrivKey) => boolean; - /** @deprecated use `Point.Fn.fromBytes()` */ - normPrivateKeyToScalar: (key: PrivKey) => bigint; - /** @deprecated use `point.precompute()` */ - precompute: (windowSize?: number, point?: WeierstrassPoint) => WeierstrassPoint; - }; - lengths: CurveLengths; -} -/** - * ECDSA interface. - * Only supported for prime fields, not Fp2 (extension fields). - */ -export interface ECDSA extends ECDH { - sign: (message: Hex, secretKey: PrivKey, opts?: ECDSASignOpts) => ECDSASigRecovered; - verify: (signature: Uint8Array, message: Uint8Array, publicKey: Uint8Array, opts?: ECDSAVerifyOpts) => boolean; - recoverPublicKey(signature: Uint8Array, message: Uint8Array, opts?: ECDSARecoverOpts): Uint8Array; - Signature: ECDSASignatureCons; -} -export declare class DERErr extends Error { - constructor(m?: string); -} -export type IDER = { - Err: typeof DERErr; - _tlv: { - encode: (tag: number, data: string) => string; - decode(tag: number, data: Uint8Array): { - v: Uint8Array; - l: Uint8Array; - }; - }; - _int: { - encode(num: bigint): string; - decode(data: Uint8Array): bigint; - }; - toSig(hex: string | Uint8Array): { - r: bigint; - s: bigint; - }; - hexFromSig(sig: { - r: bigint; - s: bigint; - }): string; -}; -/** - * ASN.1 DER encoding utilities. ASN is very complex & fragile. Format: - * - * [0x30 (SEQUENCE), bytelength, 0x02 (INTEGER), intLength, R, 0x02 (INTEGER), intLength, S] - * - * Docs: https://letsencrypt.org/docs/a-warm-welcome-to-asn1-and-der/, https://luca.ntop.org/Teaching/Appunti/asn1.html - */ -export declare const DER: IDER; -export declare function _normFnElement(Fn: IField, key: PrivKey): bigint; -/** - * Creates weierstrass Point constructor, based on specified curve options. - * - * @example -```js -const opts = { - p: BigInt('0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff'), - n: BigInt('0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551'), - h: BigInt(1), - a: BigInt('0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc'), - b: BigInt('0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b'), - Gx: BigInt('0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296'), - Gy: BigInt('0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5'), -}; -const p256_Point = weierstrass(opts); -``` - */ -export declare function weierstrassN(params: WeierstrassOpts, extraOpts?: WeierstrassExtraOpts): WeierstrassPointCons; -/** Methods of ECDSA signature instance. */ -export interface ECDSASignature { - readonly r: bigint; - readonly s: bigint; - readonly recovery?: number; - addRecoveryBit(recovery: number): ECDSASigRecovered; - hasHighS(): boolean; - toBytes(format?: string): Uint8Array; - toHex(format?: string): string; - /** @deprecated */ - assertValidity(): void; - /** @deprecated */ - normalizeS(): ECDSASignature; - /** @deprecated use standalone method `curve.recoverPublicKey(sig.toBytes('recovered'), msg)` */ - recoverPublicKey(msgHash: Hex): WeierstrassPoint; - /** @deprecated use `.toBytes('compact')` */ - toCompactRawBytes(): Uint8Array; - /** @deprecated use `.toBytes('compact')` */ - toCompactHex(): string; - /** @deprecated use `.toBytes('der')` */ - toDERRawBytes(): Uint8Array; - /** @deprecated use `.toBytes('der')` */ - toDERHex(): string; -} -export type ECDSASigRecovered = ECDSASignature & { - readonly recovery: number; -}; -/** Methods of ECDSA signature constructor. */ -export type ECDSASignatureCons = { - new (r: bigint, s: bigint, recovery?: number): ECDSASignature; - fromBytes(bytes: Uint8Array, format?: ECDSASigFormat): ECDSASignature; - fromHex(hex: string, format?: ECDSASigFormat): ECDSASignature; - /** @deprecated use `.fromBytes(bytes, 'compact')` */ - fromCompact(hex: Hex): ECDSASignature; - /** @deprecated use `.fromBytes(bytes, 'der')` */ - fromDER(hex: Hex): ECDSASignature; -}; -/** - * Implementation of the Shallue and van de Woestijne method for any weierstrass curve. - * TODO: check if there is a way to merge this with uvRatio in Edwards; move to modular. - * b = True and y = sqrt(u / v) if (u / v) is square in F, and - * b = False and y = sqrt(Z * (u / v)) otherwise. - * @param Fp - * @param Z - * @returns - */ -export declare function SWUFpSqrtRatio(Fp: IField, Z: T): (u: T, v: T) => { - isValid: boolean; - value: T; -}; -/** - * Simplified Shallue-van de Woestijne-Ulas Method - * https://www.rfc-editor.org/rfc/rfc9380#section-6.6.2 - */ -export declare function mapToCurveSimpleSWU(Fp: IField, opts: { - A: T; - B: T; - Z: T; -}): (u: T) => { - x: T; - y: T; -}; -/** - * Sometimes users only need getPublicKey, getSharedSecret, and secret key handling. - * This helper ensures no signature functionality is present. Less code, smaller bundle size. - */ -export declare function ecdh(Point: WeierstrassPointCons, ecdhOpts?: { - randomBytes?: (bytesLength?: number) => Uint8Array; -}): ECDH; -/** - * Creates ECDSA signing interface for given elliptic curve `Point` and `hash` function. - * We need `hash` for 2 features: - * 1. Message prehash-ing. NOT used if `sign` / `verify` are called with `prehash: false` - * 2. k generation in `sign`, using HMAC-drbg(hash) - * - * ECDSAOpts are only rarely needed. - * - * @example - * ```js - * const p256_Point = weierstrass(...); - * const p256_sha256 = ecdsa(p256_Point, sha256); - * const p256_sha224 = ecdsa(p256_Point, sha224); - * const p256_sha224_r = ecdsa(p256_Point, sha224, { randomBytes: (length) => { ... } }); - * ``` - */ -export declare function ecdsa(Point: WeierstrassPointCons, hash: CHash, ecdsaOpts?: ECDSAOpts): ECDSA; -/** @deprecated use ECDSASignature */ -export type SignatureType = ECDSASignature; -/** @deprecated use ECDSASigRecovered */ -export type RecoveredSignatureType = ECDSASigRecovered; -/** @deprecated switch to Uint8Array signatures in format 'compact' */ -export type SignatureLike = { - r: bigint; - s: bigint; -}; -export type ECDSAExtraEntropy = Hex | boolean; -/** @deprecated use `ECDSAExtraEntropy` */ -export type Entropy = Hex | boolean; -export type BasicWCurve = BasicCurve & { - a: T; - b: T; - allowedPrivateKeyLengths?: readonly number[]; - wrapPrivateKey?: boolean; - endo?: EndomorphismOpts; - isTorsionFree?: (c: WeierstrassPointCons, point: WeierstrassPoint) => boolean; - clearCofactor?: (c: WeierstrassPointCons, point: WeierstrassPoint) => WeierstrassPoint; -}; -/** @deprecated use ECDSASignOpts */ -export type SignOpts = ECDSASignOpts; -/** @deprecated use ECDSASignOpts */ -export type VerOpts = ECDSAVerifyOpts; -/** @deprecated use WeierstrassPoint */ -export type ProjPointType = WeierstrassPoint; -/** @deprecated use WeierstrassPointCons */ -export type ProjConstructor = WeierstrassPointCons; -/** @deprecated use ECDSASignatureCons */ -export type SignatureConstructor = ECDSASignatureCons; -export type CurvePointsType = BasicWCurve & { - fromBytes?: (bytes: Uint8Array) => AffinePoint; - toBytes?: (c: WeierstrassPointCons, point: WeierstrassPoint, isCompressed: boolean) => Uint8Array; -}; -export type CurvePointsTypeWithLength = Readonly & Partial>; -export type CurvePointsRes = { - Point: WeierstrassPointCons; - /** @deprecated use `Point.CURVE()` */ - CURVE: CurvePointsType; - /** @deprecated use `Point` */ - ProjectivePoint: WeierstrassPointCons; - /** @deprecated use `Point.Fn.fromBytes(privateKey)` */ - normPrivateKeyToScalar: (key: PrivKey) => bigint; - /** @deprecated */ - weierstrassEquation: (x: T) => T; - /** @deprecated use `Point.Fn.isValidNot0(num)` */ - isWithinCurveOrder: (num: bigint) => boolean; -}; -/** @deprecated use `Uint8Array` */ -export type PubKey = Hex | WeierstrassPoint; -export type CurveType = BasicWCurve & { - hash: CHash; - hmac?: HmacFnSync; - randomBytes?: (bytesLength?: number) => Uint8Array; - lowS?: boolean; - bits2int?: (bytes: Uint8Array) => bigint; - bits2int_modN?: (bytes: Uint8Array) => bigint; -}; -export type CurveFn = { - /** @deprecated use `Point.CURVE()` */ - CURVE: CurvePointsType; - keygen: ECDSA['keygen']; - getPublicKey: ECDSA['getPublicKey']; - getSharedSecret: ECDSA['getSharedSecret']; - sign: ECDSA['sign']; - verify: ECDSA['verify']; - Point: WeierstrassPointCons; - /** @deprecated use `Point` */ - ProjectivePoint: WeierstrassPointCons; - Signature: ECDSASignatureCons; - utils: ECDSA['utils']; - lengths: ECDSA['lengths']; -}; -/** @deprecated use `weierstrass` in newer releases */ -export declare function weierstrassPoints(c: CurvePointsTypeWithLength): CurvePointsRes; -export type WsPointComposed = { - CURVE: WeierstrassOpts; - curveOpts: WeierstrassExtraOpts; -}; -export type WsComposed = { - /** @deprecated use `Point.CURVE()` */ - CURVE: WeierstrassOpts; - hash: CHash; - curveOpts: WeierstrassExtraOpts; - ecdsaOpts: ECDSAOpts; -}; -export declare function _legacyHelperEquat(Fp: IField, a: T, b: T): (x: T) => T; -export declare function weierstrass(c: CurveType): CurveFn; -//# sourceMappingURL=weierstrass.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/weierstrass.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/abstract/weierstrass.d.ts.map deleted file mode 100644 index e698d52a..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/weierstrass.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"weierstrass.d.ts","sourceRoot":"","sources":["../src/abstract/weierstrass.ts"],"names":[],"mappings":"AA6BA,OAAO,EAkBL,KAAK,KAAK,EACV,KAAK,GAAG,EACR,KAAK,OAAO,EACb,MAAM,aAAa,CAAC;AACrB,OAAO,EAOL,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,cAAc,EACpB,MAAM,YAAY,CAAC;AACpB,OAAO,EAOL,KAAK,MAAM,EACX,KAAK,OAAO,EACb,MAAM,cAAc,CAAC;AAEtB,YAAY,EAAE,WAAW,EAAE,CAAC;AAC5B,MAAM,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,QAAQ,EAAE,UAAU,EAAE,KAAK,UAAU,CAAC;AAEpF,KAAK,SAAS,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AACtD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;CACzF,CAAC;AAKF,MAAM,MAAM,eAAe,GAAG;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OA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AAC,CAAC;IAC/B,IAAI,EAAE,KAAK,CAAC;IACZ,SAAS,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAC;IACxC,SAAS,EAAE,SAAS,CAAC;CACtB,CAAC;AA2CF,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAW5E;AA+BD,wBAAgB,WAAW,CAAC,CAAC,EAAE,SAAS,GAAG,OAAO,CAKjD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/weierstrass.js b/tools/mnemonic-test/node_modules/@noble/curves/abstract/weierstrass.js deleted file mode 100644 index a7a912fa..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/weierstrass.js +++ /dev/null @@ -1,1427 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.DER = exports.DERErr = void 0; -exports._splitEndoScalar = _splitEndoScalar; -exports._normFnElement = _normFnElement; -exports.weierstrassN = weierstrassN; -exports.SWUFpSqrtRatio = SWUFpSqrtRatio; -exports.mapToCurveSimpleSWU = mapToCurveSimpleSWU; -exports.ecdh = ecdh; -exports.ecdsa = ecdsa; -exports.weierstrassPoints = weierstrassPoints; -exports._legacyHelperEquat = _legacyHelperEquat; -exports.weierstrass = weierstrass; -/** - * Short Weierstrass curve methods. The formula is: y² = x³ + ax + b. - * - * ### Design rationale for types - * - * * Interaction between classes from different curves should fail: - * `k256.Point.BASE.add(p256.Point.BASE)` - * * For this purpose we want to use `instanceof` operator, which is fast and works during runtime - * * Different calls of `curve()` would return different classes - - * `curve(params) !== curve(params)`: if somebody decided to monkey-patch their curve, - * it won't affect others - * - * TypeScript can't infer types for classes created inside a function. Classes is one instance - * of nominative types in TypeScript and interfaces only check for shape, so it's hard to create - * unique type for every function call. - * - * We can use generic types via some param, like curve opts, but that would: - * 1. Enable interaction between `curve(params)` and `curve(params)` (curves of same params) - * which is hard to debug. - * 2. Params can be generic and we can't enforce them to be constant value: - * if somebody creates curve from non-constant params, - * it would be allowed to interact with other curves with non-constant params - * - * @todo https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html#unique-symbol - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const hmac_js_1 = require("@noble/hashes/hmac.js"); -const utils_1 = require("@noble/hashes/utils"); -const utils_ts_1 = require("../utils.js"); -const curve_ts_1 = require("./curve.js"); -const modular_ts_1 = require("./modular.js"); -// We construct basis in such way that den is always positive and equals n, but num sign depends on basis (not on secret value) -const divNearest = (num, den) => (num + (num >= 0 ? den : -den) / _2n) / den; -/** - * Splits scalar for GLV endomorphism. - */ -function _splitEndoScalar(k, basis, n) { - // Split scalar into two such that part is ~half bits: `abs(part) < sqrt(N)` - // Since part can be negative, we need to do this on point. - // TODO: verifyScalar function which consumes lambda - const [[a1, b1], [a2, b2]] = basis; - const c1 = divNearest(b2 * k, n); - const c2 = divNearest(-b1 * k, n); - // |k1|/|k2| is < sqrt(N), but can be negative. - // If we do `k1 mod N`, we'll get big scalar (`> sqrt(N)`): so, we do cheaper negation instead. - let k1 = k - c1 * a1 - c2 * a2; - let k2 = -c1 * b1 - c2 * b2; - const k1neg = k1 < _0n; - const k2neg = k2 < _0n; - if (k1neg) - k1 = -k1; - if (k2neg) - k2 = -k2; - // Double check that resulting scalar less than half bits of N: otherwise wNAF will fail. - // This should only happen on wrong basises. Also, math inside is too complex and I don't trust it. - const MAX_NUM = (0, utils_ts_1.bitMask)(Math.ceil((0, utils_ts_1.bitLen)(n) / 2)) + _1n; // Half bits of N - if (k1 < _0n || k1 >= MAX_NUM || k2 < _0n || k2 >= MAX_NUM) { - throw new Error('splitScalar (endomorphism): failed, k=' + k); - } - return { k1neg, k1, k2neg, k2 }; -} -function validateSigFormat(format) { - if (!['compact', 'recovered', 'der'].includes(format)) - throw new Error('Signature format must be "compact", "recovered", or "der"'); - return format; -} -function validateSigOpts(opts, def) { - const optsn = {}; - for (let optName of Object.keys(def)) { - // @ts-ignore - optsn[optName] = opts[optName] === undefined ? def[optName] : opts[optName]; - } - (0, utils_ts_1._abool2)(optsn.lowS, 'lowS'); - (0, utils_ts_1._abool2)(optsn.prehash, 'prehash'); - if (optsn.format !== undefined) - validateSigFormat(optsn.format); - return optsn; -} -class DERErr extends Error { - constructor(m = '') { - super(m); - } -} -exports.DERErr = DERErr; -/** - * ASN.1 DER encoding utilities. ASN is very complex & fragile. Format: - * - * [0x30 (SEQUENCE), bytelength, 0x02 (INTEGER), intLength, R, 0x02 (INTEGER), intLength, S] - * - * Docs: https://letsencrypt.org/docs/a-warm-welcome-to-asn1-and-der/, https://luca.ntop.org/Teaching/Appunti/asn1.html - */ -exports.DER = { - // asn.1 DER encoding utils - Err: DERErr, - // Basic building block is TLV (Tag-Length-Value) - _tlv: { - encode: (tag, data) => { - const { Err: E } = exports.DER; - if (tag < 0 || tag > 256) - throw new E('tlv.encode: wrong tag'); - if (data.length & 1) - throw new E('tlv.encode: unpadded data'); - const dataLen = data.length / 2; - const len = (0, utils_ts_1.numberToHexUnpadded)(dataLen); - if ((len.length / 2) & 128) - throw new E('tlv.encode: long form length too big'); - // length of length with long form flag - const lenLen = dataLen > 127 ? (0, utils_ts_1.numberToHexUnpadded)((len.length / 2) | 128) : ''; - const t = (0, utils_ts_1.numberToHexUnpadded)(tag); - return t + lenLen + len + data; - }, - // v - value, l - left bytes (unparsed) - decode(tag, data) { - const { Err: E } = exports.DER; - let pos = 0; - if (tag < 0 || tag > 256) - throw new E('tlv.encode: wrong tag'); - if (data.length < 2 || data[pos++] !== tag) - throw new E('tlv.decode: wrong tlv'); - const first = data[pos++]; - const isLong = !!(first & 128); // First bit of first length byte is flag for short/long form - let length = 0; - if (!isLong) - length = first; - else { - // Long form: [longFlag(1bit), lengthLength(7bit), length (BE)] - const lenLen = first & 127; - if (!lenLen) - throw new E('tlv.decode(long): indefinite length not supported'); - if (lenLen > 4) - throw new E('tlv.decode(long): byte length is too big'); // this will overflow u32 in js - const lengthBytes = data.subarray(pos, pos + lenLen); - if (lengthBytes.length !== lenLen) - throw new E('tlv.decode: length bytes not complete'); - if (lengthBytes[0] === 0) - throw new E('tlv.decode(long): zero leftmost byte'); - for (const b of lengthBytes) - length = (length << 8) | b; - pos += lenLen; - if (length < 128) - throw new E('tlv.decode(long): not minimal encoding'); - } - const v = data.subarray(pos, pos + length); - if (v.length !== length) - throw new E('tlv.decode: wrong value length'); - return { v, l: data.subarray(pos + length) }; - }, - }, - // https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag, - // since we always use positive integers here. It must always be empty: - // - add zero byte if exists - // - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding) - _int: { - encode(num) { - const { Err: E } = exports.DER; - if (num < _0n) - throw new E('integer: negative integers are not allowed'); - let hex = (0, utils_ts_1.numberToHexUnpadded)(num); - // Pad with zero byte if negative flag is present - if (Number.parseInt(hex[0], 16) & 0b1000) - hex = '00' + hex; - if (hex.length & 1) - throw new E('unexpected DER parsing assertion: unpadded hex'); - return hex; - }, - decode(data) { - const { Err: E } = exports.DER; - if (data[0] & 128) - throw new E('invalid signature integer: negative'); - if (data[0] === 0x00 && !(data[1] & 128)) - throw new E('invalid signature integer: unnecessary leading zero'); - return (0, utils_ts_1.bytesToNumberBE)(data); - }, - }, - toSig(hex) { - // parse DER signature - const { Err: E, _int: int, _tlv: tlv } = exports.DER; - const data = (0, utils_ts_1.ensureBytes)('signature', hex); - const { v: seqBytes, l: seqLeftBytes } = tlv.decode(0x30, data); - if (seqLeftBytes.length) - throw new E('invalid signature: left bytes after parsing'); - const { v: rBytes, l: rLeftBytes } = tlv.decode(0x02, seqBytes); - const { v: sBytes, l: sLeftBytes } = tlv.decode(0x02, rLeftBytes); - if (sLeftBytes.length) - throw new E('invalid signature: left bytes after parsing'); - return { r: int.decode(rBytes), s: int.decode(sBytes) }; - }, - hexFromSig(sig) { - const { _tlv: tlv, _int: int } = exports.DER; - const rs = tlv.encode(0x02, int.encode(sig.r)); - const ss = tlv.encode(0x02, int.encode(sig.s)); - const seq = rs + ss; - return tlv.encode(0x30, seq); - }, -}; -// Be friendly to bad ECMAScript parsers by not using bigint literals -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = BigInt(4); -function _normFnElement(Fn, key) { - const { BYTES: expected } = Fn; - let num; - if (typeof key === 'bigint') { - num = key; - } - else { - let bytes = (0, utils_ts_1.ensureBytes)('private key', key); - try { - num = Fn.fromBytes(bytes); - } - catch (error) { - throw new Error(`invalid private key: expected ui8a of size ${expected}, got ${typeof key}`); - } - } - if (!Fn.isValidNot0(num)) - throw new Error('invalid private key: out of range [1..N-1]'); - return num; -} -/** - * Creates weierstrass Point constructor, based on specified curve options. - * - * @example -```js -const opts = { - p: BigInt('0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff'), - n: BigInt('0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551'), - h: BigInt(1), - a: BigInt('0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc'), - b: BigInt('0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b'), - Gx: BigInt('0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296'), - Gy: BigInt('0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5'), -}; -const p256_Point = weierstrass(opts); -``` - */ -function weierstrassN(params, extraOpts = {}) { - const validated = (0, curve_ts_1._createCurveFields)('weierstrass', params, extraOpts); - const { Fp, Fn } = validated; - let CURVE = validated.CURVE; - const { h: cofactor, n: CURVE_ORDER } = CURVE; - (0, utils_ts_1._validateObject)(extraOpts, {}, { - allowInfinityPoint: 'boolean', - clearCofactor: 'function', - isTorsionFree: 'function', - fromBytes: 'function', - toBytes: 'function', - endo: 'object', - wrapPrivateKey: 'boolean', - }); - const { endo } = extraOpts; - if (endo) { - // validateObject(endo, { beta: 'bigint', splitScalar: 'function' }); - if (!Fp.is0(CURVE.a) || typeof endo.beta !== 'bigint' || !Array.isArray(endo.basises)) { - throw new Error('invalid endo: expected "beta": bigint and "basises": array'); - } - } - const lengths = getWLengths(Fp, Fn); - function assertCompressionIsSupported() { - if (!Fp.isOdd) - throw new Error('compression is not supported: Field does not have .isOdd()'); - } - // Implements IEEE P1363 point encoding - function pointToBytes(_c, point, isCompressed) { - const { x, y } = point.toAffine(); - const bx = Fp.toBytes(x); - (0, utils_ts_1._abool2)(isCompressed, 'isCompressed'); - if (isCompressed) { - assertCompressionIsSupported(); - const hasEvenY = !Fp.isOdd(y); - return (0, utils_ts_1.concatBytes)(pprefix(hasEvenY), bx); - } - else { - return (0, utils_ts_1.concatBytes)(Uint8Array.of(0x04), bx, Fp.toBytes(y)); - } - } - function pointFromBytes(bytes) { - (0, utils_ts_1._abytes2)(bytes, undefined, 'Point'); - const { publicKey: comp, publicKeyUncompressed: uncomp } = lengths; // e.g. for 32-byte: 33, 65 - const length = bytes.length; - const head = bytes[0]; - const tail = bytes.subarray(1); - // No actual validation is done here: use .assertValidity() - if (length === comp && (head === 0x02 || head === 0x03)) { - const x = Fp.fromBytes(tail); - if (!Fp.isValid(x)) - throw new Error('bad point: is not on curve, wrong x'); - const y2 = weierstrassEquation(x); // y² = x³ + ax + b - let y; - try { - y = Fp.sqrt(y2); // y = y² ^ (p+1)/4 - } - catch (sqrtError) { - const err = sqrtError instanceof Error ? ': ' + sqrtError.message : ''; - throw new Error('bad point: is not on curve, sqrt error' + err); - } - assertCompressionIsSupported(); - const isYOdd = Fp.isOdd(y); // (y & _1n) === _1n; - const isHeadOdd = (head & 1) === 1; // ECDSA-specific - if (isHeadOdd !== isYOdd) - y = Fp.neg(y); - return { x, y }; - } - else if (length === uncomp && head === 0x04) { - // TODO: more checks - const L = Fp.BYTES; - const x = Fp.fromBytes(tail.subarray(0, L)); - const y = Fp.fromBytes(tail.subarray(L, L * 2)); - if (!isValidXY(x, y)) - throw new Error('bad point: is not on curve'); - return { x, y }; - } - else { - throw new Error(`bad point: got length ${length}, expected compressed=${comp} or uncompressed=${uncomp}`); - } - } - const encodePoint = extraOpts.toBytes || pointToBytes; - const decodePoint = extraOpts.fromBytes || pointFromBytes; - function weierstrassEquation(x) { - const x2 = Fp.sqr(x); // x * x - const x3 = Fp.mul(x2, x); // x² * x - return Fp.add(Fp.add(x3, Fp.mul(x, CURVE.a)), CURVE.b); // x³ + a * x + b - } - // TODO: move top-level - /** Checks whether equation holds for given x, y: y² == x³ + ax + b */ - function isValidXY(x, y) { - const left = Fp.sqr(y); // y² - const right = weierstrassEquation(x); // x³ + ax + b - return Fp.eql(left, right); - } - // Validate whether the passed curve params are valid. - // Test 1: equation y² = x³ + ax + b should work for generator point. - if (!isValidXY(CURVE.Gx, CURVE.Gy)) - throw new Error('bad curve params: generator point'); - // Test 2: discriminant Δ part should be non-zero: 4a³ + 27b² != 0. - // Guarantees curve is genus-1, smooth (non-singular). - const _4a3 = Fp.mul(Fp.pow(CURVE.a, _3n), _4n); - const _27b2 = Fp.mul(Fp.sqr(CURVE.b), BigInt(27)); - if (Fp.is0(Fp.add(_4a3, _27b2))) - throw new Error('bad curve params: a or b'); - /** Asserts coordinate is valid: 0 <= n < Fp.ORDER. */ - function acoord(title, n, banZero = false) { - if (!Fp.isValid(n) || (banZero && Fp.is0(n))) - throw new Error(`bad point coordinate ${title}`); - return n; - } - function aprjpoint(other) { - if (!(other instanceof Point)) - throw new Error('ProjectivePoint expected'); - } - function splitEndoScalarN(k) { - if (!endo || !endo.basises) - throw new Error('no endo'); - return _splitEndoScalar(k, endo.basises, Fn.ORDER); - } - // Memoized toAffine / validity check. They are heavy. Points are immutable. - // Converts Projective point to affine (x, y) coordinates. - // Can accept precomputed Z^-1 - for example, from invertBatch. - // (X, Y, Z) ∋ (x=X/Z, y=Y/Z) - const toAffineMemo = (0, utils_ts_1.memoized)((p, iz) => { - const { X, Y, Z } = p; - // Fast-path for normalized points - if (Fp.eql(Z, Fp.ONE)) - return { x: X, y: Y }; - const is0 = p.is0(); - // If invZ was 0, we return zero point. However we still want to execute - // all operations, so we replace invZ with a random number, 1. - if (iz == null) - iz = is0 ? Fp.ONE : Fp.inv(Z); - const x = Fp.mul(X, iz); - const y = Fp.mul(Y, iz); - const zz = Fp.mul(Z, iz); - if (is0) - return { x: Fp.ZERO, y: Fp.ZERO }; - if (!Fp.eql(zz, Fp.ONE)) - throw new Error('invZ was invalid'); - return { x, y }; - }); - // NOTE: on exception this will crash 'cached' and no value will be set. - // Otherwise true will be return - const assertValidMemo = (0, utils_ts_1.memoized)((p) => { - if (p.is0()) { - // (0, 1, 0) aka ZERO is invalid in most contexts. - // In BLS, ZERO can be serialized, so we allow it. - // (0, 0, 0) is invalid representation of ZERO. - if (extraOpts.allowInfinityPoint && !Fp.is0(p.Y)) - return; - throw new Error('bad point: ZERO'); - } - // Some 3rd-party test vectors require different wording between here & `fromCompressedHex` - const { x, y } = p.toAffine(); - if (!Fp.isValid(x) || !Fp.isValid(y)) - throw new Error('bad point: x or y not field elements'); - if (!isValidXY(x, y)) - throw new Error('bad point: equation left != right'); - if (!p.isTorsionFree()) - throw new Error('bad point: not in prime-order subgroup'); - return true; - }); - function finishEndo(endoBeta, k1p, k2p, k1neg, k2neg) { - k2p = new Point(Fp.mul(k2p.X, endoBeta), k2p.Y, k2p.Z); - k1p = (0, curve_ts_1.negateCt)(k1neg, k1p); - k2p = (0, curve_ts_1.negateCt)(k2neg, k2p); - return k1p.add(k2p); - } - /** - * Projective Point works in 3d / projective (homogeneous) coordinates:(X, Y, Z) ∋ (x=X/Z, y=Y/Z). - * Default Point works in 2d / affine coordinates: (x, y). - * We're doing calculations in projective, because its operations don't require costly inversion. - */ - class Point { - /** Does NOT validate if the point is valid. Use `.assertValidity()`. */ - constructor(X, Y, Z) { - this.X = acoord('x', X); - this.Y = acoord('y', Y, true); - this.Z = acoord('z', Z); - Object.freeze(this); - } - static CURVE() { - return CURVE; - } - /** Does NOT validate if the point is valid. Use `.assertValidity()`. */ - static fromAffine(p) { - const { x, y } = p || {}; - if (!p || !Fp.isValid(x) || !Fp.isValid(y)) - throw new Error('invalid affine point'); - if (p instanceof Point) - throw new Error('projective point not allowed'); - // (0, 0) would've produced (0, 0, 1) - instead, we need (0, 1, 0) - if (Fp.is0(x) && Fp.is0(y)) - return Point.ZERO; - return new Point(x, y, Fp.ONE); - } - static fromBytes(bytes) { - const P = Point.fromAffine(decodePoint((0, utils_ts_1._abytes2)(bytes, undefined, 'point'))); - P.assertValidity(); - return P; - } - static fromHex(hex) { - return Point.fromBytes((0, utils_ts_1.ensureBytes)('pointHex', hex)); - } - get x() { - return this.toAffine().x; - } - get y() { - return this.toAffine().y; - } - /** - * - * @param windowSize - * @param isLazy true will defer table computation until the first multiplication - * @returns - */ - precompute(windowSize = 8, isLazy = true) { - wnaf.createCache(this, windowSize); - if (!isLazy) - this.multiply(_3n); // random number - return this; - } - // TODO: return `this` - /** A point on curve is valid if it conforms to equation. */ - assertValidity() { - assertValidMemo(this); - } - hasEvenY() { - const { y } = this.toAffine(); - if (!Fp.isOdd) - throw new Error("Field doesn't support isOdd"); - return !Fp.isOdd(y); - } - /** Compare one point to another. */ - equals(other) { - aprjpoint(other); - const { X: X1, Y: Y1, Z: Z1 } = this; - const { X: X2, Y: Y2, Z: Z2 } = other; - const U1 = Fp.eql(Fp.mul(X1, Z2), Fp.mul(X2, Z1)); - const U2 = Fp.eql(Fp.mul(Y1, Z2), Fp.mul(Y2, Z1)); - return U1 && U2; - } - /** Flips point to one corresponding to (x, -y) in Affine coordinates. */ - negate() { - return new Point(this.X, Fp.neg(this.Y), this.Z); - } - // Renes-Costello-Batina exception-free doubling formula. - // There is 30% faster Jacobian formula, but it is not complete. - // https://eprint.iacr.org/2015/1060, algorithm 3 - // Cost: 8M + 3S + 3*a + 2*b3 + 15add. - double() { - const { a, b } = CURVE; - const b3 = Fp.mul(b, _3n); - const { X: X1, Y: Y1, Z: Z1 } = this; - let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore - let t0 = Fp.mul(X1, X1); // step 1 - let t1 = Fp.mul(Y1, Y1); - let t2 = Fp.mul(Z1, Z1); - let t3 = Fp.mul(X1, Y1); - t3 = Fp.add(t3, t3); // step 5 - Z3 = Fp.mul(X1, Z1); - Z3 = Fp.add(Z3, Z3); - X3 = Fp.mul(a, Z3); - Y3 = Fp.mul(b3, t2); - Y3 = Fp.add(X3, Y3); // step 10 - X3 = Fp.sub(t1, Y3); - Y3 = Fp.add(t1, Y3); - Y3 = Fp.mul(X3, Y3); - X3 = Fp.mul(t3, X3); - Z3 = Fp.mul(b3, Z3); // step 15 - t2 = Fp.mul(a, t2); - t3 = Fp.sub(t0, t2); - t3 = Fp.mul(a, t3); - t3 = Fp.add(t3, Z3); - Z3 = Fp.add(t0, t0); // step 20 - t0 = Fp.add(Z3, t0); - t0 = Fp.add(t0, t2); - t0 = Fp.mul(t0, t3); - Y3 = Fp.add(Y3, t0); - t2 = Fp.mul(Y1, Z1); // step 25 - t2 = Fp.add(t2, t2); - t0 = Fp.mul(t2, t3); - X3 = Fp.sub(X3, t0); - Z3 = Fp.mul(t2, t1); - Z3 = Fp.add(Z3, Z3); // step 30 - Z3 = Fp.add(Z3, Z3); - return new Point(X3, Y3, Z3); - } - // Renes-Costello-Batina exception-free addition formula. - // There is 30% faster Jacobian formula, but it is not complete. - // https://eprint.iacr.org/2015/1060, algorithm 1 - // Cost: 12M + 0S + 3*a + 3*b3 + 23add. - add(other) { - aprjpoint(other); - const { X: X1, Y: Y1, Z: Z1 } = this; - const { X: X2, Y: Y2, Z: Z2 } = other; - let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore - const a = CURVE.a; - const b3 = Fp.mul(CURVE.b, _3n); - let t0 = Fp.mul(X1, X2); // step 1 - let t1 = Fp.mul(Y1, Y2); - let t2 = Fp.mul(Z1, Z2); - let t3 = Fp.add(X1, Y1); - let t4 = Fp.add(X2, Y2); // step 5 - t3 = Fp.mul(t3, t4); - t4 = Fp.add(t0, t1); - t3 = Fp.sub(t3, t4); - t4 = Fp.add(X1, Z1); - let t5 = Fp.add(X2, Z2); // step 10 - t4 = Fp.mul(t4, t5); - t5 = Fp.add(t0, t2); - t4 = Fp.sub(t4, t5); - t5 = Fp.add(Y1, Z1); - X3 = Fp.add(Y2, Z2); // step 15 - t5 = Fp.mul(t5, X3); - X3 = Fp.add(t1, t2); - t5 = Fp.sub(t5, X3); - Z3 = Fp.mul(a, t4); - X3 = Fp.mul(b3, t2); // step 20 - Z3 = Fp.add(X3, Z3); - X3 = Fp.sub(t1, Z3); - Z3 = Fp.add(t1, Z3); - Y3 = Fp.mul(X3, Z3); - t1 = Fp.add(t0, t0); // step 25 - t1 = Fp.add(t1, t0); - t2 = Fp.mul(a, t2); - t4 = Fp.mul(b3, t4); - t1 = Fp.add(t1, t2); - t2 = Fp.sub(t0, t2); // step 30 - t2 = Fp.mul(a, t2); - t4 = Fp.add(t4, t2); - t0 = Fp.mul(t1, t4); - Y3 = Fp.add(Y3, t0); - t0 = Fp.mul(t5, t4); // step 35 - X3 = Fp.mul(t3, X3); - X3 = Fp.sub(X3, t0); - t0 = Fp.mul(t3, t1); - Z3 = Fp.mul(t5, Z3); - Z3 = Fp.add(Z3, t0); // step 40 - return new Point(X3, Y3, Z3); - } - subtract(other) { - return this.add(other.negate()); - } - is0() { - return this.equals(Point.ZERO); - } - /** - * Constant time multiplication. - * Uses wNAF method. Windowed method may be 10% faster, - * but takes 2x longer to generate and consumes 2x memory. - * Uses precomputes when available. - * Uses endomorphism for Koblitz curves. - * @param scalar by which the point would be multiplied - * @returns New point - */ - multiply(scalar) { - const { endo } = extraOpts; - if (!Fn.isValidNot0(scalar)) - throw new Error('invalid scalar: out of range'); // 0 is invalid - let point, fake; // Fake point is used to const-time mult - const mul = (n) => wnaf.cached(this, n, (p) => (0, curve_ts_1.normalizeZ)(Point, p)); - /** See docs for {@link EndomorphismOpts} */ - if (endo) { - const { k1neg, k1, k2neg, k2 } = splitEndoScalarN(scalar); - const { p: k1p, f: k1f } = mul(k1); - const { p: k2p, f: k2f } = mul(k2); - fake = k1f.add(k2f); - point = finishEndo(endo.beta, k1p, k2p, k1neg, k2neg); - } - else { - const { p, f } = mul(scalar); - point = p; - fake = f; - } - // Normalize `z` for both points, but return only real one - return (0, curve_ts_1.normalizeZ)(Point, [point, fake])[0]; - } - /** - * Non-constant-time multiplication. Uses double-and-add algorithm. - * It's faster, but should only be used when you don't care about - * an exposed secret key e.g. sig verification, which works over *public* keys. - */ - multiplyUnsafe(sc) { - const { endo } = extraOpts; - const p = this; - if (!Fn.isValid(sc)) - throw new Error('invalid scalar: out of range'); // 0 is valid - if (sc === _0n || p.is0()) - return Point.ZERO; - if (sc === _1n) - return p; // fast-path - if (wnaf.hasCache(this)) - return this.multiply(sc); - if (endo) { - const { k1neg, k1, k2neg, k2 } = splitEndoScalarN(sc); - const { p1, p2 } = (0, curve_ts_1.mulEndoUnsafe)(Point, p, k1, k2); // 30% faster vs wnaf.unsafe - return finishEndo(endo.beta, p1, p2, k1neg, k2neg); - } - else { - return wnaf.unsafe(p, sc); - } - } - multiplyAndAddUnsafe(Q, a, b) { - const sum = this.multiplyUnsafe(a).add(Q.multiplyUnsafe(b)); - return sum.is0() ? undefined : sum; - } - /** - * Converts Projective point to affine (x, y) coordinates. - * @param invertedZ Z^-1 (inverted zero) - optional, precomputation is useful for invertBatch - */ - toAffine(invertedZ) { - return toAffineMemo(this, invertedZ); - } - /** - * Checks whether Point is free of torsion elements (is in prime subgroup). - * Always torsion-free for cofactor=1 curves. - */ - isTorsionFree() { - const { isTorsionFree } = extraOpts; - if (cofactor === _1n) - return true; - if (isTorsionFree) - return isTorsionFree(Point, this); - return wnaf.unsafe(this, CURVE_ORDER).is0(); - } - clearCofactor() { - const { clearCofactor } = extraOpts; - if (cofactor === _1n) - return this; // Fast-path - if (clearCofactor) - return clearCofactor(Point, this); - return this.multiplyUnsafe(cofactor); - } - isSmallOrder() { - // can we use this.clearCofactor()? - return this.multiplyUnsafe(cofactor).is0(); - } - toBytes(isCompressed = true) { - (0, utils_ts_1._abool2)(isCompressed, 'isCompressed'); - this.assertValidity(); - return encodePoint(Point, this, isCompressed); - } - toHex(isCompressed = true) { - return (0, utils_ts_1.bytesToHex)(this.toBytes(isCompressed)); - } - toString() { - return ``; - } - // TODO: remove - get px() { - return this.X; - } - get py() { - return this.X; - } - get pz() { - return this.Z; - } - toRawBytes(isCompressed = true) { - return this.toBytes(isCompressed); - } - _setWindowSize(windowSize) { - this.precompute(windowSize); - } - static normalizeZ(points) { - return (0, curve_ts_1.normalizeZ)(Point, points); - } - static msm(points, scalars) { - return (0, curve_ts_1.pippenger)(Point, Fn, points, scalars); - } - static fromPrivateKey(privateKey) { - return Point.BASE.multiply(_normFnElement(Fn, privateKey)); - } - } - // base / generator point - Point.BASE = new Point(CURVE.Gx, CURVE.Gy, Fp.ONE); - // zero / infinity / identity point - Point.ZERO = new Point(Fp.ZERO, Fp.ONE, Fp.ZERO); // 0, 1, 0 - // math field - Point.Fp = Fp; - // scalar field - Point.Fn = Fn; - const bits = Fn.BITS; - const wnaf = new curve_ts_1.wNAF(Point, extraOpts.endo ? Math.ceil(bits / 2) : bits); - Point.BASE.precompute(8); // Enable precomputes. Slows down first publicKey computation by 20ms. - return Point; -} -// Points start with byte 0x02 when y is even; otherwise 0x03 -function pprefix(hasEvenY) { - return Uint8Array.of(hasEvenY ? 0x02 : 0x03); -} -/** - * Implementation of the Shallue and van de Woestijne method for any weierstrass curve. - * TODO: check if there is a way to merge this with uvRatio in Edwards; move to modular. - * b = True and y = sqrt(u / v) if (u / v) is square in F, and - * b = False and y = sqrt(Z * (u / v)) otherwise. - * @param Fp - * @param Z - * @returns - */ -function SWUFpSqrtRatio(Fp, Z) { - // Generic implementation - const q = Fp.ORDER; - let l = _0n; - for (let o = q - _1n; o % _2n === _0n; o /= _2n) - l += _1n; - const c1 = l; // 1. c1, the largest integer such that 2^c1 divides q - 1. - // We need 2n ** c1 and 2n ** (c1-1). We can't use **; but we can use <<. - // 2n ** c1 == 2n << (c1-1) - const _2n_pow_c1_1 = _2n << (c1 - _1n - _1n); - const _2n_pow_c1 = _2n_pow_c1_1 * _2n; - const c2 = (q - _1n) / _2n_pow_c1; // 2. c2 = (q - 1) / (2^c1) # Integer arithmetic - const c3 = (c2 - _1n) / _2n; // 3. c3 = (c2 - 1) / 2 # Integer arithmetic - const c4 = _2n_pow_c1 - _1n; // 4. c4 = 2^c1 - 1 # Integer arithmetic - const c5 = _2n_pow_c1_1; // 5. c5 = 2^(c1 - 1) # Integer arithmetic - const c6 = Fp.pow(Z, c2); // 6. c6 = Z^c2 - const c7 = Fp.pow(Z, (c2 + _1n) / _2n); // 7. c7 = Z^((c2 + 1) / 2) - let sqrtRatio = (u, v) => { - let tv1 = c6; // 1. tv1 = c6 - let tv2 = Fp.pow(v, c4); // 2. tv2 = v^c4 - let tv3 = Fp.sqr(tv2); // 3. tv3 = tv2^2 - tv3 = Fp.mul(tv3, v); // 4. tv3 = tv3 * v - let tv5 = Fp.mul(u, tv3); // 5. tv5 = u * tv3 - tv5 = Fp.pow(tv5, c3); // 6. tv5 = tv5^c3 - tv5 = Fp.mul(tv5, tv2); // 7. tv5 = tv5 * tv2 - tv2 = Fp.mul(tv5, v); // 8. tv2 = tv5 * v - tv3 = Fp.mul(tv5, u); // 9. tv3 = tv5 * u - let tv4 = Fp.mul(tv3, tv2); // 10. tv4 = tv3 * tv2 - tv5 = Fp.pow(tv4, c5); // 11. tv5 = tv4^c5 - let isQR = Fp.eql(tv5, Fp.ONE); // 12. isQR = tv5 == 1 - tv2 = Fp.mul(tv3, c7); // 13. tv2 = tv3 * c7 - tv5 = Fp.mul(tv4, tv1); // 14. tv5 = tv4 * tv1 - tv3 = Fp.cmov(tv2, tv3, isQR); // 15. tv3 = CMOV(tv2, tv3, isQR) - tv4 = Fp.cmov(tv5, tv4, isQR); // 16. tv4 = CMOV(tv5, tv4, isQR) - // 17. for i in (c1, c1 - 1, ..., 2): - for (let i = c1; i > _1n; i--) { - let tv5 = i - _2n; // 18. tv5 = i - 2 - tv5 = _2n << (tv5 - _1n); // 19. tv5 = 2^tv5 - let tvv5 = Fp.pow(tv4, tv5); // 20. tv5 = tv4^tv5 - const e1 = Fp.eql(tvv5, Fp.ONE); // 21. e1 = tv5 == 1 - tv2 = Fp.mul(tv3, tv1); // 22. tv2 = tv3 * tv1 - tv1 = Fp.mul(tv1, tv1); // 23. tv1 = tv1 * tv1 - tvv5 = Fp.mul(tv4, tv1); // 24. tv5 = tv4 * tv1 - tv3 = Fp.cmov(tv2, tv3, e1); // 25. tv3 = CMOV(tv2, tv3, e1) - tv4 = Fp.cmov(tvv5, tv4, e1); // 26. tv4 = CMOV(tv5, tv4, e1) - } - return { isValid: isQR, value: tv3 }; - }; - if (Fp.ORDER % _4n === _3n) { - // sqrt_ratio_3mod4(u, v) - const c1 = (Fp.ORDER - _3n) / _4n; // 1. c1 = (q - 3) / 4 # Integer arithmetic - const c2 = Fp.sqrt(Fp.neg(Z)); // 2. c2 = sqrt(-Z) - sqrtRatio = (u, v) => { - let tv1 = Fp.sqr(v); // 1. tv1 = v^2 - const tv2 = Fp.mul(u, v); // 2. tv2 = u * v - tv1 = Fp.mul(tv1, tv2); // 3. tv1 = tv1 * tv2 - let y1 = Fp.pow(tv1, c1); // 4. y1 = tv1^c1 - y1 = Fp.mul(y1, tv2); // 5. y1 = y1 * tv2 - const y2 = Fp.mul(y1, c2); // 6. y2 = y1 * c2 - const tv3 = Fp.mul(Fp.sqr(y1), v); // 7. tv3 = y1^2; 8. tv3 = tv3 * v - const isQR = Fp.eql(tv3, u); // 9. isQR = tv3 == u - let y = Fp.cmov(y2, y1, isQR); // 10. y = CMOV(y2, y1, isQR) - return { isValid: isQR, value: y }; // 11. return (isQR, y) isQR ? y : y*c2 - }; - } - // No curves uses that - // if (Fp.ORDER % _8n === _5n) // sqrt_ratio_5mod8 - return sqrtRatio; -} -/** - * Simplified Shallue-van de Woestijne-Ulas Method - * https://www.rfc-editor.org/rfc/rfc9380#section-6.6.2 - */ -function mapToCurveSimpleSWU(Fp, opts) { - (0, modular_ts_1.validateField)(Fp); - const { A, B, Z } = opts; - if (!Fp.isValid(A) || !Fp.isValid(B) || !Fp.isValid(Z)) - throw new Error('mapToCurveSimpleSWU: invalid opts'); - const sqrtRatio = SWUFpSqrtRatio(Fp, Z); - if (!Fp.isOdd) - throw new Error('Field does not have .isOdd()'); - // Input: u, an element of F. - // Output: (x, y), a point on E. - return (u) => { - // prettier-ignore - let tv1, tv2, tv3, tv4, tv5, tv6, x, y; - tv1 = Fp.sqr(u); // 1. tv1 = u^2 - tv1 = Fp.mul(tv1, Z); // 2. tv1 = Z * tv1 - tv2 = Fp.sqr(tv1); // 3. tv2 = tv1^2 - tv2 = Fp.add(tv2, tv1); // 4. tv2 = tv2 + tv1 - tv3 = Fp.add(tv2, Fp.ONE); // 5. tv3 = tv2 + 1 - tv3 = Fp.mul(tv3, B); // 6. tv3 = B * tv3 - tv4 = Fp.cmov(Z, Fp.neg(tv2), !Fp.eql(tv2, Fp.ZERO)); // 7. tv4 = CMOV(Z, -tv2, tv2 != 0) - tv4 = Fp.mul(tv4, A); // 8. tv4 = A * tv4 - tv2 = Fp.sqr(tv3); // 9. tv2 = tv3^2 - tv6 = Fp.sqr(tv4); // 10. tv6 = tv4^2 - tv5 = Fp.mul(tv6, A); // 11. tv5 = A * tv6 - tv2 = Fp.add(tv2, tv5); // 12. tv2 = tv2 + tv5 - tv2 = Fp.mul(tv2, tv3); // 13. tv2 = tv2 * tv3 - tv6 = Fp.mul(tv6, tv4); // 14. tv6 = tv6 * tv4 - tv5 = Fp.mul(tv6, B); // 15. tv5 = B * tv6 - tv2 = Fp.add(tv2, tv5); // 16. tv2 = tv2 + tv5 - x = Fp.mul(tv1, tv3); // 17. x = tv1 * tv3 - const { isValid, value } = sqrtRatio(tv2, tv6); // 18. (is_gx1_square, y1) = sqrt_ratio(tv2, tv6) - y = Fp.mul(tv1, u); // 19. y = tv1 * u -> Z * u^3 * y1 - y = Fp.mul(y, value); // 20. y = y * y1 - x = Fp.cmov(x, tv3, isValid); // 21. x = CMOV(x, tv3, is_gx1_square) - y = Fp.cmov(y, value, isValid); // 22. y = CMOV(y, y1, is_gx1_square) - const e1 = Fp.isOdd(u) === Fp.isOdd(y); // 23. e1 = sgn0(u) == sgn0(y) - y = Fp.cmov(Fp.neg(y), y, e1); // 24. y = CMOV(-y, y, e1) - const tv4_inv = (0, modular_ts_1.FpInvertBatch)(Fp, [tv4], true)[0]; - x = Fp.mul(x, tv4_inv); // 25. x = x / tv4 - return { x, y }; - }; -} -function getWLengths(Fp, Fn) { - return { - secretKey: Fn.BYTES, - publicKey: 1 + Fp.BYTES, - publicKeyUncompressed: 1 + 2 * Fp.BYTES, - publicKeyHasPrefix: true, - signature: 2 * Fn.BYTES, - }; -} -/** - * Sometimes users only need getPublicKey, getSharedSecret, and secret key handling. - * This helper ensures no signature functionality is present. Less code, smaller bundle size. - */ -function ecdh(Point, ecdhOpts = {}) { - const { Fn } = Point; - const randomBytes_ = ecdhOpts.randomBytes || utils_ts_1.randomBytes; - const lengths = Object.assign(getWLengths(Point.Fp, Fn), { seed: (0, modular_ts_1.getMinHashLength)(Fn.ORDER) }); - function isValidSecretKey(secretKey) { - try { - return !!_normFnElement(Fn, secretKey); - } - catch (error) { - return false; - } - } - function isValidPublicKey(publicKey, isCompressed) { - const { publicKey: comp, publicKeyUncompressed } = lengths; - try { - const l = publicKey.length; - if (isCompressed === true && l !== comp) - return false; - if (isCompressed === false && l !== publicKeyUncompressed) - return false; - return !!Point.fromBytes(publicKey); - } - catch (error) { - return false; - } - } - /** - * Produces cryptographically secure secret key from random of size - * (groupLen + ceil(groupLen / 2)) with modulo bias being negligible. - */ - function randomSecretKey(seed = randomBytes_(lengths.seed)) { - return (0, modular_ts_1.mapHashToField)((0, utils_ts_1._abytes2)(seed, lengths.seed, 'seed'), Fn.ORDER); - } - /** - * Computes public key for a secret key. Checks for validity of the secret key. - * @param isCompressed whether to return compact (default), or full key - * @returns Public key, full when isCompressed=false; short when isCompressed=true - */ - function getPublicKey(secretKey, isCompressed = true) { - return Point.BASE.multiply(_normFnElement(Fn, secretKey)).toBytes(isCompressed); - } - function keygen(seed) { - const secretKey = randomSecretKey(seed); - return { secretKey, publicKey: getPublicKey(secretKey) }; - } - /** - * Quick and dirty check for item being public key. Does not validate hex, or being on-curve. - */ - function isProbPub(item) { - if (typeof item === 'bigint') - return false; - if (item instanceof Point) - return true; - const { secretKey, publicKey, publicKeyUncompressed } = lengths; - if (Fn.allowedLengths || secretKey === publicKey) - return undefined; - const l = (0, utils_ts_1.ensureBytes)('key', item).length; - return l === publicKey || l === publicKeyUncompressed; - } - /** - * ECDH (Elliptic Curve Diffie Hellman). - * Computes shared public key from secret key A and public key B. - * Checks: 1) secret key validity 2) shared key is on-curve. - * Does NOT hash the result. - * @param isCompressed whether to return compact (default), or full key - * @returns shared public key - */ - function getSharedSecret(secretKeyA, publicKeyB, isCompressed = true) { - if (isProbPub(secretKeyA) === true) - throw new Error('first arg must be private key'); - if (isProbPub(publicKeyB) === false) - throw new Error('second arg must be public key'); - const s = _normFnElement(Fn, secretKeyA); - const b = Point.fromHex(publicKeyB); // checks for being on-curve - return b.multiply(s).toBytes(isCompressed); - } - const utils = { - isValidSecretKey, - isValidPublicKey, - randomSecretKey, - // TODO: remove - isValidPrivateKey: isValidSecretKey, - randomPrivateKey: randomSecretKey, - normPrivateKeyToScalar: (key) => _normFnElement(Fn, key), - precompute(windowSize = 8, point = Point.BASE) { - return point.precompute(windowSize, false); - }, - }; - return Object.freeze({ getPublicKey, getSharedSecret, keygen, Point, utils, lengths }); -} -/** - * Creates ECDSA signing interface for given elliptic curve `Point` and `hash` function. - * We need `hash` for 2 features: - * 1. Message prehash-ing. NOT used if `sign` / `verify` are called with `prehash: false` - * 2. k generation in `sign`, using HMAC-drbg(hash) - * - * ECDSAOpts are only rarely needed. - * - * @example - * ```js - * const p256_Point = weierstrass(...); - * const p256_sha256 = ecdsa(p256_Point, sha256); - * const p256_sha224 = ecdsa(p256_Point, sha224); - * const p256_sha224_r = ecdsa(p256_Point, sha224, { randomBytes: (length) => { ... } }); - * ``` - */ -function ecdsa(Point, hash, ecdsaOpts = {}) { - (0, utils_1.ahash)(hash); - (0, utils_ts_1._validateObject)(ecdsaOpts, {}, { - hmac: 'function', - lowS: 'boolean', - randomBytes: 'function', - bits2int: 'function', - bits2int_modN: 'function', - }); - const randomBytes = ecdsaOpts.randomBytes || utils_ts_1.randomBytes; - const hmac = ecdsaOpts.hmac || - ((key, ...msgs) => (0, hmac_js_1.hmac)(hash, key, (0, utils_ts_1.concatBytes)(...msgs))); - const { Fp, Fn } = Point; - const { ORDER: CURVE_ORDER, BITS: fnBits } = Fn; - const { keygen, getPublicKey, getSharedSecret, utils, lengths } = ecdh(Point, ecdsaOpts); - const defaultSigOpts = { - prehash: false, - lowS: typeof ecdsaOpts.lowS === 'boolean' ? ecdsaOpts.lowS : false, - format: undefined, //'compact' as ECDSASigFormat, - extraEntropy: false, - }; - const defaultSigOpts_format = 'compact'; - function isBiggerThanHalfOrder(number) { - const HALF = CURVE_ORDER >> _1n; - return number > HALF; - } - function validateRS(title, num) { - if (!Fn.isValidNot0(num)) - throw new Error(`invalid signature ${title}: out of range 1..Point.Fn.ORDER`); - return num; - } - function validateSigLength(bytes, format) { - validateSigFormat(format); - const size = lengths.signature; - const sizer = format === 'compact' ? size : format === 'recovered' ? size + 1 : undefined; - return (0, utils_ts_1._abytes2)(bytes, sizer, `${format} signature`); - } - /** - * ECDSA signature with its (r, s) properties. Supports compact, recovered & DER representations. - */ - class Signature { - constructor(r, s, recovery) { - this.r = validateRS('r', r); // r in [1..N-1]; - this.s = validateRS('s', s); // s in [1..N-1]; - if (recovery != null) - this.recovery = recovery; - Object.freeze(this); - } - static fromBytes(bytes, format = defaultSigOpts_format) { - validateSigLength(bytes, format); - let recid; - if (format === 'der') { - const { r, s } = exports.DER.toSig((0, utils_ts_1._abytes2)(bytes)); - return new Signature(r, s); - } - if (format === 'recovered') { - recid = bytes[0]; - format = 'compact'; - bytes = bytes.subarray(1); - } - const L = Fn.BYTES; - const r = bytes.subarray(0, L); - const s = bytes.subarray(L, L * 2); - return new Signature(Fn.fromBytes(r), Fn.fromBytes(s), recid); - } - static fromHex(hex, format) { - return this.fromBytes((0, utils_ts_1.hexToBytes)(hex), format); - } - addRecoveryBit(recovery) { - return new Signature(this.r, this.s, recovery); - } - recoverPublicKey(messageHash) { - const FIELD_ORDER = Fp.ORDER; - const { r, s, recovery: rec } = this; - if (rec == null || ![0, 1, 2, 3].includes(rec)) - throw new Error('recovery id invalid'); - // ECDSA recovery is hard for cofactor > 1 curves. - // In sign, `r = q.x mod n`, and here we recover q.x from r. - // While recovering q.x >= n, we need to add r+n for cofactor=1 curves. - // However, for cofactor>1, r+n may not get q.x: - // r+n*i would need to be done instead where i is unknown. - // To easily get i, we either need to: - // a. increase amount of valid recid values (4, 5...); OR - // b. prohibit non-prime-order signatures (recid > 1). - const hasCofactor = CURVE_ORDER * _2n < FIELD_ORDER; - if (hasCofactor && rec > 1) - throw new Error('recovery id is ambiguous for h>1 curve'); - const radj = rec === 2 || rec === 3 ? r + CURVE_ORDER : r; - if (!Fp.isValid(radj)) - throw new Error('recovery id 2 or 3 invalid'); - const x = Fp.toBytes(radj); - const R = Point.fromBytes((0, utils_ts_1.concatBytes)(pprefix((rec & 1) === 0), x)); - const ir = Fn.inv(radj); // r^-1 - const h = bits2int_modN((0, utils_ts_1.ensureBytes)('msgHash', messageHash)); // Truncate hash - const u1 = Fn.create(-h * ir); // -hr^-1 - const u2 = Fn.create(s * ir); // sr^-1 - // (sr^-1)R-(hr^-1)G = -(hr^-1)G + (sr^-1). unsafe is fine: there is no private data. - const Q = Point.BASE.multiplyUnsafe(u1).add(R.multiplyUnsafe(u2)); - if (Q.is0()) - throw new Error('point at infinify'); - Q.assertValidity(); - return Q; - } - // Signatures should be low-s, to prevent malleability. - hasHighS() { - return isBiggerThanHalfOrder(this.s); - } - toBytes(format = defaultSigOpts_format) { - validateSigFormat(format); - if (format === 'der') - return (0, utils_ts_1.hexToBytes)(exports.DER.hexFromSig(this)); - const r = Fn.toBytes(this.r); - const s = Fn.toBytes(this.s); - if (format === 'recovered') { - if (this.recovery == null) - throw new Error('recovery bit must be present'); - return (0, utils_ts_1.concatBytes)(Uint8Array.of(this.recovery), r, s); - } - return (0, utils_ts_1.concatBytes)(r, s); - } - toHex(format) { - return (0, utils_ts_1.bytesToHex)(this.toBytes(format)); - } - // TODO: remove - assertValidity() { } - static fromCompact(hex) { - return Signature.fromBytes((0, utils_ts_1.ensureBytes)('sig', hex), 'compact'); - } - static fromDER(hex) { - return Signature.fromBytes((0, utils_ts_1.ensureBytes)('sig', hex), 'der'); - } - normalizeS() { - return this.hasHighS() ? new Signature(this.r, Fn.neg(this.s), this.recovery) : this; - } - toDERRawBytes() { - return this.toBytes('der'); - } - toDERHex() { - return (0, utils_ts_1.bytesToHex)(this.toBytes('der')); - } - toCompactRawBytes() { - return this.toBytes('compact'); - } - toCompactHex() { - return (0, utils_ts_1.bytesToHex)(this.toBytes('compact')); - } - } - // RFC6979: ensure ECDSA msg is X bytes and < N. RFC suggests optional truncating via bits2octets. - // FIPS 186-4 4.6 suggests the leftmost min(nBitLen, outLen) bits, which matches bits2int. - // bits2int can produce res>N, we can do mod(res, N) since the bitLen is the same. - // int2octets can't be used; pads small msgs with 0: unacceptatble for trunc as per RFC vectors - const bits2int = ecdsaOpts.bits2int || - function bits2int_def(bytes) { - // Our custom check "just in case", for protection against DoS - if (bytes.length > 8192) - throw new Error('input is too large'); - // For curves with nBitLength % 8 !== 0: bits2octets(bits2octets(m)) !== bits2octets(m) - // for some cases, since bytes.length * 8 is not actual bitLength. - const num = (0, utils_ts_1.bytesToNumberBE)(bytes); // check for == u8 done here - const delta = bytes.length * 8 - fnBits; // truncate to nBitLength leftmost bits - return delta > 0 ? num >> BigInt(delta) : num; - }; - const bits2int_modN = ecdsaOpts.bits2int_modN || - function bits2int_modN_def(bytes) { - return Fn.create(bits2int(bytes)); // can't use bytesToNumberBE here - }; - // Pads output with zero as per spec - const ORDER_MASK = (0, utils_ts_1.bitMask)(fnBits); - /** Converts to bytes. Checks if num in `[0..ORDER_MASK-1]` e.g.: `[0..2^256-1]`. */ - function int2octets(num) { - // IMPORTANT: the check ensures working for case `Fn.BYTES != Fn.BITS * 8` - (0, utils_ts_1.aInRange)('num < 2^' + fnBits, num, _0n, ORDER_MASK); - return Fn.toBytes(num); - } - function validateMsgAndHash(message, prehash) { - (0, utils_ts_1._abytes2)(message, undefined, 'message'); - return prehash ? (0, utils_ts_1._abytes2)(hash(message), undefined, 'prehashed message') : message; - } - /** - * Steps A, D of RFC6979 3.2. - * Creates RFC6979 seed; converts msg/privKey to numbers. - * Used only in sign, not in verify. - * - * Warning: we cannot assume here that message has same amount of bytes as curve order, - * this will be invalid at least for P521. Also it can be bigger for P224 + SHA256. - */ - function prepSig(message, privateKey, opts) { - if (['recovered', 'canonical'].some((k) => k in opts)) - throw new Error('sign() legacy options not supported'); - const { lowS, prehash, extraEntropy } = validateSigOpts(opts, defaultSigOpts); - message = validateMsgAndHash(message, prehash); // RFC6979 3.2 A: h1 = H(m) - // We can't later call bits2octets, since nested bits2int is broken for curves - // with fnBits % 8 !== 0. Because of that, we unwrap it here as int2octets call. - // const bits2octets = (bits) => int2octets(bits2int_modN(bits)) - const h1int = bits2int_modN(message); - const d = _normFnElement(Fn, privateKey); // validate secret key, convert to bigint - const seedArgs = [int2octets(d), int2octets(h1int)]; - // extraEntropy. RFC6979 3.6: additional k' (optional). - if (extraEntropy != null && extraEntropy !== false) { - // K = HMAC_K(V || 0x00 || int2octets(x) || bits2octets(h1) || k') - // gen random bytes OR pass as-is - const e = extraEntropy === true ? randomBytes(lengths.secretKey) : extraEntropy; - seedArgs.push((0, utils_ts_1.ensureBytes)('extraEntropy', e)); // check for being bytes - } - const seed = (0, utils_ts_1.concatBytes)(...seedArgs); // Step D of RFC6979 3.2 - const m = h1int; // NOTE: no need to call bits2int second time here, it is inside truncateHash! - // Converts signature params into point w r/s, checks result for validity. - // To transform k => Signature: - // q = k⋅G - // r = q.x mod n - // s = k^-1(m + rd) mod n - // Can use scalar blinding b^-1(bm + bdr) where b ∈ [1,q−1] according to - // https://tches.iacr.org/index.php/TCHES/article/view/7337/6509. We've decided against it: - // a) dependency on CSPRNG b) 15% slowdown c) doesn't really help since bigints are not CT - function k2sig(kBytes) { - // RFC 6979 Section 3.2, step 3: k = bits2int(T) - // Important: all mod() calls here must be done over N - const k = bits2int(kBytes); // mod n, not mod p - if (!Fn.isValidNot0(k)) - return; // Valid scalars (including k) must be in 1..N-1 - const ik = Fn.inv(k); // k^-1 mod n - const q = Point.BASE.multiply(k).toAffine(); // q = k⋅G - const r = Fn.create(q.x); // r = q.x mod n - if (r === _0n) - return; - const s = Fn.create(ik * Fn.create(m + r * d)); // Not using blinding here, see comment above - if (s === _0n) - return; - let recovery = (q.x === r ? 0 : 2) | Number(q.y & _1n); // recovery bit (2 or 3, when q.x > n) - let normS = s; - if (lowS && isBiggerThanHalfOrder(s)) { - normS = Fn.neg(s); // if lowS was passed, ensure s is always - recovery ^= 1; // // in the bottom half of N - } - return new Signature(r, normS, recovery); // use normS, not s - } - return { seed, k2sig }; - } - /** - * Signs message hash with a secret key. - * - * ``` - * sign(m, d) where - * k = rfc6979_hmac_drbg(m, d) - * (x, y) = G × k - * r = x mod n - * s = (m + dr) / k mod n - * ``` - */ - function sign(message, secretKey, opts = {}) { - message = (0, utils_ts_1.ensureBytes)('message', message); - const { seed, k2sig } = prepSig(message, secretKey, opts); // Steps A, D of RFC6979 3.2. - const drbg = (0, utils_ts_1.createHmacDrbg)(hash.outputLen, Fn.BYTES, hmac); - const sig = drbg(seed, k2sig); // Steps B, C, D, E, F, G - return sig; - } - function tryParsingSig(sg) { - // Try to deduce format - let sig = undefined; - const isHex = typeof sg === 'string' || (0, utils_ts_1.isBytes)(sg); - const isObj = !isHex && - sg !== null && - typeof sg === 'object' && - typeof sg.r === 'bigint' && - typeof sg.s === 'bigint'; - if (!isHex && !isObj) - throw new Error('invalid signature, expected Uint8Array, hex string or Signature instance'); - if (isObj) { - sig = new Signature(sg.r, sg.s); - } - else if (isHex) { - try { - sig = Signature.fromBytes((0, utils_ts_1.ensureBytes)('sig', sg), 'der'); - } - catch (derError) { - if (!(derError instanceof exports.DER.Err)) - throw derError; - } - if (!sig) { - try { - sig = Signature.fromBytes((0, utils_ts_1.ensureBytes)('sig', sg), 'compact'); - } - catch (error) { - return false; - } - } - } - if (!sig) - return false; - return sig; - } - /** - * Verifies a signature against message and public key. - * Rejects lowS signatures by default: see {@link ECDSAVerifyOpts}. - * Implements section 4.1.4 from https://www.secg.org/sec1-v2.pdf: - * - * ``` - * verify(r, s, h, P) where - * u1 = hs^-1 mod n - * u2 = rs^-1 mod n - * R = u1⋅G + u2⋅P - * mod(R.x, n) == r - * ``` - */ - function verify(signature, message, publicKey, opts = {}) { - const { lowS, prehash, format } = validateSigOpts(opts, defaultSigOpts); - publicKey = (0, utils_ts_1.ensureBytes)('publicKey', publicKey); - message = validateMsgAndHash((0, utils_ts_1.ensureBytes)('message', message), prehash); - if ('strict' in opts) - throw new Error('options.strict was renamed to lowS'); - const sig = format === undefined - ? tryParsingSig(signature) - : Signature.fromBytes((0, utils_ts_1.ensureBytes)('sig', signature), format); - if (sig === false) - return false; - try { - const P = Point.fromBytes(publicKey); - if (lowS && sig.hasHighS()) - return false; - const { r, s } = sig; - const h = bits2int_modN(message); // mod n, not mod p - const is = Fn.inv(s); // s^-1 mod n - const u1 = Fn.create(h * is); // u1 = hs^-1 mod n - const u2 = Fn.create(r * is); // u2 = rs^-1 mod n - const R = Point.BASE.multiplyUnsafe(u1).add(P.multiplyUnsafe(u2)); // u1⋅G + u2⋅P - if (R.is0()) - return false; - const v = Fn.create(R.x); // v = r.x mod n - return v === r; - } - catch (e) { - return false; - } - } - function recoverPublicKey(signature, message, opts = {}) { - const { prehash } = validateSigOpts(opts, defaultSigOpts); - message = validateMsgAndHash(message, prehash); - return Signature.fromBytes(signature, 'recovered').recoverPublicKey(message).toBytes(); - } - return Object.freeze({ - keygen, - getPublicKey, - getSharedSecret, - utils, - lengths, - Point, - sign, - verify, - recoverPublicKey, - Signature, - hash, - }); -} -/** @deprecated use `weierstrass` in newer releases */ -function weierstrassPoints(c) { - const { CURVE, curveOpts } = _weierstrass_legacy_opts_to_new(c); - const Point = weierstrassN(CURVE, curveOpts); - return _weierstrass_new_output_to_legacy(c, Point); -} -function _weierstrass_legacy_opts_to_new(c) { - const CURVE = { - a: c.a, - b: c.b, - p: c.Fp.ORDER, - n: c.n, - h: c.h, - Gx: c.Gx, - Gy: c.Gy, - }; - const Fp = c.Fp; - let allowedLengths = c.allowedPrivateKeyLengths - ? Array.from(new Set(c.allowedPrivateKeyLengths.map((l) => Math.ceil(l / 2)))) - : undefined; - const Fn = (0, modular_ts_1.Field)(CURVE.n, { - BITS: c.nBitLength, - allowedLengths: allowedLengths, - modFromBytes: c.wrapPrivateKey, - }); - const curveOpts = { - Fp, - Fn, - allowInfinityPoint: c.allowInfinityPoint, - endo: c.endo, - isTorsionFree: c.isTorsionFree, - clearCofactor: c.clearCofactor, - fromBytes: c.fromBytes, - toBytes: c.toBytes, - }; - return { CURVE, curveOpts }; -} -function _ecdsa_legacy_opts_to_new(c) { - const { CURVE, curveOpts } = _weierstrass_legacy_opts_to_new(c); - const ecdsaOpts = { - hmac: c.hmac, - randomBytes: c.randomBytes, - lowS: c.lowS, - bits2int: c.bits2int, - bits2int_modN: c.bits2int_modN, - }; - return { CURVE, curveOpts, hash: c.hash, ecdsaOpts }; -} -function _legacyHelperEquat(Fp, a, b) { - /** - * y² = x³ + ax + b: Short weierstrass curve formula. Takes x, returns y². - * @returns y² - */ - function weierstrassEquation(x) { - const x2 = Fp.sqr(x); // x * x - const x3 = Fp.mul(x2, x); // x² * x - return Fp.add(Fp.add(x3, Fp.mul(x, a)), b); // x³ + a * x + b - } - return weierstrassEquation; -} -function _weierstrass_new_output_to_legacy(c, Point) { - const { Fp, Fn } = Point; - function isWithinCurveOrder(num) { - return (0, utils_ts_1.inRange)(num, _1n, Fn.ORDER); - } - const weierstrassEquation = _legacyHelperEquat(Fp, c.a, c.b); - return Object.assign({}, { - CURVE: c, - Point: Point, - ProjectivePoint: Point, - normPrivateKeyToScalar: (key) => _normFnElement(Fn, key), - weierstrassEquation, - isWithinCurveOrder, - }); -} -function _ecdsa_new_output_to_legacy(c, _ecdsa) { - const Point = _ecdsa.Point; - return Object.assign({}, _ecdsa, { - ProjectivePoint: Point, - CURVE: Object.assign({}, c, (0, modular_ts_1.nLength)(Point.Fn.ORDER, Point.Fn.BITS)), - }); -} -// _ecdsa_legacy -function weierstrass(c) { - const { CURVE, curveOpts, hash, ecdsaOpts } = _ecdsa_legacy_opts_to_new(c); - const Point = weierstrassN(CURVE, curveOpts); - const signs = ecdsa(Point, hash, ecdsaOpts); - return _ecdsa_new_output_to_legacy(c, signs); -} -//# sourceMappingURL=weierstrass.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/abstract/weierstrass.js.map b/tools/mnemonic-test/node_modules/@noble/curves/abstract/weierstrass.js.map deleted file mode 100644 index 17628700..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/abstract/weierstrass.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"weierstrass.js","sourceRoot":"","sources":["../src/abstract/weierstrass.ts"],"names":[],"mappings":";;;AAoHA,4CAsBC;AAkTD,wCAeC;AAmBD,oCAkgBC;AAwDD,wCAsEC;AAKD,kDA+CC;AAgBD,oBA6FC;AAkBD,sBA2XC;AAsGD,8CAIC;AAsDD,gDAWC;AA+BD,kCAKC;AA31DD;;;;;;;;;;;;;;;;;;;;;;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CAAC,CAAC,CAAC,CAAC,CAAC;IAC7D,OAAO,MAAM,CAAC,MAAM,CAClB,EAAE,EACF;QACE,KAAK,EAAE,CAAC;QACR,KAAK,EAAE,KAAK;QACZ,eAAe,EAAE,KAAK;QACtB,sBAAsB,EAAE,CAAC,GAAY,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,EAAE,GAAG,CAAC;QACjE,mBAAmB;QACnB,kBAAkB;KACnB,CACF,CAAC;AACJ,CAAC;AACD,SAAS,2BAA2B,CAAC,CAAY,EAAE,MAAa;IAC9D,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;IAC3B,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE;QAC/B,eAAe,EAAE,KAAK;QACtB,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,EAAE,IAAA,oBAAO,EAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;KACpE,CAAC,CAAC;AACL,CAAC;AAED,gBAAgB;AAChB,SAAgB,WAAW,CAAC,CAAY;IACtC,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,yBAAyB,CAAC,CAAC,CAAC,CAAC;IAC3E,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAC7C,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;IAC5C,OAAO,2BAA2B,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AAC/C,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/bls12-381.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/bls12-381.d.ts deleted file mode 100644 index 6d0a1737..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/bls12-381.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { type CurveFn } from './abstract/bls.ts'; -import { type IField } from './abstract/modular.ts'; -export declare const bls12_381_Fr: IField; -/** - * bls12-381 pairing-friendly curve. - * @example - * import { bls12_381 as bls } from '@noble/curves/bls12-381'; - * // G1 keys, G2 signatures - * const privateKey = '67d53f170b908cabb9eb326c3c337762d59289a8fec79f7bc9254b584b73265c'; - * const message = '64726e3da8'; - * const publicKey = bls.getPublicKey(privateKey); - * const signature = bls.sign(message, privateKey); - * const isValid = bls.verify(signature, message, publicKey); - */ -export declare const bls12_381: CurveFn; -//# sourceMappingURL=bls12-381.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/bls12-381.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/bls12-381.d.ts.map deleted file mode 100644 index 1eae28c8..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/bls12-381.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bls12-381.d.ts","sourceRoot":"","sources":["src/bls12-381.ts"],"names":[],"mappings":"AAgFA,OAAO,EAAO,KAAK,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAS,KAAK,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAmE3D,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,CAGtC,CAAC;AAuTH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,EAAE,OA8HtB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/bls12-381.js b/tools/mnemonic-test/node_modules/@noble/curves/bls12-381.js deleted file mode 100644 index ea1f1cd8..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/bls12-381.js +++ /dev/null @@ -1,708 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.bls12_381 = exports.bls12_381_Fr = void 0; -/** - * bls12-381 is pairing-friendly Barreto-Lynn-Scott elliptic curve construction allowing to: - -* Construct zk-SNARKs at the ~120-bit security, as per [Barbulescu-Duquesne 2017](https://hal.science/hal-01534101/file/main.pdf) -* Efficiently verify N aggregate signatures with 1 pairing and N ec additions: -the Boneh-Lynn-Shacham signature scheme is orders of magnitude more efficient than Schnorr - -BLS can mean 2 different things: - -* Barreto-Lynn-Scott: BLS12, a Pairing Friendly Elliptic Curve -* Boneh-Lynn-Shacham: A Signature Scheme. - -### Summary - -1. BLS Relies on expensive bilinear pairing -2. Secret Keys: 32 bytes -3. Public Keys: 48 OR 96 bytes - big-endian x coordinate of point on G1 OR G2 curve -4. Signatures: 96 OR 48 bytes - big-endian x coordinate of point on G2 OR G1 curve -5. The 12 stands for the Embedding degree. - -Modes of operation: - -* Long signatures: 48-byte keys + 96-byte sigs (G1 keys + G2 sigs). -* Short signatures: 96-byte keys + 48-byte sigs (G2 keys + G1 sigs). - -### Formulas - -- `P = pk x G` - public keys -- `S = pk x H(m)` - signing, uses hash-to-curve on m -- `e(P, H(m)) == e(G, S)` - verification using pairings -- `e(G, S) = e(G, SUM(n)(Si)) = MUL(n)(e(G, Si))` - signature aggregation - -### Curves - -G1 is ordinary elliptic curve. G2 is extension field curve, think "over complex numbers". - -- G1: y² = x³ + 4 -- G2: y² = x³ + 4(u + 1) where u = √−1; r-order subgroup of E'(Fp²), M-type twist - -### Towers - -Pairing G1 + G2 produces element in Fp₁₂, 12-degree polynomial. -Fp₁₂ is usually implemented using tower of lower-degree polynomials for speed. - -- Fp₁₂ = Fp₆² => Fp₂³ -- Fp(u) / (u² - β) where β = -1 -- Fp₂(v) / (v³ - ξ) where ξ = u + 1 -- Fp₆(w) / (w² - γ) where γ = v -- Fp²[u] = Fp/u²+1 -- Fp⁶[v] = Fp²/v³-1-u -- Fp¹²[w] = Fp⁶/w²-v - -### Params - -* Embedding degree (k): 12 -* Seed is sometimes named x or t -* t = -15132376222941642752 -* p = (t-1)² * (t⁴-t²+1)/3 + t -* r = t⁴-t²+1 -* Ate loop size: X - -To verify curve parameters, see -[pairing-friendly-curves spec](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-pairing-friendly-curves-11). -Basic math is done over finite fields over p. -More complicated math is done over polynominal extension fields. - -### Compatibility and notes -1. It is compatible with Algorand, Chia, Dfinity, Ethereum, Filecoin, ZEC. -Filecoin uses little endian byte arrays for secret keys - make sure to reverse byte order. -2. Make sure to correctly select mode: "long signature" or "short signature". -3. Compatible with specs: - RFC 9380, - [cfrg-pairing-friendly-curves-11](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-pairing-friendly-curves-11), - [cfrg-bls-signature-05](https://datatracker.ietf.org/doc/draft-irtf-cfrg-bls-signature/). - - * - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const sha2_js_1 = require("@noble/hashes/sha2.js"); -const bls_ts_1 = require("./abstract/bls.js"); -const modular_ts_1 = require("./abstract/modular.js"); -const utils_ts_1 = require("./utils.js"); -// Types -const hash_to_curve_ts_1 = require("./abstract/hash-to-curve.js"); -const tower_ts_1 = require("./abstract/tower.js"); -const weierstrass_ts_1 = require("./abstract/weierstrass.js"); -// Be friendly to bad ECMAScript parsers by not using bigint literals -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = BigInt(4); -// To verify math: -// https://tools.ietf.org/html/draft-irtf-cfrg-pairing-friendly-curves-11 -// The BLS parameter x (seed) for BLS12-381. NOTE: it is negative! -// x = -2^63 - 2^62 - 2^60 - 2^57 - 2^48 - 2^16 -const BLS_X = BigInt('0xd201000000010000'); -// t = x (called differently in different places) -// const t = -BLS_X; -const BLS_X_LEN = (0, utils_ts_1.bitLen)(BLS_X); -// a=0, b=4 -// P is characteristic of field Fp, in which curve calculations are done. -// p = (t-1)² * (t⁴-t²+1)/3 + t -// bls12_381_Fp = (t-1n)**2n * (t**4n - t**2n + 1n) / 3n + t -// r*h is curve order, amount of points on curve, -// where r is order of prime subgroup and h is cofactor. -// r = t⁴-t²+1 -// r = (t**4n - t**2n + 1n) -// cofactor h of G1: (t - 1)²/3 -// cofactorG1 = (t-1n)**2n/3n -// x = 3685416753713387016781088315183077757961620795782546409894578378688607592378376318836054947676345821548104185464507 -// y = 1339506544944476473020471379941921221584933875938349620426543736416511423956333506472724655353366534992391756441569 -const bls12_381_CURVE_G1 = { - p: BigInt('0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab'), - n: BigInt('0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001'), - h: BigInt('0x396c8c005555e1568c00aaab0000aaab'), - a: _0n, - b: _4n, - Gx: BigInt('0x17f1d3a73197d7942695638c4fa9ac0fc3688c4f9774b905a14e3a3f171bac586c55e83ff97a1aeffb3af00adb22c6bb'), - Gy: BigInt('0x08b3f481e3aaa0f1a09e30ed741d8ae4fcf5e095d5d00af600db18cb2c04b3edd03cc744a2888ae40caa232946c5e7e1'), -}; -// CURVE FIELDS -exports.bls12_381_Fr = (0, modular_ts_1.Field)(bls12_381_CURVE_G1.n, { - modFromBytes: true, - isLE: true, -}); -const { Fp, Fp2, Fp6, Fp12 } = (0, tower_ts_1.tower12)({ - ORDER: bls12_381_CURVE_G1.p, - X_LEN: BLS_X_LEN, - // Finite extension field over irreducible polynominal. - // Fp(u) / (u² - β) where β = -1 - FP2_NONRESIDUE: [_1n, _1n], - Fp2mulByB: ({ c0, c1 }) => { - const t0 = Fp.mul(c0, _4n); // 4 * c0 - const t1 = Fp.mul(c1, _4n); // 4 * c1 - // (T0-T1) + (T0+T1)*i - return { c0: Fp.sub(t0, t1), c1: Fp.add(t0, t1) }; - }, - Fp12finalExponentiate: (num) => { - const x = BLS_X; - // this^(q⁶) / this - const t0 = Fp12.div(Fp12.frobeniusMap(num, 6), num); - // t0^(q²) * t0 - const t1 = Fp12.mul(Fp12.frobeniusMap(t0, 2), t0); - const t2 = Fp12.conjugate(Fp12._cyclotomicExp(t1, x)); - const t3 = Fp12.mul(Fp12.conjugate(Fp12._cyclotomicSquare(t1)), t2); - const t4 = Fp12.conjugate(Fp12._cyclotomicExp(t3, x)); - const t5 = Fp12.conjugate(Fp12._cyclotomicExp(t4, x)); - const t6 = Fp12.mul(Fp12.conjugate(Fp12._cyclotomicExp(t5, x)), Fp12._cyclotomicSquare(t2)); - const t7 = Fp12.conjugate(Fp12._cyclotomicExp(t6, x)); - const t2_t5_pow_q2 = Fp12.frobeniusMap(Fp12.mul(t2, t5), 2); - const t4_t1_pow_q3 = Fp12.frobeniusMap(Fp12.mul(t4, t1), 3); - const t6_t1c_pow_q1 = Fp12.frobeniusMap(Fp12.mul(t6, Fp12.conjugate(t1)), 1); - const t7_t3c_t1 = Fp12.mul(Fp12.mul(t7, Fp12.conjugate(t3)), t1); - // (t2 * t5)^(q²) * (t4 * t1)^(q³) * (t6 * t1.conj)^(q^1) * t7 * t3.conj * t1 - return Fp12.mul(Fp12.mul(Fp12.mul(t2_t5_pow_q2, t4_t1_pow_q3), t6_t1c_pow_q1), t7_t3c_t1); - }, -}); -// GLV endomorphism Ψ(P), for fast cofactor clearing -const { G2psi, G2psi2 } = (0, tower_ts_1.psiFrobenius)(Fp, Fp2, Fp2.div(Fp2.ONE, Fp2.NONRESIDUE)); // 1/(u+1) -/** - * Default hash_to_field / hash-to-curve for BLS. - * m: 1 for G1, 2 for G2 - * k: target security level in bits - * hash: any function, e.g. BBS+ uses BLAKE2: see [github](https://github.com/hyperledger/aries-framework-go/issues/2247). - * Parameter values come from [section 8.8.2 of RFC 9380](https://www.rfc-editor.org/rfc/rfc9380#section-8.8.2). - */ -const htfDefaults = Object.freeze({ - DST: 'BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_NUL_', - encodeDST: 'BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_NUL_', - p: Fp.ORDER, - m: 2, - k: 128, - expand: 'xmd', - hash: sha2_js_1.sha256, -}); -// a=0, b=4 -// cofactor h of G2 -// (t^8 - 4t^7 + 5t^6 - 4t^4 + 6t^3 - 4t^2 - 4t + 13)/9 -// cofactorG2 = (t**8n - 4n*t**7n + 5n*t**6n - 4n*t**4n + 6n*t**3n - 4n*t**2n - 4n*t+13n)/9n -// x = 3059144344244213709971259814753781636986470325476647558659373206291635324768958432433509563104347017837885763365758*u + 352701069587466618187139116011060144890029952792775240219908644239793785735715026873347600343865175952761926303160 -// y = 927553665492332455747201965776037880757740193453592970025027978793976877002675564980949289727957565575433344219582*u + 1985150602287291935568054521177171638300868978215655730859378665066344726373823718423869104263333984641494340347905 -const bls12_381_CURVE_G2 = { - p: Fp2.ORDER, - n: bls12_381_CURVE_G1.n, - h: BigInt('0x5d543a95414e7f1091d50792876a202cd91de4547085abaa68a205b2e5a7ddfa628f1cb4d9e82ef21537e293a6691ae1616ec6e786f0c70cf1c38e31c7238e5'), - a: Fp2.ZERO, - b: Fp2.fromBigTuple([_4n, _4n]), - Gx: Fp2.fromBigTuple([ - BigInt('0x024aa2b2f08f0a91260805272dc51051c6e47ad4fa403b02b4510b647ae3d1770bac0326a805bbefd48056c8c121bdb8'), - BigInt('0x13e02b6052719f607dacd3a088274f65596bd0d09920b61ab5da61bbdc7f5049334cf11213945d57e5ac7d055d042b7e'), - ]), - Gy: Fp2.fromBigTuple([ - BigInt('0x0ce5d527727d6e118cc9cdc6da2e351aadfd9baa8cbdd3a76d429a695160d12c923ac9cc3baca289e193548608b82801'), - BigInt('0x0606c4a02ea734cc32acd2b02bc28b99cb3e287e85a763af267492ab572e99ab3f370d275cec1da1aaa9075ff05f79be'), - ]), -}; -// Encoding utils -// Compressed point of infinity -// Set compressed & point-at-infinity bits -const COMPZERO = setMask(Fp.toBytes(_0n), { infinity: true, compressed: true }); -function parseMask(bytes) { - // Copy, so we can remove mask data. It will be removed also later, when Fp.create will call modulo. - bytes = bytes.slice(); - const mask = bytes[0] & 224; - const compressed = !!((mask >> 7) & 1); // compression bit (0b1000_0000) - const infinity = !!((mask >> 6) & 1); // point at infinity bit (0b0100_0000) - const sort = !!((mask >> 5) & 1); // sort bit (0b0010_0000) - bytes[0] &= 31; // clear mask (zero first 3 bits) - return { compressed, infinity, sort, value: bytes }; -} -function setMask(bytes, mask) { - if (bytes[0] & 224) - throw new Error('setMask: non-empty mask'); - if (mask.compressed) - bytes[0] |= 128; - if (mask.infinity) - bytes[0] |= 64; - if (mask.sort) - bytes[0] |= 32; - return bytes; -} -function pointG1ToBytes(_c, point, isComp) { - const { BYTES: L, ORDER: P } = Fp; - const is0 = point.is0(); - const { x, y } = point.toAffine(); - if (isComp) { - if (is0) - return COMPZERO.slice(); - const sort = Boolean((y * _2n) / P); - return setMask((0, utils_ts_1.numberToBytesBE)(x, L), { compressed: true, sort }); - } - else { - if (is0) { - return (0, utils_ts_1.concatBytes)(Uint8Array.of(0x40), new Uint8Array(2 * L - 1)); - } - else { - return (0, utils_ts_1.concatBytes)((0, utils_ts_1.numberToBytesBE)(x, L), (0, utils_ts_1.numberToBytesBE)(y, L)); - } - } -} -function signatureG1ToBytes(point) { - point.assertValidity(); - const { BYTES: L, ORDER: P } = Fp; - const { x, y } = point.toAffine(); - if (point.is0()) - return COMPZERO.slice(); - const sort = Boolean((y * _2n) / P); - return setMask((0, utils_ts_1.numberToBytesBE)(x, L), { compressed: true, sort }); -} -function pointG1FromBytes(bytes) { - const { compressed, infinity, sort, value } = parseMask(bytes); - const { BYTES: L, ORDER: P } = Fp; - if (value.length === 48 && compressed) { - const compressedValue = (0, utils_ts_1.bytesToNumberBE)(value); - // Zero - const x = Fp.create(compressedValue & (0, utils_ts_1.bitMask)(Fp.BITS)); - if (infinity) { - if (x !== _0n) - throw new Error('invalid G1 point: non-empty, at infinity, with compression'); - return { x: _0n, y: _0n }; - } - const right = Fp.add(Fp.pow(x, _3n), Fp.create(bls12_381_CURVE_G1.b)); // y² = x³ + b - let y = Fp.sqrt(right); - if (!y) - throw new Error('invalid G1 point: compressed point'); - if ((y * _2n) / P !== BigInt(sort)) - y = Fp.neg(y); - return { x: Fp.create(x), y: Fp.create(y) }; - } - else if (value.length === 96 && !compressed) { - // Check if the infinity flag is set - const x = (0, utils_ts_1.bytesToNumberBE)(value.subarray(0, L)); - const y = (0, utils_ts_1.bytesToNumberBE)(value.subarray(L)); - if (infinity) { - if (x !== _0n || y !== _0n) - throw new Error('G1: non-empty point at infinity'); - return exports.bls12_381.G1.Point.ZERO.toAffine(); - } - return { x: Fp.create(x), y: Fp.create(y) }; - } - else { - throw new Error('invalid G1 point: expected 48/96 bytes'); - } -} -function signatureG1FromBytes(hex) { - const { infinity, sort, value } = parseMask((0, utils_ts_1.ensureBytes)('signatureHex', hex, 48)); - const P = Fp.ORDER; - const Point = exports.bls12_381.G1.Point; - const compressedValue = (0, utils_ts_1.bytesToNumberBE)(value); - // Zero - if (infinity) - return Point.ZERO; - const x = Fp.create(compressedValue & (0, utils_ts_1.bitMask)(Fp.BITS)); - const right = Fp.add(Fp.pow(x, _3n), Fp.create(bls12_381_CURVE_G1.b)); // y² = x³ + b - let y = Fp.sqrt(right); - if (!y) - throw new Error('invalid G1 point: compressed'); - const aflag = BigInt(sort); - if ((y * _2n) / P !== aflag) - y = Fp.neg(y); - const point = Point.fromAffine({ x, y }); - point.assertValidity(); - return point; -} -function pointG2ToBytes(_c, point, isComp) { - const { BYTES: L, ORDER: P } = Fp; - const is0 = point.is0(); - const { x, y } = point.toAffine(); - if (isComp) { - if (is0) - return (0, utils_ts_1.concatBytes)(COMPZERO, (0, utils_ts_1.numberToBytesBE)(_0n, L)); - const flag = Boolean(y.c1 === _0n ? (y.c0 * _2n) / P : (y.c1 * _2n) / P); - return (0, utils_ts_1.concatBytes)(setMask((0, utils_ts_1.numberToBytesBE)(x.c1, L), { compressed: true, sort: flag }), (0, utils_ts_1.numberToBytesBE)(x.c0, L)); - } - else { - if (is0) - return (0, utils_ts_1.concatBytes)(Uint8Array.of(0x40), new Uint8Array(4 * L - 1)); - const { re: x0, im: x1 } = Fp2.reim(x); - const { re: y0, im: y1 } = Fp2.reim(y); - return (0, utils_ts_1.concatBytes)((0, utils_ts_1.numberToBytesBE)(x1, L), (0, utils_ts_1.numberToBytesBE)(x0, L), (0, utils_ts_1.numberToBytesBE)(y1, L), (0, utils_ts_1.numberToBytesBE)(y0, L)); - } -} -function signatureG2ToBytes(point) { - point.assertValidity(); - const { BYTES: L } = Fp; - if (point.is0()) - return (0, utils_ts_1.concatBytes)(COMPZERO, (0, utils_ts_1.numberToBytesBE)(_0n, L)); - const { x, y } = point.toAffine(); - const { re: x0, im: x1 } = Fp2.reim(x); - const { re: y0, im: y1 } = Fp2.reim(y); - const tmp = y1 > _0n ? y1 * _2n : y0 * _2n; - const sort = Boolean((tmp / Fp.ORDER) & _1n); - const z2 = x0; - return (0, utils_ts_1.concatBytes)(setMask((0, utils_ts_1.numberToBytesBE)(x1, L), { sort, compressed: true }), (0, utils_ts_1.numberToBytesBE)(z2, L)); -} -function pointG2FromBytes(bytes) { - const { BYTES: L, ORDER: P } = Fp; - const { compressed, infinity, sort, value } = parseMask(bytes); - if ((!compressed && !infinity && sort) || // 00100000 - (!compressed && infinity && sort) || // 01100000 - (sort && infinity && compressed) // 11100000 - ) { - throw new Error('invalid encoding flag: ' + (bytes[0] & 224)); - } - const slc = (b, from, to) => (0, utils_ts_1.bytesToNumberBE)(b.slice(from, to)); - if (value.length === 96 && compressed) { - if (infinity) { - // check that all bytes are 0 - if (value.reduce((p, c) => (p !== 0 ? c + 1 : c), 0) > 0) { - throw new Error('invalid G2 point: compressed'); - } - return { x: Fp2.ZERO, y: Fp2.ZERO }; - } - const x_1 = slc(value, 0, L); - const x_0 = slc(value, L, 2 * L); - const x = Fp2.create({ c0: Fp.create(x_0), c1: Fp.create(x_1) }); - const right = Fp2.add(Fp2.pow(x, _3n), bls12_381_CURVE_G2.b); // y² = x³ + 4 * (u+1) = x³ + b - let y = Fp2.sqrt(right); - const Y_bit = y.c1 === _0n ? (y.c0 * _2n) / P : (y.c1 * _2n) / P ? _1n : _0n; - y = sort && Y_bit > 0 ? y : Fp2.neg(y); - return { x, y }; - } - else if (value.length === 192 && !compressed) { - if (infinity) { - if (value.reduce((p, c) => (p !== 0 ? c + 1 : c), 0) > 0) { - throw new Error('invalid G2 point: uncompressed'); - } - return { x: Fp2.ZERO, y: Fp2.ZERO }; - } - const x1 = slc(value, 0 * L, 1 * L); - const x0 = slc(value, 1 * L, 2 * L); - const y1 = slc(value, 2 * L, 3 * L); - const y0 = slc(value, 3 * L, 4 * L); - return { x: Fp2.fromBigTuple([x0, x1]), y: Fp2.fromBigTuple([y0, y1]) }; - } - else { - throw new Error('invalid G2 point: expected 96/192 bytes'); - } -} -function signatureG2FromBytes(hex) { - const { ORDER: P } = Fp; - // TODO: Optimize, it's very slow because of sqrt. - const { infinity, sort, value } = parseMask((0, utils_ts_1.ensureBytes)('signatureHex', hex)); - const Point = exports.bls12_381.G2.Point; - const half = value.length / 2; - if (half !== 48 && half !== 96) - throw new Error('invalid compressed signature length, expected 96/192 bytes'); - const z1 = (0, utils_ts_1.bytesToNumberBE)(value.slice(0, half)); - const z2 = (0, utils_ts_1.bytesToNumberBE)(value.slice(half)); - // Indicates the infinity point - if (infinity) - return Point.ZERO; - const x1 = Fp.create(z1 & (0, utils_ts_1.bitMask)(Fp.BITS)); - const x2 = Fp.create(z2); - const x = Fp2.create({ c0: x2, c1: x1 }); - const y2 = Fp2.add(Fp2.pow(x, _3n), bls12_381_CURVE_G2.b); // y² = x³ + 4 - // The slow part - let y = Fp2.sqrt(y2); - if (!y) - throw new Error('Failed to find a square root'); - // Choose the y whose leftmost bit of the imaginary part is equal to the a_flag1 - // If y1 happens to be zero, then use the bit of y0 - const { re: y0, im: y1 } = Fp2.reim(y); - const aflag1 = BigInt(sort); - const isGreater = y1 > _0n && (y1 * _2n) / P !== aflag1; - const is0 = y1 === _0n && (y0 * _2n) / P !== aflag1; - if (isGreater || is0) - y = Fp2.neg(y); - const point = Point.fromAffine({ x, y }); - point.assertValidity(); - return point; -} -/** - * bls12-381 pairing-friendly curve. - * @example - * import { bls12_381 as bls } from '@noble/curves/bls12-381'; - * // G1 keys, G2 signatures - * const privateKey = '67d53f170b908cabb9eb326c3c337762d59289a8fec79f7bc9254b584b73265c'; - * const message = '64726e3da8'; - * const publicKey = bls.getPublicKey(privateKey); - * const signature = bls.sign(message, privateKey); - * const isValid = bls.verify(signature, message, publicKey); - */ -exports.bls12_381 = (0, bls_ts_1.bls)({ - // Fields - fields: { - Fp, - Fp2, - Fp6, - Fp12, - Fr: exports.bls12_381_Fr, - }, - // G1: y² = x³ + 4 - G1: { - ...bls12_381_CURVE_G1, - Fp, - htfDefaults: { ...htfDefaults, m: 1, DST: 'BLS_SIG_BLS12381G1_XMD:SHA-256_SSWU_RO_NUL_' }, - wrapPrivateKey: true, - allowInfinityPoint: true, - // Checks is the point resides in prime-order subgroup. - // point.isTorsionFree() should return true for valid points - // It returns false for shitty points. - // https://eprint.iacr.org/2021/1130.pdf - isTorsionFree: (c, point) => { - // GLV endomorphism ψ(P) - const beta = BigInt('0x5f19672fdf76ce51ba69c6076a0f77eaddb3a93be6f89688de17d813620a00022e01fffffffefffe'); - const phi = new c(Fp.mul(point.X, beta), point.Y, point.Z); - // TODO: unroll - const xP = point.multiplyUnsafe(BLS_X).negate(); // [x]P - const u2P = xP.multiplyUnsafe(BLS_X); // [u2]P - return u2P.equals(phi); - }, - // Clear cofactor of G1 - // https://eprint.iacr.org/2019/403 - clearCofactor: (_c, point) => { - // return this.multiplyUnsafe(CURVE.h); - return point.multiplyUnsafe(BLS_X).add(point); // x*P + P - }, - mapToCurve: mapToG1, - fromBytes: pointG1FromBytes, - toBytes: pointG1ToBytes, - ShortSignature: { - fromBytes(bytes) { - (0, utils_ts_1.abytes)(bytes); - return signatureG1FromBytes(bytes); - }, - fromHex(hex) { - return signatureG1FromBytes(hex); - }, - toBytes(point) { - return signatureG1ToBytes(point); - }, - toRawBytes(point) { - return signatureG1ToBytes(point); - }, - toHex(point) { - return (0, utils_ts_1.bytesToHex)(signatureG1ToBytes(point)); - }, - }, - }, - G2: { - ...bls12_381_CURVE_G2, - Fp: Fp2, - // https://datatracker.ietf.org/doc/html/rfc9380#name-clearing-the-cofactor - // https://datatracker.ietf.org/doc/html/rfc9380#name-cofactor-clearing-for-bls12 - hEff: BigInt('0xbc69f08f2ee75b3584c6a0ea91b352888e2a8e9145ad7689986ff031508ffe1329c2f178731db956d82bf015d1212b02ec0ec69d7477c1ae954cbc06689f6a359894c0adebbf6b4e8020005aaa95551'), - htfDefaults: { ...htfDefaults }, - wrapPrivateKey: true, - allowInfinityPoint: true, - mapToCurve: mapToG2, - // Checks is the point resides in prime-order subgroup. - // point.isTorsionFree() should return true for valid points - // It returns false for shitty points. - // https://eprint.iacr.org/2021/1130.pdf - // Older version: https://eprint.iacr.org/2019/814.pdf - isTorsionFree: (c, P) => { - return P.multiplyUnsafe(BLS_X).negate().equals(G2psi(c, P)); // ψ(P) == [u](P) - }, - // Maps the point into the prime-order subgroup G2. - // clear_cofactor_bls12381_g2 from RFC 9380. - // https://eprint.iacr.org/2017/419.pdf - // prettier-ignore - clearCofactor: (c, P) => { - const x = BLS_X; - let t1 = P.multiplyUnsafe(x).negate(); // [-x]P - let t2 = G2psi(c, P); // Ψ(P) - let t3 = P.double(); // 2P - t3 = G2psi2(c, t3); // Ψ²(2P) - t3 = t3.subtract(t2); // Ψ²(2P) - Ψ(P) - t2 = t1.add(t2); // [-x]P + Ψ(P) - t2 = t2.multiplyUnsafe(x).negate(); // [x²]P - [x]Ψ(P) - t3 = t3.add(t2); // Ψ²(2P) - Ψ(P) + [x²]P - [x]Ψ(P) - t3 = t3.subtract(t1); // Ψ²(2P) - Ψ(P) + [x²]P - [x]Ψ(P) + [x]P - const Q = t3.subtract(P); // Ψ²(2P) - Ψ(P) + [x²]P - [x]Ψ(P) + [x]P - 1P - return Q; // [x²-x-1]P + [x-1]Ψ(P) + Ψ²(2P) - }, - fromBytes: pointG2FromBytes, - toBytes: pointG2ToBytes, - Signature: { - fromBytes(bytes) { - (0, utils_ts_1.abytes)(bytes); - return signatureG2FromBytes(bytes); - }, - fromHex(hex) { - return signatureG2FromBytes(hex); - }, - toBytes(point) { - return signatureG2ToBytes(point); - }, - toRawBytes(point) { - return signatureG2ToBytes(point); - }, - toHex(point) { - return (0, utils_ts_1.bytesToHex)(signatureG2ToBytes(point)); - }, - }, - }, - params: { - ateLoopSize: BLS_X, // The BLS parameter x for BLS12-381 - r: bls12_381_CURVE_G1.n, // order; z⁴ − z² + 1; CURVE.n from other curves - xNegative: true, - twistType: 'multiplicative', - }, - htfDefaults, - hash: sha2_js_1.sha256, -}); -// 3-isogeny map from E' to E https://www.rfc-editor.org/rfc/rfc9380#appendix-E.3 -const isogenyMapG2 = (0, hash_to_curve_ts_1.isogenyMap)(Fp2, [ - // xNum - [ - [ - '0x5c759507e8e333ebb5b7a9a47d7ed8532c52d39fd3a042a88b58423c50ae15d5c2638e343d9c71c6238aaaaaaaa97d6', - '0x5c759507e8e333ebb5b7a9a47d7ed8532c52d39fd3a042a88b58423c50ae15d5c2638e343d9c71c6238aaaaaaaa97d6', - ], - [ - '0x0', - '0x11560bf17baa99bc32126fced787c88f984f87adf7ae0c7f9a208c6b4f20a4181472aaa9cb8d555526a9ffffffffc71a', - ], - [ - '0x11560bf17baa99bc32126fced787c88f984f87adf7ae0c7f9a208c6b4f20a4181472aaa9cb8d555526a9ffffffffc71e', - '0x8ab05f8bdd54cde190937e76bc3e447cc27c3d6fbd7063fcd104635a790520c0a395554e5c6aaaa9354ffffffffe38d', - ], - [ - '0x171d6541fa38ccfaed6dea691f5fb614cb14b4e7f4e810aa22d6108f142b85757098e38d0f671c7188e2aaaaaaaa5ed1', - '0x0', - ], - ], - // xDen - [ - [ - '0x0', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaa63', - ], - [ - '0xc', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaa9f', - ], - ['0x1', '0x0'], // LAST 1 - ], - // yNum - [ - [ - '0x1530477c7ab4113b59a4c18b076d11930f7da5d4a07f649bf54439d87d27e500fc8c25ebf8c92f6812cfc71c71c6d706', - '0x1530477c7ab4113b59a4c18b076d11930f7da5d4a07f649bf54439d87d27e500fc8c25ebf8c92f6812cfc71c71c6d706', - ], - [ - '0x0', - '0x5c759507e8e333ebb5b7a9a47d7ed8532c52d39fd3a042a88b58423c50ae15d5c2638e343d9c71c6238aaaaaaaa97be', - ], - [ - '0x11560bf17baa99bc32126fced787c88f984f87adf7ae0c7f9a208c6b4f20a4181472aaa9cb8d555526a9ffffffffc71c', - '0x8ab05f8bdd54cde190937e76bc3e447cc27c3d6fbd7063fcd104635a790520c0a395554e5c6aaaa9354ffffffffe38f', - ], - [ - '0x124c9ad43b6cf79bfbf7043de3811ad0761b0f37a1e26286b0e977c69aa274524e79097a56dc4bd9e1b371c71c718b10', - '0x0', - ], - ], - // yDen - [ - [ - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffa8fb', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffa8fb', - ], - [ - '0x0', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffa9d3', - ], - [ - '0x12', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaa99', - ], - ['0x1', '0x0'], // LAST 1 - ], -].map((i) => i.map((pair) => Fp2.fromBigTuple(pair.map(BigInt))))); -// 11-isogeny map from E' to E -const isogenyMapG1 = (0, hash_to_curve_ts_1.isogenyMap)(Fp, [ - // xNum - [ - '0x11a05f2b1e833340b809101dd99815856b303e88a2d7005ff2627b56cdb4e2c85610c2d5f2e62d6eaeac1662734649b7', - '0x17294ed3e943ab2f0588bab22147a81c7c17e75b2f6a8417f565e33c70d1e86b4838f2a6f318c356e834eef1b3cb83bb', - '0xd54005db97678ec1d1048c5d10a9a1bce032473295983e56878e501ec68e25c958c3e3d2a09729fe0179f9dac9edcb0', - '0x1778e7166fcc6db74e0609d307e55412d7f5e4656a8dbf25f1b33289f1b330835336e25ce3107193c5b388641d9b6861', - '0xe99726a3199f4436642b4b3e4118e5499db995a1257fb3f086eeb65982fac18985a286f301e77c451154ce9ac8895d9', - '0x1630c3250d7313ff01d1201bf7a74ab5db3cb17dd952799b9ed3ab9097e68f90a0870d2dcae73d19cd13c1c66f652983', - '0xd6ed6553fe44d296a3726c38ae652bfb11586264f0f8ce19008e218f9c86b2a8da25128c1052ecaddd7f225a139ed84', - '0x17b81e7701abdbe2e8743884d1117e53356de5ab275b4db1a682c62ef0f2753339b7c8f8c8f475af9ccb5618e3f0c88e', - '0x80d3cf1f9a78fc47b90b33563be990dc43b756ce79f5574a2c596c928c5d1de4fa295f296b74e956d71986a8497e317', - '0x169b1f8e1bcfa7c42e0c37515d138f22dd2ecb803a0c5c99676314baf4bb1b7fa3190b2edc0327797f241067be390c9e', - '0x10321da079ce07e272d8ec09d2565b0dfa7dccdde6787f96d50af36003b14866f69b771f8c285decca67df3f1605fb7b', - '0x6e08c248e260e70bd1e962381edee3d31d79d7e22c837bc23c0bf1bc24c6b68c24b1b80b64d391fa9c8ba2e8ba2d229', - ], - // xDen - [ - '0x8ca8d548cff19ae18b2e62f4bd3fa6f01d5ef4ba35b48ba9c9588617fc8ac62b558d681be343df8993cf9fa40d21b1c', - '0x12561a5deb559c4348b4711298e536367041e8ca0cf0800c0126c2588c48bf5713daa8846cb026e9e5c8276ec82b3bff', - '0xb2962fe57a3225e8137e629bff2991f6f89416f5a718cd1fca64e00b11aceacd6a3d0967c94fedcfcc239ba5cb83e19', - '0x3425581a58ae2fec83aafef7c40eb545b08243f16b1655154cca8abc28d6fd04976d5243eecf5c4130de8938dc62cd8', - '0x13a8e162022914a80a6f1d5f43e7a07dffdfc759a12062bb8d6b44e833b306da9bd29ba81f35781d539d395b3532a21e', - '0xe7355f8e4e667b955390f7f0506c6e9395735e9ce9cad4d0a43bcef24b8982f7400d24bc4228f11c02df9a29f6304a5', - '0x772caacf16936190f3e0c63e0596721570f5799af53a1894e2e073062aede9cea73b3538f0de06cec2574496ee84a3a', - '0x14a7ac2a9d64a8b230b3f5b074cf01996e7f63c21bca68a81996e1cdf9822c580fa5b9489d11e2d311f7d99bbdcc5a5e', - '0xa10ecf6ada54f825e920b3dafc7a3cce07f8d1d7161366b74100da67f39883503826692abba43704776ec3a79a1d641', - '0x95fc13ab9e92ad4476d6e3eb3a56680f682b4ee96f7d03776df533978f31c1593174e4b4b7865002d6384d168ecdd0a', - '0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001', // LAST 1 - ], - // yNum - [ - '0x90d97c81ba24ee0259d1f094980dcfa11ad138e48a869522b52af6c956543d3cd0c7aee9b3ba3c2be9845719707bb33', - '0x134996a104ee5811d51036d776fb46831223e96c254f383d0f906343eb67ad34d6c56711962fa8bfe097e75a2e41c696', - '0xcc786baa966e66f4a384c86a3b49942552e2d658a31ce2c344be4b91400da7d26d521628b00523b8dfe240c72de1f6', - '0x1f86376e8981c217898751ad8746757d42aa7b90eeb791c09e4a3ec03251cf9de405aba9ec61deca6355c77b0e5f4cb', - '0x8cc03fdefe0ff135caf4fe2a21529c4195536fbe3ce50b879833fd221351adc2ee7f8dc099040a841b6daecf2e8fedb', - '0x16603fca40634b6a2211e11db8f0a6a074a7d0d4afadb7bd76505c3d3ad5544e203f6326c95a807299b23ab13633a5f0', - '0x4ab0b9bcfac1bbcb2c977d027796b3ce75bb8ca2be184cb5231413c4d634f3747a87ac2460f415ec961f8855fe9d6f2', - '0x987c8d5333ab86fde9926bd2ca6c674170a05bfe3bdd81ffd038da6c26c842642f64550fedfe935a15e4ca31870fb29', - '0x9fc4018bd96684be88c9e221e4da1bb8f3abd16679dc26c1e8b6e6a1f20cabe69d65201c78607a360370e577bdba587', - '0xe1bba7a1186bdb5223abde7ada14a23c42a0ca7915af6fe06985e7ed1e4d43b9b3f7055dd4eba6f2bafaaebca731c30', - '0x19713e47937cd1be0dfd0b8f1d43fb93cd2fcbcb6caf493fd1183e416389e61031bf3a5cce3fbafce813711ad011c132', - '0x18b46a908f36f6deb918c143fed2edcc523559b8aaf0c2462e6bfe7f911f643249d9cdf41b44d606ce07c8a4d0074d8e', - '0xb182cac101b9399d155096004f53f447aa7b12a3426b08ec02710e807b4633f06c851c1919211f20d4c04f00b971ef8', - '0x245a394ad1eca9b72fc00ae7be315dc757b3b080d4c158013e6632d3c40659cc6cf90ad1c232a6442d9d3f5db980133', - '0x5c129645e44cf1102a159f748c4a3fc5e673d81d7e86568d9ab0f5d396a7ce46ba1049b6579afb7866b1e715475224b', - '0x15e6be4e990f03ce4ea50b3b42df2eb5cb181d8f84965a3957add4fa95af01b2b665027efec01c7704b456be69c8b604', - ], - // yDen - [ - '0x16112c4c3a9c98b252181140fad0eae9601a6de578980be6eec3232b5be72e7a07f3688ef60c206d01479253b03663c1', - '0x1962d75c2381201e1a0cbd6c43c348b885c84ff731c4d59ca4a10356f453e01f78a4260763529e3532f6102c2e49a03d', - '0x58df3306640da276faaae7d6e8eb15778c4855551ae7f310c35a5dd279cd2eca6757cd636f96f891e2538b53dbf67f2', - '0x16b7d288798e5395f20d23bf89edb4d1d115c5dbddbcd30e123da489e726af41727364f2c28297ada8d26d98445f5416', - '0xbe0e079545f43e4b00cc912f8228ddcc6d19c9f0f69bbb0542eda0fc9dec916a20b15dc0fd2ededda39142311a5001d', - '0x8d9e5297186db2d9fb266eaac783182b70152c65550d881c5ecd87b6f0f5a6449f38db9dfa9cce202c6477faaf9b7ac', - '0x166007c08a99db2fc3ba8734ace9824b5eecfdfa8d0cf8ef5dd365bc400a0051d5fa9c01a58b1fb93d1a1399126a775c', - '0x16a3ef08be3ea7ea03bcddfabba6ff6ee5a4375efa1f4fd7feb34fd206357132b920f5b00801dee460ee415a15812ed9', - '0x1866c8ed336c61231a1be54fd1d74cc4f9fb0ce4c6af5920abc5750c4bf39b4852cfe2f7bb9248836b233d9d55535d4a', - '0x167a55cda70a6e1cea820597d94a84903216f763e13d87bb5308592e7ea7d4fbc7385ea3d529b35e346ef48bb8913f55', - '0x4d2f259eea405bd48f010a01ad2911d9c6dd039bb61a6290e591b36e636a5c871a5c29f4f83060400f8b49cba8f6aa8', - '0xaccbb67481d033ff5852c1e48c50c477f94ff8aefce42d28c0f9a88cea7913516f968986f7ebbea9684b529e2561092', - '0xad6b9514c767fe3c3613144b45f1496543346d98adf02267d5ceef9a00d9b8693000763e3b90ac11e99b138573345cc', - '0x2660400eb2e4f3b628bdd0d53cd76f2bf565b94e72927c1cb748df27942480e420517bd8714cc80d1fadc1326ed06f7', - '0xe0fa1d816ddc03e6b24255e0d7819c171c40f65e273b853324efcd6356caa205ca2f570f13497804415473a1d634b8f', - '0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001', // LAST 1 - ], -].map((i) => i.map((j) => BigInt(j)))); -// Optimized SWU Map - Fp to G1 -const G1_SWU = (0, weierstrass_ts_1.mapToCurveSimpleSWU)(Fp, { - A: Fp.create(BigInt('0x144698a3b8e9433d693a02c96d4982b0ea985383ee66a8d8e8981aefd881ac98936f8da0e0f97f5cf428082d584c1d')), - B: Fp.create(BigInt('0x12e2908d11688030018b12e8753eee3b2016c1f0f24f4070a0b9c14fcef35ef55a23215a316ceaa5d1cc48e98e172be0')), - Z: Fp.create(BigInt(11)), -}); -// SWU Map - Fp2 to G2': y² = x³ + 240i * x + 1012 + 1012i -const G2_SWU = (0, weierstrass_ts_1.mapToCurveSimpleSWU)(Fp2, { - A: Fp2.create({ c0: Fp.create(_0n), c1: Fp.create(BigInt(240)) }), // A' = 240 * I - B: Fp2.create({ c0: Fp.create(BigInt(1012)), c1: Fp.create(BigInt(1012)) }), // B' = 1012 * (1 + I) - Z: Fp2.create({ c0: Fp.create(BigInt(-2)), c1: Fp.create(BigInt(-1)) }), // Z: -(2 + I) -}); -function mapToG1(scalars) { - const { x, y } = G1_SWU(Fp.create(scalars[0])); - return isogenyMapG1(x, y); -} -function mapToG2(scalars) { - const { x, y } = G2_SWU(Fp2.fromBigTuple(scalars)); - return isogenyMapG2(x, y); -} -//# sourceMappingURL=bls12-381.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/bls12-381.js.map b/tools/mnemonic-test/node_modules/@noble/curves/bls12-381.js.map deleted file mode 100644 index d36ae8b6..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/bls12-381.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bls12-381.js","sourceRoot":"","sources":["src/bls12-381.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6EG;AACH,sEAAsE;AACtE,mDAA+C;AAC/C,8CAAsD;AACtD,sDAA2D;AAC3D,yCAUoB;AACpB,QAAQ;AACR,kEAAyD;AAEzD,kDAA4D;AAC5D,8DAMmC;AAEnC,qEAAqE;AACrE,kBAAkB;AAClB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAE1F,kBAAkB;AAClB,yEAAyE;AAEzE,kEAAkE;AAClE,+CAA+C;AAC/C,MAAM,KAAK,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC;AAC3C,iDAAiD;AACjD,oBAAoB;AACpB,MAAM,SAAS,GAAG,IAAA,iBAAM,EAAC,KAAK,CAAC,CAAC;AAEhC,WAAW;AACX,yEAAyE;AACzE,+BAA+B;AAC/B,4DAA4D;AAC5D,iDAAiD;AACjD,wDAAw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AAM,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,eAAe;IAClF,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,sBAAsB;IACnG,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,cAAc;CACxF,CAAC,CAAC;AAEH,SAAS,OAAO,CAAC,OAAiB;IAChC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/C,OAAO,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5B,CAAC;AACD,SAAS,OAAO,CAAC,OAAiB;IAChC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,OAAsB,CAAC,CAAC,CAAC;IAClE,OAAO,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/bn254.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/bn254.d.ts deleted file mode 100644 index 64532275..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/bn254.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { type CurveFn as BLSCurveFn, type PostPrecomputeFn } from './abstract/bls.ts'; -import { type IField } from './abstract/modular.ts'; -import { type CurveFn } from './abstract/weierstrass.ts'; -export declare const bn254_Fr: IField; -export declare const _postPrecompute: PostPrecomputeFn; -/** - * bn254 (a.k.a. alt_bn128) pairing-friendly curve. - * Contains G1 / G2 operations and pairings. - */ -export declare const bn254: BLSCurveFn; -/** - * bn254 weierstrass curve with ECDSA. - * This is very rare and probably not used anywhere. - * Instead, you should use G1 / G2, defined above. - * @deprecated - */ -export declare const bn254_weierstrass: CurveFn; -//# sourceMappingURL=bn254.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/bn254.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/bn254.d.ts.map deleted file mode 100644 index 506028b6..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/bn254.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bn254.d.ts","sourceRoot":"","sources":["src/bn254.ts"],"names":[],"mappings":"AAyDA,OAAO,EAEL,KAAK,OAAO,IAAI,UAAU,EAC1B,KAAK,gBAAgB,EAEtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAS,KAAK,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAG3D,OAAO,EAAE,KAAK,OAAO,EAAqC,MAAM,2BAA2B,CAAC;AAsB5F,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,CAA2B,CAAC;AAsDhE,eAAO,MAAM,eAAe,EAAE,gBAY7B,CAAC;AAmBF;;;GAGG;AACH,eAAO,MAAM,KAAK,EAAE,UAgDlB,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,OAS9B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/bn254.js b/tools/mnemonic-test/node_modules/@noble/curves/bn254.js deleted file mode 100644 index 224a846f..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/bn254.js +++ /dev/null @@ -1,218 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.bn254_weierstrass = exports.bn254 = exports._postPrecompute = exports.bn254_Fr = void 0; -/** - * bn254, previously known as alt_bn_128, when it had 128-bit security. - -Barbulescu-Duquesne 2017 shown it's weaker: just about 100 bits, -so the naming has been adjusted to its prime bit count: -https://hal.science/hal-01534101/file/main.pdf. -Compatible with EIP-196 and EIP-197. - -There are huge compatibility issues in the ecosystem: - -1. Different libraries call it in different ways: "bn254", "bn256", "alt_bn128", "bn128". -2. libff has bn128, but it's a different curve with different G2: - https://github.com/scipr-lab/libff/blob/a44f482e18b8ac04d034c193bd9d7df7817ad73f/libff/algebra/curves/bn128/bn128_init.cpp#L166-L169 -3. halo2curves bn256 is also incompatible and returns different outputs - -We don't implement Point methods toHex / toBytes. -To work around this limitation, has to initialize points on their own from BigInts. -Reason it's not implemented is because [there is no standard](https://github.com/privacy-scaling-explorations/halo2curves/issues/109). -Points of divergence: - -- Endianness: LE vs BE (byte-swapped) -- Flags as first hex bits (similar to BLS) vs no-flags -- Imaginary part last in G2 vs first (c0, c1 vs c1, c0) - -The goal of our implementation is to support "Ethereum" variant of the curve, -because it at least has specs: - -- EIP196 (https://eips.ethereum.org/EIPS/eip-196) describes bn254 ECADD and ECMUL opcodes for EVM -- EIP197 (https://eips.ethereum.org/EIPS/eip-197) describes bn254 pairings -- It's hard: EIPs don't have proper tests. EIP-197 returns boolean output instead of Fp12 -- The existing implementations are bad. Some are deprecated: - - https://github.com/paritytech/bn (old version) - - https://github.com/ewasm/ethereum-bn128.rs (uses paritytech/bn) - - https://github.com/zcash-hackworks/bn - - https://github.com/arkworks-rs/curves/blob/master/bn254/src/lib.rs -- Python implementations use different towers and produce different Fp12 outputs: - - https://github.com/ethereum/py_pairing - - https://github.com/ethereum/execution-specs/blob/master/src/ethereum/crypto/alt_bn128.py -- Points are encoded differently in different implementations - -### Params -Seed (X): 4965661367192848881 -Fr: (36x⁴+36x³+18x²+6x+1) -Fp: (36x⁴+36x³+24x²+6x+1) -(E / Fp ): Y² = X³+3 -(Et / Fp²): Y² = X³+3/(u+9) (D-type twist) -Ate loop size: 6x+2 - -### Towers -- Fp²[u] = Fp/u²+1 -- Fp⁶[v] = Fp²/v³-9-u -- Fp¹²[w] = Fp⁶/w²-v - - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const sha2_js_1 = require("@noble/hashes/sha2.js"); -const bls_ts_1 = require("./abstract/bls.js"); -const modular_ts_1 = require("./abstract/modular.js"); -const tower_ts_1 = require("./abstract/tower.js"); -const weierstrass_ts_1 = require("./abstract/weierstrass.js"); -const utils_ts_1 = require("./utils.js"); -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3); -const _6n = BigInt(6); -const BN_X = BigInt('4965661367192848881'); -const BN_X_LEN = (0, utils_ts_1.bitLen)(BN_X); -const SIX_X_SQUARED = _6n * BN_X ** _2n; -const bn254_G1_CURVE = { - p: BigInt('0x30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47'), - n: BigInt('0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001'), - h: _1n, - a: _0n, - b: _3n, - Gx: _1n, - Gy: BigInt(2), -}; -// r == n -// Finite field over r. It's for convenience and is not used in the code below. -exports.bn254_Fr = (0, modular_ts_1.Field)(bn254_G1_CURVE.n); -// Fp2.div(Fp2.mul(Fp2.ONE, _3n), Fp2.NONRESIDUE) -const Fp2B = { - c0: BigInt('19485874751759354771024239261021720505790618469301721065564631296452457478373'), - c1: BigInt('266929791119991161246907387137283842545076965332900288569378510910307636690'), -}; -const { Fp, Fp2, Fp6, Fp12 } = (0, tower_ts_1.tower12)({ - ORDER: bn254_G1_CURVE.p, - X_LEN: BN_X_LEN, - FP2_NONRESIDUE: [BigInt(9), _1n], - Fp2mulByB: (num) => Fp2.mul(num, Fp2B), - Fp12finalExponentiate: (num) => { - const powMinusX = (num) => Fp12.conjugate(Fp12._cyclotomicExp(num, BN_X)); - const r0 = Fp12.mul(Fp12.conjugate(num), Fp12.inv(num)); - const r = Fp12.mul(Fp12.frobeniusMap(r0, 2), r0); - const y1 = Fp12._cyclotomicSquare(powMinusX(r)); - const y2 = Fp12.mul(Fp12._cyclotomicSquare(y1), y1); - const y4 = powMinusX(y2); - const y6 = powMinusX(Fp12._cyclotomicSquare(y4)); - const y8 = Fp12.mul(Fp12.mul(Fp12.conjugate(y6), y4), Fp12.conjugate(y2)); - const y9 = Fp12.mul(y8, y1); - return Fp12.mul(Fp12.frobeniusMap(Fp12.mul(Fp12.conjugate(r), y9), 3), Fp12.mul(Fp12.frobeniusMap(y8, 2), Fp12.mul(Fp12.frobeniusMap(y9, 1), Fp12.mul(Fp12.mul(y8, y4), r)))); - }, -}); -// END OF CURVE FIELDS -const { G2psi, psi } = (0, tower_ts_1.psiFrobenius)(Fp, Fp2, Fp2.NONRESIDUE); -/* -No hashToCurve for now (and signatures): - -- RFC 9380 doesn't mention bn254 and doesn't provide test vectors -- Overall seems like nobody is using BLS signatures on top of bn254 -- Seems like it can utilize SVDW, which is not implemented yet -*/ -const htfDefaults = Object.freeze({ - // DST: a domain separation tag defined in section 2.2.5 - DST: 'BN254G2_XMD:SHA-256_SVDW_RO_', - encodeDST: 'BN254G2_XMD:SHA-256_SVDW_RO_', - p: Fp.ORDER, - m: 2, - k: 128, - expand: 'xmd', - hash: sha2_js_1.sha256, -}); -const _postPrecompute = (Rx, Ry, Rz, Qx, Qy, pointAdd) => { - const q = psi(Qx, Qy); - ({ Rx, Ry, Rz } = pointAdd(Rx, Ry, Rz, q[0], q[1])); - const q2 = psi(q[0], q[1]); - pointAdd(Rx, Ry, Rz, q2[0], Fp2.neg(q2[1])); -}; -exports._postPrecompute = _postPrecompute; -// cofactor: (36 * X^4) + (36 * X^3) + (30 * X^2) + 6*X + 1 -const bn254_G2_CURVE = { - p: Fp2.ORDER, - n: bn254_G1_CURVE.n, - h: BigInt('0x30644e72e131a029b85045b68181585e06ceecda572a2489345f2299c0f9fa8d'), - a: Fp2.ZERO, - b: Fp2B, - Gx: Fp2.fromBigTuple([ - BigInt('10857046999023057135944570762232829481370756359578518086990519993285655852781'), - BigInt('11559732032986387107991004021392285783925812861821192530917403151452391805634'), - ]), - Gy: Fp2.fromBigTuple([ - BigInt('8495653923123431417604973247489272438418190587263600148770280649306958101930'), - BigInt('4082367875863433681332203403145435568316851327593401208105741076214120093531'), - ]), -}; -/** - * bn254 (a.k.a. alt_bn128) pairing-friendly curve. - * Contains G1 / G2 operations and pairings. - */ -exports.bn254 = (0, bls_ts_1.bls)({ - // Fields - fields: { Fp, Fp2, Fp6, Fp12, Fr: exports.bn254_Fr }, - G1: { - ...bn254_G1_CURVE, - Fp, - htfDefaults: { ...htfDefaults, m: 1, DST: 'BN254G2_XMD:SHA-256_SVDW_RO_' }, - wrapPrivateKey: true, - allowInfinityPoint: true, - mapToCurve: utils_ts_1.notImplemented, - fromBytes: utils_ts_1.notImplemented, - toBytes: utils_ts_1.notImplemented, - ShortSignature: { - fromBytes: utils_ts_1.notImplemented, - fromHex: utils_ts_1.notImplemented, - toBytes: utils_ts_1.notImplemented, - toRawBytes: utils_ts_1.notImplemented, - toHex: utils_ts_1.notImplemented, - }, - }, - G2: { - ...bn254_G2_CURVE, - Fp: Fp2, - hEff: BigInt('21888242871839275222246405745257275088844257914179612981679871602714643921549'), - htfDefaults: { ...htfDefaults }, - wrapPrivateKey: true, - allowInfinityPoint: true, - isTorsionFree: (c, P) => P.multiplyUnsafe(SIX_X_SQUARED).equals(G2psi(c, P)), // [p]P = [6X^2]P - mapToCurve: utils_ts_1.notImplemented, - fromBytes: utils_ts_1.notImplemented, - toBytes: utils_ts_1.notImplemented, - Signature: { - fromBytes: utils_ts_1.notImplemented, - fromHex: utils_ts_1.notImplemented, - toBytes: utils_ts_1.notImplemented, - toRawBytes: utils_ts_1.notImplemented, - toHex: utils_ts_1.notImplemented, - }, - }, - params: { - ateLoopSize: BN_X * _6n + _2n, - r: exports.bn254_Fr.ORDER, - xNegative: false, - twistType: 'divisive', - }, - htfDefaults, - hash: sha2_js_1.sha256, - postPrecompute: exports._postPrecompute, -}); -/** - * bn254 weierstrass curve with ECDSA. - * This is very rare and probably not used anywhere. - * Instead, you should use G1 / G2, defined above. - * @deprecated - */ -exports.bn254_weierstrass = (0, weierstrass_ts_1.weierstrass)({ - a: BigInt(0), - b: BigInt(3), - Fp, - n: BigInt('21888242871839275222246405745257275088548364400416034343698204186575808495617'), - Gx: BigInt(1), - Gy: BigInt(2), - h: BigInt(1), - hash: sha2_js_1.sha256, -}); -//# sourceMappingURL=bn254.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/bn254.js.map b/tools/mnemonic-test/node_modules/@noble/curves/bn254.js.map deleted file mode 100644 index b87a3439..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/bn254.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bn254.js","sourceRoot":"","sources":["src/bn254.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,sEAAsE;AACtE,mDAA+C;AAC/C,8CAK2B;AAC3B,sDAA2D;AAE3D,kDAA4D;AAC5D,8DAA4F;AAC5F,yCAAoD;AACpD,kBAAkB;AAClB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACzE,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAEtB,MAAM,IAAI,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAC3C,MAAM,QAAQ,GAAG,IAAA,iBAAM,EAAC,IAAI,CAAC,CAAC;AAC9B,MAAM,aAAa,GAAG,GAAG,GAAG,IAAI,I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AAS,EAAE,yBAAc;YACzB,OAAO,EAAE,yBAAc;YACvB,OAAO,EAAE,yBAAc;YACvB,UAAU,EAAE,yBAAc;YAC1B,KAAK,EAAE,yBAAc;SACtB;KACF;IACD,MAAM,EAAE;QACN,WAAW,EAAE,IAAI,GAAG,GAAG,GAAG,GAAG;QAC7B,CAAC,EAAE,gBAAQ,CAAC,KAAK;QACjB,SAAS,EAAE,KAAK;QAChB,SAAS,EAAE,UAAU;KACtB;IACD,WAAW;IACX,IAAI,EAAE,gBAAM;IACZ,cAAc,EAAE,uBAAe;CAChC,CAAC,CAAC;AAEH;;;;;GAKG;AACU,QAAA,iBAAiB,GAAY,IAAA,4BAAW,EAAC;IACpD,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,EAAE;IACF,CAAC,EAAE,MAAM,CAAC,+EAA+E,CAAC;IAC1F,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;IACb,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;IACb,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,IAAI,EAAE,gBAAM;CACb,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/ed25519.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/ed25519.d.ts deleted file mode 100644 index 234f8c9f..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/ed25519.d.ts +++ /dev/null @@ -1,106 +0,0 @@ -import { type AffinePoint } from './abstract/curve.ts'; -import { PrimeEdwardsPoint, type CurveFn, type EdwardsPoint } from './abstract/edwards.ts'; -import { type H2CHasher, type H2CHasherBase, type H2CMethod, type htfBasicOpts } from './abstract/hash-to-curve.ts'; -import { type IField } from './abstract/modular.ts'; -import { type MontgomeryECDH as XCurveFn } from './abstract/montgomery.ts'; -import { type Hex } from './utils.ts'; -/** - * ed25519 curve with EdDSA signatures. - * @example - * import { ed25519 } from '@noble/curves/ed25519'; - * const { secretKey, publicKey } = ed25519.keygen(); - * const msg = new TextEncoder().encode('hello'); - * const sig = ed25519.sign(msg, priv); - * ed25519.verify(sig, msg, pub); // Default mode: follows ZIP215 - * ed25519.verify(sig, msg, pub, { zip215: false }); // RFC8032 / FIPS 186-5 - */ -export declare const ed25519: CurveFn; -/** Context of ed25519. Uses context for domain separation. */ -export declare const ed25519ctx: CurveFn; -/** Prehashed version of ed25519. Accepts already-hashed messages in sign() and verify(). */ -export declare const ed25519ph: CurveFn; -/** - * ECDH using curve25519 aka x25519. - * @example - * import { x25519 } from '@noble/curves/ed25519'; - * const priv = 'a546e36bf0527c9d3b16154b82465edd62144c0ac1fc5a18506a2244ba449ac4'; - * const pub = 'e6db6867583030db3594c1a424b15f7c726624ec26b3353b10a903a6d0ab1c4c'; - * x25519.getSharedSecret(priv, pub) === x25519.scalarMult(priv, pub); // aliases - * x25519.getPublicKey(priv) === x25519.scalarMultBase(priv); - * x25519.getPublicKey(x25519.utils.randomSecretKey()); - */ -export declare const x25519: XCurveFn; -/** Hashing to ed25519 points / field. RFC 9380 methods. */ -export declare const ed25519_hasher: H2CHasher; -type ExtendedPoint = EdwardsPoint; -/** - * Wrapper over Edwards Point for ristretto255. - * - * Each ed25519/ExtendedPoint has 8 different equivalent points. This can be - * a source of bugs for protocols like ring signatures. Ristretto was created to solve this. - * Ristretto point operates in X:Y:Z:T extended coordinates like ExtendedPoint, - * but it should work in its own namespace: do not combine those two. - * See [RFC9496](https://www.rfc-editor.org/rfc/rfc9496). - */ -declare class _RistrettoPoint extends PrimeEdwardsPoint<_RistrettoPoint> { - static BASE: _RistrettoPoint; - static ZERO: _RistrettoPoint; - static Fp: IField; - static Fn: IField; - constructor(ep: ExtendedPoint); - static fromAffine(ap: AffinePoint): _RistrettoPoint; - protected assertSame(other: _RistrettoPoint): void; - protected init(ep: EdwardsPoint): _RistrettoPoint; - /** @deprecated use `import { ristretto255_hasher } from '@noble/curves/ed25519.js';` */ - static hashToCurve(hex: Hex): _RistrettoPoint; - static fromBytes(bytes: Uint8Array): _RistrettoPoint; - /** - * Converts ristretto-encoded string to ristretto point. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-decode). - * @param hex Ristretto-encoded 32 bytes. Not every 32-byte string is valid ristretto encoding - */ - static fromHex(hex: Hex): _RistrettoPoint; - static msm(points: _RistrettoPoint[], scalars: bigint[]): _RistrettoPoint; - /** - * Encodes ristretto point to Uint8Array. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-encode). - */ - toBytes(): Uint8Array; - /** - * Compares two Ristretto points. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-equals). - */ - equals(other: _RistrettoPoint): boolean; - is0(): boolean; -} -export declare const ristretto255: { - Point: typeof _RistrettoPoint; -}; -/** Hashing to ristretto255 points / field. RFC 9380 methods. */ -export declare const ristretto255_hasher: H2CHasherBase; -/** - * Weird / bogus points, useful for debugging. - * All 8 ed25519 points of 8-torsion subgroup can be generated from the point - * T = `26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05`. - * ⟨T⟩ = { O, T, 2T, 3T, 4T, 5T, 6T, 7T } - */ -export declare const ED25519_TORSION_SUBGROUP: string[]; -/** @deprecated use `ed25519.utils.toMontgomery` */ -export declare function edwardsToMontgomeryPub(edwardsPub: Hex): Uint8Array; -/** @deprecated use `ed25519.utils.toMontgomery` */ -export declare const edwardsToMontgomery: typeof edwardsToMontgomeryPub; -/** @deprecated use `ed25519.utils.toMontgomerySecret` */ -export declare function edwardsToMontgomeryPriv(edwardsPriv: Uint8Array): Uint8Array; -/** @deprecated use `ristretto255.Point` */ -export declare const RistrettoPoint: typeof _RistrettoPoint; -/** @deprecated use `import { ed25519_hasher } from '@noble/curves/ed25519.js';` */ -export declare const hashToCurve: H2CMethod; -/** @deprecated use `import { ed25519_hasher } from '@noble/curves/ed25519.js';` */ -export declare const encodeToCurve: H2CMethod; -type RistHasher = (msg: Uint8Array, options: htfBasicOpts) => _RistrettoPoint; -/** @deprecated use `import { ristretto255_hasher } from '@noble/curves/ed25519.js';` */ -export declare const hashToRistretto255: RistHasher; -/** @deprecated use `import { ristretto255_hasher } from '@noble/curves/ed25519.js';` */ -export declare const hash_to_ristretto255: RistHasher; -export {}; -//# sourceMappingURL=ed25519.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/ed25519.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/ed25519.d.ts.map deleted file mode 100644 index 94d769e2..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/ed25519.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed25519.d.ts","sourceRoot":"","sources":["src/ed25519.ts"],"names":[],"mappings":"AAUA,OAAO,EAAa,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EACL,iBAAiB,EAEjB,KAAK,OAAO,EAEZ,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,YAAY,EAClB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAOL,KAAK,MAAM,EACZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAc,KAAK,cAAc,IAAI,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACvF,OAAO,EAA4C,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AA+FhF;;;;;;;;;GASG;AACH,eAAO,MAAM,OAAO,EAAE,OAAmE,CAAC;AAY1F,8DAA8D;AAC9D,eAAO,MAAM,UAAU,EAAE,OAIlB,CAAC;AAER,4FAA4F;AAC5F,eAAO,MAAM,SAAS,EAAE,OAMlB,CAAC;AAEP;;;;;;;;;GASG;AACH,eAAO,MAAM,MAAM,EAAE,QAYjB,CAAC;AA0EL,2DAA2D;AAC3D,eAAO,MAAM,cAAc,EAAE,SAAS,CAAC,MAAM,CAavC,CAA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ACnD,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,GAAG,GAAG,UAAU,CAElE;AACD,mDAAmD;AACnD,eAAO,MAAM,mBAAmB,EAAE,OAAO,sBAA+C,CAAC;AAEzF,yDAAyD;AACzD,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,UAAU,GAAG,UAAU,CAE3E;AAED,2CAA2C;AAC3C,eAAO,MAAM,cAAc,EAAE,OAAO,eAAiC,CAAC;AACtE,mFAAmF;AACnF,eAAO,MAAM,WAAW,EAAE,SAAS,CAAC,MAAM,CAAwD,CAAC;AACnG,mFAAmF;AACnF,eAAO,MAAM,aAAa,EAAE,SAAS,CAAC,MAAM,CACX,CAAC;AAClC,KAAK,UAAU,GAAG,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,KAAK,eAAe,CAAC;AAC9E,wFAAwF;AACxF,eAAO,MAAM,kBAAkB,EAAE,UACiB,CAAC;AACnD,wFAAwF;AACxF,eAAO,MAAM,oBAAoB,EAAE,UACe,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/ed25519.js b/tools/mnemonic-test/node_modules/@noble/curves/ed25519.js deleted file mode 100644 index fb60a0a4..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/ed25519.js +++ /dev/null @@ -1,472 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.hash_to_ristretto255 = exports.hashToRistretto255 = exports.encodeToCurve = exports.hashToCurve = exports.RistrettoPoint = exports.edwardsToMontgomery = exports.ED25519_TORSION_SUBGROUP = exports.ristretto255_hasher = exports.ristretto255 = exports.ed25519_hasher = exports.x25519 = exports.ed25519ph = exports.ed25519ctx = exports.ed25519 = void 0; -exports.edwardsToMontgomeryPub = edwardsToMontgomeryPub; -exports.edwardsToMontgomeryPriv = edwardsToMontgomeryPriv; -/** - * ed25519 Twisted Edwards curve with following addons: - * - X25519 ECDH - * - Ristretto cofactor elimination - * - Elligator hash-to-group / point indistinguishability - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const sha2_js_1 = require("@noble/hashes/sha2.js"); -const utils_js_1 = require("@noble/hashes/utils.js"); -const curve_ts_1 = require("./abstract/curve.js"); -const edwards_ts_1 = require("./abstract/edwards.js"); -const hash_to_curve_ts_1 = require("./abstract/hash-to-curve.js"); -const modular_ts_1 = require("./abstract/modular.js"); -const montgomery_ts_1 = require("./abstract/montgomery.js"); -const utils_ts_1 = require("./utils.js"); -// prettier-ignore -const _0n = /* @__PURE__ */ BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3); -// prettier-ignore -const _5n = BigInt(5), _8n = BigInt(8); -// P = 2n**255n-19n -const ed25519_CURVE_p = BigInt('0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed'); -// N = 2n**252n + 27742317777372353535851937790883648493n -// a = Fp.create(BigInt(-1)) -// d = -121665/121666 a.k.a. Fp.neg(121665 * Fp.inv(121666)) -const ed25519_CURVE = /* @__PURE__ */ (() => ({ - p: ed25519_CURVE_p, - n: BigInt('0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed'), - h: _8n, - a: BigInt('0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec'), - d: BigInt('0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3'), - Gx: BigInt('0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a'), - Gy: BigInt('0x6666666666666666666666666666666666666666666666666666666666666658'), -}))(); -function ed25519_pow_2_252_3(x) { - // prettier-ignore - const _10n = BigInt(10), _20n = BigInt(20), _40n = BigInt(40), _80n = BigInt(80); - const P = ed25519_CURVE_p; - const x2 = (x * x) % P; - const b2 = (x2 * x) % P; // x^3, 11 - const b4 = ((0, modular_ts_1.pow2)(b2, _2n, P) * b2) % P; // x^15, 1111 - const b5 = ((0, modular_ts_1.pow2)(b4, _1n, P) * x) % P; // x^31 - const b10 = ((0, modular_ts_1.pow2)(b5, _5n, P) * b5) % P; - const b20 = ((0, modular_ts_1.pow2)(b10, _10n, P) * b10) % P; - const b40 = ((0, modular_ts_1.pow2)(b20, _20n, P) * b20) % P; - const b80 = ((0, modular_ts_1.pow2)(b40, _40n, P) * b40) % P; - const b160 = ((0, modular_ts_1.pow2)(b80, _80n, P) * b80) % P; - const b240 = ((0, modular_ts_1.pow2)(b160, _80n, P) * b80) % P; - const b250 = ((0, modular_ts_1.pow2)(b240, _10n, P) * b10) % P; - const pow_p_5_8 = ((0, modular_ts_1.pow2)(b250, _2n, P) * x) % P; - // ^ To pow to (p+3)/8, multiply it by x. - return { pow_p_5_8, b2 }; -} -function adjustScalarBytes(bytes) { - // Section 5: For X25519, in order to decode 32 random bytes as an integer scalar, - // set the three least significant bits of the first byte - bytes[0] &= 248; // 0b1111_1000 - // and the most significant bit of the last to zero, - bytes[31] &= 127; // 0b0111_1111 - // set the second most significant bit of the last byte to 1 - bytes[31] |= 64; // 0b0100_0000 - return bytes; -} -// √(-1) aka √(a) aka 2^((p-1)/4) -// Fp.sqrt(Fp.neg(1)) -const ED25519_SQRT_M1 = /* @__PURE__ */ BigInt('19681161376707505956807079304988542015446066515923890162744021073123829784752'); -// sqrt(u/v) -function uvRatio(u, v) { - const P = ed25519_CURVE_p; - const v3 = (0, modular_ts_1.mod)(v * v * v, P); // v³ - const v7 = (0, modular_ts_1.mod)(v3 * v3 * v, P); // v⁷ - // (p+3)/8 and (p-5)/8 - const pow = ed25519_pow_2_252_3(u * v7).pow_p_5_8; - let x = (0, modular_ts_1.mod)(u * v3 * pow, P); // (uv³)(uv⁷)^(p-5)/8 - const vx2 = (0, modular_ts_1.mod)(v * x * x, P); // vx² - const root1 = x; // First root candidate - const root2 = (0, modular_ts_1.mod)(x * ED25519_SQRT_M1, P); // Second root candidate - const useRoot1 = vx2 === u; // If vx² = u (mod p), x is a square root - const useRoot2 = vx2 === (0, modular_ts_1.mod)(-u, P); // If vx² = -u, set x <-- x * 2^((p-1)/4) - const noRoot = vx2 === (0, modular_ts_1.mod)(-u * ED25519_SQRT_M1, P); // There is no valid root, vx² = -u√(-1) - if (useRoot1) - x = root1; - if (useRoot2 || noRoot) - x = root2; // We return root2 anyway, for const-time - if ((0, modular_ts_1.isNegativeLE)(x, P)) - x = (0, modular_ts_1.mod)(-x, P); - return { isValid: useRoot1 || useRoot2, value: x }; -} -const Fp = /* @__PURE__ */ (() => (0, modular_ts_1.Field)(ed25519_CURVE.p, { isLE: true }))(); -const Fn = /* @__PURE__ */ (() => (0, modular_ts_1.Field)(ed25519_CURVE.n, { isLE: true }))(); -const ed25519Defaults = /* @__PURE__ */ (() => ({ - ...ed25519_CURVE, - Fp, - hash: sha2_js_1.sha512, - adjustScalarBytes, - // dom2 - // Ratio of u to v. Allows us to combine inversion and square root. Uses algo from RFC8032 5.1.3. - // Constant-time, u/√v - uvRatio, -}))(); -/** - * ed25519 curve with EdDSA signatures. - * @example - * import { ed25519 } from '@noble/curves/ed25519'; - * const { secretKey, publicKey } = ed25519.keygen(); - * const msg = new TextEncoder().encode('hello'); - * const sig = ed25519.sign(msg, priv); - * ed25519.verify(sig, msg, pub); // Default mode: follows ZIP215 - * ed25519.verify(sig, msg, pub, { zip215: false }); // RFC8032 / FIPS 186-5 - */ -exports.ed25519 = (() => (0, edwards_ts_1.twistedEdwards)(ed25519Defaults))(); -function ed25519_domain(data, ctx, phflag) { - if (ctx.length > 255) - throw new Error('Context is too big'); - return (0, utils_js_1.concatBytes)((0, utils_js_1.utf8ToBytes)('SigEd25519 no Ed25519 collisions'), new Uint8Array([phflag ? 1 : 0, ctx.length]), ctx, data); -} -/** Context of ed25519. Uses context for domain separation. */ -exports.ed25519ctx = (() => (0, edwards_ts_1.twistedEdwards)({ - ...ed25519Defaults, - domain: ed25519_domain, -}))(); -/** Prehashed version of ed25519. Accepts already-hashed messages in sign() and verify(). */ -exports.ed25519ph = (() => (0, edwards_ts_1.twistedEdwards)(Object.assign({}, ed25519Defaults, { - domain: ed25519_domain, - prehash: sha2_js_1.sha512, -})))(); -/** - * ECDH using curve25519 aka x25519. - * @example - * import { x25519 } from '@noble/curves/ed25519'; - * const priv = 'a546e36bf0527c9d3b16154b82465edd62144c0ac1fc5a18506a2244ba449ac4'; - * const pub = 'e6db6867583030db3594c1a424b15f7c726624ec26b3353b10a903a6d0ab1c4c'; - * x25519.getSharedSecret(priv, pub) === x25519.scalarMult(priv, pub); // aliases - * x25519.getPublicKey(priv) === x25519.scalarMultBase(priv); - * x25519.getPublicKey(x25519.utils.randomSecretKey()); - */ -exports.x25519 = (() => { - const P = Fp.ORDER; - return (0, montgomery_ts_1.montgomery)({ - P, - type: 'x25519', - powPminus2: (x) => { - // x^(p-2) aka x^(2^255-21) - const { pow_p_5_8, b2 } = ed25519_pow_2_252_3(x); - return (0, modular_ts_1.mod)((0, modular_ts_1.pow2)(pow_p_5_8, _3n, P) * b2, P); - }, - adjustScalarBytes, - }); -})(); -// Hash To Curve Elligator2 Map (NOTE: different from ristretto255 elligator) -// NOTE: very important part is usage of FpSqrtEven for ELL2_C1_EDWARDS, since -// SageMath returns different root first and everything falls apart -const ELL2_C1 = /* @__PURE__ */ (() => (ed25519_CURVE_p + _3n) / _8n)(); // 1. c1 = (q + 3) / 8 # Integer arithmetic -const ELL2_C2 = /* @__PURE__ */ (() => Fp.pow(_2n, ELL2_C1))(); // 2. c2 = 2^c1 -const ELL2_C3 = /* @__PURE__ */ (() => Fp.sqrt(Fp.neg(Fp.ONE)))(); // 3. c3 = sqrt(-1) -// prettier-ignore -function map_to_curve_elligator2_curve25519(u) { - const ELL2_C4 = (ed25519_CURVE_p - _5n) / _8n; // 4. c4 = (q - 5) / 8 # Integer arithmetic - const ELL2_J = BigInt(486662); - let tv1 = Fp.sqr(u); // 1. tv1 = u^2 - tv1 = Fp.mul(tv1, _2n); // 2. tv1 = 2 * tv1 - let xd = Fp.add(tv1, Fp.ONE); // 3. xd = tv1 + 1 # Nonzero: -1 is square (mod p), tv1 is not - let x1n = Fp.neg(ELL2_J); // 4. x1n = -J # x1 = x1n / xd = -J / (1 + 2 * u^2) - let tv2 = Fp.sqr(xd); // 5. tv2 = xd^2 - let gxd = Fp.mul(tv2, xd); // 6. gxd = tv2 * xd # gxd = xd^3 - let gx1 = Fp.mul(tv1, ELL2_J); // 7. gx1 = J * tv1 # x1n + J * xd - gx1 = Fp.mul(gx1, x1n); // 8. gx1 = gx1 * x1n # x1n^2 + J * x1n * xd - gx1 = Fp.add(gx1, tv2); // 9. gx1 = gx1 + tv2 # x1n^2 + J * x1n * xd + xd^2 - gx1 = Fp.mul(gx1, x1n); // 10. gx1 = gx1 * x1n # x1n^3 + J * x1n^2 * xd + x1n * xd^2 - let tv3 = Fp.sqr(gxd); // 11. tv3 = gxd^2 - tv2 = Fp.sqr(tv3); // 12. tv2 = tv3^2 # gxd^4 - tv3 = Fp.mul(tv3, gxd); // 13. tv3 = tv3 * gxd # gxd^3 - tv3 = Fp.mul(tv3, gx1); // 14. tv3 = tv3 * gx1 # gx1 * gxd^3 - tv2 = Fp.mul(tv2, tv3); // 15. tv2 = tv2 * tv3 # gx1 * gxd^7 - let y11 = Fp.pow(tv2, ELL2_C4); // 16. y11 = tv2^c4 # (gx1 * gxd^7)^((p - 5) / 8) - y11 = Fp.mul(y11, tv3); // 17. y11 = y11 * tv3 # gx1*gxd^3*(gx1*gxd^7)^((p-5)/8) - let y12 = Fp.mul(y11, ELL2_C3); // 18. y12 = y11 * c3 - tv2 = Fp.sqr(y11); // 19. tv2 = y11^2 - tv2 = Fp.mul(tv2, gxd); // 20. tv2 = tv2 * gxd - let e1 = Fp.eql(tv2, gx1); // 21. e1 = tv2 == gx1 - let y1 = Fp.cmov(y12, y11, e1); // 22. y1 = CMOV(y12, y11, e1) # If g(x1) is square, this is its sqrt - let x2n = Fp.mul(x1n, tv1); // 23. x2n = x1n * tv1 # x2 = x2n / xd = 2 * u^2 * x1n / xd - let y21 = Fp.mul(y11, u); // 24. y21 = y11 * u - y21 = Fp.mul(y21, ELL2_C2); // 25. y21 = y21 * c2 - let y22 = Fp.mul(y21, ELL2_C3); // 26. y22 = y21 * c3 - let gx2 = Fp.mul(gx1, tv1); // 27. gx2 = gx1 * tv1 # g(x2) = gx2 / gxd = 2 * u^2 * g(x1) - tv2 = Fp.sqr(y21); // 28. tv2 = y21^2 - tv2 = Fp.mul(tv2, gxd); // 29. tv2 = tv2 * gxd - let e2 = Fp.eql(tv2, gx2); // 30. e2 = tv2 == gx2 - let y2 = Fp.cmov(y22, y21, e2); // 31. y2 = CMOV(y22, y21, e2) # If g(x2) is square, this is its sqrt - tv2 = Fp.sqr(y1); // 32. tv2 = y1^2 - tv2 = Fp.mul(tv2, gxd); // 33. tv2 = tv2 * gxd - let e3 = Fp.eql(tv2, gx1); // 34. e3 = tv2 == gx1 - let xn = Fp.cmov(x2n, x1n, e3); // 35. xn = CMOV(x2n, x1n, e3) # If e3, x = x1, else x = x2 - let y = Fp.cmov(y2, y1, e3); // 36. y = CMOV(y2, y1, e3) # If e3, y = y1, else y = y2 - let e4 = Fp.isOdd(y); // 37. e4 = sgn0(y) == 1 # Fix sign of y - y = Fp.cmov(y, Fp.neg(y), e3 !== e4); // 38. y = CMOV(y, -y, e3 XOR e4) - return { xMn: xn, xMd: xd, yMn: y, yMd: _1n }; // 39. return (xn, xd, y, 1) -} -const ELL2_C1_EDWARDS = /* @__PURE__ */ (() => (0, modular_ts_1.FpSqrtEven)(Fp, Fp.neg(BigInt(486664))))(); // sgn0(c1) MUST equal 0 -function map_to_curve_elligator2_edwards25519(u) { - const { xMn, xMd, yMn, yMd } = map_to_curve_elligator2_curve25519(u); // 1. (xMn, xMd, yMn, yMd) = - // map_to_curve_elligator2_curve25519(u) - let xn = Fp.mul(xMn, yMd); // 2. xn = xMn * yMd - xn = Fp.mul(xn, ELL2_C1_EDWARDS); // 3. xn = xn * c1 - let xd = Fp.mul(xMd, yMn); // 4. xd = xMd * yMn # xn / xd = c1 * xM / yM - let yn = Fp.sub(xMn, xMd); // 5. yn = xMn - xMd - let yd = Fp.add(xMn, xMd); // 6. yd = xMn + xMd # (n / d - 1) / (n / d + 1) = (n - d) / (n + d) - let tv1 = Fp.mul(xd, yd); // 7. tv1 = xd * yd - let e = Fp.eql(tv1, Fp.ZERO); // 8. e = tv1 == 0 - xn = Fp.cmov(xn, Fp.ZERO, e); // 9. xn = CMOV(xn, 0, e) - xd = Fp.cmov(xd, Fp.ONE, e); // 10. xd = CMOV(xd, 1, e) - yn = Fp.cmov(yn, Fp.ONE, e); // 11. yn = CMOV(yn, 1, e) - yd = Fp.cmov(yd, Fp.ONE, e); // 12. yd = CMOV(yd, 1, e) - const [xd_inv, yd_inv] = (0, modular_ts_1.FpInvertBatch)(Fp, [xd, yd], true); // batch division - return { x: Fp.mul(xn, xd_inv), y: Fp.mul(yn, yd_inv) }; // 13. return (xn, xd, yn, yd) -} -/** Hashing to ed25519 points / field. RFC 9380 methods. */ -exports.ed25519_hasher = (() => (0, hash_to_curve_ts_1.createHasher)(exports.ed25519.Point, (scalars) => map_to_curve_elligator2_edwards25519(scalars[0]), { - DST: 'edwards25519_XMD:SHA-512_ELL2_RO_', - encodeDST: 'edwards25519_XMD:SHA-512_ELL2_NU_', - p: ed25519_CURVE_p, - m: 1, - k: 128, - expand: 'xmd', - hash: sha2_js_1.sha512, -}))(); -// √(-1) aka √(a) aka 2^((p-1)/4) -const SQRT_M1 = ED25519_SQRT_M1; -// √(ad - 1) -const SQRT_AD_MINUS_ONE = /* @__PURE__ */ BigInt('25063068953384623474111414158702152701244531502492656460079210482610430750235'); -// 1 / √(a-d) -const INVSQRT_A_MINUS_D = /* @__PURE__ */ BigInt('54469307008909316920995813868745141605393597292927456921205312896311721017578'); -// 1-d² -const ONE_MINUS_D_SQ = /* @__PURE__ */ BigInt('1159843021668779879193775521855586647937357759715417654439879720876111806838'); -// (d-1)² -const D_MINUS_ONE_SQ = /* @__PURE__ */ BigInt('40440834346308536858101042469323190826248399146238708352240133220865137265952'); -// Calculates 1/√(number) -const invertSqrt = (number) => uvRatio(_1n, number); -const MAX_255B = /* @__PURE__ */ BigInt('0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'); -const bytes255ToNumberLE = (bytes) => exports.ed25519.Point.Fp.create((0, utils_ts_1.bytesToNumberLE)(bytes) & MAX_255B); -/** - * Computes Elligator map for Ristretto255. - * Described in [RFC9380](https://www.rfc-editor.org/rfc/rfc9380#appendix-B) and on - * the [website](https://ristretto.group/formulas/elligator.html). - */ -function calcElligatorRistrettoMap(r0) { - const { d } = ed25519_CURVE; - const P = ed25519_CURVE_p; - const mod = (n) => Fp.create(n); - const r = mod(SQRT_M1 * r0 * r0); // 1 - const Ns = mod((r + _1n) * ONE_MINUS_D_SQ); // 2 - let c = BigInt(-1); // 3 - const D = mod((c - d * r) * mod(r + d)); // 4 - let { isValid: Ns_D_is_sq, value: s } = uvRatio(Ns, D); // 5 - let s_ = mod(s * r0); // 6 - if (!(0, modular_ts_1.isNegativeLE)(s_, P)) - s_ = mod(-s_); - if (!Ns_D_is_sq) - s = s_; // 7 - if (!Ns_D_is_sq) - c = r; // 8 - const Nt = mod(c * (r - _1n) * D_MINUS_ONE_SQ - D); // 9 - const s2 = s * s; - const W0 = mod((s + s) * D); // 10 - const W1 = mod(Nt * SQRT_AD_MINUS_ONE); // 11 - const W2 = mod(_1n - s2); // 12 - const W3 = mod(_1n + s2); // 13 - return new exports.ed25519.Point(mod(W0 * W3), mod(W2 * W1), mod(W1 * W3), mod(W0 * W2)); -} -function ristretto255_map(bytes) { - (0, utils_js_1.abytes)(bytes, 64); - const r1 = bytes255ToNumberLE(bytes.subarray(0, 32)); - const R1 = calcElligatorRistrettoMap(r1); - const r2 = bytes255ToNumberLE(bytes.subarray(32, 64)); - const R2 = calcElligatorRistrettoMap(r2); - return new _RistrettoPoint(R1.add(R2)); -} -/** - * Wrapper over Edwards Point for ristretto255. - * - * Each ed25519/ExtendedPoint has 8 different equivalent points. This can be - * a source of bugs for protocols like ring signatures. Ristretto was created to solve this. - * Ristretto point operates in X:Y:Z:T extended coordinates like ExtendedPoint, - * but it should work in its own namespace: do not combine those two. - * See [RFC9496](https://www.rfc-editor.org/rfc/rfc9496). - */ -class _RistrettoPoint extends edwards_ts_1.PrimeEdwardsPoint { - constructor(ep) { - super(ep); - } - static fromAffine(ap) { - return new _RistrettoPoint(exports.ed25519.Point.fromAffine(ap)); - } - assertSame(other) { - if (!(other instanceof _RistrettoPoint)) - throw new Error('RistrettoPoint expected'); - } - init(ep) { - return new _RistrettoPoint(ep); - } - /** @deprecated use `import { ristretto255_hasher } from '@noble/curves/ed25519.js';` */ - static hashToCurve(hex) { - return ristretto255_map((0, utils_ts_1.ensureBytes)('ristrettoHash', hex, 64)); - } - static fromBytes(bytes) { - (0, utils_js_1.abytes)(bytes, 32); - const { a, d } = ed25519_CURVE; - const P = ed25519_CURVE_p; - const mod = (n) => Fp.create(n); - const s = bytes255ToNumberLE(bytes); - // 1. Check that s_bytes is the canonical encoding of a field element, or else abort. - // 3. Check that s is non-negative, or else abort - if (!(0, utils_ts_1.equalBytes)(Fp.toBytes(s), bytes) || (0, modular_ts_1.isNegativeLE)(s, P)) - throw new Error('invalid ristretto255 encoding 1'); - const s2 = mod(s * s); - const u1 = mod(_1n + a * s2); // 4 (a is -1) - const u2 = mod(_1n - a * s2); // 5 - const u1_2 = mod(u1 * u1); - const u2_2 = mod(u2 * u2); - const v = mod(a * d * u1_2 - u2_2); // 6 - const { isValid, value: I } = invertSqrt(mod(v * u2_2)); // 7 - const Dx = mod(I * u2); // 8 - const Dy = mod(I * Dx * v); // 9 - let x = mod((s + s) * Dx); // 10 - if ((0, modular_ts_1.isNegativeLE)(x, P)) - x = mod(-x); // 10 - const y = mod(u1 * Dy); // 11 - const t = mod(x * y); // 12 - if (!isValid || (0, modular_ts_1.isNegativeLE)(t, P) || y === _0n) - throw new Error('invalid ristretto255 encoding 2'); - return new _RistrettoPoint(new exports.ed25519.Point(x, y, _1n, t)); - } - /** - * Converts ristretto-encoded string to ristretto point. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-decode). - * @param hex Ristretto-encoded 32 bytes. Not every 32-byte string is valid ristretto encoding - */ - static fromHex(hex) { - return _RistrettoPoint.fromBytes((0, utils_ts_1.ensureBytes)('ristrettoHex', hex, 32)); - } - static msm(points, scalars) { - return (0, curve_ts_1.pippenger)(_RistrettoPoint, exports.ed25519.Point.Fn, points, scalars); - } - /** - * Encodes ristretto point to Uint8Array. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-encode). - */ - toBytes() { - let { X, Y, Z, T } = this.ep; - const P = ed25519_CURVE_p; - const mod = (n) => Fp.create(n); - const u1 = mod(mod(Z + Y) * mod(Z - Y)); // 1 - const u2 = mod(X * Y); // 2 - // Square root always exists - const u2sq = mod(u2 * u2); - const { value: invsqrt } = invertSqrt(mod(u1 * u2sq)); // 3 - const D1 = mod(invsqrt * u1); // 4 - const D2 = mod(invsqrt * u2); // 5 - const zInv = mod(D1 * D2 * T); // 6 - let D; // 7 - if ((0, modular_ts_1.isNegativeLE)(T * zInv, P)) { - let _x = mod(Y * SQRT_M1); - let _y = mod(X * SQRT_M1); - X = _x; - Y = _y; - D = mod(D1 * INVSQRT_A_MINUS_D); - } - else { - D = D2; // 8 - } - if ((0, modular_ts_1.isNegativeLE)(X * zInv, P)) - Y = mod(-Y); // 9 - let s = mod((Z - Y) * D); // 10 (check footer's note, no sqrt(-a)) - if ((0, modular_ts_1.isNegativeLE)(s, P)) - s = mod(-s); - return Fp.toBytes(s); // 11 - } - /** - * Compares two Ristretto points. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-equals). - */ - equals(other) { - this.assertSame(other); - const { X: X1, Y: Y1 } = this.ep; - const { X: X2, Y: Y2 } = other.ep; - const mod = (n) => Fp.create(n); - // (x1 * y2 == y1 * x2) | (y1 * y2 == x1 * x2) - const one = mod(X1 * Y2) === mod(Y1 * X2); - const two = mod(Y1 * Y2) === mod(X1 * X2); - return one || two; - } - is0() { - return this.equals(_RistrettoPoint.ZERO); - } -} -// Do NOT change syntax: the following gymnastics is done, -// because typescript strips comments, which makes bundlers disable tree-shaking. -// prettier-ignore -_RistrettoPoint.BASE = -/* @__PURE__ */ (() => new _RistrettoPoint(exports.ed25519.Point.BASE))(); -// prettier-ignore -_RistrettoPoint.ZERO = -/* @__PURE__ */ (() => new _RistrettoPoint(exports.ed25519.Point.ZERO))(); -// prettier-ignore -_RistrettoPoint.Fp = -/* @__PURE__ */ (() => Fp)(); -// prettier-ignore -_RistrettoPoint.Fn = -/* @__PURE__ */ (() => Fn)(); -exports.ristretto255 = { Point: _RistrettoPoint }; -/** Hashing to ristretto255 points / field. RFC 9380 methods. */ -exports.ristretto255_hasher = { - hashToCurve(msg, options) { - const DST = options?.DST || 'ristretto255_XMD:SHA-512_R255MAP_RO_'; - const xmd = (0, hash_to_curve_ts_1.expand_message_xmd)(msg, DST, 64, sha2_js_1.sha512); - return ristretto255_map(xmd); - }, - hashToScalar(msg, options = { DST: hash_to_curve_ts_1._DST_scalar }) { - const xmd = (0, hash_to_curve_ts_1.expand_message_xmd)(msg, options.DST, 64, sha2_js_1.sha512); - return Fn.create((0, utils_ts_1.bytesToNumberLE)(xmd)); - }, -}; -// export const ristretto255_oprf: OPRF = createORPF({ -// name: 'ristretto255-SHA512', -// Point: RistrettoPoint, -// hash: sha512, -// hashToGroup: ristretto255_hasher.hashToCurve, -// hashToScalar: ristretto255_hasher.hashToScalar, -// }); -/** - * Weird / bogus points, useful for debugging. - * All 8 ed25519 points of 8-torsion subgroup can be generated from the point - * T = `26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05`. - * ⟨T⟩ = { O, T, 2T, 3T, 4T, 5T, 6T, 7T } - */ -exports.ED25519_TORSION_SUBGROUP = [ - '0100000000000000000000000000000000000000000000000000000000000000', - 'c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a', - '0000000000000000000000000000000000000000000000000000000000000080', - '26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05', - 'ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f', - '26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85', - '0000000000000000000000000000000000000000000000000000000000000000', - 'c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa', -]; -/** @deprecated use `ed25519.utils.toMontgomery` */ -function edwardsToMontgomeryPub(edwardsPub) { - return exports.ed25519.utils.toMontgomery((0, utils_ts_1.ensureBytes)('pub', edwardsPub)); -} -/** @deprecated use `ed25519.utils.toMontgomery` */ -exports.edwardsToMontgomery = edwardsToMontgomeryPub; -/** @deprecated use `ed25519.utils.toMontgomerySecret` */ -function edwardsToMontgomeryPriv(edwardsPriv) { - return exports.ed25519.utils.toMontgomerySecret((0, utils_ts_1.ensureBytes)('pub', edwardsPriv)); -} -/** @deprecated use `ristretto255.Point` */ -exports.RistrettoPoint = _RistrettoPoint; -/** @deprecated use `import { ed25519_hasher } from '@noble/curves/ed25519.js';` */ -exports.hashToCurve = (() => exports.ed25519_hasher.hashToCurve)(); -/** @deprecated use `import { ed25519_hasher } from '@noble/curves/ed25519.js';` */ -exports.encodeToCurve = (() => exports.ed25519_hasher.encodeToCurve)(); -/** @deprecated use `import { ristretto255_hasher } from '@noble/curves/ed25519.js';` */ -exports.hashToRistretto255 = (() => exports.ristretto255_hasher.hashToCurve)(); -/** @deprecated use `import { ristretto255_hasher } from '@noble/curves/ed25519.js';` */ -exports.hash_to_ristretto255 = (() => exports.ristretto255_hasher.hashToCurve)(); -//# sourceMappingURL=ed25519.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/ed25519.js.map b/tools/mnemonic-test/node_modules/@noble/curves/ed25519.js.map deleted file mode 100644 index 6d3d604e..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/ed25519.js.map +++ /dev/null @@ -1 +0,0 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,GAA2B,eAAe,CAAC;AACtE,mFAAmF;AACtE,QAAA,WAAW,GAAsC,CAAC,GAAG,EAAE,CAAC,sBAAc,CAAC,WAAW,CAAC,EAAE,CAAC;AACnG,mFAAmF;AACtE,QAAA,aAAa,GAAsC,CAAC,GAAG,EAAE,CACpE,sBAAc,CAAC,aAAa,CAAC,EAAE,CAAC;AAElC,wFAAwF;AAC3E,QAAA,kBAAkB,GAA+B,CAAC,GAAG,EAAE,CAClE,2BAAmB,CAAC,WAAyB,CAAC,EAAE,CAAC;AACnD,wFAAwF;AAC3E,QAAA,oBAAoB,GAA+B,CAAC,GAAG,EAAE,CACpE,2BAAmB,CAAC,WAAyB,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/ed448.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/ed448.d.ts deleted file mode 100644 index 656e8d60..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/ed448.d.ts +++ /dev/null @@ -1,100 +0,0 @@ -import type { AffinePoint } from './abstract/curve.ts'; -import { PrimeEdwardsPoint, type CurveFn, type EdwardsPoint, type EdwardsPointCons } from './abstract/edwards.ts'; -import { type H2CHasher, type H2CHasherBase, type H2CMethod, type htfBasicOpts } from './abstract/hash-to-curve.ts'; -import { type IField } from './abstract/modular.ts'; -import { type MontgomeryECDH as XCurveFn } from './abstract/montgomery.ts'; -import { type Hex } from './utils.ts'; -/** - * ed448 EdDSA curve and methods. - * @example - * import { ed448 } from '@noble/curves/ed448'; - * const { secretKey, publicKey } = ed448.keygen(); - * const msg = new TextEncoder().encode('hello'); - * const sig = ed448.sign(msg, secretKey); - * const isValid = ed448.verify(sig, msg, publicKey); - */ -export declare const ed448: CurveFn; -/** Prehashed version of ed448. Accepts already-hashed messages in sign() and verify(). */ -export declare const ed448ph: CurveFn; -/** - * E448 curve, defined by NIST. - * E448 != edwards448 used in ed448. - * E448 is birationally equivalent to edwards448. - */ -export declare const E448: EdwardsPointCons; -/** - * ECDH using curve448 aka x448. - * x448 has 56-byte keys as per RFC 7748, while - * ed448 has 57-byte keys as per RFC 8032. - */ -export declare const x448: XCurveFn; -/** Hashing / encoding to ed448 points / field. RFC 9380 methods. */ -export declare const ed448_hasher: H2CHasher; -/** - * Each ed448/EdwardsPoint has 4 different equivalent points. This can be - * a source of bugs for protocols like ring signatures. Decaf was created to solve this. - * Decaf point operates in X:Y:Z:T extended coordinates like EdwardsPoint, - * but it should work in its own namespace: do not combine those two. - * See [RFC9496](https://www.rfc-editor.org/rfc/rfc9496). - */ -declare class _DecafPoint extends PrimeEdwardsPoint<_DecafPoint> { - static BASE: _DecafPoint; - static ZERO: _DecafPoint; - static Fp: IField; - static Fn: IField; - constructor(ep: EdwardsPoint); - static fromAffine(ap: AffinePoint): _DecafPoint; - protected assertSame(other: _DecafPoint): void; - protected init(ep: EdwardsPoint): _DecafPoint; - /** @deprecated use `import { decaf448_hasher } from '@noble/curves/ed448.js';` */ - static hashToCurve(hex: Hex): _DecafPoint; - static fromBytes(bytes: Uint8Array): _DecafPoint; - /** - * Converts decaf-encoded string to decaf point. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-decode-2). - * @param hex Decaf-encoded 56 bytes. Not every 56-byte string is valid decaf encoding - */ - static fromHex(hex: Hex): _DecafPoint; - /** @deprecated use `import { pippenger } from '@noble/curves/abstract/curve.js';` */ - static msm(points: _DecafPoint[], scalars: bigint[]): _DecafPoint; - /** - * Encodes decaf point to Uint8Array. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-encode-2). - */ - toBytes(): Uint8Array; - /** - * Compare one point to another. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-equals-2). - */ - equals(other: _DecafPoint): boolean; - is0(): boolean; -} -export declare const decaf448: { - Point: typeof _DecafPoint; -}; -/** Hashing to decaf448 points / field. RFC 9380 methods. */ -export declare const decaf448_hasher: H2CHasherBase; -/** - * Weird / bogus points, useful for debugging. - * Unlike ed25519, there is no ed448 generator point which can produce full T subgroup. - * Instead, there is a Klein four-group, which spans over 2 independent 2-torsion points: - * (0, 1), (0, -1), (-1, 0), (1, 0). - */ -export declare const ED448_TORSION_SUBGROUP: string[]; -type DcfHasher = (msg: Uint8Array, options: htfBasicOpts) => _DecafPoint; -/** @deprecated use `decaf448.Point` */ -export declare const DecafPoint: typeof _DecafPoint; -/** @deprecated use `import { ed448_hasher } from '@noble/curves/ed448.js';` */ -export declare const hashToCurve: H2CMethod; -/** @deprecated use `import { ed448_hasher } from '@noble/curves/ed448.js';` */ -export declare const encodeToCurve: H2CMethod; -/** @deprecated use `import { decaf448_hasher } from '@noble/curves/ed448.js';` */ -export declare const hashToDecaf448: DcfHasher; -/** @deprecated use `import { decaf448_hasher } from '@noble/curves/ed448.js';` */ -export declare const hash_to_decaf448: DcfHasher; -/** @deprecated use `ed448.utils.toMontgomery` */ -export declare function edwardsToMontgomeryPub(edwardsPub: string | Uint8Array): Uint8Array; -/** @deprecated use `ed448.utils.toMontgomery` */ -export declare const edwardsToMontgomery: typeof edwardsToMontgomeryPub; -export {}; -//# sourceMappingURL=ed448.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/ed448.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/ed448.d.ts.map deleted file mode 100644 index 087cfa7e..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/ed448.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed448.d.ts","sourceRoot":"","sources":["src/ed448.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAEL,iBAAiB,EAEjB,KAAK,OAAO,EAEZ,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,YAAY,EAClB,MAAM,6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rC,qFAAqF;IACrF,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,WAAW;IAIjE;;;OAGG;IACH,OAAO,IAAI,UAAU;IAerB;;;OAGG;IACH,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO;IAQnC,GAAG,IAAI,OAAO;CAGf;AAED,eAAO,MAAM,QAAQ,EAAE;IACrB,KAAK,EAAE,OAAO,WAAW,CAAC;CACF,CAAC;AAE3B,4DAA4D;AAC5D,eAAO,MAAM,eAAe,EAAE,aAAa,CAAC,MAAM,CAajD,CAAC;AAUF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,EAK1C,CAAC;AAEF,KAAK,SAAS,GAAG,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,KAAK,WAAW,CAAC;AAEzE,uCAAuC;AACvC,eAAO,MAAM,UAAU,EAAE,OAAO,WAAyB,CAAC;AAC1D,+EAA+E;AAC/E,eAAO,MAAM,WAAW,EAAE,SAAS,CAAC,MAAM,CAAsD,CAAC;AACjG,+EAA+E;AAC/E,eAAO,MAAM,aAAa,EAAE,SAAS,CAAC,MAAM,CACb,CAAC;AAChC,kFAAkF;AAClF,eAAO,MAAM,cAAc,EAAE,SACgB,CAAC;AAC9C,kFAAkF;AAClF,eAAO,MAAM,gBAAgB,EAAE,SACc,CAAC;AAC9C,iDAAiD;AACjD,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,CAElF;AACD,iDAAiD;AACjD,eAAO,MAAM,mBAAmB,EAAE,OAAO,sBAA+C,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/ed448.js b/tools/mnemonic-test/node_modules/@noble/curves/ed448.js deleted file mode 100644 index 0137a717..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/ed448.js +++ /dev/null @@ -1,463 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.edwardsToMontgomery = exports.hash_to_decaf448 = exports.hashToDecaf448 = exports.encodeToCurve = exports.hashToCurve = exports.DecafPoint = exports.ED448_TORSION_SUBGROUP = exports.decaf448_hasher = exports.decaf448 = exports.ed448_hasher = exports.x448 = exports.E448 = exports.ed448ph = exports.ed448 = void 0; -exports.edwardsToMontgomeryPub = edwardsToMontgomeryPub; -/** - * Edwards448 (not Ed448-Goldilocks) curve with following addons: - * - X448 ECDH - * - Decaf cofactor elimination - * - Elligator hash-to-group / point indistinguishability - * Conforms to RFC 8032 https://www.rfc-editor.org/rfc/rfc8032.html#section-5.2 - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const sha3_js_1 = require("@noble/hashes/sha3.js"); -const utils_js_1 = require("@noble/hashes/utils.js"); -const curve_ts_1 = require("./abstract/curve.js"); -const edwards_ts_1 = require("./abstract/edwards.js"); -const hash_to_curve_ts_1 = require("./abstract/hash-to-curve.js"); -const modular_ts_1 = require("./abstract/modular.js"); -const montgomery_ts_1 = require("./abstract/montgomery.js"); -const utils_ts_1 = require("./utils.js"); -// edwards448 curve -// a = 1n -// d = Fp.neg(39081n) -// Finite field 2n**448n - 2n**224n - 1n -// Subgroup order -// 2n**446n - 13818066809895115352007386748515426880336692474882178609894547503885n -const ed448_CURVE = { - p: BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffff'), - n: BigInt('0x3fffffffffffffffffffffffffffffffffffffffffffffffffffffff7cca23e9c44edb49aed63690216cc2728dc58f552378c292ab5844f3'), - h: BigInt(4), - a: BigInt(1), - d: BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffffffffffffffffffffffffffffffffffffffffffffffff6756'), - Gx: BigInt('0x4f1970c66bed0ded221d15a622bf36da9e146570470f1767ea6de324a3d3a46412ae1af72ab66511433b80e18b00938e2626a82bc70cc05e'), - Gy: BigInt('0x693f46716eb6bc248876203756c9c7624bea73736ca3984087789c1e05a0c2d73ad3ff1ce67c39c4fdbd132c4ed7c8ad9808795bf230fa14'), -}; -// E448 NIST curve is identical to edwards448, except for: -// d = 39082/39081 -// Gx = 3/2 -const E448_CURVE = Object.assign({}, ed448_CURVE, { - d: BigInt('0xd78b4bdc7f0daf19f24f38c29373a2ccad46157242a50f37809b1da3412a12e79ccc9c81264cfe9ad080997058fb61c4243cc32dbaa156b9'), - Gx: BigInt('0x79a70b2b70400553ae7c9df416c792c61128751ac92969240c25a07d728bdc93e21f7787ed6972249de732f38496cd11698713093e9c04fc'), - Gy: BigInt('0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffff80000000000000000000000000000000000000000000000000000001'), -}); -const shake256_114 = /* @__PURE__ */ (0, utils_js_1.createHasher)(() => sha3_js_1.shake256.create({ dkLen: 114 })); -const shake256_64 = /* @__PURE__ */ (0, utils_js_1.createHasher)(() => sha3_js_1.shake256.create({ dkLen: 64 })); -// prettier-ignore -const _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = BigInt(4), _11n = BigInt(11); -// prettier-ignore -const _22n = BigInt(22), _44n = BigInt(44), _88n = BigInt(88), _223n = BigInt(223); -// powPminus3div4 calculates z = x^k mod p, where k = (p-3)/4. -// Used for efficient square root calculation. -// ((P-3)/4).toString(2) would produce bits [223x 1, 0, 222x 1] -function ed448_pow_Pminus3div4(x) { - const P = ed448_CURVE.p; - const b2 = (x * x * x) % P; - const b3 = (b2 * b2 * x) % P; - const b6 = ((0, modular_ts_1.pow2)(b3, _3n, P) * b3) % P; - const b9 = ((0, modular_ts_1.pow2)(b6, _3n, P) * b3) % P; - const b11 = ((0, modular_ts_1.pow2)(b9, _2n, P) * b2) % P; - const b22 = ((0, modular_ts_1.pow2)(b11, _11n, P) * b11) % P; - const b44 = ((0, modular_ts_1.pow2)(b22, _22n, P) * b22) % P; - const b88 = ((0, modular_ts_1.pow2)(b44, _44n, P) * b44) % P; - const b176 = ((0, modular_ts_1.pow2)(b88, _88n, P) * b88) % P; - const b220 = ((0, modular_ts_1.pow2)(b176, _44n, P) * b44) % P; - const b222 = ((0, modular_ts_1.pow2)(b220, _2n, P) * b2) % P; - const b223 = ((0, modular_ts_1.pow2)(b222, _1n, P) * x) % P; - return ((0, modular_ts_1.pow2)(b223, _223n, P) * b222) % P; -} -function adjustScalarBytes(bytes) { - // Section 5: Likewise, for X448, set the two least significant bits of the first byte to 0, - bytes[0] &= 252; // 0b11111100 - // and the most significant bit of the last byte to 1. - bytes[55] |= 128; // 0b10000000 - // NOTE: is NOOP for 56 bytes scalars (X25519/X448) - bytes[56] = 0; // Byte outside of group (456 buts vs 448 bits) - return bytes; -} -// Constant-time ratio of u to v. Allows to combine inversion and square root u/√v. -// Uses algo from RFC8032 5.1.3. -function uvRatio(u, v) { - const P = ed448_CURVE.p; - // https://www.rfc-editor.org/rfc/rfc8032#section-5.2.3 - // To compute the square root of (u/v), the first step is to compute the - // candidate root x = (u/v)^((p+1)/4). This can be done using the - // following trick, to use a single modular powering for both the - // inversion of v and the square root: - // x = (u/v)^((p+1)/4) = u³v(u⁵v³)^((p-3)/4) (mod p) - const u2v = (0, modular_ts_1.mod)(u * u * v, P); // u²v - const u3v = (0, modular_ts_1.mod)(u2v * u, P); // u³v - const u5v3 = (0, modular_ts_1.mod)(u3v * u2v * v, P); // u⁵v³ - const root = ed448_pow_Pminus3div4(u5v3); - const x = (0, modular_ts_1.mod)(u3v * root, P); - // Verify that root is exists - const x2 = (0, modular_ts_1.mod)(x * x, P); // x² - // If vx² = u, the recovered x-coordinate is x. Otherwise, no - // square root exists, and the decoding fails. - return { isValid: (0, modular_ts_1.mod)(x2 * v, P) === u, value: x }; -} -// Finite field 2n**448n - 2n**224n - 1n -// The value fits in 448 bits, but we use 456-bit (57-byte) elements because of bitflags. -// - ed25519 fits in 255 bits, allowing using last 1 byte for specifying bit flag of point negation. -// - ed448 fits in 448 bits. We can't use last 1 byte: we can only use a bit 224 in the middle. -const Fp = /* @__PURE__ */ (() => (0, modular_ts_1.Field)(ed448_CURVE.p, { BITS: 456, isLE: true }))(); -const Fn = /* @__PURE__ */ (() => (0, modular_ts_1.Field)(ed448_CURVE.n, { BITS: 456, isLE: true }))(); -// decaf448 uses 448-bit (56-byte) keys -const Fp448 = /* @__PURE__ */ (() => (0, modular_ts_1.Field)(ed448_CURVE.p, { BITS: 448, isLE: true }))(); -const Fn448 = /* @__PURE__ */ (() => (0, modular_ts_1.Field)(ed448_CURVE.n, { BITS: 448, isLE: true }))(); -// SHAKE256(dom4(phflag,context)||x, 114) -function dom4(data, ctx, phflag) { - if (ctx.length > 255) - throw new Error('context must be smaller than 255, got: ' + ctx.length); - return (0, utils_js_1.concatBytes)((0, utils_ts_1.asciiToBytes)('SigEd448'), new Uint8Array([phflag ? 1 : 0, ctx.length]), ctx, data); -} -// const ed448_eddsa_opts = { adjustScalarBytes, domain: dom4 }; -// const ed448_Point = edwards(ed448_CURVE, { Fp, Fn, uvRatio }); -const ED448_DEF = /* @__PURE__ */ (() => ({ - ...ed448_CURVE, - Fp, - Fn, - nBitLength: Fn.BITS, - hash: shake256_114, - adjustScalarBytes, - domain: dom4, - uvRatio, -}))(); -/** - * ed448 EdDSA curve and methods. - * @example - * import { ed448 } from '@noble/curves/ed448'; - * const { secretKey, publicKey } = ed448.keygen(); - * const msg = new TextEncoder().encode('hello'); - * const sig = ed448.sign(msg, secretKey); - * const isValid = ed448.verify(sig, msg, publicKey); - */ -exports.ed448 = (0, edwards_ts_1.twistedEdwards)(ED448_DEF); -// There is no ed448ctx, since ed448 supports ctx by default -/** Prehashed version of ed448. Accepts already-hashed messages in sign() and verify(). */ -exports.ed448ph = (() => (0, edwards_ts_1.twistedEdwards)({ - ...ED448_DEF, - prehash: shake256_64, -}))(); -/** - * E448 curve, defined by NIST. - * E448 != edwards448 used in ed448. - * E448 is birationally equivalent to edwards448. - */ -exports.E448 = (0, edwards_ts_1.edwards)(E448_CURVE); -/** - * ECDH using curve448 aka x448. - * x448 has 56-byte keys as per RFC 7748, while - * ed448 has 57-byte keys as per RFC 8032. - */ -exports.x448 = (() => { - const P = ed448_CURVE.p; - return (0, montgomery_ts_1.montgomery)({ - P, - type: 'x448', - powPminus2: (x) => { - const Pminus3div4 = ed448_pow_Pminus3div4(x); - const Pminus3 = (0, modular_ts_1.pow2)(Pminus3div4, _2n, P); - return (0, modular_ts_1.mod)(Pminus3 * x, P); // Pminus3 * x = Pminus2 - }, - adjustScalarBytes, - }); -})(); -// Hash To Curve Elligator2 Map -const ELL2_C1 = /* @__PURE__ */ (() => (Fp.ORDER - BigInt(3)) / BigInt(4))(); // 1. c1 = (q - 3) / 4 # Integer arithmetic -const ELL2_J = /* @__PURE__ */ BigInt(156326); -function map_to_curve_elligator2_curve448(u) { - let tv1 = Fp.sqr(u); // 1. tv1 = u^2 - let e1 = Fp.eql(tv1, Fp.ONE); // 2. e1 = tv1 == 1 - tv1 = Fp.cmov(tv1, Fp.ZERO, e1); // 3. tv1 = CMOV(tv1, 0, e1) # If Z * u^2 == -1, set tv1 = 0 - let xd = Fp.sub(Fp.ONE, tv1); // 4. xd = 1 - tv1 - let x1n = Fp.neg(ELL2_J); // 5. x1n = -J - let tv2 = Fp.sqr(xd); // 6. tv2 = xd^2 - let gxd = Fp.mul(tv2, xd); // 7. gxd = tv2 * xd # gxd = xd^3 - let gx1 = Fp.mul(tv1, Fp.neg(ELL2_J)); // 8. gx1 = -J * tv1 # x1n + J * xd - gx1 = Fp.mul(gx1, x1n); // 9. gx1 = gx1 * x1n # x1n^2 + J * x1n * xd - gx1 = Fp.add(gx1, tv2); // 10. gx1 = gx1 + tv2 # x1n^2 + J * x1n * xd + xd^2 - gx1 = Fp.mul(gx1, x1n); // 11. gx1 = gx1 * x1n # x1n^3 + J * x1n^2 * xd + x1n * xd^2 - let tv3 = Fp.sqr(gxd); // 12. tv3 = gxd^2 - tv2 = Fp.mul(gx1, gxd); // 13. tv2 = gx1 * gxd # gx1 * gxd - tv3 = Fp.mul(tv3, tv2); // 14. tv3 = tv3 * tv2 # gx1 * gxd^3 - let y1 = Fp.pow(tv3, ELL2_C1); // 15. y1 = tv3^c1 # (gx1 * gxd^3)^((p - 3) / 4) - y1 = Fp.mul(y1, tv2); // 16. y1 = y1 * tv2 # gx1 * gxd * (gx1 * gxd^3)^((p - 3) / 4) - let x2n = Fp.mul(x1n, Fp.neg(tv1)); // 17. x2n = -tv1 * x1n # x2 = x2n / xd = -1 * u^2 * x1n / xd - let y2 = Fp.mul(y1, u); // 18. y2 = y1 * u - y2 = Fp.cmov(y2, Fp.ZERO, e1); // 19. y2 = CMOV(y2, 0, e1) - tv2 = Fp.sqr(y1); // 20. tv2 = y1^2 - tv2 = Fp.mul(tv2, gxd); // 21. tv2 = tv2 * gxd - let e2 = Fp.eql(tv2, gx1); // 22. e2 = tv2 == gx1 - let xn = Fp.cmov(x2n, x1n, e2); // 23. xn = CMOV(x2n, x1n, e2) # If e2, x = x1, else x = x2 - let y = Fp.cmov(y2, y1, e2); // 24. y = CMOV(y2, y1, e2) # If e2, y = y1, else y = y2 - let e3 = Fp.isOdd(y); // 25. e3 = sgn0(y) == 1 # Fix sign of y - y = Fp.cmov(y, Fp.neg(y), e2 !== e3); // 26. y = CMOV(y, -y, e2 XOR e3) - return { xn, xd, yn: y, yd: Fp.ONE }; // 27. return (xn, xd, y, 1) -} -function map_to_curve_elligator2_edwards448(u) { - let { xn, xd, yn, yd } = map_to_curve_elligator2_curve448(u); // 1. (xn, xd, yn, yd) = map_to_curve_elligator2_curve448(u) - let xn2 = Fp.sqr(xn); // 2. xn2 = xn^2 - let xd2 = Fp.sqr(xd); // 3. xd2 = xd^2 - let xd4 = Fp.sqr(xd2); // 4. xd4 = xd2^2 - let yn2 = Fp.sqr(yn); // 5. yn2 = yn^2 - let yd2 = Fp.sqr(yd); // 6. yd2 = yd^2 - let xEn = Fp.sub(xn2, xd2); // 7. xEn = xn2 - xd2 - let tv2 = Fp.sub(xEn, xd2); // 8. tv2 = xEn - xd2 - xEn = Fp.mul(xEn, xd2); // 9. xEn = xEn * xd2 - xEn = Fp.mul(xEn, yd); // 10. xEn = xEn * yd - xEn = Fp.mul(xEn, yn); // 11. xEn = xEn * yn - xEn = Fp.mul(xEn, _4n); // 12. xEn = xEn * 4 - tv2 = Fp.mul(tv2, xn2); // 13. tv2 = tv2 * xn2 - tv2 = Fp.mul(tv2, yd2); // 14. tv2 = tv2 * yd2 - let tv3 = Fp.mul(yn2, _4n); // 15. tv3 = 4 * yn2 - let tv1 = Fp.add(tv3, yd2); // 16. tv1 = tv3 + yd2 - tv1 = Fp.mul(tv1, xd4); // 17. tv1 = tv1 * xd4 - let xEd = Fp.add(tv1, tv2); // 18. xEd = tv1 + tv2 - tv2 = Fp.mul(tv2, xn); // 19. tv2 = tv2 * xn - let tv4 = Fp.mul(xn, xd4); // 20. tv4 = xn * xd4 - let yEn = Fp.sub(tv3, yd2); // 21. yEn = tv3 - yd2 - yEn = Fp.mul(yEn, tv4); // 22. yEn = yEn * tv4 - yEn = Fp.sub(yEn, tv2); // 23. yEn = yEn - tv2 - tv1 = Fp.add(xn2, xd2); // 24. tv1 = xn2 + xd2 - tv1 = Fp.mul(tv1, xd2); // 25. tv1 = tv1 * xd2 - tv1 = Fp.mul(tv1, xd); // 26. tv1 = tv1 * xd - tv1 = Fp.mul(tv1, yn2); // 27. tv1 = tv1 * yn2 - tv1 = Fp.mul(tv1, BigInt(-2)); // 28. tv1 = -2 * tv1 - let yEd = Fp.add(tv2, tv1); // 29. yEd = tv2 + tv1 - tv4 = Fp.mul(tv4, yd2); // 30. tv4 = tv4 * yd2 - yEd = Fp.add(yEd, tv4); // 31. yEd = yEd + tv4 - tv1 = Fp.mul(xEd, yEd); // 32. tv1 = xEd * yEd - let e = Fp.eql(tv1, Fp.ZERO); // 33. e = tv1 == 0 - xEn = Fp.cmov(xEn, Fp.ZERO, e); // 34. xEn = CMOV(xEn, 0, e) - xEd = Fp.cmov(xEd, Fp.ONE, e); // 35. xEd = CMOV(xEd, 1, e) - yEn = Fp.cmov(yEn, Fp.ONE, e); // 36. yEn = CMOV(yEn, 1, e) - yEd = Fp.cmov(yEd, Fp.ONE, e); // 37. yEd = CMOV(yEd, 1, e) - const inv = (0, modular_ts_1.FpInvertBatch)(Fp, [xEd, yEd], true); // batch division - return { x: Fp.mul(xEn, inv[0]), y: Fp.mul(yEn, inv[1]) }; // 38. return (xEn, xEd, yEn, yEd) -} -/** Hashing / encoding to ed448 points / field. RFC 9380 methods. */ -exports.ed448_hasher = (() => (0, hash_to_curve_ts_1.createHasher)(exports.ed448.Point, (scalars) => map_to_curve_elligator2_edwards448(scalars[0]), { - DST: 'edwards448_XOF:SHAKE256_ELL2_RO_', - encodeDST: 'edwards448_XOF:SHAKE256_ELL2_NU_', - p: Fp.ORDER, - m: 1, - k: 224, - expand: 'xof', - hash: sha3_js_1.shake256, -}))(); -// 1-d -const ONE_MINUS_D = /* @__PURE__ */ BigInt('39082'); -// 1-2d -const ONE_MINUS_TWO_D = /* @__PURE__ */ BigInt('78163'); -// √(-d) -const SQRT_MINUS_D = /* @__PURE__ */ BigInt('98944233647732219769177004876929019128417576295529901074099889598043702116001257856802131563896515373927712232092845883226922417596214'); -// 1 / √(-d) -const INVSQRT_MINUS_D = /* @__PURE__ */ BigInt('315019913931389607337177038330951043522456072897266928557328499619017160722351061360252776265186336876723201881398623946864393857820716'); -// Calculates 1/√(number) -const invertSqrt = (number) => uvRatio(_1n, number); -/** - * Elligator map for hash-to-curve of decaf448. - * Described in [RFC9380](https://www.rfc-editor.org/rfc/rfc9380#appendix-C) - * and [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-element-derivation-2). - */ -function calcElligatorDecafMap(r0) { - const { d } = ed448_CURVE; - const P = Fp.ORDER; - const mod = (n) => Fp.create(n); - const r = mod(-(r0 * r0)); // 1 - const u0 = mod(d * (r - _1n)); // 2 - const u1 = mod((u0 + _1n) * (u0 - r)); // 3 - const { isValid: was_square, value: v } = uvRatio(ONE_MINUS_TWO_D, mod((r + _1n) * u1)); // 4 - let v_prime = v; // 5 - if (!was_square) - v_prime = mod(r0 * v); - let sgn = _1n; // 6 - if (!was_square) - sgn = mod(-_1n); - const s = mod(v_prime * (r + _1n)); // 7 - let s_abs = s; - if ((0, modular_ts_1.isNegativeLE)(s, P)) - s_abs = mod(-s); - const s2 = s * s; - const W0 = mod(s_abs * _2n); // 8 - const W1 = mod(s2 + _1n); // 9 - const W2 = mod(s2 - _1n); // 10 - const W3 = mod(v_prime * s * (r - _1n) * ONE_MINUS_TWO_D + sgn); // 11 - return new exports.ed448.Point(mod(W0 * W3), mod(W2 * W1), mod(W1 * W3), mod(W0 * W2)); -} -function decaf448_map(bytes) { - (0, utils_js_1.abytes)(bytes, 112); - const skipValidation = true; - // Note: Similar to the field element decoding described in - // [RFC7748], and unlike the field element decoding described in - // Section 5.3.1, non-canonical values are accepted. - const r1 = Fp448.create(Fp448.fromBytes(bytes.subarray(0, 56), skipValidation)); - const R1 = calcElligatorDecafMap(r1); - const r2 = Fp448.create(Fp448.fromBytes(bytes.subarray(56, 112), skipValidation)); - const R2 = calcElligatorDecafMap(r2); - return new _DecafPoint(R1.add(R2)); -} -/** - * Each ed448/EdwardsPoint has 4 different equivalent points. This can be - * a source of bugs for protocols like ring signatures. Decaf was created to solve this. - * Decaf point operates in X:Y:Z:T extended coordinates like EdwardsPoint, - * but it should work in its own namespace: do not combine those two. - * See [RFC9496](https://www.rfc-editor.org/rfc/rfc9496). - */ -class _DecafPoint extends edwards_ts_1.PrimeEdwardsPoint { - constructor(ep) { - super(ep); - } - static fromAffine(ap) { - return new _DecafPoint(exports.ed448.Point.fromAffine(ap)); - } - assertSame(other) { - if (!(other instanceof _DecafPoint)) - throw new Error('DecafPoint expected'); - } - init(ep) { - return new _DecafPoint(ep); - } - /** @deprecated use `import { decaf448_hasher } from '@noble/curves/ed448.js';` */ - static hashToCurve(hex) { - return decaf448_map((0, utils_ts_1.ensureBytes)('decafHash', hex, 112)); - } - static fromBytes(bytes) { - (0, utils_js_1.abytes)(bytes, 56); - const { d } = ed448_CURVE; - const P = Fp.ORDER; - const mod = (n) => Fp448.create(n); - const s = Fp448.fromBytes(bytes); - // 1. Check that s_bytes is the canonical encoding of a field element, or else abort. - // 2. Check that s is non-negative, or else abort - if (!(0, utils_ts_1.equalBytes)(Fn448.toBytes(s), bytes) || (0, modular_ts_1.isNegativeLE)(s, P)) - throw new Error('invalid decaf448 encoding 1'); - const s2 = mod(s * s); // 1 - const u1 = mod(_1n + s2); // 2 - const u1sq = mod(u1 * u1); - const u2 = mod(u1sq - _4n * d * s2); // 3 - const { isValid, value: invsqrt } = invertSqrt(mod(u2 * u1sq)); // 4 - let u3 = mod((s + s) * invsqrt * u1 * SQRT_MINUS_D); // 5 - if ((0, modular_ts_1.isNegativeLE)(u3, P)) - u3 = mod(-u3); - const x = mod(u3 * invsqrt * u2 * INVSQRT_MINUS_D); // 6 - const y = mod((_1n - s2) * invsqrt * u1); // 7 - const t = mod(x * y); // 8 - if (!isValid) - throw new Error('invalid decaf448 encoding 2'); - return new _DecafPoint(new exports.ed448.Point(x, y, _1n, t)); - } - /** - * Converts decaf-encoded string to decaf point. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-decode-2). - * @param hex Decaf-encoded 56 bytes. Not every 56-byte string is valid decaf encoding - */ - static fromHex(hex) { - return _DecafPoint.fromBytes((0, utils_ts_1.ensureBytes)('decafHex', hex, 56)); - } - /** @deprecated use `import { pippenger } from '@noble/curves/abstract/curve.js';` */ - static msm(points, scalars) { - return (0, curve_ts_1.pippenger)(_DecafPoint, Fn, points, scalars); - } - /** - * Encodes decaf point to Uint8Array. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-encode-2). - */ - toBytes() { - const { X, Z, T } = this.ep; - const P = Fp.ORDER; - const mod = (n) => Fp.create(n); - const u1 = mod(mod(X + T) * mod(X - T)); // 1 - const x2 = mod(X * X); - const { value: invsqrt } = invertSqrt(mod(u1 * ONE_MINUS_D * x2)); // 2 - let ratio = mod(invsqrt * u1 * SQRT_MINUS_D); // 3 - if ((0, modular_ts_1.isNegativeLE)(ratio, P)) - ratio = mod(-ratio); - const u2 = mod(INVSQRT_MINUS_D * ratio * Z - T); // 4 - let s = mod(ONE_MINUS_D * invsqrt * X * u2); // 5 - if ((0, modular_ts_1.isNegativeLE)(s, P)) - s = mod(-s); - return Fn448.toBytes(s); - } - /** - * Compare one point to another. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-equals-2). - */ - equals(other) { - this.assertSame(other); - const { X: X1, Y: Y1 } = this.ep; - const { X: X2, Y: Y2 } = other.ep; - // (x1 * y2 == y1 * x2) - return Fp.create(X1 * Y2) === Fp.create(Y1 * X2); - } - is0() { - return this.equals(_DecafPoint.ZERO); - } -} -// The following gymnastics is done because typescript strips comments otherwise -// prettier-ignore -_DecafPoint.BASE = -/* @__PURE__ */ (() => new _DecafPoint(exports.ed448.Point.BASE).multiplyUnsafe(_2n))(); -// prettier-ignore -_DecafPoint.ZERO = -/* @__PURE__ */ (() => new _DecafPoint(exports.ed448.Point.ZERO))(); -// prettier-ignore -_DecafPoint.Fp = -/* @__PURE__ */ (() => Fp448)(); -// prettier-ignore -_DecafPoint.Fn = -/* @__PURE__ */ (() => Fn448)(); -exports.decaf448 = { Point: _DecafPoint }; -/** Hashing to decaf448 points / field. RFC 9380 methods. */ -exports.decaf448_hasher = { - hashToCurve(msg, options) { - const DST = options?.DST || 'decaf448_XOF:SHAKE256_D448MAP_RO_'; - return decaf448_map((0, hash_to_curve_ts_1.expand_message_xof)(msg, DST, 112, 224, sha3_js_1.shake256)); - }, - // Warning: has big modulo bias of 2^-64. - // RFC is invalid. RFC says "use 64-byte xof", while for 2^-112 bias - // it must use 84-byte xof (56+56/2), not 64. - hashToScalar(msg, options = { DST: hash_to_curve_ts_1._DST_scalar }) { - // Can't use `Fn448.fromBytes()`. 64-byte input => 56-byte field element - const xof = (0, hash_to_curve_ts_1.expand_message_xof)(msg, options.DST, 64, 256, sha3_js_1.shake256); - return Fn448.create((0, utils_ts_1.bytesToNumberLE)(xof)); - }, -}; -// export const decaf448_oprf: OPRF = createORPF({ -// name: 'decaf448-SHAKE256', -// Point: DecafPoint, -// hash: (msg: Uint8Array) => shake256(msg, { dkLen: 64 }), -// hashToGroup: decaf448_hasher.hashToCurve, -// hashToScalar: decaf448_hasher.hashToScalar, -// }); -/** - * Weird / bogus points, useful for debugging. - * Unlike ed25519, there is no ed448 generator point which can produce full T subgroup. - * Instead, there is a Klein four-group, which spans over 2 independent 2-torsion points: - * (0, 1), (0, -1), (-1, 0), (1, 0). - */ -exports.ED448_TORSION_SUBGROUP = [ - '010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', - 'fefffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffff00', - '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', - '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080', -]; -/** @deprecated use `decaf448.Point` */ -exports.DecafPoint = _DecafPoint; -/** @deprecated use `import { ed448_hasher } from '@noble/curves/ed448.js';` */ -exports.hashToCurve = (() => exports.ed448_hasher.hashToCurve)(); -/** @deprecated use `import { ed448_hasher } from '@noble/curves/ed448.js';` */ -exports.encodeToCurve = (() => exports.ed448_hasher.encodeToCurve)(); -/** @deprecated use `import { decaf448_hasher } from '@noble/curves/ed448.js';` */ -exports.hashToDecaf448 = (() => exports.decaf448_hasher.hashToCurve)(); -/** @deprecated use `import { decaf448_hasher } from '@noble/curves/ed448.js';` */ -exports.hash_to_decaf448 = (() => exports.decaf448_hasher.hashToCurve)(); -/** @deprecated use `ed448.utils.toMontgomery` */ -function edwardsToMontgomeryPub(edwardsPub) { - return exports.ed448.utils.toMontgomery((0, utils_ts_1.ensureBytes)('pub', edwardsPub)); -} -/** @deprecated use `ed448.utils.toMontgomery` */ -exports.edwardsToMontgomery = edwardsToMontgomeryPub; -//# sourceMappingURL=ed448.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/ed448.js.map b/tools/mnemonic-test/node_modules/@noble/curves/ed448.js.map deleted file mode 100644 index d9f8dc4c..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/ed448.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed448.js","sourceRoot":"","sources":["src/ed448.ts"],"names":[],"mappings":";;;AAmiBA,wDAEC;AAriBD;;;;;;;GAOG;AACH,sEAAsE;AACtE,mDAAiD;AACjD,qDAA8F;AAE9F,kDAAgD;AAChD,sDAQ+B;AAC/B,kEAQqC;AACrC,sDAAmG;AACnG,4DAAuF;AACvF,yCAA8F;AAE9F,mBAAmB;AACnB,SAAS;AACT,qBAAqB;AACrB,wCAAwC;AACxC,iBAAiB;AACjB,mFAAmF;AACnF,MAAM,WAAW,GAAgB;IAC/B,CAAC,EAAE,MAAM,CACP,oHAAoH,CACrH;IACD,CAAC,EAAE,MAAM,CACP,oHAAoH,CACrH;IACD,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,CAAC,EAAE,MAAM,CACP,oHAAoH,CACrH;IACD,EAAE,EAAE,MAAM,CACR,oHAAoH,CACrH;IACD,EAAE,EAAE,MAAM,CACR,oHAAoH,CACrH;CACF,CAAC;AAEF,0DAA0D;AAC1D,kBAAkB;AAClB,WAAW;AACX,MAAM,UAAU,GAAgB,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,WAAW,EAAE;IAC7D,CAAC,EAAE,MAAM,CACP,oHAAoH,CACrH;IACD,EAAE,EAAE,MAAM,CACR,oHAAoH,CACrH;IACD,EAAE,EAAE,MAAM,CACR,oHAAoH,CACrH;CACF,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,eAAe,CAAC,IAAA,uBAAe,EAAC,GAAG,EAAE,CAAC,kBAAQ,CAAC,M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7D,uBAAe,CAAC,WAAwB,CAAC,EAAE,CAAC;AAC9C,kFAAkF;AACrE,QAAA,gBAAgB,GAA8B,CAAC,GAAG,EAAE,CAC/D,uBAAe,CAAC,WAAwB,CAAC,EAAE,CAAC;AAC9C,iDAAiD;AACjD,SAAgB,sBAAsB,CAAC,UAA+B;IACpE,OAAO,aAAK,CAAC,KAAK,CAAC,YAAY,CAAC,IAAA,sBAAW,EAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC;AAClE,CAAC;AACD,iDAAiD;AACpC,QAAA,mBAAmB,GAAkC,sBAAsB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/_shortw_utils.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/esm/_shortw_utils.d.ts deleted file mode 100644 index e0cd1e0d..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/_shortw_utils.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Utilities for short weierstrass curves, combined with noble-hashes. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { type CurveFn, type CurveType } from './abstract/weierstrass.ts'; -import type { CHash } from './utils.ts'; -/** connects noble-curves to noble-hashes */ -export declare function getHash(hash: CHash): { - hash: CHash; -}; -/** Same API as @noble/hashes, with ability to create curve with custom hash */ -export type CurveDef = Readonly>; -export type CurveFnWithCreate = CurveFn & { - create: (hash: CHash) => CurveFn; -}; -/** @deprecated use new `weierstrass()` and `ecdsa()` methods */ -export declare function createCurve(curveDef: CurveDef, defHash: CHash): CurveFnWithCreate; -//# sourceMappingURL=_shortw_utils.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/_shortw_utils.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/_shortw_utils.d.ts.map deleted file mode 100644 index 0f9096ed..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/_shortw_utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_shortw_utils.d.ts","sourceRoot":"","sources":["../src/_shortw_utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,sEAAsE;AACtE,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,SAAS,EAAe,MAAM,2BAA2B,CAAC;AACtF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,4CAA4C;AAC5C,wBAAgB,OAAO,CAAC,IAAI,EAAE,KAAK,GAAG;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE,CAEpD;AACD,+EAA+E;AAC/E,MAAM,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;AACzD,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG;IAAE,MAAM,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,OAAO,CAAA;CAAE,CAAC;AAE/E,gEAAgE;AAChE,wBAAgB,WAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,GAAG,iBAAiB,CAGjF"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/_shortw_utils.js b/tools/mnemonic-test/node_modules/@noble/curves/esm/_shortw_utils.js deleted file mode 100644 index 8494c4b3..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/_shortw_utils.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Utilities for short weierstrass curves, combined with noble-hashes. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { weierstrass } from "./abstract/weierstrass.js"; -/** connects noble-curves to noble-hashes */ -export function getHash(hash) { - return { hash }; -} -/** @deprecated use new `weierstrass()` and `ecdsa()` methods */ -export function createCurve(curveDef, defHash) { - const create = (hash) => weierstrass({ ...curveDef, hash: hash }); - return { ...create(defHash), create }; -} -//# sourceMappingURL=_shortw_utils.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/_shortw_utils.js.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/_shortw_utils.js.map deleted file mode 100644 index c1e53ff7..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/_shortw_utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_shortw_utils.js","sourceRoot":"","sources":["../src/_shortw_utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,sEAAsE;AACtE,OAAO,EAAgC,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAGtF,4CAA4C;AAC5C,MAAM,UAAU,OAAO,CAAC,IAAW;IACjC,OAAO,EAAE,IAAI,EAAE,CAAC;AAClB,CAAC;AAKD,gEAAgE;AAChE,MAAM,UAAU,WAAW,CAAC,QAAkB,EAAE,OAAc;IAC5D,MAAM,MAAM,GAAG,CAAC,IAAW,EAAW,EAAE,CAAC,WAAW,CAAC,EAAE,GAAG,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IAClF,OAAO,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;AACxC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/bls.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/bls.d.ts deleted file mode 100644 index 8a8fd9c2..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/bls.d.ts +++ /dev/null @@ -1,190 +0,0 @@ -/** - * BLS != BLS. - * The file implements BLS (Boneh-Lynn-Shacham) signatures. - * Used in both BLS (Barreto-Lynn-Scott) and BN (Barreto-Naehrig) - * families of pairing-friendly curves. - * Consists of two curves: G1 and G2: - * - G1 is a subgroup of (x, y) E(Fq) over y² = x³ + 4. - * - G2 is a subgroup of ((x₁, x₂+i), (y₁, y₂+i)) E(Fq²) over y² = x³ + 4(1 + i) where i is √-1 - * - Gt, created by bilinear (ate) pairing e(G1, G2), consists of p-th roots of unity in - * Fq^k where k is embedding degree. Only degree 12 is currently supported, 24 is not. - * Pairing is used to aggregate and verify signatures. - * There are two modes of operation: - * - Long signatures: X-byte keys + 2X-byte sigs (G1 keys + G2 sigs). - * - Short signatures: 2X-byte keys + X-byte sigs (G2 keys + G1 sigs). - * @module - **/ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { type CHash, type Hex, type PrivKey } from '../utils.ts'; -import { type H2CHasher, type H2CHashOpts, type H2COpts, type htfBasicOpts, type MapToCurve } from './hash-to-curve.ts'; -import { type IField } from './modular.ts'; -import type { Fp12, Fp12Bls, Fp2, Fp2Bls, Fp6Bls } from './tower.ts'; -import { type CurvePointsRes, type CurvePointsType, type WeierstrassPoint, type WeierstrassPointCons } from './weierstrass.ts'; -type Fp = bigint; -export type TwistType = 'multiplicative' | 'divisive'; -export type ShortSignatureCoder = { - fromBytes(bytes: Uint8Array): WeierstrassPoint; - fromHex(hex: Hex): WeierstrassPoint; - toBytes(point: WeierstrassPoint): Uint8Array; - toHex(point: WeierstrassPoint): string; - /** @deprecated use `toBytes` */ - toRawBytes(point: WeierstrassPoint): Uint8Array; -}; -export type SignatureCoder = { - fromBytes(bytes: Uint8Array): WeierstrassPoint; - fromHex(hex: Hex): WeierstrassPoint; - toBytes(point: WeierstrassPoint): Uint8Array; - toHex(point: WeierstrassPoint): string; - /** @deprecated use `toBytes` */ - toRawBytes(point: WeierstrassPoint): Uint8Array; -}; -export type BlsFields = { - Fp: IField; - Fr: IField; - Fp2: Fp2Bls; - Fp6: Fp6Bls; - Fp12: Fp12Bls; -}; -export type PostPrecomputePointAddFn = (Rx: Fp2, Ry: Fp2, Rz: Fp2, Qx: Fp2, Qy: Fp2) => { - Rx: Fp2; - Ry: Fp2; - Rz: Fp2; -}; -export type PostPrecomputeFn = (Rx: Fp2, Ry: Fp2, Rz: Fp2, Qx: Fp2, Qy: Fp2, pointAdd: PostPrecomputePointAddFn) => void; -export type BlsPairing = { - Fp12: Fp12Bls; - calcPairingPrecomputes: (p: WeierstrassPoint) => Precompute; - millerLoopBatch: (pairs: [Precompute, Fp, Fp][]) => Fp12; - pairing: (P: WeierstrassPoint, Q: WeierstrassPoint, withFinalExponent?: boolean) => Fp12; - pairingBatch: (pairs: { - g1: WeierstrassPoint; - g2: WeierstrassPoint; - }[], withFinalExponent?: boolean) => Fp12; -}; -export type BlsPairingParams = { - ateLoopSize: bigint; - xNegative: boolean; - twistType: TwistType; - postPrecompute?: PostPrecomputeFn; -}; -export type CurveType = { - G1: CurvePointsType & { - ShortSignature: SignatureCoder; - mapToCurve: MapToCurve; - htfDefaults: H2COpts; - }; - G2: CurvePointsType & { - Signature: SignatureCoder; - mapToCurve: MapToCurve; - htfDefaults: H2COpts; - }; - fields: BlsFields; - params: { - ateLoopSize: BlsPairingParams['ateLoopSize']; - xNegative: BlsPairingParams['xNegative']; - r: bigint; - twistType: BlsPairingParams['twistType']; - }; - htfDefaults: H2COpts; - hash: CHash; - randomBytes?: (bytesLength?: number) => Uint8Array; - postPrecompute?: PostPrecomputeFn; -}; -type PrecomputeSingle = [Fp2, Fp2, Fp2][]; -type Precompute = PrecomputeSingle[]; -/** - * BLS consists of two curves: G1 and G2: - * - G1 is a subgroup of (x, y) E(Fq) over y² = x³ + 4. - * - G2 is a subgroup of ((x₁, x₂+i), (y₁, y₂+i)) E(Fq²) over y² = x³ + 4(1 + i) where i is √-1 - */ -export interface BLSCurvePair { - longSignatures: BLSSigs; - shortSignatures: BLSSigs; - millerLoopBatch: BlsPairing['millerLoopBatch']; - pairing: BlsPairing['pairing']; - pairingBatch: BlsPairing['pairingBatch']; - G1: { - Point: WeierstrassPointCons; - } & H2CHasher; - G2: { - Point: WeierstrassPointCons; - } & H2CHasher; - fields: { - Fp: IField; - Fp2: Fp2Bls; - Fp6: Fp6Bls; - Fp12: Fp12Bls; - Fr: IField; - }; - utils: { - randomSecretKey: () => Uint8Array; - /** @deprecated use randomSecretKey */ - randomPrivateKey: () => Uint8Array; - calcPairingPrecomputes: BlsPairing['calcPairingPrecomputes']; - }; -} -export type CurveFn = BLSCurvePair & { - /** @deprecated use `longSignatures.getPublicKey` */ - getPublicKey: (secretKey: PrivKey) => Uint8Array; - /** @deprecated use `shortSignatures.getPublicKey` */ - getPublicKeyForShortSignatures: (secretKey: PrivKey) => Uint8Array; - /** @deprecated use `longSignatures.sign` */ - sign: { - (message: Hex, secretKey: PrivKey, htfOpts?: htfBasicOpts): Uint8Array; - (message: WeierstrassPoint, secretKey: PrivKey, htfOpts?: htfBasicOpts): WeierstrassPoint; - }; - /** @deprecated use `shortSignatures.sign` */ - signShortSignature: { - (message: Hex, secretKey: PrivKey, htfOpts?: htfBasicOpts): Uint8Array; - (message: WeierstrassPoint, secretKey: PrivKey, htfOpts?: htfBasicOpts): WeierstrassPoint; - }; - /** @deprecated use `longSignatures.verify` */ - verify: (signature: Hex | WeierstrassPoint, message: Hex | WeierstrassPoint, publicKey: Hex | WeierstrassPoint, htfOpts?: htfBasicOpts) => boolean; - /** @deprecated use `shortSignatures.verify` */ - verifyShortSignature: (signature: Hex | WeierstrassPoint, message: Hex | WeierstrassPoint, publicKey: Hex | WeierstrassPoint, htfOpts?: htfBasicOpts) => boolean; - verifyBatch: (signature: Hex | WeierstrassPoint, messages: (Hex | WeierstrassPoint)[], publicKeys: (Hex | WeierstrassPoint)[], htfOpts?: htfBasicOpts) => boolean; - /** @deprecated use `longSignatures.aggregatePublicKeys` */ - aggregatePublicKeys: { - (publicKeys: Hex[]): Uint8Array; - (publicKeys: WeierstrassPoint[]): WeierstrassPoint; - }; - /** @deprecated use `longSignatures.aggregateSignatures` */ - aggregateSignatures: { - (signatures: Hex[]): Uint8Array; - (signatures: WeierstrassPoint[]): WeierstrassPoint; - }; - /** @deprecated use `shortSignatures.aggregateSignatures` */ - aggregateShortSignatures: { - (signatures: Hex[]): Uint8Array; - (signatures: WeierstrassPoint[]): WeierstrassPoint; - }; - G1: CurvePointsRes & H2CHasher; - G2: CurvePointsRes & H2CHasher; - /** @deprecated use `longSignatures.Signature` */ - Signature: SignatureCoder; - /** @deprecated use `shortSignatures.Signature` */ - ShortSignature: ShortSignatureCoder; - params: { - ateLoopSize: bigint; - r: bigint; - twistType: TwistType; - /** @deprecated */ - G1b: bigint; - /** @deprecated */ - G2b: Fp2; - }; -}; -type BLSInput = Hex | Uint8Array; -export interface BLSSigs { - getPublicKey(secretKey: PrivKey): WeierstrassPoint

; - sign(hashedMessage: WeierstrassPoint, secretKey: PrivKey): WeierstrassPoint; - verify(signature: WeierstrassPoint | BLSInput, message: WeierstrassPoint, publicKey: WeierstrassPoint

| BLSInput): boolean; - verifyBatch: (signature: WeierstrassPoint | BLSInput, messages: WeierstrassPoint[], publicKeys: (WeierstrassPoint

| BLSInput)[]) => boolean; - aggregatePublicKeys(publicKeys: (WeierstrassPoint

| BLSInput)[]): WeierstrassPoint

; - aggregateSignatures(signatures: (WeierstrassPoint | BLSInput)[]): WeierstrassPoint; - hash(message: Uint8Array, DST?: string | Uint8Array, hashOpts?: H2CHashOpts): WeierstrassPoint; - Signature: SignatureCoder; -} -export declare function bls(CURVE: CurveType): CurveFn; -export {}; -//# sourceMappingURL=bls.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/bls.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/bls.d.ts.map deleted file mode 100644 index c560f762..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/bls.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bls.d.ts","sourceRoot":"","sources":["../../src/abstract/bls.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;IAeI;AACJ,sEAAsE;AACtE,OAAO,EAKL,KAAK,KAAK,EACV,KAAK,GAAG,EACR,KAAK,OAAO,EACb,MAAM,aAAa,CAAC;AAErB,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,OAAO,EAEZ,KAAK,YAAY,EACjB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AY,CAAC,SAAS,EAAE,OAAO,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;IACtD,IAAI,CAAC,aAAa,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAClF,MAAM,CACJ,SAAS,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,QAAQ,EACzC,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAC5B,SAAS,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,QAAQ,GACxC,OAAO,CAAC;IACX,WAAW,EAAE,CACX,SAAS,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,QAAQ,EACzC,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,EAC/B,UAAU,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,EAAE,KAC3C,OAAO,CAAC;IACb,mBAAmB,CAAC,UAAU,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,EAAE,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;IACzF,mBAAmB,CAAC,UAAU,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,EAAE,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;IACzF,IAAI,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,UAAU,EAAE,QAAQ,CAAC,EAAE,WAAW,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAClG,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;CAC9B;AA6SD,wBAAgB,GAAG,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAiL7C"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/bls.js b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/bls.js deleted file mode 100644 index a136a4e9..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/bls.js +++ /dev/null @@ -1,408 +0,0 @@ -/** - * BLS != BLS. - * The file implements BLS (Boneh-Lynn-Shacham) signatures. - * Used in both BLS (Barreto-Lynn-Scott) and BN (Barreto-Naehrig) - * families of pairing-friendly curves. - * Consists of two curves: G1 and G2: - * - G1 is a subgroup of (x, y) E(Fq) over y² = x³ + 4. - * - G2 is a subgroup of ((x₁, x₂+i), (y₁, y₂+i)) E(Fq²) over y² = x³ + 4(1 + i) where i is √-1 - * - Gt, created by bilinear (ate) pairing e(G1, G2), consists of p-th roots of unity in - * Fq^k where k is embedding degree. Only degree 12 is currently supported, 24 is not. - * Pairing is used to aggregate and verify signatures. - * There are two modes of operation: - * - Long signatures: X-byte keys + 2X-byte sigs (G1 keys + G2 sigs). - * - Short signatures: 2X-byte keys + X-byte sigs (G2 keys + G1 sigs). - * @module - **/ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { abytes, ensureBytes, memoized, randomBytes, } from "../utils.js"; -import { normalizeZ } from "./curve.js"; -import { createHasher, } from "./hash-to-curve.js"; -import { getMinHashLength, mapHashToField } from "./modular.js"; -import { _normFnElement, weierstrassPoints, } from "./weierstrass.js"; -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3); -// Not used with BLS12-381 (no sequential `11` in X). Useful for other curves. -function NAfDecomposition(a) { - const res = []; - // a>1 because of marker bit - for (; a > _1n; a >>= _1n) { - if ((a & _1n) === _0n) - res.unshift(0); - else if ((a & _3n) === _3n) { - res.unshift(-1); - a += _1n; - } - else - res.unshift(1); - } - return res; -} -function aNonEmpty(arr) { - if (!Array.isArray(arr) || arr.length === 0) - throw new Error('expected non-empty array'); -} -// This should be enough for bn254, no need to export full stuff? -function createBlsPairing(fields, G1, G2, params) { - const { Fp2, Fp12 } = fields; - const { twistType, ateLoopSize, xNegative, postPrecompute } = params; - // Applies sparse multiplication as line function - let lineFunction; - if (twistType === 'multiplicative') { - lineFunction = (c0, c1, c2, f, Px, Py) => Fp12.mul014(f, c0, Fp2.mul(c1, Px), Fp2.mul(c2, Py)); - } - else if (twistType === 'divisive') { - // NOTE: it should be [c0, c1, c2], but we use different order here to reduce complexity of - // precompute calculations. - lineFunction = (c0, c1, c2, f, Px, Py) => Fp12.mul034(f, Fp2.mul(c2, Py), Fp2.mul(c1, Px), c0); - } - else - throw new Error('bls: unknown twist type'); - const Fp2div2 = Fp2.div(Fp2.ONE, Fp2.mul(Fp2.ONE, _2n)); - function pointDouble(ell, Rx, Ry, Rz) { - const t0 = Fp2.sqr(Ry); // Ry² - const t1 = Fp2.sqr(Rz); // Rz² - const t2 = Fp2.mulByB(Fp2.mul(t1, _3n)); // 3 * T1 * B - const t3 = Fp2.mul(t2, _3n); // 3 * T2 - const t4 = Fp2.sub(Fp2.sub(Fp2.sqr(Fp2.add(Ry, Rz)), t1), t0); // (Ry + Rz)² - T1 - T0 - const c0 = Fp2.sub(t2, t0); // T2 - T0 (i) - const c1 = Fp2.mul(Fp2.sqr(Rx), _3n); // 3 * Rx² - const c2 = Fp2.neg(t4); // -T4 (-h) - ell.push([c0, c1, c2]); - Rx = Fp2.mul(Fp2.mul(Fp2.mul(Fp2.sub(t0, t3), Rx), Ry), Fp2div2); // ((T0 - T3) * Rx * Ry) / 2 - Ry = Fp2.sub(Fp2.sqr(Fp2.mul(Fp2.add(t0, t3), Fp2div2)), Fp2.mul(Fp2.sqr(t2), _3n)); // ((T0 + T3) / 2)² - 3 * T2² - Rz = Fp2.mul(t0, t4); // T0 * T4 - return { Rx, Ry, Rz }; - } - function pointAdd(ell, Rx, Ry, Rz, Qx, Qy) { - // Addition - const t0 = Fp2.sub(Ry, Fp2.mul(Qy, Rz)); // Ry - Qy * Rz - const t1 = Fp2.sub(Rx, Fp2.mul(Qx, Rz)); // Rx - Qx * Rz - const c0 = Fp2.sub(Fp2.mul(t0, Qx), Fp2.mul(t1, Qy)); // T0 * Qx - T1 * Qy == Ry * Qx - Rx * Qy - const c1 = Fp2.neg(t0); // -T0 == Qy * Rz - Ry - const c2 = t1; // == Rx - Qx * Rz - ell.push([c0, c1, c2]); - const t2 = Fp2.sqr(t1); // T1² - const t3 = Fp2.mul(t2, t1); // T2 * T1 - const t4 = Fp2.mul(t2, Rx); // T2 * Rx - const t5 = Fp2.add(Fp2.sub(t3, Fp2.mul(t4, _2n)), Fp2.mul(Fp2.sqr(t0), Rz)); // T3 - 2 * T4 + T0² * Rz - Rx = Fp2.mul(t1, t5); // T1 * T5 - Ry = Fp2.sub(Fp2.mul(Fp2.sub(t4, t5), t0), Fp2.mul(t3, Ry)); // (T4 - T5) * T0 - T3 * Ry - Rz = Fp2.mul(Rz, t3); // Rz * T3 - return { Rx, Ry, Rz }; - } - // Pre-compute coefficients for sparse multiplication - // Point addition and point double calculations is reused for coefficients - // pointAdd happens only if bit set, so wNAF is reasonable. Unfortunately we cannot combine - // add + double in windowed precomputes here, otherwise it would be single op (since X is static) - const ATE_NAF = NAfDecomposition(ateLoopSize); - const calcPairingPrecomputes = memoized((point) => { - const p = point; - const { x, y } = p.toAffine(); - // prettier-ignore - const Qx = x, Qy = y, negQy = Fp2.neg(y); - // prettier-ignore - let Rx = Qx, Ry = Qy, Rz = Fp2.ONE; - const ell = []; - for (const bit of ATE_NAF) { - const cur = []; - ({ Rx, Ry, Rz } = pointDouble(cur, Rx, Ry, Rz)); - if (bit) - ({ Rx, Ry, Rz } = pointAdd(cur, Rx, Ry, Rz, Qx, bit === -1 ? negQy : Qy)); - ell.push(cur); - } - if (postPrecompute) { - const last = ell[ell.length - 1]; - postPrecompute(Rx, Ry, Rz, Qx, Qy, pointAdd.bind(null, last)); - } - return ell; - }); - function millerLoopBatch(pairs, withFinalExponent = false) { - let f12 = Fp12.ONE; - if (pairs.length) { - const ellLen = pairs[0][0].length; - for (let i = 0; i < ellLen; i++) { - f12 = Fp12.sqr(f12); // This allows us to do sqr only one time for all pairings - // NOTE: we apply multiple pairings in parallel here - for (const [ell, Px, Py] of pairs) { - for (const [c0, c1, c2] of ell[i]) - f12 = lineFunction(c0, c1, c2, f12, Px, Py); - } - } - } - if (xNegative) - f12 = Fp12.conjugate(f12); - return withFinalExponent ? Fp12.finalExponentiate(f12) : f12; - } - // Calculates product of multiple pairings - // This up to x2 faster than just `map(({g1, g2})=>pairing({g1,g2}))` - function pairingBatch(pairs, withFinalExponent = true) { - const res = []; - // Cache precomputed toAffine for all points - normalizeZ(G1, pairs.map(({ g1 }) => g1)); - normalizeZ(G2, pairs.map(({ g2 }) => g2)); - for (const { g1, g2 } of pairs) { - if (g1.is0() || g2.is0()) - throw new Error('pairing is not available for ZERO point'); - // This uses toAffine inside - g1.assertValidity(); - g2.assertValidity(); - const Qa = g1.toAffine(); - res.push([calcPairingPrecomputes(g2), Qa.x, Qa.y]); - } - return millerLoopBatch(res, withFinalExponent); - } - // Calculates bilinear pairing - function pairing(Q, P, withFinalExponent = true) { - return pairingBatch([{ g1: Q, g2: P }], withFinalExponent); - } - return { - Fp12, // NOTE: we re-export Fp12 here because pairing results are Fp12! - millerLoopBatch, - pairing, - pairingBatch, - calcPairingPrecomputes, - }; -} -function createBlsSig(blsPairing, PubCurve, SigCurve, SignatureCoder, isSigG1) { - const { Fp12, pairingBatch } = blsPairing; - function normPub(point) { - return point instanceof PubCurve.Point ? point : PubCurve.Point.fromHex(point); - } - function normSig(point) { - return point instanceof SigCurve.Point ? point : SigCurve.Point.fromHex(point); - } - function amsg(m) { - if (!(m instanceof SigCurve.Point)) - throw new Error(`expected valid message hashed to ${!isSigG1 ? 'G2' : 'G1'} curve`); - return m; - } - // What matters here is what point pairing API accepts as G1 or G2, not actual size or names - const pair = !isSigG1 - ? (a, b) => ({ g1: a, g2: b }) - : (a, b) => ({ g1: b, g2: a }); - return { - // P = pk x G - getPublicKey(secretKey) { - // TODO: replace with - // const sec = PubCurve.Point.Fn.fromBytes(secretKey); - const sec = _normFnElement(PubCurve.Point.Fn, secretKey); - return PubCurve.Point.BASE.multiply(sec); - }, - // S = pk x H(m) - sign(message, secretKey, unusedArg) { - if (unusedArg != null) - throw new Error('sign() expects 2 arguments'); - // TODO: replace with - // PubCurve.Point.Fn.fromBytes(secretKey) - const sec = _normFnElement(PubCurve.Point.Fn, secretKey); - amsg(message).assertValidity(); - return message.multiply(sec); - }, - // Checks if pairing of public key & hash is equal to pairing of generator & signature. - // e(P, H(m)) == e(G, S) - // e(S, G) == e(H(m), P) - verify(signature, message, publicKey, unusedArg) { - if (unusedArg != null) - throw new Error('verify() expects 3 arguments'); - signature = normSig(signature); - publicKey = normPub(publicKey); - const P = publicKey.negate(); - const G = PubCurve.Point.BASE; - const Hm = amsg(message); - const S = signature; - // This code was changed in 1.9.x: - // Before it was G.negate() in G2, now it's always pubKey.negate - // e(P, -Q)===e(-P, Q)==e(P, Q)^-1. Negate can be done anywhere (as long it is done once per pair). - // We just moving sign, but since pairing is multiplicative, we doing X * X^-1 = 1 - const exp = pairingBatch([pair(P, Hm), pair(G, S)]); - return Fp12.eql(exp, Fp12.ONE); - }, - // https://ethresear.ch/t/fast-verification-of-multiple-bls-signatures/5407 - // e(G, S) = e(G, SUM(n)(Si)) = MUL(n)(e(G, Si)) - // TODO: maybe `{message: G2Hex, publicKey: G1Hex}[]` instead? - verifyBatch(signature, messages, publicKeys) { - aNonEmpty(messages); - if (publicKeys.length !== messages.length) - throw new Error('amount of public keys and messages should be equal'); - const sig = normSig(signature); - const nMessages = messages; - const nPublicKeys = publicKeys.map(normPub); - // NOTE: this works only for exact same object - const messagePubKeyMap = new Map(); - for (let i = 0; i < nPublicKeys.length; i++) { - const pub = nPublicKeys[i]; - const msg = nMessages[i]; - let keys = messagePubKeyMap.get(msg); - if (keys === undefined) { - keys = []; - messagePubKeyMap.set(msg, keys); - } - keys.push(pub); - } - const paired = []; - const G = PubCurve.Point.BASE; - try { - for (const [msg, keys] of messagePubKeyMap) { - const groupPublicKey = keys.reduce((acc, msg) => acc.add(msg)); - paired.push(pair(groupPublicKey, msg)); - } - paired.push(pair(G.negate(), sig)); - return Fp12.eql(pairingBatch(paired), Fp12.ONE); - } - catch { - return false; - } - }, - // Adds a bunch of public key points together. - // pk1 + pk2 + pk3 = pkA - aggregatePublicKeys(publicKeys) { - aNonEmpty(publicKeys); - publicKeys = publicKeys.map((pub) => normPub(pub)); - const agg = publicKeys.reduce((sum, p) => sum.add(p), PubCurve.Point.ZERO); - agg.assertValidity(); - return agg; - }, - // Adds a bunch of signature points together. - // pk1 + pk2 + pk3 = pkA - aggregateSignatures(signatures) { - aNonEmpty(signatures); - signatures = signatures.map((sig) => normSig(sig)); - const agg = signatures.reduce((sum, s) => sum.add(s), SigCurve.Point.ZERO); - agg.assertValidity(); - return agg; - }, - hash(messageBytes, DST) { - abytes(messageBytes); - const opts = DST ? { DST } : undefined; - return SigCurve.hashToCurve(messageBytes, opts); - }, - Signature: SignatureCoder, - }; -} -// G1_Point: ProjConstructor, G2_Point: ProjConstructor, -export function bls(CURVE) { - // Fields are specific for curve, so for now we'll need to pass them with opts - const { Fp, Fr, Fp2, Fp6, Fp12 } = CURVE.fields; - // Point on G1 curve: (x, y) - const G1_ = weierstrassPoints(CURVE.G1); - const G1 = Object.assign(G1_, createHasher(G1_.Point, CURVE.G1.mapToCurve, { - ...CURVE.htfDefaults, - ...CURVE.G1.htfDefaults, - })); - // Point on G2 curve (complex numbers): (x₁, x₂+i), (y₁, y₂+i) - const G2_ = weierstrassPoints(CURVE.G2); - const G2 = Object.assign(G2_, createHasher(G2_.Point, CURVE.G2.mapToCurve, { - ...CURVE.htfDefaults, - ...CURVE.G2.htfDefaults, - })); - const pairingRes = createBlsPairing(CURVE.fields, G1.Point, G2.Point, { - ...CURVE.params, - postPrecompute: CURVE.postPrecompute, - }); - const { millerLoopBatch, pairing, pairingBatch, calcPairingPrecomputes } = pairingRes; - const longSignatures = createBlsSig(pairingRes, G1, G2, CURVE.G2.Signature, false); - const shortSignatures = createBlsSig(pairingRes, G2, G1, CURVE.G1.ShortSignature, true); - const rand = CURVE.randomBytes || randomBytes; - const randomSecretKey = () => { - const length = getMinHashLength(Fr.ORDER); - return mapHashToField(rand(length), Fr.ORDER); - }; - const utils = { - randomSecretKey, - randomPrivateKey: randomSecretKey, - calcPairingPrecomputes, - }; - const { ShortSignature } = CURVE.G1; - const { Signature } = CURVE.G2; - function normP1Hash(point, htfOpts) { - return point instanceof G1.Point - ? point - : shortSignatures.hash(ensureBytes('point', point), htfOpts?.DST); - } - function normP2Hash(point, htfOpts) { - return point instanceof G2.Point - ? point - : longSignatures.hash(ensureBytes('point', point), htfOpts?.DST); - } - function getPublicKey(privateKey) { - return longSignatures.getPublicKey(privateKey).toBytes(true); - } - function getPublicKeyForShortSignatures(privateKey) { - return shortSignatures.getPublicKey(privateKey).toBytes(true); - } - function sign(message, privateKey, htfOpts) { - const Hm = normP2Hash(message, htfOpts); - const S = longSignatures.sign(Hm, privateKey); - return message instanceof G2.Point ? S : Signature.toBytes(S); - } - function signShortSignature(message, privateKey, htfOpts) { - const Hm = normP1Hash(message, htfOpts); - const S = shortSignatures.sign(Hm, privateKey); - return message instanceof G1.Point ? S : ShortSignature.toBytes(S); - } - function verify(signature, message, publicKey, htfOpts) { - const Hm = normP2Hash(message, htfOpts); - return longSignatures.verify(signature, Hm, publicKey); - } - function verifyShortSignature(signature, message, publicKey, htfOpts) { - const Hm = normP1Hash(message, htfOpts); - return shortSignatures.verify(signature, Hm, publicKey); - } - function aggregatePublicKeys(publicKeys) { - const agg = longSignatures.aggregatePublicKeys(publicKeys); - return publicKeys[0] instanceof G1.Point ? agg : agg.toBytes(true); - } - function aggregateSignatures(signatures) { - const agg = longSignatures.aggregateSignatures(signatures); - return signatures[0] instanceof G2.Point ? agg : Signature.toBytes(agg); - } - function aggregateShortSignatures(signatures) { - const agg = shortSignatures.aggregateSignatures(signatures); - return signatures[0] instanceof G1.Point ? agg : ShortSignature.toBytes(agg); - } - function verifyBatch(signature, messages, publicKeys, htfOpts) { - const Hm = messages.map((m) => normP2Hash(m, htfOpts)); - return longSignatures.verifyBatch(signature, Hm, publicKeys); - } - G1.Point.BASE.precompute(4); - return { - longSignatures, - shortSignatures, - millerLoopBatch, - pairing, - pairingBatch, - verifyBatch, - fields: { - Fr, - Fp, - Fp2, - Fp6, - Fp12, - }, - params: { - ateLoopSize: CURVE.params.ateLoopSize, - twistType: CURVE.params.twistType, - // deprecated - r: CURVE.params.r, - G1b: CURVE.G1.b, - G2b: CURVE.G2.b, - }, - utils, - // deprecated - getPublicKey, - getPublicKeyForShortSignatures, - sign, - signShortSignature, - verify, - verifyShortSignature, - aggregatePublicKeys, - aggregateSignatures, - aggregateShortSignatures, - G1, - G2, - Signature, - ShortSignature, - }; -} -//# sourceMappingURL=bls.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/bls.js.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/bls.js.map deleted file mode 100644 index 6f65de12..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/bls.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bls.js","sourceRoot":"","sources":["../../src/abstract/bls.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;IAeI;AACJ,sEAAsE;AACtE,OAAO,EACL,MAAM,EACN,WAAW,EACX,QAAQ,EACR,WAAW,GAIZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EACL,YAAY,GAOb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAe,MAAM,cAAc,CAAC;AAE7E,OAAO,EACL,cAAc,EACd,iBAAiB,GAKlB,MAAM,kBAAkB,CAAC;AAI1B,kBAAkB;AAClB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAA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C"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/curve.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/curve.d.ts deleted file mode 100644 index b6029fbc..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/curve.d.ts +++ /dev/null @@ -1,231 +0,0 @@ -import { type IField } from './modular.ts'; -export type AffinePoint = { - x: T; - y: T; -} & { - Z?: never; -}; -export interface Group> { - double(): T; - negate(): T; - add(other: T): T; - subtract(other: T): T; - equals(other: T): boolean; - multiply(scalar: bigint): T; - toAffine?(invertedZ?: any): AffinePoint; -} -/** Base interface for all elliptic curve Points. */ -export interface CurvePoint> extends Group

{ - /** Affine x coordinate. Different from projective / extended X coordinate. */ - x: F; - /** Affine y coordinate. Different from projective / extended Y coordinate. */ - y: F; - Z?: F; - double(): P; - negate(): P; - add(other: P): P; - subtract(other: P): P; - equals(other: P): boolean; - multiply(scalar: bigint): P; - assertValidity(): void; - clearCofactor(): P; - is0(): boolean; - isTorsionFree(): boolean; - isSmallOrder(): boolean; - multiplyUnsafe(scalar: bigint): P; - /** - * Massively speeds up `p.multiply(n)` by using precompute tables (caching). See {@link wNAF}. - * @param isLazy calculate cache now. Default (true) ensures it's deferred to first `multiply()` - */ - precompute(windowSize?: number, isLazy?: boolean): P; - /** Converts point to 2D xy affine coordinates */ - toAffine(invertedZ?: F): AffinePoint; - toBytes(): Uint8Array; - toHex(): string; -} -/** Base interface for all elliptic curve Point constructors. */ -export interface CurvePointCons

> { - [Symbol.hasInstance]: (item: unknown) => boolean; - BASE: P; - ZERO: P; - /** Field for basic curve math */ - Fp: IField>; - /** Scalar field, for scalars in multiply and others */ - Fn: IField; - /** Creates point from x, y. Does NOT validate if the point is valid. Use `.assertValidity()`. */ - fromAffine(p: AffinePoint>): P; - fromBytes(bytes: Uint8Array): P; - fromHex(hex: Uint8Array | string): P; -} -/** Returns Fp type from Point (P_F

== P.F) */ -export type P_F

> = P extends CurvePoint ? F : never; -/** Returns Fp type from PointCons (PC_F == PC.P.F) */ -export type PC_F>> = PC['Fp']['ZERO']; -/** Returns Point type from PointCons (PC_P == PC.P) */ -export type PC_P>> = PC['ZERO']; -export type PC_ANY = CurvePointCons>>>>>>>>>>; -export interface CurveLengths { - secretKey?: number; - publicKey?: number; - publicKeyUncompressed?: number; - publicKeyHasPrefix?: boolean; - signature?: number; - seed?: number; -} -export type GroupConstructor = { - BASE: T; - ZERO: T; -}; -/** @deprecated */ -export type ExtendedGroupConstructor = GroupConstructor & { - Fp: IField; - Fn: IField; - fromAffine(ap: AffinePoint): T; -}; -export type Mapper = (i: T[]) => T[]; -export declare function negateCt T; -}>(condition: boolean, item: T): T; -/** - * Takes a bunch of Projective Points but executes only one - * inversion on all of them. Inversion is very slow operation, - * so this improves performance massively. - * Optimization: converts a list of projective points to a list of identical points with Z=1. - */ -export declare function normalizeZ

, PC extends CurvePointCons

>(c: PC, points: P[]): P[]; -/** Internal wNAF opts for specific W and scalarBits */ -export type WOpts = { - windows: number; - windowSize: number; - mask: bigint; - maxNumber: number; - shiftBy: bigint; -}; -/** - * Elliptic curve multiplication of Point by scalar. Fragile. - * Table generation takes **30MB of ram and 10ms on high-end CPU**, - * but may take much longer on slow devices. Actual generation will happen on - * first call of `multiply()`. By default, `BASE` point is precomputed. - * - * Scalars should always be less than curve order: this should be checked inside of a curve itself. - * Creates precomputation tables for fast multiplication: - * - private scalar is split by fixed size windows of W bits - * - every window point is collected from window's table & added to accumulator - * - since windows are different, same point inside tables won't be accessed more than once per calc - * - each multiplication is 'Math.ceil(CURVE_ORDER / 𝑊) + 1' point additions (fixed for any scalar) - * - +1 window is neccessary for wNAF - * - wNAF reduces table size: 2x less memory + 2x faster generation, but 10% slower multiplication - * - * @todo Research returning 2d JS array of windows, instead of a single window. - * This would allow windows to be in different memory locations - */ -export declare class wNAF { - private readonly BASE; - private readonly ZERO; - private readonly Fn; - readonly bits: number; - constructor(Point: PC, bits: number); - _unsafeLadder(elm: PC_P, n: bigint, p?: PC_P): PC_P; - /** - * Creates a wNAF precomputation window. Used for caching. - * Default window size is set by `utils.precompute()` and is equal to 8. - * Number of precomputed points depends on the curve size: - * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where: - * - 𝑊 is the window size - * - 𝑛 is the bitlength of the curve order. - * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224. - * @param point Point instance - * @param W window size - * @returns precomputed point tables flattened to a single array - */ - private precomputeWindow; - /** - * Implements ec multiplication using precomputed tables and w-ary non-adjacent form. - * More compact implementation: - * https://github.com/paulmillr/noble-secp256k1/blob/47cb1669b6e506ad66b35fe7d76132ae97465da2/index.ts#L502-L541 - * @returns real and fake (for const-time) points - */ - private wNAF; - /** - * Implements ec unsafe (non const-time) multiplication using precomputed tables and w-ary non-adjacent form. - * @param acc accumulator point to add result of multiplication - * @returns point - */ - private wNAFUnsafe; - private getPrecomputes; - cached(point: PC_P, scalar: bigint, transform?: Mapper>): { - p: PC_P; - f: PC_P; - }; - unsafe(point: PC_P, scalar: bigint, transform?: Mapper>, prev?: PC_P): PC_P; - createCache(P: PC_P, W: number): void; - hasCache(elm: PC_P): boolean; -} -/** - * Endomorphism-specific multiplication for Koblitz curves. - * Cost: 128 dbl, 0-256 adds. - */ -export declare function mulEndoUnsafe

, PC extends CurvePointCons

>(Point: PC, point: P, k1: bigint, k2: bigint): { - p1: P; - p2: P; -}; -/** - * Pippenger algorithm for multi-scalar multiplication (MSM, Pa + Qb + Rc + ...). - * 30x faster vs naive addition on L=4096, 10x faster than precomputes. - * For N=254bit, L=1, it does: 1024 ADD + 254 DBL. For L=5: 1536 ADD + 254 DBL. - * Algorithmically constant-time (for same L), even when 1 point + scalar, or when scalar = 0. - * @param c Curve Point constructor - * @param fieldN field over CURVE.N - important that it's not over CURVE.P - * @param points array of L curve points - * @param scalars array of L scalars (aka secret keys / bigints) - */ -export declare function pippenger

, PC extends CurvePointCons

>(c: PC, fieldN: IField, points: P[], scalars: bigint[]): P; -/** - * Precomputed multi-scalar multiplication (MSM, Pa + Qb + Rc + ...). - * @param c Curve Point constructor - * @param fieldN field over CURVE.N - important that it's not over CURVE.P - * @param points array of L curve points - * @returns function which multiplies points with scaars - */ -export declare function precomputeMSMUnsafe

, PC extends CurvePointCons

>(c: PC, fieldN: IField, points: P[], windowSize: number): (scalars: bigint[]) => P; -/** - * Generic BasicCurve interface: works even for polynomial fields (BLS): P, n, h would be ok. - * Though generator can be different (Fp2 / Fp6 for BLS). - */ -export type BasicCurve = { - Fp: IField; - n: bigint; - nBitLength?: number; - nByteLength?: number; - h: bigint; - hEff?: bigint; - Gx: T; - Gy: T; - allowInfinityPoint?: boolean; -}; -/** @deprecated */ -export declare function validateBasic(curve: BasicCurve & T): Readonly<{ - readonly nBitLength: number; - readonly nByteLength: number; -} & BasicCurve & T & { - p: bigint; -}>; -export type ValidCurveParams = { - p: bigint; - n: bigint; - h: bigint; - a: T; - b?: T; - d?: T; - Gx: T; - Gy: T; -}; -export type FpFn = { - Fp: IField; - Fn: IField; -}; -/** Validates CURVE opts and creates fields */ -export declare function _createCurveFields(type: 'weierstrass' | 'edwards', CURVE: ValidCurveParams, curveOpts?: Partial>, FpFnLE?: boolean): FpFn & { - CURVE: ValidCurveParams; -}; -//# sourceMappingURL=curve.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/curve.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/curve.d.ts.map deleted file mode 100644 index fa284d5c..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/curve.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"curve.d.ts","sourceRoot":"","sources":["../../src/abstract/curve.ts"],"names":[],"mappings":"AAOA,OAAO,EAAgD,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAKzF,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;IAC3B,CAAC,EAAE,CAAC,CAAC;IACL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,EAAE,EAAE,CAAC,CAAC;CACP,CAAC;AAWF,MAAM,MAAM,IAAI,CAAC,CAAC,IAAI;IAAE,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC;AAE5D,8CAA8C;AAC9C,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,IAAI,EAAE,aAAa,GAAG,SAAS,EAC/B,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAC1B,SAAS,GAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAM,EAChC,MAAM,CAAC,EAAE,OAAO,GACf,IAAI,CAAC,CAAC,CAAC,GAAG;IAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAA;CAAE,CAmB1C"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/curve.js b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/curve.js deleted file mode 100644 index ed73357f..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/curve.js +++ /dev/null @@ -1,465 +0,0 @@ -/** - * Methods for elliptic curve multiplication by scalars. - * Contains wNAF, pippenger. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { bitLen, bitMask, validateObject } from "../utils.js"; -import { Field, FpInvertBatch, nLength, validateField } from "./modular.js"; -const _0n = BigInt(0); -const _1n = BigInt(1); -export function negateCt(condition, item) { - const neg = item.negate(); - return condition ? neg : item; -} -/** - * Takes a bunch of Projective Points but executes only one - * inversion on all of them. Inversion is very slow operation, - * so this improves performance massively. - * Optimization: converts a list of projective points to a list of identical points with Z=1. - */ -export function normalizeZ(c, points) { - const invertedZs = FpInvertBatch(c.Fp, points.map((p) => p.Z)); - return points.map((p, i) => c.fromAffine(p.toAffine(invertedZs[i]))); -} -function validateW(W, bits) { - if (!Number.isSafeInteger(W) || W <= 0 || W > bits) - throw new Error('invalid window size, expected [1..' + bits + '], got W=' + W); -} -function calcWOpts(W, scalarBits) { - validateW(W, scalarBits); - const windows = Math.ceil(scalarBits / W) + 1; // W=8 33. Not 32, because we skip zero - const windowSize = 2 ** (W - 1); // W=8 128. Not 256, because we skip zero - const maxNumber = 2 ** W; // W=8 256 - const mask = bitMask(W); // W=8 255 == mask 0b11111111 - const shiftBy = BigInt(W); // W=8 8 - return { windows, windowSize, mask, maxNumber, shiftBy }; -} -function calcOffsets(n, window, wOpts) { - const { windowSize, mask, maxNumber, shiftBy } = wOpts; - let wbits = Number(n & mask); // extract W bits. - let nextN = n >> shiftBy; // shift number by W bits. - // What actually happens here: - // const highestBit = Number(mask ^ (mask >> 1n)); - // let wbits2 = wbits - 1; // skip zero - // if (wbits2 & highestBit) { wbits2 ^= Number(mask); // (~); - // split if bits > max: +224 => 256-32 - if (wbits > windowSize) { - // we skip zero, which means instead of `>= size-1`, we do `> size` - wbits -= maxNumber; // -32, can be maxNumber - wbits, but then we need to set isNeg here. - nextN += _1n; // +256 (carry) - } - const offsetStart = window * windowSize; - const offset = offsetStart + Math.abs(wbits) - 1; // -1 because we skip zero - const isZero = wbits === 0; // is current window slice a 0? - const isNeg = wbits < 0; // is current window slice negative? - const isNegF = window % 2 !== 0; // fake random statement for noise - const offsetF = offsetStart; // fake offset for noise - return { nextN, offset, isZero, isNeg, isNegF, offsetF }; -} -function validateMSMPoints(points, c) { - if (!Array.isArray(points)) - throw new Error('array expected'); - points.forEach((p, i) => { - if (!(p instanceof c)) - throw new Error('invalid point at index ' + i); - }); -} -function validateMSMScalars(scalars, field) { - if (!Array.isArray(scalars)) - throw new Error('array of scalars expected'); - scalars.forEach((s, i) => { - if (!field.isValid(s)) - throw new Error('invalid scalar at index ' + i); - }); -} -// Since points in different groups cannot be equal (different object constructor), -// we can have single place to store precomputes. -// Allows to make points frozen / immutable. -const pointPrecomputes = new WeakMap(); -const pointWindowSizes = new WeakMap(); -function getW(P) { - // To disable precomputes: - // return 1; - return pointWindowSizes.get(P) || 1; -} -function assert0(n) { - if (n !== _0n) - throw new Error('invalid wNAF'); -} -/** - * Elliptic curve multiplication of Point by scalar. Fragile. - * Table generation takes **30MB of ram and 10ms on high-end CPU**, - * but may take much longer on slow devices. Actual generation will happen on - * first call of `multiply()`. By default, `BASE` point is precomputed. - * - * Scalars should always be less than curve order: this should be checked inside of a curve itself. - * Creates precomputation tables for fast multiplication: - * - private scalar is split by fixed size windows of W bits - * - every window point is collected from window's table & added to accumulator - * - since windows are different, same point inside tables won't be accessed more than once per calc - * - each multiplication is 'Math.ceil(CURVE_ORDER / 𝑊) + 1' point additions (fixed for any scalar) - * - +1 window is neccessary for wNAF - * - wNAF reduces table size: 2x less memory + 2x faster generation, but 10% slower multiplication - * - * @todo Research returning 2d JS array of windows, instead of a single window. - * This would allow windows to be in different memory locations - */ -export class wNAF { - // Parametrized with a given Point class (not individual point) - constructor(Point, bits) { - this.BASE = Point.BASE; - this.ZERO = Point.ZERO; - this.Fn = Point.Fn; - this.bits = bits; - } - // non-const time multiplication ladder - _unsafeLadder(elm, n, p = this.ZERO) { - let d = elm; - while (n > _0n) { - if (n & _1n) - p = p.add(d); - d = d.double(); - n >>= _1n; - } - return p; - } - /** - * Creates a wNAF precomputation window. Used for caching. - * Default window size is set by `utils.precompute()` and is equal to 8. - * Number of precomputed points depends on the curve size: - * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where: - * - 𝑊 is the window size - * - 𝑛 is the bitlength of the curve order. - * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224. - * @param point Point instance - * @param W window size - * @returns precomputed point tables flattened to a single array - */ - precomputeWindow(point, W) { - const { windows, windowSize } = calcWOpts(W, this.bits); - const points = []; - let p = point; - let base = p; - for (let window = 0; window < windows; window++) { - base = p; - points.push(base); - // i=1, bc we skip 0 - for (let i = 1; i < windowSize; i++) { - base = base.add(p); - points.push(base); - } - p = base.double(); - } - return points; - } - /** - * Implements ec multiplication using precomputed tables and w-ary non-adjacent form. - * More compact implementation: - * https://github.com/paulmillr/noble-secp256k1/blob/47cb1669b6e506ad66b35fe7d76132ae97465da2/index.ts#L502-L541 - * @returns real and fake (for const-time) points - */ - wNAF(W, precomputes, n) { - // Scalar should be smaller than field order - if (!this.Fn.isValid(n)) - throw new Error('invalid scalar'); - // Accumulators - let p = this.ZERO; - let f = this.BASE; - // This code was first written with assumption that 'f' and 'p' will never be infinity point: - // since each addition is multiplied by 2 ** W, it cannot cancel each other. However, - // there is negate now: it is possible that negated element from low value - // would be the same as high element, which will create carry into next window. - // It's not obvious how this can fail, but still worth investigating later. - const wo = calcWOpts(W, this.bits); - for (let window = 0; window < wo.windows; window++) { - // (n === _0n) is handled and not early-exited. isEven and offsetF are used for noise - const { nextN, offset, isZero, isNeg, isNegF, offsetF } = calcOffsets(n, window, wo); - n = nextN; - if (isZero) { - // bits are 0: add garbage to fake point - // Important part for const-time getPublicKey: add random "noise" point to f. - f = f.add(negateCt(isNegF, precomputes[offsetF])); - } - else { - // bits are 1: add to result point - p = p.add(negateCt(isNeg, precomputes[offset])); - } - } - assert0(n); - // Return both real and fake points: JIT won't eliminate f. - // At this point there is a way to F be infinity-point even if p is not, - // which makes it less const-time: around 1 bigint multiply. - return { p, f }; - } - /** - * Implements ec unsafe (non const-time) multiplication using precomputed tables and w-ary non-adjacent form. - * @param acc accumulator point to add result of multiplication - * @returns point - */ - wNAFUnsafe(W, precomputes, n, acc = this.ZERO) { - const wo = calcWOpts(W, this.bits); - for (let window = 0; window < wo.windows; window++) { - if (n === _0n) - break; // Early-exit, skip 0 value - const { nextN, offset, isZero, isNeg } = calcOffsets(n, window, wo); - n = nextN; - if (isZero) { - // Window bits are 0: skip processing. - // Move to next window. - continue; - } - else { - const item = precomputes[offset]; - acc = acc.add(isNeg ? item.negate() : item); // Re-using acc allows to save adds in MSM - } - } - assert0(n); - return acc; - } - getPrecomputes(W, point, transform) { - // Calculate precomputes on a first run, reuse them after - let comp = pointPrecomputes.get(point); - if (!comp) { - comp = this.precomputeWindow(point, W); - if (W !== 1) { - // Doing transform outside of if brings 15% perf hit - if (typeof transform === 'function') - comp = transform(comp); - pointPrecomputes.set(point, comp); - } - } - return comp; - } - cached(point, scalar, transform) { - const W = getW(point); - return this.wNAF(W, this.getPrecomputes(W, point, transform), scalar); - } - unsafe(point, scalar, transform, prev) { - const W = getW(point); - if (W === 1) - return this._unsafeLadder(point, scalar, prev); // For W=1 ladder is ~x2 faster - return this.wNAFUnsafe(W, this.getPrecomputes(W, point, transform), scalar, prev); - } - // We calculate precomputes for elliptic curve point multiplication - // using windowed method. This specifies window size and - // stores precomputed values. Usually only base point would be precomputed. - createCache(P, W) { - validateW(W, this.bits); - pointWindowSizes.set(P, W); - pointPrecomputes.delete(P); - } - hasCache(elm) { - return getW(elm) !== 1; - } -} -/** - * Endomorphism-specific multiplication for Koblitz curves. - * Cost: 128 dbl, 0-256 adds. - */ -export function mulEndoUnsafe(Point, point, k1, k2) { - let acc = point; - let p1 = Point.ZERO; - let p2 = Point.ZERO; - while (k1 > _0n || k2 > _0n) { - if (k1 & _1n) - p1 = p1.add(acc); - if (k2 & _1n) - p2 = p2.add(acc); - acc = acc.double(); - k1 >>= _1n; - k2 >>= _1n; - } - return { p1, p2 }; -} -/** - * Pippenger algorithm for multi-scalar multiplication (MSM, Pa + Qb + Rc + ...). - * 30x faster vs naive addition on L=4096, 10x faster than precomputes. - * For N=254bit, L=1, it does: 1024 ADD + 254 DBL. For L=5: 1536 ADD + 254 DBL. - * Algorithmically constant-time (for same L), even when 1 point + scalar, or when scalar = 0. - * @param c Curve Point constructor - * @param fieldN field over CURVE.N - important that it's not over CURVE.P - * @param points array of L curve points - * @param scalars array of L scalars (aka secret keys / bigints) - */ -export function pippenger(c, fieldN, points, scalars) { - // If we split scalars by some window (let's say 8 bits), every chunk will only - // take 256 buckets even if there are 4096 scalars, also re-uses double. - // TODO: - // - https://eprint.iacr.org/2024/750.pdf - // - https://tches.iacr.org/index.php/TCHES/article/view/10287 - // 0 is accepted in scalars - validateMSMPoints(points, c); - validateMSMScalars(scalars, fieldN); - const plength = points.length; - const slength = scalars.length; - if (plength !== slength) - throw new Error('arrays of points and scalars must have equal length'); - // if (plength === 0) throw new Error('array must be of length >= 2'); - const zero = c.ZERO; - const wbits = bitLen(BigInt(plength)); - let windowSize = 1; // bits - if (wbits > 12) - windowSize = wbits - 3; - else if (wbits > 4) - windowSize = wbits - 2; - else if (wbits > 0) - windowSize = 2; - const MASK = bitMask(windowSize); - const buckets = new Array(Number(MASK) + 1).fill(zero); // +1 for zero array - const lastBits = Math.floor((fieldN.BITS - 1) / windowSize) * windowSize; - let sum = zero; - for (let i = lastBits; i >= 0; i -= windowSize) { - buckets.fill(zero); - for (let j = 0; j < slength; j++) { - const scalar = scalars[j]; - const wbits = Number((scalar >> BigInt(i)) & MASK); - buckets[wbits] = buckets[wbits].add(points[j]); - } - let resI = zero; // not using this will do small speed-up, but will lose ct - // Skip first bucket, because it is zero - for (let j = buckets.length - 1, sumI = zero; j > 0; j--) { - sumI = sumI.add(buckets[j]); - resI = resI.add(sumI); - } - sum = sum.add(resI); - if (i !== 0) - for (let j = 0; j < windowSize; j++) - sum = sum.double(); - } - return sum; -} -/** - * Precomputed multi-scalar multiplication (MSM, Pa + Qb + Rc + ...). - * @param c Curve Point constructor - * @param fieldN field over CURVE.N - important that it's not over CURVE.P - * @param points array of L curve points - * @returns function which multiplies points with scaars - */ -export function precomputeMSMUnsafe(c, fieldN, points, windowSize) { - /** - * Performance Analysis of Window-based Precomputation - * - * Base Case (256-bit scalar, 8-bit window): - * - Standard precomputation requires: - * - 31 additions per scalar × 256 scalars = 7,936 ops - * - Plus 255 summary additions = 8,191 total ops - * Note: Summary additions can be optimized via accumulator - * - * Chunked Precomputation Analysis: - * - Using 32 chunks requires: - * - 255 additions per chunk - * - 256 doublings - * - Total: (255 × 32) + 256 = 8,416 ops - * - * Memory Usage Comparison: - * Window Size | Standard Points | Chunked Points - * ------------|-----------------|--------------- - * 4-bit | 520 | 15 - * 8-bit | 4,224 | 255 - * 10-bit | 13,824 | 1,023 - * 16-bit | 557,056 | 65,535 - * - * Key Advantages: - * 1. Enables larger window sizes due to reduced memory overhead - * 2. More efficient for smaller scalar counts: - * - 16 chunks: (16 × 255) + 256 = 4,336 ops - * - ~2x faster than standard 8,191 ops - * - * Limitations: - * - Not suitable for plain precomputes (requires 256 constant doublings) - * - Performance degrades with larger scalar counts: - * - Optimal for ~256 scalars - * - Less efficient for 4096+ scalars (Pippenger preferred) - */ - validateW(windowSize, fieldN.BITS); - validateMSMPoints(points, c); - const zero = c.ZERO; - const tableSize = 2 ** windowSize - 1; // table size (without zero) - const chunks = Math.ceil(fieldN.BITS / windowSize); // chunks of item - const MASK = bitMask(windowSize); - const tables = points.map((p) => { - const res = []; - for (let i = 0, acc = p; i < tableSize; i++) { - res.push(acc); - acc = acc.add(p); - } - return res; - }); - return (scalars) => { - validateMSMScalars(scalars, fieldN); - if (scalars.length > points.length) - throw new Error('array of scalars must be smaller than array of points'); - let res = zero; - for (let i = 0; i < chunks; i++) { - // No need to double if accumulator is still zero. - if (res !== zero) - for (let j = 0; j < windowSize; j++) - res = res.double(); - const shiftBy = BigInt(chunks * windowSize - (i + 1) * windowSize); - for (let j = 0; j < scalars.length; j++) { - const n = scalars[j]; - const curr = Number((n >> shiftBy) & MASK); - if (!curr) - continue; // skip zero scalars chunks - res = res.add(tables[j][curr - 1]); - } - } - return res; - }; -} -// TODO: remove -/** @deprecated */ -export function validateBasic(curve) { - validateField(curve.Fp); - validateObject(curve, { - n: 'bigint', - h: 'bigint', - Gx: 'field', - Gy: 'field', - }, { - nBitLength: 'isSafeInteger', - nByteLength: 'isSafeInteger', - }); - // Set defaults - return Object.freeze({ - ...nLength(curve.n, curve.nBitLength), - ...curve, - ...{ p: curve.Fp.ORDER }, - }); -} -function createField(order, field, isLE) { - if (field) { - if (field.ORDER !== order) - throw new Error('Field.ORDER must match order: Fp == p, Fn == n'); - validateField(field); - return field; - } - else { - return Field(order, { isLE }); - } -} -/** Validates CURVE opts and creates fields */ -export function _createCurveFields(type, CURVE, curveOpts = {}, FpFnLE) { - if (FpFnLE === undefined) - FpFnLE = type === 'edwards'; - if (!CURVE || typeof CURVE !== 'object') - throw new Error(`expected valid ${type} CURVE object`); - for (const p of ['p', 'n', 'h']) { - const val = CURVE[p]; - if (!(typeof val === 'bigint' && val > _0n)) - throw new Error(`CURVE.${p} must be positive bigint`); - } - const Fp = createField(CURVE.p, curveOpts.Fp, FpFnLE); - const Fn = createField(CURVE.n, curveOpts.Fn, FpFnLE); - const _b = type === 'weierstrass' ? 'b' : 'd'; - const params = ['Gx', 'Gy', 'a', _b]; - for (const p of params) { - // @ts-ignore - if (!Fp.isValid(CURVE[p])) - throw new Error(`CURVE.${p} must be valid field element of CURVE.Fp`); - } - CURVE = Object.freeze(Object.assign({}, CURVE)); - return { CURVE, Fp, Fn }; -} -//# sourceMappingURL=curve.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/curve.js.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/curve.js.map deleted file mode 100644 index 1975f457..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/curve.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"curve.js","sourceRoot":"","sources":["../../src/abstract/curve.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,sEAAsE;AACtE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,aAAa,EAAe,MAAM,cAAc,CAAC;AAEzF,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AA0ItB,MAAM,UAAU,QAAQ,CAAgC,SAAkB,EAAE,IAAO;IACjF,MAAM,GAAG,GAAG,IA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C,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAU,EAAE,CAAC;QACzC,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACrB,IAAI,CAAC,CAAC,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,GAAG,GAAG,CAAC;YACzC,MAAM,IAAI,KAAK,CAAC,SAAS,CAAC,0BAA0B,CAAC,CAAC;IAC1D,CAAC;IACD,MAAM,EAAE,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IACtD,MAAM,EAAE,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IACtD,MAAM,EAAE,GAAc,IAAI,KAAK,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;IACzD,MAAM,MAAM,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,CAAU,CAAC;IAC9C,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;QACvB,aAAa;QACb,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,SAAS,CAAC,0CAA0C,CAAC,CAAC;IAC1E,CAAC;IACD,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;IAChD,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;AAC3B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/edwards.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/edwards.d.ts deleted file mode 100644 index ed651373..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/edwards.d.ts +++ /dev/null @@ -1,243 +0,0 @@ -/** - * Twisted Edwards curve. The formula is: ax² + y² = 1 + dx²y². - * For design rationale of types / exports, see weierstrass module documentation. - * Untwisted Edwards curves exist, but they aren't used in real-world protocols. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { type FHash, type Hex } from '../utils.ts'; -import { type AffinePoint, type BasicCurve, type CurveLengths, type CurvePoint, type CurvePointCons } from './curve.ts'; -import { type IField, type NLength } from './modular.ts'; -export type UVRatio = (u: bigint, v: bigint) => { - isValid: boolean; - value: bigint; -}; -/** Instance of Extended Point with coordinates in X, Y, Z, T. */ -export interface EdwardsPoint extends CurvePoint { - /** extended X coordinate. Different from affine x. */ - readonly X: bigint; - /** extended Y coordinate. Different from affine y. */ - readonly Y: bigint; - /** extended Z coordinate */ - readonly Z: bigint; - /** extended T coordinate */ - readonly T: bigint; - /** @deprecated use `toBytes` */ - toRawBytes(): Uint8Array; - /** @deprecated use `p.precompute(windowSize)` */ - _setWindowSize(windowSize: number): void; - /** @deprecated use .X */ - readonly ex: bigint; - /** @deprecated use .Y */ - readonly ey: bigint; - /** @deprecated use .Z */ - readonly ez: bigint; - /** @deprecated use .T */ - readonly et: bigint; -} -/** Static methods of Extended Point with coordinates in X, Y, Z, T. */ -export interface EdwardsPointCons extends CurvePointCons { - new (X: bigint, Y: bigint, Z: bigint, T: bigint): EdwardsPoint; - CURVE(): EdwardsOpts; - fromBytes(bytes: Uint8Array, zip215?: boolean): EdwardsPoint; - fromHex(hex: Hex, zip215?: boolean): EdwardsPoint; - /** @deprecated use `import { pippenger } from '@noble/curves/abstract/curve.js';` */ - msm(points: EdwardsPoint[], scalars: bigint[]): EdwardsPoint; -} -/** @deprecated use EdwardsPoint */ -export type ExtPointType = EdwardsPoint; -/** @deprecated use EdwardsPointCons */ -export type ExtPointConstructor = EdwardsPointCons; -/** - * Twisted Edwards curve options. - * - * * a: formula param - * * d: formula param - * * p: prime characteristic (order) of finite field, in which arithmetics is done - * * n: order of prime subgroup a.k.a total amount of valid curve points - * * h: cofactor. h*n is group order; n is subgroup order - * * Gx: x coordinate of generator point a.k.a. base point - * * Gy: y coordinate of generator point - */ -export type EdwardsOpts = Readonly<{ - p: bigint; - n: bigint; - h: bigint; - a: bigint; - d: bigint; - Gx: bigint; - Gy: bigint; -}>; -/** - * Extra curve options for Twisted Edwards. - * - * * Fp: redefined Field over curve.p - * * Fn: redefined Field over curve.n - * * uvRatio: helper function for decompression, calculating √(u/v) - */ -export type EdwardsExtraOpts = Partial<{ - Fp: IField; - Fn: IField; - FpFnLE: boolean; - uvRatio: (u: bigint, v: bigint) => { - isValid: boolean; - value: bigint; - }; -}>; -/** - * EdDSA (Edwards Digital Signature algorithm) options. - * - * * hash: hash function used to hash secret keys and messages - * * adjustScalarBytes: clears bits to get valid field element - * * domain: Used for hashing - * * mapToCurve: for hash-to-curve standard - * * prehash: RFC 8032 pre-hashing of messages to sign() / verify() - * * randomBytes: function generating random bytes, used for randomSecretKey - */ -export type EdDSAOpts = Partial<{ - adjustScalarBytes: (bytes: Uint8Array) => Uint8Array; - domain: (data: Uint8Array, ctx: Uint8Array, phflag: boolean) => Uint8Array; - mapToCurve: (scalar: bigint[]) => AffinePoint; - prehash: FHash; - randomBytes: (bytesLength?: number) => Uint8Array; -}>; -/** - * EdDSA (Edwards Digital Signature algorithm) interface. - * - * Allows to create and verify signatures, create public and secret keys. - */ -export interface EdDSA { - keygen: (seed?: Uint8Array) => { - secretKey: Uint8Array; - publicKey: Uint8Array; - }; - getPublicKey: (secretKey: Hex) => Uint8Array; - sign: (message: Hex, secretKey: Hex, options?: { - context?: Hex; - }) => Uint8Array; - verify: (sig: Hex, message: Hex, publicKey: Hex, options?: { - context?: Hex; - zip215: boolean; - }) => boolean; - Point: EdwardsPointCons; - utils: { - randomSecretKey: (seed?: Uint8Array) => Uint8Array; - isValidSecretKey: (secretKey: Uint8Array) => boolean; - isValidPublicKey: (publicKey: Uint8Array, zip215?: boolean) => boolean; - /** - * Converts ed public key to x public key. - * - * There is NO `fromMontgomery`: - * - There are 2 valid ed25519 points for every x25519, with flipped coordinate - * - Sometimes there are 0 valid ed25519 points, because x25519 *additionally* - * accepts inputs on the quadratic twist, which can't be moved to ed25519 - * - * @example - * ```js - * const someonesPub = ed25519.getPublicKey(ed25519.utils.randomSecretKey()); - * const aPriv = x25519.utils.randomSecretKey(); - * x25519.getSharedSecret(aPriv, ed25519.utils.toMontgomery(someonesPub)) - * ``` - */ - toMontgomery: (publicKey: Uint8Array) => Uint8Array; - /** - * Converts ed secret key to x secret key. - * @example - * ```js - * const someonesPub = x25519.getPublicKey(x25519.utils.randomSecretKey()); - * const aPriv = ed25519.utils.randomSecretKey(); - * x25519.getSharedSecret(ed25519.utils.toMontgomerySecret(aPriv), someonesPub) - * ``` - */ - toMontgomerySecret: (privateKey: Uint8Array) => Uint8Array; - getExtendedPublicKey: (key: Hex) => { - head: Uint8Array; - prefix: Uint8Array; - scalar: bigint; - point: EdwardsPoint; - pointBytes: Uint8Array; - }; - /** @deprecated use `randomSecretKey` */ - randomPrivateKey: (seed?: Uint8Array) => Uint8Array; - /** @deprecated use `point.precompute()` */ - precompute: (windowSize?: number, point?: EdwardsPoint) => EdwardsPoint; - }; - lengths: CurveLengths; -} -export declare function edwards(params: EdwardsOpts, extraOpts?: EdwardsExtraOpts): EdwardsPointCons; -/** - * Base class for prime-order points like Ristretto255 and Decaf448. - * These points eliminate cofactor issues by representing equivalence classes - * of Edwards curve points. - */ -export declare abstract class PrimeEdwardsPoint> implements CurvePoint { - static BASE: PrimeEdwardsPoint; - static ZERO: PrimeEdwardsPoint; - static Fp: IField; - static Fn: IField; - protected readonly ep: EdwardsPoint; - constructor(ep: EdwardsPoint); - abstract toBytes(): Uint8Array; - abstract equals(other: T): boolean; - static fromBytes(_bytes: Uint8Array): any; - static fromHex(_hex: Hex): any; - get x(): bigint; - get y(): bigint; - clearCofactor(): T; - assertValidity(): void; - toAffine(invertedZ?: bigint): AffinePoint; - toHex(): string; - toString(): string; - isTorsionFree(): boolean; - isSmallOrder(): boolean; - add(other: T): T; - subtract(other: T): T; - multiply(scalar: bigint): T; - multiplyUnsafe(scalar: bigint): T; - double(): T; - negate(): T; - precompute(windowSize?: number, isLazy?: boolean): T; - abstract is0(): boolean; - protected abstract assertSame(other: T): void; - protected abstract init(ep: EdwardsPoint): T; - /** @deprecated use `toBytes` */ - toRawBytes(): Uint8Array; -} -/** - * Initializes EdDSA signatures over given Edwards curve. - */ -export declare function eddsa(Point: EdwardsPointCons, cHash: FHash, eddsaOpts?: EdDSAOpts): EdDSA; -export type CurveType = BasicCurve & { - a: bigint; - d: bigint; - /** @deprecated the property will be removed in next release */ - hash: FHash; - randomBytes?: (bytesLength?: number) => Uint8Array; - adjustScalarBytes?: (bytes: Uint8Array) => Uint8Array; - domain?: (data: Uint8Array, ctx: Uint8Array, phflag: boolean) => Uint8Array; - uvRatio?: UVRatio; - prehash?: FHash; - mapToCurve?: (scalar: bigint[]) => AffinePoint; -}; -export type CurveTypeWithLength = Readonly>; -export type CurveFn = { - /** @deprecated the property will be removed in next release */ - CURVE: CurveType; - keygen: EdDSA['keygen']; - getPublicKey: EdDSA['getPublicKey']; - sign: EdDSA['sign']; - verify: EdDSA['verify']; - Point: EdwardsPointCons; - /** @deprecated use `Point` */ - ExtendedPoint: EdwardsPointCons; - utils: EdDSA['utils']; - lengths: CurveLengths; -}; -export type EdComposed = { - CURVE: EdwardsOpts; - curveOpts: EdwardsExtraOpts; - hash: FHash; - eddsaOpts: EdDSAOpts; -}; -export declare function twistedEdwards(c: CurveTypeWithLength): CurveFn; -//# sourceMappingURL=edwards.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/edwards.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/edwards.d.ts.map deleted file mode 100644 index 10e15c58..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/edwards.d.ts.map +++ /dev/null @@ -1 +0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EAAE,SAAS,CAAC;CACtB,CAAC;AAkCF,wBAAgB,cAAc,CAAC,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAK9D"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/edwards.js b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/edwards.js deleted file mode 100644 index d4b54a64..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/edwards.js +++ /dev/null @@ -1,627 +0,0 @@ -/** - * Twisted Edwards curve. The formula is: ax² + y² = 1 + dx²y². - * For design rationale of types / exports, see weierstrass module documentation. - * Untwisted Edwards curves exist, but they aren't used in real-world protocols. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { _validateObject, _abool2 as abool, _abytes2 as abytes, aInRange, bytesToHex, bytesToNumberLE, concatBytes, copyBytes, ensureBytes, isBytes, memoized, notImplemented, randomBytes as randomBytesWeb, } from "../utils.js"; -import { _createCurveFields, normalizeZ, pippenger, wNAF, } from "./curve.js"; -import { Field } from "./modular.js"; -// Be friendly to bad ECMAScript parsers by not using bigint literals -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _8n = BigInt(8); -function isEdValidXY(Fp, CURVE, x, y) { - const x2 = Fp.sqr(x); - const y2 = Fp.sqr(y); - const left = Fp.add(Fp.mul(CURVE.a, x2), y2); - const right = Fp.add(Fp.ONE, Fp.mul(CURVE.d, Fp.mul(x2, y2))); - return Fp.eql(left, right); -} -export function edwards(params, extraOpts = {}) { - const validated = _createCurveFields('edwards', params, extraOpts, extraOpts.FpFnLE); - const { Fp, Fn } = validated; - let CURVE = validated.CURVE; - const { h: cofactor } = CURVE; - _validateObject(extraOpts, {}, { uvRatio: 'function' }); - // Important: - // There are some places where Fp.BYTES is used instead of nByteLength. - // So far, everything has been tested with curves of Fp.BYTES == nByteLength. - // TODO: test and find curves which behave otherwise. - const MASK = _2n << (BigInt(Fn.BYTES * 8) - _1n); - const modP = (n) => Fp.create(n); // Function overrides - // sqrt(u/v) - const uvRatio = extraOpts.uvRatio || - ((u, v) => { - try { - return { isValid: true, value: Fp.sqrt(Fp.div(u, v)) }; - } - catch (e) { - return { isValid: false, value: _0n }; - } - }); - // Validate whether the passed curve params are valid. - // equation ax² + y² = 1 + dx²y² should work for generator point. - if (!isEdValidXY(Fp, CURVE, CURVE.Gx, CURVE.Gy)) - throw new Error('bad curve params: generator point'); - /** - * Asserts coordinate is valid: 0 <= n < MASK. - * Coordinates >= Fp.ORDER are allowed for zip215. - */ - function acoord(title, n, banZero = false) { - const min = banZero ? _1n : _0n; - aInRange('coordinate ' + title, n, min, MASK); - return n; - } - function aextpoint(other) { - if (!(other instanceof Point)) - throw new Error('ExtendedPoint expected'); - } - // Converts Extended point to default (x, y) coordinates. - // Can accept precomputed Z^-1 - for example, from invertBatch. - const toAffineMemo = memoized((p, iz) => { - const { X, Y, Z } = p; - const is0 = p.is0(); - if (iz == null) - iz = is0 ? _8n : Fp.inv(Z); // 8 was chosen arbitrarily - const x = modP(X * iz); - const y = modP(Y * iz); - const zz = Fp.mul(Z, iz); - if (is0) - return { x: _0n, y: _1n }; - if (zz !== _1n) - throw new Error('invZ was invalid'); - return { x, y }; - }); - const assertValidMemo = memoized((p) => { - const { a, d } = CURVE; - if (p.is0()) - throw new Error('bad point: ZERO'); // TODO: optimize, with vars below? - // Equation in affine coordinates: ax² + y² = 1 + dx²y² - // Equation in projective coordinates (X/Z, Y/Z, Z): (aX² + Y²)Z² = Z⁴ + dX²Y² - const { X, Y, Z, T } = p; - const X2 = modP(X * X); // X² - const Y2 = modP(Y * Y); // Y² - const Z2 = modP(Z * Z); // Z² - const Z4 = modP(Z2 * Z2); // Z⁴ - const aX2 = modP(X2 * a); // aX² - const left = modP(Z2 * modP(aX2 + Y2)); // (aX² + Y²)Z² - const right = modP(Z4 + modP(d * modP(X2 * Y2))); // Z⁴ + dX²Y² - if (left !== right) - throw new Error('bad point: equation left != right (1)'); - // In Extended coordinates we also have T, which is x*y=T/Z: check X*Y == Z*T - const XY = modP(X * Y); - const ZT = modP(Z * T); - if (XY !== ZT) - throw new Error('bad point: equation left != right (2)'); - return true; - }); - // Extended Point works in extended coordinates: (X, Y, Z, T) ∋ (x=X/Z, y=Y/Z, T=xy). - // https://en.wikipedia.org/wiki/Twisted_Edwards_curve#Extended_coordinates - class Point { - constructor(X, Y, Z, T) { - this.X = acoord('x', X); - this.Y = acoord('y', Y); - this.Z = acoord('z', Z, true); - this.T = acoord('t', T); - Object.freeze(this); - } - static CURVE() { - return CURVE; - } - static fromAffine(p) { - if (p instanceof Point) - throw new Error('extended point not allowed'); - const { x, y } = p || {}; - acoord('x', x); - acoord('y', y); - return new Point(x, y, _1n, modP(x * y)); - } - // Uses algo from RFC8032 5.1.3. - static fromBytes(bytes, zip215 = false) { - const len = Fp.BYTES; - const { a, d } = CURVE; - bytes = copyBytes(abytes(bytes, len, 'point')); - abool(zip215, 'zip215'); - const normed = copyBytes(bytes); // copy again, we'll manipulate it - const lastByte = bytes[len - 1]; // select last byte - normed[len - 1] = lastByte & ~0x80; // clear last bit - const y = bytesToNumberLE(normed); - // zip215=true is good for consensus-critical apps. =false follows RFC8032 / NIST186-5. - // RFC8032 prohibits >= p, but ZIP215 doesn't - // zip215=true: 0 <= y < MASK (2^256 for ed25519) - // zip215=false: 0 <= y < P (2^255-19 for ed25519) - const max = zip215 ? MASK : Fp.ORDER; - aInRange('point.y', y, _0n, max); - // Ed25519: x² = (y²-1)/(dy²+1) mod p. Ed448: x² = (y²-1)/(dy²-1) mod p. Generic case: - // ax²+y²=1+dx²y² => y²-1=dx²y²-ax² => y²-1=x²(dy²-a) => x²=(y²-1)/(dy²-a) - const y2 = modP(y * y); // denominator is always non-0 mod p. - const u = modP(y2 - _1n); // u = y² - 1 - const v = modP(d * y2 - a); // v = d y² + 1. - let { isValid, value: x } = uvRatio(u, v); // √(u/v) - if (!isValid) - throw new Error('bad point: invalid y coordinate'); - const isXOdd = (x & _1n) === _1n; // There are 2 square roots. Use x_0 bit to select proper - const isLastByteOdd = (lastByte & 0x80) !== 0; // x_0, last bit - if (!zip215 && x === _0n && isLastByteOdd) - // if x=0 and x_0 = 1, fail - throw new Error('bad point: x=0 and x_0=1'); - if (isLastByteOdd !== isXOdd) - x = modP(-x); // if x_0 != x mod 2, set x = p-x - return Point.fromAffine({ x, y }); - } - static fromHex(bytes, zip215 = false) { - return Point.fromBytes(ensureBytes('point', bytes), zip215); - } - get x() { - return this.toAffine().x; - } - get y() { - return this.toAffine().y; - } - precompute(windowSize = 8, isLazy = true) { - wnaf.createCache(this, windowSize); - if (!isLazy) - this.multiply(_2n); // random number - return this; - } - // Useful in fromAffine() - not for fromBytes(), which always created valid points. - assertValidity() { - assertValidMemo(this); - } - // Compare one point to another. - equals(other) { - aextpoint(other); - const { X: X1, Y: Y1, Z: Z1 } = this; - const { X: X2, Y: Y2, Z: Z2 } = other; - const X1Z2 = modP(X1 * Z2); - const X2Z1 = modP(X2 * Z1); - const Y1Z2 = modP(Y1 * Z2); - const Y2Z1 = modP(Y2 * Z1); - return X1Z2 === X2Z1 && Y1Z2 === Y2Z1; - } - is0() { - return this.equals(Point.ZERO); - } - negate() { - // Flips point sign to a negative one (-x, y in affine coords) - return new Point(modP(-this.X), this.Y, this.Z, modP(-this.T)); - } - // Fast algo for doubling Extended Point. - // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-dbl-2008-hwcd - // Cost: 4M + 4S + 1*a + 6add + 1*2. - double() { - const { a } = CURVE; - const { X: X1, Y: Y1, Z: Z1 } = this; - const A = modP(X1 * X1); // A = X12 - const B = modP(Y1 * Y1); // B = Y12 - const C = modP(_2n * modP(Z1 * Z1)); // C = 2*Z12 - const D = modP(a * A); // D = a*A - const x1y1 = X1 + Y1; - const E = modP(modP(x1y1 * x1y1) - A - B); // E = (X1+Y1)2-A-B - const G = D + B; // G = D+B - const F = G - C; // F = G-C - const H = D - B; // H = D-B - const X3 = modP(E * F); // X3 = E*F - const Y3 = modP(G * H); // Y3 = G*H - const T3 = modP(E * H); // T3 = E*H - const Z3 = modP(F * G); // Z3 = F*G - return new Point(X3, Y3, Z3, T3); - } - // Fast algo for adding 2 Extended Points. - // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-add-2008-hwcd - // Cost: 9M + 1*a + 1*d + 7add. - add(other) { - aextpoint(other); - const { a, d } = CURVE; - const { X: X1, Y: Y1, Z: Z1, T: T1 } = this; - const { X: X2, Y: Y2, Z: Z2, T: T2 } = other; - const A = modP(X1 * X2); // A = X1*X2 - const B = modP(Y1 * Y2); // B = Y1*Y2 - const C = modP(T1 * d * T2); // C = T1*d*T2 - const D = modP(Z1 * Z2); // D = Z1*Z2 - const E = modP((X1 + Y1) * (X2 + Y2) - A - B); // E = (X1+Y1)*(X2+Y2)-A-B - const F = D - C; // F = D-C - const G = D + C; // G = D+C - const H = modP(B - a * A); // H = B-a*A - const X3 = modP(E * F); // X3 = E*F - const Y3 = modP(G * H); // Y3 = G*H - const T3 = modP(E * H); // T3 = E*H - const Z3 = modP(F * G); // Z3 = F*G - return new Point(X3, Y3, Z3, T3); - } - subtract(other) { - return this.add(other.negate()); - } - // Constant-time multiplication. - multiply(scalar) { - // 1 <= scalar < L - if (!Fn.isValidNot0(scalar)) - throw new Error('invalid scalar: expected 1 <= sc < curve.n'); - const { p, f } = wnaf.cached(this, scalar, (p) => normalizeZ(Point, p)); - return normalizeZ(Point, [p, f])[0]; - } - // Non-constant-time multiplication. Uses double-and-add algorithm. - // It's faster, but should only be used when you don't care about - // an exposed private key e.g. sig verification. - // Does NOT allow scalars higher than CURVE.n. - // Accepts optional accumulator to merge with multiply (important for sparse scalars) - multiplyUnsafe(scalar, acc = Point.ZERO) { - // 0 <= scalar < L - if (!Fn.isValid(scalar)) - throw new Error('invalid scalar: expected 0 <= sc < curve.n'); - if (scalar === _0n) - return Point.ZERO; - if (this.is0() || scalar === _1n) - return this; - return wnaf.unsafe(this, scalar, (p) => normalizeZ(Point, p), acc); - } - // Checks if point is of small order. - // If you add something to small order point, you will have "dirty" - // point with torsion component. - // Multiplies point by cofactor and checks if the result is 0. - isSmallOrder() { - return this.multiplyUnsafe(cofactor).is0(); - } - // Multiplies point by curve order and checks if the result is 0. - // Returns `false` is the point is dirty. - isTorsionFree() { - return wnaf.unsafe(this, CURVE.n).is0(); - } - // Converts Extended point to default (x, y) coordinates. - // Can accept precomputed Z^-1 - for example, from invertBatch. - toAffine(invertedZ) { - return toAffineMemo(this, invertedZ); - } - clearCofactor() { - if (cofactor === _1n) - return this; - return this.multiplyUnsafe(cofactor); - } - toBytes() { - const { x, y } = this.toAffine(); - // Fp.toBytes() allows non-canonical encoding of y (>= p). - const bytes = Fp.toBytes(y); - // Each y has 2 valid points: (x, y), (x,-y). - // When compressing, it's enough to store y and use the last byte to encode sign of x - bytes[bytes.length - 1] |= x & _1n ? 0x80 : 0; - return bytes; - } - toHex() { - return bytesToHex(this.toBytes()); - } - toString() { - return ``; - } - // TODO: remove - get ex() { - return this.X; - } - get ey() { - return this.Y; - } - get ez() { - return this.Z; - } - get et() { - return this.T; - } - static normalizeZ(points) { - return normalizeZ(Point, points); - } - static msm(points, scalars) { - return pippenger(Point, Fn, points, scalars); - } - _setWindowSize(windowSize) { - this.precompute(windowSize); - } - toRawBytes() { - return this.toBytes(); - } - } - // base / generator point - Point.BASE = new Point(CURVE.Gx, CURVE.Gy, _1n, modP(CURVE.Gx * CURVE.Gy)); - // zero / infinity / identity point - Point.ZERO = new Point(_0n, _1n, _1n, _0n); // 0, 1, 1, 0 - // math field - Point.Fp = Fp; - // scalar field - Point.Fn = Fn; - const wnaf = new wNAF(Point, Fn.BITS); - Point.BASE.precompute(8); // Enable precomputes. Slows down first publicKey computation by 20ms. - return Point; -} -/** - * Base class for prime-order points like Ristretto255 and Decaf448. - * These points eliminate cofactor issues by representing equivalence classes - * of Edwards curve points. - */ -export class PrimeEdwardsPoint { - constructor(ep) { - this.ep = ep; - } - // Static methods that must be implemented by subclasses - static fromBytes(_bytes) { - notImplemented(); - } - static fromHex(_hex) { - notImplemented(); - } - get x() { - return this.toAffine().x; - } - get y() { - return this.toAffine().y; - } - // Common implementations - clearCofactor() { - // no-op for prime-order groups - return this; - } - assertValidity() { - this.ep.assertValidity(); - } - toAffine(invertedZ) { - return this.ep.toAffine(invertedZ); - } - toHex() { - return bytesToHex(this.toBytes()); - } - toString() { - return this.toHex(); - } - isTorsionFree() { - return true; - } - isSmallOrder() { - return false; - } - add(other) { - this.assertSame(other); - return this.init(this.ep.add(other.ep)); - } - subtract(other) { - this.assertSame(other); - return this.init(this.ep.subtract(other.ep)); - } - multiply(scalar) { - return this.init(this.ep.multiply(scalar)); - } - multiplyUnsafe(scalar) { - return this.init(this.ep.multiplyUnsafe(scalar)); - } - double() { - return this.init(this.ep.double()); - } - negate() { - return this.init(this.ep.negate()); - } - precompute(windowSize, isLazy) { - return this.init(this.ep.precompute(windowSize, isLazy)); - } - /** @deprecated use `toBytes` */ - toRawBytes() { - return this.toBytes(); - } -} -/** - * Initializes EdDSA signatures over given Edwards curve. - */ -export function eddsa(Point, cHash, eddsaOpts = {}) { - if (typeof cHash !== 'function') - throw new Error('"hash" function param is required'); - _validateObject(eddsaOpts, {}, { - adjustScalarBytes: 'function', - randomBytes: 'function', - domain: 'function', - prehash: 'function', - mapToCurve: 'function', - }); - const { prehash } = eddsaOpts; - const { BASE, Fp, Fn } = Point; - const randomBytes = eddsaOpts.randomBytes || randomBytesWeb; - const adjustScalarBytes = eddsaOpts.adjustScalarBytes || ((bytes) => bytes); - const domain = eddsaOpts.domain || - ((data, ctx, phflag) => { - abool(phflag, 'phflag'); - if (ctx.length || phflag) - throw new Error('Contexts/pre-hash are not supported'); - return data; - }); // NOOP - // Little-endian SHA512 with modulo n - function modN_LE(hash) { - return Fn.create(bytesToNumberLE(hash)); // Not Fn.fromBytes: it has length limit - } - // Get the hashed private scalar per RFC8032 5.1.5 - function getPrivateScalar(key) { - const len = lengths.secretKey; - key = ensureBytes('private key', key, len); - // Hash private key with curve's hash function to produce uniformingly random input - // Check byte lengths: ensure(64, h(ensure(32, key))) - const hashed = ensureBytes('hashed private key', cHash(key), 2 * len); - const head = adjustScalarBytes(hashed.slice(0, len)); // clear first half bits, produce FE - const prefix = hashed.slice(len, 2 * len); // second half is called key prefix (5.1.6) - const scalar = modN_LE(head); // The actual private scalar - return { head, prefix, scalar }; - } - /** Convenience method that creates public key from scalar. RFC8032 5.1.5 */ - function getExtendedPublicKey(secretKey) { - const { head, prefix, scalar } = getPrivateScalar(secretKey); - const point = BASE.multiply(scalar); // Point on Edwards curve aka public key - const pointBytes = point.toBytes(); - return { head, prefix, scalar, point, pointBytes }; - } - /** Calculates EdDSA pub key. RFC8032 5.1.5. */ - function getPublicKey(secretKey) { - return getExtendedPublicKey(secretKey).pointBytes; - } - // int('LE', SHA512(dom2(F, C) || msgs)) mod N - function hashDomainToScalar(context = Uint8Array.of(), ...msgs) { - const msg = concatBytes(...msgs); - return modN_LE(cHash(domain(msg, ensureBytes('context', context), !!prehash))); - } - /** Signs message with privateKey. RFC8032 5.1.6 */ - function sign(msg, secretKey, options = {}) { - msg = ensureBytes('message', msg); - if (prehash) - msg = prehash(msg); // for ed25519ph etc. - const { prefix, scalar, pointBytes } = getExtendedPublicKey(secretKey); - const r = hashDomainToScalar(options.context, prefix, msg); // r = dom2(F, C) || prefix || PH(M) - const R = BASE.multiply(r).toBytes(); // R = rG - const k = hashDomainToScalar(options.context, R, pointBytes, msg); // R || A || PH(M) - const s = Fn.create(r + k * scalar); // S = (r + k * s) mod L - if (!Fn.isValid(s)) - throw new Error('sign failed: invalid s'); // 0 <= s < L - const rs = concatBytes(R, Fn.toBytes(s)); - return abytes(rs, lengths.signature, 'result'); - } - // verification rule is either zip215 or rfc8032 / nist186-5. Consult fromHex: - const verifyOpts = { zip215: true }; - /** - * Verifies EdDSA signature against message and public key. RFC8032 5.1.7. - * An extended group equation is checked. - */ - function verify(sig, msg, publicKey, options = verifyOpts) { - const { context, zip215 } = options; - const len = lengths.signature; - sig = ensureBytes('signature', sig, len); - msg = ensureBytes('message', msg); - publicKey = ensureBytes('publicKey', publicKey, lengths.publicKey); - if (zip215 !== undefined) - abool(zip215, 'zip215'); - if (prehash) - msg = prehash(msg); // for ed25519ph, etc - const mid = len / 2; - const r = sig.subarray(0, mid); - const s = bytesToNumberLE(sig.subarray(mid, len)); - let A, R, SB; - try { - // zip215=true is good for consensus-critical apps. =false follows RFC8032 / NIST186-5. - // zip215=true: 0 <= y < MASK (2^256 for ed25519) - // zip215=false: 0 <= y < P (2^255-19 for ed25519) - A = Point.fromBytes(publicKey, zip215); - R = Point.fromBytes(r, zip215); - SB = BASE.multiplyUnsafe(s); // 0 <= s < l is done inside - } - catch (error) { - return false; - } - if (!zip215 && A.isSmallOrder()) - return false; // zip215 allows public keys of small order - const k = hashDomainToScalar(context, R.toBytes(), A.toBytes(), msg); - const RkA = R.add(A.multiplyUnsafe(k)); - // Extended group equation - // [8][S]B = [8]R + [8][k]A' - return RkA.subtract(SB).clearCofactor().is0(); - } - const _size = Fp.BYTES; // 32 for ed25519, 57 for ed448 - const lengths = { - secretKey: _size, - publicKey: _size, - signature: 2 * _size, - seed: _size, - }; - function randomSecretKey(seed = randomBytes(lengths.seed)) { - return abytes(seed, lengths.seed, 'seed'); - } - function keygen(seed) { - const secretKey = utils.randomSecretKey(seed); - return { secretKey, publicKey: getPublicKey(secretKey) }; - } - function isValidSecretKey(key) { - return isBytes(key) && key.length === Fn.BYTES; - } - function isValidPublicKey(key, zip215) { - try { - return !!Point.fromBytes(key, zip215); - } - catch (error) { - return false; - } - } - const utils = { - getExtendedPublicKey, - randomSecretKey, - isValidSecretKey, - isValidPublicKey, - /** - * Converts ed public key to x public key. Uses formula: - * - ed25519: - * - `(u, v) = ((1+y)/(1-y), sqrt(-486664)*u/x)` - * - `(x, y) = (sqrt(-486664)*u/v, (u-1)/(u+1))` - * - ed448: - * - `(u, v) = ((y-1)/(y+1), sqrt(156324)*u/x)` - * - `(x, y) = (sqrt(156324)*u/v, (1+u)/(1-u))` - */ - toMontgomery(publicKey) { - const { y } = Point.fromBytes(publicKey); - const size = lengths.publicKey; - const is25519 = size === 32; - if (!is25519 && size !== 57) - throw new Error('only defined for 25519 and 448'); - const u = is25519 ? Fp.div(_1n + y, _1n - y) : Fp.div(y - _1n, y + _1n); - return Fp.toBytes(u); - }, - toMontgomerySecret(secretKey) { - const size = lengths.secretKey; - abytes(secretKey, size); - const hashed = cHash(secretKey.subarray(0, size)); - return adjustScalarBytes(hashed).subarray(0, size); - }, - /** @deprecated */ - randomPrivateKey: randomSecretKey, - /** @deprecated */ - precompute(windowSize = 8, point = Point.BASE) { - return point.precompute(windowSize, false); - }, - }; - return Object.freeze({ - keygen, - getPublicKey, - sign, - verify, - utils, - Point, - lengths, - }); -} -function _eddsa_legacy_opts_to_new(c) { - const CURVE = { - a: c.a, - d: c.d, - p: c.Fp.ORDER, - n: c.n, - h: c.h, - Gx: c.Gx, - Gy: c.Gy, - }; - const Fp = c.Fp; - const Fn = Field(CURVE.n, c.nBitLength, true); - const curveOpts = { Fp, Fn, uvRatio: c.uvRatio }; - const eddsaOpts = { - randomBytes: c.randomBytes, - adjustScalarBytes: c.adjustScalarBytes, - domain: c.domain, - prehash: c.prehash, - mapToCurve: c.mapToCurve, - }; - return { CURVE, curveOpts, hash: c.hash, eddsaOpts }; -} -function _eddsa_new_output_to_legacy(c, eddsa) { - const Point = eddsa.Point; - const legacy = Object.assign({}, eddsa, { - ExtendedPoint: Point, - CURVE: c, - nBitLength: Point.Fn.BITS, - nByteLength: Point.Fn.BYTES, - }); - return legacy; -} -// TODO: remove. Use eddsa -export function twistedEdwards(c) { - const { CURVE, curveOpts, hash, eddsaOpts } = _eddsa_legacy_opts_to_new(c); - const Point = edwards(CURVE, curveOpts); - const EDDSA = eddsa(Point, hash, eddsaOpts); - return _eddsa_new_output_to_legacy(c, EDDSA); -} -//# sourceMappingURL=edwards.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/edwards.js.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/edwards.js.map deleted file mode 100644 index 894db208..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/edwards.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"edwards.js","sourceRoot":"","sources":["../../src/abstract/edwards.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,sEAAsE;AACtE,OAAO,EACL,eAAe,EACf,OAAO,IAAI,KAAK,EAChB,QAAQ,IAAI,MAAM,EAClB,QAAQ,EACR,UAAU,EACV,eAAe,EACf,WAAW,EACX,SAAS,EACT,WAAW,EACX,OAAO,EACP,QAAQ,EACR,cAAc,EACd,WAAW,IAAI,cAAc,GAG9B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,kBAAkB,EAClB,UAAU,EACV,SAAS,EACT,IAAI,GAML,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,KAAK,EAA6B,MAAM,cAAc,CAAC;AAEhE,qEAAqE;AACrE,kBAAkB;AAClB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AA8JzE,SAAS,WAAW,CAAC,EAAkB,EAAE,KAAkB,EAAE,CAAS,EAAE,CAAS;IAC/E,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACrB,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACrB,MAAM,IAAI,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAC7C,MAAM,KAAK,GAAG,EAAE,CAAC,G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AAI,EAAE,SAAS,EAAE,GAAG,yBAAyB,CAAC,CAAC,CAAC,CAAC;IAC3E,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IACxC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;IAC5C,OAAO,2BAA2B,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AAC/C,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/fft.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/fft.d.ts deleted file mode 100644 index e1334ccb..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/fft.d.ts +++ /dev/null @@ -1,122 +0,0 @@ -/** - * Experimental implementation of NTT / FFT (Fast Fourier Transform) over finite fields. - * API may change at any time. The code has not been audited. Feature requests are welcome. - * @module - */ -import type { IField } from './modular.ts'; -export interface MutableArrayLike { - [index: number]: T; - length: number; - slice(start?: number, end?: number): this; - [Symbol.iterator](): Iterator; -} -/** Checks if integer is in form of `1 << X` */ -export declare function isPowerOfTwo(x: number): boolean; -export declare function nextPowerOfTwo(n: number): number; -export declare function reverseBits(n: number, bits: number): number; -/** Similar to `bitLen(x)-1` but much faster for small integers, like indices */ -export declare function log2(n: number): number; -/** - * Moves lowest bit to highest position, which at first step splits - * array on even and odd indices, then it applied again to each part, - * which is core of fft - */ -export declare function bitReversalInplace>(values: T): T; -export declare function bitReversalPermutation(values: T[]): T[]; -export type RootsOfUnity = { - roots: (bits: number) => bigint[]; - brp(bits: number): bigint[]; - inverse(bits: number): bigint[]; - omega: (bits: number) => bigint; - clear: () => void; -}; -/** We limit roots up to 2**31, which is a lot: 2-billion polynomimal should be rare. */ -export declare function rootsOfUnity(field: IField, generator?: bigint): RootsOfUnity; -export type Polynomial = MutableArrayLike; -/** - * Maps great to Field, but not to Group (EC points): - * - inv from scalar field - * - we need multiplyUnsafe here, instead of multiply for speed - * - multiplyUnsafe is safe in the context: we do mul(rootsOfUnity), which are public and sparse - */ -export type FFTOpts = { - add: (a: T, b: T) => T; - sub: (a: T, b: T) => T; - mul: (a: T, scalar: R) => T; - inv: (a: R) => R; -}; -export type FFTCoreOpts = { - N: number; - roots: Polynomial; - dit: boolean; - invertButterflies?: boolean; - skipStages?: number; - brp?: boolean; -}; -export type FFTCoreLoop =

>(values: P) => P; -/** - * Constructs different flavors of FFT. radix2 implementation of low level mutating API. Flavors: - * - * - DIT (Decimation-in-Time): Bottom-Up (leaves -> root), Cool-Turkey - * - DIF (Decimation-in-Frequency): Top-Down (root -> leaves), Gentleman–Sande - * - * DIT takes brp input, returns natural output. - * DIF takes natural input, returns brp output. - * - * The output is actually identical. Time / frequence distinction is not meaningful - * for Polynomial multiplication in fields. - * Which means if protocol supports/needs brp output/inputs, then we can skip this step. - * - * Cyclic NTT: Rq = Zq[x]/(x^n-1). butterfly_DIT+loop_DIT OR butterfly_DIF+loop_DIT, roots are omega - * Negacyclic NTT: Rq = Zq[x]/(x^n+1). butterfly_DIT+loop_DIF, at least for mlkem / mldsa - */ -export declare const FFTCore: (F: FFTOpts, coreOpts: FFTCoreOpts) => FFTCoreLoop; -export type FFTMethods = { - direct

>(values: P, brpInput?: boolean, brpOutput?: boolean): P; - inverse

>(values: P, brpInput?: boolean, brpOutput?: boolean): P; -}; -/** - * NTT aka FFT over finite field (NOT over complex numbers). - * Naming mirrors other libraries. - */ -export declare function FFT(roots: RootsOfUnity, opts: FFTOpts): FFTMethods; -export type CreatePolyFn

, T> = (len: number, elm?: T) => P; -export type PolyFn

, T> = { - roots: RootsOfUnity; - create: CreatePolyFn; - length?: number; - degree: (a: P) => number; - extend: (a: P, len: number) => P; - add: (a: P, b: P) => P; - sub: (a: P, b: P) => P; - mul: (a: P, b: P | T) => P; - dot: (a: P, b: P) => P; - convolve: (a: P, b: P) => P; - shift: (p: P, factor: bigint) => P; - clone: (a: P) => P; - eval: (a: P, basis: P) => T; - monomial: { - basis: (x: T, n: number) => P; - eval: (a: P, x: T) => T; - }; - lagrange: { - basis: (x: T, n: number, brp?: boolean) => P; - eval: (a: P, x: T, brp?: boolean) => T; - }; - vanishing: (roots: P) => P; -}; -/** - * Poly wants a cracker. - * - * Polynomials are functions like `y=f(x)`, which means when we multiply two polynomials, result is - * function `f3(x) = f1(x) * f2(x)`, we don't multiply values. Key takeaways: - * - * - **Polynomial** is an array of coefficients: `f(x) = sum(coeff[i] * basis[i](x))` - * - **Basis** is array of functions - * - **Monominal** is Polynomial where `basis[i](x) == x**i` (powers) - * - **Array size** is domain size - * - **Lattice** is matrix (Polynomial of Polynomials) - */ -export declare function poly(field: IField, roots: RootsOfUnity, create?: undefined, fft?: FFTMethods, length?: number): PolyFn; -export declare function poly>(field: IField, roots: RootsOfUnity, create: CreatePolyFn, fft?: FFTMethods, length?: number): PolyFn; -//# sourceMappingURL=fft.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/fft.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/fft.d.ts.map deleted file mode 100644 index 6e644df2..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/fft.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fft.d.ts","sourceRoot":"","sources":["../../src/abstract/fft.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC;CAClC;AASD,+CAA+C;AA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/fft.js b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/fft.js deleted file mode 100644 index 6fc9eafb..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/fft.js +++ /dev/null @@ -1,425 +0,0 @@ -function checkU32(n) { - // 0xff_ff_ff_ff - if (!Number.isSafeInteger(n) || n < 0 || n > 0xffffffff) - throw new Error('wrong u32 integer:' + n); - return n; -} -/** Checks if integer is in form of `1 << X` */ -export function isPowerOfTwo(x) { - checkU32(x); - return (x & (x - 1)) === 0 && x !== 0; -} -export function nextPowerOfTwo(n) { - checkU32(n); - if (n <= 1) - return 1; - return (1 << (log2(n - 1) + 1)) >>> 0; -} -export function reverseBits(n, bits) { - checkU32(n); - let reversed = 0; - for (let i = 0; i < bits; i++, n >>>= 1) - reversed = (reversed << 1) | (n & 1); - return reversed; -} -/** Similar to `bitLen(x)-1` but much faster for small integers, like indices */ -export function log2(n) { - checkU32(n); - return 31 - Math.clz32(n); -} -/** - * Moves lowest bit to highest position, which at first step splits - * array on even and odd indices, then it applied again to each part, - * which is core of fft - */ -export function bitReversalInplace(values) { - const n = values.length; - if (n < 2 || !isPowerOfTwo(n)) - throw new Error('n must be a power of 2 and greater than 1. Got ' + n); - const bits = log2(n); - for (let i = 0; i < n; i++) { - const j = reverseBits(i, bits); - if (i < j) { - const tmp = values[i]; - values[i] = values[j]; - values[j] = tmp; - } - } - return values; -} -export function bitReversalPermutation(values) { - return bitReversalInplace(values.slice()); -} -const _1n = /** @__PURE__ */ BigInt(1); -function findGenerator(field) { - let G = BigInt(2); - for (; field.eql(field.pow(G, field.ORDER >> _1n), field.ONE); G++) - ; - return G; -} -/** We limit roots up to 2**31, which is a lot: 2-billion polynomimal should be rare. */ -export function rootsOfUnity(field, generator) { - // Factor field.ORDER-1 as oddFactor * 2^powerOfTwo - let oddFactor = field.ORDER - _1n; - let powerOfTwo = 0; - for (; (oddFactor & _1n) !== _1n; powerOfTwo++, oddFactor >>= _1n) - ; - // Find non quadratic residue - let G = generator !== undefined ? BigInt(generator) : findGenerator(field); - // Powers of generator - const omegas = new Array(powerOfTwo + 1); - omegas[powerOfTwo] = field.pow(G, oddFactor); - for (let i = powerOfTwo; i > 0; i--) - omegas[i - 1] = field.sqr(omegas[i]); - // Compute all roots of unity for powers up to maxPower - const rootsCache = []; - const checkBits = (bits) => { - checkU32(bits); - if (bits > 31 || bits > powerOfTwo) - throw new Error('rootsOfUnity: wrong bits ' + bits + ' powerOfTwo=' + powerOfTwo); - return bits; - }; - const precomputeRoots = (maxPower) => { - checkBits(maxPower); - for (let power = maxPower; power >= 0; power--) { - if (rootsCache[power]) - continue; // Skip if we've already computed roots for this power - const rootsAtPower = []; - for (let j = 0, cur = field.ONE; j < 2 ** power; j++, cur = field.mul(cur, omegas[power])) - rootsAtPower.push(cur); - rootsCache[power] = rootsAtPower; - } - return rootsCache[maxPower]; - }; - const brpCache = new Map(); - const inverseCache = new Map(); - // NOTE: we use bits instead of power, because power = 2**bits, - // but power is not neccesary isPowerOfTwo(power)! - return { - roots: (bits) => { - const b = checkBits(bits); - return precomputeRoots(b); - }, - brp(bits) { - const b = checkBits(bits); - if (brpCache.has(b)) - return brpCache.get(b); - else { - const res = bitReversalPermutation(this.roots(b)); - brpCache.set(b, res); - return res; - } - }, - inverse(bits) { - const b = checkBits(bits); - if (inverseCache.has(b)) - return inverseCache.get(b); - else { - const res = field.invertBatch(this.roots(b)); - inverseCache.set(b, res); - return res; - } - }, - omega: (bits) => omegas[checkBits(bits)], - clear: () => { - rootsCache.splice(0, rootsCache.length); - brpCache.clear(); - }, - }; -} -/** - * Constructs different flavors of FFT. radix2 implementation of low level mutating API. Flavors: - * - * - DIT (Decimation-in-Time): Bottom-Up (leaves -> root), Cool-Turkey - * - DIF (Decimation-in-Frequency): Top-Down (root -> leaves), Gentleman–Sande - * - * DIT takes brp input, returns natural output. - * DIF takes natural input, returns brp output. - * - * The output is actually identical. Time / frequence distinction is not meaningful - * for Polynomial multiplication in fields. - * Which means if protocol supports/needs brp output/inputs, then we can skip this step. - * - * Cyclic NTT: Rq = Zq[x]/(x^n-1). butterfly_DIT+loop_DIT OR butterfly_DIF+loop_DIT, roots are omega - * Negacyclic NTT: Rq = Zq[x]/(x^n+1). butterfly_DIT+loop_DIF, at least for mlkem / mldsa - */ -export const FFTCore = (F, coreOpts) => { - const { N, roots, dit, invertButterflies = false, skipStages = 0, brp = true } = coreOpts; - const bits = log2(N); - if (!isPowerOfTwo(N)) - throw new Error('FFT: Polynomial size should be power of two'); - const isDit = dit !== invertButterflies; - isDit; - return (values) => { - if (values.length !== N) - throw new Error('FFT: wrong Polynomial length'); - if (dit && brp) - bitReversalInplace(values); - for (let i = 0, g = 1; i < bits - skipStages; i++) { - // For each stage s (sub-FFT length m = 2^s) - const s = dit ? i + 1 + skipStages : bits - i; - const m = 1 << s; - const m2 = m >> 1; - const stride = N >> s; - // Loop over each subarray of length m - for (let k = 0; k < N; k += m) { - // Loop over each butterfly within the subarray - for (let j = 0, grp = g++; j < m2; j++) { - const rootPos = invertButterflies ? (dit ? N - grp : grp) : j * stride; - const i0 = k + j; - const i1 = k + j + m2; - const omega = roots[rootPos]; - const b = values[i1]; - const a = values[i0]; - // Inlining gives us 10% perf in kyber vs functions - if (isDit) { - const t = F.mul(b, omega); // Standard DIT butterfly - values[i0] = F.add(a, t); - values[i1] = F.sub(a, t); - } - else if (invertButterflies) { - values[i0] = F.add(b, a); // DIT loop + inverted butterflies (Kyber decode) - values[i1] = F.mul(F.sub(b, a), omega); - } - else { - values[i0] = F.add(a, b); // Standard DIF butterfly - values[i1] = F.mul(F.sub(a, b), omega); - } - } - } - } - if (!dit && brp) - bitReversalInplace(values); - return values; - }; -}; -/** - * NTT aka FFT over finite field (NOT over complex numbers). - * Naming mirrors other libraries. - */ -export function FFT(roots, opts) { - const getLoop = (N, roots, brpInput = false, brpOutput = false) => { - if (brpInput && brpOutput) { - // we cannot optimize this case, but lets support it anyway - return (values) => FFTCore(opts, { N, roots, dit: false, brp: false })(bitReversalInplace(values)); - } - if (brpInput) - return FFTCore(opts, { N, roots, dit: true, brp: false }); - if (brpOutput) - return FFTCore(opts, { N, roots, dit: false, brp: false }); - return FFTCore(opts, { N, roots, dit: true, brp: true }); // all natural - }; - return { - direct(values, brpInput = false, brpOutput = false) { - const N = values.length; - if (!isPowerOfTwo(N)) - throw new Error('FFT: Polynomial size should be power of two'); - const bits = log2(N); - return getLoop(N, roots.roots(bits), brpInput, brpOutput)(values.slice()); - }, - inverse(values, brpInput = false, brpOutput = false) { - const N = values.length; - const bits = log2(N); - const res = getLoop(N, roots.inverse(bits), brpInput, brpOutput)(values.slice()); - const ivm = opts.inv(BigInt(values.length)); // scale - // we can get brp output if we use dif instead of dit! - for (let i = 0; i < res.length; i++) - res[i] = opts.mul(res[i], ivm); - // Allows to re-use non-inverted roots, but is VERY fragile - // return [res[0]].concat(res.slice(1).reverse()); - // inverse calculated as pow(-1), which transforms into ω^{-kn} (-> reverses indices) - return res; - }, - }; -} -export function poly(field, roots, create, fft, length) { - const F = field; - const _create = create || - ((len, elm) => new Array(len).fill(elm ?? F.ZERO)); - const isPoly = (x) => Array.isArray(x) || ArrayBuffer.isView(x); - const checkLength = (...lst) => { - if (!lst.length) - return 0; - for (const i of lst) - if (!isPoly(i)) - throw new Error('poly: not polynomial: ' + i); - const L = lst[0].length; - for (let i = 1; i < lst.length; i++) - if (lst[i].length !== L) - throw new Error(`poly: mismatched lengths ${L} vs ${lst[i].length}`); - if (length !== undefined && L !== length) - throw new Error(`poly: expected fixed length ${length}, got ${L}`); - return L; - }; - function findOmegaIndex(x, n, brp = false) { - const bits = log2(n); - const omega = brp ? roots.brp(bits) : roots.roots(bits); - for (let i = 0; i < n; i++) - if (F.eql(x, omega[i])) - return i; - return -1; - } - // TODO: mutating versions for mlkem/mldsa - return { - roots, - create: _create, - length, - extend: (a, len) => { - checkLength(a); - const out = _create(len, F.ZERO); - for (let i = 0; i < a.length; i++) - out[i] = a[i]; - return out; - }, - degree: (a) => { - checkLength(a); - for (let i = a.length - 1; i >= 0; i--) - if (!F.is0(a[i])) - return i; - return -1; - }, - add: (a, b) => { - const len = checkLength(a, b); - const out = _create(len); - for (let i = 0; i < len; i++) - out[i] = F.add(a[i], b[i]); - return out; - }, - sub: (a, b) => { - const len = checkLength(a, b); - const out = _create(len); - for (let i = 0; i < len; i++) - out[i] = F.sub(a[i], b[i]); - return out; - }, - dot: (a, b) => { - const len = checkLength(a, b); - const out = _create(len); - for (let i = 0; i < len; i++) - out[i] = F.mul(a[i], b[i]); - return out; - }, - mul: (a, b) => { - if (isPoly(b)) { - const len = checkLength(a, b); - if (fft) { - const A = fft.direct(a, false, true); - const B = fft.direct(b, false, true); - for (let i = 0; i < A.length; i++) - A[i] = F.mul(A[i], B[i]); - return fft.inverse(A, true, false); - } - else { - // NOTE: this is quadratic and mostly for compat tests with FFT - const res = _create(len); - for (let i = 0; i < len; i++) { - for (let j = 0; j < len; j++) { - const k = (i + j) % len; // wrap mod length - res[k] = F.add(res[k], F.mul(a[i], b[j])); - } - } - return res; - } - } - else { - const out = _create(checkLength(a)); - for (let i = 0; i < out.length; i++) - out[i] = F.mul(a[i], b); - return out; - } - }, - convolve(a, b) { - const len = nextPowerOfTwo(a.length + b.length - 1); - return this.mul(this.extend(a, len), this.extend(b, len)); - }, - shift(p, factor) { - const out = _create(checkLength(p)); - out[0] = p[0]; - for (let i = 1, power = F.ONE; i < p.length; i++) { - power = F.mul(power, factor); - out[i] = F.mul(p[i], power); - } - return out; - }, - clone: (a) => { - checkLength(a); - const out = _create(a.length); - for (let i = 0; i < a.length; i++) - out[i] = a[i]; - return out; - }, - eval: (a, basis) => { - checkLength(a); - let acc = F.ZERO; - for (let i = 0; i < a.length; i++) - acc = F.add(acc, F.mul(a[i], basis[i])); - return acc; - }, - monomial: { - basis: (x, n) => { - const out = _create(n); - let pow = F.ONE; - for (let i = 0; i < n; i++) { - out[i] = pow; - pow = F.mul(pow, x); - } - return out; - }, - eval: (a, x) => { - checkLength(a); - // Same as eval(a, monomialBasis(x, a.length)), but it is faster this way - let acc = F.ZERO; - for (let i = a.length - 1; i >= 0; i--) - acc = F.add(F.mul(acc, x), a[i]); - return acc; - }, - }, - lagrange: { - basis: (x, n, brp = false, weights) => { - const bits = log2(n); - const cache = weights || brp ? roots.brp(bits) : roots.roots(bits); // [ω⁰, ω¹, ..., ωⁿ⁻¹] - const out = _create(n); - // Fast Kronecker-δ shortcut - const idx = findOmegaIndex(x, n, brp); - if (idx !== -1) { - out[idx] = F.ONE; - return out; - } - const tm = F.pow(x, BigInt(n)); - const c = F.mul(F.sub(tm, F.ONE), F.inv(BigInt(n))); // c = (xⁿ - 1)/n - const denom = _create(n); - for (let i = 0; i < n; i++) - denom[i] = F.sub(x, cache[i]); - const inv = F.invertBatch(denom); - for (let i = 0; i < n; i++) - out[i] = F.mul(c, F.mul(cache[i], inv[i])); - return out; - }, - eval(a, x, brp = false) { - checkLength(a); - const idx = findOmegaIndex(x, a.length, brp); - if (idx !== -1) - return a[idx]; // fast path - const L = this.basis(x, a.length, brp); // Lᵢ(x) - let acc = F.ZERO; - for (let i = 0; i < a.length; i++) - if (!F.is0(a[i])) - acc = F.add(acc, F.mul(a[i], L[i])); - return acc; - }, - }, - vanishing(roots) { - checkLength(roots); - const out = _create(roots.length + 1, F.ZERO); - out[0] = F.ONE; - for (const r of roots) { - const neg = F.neg(r); - for (let j = out.length - 1; j > 0; j--) - out[j] = F.add(F.mul(out[j], neg), out[j - 1]); - out[0] = F.mul(out[0], neg); - } - return out; - }, - }; -} -//# sourceMappingURL=fft.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/fft.js.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/fft.js.map deleted file mode 100644 index 8ee359db..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/fft.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fft.js","sourceRoot":"","sources":["../../src/abstract/fft.ts"],"names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C,CAAC;gBACrB,KAAK,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;oBAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBACxF,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;YAC9B,CAAC;YACD,OAAO,GAAG,CAAC;QACb,CAAC;KACF,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/hash-to-curve.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/hash-to-curve.d.ts deleted file mode 100644 index 2bc50717..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/hash-to-curve.d.ts +++ /dev/null @@ -1,102 +0,0 @@ -/** - * hash-to-curve from RFC 9380. - * Hashes arbitrary-length byte strings to a list of one or more elements of a finite field F. - * https://www.rfc-editor.org/rfc/rfc9380 - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import type { CHash } from '../utils.ts'; -import type { AffinePoint, Group, GroupConstructor } from './curve.ts'; -import { type IField } from './modular.ts'; -export type UnicodeOrBytes = string | Uint8Array; -/** - * * `DST` is a domain separation tag, defined in section 2.2.5 - * * `p` characteristic of F, where F is a finite field of characteristic p and order q = p^m - * * `m` is extension degree (1 for prime fields) - * * `k` is the target security target in bits (e.g. 128), from section 5.1 - * * `expand` is `xmd` (SHA2, SHA3, BLAKE) or `xof` (SHAKE, BLAKE-XOF) - * * `hash` conforming to `utils.CHash` interface, with `outputLen` / `blockLen` props - */ -export type H2COpts = { - DST: UnicodeOrBytes; - expand: 'xmd' | 'xof'; - hash: CHash; - p: bigint; - m: number; - k: number; -}; -export type H2CHashOpts = { - expand: 'xmd' | 'xof'; - hash: CHash; -}; -export type Opts = H2COpts; -/** - * Produces a uniformly random byte string using a cryptographic hash function H that outputs b bits. - * [RFC 9380 5.3.1](https://www.rfc-editor.org/rfc/rfc9380#section-5.3.1). - */ -export declare function expand_message_xmd(msg: Uint8Array, DST: UnicodeOrBytes, lenInBytes: number, H: CHash): Uint8Array; -/** - * Produces a uniformly random byte string using an extendable-output function (XOF) H. - * 1. The collision resistance of H MUST be at least k bits. - * 2. H MUST be an XOF that has been proved indifferentiable from - * a random oracle under a reasonable cryptographic assumption. - * [RFC 9380 5.3.2](https://www.rfc-editor.org/rfc/rfc9380#section-5.3.2). - */ -export declare function expand_message_xof(msg: Uint8Array, DST: UnicodeOrBytes, lenInBytes: number, k: number, H: CHash): Uint8Array; -/** - * Hashes arbitrary-length byte strings to a list of one or more elements of a finite field F. - * [RFC 9380 5.2](https://www.rfc-editor.org/rfc/rfc9380#section-5.2). - * @param msg a byte string containing the message to hash - * @param count the number of elements of F to output - * @param options `{DST: string, p: bigint, m: number, k: number, expand: 'xmd' | 'xof', hash: H}`, see above - * @returns [u_0, ..., u_(count - 1)], a list of field elements. - */ -export declare function hash_to_field(msg: Uint8Array, count: number, options: H2COpts): bigint[][]; -export type XY = (x: T, y: T) => { - x: T; - y: T; -}; -export type XYRatio = [T[], T[], T[], T[]]; -export declare function isogenyMap>(field: F, map: XYRatio): XY; -/** Point interface, which curves must implement to work correctly with the module. */ -export interface H2CPoint extends Group> { - add(rhs: H2CPoint): H2CPoint; - toAffine(iz?: bigint): AffinePoint; - clearCofactor(): H2CPoint; - assertValidity(): void; -} -export interface H2CPointConstructor extends GroupConstructor> { - fromAffine(ap: AffinePoint): H2CPoint; -} -export type MapToCurve = (scalar: bigint[]) => AffinePoint; -export type htfBasicOpts = { - DST: UnicodeOrBytes; -}; -export type H2CMethod = (msg: Uint8Array, options?: htfBasicOpts) => H2CPoint; -export type HTFMethod = H2CMethod; -export type MapMethod = (scalars: bigint[]) => H2CPoint; -export type H2CHasherBase = { - hashToCurve: H2CMethod; - hashToScalar: (msg: Uint8Array, options: htfBasicOpts) => bigint; -}; -/** - * RFC 9380 methods, with cofactor clearing. See https://www.rfc-editor.org/rfc/rfc9380#section-3. - * - * * hashToCurve: `map(hash(input))`, encodes RANDOM bytes to curve (WITH hashing) - * * encodeToCurve: `map(hash(input))`, encodes NON-UNIFORM bytes to curve (WITH hashing) - * * mapToCurve: `map(scalars)`, encodes NON-UNIFORM scalars to curve (NO hashing) - */ -export type H2CHasher = H2CHasherBase & { - encodeToCurve: H2CMethod; - mapToCurve: MapMethod; - defaults: H2COpts & { - encodeDST?: UnicodeOrBytes; - }; -}; -export type Hasher = H2CHasher; -export declare const _DST_scalar: Uint8Array; -/** Creates hash-to-curve methods from EC Point and mapToCurve function. See {@link H2CHasher}. */ -export declare function createHasher(Point: H2CPointConstructor, mapToCurve: MapToCurve, defaults: H2COpts & { - encodeDST?: UnicodeOrBytes; -}): H2CHasher; -//# sourceMappingURL=hash-to-curve.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/hash-to-curve.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/hash-to-curve.d.ts.map deleted file mode 100644 index e81d02a0..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/hash-to-curve.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hash-to-curve.d.ts","sourceRoot":"","sources":["../../src/abstract/hash-to-curve.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,sEAAsE;AACtE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAUzC,OAAO,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,EAAsB,KAAK,MAAM,EAAE,MAAM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CAAC,CAAC;AAC9D,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI;IAC7B,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IAC1B,YAAY,EAAE,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,KAAK,MAAM,CAAC;CAClE,CAAC;AACF;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,aAAa,CAAC,CAAC,CAAC,GAAG;IAC5C,aAAa,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IAC5B,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IACzB,QAAQ,EAAE,OAAO,GAAG;QAAE,SAAS,CAAC,EAAE,cAAc,CAAA;KAAE,CAAC;CACpD,CAAC;AAEF,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC;AAErC,eAAO,MAAM,WAAW,EAAE,UAAyC,CAAC;AAEpE,kGAAkG;AAClG,wBAAgB,YAAY,CAAC,CAAC,EAC5B,KAAK,EAAE,mBAAmB,CAAC,CAAC,CAAC,EAC7B,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,EACzB,QAAQ,EAAE,OAAO,GAAG;IAAE,SAAS,CAAC,EAAE,cAAc,CAAA;CAAE,GACjD,SAAS,CAAC,CAAC,CAAC,CA8Cd"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/hash-to-curve.js b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/hash-to-curve.js deleted file mode 100644 index d35388a9..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/hash-to-curve.js +++ /dev/null @@ -1,203 +0,0 @@ -import { _validateObject, abytes, bytesToNumberBE, concatBytes, isBytes, isHash, utf8ToBytes, } from "../utils.js"; -import { FpInvertBatch, mod } from "./modular.js"; -// Octet Stream to Integer. "spec" implementation of os2ip is 2.5x slower vs bytesToNumberBE. -const os2ip = bytesToNumberBE; -// Integer to Octet Stream (numberToBytesBE) -function i2osp(value, length) { - anum(value); - anum(length); - if (value < 0 || value >= 1 << (8 * length)) - throw new Error('invalid I2OSP input: ' + value); - const res = Array.from({ length }).fill(0); - for (let i = length - 1; i >= 0; i--) { - res[i] = value & 0xff; - value >>>= 8; - } - return new Uint8Array(res); -} -function strxor(a, b) { - const arr = new Uint8Array(a.length); - for (let i = 0; i < a.length; i++) { - arr[i] = a[i] ^ b[i]; - } - return arr; -} -function anum(item) { - if (!Number.isSafeInteger(item)) - throw new Error('number expected'); -} -function normDST(DST) { - if (!isBytes(DST) && typeof DST !== 'string') - throw new Error('DST must be Uint8Array or string'); - return typeof DST === 'string' ? utf8ToBytes(DST) : DST; -} -/** - * Produces a uniformly random byte string using a cryptographic hash function H that outputs b bits. - * [RFC 9380 5.3.1](https://www.rfc-editor.org/rfc/rfc9380#section-5.3.1). - */ -export function expand_message_xmd(msg, DST, lenInBytes, H) { - abytes(msg); - anum(lenInBytes); - DST = normDST(DST); - // https://www.rfc-editor.org/rfc/rfc9380#section-5.3.3 - if (DST.length > 255) - DST = H(concatBytes(utf8ToBytes('H2C-OVERSIZE-DST-'), DST)); - const { outputLen: b_in_bytes, blockLen: r_in_bytes } = H; - const ell = Math.ceil(lenInBytes / b_in_bytes); - if (lenInBytes > 65535 || ell > 255) - throw new Error('expand_message_xmd: invalid lenInBytes'); - const DST_prime = concatBytes(DST, i2osp(DST.length, 1)); - const Z_pad = i2osp(0, r_in_bytes); - const l_i_b_str = i2osp(lenInBytes, 2); // len_in_bytes_str - const b = new Array(ell); - const b_0 = H(concatBytes(Z_pad, msg, l_i_b_str, i2osp(0, 1), DST_prime)); - b[0] = H(concatBytes(b_0, i2osp(1, 1), DST_prime)); - for (let i = 1; i <= ell; i++) { - const args = [strxor(b_0, b[i - 1]), i2osp(i + 1, 1), DST_prime]; - b[i] = H(concatBytes(...args)); - } - const pseudo_random_bytes = concatBytes(...b); - return pseudo_random_bytes.slice(0, lenInBytes); -} -/** - * Produces a uniformly random byte string using an extendable-output function (XOF) H. - * 1. The collision resistance of H MUST be at least k bits. - * 2. H MUST be an XOF that has been proved indifferentiable from - * a random oracle under a reasonable cryptographic assumption. - * [RFC 9380 5.3.2](https://www.rfc-editor.org/rfc/rfc9380#section-5.3.2). - */ -export function expand_message_xof(msg, DST, lenInBytes, k, H) { - abytes(msg); - anum(lenInBytes); - DST = normDST(DST); - // https://www.rfc-editor.org/rfc/rfc9380#section-5.3.3 - // DST = H('H2C-OVERSIZE-DST-' || a_very_long_DST, Math.ceil((lenInBytes * k) / 8)); - if (DST.length > 255) { - const dkLen = Math.ceil((2 * k) / 8); - DST = H.create({ dkLen }).update(utf8ToBytes('H2C-OVERSIZE-DST-')).update(DST).digest(); - } - if (lenInBytes > 65535 || DST.length > 255) - throw new Error('expand_message_xof: invalid lenInBytes'); - return (H.create({ dkLen: lenInBytes }) - .update(msg) - .update(i2osp(lenInBytes, 2)) - // 2. DST_prime = DST || I2OSP(len(DST), 1) - .update(DST) - .update(i2osp(DST.length, 1)) - .digest()); -} -/** - * Hashes arbitrary-length byte strings to a list of one or more elements of a finite field F. - * [RFC 9380 5.2](https://www.rfc-editor.org/rfc/rfc9380#section-5.2). - * @param msg a byte string containing the message to hash - * @param count the number of elements of F to output - * @param options `{DST: string, p: bigint, m: number, k: number, expand: 'xmd' | 'xof', hash: H}`, see above - * @returns [u_0, ..., u_(count - 1)], a list of field elements. - */ -export function hash_to_field(msg, count, options) { - _validateObject(options, { - p: 'bigint', - m: 'number', - k: 'number', - hash: 'function', - }); - const { p, k, m, hash, expand, DST } = options; - if (!isHash(options.hash)) - throw new Error('expected valid hash'); - abytes(msg); - anum(count); - const log2p = p.toString(2).length; - const L = Math.ceil((log2p + k) / 8); // section 5.1 of ietf draft link above - const len_in_bytes = count * m * L; - let prb; // pseudo_random_bytes - if (expand === 'xmd') { - prb = expand_message_xmd(msg, DST, len_in_bytes, hash); - } - else if (expand === 'xof') { - prb = expand_message_xof(msg, DST, len_in_bytes, k, hash); - } - else if (expand === '_internal_pass') { - // for internal tests only - prb = msg; - } - else { - throw new Error('expand must be "xmd" or "xof"'); - } - const u = new Array(count); - for (let i = 0; i < count; i++) { - const e = new Array(m); - for (let j = 0; j < m; j++) { - const elm_offset = L * (j + i * m); - const tv = prb.subarray(elm_offset, elm_offset + L); - e[j] = mod(os2ip(tv), p); - } - u[i] = e; - } - return u; -} -export function isogenyMap(field, map) { - // Make same order as in spec - const coeff = map.map((i) => Array.from(i).reverse()); - return (x, y) => { - const [xn, xd, yn, yd] = coeff.map((val) => val.reduce((acc, i) => field.add(field.mul(acc, x), i))); - // 6.6.3 - // Exceptional cases of iso_map are inputs that cause the denominator of - // either rational function to evaluate to zero; such cases MUST return - // the identity point on E. - const [xd_inv, yd_inv] = FpInvertBatch(field, [xd, yd], true); - x = field.mul(xn, xd_inv); // xNum / xDen - y = field.mul(y, field.mul(yn, yd_inv)); // y * (yNum / yDev) - return { x, y }; - }; -} -export const _DST_scalar = utf8ToBytes('HashToScalar-'); -/** Creates hash-to-curve methods from EC Point and mapToCurve function. See {@link H2CHasher}. */ -export function createHasher(Point, mapToCurve, defaults) { - if (typeof mapToCurve !== 'function') - throw new Error('mapToCurve() must be defined'); - function map(num) { - return Point.fromAffine(mapToCurve(num)); - } - function clear(initial) { - const P = initial.clearCofactor(); - if (P.equals(Point.ZERO)) - return Point.ZERO; // zero will throw in assert - P.assertValidity(); - return P; - } - return { - defaults, - hashToCurve(msg, options) { - const opts = Object.assign({}, defaults, options); - const u = hash_to_field(msg, 2, opts); - const u0 = map(u[0]); - const u1 = map(u[1]); - return clear(u0.add(u1)); - }, - encodeToCurve(msg, options) { - const optsDst = defaults.encodeDST ? { DST: defaults.encodeDST } : {}; - const opts = Object.assign({}, defaults, optsDst, options); - const u = hash_to_field(msg, 1, opts); - const u0 = map(u[0]); - return clear(u0); - }, - /** See {@link H2CHasher} */ - mapToCurve(scalars) { - if (!Array.isArray(scalars)) - throw new Error('expected array of bigints'); - for (const i of scalars) - if (typeof i !== 'bigint') - throw new Error('expected array of bigints'); - return clear(map(scalars)); - }, - // hash_to_scalar can produce 0: https://www.rfc-editor.org/errata/eid8393 - // RFC 9380, draft-irtf-cfrg-bbs-signatures-08 - hashToScalar(msg, options) { - // @ts-ignore - const N = Point.Fn.ORDER; - const opts = Object.assign({}, defaults, { p: N, m: 1, DST: _DST_scalar }, options); - return hash_to_field(msg, 1, opts)[0][0]; - }, - }; -} -//# sourceMappingURL=hash-to-curve.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/hash-to-curve.js.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/hash-to-curve.js.map deleted file mode 100644 index b6d1f3d6..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/hash-to-curve.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hash-to-curve.js","sourceRoot":"","sources":["../../src/abstract/hash-to-curve.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,eAAe,EACf,MAAM,EACN,eAAe,EACf,WAAW,EACX,OAAO,EACP,MAAM,EACN,WAAW,GACZ,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,aAAa,EAAE,GAAG,EAAe,MAAM,cAAc,CAAC;AA2B/D,6FAA6F;AAC7F,MAAM,KAAK,GAAG,eAAe,CAAC;AAE9B,4CAA4C;AAC5C,SAAS,KAAK,CAAC,KAAa,EAAE,MAAc;IAC1C,IAAI,CAAC,KAAK,CAAC,CAAC;IACZ,IAAI,CAAC,MAAM,CAAC,CAAC;IACb,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,GAAG,KAAK,CAAC,CAAC;IAC9F,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAa,C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AAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;YAC1E,OAAO,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;QAC7B,CAAC;QAED,0EAA0E;QAC1E,8CAA8C;QAC9C,YAAY,CAAC,GAAe,EAAE,OAAsB;YAClD,aAAa;YACb,MAAM,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC;YACzB,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,WAAW,EAAE,EAAE,OAAO,CAAC,CAAC;YACpF,OAAO,aAAa,CAAC,GAAG,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3C,CAAC;KACF,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/modular.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/modular.d.ts deleted file mode 100644 index 3eb9892a..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/modular.d.ts +++ /dev/null @@ -1,171 +0,0 @@ -export declare function mod(a: bigint, b: bigint): bigint; -/** - * Efficiently raise num to power and do modular division. - * Unsafe in some contexts: uses ladder, so can expose bigint bits. - * @example - * pow(2n, 6n, 11n) // 64n % 11n == 9n - */ -export declare function pow(num: bigint, power: bigint, modulo: bigint): bigint; -/** Does `x^(2^power)` mod p. `pow2(30, 4)` == `30^(2^4)` */ -export declare function pow2(x: bigint, power: bigint, modulo: bigint): bigint; -/** - * Inverses number over modulo. - * Implemented using [Euclidean GCD](https://brilliant.org/wiki/extended-euclidean-algorithm/). - */ -export declare function invert(number: bigint, modulo: bigint): bigint; -/** - * Tonelli-Shanks square root search algorithm. - * 1. https://eprint.iacr.org/2012/685.pdf (page 12) - * 2. Square Roots from 1; 24, 51, 10 to Dan Shanks - * @param P field order - * @returns function that takes field Fp (created from P) and number n - */ -export declare function tonelliShanks(P: bigint): (Fp: IField, n: T) => T; -/** - * Square root for a finite field. Will try optimized versions first: - * - * 1. P ≡ 3 (mod 4) - * 2. P ≡ 5 (mod 8) - * 3. P ≡ 9 (mod 16) - * 4. Tonelli-Shanks algorithm - * - * Different algorithms can give different roots, it is up to user to decide which one they want. - * For example there is FpSqrtOdd/FpSqrtEven to choice root based on oddness (used for hash-to-curve). - */ -export declare function FpSqrt(P: bigint): (Fp: IField, n: T) => T; -export declare const isNegativeLE: (num: bigint, modulo: bigint) => boolean; -/** Field is not always over prime: for example, Fp2 has ORDER(q)=p^m. */ -export interface IField { - ORDER: bigint; - isLE: boolean; - BYTES: number; - BITS: number; - MASK: bigint; - ZERO: T; - ONE: T; - create: (num: T) => T; - isValid: (num: T) => boolean; - is0: (num: T) => boolean; - isValidNot0: (num: T) => boolean; - neg(num: T): T; - inv(num: T): T; - sqrt(num: T): T; - sqr(num: T): T; - eql(lhs: T, rhs: T): boolean; - add(lhs: T, rhs: T): T; - sub(lhs: T, rhs: T): T; - mul(lhs: T, rhs: T | bigint): T; - pow(lhs: T, power: bigint): T; - div(lhs: T, rhs: T | bigint): T; - addN(lhs: T, rhs: T): T; - subN(lhs: T, rhs: T): T; - mulN(lhs: T, rhs: T | bigint): T; - sqrN(num: T): T; - isOdd?(num: T): boolean; - allowedLengths?: number[]; - invertBatch: (lst: T[]) => T[]; - toBytes(num: T): Uint8Array; - fromBytes(bytes: Uint8Array, skipValidation?: boolean): T; - cmov(a: T, b: T, c: boolean): T; -} -export declare function validateField(field: IField): IField; -/** - * Same as `pow` but for Fp: non-constant-time. - * Unsafe in some contexts: uses ladder, so can expose bigint bits. - */ -export declare function FpPow(Fp: IField, num: T, power: bigint): T; -/** - * Efficiently invert an array of Field elements. - * Exception-free. Will return `undefined` for 0 elements. - * @param passZero map 0 to 0 (instead of undefined) - */ -export declare function FpInvertBatch(Fp: IField, nums: T[], passZero?: boolean): T[]; -export declare function FpDiv(Fp: IField, lhs: T, rhs: T | bigint): T; -/** - * Legendre symbol. - * Legendre constant is used to calculate Legendre symbol (a | p) - * which denotes the value of a^((p-1)/2) (mod p). - * - * * (a | p) ≡ 1 if a is a square (mod p), quadratic residue - * * (a | p) ≡ -1 if a is not a square (mod p), quadratic non residue - * * (a | p) ≡ 0 if a ≡ 0 (mod p) - */ -export declare function FpLegendre(Fp: IField, n: T): -1 | 0 | 1; -export declare function FpIsSquare(Fp: IField, n: T): boolean; -export type NLength = { - nByteLength: number; - nBitLength: number; -}; -export declare function nLength(n: bigint, nBitLength?: number): NLength; -type FpField = IField & Required, 'isOdd'>>; -type SqrtFn = (n: bigint) => bigint; -type FieldOpts = Partial<{ - sqrt: SqrtFn; - isLE: boolean; - BITS: number; - modFromBytes: boolean; - allowedLengths?: readonly number[]; -}>; -/** - * Creates a finite field. Major performance optimizations: - * * 1. Denormalized operations like mulN instead of mul. - * * 2. Identical object shape: never add or remove keys. - * * 3. `Object.freeze`. - * Fragile: always run a benchmark on a change. - * Security note: operations don't check 'isValid' for all elements for performance reasons, - * it is caller responsibility to check this. - * This is low-level code, please make sure you know what you're doing. - * - * Note about field properties: - * * CHARACTERISTIC p = prime number, number of elements in main subgroup. - * * ORDER q = similar to cofactor in curves, may be composite `q = p^m`. - * - * @param ORDER field order, probably prime, or could be composite - * @param bitLen how many bits the field consumes - * @param isLE (default: false) if encoding / decoding should be in little-endian - * @param redef optional faster redefinitions of sqrt and other methods - */ -export declare function Field(ORDER: bigint, bitLenOrOpts?: number | FieldOpts, // TODO: use opts only in v2? -isLE?: boolean, opts?: { - sqrt?: SqrtFn; -}): Readonly; -export declare function FpSqrtOdd(Fp: IField, elm: T): T; -export declare function FpSqrtEven(Fp: IField, elm: T): T; -/** - * "Constant-time" private key generation utility. - * Same as mapKeyToField, but accepts less bytes (40 instead of 48 for 32-byte field). - * Which makes it slightly more biased, less secure. - * @deprecated use `mapKeyToField` instead - */ -export declare function hashToPrivateScalar(hash: string | Uint8Array, groupOrder: bigint, isLE?: boolean): bigint; -/** - * Returns total number of bytes consumed by the field element. - * For example, 32 bytes for usual 256-bit weierstrass curve. - * @param fieldOrder number of field elements, usually CURVE.n - * @returns byte length of field - */ -export declare function getFieldBytesLength(fieldOrder: bigint): number; -/** - * Returns minimal amount of bytes that can be safely reduced - * by field order. - * Should be 2^-128 for 128-bit curve such as P256. - * @param fieldOrder number of field elements, usually CURVE.n - * @returns byte length of target hash - */ -export declare function getMinHashLength(fieldOrder: bigint): number; -/** - * "Constant-time" private key generation utility. - * Can take (n + n/2) or more bytes of uniform input e.g. from CSPRNG or KDF - * and convert them into private scalar, with the modulo bias being negligible. - * Needs at least 48 bytes of input for 32-byte private key. - * https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/ - * FIPS 186-5, A.2 https://csrc.nist.gov/publications/detail/fips/186/5/final - * RFC 9380, https://www.rfc-editor.org/rfc/rfc9380#section-5 - * @param hash hash output from SHA3 or a similar function - * @param groupOrder size of subgroup - (e.g. secp256k1.CURVE.n) - * @param isLE interpret hash bytes as LE num - * @returns valid private scalar - */ -export declare function mapHashToField(key: Uint8Array, fieldOrder: bigint, isLE?: boolean): Uint8Array; -export {}; -//# sourceMappingURL=modular.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/modular.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/modular.d.ts.map deleted file mode 100644 index 12754be3..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/modular.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"modular.d.ts","sourceRoot":"","sources":["../../src/abstract/modular.ts"],"names":[],"mappings":"AA0BA,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAGhD;AACD;;;;;GAKG;AACH,wBAAgB,GAAG,CAA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;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,UAAQ,GAAG,UAAU,CAW5F"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/modular.js b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/modular.js deleted file mode 100644 index 790a188b..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/modular.js +++ /dev/null @@ -1,530 +0,0 @@ -/** - * Utils for modular division and fields. - * Field over 11 is a finite (Galois) field is integer number operations `mod 11`. - * There is no division: it is replaced by modular multiplicative inverse. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { _validateObject, anumber, bitMask, bytesToNumberBE, bytesToNumberLE, ensureBytes, numberToBytesBE, numberToBytesLE, } from "../utils.js"; -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = /* @__PURE__ */ BigInt(2), _3n = /* @__PURE__ */ BigInt(3); -// prettier-ignore -const _4n = /* @__PURE__ */ BigInt(4), _5n = /* @__PURE__ */ BigInt(5), _7n = /* @__PURE__ */ BigInt(7); -// prettier-ignore -const _8n = /* @__PURE__ */ BigInt(8), _9n = /* @__PURE__ */ BigInt(9), _16n = /* @__PURE__ */ BigInt(16); -// Calculates a modulo b -export function mod(a, b) { - const result = a % b; - return result >= _0n ? result : b + result; -} -/** - * Efficiently raise num to power and do modular division. - * Unsafe in some contexts: uses ladder, so can expose bigint bits. - * @example - * pow(2n, 6n, 11n) // 64n % 11n == 9n - */ -export function pow(num, power, modulo) { - return FpPow(Field(modulo), num, power); -} -/** Does `x^(2^power)` mod p. `pow2(30, 4)` == `30^(2^4)` */ -export function pow2(x, power, modulo) { - let res = x; - while (power-- > _0n) { - res *= res; - res %= modulo; - } - return res; -} -/** - * Inverses number over modulo. - * Implemented using [Euclidean GCD](https://brilliant.org/wiki/extended-euclidean-algorithm/). - */ -export function invert(number, modulo) { - if (number === _0n) - throw new Error('invert: expected non-zero number'); - if (modulo <= _0n) - throw new Error('invert: expected positive modulus, got ' + modulo); - // Fermat's little theorem "CT-like" version inv(n) = n^(m-2) mod m is 30x slower. - let a = mod(number, modulo); - let b = modulo; - // prettier-ignore - let x = _0n, y = _1n, u = _1n, v = _0n; - while (a !== _0n) { - // JIT applies optimization if those two lines follow each other - const q = b / a; - const r = b % a; - const m = x - u * q; - const n = y - v * q; - // prettier-ignore - b = a, a = r, x = u, y = v, u = m, v = n; - } - const gcd = b; - if (gcd !== _1n) - throw new Error('invert: does not exist'); - return mod(x, modulo); -} -function assertIsSquare(Fp, root, n) { - if (!Fp.eql(Fp.sqr(root), n)) - throw new Error('Cannot find square root'); -} -// Not all roots are possible! Example which will throw: -// const NUM = -// n = 72057594037927816n; -// Fp = Field(BigInt('0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab')); -function sqrt3mod4(Fp, n) { - const p1div4 = (Fp.ORDER + _1n) / _4n; - const root = Fp.pow(n, p1div4); - assertIsSquare(Fp, root, n); - return root; -} -function sqrt5mod8(Fp, n) { - const p5div8 = (Fp.ORDER - _5n) / _8n; - const n2 = Fp.mul(n, _2n); - const v = Fp.pow(n2, p5div8); - const nv = Fp.mul(n, v); - const i = Fp.mul(Fp.mul(nv, _2n), v); - const root = Fp.mul(nv, Fp.sub(i, Fp.ONE)); - assertIsSquare(Fp, root, n); - return root; -} -// Based on RFC9380, Kong algorithm -// prettier-ignore -function sqrt9mod16(P) { - const Fp_ = Field(P); - const tn = tonelliShanks(P); - const c1 = tn(Fp_, Fp_.neg(Fp_.ONE)); // 1. c1 = sqrt(-1) in F, i.e., (c1^2) == -1 in F - const c2 = tn(Fp_, c1); // 2. c2 = sqrt(c1) in F, i.e., (c2^2) == c1 in F - const c3 = tn(Fp_, Fp_.neg(c1)); // 3. c3 = sqrt(-c1) in F, i.e., (c3^2) == -c1 in F - const c4 = (P + _7n) / _16n; // 4. c4 = (q + 7) / 16 # Integer arithmetic - return (Fp, n) => { - let tv1 = Fp.pow(n, c4); // 1. tv1 = x^c4 - let tv2 = Fp.mul(tv1, c1); // 2. tv2 = c1 * tv1 - const tv3 = Fp.mul(tv1, c2); // 3. tv3 = c2 * tv1 - const tv4 = Fp.mul(tv1, c3); // 4. tv4 = c3 * tv1 - const e1 = Fp.eql(Fp.sqr(tv2), n); // 5. e1 = (tv2^2) == x - const e2 = Fp.eql(Fp.sqr(tv3), n); // 6. e2 = (tv3^2) == x - tv1 = Fp.cmov(tv1, tv2, e1); // 7. tv1 = CMOV(tv1, tv2, e1) # Select tv2 if (tv2^2) == x - tv2 = Fp.cmov(tv4, tv3, e2); // 8. tv2 = CMOV(tv4, tv3, e2) # Select tv3 if (tv3^2) == x - const e3 = Fp.eql(Fp.sqr(tv2), n); // 9. e3 = (tv2^2) == x - const root = Fp.cmov(tv1, tv2, e3); // 10. z = CMOV(tv1, tv2, e3) # Select sqrt from tv1 & tv2 - assertIsSquare(Fp, root, n); - return root; - }; -} -/** - * Tonelli-Shanks square root search algorithm. - * 1. https://eprint.iacr.org/2012/685.pdf (page 12) - * 2. Square Roots from 1; 24, 51, 10 to Dan Shanks - * @param P field order - * @returns function that takes field Fp (created from P) and number n - */ -export function tonelliShanks(P) { - // Initialization (precomputation). - // Caching initialization could boost perf by 7%. - if (P < _3n) - throw new Error('sqrt is not defined for small field'); - // Factor P - 1 = Q * 2^S, where Q is odd - let Q = P - _1n; - let S = 0; - while (Q % _2n === _0n) { - Q /= _2n; - S++; - } - // Find the first quadratic non-residue Z >= 2 - let Z = _2n; - const _Fp = Field(P); - while (FpLegendre(_Fp, Z) === 1) { - // Basic primality test for P. After x iterations, chance of - // not finding quadratic non-residue is 2^x, so 2^1000. - if (Z++ > 1000) - throw new Error('Cannot find square root: probably non-prime P'); - } - // Fast-path; usually done before Z, but we do "primality test". - if (S === 1) - return sqrt3mod4; - // Slow-path - // TODO: test on Fp2 and others - let cc = _Fp.pow(Z, Q); // c = z^Q - const Q1div2 = (Q + _1n) / _2n; - return function tonelliSlow(Fp, n) { - if (Fp.is0(n)) - return n; - // Check if n is a quadratic residue using Legendre symbol - if (FpLegendre(Fp, n) !== 1) - throw new Error('Cannot find square root'); - // Initialize variables for the main loop - let M = S; - let c = Fp.mul(Fp.ONE, cc); // c = z^Q, move cc from field _Fp into field Fp - let t = Fp.pow(n, Q); // t = n^Q, first guess at the fudge factor - let R = Fp.pow(n, Q1div2); // R = n^((Q+1)/2), first guess at the square root - // Main loop - // while t != 1 - while (!Fp.eql(t, Fp.ONE)) { - if (Fp.is0(t)) - return Fp.ZERO; // if t=0 return R=0 - let i = 1; - // Find the smallest i >= 1 such that t^(2^i) ≡ 1 (mod P) - let t_tmp = Fp.sqr(t); // t^(2^1) - while (!Fp.eql(t_tmp, Fp.ONE)) { - i++; - t_tmp = Fp.sqr(t_tmp); // t^(2^2)... - if (i === M) - throw new Error('Cannot find square root'); - } - // Calculate the exponent for b: 2^(M - i - 1) - const exponent = _1n << BigInt(M - i - 1); // bigint is important - const b = Fp.pow(c, exponent); // b = 2^(M - i - 1) - // Update variables - M = i; - c = Fp.sqr(b); // c = b^2 - t = Fp.mul(t, c); // t = (t * b^2) - R = Fp.mul(R, b); // R = R*b - } - return R; - }; -} -/** - * Square root for a finite field. Will try optimized versions first: - * - * 1. P ≡ 3 (mod 4) - * 2. P ≡ 5 (mod 8) - * 3. P ≡ 9 (mod 16) - * 4. Tonelli-Shanks algorithm - * - * Different algorithms can give different roots, it is up to user to decide which one they want. - * For example there is FpSqrtOdd/FpSqrtEven to choice root based on oddness (used for hash-to-curve). - */ -export function FpSqrt(P) { - // P ≡ 3 (mod 4) => √n = n^((P+1)/4) - if (P % _4n === _3n) - return sqrt3mod4; - // P ≡ 5 (mod 8) => Atkin algorithm, page 10 of https://eprint.iacr.org/2012/685.pdf - if (P % _8n === _5n) - return sqrt5mod8; - // P ≡ 9 (mod 16) => Kong algorithm, page 11 of https://eprint.iacr.org/2012/685.pdf (algorithm 4) - if (P % _16n === _9n) - return sqrt9mod16(P); - // Tonelli-Shanks algorithm - return tonelliShanks(P); -} -// Little-endian check for first LE bit (last BE bit); -export const isNegativeLE = (num, modulo) => (mod(num, modulo) & _1n) === _1n; -// prettier-ignore -const FIELD_FIELDS = [ - 'create', 'isValid', 'is0', 'neg', 'inv', 'sqrt', 'sqr', - 'eql', 'add', 'sub', 'mul', 'pow', 'div', - 'addN', 'subN', 'mulN', 'sqrN' -]; -export function validateField(field) { - const initial = { - ORDER: 'bigint', - MASK: 'bigint', - BYTES: 'number', - BITS: 'number', - }; - const opts = FIELD_FIELDS.reduce((map, val) => { - map[val] = 'function'; - return map; - }, initial); - _validateObject(field, opts); - // const max = 16384; - // if (field.BYTES < 1 || field.BYTES > max) throw new Error('invalid field'); - // if (field.BITS < 1 || field.BITS > 8 * max) throw new Error('invalid field'); - return field; -} -// Generic field functions -/** - * Same as `pow` but for Fp: non-constant-time. - * Unsafe in some contexts: uses ladder, so can expose bigint bits. - */ -export function FpPow(Fp, num, power) { - if (power < _0n) - throw new Error('invalid exponent, negatives unsupported'); - if (power === _0n) - return Fp.ONE; - if (power === _1n) - return num; - let p = Fp.ONE; - let d = num; - while (power > _0n) { - if (power & _1n) - p = Fp.mul(p, d); - d = Fp.sqr(d); - power >>= _1n; - } - return p; -} -/** - * Efficiently invert an array of Field elements. - * Exception-free. Will return `undefined` for 0 elements. - * @param passZero map 0 to 0 (instead of undefined) - */ -export function FpInvertBatch(Fp, nums, passZero = false) { - const inverted = new Array(nums.length).fill(passZero ? Fp.ZERO : undefined); - // Walk from first to last, multiply them by each other MOD p - const multipliedAcc = nums.reduce((acc, num, i) => { - if (Fp.is0(num)) - return acc; - inverted[i] = acc; - return Fp.mul(acc, num); - }, Fp.ONE); - // Invert last element - const invertedAcc = Fp.inv(multipliedAcc); - // Walk from last to first, multiply them by inverted each other MOD p - nums.reduceRight((acc, num, i) => { - if (Fp.is0(num)) - return acc; - inverted[i] = Fp.mul(acc, inverted[i]); - return Fp.mul(acc, num); - }, invertedAcc); - return inverted; -} -// TODO: remove -export function FpDiv(Fp, lhs, rhs) { - return Fp.mul(lhs, typeof rhs === 'bigint' ? invert(rhs, Fp.ORDER) : Fp.inv(rhs)); -} -/** - * Legendre symbol. - * Legendre constant is used to calculate Legendre symbol (a | p) - * which denotes the value of a^((p-1)/2) (mod p). - * - * * (a | p) ≡ 1 if a is a square (mod p), quadratic residue - * * (a | p) ≡ -1 if a is not a square (mod p), quadratic non residue - * * (a | p) ≡ 0 if a ≡ 0 (mod p) - */ -export function FpLegendre(Fp, n) { - // We can use 3rd argument as optional cache of this value - // but seems unneeded for now. The operation is very fast. - const p1mod2 = (Fp.ORDER - _1n) / _2n; - const powered = Fp.pow(n, p1mod2); - const yes = Fp.eql(powered, Fp.ONE); - const zero = Fp.eql(powered, Fp.ZERO); - const no = Fp.eql(powered, Fp.neg(Fp.ONE)); - if (!yes && !zero && !no) - throw new Error('invalid Legendre symbol result'); - return yes ? 1 : zero ? 0 : -1; -} -// This function returns True whenever the value x is a square in the field F. -export function FpIsSquare(Fp, n) { - const l = FpLegendre(Fp, n); - return l === 1; -} -// CURVE.n lengths -export function nLength(n, nBitLength) { - // Bit size, byte size of CURVE.n - if (nBitLength !== undefined) - anumber(nBitLength); - const _nBitLength = nBitLength !== undefined ? nBitLength : n.toString(2).length; - const nByteLength = Math.ceil(_nBitLength / 8); - return { nBitLength: _nBitLength, nByteLength }; -} -/** - * Creates a finite field. Major performance optimizations: - * * 1. Denormalized operations like mulN instead of mul. - * * 2. Identical object shape: never add or remove keys. - * * 3. `Object.freeze`. - * Fragile: always run a benchmark on a change. - * Security note: operations don't check 'isValid' for all elements for performance reasons, - * it is caller responsibility to check this. - * This is low-level code, please make sure you know what you're doing. - * - * Note about field properties: - * * CHARACTERISTIC p = prime number, number of elements in main subgroup. - * * ORDER q = similar to cofactor in curves, may be composite `q = p^m`. - * - * @param ORDER field order, probably prime, or could be composite - * @param bitLen how many bits the field consumes - * @param isLE (default: false) if encoding / decoding should be in little-endian - * @param redef optional faster redefinitions of sqrt and other methods - */ -export function Field(ORDER, bitLenOrOpts, // TODO: use opts only in v2? -isLE = false, opts = {}) { - if (ORDER <= _0n) - throw new Error('invalid field: expected ORDER > 0, got ' + ORDER); - let _nbitLength = undefined; - let _sqrt = undefined; - let modFromBytes = false; - let allowedLengths = undefined; - if (typeof bitLenOrOpts === 'object' && bitLenOrOpts != null) { - if (opts.sqrt || isLE) - throw new Error('cannot specify opts in two arguments'); - const _opts = bitLenOrOpts; - if (_opts.BITS) - _nbitLength = _opts.BITS; - if (_opts.sqrt) - _sqrt = _opts.sqrt; - if (typeof _opts.isLE === 'boolean') - isLE = _opts.isLE; - if (typeof _opts.modFromBytes === 'boolean') - modFromBytes = _opts.modFromBytes; - allowedLengths = _opts.allowedLengths; - } - else { - if (typeof bitLenOrOpts === 'number') - _nbitLength = bitLenOrOpts; - if (opts.sqrt) - _sqrt = opts.sqrt; - } - const { nBitLength: BITS, nByteLength: BYTES } = nLength(ORDER, _nbitLength); - if (BYTES > 2048) - throw new Error('invalid field: expected ORDER of <= 2048 bytes'); - let sqrtP; // cached sqrtP - const f = Object.freeze({ - ORDER, - isLE, - BITS, - BYTES, - MASK: bitMask(BITS), - ZERO: _0n, - ONE: _1n, - allowedLengths: allowedLengths, - create: (num) => mod(num, ORDER), - isValid: (num) => { - if (typeof num !== 'bigint') - throw new Error('invalid field element: expected bigint, got ' + typeof num); - return _0n <= num && num < ORDER; // 0 is valid element, but it's not invertible - }, - is0: (num) => num === _0n, - // is valid and invertible - isValidNot0: (num) => !f.is0(num) && f.isValid(num), - isOdd: (num) => (num & _1n) === _1n, - neg: (num) => mod(-num, ORDER), - eql: (lhs, rhs) => lhs === rhs, - sqr: (num) => mod(num * num, ORDER), - add: (lhs, rhs) => mod(lhs + rhs, ORDER), - sub: (lhs, rhs) => mod(lhs - rhs, ORDER), - mul: (lhs, rhs) => mod(lhs * rhs, ORDER), - pow: (num, power) => FpPow(f, num, power), - div: (lhs, rhs) => mod(lhs * invert(rhs, ORDER), ORDER), - // Same as above, but doesn't normalize - sqrN: (num) => num * num, - addN: (lhs, rhs) => lhs + rhs, - subN: (lhs, rhs) => lhs - rhs, - mulN: (lhs, rhs) => lhs * rhs, - inv: (num) => invert(num, ORDER), - sqrt: _sqrt || - ((n) => { - if (!sqrtP) - sqrtP = FpSqrt(ORDER); - return sqrtP(f, n); - }), - toBytes: (num) => (isLE ? numberToBytesLE(num, BYTES) : numberToBytesBE(num, BYTES)), - fromBytes: (bytes, skipValidation = true) => { - if (allowedLengths) { - if (!allowedLengths.includes(bytes.length) || bytes.length > BYTES) { - throw new Error('Field.fromBytes: expected ' + allowedLengths + ' bytes, got ' + bytes.length); - } - const padded = new Uint8Array(BYTES); - // isLE add 0 to right, !isLE to the left. - padded.set(bytes, isLE ? 0 : padded.length - bytes.length); - bytes = padded; - } - if (bytes.length !== BYTES) - throw new Error('Field.fromBytes: expected ' + BYTES + ' bytes, got ' + bytes.length); - let scalar = isLE ? bytesToNumberLE(bytes) : bytesToNumberBE(bytes); - if (modFromBytes) - scalar = mod(scalar, ORDER); - if (!skipValidation) - if (!f.isValid(scalar)) - throw new Error('invalid field element: outside of range 0..ORDER'); - // NOTE: we don't validate scalar here, please use isValid. This done such way because some - // protocol may allow non-reduced scalar that reduced later or changed some other way. - return scalar; - }, - // TODO: we don't need it here, move out to separate fn - invertBatch: (lst) => FpInvertBatch(f, lst), - // We can't move this out because Fp6, Fp12 implement it - // and it's unclear what to return in there. - cmov: (a, b, c) => (c ? b : a), - }); - return Object.freeze(f); -} -// Generic random scalar, we can do same for other fields if via Fp2.mul(Fp2.ONE, Fp2.random)? -// This allows unsafe methods like ignore bias or zero. These unsafe, but often used in different protocols (if deterministic RNG). -// which mean we cannot force this via opts. -// Not sure what to do with randomBytes, we can accept it inside opts if wanted. -// Probably need to export getMinHashLength somewhere? -// random(bytes?: Uint8Array, unsafeAllowZero = false, unsafeAllowBias = false) { -// const LEN = !unsafeAllowBias ? getMinHashLength(ORDER) : BYTES; -// if (bytes === undefined) bytes = randomBytes(LEN); // _opts.randomBytes? -// const num = isLE ? bytesToNumberLE(bytes) : bytesToNumberBE(bytes); -// // `mod(x, 11)` can sometimes produce 0. `mod(x, 10) + 1` is the same, but no 0 -// const reduced = unsafeAllowZero ? mod(num, ORDER) : mod(num, ORDER - _1n) + _1n; -// return reduced; -// }, -export function FpSqrtOdd(Fp, elm) { - if (!Fp.isOdd) - throw new Error("Field doesn't have isOdd"); - const root = Fp.sqrt(elm); - return Fp.isOdd(root) ? root : Fp.neg(root); -} -export function FpSqrtEven(Fp, elm) { - if (!Fp.isOdd) - throw new Error("Field doesn't have isOdd"); - const root = Fp.sqrt(elm); - return Fp.isOdd(root) ? Fp.neg(root) : root; -} -/** - * "Constant-time" private key generation utility. - * Same as mapKeyToField, but accepts less bytes (40 instead of 48 for 32-byte field). - * Which makes it slightly more biased, less secure. - * @deprecated use `mapKeyToField` instead - */ -export function hashToPrivateScalar(hash, groupOrder, isLE = false) { - hash = ensureBytes('privateHash', hash); - const hashLen = hash.length; - const minLen = nLength(groupOrder).nByteLength + 8; - if (minLen < 24 || hashLen < minLen || hashLen > 1024) - throw new Error('hashToPrivateScalar: expected ' + minLen + '-1024 bytes of input, got ' + hashLen); - const num = isLE ? bytesToNumberLE(hash) : bytesToNumberBE(hash); - return mod(num, groupOrder - _1n) + _1n; -} -/** - * Returns total number of bytes consumed by the field element. - * For example, 32 bytes for usual 256-bit weierstrass curve. - * @param fieldOrder number of field elements, usually CURVE.n - * @returns byte length of field - */ -export function getFieldBytesLength(fieldOrder) { - if (typeof fieldOrder !== 'bigint') - throw new Error('field order must be bigint'); - const bitLength = fieldOrder.toString(2).length; - return Math.ceil(bitLength / 8); -} -/** - * Returns minimal amount of bytes that can be safely reduced - * by field order. - * Should be 2^-128 for 128-bit curve such as P256. - * @param fieldOrder number of field elements, usually CURVE.n - * @returns byte length of target hash - */ -export function getMinHashLength(fieldOrder) { - const length = getFieldBytesLength(fieldOrder); - return length + Math.ceil(length / 2); -} -/** - * "Constant-time" private key generation utility. - * Can take (n + n/2) or more bytes of uniform input e.g. from CSPRNG or KDF - * and convert them into private scalar, with the modulo bias being negligible. - * Needs at least 48 bytes of input for 32-byte private key. - * https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/ - * FIPS 186-5, A.2 https://csrc.nist.gov/publications/detail/fips/186/5/final - * RFC 9380, https://www.rfc-editor.org/rfc/rfc9380#section-5 - * @param hash hash output from SHA3 or a similar function - * @param groupOrder size of subgroup - (e.g. secp256k1.CURVE.n) - * @param isLE interpret hash bytes as LE num - * @returns valid private scalar - */ -export function mapHashToField(key, fieldOrder, isLE = false) { - const len = key.length; - const fieldLen = getFieldBytesLength(fieldOrder); - const minLen = getMinHashLength(fieldOrder); - // No small numbers: need to understand bias story. No huge numbers: easier to detect JS timings. - if (len < 16 || len < minLen || len > 1024) - throw new Error('expected ' + minLen + '-1024 bytes of input, got ' + len); - const num = isLE ? bytesToNumberLE(key) : bytesToNumberBE(key); - // `mod(x, 11)` can sometimes produce 0. `mod(x, 10) + 1` is the same, but no 0 - const reduced = mod(num, fieldOrder - _1n) + _1n; - return isLE ? numberToBytesLE(reduced, fieldLen) : numberToBytesBE(reduced, fieldLen); -} -//# sourceMappingURL=modular.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/modular.js.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/modular.js.map deleted file mode 100644 index e6d2d625..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/modular.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"modular.js","sourceRoot":"","sources":["../../src/abstract/modular.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,sEAAsE;AACtE,OAAO,EACL,eAAe,EACf,OAAO,EACP,OAAO,EACP,eAAe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AG,GAAG,CAAC,GAAG,EAAE,UAAU,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;IACjD,OAAO,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AACxF,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/montgomery.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/montgomery.d.ts deleted file mode 100644 index 7615c2a8..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/montgomery.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type { CurveLengths } from './curve.ts'; -type Hex = string | Uint8Array; -export type CurveType = { - P: bigint; - type: 'x25519' | 'x448'; - adjustScalarBytes: (bytes: Uint8Array) => Uint8Array; - powPminus2: (x: bigint) => bigint; - randomBytes?: (bytesLength?: number) => Uint8Array; -}; -export type MontgomeryECDH = { - scalarMult: (scalar: Hex, u: Hex) => Uint8Array; - scalarMultBase: (scalar: Hex) => Uint8Array; - getSharedSecret: (secretKeyA: Hex, publicKeyB: Hex) => Uint8Array; - getPublicKey: (secretKey: Hex) => Uint8Array; - utils: { - randomSecretKey: () => Uint8Array; - /** @deprecated use `randomSecretKey` */ - randomPrivateKey: () => Uint8Array; - }; - GuBytes: Uint8Array; - lengths: CurveLengths; - keygen: (seed?: Uint8Array) => { - secretKey: Uint8Array; - publicKey: Uint8Array; - }; -}; -export type CurveFn = MontgomeryECDH; -export declare function montgomery(curveDef: CurveType): MontgomeryECDH; -export {}; -//# sourceMappingURL=montgomery.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/montgomery.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/montgomery.d.ts.map deleted file mode 100644 index d2d514df..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/montgom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QAAQ,EAAE,SAAS,GAAG,cAAc,CAyI9D"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/montgomery.js b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/montgomery.js deleted file mode 100644 index d7694feb..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/montgomery.js +++ /dev/null @@ -1,157 +0,0 @@ -/** - * Montgomery curve methods. It's not really whole montgomery curve, - * just bunch of very specific methods for X25519 / X448 from - * [RFC 7748](https://www.rfc-editor.org/rfc/rfc7748) - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { _validateObject, abytes, aInRange, bytesToNumberLE, ensureBytes, numberToBytesLE, randomBytes, } from "../utils.js"; -import { mod } from "./modular.js"; -const _0n = BigInt(0); -const _1n = BigInt(1); -const _2n = BigInt(2); -function validateOpts(curve) { - _validateObject(curve, { - adjustScalarBytes: 'function', - powPminus2: 'function', - }); - return Object.freeze({ ...curve }); -} -export function montgomery(curveDef) { - const CURVE = validateOpts(curveDef); - const { P, type, adjustScalarBytes, powPminus2, randomBytes: rand } = CURVE; - const is25519 = type === 'x25519'; - if (!is25519 && type !== 'x448') - throw new Error('invalid type'); - const randomBytes_ = rand || randomBytes; - const montgomeryBits = is25519 ? 255 : 448; - const fieldLen = is25519 ? 32 : 56; - const Gu = is25519 ? BigInt(9) : BigInt(5); - // RFC 7748 #5: - // The constant a24 is (486662 - 2) / 4 = 121665 for curve25519/X25519 and - // (156326 - 2) / 4 = 39081 for curve448/X448 - // const a = is25519 ? 156326n : 486662n; - const a24 = is25519 ? BigInt(121665) : BigInt(39081); - // RFC: x25519 "the resulting integer is of the form 2^254 plus - // eight times a value between 0 and 2^251 - 1 (inclusive)" - // x448: "2^447 plus four times a value between 0 and 2^445 - 1 (inclusive)" - const minScalar = is25519 ? _2n ** BigInt(254) : _2n ** BigInt(447); - const maxAdded = is25519 - ? BigInt(8) * _2n ** BigInt(251) - _1n - : BigInt(4) * _2n ** BigInt(445) - _1n; - const maxScalar = minScalar + maxAdded + _1n; // (inclusive) - const modP = (n) => mod(n, P); - const GuBytes = encodeU(Gu); - function encodeU(u) { - return numberToBytesLE(modP(u), fieldLen); - } - function decodeU(u) { - const _u = ensureBytes('u coordinate', u, fieldLen); - // RFC: When receiving such an array, implementations of X25519 - // (but not X448) MUST mask the most significant bit in the final byte. - if (is25519) - _u[31] &= 127; // 0b0111_1111 - // RFC: Implementations MUST accept non-canonical values and process them as - // if they had been reduced modulo the field prime. The non-canonical - // values are 2^255 - 19 through 2^255 - 1 for X25519 and 2^448 - 2^224 - // - 1 through 2^448 - 1 for X448. - return modP(bytesToNumberLE(_u)); - } - function decodeScalar(scalar) { - return bytesToNumberLE(adjustScalarBytes(ensureBytes('scalar', scalar, fieldLen))); - } - function scalarMult(scalar, u) { - const pu = montgomeryLadder(decodeU(u), decodeScalar(scalar)); - // Some public keys are useless, of low-order. Curve author doesn't think - // it needs to be validated, but we do it nonetheless. - // https://cr.yp.to/ecdh.html#validate - if (pu === _0n) - throw new Error('invalid private or public key received'); - return encodeU(pu); - } - // Computes public key from private. By doing scalar multiplication of base point. - function scalarMultBase(scalar) { - return scalarMult(scalar, GuBytes); - } - // cswap from RFC7748 "example code" - function cswap(swap, x_2, x_3) { - // dummy = mask(swap) AND (x_2 XOR x_3) - // Where mask(swap) is the all-1 or all-0 word of the same length as x_2 - // and x_3, computed, e.g., as mask(swap) = 0 - swap. - const dummy = modP(swap * (x_2 - x_3)); - x_2 = modP(x_2 - dummy); // x_2 = x_2 XOR dummy - x_3 = modP(x_3 + dummy); // x_3 = x_3 XOR dummy - return { x_2, x_3 }; - } - /** - * Montgomery x-only multiplication ladder. - * @param pointU u coordinate (x) on Montgomery Curve 25519 - * @param scalar by which the point would be multiplied - * @returns new Point on Montgomery curve - */ - function montgomeryLadder(u, scalar) { - aInRange('u', u, _0n, P); - aInRange('scalar', scalar, minScalar, maxScalar); - const k = scalar; - const x_1 = u; - let x_2 = _1n; - let z_2 = _0n; - let x_3 = u; - let z_3 = _1n; - let swap = _0n; - for (let t = BigInt(montgomeryBits - 1); t >= _0n; t--) { - const k_t = (k >> t) & _1n; - swap ^= k_t; - ({ x_2, x_3 } = cswap(swap, x_2, x_3)); - ({ x_2: z_2, x_3: z_3 } = cswap(swap, z_2, z_3)); - swap = k_t; - const A = x_2 + z_2; - const AA = modP(A * A); - const B = x_2 - z_2; - const BB = modP(B * B); - const E = AA - BB; - const C = x_3 + z_3; - const D = x_3 - z_3; - const DA = modP(D * A); - const CB = modP(C * B); - const dacb = DA + CB; - const da_cb = DA - CB; - x_3 = modP(dacb * dacb); - z_3 = modP(x_1 * modP(da_cb * da_cb)); - x_2 = modP(AA * BB); - z_2 = modP(E * (AA + modP(a24 * E))); - } - ({ x_2, x_3 } = cswap(swap, x_2, x_3)); - ({ x_2: z_2, x_3: z_3 } = cswap(swap, z_2, z_3)); - const z2 = powPminus2(z_2); // `Fp.pow(x, P - _2n)` is much slower equivalent - return modP(x_2 * z2); // Return x_2 * (z_2^(p - 2)) - } - const lengths = { - secretKey: fieldLen, - publicKey: fieldLen, - seed: fieldLen, - }; - const randomSecretKey = (seed = randomBytes_(fieldLen)) => { - abytes(seed, lengths.seed); - return seed; - }; - function keygen(seed) { - const secretKey = randomSecretKey(seed); - return { secretKey, publicKey: scalarMultBase(secretKey) }; - } - const utils = { - randomSecretKey, - randomPrivateKey: randomSecretKey, - }; - return { - keygen, - getSharedSecret: (secretKey, publicKey) => scalarMult(secretKey, publicKey), - getPublicKey: (secretKey) => scalarMultBase(secretKey), - scalarMult, - scalarMultBase, - utils, - GuBytes: GuBytes.slice(), - lengths, - }; -} -//# sourceMappingURL=montgomery.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/montgomery.js.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/montgomery.js.map deleted file mode 100644 index 6ad248cc..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves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,OAAO,CAAC,IAAI,CAAC,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;IACF,SAAS,MAAM,CAAC,IAAiB;QAC/B,MAAM,SAAS,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;QACxC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,CAAC,SAAS,CAAC,EAAE,CAAC;IAC7D,CAAC;IACD,MAAM,KAAK,GAAG;QACZ,eAAe;QACf,gBAAgB,EAAE,eAAe;KAClC,CAAC;IACF,OAAO;QACL,MAAM;QACN,eAAe,EAAE,CAAC,SAAc,EAAE,SAAc,EAAE,EAAE,CAAC,UAAU,CAAC,SAAS,EAAE,SAAS,CAAC;QACrF,YAAY,EAAE,CAAC,SAAc,EAAc,EAAE,CAAC,cAAc,CAAC,SAAS,CAAC;QACvE,UAAU;QACV,cAAc;QACd,KAAK;QACL,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE;QACxB,OAAO;KACR,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/poseidon.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/poseidon.d.ts deleted file mode 100644 index e0684efc..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/poseidon.d.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { type IField } from './modular.ts'; -export type PoseidonBasicOpts = { - Fp: IField; - t: number; - roundsFull: number; - roundsPartial: number; - isSboxInverse?: boolean; -}; -export type PoseidonGrainOpts = PoseidonBasicOpts & { - sboxPower?: number; -}; -type PoseidonConstants = { - mds: bigint[][]; - roundConstants: bigint[][]; -}; -export declare function grainGenConstants(opts: PoseidonGrainOpts, skipMDS?: number): PoseidonConstants; -export type PoseidonOpts = PoseidonBasicOpts & PoseidonConstants & { - sboxPower?: number; - reversePartialPowIdx?: boolean; -}; -export declare function validateOpts(opts: PoseidonOpts): Readonly<{ - rounds: number; - sboxFn: (n: bigint) => bigint; - roundConstants: bigint[][]; - mds: bigint[][]; - Fp: IField; - t: number; - roundsFull: number; - roundsPartial: number; - sboxPower?: number; - reversePartialPowIdx?: boolean; -}>; -export declare function splitConstants(rc: bigint[], t: number): bigint[][]; -export type PoseidonFn = { - (values: bigint[]): bigint[]; - roundConstants: bigint[][]; -}; -/** Poseidon NTT-friendly hash. */ -export declare function poseidon(opts: PoseidonOpts): PoseidonFn; -export declare class PoseidonSponge { - private Fp; - readonly rate: number; - readonly capacity: number; - readonly hash: PoseidonFn; - private state; - private pos; - private isAbsorbing; - constructor(Fp: IField, rate: number, capacity: number, hash: PoseidonFn); - private process; - absorb(input: bigint[]): void; - squeeze(count: number): bigint[]; - clean(): void; - clone(): PoseidonSponge; -} -export type PoseidonSpongeOpts = Omit & { - rate: number; - capacity: number; -}; -/** - * The method is not defined in spec, but nevertheless used often. - * Check carefully for compatibility: there are many edge cases, like absorbing an empty array. - * We cross-test against: - * - https://github.com/ProvableHQ/snarkVM/tree/staging/algorithms - * - https://github.com/arkworks-rs/crypto-primitives/tree/main - */ -export declare function poseidonSponge(opts: PoseidonSpongeOpts): () => PoseidonSponge; -export {}; -//# sourceMappingURL=poseidon.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/poseidon.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/poseidon.d.ts.map deleted file mode 100644 index 33da6c96..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/poseidon.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"poseidon.d.ts","sourceRoot":"","sources":["../../src/abstract/poseidon.ts"],"names":[],"mappings":"AAUA,OAAO,EAAwB,KAAK,MAAM,EAAiB,MAAM,cAAc,CAAC;AAyBhF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACnB,CAAC,EAAE,MAAM,CAAC;IACV,UAAU,EAAE,MA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,MAAM,EAAE,EAAE,CAAC;CAC5B,CAAC;AACF,kCAAkC;AAClC,wBAAgB,QAAQ,CAAC,IAAI,EAAE,YAAY,GAAG,UAAU,CAmCvD;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,EAAE,CAAiB;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,OAAO,CAAC,KAAK,CAAW;IACxB,OAAO,CAAC,GAAG,CAAK;IAChB,OAAO,CAAC,WAAW,CAAQ;gBAEf,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU;IAQhF,OAAO,CAAC,OAAO;IAGf,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI;IAgB7B,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE;IAahC,KAAK,IAAI,IAAI;IAKb,KAAK,IAAI,cAAc;CAMxB;AAED,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,YAAY,EAAE,GAAG,CAAC,GAAG;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,kBAAkB,GAAG,MAAM,cAAc,CAW7E"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/poseidon.js b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/poseidon.js deleted file mode 100644 index 226bc072..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/poseidon.js +++ /dev/null @@ -1,296 +0,0 @@ -/** - * Implements [Poseidon](https://www.poseidon-hash.info) ZK-friendly hash. - * - * There are many poseidon variants with different constants. - * We don't provide them: you should construct them manually. - * Check out [micro-starknet](https://github.com/paulmillr/micro-starknet) package for a proper example. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { _validateObject, bitGet } from "../utils.js"; -import { FpInvertBatch, FpPow, validateField } from "./modular.js"; -// Grain LFSR (Linear-Feedback Shift Register): https://eprint.iacr.org/2009/109.pdf -function grainLFSR(state) { - let pos = 0; - if (state.length !== 80) - throw new Error('grainLFRS: wrong state length, should be 80 bits'); - const getBit = () => { - const r = (offset) => state[(pos + offset) % 80]; - const bit = r(62) ^ r(51) ^ r(38) ^ r(23) ^ r(13) ^ r(0); - state[pos] = bit; - pos = ++pos % 80; - return !!bit; - }; - for (let i = 0; i < 160; i++) - getBit(); - return () => { - // https://en.wikipedia.org/wiki/Shrinking_generator - while (true) { - const b1 = getBit(); - const b2 = getBit(); - if (!b1) - continue; - return b2; - } - }; -} -function assertValidPosOpts(opts) { - const { Fp, roundsFull } = opts; - validateField(Fp); - _validateObject(opts, { - t: 'number', - roundsFull: 'number', - roundsPartial: 'number', - }, { - isSboxInverse: 'boolean', - }); - for (const i of ['t', 'roundsFull', 'roundsPartial']) { - if (!Number.isSafeInteger(opts[i]) || opts[i] < 1) - throw new Error('invalid number ' + i); - } - if (roundsFull & 1) - throw new Error('roundsFull is not even' + roundsFull); -} -function poseidonGrain(opts) { - assertValidPosOpts(opts); - const { Fp } = opts; - const state = Array(80).fill(1); - let pos = 0; - const writeBits = (value, bitCount) => { - for (let i = bitCount - 1; i >= 0; i--) - state[pos++] = Number(bitGet(value, i)); - }; - const _0n = BigInt(0); - const _1n = BigInt(1); - writeBits(_1n, 2); // prime field - writeBits(opts.isSboxInverse ? _1n : _0n, 4); // b2..b5 - writeBits(BigInt(Fp.BITS), 12); // b6..b17 - writeBits(BigInt(opts.t), 12); // b18..b29 - writeBits(BigInt(opts.roundsFull), 10); // b30..b39 - writeBits(BigInt(opts.roundsPartial), 10); // b40..b49 - const getBit = grainLFSR(state); - return (count, reject) => { - const res = []; - for (let i = 0; i < count; i++) { - while (true) { - let num = _0n; - for (let i = 0; i < Fp.BITS; i++) { - num <<= _1n; - if (getBit()) - num |= _1n; - } - if (reject && num >= Fp.ORDER) - continue; // rejection sampling - res.push(Fp.create(num)); - break; - } - } - return res; - }; -} -// NOTE: this is not standard but used often for constant generation for poseidon -// (grain LFRS-like structure) -export function grainGenConstants(opts, skipMDS = 0) { - const { Fp, t, roundsFull, roundsPartial } = opts; - const rounds = roundsFull + roundsPartial; - const sample = poseidonGrain(opts); - const roundConstants = []; - for (let r = 0; r < rounds; r++) - roundConstants.push(sample(t, true)); - if (skipMDS > 0) - for (let i = 0; i < skipMDS; i++) - sample(2 * t, false); - const xs = sample(t, false); - const ys = sample(t, false); - // Construct MDS Matrix M[i][j] = 1 / (xs[i] + ys[j]) - const mds = []; - for (let i = 0; i < t; i++) { - const row = []; - for (let j = 0; j < t; j++) { - const xy = Fp.add(xs[i], ys[j]); - if (Fp.is0(xy)) - throw new Error(`Error generating MDS matrix: xs[${i}] + ys[${j}] resulted in zero.`); - row.push(xy); - } - mds.push(FpInvertBatch(Fp, row)); - } - return { roundConstants, mds }; -} -export function validateOpts(opts) { - assertValidPosOpts(opts); - const { Fp, mds, reversePartialPowIdx: rev, roundConstants: rc } = opts; - const { roundsFull, roundsPartial, sboxPower, t } = opts; - // MDS is TxT matrix - if (!Array.isArray(mds) || mds.length !== t) - throw new Error('Poseidon: invalid MDS matrix'); - const _mds = mds.map((mdsRow) => { - if (!Array.isArray(mdsRow) || mdsRow.length !== t) - throw new Error('invalid MDS matrix row: ' + mdsRow); - return mdsRow.map((i) => { - if (typeof i !== 'bigint') - throw new Error('invalid MDS matrix bigint: ' + i); - return Fp.create(i); - }); - }); - if (rev !== undefined && typeof rev !== 'boolean') - throw new Error('invalid param reversePartialPowIdx=' + rev); - if (roundsFull & 1) - throw new Error('roundsFull is not even' + roundsFull); - const rounds = roundsFull + roundsPartial; - if (!Array.isArray(rc) || rc.length !== rounds) - throw new Error('Poseidon: invalid round constants'); - const roundConstants = rc.map((rc) => { - if (!Array.isArray(rc) || rc.length !== t) - throw new Error('invalid round constants'); - return rc.map((i) => { - if (typeof i !== 'bigint' || !Fp.isValid(i)) - throw new Error('invalid round constant'); - return Fp.create(i); - }); - }); - if (!sboxPower || ![3, 5, 7, 17].includes(sboxPower)) - throw new Error('invalid sboxPower'); - const _sboxPower = BigInt(sboxPower); - let sboxFn = (n) => FpPow(Fp, n, _sboxPower); - // Unwrapped sbox power for common cases (195->142μs) - if (sboxPower === 3) - sboxFn = (n) => Fp.mul(Fp.sqrN(n), n); - else if (sboxPower === 5) - sboxFn = (n) => Fp.mul(Fp.sqrN(Fp.sqrN(n)), n); - return Object.freeze({ ...opts, rounds, sboxFn, roundConstants, mds: _mds }); -} -export function splitConstants(rc, t) { - if (typeof t !== 'number') - throw new Error('poseidonSplitConstants: invalid t'); - if (!Array.isArray(rc) || rc.length % t) - throw new Error('poseidonSplitConstants: invalid rc'); - const res = []; - let tmp = []; - for (let i = 0; i < rc.length; i++) { - tmp.push(rc[i]); - if (tmp.length === t) { - res.push(tmp); - tmp = []; - } - } - return res; -} -/** Poseidon NTT-friendly hash. */ -export function poseidon(opts) { - const _opts = validateOpts(opts); - const { Fp, mds, roundConstants, rounds: totalRounds, roundsPartial, sboxFn, t } = _opts; - const halfRoundsFull = _opts.roundsFull / 2; - const partialIdx = _opts.reversePartialPowIdx ? t - 1 : 0; - const poseidonRound = (values, isFull, idx) => { - values = values.map((i, j) => Fp.add(i, roundConstants[idx][j])); - if (isFull) - values = values.map((i) => sboxFn(i)); - else - values[partialIdx] = sboxFn(values[partialIdx]); - // Matrix multiplication - values = mds.map((i) => i.reduce((acc, i, j) => Fp.add(acc, Fp.mulN(i, values[j])), Fp.ZERO)); - return values; - }; - const poseidonHash = function poseidonHash(values) { - if (!Array.isArray(values) || values.length !== t) - throw new Error('invalid values, expected array of bigints with length ' + t); - values = values.map((i) => { - if (typeof i !== 'bigint') - throw new Error('invalid bigint=' + i); - return Fp.create(i); - }); - let lastRound = 0; - // Apply r_f/2 full rounds. - for (let i = 0; i < halfRoundsFull; i++) - values = poseidonRound(values, true, lastRound++); - // Apply r_p partial rounds. - for (let i = 0; i < roundsPartial; i++) - values = poseidonRound(values, false, lastRound++); - // Apply r_f/2 full rounds. - for (let i = 0; i < halfRoundsFull; i++) - values = poseidonRound(values, true, lastRound++); - if (lastRound !== totalRounds) - throw new Error('invalid number of rounds'); - return values; - }; - // For verification in tests - poseidonHash.roundConstants = roundConstants; - return poseidonHash; -} -export class PoseidonSponge { - constructor(Fp, rate, capacity, hash) { - this.pos = 0; - this.isAbsorbing = true; - this.Fp = Fp; - this.hash = hash; - this.rate = rate; - this.capacity = capacity; - this.state = new Array(rate + capacity); - this.clean(); - } - process() { - this.state = this.hash(this.state); - } - absorb(input) { - for (const i of input) - if (typeof i !== 'bigint' || !this.Fp.isValid(i)) - throw new Error('invalid input: ' + i); - for (let i = 0; i < input.length;) { - if (!this.isAbsorbing || this.pos === this.rate) { - this.process(); - this.pos = 0; - this.isAbsorbing = true; - } - const chunk = Math.min(this.rate - this.pos, input.length - i); - for (let j = 0; j < chunk; j++) { - const idx = this.capacity + this.pos++; - this.state[idx] = this.Fp.add(this.state[idx], input[i++]); - } - } - } - squeeze(count) { - const res = []; - while (res.length < count) { - if (this.isAbsorbing || this.pos === this.rate) { - this.process(); - this.pos = 0; - this.isAbsorbing = false; - } - const chunk = Math.min(this.rate - this.pos, count - res.length); - for (let i = 0; i < chunk; i++) - res.push(this.state[this.capacity + this.pos++]); - } - return res; - } - clean() { - this.state.fill(this.Fp.ZERO); - this.isAbsorbing = true; - this.pos = 0; - } - clone() { - const c = new PoseidonSponge(this.Fp, this.rate, this.capacity, this.hash); - c.pos = this.pos; - c.state = [...this.state]; - return c; - } -} -/** - * The method is not defined in spec, but nevertheless used often. - * Check carefully for compatibility: there are many edge cases, like absorbing an empty array. - * We cross-test against: - * - https://github.com/ProvableHQ/snarkVM/tree/staging/algorithms - * - https://github.com/arkworks-rs/crypto-primitives/tree/main - */ -export function poseidonSponge(opts) { - for (const i of ['rate', 'capacity']) { - if (typeof opts[i] !== 'number' || !Number.isSafeInteger(opts[i])) - throw new Error('invalid number ' + i); - } - const { rate, capacity } = opts; - const t = opts.rate + opts.capacity; - // Re-use hash instance between multiple instances - const hash = poseidon({ ...opts, t }); - const { Fp } = opts; - return () => new PoseidonSponge(Fp, rate, capacity, hash); -} -//# sourceMappingURL=poseidon.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/poseidon.js.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/poseidon.js.map deleted file mode 100644 index d64e66ec..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/poseidon.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"poseidon.js","sourceRoot":"","sources":["../../src/abstract/poseidon.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,sEAAsE;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,KAAK,EAAe,aAAa,EAAE,MAAM,cAAc,CAAC;AAEhF,oFAAoF;AACpF,SAAS,SAAS,CAAC,KAAe;IAChC,IAAI,GAAG,GAAG,CAAC,CAAC;IACZ,IAAI,KAAK,CAAC,MAAM,KAAK,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;IAC7F,MAAM,MAAM,GAAG,GAAY,EAAE;QAC3B,MAAM,CAAC,GAAG,CAAC,MAAc,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;QACzD,MAAM,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CA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AAC,CAAC;YAC/D,MAAM,IAAI,KAAK,CAAC,iBAAiB,GAAG,CAAC,CAAC,CAAC;IAC3C,CAAC;IACD,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IAChC,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC;IACpC,kDAAkD;IAClD,MAAM,IAAI,GAAG,QAAQ,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;IACtC,MAAM,EAAE,EAAE,EAAE,GAAG,IAAI,CAAC;IACpB,OAAO,GAAG,EAAE,CAAC,IAAI,cAAc,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;AAC5D,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/tower.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/tower.d.ts deleted file mode 100644 index 262e04ac..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/tower.d.ts +++ /dev/null @@ -1,95 +0,0 @@ -import * as mod from './modular.ts'; -import type { WeierstrassPoint, WeierstrassPointCons } from './weierstrass.ts'; -export type BigintTuple = [bigint, bigint]; -export type Fp = bigint; -export type Fp2 = { - c0: bigint; - c1: bigint; -}; -export type BigintSix = [bigint, bigint, bigint, bigint, bigint, bigint]; -export type Fp6 = { - c0: Fp2; - c1: Fp2; - c2: Fp2; -}; -export type Fp12 = { - c0: Fp6; - c1: Fp6; -}; -export type BigintTwelve = [ - bigint, - bigint, - bigint, - bigint, - bigint, - bigint, - bigint, - bigint, - bigint, - bigint, - bigint, - bigint -]; -export type Fp2Bls = mod.IField & { - Fp: mod.IField; - frobeniusMap(num: Fp2, power: number): Fp2; - fromBigTuple(num: BigintTuple): Fp2; - mulByB: (num: Fp2) => Fp2; - mulByNonresidue: (num: Fp2) => Fp2; - reim: (num: Fp2) => { - re: Fp; - im: Fp; - }; - Fp4Square: (a: Fp2, b: Fp2) => { - first: Fp2; - second: Fp2; - }; - NONRESIDUE: Fp2; -}; -export type Fp6Bls = mod.IField & { - Fp2: Fp2Bls; - frobeniusMap(num: Fp6, power: number): Fp6; - fromBigSix: (tuple: BigintSix) => Fp6; - mul1(num: Fp6, b1: Fp2): Fp6; - mul01(num: Fp6, b0: Fp2, b1: Fp2): Fp6; - mulByFp2(lhs: Fp6, rhs: Fp2): Fp6; - mulByNonresidue: (num: Fp6) => Fp6; -}; -export type Fp12Bls = mod.IField & { - Fp6: Fp6Bls; - frobeniusMap(num: Fp12, power: number): Fp12; - fromBigTwelve: (t: BigintTwelve) => Fp12; - mul014(num: Fp12, o0: Fp2, o1: Fp2, o4: Fp2): Fp12; - mul034(num: Fp12, o0: Fp2, o3: Fp2, o4: Fp2): Fp12; - mulByFp2(lhs: Fp12, rhs: Fp2): Fp12; - conjugate(num: Fp12): Fp12; - finalExponentiate(num: Fp12): Fp12; - _cyclotomicSquare(num: Fp12): Fp12; - _cyclotomicExp(num: Fp12, n: bigint): Fp12; -}; -export declare function psiFrobenius(Fp: mod.IField, Fp2: Fp2Bls, base: Fp2): { - psi: (x: Fp2, y: Fp2) => [Fp2, Fp2]; - psi2: (x: Fp2, y: Fp2) => [Fp2, Fp2]; - G2psi: (c: WeierstrassPointCons, P: WeierstrassPoint) => WeierstrassPoint; - G2psi2: (c: WeierstrassPointCons, P: WeierstrassPoint) => WeierstrassPoint; - PSI_X: Fp2; - PSI_Y: Fp2; - PSI2_X: Fp2; - PSI2_Y: Fp2; -}; -export type Tower12Opts = { - ORDER: bigint; - X_LEN: number; - NONRESIDUE?: Fp; - FP2_NONRESIDUE: BigintTuple; - Fp2sqrt?: (num: Fp2) => Fp2; - Fp2mulByB: (num: Fp2) => Fp2; - Fp12finalExponentiate: (num: Fp12) => Fp12; -}; -export declare function tower12(opts: Tower12Opts): { - Fp: Readonly & Required, 'isOdd'>>>; - Fp2: Fp2Bls; - Fp6: Fp6Bls; - Fp12: Fp12Bls; -}; -//# sourceMappingURL=tower.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/tower.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/tower.d.ts.map deleted file mode 100644 index d6737159..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/tower.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tower.d.ts","sourceRoot":"","sources":["../../src/abstract/tower.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAO/E,MAAM,MAAM,WAAW,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC3C,MAAM,MAAM,EAAE,GAAG,MAAM,CAAC;AAGxB,MAAM,MAAM,GAAG,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAC7C,MAAM,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AACzE,MAAM,MAAM,GAAG,GAAG;IAAE,EAAE,EAAE,GAAG,CAAC;IAAC,EAAE,EAAE,GAAG,CAAC;IAAC,EAAE,EAAE,GAAG,CAAA;CAAE,CAAC;AAChD,MAAM,MAAM,IAAI,GAAG;IAAE,EAAE,EAAE,GAAG,CAAC;IAAC,EAAE,EAAE,GAAG,CAAA;CAAE,CAAC;AAExC,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM;IAAE,MAAM;IAAE,MAAM;IAAE,MAAM;IAAE,MAAM;IAAE,MAAM;IAC9C,MAAM;IAAE,MAAM;IAAE,MAAM;IAAE,MAAM;IAAE,MAAM;IAAE,MAAM;CAC/C,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG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CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,gBAAgB,CAAC,GAAG,CAAC,KAAK,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACzF,MAAM,EAAE,CAAC,CAAC,EAAE,oBAAoB,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,gBAAgB,CAAC,GAAG,CAAC,KAAK,gBAAgB,CAAC,GAAG,CAAC,CAAC;IAC1F,KAAK,EAAE,GAAG,CAAC;IACX,KAAK,EAAE,GAAG,CAAC;IACX,MAAM,EAAE,GAAG,CAAC;IACZ,MAAM,EAAE,GAAG,CAAC;CACb,CA8BA;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,EAAE,CAAC;IAChB,cAAc,EAAE,WAAW,CAAC;IAC5B,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,CAAC;IAC5B,SAAS,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,CAAC;IAC7B,qBAAqB,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,IAAI,CAAC;CAC5C,CAAC;AAosBF,wBAAgB,OAAO,CAAC,IAAI,EAAE,WAAW,GAAG;IAC1C,EAAE,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAC/E,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,OAAO,CAAC;CACf,CAMA"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/tower.js b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/tower.js deleted file mode 100644 index c400d2fb..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/tower.js +++ /dev/null @@ -1,714 +0,0 @@ -/** - * Towered extension fields. - * Rather than implementing a massive 12th-degree extension directly, it is more efficient - * to build it up from smaller extensions: a tower of extensions. - * - * For BLS12-381, the Fp12 field is implemented as a quadratic (degree two) extension, - * on top of a cubic (degree three) extension, on top of a quadratic extension of Fp. - * - * For more info: "Pairings for beginners" by Costello, section 7.3. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { bitGet, bitLen, concatBytes, notImplemented } from "../utils.js"; -import * as mod from "./modular.js"; -// Be friendly to bad ECMAScript parsers by not using bigint literals -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3); -function calcFrobeniusCoefficients(Fp, nonResidue, modulus, degree, num = 1, divisor) { - const _divisor = BigInt(divisor === undefined ? degree : divisor); - const towerModulus = modulus ** BigInt(degree); - const res = []; - for (let i = 0; i < num; i++) { - const a = BigInt(i + 1); - const powers = []; - for (let j = 0, qPower = _1n; j < degree; j++) { - const power = ((a * qPower - a) / _divisor) % towerModulus; - powers.push(Fp.pow(nonResidue, power)); - qPower *= modulus; - } - res.push(powers); - } - return res; -} -// This works same at least for bls12-381, bn254 and bls12-377 -export function psiFrobenius(Fp, Fp2, base) { - // GLV endomorphism Ψ(P) - const PSI_X = Fp2.pow(base, (Fp.ORDER - _1n) / _3n); // u^((p-1)/3) - const PSI_Y = Fp2.pow(base, (Fp.ORDER - _1n) / _2n); // u^((p-1)/2) - function psi(x, y) { - // This x10 faster than previous version in bls12-381 - const x2 = Fp2.mul(Fp2.frobeniusMap(x, 1), PSI_X); - const y2 = Fp2.mul(Fp2.frobeniusMap(y, 1), PSI_Y); - return [x2, y2]; - } - // Ψ²(P) endomorphism (psi2(x) = psi(psi(x))) - const PSI2_X = Fp2.pow(base, (Fp.ORDER ** _2n - _1n) / _3n); // u^((p^2 - 1)/3) - // This equals -1, which causes y to be Fp2.neg(y). - // But not sure if there are case when this is not true? - const PSI2_Y = Fp2.pow(base, (Fp.ORDER ** _2n - _1n) / _2n); // u^((p^2 - 1)/3) - if (!Fp2.eql(PSI2_Y, Fp2.neg(Fp2.ONE))) - throw new Error('psiFrobenius: PSI2_Y!==-1'); - function psi2(x, y) { - return [Fp2.mul(x, PSI2_X), Fp2.neg(y)]; - } - // Map points - const mapAffine = (fn) => (c, P) => { - const affine = P.toAffine(); - const p = fn(affine.x, affine.y); - return c.fromAffine({ x: p[0], y: p[1] }); - }; - const G2psi = mapAffine(psi); - const G2psi2 = mapAffine(psi2); - return { psi, psi2, G2psi, G2psi2, PSI_X, PSI_Y, PSI2_X, PSI2_Y }; -} -const Fp2fromBigTuple = (Fp, tuple) => { - if (tuple.length !== 2) - throw new Error('invalid tuple'); - const fps = tuple.map((n) => Fp.create(n)); - return { c0: fps[0], c1: fps[1] }; -}; -class _Field2 { - constructor(Fp, opts = {}) { - this.MASK = _1n; - const ORDER = Fp.ORDER; - const FP2_ORDER = ORDER * ORDER; - this.Fp = Fp; - this.ORDER = FP2_ORDER; - this.BITS = bitLen(FP2_ORDER); - this.BYTES = Math.ceil(bitLen(FP2_ORDER) / 8); - this.isLE = Fp.isLE; - this.ZERO = { c0: Fp.ZERO, c1: Fp.ZERO }; - this.ONE = { c0: Fp.ONE, c1: Fp.ZERO }; - this.Fp_NONRESIDUE = Fp.create(opts.NONRESIDUE || BigInt(-1)); - this.Fp_div2 = Fp.div(Fp.ONE, _2n); // 1/2 - this.NONRESIDUE = Fp2fromBigTuple(Fp, opts.FP2_NONRESIDUE); - // const Fp2Nonresidue = Fp2fromBigTuple(opts.FP2_NONRESIDUE); - this.FROBENIUS_COEFFICIENTS = calcFrobeniusCoefficients(Fp, this.Fp_NONRESIDUE, Fp.ORDER, 2)[0]; - this.mulByB = opts.Fp2mulByB; - Object.seal(this); - } - fromBigTuple(tuple) { - return Fp2fromBigTuple(this.Fp, tuple); - } - create(num) { - return num; - } - isValid({ c0, c1 }) { - function isValidC(num, ORDER) { - return typeof num === 'bigint' && _0n <= num && num < ORDER; - } - return isValidC(c0, this.ORDER) && isValidC(c1, this.ORDER); - } - is0({ c0, c1 }) { - return this.Fp.is0(c0) && this.Fp.is0(c1); - } - isValidNot0(num) { - return !this.is0(num) && this.isValid(num); - } - eql({ c0, c1 }, { c0: r0, c1: r1 }) { - return this.Fp.eql(c0, r0) && this.Fp.eql(c1, r1); - } - neg({ c0, c1 }) { - return { c0: this.Fp.neg(c0), c1: this.Fp.neg(c1) }; - } - pow(num, power) { - return mod.FpPow(this, num, power); - } - invertBatch(nums) { - return mod.FpInvertBatch(this, nums); - } - // Normalized - add(f1, f2) { - const { c0, c1 } = f1; - const { c0: r0, c1: r1 } = f2; - return { - c0: this.Fp.add(c0, r0), - c1: this.Fp.add(c1, r1), - }; - } - sub({ c0, c1 }, { c0: r0, c1: r1 }) { - return { - c0: this.Fp.sub(c0, r0), - c1: this.Fp.sub(c1, r1), - }; - } - mul({ c0, c1 }, rhs) { - const { Fp } = this; - if (typeof rhs === 'bigint') - return { c0: Fp.mul(c0, rhs), c1: Fp.mul(c1, rhs) }; - // (a+bi)(c+di) = (ac−bd) + (ad+bc)i - const { c0: r0, c1: r1 } = rhs; - let t1 = Fp.mul(c0, r0); // c0 * o0 - let t2 = Fp.mul(c1, r1); // c1 * o1 - // (T1 - T2) + ((c0 + c1) * (r0 + r1) - (T1 + T2))*i - const o0 = Fp.sub(t1, t2); - const o1 = Fp.sub(Fp.mul(Fp.add(c0, c1), Fp.add(r0, r1)), Fp.add(t1, t2)); - return { c0: o0, c1: o1 }; - } - sqr({ c0, c1 }) { - const { Fp } = this; - const a = Fp.add(c0, c1); - const b = Fp.sub(c0, c1); - const c = Fp.add(c0, c0); - return { c0: Fp.mul(a, b), c1: Fp.mul(c, c1) }; - } - // NonNormalized stuff - addN(a, b) { - return this.add(a, b); - } - subN(a, b) { - return this.sub(a, b); - } - mulN(a, b) { - return this.mul(a, b); - } - sqrN(a) { - return this.sqr(a); - } - // Why inversion for bigint inside Fp instead of Fp2? it is even used in that context? - div(lhs, rhs) { - const { Fp } = this; - // @ts-ignore - return this.mul(lhs, typeof rhs === 'bigint' ? Fp.inv(Fp.create(rhs)) : this.inv(rhs)); - } - inv({ c0: a, c1: b }) { - // We wish to find the multiplicative inverse of a nonzero - // element a + bu in Fp2. We leverage an identity - // - // (a + bu)(a - bu) = a² + b² - // - // which holds because u² = -1. This can be rewritten as - // - // (a + bu)(a - bu)/(a² + b²) = 1 - // - // because a² + b² = 0 has no nonzero solutions for (a, b). - // This gives that (a - bu)/(a² + b²) is the inverse - // of (a + bu). Importantly, this can be computing using - // only a single inversion in Fp. - const { Fp } = this; - const factor = Fp.inv(Fp.create(a * a + b * b)); - return { c0: Fp.mul(factor, Fp.create(a)), c1: Fp.mul(factor, Fp.create(-b)) }; - } - sqrt(num) { - // This is generic for all quadratic extensions (Fp2) - const { Fp } = this; - const Fp2 = this; - const { c0, c1 } = num; - if (Fp.is0(c1)) { - // if c0 is quadratic residue - if (mod.FpLegendre(Fp, c0) === 1) - return Fp2.create({ c0: Fp.sqrt(c0), c1: Fp.ZERO }); - else - return Fp2.create({ c0: Fp.ZERO, c1: Fp.sqrt(Fp.div(c0, this.Fp_NONRESIDUE)) }); - } - const a = Fp.sqrt(Fp.sub(Fp.sqr(c0), Fp.mul(Fp.sqr(c1), this.Fp_NONRESIDUE))); - let d = Fp.mul(Fp.add(a, c0), this.Fp_div2); - const legendre = mod.FpLegendre(Fp, d); - // -1, Quadratic non residue - if (legendre === -1) - d = Fp.sub(d, a); - const a0 = Fp.sqrt(d); - const candidateSqrt = Fp2.create({ c0: a0, c1: Fp.div(Fp.mul(c1, this.Fp_div2), a0) }); - if (!Fp2.eql(Fp2.sqr(candidateSqrt), num)) - throw new Error('Cannot find square root'); - // Normalize root: at this point candidateSqrt ** 2 = num, but also -candidateSqrt ** 2 = num - const x1 = candidateSqrt; - const x2 = Fp2.neg(x1); - const { re: re1, im: im1 } = Fp2.reim(x1); - const { re: re2, im: im2 } = Fp2.reim(x2); - if (im1 > im2 || (im1 === im2 && re1 > re2)) - return x1; - return x2; - } - // Same as sgn0_m_eq_2 in RFC 9380 - isOdd(x) { - const { re: x0, im: x1 } = this.reim(x); - const sign_0 = x0 % _2n; - const zero_0 = x0 === _0n; - const sign_1 = x1 % _2n; - return BigInt(sign_0 || (zero_0 && sign_1)) == _1n; - } - // Bytes util - fromBytes(b) { - const { Fp } = this; - if (b.length !== this.BYTES) - throw new Error('fromBytes invalid length=' + b.length); - return { c0: Fp.fromBytes(b.subarray(0, Fp.BYTES)), c1: Fp.fromBytes(b.subarray(Fp.BYTES)) }; - } - toBytes({ c0, c1 }) { - return concatBytes(this.Fp.toBytes(c0), this.Fp.toBytes(c1)); - } - cmov({ c0, c1 }, { c0: r0, c1: r1 }, c) { - return { - c0: this.Fp.cmov(c0, r0, c), - c1: this.Fp.cmov(c1, r1, c), - }; - } - reim({ c0, c1 }) { - return { re: c0, im: c1 }; - } - Fp4Square(a, b) { - const Fp2 = this; - const a2 = Fp2.sqr(a); - const b2 = Fp2.sqr(b); - return { - first: Fp2.add(Fp2.mulByNonresidue(b2), a2), // b² * Nonresidue + a² - second: Fp2.sub(Fp2.sub(Fp2.sqr(Fp2.add(a, b)), a2), b2), // (a + b)² - a² - b² - }; - } - // multiply by u + 1 - mulByNonresidue({ c0, c1 }) { - return this.mul({ c0, c1 }, this.NONRESIDUE); - } - frobeniusMap({ c0, c1 }, power) { - return { - c0, - c1: this.Fp.mul(c1, this.FROBENIUS_COEFFICIENTS[power % 2]), - }; - } -} -class _Field6 { - constructor(Fp2) { - this.MASK = _1n; - this.Fp2 = Fp2; - this.ORDER = Fp2.ORDER; // TODO: unused, but need to verify - this.BITS = 3 * Fp2.BITS; - this.BYTES = 3 * Fp2.BYTES; - this.isLE = Fp2.isLE; - this.ZERO = { c0: Fp2.ZERO, c1: Fp2.ZERO, c2: Fp2.ZERO }; - this.ONE = { c0: Fp2.ONE, c1: Fp2.ZERO, c2: Fp2.ZERO }; - const { Fp } = Fp2; - const frob = calcFrobeniusCoefficients(Fp2, Fp2.NONRESIDUE, Fp.ORDER, 6, 2, 3); - this.FROBENIUS_COEFFICIENTS_1 = frob[0]; - this.FROBENIUS_COEFFICIENTS_2 = frob[1]; - Object.seal(this); - } - add({ c0, c1, c2 }, { c0: r0, c1: r1, c2: r2 }) { - const { Fp2 } = this; - return { - c0: Fp2.add(c0, r0), - c1: Fp2.add(c1, r1), - c2: Fp2.add(c2, r2), - }; - } - sub({ c0, c1, c2 }, { c0: r0, c1: r1, c2: r2 }) { - const { Fp2 } = this; - return { - c0: Fp2.sub(c0, r0), - c1: Fp2.sub(c1, r1), - c2: Fp2.sub(c2, r2), - }; - } - mul({ c0, c1, c2 }, rhs) { - const { Fp2 } = this; - if (typeof rhs === 'bigint') { - return { - c0: Fp2.mul(c0, rhs), - c1: Fp2.mul(c1, rhs), - c2: Fp2.mul(c2, rhs), - }; - } - const { c0: r0, c1: r1, c2: r2 } = rhs; - const t0 = Fp2.mul(c0, r0); // c0 * o0 - const t1 = Fp2.mul(c1, r1); // c1 * o1 - const t2 = Fp2.mul(c2, r2); // c2 * o2 - return { - // t0 + (c1 + c2) * (r1 * r2) - (T1 + T2) * (u + 1) - c0: Fp2.add(t0, Fp2.mulByNonresidue(Fp2.sub(Fp2.mul(Fp2.add(c1, c2), Fp2.add(r1, r2)), Fp2.add(t1, t2)))), - // (c0 + c1) * (r0 + r1) - (T0 + T1) + T2 * (u + 1) - c1: Fp2.add(Fp2.sub(Fp2.mul(Fp2.add(c0, c1), Fp2.add(r0, r1)), Fp2.add(t0, t1)), Fp2.mulByNonresidue(t2)), - // T1 + (c0 + c2) * (r0 + r2) - T0 + T2 - c2: Fp2.sub(Fp2.add(t1, Fp2.mul(Fp2.add(c0, c2), Fp2.add(r0, r2))), Fp2.add(t0, t2)), - }; - } - sqr({ c0, c1, c2 }) { - const { Fp2 } = this; - let t0 = Fp2.sqr(c0); // c0² - let t1 = Fp2.mul(Fp2.mul(c0, c1), _2n); // 2 * c0 * c1 - let t3 = Fp2.mul(Fp2.mul(c1, c2), _2n); // 2 * c1 * c2 - let t4 = Fp2.sqr(c2); // c2² - return { - c0: Fp2.add(Fp2.mulByNonresidue(t3), t0), // T3 * (u + 1) + T0 - c1: Fp2.add(Fp2.mulByNonresidue(t4), t1), // T4 * (u + 1) + T1 - // T1 + (c0 - c1 + c2)² + T3 - T0 - T4 - c2: Fp2.sub(Fp2.sub(Fp2.add(Fp2.add(t1, Fp2.sqr(Fp2.add(Fp2.sub(c0, c1), c2))), t3), t0), t4), - }; - } - addN(a, b) { - return this.add(a, b); - } - subN(a, b) { - return this.sub(a, b); - } - mulN(a, b) { - return this.mul(a, b); - } - sqrN(a) { - return this.sqr(a); - } - create(num) { - return num; - } - isValid({ c0, c1, c2 }) { - const { Fp2 } = this; - return Fp2.isValid(c0) && Fp2.isValid(c1) && Fp2.isValid(c2); - } - is0({ c0, c1, c2 }) { - const { Fp2 } = this; - return Fp2.is0(c0) && Fp2.is0(c1) && Fp2.is0(c2); - } - isValidNot0(num) { - return !this.is0(num) && this.isValid(num); - } - neg({ c0, c1, c2 }) { - const { Fp2 } = this; - return { c0: Fp2.neg(c0), c1: Fp2.neg(c1), c2: Fp2.neg(c2) }; - } - eql({ c0, c1, c2 }, { c0: r0, c1: r1, c2: r2 }) { - const { Fp2 } = this; - return Fp2.eql(c0, r0) && Fp2.eql(c1, r1) && Fp2.eql(c2, r2); - } - sqrt(_) { - return notImplemented(); - } - // Do we need division by bigint at all? Should be done via order: - div(lhs, rhs) { - const { Fp2 } = this; - const { Fp } = Fp2; - return this.mul(lhs, typeof rhs === 'bigint' ? Fp.inv(Fp.create(rhs)) : this.inv(rhs)); - } - pow(num, power) { - return mod.FpPow(this, num, power); - } - invertBatch(nums) { - return mod.FpInvertBatch(this, nums); - } - inv({ c0, c1, c2 }) { - const { Fp2 } = this; - let t0 = Fp2.sub(Fp2.sqr(c0), Fp2.mulByNonresidue(Fp2.mul(c2, c1))); // c0² - c2 * c1 * (u + 1) - let t1 = Fp2.sub(Fp2.mulByNonresidue(Fp2.sqr(c2)), Fp2.mul(c0, c1)); // c2² * (u + 1) - c0 * c1 - let t2 = Fp2.sub(Fp2.sqr(c1), Fp2.mul(c0, c2)); // c1² - c0 * c2 - // 1/(((c2 * T1 + c1 * T2) * v) + c0 * T0) - let t4 = Fp2.inv(Fp2.add(Fp2.mulByNonresidue(Fp2.add(Fp2.mul(c2, t1), Fp2.mul(c1, t2))), Fp2.mul(c0, t0))); - return { c0: Fp2.mul(t4, t0), c1: Fp2.mul(t4, t1), c2: Fp2.mul(t4, t2) }; - } - // Bytes utils - fromBytes(b) { - const { Fp2 } = this; - if (b.length !== this.BYTES) - throw new Error('fromBytes invalid length=' + b.length); - const B2 = Fp2.BYTES; - return { - c0: Fp2.fromBytes(b.subarray(0, B2)), - c1: Fp2.fromBytes(b.subarray(B2, B2 * 2)), - c2: Fp2.fromBytes(b.subarray(2 * B2)), - }; - } - toBytes({ c0, c1, c2 }) { - const { Fp2 } = this; - return concatBytes(Fp2.toBytes(c0), Fp2.toBytes(c1), Fp2.toBytes(c2)); - } - cmov({ c0, c1, c2 }, { c0: r0, c1: r1, c2: r2 }, c) { - const { Fp2 } = this; - return { - c0: Fp2.cmov(c0, r0, c), - c1: Fp2.cmov(c1, r1, c), - c2: Fp2.cmov(c2, r2, c), - }; - } - fromBigSix(t) { - const { Fp2 } = this; - if (!Array.isArray(t) || t.length !== 6) - throw new Error('invalid Fp6 usage'); - return { - c0: Fp2.fromBigTuple(t.slice(0, 2)), - c1: Fp2.fromBigTuple(t.slice(2, 4)), - c2: Fp2.fromBigTuple(t.slice(4, 6)), - }; - } - frobeniusMap({ c0, c1, c2 }, power) { - const { Fp2 } = this; - return { - c0: Fp2.frobeniusMap(c0, power), - c1: Fp2.mul(Fp2.frobeniusMap(c1, power), this.FROBENIUS_COEFFICIENTS_1[power % 6]), - c2: Fp2.mul(Fp2.frobeniusMap(c2, power), this.FROBENIUS_COEFFICIENTS_2[power % 6]), - }; - } - mulByFp2({ c0, c1, c2 }, rhs) { - const { Fp2 } = this; - return { - c0: Fp2.mul(c0, rhs), - c1: Fp2.mul(c1, rhs), - c2: Fp2.mul(c2, rhs), - }; - } - mulByNonresidue({ c0, c1, c2 }) { - const { Fp2 } = this; - return { c0: Fp2.mulByNonresidue(c2), c1: c0, c2: c1 }; - } - // Sparse multiplication - mul1({ c0, c1, c2 }, b1) { - const { Fp2 } = this; - return { - c0: Fp2.mulByNonresidue(Fp2.mul(c2, b1)), - c1: Fp2.mul(c0, b1), - c2: Fp2.mul(c1, b1), - }; - } - // Sparse multiplication - mul01({ c0, c1, c2 }, b0, b1) { - const { Fp2 } = this; - let t0 = Fp2.mul(c0, b0); // c0 * b0 - let t1 = Fp2.mul(c1, b1); // c1 * b1 - return { - // ((c1 + c2) * b1 - T1) * (u + 1) + T0 - c0: Fp2.add(Fp2.mulByNonresidue(Fp2.sub(Fp2.mul(Fp2.add(c1, c2), b1), t1)), t0), - // (b0 + b1) * (c0 + c1) - T0 - T1 - c1: Fp2.sub(Fp2.sub(Fp2.mul(Fp2.add(b0, b1), Fp2.add(c0, c1)), t0), t1), - // (c0 + c2) * b0 - T0 + T1 - c2: Fp2.add(Fp2.sub(Fp2.mul(Fp2.add(c0, c2), b0), t0), t1), - }; - } -} -class _Field12 { - constructor(Fp6, opts) { - this.MASK = _1n; - const { Fp2 } = Fp6; - const { Fp } = Fp2; - this.Fp6 = Fp6; - this.ORDER = Fp2.ORDER; // TODO: verify if it's unuesd - this.BITS = 2 * Fp6.BITS; - this.BYTES = 2 * Fp6.BYTES; - this.isLE = Fp6.isLE; - this.ZERO = { c0: Fp6.ZERO, c1: Fp6.ZERO }; - this.ONE = { c0: Fp6.ONE, c1: Fp6.ZERO }; - this.FROBENIUS_COEFFICIENTS = calcFrobeniusCoefficients(Fp2, Fp2.NONRESIDUE, Fp.ORDER, 12, 1, 6)[0]; - this.X_LEN = opts.X_LEN; - this.finalExponentiate = opts.Fp12finalExponentiate; - } - create(num) { - return num; - } - isValid({ c0, c1 }) { - const { Fp6 } = this; - return Fp6.isValid(c0) && Fp6.isValid(c1); - } - is0({ c0, c1 }) { - const { Fp6 } = this; - return Fp6.is0(c0) && Fp6.is0(c1); - } - isValidNot0(num) { - return !this.is0(num) && this.isValid(num); - } - neg({ c0, c1 }) { - const { Fp6 } = this; - return { c0: Fp6.neg(c0), c1: Fp6.neg(c1) }; - } - eql({ c0, c1 }, { c0: r0, c1: r1 }) { - const { Fp6 } = this; - return Fp6.eql(c0, r0) && Fp6.eql(c1, r1); - } - sqrt(_) { - notImplemented(); - } - inv({ c0, c1 }) { - const { Fp6 } = this; - let t = Fp6.inv(Fp6.sub(Fp6.sqr(c0), Fp6.mulByNonresidue(Fp6.sqr(c1)))); // 1 / (c0² - c1² * v) - return { c0: Fp6.mul(c0, t), c1: Fp6.neg(Fp6.mul(c1, t)) }; // ((C0 * T) * T) + (-C1 * T) * w - } - div(lhs, rhs) { - const { Fp6 } = this; - const { Fp2 } = Fp6; - const { Fp } = Fp2; - return this.mul(lhs, typeof rhs === 'bigint' ? Fp.inv(Fp.create(rhs)) : this.inv(rhs)); - } - pow(num, power) { - return mod.FpPow(this, num, power); - } - invertBatch(nums) { - return mod.FpInvertBatch(this, nums); - } - // Normalized - add({ c0, c1 }, { c0: r0, c1: r1 }) { - const { Fp6 } = this; - return { - c0: Fp6.add(c0, r0), - c1: Fp6.add(c1, r1), - }; - } - sub({ c0, c1 }, { c0: r0, c1: r1 }) { - const { Fp6 } = this; - return { - c0: Fp6.sub(c0, r0), - c1: Fp6.sub(c1, r1), - }; - } - mul({ c0, c1 }, rhs) { - const { Fp6 } = this; - if (typeof rhs === 'bigint') - return { c0: Fp6.mul(c0, rhs), c1: Fp6.mul(c1, rhs) }; - let { c0: r0, c1: r1 } = rhs; - let t1 = Fp6.mul(c0, r0); // c0 * r0 - let t2 = Fp6.mul(c1, r1); // c1 * r1 - return { - c0: Fp6.add(t1, Fp6.mulByNonresidue(t2)), // T1 + T2 * v - // (c0 + c1) * (r0 + r1) - (T1 + T2) - c1: Fp6.sub(Fp6.mul(Fp6.add(c0, c1), Fp6.add(r0, r1)), Fp6.add(t1, t2)), - }; - } - sqr({ c0, c1 }) { - const { Fp6 } = this; - let ab = Fp6.mul(c0, c1); // c0 * c1 - return { - // (c1 * v + c0) * (c0 + c1) - AB - AB * v - c0: Fp6.sub(Fp6.sub(Fp6.mul(Fp6.add(Fp6.mulByNonresidue(c1), c0), Fp6.add(c0, c1)), ab), Fp6.mulByNonresidue(ab)), - c1: Fp6.add(ab, ab), - }; // AB + AB - } - // NonNormalized stuff - addN(a, b) { - return this.add(a, b); - } - subN(a, b) { - return this.sub(a, b); - } - mulN(a, b) { - return this.mul(a, b); - } - sqrN(a) { - return this.sqr(a); - } - // Bytes utils - fromBytes(b) { - const { Fp6 } = this; - if (b.length !== this.BYTES) - throw new Error('fromBytes invalid length=' + b.length); - return { - c0: Fp6.fromBytes(b.subarray(0, Fp6.BYTES)), - c1: Fp6.fromBytes(b.subarray(Fp6.BYTES)), - }; - } - toBytes({ c0, c1 }) { - const { Fp6 } = this; - return concatBytes(Fp6.toBytes(c0), Fp6.toBytes(c1)); - } - cmov({ c0, c1 }, { c0: r0, c1: r1 }, c) { - const { Fp6 } = this; - return { - c0: Fp6.cmov(c0, r0, c), - c1: Fp6.cmov(c1, r1, c), - }; - } - // Utils - // toString() { - // return '' + 'Fp12(' + this.c0 + this.c1 + '* w'); - // }, - // fromTuple(c: [Fp6, Fp6]) { - // return new Fp12(...c); - // } - fromBigTwelve(t) { - const { Fp6 } = this; - return { - c0: Fp6.fromBigSix(t.slice(0, 6)), - c1: Fp6.fromBigSix(t.slice(6, 12)), - }; - } - // Raises to q**i -th power - frobeniusMap(lhs, power) { - const { Fp6 } = this; - const { Fp2 } = Fp6; - const { c0, c1, c2 } = Fp6.frobeniusMap(lhs.c1, power); - const coeff = this.FROBENIUS_COEFFICIENTS[power % 12]; - return { - c0: Fp6.frobeniusMap(lhs.c0, power), - c1: Fp6.create({ - c0: Fp2.mul(c0, coeff), - c1: Fp2.mul(c1, coeff), - c2: Fp2.mul(c2, coeff), - }), - }; - } - mulByFp2({ c0, c1 }, rhs) { - const { Fp6 } = this; - return { - c0: Fp6.mulByFp2(c0, rhs), - c1: Fp6.mulByFp2(c1, rhs), - }; - } - conjugate({ c0, c1 }) { - return { c0, c1: this.Fp6.neg(c1) }; - } - // Sparse multiplication - mul014({ c0, c1 }, o0, o1, o4) { - const { Fp6 } = this; - const { Fp2 } = Fp6; - let t0 = Fp6.mul01(c0, o0, o1); - let t1 = Fp6.mul1(c1, o4); - return { - c0: Fp6.add(Fp6.mulByNonresidue(t1), t0), // T1 * v + T0 - // (c1 + c0) * [o0, o1+o4] - T0 - T1 - c1: Fp6.sub(Fp6.sub(Fp6.mul01(Fp6.add(c1, c0), o0, Fp2.add(o1, o4)), t0), t1), - }; - } - mul034({ c0, c1 }, o0, o3, o4) { - const { Fp6 } = this; - const { Fp2 } = Fp6; - const a = Fp6.create({ - c0: Fp2.mul(c0.c0, o0), - c1: Fp2.mul(c0.c1, o0), - c2: Fp2.mul(c0.c2, o0), - }); - const b = Fp6.mul01(c1, o3, o4); - const e = Fp6.mul01(Fp6.add(c0, c1), Fp2.add(o0, o3), o4); - return { - c0: Fp6.add(Fp6.mulByNonresidue(b), a), - c1: Fp6.sub(e, Fp6.add(a, b)), - }; - } - // A cyclotomic group is a subgroup of Fp^n defined by - // GΦₙ(p) = {α ∈ Fpⁿ : α^Φₙ(p) = 1} - // The result of any pairing is in a cyclotomic subgroup - // https://eprint.iacr.org/2009/565.pdf - // https://eprint.iacr.org/2010/354.pdf - _cyclotomicSquare({ c0, c1 }) { - const { Fp6 } = this; - const { Fp2 } = Fp6; - const { c0: c0c0, c1: c0c1, c2: c0c2 } = c0; - const { c0: c1c0, c1: c1c1, c2: c1c2 } = c1; - const { first: t3, second: t4 } = Fp2.Fp4Square(c0c0, c1c1); - const { first: t5, second: t6 } = Fp2.Fp4Square(c1c0, c0c2); - const { first: t7, second: t8 } = Fp2.Fp4Square(c0c1, c1c2); - const t9 = Fp2.mulByNonresidue(t8); // T8 * (u + 1) - return { - c0: Fp6.create({ - c0: Fp2.add(Fp2.mul(Fp2.sub(t3, c0c0), _2n), t3), // 2 * (T3 - c0c0) + T3 - c1: Fp2.add(Fp2.mul(Fp2.sub(t5, c0c1), _2n), t5), // 2 * (T5 - c0c1) + T5 - c2: Fp2.add(Fp2.mul(Fp2.sub(t7, c0c2), _2n), t7), - }), // 2 * (T7 - c0c2) + T7 - c1: Fp6.create({ - c0: Fp2.add(Fp2.mul(Fp2.add(t9, c1c0), _2n), t9), // 2 * (T9 + c1c0) + T9 - c1: Fp2.add(Fp2.mul(Fp2.add(t4, c1c1), _2n), t4), // 2 * (T4 + c1c1) + T4 - c2: Fp2.add(Fp2.mul(Fp2.add(t6, c1c2), _2n), t6), - }), - }; // 2 * (T6 + c1c2) + T6 - } - // https://eprint.iacr.org/2009/565.pdf - _cyclotomicExp(num, n) { - let z = this.ONE; - for (let i = this.X_LEN - 1; i >= 0; i--) { - z = this._cyclotomicSquare(z); - if (bitGet(n, i)) - z = this.mul(z, num); - } - return z; - } -} -export function tower12(opts) { - const Fp = mod.Field(opts.ORDER); - const Fp2 = new _Field2(Fp, opts); - const Fp6 = new _Field6(Fp2); - const Fp12 = new _Field12(Fp6, opts); - return { Fp, Fp2, Fp6, Fp12 }; -} -//# sourceMappingURL=tower.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/tower.js.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/tower.js.map deleted file mode 100644 index 10a46495..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/tower.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tower.js","sourceRoot":"","sources":["../../src/abstract/tower.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,sEAAsE;AACtE,OAAO,EAAE,MA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AC,CAAC;IACX,CAAC;CACF;AAED,MAAM,UAAU,OAAO,CAAC,IAAiB;IAMvC,MAAM,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACjC,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IAClC,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IAC7B,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACrC,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;AAChC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/utils.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/utils.d.ts deleted file mode 100644 index 930b4854..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/utils.d.ts +++ /dev/null @@ -1,78 +0,0 @@ -/** - * Deprecated module: moved from curves/abstract/utils.js to curves/utils.js - * @module - */ -import * as u from '../utils.ts'; -/** @deprecated moved to `@noble/curves/utils.js` */ -export type Hex = u.Hex; -/** @deprecated moved to `@noble/curves/utils.js` */ -export type PrivKey = u.PrivKey; -/** @deprecated moved to `@noble/curves/utils.js` */ -export type CHash = u.CHash; -/** @deprecated moved to `@noble/curves/utils.js` */ -export type FHash = u.FHash; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const abytes: typeof u.abytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const anumber: typeof u.anumber; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const bytesToHex: typeof u.bytesToHex; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const bytesToUtf8: typeof u.bytesToUtf8; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const concatBytes: typeof u.concatBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const hexToBytes: typeof u.hexToBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const isBytes: typeof u.isBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const randomBytes: typeof u.randomBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const utf8ToBytes: typeof u.utf8ToBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const abool: typeof u.abool; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const numberToHexUnpadded: typeof u.numberToHexUnpadded; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const hexToNumber: typeof u.hexToNumber; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const bytesToNumberBE: typeof u.bytesToNumberBE; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const bytesToNumberLE: typeof u.bytesToNumberLE; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const numberToBytesBE: typeof u.numberToBytesBE; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const numberToBytesLE: typeof u.numberToBytesLE; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const numberToVarBytesBE: typeof u.numberToVarBytesBE; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const ensureBytes: typeof u.ensureBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const equalBytes: typeof u.equalBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const copyBytes: typeof u.copyBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const asciiToBytes: typeof u.asciiToBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const inRange: typeof u.inRange; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const aInRange: typeof u.aInRange; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const bitLen: typeof u.bitLen; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const bitGet: typeof u.bitGet; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const bitSet: typeof u.bitSet; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const bitMask: typeof u.bitMask; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const createHmacDrbg: typeof u.createHmacDrbg; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const notImplemented: typeof u.notImplemented; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const memoized: typeof u.memoized; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const validateObject: typeof u.validateObject; -/** @deprecated moved to `@noble/curves/utils.js` */ -export declare const isHash: typeof u.isHash; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/utils.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/utils.d.ts.map deleted file mode 100644 index a6338c3c..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/abstract/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AAEjC,oDAAoD;AACpD,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC;AACxB,oDAAoD;AACpD,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC;AAChC,oDAAoD;AACpD,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;AAC5B,oDAAoD;AACpD,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;AAE5B,oDAAoD;AACpD,eAAO,MAAM,MAAM,EAAE,OAAO,CAAC,CAAC,MAAiB,CAAC;AAChD,oDAAoD;AACpD,eAAO,MAAM,OAAO,EAAE,OAAO,CAAC,CAAC,OAAmB,CAAC;AACnD,oDAAoD;AACpD,eAAO,MAAM,UAAU,EAAE,OAAO,CAAC,CAAC,UAAyB,CAAC;AAC5D,oDAAoD;AACpD,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D,eAAO,MAAM,SAAS,EAAE,OAAO,CAAC,CAAC,SAAuB,CAAC;AACzD,oDAAoD;AACpD,eAAO,MAAM,YAAY,EAAE,OAAO,CAAC,CAAC,YAA6B,CAAC;AAClE,oDAAoD;AACpD,eAAO,MAAM,OAAO,EAAE,OAAO,CAAC,CAAC,OAAmB,CAAC;AACnD,oDAAoD;AACpD,eAAO,MAAM,QAAQ,EAAE,OAAO,CAAC,CAAC,QAAqB,CAAC;AACtD,oDAAoD;AACpD,eAAO,MAAM,MAAM,EAAE,OAAO,CAAC,CAAC,MAAiB,CAAC;AAChD,oDAAoD;AACpD,eAAO,MAAM,MAAM,EAAE,OAAO,CAAC,CAAC,MAAiB,CAAC;AAChD,oDAAoD;AACpD,eAAO,MAAM,MAAM,EAAE,OAAO,CAAC,CAAC,MAAiB,CAAC;AAChD,oDAAoD;AACpD,eAAO,MAAM,OAAO,EAAE,OAAO,CAAC,CAAC,OAAmB,CAAC;AACnD,oDAAoD;AACpD,eAAO,MAAM,cAAc,EAAE,OAAO,CAAC,CAAC,cAAiC,CAAC;AACxE,oDAAoD;AACpD,eAAO,MAAM,cAAc,EAAE,OAAO,CAAC,CAAC,cAAiC,CAAC;AACxE,oDAAoD;AACpD,eAAO,MAAM,QAAQ,EAAE,OAAO,CAAC,CAAC,QAAqB,CAAC;AACtD,oDAAoD;AACpD,eAAO,MAAM,cAAc,EAAE,OAAO,CAAC,CAAC,cAAiC,CAAC;AACxE,oDAAoD;AACpD,eAAO,MAAM,MAAM,EAAE,OAAO,CAAC,CAAC,MAAiB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/utils.js b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/utils.js deleted file mode 100644 index 60423812..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/utils.js +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Deprecated module: moved from curves/abstract/utils.js to curves/utils.js - * @module - */ -import * as u from "../utils.js"; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const abytes = u.abytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const anumber = u.anumber; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const bytesToHex = u.bytesToHex; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const bytesToUtf8 = u.bytesToUtf8; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const concatBytes = u.concatBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const hexToBytes = u.hexToBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const isBytes = u.isBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const randomBytes = u.randomBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const utf8ToBytes = u.utf8ToBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const abool = u.abool; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const numberToHexUnpadded = u.numberToHexUnpadded; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const hexToNumber = u.hexToNumber; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const bytesToNumberBE = u.bytesToNumberBE; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const bytesToNumberLE = u.bytesToNumberLE; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const numberToBytesBE = u.numberToBytesBE; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const numberToBytesLE = u.numberToBytesLE; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const numberToVarBytesBE = u.numberToVarBytesBE; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const ensureBytes = u.ensureBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const equalBytes = u.equalBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const copyBytes = u.copyBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const asciiToBytes = u.asciiToBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const inRange = u.inRange; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const aInRange = u.aInRange; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const bitLen = u.bitLen; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const bitGet = u.bitGet; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const bitSet = u.bitSet; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const bitMask = u.bitMask; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const createHmacDrbg = u.createHmacDrbg; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const notImplemented = u.notImplemented; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const memoized = u.memoized; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const validateObject = u.validateObject; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const isHash = u.isHash; -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/utils.js.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/utils.js.map deleted file mode 100644 index 64f31bc6..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/abstract/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AAWjC,oDAAoD;AACpD,MAAM,CAAC,MAAM,MAAM,GAAoB,CAAC,CAAC,MAAM,CAAC;AAChD,oDAAoD;AACpD,MAAM,CAAC,MAAM,OAAO,GAAqB,CAAC,CAAC,OAAO,CAAC;AACnD,oDAAoD;AACpD,MAAM,CAAC,MAAM,UAAU,GAAwB,CAAC,CAAC,UAAU,CAAC;AAC5D,oDAAoD;AACpD,MAAM,CAAC,MAAM,WAAW,GAAyB,CAAC,CAAC,WAAW,CAAC;AAC/D,oDAAoD;AACpD,MAAM,CAAC,MAAM,WAAW,GAAyB,CAAC,CAAC,WAAW,CAAC;AAC/D,oDAAoD;AACpD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ACpD,MAAM,CAAC,MAAM,OAAO,GAAqB,CAAC,CAAC,OAAO,CAAC;AACnD,oDAAoD;AACpD,MAAM,CAAC,MAAM,QAAQ,GAAsB,CAAC,CAAC,QAAQ,CAAC;AACtD,oDAAoD;AACpD,MAAM,CAAC,MAAM,MAAM,GAAoB,CAAC,CAAC,MAAM,CAAC;AAChD,oDAAoD;AACpD,MAAM,CAAC,MAAM,MAAM,GAAoB,CAAC,CAAC,MAAM,CAAC;AAChD,oDAAoD;AACpD,MAAM,CAAC,MAAM,MAAM,GAAoB,CAAC,CAAC,MAAM,CAAC;AAChD,oDAAoD;AACpD,MAAM,CAAC,MAAM,OAAO,GAAqB,CAAC,CAAC,OAAO,CAAC;AACnD,oDAAoD;AACpD,MAAM,CAAC,MAAM,cAAc,GAA4B,CAAC,CAAC,cAAc,CAAC;AACxE,oDAAoD;AACpD,MAAM,CAAC,MAAM,cAAc,GAA4B,CAAC,CAAC,cAAc,CAAC;AACxE,oDAAoD;AACpD,MAAM,CAAC,MAAM,QAAQ,GAAsB,CAAC,CAAC,QAAQ,CAAC;AACtD,oDAAoD;AACpD,MAAM,CAAC,MAAM,cAAc,GAA4B,CAAC,CAAC,cAAc,CAAC;AACxE,oDAAoD;AACpD,MAAM,CAAC,MAAM,MAAM,GAAoB,CAAC,CAAC,MAAM,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/weierstrass.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/weierstrass.d.ts deleted file mode 100644 index 9477038b..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/weierstrass.d.ts +++ /dev/null @@ -1,416 +0,0 @@ -import { type CHash, type Hex, type PrivKey } from '../utils.ts'; -import { type AffinePoint, type BasicCurve, type CurveLengths, type CurvePoint, type CurvePointCons } from './curve.ts'; -import { type IField, type NLength } from './modular.ts'; -export type { AffinePoint }; -export type HmacFnSync = (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array; -type EndoBasis = [[bigint, bigint], [bigint, bigint]]; -/** - * When Weierstrass curve has `a=0`, it becomes Koblitz curve. - * Koblitz curves allow using **efficiently-computable GLV endomorphism ψ**. - * Endomorphism uses 2x less RAM, speeds up precomputation by 2x and ECDH / key recovery by 20%. - * For precomputed wNAF it trades off 1/2 init time & 1/3 ram for 20% perf hit. - * - * Endomorphism consists of beta, lambda and splitScalar: - * - * 1. GLV endomorphism ψ transforms a point: `P = (x, y) ↦ ψ(P) = (β·x mod p, y)` - * 2. GLV scalar decomposition transforms a scalar: `k ≡ k₁ + k₂·λ (mod n)` - * 3. Then these are combined: `k·P = k₁·P + k₂·ψ(P)` - * 4. Two 128-bit point-by-scalar multiplications + one point addition is faster than - * one 256-bit multiplication. - * - * where - * * beta: β ∈ Fₚ with β³ = 1, β ≠ 1 - * * lambda: λ ∈ Fₙ with λ³ = 1, λ ≠ 1 - * * splitScalar decomposes k ↦ k₁, k₂, by using reduced basis vectors. - * Gauss lattice reduction calculates them from initial basis vectors `(n, 0), (-λ, 0)` - * - * Check out `test/misc/endomorphism.js` and - * [gist](https://gist.github.com/paulmillr/eb670806793e84df628a7c434a873066). - */ -export type EndomorphismOpts = { - beta: bigint; - basises?: EndoBasis; - splitScalar?: (k: bigint) => { - k1neg: boolean; - k1: bigint; - k2neg: boolean; - k2: bigint; - }; -}; -export type ScalarEndoParts = { - k1neg: boolean; - k1: bigint; - k2neg: boolean; - k2: bigint; -}; -/** - * Splits scalar for GLV endomorphism. - */ -export declare function _splitEndoScalar(k: bigint, basis: EndoBasis, n: bigint): ScalarEndoParts; -export type ECDSASigFormat = 'compact' | 'recovered' | 'der'; -export type ECDSARecoverOpts = { - prehash?: boolean; -}; -export type ECDSAVerifyOpts = { - prehash?: boolean; - lowS?: boolean; - format?: ECDSASigFormat; -}; -export type ECDSASignOpts = { - prehash?: boolean; - lowS?: boolean; - format?: ECDSASigFormat; - extraEntropy?: Uint8Array | boolean; -}; -/** Instance methods for 3D XYZ projective points. */ -export interface WeierstrassPoint extends CurvePoint> { - /** projective X coordinate. Different from affine x. */ - readonly X: T; - /** projective Y coordinate. Different from affine y. */ - readonly Y: T; - /** projective z coordinate */ - readonly Z: T; - /** affine x coordinate. Different from projective X. */ - get x(): T; - /** affine y coordinate. Different from projective Y. */ - get y(): T; - /** Encodes point using IEEE P1363 (DER) encoding. First byte is 2/3/4. Default = isCompressed. */ - toBytes(isCompressed?: boolean): Uint8Array; - toHex(isCompressed?: boolean): string; - /** @deprecated use `.X` */ - readonly px: T; - /** @deprecated use `.Y` */ - readonly py: T; - /** @deprecated use `.Z` */ - readonly pz: T; - /** @deprecated use `toBytes` */ - toRawBytes(isCompressed?: boolean): Uint8Array; - /** @deprecated use `multiplyUnsafe` */ - multiplyAndAddUnsafe(Q: WeierstrassPoint, a: bigint, b: bigint): WeierstrassPoint | undefined; - /** @deprecated use `p.y % 2n === 0n` */ - hasEvenY(): boolean; - /** @deprecated use `p.precompute(windowSize)` */ - _setWindowSize(windowSize: number): void; -} -/** Static methods for 3D XYZ projective points. */ -export interface WeierstrassPointCons extends CurvePointCons> { - /** Does NOT validate if the point is valid. Use `.assertValidity()`. */ - new (X: T, Y: T, Z: T): WeierstrassPoint; - CURVE(): WeierstrassOpts; - /** @deprecated use `Point.BASE.multiply(Point.Fn.fromBytes(privateKey))` */ - fromPrivateKey(privateKey: PrivKey): WeierstrassPoint; - /** @deprecated use `import { normalizeZ } from '@noble/curves/abstract/curve.js';` */ - normalizeZ(points: WeierstrassPoint[]): WeierstrassPoint[]; - /** @deprecated use `import { pippenger } from '@noble/curves/abstract/curve.js';` */ - msm(points: WeierstrassPoint[], scalars: bigint[]): WeierstrassPoint; -} -/** - * Weierstrass curve options. - * - * * p: prime characteristic (order) of finite field, in which arithmetics is done - * * n: order of prime subgroup a.k.a total amount of valid curve points - * * h: cofactor, usually 1. h*n is group order; n is subgroup order - * * a: formula param, must be in field of p - * * b: formula param, must be in field of p - * * Gx: x coordinate of generator point a.k.a. base point - * * Gy: y coordinate of generator point - */ -export type WeierstrassOpts = Readonly<{ - p: bigint; - n: bigint; - h: bigint; - a: T; - b: T; - Gx: T; - Gy: T; -}>; -export type WeierstrassExtraOpts = Partial<{ - Fp: IField; - Fn: IField; - allowInfinityPoint: boolean; - endo: EndomorphismOpts; - isTorsionFree: (c: WeierstrassPointCons, point: WeierstrassPoint) => boolean; - clearCofactor: (c: WeierstrassPointCons, point: WeierstrassPoint) => WeierstrassPoint; - fromBytes: (bytes: Uint8Array) => AffinePoint; - toBytes: (c: WeierstrassPointCons, point: WeierstrassPoint, isCompressed: boolean) => Uint8Array; -}>; -/** - * Options for ECDSA signatures over a Weierstrass curve. - * - * * lowS: (default: true) whether produced / verified signatures occupy low half of ecdsaOpts.p. Prevents malleability. - * * hmac: (default: noble-hashes hmac) function, would be used to init hmac-drbg for k generation. - * * randomBytes: (default: webcrypto os-level CSPRNG) custom method for fetching secure randomness. - * * bits2int, bits2int_modN: used in sigs, sometimes overridden by curves - */ -export type ECDSAOpts = Partial<{ - lowS: boolean; - hmac: HmacFnSync; - randomBytes: (bytesLength?: number) => Uint8Array; - bits2int: (bytes: Uint8Array) => bigint; - bits2int_modN: (bytes: Uint8Array) => bigint; -}>; -/** - * Elliptic Curve Diffie-Hellman interface. - * Provides keygen, secret-to-public conversion, calculating shared secrets. - */ -export interface ECDH { - keygen: (seed?: Uint8Array) => { - secretKey: Uint8Array; - publicKey: Uint8Array; - }; - getPublicKey: (secretKey: PrivKey, isCompressed?: boolean) => Uint8Array; - getSharedSecret: (secretKeyA: PrivKey, publicKeyB: Hex, isCompressed?: boolean) => Uint8Array; - Point: WeierstrassPointCons; - utils: { - isValidSecretKey: (secretKey: PrivKey) => boolean; - isValidPublicKey: (publicKey: Uint8Array, isCompressed?: boolean) => boolean; - randomSecretKey: (seed?: Uint8Array) => Uint8Array; - /** @deprecated use `randomSecretKey` */ - randomPrivateKey: (seed?: Uint8Array) => Uint8Array; - /** @deprecated use `isValidSecretKey` */ - isValidPrivateKey: (secretKey: PrivKey) => boolean; - /** @deprecated use `Point.Fn.fromBytes()` */ - normPrivateKeyToScalar: (key: PrivKey) => bigint; - /** @deprecated use `point.precompute()` */ - precompute: (windowSize?: number, point?: WeierstrassPoint) => WeierstrassPoint; - }; - lengths: CurveLengths; -} -/** - * ECDSA interface. - * Only supported for prime fields, not Fp2 (extension fields). - */ -export interface ECDSA extends ECDH { - sign: (message: Hex, secretKey: PrivKey, opts?: ECDSASignOpts) => ECDSASigRecovered; - verify: (signature: Uint8Array, message: Uint8Array, publicKey: Uint8Array, opts?: ECDSAVerifyOpts) => boolean; - recoverPublicKey(signature: Uint8Array, message: Uint8Array, opts?: ECDSARecoverOpts): Uint8Array; - Signature: ECDSASignatureCons; -} -export declare class DERErr extends Error { - constructor(m?: string); -} -export type IDER = { - Err: typeof DERErr; - _tlv: { - encode: (tag: number, data: string) => string; - decode(tag: number, data: Uint8Array): { - v: Uint8Array; - l: Uint8Array; - }; - }; - _int: { - encode(num: bigint): string; - decode(data: Uint8Array): bigint; - }; - toSig(hex: string | Uint8Array): { - r: bigint; - s: bigint; - }; - hexFromSig(sig: { - r: bigint; - s: bigint; - }): string; -}; -/** - * ASN.1 DER encoding utilities. ASN is very complex & fragile. Format: - * - * [0x30 (SEQUENCE), bytelength, 0x02 (INTEGER), intLength, R, 0x02 (INTEGER), intLength, S] - * - * Docs: https://letsencrypt.org/docs/a-warm-welcome-to-asn1-and-der/, https://luca.ntop.org/Teaching/Appunti/asn1.html - */ -export declare const DER: IDER; -export declare function _normFnElement(Fn: IField, key: PrivKey): bigint; -/** - * Creates weierstrass Point constructor, based on specified curve options. - * - * @example -```js -const opts = { - p: BigInt('0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff'), - n: BigInt('0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551'), - h: BigInt(1), - a: BigInt('0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc'), - b: BigInt('0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b'), - Gx: BigInt('0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296'), - Gy: BigInt('0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5'), -}; -const p256_Point = weierstrass(opts); -``` - */ -export declare function weierstrassN(params: WeierstrassOpts, extraOpts?: WeierstrassExtraOpts): WeierstrassPointCons; -/** Methods of ECDSA signature instance. */ -export interface ECDSASignature { - readonly r: bigint; - readonly s: bigint; - readonly recovery?: number; - addRecoveryBit(recovery: number): ECDSASigRecovered; - hasHighS(): boolean; - toBytes(format?: string): Uint8Array; - toHex(format?: string): string; - /** @deprecated */ - assertValidity(): void; - /** @deprecated */ - normalizeS(): ECDSASignature; - /** @deprecated use standalone method `curve.recoverPublicKey(sig.toBytes('recovered'), msg)` */ - recoverPublicKey(msgHash: Hex): WeierstrassPoint; - /** @deprecated use `.toBytes('compact')` */ - toCompactRawBytes(): Uint8Array; - /** @deprecated use `.toBytes('compact')` */ - toCompactHex(): string; - /** @deprecated use `.toBytes('der')` */ - toDERRawBytes(): Uint8Array; - /** @deprecated use `.toBytes('der')` */ - toDERHex(): string; -} -export type ECDSASigRecovered = ECDSASignature & { - readonly recovery: number; -}; -/** Methods of ECDSA signature constructor. */ -export type ECDSASignatureCons = { - new (r: bigint, s: bigint, recovery?: number): ECDSASignature; - fromBytes(bytes: Uint8Array, format?: ECDSASigFormat): ECDSASignature; - fromHex(hex: string, format?: ECDSASigFormat): ECDSASignature; - /** @deprecated use `.fromBytes(bytes, 'compact')` */ - fromCompact(hex: Hex): ECDSASignature; - /** @deprecated use `.fromBytes(bytes, 'der')` */ - fromDER(hex: Hex): ECDSASignature; -}; -/** - * Implementation of the Shallue and van de Woestijne method for any weierstrass curve. - * TODO: check if there is a way to merge this with uvRatio in Edwards; move to modular. - * b = True and y = sqrt(u / v) if (u / v) is square in F, and - * b = False and y = sqrt(Z * (u / v)) otherwise. - * @param Fp - * @param Z - * @returns - */ -export declare function SWUFpSqrtRatio(Fp: IField, Z: T): (u: T, v: T) => { - isValid: boolean; - value: T; -}; -/** - * Simplified Shallue-van de Woestijne-Ulas Method - * https://www.rfc-editor.org/rfc/rfc9380#section-6.6.2 - */ -export declare function mapToCurveSimpleSWU(Fp: IField, opts: { - A: T; - B: T; - Z: T; -}): (u: T) => { - x: T; - y: T; -}; -/** - * Sometimes users only need getPublicKey, getSharedSecret, and secret key handling. - * This helper ensures no signature functionality is present. Less code, smaller bundle size. - */ -export declare function ecdh(Point: WeierstrassPointCons, ecdhOpts?: { - randomBytes?: (bytesLength?: number) => Uint8Array; -}): ECDH; -/** - * Creates ECDSA signing interface for given elliptic curve `Point` and `hash` function. - * We need `hash` for 2 features: - * 1. Message prehash-ing. NOT used if `sign` / `verify` are called with `prehash: false` - * 2. k generation in `sign`, using HMAC-drbg(hash) - * - * ECDSAOpts are only rarely needed. - * - * @example - * ```js - * const p256_Point = weierstrass(...); - * const p256_sha256 = ecdsa(p256_Point, sha256); - * const p256_sha224 = ecdsa(p256_Point, sha224); - * const p256_sha224_r = ecdsa(p256_Point, sha224, { randomBytes: (length) => { ... } }); - * ``` - */ -export declare function ecdsa(Point: WeierstrassPointCons, hash: CHash, ecdsaOpts?: ECDSAOpts): ECDSA; -/** @deprecated use ECDSASignature */ -export type SignatureType = ECDSASignature; -/** @deprecated use ECDSASigRecovered */ -export type RecoveredSignatureType = ECDSASigRecovered; -/** @deprecated switch to Uint8Array signatures in format 'compact' */ -export type SignatureLike = { - r: bigint; - s: bigint; -}; -export type ECDSAExtraEntropy = Hex | boolean; -/** @deprecated use `ECDSAExtraEntropy` */ -export type Entropy = Hex | boolean; -export type BasicWCurve = BasicCurve & { - a: T; - b: T; - allowedPrivateKeyLengths?: readonly number[]; - wrapPrivateKey?: boolean; - endo?: EndomorphismOpts; - isTorsionFree?: (c: WeierstrassPointCons, point: WeierstrassPoint) => boolean; - clearCofactor?: (c: WeierstrassPointCons, point: WeierstrassPoint) => WeierstrassPoint; -}; -/** @deprecated use ECDSASignOpts */ -export type SignOpts = ECDSASignOpts; -/** @deprecated use ECDSASignOpts */ -export type VerOpts = ECDSAVerifyOpts; -/** @deprecated use WeierstrassPoint */ -export type ProjPointType = WeierstrassPoint; -/** @deprecated use WeierstrassPointCons */ -export type ProjConstructor = WeierstrassPointCons; -/** @deprecated use ECDSASignatureCons */ -export type SignatureConstructor = ECDSASignatureCons; -export type CurvePointsType = BasicWCurve & { - fromBytes?: (bytes: Uint8Array) => AffinePoint; - toBytes?: (c: WeierstrassPointCons, point: WeierstrassPoint, isCompressed: boolean) => Uint8Array; -}; -export type CurvePointsTypeWithLength = Readonly & Partial>; -export type CurvePointsRes = { - Point: WeierstrassPointCons; - /** @deprecated use `Point.CURVE()` */ - CURVE: CurvePointsType; - /** @deprecated use `Point` */ - ProjectivePoint: WeierstrassPointCons; - /** @deprecated use `Point.Fn.fromBytes(privateKey)` */ - normPrivateKeyToScalar: (key: PrivKey) => bigint; - /** @deprecated */ - weierstrassEquation: (x: T) => T; - /** @deprecated use `Point.Fn.isValidNot0(num)` */ - isWithinCurveOrder: (num: bigint) => boolean; -}; -/** @deprecated use `Uint8Array` */ -export type PubKey = Hex | WeierstrassPoint; -export type CurveType = BasicWCurve & { - hash: CHash; - hmac?: HmacFnSync; - randomBytes?: (bytesLength?: number) => Uint8Array; - lowS?: boolean; - bits2int?: (bytes: Uint8Array) => bigint; - bits2int_modN?: (bytes: Uint8Array) => bigint; -}; -export type CurveFn = { - /** @deprecated use `Point.CURVE()` */ - CURVE: CurvePointsType; - keygen: ECDSA['keygen']; - getPublicKey: ECDSA['getPublicKey']; - getSharedSecret: ECDSA['getSharedSecret']; - sign: ECDSA['sign']; - verify: ECDSA['verify']; - Point: WeierstrassPointCons; - /** @deprecated use `Point` */ - ProjectivePoint: WeierstrassPointCons; - Signature: ECDSASignatureCons; - utils: ECDSA['utils']; - lengths: ECDSA['lengths']; -}; -/** @deprecated use `weierstrass` in newer releases */ -export declare function weierstrassPoints(c: CurvePointsTypeWithLength): CurvePointsRes; -export type WsPointComposed = { - CURVE: WeierstrassOpts; - curveOpts: WeierstrassExtraOpts; -}; -export type WsComposed = { - /** @deprecated use `Point.CURVE()` */ - CURVE: WeierstrassOpts; - hash: CHash; - curveOpts: WeierstrassExtraOpts; - ecdsaOpts: ECDSAOpts; -}; -export declare function _legacyHelperEquat(Fp: IField, a: T, b: T): (x: T) => T; -export declare function weierstrass(c: CurveType): CurveFn; -//# sourceMappingURL=weierstrass.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/weierstrass.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/weierstrass.d.ts.map deleted file mode 100644 index 4095b505..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/weierstrass.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"weierstrass.d.ts","sourceRoot":"","sources":["../../src/abstract/weierstrass.ts"],"names":[],"mappings":"AA6BA,OAAO,EAkBL,KAAK,KAAK,EACV,KAAK,GAAG,EACR,KAAK,OAAO,EACb,MAAM,aAAa,CAAC;AACrB,OAAO,EAOL,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,cAAc,EACpB,MAAM,YAAY,CAAC;AACpB,OAAO,EAOL,KAAK,MAAM,EACX,KAAK,OAAO,EACb,MAAM,cAAc,CAAC;AAEtB,YAAY,EAAE,WAAW,EAAE,CAAC;AAC5B,MAAM,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,QAAQ,EAAE,UAAU,EAAE,KAAK,UAAU,CAAC;AAEpF,KAAK,SAAS,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AACtD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,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CAAC,CAAC;CAC3B,CAAC;AACF,sDAAsD;AACtD,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,CAAC,EAAE,yBAAyB,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAIvF;AACD,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI;IAC/B,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;IAC1B,SAAS,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC;CACpC,CAAC;AACF,MAAM,MAAM,UAAU,GAAG;IACvB,sCAAsC;IACtC,KAAK,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IAC/B,IAAI,EAAE,KAAK,CAAC;IACZ,SAAS,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAC;IACxC,SAAS,EAAE,SAAS,CAAC;CACtB,CAAC;AA2CF,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAW5E;AA+BD,wBAAgB,WAAW,CAAC,CAAC,EAAE,SAAS,GAAG,OAAO,CAKjD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/weierstrass.js b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/weierstrass.js deleted file mode 100644 index 7830e34b..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/weierstrass.js +++ /dev/null @@ -1,1413 +0,0 @@ -/** - * Short Weierstrass curve methods. The formula is: y² = x³ + ax + b. - * - * ### Design rationale for types - * - * * Interaction between classes from different curves should fail: - * `k256.Point.BASE.add(p256.Point.BASE)` - * * For this purpose we want to use `instanceof` operator, which is fast and works during runtime - * * Different calls of `curve()` would return different classes - - * `curve(params) !== curve(params)`: if somebody decided to monkey-patch their curve, - * it won't affect others - * - * TypeScript can't infer types for classes created inside a function. Classes is one instance - * of nominative types in TypeScript and interfaces only check for shape, so it's hard to create - * unique type for every function call. - * - * We can use generic types via some param, like curve opts, but that would: - * 1. Enable interaction between `curve(params)` and `curve(params)` (curves of same params) - * which is hard to debug. - * 2. Params can be generic and we can't enforce them to be constant value: - * if somebody creates curve from non-constant params, - * it would be allowed to interact with other curves with non-constant params - * - * @todo https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html#unique-symbol - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { hmac as nobleHmac } from '@noble/hashes/hmac.js'; -import { ahash } from '@noble/hashes/utils'; -import { _validateObject, _abool2 as abool, _abytes2 as abytes, aInRange, bitLen, bitMask, bytesToHex, bytesToNumberBE, concatBytes, createHmacDrbg, ensureBytes, hexToBytes, inRange, isBytes, memoized, numberToHexUnpadded, randomBytes as randomBytesWeb, } from "../utils.js"; -import { _createCurveFields, mulEndoUnsafe, negateCt, normalizeZ, pippenger, wNAF, } from "./curve.js"; -import { Field, FpInvertBatch, getMinHashLength, mapHashToField, nLength, validateField, } from "./modular.js"; -// We construct basis in such way that den is always positive and equals n, but num sign depends on basis (not on secret value) -const divNearest = (num, den) => (num + (num >= 0 ? den : -den) / _2n) / den; -/** - * Splits scalar for GLV endomorphism. - */ -export function _splitEndoScalar(k, basis, n) { - // Split scalar into two such that part is ~half bits: `abs(part) < sqrt(N)` - // Since part can be negative, we need to do this on point. - // TODO: verifyScalar function which consumes lambda - const [[a1, b1], [a2, b2]] = basis; - const c1 = divNearest(b2 * k, n); - const c2 = divNearest(-b1 * k, n); - // |k1|/|k2| is < sqrt(N), but can be negative. - // If we do `k1 mod N`, we'll get big scalar (`> sqrt(N)`): so, we do cheaper negation instead. - let k1 = k - c1 * a1 - c2 * a2; - let k2 = -c1 * b1 - c2 * b2; - const k1neg = k1 < _0n; - const k2neg = k2 < _0n; - if (k1neg) - k1 = -k1; - if (k2neg) - k2 = -k2; - // Double check that resulting scalar less than half bits of N: otherwise wNAF will fail. - // This should only happen on wrong basises. Also, math inside is too complex and I don't trust it. - const MAX_NUM = bitMask(Math.ceil(bitLen(n) / 2)) + _1n; // Half bits of N - if (k1 < _0n || k1 >= MAX_NUM || k2 < _0n || k2 >= MAX_NUM) { - throw new Error('splitScalar (endomorphism): failed, k=' + k); - } - return { k1neg, k1, k2neg, k2 }; -} -function validateSigFormat(format) { - if (!['compact', 'recovered', 'der'].includes(format)) - throw new Error('Signature format must be "compact", "recovered", or "der"'); - return format; -} -function validateSigOpts(opts, def) { - const optsn = {}; - for (let optName of Object.keys(def)) { - // @ts-ignore - optsn[optName] = opts[optName] === undefined ? def[optName] : opts[optName]; - } - abool(optsn.lowS, 'lowS'); - abool(optsn.prehash, 'prehash'); - if (optsn.format !== undefined) - validateSigFormat(optsn.format); - return optsn; -} -export class DERErr extends Error { - constructor(m = '') { - super(m); - } -} -/** - * ASN.1 DER encoding utilities. ASN is very complex & fragile. Format: - * - * [0x30 (SEQUENCE), bytelength, 0x02 (INTEGER), intLength, R, 0x02 (INTEGER), intLength, S] - * - * Docs: https://letsencrypt.org/docs/a-warm-welcome-to-asn1-and-der/, https://luca.ntop.org/Teaching/Appunti/asn1.html - */ -export const DER = { - // asn.1 DER encoding utils - Err: DERErr, - // Basic building block is TLV (Tag-Length-Value) - _tlv: { - encode: (tag, data) => { - const { Err: E } = DER; - if (tag < 0 || tag > 256) - throw new E('tlv.encode: wrong tag'); - if (data.length & 1) - throw new E('tlv.encode: unpadded data'); - const dataLen = data.length / 2; - const len = numberToHexUnpadded(dataLen); - if ((len.length / 2) & 128) - throw new E('tlv.encode: long form length too big'); - // length of length with long form flag - const lenLen = dataLen > 127 ? numberToHexUnpadded((len.length / 2) | 128) : ''; - const t = numberToHexUnpadded(tag); - return t + lenLen + len + data; - }, - // v - value, l - left bytes (unparsed) - decode(tag, data) { - const { Err: E } = DER; - let pos = 0; - if (tag < 0 || tag > 256) - throw new E('tlv.encode: wrong tag'); - if (data.length < 2 || data[pos++] !== tag) - throw new E('tlv.decode: wrong tlv'); - const first = data[pos++]; - const isLong = !!(first & 128); // First bit of first length byte is flag for short/long form - let length = 0; - if (!isLong) - length = first; - else { - // Long form: [longFlag(1bit), lengthLength(7bit), length (BE)] - const lenLen = first & 127; - if (!lenLen) - throw new E('tlv.decode(long): indefinite length not supported'); - if (lenLen > 4) - throw new E('tlv.decode(long): byte length is too big'); // this will overflow u32 in js - const lengthBytes = data.subarray(pos, pos + lenLen); - if (lengthBytes.length !== lenLen) - throw new E('tlv.decode: length bytes not complete'); - if (lengthBytes[0] === 0) - throw new E('tlv.decode(long): zero leftmost byte'); - for (const b of lengthBytes) - length = (length << 8) | b; - pos += lenLen; - if (length < 128) - throw new E('tlv.decode(long): not minimal encoding'); - } - const v = data.subarray(pos, pos + length); - if (v.length !== length) - throw new E('tlv.decode: wrong value length'); - return { v, l: data.subarray(pos + length) }; - }, - }, - // https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag, - // since we always use positive integers here. It must always be empty: - // - add zero byte if exists - // - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding) - _int: { - encode(num) { - const { Err: E } = DER; - if (num < _0n) - throw new E('integer: negative integers are not allowed'); - let hex = numberToHexUnpadded(num); - // Pad with zero byte if negative flag is present - if (Number.parseInt(hex[0], 16) & 0b1000) - hex = '00' + hex; - if (hex.length & 1) - throw new E('unexpected DER parsing assertion: unpadded hex'); - return hex; - }, - decode(data) { - const { Err: E } = DER; - if (data[0] & 128) - throw new E('invalid signature integer: negative'); - if (data[0] === 0x00 && !(data[1] & 128)) - throw new E('invalid signature integer: unnecessary leading zero'); - return bytesToNumberBE(data); - }, - }, - toSig(hex) { - // parse DER signature - const { Err: E, _int: int, _tlv: tlv } = DER; - const data = ensureBytes('signature', hex); - const { v: seqBytes, l: seqLeftBytes } = tlv.decode(0x30, data); - if (seqLeftBytes.length) - throw new E('invalid signature: left bytes after parsing'); - const { v: rBytes, l: rLeftBytes } = tlv.decode(0x02, seqBytes); - const { v: sBytes, l: sLeftBytes } = tlv.decode(0x02, rLeftBytes); - if (sLeftBytes.length) - throw new E('invalid signature: left bytes after parsing'); - return { r: int.decode(rBytes), s: int.decode(sBytes) }; - }, - hexFromSig(sig) { - const { _tlv: tlv, _int: int } = DER; - const rs = tlv.encode(0x02, int.encode(sig.r)); - const ss = tlv.encode(0x02, int.encode(sig.s)); - const seq = rs + ss; - return tlv.encode(0x30, seq); - }, -}; -// Be friendly to bad ECMAScript parsers by not using bigint literals -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = BigInt(4); -export function _normFnElement(Fn, key) { - const { BYTES: expected } = Fn; - let num; - if (typeof key === 'bigint') { - num = key; - } - else { - let bytes = ensureBytes('private key', key); - try { - num = Fn.fromBytes(bytes); - } - catch (error) { - throw new Error(`invalid private key: expected ui8a of size ${expected}, got ${typeof key}`); - } - } - if (!Fn.isValidNot0(num)) - throw new Error('invalid private key: out of range [1..N-1]'); - return num; -} -/** - * Creates weierstrass Point constructor, based on specified curve options. - * - * @example -```js -const opts = { - p: BigInt('0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff'), - n: BigInt('0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551'), - h: BigInt(1), - a: BigInt('0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc'), - b: BigInt('0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b'), - Gx: BigInt('0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296'), - Gy: BigInt('0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5'), -}; -const p256_Point = weierstrass(opts); -``` - */ -export function weierstrassN(params, extraOpts = {}) { - const validated = _createCurveFields('weierstrass', params, extraOpts); - const { Fp, Fn } = validated; - let CURVE = validated.CURVE; - const { h: cofactor, n: CURVE_ORDER } = CURVE; - _validateObject(extraOpts, {}, { - allowInfinityPoint: 'boolean', - clearCofactor: 'function', - isTorsionFree: 'function', - fromBytes: 'function', - toBytes: 'function', - endo: 'object', - wrapPrivateKey: 'boolean', - }); - const { endo } = extraOpts; - if (endo) { - // validateObject(endo, { beta: 'bigint', splitScalar: 'function' }); - if (!Fp.is0(CURVE.a) || typeof endo.beta !== 'bigint' || !Array.isArray(endo.basises)) { - throw new Error('invalid endo: expected "beta": bigint and "basises": array'); - } - } - const lengths = getWLengths(Fp, Fn); - function assertCompressionIsSupported() { - if (!Fp.isOdd) - throw new Error('compression is not supported: Field does not have .isOdd()'); - } - // Implements IEEE P1363 point encoding - function pointToBytes(_c, point, isCompressed) { - const { x, y } = point.toAffine(); - const bx = Fp.toBytes(x); - abool(isCompressed, 'isCompressed'); - if (isCompressed) { - assertCompressionIsSupported(); - const hasEvenY = !Fp.isOdd(y); - return concatBytes(pprefix(hasEvenY), bx); - } - else { - return concatBytes(Uint8Array.of(0x04), bx, Fp.toBytes(y)); - } - } - function pointFromBytes(bytes) { - abytes(bytes, undefined, 'Point'); - const { publicKey: comp, publicKeyUncompressed: uncomp } = lengths; // e.g. for 32-byte: 33, 65 - const length = bytes.length; - const head = bytes[0]; - const tail = bytes.subarray(1); - // No actual validation is done here: use .assertValidity() - if (length === comp && (head === 0x02 || head === 0x03)) { - const x = Fp.fromBytes(tail); - if (!Fp.isValid(x)) - throw new Error('bad point: is not on curve, wrong x'); - const y2 = weierstrassEquation(x); // y² = x³ + ax + b - let y; - try { - y = Fp.sqrt(y2); // y = y² ^ (p+1)/4 - } - catch (sqrtError) { - const err = sqrtError instanceof Error ? ': ' + sqrtError.message : ''; - throw new Error('bad point: is not on curve, sqrt error' + err); - } - assertCompressionIsSupported(); - const isYOdd = Fp.isOdd(y); // (y & _1n) === _1n; - const isHeadOdd = (head & 1) === 1; // ECDSA-specific - if (isHeadOdd !== isYOdd) - y = Fp.neg(y); - return { x, y }; - } - else if (length === uncomp && head === 0x04) { - // TODO: more checks - const L = Fp.BYTES; - const x = Fp.fromBytes(tail.subarray(0, L)); - const y = Fp.fromBytes(tail.subarray(L, L * 2)); - if (!isValidXY(x, y)) - throw new Error('bad point: is not on curve'); - return { x, y }; - } - else { - throw new Error(`bad point: got length ${length}, expected compressed=${comp} or uncompressed=${uncomp}`); - } - } - const encodePoint = extraOpts.toBytes || pointToBytes; - const decodePoint = extraOpts.fromBytes || pointFromBytes; - function weierstrassEquation(x) { - const x2 = Fp.sqr(x); // x * x - const x3 = Fp.mul(x2, x); // x² * x - return Fp.add(Fp.add(x3, Fp.mul(x, CURVE.a)), CURVE.b); // x³ + a * x + b - } - // TODO: move top-level - /** Checks whether equation holds for given x, y: y² == x³ + ax + b */ - function isValidXY(x, y) { - const left = Fp.sqr(y); // y² - const right = weierstrassEquation(x); // x³ + ax + b - return Fp.eql(left, right); - } - // Validate whether the passed curve params are valid. - // Test 1: equation y² = x³ + ax + b should work for generator point. - if (!isValidXY(CURVE.Gx, CURVE.Gy)) - throw new Error('bad curve params: generator point'); - // Test 2: discriminant Δ part should be non-zero: 4a³ + 27b² != 0. - // Guarantees curve is genus-1, smooth (non-singular). - const _4a3 = Fp.mul(Fp.pow(CURVE.a, _3n), _4n); - const _27b2 = Fp.mul(Fp.sqr(CURVE.b), BigInt(27)); - if (Fp.is0(Fp.add(_4a3, _27b2))) - throw new Error('bad curve params: a or b'); - /** Asserts coordinate is valid: 0 <= n < Fp.ORDER. */ - function acoord(title, n, banZero = false) { - if (!Fp.isValid(n) || (banZero && Fp.is0(n))) - throw new Error(`bad point coordinate ${title}`); - return n; - } - function aprjpoint(other) { - if (!(other instanceof Point)) - throw new Error('ProjectivePoint expected'); - } - function splitEndoScalarN(k) { - if (!endo || !endo.basises) - throw new Error('no endo'); - return _splitEndoScalar(k, endo.basises, Fn.ORDER); - } - // Memoized toAffine / validity check. They are heavy. Points are immutable. - // Converts Projective point to affine (x, y) coordinates. - // Can accept precomputed Z^-1 - for example, from invertBatch. - // (X, Y, Z) ∋ (x=X/Z, y=Y/Z) - const toAffineMemo = memoized((p, iz) => { - const { X, Y, Z } = p; - // Fast-path for normalized points - if (Fp.eql(Z, Fp.ONE)) - return { x: X, y: Y }; - const is0 = p.is0(); - // If invZ was 0, we return zero point. However we still want to execute - // all operations, so we replace invZ with a random number, 1. - if (iz == null) - iz = is0 ? Fp.ONE : Fp.inv(Z); - const x = Fp.mul(X, iz); - const y = Fp.mul(Y, iz); - const zz = Fp.mul(Z, iz); - if (is0) - return { x: Fp.ZERO, y: Fp.ZERO }; - if (!Fp.eql(zz, Fp.ONE)) - throw new Error('invZ was invalid'); - return { x, y }; - }); - // NOTE: on exception this will crash 'cached' and no value will be set. - // Otherwise true will be return - const assertValidMemo = memoized((p) => { - if (p.is0()) { - // (0, 1, 0) aka ZERO is invalid in most contexts. - // In BLS, ZERO can be serialized, so we allow it. - // (0, 0, 0) is invalid representation of ZERO. - if (extraOpts.allowInfinityPoint && !Fp.is0(p.Y)) - return; - throw new Error('bad point: ZERO'); - } - // Some 3rd-party test vectors require different wording between here & `fromCompressedHex` - const { x, y } = p.toAffine(); - if (!Fp.isValid(x) || !Fp.isValid(y)) - throw new Error('bad point: x or y not field elements'); - if (!isValidXY(x, y)) - throw new Error('bad point: equation left != right'); - if (!p.isTorsionFree()) - throw new Error('bad point: not in prime-order subgroup'); - return true; - }); - function finishEndo(endoBeta, k1p, k2p, k1neg, k2neg) { - k2p = new Point(Fp.mul(k2p.X, endoBeta), k2p.Y, k2p.Z); - k1p = negateCt(k1neg, k1p); - k2p = negateCt(k2neg, k2p); - return k1p.add(k2p); - } - /** - * Projective Point works in 3d / projective (homogeneous) coordinates:(X, Y, Z) ∋ (x=X/Z, y=Y/Z). - * Default Point works in 2d / affine coordinates: (x, y). - * We're doing calculations in projective, because its operations don't require costly inversion. - */ - class Point { - /** Does NOT validate if the point is valid. Use `.assertValidity()`. */ - constructor(X, Y, Z) { - this.X = acoord('x', X); - this.Y = acoord('y', Y, true); - this.Z = acoord('z', Z); - Object.freeze(this); - } - static CURVE() { - return CURVE; - } - /** Does NOT validate if the point is valid. Use `.assertValidity()`. */ - static fromAffine(p) { - const { x, y } = p || {}; - if (!p || !Fp.isValid(x) || !Fp.isValid(y)) - throw new Error('invalid affine point'); - if (p instanceof Point) - throw new Error('projective point not allowed'); - // (0, 0) would've produced (0, 0, 1) - instead, we need (0, 1, 0) - if (Fp.is0(x) && Fp.is0(y)) - return Point.ZERO; - return new Point(x, y, Fp.ONE); - } - static fromBytes(bytes) { - const P = Point.fromAffine(decodePoint(abytes(bytes, undefined, 'point'))); - P.assertValidity(); - return P; - } - static fromHex(hex) { - return Point.fromBytes(ensureBytes('pointHex', hex)); - } - get x() { - return this.toAffine().x; - } - get y() { - return this.toAffine().y; - } - /** - * - * @param windowSize - * @param isLazy true will defer table computation until the first multiplication - * @returns - */ - precompute(windowSize = 8, isLazy = true) { - wnaf.createCache(this, windowSize); - if (!isLazy) - this.multiply(_3n); // random number - return this; - } - // TODO: return `this` - /** A point on curve is valid if it conforms to equation. */ - assertValidity() { - assertValidMemo(this); - } - hasEvenY() { - const { y } = this.toAffine(); - if (!Fp.isOdd) - throw new Error("Field doesn't support isOdd"); - return !Fp.isOdd(y); - } - /** Compare one point to another. */ - equals(other) { - aprjpoint(other); - const { X: X1, Y: Y1, Z: Z1 } = this; - const { X: X2, Y: Y2, Z: Z2 } = other; - const U1 = Fp.eql(Fp.mul(X1, Z2), Fp.mul(X2, Z1)); - const U2 = Fp.eql(Fp.mul(Y1, Z2), Fp.mul(Y2, Z1)); - return U1 && U2; - } - /** Flips point to one corresponding to (x, -y) in Affine coordinates. */ - negate() { - return new Point(this.X, Fp.neg(this.Y), this.Z); - } - // Renes-Costello-Batina exception-free doubling formula. - // There is 30% faster Jacobian formula, but it is not complete. - // https://eprint.iacr.org/2015/1060, algorithm 3 - // Cost: 8M + 3S + 3*a + 2*b3 + 15add. - double() { - const { a, b } = CURVE; - const b3 = Fp.mul(b, _3n); - const { X: X1, Y: Y1, Z: Z1 } = this; - let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore - let t0 = Fp.mul(X1, X1); // step 1 - let t1 = Fp.mul(Y1, Y1); - let t2 = Fp.mul(Z1, Z1); - let t3 = Fp.mul(X1, Y1); - t3 = Fp.add(t3, t3); // step 5 - Z3 = Fp.mul(X1, Z1); - Z3 = Fp.add(Z3, Z3); - X3 = Fp.mul(a, Z3); - Y3 = Fp.mul(b3, t2); - Y3 = Fp.add(X3, Y3); // step 10 - X3 = Fp.sub(t1, Y3); - Y3 = Fp.add(t1, Y3); - Y3 = Fp.mul(X3, Y3); - X3 = Fp.mul(t3, X3); - Z3 = Fp.mul(b3, Z3); // step 15 - t2 = Fp.mul(a, t2); - t3 = Fp.sub(t0, t2); - t3 = Fp.mul(a, t3); - t3 = Fp.add(t3, Z3); - Z3 = Fp.add(t0, t0); // step 20 - t0 = Fp.add(Z3, t0); - t0 = Fp.add(t0, t2); - t0 = Fp.mul(t0, t3); - Y3 = Fp.add(Y3, t0); - t2 = Fp.mul(Y1, Z1); // step 25 - t2 = Fp.add(t2, t2); - t0 = Fp.mul(t2, t3); - X3 = Fp.sub(X3, t0); - Z3 = Fp.mul(t2, t1); - Z3 = Fp.add(Z3, Z3); // step 30 - Z3 = Fp.add(Z3, Z3); - return new Point(X3, Y3, Z3); - } - // Renes-Costello-Batina exception-free addition formula. - // There is 30% faster Jacobian formula, but it is not complete. - // https://eprint.iacr.org/2015/1060, algorithm 1 - // Cost: 12M + 0S + 3*a + 3*b3 + 23add. - add(other) { - aprjpoint(other); - const { X: X1, Y: Y1, Z: Z1 } = this; - const { X: X2, Y: Y2, Z: Z2 } = other; - let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore - const a = CURVE.a; - const b3 = Fp.mul(CURVE.b, _3n); - let t0 = Fp.mul(X1, X2); // step 1 - let t1 = Fp.mul(Y1, Y2); - let t2 = Fp.mul(Z1, Z2); - let t3 = Fp.add(X1, Y1); - let t4 = Fp.add(X2, Y2); // step 5 - t3 = Fp.mul(t3, t4); - t4 = Fp.add(t0, t1); - t3 = Fp.sub(t3, t4); - t4 = Fp.add(X1, Z1); - let t5 = Fp.add(X2, Z2); // step 10 - t4 = Fp.mul(t4, t5); - t5 = Fp.add(t0, t2); - t4 = Fp.sub(t4, t5); - t5 = Fp.add(Y1, Z1); - X3 = Fp.add(Y2, Z2); // step 15 - t5 = Fp.mul(t5, X3); - X3 = Fp.add(t1, t2); - t5 = Fp.sub(t5, X3); - Z3 = Fp.mul(a, t4); - X3 = Fp.mul(b3, t2); // step 20 - Z3 = Fp.add(X3, Z3); - X3 = Fp.sub(t1, Z3); - Z3 = Fp.add(t1, Z3); - Y3 = Fp.mul(X3, Z3); - t1 = Fp.add(t0, t0); // step 25 - t1 = Fp.add(t1, t0); - t2 = Fp.mul(a, t2); - t4 = Fp.mul(b3, t4); - t1 = Fp.add(t1, t2); - t2 = Fp.sub(t0, t2); // step 30 - t2 = Fp.mul(a, t2); - t4 = Fp.add(t4, t2); - t0 = Fp.mul(t1, t4); - Y3 = Fp.add(Y3, t0); - t0 = Fp.mul(t5, t4); // step 35 - X3 = Fp.mul(t3, X3); - X3 = Fp.sub(X3, t0); - t0 = Fp.mul(t3, t1); - Z3 = Fp.mul(t5, Z3); - Z3 = Fp.add(Z3, t0); // step 40 - return new Point(X3, Y3, Z3); - } - subtract(other) { - return this.add(other.negate()); - } - is0() { - return this.equals(Point.ZERO); - } - /** - * Constant time multiplication. - * Uses wNAF method. Windowed method may be 10% faster, - * but takes 2x longer to generate and consumes 2x memory. - * Uses precomputes when available. - * Uses endomorphism for Koblitz curves. - * @param scalar by which the point would be multiplied - * @returns New point - */ - multiply(scalar) { - const { endo } = extraOpts; - if (!Fn.isValidNot0(scalar)) - throw new Error('invalid scalar: out of range'); // 0 is invalid - let point, fake; // Fake point is used to const-time mult - const mul = (n) => wnaf.cached(this, n, (p) => normalizeZ(Point, p)); - /** See docs for {@link EndomorphismOpts} */ - if (endo) { - const { k1neg, k1, k2neg, k2 } = splitEndoScalarN(scalar); - const { p: k1p, f: k1f } = mul(k1); - const { p: k2p, f: k2f } = mul(k2); - fake = k1f.add(k2f); - point = finishEndo(endo.beta, k1p, k2p, k1neg, k2neg); - } - else { - const { p, f } = mul(scalar); - point = p; - fake = f; - } - // Normalize `z` for both points, but return only real one - return normalizeZ(Point, [point, fake])[0]; - } - /** - * Non-constant-time multiplication. Uses double-and-add algorithm. - * It's faster, but should only be used when you don't care about - * an exposed secret key e.g. sig verification, which works over *public* keys. - */ - multiplyUnsafe(sc) { - const { endo } = extraOpts; - const p = this; - if (!Fn.isValid(sc)) - throw new Error('invalid scalar: out of range'); // 0 is valid - if (sc === _0n || p.is0()) - return Point.ZERO; - if (sc === _1n) - return p; // fast-path - if (wnaf.hasCache(this)) - return this.multiply(sc); - if (endo) { - const { k1neg, k1, k2neg, k2 } = splitEndoScalarN(sc); - const { p1, p2 } = mulEndoUnsafe(Point, p, k1, k2); // 30% faster vs wnaf.unsafe - return finishEndo(endo.beta, p1, p2, k1neg, k2neg); - } - else { - return wnaf.unsafe(p, sc); - } - } - multiplyAndAddUnsafe(Q, a, b) { - const sum = this.multiplyUnsafe(a).add(Q.multiplyUnsafe(b)); - return sum.is0() ? undefined : sum; - } - /** - * Converts Projective point to affine (x, y) coordinates. - * @param invertedZ Z^-1 (inverted zero) - optional, precomputation is useful for invertBatch - */ - toAffine(invertedZ) { - return toAffineMemo(this, invertedZ); - } - /** - * Checks whether Point is free of torsion elements (is in prime subgroup). - * Always torsion-free for cofactor=1 curves. - */ - isTorsionFree() { - const { isTorsionFree } = extraOpts; - if (cofactor === _1n) - return true; - if (isTorsionFree) - return isTorsionFree(Point, this); - return wnaf.unsafe(this, CURVE_ORDER).is0(); - } - clearCofactor() { - const { clearCofactor } = extraOpts; - if (cofactor === _1n) - return this; // Fast-path - if (clearCofactor) - return clearCofactor(Point, this); - return this.multiplyUnsafe(cofactor); - } - isSmallOrder() { - // can we use this.clearCofactor()? - return this.multiplyUnsafe(cofactor).is0(); - } - toBytes(isCompressed = true) { - abool(isCompressed, 'isCompressed'); - this.assertValidity(); - return encodePoint(Point, this, isCompressed); - } - toHex(isCompressed = true) { - return bytesToHex(this.toBytes(isCompressed)); - } - toString() { - return ``; - } - // TODO: remove - get px() { - return this.X; - } - get py() { - return this.X; - } - get pz() { - return this.Z; - } - toRawBytes(isCompressed = true) { - return this.toBytes(isCompressed); - } - _setWindowSize(windowSize) { - this.precompute(windowSize); - } - static normalizeZ(points) { - return normalizeZ(Point, points); - } - static msm(points, scalars) { - return pippenger(Point, Fn, points, scalars); - } - static fromPrivateKey(privateKey) { - return Point.BASE.multiply(_normFnElement(Fn, privateKey)); - } - } - // base / generator point - Point.BASE = new Point(CURVE.Gx, CURVE.Gy, Fp.ONE); - // zero / infinity / identity point - Point.ZERO = new Point(Fp.ZERO, Fp.ONE, Fp.ZERO); // 0, 1, 0 - // math field - Point.Fp = Fp; - // scalar field - Point.Fn = Fn; - const bits = Fn.BITS; - const wnaf = new wNAF(Point, extraOpts.endo ? Math.ceil(bits / 2) : bits); - Point.BASE.precompute(8); // Enable precomputes. Slows down first publicKey computation by 20ms. - return Point; -} -// Points start with byte 0x02 when y is even; otherwise 0x03 -function pprefix(hasEvenY) { - return Uint8Array.of(hasEvenY ? 0x02 : 0x03); -} -/** - * Implementation of the Shallue and van de Woestijne method for any weierstrass curve. - * TODO: check if there is a way to merge this with uvRatio in Edwards; move to modular. - * b = True and y = sqrt(u / v) if (u / v) is square in F, and - * b = False and y = sqrt(Z * (u / v)) otherwise. - * @param Fp - * @param Z - * @returns - */ -export function SWUFpSqrtRatio(Fp, Z) { - // Generic implementation - const q = Fp.ORDER; - let l = _0n; - for (let o = q - _1n; o % _2n === _0n; o /= _2n) - l += _1n; - const c1 = l; // 1. c1, the largest integer such that 2^c1 divides q - 1. - // We need 2n ** c1 and 2n ** (c1-1). We can't use **; but we can use <<. - // 2n ** c1 == 2n << (c1-1) - const _2n_pow_c1_1 = _2n << (c1 - _1n - _1n); - const _2n_pow_c1 = _2n_pow_c1_1 * _2n; - const c2 = (q - _1n) / _2n_pow_c1; // 2. c2 = (q - 1) / (2^c1) # Integer arithmetic - const c3 = (c2 - _1n) / _2n; // 3. c3 = (c2 - 1) / 2 # Integer arithmetic - const c4 = _2n_pow_c1 - _1n; // 4. c4 = 2^c1 - 1 # Integer arithmetic - const c5 = _2n_pow_c1_1; // 5. c5 = 2^(c1 - 1) # Integer arithmetic - const c6 = Fp.pow(Z, c2); // 6. c6 = Z^c2 - const c7 = Fp.pow(Z, (c2 + _1n) / _2n); // 7. c7 = Z^((c2 + 1) / 2) - let sqrtRatio = (u, v) => { - let tv1 = c6; // 1. tv1 = c6 - let tv2 = Fp.pow(v, c4); // 2. tv2 = v^c4 - let tv3 = Fp.sqr(tv2); // 3. tv3 = tv2^2 - tv3 = Fp.mul(tv3, v); // 4. tv3 = tv3 * v - let tv5 = Fp.mul(u, tv3); // 5. tv5 = u * tv3 - tv5 = Fp.pow(tv5, c3); // 6. tv5 = tv5^c3 - tv5 = Fp.mul(tv5, tv2); // 7. tv5 = tv5 * tv2 - tv2 = Fp.mul(tv5, v); // 8. tv2 = tv5 * v - tv3 = Fp.mul(tv5, u); // 9. tv3 = tv5 * u - let tv4 = Fp.mul(tv3, tv2); // 10. tv4 = tv3 * tv2 - tv5 = Fp.pow(tv4, c5); // 11. tv5 = tv4^c5 - let isQR = Fp.eql(tv5, Fp.ONE); // 12. isQR = tv5 == 1 - tv2 = Fp.mul(tv3, c7); // 13. tv2 = tv3 * c7 - tv5 = Fp.mul(tv4, tv1); // 14. tv5 = tv4 * tv1 - tv3 = Fp.cmov(tv2, tv3, isQR); // 15. tv3 = CMOV(tv2, tv3, isQR) - tv4 = Fp.cmov(tv5, tv4, isQR); // 16. tv4 = CMOV(tv5, tv4, isQR) - // 17. for i in (c1, c1 - 1, ..., 2): - for (let i = c1; i > _1n; i--) { - let tv5 = i - _2n; // 18. tv5 = i - 2 - tv5 = _2n << (tv5 - _1n); // 19. tv5 = 2^tv5 - let tvv5 = Fp.pow(tv4, tv5); // 20. tv5 = tv4^tv5 - const e1 = Fp.eql(tvv5, Fp.ONE); // 21. e1 = tv5 == 1 - tv2 = Fp.mul(tv3, tv1); // 22. tv2 = tv3 * tv1 - tv1 = Fp.mul(tv1, tv1); // 23. tv1 = tv1 * tv1 - tvv5 = Fp.mul(tv4, tv1); // 24. tv5 = tv4 * tv1 - tv3 = Fp.cmov(tv2, tv3, e1); // 25. tv3 = CMOV(tv2, tv3, e1) - tv4 = Fp.cmov(tvv5, tv4, e1); // 26. tv4 = CMOV(tv5, tv4, e1) - } - return { isValid: isQR, value: tv3 }; - }; - if (Fp.ORDER % _4n === _3n) { - // sqrt_ratio_3mod4(u, v) - const c1 = (Fp.ORDER - _3n) / _4n; // 1. c1 = (q - 3) / 4 # Integer arithmetic - const c2 = Fp.sqrt(Fp.neg(Z)); // 2. c2 = sqrt(-Z) - sqrtRatio = (u, v) => { - let tv1 = Fp.sqr(v); // 1. tv1 = v^2 - const tv2 = Fp.mul(u, v); // 2. tv2 = u * v - tv1 = Fp.mul(tv1, tv2); // 3. tv1 = tv1 * tv2 - let y1 = Fp.pow(tv1, c1); // 4. y1 = tv1^c1 - y1 = Fp.mul(y1, tv2); // 5. y1 = y1 * tv2 - const y2 = Fp.mul(y1, c2); // 6. y2 = y1 * c2 - const tv3 = Fp.mul(Fp.sqr(y1), v); // 7. tv3 = y1^2; 8. tv3 = tv3 * v - const isQR = Fp.eql(tv3, u); // 9. isQR = tv3 == u - let y = Fp.cmov(y2, y1, isQR); // 10. y = CMOV(y2, y1, isQR) - return { isValid: isQR, value: y }; // 11. return (isQR, y) isQR ? y : y*c2 - }; - } - // No curves uses that - // if (Fp.ORDER % _8n === _5n) // sqrt_ratio_5mod8 - return sqrtRatio; -} -/** - * Simplified Shallue-van de Woestijne-Ulas Method - * https://www.rfc-editor.org/rfc/rfc9380#section-6.6.2 - */ -export function mapToCurveSimpleSWU(Fp, opts) { - validateField(Fp); - const { A, B, Z } = opts; - if (!Fp.isValid(A) || !Fp.isValid(B) || !Fp.isValid(Z)) - throw new Error('mapToCurveSimpleSWU: invalid opts'); - const sqrtRatio = SWUFpSqrtRatio(Fp, Z); - if (!Fp.isOdd) - throw new Error('Field does not have .isOdd()'); - // Input: u, an element of F. - // Output: (x, y), a point on E. - return (u) => { - // prettier-ignore - let tv1, tv2, tv3, tv4, tv5, tv6, x, y; - tv1 = Fp.sqr(u); // 1. tv1 = u^2 - tv1 = Fp.mul(tv1, Z); // 2. tv1 = Z * tv1 - tv2 = Fp.sqr(tv1); // 3. tv2 = tv1^2 - tv2 = Fp.add(tv2, tv1); // 4. tv2 = tv2 + tv1 - tv3 = Fp.add(tv2, Fp.ONE); // 5. tv3 = tv2 + 1 - tv3 = Fp.mul(tv3, B); // 6. tv3 = B * tv3 - tv4 = Fp.cmov(Z, Fp.neg(tv2), !Fp.eql(tv2, Fp.ZERO)); // 7. tv4 = CMOV(Z, -tv2, tv2 != 0) - tv4 = Fp.mul(tv4, A); // 8. tv4 = A * tv4 - tv2 = Fp.sqr(tv3); // 9. tv2 = tv3^2 - tv6 = Fp.sqr(tv4); // 10. tv6 = tv4^2 - tv5 = Fp.mul(tv6, A); // 11. tv5 = A * tv6 - tv2 = Fp.add(tv2, tv5); // 12. tv2 = tv2 + tv5 - tv2 = Fp.mul(tv2, tv3); // 13. tv2 = tv2 * tv3 - tv6 = Fp.mul(tv6, tv4); // 14. tv6 = tv6 * tv4 - tv5 = Fp.mul(tv6, B); // 15. tv5 = B * tv6 - tv2 = Fp.add(tv2, tv5); // 16. tv2 = tv2 + tv5 - x = Fp.mul(tv1, tv3); // 17. x = tv1 * tv3 - const { isValid, value } = sqrtRatio(tv2, tv6); // 18. (is_gx1_square, y1) = sqrt_ratio(tv2, tv6) - y = Fp.mul(tv1, u); // 19. y = tv1 * u -> Z * u^3 * y1 - y = Fp.mul(y, value); // 20. y = y * y1 - x = Fp.cmov(x, tv3, isValid); // 21. x = CMOV(x, tv3, is_gx1_square) - y = Fp.cmov(y, value, isValid); // 22. y = CMOV(y, y1, is_gx1_square) - const e1 = Fp.isOdd(u) === Fp.isOdd(y); // 23. e1 = sgn0(u) == sgn0(y) - y = Fp.cmov(Fp.neg(y), y, e1); // 24. y = CMOV(-y, y, e1) - const tv4_inv = FpInvertBatch(Fp, [tv4], true)[0]; - x = Fp.mul(x, tv4_inv); // 25. x = x / tv4 - return { x, y }; - }; -} -function getWLengths(Fp, Fn) { - return { - secretKey: Fn.BYTES, - publicKey: 1 + Fp.BYTES, - publicKeyUncompressed: 1 + 2 * Fp.BYTES, - publicKeyHasPrefix: true, - signature: 2 * Fn.BYTES, - }; -} -/** - * Sometimes users only need getPublicKey, getSharedSecret, and secret key handling. - * This helper ensures no signature functionality is present. Less code, smaller bundle size. - */ -export function ecdh(Point, ecdhOpts = {}) { - const { Fn } = Point; - const randomBytes_ = ecdhOpts.randomBytes || randomBytesWeb; - const lengths = Object.assign(getWLengths(Point.Fp, Fn), { seed: getMinHashLength(Fn.ORDER) }); - function isValidSecretKey(secretKey) { - try { - return !!_normFnElement(Fn, secretKey); - } - catch (error) { - return false; - } - } - function isValidPublicKey(publicKey, isCompressed) { - const { publicKey: comp, publicKeyUncompressed } = lengths; - try { - const l = publicKey.length; - if (isCompressed === true && l !== comp) - return false; - if (isCompressed === false && l !== publicKeyUncompressed) - return false; - return !!Point.fromBytes(publicKey); - } - catch (error) { - return false; - } - } - /** - * Produces cryptographically secure secret key from random of size - * (groupLen + ceil(groupLen / 2)) with modulo bias being negligible. - */ - function randomSecretKey(seed = randomBytes_(lengths.seed)) { - return mapHashToField(abytes(seed, lengths.seed, 'seed'), Fn.ORDER); - } - /** - * Computes public key for a secret key. Checks for validity of the secret key. - * @param isCompressed whether to return compact (default), or full key - * @returns Public key, full when isCompressed=false; short when isCompressed=true - */ - function getPublicKey(secretKey, isCompressed = true) { - return Point.BASE.multiply(_normFnElement(Fn, secretKey)).toBytes(isCompressed); - } - function keygen(seed) { - const secretKey = randomSecretKey(seed); - return { secretKey, publicKey: getPublicKey(secretKey) }; - } - /** - * Quick and dirty check for item being public key. Does not validate hex, or being on-curve. - */ - function isProbPub(item) { - if (typeof item === 'bigint') - return false; - if (item instanceof Point) - return true; - const { secretKey, publicKey, publicKeyUncompressed } = lengths; - if (Fn.allowedLengths || secretKey === publicKey) - return undefined; - const l = ensureBytes('key', item).length; - return l === publicKey || l === publicKeyUncompressed; - } - /** - * ECDH (Elliptic Curve Diffie Hellman). - * Computes shared public key from secret key A and public key B. - * Checks: 1) secret key validity 2) shared key is on-curve. - * Does NOT hash the result. - * @param isCompressed whether to return compact (default), or full key - * @returns shared public key - */ - function getSharedSecret(secretKeyA, publicKeyB, isCompressed = true) { - if (isProbPub(secretKeyA) === true) - throw new Error('first arg must be private key'); - if (isProbPub(publicKeyB) === false) - throw new Error('second arg must be public key'); - const s = _normFnElement(Fn, secretKeyA); - const b = Point.fromHex(publicKeyB); // checks for being on-curve - return b.multiply(s).toBytes(isCompressed); - } - const utils = { - isValidSecretKey, - isValidPublicKey, - randomSecretKey, - // TODO: remove - isValidPrivateKey: isValidSecretKey, - randomPrivateKey: randomSecretKey, - normPrivateKeyToScalar: (key) => _normFnElement(Fn, key), - precompute(windowSize = 8, point = Point.BASE) { - return point.precompute(windowSize, false); - }, - }; - return Object.freeze({ getPublicKey, getSharedSecret, keygen, Point, utils, lengths }); -} -/** - * Creates ECDSA signing interface for given elliptic curve `Point` and `hash` function. - * We need `hash` for 2 features: - * 1. Message prehash-ing. NOT used if `sign` / `verify` are called with `prehash: false` - * 2. k generation in `sign`, using HMAC-drbg(hash) - * - * ECDSAOpts are only rarely needed. - * - * @example - * ```js - * const p256_Point = weierstrass(...); - * const p256_sha256 = ecdsa(p256_Point, sha256); - * const p256_sha224 = ecdsa(p256_Point, sha224); - * const p256_sha224_r = ecdsa(p256_Point, sha224, { randomBytes: (length) => { ... } }); - * ``` - */ -export function ecdsa(Point, hash, ecdsaOpts = {}) { - ahash(hash); - _validateObject(ecdsaOpts, {}, { - hmac: 'function', - lowS: 'boolean', - randomBytes: 'function', - bits2int: 'function', - bits2int_modN: 'function', - }); - const randomBytes = ecdsaOpts.randomBytes || randomBytesWeb; - const hmac = ecdsaOpts.hmac || - ((key, ...msgs) => nobleHmac(hash, key, concatBytes(...msgs))); - const { Fp, Fn } = Point; - const { ORDER: CURVE_ORDER, BITS: fnBits } = Fn; - const { keygen, getPublicKey, getSharedSecret, utils, lengths } = ecdh(Point, ecdsaOpts); - const defaultSigOpts = { - prehash: false, - lowS: typeof ecdsaOpts.lowS === 'boolean' ? ecdsaOpts.lowS : false, - format: undefined, //'compact' as ECDSASigFormat, - extraEntropy: false, - }; - const defaultSigOpts_format = 'compact'; - function isBiggerThanHalfOrder(number) { - const HALF = CURVE_ORDER >> _1n; - return number > HALF; - } - function validateRS(title, num) { - if (!Fn.isValidNot0(num)) - throw new Error(`invalid signature ${title}: out of range 1..Point.Fn.ORDER`); - return num; - } - function validateSigLength(bytes, format) { - validateSigFormat(format); - const size = lengths.signature; - const sizer = format === 'compact' ? size : format === 'recovered' ? size + 1 : undefined; - return abytes(bytes, sizer, `${format} signature`); - } - /** - * ECDSA signature with its (r, s) properties. Supports compact, recovered & DER representations. - */ - class Signature { - constructor(r, s, recovery) { - this.r = validateRS('r', r); // r in [1..N-1]; - this.s = validateRS('s', s); // s in [1..N-1]; - if (recovery != null) - this.recovery = recovery; - Object.freeze(this); - } - static fromBytes(bytes, format = defaultSigOpts_format) { - validateSigLength(bytes, format); - let recid; - if (format === 'der') { - const { r, s } = DER.toSig(abytes(bytes)); - return new Signature(r, s); - } - if (format === 'recovered') { - recid = bytes[0]; - format = 'compact'; - bytes = bytes.subarray(1); - } - const L = Fn.BYTES; - const r = bytes.subarray(0, L); - const s = bytes.subarray(L, L * 2); - return new Signature(Fn.fromBytes(r), Fn.fromBytes(s), recid); - } - static fromHex(hex, format) { - return this.fromBytes(hexToBytes(hex), format); - } - addRecoveryBit(recovery) { - return new Signature(this.r, this.s, recovery); - } - recoverPublicKey(messageHash) { - const FIELD_ORDER = Fp.ORDER; - const { r, s, recovery: rec } = this; - if (rec == null || ![0, 1, 2, 3].includes(rec)) - throw new Error('recovery id invalid'); - // ECDSA recovery is hard for cofactor > 1 curves. - // In sign, `r = q.x mod n`, and here we recover q.x from r. - // While recovering q.x >= n, we need to add r+n for cofactor=1 curves. - // However, for cofactor>1, r+n may not get q.x: - // r+n*i would need to be done instead where i is unknown. - // To easily get i, we either need to: - // a. increase amount of valid recid values (4, 5...); OR - // b. prohibit non-prime-order signatures (recid > 1). - const hasCofactor = CURVE_ORDER * _2n < FIELD_ORDER; - if (hasCofactor && rec > 1) - throw new Error('recovery id is ambiguous for h>1 curve'); - const radj = rec === 2 || rec === 3 ? r + CURVE_ORDER : r; - if (!Fp.isValid(radj)) - throw new Error('recovery id 2 or 3 invalid'); - const x = Fp.toBytes(radj); - const R = Point.fromBytes(concatBytes(pprefix((rec & 1) === 0), x)); - const ir = Fn.inv(radj); // r^-1 - const h = bits2int_modN(ensureBytes('msgHash', messageHash)); // Truncate hash - const u1 = Fn.create(-h * ir); // -hr^-1 - const u2 = Fn.create(s * ir); // sr^-1 - // (sr^-1)R-(hr^-1)G = -(hr^-1)G + (sr^-1). unsafe is fine: there is no private data. - const Q = Point.BASE.multiplyUnsafe(u1).add(R.multiplyUnsafe(u2)); - if (Q.is0()) - throw new Error('point at infinify'); - Q.assertValidity(); - return Q; - } - // Signatures should be low-s, to prevent malleability. - hasHighS() { - return isBiggerThanHalfOrder(this.s); - } - toBytes(format = defaultSigOpts_format) { - validateSigFormat(format); - if (format === 'der') - return hexToBytes(DER.hexFromSig(this)); - const r = Fn.toBytes(this.r); - const s = Fn.toBytes(this.s); - if (format === 'recovered') { - if (this.recovery == null) - throw new Error('recovery bit must be present'); - return concatBytes(Uint8Array.of(this.recovery), r, s); - } - return concatBytes(r, s); - } - toHex(format) { - return bytesToHex(this.toBytes(format)); - } - // TODO: remove - assertValidity() { } - static fromCompact(hex) { - return Signature.fromBytes(ensureBytes('sig', hex), 'compact'); - } - static fromDER(hex) { - return Signature.fromBytes(ensureBytes('sig', hex), 'der'); - } - normalizeS() { - return this.hasHighS() ? new Signature(this.r, Fn.neg(this.s), this.recovery) : this; - } - toDERRawBytes() { - return this.toBytes('der'); - } - toDERHex() { - return bytesToHex(this.toBytes('der')); - } - toCompactRawBytes() { - return this.toBytes('compact'); - } - toCompactHex() { - return bytesToHex(this.toBytes('compact')); - } - } - // RFC6979: ensure ECDSA msg is X bytes and < N. RFC suggests optional truncating via bits2octets. - // FIPS 186-4 4.6 suggests the leftmost min(nBitLen, outLen) bits, which matches bits2int. - // bits2int can produce res>N, we can do mod(res, N) since the bitLen is the same. - // int2octets can't be used; pads small msgs with 0: unacceptatble for trunc as per RFC vectors - const bits2int = ecdsaOpts.bits2int || - function bits2int_def(bytes) { - // Our custom check "just in case", for protection against DoS - if (bytes.length > 8192) - throw new Error('input is too large'); - // For curves with nBitLength % 8 !== 0: bits2octets(bits2octets(m)) !== bits2octets(m) - // for some cases, since bytes.length * 8 is not actual bitLength. - const num = bytesToNumberBE(bytes); // check for == u8 done here - const delta = bytes.length * 8 - fnBits; // truncate to nBitLength leftmost bits - return delta > 0 ? num >> BigInt(delta) : num; - }; - const bits2int_modN = ecdsaOpts.bits2int_modN || - function bits2int_modN_def(bytes) { - return Fn.create(bits2int(bytes)); // can't use bytesToNumberBE here - }; - // Pads output with zero as per spec - const ORDER_MASK = bitMask(fnBits); - /** Converts to bytes. Checks if num in `[0..ORDER_MASK-1]` e.g.: `[0..2^256-1]`. */ - function int2octets(num) { - // IMPORTANT: the check ensures working for case `Fn.BYTES != Fn.BITS * 8` - aInRange('num < 2^' + fnBits, num, _0n, ORDER_MASK); - return Fn.toBytes(num); - } - function validateMsgAndHash(message, prehash) { - abytes(message, undefined, 'message'); - return prehash ? abytes(hash(message), undefined, 'prehashed message') : message; - } - /** - * Steps A, D of RFC6979 3.2. - * Creates RFC6979 seed; converts msg/privKey to numbers. - * Used only in sign, not in verify. - * - * Warning: we cannot assume here that message has same amount of bytes as curve order, - * this will be invalid at least for P521. Also it can be bigger for P224 + SHA256. - */ - function prepSig(message, privateKey, opts) { - if (['recovered', 'canonical'].some((k) => k in opts)) - throw new Error('sign() legacy options not supported'); - const { lowS, prehash, extraEntropy } = validateSigOpts(opts, defaultSigOpts); - message = validateMsgAndHash(message, prehash); // RFC6979 3.2 A: h1 = H(m) - // We can't later call bits2octets, since nested bits2int is broken for curves - // with fnBits % 8 !== 0. Because of that, we unwrap it here as int2octets call. - // const bits2octets = (bits) => int2octets(bits2int_modN(bits)) - const h1int = bits2int_modN(message); - const d = _normFnElement(Fn, privateKey); // validate secret key, convert to bigint - const seedArgs = [int2octets(d), int2octets(h1int)]; - // extraEntropy. RFC6979 3.6: additional k' (optional). - if (extraEntropy != null && extraEntropy !== false) { - // K = HMAC_K(V || 0x00 || int2octets(x) || bits2octets(h1) || k') - // gen random bytes OR pass as-is - const e = extraEntropy === true ? randomBytes(lengths.secretKey) : extraEntropy; - seedArgs.push(ensureBytes('extraEntropy', e)); // check for being bytes - } - const seed = concatBytes(...seedArgs); // Step D of RFC6979 3.2 - const m = h1int; // NOTE: no need to call bits2int second time here, it is inside truncateHash! - // Converts signature params into point w r/s, checks result for validity. - // To transform k => Signature: - // q = k⋅G - // r = q.x mod n - // s = k^-1(m + rd) mod n - // Can use scalar blinding b^-1(bm + bdr) where b ∈ [1,q−1] according to - // https://tches.iacr.org/index.php/TCHES/article/view/7337/6509. We've decided against it: - // a) dependency on CSPRNG b) 15% slowdown c) doesn't really help since bigints are not CT - function k2sig(kBytes) { - // RFC 6979 Section 3.2, step 3: k = bits2int(T) - // Important: all mod() calls here must be done over N - const k = bits2int(kBytes); // mod n, not mod p - if (!Fn.isValidNot0(k)) - return; // Valid scalars (including k) must be in 1..N-1 - const ik = Fn.inv(k); // k^-1 mod n - const q = Point.BASE.multiply(k).toAffine(); // q = k⋅G - const r = Fn.create(q.x); // r = q.x mod n - if (r === _0n) - return; - const s = Fn.create(ik * Fn.create(m + r * d)); // Not using blinding here, see comment above - if (s === _0n) - return; - let recovery = (q.x === r ? 0 : 2) | Number(q.y & _1n); // recovery bit (2 or 3, when q.x > n) - let normS = s; - if (lowS && isBiggerThanHalfOrder(s)) { - normS = Fn.neg(s); // if lowS was passed, ensure s is always - recovery ^= 1; // // in the bottom half of N - } - return new Signature(r, normS, recovery); // use normS, not s - } - return { seed, k2sig }; - } - /** - * Signs message hash with a secret key. - * - * ``` - * sign(m, d) where - * k = rfc6979_hmac_drbg(m, d) - * (x, y) = G × k - * r = x mod n - * s = (m + dr) / k mod n - * ``` - */ - function sign(message, secretKey, opts = {}) { - message = ensureBytes('message', message); - const { seed, k2sig } = prepSig(message, secretKey, opts); // Steps A, D of RFC6979 3.2. - const drbg = createHmacDrbg(hash.outputLen, Fn.BYTES, hmac); - const sig = drbg(seed, k2sig); // Steps B, C, D, E, F, G - return sig; - } - function tryParsingSig(sg) { - // Try to deduce format - let sig = undefined; - const isHex = typeof sg === 'string' || isBytes(sg); - const isObj = !isHex && - sg !== null && - typeof sg === 'object' && - typeof sg.r === 'bigint' && - typeof sg.s === 'bigint'; - if (!isHex && !isObj) - throw new Error('invalid signature, expected Uint8Array, hex string or Signature instance'); - if (isObj) { - sig = new Signature(sg.r, sg.s); - } - else if (isHex) { - try { - sig = Signature.fromBytes(ensureBytes('sig', sg), 'der'); - } - catch (derError) { - if (!(derError instanceof DER.Err)) - throw derError; - } - if (!sig) { - try { - sig = Signature.fromBytes(ensureBytes('sig', sg), 'compact'); - } - catch (error) { - return false; - } - } - } - if (!sig) - return false; - return sig; - } - /** - * Verifies a signature against message and public key. - * Rejects lowS signatures by default: see {@link ECDSAVerifyOpts}. - * Implements section 4.1.4 from https://www.secg.org/sec1-v2.pdf: - * - * ``` - * verify(r, s, h, P) where - * u1 = hs^-1 mod n - * u2 = rs^-1 mod n - * R = u1⋅G + u2⋅P - * mod(R.x, n) == r - * ``` - */ - function verify(signature, message, publicKey, opts = {}) { - const { lowS, prehash, format } = validateSigOpts(opts, defaultSigOpts); - publicKey = ensureBytes('publicKey', publicKey); - message = validateMsgAndHash(ensureBytes('message', message), prehash); - if ('strict' in opts) - throw new Error('options.strict was renamed to lowS'); - const sig = format === undefined - ? tryParsingSig(signature) - : Signature.fromBytes(ensureBytes('sig', signature), format); - if (sig === false) - return false; - try { - const P = Point.fromBytes(publicKey); - if (lowS && sig.hasHighS()) - return false; - const { r, s } = sig; - const h = bits2int_modN(message); // mod n, not mod p - const is = Fn.inv(s); // s^-1 mod n - const u1 = Fn.create(h * is); // u1 = hs^-1 mod n - const u2 = Fn.create(r * is); // u2 = rs^-1 mod n - const R = Point.BASE.multiplyUnsafe(u1).add(P.multiplyUnsafe(u2)); // u1⋅G + u2⋅P - if (R.is0()) - return false; - const v = Fn.create(R.x); // v = r.x mod n - return v === r; - } - catch (e) { - return false; - } - } - function recoverPublicKey(signature, message, opts = {}) { - const { prehash } = validateSigOpts(opts, defaultSigOpts); - message = validateMsgAndHash(message, prehash); - return Signature.fromBytes(signature, 'recovered').recoverPublicKey(message).toBytes(); - } - return Object.freeze({ - keygen, - getPublicKey, - getSharedSecret, - utils, - lengths, - Point, - sign, - verify, - recoverPublicKey, - Signature, - hash, - }); -} -/** @deprecated use `weierstrass` in newer releases */ -export function weierstrassPoints(c) { - const { CURVE, curveOpts } = _weierstrass_legacy_opts_to_new(c); - const Point = weierstrassN(CURVE, curveOpts); - return _weierstrass_new_output_to_legacy(c, Point); -} -function _weierstrass_legacy_opts_to_new(c) { - const CURVE = { - a: c.a, - b: c.b, - p: c.Fp.ORDER, - n: c.n, - h: c.h, - Gx: c.Gx, - Gy: c.Gy, - }; - const Fp = c.Fp; - let allowedLengths = c.allowedPrivateKeyLengths - ? Array.from(new Set(c.allowedPrivateKeyLengths.map((l) => Math.ceil(l / 2)))) - : undefined; - const Fn = Field(CURVE.n, { - BITS: c.nBitLength, - allowedLengths: allowedLengths, - modFromBytes: c.wrapPrivateKey, - }); - const curveOpts = { - Fp, - Fn, - allowInfinityPoint: c.allowInfinityPoint, - endo: c.endo, - isTorsionFree: c.isTorsionFree, - clearCofactor: c.clearCofactor, - fromBytes: c.fromBytes, - toBytes: c.toBytes, - }; - return { CURVE, curveOpts }; -} -function _ecdsa_legacy_opts_to_new(c) { - const { CURVE, curveOpts } = _weierstrass_legacy_opts_to_new(c); - const ecdsaOpts = { - hmac: c.hmac, - randomBytes: c.randomBytes, - lowS: c.lowS, - bits2int: c.bits2int, - bits2int_modN: c.bits2int_modN, - }; - return { CURVE, curveOpts, hash: c.hash, ecdsaOpts }; -} -export function _legacyHelperEquat(Fp, a, b) { - /** - * y² = x³ + ax + b: Short weierstrass curve formula. Takes x, returns y². - * @returns y² - */ - function weierstrassEquation(x) { - const x2 = Fp.sqr(x); // x * x - const x3 = Fp.mul(x2, x); // x² * x - return Fp.add(Fp.add(x3, Fp.mul(x, a)), b); // x³ + a * x + b - } - return weierstrassEquation; -} -function _weierstrass_new_output_to_legacy(c, Point) { - const { Fp, Fn } = Point; - function isWithinCurveOrder(num) { - return inRange(num, _1n, Fn.ORDER); - } - const weierstrassEquation = _legacyHelperEquat(Fp, c.a, c.b); - return Object.assign({}, { - CURVE: c, - Point: Point, - ProjectivePoint: Point, - normPrivateKeyToScalar: (key) => _normFnElement(Fn, key), - weierstrassEquation, - isWithinCurveOrder, - }); -} -function _ecdsa_new_output_to_legacy(c, _ecdsa) { - const Point = _ecdsa.Point; - return Object.assign({}, _ecdsa, { - ProjectivePoint: Point, - CURVE: Object.assign({}, c, nLength(Point.Fn.ORDER, Point.Fn.BITS)), - }); -} -// _ecdsa_legacy -export function weierstrass(c) { - const { CURVE, curveOpts, hash, ecdsaOpts } = _ecdsa_legacy_opts_to_new(c); - const Point = weierstrassN(CURVE, curveOpts); - const signs = ecdsa(Point, hash, ecdsaOpts); - return _ecdsa_new_output_to_legacy(c, signs); -} -//# sourceMappingURL=weierstrass.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/weierstrass.js.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/weierstrass.js.map deleted file mode 100644 index eab5c931..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/abstract/weierstrass.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"weierstrass.js","sourceRoot":"","sources":["../../src/abstract/weierstrass.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,sEAAsE;AACtE,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EACL,eAAe,EACf,OAAO,IAAI,KAAK,EAChB,QAAQ,IAAI,MAAM,EAClB,QAAQ,EACR,MAAM,EACN,OAAO,EACP,UAAU,EACV,eAAe,EACf,WAAW,EACX,cAAc,EACd,WAAW,EACX,UAAU,EACV,OAAO,EACP,OAAO,EACP,QAAQ,EACR,mBAAmB,EACnB,WAAW,IAAI,cAAc,GAI9B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,QAAQ,EACR,UAAU,EACV,SAAS,EACT,IAAI,GAML,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,KAAK,EACL,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,OAAO,EACP,aAAa,GAGd,MAAM,cAAc,CAAC;AAmCtB,+HAA+H;AAC/H,MAAM,UAAU,GAAG,CAAC,GAAW,EAAE,GAAW,EAAE,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;AAI7F;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,CAAS,EAAE,KAAgB,EAA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Y,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAC7C,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;IAC5C,OAAO,2BAA2B,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AAC/C,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/bls12-381.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/esm/bls12-381.d.ts deleted file mode 100644 index 6d0a1737..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/bls12-381.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { type CurveFn } from './abstract/bls.ts'; -import { type IField } from './abstract/modular.ts'; -export declare const bls12_381_Fr: IField; -/** - * bls12-381 pairing-friendly curve. - * @example - * import { bls12_381 as bls } from '@noble/curves/bls12-381'; - * // G1 keys, G2 signatures - * const privateKey = '67d53f170b908cabb9eb326c3c337762d59289a8fec79f7bc9254b584b73265c'; - * const message = '64726e3da8'; - * const publicKey = bls.getPublicKey(privateKey); - * const signature = bls.sign(message, privateKey); - * const isValid = bls.verify(signature, message, publicKey); - */ -export declare const bls12_381: CurveFn; -//# sourceMappingURL=bls12-381.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/bls12-381.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/bls12-381.d.ts.map deleted file mode 100644 index 5ff79083..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/bls12-381.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bls12-381.d.ts","sourceRoot":"","sources":["../src/bls12-381.ts"],"names":[],"mappings":"AAgFA,OAAO,EAAO,KAAK,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAS,KAAK,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAmE3D,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,CAGtC,CAAC;AAuTH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,EAAE,OA8HtB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/bls12-381.js b/tools/mnemonic-test/node_modules/@noble/curves/esm/bls12-381.js deleted file mode 100644 index 737b20cf..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/bls12-381.js +++ /dev/null @@ -1,705 +0,0 @@ -/** - * bls12-381 is pairing-friendly Barreto-Lynn-Scott elliptic curve construction allowing to: - -* Construct zk-SNARKs at the ~120-bit security, as per [Barbulescu-Duquesne 2017](https://hal.science/hal-01534101/file/main.pdf) -* Efficiently verify N aggregate signatures with 1 pairing and N ec additions: -the Boneh-Lynn-Shacham signature scheme is orders of magnitude more efficient than Schnorr - -BLS can mean 2 different things: - -* Barreto-Lynn-Scott: BLS12, a Pairing Friendly Elliptic Curve -* Boneh-Lynn-Shacham: A Signature Scheme. - -### Summary - -1. BLS Relies on expensive bilinear pairing -2. Secret Keys: 32 bytes -3. Public Keys: 48 OR 96 bytes - big-endian x coordinate of point on G1 OR G2 curve -4. Signatures: 96 OR 48 bytes - big-endian x coordinate of point on G2 OR G1 curve -5. The 12 stands for the Embedding degree. - -Modes of operation: - -* Long signatures: 48-byte keys + 96-byte sigs (G1 keys + G2 sigs). -* Short signatures: 96-byte keys + 48-byte sigs (G2 keys + G1 sigs). - -### Formulas - -- `P = pk x G` - public keys -- `S = pk x H(m)` - signing, uses hash-to-curve on m -- `e(P, H(m)) == e(G, S)` - verification using pairings -- `e(G, S) = e(G, SUM(n)(Si)) = MUL(n)(e(G, Si))` - signature aggregation - -### Curves - -G1 is ordinary elliptic curve. G2 is extension field curve, think "over complex numbers". - -- G1: y² = x³ + 4 -- G2: y² = x³ + 4(u + 1) where u = √−1; r-order subgroup of E'(Fp²), M-type twist - -### Towers - -Pairing G1 + G2 produces element in Fp₁₂, 12-degree polynomial. -Fp₁₂ is usually implemented using tower of lower-degree polynomials for speed. - -- Fp₁₂ = Fp₆² => Fp₂³ -- Fp(u) / (u² - β) where β = -1 -- Fp₂(v) / (v³ - ξ) where ξ = u + 1 -- Fp₆(w) / (w² - γ) where γ = v -- Fp²[u] = Fp/u²+1 -- Fp⁶[v] = Fp²/v³-1-u -- Fp¹²[w] = Fp⁶/w²-v - -### Params - -* Embedding degree (k): 12 -* Seed is sometimes named x or t -* t = -15132376222941642752 -* p = (t-1)² * (t⁴-t²+1)/3 + t -* r = t⁴-t²+1 -* Ate loop size: X - -To verify curve parameters, see -[pairing-friendly-curves spec](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-pairing-friendly-curves-11). -Basic math is done over finite fields over p. -More complicated math is done over polynominal extension fields. - -### Compatibility and notes -1. It is compatible with Algorand, Chia, Dfinity, Ethereum, Filecoin, ZEC. -Filecoin uses little endian byte arrays for secret keys - make sure to reverse byte order. -2. Make sure to correctly select mode: "long signature" or "short signature". -3. Compatible with specs: - RFC 9380, - [cfrg-pairing-friendly-curves-11](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-pairing-friendly-curves-11), - [cfrg-bls-signature-05](https://datatracker.ietf.org/doc/draft-irtf-cfrg-bls-signature/). - - * - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { sha256 } from '@noble/hashes/sha2.js'; -import { bls } from "./abstract/bls.js"; -import { Field } from "./abstract/modular.js"; -import { abytes, bitLen, bitMask, bytesToHex, bytesToNumberBE, concatBytes, ensureBytes, numberToBytesBE, } from "./utils.js"; -// Types -import { isogenyMap } from "./abstract/hash-to-curve.js"; -import { psiFrobenius, tower12 } from "./abstract/tower.js"; -import { mapToCurveSimpleSWU, } from "./abstract/weierstrass.js"; -// Be friendly to bad ECMAScript parsers by not using bigint literals -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = BigInt(4); -// To verify math: -// https://tools.ietf.org/html/draft-irtf-cfrg-pairing-friendly-curves-11 -// The BLS parameter x (seed) for BLS12-381. NOTE: it is negative! -// x = -2^63 - 2^62 - 2^60 - 2^57 - 2^48 - 2^16 -const BLS_X = BigInt('0xd201000000010000'); -// t = x (called differently in different places) -// const t = -BLS_X; -const BLS_X_LEN = bitLen(BLS_X); -// a=0, b=4 -// P is characteristic of field Fp, in which curve calculations are done. -// p = (t-1)² * (t⁴-t²+1)/3 + t -// bls12_381_Fp = (t-1n)**2n * (t**4n - t**2n + 1n) / 3n + t -// r*h is curve order, amount of points on curve, -// where r is order of prime subgroup and h is cofactor. -// r = t⁴-t²+1 -// r = (t**4n - t**2n + 1n) -// cofactor h of G1: (t - 1)²/3 -// cofactorG1 = (t-1n)**2n/3n -// x = 3685416753713387016781088315183077757961620795782546409894578378688607592378376318836054947676345821548104185464507 -// y = 1339506544944476473020471379941921221584933875938349620426543736416511423956333506472724655353366534992391756441569 -const bls12_381_CURVE_G1 = { - p: BigInt('0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab'), - n: BigInt('0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001'), - h: BigInt('0x396c8c005555e1568c00aaab0000aaab'), - a: _0n, - b: _4n, - Gx: BigInt('0x17f1d3a73197d7942695638c4fa9ac0fc3688c4f9774b905a14e3a3f171bac586c55e83ff97a1aeffb3af00adb22c6bb'), - Gy: BigInt('0x08b3f481e3aaa0f1a09e30ed741d8ae4fcf5e095d5d00af600db18cb2c04b3edd03cc744a2888ae40caa232946c5e7e1'), -}; -// CURVE FIELDS -export const bls12_381_Fr = Field(bls12_381_CURVE_G1.n, { - modFromBytes: true, - isLE: true, -}); -const { Fp, Fp2, Fp6, Fp12 } = tower12({ - ORDER: bls12_381_CURVE_G1.p, - X_LEN: BLS_X_LEN, - // Finite extension field over irreducible polynominal. - // Fp(u) / (u² - β) where β = -1 - FP2_NONRESIDUE: [_1n, _1n], - Fp2mulByB: ({ c0, c1 }) => { - const t0 = Fp.mul(c0, _4n); // 4 * c0 - const t1 = Fp.mul(c1, _4n); // 4 * c1 - // (T0-T1) + (T0+T1)*i - return { c0: Fp.sub(t0, t1), c1: Fp.add(t0, t1) }; - }, - Fp12finalExponentiate: (num) => { - const x = BLS_X; - // this^(q⁶) / this - const t0 = Fp12.div(Fp12.frobeniusMap(num, 6), num); - // t0^(q²) * t0 - const t1 = Fp12.mul(Fp12.frobeniusMap(t0, 2), t0); - const t2 = Fp12.conjugate(Fp12._cyclotomicExp(t1, x)); - const t3 = Fp12.mul(Fp12.conjugate(Fp12._cyclotomicSquare(t1)), t2); - const t4 = Fp12.conjugate(Fp12._cyclotomicExp(t3, x)); - const t5 = Fp12.conjugate(Fp12._cyclotomicExp(t4, x)); - const t6 = Fp12.mul(Fp12.conjugate(Fp12._cyclotomicExp(t5, x)), Fp12._cyclotomicSquare(t2)); - const t7 = Fp12.conjugate(Fp12._cyclotomicExp(t6, x)); - const t2_t5_pow_q2 = Fp12.frobeniusMap(Fp12.mul(t2, t5), 2); - const t4_t1_pow_q3 = Fp12.frobeniusMap(Fp12.mul(t4, t1), 3); - const t6_t1c_pow_q1 = Fp12.frobeniusMap(Fp12.mul(t6, Fp12.conjugate(t1)), 1); - const t7_t3c_t1 = Fp12.mul(Fp12.mul(t7, Fp12.conjugate(t3)), t1); - // (t2 * t5)^(q²) * (t4 * t1)^(q³) * (t6 * t1.conj)^(q^1) * t7 * t3.conj * t1 - return Fp12.mul(Fp12.mul(Fp12.mul(t2_t5_pow_q2, t4_t1_pow_q3), t6_t1c_pow_q1), t7_t3c_t1); - }, -}); -// GLV endomorphism Ψ(P), for fast cofactor clearing -const { G2psi, G2psi2 } = psiFrobenius(Fp, Fp2, Fp2.div(Fp2.ONE, Fp2.NONRESIDUE)); // 1/(u+1) -/** - * Default hash_to_field / hash-to-curve for BLS. - * m: 1 for G1, 2 for G2 - * k: target security level in bits - * hash: any function, e.g. BBS+ uses BLAKE2: see [github](https://github.com/hyperledger/aries-framework-go/issues/2247). - * Parameter values come from [section 8.8.2 of RFC 9380](https://www.rfc-editor.org/rfc/rfc9380#section-8.8.2). - */ -const htfDefaults = Object.freeze({ - DST: 'BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_NUL_', - encodeDST: 'BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_NUL_', - p: Fp.ORDER, - m: 2, - k: 128, - expand: 'xmd', - hash: sha256, -}); -// a=0, b=4 -// cofactor h of G2 -// (t^8 - 4t^7 + 5t^6 - 4t^4 + 6t^3 - 4t^2 - 4t + 13)/9 -// cofactorG2 = (t**8n - 4n*t**7n + 5n*t**6n - 4n*t**4n + 6n*t**3n - 4n*t**2n - 4n*t+13n)/9n -// x = 3059144344244213709971259814753781636986470325476647558659373206291635324768958432433509563104347017837885763365758*u + 352701069587466618187139116011060144890029952792775240219908644239793785735715026873347600343865175952761926303160 -// y = 927553665492332455747201965776037880757740193453592970025027978793976877002675564980949289727957565575433344219582*u + 1985150602287291935568054521177171638300868978215655730859378665066344726373823718423869104263333984641494340347905 -const bls12_381_CURVE_G2 = { - p: Fp2.ORDER, - n: bls12_381_CURVE_G1.n, - h: BigInt('0x5d543a95414e7f1091d50792876a202cd91de4547085abaa68a205b2e5a7ddfa628f1cb4d9e82ef21537e293a6691ae1616ec6e786f0c70cf1c38e31c7238e5'), - a: Fp2.ZERO, - b: Fp2.fromBigTuple([_4n, _4n]), - Gx: Fp2.fromBigTuple([ - BigInt('0x024aa2b2f08f0a91260805272dc51051c6e47ad4fa403b02b4510b647ae3d1770bac0326a805bbefd48056c8c121bdb8'), - BigInt('0x13e02b6052719f607dacd3a088274f65596bd0d09920b61ab5da61bbdc7f5049334cf11213945d57e5ac7d055d042b7e'), - ]), - Gy: Fp2.fromBigTuple([ - BigInt('0x0ce5d527727d6e118cc9cdc6da2e351aadfd9baa8cbdd3a76d429a695160d12c923ac9cc3baca289e193548608b82801'), - BigInt('0x0606c4a02ea734cc32acd2b02bc28b99cb3e287e85a763af267492ab572e99ab3f370d275cec1da1aaa9075ff05f79be'), - ]), -}; -// Encoding utils -// Compressed point of infinity -// Set compressed & point-at-infinity bits -const COMPZERO = setMask(Fp.toBytes(_0n), { infinity: true, compressed: true }); -function parseMask(bytes) { - // Copy, so we can remove mask data. It will be removed also later, when Fp.create will call modulo. - bytes = bytes.slice(); - const mask = bytes[0] & 224; - const compressed = !!((mask >> 7) & 1); // compression bit (0b1000_0000) - const infinity = !!((mask >> 6) & 1); // point at infinity bit (0b0100_0000) - const sort = !!((mask >> 5) & 1); // sort bit (0b0010_0000) - bytes[0] &= 31; // clear mask (zero first 3 bits) - return { compressed, infinity, sort, value: bytes }; -} -function setMask(bytes, mask) { - if (bytes[0] & 224) - throw new Error('setMask: non-empty mask'); - if (mask.compressed) - bytes[0] |= 128; - if (mask.infinity) - bytes[0] |= 64; - if (mask.sort) - bytes[0] |= 32; - return bytes; -} -function pointG1ToBytes(_c, point, isComp) { - const { BYTES: L, ORDER: P } = Fp; - const is0 = point.is0(); - const { x, y } = point.toAffine(); - if (isComp) { - if (is0) - return COMPZERO.slice(); - const sort = Boolean((y * _2n) / P); - return setMask(numberToBytesBE(x, L), { compressed: true, sort }); - } - else { - if (is0) { - return concatBytes(Uint8Array.of(0x40), new Uint8Array(2 * L - 1)); - } - else { - return concatBytes(numberToBytesBE(x, L), numberToBytesBE(y, L)); - } - } -} -function signatureG1ToBytes(point) { - point.assertValidity(); - const { BYTES: L, ORDER: P } = Fp; - const { x, y } = point.toAffine(); - if (point.is0()) - return COMPZERO.slice(); - const sort = Boolean((y * _2n) / P); - return setMask(numberToBytesBE(x, L), { compressed: true, sort }); -} -function pointG1FromBytes(bytes) { - const { compressed, infinity, sort, value } = parseMask(bytes); - const { BYTES: L, ORDER: P } = Fp; - if (value.length === 48 && compressed) { - const compressedValue = bytesToNumberBE(value); - // Zero - const x = Fp.create(compressedValue & bitMask(Fp.BITS)); - if (infinity) { - if (x !== _0n) - throw new Error('invalid G1 point: non-empty, at infinity, with compression'); - return { x: _0n, y: _0n }; - } - const right = Fp.add(Fp.pow(x, _3n), Fp.create(bls12_381_CURVE_G1.b)); // y² = x³ + b - let y = Fp.sqrt(right); - if (!y) - throw new Error('invalid G1 point: compressed point'); - if ((y * _2n) / P !== BigInt(sort)) - y = Fp.neg(y); - return { x: Fp.create(x), y: Fp.create(y) }; - } - else if (value.length === 96 && !compressed) { - // Check if the infinity flag is set - const x = bytesToNumberBE(value.subarray(0, L)); - const y = bytesToNumberBE(value.subarray(L)); - if (infinity) { - if (x !== _0n || y !== _0n) - throw new Error('G1: non-empty point at infinity'); - return bls12_381.G1.Point.ZERO.toAffine(); - } - return { x: Fp.create(x), y: Fp.create(y) }; - } - else { - throw new Error('invalid G1 point: expected 48/96 bytes'); - } -} -function signatureG1FromBytes(hex) { - const { infinity, sort, value } = parseMask(ensureBytes('signatureHex', hex, 48)); - const P = Fp.ORDER; - const Point = bls12_381.G1.Point; - const compressedValue = bytesToNumberBE(value); - // Zero - if (infinity) - return Point.ZERO; - const x = Fp.create(compressedValue & bitMask(Fp.BITS)); - const right = Fp.add(Fp.pow(x, _3n), Fp.create(bls12_381_CURVE_G1.b)); // y² = x³ + b - let y = Fp.sqrt(right); - if (!y) - throw new Error('invalid G1 point: compressed'); - const aflag = BigInt(sort); - if ((y * _2n) / P !== aflag) - y = Fp.neg(y); - const point = Point.fromAffine({ x, y }); - point.assertValidity(); - return point; -} -function pointG2ToBytes(_c, point, isComp) { - const { BYTES: L, ORDER: P } = Fp; - const is0 = point.is0(); - const { x, y } = point.toAffine(); - if (isComp) { - if (is0) - return concatBytes(COMPZERO, numberToBytesBE(_0n, L)); - const flag = Boolean(y.c1 === _0n ? (y.c0 * _2n) / P : (y.c1 * _2n) / P); - return concatBytes(setMask(numberToBytesBE(x.c1, L), { compressed: true, sort: flag }), numberToBytesBE(x.c0, L)); - } - else { - if (is0) - return concatBytes(Uint8Array.of(0x40), new Uint8Array(4 * L - 1)); - const { re: x0, im: x1 } = Fp2.reim(x); - const { re: y0, im: y1 } = Fp2.reim(y); - return concatBytes(numberToBytesBE(x1, L), numberToBytesBE(x0, L), numberToBytesBE(y1, L), numberToBytesBE(y0, L)); - } -} -function signatureG2ToBytes(point) { - point.assertValidity(); - const { BYTES: L } = Fp; - if (point.is0()) - return concatBytes(COMPZERO, numberToBytesBE(_0n, L)); - const { x, y } = point.toAffine(); - const { re: x0, im: x1 } = Fp2.reim(x); - const { re: y0, im: y1 } = Fp2.reim(y); - const tmp = y1 > _0n ? y1 * _2n : y0 * _2n; - const sort = Boolean((tmp / Fp.ORDER) & _1n); - const z2 = x0; - return concatBytes(setMask(numberToBytesBE(x1, L), { sort, compressed: true }), numberToBytesBE(z2, L)); -} -function pointG2FromBytes(bytes) { - const { BYTES: L, ORDER: P } = Fp; - const { compressed, infinity, sort, value } = parseMask(bytes); - if ((!compressed && !infinity && sort) || // 00100000 - (!compressed && infinity && sort) || // 01100000 - (sort && infinity && compressed) // 11100000 - ) { - throw new Error('invalid encoding flag: ' + (bytes[0] & 224)); - } - const slc = (b, from, to) => bytesToNumberBE(b.slice(from, to)); - if (value.length === 96 && compressed) { - if (infinity) { - // check that all bytes are 0 - if (value.reduce((p, c) => (p !== 0 ? c + 1 : c), 0) > 0) { - throw new Error('invalid G2 point: compressed'); - } - return { x: Fp2.ZERO, y: Fp2.ZERO }; - } - const x_1 = slc(value, 0, L); - const x_0 = slc(value, L, 2 * L); - const x = Fp2.create({ c0: Fp.create(x_0), c1: Fp.create(x_1) }); - const right = Fp2.add(Fp2.pow(x, _3n), bls12_381_CURVE_G2.b); // y² = x³ + 4 * (u+1) = x³ + b - let y = Fp2.sqrt(right); - const Y_bit = y.c1 === _0n ? (y.c0 * _2n) / P : (y.c1 * _2n) / P ? _1n : _0n; - y = sort && Y_bit > 0 ? y : Fp2.neg(y); - return { x, y }; - } - else if (value.length === 192 && !compressed) { - if (infinity) { - if (value.reduce((p, c) => (p !== 0 ? c + 1 : c), 0) > 0) { - throw new Error('invalid G2 point: uncompressed'); - } - return { x: Fp2.ZERO, y: Fp2.ZERO }; - } - const x1 = slc(value, 0 * L, 1 * L); - const x0 = slc(value, 1 * L, 2 * L); - const y1 = slc(value, 2 * L, 3 * L); - const y0 = slc(value, 3 * L, 4 * L); - return { x: Fp2.fromBigTuple([x0, x1]), y: Fp2.fromBigTuple([y0, y1]) }; - } - else { - throw new Error('invalid G2 point: expected 96/192 bytes'); - } -} -function signatureG2FromBytes(hex) { - const { ORDER: P } = Fp; - // TODO: Optimize, it's very slow because of sqrt. - const { infinity, sort, value } = parseMask(ensureBytes('signatureHex', hex)); - const Point = bls12_381.G2.Point; - const half = value.length / 2; - if (half !== 48 && half !== 96) - throw new Error('invalid compressed signature length, expected 96/192 bytes'); - const z1 = bytesToNumberBE(value.slice(0, half)); - const z2 = bytesToNumberBE(value.slice(half)); - // Indicates the infinity point - if (infinity) - return Point.ZERO; - const x1 = Fp.create(z1 & bitMask(Fp.BITS)); - const x2 = Fp.create(z2); - const x = Fp2.create({ c0: x2, c1: x1 }); - const y2 = Fp2.add(Fp2.pow(x, _3n), bls12_381_CURVE_G2.b); // y² = x³ + 4 - // The slow part - let y = Fp2.sqrt(y2); - if (!y) - throw new Error('Failed to find a square root'); - // Choose the y whose leftmost bit of the imaginary part is equal to the a_flag1 - // If y1 happens to be zero, then use the bit of y0 - const { re: y0, im: y1 } = Fp2.reim(y); - const aflag1 = BigInt(sort); - const isGreater = y1 > _0n && (y1 * _2n) / P !== aflag1; - const is0 = y1 === _0n && (y0 * _2n) / P !== aflag1; - if (isGreater || is0) - y = Fp2.neg(y); - const point = Point.fromAffine({ x, y }); - point.assertValidity(); - return point; -} -/** - * bls12-381 pairing-friendly curve. - * @example - * import { bls12_381 as bls } from '@noble/curves/bls12-381'; - * // G1 keys, G2 signatures - * const privateKey = '67d53f170b908cabb9eb326c3c337762d59289a8fec79f7bc9254b584b73265c'; - * const message = '64726e3da8'; - * const publicKey = bls.getPublicKey(privateKey); - * const signature = bls.sign(message, privateKey); - * const isValid = bls.verify(signature, message, publicKey); - */ -export const bls12_381 = bls({ - // Fields - fields: { - Fp, - Fp2, - Fp6, - Fp12, - Fr: bls12_381_Fr, - }, - // G1: y² = x³ + 4 - G1: { - ...bls12_381_CURVE_G1, - Fp, - htfDefaults: { ...htfDefaults, m: 1, DST: 'BLS_SIG_BLS12381G1_XMD:SHA-256_SSWU_RO_NUL_' }, - wrapPrivateKey: true, - allowInfinityPoint: true, - // Checks is the point resides in prime-order subgroup. - // point.isTorsionFree() should return true for valid points - // It returns false for shitty points. - // https://eprint.iacr.org/2021/1130.pdf - isTorsionFree: (c, point) => { - // GLV endomorphism ψ(P) - const beta = BigInt('0x5f19672fdf76ce51ba69c6076a0f77eaddb3a93be6f89688de17d813620a00022e01fffffffefffe'); - const phi = new c(Fp.mul(point.X, beta), point.Y, point.Z); - // TODO: unroll - const xP = point.multiplyUnsafe(BLS_X).negate(); // [x]P - const u2P = xP.multiplyUnsafe(BLS_X); // [u2]P - return u2P.equals(phi); - }, - // Clear cofactor of G1 - // https://eprint.iacr.org/2019/403 - clearCofactor: (_c, point) => { - // return this.multiplyUnsafe(CURVE.h); - return point.multiplyUnsafe(BLS_X).add(point); // x*P + P - }, - mapToCurve: mapToG1, - fromBytes: pointG1FromBytes, - toBytes: pointG1ToBytes, - ShortSignature: { - fromBytes(bytes) { - abytes(bytes); - return signatureG1FromBytes(bytes); - }, - fromHex(hex) { - return signatureG1FromBytes(hex); - }, - toBytes(point) { - return signatureG1ToBytes(point); - }, - toRawBytes(point) { - return signatureG1ToBytes(point); - }, - toHex(point) { - return bytesToHex(signatureG1ToBytes(point)); - }, - }, - }, - G2: { - ...bls12_381_CURVE_G2, - Fp: Fp2, - // https://datatracker.ietf.org/doc/html/rfc9380#name-clearing-the-cofactor - // https://datatracker.ietf.org/doc/html/rfc9380#name-cofactor-clearing-for-bls12 - hEff: BigInt('0xbc69f08f2ee75b3584c6a0ea91b352888e2a8e9145ad7689986ff031508ffe1329c2f178731db956d82bf015d1212b02ec0ec69d7477c1ae954cbc06689f6a359894c0adebbf6b4e8020005aaa95551'), - htfDefaults: { ...htfDefaults }, - wrapPrivateKey: true, - allowInfinityPoint: true, - mapToCurve: mapToG2, - // Checks is the point resides in prime-order subgroup. - // point.isTorsionFree() should return true for valid points - // It returns false for shitty points. - // https://eprint.iacr.org/2021/1130.pdf - // Older version: https://eprint.iacr.org/2019/814.pdf - isTorsionFree: (c, P) => { - return P.multiplyUnsafe(BLS_X).negate().equals(G2psi(c, P)); // ψ(P) == [u](P) - }, - // Maps the point into the prime-order subgroup G2. - // clear_cofactor_bls12381_g2 from RFC 9380. - // https://eprint.iacr.org/2017/419.pdf - // prettier-ignore - clearCofactor: (c, P) => { - const x = BLS_X; - let t1 = P.multiplyUnsafe(x).negate(); // [-x]P - let t2 = G2psi(c, P); // Ψ(P) - let t3 = P.double(); // 2P - t3 = G2psi2(c, t3); // Ψ²(2P) - t3 = t3.subtract(t2); // Ψ²(2P) - Ψ(P) - t2 = t1.add(t2); // [-x]P + Ψ(P) - t2 = t2.multiplyUnsafe(x).negate(); // [x²]P - [x]Ψ(P) - t3 = t3.add(t2); // Ψ²(2P) - Ψ(P) + [x²]P - [x]Ψ(P) - t3 = t3.subtract(t1); // Ψ²(2P) - Ψ(P) + [x²]P - [x]Ψ(P) + [x]P - const Q = t3.subtract(P); // Ψ²(2P) - Ψ(P) + [x²]P - [x]Ψ(P) + [x]P - 1P - return Q; // [x²-x-1]P + [x-1]Ψ(P) + Ψ²(2P) - }, - fromBytes: pointG2FromBytes, - toBytes: pointG2ToBytes, - Signature: { - fromBytes(bytes) { - abytes(bytes); - return signatureG2FromBytes(bytes); - }, - fromHex(hex) { - return signatureG2FromBytes(hex); - }, - toBytes(point) { - return signatureG2ToBytes(point); - }, - toRawBytes(point) { - return signatureG2ToBytes(point); - }, - toHex(point) { - return bytesToHex(signatureG2ToBytes(point)); - }, - }, - }, - params: { - ateLoopSize: BLS_X, // The BLS parameter x for BLS12-381 - r: bls12_381_CURVE_G1.n, // order; z⁴ − z² + 1; CURVE.n from other curves - xNegative: true, - twistType: 'multiplicative', - }, - htfDefaults, - hash: sha256, -}); -// 3-isogeny map from E' to E https://www.rfc-editor.org/rfc/rfc9380#appendix-E.3 -const isogenyMapG2 = isogenyMap(Fp2, [ - // xNum - [ - [ - '0x5c759507e8e333ebb5b7a9a47d7ed8532c52d39fd3a042a88b58423c50ae15d5c2638e343d9c71c6238aaaaaaaa97d6', - '0x5c759507e8e333ebb5b7a9a47d7ed8532c52d39fd3a042a88b58423c50ae15d5c2638e343d9c71c6238aaaaaaaa97d6', - ], - [ - '0x0', - '0x11560bf17baa99bc32126fced787c88f984f87adf7ae0c7f9a208c6b4f20a4181472aaa9cb8d555526a9ffffffffc71a', - ], - [ - '0x11560bf17baa99bc32126fced787c88f984f87adf7ae0c7f9a208c6b4f20a4181472aaa9cb8d555526a9ffffffffc71e', - '0x8ab05f8bdd54cde190937e76bc3e447cc27c3d6fbd7063fcd104635a790520c0a395554e5c6aaaa9354ffffffffe38d', - ], - [ - '0x171d6541fa38ccfaed6dea691f5fb614cb14b4e7f4e810aa22d6108f142b85757098e38d0f671c7188e2aaaaaaaa5ed1', - '0x0', - ], - ], - // xDen - [ - [ - '0x0', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaa63', - ], - [ - '0xc', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaa9f', - ], - ['0x1', '0x0'], // LAST 1 - ], - // yNum - [ - [ - '0x1530477c7ab4113b59a4c18b076d11930f7da5d4a07f649bf54439d87d27e500fc8c25ebf8c92f6812cfc71c71c6d706', - '0x1530477c7ab4113b59a4c18b076d11930f7da5d4a07f649bf54439d87d27e500fc8c25ebf8c92f6812cfc71c71c6d706', - ], - [ - '0x0', - '0x5c759507e8e333ebb5b7a9a47d7ed8532c52d39fd3a042a88b58423c50ae15d5c2638e343d9c71c6238aaaaaaaa97be', - ], - [ - '0x11560bf17baa99bc32126fced787c88f984f87adf7ae0c7f9a208c6b4f20a4181472aaa9cb8d555526a9ffffffffc71c', - '0x8ab05f8bdd54cde190937e76bc3e447cc27c3d6fbd7063fcd104635a790520c0a395554e5c6aaaa9354ffffffffe38f', - ], - [ - '0x124c9ad43b6cf79bfbf7043de3811ad0761b0f37a1e26286b0e977c69aa274524e79097a56dc4bd9e1b371c71c718b10', - '0x0', - ], - ], - // yDen - [ - [ - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffa8fb', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffa8fb', - ], - [ - '0x0', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffa9d3', - ], - [ - '0x12', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaa99', - ], - ['0x1', '0x0'], // LAST 1 - ], -].map((i) => i.map((pair) => Fp2.fromBigTuple(pair.map(BigInt))))); -// 11-isogeny map from E' to E -const isogenyMapG1 = isogenyMap(Fp, [ - // xNum - [ - '0x11a05f2b1e833340b809101dd99815856b303e88a2d7005ff2627b56cdb4e2c85610c2d5f2e62d6eaeac1662734649b7', - '0x17294ed3e943ab2f0588bab22147a81c7c17e75b2f6a8417f565e33c70d1e86b4838f2a6f318c356e834eef1b3cb83bb', - '0xd54005db97678ec1d1048c5d10a9a1bce032473295983e56878e501ec68e25c958c3e3d2a09729fe0179f9dac9edcb0', - '0x1778e7166fcc6db74e0609d307e55412d7f5e4656a8dbf25f1b33289f1b330835336e25ce3107193c5b388641d9b6861', - '0xe99726a3199f4436642b4b3e4118e5499db995a1257fb3f086eeb65982fac18985a286f301e77c451154ce9ac8895d9', - '0x1630c3250d7313ff01d1201bf7a74ab5db3cb17dd952799b9ed3ab9097e68f90a0870d2dcae73d19cd13c1c66f652983', - '0xd6ed6553fe44d296a3726c38ae652bfb11586264f0f8ce19008e218f9c86b2a8da25128c1052ecaddd7f225a139ed84', - '0x17b81e7701abdbe2e8743884d1117e53356de5ab275b4db1a682c62ef0f2753339b7c8f8c8f475af9ccb5618e3f0c88e', - '0x80d3cf1f9a78fc47b90b33563be990dc43b756ce79f5574a2c596c928c5d1de4fa295f296b74e956d71986a8497e317', - '0x169b1f8e1bcfa7c42e0c37515d138f22dd2ecb803a0c5c99676314baf4bb1b7fa3190b2edc0327797f241067be390c9e', - '0x10321da079ce07e272d8ec09d2565b0dfa7dccdde6787f96d50af36003b14866f69b771f8c285decca67df3f1605fb7b', - '0x6e08c248e260e70bd1e962381edee3d31d79d7e22c837bc23c0bf1bc24c6b68c24b1b80b64d391fa9c8ba2e8ba2d229', - ], - // xDen - [ - '0x8ca8d548cff19ae18b2e62f4bd3fa6f01d5ef4ba35b48ba9c9588617fc8ac62b558d681be343df8993cf9fa40d21b1c', - '0x12561a5deb559c4348b4711298e536367041e8ca0cf0800c0126c2588c48bf5713daa8846cb026e9e5c8276ec82b3bff', - '0xb2962fe57a3225e8137e629bff2991f6f89416f5a718cd1fca64e00b11aceacd6a3d0967c94fedcfcc239ba5cb83e19', - '0x3425581a58ae2fec83aafef7c40eb545b08243f16b1655154cca8abc28d6fd04976d5243eecf5c4130de8938dc62cd8', - '0x13a8e162022914a80a6f1d5f43e7a07dffdfc759a12062bb8d6b44e833b306da9bd29ba81f35781d539d395b3532a21e', - '0xe7355f8e4e667b955390f7f0506c6e9395735e9ce9cad4d0a43bcef24b8982f7400d24bc4228f11c02df9a29f6304a5', - '0x772caacf16936190f3e0c63e0596721570f5799af53a1894e2e073062aede9cea73b3538f0de06cec2574496ee84a3a', - '0x14a7ac2a9d64a8b230b3f5b074cf01996e7f63c21bca68a81996e1cdf9822c580fa5b9489d11e2d311f7d99bbdcc5a5e', - '0xa10ecf6ada54f825e920b3dafc7a3cce07f8d1d7161366b74100da67f39883503826692abba43704776ec3a79a1d641', - '0x95fc13ab9e92ad4476d6e3eb3a56680f682b4ee96f7d03776df533978f31c1593174e4b4b7865002d6384d168ecdd0a', - '0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001', // LAST 1 - ], - // yNum - [ - '0x90d97c81ba24ee0259d1f094980dcfa11ad138e48a869522b52af6c956543d3cd0c7aee9b3ba3c2be9845719707bb33', - '0x134996a104ee5811d51036d776fb46831223e96c254f383d0f906343eb67ad34d6c56711962fa8bfe097e75a2e41c696', - '0xcc786baa966e66f4a384c86a3b49942552e2d658a31ce2c344be4b91400da7d26d521628b00523b8dfe240c72de1f6', - '0x1f86376e8981c217898751ad8746757d42aa7b90eeb791c09e4a3ec03251cf9de405aba9ec61deca6355c77b0e5f4cb', - '0x8cc03fdefe0ff135caf4fe2a21529c4195536fbe3ce50b879833fd221351adc2ee7f8dc099040a841b6daecf2e8fedb', - '0x16603fca40634b6a2211e11db8f0a6a074a7d0d4afadb7bd76505c3d3ad5544e203f6326c95a807299b23ab13633a5f0', - '0x4ab0b9bcfac1bbcb2c977d027796b3ce75bb8ca2be184cb5231413c4d634f3747a87ac2460f415ec961f8855fe9d6f2', - '0x987c8d5333ab86fde9926bd2ca6c674170a05bfe3bdd81ffd038da6c26c842642f64550fedfe935a15e4ca31870fb29', - '0x9fc4018bd96684be88c9e221e4da1bb8f3abd16679dc26c1e8b6e6a1f20cabe69d65201c78607a360370e577bdba587', - '0xe1bba7a1186bdb5223abde7ada14a23c42a0ca7915af6fe06985e7ed1e4d43b9b3f7055dd4eba6f2bafaaebca731c30', - '0x19713e47937cd1be0dfd0b8f1d43fb93cd2fcbcb6caf493fd1183e416389e61031bf3a5cce3fbafce813711ad011c132', - '0x18b46a908f36f6deb918c143fed2edcc523559b8aaf0c2462e6bfe7f911f643249d9cdf41b44d606ce07c8a4d0074d8e', - '0xb182cac101b9399d155096004f53f447aa7b12a3426b08ec02710e807b4633f06c851c1919211f20d4c04f00b971ef8', - '0x245a394ad1eca9b72fc00ae7be315dc757b3b080d4c158013e6632d3c40659cc6cf90ad1c232a6442d9d3f5db980133', - '0x5c129645e44cf1102a159f748c4a3fc5e673d81d7e86568d9ab0f5d396a7ce46ba1049b6579afb7866b1e715475224b', - '0x15e6be4e990f03ce4ea50b3b42df2eb5cb181d8f84965a3957add4fa95af01b2b665027efec01c7704b456be69c8b604', - ], - // yDen - [ - '0x16112c4c3a9c98b252181140fad0eae9601a6de578980be6eec3232b5be72e7a07f3688ef60c206d01479253b03663c1', - '0x1962d75c2381201e1a0cbd6c43c348b885c84ff731c4d59ca4a10356f453e01f78a4260763529e3532f6102c2e49a03d', - '0x58df3306640da276faaae7d6e8eb15778c4855551ae7f310c35a5dd279cd2eca6757cd636f96f891e2538b53dbf67f2', - '0x16b7d288798e5395f20d23bf89edb4d1d115c5dbddbcd30e123da489e726af41727364f2c28297ada8d26d98445f5416', - '0xbe0e079545f43e4b00cc912f8228ddcc6d19c9f0f69bbb0542eda0fc9dec916a20b15dc0fd2ededda39142311a5001d', - '0x8d9e5297186db2d9fb266eaac783182b70152c65550d881c5ecd87b6f0f5a6449f38db9dfa9cce202c6477faaf9b7ac', - '0x166007c08a99db2fc3ba8734ace9824b5eecfdfa8d0cf8ef5dd365bc400a0051d5fa9c01a58b1fb93d1a1399126a775c', - '0x16a3ef08be3ea7ea03bcddfabba6ff6ee5a4375efa1f4fd7feb34fd206357132b920f5b00801dee460ee415a15812ed9', - '0x1866c8ed336c61231a1be54fd1d74cc4f9fb0ce4c6af5920abc5750c4bf39b4852cfe2f7bb9248836b233d9d55535d4a', - '0x167a55cda70a6e1cea820597d94a84903216f763e13d87bb5308592e7ea7d4fbc7385ea3d529b35e346ef48bb8913f55', - '0x4d2f259eea405bd48f010a01ad2911d9c6dd039bb61a6290e591b36e636a5c871a5c29f4f83060400f8b49cba8f6aa8', - '0xaccbb67481d033ff5852c1e48c50c477f94ff8aefce42d28c0f9a88cea7913516f968986f7ebbea9684b529e2561092', - '0xad6b9514c767fe3c3613144b45f1496543346d98adf02267d5ceef9a00d9b8693000763e3b90ac11e99b138573345cc', - '0x2660400eb2e4f3b628bdd0d53cd76f2bf565b94e72927c1cb748df27942480e420517bd8714cc80d1fadc1326ed06f7', - '0xe0fa1d816ddc03e6b24255e0d7819c171c40f65e273b853324efcd6356caa205ca2f570f13497804415473a1d634b8f', - '0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001', // LAST 1 - ], -].map((i) => i.map((j) => BigInt(j)))); -// Optimized SWU Map - Fp to G1 -const G1_SWU = mapToCurveSimpleSWU(Fp, { - A: Fp.create(BigInt('0x144698a3b8e9433d693a02c96d4982b0ea985383ee66a8d8e8981aefd881ac98936f8da0e0f97f5cf428082d584c1d')), - B: Fp.create(BigInt('0x12e2908d11688030018b12e8753eee3b2016c1f0f24f4070a0b9c14fcef35ef55a23215a316ceaa5d1cc48e98e172be0')), - Z: Fp.create(BigInt(11)), -}); -// SWU Map - Fp2 to G2': y² = x³ + 240i * x + 1012 + 1012i -const G2_SWU = mapToCurveSimpleSWU(Fp2, { - A: Fp2.create({ c0: Fp.create(_0n), c1: Fp.create(BigInt(240)) }), // A' = 240 * I - B: Fp2.create({ c0: Fp.create(BigInt(1012)), c1: Fp.create(BigInt(1012)) }), // B' = 1012 * (1 + I) - Z: Fp2.create({ c0: Fp.create(BigInt(-2)), c1: Fp.create(BigInt(-1)) }), // Z: -(2 + I) -}); -function mapToG1(scalars) { - const { x, y } = G1_SWU(Fp.create(scalars[0])); - return isogenyMapG1(x, y); -} -function mapToG2(scalars) { - const { x, y } = G2_SWU(Fp2.fromBigTuple(scalars)); - return isogenyMapG2(x, y); -} -//# sourceMappingURL=bls12-381.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/bls12-381.js.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/bls12-381.js.map deleted file mode 100644 index 7e92b9cf..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/bls12-381.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bls12-381.js","sourceRoot":"","sources":["../src/bls12-381.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6EG;AACH,sEAAsE;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAgB,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,KAAK,EAAe,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EACL,MAAM,EACN,MAAM,EACN,OAAO,EACP,UAAU,EACV,eAAe,EACf,WAAW,EACX,WAAW,EACX,eAAe,GAEhB,MAAM,YAAY,CAAC;AACpB,QAAQ;AACR,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EACL,mBAAmB,GAKpB,MAAM,2BAA2B,CAAC;AAEnC,qEAAqE;AACrE,kBAAkB;AAClB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAE1F,kBAAkB;AAClB,yEAAyE;AAEzE,kEAAkE;AAClE,+CAA+C;AAC/C,MAAM,KAAK,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC;AAC3C,iDAAiD;AACjD,oBAAoB;AACpB,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AAEhC,WAAW;AACX,yEAAyE;AACzE,+BAA+B;AAC/B,4DAA4D;AAC5D,iDAAiD;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CAAC,EAAE,CAAC,EAAE,sBAAsB;IACnG,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,cAAc;CACxF,CAAC,CAAC;AAEH,SAAS,OAAO,CAAC,OAAiB;IAChC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/C,OAAO,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5B,CAAC;AACD,SAAS,OAAO,CAAC,OAAiB;IAChC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,OAAsB,CAAC,CAAC,CAAC;IAClE,OAAO,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/bn254.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/esm/bn254.d.ts deleted file mode 100644 index 64532275..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/bn254.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { type CurveFn as BLSCurveFn, type PostPrecomputeFn } from './abstract/bls.ts'; -import { type IField } from './abstract/modular.ts'; -import { type CurveFn } from './abstract/weierstrass.ts'; -export declare const bn254_Fr: IField; -export declare const _postPrecompute: PostPrecomputeFn; -/** - * bn254 (a.k.a. alt_bn128) pairing-friendly curve. - * Contains G1 / G2 operations and pairings. - */ -export declare const bn254: BLSCurveFn; -/** - * bn254 weierstrass curve with ECDSA. - * This is very rare and probably not used anywhere. - * Instead, you should use G1 / G2, defined above. - * @deprecated - */ -export declare const bn254_weierstrass: CurveFn; -//# sourceMappingURL=bn254.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/bn254.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/bn254.d.ts.map deleted file mode 100644 index 16a55f87..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/bn254.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bn254.d.ts","sourceRoot":"","sources":["../src/bn254.ts"],"names":[],"mappings":"AAyDA,OAAO,EAEL,KAAK,OAAO,IAAI,UAAU,EAC1B,KAAK,gBAAgB,EAEtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAS,KAAK,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAG3D,OAAO,EAAE,KAAK,OAAO,EAAqC,MAAM,2BAA2B,CAAC;AAsB5F,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,CAA2B,CAAC;AAsDhE,eAAO,MAAM,eAAe,EAAE,gBAY7B,CAAC;AAmBF;;;GAGG;AACH,eAAO,MAAM,KAAK,EAAE,UAgDlB,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,OAS9B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/bn254.js b/tools/mnemonic-test/node_modules/@noble/curves/esm/bn254.js deleted file mode 100644 index 6f14e1ff..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/bn254.js +++ /dev/null @@ -1,214 +0,0 @@ -/** - * bn254, previously known as alt_bn_128, when it had 128-bit security. - -Barbulescu-Duquesne 2017 shown it's weaker: just about 100 bits, -so the naming has been adjusted to its prime bit count: -https://hal.science/hal-01534101/file/main.pdf. -Compatible with EIP-196 and EIP-197. - -There are huge compatibility issues in the ecosystem: - -1. Different libraries call it in different ways: "bn254", "bn256", "alt_bn128", "bn128". -2. libff has bn128, but it's a different curve with different G2: - https://github.com/scipr-lab/libff/blob/a44f482e18b8ac04d034c193bd9d7df7817ad73f/libff/algebra/curves/bn128/bn128_init.cpp#L166-L169 -3. halo2curves bn256 is also incompatible and returns different outputs - -We don't implement Point methods toHex / toBytes. -To work around this limitation, has to initialize points on their own from BigInts. -Reason it's not implemented is because [there is no standard](https://github.com/privacy-scaling-explorations/halo2curves/issues/109). -Points of divergence: - -- Endianness: LE vs BE (byte-swapped) -- Flags as first hex bits (similar to BLS) vs no-flags -- Imaginary part last in G2 vs first (c0, c1 vs c1, c0) - -The goal of our implementation is to support "Ethereum" variant of the curve, -because it at least has specs: - -- EIP196 (https://eips.ethereum.org/EIPS/eip-196) describes bn254 ECADD and ECMUL opcodes for EVM -- EIP197 (https://eips.ethereum.org/EIPS/eip-197) describes bn254 pairings -- It's hard: EIPs don't have proper tests. EIP-197 returns boolean output instead of Fp12 -- The existing implementations are bad. Some are deprecated: - - https://github.com/paritytech/bn (old version) - - https://github.com/ewasm/ethereum-bn128.rs (uses paritytech/bn) - - https://github.com/zcash-hackworks/bn - - https://github.com/arkworks-rs/curves/blob/master/bn254/src/lib.rs -- Python implementations use different towers and produce different Fp12 outputs: - - https://github.com/ethereum/py_pairing - - https://github.com/ethereum/execution-specs/blob/master/src/ethereum/crypto/alt_bn128.py -- Points are encoded differently in different implementations - -### Params -Seed (X): 4965661367192848881 -Fr: (36x⁴+36x³+18x²+6x+1) -Fp: (36x⁴+36x³+24x²+6x+1) -(E / Fp ): Y² = X³+3 -(Et / Fp²): Y² = X³+3/(u+9) (D-type twist) -Ate loop size: 6x+2 - -### Towers -- Fp²[u] = Fp/u²+1 -- Fp⁶[v] = Fp²/v³-9-u -- Fp¹²[w] = Fp⁶/w²-v - - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { sha256 } from '@noble/hashes/sha2.js'; -import { bls, } from "./abstract/bls.js"; -import { Field } from "./abstract/modular.js"; -import { psiFrobenius, tower12 } from "./abstract/tower.js"; -import { weierstrass } from "./abstract/weierstrass.js"; -import { bitLen, notImplemented } from "./utils.js"; -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3); -const _6n = BigInt(6); -const BN_X = BigInt('4965661367192848881'); -const BN_X_LEN = bitLen(BN_X); -const SIX_X_SQUARED = _6n * BN_X ** _2n; -const bn254_G1_CURVE = { - p: BigInt('0x30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47'), - n: BigInt('0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001'), - h: _1n, - a: _0n, - b: _3n, - Gx: _1n, - Gy: BigInt(2), -}; -// r == n -// Finite field over r. It's for convenience and is not used in the code below. -export const bn254_Fr = Field(bn254_G1_CURVE.n); -// Fp2.div(Fp2.mul(Fp2.ONE, _3n), Fp2.NONRESIDUE) -const Fp2B = { - c0: BigInt('19485874751759354771024239261021720505790618469301721065564631296452457478373'), - c1: BigInt('266929791119991161246907387137283842545076965332900288569378510910307636690'), -}; -const { Fp, Fp2, Fp6, Fp12 } = tower12({ - ORDER: bn254_G1_CURVE.p, - X_LEN: BN_X_LEN, - FP2_NONRESIDUE: [BigInt(9), _1n], - Fp2mulByB: (num) => Fp2.mul(num, Fp2B), - Fp12finalExponentiate: (num) => { - const powMinusX = (num) => Fp12.conjugate(Fp12._cyclotomicExp(num, BN_X)); - const r0 = Fp12.mul(Fp12.conjugate(num), Fp12.inv(num)); - const r = Fp12.mul(Fp12.frobeniusMap(r0, 2), r0); - const y1 = Fp12._cyclotomicSquare(powMinusX(r)); - const y2 = Fp12.mul(Fp12._cyclotomicSquare(y1), y1); - const y4 = powMinusX(y2); - const y6 = powMinusX(Fp12._cyclotomicSquare(y4)); - const y8 = Fp12.mul(Fp12.mul(Fp12.conjugate(y6), y4), Fp12.conjugate(y2)); - const y9 = Fp12.mul(y8, y1); - return Fp12.mul(Fp12.frobeniusMap(Fp12.mul(Fp12.conjugate(r), y9), 3), Fp12.mul(Fp12.frobeniusMap(y8, 2), Fp12.mul(Fp12.frobeniusMap(y9, 1), Fp12.mul(Fp12.mul(y8, y4), r)))); - }, -}); -// END OF CURVE FIELDS -const { G2psi, psi } = psiFrobenius(Fp, Fp2, Fp2.NONRESIDUE); -/* -No hashToCurve for now (and signatures): - -- RFC 9380 doesn't mention bn254 and doesn't provide test vectors -- Overall seems like nobody is using BLS signatures on top of bn254 -- Seems like it can utilize SVDW, which is not implemented yet -*/ -const htfDefaults = Object.freeze({ - // DST: a domain separation tag defined in section 2.2.5 - DST: 'BN254G2_XMD:SHA-256_SVDW_RO_', - encodeDST: 'BN254G2_XMD:SHA-256_SVDW_RO_', - p: Fp.ORDER, - m: 2, - k: 128, - expand: 'xmd', - hash: sha256, -}); -export const _postPrecompute = (Rx, Ry, Rz, Qx, Qy, pointAdd) => { - const q = psi(Qx, Qy); - ({ Rx, Ry, Rz } = pointAdd(Rx, Ry, Rz, q[0], q[1])); - const q2 = psi(q[0], q[1]); - pointAdd(Rx, Ry, Rz, q2[0], Fp2.neg(q2[1])); -}; -// cofactor: (36 * X^4) + (36 * X^3) + (30 * X^2) + 6*X + 1 -const bn254_G2_CURVE = { - p: Fp2.ORDER, - n: bn254_G1_CURVE.n, - h: BigInt('0x30644e72e131a029b85045b68181585e06ceecda572a2489345f2299c0f9fa8d'), - a: Fp2.ZERO, - b: Fp2B, - Gx: Fp2.fromBigTuple([ - BigInt('10857046999023057135944570762232829481370756359578518086990519993285655852781'), - BigInt('11559732032986387107991004021392285783925812861821192530917403151452391805634'), - ]), - Gy: Fp2.fromBigTuple([ - BigInt('8495653923123431417604973247489272438418190587263600148770280649306958101930'), - BigInt('4082367875863433681332203403145435568316851327593401208105741076214120093531'), - ]), -}; -/** - * bn254 (a.k.a. alt_bn128) pairing-friendly curve. - * Contains G1 / G2 operations and pairings. - */ -export const bn254 = bls({ - // Fields - fields: { Fp, Fp2, Fp6, Fp12, Fr: bn254_Fr }, - G1: { - ...bn254_G1_CURVE, - Fp, - htfDefaults: { ...htfDefaults, m: 1, DST: 'BN254G2_XMD:SHA-256_SVDW_RO_' }, - wrapPrivateKey: true, - allowInfinityPoint: true, - mapToCurve: notImplemented, - fromBytes: notImplemented, - toBytes: notImplemented, - ShortSignature: { - fromBytes: notImplemented, - fromHex: notImplemented, - toBytes: notImplemented, - toRawBytes: notImplemented, - toHex: notImplemented, - }, - }, - G2: { - ...bn254_G2_CURVE, - Fp: Fp2, - hEff: BigInt('21888242871839275222246405745257275088844257914179612981679871602714643921549'), - htfDefaults: { ...htfDefaults }, - wrapPrivateKey: true, - allowInfinityPoint: true, - isTorsionFree: (c, P) => P.multiplyUnsafe(SIX_X_SQUARED).equals(G2psi(c, P)), // [p]P = [6X^2]P - mapToCurve: notImplemented, - fromBytes: notImplemented, - toBytes: notImplemented, - Signature: { - fromBytes: notImplemented, - fromHex: notImplemented, - toBytes: notImplemented, - toRawBytes: notImplemented, - toHex: notImplemented, - }, - }, - params: { - ateLoopSize: BN_X * _6n + _2n, - r: bn254_Fr.ORDER, - xNegative: false, - twistType: 'divisive', - }, - htfDefaults, - hash: sha256, - postPrecompute: _postPrecompute, -}); -/** - * bn254 weierstrass curve with ECDSA. - * This is very rare and probably not used anywhere. - * Instead, you should use G1 / G2, defined above. - * @deprecated - */ -export const bn254_weierstrass = weierstrass({ - a: BigInt(0), - b: BigInt(3), - Fp, - n: BigInt('21888242871839275222246405745257275088548364400416034343698204186575808495617'), - Gx: BigInt(1), - Gy: BigInt(2), - h: BigInt(1), - hash: sha256, -}); -//# sourceMappingURL=bn254.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/bn254.js.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/bn254.js.map deleted file mode 100644 index 4a037fc0..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/bn254.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bn254.js","sourceRoot":"","sources":["../src/bn254.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;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AC;IACZ,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,EAAE;IACF,CAAC,EAAE,MAAM,CAAC,+EAA+E,CAAC;IAC1F,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;IACb,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;IACb,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,IAAI,EAAE,MAAM;CACb,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/ed25519.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/esm/ed25519.d.ts deleted file mode 100644 index 234f8c9f..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/ed25519.d.ts +++ /dev/null @@ -1,106 +0,0 @@ -import { type AffinePoint } from './abstract/curve.ts'; -import { PrimeEdwardsPoint, type CurveFn, type EdwardsPoint } from './abstract/edwards.ts'; -import { type H2CHasher, type H2CHasherBase, type H2CMethod, type htfBasicOpts } from './abstract/hash-to-curve.ts'; -import { type IField } from './abstract/modular.ts'; -import { type MontgomeryECDH as XCurveFn } from './abstract/montgomery.ts'; -import { type Hex } from './utils.ts'; -/** - * ed25519 curve with EdDSA signatures. - * @example - * import { ed25519 } from '@noble/curves/ed25519'; - * const { secretKey, publicKey } = ed25519.keygen(); - * const msg = new TextEncoder().encode('hello'); - * const sig = ed25519.sign(msg, priv); - * ed25519.verify(sig, msg, pub); // Default mode: follows ZIP215 - * ed25519.verify(sig, msg, pub, { zip215: false }); // RFC8032 / FIPS 186-5 - */ -export declare const ed25519: CurveFn; -/** Context of ed25519. Uses context for domain separation. */ -export declare const ed25519ctx: CurveFn; -/** Prehashed version of ed25519. Accepts already-hashed messages in sign() and verify(). */ -export declare const ed25519ph: CurveFn; -/** - * ECDH using curve25519 aka x25519. - * @example - * import { x25519 } from '@noble/curves/ed25519'; - * const priv = 'a546e36bf0527c9d3b16154b82465edd62144c0ac1fc5a18506a2244ba449ac4'; - * const pub = 'e6db6867583030db3594c1a424b15f7c726624ec26b3353b10a903a6d0ab1c4c'; - * x25519.getSharedSecret(priv, pub) === x25519.scalarMult(priv, pub); // aliases - * x25519.getPublicKey(priv) === x25519.scalarMultBase(priv); - * x25519.getPublicKey(x25519.utils.randomSecretKey()); - */ -export declare const x25519: XCurveFn; -/** Hashing to ed25519 points / field. RFC 9380 methods. */ -export declare const ed25519_hasher: H2CHasher; -type ExtendedPoint = EdwardsPoint; -/** - * Wrapper over Edwards Point for ristretto255. - * - * Each ed25519/ExtendedPoint has 8 different equivalent points. This can be - * a source of bugs for protocols like ring signatures. Ristretto was created to solve this. - * Ristretto point operates in X:Y:Z:T extended coordinates like ExtendedPoint, - * but it should work in its own namespace: do not combine those two. - * See [RFC9496](https://www.rfc-editor.org/rfc/rfc9496). - */ -declare class _RistrettoPoint extends PrimeEdwardsPoint<_RistrettoPoint> { - static BASE: _RistrettoPoint; - static ZERO: _RistrettoPoint; - static Fp: IField; - static Fn: IField; - constructor(ep: ExtendedPoint); - static fromAffine(ap: AffinePoint): _RistrettoPoint; - protected assertSame(other: _RistrettoPoint): void; - protected init(ep: EdwardsPoint): _RistrettoPoint; - /** @deprecated use `import { ristretto255_hasher } from '@noble/curves/ed25519.js';` */ - static hashToCurve(hex: Hex): _RistrettoPoint; - static fromBytes(bytes: Uint8Array): _RistrettoPoint; - /** - * Converts ristretto-encoded string to ristretto point. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-decode). - * @param hex Ristretto-encoded 32 bytes. Not every 32-byte string is valid ristretto encoding - */ - static fromHex(hex: Hex): _RistrettoPoint; - static msm(points: _RistrettoPoint[], scalars: bigint[]): _RistrettoPoint; - /** - * Encodes ristretto point to Uint8Array. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-encode). - */ - toBytes(): Uint8Array; - /** - * Compares two Ristretto points. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-equals). - */ - equals(other: _RistrettoPoint): boolean; - is0(): boolean; -} -export declare const ristretto255: { - Point: typeof _RistrettoPoint; -}; -/** Hashing to ristretto255 points / field. RFC 9380 methods. */ -export declare const ristretto255_hasher: H2CHasherBase; -/** - * Weird / bogus points, useful for debugging. - * All 8 ed25519 points of 8-torsion subgroup can be generated from the point - * T = `26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05`. - * ⟨T⟩ = { O, T, 2T, 3T, 4T, 5T, 6T, 7T } - */ -export declare const ED25519_TORSION_SUBGROUP: string[]; -/** @deprecated use `ed25519.utils.toMontgomery` */ -export declare function edwardsToMontgomeryPub(edwardsPub: Hex): Uint8Array; -/** @deprecated use `ed25519.utils.toMontgomery` */ -export declare const edwardsToMontgomery: typeof edwardsToMontgomeryPub; -/** @deprecated use `ed25519.utils.toMontgomerySecret` */ -export declare function edwardsToMontgomeryPriv(edwardsPriv: Uint8Array): Uint8Array; -/** @deprecated use `ristretto255.Point` */ -export declare const RistrettoPoint: typeof _RistrettoPoint; -/** @deprecated use `import { ed25519_hasher } from '@noble/curves/ed25519.js';` */ -export declare const hashToCurve: H2CMethod; -/** @deprecated use `import { ed25519_hasher } from '@noble/curves/ed25519.js';` */ -export declare const encodeToCurve: H2CMethod; -type RistHasher = (msg: Uint8Array, options: htfBasicOpts) => _RistrettoPoint; -/** @deprecated use `import { ristretto255_hasher } from '@noble/curves/ed25519.js';` */ -export declare const hashToRistretto255: RistHasher; -/** @deprecated use `import { ristretto255_hasher } from '@noble/curves/ed25519.js';` */ -export declare const hash_to_ristretto255: RistHasher; -export {}; -//# sourceMappingURL=ed25519.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/ed25519.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/ed25519.d.ts.map deleted file mode 100644 index f9f19ef5..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/ed25519.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed25519.d.ts","sourceRoot":"","sources":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AAG,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,KAAK,eAAe,CAAC;AAC9E,wFAAwF;AACxF,eAAO,MAAM,kBAAkB,EAAE,UACiB,CAAC;AACnD,wFAAwF;AACxF,eAAO,MAAM,oBAAoB,EAAE,UACe,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/ed25519.js b/tools/mnemonic-test/node_modules/@noble/curves/esm/ed25519.js deleted file mode 100644 index 0f2c3acf..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/ed25519.js +++ /dev/null @@ -1,467 +0,0 @@ -/** - * ed25519 Twisted Edwards curve with following addons: - * - X25519 ECDH - * - Ristretto cofactor elimination - * - Elligator hash-to-group / point indistinguishability - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { sha512 } from '@noble/hashes/sha2.js'; -import { abytes, concatBytes, utf8ToBytes } from '@noble/hashes/utils.js'; -import { pippenger } from "./abstract/curve.js"; -import { PrimeEdwardsPoint, twistedEdwards, } from "./abstract/edwards.js"; -import { _DST_scalar, createHasher, expand_message_xmd, } from "./abstract/hash-to-curve.js"; -import { Field, FpInvertBatch, FpSqrtEven, isNegativeLE, mod, pow2, } from "./abstract/modular.js"; -import { montgomery } from "./abstract/montgomery.js"; -import { bytesToNumberLE, ensureBytes, equalBytes } from "./utils.js"; -// prettier-ignore -const _0n = /* @__PURE__ */ BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3); -// prettier-ignore -const _5n = BigInt(5), _8n = BigInt(8); -// P = 2n**255n-19n -const ed25519_CURVE_p = BigInt('0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed'); -// N = 2n**252n + 27742317777372353535851937790883648493n -// a = Fp.create(BigInt(-1)) -// d = -121665/121666 a.k.a. Fp.neg(121665 * Fp.inv(121666)) -const ed25519_CURVE = /* @__PURE__ */ (() => ({ - p: ed25519_CURVE_p, - n: BigInt('0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed'), - h: _8n, - a: BigInt('0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec'), - d: BigInt('0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3'), - Gx: BigInt('0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a'), - Gy: BigInt('0x6666666666666666666666666666666666666666666666666666666666666658'), -}))(); -function ed25519_pow_2_252_3(x) { - // prettier-ignore - const _10n = BigInt(10), _20n = BigInt(20), _40n = BigInt(40), _80n = BigInt(80); - const P = ed25519_CURVE_p; - const x2 = (x * x) % P; - const b2 = (x2 * x) % P; // x^3, 11 - const b4 = (pow2(b2, _2n, P) * b2) % P; // x^15, 1111 - const b5 = (pow2(b4, _1n, P) * x) % P; // x^31 - const b10 = (pow2(b5, _5n, P) * b5) % P; - const b20 = (pow2(b10, _10n, P) * b10) % P; - const b40 = (pow2(b20, _20n, P) * b20) % P; - const b80 = (pow2(b40, _40n, P) * b40) % P; - const b160 = (pow2(b80, _80n, P) * b80) % P; - const b240 = (pow2(b160, _80n, P) * b80) % P; - const b250 = (pow2(b240, _10n, P) * b10) % P; - const pow_p_5_8 = (pow2(b250, _2n, P) * x) % P; - // ^ To pow to (p+3)/8, multiply it by x. - return { pow_p_5_8, b2 }; -} -function adjustScalarBytes(bytes) { - // Section 5: For X25519, in order to decode 32 random bytes as an integer scalar, - // set the three least significant bits of the first byte - bytes[0] &= 248; // 0b1111_1000 - // and the most significant bit of the last to zero, - bytes[31] &= 127; // 0b0111_1111 - // set the second most significant bit of the last byte to 1 - bytes[31] |= 64; // 0b0100_0000 - return bytes; -} -// √(-1) aka √(a) aka 2^((p-1)/4) -// Fp.sqrt(Fp.neg(1)) -const ED25519_SQRT_M1 = /* @__PURE__ */ BigInt('19681161376707505956807079304988542015446066515923890162744021073123829784752'); -// sqrt(u/v) -function uvRatio(u, v) { - const P = ed25519_CURVE_p; - const v3 = mod(v * v * v, P); // v³ - const v7 = mod(v3 * v3 * v, P); // v⁷ - // (p+3)/8 and (p-5)/8 - const pow = ed25519_pow_2_252_3(u * v7).pow_p_5_8; - let x = mod(u * v3 * pow, P); // (uv³)(uv⁷)^(p-5)/8 - const vx2 = mod(v * x * x, P); // vx² - const root1 = x; // First root candidate - const root2 = mod(x * ED25519_SQRT_M1, P); // Second root candidate - const useRoot1 = vx2 === u; // If vx² = u (mod p), x is a square root - const useRoot2 = vx2 === mod(-u, P); // If vx² = -u, set x <-- x * 2^((p-1)/4) - const noRoot = vx2 === mod(-u * ED25519_SQRT_M1, P); // There is no valid root, vx² = -u√(-1) - if (useRoot1) - x = root1; - if (useRoot2 || noRoot) - x = root2; // We return root2 anyway, for const-time - if (isNegativeLE(x, P)) - x = mod(-x, P); - return { isValid: useRoot1 || useRoot2, value: x }; -} -const Fp = /* @__PURE__ */ (() => Field(ed25519_CURVE.p, { isLE: true }))(); -const Fn = /* @__PURE__ */ (() => Field(ed25519_CURVE.n, { isLE: true }))(); -const ed25519Defaults = /* @__PURE__ */ (() => ({ - ...ed25519_CURVE, - Fp, - hash: sha512, - adjustScalarBytes, - // dom2 - // Ratio of u to v. Allows us to combine inversion and square root. Uses algo from RFC8032 5.1.3. - // Constant-time, u/√v - uvRatio, -}))(); -/** - * ed25519 curve with EdDSA signatures. - * @example - * import { ed25519 } from '@noble/curves/ed25519'; - * const { secretKey, publicKey } = ed25519.keygen(); - * const msg = new TextEncoder().encode('hello'); - * const sig = ed25519.sign(msg, priv); - * ed25519.verify(sig, msg, pub); // Default mode: follows ZIP215 - * ed25519.verify(sig, msg, pub, { zip215: false }); // RFC8032 / FIPS 186-5 - */ -export const ed25519 = /* @__PURE__ */ (() => twistedEdwards(ed25519Defaults))(); -function ed25519_domain(data, ctx, phflag) { - if (ctx.length > 255) - throw new Error('Context is too big'); - return concatBytes(utf8ToBytes('SigEd25519 no Ed25519 collisions'), new Uint8Array([phflag ? 1 : 0, ctx.length]), ctx, data); -} -/** Context of ed25519. Uses context for domain separation. */ -export const ed25519ctx = /* @__PURE__ */ (() => twistedEdwards({ - ...ed25519Defaults, - domain: ed25519_domain, -}))(); -/** Prehashed version of ed25519. Accepts already-hashed messages in sign() and verify(). */ -export const ed25519ph = /* @__PURE__ */ (() => twistedEdwards(Object.assign({}, ed25519Defaults, { - domain: ed25519_domain, - prehash: sha512, -})))(); -/** - * ECDH using curve25519 aka x25519. - * @example - * import { x25519 } from '@noble/curves/ed25519'; - * const priv = 'a546e36bf0527c9d3b16154b82465edd62144c0ac1fc5a18506a2244ba449ac4'; - * const pub = 'e6db6867583030db3594c1a424b15f7c726624ec26b3353b10a903a6d0ab1c4c'; - * x25519.getSharedSecret(priv, pub) === x25519.scalarMult(priv, pub); // aliases - * x25519.getPublicKey(priv) === x25519.scalarMultBase(priv); - * x25519.getPublicKey(x25519.utils.randomSecretKey()); - */ -export const x25519 = /* @__PURE__ */ (() => { - const P = Fp.ORDER; - return montgomery({ - P, - type: 'x25519', - powPminus2: (x) => { - // x^(p-2) aka x^(2^255-21) - const { pow_p_5_8, b2 } = ed25519_pow_2_252_3(x); - return mod(pow2(pow_p_5_8, _3n, P) * b2, P); - }, - adjustScalarBytes, - }); -})(); -// Hash To Curve Elligator2 Map (NOTE: different from ristretto255 elligator) -// NOTE: very important part is usage of FpSqrtEven for ELL2_C1_EDWARDS, since -// SageMath returns different root first and everything falls apart -const ELL2_C1 = /* @__PURE__ */ (() => (ed25519_CURVE_p + _3n) / _8n)(); // 1. c1 = (q + 3) / 8 # Integer arithmetic -const ELL2_C2 = /* @__PURE__ */ (() => Fp.pow(_2n, ELL2_C1))(); // 2. c2 = 2^c1 -const ELL2_C3 = /* @__PURE__ */ (() => Fp.sqrt(Fp.neg(Fp.ONE)))(); // 3. c3 = sqrt(-1) -// prettier-ignore -function map_to_curve_elligator2_curve25519(u) { - const ELL2_C4 = (ed25519_CURVE_p - _5n) / _8n; // 4. c4 = (q - 5) / 8 # Integer arithmetic - const ELL2_J = BigInt(486662); - let tv1 = Fp.sqr(u); // 1. tv1 = u^2 - tv1 = Fp.mul(tv1, _2n); // 2. tv1 = 2 * tv1 - let xd = Fp.add(tv1, Fp.ONE); // 3. xd = tv1 + 1 # Nonzero: -1 is square (mod p), tv1 is not - let x1n = Fp.neg(ELL2_J); // 4. x1n = -J # x1 = x1n / xd = -J / (1 + 2 * u^2) - let tv2 = Fp.sqr(xd); // 5. tv2 = xd^2 - let gxd = Fp.mul(tv2, xd); // 6. gxd = tv2 * xd # gxd = xd^3 - let gx1 = Fp.mul(tv1, ELL2_J); // 7. gx1 = J * tv1 # x1n + J * xd - gx1 = Fp.mul(gx1, x1n); // 8. gx1 = gx1 * x1n # x1n^2 + J * x1n * xd - gx1 = Fp.add(gx1, tv2); // 9. gx1 = gx1 + tv2 # x1n^2 + J * x1n * xd + xd^2 - gx1 = Fp.mul(gx1, x1n); // 10. gx1 = gx1 * x1n # x1n^3 + J * x1n^2 * xd + x1n * xd^2 - let tv3 = Fp.sqr(gxd); // 11. tv3 = gxd^2 - tv2 = Fp.sqr(tv3); // 12. tv2 = tv3^2 # gxd^4 - tv3 = Fp.mul(tv3, gxd); // 13. tv3 = tv3 * gxd # gxd^3 - tv3 = Fp.mul(tv3, gx1); // 14. tv3 = tv3 * gx1 # gx1 * gxd^3 - tv2 = Fp.mul(tv2, tv3); // 15. tv2 = tv2 * tv3 # gx1 * gxd^7 - let y11 = Fp.pow(tv2, ELL2_C4); // 16. y11 = tv2^c4 # (gx1 * gxd^7)^((p - 5) / 8) - y11 = Fp.mul(y11, tv3); // 17. y11 = y11 * tv3 # gx1*gxd^3*(gx1*gxd^7)^((p-5)/8) - let y12 = Fp.mul(y11, ELL2_C3); // 18. y12 = y11 * c3 - tv2 = Fp.sqr(y11); // 19. tv2 = y11^2 - tv2 = Fp.mul(tv2, gxd); // 20. tv2 = tv2 * gxd - let e1 = Fp.eql(tv2, gx1); // 21. e1 = tv2 == gx1 - let y1 = Fp.cmov(y12, y11, e1); // 22. y1 = CMOV(y12, y11, e1) # If g(x1) is square, this is its sqrt - let x2n = Fp.mul(x1n, tv1); // 23. x2n = x1n * tv1 # x2 = x2n / xd = 2 * u^2 * x1n / xd - let y21 = Fp.mul(y11, u); // 24. y21 = y11 * u - y21 = Fp.mul(y21, ELL2_C2); // 25. y21 = y21 * c2 - let y22 = Fp.mul(y21, ELL2_C3); // 26. y22 = y21 * c3 - let gx2 = Fp.mul(gx1, tv1); // 27. gx2 = gx1 * tv1 # g(x2) = gx2 / gxd = 2 * u^2 * g(x1) - tv2 = Fp.sqr(y21); // 28. tv2 = y21^2 - tv2 = Fp.mul(tv2, gxd); // 29. tv2 = tv2 * gxd - let e2 = Fp.eql(tv2, gx2); // 30. e2 = tv2 == gx2 - let y2 = Fp.cmov(y22, y21, e2); // 31. y2 = CMOV(y22, y21, e2) # If g(x2) is square, this is its sqrt - tv2 = Fp.sqr(y1); // 32. tv2 = y1^2 - tv2 = Fp.mul(tv2, gxd); // 33. tv2 = tv2 * gxd - let e3 = Fp.eql(tv2, gx1); // 34. e3 = tv2 == gx1 - let xn = Fp.cmov(x2n, x1n, e3); // 35. xn = CMOV(x2n, x1n, e3) # If e3, x = x1, else x = x2 - let y = Fp.cmov(y2, y1, e3); // 36. y = CMOV(y2, y1, e3) # If e3, y = y1, else y = y2 - let e4 = Fp.isOdd(y); // 37. e4 = sgn0(y) == 1 # Fix sign of y - y = Fp.cmov(y, Fp.neg(y), e3 !== e4); // 38. y = CMOV(y, -y, e3 XOR e4) - return { xMn: xn, xMd: xd, yMn: y, yMd: _1n }; // 39. return (xn, xd, y, 1) -} -const ELL2_C1_EDWARDS = /* @__PURE__ */ (() => FpSqrtEven(Fp, Fp.neg(BigInt(486664))))(); // sgn0(c1) MUST equal 0 -function map_to_curve_elligator2_edwards25519(u) { - const { xMn, xMd, yMn, yMd } = map_to_curve_elligator2_curve25519(u); // 1. (xMn, xMd, yMn, yMd) = - // map_to_curve_elligator2_curve25519(u) - let xn = Fp.mul(xMn, yMd); // 2. xn = xMn * yMd - xn = Fp.mul(xn, ELL2_C1_EDWARDS); // 3. xn = xn * c1 - let xd = Fp.mul(xMd, yMn); // 4. xd = xMd * yMn # xn / xd = c1 * xM / yM - let yn = Fp.sub(xMn, xMd); // 5. yn = xMn - xMd - let yd = Fp.add(xMn, xMd); // 6. yd = xMn + xMd # (n / d - 1) / (n / d + 1) = (n - d) / (n + d) - let tv1 = Fp.mul(xd, yd); // 7. tv1 = xd * yd - let e = Fp.eql(tv1, Fp.ZERO); // 8. e = tv1 == 0 - xn = Fp.cmov(xn, Fp.ZERO, e); // 9. xn = CMOV(xn, 0, e) - xd = Fp.cmov(xd, Fp.ONE, e); // 10. xd = CMOV(xd, 1, e) - yn = Fp.cmov(yn, Fp.ONE, e); // 11. yn = CMOV(yn, 1, e) - yd = Fp.cmov(yd, Fp.ONE, e); // 12. yd = CMOV(yd, 1, e) - const [xd_inv, yd_inv] = FpInvertBatch(Fp, [xd, yd], true); // batch division - return { x: Fp.mul(xn, xd_inv), y: Fp.mul(yn, yd_inv) }; // 13. return (xn, xd, yn, yd) -} -/** Hashing to ed25519 points / field. RFC 9380 methods. */ -export const ed25519_hasher = /* @__PURE__ */ (() => createHasher(ed25519.Point, (scalars) => map_to_curve_elligator2_edwards25519(scalars[0]), { - DST: 'edwards25519_XMD:SHA-512_ELL2_RO_', - encodeDST: 'edwards25519_XMD:SHA-512_ELL2_NU_', - p: ed25519_CURVE_p, - m: 1, - k: 128, - expand: 'xmd', - hash: sha512, -}))(); -// √(-1) aka √(a) aka 2^((p-1)/4) -const SQRT_M1 = ED25519_SQRT_M1; -// √(ad - 1) -const SQRT_AD_MINUS_ONE = /* @__PURE__ */ BigInt('25063068953384623474111414158702152701244531502492656460079210482610430750235'); -// 1 / √(a-d) -const INVSQRT_A_MINUS_D = /* @__PURE__ */ BigInt('54469307008909316920995813868745141605393597292927456921205312896311721017578'); -// 1-d² -const ONE_MINUS_D_SQ = /* @__PURE__ */ BigInt('1159843021668779879193775521855586647937357759715417654439879720876111806838'); -// (d-1)² -const D_MINUS_ONE_SQ = /* @__PURE__ */ BigInt('40440834346308536858101042469323190826248399146238708352240133220865137265952'); -// Calculates 1/√(number) -const invertSqrt = (number) => uvRatio(_1n, number); -const MAX_255B = /* @__PURE__ */ BigInt('0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'); -const bytes255ToNumberLE = (bytes) => ed25519.Point.Fp.create(bytesToNumberLE(bytes) & MAX_255B); -/** - * Computes Elligator map for Ristretto255. - * Described in [RFC9380](https://www.rfc-editor.org/rfc/rfc9380#appendix-B) and on - * the [website](https://ristretto.group/formulas/elligator.html). - */ -function calcElligatorRistrettoMap(r0) { - const { d } = ed25519_CURVE; - const P = ed25519_CURVE_p; - const mod = (n) => Fp.create(n); - const r = mod(SQRT_M1 * r0 * r0); // 1 - const Ns = mod((r + _1n) * ONE_MINUS_D_SQ); // 2 - let c = BigInt(-1); // 3 - const D = mod((c - d * r) * mod(r + d)); // 4 - let { isValid: Ns_D_is_sq, value: s } = uvRatio(Ns, D); // 5 - let s_ = mod(s * r0); // 6 - if (!isNegativeLE(s_, P)) - s_ = mod(-s_); - if (!Ns_D_is_sq) - s = s_; // 7 - if (!Ns_D_is_sq) - c = r; // 8 - const Nt = mod(c * (r - _1n) * D_MINUS_ONE_SQ - D); // 9 - const s2 = s * s; - const W0 = mod((s + s) * D); // 10 - const W1 = mod(Nt * SQRT_AD_MINUS_ONE); // 11 - const W2 = mod(_1n - s2); // 12 - const W3 = mod(_1n + s2); // 13 - return new ed25519.Point(mod(W0 * W3), mod(W2 * W1), mod(W1 * W3), mod(W0 * W2)); -} -function ristretto255_map(bytes) { - abytes(bytes, 64); - const r1 = bytes255ToNumberLE(bytes.subarray(0, 32)); - const R1 = calcElligatorRistrettoMap(r1); - const r2 = bytes255ToNumberLE(bytes.subarray(32, 64)); - const R2 = calcElligatorRistrettoMap(r2); - return new _RistrettoPoint(R1.add(R2)); -} -/** - * Wrapper over Edwards Point for ristretto255. - * - * Each ed25519/ExtendedPoint has 8 different equivalent points. This can be - * a source of bugs for protocols like ring signatures. Ristretto was created to solve this. - * Ristretto point operates in X:Y:Z:T extended coordinates like ExtendedPoint, - * but it should work in its own namespace: do not combine those two. - * See [RFC9496](https://www.rfc-editor.org/rfc/rfc9496). - */ -class _RistrettoPoint extends PrimeEdwardsPoint { - constructor(ep) { - super(ep); - } - static fromAffine(ap) { - return new _RistrettoPoint(ed25519.Point.fromAffine(ap)); - } - assertSame(other) { - if (!(other instanceof _RistrettoPoint)) - throw new Error('RistrettoPoint expected'); - } - init(ep) { - return new _RistrettoPoint(ep); - } - /** @deprecated use `import { ristretto255_hasher } from '@noble/curves/ed25519.js';` */ - static hashToCurve(hex) { - return ristretto255_map(ensureBytes('ristrettoHash', hex, 64)); - } - static fromBytes(bytes) { - abytes(bytes, 32); - const { a, d } = ed25519_CURVE; - const P = ed25519_CURVE_p; - const mod = (n) => Fp.create(n); - const s = bytes255ToNumberLE(bytes); - // 1. Check that s_bytes is the canonical encoding of a field element, or else abort. - // 3. Check that s is non-negative, or else abort - if (!equalBytes(Fp.toBytes(s), bytes) || isNegativeLE(s, P)) - throw new Error('invalid ristretto255 encoding 1'); - const s2 = mod(s * s); - const u1 = mod(_1n + a * s2); // 4 (a is -1) - const u2 = mod(_1n - a * s2); // 5 - const u1_2 = mod(u1 * u1); - const u2_2 = mod(u2 * u2); - const v = mod(a * d * u1_2 - u2_2); // 6 - const { isValid, value: I } = invertSqrt(mod(v * u2_2)); // 7 - const Dx = mod(I * u2); // 8 - const Dy = mod(I * Dx * v); // 9 - let x = mod((s + s) * Dx); // 10 - if (isNegativeLE(x, P)) - x = mod(-x); // 10 - const y = mod(u1 * Dy); // 11 - const t = mod(x * y); // 12 - if (!isValid || isNegativeLE(t, P) || y === _0n) - throw new Error('invalid ristretto255 encoding 2'); - return new _RistrettoPoint(new ed25519.Point(x, y, _1n, t)); - } - /** - * Converts ristretto-encoded string to ristretto point. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-decode). - * @param hex Ristretto-encoded 32 bytes. Not every 32-byte string is valid ristretto encoding - */ - static fromHex(hex) { - return _RistrettoPoint.fromBytes(ensureBytes('ristrettoHex', hex, 32)); - } - static msm(points, scalars) { - return pippenger(_RistrettoPoint, ed25519.Point.Fn, points, scalars); - } - /** - * Encodes ristretto point to Uint8Array. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-encode). - */ - toBytes() { - let { X, Y, Z, T } = this.ep; - const P = ed25519_CURVE_p; - const mod = (n) => Fp.create(n); - const u1 = mod(mod(Z + Y) * mod(Z - Y)); // 1 - const u2 = mod(X * Y); // 2 - // Square root always exists - const u2sq = mod(u2 * u2); - const { value: invsqrt } = invertSqrt(mod(u1 * u2sq)); // 3 - const D1 = mod(invsqrt * u1); // 4 - const D2 = mod(invsqrt * u2); // 5 - const zInv = mod(D1 * D2 * T); // 6 - let D; // 7 - if (isNegativeLE(T * zInv, P)) { - let _x = mod(Y * SQRT_M1); - let _y = mod(X * SQRT_M1); - X = _x; - Y = _y; - D = mod(D1 * INVSQRT_A_MINUS_D); - } - else { - D = D2; // 8 - } - if (isNegativeLE(X * zInv, P)) - Y = mod(-Y); // 9 - let s = mod((Z - Y) * D); // 10 (check footer's note, no sqrt(-a)) - if (isNegativeLE(s, P)) - s = mod(-s); - return Fp.toBytes(s); // 11 - } - /** - * Compares two Ristretto points. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-equals). - */ - equals(other) { - this.assertSame(other); - const { X: X1, Y: Y1 } = this.ep; - const { X: X2, Y: Y2 } = other.ep; - const mod = (n) => Fp.create(n); - // (x1 * y2 == y1 * x2) | (y1 * y2 == x1 * x2) - const one = mod(X1 * Y2) === mod(Y1 * X2); - const two = mod(Y1 * Y2) === mod(X1 * X2); - return one || two; - } - is0() { - return this.equals(_RistrettoPoint.ZERO); - } -} -// Do NOT change syntax: the following gymnastics is done, -// because typescript strips comments, which makes bundlers disable tree-shaking. -// prettier-ignore -_RistrettoPoint.BASE = -/* @__PURE__ */ (() => new _RistrettoPoint(ed25519.Point.BASE))(); -// prettier-ignore -_RistrettoPoint.ZERO = -/* @__PURE__ */ (() => new _RistrettoPoint(ed25519.Point.ZERO))(); -// prettier-ignore -_RistrettoPoint.Fp = -/* @__PURE__ */ (() => Fp)(); -// prettier-ignore -_RistrettoPoint.Fn = -/* @__PURE__ */ (() => Fn)(); -export const ristretto255 = { Point: _RistrettoPoint }; -/** Hashing to ristretto255 points / field. RFC 9380 methods. */ -export const ristretto255_hasher = { - hashToCurve(msg, options) { - const DST = options?.DST || 'ristretto255_XMD:SHA-512_R255MAP_RO_'; - const xmd = expand_message_xmd(msg, DST, 64, sha512); - return ristretto255_map(xmd); - }, - hashToScalar(msg, options = { DST: _DST_scalar }) { - const xmd = expand_message_xmd(msg, options.DST, 64, sha512); - return Fn.create(bytesToNumberLE(xmd)); - }, -}; -// export const ristretto255_oprf: OPRF = createORPF({ -// name: 'ristretto255-SHA512', -// Point: RistrettoPoint, -// hash: sha512, -// hashToGroup: ristretto255_hasher.hashToCurve, -// hashToScalar: ristretto255_hasher.hashToScalar, -// }); -/** - * Weird / bogus points, useful for debugging. - * All 8 ed25519 points of 8-torsion subgroup can be generated from the point - * T = `26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05`. - * ⟨T⟩ = { O, T, 2T, 3T, 4T, 5T, 6T, 7T } - */ -export const ED25519_TORSION_SUBGROUP = [ - '0100000000000000000000000000000000000000000000000000000000000000', - 'c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a', - '0000000000000000000000000000000000000000000000000000000000000080', - '26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05', - 'ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f', - '26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85', - '0000000000000000000000000000000000000000000000000000000000000000', - 'c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa', -]; -/** @deprecated use `ed25519.utils.toMontgomery` */ -export function edwardsToMontgomeryPub(edwardsPub) { - return ed25519.utils.toMontgomery(ensureBytes('pub', edwardsPub)); -} -/** @deprecated use `ed25519.utils.toMontgomery` */ -export const edwardsToMontgomery = edwardsToMontgomeryPub; -/** @deprecated use `ed25519.utils.toMontgomerySecret` */ -export function edwardsToMontgomeryPriv(edwardsPriv) { - return ed25519.utils.toMontgomerySecret(ensureBytes('pub', edwardsPriv)); -} -/** @deprecated use `ristretto255.Point` */ -export const RistrettoPoint = _RistrettoPoint; -/** @deprecated use `import { ed25519_hasher } from '@noble/curves/ed25519.js';` */ -export const hashToCurve = /* @__PURE__ */ (() => ed25519_hasher.hashToCurve)(); -/** @deprecated use `import { ed25519_hasher } from '@noble/curves/ed25519.js';` */ -export const encodeToCurve = /* @__PURE__ */ (() => ed25519_hasher.encodeToCurve)(); -/** @deprecated use `import { ristretto255_hasher } from '@noble/curves/ed25519.js';` */ -export const hashToRistretto255 = /* @__PURE__ */ (() => ristretto255_hasher.hashToCurve)(); -/** @deprecated use `import { ristretto255_hasher } from '@noble/curves/ed25519.js';` */ -export const hash_to_ristretto255 = /* @__PURE__ */ (() => ristretto255_hasher.hashToCurve)(); -//# sourceMappingURL=ed25519.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/ed25519.js.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/ed25519.js.map deleted file mode 100644 index a4476982..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/ed25519.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed25519.js","sourceRoot":"","sources":["../src/ed25519.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,sEAAsE;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAA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M,cAAc,GAA2B,eAAe,CAAC;AACtE,mFAAmF;AACnF,MAAM,CAAC,MAAM,WAAW,GAAsB,eAAe,CAAC,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,CAAC;AACnG,mFAAmF;AACnF,MAAM,CAAC,MAAM,aAAa,GAAsB,eAAe,CAAC,CAAC,GAAG,EAAE,CACpE,cAAc,CAAC,aAAa,CAAC,EAAE,CAAC;AAElC,wFAAwF;AACxF,MAAM,CAAC,MAAM,kBAAkB,GAAe,eAAe,CAAC,CAAC,GAAG,EAAE,CAClE,mBAAmB,CAAC,WAAyB,CAAC,EAAE,CAAC;AACnD,wFAAwF;AACxF,MAAM,CAAC,MAAM,oBAAoB,GAAe,eAAe,CAAC,CAAC,GAAG,EAAE,CACpE,mBAAmB,CAAC,WAAyB,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/ed448.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/esm/ed448.d.ts deleted file mode 100644 index 656e8d60..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/ed448.d.ts +++ /dev/null @@ -1,100 +0,0 @@ -import type { AffinePoint } from './abstract/curve.ts'; -import { PrimeEdwardsPoint, type CurveFn, type EdwardsPoint, type EdwardsPointCons } from './abstract/edwards.ts'; -import { type H2CHasher, type H2CHasherBase, type H2CMethod, type htfBasicOpts } from './abstract/hash-to-curve.ts'; -import { type IField } from './abstract/modular.ts'; -import { type MontgomeryECDH as XCurveFn } from './abstract/montgomery.ts'; -import { type Hex } from './utils.ts'; -/** - * ed448 EdDSA curve and methods. - * @example - * import { ed448 } from '@noble/curves/ed448'; - * const { secretKey, publicKey } = ed448.keygen(); - * const msg = new TextEncoder().encode('hello'); - * const sig = ed448.sign(msg, secretKey); - * const isValid = ed448.verify(sig, msg, publicKey); - */ -export declare const ed448: CurveFn; -/** Prehashed version of ed448. Accepts already-hashed messages in sign() and verify(). */ -export declare const ed448ph: CurveFn; -/** - * E448 curve, defined by NIST. - * E448 != edwards448 used in ed448. - * E448 is birationally equivalent to edwards448. - */ -export declare const E448: EdwardsPointCons; -/** - * ECDH using curve448 aka x448. - * x448 has 56-byte keys as per RFC 7748, while - * ed448 has 57-byte keys as per RFC 8032. - */ -export declare const x448: XCurveFn; -/** Hashing / encoding to ed448 points / field. RFC 9380 methods. */ -export declare const ed448_hasher: H2CHasher; -/** - * Each ed448/EdwardsPoint has 4 different equivalent points. This can be - * a source of bugs for protocols like ring signatures. Decaf was created to solve this. - * Decaf point operates in X:Y:Z:T extended coordinates like EdwardsPoint, - * but it should work in its own namespace: do not combine those two. - * See [RFC9496](https://www.rfc-editor.org/rfc/rfc9496). - */ -declare class _DecafPoint extends PrimeEdwardsPoint<_DecafPoint> { - static BASE: _DecafPoint; - static ZERO: _DecafPoint; - static Fp: IField; - static Fn: IField; - constructor(ep: EdwardsPoint); - static fromAffine(ap: AffinePoint): _DecafPoint; - protected assertSame(other: _DecafPoint): void; - protected init(ep: EdwardsPoint): _DecafPoint; - /** @deprecated use `import { decaf448_hasher } from '@noble/curves/ed448.js';` */ - static hashToCurve(hex: Hex): _DecafPoint; - static fromBytes(bytes: Uint8Array): _DecafPoint; - /** - * Converts decaf-encoded string to decaf point. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-decode-2). - * @param hex Decaf-encoded 56 bytes. Not every 56-byte string is valid decaf encoding - */ - static fromHex(hex: Hex): _DecafPoint; - /** @deprecated use `import { pippenger } from '@noble/curves/abstract/curve.js';` */ - static msm(points: _DecafPoint[], scalars: bigint[]): _DecafPoint; - /** - * Encodes decaf point to Uint8Array. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-encode-2). - */ - toBytes(): Uint8Array; - /** - * Compare one point to another. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-equals-2). - */ - equals(other: _DecafPoint): boolean; - is0(): boolean; -} -export declare const decaf448: { - Point: typeof _DecafPoint; -}; -/** Hashing to decaf448 points / field. RFC 9380 methods. */ -export declare const decaf448_hasher: H2CHasherBase; -/** - * Weird / bogus points, useful for debugging. - * Unlike ed25519, there is no ed448 generator point which can produce full T subgroup. - * Instead, there is a Klein four-group, which spans over 2 independent 2-torsion points: - * (0, 1), (0, -1), (-1, 0), (1, 0). - */ -export declare const ED448_TORSION_SUBGROUP: string[]; -type DcfHasher = (msg: Uint8Array, options: htfBasicOpts) => _DecafPoint; -/** @deprecated use `decaf448.Point` */ -export declare const DecafPoint: typeof _DecafPoint; -/** @deprecated use `import { ed448_hasher } from '@noble/curves/ed448.js';` */ -export declare const hashToCurve: H2CMethod; -/** @deprecated use `import { ed448_hasher } from '@noble/curves/ed448.js';` */ -export declare const encodeToCurve: H2CMethod; -/** @deprecated use `import { decaf448_hasher } from '@noble/curves/ed448.js';` */ -export declare const hashToDecaf448: DcfHasher; -/** @deprecated use `import { decaf448_hasher } from '@noble/curves/ed448.js';` */ -export declare const hash_to_decaf448: DcfHasher; -/** @deprecated use `ed448.utils.toMontgomery` */ -export declare function edwardsToMontgomeryPub(edwardsPub: string | Uint8Array): Uint8Array; -/** @deprecated use `ed448.utils.toMontgomery` */ -export declare const edwardsToMontgomery: typeof edwardsToMontgomeryPub; -export {}; -//# sourceMappingURL=ed448.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/ed448.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/ed448.d.ts.map deleted file mode 100644 index 42dfabcd..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/ed448.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed448.d.ts","sourceRoot":"","sources":["../src/ed448.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAEL,iBAAiB,EAEjB,KAAK,OAAO,EAEZ,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACt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test/node_modules/@noble/curves/esm/ed448.js deleted file mode 100644 index 8add0369..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/ed448.js +++ /dev/null @@ -1,459 +0,0 @@ -/** - * Edwards448 (not Ed448-Goldilocks) curve with following addons: - * - X448 ECDH - * - Decaf cofactor elimination - * - Elligator hash-to-group / point indistinguishability - * Conforms to RFC 8032 https://www.rfc-editor.org/rfc/rfc8032.html#section-5.2 - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { shake256 } from '@noble/hashes/sha3.js'; -import { abytes, concatBytes, createHasher as wrapConstructor } from '@noble/hashes/utils.js'; -import { pippenger } from "./abstract/curve.js"; -import { edwards, PrimeEdwardsPoint, twistedEdwards, } from "./abstract/edwards.js"; -import { _DST_scalar, createHasher, expand_message_xof, } from "./abstract/hash-to-curve.js"; -import { Field, FpInvertBatch, isNegativeLE, mod, pow2 } from "./abstract/modular.js"; -import { montgomery } from "./abstract/montgomery.js"; -import { asciiToBytes, bytesToNumberLE, ensureBytes, equalBytes } from "./utils.js"; -// edwards448 curve -// a = 1n -// d = Fp.neg(39081n) -// Finite field 2n**448n - 2n**224n - 1n -// Subgroup order -// 2n**446n - 13818066809895115352007386748515426880336692474882178609894547503885n -const ed448_CURVE = { - p: BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffff'), - n: BigInt('0x3fffffffffffffffffffffffffffffffffffffffffffffffffffffff7cca23e9c44edb49aed63690216cc2728dc58f552378c292ab5844f3'), - h: BigInt(4), - a: BigInt(1), - d: BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffffffffffffffffffffffffffffffffffffffffffffffff6756'), - Gx: BigInt('0x4f1970c66bed0ded221d15a622bf36da9e146570470f1767ea6de324a3d3a46412ae1af72ab66511433b80e18b00938e2626a82bc70cc05e'), - Gy: BigInt('0x693f46716eb6bc248876203756c9c7624bea73736ca3984087789c1e05a0c2d73ad3ff1ce67c39c4fdbd132c4ed7c8ad9808795bf230fa14'), -}; -// E448 NIST curve is identical to edwards448, except for: -// d = 39082/39081 -// Gx = 3/2 -const E448_CURVE = Object.assign({}, ed448_CURVE, { - d: BigInt('0xd78b4bdc7f0daf19f24f38c29373a2ccad46157242a50f37809b1da3412a12e79ccc9c81264cfe9ad080997058fb61c4243cc32dbaa156b9'), - Gx: BigInt('0x79a70b2b70400553ae7c9df416c792c61128751ac92969240c25a07d728bdc93e21f7787ed6972249de732f38496cd11698713093e9c04fc'), - Gy: BigInt('0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffff80000000000000000000000000000000000000000000000000000001'), -}); -const shake256_114 = /* @__PURE__ */ wrapConstructor(() => shake256.create({ dkLen: 114 })); -const shake256_64 = /* @__PURE__ */ wrapConstructor(() => shake256.create({ dkLen: 64 })); -// prettier-ignore -const _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = BigInt(4), _11n = BigInt(11); -// prettier-ignore -const _22n = BigInt(22), _44n = BigInt(44), _88n = BigInt(88), _223n = BigInt(223); -// powPminus3div4 calculates z = x^k mod p, where k = (p-3)/4. -// Used for efficient square root calculation. -// ((P-3)/4).toString(2) would produce bits [223x 1, 0, 222x 1] -function ed448_pow_Pminus3div4(x) { - const P = ed448_CURVE.p; - const b2 = (x * x * x) % P; - const b3 = (b2 * b2 * x) % P; - const b6 = (pow2(b3, _3n, P) * b3) % P; - const b9 = (pow2(b6, _3n, P) * b3) % P; - const b11 = (pow2(b9, _2n, P) * b2) % P; - const b22 = (pow2(b11, _11n, P) * b11) % P; - const b44 = (pow2(b22, _22n, P) * b22) % P; - const b88 = (pow2(b44, _44n, P) * b44) % P; - const b176 = (pow2(b88, _88n, P) * b88) % P; - const b220 = (pow2(b176, _44n, P) * b44) % P; - const b222 = (pow2(b220, _2n, P) * b2) % P; - const b223 = (pow2(b222, _1n, P) * x) % P; - return (pow2(b223, _223n, P) * b222) % P; -} -function adjustScalarBytes(bytes) { - // Section 5: Likewise, for X448, set the two least significant bits of the first byte to 0, - bytes[0] &= 252; // 0b11111100 - // and the most significant bit of the last byte to 1. - bytes[55] |= 128; // 0b10000000 - // NOTE: is NOOP for 56 bytes scalars (X25519/X448) - bytes[56] = 0; // Byte outside of group (456 buts vs 448 bits) - return bytes; -} -// Constant-time ratio of u to v. Allows to combine inversion and square root u/√v. -// Uses algo from RFC8032 5.1.3. -function uvRatio(u, v) { - const P = ed448_CURVE.p; - // https://www.rfc-editor.org/rfc/rfc8032#section-5.2.3 - // To compute the square root of (u/v), the first step is to compute the - // candidate root x = (u/v)^((p+1)/4). This can be done using the - // following trick, to use a single modular powering for both the - // inversion of v and the square root: - // x = (u/v)^((p+1)/4) = u³v(u⁵v³)^((p-3)/4) (mod p) - const u2v = mod(u * u * v, P); // u²v - const u3v = mod(u2v * u, P); // u³v - const u5v3 = mod(u3v * u2v * v, P); // u⁵v³ - const root = ed448_pow_Pminus3div4(u5v3); - const x = mod(u3v * root, P); - // Verify that root is exists - const x2 = mod(x * x, P); // x² - // If vx² = u, the recovered x-coordinate is x. Otherwise, no - // square root exists, and the decoding fails. - return { isValid: mod(x2 * v, P) === u, value: x }; -} -// Finite field 2n**448n - 2n**224n - 1n -// The value fits in 448 bits, but we use 456-bit (57-byte) elements because of bitflags. -// - ed25519 fits in 255 bits, allowing using last 1 byte for specifying bit flag of point negation. -// - ed448 fits in 448 bits. We can't use last 1 byte: we can only use a bit 224 in the middle. -const Fp = /* @__PURE__ */ (() => Field(ed448_CURVE.p, { BITS: 456, isLE: true }))(); -const Fn = /* @__PURE__ */ (() => Field(ed448_CURVE.n, { BITS: 456, isLE: true }))(); -// decaf448 uses 448-bit (56-byte) keys -const Fp448 = /* @__PURE__ */ (() => Field(ed448_CURVE.p, { BITS: 448, isLE: true }))(); -const Fn448 = /* @__PURE__ */ (() => Field(ed448_CURVE.n, { BITS: 448, isLE: true }))(); -// SHAKE256(dom4(phflag,context)||x, 114) -function dom4(data, ctx, phflag) { - if (ctx.length > 255) - throw new Error('context must be smaller than 255, got: ' + ctx.length); - return concatBytes(asciiToBytes('SigEd448'), new Uint8Array([phflag ? 1 : 0, ctx.length]), ctx, data); -} -// const ed448_eddsa_opts = { adjustScalarBytes, domain: dom4 }; -// const ed448_Point = edwards(ed448_CURVE, { Fp, Fn, uvRatio }); -const ED448_DEF = /* @__PURE__ */ (() => ({ - ...ed448_CURVE, - Fp, - Fn, - nBitLength: Fn.BITS, - hash: shake256_114, - adjustScalarBytes, - domain: dom4, - uvRatio, -}))(); -/** - * ed448 EdDSA curve and methods. - * @example - * import { ed448 } from '@noble/curves/ed448'; - * const { secretKey, publicKey } = ed448.keygen(); - * const msg = new TextEncoder().encode('hello'); - * const sig = ed448.sign(msg, secretKey); - * const isValid = ed448.verify(sig, msg, publicKey); - */ -export const ed448 = twistedEdwards(ED448_DEF); -// There is no ed448ctx, since ed448 supports ctx by default -/** Prehashed version of ed448. Accepts already-hashed messages in sign() and verify(). */ -export const ed448ph = /* @__PURE__ */ (() => twistedEdwards({ - ...ED448_DEF, - prehash: shake256_64, -}))(); -/** - * E448 curve, defined by NIST. - * E448 != edwards448 used in ed448. - * E448 is birationally equivalent to edwards448. - */ -export const E448 = edwards(E448_CURVE); -/** - * ECDH using curve448 aka x448. - * x448 has 56-byte keys as per RFC 7748, while - * ed448 has 57-byte keys as per RFC 8032. - */ -export const x448 = /* @__PURE__ */ (() => { - const P = ed448_CURVE.p; - return montgomery({ - P, - type: 'x448', - powPminus2: (x) => { - const Pminus3div4 = ed448_pow_Pminus3div4(x); - const Pminus3 = pow2(Pminus3div4, _2n, P); - return mod(Pminus3 * x, P); // Pminus3 * x = Pminus2 - }, - adjustScalarBytes, - }); -})(); -// Hash To Curve Elligator2 Map -const ELL2_C1 = /* @__PURE__ */ (() => (Fp.ORDER - BigInt(3)) / BigInt(4))(); // 1. c1 = (q - 3) / 4 # Integer arithmetic -const ELL2_J = /* @__PURE__ */ BigInt(156326); -function map_to_curve_elligator2_curve448(u) { - let tv1 = Fp.sqr(u); // 1. tv1 = u^2 - let e1 = Fp.eql(tv1, Fp.ONE); // 2. e1 = tv1 == 1 - tv1 = Fp.cmov(tv1, Fp.ZERO, e1); // 3. tv1 = CMOV(tv1, 0, e1) # If Z * u^2 == -1, set tv1 = 0 - let xd = Fp.sub(Fp.ONE, tv1); // 4. xd = 1 - tv1 - let x1n = Fp.neg(ELL2_J); // 5. x1n = -J - let tv2 = Fp.sqr(xd); // 6. tv2 = xd^2 - let gxd = Fp.mul(tv2, xd); // 7. gxd = tv2 * xd # gxd = xd^3 - let gx1 = Fp.mul(tv1, Fp.neg(ELL2_J)); // 8. gx1 = -J * tv1 # x1n + J * xd - gx1 = Fp.mul(gx1, x1n); // 9. gx1 = gx1 * x1n # x1n^2 + J * x1n * xd - gx1 = Fp.add(gx1, tv2); // 10. gx1 = gx1 + tv2 # x1n^2 + J * x1n * xd + xd^2 - gx1 = Fp.mul(gx1, x1n); // 11. gx1 = gx1 * x1n # x1n^3 + J * x1n^2 * xd + x1n * xd^2 - let tv3 = Fp.sqr(gxd); // 12. tv3 = gxd^2 - tv2 = Fp.mul(gx1, gxd); // 13. tv2 = gx1 * gxd # gx1 * gxd - tv3 = Fp.mul(tv3, tv2); // 14. tv3 = tv3 * tv2 # gx1 * gxd^3 - let y1 = Fp.pow(tv3, ELL2_C1); // 15. y1 = tv3^c1 # (gx1 * gxd^3)^((p - 3) / 4) - y1 = Fp.mul(y1, tv2); // 16. y1 = y1 * tv2 # gx1 * gxd * (gx1 * gxd^3)^((p - 3) / 4) - let x2n = Fp.mul(x1n, Fp.neg(tv1)); // 17. x2n = -tv1 * x1n # x2 = x2n / xd = -1 * u^2 * x1n / xd - let y2 = Fp.mul(y1, u); // 18. y2 = y1 * u - y2 = Fp.cmov(y2, Fp.ZERO, e1); // 19. y2 = CMOV(y2, 0, e1) - tv2 = Fp.sqr(y1); // 20. tv2 = y1^2 - tv2 = Fp.mul(tv2, gxd); // 21. tv2 = tv2 * gxd - let e2 = Fp.eql(tv2, gx1); // 22. e2 = tv2 == gx1 - let xn = Fp.cmov(x2n, x1n, e2); // 23. xn = CMOV(x2n, x1n, e2) # If e2, x = x1, else x = x2 - let y = Fp.cmov(y2, y1, e2); // 24. y = CMOV(y2, y1, e2) # If e2, y = y1, else y = y2 - let e3 = Fp.isOdd(y); // 25. e3 = sgn0(y) == 1 # Fix sign of y - y = Fp.cmov(y, Fp.neg(y), e2 !== e3); // 26. y = CMOV(y, -y, e2 XOR e3) - return { xn, xd, yn: y, yd: Fp.ONE }; // 27. return (xn, xd, y, 1) -} -function map_to_curve_elligator2_edwards448(u) { - let { xn, xd, yn, yd } = map_to_curve_elligator2_curve448(u); // 1. (xn, xd, yn, yd) = map_to_curve_elligator2_curve448(u) - let xn2 = Fp.sqr(xn); // 2. xn2 = xn^2 - let xd2 = Fp.sqr(xd); // 3. xd2 = xd^2 - let xd4 = Fp.sqr(xd2); // 4. xd4 = xd2^2 - let yn2 = Fp.sqr(yn); // 5. yn2 = yn^2 - let yd2 = Fp.sqr(yd); // 6. yd2 = yd^2 - let xEn = Fp.sub(xn2, xd2); // 7. xEn = xn2 - xd2 - let tv2 = Fp.sub(xEn, xd2); // 8. tv2 = xEn - xd2 - xEn = Fp.mul(xEn, xd2); // 9. xEn = xEn * xd2 - xEn = Fp.mul(xEn, yd); // 10. xEn = xEn * yd - xEn = Fp.mul(xEn, yn); // 11. xEn = xEn * yn - xEn = Fp.mul(xEn, _4n); // 12. xEn = xEn * 4 - tv2 = Fp.mul(tv2, xn2); // 13. tv2 = tv2 * xn2 - tv2 = Fp.mul(tv2, yd2); // 14. tv2 = tv2 * yd2 - let tv3 = Fp.mul(yn2, _4n); // 15. tv3 = 4 * yn2 - let tv1 = Fp.add(tv3, yd2); // 16. tv1 = tv3 + yd2 - tv1 = Fp.mul(tv1, xd4); // 17. tv1 = tv1 * xd4 - let xEd = Fp.add(tv1, tv2); // 18. xEd = tv1 + tv2 - tv2 = Fp.mul(tv2, xn); // 19. tv2 = tv2 * xn - let tv4 = Fp.mul(xn, xd4); // 20. tv4 = xn * xd4 - let yEn = Fp.sub(tv3, yd2); // 21. yEn = tv3 - yd2 - yEn = Fp.mul(yEn, tv4); // 22. yEn = yEn * tv4 - yEn = Fp.sub(yEn, tv2); // 23. yEn = yEn - tv2 - tv1 = Fp.add(xn2, xd2); // 24. tv1 = xn2 + xd2 - tv1 = Fp.mul(tv1, xd2); // 25. tv1 = tv1 * xd2 - tv1 = Fp.mul(tv1, xd); // 26. tv1 = tv1 * xd - tv1 = Fp.mul(tv1, yn2); // 27. tv1 = tv1 * yn2 - tv1 = Fp.mul(tv1, BigInt(-2)); // 28. tv1 = -2 * tv1 - let yEd = Fp.add(tv2, tv1); // 29. yEd = tv2 + tv1 - tv4 = Fp.mul(tv4, yd2); // 30. tv4 = tv4 * yd2 - yEd = Fp.add(yEd, tv4); // 31. yEd = yEd + tv4 - tv1 = Fp.mul(xEd, yEd); // 32. tv1 = xEd * yEd - let e = Fp.eql(tv1, Fp.ZERO); // 33. e = tv1 == 0 - xEn = Fp.cmov(xEn, Fp.ZERO, e); // 34. xEn = CMOV(xEn, 0, e) - xEd = Fp.cmov(xEd, Fp.ONE, e); // 35. xEd = CMOV(xEd, 1, e) - yEn = Fp.cmov(yEn, Fp.ONE, e); // 36. yEn = CMOV(yEn, 1, e) - yEd = Fp.cmov(yEd, Fp.ONE, e); // 37. yEd = CMOV(yEd, 1, e) - const inv = FpInvertBatch(Fp, [xEd, yEd], true); // batch division - return { x: Fp.mul(xEn, inv[0]), y: Fp.mul(yEn, inv[1]) }; // 38. return (xEn, xEd, yEn, yEd) -} -/** Hashing / encoding to ed448 points / field. RFC 9380 methods. */ -export const ed448_hasher = /* @__PURE__ */ (() => createHasher(ed448.Point, (scalars) => map_to_curve_elligator2_edwards448(scalars[0]), { - DST: 'edwards448_XOF:SHAKE256_ELL2_RO_', - encodeDST: 'edwards448_XOF:SHAKE256_ELL2_NU_', - p: Fp.ORDER, - m: 1, - k: 224, - expand: 'xof', - hash: shake256, -}))(); -// 1-d -const ONE_MINUS_D = /* @__PURE__ */ BigInt('39082'); -// 1-2d -const ONE_MINUS_TWO_D = /* @__PURE__ */ BigInt('78163'); -// √(-d) -const SQRT_MINUS_D = /* @__PURE__ */ BigInt('98944233647732219769177004876929019128417576295529901074099889598043702116001257856802131563896515373927712232092845883226922417596214'); -// 1 / √(-d) -const INVSQRT_MINUS_D = /* @__PURE__ */ BigInt('315019913931389607337177038330951043522456072897266928557328499619017160722351061360252776265186336876723201881398623946864393857820716'); -// Calculates 1/√(number) -const invertSqrt = (number) => uvRatio(_1n, number); -/** - * Elligator map for hash-to-curve of decaf448. - * Described in [RFC9380](https://www.rfc-editor.org/rfc/rfc9380#appendix-C) - * and [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-element-derivation-2). - */ -function calcElligatorDecafMap(r0) { - const { d } = ed448_CURVE; - const P = Fp.ORDER; - const mod = (n) => Fp.create(n); - const r = mod(-(r0 * r0)); // 1 - const u0 = mod(d * (r - _1n)); // 2 - const u1 = mod((u0 + _1n) * (u0 - r)); // 3 - const { isValid: was_square, value: v } = uvRatio(ONE_MINUS_TWO_D, mod((r + _1n) * u1)); // 4 - let v_prime = v; // 5 - if (!was_square) - v_prime = mod(r0 * v); - let sgn = _1n; // 6 - if (!was_square) - sgn = mod(-_1n); - const s = mod(v_prime * (r + _1n)); // 7 - let s_abs = s; - if (isNegativeLE(s, P)) - s_abs = mod(-s); - const s2 = s * s; - const W0 = mod(s_abs * _2n); // 8 - const W1 = mod(s2 + _1n); // 9 - const W2 = mod(s2 - _1n); // 10 - const W3 = mod(v_prime * s * (r - _1n) * ONE_MINUS_TWO_D + sgn); // 11 - return new ed448.Point(mod(W0 * W3), mod(W2 * W1), mod(W1 * W3), mod(W0 * W2)); -} -function decaf448_map(bytes) { - abytes(bytes, 112); - const skipValidation = true; - // Note: Similar to the field element decoding described in - // [RFC7748], and unlike the field element decoding described in - // Section 5.3.1, non-canonical values are accepted. - const r1 = Fp448.create(Fp448.fromBytes(bytes.subarray(0, 56), skipValidation)); - const R1 = calcElligatorDecafMap(r1); - const r2 = Fp448.create(Fp448.fromBytes(bytes.subarray(56, 112), skipValidation)); - const R2 = calcElligatorDecafMap(r2); - return new _DecafPoint(R1.add(R2)); -} -/** - * Each ed448/EdwardsPoint has 4 different equivalent points. This can be - * a source of bugs for protocols like ring signatures. Decaf was created to solve this. - * Decaf point operates in X:Y:Z:T extended coordinates like EdwardsPoint, - * but it should work in its own namespace: do not combine those two. - * See [RFC9496](https://www.rfc-editor.org/rfc/rfc9496). - */ -class _DecafPoint extends PrimeEdwardsPoint { - constructor(ep) { - super(ep); - } - static fromAffine(ap) { - return new _DecafPoint(ed448.Point.fromAffine(ap)); - } - assertSame(other) { - if (!(other instanceof _DecafPoint)) - throw new Error('DecafPoint expected'); - } - init(ep) { - return new _DecafPoint(ep); - } - /** @deprecated use `import { decaf448_hasher } from '@noble/curves/ed448.js';` */ - static hashToCurve(hex) { - return decaf448_map(ensureBytes('decafHash', hex, 112)); - } - static fromBytes(bytes) { - abytes(bytes, 56); - const { d } = ed448_CURVE; - const P = Fp.ORDER; - const mod = (n) => Fp448.create(n); - const s = Fp448.fromBytes(bytes); - // 1. Check that s_bytes is the canonical encoding of a field element, or else abort. - // 2. Check that s is non-negative, or else abort - if (!equalBytes(Fn448.toBytes(s), bytes) || isNegativeLE(s, P)) - throw new Error('invalid decaf448 encoding 1'); - const s2 = mod(s * s); // 1 - const u1 = mod(_1n + s2); // 2 - const u1sq = mod(u1 * u1); - const u2 = mod(u1sq - _4n * d * s2); // 3 - const { isValid, value: invsqrt } = invertSqrt(mod(u2 * u1sq)); // 4 - let u3 = mod((s + s) * invsqrt * u1 * SQRT_MINUS_D); // 5 - if (isNegativeLE(u3, P)) - u3 = mod(-u3); - const x = mod(u3 * invsqrt * u2 * INVSQRT_MINUS_D); // 6 - const y = mod((_1n - s2) * invsqrt * u1); // 7 - const t = mod(x * y); // 8 - if (!isValid) - throw new Error('invalid decaf448 encoding 2'); - return new _DecafPoint(new ed448.Point(x, y, _1n, t)); - } - /** - * Converts decaf-encoded string to decaf point. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-decode-2). - * @param hex Decaf-encoded 56 bytes. Not every 56-byte string is valid decaf encoding - */ - static fromHex(hex) { - return _DecafPoint.fromBytes(ensureBytes('decafHex', hex, 56)); - } - /** @deprecated use `import { pippenger } from '@noble/curves/abstract/curve.js';` */ - static msm(points, scalars) { - return pippenger(_DecafPoint, Fn, points, scalars); - } - /** - * Encodes decaf point to Uint8Array. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-encode-2). - */ - toBytes() { - const { X, Z, T } = this.ep; - const P = Fp.ORDER; - const mod = (n) => Fp.create(n); - const u1 = mod(mod(X + T) * mod(X - T)); // 1 - const x2 = mod(X * X); - const { value: invsqrt } = invertSqrt(mod(u1 * ONE_MINUS_D * x2)); // 2 - let ratio = mod(invsqrt * u1 * SQRT_MINUS_D); // 3 - if (isNegativeLE(ratio, P)) - ratio = mod(-ratio); - const u2 = mod(INVSQRT_MINUS_D * ratio * Z - T); // 4 - let s = mod(ONE_MINUS_D * invsqrt * X * u2); // 5 - if (isNegativeLE(s, P)) - s = mod(-s); - return Fn448.toBytes(s); - } - /** - * Compare one point to another. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-equals-2). - */ - equals(other) { - this.assertSame(other); - const { X: X1, Y: Y1 } = this.ep; - const { X: X2, Y: Y2 } = other.ep; - // (x1 * y2 == y1 * x2) - return Fp.create(X1 * Y2) === Fp.create(Y1 * X2); - } - is0() { - return this.equals(_DecafPoint.ZERO); - } -} -// The following gymnastics is done because typescript strips comments otherwise -// prettier-ignore -_DecafPoint.BASE = -/* @__PURE__ */ (() => new _DecafPoint(ed448.Point.BASE).multiplyUnsafe(_2n))(); -// prettier-ignore -_DecafPoint.ZERO = -/* @__PURE__ */ (() => new _DecafPoint(ed448.Point.ZERO))(); -// prettier-ignore -_DecafPoint.Fp = -/* @__PURE__ */ (() => Fp448)(); -// prettier-ignore -_DecafPoint.Fn = -/* @__PURE__ */ (() => Fn448)(); -export const decaf448 = { Point: _DecafPoint }; -/** Hashing to decaf448 points / field. RFC 9380 methods. */ -export const decaf448_hasher = { - hashToCurve(msg, options) { - const DST = options?.DST || 'decaf448_XOF:SHAKE256_D448MAP_RO_'; - return decaf448_map(expand_message_xof(msg, DST, 112, 224, shake256)); - }, - // Warning: has big modulo bias of 2^-64. - // RFC is invalid. RFC says "use 64-byte xof", while for 2^-112 bias - // it must use 84-byte xof (56+56/2), not 64. - hashToScalar(msg, options = { DST: _DST_scalar }) { - // Can't use `Fn448.fromBytes()`. 64-byte input => 56-byte field element - const xof = expand_message_xof(msg, options.DST, 64, 256, shake256); - return Fn448.create(bytesToNumberLE(xof)); - }, -}; -// export const decaf448_oprf: OPRF = createORPF({ -// name: 'decaf448-SHAKE256', -// Point: DecafPoint, -// hash: (msg: Uint8Array) => shake256(msg, { dkLen: 64 }), -// hashToGroup: decaf448_hasher.hashToCurve, -// hashToScalar: decaf448_hasher.hashToScalar, -// }); -/** - * Weird / bogus points, useful for debugging. - * Unlike ed25519, there is no ed448 generator point which can produce full T subgroup. - * Instead, there is a Klein four-group, which spans over 2 independent 2-torsion points: - * (0, 1), (0, -1), (-1, 0), (1, 0). - */ -export const ED448_TORSION_SUBGROUP = [ - '010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', - 'fefffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffff00', - '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', - '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080', -]; -/** @deprecated use `decaf448.Point` */ -export const DecafPoint = _DecafPoint; -/** @deprecated use `import { ed448_hasher } from '@noble/curves/ed448.js';` */ -export const hashToCurve = /* @__PURE__ */ (() => ed448_hasher.hashToCurve)(); -/** @deprecated use `import { ed448_hasher } from '@noble/curves/ed448.js';` */ -export const encodeToCurve = /* @__PURE__ */ (() => ed448_hasher.encodeToCurve)(); -/** @deprecated use `import { decaf448_hasher } from '@noble/curves/ed448.js';` */ -export const hashToDecaf448 = /* @__PURE__ */ (() => decaf448_hasher.hashToCurve)(); -/** @deprecated use `import { decaf448_hasher } from '@noble/curves/ed448.js';` */ -export const hash_to_decaf448 = /* @__PURE__ */ (() => decaf448_hasher.hashToCurve)(); -/** @deprecated use `ed448.utils.toMontgomery` */ -export function edwardsToMontgomeryPub(edwardsPub) { - return ed448.utils.toMontgomery(ensureBytes('pub', edwardsPub)); -} -/** @deprecated use `ed448.utils.toMontgomery` */ -export const edwardsToMontgomery = edwardsToMontgomeryPub; -//# sourceMappingURL=ed448.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/ed448.js.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/ed448.js.map deleted file mode 100644 index 8776664c..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/ed448.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed448.js","sourceRoot":"","sources":["../src/ed448.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,sEAAsE;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,IAAI,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9F,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EACL,OAAO,EACP,iBAAiB,EACjB,cAAc,GAKf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,WAAW,EACX,YAAY,EACZ,kBAAkB,GAKnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,EAAE,IAAI,EAAe,MAAM,uBAAuB,CAAC;AACnG,O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ic-test/node_modules/@noble/curves/esm/index.d.ts deleted file mode 100644 index e26a57a8..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/index.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/index.d.ts.map deleted file mode 100644 index 535b86d2..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/index.js b/tools/mnemonic-test/node_modules/@noble/curves/esm/index.js deleted file mode 100644 index 608abeb6..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/index.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Audited & minimal JS implementation of elliptic curve cryptography. - * @module - * @example -```js -import { secp256k1, schnorr } from '@noble/curves/secp256k1.js'; -import { ed25519, ed25519ph, ed25519ctx, x25519, RistrettoPoint } from '@noble/curves/ed25519.js'; -import { ed448, ed448ph, ed448ctx, x448 } from '@noble/curves/ed448.js'; -import { p256, p384, p521 } from '@noble/curves/nist.js'; -import { bls12_381 } from '@noble/curves/bls12-381.js'; -import { bn254 } from '@noble/curves/bn254.js'; -import { bytesToHex, hexToBytes, concatBytes, utf8ToBytes } from '@noble/curves/abstract/utils.js'; -``` - */ -throw new Error('root module cannot be imported: import submodules instead. Check out README'); -export {}; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/index.js.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/index.js.map deleted file mode 100644 index b6083439..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,IAAI,KAAK,CAAC,6EAA6E,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/jubjub.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/esm/jubjub.d.ts deleted file mode 100644 index 11ebd199..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/jubjub.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * @deprecated - * @module - */ -import { jubjub_findGroupHash, jubjub_groupHash, jubjub as jubjubn } from './misc.ts'; -/** @deprecated use `import { jubjub } from '@noble/curves/misc.js';` */ -export declare const jubjub: typeof jubjubn; -/** @deprecated use `import { jubjub_findGroupHash } from '@noble/curves/misc.js';` */ -export declare const findGroupHash: typeof jubjub_findGroupHash; -/** @deprecated use `import { jubjub_groupHash } from '@noble/curves/misc.js';` */ -export declare const groupHash: typeof jubjub_groupHash; -//# sourceMappingURL=jubjub.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/jubjub.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/jubjub.d.ts.map deleted file mode 100644 index f7066e5c..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/jubjub.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"jubjub.d.ts","sourceRoot":"","sources":["../src/jubjub.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAEtF,wEAAwE;AACxE,eAAO,MAAM,MAAM,EAAE,OAAO,OAAiB,CAAC;AAC9C,sFAAsF;AACtF,eAAO,MAAM,aAAa,EAAE,OAAO,oBAA2C,CAAC;AAC/E,kFAAkF;AAClF,eAAO,MAAM,SAAS,EAAE,OAAO,gBAAmC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/jubjub.js b/tools/mnemonic-test/node_modules/@noble/curves/esm/jubjub.js deleted file mode 100644 index e8690be3..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/jubjub.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * @deprecated - * @module - */ -import { jubjub_findGroupHash, jubjub_groupHash, jubjub as jubjubn } from "./misc.js"; -/** @deprecated use `import { jubjub } from '@noble/curves/misc.js';` */ -export const jubjub = jubjubn; -/** @deprecated use `import { jubjub_findGroupHash } from '@noble/curves/misc.js';` */ -export const findGroupHash = jubjub_findGroupHash; -/** @deprecated use `import { jubjub_groupHash } from '@noble/curves/misc.js';` */ -export const groupHash = jubjub_groupHash; -//# sourceMappingURL=jubjub.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/jubjub.js.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/jubjub.js.map deleted file mode 100644 index ba0b8e8c..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/jubjub.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"jubjub.js","sourceRoot":"","sources":["../src/jubjub.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAEtF,wEAAwE;AACxE,MAAM,CAAC,MAAM,MAAM,GAAmB,OAAO,CAAC;AAC9C,sFAAsF;AACtF,MAAM,CAAC,MAAM,aAAa,GAAgC,oBAAoB,CAAC;AAC/E,kFAAkF;AAClF,MAAM,CAAC,MAAM,SAAS,GAA4B,gBAAgB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/misc.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/esm/misc.d.ts deleted file mode 100644 index 165e3374..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/misc.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { type CurveFn, type EdwardsPoint } from './abstract/edwards.ts'; -import { type CurveFn as WCurveFn } from './abstract/weierstrass.ts'; -/** Curve over scalar field of bls12-381. jubjub Fp = bls n */ -export declare const jubjub: CurveFn; -/** Curve over scalar field of bn254. babyjubjub Fp = bn254 n */ -export declare const babyjubjub: CurveFn; -export declare function jubjub_groupHash(tag: Uint8Array, personalization: Uint8Array): EdwardsPoint; -export declare function jubjub_findGroupHash(m: Uint8Array, personalization: Uint8Array): EdwardsPoint; -export declare const pasta_p: bigint; -export declare const pasta_q: bigint; -/** - * @deprecated - */ -export declare const pallas: WCurveFn; -/** - * @deprecated - */ -export declare const vesta: WCurveFn; -//# sourceMappingURL=misc.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/misc.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/misc.d.ts.map deleted file mode 100644 index d220d750..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/misc.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../src/misc.ts"],"names":[],"mappings":"AAUA,OAAO,EAEL,KAAK,OAAO,EAEZ,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAe,KAAK,OAAO,IAAI,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAgBlF,8DAA8D;AAC9D,eAAO,MAAM,MAAM,EAAE,OAInB,CAAC;AAWH,gEAAgE;AAChE,eAAO,MAAM,UAAU,EAAE,OAIvB,CAAC;AAOH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,GAAG,YAAY,CAU3F;AAKD,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,GAAG,YAAY,CAW7F;AAID,eAAO,MAAM,OAAO,EAAE,MAErB,CAAC;AACF,eAAO,MAAM,OAAO,EAAE,MAErB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,MAAM,EAAE,QASnB,CAAC;AACH;;GAEG;AACH,eAAO,MAAM,KAAK,EAAE,QASlB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/misc.js b/tools/mnemonic-test/node_modules/@noble/curves/esm/misc.js deleted file mode 100644 index b8ee5611..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/misc.js +++ /dev/null @@ -1,109 +0,0 @@ -/** - * Miscellaneous, rarely used curves. - * jubjub, babyjubjub, pallas, vesta. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { blake256 } from '@noble/hashes/blake1.js'; -import { blake2s } from '@noble/hashes/blake2.js'; -import { sha256, sha512 } from '@noble/hashes/sha2.js'; -import { concatBytes, utf8ToBytes } from '@noble/hashes/utils.js'; -import { twistedEdwards, } from "./abstract/edwards.js"; -import { Field, mod } from "./abstract/modular.js"; -import { weierstrass } from "./abstract/weierstrass.js"; -import { bls12_381_Fr } from "./bls12-381.js"; -import { bn254_Fr } from "./bn254.js"; -// Jubjub curves have 𝔽p over scalar fields of other curves. They are friendly to ZK proofs. -// jubjub Fp = bls n. babyjubjub Fp = bn254 n. -// verify manually, check bls12-381.ts and bn254.ts. -const jubjub_CURVE = { - p: bls12_381_Fr.ORDER, - n: BigInt('0xe7db4ea6533afa906673b0101343b00a6682093ccc81082d0970e5ed6f72cb7'), - h: BigInt(8), - a: BigInt('0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000000'), - d: BigInt('0x2a9318e74bfa2b48f5fd9207e6bd7fd4292d7f6d37579d2601065fd6d6343eb1'), - Gx: BigInt('0x11dafe5d23e1218086a365b99fbf3d3be72f6afd7d1f72623e6b071492d1122b'), - Gy: BigInt('0x1d523cf1ddab1a1793132e78c866c0c33e26ba5cc220fed7cc3f870e59d292aa'), -}; -/** Curve over scalar field of bls12-381. jubjub Fp = bls n */ -export const jubjub = /* @__PURE__ */ twistedEdwards({ - ...jubjub_CURVE, - Fp: bls12_381_Fr, - hash: sha512, -}); -const babyjubjub_CURVE = { - p: bn254_Fr.ORDER, - n: BigInt('0x30644e72e131a029b85045b68181585d59f76dc1c90770533b94bee1c9093788'), - h: BigInt(8), - a: BigInt('168700'), - d: BigInt('168696'), - Gx: BigInt('0x23343e3445b673d38bcba38f25645adb494b1255b1162bb40f41a59f4d4b45e'), - Gy: BigInt('0xc19139cb84c680a6e14116da06056174a0cfa121e6e5c2450f87d64fc000001'), -}; -/** Curve over scalar field of bn254. babyjubjub Fp = bn254 n */ -export const babyjubjub = /* @__PURE__ */ twistedEdwards({ - ...babyjubjub_CURVE, - Fp: bn254_Fr, - hash: blake256, -}); -const jubjub_gh_first_block = utf8ToBytes('096b36a5804bfacef1691e173c366a47ff5ba84a44f26ddd7e8d9f79d5b42df0'); -// Returns point at JubJub curve which is prime order and not zero -export function jubjub_groupHash(tag, personalization) { - const h = blake2s.create({ personalization, dkLen: 32 }); - h.update(jubjub_gh_first_block); - h.update(tag); - // NOTE: returns ExtendedPoint, in case it will be multiplied later - let p = jubjub.Point.fromBytes(h.digest()); - // NOTE: cannot replace with isSmallOrder, returns Point*8 - p = p.multiply(jubjub_CURVE.h); - if (p.equals(jubjub.Point.ZERO)) - throw new Error('Point has small order'); - return p; -} -// No secret data is leaked here at all. -// It operates over public data: -// const G_SPEND = jubjub.findGroupHash(Uint8Array.of(), utf8ToBytes('Item_G_')); -export function jubjub_findGroupHash(m, personalization) { - const tag = concatBytes(m, Uint8Array.of(0)); - const hashes = []; - for (let i = 0; i < 256; i++) { - tag[tag.length - 1] = i; - try { - hashes.push(jubjub_groupHash(tag, personalization)); - } - catch (e) { } - } - if (!hashes.length) - throw new Error('findGroupHash tag overflow'); - return hashes[0]; -} -// Pasta curves. See [Spec](https://o1-labs.github.io/proof-systems/specs/pasta.html). -export const pasta_p = BigInt('0x40000000000000000000000000000000224698fc094cf91b992d30ed00000001'); -export const pasta_q = BigInt('0x40000000000000000000000000000000224698fc0994a8dd8c46eb2100000001'); -/** - * @deprecated - */ -export const pallas = weierstrass({ - a: BigInt(0), - b: BigInt(5), - Fp: Field(pasta_p), - n: pasta_q, - Gx: mod(BigInt(-1), pasta_p), - Gy: BigInt(2), - h: BigInt(1), - hash: sha256, -}); -/** - * @deprecated - */ -export const vesta = weierstrass({ - a: BigInt(0), - b: BigInt(5), - Fp: Field(pasta_q), - n: pasta_p, - Gx: mod(BigInt(-1), pasta_q), - Gy: BigInt(2), - h: BigInt(1), - hash: sha256, -}); -//# sourceMappingURL=misc.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/misc.js.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/misc.js.map deleted file mode 100644 index 61fa6ef5..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/misc.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"misc.js","sourceRoot":"","sources":["../src/misc.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,sEAAsE;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EACL,cAAc,GAIf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,WAAW,EAA4B,MAAM,2BAA2B,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,6FAA6F;AAC7F,8CAA8C;AAC9C,oDAAoD;AACpD,MAAM,Y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,CAAC,MAAM,OAAO,GAAW,MAAM,CACnC,oEAAoE,CACrE,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAa,WAAW,CAAC;IAC1C,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC;IAClB,CAAC,EAAE,OAAO;IACV,EAAE,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC;IAC5B,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;IACb,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,IAAI,EAAE,MAAM;CACb,CAAC,CAAC;AACH;;GAEG;AACH,MAAM,CAAC,MAAM,KAAK,GAAa,WAAW,CAAC;IACzC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC;IAClB,CAAC,EAAE,OAAO;IACV,EAAE,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC;IAC5B,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;IACb,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,IAAI,EAAE,MAAM;CACb,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/nist.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/esm/nist.d.ts deleted file mode 100644 index 244013d4..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/nist.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { type CurveFnWithCreate } from './_shortw_utils.ts'; -import { type H2CHasher } from './abstract/hash-to-curve.ts'; -/** NIST P256 (aka secp256r1, prime256v1) curve, ECDSA and ECDH methods. */ -export declare const p256: CurveFnWithCreate; -/** Hashing / encoding to p256 points / field. RFC 9380 methods. */ -export declare const p256_hasher: H2CHasher; -/** NIST P384 (aka secp384r1) curve, ECDSA and ECDH methods. */ -export declare const p384: CurveFnWithCreate; -/** Hashing / encoding to p384 points / field. RFC 9380 methods. */ -export declare const p384_hasher: H2CHasher; -/** NIST P521 (aka secp521r1) curve, ECDSA and ECDH methods. */ -export declare const p521: CurveFnWithCreate; -/** @deprecated use `p256` for consistency with `p256_hasher` */ -export declare const secp256r1: typeof p256; -/** @deprecated use `p384` for consistency with `p384_hasher` */ -export declare const secp384r1: typeof p384; -/** @deprecated use `p521` for consistency with `p521_hasher` */ -export declare const secp521r1: typeof p521; -/** Hashing / encoding to p521 points / field. RFC 9380 methods. */ -export declare const p521_hasher: H2CHasher; -//# sourceMappingURL=nist.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/nist.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/nist.d.ts.map deleted file mode 100644 index a5ffd33c..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/nist.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nist.d.ts","sourceRoot":"","sources":["../src/nist.ts"],"names":[],"mappings":"AAOA,OAAO,EAAe,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,6BAA6B,CAAC;AA+E3E,2EAA2E;AAC3E,eAAO,MAAM,IAAI,EAAE,iBAGlB,CAAC;AACF,mEAAmE;AACnE,eAAO,MAAM,WAAW,EAAE,SAAS,CAAC,MAAM,CAkBtC,CAAC;AAUL,+DAA+D;AAC/D,eAAO,MAAM,IAAI,EAAE,iBAGlB,CAAC;AACF,mEAAmE;AACnE,eAAO,MAAM,WAAW,EAAE,SAAS,CAAC,MAAM,CAkBtC,CAAC;AAWL,+DAA+D;AAC/D,eAAO,MAAM,IAAI,EAAE,iBAGlB,CAAC;AAEF,gEAAgE;AAChE,eAAO,MAAM,SAAS,EAAE,OAAO,IAAW,CAAC;AAC3C,gEAAgE;AAChE,eAAO,MAAM,SAAS,EAAE,OAAO,IAAW,CAAC;AAC3C,gEAAgE;AAChE,eAAO,MAAM,SAAS,EAAE,OAAO,IAAW,CAAC;AAE3C,mEAAmE;AACnE,eAAO,MAAM,WAAW,EAAE,SAAS,CAAC,MAAM,CAkBtC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/nist.js b/tools/mnemonic-test/node_modules/@noble/curves/esm/nist.js deleted file mode 100644 index 324f4bc4..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/nist.js +++ /dev/null @@ -1,132 +0,0 @@ -/** - * Internal module for NIST P256, P384, P521 curves. - * Do not use for now. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { sha256, sha384, sha512 } from '@noble/hashes/sha2.js'; -import { createCurve } from "./_shortw_utils.js"; -import { createHasher } from "./abstract/hash-to-curve.js"; -import { Field } from "./abstract/modular.js"; -import { mapToCurveSimpleSWU, } from "./abstract/weierstrass.js"; -// p = 2n**224n * (2n**32n-1n) + 2n**192n + 2n**96n - 1n -// a = Fp256.create(BigInt('-3')); -const p256_CURVE = { - p: BigInt('0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff'), - n: BigInt('0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551'), - h: BigInt(1), - a: BigInt('0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc'), - b: BigInt('0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b'), - Gx: BigInt('0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296'), - Gy: BigInt('0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5'), -}; -// p = 2n**384n - 2n**128n - 2n**96n + 2n**32n - 1n -const p384_CURVE = { - p: BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff'), - n: BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973'), - h: BigInt(1), - a: BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffc'), - b: BigInt('0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef'), - Gx: BigInt('0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7'), - Gy: BigInt('0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f'), -}; -// p = 2n**521n - 1n -const p521_CURVE = { - p: BigInt('0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'), - n: BigInt('0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409'), - h: BigInt(1), - a: BigInt('0x1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc'), - b: BigInt('0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00'), - Gx: BigInt('0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66'), - Gy: BigInt('0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650'), -}; -const Fp256 = Field(p256_CURVE.p); -const Fp384 = Field(p384_CURVE.p); -const Fp521 = Field(p521_CURVE.p); -function createSWU(Point, opts) { - const map = mapToCurveSimpleSWU(Point.Fp, opts); - return (scalars) => map(scalars[0]); -} -/** NIST P256 (aka secp256r1, prime256v1) curve, ECDSA and ECDH methods. */ -export const p256 = createCurve({ ...p256_CURVE, Fp: Fp256, lowS: false }, sha256); -/** Hashing / encoding to p256 points / field. RFC 9380 methods. */ -export const p256_hasher = /* @__PURE__ */ (() => { - return createHasher(p256.Point, createSWU(p256.Point, { - A: p256_CURVE.a, - B: p256_CURVE.b, - Z: p256.Point.Fp.create(BigInt('-10')), - }), { - DST: 'P256_XMD:SHA-256_SSWU_RO_', - encodeDST: 'P256_XMD:SHA-256_SSWU_NU_', - p: p256_CURVE.p, - m: 1, - k: 128, - expand: 'xmd', - hash: sha256, - }); -})(); -// export const p256_oprf: OPRF = createORPF({ -// name: 'P256-SHA256', -// Point: p256.Point, -// hash: sha256, -// hashToGroup: p256_hasher.hashToCurve, -// hashToScalar: p256_hasher.hashToScalar, -// }); -/** NIST P384 (aka secp384r1) curve, ECDSA and ECDH methods. */ -export const p384 = createCurve({ ...p384_CURVE, Fp: Fp384, lowS: false }, sha384); -/** Hashing / encoding to p384 points / field. RFC 9380 methods. */ -export const p384_hasher = /* @__PURE__ */ (() => { - return createHasher(p384.Point, createSWU(p384.Point, { - A: p384_CURVE.a, - B: p384_CURVE.b, - Z: p384.Point.Fp.create(BigInt('-12')), - }), { - DST: 'P384_XMD:SHA-384_SSWU_RO_', - encodeDST: 'P384_XMD:SHA-384_SSWU_NU_', - p: p384_CURVE.p, - m: 1, - k: 192, - expand: 'xmd', - hash: sha384, - }); -})(); -// export const p384_oprf: OPRF = createORPF({ -// name: 'P384-SHA384', -// Point: p384.Point, -// hash: sha384, -// hashToGroup: p384_hasher.hashToCurve, -// hashToScalar: p384_hasher.hashToScalar, -// }); -// const Fn521 = Field(p521_CURVE.n, { allowedScalarLengths: [65, 66] }); -/** NIST P521 (aka secp521r1) curve, ECDSA and ECDH methods. */ -export const p521 = createCurve({ ...p521_CURVE, Fp: Fp521, lowS: false, allowedPrivateKeyLengths: [130, 131, 132] }, sha512); -/** @deprecated use `p256` for consistency with `p256_hasher` */ -export const secp256r1 = p256; -/** @deprecated use `p384` for consistency with `p384_hasher` */ -export const secp384r1 = p384; -/** @deprecated use `p521` for consistency with `p521_hasher` */ -export const secp521r1 = p521; -/** Hashing / encoding to p521 points / field. RFC 9380 methods. */ -export const p521_hasher = /* @__PURE__ */ (() => { - return createHasher(p521.Point, createSWU(p521.Point, { - A: p521_CURVE.a, - B: p521_CURVE.b, - Z: p521.Point.Fp.create(BigInt('-4')), - }), { - DST: 'P521_XMD:SHA-512_SSWU_RO_', - encodeDST: 'P521_XMD:SHA-512_SSWU_NU_', - p: p521_CURVE.p, - m: 1, - k: 256, - expand: 'xmd', - hash: sha512, - }); -})(); -// export const p521_oprf: OPRF = createORPF({ -// name: 'P521-SHA512', -// Point: p521.Point, -// hash: sha512, -// hashToGroup: p521_hasher.hashToCurve, -// hashToScalar: p521_hasher.hashToScalar, // produces L=98 just like in RFC -// }); -//# sourceMappingURL=nist.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/nist.js.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/nist.js.map deleted file mode 100644 index d0e63e10..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/nist.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nist.js","sourceRoot":"","sources":["../src/nist.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,sEAAsE;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,WAAW,EAA0B,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,YAAY,EAAkB,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EACL,mB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,CAAC,CAAC,GAAG,EAAE;IAClE,OAAO,YAAY,CACjB,IAAI,CAAC,KAAK,EACV,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE;QACpB,CAAC,EAAE,UAAU,CAAC,CAAC;QACf,CAAC,EAAE,UAAU,CAAC,CAAC;QACf,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;KACtC,CAAC,EACF;QACE,GAAG,EAAE,2BAA2B;QAChC,SAAS,EAAE,2BAA2B;QACtC,CAAC,EAAE,UAAU,CAAC,CAAC;QACf,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,GAAG;QACN,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,MAAM;KACb,CACF,CAAC;AACJ,CAAC,CAAC,EAAE,CAAC;AAEL,8CAA8C;AAC9C,yBAAyB;AACzB,uBAAuB;AACvB,kBAAkB;AAClB,0CAA0C;AAC1C,8EAA8E;AAC9E,MAAM"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/p256.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/esm/p256.d.ts deleted file mode 100644 index 14290a8e..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/p256.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * NIST secp256r1 aka p256. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { type H2CMethod } from './abstract/hash-to-curve.ts'; -import { p256 as p256n } from './nist.ts'; -/** @deprecated use `import { p256 } from '@noble/curves/nist.js';` */ -export declare const p256: typeof p256n; -/** @deprecated use `import { p256 } from '@noble/curves/nist.js';` */ -export declare const secp256r1: typeof p256n; -/** @deprecated use `import { p256_hasher } from '@noble/curves/nist.js';` */ -export declare const hashToCurve: H2CMethod; -/** @deprecated use `import { p256_hasher } from '@noble/curves/nist.js';` */ -export declare const encodeToCurve: H2CMethod; -//# sourceMappingURL=p256.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/p256.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/p256.d.ts.map deleted file mode 100644 index edb05b82..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/p256.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"p256.d.ts","sourceRoot":"","sources":["../src/p256.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,sEAAsE;AACtE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAe,IAAI,IAAI,KAAK,EAAE,MAAM,WAAW,CAAC;AACvD,sEAAsE;AACtE,eAAO,MAAM,IAAI,EAAE,OAAO,KAAa,CAAC;AACxC,sEAAsE;AACtE,eAAO,MAAM,SAAS,EAAE,OAAO,KAAa,CAAC;AAC7C,6EAA6E;AAC7E,eAAO,MAAM,WAAW,EAAE,SAAS,CAAC,MAAM,CAAqD,CAAC;AAChG,6EAA6E;AAC7E,eAAO,MAAM,aAAa,EAAE,SAAS,CAAC,MAAM,CAAuD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/p256.js b/tools/mnemonic-test/node_modules/@noble/curves/esm/p256.js deleted file mode 100644 index eae012cc..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/p256.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * NIST secp256r1 aka p256. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import {} from "./abstract/hash-to-curve.js"; -import { p256_hasher, p256 as p256n } from "./nist.js"; -/** @deprecated use `import { p256 } from '@noble/curves/nist.js';` */ -export const p256 = p256n; -/** @deprecated use `import { p256 } from '@noble/curves/nist.js';` */ -export const secp256r1 = p256n; -/** @deprecated use `import { p256_hasher } from '@noble/curves/nist.js';` */ -export const hashToCurve = /* @__PURE__ */ (() => p256_hasher.hashToCurve)(); -/** @deprecated use `import { p256_hasher } from '@noble/curves/nist.js';` */ -export const encodeToCurve = /* @__PURE__ */ (() => p256_hasher.encodeToCurve)(); -//# sourceMappingURL=p256.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/p256.js.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/p256.js.map deleted file mode 100644 index e31767bc..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/p256.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"p256.js","sourceRoot":"","sources":["../src/p256.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,sEAAsE;AACtE,OAAO,EAAkB,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,IAAI,IAAI,KAAK,EAAE,MAAM,WAAW,CAAC;AACvD,sEAAsE;AACtE,MAAM,CAAC,MAAM,IAAI,GAAiB,KAAK,CAAC;AACxC,sEAAsE;AACtE,MAAM,CAAC,MAAM,SAAS,GAAiB,KAAK,CAAC;AAC7C,6EAA6E;AAC7E,MAAM,CAAC,MAAM,WAAW,GAAsB,eAAe,CAAC,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,CAAC;AAChG,6EAA6E;AAC7E,MAAM,CAAC,MAAM,aAAa,GAAsB,eAAe,CAAC,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/p384.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/esm/p384.d.ts deleted file mode 100644 index 58fba871..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/p384.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * NIST secp384r1 aka p384. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { type H2CMethod } from './abstract/hash-to-curve.ts'; -import { p384 as p384n } from './nist.ts'; -/** @deprecated use `import { p384 } from '@noble/curves/nist.js';` */ -export declare const p384: typeof p384n; -/** @deprecated use `import { p384 } from '@noble/curves/nist.js';` */ -export declare const secp384r1: typeof p384n; -/** @deprecated use `import { p384_hasher } from '@noble/curves/nist.js';` */ -export declare const hashToCurve: H2CMethod; -/** @deprecated use `import { p384_hasher } from '@noble/curves/nist.js';` */ -export declare const encodeToCurve: H2CMethod; -//# sourceMappingURL=p384.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/p384.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/p384.d.ts.map deleted file mode 100644 index 17f6707b..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/p384.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"p384.d.ts","sourceRoot":"","sources":["../src/p384.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,sEAAsE;AACtE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAe,IAAI,IAAI,KAAK,EAAE,MAAM,WAAW,CAAC;AACvD,sEAAsE;AACtE,eAAO,MAAM,IAAI,EAAE,OAAO,KAAa,CAAC;AACxC,sEAAsE;AACtE,eAAO,MAAM,SAAS,EAAE,OAAO,KAAa,CAAC;AAC7C,6EAA6E;AAC7E,eAAO,MAAM,WAAW,EAAE,SAAS,CAAC,MAAM,CAAqD,CAAC;AAChG,6EAA6E;AAC7E,eAAO,MAAM,aAAa,EAAE,SAAS,CAAC,MAAM,CAAuD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/p384.js b/tools/mnemonic-test/node_modules/@noble/curves/esm/p384.js deleted file mode 100644 index 68b938b4..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/p384.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * NIST secp384r1 aka p384. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import {} from "./abstract/hash-to-curve.js"; -import { p384_hasher, p384 as p384n } from "./nist.js"; -/** @deprecated use `import { p384 } from '@noble/curves/nist.js';` */ -export const p384 = p384n; -/** @deprecated use `import { p384 } from '@noble/curves/nist.js';` */ -export const secp384r1 = p384n; -/** @deprecated use `import { p384_hasher } from '@noble/curves/nist.js';` */ -export const hashToCurve = /* @__PURE__ */ (() => p384_hasher.hashToCurve)(); -/** @deprecated use `import { p384_hasher } from '@noble/curves/nist.js';` */ -export const encodeToCurve = /* @__PURE__ */ (() => p384_hasher.encodeToCurve)(); -//# sourceMappingURL=p384.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/p384.js.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/p384.js.map deleted file mode 100644 index 912fd5f4..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/p384.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"p384.js","sourceRoot":"","sources":["../src/p384.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,sEAAsE;AACtE,OAAO,EAAkB,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,IAAI,IAAI,KAAK,EAAE,MAAM,WAAW,CAAC;AACvD,sEAAsE;AACtE,MAAM,CAAC,MAAM,IAAI,GAAiB,KAAK,CAAC;AACxC,sEAAsE;AACtE,MAAM,CAAC,MAAM,SAAS,GAAiB,KAAK,CAAC;AAC7C,6EAA6E;AAC7E,MAAM,CAAC,MAAM,WAAW,GAAsB,eAAe,CAAC,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,CAAC;AAChG,6EAA6E;AAC7E,MAAM,CAAC,MAAM,aAAa,GAAsB,eAAe,CAAC,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/p521.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/esm/p521.d.ts deleted file mode 100644 index 470f5ce9..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/p521.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * NIST secp521r1 aka p521. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { type H2CMethod } from './abstract/hash-to-curve.ts'; -import { p521 as p521n } from './nist.ts'; -/** @deprecated use `import { p521 } from '@noble/curves/nist.js';` */ -export declare const p521: typeof p521n; -/** @deprecated use `import { p521 } from '@noble/curves/nist.js';` */ -export declare const secp521r1: typeof p521n; -/** @deprecated use `import { p521_hasher } from '@noble/curves/nist.js';` */ -export declare const hashToCurve: H2CMethod; -/** @deprecated use `import { p521_hasher } from '@noble/curves/nist.js';` */ -export declare const encodeToCurve: H2CMethod; -//# sourceMappingURL=p521.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/p521.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/p521.d.ts.map deleted file mode 100644 index 051f3289..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/p521.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"p521.d.ts","sourceRoot":"","sources":["../src/p521.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,sEAAsE;AACtE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAe,IAAI,IAAI,KAAK,EAAE,MAAM,WAAW,CAAC;AACvD,sEAAsE;AACtE,eAAO,MAAM,IAAI,EAAE,OAAO,KAAa,CAAC;AACxC,sEAAsE;AACtE,eAAO,MAAM,SAAS,EAAE,OAAO,KAAa,CAAC;AAC7C,6EAA6E;AAC7E,eAAO,MAAM,WAAW,EAAE,SAAS,CAAC,MAAM,CAAqD,CAAC;AAChG,6EAA6E;AAC7E,eAAO,MAAM,aAAa,EAAE,SAAS,CAAC,MAAM,CAAuD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/p521.js b/tools/mnemonic-test/node_modules/@noble/curves/esm/p521.js deleted file mode 100644 index 39db43d8..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/p521.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * NIST secp521r1 aka p521. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import {} from "./abstract/hash-to-curve.js"; -import { p521_hasher, p521 as p521n } from "./nist.js"; -/** @deprecated use `import { p521 } from '@noble/curves/nist.js';` */ -export const p521 = p521n; -/** @deprecated use `import { p521 } from '@noble/curves/nist.js';` */ -export const secp521r1 = p521n; -/** @deprecated use `import { p521_hasher } from '@noble/curves/nist.js';` */ -export const hashToCurve = /* @__PURE__ */ (() => p521_hasher.hashToCurve)(); -/** @deprecated use `import { p521_hasher } from '@noble/curves/nist.js';` */ -export const encodeToCurve = /* @__PURE__ */ (() => p521_hasher.encodeToCurve)(); -//# sourceMappingURL=p521.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/p521.js.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/p521.js.map deleted file mode 100644 index 2d94e93d..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/p521.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"p521.js","sourceRoot":"","sources":["../src/p521.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,sEAAsE;AACtE,OAAO,EAAkB,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,IAAI,IAAI,KAAK,EAAE,MAAM,WAAW,CAAC;AACvD,sEAAsE;AACtE,MAAM,CAAC,MAAM,IAAI,GAAiB,KAAK,CAAC;AACxC,sEAAsE;AACtE,MAAM,CAAC,MAAM,SAAS,GAAiB,KAAK,CAAC;AAC7C,6EAA6E;AAC7E,MAAM,CAAC,MAAM,WAAW,GAAsB,eAAe,CAAC,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,CAAC;AAChG,6EAA6E;AAC7E,MAAM,CAAC,MAAM,aAAa,GAAsB,eAAe,CAAC,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/package.json b/tools/mnemonic-test/node_modules/@noble/curves/esm/package.json deleted file mode 100644 index 7f1fc33d..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "type": "module", - "sideEffects": false -} diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/pasta.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/esm/pasta.d.ts deleted file mode 100644 index b5d5ba9b..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/pasta.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * @deprecated - * @module - */ -import { pallas as pn, vesta as vn } from './misc.ts'; -/** @deprecated */ -export declare const pallas: typeof pn; -/** @deprecated */ -export declare const vesta: typeof vn; -//# sourceMappingURL=pasta.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/pasta.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/pasta.d.ts.map deleted file mode 100644 index 29c2666a..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/pasta.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pasta.d.ts","sourceRoot":"","sources":["../src/pasta.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,IAAI,EAAE,EAAE,KAAK,IAAI,EAAE,EAAE,MAAM,WAAW,CAAC;AACtD,kBAAkB;AAClB,eAAO,MAAM,MAAM,EAAE,OAAO,EAAO,CAAC;AACpC,kBAAkB;AAClB,eAAO,MAAM,KAAK,EAAE,OAAO,EAAO,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/pasta.js b/tools/mnemonic-test/node_modules/@noble/curves/esm/pasta.js deleted file mode 100644 index f65e46fb..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/pasta.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * @deprecated - * @module - */ -import { pallas as pn, vesta as vn } from "./misc.js"; -/** @deprecated */ -export const pallas = pn; -/** @deprecated */ -export const vesta = vn; -//# sourceMappingURL=pasta.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/pasta.js.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/pasta.js.map deleted file mode 100644 index 0a749e63..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/pasta.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pasta.js","sourceRoot":"","sources":["../src/pasta.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,IAAI,EAAE,EAAE,KAAK,IAAI,EAAE,EAAE,MAAM,WAAW,CAAC;AACtD,kBAAkB;AAClB,MAAM,CAAC,MAAM,MAAM,GAAc,EAAE,CAAC;AACpC,kBAAkB;AAClB,MAAM,CAAC,MAAM,KAAK,GAAc,EAAE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/secp256k1.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/esm/secp256k1.d.ts deleted file mode 100644 index 4ba3fc91..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/secp256k1.d.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { type CurveFnWithCreate } from './_shortw_utils.ts'; -import type { CurveLengths } from './abstract/curve.ts'; -import { type H2CHasher, type H2CMethod } from './abstract/hash-to-curve.ts'; -import { mod } from './abstract/modular.ts'; -import { type WeierstrassPoint as PointType, type WeierstrassPointCons } from './abstract/weierstrass.ts'; -import type { Hex, PrivKey } from './utils.ts'; -import { bytesToNumberBE, numberToBytesBE } from './utils.ts'; -/** - * secp256k1 curve, ECDSA and ECDH methods. - * - * Field: `2n**256n - 2n**32n - 2n**9n - 2n**8n - 2n**7n - 2n**6n - 2n**4n - 1n` - * - * @example - * ```js - * import { secp256k1 } from '@noble/curves/secp256k1'; - * const { secretKey, publicKey } = secp256k1.keygen(); - * const msg = new TextEncoder().encode('hello'); - * const sig = secp256k1.sign(msg, secretKey); - * const isValid = secp256k1.verify(sig, msg, publicKey) === true; - * ``` - */ -export declare const secp256k1: CurveFnWithCreate; -declare function taggedHash(tag: string, ...messages: Uint8Array[]): Uint8Array; -/** - * lift_x from BIP340. Convert 32-byte x coordinate to elliptic curve point. - * @returns valid point checked for being on-curve - */ -declare function lift_x(x: bigint): PointType; -/** - * Schnorr public key is just `x` coordinate of Point as per BIP340. - */ -declare function schnorrGetPublicKey(secretKey: Hex): Uint8Array; -/** - * Creates Schnorr signature as per BIP340. Verifies itself before returning anything. - * auxRand is optional and is not the sole source of k generation: bad CSPRNG won't be dangerous. - */ -declare function schnorrSign(message: Hex, secretKey: PrivKey, auxRand?: Hex): Uint8Array; -/** - * Verifies Schnorr signature. - * Will swallow errors & return false except for initial type validation of arguments. - */ -declare function schnorrVerify(signature: Hex, message: Hex, publicKey: Hex): boolean; -export type SecpSchnorr = { - keygen: (seed?: Uint8Array) => { - secretKey: Uint8Array; - publicKey: Uint8Array; - }; - getPublicKey: typeof schnorrGetPublicKey; - sign: typeof schnorrSign; - verify: typeof schnorrVerify; - Point: WeierstrassPointCons; - utils: { - randomSecretKey: (seed?: Uint8Array) => Uint8Array; - pointToBytes: (point: PointType) => Uint8Array; - lift_x: typeof lift_x; - taggedHash: typeof taggedHash; - /** @deprecated use `randomSecretKey` */ - randomPrivateKey: (seed?: Uint8Array) => Uint8Array; - /** @deprecated use `utils` */ - numberToBytesBE: typeof numberToBytesBE; - /** @deprecated use `utils` */ - bytesToNumberBE: typeof bytesToNumberBE; - /** @deprecated use `modular` */ - mod: typeof mod; - }; - lengths: CurveLengths; -}; -/** - * Schnorr signatures over secp256k1. - * https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki - * @example - * ```js - * import { schnorr } from '@noble/curves/secp256k1'; - * const { secretKey, publicKey } = schnorr.keygen(); - * // const publicKey = schnorr.getPublicKey(secretKey); - * const msg = new TextEncoder().encode('hello'); - * const sig = schnorr.sign(msg, secretKey); - * const isValid = schnorr.verify(sig, msg, publicKey); - * ``` - */ -export declare const schnorr: SecpSchnorr; -/** Hashing / encoding to secp256k1 points / field. RFC 9380 methods. */ -export declare const secp256k1_hasher: H2CHasher; -/** @deprecated use `import { secp256k1_hasher } from '@noble/curves/secp256k1.js';` */ -export declare const hashToCurve: H2CMethod; -/** @deprecated use `import { secp256k1_hasher } from '@noble/curves/secp256k1.js';` */ -export declare const encodeToCurve: H2CMethod; -export {}; -//# sourceMappingURL=secp256k1.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/secp256k1.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/secp256k1.d.ts.map deleted file mode 100644 index 86739816..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/secp256k1.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"secp256k1.d.ts","sourceRoot":"","sources":["../src/secp256k1.ts"],"names":[],"mappings":"AAUA,OAAO,EAAe,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,SAAS,EAEf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAyB,GAAG,EAAQ,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAIL,KAAK,gBAAgB,IAAI,SAAS,EAElC,KAAK,oBAAoB,EAC1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC/C,OAA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C,IAAI,CAAC,EAAE,UAAU,KAAK,UAAU,CAAC;QACpD,8BAA8B;QAC9B,eAAe,EAAE,OAAO,eAAe,CAAC;QACxC,8BAA8B;QAC9B,eAAe,EAAE,OAAO,eAAe,CAAC;QACxC,gCAAgC;QAChC,GAAG,EAAE,OAAO,GAAG,CAAC;KACjB,CAAC;IACF,OAAO,EAAE,YAAY,CAAC;CACvB,CAAC;AACF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,OAAO,EAAE,WAsClB,CAAC;AA0CL,wEAAwE;AACxE,eAAO,MAAM,gBAAgB,EAAE,SAAS,CAAC,MAAM,CAgBzC,CAAC;AAEP,uFAAuF;AACvF,eAAO,MAAM,WAAW,EAAE,SAAS,CAAC,MAAM,CACT,CAAC;AAElC,uFAAuF;AACvF,eAAO,MAAM,aAAa,EAAE,SAAS,CAAC,MAAM,CACT,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/secp256k1.js b/tools/mnemonic-test/node_modules/@noble/curves/esm/secp256k1.js deleted file mode 100644 index e1832835..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/secp256k1.js +++ /dev/null @@ -1,294 +0,0 @@ -/** - * SECG secp256k1. See [pdf](https://www.secg.org/sec2-v2.pdf). - * - * Belongs to Koblitz curves: it has efficiently-computable GLV endomorphism ψ, - * check out {@link EndomorphismOpts}. Seems to be rigid (not backdoored). - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { sha256 } from '@noble/hashes/sha2.js'; -import { randomBytes } from '@noble/hashes/utils.js'; -import { createCurve } from "./_shortw_utils.js"; -import { createHasher, isogenyMap, } from "./abstract/hash-to-curve.js"; -import { Field, mapHashToField, mod, pow2 } from "./abstract/modular.js"; -import { _normFnElement, mapToCurveSimpleSWU, } from "./abstract/weierstrass.js"; -import { bytesToNumberBE, concatBytes, ensureBytes, inRange, numberToBytesBE, utf8ToBytes, } from "./utils.js"; -// Seems like generator was produced from some seed: -// `Point.BASE.multiply(Point.Fn.inv(2n, N)).toAffine().x` -// // gives short x 0x3b78ce563f89a0ed9414f5aa28ad0d96d6795f9c63n -const secp256k1_CURVE = { - p: BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f'), - n: BigInt('0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141'), - h: BigInt(1), - a: BigInt(0), - b: BigInt(7), - Gx: BigInt('0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798'), - Gy: BigInt('0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8'), -}; -const secp256k1_ENDO = { - beta: BigInt('0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee'), - basises: [ - [BigInt('0x3086d221a7d46bcde86c90e49284eb15'), -BigInt('0xe4437ed6010e88286f547fa90abfe4c3')], - [BigInt('0x114ca50f7a8e2f3f657c1108d9d44cfd8'), BigInt('0x3086d221a7d46bcde86c90e49284eb15')], - ], -}; -const _0n = /* @__PURE__ */ BigInt(0); -const _1n = /* @__PURE__ */ BigInt(1); -const _2n = /* @__PURE__ */ BigInt(2); -/** - * √n = n^((p+1)/4) for fields p = 3 mod 4. We unwrap the loop and multiply bit-by-bit. - * (P+1n/4n).toString(2) would produce bits [223x 1, 0, 22x 1, 4x 0, 11, 00] - */ -function sqrtMod(y) { - const P = secp256k1_CURVE.p; - // prettier-ignore - const _3n = BigInt(3), _6n = BigInt(6), _11n = BigInt(11), _22n = BigInt(22); - // prettier-ignore - const _23n = BigInt(23), _44n = BigInt(44), _88n = BigInt(88); - const b2 = (y * y * y) % P; // x^3, 11 - const b3 = (b2 * b2 * y) % P; // x^7 - const b6 = (pow2(b3, _3n, P) * b3) % P; - const b9 = (pow2(b6, _3n, P) * b3) % P; - const b11 = (pow2(b9, _2n, P) * b2) % P; - const b22 = (pow2(b11, _11n, P) * b11) % P; - const b44 = (pow2(b22, _22n, P) * b22) % P; - const b88 = (pow2(b44, _44n, P) * b44) % P; - const b176 = (pow2(b88, _88n, P) * b88) % P; - const b220 = (pow2(b176, _44n, P) * b44) % P; - const b223 = (pow2(b220, _3n, P) * b3) % P; - const t1 = (pow2(b223, _23n, P) * b22) % P; - const t2 = (pow2(t1, _6n, P) * b2) % P; - const root = pow2(t2, _2n, P); - if (!Fpk1.eql(Fpk1.sqr(root), y)) - throw new Error('Cannot find square root'); - return root; -} -const Fpk1 = Field(secp256k1_CURVE.p, { sqrt: sqrtMod }); -/** - * secp256k1 curve, ECDSA and ECDH methods. - * - * Field: `2n**256n - 2n**32n - 2n**9n - 2n**8n - 2n**7n - 2n**6n - 2n**4n - 1n` - * - * @example - * ```js - * import { secp256k1 } from '@noble/curves/secp256k1'; - * const { secretKey, publicKey } = secp256k1.keygen(); - * const msg = new TextEncoder().encode('hello'); - * const sig = secp256k1.sign(msg, secretKey); - * const isValid = secp256k1.verify(sig, msg, publicKey) === true; - * ``` - */ -export const secp256k1 = createCurve({ ...secp256k1_CURVE, Fp: Fpk1, lowS: true, endo: secp256k1_ENDO }, sha256); -// Schnorr signatures are superior to ECDSA from above. Below is Schnorr-specific BIP0340 code. -// https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki -/** An object mapping tags to their tagged hash prefix of [SHA256(tag) | SHA256(tag)] */ -const TAGGED_HASH_PREFIXES = {}; -function taggedHash(tag, ...messages) { - let tagP = TAGGED_HASH_PREFIXES[tag]; - if (tagP === undefined) { - const tagH = sha256(utf8ToBytes(tag)); - tagP = concatBytes(tagH, tagH); - TAGGED_HASH_PREFIXES[tag] = tagP; - } - return sha256(concatBytes(tagP, ...messages)); -} -// ECDSA compact points are 33-byte. Schnorr is 32: we strip first byte 0x02 or 0x03 -const pointToBytes = (point) => point.toBytes(true).slice(1); -const Pointk1 = /* @__PURE__ */ (() => secp256k1.Point)(); -const hasEven = (y) => y % _2n === _0n; -// Calculate point, scalar and bytes -function schnorrGetExtPubKey(priv) { - const { Fn, BASE } = Pointk1; - const d_ = _normFnElement(Fn, priv); - const p = BASE.multiply(d_); // P = d'⋅G; 0 < d' < n check is done inside - const scalar = hasEven(p.y) ? d_ : Fn.neg(d_); - return { scalar, bytes: pointToBytes(p) }; -} -/** - * lift_x from BIP340. Convert 32-byte x coordinate to elliptic curve point. - * @returns valid point checked for being on-curve - */ -function lift_x(x) { - const Fp = Fpk1; - if (!Fp.isValidNot0(x)) - throw new Error('invalid x: Fail if x ≥ p'); - const xx = Fp.create(x * x); - const c = Fp.create(xx * x + BigInt(7)); // Let c = x³ + 7 mod p. - let y = Fp.sqrt(c); // Let y = c^(p+1)/4 mod p. Same as sqrt(). - // Return the unique point P such that x(P) = x and - // y(P) = y if y mod 2 = 0 or y(P) = p-y otherwise. - if (!hasEven(y)) - y = Fp.neg(y); - const p = Pointk1.fromAffine({ x, y }); - p.assertValidity(); - return p; -} -const num = bytesToNumberBE; -/** - * Create tagged hash, convert it to bigint, reduce modulo-n. - */ -function challenge(...args) { - return Pointk1.Fn.create(num(taggedHash('BIP0340/challenge', ...args))); -} -/** - * Schnorr public key is just `x` coordinate of Point as per BIP340. - */ -function schnorrGetPublicKey(secretKey) { - return schnorrGetExtPubKey(secretKey).bytes; // d'=int(sk). Fail if d'=0 or d'≥n. Ret bytes(d'⋅G) -} -/** - * Creates Schnorr signature as per BIP340. Verifies itself before returning anything. - * auxRand is optional and is not the sole source of k generation: bad CSPRNG won't be dangerous. - */ -function schnorrSign(message, secretKey, auxRand = randomBytes(32)) { - const { Fn } = Pointk1; - const m = ensureBytes('message', message); - const { bytes: px, scalar: d } = schnorrGetExtPubKey(secretKey); // checks for isWithinCurveOrder - const a = ensureBytes('auxRand', auxRand, 32); // Auxiliary random data a: a 32-byte array - const t = Fn.toBytes(d ^ num(taggedHash('BIP0340/aux', a))); // Let t be the byte-wise xor of bytes(d) and hash/aux(a) - const rand = taggedHash('BIP0340/nonce', t, px, m); // Let rand = hash/nonce(t || bytes(P) || m) - // Let k' = int(rand) mod n. Fail if k' = 0. Let R = k'⋅G - const { bytes: rx, scalar: k } = schnorrGetExtPubKey(rand); - const e = challenge(rx, px, m); // Let e = int(hash/challenge(bytes(R) || bytes(P) || m)) mod n. - const sig = new Uint8Array(64); // Let sig = bytes(R) || bytes((k + ed) mod n). - sig.set(rx, 0); - sig.set(Fn.toBytes(Fn.create(k + e * d)), 32); - // If Verify(bytes(P), m, sig) (see below) returns failure, abort - if (!schnorrVerify(sig, m, px)) - throw new Error('sign: Invalid signature produced'); - return sig; -} -/** - * Verifies Schnorr signature. - * Will swallow errors & return false except for initial type validation of arguments. - */ -function schnorrVerify(signature, message, publicKey) { - const { Fn, BASE } = Pointk1; - const sig = ensureBytes('signature', signature, 64); - const m = ensureBytes('message', message); - const pub = ensureBytes('publicKey', publicKey, 32); - try { - const P = lift_x(num(pub)); // P = lift_x(int(pk)); fail if that fails - const r = num(sig.subarray(0, 32)); // Let r = int(sig[0:32]); fail if r ≥ p. - if (!inRange(r, _1n, secp256k1_CURVE.p)) - return false; - const s = num(sig.subarray(32, 64)); // Let s = int(sig[32:64]); fail if s ≥ n. - if (!inRange(s, _1n, secp256k1_CURVE.n)) - return false; - // int(challenge(bytes(r)||bytes(P)||m))%n - const e = challenge(Fn.toBytes(r), pointToBytes(P), m); - // R = s⋅G - e⋅P, where -eP == (n-e)P - const R = BASE.multiplyUnsafe(s).add(P.multiplyUnsafe(Fn.neg(e))); - const { x, y } = R.toAffine(); - // Fail if is_infinite(R) / not has_even_y(R) / x(R) ≠ r. - if (R.is0() || !hasEven(y) || x !== r) - return false; - return true; - } - catch (error) { - return false; - } -} -/** - * Schnorr signatures over secp256k1. - * https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki - * @example - * ```js - * import { schnorr } from '@noble/curves/secp256k1'; - * const { secretKey, publicKey } = schnorr.keygen(); - * // const publicKey = schnorr.getPublicKey(secretKey); - * const msg = new TextEncoder().encode('hello'); - * const sig = schnorr.sign(msg, secretKey); - * const isValid = schnorr.verify(sig, msg, publicKey); - * ``` - */ -export const schnorr = /* @__PURE__ */ (() => { - const size = 32; - const seedLength = 48; - const randomSecretKey = (seed = randomBytes(seedLength)) => { - return mapHashToField(seed, secp256k1_CURVE.n); - }; - // TODO: remove - secp256k1.utils.randomSecretKey; - function keygen(seed) { - const secretKey = randomSecretKey(seed); - return { secretKey, publicKey: schnorrGetPublicKey(secretKey) }; - } - return { - keygen, - getPublicKey: schnorrGetPublicKey, - sign: schnorrSign, - verify: schnorrVerify, - Point: Pointk1, - utils: { - randomSecretKey: randomSecretKey, - randomPrivateKey: randomSecretKey, - taggedHash, - // TODO: remove - lift_x, - pointToBytes, - numberToBytesBE, - bytesToNumberBE, - mod, - }, - lengths: { - secretKey: size, - publicKey: size, - publicKeyHasPrefix: false, - signature: size * 2, - seed: seedLength, - }, - }; -})(); -const isoMap = /* @__PURE__ */ (() => isogenyMap(Fpk1, [ - // xNum - [ - '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7', - '0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581', - '0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262', - '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c', - ], - // xDen - [ - '0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b', - '0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14', - '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1 - ], - // yNum - [ - '0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c', - '0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3', - '0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931', - '0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84', - ], - // yDen - [ - '0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b', - '0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573', - '0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f', - '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1 - ], -].map((i) => i.map((j) => BigInt(j)))))(); -const mapSWU = /* @__PURE__ */ (() => mapToCurveSimpleSWU(Fpk1, { - A: BigInt('0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533'), - B: BigInt('1771'), - Z: Fpk1.create(BigInt('-11')), -}))(); -/** Hashing / encoding to secp256k1 points / field. RFC 9380 methods. */ -export const secp256k1_hasher = /* @__PURE__ */ (() => createHasher(secp256k1.Point, (scalars) => { - const { x, y } = mapSWU(Fpk1.create(scalars[0])); - return isoMap(x, y); -}, { - DST: 'secp256k1_XMD:SHA-256_SSWU_RO_', - encodeDST: 'secp256k1_XMD:SHA-256_SSWU_NU_', - p: Fpk1.ORDER, - m: 1, - k: 128, - expand: 'xmd', - hash: sha256, -}))(); -/** @deprecated use `import { secp256k1_hasher } from '@noble/curves/secp256k1.js';` */ -export const hashToCurve = /* @__PURE__ */ (() => secp256k1_hasher.hashToCurve)(); -/** @deprecated use `import { secp256k1_hasher } from '@noble/curves/secp256k1.js';` */ -export const encodeToCurve = /* @__PURE__ */ (() => secp256k1_hasher.encodeToCurve)(); -//# sourceMappingURL=secp256k1.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/secp256k1.js.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/secp256k1.js.map deleted file mode 100644 index 21eecd01..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/secp256k1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"secp256k1.js","sourceRoot":"","sources":["../src/secp256k1.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,sEAAsE;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAu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,EAAE,CAAC,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACjD,OAAO,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACtB,CAAC,EACD;IACE,GAAG,EAAE,gCAAgC;IACrC,SAAS,EAAE,gCAAgC;IAC3C,CAAC,EAAE,IAAI,CAAC,KAAK;IACb,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,GAAG;IACN,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,MAAM;CACb,CACF,CAAC,EAAE,CAAC;AAEP,uFAAuF;AACvF,MAAM,CAAC,MAAM,WAAW,GAAsB,eAAe,CAAC,CAAC,GAAG,EAAE,CAClE,gBAAgB,CAAC,WAAW,CAAC,EAAE,CAAC;AAElC,uFAAuF;AACvF,MAAM,CAAC,MAAM,aAAa,GAAsB,eAAe,CAAC,CAAC,GAAG,EAAE,CACpE,gBAAgB,CAAC,aAAa,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/utils.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/esm/utils.d.ts deleted file mode 100644 index ebb36df9..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/utils.d.ts +++ /dev/null @@ -1,110 +0,0 @@ -export { abytes, anumber, bytesToHex, bytesToUtf8, concatBytes, hexToBytes, isBytes, randomBytes, utf8ToBytes, } from '@noble/hashes/utils.js'; -export type Hex = Uint8Array | string; -export type PrivKey = Hex | bigint; -export type CHash = { - (message: Uint8Array | string): Uint8Array; - blockLen: number; - outputLen: number; - create(opts?: { - dkLen?: number; - }): any; -}; -export type FHash = (message: Uint8Array | string) => Uint8Array; -export declare function abool(title: string, value: boolean): void; -export declare function _abool2(value: boolean, title?: string): boolean; -/** Asserts something is Uint8Array. */ -export declare function _abytes2(value: Uint8Array, length?: number, title?: string): Uint8Array; -export declare function numberToHexUnpadded(num: number | bigint): string; -export declare function hexToNumber(hex: string): bigint; -export declare function bytesToNumberBE(bytes: Uint8Array): bigint; -export declare function bytesToNumberLE(bytes: Uint8Array): bigint; -export declare function numberToBytesBE(n: number | bigint, len: number): Uint8Array; -export declare function numberToBytesLE(n: number | bigint, len: number): Uint8Array; -export declare function numberToVarBytesBE(n: number | bigint): Uint8Array; -/** - * Takes hex string or Uint8Array, converts to Uint8Array. - * Validates output length. - * Will throw error for other types. - * @param title descriptive title for an error e.g. 'secret key' - * @param hex hex string or Uint8Array - * @param expectedLength optional, will compare to result array's length - * @returns - */ -export declare function ensureBytes(title: string, hex: Hex, expectedLength?: number): Uint8Array; -export declare function equalBytes(a: Uint8Array, b: Uint8Array): boolean; -/** - * Copies Uint8Array. We can't use u8a.slice(), because u8a can be Buffer, - * and Buffer#slice creates mutable copy. Never use Buffers! - */ -export declare function copyBytes(bytes: Uint8Array): Uint8Array; -/** - * Decodes 7-bit ASCII string to Uint8Array, throws on non-ascii symbols - * Should be safe to use for things expected to be ASCII. - * Returns exact same result as utf8ToBytes for ASCII or throws. - */ -export declare function asciiToBytes(ascii: string): Uint8Array; -export declare function inRange(n: bigint, min: bigint, max: bigint): boolean; -/** - * Asserts min <= n < max. NOTE: It's < max and not <= max. - * @example - * aInRange('x', x, 1n, 256n); // would assume x is in (1n..255n) - */ -export declare function aInRange(title: string, n: bigint, min: bigint, max: bigint): void; -/** - * Calculates amount of bits in a bigint. - * Same as `n.toString(2).length` - * TODO: merge with nLength in modular - */ -export declare function bitLen(n: bigint): number; -/** - * Gets single bit at position. - * NOTE: first bit position is 0 (same as arrays) - * Same as `!!+Array.from(n.toString(2)).reverse()[pos]` - */ -export declare function bitGet(n: bigint, pos: number): bigint; -/** - * Sets single bit at position. - */ -export declare function bitSet(n: bigint, pos: number, value: boolean): bigint; -/** - * Calculate mask for N bits. Not using ** operator with bigints because of old engines. - * Same as BigInt(`0b${Array(i).fill('1').join('')}`) - */ -export declare const bitMask: (n: number) => bigint; -type Pred = (v: Uint8Array) => T | undefined; -/** - * Minimal HMAC-DRBG from NIST 800-90 for RFC6979 sigs. - * @returns function that will call DRBG until 2nd arg returns something meaningful - * @example - * const drbg = createHmacDRBG(32, 32, hmac); - * drbg(seed, bytesToKey); // bytesToKey must return Key or undefined - */ -export declare function createHmacDrbg(hashLen: number, qByteLen: number, hmacFn: (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array): (seed: Uint8Array, predicate: Pred) => T; -declare const validatorFns: { - readonly bigint: (val: any) => boolean; - readonly function: (val: any) => boolean; - readonly boolean: (val: any) => boolean; - readonly string: (val: any) => boolean; - readonly stringOrUint8Array: (val: any) => boolean; - readonly isSafeInteger: (val: any) => boolean; - readonly array: (val: any) => boolean; - readonly field: (val: any, object: any) => any; - readonly hash: (val: any) => boolean; -}; -type Validator = keyof typeof validatorFns; -type ValMap> = { - [K in keyof T]?: Validator; -}; -export declare function validateObject>(object: T, validators: ValMap, optValidators?: ValMap): T; -export declare function isHash(val: CHash): boolean; -export declare function _validateObject(object: Record, fields: Record, optFields?: Record): void; -/** - * throws not implemented error - */ -export declare const notImplemented: () => never; -/** - * Memoizes (caches) computation result. - * Uses WeakMap: the value is going auto-cleaned by GC after last reference is removed. - */ -export declare function memoized(fn: (arg: T, ...args: O) => R): (arg: T, ...args: O) => R; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/utils.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/utils.d.ts.map deleted file mode 100644 index 91551a79..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,MAAM,EACN,OAAO,EACP,UAAU,EACV,WAAW,EACX,WAAW,EACX,UAAU,EACV,OAAO,EACP,WAAW,EACX,WAAW,GACZ,MAAM,wBAAwB,CAAC;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wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAAC,SAAS,GAAG,EAAE,EAC3D,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,GAC5B,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,CAS3B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/utils.js b/tools/mnemonic-test/node_modules/@noble/curves/esm/utils.js deleted file mode 100644 index e543787f..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/utils.js +++ /dev/null @@ -1,322 +0,0 @@ -/** - * Hex, bytes and number utilities. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { abytes as abytes_, bytesToHex as bytesToHex_, concatBytes as concatBytes_, hexToBytes as hexToBytes_, isBytes as isBytes_, } from '@noble/hashes/utils.js'; -export { abytes, anumber, bytesToHex, bytesToUtf8, concatBytes, hexToBytes, isBytes, randomBytes, utf8ToBytes, } from '@noble/hashes/utils.js'; -const _0n = /* @__PURE__ */ BigInt(0); -const _1n = /* @__PURE__ */ BigInt(1); -export function abool(title, value) { - if (typeof value !== 'boolean') - throw new Error(title + ' boolean expected, got ' + value); -} -// tmp name until v2 -export function _abool2(value, title = '') { - if (typeof value !== 'boolean') { - const prefix = title && `"${title}"`; - throw new Error(prefix + 'expected boolean, got type=' + typeof value); - } - return value; -} -// tmp name until v2 -/** Asserts something is Uint8Array. */ -export function _abytes2(value, length, title = '') { - const bytes = isBytes_(value); - const len = value?.length; - const needsLen = length !== undefined; - if (!bytes || (needsLen && len !== length)) { - const prefix = title && `"${title}" `; - const ofLen = needsLen ? ` of length ${length}` : ''; - const got = bytes ? `length=${len}` : `type=${typeof value}`; - throw new Error(prefix + 'expected Uint8Array' + ofLen + ', got ' + got); - } - return value; -} -// Used in weierstrass, der -export function numberToHexUnpadded(num) { - const hex = num.toString(16); - return hex.length & 1 ? '0' + hex : hex; -} -export function hexToNumber(hex) { - if (typeof hex !== 'string') - throw new Error('hex string expected, got ' + typeof hex); - return hex === '' ? _0n : BigInt('0x' + hex); // Big Endian -} -// BE: Big Endian, LE: Little Endian -export function bytesToNumberBE(bytes) { - return hexToNumber(bytesToHex_(bytes)); -} -export function bytesToNumberLE(bytes) { - abytes_(bytes); - return hexToNumber(bytesToHex_(Uint8Array.from(bytes).reverse())); -} -export function numberToBytesBE(n, len) { - return hexToBytes_(n.toString(16).padStart(len * 2, '0')); -} -export function numberToBytesLE(n, len) { - return numberToBytesBE(n, len).reverse(); -} -// Unpadded, rarely used -export function numberToVarBytesBE(n) { - return hexToBytes_(numberToHexUnpadded(n)); -} -/** - * Takes hex string or Uint8Array, converts to Uint8Array. - * Validates output length. - * Will throw error for other types. - * @param title descriptive title for an error e.g. 'secret key' - * @param hex hex string or Uint8Array - * @param expectedLength optional, will compare to result array's length - * @returns - */ -export function ensureBytes(title, hex, expectedLength) { - let res; - if (typeof hex === 'string') { - try { - res = hexToBytes_(hex); - } - catch (e) { - throw new Error(title + ' must be hex string or Uint8Array, cause: ' + e); - } - } - else if (isBytes_(hex)) { - // Uint8Array.from() instead of hash.slice() because node.js Buffer - // is instance of Uint8Array, and its slice() creates **mutable** copy - res = Uint8Array.from(hex); - } - else { - throw new Error(title + ' must be hex string or Uint8Array'); - } - const len = res.length; - if (typeof expectedLength === 'number' && len !== expectedLength) - throw new Error(title + ' of length ' + expectedLength + ' expected, got ' + len); - return res; -} -// Compares 2 u8a-s in kinda constant time -export function equalBytes(a, b) { - if (a.length !== b.length) - return false; - let diff = 0; - for (let i = 0; i < a.length; i++) - diff |= a[i] ^ b[i]; - return diff === 0; -} -/** - * Copies Uint8Array. We can't use u8a.slice(), because u8a can be Buffer, - * and Buffer#slice creates mutable copy. Never use Buffers! - */ -export function copyBytes(bytes) { - return Uint8Array.from(bytes); -} -/** - * Decodes 7-bit ASCII string to Uint8Array, throws on non-ascii symbols - * Should be safe to use for things expected to be ASCII. - * Returns exact same result as utf8ToBytes for ASCII or throws. - */ -export function asciiToBytes(ascii) { - return Uint8Array.from(ascii, (c, i) => { - const charCode = c.charCodeAt(0); - if (c.length !== 1 || charCode > 127) { - throw new Error(`string contains non-ASCII character "${ascii[i]}" with code ${charCode} at position ${i}`); - } - return charCode; - }); -} -/** - * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99]) - */ -// export const utf8ToBytes: typeof utf8ToBytes_ = utf8ToBytes_; -/** - * Converts bytes to string using UTF8 encoding. - * @example bytesToUtf8(Uint8Array.from([97, 98, 99])) // 'abc' - */ -// export const bytesToUtf8: typeof bytesToUtf8_ = bytesToUtf8_; -// Is positive bigint -const isPosBig = (n) => typeof n === 'bigint' && _0n <= n; -export function inRange(n, min, max) { - return isPosBig(n) && isPosBig(min) && isPosBig(max) && min <= n && n < max; -} -/** - * Asserts min <= n < max. NOTE: It's < max and not <= max. - * @example - * aInRange('x', x, 1n, 256n); // would assume x is in (1n..255n) - */ -export function aInRange(title, n, min, max) { - // Why min <= n < max and not a (min < n < max) OR b (min <= n <= max)? - // consider P=256n, min=0n, max=P - // - a for min=0 would require -1: `inRange('x', x, -1n, P)` - // - b would commonly require subtraction: `inRange('x', x, 0n, P - 1n)` - // - our way is the cleanest: `inRange('x', x, 0n, P) - if (!inRange(n, min, max)) - throw new Error('expected valid ' + title + ': ' + min + ' <= n < ' + max + ', got ' + n); -} -// Bit operations -/** - * Calculates amount of bits in a bigint. - * Same as `n.toString(2).length` - * TODO: merge with nLength in modular - */ -export function bitLen(n) { - let len; - for (len = 0; n > _0n; n >>= _1n, len += 1) - ; - return len; -} -/** - * Gets single bit at position. - * NOTE: first bit position is 0 (same as arrays) - * Same as `!!+Array.from(n.toString(2)).reverse()[pos]` - */ -export function bitGet(n, pos) { - return (n >> BigInt(pos)) & _1n; -} -/** - * Sets single bit at position. - */ -export function bitSet(n, pos, value) { - return n | ((value ? _1n : _0n) << BigInt(pos)); -} -/** - * Calculate mask for N bits. Not using ** operator with bigints because of old engines. - * Same as BigInt(`0b${Array(i).fill('1').join('')}`) - */ -export const bitMask = (n) => (_1n << BigInt(n)) - _1n; -/** - * Minimal HMAC-DRBG from NIST 800-90 for RFC6979 sigs. - * @returns function that will call DRBG until 2nd arg returns something meaningful - * @example - * const drbg = createHmacDRBG(32, 32, hmac); - * drbg(seed, bytesToKey); // bytesToKey must return Key or undefined - */ -export function createHmacDrbg(hashLen, qByteLen, hmacFn) { - if (typeof hashLen !== 'number' || hashLen < 2) - throw new Error('hashLen must be a number'); - if (typeof qByteLen !== 'number' || qByteLen < 2) - throw new Error('qByteLen must be a number'); - if (typeof hmacFn !== 'function') - throw new Error('hmacFn must be a function'); - // Step B, Step C: set hashLen to 8*ceil(hlen/8) - const u8n = (len) => new Uint8Array(len); // creates Uint8Array - const u8of = (byte) => Uint8Array.of(byte); // another shortcut - let v = u8n(hashLen); // Minimal non-full-spec HMAC-DRBG from NIST 800-90 for RFC6979 sigs. - let k = u8n(hashLen); // Steps B and C of RFC6979 3.2: set hashLen, in our case always same - let i = 0; // Iterations counter, will throw when over 1000 - const reset = () => { - v.fill(1); - k.fill(0); - i = 0; - }; - const h = (...b) => hmacFn(k, v, ...b); // hmac(k)(v, ...values) - const reseed = (seed = u8n(0)) => { - // HMAC-DRBG reseed() function. Steps D-G - k = h(u8of(0x00), seed); // k = hmac(k || v || 0x00 || seed) - v = h(); // v = hmac(k || v) - if (seed.length === 0) - return; - k = h(u8of(0x01), seed); // k = hmac(k || v || 0x01 || seed) - v = h(); // v = hmac(k || v) - }; - const gen = () => { - // HMAC-DRBG generate() function - if (i++ >= 1000) - throw new Error('drbg: tried 1000 values'); - let len = 0; - const out = []; - while (len < qByteLen) { - v = h(); - const sl = v.slice(); - out.push(sl); - len += v.length; - } - return concatBytes_(...out); - }; - const genUntil = (seed, pred) => { - reset(); - reseed(seed); // Steps D-G - let res = undefined; // Step H: grind until k is in [1..n-1] - while (!(res = pred(gen()))) - reseed(); - reset(); - return res; - }; - return genUntil; -} -// Validating curves and fields -const validatorFns = { - bigint: (val) => typeof val === 'bigint', - function: (val) => typeof val === 'function', - boolean: (val) => typeof val === 'boolean', - string: (val) => typeof val === 'string', - stringOrUint8Array: (val) => typeof val === 'string' || isBytes_(val), - isSafeInteger: (val) => Number.isSafeInteger(val), - array: (val) => Array.isArray(val), - field: (val, object) => object.Fp.isValid(val), - hash: (val) => typeof val === 'function' && Number.isSafeInteger(val.outputLen), -}; -// type Record = { [P in K]: T; } -export function validateObject(object, validators, optValidators = {}) { - const checkField = (fieldName, type, isOptional) => { - const checkVal = validatorFns[type]; - if (typeof checkVal !== 'function') - throw new Error('invalid validator function'); - const val = object[fieldName]; - if (isOptional && val === undefined) - return; - if (!checkVal(val, object)) { - throw new Error('param ' + String(fieldName) + ' is invalid. Expected ' + type + ', got ' + val); - } - }; - for (const [fieldName, type] of Object.entries(validators)) - checkField(fieldName, type, false); - for (const [fieldName, type] of Object.entries(optValidators)) - checkField(fieldName, type, true); - return object; -} -// validate type tests -// const o: { a: number; b: number; c: number } = { a: 1, b: 5, c: 6 }; -// const z0 = validateObject(o, { a: 'isSafeInteger' }, { c: 'bigint' }); // Ok! -// // Should fail type-check -// const z1 = validateObject(o, { a: 'tmp' }, { c: 'zz' }); -// const z2 = validateObject(o, { a: 'isSafeInteger' }, { c: 'zz' }); -// const z3 = validateObject(o, { test: 'boolean', z: 'bug' }); -// const z4 = validateObject(o, { a: 'boolean', z: 'bug' }); -export function isHash(val) { - return typeof val === 'function' && Number.isSafeInteger(val.outputLen); -} -export function _validateObject(object, fields, optFields = {}) { - if (!object || typeof object !== 'object') - throw new Error('expected valid options object'); - function checkField(fieldName, expectedType, isOpt) { - const val = object[fieldName]; - if (isOpt && val === undefined) - return; - const current = typeof val; - if (current !== expectedType || val === null) - throw new Error(`param "${fieldName}" is invalid: expected ${expectedType}, got ${current}`); - } - Object.entries(fields).forEach(([k, v]) => checkField(k, v, false)); - Object.entries(optFields).forEach(([k, v]) => checkField(k, v, true)); -} -/** - * throws not implemented error - */ -export const notImplemented = () => { - throw new Error('not implemented'); -}; -/** - * Memoizes (caches) computation result. - * Uses WeakMap: the value is going auto-cleaned by GC after last reference is removed. - */ -export function memoized(fn) { - const map = new WeakMap(); - return (arg, ...args) => { - const val = map.get(arg); - if (val !== undefined) - return val; - const computed = fn(arg, ...args); - map.set(arg, computed); - return computed; - }; -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/esm/utils.js.map b/tools/mnemonic-test/node_modules/@noble/curves/esm/utils.js.map deleted file mode 100644 index 5588c9c7..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/esm/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,sEAAsE;AACtE,OAAO,EACL,MAAM,IAAI,OAAO,EACjB,UAAU,IAAI,WAAW,EACzB,WAAW,IAAI,YAAY,EAC3B,UAAU,IAAI,WAAW,EACzB,OAAO,IAAI,QAAQ,GACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,MAAM,EACN,OAAO,EACP,UAAU,EACV,WAAW,EACX,WAAW,EACX,UAAU,EACV,OAAO,EACP,WAAW,EACX,WAAW,GACZ,MAAM,wBAAwB,CAAC;AAChC,MAAM,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACtC,MAAM,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAWtC,MAAM,UAAU,KAAK,CAAC,KAAa,EAAE,KAAc;IACjD,IAAI,OAAO,KAAK,KAAK,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,KAAK,GAAG,yBAAyB,GAAG,KAAK,CAAC,CAAC;AAC7F,CAAC;AAED,oBAAoB;AACpB,MAAM,UAAU,OAAO,CAAC,KAAc,EAAE,QA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AAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AACxE,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,GAAU,EAAE;IACxC,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;AACrC,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,QAAQ,CACtB,EAA6B;IAE7B,MAAM,GAAG,GAAG,IAAI,OAAO,EAAQ,CAAC;IAChC,OAAO,CAAC,GAAM,EAAE,GAAG,IAAO,EAAK,EAAE;QAC/B,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACzB,IAAI,GAAG,KAAK,SAAS;YAAE,OAAO,GAAG,CAAC;QAClC,MAAM,QAAQ,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;QAClC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QACvB,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/index.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/index.d.ts deleted file mode 100644 index f36479a7..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/index.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/index.d.ts.map deleted file mode 100644 index 4e8c5816..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/index.js b/tools/mnemonic-test/node_modules/@noble/curves/index.js deleted file mode 100644 index 6aa9a671..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/index.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -/** - * Audited & minimal JS implementation of elliptic curve cryptography. - * @module - * @example -```js -import { secp256k1, schnorr } from '@noble/curves/secp256k1.js'; -import { ed25519, ed25519ph, ed25519ctx, x25519, RistrettoPoint } from '@noble/curves/ed25519.js'; -import { ed448, ed448ph, ed448ctx, x448 } from '@noble/curves/ed448.js'; -import { p256, p384, p521 } from '@noble/curves/nist.js'; -import { bls12_381 } from '@noble/curves/bls12-381.js'; -import { bn254 } from '@noble/curves/bn254.js'; -import { bytesToHex, hexToBytes, concatBytes, utf8ToBytes } from '@noble/curves/abstract/utils.js'; -``` - */ -throw new Error('root module cannot be imported: import submodules instead. Check out README'); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/index.js.map b/tools/mnemonic-test/node_modules/@noble/curves/index.js.map deleted file mode 100644 index 90dfbf81..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,IAAI,KAAK,CAAC,6EAA6E,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/jubjub.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/jubjub.d.ts deleted file mode 100644 index 11ebd199..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/jubjub.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * @deprecated - * @module - */ -import { jubjub_findGroupHash, jubjub_groupHash, jubjub as jubjubn } from './misc.ts'; -/** @deprecated use `import { jubjub } from '@noble/curves/misc.js';` */ -export declare const jubjub: typeof jubjubn; -/** @deprecated use `import { jubjub_findGroupHash } from '@noble/curves/misc.js';` */ -export declare const findGroupHash: typeof jubjub_findGroupHash; -/** @deprecated use `import { jubjub_groupHash } from '@noble/curves/misc.js';` */ -export declare const groupHash: typeof jubjub_groupHash; -//# sourceMappingURL=jubjub.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/jubjub.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/jubjub.d.ts.map deleted file mode 100644 index 996228d2..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/jubjub.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"jubjub.d.ts","sourceRoot":"","sources":["src/jubjub.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAEtF,wEAAwE;AACxE,eAAO,MAAM,MAAM,EAAE,OAAO,OAAiB,CAAC;AAC9C,sFAAsF;AACtF,eAAO,MAAM,aAAa,EAAE,OAAO,oBAA2C,CAAC;AAC/E,kFAAkF;AAClF,eAAO,MAAM,SAAS,EAAE,OAAO,gBAAmC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/jubjub.js b/tools/mnemonic-test/node_modules/@noble/curves/jubjub.js deleted file mode 100644 index 70d69557..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/jubjub.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.groupHash = exports.findGroupHash = exports.jubjub = void 0; -/** - * @deprecated - * @module - */ -const misc_ts_1 = require("./misc.js"); -/** @deprecated use `import { jubjub } from '@noble/curves/misc.js';` */ -exports.jubjub = misc_ts_1.jubjub; -/** @deprecated use `import { jubjub_findGroupHash } from '@noble/curves/misc.js';` */ -exports.findGroupHash = misc_ts_1.jubjub_findGroupHash; -/** @deprecated use `import { jubjub_groupHash } from '@noble/curves/misc.js';` */ -exports.groupHash = misc_ts_1.jubjub_groupHash; -//# sourceMappingURL=jubjub.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/jubjub.js.map b/tools/mnemonic-test/node_modules/@noble/curves/jubjub.js.map deleted file mode 100644 index 8f9e021b..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/jubjub.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"jubjub.js","sourceRoot":"","sources":["src/jubjub.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAAsF;AAEtF,wEAAwE;AAC3D,QAAA,MAAM,GAAmB,gBAAO,CAAC;AAC9C,sFAAsF;AACzE,QAAA,aAAa,GAAgC,8BAAoB,CAAC;AAC/E,kFAAkF;AACrE,QAAA,SAAS,GAA4B,0BAAgB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/misc.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/misc.d.ts deleted file mode 100644 index 165e3374..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/misc.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { type CurveFn, type EdwardsPoint } from './abstract/edwards.ts'; -import { type CurveFn as WCurveFn } from './abstract/weierstrass.ts'; -/** Curve over scalar field of bls12-381. jubjub Fp = bls n */ -export declare const jubjub: CurveFn; -/** Curve over scalar field of bn254. babyjubjub Fp = bn254 n */ -export declare const babyjubjub: CurveFn; -export declare function jubjub_groupHash(tag: Uint8Array, personalization: Uint8Array): EdwardsPoint; -export declare function jubjub_findGroupHash(m: Uint8Array, personalization: Uint8Array): EdwardsPoint; -export declare const pasta_p: bigint; -export declare const pasta_q: bigint; -/** - * @deprecated - */ -export declare const pallas: WCurveFn; -/** - * @deprecated - */ -export declare const vesta: WCurveFn; -//# sourceMappingURL=misc.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/misc.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/misc.d.ts.map deleted file mode 100644 index e18cdb50..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/misc.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["src/misc.ts"],"names":[],"mappings":"AAUA,OAAO,EAEL,KAAK,OAAO,EAEZ,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAe,KAAK,OAAO,IAAI,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAgBlF,8DAA8D;AAC9D,eAAO,MAAM,MAAM,EAAE,OAInB,CAAC;AAWH,gEAAgE;AAChE,eAAO,MAAM,UAAU,EAAE,OAIvB,CAAC;AAOH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,GAAG,YAAY,CAU3F;AAKD,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,GAAG,YAAY,CAW7F;AAID,eAAO,MAAM,OAAO,EAAE,MAErB,CAAC;AACF,eAAO,MAAM,OAAO,EAAE,MAErB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,MAAM,EAAE,QASnB,CAAC;AACH;;GAEG;AACH,eAAO,MAAM,KAAK,EAAE,QASlB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/misc.js b/tools/mnemonic-test/node_modules/@noble/curves/misc.js deleted file mode 100644 index e4c1ee6d..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/misc.js +++ /dev/null @@ -1,114 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.vesta = exports.pallas = exports.pasta_q = exports.pasta_p = exports.babyjubjub = exports.jubjub = void 0; -exports.jubjub_groupHash = jubjub_groupHash; -exports.jubjub_findGroupHash = jubjub_findGroupHash; -/** - * Miscellaneous, rarely used curves. - * jubjub, babyjubjub, pallas, vesta. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const blake1_js_1 = require("@noble/hashes/blake1.js"); -const blake2_js_1 = require("@noble/hashes/blake2.js"); -const sha2_js_1 = require("@noble/hashes/sha2.js"); -const utils_js_1 = require("@noble/hashes/utils.js"); -const edwards_ts_1 = require("./abstract/edwards.js"); -const modular_ts_1 = require("./abstract/modular.js"); -const weierstrass_ts_1 = require("./abstract/weierstrass.js"); -const bls12_381_ts_1 = require("./bls12-381.js"); -const bn254_ts_1 = require("./bn254.js"); -// Jubjub curves have 𝔽p over scalar fields of other curves. They are friendly to ZK proofs. -// jubjub Fp = bls n. babyjubjub Fp = bn254 n. -// verify manually, check bls12-381.ts and bn254.ts. -const jubjub_CURVE = { - p: bls12_381_ts_1.bls12_381_Fr.ORDER, - n: BigInt('0xe7db4ea6533afa906673b0101343b00a6682093ccc81082d0970e5ed6f72cb7'), - h: BigInt(8), - a: BigInt('0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000000'), - d: BigInt('0x2a9318e74bfa2b48f5fd9207e6bd7fd4292d7f6d37579d2601065fd6d6343eb1'), - Gx: BigInt('0x11dafe5d23e1218086a365b99fbf3d3be72f6afd7d1f72623e6b071492d1122b'), - Gy: BigInt('0x1d523cf1ddab1a1793132e78c866c0c33e26ba5cc220fed7cc3f870e59d292aa'), -}; -/** Curve over scalar field of bls12-381. jubjub Fp = bls n */ -exports.jubjub = (0, edwards_ts_1.twistedEdwards)({ - ...jubjub_CURVE, - Fp: bls12_381_ts_1.bls12_381_Fr, - hash: sha2_js_1.sha512, -}); -const babyjubjub_CURVE = { - p: bn254_ts_1.bn254_Fr.ORDER, - n: BigInt('0x30644e72e131a029b85045b68181585d59f76dc1c90770533b94bee1c9093788'), - h: BigInt(8), - a: BigInt('168700'), - d: BigInt('168696'), - Gx: BigInt('0x23343e3445b673d38bcba38f25645adb494b1255b1162bb40f41a59f4d4b45e'), - Gy: BigInt('0xc19139cb84c680a6e14116da06056174a0cfa121e6e5c2450f87d64fc000001'), -}; -/** Curve over scalar field of bn254. babyjubjub Fp = bn254 n */ -exports.babyjubjub = (0, edwards_ts_1.twistedEdwards)({ - ...babyjubjub_CURVE, - Fp: bn254_ts_1.bn254_Fr, - hash: blake1_js_1.blake256, -}); -const jubjub_gh_first_block = (0, utils_js_1.utf8ToBytes)('096b36a5804bfacef1691e173c366a47ff5ba84a44f26ddd7e8d9f79d5b42df0'); -// Returns point at JubJub curve which is prime order and not zero -function jubjub_groupHash(tag, personalization) { - const h = blake2_js_1.blake2s.create({ personalization, dkLen: 32 }); - h.update(jubjub_gh_first_block); - h.update(tag); - // NOTE: returns ExtendedPoint, in case it will be multiplied later - let p = exports.jubjub.Point.fromBytes(h.digest()); - // NOTE: cannot replace with isSmallOrder, returns Point*8 - p = p.multiply(jubjub_CURVE.h); - if (p.equals(exports.jubjub.Point.ZERO)) - throw new Error('Point has small order'); - return p; -} -// No secret data is leaked here at all. -// It operates over public data: -// const G_SPEND = jubjub.findGroupHash(Uint8Array.of(), utf8ToBytes('Item_G_')); -function jubjub_findGroupHash(m, personalization) { - const tag = (0, utils_js_1.concatBytes)(m, Uint8Array.of(0)); - const hashes = []; - for (let i = 0; i < 256; i++) { - tag[tag.length - 1] = i; - try { - hashes.push(jubjub_groupHash(tag, personalization)); - } - catch (e) { } - } - if (!hashes.length) - throw new Error('findGroupHash tag overflow'); - return hashes[0]; -} -// Pasta curves. See [Spec](https://o1-labs.github.io/proof-systems/specs/pasta.html). -exports.pasta_p = BigInt('0x40000000000000000000000000000000224698fc094cf91b992d30ed00000001'); -exports.pasta_q = BigInt('0x40000000000000000000000000000000224698fc0994a8dd8c46eb2100000001'); -/** - * @deprecated - */ -exports.pallas = (0, weierstrass_ts_1.weierstrass)({ - a: BigInt(0), - b: BigInt(5), - Fp: (0, modular_ts_1.Field)(exports.pasta_p), - n: exports.pasta_q, - Gx: (0, modular_ts_1.mod)(BigInt(-1), exports.pasta_p), - Gy: BigInt(2), - h: BigInt(1), - hash: sha2_js_1.sha256, -}); -/** - * @deprecated - */ -exports.vesta = (0, weierstrass_ts_1.weierstrass)({ - a: BigInt(0), - b: BigInt(5), - Fp: (0, modular_ts_1.Field)(exports.pasta_q), - n: exports.pasta_p, - Gx: (0, modular_ts_1.mod)(BigInt(-1), exports.pasta_q), - Gy: BigInt(2), - h: BigInt(1), - hash: sha2_js_1.sha256, -}); -//# sourceMappingURL=misc.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/misc.js.map b/tools/mnemonic-test/node_modules/@noble/curves/misc.js.map deleted file mode 100644 index 088f3521..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/misc.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"misc.js","sourceRoot":"","sources":["src/misc.ts"],"names":[],"mappings":";;;AA6DA,4CAUC;AAKD,oDAWC;AAvFD;;;;GAIG;AACH,sEAAsE;AACtE,uDAAmD;AACnD,uDAAkD;AAClD,mDAAuD;AACvD,qDAAkE;AAClE,sDAK+B;AAC/B,sDAAmD;AACnD,8DAAkF;AAClF,iDAA8C;AAC9C,yCAAsC;AAEtC,6FAA6F;AAC7F,8CAA8C;AAC9C,oDAAoD;AACpD,MAAM,YAAY,GAAgB;IAChC,CAAC,EAAE,2BAAY,CAAC,KAAK;IACrB,CAAC,EAAE,MAAM,CAAC,mEAAmE,CAAC;IAC9E,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,CAAC,EAAE,MAAM,CAAC,oEAAoE,CAAC;IAC/E,CAAC,EAAE,MAAM,CAAC,oEAAoE,CAAC;IAC/E,EAAE,EAAE,MAAM,CAAC,oEAAoE,CAAC;IAChF,EAAE,EAAE,MAAM,CAAC,oEAAoE,CAAC;CACjF,CAAC;AACF,8DAA8D;AACjD,QAAA,MAAM,GAA4B,IAAA,2BAAc,EAAC;IAC5D,GAAG,YAAY;IACf,EAAE,EAAE,2BAAY;IAChB,IAAI,EAAE,gBAAM;CACb,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAAgB;IACpC,CAAC,EAAE,mBAAQ,CAAC,KAAK;IACjB,CAAC,EAAE,MAAM,CAAC,oEAAoE,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IACZ,EAAE,EAAE,IAAA,kBAAK,EAAC,eAAO,CAAC;IAClB,CAAC,EAAE,eAAO;IACV,EAAE,EAAE,IAAA,gBAAG,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,eAAO,CAAC;IAC5B,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;IACb,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,IAAI,EAAE,gBAAM;CACb,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/nist.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/nist.d.ts deleted file mode 100644 index 244013d4..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/nist.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { type CurveFnWithCreate } from './_shortw_utils.ts'; -import { type H2CHasher } from './abstract/hash-to-curve.ts'; -/** NIST P256 (aka secp256r1, prime256v1) curve, ECDSA and ECDH methods. */ -export declare const p256: CurveFnWithCreate; -/** Hashing / encoding to p256 points / field. RFC 9380 methods. */ -export declare const p256_hasher: H2CHasher; -/** NIST P384 (aka secp384r1) curve, ECDSA and ECDH methods. */ -export declare const p384: CurveFnWithCreate; -/** Hashing / encoding to p384 points / field. RFC 9380 methods. */ -export declare const p384_hasher: H2CHasher; -/** NIST P521 (aka secp521r1) curve, ECDSA and ECDH methods. */ -export declare const p521: CurveFnWithCreate; -/** @deprecated use `p256` for consistency with `p256_hasher` */ -export declare const secp256r1: typeof p256; -/** @deprecated use `p384` for consistency with `p384_hasher` */ -export declare const secp384r1: typeof p384; -/** @deprecated use `p521` for consistency with `p521_hasher` */ -export declare const secp521r1: typeof p521; -/** Hashing / encoding to p521 points / field. RFC 9380 methods. */ -export declare const p521_hasher: H2CHasher; -//# sourceMappingURL=nist.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/nist.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/nist.d.ts.map deleted file mode 100644 index ad056417..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/nist.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nist.d.ts","sourceRoot":"","sources":["src/nist.ts"],"names":[],"mappings":"AAOA,OAAO,EAAe,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,6BAA6B,CAAC;AA+E3E,2EAA2E;AAC3E,eAAO,MAAM,IAAI,EAAE,iBAGlB,CAAC;AACF,mEAAmE;AACnE,eAAO,MAAM,WAAW,EAAE,SAAS,CAAC,MAAM,CAkBtC,CAAC;AAUL,+DAA+D;AAC/D,eAAO,MAAM,IAAI,EAAE,iBAGlB,CAAC;AACF,mEAAmE;AACnE,eAAO,MAAM,WAAW,EAAE,SAAS,CAAC,MAAM,CAkBtC,CAAC;AAWL,+DAA+D;AAC/D,eAAO,MAAM,IAAI,EAAE,iBAGlB,CAAC;AAEF,gEAAgE;AAChE,eAAO,MAAM,SAAS,EAAE,OAAO,IAAW,CAAC;AAC3C,gEAAgE;AAChE,eAAO,MAAM,SAAS,EAAE,OAAO,IAAW,CAAC;AAC3C,gEAAgE;AAChE,eAAO,MAAM,SAAS,EAAE,OAAO,IAAW,CAAC;AAE3C,mEAAmE;AACnE,eAAO,MAAM,WAAW,EAAE,SAAS,CAAC,MAAM,CAkBtC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/nist.js b/tools/mnemonic-test/node_modules/@noble/curves/nist.js deleted file mode 100644 index 98ae90b1..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/nist.js +++ /dev/null @@ -1,135 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.p521_hasher = exports.secp521r1 = exports.secp384r1 = exports.secp256r1 = exports.p521 = exports.p384_hasher = exports.p384 = exports.p256_hasher = exports.p256 = void 0; -/** - * Internal module for NIST P256, P384, P521 curves. - * Do not use for now. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const sha2_js_1 = require("@noble/hashes/sha2.js"); -const _shortw_utils_ts_1 = require("./_shortw_utils.js"); -const hash_to_curve_ts_1 = require("./abstract/hash-to-curve.js"); -const modular_ts_1 = require("./abstract/modular.js"); -const weierstrass_ts_1 = require("./abstract/weierstrass.js"); -// p = 2n**224n * (2n**32n-1n) + 2n**192n + 2n**96n - 1n -// a = Fp256.create(BigInt('-3')); -const p256_CURVE = { - p: BigInt('0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff'), - n: BigInt('0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551'), - h: BigInt(1), - a: BigInt('0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc'), - b: BigInt('0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b'), - Gx: BigInt('0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296'), - Gy: BigInt('0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5'), -}; -// p = 2n**384n - 2n**128n - 2n**96n + 2n**32n - 1n -const p384_CURVE = { - p: BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff'), - n: BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973'), - h: BigInt(1), - a: BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffc'), - b: BigInt('0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef'), - Gx: BigInt('0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7'), - Gy: BigInt('0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f'), -}; -// p = 2n**521n - 1n -const p521_CURVE = { - p: BigInt('0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'), - n: BigInt('0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409'), - h: BigInt(1), - a: BigInt('0x1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc'), - b: BigInt('0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00'), - Gx: BigInt('0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66'), - Gy: BigInt('0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650'), -}; -const Fp256 = (0, modular_ts_1.Field)(p256_CURVE.p); -const Fp384 = (0, modular_ts_1.Field)(p384_CURVE.p); -const Fp521 = (0, modular_ts_1.Field)(p521_CURVE.p); -function createSWU(Point, opts) { - const map = (0, weierstrass_ts_1.mapToCurveSimpleSWU)(Point.Fp, opts); - return (scalars) => map(scalars[0]); -} -/** NIST P256 (aka secp256r1, prime256v1) curve, ECDSA and ECDH methods. */ -exports.p256 = (0, _shortw_utils_ts_1.createCurve)({ ...p256_CURVE, Fp: Fp256, lowS: false }, sha2_js_1.sha256); -/** Hashing / encoding to p256 points / field. RFC 9380 methods. */ -exports.p256_hasher = (() => { - return (0, hash_to_curve_ts_1.createHasher)(exports.p256.Point, createSWU(exports.p256.Point, { - A: p256_CURVE.a, - B: p256_CURVE.b, - Z: exports.p256.Point.Fp.create(BigInt('-10')), - }), { - DST: 'P256_XMD:SHA-256_SSWU_RO_', - encodeDST: 'P256_XMD:SHA-256_SSWU_NU_', - p: p256_CURVE.p, - m: 1, - k: 128, - expand: 'xmd', - hash: sha2_js_1.sha256, - }); -})(); -// export const p256_oprf: OPRF = createORPF({ -// name: 'P256-SHA256', -// Point: p256.Point, -// hash: sha256, -// hashToGroup: p256_hasher.hashToCurve, -// hashToScalar: p256_hasher.hashToScalar, -// }); -/** NIST P384 (aka secp384r1) curve, ECDSA and ECDH methods. */ -exports.p384 = (0, _shortw_utils_ts_1.createCurve)({ ...p384_CURVE, Fp: Fp384, lowS: false }, sha2_js_1.sha384); -/** Hashing / encoding to p384 points / field. RFC 9380 methods. */ -exports.p384_hasher = (() => { - return (0, hash_to_curve_ts_1.createHasher)(exports.p384.Point, createSWU(exports.p384.Point, { - A: p384_CURVE.a, - B: p384_CURVE.b, - Z: exports.p384.Point.Fp.create(BigInt('-12')), - }), { - DST: 'P384_XMD:SHA-384_SSWU_RO_', - encodeDST: 'P384_XMD:SHA-384_SSWU_NU_', - p: p384_CURVE.p, - m: 1, - k: 192, - expand: 'xmd', - hash: sha2_js_1.sha384, - }); -})(); -// export const p384_oprf: OPRF = createORPF({ -// name: 'P384-SHA384', -// Point: p384.Point, -// hash: sha384, -// hashToGroup: p384_hasher.hashToCurve, -// hashToScalar: p384_hasher.hashToScalar, -// }); -// const Fn521 = Field(p521_CURVE.n, { allowedScalarLengths: [65, 66] }); -/** NIST P521 (aka secp521r1) curve, ECDSA and ECDH methods. */ -exports.p521 = (0, _shortw_utils_ts_1.createCurve)({ ...p521_CURVE, Fp: Fp521, lowS: false, allowedPrivateKeyLengths: [130, 131, 132] }, sha2_js_1.sha512); -/** @deprecated use `p256` for consistency with `p256_hasher` */ -exports.secp256r1 = exports.p256; -/** @deprecated use `p384` for consistency with `p384_hasher` */ -exports.secp384r1 = exports.p384; -/** @deprecated use `p521` for consistency with `p521_hasher` */ -exports.secp521r1 = exports.p521; -/** Hashing / encoding to p521 points / field. RFC 9380 methods. */ -exports.p521_hasher = (() => { - return (0, hash_to_curve_ts_1.createHasher)(exports.p521.Point, createSWU(exports.p521.Point, { - A: p521_CURVE.a, - B: p521_CURVE.b, - Z: exports.p521.Point.Fp.create(BigInt('-4')), - }), { - DST: 'P521_XMD:SHA-512_SSWU_RO_', - encodeDST: 'P521_XMD:SHA-512_SSWU_NU_', - p: p521_CURVE.p, - m: 1, - k: 256, - expand: 'xmd', - hash: sha2_js_1.sha512, - }); -})(); -// export const p521_oprf: OPRF = createORPF({ -// name: 'P521-SHA512', -// Point: p521.Point, -// hash: sha512, -// hashToGroup: p521_hasher.hashToCurve, -// hashToScalar: p521_hasher.hashToScalar, // produces L=98 just like in RFC -// }); -//# sourceMappingURL=nist.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/nist.js.map b/tools/mnemonic-test/node_modules/@noble/curves/nist.js.map deleted file mode 100644 index 8054e5e0..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/nist.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nist.js","sourceRoot":"","sources":["src/nist.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,sEAAsE;AACtE,mDAA+D;AAC/D,yDAAyE;AACzE,kEAA2E;AAC3E,sDAA8C;AAC9C,8DAImC;AAEnC,wDAAwD;AACxD,kCAAkC;AAClC,MAAM,UAAU,GAA4B;IAC1C,CAAC,EAAE,MAAM,CAAC,oEAAoE,CAAC;IAC/E,CAAC,EAAE,MAAM,CAAC,oEAAoE,CAAC;IAC/E,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,CAAC,EAAE,MAAM,CAAC,oEAAoE,CAAC;IAC/E,CAAC,EAAE,MAAM,CAAC,oEAAoE,CAAC;IAC/E,EAAE,EAAE,MAAM,CAAC,oEAAoE,CAAC;IAChF,EAAE,EAAE,MAAM,CAAC,oEAAoE,CAAC;CACjF,CAAC;AAEF,mDAAmD;AACnD,MAAM,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CAAC;AAEL,8CAA8C;AAC9C,yBAAyB;AACzB,uBAAuB;AACvB,kBAAkB;AAClB,0CAA0C;AAC1C,8EAA8E;AAC9E,MAAM"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/p256.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/p256.d.ts deleted file mode 100644 index 14290a8e..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/p256.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * NIST secp256r1 aka p256. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { type H2CMethod } from './abstract/hash-to-curve.ts'; -import { p256 as p256n } from './nist.ts'; -/** @deprecated use `import { p256 } from '@noble/curves/nist.js';` */ -export declare const p256: typeof p256n; -/** @deprecated use `import { p256 } from '@noble/curves/nist.js';` */ -export declare const secp256r1: typeof p256n; -/** @deprecated use `import { p256_hasher } from '@noble/curves/nist.js';` */ -export declare const hashToCurve: H2CMethod; -/** @deprecated use `import { p256_hasher } from '@noble/curves/nist.js';` */ -export declare const encodeToCurve: H2CMethod; -//# sourceMappingURL=p256.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/p256.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/p256.d.ts.map deleted file mode 100644 index 7049f87c..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/p256.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"p256.d.ts","sourceRoot":"","sources":["src/p256.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,sEAAsE;AACtE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAe,IAAI,IAAI,KAAK,EAAE,MAAM,WAAW,CAAC;AACvD,sEAAsE;AACtE,eAAO,MAAM,IAAI,EAAE,OAAO,KAAa,CAAC;AACxC,sEAAsE;AACtE,eAAO,MAAM,SAAS,EAAE,OAAO,KAAa,CAAC;AAC7C,6EAA6E;AAC7E,eAAO,MAAM,WAAW,EAAE,SAAS,CAAC,MAAM,CAAqD,CAAC;AAChG,6EAA6E;AAC7E,eAAO,MAAM,aAAa,EAAE,SAAS,CAAC,MAAM,CAAuD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/p256.js b/tools/mnemonic-test/node_modules/@noble/curves/p256.js deleted file mode 100644 index e2d24775..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/p256.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.encodeToCurve = exports.hashToCurve = exports.secp256r1 = exports.p256 = void 0; -const nist_ts_1 = require("./nist.js"); -/** @deprecated use `import { p256 } from '@noble/curves/nist.js';` */ -exports.p256 = nist_ts_1.p256; -/** @deprecated use `import { p256 } from '@noble/curves/nist.js';` */ -exports.secp256r1 = nist_ts_1.p256; -/** @deprecated use `import { p256_hasher } from '@noble/curves/nist.js';` */ -exports.hashToCurve = (() => nist_ts_1.p256_hasher.hashToCurve)(); -/** @deprecated use `import { p256_hasher } from '@noble/curves/nist.js';` */ -exports.encodeToCurve = (() => nist_ts_1.p256_hasher.encodeToCurve)(); -//# sourceMappingURL=p256.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/p256.js.map b/tools/mnemonic-test/node_modules/@noble/curves/p256.js.map deleted file mode 100644 index 2fb9eedf..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/p256.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"p256.js","sourceRoot":"","sources":["src/p256.ts"],"names":[],"mappings":";;;AAMA,uCAAuD;AACvD,sEAAsE;AACzD,QAAA,IAAI,GAAiB,cAAK,CAAC;AACxC,sEAAsE;AACzD,QAAA,SAAS,GAAiB,cAAK,CAAC;AAC7C,6EAA6E;AAChE,QAAA,WAAW,GAAsC,CAAC,GAAG,EAAE,CAAC,qBAAW,CAAC,WAAW,CAAC,EAAE,CAAC;AAChG,6EAA6E;AAChE,QAAA,aAAa,GAAsC,CAAC,GAAG,EAAE,CAAC,qBAAW,CAAC,aAAa,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/p384.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/p384.d.ts deleted file mode 100644 index 58fba871..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/p384.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * NIST secp384r1 aka p384. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { type H2CMethod } from './abstract/hash-to-curve.ts'; -import { p384 as p384n } from './nist.ts'; -/** @deprecated use `import { p384 } from '@noble/curves/nist.js';` */ -export declare const p384: typeof p384n; -/** @deprecated use `import { p384 } from '@noble/curves/nist.js';` */ -export declare const secp384r1: typeof p384n; -/** @deprecated use `import { p384_hasher } from '@noble/curves/nist.js';` */ -export declare const hashToCurve: H2CMethod; -/** @deprecated use `import { p384_hasher } from '@noble/curves/nist.js';` */ -export declare const encodeToCurve: H2CMethod; -//# sourceMappingURL=p384.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/p384.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/p384.d.ts.map deleted file mode 100644 index d9d543c1..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/p384.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"p384.d.ts","sourceRoot":"","sources":["src/p384.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,sEAAsE;AACtE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAe,IAAI,IAAI,KAAK,EAAE,MAAM,WAAW,CAAC;AACvD,sEAAsE;AACtE,eAAO,MAAM,IAAI,EAAE,OAAO,KAAa,CAAC;AACxC,sEAAsE;AACtE,eAAO,MAAM,SAAS,EAAE,OAAO,KAAa,CAAC;AAC7C,6EAA6E;AAC7E,eAAO,MAAM,WAAW,EAAE,SAAS,CAAC,MAAM,CAAqD,CAAC;AAChG,6EAA6E;AAC7E,eAAO,MAAM,aAAa,EAAE,SAAS,CAAC,MAAM,CAAuD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/p384.js b/tools/mnemonic-test/node_modules/@noble/curves/p384.js deleted file mode 100644 index 2c650707..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/p384.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.encodeToCurve = exports.hashToCurve = exports.secp384r1 = exports.p384 = void 0; -const nist_ts_1 = require("./nist.js"); -/** @deprecated use `import { p384 } from '@noble/curves/nist.js';` */ -exports.p384 = nist_ts_1.p384; -/** @deprecated use `import { p384 } from '@noble/curves/nist.js';` */ -exports.secp384r1 = nist_ts_1.p384; -/** @deprecated use `import { p384_hasher } from '@noble/curves/nist.js';` */ -exports.hashToCurve = (() => nist_ts_1.p384_hasher.hashToCurve)(); -/** @deprecated use `import { p384_hasher } from '@noble/curves/nist.js';` */ -exports.encodeToCurve = (() => nist_ts_1.p384_hasher.encodeToCurve)(); -//# sourceMappingURL=p384.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/p384.js.map b/tools/mnemonic-test/node_modules/@noble/curves/p384.js.map deleted file mode 100644 index 9afc7f7d..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/p384.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"p384.js","sourceRoot":"","sources":["src/p384.ts"],"names":[],"mappings":";;;AAMA,uCAAuD;AACvD,sEAAsE;AACzD,QAAA,IAAI,GAAiB,cAAK,CAAC;AACxC,sEAAsE;AACzD,QAAA,SAAS,GAAiB,cAAK,CAAC;AAC7C,6EAA6E;AAChE,QAAA,WAAW,GAAsC,CAAC,GAAG,EAAE,CAAC,qBAAW,CAAC,WAAW,CAAC,EAAE,CAAC;AAChG,6EAA6E;AAChE,QAAA,aAAa,GAAsC,CAAC,GAAG,EAAE,CAAC,qBAAW,CAAC,aAAa,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/p521.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/p521.d.ts deleted file mode 100644 index 470f5ce9..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/p521.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * NIST secp521r1 aka p521. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { type H2CMethod } from './abstract/hash-to-curve.ts'; -import { p521 as p521n } from './nist.ts'; -/** @deprecated use `import { p521 } from '@noble/curves/nist.js';` */ -export declare const p521: typeof p521n; -/** @deprecated use `import { p521 } from '@noble/curves/nist.js';` */ -export declare const secp521r1: typeof p521n; -/** @deprecated use `import { p521_hasher } from '@noble/curves/nist.js';` */ -export declare const hashToCurve: H2CMethod; -/** @deprecated use `import { p521_hasher } from '@noble/curves/nist.js';` */ -export declare const encodeToCurve: H2CMethod; -//# sourceMappingURL=p521.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/p521.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/p521.d.ts.map deleted file mode 100644 index 6337fe6a..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/p521.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"p521.d.ts","sourceRoot":"","sources":["src/p521.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,sEAAsE;AACtE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAe,IAAI,IAAI,KAAK,EAAE,MAAM,WAAW,CAAC;AACvD,sEAAsE;AACtE,eAAO,MAAM,IAAI,EAAE,OAAO,KAAa,CAAC;AACxC,sEAAsE;AACtE,eAAO,MAAM,SAAS,EAAE,OAAO,KAAa,CAAC;AAC7C,6EAA6E;AAC7E,eAAO,MAAM,WAAW,EAAE,SAAS,CAAC,MAAM,CAAqD,CAAC;AAChG,6EAA6E;AAC7E,eAAO,MAAM,aAAa,EAAE,SAAS,CAAC,MAAM,CAAuD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/p521.js b/tools/mnemonic-test/node_modules/@noble/curves/p521.js deleted file mode 100644 index 77aea02e..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/p521.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.encodeToCurve = exports.hashToCurve = exports.secp521r1 = exports.p521 = void 0; -const nist_ts_1 = require("./nist.js"); -/** @deprecated use `import { p521 } from '@noble/curves/nist.js';` */ -exports.p521 = nist_ts_1.p521; -/** @deprecated use `import { p521 } from '@noble/curves/nist.js';` */ -exports.secp521r1 = nist_ts_1.p521; -/** @deprecated use `import { p521_hasher } from '@noble/curves/nist.js';` */ -exports.hashToCurve = (() => nist_ts_1.p521_hasher.hashToCurve)(); -/** @deprecated use `import { p521_hasher } from '@noble/curves/nist.js';` */ -exports.encodeToCurve = (() => nist_ts_1.p521_hasher.encodeToCurve)(); -//# sourceMappingURL=p521.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/p521.js.map b/tools/mnemonic-test/node_modules/@noble/curves/p521.js.map deleted file mode 100644 index 4a5f6dcb..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/p521.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"p521.js","sourceRoot":"","sources":["src/p521.ts"],"names":[],"mappings":";;;AAMA,uCAAuD;AACvD,sEAAsE;AACzD,QAAA,IAAI,GAAiB,cAAK,CAAC;AACxC,sEAAsE;AACzD,QAAA,SAAS,GAAiB,cAAK,CAAC;AAC7C,6EAA6E;AAChE,QAAA,WAAW,GAAsC,CAAC,GAAG,EAAE,CAAC,qBAAW,CAAC,WAAW,CAAC,EAAE,CAAC;AAChG,6EAA6E;AAChE,QAAA,aAAa,GAAsC,CAAC,GAAG,EAAE,CAAC,qBAAW,CAAC,aAAa,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/package.json b/tools/mnemonic-test/node_modules/@noble/curves/package.json deleted file mode 100644 index 852104a5..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/package.json +++ /dev/null @@ -1,295 +0,0 @@ -{ - "name": "@noble/curves", - "version": "1.9.7", - "description": "Audited & minimal JS implementation of elliptic curve cryptography", - "files": [ - "*.js", - "*.js.map", - "*.d.ts", - "*.d.ts.map", - "esm", - "src", - "abstract", - "!oprf.*", - "!webcrypto.*" - ], - "scripts": { - "bench": "npm run bench:install; cd test/benchmark; node secp256k1.js; node curves.js; node utils.js; node bls.js", - "bench:install": "cd test/benchmark; npm install; npm install ../.. --install-links", - "build": "tsc && tsc -p tsconfig.cjs.json", - "build:release": "npx jsbt esbuild test/build", - "build:clean": "rm {.,esm,abstract,esm/abstract}/*.{js,d.ts,d.ts.map,js.map} 2> /dev/null", - "lint": "prettier --check 'src/**/*.{js,ts}' 'test/*.js'", - "format": "prettier --write 'src/**/*.{js,ts}' 'test/*.js'", - "test": "node --disable-warning=ExperimentalWarning test/index.js", - "test:bun": "bun test/index.js", - "test:deno": "deno --allow-env --allow-read test/index.js", - "test:coverage": "npm install --no-save c8@10.1.2 && npx c8 npm test" - }, - "author": "Paul Miller (https://paulmillr.com)", - "homepage": "https://paulmillr.com/noble/", - "repository": { - "type": "git", - "url": "git+https://github.com/paulmillr/noble-curves.git" - }, - "license": "MIT", - "dependencies": { - "@noble/hashes": "1.8.0" - }, - "devDependencies": { - "@paulmillr/jsbt": "0.4.0", - "@types/node": "22.15.21", - "fast-check": "4.1.1", - "micro-bmark": "0.4.2", - "micro-should": "0.5.3", - "prettier": "3.5.3", - "typescript": "5.8.3" - }, - "sideEffects": false, - "main": "index.js", - "exports": { - ".": { - "import": "./esm/index.js", - "require": "./index.js" - }, - "./abstract/bls": { - "import": "./esm/abstract/bls.js", - "require": "./abstract/bls.js" - }, - "./abstract/curve": { - "import": "./esm/abstract/curve.js", - "require": "./abstract/curve.js" - }, - "./abstract/edwards": { - "import": "./esm/abstract/edwards.js", - "require": "./abstract/edwards.js" - }, - "./abstract/hash-to-curve": { - "import": "./esm/abstract/hash-to-curve.js", - "require": "./abstract/hash-to-curve.js" - }, - "./abstract/modular": { - "import": "./esm/abstract/modular.js", - "require": "./abstract/modular.js" - }, - "./abstract/montgomery": { - "import": "./esm/abstract/montgomery.js", - "require": "./abstract/montgomery.js" - }, - "./abstract/poseidon": { - "import": "./esm/abstract/poseidon.js", - "require": "./abstract/poseidon.js" - }, - "./abstract/tower": { - "import": "./esm/abstract/tower.js", - "require": "./abstract/tower.js" - }, - "./abstract/utils": { - "import": "./esm/abstract/utils.js", - "require": "./abstract/utils.js" - }, - "./abstract/weierstrass": { - "import": "./esm/abstract/weierstrass.js", - "require": "./abstract/weierstrass.js" - }, - "./abstract/fft": { - "import": "./esm/abstract/fft.js", - "require": "./abstract/fft.js" - }, - "./_shortw_utils": { - "import": "./esm/_shortw_utils.js", - "require": "./_shortw_utils.js" - }, - "./bls12-381": { - "import": "./esm/bls12-381.js", - "require": "./bls12-381.js" - }, - "./bn254": { - "import": "./esm/bn254.js", - "require": "./bn254.js" - }, - "./ed448": { - "import": "./esm/ed448.js", - "require": "./ed448.js" - }, - "./ed25519": { - "import": "./esm/ed25519.js", - "require": "./ed25519.js" - }, - "./index": { - "import": "./esm/index.js", - "require": "./index.js" - }, - "./jubjub": { - "import": "./esm/jubjub.js", - "require": "./jubjub.js" - }, - "./misc": { - "import": "./esm/misc.js", - "require": "./misc.js" - }, - "./nist": { - "import": "./esm/nist.js", - "require": "./nist.js" - }, - "./p256": { - "import": "./esm/p256.js", - "require": "./p256.js" - }, - "./p384": { - "import": "./esm/p384.js", - "require": "./p384.js" - }, - "./p521": { - "import": "./esm/p521.js", - "require": "./p521.js" - }, - "./pasta": { - "import": "./esm/pasta.js", - "require": "./pasta.js" - }, - "./secp256k1": { - "import": "./esm/secp256k1.js", - "require": "./secp256k1.js" - }, - "./utils": { - "import": "./esm/utils.js", - "require": "./utils.js" - }, - "./abstract/bls.js": { - "import": "./esm/abstract/bls.js", - "require": "./abstract/bls.js" - }, - "./abstract/curve.js": { - "import": "./esm/abstract/curve.js", - "require": "./abstract/curve.js" - }, - "./abstract/edwards.js": { - "import": "./esm/abstract/edwards.js", - "require": "./abstract/edwards.js" - }, - "./abstract/hash-to-curve.js": { - "import": "./esm/abstract/hash-to-curve.js", - "require": "./abstract/hash-to-curve.js" - }, - "./abstract/modular.js": { - "import": "./esm/abstract/modular.js", - "require": "./abstract/modular.js" - }, - "./abstract/montgomery.js": { - "import": "./esm/abstract/montgomery.js", - "require": "./abstract/montgomery.js" - }, - "./abstract/poseidon.js": { - "import": "./esm/abstract/poseidon.js", - "require": "./abstract/poseidon.js" - }, - "./abstract/tower.js": { - "import": "./esm/abstract/tower.js", - "require": "./abstract/tower.js" - }, - "./abstract/utils.js": { - "import": "./esm/abstract/utils.js", - "require": "./abstract/utils.js" - }, - "./abstract/weierstrass.js": { - "import": "./esm/abstract/weierstrass.js", - "require": "./abstract/weierstrass.js" - }, - "./abstract/fft.js": { - "import": "./esm/abstract/fft.js", - "require": "./abstract/fft.js" - }, - "./_shortw_utils.js": { - "import": "./esm/_shortw_utils.js", - "require": "./_shortw_utils.js" - }, - "./bls12-381.js": { - "import": "./esm/bls12-381.js", - "require": "./bls12-381.js" - }, - "./bn254.js": { - "import": "./esm/bn254.js", - "require": "./bn254.js" - }, - "./utils.js": { - "import": "./esm/utils.js", - "require": "./utils.js" - }, - "./ed448.js": { - "import": "./esm/ed448.js", - "require": "./ed448.js" - }, - "./ed25519.js": { - "import": "./esm/ed25519.js", - "require": "./ed25519.js" - }, - "./index.js": { - "import": "./esm/index.js", - "require": "./index.js" - }, - "./jubjub.js": { - "import": "./esm/jubjub.js", - "require": "./jubjub.js" - }, - "./misc.js": { - "import": "./esm/misc.js", - "require": "./misc.js" - }, - "./nist.js": { - "import": "./esm/nist.js", - "require": "./nist.js" - }, - "./p256.js": { - "import": "./esm/p256.js", - "require": "./p256.js" - }, - "./p384.js": { - "import": "./esm/p384.js", - "require": "./p384.js" - }, - "./p521.js": { - "import": "./esm/p521.js", - "require": "./p521.js" - }, - "./pasta.js": { - "import": "./esm/pasta.js", - "require": "./pasta.js" - }, - "./secp256k1.js": { - "import": "./esm/secp256k1.js", - "require": "./secp256k1.js" - } - }, - "engines": { - "node": "^14.21.3 || >=16" - }, - "keywords": [ - "elliptic", - "curve", - "cryptography", - "secp256k1", - "ed25519", - "p256", - "p384", - "p521", - "secp256r1", - "ed448", - "x25519", - "ed25519", - "bls12-381", - "bn254", - "alt_bn128", - "bls", - "noble", - "ecc", - "ecdsa", - "eddsa", - "weierstrass", - "montgomery", - "edwards", - "schnorr", - "fft" - ], - "funding": "https://paulmillr.com/funding/" -} diff --git a/tools/mnemonic-test/node_modules/@noble/curves/pasta.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/pasta.d.ts deleted file mode 100644 index b5d5ba9b..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/pasta.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * @deprecated - * @module - */ -import { pallas as pn, vesta as vn } from './misc.ts'; -/** @deprecated */ -export declare const pallas: typeof pn; -/** @deprecated */ -export declare const vesta: typeof vn; -//# sourceMappingURL=pasta.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/pasta.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/pasta.d.ts.map deleted file mode 100644 index 428774fb..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/pasta.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pasta.d.ts","sourceRoot":"","sources":["src/pasta.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,IAAI,EAAE,EAAE,KAAK,IAAI,EAAE,EAAE,MAAM,WAAW,CAAC;AACtD,kBAAkB;AAClB,eAAO,MAAM,MAAM,EAAE,OAAO,EAAO,CAAC;AACpC,kBAAkB;AAClB,eAAO,MAAM,KAAK,EAAE,OAAO,EAAO,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/pasta.js b/tools/mnemonic-test/node_modules/@noble/curves/pasta.js deleted file mode 100644 index 09503ffc..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/pasta.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.vesta = exports.pallas = void 0; -/** - * @deprecated - * @module - */ -const misc_ts_1 = require("./misc.js"); -/** @deprecated */ -exports.pallas = misc_ts_1.pallas; -/** @deprecated */ -exports.vesta = misc_ts_1.vesta; -//# sourceMappingURL=pasta.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/pasta.js.map b/tools/mnemonic-test/node_modules/@noble/curves/pasta.js.map deleted file mode 100644 index 3ec65d3a..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/pasta.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pasta.js","sourceRoot":"","sources":["src/pasta.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAAsD;AACtD,kBAAkB;AACL,QAAA,MAAM,GAAc,gBAAE,CAAC;AACpC,kBAAkB;AACL,QAAA,KAAK,GAAc,eAAE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/secp256k1.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/secp256k1.d.ts deleted file mode 100644 index 4ba3fc91..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/secp256k1.d.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { type CurveFnWithCreate } from './_shortw_utils.ts'; -import type { CurveLengths } from './abstract/curve.ts'; -import { type H2CHasher, type H2CMethod } from './abstract/hash-to-curve.ts'; -import { mod } from './abstract/modular.ts'; -import { type WeierstrassPoint as PointType, type WeierstrassPointCons } from './abstract/weierstrass.ts'; -import type { Hex, PrivKey } from './utils.ts'; -import { bytesToNumberBE, numberToBytesBE } from './utils.ts'; -/** - * secp256k1 curve, ECDSA and ECDH methods. - * - * Field: `2n**256n - 2n**32n - 2n**9n - 2n**8n - 2n**7n - 2n**6n - 2n**4n - 1n` - * - * @example - * ```js - * import { secp256k1 } from '@noble/curves/secp256k1'; - * const { secretKey, publicKey } = secp256k1.keygen(); - * const msg = new TextEncoder().encode('hello'); - * const sig = secp256k1.sign(msg, secretKey); - * const isValid = secp256k1.verify(sig, msg, publicKey) === true; - * ``` - */ -export declare const secp256k1: CurveFnWithCreate; -declare function taggedHash(tag: string, ...messages: Uint8Array[]): Uint8Array; -/** - * lift_x from BIP340. Convert 32-byte x coordinate to elliptic curve point. - * @returns valid point checked for being on-curve - */ -declare function lift_x(x: bigint): PointType; -/** - * Schnorr public key is just `x` coordinate of Point as per BIP340. - */ -declare function schnorrGetPublicKey(secretKey: Hex): Uint8Array; -/** - * Creates Schnorr signature as per BIP340. Verifies itself before returning anything. - * auxRand is optional and is not the sole source of k generation: bad CSPRNG won't be dangerous. - */ -declare function schnorrSign(message: Hex, secretKey: PrivKey, auxRand?: Hex): Uint8Array; -/** - * Verifies Schnorr signature. - * Will swallow errors & return false except for initial type validation of arguments. - */ -declare function schnorrVerify(signature: Hex, message: Hex, publicKey: Hex): boolean; -export type SecpSchnorr = { - keygen: (seed?: Uint8Array) => { - secretKey: Uint8Array; - publicKey: Uint8Array; - }; - getPublicKey: typeof schnorrGetPublicKey; - sign: typeof schnorrSign; - verify: typeof schnorrVerify; - Point: WeierstrassPointCons; - utils: { - randomSecretKey: (seed?: Uint8Array) => Uint8Array; - pointToBytes: (point: PointType) => Uint8Array; - lift_x: typeof lift_x; - taggedHash: typeof taggedHash; - /** @deprecated use `randomSecretKey` */ - randomPrivateKey: (seed?: Uint8Array) => Uint8Array; - /** @deprecated use `utils` */ - numberToBytesBE: typeof numberToBytesBE; - /** @deprecated use `utils` */ - bytesToNumberBE: typeof bytesToNumberBE; - /** @deprecated use `modular` */ - mod: typeof mod; - }; - lengths: CurveLengths; -}; -/** - * Schnorr signatures over secp256k1. - * https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki - * @example - * ```js - * import { schnorr } from '@noble/curves/secp256k1'; - * const { secretKey, publicKey } = schnorr.keygen(); - * // const publicKey = schnorr.getPublicKey(secretKey); - * const msg = new TextEncoder().encode('hello'); - * const sig = schnorr.sign(msg, secretKey); - * const isValid = schnorr.verify(sig, msg, publicKey); - * ``` - */ -export declare const schnorr: SecpSchnorr; -/** Hashing / encoding to secp256k1 points / field. RFC 9380 methods. */ -export declare const secp256k1_hasher: H2CHasher; -/** @deprecated use `import { secp256k1_hasher } from '@noble/curves/secp256k1.js';` */ -export declare const hashToCurve: H2CMethod; -/** @deprecated use `import { secp256k1_hasher } from '@noble/curves/secp256k1.js';` */ -export declare const encodeToCurve: H2CMethod; -export {}; -//# sourceMappingURL=secp256k1.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/secp256k1.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/secp256k1.d.ts.map deleted file mode 100644 index 1fc72158..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/secp256k1.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"secp256k1.d.ts","sourceRoot":"","sources":["src/secp256k1.ts"],"names":[],"mappings":"AAUA,OAAO,EAAe,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,SAAS,EAEf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAyB,GAAG,EAAQ,M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ACnD,YAAY,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,KAAK,UAAU,CAAC;QACvD,MAAM,EAAE,OAAO,MAAM,CAAC;QACtB,UAAU,EAAE,OAAO,UAAU,CAAC;QAE9B,wCAAwC;QACxC,gBAAgB,EAAE,CAAC,IAAI,CAAC,EAAE,UAAU,KAAK,UAAU,CAAC;QACpD,8BAA8B;QAC9B,eAAe,EAAE,OAAO,eAAe,CAAC;QACxC,8BAA8B;QAC9B,eAAe,EAAE,OAAO,eAAe,CAAC;QACxC,gCAAgC;QAChC,GAAG,EAAE,OAAO,GAAG,CAAC;KACjB,CAAC;IACF,OAAO,EAAE,YAAY,CAAC;CACvB,CAAC;AACF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,OAAO,EAAE,WAsClB,CAAC;AA0CL,wEAAwE;AACxE,eAAO,MAAM,gBAAgB,EAAE,SAAS,CAAC,MAAM,CAgBzC,CAAC;AAEP,uFAAuF;AACvF,eAAO,MAAM,WAAW,EAAE,SAAS,CAAC,MAAM,CACT,CAAC;AAElC,uFAAuF;AACvF,eAAO,MAAM,aAAa,EAAE,SAAS,CAAC,MAAM,CACT,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/secp256k1.js b/tools/mnemonic-test/node_modules/@noble/curves/secp256k1.js deleted file mode 100644 index 87693c90..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/secp256k1.js +++ /dev/null @@ -1,297 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.encodeToCurve = exports.hashToCurve = exports.secp256k1_hasher = exports.schnorr = exports.secp256k1 = void 0; -/** - * SECG secp256k1. See [pdf](https://www.secg.org/sec2-v2.pdf). - * - * Belongs to Koblitz curves: it has efficiently-computable GLV endomorphism ψ, - * check out {@link EndomorphismOpts}. Seems to be rigid (not backdoored). - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const sha2_js_1 = require("@noble/hashes/sha2.js"); -const utils_js_1 = require("@noble/hashes/utils.js"); -const _shortw_utils_ts_1 = require("./_shortw_utils.js"); -const hash_to_curve_ts_1 = require("./abstract/hash-to-curve.js"); -const modular_ts_1 = require("./abstract/modular.js"); -const weierstrass_ts_1 = require("./abstract/weierstrass.js"); -const utils_ts_1 = require("./utils.js"); -// Seems like generator was produced from some seed: -// `Point.BASE.multiply(Point.Fn.inv(2n, N)).toAffine().x` -// // gives short x 0x3b78ce563f89a0ed9414f5aa28ad0d96d6795f9c63n -const secp256k1_CURVE = { - p: BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f'), - n: BigInt('0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141'), - h: BigInt(1), - a: BigInt(0), - b: BigInt(7), - Gx: BigInt('0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798'), - Gy: BigInt('0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8'), -}; -const secp256k1_ENDO = { - beta: BigInt('0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee'), - basises: [ - [BigInt('0x3086d221a7d46bcde86c90e49284eb15'), -BigInt('0xe4437ed6010e88286f547fa90abfe4c3')], - [BigInt('0x114ca50f7a8e2f3f657c1108d9d44cfd8'), BigInt('0x3086d221a7d46bcde86c90e49284eb15')], - ], -}; -const _0n = /* @__PURE__ */ BigInt(0); -const _1n = /* @__PURE__ */ BigInt(1); -const _2n = /* @__PURE__ */ BigInt(2); -/** - * √n = n^((p+1)/4) for fields p = 3 mod 4. We unwrap the loop and multiply bit-by-bit. - * (P+1n/4n).toString(2) would produce bits [223x 1, 0, 22x 1, 4x 0, 11, 00] - */ -function sqrtMod(y) { - const P = secp256k1_CURVE.p; - // prettier-ignore - const _3n = BigInt(3), _6n = BigInt(6), _11n = BigInt(11), _22n = BigInt(22); - // prettier-ignore - const _23n = BigInt(23), _44n = BigInt(44), _88n = BigInt(88); - const b2 = (y * y * y) % P; // x^3, 11 - const b3 = (b2 * b2 * y) % P; // x^7 - const b6 = ((0, modular_ts_1.pow2)(b3, _3n, P) * b3) % P; - const b9 = ((0, modular_ts_1.pow2)(b6, _3n, P) * b3) % P; - const b11 = ((0, modular_ts_1.pow2)(b9, _2n, P) * b2) % P; - const b22 = ((0, modular_ts_1.pow2)(b11, _11n, P) * b11) % P; - const b44 = ((0, modular_ts_1.pow2)(b22, _22n, P) * b22) % P; - const b88 = ((0, modular_ts_1.pow2)(b44, _44n, P) * b44) % P; - const b176 = ((0, modular_ts_1.pow2)(b88, _88n, P) * b88) % P; - const b220 = ((0, modular_ts_1.pow2)(b176, _44n, P) * b44) % P; - const b223 = ((0, modular_ts_1.pow2)(b220, _3n, P) * b3) % P; - const t1 = ((0, modular_ts_1.pow2)(b223, _23n, P) * b22) % P; - const t2 = ((0, modular_ts_1.pow2)(t1, _6n, P) * b2) % P; - const root = (0, modular_ts_1.pow2)(t2, _2n, P); - if (!Fpk1.eql(Fpk1.sqr(root), y)) - throw new Error('Cannot find square root'); - return root; -} -const Fpk1 = (0, modular_ts_1.Field)(secp256k1_CURVE.p, { sqrt: sqrtMod }); -/** - * secp256k1 curve, ECDSA and ECDH methods. - * - * Field: `2n**256n - 2n**32n - 2n**9n - 2n**8n - 2n**7n - 2n**6n - 2n**4n - 1n` - * - * @example - * ```js - * import { secp256k1 } from '@noble/curves/secp256k1'; - * const { secretKey, publicKey } = secp256k1.keygen(); - * const msg = new TextEncoder().encode('hello'); - * const sig = secp256k1.sign(msg, secretKey); - * const isValid = secp256k1.verify(sig, msg, publicKey) === true; - * ``` - */ -exports.secp256k1 = (0, _shortw_utils_ts_1.createCurve)({ ...secp256k1_CURVE, Fp: Fpk1, lowS: true, endo: secp256k1_ENDO }, sha2_js_1.sha256); -// Schnorr signatures are superior to ECDSA from above. Below is Schnorr-specific BIP0340 code. -// https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki -/** An object mapping tags to their tagged hash prefix of [SHA256(tag) | SHA256(tag)] */ -const TAGGED_HASH_PREFIXES = {}; -function taggedHash(tag, ...messages) { - let tagP = TAGGED_HASH_PREFIXES[tag]; - if (tagP === undefined) { - const tagH = (0, sha2_js_1.sha256)((0, utils_ts_1.utf8ToBytes)(tag)); - tagP = (0, utils_ts_1.concatBytes)(tagH, tagH); - TAGGED_HASH_PREFIXES[tag] = tagP; - } - return (0, sha2_js_1.sha256)((0, utils_ts_1.concatBytes)(tagP, ...messages)); -} -// ECDSA compact points are 33-byte. Schnorr is 32: we strip first byte 0x02 or 0x03 -const pointToBytes = (point) => point.toBytes(true).slice(1); -const Pointk1 = /* @__PURE__ */ (() => exports.secp256k1.Point)(); -const hasEven = (y) => y % _2n === _0n; -// Calculate point, scalar and bytes -function schnorrGetExtPubKey(priv) { - const { Fn, BASE } = Pointk1; - const d_ = (0, weierstrass_ts_1._normFnElement)(Fn, priv); - const p = BASE.multiply(d_); // P = d'⋅G; 0 < d' < n check is done inside - const scalar = hasEven(p.y) ? d_ : Fn.neg(d_); - return { scalar, bytes: pointToBytes(p) }; -} -/** - * lift_x from BIP340. Convert 32-byte x coordinate to elliptic curve point. - * @returns valid point checked for being on-curve - */ -function lift_x(x) { - const Fp = Fpk1; - if (!Fp.isValidNot0(x)) - throw new Error('invalid x: Fail if x ≥ p'); - const xx = Fp.create(x * x); - const c = Fp.create(xx * x + BigInt(7)); // Let c = x³ + 7 mod p. - let y = Fp.sqrt(c); // Let y = c^(p+1)/4 mod p. Same as sqrt(). - // Return the unique point P such that x(P) = x and - // y(P) = y if y mod 2 = 0 or y(P) = p-y otherwise. - if (!hasEven(y)) - y = Fp.neg(y); - const p = Pointk1.fromAffine({ x, y }); - p.assertValidity(); - return p; -} -const num = utils_ts_1.bytesToNumberBE; -/** - * Create tagged hash, convert it to bigint, reduce modulo-n. - */ -function challenge(...args) { - return Pointk1.Fn.create(num(taggedHash('BIP0340/challenge', ...args))); -} -/** - * Schnorr public key is just `x` coordinate of Point as per BIP340. - */ -function schnorrGetPublicKey(secretKey) { - return schnorrGetExtPubKey(secretKey).bytes; // d'=int(sk). Fail if d'=0 or d'≥n. Ret bytes(d'⋅G) -} -/** - * Creates Schnorr signature as per BIP340. Verifies itself before returning anything. - * auxRand is optional and is not the sole source of k generation: bad CSPRNG won't be dangerous. - */ -function schnorrSign(message, secretKey, auxRand = (0, utils_js_1.randomBytes)(32)) { - const { Fn } = Pointk1; - const m = (0, utils_ts_1.ensureBytes)('message', message); - const { bytes: px, scalar: d } = schnorrGetExtPubKey(secretKey); // checks for isWithinCurveOrder - const a = (0, utils_ts_1.ensureBytes)('auxRand', auxRand, 32); // Auxiliary random data a: a 32-byte array - const t = Fn.toBytes(d ^ num(taggedHash('BIP0340/aux', a))); // Let t be the byte-wise xor of bytes(d) and hash/aux(a) - const rand = taggedHash('BIP0340/nonce', t, px, m); // Let rand = hash/nonce(t || bytes(P) || m) - // Let k' = int(rand) mod n. Fail if k' = 0. Let R = k'⋅G - const { bytes: rx, scalar: k } = schnorrGetExtPubKey(rand); - const e = challenge(rx, px, m); // Let e = int(hash/challenge(bytes(R) || bytes(P) || m)) mod n. - const sig = new Uint8Array(64); // Let sig = bytes(R) || bytes((k + ed) mod n). - sig.set(rx, 0); - sig.set(Fn.toBytes(Fn.create(k + e * d)), 32); - // If Verify(bytes(P), m, sig) (see below) returns failure, abort - if (!schnorrVerify(sig, m, px)) - throw new Error('sign: Invalid signature produced'); - return sig; -} -/** - * Verifies Schnorr signature. - * Will swallow errors & return false except for initial type validation of arguments. - */ -function schnorrVerify(signature, message, publicKey) { - const { Fn, BASE } = Pointk1; - const sig = (0, utils_ts_1.ensureBytes)('signature', signature, 64); - const m = (0, utils_ts_1.ensureBytes)('message', message); - const pub = (0, utils_ts_1.ensureBytes)('publicKey', publicKey, 32); - try { - const P = lift_x(num(pub)); // P = lift_x(int(pk)); fail if that fails - const r = num(sig.subarray(0, 32)); // Let r = int(sig[0:32]); fail if r ≥ p. - if (!(0, utils_ts_1.inRange)(r, _1n, secp256k1_CURVE.p)) - return false; - const s = num(sig.subarray(32, 64)); // Let s = int(sig[32:64]); fail if s ≥ n. - if (!(0, utils_ts_1.inRange)(s, _1n, secp256k1_CURVE.n)) - return false; - // int(challenge(bytes(r)||bytes(P)||m))%n - const e = challenge(Fn.toBytes(r), pointToBytes(P), m); - // R = s⋅G - e⋅P, where -eP == (n-e)P - const R = BASE.multiplyUnsafe(s).add(P.multiplyUnsafe(Fn.neg(e))); - const { x, y } = R.toAffine(); - // Fail if is_infinite(R) / not has_even_y(R) / x(R) ≠ r. - if (R.is0() || !hasEven(y) || x !== r) - return false; - return true; - } - catch (error) { - return false; - } -} -/** - * Schnorr signatures over secp256k1. - * https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki - * @example - * ```js - * import { schnorr } from '@noble/curves/secp256k1'; - * const { secretKey, publicKey } = schnorr.keygen(); - * // const publicKey = schnorr.getPublicKey(secretKey); - * const msg = new TextEncoder().encode('hello'); - * const sig = schnorr.sign(msg, secretKey); - * const isValid = schnorr.verify(sig, msg, publicKey); - * ``` - */ -exports.schnorr = (() => { - const size = 32; - const seedLength = 48; - const randomSecretKey = (seed = (0, utils_js_1.randomBytes)(seedLength)) => { - return (0, modular_ts_1.mapHashToField)(seed, secp256k1_CURVE.n); - }; - // TODO: remove - exports.secp256k1.utils.randomSecretKey; - function keygen(seed) { - const secretKey = randomSecretKey(seed); - return { secretKey, publicKey: schnorrGetPublicKey(secretKey) }; - } - return { - keygen, - getPublicKey: schnorrGetPublicKey, - sign: schnorrSign, - verify: schnorrVerify, - Point: Pointk1, - utils: { - randomSecretKey: randomSecretKey, - randomPrivateKey: randomSecretKey, - taggedHash, - // TODO: remove - lift_x, - pointToBytes, - numberToBytesBE: utils_ts_1.numberToBytesBE, - bytesToNumberBE: utils_ts_1.bytesToNumberBE, - mod: modular_ts_1.mod, - }, - lengths: { - secretKey: size, - publicKey: size, - publicKeyHasPrefix: false, - signature: size * 2, - seed: seedLength, - }, - }; -})(); -const isoMap = /* @__PURE__ */ (() => (0, hash_to_curve_ts_1.isogenyMap)(Fpk1, [ - // xNum - [ - '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7', - '0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581', - '0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262', - '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c', - ], - // xDen - [ - '0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b', - '0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14', - '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1 - ], - // yNum - [ - '0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c', - '0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3', - '0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931', - '0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84', - ], - // yDen - [ - '0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b', - '0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573', - '0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f', - '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1 - ], -].map((i) => i.map((j) => BigInt(j)))))(); -const mapSWU = /* @__PURE__ */ (() => (0, weierstrass_ts_1.mapToCurveSimpleSWU)(Fpk1, { - A: BigInt('0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533'), - B: BigInt('1771'), - Z: Fpk1.create(BigInt('-11')), -}))(); -/** Hashing / encoding to secp256k1 points / field. RFC 9380 methods. */ -exports.secp256k1_hasher = (() => (0, hash_to_curve_ts_1.createHasher)(exports.secp256k1.Point, (scalars) => { - const { x, y } = mapSWU(Fpk1.create(scalars[0])); - return isoMap(x, y); -}, { - DST: 'secp256k1_XMD:SHA-256_SSWU_RO_', - encodeDST: 'secp256k1_XMD:SHA-256_SSWU_NU_', - p: Fpk1.ORDER, - m: 1, - k: 128, - expand: 'xmd', - hash: sha2_js_1.sha256, -}))(); -/** @deprecated use `import { secp256k1_hasher } from '@noble/curves/secp256k1.js';` */ -exports.hashToCurve = (() => exports.secp256k1_hasher.hashToCurve)(); -/** @deprecated use `import { secp256k1_hasher } from '@noble/curves/secp256k1.js';` */ -exports.encodeToCurve = (() => exports.secp256k1_hasher.encodeToCurve)(); -//# sourceMappingURL=secp256k1.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/secp256k1.js.map b/tools/mnemonic-test/node_modules/@noble/curves/secp256k1.js.map deleted file mode 100644 index b9d0827a..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/secp256k1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"secp256k1.js","sourceRoot":"","sources":["src/secp256k1.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,sEAAsE;AACtE,mDAA+C;AAC/C,qDAAqD;AACrD,yDAAyE;AAEzE,kEAKqC;AACrC,sDAAyE;AACzE,8DAOmC;AAEnC,yCAOoB;AAEpB,oDAAoD;AACpD,0DAA0D;AAC1D,iEAAiE;AACjE,MAAM,eAAe,GAA4B;IAC/C,CAAC,EAAE,MAAM,CAAC,oEAAoE,CAAC;IAC/E,CAAC,EAAE,MAAM,CAAC,oEAAoE,CAAC;IAC/E,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC,oEAAoE,CAAC;IAChF,EAAE,EAAE,MAAM,CAAC,oEAAoE,CAAC;CACjF,CAAC;AAEF,M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file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/src/_shortw_utils.ts b/tools/mnemonic-test/node_modules/@noble/curves/src/_shortw_utils.ts deleted file mode 100644 index 9297975d..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/src/_shortw_utils.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Utilities for short weierstrass curves, combined with noble-hashes. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { type CurveFn, type CurveType, weierstrass } from './abstract/weierstrass.ts'; -import type { CHash } from './utils.ts'; - -/** connects noble-curves to noble-hashes */ -export function getHash(hash: CHash): { hash: CHash } { - return { hash }; -} -/** Same API as @noble/hashes, with ability to create curve with custom hash */ -export type CurveDef = Readonly>; -export type CurveFnWithCreate = CurveFn & { create: (hash: CHash) => CurveFn }; - -/** @deprecated use new `weierstrass()` and `ecdsa()` methods */ -export function createCurve(curveDef: CurveDef, defHash: CHash): CurveFnWithCreate { - const create = (hash: CHash): CurveFn => weierstrass({ ...curveDef, hash: hash }); - return { ...create(defHash), create }; -} diff --git a/tools/mnemonic-test/node_modules/@noble/curves/src/abstract/bls.ts b/tools/mnemonic-test/node_modules/@noble/curves/src/abstract/bls.ts deleted file mode 100644 index 7811b3c3..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/src/abstract/bls.ts +++ /dev/null @@ -1,747 +0,0 @@ -/** - * BLS != BLS. - * The file implements BLS (Boneh-Lynn-Shacham) signatures. - * Used in both BLS (Barreto-Lynn-Scott) and BN (Barreto-Naehrig) - * families of pairing-friendly curves. - * Consists of two curves: G1 and G2: - * - G1 is a subgroup of (x, y) E(Fq) over y² = x³ + 4. - * - G2 is a subgroup of ((x₁, x₂+i), (y₁, y₂+i)) E(Fq²) over y² = x³ + 4(1 + i) where i is √-1 - * - Gt, created by bilinear (ate) pairing e(G1, G2), consists of p-th roots of unity in - * Fq^k where k is embedding degree. Only degree 12 is currently supported, 24 is not. - * Pairing is used to aggregate and verify signatures. - * There are two modes of operation: - * - Long signatures: X-byte keys + 2X-byte sigs (G1 keys + G2 sigs). - * - Short signatures: 2X-byte keys + X-byte sigs (G2 keys + G1 sigs). - * @module - **/ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { - abytes, - ensureBytes, - memoized, - randomBytes, - type CHash, - type Hex, - type PrivKey, -} from '../utils.ts'; -import { normalizeZ } from './curve.ts'; -import { - createHasher, - type H2CHasher, - type H2CHashOpts, - type H2COpts, - type H2CPointConstructor, - type htfBasicOpts, - type MapToCurve, -} from './hash-to-curve.ts'; -import { getMinHashLength, mapHashToField, type IField } from './modular.ts'; -import type { Fp12, Fp12Bls, Fp2, Fp2Bls, Fp6Bls } from './tower.ts'; -import { - _normFnElement, - weierstrassPoints, - type CurvePointsRes, - type CurvePointsType, - type WeierstrassPoint, - type WeierstrassPointCons, -} from './weierstrass.ts'; - -type Fp = bigint; // Can be different field? - -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3); - -export type TwistType = 'multiplicative' | 'divisive'; - -export type ShortSignatureCoder = { - fromBytes(bytes: Uint8Array): WeierstrassPoint; - fromHex(hex: Hex): WeierstrassPoint; - toBytes(point: WeierstrassPoint): Uint8Array; - toHex(point: WeierstrassPoint): string; - /** @deprecated use `toBytes` */ - toRawBytes(point: WeierstrassPoint): Uint8Array; -}; - -export type SignatureCoder = { - fromBytes(bytes: Uint8Array): WeierstrassPoint; - fromHex(hex: Hex): WeierstrassPoint; - toBytes(point: WeierstrassPoint): Uint8Array; - toHex(point: WeierstrassPoint): string; - /** @deprecated use `toBytes` */ - toRawBytes(point: WeierstrassPoint): Uint8Array; -}; - -export type BlsFields = { - Fp: IField; - Fr: IField; - Fp2: Fp2Bls; - Fp6: Fp6Bls; - Fp12: Fp12Bls; -}; - -export type PostPrecomputePointAddFn = ( - Rx: Fp2, - Ry: Fp2, - Rz: Fp2, - Qx: Fp2, - Qy: Fp2 -) => { Rx: Fp2; Ry: Fp2; Rz: Fp2 }; -export type PostPrecomputeFn = ( - Rx: Fp2, - Ry: Fp2, - Rz: Fp2, - Qx: Fp2, - Qy: Fp2, - pointAdd: PostPrecomputePointAddFn -) => void; -export type BlsPairing = { - Fp12: Fp12Bls; - calcPairingPrecomputes: (p: WeierstrassPoint) => Precompute; - millerLoopBatch: (pairs: [Precompute, Fp, Fp][]) => Fp12; - pairing: (P: WeierstrassPoint, Q: WeierstrassPoint, withFinalExponent?: boolean) => Fp12; - pairingBatch: ( - pairs: { g1: WeierstrassPoint; g2: WeierstrassPoint }[], - withFinalExponent?: boolean - ) => Fp12; -}; -// TODO: replace CurveType with this? It doesn't contain r however and has postPrecompute -export type BlsPairingParams = { - // NOTE: MSB is always ignored and used as marker for length, - // otherwise leading zeros will be lost. - // Can be different from 'X' (seed) param! - ateLoopSize: bigint; - xNegative: boolean; - twistType: TwistType; // BLS12-381: Multiplicative, BN254: Divisive - // This is super ugly hack for untwist point in BN254 after miller loop - postPrecompute?: PostPrecomputeFn; -}; -export type CurveType = { - G1: CurvePointsType & { - ShortSignature: SignatureCoder; - mapToCurve: MapToCurve; - htfDefaults: H2COpts; - }; - G2: CurvePointsType & { - Signature: SignatureCoder; - mapToCurve: MapToCurve; - htfDefaults: H2COpts; - }; - fields: BlsFields; - params: { - // NOTE: MSB is always ignored and used as marker for length, - // otherwise leading zeros will be lost. - // Can be different from 'X' (seed) param! - ateLoopSize: BlsPairingParams['ateLoopSize']; - xNegative: BlsPairingParams['xNegative']; - r: bigint; // TODO: remove - twistType: BlsPairingParams['twistType']; // BLS12-381: Multiplicative, BN254: Divisive - }; - htfDefaults: H2COpts; - hash: CHash; // Because we need outputLen for DRBG - randomBytes?: (bytesLength?: number) => Uint8Array; - // This is super ugly hack for untwist point in BN254 after miller loop - postPrecompute?: PostPrecomputeFn; -}; - -type PrecomputeSingle = [Fp2, Fp2, Fp2][]; -type Precompute = PrecomputeSingle[]; - -/** - * BLS consists of two curves: G1 and G2: - * - G1 is a subgroup of (x, y) E(Fq) over y² = x³ + 4. - * - G2 is a subgroup of ((x₁, x₂+i), (y₁, y₂+i)) E(Fq²) over y² = x³ + 4(1 + i) where i is √-1 - */ -export interface BLSCurvePair { - longSignatures: BLSSigs; - shortSignatures: BLSSigs; - millerLoopBatch: BlsPairing['millerLoopBatch']; - pairing: BlsPairing['pairing']; - pairingBatch: BlsPairing['pairingBatch']; - G1: { Point: WeierstrassPointCons } & H2CHasher; - G2: { Point: WeierstrassPointCons } & H2CHasher; - fields: { - Fp: IField; - Fp2: Fp2Bls; - Fp6: Fp6Bls; - Fp12: Fp12Bls; - Fr: IField; - }; - utils: { - randomSecretKey: () => Uint8Array; - /** @deprecated use randomSecretKey */ - randomPrivateKey: () => Uint8Array; - calcPairingPrecomputes: BlsPairing['calcPairingPrecomputes']; - }; -} - -export type CurveFn = BLSCurvePair & { - /** @deprecated use `longSignatures.getPublicKey` */ - getPublicKey: (secretKey: PrivKey) => Uint8Array; - /** @deprecated use `shortSignatures.getPublicKey` */ - getPublicKeyForShortSignatures: (secretKey: PrivKey) => Uint8Array; - /** @deprecated use `longSignatures.sign` */ - sign: { - (message: Hex, secretKey: PrivKey, htfOpts?: htfBasicOpts): Uint8Array; - ( - message: WeierstrassPoint, - secretKey: PrivKey, - htfOpts?: htfBasicOpts - ): WeierstrassPoint; - }; - /** @deprecated use `shortSignatures.sign` */ - signShortSignature: { - (message: Hex, secretKey: PrivKey, htfOpts?: htfBasicOpts): Uint8Array; - ( - message: WeierstrassPoint, - secretKey: PrivKey, - htfOpts?: htfBasicOpts - ): WeierstrassPoint; - }; - /** @deprecated use `longSignatures.verify` */ - verify: ( - signature: Hex | WeierstrassPoint, - message: Hex | WeierstrassPoint, - publicKey: Hex | WeierstrassPoint, - htfOpts?: htfBasicOpts - ) => boolean; - /** @deprecated use `shortSignatures.verify` */ - verifyShortSignature: ( - signature: Hex | WeierstrassPoint, - message: Hex | WeierstrassPoint, - publicKey: Hex | WeierstrassPoint, - htfOpts?: htfBasicOpts - ) => boolean; - verifyBatch: ( - signature: Hex | WeierstrassPoint, - messages: (Hex | WeierstrassPoint)[], - publicKeys: (Hex | WeierstrassPoint)[], - htfOpts?: htfBasicOpts - ) => boolean; - /** @deprecated use `longSignatures.aggregatePublicKeys` */ - aggregatePublicKeys: { - (publicKeys: Hex[]): Uint8Array; - (publicKeys: WeierstrassPoint[]): WeierstrassPoint; - }; - /** @deprecated use `longSignatures.aggregateSignatures` */ - aggregateSignatures: { - (signatures: Hex[]): Uint8Array; - (signatures: WeierstrassPoint[]): WeierstrassPoint; - }; - /** @deprecated use `shortSignatures.aggregateSignatures` */ - aggregateShortSignatures: { - (signatures: Hex[]): Uint8Array; - (signatures: WeierstrassPoint[]): WeierstrassPoint; - }; - G1: CurvePointsRes & H2CHasher; - G2: CurvePointsRes & H2CHasher; - /** @deprecated use `longSignatures.Signature` */ - Signature: SignatureCoder; - /** @deprecated use `shortSignatures.Signature` */ - ShortSignature: ShortSignatureCoder; - params: { - ateLoopSize: bigint; - r: bigint; - twistType: TwistType; - /** @deprecated */ - G1b: bigint; - /** @deprecated */ - G2b: Fp2; - }; -}; - -type BLSInput = Hex | Uint8Array; -export interface BLSSigs { - getPublicKey(secretKey: PrivKey): WeierstrassPoint

; - sign(hashedMessage: WeierstrassPoint, secretKey: PrivKey): WeierstrassPoint; - verify( - signature: WeierstrassPoint | BLSInput, - message: WeierstrassPoint, - publicKey: WeierstrassPoint

| BLSInput - ): boolean; - verifyBatch: ( - signature: WeierstrassPoint | BLSInput, - messages: WeierstrassPoint[], - publicKeys: (WeierstrassPoint

| BLSInput)[] - ) => boolean; - aggregatePublicKeys(publicKeys: (WeierstrassPoint

| BLSInput)[]): WeierstrassPoint

; - aggregateSignatures(signatures: (WeierstrassPoint | BLSInput)[]): WeierstrassPoint; - hash(message: Uint8Array, DST?: string | Uint8Array, hashOpts?: H2CHashOpts): WeierstrassPoint; - Signature: SignatureCoder; -} - -// Not used with BLS12-381 (no sequential `11` in X). Useful for other curves. -function NAfDecomposition(a: bigint) { - const res = []; - // a>1 because of marker bit - for (; a > _1n; a >>= _1n) { - if ((a & _1n) === _0n) res.unshift(0); - else if ((a & _3n) === _3n) { - res.unshift(-1); - a += _1n; - } else res.unshift(1); - } - return res; -} - -function aNonEmpty(arr: any[]) { - if (!Array.isArray(arr) || arr.length === 0) throw new Error('expected non-empty array'); -} - -// This should be enough for bn254, no need to export full stuff? -function createBlsPairing( - fields: BlsFields, - G1: WeierstrassPointCons, - G2: WeierstrassPointCons, - params: BlsPairingParams -): BlsPairing { - const { Fp2, Fp12 } = fields; - const { twistType, ateLoopSize, xNegative, postPrecompute } = params; - type G1 = typeof G1.BASE; - type G2 = typeof G2.BASE; - // Applies sparse multiplication as line function - let lineFunction: (c0: Fp2, c1: Fp2, c2: Fp2, f: Fp12, Px: Fp, Py: Fp) => Fp12; - if (twistType === 'multiplicative') { - lineFunction = (c0: Fp2, c1: Fp2, c2: Fp2, f: Fp12, Px: Fp, Py: Fp) => - Fp12.mul014(f, c0, Fp2.mul(c1, Px), Fp2.mul(c2, Py)); - } else if (twistType === 'divisive') { - // NOTE: it should be [c0, c1, c2], but we use different order here to reduce complexity of - // precompute calculations. - lineFunction = (c0: Fp2, c1: Fp2, c2: Fp2, f: Fp12, Px: Fp, Py: Fp) => - Fp12.mul034(f, Fp2.mul(c2, Py), Fp2.mul(c1, Px), c0); - } else throw new Error('bls: unknown twist type'); - - const Fp2div2 = Fp2.div(Fp2.ONE, Fp2.mul(Fp2.ONE, _2n)); - function pointDouble(ell: PrecomputeSingle, Rx: Fp2, Ry: Fp2, Rz: Fp2) { - const t0 = Fp2.sqr(Ry); // Ry² - const t1 = Fp2.sqr(Rz); // Rz² - const t2 = Fp2.mulByB(Fp2.mul(t1, _3n)); // 3 * T1 * B - const t3 = Fp2.mul(t2, _3n); // 3 * T2 - const t4 = Fp2.sub(Fp2.sub(Fp2.sqr(Fp2.add(Ry, Rz)), t1), t0); // (Ry + Rz)² - T1 - T0 - const c0 = Fp2.sub(t2, t0); // T2 - T0 (i) - const c1 = Fp2.mul(Fp2.sqr(Rx), _3n); // 3 * Rx² - const c2 = Fp2.neg(t4); // -T4 (-h) - - ell.push([c0, c1, c2]); - - Rx = Fp2.mul(Fp2.mul(Fp2.mul(Fp2.sub(t0, t3), Rx), Ry), Fp2div2); // ((T0 - T3) * Rx * Ry) / 2 - Ry = Fp2.sub(Fp2.sqr(Fp2.mul(Fp2.add(t0, t3), Fp2div2)), Fp2.mul(Fp2.sqr(t2), _3n)); // ((T0 + T3) / 2)² - 3 * T2² - Rz = Fp2.mul(t0, t4); // T0 * T4 - return { Rx, Ry, Rz }; - } - function pointAdd(ell: PrecomputeSingle, Rx: Fp2, Ry: Fp2, Rz: Fp2, Qx: Fp2, Qy: Fp2) { - // Addition - const t0 = Fp2.sub(Ry, Fp2.mul(Qy, Rz)); // Ry - Qy * Rz - const t1 = Fp2.sub(Rx, Fp2.mul(Qx, Rz)); // Rx - Qx * Rz - const c0 = Fp2.sub(Fp2.mul(t0, Qx), Fp2.mul(t1, Qy)); // T0 * Qx - T1 * Qy == Ry * Qx - Rx * Qy - const c1 = Fp2.neg(t0); // -T0 == Qy * Rz - Ry - const c2 = t1; // == Rx - Qx * Rz - - ell.push([c0, c1, c2]); - - const t2 = Fp2.sqr(t1); // T1² - const t3 = Fp2.mul(t2, t1); // T2 * T1 - const t4 = Fp2.mul(t2, Rx); // T2 * Rx - const t5 = Fp2.add(Fp2.sub(t3, Fp2.mul(t4, _2n)), Fp2.mul(Fp2.sqr(t0), Rz)); // T3 - 2 * T4 + T0² * Rz - Rx = Fp2.mul(t1, t5); // T1 * T5 - Ry = Fp2.sub(Fp2.mul(Fp2.sub(t4, t5), t0), Fp2.mul(t3, Ry)); // (T4 - T5) * T0 - T3 * Ry - Rz = Fp2.mul(Rz, t3); // Rz * T3 - return { Rx, Ry, Rz }; - } - - // Pre-compute coefficients for sparse multiplication - // Point addition and point double calculations is reused for coefficients - // pointAdd happens only if bit set, so wNAF is reasonable. Unfortunately we cannot combine - // add + double in windowed precomputes here, otherwise it would be single op (since X is static) - const ATE_NAF = NAfDecomposition(ateLoopSize); - - const calcPairingPrecomputes = memoized((point: G2) => { - const p = point; - const { x, y } = p.toAffine(); - // prettier-ignore - const Qx = x, Qy = y, negQy = Fp2.neg(y); - // prettier-ignore - let Rx = Qx, Ry = Qy, Rz = Fp2.ONE; - const ell: Precompute = []; - for (const bit of ATE_NAF) { - const cur: PrecomputeSingle = []; - ({ Rx, Ry, Rz } = pointDouble(cur, Rx, Ry, Rz)); - if (bit) ({ Rx, Ry, Rz } = pointAdd(cur, Rx, Ry, Rz, Qx, bit === -1 ? negQy : Qy)); - ell.push(cur); - } - if (postPrecompute) { - const last = ell[ell.length - 1]; - postPrecompute(Rx, Ry, Rz, Qx, Qy, pointAdd.bind(null, last)); - } - return ell; - }); - - // Main pairing logic is here. Computes product of miller loops + final exponentiate - // Applies calculated precomputes - type MillerInput = [Precompute, Fp, Fp][]; - function millerLoopBatch(pairs: MillerInput, withFinalExponent: boolean = false) { - let f12 = Fp12.ONE; - if (pairs.length) { - const ellLen = pairs[0][0].length; - for (let i = 0; i < ellLen; i++) { - f12 = Fp12.sqr(f12); // This allows us to do sqr only one time for all pairings - // NOTE: we apply multiple pairings in parallel here - for (const [ell, Px, Py] of pairs) { - for (const [c0, c1, c2] of ell[i]) f12 = lineFunction(c0, c1, c2, f12, Px, Py); - } - } - } - if (xNegative) f12 = Fp12.conjugate(f12); - return withFinalExponent ? Fp12.finalExponentiate(f12) : f12; - } - type PairingInput = { g1: G1; g2: G2 }; - // Calculates product of multiple pairings - // This up to x2 faster than just `map(({g1, g2})=>pairing({g1,g2}))` - function pairingBatch(pairs: PairingInput[], withFinalExponent: boolean = true) { - const res: MillerInput = []; - // Cache precomputed toAffine for all points - normalizeZ( - G1, - pairs.map(({ g1 }) => g1) - ); - normalizeZ( - G2, - pairs.map(({ g2 }) => g2) - ); - for (const { g1, g2 } of pairs) { - if (g1.is0() || g2.is0()) throw new Error('pairing is not available for ZERO point'); - // This uses toAffine inside - g1.assertValidity(); - g2.assertValidity(); - const Qa = g1.toAffine(); - res.push([calcPairingPrecomputes(g2), Qa.x, Qa.y]); - } - return millerLoopBatch(res, withFinalExponent); - } - // Calculates bilinear pairing - function pairing(Q: G1, P: G2, withFinalExponent: boolean = true): Fp12 { - return pairingBatch([{ g1: Q, g2: P }], withFinalExponent); - } - return { - Fp12, // NOTE: we re-export Fp12 here because pairing results are Fp12! - millerLoopBatch, - pairing, - pairingBatch, - calcPairingPrecomputes, - }; -} - -function createBlsSig( - blsPairing: BlsPairing, - PubCurve: CurvePointsRes

& H2CHasher

, - SigCurve: CurvePointsRes & H2CHasher, - SignatureCoder: SignatureCoder, - isSigG1: boolean -): BLSSigs { - const { Fp12, pairingBatch } = blsPairing; - type PubPoint = WeierstrassPoint

; - type SigPoint = WeierstrassPoint; - function normPub(point: PubPoint | BLSInput): PubPoint { - return point instanceof PubCurve.Point ? (point as PubPoint) : PubCurve.Point.fromHex(point); - } - function normSig(point: SigPoint | BLSInput): SigPoint { - return point instanceof SigCurve.Point ? (point as SigPoint) : SigCurve.Point.fromHex(point); - } - function amsg(m: unknown): SigPoint { - if (!(m instanceof SigCurve.Point)) - throw new Error(`expected valid message hashed to ${!isSigG1 ? 'G2' : 'G1'} curve`); - return m as SigPoint; - } - - type G1 = CurvePointsRes['Point']['BASE']; - type G2 = CurvePointsRes['Point']['BASE']; - type PairingInput = { g1: G1; g2: G2 }; - // What matters here is what point pairing API accepts as G1 or G2, not actual size or names - const pair: (a: PubPoint, b: SigPoint) => PairingInput = !isSigG1 - ? (a: PubPoint, b: SigPoint) => ({ g1: a, g2: b }) as PairingInput - : (a: PubPoint, b: SigPoint) => ({ g1: b, g2: a }) as PairingInput; - return { - // P = pk x G - getPublicKey(secretKey: PrivKey): PubPoint { - // TODO: replace with - // const sec = PubCurve.Point.Fn.fromBytes(secretKey); - const sec = _normFnElement(PubCurve.Point.Fn, secretKey); - return PubCurve.Point.BASE.multiply(sec); - }, - // S = pk x H(m) - sign(message: SigPoint, secretKey: PrivKey, unusedArg?: any): SigPoint { - if (unusedArg != null) throw new Error('sign() expects 2 arguments'); - // TODO: replace with - // PubCurve.Point.Fn.fromBytes(secretKey) - const sec = _normFnElement(PubCurve.Point.Fn, secretKey); - amsg(message).assertValidity(); - return message.multiply(sec); - }, - // Checks if pairing of public key & hash is equal to pairing of generator & signature. - // e(P, H(m)) == e(G, S) - // e(S, G) == e(H(m), P) - verify( - signature: SigPoint | BLSInput, - message: SigPoint, - publicKey: PubPoint | BLSInput, - unusedArg?: any - ): boolean { - if (unusedArg != null) throw new Error('verify() expects 3 arguments'); - signature = normSig(signature); - publicKey = normPub(publicKey); - const P = publicKey.negate(); - const G = PubCurve.Point.BASE; - const Hm = amsg(message); - const S = signature; - // This code was changed in 1.9.x: - // Before it was G.negate() in G2, now it's always pubKey.negate - // e(P, -Q)===e(-P, Q)==e(P, Q)^-1. Negate can be done anywhere (as long it is done once per pair). - // We just moving sign, but since pairing is multiplicative, we doing X * X^-1 = 1 - const exp = pairingBatch([pair(P, Hm), pair(G, S)]); - return Fp12.eql(exp, Fp12.ONE); - }, - // https://ethresear.ch/t/fast-verification-of-multiple-bls-signatures/5407 - // e(G, S) = e(G, SUM(n)(Si)) = MUL(n)(e(G, Si)) - // TODO: maybe `{message: G2Hex, publicKey: G1Hex}[]` instead? - verifyBatch( - signature: SigPoint | BLSInput, - messages: SigPoint[], - publicKeys: (PubPoint | BLSInput)[] - ): boolean { - aNonEmpty(messages); - if (publicKeys.length !== messages.length) - throw new Error('amount of public keys and messages should be equal'); - const sig = normSig(signature); - const nMessages = messages; - const nPublicKeys = publicKeys.map(normPub); - // NOTE: this works only for exact same object - const messagePubKeyMap = new Map(); - for (let i = 0; i < nPublicKeys.length; i++) { - const pub = nPublicKeys[i]; - const msg = nMessages[i]; - let keys = messagePubKeyMap.get(msg); - if (keys === undefined) { - keys = []; - messagePubKeyMap.set(msg, keys); - } - keys.push(pub); - } - const paired = []; - const G = PubCurve.Point.BASE; - try { - for (const [msg, keys] of messagePubKeyMap) { - const groupPublicKey = keys.reduce((acc, msg) => acc.add(msg)); - paired.push(pair(groupPublicKey, msg)); - } - paired.push(pair(G.negate(), sig)); - return Fp12.eql(pairingBatch(paired), Fp12.ONE); - } catch { - return false; - } - }, - // Adds a bunch of public key points together. - // pk1 + pk2 + pk3 = pkA - aggregatePublicKeys(publicKeys: (PubPoint | BLSInput)[]): PubPoint { - aNonEmpty(publicKeys); - publicKeys = publicKeys.map((pub) => normPub(pub)); - const agg = (publicKeys as PubPoint[]).reduce((sum, p) => sum.add(p), PubCurve.Point.ZERO); - agg.assertValidity(); - return agg; - }, - - // Adds a bunch of signature points together. - // pk1 + pk2 + pk3 = pkA - aggregateSignatures(signatures: (SigPoint | BLSInput)[]): SigPoint { - aNonEmpty(signatures); - signatures = signatures.map((sig) => normSig(sig)); - const agg = (signatures as SigPoint[]).reduce((sum, s) => sum.add(s), SigCurve.Point.ZERO); - agg.assertValidity(); - return agg; - }, - - hash(messageBytes: Uint8Array, DST?: string | Uint8Array): SigPoint { - abytes(messageBytes); - const opts = DST ? { DST } : undefined; - return SigCurve.hashToCurve(messageBytes, opts) as SigPoint; - }, - Signature: SignatureCoder, - }; -} - -// G1_Point: ProjConstructor, G2_Point: ProjConstructor, -export function bls(CURVE: CurveType): CurveFn { - // Fields are specific for curve, so for now we'll need to pass them with opts - const { Fp, Fr, Fp2, Fp6, Fp12 } = CURVE.fields; - // Point on G1 curve: (x, y) - const G1_ = weierstrassPoints(CURVE.G1); - const G1 = Object.assign( - G1_, - createHasher(G1_.Point, CURVE.G1.mapToCurve, { - ...CURVE.htfDefaults, - ...CURVE.G1.htfDefaults, - }) - ); - // Point on G2 curve (complex numbers): (x₁, x₂+i), (y₁, y₂+i) - const G2_ = weierstrassPoints(CURVE.G2); - const G2 = Object.assign( - G2_, - createHasher(G2_.Point as H2CPointConstructor, CURVE.G2.mapToCurve, { - ...CURVE.htfDefaults, - ...CURVE.G2.htfDefaults, - }) - ); - type G1 = typeof G1.Point.BASE; - type G2 = typeof G2.Point.BASE; - - const pairingRes = createBlsPairing(CURVE.fields, G1.Point, G2.Point, { - ...CURVE.params, - postPrecompute: CURVE.postPrecompute, - }); - - const { millerLoopBatch, pairing, pairingBatch, calcPairingPrecomputes } = pairingRes; - const longSignatures = createBlsSig(pairingRes, G1, G2, CURVE.G2.Signature, false); - const shortSignatures = createBlsSig(pairingRes, G2, G1, CURVE.G1.ShortSignature, true); - - const rand = CURVE.randomBytes || randomBytes; - const randomSecretKey = (): Uint8Array => { - const length = getMinHashLength(Fr.ORDER); - return mapHashToField(rand(length), Fr.ORDER); - }; - const utils = { - randomSecretKey, - randomPrivateKey: randomSecretKey, - calcPairingPrecomputes, - }; - - // LEGACY code - type G1Hex = Hex | G1; - type G2Hex = Hex | G2; - - const { ShortSignature } = CURVE.G1; - const { Signature } = CURVE.G2; - - function normP1Hash(point: G1Hex, htfOpts?: htfBasicOpts): G1 { - return point instanceof G1.Point - ? point - : shortSignatures.hash(ensureBytes('point', point), htfOpts?.DST); - } - function normP2Hash(point: G2Hex, htfOpts?: htfBasicOpts): G2 { - return point instanceof G2.Point - ? point - : longSignatures.hash(ensureBytes('point', point), htfOpts?.DST); - } - - function getPublicKey(privateKey: PrivKey): Uint8Array { - return longSignatures.getPublicKey(privateKey).toBytes(true); - } - function getPublicKeyForShortSignatures(privateKey: PrivKey): Uint8Array { - return shortSignatures.getPublicKey(privateKey).toBytes(true); - } - function sign(message: Hex, privateKey: PrivKey, htfOpts?: htfBasicOpts): Uint8Array; - function sign(message: G2, privateKey: PrivKey, htfOpts?: htfBasicOpts): G2; - function sign(message: G2Hex, privateKey: PrivKey, htfOpts?: htfBasicOpts): Uint8Array | G2 { - const Hm = normP2Hash(message, htfOpts); - const S = longSignatures.sign(Hm, privateKey); - return message instanceof G2.Point ? S : Signature.toBytes(S); - } - function signShortSignature( - message: Hex, - privateKey: PrivKey, - htfOpts?: htfBasicOpts - ): Uint8Array; - function signShortSignature(message: G1, privateKey: PrivKey, htfOpts?: htfBasicOpts): G1; - function signShortSignature( - message: G1Hex, - privateKey: PrivKey, - htfOpts?: htfBasicOpts - ): Uint8Array | G1 { - const Hm = normP1Hash(message, htfOpts); - const S = shortSignatures.sign(Hm, privateKey); - return message instanceof G1.Point ? S : ShortSignature.toBytes(S); - } - function verify( - signature: G2Hex, - message: G2Hex, - publicKey: G1Hex, - htfOpts?: htfBasicOpts - ): boolean { - const Hm = normP2Hash(message, htfOpts); - return longSignatures.verify(signature, Hm, publicKey); - } - function verifyShortSignature( - signature: G1Hex, - message: G1Hex, - publicKey: G2Hex, - htfOpts?: htfBasicOpts - ): boolean { - const Hm = normP1Hash(message, htfOpts); - return shortSignatures.verify(signature, Hm, publicKey); - } - function aggregatePublicKeys(publicKeys: Hex[]): Uint8Array; - function aggregatePublicKeys(publicKeys: G1[]): G1; - function aggregatePublicKeys(publicKeys: G1Hex[]): Uint8Array | G1 { - const agg = longSignatures.aggregatePublicKeys(publicKeys); - return publicKeys[0] instanceof G1.Point ? agg : agg.toBytes(true); - } - function aggregateSignatures(signatures: Hex[]): Uint8Array; - function aggregateSignatures(signatures: G2[]): G2; - function aggregateSignatures(signatures: G2Hex[]): Uint8Array | G2 { - const agg = longSignatures.aggregateSignatures(signatures); - return signatures[0] instanceof G2.Point ? agg : Signature.toBytes(agg); - } - function aggregateShortSignatures(signatures: Hex[]): Uint8Array; - function aggregateShortSignatures(signatures: G1[]): G1; - function aggregateShortSignatures(signatures: G1Hex[]): Uint8Array | G1 { - const agg = shortSignatures.aggregateSignatures(signatures); - return signatures[0] instanceof G1.Point ? agg : ShortSignature.toBytes(agg); - } - function verifyBatch( - signature: G2Hex, - messages: G2Hex[], - publicKeys: G1Hex[], - htfOpts?: htfBasicOpts - ): boolean { - const Hm = messages.map((m) => normP2Hash(m, htfOpts)); - return longSignatures.verifyBatch(signature, Hm, publicKeys); - } - - G1.Point.BASE.precompute(4); - - return { - longSignatures, - shortSignatures, - millerLoopBatch, - pairing, - pairingBatch, - verifyBatch, - fields: { - Fr, - Fp, - Fp2, - Fp6, - Fp12, - }, - params: { - ateLoopSize: CURVE.params.ateLoopSize, - twistType: CURVE.params.twistType, - // deprecated - r: CURVE.params.r, - G1b: CURVE.G1.b, - G2b: CURVE.G2.b, - }, - utils, - - // deprecated - getPublicKey, - getPublicKeyForShortSignatures, - sign, - signShortSignature, - verify, - verifyShortSignature, - aggregatePublicKeys, - aggregateSignatures, - aggregateShortSignatures, - G1, - G2, - Signature, - ShortSignature, - }; -} diff --git a/tools/mnemonic-test/node_modules/@noble/curves/src/abstract/curve.ts b/tools/mnemonic-test/node_modules/@noble/curves/src/abstract/curve.ts deleted file mode 100644 index 5c06b765..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/src/abstract/curve.ts +++ /dev/null @@ -1,692 +0,0 @@ -/** - * Methods for elliptic curve multiplication by scalars. - * Contains wNAF, pippenger. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { bitLen, bitMask, validateObject } from '../utils.ts'; -import { Field, FpInvertBatch, nLength, validateField, type IField } from './modular.ts'; - -const _0n = BigInt(0); -const _1n = BigInt(1); - -export type AffinePoint = { - x: T; - y: T; -} & { Z?: never }; - -// This was initialy do this way to re-use montgomery ladder in field (add->mul,double->sqr), but -// that didn't happen and there is probably not much reason to have separate Group like this? -export interface Group> { - double(): T; - negate(): T; - add(other: T): T; - subtract(other: T): T; - equals(other: T): boolean; - multiply(scalar: bigint): T; - toAffine?(invertedZ?: any): AffinePoint; -} - -// We can't "abstract out" coordinates (X, Y, Z; and T in Edwards): argument names of constructor -// are not accessible. See Typescript gh-56093, gh-41594. -// -// We have to use recursive types, so it will return actual point, not constained `CurvePoint`. -// If, at any point, P is `any`, it will erase all types and replace it -// with `any`, because of recursion, `any implements CurvePoint`, -// but we lose all constrains on methods. - -/** Base interface for all elliptic curve Points. */ -export interface CurvePoint> extends Group

{ - /** Affine x coordinate. Different from projective / extended X coordinate. */ - x: F; - /** Affine y coordinate. Different from projective / extended Y coordinate. */ - y: F; - Z?: F; - double(): P; - negate(): P; - add(other: P): P; - subtract(other: P): P; - equals(other: P): boolean; - multiply(scalar: bigint): P; - assertValidity(): void; - clearCofactor(): P; - is0(): boolean; - isTorsionFree(): boolean; - isSmallOrder(): boolean; - multiplyUnsafe(scalar: bigint): P; - /** - * Massively speeds up `p.multiply(n)` by using precompute tables (caching). See {@link wNAF}. - * @param isLazy calculate cache now. Default (true) ensures it's deferred to first `multiply()` - */ - precompute(windowSize?: number, isLazy?: boolean): P; - /** Converts point to 2D xy affine coordinates */ - toAffine(invertedZ?: F): AffinePoint; - toBytes(): Uint8Array; - toHex(): string; -} - -/** Base interface for all elliptic curve Point constructors. */ -export interface CurvePointCons

> { - [Symbol.hasInstance]: (item: unknown) => boolean; - BASE: P; - ZERO: P; - /** Field for basic curve math */ - Fp: IField>; - /** Scalar field, for scalars in multiply and others */ - Fn: IField; - /** Creates point from x, y. Does NOT validate if the point is valid. Use `.assertValidity()`. */ - fromAffine(p: AffinePoint>): P; - fromBytes(bytes: Uint8Array): P; - fromHex(hex: Uint8Array | string): P; -} - -// Type inference helpers: PC - PointConstructor, P - Point, Fp - Field element -// Short names, because we use them a lot in result types: -// * we can't do 'P = GetCurvePoint': this is default value and doesn't constrain anything -// * we can't do 'type X = GetCurvePoint': it won't be accesible for arguments/return types -// * `CurvePointCons

>` constraints from interface definition -// won't propagate, if `PC extends CurvePointCons`: the P would be 'any', which is incorrect -// * PC could be super specific with super specific P, which implements CurvePoint. -// this means we need to do stuff like -// `function test

, PC extends CurvePointCons

>(` -// if we want type safety around P, otherwise PC_P will be any - -/** Returns Fp type from Point (P_F

== P.F) */ -export type P_F

> = P extends CurvePoint ? F : never; -/** Returns Fp type from PointCons (PC_F == PC.P.F) */ -export type PC_F>> = PC['Fp']['ZERO']; -/** Returns Point type from PointCons (PC_P == PC.P) */ -export type PC_P>> = PC['ZERO']; - -// Ugly hack to get proper type inference, because in typescript fails to infer resursively. -// The hack allows to do up to 10 chained operations without applying type erasure. -// -// Types which won't work: -// * `CurvePointCons>`, will return `any` after 1 operation -// * `CurvePointCons: WeierstrassPointCons extends CurvePointCons = false` -// * `P extends CurvePoint, PC extends CurvePointCons

` -// * It can't infer P from PC alone -// * Too many relations between F, P & PC -// * It will infer P/F if `arg: CurvePointCons`, but will fail if PC is generic -// * It will work correctly if there is an additional argument of type P -// * But generally, we don't want to parametrize `CurvePointCons` over `F`: it will complicate -// types, making them un-inferable -// prettier-ignore -export type PC_ANY = CurvePointCons< - CurvePoint - >>>>>>>>> ->; - -export interface CurveLengths { - secretKey?: number; - publicKey?: number; - publicKeyUncompressed?: number; - publicKeyHasPrefix?: boolean; - signature?: number; - seed?: number; -} -export type GroupConstructor = { - BASE: T; - ZERO: T; -}; -/** @deprecated */ -export type ExtendedGroupConstructor = GroupConstructor & { - Fp: IField; - Fn: IField; - fromAffine(ap: AffinePoint): T; -}; -export type Mapper = (i: T[]) => T[]; - -export function negateCt T }>(condition: boolean, item: T): T { - const neg = item.negate(); - return condition ? neg : item; -} - -/** - * Takes a bunch of Projective Points but executes only one - * inversion on all of them. Inversion is very slow operation, - * so this improves performance massively. - * Optimization: converts a list of projective points to a list of identical points with Z=1. - */ -export function normalizeZ

, PC extends CurvePointCons

>( - c: PC, - points: P[] -): P[] { - const invertedZs = FpInvertBatch( - c.Fp, - points.map((p) => p.Z!) - ); - return points.map((p, i) => c.fromAffine(p.toAffine(invertedZs[i]))); -} - -function validateW(W: number, bits: number) { - if (!Number.isSafeInteger(W) || W <= 0 || W > bits) - throw new Error('invalid window size, expected [1..' + bits + '], got W=' + W); -} - -/** Internal wNAF opts for specific W and scalarBits */ -export type WOpts = { - windows: number; - windowSize: number; - mask: bigint; - maxNumber: number; - shiftBy: bigint; -}; - -function calcWOpts(W: number, scalarBits: number): WOpts { - validateW(W, scalarBits); - const windows = Math.ceil(scalarBits / W) + 1; // W=8 33. Not 32, because we skip zero - const windowSize = 2 ** (W - 1); // W=8 128. Not 256, because we skip zero - const maxNumber = 2 ** W; // W=8 256 - const mask = bitMask(W); // W=8 255 == mask 0b11111111 - const shiftBy = BigInt(W); // W=8 8 - return { windows, windowSize, mask, maxNumber, shiftBy }; -} - -function calcOffsets(n: bigint, window: number, wOpts: WOpts) { - const { windowSize, mask, maxNumber, shiftBy } = wOpts; - let wbits = Number(n & mask); // extract W bits. - let nextN = n >> shiftBy; // shift number by W bits. - - // What actually happens here: - // const highestBit = Number(mask ^ (mask >> 1n)); - // let wbits2 = wbits - 1; // skip zero - // if (wbits2 & highestBit) { wbits2 ^= Number(mask); // (~); - - // split if bits > max: +224 => 256-32 - if (wbits > windowSize) { - // we skip zero, which means instead of `>= size-1`, we do `> size` - wbits -= maxNumber; // -32, can be maxNumber - wbits, but then we need to set isNeg here. - nextN += _1n; // +256 (carry) - } - const offsetStart = window * windowSize; - const offset = offsetStart + Math.abs(wbits) - 1; // -1 because we skip zero - const isZero = wbits === 0; // is current window slice a 0? - const isNeg = wbits < 0; // is current window slice negative? - const isNegF = window % 2 !== 0; // fake random statement for noise - const offsetF = offsetStart; // fake offset for noise - return { nextN, offset, isZero, isNeg, isNegF, offsetF }; -} - -function validateMSMPoints(points: any[], c: any) { - if (!Array.isArray(points)) throw new Error('array expected'); - points.forEach((p, i) => { - if (!(p instanceof c)) throw new Error('invalid point at index ' + i); - }); -} -function validateMSMScalars(scalars: any[], field: any) { - if (!Array.isArray(scalars)) throw new Error('array of scalars expected'); - scalars.forEach((s, i) => { - if (!field.isValid(s)) throw new Error('invalid scalar at index ' + i); - }); -} - -// Since points in different groups cannot be equal (different object constructor), -// we can have single place to store precomputes. -// Allows to make points frozen / immutable. -const pointPrecomputes = new WeakMap(); -const pointWindowSizes = new WeakMap(); - -function getW(P: any): number { - // To disable precomputes: - // return 1; - return pointWindowSizes.get(P) || 1; -} - -function assert0(n: bigint): void { - if (n !== _0n) throw new Error('invalid wNAF'); -} - -/** - * Elliptic curve multiplication of Point by scalar. Fragile. - * Table generation takes **30MB of ram and 10ms on high-end CPU**, - * but may take much longer on slow devices. Actual generation will happen on - * first call of `multiply()`. By default, `BASE` point is precomputed. - * - * Scalars should always be less than curve order: this should be checked inside of a curve itself. - * Creates precomputation tables for fast multiplication: - * - private scalar is split by fixed size windows of W bits - * - every window point is collected from window's table & added to accumulator - * - since windows are different, same point inside tables won't be accessed more than once per calc - * - each multiplication is 'Math.ceil(CURVE_ORDER / 𝑊) + 1' point additions (fixed for any scalar) - * - +1 window is neccessary for wNAF - * - wNAF reduces table size: 2x less memory + 2x faster generation, but 10% slower multiplication - * - * @todo Research returning 2d JS array of windows, instead of a single window. - * This would allow windows to be in different memory locations - */ -export class wNAF { - private readonly BASE: PC_P; - private readonly ZERO: PC_P; - private readonly Fn: PC['Fn']; - readonly bits: number; - - // Parametrized with a given Point class (not individual point) - constructor(Point: PC, bits: number) { - this.BASE = Point.BASE; - this.ZERO = Point.ZERO; - this.Fn = Point.Fn; - this.bits = bits; - } - - // non-const time multiplication ladder - _unsafeLadder(elm: PC_P, n: bigint, p: PC_P = this.ZERO): PC_P { - let d: PC_P = elm; - while (n > _0n) { - if (n & _1n) p = p.add(d); - d = d.double(); - n >>= _1n; - } - return p; - } - - /** - * Creates a wNAF precomputation window. Used for caching. - * Default window size is set by `utils.precompute()` and is equal to 8. - * Number of precomputed points depends on the curve size: - * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where: - * - 𝑊 is the window size - * - 𝑛 is the bitlength of the curve order. - * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224. - * @param point Point instance - * @param W window size - * @returns precomputed point tables flattened to a single array - */ - private precomputeWindow(point: PC_P, W: number): PC_P[] { - const { windows, windowSize } = calcWOpts(W, this.bits); - const points: PC_P[] = []; - let p: PC_P = point; - let base = p; - for (let window = 0; window < windows; window++) { - base = p; - points.push(base); - // i=1, bc we skip 0 - for (let i = 1; i < windowSize; i++) { - base = base.add(p); - points.push(base); - } - p = base.double(); - } - return points; - } - - /** - * Implements ec multiplication using precomputed tables and w-ary non-adjacent form. - * More compact implementation: - * https://github.com/paulmillr/noble-secp256k1/blob/47cb1669b6e506ad66b35fe7d76132ae97465da2/index.ts#L502-L541 - * @returns real and fake (for const-time) points - */ - private wNAF(W: number, precomputes: PC_P[], n: bigint): { p: PC_P; f: PC_P } { - // Scalar should be smaller than field order - if (!this.Fn.isValid(n)) throw new Error('invalid scalar'); - // Accumulators - let p = this.ZERO; - let f = this.BASE; - // This code was first written with assumption that 'f' and 'p' will never be infinity point: - // since each addition is multiplied by 2 ** W, it cannot cancel each other. However, - // there is negate now: it is possible that negated element from low value - // would be the same as high element, which will create carry into next window. - // It's not obvious how this can fail, but still worth investigating later. - const wo = calcWOpts(W, this.bits); - for (let window = 0; window < wo.windows; window++) { - // (n === _0n) is handled and not early-exited. isEven and offsetF are used for noise - const { nextN, offset, isZero, isNeg, isNegF, offsetF } = calcOffsets(n, window, wo); - n = nextN; - if (isZero) { - // bits are 0: add garbage to fake point - // Important part for const-time getPublicKey: add random "noise" point to f. - f = f.add(negateCt(isNegF, precomputes[offsetF])); - } else { - // bits are 1: add to result point - p = p.add(negateCt(isNeg, precomputes[offset])); - } - } - assert0(n); - // Return both real and fake points: JIT won't eliminate f. - // At this point there is a way to F be infinity-point even if p is not, - // which makes it less const-time: around 1 bigint multiply. - return { p, f }; - } - - /** - * Implements ec unsafe (non const-time) multiplication using precomputed tables and w-ary non-adjacent form. - * @param acc accumulator point to add result of multiplication - * @returns point - */ - private wNAFUnsafe( - W: number, - precomputes: PC_P[], - n: bigint, - acc: PC_P = this.ZERO - ): PC_P { - const wo = calcWOpts(W, this.bits); - for (let window = 0; window < wo.windows; window++) { - if (n === _0n) break; // Early-exit, skip 0 value - const { nextN, offset, isZero, isNeg } = calcOffsets(n, window, wo); - n = nextN; - if (isZero) { - // Window bits are 0: skip processing. - // Move to next window. - continue; - } else { - const item = precomputes[offset]; - acc = acc.add(isNeg ? item.negate() : item); // Re-using acc allows to save adds in MSM - } - } - assert0(n); - return acc; - } - - private getPrecomputes(W: number, point: PC_P, transform?: Mapper>): PC_P[] { - // Calculate precomputes on a first run, reuse them after - let comp = pointPrecomputes.get(point); - if (!comp) { - comp = this.precomputeWindow(point, W) as PC_P[]; - if (W !== 1) { - // Doing transform outside of if brings 15% perf hit - if (typeof transform === 'function') comp = transform(comp); - pointPrecomputes.set(point, comp); - } - } - return comp; - } - - cached( - point: PC_P, - scalar: bigint, - transform?: Mapper> - ): { p: PC_P; f: PC_P } { - const W = getW(point); - return this.wNAF(W, this.getPrecomputes(W, point, transform), scalar); - } - - unsafe(point: PC_P, scalar: bigint, transform?: Mapper>, prev?: PC_P): PC_P { - const W = getW(point); - if (W === 1) return this._unsafeLadder(point, scalar, prev); // For W=1 ladder is ~x2 faster - return this.wNAFUnsafe(W, this.getPrecomputes(W, point, transform), scalar, prev); - } - - // We calculate precomputes for elliptic curve point multiplication - // using windowed method. This specifies window size and - // stores precomputed values. Usually only base point would be precomputed. - createCache(P: PC_P, W: number): void { - validateW(W, this.bits); - pointWindowSizes.set(P, W); - pointPrecomputes.delete(P); - } - - hasCache(elm: PC_P): boolean { - return getW(elm) !== 1; - } -} - -/** - * Endomorphism-specific multiplication for Koblitz curves. - * Cost: 128 dbl, 0-256 adds. - */ -export function mulEndoUnsafe

, PC extends CurvePointCons

>( - Point: PC, - point: P, - k1: bigint, - k2: bigint -): { p1: P; p2: P } { - let acc = point; - let p1 = Point.ZERO; - let p2 = Point.ZERO; - while (k1 > _0n || k2 > _0n) { - if (k1 & _1n) p1 = p1.add(acc); - if (k2 & _1n) p2 = p2.add(acc); - acc = acc.double(); - k1 >>= _1n; - k2 >>= _1n; - } - return { p1, p2 }; -} - -/** - * Pippenger algorithm for multi-scalar multiplication (MSM, Pa + Qb + Rc + ...). - * 30x faster vs naive addition on L=4096, 10x faster than precomputes. - * For N=254bit, L=1, it does: 1024 ADD + 254 DBL. For L=5: 1536 ADD + 254 DBL. - * Algorithmically constant-time (for same L), even when 1 point + scalar, or when scalar = 0. - * @param c Curve Point constructor - * @param fieldN field over CURVE.N - important that it's not over CURVE.P - * @param points array of L curve points - * @param scalars array of L scalars (aka secret keys / bigints) - */ -export function pippenger

, PC extends CurvePointCons

>( - c: PC, - fieldN: IField, - points: P[], - scalars: bigint[] -): P { - // If we split scalars by some window (let's say 8 bits), every chunk will only - // take 256 buckets even if there are 4096 scalars, also re-uses double. - // TODO: - // - https://eprint.iacr.org/2024/750.pdf - // - https://tches.iacr.org/index.php/TCHES/article/view/10287 - // 0 is accepted in scalars - validateMSMPoints(points, c); - validateMSMScalars(scalars, fieldN); - const plength = points.length; - const slength = scalars.length; - if (plength !== slength) throw new Error('arrays of points and scalars must have equal length'); - // if (plength === 0) throw new Error('array must be of length >= 2'); - const zero = c.ZERO; - const wbits = bitLen(BigInt(plength)); - let windowSize = 1; // bits - if (wbits > 12) windowSize = wbits - 3; - else if (wbits > 4) windowSize = wbits - 2; - else if (wbits > 0) windowSize = 2; - const MASK = bitMask(windowSize); - const buckets = new Array(Number(MASK) + 1).fill(zero); // +1 for zero array - const lastBits = Math.floor((fieldN.BITS - 1) / windowSize) * windowSize; - let sum = zero; - for (let i = lastBits; i >= 0; i -= windowSize) { - buckets.fill(zero); - for (let j = 0; j < slength; j++) { - const scalar = scalars[j]; - const wbits = Number((scalar >> BigInt(i)) & MASK); - buckets[wbits] = buckets[wbits].add(points[j]); - } - let resI = zero; // not using this will do small speed-up, but will lose ct - // Skip first bucket, because it is zero - for (let j = buckets.length - 1, sumI = zero; j > 0; j--) { - sumI = sumI.add(buckets[j]); - resI = resI.add(sumI); - } - sum = sum.add(resI); - if (i !== 0) for (let j = 0; j < windowSize; j++) sum = sum.double(); - } - return sum as P; -} -/** - * Precomputed multi-scalar multiplication (MSM, Pa + Qb + Rc + ...). - * @param c Curve Point constructor - * @param fieldN field over CURVE.N - important that it's not over CURVE.P - * @param points array of L curve points - * @returns function which multiplies points with scaars - */ -export function precomputeMSMUnsafe

, PC extends CurvePointCons

>( - c: PC, - fieldN: IField, - points: P[], - windowSize: number -): (scalars: bigint[]) => P { - /** - * Performance Analysis of Window-based Precomputation - * - * Base Case (256-bit scalar, 8-bit window): - * - Standard precomputation requires: - * - 31 additions per scalar × 256 scalars = 7,936 ops - * - Plus 255 summary additions = 8,191 total ops - * Note: Summary additions can be optimized via accumulator - * - * Chunked Precomputation Analysis: - * - Using 32 chunks requires: - * - 255 additions per chunk - * - 256 doublings - * - Total: (255 × 32) + 256 = 8,416 ops - * - * Memory Usage Comparison: - * Window Size | Standard Points | Chunked Points - * ------------|-----------------|--------------- - * 4-bit | 520 | 15 - * 8-bit | 4,224 | 255 - * 10-bit | 13,824 | 1,023 - * 16-bit | 557,056 | 65,535 - * - * Key Advantages: - * 1. Enables larger window sizes due to reduced memory overhead - * 2. More efficient for smaller scalar counts: - * - 16 chunks: (16 × 255) + 256 = 4,336 ops - * - ~2x faster than standard 8,191 ops - * - * Limitations: - * - Not suitable for plain precomputes (requires 256 constant doublings) - * - Performance degrades with larger scalar counts: - * - Optimal for ~256 scalars - * - Less efficient for 4096+ scalars (Pippenger preferred) - */ - validateW(windowSize, fieldN.BITS); - validateMSMPoints(points, c); - const zero = c.ZERO; - const tableSize = 2 ** windowSize - 1; // table size (without zero) - const chunks = Math.ceil(fieldN.BITS / windowSize); // chunks of item - const MASK = bitMask(windowSize); - const tables = points.map((p: P) => { - const res = []; - for (let i = 0, acc = p; i < tableSize; i++) { - res.push(acc); - acc = acc.add(p); - } - return res; - }); - return (scalars: bigint[]): P => { - validateMSMScalars(scalars, fieldN); - if (scalars.length > points.length) - throw new Error('array of scalars must be smaller than array of points'); - let res = zero; - for (let i = 0; i < chunks; i++) { - // No need to double if accumulator is still zero. - if (res !== zero) for (let j = 0; j < windowSize; j++) res = res.double(); - const shiftBy = BigInt(chunks * windowSize - (i + 1) * windowSize); - for (let j = 0; j < scalars.length; j++) { - const n = scalars[j]; - const curr = Number((n >> shiftBy) & MASK); - if (!curr) continue; // skip zero scalars chunks - res = res.add(tables[j][curr - 1]); - } - } - return res; - }; -} - -// TODO: remove -/** - * Generic BasicCurve interface: works even for polynomial fields (BLS): P, n, h would be ok. - * Though generator can be different (Fp2 / Fp6 for BLS). - */ -export type BasicCurve = { - Fp: IField; // Field over which we'll do calculations (Fp) - n: bigint; // Curve order, total count of valid points in the field - nBitLength?: number; // bit length of curve order - nByteLength?: number; // byte length of curve order - h: bigint; // cofactor. we can assign default=1, but users will just ignore it w/o validation - hEff?: bigint; // Number to multiply to clear cofactor - Gx: T; // base point X coordinate - Gy: T; // base point Y coordinate - allowInfinityPoint?: boolean; // bls12-381 requires it. ZERO point is valid, but invalid pubkey -}; - -// TODO: remove -/** @deprecated */ -export function validateBasic( - curve: BasicCurve & T -): Readonly< - { - readonly nBitLength: number; - readonly nByteLength: number; - } & BasicCurve & - T & { - p: bigint; - } -> { - validateField(curve.Fp); - validateObject( - curve, - { - n: 'bigint', - h: 'bigint', - Gx: 'field', - Gy: 'field', - }, - { - nBitLength: 'isSafeInteger', - nByteLength: 'isSafeInteger', - } - ); - // Set defaults - return Object.freeze({ - ...nLength(curve.n, curve.nBitLength), - ...curve, - ...{ p: curve.Fp.ORDER }, - } as const); -} - -export type ValidCurveParams = { - p: bigint; - n: bigint; - h: bigint; - a: T; - b?: T; - d?: T; - Gx: T; - Gy: T; -}; - -function createField(order: bigint, field?: IField, isLE?: boolean): IField { - if (field) { - if (field.ORDER !== order) throw new Error('Field.ORDER must match order: Fp == p, Fn == n'); - validateField(field); - return field; - } else { - return Field(order, { isLE }) as unknown as IField; - } -} -export type FpFn = { Fp: IField; Fn: IField }; - -/** Validates CURVE opts and creates fields */ -export function _createCurveFields( - type: 'weierstrass' | 'edwards', - CURVE: ValidCurveParams, - curveOpts: Partial> = {}, - FpFnLE?: boolean -): FpFn & { CURVE: ValidCurveParams } { - if (FpFnLE === undefined) FpFnLE = type === 'edwards'; - if (!CURVE || typeof CURVE !== 'object') throw new Error(`expected valid ${type} CURVE object`); - for (const p of ['p', 'n', 'h'] as const) { - const val = CURVE[p]; - if (!(typeof val === 'bigint' && val > _0n)) - throw new Error(`CURVE.${p} must be positive bigint`); - } - const Fp = createField(CURVE.p, curveOpts.Fp, FpFnLE); - const Fn = createField(CURVE.n, curveOpts.Fn, FpFnLE); - const _b: 'b' | 'd' = type === 'weierstrass' ? 'b' : 'd'; - const params = ['Gx', 'Gy', 'a', _b] as const; - for (const p of params) { - // @ts-ignore - if (!Fp.isValid(CURVE[p])) - throw new Error(`CURVE.${p} must be valid field element of CURVE.Fp`); - } - CURVE = Object.freeze(Object.assign({}, CURVE)); - return { CURVE, Fp, Fn }; -} diff --git a/tools/mnemonic-test/node_modules/@noble/curves/src/abstract/edwards.ts b/tools/mnemonic-test/node_modules/@noble/curves/src/abstract/edwards.ts deleted file mode 100644 index 58ba4256..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/src/abstract/edwards.ts +++ /dev/null @@ -1,914 +0,0 @@ -/** - * Twisted Edwards curve. The formula is: ax² + y² = 1 + dx²y². - * For design rationale of types / exports, see weierstrass module documentation. - * Untwisted Edwards curves exist, but they aren't used in real-world protocols. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { - _validateObject, - _abool2 as abool, - _abytes2 as abytes, - aInRange, - bytesToHex, - bytesToNumberLE, - concatBytes, - copyBytes, - ensureBytes, - isBytes, - memoized, - notImplemented, - randomBytes as randomBytesWeb, - type FHash, - type Hex, -} from '../utils.ts'; -import { - _createCurveFields, - normalizeZ, - pippenger, - wNAF, - type AffinePoint, - type BasicCurve, - type CurveLengths, - type CurvePoint, - type CurvePointCons, -} from './curve.ts'; -import { Field, type IField, type NLength } from './modular.ts'; - -// Be friendly to bad ECMAScript parsers by not using bigint literals -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _8n = BigInt(8); - -export type UVRatio = (u: bigint, v: bigint) => { isValid: boolean; value: bigint }; - -/** Instance of Extended Point with coordinates in X, Y, Z, T. */ -export interface EdwardsPoint extends CurvePoint { - /** extended X coordinate. Different from affine x. */ - readonly X: bigint; - /** extended Y coordinate. Different from affine y. */ - readonly Y: bigint; - /** extended Z coordinate */ - readonly Z: bigint; - /** extended T coordinate */ - readonly T: bigint; - - /** @deprecated use `toBytes` */ - toRawBytes(): Uint8Array; - /** @deprecated use `p.precompute(windowSize)` */ - _setWindowSize(windowSize: number): void; - /** @deprecated use .X */ - readonly ex: bigint; - /** @deprecated use .Y */ - readonly ey: bigint; - /** @deprecated use .Z */ - readonly ez: bigint; - /** @deprecated use .T */ - readonly et: bigint; -} -/** Static methods of Extended Point with coordinates in X, Y, Z, T. */ -export interface EdwardsPointCons extends CurvePointCons { - new (X: bigint, Y: bigint, Z: bigint, T: bigint): EdwardsPoint; - CURVE(): EdwardsOpts; - fromBytes(bytes: Uint8Array, zip215?: boolean): EdwardsPoint; - fromHex(hex: Hex, zip215?: boolean): EdwardsPoint; - /** @deprecated use `import { pippenger } from '@noble/curves/abstract/curve.js';` */ - msm(points: EdwardsPoint[], scalars: bigint[]): EdwardsPoint; -} -/** @deprecated use EdwardsPoint */ -export type ExtPointType = EdwardsPoint; -/** @deprecated use EdwardsPointCons */ -export type ExtPointConstructor = EdwardsPointCons; - -/** - * Twisted Edwards curve options. - * - * * a: formula param - * * d: formula param - * * p: prime characteristic (order) of finite field, in which arithmetics is done - * * n: order of prime subgroup a.k.a total amount of valid curve points - * * h: cofactor. h*n is group order; n is subgroup order - * * Gx: x coordinate of generator point a.k.a. base point - * * Gy: y coordinate of generator point - */ -export type EdwardsOpts = Readonly<{ - p: bigint; - n: bigint; - h: bigint; - a: bigint; - d: bigint; - Gx: bigint; - Gy: bigint; -}>; - -/** - * Extra curve options for Twisted Edwards. - * - * * Fp: redefined Field over curve.p - * * Fn: redefined Field over curve.n - * * uvRatio: helper function for decompression, calculating √(u/v) - */ -export type EdwardsExtraOpts = Partial<{ - Fp: IField; - Fn: IField; - FpFnLE: boolean; - uvRatio: (u: bigint, v: bigint) => { isValid: boolean; value: bigint }; -}>; - -/** - * EdDSA (Edwards Digital Signature algorithm) options. - * - * * hash: hash function used to hash secret keys and messages - * * adjustScalarBytes: clears bits to get valid field element - * * domain: Used for hashing - * * mapToCurve: for hash-to-curve standard - * * prehash: RFC 8032 pre-hashing of messages to sign() / verify() - * * randomBytes: function generating random bytes, used for randomSecretKey - */ -export type EdDSAOpts = Partial<{ - adjustScalarBytes: (bytes: Uint8Array) => Uint8Array; - domain: (data: Uint8Array, ctx: Uint8Array, phflag: boolean) => Uint8Array; - mapToCurve: (scalar: bigint[]) => AffinePoint; - prehash: FHash; - randomBytes: (bytesLength?: number) => Uint8Array; -}>; - -/** - * EdDSA (Edwards Digital Signature algorithm) interface. - * - * Allows to create and verify signatures, create public and secret keys. - */ -export interface EdDSA { - keygen: (seed?: Uint8Array) => { secretKey: Uint8Array; publicKey: Uint8Array }; - getPublicKey: (secretKey: Hex) => Uint8Array; - sign: (message: Hex, secretKey: Hex, options?: { context?: Hex }) => Uint8Array; - verify: ( - sig: Hex, - message: Hex, - publicKey: Hex, - options?: { context?: Hex; zip215: boolean } - ) => boolean; - Point: EdwardsPointCons; - utils: { - randomSecretKey: (seed?: Uint8Array) => Uint8Array; - isValidSecretKey: (secretKey: Uint8Array) => boolean; - isValidPublicKey: (publicKey: Uint8Array, zip215?: boolean) => boolean; - - /** - * Converts ed public key to x public key. - * - * There is NO `fromMontgomery`: - * - There are 2 valid ed25519 points for every x25519, with flipped coordinate - * - Sometimes there are 0 valid ed25519 points, because x25519 *additionally* - * accepts inputs on the quadratic twist, which can't be moved to ed25519 - * - * @example - * ```js - * const someonesPub = ed25519.getPublicKey(ed25519.utils.randomSecretKey()); - * const aPriv = x25519.utils.randomSecretKey(); - * x25519.getSharedSecret(aPriv, ed25519.utils.toMontgomery(someonesPub)) - * ``` - */ - toMontgomery: (publicKey: Uint8Array) => Uint8Array; - /** - * Converts ed secret key to x secret key. - * @example - * ```js - * const someonesPub = x25519.getPublicKey(x25519.utils.randomSecretKey()); - * const aPriv = ed25519.utils.randomSecretKey(); - * x25519.getSharedSecret(ed25519.utils.toMontgomerySecret(aPriv), someonesPub) - * ``` - */ - toMontgomerySecret: (privateKey: Uint8Array) => Uint8Array; - getExtendedPublicKey: (key: Hex) => { - head: Uint8Array; - prefix: Uint8Array; - scalar: bigint; - point: EdwardsPoint; - pointBytes: Uint8Array; - }; - - /** @deprecated use `randomSecretKey` */ - randomPrivateKey: (seed?: Uint8Array) => Uint8Array; - /** @deprecated use `point.precompute()` */ - precompute: (windowSize?: number, point?: EdwardsPoint) => EdwardsPoint; - }; - lengths: CurveLengths; -} - -function isEdValidXY(Fp: IField, CURVE: EdwardsOpts, x: bigint, y: bigint): boolean { - const x2 = Fp.sqr(x); - const y2 = Fp.sqr(y); - const left = Fp.add(Fp.mul(CURVE.a, x2), y2); - const right = Fp.add(Fp.ONE, Fp.mul(CURVE.d, Fp.mul(x2, y2))); - return Fp.eql(left, right); -} - -export function edwards(params: EdwardsOpts, extraOpts: EdwardsExtraOpts = {}): EdwardsPointCons { - const validated = _createCurveFields('edwards', params, extraOpts, extraOpts.FpFnLE); - const { Fp, Fn } = validated; - let CURVE = validated.CURVE as EdwardsOpts; - const { h: cofactor } = CURVE; - _validateObject(extraOpts, {}, { uvRatio: 'function' }); - - // Important: - // There are some places where Fp.BYTES is used instead of nByteLength. - // So far, everything has been tested with curves of Fp.BYTES == nByteLength. - // TODO: test and find curves which behave otherwise. - const MASK = _2n << (BigInt(Fn.BYTES * 8) - _1n); - const modP = (n: bigint) => Fp.create(n); // Function overrides - - // sqrt(u/v) - const uvRatio = - extraOpts.uvRatio || - ((u: bigint, v: bigint) => { - try { - return { isValid: true, value: Fp.sqrt(Fp.div(u, v)) }; - } catch (e) { - return { isValid: false, value: _0n }; - } - }); - - // Validate whether the passed curve params are valid. - // equation ax² + y² = 1 + dx²y² should work for generator point. - if (!isEdValidXY(Fp, CURVE, CURVE.Gx, CURVE.Gy)) - throw new Error('bad curve params: generator point'); - - /** - * Asserts coordinate is valid: 0 <= n < MASK. - * Coordinates >= Fp.ORDER are allowed for zip215. - */ - function acoord(title: string, n: bigint, banZero = false) { - const min = banZero ? _1n : _0n; - aInRange('coordinate ' + title, n, min, MASK); - return n; - } - - function aextpoint(other: unknown) { - if (!(other instanceof Point)) throw new Error('ExtendedPoint expected'); - } - // Converts Extended point to default (x, y) coordinates. - // Can accept precomputed Z^-1 - for example, from invertBatch. - const toAffineMemo = memoized((p: Point, iz?: bigint): AffinePoint => { - const { X, Y, Z } = p; - const is0 = p.is0(); - if (iz == null) iz = is0 ? _8n : (Fp.inv(Z) as bigint); // 8 was chosen arbitrarily - const x = modP(X * iz); - const y = modP(Y * iz); - const zz = Fp.mul(Z, iz); - if (is0) return { x: _0n, y: _1n }; - if (zz !== _1n) throw new Error('invZ was invalid'); - return { x, y }; - }); - const assertValidMemo = memoized((p: Point) => { - const { a, d } = CURVE; - if (p.is0()) throw new Error('bad point: ZERO'); // TODO: optimize, with vars below? - // Equation in affine coordinates: ax² + y² = 1 + dx²y² - // Equation in projective coordinates (X/Z, Y/Z, Z): (aX² + Y²)Z² = Z⁴ + dX²Y² - const { X, Y, Z, T } = p; - const X2 = modP(X * X); // X² - const Y2 = modP(Y * Y); // Y² - const Z2 = modP(Z * Z); // Z² - const Z4 = modP(Z2 * Z2); // Z⁴ - const aX2 = modP(X2 * a); // aX² - const left = modP(Z2 * modP(aX2 + Y2)); // (aX² + Y²)Z² - const right = modP(Z4 + modP(d * modP(X2 * Y2))); // Z⁴ + dX²Y² - if (left !== right) throw new Error('bad point: equation left != right (1)'); - // In Extended coordinates we also have T, which is x*y=T/Z: check X*Y == Z*T - const XY = modP(X * Y); - const ZT = modP(Z * T); - if (XY !== ZT) throw new Error('bad point: equation left != right (2)'); - return true; - }); - - // Extended Point works in extended coordinates: (X, Y, Z, T) ∋ (x=X/Z, y=Y/Z, T=xy). - // https://en.wikipedia.org/wiki/Twisted_Edwards_curve#Extended_coordinates - class Point implements EdwardsPoint { - // base / generator point - static readonly BASE = new Point(CURVE.Gx, CURVE.Gy, _1n, modP(CURVE.Gx * CURVE.Gy)); - // zero / infinity / identity point - static readonly ZERO = new Point(_0n, _1n, _1n, _0n); // 0, 1, 1, 0 - // math field - static readonly Fp = Fp; - // scalar field - static readonly Fn = Fn; - - readonly X: bigint; - readonly Y: bigint; - readonly Z: bigint; - readonly T: bigint; - - constructor(X: bigint, Y: bigint, Z: bigint, T: bigint) { - this.X = acoord('x', X); - this.Y = acoord('y', Y); - this.Z = acoord('z', Z, true); - this.T = acoord('t', T); - Object.freeze(this); - } - - static CURVE(): EdwardsOpts { - return CURVE; - } - - static fromAffine(p: AffinePoint): Point { - if (p instanceof Point) throw new Error('extended point not allowed'); - const { x, y } = p || {}; - acoord('x', x); - acoord('y', y); - return new Point(x, y, _1n, modP(x * y)); - } - - // Uses algo from RFC8032 5.1.3. - static fromBytes(bytes: Uint8Array, zip215 = false): Point { - const len = Fp.BYTES; - const { a, d } = CURVE; - bytes = copyBytes(abytes(bytes, len, 'point')); - abool(zip215, 'zip215'); - const normed = copyBytes(bytes); // copy again, we'll manipulate it - const lastByte = bytes[len - 1]; // select last byte - normed[len - 1] = lastByte & ~0x80; // clear last bit - const y = bytesToNumberLE(normed); - - // zip215=true is good for consensus-critical apps. =false follows RFC8032 / NIST186-5. - // RFC8032 prohibits >= p, but ZIP215 doesn't - // zip215=true: 0 <= y < MASK (2^256 for ed25519) - // zip215=false: 0 <= y < P (2^255-19 for ed25519) - const max = zip215 ? MASK : Fp.ORDER; - aInRange('point.y', y, _0n, max); - - // Ed25519: x² = (y²-1)/(dy²+1) mod p. Ed448: x² = (y²-1)/(dy²-1) mod p. Generic case: - // ax²+y²=1+dx²y² => y²-1=dx²y²-ax² => y²-1=x²(dy²-a) => x²=(y²-1)/(dy²-a) - const y2 = modP(y * y); // denominator is always non-0 mod p. - const u = modP(y2 - _1n); // u = y² - 1 - const v = modP(d * y2 - a); // v = d y² + 1. - let { isValid, value: x } = uvRatio(u, v); // √(u/v) - if (!isValid) throw new Error('bad point: invalid y coordinate'); - const isXOdd = (x & _1n) === _1n; // There are 2 square roots. Use x_0 bit to select proper - const isLastByteOdd = (lastByte & 0x80) !== 0; // x_0, last bit - if (!zip215 && x === _0n && isLastByteOdd) - // if x=0 and x_0 = 1, fail - throw new Error('bad point: x=0 and x_0=1'); - if (isLastByteOdd !== isXOdd) x = modP(-x); // if x_0 != x mod 2, set x = p-x - return Point.fromAffine({ x, y }); - } - static fromHex(bytes: Uint8Array, zip215 = false): Point { - return Point.fromBytes(ensureBytes('point', bytes), zip215); - } - - get x(): bigint { - return this.toAffine().x; - } - get y(): bigint { - return this.toAffine().y; - } - - precompute(windowSize: number = 8, isLazy = true) { - wnaf.createCache(this, windowSize); - if (!isLazy) this.multiply(_2n); // random number - return this; - } - - // Useful in fromAffine() - not for fromBytes(), which always created valid points. - assertValidity(): void { - assertValidMemo(this); - } - - // Compare one point to another. - equals(other: Point): boolean { - aextpoint(other); - const { X: X1, Y: Y1, Z: Z1 } = this; - const { X: X2, Y: Y2, Z: Z2 } = other; - const X1Z2 = modP(X1 * Z2); - const X2Z1 = modP(X2 * Z1); - const Y1Z2 = modP(Y1 * Z2); - const Y2Z1 = modP(Y2 * Z1); - return X1Z2 === X2Z1 && Y1Z2 === Y2Z1; - } - - is0(): boolean { - return this.equals(Point.ZERO); - } - - negate(): Point { - // Flips point sign to a negative one (-x, y in affine coords) - return new Point(modP(-this.X), this.Y, this.Z, modP(-this.T)); - } - - // Fast algo for doubling Extended Point. - // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-dbl-2008-hwcd - // Cost: 4M + 4S + 1*a + 6add + 1*2. - double(): Point { - const { a } = CURVE; - const { X: X1, Y: Y1, Z: Z1 } = this; - const A = modP(X1 * X1); // A = X12 - const B = modP(Y1 * Y1); // B = Y12 - const C = modP(_2n * modP(Z1 * Z1)); // C = 2*Z12 - const D = modP(a * A); // D = a*A - const x1y1 = X1 + Y1; - const E = modP(modP(x1y1 * x1y1) - A - B); // E = (X1+Y1)2-A-B - const G = D + B; // G = D+B - const F = G - C; // F = G-C - const H = D - B; // H = D-B - const X3 = modP(E * F); // X3 = E*F - const Y3 = modP(G * H); // Y3 = G*H - const T3 = modP(E * H); // T3 = E*H - const Z3 = modP(F * G); // Z3 = F*G - return new Point(X3, Y3, Z3, T3); - } - - // Fast algo for adding 2 Extended Points. - // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-add-2008-hwcd - // Cost: 9M + 1*a + 1*d + 7add. - add(other: Point) { - aextpoint(other); - const { a, d } = CURVE; - const { X: X1, Y: Y1, Z: Z1, T: T1 } = this; - const { X: X2, Y: Y2, Z: Z2, T: T2 } = other; - const A = modP(X1 * X2); // A = X1*X2 - const B = modP(Y1 * Y2); // B = Y1*Y2 - const C = modP(T1 * d * T2); // C = T1*d*T2 - const D = modP(Z1 * Z2); // D = Z1*Z2 - const E = modP((X1 + Y1) * (X2 + Y2) - A - B); // E = (X1+Y1)*(X2+Y2)-A-B - const F = D - C; // F = D-C - const G = D + C; // G = D+C - const H = modP(B - a * A); // H = B-a*A - const X3 = modP(E * F); // X3 = E*F - const Y3 = modP(G * H); // Y3 = G*H - const T3 = modP(E * H); // T3 = E*H - const Z3 = modP(F * G); // Z3 = F*G - return new Point(X3, Y3, Z3, T3); - } - - subtract(other: Point): Point { - return this.add(other.negate()); - } - - // Constant-time multiplication. - multiply(scalar: bigint): Point { - // 1 <= scalar < L - if (!Fn.isValidNot0(scalar)) throw new Error('invalid scalar: expected 1 <= sc < curve.n'); - const { p, f } = wnaf.cached(this, scalar, (p) => normalizeZ(Point, p)); - return normalizeZ(Point, [p, f])[0]; - } - - // Non-constant-time multiplication. Uses double-and-add algorithm. - // It's faster, but should only be used when you don't care about - // an exposed private key e.g. sig verification. - // Does NOT allow scalars higher than CURVE.n. - // Accepts optional accumulator to merge with multiply (important for sparse scalars) - multiplyUnsafe(scalar: bigint, acc = Point.ZERO): Point { - // 0 <= scalar < L - if (!Fn.isValid(scalar)) throw new Error('invalid scalar: expected 0 <= sc < curve.n'); - if (scalar === _0n) return Point.ZERO; - if (this.is0() || scalar === _1n) return this; - return wnaf.unsafe(this, scalar, (p) => normalizeZ(Point, p), acc); - } - - // Checks if point is of small order. - // If you add something to small order point, you will have "dirty" - // point with torsion component. - // Multiplies point by cofactor and checks if the result is 0. - isSmallOrder(): boolean { - return this.multiplyUnsafe(cofactor).is0(); - } - - // Multiplies point by curve order and checks if the result is 0. - // Returns `false` is the point is dirty. - isTorsionFree(): boolean { - return wnaf.unsafe(this, CURVE.n).is0(); - } - - // Converts Extended point to default (x, y) coordinates. - // Can accept precomputed Z^-1 - for example, from invertBatch. - toAffine(invertedZ?: bigint): AffinePoint { - return toAffineMemo(this, invertedZ); - } - - clearCofactor(): Point { - if (cofactor === _1n) return this; - return this.multiplyUnsafe(cofactor); - } - - toBytes(): Uint8Array { - const { x, y } = this.toAffine(); - // Fp.toBytes() allows non-canonical encoding of y (>= p). - const bytes = Fp.toBytes(y); - // Each y has 2 valid points: (x, y), (x,-y). - // When compressing, it's enough to store y and use the last byte to encode sign of x - bytes[bytes.length - 1] |= x & _1n ? 0x80 : 0; - return bytes; - } - toHex(): string { - return bytesToHex(this.toBytes()); - } - - toString() { - return ``; - } - - // TODO: remove - get ex(): bigint { - return this.X; - } - get ey(): bigint { - return this.Y; - } - get ez(): bigint { - return this.Z; - } - get et(): bigint { - return this.T; - } - static normalizeZ(points: Point[]): Point[] { - return normalizeZ(Point, points); - } - static msm(points: Point[], scalars: bigint[]): Point { - return pippenger(Point, Fn, points, scalars); - } - _setWindowSize(windowSize: number) { - this.precompute(windowSize); - } - toRawBytes(): Uint8Array { - return this.toBytes(); - } - } - const wnaf = new wNAF(Point, Fn.BITS); - Point.BASE.precompute(8); // Enable precomputes. Slows down first publicKey computation by 20ms. - return Point; -} - -/** - * Base class for prime-order points like Ristretto255 and Decaf448. - * These points eliminate cofactor issues by representing equivalence classes - * of Edwards curve points. - */ -export abstract class PrimeEdwardsPoint> - implements CurvePoint -{ - static BASE: PrimeEdwardsPoint; - static ZERO: PrimeEdwardsPoint; - static Fp: IField; - static Fn: IField; - - protected readonly ep: EdwardsPoint; - - constructor(ep: EdwardsPoint) { - this.ep = ep; - } - - // Abstract methods that must be implemented by subclasses - abstract toBytes(): Uint8Array; - abstract equals(other: T): boolean; - - // Static methods that must be implemented by subclasses - static fromBytes(_bytes: Uint8Array): any { - notImplemented(); - } - - static fromHex(_hex: Hex): any { - notImplemented(); - } - - get x(): bigint { - return this.toAffine().x; - } - get y(): bigint { - return this.toAffine().y; - } - - // Common implementations - clearCofactor(): T { - // no-op for prime-order groups - return this as any; - } - - assertValidity(): void { - this.ep.assertValidity(); - } - - toAffine(invertedZ?: bigint): AffinePoint { - return this.ep.toAffine(invertedZ); - } - - toHex(): string { - return bytesToHex(this.toBytes()); - } - - toString(): string { - return this.toHex(); - } - - isTorsionFree(): boolean { - return true; - } - - isSmallOrder(): boolean { - return false; - } - - add(other: T): T { - this.assertSame(other); - return this.init(this.ep.add(other.ep)); - } - - subtract(other: T): T { - this.assertSame(other); - return this.init(this.ep.subtract(other.ep)); - } - - multiply(scalar: bigint): T { - return this.init(this.ep.multiply(scalar)); - } - - multiplyUnsafe(scalar: bigint): T { - return this.init(this.ep.multiplyUnsafe(scalar)); - } - - double(): T { - return this.init(this.ep.double()); - } - - negate(): T { - return this.init(this.ep.negate()); - } - - precompute(windowSize?: number, isLazy?: boolean): T { - return this.init(this.ep.precompute(windowSize, isLazy)); - } - - // Helper methods - abstract is0(): boolean; - protected abstract assertSame(other: T): void; - protected abstract init(ep: EdwardsPoint): T; - - /** @deprecated use `toBytes` */ - toRawBytes(): Uint8Array { - return this.toBytes(); - } -} - -/** - * Initializes EdDSA signatures over given Edwards curve. - */ -export function eddsa(Point: EdwardsPointCons, cHash: FHash, eddsaOpts: EdDSAOpts = {}): EdDSA { - if (typeof cHash !== 'function') throw new Error('"hash" function param is required'); - _validateObject( - eddsaOpts, - {}, - { - adjustScalarBytes: 'function', - randomBytes: 'function', - domain: 'function', - prehash: 'function', - mapToCurve: 'function', - } - ); - - const { prehash } = eddsaOpts; - const { BASE, Fp, Fn } = Point; - - const randomBytes = eddsaOpts.randomBytes || randomBytesWeb; - const adjustScalarBytes = eddsaOpts.adjustScalarBytes || ((bytes: Uint8Array) => bytes); - const domain = - eddsaOpts.domain || - ((data: Uint8Array, ctx: Uint8Array, phflag: boolean) => { - abool(phflag, 'phflag'); - if (ctx.length || phflag) throw new Error('Contexts/pre-hash are not supported'); - return data; - }); // NOOP - - // Little-endian SHA512 with modulo n - function modN_LE(hash: Uint8Array): bigint { - return Fn.create(bytesToNumberLE(hash)); // Not Fn.fromBytes: it has length limit - } - - // Get the hashed private scalar per RFC8032 5.1.5 - function getPrivateScalar(key: Hex) { - const len = lengths.secretKey; - key = ensureBytes('private key', key, len); - // Hash private key with curve's hash function to produce uniformingly random input - // Check byte lengths: ensure(64, h(ensure(32, key))) - const hashed = ensureBytes('hashed private key', cHash(key), 2 * len); - const head = adjustScalarBytes(hashed.slice(0, len)); // clear first half bits, produce FE - const prefix = hashed.slice(len, 2 * len); // second half is called key prefix (5.1.6) - const scalar = modN_LE(head); // The actual private scalar - return { head, prefix, scalar }; - } - - /** Convenience method that creates public key from scalar. RFC8032 5.1.5 */ - function getExtendedPublicKey(secretKey: Hex) { - const { head, prefix, scalar } = getPrivateScalar(secretKey); - const point = BASE.multiply(scalar); // Point on Edwards curve aka public key - const pointBytes = point.toBytes(); - return { head, prefix, scalar, point, pointBytes }; - } - - /** Calculates EdDSA pub key. RFC8032 5.1.5. */ - function getPublicKey(secretKey: Hex): Uint8Array { - return getExtendedPublicKey(secretKey).pointBytes; - } - - // int('LE', SHA512(dom2(F, C) || msgs)) mod N - function hashDomainToScalar(context: Hex = Uint8Array.of(), ...msgs: Uint8Array[]) { - const msg = concatBytes(...msgs); - return modN_LE(cHash(domain(msg, ensureBytes('context', context), !!prehash))); - } - - /** Signs message with privateKey. RFC8032 5.1.6 */ - function sign(msg: Hex, secretKey: Hex, options: { context?: Hex } = {}): Uint8Array { - msg = ensureBytes('message', msg); - if (prehash) msg = prehash(msg); // for ed25519ph etc. - const { prefix, scalar, pointBytes } = getExtendedPublicKey(secretKey); - const r = hashDomainToScalar(options.context, prefix, msg); // r = dom2(F, C) || prefix || PH(M) - const R = BASE.multiply(r).toBytes(); // R = rG - const k = hashDomainToScalar(options.context, R, pointBytes, msg); // R || A || PH(M) - const s = Fn.create(r + k * scalar); // S = (r + k * s) mod L - if (!Fn.isValid(s)) throw new Error('sign failed: invalid s'); // 0 <= s < L - const rs = concatBytes(R, Fn.toBytes(s)); - return abytes(rs, lengths.signature, 'result'); - } - - // verification rule is either zip215 or rfc8032 / nist186-5. Consult fromHex: - const verifyOpts: { context?: Hex; zip215?: boolean } = { zip215: true }; - - /** - * Verifies EdDSA signature against message and public key. RFC8032 5.1.7. - * An extended group equation is checked. - */ - function verify(sig: Hex, msg: Hex, publicKey: Hex, options = verifyOpts): boolean { - const { context, zip215 } = options; - const len = lengths.signature; - sig = ensureBytes('signature', sig, len); - msg = ensureBytes('message', msg); - publicKey = ensureBytes('publicKey', publicKey, lengths.publicKey); - if (zip215 !== undefined) abool(zip215, 'zip215'); - if (prehash) msg = prehash(msg); // for ed25519ph, etc - - const mid = len / 2; - const r = sig.subarray(0, mid); - const s = bytesToNumberLE(sig.subarray(mid, len)); - let A, R, SB; - try { - // zip215=true is good for consensus-critical apps. =false follows RFC8032 / NIST186-5. - // zip215=true: 0 <= y < MASK (2^256 for ed25519) - // zip215=false: 0 <= y < P (2^255-19 for ed25519) - A = Point.fromBytes(publicKey, zip215); - R = Point.fromBytes(r, zip215); - SB = BASE.multiplyUnsafe(s); // 0 <= s < l is done inside - } catch (error) { - return false; - } - if (!zip215 && A.isSmallOrder()) return false; // zip215 allows public keys of small order - - const k = hashDomainToScalar(context, R.toBytes(), A.toBytes(), msg); - const RkA = R.add(A.multiplyUnsafe(k)); - // Extended group equation - // [8][S]B = [8]R + [8][k]A' - return RkA.subtract(SB).clearCofactor().is0(); - } - - const _size = Fp.BYTES; // 32 for ed25519, 57 for ed448 - const lengths = { - secretKey: _size, - publicKey: _size, - signature: 2 * _size, - seed: _size, - }; - function randomSecretKey(seed = randomBytes(lengths.seed)): Uint8Array { - return abytes(seed, lengths.seed, 'seed'); - } - function keygen(seed?: Uint8Array) { - const secretKey = utils.randomSecretKey(seed); - return { secretKey, publicKey: getPublicKey(secretKey) }; - } - function isValidSecretKey(key: Uint8Array): boolean { - return isBytes(key) && key.length === Fn.BYTES; - } - function isValidPublicKey(key: Uint8Array, zip215?: boolean): boolean { - try { - return !!Point.fromBytes(key, zip215); - } catch (error) { - return false; - } - } - - const utils = { - getExtendedPublicKey, - randomSecretKey, - isValidSecretKey, - isValidPublicKey, - /** - * Converts ed public key to x public key. Uses formula: - * - ed25519: - * - `(u, v) = ((1+y)/(1-y), sqrt(-486664)*u/x)` - * - `(x, y) = (sqrt(-486664)*u/v, (u-1)/(u+1))` - * - ed448: - * - `(u, v) = ((y-1)/(y+1), sqrt(156324)*u/x)` - * - `(x, y) = (sqrt(156324)*u/v, (1+u)/(1-u))` - */ - toMontgomery(publicKey: Uint8Array): Uint8Array { - const { y } = Point.fromBytes(publicKey); - const size = lengths.publicKey; - const is25519 = size === 32; - if (!is25519 && size !== 57) throw new Error('only defined for 25519 and 448'); - const u = is25519 ? Fp.div(_1n + y, _1n - y) : Fp.div(y - _1n, y + _1n); - return Fp.toBytes(u); - }, - - toMontgomerySecret(secretKey: Uint8Array): Uint8Array { - const size = lengths.secretKey; - abytes(secretKey, size); - const hashed = cHash(secretKey.subarray(0, size)); - return adjustScalarBytes(hashed).subarray(0, size); - }, - - /** @deprecated */ - randomPrivateKey: randomSecretKey, - /** @deprecated */ - precompute(windowSize = 8, point: EdwardsPoint = Point.BASE): EdwardsPoint { - return point.precompute(windowSize, false); - }, - }; - - return Object.freeze({ - keygen, - getPublicKey, - sign, - verify, - utils, - Point, - lengths, - }); -} - -// TODO: remove everything below -export type CurveType = BasicCurve & { - a: bigint; // curve param a - d: bigint; // curve param d - /** @deprecated the property will be removed in next release */ - hash: FHash; // Hashing - randomBytes?: (bytesLength?: number) => Uint8Array; // CSPRNG - adjustScalarBytes?: (bytes: Uint8Array) => Uint8Array; // clears bits to get valid field elemtn - domain?: (data: Uint8Array, ctx: Uint8Array, phflag: boolean) => Uint8Array; // Used for hashing - uvRatio?: UVRatio; // Ratio √(u/v) - prehash?: FHash; // RFC 8032 pre-hashing of messages to sign() / verify() - mapToCurve?: (scalar: bigint[]) => AffinePoint; // for hash-to-curve standard -}; -export type CurveTypeWithLength = Readonly>; -export type CurveFn = { - /** @deprecated the property will be removed in next release */ - CURVE: CurveType; - keygen: EdDSA['keygen']; - getPublicKey: EdDSA['getPublicKey']; - sign: EdDSA['sign']; - verify: EdDSA['verify']; - Point: EdwardsPointCons; - /** @deprecated use `Point` */ - ExtendedPoint: EdwardsPointCons; - utils: EdDSA['utils']; - lengths: CurveLengths; -}; -export type EdComposed = { - CURVE: EdwardsOpts; - curveOpts: EdwardsExtraOpts; - hash: FHash; - eddsaOpts: EdDSAOpts; -}; -function _eddsa_legacy_opts_to_new(c: CurveTypeWithLength): EdComposed { - const CURVE: EdwardsOpts = { - a: c.a, - d: c.d, - p: c.Fp.ORDER, - n: c.n, - h: c.h, - Gx: c.Gx, - Gy: c.Gy, - }; - const Fp = c.Fp; - const Fn = Field(CURVE.n, c.nBitLength, true); - const curveOpts: EdwardsExtraOpts = { Fp, Fn, uvRatio: c.uvRatio }; - const eddsaOpts: EdDSAOpts = { - randomBytes: c.randomBytes, - adjustScalarBytes: c.adjustScalarBytes, - domain: c.domain, - prehash: c.prehash, - mapToCurve: c.mapToCurve, - }; - return { CURVE, curveOpts, hash: c.hash, eddsaOpts }; -} -function _eddsa_new_output_to_legacy(c: CurveTypeWithLength, eddsa: EdDSA): CurveFn { - const Point = eddsa.Point; - const legacy = Object.assign({}, eddsa, { - ExtendedPoint: Point, - CURVE: c, - nBitLength: Point.Fn.BITS, - nByteLength: Point.Fn.BYTES, - }); - return legacy; -} -// TODO: remove. Use eddsa -export function twistedEdwards(c: CurveTypeWithLength): CurveFn { - const { CURVE, curveOpts, hash, eddsaOpts } = _eddsa_legacy_opts_to_new(c); - const Point = edwards(CURVE, curveOpts); - const EDDSA = eddsa(Point, hash, eddsaOpts); - return _eddsa_new_output_to_legacy(c, EDDSA); -} diff --git a/tools/mnemonic-test/node_modules/@noble/curves/src/abstract/fft.ts b/tools/mnemonic-test/node_modules/@noble/curves/src/abstract/fft.ts deleted file mode 100644 index 0aa7cbfe..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/src/abstract/fft.ts +++ /dev/null @@ -1,519 +0,0 @@ -/** - * Experimental implementation of NTT / FFT (Fast Fourier Transform) over finite fields. - * API may change at any time. The code has not been audited. Feature requests are welcome. - * @module - */ -import type { IField } from './modular.ts'; - -export interface MutableArrayLike { - [index: number]: T; - length: number; - slice(start?: number, end?: number): this; - [Symbol.iterator](): Iterator; -} - -function checkU32(n: number) { - // 0xff_ff_ff_ff - if (!Number.isSafeInteger(n) || n < 0 || n > 0xffffffff) - throw new Error('wrong u32 integer:' + n); - return n; -} - -/** Checks if integer is in form of `1 << X` */ -export function isPowerOfTwo(x: number): boolean { - checkU32(x); - return (x & (x - 1)) === 0 && x !== 0; -} - -export function nextPowerOfTwo(n: number): number { - checkU32(n); - if (n <= 1) return 1; - return (1 << (log2(n - 1) + 1)) >>> 0; -} - -export function reverseBits(n: number, bits: number): number { - checkU32(n); - let reversed = 0; - for (let i = 0; i < bits; i++, n >>>= 1) reversed = (reversed << 1) | (n & 1); - return reversed; -} - -/** Similar to `bitLen(x)-1` but much faster for small integers, like indices */ -export function log2(n: number): number { - checkU32(n); - return 31 - Math.clz32(n); -} - -/** - * Moves lowest bit to highest position, which at first step splits - * array on even and odd indices, then it applied again to each part, - * which is core of fft - */ -export function bitReversalInplace>(values: T): T { - const n = values.length; - if (n < 2 || !isPowerOfTwo(n)) - throw new Error('n must be a power of 2 and greater than 1. Got ' + n); - const bits = log2(n); - for (let i = 0; i < n; i++) { - const j = reverseBits(i, bits); - if (i < j) { - const tmp = values[i]; - values[i] = values[j]; - values[j] = tmp; - } - } - return values; -} - -export function bitReversalPermutation(values: T[]): T[] { - return bitReversalInplace(values.slice()) as T[]; -} - -const _1n = /** @__PURE__ */ BigInt(1); -function findGenerator(field: IField) { - let G = BigInt(2); - for (; field.eql(field.pow(G, field.ORDER >> _1n), field.ONE); G++); - return G; -} - -export type RootsOfUnity = { - roots: (bits: number) => bigint[]; - brp(bits: number): bigint[]; - inverse(bits: number): bigint[]; - omega: (bits: number) => bigint; - clear: () => void; -}; -/** We limit roots up to 2**31, which is a lot: 2-billion polynomimal should be rare. */ -export function rootsOfUnity(field: IField, generator?: bigint): RootsOfUnity { - // Factor field.ORDER-1 as oddFactor * 2^powerOfTwo - let oddFactor = field.ORDER - _1n; - let powerOfTwo = 0; - for (; (oddFactor & _1n) !== _1n; powerOfTwo++, oddFactor >>= _1n); - - // Find non quadratic residue - let G = generator !== undefined ? BigInt(generator) : findGenerator(field); - // Powers of generator - const omegas: bigint[] = new Array(powerOfTwo + 1); - omegas[powerOfTwo] = field.pow(G, oddFactor); - for (let i = powerOfTwo; i > 0; i--) omegas[i - 1] = field.sqr(omegas[i]); - // Compute all roots of unity for powers up to maxPower - const rootsCache: bigint[][] = []; - const checkBits = (bits: number) => { - checkU32(bits); - if (bits > 31 || bits > powerOfTwo) - throw new Error('rootsOfUnity: wrong bits ' + bits + ' powerOfTwo=' + powerOfTwo); - return bits; - }; - const precomputeRoots = (maxPower: number) => { - checkBits(maxPower); - for (let power = maxPower; power >= 0; power--) { - if (rootsCache[power]) continue; // Skip if we've already computed roots for this power - const rootsAtPower: bigint[] = []; - for (let j = 0, cur = field.ONE; j < 2 ** power; j++, cur = field.mul(cur, omegas[power])) - rootsAtPower.push(cur); - rootsCache[power] = rootsAtPower; - } - return rootsCache[maxPower]; - }; - const brpCache = new Map(); - const inverseCache = new Map(); - - // NOTE: we use bits instead of power, because power = 2**bits, - // but power is not neccesary isPowerOfTwo(power)! - return { - roots: (bits: number): bigint[] => { - const b = checkBits(bits); - return precomputeRoots(b); - }, - brp(bits: number): bigint[] { - const b = checkBits(bits); - if (brpCache.has(b)) return brpCache.get(b)!; - else { - const res = bitReversalPermutation(this.roots(b)); - brpCache.set(b, res); - return res; - } - }, - inverse(bits: number): bigint[] { - const b = checkBits(bits); - if (inverseCache.has(b)) return inverseCache.get(b)!; - else { - const res = field.invertBatch(this.roots(b)); - inverseCache.set(b, res); - return res; - } - }, - omega: (bits: number): bigint => omegas[checkBits(bits)], - clear: (): void => { - rootsCache.splice(0, rootsCache.length); - brpCache.clear(); - }, - }; -} - -export type Polynomial = MutableArrayLike; - -/** - * Maps great to Field, but not to Group (EC points): - * - inv from scalar field - * - we need multiplyUnsafe here, instead of multiply for speed - * - multiplyUnsafe is safe in the context: we do mul(rootsOfUnity), which are public and sparse - */ -export type FFTOpts = { - add: (a: T, b: T) => T; - sub: (a: T, b: T) => T; - mul: (a: T, scalar: R) => T; - inv: (a: R) => R; -}; - -export type FFTCoreOpts = { - N: number; - roots: Polynomial; - dit: boolean; - invertButterflies?: boolean; - skipStages?: number; - brp?: boolean; -}; - -export type FFTCoreLoop =

>(values: P) => P; - -/** - * Constructs different flavors of FFT. radix2 implementation of low level mutating API. Flavors: - * - * - DIT (Decimation-in-Time): Bottom-Up (leaves -> root), Cool-Turkey - * - DIF (Decimation-in-Frequency): Top-Down (root -> leaves), Gentleman–Sande - * - * DIT takes brp input, returns natural output. - * DIF takes natural input, returns brp output. - * - * The output is actually identical. Time / frequence distinction is not meaningful - * for Polynomial multiplication in fields. - * Which means if protocol supports/needs brp output/inputs, then we can skip this step. - * - * Cyclic NTT: Rq = Zq[x]/(x^n-1). butterfly_DIT+loop_DIT OR butterfly_DIF+loop_DIT, roots are omega - * Negacyclic NTT: Rq = Zq[x]/(x^n+1). butterfly_DIT+loop_DIF, at least for mlkem / mldsa - */ -export const FFTCore = (F: FFTOpts, coreOpts: FFTCoreOpts): FFTCoreLoop => { - const { N, roots, dit, invertButterflies = false, skipStages = 0, brp = true } = coreOpts; - const bits = log2(N); - if (!isPowerOfTwo(N)) throw new Error('FFT: Polynomial size should be power of two'); - const isDit = dit !== invertButterflies; - isDit; - return

>(values: P): P => { - if (values.length !== N) throw new Error('FFT: wrong Polynomial length'); - if (dit && brp) bitReversalInplace(values); - for (let i = 0, g = 1; i < bits - skipStages; i++) { - // For each stage s (sub-FFT length m = 2^s) - const s = dit ? i + 1 + skipStages : bits - i; - const m = 1 << s; - const m2 = m >> 1; - const stride = N >> s; - // Loop over each subarray of length m - for (let k = 0; k < N; k += m) { - // Loop over each butterfly within the subarray - for (let j = 0, grp = g++; j < m2; j++) { - const rootPos = invertButterflies ? (dit ? N - grp : grp) : j * stride; - const i0 = k + j; - const i1 = k + j + m2; - const omega = roots[rootPos]; - const b = values[i1]; - const a = values[i0]; - // Inlining gives us 10% perf in kyber vs functions - if (isDit) { - const t = F.mul(b, omega); // Standard DIT butterfly - values[i0] = F.add(a, t); - values[i1] = F.sub(a, t); - } else if (invertButterflies) { - values[i0] = F.add(b, a); // DIT loop + inverted butterflies (Kyber decode) - values[i1] = F.mul(F.sub(b, a), omega); - } else { - values[i0] = F.add(a, b); // Standard DIF butterfly - values[i1] = F.mul(F.sub(a, b), omega); - } - } - } - } - if (!dit && brp) bitReversalInplace(values); - return values; - }; -}; - -export type FFTMethods = { - direct

>(values: P, brpInput?: boolean, brpOutput?: boolean): P; - inverse

>(values: P, brpInput?: boolean, brpOutput?: boolean): P; -}; - -/** - * NTT aka FFT over finite field (NOT over complex numbers). - * Naming mirrors other libraries. - */ -export function FFT(roots: RootsOfUnity, opts: FFTOpts): FFTMethods { - const getLoop = ( - N: number, - roots: Polynomial, - brpInput = false, - brpOutput = false - ): (

>(values: P) => P) => { - if (brpInput && brpOutput) { - // we cannot optimize this case, but lets support it anyway - return (values) => - FFTCore(opts, { N, roots, dit: false, brp: false })(bitReversalInplace(values)); - } - if (brpInput) return FFTCore(opts, { N, roots, dit: true, brp: false }); - if (brpOutput) return FFTCore(opts, { N, roots, dit: false, brp: false }); - return FFTCore(opts, { N, roots, dit: true, brp: true }); // all natural - }; - return { - direct

>(values: P, brpInput = false, brpOutput = false): P { - const N = values.length; - if (!isPowerOfTwo(N)) throw new Error('FFT: Polynomial size should be power of two'); - const bits = log2(N); - return getLoop(N, roots.roots(bits), brpInput, brpOutput)

(values.slice()); - }, - inverse

>(values: P, brpInput = false, brpOutput = false): P { - const N = values.length; - const bits = log2(N); - const res = getLoop(N, roots.inverse(bits), brpInput, brpOutput)(values.slice()); - const ivm = opts.inv(BigInt(values.length)); // scale - // we can get brp output if we use dif instead of dit! - for (let i = 0; i < res.length; i++) res[i] = opts.mul(res[i], ivm); - // Allows to re-use non-inverted roots, but is VERY fragile - // return [res[0]].concat(res.slice(1).reverse()); - // inverse calculated as pow(-1), which transforms into ω^{-kn} (-> reverses indices) - return res; - }, - }; -} - -export type CreatePolyFn

, T> = (len: number, elm?: T) => P; - -export type PolyFn

, T> = { - roots: RootsOfUnity; - create: CreatePolyFn; - length?: number; // optional enforced size - - degree: (a: P) => number; - extend: (a: P, len: number) => P; - add: (a: P, b: P) => P; // fc(x) = fa(x) + fb(x) - sub: (a: P, b: P) => P; // fc(x) = fa(x) - fb(x) - mul: (a: P, b: P | T) => P; // fc(x) = fa(x) * fb(x) OR fc(x) = fa(x) * scalar (same as field) - dot: (a: P, b: P) => P; // point-wise coeff multiplication - convolve: (a: P, b: P) => P; - shift: (p: P, factor: bigint) => P; // point-wise coeffcient shift - clone: (a: P) => P; - // Eval - eval: (a: P, basis: P) => T; // y = fc(x) - monomial: { - basis: (x: T, n: number) => P; - eval: (a: P, x: T) => T; - }; - lagrange: { - basis: (x: T, n: number, brp?: boolean) => P; - eval: (a: P, x: T, brp?: boolean) => T; - }; - // Complex - vanishing: (roots: P) => P; // f(x) = 0 for every x in roots -}; - -/** - * Poly wants a cracker. - * - * Polynomials are functions like `y=f(x)`, which means when we multiply two polynomials, result is - * function `f3(x) = f1(x) * f2(x)`, we don't multiply values. Key takeaways: - * - * - **Polynomial** is an array of coefficients: `f(x) = sum(coeff[i] * basis[i](x))` - * - **Basis** is array of functions - * - **Monominal** is Polynomial where `basis[i](x) == x**i` (powers) - * - **Array size** is domain size - * - **Lattice** is matrix (Polynomial of Polynomials) - */ -export function poly( - field: IField, - roots: RootsOfUnity, - create?: undefined, - fft?: FFTMethods, - length?: number -): PolyFn; -export function poly>( - field: IField, - roots: RootsOfUnity, - create: CreatePolyFn, - fft?: FFTMethods, - length?: number -): PolyFn; -export function poly>( - field: IField, - roots: RootsOfUnity, - create?: CreatePolyFn, - fft?: FFTMethods, - length?: number -): PolyFn { - const F = field; - const _create = - create || - (((len: number, elm?: T): Polynomial => new Array(len).fill(elm ?? F.ZERO)) as CreatePolyFn< - P, - T - >); - - const isPoly = (x: any): x is P => Array.isArray(x) || ArrayBuffer.isView(x); - const checkLength = (...lst: P[]): number => { - if (!lst.length) return 0; - for (const i of lst) if (!isPoly(i)) throw new Error('poly: not polynomial: ' + i); - const L = lst[0].length; - for (let i = 1; i < lst.length; i++) - if (lst[i].length !== L) throw new Error(`poly: mismatched lengths ${L} vs ${lst[i].length}`); - if (length !== undefined && L !== length) - throw new Error(`poly: expected fixed length ${length}, got ${L}`); - return L; - }; - function findOmegaIndex(x: T, n: number, brp = false): number { - const bits = log2(n); - const omega = brp ? roots.brp(bits) : roots.roots(bits); - for (let i = 0; i < n; i++) if (F.eql(x, omega[i] as T)) return i; - return -1; - } - // TODO: mutating versions for mlkem/mldsa - return { - roots, - create: _create, - length, - extend: (a: P, len: number): P => { - checkLength(a); - const out = _create(len, F.ZERO); - for (let i = 0; i < a.length; i++) out[i] = a[i]; - return out; - }, - degree: (a: P): number => { - checkLength(a); - for (let i = a.length - 1; i >= 0; i--) if (!F.is0(a[i])) return i; - return -1; - }, - add: (a: P, b: P): P => { - const len = checkLength(a, b); - const out = _create(len); - for (let i = 0; i < len; i++) out[i] = F.add(a[i], b[i]); - return out; - }, - sub: (a: P, b: P): P => { - const len = checkLength(a, b); - const out = _create(len); - for (let i = 0; i < len; i++) out[i] = F.sub(a[i], b[i]); - return out; - }, - dot: (a: P, b: P): P => { - const len = checkLength(a, b); - const out = _create(len); - for (let i = 0; i < len; i++) out[i] = F.mul(a[i], b[i]); - return out; - }, - mul: (a: P, b: P | T): P => { - if (isPoly(b)) { - const len = checkLength(a, b); - if (fft) { - const A = fft.direct(a, false, true); - const B = fft.direct(b, false, true); - for (let i = 0; i < A.length; i++) A[i] = F.mul(A[i], B[i]); - return fft.inverse(A, true, false) as P; - } else { - // NOTE: this is quadratic and mostly for compat tests with FFT - const res = _create(len); - for (let i = 0; i < len; i++) { - for (let j = 0; j < len; j++) { - const k = (i + j) % len; // wrap mod length - res[k] = F.add(res[k], F.mul(a[i], b[j])); - } - } - return res; - } - } else { - const out = _create(checkLength(a)); - for (let i = 0; i < out.length; i++) out[i] = F.mul(a[i], b); - return out; - } - }, - convolve(a: P, b: P): P { - const len = nextPowerOfTwo(a.length + b.length - 1); - return this.mul(this.extend(a, len), this.extend(b, len)); - }, - shift(p: P, factor: bigint): P { - const out = _create(checkLength(p)); - out[0] = p[0]; - for (let i = 1, power = F.ONE; i < p.length; i++) { - power = F.mul(power, factor); - out[i] = F.mul(p[i], power); - } - return out; - }, - clone: (a: P): P => { - checkLength(a); - const out = _create(a.length); - for (let i = 0; i < a.length; i++) out[i] = a[i]; - return out; - }, - eval: (a: P, basis: P): T => { - checkLength(a); - let acc = F.ZERO; - for (let i = 0; i < a.length; i++) acc = F.add(acc, F.mul(a[i], basis[i])); - return acc; - }, - monomial: { - basis: (x: T, n: number): P => { - const out = _create(n); - let pow = F.ONE; - for (let i = 0; i < n; i++) { - out[i] = pow; - pow = F.mul(pow, x); - } - return out; - }, - eval: (a: P, x: T): T => { - checkLength(a); - // Same as eval(a, monomialBasis(x, a.length)), but it is faster this way - let acc = F.ZERO; - for (let i = a.length - 1; i >= 0; i--) acc = F.add(F.mul(acc, x), a[i]); - return acc; - }, - }, - lagrange: { - basis: (x: T, n: number, brp = false, weights?: P): P => { - const bits = log2(n); - const cache = weights || brp ? roots.brp(bits) : roots.roots(bits); // [ω⁰, ω¹, ..., ωⁿ⁻¹] - const out = _create(n); - // Fast Kronecker-δ shortcut - const idx = findOmegaIndex(x, n, brp); - if (idx !== -1) { - out[idx] = F.ONE; - return out; - } - const tm = F.pow(x, BigInt(n)); - const c = F.mul(F.sub(tm, F.ONE), F.inv(BigInt(n) as T)); // c = (xⁿ - 1)/n - const denom = _create(n); - for (let i = 0; i < n; i++) denom[i] = F.sub(x, cache[i] as T); - const inv = F.invertBatch(denom as any as T[]); - for (let i = 0; i < n; i++) out[i] = F.mul(c, F.mul(cache[i] as T, inv[i])); - return out; - }, - eval(a: P, x: T, brp = false): T { - checkLength(a); - const idx = findOmegaIndex(x, a.length, brp); - if (idx !== -1) return a[idx]; // fast path - const L = this.basis(x, a.length, brp); // Lᵢ(x) - let acc = F.ZERO; - for (let i = 0; i < a.length; i++) if (!F.is0(a[i])) acc = F.add(acc, F.mul(a[i], L[i])); - return acc; - }, - }, - vanishing(roots: P): P { - checkLength(roots); - const out = _create(roots.length + 1, F.ZERO); - out[0] = F.ONE; - for (const r of roots) { - const neg = F.neg(r); - for (let j = out.length - 1; j > 0; j--) out[j] = F.add(F.mul(out[j], neg), out[j - 1]); - out[0] = F.mul(out[0], neg); - } - return out; - }, - }; -} diff --git a/tools/mnemonic-test/node_modules/@noble/curves/src/abstract/hash-to-curve.ts b/tools/mnemonic-test/node_modules/@noble/curves/src/abstract/hash-to-curve.ts deleted file mode 100644 index 650057ea..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/src/abstract/hash-to-curve.ts +++ /dev/null @@ -1,306 +0,0 @@ -/** - * hash-to-curve from RFC 9380. - * Hashes arbitrary-length byte strings to a list of one or more elements of a finite field F. - * https://www.rfc-editor.org/rfc/rfc9380 - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import type { CHash } from '../utils.ts'; -import { - _validateObject, - abytes, - bytesToNumberBE, - concatBytes, - isBytes, - isHash, - utf8ToBytes, -} from '../utils.ts'; -import type { AffinePoint, Group, GroupConstructor } from './curve.ts'; -import { FpInvertBatch, mod, type IField } from './modular.ts'; - -export type UnicodeOrBytes = string | Uint8Array; - -/** - * * `DST` is a domain separation tag, defined in section 2.2.5 - * * `p` characteristic of F, where F is a finite field of characteristic p and order q = p^m - * * `m` is extension degree (1 for prime fields) - * * `k` is the target security target in bits (e.g. 128), from section 5.1 - * * `expand` is `xmd` (SHA2, SHA3, BLAKE) or `xof` (SHAKE, BLAKE-XOF) - * * `hash` conforming to `utils.CHash` interface, with `outputLen` / `blockLen` props - */ -export type H2COpts = { - DST: UnicodeOrBytes; - expand: 'xmd' | 'xof'; - hash: CHash; - p: bigint; - m: number; - k: number; -}; -export type H2CHashOpts = { - expand: 'xmd' | 'xof'; - hash: CHash; -}; -// todo: remove -export type Opts = H2COpts; - -// Octet Stream to Integer. "spec" implementation of os2ip is 2.5x slower vs bytesToNumberBE. -const os2ip = bytesToNumberBE; - -// Integer to Octet Stream (numberToBytesBE) -function i2osp(value: number, length: number): Uint8Array { - anum(value); - anum(length); - if (value < 0 || value >= 1 << (8 * length)) throw new Error('invalid I2OSP input: ' + value); - const res = Array.from({ length }).fill(0) as number[]; - for (let i = length - 1; i >= 0; i--) { - res[i] = value & 0xff; - value >>>= 8; - } - return new Uint8Array(res); -} - -function strxor(a: Uint8Array, b: Uint8Array): Uint8Array { - const arr = new Uint8Array(a.length); - for (let i = 0; i < a.length; i++) { - arr[i] = a[i] ^ b[i]; - } - return arr; -} - -function anum(item: unknown): void { - if (!Number.isSafeInteger(item)) throw new Error('number expected'); -} - -function normDST(DST: UnicodeOrBytes): Uint8Array { - if (!isBytes(DST) && typeof DST !== 'string') throw new Error('DST must be Uint8Array or string'); - return typeof DST === 'string' ? utf8ToBytes(DST) : DST; -} - -/** - * Produces a uniformly random byte string using a cryptographic hash function H that outputs b bits. - * [RFC 9380 5.3.1](https://www.rfc-editor.org/rfc/rfc9380#section-5.3.1). - */ -export function expand_message_xmd( - msg: Uint8Array, - DST: UnicodeOrBytes, - lenInBytes: number, - H: CHash -): Uint8Array { - abytes(msg); - anum(lenInBytes); - DST = normDST(DST); - // https://www.rfc-editor.org/rfc/rfc9380#section-5.3.3 - if (DST.length > 255) DST = H(concatBytes(utf8ToBytes('H2C-OVERSIZE-DST-'), DST)); - const { outputLen: b_in_bytes, blockLen: r_in_bytes } = H; - const ell = Math.ceil(lenInBytes / b_in_bytes); - if (lenInBytes > 65535 || ell > 255) throw new Error('expand_message_xmd: invalid lenInBytes'); - const DST_prime = concatBytes(DST, i2osp(DST.length, 1)); - const Z_pad = i2osp(0, r_in_bytes); - const l_i_b_str = i2osp(lenInBytes, 2); // len_in_bytes_str - const b = new Array(ell); - const b_0 = H(concatBytes(Z_pad, msg, l_i_b_str, i2osp(0, 1), DST_prime)); - b[0] = H(concatBytes(b_0, i2osp(1, 1), DST_prime)); - for (let i = 1; i <= ell; i++) { - const args = [strxor(b_0, b[i - 1]), i2osp(i + 1, 1), DST_prime]; - b[i] = H(concatBytes(...args)); - } - const pseudo_random_bytes = concatBytes(...b); - return pseudo_random_bytes.slice(0, lenInBytes); -} - -/** - * Produces a uniformly random byte string using an extendable-output function (XOF) H. - * 1. The collision resistance of H MUST be at least k bits. - * 2. H MUST be an XOF that has been proved indifferentiable from - * a random oracle under a reasonable cryptographic assumption. - * [RFC 9380 5.3.2](https://www.rfc-editor.org/rfc/rfc9380#section-5.3.2). - */ -export function expand_message_xof( - msg: Uint8Array, - DST: UnicodeOrBytes, - lenInBytes: number, - k: number, - H: CHash -): Uint8Array { - abytes(msg); - anum(lenInBytes); - DST = normDST(DST); - // https://www.rfc-editor.org/rfc/rfc9380#section-5.3.3 - // DST = H('H2C-OVERSIZE-DST-' || a_very_long_DST, Math.ceil((lenInBytes * k) / 8)); - if (DST.length > 255) { - const dkLen = Math.ceil((2 * k) / 8); - DST = H.create({ dkLen }).update(utf8ToBytes('H2C-OVERSIZE-DST-')).update(DST).digest(); - } - if (lenInBytes > 65535 || DST.length > 255) - throw new Error('expand_message_xof: invalid lenInBytes'); - return ( - H.create({ dkLen: lenInBytes }) - .update(msg) - .update(i2osp(lenInBytes, 2)) - // 2. DST_prime = DST || I2OSP(len(DST), 1) - .update(DST) - .update(i2osp(DST.length, 1)) - .digest() - ); -} - -/** - * Hashes arbitrary-length byte strings to a list of one or more elements of a finite field F. - * [RFC 9380 5.2](https://www.rfc-editor.org/rfc/rfc9380#section-5.2). - * @param msg a byte string containing the message to hash - * @param count the number of elements of F to output - * @param options `{DST: string, p: bigint, m: number, k: number, expand: 'xmd' | 'xof', hash: H}`, see above - * @returns [u_0, ..., u_(count - 1)], a list of field elements. - */ -export function hash_to_field(msg: Uint8Array, count: number, options: H2COpts): bigint[][] { - _validateObject(options, { - p: 'bigint', - m: 'number', - k: 'number', - hash: 'function', - }); - const { p, k, m, hash, expand, DST } = options; - if (!isHash(options.hash)) throw new Error('expected valid hash'); - abytes(msg); - anum(count); - const log2p = p.toString(2).length; - const L = Math.ceil((log2p + k) / 8); // section 5.1 of ietf draft link above - const len_in_bytes = count * m * L; - let prb; // pseudo_random_bytes - if (expand === 'xmd') { - prb = expand_message_xmd(msg, DST, len_in_bytes, hash); - } else if (expand === 'xof') { - prb = expand_message_xof(msg, DST, len_in_bytes, k, hash); - } else if (expand === '_internal_pass') { - // for internal tests only - prb = msg; - } else { - throw new Error('expand must be "xmd" or "xof"'); - } - const u = new Array(count); - for (let i = 0; i < count; i++) { - const e = new Array(m); - for (let j = 0; j < m; j++) { - const elm_offset = L * (j + i * m); - const tv = prb.subarray(elm_offset, elm_offset + L); - e[j] = mod(os2ip(tv), p); - } - u[i] = e; - } - return u; -} - -export type XY = (x: T, y: T) => { x: T; y: T }; -export type XYRatio = [T[], T[], T[], T[]]; // xn/xd, yn/yd -export function isogenyMap>(field: F, map: XYRatio): XY { - // Make same order as in spec - const coeff = map.map((i) => Array.from(i).reverse()); - return (x: T, y: T) => { - const [xn, xd, yn, yd] = coeff.map((val) => - val.reduce((acc, i) => field.add(field.mul(acc, x), i)) - ); - // 6.6.3 - // Exceptional cases of iso_map are inputs that cause the denominator of - // either rational function to evaluate to zero; such cases MUST return - // the identity point on E. - const [xd_inv, yd_inv] = FpInvertBatch(field, [xd, yd], true); - x = field.mul(xn, xd_inv); // xNum / xDen - y = field.mul(y, field.mul(yn, yd_inv)); // y * (yNum / yDev) - return { x, y }; - }; -} - -/** Point interface, which curves must implement to work correctly with the module. */ -export interface H2CPoint extends Group> { - add(rhs: H2CPoint): H2CPoint; - toAffine(iz?: bigint): AffinePoint; - clearCofactor(): H2CPoint; - assertValidity(): void; -} - -export interface H2CPointConstructor extends GroupConstructor> { - fromAffine(ap: AffinePoint): H2CPoint; -} - -export type MapToCurve = (scalar: bigint[]) => AffinePoint; - -// Separated from initialization opts, so users won't accidentally change per-curve parameters -// (changing DST is ok!) -export type htfBasicOpts = { DST: UnicodeOrBytes }; -export type H2CMethod = (msg: Uint8Array, options?: htfBasicOpts) => H2CPoint; -// TODO: remove -export type HTFMethod = H2CMethod; -export type MapMethod = (scalars: bigint[]) => H2CPoint; -export type H2CHasherBase = { - hashToCurve: H2CMethod; - hashToScalar: (msg: Uint8Array, options: htfBasicOpts) => bigint; -}; -/** - * RFC 9380 methods, with cofactor clearing. See https://www.rfc-editor.org/rfc/rfc9380#section-3. - * - * * hashToCurve: `map(hash(input))`, encodes RANDOM bytes to curve (WITH hashing) - * * encodeToCurve: `map(hash(input))`, encodes NON-UNIFORM bytes to curve (WITH hashing) - * * mapToCurve: `map(scalars)`, encodes NON-UNIFORM scalars to curve (NO hashing) - */ -export type H2CHasher = H2CHasherBase & { - encodeToCurve: H2CMethod; - mapToCurve: MapMethod; - defaults: H2COpts & { encodeDST?: UnicodeOrBytes }; -}; -// TODO: remove -export type Hasher = H2CHasher; - -export const _DST_scalar: Uint8Array = utf8ToBytes('HashToScalar-'); - -/** Creates hash-to-curve methods from EC Point and mapToCurve function. See {@link H2CHasher}. */ -export function createHasher( - Point: H2CPointConstructor, - mapToCurve: MapToCurve, - defaults: H2COpts & { encodeDST?: UnicodeOrBytes } -): H2CHasher { - if (typeof mapToCurve !== 'function') throw new Error('mapToCurve() must be defined'); - function map(num: bigint[]) { - return Point.fromAffine(mapToCurve(num)); - } - function clear(initial: H2CPoint) { - const P = initial.clearCofactor(); - if (P.equals(Point.ZERO)) return Point.ZERO; // zero will throw in assert - P.assertValidity(); - return P; - } - - return { - defaults, - - hashToCurve(msg: Uint8Array, options?: htfBasicOpts): H2CPoint { - const opts = Object.assign({}, defaults, options); - const u = hash_to_field(msg, 2, opts); - const u0 = map(u[0]); - const u1 = map(u[1]); - return clear(u0.add(u1)); - }, - encodeToCurve(msg: Uint8Array, options?: htfBasicOpts): H2CPoint { - const optsDst = defaults.encodeDST ? { DST: defaults.encodeDST } : {}; - const opts = Object.assign({}, defaults, optsDst, options); - const u = hash_to_field(msg, 1, opts); - const u0 = map(u[0]); - return clear(u0); - }, - /** See {@link H2CHasher} */ - mapToCurve(scalars: bigint[]): H2CPoint { - if (!Array.isArray(scalars)) throw new Error('expected array of bigints'); - for (const i of scalars) - if (typeof i !== 'bigint') throw new Error('expected array of bigints'); - return clear(map(scalars)); - }, - - // hash_to_scalar can produce 0: https://www.rfc-editor.org/errata/eid8393 - // RFC 9380, draft-irtf-cfrg-bbs-signatures-08 - hashToScalar(msg: Uint8Array, options?: htfBasicOpts): bigint { - // @ts-ignore - const N = Point.Fn.ORDER; - const opts = Object.assign({}, defaults, { p: N, m: 1, DST: _DST_scalar }, options); - return hash_to_field(msg, 1, opts)[0][0]; - }, - }; -} diff --git a/tools/mnemonic-test/node_modules/@noble/curves/src/abstract/modular.ts b/tools/mnemonic-test/node_modules/@noble/curves/src/abstract/modular.ts deleted file mode 100644 index e4618c04..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/src/abstract/modular.ts +++ /dev/null @@ -1,605 +0,0 @@ -/** - * Utils for modular division and fields. - * Field over 11 is a finite (Galois) field is integer number operations `mod 11`. - * There is no division: it is replaced by modular multiplicative inverse. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { - _validateObject, - anumber, - bitMask, - bytesToNumberBE, - bytesToNumberLE, - ensureBytes, - numberToBytesBE, - numberToBytesLE, -} from '../utils.ts'; - -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = /* @__PURE__ */ BigInt(2), _3n = /* @__PURE__ */ BigInt(3); -// prettier-ignore -const _4n = /* @__PURE__ */ BigInt(4), _5n = /* @__PURE__ */ BigInt(5), _7n = /* @__PURE__ */ BigInt(7); -// prettier-ignore -const _8n = /* @__PURE__ */ BigInt(8), _9n = /* @__PURE__ */ BigInt(9), _16n = /* @__PURE__ */ BigInt(16); - -// Calculates a modulo b -export function mod(a: bigint, b: bigint): bigint { - const result = a % b; - return result >= _0n ? result : b + result; -} -/** - * Efficiently raise num to power and do modular division. - * Unsafe in some contexts: uses ladder, so can expose bigint bits. - * @example - * pow(2n, 6n, 11n) // 64n % 11n == 9n - */ -export function pow(num: bigint, power: bigint, modulo: bigint): bigint { - return FpPow(Field(modulo), num, power); -} - -/** Does `x^(2^power)` mod p. `pow2(30, 4)` == `30^(2^4)` */ -export function pow2(x: bigint, power: bigint, modulo: bigint): bigint { - let res = x; - while (power-- > _0n) { - res *= res; - res %= modulo; - } - return res; -} - -/** - * Inverses number over modulo. - * Implemented using [Euclidean GCD](https://brilliant.org/wiki/extended-euclidean-algorithm/). - */ -export function invert(number: bigint, modulo: bigint): bigint { - if (number === _0n) throw new Error('invert: expected non-zero number'); - if (modulo <= _0n) throw new Error('invert: expected positive modulus, got ' + modulo); - // Fermat's little theorem "CT-like" version inv(n) = n^(m-2) mod m is 30x slower. - let a = mod(number, modulo); - let b = modulo; - // prettier-ignore - let x = _0n, y = _1n, u = _1n, v = _0n; - while (a !== _0n) { - // JIT applies optimization if those two lines follow each other - const q = b / a; - const r = b % a; - const m = x - u * q; - const n = y - v * q; - // prettier-ignore - b = a, a = r, x = u, y = v, u = m, v = n; - } - const gcd = b; - if (gcd !== _1n) throw new Error('invert: does not exist'); - return mod(x, modulo); -} - -function assertIsSquare(Fp: IField, root: T, n: T): void { - if (!Fp.eql(Fp.sqr(root), n)) throw new Error('Cannot find square root'); -} - -// Not all roots are possible! Example which will throw: -// const NUM = -// n = 72057594037927816n; -// Fp = Field(BigInt('0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab')); -function sqrt3mod4(Fp: IField, n: T) { - const p1div4 = (Fp.ORDER + _1n) / _4n; - const root = Fp.pow(n, p1div4); - assertIsSquare(Fp, root, n); - return root; -} - -function sqrt5mod8(Fp: IField, n: T) { - const p5div8 = (Fp.ORDER - _5n) / _8n; - const n2 = Fp.mul(n, _2n); - const v = Fp.pow(n2, p5div8); - const nv = Fp.mul(n, v); - const i = Fp.mul(Fp.mul(nv, _2n), v); - const root = Fp.mul(nv, Fp.sub(i, Fp.ONE)); - assertIsSquare(Fp, root, n); - return root; -} - -// Based on RFC9380, Kong algorithm -// prettier-ignore -function sqrt9mod16(P: bigint): (Fp: IField, n: T) => T { - const Fp_ = Field(P); - const tn = tonelliShanks(P); - const c1 = tn(Fp_, Fp_.neg(Fp_.ONE));// 1. c1 = sqrt(-1) in F, i.e., (c1^2) == -1 in F - const c2 = tn(Fp_, c1); // 2. c2 = sqrt(c1) in F, i.e., (c2^2) == c1 in F - const c3 = tn(Fp_, Fp_.neg(c1)); // 3. c3 = sqrt(-c1) in F, i.e., (c3^2) == -c1 in F - const c4 = (P + _7n) / _16n; // 4. c4 = (q + 7) / 16 # Integer arithmetic - return (Fp: IField, n: T) => { - let tv1 = Fp.pow(n, c4); // 1. tv1 = x^c4 - let tv2 = Fp.mul(tv1, c1); // 2. tv2 = c1 * tv1 - const tv3 = Fp.mul(tv1, c2); // 3. tv3 = c2 * tv1 - const tv4 = Fp.mul(tv1, c3); // 4. tv4 = c3 * tv1 - const e1 = Fp.eql(Fp.sqr(tv2), n); // 5. e1 = (tv2^2) == x - const e2 = Fp.eql(Fp.sqr(tv3), n); // 6. e2 = (tv3^2) == x - tv1 = Fp.cmov(tv1, tv2, e1); // 7. tv1 = CMOV(tv1, tv2, e1) # Select tv2 if (tv2^2) == x - tv2 = Fp.cmov(tv4, tv3, e2); // 8. tv2 = CMOV(tv4, tv3, e2) # Select tv3 if (tv3^2) == x - const e3 = Fp.eql(Fp.sqr(tv2), n); // 9. e3 = (tv2^2) == x - const root = Fp.cmov(tv1, tv2, e3);// 10. z = CMOV(tv1, tv2, e3) # Select sqrt from tv1 & tv2 - assertIsSquare(Fp, root, n); - return root; - }; -} - -/** - * Tonelli-Shanks square root search algorithm. - * 1. https://eprint.iacr.org/2012/685.pdf (page 12) - * 2. Square Roots from 1; 24, 51, 10 to Dan Shanks - * @param P field order - * @returns function that takes field Fp (created from P) and number n - */ -export function tonelliShanks(P: bigint): (Fp: IField, n: T) => T { - // Initialization (precomputation). - // Caching initialization could boost perf by 7%. - if (P < _3n) throw new Error('sqrt is not defined for small field'); - // Factor P - 1 = Q * 2^S, where Q is odd - let Q = P - _1n; - let S = 0; - while (Q % _2n === _0n) { - Q /= _2n; - S++; - } - - // Find the first quadratic non-residue Z >= 2 - let Z = _2n; - const _Fp = Field(P); - while (FpLegendre(_Fp, Z) === 1) { - // Basic primality test for P. After x iterations, chance of - // not finding quadratic non-residue is 2^x, so 2^1000. - if (Z++ > 1000) throw new Error('Cannot find square root: probably non-prime P'); - } - // Fast-path; usually done before Z, but we do "primality test". - if (S === 1) return sqrt3mod4; - - // Slow-path - // TODO: test on Fp2 and others - let cc = _Fp.pow(Z, Q); // c = z^Q - const Q1div2 = (Q + _1n) / _2n; - return function tonelliSlow(Fp: IField, n: T): T { - if (Fp.is0(n)) return n; - // Check if n is a quadratic residue using Legendre symbol - if (FpLegendre(Fp, n) !== 1) throw new Error('Cannot find square root'); - - // Initialize variables for the main loop - let M = S; - let c = Fp.mul(Fp.ONE, cc); // c = z^Q, move cc from field _Fp into field Fp - let t = Fp.pow(n, Q); // t = n^Q, first guess at the fudge factor - let R = Fp.pow(n, Q1div2); // R = n^((Q+1)/2), first guess at the square root - - // Main loop - // while t != 1 - while (!Fp.eql(t, Fp.ONE)) { - if (Fp.is0(t)) return Fp.ZERO; // if t=0 return R=0 - let i = 1; - - // Find the smallest i >= 1 such that t^(2^i) ≡ 1 (mod P) - let t_tmp = Fp.sqr(t); // t^(2^1) - while (!Fp.eql(t_tmp, Fp.ONE)) { - i++; - t_tmp = Fp.sqr(t_tmp); // t^(2^2)... - if (i === M) throw new Error('Cannot find square root'); - } - - // Calculate the exponent for b: 2^(M - i - 1) - const exponent = _1n << BigInt(M - i - 1); // bigint is important - const b = Fp.pow(c, exponent); // b = 2^(M - i - 1) - - // Update variables - M = i; - c = Fp.sqr(b); // c = b^2 - t = Fp.mul(t, c); // t = (t * b^2) - R = Fp.mul(R, b); // R = R*b - } - return R; - }; -} - -/** - * Square root for a finite field. Will try optimized versions first: - * - * 1. P ≡ 3 (mod 4) - * 2. P ≡ 5 (mod 8) - * 3. P ≡ 9 (mod 16) - * 4. Tonelli-Shanks algorithm - * - * Different algorithms can give different roots, it is up to user to decide which one they want. - * For example there is FpSqrtOdd/FpSqrtEven to choice root based on oddness (used for hash-to-curve). - */ -export function FpSqrt(P: bigint): (Fp: IField, n: T) => T { - // P ≡ 3 (mod 4) => √n = n^((P+1)/4) - if (P % _4n === _3n) return sqrt3mod4; - // P ≡ 5 (mod 8) => Atkin algorithm, page 10 of https://eprint.iacr.org/2012/685.pdf - if (P % _8n === _5n) return sqrt5mod8; - // P ≡ 9 (mod 16) => Kong algorithm, page 11 of https://eprint.iacr.org/2012/685.pdf (algorithm 4) - if (P % _16n === _9n) return sqrt9mod16(P); - // Tonelli-Shanks algorithm - return tonelliShanks(P); -} - -// Little-endian check for first LE bit (last BE bit); -export const isNegativeLE = (num: bigint, modulo: bigint): boolean => - (mod(num, modulo) & _1n) === _1n; - -/** Field is not always over prime: for example, Fp2 has ORDER(q)=p^m. */ -export interface IField { - ORDER: bigint; - isLE: boolean; - BYTES: number; - BITS: number; - MASK: bigint; - ZERO: T; - ONE: T; - // 1-arg - create: (num: T) => T; - isValid: (num: T) => boolean; - is0: (num: T) => boolean; - isValidNot0: (num: T) => boolean; - neg(num: T): T; - inv(num: T): T; - sqrt(num: T): T; - sqr(num: T): T; - // 2-args - eql(lhs: T, rhs: T): boolean; - add(lhs: T, rhs: T): T; - sub(lhs: T, rhs: T): T; - mul(lhs: T, rhs: T | bigint): T; - pow(lhs: T, power: bigint): T; - div(lhs: T, rhs: T | bigint): T; - // N for NonNormalized (for now) - addN(lhs: T, rhs: T): T; - subN(lhs: T, rhs: T): T; - mulN(lhs: T, rhs: T | bigint): T; - sqrN(num: T): T; - - // Optional - // Should be same as sgn0 function in - // [RFC9380](https://www.rfc-editor.org/rfc/rfc9380#section-4.1). - // NOTE: sgn0 is 'negative in LE', which is same as odd. And negative in LE is kinda strange definition anyway. - isOdd?(num: T): boolean; // Odd instead of even since we have it for Fp2 - allowedLengths?: number[]; - // legendre?(num: T): T; - invertBatch: (lst: T[]) => T[]; - toBytes(num: T): Uint8Array; - fromBytes(bytes: Uint8Array, skipValidation?: boolean): T; - // If c is False, CMOV returns a, otherwise it returns b. - cmov(a: T, b: T, c: boolean): T; -} -// prettier-ignore -const FIELD_FIELDS = [ - 'create', 'isValid', 'is0', 'neg', 'inv', 'sqrt', 'sqr', - 'eql', 'add', 'sub', 'mul', 'pow', 'div', - 'addN', 'subN', 'mulN', 'sqrN' -] as const; -export function validateField(field: IField): IField { - const initial = { - ORDER: 'bigint', - MASK: 'bigint', - BYTES: 'number', - BITS: 'number', - } as Record; - const opts = FIELD_FIELDS.reduce((map, val: string) => { - map[val] = 'function'; - return map; - }, initial); - _validateObject(field, opts); - // const max = 16384; - // if (field.BYTES < 1 || field.BYTES > max) throw new Error('invalid field'); - // if (field.BITS < 1 || field.BITS > 8 * max) throw new Error('invalid field'); - return field; -} - -// Generic field functions - -/** - * Same as `pow` but for Fp: non-constant-time. - * Unsafe in some contexts: uses ladder, so can expose bigint bits. - */ -export function FpPow(Fp: IField, num: T, power: bigint): T { - if (power < _0n) throw new Error('invalid exponent, negatives unsupported'); - if (power === _0n) return Fp.ONE; - if (power === _1n) return num; - let p = Fp.ONE; - let d = num; - while (power > _0n) { - if (power & _1n) p = Fp.mul(p, d); - d = Fp.sqr(d); - power >>= _1n; - } - return p; -} - -/** - * Efficiently invert an array of Field elements. - * Exception-free. Will return `undefined` for 0 elements. - * @param passZero map 0 to 0 (instead of undefined) - */ -export function FpInvertBatch(Fp: IField, nums: T[], passZero = false): T[] { - const inverted = new Array(nums.length).fill(passZero ? Fp.ZERO : undefined); - // Walk from first to last, multiply them by each other MOD p - const multipliedAcc = nums.reduce((acc, num, i) => { - if (Fp.is0(num)) return acc; - inverted[i] = acc; - return Fp.mul(acc, num); - }, Fp.ONE); - // Invert last element - const invertedAcc = Fp.inv(multipliedAcc); - // Walk from last to first, multiply them by inverted each other MOD p - nums.reduceRight((acc, num, i) => { - if (Fp.is0(num)) return acc; - inverted[i] = Fp.mul(acc, inverted[i]); - return Fp.mul(acc, num); - }, invertedAcc); - return inverted; -} - -// TODO: remove -export function FpDiv(Fp: IField, lhs: T, rhs: T | bigint): T { - return Fp.mul(lhs, typeof rhs === 'bigint' ? invert(rhs, Fp.ORDER) : Fp.inv(rhs)); -} - -/** - * Legendre symbol. - * Legendre constant is used to calculate Legendre symbol (a | p) - * which denotes the value of a^((p-1)/2) (mod p). - * - * * (a | p) ≡ 1 if a is a square (mod p), quadratic residue - * * (a | p) ≡ -1 if a is not a square (mod p), quadratic non residue - * * (a | p) ≡ 0 if a ≡ 0 (mod p) - */ -export function FpLegendre(Fp: IField, n: T): -1 | 0 | 1 { - // We can use 3rd argument as optional cache of this value - // but seems unneeded for now. The operation is very fast. - const p1mod2 = (Fp.ORDER - _1n) / _2n; - const powered = Fp.pow(n, p1mod2); - const yes = Fp.eql(powered, Fp.ONE); - const zero = Fp.eql(powered, Fp.ZERO); - const no = Fp.eql(powered, Fp.neg(Fp.ONE)); - if (!yes && !zero && !no) throw new Error('invalid Legendre symbol result'); - return yes ? 1 : zero ? 0 : -1; -} - -// This function returns True whenever the value x is a square in the field F. -export function FpIsSquare(Fp: IField, n: T): boolean { - const l = FpLegendre(Fp, n); - return l === 1; -} - -export type NLength = { nByteLength: number; nBitLength: number }; -// CURVE.n lengths -export function nLength(n: bigint, nBitLength?: number): NLength { - // Bit size, byte size of CURVE.n - if (nBitLength !== undefined) anumber(nBitLength); - const _nBitLength = nBitLength !== undefined ? nBitLength : n.toString(2).length; - const nByteLength = Math.ceil(_nBitLength / 8); - return { nBitLength: _nBitLength, nByteLength }; -} - -type FpField = IField & Required, 'isOdd'>>; -type SqrtFn = (n: bigint) => bigint; -type FieldOpts = Partial<{ - sqrt: SqrtFn; - isLE: boolean; - BITS: number; - modFromBytes: boolean; // bls12-381 requires mod(n) instead of rejecting keys >= n - allowedLengths?: readonly number[]; // for P521 (adds padding for smaller sizes) -}>; -/** - * Creates a finite field. Major performance optimizations: - * * 1. Denormalized operations like mulN instead of mul. - * * 2. Identical object shape: never add or remove keys. - * * 3. `Object.freeze`. - * Fragile: always run a benchmark on a change. - * Security note: operations don't check 'isValid' for all elements for performance reasons, - * it is caller responsibility to check this. - * This is low-level code, please make sure you know what you're doing. - * - * Note about field properties: - * * CHARACTERISTIC p = prime number, number of elements in main subgroup. - * * ORDER q = similar to cofactor in curves, may be composite `q = p^m`. - * - * @param ORDER field order, probably prime, or could be composite - * @param bitLen how many bits the field consumes - * @param isLE (default: false) if encoding / decoding should be in little-endian - * @param redef optional faster redefinitions of sqrt and other methods - */ -export function Field( - ORDER: bigint, - bitLenOrOpts?: number | FieldOpts, // TODO: use opts only in v2? - isLE = false, - opts: { sqrt?: SqrtFn } = {} -): Readonly { - if (ORDER <= _0n) throw new Error('invalid field: expected ORDER > 0, got ' + ORDER); - let _nbitLength: number | undefined = undefined; - let _sqrt: SqrtFn | undefined = undefined; - let modFromBytes: boolean = false; - let allowedLengths: undefined | readonly number[] = undefined; - if (typeof bitLenOrOpts === 'object' && bitLenOrOpts != null) { - if (opts.sqrt || isLE) throw new Error('cannot specify opts in two arguments'); - const _opts = bitLenOrOpts; - if (_opts.BITS) _nbitLength = _opts.BITS; - if (_opts.sqrt) _sqrt = _opts.sqrt; - if (typeof _opts.isLE === 'boolean') isLE = _opts.isLE; - if (typeof _opts.modFromBytes === 'boolean') modFromBytes = _opts.modFromBytes; - allowedLengths = _opts.allowedLengths; - } else { - if (typeof bitLenOrOpts === 'number') _nbitLength = bitLenOrOpts; - if (opts.sqrt) _sqrt = opts.sqrt; - } - const { nBitLength: BITS, nByteLength: BYTES } = nLength(ORDER, _nbitLength); - if (BYTES > 2048) throw new Error('invalid field: expected ORDER of <= 2048 bytes'); - let sqrtP: ReturnType; // cached sqrtP - const f: Readonly = Object.freeze({ - ORDER, - isLE, - BITS, - BYTES, - MASK: bitMask(BITS), - ZERO: _0n, - ONE: _1n, - allowedLengths: allowedLengths, - create: (num) => mod(num, ORDER), - isValid: (num) => { - if (typeof num !== 'bigint') - throw new Error('invalid field element: expected bigint, got ' + typeof num); - return _0n <= num && num < ORDER; // 0 is valid element, but it's not invertible - }, - is0: (num) => num === _0n, - // is valid and invertible - isValidNot0: (num: bigint) => !f.is0(num) && f.isValid(num), - isOdd: (num) => (num & _1n) === _1n, - neg: (num) => mod(-num, ORDER), - eql: (lhs, rhs) => lhs === rhs, - - sqr: (num) => mod(num * num, ORDER), - add: (lhs, rhs) => mod(lhs + rhs, ORDER), - sub: (lhs, rhs) => mod(lhs - rhs, ORDER), - mul: (lhs, rhs) => mod(lhs * rhs, ORDER), - pow: (num, power) => FpPow(f, num, power), - div: (lhs, rhs) => mod(lhs * invert(rhs, ORDER), ORDER), - - // Same as above, but doesn't normalize - sqrN: (num) => num * num, - addN: (lhs, rhs) => lhs + rhs, - subN: (lhs, rhs) => lhs - rhs, - mulN: (lhs, rhs) => lhs * rhs, - - inv: (num) => invert(num, ORDER), - sqrt: - _sqrt || - ((n) => { - if (!sqrtP) sqrtP = FpSqrt(ORDER); - return sqrtP(f, n); - }), - toBytes: (num) => (isLE ? numberToBytesLE(num, BYTES) : numberToBytesBE(num, BYTES)), - fromBytes: (bytes, skipValidation = true) => { - if (allowedLengths) { - if (!allowedLengths.includes(bytes.length) || bytes.length > BYTES) { - throw new Error( - 'Field.fromBytes: expected ' + allowedLengths + ' bytes, got ' + bytes.length - ); - } - const padded = new Uint8Array(BYTES); - // isLE add 0 to right, !isLE to the left. - padded.set(bytes, isLE ? 0 : padded.length - bytes.length); - bytes = padded; - } - if (bytes.length !== BYTES) - throw new Error('Field.fromBytes: expected ' + BYTES + ' bytes, got ' + bytes.length); - let scalar = isLE ? bytesToNumberLE(bytes) : bytesToNumberBE(bytes); - if (modFromBytes) scalar = mod(scalar, ORDER); - if (!skipValidation) - if (!f.isValid(scalar)) throw new Error('invalid field element: outside of range 0..ORDER'); - // NOTE: we don't validate scalar here, please use isValid. This done such way because some - // protocol may allow non-reduced scalar that reduced later or changed some other way. - return scalar; - }, - // TODO: we don't need it here, move out to separate fn - invertBatch: (lst) => FpInvertBatch(f, lst), - // We can't move this out because Fp6, Fp12 implement it - // and it's unclear what to return in there. - cmov: (a, b, c) => (c ? b : a), - } as FpField); - return Object.freeze(f); -} - -// Generic random scalar, we can do same for other fields if via Fp2.mul(Fp2.ONE, Fp2.random)? -// This allows unsafe methods like ignore bias or zero. These unsafe, but often used in different protocols (if deterministic RNG). -// which mean we cannot force this via opts. -// Not sure what to do with randomBytes, we can accept it inside opts if wanted. -// Probably need to export getMinHashLength somewhere? -// random(bytes?: Uint8Array, unsafeAllowZero = false, unsafeAllowBias = false) { -// const LEN = !unsafeAllowBias ? getMinHashLength(ORDER) : BYTES; -// if (bytes === undefined) bytes = randomBytes(LEN); // _opts.randomBytes? -// const num = isLE ? bytesToNumberLE(bytes) : bytesToNumberBE(bytes); -// // `mod(x, 11)` can sometimes produce 0. `mod(x, 10) + 1` is the same, but no 0 -// const reduced = unsafeAllowZero ? mod(num, ORDER) : mod(num, ORDER - _1n) + _1n; -// return reduced; -// }, - -export function FpSqrtOdd(Fp: IField, elm: T): T { - if (!Fp.isOdd) throw new Error("Field doesn't have isOdd"); - const root = Fp.sqrt(elm); - return Fp.isOdd(root) ? root : Fp.neg(root); -} - -export function FpSqrtEven(Fp: IField, elm: T): T { - if (!Fp.isOdd) throw new Error("Field doesn't have isOdd"); - const root = Fp.sqrt(elm); - return Fp.isOdd(root) ? Fp.neg(root) : root; -} - -/** - * "Constant-time" private key generation utility. - * Same as mapKeyToField, but accepts less bytes (40 instead of 48 for 32-byte field). - * Which makes it slightly more biased, less secure. - * @deprecated use `mapKeyToField` instead - */ -export function hashToPrivateScalar( - hash: string | Uint8Array, - groupOrder: bigint, - isLE = false -): bigint { - hash = ensureBytes('privateHash', hash); - const hashLen = hash.length; - const minLen = nLength(groupOrder).nByteLength + 8; - if (minLen < 24 || hashLen < minLen || hashLen > 1024) - throw new Error( - 'hashToPrivateScalar: expected ' + minLen + '-1024 bytes of input, got ' + hashLen - ); - const num = isLE ? bytesToNumberLE(hash) : bytesToNumberBE(hash); - return mod(num, groupOrder - _1n) + _1n; -} - -/** - * Returns total number of bytes consumed by the field element. - * For example, 32 bytes for usual 256-bit weierstrass curve. - * @param fieldOrder number of field elements, usually CURVE.n - * @returns byte length of field - */ -export function getFieldBytesLength(fieldOrder: bigint): number { - if (typeof fieldOrder !== 'bigint') throw new Error('field order must be bigint'); - const bitLength = fieldOrder.toString(2).length; - return Math.ceil(bitLength / 8); -} - -/** - * Returns minimal amount of bytes that can be safely reduced - * by field order. - * Should be 2^-128 for 128-bit curve such as P256. - * @param fieldOrder number of field elements, usually CURVE.n - * @returns byte length of target hash - */ -export function getMinHashLength(fieldOrder: bigint): number { - const length = getFieldBytesLength(fieldOrder); - return length + Math.ceil(length / 2); -} - -/** - * "Constant-time" private key generation utility. - * Can take (n + n/2) or more bytes of uniform input e.g. from CSPRNG or KDF - * and convert them into private scalar, with the modulo bias being negligible. - * Needs at least 48 bytes of input for 32-byte private key. - * https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/ - * FIPS 186-5, A.2 https://csrc.nist.gov/publications/detail/fips/186/5/final - * RFC 9380, https://www.rfc-editor.org/rfc/rfc9380#section-5 - * @param hash hash output from SHA3 or a similar function - * @param groupOrder size of subgroup - (e.g. secp256k1.CURVE.n) - * @param isLE interpret hash bytes as LE num - * @returns valid private scalar - */ -export function mapHashToField(key: Uint8Array, fieldOrder: bigint, isLE = false): Uint8Array { - const len = key.length; - const fieldLen = getFieldBytesLength(fieldOrder); - const minLen = getMinHashLength(fieldOrder); - // No small numbers: need to understand bias story. No huge numbers: easier to detect JS timings. - if (len < 16 || len < minLen || len > 1024) - throw new Error('expected ' + minLen + '-1024 bytes of input, got ' + len); - const num = isLE ? bytesToNumberLE(key) : bytesToNumberBE(key); - // `mod(x, 11)` can sometimes produce 0. `mod(x, 10) + 1` is the same, but no 0 - const reduced = mod(num, fieldOrder - _1n) + _1n; - return isLE ? numberToBytesLE(reduced, fieldLen) : numberToBytesBE(reduced, fieldLen); -} diff --git a/tools/mnemonic-test/node_modules/@noble/curves/src/abstract/montgomery.ts b/tools/mnemonic-test/node_modules/@noble/curves/src/abstract/montgomery.ts deleted file mode 100644 index 7404c911..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/src/abstract/montgomery.ts +++ /dev/null @@ -1,194 +0,0 @@ -/** - * Montgomery curve methods. It's not really whole montgomery curve, - * just bunch of very specific methods for X25519 / X448 from - * [RFC 7748](https://www.rfc-editor.org/rfc/rfc7748) - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { - _validateObject, - abytes, - aInRange, - bytesToNumberLE, - ensureBytes, - numberToBytesLE, - randomBytes, -} from '../utils.ts'; -import type { CurveLengths } from './curve.ts'; -import { mod } from './modular.ts'; - -const _0n = BigInt(0); -const _1n = BigInt(1); -const _2n = BigInt(2); -type Hex = string | Uint8Array; - -export type CurveType = { - P: bigint; // finite field prime - type: 'x25519' | 'x448'; - adjustScalarBytes: (bytes: Uint8Array) => Uint8Array; - powPminus2: (x: bigint) => bigint; - randomBytes?: (bytesLength?: number) => Uint8Array; -}; - -export type MontgomeryECDH = { - scalarMult: (scalar: Hex, u: Hex) => Uint8Array; - scalarMultBase: (scalar: Hex) => Uint8Array; - getSharedSecret: (secretKeyA: Hex, publicKeyB: Hex) => Uint8Array; - getPublicKey: (secretKey: Hex) => Uint8Array; - utils: { - randomSecretKey: () => Uint8Array; - /** @deprecated use `randomSecretKey` */ - randomPrivateKey: () => Uint8Array; - }; - GuBytes: Uint8Array; - lengths: CurveLengths; - keygen: (seed?: Uint8Array) => { secretKey: Uint8Array; publicKey: Uint8Array }; -}; -export type CurveFn = MontgomeryECDH; - -function validateOpts(curve: CurveType) { - _validateObject(curve, { - adjustScalarBytes: 'function', - powPminus2: 'function', - }); - return Object.freeze({ ...curve } as const); -} - -export function montgomery(curveDef: CurveType): MontgomeryECDH { - const CURVE = validateOpts(curveDef); - const { P, type, adjustScalarBytes, powPminus2, randomBytes: rand } = CURVE; - const is25519 = type === 'x25519'; - if (!is25519 && type !== 'x448') throw new Error('invalid type'); - const randomBytes_ = rand || randomBytes; - - const montgomeryBits = is25519 ? 255 : 448; - const fieldLen = is25519 ? 32 : 56; - const Gu = is25519 ? BigInt(9) : BigInt(5); - // RFC 7748 #5: - // The constant a24 is (486662 - 2) / 4 = 121665 for curve25519/X25519 and - // (156326 - 2) / 4 = 39081 for curve448/X448 - // const a = is25519 ? 156326n : 486662n; - const a24 = is25519 ? BigInt(121665) : BigInt(39081); - // RFC: x25519 "the resulting integer is of the form 2^254 plus - // eight times a value between 0 and 2^251 - 1 (inclusive)" - // x448: "2^447 plus four times a value between 0 and 2^445 - 1 (inclusive)" - const minScalar = is25519 ? _2n ** BigInt(254) : _2n ** BigInt(447); - const maxAdded = is25519 - ? BigInt(8) * _2n ** BigInt(251) - _1n - : BigInt(4) * _2n ** BigInt(445) - _1n; - const maxScalar = minScalar + maxAdded + _1n; // (inclusive) - const modP = (n: bigint) => mod(n, P); - const GuBytes = encodeU(Gu); - function encodeU(u: bigint): Uint8Array { - return numberToBytesLE(modP(u), fieldLen); - } - function decodeU(u: Hex): bigint { - const _u = ensureBytes('u coordinate', u, fieldLen); - // RFC: When receiving such an array, implementations of X25519 - // (but not X448) MUST mask the most significant bit in the final byte. - if (is25519) _u[31] &= 127; // 0b0111_1111 - // RFC: Implementations MUST accept non-canonical values and process them as - // if they had been reduced modulo the field prime. The non-canonical - // values are 2^255 - 19 through 2^255 - 1 for X25519 and 2^448 - 2^224 - // - 1 through 2^448 - 1 for X448. - return modP(bytesToNumberLE(_u)); - } - function decodeScalar(scalar: Hex): bigint { - return bytesToNumberLE(adjustScalarBytes(ensureBytes('scalar', scalar, fieldLen))); - } - function scalarMult(scalar: Hex, u: Hex): Uint8Array { - const pu = montgomeryLadder(decodeU(u), decodeScalar(scalar)); - // Some public keys are useless, of low-order. Curve author doesn't think - // it needs to be validated, but we do it nonetheless. - // https://cr.yp.to/ecdh.html#validate - if (pu === _0n) throw new Error('invalid private or public key received'); - return encodeU(pu); - } - // Computes public key from private. By doing scalar multiplication of base point. - function scalarMultBase(scalar: Hex): Uint8Array { - return scalarMult(scalar, GuBytes); - } - - // cswap from RFC7748 "example code" - function cswap(swap: bigint, x_2: bigint, x_3: bigint): { x_2: bigint; x_3: bigint } { - // dummy = mask(swap) AND (x_2 XOR x_3) - // Where mask(swap) is the all-1 or all-0 word of the same length as x_2 - // and x_3, computed, e.g., as mask(swap) = 0 - swap. - const dummy = modP(swap * (x_2 - x_3)); - x_2 = modP(x_2 - dummy); // x_2 = x_2 XOR dummy - x_3 = modP(x_3 + dummy); // x_3 = x_3 XOR dummy - return { x_2, x_3 }; - } - - /** - * Montgomery x-only multiplication ladder. - * @param pointU u coordinate (x) on Montgomery Curve 25519 - * @param scalar by which the point would be multiplied - * @returns new Point on Montgomery curve - */ - function montgomeryLadder(u: bigint, scalar: bigint): bigint { - aInRange('u', u, _0n, P); - aInRange('scalar', scalar, minScalar, maxScalar); - const k = scalar; - const x_1 = u; - let x_2 = _1n; - let z_2 = _0n; - let x_3 = u; - let z_3 = _1n; - let swap = _0n; - for (let t = BigInt(montgomeryBits - 1); t >= _0n; t--) { - const k_t = (k >> t) & _1n; - swap ^= k_t; - ({ x_2, x_3 } = cswap(swap, x_2, x_3)); - ({ x_2: z_2, x_3: z_3 } = cswap(swap, z_2, z_3)); - swap = k_t; - - const A = x_2 + z_2; - const AA = modP(A * A); - const B = x_2 - z_2; - const BB = modP(B * B); - const E = AA - BB; - const C = x_3 + z_3; - const D = x_3 - z_3; - const DA = modP(D * A); - const CB = modP(C * B); - const dacb = DA + CB; - const da_cb = DA - CB; - x_3 = modP(dacb * dacb); - z_3 = modP(x_1 * modP(da_cb * da_cb)); - x_2 = modP(AA * BB); - z_2 = modP(E * (AA + modP(a24 * E))); - } - ({ x_2, x_3 } = cswap(swap, x_2, x_3)); - ({ x_2: z_2, x_3: z_3 } = cswap(swap, z_2, z_3)); - const z2 = powPminus2(z_2); // `Fp.pow(x, P - _2n)` is much slower equivalent - return modP(x_2 * z2); // Return x_2 * (z_2^(p - 2)) - } - const lengths = { - secretKey: fieldLen, - publicKey: fieldLen, - seed: fieldLen, - }; - const randomSecretKey = (seed = randomBytes_(fieldLen)) => { - abytes(seed, lengths.seed); - return seed; - }; - function keygen(seed?: Uint8Array) { - const secretKey = randomSecretKey(seed); - return { secretKey, publicKey: scalarMultBase(secretKey) }; - } - const utils = { - randomSecretKey, - randomPrivateKey: randomSecretKey, - }; - return { - keygen, - getSharedSecret: (secretKey: Hex, publicKey: Hex) => scalarMult(secretKey, publicKey), - getPublicKey: (secretKey: Hex): Uint8Array => scalarMultBase(secretKey), - scalarMult, - scalarMultBase, - utils, - GuBytes: GuBytes.slice(), - lengths, - }; -} diff --git a/tools/mnemonic-test/node_modules/@noble/curves/src/abstract/poseidon.ts b/tools/mnemonic-test/node_modules/@noble/curves/src/abstract/poseidon.ts deleted file mode 100644 index 74b3f1e3..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/src/abstract/poseidon.ts +++ /dev/null @@ -1,335 +0,0 @@ -/** - * Implements [Poseidon](https://www.poseidon-hash.info) ZK-friendly hash. - * - * There are many poseidon variants with different constants. - * We don't provide them: you should construct them manually. - * Check out [micro-starknet](https://github.com/paulmillr/micro-starknet) package for a proper example. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { _validateObject, bitGet } from '../utils.ts'; -import { FpInvertBatch, FpPow, type IField, validateField } from './modular.ts'; - -// Grain LFSR (Linear-Feedback Shift Register): https://eprint.iacr.org/2009/109.pdf -function grainLFSR(state: number[]): () => boolean { - let pos = 0; - if (state.length !== 80) throw new Error('grainLFRS: wrong state length, should be 80 bits'); - const getBit = (): boolean => { - const r = (offset: number) => state[(pos + offset) % 80]; - const bit = r(62) ^ r(51) ^ r(38) ^ r(23) ^ r(13) ^ r(0); - state[pos] = bit; - pos = ++pos % 80; - return !!bit; - }; - for (let i = 0; i < 160; i++) getBit(); - return () => { - // https://en.wikipedia.org/wiki/Shrinking_generator - while (true) { - const b1 = getBit(); - const b2 = getBit(); - if (!b1) continue; - return b2; - } - }; -} - -export type PoseidonBasicOpts = { - Fp: IField; - t: number; // t = rate + capacity - roundsFull: number; - roundsPartial: number; - isSboxInverse?: boolean; -}; - -function assertValidPosOpts(opts: PoseidonBasicOpts) { - const { Fp, roundsFull } = opts; - validateField(Fp); - _validateObject( - opts, - { - t: 'number', - roundsFull: 'number', - roundsPartial: 'number', - }, - { - isSboxInverse: 'boolean', - } - ); - for (const i of ['t', 'roundsFull', 'roundsPartial'] as const) { - if (!Number.isSafeInteger(opts[i]) || opts[i] < 1) throw new Error('invalid number ' + i); - } - if (roundsFull & 1) throw new Error('roundsFull is not even' + roundsFull); -} - -function poseidonGrain(opts: PoseidonBasicOpts) { - assertValidPosOpts(opts); - const { Fp } = opts; - const state = Array(80).fill(1); - let pos = 0; - const writeBits = (value: bigint, bitCount: number) => { - for (let i = bitCount - 1; i >= 0; i--) state[pos++] = Number(bitGet(value, i)); - }; - const _0n = BigInt(0); - const _1n = BigInt(1); - writeBits(_1n, 2); // prime field - writeBits(opts.isSboxInverse ? _1n : _0n, 4); // b2..b5 - writeBits(BigInt(Fp.BITS), 12); // b6..b17 - writeBits(BigInt(opts.t), 12); // b18..b29 - writeBits(BigInt(opts.roundsFull), 10); // b30..b39 - writeBits(BigInt(opts.roundsPartial), 10); // b40..b49 - - const getBit = grainLFSR(state); - return (count: number, reject: boolean): bigint[] => { - const res: bigint[] = []; - for (let i = 0; i < count; i++) { - while (true) { - let num = _0n; - for (let i = 0; i < Fp.BITS; i++) { - num <<= _1n; - if (getBit()) num |= _1n; - } - if (reject && num >= Fp.ORDER) continue; // rejection sampling - res.push(Fp.create(num)); - break; - } - } - return res; - }; -} - -export type PoseidonGrainOpts = PoseidonBasicOpts & { - sboxPower?: number; -}; - -type PoseidonConstants = { mds: bigint[][]; roundConstants: bigint[][] }; - -// NOTE: this is not standard but used often for constant generation for poseidon -// (grain LFRS-like structure) -export function grainGenConstants(opts: PoseidonGrainOpts, skipMDS: number = 0): PoseidonConstants { - const { Fp, t, roundsFull, roundsPartial } = opts; - const rounds = roundsFull + roundsPartial; - const sample = poseidonGrain(opts); - const roundConstants: bigint[][] = []; - for (let r = 0; r < rounds; r++) roundConstants.push(sample(t, true)); - if (skipMDS > 0) for (let i = 0; i < skipMDS; i++) sample(2 * t, false); - const xs = sample(t, false); - const ys = sample(t, false); - // Construct MDS Matrix M[i][j] = 1 / (xs[i] + ys[j]) - const mds: bigint[][] = []; - for (let i = 0; i < t; i++) { - const row: bigint[] = []; - for (let j = 0; j < t; j++) { - const xy = Fp.add(xs[i], ys[j]); - if (Fp.is0(xy)) - throw new Error(`Error generating MDS matrix: xs[${i}] + ys[${j}] resulted in zero.`); - row.push(xy); - } - mds.push(FpInvertBatch(Fp, row)); - } - - return { roundConstants, mds }; -} - -export type PoseidonOpts = PoseidonBasicOpts & - PoseidonConstants & { - sboxPower?: number; - reversePartialPowIdx?: boolean; // Hack for stark - }; - -export function validateOpts(opts: PoseidonOpts): Readonly<{ - rounds: number; - sboxFn: (n: bigint) => bigint; - roundConstants: bigint[][]; - mds: bigint[][]; - Fp: IField; - t: number; - roundsFull: number; - roundsPartial: number; - sboxPower?: number; - reversePartialPowIdx?: boolean; // Hack for stark -}> { - assertValidPosOpts(opts); - const { Fp, mds, reversePartialPowIdx: rev, roundConstants: rc } = opts; - const { roundsFull, roundsPartial, sboxPower, t } = opts; - - // MDS is TxT matrix - if (!Array.isArray(mds) || mds.length !== t) throw new Error('Poseidon: invalid MDS matrix'); - const _mds = mds.map((mdsRow) => { - if (!Array.isArray(mdsRow) || mdsRow.length !== t) - throw new Error('invalid MDS matrix row: ' + mdsRow); - return mdsRow.map((i) => { - if (typeof i !== 'bigint') throw new Error('invalid MDS matrix bigint: ' + i); - return Fp.create(i); - }); - }); - - if (rev !== undefined && typeof rev !== 'boolean') - throw new Error('invalid param reversePartialPowIdx=' + rev); - - if (roundsFull & 1) throw new Error('roundsFull is not even' + roundsFull); - const rounds = roundsFull + roundsPartial; - - if (!Array.isArray(rc) || rc.length !== rounds) - throw new Error('Poseidon: invalid round constants'); - const roundConstants = rc.map((rc) => { - if (!Array.isArray(rc) || rc.length !== t) throw new Error('invalid round constants'); - return rc.map((i) => { - if (typeof i !== 'bigint' || !Fp.isValid(i)) throw new Error('invalid round constant'); - return Fp.create(i); - }); - }); - - if (!sboxPower || ![3, 5, 7, 17].includes(sboxPower)) throw new Error('invalid sboxPower'); - const _sboxPower = BigInt(sboxPower); - let sboxFn = (n: bigint) => FpPow(Fp, n, _sboxPower); - // Unwrapped sbox power for common cases (195->142μs) - if (sboxPower === 3) sboxFn = (n: bigint) => Fp.mul(Fp.sqrN(n), n); - else if (sboxPower === 5) sboxFn = (n: bigint) => Fp.mul(Fp.sqrN(Fp.sqrN(n)), n); - - return Object.freeze({ ...opts, rounds, sboxFn, roundConstants, mds: _mds }); -} - -export function splitConstants(rc: bigint[], t: number): bigint[][] { - if (typeof t !== 'number') throw new Error('poseidonSplitConstants: invalid t'); - if (!Array.isArray(rc) || rc.length % t) throw new Error('poseidonSplitConstants: invalid rc'); - const res = []; - let tmp = []; - for (let i = 0; i < rc.length; i++) { - tmp.push(rc[i]); - if (tmp.length === t) { - res.push(tmp); - tmp = []; - } - } - return res; -} - -export type PoseidonFn = { - (values: bigint[]): bigint[]; - // For verification in tests - roundConstants: bigint[][]; -}; -/** Poseidon NTT-friendly hash. */ -export function poseidon(opts: PoseidonOpts): PoseidonFn { - const _opts = validateOpts(opts); - const { Fp, mds, roundConstants, rounds: totalRounds, roundsPartial, sboxFn, t } = _opts; - const halfRoundsFull = _opts.roundsFull / 2; - const partialIdx = _opts.reversePartialPowIdx ? t - 1 : 0; - const poseidonRound = (values: bigint[], isFull: boolean, idx: number) => { - values = values.map((i, j) => Fp.add(i, roundConstants[idx][j])); - - if (isFull) values = values.map((i) => sboxFn(i)); - else values[partialIdx] = sboxFn(values[partialIdx]); - // Matrix multiplication - values = mds.map((i) => i.reduce((acc, i, j) => Fp.add(acc, Fp.mulN(i, values[j])), Fp.ZERO)); - return values; - }; - const poseidonHash = function poseidonHash(values: bigint[]) { - if (!Array.isArray(values) || values.length !== t) - throw new Error('invalid values, expected array of bigints with length ' + t); - values = values.map((i) => { - if (typeof i !== 'bigint') throw new Error('invalid bigint=' + i); - return Fp.create(i); - }); - let lastRound = 0; - // Apply r_f/2 full rounds. - for (let i = 0; i < halfRoundsFull; i++) values = poseidonRound(values, true, lastRound++); - // Apply r_p partial rounds. - for (let i = 0; i < roundsPartial; i++) values = poseidonRound(values, false, lastRound++); - // Apply r_f/2 full rounds. - for (let i = 0; i < halfRoundsFull; i++) values = poseidonRound(values, true, lastRound++); - - if (lastRound !== totalRounds) throw new Error('invalid number of rounds'); - return values; - }; - // For verification in tests - poseidonHash.roundConstants = roundConstants; - return poseidonHash; -} - -export class PoseidonSponge { - private Fp: IField; - readonly rate: number; - readonly capacity: number; - readonly hash: PoseidonFn; - private state: bigint[]; // [...capacity, ...rate] - private pos = 0; - private isAbsorbing = true; - - constructor(Fp: IField, rate: number, capacity: number, hash: PoseidonFn) { - this.Fp = Fp; - this.hash = hash; - this.rate = rate; - this.capacity = capacity; - this.state = new Array(rate + capacity); - this.clean(); - } - private process(): void { - this.state = this.hash(this.state); - } - absorb(input: bigint[]): void { - for (const i of input) - if (typeof i !== 'bigint' || !this.Fp.isValid(i)) throw new Error('invalid input: ' + i); - for (let i = 0; i < input.length; ) { - if (!this.isAbsorbing || this.pos === this.rate) { - this.process(); - this.pos = 0; - this.isAbsorbing = true; - } - const chunk = Math.min(this.rate - this.pos, input.length - i); - for (let j = 0; j < chunk; j++) { - const idx = this.capacity + this.pos++; - this.state[idx] = this.Fp.add(this.state[idx], input[i++]); - } - } - } - squeeze(count: number): bigint[] { - const res: bigint[] = []; - while (res.length < count) { - if (this.isAbsorbing || this.pos === this.rate) { - this.process(); - this.pos = 0; - this.isAbsorbing = false; - } - const chunk = Math.min(this.rate - this.pos, count - res.length); - for (let i = 0; i < chunk; i++) res.push(this.state[this.capacity + this.pos++]); - } - return res; - } - clean(): void { - this.state.fill(this.Fp.ZERO); - this.isAbsorbing = true; - this.pos = 0; - } - clone(): PoseidonSponge { - const c = new PoseidonSponge(this.Fp, this.rate, this.capacity, this.hash); - c.pos = this.pos; - c.state = [...this.state]; - return c; - } -} - -export type PoseidonSpongeOpts = Omit & { - rate: number; - capacity: number; -}; - -/** - * The method is not defined in spec, but nevertheless used often. - * Check carefully for compatibility: there are many edge cases, like absorbing an empty array. - * We cross-test against: - * - https://github.com/ProvableHQ/snarkVM/tree/staging/algorithms - * - https://github.com/arkworks-rs/crypto-primitives/tree/main - */ -export function poseidonSponge(opts: PoseidonSpongeOpts): () => PoseidonSponge { - for (const i of ['rate', 'capacity'] as const) { - if (typeof opts[i] !== 'number' || !Number.isSafeInteger(opts[i])) - throw new Error('invalid number ' + i); - } - const { rate, capacity } = opts; - const t = opts.rate + opts.capacity; - // Re-use hash instance between multiple instances - const hash = poseidon({ ...opts, t }); - const { Fp } = opts; - return () => new PoseidonSponge(Fp, rate, capacity, hash); -} diff --git a/tools/mnemonic-test/node_modules/@noble/curves/src/abstract/tower.ts b/tools/mnemonic-test/node_modules/@noble/curves/src/abstract/tower.ts deleted file mode 100644 index 9c397425..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/src/abstract/tower.ts +++ /dev/null @@ -1,867 +0,0 @@ -/** - * Towered extension fields. - * Rather than implementing a massive 12th-degree extension directly, it is more efficient - * to build it up from smaller extensions: a tower of extensions. - * - * For BLS12-381, the Fp12 field is implemented as a quadratic (degree two) extension, - * on top of a cubic (degree three) extension, on top of a quadratic extension of Fp. - * - * For more info: "Pairings for beginners" by Costello, section 7.3. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { bitGet, bitLen, concatBytes, notImplemented } from '../utils.ts'; -import * as mod from './modular.ts'; -import type { WeierstrassPoint, WeierstrassPointCons } from './weierstrass.ts'; - -// Be friendly to bad ECMAScript parsers by not using bigint literals -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3); - -// Fp₂ over complex plane -export type BigintTuple = [bigint, bigint]; -export type Fp = bigint; -// Finite extension field over irreducible polynominal. -// Fp(u) / (u² - β) where β = -1 -export type Fp2 = { c0: bigint; c1: bigint }; -export type BigintSix = [bigint, bigint, bigint, bigint, bigint, bigint]; -export type Fp6 = { c0: Fp2; c1: Fp2; c2: Fp2 }; -export type Fp12 = { c0: Fp6; c1: Fp6 }; // Fp₁₂ = Fp₆² => Fp₂³, Fp₆(w) / (w² - γ) where γ = v -// prettier-ignore -export type BigintTwelve = [ - bigint, bigint, bigint, bigint, bigint, bigint, - bigint, bigint, bigint, bigint, bigint, bigint -]; - -export type Fp2Bls = mod.IField & { - Fp: mod.IField; - frobeniusMap(num: Fp2, power: number): Fp2; - fromBigTuple(num: BigintTuple): Fp2; - mulByB: (num: Fp2) => Fp2; - mulByNonresidue: (num: Fp2) => Fp2; - reim: (num: Fp2) => { re: Fp; im: Fp }; - Fp4Square: (a: Fp2, b: Fp2) => { first: Fp2; second: Fp2 }; - NONRESIDUE: Fp2; -}; - -export type Fp6Bls = mod.IField & { - Fp2: Fp2Bls; - frobeniusMap(num: Fp6, power: number): Fp6; - fromBigSix: (tuple: BigintSix) => Fp6; - mul1(num: Fp6, b1: Fp2): Fp6; - mul01(num: Fp6, b0: Fp2, b1: Fp2): Fp6; - mulByFp2(lhs: Fp6, rhs: Fp2): Fp6; - mulByNonresidue: (num: Fp6) => Fp6; -}; - -export type Fp12Bls = mod.IField & { - Fp6: Fp6Bls; - frobeniusMap(num: Fp12, power: number): Fp12; - fromBigTwelve: (t: BigintTwelve) => Fp12; - mul014(num: Fp12, o0: Fp2, o1: Fp2, o4: Fp2): Fp12; - mul034(num: Fp12, o0: Fp2, o3: Fp2, o4: Fp2): Fp12; - mulByFp2(lhs: Fp12, rhs: Fp2): Fp12; - conjugate(num: Fp12): Fp12; - finalExponentiate(num: Fp12): Fp12; - _cyclotomicSquare(num: Fp12): Fp12; - _cyclotomicExp(num: Fp12, n: bigint): Fp12; -}; - -function calcFrobeniusCoefficients( - Fp: mod.IField, - nonResidue: T, - modulus: bigint, - degree: number, - num: number = 1, - divisor?: number -) { - const _divisor = BigInt(divisor === undefined ? degree : divisor); - const towerModulus: any = modulus ** BigInt(degree); - const res: T[][] = []; - for (let i = 0; i < num; i++) { - const a = BigInt(i + 1); - const powers: T[] = []; - for (let j = 0, qPower = _1n; j < degree; j++) { - const power = ((a * qPower - a) / _divisor) % towerModulus; - powers.push(Fp.pow(nonResidue, power)); - qPower *= modulus; - } - res.push(powers); - } - return res; -} - -// This works same at least for bls12-381, bn254 and bls12-377 -export function psiFrobenius( - Fp: mod.IField, - Fp2: Fp2Bls, - base: Fp2 -): { - psi: (x: Fp2, y: Fp2) => [Fp2, Fp2]; - psi2: (x: Fp2, y: Fp2) => [Fp2, Fp2]; - G2psi: (c: WeierstrassPointCons, P: WeierstrassPoint) => WeierstrassPoint; - G2psi2: (c: WeierstrassPointCons, P: WeierstrassPoint) => WeierstrassPoint; - PSI_X: Fp2; - PSI_Y: Fp2; - PSI2_X: Fp2; - PSI2_Y: Fp2; -} { - // GLV endomorphism Ψ(P) - const PSI_X = Fp2.pow(base, (Fp.ORDER - _1n) / _3n); // u^((p-1)/3) - const PSI_Y = Fp2.pow(base, (Fp.ORDER - _1n) / _2n); // u^((p-1)/2) - function psi(x: Fp2, y: Fp2): [Fp2, Fp2] { - // This x10 faster than previous version in bls12-381 - const x2 = Fp2.mul(Fp2.frobeniusMap(x, 1), PSI_X); - const y2 = Fp2.mul(Fp2.frobeniusMap(y, 1), PSI_Y); - return [x2, y2]; - } - // Ψ²(P) endomorphism (psi2(x) = psi(psi(x))) - const PSI2_X = Fp2.pow(base, (Fp.ORDER ** _2n - _1n) / _3n); // u^((p^2 - 1)/3) - // This equals -1, which causes y to be Fp2.neg(y). - // But not sure if there are case when this is not true? - const PSI2_Y = Fp2.pow(base, (Fp.ORDER ** _2n - _1n) / _2n); // u^((p^2 - 1)/3) - if (!Fp2.eql(PSI2_Y, Fp2.neg(Fp2.ONE))) throw new Error('psiFrobenius: PSI2_Y!==-1'); - function psi2(x: Fp2, y: Fp2): [Fp2, Fp2] { - return [Fp2.mul(x, PSI2_X), Fp2.neg(y)]; - } - // Map points - const mapAffine = - (fn: (x: T, y: T) => [T, T]) => - (c: WeierstrassPointCons, P: WeierstrassPoint) => { - const affine = P.toAffine(); - const p = fn(affine.x, affine.y); - return c.fromAffine({ x: p[0], y: p[1] }); - }; - const G2psi = mapAffine(psi); - const G2psi2 = mapAffine(psi2); - return { psi, psi2, G2psi, G2psi2, PSI_X, PSI_Y, PSI2_X, PSI2_Y }; -} - -export type Tower12Opts = { - ORDER: bigint; - X_LEN: number; - NONRESIDUE?: Fp; - FP2_NONRESIDUE: BigintTuple; - Fp2sqrt?: (num: Fp2) => Fp2; - Fp2mulByB: (num: Fp2) => Fp2; - Fp12finalExponentiate: (num: Fp12) => Fp12; -}; - -const Fp2fromBigTuple = (Fp: mod.IField, tuple: BigintTuple | bigint[]) => { - if (tuple.length !== 2) throw new Error('invalid tuple'); - const fps = tuple.map((n) => Fp.create(n)) as BigintTuple; - return { c0: fps[0], c1: fps[1] }; -}; - -class _Field2 implements mod.IField { - readonly ORDER: bigint; - readonly BITS: number; - readonly BYTES: number; - readonly isLE: boolean; - readonly MASK = _1n; - - readonly ZERO: Fp2; - readonly ONE: Fp2; - readonly Fp: mod.IField; - - readonly NONRESIDUE: Fp2; - readonly mulByB: Tower12Opts['Fp2mulByB']; - readonly Fp_NONRESIDUE: bigint; - readonly Fp_div2: bigint; - readonly FROBENIUS_COEFFICIENTS: Fp[]; - - constructor( - Fp: mod.IField, - opts: Partial<{ - NONRESIDUE: bigint; - FP2_NONRESIDUE: BigintTuple; - Fp2mulByB: Tower12Opts['Fp2mulByB']; - }> = {} - ) { - const ORDER = Fp.ORDER; - const FP2_ORDER = ORDER * ORDER; - this.Fp = Fp; - this.ORDER = FP2_ORDER; - this.BITS = bitLen(FP2_ORDER); - this.BYTES = Math.ceil(bitLen(FP2_ORDER) / 8); - this.isLE = Fp.isLE; - this.ZERO = { c0: Fp.ZERO, c1: Fp.ZERO }; - this.ONE = { c0: Fp.ONE, c1: Fp.ZERO }; - - this.Fp_NONRESIDUE = Fp.create(opts.NONRESIDUE || BigInt(-1)); - this.Fp_div2 = Fp.div(Fp.ONE, _2n); // 1/2 - this.NONRESIDUE = Fp2fromBigTuple(Fp, opts.FP2_NONRESIDUE!); - // const Fp2Nonresidue = Fp2fromBigTuple(opts.FP2_NONRESIDUE); - this.FROBENIUS_COEFFICIENTS = calcFrobeniusCoefficients(Fp, this.Fp_NONRESIDUE, Fp.ORDER, 2)[0]; - this.mulByB = opts.Fp2mulByB!; - Object.seal(this); - } - fromBigTuple(tuple: BigintTuple) { - return Fp2fromBigTuple(this.Fp, tuple); - } - create(num: Fp2) { - return num; - } - isValid({ c0, c1 }: Fp2) { - function isValidC(num: bigint, ORDER: bigint) { - return typeof num === 'bigint' && _0n <= num && num < ORDER; - } - return isValidC(c0, this.ORDER) && isValidC(c1, this.ORDER); - } - is0({ c0, c1 }: Fp2) { - return this.Fp.is0(c0) && this.Fp.is0(c1); - } - isValidNot0(num: Fp2) { - return !this.is0(num) && this.isValid(num); - } - eql({ c0, c1 }: Fp2, { c0: r0, c1: r1 }: Fp2) { - return this.Fp.eql(c0, r0) && this.Fp.eql(c1, r1); - } - neg({ c0, c1 }: Fp2) { - return { c0: this.Fp.neg(c0), c1: this.Fp.neg(c1) }; - } - pow(num: Fp2, power: bigint): Fp2 { - return mod.FpPow(this, num, power); - } - invertBatch(nums: Fp2[]): Fp2[] { - return mod.FpInvertBatch(this, nums); - } - // Normalized - add(f1: Fp2, f2: Fp2): Fp2 { - const { c0, c1 } = f1; - const { c0: r0, c1: r1 } = f2; - return { - c0: this.Fp.add(c0, r0), - c1: this.Fp.add(c1, r1), - }; - } - sub({ c0, c1 }: Fp2, { c0: r0, c1: r1 }: Fp2) { - return { - c0: this.Fp.sub(c0, r0), - c1: this.Fp.sub(c1, r1), - }; - } - mul({ c0, c1 }: Fp2, rhs: Fp2) { - const { Fp } = this; - if (typeof rhs === 'bigint') return { c0: Fp.mul(c0, rhs), c1: Fp.mul(c1, rhs) }; - // (a+bi)(c+di) = (ac−bd) + (ad+bc)i - const { c0: r0, c1: r1 } = rhs; - let t1 = Fp.mul(c0, r0); // c0 * o0 - let t2 = Fp.mul(c1, r1); // c1 * o1 - // (T1 - T2) + ((c0 + c1) * (r0 + r1) - (T1 + T2))*i - const o0 = Fp.sub(t1, t2); - const o1 = Fp.sub(Fp.mul(Fp.add(c0, c1), Fp.add(r0, r1)), Fp.add(t1, t2)); - return { c0: o0, c1: o1 }; - } - sqr({ c0, c1 }: Fp2) { - const { Fp } = this; - const a = Fp.add(c0, c1); - const b = Fp.sub(c0, c1); - const c = Fp.add(c0, c0); - return { c0: Fp.mul(a, b), c1: Fp.mul(c, c1) }; - } - // NonNormalized stuff - addN(a: Fp2, b: Fp2): Fp2 { - return this.add(a, b); - } - subN(a: Fp2, b: Fp2): Fp2 { - return this.sub(a, b); - } - mulN(a: Fp2, b: Fp2): Fp2 { - return this.mul(a, b); - } - sqrN(a: Fp2): Fp2 { - return this.sqr(a); - } - // Why inversion for bigint inside Fp instead of Fp2? it is even used in that context? - div(lhs: Fp2, rhs: Fp2): Fp2 { - const { Fp } = this; - // @ts-ignore - return this.mul(lhs, typeof rhs === 'bigint' ? Fp.inv(Fp.create(rhs)) : this.inv(rhs)); - } - inv({ c0: a, c1: b }: Fp2): Fp2 { - // We wish to find the multiplicative inverse of a nonzero - // element a + bu in Fp2. We leverage an identity - // - // (a + bu)(a - bu) = a² + b² - // - // which holds because u² = -1. This can be rewritten as - // - // (a + bu)(a - bu)/(a² + b²) = 1 - // - // because a² + b² = 0 has no nonzero solutions for (a, b). - // This gives that (a - bu)/(a² + b²) is the inverse - // of (a + bu). Importantly, this can be computing using - // only a single inversion in Fp. - const { Fp } = this; - const factor = Fp.inv(Fp.create(a * a + b * b)); - return { c0: Fp.mul(factor, Fp.create(a)), c1: Fp.mul(factor, Fp.create(-b)) }; - } - sqrt(num: Fp2) { - // This is generic for all quadratic extensions (Fp2) - const { Fp } = this; - const Fp2 = this; - const { c0, c1 } = num; - if (Fp.is0(c1)) { - // if c0 is quadratic residue - if (mod.FpLegendre(Fp, c0) === 1) return Fp2.create({ c0: Fp.sqrt(c0), c1: Fp.ZERO }); - else return Fp2.create({ c0: Fp.ZERO, c1: Fp.sqrt(Fp.div(c0, this.Fp_NONRESIDUE)) }); - } - const a = Fp.sqrt(Fp.sub(Fp.sqr(c0), Fp.mul(Fp.sqr(c1), this.Fp_NONRESIDUE))); - let d = Fp.mul(Fp.add(a, c0), this.Fp_div2); - const legendre = mod.FpLegendre(Fp, d); - // -1, Quadratic non residue - if (legendre === -1) d = Fp.sub(d, a); - const a0 = Fp.sqrt(d); - const candidateSqrt = Fp2.create({ c0: a0, c1: Fp.div(Fp.mul(c1, this.Fp_div2), a0) }); - if (!Fp2.eql(Fp2.sqr(candidateSqrt), num)) throw new Error('Cannot find square root'); - // Normalize root: at this point candidateSqrt ** 2 = num, but also -candidateSqrt ** 2 = num - const x1 = candidateSqrt; - const x2 = Fp2.neg(x1); - const { re: re1, im: im1 } = Fp2.reim(x1); - const { re: re2, im: im2 } = Fp2.reim(x2); - if (im1 > im2 || (im1 === im2 && re1 > re2)) return x1; - return x2; - } - // Same as sgn0_m_eq_2 in RFC 9380 - isOdd(x: Fp2) { - const { re: x0, im: x1 } = this.reim(x); - const sign_0 = x0 % _2n; - const zero_0 = x0 === _0n; - const sign_1 = x1 % _2n; - return BigInt(sign_0 || (zero_0 && sign_1)) == _1n; - } - // Bytes util - fromBytes(b: Uint8Array): Fp2 { - const { Fp } = this; - if (b.length !== this.BYTES) throw new Error('fromBytes invalid length=' + b.length); - return { c0: Fp.fromBytes(b.subarray(0, Fp.BYTES)), c1: Fp.fromBytes(b.subarray(Fp.BYTES)) }; - } - toBytes({ c0, c1 }: Fp2) { - return concatBytes(this.Fp.toBytes(c0), this.Fp.toBytes(c1)); - } - cmov({ c0, c1 }: Fp2, { c0: r0, c1: r1 }: Fp2, c: boolean) { - return { - c0: this.Fp.cmov(c0, r0, c), - c1: this.Fp.cmov(c1, r1, c), - }; - } - reim({ c0, c1 }: Fp2) { - return { re: c0, im: c1 }; - } - Fp4Square(a: Fp2, b: Fp2): { first: Fp2; second: Fp2 } { - const Fp2 = this; - const a2 = Fp2.sqr(a); - const b2 = Fp2.sqr(b); - return { - first: Fp2.add(Fp2.mulByNonresidue(b2), a2), // b² * Nonresidue + a² - second: Fp2.sub(Fp2.sub(Fp2.sqr(Fp2.add(a, b)), a2), b2), // (a + b)² - a² - b² - }; - } - // multiply by u + 1 - mulByNonresidue({ c0, c1 }: Fp2) { - return this.mul({ c0, c1 }, this.NONRESIDUE); - } - frobeniusMap({ c0, c1 }: Fp2, power: number): Fp2 { - return { - c0, - c1: this.Fp.mul(c1, this.FROBENIUS_COEFFICIENTS[power % 2]), - }; - } -} - -class _Field6 implements Fp6Bls { - readonly ORDER: bigint; - readonly BITS: number; - readonly BYTES: number; - readonly isLE: boolean; - readonly MASK = _1n; - - readonly ZERO: Fp6; - readonly ONE: Fp6; - readonly Fp2: Fp2Bls; - readonly FROBENIUS_COEFFICIENTS_1: Fp2[]; - readonly FROBENIUS_COEFFICIENTS_2: Fp2[]; - - constructor(Fp2: Fp2Bls) { - this.Fp2 = Fp2; - this.ORDER = Fp2.ORDER; // TODO: unused, but need to verify - this.BITS = 3 * Fp2.BITS; - this.BYTES = 3 * Fp2.BYTES; - this.isLE = Fp2.isLE; - this.ZERO = { c0: Fp2.ZERO, c1: Fp2.ZERO, c2: Fp2.ZERO }; - this.ONE = { c0: Fp2.ONE, c1: Fp2.ZERO, c2: Fp2.ZERO }; - const { Fp } = Fp2; - const frob = calcFrobeniusCoefficients(Fp2, Fp2.NONRESIDUE, Fp.ORDER, 6, 2, 3); - this.FROBENIUS_COEFFICIENTS_1 = frob[0]; - this.FROBENIUS_COEFFICIENTS_2 = frob[1]; - Object.seal(this); - } - add({ c0, c1, c2 }: Fp6, { c0: r0, c1: r1, c2: r2 }: Fp6) { - const { Fp2 } = this; - return { - c0: Fp2.add(c0, r0), - c1: Fp2.add(c1, r1), - c2: Fp2.add(c2, r2), - }; - } - sub({ c0, c1, c2 }: Fp6, { c0: r0, c1: r1, c2: r2 }: Fp6) { - const { Fp2 } = this; - return { - c0: Fp2.sub(c0, r0), - c1: Fp2.sub(c1, r1), - c2: Fp2.sub(c2, r2), - }; - } - mul({ c0, c1, c2 }: Fp6, rhs: Fp6 | bigint) { - const { Fp2 } = this; - if (typeof rhs === 'bigint') { - return { - c0: Fp2.mul(c0, rhs), - c1: Fp2.mul(c1, rhs), - c2: Fp2.mul(c2, rhs), - }; - } - const { c0: r0, c1: r1, c2: r2 } = rhs; - const t0 = Fp2.mul(c0, r0); // c0 * o0 - const t1 = Fp2.mul(c1, r1); // c1 * o1 - const t2 = Fp2.mul(c2, r2); // c2 * o2 - return { - // t0 + (c1 + c2) * (r1 * r2) - (T1 + T2) * (u + 1) - c0: Fp2.add( - t0, - Fp2.mulByNonresidue(Fp2.sub(Fp2.mul(Fp2.add(c1, c2), Fp2.add(r1, r2)), Fp2.add(t1, t2))) - ), - // (c0 + c1) * (r0 + r1) - (T0 + T1) + T2 * (u + 1) - c1: Fp2.add( - Fp2.sub(Fp2.mul(Fp2.add(c0, c1), Fp2.add(r0, r1)), Fp2.add(t0, t1)), - Fp2.mulByNonresidue(t2) - ), - // T1 + (c0 + c2) * (r0 + r2) - T0 + T2 - c2: Fp2.sub(Fp2.add(t1, Fp2.mul(Fp2.add(c0, c2), Fp2.add(r0, r2))), Fp2.add(t0, t2)), - }; - } - sqr({ c0, c1, c2 }: Fp6) { - const { Fp2 } = this; - let t0 = Fp2.sqr(c0); // c0² - let t1 = Fp2.mul(Fp2.mul(c0, c1), _2n); // 2 * c0 * c1 - let t3 = Fp2.mul(Fp2.mul(c1, c2), _2n); // 2 * c1 * c2 - let t4 = Fp2.sqr(c2); // c2² - return { - c0: Fp2.add(Fp2.mulByNonresidue(t3), t0), // T3 * (u + 1) + T0 - c1: Fp2.add(Fp2.mulByNonresidue(t4), t1), // T4 * (u + 1) + T1 - // T1 + (c0 - c1 + c2)² + T3 - T0 - T4 - c2: Fp2.sub(Fp2.sub(Fp2.add(Fp2.add(t1, Fp2.sqr(Fp2.add(Fp2.sub(c0, c1), c2))), t3), t0), t4), - }; - } - addN(a: Fp6, b: Fp6): Fp6 { - return this.add(a, b); - } - subN(a: Fp6, b: Fp6): Fp6 { - return this.sub(a, b); - } - mulN(a: Fp6, b: Fp6): Fp6 { - return this.mul(a, b); - } - sqrN(a: Fp6): Fp6 { - return this.sqr(a); - } - - create(num: Fp6) { - return num; - } - - isValid({ c0, c1, c2 }: Fp6) { - const { Fp2 } = this; - return Fp2.isValid(c0) && Fp2.isValid(c1) && Fp2.isValid(c2); - } - is0({ c0, c1, c2 }: Fp6) { - const { Fp2 } = this; - return Fp2.is0(c0) && Fp2.is0(c1) && Fp2.is0(c2); - } - isValidNot0(num: Fp6) { - return !this.is0(num) && this.isValid(num); - } - neg({ c0, c1, c2 }: Fp6) { - const { Fp2 } = this; - return { c0: Fp2.neg(c0), c1: Fp2.neg(c1), c2: Fp2.neg(c2) }; - } - eql({ c0, c1, c2 }: Fp6, { c0: r0, c1: r1, c2: r2 }: Fp6) { - const { Fp2 } = this; - return Fp2.eql(c0, r0) && Fp2.eql(c1, r1) && Fp2.eql(c2, r2); - } - sqrt(_: Fp6) { - return notImplemented(); - } - // Do we need division by bigint at all? Should be done via order: - div(lhs: Fp6, rhs: Fp6) { - const { Fp2 } = this; - const { Fp } = Fp2; - return this.mul(lhs, typeof rhs === 'bigint' ? Fp.inv(Fp.create(rhs)) : this.inv(rhs)); - } - pow(num: Fp6, power: Fp): Fp6 { - return mod.FpPow(this, num, power); - } - invertBatch(nums: Fp6[]): Fp6[] { - return mod.FpInvertBatch(this, nums); - } - - inv({ c0, c1, c2 }: Fp6) { - const { Fp2 } = this; - let t0 = Fp2.sub(Fp2.sqr(c0), Fp2.mulByNonresidue(Fp2.mul(c2, c1))); // c0² - c2 * c1 * (u + 1) - let t1 = Fp2.sub(Fp2.mulByNonresidue(Fp2.sqr(c2)), Fp2.mul(c0, c1)); // c2² * (u + 1) - c0 * c1 - let t2 = Fp2.sub(Fp2.sqr(c1), Fp2.mul(c0, c2)); // c1² - c0 * c2 - // 1/(((c2 * T1 + c1 * T2) * v) + c0 * T0) - let t4 = Fp2.inv( - Fp2.add(Fp2.mulByNonresidue(Fp2.add(Fp2.mul(c2, t1), Fp2.mul(c1, t2))), Fp2.mul(c0, t0)) - ); - return { c0: Fp2.mul(t4, t0), c1: Fp2.mul(t4, t1), c2: Fp2.mul(t4, t2) }; - } - // Bytes utils - fromBytes(b: Uint8Array): Fp6 { - const { Fp2 } = this; - if (b.length !== this.BYTES) throw new Error('fromBytes invalid length=' + b.length); - const B2 = Fp2.BYTES; - return { - c0: Fp2.fromBytes(b.subarray(0, B2)), - c1: Fp2.fromBytes(b.subarray(B2, B2 * 2)), - c2: Fp2.fromBytes(b.subarray(2 * B2)), - }; - } - toBytes({ c0, c1, c2 }: Fp6): Uint8Array { - const { Fp2 } = this; - return concatBytes(Fp2.toBytes(c0), Fp2.toBytes(c1), Fp2.toBytes(c2)); - } - cmov({ c0, c1, c2 }: Fp6, { c0: r0, c1: r1, c2: r2 }: Fp6, c: boolean) { - const { Fp2 } = this; - return { - c0: Fp2.cmov(c0, r0, c), - c1: Fp2.cmov(c1, r1, c), - c2: Fp2.cmov(c2, r2, c), - }; - } - fromBigSix(t: BigintSix): Fp6 { - const { Fp2 } = this; - if (!Array.isArray(t) || t.length !== 6) throw new Error('invalid Fp6 usage'); - return { - c0: Fp2.fromBigTuple(t.slice(0, 2) as BigintTuple), - c1: Fp2.fromBigTuple(t.slice(2, 4) as BigintTuple), - c2: Fp2.fromBigTuple(t.slice(4, 6) as BigintTuple), - }; - } - frobeniusMap({ c0, c1, c2 }: Fp6, power: number) { - const { Fp2 } = this; - return { - c0: Fp2.frobeniusMap(c0, power), - c1: Fp2.mul(Fp2.frobeniusMap(c1, power), this.FROBENIUS_COEFFICIENTS_1[power % 6]), - c2: Fp2.mul(Fp2.frobeniusMap(c2, power), this.FROBENIUS_COEFFICIENTS_2[power % 6]), - }; - } - mulByFp2({ c0, c1, c2 }: Fp6, rhs: Fp2): Fp6 { - const { Fp2 } = this; - return { - c0: Fp2.mul(c0, rhs), - c1: Fp2.mul(c1, rhs), - c2: Fp2.mul(c2, rhs), - }; - } - mulByNonresidue({ c0, c1, c2 }: Fp6) { - const { Fp2 } = this; - return { c0: Fp2.mulByNonresidue(c2), c1: c0, c2: c1 }; - } - // Sparse multiplication - mul1({ c0, c1, c2 }: Fp6, b1: Fp2): Fp6 { - const { Fp2 } = this; - return { - c0: Fp2.mulByNonresidue(Fp2.mul(c2, b1)), - c1: Fp2.mul(c0, b1), - c2: Fp2.mul(c1, b1), - }; - } - // Sparse multiplication - mul01({ c0, c1, c2 }: Fp6, b0: Fp2, b1: Fp2): Fp6 { - const { Fp2 } = this; - let t0 = Fp2.mul(c0, b0); // c0 * b0 - let t1 = Fp2.mul(c1, b1); // c1 * b1 - return { - // ((c1 + c2) * b1 - T1) * (u + 1) + T0 - c0: Fp2.add(Fp2.mulByNonresidue(Fp2.sub(Fp2.mul(Fp2.add(c1, c2), b1), t1)), t0), - // (b0 + b1) * (c0 + c1) - T0 - T1 - c1: Fp2.sub(Fp2.sub(Fp2.mul(Fp2.add(b0, b1), Fp2.add(c0, c1)), t0), t1), - // (c0 + c2) * b0 - T0 + T1 - c2: Fp2.add(Fp2.sub(Fp2.mul(Fp2.add(c0, c2), b0), t0), t1), - }; - } -} - -class _Field12 implements Fp12Bls { - readonly ORDER: bigint; - readonly BITS: number; - readonly BYTES: number; - readonly isLE: boolean; - readonly MASK = _1n; - - readonly ZERO: Fp12; - readonly ONE: Fp12; - - readonly Fp6: Fp6Bls; - readonly FROBENIUS_COEFFICIENTS: Fp2[]; - readonly X_LEN: number; - readonly finalExponentiate: Tower12Opts['Fp12finalExponentiate']; - - constructor(Fp6: Fp6Bls, opts: Tower12Opts) { - const { Fp2 } = Fp6; - const { Fp } = Fp2; - this.Fp6 = Fp6; - - this.ORDER = Fp2.ORDER; // TODO: verify if it's unuesd - this.BITS = 2 * Fp6.BITS; - this.BYTES = 2 * Fp6.BYTES; - this.isLE = Fp6.isLE; - this.ZERO = { c0: Fp6.ZERO, c1: Fp6.ZERO }; - this.ONE = { c0: Fp6.ONE, c1: Fp6.ZERO }; - - this.FROBENIUS_COEFFICIENTS = calcFrobeniusCoefficients( - Fp2, - Fp2.NONRESIDUE, - Fp.ORDER, - 12, - 1, - 6 - )[0]; - this.X_LEN = opts.X_LEN; - this.finalExponentiate = opts.Fp12finalExponentiate; - } - create(num: Fp12) { - return num; - } - isValid({ c0, c1 }: Fp12) { - const { Fp6 } = this; - return Fp6.isValid(c0) && Fp6.isValid(c1); - } - is0({ c0, c1 }: Fp12) { - const { Fp6 } = this; - return Fp6.is0(c0) && Fp6.is0(c1); - } - isValidNot0(num: Fp12) { - return !this.is0(num) && this.isValid(num); - } - neg({ c0, c1 }: Fp12) { - const { Fp6 } = this; - return { c0: Fp6.neg(c0), c1: Fp6.neg(c1) }; - } - eql({ c0, c1 }: Fp12, { c0: r0, c1: r1 }: Fp12) { - const { Fp6 } = this; - return Fp6.eql(c0, r0) && Fp6.eql(c1, r1); - } - sqrt(_: any): any { - notImplemented(); - } - inv({ c0, c1 }: Fp12) { - const { Fp6 } = this; - let t = Fp6.inv(Fp6.sub(Fp6.sqr(c0), Fp6.mulByNonresidue(Fp6.sqr(c1)))); // 1 / (c0² - c1² * v) - return { c0: Fp6.mul(c0, t), c1: Fp6.neg(Fp6.mul(c1, t)) }; // ((C0 * T) * T) + (-C1 * T) * w - } - div(lhs: Fp12, rhs: Fp12) { - const { Fp6 } = this; - const { Fp2 } = Fp6; - const { Fp } = Fp2; - return this.mul(lhs, typeof rhs === 'bigint' ? Fp.inv(Fp.create(rhs)) : this.inv(rhs)); - } - pow(num: Fp12, power: bigint): Fp12 { - return mod.FpPow(this, num, power); - } - invertBatch(nums: Fp12[]): Fp12[] { - return mod.FpInvertBatch(this, nums); - } - - // Normalized - add({ c0, c1 }: Fp12, { c0: r0, c1: r1 }: Fp12) { - const { Fp6 } = this; - return { - c0: Fp6.add(c0, r0), - c1: Fp6.add(c1, r1), - }; - } - sub({ c0, c1 }: Fp12, { c0: r0, c1: r1 }: Fp12) { - const { Fp6 } = this; - return { - c0: Fp6.sub(c0, r0), - c1: Fp6.sub(c1, r1), - }; - } - mul({ c0, c1 }: Fp12, rhs: Fp12 | bigint) { - const { Fp6 } = this; - if (typeof rhs === 'bigint') return { c0: Fp6.mul(c0, rhs), c1: Fp6.mul(c1, rhs) }; - let { c0: r0, c1: r1 } = rhs; - let t1 = Fp6.mul(c0, r0); // c0 * r0 - let t2 = Fp6.mul(c1, r1); // c1 * r1 - return { - c0: Fp6.add(t1, Fp6.mulByNonresidue(t2)), // T1 + T2 * v - // (c0 + c1) * (r0 + r1) - (T1 + T2) - c1: Fp6.sub(Fp6.mul(Fp6.add(c0, c1), Fp6.add(r0, r1)), Fp6.add(t1, t2)), - }; - } - sqr({ c0, c1 }: Fp12) { - const { Fp6 } = this; - let ab = Fp6.mul(c0, c1); // c0 * c1 - return { - // (c1 * v + c0) * (c0 + c1) - AB - AB * v - c0: Fp6.sub( - Fp6.sub(Fp6.mul(Fp6.add(Fp6.mulByNonresidue(c1), c0), Fp6.add(c0, c1)), ab), - Fp6.mulByNonresidue(ab) - ), - c1: Fp6.add(ab, ab), - }; // AB + AB - } - // NonNormalized stuff - addN(a: Fp12, b: Fp12): Fp12 { - return this.add(a, b); - } - subN(a: Fp12, b: Fp12): Fp12 { - return this.sub(a, b); - } - mulN(a: Fp12, b: Fp12): Fp12 { - return this.mul(a, b); - } - sqrN(a: Fp12): Fp12 { - return this.sqr(a); - } - - // Bytes utils - fromBytes(b: Uint8Array): Fp12 { - const { Fp6 } = this; - if (b.length !== this.BYTES) throw new Error('fromBytes invalid length=' + b.length); - return { - c0: Fp6.fromBytes(b.subarray(0, Fp6.BYTES)), - c1: Fp6.fromBytes(b.subarray(Fp6.BYTES)), - }; - } - toBytes({ c0, c1 }: Fp12): Uint8Array { - const { Fp6 } = this; - return concatBytes(Fp6.toBytes(c0), Fp6.toBytes(c1)); - } - cmov({ c0, c1 }: Fp12, { c0: r0, c1: r1 }: Fp12, c: boolean) { - const { Fp6 } = this; - return { - c0: Fp6.cmov(c0, r0, c), - c1: Fp6.cmov(c1, r1, c), - }; - } - // Utils - // toString() { - // return '' + 'Fp12(' + this.c0 + this.c1 + '* w'); - // }, - // fromTuple(c: [Fp6, Fp6]) { - // return new Fp12(...c); - // } - fromBigTwelve(t: BigintTwelve): Fp12 { - const { Fp6 } = this; - return { - c0: Fp6.fromBigSix(t.slice(0, 6) as BigintSix), - c1: Fp6.fromBigSix(t.slice(6, 12) as BigintSix), - }; - } - // Raises to q**i -th power - frobeniusMap(lhs: Fp12, power: number) { - const { Fp6 } = this; - const { Fp2 } = Fp6; - const { c0, c1, c2 } = Fp6.frobeniusMap(lhs.c1, power); - const coeff = this.FROBENIUS_COEFFICIENTS[power % 12]; - return { - c0: Fp6.frobeniusMap(lhs.c0, power), - c1: Fp6.create({ - c0: Fp2.mul(c0, coeff), - c1: Fp2.mul(c1, coeff), - c2: Fp2.mul(c2, coeff), - }), - }; - } - mulByFp2({ c0, c1 }: Fp12, rhs: Fp2): Fp12 { - const { Fp6 } = this; - return { - c0: Fp6.mulByFp2(c0, rhs), - c1: Fp6.mulByFp2(c1, rhs), - }; - } - conjugate({ c0, c1 }: Fp12): Fp12 { - return { c0, c1: this.Fp6.neg(c1) }; - } - // Sparse multiplication - mul014({ c0, c1 }: Fp12, o0: Fp2, o1: Fp2, o4: Fp2) { - const { Fp6 } = this; - const { Fp2 } = Fp6; - let t0 = Fp6.mul01(c0, o0, o1); - let t1 = Fp6.mul1(c1, o4); - return { - c0: Fp6.add(Fp6.mulByNonresidue(t1), t0), // T1 * v + T0 - // (c1 + c0) * [o0, o1+o4] - T0 - T1 - c1: Fp6.sub(Fp6.sub(Fp6.mul01(Fp6.add(c1, c0), o0, Fp2.add(o1, o4)), t0), t1), - }; - } - mul034({ c0, c1 }: Fp12, o0: Fp2, o3: Fp2, o4: Fp2) { - const { Fp6 } = this; - const { Fp2 } = Fp6; - const a = Fp6.create({ - c0: Fp2.mul(c0.c0, o0), - c1: Fp2.mul(c0.c1, o0), - c2: Fp2.mul(c0.c2, o0), - }); - const b = Fp6.mul01(c1, o3, o4); - const e = Fp6.mul01(Fp6.add(c0, c1), Fp2.add(o0, o3), o4); - return { - c0: Fp6.add(Fp6.mulByNonresidue(b), a), - c1: Fp6.sub(e, Fp6.add(a, b)), - }; - } - - // A cyclotomic group is a subgroup of Fp^n defined by - // GΦₙ(p) = {α ∈ Fpⁿ : α^Φₙ(p) = 1} - // The result of any pairing is in a cyclotomic subgroup - // https://eprint.iacr.org/2009/565.pdf - // https://eprint.iacr.org/2010/354.pdf - _cyclotomicSquare({ c0, c1 }: Fp12): Fp12 { - const { Fp6 } = this; - const { Fp2 } = Fp6; - const { c0: c0c0, c1: c0c1, c2: c0c2 } = c0; - const { c0: c1c0, c1: c1c1, c2: c1c2 } = c1; - const { first: t3, second: t4 } = Fp2.Fp4Square(c0c0, c1c1); - const { first: t5, second: t6 } = Fp2.Fp4Square(c1c0, c0c2); - const { first: t7, second: t8 } = Fp2.Fp4Square(c0c1, c1c2); - const t9 = Fp2.mulByNonresidue(t8); // T8 * (u + 1) - return { - c0: Fp6.create({ - c0: Fp2.add(Fp2.mul(Fp2.sub(t3, c0c0), _2n), t3), // 2 * (T3 - c0c0) + T3 - c1: Fp2.add(Fp2.mul(Fp2.sub(t5, c0c1), _2n), t5), // 2 * (T5 - c0c1) + T5 - c2: Fp2.add(Fp2.mul(Fp2.sub(t7, c0c2), _2n), t7), - }), // 2 * (T7 - c0c2) + T7 - c1: Fp6.create({ - c0: Fp2.add(Fp2.mul(Fp2.add(t9, c1c0), _2n), t9), // 2 * (T9 + c1c0) + T9 - c1: Fp2.add(Fp2.mul(Fp2.add(t4, c1c1), _2n), t4), // 2 * (T4 + c1c1) + T4 - c2: Fp2.add(Fp2.mul(Fp2.add(t6, c1c2), _2n), t6), - }), - }; // 2 * (T6 + c1c2) + T6 - } - // https://eprint.iacr.org/2009/565.pdf - _cyclotomicExp(num: Fp12, n: bigint): Fp12 { - let z = this.ONE; - for (let i = this.X_LEN - 1; i >= 0; i--) { - z = this._cyclotomicSquare(z); - if (bitGet(n, i)) z = this.mul(z, num); - } - return z; - } -} - -export function tower12(opts: Tower12Opts): { - Fp: Readonly & Required, 'isOdd'>>>; - Fp2: Fp2Bls; - Fp6: Fp6Bls; - Fp12: Fp12Bls; -} { - const Fp = mod.Field(opts.ORDER); - const Fp2 = new _Field2(Fp, opts); - const Fp6 = new _Field6(Fp2); - const Fp12 = new _Field12(Fp6, opts); - return { Fp, Fp2, Fp6, Fp12 }; -} diff --git a/tools/mnemonic-test/node_modules/@noble/curves/src/abstract/utils.ts b/tools/mnemonic-test/node_modules/@noble/curves/src/abstract/utils.ts deleted file mode 100644 index 6d56888c..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/src/abstract/utils.ts +++ /dev/null @@ -1,80 +0,0 @@ -/** - * Deprecated module: moved from curves/abstract/utils.js to curves/utils.js - * @module - */ -import * as u from '../utils.ts'; - -/** @deprecated moved to `@noble/curves/utils.js` */ -export type Hex = u.Hex; -/** @deprecated moved to `@noble/curves/utils.js` */ -export type PrivKey = u.PrivKey; -/** @deprecated moved to `@noble/curves/utils.js` */ -export type CHash = u.CHash; -/** @deprecated moved to `@noble/curves/utils.js` */ -export type FHash = u.FHash; - -/** @deprecated moved to `@noble/curves/utils.js` */ -export const abytes: typeof u.abytes = u.abytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const anumber: typeof u.anumber = u.anumber; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const bytesToHex: typeof u.bytesToHex = u.bytesToHex; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const bytesToUtf8: typeof u.bytesToUtf8 = u.bytesToUtf8; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const concatBytes: typeof u.concatBytes = u.concatBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const hexToBytes: typeof u.hexToBytes = u.hexToBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const isBytes: typeof u.isBytes = u.isBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const randomBytes: typeof u.randomBytes = u.randomBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const utf8ToBytes: typeof u.utf8ToBytes = u.utf8ToBytes; - -/** @deprecated moved to `@noble/curves/utils.js` */ -export const abool: typeof u.abool = u.abool; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const numberToHexUnpadded: typeof u.numberToHexUnpadded = u.numberToHexUnpadded; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const hexToNumber: typeof u.hexToNumber = u.hexToNumber; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const bytesToNumberBE: typeof u.bytesToNumberBE = u.bytesToNumberBE; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const bytesToNumberLE: typeof u.bytesToNumberLE = u.bytesToNumberLE; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const numberToBytesBE: typeof u.numberToBytesBE = u.numberToBytesBE; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const numberToBytesLE: typeof u.numberToBytesLE = u.numberToBytesLE; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const numberToVarBytesBE: typeof u.numberToVarBytesBE = u.numberToVarBytesBE; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const ensureBytes: typeof u.ensureBytes = u.ensureBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const equalBytes: typeof u.equalBytes = u.equalBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const copyBytes: typeof u.copyBytes = u.copyBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const asciiToBytes: typeof u.asciiToBytes = u.asciiToBytes; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const inRange: typeof u.inRange = u.inRange; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const aInRange: typeof u.aInRange = u.aInRange; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const bitLen: typeof u.bitLen = u.bitLen; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const bitGet: typeof u.bitGet = u.bitGet; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const bitSet: typeof u.bitSet = u.bitSet; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const bitMask: typeof u.bitMask = u.bitMask; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const createHmacDrbg: typeof u.createHmacDrbg = u.createHmacDrbg; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const notImplemented: typeof u.notImplemented = u.notImplemented; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const memoized: typeof u.memoized = u.memoized; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const validateObject: typeof u.validateObject = u.validateObject; -/** @deprecated moved to `@noble/curves/utils.js` */ -export const isHash: typeof u.isHash = u.isHash; diff --git a/tools/mnemonic-test/node_modules/@noble/curves/src/abstract/weierstrass.ts b/tools/mnemonic-test/node_modules/@noble/curves/src/abstract/weierstrass.ts deleted file mode 100644 index 17c75dc6..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/src/abstract/weierstrass.ts +++ /dev/null @@ -1,1884 +0,0 @@ -/** - * Short Weierstrass curve methods. The formula is: y² = x³ + ax + b. - * - * ### Design rationale for types - * - * * Interaction between classes from different curves should fail: - * `k256.Point.BASE.add(p256.Point.BASE)` - * * For this purpose we want to use `instanceof` operator, which is fast and works during runtime - * * Different calls of `curve()` would return different classes - - * `curve(params) !== curve(params)`: if somebody decided to monkey-patch their curve, - * it won't affect others - * - * TypeScript can't infer types for classes created inside a function. Classes is one instance - * of nominative types in TypeScript and interfaces only check for shape, so it's hard to create - * unique type for every function call. - * - * We can use generic types via some param, like curve opts, but that would: - * 1. Enable interaction between `curve(params)` and `curve(params)` (curves of same params) - * which is hard to debug. - * 2. Params can be generic and we can't enforce them to be constant value: - * if somebody creates curve from non-constant params, - * it would be allowed to interact with other curves with non-constant params - * - * @todo https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html#unique-symbol - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { hmac as nobleHmac } from '@noble/hashes/hmac.js'; -import { ahash } from '@noble/hashes/utils'; -import { - _validateObject, - _abool2 as abool, - _abytes2 as abytes, - aInRange, - bitLen, - bitMask, - bytesToHex, - bytesToNumberBE, - concatBytes, - createHmacDrbg, - ensureBytes, - hexToBytes, - inRange, - isBytes, - memoized, - numberToHexUnpadded, - randomBytes as randomBytesWeb, - type CHash, - type Hex, - type PrivKey, -} from '../utils.ts'; -import { - _createCurveFields, - mulEndoUnsafe, - negateCt, - normalizeZ, - pippenger, - wNAF, - type AffinePoint, - type BasicCurve, - type CurveLengths, - type CurvePoint, - type CurvePointCons, -} from './curve.ts'; -import { - Field, - FpInvertBatch, - getMinHashLength, - mapHashToField, - nLength, - validateField, - type IField, - type NLength, -} from './modular.ts'; - -export type { AffinePoint }; -export type HmacFnSync = (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array; - -type EndoBasis = [[bigint, bigint], [bigint, bigint]]; -/** - * When Weierstrass curve has `a=0`, it becomes Koblitz curve. - * Koblitz curves allow using **efficiently-computable GLV endomorphism ψ**. - * Endomorphism uses 2x less RAM, speeds up precomputation by 2x and ECDH / key recovery by 20%. - * For precomputed wNAF it trades off 1/2 init time & 1/3 ram for 20% perf hit. - * - * Endomorphism consists of beta, lambda and splitScalar: - * - * 1. GLV endomorphism ψ transforms a point: `P = (x, y) ↦ ψ(P) = (β·x mod p, y)` - * 2. GLV scalar decomposition transforms a scalar: `k ≡ k₁ + k₂·λ (mod n)` - * 3. Then these are combined: `k·P = k₁·P + k₂·ψ(P)` - * 4. Two 128-bit point-by-scalar multiplications + one point addition is faster than - * one 256-bit multiplication. - * - * where - * * beta: β ∈ Fₚ with β³ = 1, β ≠ 1 - * * lambda: λ ∈ Fₙ with λ³ = 1, λ ≠ 1 - * * splitScalar decomposes k ↦ k₁, k₂, by using reduced basis vectors. - * Gauss lattice reduction calculates them from initial basis vectors `(n, 0), (-λ, 0)` - * - * Check out `test/misc/endomorphism.js` and - * [gist](https://gist.github.com/paulmillr/eb670806793e84df628a7c434a873066). - */ -export type EndomorphismOpts = { - beta: bigint; - basises?: EndoBasis; - splitScalar?: (k: bigint) => { k1neg: boolean; k1: bigint; k2neg: boolean; k2: bigint }; -}; - -// We construct basis in such way that den is always positive and equals n, but num sign depends on basis (not on secret value) -const divNearest = (num: bigint, den: bigint) => (num + (num >= 0 ? den : -den) / _2n) / den; - -export type ScalarEndoParts = { k1neg: boolean; k1: bigint; k2neg: boolean; k2: bigint }; - -/** - * Splits scalar for GLV endomorphism. - */ -export function _splitEndoScalar(k: bigint, basis: EndoBasis, n: bigint): ScalarEndoParts { - // Split scalar into two such that part is ~half bits: `abs(part) < sqrt(N)` - // Since part can be negative, we need to do this on point. - // TODO: verifyScalar function which consumes lambda - const [[a1, b1], [a2, b2]] = basis; - const c1 = divNearest(b2 * k, n); - const c2 = divNearest(-b1 * k, n); - // |k1|/|k2| is < sqrt(N), but can be negative. - // If we do `k1 mod N`, we'll get big scalar (`> sqrt(N)`): so, we do cheaper negation instead. - let k1 = k - c1 * a1 - c2 * a2; - let k2 = -c1 * b1 - c2 * b2; - const k1neg = k1 < _0n; - const k2neg = k2 < _0n; - if (k1neg) k1 = -k1; - if (k2neg) k2 = -k2; - // Double check that resulting scalar less than half bits of N: otherwise wNAF will fail. - // This should only happen on wrong basises. Also, math inside is too complex and I don't trust it. - const MAX_NUM = bitMask(Math.ceil(bitLen(n) / 2)) + _1n; // Half bits of N - if (k1 < _0n || k1 >= MAX_NUM || k2 < _0n || k2 >= MAX_NUM) { - throw new Error('splitScalar (endomorphism): failed, k=' + k); - } - return { k1neg, k1, k2neg, k2 }; -} - -export type ECDSASigFormat = 'compact' | 'recovered' | 'der'; -export type ECDSARecoverOpts = { - prehash?: boolean; -}; -export type ECDSAVerifyOpts = { - prehash?: boolean; - lowS?: boolean; - format?: ECDSASigFormat; -}; -export type ECDSASignOpts = { - prehash?: boolean; - lowS?: boolean; - format?: ECDSASigFormat; - extraEntropy?: Uint8Array | boolean; -}; - -function validateSigFormat(format: string): ECDSASigFormat { - if (!['compact', 'recovered', 'der'].includes(format)) - throw new Error('Signature format must be "compact", "recovered", or "der"'); - return format as ECDSASigFormat; -} - -function validateSigOpts>( - opts: T, - def: D -): Required { - const optsn: ECDSASignOpts = {}; - for (let optName of Object.keys(def)) { - // @ts-ignore - optsn[optName] = opts[optName] === undefined ? def[optName] : opts[optName]; - } - abool(optsn.lowS!, 'lowS'); - abool(optsn.prehash!, 'prehash'); - if (optsn.format !== undefined) validateSigFormat(optsn.format); - return optsn as Required; -} - -/** Instance methods for 3D XYZ projective points. */ -export interface WeierstrassPoint extends CurvePoint> { - /** projective X coordinate. Different from affine x. */ - readonly X: T; - /** projective Y coordinate. Different from affine y. */ - readonly Y: T; - /** projective z coordinate */ - readonly Z: T; - /** affine x coordinate. Different from projective X. */ - get x(): T; - /** affine y coordinate. Different from projective Y. */ - get y(): T; - /** Encodes point using IEEE P1363 (DER) encoding. First byte is 2/3/4. Default = isCompressed. */ - toBytes(isCompressed?: boolean): Uint8Array; - toHex(isCompressed?: boolean): string; - - /** @deprecated use `.X` */ - readonly px: T; - /** @deprecated use `.Y` */ - readonly py: T; - /** @deprecated use `.Z` */ - readonly pz: T; - /** @deprecated use `toBytes` */ - toRawBytes(isCompressed?: boolean): Uint8Array; - /** @deprecated use `multiplyUnsafe` */ - multiplyAndAddUnsafe( - Q: WeierstrassPoint, - a: bigint, - b: bigint - ): WeierstrassPoint | undefined; - /** @deprecated use `p.y % 2n === 0n` */ - hasEvenY(): boolean; - /** @deprecated use `p.precompute(windowSize)` */ - _setWindowSize(windowSize: number): void; -} - -/** Static methods for 3D XYZ projective points. */ -export interface WeierstrassPointCons extends CurvePointCons> { - /** Does NOT validate if the point is valid. Use `.assertValidity()`. */ - new (X: T, Y: T, Z: T): WeierstrassPoint; - CURVE(): WeierstrassOpts; - /** @deprecated use `Point.BASE.multiply(Point.Fn.fromBytes(privateKey))` */ - fromPrivateKey(privateKey: PrivKey): WeierstrassPoint; - /** @deprecated use `import { normalizeZ } from '@noble/curves/abstract/curve.js';` */ - normalizeZ(points: WeierstrassPoint[]): WeierstrassPoint[]; - /** @deprecated use `import { pippenger } from '@noble/curves/abstract/curve.js';` */ - msm(points: WeierstrassPoint[], scalars: bigint[]): WeierstrassPoint; -} - -/** - * Weierstrass curve options. - * - * * p: prime characteristic (order) of finite field, in which arithmetics is done - * * n: order of prime subgroup a.k.a total amount of valid curve points - * * h: cofactor, usually 1. h*n is group order; n is subgroup order - * * a: formula param, must be in field of p - * * b: formula param, must be in field of p - * * Gx: x coordinate of generator point a.k.a. base point - * * Gy: y coordinate of generator point - */ -export type WeierstrassOpts = Readonly<{ - p: bigint; - n: bigint; - h: bigint; - a: T; - b: T; - Gx: T; - Gy: T; -}>; - -// When a cofactor != 1, there can be an effective methods to: -// 1. Determine whether a point is torsion-free -// 2. Clear torsion component -// wrapPrivateKey: bls12-381 requires mod(n) instead of rejecting keys >= n -export type WeierstrassExtraOpts = Partial<{ - Fp: IField; - Fn: IField; - allowInfinityPoint: boolean; - endo: EndomorphismOpts; - isTorsionFree: (c: WeierstrassPointCons, point: WeierstrassPoint) => boolean; - clearCofactor: (c: WeierstrassPointCons, point: WeierstrassPoint) => WeierstrassPoint; - fromBytes: (bytes: Uint8Array) => AffinePoint; - toBytes: ( - c: WeierstrassPointCons, - point: WeierstrassPoint, - isCompressed: boolean - ) => Uint8Array; -}>; - -/** - * Options for ECDSA signatures over a Weierstrass curve. - * - * * lowS: (default: true) whether produced / verified signatures occupy low half of ecdsaOpts.p. Prevents malleability. - * * hmac: (default: noble-hashes hmac) function, would be used to init hmac-drbg for k generation. - * * randomBytes: (default: webcrypto os-level CSPRNG) custom method for fetching secure randomness. - * * bits2int, bits2int_modN: used in sigs, sometimes overridden by curves - */ -export type ECDSAOpts = Partial<{ - lowS: boolean; - hmac: HmacFnSync; - randomBytes: (bytesLength?: number) => Uint8Array; - bits2int: (bytes: Uint8Array) => bigint; - bits2int_modN: (bytes: Uint8Array) => bigint; -}>; - -/** - * Elliptic Curve Diffie-Hellman interface. - * Provides keygen, secret-to-public conversion, calculating shared secrets. - */ -export interface ECDH { - keygen: (seed?: Uint8Array) => { secretKey: Uint8Array; publicKey: Uint8Array }; - getPublicKey: (secretKey: PrivKey, isCompressed?: boolean) => Uint8Array; - getSharedSecret: (secretKeyA: PrivKey, publicKeyB: Hex, isCompressed?: boolean) => Uint8Array; - Point: WeierstrassPointCons; - utils: { - isValidSecretKey: (secretKey: PrivKey) => boolean; - isValidPublicKey: (publicKey: Uint8Array, isCompressed?: boolean) => boolean; - randomSecretKey: (seed?: Uint8Array) => Uint8Array; - /** @deprecated use `randomSecretKey` */ - randomPrivateKey: (seed?: Uint8Array) => Uint8Array; - /** @deprecated use `isValidSecretKey` */ - isValidPrivateKey: (secretKey: PrivKey) => boolean; - /** @deprecated use `Point.Fn.fromBytes()` */ - normPrivateKeyToScalar: (key: PrivKey) => bigint; - /** @deprecated use `point.precompute()` */ - precompute: (windowSize?: number, point?: WeierstrassPoint) => WeierstrassPoint; - }; - lengths: CurveLengths; -} - -/** - * ECDSA interface. - * Only supported for prime fields, not Fp2 (extension fields). - */ -export interface ECDSA extends ECDH { - sign: (message: Hex, secretKey: PrivKey, opts?: ECDSASignOpts) => ECDSASigRecovered; - verify: ( - signature: Uint8Array, - message: Uint8Array, - publicKey: Uint8Array, - opts?: ECDSAVerifyOpts - ) => boolean; - recoverPublicKey(signature: Uint8Array, message: Uint8Array, opts?: ECDSARecoverOpts): Uint8Array; - Signature: ECDSASignatureCons; -} -export class DERErr extends Error { - constructor(m = '') { - super(m); - } -} -export type IDER = { - // asn.1 DER encoding utils - Err: typeof DERErr; - // Basic building block is TLV (Tag-Length-Value) - _tlv: { - encode: (tag: number, data: string) => string; - // v - value, l - left bytes (unparsed) - decode(tag: number, data: Uint8Array): { v: Uint8Array; l: Uint8Array }; - }; - // https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag, - // since we always use positive integers here. It must always be empty: - // - add zero byte if exists - // - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding) - _int: { - encode(num: bigint): string; - decode(data: Uint8Array): bigint; - }; - toSig(hex: string | Uint8Array): { r: bigint; s: bigint }; - hexFromSig(sig: { r: bigint; s: bigint }): string; -}; -/** - * ASN.1 DER encoding utilities. ASN is very complex & fragile. Format: - * - * [0x30 (SEQUENCE), bytelength, 0x02 (INTEGER), intLength, R, 0x02 (INTEGER), intLength, S] - * - * Docs: https://letsencrypt.org/docs/a-warm-welcome-to-asn1-and-der/, https://luca.ntop.org/Teaching/Appunti/asn1.html - */ -export const DER: IDER = { - // asn.1 DER encoding utils - Err: DERErr, - // Basic building block is TLV (Tag-Length-Value) - _tlv: { - encode: (tag: number, data: string): string => { - const { Err: E } = DER; - if (tag < 0 || tag > 256) throw new E('tlv.encode: wrong tag'); - if (data.length & 1) throw new E('tlv.encode: unpadded data'); - const dataLen = data.length / 2; - const len = numberToHexUnpadded(dataLen); - if ((len.length / 2) & 0b1000_0000) throw new E('tlv.encode: long form length too big'); - // length of length with long form flag - const lenLen = dataLen > 127 ? numberToHexUnpadded((len.length / 2) | 0b1000_0000) : ''; - const t = numberToHexUnpadded(tag); - return t + lenLen + len + data; - }, - // v - value, l - left bytes (unparsed) - decode(tag: number, data: Uint8Array): { v: Uint8Array; l: Uint8Array } { - const { Err: E } = DER; - let pos = 0; - if (tag < 0 || tag > 256) throw new E('tlv.encode: wrong tag'); - if (data.length < 2 || data[pos++] !== tag) throw new E('tlv.decode: wrong tlv'); - const first = data[pos++]; - const isLong = !!(first & 0b1000_0000); // First bit of first length byte is flag for short/long form - let length = 0; - if (!isLong) length = first; - else { - // Long form: [longFlag(1bit), lengthLength(7bit), length (BE)] - const lenLen = first & 0b0111_1111; - if (!lenLen) throw new E('tlv.decode(long): indefinite length not supported'); - if (lenLen > 4) throw new E('tlv.decode(long): byte length is too big'); // this will overflow u32 in js - const lengthBytes = data.subarray(pos, pos + lenLen); - if (lengthBytes.length !== lenLen) throw new E('tlv.decode: length bytes not complete'); - if (lengthBytes[0] === 0) throw new E('tlv.decode(long): zero leftmost byte'); - for (const b of lengthBytes) length = (length << 8) | b; - pos += lenLen; - if (length < 128) throw new E('tlv.decode(long): not minimal encoding'); - } - const v = data.subarray(pos, pos + length); - if (v.length !== length) throw new E('tlv.decode: wrong value length'); - return { v, l: data.subarray(pos + length) }; - }, - }, - // https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag, - // since we always use positive integers here. It must always be empty: - // - add zero byte if exists - // - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding) - _int: { - encode(num: bigint): string { - const { Err: E } = DER; - if (num < _0n) throw new E('integer: negative integers are not allowed'); - let hex = numberToHexUnpadded(num); - // Pad with zero byte if negative flag is present - if (Number.parseInt(hex[0], 16) & 0b1000) hex = '00' + hex; - if (hex.length & 1) throw new E('unexpected DER parsing assertion: unpadded hex'); - return hex; - }, - decode(data: Uint8Array): bigint { - const { Err: E } = DER; - if (data[0] & 0b1000_0000) throw new E('invalid signature integer: negative'); - if (data[0] === 0x00 && !(data[1] & 0b1000_0000)) - throw new E('invalid signature integer: unnecessary leading zero'); - return bytesToNumberBE(data); - }, - }, - toSig(hex: string | Uint8Array): { r: bigint; s: bigint } { - // parse DER signature - const { Err: E, _int: int, _tlv: tlv } = DER; - const data = ensureBytes('signature', hex); - const { v: seqBytes, l: seqLeftBytes } = tlv.decode(0x30, data); - if (seqLeftBytes.length) throw new E('invalid signature: left bytes after parsing'); - const { v: rBytes, l: rLeftBytes } = tlv.decode(0x02, seqBytes); - const { v: sBytes, l: sLeftBytes } = tlv.decode(0x02, rLeftBytes); - if (sLeftBytes.length) throw new E('invalid signature: left bytes after parsing'); - return { r: int.decode(rBytes), s: int.decode(sBytes) }; - }, - hexFromSig(sig: { r: bigint; s: bigint }): string { - const { _tlv: tlv, _int: int } = DER; - const rs = tlv.encode(0x02, int.encode(sig.r)); - const ss = tlv.encode(0x02, int.encode(sig.s)); - const seq = rs + ss; - return tlv.encode(0x30, seq); - }, -}; - -// Be friendly to bad ECMAScript parsers by not using bigint literals -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = BigInt(4); - -export function _normFnElement(Fn: IField, key: PrivKey): bigint { - const { BYTES: expected } = Fn; - let num: bigint; - if (typeof key === 'bigint') { - num = key; - } else { - let bytes = ensureBytes('private key', key); - try { - num = Fn.fromBytes(bytes); - } catch (error) { - throw new Error(`invalid private key: expected ui8a of size ${expected}, got ${typeof key}`); - } - } - if (!Fn.isValidNot0(num)) throw new Error('invalid private key: out of range [1..N-1]'); - return num; -} - -/** - * Creates weierstrass Point constructor, based on specified curve options. - * - * @example -```js -const opts = { - p: BigInt('0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff'), - n: BigInt('0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551'), - h: BigInt(1), - a: BigInt('0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc'), - b: BigInt('0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b'), - Gx: BigInt('0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296'), - Gy: BigInt('0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5'), -}; -const p256_Point = weierstrass(opts); -``` - */ -export function weierstrassN( - params: WeierstrassOpts, - extraOpts: WeierstrassExtraOpts = {} -): WeierstrassPointCons { - const validated = _createCurveFields('weierstrass', params, extraOpts); - const { Fp, Fn } = validated; - let CURVE = validated.CURVE as WeierstrassOpts; - const { h: cofactor, n: CURVE_ORDER } = CURVE; - _validateObject( - extraOpts, - {}, - { - allowInfinityPoint: 'boolean', - clearCofactor: 'function', - isTorsionFree: 'function', - fromBytes: 'function', - toBytes: 'function', - endo: 'object', - wrapPrivateKey: 'boolean', - } - ); - - const { endo } = extraOpts; - if (endo) { - // validateObject(endo, { beta: 'bigint', splitScalar: 'function' }); - if (!Fp.is0(CURVE.a) || typeof endo.beta !== 'bigint' || !Array.isArray(endo.basises)) { - throw new Error('invalid endo: expected "beta": bigint and "basises": array'); - } - } - - const lengths = getWLengths(Fp, Fn); - - function assertCompressionIsSupported() { - if (!Fp.isOdd) throw new Error('compression is not supported: Field does not have .isOdd()'); - } - - // Implements IEEE P1363 point encoding - function pointToBytes( - _c: WeierstrassPointCons, - point: WeierstrassPoint, - isCompressed: boolean - ): Uint8Array { - const { x, y } = point.toAffine(); - const bx = Fp.toBytes(x); - abool(isCompressed, 'isCompressed'); - if (isCompressed) { - assertCompressionIsSupported(); - const hasEvenY = !Fp.isOdd!(y); - return concatBytes(pprefix(hasEvenY), bx); - } else { - return concatBytes(Uint8Array.of(0x04), bx, Fp.toBytes(y)); - } - } - function pointFromBytes(bytes: Uint8Array) { - abytes(bytes, undefined, 'Point'); - const { publicKey: comp, publicKeyUncompressed: uncomp } = lengths; // e.g. for 32-byte: 33, 65 - const length = bytes.length; - const head = bytes[0]; - const tail = bytes.subarray(1); - // No actual validation is done here: use .assertValidity() - if (length === comp && (head === 0x02 || head === 0x03)) { - const x = Fp.fromBytes(tail); - if (!Fp.isValid(x)) throw new Error('bad point: is not on curve, wrong x'); - const y2 = weierstrassEquation(x); // y² = x³ + ax + b - let y: T; - try { - y = Fp.sqrt(y2); // y = y² ^ (p+1)/4 - } catch (sqrtError) { - const err = sqrtError instanceof Error ? ': ' + sqrtError.message : ''; - throw new Error('bad point: is not on curve, sqrt error' + err); - } - assertCompressionIsSupported(); - const isYOdd = Fp.isOdd!(y); // (y & _1n) === _1n; - const isHeadOdd = (head & 1) === 1; // ECDSA-specific - if (isHeadOdd !== isYOdd) y = Fp.neg(y); - return { x, y }; - } else if (length === uncomp && head === 0x04) { - // TODO: more checks - const L = Fp.BYTES; - const x = Fp.fromBytes(tail.subarray(0, L)); - const y = Fp.fromBytes(tail.subarray(L, L * 2)); - if (!isValidXY(x, y)) throw new Error('bad point: is not on curve'); - return { x, y }; - } else { - throw new Error( - `bad point: got length ${length}, expected compressed=${comp} or uncompressed=${uncomp}` - ); - } - } - - const encodePoint = extraOpts.toBytes || pointToBytes; - const decodePoint = extraOpts.fromBytes || pointFromBytes; - function weierstrassEquation(x: T): T { - const x2 = Fp.sqr(x); // x * x - const x3 = Fp.mul(x2, x); // x² * x - return Fp.add(Fp.add(x3, Fp.mul(x, CURVE.a)), CURVE.b); // x³ + a * x + b - } - - // TODO: move top-level - /** Checks whether equation holds for given x, y: y² == x³ + ax + b */ - function isValidXY(x: T, y: T): boolean { - const left = Fp.sqr(y); // y² - const right = weierstrassEquation(x); // x³ + ax + b - return Fp.eql(left, right); - } - - // Validate whether the passed curve params are valid. - // Test 1: equation y² = x³ + ax + b should work for generator point. - if (!isValidXY(CURVE.Gx, CURVE.Gy)) throw new Error('bad curve params: generator point'); - - // Test 2: discriminant Δ part should be non-zero: 4a³ + 27b² != 0. - // Guarantees curve is genus-1, smooth (non-singular). - const _4a3 = Fp.mul(Fp.pow(CURVE.a, _3n), _4n); - const _27b2 = Fp.mul(Fp.sqr(CURVE.b), BigInt(27)); - if (Fp.is0(Fp.add(_4a3, _27b2))) throw new Error('bad curve params: a or b'); - - /** Asserts coordinate is valid: 0 <= n < Fp.ORDER. */ - function acoord(title: string, n: T, banZero = false) { - if (!Fp.isValid(n) || (banZero && Fp.is0(n))) throw new Error(`bad point coordinate ${title}`); - return n; - } - - function aprjpoint(other: unknown) { - if (!(other instanceof Point)) throw new Error('ProjectivePoint expected'); - } - - function splitEndoScalarN(k: bigint) { - if (!endo || !endo.basises) throw new Error('no endo'); - return _splitEndoScalar(k, endo.basises, Fn.ORDER); - } - - // Memoized toAffine / validity check. They are heavy. Points are immutable. - - // Converts Projective point to affine (x, y) coordinates. - // Can accept precomputed Z^-1 - for example, from invertBatch. - // (X, Y, Z) ∋ (x=X/Z, y=Y/Z) - const toAffineMemo = memoized((p: Point, iz?: T): AffinePoint => { - const { X, Y, Z } = p; - // Fast-path for normalized points - if (Fp.eql(Z, Fp.ONE)) return { x: X, y: Y }; - const is0 = p.is0(); - // If invZ was 0, we return zero point. However we still want to execute - // all operations, so we replace invZ with a random number, 1. - if (iz == null) iz = is0 ? Fp.ONE : Fp.inv(Z); - const x = Fp.mul(X, iz); - const y = Fp.mul(Y, iz); - const zz = Fp.mul(Z, iz); - if (is0) return { x: Fp.ZERO, y: Fp.ZERO }; - if (!Fp.eql(zz, Fp.ONE)) throw new Error('invZ was invalid'); - return { x, y }; - }); - // NOTE: on exception this will crash 'cached' and no value will be set. - // Otherwise true will be return - const assertValidMemo = memoized((p: Point) => { - if (p.is0()) { - // (0, 1, 0) aka ZERO is invalid in most contexts. - // In BLS, ZERO can be serialized, so we allow it. - // (0, 0, 0) is invalid representation of ZERO. - if (extraOpts.allowInfinityPoint && !Fp.is0(p.Y)) return; - throw new Error('bad point: ZERO'); - } - // Some 3rd-party test vectors require different wording between here & `fromCompressedHex` - const { x, y } = p.toAffine(); - if (!Fp.isValid(x) || !Fp.isValid(y)) throw new Error('bad point: x or y not field elements'); - if (!isValidXY(x, y)) throw new Error('bad point: equation left != right'); - if (!p.isTorsionFree()) throw new Error('bad point: not in prime-order subgroup'); - return true; - }); - - function finishEndo( - endoBeta: EndomorphismOpts['beta'], - k1p: Point, - k2p: Point, - k1neg: boolean, - k2neg: boolean - ) { - k2p = new Point(Fp.mul(k2p.X, endoBeta), k2p.Y, k2p.Z); - k1p = negateCt(k1neg, k1p); - k2p = negateCt(k2neg, k2p); - return k1p.add(k2p); - } - - /** - * Projective Point works in 3d / projective (homogeneous) coordinates:(X, Y, Z) ∋ (x=X/Z, y=Y/Z). - * Default Point works in 2d / affine coordinates: (x, y). - * We're doing calculations in projective, because its operations don't require costly inversion. - */ - class Point implements WeierstrassPoint { - // base / generator point - static readonly BASE = new Point(CURVE.Gx, CURVE.Gy, Fp.ONE); - // zero / infinity / identity point - static readonly ZERO = new Point(Fp.ZERO, Fp.ONE, Fp.ZERO); // 0, 1, 0 - // math field - static readonly Fp = Fp; - // scalar field - static readonly Fn = Fn; - - readonly X: T; - readonly Y: T; - readonly Z: T; - - /** Does NOT validate if the point is valid. Use `.assertValidity()`. */ - constructor(X: T, Y: T, Z: T) { - this.X = acoord('x', X); - this.Y = acoord('y', Y, true); - this.Z = acoord('z', Z); - Object.freeze(this); - } - - static CURVE(): WeierstrassOpts { - return CURVE; - } - - /** Does NOT validate if the point is valid. Use `.assertValidity()`. */ - static fromAffine(p: AffinePoint): Point { - const { x, y } = p || {}; - if (!p || !Fp.isValid(x) || !Fp.isValid(y)) throw new Error('invalid affine point'); - if (p instanceof Point) throw new Error('projective point not allowed'); - // (0, 0) would've produced (0, 0, 1) - instead, we need (0, 1, 0) - if (Fp.is0(x) && Fp.is0(y)) return Point.ZERO; - return new Point(x, y, Fp.ONE); - } - - static fromBytes(bytes: Uint8Array): Point { - const P = Point.fromAffine(decodePoint(abytes(bytes, undefined, 'point'))); - P.assertValidity(); - return P; - } - static fromHex(hex: Hex): Point { - return Point.fromBytes(ensureBytes('pointHex', hex)); - } - - get x(): T { - return this.toAffine().x; - } - get y(): T { - return this.toAffine().y; - } - - /** - * - * @param windowSize - * @param isLazy true will defer table computation until the first multiplication - * @returns - */ - precompute(windowSize: number = 8, isLazy = true): Point { - wnaf.createCache(this, windowSize); - if (!isLazy) this.multiply(_3n); // random number - return this; - } - - // TODO: return `this` - /** A point on curve is valid if it conforms to equation. */ - assertValidity(): void { - assertValidMemo(this); - } - - hasEvenY(): boolean { - const { y } = this.toAffine(); - if (!Fp.isOdd) throw new Error("Field doesn't support isOdd"); - return !Fp.isOdd(y); - } - - /** Compare one point to another. */ - equals(other: Point): boolean { - aprjpoint(other); - const { X: X1, Y: Y1, Z: Z1 } = this; - const { X: X2, Y: Y2, Z: Z2 } = other; - const U1 = Fp.eql(Fp.mul(X1, Z2), Fp.mul(X2, Z1)); - const U2 = Fp.eql(Fp.mul(Y1, Z2), Fp.mul(Y2, Z1)); - return U1 && U2; - } - - /** Flips point to one corresponding to (x, -y) in Affine coordinates. */ - negate(): Point { - return new Point(this.X, Fp.neg(this.Y), this.Z); - } - - // Renes-Costello-Batina exception-free doubling formula. - // There is 30% faster Jacobian formula, but it is not complete. - // https://eprint.iacr.org/2015/1060, algorithm 3 - // Cost: 8M + 3S + 3*a + 2*b3 + 15add. - double() { - const { a, b } = CURVE; - const b3 = Fp.mul(b, _3n); - const { X: X1, Y: Y1, Z: Z1 } = this; - let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore - let t0 = Fp.mul(X1, X1); // step 1 - let t1 = Fp.mul(Y1, Y1); - let t2 = Fp.mul(Z1, Z1); - let t3 = Fp.mul(X1, Y1); - t3 = Fp.add(t3, t3); // step 5 - Z3 = Fp.mul(X1, Z1); - Z3 = Fp.add(Z3, Z3); - X3 = Fp.mul(a, Z3); - Y3 = Fp.mul(b3, t2); - Y3 = Fp.add(X3, Y3); // step 10 - X3 = Fp.sub(t1, Y3); - Y3 = Fp.add(t1, Y3); - Y3 = Fp.mul(X3, Y3); - X3 = Fp.mul(t3, X3); - Z3 = Fp.mul(b3, Z3); // step 15 - t2 = Fp.mul(a, t2); - t3 = Fp.sub(t0, t2); - t3 = Fp.mul(a, t3); - t3 = Fp.add(t3, Z3); - Z3 = Fp.add(t0, t0); // step 20 - t0 = Fp.add(Z3, t0); - t0 = Fp.add(t0, t2); - t0 = Fp.mul(t0, t3); - Y3 = Fp.add(Y3, t0); - t2 = Fp.mul(Y1, Z1); // step 25 - t2 = Fp.add(t2, t2); - t0 = Fp.mul(t2, t3); - X3 = Fp.sub(X3, t0); - Z3 = Fp.mul(t2, t1); - Z3 = Fp.add(Z3, Z3); // step 30 - Z3 = Fp.add(Z3, Z3); - return new Point(X3, Y3, Z3); - } - - // Renes-Costello-Batina exception-free addition formula. - // There is 30% faster Jacobian formula, but it is not complete. - // https://eprint.iacr.org/2015/1060, algorithm 1 - // Cost: 12M + 0S + 3*a + 3*b3 + 23add. - add(other: Point): Point { - aprjpoint(other); - const { X: X1, Y: Y1, Z: Z1 } = this; - const { X: X2, Y: Y2, Z: Z2 } = other; - let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore - const a = CURVE.a; - const b3 = Fp.mul(CURVE.b, _3n); - let t0 = Fp.mul(X1, X2); // step 1 - let t1 = Fp.mul(Y1, Y2); - let t2 = Fp.mul(Z1, Z2); - let t3 = Fp.add(X1, Y1); - let t4 = Fp.add(X2, Y2); // step 5 - t3 = Fp.mul(t3, t4); - t4 = Fp.add(t0, t1); - t3 = Fp.sub(t3, t4); - t4 = Fp.add(X1, Z1); - let t5 = Fp.add(X2, Z2); // step 10 - t4 = Fp.mul(t4, t5); - t5 = Fp.add(t0, t2); - t4 = Fp.sub(t4, t5); - t5 = Fp.add(Y1, Z1); - X3 = Fp.add(Y2, Z2); // step 15 - t5 = Fp.mul(t5, X3); - X3 = Fp.add(t1, t2); - t5 = Fp.sub(t5, X3); - Z3 = Fp.mul(a, t4); - X3 = Fp.mul(b3, t2); // step 20 - Z3 = Fp.add(X3, Z3); - X3 = Fp.sub(t1, Z3); - Z3 = Fp.add(t1, Z3); - Y3 = Fp.mul(X3, Z3); - t1 = Fp.add(t0, t0); // step 25 - t1 = Fp.add(t1, t0); - t2 = Fp.mul(a, t2); - t4 = Fp.mul(b3, t4); - t1 = Fp.add(t1, t2); - t2 = Fp.sub(t0, t2); // step 30 - t2 = Fp.mul(a, t2); - t4 = Fp.add(t4, t2); - t0 = Fp.mul(t1, t4); - Y3 = Fp.add(Y3, t0); - t0 = Fp.mul(t5, t4); // step 35 - X3 = Fp.mul(t3, X3); - X3 = Fp.sub(X3, t0); - t0 = Fp.mul(t3, t1); - Z3 = Fp.mul(t5, Z3); - Z3 = Fp.add(Z3, t0); // step 40 - return new Point(X3, Y3, Z3); - } - - subtract(other: Point) { - return this.add(other.negate()); - } - - is0(): boolean { - return this.equals(Point.ZERO); - } - - /** - * Constant time multiplication. - * Uses wNAF method. Windowed method may be 10% faster, - * but takes 2x longer to generate and consumes 2x memory. - * Uses precomputes when available. - * Uses endomorphism for Koblitz curves. - * @param scalar by which the point would be multiplied - * @returns New point - */ - multiply(scalar: bigint): Point { - const { endo } = extraOpts; - if (!Fn.isValidNot0(scalar)) throw new Error('invalid scalar: out of range'); // 0 is invalid - let point: Point, fake: Point; // Fake point is used to const-time mult - const mul = (n: bigint) => wnaf.cached(this, n, (p) => normalizeZ(Point, p)); - /** See docs for {@link EndomorphismOpts} */ - if (endo) { - const { k1neg, k1, k2neg, k2 } = splitEndoScalarN(scalar); - const { p: k1p, f: k1f } = mul(k1); - const { p: k2p, f: k2f } = mul(k2); - fake = k1f.add(k2f); - point = finishEndo(endo.beta, k1p, k2p, k1neg, k2neg); - } else { - const { p, f } = mul(scalar); - point = p; - fake = f; - } - // Normalize `z` for both points, but return only real one - return normalizeZ(Point, [point, fake])[0]; - } - - /** - * Non-constant-time multiplication. Uses double-and-add algorithm. - * It's faster, but should only be used when you don't care about - * an exposed secret key e.g. sig verification, which works over *public* keys. - */ - multiplyUnsafe(sc: bigint): Point { - const { endo } = extraOpts; - const p = this as Point; - if (!Fn.isValid(sc)) throw new Error('invalid scalar: out of range'); // 0 is valid - if (sc === _0n || p.is0()) return Point.ZERO; - if (sc === _1n) return p; // fast-path - if (wnaf.hasCache(this)) return this.multiply(sc); - if (endo) { - const { k1neg, k1, k2neg, k2 } = splitEndoScalarN(sc); - const { p1, p2 } = mulEndoUnsafe(Point, p, k1, k2); // 30% faster vs wnaf.unsafe - return finishEndo(endo.beta, p1, p2, k1neg, k2neg); - } else { - return wnaf.unsafe(p, sc); - } - } - - multiplyAndAddUnsafe(Q: Point, a: bigint, b: bigint): Point | undefined { - const sum = this.multiplyUnsafe(a).add(Q.multiplyUnsafe(b)); - return sum.is0() ? undefined : sum; - } - - /** - * Converts Projective point to affine (x, y) coordinates. - * @param invertedZ Z^-1 (inverted zero) - optional, precomputation is useful for invertBatch - */ - toAffine(invertedZ?: T): AffinePoint { - return toAffineMemo(this, invertedZ); - } - - /** - * Checks whether Point is free of torsion elements (is in prime subgroup). - * Always torsion-free for cofactor=1 curves. - */ - isTorsionFree(): boolean { - const { isTorsionFree } = extraOpts; - if (cofactor === _1n) return true; - if (isTorsionFree) return isTorsionFree(Point, this); - return wnaf.unsafe(this, CURVE_ORDER).is0(); - } - - clearCofactor(): Point { - const { clearCofactor } = extraOpts; - if (cofactor === _1n) return this; // Fast-path - if (clearCofactor) return clearCofactor(Point, this) as Point; - return this.multiplyUnsafe(cofactor); - } - - isSmallOrder(): boolean { - // can we use this.clearCofactor()? - return this.multiplyUnsafe(cofactor).is0(); - } - - toBytes(isCompressed = true): Uint8Array { - abool(isCompressed, 'isCompressed'); - this.assertValidity(); - return encodePoint(Point, this, isCompressed); - } - - toHex(isCompressed = true): string { - return bytesToHex(this.toBytes(isCompressed)); - } - - toString() { - return ``; - } - - // TODO: remove - get px(): T { - return this.X; - } - get py(): T { - return this.X; - } - get pz(): T { - return this.Z; - } - toRawBytes(isCompressed = true): Uint8Array { - return this.toBytes(isCompressed); - } - _setWindowSize(windowSize: number) { - this.precompute(windowSize); - } - static normalizeZ(points: Point[]): Point[] { - return normalizeZ(Point, points); - } - static msm(points: Point[], scalars: bigint[]): Point { - return pippenger(Point, Fn, points, scalars); - } - static fromPrivateKey(privateKey: PrivKey) { - return Point.BASE.multiply(_normFnElement(Fn, privateKey)); - } - } - const bits = Fn.BITS; - const wnaf = new wNAF(Point, extraOpts.endo ? Math.ceil(bits / 2) : bits); - Point.BASE.precompute(8); // Enable precomputes. Slows down first publicKey computation by 20ms. - return Point; -} - -/** Methods of ECDSA signature instance. */ -export interface ECDSASignature { - readonly r: bigint; - readonly s: bigint; - readonly recovery?: number; - addRecoveryBit(recovery: number): ECDSASigRecovered; - hasHighS(): boolean; - toBytes(format?: string): Uint8Array; - toHex(format?: string): string; - - /** @deprecated */ - assertValidity(): void; - /** @deprecated */ - normalizeS(): ECDSASignature; - /** @deprecated use standalone method `curve.recoverPublicKey(sig.toBytes('recovered'), msg)` */ - recoverPublicKey(msgHash: Hex): WeierstrassPoint; - /** @deprecated use `.toBytes('compact')` */ - toCompactRawBytes(): Uint8Array; - /** @deprecated use `.toBytes('compact')` */ - toCompactHex(): string; - /** @deprecated use `.toBytes('der')` */ - toDERRawBytes(): Uint8Array; - /** @deprecated use `.toBytes('der')` */ - toDERHex(): string; -} -export type ECDSASigRecovered = ECDSASignature & { - readonly recovery: number; -}; -/** Methods of ECDSA signature constructor. */ -export type ECDSASignatureCons = { - new (r: bigint, s: bigint, recovery?: number): ECDSASignature; - fromBytes(bytes: Uint8Array, format?: ECDSASigFormat): ECDSASignature; - fromHex(hex: string, format?: ECDSASigFormat): ECDSASignature; - - /** @deprecated use `.fromBytes(bytes, 'compact')` */ - fromCompact(hex: Hex): ECDSASignature; - /** @deprecated use `.fromBytes(bytes, 'der')` */ - fromDER(hex: Hex): ECDSASignature; -}; - -// Points start with byte 0x02 when y is even; otherwise 0x03 -function pprefix(hasEvenY: boolean): Uint8Array { - return Uint8Array.of(hasEvenY ? 0x02 : 0x03); -} - -/** - * Implementation of the Shallue and van de Woestijne method for any weierstrass curve. - * TODO: check if there is a way to merge this with uvRatio in Edwards; move to modular. - * b = True and y = sqrt(u / v) if (u / v) is square in F, and - * b = False and y = sqrt(Z * (u / v)) otherwise. - * @param Fp - * @param Z - * @returns - */ -export function SWUFpSqrtRatio( - Fp: IField, - Z: T -): (u: T, v: T) => { isValid: boolean; value: T } { - // Generic implementation - const q = Fp.ORDER; - let l = _0n; - for (let o = q - _1n; o % _2n === _0n; o /= _2n) l += _1n; - const c1 = l; // 1. c1, the largest integer such that 2^c1 divides q - 1. - // We need 2n ** c1 and 2n ** (c1-1). We can't use **; but we can use <<. - // 2n ** c1 == 2n << (c1-1) - const _2n_pow_c1_1 = _2n << (c1 - _1n - _1n); - const _2n_pow_c1 = _2n_pow_c1_1 * _2n; - const c2 = (q - _1n) / _2n_pow_c1; // 2. c2 = (q - 1) / (2^c1) # Integer arithmetic - const c3 = (c2 - _1n) / _2n; // 3. c3 = (c2 - 1) / 2 # Integer arithmetic - const c4 = _2n_pow_c1 - _1n; // 4. c4 = 2^c1 - 1 # Integer arithmetic - const c5 = _2n_pow_c1_1; // 5. c5 = 2^(c1 - 1) # Integer arithmetic - const c6 = Fp.pow(Z, c2); // 6. c6 = Z^c2 - const c7 = Fp.pow(Z, (c2 + _1n) / _2n); // 7. c7 = Z^((c2 + 1) / 2) - let sqrtRatio = (u: T, v: T): { isValid: boolean; value: T } => { - let tv1 = c6; // 1. tv1 = c6 - let tv2 = Fp.pow(v, c4); // 2. tv2 = v^c4 - let tv3 = Fp.sqr(tv2); // 3. tv3 = tv2^2 - tv3 = Fp.mul(tv3, v); // 4. tv3 = tv3 * v - let tv5 = Fp.mul(u, tv3); // 5. tv5 = u * tv3 - tv5 = Fp.pow(tv5, c3); // 6. tv5 = tv5^c3 - tv5 = Fp.mul(tv5, tv2); // 7. tv5 = tv5 * tv2 - tv2 = Fp.mul(tv5, v); // 8. tv2 = tv5 * v - tv3 = Fp.mul(tv5, u); // 9. tv3 = tv5 * u - let tv4 = Fp.mul(tv3, tv2); // 10. tv4 = tv3 * tv2 - tv5 = Fp.pow(tv4, c5); // 11. tv5 = tv4^c5 - let isQR = Fp.eql(tv5, Fp.ONE); // 12. isQR = tv5 == 1 - tv2 = Fp.mul(tv3, c7); // 13. tv2 = tv3 * c7 - tv5 = Fp.mul(tv4, tv1); // 14. tv5 = tv4 * tv1 - tv3 = Fp.cmov(tv2, tv3, isQR); // 15. tv3 = CMOV(tv2, tv3, isQR) - tv4 = Fp.cmov(tv5, tv4, isQR); // 16. tv4 = CMOV(tv5, tv4, isQR) - // 17. for i in (c1, c1 - 1, ..., 2): - for (let i = c1; i > _1n; i--) { - let tv5 = i - _2n; // 18. tv5 = i - 2 - tv5 = _2n << (tv5 - _1n); // 19. tv5 = 2^tv5 - let tvv5 = Fp.pow(tv4, tv5); // 20. tv5 = tv4^tv5 - const e1 = Fp.eql(tvv5, Fp.ONE); // 21. e1 = tv5 == 1 - tv2 = Fp.mul(tv3, tv1); // 22. tv2 = tv3 * tv1 - tv1 = Fp.mul(tv1, tv1); // 23. tv1 = tv1 * tv1 - tvv5 = Fp.mul(tv4, tv1); // 24. tv5 = tv4 * tv1 - tv3 = Fp.cmov(tv2, tv3, e1); // 25. tv3 = CMOV(tv2, tv3, e1) - tv4 = Fp.cmov(tvv5, tv4, e1); // 26. tv4 = CMOV(tv5, tv4, e1) - } - return { isValid: isQR, value: tv3 }; - }; - if (Fp.ORDER % _4n === _3n) { - // sqrt_ratio_3mod4(u, v) - const c1 = (Fp.ORDER - _3n) / _4n; // 1. c1 = (q - 3) / 4 # Integer arithmetic - const c2 = Fp.sqrt(Fp.neg(Z)); // 2. c2 = sqrt(-Z) - sqrtRatio = (u: T, v: T) => { - let tv1 = Fp.sqr(v); // 1. tv1 = v^2 - const tv2 = Fp.mul(u, v); // 2. tv2 = u * v - tv1 = Fp.mul(tv1, tv2); // 3. tv1 = tv1 * tv2 - let y1 = Fp.pow(tv1, c1); // 4. y1 = tv1^c1 - y1 = Fp.mul(y1, tv2); // 5. y1 = y1 * tv2 - const y2 = Fp.mul(y1, c2); // 6. y2 = y1 * c2 - const tv3 = Fp.mul(Fp.sqr(y1), v); // 7. tv3 = y1^2; 8. tv3 = tv3 * v - const isQR = Fp.eql(tv3, u); // 9. isQR = tv3 == u - let y = Fp.cmov(y2, y1, isQR); // 10. y = CMOV(y2, y1, isQR) - return { isValid: isQR, value: y }; // 11. return (isQR, y) isQR ? y : y*c2 - }; - } - // No curves uses that - // if (Fp.ORDER % _8n === _5n) // sqrt_ratio_5mod8 - return sqrtRatio; -} -/** - * Simplified Shallue-van de Woestijne-Ulas Method - * https://www.rfc-editor.org/rfc/rfc9380#section-6.6.2 - */ -export function mapToCurveSimpleSWU( - Fp: IField, - opts: { - A: T; - B: T; - Z: T; - } -): (u: T) => { x: T; y: T } { - validateField(Fp); - const { A, B, Z } = opts; - if (!Fp.isValid(A) || !Fp.isValid(B) || !Fp.isValid(Z)) - throw new Error('mapToCurveSimpleSWU: invalid opts'); - const sqrtRatio = SWUFpSqrtRatio(Fp, Z); - if (!Fp.isOdd) throw new Error('Field does not have .isOdd()'); - // Input: u, an element of F. - // Output: (x, y), a point on E. - return (u: T): { x: T; y: T } => { - // prettier-ignore - let tv1, tv2, tv3, tv4, tv5, tv6, x, y; - tv1 = Fp.sqr(u); // 1. tv1 = u^2 - tv1 = Fp.mul(tv1, Z); // 2. tv1 = Z * tv1 - tv2 = Fp.sqr(tv1); // 3. tv2 = tv1^2 - tv2 = Fp.add(tv2, tv1); // 4. tv2 = tv2 + tv1 - tv3 = Fp.add(tv2, Fp.ONE); // 5. tv3 = tv2 + 1 - tv3 = Fp.mul(tv3, B); // 6. tv3 = B * tv3 - tv4 = Fp.cmov(Z, Fp.neg(tv2), !Fp.eql(tv2, Fp.ZERO)); // 7. tv4 = CMOV(Z, -tv2, tv2 != 0) - tv4 = Fp.mul(tv4, A); // 8. tv4 = A * tv4 - tv2 = Fp.sqr(tv3); // 9. tv2 = tv3^2 - tv6 = Fp.sqr(tv4); // 10. tv6 = tv4^2 - tv5 = Fp.mul(tv6, A); // 11. tv5 = A * tv6 - tv2 = Fp.add(tv2, tv5); // 12. tv2 = tv2 + tv5 - tv2 = Fp.mul(tv2, tv3); // 13. tv2 = tv2 * tv3 - tv6 = Fp.mul(tv6, tv4); // 14. tv6 = tv6 * tv4 - tv5 = Fp.mul(tv6, B); // 15. tv5 = B * tv6 - tv2 = Fp.add(tv2, tv5); // 16. tv2 = tv2 + tv5 - x = Fp.mul(tv1, tv3); // 17. x = tv1 * tv3 - const { isValid, value } = sqrtRatio(tv2, tv6); // 18. (is_gx1_square, y1) = sqrt_ratio(tv2, tv6) - y = Fp.mul(tv1, u); // 19. y = tv1 * u -> Z * u^3 * y1 - y = Fp.mul(y, value); // 20. y = y * y1 - x = Fp.cmov(x, tv3, isValid); // 21. x = CMOV(x, tv3, is_gx1_square) - y = Fp.cmov(y, value, isValid); // 22. y = CMOV(y, y1, is_gx1_square) - const e1 = Fp.isOdd!(u) === Fp.isOdd!(y); // 23. e1 = sgn0(u) == sgn0(y) - y = Fp.cmov(Fp.neg(y), y, e1); // 24. y = CMOV(-y, y, e1) - const tv4_inv = FpInvertBatch(Fp, [tv4], true)[0]; - x = Fp.mul(x, tv4_inv); // 25. x = x / tv4 - return { x, y }; - }; -} - -function getWLengths(Fp: IField, Fn: IField) { - return { - secretKey: Fn.BYTES, - publicKey: 1 + Fp.BYTES, - publicKeyUncompressed: 1 + 2 * Fp.BYTES, - publicKeyHasPrefix: true, - signature: 2 * Fn.BYTES, - }; -} - -/** - * Sometimes users only need getPublicKey, getSharedSecret, and secret key handling. - * This helper ensures no signature functionality is present. Less code, smaller bundle size. - */ -export function ecdh( - Point: WeierstrassPointCons, - ecdhOpts: { randomBytes?: (bytesLength?: number) => Uint8Array } = {} -): ECDH { - const { Fn } = Point; - const randomBytes_ = ecdhOpts.randomBytes || randomBytesWeb; - const lengths = Object.assign(getWLengths(Point.Fp, Fn), { seed: getMinHashLength(Fn.ORDER) }); - - function isValidSecretKey(secretKey: PrivKey) { - try { - return !!_normFnElement(Fn, secretKey); - } catch (error) { - return false; - } - } - - function isValidPublicKey(publicKey: Uint8Array, isCompressed?: boolean): boolean { - const { publicKey: comp, publicKeyUncompressed } = lengths; - try { - const l = publicKey.length; - if (isCompressed === true && l !== comp) return false; - if (isCompressed === false && l !== publicKeyUncompressed) return false; - return !!Point.fromBytes(publicKey); - } catch (error) { - return false; - } - } - - /** - * Produces cryptographically secure secret key from random of size - * (groupLen + ceil(groupLen / 2)) with modulo bias being negligible. - */ - function randomSecretKey(seed = randomBytes_(lengths.seed)): Uint8Array { - return mapHashToField(abytes(seed, lengths.seed, 'seed'), Fn.ORDER); - } - - /** - * Computes public key for a secret key. Checks for validity of the secret key. - * @param isCompressed whether to return compact (default), or full key - * @returns Public key, full when isCompressed=false; short when isCompressed=true - */ - function getPublicKey(secretKey: PrivKey, isCompressed = true): Uint8Array { - return Point.BASE.multiply(_normFnElement(Fn, secretKey)).toBytes(isCompressed); - } - - function keygen(seed?: Uint8Array) { - const secretKey = randomSecretKey(seed); - return { secretKey, publicKey: getPublicKey(secretKey) }; - } - - /** - * Quick and dirty check for item being public key. Does not validate hex, or being on-curve. - */ - function isProbPub(item: PrivKey | PubKey): boolean | undefined { - if (typeof item === 'bigint') return false; - if (item instanceof Point) return true; - const { secretKey, publicKey, publicKeyUncompressed } = lengths; - if (Fn.allowedLengths || secretKey === publicKey) return undefined; - const l = ensureBytes('key', item).length; - return l === publicKey || l === publicKeyUncompressed; - } - - /** - * ECDH (Elliptic Curve Diffie Hellman). - * Computes shared public key from secret key A and public key B. - * Checks: 1) secret key validity 2) shared key is on-curve. - * Does NOT hash the result. - * @param isCompressed whether to return compact (default), or full key - * @returns shared public key - */ - function getSharedSecret(secretKeyA: PrivKey, publicKeyB: Hex, isCompressed = true): Uint8Array { - if (isProbPub(secretKeyA) === true) throw new Error('first arg must be private key'); - if (isProbPub(publicKeyB) === false) throw new Error('second arg must be public key'); - const s = _normFnElement(Fn, secretKeyA); - const b = Point.fromHex(publicKeyB); // checks for being on-curve - return b.multiply(s).toBytes(isCompressed); - } - - const utils = { - isValidSecretKey, - isValidPublicKey, - randomSecretKey, - - // TODO: remove - isValidPrivateKey: isValidSecretKey, - randomPrivateKey: randomSecretKey, - normPrivateKeyToScalar: (key: PrivKey) => _normFnElement(Fn, key), - precompute(windowSize = 8, point = Point.BASE): WeierstrassPoint { - return point.precompute(windowSize, false); - }, - }; - - return Object.freeze({ getPublicKey, getSharedSecret, keygen, Point, utils, lengths }); -} - -/** - * Creates ECDSA signing interface for given elliptic curve `Point` and `hash` function. - * We need `hash` for 2 features: - * 1. Message prehash-ing. NOT used if `sign` / `verify` are called with `prehash: false` - * 2. k generation in `sign`, using HMAC-drbg(hash) - * - * ECDSAOpts are only rarely needed. - * - * @example - * ```js - * const p256_Point = weierstrass(...); - * const p256_sha256 = ecdsa(p256_Point, sha256); - * const p256_sha224 = ecdsa(p256_Point, sha224); - * const p256_sha224_r = ecdsa(p256_Point, sha224, { randomBytes: (length) => { ... } }); - * ``` - */ -export function ecdsa( - Point: WeierstrassPointCons, - hash: CHash, - ecdsaOpts: ECDSAOpts = {} -): ECDSA { - ahash(hash); - _validateObject( - ecdsaOpts, - {}, - { - hmac: 'function', - lowS: 'boolean', - randomBytes: 'function', - bits2int: 'function', - bits2int_modN: 'function', - } - ); - - const randomBytes = ecdsaOpts.randomBytes || randomBytesWeb; - const hmac: HmacFnSync = - ecdsaOpts.hmac || - (((key, ...msgs) => nobleHmac(hash, key, concatBytes(...msgs))) satisfies HmacFnSync); - - const { Fp, Fn } = Point; - const { ORDER: CURVE_ORDER, BITS: fnBits } = Fn; - const { keygen, getPublicKey, getSharedSecret, utils, lengths } = ecdh(Point, ecdsaOpts); - const defaultSigOpts: Required = { - prehash: false, - lowS: typeof ecdsaOpts.lowS === 'boolean' ? ecdsaOpts.lowS : false, - format: undefined as any, //'compact' as ECDSASigFormat, - extraEntropy: false, - }; - const defaultSigOpts_format = 'compact'; - - function isBiggerThanHalfOrder(number: bigint) { - const HALF = CURVE_ORDER >> _1n; - return number > HALF; - } - function validateRS(title: string, num: bigint): bigint { - if (!Fn.isValidNot0(num)) - throw new Error(`invalid signature ${title}: out of range 1..Point.Fn.ORDER`); - return num; - } - function validateSigLength(bytes: Uint8Array, format: ECDSASigFormat) { - validateSigFormat(format); - const size = lengths.signature!; - const sizer = format === 'compact' ? size : format === 'recovered' ? size + 1 : undefined; - return abytes(bytes, sizer, `${format} signature`); - } - - /** - * ECDSA signature with its (r, s) properties. Supports compact, recovered & DER representations. - */ - class Signature implements ECDSASignature { - readonly r: bigint; - readonly s: bigint; - readonly recovery?: number; - constructor(r: bigint, s: bigint, recovery?: number) { - this.r = validateRS('r', r); // r in [1..N-1]; - this.s = validateRS('s', s); // s in [1..N-1]; - if (recovery != null) this.recovery = recovery; - Object.freeze(this); - } - - static fromBytes(bytes: Uint8Array, format: ECDSASigFormat = defaultSigOpts_format): Signature { - validateSigLength(bytes, format); - let recid: number | undefined; - if (format === 'der') { - const { r, s } = DER.toSig(abytes(bytes)); - return new Signature(r, s); - } - if (format === 'recovered') { - recid = bytes[0]; - format = 'compact'; - bytes = bytes.subarray(1); - } - const L = Fn.BYTES; - const r = bytes.subarray(0, L); - const s = bytes.subarray(L, L * 2); - return new Signature(Fn.fromBytes(r), Fn.fromBytes(s), recid); - } - - static fromHex(hex: string, format?: ECDSASigFormat) { - return this.fromBytes(hexToBytes(hex), format); - } - - addRecoveryBit(recovery: number): RecoveredSignature { - return new Signature(this.r, this.s, recovery) as RecoveredSignature; - } - - recoverPublicKey(messageHash: Hex): WeierstrassPoint { - const FIELD_ORDER = Fp.ORDER; - const { r, s, recovery: rec } = this; - if (rec == null || ![0, 1, 2, 3].includes(rec)) throw new Error('recovery id invalid'); - - // ECDSA recovery is hard for cofactor > 1 curves. - // In sign, `r = q.x mod n`, and here we recover q.x from r. - // While recovering q.x >= n, we need to add r+n for cofactor=1 curves. - // However, for cofactor>1, r+n may not get q.x: - // r+n*i would need to be done instead where i is unknown. - // To easily get i, we either need to: - // a. increase amount of valid recid values (4, 5...); OR - // b. prohibit non-prime-order signatures (recid > 1). - const hasCofactor = CURVE_ORDER * _2n < FIELD_ORDER; - if (hasCofactor && rec > 1) throw new Error('recovery id is ambiguous for h>1 curve'); - - const radj = rec === 2 || rec === 3 ? r + CURVE_ORDER : r; - if (!Fp.isValid(radj)) throw new Error('recovery id 2 or 3 invalid'); - const x = Fp.toBytes(radj); - const R = Point.fromBytes(concatBytes(pprefix((rec & 1) === 0), x)); - const ir = Fn.inv(radj); // r^-1 - const h = bits2int_modN(ensureBytes('msgHash', messageHash)); // Truncate hash - const u1 = Fn.create(-h * ir); // -hr^-1 - const u2 = Fn.create(s * ir); // sr^-1 - // (sr^-1)R-(hr^-1)G = -(hr^-1)G + (sr^-1). unsafe is fine: there is no private data. - const Q = Point.BASE.multiplyUnsafe(u1).add(R.multiplyUnsafe(u2)); - if (Q.is0()) throw new Error('point at infinify'); - Q.assertValidity(); - return Q; - } - - // Signatures should be low-s, to prevent malleability. - hasHighS(): boolean { - return isBiggerThanHalfOrder(this.s); - } - - toBytes(format: ECDSASigFormat = defaultSigOpts_format) { - validateSigFormat(format); - if (format === 'der') return hexToBytes(DER.hexFromSig(this)); - const r = Fn.toBytes(this.r); - const s = Fn.toBytes(this.s); - if (format === 'recovered') { - if (this.recovery == null) throw new Error('recovery bit must be present'); - return concatBytes(Uint8Array.of(this.recovery), r, s); - } - return concatBytes(r, s); - } - - toHex(format?: ECDSASigFormat) { - return bytesToHex(this.toBytes(format)); - } - - // TODO: remove - assertValidity(): void {} - static fromCompact(hex: Hex) { - return Signature.fromBytes(ensureBytes('sig', hex), 'compact'); - } - static fromDER(hex: Hex) { - return Signature.fromBytes(ensureBytes('sig', hex), 'der'); - } - normalizeS() { - return this.hasHighS() ? new Signature(this.r, Fn.neg(this.s), this.recovery) : this; - } - toDERRawBytes() { - return this.toBytes('der'); - } - toDERHex() { - return bytesToHex(this.toBytes('der')); - } - toCompactRawBytes() { - return this.toBytes('compact'); - } - toCompactHex() { - return bytesToHex(this.toBytes('compact')); - } - } - type RecoveredSignature = Signature & { recovery: number }; - - // RFC6979: ensure ECDSA msg is X bytes and < N. RFC suggests optional truncating via bits2octets. - // FIPS 186-4 4.6 suggests the leftmost min(nBitLen, outLen) bits, which matches bits2int. - // bits2int can produce res>N, we can do mod(res, N) since the bitLen is the same. - // int2octets can't be used; pads small msgs with 0: unacceptatble for trunc as per RFC vectors - const bits2int = - ecdsaOpts.bits2int || - function bits2int_def(bytes: Uint8Array): bigint { - // Our custom check "just in case", for protection against DoS - if (bytes.length > 8192) throw new Error('input is too large'); - // For curves with nBitLength % 8 !== 0: bits2octets(bits2octets(m)) !== bits2octets(m) - // for some cases, since bytes.length * 8 is not actual bitLength. - const num = bytesToNumberBE(bytes); // check for == u8 done here - const delta = bytes.length * 8 - fnBits; // truncate to nBitLength leftmost bits - return delta > 0 ? num >> BigInt(delta) : num; - }; - const bits2int_modN = - ecdsaOpts.bits2int_modN || - function bits2int_modN_def(bytes: Uint8Array): bigint { - return Fn.create(bits2int(bytes)); // can't use bytesToNumberBE here - }; - // Pads output with zero as per spec - const ORDER_MASK = bitMask(fnBits); - /** Converts to bytes. Checks if num in `[0..ORDER_MASK-1]` e.g.: `[0..2^256-1]`. */ - function int2octets(num: bigint): Uint8Array { - // IMPORTANT: the check ensures working for case `Fn.BYTES != Fn.BITS * 8` - aInRange('num < 2^' + fnBits, num, _0n, ORDER_MASK); - return Fn.toBytes(num); - } - - function validateMsgAndHash(message: Uint8Array, prehash: boolean) { - abytes(message, undefined, 'message'); - return prehash ? abytes(hash(message), undefined, 'prehashed message') : message; - } - - /** - * Steps A, D of RFC6979 3.2. - * Creates RFC6979 seed; converts msg/privKey to numbers. - * Used only in sign, not in verify. - * - * Warning: we cannot assume here that message has same amount of bytes as curve order, - * this will be invalid at least for P521. Also it can be bigger for P224 + SHA256. - */ - function prepSig(message: Uint8Array, privateKey: PrivKey, opts: ECDSASignOpts) { - if (['recovered', 'canonical'].some((k) => k in opts)) - throw new Error('sign() legacy options not supported'); - const { lowS, prehash, extraEntropy } = validateSigOpts(opts, defaultSigOpts); - message = validateMsgAndHash(message, prehash); // RFC6979 3.2 A: h1 = H(m) - // We can't later call bits2octets, since nested bits2int is broken for curves - // with fnBits % 8 !== 0. Because of that, we unwrap it here as int2octets call. - // const bits2octets = (bits) => int2octets(bits2int_modN(bits)) - const h1int = bits2int_modN(message); - const d = _normFnElement(Fn, privateKey); // validate secret key, convert to bigint - const seedArgs = [int2octets(d), int2octets(h1int)]; - // extraEntropy. RFC6979 3.6: additional k' (optional). - if (extraEntropy != null && extraEntropy !== false) { - // K = HMAC_K(V || 0x00 || int2octets(x) || bits2octets(h1) || k') - // gen random bytes OR pass as-is - const e = extraEntropy === true ? randomBytes(lengths.secretKey) : extraEntropy; - seedArgs.push(ensureBytes('extraEntropy', e)); // check for being bytes - } - const seed = concatBytes(...seedArgs); // Step D of RFC6979 3.2 - const m = h1int; // NOTE: no need to call bits2int second time here, it is inside truncateHash! - // Converts signature params into point w r/s, checks result for validity. - // To transform k => Signature: - // q = k⋅G - // r = q.x mod n - // s = k^-1(m + rd) mod n - // Can use scalar blinding b^-1(bm + bdr) where b ∈ [1,q−1] according to - // https://tches.iacr.org/index.php/TCHES/article/view/7337/6509. We've decided against it: - // a) dependency on CSPRNG b) 15% slowdown c) doesn't really help since bigints are not CT - function k2sig(kBytes: Uint8Array): RecoveredSignature | undefined { - // RFC 6979 Section 3.2, step 3: k = bits2int(T) - // Important: all mod() calls here must be done over N - const k = bits2int(kBytes); // mod n, not mod p - if (!Fn.isValidNot0(k)) return; // Valid scalars (including k) must be in 1..N-1 - const ik = Fn.inv(k); // k^-1 mod n - const q = Point.BASE.multiply(k).toAffine(); // q = k⋅G - const r = Fn.create(q.x); // r = q.x mod n - if (r === _0n) return; - const s = Fn.create(ik * Fn.create(m + r * d)); // Not using blinding here, see comment above - if (s === _0n) return; - let recovery = (q.x === r ? 0 : 2) | Number(q.y & _1n); // recovery bit (2 or 3, when q.x > n) - let normS = s; - if (lowS && isBiggerThanHalfOrder(s)) { - normS = Fn.neg(s); // if lowS was passed, ensure s is always - recovery ^= 1; // // in the bottom half of N - } - return new Signature(r, normS, recovery) as RecoveredSignature; // use normS, not s - } - return { seed, k2sig }; - } - - /** - * Signs message hash with a secret key. - * - * ``` - * sign(m, d) where - * k = rfc6979_hmac_drbg(m, d) - * (x, y) = G × k - * r = x mod n - * s = (m + dr) / k mod n - * ``` - */ - function sign(message: Hex, secretKey: PrivKey, opts: ECDSASignOpts = {}): RecoveredSignature { - message = ensureBytes('message', message); - const { seed, k2sig } = prepSig(message, secretKey, opts); // Steps A, D of RFC6979 3.2. - const drbg = createHmacDrbg(hash.outputLen, Fn.BYTES, hmac); - const sig = drbg(seed, k2sig); // Steps B, C, D, E, F, G - return sig; - } - - function tryParsingSig(sg: Hex | SignatureLike) { - // Try to deduce format - let sig: Signature | undefined = undefined; - const isHex = typeof sg === 'string' || isBytes(sg); - const isObj = - !isHex && - sg !== null && - typeof sg === 'object' && - typeof sg.r === 'bigint' && - typeof sg.s === 'bigint'; - if (!isHex && !isObj) - throw new Error('invalid signature, expected Uint8Array, hex string or Signature instance'); - if (isObj) { - sig = new Signature(sg.r, sg.s); - } else if (isHex) { - try { - sig = Signature.fromBytes(ensureBytes('sig', sg), 'der'); - } catch (derError) { - if (!(derError instanceof DER.Err)) throw derError; - } - if (!sig) { - try { - sig = Signature.fromBytes(ensureBytes('sig', sg), 'compact'); - } catch (error) { - return false; - } - } - } - if (!sig) return false; - return sig; - } - - /** - * Verifies a signature against message and public key. - * Rejects lowS signatures by default: see {@link ECDSAVerifyOpts}. - * Implements section 4.1.4 from https://www.secg.org/sec1-v2.pdf: - * - * ``` - * verify(r, s, h, P) where - * u1 = hs^-1 mod n - * u2 = rs^-1 mod n - * R = u1⋅G + u2⋅P - * mod(R.x, n) == r - * ``` - */ - function verify( - signature: Hex | SignatureLike, - message: Hex, - publicKey: Hex, - opts: ECDSAVerifyOpts = {} - ): boolean { - const { lowS, prehash, format } = validateSigOpts(opts, defaultSigOpts); - publicKey = ensureBytes('publicKey', publicKey); - message = validateMsgAndHash(ensureBytes('message', message), prehash); - if ('strict' in opts) throw new Error('options.strict was renamed to lowS'); - const sig = - format === undefined - ? tryParsingSig(signature) - : Signature.fromBytes(ensureBytes('sig', signature as Hex), format); - if (sig === false) return false; - try { - const P = Point.fromBytes(publicKey); - if (lowS && sig.hasHighS()) return false; - const { r, s } = sig; - const h = bits2int_modN(message); // mod n, not mod p - const is = Fn.inv(s); // s^-1 mod n - const u1 = Fn.create(h * is); // u1 = hs^-1 mod n - const u2 = Fn.create(r * is); // u2 = rs^-1 mod n - const R = Point.BASE.multiplyUnsafe(u1).add(P.multiplyUnsafe(u2)); // u1⋅G + u2⋅P - if (R.is0()) return false; - const v = Fn.create(R.x); // v = r.x mod n - return v === r; - } catch (e) { - return false; - } - } - - function recoverPublicKey( - signature: Uint8Array, - message: Uint8Array, - opts: ECDSARecoverOpts = {} - ): Uint8Array { - const { prehash } = validateSigOpts(opts, defaultSigOpts); - message = validateMsgAndHash(message, prehash); - return Signature.fromBytes(signature, 'recovered').recoverPublicKey(message).toBytes(); - } - - return Object.freeze({ - keygen, - getPublicKey, - getSharedSecret, - utils, - lengths, - Point, - sign, - verify, - recoverPublicKey, - Signature, - hash, - }); -} - -// TODO: remove everything below -/** @deprecated use ECDSASignature */ -export type SignatureType = ECDSASignature; -/** @deprecated use ECDSASigRecovered */ -export type RecoveredSignatureType = ECDSASigRecovered; -/** @deprecated switch to Uint8Array signatures in format 'compact' */ -export type SignatureLike = { r: bigint; s: bigint }; -export type ECDSAExtraEntropy = Hex | boolean; -/** @deprecated use `ECDSAExtraEntropy` */ -export type Entropy = Hex | boolean; -export type BasicWCurve = BasicCurve & { - // Params: a, b - a: T; - b: T; - - // Optional params - allowedPrivateKeyLengths?: readonly number[]; // for P521 - wrapPrivateKey?: boolean; // bls12-381 requires mod(n) instead of rejecting keys >= n - endo?: EndomorphismOpts; - // When a cofactor != 1, there can be an effective methods to: - // 1. Determine whether a point is torsion-free - isTorsionFree?: (c: WeierstrassPointCons, point: WeierstrassPoint) => boolean; - // 2. Clear torsion component - clearCofactor?: (c: WeierstrassPointCons, point: WeierstrassPoint) => WeierstrassPoint; -}; -/** @deprecated use ECDSASignOpts */ -export type SignOpts = ECDSASignOpts; -/** @deprecated use ECDSASignOpts */ -export type VerOpts = ECDSAVerifyOpts; - -/** @deprecated use WeierstrassPoint */ -export type ProjPointType = WeierstrassPoint; -/** @deprecated use WeierstrassPointCons */ -export type ProjConstructor = WeierstrassPointCons; -/** @deprecated use ECDSASignatureCons */ -export type SignatureConstructor = ECDSASignatureCons; - -// TODO: remove -export type CurvePointsType = BasicWCurve & { - fromBytes?: (bytes: Uint8Array) => AffinePoint; - toBytes?: ( - c: WeierstrassPointCons, - point: WeierstrassPoint, - isCompressed: boolean - ) => Uint8Array; -}; - -// LegacyWeierstrassOpts -export type CurvePointsTypeWithLength = Readonly & Partial>; - -// LegacyWeierstrass -export type CurvePointsRes = { - Point: WeierstrassPointCons; - - /** @deprecated use `Point.CURVE()` */ - CURVE: CurvePointsType; - /** @deprecated use `Point` */ - ProjectivePoint: WeierstrassPointCons; - /** @deprecated use `Point.Fn.fromBytes(privateKey)` */ - normPrivateKeyToScalar: (key: PrivKey) => bigint; - /** @deprecated */ - weierstrassEquation: (x: T) => T; - /** @deprecated use `Point.Fn.isValidNot0(num)` */ - isWithinCurveOrder: (num: bigint) => boolean; -}; - -// Aliases to legacy types -// export type CurveType = LegacyECDSAOpts; -// export type CurveFn = LegacyECDSA; -// export type CurvePointsRes = LegacyWeierstrass; -// export type CurvePointsType = LegacyWeierstrassOpts; -// export type CurvePointsTypeWithLength = LegacyWeierstrassOpts; -// export type BasicWCurve = LegacyWeierstrassOpts; - -/** @deprecated use `Uint8Array` */ -export type PubKey = Hex | WeierstrassPoint; -export type CurveType = BasicWCurve & { - hash: CHash; // CHash not FHash because we need outputLen for DRBG - hmac?: HmacFnSync; - randomBytes?: (bytesLength?: number) => Uint8Array; - lowS?: boolean; - bits2int?: (bytes: Uint8Array) => bigint; - bits2int_modN?: (bytes: Uint8Array) => bigint; -}; -export type CurveFn = { - /** @deprecated use `Point.CURVE()` */ - CURVE: CurvePointsType; - keygen: ECDSA['keygen']; - getPublicKey: ECDSA['getPublicKey']; - getSharedSecret: ECDSA['getSharedSecret']; - sign: ECDSA['sign']; - verify: ECDSA['verify']; - Point: WeierstrassPointCons; - /** @deprecated use `Point` */ - ProjectivePoint: WeierstrassPointCons; - Signature: ECDSASignatureCons; - utils: ECDSA['utils']; - lengths: ECDSA['lengths']; -}; -/** @deprecated use `weierstrass` in newer releases */ -export function weierstrassPoints(c: CurvePointsTypeWithLength): CurvePointsRes { - const { CURVE, curveOpts } = _weierstrass_legacy_opts_to_new(c); - const Point = weierstrassN(CURVE, curveOpts); - return _weierstrass_new_output_to_legacy(c, Point); -} -export type WsPointComposed = { - CURVE: WeierstrassOpts; - curveOpts: WeierstrassExtraOpts; -}; -export type WsComposed = { - /** @deprecated use `Point.CURVE()` */ - CURVE: WeierstrassOpts; - hash: CHash; - curveOpts: WeierstrassExtraOpts; - ecdsaOpts: ECDSAOpts; -}; -function _weierstrass_legacy_opts_to_new(c: CurvePointsType): WsPointComposed { - const CURVE: WeierstrassOpts = { - a: c.a, - b: c.b, - p: c.Fp.ORDER, - n: c.n, - h: c.h, - Gx: c.Gx, - Gy: c.Gy, - }; - const Fp = c.Fp; - let allowedLengths = c.allowedPrivateKeyLengths - ? Array.from(new Set(c.allowedPrivateKeyLengths.map((l) => Math.ceil(l / 2)))) - : undefined; - const Fn = Field(CURVE.n, { - BITS: c.nBitLength, - allowedLengths: allowedLengths, - modFromBytes: c.wrapPrivateKey, - }); - const curveOpts: WeierstrassExtraOpts = { - Fp, - Fn, - allowInfinityPoint: c.allowInfinityPoint, - endo: c.endo, - isTorsionFree: c.isTorsionFree, - clearCofactor: c.clearCofactor, - fromBytes: c.fromBytes, - toBytes: c.toBytes, - }; - return { CURVE, curveOpts }; -} -function _ecdsa_legacy_opts_to_new(c: CurveType): WsComposed { - const { CURVE, curveOpts } = _weierstrass_legacy_opts_to_new(c); - const ecdsaOpts: ECDSAOpts = { - hmac: c.hmac, - randomBytes: c.randomBytes, - lowS: c.lowS, - bits2int: c.bits2int, - bits2int_modN: c.bits2int_modN, - }; - return { CURVE, curveOpts, hash: c.hash, ecdsaOpts }; -} -export function _legacyHelperEquat(Fp: IField, a: T, b: T): (x: T) => T { - /** - * y² = x³ + ax + b: Short weierstrass curve formula. Takes x, returns y². - * @returns y² - */ - function weierstrassEquation(x: T): T { - const x2 = Fp.sqr(x); // x * x - const x3 = Fp.mul(x2, x); // x² * x - return Fp.add(Fp.add(x3, Fp.mul(x, a)), b); // x³ + a * x + b - } - return weierstrassEquation; -} -function _weierstrass_new_output_to_legacy( - c: CurvePointsType, - Point: WeierstrassPointCons -): CurvePointsRes { - const { Fp, Fn } = Point; - function isWithinCurveOrder(num: bigint): boolean { - return inRange(num, _1n, Fn.ORDER); - } - const weierstrassEquation = _legacyHelperEquat(Fp, c.a, c.b); - return Object.assign( - {}, - { - CURVE: c, - Point: Point, - ProjectivePoint: Point, - normPrivateKeyToScalar: (key: PrivKey) => _normFnElement(Fn, key), - weierstrassEquation, - isWithinCurveOrder, - } - ); -} -function _ecdsa_new_output_to_legacy(c: CurveType, _ecdsa: ECDSA): CurveFn { - const Point = _ecdsa.Point; - return Object.assign({}, _ecdsa, { - ProjectivePoint: Point, - CURVE: Object.assign({}, c, nLength(Point.Fn.ORDER, Point.Fn.BITS)), - }); -} - -// _ecdsa_legacy -export function weierstrass(c: CurveType): CurveFn { - const { CURVE, curveOpts, hash, ecdsaOpts } = _ecdsa_legacy_opts_to_new(c); - const Point = weierstrassN(CURVE, curveOpts); - const signs = ecdsa(Point, hash, ecdsaOpts); - return _ecdsa_new_output_to_legacy(c, signs); -} diff --git a/tools/mnemonic-test/node_modules/@noble/curves/src/bls12-381.ts b/tools/mnemonic-test/node_modules/@noble/curves/src/bls12-381.ts deleted file mode 100644 index cb8d6aa2..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/src/bls12-381.ts +++ /dev/null @@ -1,781 +0,0 @@ -/** - * bls12-381 is pairing-friendly Barreto-Lynn-Scott elliptic curve construction allowing to: - -* Construct zk-SNARKs at the ~120-bit security, as per [Barbulescu-Duquesne 2017](https://hal.science/hal-01534101/file/main.pdf) -* Efficiently verify N aggregate signatures with 1 pairing and N ec additions: -the Boneh-Lynn-Shacham signature scheme is orders of magnitude more efficient than Schnorr - -BLS can mean 2 different things: - -* Barreto-Lynn-Scott: BLS12, a Pairing Friendly Elliptic Curve -* Boneh-Lynn-Shacham: A Signature Scheme. - -### Summary - -1. BLS Relies on expensive bilinear pairing -2. Secret Keys: 32 bytes -3. Public Keys: 48 OR 96 bytes - big-endian x coordinate of point on G1 OR G2 curve -4. Signatures: 96 OR 48 bytes - big-endian x coordinate of point on G2 OR G1 curve -5. The 12 stands for the Embedding degree. - -Modes of operation: - -* Long signatures: 48-byte keys + 96-byte sigs (G1 keys + G2 sigs). -* Short signatures: 96-byte keys + 48-byte sigs (G2 keys + G1 sigs). - -### Formulas - -- `P = pk x G` - public keys -- `S = pk x H(m)` - signing, uses hash-to-curve on m -- `e(P, H(m)) == e(G, S)` - verification using pairings -- `e(G, S) = e(G, SUM(n)(Si)) = MUL(n)(e(G, Si))` - signature aggregation - -### Curves - -G1 is ordinary elliptic curve. G2 is extension field curve, think "over complex numbers". - -- G1: y² = x³ + 4 -- G2: y² = x³ + 4(u + 1) where u = √−1; r-order subgroup of E'(Fp²), M-type twist - -### Towers - -Pairing G1 + G2 produces element in Fp₁₂, 12-degree polynomial. -Fp₁₂ is usually implemented using tower of lower-degree polynomials for speed. - -- Fp₁₂ = Fp₆² => Fp₂³ -- Fp(u) / (u² - β) where β = -1 -- Fp₂(v) / (v³ - ξ) where ξ = u + 1 -- Fp₆(w) / (w² - γ) where γ = v -- Fp²[u] = Fp/u²+1 -- Fp⁶[v] = Fp²/v³-1-u -- Fp¹²[w] = Fp⁶/w²-v - -### Params - -* Embedding degree (k): 12 -* Seed is sometimes named x or t -* t = -15132376222941642752 -* p = (t-1)² * (t⁴-t²+1)/3 + t -* r = t⁴-t²+1 -* Ate loop size: X - -To verify curve parameters, see -[pairing-friendly-curves spec](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-pairing-friendly-curves-11). -Basic math is done over finite fields over p. -More complicated math is done over polynominal extension fields. - -### Compatibility and notes -1. It is compatible with Algorand, Chia, Dfinity, Ethereum, Filecoin, ZEC. -Filecoin uses little endian byte arrays for secret keys - make sure to reverse byte order. -2. Make sure to correctly select mode: "long signature" or "short signature". -3. Compatible with specs: - RFC 9380, - [cfrg-pairing-friendly-curves-11](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-pairing-friendly-curves-11), - [cfrg-bls-signature-05](https://datatracker.ietf.org/doc/draft-irtf-cfrg-bls-signature/). - - * - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { sha256 } from '@noble/hashes/sha2.js'; -import { bls, type CurveFn } from './abstract/bls.ts'; -import { Field, type IField } from './abstract/modular.ts'; -import { - abytes, - bitLen, - bitMask, - bytesToHex, - bytesToNumberBE, - concatBytes, - ensureBytes, - numberToBytesBE, - type Hex, -} from './utils.ts'; -// Types -import { isogenyMap } from './abstract/hash-to-curve.ts'; -import type { BigintTuple, Fp, Fp12, Fp2, Fp6 } from './abstract/tower.ts'; -import { psiFrobenius, tower12 } from './abstract/tower.ts'; -import { - mapToCurveSimpleSWU, - type AffinePoint, - type WeierstrassOpts, - type WeierstrassPoint, - type WeierstrassPointCons, -} from './abstract/weierstrass.ts'; - -// Be friendly to bad ECMAScript parsers by not using bigint literals -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = BigInt(4); - -// To verify math: -// https://tools.ietf.org/html/draft-irtf-cfrg-pairing-friendly-curves-11 - -// The BLS parameter x (seed) for BLS12-381. NOTE: it is negative! -// x = -2^63 - 2^62 - 2^60 - 2^57 - 2^48 - 2^16 -const BLS_X = BigInt('0xd201000000010000'); -// t = x (called differently in different places) -// const t = -BLS_X; -const BLS_X_LEN = bitLen(BLS_X); - -// a=0, b=4 -// P is characteristic of field Fp, in which curve calculations are done. -// p = (t-1)² * (t⁴-t²+1)/3 + t -// bls12_381_Fp = (t-1n)**2n * (t**4n - t**2n + 1n) / 3n + t -// r*h is curve order, amount of points on curve, -// where r is order of prime subgroup and h is cofactor. -// r = t⁴-t²+1 -// r = (t**4n - t**2n + 1n) -// cofactor h of G1: (t - 1)²/3 -// cofactorG1 = (t-1n)**2n/3n -// x = 3685416753713387016781088315183077757961620795782546409894578378688607592378376318836054947676345821548104185464507 -// y = 1339506544944476473020471379941921221584933875938349620426543736416511423956333506472724655353366534992391756441569 -const bls12_381_CURVE_G1: WeierstrassOpts = { - p: BigInt( - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab' - ), - n: BigInt('0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001'), - h: BigInt('0x396c8c005555e1568c00aaab0000aaab'), - a: _0n, - b: _4n, - Gx: BigInt( - '0x17f1d3a73197d7942695638c4fa9ac0fc3688c4f9774b905a14e3a3f171bac586c55e83ff97a1aeffb3af00adb22c6bb' - ), - Gy: BigInt( - '0x08b3f481e3aaa0f1a09e30ed741d8ae4fcf5e095d5d00af600db18cb2c04b3edd03cc744a2888ae40caa232946c5e7e1' - ), -}; - -// CURVE FIELDS -export const bls12_381_Fr: IField = Field(bls12_381_CURVE_G1.n, { - modFromBytes: true, - isLE: true, -}); -const { Fp, Fp2, Fp6, Fp12 } = tower12({ - ORDER: bls12_381_CURVE_G1.p, - X_LEN: BLS_X_LEN, - // Finite extension field over irreducible polynominal. - // Fp(u) / (u² - β) where β = -1 - FP2_NONRESIDUE: [_1n, _1n], - Fp2mulByB: ({ c0, c1 }) => { - const t0 = Fp.mul(c0, _4n); // 4 * c0 - const t1 = Fp.mul(c1, _4n); // 4 * c1 - // (T0-T1) + (T0+T1)*i - return { c0: Fp.sub(t0, t1), c1: Fp.add(t0, t1) }; - }, - Fp12finalExponentiate: (num) => { - const x = BLS_X; - // this^(q⁶) / this - const t0 = Fp12.div(Fp12.frobeniusMap(num, 6), num); - // t0^(q²) * t0 - const t1 = Fp12.mul(Fp12.frobeniusMap(t0, 2), t0); - const t2 = Fp12.conjugate(Fp12._cyclotomicExp(t1, x)); - const t3 = Fp12.mul(Fp12.conjugate(Fp12._cyclotomicSquare(t1)), t2); - const t4 = Fp12.conjugate(Fp12._cyclotomicExp(t3, x)); - const t5 = Fp12.conjugate(Fp12._cyclotomicExp(t4, x)); - const t6 = Fp12.mul(Fp12.conjugate(Fp12._cyclotomicExp(t5, x)), Fp12._cyclotomicSquare(t2)); - const t7 = Fp12.conjugate(Fp12._cyclotomicExp(t6, x)); - const t2_t5_pow_q2 = Fp12.frobeniusMap(Fp12.mul(t2, t5), 2); - const t4_t1_pow_q3 = Fp12.frobeniusMap(Fp12.mul(t4, t1), 3); - const t6_t1c_pow_q1 = Fp12.frobeniusMap(Fp12.mul(t6, Fp12.conjugate(t1)), 1); - const t7_t3c_t1 = Fp12.mul(Fp12.mul(t7, Fp12.conjugate(t3)), t1); - // (t2 * t5)^(q²) * (t4 * t1)^(q³) * (t6 * t1.conj)^(q^1) * t7 * t3.conj * t1 - return Fp12.mul(Fp12.mul(Fp12.mul(t2_t5_pow_q2, t4_t1_pow_q3), t6_t1c_pow_q1), t7_t3c_t1); - }, -}); - -// GLV endomorphism Ψ(P), for fast cofactor clearing -const { G2psi, G2psi2 } = psiFrobenius(Fp, Fp2, Fp2.div(Fp2.ONE, Fp2.NONRESIDUE)); // 1/(u+1) - -/** - * Default hash_to_field / hash-to-curve for BLS. - * m: 1 for G1, 2 for G2 - * k: target security level in bits - * hash: any function, e.g. BBS+ uses BLAKE2: see [github](https://github.com/hyperledger/aries-framework-go/issues/2247). - * Parameter values come from [section 8.8.2 of RFC 9380](https://www.rfc-editor.org/rfc/rfc9380#section-8.8.2). - */ -const htfDefaults = Object.freeze({ - DST: 'BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_NUL_', - encodeDST: 'BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_NUL_', - p: Fp.ORDER, - m: 2, - k: 128, - expand: 'xmd', - hash: sha256, -}); - -// a=0, b=4 -// cofactor h of G2 -// (t^8 - 4t^7 + 5t^6 - 4t^4 + 6t^3 - 4t^2 - 4t + 13)/9 -// cofactorG2 = (t**8n - 4n*t**7n + 5n*t**6n - 4n*t**4n + 6n*t**3n - 4n*t**2n - 4n*t+13n)/9n -// x = 3059144344244213709971259814753781636986470325476647558659373206291635324768958432433509563104347017837885763365758*u + 352701069587466618187139116011060144890029952792775240219908644239793785735715026873347600343865175952761926303160 -// y = 927553665492332455747201965776037880757740193453592970025027978793976877002675564980949289727957565575433344219582*u + 1985150602287291935568054521177171638300868978215655730859378665066344726373823718423869104263333984641494340347905 -const bls12_381_CURVE_G2 = { - p: Fp2.ORDER, - n: bls12_381_CURVE_G1.n, - h: BigInt( - '0x5d543a95414e7f1091d50792876a202cd91de4547085abaa68a205b2e5a7ddfa628f1cb4d9e82ef21537e293a6691ae1616ec6e786f0c70cf1c38e31c7238e5' - ), - a: Fp2.ZERO, - b: Fp2.fromBigTuple([_4n, _4n]), - Gx: Fp2.fromBigTuple([ - BigInt( - '0x024aa2b2f08f0a91260805272dc51051c6e47ad4fa403b02b4510b647ae3d1770bac0326a805bbefd48056c8c121bdb8' - ), - BigInt( - '0x13e02b6052719f607dacd3a088274f65596bd0d09920b61ab5da61bbdc7f5049334cf11213945d57e5ac7d055d042b7e' - ), - ]), - Gy: Fp2.fromBigTuple([ - BigInt( - '0x0ce5d527727d6e118cc9cdc6da2e351aadfd9baa8cbdd3a76d429a695160d12c923ac9cc3baca289e193548608b82801' - ), - BigInt( - '0x0606c4a02ea734cc32acd2b02bc28b99cb3e287e85a763af267492ab572e99ab3f370d275cec1da1aaa9075ff05f79be' - ), - ]), -}; - -// Encoding utils -// Compressed point of infinity -// Set compressed & point-at-infinity bits -const COMPZERO = setMask(Fp.toBytes(_0n), { infinity: true, compressed: true }); - -function parseMask(bytes: Uint8Array) { - // Copy, so we can remove mask data. It will be removed also later, when Fp.create will call modulo. - bytes = bytes.slice(); - const mask = bytes[0] & 0b1110_0000; - const compressed = !!((mask >> 7) & 1); // compression bit (0b1000_0000) - const infinity = !!((mask >> 6) & 1); // point at infinity bit (0b0100_0000) - const sort = !!((mask >> 5) & 1); // sort bit (0b0010_0000) - bytes[0] &= 0b0001_1111; // clear mask (zero first 3 bits) - return { compressed, infinity, sort, value: bytes }; -} - -function setMask( - bytes: Uint8Array, - mask: { compressed?: boolean; infinity?: boolean; sort?: boolean } -) { - if (bytes[0] & 0b1110_0000) throw new Error('setMask: non-empty mask'); - if (mask.compressed) bytes[0] |= 0b1000_0000; - if (mask.infinity) bytes[0] |= 0b0100_0000; - if (mask.sort) bytes[0] |= 0b0010_0000; - return bytes; -} - -function pointG1ToBytes( - _c: WeierstrassPointCons, - point: WeierstrassPoint, - isComp: boolean -) { - const { BYTES: L, ORDER: P } = Fp; - const is0 = point.is0(); - const { x, y } = point.toAffine(); - if (isComp) { - if (is0) return COMPZERO.slice(); - const sort = Boolean((y * _2n) / P); - return setMask(numberToBytesBE(x, L), { compressed: true, sort }); - } else { - if (is0) { - return concatBytes(Uint8Array.of(0x40), new Uint8Array(2 * L - 1)); - } else { - return concatBytes(numberToBytesBE(x, L), numberToBytesBE(y, L)); - } - } -} - -function signatureG1ToBytes(point: WeierstrassPoint) { - point.assertValidity(); - const { BYTES: L, ORDER: P } = Fp; - const { x, y } = point.toAffine(); - if (point.is0()) return COMPZERO.slice(); - const sort = Boolean((y * _2n) / P); - return setMask(numberToBytesBE(x, L), { compressed: true, sort }); -} - -function pointG1FromBytes(bytes: Uint8Array): AffinePoint { - const { compressed, infinity, sort, value } = parseMask(bytes); - const { BYTES: L, ORDER: P } = Fp; - if (value.length === 48 && compressed) { - const compressedValue = bytesToNumberBE(value); - // Zero - const x = Fp.create(compressedValue & bitMask(Fp.BITS)); - if (infinity) { - if (x !== _0n) throw new Error('invalid G1 point: non-empty, at infinity, with compression'); - return { x: _0n, y: _0n }; - } - const right = Fp.add(Fp.pow(x, _3n), Fp.create(bls12_381_CURVE_G1.b)); // y² = x³ + b - let y = Fp.sqrt(right); - if (!y) throw new Error('invalid G1 point: compressed point'); - if ((y * _2n) / P !== BigInt(sort)) y = Fp.neg(y); - return { x: Fp.create(x), y: Fp.create(y) }; - } else if (value.length === 96 && !compressed) { - // Check if the infinity flag is set - const x = bytesToNumberBE(value.subarray(0, L)); - const y = bytesToNumberBE(value.subarray(L)); - if (infinity) { - if (x !== _0n || y !== _0n) throw new Error('G1: non-empty point at infinity'); - return bls12_381.G1.Point.ZERO.toAffine(); - } - return { x: Fp.create(x), y: Fp.create(y) }; - } else { - throw new Error('invalid G1 point: expected 48/96 bytes'); - } -} - -function signatureG1FromBytes(hex: Hex): WeierstrassPoint { - const { infinity, sort, value } = parseMask(ensureBytes('signatureHex', hex, 48)); - const P = Fp.ORDER; - const Point = bls12_381.G1.Point; - const compressedValue = bytesToNumberBE(value); - // Zero - if (infinity) return Point.ZERO; - const x = Fp.create(compressedValue & bitMask(Fp.BITS)); - const right = Fp.add(Fp.pow(x, _3n), Fp.create(bls12_381_CURVE_G1.b)); // y² = x³ + b - let y = Fp.sqrt(right); - if (!y) throw new Error('invalid G1 point: compressed'); - const aflag = BigInt(sort); - if ((y * _2n) / P !== aflag) y = Fp.neg(y); - const point = Point.fromAffine({ x, y }); - point.assertValidity(); - return point; -} - -function pointG2ToBytes( - _c: WeierstrassPointCons, - point: WeierstrassPoint, - isComp: boolean -) { - const { BYTES: L, ORDER: P } = Fp; - const is0 = point.is0(); - const { x, y } = point.toAffine(); - if (isComp) { - if (is0) return concatBytes(COMPZERO, numberToBytesBE(_0n, L)); - const flag = Boolean(y.c1 === _0n ? (y.c0 * _2n) / P : (y.c1 * _2n) / P); - return concatBytes( - setMask(numberToBytesBE(x.c1, L), { compressed: true, sort: flag }), - numberToBytesBE(x.c0, L) - ); - } else { - if (is0) return concatBytes(Uint8Array.of(0x40), new Uint8Array(4 * L - 1)); - const { re: x0, im: x1 } = Fp2.reim(x); - const { re: y0, im: y1 } = Fp2.reim(y); - return concatBytes( - numberToBytesBE(x1, L), - numberToBytesBE(x0, L), - numberToBytesBE(y1, L), - numberToBytesBE(y0, L) - ); - } -} - -function signatureG2ToBytes(point: WeierstrassPoint) { - point.assertValidity(); - const { BYTES: L } = Fp; - if (point.is0()) return concatBytes(COMPZERO, numberToBytesBE(_0n, L)); - const { x, y } = point.toAffine(); - const { re: x0, im: x1 } = Fp2.reim(x); - const { re: y0, im: y1 } = Fp2.reim(y); - const tmp = y1 > _0n ? y1 * _2n : y0 * _2n; - const sort = Boolean((tmp / Fp.ORDER) & _1n); - const z2 = x0; - return concatBytes( - setMask(numberToBytesBE(x1, L), { sort, compressed: true }), - numberToBytesBE(z2, L) - ); -} - -function pointG2FromBytes(bytes: Uint8Array): AffinePoint { - const { BYTES: L, ORDER: P } = Fp; - const { compressed, infinity, sort, value } = parseMask(bytes); - if ( - (!compressed && !infinity && sort) || // 00100000 - (!compressed && infinity && sort) || // 01100000 - (sort && infinity && compressed) // 11100000 - ) { - throw new Error('invalid encoding flag: ' + (bytes[0] & 0b1110_0000)); - } - const slc = (b: Uint8Array, from: number, to?: number) => bytesToNumberBE(b.slice(from, to)); - if (value.length === 96 && compressed) { - if (infinity) { - // check that all bytes are 0 - if (value.reduce((p, c) => (p !== 0 ? c + 1 : c), 0) > 0) { - throw new Error('invalid G2 point: compressed'); - } - return { x: Fp2.ZERO, y: Fp2.ZERO }; - } - const x_1 = slc(value, 0, L); - const x_0 = slc(value, L, 2 * L); - const x = Fp2.create({ c0: Fp.create(x_0), c1: Fp.create(x_1) }); - const right = Fp2.add(Fp2.pow(x, _3n), bls12_381_CURVE_G2.b); // y² = x³ + 4 * (u+1) = x³ + b - let y = Fp2.sqrt(right); - const Y_bit = y.c1 === _0n ? (y.c0 * _2n) / P : (y.c1 * _2n) / P ? _1n : _0n; - y = sort && Y_bit > 0 ? y : Fp2.neg(y); - return { x, y }; - } else if (value.length === 192 && !compressed) { - if (infinity) { - if (value.reduce((p, c) => (p !== 0 ? c + 1 : c), 0) > 0) { - throw new Error('invalid G2 point: uncompressed'); - } - return { x: Fp2.ZERO, y: Fp2.ZERO }; - } - const x1 = slc(value, 0 * L, 1 * L); - const x0 = slc(value, 1 * L, 2 * L); - const y1 = slc(value, 2 * L, 3 * L); - const y0 = slc(value, 3 * L, 4 * L); - return { x: Fp2.fromBigTuple([x0, x1]), y: Fp2.fromBigTuple([y0, y1]) }; - } else { - throw new Error('invalid G2 point: expected 96/192 bytes'); - } -} - -function signatureG2FromBytes(hex: Hex) { - const { ORDER: P } = Fp; - // TODO: Optimize, it's very slow because of sqrt. - const { infinity, sort, value } = parseMask(ensureBytes('signatureHex', hex)); - const Point = bls12_381.G2.Point; - const half = value.length / 2; - if (half !== 48 && half !== 96) - throw new Error('invalid compressed signature length, expected 96/192 bytes'); - const z1 = bytesToNumberBE(value.slice(0, half)); - const z2 = bytesToNumberBE(value.slice(half)); - // Indicates the infinity point - if (infinity) return Point.ZERO; - const x1 = Fp.create(z1 & bitMask(Fp.BITS)); - const x2 = Fp.create(z2); - const x = Fp2.create({ c0: x2, c1: x1 }); - const y2 = Fp2.add(Fp2.pow(x, _3n), bls12_381_CURVE_G2.b); // y² = x³ + 4 - // The slow part - let y = Fp2.sqrt(y2); - if (!y) throw new Error('Failed to find a square root'); - - // Choose the y whose leftmost bit of the imaginary part is equal to the a_flag1 - // If y1 happens to be zero, then use the bit of y0 - const { re: y0, im: y1 } = Fp2.reim(y); - const aflag1 = BigInt(sort); - const isGreater = y1 > _0n && (y1 * _2n) / P !== aflag1; - const is0 = y1 === _0n && (y0 * _2n) / P !== aflag1; - if (isGreater || is0) y = Fp2.neg(y); - const point = Point.fromAffine({ x, y }); - point.assertValidity(); - return point; -} - -/** - * bls12-381 pairing-friendly curve. - * @example - * import { bls12_381 as bls } from '@noble/curves/bls12-381'; - * // G1 keys, G2 signatures - * const privateKey = '67d53f170b908cabb9eb326c3c337762d59289a8fec79f7bc9254b584b73265c'; - * const message = '64726e3da8'; - * const publicKey = bls.getPublicKey(privateKey); - * const signature = bls.sign(message, privateKey); - * const isValid = bls.verify(signature, message, publicKey); - */ -export const bls12_381: CurveFn = bls({ - // Fields - fields: { - Fp, - Fp2, - Fp6, - Fp12, - Fr: bls12_381_Fr, - }, - // G1: y² = x³ + 4 - G1: { - ...bls12_381_CURVE_G1, - Fp, - htfDefaults: { ...htfDefaults, m: 1, DST: 'BLS_SIG_BLS12381G1_XMD:SHA-256_SSWU_RO_NUL_' }, - wrapPrivateKey: true, - allowInfinityPoint: true, - // Checks is the point resides in prime-order subgroup. - // point.isTorsionFree() should return true for valid points - // It returns false for shitty points. - // https://eprint.iacr.org/2021/1130.pdf - isTorsionFree: (c, point): boolean => { - // GLV endomorphism ψ(P) - const beta = BigInt( - '0x5f19672fdf76ce51ba69c6076a0f77eaddb3a93be6f89688de17d813620a00022e01fffffffefffe' - ); - const phi = new c(Fp.mul(point.X, beta), point.Y, point.Z); - // TODO: unroll - const xP = point.multiplyUnsafe(BLS_X).negate(); // [x]P - const u2P = xP.multiplyUnsafe(BLS_X); // [u2]P - return u2P.equals(phi); - }, - // Clear cofactor of G1 - // https://eprint.iacr.org/2019/403 - clearCofactor: (_c, point) => { - // return this.multiplyUnsafe(CURVE.h); - return point.multiplyUnsafe(BLS_X).add(point); // x*P + P - }, - mapToCurve: mapToG1, - fromBytes: pointG1FromBytes, - toBytes: pointG1ToBytes, - ShortSignature: { - fromBytes(bytes: Uint8Array) { - abytes(bytes); - return signatureG1FromBytes(bytes); - }, - fromHex(hex: Hex): WeierstrassPoint { - return signatureG1FromBytes(hex); - }, - toBytes(point: WeierstrassPoint) { - return signatureG1ToBytes(point); - }, - toRawBytes(point: WeierstrassPoint) { - return signatureG1ToBytes(point); - }, - toHex(point: WeierstrassPoint) { - return bytesToHex(signatureG1ToBytes(point)); - }, - }, - }, - G2: { - ...bls12_381_CURVE_G2, - Fp: Fp2, - // https://datatracker.ietf.org/doc/html/rfc9380#name-clearing-the-cofactor - // https://datatracker.ietf.org/doc/html/rfc9380#name-cofactor-clearing-for-bls12 - hEff: BigInt( - '0xbc69f08f2ee75b3584c6a0ea91b352888e2a8e9145ad7689986ff031508ffe1329c2f178731db956d82bf015d1212b02ec0ec69d7477c1ae954cbc06689f6a359894c0adebbf6b4e8020005aaa95551' - ), - htfDefaults: { ...htfDefaults }, - wrapPrivateKey: true, - allowInfinityPoint: true, - mapToCurve: mapToG2, - // Checks is the point resides in prime-order subgroup. - // point.isTorsionFree() should return true for valid points - // It returns false for shitty points. - // https://eprint.iacr.org/2021/1130.pdf - // Older version: https://eprint.iacr.org/2019/814.pdf - isTorsionFree: (c, P): boolean => { - return P.multiplyUnsafe(BLS_X).negate().equals(G2psi(c, P)); // ψ(P) == [u](P) - }, - // Maps the point into the prime-order subgroup G2. - // clear_cofactor_bls12381_g2 from RFC 9380. - // https://eprint.iacr.org/2017/419.pdf - // prettier-ignore - clearCofactor: (c, P) => { - const x = BLS_X; - let t1 = P.multiplyUnsafe(x).negate(); // [-x]P - let t2 = G2psi(c, P); // Ψ(P) - let t3 = P.double(); // 2P - t3 = G2psi2(c, t3); // Ψ²(2P) - t3 = t3.subtract(t2); // Ψ²(2P) - Ψ(P) - t2 = t1.add(t2); // [-x]P + Ψ(P) - t2 = t2.multiplyUnsafe(x).negate(); // [x²]P - [x]Ψ(P) - t3 = t3.add(t2); // Ψ²(2P) - Ψ(P) + [x²]P - [x]Ψ(P) - t3 = t3.subtract(t1); // Ψ²(2P) - Ψ(P) + [x²]P - [x]Ψ(P) + [x]P - const Q = t3.subtract(P); // Ψ²(2P) - Ψ(P) + [x²]P - [x]Ψ(P) + [x]P - 1P - return Q; // [x²-x-1]P + [x-1]Ψ(P) + Ψ²(2P) - }, - fromBytes: pointG2FromBytes, - toBytes: pointG2ToBytes, - Signature: { - fromBytes(bytes: Uint8Array): WeierstrassPoint { - abytes(bytes); - return signatureG2FromBytes(bytes); - }, - fromHex(hex: Hex): WeierstrassPoint { - return signatureG2FromBytes(hex); - }, - toBytes(point: WeierstrassPoint) { - return signatureG2ToBytes(point); - }, - toRawBytes(point: WeierstrassPoint) { - return signatureG2ToBytes(point); - }, - toHex(point: WeierstrassPoint) { - return bytesToHex(signatureG2ToBytes(point)); - }, - }, - }, - params: { - ateLoopSize: BLS_X, // The BLS parameter x for BLS12-381 - r: bls12_381_CURVE_G1.n, // order; z⁴ − z² + 1; CURVE.n from other curves - xNegative: true, - twistType: 'multiplicative', - }, - htfDefaults, - hash: sha256, -}); - -// 3-isogeny map from E' to E https://www.rfc-editor.org/rfc/rfc9380#appendix-E.3 -const isogenyMapG2 = isogenyMap( - Fp2, - [ - // xNum - [ - [ - '0x5c759507e8e333ebb5b7a9a47d7ed8532c52d39fd3a042a88b58423c50ae15d5c2638e343d9c71c6238aaaaaaaa97d6', - '0x5c759507e8e333ebb5b7a9a47d7ed8532c52d39fd3a042a88b58423c50ae15d5c2638e343d9c71c6238aaaaaaaa97d6', - ], - [ - '0x0', - '0x11560bf17baa99bc32126fced787c88f984f87adf7ae0c7f9a208c6b4f20a4181472aaa9cb8d555526a9ffffffffc71a', - ], - [ - '0x11560bf17baa99bc32126fced787c88f984f87adf7ae0c7f9a208c6b4f20a4181472aaa9cb8d555526a9ffffffffc71e', - '0x8ab05f8bdd54cde190937e76bc3e447cc27c3d6fbd7063fcd104635a790520c0a395554e5c6aaaa9354ffffffffe38d', - ], - [ - '0x171d6541fa38ccfaed6dea691f5fb614cb14b4e7f4e810aa22d6108f142b85757098e38d0f671c7188e2aaaaaaaa5ed1', - '0x0', - ], - ], - // xDen - [ - [ - '0x0', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaa63', - ], - [ - '0xc', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaa9f', - ], - ['0x1', '0x0'], // LAST 1 - ], - // yNum - [ - [ - '0x1530477c7ab4113b59a4c18b076d11930f7da5d4a07f649bf54439d87d27e500fc8c25ebf8c92f6812cfc71c71c6d706', - '0x1530477c7ab4113b59a4c18b076d11930f7da5d4a07f649bf54439d87d27e500fc8c25ebf8c92f6812cfc71c71c6d706', - ], - [ - '0x0', - '0x5c759507e8e333ebb5b7a9a47d7ed8532c52d39fd3a042a88b58423c50ae15d5c2638e343d9c71c6238aaaaaaaa97be', - ], - [ - '0x11560bf17baa99bc32126fced787c88f984f87adf7ae0c7f9a208c6b4f20a4181472aaa9cb8d555526a9ffffffffc71c', - '0x8ab05f8bdd54cde190937e76bc3e447cc27c3d6fbd7063fcd104635a790520c0a395554e5c6aaaa9354ffffffffe38f', - ], - [ - '0x124c9ad43b6cf79bfbf7043de3811ad0761b0f37a1e26286b0e977c69aa274524e79097a56dc4bd9e1b371c71c718b10', - '0x0', - ], - ], - // yDen - [ - [ - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffa8fb', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffa8fb', - ], - [ - '0x0', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffa9d3', - ], - [ - '0x12', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaa99', - ], - ['0x1', '0x0'], // LAST 1 - ], - ].map((i) => i.map((pair) => Fp2.fromBigTuple(pair.map(BigInt) as BigintTuple))) as [ - Fp2[], - Fp2[], - Fp2[], - Fp2[], - ] -); -// 11-isogeny map from E' to E -const isogenyMapG1 = isogenyMap( - Fp, - [ - // xNum - [ - '0x11a05f2b1e833340b809101dd99815856b303e88a2d7005ff2627b56cdb4e2c85610c2d5f2e62d6eaeac1662734649b7', - '0x17294ed3e943ab2f0588bab22147a81c7c17e75b2f6a8417f565e33c70d1e86b4838f2a6f318c356e834eef1b3cb83bb', - '0xd54005db97678ec1d1048c5d10a9a1bce032473295983e56878e501ec68e25c958c3e3d2a09729fe0179f9dac9edcb0', - '0x1778e7166fcc6db74e0609d307e55412d7f5e4656a8dbf25f1b33289f1b330835336e25ce3107193c5b388641d9b6861', - '0xe99726a3199f4436642b4b3e4118e5499db995a1257fb3f086eeb65982fac18985a286f301e77c451154ce9ac8895d9', - '0x1630c3250d7313ff01d1201bf7a74ab5db3cb17dd952799b9ed3ab9097e68f90a0870d2dcae73d19cd13c1c66f652983', - '0xd6ed6553fe44d296a3726c38ae652bfb11586264f0f8ce19008e218f9c86b2a8da25128c1052ecaddd7f225a139ed84', - '0x17b81e7701abdbe2e8743884d1117e53356de5ab275b4db1a682c62ef0f2753339b7c8f8c8f475af9ccb5618e3f0c88e', - '0x80d3cf1f9a78fc47b90b33563be990dc43b756ce79f5574a2c596c928c5d1de4fa295f296b74e956d71986a8497e317', - '0x169b1f8e1bcfa7c42e0c37515d138f22dd2ecb803a0c5c99676314baf4bb1b7fa3190b2edc0327797f241067be390c9e', - '0x10321da079ce07e272d8ec09d2565b0dfa7dccdde6787f96d50af36003b14866f69b771f8c285decca67df3f1605fb7b', - '0x6e08c248e260e70bd1e962381edee3d31d79d7e22c837bc23c0bf1bc24c6b68c24b1b80b64d391fa9c8ba2e8ba2d229', - ], - // xDen - [ - '0x8ca8d548cff19ae18b2e62f4bd3fa6f01d5ef4ba35b48ba9c9588617fc8ac62b558d681be343df8993cf9fa40d21b1c', - '0x12561a5deb559c4348b4711298e536367041e8ca0cf0800c0126c2588c48bf5713daa8846cb026e9e5c8276ec82b3bff', - '0xb2962fe57a3225e8137e629bff2991f6f89416f5a718cd1fca64e00b11aceacd6a3d0967c94fedcfcc239ba5cb83e19', - '0x3425581a58ae2fec83aafef7c40eb545b08243f16b1655154cca8abc28d6fd04976d5243eecf5c4130de8938dc62cd8', - '0x13a8e162022914a80a6f1d5f43e7a07dffdfc759a12062bb8d6b44e833b306da9bd29ba81f35781d539d395b3532a21e', - '0xe7355f8e4e667b955390f7f0506c6e9395735e9ce9cad4d0a43bcef24b8982f7400d24bc4228f11c02df9a29f6304a5', - '0x772caacf16936190f3e0c63e0596721570f5799af53a1894e2e073062aede9cea73b3538f0de06cec2574496ee84a3a', - '0x14a7ac2a9d64a8b230b3f5b074cf01996e7f63c21bca68a81996e1cdf9822c580fa5b9489d11e2d311f7d99bbdcc5a5e', - '0xa10ecf6ada54f825e920b3dafc7a3cce07f8d1d7161366b74100da67f39883503826692abba43704776ec3a79a1d641', - '0x95fc13ab9e92ad4476d6e3eb3a56680f682b4ee96f7d03776df533978f31c1593174e4b4b7865002d6384d168ecdd0a', - '0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001', // LAST 1 - ], - // yNum - [ - '0x90d97c81ba24ee0259d1f094980dcfa11ad138e48a869522b52af6c956543d3cd0c7aee9b3ba3c2be9845719707bb33', - '0x134996a104ee5811d51036d776fb46831223e96c254f383d0f906343eb67ad34d6c56711962fa8bfe097e75a2e41c696', - '0xcc786baa966e66f4a384c86a3b49942552e2d658a31ce2c344be4b91400da7d26d521628b00523b8dfe240c72de1f6', - '0x1f86376e8981c217898751ad8746757d42aa7b90eeb791c09e4a3ec03251cf9de405aba9ec61deca6355c77b0e5f4cb', - '0x8cc03fdefe0ff135caf4fe2a21529c4195536fbe3ce50b879833fd221351adc2ee7f8dc099040a841b6daecf2e8fedb', - '0x16603fca40634b6a2211e11db8f0a6a074a7d0d4afadb7bd76505c3d3ad5544e203f6326c95a807299b23ab13633a5f0', - '0x4ab0b9bcfac1bbcb2c977d027796b3ce75bb8ca2be184cb5231413c4d634f3747a87ac2460f415ec961f8855fe9d6f2', - '0x987c8d5333ab86fde9926bd2ca6c674170a05bfe3bdd81ffd038da6c26c842642f64550fedfe935a15e4ca31870fb29', - '0x9fc4018bd96684be88c9e221e4da1bb8f3abd16679dc26c1e8b6e6a1f20cabe69d65201c78607a360370e577bdba587', - '0xe1bba7a1186bdb5223abde7ada14a23c42a0ca7915af6fe06985e7ed1e4d43b9b3f7055dd4eba6f2bafaaebca731c30', - '0x19713e47937cd1be0dfd0b8f1d43fb93cd2fcbcb6caf493fd1183e416389e61031bf3a5cce3fbafce813711ad011c132', - '0x18b46a908f36f6deb918c143fed2edcc523559b8aaf0c2462e6bfe7f911f643249d9cdf41b44d606ce07c8a4d0074d8e', - '0xb182cac101b9399d155096004f53f447aa7b12a3426b08ec02710e807b4633f06c851c1919211f20d4c04f00b971ef8', - '0x245a394ad1eca9b72fc00ae7be315dc757b3b080d4c158013e6632d3c40659cc6cf90ad1c232a6442d9d3f5db980133', - '0x5c129645e44cf1102a159f748c4a3fc5e673d81d7e86568d9ab0f5d396a7ce46ba1049b6579afb7866b1e715475224b', - '0x15e6be4e990f03ce4ea50b3b42df2eb5cb181d8f84965a3957add4fa95af01b2b665027efec01c7704b456be69c8b604', - ], - // yDen - [ - '0x16112c4c3a9c98b252181140fad0eae9601a6de578980be6eec3232b5be72e7a07f3688ef60c206d01479253b03663c1', - '0x1962d75c2381201e1a0cbd6c43c348b885c84ff731c4d59ca4a10356f453e01f78a4260763529e3532f6102c2e49a03d', - '0x58df3306640da276faaae7d6e8eb15778c4855551ae7f310c35a5dd279cd2eca6757cd636f96f891e2538b53dbf67f2', - '0x16b7d288798e5395f20d23bf89edb4d1d115c5dbddbcd30e123da489e726af41727364f2c28297ada8d26d98445f5416', - '0xbe0e079545f43e4b00cc912f8228ddcc6d19c9f0f69bbb0542eda0fc9dec916a20b15dc0fd2ededda39142311a5001d', - '0x8d9e5297186db2d9fb266eaac783182b70152c65550d881c5ecd87b6f0f5a6449f38db9dfa9cce202c6477faaf9b7ac', - '0x166007c08a99db2fc3ba8734ace9824b5eecfdfa8d0cf8ef5dd365bc400a0051d5fa9c01a58b1fb93d1a1399126a775c', - '0x16a3ef08be3ea7ea03bcddfabba6ff6ee5a4375efa1f4fd7feb34fd206357132b920f5b00801dee460ee415a15812ed9', - '0x1866c8ed336c61231a1be54fd1d74cc4f9fb0ce4c6af5920abc5750c4bf39b4852cfe2f7bb9248836b233d9d55535d4a', - '0x167a55cda70a6e1cea820597d94a84903216f763e13d87bb5308592e7ea7d4fbc7385ea3d529b35e346ef48bb8913f55', - '0x4d2f259eea405bd48f010a01ad2911d9c6dd039bb61a6290e591b36e636a5c871a5c29f4f83060400f8b49cba8f6aa8', - '0xaccbb67481d033ff5852c1e48c50c477f94ff8aefce42d28c0f9a88cea7913516f968986f7ebbea9684b529e2561092', - '0xad6b9514c767fe3c3613144b45f1496543346d98adf02267d5ceef9a00d9b8693000763e3b90ac11e99b138573345cc', - '0x2660400eb2e4f3b628bdd0d53cd76f2bf565b94e72927c1cb748df27942480e420517bd8714cc80d1fadc1326ed06f7', - '0xe0fa1d816ddc03e6b24255e0d7819c171c40f65e273b853324efcd6356caa205ca2f570f13497804415473a1d634b8f', - '0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001', // LAST 1 - ], - ].map((i) => i.map((j) => BigInt(j))) as [Fp[], Fp[], Fp[], Fp[]] -); - -// Optimized SWU Map - Fp to G1 -const G1_SWU = mapToCurveSimpleSWU(Fp, { - A: Fp.create( - BigInt( - '0x144698a3b8e9433d693a02c96d4982b0ea985383ee66a8d8e8981aefd881ac98936f8da0e0f97f5cf428082d584c1d' - ) - ), - B: Fp.create( - BigInt( - '0x12e2908d11688030018b12e8753eee3b2016c1f0f24f4070a0b9c14fcef35ef55a23215a316ceaa5d1cc48e98e172be0' - ) - ), - Z: Fp.create(BigInt(11)), -}); -// SWU Map - Fp2 to G2': y² = x³ + 240i * x + 1012 + 1012i -const G2_SWU = mapToCurveSimpleSWU(Fp2, { - A: Fp2.create({ c0: Fp.create(_0n), c1: Fp.create(BigInt(240)) }), // A' = 240 * I - B: Fp2.create({ c0: Fp.create(BigInt(1012)), c1: Fp.create(BigInt(1012)) }), // B' = 1012 * (1 + I) - Z: Fp2.create({ c0: Fp.create(BigInt(-2)), c1: Fp.create(BigInt(-1)) }), // Z: -(2 + I) -}); - -function mapToG1(scalars: bigint[]) { - const { x, y } = G1_SWU(Fp.create(scalars[0])); - return isogenyMapG1(x, y); -} -function mapToG2(scalars: bigint[]) { - const { x, y } = G2_SWU(Fp2.fromBigTuple(scalars as BigintTuple)); - return isogenyMapG2(x, y); -} diff --git a/tools/mnemonic-test/node_modules/@noble/curves/src/bn254.ts b/tools/mnemonic-test/node_modules/@noble/curves/src/bn254.ts deleted file mode 100644 index c43337fa..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/src/bn254.ts +++ /dev/null @@ -1,243 +0,0 @@ -/** - * bn254, previously known as alt_bn_128, when it had 128-bit security. - -Barbulescu-Duquesne 2017 shown it's weaker: just about 100 bits, -so the naming has been adjusted to its prime bit count: -https://hal.science/hal-01534101/file/main.pdf. -Compatible with EIP-196 and EIP-197. - -There are huge compatibility issues in the ecosystem: - -1. Different libraries call it in different ways: "bn254", "bn256", "alt_bn128", "bn128". -2. libff has bn128, but it's a different curve with different G2: - https://github.com/scipr-lab/libff/blob/a44f482e18b8ac04d034c193bd9d7df7817ad73f/libff/algebra/curves/bn128/bn128_init.cpp#L166-L169 -3. halo2curves bn256 is also incompatible and returns different outputs - -We don't implement Point methods toHex / toBytes. -To work around this limitation, has to initialize points on their own from BigInts. -Reason it's not implemented is because [there is no standard](https://github.com/privacy-scaling-explorations/halo2curves/issues/109). -Points of divergence: - -- Endianness: LE vs BE (byte-swapped) -- Flags as first hex bits (similar to BLS) vs no-flags -- Imaginary part last in G2 vs first (c0, c1 vs c1, c0) - -The goal of our implementation is to support "Ethereum" variant of the curve, -because it at least has specs: - -- EIP196 (https://eips.ethereum.org/EIPS/eip-196) describes bn254 ECADD and ECMUL opcodes for EVM -- EIP197 (https://eips.ethereum.org/EIPS/eip-197) describes bn254 pairings -- It's hard: EIPs don't have proper tests. EIP-197 returns boolean output instead of Fp12 -- The existing implementations are bad. Some are deprecated: - - https://github.com/paritytech/bn (old version) - - https://github.com/ewasm/ethereum-bn128.rs (uses paritytech/bn) - - https://github.com/zcash-hackworks/bn - - https://github.com/arkworks-rs/curves/blob/master/bn254/src/lib.rs -- Python implementations use different towers and produce different Fp12 outputs: - - https://github.com/ethereum/py_pairing - - https://github.com/ethereum/execution-specs/blob/master/src/ethereum/crypto/alt_bn128.py -- Points are encoded differently in different implementations - -### Params -Seed (X): 4965661367192848881 -Fr: (36x⁴+36x³+18x²+6x+1) -Fp: (36x⁴+36x³+24x²+6x+1) -(E / Fp ): Y² = X³+3 -(Et / Fp²): Y² = X³+3/(u+9) (D-type twist) -Ate loop size: 6x+2 - -### Towers -- Fp²[u] = Fp/u²+1 -- Fp⁶[v] = Fp²/v³-9-u -- Fp¹²[w] = Fp⁶/w²-v - - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { sha256 } from '@noble/hashes/sha2.js'; -import { - bls, - type CurveFn as BLSCurveFn, - type PostPrecomputeFn, - type PostPrecomputePointAddFn, -} from './abstract/bls.ts'; -import { Field, type IField } from './abstract/modular.ts'; -import type { Fp, Fp12, Fp2, Fp6 } from './abstract/tower.ts'; -import { psiFrobenius, tower12 } from './abstract/tower.ts'; -import { type CurveFn, weierstrass, type WeierstrassOpts } from './abstract/weierstrass.ts'; -import { bitLen, notImplemented } from './utils.ts'; -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3); -const _6n = BigInt(6); - -const BN_X = BigInt('4965661367192848881'); -const BN_X_LEN = bitLen(BN_X); -const SIX_X_SQUARED = _6n * BN_X ** _2n; - -const bn254_G1_CURVE: WeierstrassOpts = { - p: BigInt('0x30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47'), - n: BigInt('0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001'), - h: _1n, - a: _0n, - b: _3n, - Gx: _1n, - Gy: BigInt(2), -}; - -// r == n -// Finite field over r. It's for convenience and is not used in the code below. -export const bn254_Fr: IField = Field(bn254_G1_CURVE.n); - -// Fp2.div(Fp2.mul(Fp2.ONE, _3n), Fp2.NONRESIDUE) -const Fp2B = { - c0: BigInt('19485874751759354771024239261021720505790618469301721065564631296452457478373'), - c1: BigInt('266929791119991161246907387137283842545076965332900288569378510910307636690'), -}; - -const { Fp, Fp2, Fp6, Fp12 } = tower12({ - ORDER: bn254_G1_CURVE.p, - X_LEN: BN_X_LEN, - FP2_NONRESIDUE: [BigInt(9), _1n], - Fp2mulByB: (num) => Fp2.mul(num, Fp2B), - Fp12finalExponentiate: (num) => { - const powMinusX = (num: Fp12) => Fp12.conjugate(Fp12._cyclotomicExp(num, BN_X)); - const r0 = Fp12.mul(Fp12.conjugate(num), Fp12.inv(num)); - const r = Fp12.mul(Fp12.frobeniusMap(r0, 2), r0); - const y1 = Fp12._cyclotomicSquare(powMinusX(r)); - const y2 = Fp12.mul(Fp12._cyclotomicSquare(y1), y1); - const y4 = powMinusX(y2); - const y6 = powMinusX(Fp12._cyclotomicSquare(y4)); - const y8 = Fp12.mul(Fp12.mul(Fp12.conjugate(y6), y4), Fp12.conjugate(y2)); - const y9 = Fp12.mul(y8, y1); - return Fp12.mul( - Fp12.frobeniusMap(Fp12.mul(Fp12.conjugate(r), y9), 3), - Fp12.mul( - Fp12.frobeniusMap(y8, 2), - Fp12.mul(Fp12.frobeniusMap(y9, 1), Fp12.mul(Fp12.mul(y8, y4), r)) - ) - ); - }, -}); - -// END OF CURVE FIELDS -const { G2psi, psi } = psiFrobenius(Fp, Fp2, Fp2.NONRESIDUE); - -/* -No hashToCurve for now (and signatures): - -- RFC 9380 doesn't mention bn254 and doesn't provide test vectors -- Overall seems like nobody is using BLS signatures on top of bn254 -- Seems like it can utilize SVDW, which is not implemented yet -*/ -const htfDefaults = Object.freeze({ - // DST: a domain separation tag defined in section 2.2.5 - DST: 'BN254G2_XMD:SHA-256_SVDW_RO_', - encodeDST: 'BN254G2_XMD:SHA-256_SVDW_RO_', - p: Fp.ORDER, - m: 2, - k: 128, - expand: 'xmd', - hash: sha256, -}); - -export const _postPrecompute: PostPrecomputeFn = ( - Rx: Fp2, - Ry: Fp2, - Rz: Fp2, - Qx: Fp2, - Qy: Fp2, - pointAdd: PostPrecomputePointAddFn -) => { - const q = psi(Qx, Qy); - ({ Rx, Ry, Rz } = pointAdd(Rx, Ry, Rz, q[0], q[1])); - const q2 = psi(q[0], q[1]); - pointAdd(Rx, Ry, Rz, q2[0], Fp2.neg(q2[1])); -}; - -// cofactor: (36 * X^4) + (36 * X^3) + (30 * X^2) + 6*X + 1 -const bn254_G2_CURVE: WeierstrassOpts = { - p: Fp2.ORDER, - n: bn254_G1_CURVE.n, - h: BigInt('0x30644e72e131a029b85045b68181585e06ceecda572a2489345f2299c0f9fa8d'), - a: Fp2.ZERO, - b: Fp2B, - Gx: Fp2.fromBigTuple([ - BigInt('10857046999023057135944570762232829481370756359578518086990519993285655852781'), - BigInt('11559732032986387107991004021392285783925812861821192530917403151452391805634'), - ]), - Gy: Fp2.fromBigTuple([ - BigInt('8495653923123431417604973247489272438418190587263600148770280649306958101930'), - BigInt('4082367875863433681332203403145435568316851327593401208105741076214120093531'), - ]), -}; - -/** - * bn254 (a.k.a. alt_bn128) pairing-friendly curve. - * Contains G1 / G2 operations and pairings. - */ -export const bn254: BLSCurveFn = bls({ - // Fields - fields: { Fp, Fp2, Fp6, Fp12, Fr: bn254_Fr }, - G1: { - ...bn254_G1_CURVE, - Fp, - htfDefaults: { ...htfDefaults, m: 1, DST: 'BN254G2_XMD:SHA-256_SVDW_RO_' }, - wrapPrivateKey: true, - allowInfinityPoint: true, - mapToCurve: notImplemented, - fromBytes: notImplemented, - toBytes: notImplemented, - ShortSignature: { - fromBytes: notImplemented, - fromHex: notImplemented, - toBytes: notImplemented, - toRawBytes: notImplemented, - toHex: notImplemented, - }, - }, - G2: { - ...bn254_G2_CURVE, - Fp: Fp2, - hEff: BigInt('21888242871839275222246405745257275088844257914179612981679871602714643921549'), - htfDefaults: { ...htfDefaults }, - wrapPrivateKey: true, - allowInfinityPoint: true, - isTorsionFree: (c, P) => P.multiplyUnsafe(SIX_X_SQUARED).equals(G2psi(c, P)), // [p]P = [6X^2]P - mapToCurve: notImplemented, - fromBytes: notImplemented, - toBytes: notImplemented, - Signature: { - fromBytes: notImplemented, - fromHex: notImplemented, - toBytes: notImplemented, - toRawBytes: notImplemented, - toHex: notImplemented, - }, - }, - params: { - ateLoopSize: BN_X * _6n + _2n, - r: bn254_Fr.ORDER, - xNegative: false, - twistType: 'divisive', - }, - htfDefaults, - hash: sha256, - postPrecompute: _postPrecompute, -}); - -/** - * bn254 weierstrass curve with ECDSA. - * This is very rare and probably not used anywhere. - * Instead, you should use G1 / G2, defined above. - * @deprecated - */ -export const bn254_weierstrass: CurveFn = weierstrass({ - a: BigInt(0), - b: BigInt(3), - Fp, - n: BigInt('21888242871839275222246405745257275088548364400416034343698204186575808495617'), - Gx: BigInt(1), - Gy: BigInt(2), - h: BigInt(1), - hash: sha256, -}); diff --git a/tools/mnemonic-test/node_modules/@noble/curves/src/ed25519.ts b/tools/mnemonic-test/node_modules/@noble/curves/src/ed25519.ts deleted file mode 100644 index cba7888e..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/src/ed25519.ts +++ /dev/null @@ -1,554 +0,0 @@ -/** - * ed25519 Twisted Edwards curve with following addons: - * - X25519 ECDH - * - Ristretto cofactor elimination - * - Elligator hash-to-group / point indistinguishability - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { sha512 } from '@noble/hashes/sha2.js'; -import { abytes, concatBytes, utf8ToBytes } from '@noble/hashes/utils.js'; -import { pippenger, type AffinePoint } from './abstract/curve.ts'; -import { - PrimeEdwardsPoint, - twistedEdwards, - type CurveFn, - type EdwardsOpts, - type EdwardsPoint, -} from './abstract/edwards.ts'; -import { - _DST_scalar, - createHasher, - expand_message_xmd, - type H2CHasher, - type H2CHasherBase, - type H2CMethod, - type htfBasicOpts, -} from './abstract/hash-to-curve.ts'; -import { - Field, - FpInvertBatch, - FpSqrtEven, - isNegativeLE, - mod, - pow2, - type IField, -} from './abstract/modular.ts'; -import { montgomery, type MontgomeryECDH as XCurveFn } from './abstract/montgomery.ts'; -import { bytesToNumberLE, ensureBytes, equalBytes, type Hex } from './utils.ts'; - -// prettier-ignore -const _0n = /* @__PURE__ */ BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3); -// prettier-ignore -const _5n = BigInt(5), _8n = BigInt(8); - -// P = 2n**255n-19n -const ed25519_CURVE_p = BigInt( - '0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed' -); - -// N = 2n**252n + 27742317777372353535851937790883648493n -// a = Fp.create(BigInt(-1)) -// d = -121665/121666 a.k.a. Fp.neg(121665 * Fp.inv(121666)) -const ed25519_CURVE: EdwardsOpts = /* @__PURE__ */ (() => ({ - p: ed25519_CURVE_p, - n: BigInt('0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed'), - h: _8n, - a: BigInt('0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec'), - d: BigInt('0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3'), - Gx: BigInt('0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a'), - Gy: BigInt('0x6666666666666666666666666666666666666666666666666666666666666658'), -}))(); - -function ed25519_pow_2_252_3(x: bigint) { - // prettier-ignore - const _10n = BigInt(10), _20n = BigInt(20), _40n = BigInt(40), _80n = BigInt(80); - const P = ed25519_CURVE_p; - const x2 = (x * x) % P; - const b2 = (x2 * x) % P; // x^3, 11 - const b4 = (pow2(b2, _2n, P) * b2) % P; // x^15, 1111 - const b5 = (pow2(b4, _1n, P) * x) % P; // x^31 - const b10 = (pow2(b5, _5n, P) * b5) % P; - const b20 = (pow2(b10, _10n, P) * b10) % P; - const b40 = (pow2(b20, _20n, P) * b20) % P; - const b80 = (pow2(b40, _40n, P) * b40) % P; - const b160 = (pow2(b80, _80n, P) * b80) % P; - const b240 = (pow2(b160, _80n, P) * b80) % P; - const b250 = (pow2(b240, _10n, P) * b10) % P; - const pow_p_5_8 = (pow2(b250, _2n, P) * x) % P; - // ^ To pow to (p+3)/8, multiply it by x. - return { pow_p_5_8, b2 }; -} - -function adjustScalarBytes(bytes: Uint8Array): Uint8Array { - // Section 5: For X25519, in order to decode 32 random bytes as an integer scalar, - // set the three least significant bits of the first byte - bytes[0] &= 248; // 0b1111_1000 - // and the most significant bit of the last to zero, - bytes[31] &= 127; // 0b0111_1111 - // set the second most significant bit of the last byte to 1 - bytes[31] |= 64; // 0b0100_0000 - return bytes; -} - -// √(-1) aka √(a) aka 2^((p-1)/4) -// Fp.sqrt(Fp.neg(1)) -const ED25519_SQRT_M1 = /* @__PURE__ */ BigInt( - '19681161376707505956807079304988542015446066515923890162744021073123829784752' -); -// sqrt(u/v) -function uvRatio(u: bigint, v: bigint): { isValid: boolean; value: bigint } { - const P = ed25519_CURVE_p; - const v3 = mod(v * v * v, P); // v³ - const v7 = mod(v3 * v3 * v, P); // v⁷ - // (p+3)/8 and (p-5)/8 - const pow = ed25519_pow_2_252_3(u * v7).pow_p_5_8; - let x = mod(u * v3 * pow, P); // (uv³)(uv⁷)^(p-5)/8 - const vx2 = mod(v * x * x, P); // vx² - const root1 = x; // First root candidate - const root2 = mod(x * ED25519_SQRT_M1, P); // Second root candidate - const useRoot1 = vx2 === u; // If vx² = u (mod p), x is a square root - const useRoot2 = vx2 === mod(-u, P); // If vx² = -u, set x <-- x * 2^((p-1)/4) - const noRoot = vx2 === mod(-u * ED25519_SQRT_M1, P); // There is no valid root, vx² = -u√(-1) - if (useRoot1) x = root1; - if (useRoot2 || noRoot) x = root2; // We return root2 anyway, for const-time - if (isNegativeLE(x, P)) x = mod(-x, P); - return { isValid: useRoot1 || useRoot2, value: x }; -} - -const Fp = /* @__PURE__ */ (() => Field(ed25519_CURVE.p, { isLE: true }))(); -const Fn = /* @__PURE__ */ (() => Field(ed25519_CURVE.n, { isLE: true }))(); - -const ed25519Defaults = /* @__PURE__ */ (() => ({ - ...ed25519_CURVE, - Fp, - hash: sha512, - adjustScalarBytes, - // dom2 - // Ratio of u to v. Allows us to combine inversion and square root. Uses algo from RFC8032 5.1.3. - // Constant-time, u/√v - uvRatio, -}))(); - -/** - * ed25519 curve with EdDSA signatures. - * @example - * import { ed25519 } from '@noble/curves/ed25519'; - * const { secretKey, publicKey } = ed25519.keygen(); - * const msg = new TextEncoder().encode('hello'); - * const sig = ed25519.sign(msg, priv); - * ed25519.verify(sig, msg, pub); // Default mode: follows ZIP215 - * ed25519.verify(sig, msg, pub, { zip215: false }); // RFC8032 / FIPS 186-5 - */ -export const ed25519: CurveFn = /* @__PURE__ */ (() => twistedEdwards(ed25519Defaults))(); - -function ed25519_domain(data: Uint8Array, ctx: Uint8Array, phflag: boolean) { - if (ctx.length > 255) throw new Error('Context is too big'); - return concatBytes( - utf8ToBytes('SigEd25519 no Ed25519 collisions'), - new Uint8Array([phflag ? 1 : 0, ctx.length]), - ctx, - data - ); -} - -/** Context of ed25519. Uses context for domain separation. */ -export const ed25519ctx: CurveFn = /* @__PURE__ */ (() => - twistedEdwards({ - ...ed25519Defaults, - domain: ed25519_domain, - }))(); - -/** Prehashed version of ed25519. Accepts already-hashed messages in sign() and verify(). */ -export const ed25519ph: CurveFn = /* @__PURE__ */ (() => - twistedEdwards( - Object.assign({}, ed25519Defaults, { - domain: ed25519_domain, - prehash: sha512, - }) - ))(); - -/** - * ECDH using curve25519 aka x25519. - * @example - * import { x25519 } from '@noble/curves/ed25519'; - * const priv = 'a546e36bf0527c9d3b16154b82465edd62144c0ac1fc5a18506a2244ba449ac4'; - * const pub = 'e6db6867583030db3594c1a424b15f7c726624ec26b3353b10a903a6d0ab1c4c'; - * x25519.getSharedSecret(priv, pub) === x25519.scalarMult(priv, pub); // aliases - * x25519.getPublicKey(priv) === x25519.scalarMultBase(priv); - * x25519.getPublicKey(x25519.utils.randomSecretKey()); - */ -export const x25519: XCurveFn = /* @__PURE__ */ (() => { - const P = Fp.ORDER; - return montgomery({ - P, - type: 'x25519', - powPminus2: (x: bigint): bigint => { - // x^(p-2) aka x^(2^255-21) - const { pow_p_5_8, b2 } = ed25519_pow_2_252_3(x); - return mod(pow2(pow_p_5_8, _3n, P) * b2, P); - }, - adjustScalarBytes, - }); -})(); - -// Hash To Curve Elligator2 Map (NOTE: different from ristretto255 elligator) -// NOTE: very important part is usage of FpSqrtEven for ELL2_C1_EDWARDS, since -// SageMath returns different root first and everything falls apart -const ELL2_C1 = /* @__PURE__ */ (() => (ed25519_CURVE_p + _3n) / _8n)(); // 1. c1 = (q + 3) / 8 # Integer arithmetic -const ELL2_C2 = /* @__PURE__ */ (() => Fp.pow(_2n, ELL2_C1))(); // 2. c2 = 2^c1 -const ELL2_C3 = /* @__PURE__ */ (() => Fp.sqrt(Fp.neg(Fp.ONE)))(); // 3. c3 = sqrt(-1) - -// prettier-ignore -function map_to_curve_elligator2_curve25519(u: bigint) { - const ELL2_C4 = (ed25519_CURVE_p - _5n) / _8n; // 4. c4 = (q - 5) / 8 # Integer arithmetic - const ELL2_J = BigInt(486662); - - let tv1 = Fp.sqr(u); // 1. tv1 = u^2 - tv1 = Fp.mul(tv1, _2n); // 2. tv1 = 2 * tv1 - let xd = Fp.add(tv1, Fp.ONE); // 3. xd = tv1 + 1 # Nonzero: -1 is square (mod p), tv1 is not - let x1n = Fp.neg(ELL2_J); // 4. x1n = -J # x1 = x1n / xd = -J / (1 + 2 * u^2) - let tv2 = Fp.sqr(xd); // 5. tv2 = xd^2 - let gxd = Fp.mul(tv2, xd); // 6. gxd = tv2 * xd # gxd = xd^3 - let gx1 = Fp.mul(tv1, ELL2_J);// 7. gx1 = J * tv1 # x1n + J * xd - gx1 = Fp.mul(gx1, x1n); // 8. gx1 = gx1 * x1n # x1n^2 + J * x1n * xd - gx1 = Fp.add(gx1, tv2); // 9. gx1 = gx1 + tv2 # x1n^2 + J * x1n * xd + xd^2 - gx1 = Fp.mul(gx1, x1n); // 10. gx1 = gx1 * x1n # x1n^3 + J * x1n^2 * xd + x1n * xd^2 - let tv3 = Fp.sqr(gxd); // 11. tv3 = gxd^2 - tv2 = Fp.sqr(tv3); // 12. tv2 = tv3^2 # gxd^4 - tv3 = Fp.mul(tv3, gxd); // 13. tv3 = tv3 * gxd # gxd^3 - tv3 = Fp.mul(tv3, gx1); // 14. tv3 = tv3 * gx1 # gx1 * gxd^3 - tv2 = Fp.mul(tv2, tv3); // 15. tv2 = tv2 * tv3 # gx1 * gxd^7 - let y11 = Fp.pow(tv2, ELL2_C4); // 16. y11 = tv2^c4 # (gx1 * gxd^7)^((p - 5) / 8) - y11 = Fp.mul(y11, tv3); // 17. y11 = y11 * tv3 # gx1*gxd^3*(gx1*gxd^7)^((p-5)/8) - let y12 = Fp.mul(y11, ELL2_C3); // 18. y12 = y11 * c3 - tv2 = Fp.sqr(y11); // 19. tv2 = y11^2 - tv2 = Fp.mul(tv2, gxd); // 20. tv2 = tv2 * gxd - let e1 = Fp.eql(tv2, gx1); // 21. e1 = tv2 == gx1 - let y1 = Fp.cmov(y12, y11, e1); // 22. y1 = CMOV(y12, y11, e1) # If g(x1) is square, this is its sqrt - let x2n = Fp.mul(x1n, tv1); // 23. x2n = x1n * tv1 # x2 = x2n / xd = 2 * u^2 * x1n / xd - let y21 = Fp.mul(y11, u); // 24. y21 = y11 * u - y21 = Fp.mul(y21, ELL2_C2); // 25. y21 = y21 * c2 - let y22 = Fp.mul(y21, ELL2_C3); // 26. y22 = y21 * c3 - let gx2 = Fp.mul(gx1, tv1); // 27. gx2 = gx1 * tv1 # g(x2) = gx2 / gxd = 2 * u^2 * g(x1) - tv2 = Fp.sqr(y21); // 28. tv2 = y21^2 - tv2 = Fp.mul(tv2, gxd); // 29. tv2 = tv2 * gxd - let e2 = Fp.eql(tv2, gx2); // 30. e2 = tv2 == gx2 - let y2 = Fp.cmov(y22, y21, e2); // 31. y2 = CMOV(y22, y21, e2) # If g(x2) is square, this is its sqrt - tv2 = Fp.sqr(y1); // 32. tv2 = y1^2 - tv2 = Fp.mul(tv2, gxd); // 33. tv2 = tv2 * gxd - let e3 = Fp.eql(tv2, gx1); // 34. e3 = tv2 == gx1 - let xn = Fp.cmov(x2n, x1n, e3); // 35. xn = CMOV(x2n, x1n, e3) # If e3, x = x1, else x = x2 - let y = Fp.cmov(y2, y1, e3); // 36. y = CMOV(y2, y1, e3) # If e3, y = y1, else y = y2 - let e4 = Fp.isOdd!(y); // 37. e4 = sgn0(y) == 1 # Fix sign of y - y = Fp.cmov(y, Fp.neg(y), e3 !== e4); // 38. y = CMOV(y, -y, e3 XOR e4) - return { xMn: xn, xMd: xd, yMn: y, yMd: _1n }; // 39. return (xn, xd, y, 1) -} - -const ELL2_C1_EDWARDS = /* @__PURE__ */ (() => FpSqrtEven(Fp, Fp.neg(BigInt(486664))))(); // sgn0(c1) MUST equal 0 -function map_to_curve_elligator2_edwards25519(u: bigint) { - const { xMn, xMd, yMn, yMd } = map_to_curve_elligator2_curve25519(u); // 1. (xMn, xMd, yMn, yMd) = - // map_to_curve_elligator2_curve25519(u) - let xn = Fp.mul(xMn, yMd); // 2. xn = xMn * yMd - xn = Fp.mul(xn, ELL2_C1_EDWARDS); // 3. xn = xn * c1 - let xd = Fp.mul(xMd, yMn); // 4. xd = xMd * yMn # xn / xd = c1 * xM / yM - let yn = Fp.sub(xMn, xMd); // 5. yn = xMn - xMd - let yd = Fp.add(xMn, xMd); // 6. yd = xMn + xMd # (n / d - 1) / (n / d + 1) = (n - d) / (n + d) - let tv1 = Fp.mul(xd, yd); // 7. tv1 = xd * yd - let e = Fp.eql(tv1, Fp.ZERO); // 8. e = tv1 == 0 - xn = Fp.cmov(xn, Fp.ZERO, e); // 9. xn = CMOV(xn, 0, e) - xd = Fp.cmov(xd, Fp.ONE, e); // 10. xd = CMOV(xd, 1, e) - yn = Fp.cmov(yn, Fp.ONE, e); // 11. yn = CMOV(yn, 1, e) - yd = Fp.cmov(yd, Fp.ONE, e); // 12. yd = CMOV(yd, 1, e) - const [xd_inv, yd_inv] = FpInvertBatch(Fp, [xd, yd], true); // batch division - return { x: Fp.mul(xn, xd_inv), y: Fp.mul(yn, yd_inv) }; // 13. return (xn, xd, yn, yd) -} - -/** Hashing to ed25519 points / field. RFC 9380 methods. */ -export const ed25519_hasher: H2CHasher = /* @__PURE__ */ (() => - createHasher( - ed25519.Point, - (scalars: bigint[]) => map_to_curve_elligator2_edwards25519(scalars[0]), - { - DST: 'edwards25519_XMD:SHA-512_ELL2_RO_', - encodeDST: 'edwards25519_XMD:SHA-512_ELL2_NU_', - p: ed25519_CURVE_p, - m: 1, - k: 128, - expand: 'xmd', - hash: sha512, - } - ))(); - -// √(-1) aka √(a) aka 2^((p-1)/4) -const SQRT_M1 = ED25519_SQRT_M1; -// √(ad - 1) -const SQRT_AD_MINUS_ONE = /* @__PURE__ */ BigInt( - '25063068953384623474111414158702152701244531502492656460079210482610430750235' -); -// 1 / √(a-d) -const INVSQRT_A_MINUS_D = /* @__PURE__ */ BigInt( - '54469307008909316920995813868745141605393597292927456921205312896311721017578' -); -// 1-d² -const ONE_MINUS_D_SQ = /* @__PURE__ */ BigInt( - '1159843021668779879193775521855586647937357759715417654439879720876111806838' -); -// (d-1)² -const D_MINUS_ONE_SQ = /* @__PURE__ */ BigInt( - '40440834346308536858101042469323190826248399146238708352240133220865137265952' -); -// Calculates 1/√(number) -const invertSqrt = (number: bigint) => uvRatio(_1n, number); - -const MAX_255B = /* @__PURE__ */ BigInt( - '0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff' -); -const bytes255ToNumberLE = (bytes: Uint8Array) => - ed25519.Point.Fp.create(bytesToNumberLE(bytes) & MAX_255B); - -type ExtendedPoint = EdwardsPoint; - -/** - * Computes Elligator map for Ristretto255. - * Described in [RFC9380](https://www.rfc-editor.org/rfc/rfc9380#appendix-B) and on - * the [website](https://ristretto.group/formulas/elligator.html). - */ -function calcElligatorRistrettoMap(r0: bigint): ExtendedPoint { - const { d } = ed25519_CURVE; - const P = ed25519_CURVE_p; - const mod = (n: bigint) => Fp.create(n); - const r = mod(SQRT_M1 * r0 * r0); // 1 - const Ns = mod((r + _1n) * ONE_MINUS_D_SQ); // 2 - let c = BigInt(-1); // 3 - const D = mod((c - d * r) * mod(r + d)); // 4 - let { isValid: Ns_D_is_sq, value: s } = uvRatio(Ns, D); // 5 - let s_ = mod(s * r0); // 6 - if (!isNegativeLE(s_, P)) s_ = mod(-s_); - if (!Ns_D_is_sq) s = s_; // 7 - if (!Ns_D_is_sq) c = r; // 8 - const Nt = mod(c * (r - _1n) * D_MINUS_ONE_SQ - D); // 9 - const s2 = s * s; - const W0 = mod((s + s) * D); // 10 - const W1 = mod(Nt * SQRT_AD_MINUS_ONE); // 11 - const W2 = mod(_1n - s2); // 12 - const W3 = mod(_1n + s2); // 13 - return new ed25519.Point(mod(W0 * W3), mod(W2 * W1), mod(W1 * W3), mod(W0 * W2)); -} - -function ristretto255_map(bytes: Uint8Array): _RistrettoPoint { - abytes(bytes, 64); - const r1 = bytes255ToNumberLE(bytes.subarray(0, 32)); - const R1 = calcElligatorRistrettoMap(r1); - const r2 = bytes255ToNumberLE(bytes.subarray(32, 64)); - const R2 = calcElligatorRistrettoMap(r2); - return new _RistrettoPoint(R1.add(R2)); -} - -/** - * Wrapper over Edwards Point for ristretto255. - * - * Each ed25519/ExtendedPoint has 8 different equivalent points. This can be - * a source of bugs for protocols like ring signatures. Ristretto was created to solve this. - * Ristretto point operates in X:Y:Z:T extended coordinates like ExtendedPoint, - * but it should work in its own namespace: do not combine those two. - * See [RFC9496](https://www.rfc-editor.org/rfc/rfc9496). - */ -class _RistrettoPoint extends PrimeEdwardsPoint<_RistrettoPoint> { - // Do NOT change syntax: the following gymnastics is done, - // because typescript strips comments, which makes bundlers disable tree-shaking. - // prettier-ignore - static BASE: _RistrettoPoint = - /* @__PURE__ */ (() => new _RistrettoPoint(ed25519.Point.BASE))(); - // prettier-ignore - static ZERO: _RistrettoPoint = - /* @__PURE__ */ (() => new _RistrettoPoint(ed25519.Point.ZERO))(); - // prettier-ignore - static Fp: IField = - /* @__PURE__ */ (() => Fp)(); - // prettier-ignore - static Fn: IField = - /* @__PURE__ */ (() => Fn)(); - - constructor(ep: ExtendedPoint) { - super(ep); - } - - static fromAffine(ap: AffinePoint): _RistrettoPoint { - return new _RistrettoPoint(ed25519.Point.fromAffine(ap)); - } - - protected assertSame(other: _RistrettoPoint): void { - if (!(other instanceof _RistrettoPoint)) throw new Error('RistrettoPoint expected'); - } - - protected init(ep: EdwardsPoint): _RistrettoPoint { - return new _RistrettoPoint(ep); - } - - /** @deprecated use `import { ristretto255_hasher } from '@noble/curves/ed25519.js';` */ - static hashToCurve(hex: Hex): _RistrettoPoint { - return ristretto255_map(ensureBytes('ristrettoHash', hex, 64)); - } - - static fromBytes(bytes: Uint8Array): _RistrettoPoint { - abytes(bytes, 32); - const { a, d } = ed25519_CURVE; - const P = ed25519_CURVE_p; - const mod = (n: bigint) => Fp.create(n); - const s = bytes255ToNumberLE(bytes); - // 1. Check that s_bytes is the canonical encoding of a field element, or else abort. - // 3. Check that s is non-negative, or else abort - if (!equalBytes(Fp.toBytes(s), bytes) || isNegativeLE(s, P)) - throw new Error('invalid ristretto255 encoding 1'); - const s2 = mod(s * s); - const u1 = mod(_1n + a * s2); // 4 (a is -1) - const u2 = mod(_1n - a * s2); // 5 - const u1_2 = mod(u1 * u1); - const u2_2 = mod(u2 * u2); - const v = mod(a * d * u1_2 - u2_2); // 6 - const { isValid, value: I } = invertSqrt(mod(v * u2_2)); // 7 - const Dx = mod(I * u2); // 8 - const Dy = mod(I * Dx * v); // 9 - let x = mod((s + s) * Dx); // 10 - if (isNegativeLE(x, P)) x = mod(-x); // 10 - const y = mod(u1 * Dy); // 11 - const t = mod(x * y); // 12 - if (!isValid || isNegativeLE(t, P) || y === _0n) - throw new Error('invalid ristretto255 encoding 2'); - return new _RistrettoPoint(new ed25519.Point(x, y, _1n, t)); - } - - /** - * Converts ristretto-encoded string to ristretto point. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-decode). - * @param hex Ristretto-encoded 32 bytes. Not every 32-byte string is valid ristretto encoding - */ - static fromHex(hex: Hex): _RistrettoPoint { - return _RistrettoPoint.fromBytes(ensureBytes('ristrettoHex', hex, 32)); - } - - static msm(points: _RistrettoPoint[], scalars: bigint[]): _RistrettoPoint { - return pippenger(_RistrettoPoint, ed25519.Point.Fn, points, scalars); - } - - /** - * Encodes ristretto point to Uint8Array. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-encode). - */ - toBytes(): Uint8Array { - let { X, Y, Z, T } = this.ep; - const P = ed25519_CURVE_p; - const mod = (n: bigint) => Fp.create(n); - const u1 = mod(mod(Z + Y) * mod(Z - Y)); // 1 - const u2 = mod(X * Y); // 2 - // Square root always exists - const u2sq = mod(u2 * u2); - const { value: invsqrt } = invertSqrt(mod(u1 * u2sq)); // 3 - const D1 = mod(invsqrt * u1); // 4 - const D2 = mod(invsqrt * u2); // 5 - const zInv = mod(D1 * D2 * T); // 6 - let D: bigint; // 7 - if (isNegativeLE(T * zInv, P)) { - let _x = mod(Y * SQRT_M1); - let _y = mod(X * SQRT_M1); - X = _x; - Y = _y; - D = mod(D1 * INVSQRT_A_MINUS_D); - } else { - D = D2; // 8 - } - if (isNegativeLE(X * zInv, P)) Y = mod(-Y); // 9 - let s = mod((Z - Y) * D); // 10 (check footer's note, no sqrt(-a)) - if (isNegativeLE(s, P)) s = mod(-s); - return Fp.toBytes(s); // 11 - } - - /** - * Compares two Ristretto points. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-equals). - */ - equals(other: _RistrettoPoint): boolean { - this.assertSame(other); - const { X: X1, Y: Y1 } = this.ep; - const { X: X2, Y: Y2 } = other.ep; - const mod = (n: bigint) => Fp.create(n); - // (x1 * y2 == y1 * x2) | (y1 * y2 == x1 * x2) - const one = mod(X1 * Y2) === mod(Y1 * X2); - const two = mod(Y1 * Y2) === mod(X1 * X2); - return one || two; - } - - is0(): boolean { - return this.equals(_RistrettoPoint.ZERO); - } -} - -export const ristretto255: { - Point: typeof _RistrettoPoint; -} = { Point: _RistrettoPoint }; - -/** Hashing to ristretto255 points / field. RFC 9380 methods. */ -export const ristretto255_hasher: H2CHasherBase = { - hashToCurve(msg: Uint8Array, options?: htfBasicOpts): _RistrettoPoint { - const DST = options?.DST || 'ristretto255_XMD:SHA-512_R255MAP_RO_'; - const xmd = expand_message_xmd(msg, DST, 64, sha512); - return ristretto255_map(xmd); - }, - hashToScalar(msg: Uint8Array, options: htfBasicOpts = { DST: _DST_scalar }) { - const xmd = expand_message_xmd(msg, options.DST, 64, sha512); - return Fn.create(bytesToNumberLE(xmd)); - }, -}; - -// export const ristretto255_oprf: OPRF = createORPF({ -// name: 'ristretto255-SHA512', -// Point: RistrettoPoint, -// hash: sha512, -// hashToGroup: ristretto255_hasher.hashToCurve, -// hashToScalar: ristretto255_hasher.hashToScalar, -// }); - -/** - * Weird / bogus points, useful for debugging. - * All 8 ed25519 points of 8-torsion subgroup can be generated from the point - * T = `26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05`. - * ⟨T⟩ = { O, T, 2T, 3T, 4T, 5T, 6T, 7T } - */ -export const ED25519_TORSION_SUBGROUP: string[] = [ - '0100000000000000000000000000000000000000000000000000000000000000', - 'c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a', - '0000000000000000000000000000000000000000000000000000000000000080', - '26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05', - 'ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f', - '26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85', - '0000000000000000000000000000000000000000000000000000000000000000', - 'c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa', -]; - -/** @deprecated use `ed25519.utils.toMontgomery` */ -export function edwardsToMontgomeryPub(edwardsPub: Hex): Uint8Array { - return ed25519.utils.toMontgomery(ensureBytes('pub', edwardsPub)); -} -/** @deprecated use `ed25519.utils.toMontgomery` */ -export const edwardsToMontgomery: typeof edwardsToMontgomeryPub = edwardsToMontgomeryPub; - -/** @deprecated use `ed25519.utils.toMontgomerySecret` */ -export function edwardsToMontgomeryPriv(edwardsPriv: Uint8Array): Uint8Array { - return ed25519.utils.toMontgomerySecret(ensureBytes('pub', edwardsPriv)); -} - -/** @deprecated use `ristretto255.Point` */ -export const RistrettoPoint: typeof _RistrettoPoint = _RistrettoPoint; -/** @deprecated use `import { ed25519_hasher } from '@noble/curves/ed25519.js';` */ -export const hashToCurve: H2CMethod = /* @__PURE__ */ (() => ed25519_hasher.hashToCurve)(); -/** @deprecated use `import { ed25519_hasher } from '@noble/curves/ed25519.js';` */ -export const encodeToCurve: H2CMethod = /* @__PURE__ */ (() => - ed25519_hasher.encodeToCurve)(); -type RistHasher = (msg: Uint8Array, options: htfBasicOpts) => _RistrettoPoint; -/** @deprecated use `import { ristretto255_hasher } from '@noble/curves/ed25519.js';` */ -export const hashToRistretto255: RistHasher = /* @__PURE__ */ (() => - ristretto255_hasher.hashToCurve as RistHasher)(); -/** @deprecated use `import { ristretto255_hasher } from '@noble/curves/ed25519.js';` */ -export const hash_to_ristretto255: RistHasher = /* @__PURE__ */ (() => - ristretto255_hasher.hashToCurve as RistHasher)(); diff --git a/tools/mnemonic-test/node_modules/@noble/curves/src/ed448.ts b/tools/mnemonic-test/node_modules/@noble/curves/src/ed448.ts deleted file mode 100644 index bc110b79..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/src/ed448.ts +++ /dev/null @@ -1,552 +0,0 @@ -/** - * Edwards448 (not Ed448-Goldilocks) curve with following addons: - * - X448 ECDH - * - Decaf cofactor elimination - * - Elligator hash-to-group / point indistinguishability - * Conforms to RFC 8032 https://www.rfc-editor.org/rfc/rfc8032.html#section-5.2 - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { shake256 } from '@noble/hashes/sha3.js'; -import { abytes, concatBytes, createHasher as wrapConstructor } from '@noble/hashes/utils.js'; -import type { AffinePoint } from './abstract/curve.ts'; -import { pippenger } from './abstract/curve.ts'; -import { - edwards, - PrimeEdwardsPoint, - twistedEdwards, - type CurveFn, - type EdwardsOpts, - type EdwardsPoint, - type EdwardsPointCons, -} from './abstract/edwards.ts'; -import { - _DST_scalar, - createHasher, - expand_message_xof, - type H2CHasher, - type H2CHasherBase, - type H2CMethod, - type htfBasicOpts, -} from './abstract/hash-to-curve.ts'; -import { Field, FpInvertBatch, isNegativeLE, mod, pow2, type IField } from './abstract/modular.ts'; -import { montgomery, type MontgomeryECDH as XCurveFn } from './abstract/montgomery.ts'; -import { asciiToBytes, bytesToNumberLE, ensureBytes, equalBytes, type Hex } from './utils.ts'; - -// edwards448 curve -// a = 1n -// d = Fp.neg(39081n) -// Finite field 2n**448n - 2n**224n - 1n -// Subgroup order -// 2n**446n - 13818066809895115352007386748515426880336692474882178609894547503885n -const ed448_CURVE: EdwardsOpts = { - p: BigInt( - '0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffff' - ), - n: BigInt( - '0x3fffffffffffffffffffffffffffffffffffffffffffffffffffffff7cca23e9c44edb49aed63690216cc2728dc58f552378c292ab5844f3' - ), - h: BigInt(4), - a: BigInt(1), - d: BigInt( - '0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffffffffffffffffffffffffffffffffffffffffffffffff6756' - ), - Gx: BigInt( - '0x4f1970c66bed0ded221d15a622bf36da9e146570470f1767ea6de324a3d3a46412ae1af72ab66511433b80e18b00938e2626a82bc70cc05e' - ), - Gy: BigInt( - '0x693f46716eb6bc248876203756c9c7624bea73736ca3984087789c1e05a0c2d73ad3ff1ce67c39c4fdbd132c4ed7c8ad9808795bf230fa14' - ), -}; - -// E448 NIST curve is identical to edwards448, except for: -// d = 39082/39081 -// Gx = 3/2 -const E448_CURVE: EdwardsOpts = Object.assign({}, ed448_CURVE, { - d: BigInt( - '0xd78b4bdc7f0daf19f24f38c29373a2ccad46157242a50f37809b1da3412a12e79ccc9c81264cfe9ad080997058fb61c4243cc32dbaa156b9' - ), - Gx: BigInt( - '0x79a70b2b70400553ae7c9df416c792c61128751ac92969240c25a07d728bdc93e21f7787ed6972249de732f38496cd11698713093e9c04fc' - ), - Gy: BigInt( - '0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffff80000000000000000000000000000000000000000000000000000001' - ), -}); - -const shake256_114 = /* @__PURE__ */ wrapConstructor(() => shake256.create({ dkLen: 114 })); -const shake256_64 = /* @__PURE__ */ wrapConstructor(() => shake256.create({ dkLen: 64 })); - -// prettier-ignore -const _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = BigInt(4), _11n = BigInt(11); -// prettier-ignore -const _22n = BigInt(22), _44n = BigInt(44), _88n = BigInt(88), _223n = BigInt(223); - -// powPminus3div4 calculates z = x^k mod p, where k = (p-3)/4. -// Used for efficient square root calculation. -// ((P-3)/4).toString(2) would produce bits [223x 1, 0, 222x 1] -function ed448_pow_Pminus3div4(x: bigint): bigint { - const P = ed448_CURVE.p; - const b2 = (x * x * x) % P; - const b3 = (b2 * b2 * x) % P; - const b6 = (pow2(b3, _3n, P) * b3) % P; - const b9 = (pow2(b6, _3n, P) * b3) % P; - const b11 = (pow2(b9, _2n, P) * b2) % P; - const b22 = (pow2(b11, _11n, P) * b11) % P; - const b44 = (pow2(b22, _22n, P) * b22) % P; - const b88 = (pow2(b44, _44n, P) * b44) % P; - const b176 = (pow2(b88, _88n, P) * b88) % P; - const b220 = (pow2(b176, _44n, P) * b44) % P; - const b222 = (pow2(b220, _2n, P) * b2) % P; - const b223 = (pow2(b222, _1n, P) * x) % P; - return (pow2(b223, _223n, P) * b222) % P; -} - -function adjustScalarBytes(bytes: Uint8Array): Uint8Array { - // Section 5: Likewise, for X448, set the two least significant bits of the first byte to 0, - bytes[0] &= 252; // 0b11111100 - // and the most significant bit of the last byte to 1. - bytes[55] |= 128; // 0b10000000 - // NOTE: is NOOP for 56 bytes scalars (X25519/X448) - bytes[56] = 0; // Byte outside of group (456 buts vs 448 bits) - return bytes; -} - -// Constant-time ratio of u to v. Allows to combine inversion and square root u/√v. -// Uses algo from RFC8032 5.1.3. -function uvRatio(u: bigint, v: bigint): { isValid: boolean; value: bigint } { - const P = ed448_CURVE.p; - // https://www.rfc-editor.org/rfc/rfc8032#section-5.2.3 - // To compute the square root of (u/v), the first step is to compute the - // candidate root x = (u/v)^((p+1)/4). This can be done using the - // following trick, to use a single modular powering for both the - // inversion of v and the square root: - // x = (u/v)^((p+1)/4) = u³v(u⁵v³)^((p-3)/4) (mod p) - const u2v = mod(u * u * v, P); // u²v - const u3v = mod(u2v * u, P); // u³v - const u5v3 = mod(u3v * u2v * v, P); // u⁵v³ - const root = ed448_pow_Pminus3div4(u5v3); - const x = mod(u3v * root, P); - // Verify that root is exists - const x2 = mod(x * x, P); // x² - // If vx² = u, the recovered x-coordinate is x. Otherwise, no - // square root exists, and the decoding fails. - return { isValid: mod(x2 * v, P) === u, value: x }; -} - -// Finite field 2n**448n - 2n**224n - 1n -// The value fits in 448 bits, but we use 456-bit (57-byte) elements because of bitflags. -// - ed25519 fits in 255 bits, allowing using last 1 byte for specifying bit flag of point negation. -// - ed448 fits in 448 bits. We can't use last 1 byte: we can only use a bit 224 in the middle. -const Fp = /* @__PURE__ */ (() => Field(ed448_CURVE.p, { BITS: 456, isLE: true }))(); -const Fn = /* @__PURE__ */ (() => Field(ed448_CURVE.n, { BITS: 456, isLE: true }))(); -// decaf448 uses 448-bit (56-byte) keys -const Fp448 = /* @__PURE__ */ (() => Field(ed448_CURVE.p, { BITS: 448, isLE: true }))(); -const Fn448 = /* @__PURE__ */ (() => Field(ed448_CURVE.n, { BITS: 448, isLE: true }))(); - -// SHAKE256(dom4(phflag,context)||x, 114) -function dom4(data: Uint8Array, ctx: Uint8Array, phflag: boolean) { - if (ctx.length > 255) throw new Error('context must be smaller than 255, got: ' + ctx.length); - return concatBytes( - asciiToBytes('SigEd448'), - new Uint8Array([phflag ? 1 : 0, ctx.length]), - ctx, - data - ); -} -// const ed448_eddsa_opts = { adjustScalarBytes, domain: dom4 }; -// const ed448_Point = edwards(ed448_CURVE, { Fp, Fn, uvRatio }); - -const ED448_DEF = /* @__PURE__ */ (() => ({ - ...ed448_CURVE, - Fp, - Fn, - nBitLength: Fn.BITS, - hash: shake256_114, - adjustScalarBytes, - domain: dom4, - uvRatio, -}))(); - -/** - * ed448 EdDSA curve and methods. - * @example - * import { ed448 } from '@noble/curves/ed448'; - * const { secretKey, publicKey } = ed448.keygen(); - * const msg = new TextEncoder().encode('hello'); - * const sig = ed448.sign(msg, secretKey); - * const isValid = ed448.verify(sig, msg, publicKey); - */ -export const ed448: CurveFn = twistedEdwards(ED448_DEF); - -// There is no ed448ctx, since ed448 supports ctx by default -/** Prehashed version of ed448. Accepts already-hashed messages in sign() and verify(). */ -export const ed448ph: CurveFn = /* @__PURE__ */ (() => - twistedEdwards({ - ...ED448_DEF, - prehash: shake256_64, - }))(); - -/** - * E448 curve, defined by NIST. - * E448 != edwards448 used in ed448. - * E448 is birationally equivalent to edwards448. - */ -export const E448: EdwardsPointCons = edwards(E448_CURVE); - -/** - * ECDH using curve448 aka x448. - * x448 has 56-byte keys as per RFC 7748, while - * ed448 has 57-byte keys as per RFC 8032. - */ -export const x448: XCurveFn = /* @__PURE__ */ (() => { - const P = ed448_CURVE.p; - return montgomery({ - P, - type: 'x448', - powPminus2: (x: bigint): bigint => { - const Pminus3div4 = ed448_pow_Pminus3div4(x); - const Pminus3 = pow2(Pminus3div4, _2n, P); - return mod(Pminus3 * x, P); // Pminus3 * x = Pminus2 - }, - adjustScalarBytes, - }); -})(); - -// Hash To Curve Elligator2 Map -const ELL2_C1 = /* @__PURE__ */ (() => (Fp.ORDER - BigInt(3)) / BigInt(4))(); // 1. c1 = (q - 3) / 4 # Integer arithmetic -const ELL2_J = /* @__PURE__ */ BigInt(156326); - -function map_to_curve_elligator2_curve448(u: bigint) { - let tv1 = Fp.sqr(u); // 1. tv1 = u^2 - let e1 = Fp.eql(tv1, Fp.ONE); // 2. e1 = tv1 == 1 - tv1 = Fp.cmov(tv1, Fp.ZERO, e1); // 3. tv1 = CMOV(tv1, 0, e1) # If Z * u^2 == -1, set tv1 = 0 - let xd = Fp.sub(Fp.ONE, tv1); // 4. xd = 1 - tv1 - let x1n = Fp.neg(ELL2_J); // 5. x1n = -J - let tv2 = Fp.sqr(xd); // 6. tv2 = xd^2 - let gxd = Fp.mul(tv2, xd); // 7. gxd = tv2 * xd # gxd = xd^3 - let gx1 = Fp.mul(tv1, Fp.neg(ELL2_J)); // 8. gx1 = -J * tv1 # x1n + J * xd - gx1 = Fp.mul(gx1, x1n); // 9. gx1 = gx1 * x1n # x1n^2 + J * x1n * xd - gx1 = Fp.add(gx1, tv2); // 10. gx1 = gx1 + tv2 # x1n^2 + J * x1n * xd + xd^2 - gx1 = Fp.mul(gx1, x1n); // 11. gx1 = gx1 * x1n # x1n^3 + J * x1n^2 * xd + x1n * xd^2 - let tv3 = Fp.sqr(gxd); // 12. tv3 = gxd^2 - tv2 = Fp.mul(gx1, gxd); // 13. tv2 = gx1 * gxd # gx1 * gxd - tv3 = Fp.mul(tv3, tv2); // 14. tv3 = tv3 * tv2 # gx1 * gxd^3 - let y1 = Fp.pow(tv3, ELL2_C1); // 15. y1 = tv3^c1 # (gx1 * gxd^3)^((p - 3) / 4) - y1 = Fp.mul(y1, tv2); // 16. y1 = y1 * tv2 # gx1 * gxd * (gx1 * gxd^3)^((p - 3) / 4) - let x2n = Fp.mul(x1n, Fp.neg(tv1)); // 17. x2n = -tv1 * x1n # x2 = x2n / xd = -1 * u^2 * x1n / xd - let y2 = Fp.mul(y1, u); // 18. y2 = y1 * u - y2 = Fp.cmov(y2, Fp.ZERO, e1); // 19. y2 = CMOV(y2, 0, e1) - tv2 = Fp.sqr(y1); // 20. tv2 = y1^2 - tv2 = Fp.mul(tv2, gxd); // 21. tv2 = tv2 * gxd - let e2 = Fp.eql(tv2, gx1); // 22. e2 = tv2 == gx1 - let xn = Fp.cmov(x2n, x1n, e2); // 23. xn = CMOV(x2n, x1n, e2) # If e2, x = x1, else x = x2 - let y = Fp.cmov(y2, y1, e2); // 24. y = CMOV(y2, y1, e2) # If e2, y = y1, else y = y2 - let e3 = Fp.isOdd(y); // 25. e3 = sgn0(y) == 1 # Fix sign of y - y = Fp.cmov(y, Fp.neg(y), e2 !== e3); // 26. y = CMOV(y, -y, e2 XOR e3) - return { xn, xd, yn: y, yd: Fp.ONE }; // 27. return (xn, xd, y, 1) -} - -function map_to_curve_elligator2_edwards448(u: bigint) { - let { xn, xd, yn, yd } = map_to_curve_elligator2_curve448(u); // 1. (xn, xd, yn, yd) = map_to_curve_elligator2_curve448(u) - let xn2 = Fp.sqr(xn); // 2. xn2 = xn^2 - let xd2 = Fp.sqr(xd); // 3. xd2 = xd^2 - let xd4 = Fp.sqr(xd2); // 4. xd4 = xd2^2 - let yn2 = Fp.sqr(yn); // 5. yn2 = yn^2 - let yd2 = Fp.sqr(yd); // 6. yd2 = yd^2 - let xEn = Fp.sub(xn2, xd2); // 7. xEn = xn2 - xd2 - let tv2 = Fp.sub(xEn, xd2); // 8. tv2 = xEn - xd2 - xEn = Fp.mul(xEn, xd2); // 9. xEn = xEn * xd2 - xEn = Fp.mul(xEn, yd); // 10. xEn = xEn * yd - xEn = Fp.mul(xEn, yn); // 11. xEn = xEn * yn - xEn = Fp.mul(xEn, _4n); // 12. xEn = xEn * 4 - tv2 = Fp.mul(tv2, xn2); // 13. tv2 = tv2 * xn2 - tv2 = Fp.mul(tv2, yd2); // 14. tv2 = tv2 * yd2 - let tv3 = Fp.mul(yn2, _4n); // 15. tv3 = 4 * yn2 - let tv1 = Fp.add(tv3, yd2); // 16. tv1 = tv3 + yd2 - tv1 = Fp.mul(tv1, xd4); // 17. tv1 = tv1 * xd4 - let xEd = Fp.add(tv1, tv2); // 18. xEd = tv1 + tv2 - tv2 = Fp.mul(tv2, xn); // 19. tv2 = tv2 * xn - let tv4 = Fp.mul(xn, xd4); // 20. tv4 = xn * xd4 - let yEn = Fp.sub(tv3, yd2); // 21. yEn = tv3 - yd2 - yEn = Fp.mul(yEn, tv4); // 22. yEn = yEn * tv4 - yEn = Fp.sub(yEn, tv2); // 23. yEn = yEn - tv2 - tv1 = Fp.add(xn2, xd2); // 24. tv1 = xn2 + xd2 - tv1 = Fp.mul(tv1, xd2); // 25. tv1 = tv1 * xd2 - tv1 = Fp.mul(tv1, xd); // 26. tv1 = tv1 * xd - tv1 = Fp.mul(tv1, yn2); // 27. tv1 = tv1 * yn2 - tv1 = Fp.mul(tv1, BigInt(-2)); // 28. tv1 = -2 * tv1 - let yEd = Fp.add(tv2, tv1); // 29. yEd = tv2 + tv1 - tv4 = Fp.mul(tv4, yd2); // 30. tv4 = tv4 * yd2 - yEd = Fp.add(yEd, tv4); // 31. yEd = yEd + tv4 - tv1 = Fp.mul(xEd, yEd); // 32. tv1 = xEd * yEd - let e = Fp.eql(tv1, Fp.ZERO); // 33. e = tv1 == 0 - xEn = Fp.cmov(xEn, Fp.ZERO, e); // 34. xEn = CMOV(xEn, 0, e) - xEd = Fp.cmov(xEd, Fp.ONE, e); // 35. xEd = CMOV(xEd, 1, e) - yEn = Fp.cmov(yEn, Fp.ONE, e); // 36. yEn = CMOV(yEn, 1, e) - yEd = Fp.cmov(yEd, Fp.ONE, e); // 37. yEd = CMOV(yEd, 1, e) - - const inv = FpInvertBatch(Fp, [xEd, yEd], true); // batch division - return { x: Fp.mul(xEn, inv[0]), y: Fp.mul(yEn, inv[1]) }; // 38. return (xEn, xEd, yEn, yEd) -} - -/** Hashing / encoding to ed448 points / field. RFC 9380 methods. */ -export const ed448_hasher: H2CHasher = /* @__PURE__ */ (() => - createHasher(ed448.Point, (scalars: bigint[]) => map_to_curve_elligator2_edwards448(scalars[0]), { - DST: 'edwards448_XOF:SHAKE256_ELL2_RO_', - encodeDST: 'edwards448_XOF:SHAKE256_ELL2_NU_', - p: Fp.ORDER, - m: 1, - k: 224, - expand: 'xof', - hash: shake256, - }))(); - -// 1-d -const ONE_MINUS_D = /* @__PURE__ */ BigInt('39082'); -// 1-2d -const ONE_MINUS_TWO_D = /* @__PURE__ */ BigInt('78163'); -// √(-d) -const SQRT_MINUS_D = /* @__PURE__ */ BigInt( - '98944233647732219769177004876929019128417576295529901074099889598043702116001257856802131563896515373927712232092845883226922417596214' -); -// 1 / √(-d) -const INVSQRT_MINUS_D = /* @__PURE__ */ BigInt( - '315019913931389607337177038330951043522456072897266928557328499619017160722351061360252776265186336876723201881398623946864393857820716' -); -// Calculates 1/√(number) -const invertSqrt = (number: bigint) => uvRatio(_1n, number); - -/** - * Elligator map for hash-to-curve of decaf448. - * Described in [RFC9380](https://www.rfc-editor.org/rfc/rfc9380#appendix-C) - * and [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-element-derivation-2). - */ -function calcElligatorDecafMap(r0: bigint): EdwardsPoint { - const { d } = ed448_CURVE; - const P = Fp.ORDER; - const mod = (n: bigint) => Fp.create(n); - - const r = mod(-(r0 * r0)); // 1 - const u0 = mod(d * (r - _1n)); // 2 - const u1 = mod((u0 + _1n) * (u0 - r)); // 3 - - const { isValid: was_square, value: v } = uvRatio(ONE_MINUS_TWO_D, mod((r + _1n) * u1)); // 4 - - let v_prime = v; // 5 - if (!was_square) v_prime = mod(r0 * v); - - let sgn = _1n; // 6 - if (!was_square) sgn = mod(-_1n); - - const s = mod(v_prime * (r + _1n)); // 7 - let s_abs = s; - if (isNegativeLE(s, P)) s_abs = mod(-s); - - const s2 = s * s; - const W0 = mod(s_abs * _2n); // 8 - const W1 = mod(s2 + _1n); // 9 - const W2 = mod(s2 - _1n); // 10 - const W3 = mod(v_prime * s * (r - _1n) * ONE_MINUS_TWO_D + sgn); // 11 - return new ed448.Point(mod(W0 * W3), mod(W2 * W1), mod(W1 * W3), mod(W0 * W2)); -} - -function decaf448_map(bytes: Uint8Array): _DecafPoint { - abytes(bytes, 112); - const skipValidation = true; - // Note: Similar to the field element decoding described in - // [RFC7748], and unlike the field element decoding described in - // Section 5.3.1, non-canonical values are accepted. - const r1 = Fp448.create(Fp448.fromBytes(bytes.subarray(0, 56), skipValidation)); - const R1 = calcElligatorDecafMap(r1); - const r2 = Fp448.create(Fp448.fromBytes(bytes.subarray(56, 112), skipValidation)); - const R2 = calcElligatorDecafMap(r2); - return new _DecafPoint(R1.add(R2)); -} - -/** - * Each ed448/EdwardsPoint has 4 different equivalent points. This can be - * a source of bugs for protocols like ring signatures. Decaf was created to solve this. - * Decaf point operates in X:Y:Z:T extended coordinates like EdwardsPoint, - * but it should work in its own namespace: do not combine those two. - * See [RFC9496](https://www.rfc-editor.org/rfc/rfc9496). - */ -class _DecafPoint extends PrimeEdwardsPoint<_DecafPoint> { - // The following gymnastics is done because typescript strips comments otherwise - // prettier-ignore - static BASE: _DecafPoint = - /* @__PURE__ */ (() => new _DecafPoint(ed448.Point.BASE).multiplyUnsafe(_2n))(); - // prettier-ignore - static ZERO: _DecafPoint = - /* @__PURE__ */ (() => new _DecafPoint(ed448.Point.ZERO))(); - // prettier-ignore - static Fp: IField = - /* @__PURE__ */ (() => Fp448)(); - // prettier-ignore - static Fn: IField = - /* @__PURE__ */ (() => Fn448)(); - - constructor(ep: EdwardsPoint) { - super(ep); - } - - static fromAffine(ap: AffinePoint): _DecafPoint { - return new _DecafPoint(ed448.Point.fromAffine(ap)); - } - - protected assertSame(other: _DecafPoint): void { - if (!(other instanceof _DecafPoint)) throw new Error('DecafPoint expected'); - } - - protected init(ep: EdwardsPoint): _DecafPoint { - return new _DecafPoint(ep); - } - - /** @deprecated use `import { decaf448_hasher } from '@noble/curves/ed448.js';` */ - static hashToCurve(hex: Hex): _DecafPoint { - return decaf448_map(ensureBytes('decafHash', hex, 112)); - } - - static fromBytes(bytes: Uint8Array): _DecafPoint { - abytes(bytes, 56); - const { d } = ed448_CURVE; - const P = Fp.ORDER; - const mod = (n: bigint) => Fp448.create(n); - const s = Fp448.fromBytes(bytes); - - // 1. Check that s_bytes is the canonical encoding of a field element, or else abort. - // 2. Check that s is non-negative, or else abort - - if (!equalBytes(Fn448.toBytes(s), bytes) || isNegativeLE(s, P)) - throw new Error('invalid decaf448 encoding 1'); - - const s2 = mod(s * s); // 1 - const u1 = mod(_1n + s2); // 2 - const u1sq = mod(u1 * u1); - const u2 = mod(u1sq - _4n * d * s2); // 3 - - const { isValid, value: invsqrt } = invertSqrt(mod(u2 * u1sq)); // 4 - - let u3 = mod((s + s) * invsqrt * u1 * SQRT_MINUS_D); // 5 - if (isNegativeLE(u3, P)) u3 = mod(-u3); - - const x = mod(u3 * invsqrt * u2 * INVSQRT_MINUS_D); // 6 - const y = mod((_1n - s2) * invsqrt * u1); // 7 - const t = mod(x * y); // 8 - - if (!isValid) throw new Error('invalid decaf448 encoding 2'); - return new _DecafPoint(new ed448.Point(x, y, _1n, t)); - } - - /** - * Converts decaf-encoded string to decaf point. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-decode-2). - * @param hex Decaf-encoded 56 bytes. Not every 56-byte string is valid decaf encoding - */ - static fromHex(hex: Hex): _DecafPoint { - return _DecafPoint.fromBytes(ensureBytes('decafHex', hex, 56)); - } - - /** @deprecated use `import { pippenger } from '@noble/curves/abstract/curve.js';` */ - static msm(points: _DecafPoint[], scalars: bigint[]): _DecafPoint { - return pippenger(_DecafPoint, Fn, points, scalars); - } - - /** - * Encodes decaf point to Uint8Array. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-encode-2). - */ - toBytes(): Uint8Array { - const { X, Z, T } = this.ep; - const P = Fp.ORDER; - const mod = (n: bigint) => Fp.create(n); - const u1 = mod(mod(X + T) * mod(X - T)); // 1 - const x2 = mod(X * X); - const { value: invsqrt } = invertSqrt(mod(u1 * ONE_MINUS_D * x2)); // 2 - let ratio = mod(invsqrt * u1 * SQRT_MINUS_D); // 3 - if (isNegativeLE(ratio, P)) ratio = mod(-ratio); - const u2 = mod(INVSQRT_MINUS_D * ratio * Z - T); // 4 - let s = mod(ONE_MINUS_D * invsqrt * X * u2); // 5 - if (isNegativeLE(s, P)) s = mod(-s); - return Fn448.toBytes(s); - } - - /** - * Compare one point to another. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-equals-2). - */ - equals(other: _DecafPoint): boolean { - this.assertSame(other); - const { X: X1, Y: Y1 } = this.ep; - const { X: X2, Y: Y2 } = other.ep; - // (x1 * y2 == y1 * x2) - return Fp.create(X1 * Y2) === Fp.create(Y1 * X2); - } - - is0(): boolean { - return this.equals(_DecafPoint.ZERO); - } -} - -export const decaf448: { - Point: typeof _DecafPoint; -} = { Point: _DecafPoint }; - -/** Hashing to decaf448 points / field. RFC 9380 methods. */ -export const decaf448_hasher: H2CHasherBase = { - hashToCurve(msg: Uint8Array, options?: htfBasicOpts): _DecafPoint { - const DST = options?.DST || 'decaf448_XOF:SHAKE256_D448MAP_RO_'; - return decaf448_map(expand_message_xof(msg, DST, 112, 224, shake256)); - }, - // Warning: has big modulo bias of 2^-64. - // RFC is invalid. RFC says "use 64-byte xof", while for 2^-112 bias - // it must use 84-byte xof (56+56/2), not 64. - hashToScalar(msg: Uint8Array, options: htfBasicOpts = { DST: _DST_scalar }) { - // Can't use `Fn448.fromBytes()`. 64-byte input => 56-byte field element - const xof = expand_message_xof(msg, options.DST, 64, 256, shake256); - return Fn448.create(bytesToNumberLE(xof)); - }, -}; - -// export const decaf448_oprf: OPRF = createORPF({ -// name: 'decaf448-SHAKE256', -// Point: DecafPoint, -// hash: (msg: Uint8Array) => shake256(msg, { dkLen: 64 }), -// hashToGroup: decaf448_hasher.hashToCurve, -// hashToScalar: decaf448_hasher.hashToScalar, -// }); - -/** - * Weird / bogus points, useful for debugging. - * Unlike ed25519, there is no ed448 generator point which can produce full T subgroup. - * Instead, there is a Klein four-group, which spans over 2 independent 2-torsion points: - * (0, 1), (0, -1), (-1, 0), (1, 0). - */ -export const ED448_TORSION_SUBGROUP: string[] = [ - '010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', - 'fefffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffff00', - '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', - '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080', -]; - -type DcfHasher = (msg: Uint8Array, options: htfBasicOpts) => _DecafPoint; - -/** @deprecated use `decaf448.Point` */ -export const DecafPoint: typeof _DecafPoint = _DecafPoint; -/** @deprecated use `import { ed448_hasher } from '@noble/curves/ed448.js';` */ -export const hashToCurve: H2CMethod = /* @__PURE__ */ (() => ed448_hasher.hashToCurve)(); -/** @deprecated use `import { ed448_hasher } from '@noble/curves/ed448.js';` */ -export const encodeToCurve: H2CMethod = /* @__PURE__ */ (() => - ed448_hasher.encodeToCurve)(); -/** @deprecated use `import { decaf448_hasher } from '@noble/curves/ed448.js';` */ -export const hashToDecaf448: DcfHasher = /* @__PURE__ */ (() => - decaf448_hasher.hashToCurve as DcfHasher)(); -/** @deprecated use `import { decaf448_hasher } from '@noble/curves/ed448.js';` */ -export const hash_to_decaf448: DcfHasher = /* @__PURE__ */ (() => - decaf448_hasher.hashToCurve as DcfHasher)(); -/** @deprecated use `ed448.utils.toMontgomery` */ -export function edwardsToMontgomeryPub(edwardsPub: string | Uint8Array): Uint8Array { - return ed448.utils.toMontgomery(ensureBytes('pub', edwardsPub)); -} -/** @deprecated use `ed448.utils.toMontgomery` */ -export const edwardsToMontgomery: typeof edwardsToMontgomeryPub = edwardsToMontgomeryPub; diff --git a/tools/mnemonic-test/node_modules/@noble/curves/src/index.ts b/tools/mnemonic-test/node_modules/@noble/curves/src/index.ts deleted file mode 100644 index 78bd1e39..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/src/index.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Audited & minimal JS implementation of elliptic curve cryptography. - * @module - * @example -```js -import { secp256k1, schnorr } from '@noble/curves/secp256k1.js'; -import { ed25519, ed25519ph, ed25519ctx, x25519, RistrettoPoint } from '@noble/curves/ed25519.js'; -import { ed448, ed448ph, ed448ctx, x448 } from '@noble/curves/ed448.js'; -import { p256, p384, p521 } from '@noble/curves/nist.js'; -import { bls12_381 } from '@noble/curves/bls12-381.js'; -import { bn254 } from '@noble/curves/bn254.js'; -import { bytesToHex, hexToBytes, concatBytes, utf8ToBytes } from '@noble/curves/abstract/utils.js'; -``` - */ -throw new Error('root module cannot be imported: import submodules instead. Check out README'); diff --git a/tools/mnemonic-test/node_modules/@noble/curves/src/jubjub.ts b/tools/mnemonic-test/node_modules/@noble/curves/src/jubjub.ts deleted file mode 100644 index 91d687b9..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/src/jubjub.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * @deprecated - * @module - */ -import { jubjub_findGroupHash, jubjub_groupHash, jubjub as jubjubn } from './misc.ts'; - -/** @deprecated use `import { jubjub } from '@noble/curves/misc.js';` */ -export const jubjub: typeof jubjubn = jubjubn; -/** @deprecated use `import { jubjub_findGroupHash } from '@noble/curves/misc.js';` */ -export const findGroupHash: typeof jubjub_findGroupHash = jubjub_findGroupHash; -/** @deprecated use `import { jubjub_groupHash } from '@noble/curves/misc.js';` */ -export const groupHash: typeof jubjub_groupHash = jubjub_groupHash; diff --git a/tools/mnemonic-test/node_modules/@noble/curves/src/misc.ts b/tools/mnemonic-test/node_modules/@noble/curves/src/misc.ts deleted file mode 100644 index d96e5f0e..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/src/misc.ts +++ /dev/null @@ -1,124 +0,0 @@ -/** - * Miscellaneous, rarely used curves. - * jubjub, babyjubjub, pallas, vesta. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { blake256 } from '@noble/hashes/blake1.js'; -import { blake2s } from '@noble/hashes/blake2.js'; -import { sha256, sha512 } from '@noble/hashes/sha2.js'; -import { concatBytes, utf8ToBytes } from '@noble/hashes/utils.js'; -import { - twistedEdwards, - type CurveFn, - type EdwardsOpts, - type EdwardsPoint, -} from './abstract/edwards.ts'; -import { Field, mod } from './abstract/modular.ts'; -import { weierstrass, type CurveFn as WCurveFn } from './abstract/weierstrass.ts'; -import { bls12_381_Fr } from './bls12-381.ts'; -import { bn254_Fr } from './bn254.ts'; - -// Jubjub curves have 𝔽p over scalar fields of other curves. They are friendly to ZK proofs. -// jubjub Fp = bls n. babyjubjub Fp = bn254 n. -// verify manually, check bls12-381.ts and bn254.ts. -const jubjub_CURVE: EdwardsOpts = { - p: bls12_381_Fr.ORDER, - n: BigInt('0xe7db4ea6533afa906673b0101343b00a6682093ccc81082d0970e5ed6f72cb7'), - h: BigInt(8), - a: BigInt('0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000000'), - d: BigInt('0x2a9318e74bfa2b48f5fd9207e6bd7fd4292d7f6d37579d2601065fd6d6343eb1'), - Gx: BigInt('0x11dafe5d23e1218086a365b99fbf3d3be72f6afd7d1f72623e6b071492d1122b'), - Gy: BigInt('0x1d523cf1ddab1a1793132e78c866c0c33e26ba5cc220fed7cc3f870e59d292aa'), -}; -/** Curve over scalar field of bls12-381. jubjub Fp = bls n */ -export const jubjub: CurveFn = /* @__PURE__ */ twistedEdwards({ - ...jubjub_CURVE, - Fp: bls12_381_Fr, - hash: sha512, -}); - -const babyjubjub_CURVE: EdwardsOpts = { - p: bn254_Fr.ORDER, - n: BigInt('0x30644e72e131a029b85045b68181585d59f76dc1c90770533b94bee1c9093788'), - h: BigInt(8), - a: BigInt('168700'), - d: BigInt('168696'), - Gx: BigInt('0x23343e3445b673d38bcba38f25645adb494b1255b1162bb40f41a59f4d4b45e'), - Gy: BigInt('0xc19139cb84c680a6e14116da06056174a0cfa121e6e5c2450f87d64fc000001'), -}; -/** Curve over scalar field of bn254. babyjubjub Fp = bn254 n */ -export const babyjubjub: CurveFn = /* @__PURE__ */ twistedEdwards({ - ...babyjubjub_CURVE, - Fp: bn254_Fr, - hash: blake256, -}); - -const jubjub_gh_first_block = utf8ToBytes( - '096b36a5804bfacef1691e173c366a47ff5ba84a44f26ddd7e8d9f79d5b42df0' -); - -// Returns point at JubJub curve which is prime order and not zero -export function jubjub_groupHash(tag: Uint8Array, personalization: Uint8Array): EdwardsPoint { - const h = blake2s.create({ personalization, dkLen: 32 }); - h.update(jubjub_gh_first_block); - h.update(tag); - // NOTE: returns ExtendedPoint, in case it will be multiplied later - let p = jubjub.Point.fromBytes(h.digest()); - // NOTE: cannot replace with isSmallOrder, returns Point*8 - p = p.multiply(jubjub_CURVE.h); - if (p.equals(jubjub.Point.ZERO)) throw new Error('Point has small order'); - return p; -} - -// No secret data is leaked here at all. -// It operates over public data: -// const G_SPEND = jubjub.findGroupHash(Uint8Array.of(), utf8ToBytes('Item_G_')); -export function jubjub_findGroupHash(m: Uint8Array, personalization: Uint8Array): EdwardsPoint { - const tag = concatBytes(m, Uint8Array.of(0)); - const hashes = []; - for (let i = 0; i < 256; i++) { - tag[tag.length - 1] = i; - try { - hashes.push(jubjub_groupHash(tag, personalization)); - } catch (e) {} - } - if (!hashes.length) throw new Error('findGroupHash tag overflow'); - return hashes[0]; -} - -// Pasta curves. See [Spec](https://o1-labs.github.io/proof-systems/specs/pasta.html). - -export const pasta_p: bigint = BigInt( - '0x40000000000000000000000000000000224698fc094cf91b992d30ed00000001' -); -export const pasta_q: bigint = BigInt( - '0x40000000000000000000000000000000224698fc0994a8dd8c46eb2100000001' -); - -/** - * @deprecated - */ -export const pallas: WCurveFn = weierstrass({ - a: BigInt(0), - b: BigInt(5), - Fp: Field(pasta_p), - n: pasta_q, - Gx: mod(BigInt(-1), pasta_p), - Gy: BigInt(2), - h: BigInt(1), - hash: sha256, -}); -/** - * @deprecated - */ -export const vesta: WCurveFn = weierstrass({ - a: BigInt(0), - b: BigInt(5), - Fp: Field(pasta_q), - n: pasta_p, - Gx: mod(BigInt(-1), pasta_q), - Gy: BigInt(2), - h: BigInt(1), - hash: sha256, -}); diff --git a/tools/mnemonic-test/node_modules/@noble/curves/src/nist.ts b/tools/mnemonic-test/node_modules/@noble/curves/src/nist.ts deleted file mode 100644 index 50f88d62..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/src/nist.ts +++ /dev/null @@ -1,197 +0,0 @@ -/** - * Internal module for NIST P256, P384, P521 curves. - * Do not use for now. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { sha256, sha384, sha512 } from '@noble/hashes/sha2.js'; -import { createCurve, type CurveFnWithCreate } from './_shortw_utils.ts'; -import { createHasher, type H2CHasher } from './abstract/hash-to-curve.ts'; -import { Field } from './abstract/modular.ts'; -import { - mapToCurveSimpleSWU, - type WeierstrassOpts, - type WeierstrassPointCons, -} from './abstract/weierstrass.ts'; - -// p = 2n**224n * (2n**32n-1n) + 2n**192n + 2n**96n - 1n -// a = Fp256.create(BigInt('-3')); -const p256_CURVE: WeierstrassOpts = { - p: BigInt('0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff'), - n: BigInt('0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551'), - h: BigInt(1), - a: BigInt('0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc'), - b: BigInt('0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b'), - Gx: BigInt('0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296'), - Gy: BigInt('0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5'), -}; - -// p = 2n**384n - 2n**128n - 2n**96n + 2n**32n - 1n -const p384_CURVE: WeierstrassOpts = { - p: BigInt( - '0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff' - ), - n: BigInt( - '0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973' - ), - h: BigInt(1), - a: BigInt( - '0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffc' - ), - b: BigInt( - '0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef' - ), - Gx: BigInt( - '0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7' - ), - Gy: BigInt( - '0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f' - ), -}; - -// p = 2n**521n - 1n -const p521_CURVE: WeierstrassOpts = { - p: BigInt( - '0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff' - ), - n: BigInt( - '0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409' - ), - h: BigInt(1), - a: BigInt( - '0x1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc' - ), - b: BigInt( - '0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00' - ), - Gx: BigInt( - '0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66' - ), - Gy: BigInt( - '0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650' - ), -}; - -const Fp256 = Field(p256_CURVE.p); -const Fp384 = Field(p384_CURVE.p); -const Fp521 = Field(p521_CURVE.p); -type SwuOpts = { - A: bigint; - B: bigint; - Z: bigint; -}; -function createSWU(Point: WeierstrassPointCons, opts: SwuOpts) { - const map = mapToCurveSimpleSWU(Point.Fp, opts); - return (scalars: bigint[]) => map(scalars[0]); -} - -/** NIST P256 (aka secp256r1, prime256v1) curve, ECDSA and ECDH methods. */ -export const p256: CurveFnWithCreate = createCurve( - { ...p256_CURVE, Fp: Fp256, lowS: false }, - sha256 -); -/** Hashing / encoding to p256 points / field. RFC 9380 methods. */ -export const p256_hasher: H2CHasher = /* @__PURE__ */ (() => { - return createHasher( - p256.Point, - createSWU(p256.Point, { - A: p256_CURVE.a, - B: p256_CURVE.b, - Z: p256.Point.Fp.create(BigInt('-10')), - }), - { - DST: 'P256_XMD:SHA-256_SSWU_RO_', - encodeDST: 'P256_XMD:SHA-256_SSWU_NU_', - p: p256_CURVE.p, - m: 1, - k: 128, - expand: 'xmd', - hash: sha256, - } - ); -})(); - -// export const p256_oprf: OPRF = createORPF({ -// name: 'P256-SHA256', -// Point: p256.Point, -// hash: sha256, -// hashToGroup: p256_hasher.hashToCurve, -// hashToScalar: p256_hasher.hashToScalar, -// }); - -/** NIST P384 (aka secp384r1) curve, ECDSA and ECDH methods. */ -export const p384: CurveFnWithCreate = createCurve( - { ...p384_CURVE, Fp: Fp384, lowS: false }, - sha384 -); -/** Hashing / encoding to p384 points / field. RFC 9380 methods. */ -export const p384_hasher: H2CHasher = /* @__PURE__ */ (() => { - return createHasher( - p384.Point, - createSWU(p384.Point, { - A: p384_CURVE.a, - B: p384_CURVE.b, - Z: p384.Point.Fp.create(BigInt('-12')), - }), - { - DST: 'P384_XMD:SHA-384_SSWU_RO_', - encodeDST: 'P384_XMD:SHA-384_SSWU_NU_', - p: p384_CURVE.p, - m: 1, - k: 192, - expand: 'xmd', - hash: sha384, - } - ); -})(); - -// export const p384_oprf: OPRF = createORPF({ -// name: 'P384-SHA384', -// Point: p384.Point, -// hash: sha384, -// hashToGroup: p384_hasher.hashToCurve, -// hashToScalar: p384_hasher.hashToScalar, -// }); - -// const Fn521 = Field(p521_CURVE.n, { allowedScalarLengths: [65, 66] }); -/** NIST P521 (aka secp521r1) curve, ECDSA and ECDH methods. */ -export const p521: CurveFnWithCreate = createCurve( - { ...p521_CURVE, Fp: Fp521, lowS: false, allowedPrivateKeyLengths: [130, 131, 132] }, - sha512 -); - -/** @deprecated use `p256` for consistency with `p256_hasher` */ -export const secp256r1: typeof p256 = p256; -/** @deprecated use `p384` for consistency with `p384_hasher` */ -export const secp384r1: typeof p384 = p384; -/** @deprecated use `p521` for consistency with `p521_hasher` */ -export const secp521r1: typeof p521 = p521; - -/** Hashing / encoding to p521 points / field. RFC 9380 methods. */ -export const p521_hasher: H2CHasher = /* @__PURE__ */ (() => { - return createHasher( - p521.Point, - createSWU(p521.Point, { - A: p521_CURVE.a, - B: p521_CURVE.b, - Z: p521.Point.Fp.create(BigInt('-4')), - }), - { - DST: 'P521_XMD:SHA-512_SSWU_RO_', - encodeDST: 'P521_XMD:SHA-512_SSWU_NU_', - p: p521_CURVE.p, - m: 1, - k: 256, - expand: 'xmd', - hash: sha512, - } - ); -})(); - -// export const p521_oprf: OPRF = createORPF({ -// name: 'P521-SHA512', -// Point: p521.Point, -// hash: sha512, -// hashToGroup: p521_hasher.hashToCurve, -// hashToScalar: p521_hasher.hashToScalar, // produces L=98 just like in RFC -// }); diff --git a/tools/mnemonic-test/node_modules/@noble/curves/src/p256.ts b/tools/mnemonic-test/node_modules/@noble/curves/src/p256.ts deleted file mode 100644 index e881ba2d..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/src/p256.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * NIST secp256r1 aka p256. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { type H2CMethod } from './abstract/hash-to-curve.ts'; -import { p256_hasher, p256 as p256n } from './nist.ts'; -/** @deprecated use `import { p256 } from '@noble/curves/nist.js';` */ -export const p256: typeof p256n = p256n; -/** @deprecated use `import { p256 } from '@noble/curves/nist.js';` */ -export const secp256r1: typeof p256n = p256n; -/** @deprecated use `import { p256_hasher } from '@noble/curves/nist.js';` */ -export const hashToCurve: H2CMethod = /* @__PURE__ */ (() => p256_hasher.hashToCurve)(); -/** @deprecated use `import { p256_hasher } from '@noble/curves/nist.js';` */ -export const encodeToCurve: H2CMethod = /* @__PURE__ */ (() => p256_hasher.encodeToCurve)(); diff --git a/tools/mnemonic-test/node_modules/@noble/curves/src/p384.ts b/tools/mnemonic-test/node_modules/@noble/curves/src/p384.ts deleted file mode 100644 index 7275acc1..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/src/p384.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * NIST secp384r1 aka p384. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { type H2CMethod } from './abstract/hash-to-curve.ts'; -import { p384_hasher, p384 as p384n } from './nist.ts'; -/** @deprecated use `import { p384 } from '@noble/curves/nist.js';` */ -export const p384: typeof p384n = p384n; -/** @deprecated use `import { p384 } from '@noble/curves/nist.js';` */ -export const secp384r1: typeof p384n = p384n; -/** @deprecated use `import { p384_hasher } from '@noble/curves/nist.js';` */ -export const hashToCurve: H2CMethod = /* @__PURE__ */ (() => p384_hasher.hashToCurve)(); -/** @deprecated use `import { p384_hasher } from '@noble/curves/nist.js';` */ -export const encodeToCurve: H2CMethod = /* @__PURE__ */ (() => p384_hasher.encodeToCurve)(); diff --git a/tools/mnemonic-test/node_modules/@noble/curves/src/p521.ts b/tools/mnemonic-test/node_modules/@noble/curves/src/p521.ts deleted file mode 100644 index cc6bd2bd..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/src/p521.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * NIST secp521r1 aka p521. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { type H2CMethod } from './abstract/hash-to-curve.ts'; -import { p521_hasher, p521 as p521n } from './nist.ts'; -/** @deprecated use `import { p521 } from '@noble/curves/nist.js';` */ -export const p521: typeof p521n = p521n; -/** @deprecated use `import { p521 } from '@noble/curves/nist.js';` */ -export const secp521r1: typeof p521n = p521n; -/** @deprecated use `import { p521_hasher } from '@noble/curves/nist.js';` */ -export const hashToCurve: H2CMethod = /* @__PURE__ */ (() => p521_hasher.hashToCurve)(); -/** @deprecated use `import { p521_hasher } from '@noble/curves/nist.js';` */ -export const encodeToCurve: H2CMethod = /* @__PURE__ */ (() => p521_hasher.encodeToCurve)(); diff --git a/tools/mnemonic-test/node_modules/@noble/curves/src/package.json b/tools/mnemonic-test/node_modules/@noble/curves/src/package.json deleted file mode 100644 index 3dbc1ca5..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/src/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "module" -} diff --git a/tools/mnemonic-test/node_modules/@noble/curves/src/pasta.ts b/tools/mnemonic-test/node_modules/@noble/curves/src/pasta.ts deleted file mode 100644 index 1f45229b..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/src/pasta.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * @deprecated - * @module - */ -import { pallas as pn, vesta as vn } from './misc.ts'; -/** @deprecated */ -export const pallas: typeof pn = pn; -/** @deprecated */ -export const vesta: typeof vn = vn; diff --git a/tools/mnemonic-test/node_modules/@noble/curves/src/secp256k1.ts b/tools/mnemonic-test/node_modules/@noble/curves/src/secp256k1.ts deleted file mode 100644 index f62eb318..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/src/secp256k1.ts +++ /dev/null @@ -1,362 +0,0 @@ -/** - * SECG secp256k1. See [pdf](https://www.secg.org/sec2-v2.pdf). - * - * Belongs to Koblitz curves: it has efficiently-computable GLV endomorphism ψ, - * check out {@link EndomorphismOpts}. Seems to be rigid (not backdoored). - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { sha256 } from '@noble/hashes/sha2.js'; -import { randomBytes } from '@noble/hashes/utils.js'; -import { createCurve, type CurveFnWithCreate } from './_shortw_utils.ts'; -import type { CurveLengths } from './abstract/curve.ts'; -import { - createHasher, - type H2CHasher, - type H2CMethod, - isogenyMap, -} from './abstract/hash-to-curve.ts'; -import { Field, mapHashToField, mod, pow2 } from './abstract/modular.ts'; -import { - _normFnElement, - type EndomorphismOpts, - mapToCurveSimpleSWU, - type WeierstrassPoint as PointType, - type WeierstrassOpts, - type WeierstrassPointCons, -} from './abstract/weierstrass.ts'; -import type { Hex, PrivKey } from './utils.ts'; -import { - bytesToNumberBE, - concatBytes, - ensureBytes, - inRange, - numberToBytesBE, - utf8ToBytes, -} from './utils.ts'; - -// Seems like generator was produced from some seed: -// `Point.BASE.multiply(Point.Fn.inv(2n, N)).toAffine().x` -// // gives short x 0x3b78ce563f89a0ed9414f5aa28ad0d96d6795f9c63n -const secp256k1_CURVE: WeierstrassOpts = { - p: BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f'), - n: BigInt('0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141'), - h: BigInt(1), - a: BigInt(0), - b: BigInt(7), - Gx: BigInt('0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798'), - Gy: BigInt('0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8'), -}; - -const secp256k1_ENDO: EndomorphismOpts = { - beta: BigInt('0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee'), - basises: [ - [BigInt('0x3086d221a7d46bcde86c90e49284eb15'), -BigInt('0xe4437ed6010e88286f547fa90abfe4c3')], - [BigInt('0x114ca50f7a8e2f3f657c1108d9d44cfd8'), BigInt('0x3086d221a7d46bcde86c90e49284eb15')], - ], -}; - -const _0n = /* @__PURE__ */ BigInt(0); -const _1n = /* @__PURE__ */ BigInt(1); -const _2n = /* @__PURE__ */ BigInt(2); - -/** - * √n = n^((p+1)/4) for fields p = 3 mod 4. We unwrap the loop and multiply bit-by-bit. - * (P+1n/4n).toString(2) would produce bits [223x 1, 0, 22x 1, 4x 0, 11, 00] - */ -function sqrtMod(y: bigint): bigint { - const P = secp256k1_CURVE.p; - // prettier-ignore - const _3n = BigInt(3), _6n = BigInt(6), _11n = BigInt(11), _22n = BigInt(22); - // prettier-ignore - const _23n = BigInt(23), _44n = BigInt(44), _88n = BigInt(88); - const b2 = (y * y * y) % P; // x^3, 11 - const b3 = (b2 * b2 * y) % P; // x^7 - const b6 = (pow2(b3, _3n, P) * b3) % P; - const b9 = (pow2(b6, _3n, P) * b3) % P; - const b11 = (pow2(b9, _2n, P) * b2) % P; - const b22 = (pow2(b11, _11n, P) * b11) % P; - const b44 = (pow2(b22, _22n, P) * b22) % P; - const b88 = (pow2(b44, _44n, P) * b44) % P; - const b176 = (pow2(b88, _88n, P) * b88) % P; - const b220 = (pow2(b176, _44n, P) * b44) % P; - const b223 = (pow2(b220, _3n, P) * b3) % P; - const t1 = (pow2(b223, _23n, P) * b22) % P; - const t2 = (pow2(t1, _6n, P) * b2) % P; - const root = pow2(t2, _2n, P); - if (!Fpk1.eql(Fpk1.sqr(root), y)) throw new Error('Cannot find square root'); - return root; -} - -const Fpk1 = Field(secp256k1_CURVE.p, { sqrt: sqrtMod }); - -/** - * secp256k1 curve, ECDSA and ECDH methods. - * - * Field: `2n**256n - 2n**32n - 2n**9n - 2n**8n - 2n**7n - 2n**6n - 2n**4n - 1n` - * - * @example - * ```js - * import { secp256k1 } from '@noble/curves/secp256k1'; - * const { secretKey, publicKey } = secp256k1.keygen(); - * const msg = new TextEncoder().encode('hello'); - * const sig = secp256k1.sign(msg, secretKey); - * const isValid = secp256k1.verify(sig, msg, publicKey) === true; - * ``` - */ -export const secp256k1: CurveFnWithCreate = createCurve( - { ...secp256k1_CURVE, Fp: Fpk1, lowS: true, endo: secp256k1_ENDO }, - sha256 -); - -// Schnorr signatures are superior to ECDSA from above. Below is Schnorr-specific BIP0340 code. -// https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki -/** An object mapping tags to their tagged hash prefix of [SHA256(tag) | SHA256(tag)] */ -const TAGGED_HASH_PREFIXES: { [tag: string]: Uint8Array } = {}; -function taggedHash(tag: string, ...messages: Uint8Array[]): Uint8Array { - let tagP = TAGGED_HASH_PREFIXES[tag]; - if (tagP === undefined) { - const tagH = sha256(utf8ToBytes(tag)); - tagP = concatBytes(tagH, tagH); - TAGGED_HASH_PREFIXES[tag] = tagP; - } - return sha256(concatBytes(tagP, ...messages)); -} - -// ECDSA compact points are 33-byte. Schnorr is 32: we strip first byte 0x02 or 0x03 -const pointToBytes = (point: PointType) => point.toBytes(true).slice(1); -const Pointk1 = /* @__PURE__ */ (() => secp256k1.Point)(); -const hasEven = (y: bigint) => y % _2n === _0n; - -// Calculate point, scalar and bytes -function schnorrGetExtPubKey(priv: PrivKey) { - const { Fn, BASE } = Pointk1; - const d_ = _normFnElement(Fn, priv); - const p = BASE.multiply(d_); // P = d'⋅G; 0 < d' < n check is done inside - const scalar = hasEven(p.y) ? d_ : Fn.neg(d_); - return { scalar, bytes: pointToBytes(p) }; -} -/** - * lift_x from BIP340. Convert 32-byte x coordinate to elliptic curve point. - * @returns valid point checked for being on-curve - */ -function lift_x(x: bigint): PointType { - const Fp = Fpk1; - if (!Fp.isValidNot0(x)) throw new Error('invalid x: Fail if x ≥ p'); - const xx = Fp.create(x * x); - const c = Fp.create(xx * x + BigInt(7)); // Let c = x³ + 7 mod p. - let y = Fp.sqrt(c); // Let y = c^(p+1)/4 mod p. Same as sqrt(). - // Return the unique point P such that x(P) = x and - // y(P) = y if y mod 2 = 0 or y(P) = p-y otherwise. - if (!hasEven(y)) y = Fp.neg(y); - const p = Pointk1.fromAffine({ x, y }); - p.assertValidity(); - return p; -} -const num = bytesToNumberBE; -/** - * Create tagged hash, convert it to bigint, reduce modulo-n. - */ -function challenge(...args: Uint8Array[]): bigint { - return Pointk1.Fn.create(num(taggedHash('BIP0340/challenge', ...args))); -} - -/** - * Schnorr public key is just `x` coordinate of Point as per BIP340. - */ -function schnorrGetPublicKey(secretKey: Hex): Uint8Array { - return schnorrGetExtPubKey(secretKey).bytes; // d'=int(sk). Fail if d'=0 or d'≥n. Ret bytes(d'⋅G) -} - -/** - * Creates Schnorr signature as per BIP340. Verifies itself before returning anything. - * auxRand is optional and is not the sole source of k generation: bad CSPRNG won't be dangerous. - */ -function schnorrSign(message: Hex, secretKey: PrivKey, auxRand: Hex = randomBytes(32)): Uint8Array { - const { Fn } = Pointk1; - const m = ensureBytes('message', message); - const { bytes: px, scalar: d } = schnorrGetExtPubKey(secretKey); // checks for isWithinCurveOrder - const a = ensureBytes('auxRand', auxRand, 32); // Auxiliary random data a: a 32-byte array - const t = Fn.toBytes(d ^ num(taggedHash('BIP0340/aux', a))); // Let t be the byte-wise xor of bytes(d) and hash/aux(a) - const rand = taggedHash('BIP0340/nonce', t, px, m); // Let rand = hash/nonce(t || bytes(P) || m) - // Let k' = int(rand) mod n. Fail if k' = 0. Let R = k'⋅G - const { bytes: rx, scalar: k } = schnorrGetExtPubKey(rand); - const e = challenge(rx, px, m); // Let e = int(hash/challenge(bytes(R) || bytes(P) || m)) mod n. - const sig = new Uint8Array(64); // Let sig = bytes(R) || bytes((k + ed) mod n). - sig.set(rx, 0); - sig.set(Fn.toBytes(Fn.create(k + e * d)), 32); - // If Verify(bytes(P), m, sig) (see below) returns failure, abort - if (!schnorrVerify(sig, m, px)) throw new Error('sign: Invalid signature produced'); - return sig; -} - -/** - * Verifies Schnorr signature. - * Will swallow errors & return false except for initial type validation of arguments. - */ -function schnorrVerify(signature: Hex, message: Hex, publicKey: Hex): boolean { - const { Fn, BASE } = Pointk1; - const sig = ensureBytes('signature', signature, 64); - const m = ensureBytes('message', message); - const pub = ensureBytes('publicKey', publicKey, 32); - try { - const P = lift_x(num(pub)); // P = lift_x(int(pk)); fail if that fails - const r = num(sig.subarray(0, 32)); // Let r = int(sig[0:32]); fail if r ≥ p. - if (!inRange(r, _1n, secp256k1_CURVE.p)) return false; - const s = num(sig.subarray(32, 64)); // Let s = int(sig[32:64]); fail if s ≥ n. - if (!inRange(s, _1n, secp256k1_CURVE.n)) return false; - // int(challenge(bytes(r)||bytes(P)||m))%n - const e = challenge(Fn.toBytes(r), pointToBytes(P), m); - // R = s⋅G - e⋅P, where -eP == (n-e)P - const R = BASE.multiplyUnsafe(s).add(P.multiplyUnsafe(Fn.neg(e))); - const { x, y } = R.toAffine(); - // Fail if is_infinite(R) / not has_even_y(R) / x(R) ≠ r. - if (R.is0() || !hasEven(y) || x !== r) return false; - return true; - } catch (error) { - return false; - } -} - -export type SecpSchnorr = { - keygen: (seed?: Uint8Array) => { secretKey: Uint8Array; publicKey: Uint8Array }; - getPublicKey: typeof schnorrGetPublicKey; - sign: typeof schnorrSign; - verify: typeof schnorrVerify; - Point: WeierstrassPointCons; - utils: { - randomSecretKey: (seed?: Uint8Array) => Uint8Array; - pointToBytes: (point: PointType) => Uint8Array; - lift_x: typeof lift_x; - taggedHash: typeof taggedHash; - - /** @deprecated use `randomSecretKey` */ - randomPrivateKey: (seed?: Uint8Array) => Uint8Array; - /** @deprecated use `utils` */ - numberToBytesBE: typeof numberToBytesBE; - /** @deprecated use `utils` */ - bytesToNumberBE: typeof bytesToNumberBE; - /** @deprecated use `modular` */ - mod: typeof mod; - }; - lengths: CurveLengths; -}; -/** - * Schnorr signatures over secp256k1. - * https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki - * @example - * ```js - * import { schnorr } from '@noble/curves/secp256k1'; - * const { secretKey, publicKey } = schnorr.keygen(); - * // const publicKey = schnorr.getPublicKey(secretKey); - * const msg = new TextEncoder().encode('hello'); - * const sig = schnorr.sign(msg, secretKey); - * const isValid = schnorr.verify(sig, msg, publicKey); - * ``` - */ -export const schnorr: SecpSchnorr = /* @__PURE__ */ (() => { - const size = 32; - const seedLength = 48; - const randomSecretKey = (seed = randomBytes(seedLength)): Uint8Array => { - return mapHashToField(seed, secp256k1_CURVE.n); - }; - // TODO: remove - secp256k1.utils.randomSecretKey; - function keygen(seed?: Uint8Array) { - const secretKey = randomSecretKey(seed); - return { secretKey, publicKey: schnorrGetPublicKey(secretKey) }; - } - return { - keygen, - getPublicKey: schnorrGetPublicKey, - sign: schnorrSign, - verify: schnorrVerify, - Point: Pointk1, - utils: { - randomSecretKey: randomSecretKey, - randomPrivateKey: randomSecretKey, - taggedHash, - - // TODO: remove - lift_x, - pointToBytes, - numberToBytesBE, - bytesToNumberBE, - mod, - }, - lengths: { - secretKey: size, - publicKey: size, - publicKeyHasPrefix: false, - signature: size * 2, - seed: seedLength, - }, - }; -})(); - -const isoMap = /* @__PURE__ */ (() => - isogenyMap( - Fpk1, - [ - // xNum - [ - '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7', - '0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581', - '0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262', - '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c', - ], - // xDen - [ - '0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b', - '0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14', - '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1 - ], - // yNum - [ - '0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c', - '0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3', - '0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931', - '0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84', - ], - // yDen - [ - '0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b', - '0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573', - '0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f', - '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1 - ], - ].map((i) => i.map((j) => BigInt(j))) as [bigint[], bigint[], bigint[], bigint[]] - ))(); -const mapSWU = /* @__PURE__ */ (() => - mapToCurveSimpleSWU(Fpk1, { - A: BigInt('0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533'), - B: BigInt('1771'), - Z: Fpk1.create(BigInt('-11')), - }))(); - -/** Hashing / encoding to secp256k1 points / field. RFC 9380 methods. */ -export const secp256k1_hasher: H2CHasher = /* @__PURE__ */ (() => - createHasher( - secp256k1.Point, - (scalars: bigint[]) => { - const { x, y } = mapSWU(Fpk1.create(scalars[0])); - return isoMap(x, y); - }, - { - DST: 'secp256k1_XMD:SHA-256_SSWU_RO_', - encodeDST: 'secp256k1_XMD:SHA-256_SSWU_NU_', - p: Fpk1.ORDER, - m: 1, - k: 128, - expand: 'xmd', - hash: sha256, - } - ))(); - -/** @deprecated use `import { secp256k1_hasher } from '@noble/curves/secp256k1.js';` */ -export const hashToCurve: H2CMethod = /* @__PURE__ */ (() => - secp256k1_hasher.hashToCurve)(); - -/** @deprecated use `import { secp256k1_hasher } from '@noble/curves/secp256k1.js';` */ -export const encodeToCurve: H2CMethod = /* @__PURE__ */ (() => - secp256k1_hasher.encodeToCurve)(); diff --git a/tools/mnemonic-test/node_modules/@noble/curves/src/utils.ts b/tools/mnemonic-test/node_modules/@noble/curves/src/utils.ts deleted file mode 100644 index a255285a..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/src/utils.ts +++ /dev/null @@ -1,376 +0,0 @@ -/** - * Hex, bytes and number utilities. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { - abytes as abytes_, - bytesToHex as bytesToHex_, - concatBytes as concatBytes_, - hexToBytes as hexToBytes_, - isBytes as isBytes_, -} from '@noble/hashes/utils.js'; -export { - abytes, - anumber, - bytesToHex, - bytesToUtf8, - concatBytes, - hexToBytes, - isBytes, - randomBytes, - utf8ToBytes, -} from '@noble/hashes/utils.js'; -const _0n = /* @__PURE__ */ BigInt(0); -const _1n = /* @__PURE__ */ BigInt(1); -export type Hex = Uint8Array | string; // hex strings are accepted for simplicity -export type PrivKey = Hex | bigint; // bigints are accepted to ease learning curve -export type CHash = { - (message: Uint8Array | string): Uint8Array; - blockLen: number; - outputLen: number; - create(opts?: { dkLen?: number }): any; // For shake -}; -export type FHash = (message: Uint8Array | string) => Uint8Array; - -export function abool(title: string, value: boolean): void { - if (typeof value !== 'boolean') throw new Error(title + ' boolean expected, got ' + value); -} - -// tmp name until v2 -export function _abool2(value: boolean, title: string = ''): boolean { - if (typeof value !== 'boolean') { - const prefix = title && `"${title}"`; - throw new Error(prefix + 'expected boolean, got type=' + typeof value); - } - return value; -} - -// tmp name until v2 -/** Asserts something is Uint8Array. */ -export function _abytes2(value: Uint8Array, length?: number, title: string = ''): Uint8Array { - const bytes = isBytes_(value); - const len = value?.length; - const needsLen = length !== undefined; - if (!bytes || (needsLen && len !== length)) { - const prefix = title && `"${title}" `; - const ofLen = needsLen ? ` of length ${length}` : ''; - const got = bytes ? `length=${len}` : `type=${typeof value}`; - throw new Error(prefix + 'expected Uint8Array' + ofLen + ', got ' + got); - } - return value; -} - -// Used in weierstrass, der -export function numberToHexUnpadded(num: number | bigint): string { - const hex = num.toString(16); - return hex.length & 1 ? '0' + hex : hex; -} - -export function hexToNumber(hex: string): bigint { - if (typeof hex !== 'string') throw new Error('hex string expected, got ' + typeof hex); - return hex === '' ? _0n : BigInt('0x' + hex); // Big Endian -} - -// BE: Big Endian, LE: Little Endian -export function bytesToNumberBE(bytes: Uint8Array): bigint { - return hexToNumber(bytesToHex_(bytes)); -} -export function bytesToNumberLE(bytes: Uint8Array): bigint { - abytes_(bytes); - return hexToNumber(bytesToHex_(Uint8Array.from(bytes).reverse())); -} - -export function numberToBytesBE(n: number | bigint, len: number): Uint8Array { - return hexToBytes_(n.toString(16).padStart(len * 2, '0')); -} -export function numberToBytesLE(n: number | bigint, len: number): Uint8Array { - return numberToBytesBE(n, len).reverse(); -} -// Unpadded, rarely used -export function numberToVarBytesBE(n: number | bigint): Uint8Array { - return hexToBytes_(numberToHexUnpadded(n)); -} - -/** - * Takes hex string or Uint8Array, converts to Uint8Array. - * Validates output length. - * Will throw error for other types. - * @param title descriptive title for an error e.g. 'secret key' - * @param hex hex string or Uint8Array - * @param expectedLength optional, will compare to result array's length - * @returns - */ -export function ensureBytes(title: string, hex: Hex, expectedLength?: number): Uint8Array { - let res: Uint8Array; - if (typeof hex === 'string') { - try { - res = hexToBytes_(hex); - } catch (e) { - throw new Error(title + ' must be hex string or Uint8Array, cause: ' + e); - } - } else if (isBytes_(hex)) { - // Uint8Array.from() instead of hash.slice() because node.js Buffer - // is instance of Uint8Array, and its slice() creates **mutable** copy - res = Uint8Array.from(hex); - } else { - throw new Error(title + ' must be hex string or Uint8Array'); - } - const len = res.length; - if (typeof expectedLength === 'number' && len !== expectedLength) - throw new Error(title + ' of length ' + expectedLength + ' expected, got ' + len); - return res; -} - -// Compares 2 u8a-s in kinda constant time -export function equalBytes(a: Uint8Array, b: Uint8Array): boolean { - if (a.length !== b.length) return false; - let diff = 0; - for (let i = 0; i < a.length; i++) diff |= a[i] ^ b[i]; - return diff === 0; -} -/** - * Copies Uint8Array. We can't use u8a.slice(), because u8a can be Buffer, - * and Buffer#slice creates mutable copy. Never use Buffers! - */ -export function copyBytes(bytes: Uint8Array): Uint8Array { - return Uint8Array.from(bytes); -} - -/** - * Decodes 7-bit ASCII string to Uint8Array, throws on non-ascii symbols - * Should be safe to use for things expected to be ASCII. - * Returns exact same result as utf8ToBytes for ASCII or throws. - */ -export function asciiToBytes(ascii: string): Uint8Array { - return Uint8Array.from(ascii, (c, i) => { - const charCode = c.charCodeAt(0); - if (c.length !== 1 || charCode > 127) { - throw new Error( - `string contains non-ASCII character "${ascii[i]}" with code ${charCode} at position ${i}` - ); - } - return charCode; - }); -} - -/** - * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99]) - */ -// export const utf8ToBytes: typeof utf8ToBytes_ = utf8ToBytes_; -/** - * Converts bytes to string using UTF8 encoding. - * @example bytesToUtf8(Uint8Array.from([97, 98, 99])) // 'abc' - */ -// export const bytesToUtf8: typeof bytesToUtf8_ = bytesToUtf8_; - -// Is positive bigint -const isPosBig = (n: bigint) => typeof n === 'bigint' && _0n <= n; - -export function inRange(n: bigint, min: bigint, max: bigint): boolean { - return isPosBig(n) && isPosBig(min) && isPosBig(max) && min <= n && n < max; -} - -/** - * Asserts min <= n < max. NOTE: It's < max and not <= max. - * @example - * aInRange('x', x, 1n, 256n); // would assume x is in (1n..255n) - */ -export function aInRange(title: string, n: bigint, min: bigint, max: bigint): void { - // Why min <= n < max and not a (min < n < max) OR b (min <= n <= max)? - // consider P=256n, min=0n, max=P - // - a for min=0 would require -1: `inRange('x', x, -1n, P)` - // - b would commonly require subtraction: `inRange('x', x, 0n, P - 1n)` - // - our way is the cleanest: `inRange('x', x, 0n, P) - if (!inRange(n, min, max)) - throw new Error('expected valid ' + title + ': ' + min + ' <= n < ' + max + ', got ' + n); -} - -// Bit operations - -/** - * Calculates amount of bits in a bigint. - * Same as `n.toString(2).length` - * TODO: merge with nLength in modular - */ -export function bitLen(n: bigint): number { - let len; - for (len = 0; n > _0n; n >>= _1n, len += 1); - return len; -} - -/** - * Gets single bit at position. - * NOTE: first bit position is 0 (same as arrays) - * Same as `!!+Array.from(n.toString(2)).reverse()[pos]` - */ -export function bitGet(n: bigint, pos: number): bigint { - return (n >> BigInt(pos)) & _1n; -} - -/** - * Sets single bit at position. - */ -export function bitSet(n: bigint, pos: number, value: boolean): bigint { - return n | ((value ? _1n : _0n) << BigInt(pos)); -} - -/** - * Calculate mask for N bits. Not using ** operator with bigints because of old engines. - * Same as BigInt(`0b${Array(i).fill('1').join('')}`) - */ -export const bitMask = (n: number): bigint => (_1n << BigInt(n)) - _1n; - -// DRBG - -type Pred = (v: Uint8Array) => T | undefined; -/** - * Minimal HMAC-DRBG from NIST 800-90 for RFC6979 sigs. - * @returns function that will call DRBG until 2nd arg returns something meaningful - * @example - * const drbg = createHmacDRBG(32, 32, hmac); - * drbg(seed, bytesToKey); // bytesToKey must return Key or undefined - */ -export function createHmacDrbg( - hashLen: number, - qByteLen: number, - hmacFn: (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array -): (seed: Uint8Array, predicate: Pred) => T { - if (typeof hashLen !== 'number' || hashLen < 2) throw new Error('hashLen must be a number'); - if (typeof qByteLen !== 'number' || qByteLen < 2) throw new Error('qByteLen must be a number'); - if (typeof hmacFn !== 'function') throw new Error('hmacFn must be a function'); - // Step B, Step C: set hashLen to 8*ceil(hlen/8) - const u8n = (len: number) => new Uint8Array(len); // creates Uint8Array - const u8of = (byte: number) => Uint8Array.of(byte); // another shortcut - let v = u8n(hashLen); // Minimal non-full-spec HMAC-DRBG from NIST 800-90 for RFC6979 sigs. - let k = u8n(hashLen); // Steps B and C of RFC6979 3.2: set hashLen, in our case always same - let i = 0; // Iterations counter, will throw when over 1000 - const reset = () => { - v.fill(1); - k.fill(0); - i = 0; - }; - const h = (...b: Uint8Array[]) => hmacFn(k, v, ...b); // hmac(k)(v, ...values) - const reseed = (seed = u8n(0)) => { - // HMAC-DRBG reseed() function. Steps D-G - k = h(u8of(0x00), seed); // k = hmac(k || v || 0x00 || seed) - v = h(); // v = hmac(k || v) - if (seed.length === 0) return; - k = h(u8of(0x01), seed); // k = hmac(k || v || 0x01 || seed) - v = h(); // v = hmac(k || v) - }; - const gen = () => { - // HMAC-DRBG generate() function - if (i++ >= 1000) throw new Error('drbg: tried 1000 values'); - let len = 0; - const out: Uint8Array[] = []; - while (len < qByteLen) { - v = h(); - const sl = v.slice(); - out.push(sl); - len += v.length; - } - return concatBytes_(...out); - }; - const genUntil = (seed: Uint8Array, pred: Pred): T => { - reset(); - reseed(seed); // Steps D-G - let res: T | undefined = undefined; // Step H: grind until k is in [1..n-1] - while (!(res = pred(gen()))) reseed(); - reset(); - return res; - }; - return genUntil; -} - -// Validating curves and fields - -const validatorFns = { - bigint: (val: any): boolean => typeof val === 'bigint', - function: (val: any): boolean => typeof val === 'function', - boolean: (val: any): boolean => typeof val === 'boolean', - string: (val: any): boolean => typeof val === 'string', - stringOrUint8Array: (val: any): boolean => typeof val === 'string' || isBytes_(val), - isSafeInteger: (val: any): boolean => Number.isSafeInteger(val), - array: (val: any): boolean => Array.isArray(val), - field: (val: any, object: any): any => (object as any).Fp.isValid(val), - hash: (val: any): boolean => typeof val === 'function' && Number.isSafeInteger(val.outputLen), -} as const; -type Validator = keyof typeof validatorFns; -type ValMap> = { [K in keyof T]?: Validator }; -// type Record = { [P in K]: T; } - -export function validateObject>( - object: T, - validators: ValMap, - optValidators: ValMap = {} -): T { - const checkField = (fieldName: keyof T, type: Validator, isOptional: boolean) => { - const checkVal = validatorFns[type]; - if (typeof checkVal !== 'function') throw new Error('invalid validator function'); - - const val = object[fieldName as keyof typeof object]; - if (isOptional && val === undefined) return; - if (!checkVal(val, object)) { - throw new Error( - 'param ' + String(fieldName) + ' is invalid. Expected ' + type + ', got ' + val - ); - } - }; - for (const [fieldName, type] of Object.entries(validators)) checkField(fieldName, type!, false); - for (const [fieldName, type] of Object.entries(optValidators)) checkField(fieldName, type!, true); - return object; -} -// validate type tests -// const o: { a: number; b: number; c: number } = { a: 1, b: 5, c: 6 }; -// const z0 = validateObject(o, { a: 'isSafeInteger' }, { c: 'bigint' }); // Ok! -// // Should fail type-check -// const z1 = validateObject(o, { a: 'tmp' }, { c: 'zz' }); -// const z2 = validateObject(o, { a: 'isSafeInteger' }, { c: 'zz' }); -// const z3 = validateObject(o, { test: 'boolean', z: 'bug' }); -// const z4 = validateObject(o, { a: 'boolean', z: 'bug' }); - -export function isHash(val: CHash): boolean { - return typeof val === 'function' && Number.isSafeInteger(val.outputLen); -} -export function _validateObject( - object: Record, - fields: Record, - optFields: Record = {} -): void { - if (!object || typeof object !== 'object') throw new Error('expected valid options object'); - type Item = keyof typeof object; - function checkField(fieldName: Item, expectedType: string, isOpt: boolean) { - const val = object[fieldName]; - if (isOpt && val === undefined) return; - const current = typeof val; - if (current !== expectedType || val === null) - throw new Error(`param "${fieldName}" is invalid: expected ${expectedType}, got ${current}`); - } - Object.entries(fields).forEach(([k, v]) => checkField(k, v, false)); - Object.entries(optFields).forEach(([k, v]) => checkField(k, v, true)); -} - -/** - * throws not implemented error - */ -export const notImplemented = (): never => { - throw new Error('not implemented'); -}; - -/** - * Memoizes (caches) computation result. - * Uses WeakMap: the value is going auto-cleaned by GC after last reference is removed. - */ -export function memoized( - fn: (arg: T, ...args: O) => R -): (arg: T, ...args: O) => R { - const map = new WeakMap(); - return (arg: T, ...args: O): R => { - const val = map.get(arg); - if (val !== undefined) return val; - const computed = fn(arg, ...args); - map.set(arg, computed); - return computed; - }; -} diff --git a/tools/mnemonic-test/node_modules/@noble/curves/utils.d.ts b/tools/mnemonic-test/node_modules/@noble/curves/utils.d.ts deleted file mode 100644 index ebb36df9..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/utils.d.ts +++ /dev/null @@ -1,110 +0,0 @@ -export { abytes, anumber, bytesToHex, bytesToUtf8, concatBytes, hexToBytes, isBytes, randomBytes, utf8ToBytes, } from '@noble/hashes/utils.js'; -export type Hex = Uint8Array | string; -export type PrivKey = Hex | bigint; -export type CHash = { - (message: Uint8Array | string): Uint8Array; - blockLen: number; - outputLen: number; - create(opts?: { - dkLen?: number; - }): any; -}; -export type FHash = (message: Uint8Array | string) => Uint8Array; -export declare function abool(title: string, value: boolean): void; -export declare function _abool2(value: boolean, title?: string): boolean; -/** Asserts something is Uint8Array. */ -export declare function _abytes2(value: Uint8Array, length?: number, title?: string): Uint8Array; -export declare function numberToHexUnpadded(num: number | bigint): string; -export declare function hexToNumber(hex: string): bigint; -export declare function bytesToNumberBE(bytes: Uint8Array): bigint; -export declare function bytesToNumberLE(bytes: Uint8Array): bigint; -export declare function numberToBytesBE(n: number | bigint, len: number): Uint8Array; -export declare function numberToBytesLE(n: number | bigint, len: number): Uint8Array; -export declare function numberToVarBytesBE(n: number | bigint): Uint8Array; -/** - * Takes hex string or Uint8Array, converts to Uint8Array. - * Validates output length. - * Will throw error for other types. - * @param title descriptive title for an error e.g. 'secret key' - * @param hex hex string or Uint8Array - * @param expectedLength optional, will compare to result array's length - * @returns - */ -export declare function ensureBytes(title: string, hex: Hex, expectedLength?: number): Uint8Array; -export declare function equalBytes(a: Uint8Array, b: Uint8Array): boolean; -/** - * Copies Uint8Array. We can't use u8a.slice(), because u8a can be Buffer, - * and Buffer#slice creates mutable copy. Never use Buffers! - */ -export declare function copyBytes(bytes: Uint8Array): Uint8Array; -/** - * Decodes 7-bit ASCII string to Uint8Array, throws on non-ascii symbols - * Should be safe to use for things expected to be ASCII. - * Returns exact same result as utf8ToBytes for ASCII or throws. - */ -export declare function asciiToBytes(ascii: string): Uint8Array; -export declare function inRange(n: bigint, min: bigint, max: bigint): boolean; -/** - * Asserts min <= n < max. NOTE: It's < max and not <= max. - * @example - * aInRange('x', x, 1n, 256n); // would assume x is in (1n..255n) - */ -export declare function aInRange(title: string, n: bigint, min: bigint, max: bigint): void; -/** - * Calculates amount of bits in a bigint. - * Same as `n.toString(2).length` - * TODO: merge with nLength in modular - */ -export declare function bitLen(n: bigint): number; -/** - * Gets single bit at position. - * NOTE: first bit position is 0 (same as arrays) - * Same as `!!+Array.from(n.toString(2)).reverse()[pos]` - */ -export declare function bitGet(n: bigint, pos: number): bigint; -/** - * Sets single bit at position. - */ -export declare function bitSet(n: bigint, pos: number, value: boolean): bigint; -/** - * Calculate mask for N bits. Not using ** operator with bigints because of old engines. - * Same as BigInt(`0b${Array(i).fill('1').join('')}`) - */ -export declare const bitMask: (n: number) => bigint; -type Pred = (v: Uint8Array) => T | undefined; -/** - * Minimal HMAC-DRBG from NIST 800-90 for RFC6979 sigs. - * @returns function that will call DRBG until 2nd arg returns something meaningful - * @example - * const drbg = createHmacDRBG(32, 32, hmac); - * drbg(seed, bytesToKey); // bytesToKey must return Key or undefined - */ -export declare function createHmacDrbg(hashLen: number, qByteLen: number, hmacFn: (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array): (seed: Uint8Array, predicate: Pred) => T; -declare const validatorFns: { - readonly bigint: (val: any) => boolean; - readonly function: (val: any) => boolean; - readonly boolean: (val: any) => boolean; - readonly string: (val: any) => boolean; - readonly stringOrUint8Array: (val: any) => boolean; - readonly isSafeInteger: (val: any) => boolean; - readonly array: (val: any) => boolean; - readonly field: (val: any, object: any) => any; - readonly hash: (val: any) => boolean; -}; -type Validator = keyof typeof validatorFns; -type ValMap> = { - [K in keyof T]?: Validator; -}; -export declare function validateObject>(object: T, validators: ValMap, optValidators?: ValMap): T; -export declare function isHash(val: CHash): boolean; -export declare function _validateObject(object: Record, fields: Record, optFields?: Record): void; -/** - * throws not implemented error - */ -export declare const notImplemented: () => never; -/** - * Memoizes (caches) computation result. - * Uses WeakMap: the value is going auto-cleaned by GC after last reference is removed. - */ -export declare function memoized(fn: (arg: T, ...args: O) => R): (arg: T, ...args: O) => R; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/utils.d.ts.map b/tools/mnemonic-test/node_modules/@noble/curves/utils.d.ts.map deleted file mode 100644 index 01ca7521..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["src/utils.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,MAAM,EACN,OAAO,EACP,UAAU,EACV,WAAW,EACX,WAAW,EACX,UAAU,EACV,OAAO,EACP,WAAW,EACX,WAAW,GACZ,MAAM,wBAAwB,CAAC;AAGhC,MAAM,MAAM,GAAG,GAAG,UAAU,GAAG,MAAM,CAAC;AACtC,MAAM,MAAM,OAAO,GAAG,GAAG,GAAG,MAAM,CAAC;AACnC,MAAM,MAAM,KAAK,GAAG;IAClB,CAAC,OAAO,EAAE,UAAU,GAAG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CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,CAS3B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/utils.js b/tools/mnemonic-test/node_modules/@noble/curves/utils.js deleted file mode 100644 index c0940d83..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/utils.js +++ /dev/null @@ -1,360 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.notImplemented = exports.bitMask = exports.utf8ToBytes = exports.randomBytes = exports.isBytes = exports.hexToBytes = exports.concatBytes = exports.bytesToUtf8 = exports.bytesToHex = exports.anumber = exports.abytes = void 0; -exports.abool = abool; -exports._abool2 = _abool2; -exports._abytes2 = _abytes2; -exports.numberToHexUnpadded = numberToHexUnpadded; -exports.hexToNumber = hexToNumber; -exports.bytesToNumberBE = bytesToNumberBE; -exports.bytesToNumberLE = bytesToNumberLE; -exports.numberToBytesBE = numberToBytesBE; -exports.numberToBytesLE = numberToBytesLE; -exports.numberToVarBytesBE = numberToVarBytesBE; -exports.ensureBytes = ensureBytes; -exports.equalBytes = equalBytes; -exports.copyBytes = copyBytes; -exports.asciiToBytes = asciiToBytes; -exports.inRange = inRange; -exports.aInRange = aInRange; -exports.bitLen = bitLen; -exports.bitGet = bitGet; -exports.bitSet = bitSet; -exports.createHmacDrbg = createHmacDrbg; -exports.validateObject = validateObject; -exports.isHash = isHash; -exports._validateObject = _validateObject; -exports.memoized = memoized; -/** - * Hex, bytes and number utilities. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const utils_js_1 = require("@noble/hashes/utils.js"); -var utils_js_2 = require("@noble/hashes/utils.js"); -Object.defineProperty(exports, "abytes", { enumerable: true, get: function () { return utils_js_2.abytes; } }); -Object.defineProperty(exports, "anumber", { enumerable: true, get: function () { return utils_js_2.anumber; } }); -Object.defineProperty(exports, "bytesToHex", { enumerable: true, get: function () { return utils_js_2.bytesToHex; } }); -Object.defineProperty(exports, "bytesToUtf8", { enumerable: true, get: function () { return utils_js_2.bytesToUtf8; } }); -Object.defineProperty(exports, "concatBytes", { enumerable: true, get: function () { return utils_js_2.concatBytes; } }); -Object.defineProperty(exports, "hexToBytes", { enumerable: true, get: function () { return utils_js_2.hexToBytes; } }); -Object.defineProperty(exports, "isBytes", { enumerable: true, get: function () { return utils_js_2.isBytes; } }); -Object.defineProperty(exports, "randomBytes", { enumerable: true, get: function () { return utils_js_2.randomBytes; } }); -Object.defineProperty(exports, "utf8ToBytes", { enumerable: true, get: function () { return utils_js_2.utf8ToBytes; } }); -const _0n = /* @__PURE__ */ BigInt(0); -const _1n = /* @__PURE__ */ BigInt(1); -function abool(title, value) { - if (typeof value !== 'boolean') - throw new Error(title + ' boolean expected, got ' + value); -} -// tmp name until v2 -function _abool2(value, title = '') { - if (typeof value !== 'boolean') { - const prefix = title && `"${title}"`; - throw new Error(prefix + 'expected boolean, got type=' + typeof value); - } - return value; -} -// tmp name until v2 -/** Asserts something is Uint8Array. */ -function _abytes2(value, length, title = '') { - const bytes = (0, utils_js_1.isBytes)(value); - const len = value?.length; - const needsLen = length !== undefined; - if (!bytes || (needsLen && len !== length)) { - const prefix = title && `"${title}" `; - const ofLen = needsLen ? ` of length ${length}` : ''; - const got = bytes ? `length=${len}` : `type=${typeof value}`; - throw new Error(prefix + 'expected Uint8Array' + ofLen + ', got ' + got); - } - return value; -} -// Used in weierstrass, der -function numberToHexUnpadded(num) { - const hex = num.toString(16); - return hex.length & 1 ? '0' + hex : hex; -} -function hexToNumber(hex) { - if (typeof hex !== 'string') - throw new Error('hex string expected, got ' + typeof hex); - return hex === '' ? _0n : BigInt('0x' + hex); // Big Endian -} -// BE: Big Endian, LE: Little Endian -function bytesToNumberBE(bytes) { - return hexToNumber((0, utils_js_1.bytesToHex)(bytes)); -} -function bytesToNumberLE(bytes) { - (0, utils_js_1.abytes)(bytes); - return hexToNumber((0, utils_js_1.bytesToHex)(Uint8Array.from(bytes).reverse())); -} -function numberToBytesBE(n, len) { - return (0, utils_js_1.hexToBytes)(n.toString(16).padStart(len * 2, '0')); -} -function numberToBytesLE(n, len) { - return numberToBytesBE(n, len).reverse(); -} -// Unpadded, rarely used -function numberToVarBytesBE(n) { - return (0, utils_js_1.hexToBytes)(numberToHexUnpadded(n)); -} -/** - * Takes hex string or Uint8Array, converts to Uint8Array. - * Validates output length. - * Will throw error for other types. - * @param title descriptive title for an error e.g. 'secret key' - * @param hex hex string or Uint8Array - * @param expectedLength optional, will compare to result array's length - * @returns - */ -function ensureBytes(title, hex, expectedLength) { - let res; - if (typeof hex === 'string') { - try { - res = (0, utils_js_1.hexToBytes)(hex); - } - catch (e) { - throw new Error(title + ' must be hex string or Uint8Array, cause: ' + e); - } - } - else if ((0, utils_js_1.isBytes)(hex)) { - // Uint8Array.from() instead of hash.slice() because node.js Buffer - // is instance of Uint8Array, and its slice() creates **mutable** copy - res = Uint8Array.from(hex); - } - else { - throw new Error(title + ' must be hex string or Uint8Array'); - } - const len = res.length; - if (typeof expectedLength === 'number' && len !== expectedLength) - throw new Error(title + ' of length ' + expectedLength + ' expected, got ' + len); - return res; -} -// Compares 2 u8a-s in kinda constant time -function equalBytes(a, b) { - if (a.length !== b.length) - return false; - let diff = 0; - for (let i = 0; i < a.length; i++) - diff |= a[i] ^ b[i]; - return diff === 0; -} -/** - * Copies Uint8Array. We can't use u8a.slice(), because u8a can be Buffer, - * and Buffer#slice creates mutable copy. Never use Buffers! - */ -function copyBytes(bytes) { - return Uint8Array.from(bytes); -} -/** - * Decodes 7-bit ASCII string to Uint8Array, throws on non-ascii symbols - * Should be safe to use for things expected to be ASCII. - * Returns exact same result as utf8ToBytes for ASCII or throws. - */ -function asciiToBytes(ascii) { - return Uint8Array.from(ascii, (c, i) => { - const charCode = c.charCodeAt(0); - if (c.length !== 1 || charCode > 127) { - throw new Error(`string contains non-ASCII character "${ascii[i]}" with code ${charCode} at position ${i}`); - } - return charCode; - }); -} -/** - * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99]) - */ -// export const utf8ToBytes: typeof utf8ToBytes_ = utf8ToBytes_; -/** - * Converts bytes to string using UTF8 encoding. - * @example bytesToUtf8(Uint8Array.from([97, 98, 99])) // 'abc' - */ -// export const bytesToUtf8: typeof bytesToUtf8_ = bytesToUtf8_; -// Is positive bigint -const isPosBig = (n) => typeof n === 'bigint' && _0n <= n; -function inRange(n, min, max) { - return isPosBig(n) && isPosBig(min) && isPosBig(max) && min <= n && n < max; -} -/** - * Asserts min <= n < max. NOTE: It's < max and not <= max. - * @example - * aInRange('x', x, 1n, 256n); // would assume x is in (1n..255n) - */ -function aInRange(title, n, min, max) { - // Why min <= n < max and not a (min < n < max) OR b (min <= n <= max)? - // consider P=256n, min=0n, max=P - // - a for min=0 would require -1: `inRange('x', x, -1n, P)` - // - b would commonly require subtraction: `inRange('x', x, 0n, P - 1n)` - // - our way is the cleanest: `inRange('x', x, 0n, P) - if (!inRange(n, min, max)) - throw new Error('expected valid ' + title + ': ' + min + ' <= n < ' + max + ', got ' + n); -} -// Bit operations -/** - * Calculates amount of bits in a bigint. - * Same as `n.toString(2).length` - * TODO: merge with nLength in modular - */ -function bitLen(n) { - let len; - for (len = 0; n > _0n; n >>= _1n, len += 1) - ; - return len; -} -/** - * Gets single bit at position. - * NOTE: first bit position is 0 (same as arrays) - * Same as `!!+Array.from(n.toString(2)).reverse()[pos]` - */ -function bitGet(n, pos) { - return (n >> BigInt(pos)) & _1n; -} -/** - * Sets single bit at position. - */ -function bitSet(n, pos, value) { - return n | ((value ? _1n : _0n) << BigInt(pos)); -} -/** - * Calculate mask for N bits. Not using ** operator with bigints because of old engines. - * Same as BigInt(`0b${Array(i).fill('1').join('')}`) - */ -const bitMask = (n) => (_1n << BigInt(n)) - _1n; -exports.bitMask = bitMask; -/** - * Minimal HMAC-DRBG from NIST 800-90 for RFC6979 sigs. - * @returns function that will call DRBG until 2nd arg returns something meaningful - * @example - * const drbg = createHmacDRBG(32, 32, hmac); - * drbg(seed, bytesToKey); // bytesToKey must return Key or undefined - */ -function createHmacDrbg(hashLen, qByteLen, hmacFn) { - if (typeof hashLen !== 'number' || hashLen < 2) - throw new Error('hashLen must be a number'); - if (typeof qByteLen !== 'number' || qByteLen < 2) - throw new Error('qByteLen must be a number'); - if (typeof hmacFn !== 'function') - throw new Error('hmacFn must be a function'); - // Step B, Step C: set hashLen to 8*ceil(hlen/8) - const u8n = (len) => new Uint8Array(len); // creates Uint8Array - const u8of = (byte) => Uint8Array.of(byte); // another shortcut - let v = u8n(hashLen); // Minimal non-full-spec HMAC-DRBG from NIST 800-90 for RFC6979 sigs. - let k = u8n(hashLen); // Steps B and C of RFC6979 3.2: set hashLen, in our case always same - let i = 0; // Iterations counter, will throw when over 1000 - const reset = () => { - v.fill(1); - k.fill(0); - i = 0; - }; - const h = (...b) => hmacFn(k, v, ...b); // hmac(k)(v, ...values) - const reseed = (seed = u8n(0)) => { - // HMAC-DRBG reseed() function. Steps D-G - k = h(u8of(0x00), seed); // k = hmac(k || v || 0x00 || seed) - v = h(); // v = hmac(k || v) - if (seed.length === 0) - return; - k = h(u8of(0x01), seed); // k = hmac(k || v || 0x01 || seed) - v = h(); // v = hmac(k || v) - }; - const gen = () => { - // HMAC-DRBG generate() function - if (i++ >= 1000) - throw new Error('drbg: tried 1000 values'); - let len = 0; - const out = []; - while (len < qByteLen) { - v = h(); - const sl = v.slice(); - out.push(sl); - len += v.length; - } - return (0, utils_js_1.concatBytes)(...out); - }; - const genUntil = (seed, pred) => { - reset(); - reseed(seed); // Steps D-G - let res = undefined; // Step H: grind until k is in [1..n-1] - while (!(res = pred(gen()))) - reseed(); - reset(); - return res; - }; - return genUntil; -} -// Validating curves and fields -const validatorFns = { - bigint: (val) => typeof val === 'bigint', - function: (val) => typeof val === 'function', - boolean: (val) => typeof val === 'boolean', - string: (val) => typeof val === 'string', - stringOrUint8Array: (val) => typeof val === 'string' || (0, utils_js_1.isBytes)(val), - isSafeInteger: (val) => Number.isSafeInteger(val), - array: (val) => Array.isArray(val), - field: (val, object) => object.Fp.isValid(val), - hash: (val) => typeof val === 'function' && Number.isSafeInteger(val.outputLen), -}; -// type Record = { [P in K]: T; } -function validateObject(object, validators, optValidators = {}) { - const checkField = (fieldName, type, isOptional) => { - const checkVal = validatorFns[type]; - if (typeof checkVal !== 'function') - throw new Error('invalid validator function'); - const val = object[fieldName]; - if (isOptional && val === undefined) - return; - if (!checkVal(val, object)) { - throw new Error('param ' + String(fieldName) + ' is invalid. Expected ' + type + ', got ' + val); - } - }; - for (const [fieldName, type] of Object.entries(validators)) - checkField(fieldName, type, false); - for (const [fieldName, type] of Object.entries(optValidators)) - checkField(fieldName, type, true); - return object; -} -// validate type tests -// const o: { a: number; b: number; c: number } = { a: 1, b: 5, c: 6 }; -// const z0 = validateObject(o, { a: 'isSafeInteger' }, { c: 'bigint' }); // Ok! -// // Should fail type-check -// const z1 = validateObject(o, { a: 'tmp' }, { c: 'zz' }); -// const z2 = validateObject(o, { a: 'isSafeInteger' }, { c: 'zz' }); -// const z3 = validateObject(o, { test: 'boolean', z: 'bug' }); -// const z4 = validateObject(o, { a: 'boolean', z: 'bug' }); -function isHash(val) { - return typeof val === 'function' && Number.isSafeInteger(val.outputLen); -} -function _validateObject(object, fields, optFields = {}) { - if (!object || typeof object !== 'object') - throw new Error('expected valid options object'); - function checkField(fieldName, expectedType, isOpt) { - const val = object[fieldName]; - if (isOpt && val === undefined) - return; - const current = typeof val; - if (current !== expectedType || val === null) - throw new Error(`param "${fieldName}" is invalid: expected ${expectedType}, got ${current}`); - } - Object.entries(fields).forEach(([k, v]) => checkField(k, v, false)); - Object.entries(optFields).forEach(([k, v]) => checkField(k, v, true)); -} -/** - * throws not implemented error - */ -const notImplemented = () => { - throw new Error('not implemented'); -}; -exports.notImplemented = notImplemented; -/** - * Memoizes (caches) computation result. - * Uses WeakMap: the value is going auto-cleaned by GC after last reference is removed. - */ -function memoized(fn) { - const map = new WeakMap(); - return (arg, ...args) => { - const val = map.get(arg); - if (val !== undefined) - return val; - const computed = fn(arg, ...args); - map.set(arg, computed); - return computed; - }; -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/curves/utils.js.map b/tools/mnemonic-test/node_modules/@noble/curves/utils.js.map deleted file mode 100644 index 24c08b33..00000000 --- a/tools/mnemonic-test/node_modules/@noble/curves/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["src/utils.ts"],"names":[],"mappings":";;;AAmCA,sBAEC;AAGD,0BAMC;AAID,4BAWC;AAGD,kDAGC;AAED,kCAGC;AAGD,0CAEC;AACD,0CAGC;AAED,0CAEC;AACD,0CAEC;AAED,gDAEC;AAWD,kCAmBC;AAGD,gCAKC;AAKD,8BAEC;AAOD,oCAUC;AAeD,0BAEC;AAOD,4BAQC;AASD,wBAIC;AAOD,wBAEC;AAKD,wBAEC;AAkBD,wCAkDC;AAmBD,wCAoBC;AAUD,wBAEC;AACD,0CAgBC;AAaD,4BAWC;AAvXD;;;GAGG;AACH,sEAAsE;AACtE,qDAMgC;AAChC,mDAUgC;AAT9B,kGAAA,MAAM,OAAA;AACN,mGAAA,OAAO,OAAA;AACP,sGAAA,UAAU,OAAA;AACV,uGAAA,WAAW,OAAA;AACX,uGAAA,WAAW,OAAA;AACX,sGAAA,UAAU,OAAA;AACV,mGAAA,OAAO,OAAA;AACP,uGAAA,WAAW,OAAA;AACX,uGAAA,WAAW,OAAA;AAEb,MAAM,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACtC,MAAM,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAWtC,SAAgB,KAAK,CAAC,KAAa,EAAE,KAAc;IACjD,IAAI,OAAO,KAAK,KAAK,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,KAAK,GAAG,yBAAyB,GAAG,KAAK,CAAC,CAAC;AAC7F,CAAC;AAED,oBAAoB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,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AACxE,CAAC;AAED;;GAEG;AACI,MAAM,cAAc,GAAG,GAAU,EAAE;IACxC,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;AACrC,CAAC,CAAC;AAFW,QAAA,cAAc,kBAEzB;AAEF;;;GAGG;AACH,SAAgB,QAAQ,CACtB,EAA6B;IAE7B,MAAM,GAAG,GAAG,IAAI,OAAO,EAAQ,CAAC;IAChC,OAAO,CAAC,GAAM,EAAE,GAAG,IAAO,EAAK,EAAE;QAC/B,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACzB,IAAI,GAAG,KAAK,SAAS;YAAE,OAAO,GAAG,CAAC;QAClC,MAAM,QAAQ,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;QAClC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QACvB,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/LICENSE b/tools/mnemonic-test/node_modules/@noble/hashes/LICENSE deleted file mode 100644 index 9297a046..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2022 Paul Miller (https://paulmillr.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the “Software”), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/README.md b/tools/mnemonic-test/node_modules/@noble/hashes/README.md deleted file mode 100644 index 759d34bf..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/README.md +++ /dev/null @@ -1,521 +0,0 @@ -# noble-hashes - -Audited & minimal JS implementation of hash functions, MACs and KDFs. - -- 🔒 [**Audited**](#security) by an independent security firm -- 🔻 Tree-shakeable: unused code is excluded from your builds -- 🏎 Fast: hand-optimized for caveats of JS engines -- 🔍 Reliable: chained / sliding window / DoS tests and fuzzing ensure correctness -- 🔁 No unrolled loops: makes it easier to verify and reduces source code size up to 5x -- 🦘 Includes SHA, RIPEMD, BLAKE, HMAC, HKDF, PBKDF, Scrypt, Argon2 & KangarooTwelve -- 🪶 48KB for everything, 4.8KB (2.36KB gzipped) for single-hash build - -Take a glance at [GitHub Discussions](https://github.com/paulmillr/noble-hashes/discussions) for questions and support. -The library's initial development was funded by [Ethereum Foundation](https://ethereum.org/). - -### This library belongs to _noble_ cryptography - -> **noble cryptography** — high-security, easily auditable set of contained cryptographic libraries and tools. - -- Zero or minimal dependencies -- Highly readable TypeScript / JS code -- PGP-signed releases and transparent NPM builds -- All libraries: - [ciphers](https://github.com/paulmillr/noble-ciphers), - [curves](https://github.com/paulmillr/noble-curves), - [hashes](https://github.com/paulmillr/noble-hashes), - [post-quantum](https://github.com/paulmillr/noble-post-quantum), - 4kb [secp256k1](https://github.com/paulmillr/noble-secp256k1) / - [ed25519](https://github.com/paulmillr/noble-ed25519) -- [Check out homepage](https://paulmillr.com/noble/) - for reading resources, documentation and apps built with noble - -## Usage - -> `npm install @noble/hashes` - -> `deno add jsr:@noble/hashes` - -> `deno doc jsr:@noble/hashes` # command-line documentation - -We support all major platforms and runtimes. -For React Native, you may need a [polyfill for getRandomValues](https://github.com/LinusU/react-native-get-random-values). -A standalone file [noble-hashes.js](https://github.com/paulmillr/noble-hashes/releases) is also available. - -```js -// import * from '@noble/hashes'; // Error: use sub-imports, to ensure small app size -import { sha256 } from '@noble/hashes/sha2.js'; // ESM & Common.js -sha256(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])); // returns Uint8Array - -// Available modules -import { sha256, sha384, sha512, sha224, sha512_224, sha512_256 } from '@noble/hashes/sha2.js'; -import { sha3_256, sha3_512, keccak_256, keccak_512, shake128, shake256 } from '@noble/hashes/sha3.js'; -import { cshake256, turboshake256, kmac256, tuplehash256, k12, m14, keccakprg } from '@noble/hashes/sha3-addons.js'; -import { blake3 } from '@noble/hashes/blake3.js'; -import { blake2b, blake2s } from '@noble/hashes/blake2.js'; -import { blake256, blake512 } from '@noble/hashes/blake1.js'; -import { sha1, md5, ripemd160 } from '@noble/hashes/legacy.js'; -import { hmac } from '@noble/hashes/hmac.js'; -import { hkdf } from '@noble/hashes/hkdf.js'; -import { pbkdf2, pbkdf2Async } from '@noble/hashes/pbkdf2.js'; -import { scrypt, scryptAsync } from '@noble/hashes/scrypt.js'; -import { argon2d, argon2i, argon2id } from '@noble/hashes/argon2.js'; -import * as utils from '@noble/hashes/utils'; // bytesToHex, bytesToUtf8, concatBytes... -``` - -- [sha2: sha256, sha384, sha512](#sha2-sha256-sha384-sha512-and-others) -- [sha3: FIPS, SHAKE, Keccak](#sha3-fips-shake-keccak) -- [sha3-addons: cSHAKE, KMAC, K12, M14, TurboSHAKE](#sha3-addons-cshake-kmac-k12-m14-turboshake) -- [blake, blake2, blake3](#blake-blake2-blake3) | [legacy: sha1, md5, ripemd160](#legacy-sha1-md5-ripemd160) -- MACs: [hmac](#hmac) | [sha3-addons kmac](#sha3-addons-cshake-kmac-k12-m14-turboshake) | [blake3 key mode](#blake2b-blake2s-blake3) -- KDFs: [hkdf](#hkdf) | [pbkdf2](#pbkdf2) | [scrypt](#scrypt) | [argon2](#argon2) -- [utils](#utils) -- [Security](#security) | [Speed](#speed) | [Contributing & testing](#contributing--testing) | [License](#license) - -### Implementations - -Hash functions: - -- `sha256()`: receive & return `Uint8Array` -- `sha256.create().update(a).update(b).digest()`: support partial updates -- `blake3.create({ context: 'e', dkLen: 32 })`: sometimes have options -- support little-endian architecture; also experimentally big-endian -- can hash up to 4GB per chunk, with any amount of chunks - -#### sha2: sha256, sha384, sha512 and others - -```typescript -import { sha224, sha256, sha384, sha512, sha512_224, sha512_256 } from '@noble/hashes/sha2.js'; -const res = sha256(Uint8Array.from([0xbc])); // basic -for (let hash of [sha256, sha384, sha512, sha224, sha512_224, sha512_256]) { - const arr = Uint8Array.from([0x10, 0x20, 0x30]); - const a = hash(arr); - const b = hash.create().update(arr).digest(); -} -``` - -See [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and -[the paper on truncated SHA512/256](https://eprint.iacr.org/2010/548.pdf). - -#### sha3: FIPS, SHAKE, Keccak - -```typescript -import { - keccak_224, keccak_256, keccak_384, keccak_512, - sha3_224, sha3_256, sha3_384, sha3_512, - shake128, shake256, -} from '@noble/hashes/sha3.js'; -for (let hash of [ - sha3_224, sha3_256, sha3_384, sha3_512, - keccak_224, keccak_256, keccak_384, keccak_512, -]) { - const arr = Uint8Array.from([0x10, 0x20, 0x30]); - const a = hash(arr); - const b = hash.create().update(arr).digest(); -} -const shka = shake128(Uint8Array.from([0x10]), { dkLen: 512 }); -const shkb = shake256(Uint8Array.from([0x30]), { dkLen: 512 }); -``` - -See [FIPS-202](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf), -[Website](https://keccak.team/keccak.html). - -Check out [the differences between SHA-3 and Keccak](https://crypto.stackexchange.com/questions/15727/what-are-the-key-differences-between-the-draft-sha-3-standard-and-the-keccak-sub) - -#### sha3-addons: cSHAKE, KMAC, K12, M14, TurboSHAKE - -```typescript -import { - cshake128, cshake256, - k12, - keccakprg, - kmac128, kmac256, - m14, - parallelhash256, - tuplehash256, - turboshake128, turboshake256 -} from '@noble/hashes/sha3-addons.js'; -const data = Uint8Array.from([0x10, 0x20, 0x30]); -const ec1 = cshake128(data, { personalization: 'def' }); -const ec2 = cshake256(data, { personalization: 'def' }); -const et1 = turboshake128(data); -const et2 = turboshake256(data, { D: 0x05 }); - // tuplehash(['ab', 'c']) !== tuplehash(['a', 'bc']) !== tuplehash([data]) -const et3 = tuplehash256([utf8ToBytes('ab'), utf8ToBytes('c')]); -// Not parallel in JS (similar to blake3 / k12), added for compat -const ep1 = parallelhash256(data, { blockLen: 8 }); -const kk = Uint8Array.from([0xca]); -const ek10 = kmac128(kk, data); -const ek11 = kmac256(kk, data); -const ek12 = k12(data); -const ek13 = m14(data); -// pseudo-random generator, first argument is capacity. XKCP recommends 254 bits capacity for 128-bit security strength. -// * with a capacity of 254 bits. -const p = keccakprg(254); -p.feed('test'); -const rand1b = p.fetch(1); -``` - -- Full [NIST SP 800-185](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-185.pdf): - cSHAKE, KMAC, TupleHash, ParallelHash + XOF variants -- [Reduced-round Keccak](https://datatracker.ietf.org/doc/draft-irtf-cfrg-kangarootwelve/): - - 🦘 K12 aka KangarooTwelve - - M14 aka MarsupilamiFourteen - - TurboSHAKE -- [KeccakPRG](https://keccak.team/files/CSF-0.1.pdf): Pseudo-random generator based on Keccak - -#### blake, blake2, blake3 - -```typescript -import { blake224, blake256, blake384, blake512 } from '@noble/hashes/blake1.js'; -import { blake2b, blake2s } from '@noble/hashes/blake2.js'; -import { blake3 } from '@noble/hashes/blake3.js'; - -for (let hash of [ - blake224, blake256, blake384, blake512, - blake2b, blake2s, blake3 -]) { - const arr = Uint8Array.from([0x10, 0x20, 0x30]); - const a = hash(arr); - const b = hash.create().update(arr).digest(); -} - -// blake2 advanced usage -const ab = Uint8Array.from([0x01]); -blake2s(ab); -blake2s(ab, { key: new Uint8Array(32) }); -blake2s(ab, { personalization: 'pers1234' }); -blake2s(ab, { salt: 'salt1234' }); -blake2b(ab); -blake2b(ab, { key: new Uint8Array(64) }); -blake2b(ab, { personalization: 'pers1234pers1234' }); -blake2b(ab, { salt: 'salt1234salt1234' }); - -// blake3 advanced usage -blake3(ab); -blake3(ab, { dkLen: 256 }); -blake3(ab, { key: new Uint8Array(32) }); -blake3(ab, { context: 'application-name' }); -``` - -- Blake1 is legacy hash, one of SHA3 proposals. It is rarely used anywhere. See [pdf](https://www.aumasson.jp/blake/blake.pdf). -- Blake2 is popular fast hash. blake2b focuses on 64-bit platforms while blake2s is for 8-bit to 32-bit ones. See [RFC 7693](https://datatracker.ietf.org/doc/html/rfc7693), [Website](https://www.blake2.net) -- Blake3 is faster, reduced-round blake2. See [Website & specs](https://blake3.io) - -#### legacy: sha1, md5, ripemd160 - -SHA1 (RFC 3174), MD5 (RFC 1321) and RIPEMD160 (RFC 2286) legacy, weak hash functions. -Don't use them in a new protocol. What "weak" means: - -- Collisions can be made with 2^18 effort in MD5, 2^60 in SHA1, 2^80 in RIPEMD160. -- No practical pre-image attacks (only theoretical, 2^123.4) -- HMAC seems kinda ok: https://datatracker.ietf.org/doc/html/rfc6151 - -```typescript -import { md5, ripemd160, sha1 } from '@noble/hashes/legacy.js'; -for (let hash of [md5, ripemd160, sha1]) { - const arr = Uint8Array.from([0x10, 0x20, 0x30]); - const a = hash(arr); - const b = hash.create().update(arr).digest(); -} -``` - -#### hmac - -```typescript -import { hmac } from '@noble/hashes/hmac.js'; -import { sha256 } from '@noble/hashes/sha2.js'; -const key = new Uint8Array(32).fill(1); -const msg = new Uint8Array(32).fill(2); -const mac1 = hmac(sha256, key, msg); -const mac2 = hmac.create(sha256, key).update(msg).digest(); -``` - -Matches [RFC 2104](https://datatracker.ietf.org/doc/html/rfc2104). - -#### hkdf - -```typescript -import { hkdf } from '@noble/hashes/hkdf.js'; -import { randomBytes } from '@noble/hashes/utils.js'; -import { sha256 } from '@noble/hashes/sha2.js'; -const inputKey = randomBytes(32); -const salt = randomBytes(32); -const info = 'application-key'; -const hk1 = hkdf(sha256, inputKey, salt, info, 32); - -// == same as -import { extract, expand } from '@noble/hashes/hkdf.js'; -import { sha256 } from '@noble/hashes/sha2.js'; -const prk = extract(sha256, inputKey, salt); -const hk2 = expand(sha256, prk, info, 32); -``` - -Matches [RFC 5869](https://datatracker.ietf.org/doc/html/rfc5869). - -#### pbkdf2 - -```typescript -import { pbkdf2, pbkdf2Async } from '@noble/hashes/pbkdf2.js'; -import { sha256 } from '@noble/hashes/sha2.js'; -const pbkey1 = pbkdf2(sha256, 'password', 'salt', { c: 32, dkLen: 32 }); -const pbkey2 = await pbkdf2Async(sha256, 'password', 'salt', { c: 32, dkLen: 32 }); -const pbkey3 = await pbkdf2Async(sha256, Uint8Array.from([1, 2, 3]), Uint8Array.from([4, 5, 6]), { - c: 32, - dkLen: 32, -}); -``` - -Matches [RFC 2898](https://datatracker.ietf.org/doc/html/rfc2898). - -#### scrypt - -```typescript -import { scrypt, scryptAsync } from '@noble/hashes/scrypt.js'; -const scr1 = scrypt('password', 'salt', { N: 2 ** 16, r: 8, p: 1, dkLen: 32 }); -const scr2 = await scryptAsync('password', 'salt', { N: 2 ** 16, r: 8, p: 1, dkLen: 32 }); -const scr3 = await scryptAsync(Uint8Array.from([1, 2, 3]), Uint8Array.from([4, 5, 6]), { - N: 2 ** 17, - r: 8, - p: 1, - dkLen: 32, - onProgress(percentage) { - console.log('progress', percentage); - }, - maxmem: 2 ** 32 + 128 * 8 * 1, // N * r * p * 128 + (128*r*p) -}); -``` - -Conforms to [RFC 7914](https://datatracker.ietf.org/doc/html/rfc7914), -[Website](https://www.tarsnap.com/scrypt.html) - -- `N, r, p` are work factors. To understand them, see [the blog post](https://blog.filippo.io/the-scrypt-parameters/). - `r: 8, p: 1` are common. JS doesn't support parallelization, making increasing p meaningless. -- `dkLen` is the length of output bytes e.g. `32` or `64` -- `onProgress` can be used with async version of the function to report progress to a user. -- `maxmem` prevents DoS and is limited to `1GB + 1KB` (`2**30 + 2**10`), but can be adjusted using formula: `N * r * p * 128 + (128 * r * p)` - -Time it takes to derive Scrypt key under different values of N (2\*\*N) on Apple M4 (mobile phones can be 1x-4x slower): - -| N pow | Time | RAM | -| ----- | ---- | ----- | -| 16 | 0.1s | 64MB | -| 17 | 0.2s | 128MB | -| 18 | 0.4s | 256MB | -| 19 | 0.8s | 512MB | -| 20 | 1.5s | 1GB | -| 21 | 3.1s | 2GB | -| 22 | 6.2s | 4GB | -| 23 | 13s | 8GB | -| 24 | 27s | 16GB | - -> [!NOTE] -> We support N larger than `2**20` where available, however, -> not all JS engines support >= 2GB ArrayBuffer-s. -> When using such N, you'll need to manually adjust `maxmem`, using formula above. -> Other JS implementations don't support large N-s. - -#### argon2 - -```ts -import { argon2d, argon2i, argon2id } from '@noble/hashes/argon2.js'; -const arg1 = argon2id('password', 'saltsalt', { t: 2, m: 65536, p: 1, maxmem: 2 ** 32 - 1 }); -``` - -Argon2 [RFC 9106](https://datatracker.ietf.org/doc/html/rfc9106) implementation. - -> [!WARNING] -> Argon2 can't be fast in JS, because there is no fast Uint64Array. -> It is suggested to use [Scrypt](#scrypt) instead. -> Being 5x slower than native code means brute-forcing attackers have bigger advantage. - -#### utils - -```typescript -import { bytesToHex as toHex, randomBytes } from '@noble/hashes/utils'; -console.log(toHex(randomBytes(32))); -``` - -- `bytesToHex` will convert `Uint8Array` to a hex string -- `randomBytes(bytes)` will produce cryptographically secure random `Uint8Array` of length `bytes` - -## Security - -The library has been independently audited: - -- at version 1.0.0, in Jan 2022, by [Cure53](https://cure53.de) - - PDFs: [website](https://cure53.de/pentest-report_hashing-libs.pdf), [in-repo](./audit/2022-01-05-cure53-audit-nbl2.pdf) - - [Changes since audit](https://github.com/paulmillr/noble-hashes/compare/1.0.0..main). - - Scope: everything, besides `blake3`, `sha3-addons`, `sha1` and `argon2`, which have not been audited - - The audit has been funded by [Ethereum Foundation](https://ethereum.org/en/) with help of [Nomic Labs](https://nomiclabs.io) - -It is tested against property-based, cross-library and Wycheproof vectors, -and is being fuzzed in [the separate repo](https://github.com/paulmillr/fuzzing). - -If you see anything unusual: investigate and report. - -### Constant-timeness - -We're targetting algorithmic constant time. _JIT-compiler_ and _Garbage Collector_ make "constant time" -extremely hard to achieve [timing attack](https://en.wikipedia.org/wiki/Timing_attack) resistance -in a scripting language. Which means _any other JS library can't have -constant-timeness_. Even statically typed Rust, a language without GC, -[makes it harder to achieve constant-time](https://www.chosenplaintext.ca/open-source/rust-timing-shield/security) -for some cases. If your goal is absolute security, don't use any JS lib — including bindings to native ones. -Use low-level libraries & languages. - -### Memory dumping - -The library shares state buffers between hash -function calls. The buffers are zeroed-out after each call. However, if an attacker -can read application memory, you are doomed in any case: - -- At some point, input will be a string and strings are immutable in JS: - there is no way to overwrite them with zeros. For example: deriving - key from `scrypt(password, salt)` where password and salt are strings -- Input from a file will stay in file buffers -- Input / output will be re-used multiple times in application which means it could stay in memory -- `await anything()` will always write all internal variables (including numbers) - to memory. With async functions / Promises there are no guarantees when the code - chunk would be executed. Which means attacker can have plenty of time to read data from memory -- There is no way to guarantee anything about zeroing sensitive data without - complex tests-suite which will dump process memory and verify that there is - no sensitive data left. For JS it means testing all browsers (incl. mobile), - which is complex. And of course it will be useless without using the same - test-suite in the actual application that consumes the library - -### Supply chain security - -- **Commits** are signed with PGP keys, to prevent forgery. Make sure to verify commit signatures -- **Releases** are transparent and built on GitHub CI. Make sure to verify [provenance](https://docs.npmjs.com/generating-provenance-statements) logs - - Use GitHub CLI to verify single-file builds: - `gh attestation verify --owner paulmillr noble-hashes.js` -- **Rare releasing** is followed to ensure less re-audit need for end-users -- **Dependencies** are minimized and locked-down: any dependency could get hacked and users will be downloading malware with every install. - - We make sure to use as few dependencies as possible - - Automatic dep updates are prevented by locking-down version ranges; diffs are checked with `npm-diff` -- **Dev Dependencies** are disabled for end-users; they are only used to develop / build the source code - -For this package, there are 0 dependencies; and a few dev dependencies: - -- micro-bmark, micro-should and jsbt are used for benchmarking / testing / build tooling and developed by the same author -- prettier, fast-check and typescript are used for code quality / test generation / ts compilation. It's hard to audit their source code thoroughly and fully because of their size - -### Randomness - -We're deferring to built-in -[crypto.getRandomValues](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues) -which is considered cryptographically secure (CSPRNG). - -In the past, browsers had bugs that made it weak: it may happen again. -Implementing a userspace CSPRNG to get resilient to the weakness -is even worse: there is no reliable userspace source of quality entropy. - -### Quantum computers - -Cryptographically relevant quantum computer, if built, will allow to -utilize Grover's algorithm to break hashes in 2^n/2 operations, instead of 2^n. - -This means SHA256 should be replaced with SHA512, SHA3-256 with SHA3-512, SHAKE128 with SHAKE256 etc. - -Australian ASD prohibits SHA256 and similar hashes [after 2030](https://www.cyber.gov.au/resources-business-and-government/essential-cyber-security/ism/cyber-security-guidelines/guidelines-cryptography). - -## Speed - -```sh -npm run bench:install && npm run bench -``` - -Benchmarks measured on Apple M4. - -``` -# 32B -sha256 x 1,968,503 ops/sec @ 508ns/op -sha512 x 740,740 ops/sec @ 1μs/op -sha3_256 x 287,686 ops/sec @ 3μs/op -sha3_512 x 288,267 ops/sec @ 3μs/op -k12 x 476,190 ops/sec @ 2μs/op -m14 x 423,190 ops/sec @ 2μs/op -blake2b x 464,252 ops/sec @ 2μs/op -blake2s x 766,871 ops/sec @ 1μs/op -blake3 x 879,507 ops/sec @ 1μs/op - -# 1MB -sha256 x 331 ops/sec @ 3ms/op -sha512 x 129 ops/sec @ 7ms/op -sha3_256 x 38 ops/sec @ 25ms/op -sha3_512 x 20 ops/sec @ 47ms/op -k12 x 88 ops/sec @ 11ms/op -m14 x 62 ops/sec @ 15ms/op -blake2b x 69 ops/sec @ 14ms/op -blake2s x 57 ops/sec @ 17ms/op -blake3 x 72 ops/sec @ 13ms/op - -# MAC -hmac(sha256) x 599,880 ops/sec @ 1μs/op -hmac(sha512) x 197,122 ops/sec @ 5μs/op -kmac256 x 87,981 ops/sec @ 11μs/op -blake3(key) x 796,812 ops/sec @ 1μs/op - -# KDF -hkdf(sha256) x 259,942 ops/sec @ 3μs/op -blake3(context) x 424,808 ops/sec @ 2μs/op -pbkdf2(sha256, c: 2 ** 18) x 5 ops/sec @ 197ms/op -pbkdf2(sha512, c: 2 ** 18) x 1 ops/sec @ 630ms/op -scrypt(n: 2 ** 18, r: 8, p: 1) x 2 ops/sec @ 400ms/op -argon2id(t: 1, m: 256MB) 2881ms -``` - -Compare to native node.js implementation that uses C bindings instead of pure-js code: - -``` -# native (node) 32B -sha256 x 2,267,573 ops/sec -sha512 x 983,284 ops/sec -sha3_256 x 1,522,070 ops/sec -blake2b x 1,512,859 ops/sec -blake2s x 1,821,493 ops/sec -hmac(sha256) x 1,085,776 ops/sec -hkdf(sha256) x 312,109 ops/sec -# native (node) KDF -pbkdf2(sha256, c: 2 ** 18) x 5 ops/sec @ 197ms/op -pbkdf2(sha512, c: 2 ** 18) x 1 ops/sec @ 630ms/op -scrypt(n: 2 ** 18, r: 8, p: 1) x 2 ops/sec @ 378ms/op -``` - -It is possible to [make this library 4x+ faster](./benchmark/README.md) by -_doing code generation of full loop unrolls_. We've decided against it. Reasons: - -- the library must be auditable, with minimum amount of code, and zero dependencies -- most method invocations with the lib are going to be something like hashing 32b to 64kb of data -- hashing big inputs is 10x faster with low-level languages, which means you should probably pick 'em instead - -The current performance is good enough when compared to other projects; SHA256 takes only 900 nanoseconds to run. - -## Contributing & testing - -`test/misc` directory contains implementations of loop unrolling and md5. - -- `npm install && npm run build && npm test` will build the code and run tests. -- `npm run lint` / `npm run format` will run linter / fix linter issues. -- `npm run bench` will run benchmarks, which may need their deps first (`npm run bench:install`) -- `npm run build:release` will build single file -- There is **additional** 20-min DoS test `npm run test:dos` and 2-hour "big" multicore test `npm run test:big`. - See [our approach to testing](./test/README.md) - -Additional resources: - -- NTT hashes are outside of scope of the library. You can view some of them in different repos: - - [Pedersen in micro-zk-proofs](https://github.com/paulmillr/micro-zk-proofs/blob/1ed5ce1253583b2e540eef7f3477fb52bf5344ff/src/pedersen.ts) - - [Poseidon in noble-curves](https://github.com/paulmillr/noble-curves/blob/3d124dd3ecec8b6634cc0b2ba1c183aded5304f9/src/abstract/poseidon.ts) -- Check out [guidelines](https://github.com/paulmillr/guidelines) for coding practices -- See [paulmillr.com/noble](https://paulmillr.com/noble/) for useful resources, articles, documentation and demos -related to the library. - -## License - -The MIT License (MIT) - -Copyright (c) 2022 Paul Miller [(https://paulmillr.com)](https://paulmillr.com) - -See LICENSE file. diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/_assert.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/_assert.d.ts deleted file mode 100644 index 5d62f87b..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/_assert.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Internal assertion helpers. - * @module - * @deprecated - */ -import { abytes as ab, aexists as ae, anumber as an, aoutput as ao, type IHash as H } from './utils.ts'; -/** @deprecated Use import from `noble/hashes/utils` module */ -export declare const abytes: typeof ab; -/** @deprecated Use import from `noble/hashes/utils` module */ -export declare const aexists: typeof ae; -/** @deprecated Use import from `noble/hashes/utils` module */ -export declare const anumber: typeof an; -/** @deprecated Use import from `noble/hashes/utils` module */ -export declare const aoutput: typeof ao; -/** @deprecated Use import from `noble/hashes/utils` module */ -export type Hash = H; -//# sourceMappingURL=_assert.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/_assert.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/_assert.d.ts.map deleted file mode 100644 index 0ba0e4c8..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/_assert.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_assert.d.ts","sourceRoot":"","sources":["src/_assert.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,MAAM,IAAI,EAAE,EACZ,OAAO,IAAI,EAAE,EACb,OAAO,IAAI,EAAE,EACb,OAAO,IAAI,EAAE,EACb,KAAK,KAAK,IAAI,CAAC,EAChB,MAAM,YAAY,CAAC;AACpB,8DAA8D;AAC9D,eAAO,MAAM,MAAM,EAAE,OAAO,EAAO,CAAC;AACpC,8DAA8D;AAC9D,eAAO,MAAM,OAAO,EAAE,OAAO,EAAO,CAAC;AACrC,8DAA8D;AAC9D,eAAO,MAAM,OAAO,EAAE,OAAO,EAAO,CAAC;AACrC,8DAA8D;AAC9D,eAAO,MAAM,OAAO,EAAE,OAAO,EAAO,CAAC;AACrC,8DAA8D;AAC9D,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/_assert.js b/tools/mnemonic-test/node_modules/@noble/hashes/_assert.js deleted file mode 100644 index b54da64a..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/_assert.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.aoutput = exports.anumber = exports.aexists = exports.abytes = void 0; -/** - * Internal assertion helpers. - * @module - * @deprecated - */ -const utils_ts_1 = require("./utils.js"); -/** @deprecated Use import from `noble/hashes/utils` module */ -exports.abytes = utils_ts_1.abytes; -/** @deprecated Use import from `noble/hashes/utils` module */ -exports.aexists = utils_ts_1.aexists; -/** @deprecated Use import from `noble/hashes/utils` module */ -exports.anumber = utils_ts_1.anumber; -/** @deprecated Use import from `noble/hashes/utils` module */ -exports.aoutput = utils_ts_1.aoutput; -//# sourceMappingURL=_assert.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/_assert.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/_assert.js.map deleted file mode 100644 index caf8b659..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/_assert.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_assert.js","sourceRoot":"","sources":["src/_assert.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,yCAMoB;AACpB,8DAA8D;AACjD,QAAA,MAAM,GAAc,iBAAE,CAAC;AACpC,8DAA8D;AACjD,QAAA,OAAO,GAAc,kBAAE,CAAC;AACrC,8DAA8D;AACjD,QAAA,OAAO,GAAc,kBAAE,CAAC;AACrC,8DAA8D;AACjD,QAAA,OAAO,GAAc,kBAAE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/_blake.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/_blake.d.ts deleted file mode 100644 index 71ed85f9..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/_blake.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Internal blake variable. - * For BLAKE2b, the two extra permutations for rounds 10 and 11 are SIGMA[10..11] = SIGMA[0..1]. - */ -export declare const BSIGMA: Uint8Array; -export type Num4 = { - a: number; - b: number; - c: number; - d: number; -}; -export declare function G1s(a: number, b: number, c: number, d: number, x: number): Num4; -export declare function G2s(a: number, b: number, c: number, d: number, x: number): Num4; -//# sourceMappingURL=_blake.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/_blake.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/_blake.d.ts.map deleted file mode 100644 index 7b11ac1f..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/_blake.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_blake.d.ts","sourceRoot":"","sources":["src/_blake.ts"],"names":[],"mappings":"AAMA;;;GAGG;AAEH,eAAO,MAAM,MAAM,EAAE,UAkBnB,CAAC;AAGH,MAAM,MAAM,IAAI,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;CAAE,CAAC;AAGnE,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAM/E;AAED,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAM/E"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/_blake.js b/tools/mnemonic-test/node_modules/@noble/hashes/_blake.js deleted file mode 100644 index a0b2cb16..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/_blake.js +++ /dev/null @@ -1,50 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.BSIGMA = void 0; -exports.G1s = G1s; -exports.G2s = G2s; -/** - * Internal helpers for blake hash. - * @module - */ -const utils_ts_1 = require("./utils.js"); -/** - * Internal blake variable. - * For BLAKE2b, the two extra permutations for rounds 10 and 11 are SIGMA[10..11] = SIGMA[0..1]. - */ -// prettier-ignore -exports.BSIGMA = Uint8Array.from([ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3, - 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4, - 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8, - 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13, - 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9, - 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11, - 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10, - 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5, - 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3, - // Blake1, unused in others - 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4, - 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8, - 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13, - 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9, -]); -// Mixing function G splitted in two halfs -function G1s(a, b, c, d, x) { - a = (a + b + x) | 0; - d = (0, utils_ts_1.rotr)(d ^ a, 16); - c = (c + d) | 0; - b = (0, utils_ts_1.rotr)(b ^ c, 12); - return { a, b, c, d }; -} -function G2s(a, b, c, d, x) { - a = (a + b + x) | 0; - d = (0, utils_ts_1.rotr)(d ^ a, 8); - c = (c + d) | 0; - b = (0, utils_ts_1.rotr)(b ^ c, 7); - return { a, b, c, d }; -} -//# sourceMappingURL=_blake.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/_blake.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/_blake.js.map deleted file mode 100644 index b081eb6b..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/_blake.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_blake.js","sourceRoot":"","sources":["src/_blake.ts"],"names":[],"mappings":";;;AAmCA,kBAMC;AAED,kBAMC;AAjDD;;;GAGG;AACH,yCAAkC;AAElC;;;GAGG;AACH,kBAAkB;AACL,QAAA,MAAM,GAA+B,UAAU,CAAC,IAAI,CAAC;IAChE,CAAC,EAAE,CAAC,EAAE,CA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AC,GAAG,CAAC,CAAC;IACpB,CAAC,GAAG,IAAA,eAAI,EAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IACnB,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IAChB,CAAC,GAAG,IAAA,eAAI,EAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IACnB,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/_md.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/_md.d.ts deleted file mode 100644 index ae184df9..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/_md.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Internal Merkle-Damgard hash utils. - * @module - */ -import { type Input, Hash } from './utils.ts'; -/** Polyfill for Safari 14. https://caniuse.com/mdn-javascript_builtins_dataview_setbiguint64 */ -export declare function setBigUint64(view: DataView, byteOffset: number, value: bigint, isLE: boolean): void; -/** Choice: a ? b : c */ -export declare function Chi(a: number, b: number, c: number): number; -/** Majority function, true if any two inputs is true. */ -export declare function Maj(a: number, b: number, c: number): number; -/** - * Merkle-Damgard hash construction base class. - * Could be used to create MD5, RIPEMD, SHA1, SHA2. - */ -export declare abstract class HashMD> extends Hash { - protected abstract process(buf: DataView, offset: number): void; - protected abstract get(): number[]; - protected abstract set(...args: number[]): void; - abstract destroy(): void; - protected abstract roundClean(): void; - readonly blockLen: number; - readonly outputLen: number; - readonly padOffset: number; - readonly isLE: boolean; - protected buffer: Uint8Array; - protected view: DataView; - protected finished: boolean; - protected length: number; - protected pos: number; - protected destroyed: boolean; - constructor(blockLen: number, outputLen: number, padOffset: number, isLE: boolean); - update(data: Input): this; - digestInto(out: Uint8Array): void; - digest(): Uint8Array; - _cloneInto(to?: T): T; - clone(): T; -} -/** - * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53. - * Check out `test/misc/sha2-gen-iv.js` for recomputation guide. - */ -/** Initial SHA256 state. Bits 0..32 of frac part of sqrt of primes 2..19 */ -export declare const SHA256_IV: Uint32Array; -/** Initial SHA224 state. Bits 32..64 of frac part of sqrt of primes 23..53 */ -export declare const SHA224_IV: Uint32Array; -/** Initial SHA384 state. Bits 0..64 of frac part of sqrt of primes 23..53 */ -export declare const SHA384_IV: Uint32Array; -/** Initial SHA512 state. Bits 0..64 of frac part of sqrt of primes 2..19 */ -export declare const SHA512_IV: Uint32Array; -//# sourceMappingURL=_md.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/_md.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/_md.d.ts.map deleted file mode 100644 index 0f653d1c..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/_md.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_md.d.ts","sourceRoot":"","sources":["src/_md.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,KAAK,KAAK,EAAE,IAAI,EAAwD,MAAM,YAAY,CAAC;AAEpG,gGAAgG;AAChG,wBAAgB,YAAY,CAC1B,IAAI,EAAE,QAAQ,EACd,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,OAAO,GACZ,IAAI,CAUN;AAED,wBAAwB;AACxB,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,yDAAyD;AACzD,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED;;;GAGG;AACH,8BAAsB,MAAM,CAAC,CAAC,SAAS,MAAM,CAAC,CAAC,CAAC,CAAE,SAAQ,IAAI,CAAC,CAAC,CAAC;I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;AAC5E,eAAO,MAAM,SAAS,EAAE,WAGtB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/_md.js b/tools/mnemonic-test/node_modules/@noble/hashes/_md.js deleted file mode 100644 index 53047f3a..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/_md.js +++ /dev/null @@ -1,162 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.SHA512_IV = exports.SHA384_IV = exports.SHA224_IV = exports.SHA256_IV = exports.HashMD = void 0; -exports.setBigUint64 = setBigUint64; -exports.Chi = Chi; -exports.Maj = Maj; -/** - * Internal Merkle-Damgard hash utils. - * @module - */ -const utils_ts_1 = require("./utils.js"); -/** Polyfill for Safari 14. https://caniuse.com/mdn-javascript_builtins_dataview_setbiguint64 */ -function setBigUint64(view, byteOffset, value, isLE) { - if (typeof view.setBigUint64 === 'function') - return view.setBigUint64(byteOffset, value, isLE); - const _32n = BigInt(32); - const _u32_max = BigInt(0xffffffff); - const wh = Number((value >> _32n) & _u32_max); - const wl = Number(value & _u32_max); - const h = isLE ? 4 : 0; - const l = isLE ? 0 : 4; - view.setUint32(byteOffset + h, wh, isLE); - view.setUint32(byteOffset + l, wl, isLE); -} -/** Choice: a ? b : c */ -function Chi(a, b, c) { - return (a & b) ^ (~a & c); -} -/** Majority function, true if any two inputs is true. */ -function Maj(a, b, c) { - return (a & b) ^ (a & c) ^ (b & c); -} -/** - * Merkle-Damgard hash construction base class. - * Could be used to create MD5, RIPEMD, SHA1, SHA2. - */ -class HashMD extends utils_ts_1.Hash { - constructor(blockLen, outputLen, padOffset, isLE) { - super(); - this.finished = false; - this.length = 0; - this.pos = 0; - this.destroyed = false; - this.blockLen = blockLen; - this.outputLen = outputLen; - this.padOffset = padOffset; - this.isLE = isLE; - this.buffer = new Uint8Array(blockLen); - this.view = (0, utils_ts_1.createView)(this.buffer); - } - update(data) { - (0, utils_ts_1.aexists)(this); - data = (0, utils_ts_1.toBytes)(data); - (0, utils_ts_1.abytes)(data); - const { view, buffer, blockLen } = this; - const len = data.length; - for (let pos = 0; pos < len;) { - const take = Math.min(blockLen - this.pos, len - pos); - // Fast path: we have at least one block in input, cast it to view and process - if (take === blockLen) { - const dataView = (0, utils_ts_1.createView)(data); - for (; blockLen <= len - pos; pos += blockLen) - this.process(dataView, pos); - continue; - } - buffer.set(data.subarray(pos, pos + take), this.pos); - this.pos += take; - pos += take; - if (this.pos === blockLen) { - this.process(view, 0); - this.pos = 0; - } - } - this.length += data.length; - this.roundClean(); - return this; - } - digestInto(out) { - (0, utils_ts_1.aexists)(this); - (0, utils_ts_1.aoutput)(out, this); - this.finished = true; - // Padding - // We can avoid allocation of buffer for padding completely if it - // was previously not allocated here. But it won't change performance. - const { buffer, view, blockLen, isLE } = this; - let { pos } = this; - // append the bit '1' to the message - buffer[pos++] = 0b10000000; - (0, utils_ts_1.clean)(this.buffer.subarray(pos)); - // we have less than padOffset left in buffer, so we cannot put length in - // current block, need process it and pad again - if (this.padOffset > blockLen - pos) { - this.process(view, 0); - pos = 0; - } - // Pad until full block byte with zeros - for (let i = pos; i < blockLen; i++) - buffer[i] = 0; - // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that - // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen. - // So we just write lowest 64 bits of that value. - setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE); - this.process(view, 0); - const oview = (0, utils_ts_1.createView)(out); - const len = this.outputLen; - // NOTE: we do division by 4 later, which should be fused in single op with modulo by JIT - if (len % 4) - throw new Error('_sha2: outputLen should be aligned to 32bit'); - const outLen = len / 4; - const state = this.get(); - if (outLen > state.length) - throw new Error('_sha2: outputLen bigger than state'); - for (let i = 0; i < outLen; i++) - oview.setUint32(4 * i, state[i], isLE); - } - digest() { - const { buffer, outputLen } = this; - this.digestInto(buffer); - const res = buffer.slice(0, outputLen); - this.destroy(); - return res; - } - _cloneInto(to) { - to || (to = new this.constructor()); - to.set(...this.get()); - const { blockLen, buffer, length, finished, destroyed, pos } = this; - to.destroyed = destroyed; - to.finished = finished; - to.length = length; - to.pos = pos; - if (length % blockLen) - to.buffer.set(buffer); - return to; - } - clone() { - return this._cloneInto(); - } -} -exports.HashMD = HashMD; -/** - * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53. - * Check out `test/misc/sha2-gen-iv.js` for recomputation guide. - */ -/** Initial SHA256 state. Bits 0..32 of frac part of sqrt of primes 2..19 */ -exports.SHA256_IV = Uint32Array.from([ - 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19, -]); -/** Initial SHA224 state. Bits 32..64 of frac part of sqrt of primes 23..53 */ -exports.SHA224_IV = Uint32Array.from([ - 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4, -]); -/** Initial SHA384 state. Bits 0..64 of frac part of sqrt of primes 23..53 */ -exports.SHA384_IV = Uint32Array.from([ - 0xcbbb9d5d, 0xc1059ed8, 0x629a292a, 0x367cd507, 0x9159015a, 0x3070dd17, 0x152fecd8, 0xf70e5939, - 0x67332667, 0xffc00b31, 0x8eb44a87, 0x68581511, 0xdb0c2e0d, 0x64f98fa7, 0x47b5481d, 0xbefa4fa4, -]); -/** Initial SHA512 state. Bits 0..64 of frac part of sqrt of primes 2..19 */ -exports.SHA512_IV = Uint32Array.from([ - 0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1, - 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179, -]); -//# sourceMappingURL=_md.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/_md.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/_md.js.map deleted file mode 100644 index 07270e0a..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/_md.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_md.js","sourceRoot":"","sources":["src/_md.ts"],"names":[],"mappings":";;;AAOA,oCAeC;AAGD,kBAEC;AAGD,kBAEC;AAhCD;;;GAGG;AACH,yCAAoG;AAEpG,gGAAgG;AAChG,SAAgB,YAAY,CAC1B,IAAc,EACd,UAAkB,EAClB,KAAa,EACb,IAAa;IAEb,IAAI,OAAO,IAAI,CAAC,YAAY,KAAK,UAAU;QAAE,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IAC/F,MAAM,IAAI,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;IACxB,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;IACpC,MAAM,EAAE,GAAG,MAAM,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC;IAC9C,MAAM,EAAE,GAAG,MAAM,CAAC,KAAK,GAAG,QAAQ,CAAC,CAAC;IACpC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACvB,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACvB,IAAI,CAAC,SAAS,CAAC,UAAU,GAAG,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;IACzC,IAAI,CAAC,SAAS,CAAC,UAAU,GAAG,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;AAC3C,CAAC;AAED,wBAAwB;AACxB,SAAgB,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS;IACjD,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAC5B,CAAC;AAED,yDAAyD;AACzD,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AAE,UAAU,EAAE,UAAU,EAAE,UAAU;CAC/F,CAAC,CAAC;AAEH,6EAA6E;AAChE,QAAA,SAAS,GAAgC,WAAW,CAAC,IAAI,CAAC;IACrE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IAC9F,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;CAC/F,CAAC,CAAC;AAEH,4EAA4E;AAC/D,QAAA,SAAS,GAAgC,WAAW,CAAC,IAAI,CAAC;IACrE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IAC9F,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;CAC/F,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/_u64.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/_u64.d.ts deleted file mode 100644 index ac5523a3..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/_u64.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -declare function fromBig(n: bigint, le?: boolean): { - h: number; - l: number; -}; -declare function split(lst: bigint[], le?: boolean): Uint32Array[]; -declare const toBig: (h: number, l: number) => bigint; -declare const shrSH: (h: number, _l: number, s: number) => number; -declare const shrSL: (h: number, l: number, s: number) => number; -declare const rotrSH: (h: number, l: number, s: number) => number; -declare const rotrSL: (h: number, l: number, s: number) => number; -declare const rotrBH: (h: number, l: number, s: number) => number; -declare const rotrBL: (h: number, l: number, s: number) => number; -declare const rotr32H: (_h: number, l: number) => number; -declare const rotr32L: (h: number, _l: number) => number; -declare const rotlSH: (h: number, l: number, s: number) => number; -declare const rotlSL: (h: number, l: number, s: number) => number; -declare const rotlBH: (h: number, l: number, s: number) => number; -declare const rotlBL: (h: number, l: number, s: number) => number; -declare function add(Ah: number, Al: number, Bh: number, Bl: number): { - h: number; - l: number; -}; -declare const add3L: (Al: number, Bl: number, Cl: number) => number; -declare const add3H: (low: number, Ah: number, Bh: number, Ch: number) => number; -declare const add4L: (Al: number, Bl: number, Cl: number, Dl: number) => number; -declare const add4H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number) => number; -declare const add5L: (Al: number, Bl: number, Cl: number, Dl: number, El: number) => number; -declare const add5H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number, Eh: number) => number; -export { add, add3H, add3L, add4H, add4L, add5H, add5L, fromBig, rotlBH, rotlBL, rotlSH, rotlSL, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL, shrSH, shrSL, split, toBig }; -declare const u64: { - fromBig: typeof fromBig; - split: typeof split; - toBig: (h: number, l: number) => bigint; - shrSH: (h: number, _l: number, s: number) => number; - shrSL: (h: number, l: number, s: number) => number; - rotrSH: (h: number, l: number, s: number) => number; - rotrSL: (h: number, l: number, s: number) => number; - rotrBH: (h: number, l: number, s: number) => number; - rotrBL: (h: number, l: number, s: number) => number; - rotr32H: (_h: number, l: number) => number; - rotr32L: (h: number, _l: number) => number; - rotlSH: (h: number, l: number, s: number) => number; - rotlSL: (h: number, l: number, s: number) => number; - rotlBH: (h: number, l: number, s: number) => number; - rotlBL: (h: number, l: number, s: number) => number; - add: typeof add; - add3L: (Al: number, Bl: number, Cl: number) => number; - add3H: (low: number, Ah: number, Bh: number, Ch: number) => number; - add4L: (Al: number, Bl: number, Cl: number, Dl: number) => number; - add4H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number) => number; - add5H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number, Eh: number) => number; - add5L: (Al: number, Bl: number, Cl: number, Dl: number, El: number) => number; -}; -export default u64; -//# sourceMappingURL=_u64.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/_u64.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/_u64.d.ts.map deleted file mode 100644 index 211a4c69..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/_u64.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_u64.d.ts","sourceRoot":"","sources":["src/_u64.ts"],"names":[],"mappings":"AAQA,iBAAS,OAAO,CACd,CAAC,EAAE,MAAM,EACT,EAAE,UAAQ,GACT;IACD,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAGA;AAED,iBAAS,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,UAAQ,GAAG,WAAW,EAAE,CASvD;AAED,QAAA,MAAM,KAAK,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,KAAG,MAAqD,CAAC;AAE5F,QAAA,MAAM,KAAK,GAAI,GAAG,MAAM,EAAE,IAAI,MAAM,EAAE,GAAG,MAAM,KAAG,MAAiB,CAAC;AACpE,QAAA,MAAM,KAAK,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,KAAG,MAAqC,CAAC;AAEvF,QAAA,MAAM,MAAM,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,KAAG,MAAqC,CAAC;AACxF,QAAA,MAAM,MAAM,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,KAAG,MAAqC,CAAC;AAExF,QAAA,MAAM,MAAM,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,KAAG,MAA4C,CAAC;AAC/F,QAAA,MAAM,MAAM,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,KAAG,MAA4C,CAAC;AAE/F,QAAA,MAAM,OAAO,GAAI,IAAI,MAAM,EAAE,GAAG,MAAM,KAAG,MAAW,CAAC;AACrD,QAAA,MAAM,OAAO,GAAI,GAAG,MAAM,EAAE,IA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,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;IAAC,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;CAOrpC,CAAC;AACF,eAAe,GAAG,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/_u64.js b/tools/mnemonic-test/node_modules/@noble/hashes/_u64.js deleted file mode 100644 index 3232f4dd..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/_u64.js +++ /dev/null @@ -1,90 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.toBig = exports.shrSL = exports.shrSH = exports.rotrSL = exports.rotrSH = exports.rotrBL = exports.rotrBH = exports.rotr32L = exports.rotr32H = exports.rotlSL = exports.rotlSH = exports.rotlBL = exports.rotlBH = exports.add5L = exports.add5H = exports.add4L = exports.add4H = exports.add3L = exports.add3H = void 0; -exports.add = add; -exports.fromBig = fromBig; -exports.split = split; -/** - * Internal helpers for u64. BigUint64Array is too slow as per 2025, so we implement it using Uint32Array. - * @todo re-check https://issues.chromium.org/issues/42212588 - * @module - */ -const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1); -const _32n = /* @__PURE__ */ BigInt(32); -function fromBig(n, le = false) { - if (le) - return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) }; - return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 }; -} -function split(lst, le = false) { - const len = lst.length; - let Ah = new Uint32Array(len); - let Al = new Uint32Array(len); - for (let i = 0; i < len; i++) { - const { h, l } = fromBig(lst[i], le); - [Ah[i], Al[i]] = [h, l]; - } - return [Ah, Al]; -} -const toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0); -exports.toBig = toBig; -// for Shift in [0, 32) -const shrSH = (h, _l, s) => h >>> s; -exports.shrSH = shrSH; -const shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); -exports.shrSL = shrSL; -// Right rotate for Shift in [1, 32) -const rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s)); -exports.rotrSH = rotrSH; -const rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); -exports.rotrSL = rotrSL; -// Right rotate for Shift in (32, 64), NOTE: 32 is special case. -const rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32)); -exports.rotrBH = rotrBH; -const rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s)); -exports.rotrBL = rotrBL; -// Right rotate for shift===32 (just swaps l&h) -const rotr32H = (_h, l) => l; -exports.rotr32H = rotr32H; -const rotr32L = (h, _l) => h; -exports.rotr32L = rotr32L; -// Left rotate for Shift in [1, 32) -const rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s)); -exports.rotlSH = rotlSH; -const rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s)); -exports.rotlSL = rotlSL; -// Left rotate for Shift in (32, 64), NOTE: 32 is special case. -const rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s)); -exports.rotlBH = rotlBH; -const rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s)); -exports.rotlBL = rotlBL; -// JS uses 32-bit signed integers for bitwise operations which means we cannot -// simple take carry out of low bit sum by shift, we need to use division. -function add(Ah, Al, Bh, Bl) { - const l = (Al >>> 0) + (Bl >>> 0); - return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 }; -} -// Addition with more than 2 elements -const add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); -exports.add3L = add3L; -const add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0; -exports.add3H = add3H; -const add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); -exports.add4L = add4L; -const add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0; -exports.add4H = add4H; -const add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); -exports.add5L = add5L; -const add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0; -exports.add5H = add5H; -// prettier-ignore -const u64 = { - fromBig, split, toBig, - shrSH, shrSL, - rotrSH, rotrSL, rotrBH, rotrBL, - rotr32H, rotr32L, - rotlSH, rotlSL, rotlBH, rotlBL, - add, add3L, add3H, add4L, add4H, add5H, add5L, -}; -exports.default = u64; -//# sourceMappingURL=_u64.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/_u64.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/_u64.js.map deleted file mode 100644 index 49ffb25e..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/_u64.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_u64.js","sourceRoot":"","sources":["src/_u64.ts"],"names":[],"mappings":";;;AA+EE,kBAAG;AAA4C,0BAAO;AAAkG,sBAAK;AA/E/J;;;;GAIG;AACH,MAAM,UAAU,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;AACvD,MAAM,IAAI,GAAG,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAExC,SAAS,OAAO,CACd,CAAS,EACT,EAAE,GAAG,KAAK;IAKV,IAAI,EAAE;QAAE,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,UAAU,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,C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sBAAK;AAL/C,MAAM,KAAK,GAAG,CAAC,GAAW,EAAE,EAAU,EAAE,EAAU,EAAE,EAAU,EAAE,EAAU,EAAE,EAAU,EAAU,EAAE,CAChG,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAIpB,sBAAK;AAExC,kBAAkB;AAClB,MAAM,GAAG,GAAkpC;IACzpC,OAAO,EAAE,KAAK,EAAE,KAAK;IACrB,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAC9B,OAAO,EAAE,OAAO;IAChB,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAC9B,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;CAC9C,CAAC;AACF,kBAAe,GAAG,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/argon2.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/argon2.d.ts deleted file mode 100644 index 67cb8f6b..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/argon2.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { type KDFInput } from './utils.ts'; -/** - * Argon2 options. - * * t: time cost, m: mem cost in kb, p: parallelization. - * * key: optional key. personalization: arbitrary extra data. - * * dkLen: desired number of output bytes. - */ -export type ArgonOpts = { - t: number; - m: number; - p: number; - version?: number; - key?: KDFInput; - personalization?: KDFInput; - dkLen?: number; - asyncTick?: number; - maxmem?: number; - onProgress?: (progress: number) => void; -}; -/** argon2d GPU-resistant version. */ -export declare const argon2d: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Uint8Array; -/** argon2i side-channel-resistant version. */ -export declare const argon2i: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Uint8Array; -/** argon2id, combining i+d, the most popular version from RFC 9106 */ -export declare const argon2id: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Uint8Array; -/** argon2d async GPU-resistant version. */ -export declare const argon2dAsync: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Promise; -/** argon2i async side-channel-resistant version. */ -export declare const argon2iAsync: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Promise; -/** argon2id async, combining i+d, the most popular version from RFC 9106 */ -export declare const argon2idAsync: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Promise; -//# sourceMappingURL=argon2.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/argon2.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/argon2.d.ts.map deleted file mode 100644 index 0928c343..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/argon2.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"argon2.d.ts","sourceRoot":"","sources":["src/argon2.ts"],"names":[],"mappings":"AAYA,OAAO,EAAqD,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAkK9F;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,QAAQ,CAAC;IACf,eAAe,CAAC,EAAE,QAAQ,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC,CAAC;AAuNF,qCAAqC;AACrC,eAAO,MAAM,OAAO,GAAI,UAAU,QAAQ,EAAE,MAAM,QAAQ,EAAE,MAAM,SAAS,KAAG,UACnC,CAAC;AAC5C,8CAA8C;AAC9C,eAAO,MAAM,OAAO,GAAI,UAAU,QAAQ,EAAE,MAAM,QAAQ,EAAE,MAAM,SAAS,KAAG,UACpC,CAAC;AAC3C,sEAAsE;AACtE,eAAO,MAAM,QAAQ,GAAI,UAAU,QAAQ,EAAE,MAAM,QAAQ,EAAE,MAAM,SAAS,KAAG,UACpC,CAAC;AAiE5C,2CAA2C;AAC3C,eAAO,MAAM,YAAY,GACvB,UAAU,QAAQ,EAClB,MAAM,QAAQ,EACd,MAAM,SAAS,KACd,OAAO,CAAC,UAAU,CAAmD,CAAC;AACzE,oDAAoD;AACpD,eAAO,MAAM,YAAY,GACvB,UAAU,QAAQ,EAClB,MAAM,QAAQ,EACd,MAAM,SAAS,KACd,OAAO,CAAC,UAAU,CAAkD,CAAC;AACxE,4EAA4E;AAC5E,eAAO,MAAM,aAAa,GACxB,UAAU,QAAQ,EAClB,MAAM,QAAQ,EACd,MAAM,SAAS,KACd,OAAO,CAAC,UAAU,CAAmD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/argon2.js b/tools/mnemonic-test/node_modules/@noble/hashes/argon2.js deleted file mode 100644 index 44488ac8..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/argon2.js +++ /dev/null @@ -1,401 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.argon2idAsync = exports.argon2iAsync = exports.argon2dAsync = exports.argon2id = exports.argon2i = exports.argon2d = void 0; -/** - * Argon2 KDF from RFC 9106. Can be used to create a key from password and salt. - * We suggest to use Scrypt. JS Argon is 2-10x slower than native code because of 64-bitness: - * * argon uses uint64, but JS doesn't have fast uint64array - * * uint64 multiplication is 1/3 of time - * * `P` function would be very nice with u64, because most of value will be in registers, - * hovewer with u32 it will require 32 registers, which is too much. - * * JS arrays do slow bound checks, so reading from `A2_BUF` slows it down - * @module - */ -const _u64_ts_1 = require("./_u64.js"); -const blake2_ts_1 = require("./blake2.js"); -const utils_ts_1 = require("./utils.js"); -const AT = { Argond2d: 0, Argon2i: 1, Argon2id: 2 }; -const ARGON2_SYNC_POINTS = 4; -const abytesOrZero = (buf) => { - if (buf === undefined) - return Uint8Array.of(); - return (0, utils_ts_1.kdfInputToBytes)(buf); -}; -// u32 * u32 = u64 -function mul(a, b) { - const aL = a & 0xffff; - const aH = a >>> 16; - const bL = b & 0xffff; - const bH = b >>> 16; - const ll = Math.imul(aL, bL); - const hl = Math.imul(aH, bL); - const lh = Math.imul(aL, bH); - const hh = Math.imul(aH, bH); - const carry = (ll >>> 16) + (hl & 0xffff) + lh; - const high = (hh + (hl >>> 16) + (carry >>> 16)) | 0; - const low = (carry << 16) | (ll & 0xffff); - return { h: high, l: low }; -} -function mul2(a, b) { - // 2 * a * b (via shifts) - const { h, l } = mul(a, b); - return { h: ((h << 1) | (l >>> 31)) & 4294967295, l: (l << 1) & 4294967295 }; -} -// BlaMka permutation for Argon2 -// A + B + (2 * u32(A) * u32(B)) -function blamka(Ah, Al, Bh, Bl) { - const { h: Ch, l: Cl } = mul2(Al, Bl); - // A + B + (2 * A * B) - const Rll = (0, _u64_ts_1.add3L)(Al, Bl, Cl); - return { h: (0, _u64_ts_1.add3H)(Rll, Ah, Bh, Ch), l: Rll | 0 }; -} -// Temporary block buffer -const A2_BUF = new Uint32Array(256); // 1024 bytes (matrix 16x16) -function G(a, b, c, d) { - let Al = A2_BUF[2 * a], Ah = A2_BUF[2 * a + 1]; // prettier-ignore - let Bl = A2_BUF[2 * b], Bh = A2_BUF[2 * b + 1]; // prettier-ignore - let Cl = A2_BUF[2 * c], Ch = A2_BUF[2 * c + 1]; // prettier-ignore - let Dl = A2_BUF[2 * d], Dh = A2_BUF[2 * d + 1]; // prettier-ignore - ({ h: Ah, l: Al } = blamka(Ah, Al, Bh, Bl)); - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: (0, _u64_ts_1.rotr32H)(Dh, Dl), Dl: (0, _u64_ts_1.rotr32L)(Dh, Dl) }); - ({ h: Ch, l: Cl } = blamka(Ch, Cl, Dh, Dl)); - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: (0, _u64_ts_1.rotrSH)(Bh, Bl, 24), Bl: (0, _u64_ts_1.rotrSL)(Bh, Bl, 24) }); - ({ h: Ah, l: Al } = blamka(Ah, Al, Bh, Bl)); - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: (0, _u64_ts_1.rotrSH)(Dh, Dl, 16), Dl: (0, _u64_ts_1.rotrSL)(Dh, Dl, 16) }); - ({ h: Ch, l: Cl } = blamka(Ch, Cl, Dh, Dl)); - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: (0, _u64_ts_1.rotrBH)(Bh, Bl, 63), Bl: (0, _u64_ts_1.rotrBL)(Bh, Bl, 63) }); - (A2_BUF[2 * a] = Al), (A2_BUF[2 * a + 1] = Ah); - (A2_BUF[2 * b] = Bl), (A2_BUF[2 * b + 1] = Bh); - (A2_BUF[2 * c] = Cl), (A2_BUF[2 * c + 1] = Ch); - (A2_BUF[2 * d] = Dl), (A2_BUF[2 * d + 1] = Dh); -} -// prettier-ignore -function P(v00, v01, v02, v03, v04, v05, v06, v07, v08, v09, v10, v11, v12, v13, v14, v15) { - G(v00, v04, v08, v12); - G(v01, v05, v09, v13); - G(v02, v06, v10, v14); - G(v03, v07, v11, v15); - G(v00, v05, v10, v15); - G(v01, v06, v11, v12); - G(v02, v07, v08, v13); - G(v03, v04, v09, v14); -} -function block(x, xPos, yPos, outPos, needXor) { - for (let i = 0; i < 256; i++) - A2_BUF[i] = x[xPos + i] ^ x[yPos + i]; - // columns (8) - for (let i = 0; i < 128; i += 16) { - // prettier-ignore - P(i, i + 1, i + 2, i + 3, i + 4, i + 5, i + 6, i + 7, i + 8, i + 9, i + 10, i + 11, i + 12, i + 13, i + 14, i + 15); - } - // rows (8) - for (let i = 0; i < 16; i += 2) { - // prettier-ignore - P(i, i + 1, i + 16, i + 17, i + 32, i + 33, i + 48, i + 49, i + 64, i + 65, i + 80, i + 81, i + 96, i + 97, i + 112, i + 113); - } - if (needXor) - for (let i = 0; i < 256; i++) - x[outPos + i] ^= A2_BUF[i] ^ x[xPos + i] ^ x[yPos + i]; - else - for (let i = 0; i < 256; i++) - x[outPos + i] = A2_BUF[i] ^ x[xPos + i] ^ x[yPos + i]; - (0, utils_ts_1.clean)(A2_BUF); -} -// Variable-Length Hash Function H' -function Hp(A, dkLen) { - const A8 = (0, utils_ts_1.u8)(A); - const T = new Uint32Array(1); - const T8 = (0, utils_ts_1.u8)(T); - T[0] = dkLen; - // Fast path - if (dkLen <= 64) - return blake2_ts_1.blake2b.create({ dkLen }).update(T8).update(A8).digest(); - const out = new Uint8Array(dkLen); - let V = blake2_ts_1.blake2b.create({}).update(T8).update(A8).digest(); - let pos = 0; - // First block - out.set(V.subarray(0, 32)); - pos += 32; - // Rest blocks - for (; dkLen - pos > 64; pos += 32) { - const Vh = blake2_ts_1.blake2b.create({}).update(V); - Vh.digestInto(V); - Vh.destroy(); - out.set(V.subarray(0, 32), pos); - } - // Last block - out.set((0, blake2_ts_1.blake2b)(V, { dkLen: dkLen - pos }), pos); - (0, utils_ts_1.clean)(V, T); - return (0, utils_ts_1.u32)(out); -} -// Used only inside process block! -function indexAlpha(r, s, laneLen, segmentLen, index, randL, sameLane = false) { - // This is ugly, but close enough to reference implementation. - let area; - if (r === 0) { - if (s === 0) - area = index - 1; - else if (sameLane) - area = s * segmentLen + index - 1; - else - area = s * segmentLen + (index == 0 ? -1 : 0); - } - else if (sameLane) - area = laneLen - segmentLen + index - 1; - else - area = laneLen - segmentLen + (index == 0 ? -1 : 0); - const startPos = r !== 0 && s !== ARGON2_SYNC_POINTS - 1 ? (s + 1) * segmentLen : 0; - const rel = area - 1 - mul(area, mul(randL, randL).h).h; - return (startPos + rel) % laneLen; -} -const maxUint32 = Math.pow(2, 32); -function isU32(num) { - return Number.isSafeInteger(num) && num >= 0 && num < maxUint32; -} -function argon2Opts(opts) { - const merged = { - version: 0x13, - dkLen: 32, - maxmem: maxUint32 - 1, - asyncTick: 10, - }; - for (let [k, v] of Object.entries(opts)) - if (v != null) - merged[k] = v; - const { dkLen, p, m, t, version, onProgress } = merged; - if (!isU32(dkLen) || dkLen < 4) - throw new Error('dkLen should be at least 4 bytes'); - if (!isU32(p) || p < 1 || p >= Math.pow(2, 24)) - throw new Error('p should be 1 <= p < 2^24'); - if (!isU32(m)) - throw new Error('m should be 0 <= m < 2^32'); - if (!isU32(t) || t < 1) - throw new Error('t (iterations) should be 1 <= t < 2^32'); - if (onProgress !== undefined && typeof onProgress !== 'function') - throw new Error('progressCb should be function'); - /* - Memory size m MUST be an integer number of kibibytes from 8*p to 2^(32)-1. The actual number of blocks is m', which is m rounded down to the nearest multiple of 4*p. - */ - if (!isU32(m) || m < 8 * p) - throw new Error('memory should be at least 8*p bytes'); - if (version !== 0x10 && version !== 0x13) - throw new Error('unknown version=' + version); - return merged; -} -function argon2Init(password, salt, type, opts) { - password = (0, utils_ts_1.kdfInputToBytes)(password); - salt = (0, utils_ts_1.kdfInputToBytes)(salt); - (0, utils_ts_1.abytes)(password); - (0, utils_ts_1.abytes)(salt); - if (!isU32(password.length)) - throw new Error('password should be less than 4 GB'); - if (!isU32(salt.length) || salt.length < 8) - throw new Error('salt should be at least 8 bytes and less than 4 GB'); - if (!Object.values(AT).includes(type)) - throw new Error('invalid type'); - let { p, dkLen, m, t, version, key, personalization, maxmem, onProgress, asyncTick } = argon2Opts(opts); - // Validation - key = abytesOrZero(key); - personalization = abytesOrZero(personalization); - // H_0 = H^(64)(LE32(p) || LE32(T) || LE32(m) || LE32(t) || - // LE32(v) || LE32(y) || LE32(length(P)) || P || - // LE32(length(S)) || S || LE32(length(K)) || K || - // LE32(length(X)) || X) - const h = blake2_ts_1.blake2b.create({}); - const BUF = new Uint32Array(1); - const BUF8 = (0, utils_ts_1.u8)(BUF); - for (let item of [p, dkLen, m, t, version, type]) { - BUF[0] = item; - h.update(BUF8); - } - for (let i of [password, salt, key, personalization]) { - BUF[0] = i.length; // BUF is u32 array, this is valid - h.update(BUF8).update(i); - } - const H0 = new Uint32Array(18); - const H0_8 = (0, utils_ts_1.u8)(H0); - h.digestInto(H0_8); - // 256 u32 = 1024 (BLOCK_SIZE), fills A2_BUF on processing - // Params - const lanes = p; - // m' = 4 * p * floor (m / 4p) - const mP = 4 * p * Math.floor(m / (ARGON2_SYNC_POINTS * p)); - //q = m' / p columns - const laneLen = Math.floor(mP / p); - const segmentLen = Math.floor(laneLen / ARGON2_SYNC_POINTS); - const memUsed = mP * 256; - if (!isU32(maxmem) || memUsed > maxmem) - throw new Error('mem should be less than 2**32, got: maxmem=' + maxmem + ', memused=' + memUsed); - const B = new Uint32Array(memUsed); - // Fill first blocks - for (let l = 0; l < p; l++) { - const i = 256 * laneLen * l; - // B[i][0] = H'^(1024)(H_0 || LE32(0) || LE32(i)) - H0[17] = l; - H0[16] = 0; - B.set(Hp(H0, 1024), i); - // B[i][1] = H'^(1024)(H_0 || LE32(1) || LE32(i)) - H0[16] = 1; - B.set(Hp(H0, 1024), i + 256); - } - let perBlock = () => { }; - if (onProgress) { - const totalBlock = t * ARGON2_SYNC_POINTS * p * segmentLen; - // Invoke callback if progress changes from 10.01 to 10.02 - // Allows to draw smooth progress bar on up to 8K screen - const callbackPer = Math.max(Math.floor(totalBlock / 10000), 1); - let blockCnt = 0; - perBlock = () => { - blockCnt++; - if (onProgress && (!(blockCnt % callbackPer) || blockCnt === totalBlock)) - onProgress(blockCnt / totalBlock); - }; - } - (0, utils_ts_1.clean)(BUF, H0); - return { type, mP, p, t, version, B, laneLen, lanes, segmentLen, dkLen, perBlock, asyncTick }; -} -function argon2Output(B, p, laneLen, dkLen) { - const B_final = new Uint32Array(256); - for (let l = 0; l < p; l++) - for (let j = 0; j < 256; j++) - B_final[j] ^= B[256 * (laneLen * l + laneLen - 1) + j]; - const res = (0, utils_ts_1.u8)(Hp(B_final, dkLen)); - (0, utils_ts_1.clean)(B_final); - return res; -} -function processBlock(B, address, l, r, s, index, laneLen, segmentLen, lanes, offset, prev, dataIndependent, needXor) { - if (offset % laneLen) - prev = offset - 1; - let randL, randH; - if (dataIndependent) { - let i128 = index % 128; - if (i128 === 0) { - address[256 + 12]++; - block(address, 256, 2 * 256, 0, false); - block(address, 0, 2 * 256, 0, false); - } - randL = address[2 * i128]; - randH = address[2 * i128 + 1]; - } - else { - const T = 256 * prev; - randL = B[T]; - randH = B[T + 1]; - } - // address block - const refLane = r === 0 && s === 0 ? l : randH % lanes; - const refPos = indexAlpha(r, s, laneLen, segmentLen, index, randL, refLane == l); - const refBlock = laneLen * refLane + refPos; - // B[i][j] = G(B[i][j-1], B[l][z]) - block(B, 256 * prev, 256 * refBlock, offset * 256, needXor); -} -function argon2(type, password, salt, opts) { - const { mP, p, t, version, B, laneLen, lanes, segmentLen, dkLen, perBlock } = argon2Init(password, salt, type, opts); - // Pre-loop setup - // [address, input, zero_block] format so we can pass single U32 to block function - const address = new Uint32Array(3 * 256); - address[256 + 6] = mP; - address[256 + 8] = t; - address[256 + 10] = type; - for (let r = 0; r < t; r++) { - const needXor = r !== 0 && version === 0x13; - address[256 + 0] = r; - for (let s = 0; s < ARGON2_SYNC_POINTS; s++) { - address[256 + 4] = s; - const dataIndependent = type == AT.Argon2i || (type == AT.Argon2id && r === 0 && s < 2); - for (let l = 0; l < p; l++) { - address[256 + 2] = l; - address[256 + 12] = 0; - let startPos = 0; - if (r === 0 && s === 0) { - startPos = 2; - if (dataIndependent) { - address[256 + 12]++; - block(address, 256, 2 * 256, 0, false); - block(address, 0, 2 * 256, 0, false); - } - } - // current block postion - let offset = l * laneLen + s * segmentLen + startPos; - // previous block position - let prev = offset % laneLen ? offset - 1 : offset + laneLen - 1; - for (let index = startPos; index < segmentLen; index++, offset++, prev++) { - perBlock(); - processBlock(B, address, l, r, s, index, laneLen, segmentLen, lanes, offset, prev, dataIndependent, needXor); - } - } - } - } - (0, utils_ts_1.clean)(address); - return argon2Output(B, p, laneLen, dkLen); -} -/** argon2d GPU-resistant version. */ -const argon2d = (password, salt, opts) => argon2(AT.Argond2d, password, salt, opts); -exports.argon2d = argon2d; -/** argon2i side-channel-resistant version. */ -const argon2i = (password, salt, opts) => argon2(AT.Argon2i, password, salt, opts); -exports.argon2i = argon2i; -/** argon2id, combining i+d, the most popular version from RFC 9106 */ -const argon2id = (password, salt, opts) => argon2(AT.Argon2id, password, salt, opts); -exports.argon2id = argon2id; -async function argon2Async(type, password, salt, opts) { - const { mP, p, t, version, B, laneLen, lanes, segmentLen, dkLen, perBlock, asyncTick } = argon2Init(password, salt, type, opts); - // Pre-loop setup - // [address, input, zero_block] format so we can pass single U32 to block function - const address = new Uint32Array(3 * 256); - address[256 + 6] = mP; - address[256 + 8] = t; - address[256 + 10] = type; - let ts = Date.now(); - for (let r = 0; r < t; r++) { - const needXor = r !== 0 && version === 0x13; - address[256 + 0] = r; - for (let s = 0; s < ARGON2_SYNC_POINTS; s++) { - address[256 + 4] = s; - const dataIndependent = type == AT.Argon2i || (type == AT.Argon2id && r === 0 && s < 2); - for (let l = 0; l < p; l++) { - address[256 + 2] = l; - address[256 + 12] = 0; - let startPos = 0; - if (r === 0 && s === 0) { - startPos = 2; - if (dataIndependent) { - address[256 + 12]++; - block(address, 256, 2 * 256, 0, false); - block(address, 0, 2 * 256, 0, false); - } - } - // current block postion - let offset = l * laneLen + s * segmentLen + startPos; - // previous block position - let prev = offset % laneLen ? offset - 1 : offset + laneLen - 1; - for (let index = startPos; index < segmentLen; index++, offset++, prev++) { - perBlock(); - processBlock(B, address, l, r, s, index, laneLen, segmentLen, lanes, offset, prev, dataIndependent, needXor); - // Date.now() is not monotonic, so in case if clock goes backwards we return return control too - const diff = Date.now() - ts; - if (!(diff >= 0 && diff < asyncTick)) { - await (0, utils_ts_1.nextTick)(); - ts += diff; - } - } - } - } - } - (0, utils_ts_1.clean)(address); - return argon2Output(B, p, laneLen, dkLen); -} -/** argon2d async GPU-resistant version. */ -const argon2dAsync = (password, salt, opts) => argon2Async(AT.Argond2d, password, salt, opts); -exports.argon2dAsync = argon2dAsync; -/** argon2i async side-channel-resistant version. */ -const argon2iAsync = (password, salt, opts) => argon2Async(AT.Argon2i, password, salt, opts); -exports.argon2iAsync = argon2iAsync; -/** argon2id async, combining i+d, the most popular version from RFC 9106 */ -const argon2idAsync = (password, salt, opts) => argon2Async(AT.Argon2id, password, salt, opts); -exports.argon2idAsync = argon2idAsync; -//# sourceMappingURL=argon2.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/argon2.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/argon2.js.map deleted file mode 100644 index 74bde80f..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/argon2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"argon2.js","sourceRoot":"","sources":["src/argon2.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;GASG;AACH,uCAA2F;AAC3F,2CAAsC;AACtC,yCAA8F;AAE9F,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAW,CAAC;AAG7D,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAC7B,MAAM,YAAY,GAAG,CAAC,GAAc,EAAE,EAAE;IACtC,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,UAAU,CAAC,EAAE,EAAE,CAAC;IAC9C,OAAO,IAAA,0BAAe,EAAC,GAAG,CAAC,CAAC;AAC9B,CAAC,CAAC;AAEF,kBAAkB;AAClB,SAAS,GAAG,CAAC,CAAS,EAAE,CAAS;IAC/B,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC;IACtB,MAAM,EAAE,GAAG,CAAC,KAAK,EAAE,C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C,IAAI,IAAI,CAAC,IAAI,IAAI,GAAG,SAAS,CAAC,EAAE,CAAC;wBACrC,MAAM,IAAA,mBAAQ,GAAE,CAAC;wBACjB,EAAE,IAAI,IAAI,CAAC;oBACb,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IACD,IAAA,gBAAK,EAAC,OAAO,CAAC,CAAC;IACf,OAAO,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AAC5C,CAAC;AAED,2CAA2C;AACpC,MAAM,YAAY,GAAG,CAC1B,QAAkB,EAClB,IAAc,EACd,IAAe,EACM,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAJ5D,QAAA,YAAY,gBAIgD;AACzE,oDAAoD;AAC7C,MAAM,YAAY,GAAG,CAC1B,QAAkB,EAClB,IAAc,EACd,IAAe,EACM,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAJ3D,QAAA,YAAY,gBAI+C;AACxE,4EAA4E;AACrE,MAAM,aAAa,GAAG,CAC3B,QAAkB,EAClB,IAAc,EACd,IAAe,EACM,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAJ5D,QAAA,aAAa,iBAI+C"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/blake1.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/blake1.d.ts deleted file mode 100644 index 62d576f2..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/blake1.d.ts +++ /dev/null @@ -1,106 +0,0 @@ -import { Hash, type CHashO, type Input } from './utils.ts'; -/** Blake1 options. Basically just "salt" */ -export type BlakeOpts = { - salt?: Uint8Array; -}; -declare abstract class BLAKE1> extends Hash { - protected finished: boolean; - protected length: number; - protected pos: number; - protected destroyed: boolean; - protected buffer: Uint8Array; - protected view: DataView; - protected salt: Uint32Array; - abstract compress(view: DataView, offset: number, withLength?: boolean): void; - protected abstract get(): number[]; - protected abstract set(...args: number[]): void; - readonly blockLen: number; - readonly outputLen: number; - private lengthFlag; - private counterLen; - protected constants: Uint32Array; - constructor(blockLen: number, outputLen: number, lengthFlag: number, counterLen: number, saltLen: number, constants: Uint32Array, opts?: BlakeOpts); - update(data: Input): this; - destroy(): void; - _cloneInto(to?: T): T; - clone(): T; - digestInto(out: Uint8Array): void; - digest(): Uint8Array; -} -declare class Blake1_32 extends BLAKE1 { - private v0; - private v1; - private v2; - private v3; - private v4; - private v5; - private v6; - private v7; - constructor(outputLen: number, IV: Uint32Array, lengthFlag: number, opts?: BlakeOpts); - protected get(): [number, number, number, number, number, number, number, number]; - protected set(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number): void; - destroy(): void; - compress(view: DataView, offset: number, withLength?: boolean): void; -} -declare class Blake1_64 extends BLAKE1 { - private v0l; - private v0h; - private v1l; - private v1h; - private v2l; - private v2h; - private v3l; - private v3h; - private v4l; - private v4h; - private v5l; - private v5h; - private v6l; - private v6h; - private v7l; - private v7h; - constructor(outputLen: number, IV: Uint32Array, lengthFlag: number, opts?: BlakeOpts); - protected get(): [ - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number - ]; - protected set(v0l: number, v0h: number, v1l: number, v1h: number, v2l: number, v2h: number, v3l: number, v3h: number, v4l: number, v4h: number, v5l: number, v5h: number, v6l: number, v6h: number, v7l: number, v7h: number): void; - destroy(): void; - compress(view: DataView, offset: number, withLength?: boolean): void; -} -export declare class BLAKE224 extends Blake1_32 { - constructor(opts?: BlakeOpts); -} -export declare class BLAKE256 extends Blake1_32 { - constructor(opts?: BlakeOpts); -} -export declare class BLAKE384 extends Blake1_64 { - constructor(opts?: BlakeOpts); -} -export declare class BLAKE512 extends Blake1_64 { - constructor(opts?: BlakeOpts); -} -/** blake1-224 hash function */ -export declare const blake224: CHashO; -/** blake1-256 hash function */ -export declare const blake256: CHashO; -/** blake1-384 hash function */ -export declare const blake384: CHashO; -/** blake1-512 hash function */ -export declare const blake512: CHashO; -export {}; -//# sourceMappingURL=blake1.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/blake1.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/blake1.d.ts.map deleted file mode 100644 index cecd4dfb..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/blake1.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blake1.d.ts","sourceRoot":"","sources":["src/blake1.ts"],"names":[],"mappings":"AA4BA,OAAO,EAGO,IAAI,EAChB,KAAK,MAAM,EAAE,KAAK,KAAK,EACxB,MAAM,YAAY,CAAC;AAEpB,4CAA4C;AAC5C,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB,CAAC;AAKF,uBAAe,MAAM,CAAC,CAAC,SAAS,MAAM,CAAC,CAAC,CAAC,CAAE,SAAQ,IAAI,CAAC,CAAC,CAAC;IACxD,SAAS,CAAC,QAAQ,UAAS;IAC3B,SAAS,CAAC,MAAM,SAAK;IACrB,SAAS,CAAC,GAAG,SAAK;IAClB,SAAS,CAAC,SAAS,UAAS;IAE5B,SAAS,CAAC,MAAM,EAAE,UAAU,CAAC;IAC7B,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC;IACzB,SAAS,CAAC,IAAI,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,IAAI;IAC7E,SAAS,CAAC,QAAQ,CAAC,GAAG,IAAI,MAAM,EAAE;IAClC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,IAA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M,EAAE,GAAG,EAAE,MAAM,EAClD,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAClD,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAClD,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GACjD,IAAI;IAkBP,OAAO,IAAI,IAAI;IAIf,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,UAAO,GAAG,IAAI;CAiDlE;AAED,qBAAa,QAAS,SAAQ,SAAS;gBACzB,IAAI,GAAE,SAAc;CAGjC;AACD,qBAAa,QAAS,SAAQ,SAAS;gBACzB,IAAI,GAAE,SAAc;CAGjC;AACD,qBAAa,QAAS,SAAQ,SAAS;gBACzB,IAAI,GAAE,SAAc;CAGjC;AACD,qBAAa,QAAS,SAAQ,SAAS;gBACzB,IAAI,GAAE,SAAc;CAGjC;AACD,+BAA+B;AAC/B,eAAO,MAAM,QAAQ,EAAE,MAEtB,CAAC;AACF,+BAA+B;AAC/B,eAAO,MAAM,QAAQ,EAAE,MAEtB,CAAC;AACF,+BAA+B;AAC/B,eAAO,MAAM,QAAQ,EAAE,MAEtB,CAAC;AACF,+BAA+B;AAC/B,eAAO,MAAM,QAAQ,EAAE,MAEtB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/blake1.js b/tools/mnemonic-test/node_modules/@noble/hashes/blake1.js deleted file mode 100644 index a877fcbd..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/blake1.js +++ /dev/null @@ -1,459 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.blake512 = exports.blake384 = exports.blake256 = exports.blake224 = exports.BLAKE512 = exports.BLAKE384 = exports.BLAKE256 = exports.BLAKE224 = void 0; -/** - * Blake1 legacy hash function, one of SHA3 proposals. - * Rarely used. Check out blake2 or blake3 instead. - * https://www.aumasson.jp/blake/blake.pdf - * - * In the best case, there are 0 allocations. - * - * Differences from blake2: - * - * - BE instead of LE - * - Paddings, similar to MD5, RIPEMD, SHA1, SHA2, but: - * - length flag is located before actual length - * - padding block is compressed differently (no lengths) - * Instead of msg[sigma[k]], we have `msg[sigma[k]] ^ constants[sigma[k-1]]` - * (-1 for g1, g2 without -1) - * - Salt is XOR-ed into constants instead of state - * - Salt is XOR-ed with output in `compress` - * - Additional rows (+64 bytes) in SIGMA for new rounds - * - Different round count: - * - 14 / 10 rounds in blake256 / blake2s - * - 16 / 12 rounds in blake512 / blake2b - * - blake512: G1b: rotr 24 -> 25, G2b: rotr 63 -> 11 - * @module - */ -const _blake_ts_1 = require("./_blake.js"); -const _md_ts_1 = require("./_md.js"); -const u64 = require("./_u64.js"); -// prettier-ignore -const utils_ts_1 = require("./utils.js"); -// Empty zero-filled salt -const EMPTY_SALT = /* @__PURE__ */ new Uint32Array(8); -class BLAKE1 extends utils_ts_1.Hash { - constructor(blockLen, outputLen, lengthFlag, counterLen, saltLen, constants, opts = {}) { - super(); - this.finished = false; - this.length = 0; - this.pos = 0; - this.destroyed = false; - const { salt } = opts; - this.blockLen = blockLen; - this.outputLen = outputLen; - this.lengthFlag = lengthFlag; - this.counterLen = counterLen; - this.buffer = new Uint8Array(blockLen); - this.view = (0, utils_ts_1.createView)(this.buffer); - if (salt) { - let slt = salt; - slt = (0, utils_ts_1.toBytes)(slt); - (0, utils_ts_1.abytes)(slt); - if (slt.length !== 4 * saltLen) - throw new Error('wrong salt length'); - const salt32 = (this.salt = new Uint32Array(saltLen)); - const sv = (0, utils_ts_1.createView)(slt); - this.constants = constants.slice(); - for (let i = 0, offset = 0; i < salt32.length; i++, offset += 4) { - salt32[i] = sv.getUint32(offset, false); - this.constants[i] ^= salt32[i]; - } - } - else { - this.salt = EMPTY_SALT; - this.constants = constants; - } - } - update(data) { - (0, utils_ts_1.aexists)(this); - data = (0, utils_ts_1.toBytes)(data); - (0, utils_ts_1.abytes)(data); - // From _md, but update length before each compress - const { view, buffer, blockLen } = this; - const len = data.length; - let dataView; - for (let pos = 0; pos < len;) { - const take = Math.min(blockLen - this.pos, len - pos); - // Fast path: we have at least one block in input, cast it to view and process - if (take === blockLen) { - if (!dataView) - dataView = (0, utils_ts_1.createView)(data); - for (; blockLen <= len - pos; pos += blockLen) { - this.length += blockLen; - this.compress(dataView, pos); - } - continue; - } - buffer.set(data.subarray(pos, pos + take), this.pos); - this.pos += take; - pos += take; - if (this.pos === blockLen) { - this.length += blockLen; - this.compress(view, 0, true); - this.pos = 0; - } - } - return this; - } - destroy() { - this.destroyed = true; - if (this.salt !== EMPTY_SALT) { - (0, utils_ts_1.clean)(this.salt, this.constants); - } - } - _cloneInto(to) { - to || (to = new this.constructor()); - to.set(...this.get()); - const { buffer, length, finished, destroyed, constants, salt, pos } = this; - to.buffer.set(buffer); - to.constants = constants.slice(); - to.destroyed = destroyed; - to.finished = finished; - to.length = length; - to.pos = pos; - to.salt = salt.slice(); - return to; - } - clone() { - return this._cloneInto(); - } - digestInto(out) { - (0, utils_ts_1.aexists)(this); - (0, utils_ts_1.aoutput)(out, this); - this.finished = true; - // Padding - const { buffer, blockLen, counterLen, lengthFlag, view } = this; - (0, utils_ts_1.clean)(buffer.subarray(this.pos)); // clean buf - const counter = BigInt((this.length + this.pos) * 8); - const counterPos = blockLen - counterLen - 1; - buffer[this.pos] |= 128; // End block flag - this.length += this.pos; // add unwritten length - // Not enough in buffer for length: write what we have. - if (this.pos > counterPos) { - this.compress(view, 0); - (0, utils_ts_1.clean)(buffer); - this.pos = 0; - } - // Difference with md: here we have lengthFlag! - buffer[counterPos] |= lengthFlag; // Length flag - // We always set 8 byte length flag. Because length will overflow significantly sooner. - (0, _md_ts_1.setBigUint64)(view, blockLen - 8, counter, false); - this.compress(view, 0, this.pos !== 0); // don't add length if length is not empty block? - // Write output - (0, utils_ts_1.clean)(buffer); - const v = (0, utils_ts_1.createView)(out); - const state = this.get(); - for (let i = 0; i < this.outputLen / 4; ++i) - v.setUint32(i * 4, state[i]); - } - digest() { - const { buffer, outputLen } = this; - this.digestInto(buffer); - const res = buffer.slice(0, outputLen); - this.destroy(); - return res; - } -} -// Constants -const B64C = /* @__PURE__ */ Uint32Array.from([ - 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, - 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, - 0x9216d5d9, 0x8979fb1b, 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96, - 0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, 0x636920d8, 0x71574e69, -]); -// first half of C512 -const B32C = B64C.slice(0, 16); -const B256_IV = _md_ts_1.SHA256_IV.slice(); -const B224_IV = _md_ts_1.SHA224_IV.slice(); -const B384_IV = _md_ts_1.SHA384_IV.slice(); -const B512_IV = _md_ts_1.SHA512_IV.slice(); -function generateTBL256() { - const TBL = []; - for (let i = 0, j = 0; i < 14; i++, j += 16) { - for (let offset = 1; offset < 16; offset += 2) { - TBL.push(B32C[_blake_ts_1.BSIGMA[j + offset]]); - TBL.push(B32C[_blake_ts_1.BSIGMA[j + offset - 1]]); - } - } - return new Uint32Array(TBL); -} -const TBL256 = /* @__PURE__ */ generateTBL256(); // C256[SIGMA[X]] precompute -// Reusable temporary buffer -const BLAKE256_W = /* @__PURE__ */ new Uint32Array(16); -class Blake1_32 extends BLAKE1 { - constructor(outputLen, IV, lengthFlag, opts = {}) { - super(64, outputLen, lengthFlag, 8, 4, B32C, opts); - this.v0 = IV[0] | 0; - this.v1 = IV[1] | 0; - this.v2 = IV[2] | 0; - this.v3 = IV[3] | 0; - this.v4 = IV[4] | 0; - this.v5 = IV[5] | 0; - this.v6 = IV[6] | 0; - this.v7 = IV[7] | 0; - } - get() { - const { v0, v1, v2, v3, v4, v5, v6, v7 } = this; - return [v0, v1, v2, v3, v4, v5, v6, v7]; - } - // prettier-ignore - set(v0, v1, v2, v3, v4, v5, v6, v7) { - this.v0 = v0 | 0; - this.v1 = v1 | 0; - this.v2 = v2 | 0; - this.v3 = v3 | 0; - this.v4 = v4 | 0; - this.v5 = v5 | 0; - this.v6 = v6 | 0; - this.v7 = v7 | 0; - } - destroy() { - super.destroy(); - this.set(0, 0, 0, 0, 0, 0, 0, 0); - } - compress(view, offset, withLength = true) { - for (let i = 0; i < 16; i++, offset += 4) - BLAKE256_W[i] = view.getUint32(offset, false); - // NOTE: we cannot re-use compress from blake2s, since there is additional xor over u256[SIGMA[e]] - let v00 = this.v0 | 0; - let v01 = this.v1 | 0; - let v02 = this.v2 | 0; - let v03 = this.v3 | 0; - let v04 = this.v4 | 0; - let v05 = this.v5 | 0; - let v06 = this.v6 | 0; - let v07 = this.v7 | 0; - let v08 = this.constants[0] | 0; - let v09 = this.constants[1] | 0; - let v10 = this.constants[2] | 0; - let v11 = this.constants[3] | 0; - const { h, l } = u64.fromBig(BigInt(withLength ? this.length * 8 : 0)); - let v12 = (this.constants[4] ^ l) >>> 0; - let v13 = (this.constants[5] ^ l) >>> 0; - let v14 = (this.constants[6] ^ h) >>> 0; - let v15 = (this.constants[7] ^ h) >>> 0; - // prettier-ignore - for (let i = 0, k = 0, j = 0; i < 14; i++) { - ({ a: v00, b: v04, c: v08, d: v12 } = (0, _blake_ts_1.G1s)(v00, v04, v08, v12, BLAKE256_W[_blake_ts_1.BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v00, b: v04, c: v08, d: v12 } = (0, _blake_ts_1.G2s)(v00, v04, v08, v12, BLAKE256_W[_blake_ts_1.BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v01, b: v05, c: v09, d: v13 } = (0, _blake_ts_1.G1s)(v01, v05, v09, v13, BLAKE256_W[_blake_ts_1.BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v01, b: v05, c: v09, d: v13 } = (0, _blake_ts_1.G2s)(v01, v05, v09, v13, BLAKE256_W[_blake_ts_1.BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v02, b: v06, c: v10, d: v14 } = (0, _blake_ts_1.G1s)(v02, v06, v10, v14, BLAKE256_W[_blake_ts_1.BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v02, b: v06, c: v10, d: v14 } = (0, _blake_ts_1.G2s)(v02, v06, v10, v14, BLAKE256_W[_blake_ts_1.BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v03, b: v07, c: v11, d: v15 } = (0, _blake_ts_1.G1s)(v03, v07, v11, v15, BLAKE256_W[_blake_ts_1.BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v03, b: v07, c: v11, d: v15 } = (0, _blake_ts_1.G2s)(v03, v07, v11, v15, BLAKE256_W[_blake_ts_1.BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v00, b: v05, c: v10, d: v15 } = (0, _blake_ts_1.G1s)(v00, v05, v10, v15, BLAKE256_W[_blake_ts_1.BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v00, b: v05, c: v10, d: v15 } = (0, _blake_ts_1.G2s)(v00, v05, v10, v15, BLAKE256_W[_blake_ts_1.BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v01, b: v06, c: v11, d: v12 } = (0, _blake_ts_1.G1s)(v01, v06, v11, v12, BLAKE256_W[_blake_ts_1.BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v01, b: v06, c: v11, d: v12 } = (0, _blake_ts_1.G2s)(v01, v06, v11, v12, BLAKE256_W[_blake_ts_1.BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v02, b: v07, c: v08, d: v13 } = (0, _blake_ts_1.G1s)(v02, v07, v08, v13, BLAKE256_W[_blake_ts_1.BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v02, b: v07, c: v08, d: v13 } = (0, _blake_ts_1.G2s)(v02, v07, v08, v13, BLAKE256_W[_blake_ts_1.BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v03, b: v04, c: v09, d: v14 } = (0, _blake_ts_1.G1s)(v03, v04, v09, v14, BLAKE256_W[_blake_ts_1.BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v03, b: v04, c: v09, d: v14 } = (0, _blake_ts_1.G2s)(v03, v04, v09, v14, BLAKE256_W[_blake_ts_1.BSIGMA[k++]] ^ TBL256[j++])); - } - this.v0 = (this.v0 ^ v00 ^ v08 ^ this.salt[0]) >>> 0; - this.v1 = (this.v1 ^ v01 ^ v09 ^ this.salt[1]) >>> 0; - this.v2 = (this.v2 ^ v02 ^ v10 ^ this.salt[2]) >>> 0; - this.v3 = (this.v3 ^ v03 ^ v11 ^ this.salt[3]) >>> 0; - this.v4 = (this.v4 ^ v04 ^ v12 ^ this.salt[0]) >>> 0; - this.v5 = (this.v5 ^ v05 ^ v13 ^ this.salt[1]) >>> 0; - this.v6 = (this.v6 ^ v06 ^ v14 ^ this.salt[2]) >>> 0; - this.v7 = (this.v7 ^ v07 ^ v15 ^ this.salt[3]) >>> 0; - (0, utils_ts_1.clean)(BLAKE256_W); - } -} -const BBUF = /* @__PURE__ */ new Uint32Array(32); -const BLAKE512_W = /* @__PURE__ */ new Uint32Array(32); -function generateTBL512() { - const TBL = []; - for (let r = 0, k = 0; r < 16; r++, k += 16) { - for (let offset = 1; offset < 16; offset += 2) { - TBL.push(B64C[_blake_ts_1.BSIGMA[k + offset] * 2 + 0]); - TBL.push(B64C[_blake_ts_1.BSIGMA[k + offset] * 2 + 1]); - TBL.push(B64C[_blake_ts_1.BSIGMA[k + offset - 1] * 2 + 0]); - TBL.push(B64C[_blake_ts_1.BSIGMA[k + offset - 1] * 2 + 1]); - } - } - return new Uint32Array(TBL); -} -const TBL512 = /* @__PURE__ */ generateTBL512(); // C512[SIGMA[X]] precompute -// Mixing function G splitted in two halfs -function G1b(a, b, c, d, msg, k) { - const Xpos = 2 * _blake_ts_1.BSIGMA[k]; - const Xl = msg[Xpos + 1] ^ TBL512[k * 2 + 1], Xh = msg[Xpos] ^ TBL512[k * 2]; // prettier-ignore - let Al = BBUF[2 * a + 1], Ah = BBUF[2 * a]; // prettier-ignore - let Bl = BBUF[2 * b + 1], Bh = BBUF[2 * b]; // prettier-ignore - let Cl = BBUF[2 * c + 1], Ch = BBUF[2 * c]; // prettier-ignore - let Dl = BBUF[2 * d + 1], Dh = BBUF[2 * d]; // prettier-ignore - // v[a] = (v[a] + v[b] + x) | 0; - let ll = u64.add3L(Al, Bl, Xl); - Ah = u64.add3H(ll, Ah, Bh, Xh) >>> 0; - Al = (ll | 0) >>> 0; - // v[d] = rotr(v[d] ^ v[a], 32) - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: u64.rotr32H(Dh, Dl), Dl: u64.rotr32L(Dh, Dl) }); - // v[c] = (v[c] + v[d]) | 0; - ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); - // v[b] = rotr(v[b] ^ v[c], 25) - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: u64.rotrSH(Bh, Bl, 25), Bl: u64.rotrSL(Bh, Bl, 25) }); - (BBUF[2 * a + 1] = Al), (BBUF[2 * a] = Ah); - (BBUF[2 * b + 1] = Bl), (BBUF[2 * b] = Bh); - (BBUF[2 * c + 1] = Cl), (BBUF[2 * c] = Ch); - (BBUF[2 * d + 1] = Dl), (BBUF[2 * d] = Dh); -} -function G2b(a, b, c, d, msg, k) { - const Xpos = 2 * _blake_ts_1.BSIGMA[k]; - const Xl = msg[Xpos + 1] ^ TBL512[k * 2 + 1], Xh = msg[Xpos] ^ TBL512[k * 2]; // prettier-ignore - let Al = BBUF[2 * a + 1], Ah = BBUF[2 * a]; // prettier-ignore - let Bl = BBUF[2 * b + 1], Bh = BBUF[2 * b]; // prettier-ignore - let Cl = BBUF[2 * c + 1], Ch = BBUF[2 * c]; // prettier-ignore - let Dl = BBUF[2 * d + 1], Dh = BBUF[2 * d]; // prettier-ignore - // v[a] = (v[a] + v[b] + x) | 0; - let ll = u64.add3L(Al, Bl, Xl); - Ah = u64.add3H(ll, Ah, Bh, Xh); - Al = ll | 0; - // v[d] = rotr(v[d] ^ v[a], 16) - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: u64.rotrSH(Dh, Dl, 16), Dl: u64.rotrSL(Dh, Dl, 16) }); - // v[c] = (v[c] + v[d]) | 0; - ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); - // v[b] = rotr(v[b] ^ v[c], 11) - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: u64.rotrSH(Bh, Bl, 11), Bl: u64.rotrSL(Bh, Bl, 11) }); - (BBUF[2 * a + 1] = Al), (BBUF[2 * a] = Ah); - (BBUF[2 * b + 1] = Bl), (BBUF[2 * b] = Bh); - (BBUF[2 * c + 1] = Cl), (BBUF[2 * c] = Ch); - (BBUF[2 * d + 1] = Dl), (BBUF[2 * d] = Dh); -} -class Blake1_64 extends BLAKE1 { - constructor(outputLen, IV, lengthFlag, opts = {}) { - super(128, outputLen, lengthFlag, 16, 8, B64C, opts); - this.v0l = IV[0] | 0; - this.v0h = IV[1] | 0; - this.v1l = IV[2] | 0; - this.v1h = IV[3] | 0; - this.v2l = IV[4] | 0; - this.v2h = IV[5] | 0; - this.v3l = IV[6] | 0; - this.v3h = IV[7] | 0; - this.v4l = IV[8] | 0; - this.v4h = IV[9] | 0; - this.v5l = IV[10] | 0; - this.v5h = IV[11] | 0; - this.v6l = IV[12] | 0; - this.v6h = IV[13] | 0; - this.v7l = IV[14] | 0; - this.v7h = IV[15] | 0; - } - // prettier-ignore - get() { - let { v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h } = this; - return [v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h]; - } - // prettier-ignore - set(v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h) { - this.v0l = v0l | 0; - this.v0h = v0h | 0; - this.v1l = v1l | 0; - this.v1h = v1h | 0; - this.v2l = v2l | 0; - this.v2h = v2h | 0; - this.v3l = v3l | 0; - this.v3h = v3h | 0; - this.v4l = v4l | 0; - this.v4h = v4h | 0; - this.v5l = v5l | 0; - this.v5h = v5h | 0; - this.v6l = v6l | 0; - this.v6h = v6h | 0; - this.v7l = v7l | 0; - this.v7h = v7h | 0; - } - destroy() { - super.destroy(); - this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - } - compress(view, offset, withLength = true) { - for (let i = 0; i < 32; i++, offset += 4) - BLAKE512_W[i] = view.getUint32(offset, false); - this.get().forEach((v, i) => (BBUF[i] = v)); // First half from state. - BBUF.set(this.constants.subarray(0, 16), 16); - if (withLength) { - const { h, l } = u64.fromBig(BigInt(this.length * 8)); - BBUF[24] = (BBUF[24] ^ h) >>> 0; - BBUF[25] = (BBUF[25] ^ l) >>> 0; - BBUF[26] = (BBUF[26] ^ h) >>> 0; - BBUF[27] = (BBUF[27] ^ l) >>> 0; - } - for (let i = 0, k = 0; i < 16; i++) { - G1b(0, 4, 8, 12, BLAKE512_W, k++); - G2b(0, 4, 8, 12, BLAKE512_W, k++); - G1b(1, 5, 9, 13, BLAKE512_W, k++); - G2b(1, 5, 9, 13, BLAKE512_W, k++); - G1b(2, 6, 10, 14, BLAKE512_W, k++); - G2b(2, 6, 10, 14, BLAKE512_W, k++); - G1b(3, 7, 11, 15, BLAKE512_W, k++); - G2b(3, 7, 11, 15, BLAKE512_W, k++); - G1b(0, 5, 10, 15, BLAKE512_W, k++); - G2b(0, 5, 10, 15, BLAKE512_W, k++); - G1b(1, 6, 11, 12, BLAKE512_W, k++); - G2b(1, 6, 11, 12, BLAKE512_W, k++); - G1b(2, 7, 8, 13, BLAKE512_W, k++); - G2b(2, 7, 8, 13, BLAKE512_W, k++); - G1b(3, 4, 9, 14, BLAKE512_W, k++); - G2b(3, 4, 9, 14, BLAKE512_W, k++); - } - this.v0l ^= BBUF[0] ^ BBUF[16] ^ this.salt[0]; - this.v0h ^= BBUF[1] ^ BBUF[17] ^ this.salt[1]; - this.v1l ^= BBUF[2] ^ BBUF[18] ^ this.salt[2]; - this.v1h ^= BBUF[3] ^ BBUF[19] ^ this.salt[3]; - this.v2l ^= BBUF[4] ^ BBUF[20] ^ this.salt[4]; - this.v2h ^= BBUF[5] ^ BBUF[21] ^ this.salt[5]; - this.v3l ^= BBUF[6] ^ BBUF[22] ^ this.salt[6]; - this.v3h ^= BBUF[7] ^ BBUF[23] ^ this.salt[7]; - this.v4l ^= BBUF[8] ^ BBUF[24] ^ this.salt[0]; - this.v4h ^= BBUF[9] ^ BBUF[25] ^ this.salt[1]; - this.v5l ^= BBUF[10] ^ BBUF[26] ^ this.salt[2]; - this.v5h ^= BBUF[11] ^ BBUF[27] ^ this.salt[3]; - this.v6l ^= BBUF[12] ^ BBUF[28] ^ this.salt[4]; - this.v6h ^= BBUF[13] ^ BBUF[29] ^ this.salt[5]; - this.v7l ^= BBUF[14] ^ BBUF[30] ^ this.salt[6]; - this.v7h ^= BBUF[15] ^ BBUF[31] ^ this.salt[7]; - (0, utils_ts_1.clean)(BBUF, BLAKE512_W); - } -} -class BLAKE224 extends Blake1_32 { - constructor(opts = {}) { - super(28, B224_IV, 0, opts); - } -} -exports.BLAKE224 = BLAKE224; -class BLAKE256 extends Blake1_32 { - constructor(opts = {}) { - super(32, B256_IV, 1, opts); - } -} -exports.BLAKE256 = BLAKE256; -class BLAKE384 extends Blake1_64 { - constructor(opts = {}) { - super(48, B384_IV, 0, opts); - } -} -exports.BLAKE384 = BLAKE384; -class BLAKE512 extends Blake1_64 { - constructor(opts = {}) { - super(64, B512_IV, 1, opts); - } -} -exports.BLAKE512 = BLAKE512; -/** blake1-224 hash function */ -exports.blake224 = (0, utils_ts_1.createOptHasher)((opts) => new BLAKE224(opts)); -/** blake1-256 hash function */ -exports.blake256 = (0, utils_ts_1.createOptHasher)((opts) => new BLAKE256(opts)); -/** blake1-384 hash function */ -exports.blake384 = (0, utils_ts_1.createOptHasher)((opts) => new BLAKE384(opts)); -/** blake1-512 hash function */ -exports.blake512 = (0, utils_ts_1.createOptHasher)((opts) => new BLAKE512(opts)); -//# sourceMappingURL=blake1.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/blake1.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/blake1.js.map deleted file mode 100644 index 314f7a8a..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/blake1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blake1.js","sourceRoot":"","sources":["src/blake1.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,2CAA+C;AAC/C,qCAAoF;AACpF,iCAAiC;AACjC,kBAAkB;AAClB,yCAKoB;AAOpB,yBAAyB;AACzB,MAAM,UAAU,GAAG,eAAe,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;AAEtD,MAAe,MAA4B,SAAQ,eAAO;IAmBxD,YACE,QAAgB,EAChB,SAAiB,EACjB,UAAkB,EAClB,UAAkB,EAClB,OAAe,EACf,SAAsB,EACtB,OAAkB,EAAE;QAEpB,KAAK,EAAE,CAAC;QA3BA,aAAQ,GAAG,KAAK,CAAC;QACjB,WAAM,GAAG,CAAC,CAAC;QACX,QAAG,GAAG,CAAC,CAAC;QACR,cAAS,GAAG,KAAK,CAAC;QAyB1B,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,C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E,IAAI,CAAC,CAAC;IACxC,CAAC;CACF;AAJD,4BAIC;AACD,+BAA+B;AAClB,QAAA,QAAQ,GAA2B,IAAA,0BAAe,EAC7D,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,CAC7B,CAAC;AACF,+BAA+B;AAClB,QAAA,QAAQ,GAA2B,IAAA,0BAAe,EAC7D,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,CAC7B,CAAC;AACF,+BAA+B;AAClB,QAAA,QAAQ,GAA2B,IAAA,0BAAe,EAC7D,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,CAC7B,CAAC;AACF,+BAA+B;AAClB,QAAA,QAAQ,GAA2B,IAAA,0BAAe,EAC7D,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,CAC7B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/blake2.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/blake2.d.ts deleted file mode 100644 index ea6ae419..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/blake2.d.ts +++ /dev/null @@ -1,116 +0,0 @@ -import { Hash, type CHashO, type Input } from './utils.ts'; -/** Blake hash options. dkLen is output length. key is used in MAC mode. salt is used in KDF mode. */ -export type Blake2Opts = { - dkLen?: number; - key?: Input; - salt?: Input; - personalization?: Input; -}; -/** Class, from which others are subclassed. */ -export declare abstract class BLAKE2> extends Hash { - protected abstract compress(msg: Uint32Array, offset: number, isLast: boolean): void; - protected abstract get(): number[]; - protected abstract set(...args: number[]): void; - abstract destroy(): void; - protected buffer: Uint8Array; - protected buffer32: Uint32Array; - protected finished: boolean; - protected destroyed: boolean; - protected length: number; - protected pos: number; - readonly blockLen: number; - readonly outputLen: number; - constructor(blockLen: number, outputLen: number); - update(data: Input): this; - digestInto(out: Uint8Array): void; - digest(): Uint8Array; - _cloneInto(to?: T): T; - clone(): T; -} -export declare class BLAKE2b extends BLAKE2 { - private v0l; - private v0h; - private v1l; - private v1h; - private v2l; - private v2h; - private v3l; - private v3h; - private v4l; - private v4h; - private v5l; - private v5h; - private v6l; - private v6h; - private v7l; - private v7h; - constructor(opts?: Blake2Opts); - protected get(): [ - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number - ]; - protected set(v0l: number, v0h: number, v1l: number, v1h: number, v2l: number, v2h: number, v3l: number, v3h: number, v4l: number, v4h: number, v5l: number, v5h: number, v6l: number, v6h: number, v7l: number, v7h: number): void; - protected compress(msg: Uint32Array, offset: number, isLast: boolean): void; - destroy(): void; -} -/** - * Blake2b hash function. 64-bit. 1.5x slower than blake2s in JS. - * @param msg - message that would be hashed - * @param opts - dkLen output length, key for MAC mode, salt, personalization - */ -export declare const blake2b: CHashO; -export type Num16 = { - v0: number; - v1: number; - v2: number; - v3: number; - v4: number; - v5: number; - v6: number; - v7: number; - v8: number; - v9: number; - v10: number; - v11: number; - v12: number; - v13: number; - v14: number; - v15: number; -}; -export declare function compress(s: Uint8Array, offset: number, msg: Uint32Array, rounds: number, v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, v9: number, v10: number, v11: number, v12: number, v13: number, v14: number, v15: number): Num16; -export declare class BLAKE2s extends BLAKE2 { - private v0; - private v1; - private v2; - private v3; - private v4; - private v5; - private v6; - private v7; - constructor(opts?: Blake2Opts); - protected get(): [number, number, number, number, number, number, number, number]; - protected set(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number): void; - protected compress(msg: Uint32Array, offset: number, isLast: boolean): void; - destroy(): void; -} -/** - * Blake2s hash function. Focuses on 8-bit to 32-bit platforms. 1.5x faster than blake2b in JS. - * @param msg - message that would be hashed - * @param opts - dkLen output length, key for MAC mode, salt, personalization - */ -export declare const blake2s: CHashO; -//# sourceMappingURL=blake2.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/blake2.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/blake2.d.ts.map deleted file mode 100644 index f7d88d1b..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/blake2.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blake2.d.ts","sourceRoot":"","sources":["src/blake2.ts"],"names":[],"mappings":"AASA,OAAO,EAEmB,IAAI,EAC5B,KAAK,MAAM,EAAE,KAAK,KAAK,EACxB,MAAM,YAAY,CAAC;AAEpB,qGAAqG;AACrG,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,KAAK,CAAC;IACZ,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,eAAe,CAAC,EAAE,KAAK,CAAC;CACzB,CAAC;AA+EF,+CAA+C;AAC/C,8BAAsB,MAAM,CAAC,CAAC,SAAS,MAAM,CAAC,CAAC,CAAC,CAAE,SAAQ,IAAI,CAAC,CAAC,CAAC;IAC/D,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI;IACpF,SAAS,CAAC,QAAQ,CAAC,GAAG,IAAI,MAAM,EAAE;IAClC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI;IAC/C,QAAQ,CAAC,OAAO,IAAI,IAAI;IACxB,SAAS,CAAC,MAAM,EAAE,UAAU,CAAC;IAC7B,SAAS,CAAC,QAAQ,EAAE,WAAW,CAAC;IAChC,SAAS,CAAC,QAAQ,UAAS;IAC3B,SAAS,CAAC,SAAS,UAAS;IAC5B,SAAS,CAAC,MAAM,EAAE,MAAM,CAAK;IAC7B,SAAS,CAAC,GAAG,EAAE,MAAM,CAAK;IAC1B,QAAQ,CAAC,QAAQ,EAAE,M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AAE,MAErB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/blake2.js b/tools/mnemonic-test/node_modules/@noble/hashes/blake2.js deleted file mode 100644 index 3b2a0484..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/blake2.js +++ /dev/null @@ -1,420 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.blake2s = exports.BLAKE2s = exports.blake2b = exports.BLAKE2b = exports.BLAKE2 = void 0; -exports.compress = compress; -/** - * blake2b (64-bit) & blake2s (8 to 32-bit) hash functions. - * b could have been faster, but there is no fast u64 in js, so s is 1.5x faster. - * @module - */ -const _blake_ts_1 = require("./_blake.js"); -const _md_ts_1 = require("./_md.js"); -const u64 = require("./_u64.js"); -// prettier-ignore -const utils_ts_1 = require("./utils.js"); -// Same as SHA512_IV, but swapped endianness: LE instead of BE. iv[1] is iv[0], etc. -const B2B_IV = /* @__PURE__ */ Uint32Array.from([ - 0xf3bcc908, 0x6a09e667, 0x84caa73b, 0xbb67ae85, 0xfe94f82b, 0x3c6ef372, 0x5f1d36f1, 0xa54ff53a, - 0xade682d1, 0x510e527f, 0x2b3e6c1f, 0x9b05688c, 0xfb41bd6b, 0x1f83d9ab, 0x137e2179, 0x5be0cd19, -]); -// Temporary buffer -const BBUF = /* @__PURE__ */ new Uint32Array(32); -// Mixing function G splitted in two halfs -function G1b(a, b, c, d, msg, x) { - // NOTE: V is LE here - const Xl = msg[x], Xh = msg[x + 1]; // prettier-ignore - let Al = BBUF[2 * a], Ah = BBUF[2 * a + 1]; // prettier-ignore - let Bl = BBUF[2 * b], Bh = BBUF[2 * b + 1]; // prettier-ignore - let Cl = BBUF[2 * c], Ch = BBUF[2 * c + 1]; // prettier-ignore - let Dl = BBUF[2 * d], Dh = BBUF[2 * d + 1]; // prettier-ignore - // v[a] = (v[a] + v[b] + x) | 0; - let ll = u64.add3L(Al, Bl, Xl); - Ah = u64.add3H(ll, Ah, Bh, Xh); - Al = ll | 0; - // v[d] = rotr(v[d] ^ v[a], 32) - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: u64.rotr32H(Dh, Dl), Dl: u64.rotr32L(Dh, Dl) }); - // v[c] = (v[c] + v[d]) | 0; - ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); - // v[b] = rotr(v[b] ^ v[c], 24) - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: u64.rotrSH(Bh, Bl, 24), Bl: u64.rotrSL(Bh, Bl, 24) }); - (BBUF[2 * a] = Al), (BBUF[2 * a + 1] = Ah); - (BBUF[2 * b] = Bl), (BBUF[2 * b + 1] = Bh); - (BBUF[2 * c] = Cl), (BBUF[2 * c + 1] = Ch); - (BBUF[2 * d] = Dl), (BBUF[2 * d + 1] = Dh); -} -function G2b(a, b, c, d, msg, x) { - // NOTE: V is LE here - const Xl = msg[x], Xh = msg[x + 1]; // prettier-ignore - let Al = BBUF[2 * a], Ah = BBUF[2 * a + 1]; // prettier-ignore - let Bl = BBUF[2 * b], Bh = BBUF[2 * b + 1]; // prettier-ignore - let Cl = BBUF[2 * c], Ch = BBUF[2 * c + 1]; // prettier-ignore - let Dl = BBUF[2 * d], Dh = BBUF[2 * d + 1]; // prettier-ignore - // v[a] = (v[a] + v[b] + x) | 0; - let ll = u64.add3L(Al, Bl, Xl); - Ah = u64.add3H(ll, Ah, Bh, Xh); - Al = ll | 0; - // v[d] = rotr(v[d] ^ v[a], 16) - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: u64.rotrSH(Dh, Dl, 16), Dl: u64.rotrSL(Dh, Dl, 16) }); - // v[c] = (v[c] + v[d]) | 0; - ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); - // v[b] = rotr(v[b] ^ v[c], 63) - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: u64.rotrBH(Bh, Bl, 63), Bl: u64.rotrBL(Bh, Bl, 63) }); - (BBUF[2 * a] = Al), (BBUF[2 * a + 1] = Ah); - (BBUF[2 * b] = Bl), (BBUF[2 * b + 1] = Bh); - (BBUF[2 * c] = Cl), (BBUF[2 * c + 1] = Ch); - (BBUF[2 * d] = Dl), (BBUF[2 * d + 1] = Dh); -} -function checkBlake2Opts(outputLen, opts = {}, keyLen, saltLen, persLen) { - (0, utils_ts_1.anumber)(keyLen); - if (outputLen < 0 || outputLen > keyLen) - throw new Error('outputLen bigger than keyLen'); - const { key, salt, personalization } = opts; - if (key !== undefined && (key.length < 1 || key.length > keyLen)) - throw new Error('key length must be undefined or 1..' + keyLen); - if (salt !== undefined && salt.length !== saltLen) - throw new Error('salt must be undefined or ' + saltLen); - if (personalization !== undefined && personalization.length !== persLen) - throw new Error('personalization must be undefined or ' + persLen); -} -/** Class, from which others are subclassed. */ -class BLAKE2 extends utils_ts_1.Hash { - constructor(blockLen, outputLen) { - super(); - this.finished = false; - this.destroyed = false; - this.length = 0; - this.pos = 0; - (0, utils_ts_1.anumber)(blockLen); - (0, utils_ts_1.anumber)(outputLen); - this.blockLen = blockLen; - this.outputLen = outputLen; - this.buffer = new Uint8Array(blockLen); - this.buffer32 = (0, utils_ts_1.u32)(this.buffer); - } - update(data) { - (0, utils_ts_1.aexists)(this); - data = (0, utils_ts_1.toBytes)(data); - (0, utils_ts_1.abytes)(data); - // Main difference with other hashes: there is flag for last block, - // so we cannot process current block before we know that there - // is the next one. This significantly complicates logic and reduces ability - // to do zero-copy processing - const { blockLen, buffer, buffer32 } = this; - const len = data.length; - const offset = data.byteOffset; - const buf = data.buffer; - for (let pos = 0; pos < len;) { - // If buffer is full and we still have input (don't process last block, same as blake2s) - if (this.pos === blockLen) { - (0, utils_ts_1.swap32IfBE)(buffer32); - this.compress(buffer32, 0, false); - (0, utils_ts_1.swap32IfBE)(buffer32); - this.pos = 0; - } - const take = Math.min(blockLen - this.pos, len - pos); - const dataOffset = offset + pos; - // full block && aligned to 4 bytes && not last in input - if (take === blockLen && !(dataOffset % 4) && pos + take < len) { - const data32 = new Uint32Array(buf, dataOffset, Math.floor((len - pos) / 4)); - (0, utils_ts_1.swap32IfBE)(data32); - for (let pos32 = 0; pos + blockLen < len; pos32 += buffer32.length, pos += blockLen) { - this.length += blockLen; - this.compress(data32, pos32, false); - } - (0, utils_ts_1.swap32IfBE)(data32); - continue; - } - buffer.set(data.subarray(pos, pos + take), this.pos); - this.pos += take; - this.length += take; - pos += take; - } - return this; - } - digestInto(out) { - (0, utils_ts_1.aexists)(this); - (0, utils_ts_1.aoutput)(out, this); - const { pos, buffer32 } = this; - this.finished = true; - // Padding - (0, utils_ts_1.clean)(this.buffer.subarray(pos)); - (0, utils_ts_1.swap32IfBE)(buffer32); - this.compress(buffer32, 0, true); - (0, utils_ts_1.swap32IfBE)(buffer32); - const out32 = (0, utils_ts_1.u32)(out); - this.get().forEach((v, i) => (out32[i] = (0, utils_ts_1.swap8IfBE)(v))); - } - digest() { - const { buffer, outputLen } = this; - this.digestInto(buffer); - const res = buffer.slice(0, outputLen); - this.destroy(); - return res; - } - _cloneInto(to) { - const { buffer, length, finished, destroyed, outputLen, pos } = this; - to || (to = new this.constructor({ dkLen: outputLen })); - to.set(...this.get()); - to.buffer.set(buffer); - to.destroyed = destroyed; - to.finished = finished; - to.length = length; - to.pos = pos; - // @ts-ignore - to.outputLen = outputLen; - return to; - } - clone() { - return this._cloneInto(); - } -} -exports.BLAKE2 = BLAKE2; -class BLAKE2b extends BLAKE2 { - constructor(opts = {}) { - const olen = opts.dkLen === undefined ? 64 : opts.dkLen; - super(128, olen); - // Same as SHA-512, but LE - this.v0l = B2B_IV[0] | 0; - this.v0h = B2B_IV[1] | 0; - this.v1l = B2B_IV[2] | 0; - this.v1h = B2B_IV[3] | 0; - this.v2l = B2B_IV[4] | 0; - this.v2h = B2B_IV[5] | 0; - this.v3l = B2B_IV[6] | 0; - this.v3h = B2B_IV[7] | 0; - this.v4l = B2B_IV[8] | 0; - this.v4h = B2B_IV[9] | 0; - this.v5l = B2B_IV[10] | 0; - this.v5h = B2B_IV[11] | 0; - this.v6l = B2B_IV[12] | 0; - this.v6h = B2B_IV[13] | 0; - this.v7l = B2B_IV[14] | 0; - this.v7h = B2B_IV[15] | 0; - checkBlake2Opts(olen, opts, 64, 16, 16); - let { key, personalization, salt } = opts; - let keyLength = 0; - if (key !== undefined) { - key = (0, utils_ts_1.toBytes)(key); - keyLength = key.length; - } - this.v0l ^= this.outputLen | (keyLength << 8) | (0x01 << 16) | (0x01 << 24); - if (salt !== undefined) { - salt = (0, utils_ts_1.toBytes)(salt); - const slt = (0, utils_ts_1.u32)(salt); - this.v4l ^= (0, utils_ts_1.swap8IfBE)(slt[0]); - this.v4h ^= (0, utils_ts_1.swap8IfBE)(slt[1]); - this.v5l ^= (0, utils_ts_1.swap8IfBE)(slt[2]); - this.v5h ^= (0, utils_ts_1.swap8IfBE)(slt[3]); - } - if (personalization !== undefined) { - personalization = (0, utils_ts_1.toBytes)(personalization); - const pers = (0, utils_ts_1.u32)(personalization); - this.v6l ^= (0, utils_ts_1.swap8IfBE)(pers[0]); - this.v6h ^= (0, utils_ts_1.swap8IfBE)(pers[1]); - this.v7l ^= (0, utils_ts_1.swap8IfBE)(pers[2]); - this.v7h ^= (0, utils_ts_1.swap8IfBE)(pers[3]); - } - if (key !== undefined) { - // Pad to blockLen and update - const tmp = new Uint8Array(this.blockLen); - tmp.set(key); - this.update(tmp); - } - } - // prettier-ignore - get() { - let { v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h } = this; - return [v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h]; - } - // prettier-ignore - set(v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h) { - this.v0l = v0l | 0; - this.v0h = v0h | 0; - this.v1l = v1l | 0; - this.v1h = v1h | 0; - this.v2l = v2l | 0; - this.v2h = v2h | 0; - this.v3l = v3l | 0; - this.v3h = v3h | 0; - this.v4l = v4l | 0; - this.v4h = v4h | 0; - this.v5l = v5l | 0; - this.v5h = v5h | 0; - this.v6l = v6l | 0; - this.v6h = v6h | 0; - this.v7l = v7l | 0; - this.v7h = v7h | 0; - } - compress(msg, offset, isLast) { - this.get().forEach((v, i) => (BBUF[i] = v)); // First half from state. - BBUF.set(B2B_IV, 16); // Second half from IV. - let { h, l } = u64.fromBig(BigInt(this.length)); - BBUF[24] = B2B_IV[8] ^ l; // Low word of the offset. - BBUF[25] = B2B_IV[9] ^ h; // High word. - // Invert all bits for last block - if (isLast) { - BBUF[28] = ~BBUF[28]; - BBUF[29] = ~BBUF[29]; - } - let j = 0; - const s = _blake_ts_1.BSIGMA; - for (let i = 0; i < 12; i++) { - G1b(0, 4, 8, 12, msg, offset + 2 * s[j++]); - G2b(0, 4, 8, 12, msg, offset + 2 * s[j++]); - G1b(1, 5, 9, 13, msg, offset + 2 * s[j++]); - G2b(1, 5, 9, 13, msg, offset + 2 * s[j++]); - G1b(2, 6, 10, 14, msg, offset + 2 * s[j++]); - G2b(2, 6, 10, 14, msg, offset + 2 * s[j++]); - G1b(3, 7, 11, 15, msg, offset + 2 * s[j++]); - G2b(3, 7, 11, 15, msg, offset + 2 * s[j++]); - G1b(0, 5, 10, 15, msg, offset + 2 * s[j++]); - G2b(0, 5, 10, 15, msg, offset + 2 * s[j++]); - G1b(1, 6, 11, 12, msg, offset + 2 * s[j++]); - G2b(1, 6, 11, 12, msg, offset + 2 * s[j++]); - G1b(2, 7, 8, 13, msg, offset + 2 * s[j++]); - G2b(2, 7, 8, 13, msg, offset + 2 * s[j++]); - G1b(3, 4, 9, 14, msg, offset + 2 * s[j++]); - G2b(3, 4, 9, 14, msg, offset + 2 * s[j++]); - } - this.v0l ^= BBUF[0] ^ BBUF[16]; - this.v0h ^= BBUF[1] ^ BBUF[17]; - this.v1l ^= BBUF[2] ^ BBUF[18]; - this.v1h ^= BBUF[3] ^ BBUF[19]; - this.v2l ^= BBUF[4] ^ BBUF[20]; - this.v2h ^= BBUF[5] ^ BBUF[21]; - this.v3l ^= BBUF[6] ^ BBUF[22]; - this.v3h ^= BBUF[7] ^ BBUF[23]; - this.v4l ^= BBUF[8] ^ BBUF[24]; - this.v4h ^= BBUF[9] ^ BBUF[25]; - this.v5l ^= BBUF[10] ^ BBUF[26]; - this.v5h ^= BBUF[11] ^ BBUF[27]; - this.v6l ^= BBUF[12] ^ BBUF[28]; - this.v6h ^= BBUF[13] ^ BBUF[29]; - this.v7l ^= BBUF[14] ^ BBUF[30]; - this.v7h ^= BBUF[15] ^ BBUF[31]; - (0, utils_ts_1.clean)(BBUF); - } - destroy() { - this.destroyed = true; - (0, utils_ts_1.clean)(this.buffer32); - this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - } -} -exports.BLAKE2b = BLAKE2b; -/** - * Blake2b hash function. 64-bit. 1.5x slower than blake2s in JS. - * @param msg - message that would be hashed - * @param opts - dkLen output length, key for MAC mode, salt, personalization - */ -exports.blake2b = (0, utils_ts_1.createOptHasher)((opts) => new BLAKE2b(opts)); -// prettier-ignore -function compress(s, offset, msg, rounds, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) { - let j = 0; - for (let i = 0; i < rounds; i++) { - ({ a: v0, b: v4, c: v8, d: v12 } = (0, _blake_ts_1.G1s)(v0, v4, v8, v12, msg[offset + s[j++]])); - ({ a: v0, b: v4, c: v8, d: v12 } = (0, _blake_ts_1.G2s)(v0, v4, v8, v12, msg[offset + s[j++]])); - ({ a: v1, b: v5, c: v9, d: v13 } = (0, _blake_ts_1.G1s)(v1, v5, v9, v13, msg[offset + s[j++]])); - ({ a: v1, b: v5, c: v9, d: v13 } = (0, _blake_ts_1.G2s)(v1, v5, v9, v13, msg[offset + s[j++]])); - ({ a: v2, b: v6, c: v10, d: v14 } = (0, _blake_ts_1.G1s)(v2, v6, v10, v14, msg[offset + s[j++]])); - ({ a: v2, b: v6, c: v10, d: v14 } = (0, _blake_ts_1.G2s)(v2, v6, v10, v14, msg[offset + s[j++]])); - ({ a: v3, b: v7, c: v11, d: v15 } = (0, _blake_ts_1.G1s)(v3, v7, v11, v15, msg[offset + s[j++]])); - ({ a: v3, b: v7, c: v11, d: v15 } = (0, _blake_ts_1.G2s)(v3, v7, v11, v15, msg[offset + s[j++]])); - ({ a: v0, b: v5, c: v10, d: v15 } = (0, _blake_ts_1.G1s)(v0, v5, v10, v15, msg[offset + s[j++]])); - ({ a: v0, b: v5, c: v10, d: v15 } = (0, _blake_ts_1.G2s)(v0, v5, v10, v15, msg[offset + s[j++]])); - ({ a: v1, b: v6, c: v11, d: v12 } = (0, _blake_ts_1.G1s)(v1, v6, v11, v12, msg[offset + s[j++]])); - ({ a: v1, b: v6, c: v11, d: v12 } = (0, _blake_ts_1.G2s)(v1, v6, v11, v12, msg[offset + s[j++]])); - ({ a: v2, b: v7, c: v8, d: v13 } = (0, _blake_ts_1.G1s)(v2, v7, v8, v13, msg[offset + s[j++]])); - ({ a: v2, b: v7, c: v8, d: v13 } = (0, _blake_ts_1.G2s)(v2, v7, v8, v13, msg[offset + s[j++]])); - ({ a: v3, b: v4, c: v9, d: v14 } = (0, _blake_ts_1.G1s)(v3, v4, v9, v14, msg[offset + s[j++]])); - ({ a: v3, b: v4, c: v9, d: v14 } = (0, _blake_ts_1.G2s)(v3, v4, v9, v14, msg[offset + s[j++]])); - } - return { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 }; -} -const B2S_IV = _md_ts_1.SHA256_IV; -class BLAKE2s extends BLAKE2 { - constructor(opts = {}) { - const olen = opts.dkLen === undefined ? 32 : opts.dkLen; - super(64, olen); - // Internal state, same as SHA-256 - this.v0 = B2S_IV[0] | 0; - this.v1 = B2S_IV[1] | 0; - this.v2 = B2S_IV[2] | 0; - this.v3 = B2S_IV[3] | 0; - this.v4 = B2S_IV[4] | 0; - this.v5 = B2S_IV[5] | 0; - this.v6 = B2S_IV[6] | 0; - this.v7 = B2S_IV[7] | 0; - checkBlake2Opts(olen, opts, 32, 8, 8); - let { key, personalization, salt } = opts; - let keyLength = 0; - if (key !== undefined) { - key = (0, utils_ts_1.toBytes)(key); - keyLength = key.length; - } - this.v0 ^= this.outputLen | (keyLength << 8) | (0x01 << 16) | (0x01 << 24); - if (salt !== undefined) { - salt = (0, utils_ts_1.toBytes)(salt); - const slt = (0, utils_ts_1.u32)(salt); - this.v4 ^= (0, utils_ts_1.swap8IfBE)(slt[0]); - this.v5 ^= (0, utils_ts_1.swap8IfBE)(slt[1]); - } - if (personalization !== undefined) { - personalization = (0, utils_ts_1.toBytes)(personalization); - const pers = (0, utils_ts_1.u32)(personalization); - this.v6 ^= (0, utils_ts_1.swap8IfBE)(pers[0]); - this.v7 ^= (0, utils_ts_1.swap8IfBE)(pers[1]); - } - if (key !== undefined) { - // Pad to blockLen and update - (0, utils_ts_1.abytes)(key); - const tmp = new Uint8Array(this.blockLen); - tmp.set(key); - this.update(tmp); - } - } - get() { - const { v0, v1, v2, v3, v4, v5, v6, v7 } = this; - return [v0, v1, v2, v3, v4, v5, v6, v7]; - } - // prettier-ignore - set(v0, v1, v2, v3, v4, v5, v6, v7) { - this.v0 = v0 | 0; - this.v1 = v1 | 0; - this.v2 = v2 | 0; - this.v3 = v3 | 0; - this.v4 = v4 | 0; - this.v5 = v5 | 0; - this.v6 = v6 | 0; - this.v7 = v7 | 0; - } - compress(msg, offset, isLast) { - const { h, l } = u64.fromBig(BigInt(this.length)); - // prettier-ignore - const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = compress(_blake_ts_1.BSIGMA, offset, msg, 10, this.v0, this.v1, this.v2, this.v3, this.v4, this.v5, this.v6, this.v7, B2S_IV[0], B2S_IV[1], B2S_IV[2], B2S_IV[3], l ^ B2S_IV[4], h ^ B2S_IV[5], isLast ? ~B2S_IV[6] : B2S_IV[6], B2S_IV[7]); - this.v0 ^= v0 ^ v8; - this.v1 ^= v1 ^ v9; - this.v2 ^= v2 ^ v10; - this.v3 ^= v3 ^ v11; - this.v4 ^= v4 ^ v12; - this.v5 ^= v5 ^ v13; - this.v6 ^= v6 ^ v14; - this.v7 ^= v7 ^ v15; - } - destroy() { - this.destroyed = true; - (0, utils_ts_1.clean)(this.buffer32); - this.set(0, 0, 0, 0, 0, 0, 0, 0); - } -} -exports.BLAKE2s = BLAKE2s; -/** - * Blake2s hash function. Focuses on 8-bit to 32-bit platforms. 1.5x faster than blake2b in JS. - * @param msg - message that would be hashed - * @param opts - dkLen output length, key for MAC mode, salt, personalization - */ -exports.blake2s = (0, utils_ts_1.createOptHasher)((opts) => new BLAKE2s(opts)); -//# sourceMappingURL=blake2.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/blake2.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/blake2.js.map deleted file mode 100644 index 8849793d..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/blake2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blake2.js","sourceRoot":"","sources":["src/blake2.ts"],"names":[],"mappings":";;;AA8WA,4BAyBC;AAvYD;;;;GAIG;AACH,2CAA+C;AAC/C,qCAAqC;AACrC,iCAAiC;AACjC,kBAAkB;AAClB,yCAIoB;AAUpB,oFAAoF;AACpF,MAAM,MAAM,GAAG,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC;IAC9C,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IAC9F,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAA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E,IAAI,EAAE,GAAG,GAAG,CAAC;IACtB,CAAC;IACD,OAAO;QACL,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAA,gBAAK,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACrB,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACnC,CAAC;CACF;AAlFD,0BAkFC;AAED;;;;GAIG;AACU,QAAA,OAAO,GAA2B,IAAA,0BAAe,EAC5D,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAC5B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/blake2b.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/blake2b.d.ts deleted file mode 100644 index a9ea37ec..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/blake2b.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Blake2b hash function. Focuses on 64-bit platforms, but in JS speed different from Blake2s is negligible. - * @module - * @deprecated - */ -import { BLAKE2b as B2B, blake2b as b2b } from './blake2.ts'; -/** @deprecated Use import from `noble/hashes/blake2` module */ -export declare const BLAKE2b: typeof B2B; -/** @deprecated Use import from `noble/hashes/blake2` module */ -export declare const blake2b: typeof b2b; -//# sourceMappingURL=blake2b.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/blake2b.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/blake2b.d.ts.map deleted file mode 100644 index 3b1ad51d..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/blake2b.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blake2b.d.ts","sourceRoot":"","sources":["src/blake2b.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,aAAa,CAAC;AAC7D,+DAA+D;AAC/D,eAAO,MAAM,OAAO,EAAE,OAAO,GAAS,CAAC;AACvC,+DAA+D;AAC/D,eAAO,MAAM,OAAO,EAAE,OAAO,GAAS,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/blake2b.js b/tools/mnemonic-test/node_modules/@noble/hashes/blake2b.js deleted file mode 100644 index 18cdcca1..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/blake2b.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.blake2b = exports.BLAKE2b = void 0; -/** - * Blake2b hash function. Focuses on 64-bit platforms, but in JS speed different from Blake2s is negligible. - * @module - * @deprecated - */ -const blake2_ts_1 = require("./blake2.js"); -/** @deprecated Use import from `noble/hashes/blake2` module */ -exports.BLAKE2b = blake2_ts_1.BLAKE2b; -/** @deprecated Use import from `noble/hashes/blake2` module */ -exports.blake2b = blake2_ts_1.blake2b; -//# sourceMappingURL=blake2b.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/blake2b.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/blake2b.js.map deleted file mode 100644 index 65282add..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/blake2b.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blake2b.js","sourceRoot":"","sources":["src/blake2b.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,2CAA6D;AAC7D,+DAA+D;AAClD,QAAA,OAAO,GAAe,mBAAG,CAAC;AACvC,+DAA+D;AAClD,QAAA,OAAO,GAAe,mBAAG,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/blake2s.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/blake2s.d.ts deleted file mode 100644 index 6720f358..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/blake2s.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Blake2s hash function. Focuses on 8-bit to 32-bit platforms. blake2b for 64-bit, but in JS it is slower. - * @module - * @deprecated - */ -import { G1s as G1s_n, G2s as G2s_n } from './_blake.ts'; -import { BLAKE2s as B2S, blake2s as b2s, compress as compress_n } from './blake2.ts'; -/** @deprecated Use import from `noble/hashes/blake2` module */ -export declare const B2S_IV: Uint32Array; -/** @deprecated Use import from `noble/hashes/blake2` module */ -export declare const G1s: typeof G1s_n; -/** @deprecated Use import from `noble/hashes/blake2` module */ -export declare const G2s: typeof G2s_n; -/** @deprecated Use import from `noble/hashes/blake2` module */ -export declare const compress: typeof compress_n; -/** @deprecated Use import from `noble/hashes/blake2` module */ -export declare const BLAKE2s: typeof B2S; -/** @deprecated Use import from `noble/hashes/blake2` module */ -export declare const blake2s: typeof b2s; -//# sourceMappingURL=blake2s.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/blake2s.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/blake2s.d.ts.map deleted file mode 100644 index 9a54568e..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/blake2s.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blake2s.d.ts","sourceRoot":"","sources":["src/blake2s.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,GAAG,IAAI,KAAK,EAAE,GAAG,IAAI,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,OAAO,IAAI,GAAG,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,aAAa,CAAC;AACrF,+DAA+D;AAC/D,eAAO,MAAM,MAAM,EAAE,WAAuB,CAAC;AAC7C,+DAA+D;AAC/D,eAAO,MAAM,GAAG,EAAE,OAAO,KAAa,CAAC;AACvC,+DAA+D;AAC/D,eAAO,MAAM,GAAG,EAAE,OAAO,KAAa,CAAC;AACvC,+DAA+D;AAC/D,eAAO,MAAM,QAAQ,EAAE,OAAO,UAAuB,CAAC;AACtD,+DAA+D;AAC/D,eAAO,MAAM,OAAO,EAAE,OAAO,GAAS,CAAC;AACvC,+DAA+D;AAC/D,eAAO,MAAM,OAAO,EAAE,OAAO,GAAS,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/blake2s.js b/tools/mnemonic-test/node_modules/@noble/hashes/blake2s.js deleted file mode 100644 index 3d4f42b2..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/blake2s.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.blake2s = exports.BLAKE2s = exports.compress = exports.G2s = exports.G1s = exports.B2S_IV = void 0; -/** - * Blake2s hash function. Focuses on 8-bit to 32-bit platforms. blake2b for 64-bit, but in JS it is slower. - * @module - * @deprecated - */ -const _blake_ts_1 = require("./_blake.js"); -const _md_ts_1 = require("./_md.js"); -const blake2_ts_1 = require("./blake2.js"); -/** @deprecated Use import from `noble/hashes/blake2` module */ -exports.B2S_IV = _md_ts_1.SHA256_IV; -/** @deprecated Use import from `noble/hashes/blake2` module */ -exports.G1s = _blake_ts_1.G1s; -/** @deprecated Use import from `noble/hashes/blake2` module */ -exports.G2s = _blake_ts_1.G2s; -/** @deprecated Use import from `noble/hashes/blake2` module */ -exports.compress = blake2_ts_1.compress; -/** @deprecated Use import from `noble/hashes/blake2` module */ -exports.BLAKE2s = blake2_ts_1.BLAKE2s; -/** @deprecated Use import from `noble/hashes/blake2` module */ -exports.blake2s = blake2_ts_1.blake2s; -//# sourceMappingURL=blake2s.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/blake2s.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/blake2s.js.map deleted file mode 100644 index 84f0312f..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/blake2s.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blake2s.js","sourceRoot":"","sources":["src/blake2s.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,2CAAyD;AACzD,qCAAqC;AACrC,2CAAqF;AACrF,+DAA+D;AAClD,QAAA,MAAM,GAAgB,kBAAS,CAAC;AAC7C,+DAA+D;AAClD,QAAA,GAAG,GAAiB,eAAK,CAAC;AACvC,+DAA+D;AAClD,QAAA,GAAG,GAAiB,eAAK,CAAC;AACvC,+DAA+D;AAClD,QAAA,QAAQ,GAAsB,oBAAU,CAAC;AACtD,+DAA+D;AAClD,QAAA,OAAO,GAAe,mBAAG,CAAC;AACvC,+DAA+D;AAClD,QAAA,OAAO,GAAe,mBAAG,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/blake3.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/blake3.d.ts deleted file mode 100644 index 234fa87f..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/blake3.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { BLAKE2 } from './blake2.ts'; -import { type CHashXO, type HashXOF, type Input } from './utils.ts'; -/** - * Ensure to use EITHER `key` OR `context`, not both. - * - * * `key`: 32-byte MAC key. - * * `context`: string for KDF. Should be hardcoded, globally unique, and application - specific. - * A good default format for the context string is "[application] [commit timestamp] [purpose]". - */ -export type Blake3Opts = { - dkLen?: number; - key?: Input; - context?: Input; -}; -/** Blake3 hash. Can be used as MAC and KDF. */ -export declare class BLAKE3 extends BLAKE2 implements HashXOF { - private chunkPos; - private chunksDone; - private flags; - private IV; - private state; - private stack; - private posOut; - private bufferOut32; - private bufferOut; - private chunkOut; - private enableXOF; - constructor(opts?: Blake3Opts, flags?: number); - protected get(): []; - protected set(): void; - private b2Compress; - protected compress(buf: Uint32Array, bufPos?: number, isLast?: boolean): void; - _cloneInto(to?: BLAKE3): BLAKE3; - destroy(): void; - private b2CompressOut; - protected finish(): void; - private writeInto; - xofInto(out: Uint8Array): Uint8Array; - xof(bytes: number): Uint8Array; - digestInto(out: Uint8Array): Uint8Array; - digest(): Uint8Array; -} -/** - * BLAKE3 hash function. Can be used as MAC and KDF. - * @param msg - message that would be hashed - * @param opts - `dkLen` for output length, `key` for MAC mode, `context` for KDF mode - * @example - * const data = new Uint8Array(32); - * const hash = blake3(data); - * const mac = blake3(data, { key: new Uint8Array(32) }); - * const kdf = blake3(data, { context: 'application name' }); - */ -export declare const blake3: CHashXO; -//# sourceMappingURL=blake3.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/blake3.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/blake3.d.ts.map deleted file mode 100644 index f951d3d5..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/blake3.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blake3.d.ts","sourceRoot":"","sources":["src/blake3.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,MAAM,EAAY,MAAM,aAAa,CAAC;AAE/C,OAAO,EAGL,KAAK,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EACvC,MAAM,YAAY,CAAC;AAwBpB;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,KAAK,CAAC;IAAC,OAAO,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAE1E,+CAA+C;AAC/C,qBAAa,MAAO,SAAQ,MAAM,CAAC,MAAM,CAAE,YAAW,OAAO,CAAC,MAAM,CAAC;IACnE,OAAO,CAAC,QAAQ,CAAK;IACrB,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,EAAE,CAAc;IACxB,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,KAAK,CAAqB;IAElC,OAAO,CAAC,MAAM,CAAK;IACnB,OAAO,CAAC,WAAW,CAAuB;IAC1C,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,QAAQ,CAAK;IACrB,OAAO,CAAC,SAAS,CAAQ;gBAEb,IAAI,GAAE,UAAe,EAAE,KAAK,SAAI;IA2B5C,SAAS,CAAC,GAAG,IAAI,EAAE;IAGnB,SAAS,CAAC,GAAG,IAAI,IAAI;IACrB,OAAO,CAAC,UAAU;IAmBlB,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,GAAE,MAAU,EAAE,MAAM,GAAE,OAAe,GAAG,IAAI;IAiCvF,UAAU,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM;IAe/B,OAAO,IAAI,IAAI;IAMf,OAAO,CAAC,aAAa;IA+BrB,SAAS,CAAC,MAAM,IAAI,IAAI;IAoBxB,OAAO,CAAC,SAAS;IAcjB,OAAO,CAAC,GAAG,EAAE,UAAU,GAAG,UAAU;IAIpC,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU;IAI9B,UAAU,CAAC,GAAG,EAAE,UAAU,GAAG,UAAU;IAQvC,MAAM,IAAI,UAAU;CAGrB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,MAAM,EAAE,OAEpB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/blake3.js b/tools/mnemonic-test/node_modules/@noble/hashes/blake3.js deleted file mode 100644 index 86023420..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/blake3.js +++ /dev/null @@ -1,255 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.blake3 = exports.BLAKE3 = void 0; -/** - * Blake3 fast hash is Blake2 with reduced security (round count). Can also be used as MAC & KDF. - * - * It is advertised as "the fastest cryptographic hash". However, it isn't true in JS. - * Why is this so slow? While it should be 6x faster than blake2b, perf diff is only 20%: - * - * * There is only 30% reduction in number of rounds from blake2s - * * Speed-up comes from tree structure, which is parallelized using SIMD & threading. - * These features are not present in JS, so we only get overhead from trees. - * * Parallelization only happens on 1024-byte chunks: there is no benefit for small inputs. - * * It is still possible to make it faster using: a) loop unrolling b) web workers c) wasm - * @module - */ -const _md_ts_1 = require("./_md.js"); -const _u64_ts_1 = require("./_u64.js"); -const blake2_ts_1 = require("./blake2.js"); -// prettier-ignore -const utils_ts_1 = require("./utils.js"); -// Flag bitset -const B3_Flags = { - CHUNK_START: 0b1, - CHUNK_END: 0b10, - PARENT: 0b100, - ROOT: 0b1000, - KEYED_HASH: 0b10000, - DERIVE_KEY_CONTEXT: 0b100000, - DERIVE_KEY_MATERIAL: 0b1000000, -}; -const B3_IV = _md_ts_1.SHA256_IV.slice(); -const B3_SIGMA = /* @__PURE__ */ (() => { - const Id = Array.from({ length: 16 }, (_, i) => i); - const permute = (arr) => [2, 6, 3, 10, 7, 0, 4, 13, 1, 11, 12, 5, 9, 14, 15, 8].map((i) => arr[i]); - const res = []; - for (let i = 0, v = Id; i < 7; i++, v = permute(v)) - res.push(...v); - return Uint8Array.from(res); -})(); -/** Blake3 hash. Can be used as MAC and KDF. */ -class BLAKE3 extends blake2_ts_1.BLAKE2 { - constructor(opts = {}, flags = 0) { - super(64, opts.dkLen === undefined ? 32 : opts.dkLen); - this.chunkPos = 0; // Position of current block in chunk - this.chunksDone = 0; // How many chunks we already have - this.flags = 0 | 0; - this.stack = []; - // Output - this.posOut = 0; - this.bufferOut32 = new Uint32Array(16); - this.chunkOut = 0; // index of output chunk - this.enableXOF = true; - const { key, context } = opts; - const hasContext = context !== undefined; - if (key !== undefined) { - if (hasContext) - throw new Error('Only "key" or "context" can be specified at same time'); - const k = (0, utils_ts_1.toBytes)(key).slice(); - (0, utils_ts_1.abytes)(k, 32); - this.IV = (0, utils_ts_1.u32)(k); - (0, utils_ts_1.swap32IfBE)(this.IV); - this.flags = flags | B3_Flags.KEYED_HASH; - } - else if (hasContext) { - const ctx = (0, utils_ts_1.toBytes)(context); - const contextKey = new BLAKE3({ dkLen: 32 }, B3_Flags.DERIVE_KEY_CONTEXT) - .update(ctx) - .digest(); - this.IV = (0, utils_ts_1.u32)(contextKey); - (0, utils_ts_1.swap32IfBE)(this.IV); - this.flags = flags | B3_Flags.DERIVE_KEY_MATERIAL; - } - else { - this.IV = B3_IV.slice(); - this.flags = flags; - } - this.state = this.IV.slice(); - this.bufferOut = (0, utils_ts_1.u8)(this.bufferOut32); - } - // Unused - get() { - return []; - } - set() { } - b2Compress(counter, flags, buf, bufPos = 0) { - const { state: s, pos } = this; - const { h, l } = (0, _u64_ts_1.fromBig)(BigInt(counter), true); - // prettier-ignore - const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = (0, blake2_ts_1.compress)(B3_SIGMA, bufPos, buf, 7, s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], B3_IV[0], B3_IV[1], B3_IV[2], B3_IV[3], h, l, pos, flags); - s[0] = v0 ^ v8; - s[1] = v1 ^ v9; - s[2] = v2 ^ v10; - s[3] = v3 ^ v11; - s[4] = v4 ^ v12; - s[5] = v5 ^ v13; - s[6] = v6 ^ v14; - s[7] = v7 ^ v15; - } - compress(buf, bufPos = 0, isLast = false) { - // Compress last block - let flags = this.flags; - if (!this.chunkPos) - flags |= B3_Flags.CHUNK_START; - if (this.chunkPos === 15 || isLast) - flags |= B3_Flags.CHUNK_END; - if (!isLast) - this.pos = this.blockLen; - this.b2Compress(this.chunksDone, flags, buf, bufPos); - this.chunkPos += 1; - // If current block is last in chunk (16 blocks), then compress chunks - if (this.chunkPos === 16 || isLast) { - let chunk = this.state; - this.state = this.IV.slice(); - // If not the last one, compress only when there are trailing zeros in chunk counter - // chunks used as binary tree where current stack is path. Zero means current leaf is finished and can be compressed. - // 1 (001) - leaf not finished (just push current chunk to stack) - // 2 (010) - leaf finished at depth=1 (merge with last elm on stack and push back) - // 3 (011) - last leaf not finished - // 4 (100) - leafs finished at depth=1 and depth=2 - for (let last, chunks = this.chunksDone + 1; isLast || !(chunks & 1); chunks >>= 1) { - if (!(last = this.stack.pop())) - break; - this.buffer32.set(last, 0); - this.buffer32.set(chunk, 8); - this.pos = this.blockLen; - this.b2Compress(0, this.flags | B3_Flags.PARENT, this.buffer32, 0); - chunk = this.state; - this.state = this.IV.slice(); - } - this.chunksDone++; - this.chunkPos = 0; - this.stack.push(chunk); - } - this.pos = 0; - } - _cloneInto(to) { - to = super._cloneInto(to); - const { IV, flags, state, chunkPos, posOut, chunkOut, stack, chunksDone } = this; - to.state.set(state.slice()); - to.stack = stack.map((i) => Uint32Array.from(i)); - to.IV.set(IV); - to.flags = flags; - to.chunkPos = chunkPos; - to.chunksDone = chunksDone; - to.posOut = posOut; - to.chunkOut = chunkOut; - to.enableXOF = this.enableXOF; - to.bufferOut32.set(this.bufferOut32); - return to; - } - destroy() { - this.destroyed = true; - (0, utils_ts_1.clean)(this.state, this.buffer32, this.IV, this.bufferOut32); - (0, utils_ts_1.clean)(...this.stack); - } - // Same as b2Compress, but doesn't modify state and returns 16 u32 array (instead of 8) - b2CompressOut() { - const { state: s, pos, flags, buffer32, bufferOut32: out32 } = this; - const { h, l } = (0, _u64_ts_1.fromBig)(BigInt(this.chunkOut++)); - (0, utils_ts_1.swap32IfBE)(buffer32); - // prettier-ignore - const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = (0, blake2_ts_1.compress)(B3_SIGMA, 0, buffer32, 7, s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], B3_IV[0], B3_IV[1], B3_IV[2], B3_IV[3], l, h, pos, flags); - out32[0] = v0 ^ v8; - out32[1] = v1 ^ v9; - out32[2] = v2 ^ v10; - out32[3] = v3 ^ v11; - out32[4] = v4 ^ v12; - out32[5] = v5 ^ v13; - out32[6] = v6 ^ v14; - out32[7] = v7 ^ v15; - out32[8] = s[0] ^ v8; - out32[9] = s[1] ^ v9; - out32[10] = s[2] ^ v10; - out32[11] = s[3] ^ v11; - out32[12] = s[4] ^ v12; - out32[13] = s[5] ^ v13; - out32[14] = s[6] ^ v14; - out32[15] = s[7] ^ v15; - (0, utils_ts_1.swap32IfBE)(buffer32); - (0, utils_ts_1.swap32IfBE)(out32); - this.posOut = 0; - } - finish() { - if (this.finished) - return; - this.finished = true; - // Padding - (0, utils_ts_1.clean)(this.buffer.subarray(this.pos)); - // Process last chunk - let flags = this.flags | B3_Flags.ROOT; - if (this.stack.length) { - flags |= B3_Flags.PARENT; - (0, utils_ts_1.swap32IfBE)(this.buffer32); - this.compress(this.buffer32, 0, true); - (0, utils_ts_1.swap32IfBE)(this.buffer32); - this.chunksDone = 0; - this.pos = this.blockLen; - } - else { - flags |= (!this.chunkPos ? B3_Flags.CHUNK_START : 0) | B3_Flags.CHUNK_END; - } - this.flags = flags; - this.b2CompressOut(); - } - writeInto(out) { - (0, utils_ts_1.aexists)(this, false); - (0, utils_ts_1.abytes)(out); - this.finish(); - const { blockLen, bufferOut } = this; - for (let pos = 0, len = out.length; pos < len;) { - if (this.posOut >= blockLen) - this.b2CompressOut(); - const take = Math.min(blockLen - this.posOut, len - pos); - out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); - this.posOut += take; - pos += take; - } - return out; - } - xofInto(out) { - if (!this.enableXOF) - throw new Error('XOF is not possible after digest call'); - return this.writeInto(out); - } - xof(bytes) { - (0, utils_ts_1.anumber)(bytes); - return this.xofInto(new Uint8Array(bytes)); - } - digestInto(out) { - (0, utils_ts_1.aoutput)(out, this); - if (this.finished) - throw new Error('digest() was already called'); - this.enableXOF = false; - this.writeInto(out); - this.destroy(); - return out; - } - digest() { - return this.digestInto(new Uint8Array(this.outputLen)); - } -} -exports.BLAKE3 = BLAKE3; -/** - * BLAKE3 hash function. Can be used as MAC and KDF. - * @param msg - message that would be hashed - * @param opts - `dkLen` for output length, `key` for MAC mode, `context` for KDF mode - * @example - * const data = new Uint8Array(32); - * const hash = blake3(data); - * const mac = blake3(data, { key: new Uint8Array(32) }); - * const kdf = blake3(data, { context: 'application name' }); - */ -exports.blake3 = (0, utils_ts_1.createXOFer)((opts) => new BLAKE3(opts)); -//# sourceMappingURL=blake3.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/blake3.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/blake3.js.map deleted file mode 100644 index 6c06019e..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/blake3.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blake3.js","sourceRoot":"","sources":["src/blake3.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;GAYG;AACH,qCAAqC;AACrC,uCAAoC;AACpC,2CAA+C;AAC/C,kBAAkB;AAClB,yCAIoB;AAEpB,cAAc;AACd,MAAM,QAAQ,GAAG;IACf,WAAW,EAAE,GAAG;IAChB,SAAS,EAAE,IAAI;IACf,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE,OAAO;IACnB,kBAAkB,EAAE,QAAQ;IAC5B,mBAAmB,EAAE,SAAS;CACtB,CAAC;AAEX,MAAM,KAAK,GAAG,kBAAS,CAAC,KAAK,EAAE,CAAC;AAEhC,MAAM,QAAQ,GAAe,eAAe,CAAC,CAAC,GAAG,EAAE;IACjD,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IACnD,MAAM,OAAO,GAAG,CAAC,GAAa,EAAE,EAAE,CAChC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5E,MAAM,GAAG,GAA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6BAA6B,CAAC,CAAC;QAClE,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QACpB,IAAI,CAAC,OAAO,EAAE,CAAC;QACf,OAAO,GAAG,CAAC;IACb,CAAC;IACD,MAAM;QACJ,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IACzD,CAAC;CACF;AA1MD,wBA0MC;AAED;;;;;;;;;GASG;AACU,QAAA,MAAM,GAA4B,IAAA,sBAAW,EACxD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAC3B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/crypto.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/crypto.d.ts deleted file mode 100644 index ac181a02..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/crypto.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const crypto: any; -//# sourceMappingURL=crypto.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/crypto.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/crypto.d.ts.map deleted file mode 100644 index 4ecc6bca..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/crypto.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["src/crypto.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,MAAM,EAAE,GACqE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/crypto.js b/tools/mnemonic-test/node_modules/@noble/hashes/crypto.js deleted file mode 100644 index 8226391f..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/crypto.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.crypto = void 0; -exports.crypto = typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined; -//# sourceMappingURL=crypto.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/crypto.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/crypto.js.map deleted file mode 100644 index 0bb417ce..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/crypto.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto.js","sourceRoot":"","sources":["src/crypto.ts"],"names":[],"mappings":";;;AAOa,QAAA,MAAM,GACjB,OAAO,UAAU,KAAK,QAAQ,IAAI,QAAQ,IAAI,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/cryptoNode.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/cryptoNode.d.ts deleted file mode 100644 index 98bda7be..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/cryptoNode.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const crypto: any; -//# sourceMappingURL=cryptoNode.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/cryptoNode.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/cryptoNode.d.ts.map deleted file mode 100644 index 4303dc76..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/cryptoNode.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cryptoNode.d.ts","sourceRoot":"","sources":["src/cryptoNode.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,MAAM,EAAE,GAKJ,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/cryptoNode.js b/tools/mnemonic-test/node_modules/@noble/hashes/cryptoNode.js deleted file mode 100644 index eba1a1ff..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/cryptoNode.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.crypto = void 0; -/** - * Internal webcrypto alias. - * We prefer WebCrypto aka globalThis.crypto, which exists in node.js 16+. - * Falls back to Node.js built-in crypto for Node.js <=v14. - * See utils.ts for details. - * @module - */ -// @ts-ignore -const nc = require("node:crypto"); -exports.crypto = nc && typeof nc === 'object' && 'webcrypto' in nc - ? nc.webcrypto - : nc && typeof nc === 'object' && 'randomBytes' in nc - ? nc - : undefined; -//# sourceMappingURL=cryptoNode.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/cryptoNode.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/cryptoNode.js.map deleted file mode 100644 index 14983d52..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/cryptoNode.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cryptoNode.js","sourceRoot":"","sources":["src/cryptoNode.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,aAAa;AACb,kCAAkC;AACrB,QAAA,MAAM,GACjB,EAAE,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,WAAW,IAAI,EAAE;IAC/C,CAAC,CAAE,EAAE,CAAC,SAAiB;IACvB,CAAC,CAAC,EAAE,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,aAAa,IAAI,EAAE;QACnD,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,SAAS,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/eskdf.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/eskdf.d.ts deleted file mode 100644 index 66721eb5..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/eskdf.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -export declare function scrypt(password: string, salt: string): Uint8Array; -export declare function pbkdf2(password: string, salt: string): Uint8Array; -/** - * Derives main seed. Takes a lot of time. Prefer `eskdf` method instead. - */ -export declare function deriveMainSeed(username: string, password: string): Uint8Array; -type AccountID = number | string; -type OptsLength = { - keyLength: number; -}; -type OptsMod = { - modulus: bigint; -}; -type KeyOpts = undefined | OptsLength | OptsMod; -export interface ESKDF { - /** - * Derives a child key. Child key will not be associated with any - * other child key because of properties of underlying KDF. - * - * @param protocol - 3-15 character protocol name - * @param accountId - numeric identifier of account - * @param options - `keyLength: 64` or `modulus: 41920438n` - * @example deriveChildKey('aes', 0) - */ - deriveChildKey: (protocol: string, accountId: AccountID, options?: KeyOpts) => Uint8Array; - /** - * Deletes the main seed from eskdf instance - */ - expire: () => void; - /** - * Account fingerprint - */ - fingerprint: string; -} -/** - * ESKDF - * @param username - username, email, or identifier, min: 8 characters, should have enough entropy - * @param password - password, min: 8 characters, should have enough entropy - * @example - * const kdf = await eskdf('example-university', 'beginning-new-example'); - * const key = kdf.deriveChildKey('aes', 0); - * console.log(kdf.fingerprint); - * kdf.expire(); - */ -export declare function eskdf(username: string, password: string): Promise; -export {}; -//# sourceMappingURL=eskdf.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/eskdf.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/eskdf.d.ts.map deleted file mode 100644 index 13145135..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/eskdf.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"eskdf.d.ts","sourceRoot":"","sources":["src/eskdf.ts"],"names":[],"mappings":"AAiBA,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAEjE;AAGD,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAEjE;AAiBD;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,UAAU,CAY7E;AAED,KAAK,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AAgCjC,KAAK,UAAU,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AACxC,KAAK,OAAO,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AACnC,KAAK,OAAO,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,CAAC;AAwChD,MAAM,WAAW,KAAK;IACpB;;;;;;;;OAQG;IACH,cAAc,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,UAAU,CAAC;IAC1F;;OAEG;IACH,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;GASG;AACH,wBAAsB,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAuB9E"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/eskdf.js b/tools/mnemonic-test/node_modules/@noble/hashes/eskdf.js deleted file mode 100644 index ac23290e..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/eskdf.js +++ /dev/null @@ -1,166 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.scrypt = scrypt; -exports.pbkdf2 = pbkdf2; -exports.deriveMainSeed = deriveMainSeed; -exports.eskdf = eskdf; -/** - * Experimental KDF for AES. - */ -const hkdf_ts_1 = require("./hkdf.js"); -const pbkdf2_ts_1 = require("./pbkdf2.js"); -const scrypt_ts_1 = require("./scrypt.js"); -const sha256_ts_1 = require("./sha256.js"); -const utils_ts_1 = require("./utils.js"); -// A tiny KDF for various applications like AES key-gen. -// Uses HKDF in a non-standard way, so it's not "KDF-secure", only "PRF-secure". -// Which is good enough: assume sha2-256 retained preimage resistance. -const SCRYPT_FACTOR = 2 ** 19; -const PBKDF2_FACTOR = 2 ** 17; -// Scrypt KDF -function scrypt(password, salt) { - return (0, scrypt_ts_1.scrypt)(password, salt, { N: SCRYPT_FACTOR, r: 8, p: 1, dkLen: 32 }); -} -// PBKDF2-HMAC-SHA256 -function pbkdf2(password, salt) { - return (0, pbkdf2_ts_1.pbkdf2)(sha256_ts_1.sha256, password, salt, { c: PBKDF2_FACTOR, dkLen: 32 }); -} -// Combines two 32-byte byte arrays -function xor32(a, b) { - (0, utils_ts_1.abytes)(a, 32); - (0, utils_ts_1.abytes)(b, 32); - const arr = new Uint8Array(32); - for (let i = 0; i < 32; i++) { - arr[i] = a[i] ^ b[i]; - } - return arr; -} -function strHasLength(str, min, max) { - return typeof str === 'string' && str.length >= min && str.length <= max; -} -/** - * Derives main seed. Takes a lot of time. Prefer `eskdf` method instead. - */ -function deriveMainSeed(username, password) { - if (!strHasLength(username, 8, 255)) - throw new Error('invalid username'); - if (!strHasLength(password, 8, 255)) - throw new Error('invalid password'); - // Declared like this to throw off minifiers which auto-convert .fromCharCode(1) to actual string. - // String with non-ascii may be problematic in some envs - const codes = { _1: 1, _2: 2 }; - const sep = { s: String.fromCharCode(codes._1), p: String.fromCharCode(codes._2) }; - const scr = scrypt(password + sep.s, username + sep.s); - const pbk = pbkdf2(password + sep.p, username + sep.p); - const res = xor32(scr, pbk); - (0, utils_ts_1.clean)(scr, pbk); - return res; -} -/** - * Converts protocol & accountId pair to HKDF salt & info params. - */ -function getSaltInfo(protocol, accountId = 0) { - // Note that length here also repeats two lines below - // We do an additional length check here to reduce the scope of DoS attacks - if (!(strHasLength(protocol, 3, 15) && /^[a-z0-9]{3,15}$/.test(protocol))) { - throw new Error('invalid protocol'); - } - // Allow string account ids for some protocols - const allowsStr = /^password\d{0,3}|ssh|tor|file$/.test(protocol); - let salt; // Extract salt. Default is undefined. - if (typeof accountId === 'string') { - if (!allowsStr) - throw new Error('accountId must be a number'); - if (!strHasLength(accountId, 1, 255)) - throw new Error('accountId must be string of length 1..255'); - salt = (0, utils_ts_1.kdfInputToBytes)(accountId); - } - else if (Number.isSafeInteger(accountId)) { - if (accountId < 0 || accountId > Math.pow(2, 32) - 1) - throw new Error('invalid accountId'); - // Convert to Big Endian Uint32 - salt = new Uint8Array(4); - (0, utils_ts_1.createView)(salt).setUint32(0, accountId, false); - } - else { - throw new Error('accountId must be a number' + (allowsStr ? ' or string' : '')); - } - const info = (0, utils_ts_1.kdfInputToBytes)(protocol); - return { salt, info }; -} -function countBytes(num) { - if (typeof num !== 'bigint' || num <= BigInt(128)) - throw new Error('invalid number'); - return Math.ceil(num.toString(2).length / 8); -} -/** - * Parses keyLength and modulus options to extract length of result key. - * If modulus is used, adds 64 bits to it as per FIPS 186 B.4.1 to combat modulo bias. - */ -function getKeyLength(options) { - if (!options || typeof options !== 'object') - return 32; - const hasLen = 'keyLength' in options; - const hasMod = 'modulus' in options; - if (hasLen && hasMod) - throw new Error('cannot combine keyLength and modulus options'); - if (!hasLen && !hasMod) - throw new Error('must have either keyLength or modulus option'); - // FIPS 186 B.4.1 requires at least 64 more bits - const l = hasMod ? countBytes(options.modulus) + 8 : options.keyLength; - if (!(typeof l === 'number' && l >= 16 && l <= 8192)) - throw new Error('invalid keyLength'); - return l; -} -/** - * Converts key to bigint and divides it by modulus. Big Endian. - * Implements FIPS 186 B.4.1, which removes 0 and modulo bias from output. - */ -function modReduceKey(key, modulus) { - const _1 = BigInt(1); - const num = BigInt('0x' + (0, utils_ts_1.bytesToHex)(key)); // check for ui8a, then bytesToNumber() - const res = (num % (modulus - _1)) + _1; // Remove 0 from output - if (res < _1) - throw new Error('expected positive number'); // Guard against bad values - const len = key.length - 8; // FIPS requires 64 more bits = 8 bytes - const hex = res.toString(16).padStart(len * 2, '0'); // numberToHex() - const bytes = (0, utils_ts_1.hexToBytes)(hex); - if (bytes.length !== len) - throw new Error('invalid length of result key'); - return bytes; -} -/** - * ESKDF - * @param username - username, email, or identifier, min: 8 characters, should have enough entropy - * @param password - password, min: 8 characters, should have enough entropy - * @example - * const kdf = await eskdf('example-university', 'beginning-new-example'); - * const key = kdf.deriveChildKey('aes', 0); - * console.log(kdf.fingerprint); - * kdf.expire(); - */ -async function eskdf(username, password) { - // We are using closure + object instead of class because - // we want to make `seed` non-accessible for any external function. - let seed = deriveMainSeed(username, password); - function deriveCK(protocol, accountId = 0, options) { - (0, utils_ts_1.abytes)(seed, 32); - const { salt, info } = getSaltInfo(protocol, accountId); // validate protocol & accountId - const keyLength = getKeyLength(options); // validate options - const key = (0, hkdf_ts_1.hkdf)(sha256_ts_1.sha256, seed, salt, info, keyLength); - // Modulus has already been validated - return options && 'modulus' in options ? modReduceKey(key, options.modulus) : key; - } - function expire() { - if (seed) - seed.fill(1); - seed = undefined; - } - // prettier-ignore - const fingerprint = Array.from(deriveCK('fingerprint', 0)) - .slice(0, 6) - .map((char) => char.toString(16).padStart(2, '0').toUpperCase()) - .join(':'); - return Object.freeze({ deriveChildKey: deriveCK, expire, fingerprint }); -} -//# sourceMappingURL=eskdf.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/eskdf.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/eskdf.js.map deleted file mode 100644 index c5204447..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/eskdf.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"eskdf.js","sourceRoot":"","sources":["src/eskdf.ts"],"names":[],"mappings":";;AAiBA,wBAEC;AAGD,wBAEC;AAoBD,wCAYC;AA2GD,sBAuBC;AA1LD;;GAEG;AACH,uCAAiC;AACjC,2CAAgD;AAChD,2CAAgD;AAChD,2CAAqC;AACrC,yCAAgG;AAEhG,wDAAwD;AACxD,gFAAgF;AAChF,sEAAsE;AAEtE,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE,CAAC;AAC9B,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE,CAAC;AAE9B,aAAa;AACb,SAAgB,MAAM,CAAC,QAAgB,EAAE,IAAY;IACnD,OAAO,IAAA,kBAAO,EAAC,QAAQ,EAAE,IAAI,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ACvD,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;SACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;SAC/D,IAAI,CAAC,GAAG,CAAC,CAAC;IACb,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC;AAC1E,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/_assert.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/esm/_assert.d.ts deleted file mode 100644 index 5d62f87b..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/_assert.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Internal assertion helpers. - * @module - * @deprecated - */ -import { abytes as ab, aexists as ae, anumber as an, aoutput as ao, type IHash as H } from './utils.ts'; -/** @deprecated Use import from `noble/hashes/utils` module */ -export declare const abytes: typeof ab; -/** @deprecated Use import from `noble/hashes/utils` module */ -export declare const aexists: typeof ae; -/** @deprecated Use import from `noble/hashes/utils` module */ -export declare const anumber: typeof an; -/** @deprecated Use import from `noble/hashes/utils` module */ -export declare const aoutput: typeof ao; -/** @deprecated Use import from `noble/hashes/utils` module */ -export type Hash = H; -//# sourceMappingURL=_assert.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/_assert.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/_assert.d.ts.map deleted file mode 100644 index 8e49f069..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/_assert.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_assert.d.ts","sourceRoot":"","sources":["../src/_assert.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,MAAM,IAAI,EAAE,EACZ,OAAO,IAAI,EAAE,EACb,OAAO,IAAI,EAAE,EACb,OAAO,IAAI,EAAE,EACb,KAAK,KAAK,IAAI,CAAC,EAChB,MAAM,YAAY,CAAC;AACpB,8DAA8D;AAC9D,eAAO,MAAM,MAAM,EAAE,OAAO,EAAO,CAAC;AACpC,8DAA8D;AAC9D,eAAO,MAAM,OAAO,EAAE,OAAO,EAAO,CAAC;AACrC,8DAA8D;AAC9D,eAAO,MAAM,OAAO,EAAE,OAAO,EAAO,CAAC;AACrC,8DAA8D;AAC9D,eAAO,MAAM,OAAO,EAAE,OAAO,EAAO,CAAC;AACrC,8DAA8D;AAC9D,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/_assert.js b/tools/mnemonic-test/node_modules/@noble/hashes/esm/_assert.js deleted file mode 100644 index 91286fdf..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/_assert.js +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Internal assertion helpers. - * @module - * @deprecated - */ -import { abytes as ab, aexists as ae, anumber as an, aoutput as ao, } from "./utils.js"; -/** @deprecated Use import from `noble/hashes/utils` module */ -export const abytes = ab; -/** @deprecated Use import from `noble/hashes/utils` module */ -export const aexists = ae; -/** @deprecated Use import from `noble/hashes/utils` module */ -export const anumber = an; -/** @deprecated Use import from `noble/hashes/utils` module */ -export const aoutput = ao; -//# sourceMappingURL=_assert.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/_assert.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/_assert.js.map deleted file mode 100644 index a64fcf56..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/_assert.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_assert.js","sourceRoot":"","sources":["../src/_assert.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,MAAM,IAAI,EAAE,EACZ,OAAO,IAAI,EAAE,EACb,OAAO,IAAI,EAAE,EACb,OAAO,IAAI,EAAE,GAEd,MAAM,YAAY,CAAC;AACpB,8DAA8D;AAC9D,MAAM,CAAC,MAAM,MAAM,GAAc,EAAE,CAAC;AACpC,8DAA8D;AAC9D,MAAM,CAAC,MAAM,OAAO,GAAc,EAAE,CAAC;AACrC,8DAA8D;AAC9D,MAAM,CAAC,MAAM,OAAO,GAAc,EAAE,CAAC;AACrC,8DAA8D;AAC9D,MAAM,CAAC,MAAM,OAAO,GAAc,EAAE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/_blake.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/esm/_blake.d.ts deleted file mode 100644 index 71ed85f9..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/_blake.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Internal blake variable. - * For BLAKE2b, the two extra permutations for rounds 10 and 11 are SIGMA[10..11] = SIGMA[0..1]. - */ -export declare const BSIGMA: Uint8Array; -export type Num4 = { - a: number; - b: number; - c: number; - d: number; -}; -export declare function G1s(a: number, b: number, c: number, d: number, x: number): Num4; -export declare function G2s(a: number, b: number, c: number, d: number, x: number): Num4; -//# sourceMappingURL=_blake.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/_blake.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/_blake.d.ts.map deleted file mode 100644 index c945f9d1..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/_blake.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_blake.d.ts","sourceRoot":"","sources":["../src/_blake.ts"],"names":[],"mappings":"AAMA;;;GAGG;AAEH,eAAO,MAAM,MAAM,EAAE,UAkBnB,CAAC;AAGH,MAAM,MAAM,IAAI,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;CAAE,CAAC;AAGnE,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAM/E;AAED,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAM/E"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/_blake.js b/tools/mnemonic-test/node_modules/@noble/hashes/esm/_blake.js deleted file mode 100644 index 3573ee96..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/_blake.js +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Internal helpers for blake hash. - * @module - */ -import { rotr } from "./utils.js"; -/** - * Internal blake variable. - * For BLAKE2b, the two extra permutations for rounds 10 and 11 are SIGMA[10..11] = SIGMA[0..1]. - */ -// prettier-ignore -export const BSIGMA = /* @__PURE__ */ Uint8Array.from([ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3, - 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4, - 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8, - 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13, - 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9, - 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11, - 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10, - 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5, - 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3, - // Blake1, unused in others - 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4, - 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8, - 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13, - 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9, -]); -// Mixing function G splitted in two halfs -export function G1s(a, b, c, d, x) { - a = (a + b + x) | 0; - d = rotr(d ^ a, 16); - c = (c + d) | 0; - b = rotr(b ^ c, 12); - return { a, b, c, d }; -} -export function G2s(a, b, c, d, x) { - a = (a + b + x) | 0; - d = rotr(d ^ a, 8); - c = (c + d) | 0; - b = rotr(b ^ c, 7); - return { a, b, c, d }; -} -//# sourceMappingURL=_blake.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/_blake.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/_blake.js.map deleted file mode 100644 index c8cdaaaf..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/_blake.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_blake.js","sourceRoot":"","sources":["../src/_blake.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC;;;GAGG;AACH,kBAAkB;AAClB,MAAM,CAAC,MAAM,MAAM,GAAe,eAAe,CAAC,UAAU,CAAC,IAAI,CAAC;IAChE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC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AAC;IACpB,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IACnB,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IAChB,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IACnB,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/_md.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/esm/_md.d.ts deleted file mode 100644 index ae184df9..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/_md.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Internal Merkle-Damgard hash utils. - * @module - */ -import { type Input, Hash } from './utils.ts'; -/** Polyfill for Safari 14. https://caniuse.com/mdn-javascript_builtins_dataview_setbiguint64 */ -export declare function setBigUint64(view: DataView, byteOffset: number, value: bigint, isLE: boolean): void; -/** Choice: a ? b : c */ -export declare function Chi(a: number, b: number, c: number): number; -/** Majority function, true if any two inputs is true. */ -export declare function Maj(a: number, b: number, c: number): number; -/** - * Merkle-Damgard hash construction base class. - * Could be used to create MD5, RIPEMD, SHA1, SHA2. - */ -export declare abstract class HashMD> extends Hash { - protected abstract process(buf: DataView, offset: number): void; - protected abstract get(): number[]; - protected abstract set(...args: number[]): void; - abstract destroy(): void; - protected abstract roundClean(): void; - readonly blockLen: number; - readonly outputLen: number; - readonly padOffset: number; - readonly isLE: boolean; - protected buffer: Uint8Array; - protected view: DataView; - protected finished: boolean; - protected length: number; - protected pos: number; - protected destroyed: boolean; - constructor(blockLen: number, outputLen: number, padOffset: number, isLE: boolean); - update(data: Input): this; - digestInto(out: Uint8Array): void; - digest(): Uint8Array; - _cloneInto(to?: T): T; - clone(): T; -} -/** - * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53. - * Check out `test/misc/sha2-gen-iv.js` for recomputation guide. - */ -/** Initial SHA256 state. Bits 0..32 of frac part of sqrt of primes 2..19 */ -export declare const SHA256_IV: Uint32Array; -/** Initial SHA224 state. Bits 32..64 of frac part of sqrt of primes 23..53 */ -export declare const SHA224_IV: Uint32Array; -/** Initial SHA384 state. Bits 0..64 of frac part of sqrt of primes 23..53 */ -export declare const SHA384_IV: Uint32Array; -/** Initial SHA512 state. Bits 0..64 of frac part of sqrt of primes 2..19 */ -export declare const SHA512_IV: Uint32Array; -//# sourceMappingURL=_md.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/_md.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/_md.d.ts.map deleted file mode 100644 index d67c9702..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/_md.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_md.d.ts","sourceRoot":"","sources":["../src/_md.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,KAAK,KAAK,EAAE,IAAI,EAAwD,MAAM,YAAY,CAAC;AAEpG,gGAAgG;AAChG,wBAAgB,YAAY,CAC1B,IAAI,EAAE,QAAQ,EACd,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,OAAO,GACZ,IAAI,CAUN;AAED,wBAAwB;AACxB,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,yDAAyD;AACzD,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED;;;GAGG;AACH,8BAAsB,MAAM,CAAC,CAAC,SAAS,MAAM,CAAC,CAAC,CAAC,CAAE,SAAQ,IAAI,CAAC,CAAC,CAAC;IAC/D,SA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eAAO,MAAM,SAAS,EAAE,WAGtB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/_md.js b/tools/mnemonic-test/node_modules/@noble/hashes/esm/_md.js deleted file mode 100644 index 3cf023d9..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/_md.js +++ /dev/null @@ -1,155 +0,0 @@ -/** - * Internal Merkle-Damgard hash utils. - * @module - */ -import { Hash, abytes, aexists, aoutput, clean, createView, toBytes } from "./utils.js"; -/** Polyfill for Safari 14. https://caniuse.com/mdn-javascript_builtins_dataview_setbiguint64 */ -export function setBigUint64(view, byteOffset, value, isLE) { - if (typeof view.setBigUint64 === 'function') - return view.setBigUint64(byteOffset, value, isLE); - const _32n = BigInt(32); - const _u32_max = BigInt(0xffffffff); - const wh = Number((value >> _32n) & _u32_max); - const wl = Number(value & _u32_max); - const h = isLE ? 4 : 0; - const l = isLE ? 0 : 4; - view.setUint32(byteOffset + h, wh, isLE); - view.setUint32(byteOffset + l, wl, isLE); -} -/** Choice: a ? b : c */ -export function Chi(a, b, c) { - return (a & b) ^ (~a & c); -} -/** Majority function, true if any two inputs is true. */ -export function Maj(a, b, c) { - return (a & b) ^ (a & c) ^ (b & c); -} -/** - * Merkle-Damgard hash construction base class. - * Could be used to create MD5, RIPEMD, SHA1, SHA2. - */ -export class HashMD extends Hash { - constructor(blockLen, outputLen, padOffset, isLE) { - super(); - this.finished = false; - this.length = 0; - this.pos = 0; - this.destroyed = false; - this.blockLen = blockLen; - this.outputLen = outputLen; - this.padOffset = padOffset; - this.isLE = isLE; - this.buffer = new Uint8Array(blockLen); - this.view = createView(this.buffer); - } - update(data) { - aexists(this); - data = toBytes(data); - abytes(data); - const { view, buffer, blockLen } = this; - const len = data.length; - for (let pos = 0; pos < len;) { - const take = Math.min(blockLen - this.pos, len - pos); - // Fast path: we have at least one block in input, cast it to view and process - if (take === blockLen) { - const dataView = createView(data); - for (; blockLen <= len - pos; pos += blockLen) - this.process(dataView, pos); - continue; - } - buffer.set(data.subarray(pos, pos + take), this.pos); - this.pos += take; - pos += take; - if (this.pos === blockLen) { - this.process(view, 0); - this.pos = 0; - } - } - this.length += data.length; - this.roundClean(); - return this; - } - digestInto(out) { - aexists(this); - aoutput(out, this); - this.finished = true; - // Padding - // We can avoid allocation of buffer for padding completely if it - // was previously not allocated here. But it won't change performance. - const { buffer, view, blockLen, isLE } = this; - let { pos } = this; - // append the bit '1' to the message - buffer[pos++] = 0b10000000; - clean(this.buffer.subarray(pos)); - // we have less than padOffset left in buffer, so we cannot put length in - // current block, need process it and pad again - if (this.padOffset > blockLen - pos) { - this.process(view, 0); - pos = 0; - } - // Pad until full block byte with zeros - for (let i = pos; i < blockLen; i++) - buffer[i] = 0; - // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that - // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen. - // So we just write lowest 64 bits of that value. - setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE); - this.process(view, 0); - const oview = createView(out); - const len = this.outputLen; - // NOTE: we do division by 4 later, which should be fused in single op with modulo by JIT - if (len % 4) - throw new Error('_sha2: outputLen should be aligned to 32bit'); - const outLen = len / 4; - const state = this.get(); - if (outLen > state.length) - throw new Error('_sha2: outputLen bigger than state'); - for (let i = 0; i < outLen; i++) - oview.setUint32(4 * i, state[i], isLE); - } - digest() { - const { buffer, outputLen } = this; - this.digestInto(buffer); - const res = buffer.slice(0, outputLen); - this.destroy(); - return res; - } - _cloneInto(to) { - to || (to = new this.constructor()); - to.set(...this.get()); - const { blockLen, buffer, length, finished, destroyed, pos } = this; - to.destroyed = destroyed; - to.finished = finished; - to.length = length; - to.pos = pos; - if (length % blockLen) - to.buffer.set(buffer); - return to; - } - clone() { - return this._cloneInto(); - } -} -/** - * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53. - * Check out `test/misc/sha2-gen-iv.js` for recomputation guide. - */ -/** Initial SHA256 state. Bits 0..32 of frac part of sqrt of primes 2..19 */ -export const SHA256_IV = /* @__PURE__ */ Uint32Array.from([ - 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19, -]); -/** Initial SHA224 state. Bits 32..64 of frac part of sqrt of primes 23..53 */ -export const SHA224_IV = /* @__PURE__ */ Uint32Array.from([ - 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4, -]); -/** Initial SHA384 state. Bits 0..64 of frac part of sqrt of primes 23..53 */ -export const SHA384_IV = /* @__PURE__ */ Uint32Array.from([ - 0xcbbb9d5d, 0xc1059ed8, 0x629a292a, 0x367cd507, 0x9159015a, 0x3070dd17, 0x152fecd8, 0xf70e5939, - 0x67332667, 0xffc00b31, 0x8eb44a87, 0x68581511, 0xdb0c2e0d, 0x64f98fa7, 0x47b5481d, 0xbefa4fa4, -]); -/** Initial SHA512 state. Bits 0..64 of frac part of sqrt of primes 2..19 */ -export const SHA512_IV = /* @__PURE__ */ Uint32Array.from([ - 0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1, - 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179, -]); -//# sourceMappingURL=_md.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/_md.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/_md.js.map deleted file mode 100644 index 4b3da57e..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/_md.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_md.js","sourceRoot":"","sources":["../src/_md.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAc,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KA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AE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IAC9F,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;CAC/F,CAAC,CAAC;AAEH,4EAA4E;AAC5E,MAAM,CAAC,MAAM,SAAS,GAAgB,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC;IACrE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IAC9F,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;CAC/F,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/_u64.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/esm/_u64.d.ts deleted file mode 100644 index ac5523a3..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/_u64.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -declare function fromBig(n: bigint, le?: boolean): { - h: number; - l: number; -}; -declare function split(lst: bigint[], le?: boolean): Uint32Array[]; -declare const toBig: (h: number, l: number) => bigint; -declare const shrSH: (h: number, _l: number, s: number) => number; -declare const shrSL: (h: number, l: number, s: number) => number; -declare const rotrSH: (h: number, l: number, s: number) => number; -declare const rotrSL: (h: number, l: number, s: number) => number; -declare const rotrBH: (h: number, l: number, s: number) => number; -declare const rotrBL: (h: number, l: number, s: number) => number; -declare const rotr32H: (_h: number, l: number) => number; -declare const rotr32L: (h: number, _l: number) => number; -declare const rotlSH: (h: number, l: number, s: number) => number; -declare const rotlSL: (h: number, l: number, s: number) => number; -declare const rotlBH: (h: number, l: number, s: number) => number; -declare const rotlBL: (h: number, l: number, s: number) => number; -declare function add(Ah: number, Al: number, Bh: number, Bl: number): { - h: number; - l: number; -}; -declare const add3L: (Al: number, Bl: number, Cl: number) => number; -declare const add3H: (low: number, Ah: number, Bh: number, Ch: number) => number; -declare const add4L: (Al: number, Bl: number, Cl: number, Dl: number) => number; -declare const add4H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number) => number; -declare const add5L: (Al: number, Bl: number, Cl: number, Dl: number, El: number) => number; -declare const add5H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number, Eh: number) => number; -export { add, add3H, add3L, add4H, add4L, add5H, add5L, fromBig, rotlBH, rotlBL, rotlSH, rotlSL, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL, shrSH, shrSL, split, toBig }; -declare const u64: { - fromBig: typeof fromBig; - split: typeof split; - toBig: (h: number, l: number) => bigint; - shrSH: (h: number, _l: number, s: number) => number; - shrSL: (h: number, l: number, s: number) => number; - rotrSH: (h: number, l: number, s: number) => number; - rotrSL: (h: number, l: number, s: number) => number; - rotrBH: (h: number, l: number, s: number) => number; - rotrBL: (h: number, l: number, s: number) => number; - rotr32H: (_h: number, l: number) => number; - rotr32L: (h: number, _l: number) => number; - rotlSH: (h: number, l: number, s: number) => number; - rotlSL: (h: number, l: number, s: number) => number; - rotlBH: (h: number, l: number, s: number) => number; - rotlBL: (h: number, l: number, s: number) => number; - add: typeof add; - add3L: (Al: number, Bl: number, Cl: number) => number; - add3H: (low: number, Ah: number, Bh: number, Ch: number) => number; - add4L: (Al: number, Bl: number, Cl: number, Dl: number) => number; - add4H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number) => number; - add5H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number, Eh: number) => number; - add5L: (Al: number, Bl: number, Cl: number, Dl: number, El: number) => number; -}; -export default u64; -//# sourceMappingURL=_u64.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/_u64.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/_u64.d.ts.map deleted file mode 100644 index b1e0a4ef..00000000 --- a/tools/mnemonic-test/node_modules/@no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E,MAAM,KAAK,MAAM,CAAC;IAAC,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;CAOrpC,CAAC;AACF,eAAe,GAAG,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/_u64.js b/tools/mnemonic-test/node_modules/@noble/hashes/esm/_u64.js deleted file mode 100644 index 65193543..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/_u64.js +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Internal helpers for u64. BigUint64Array is too slow as per 2025, so we implement it using Uint32Array. - * @todo re-check https://issues.chromium.org/issues/42212588 - * @module - */ -const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1); -const _32n = /* @__PURE__ */ BigInt(32); -function fromBig(n, le = false) { - if (le) - return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) }; - return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 }; -} -function split(lst, le = false) { - const len = lst.length; - let Ah = new Uint32Array(len); - let Al = new Uint32Array(len); - for (let i = 0; i < len; i++) { - const { h, l } = fromBig(lst[i], le); - [Ah[i], Al[i]] = [h, l]; - } - return [Ah, Al]; -} -const toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0); -// for Shift in [0, 32) -const shrSH = (h, _l, s) => h >>> s; -const shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); -// Right rotate for Shift in [1, 32) -const rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s)); -const rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); -// Right rotate for Shift in (32, 64), NOTE: 32 is special case. -const rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32)); -const rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s)); -// Right rotate for shift===32 (just swaps l&h) -const rotr32H = (_h, l) => l; -const rotr32L = (h, _l) => h; -// Left rotate for Shift in [1, 32) -const rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s)); -const rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s)); -// Left rotate for Shift in (32, 64), NOTE: 32 is special case. -const rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s)); -const rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s)); -// JS uses 32-bit signed integers for bitwise operations which means we cannot -// simple take carry out of low bit sum by shift, we need to use division. -function add(Ah, Al, Bh, Bl) { - const l = (Al >>> 0) + (Bl >>> 0); - return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 }; -} -// Addition with more than 2 elements -const add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); -const add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0; -const add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); -const add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0; -const add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); -const add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0; -// prettier-ignore -export { add, add3H, add3L, add4H, add4L, add5H, add5L, fromBig, rotlBH, rotlBL, rotlSH, rotlSL, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL, shrSH, shrSL, split, toBig }; -// prettier-ignore -const u64 = { - fromBig, split, toBig, - shrSH, shrSL, - rotrSH, rotrSL, rotrBH, rotrBL, - rotr32H, rotr32L, - rotlSH, rotlSL, rotlBH, rotlBL, - add, add3L, add3H, add4L, add4H, add5H, add5L, -}; -export default u64; -//# sourceMappingURL=_u64.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/_u64.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/_u64.js.map deleted file mode 100644 index 36261865..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/_u64.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_u64.js","sourceRoot":"","sources":["../src/_u64.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;AACvD,MAAM,IAAI,GAAG,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAExC,SAAS,OAAO,CACd,CAAS,EACT,EAAE,GAAG,KAAK;IAKV,IAAI,EAAE;QAAE,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,UAAU,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,UAAU,CAAC,EAAE,CAAC;IAClF,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;AACpF,CAAC;AAED,SAAS,KAAK,CAAC,GAAa,EAAE,EAAE,GAAG,KAAK;IACtC,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC;IACvB,IAAI,EAAE,GAAG,IAAI,WAAW,CAAC,GAAG,CAAC,CAAC;IAC9B,IAAI,EAAE,GAAG,IAAI,WAAW,CAAC,GAAG,CAAC,CAAC;IAC9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;QAC7B,MAAM,EA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AE,KAAK;CAC9C,CAAC;AACF,eAAe,GAAG,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/argon2.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/esm/argon2.d.ts deleted file mode 100644 index 67cb8f6b..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/argon2.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { type KDFInput } from './utils.ts'; -/** - * Argon2 options. - * * t: time cost, m: mem cost in kb, p: parallelization. - * * key: optional key. personalization: arbitrary extra data. - * * dkLen: desired number of output bytes. - */ -export type ArgonOpts = { - t: number; - m: number; - p: number; - version?: number; - key?: KDFInput; - personalization?: KDFInput; - dkLen?: number; - asyncTick?: number; - maxmem?: number; - onProgress?: (progress: number) => void; -}; -/** argon2d GPU-resistant version. */ -export declare const argon2d: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Uint8Array; -/** argon2i side-channel-resistant version. */ -export declare const argon2i: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Uint8Array; -/** argon2id, combining i+d, the most popular version from RFC 9106 */ -export declare const argon2id: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Uint8Array; -/** argon2d async GPU-resistant version. */ -export declare const argon2dAsync: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Promise; -/** argon2i async side-channel-resistant version. */ -export declare const argon2iAsync: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Promise; -/** argon2id async, combining i+d, the most popular version from RFC 9106 */ -export declare const argon2idAsync: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Promise; -//# sourceMappingURL=argon2.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/argon2.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/argon2.d.ts.map deleted file mode 100644 index 65b1e4cb..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/argon2.d.ts.map +++ /dev/null @@ -1 +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AClB,MAAM,QAAQ,EACd,MAAM,SAAS,KACd,OAAO,CAAC,UAAU,CAAmD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/argon2.js b/tools/mnemonic-test/node_modules/@noble/hashes/esm/argon2.js deleted file mode 100644 index 3ba860f8..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/argon2.js +++ /dev/null @@ -1,392 +0,0 @@ -/** - * Argon2 KDF from RFC 9106. Can be used to create a key from password and salt. - * We suggest to use Scrypt. JS Argon is 2-10x slower than native code because of 64-bitness: - * * argon uses uint64, but JS doesn't have fast uint64array - * * uint64 multiplication is 1/3 of time - * * `P` function would be very nice with u64, because most of value will be in registers, - * hovewer with u32 it will require 32 registers, which is too much. - * * JS arrays do slow bound checks, so reading from `A2_BUF` slows it down - * @module - */ -import { add3H, add3L, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL } from "./_u64.js"; -import { blake2b } from "./blake2.js"; -import { abytes, clean, kdfInputToBytes, nextTick, u32, u8 } from "./utils.js"; -const AT = { Argond2d: 0, Argon2i: 1, Argon2id: 2 }; -const ARGON2_SYNC_POINTS = 4; -const abytesOrZero = (buf) => { - if (buf === undefined) - return Uint8Array.of(); - return kdfInputToBytes(buf); -}; -// u32 * u32 = u64 -function mul(a, b) { - const aL = a & 0xffff; - const aH = a >>> 16; - const bL = b & 0xffff; - const bH = b >>> 16; - const ll = Math.imul(aL, bL); - const hl = Math.imul(aH, bL); - const lh = Math.imul(aL, bH); - const hh = Math.imul(aH, bH); - const carry = (ll >>> 16) + (hl & 0xffff) + lh; - const high = (hh + (hl >>> 16) + (carry >>> 16)) | 0; - const low = (carry << 16) | (ll & 0xffff); - return { h: high, l: low }; -} -function mul2(a, b) { - // 2 * a * b (via shifts) - const { h, l } = mul(a, b); - return { h: ((h << 1) | (l >>> 31)) & 4294967295, l: (l << 1) & 4294967295 }; -} -// BlaMka permutation for Argon2 -// A + B + (2 * u32(A) * u32(B)) -function blamka(Ah, Al, Bh, Bl) { - const { h: Ch, l: Cl } = mul2(Al, Bl); - // A + B + (2 * A * B) - const Rll = add3L(Al, Bl, Cl); - return { h: add3H(Rll, Ah, Bh, Ch), l: Rll | 0 }; -} -// Temporary block buffer -const A2_BUF = new Uint32Array(256); // 1024 bytes (matrix 16x16) -function G(a, b, c, d) { - let Al = A2_BUF[2 * a], Ah = A2_BUF[2 * a + 1]; // prettier-ignore - let Bl = A2_BUF[2 * b], Bh = A2_BUF[2 * b + 1]; // prettier-ignore - let Cl = A2_BUF[2 * c], Ch = A2_BUF[2 * c + 1]; // prettier-ignore - let Dl = A2_BUF[2 * d], Dh = A2_BUF[2 * d + 1]; // prettier-ignore - ({ h: Ah, l: Al } = blamka(Ah, Al, Bh, Bl)); - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: rotr32H(Dh, Dl), Dl: rotr32L(Dh, Dl) }); - ({ h: Ch, l: Cl } = blamka(Ch, Cl, Dh, Dl)); - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: rotrSH(Bh, Bl, 24), Bl: rotrSL(Bh, Bl, 24) }); - ({ h: Ah, l: Al } = blamka(Ah, Al, Bh, Bl)); - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: rotrSH(Dh, Dl, 16), Dl: rotrSL(Dh, Dl, 16) }); - ({ h: Ch, l: Cl } = blamka(Ch, Cl, Dh, Dl)); - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: rotrBH(Bh, Bl, 63), Bl: rotrBL(Bh, Bl, 63) }); - (A2_BUF[2 * a] = Al), (A2_BUF[2 * a + 1] = Ah); - (A2_BUF[2 * b] = Bl), (A2_BUF[2 * b + 1] = Bh); - (A2_BUF[2 * c] = Cl), (A2_BUF[2 * c + 1] = Ch); - (A2_BUF[2 * d] = Dl), (A2_BUF[2 * d + 1] = Dh); -} -// prettier-ignore -function P(v00, v01, v02, v03, v04, v05, v06, v07, v08, v09, v10, v11, v12, v13, v14, v15) { - G(v00, v04, v08, v12); - G(v01, v05, v09, v13); - G(v02, v06, v10, v14); - G(v03, v07, v11, v15); - G(v00, v05, v10, v15); - G(v01, v06, v11, v12); - G(v02, v07, v08, v13); - G(v03, v04, v09, v14); -} -function block(x, xPos, yPos, outPos, needXor) { - for (let i = 0; i < 256; i++) - A2_BUF[i] = x[xPos + i] ^ x[yPos + i]; - // columns (8) - for (let i = 0; i < 128; i += 16) { - // prettier-ignore - P(i, i + 1, i + 2, i + 3, i + 4, i + 5, i + 6, i + 7, i + 8, i + 9, i + 10, i + 11, i + 12, i + 13, i + 14, i + 15); - } - // rows (8) - for (let i = 0; i < 16; i += 2) { - // prettier-ignore - P(i, i + 1, i + 16, i + 17, i + 32, i + 33, i + 48, i + 49, i + 64, i + 65, i + 80, i + 81, i + 96, i + 97, i + 112, i + 113); - } - if (needXor) - for (let i = 0; i < 256; i++) - x[outPos + i] ^= A2_BUF[i] ^ x[xPos + i] ^ x[yPos + i]; - else - for (let i = 0; i < 256; i++) - x[outPos + i] = A2_BUF[i] ^ x[xPos + i] ^ x[yPos + i]; - clean(A2_BUF); -} -// Variable-Length Hash Function H' -function Hp(A, dkLen) { - const A8 = u8(A); - const T = new Uint32Array(1); - const T8 = u8(T); - T[0] = dkLen; - // Fast path - if (dkLen <= 64) - return blake2b.create({ dkLen }).update(T8).update(A8).digest(); - const out = new Uint8Array(dkLen); - let V = blake2b.create({}).update(T8).update(A8).digest(); - let pos = 0; - // First block - out.set(V.subarray(0, 32)); - pos += 32; - // Rest blocks - for (; dkLen - pos > 64; pos += 32) { - const Vh = blake2b.create({}).update(V); - Vh.digestInto(V); - Vh.destroy(); - out.set(V.subarray(0, 32), pos); - } - // Last block - out.set(blake2b(V, { dkLen: dkLen - pos }), pos); - clean(V, T); - return u32(out); -} -// Used only inside process block! -function indexAlpha(r, s, laneLen, segmentLen, index, randL, sameLane = false) { - // This is ugly, but close enough to reference implementation. - let area; - if (r === 0) { - if (s === 0) - area = index - 1; - else if (sameLane) - area = s * segmentLen + index - 1; - else - area = s * segmentLen + (index == 0 ? -1 : 0); - } - else if (sameLane) - area = laneLen - segmentLen + index - 1; - else - area = laneLen - segmentLen + (index == 0 ? -1 : 0); - const startPos = r !== 0 && s !== ARGON2_SYNC_POINTS - 1 ? (s + 1) * segmentLen : 0; - const rel = area - 1 - mul(area, mul(randL, randL).h).h; - return (startPos + rel) % laneLen; -} -const maxUint32 = Math.pow(2, 32); -function isU32(num) { - return Number.isSafeInteger(num) && num >= 0 && num < maxUint32; -} -function argon2Opts(opts) { - const merged = { - version: 0x13, - dkLen: 32, - maxmem: maxUint32 - 1, - asyncTick: 10, - }; - for (let [k, v] of Object.entries(opts)) - if (v != null) - merged[k] = v; - const { dkLen, p, m, t, version, onProgress } = merged; - if (!isU32(dkLen) || dkLen < 4) - throw new Error('dkLen should be at least 4 bytes'); - if (!isU32(p) || p < 1 || p >= Math.pow(2, 24)) - throw new Error('p should be 1 <= p < 2^24'); - if (!isU32(m)) - throw new Error('m should be 0 <= m < 2^32'); - if (!isU32(t) || t < 1) - throw new Error('t (iterations) should be 1 <= t < 2^32'); - if (onProgress !== undefined && typeof onProgress !== 'function') - throw new Error('progressCb should be function'); - /* - Memory size m MUST be an integer number of kibibytes from 8*p to 2^(32)-1. The actual number of blocks is m', which is m rounded down to the nearest multiple of 4*p. - */ - if (!isU32(m) || m < 8 * p) - throw new Error('memory should be at least 8*p bytes'); - if (version !== 0x10 && version !== 0x13) - throw new Error('unknown version=' + version); - return merged; -} -function argon2Init(password, salt, type, opts) { - password = kdfInputToBytes(password); - salt = kdfInputToBytes(salt); - abytes(password); - abytes(salt); - if (!isU32(password.length)) - throw new Error('password should be less than 4 GB'); - if (!isU32(salt.length) || salt.length < 8) - throw new Error('salt should be at least 8 bytes and less than 4 GB'); - if (!Object.values(AT).includes(type)) - throw new Error('invalid type'); - let { p, dkLen, m, t, version, key, personalization, maxmem, onProgress, asyncTick } = argon2Opts(opts); - // Validation - key = abytesOrZero(key); - personalization = abytesOrZero(personalization); - // H_0 = H^(64)(LE32(p) || LE32(T) || LE32(m) || LE32(t) || - // LE32(v) || LE32(y) || LE32(length(P)) || P || - // LE32(length(S)) || S || LE32(length(K)) || K || - // LE32(length(X)) || X) - const h = blake2b.create({}); - const BUF = new Uint32Array(1); - const BUF8 = u8(BUF); - for (let item of [p, dkLen, m, t, version, type]) { - BUF[0] = item; - h.update(BUF8); - } - for (let i of [password, salt, key, personalization]) { - BUF[0] = i.length; // BUF is u32 array, this is valid - h.update(BUF8).update(i); - } - const H0 = new Uint32Array(18); - const H0_8 = u8(H0); - h.digestInto(H0_8); - // 256 u32 = 1024 (BLOCK_SIZE), fills A2_BUF on processing - // Params - const lanes = p; - // m' = 4 * p * floor (m / 4p) - const mP = 4 * p * Math.floor(m / (ARGON2_SYNC_POINTS * p)); - //q = m' / p columns - const laneLen = Math.floor(mP / p); - const segmentLen = Math.floor(laneLen / ARGON2_SYNC_POINTS); - const memUsed = mP * 256; - if (!isU32(maxmem) || memUsed > maxmem) - throw new Error('mem should be less than 2**32, got: maxmem=' + maxmem + ', memused=' + memUsed); - const B = new Uint32Array(memUsed); - // Fill first blocks - for (let l = 0; l < p; l++) { - const i = 256 * laneLen * l; - // B[i][0] = H'^(1024)(H_0 || LE32(0) || LE32(i)) - H0[17] = l; - H0[16] = 0; - B.set(Hp(H0, 1024), i); - // B[i][1] = H'^(1024)(H_0 || LE32(1) || LE32(i)) - H0[16] = 1; - B.set(Hp(H0, 1024), i + 256); - } - let perBlock = () => { }; - if (onProgress) { - const totalBlock = t * ARGON2_SYNC_POINTS * p * segmentLen; - // Invoke callback if progress changes from 10.01 to 10.02 - // Allows to draw smooth progress bar on up to 8K screen - const callbackPer = Math.max(Math.floor(totalBlock / 10000), 1); - let blockCnt = 0; - perBlock = () => { - blockCnt++; - if (onProgress && (!(blockCnt % callbackPer) || blockCnt === totalBlock)) - onProgress(blockCnt / totalBlock); - }; - } - clean(BUF, H0); - return { type, mP, p, t, version, B, laneLen, lanes, segmentLen, dkLen, perBlock, asyncTick }; -} -function argon2Output(B, p, laneLen, dkLen) { - const B_final = new Uint32Array(256); - for (let l = 0; l < p; l++) - for (let j = 0; j < 256; j++) - B_final[j] ^= B[256 * (laneLen * l + laneLen - 1) + j]; - const res = u8(Hp(B_final, dkLen)); - clean(B_final); - return res; -} -function processBlock(B, address, l, r, s, index, laneLen, segmentLen, lanes, offset, prev, dataIndependent, needXor) { - if (offset % laneLen) - prev = offset - 1; - let randL, randH; - if (dataIndependent) { - let i128 = index % 128; - if (i128 === 0) { - address[256 + 12]++; - block(address, 256, 2 * 256, 0, false); - block(address, 0, 2 * 256, 0, false); - } - randL = address[2 * i128]; - randH = address[2 * i128 + 1]; - } - else { - const T = 256 * prev; - randL = B[T]; - randH = B[T + 1]; - } - // address block - const refLane = r === 0 && s === 0 ? l : randH % lanes; - const refPos = indexAlpha(r, s, laneLen, segmentLen, index, randL, refLane == l); - const refBlock = laneLen * refLane + refPos; - // B[i][j] = G(B[i][j-1], B[l][z]) - block(B, 256 * prev, 256 * refBlock, offset * 256, needXor); -} -function argon2(type, password, salt, opts) { - const { mP, p, t, version, B, laneLen, lanes, segmentLen, dkLen, perBlock } = argon2Init(password, salt, type, opts); - // Pre-loop setup - // [address, input, zero_block] format so we can pass single U32 to block function - const address = new Uint32Array(3 * 256); - address[256 + 6] = mP; - address[256 + 8] = t; - address[256 + 10] = type; - for (let r = 0; r < t; r++) { - const needXor = r !== 0 && version === 0x13; - address[256 + 0] = r; - for (let s = 0; s < ARGON2_SYNC_POINTS; s++) { - address[256 + 4] = s; - const dataIndependent = type == AT.Argon2i || (type == AT.Argon2id && r === 0 && s < 2); - for (let l = 0; l < p; l++) { - address[256 + 2] = l; - address[256 + 12] = 0; - let startPos = 0; - if (r === 0 && s === 0) { - startPos = 2; - if (dataIndependent) { - address[256 + 12]++; - block(address, 256, 2 * 256, 0, false); - block(address, 0, 2 * 256, 0, false); - } - } - // current block postion - let offset = l * laneLen + s * segmentLen + startPos; - // previous block position - let prev = offset % laneLen ? offset - 1 : offset + laneLen - 1; - for (let index = startPos; index < segmentLen; index++, offset++, prev++) { - perBlock(); - processBlock(B, address, l, r, s, index, laneLen, segmentLen, lanes, offset, prev, dataIndependent, needXor); - } - } - } - } - clean(address); - return argon2Output(B, p, laneLen, dkLen); -} -/** argon2d GPU-resistant version. */ -export const argon2d = (password, salt, opts) => argon2(AT.Argond2d, password, salt, opts); -/** argon2i side-channel-resistant version. */ -export const argon2i = (password, salt, opts) => argon2(AT.Argon2i, password, salt, opts); -/** argon2id, combining i+d, the most popular version from RFC 9106 */ -export const argon2id = (password, salt, opts) => argon2(AT.Argon2id, password, salt, opts); -async function argon2Async(type, password, salt, opts) { - const { mP, p, t, version, B, laneLen, lanes, segmentLen, dkLen, perBlock, asyncTick } = argon2Init(password, salt, type, opts); - // Pre-loop setup - // [address, input, zero_block] format so we can pass single U32 to block function - const address = new Uint32Array(3 * 256); - address[256 + 6] = mP; - address[256 + 8] = t; - address[256 + 10] = type; - let ts = Date.now(); - for (let r = 0; r < t; r++) { - const needXor = r !== 0 && version === 0x13; - address[256 + 0] = r; - for (let s = 0; s < ARGON2_SYNC_POINTS; s++) { - address[256 + 4] = s; - const dataIndependent = type == AT.Argon2i || (type == AT.Argon2id && r === 0 && s < 2); - for (let l = 0; l < p; l++) { - address[256 + 2] = l; - address[256 + 12] = 0; - let startPos = 0; - if (r === 0 && s === 0) { - startPos = 2; - if (dataIndependent) { - address[256 + 12]++; - block(address, 256, 2 * 256, 0, false); - block(address, 0, 2 * 256, 0, false); - } - } - // current block postion - let offset = l * laneLen + s * segmentLen + startPos; - // previous block position - let prev = offset % laneLen ? offset - 1 : offset + laneLen - 1; - for (let index = startPos; index < segmentLen; index++, offset++, prev++) { - perBlock(); - processBlock(B, address, l, r, s, index, laneLen, segmentLen, lanes, offset, prev, dataIndependent, needXor); - // Date.now() is not monotonic, so in case if clock goes backwards we return return control too - const diff = Date.now() - ts; - if (!(diff >= 0 && diff < asyncTick)) { - await nextTick(); - ts += diff; - } - } - } - } - } - clean(address); - return argon2Output(B, p, laneLen, dkLen); -} -/** argon2d async GPU-resistant version. */ -export const argon2dAsync = (password, salt, opts) => argon2Async(AT.Argond2d, password, salt, opts); -/** argon2i async side-channel-resistant version. */ -export const argon2iAsync = (password, salt, opts) => argon2Async(AT.Argon2i, password, salt, opts); -/** argon2id async, combining i+d, the most popular version from RFC 9106 */ -export const argon2idAsync = (password, salt, opts) => argon2Async(AT.Argon2id, password, salt, opts); -//# sourceMappingURL=argon2.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/argon2.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/argon2.js.map deleted file mode 100644 index 40168569..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/argon2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"argon2.js","sourceRoot":"","sources":["../src/argon2.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC3F,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,EAAiB,MAAM,YAAY,CAAC;AAE9F,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAW,CAAC;AAG7D,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAC7B,MAAM,YAAY,GAAG,CAAC,GAAc,EAAE,EAAE;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AAC,GAAG,EAAE,GAAG,EAAE,CAAC;oBAC7B,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,IAAI,GAAG,SAAS,CAAC,EAAE,CAAC;wBACrC,MAAM,QAAQ,EAAE,CAAC;wBACjB,EAAE,IAAI,IAAI,CAAC;oBACb,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IACD,KAAK,CAAC,OAAO,CAAC,CAAC;IACf,OAAO,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AAC5C,CAAC;AAED,2CAA2C;AAC3C,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,QAAkB,EAClB,IAAc,EACd,IAAe,EACM,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACzE,oDAAoD;AACpD,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,QAAkB,EAClB,IAAc,EACd,IAAe,EACM,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACxE,4EAA4E;AAC5E,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,QAAkB,EAClB,IAAc,EACd,IAAe,EACM,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake1.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake1.d.ts deleted file mode 100644 index 62d576f2..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake1.d.ts +++ /dev/null @@ -1,106 +0,0 @@ -import { Hash, type CHashO, type Input } from './utils.ts'; -/** Blake1 options. Basically just "salt" */ -export type BlakeOpts = { - salt?: Uint8Array; -}; -declare abstract class BLAKE1> extends Hash { - protected finished: boolean; - protected length: number; - protected pos: number; - protected destroyed: boolean; - protected buffer: Uint8Array; - protected view: DataView; - protected salt: Uint32Array; - abstract compress(view: DataView, offset: number, withLength?: boolean): void; - protected abstract get(): number[]; - protected abstract set(...args: number[]): void; - readonly blockLen: number; - readonly outputLen: number; - private lengthFlag; - private counterLen; - protected constants: Uint32Array; - constructor(blockLen: number, outputLen: number, lengthFlag: number, counterLen: number, saltLen: number, constants: Uint32Array, opts?: BlakeOpts); - update(data: Input): this; - destroy(): void; - _cloneInto(to?: T): T; - clone(): T; - digestInto(out: Uint8Array): void; - digest(): Uint8Array; -} -declare class Blake1_32 extends BLAKE1 { - private v0; - private v1; - private v2; - private v3; - private v4; - private v5; - private v6; - private v7; - constructor(outputLen: number, IV: Uint32Array, lengthFlag: number, opts?: BlakeOpts); - protected get(): [number, number, number, number, number, number, number, number]; - protected set(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number): void; - destroy(): void; - compress(view: DataView, offset: number, withLength?: boolean): void; -} -declare class Blake1_64 extends BLAKE1 { - private v0l; - private v0h; - private v1l; - private v1h; - private v2l; - private v2h; - private v3l; - private v3h; - private v4l; - private v4h; - private v5l; - private v5h; - private v6l; - private v6h; - private v7l; - private v7h; - constructor(outputLen: number, IV: Uint32Array, lengthFlag: number, opts?: BlakeOpts); - protected get(): [ - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number - ]; - protected set(v0l: number, v0h: number, v1l: number, v1h: number, v2l: number, v2h: number, v3l: number, v3h: number, v4l: number, v4h: number, v5l: number, v5h: number, v6l: number, v6h: number, v7l: number, v7h: number): void; - destroy(): void; - compress(view: DataView, offset: number, withLength?: boolean): void; -} -export declare class BLAKE224 extends Blake1_32 { - constructor(opts?: BlakeOpts); -} -export declare class BLAKE256 extends Blake1_32 { - constructor(opts?: BlakeOpts); -} -export declare class BLAKE384 extends Blake1_64 { - constructor(opts?: BlakeOpts); -} -export declare class BLAKE512 extends Blake1_64 { - constructor(opts?: BlakeOpts); -} -/** blake1-224 hash function */ -export declare const blake224: CHashO; -/** blake1-256 hash function */ -export declare const blake256: CHashO; -/** blake1-384 hash function */ -export declare const blake384: CHashO; -/** blake1-512 hash function */ -export declare const blake512: CHashO; -export {}; -//# sourceMappingURL=blake1.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake1.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake1.d.ts.map deleted file mode 100644 index 93d9bcf8..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake1.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blake1.d.ts","sourceRoot":"","sources":["../src/blake1.ts"],"names":[],"mappings":"AA4BA,OAAO,EAGO,IAAI,EAChB,KAAK,MAAM,EAAE,KAAK,KAAK,EACxB,MAAM,YAAY,CAAC;AAEpB,4CAA4C;AAC5C,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB,CAAC;AAKF,uBAAe,MAAM,CAAC,CAAC,SAAS,MAAM,CAAC,CAAC,CAAC,CAAE,SAAQ,IAAI,CAAC,CAAC,CAAC;IACxD,SAAS,CAAC,QAAQ,UAAS;IAC3B,SAAS,CAAC,MAAM,SAAK;IACrB,SAAS,CAAC,GAAG,SAAK;IAClB,SAAS,CAAC,SAAS,UAAS;IAE5B,SAAS,CAAC,MAAM,EAAE,UAAU,CAAC;IAC7B,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC;IACzB,SAAS,CAAC,IAAI,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,IAAI;IAC7E,SAAS,CAAC,QAAQ,CAAC,GAAG,IAAI,MAAM,EAAE;IAClC,SAAS,CAAC,QAAQ,CAAC,GA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AE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAClD,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAClD,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAClD,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GACjD,IAAI;IAkBP,OAAO,IAAI,IAAI;IAIf,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,UAAO,GAAG,IAAI;CAiDlE;AAED,qBAAa,QAAS,SAAQ,SAAS;gBACzB,IAAI,GAAE,SAAc;CAGjC;AACD,qBAAa,QAAS,SAAQ,SAAS;gBACzB,IAAI,GAAE,SAAc;CAGjC;AACD,qBAAa,QAAS,SAAQ,SAAS;gBACzB,IAAI,GAAE,SAAc;CAGjC;AACD,qBAAa,QAAS,SAAQ,SAAS;gBACzB,IAAI,GAAE,SAAc;CAGjC;AACD,+BAA+B;AAC/B,eAAO,MAAM,QAAQ,EAAE,MAEtB,CAAC;AACF,+BAA+B;AAC/B,eAAO,MAAM,QAAQ,EAAE,MAEtB,CAAC;AACF,+BAA+B;AAC/B,eAAO,MAAM,QAAQ,EAAE,MAEtB,CAAC;AACF,+BAA+B;AAC/B,eAAO,MAAM,QAAQ,EAAE,MAEtB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake1.js b/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake1.js deleted file mode 100644 index 549d49dd..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake1.js +++ /dev/null @@ -1,452 +0,0 @@ -/** - * Blake1 legacy hash function, one of SHA3 proposals. - * Rarely used. Check out blake2 or blake3 instead. - * https://www.aumasson.jp/blake/blake.pdf - * - * In the best case, there are 0 allocations. - * - * Differences from blake2: - * - * - BE instead of LE - * - Paddings, similar to MD5, RIPEMD, SHA1, SHA2, but: - * - length flag is located before actual length - * - padding block is compressed differently (no lengths) - * Instead of msg[sigma[k]], we have `msg[sigma[k]] ^ constants[sigma[k-1]]` - * (-1 for g1, g2 without -1) - * - Salt is XOR-ed into constants instead of state - * - Salt is XOR-ed with output in `compress` - * - Additional rows (+64 bytes) in SIGMA for new rounds - * - Different round count: - * - 14 / 10 rounds in blake256 / blake2s - * - 16 / 12 rounds in blake512 / blake2b - * - blake512: G1b: rotr 24 -> 25, G2b: rotr 63 -> 11 - * @module - */ -import { BSIGMA, G1s, G2s } from "./_blake.js"; -import { setBigUint64, SHA224_IV, SHA256_IV, SHA384_IV, SHA512_IV } from "./_md.js"; -import * as u64 from "./_u64.js"; -// prettier-ignore -import { abytes, aexists, aoutput, clean, createOptHasher, createView, Hash, toBytes, } from "./utils.js"; -// Empty zero-filled salt -const EMPTY_SALT = /* @__PURE__ */ new Uint32Array(8); -class BLAKE1 extends Hash { - constructor(blockLen, outputLen, lengthFlag, counterLen, saltLen, constants, opts = {}) { - super(); - this.finished = false; - this.length = 0; - this.pos = 0; - this.destroyed = false; - const { salt } = opts; - this.blockLen = blockLen; - this.outputLen = outputLen; - this.lengthFlag = lengthFlag; - this.counterLen = counterLen; - this.buffer = new Uint8Array(blockLen); - this.view = createView(this.buffer); - if (salt) { - let slt = salt; - slt = toBytes(slt); - abytes(slt); - if (slt.length !== 4 * saltLen) - throw new Error('wrong salt length'); - const salt32 = (this.salt = new Uint32Array(saltLen)); - const sv = createView(slt); - this.constants = constants.slice(); - for (let i = 0, offset = 0; i < salt32.length; i++, offset += 4) { - salt32[i] = sv.getUint32(offset, false); - this.constants[i] ^= salt32[i]; - } - } - else { - this.salt = EMPTY_SALT; - this.constants = constants; - } - } - update(data) { - aexists(this); - data = toBytes(data); - abytes(data); - // From _md, but update length before each compress - const { view, buffer, blockLen } = this; - const len = data.length; - let dataView; - for (let pos = 0; pos < len;) { - const take = Math.min(blockLen - this.pos, len - pos); - // Fast path: we have at least one block in input, cast it to view and process - if (take === blockLen) { - if (!dataView) - dataView = createView(data); - for (; blockLen <= len - pos; pos += blockLen) { - this.length += blockLen; - this.compress(dataView, pos); - } - continue; - } - buffer.set(data.subarray(pos, pos + take), this.pos); - this.pos += take; - pos += take; - if (this.pos === blockLen) { - this.length += blockLen; - this.compress(view, 0, true); - this.pos = 0; - } - } - return this; - } - destroy() { - this.destroyed = true; - if (this.salt !== EMPTY_SALT) { - clean(this.salt, this.constants); - } - } - _cloneInto(to) { - to || (to = new this.constructor()); - to.set(...this.get()); - const { buffer, length, finished, destroyed, constants, salt, pos } = this; - to.buffer.set(buffer); - to.constants = constants.slice(); - to.destroyed = destroyed; - to.finished = finished; - to.length = length; - to.pos = pos; - to.salt = salt.slice(); - return to; - } - clone() { - return this._cloneInto(); - } - digestInto(out) { - aexists(this); - aoutput(out, this); - this.finished = true; - // Padding - const { buffer, blockLen, counterLen, lengthFlag, view } = this; - clean(buffer.subarray(this.pos)); // clean buf - const counter = BigInt((this.length + this.pos) * 8); - const counterPos = blockLen - counterLen - 1; - buffer[this.pos] |= 128; // End block flag - this.length += this.pos; // add unwritten length - // Not enough in buffer for length: write what we have. - if (this.pos > counterPos) { - this.compress(view, 0); - clean(buffer); - this.pos = 0; - } - // Difference with md: here we have lengthFlag! - buffer[counterPos] |= lengthFlag; // Length flag - // We always set 8 byte length flag. Because length will overflow significantly sooner. - setBigUint64(view, blockLen - 8, counter, false); - this.compress(view, 0, this.pos !== 0); // don't add length if length is not empty block? - // Write output - clean(buffer); - const v = createView(out); - const state = this.get(); - for (let i = 0; i < this.outputLen / 4; ++i) - v.setUint32(i * 4, state[i]); - } - digest() { - const { buffer, outputLen } = this; - this.digestInto(buffer); - const res = buffer.slice(0, outputLen); - this.destroy(); - return res; - } -} -// Constants -const B64C = /* @__PURE__ */ Uint32Array.from([ - 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, - 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, - 0x9216d5d9, 0x8979fb1b, 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96, - 0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, 0x636920d8, 0x71574e69, -]); -// first half of C512 -const B32C = B64C.slice(0, 16); -const B256_IV = SHA256_IV.slice(); -const B224_IV = SHA224_IV.slice(); -const B384_IV = SHA384_IV.slice(); -const B512_IV = SHA512_IV.slice(); -function generateTBL256() { - const TBL = []; - for (let i = 0, j = 0; i < 14; i++, j += 16) { - for (let offset = 1; offset < 16; offset += 2) { - TBL.push(B32C[BSIGMA[j + offset]]); - TBL.push(B32C[BSIGMA[j + offset - 1]]); - } - } - return new Uint32Array(TBL); -} -const TBL256 = /* @__PURE__ */ generateTBL256(); // C256[SIGMA[X]] precompute -// Reusable temporary buffer -const BLAKE256_W = /* @__PURE__ */ new Uint32Array(16); -class Blake1_32 extends BLAKE1 { - constructor(outputLen, IV, lengthFlag, opts = {}) { - super(64, outputLen, lengthFlag, 8, 4, B32C, opts); - this.v0 = IV[0] | 0; - this.v1 = IV[1] | 0; - this.v2 = IV[2] | 0; - this.v3 = IV[3] | 0; - this.v4 = IV[4] | 0; - this.v5 = IV[5] | 0; - this.v6 = IV[6] | 0; - this.v7 = IV[7] | 0; - } - get() { - const { v0, v1, v2, v3, v4, v5, v6, v7 } = this; - return [v0, v1, v2, v3, v4, v5, v6, v7]; - } - // prettier-ignore - set(v0, v1, v2, v3, v4, v5, v6, v7) { - this.v0 = v0 | 0; - this.v1 = v1 | 0; - this.v2 = v2 | 0; - this.v3 = v3 | 0; - this.v4 = v4 | 0; - this.v5 = v5 | 0; - this.v6 = v6 | 0; - this.v7 = v7 | 0; - } - destroy() { - super.destroy(); - this.set(0, 0, 0, 0, 0, 0, 0, 0); - } - compress(view, offset, withLength = true) { - for (let i = 0; i < 16; i++, offset += 4) - BLAKE256_W[i] = view.getUint32(offset, false); - // NOTE: we cannot re-use compress from blake2s, since there is additional xor over u256[SIGMA[e]] - let v00 = this.v0 | 0; - let v01 = this.v1 | 0; - let v02 = this.v2 | 0; - let v03 = this.v3 | 0; - let v04 = this.v4 | 0; - let v05 = this.v5 | 0; - let v06 = this.v6 | 0; - let v07 = this.v7 | 0; - let v08 = this.constants[0] | 0; - let v09 = this.constants[1] | 0; - let v10 = this.constants[2] | 0; - let v11 = this.constants[3] | 0; - const { h, l } = u64.fromBig(BigInt(withLength ? this.length * 8 : 0)); - let v12 = (this.constants[4] ^ l) >>> 0; - let v13 = (this.constants[5] ^ l) >>> 0; - let v14 = (this.constants[6] ^ h) >>> 0; - let v15 = (this.constants[7] ^ h) >>> 0; - // prettier-ignore - for (let i = 0, k = 0, j = 0; i < 14; i++) { - ({ a: v00, b: v04, c: v08, d: v12 } = G1s(v00, v04, v08, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v00, b: v04, c: v08, d: v12 } = G2s(v00, v04, v08, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v01, b: v05, c: v09, d: v13 } = G1s(v01, v05, v09, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v01, b: v05, c: v09, d: v13 } = G2s(v01, v05, v09, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v02, b: v06, c: v10, d: v14 } = G1s(v02, v06, v10, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v02, b: v06, c: v10, d: v14 } = G2s(v02, v06, v10, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v03, b: v07, c: v11, d: v15 } = G1s(v03, v07, v11, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v03, b: v07, c: v11, d: v15 } = G2s(v03, v07, v11, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v00, b: v05, c: v10, d: v15 } = G1s(v00, v05, v10, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v00, b: v05, c: v10, d: v15 } = G2s(v00, v05, v10, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v01, b: v06, c: v11, d: v12 } = G1s(v01, v06, v11, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v01, b: v06, c: v11, d: v12 } = G2s(v01, v06, v11, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v02, b: v07, c: v08, d: v13 } = G1s(v02, v07, v08, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v02, b: v07, c: v08, d: v13 } = G2s(v02, v07, v08, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v03, b: v04, c: v09, d: v14 } = G1s(v03, v04, v09, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v03, b: v04, c: v09, d: v14 } = G2s(v03, v04, v09, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - } - this.v0 = (this.v0 ^ v00 ^ v08 ^ this.salt[0]) >>> 0; - this.v1 = (this.v1 ^ v01 ^ v09 ^ this.salt[1]) >>> 0; - this.v2 = (this.v2 ^ v02 ^ v10 ^ this.salt[2]) >>> 0; - this.v3 = (this.v3 ^ v03 ^ v11 ^ this.salt[3]) >>> 0; - this.v4 = (this.v4 ^ v04 ^ v12 ^ this.salt[0]) >>> 0; - this.v5 = (this.v5 ^ v05 ^ v13 ^ this.salt[1]) >>> 0; - this.v6 = (this.v6 ^ v06 ^ v14 ^ this.salt[2]) >>> 0; - this.v7 = (this.v7 ^ v07 ^ v15 ^ this.salt[3]) >>> 0; - clean(BLAKE256_W); - } -} -const BBUF = /* @__PURE__ */ new Uint32Array(32); -const BLAKE512_W = /* @__PURE__ */ new Uint32Array(32); -function generateTBL512() { - const TBL = []; - for (let r = 0, k = 0; r < 16; r++, k += 16) { - for (let offset = 1; offset < 16; offset += 2) { - TBL.push(B64C[BSIGMA[k + offset] * 2 + 0]); - TBL.push(B64C[BSIGMA[k + offset] * 2 + 1]); - TBL.push(B64C[BSIGMA[k + offset - 1] * 2 + 0]); - TBL.push(B64C[BSIGMA[k + offset - 1] * 2 + 1]); - } - } - return new Uint32Array(TBL); -} -const TBL512 = /* @__PURE__ */ generateTBL512(); // C512[SIGMA[X]] precompute -// Mixing function G splitted in two halfs -function G1b(a, b, c, d, msg, k) { - const Xpos = 2 * BSIGMA[k]; - const Xl = msg[Xpos + 1] ^ TBL512[k * 2 + 1], Xh = msg[Xpos] ^ TBL512[k * 2]; // prettier-ignore - let Al = BBUF[2 * a + 1], Ah = BBUF[2 * a]; // prettier-ignore - let Bl = BBUF[2 * b + 1], Bh = BBUF[2 * b]; // prettier-ignore - let Cl = BBUF[2 * c + 1], Ch = BBUF[2 * c]; // prettier-ignore - let Dl = BBUF[2 * d + 1], Dh = BBUF[2 * d]; // prettier-ignore - // v[a] = (v[a] + v[b] + x) | 0; - let ll = u64.add3L(Al, Bl, Xl); - Ah = u64.add3H(ll, Ah, Bh, Xh) >>> 0; - Al = (ll | 0) >>> 0; - // v[d] = rotr(v[d] ^ v[a], 32) - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: u64.rotr32H(Dh, Dl), Dl: u64.rotr32L(Dh, Dl) }); - // v[c] = (v[c] + v[d]) | 0; - ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); - // v[b] = rotr(v[b] ^ v[c], 25) - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: u64.rotrSH(Bh, Bl, 25), Bl: u64.rotrSL(Bh, Bl, 25) }); - (BBUF[2 * a + 1] = Al), (BBUF[2 * a] = Ah); - (BBUF[2 * b + 1] = Bl), (BBUF[2 * b] = Bh); - (BBUF[2 * c + 1] = Cl), (BBUF[2 * c] = Ch); - (BBUF[2 * d + 1] = Dl), (BBUF[2 * d] = Dh); -} -function G2b(a, b, c, d, msg, k) { - const Xpos = 2 * BSIGMA[k]; - const Xl = msg[Xpos + 1] ^ TBL512[k * 2 + 1], Xh = msg[Xpos] ^ TBL512[k * 2]; // prettier-ignore - let Al = BBUF[2 * a + 1], Ah = BBUF[2 * a]; // prettier-ignore - let Bl = BBUF[2 * b + 1], Bh = BBUF[2 * b]; // prettier-ignore - let Cl = BBUF[2 * c + 1], Ch = BBUF[2 * c]; // prettier-ignore - let Dl = BBUF[2 * d + 1], Dh = BBUF[2 * d]; // prettier-ignore - // v[a] = (v[a] + v[b] + x) | 0; - let ll = u64.add3L(Al, Bl, Xl); - Ah = u64.add3H(ll, Ah, Bh, Xh); - Al = ll | 0; - // v[d] = rotr(v[d] ^ v[a], 16) - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: u64.rotrSH(Dh, Dl, 16), Dl: u64.rotrSL(Dh, Dl, 16) }); - // v[c] = (v[c] + v[d]) | 0; - ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); - // v[b] = rotr(v[b] ^ v[c], 11) - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: u64.rotrSH(Bh, Bl, 11), Bl: u64.rotrSL(Bh, Bl, 11) }); - (BBUF[2 * a + 1] = Al), (BBUF[2 * a] = Ah); - (BBUF[2 * b + 1] = Bl), (BBUF[2 * b] = Bh); - (BBUF[2 * c + 1] = Cl), (BBUF[2 * c] = Ch); - (BBUF[2 * d + 1] = Dl), (BBUF[2 * d] = Dh); -} -class Blake1_64 extends BLAKE1 { - constructor(outputLen, IV, lengthFlag, opts = {}) { - super(128, outputLen, lengthFlag, 16, 8, B64C, opts); - this.v0l = IV[0] | 0; - this.v0h = IV[1] | 0; - this.v1l = IV[2] | 0; - this.v1h = IV[3] | 0; - this.v2l = IV[4] | 0; - this.v2h = IV[5] | 0; - this.v3l = IV[6] | 0; - this.v3h = IV[7] | 0; - this.v4l = IV[8] | 0; - this.v4h = IV[9] | 0; - this.v5l = IV[10] | 0; - this.v5h = IV[11] | 0; - this.v6l = IV[12] | 0; - this.v6h = IV[13] | 0; - this.v7l = IV[14] | 0; - this.v7h = IV[15] | 0; - } - // prettier-ignore - get() { - let { v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h } = this; - return [v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h]; - } - // prettier-ignore - set(v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h) { - this.v0l = v0l | 0; - this.v0h = v0h | 0; - this.v1l = v1l | 0; - this.v1h = v1h | 0; - this.v2l = v2l | 0; - this.v2h = v2h | 0; - this.v3l = v3l | 0; - this.v3h = v3h | 0; - this.v4l = v4l | 0; - this.v4h = v4h | 0; - this.v5l = v5l | 0; - this.v5h = v5h | 0; - this.v6l = v6l | 0; - this.v6h = v6h | 0; - this.v7l = v7l | 0; - this.v7h = v7h | 0; - } - destroy() { - super.destroy(); - this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - } - compress(view, offset, withLength = true) { - for (let i = 0; i < 32; i++, offset += 4) - BLAKE512_W[i] = view.getUint32(offset, false); - this.get().forEach((v, i) => (BBUF[i] = v)); // First half from state. - BBUF.set(this.constants.subarray(0, 16), 16); - if (withLength) { - const { h, l } = u64.fromBig(BigInt(this.length * 8)); - BBUF[24] = (BBUF[24] ^ h) >>> 0; - BBUF[25] = (BBUF[25] ^ l) >>> 0; - BBUF[26] = (BBUF[26] ^ h) >>> 0; - BBUF[27] = (BBUF[27] ^ l) >>> 0; - } - for (let i = 0, k = 0; i < 16; i++) { - G1b(0, 4, 8, 12, BLAKE512_W, k++); - G2b(0, 4, 8, 12, BLAKE512_W, k++); - G1b(1, 5, 9, 13, BLAKE512_W, k++); - G2b(1, 5, 9, 13, BLAKE512_W, k++); - G1b(2, 6, 10, 14, BLAKE512_W, k++); - G2b(2, 6, 10, 14, BLAKE512_W, k++); - G1b(3, 7, 11, 15, BLAKE512_W, k++); - G2b(3, 7, 11, 15, BLAKE512_W, k++); - G1b(0, 5, 10, 15, BLAKE512_W, k++); - G2b(0, 5, 10, 15, BLAKE512_W, k++); - G1b(1, 6, 11, 12, BLAKE512_W, k++); - G2b(1, 6, 11, 12, BLAKE512_W, k++); - G1b(2, 7, 8, 13, BLAKE512_W, k++); - G2b(2, 7, 8, 13, BLAKE512_W, k++); - G1b(3, 4, 9, 14, BLAKE512_W, k++); - G2b(3, 4, 9, 14, BLAKE512_W, k++); - } - this.v0l ^= BBUF[0] ^ BBUF[16] ^ this.salt[0]; - this.v0h ^= BBUF[1] ^ BBUF[17] ^ this.salt[1]; - this.v1l ^= BBUF[2] ^ BBUF[18] ^ this.salt[2]; - this.v1h ^= BBUF[3] ^ BBUF[19] ^ this.salt[3]; - this.v2l ^= BBUF[4] ^ BBUF[20] ^ this.salt[4]; - this.v2h ^= BBUF[5] ^ BBUF[21] ^ this.salt[5]; - this.v3l ^= BBUF[6] ^ BBUF[22] ^ this.salt[6]; - this.v3h ^= BBUF[7] ^ BBUF[23] ^ this.salt[7]; - this.v4l ^= BBUF[8] ^ BBUF[24] ^ this.salt[0]; - this.v4h ^= BBUF[9] ^ BBUF[25] ^ this.salt[1]; - this.v5l ^= BBUF[10] ^ BBUF[26] ^ this.salt[2]; - this.v5h ^= BBUF[11] ^ BBUF[27] ^ this.salt[3]; - this.v6l ^= BBUF[12] ^ BBUF[28] ^ this.salt[4]; - this.v6h ^= BBUF[13] ^ BBUF[29] ^ this.salt[5]; - this.v7l ^= BBUF[14] ^ BBUF[30] ^ this.salt[6]; - this.v7h ^= BBUF[15] ^ BBUF[31] ^ this.salt[7]; - clean(BBUF, BLAKE512_W); - } -} -export class BLAKE224 extends Blake1_32 { - constructor(opts = {}) { - super(28, B224_IV, 0, opts); - } -} -export class BLAKE256 extends Blake1_32 { - constructor(opts = {}) { - super(32, B256_IV, 1, opts); - } -} -export class BLAKE384 extends Blake1_64 { - constructor(opts = {}) { - super(48, B384_IV, 0, opts); - } -} -export class BLAKE512 extends Blake1_64 { - constructor(opts = {}) { - super(64, B512_IV, 1, opts); - } -} -/** blake1-224 hash function */ -export const blake224 = /* @__PURE__ */ createOptHasher((opts) => new BLAKE224(opts)); -/** blake1-256 hash function */ -export const blake256 = /* @__PURE__ */ createOptHasher((opts) => new BLAKE256(opts)); -/** blake1-384 hash function */ -export const blake384 = /* @__PURE__ */ createOptHasher((opts) => new BLAKE384(opts)); -/** blake1-512 hash function */ -export const blake512 = /* @__PURE__ */ createOptHasher((opts) => new BLAKE512(opts)); -//# sourceMappingURL=blake1.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake1.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake1.js.map deleted file mode 100644 index 65325b8c..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blake1.js","sourceRoot":"","sources":["../src/blake1.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACpF,OAAO,KAAK,GA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W,EAAE,IAAI,CAAC,CAAC;IACxC,CAAC;CACF;AACD,MAAM,OAAO,QAAS,SAAQ,SAAS;IACrC,YAAY,OAAkB,EAAE;QAC9B,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,CAAW,EAAE,IAAI,CAAC,CAAC;IACxC,CAAC;CACF;AACD,MAAM,OAAO,QAAS,SAAQ,SAAS;IACrC,YAAY,OAAkB,EAAE;QAC9B,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,CAAW,EAAE,IAAI,CAAC,CAAC;IACxC,CAAC;CACF;AACD,+BAA+B;AAC/B,MAAM,CAAC,MAAM,QAAQ,GAAW,eAAe,CAAC,eAAe,CAC7D,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,CAC7B,CAAC;AACF,+BAA+B;AAC/B,MAAM,CAAC,MAAM,QAAQ,GAAW,eAAe,CAAC,eAAe,CAC7D,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,CAC7B,CAAC;AACF,+BAA+B;AAC/B,MAAM,CAAC,MAAM,QAAQ,GAAW,eAAe,CAAC,eAAe,CAC7D,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,CAC7B,CAAC;AACF,+BAA+B;AAC/B,MAAM,CAAC,MAAM,QAAQ,GAAW,eAAe,CAAC,eAAe,CAC7D,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,CAC7B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2.d.ts deleted file mode 100644 index ea6ae419..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2.d.ts +++ /dev/null @@ -1,116 +0,0 @@ -import { Hash, type CHashO, type Input } from './utils.ts'; -/** Blake hash options. dkLen is output length. key is used in MAC mode. salt is used in KDF mode. */ -export type Blake2Opts = { - dkLen?: number; - key?: Input; - salt?: Input; - personalization?: Input; -}; -/** Class, from which others are subclassed. */ -export declare abstract class BLAKE2> extends Hash { - protected abstract compress(msg: Uint32Array, offset: number, isLast: boolean): void; - protected abstract get(): number[]; - protected abstract set(...args: number[]): void; - abstract destroy(): void; - protected buffer: Uint8Array; - protected buffer32: Uint32Array; - protected finished: boolean; - protected destroyed: boolean; - protected length: number; - protected pos: number; - readonly blockLen: number; - readonly outputLen: number; - constructor(blockLen: number, outputLen: number); - update(data: Input): this; - digestInto(out: Uint8Array): void; - digest(): Uint8Array; - _cloneInto(to?: T): T; - clone(): T; -} -export declare class BLAKE2b extends BLAKE2 { - private v0l; - private v0h; - private v1l; - private v1h; - private v2l; - private v2h; - private v3l; - private v3h; - private v4l; - private v4h; - private v5l; - private v5h; - private v6l; - private v6h; - private v7l; - private v7h; - constructor(opts?: Blake2Opts); - protected get(): [ - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number - ]; - protected set(v0l: number, v0h: number, v1l: number, v1h: number, v2l: number, v2h: number, v3l: number, v3h: number, v4l: number, v4h: number, v5l: number, v5h: number, v6l: number, v6h: number, v7l: number, v7h: number): void; - protected compress(msg: Uint32Array, offset: number, isLast: boolean): void; - destroy(): void; -} -/** - * Blake2b hash function. 64-bit. 1.5x slower than blake2s in JS. - * @param msg - message that would be hashed - * @param opts - dkLen output length, key for MAC mode, salt, personalization - */ -export declare const blake2b: CHashO; -export type Num16 = { - v0: number; - v1: number; - v2: number; - v3: number; - v4: number; - v5: number; - v6: number; - v7: number; - v8: number; - v9: number; - v10: number; - v11: number; - v12: number; - v13: number; - v14: number; - v15: number; -}; -export declare function compress(s: Uint8Array, offset: number, msg: Uint32Array, rounds: number, v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, v9: number, v10: number, v11: number, v12: number, v13: number, v14: number, v15: number): Num16; -export declare class BLAKE2s extends BLAKE2 { - private v0; - private v1; - private v2; - private v3; - private v4; - private v5; - private v6; - private v7; - constructor(opts?: Blake2Opts); - protected get(): [number, number, number, number, number, number, number, number]; - protected set(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number): void; - protected compress(msg: Uint32Array, offset: number, isLast: boolean): void; - destroy(): void; -} -/** - * Blake2s hash function. Focuses on 8-bit to 32-bit platforms. 1.5x faster than blake2b in JS. - * @param msg - message that would be hashed - * @param opts - dkLen output length, key for MAC mode, salt, personalization - */ -export declare const blake2s: CHashO; -//# sourceMappingURL=blake2.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2.d.ts.map deleted file mode 100644 index 2d531225..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blake2.d.ts","sourceRoot":"","sources":["../src/blake2.ts"],"names":[],"mappings":"AASA,OAAO,EAEmB,IAAI,EAC5B,KAAK,MAAM,EAAE,KAAK,KAAK,EACxB,MAAM,YAAY,CAAC;AAEpB,qGAAqG;AACrG,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,KAAK,CAAC;IACZ,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,eAAe,CAAC,EAAE,KAAK,CAAC;CACzB,CAAC;AA+EF,+CAA+C;AAC/C,8BAAsB,MAAM,CAAC,CAAC,SAAS,MAAM,CAAC,CAAC,CAAC,CAAE,SAAQ,IAAI,CAAC,CAAC,CAAC;IAC/D,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI;IACpF,SAAS,CAAC,QAAQ,CAAC,GAAG,IAAI,MAAM,EAAE;IAClC,SAAS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X,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAC7F,IAAI;IAUP,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI;IAkB3E,OAAO,IAAI,IAAI;CAKhB;AAED;;;;GAIG;AACH,eAAO,MAAM,OAAO,EAAE,MAErB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2.js b/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2.js deleted file mode 100644 index 69b3c415..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2.js +++ /dev/null @@ -1,413 +0,0 @@ -/** - * blake2b (64-bit) & blake2s (8 to 32-bit) hash functions. - * b could have been faster, but there is no fast u64 in js, so s is 1.5x faster. - * @module - */ -import { BSIGMA, G1s, G2s } from "./_blake.js"; -import { SHA256_IV } from "./_md.js"; -import * as u64 from "./_u64.js"; -// prettier-ignore -import { abytes, aexists, anumber, aoutput, clean, createOptHasher, Hash, swap32IfBE, swap8IfBE, toBytes, u32 } from "./utils.js"; -// Same as SHA512_IV, but swapped endianness: LE instead of BE. iv[1] is iv[0], etc. -const B2B_IV = /* @__PURE__ */ Uint32Array.from([ - 0xf3bcc908, 0x6a09e667, 0x84caa73b, 0xbb67ae85, 0xfe94f82b, 0x3c6ef372, 0x5f1d36f1, 0xa54ff53a, - 0xade682d1, 0x510e527f, 0x2b3e6c1f, 0x9b05688c, 0xfb41bd6b, 0x1f83d9ab, 0x137e2179, 0x5be0cd19, -]); -// Temporary buffer -const BBUF = /* @__PURE__ */ new Uint32Array(32); -// Mixing function G splitted in two halfs -function G1b(a, b, c, d, msg, x) { - // NOTE: V is LE here - const Xl = msg[x], Xh = msg[x + 1]; // prettier-ignore - let Al = BBUF[2 * a], Ah = BBUF[2 * a + 1]; // prettier-ignore - let Bl = BBUF[2 * b], Bh = BBUF[2 * b + 1]; // prettier-ignore - let Cl = BBUF[2 * c], Ch = BBUF[2 * c + 1]; // prettier-ignore - let Dl = BBUF[2 * d], Dh = BBUF[2 * d + 1]; // prettier-ignore - // v[a] = (v[a] + v[b] + x) | 0; - let ll = u64.add3L(Al, Bl, Xl); - Ah = u64.add3H(ll, Ah, Bh, Xh); - Al = ll | 0; - // v[d] = rotr(v[d] ^ v[a], 32) - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: u64.rotr32H(Dh, Dl), Dl: u64.rotr32L(Dh, Dl) }); - // v[c] = (v[c] + v[d]) | 0; - ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); - // v[b] = rotr(v[b] ^ v[c], 24) - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: u64.rotrSH(Bh, Bl, 24), Bl: u64.rotrSL(Bh, Bl, 24) }); - (BBUF[2 * a] = Al), (BBUF[2 * a + 1] = Ah); - (BBUF[2 * b] = Bl), (BBUF[2 * b + 1] = Bh); - (BBUF[2 * c] = Cl), (BBUF[2 * c + 1] = Ch); - (BBUF[2 * d] = Dl), (BBUF[2 * d + 1] = Dh); -} -function G2b(a, b, c, d, msg, x) { - // NOTE: V is LE here - const Xl = msg[x], Xh = msg[x + 1]; // prettier-ignore - let Al = BBUF[2 * a], Ah = BBUF[2 * a + 1]; // prettier-ignore - let Bl = BBUF[2 * b], Bh = BBUF[2 * b + 1]; // prettier-ignore - let Cl = BBUF[2 * c], Ch = BBUF[2 * c + 1]; // prettier-ignore - let Dl = BBUF[2 * d], Dh = BBUF[2 * d + 1]; // prettier-ignore - // v[a] = (v[a] + v[b] + x) | 0; - let ll = u64.add3L(Al, Bl, Xl); - Ah = u64.add3H(ll, Ah, Bh, Xh); - Al = ll | 0; - // v[d] = rotr(v[d] ^ v[a], 16) - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: u64.rotrSH(Dh, Dl, 16), Dl: u64.rotrSL(Dh, Dl, 16) }); - // v[c] = (v[c] + v[d]) | 0; - ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); - // v[b] = rotr(v[b] ^ v[c], 63) - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: u64.rotrBH(Bh, Bl, 63), Bl: u64.rotrBL(Bh, Bl, 63) }); - (BBUF[2 * a] = Al), (BBUF[2 * a + 1] = Ah); - (BBUF[2 * b] = Bl), (BBUF[2 * b + 1] = Bh); - (BBUF[2 * c] = Cl), (BBUF[2 * c + 1] = Ch); - (BBUF[2 * d] = Dl), (BBUF[2 * d + 1] = Dh); -} -function checkBlake2Opts(outputLen, opts = {}, keyLen, saltLen, persLen) { - anumber(keyLen); - if (outputLen < 0 || outputLen > keyLen) - throw new Error('outputLen bigger than keyLen'); - const { key, salt, personalization } = opts; - if (key !== undefined && (key.length < 1 || key.length > keyLen)) - throw new Error('key length must be undefined or 1..' + keyLen); - if (salt !== undefined && salt.length !== saltLen) - throw new Error('salt must be undefined or ' + saltLen); - if (personalization !== undefined && personalization.length !== persLen) - throw new Error('personalization must be undefined or ' + persLen); -} -/** Class, from which others are subclassed. */ -export class BLAKE2 extends Hash { - constructor(blockLen, outputLen) { - super(); - this.finished = false; - this.destroyed = false; - this.length = 0; - this.pos = 0; - anumber(blockLen); - anumber(outputLen); - this.blockLen = blockLen; - this.outputLen = outputLen; - this.buffer = new Uint8Array(blockLen); - this.buffer32 = u32(this.buffer); - } - update(data) { - aexists(this); - data = toBytes(data); - abytes(data); - // Main difference with other hashes: there is flag for last block, - // so we cannot process current block before we know that there - // is the next one. This significantly complicates logic and reduces ability - // to do zero-copy processing - const { blockLen, buffer, buffer32 } = this; - const len = data.length; - const offset = data.byteOffset; - const buf = data.buffer; - for (let pos = 0; pos < len;) { - // If buffer is full and we still have input (don't process last block, same as blake2s) - if (this.pos === blockLen) { - swap32IfBE(buffer32); - this.compress(buffer32, 0, false); - swap32IfBE(buffer32); - this.pos = 0; - } - const take = Math.min(blockLen - this.pos, len - pos); - const dataOffset = offset + pos; - // full block && aligned to 4 bytes && not last in input - if (take === blockLen && !(dataOffset % 4) && pos + take < len) { - const data32 = new Uint32Array(buf, dataOffset, Math.floor((len - pos) / 4)); - swap32IfBE(data32); - for (let pos32 = 0; pos + blockLen < len; pos32 += buffer32.length, pos += blockLen) { - this.length += blockLen; - this.compress(data32, pos32, false); - } - swap32IfBE(data32); - continue; - } - buffer.set(data.subarray(pos, pos + take), this.pos); - this.pos += take; - this.length += take; - pos += take; - } - return this; - } - digestInto(out) { - aexists(this); - aoutput(out, this); - const { pos, buffer32 } = this; - this.finished = true; - // Padding - clean(this.buffer.subarray(pos)); - swap32IfBE(buffer32); - this.compress(buffer32, 0, true); - swap32IfBE(buffer32); - const out32 = u32(out); - this.get().forEach((v, i) => (out32[i] = swap8IfBE(v))); - } - digest() { - const { buffer, outputLen } = this; - this.digestInto(buffer); - const res = buffer.slice(0, outputLen); - this.destroy(); - return res; - } - _cloneInto(to) { - const { buffer, length, finished, destroyed, outputLen, pos } = this; - to || (to = new this.constructor({ dkLen: outputLen })); - to.set(...this.get()); - to.buffer.set(buffer); - to.destroyed = destroyed; - to.finished = finished; - to.length = length; - to.pos = pos; - // @ts-ignore - to.outputLen = outputLen; - return to; - } - clone() { - return this._cloneInto(); - } -} -export class BLAKE2b extends BLAKE2 { - constructor(opts = {}) { - const olen = opts.dkLen === undefined ? 64 : opts.dkLen; - super(128, olen); - // Same as SHA-512, but LE - this.v0l = B2B_IV[0] | 0; - this.v0h = B2B_IV[1] | 0; - this.v1l = B2B_IV[2] | 0; - this.v1h = B2B_IV[3] | 0; - this.v2l = B2B_IV[4] | 0; - this.v2h = B2B_IV[5] | 0; - this.v3l = B2B_IV[6] | 0; - this.v3h = B2B_IV[7] | 0; - this.v4l = B2B_IV[8] | 0; - this.v4h = B2B_IV[9] | 0; - this.v5l = B2B_IV[10] | 0; - this.v5h = B2B_IV[11] | 0; - this.v6l = B2B_IV[12] | 0; - this.v6h = B2B_IV[13] | 0; - this.v7l = B2B_IV[14] | 0; - this.v7h = B2B_IV[15] | 0; - checkBlake2Opts(olen, opts, 64, 16, 16); - let { key, personalization, salt } = opts; - let keyLength = 0; - if (key !== undefined) { - key = toBytes(key); - keyLength = key.length; - } - this.v0l ^= this.outputLen | (keyLength << 8) | (0x01 << 16) | (0x01 << 24); - if (salt !== undefined) { - salt = toBytes(salt); - const slt = u32(salt); - this.v4l ^= swap8IfBE(slt[0]); - this.v4h ^= swap8IfBE(slt[1]); - this.v5l ^= swap8IfBE(slt[2]); - this.v5h ^= swap8IfBE(slt[3]); - } - if (personalization !== undefined) { - personalization = toBytes(personalization); - const pers = u32(personalization); - this.v6l ^= swap8IfBE(pers[0]); - this.v6h ^= swap8IfBE(pers[1]); - this.v7l ^= swap8IfBE(pers[2]); - this.v7h ^= swap8IfBE(pers[3]); - } - if (key !== undefined) { - // Pad to blockLen and update - const tmp = new Uint8Array(this.blockLen); - tmp.set(key); - this.update(tmp); - } - } - // prettier-ignore - get() { - let { v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h } = this; - return [v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h]; - } - // prettier-ignore - set(v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h) { - this.v0l = v0l | 0; - this.v0h = v0h | 0; - this.v1l = v1l | 0; - this.v1h = v1h | 0; - this.v2l = v2l | 0; - this.v2h = v2h | 0; - this.v3l = v3l | 0; - this.v3h = v3h | 0; - this.v4l = v4l | 0; - this.v4h = v4h | 0; - this.v5l = v5l | 0; - this.v5h = v5h | 0; - this.v6l = v6l | 0; - this.v6h = v6h | 0; - this.v7l = v7l | 0; - this.v7h = v7h | 0; - } - compress(msg, offset, isLast) { - this.get().forEach((v, i) => (BBUF[i] = v)); // First half from state. - BBUF.set(B2B_IV, 16); // Second half from IV. - let { h, l } = u64.fromBig(BigInt(this.length)); - BBUF[24] = B2B_IV[8] ^ l; // Low word of the offset. - BBUF[25] = B2B_IV[9] ^ h; // High word. - // Invert all bits for last block - if (isLast) { - BBUF[28] = ~BBUF[28]; - BBUF[29] = ~BBUF[29]; - } - let j = 0; - const s = BSIGMA; - for (let i = 0; i < 12; i++) { - G1b(0, 4, 8, 12, msg, offset + 2 * s[j++]); - G2b(0, 4, 8, 12, msg, offset + 2 * s[j++]); - G1b(1, 5, 9, 13, msg, offset + 2 * s[j++]); - G2b(1, 5, 9, 13, msg, offset + 2 * s[j++]); - G1b(2, 6, 10, 14, msg, offset + 2 * s[j++]); - G2b(2, 6, 10, 14, msg, offset + 2 * s[j++]); - G1b(3, 7, 11, 15, msg, offset + 2 * s[j++]); - G2b(3, 7, 11, 15, msg, offset + 2 * s[j++]); - G1b(0, 5, 10, 15, msg, offset + 2 * s[j++]); - G2b(0, 5, 10, 15, msg, offset + 2 * s[j++]); - G1b(1, 6, 11, 12, msg, offset + 2 * s[j++]); - G2b(1, 6, 11, 12, msg, offset + 2 * s[j++]); - G1b(2, 7, 8, 13, msg, offset + 2 * s[j++]); - G2b(2, 7, 8, 13, msg, offset + 2 * s[j++]); - G1b(3, 4, 9, 14, msg, offset + 2 * s[j++]); - G2b(3, 4, 9, 14, msg, offset + 2 * s[j++]); - } - this.v0l ^= BBUF[0] ^ BBUF[16]; - this.v0h ^= BBUF[1] ^ BBUF[17]; - this.v1l ^= BBUF[2] ^ BBUF[18]; - this.v1h ^= BBUF[3] ^ BBUF[19]; - this.v2l ^= BBUF[4] ^ BBUF[20]; - this.v2h ^= BBUF[5] ^ BBUF[21]; - this.v3l ^= BBUF[6] ^ BBUF[22]; - this.v3h ^= BBUF[7] ^ BBUF[23]; - this.v4l ^= BBUF[8] ^ BBUF[24]; - this.v4h ^= BBUF[9] ^ BBUF[25]; - this.v5l ^= BBUF[10] ^ BBUF[26]; - this.v5h ^= BBUF[11] ^ BBUF[27]; - this.v6l ^= BBUF[12] ^ BBUF[28]; - this.v6h ^= BBUF[13] ^ BBUF[29]; - this.v7l ^= BBUF[14] ^ BBUF[30]; - this.v7h ^= BBUF[15] ^ BBUF[31]; - clean(BBUF); - } - destroy() { - this.destroyed = true; - clean(this.buffer32); - this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - } -} -/** - * Blake2b hash function. 64-bit. 1.5x slower than blake2s in JS. - * @param msg - message that would be hashed - * @param opts - dkLen output length, key for MAC mode, salt, personalization - */ -export const blake2b = /* @__PURE__ */ createOptHasher((opts) => new BLAKE2b(opts)); -// prettier-ignore -export function compress(s, offset, msg, rounds, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) { - let j = 0; - for (let i = 0; i < rounds; i++) { - ({ a: v0, b: v4, c: v8, d: v12 } = G1s(v0, v4, v8, v12, msg[offset + s[j++]])); - ({ a: v0, b: v4, c: v8, d: v12 } = G2s(v0, v4, v8, v12, msg[offset + s[j++]])); - ({ a: v1, b: v5, c: v9, d: v13 } = G1s(v1, v5, v9, v13, msg[offset + s[j++]])); - ({ a: v1, b: v5, c: v9, d: v13 } = G2s(v1, v5, v9, v13, msg[offset + s[j++]])); - ({ a: v2, b: v6, c: v10, d: v14 } = G1s(v2, v6, v10, v14, msg[offset + s[j++]])); - ({ a: v2, b: v6, c: v10, d: v14 } = G2s(v2, v6, v10, v14, msg[offset + s[j++]])); - ({ a: v3, b: v7, c: v11, d: v15 } = G1s(v3, v7, v11, v15, msg[offset + s[j++]])); - ({ a: v3, b: v7, c: v11, d: v15 } = G2s(v3, v7, v11, v15, msg[offset + s[j++]])); - ({ a: v0, b: v5, c: v10, d: v15 } = G1s(v0, v5, v10, v15, msg[offset + s[j++]])); - ({ a: v0, b: v5, c: v10, d: v15 } = G2s(v0, v5, v10, v15, msg[offset + s[j++]])); - ({ a: v1, b: v6, c: v11, d: v12 } = G1s(v1, v6, v11, v12, msg[offset + s[j++]])); - ({ a: v1, b: v6, c: v11, d: v12 } = G2s(v1, v6, v11, v12, msg[offset + s[j++]])); - ({ a: v2, b: v7, c: v8, d: v13 } = G1s(v2, v7, v8, v13, msg[offset + s[j++]])); - ({ a: v2, b: v7, c: v8, d: v13 } = G2s(v2, v7, v8, v13, msg[offset + s[j++]])); - ({ a: v3, b: v4, c: v9, d: v14 } = G1s(v3, v4, v9, v14, msg[offset + s[j++]])); - ({ a: v3, b: v4, c: v9, d: v14 } = G2s(v3, v4, v9, v14, msg[offset + s[j++]])); - } - return { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 }; -} -const B2S_IV = SHA256_IV; -export class BLAKE2s extends BLAKE2 { - constructor(opts = {}) { - const olen = opts.dkLen === undefined ? 32 : opts.dkLen; - super(64, olen); - // Internal state, same as SHA-256 - this.v0 = B2S_IV[0] | 0; - this.v1 = B2S_IV[1] | 0; - this.v2 = B2S_IV[2] | 0; - this.v3 = B2S_IV[3] | 0; - this.v4 = B2S_IV[4] | 0; - this.v5 = B2S_IV[5] | 0; - this.v6 = B2S_IV[6] | 0; - this.v7 = B2S_IV[7] | 0; - checkBlake2Opts(olen, opts, 32, 8, 8); - let { key, personalization, salt } = opts; - let keyLength = 0; - if (key !== undefined) { - key = toBytes(key); - keyLength = key.length; - } - this.v0 ^= this.outputLen | (keyLength << 8) | (0x01 << 16) | (0x01 << 24); - if (salt !== undefined) { - salt = toBytes(salt); - const slt = u32(salt); - this.v4 ^= swap8IfBE(slt[0]); - this.v5 ^= swap8IfBE(slt[1]); - } - if (personalization !== undefined) { - personalization = toBytes(personalization); - const pers = u32(personalization); - this.v6 ^= swap8IfBE(pers[0]); - this.v7 ^= swap8IfBE(pers[1]); - } - if (key !== undefined) { - // Pad to blockLen and update - abytes(key); - const tmp = new Uint8Array(this.blockLen); - tmp.set(key); - this.update(tmp); - } - } - get() { - const { v0, v1, v2, v3, v4, v5, v6, v7 } = this; - return [v0, v1, v2, v3, v4, v5, v6, v7]; - } - // prettier-ignore - set(v0, v1, v2, v3, v4, v5, v6, v7) { - this.v0 = v0 | 0; - this.v1 = v1 | 0; - this.v2 = v2 | 0; - this.v3 = v3 | 0; - this.v4 = v4 | 0; - this.v5 = v5 | 0; - this.v6 = v6 | 0; - this.v7 = v7 | 0; - } - compress(msg, offset, isLast) { - const { h, l } = u64.fromBig(BigInt(this.length)); - // prettier-ignore - const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = compress(BSIGMA, offset, msg, 10, this.v0, this.v1, this.v2, this.v3, this.v4, this.v5, this.v6, this.v7, B2S_IV[0], B2S_IV[1], B2S_IV[2], B2S_IV[3], l ^ B2S_IV[4], h ^ B2S_IV[5], isLast ? ~B2S_IV[6] : B2S_IV[6], B2S_IV[7]); - this.v0 ^= v0 ^ v8; - this.v1 ^= v1 ^ v9; - this.v2 ^= v2 ^ v10; - this.v3 ^= v3 ^ v11; - this.v4 ^= v4 ^ v12; - this.v5 ^= v5 ^ v13; - this.v6 ^= v6 ^ v14; - this.v7 ^= v7 ^ v15; - } - destroy() { - this.destroyed = true; - clean(this.buffer32); - this.set(0, 0, 0, 0, 0, 0, 0, 0); - } -} -/** - * Blake2s hash function. Focuses on 8-bit to 32-bit platforms. 1.5x faster than blake2b in JS. - * @param msg - message that would be hashed - * @param opts - dkLen output length, key for MAC mode, salt, personalization - */ -export const blake2s = /* @__PURE__ */ createOptHasher((opts) => new BLAKE2s(opts)); -//# sourceMappingURL=blake2.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2.js.map deleted file mode 100644 index 6289763e..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blake2.js","sourceRoot":"","sources":["../src/blake2.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,KAAK,GAAG,MAAM,WAAW,CAAC;AACjC,kBAAkB;AAClB,OAAO,EACL,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EACjC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,EAElE,MAAM,YAAY,CAAC;AAUpB,oFAAoF;AACpF,MAAM,MAAM,GAAG,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC;IAC9C,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IAC9F,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;CAC/F,CAAC,CAAC;AACH,mBAAmB;AACnB,MAAM,IAAI,GAAG,eAAe,CAAC,IAAI,WAAW,CAAC,EAAE,CAAC,CAAC;AAEjD,0CAA0C;AAC1C,SAAS,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,GAAgB,EAAE,CAAS;IAClF,qBAAqB;IACrB,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,kBAAkB;IACtD,IAAI,EAAE,GAAG,IAAI,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AAC,EAAE,MAAM,CAAC,CAAC,CAAC,CACrH,CAAC;QACJ,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC;QACpB,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC;QACpB,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC;QACpB,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC;QACpB,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC;QACpB,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC;IACtB,CAAC;IACD,OAAO;QACL,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACrB,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACnC,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,OAAO,GAAW,eAAe,CAAC,eAAe,CAC5D,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAC5B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2b.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2b.d.ts deleted file mode 100644 index a9ea37ec..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2b.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Blake2b hash function. Focuses on 64-bit platforms, but in JS speed different from Blake2s is negligible. - * @module - * @deprecated - */ -import { BLAKE2b as B2B, blake2b as b2b } from './blake2.ts'; -/** @deprecated Use import from `noble/hashes/blake2` module */ -export declare const BLAKE2b: typeof B2B; -/** @deprecated Use import from `noble/hashes/blake2` module */ -export declare const blake2b: typeof b2b; -//# sourceMappingURL=blake2b.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2b.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2b.d.ts.map deleted file mode 100644 index 0307e900..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2b.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blake2b.d.ts","sourceRoot":"","sources":["../src/blake2b.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,aAAa,CAAC;AAC7D,+DAA+D;AAC/D,eAAO,MAAM,OAAO,EAAE,OAAO,GAAS,CAAC;AACvC,+DAA+D;AAC/D,eAAO,MAAM,OAAO,EAAE,OAAO,GAAS,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2b.js b/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2b.js deleted file mode 100644 index 2a7fa354..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2b.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Blake2b hash function. Focuses on 64-bit platforms, but in JS speed different from Blake2s is negligible. - * @module - * @deprecated - */ -import { BLAKE2b as B2B, blake2b as b2b } from "./blake2.js"; -/** @deprecated Use import from `noble/hashes/blake2` module */ -export const BLAKE2b = B2B; -/** @deprecated Use import from `noble/hashes/blake2` module */ -export const blake2b = b2b; -//# sourceMappingURL=blake2b.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2b.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2b.js.map deleted file mode 100644 index 8450afa4..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2b.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blake2b.js","sourceRoot":"","sources":["../src/blake2b.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,aAAa,CAAC;AAC7D,+DAA+D;AAC/D,MAAM,CAAC,MAAM,OAAO,GAAe,GAAG,CAAC;AACvC,+DAA+D;AAC/D,MAAM,CAAC,MAAM,OAAO,GAAe,GAAG,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2s.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2s.d.ts deleted file mode 100644 index 6720f358..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2s.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Blake2s hash function. Focuses on 8-bit to 32-bit platforms. blake2b for 64-bit, but in JS it is slower. - * @module - * @deprecated - */ -import { G1s as G1s_n, G2s as G2s_n } from './_blake.ts'; -import { BLAKE2s as B2S, blake2s as b2s, compress as compress_n } from './blake2.ts'; -/** @deprecated Use import from `noble/hashes/blake2` module */ -export declare const B2S_IV: Uint32Array; -/** @deprecated Use import from `noble/hashes/blake2` module */ -export declare const G1s: typeof G1s_n; -/** @deprecated Use import from `noble/hashes/blake2` module */ -export declare const G2s: typeof G2s_n; -/** @deprecated Use import from `noble/hashes/blake2` module */ -export declare const compress: typeof compress_n; -/** @deprecated Use import from `noble/hashes/blake2` module */ -export declare const BLAKE2s: typeof B2S; -/** @deprecated Use import from `noble/hashes/blake2` module */ -export declare const blake2s: typeof b2s; -//# sourceMappingURL=blake2s.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2s.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2s.d.ts.map deleted file mode 100644 index ced6ec76..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2s.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blake2s.d.ts","sourceRoot":"","sources":["../src/blake2s.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,GAAG,IAAI,KAAK,EAAE,GAAG,IAAI,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,OAAO,IAAI,GAAG,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,aAAa,CAAC;AACrF,+DAA+D;AAC/D,eAAO,MAAM,MAAM,EAAE,WAAuB,CAAC;AAC7C,+DAA+D;AAC/D,eAAO,MAAM,GAAG,EAAE,OAAO,KAAa,CAAC;AACvC,+DAA+D;AAC/D,eAAO,MAAM,GAAG,EAAE,OAAO,KAAa,CAAC;AACvC,+DAA+D;AAC/D,eAAO,MAAM,QAAQ,EAAE,OAAO,UAAuB,CAAC;AACtD,+DAA+D;AAC/D,eAAO,MAAM,OAAO,EAAE,OAAO,GAAS,CAAC;AACvC,+DAA+D;AAC/D,eAAO,MAAM,OAAO,EAAE,OAAO,GAAS,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2s.js b/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2s.js deleted file mode 100644 index a4d33378..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2s.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Blake2s hash function. Focuses on 8-bit to 32-bit platforms. blake2b for 64-bit, but in JS it is slower. - * @module - * @deprecated - */ -import { G1s as G1s_n, G2s as G2s_n } from "./_blake.js"; -import { SHA256_IV } from "./_md.js"; -import { BLAKE2s as B2S, blake2s as b2s, compress as compress_n } from "./blake2.js"; -/** @deprecated Use import from `noble/hashes/blake2` module */ -export const B2S_IV = SHA256_IV; -/** @deprecated Use import from `noble/hashes/blake2` module */ -export const G1s = G1s_n; -/** @deprecated Use import from `noble/hashes/blake2` module */ -export const G2s = G2s_n; -/** @deprecated Use import from `noble/hashes/blake2` module */ -export const compress = compress_n; -/** @deprecated Use import from `noble/hashes/blake2` module */ -export const BLAKE2s = B2S; -/** @deprecated Use import from `noble/hashes/blake2` module */ -export const blake2s = b2s; -//# sourceMappingURL=blake2s.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2s.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2s.js.map deleted file mode 100644 index c0572b2a..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake2s.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blake2s.js","sourceRoot":"","sources":["../src/blake2s.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,GAAG,IAAI,KAAK,EAAE,GAAG,IAAI,KAAK,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,OAAO,IAAI,GAAG,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,aAAa,CAAC;AACrF,+DAA+D;AAC/D,MAAM,CAAC,MAAM,MAAM,GAAgB,SAAS,CAAC;AAC7C,+DAA+D;AAC/D,MAAM,CAAC,MAAM,GAAG,GAAiB,KAAK,CAAC;AACvC,+DAA+D;AAC/D,MAAM,CAAC,MAAM,GAAG,GAAiB,KAAK,CAAC;AACvC,+DAA+D;AAC/D,MAAM,CAAC,MAAM,QAAQ,GAAsB,UAAU,CAAC;AACtD,+DAA+D;AAC/D,MAAM,CAAC,MAAM,OAAO,GAAe,GAAG,CAAC;AACvC,+DAA+D;AAC/D,MAAM,CAAC,MAAM,OAAO,GAAe,GAAG,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake3.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake3.d.ts deleted file mode 100644 index 234fa87f..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake3.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { BLAKE2 } from './blake2.ts'; -import { type CHashXO, type HashXOF, type Input } from './utils.ts'; -/** - * Ensure to use EITHER `key` OR `context`, not both. - * - * * `key`: 32-byte MAC key. - * * `context`: string for KDF. Should be hardcoded, globally unique, and application - specific. - * A good default format for the context string is "[application] [commit timestamp] [purpose]". - */ -export type Blake3Opts = { - dkLen?: number; - key?: Input; - context?: Input; -}; -/** Blake3 hash. Can be used as MAC and KDF. */ -export declare class BLAKE3 extends BLAKE2 implements HashXOF { - private chunkPos; - private chunksDone; - private flags; - private IV; - private state; - private stack; - private posOut; - private bufferOut32; - private bufferOut; - private chunkOut; - private enableXOF; - constructor(opts?: Blake3Opts, flags?: number); - protected get(): []; - protected set(): void; - private b2Compress; - protected compress(buf: Uint32Array, bufPos?: number, isLast?: boolean): void; - _cloneInto(to?: BLAKE3): BLAKE3; - destroy(): void; - private b2CompressOut; - protected finish(): void; - private writeInto; - xofInto(out: Uint8Array): Uint8Array; - xof(bytes: number): Uint8Array; - digestInto(out: Uint8Array): Uint8Array; - digest(): Uint8Array; -} -/** - * BLAKE3 hash function. Can be used as MAC and KDF. - * @param msg - message that would be hashed - * @param opts - `dkLen` for output length, `key` for MAC mode, `context` for KDF mode - * @example - * const data = new Uint8Array(32); - * const hash = blake3(data); - * const mac = blake3(data, { key: new Uint8Array(32) }); - * const kdf = blake3(data, { context: 'application name' }); - */ -export declare const blake3: CHashXO; -//# sourceMappingURL=blake3.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake3.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake3.d.ts.map deleted file mode 100644 index 4335e424..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake3.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blake3.d.ts","sourceRoot":"","sources":["../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AU,GAAG,UAAU;IAIpC,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU;IAI9B,UAAU,CAAC,GAAG,EAAE,UAAU,GAAG,UAAU;IAQvC,MAAM,IAAI,UAAU;CAGrB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,MAAM,EAAE,OAEpB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake3.js b/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake3.js deleted file mode 100644 index e7e6e48d..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake3.js +++ /dev/null @@ -1,251 +0,0 @@ -/** - * Blake3 fast hash is Blake2 with reduced security (round count). Can also be used as MAC & KDF. - * - * It is advertised as "the fastest cryptographic hash". However, it isn't true in JS. - * Why is this so slow? While it should be 6x faster than blake2b, perf diff is only 20%: - * - * * There is only 30% reduction in number of rounds from blake2s - * * Speed-up comes from tree structure, which is parallelized using SIMD & threading. - * These features are not present in JS, so we only get overhead from trees. - * * Parallelization only happens on 1024-byte chunks: there is no benefit for small inputs. - * * It is still possible to make it faster using: a) loop unrolling b) web workers c) wasm - * @module - */ -import { SHA256_IV } from "./_md.js"; -import { fromBig } from "./_u64.js"; -import { BLAKE2, compress } from "./blake2.js"; -// prettier-ignore -import { abytes, aexists, anumber, aoutput, clean, createXOFer, swap32IfBE, toBytes, u32, u8 } from "./utils.js"; -// Flag bitset -const B3_Flags = { - CHUNK_START: 0b1, - CHUNK_END: 0b10, - PARENT: 0b100, - ROOT: 0b1000, - KEYED_HASH: 0b10000, - DERIVE_KEY_CONTEXT: 0b100000, - DERIVE_KEY_MATERIAL: 0b1000000, -}; -const B3_IV = SHA256_IV.slice(); -const B3_SIGMA = /* @__PURE__ */ (() => { - const Id = Array.from({ length: 16 }, (_, i) => i); - const permute = (arr) => [2, 6, 3, 10, 7, 0, 4, 13, 1, 11, 12, 5, 9, 14, 15, 8].map((i) => arr[i]); - const res = []; - for (let i = 0, v = Id; i < 7; i++, v = permute(v)) - res.push(...v); - return Uint8Array.from(res); -})(); -/** Blake3 hash. Can be used as MAC and KDF. */ -export class BLAKE3 extends BLAKE2 { - constructor(opts = {}, flags = 0) { - super(64, opts.dkLen === undefined ? 32 : opts.dkLen); - this.chunkPos = 0; // Position of current block in chunk - this.chunksDone = 0; // How many chunks we already have - this.flags = 0 | 0; - this.stack = []; - // Output - this.posOut = 0; - this.bufferOut32 = new Uint32Array(16); - this.chunkOut = 0; // index of output chunk - this.enableXOF = true; - const { key, context } = opts; - const hasContext = context !== undefined; - if (key !== undefined) { - if (hasContext) - throw new Error('Only "key" or "context" can be specified at same time'); - const k = toBytes(key).slice(); - abytes(k, 32); - this.IV = u32(k); - swap32IfBE(this.IV); - this.flags = flags | B3_Flags.KEYED_HASH; - } - else if (hasContext) { - const ctx = toBytes(context); - const contextKey = new BLAKE3({ dkLen: 32 }, B3_Flags.DERIVE_KEY_CONTEXT) - .update(ctx) - .digest(); - this.IV = u32(contextKey); - swap32IfBE(this.IV); - this.flags = flags | B3_Flags.DERIVE_KEY_MATERIAL; - } - else { - this.IV = B3_IV.slice(); - this.flags = flags; - } - this.state = this.IV.slice(); - this.bufferOut = u8(this.bufferOut32); - } - // Unused - get() { - return []; - } - set() { } - b2Compress(counter, flags, buf, bufPos = 0) { - const { state: s, pos } = this; - const { h, l } = fromBig(BigInt(counter), true); - // prettier-ignore - const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = compress(B3_SIGMA, bufPos, buf, 7, s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], B3_IV[0], B3_IV[1], B3_IV[2], B3_IV[3], h, l, pos, flags); - s[0] = v0 ^ v8; - s[1] = v1 ^ v9; - s[2] = v2 ^ v10; - s[3] = v3 ^ v11; - s[4] = v4 ^ v12; - s[5] = v5 ^ v13; - s[6] = v6 ^ v14; - s[7] = v7 ^ v15; - } - compress(buf, bufPos = 0, isLast = false) { - // Compress last block - let flags = this.flags; - if (!this.chunkPos) - flags |= B3_Flags.CHUNK_START; - if (this.chunkPos === 15 || isLast) - flags |= B3_Flags.CHUNK_END; - if (!isLast) - this.pos = this.blockLen; - this.b2Compress(this.chunksDone, flags, buf, bufPos); - this.chunkPos += 1; - // If current block is last in chunk (16 blocks), then compress chunks - if (this.chunkPos === 16 || isLast) { - let chunk = this.state; - this.state = this.IV.slice(); - // If not the last one, compress only when there are trailing zeros in chunk counter - // chunks used as binary tree where current stack is path. Zero means current leaf is finished and can be compressed. - // 1 (001) - leaf not finished (just push current chunk to stack) - // 2 (010) - leaf finished at depth=1 (merge with last elm on stack and push back) - // 3 (011) - last leaf not finished - // 4 (100) - leafs finished at depth=1 and depth=2 - for (let last, chunks = this.chunksDone + 1; isLast || !(chunks & 1); chunks >>= 1) { - if (!(last = this.stack.pop())) - break; - this.buffer32.set(last, 0); - this.buffer32.set(chunk, 8); - this.pos = this.blockLen; - this.b2Compress(0, this.flags | B3_Flags.PARENT, this.buffer32, 0); - chunk = this.state; - this.state = this.IV.slice(); - } - this.chunksDone++; - this.chunkPos = 0; - this.stack.push(chunk); - } - this.pos = 0; - } - _cloneInto(to) { - to = super._cloneInto(to); - const { IV, flags, state, chunkPos, posOut, chunkOut, stack, chunksDone } = this; - to.state.set(state.slice()); - to.stack = stack.map((i) => Uint32Array.from(i)); - to.IV.set(IV); - to.flags = flags; - to.chunkPos = chunkPos; - to.chunksDone = chunksDone; - to.posOut = posOut; - to.chunkOut = chunkOut; - to.enableXOF = this.enableXOF; - to.bufferOut32.set(this.bufferOut32); - return to; - } - destroy() { - this.destroyed = true; - clean(this.state, this.buffer32, this.IV, this.bufferOut32); - clean(...this.stack); - } - // Same as b2Compress, but doesn't modify state and returns 16 u32 array (instead of 8) - b2CompressOut() { - const { state: s, pos, flags, buffer32, bufferOut32: out32 } = this; - const { h, l } = fromBig(BigInt(this.chunkOut++)); - swap32IfBE(buffer32); - // prettier-ignore - const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = compress(B3_SIGMA, 0, buffer32, 7, s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], B3_IV[0], B3_IV[1], B3_IV[2], B3_IV[3], l, h, pos, flags); - out32[0] = v0 ^ v8; - out32[1] = v1 ^ v9; - out32[2] = v2 ^ v10; - out32[3] = v3 ^ v11; - out32[4] = v4 ^ v12; - out32[5] = v5 ^ v13; - out32[6] = v6 ^ v14; - out32[7] = v7 ^ v15; - out32[8] = s[0] ^ v8; - out32[9] = s[1] ^ v9; - out32[10] = s[2] ^ v10; - out32[11] = s[3] ^ v11; - out32[12] = s[4] ^ v12; - out32[13] = s[5] ^ v13; - out32[14] = s[6] ^ v14; - out32[15] = s[7] ^ v15; - swap32IfBE(buffer32); - swap32IfBE(out32); - this.posOut = 0; - } - finish() { - if (this.finished) - return; - this.finished = true; - // Padding - clean(this.buffer.subarray(this.pos)); - // Process last chunk - let flags = this.flags | B3_Flags.ROOT; - if (this.stack.length) { - flags |= B3_Flags.PARENT; - swap32IfBE(this.buffer32); - this.compress(this.buffer32, 0, true); - swap32IfBE(this.buffer32); - this.chunksDone = 0; - this.pos = this.blockLen; - } - else { - flags |= (!this.chunkPos ? B3_Flags.CHUNK_START : 0) | B3_Flags.CHUNK_END; - } - this.flags = flags; - this.b2CompressOut(); - } - writeInto(out) { - aexists(this, false); - abytes(out); - this.finish(); - const { blockLen, bufferOut } = this; - for (let pos = 0, len = out.length; pos < len;) { - if (this.posOut >= blockLen) - this.b2CompressOut(); - const take = Math.min(blockLen - this.posOut, len - pos); - out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); - this.posOut += take; - pos += take; - } - return out; - } - xofInto(out) { - if (!this.enableXOF) - throw new Error('XOF is not possible after digest call'); - return this.writeInto(out); - } - xof(bytes) { - anumber(bytes); - return this.xofInto(new Uint8Array(bytes)); - } - digestInto(out) { - aoutput(out, this); - if (this.finished) - throw new Error('digest() was already called'); - this.enableXOF = false; - this.writeInto(out); - this.destroy(); - return out; - } - digest() { - return this.digestInto(new Uint8Array(this.outputLen)); - } -} -/** - * BLAKE3 hash function. Can be used as MAC and KDF. - * @param msg - message that would be hashed - * @param opts - `dkLen` for output length, `key` for MAC mode, `context` for KDF mode - * @example - * const data = new Uint8Array(32); - * const hash = blake3(data); - * const mac = blake3(data, { key: new Uint8Array(32) }); - * const kdf = blake3(data, { context: 'application name' }); - */ -export const blake3 = /* @__PURE__ */ createXOFer((opts) => new BLAKE3(opts)); -//# sourceMappingURL=blake3.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake3.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake3.js.map deleted file mode 100644 index 91f5a798..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/blake3.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blake3.js","sourceRoot":"","sources":["../src/blake3.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC/C,kBAAkB;AAClB,OAAO,EACL,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EACjC,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,EAEjD,MAAM,YAAY,CAAC;AAEpB,cAAc;AACd,MAAM,QAAQ,GAAG;IACf,WAAW,EAAE,GAAG;IAChB,SAAS,EAAE,IAAI;IACf,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE,OAAO;IACnB,kBAAkB,EAAE,QAAQ;IAC5B,mBAAmB,EAAE,SAAS;CACtB,CAAC;AAEX,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,EAAE,CAAC;AAEhC,MAA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AI,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAC9E,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IACD,GAAG,CAAC,KAAa;QACf,OAAO,CAAC,KAAK,CAAC,CAAC;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7C,CAAC;IACD,UAAU,CAAC,GAAe;QACxB,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACnB,IAAI,IAAI,CAAC,QAAQ;YAAE,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;QAClE,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QACpB,IAAI,CAAC,OAAO,EAAE,CAAC;QACf,OAAO,GAAG,CAAC;IACb,CAAC;IACD,MAAM;QACJ,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IACzD,CAAC;CACF;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,MAAM,GAAY,eAAe,CAAC,WAAW,CACxD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAC3B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/crypto.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/esm/crypto.d.ts deleted file mode 100644 index ac181a02..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/crypto.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const crypto: any; -//# sourceMappingURL=crypto.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/crypto.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/crypto.d.ts.map deleted file mode 100644 index 756d9820..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/crypto.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../src/crypto.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,MAAM,EAAE,GACqE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/crypto.js b/tools/mnemonic-test/node_modules/@noble/hashes/esm/crypto.js deleted file mode 100644 index 8d499a08..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/crypto.js +++ /dev/null @@ -1,2 +0,0 @@ -export const crypto = typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined; -//# sourceMappingURL=crypto.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/crypto.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/crypto.js.map deleted file mode 100644 index 9ad4f45b..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/crypto.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../src/crypto.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,MAAM,GACjB,OAAO,UAAU,KAAK,QAAQ,IAAI,QAAQ,IAAI,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/cryptoNode.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/esm/cryptoNode.d.ts deleted file mode 100644 index 98bda7be..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/cryptoNode.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const crypto: any; -//# sourceMappingURL=cryptoNode.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/cryptoNode.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/cryptoNode.d.ts.map deleted file mode 100644 index 90dcc444..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/cryptoNode.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cryptoNode.d.ts","sourceRoot":"","sources":["../src/cryptoNode.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,MAAM,EAAE,GAKJ,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/cryptoNode.js b/tools/mnemonic-test/node_modules/@noble/hashes/esm/cryptoNode.js deleted file mode 100644 index 4f77e8f4..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/cryptoNode.js +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Internal webcrypto alias. - * We prefer WebCrypto aka globalThis.crypto, which exists in node.js 16+. - * Falls back to Node.js built-in crypto for Node.js <=v14. - * See utils.ts for details. - * @module - */ -// @ts-ignore -import * as nc from 'node:crypto'; -export const crypto = nc && typeof nc === 'object' && 'webcrypto' in nc - ? nc.webcrypto - : nc && typeof nc === 'object' && 'randomBytes' in nc - ? nc - : undefined; -//# sourceMappingURL=cryptoNode.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/cryptoNode.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/cryptoNode.js.map deleted file mode 100644 index 6b07d8a6..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/cryptoNode.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cryptoNode.js","sourceRoot":"","sources":["../src/cryptoNode.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,aAAa;AACb,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,MAAM,CAAC,MAAM,MAAM,GACjB,EAAE,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,WAAW,IAAI,EAAE;IAC/C,CAAC,CAAE,EAAE,CAAC,SAAiB;IACvB,CAAC,CAAC,EAAE,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,aAAa,IAAI,EAAE;QACnD,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,SAAS,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/eskdf.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/esm/eskdf.d.ts deleted file mode 100644 index 66721eb5..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/eskdf.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -export declare function scrypt(password: string, salt: string): Uint8Array; -export declare function pbkdf2(password: string, salt: string): Uint8Array; -/** - * Derives main seed. Takes a lot of time. Prefer `eskdf` method instead. - */ -export declare function deriveMainSeed(username: string, password: string): Uint8Array; -type AccountID = number | string; -type OptsLength = { - keyLength: number; -}; -type OptsMod = { - modulus: bigint; -}; -type KeyOpts = undefined | OptsLength | OptsMod; -export interface ESKDF { - /** - * Derives a child key. Child key will not be associated with any - * other child key because of properties of underlying KDF. - * - * @param protocol - 3-15 character protocol name - * @param accountId - numeric identifier of account - * @param options - `keyLength: 64` or `modulus: 41920438n` - * @example deriveChildKey('aes', 0) - */ - deriveChildKey: (protocol: string, accountId: AccountID, options?: KeyOpts) => Uint8Array; - /** - * Deletes the main seed from eskdf instance - */ - expire: () => void; - /** - * Account fingerprint - */ - fingerprint: string; -} -/** - * ESKDF - * @param username - username, email, or identifier, min: 8 characters, should have enough entropy - * @param password - password, min: 8 characters, should have enough entropy - * @example - * const kdf = await eskdf('example-university', 'beginning-new-example'); - * const key = kdf.deriveChildKey('aes', 0); - * console.log(kdf.fingerprint); - * kdf.expire(); - */ -export declare function eskdf(username: string, password: string): Promise; -export {}; -//# sourceMappingURL=eskdf.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/eskdf.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/eskdf.d.ts.map deleted file mode 100644 index f05732c0..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/eskdf.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"eskdf.d.ts","sourceRoot":"","sources":["../src/eskdf.ts"],"names":[],"mappings":"AAiBA,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAEjE;AAGD,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAEjE;AAiBD;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,UAAU,CAY7E;AAED,KAAK,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AAgCjC,KAAK,UAAU,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AACxC,KAAK,OAAO,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AACnC,KAAK,OAAO,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,CAAC;AAwChD,MAAM,WAAW,KAAK;IACpB;;;;;;;;OAQG;IACH,cAAc,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,UAAU,CAAC;IAC1F;;OAEG;IACH,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;GASG;AACH,wBAAsB,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAuB9E"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/eskdf.js b/tools/mnemonic-test/node_modules/@noble/hashes/esm/eskdf.js deleted file mode 100644 index 96d7a500..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/eskdf.js +++ /dev/null @@ -1,160 +0,0 @@ -/** - * Experimental KDF for AES. - */ -import { hkdf } from "./hkdf.js"; -import { pbkdf2 as _pbkdf2 } from "./pbkdf2.js"; -import { scrypt as _scrypt } from "./scrypt.js"; -import { sha256 } from "./sha256.js"; -import { abytes, bytesToHex, clean, createView, hexToBytes, kdfInputToBytes } from "./utils.js"; -// A tiny KDF for various applications like AES key-gen. -// Uses HKDF in a non-standard way, so it's not "KDF-secure", only "PRF-secure". -// Which is good enough: assume sha2-256 retained preimage resistance. -const SCRYPT_FACTOR = 2 ** 19; -const PBKDF2_FACTOR = 2 ** 17; -// Scrypt KDF -export function scrypt(password, salt) { - return _scrypt(password, salt, { N: SCRYPT_FACTOR, r: 8, p: 1, dkLen: 32 }); -} -// PBKDF2-HMAC-SHA256 -export function pbkdf2(password, salt) { - return _pbkdf2(sha256, password, salt, { c: PBKDF2_FACTOR, dkLen: 32 }); -} -// Combines two 32-byte byte arrays -function xor32(a, b) { - abytes(a, 32); - abytes(b, 32); - const arr = new Uint8Array(32); - for (let i = 0; i < 32; i++) { - arr[i] = a[i] ^ b[i]; - } - return arr; -} -function strHasLength(str, min, max) { - return typeof str === 'string' && str.length >= min && str.length <= max; -} -/** - * Derives main seed. Takes a lot of time. Prefer `eskdf` method instead. - */ -export function deriveMainSeed(username, password) { - if (!strHasLength(username, 8, 255)) - throw new Error('invalid username'); - if (!strHasLength(password, 8, 255)) - throw new Error('invalid password'); - // Declared like this to throw off minifiers which auto-convert .fromCharCode(1) to actual string. - // String with non-ascii may be problematic in some envs - const codes = { _1: 1, _2: 2 }; - const sep = { s: String.fromCharCode(codes._1), p: String.fromCharCode(codes._2) }; - const scr = scrypt(password + sep.s, username + sep.s); - const pbk = pbkdf2(password + sep.p, username + sep.p); - const res = xor32(scr, pbk); - clean(scr, pbk); - return res; -} -/** - * Converts protocol & accountId pair to HKDF salt & info params. - */ -function getSaltInfo(protocol, accountId = 0) { - // Note that length here also repeats two lines below - // We do an additional length check here to reduce the scope of DoS attacks - if (!(strHasLength(protocol, 3, 15) && /^[a-z0-9]{3,15}$/.test(protocol))) { - throw new Error('invalid protocol'); - } - // Allow string account ids for some protocols - const allowsStr = /^password\d{0,3}|ssh|tor|file$/.test(protocol); - let salt; // Extract salt. Default is undefined. - if (typeof accountId === 'string') { - if (!allowsStr) - throw new Error('accountId must be a number'); - if (!strHasLength(accountId, 1, 255)) - throw new Error('accountId must be string of length 1..255'); - salt = kdfInputToBytes(accountId); - } - else if (Number.isSafeInteger(accountId)) { - if (accountId < 0 || accountId > Math.pow(2, 32) - 1) - throw new Error('invalid accountId'); - // Convert to Big Endian Uint32 - salt = new Uint8Array(4); - createView(salt).setUint32(0, accountId, false); - } - else { - throw new Error('accountId must be a number' + (allowsStr ? ' or string' : '')); - } - const info = kdfInputToBytes(protocol); - return { salt, info }; -} -function countBytes(num) { - if (typeof num !== 'bigint' || num <= BigInt(128)) - throw new Error('invalid number'); - return Math.ceil(num.toString(2).length / 8); -} -/** - * Parses keyLength and modulus options to extract length of result key. - * If modulus is used, adds 64 bits to it as per FIPS 186 B.4.1 to combat modulo bias. - */ -function getKeyLength(options) { - if (!options || typeof options !== 'object') - return 32; - const hasLen = 'keyLength' in options; - const hasMod = 'modulus' in options; - if (hasLen && hasMod) - throw new Error('cannot combine keyLength and modulus options'); - if (!hasLen && !hasMod) - throw new Error('must have either keyLength or modulus option'); - // FIPS 186 B.4.1 requires at least 64 more bits - const l = hasMod ? countBytes(options.modulus) + 8 : options.keyLength; - if (!(typeof l === 'number' && l >= 16 && l <= 8192)) - throw new Error('invalid keyLength'); - return l; -} -/** - * Converts key to bigint and divides it by modulus. Big Endian. - * Implements FIPS 186 B.4.1, which removes 0 and modulo bias from output. - */ -function modReduceKey(key, modulus) { - const _1 = BigInt(1); - const num = BigInt('0x' + bytesToHex(key)); // check for ui8a, then bytesToNumber() - const res = (num % (modulus - _1)) + _1; // Remove 0 from output - if (res < _1) - throw new Error('expected positive number'); // Guard against bad values - const len = key.length - 8; // FIPS requires 64 more bits = 8 bytes - const hex = res.toString(16).padStart(len * 2, '0'); // numberToHex() - const bytes = hexToBytes(hex); - if (bytes.length !== len) - throw new Error('invalid length of result key'); - return bytes; -} -/** - * ESKDF - * @param username - username, email, or identifier, min: 8 characters, should have enough entropy - * @param password - password, min: 8 characters, should have enough entropy - * @example - * const kdf = await eskdf('example-university', 'beginning-new-example'); - * const key = kdf.deriveChildKey('aes', 0); - * console.log(kdf.fingerprint); - * kdf.expire(); - */ -export async function eskdf(username, password) { - // We are using closure + object instead of class because - // we want to make `seed` non-accessible for any external function. - let seed = deriveMainSeed(username, password); - function deriveCK(protocol, accountId = 0, options) { - abytes(seed, 32); - const { salt, info } = getSaltInfo(protocol, accountId); // validate protocol & accountId - const keyLength = getKeyLength(options); // validate options - const key = hkdf(sha256, seed, salt, info, keyLength); - // Modulus has already been validated - return options && 'modulus' in options ? modReduceKey(key, options.modulus) : key; - } - function expire() { - if (seed) - seed.fill(1); - seed = undefined; - } - // prettier-ignore - const fingerprint = Array.from(deriveCK('fingerprint', 0)) - .slice(0, 6) - .map((char) => char.toString(16).padStart(2, '0').toUpperCase()) - .join(':'); - return Object.freeze({ deriveChildKey: deriveCK, expire, fingerprint }); -} -//# sourceMappingURL=eskdf.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/eskdf.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/eskdf.js.map deleted file mode 100644 index 578d3f49..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/eskdf.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"eskdf.js","sourceRoot":"","sources":["../src/eskdf.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAA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AC,GAAG,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IACpF,CAAC;IACD,SAAS,MAAM;QACb,IAAI,IAAI;YAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACvB,IAAI,GAAG,SAAS,CAAC;IACnB,CAAC;IACD,kBAAkB;IAClB,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC;SACvD,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;SACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;SAC/D,IAAI,CAAC,GAAG,CAAC,CAAC;IACb,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC;AAC1E,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/hkdf.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/esm/hkdf.d.ts deleted file mode 100644 index c54c4ab2..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/hkdf.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { type CHash, type Input } from './utils.ts'; -/** - * HKDF-extract from spec. Less important part. `HKDF-Extract(IKM, salt) -> PRK` - * Arguments position differs from spec (IKM is first one, since it is not optional) - * @param hash - hash function that would be used (e.g. sha256) - * @param ikm - input keying material, the initial key - * @param salt - optional salt value (a non-secret random value) - */ -export declare function extract(hash: CHash, ikm: Input, salt?: Input): Uint8Array; -/** - * HKDF-expand from the spec. The most important part. `HKDF-Expand(PRK, info, L) -> OKM` - * @param hash - hash function that would be used (e.g. sha256) - * @param prk - a pseudorandom key of at least HashLen octets (usually, the output from the extract step) - * @param info - optional context and application specific information (can be a zero-length string) - * @param length - length of output keying material in bytes - */ -export declare function expand(hash: CHash, prk: Input, info?: Input, length?: number): Uint8Array; -/** - * HKDF (RFC 5869): derive keys from an initial input. - * Combines hkdf_extract + hkdf_expand in one step - * @param hash - hash function that would be used (e.g. sha256) - * @param ikm - input keying material, the initial key - * @param salt - optional salt value (a non-secret random value) - * @param info - optional context and application specific information (can be a zero-length string) - * @param length - length of output keying material in bytes - * @example - * import { hkdf } from '@noble/hashes/hkdf'; - * import { sha256 } from '@noble/hashes/sha2'; - * import { randomBytes } from '@noble/hashes/utils'; - * const inputKey = randomBytes(32); - * const salt = randomBytes(32); - * const info = 'application-key'; - * const hk1 = hkdf(sha256, inputKey, salt, info, 32); - */ -export declare const hkdf: (hash: CHash, ikm: Input, salt: Input | undefined, info: Input | undefined, length: number) => Uint8Array; -//# sourceMappingURL=hkdf.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/hkdf.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/hkdf.d.ts.map deleted file mode 100644 index 675ea9e9..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/hkdf.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hkdf.d.ts","sourceRoot":"","sources":["../src/hkdf.ts"],"names":[],"mappings":"AAMA,OAAO,EAAkB,KAAK,KAAK,EAAS,KAAK,KAAK,EAAW,MAAM,YAAY,CAAC;AAEpF;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,KAAK,GAAG,UAAU,CAOzE;AAKD;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,GAAE,MAAW,GAAG,UAAU,CA4B7F;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,IAAI,GACf,MAAM,KAAK,EACX,KAAK,KAAK,EACV,MAAM,KAAK,GAAG,SAAS,EACvB,MAAM,KAAK,GAAG,SAAS,EACvB,QAAQ,MAAM,KACb,UAAkE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/hkdf.js b/tools/mnemonic-test/node_modules/@noble/hashes/esm/hkdf.js deleted file mode 100644 index a306a9bf..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/hkdf.js +++ /dev/null @@ -1,82 +0,0 @@ -/** - * HKDF (RFC 5869): extract + expand in one step. - * See https://soatok.blog/2021/11/17/understanding-hkdf/. - * @module - */ -import { hmac } from "./hmac.js"; -import { ahash, anumber, clean, toBytes } from "./utils.js"; -/** - * HKDF-extract from spec. Less important part. `HKDF-Extract(IKM, salt) -> PRK` - * Arguments position differs from spec (IKM is first one, since it is not optional) - * @param hash - hash function that would be used (e.g. sha256) - * @param ikm - input keying material, the initial key - * @param salt - optional salt value (a non-secret random value) - */ -export function extract(hash, ikm, salt) { - ahash(hash); - // NOTE: some libraries treat zero-length array as 'not provided'; - // we don't, since we have undefined as 'not provided' - // https://github.com/RustCrypto/KDFs/issues/15 - if (salt === undefined) - salt = new Uint8Array(hash.outputLen); - return hmac(hash, toBytes(salt), toBytes(ikm)); -} -const HKDF_COUNTER = /* @__PURE__ */ Uint8Array.from([0]); -const EMPTY_BUFFER = /* @__PURE__ */ Uint8Array.of(); -/** - * HKDF-expand from the spec. The most important part. `HKDF-Expand(PRK, info, L) -> OKM` - * @param hash - hash function that would be used (e.g. sha256) - * @param prk - a pseudorandom key of at least HashLen octets (usually, the output from the extract step) - * @param info - optional context and application specific information (can be a zero-length string) - * @param length - length of output keying material in bytes - */ -export function expand(hash, prk, info, length = 32) { - ahash(hash); - anumber(length); - const olen = hash.outputLen; - if (length > 255 * olen) - throw new Error('Length should be <= 255*HashLen'); - const blocks = Math.ceil(length / olen); - if (info === undefined) - info = EMPTY_BUFFER; - // first L(ength) octets of T - const okm = new Uint8Array(blocks * olen); - // Re-use HMAC instance between blocks - const HMAC = hmac.create(hash, prk); - const HMACTmp = HMAC._cloneInto(); - const T = new Uint8Array(HMAC.outputLen); - for (let counter = 0; counter < blocks; counter++) { - HKDF_COUNTER[0] = counter + 1; - // T(0) = empty string (zero length) - // T(N) = HMAC-Hash(PRK, T(N-1) | info | N) - HMACTmp.update(counter === 0 ? EMPTY_BUFFER : T) - .update(info) - .update(HKDF_COUNTER) - .digestInto(T); - okm.set(T, olen * counter); - HMAC._cloneInto(HMACTmp); - } - HMAC.destroy(); - HMACTmp.destroy(); - clean(T, HKDF_COUNTER); - return okm.slice(0, length); -} -/** - * HKDF (RFC 5869): derive keys from an initial input. - * Combines hkdf_extract + hkdf_expand in one step - * @param hash - hash function that would be used (e.g. sha256) - * @param ikm - input keying material, the initial key - * @param salt - optional salt value (a non-secret random value) - * @param info - optional context and application specific information (can be a zero-length string) - * @param length - length of output keying material in bytes - * @example - * import { hkdf } from '@noble/hashes/hkdf'; - * import { sha256 } from '@noble/hashes/sha2'; - * import { randomBytes } from '@noble/hashes/utils'; - * const inputKey = randomBytes(32); - * const salt = randomBytes(32); - * const info = 'application-key'; - * const hk1 = hkdf(sha256, inputKey, salt, info, 32); - */ -export const hkdf = (hash, ikm, salt, info, length) => expand(hash, extract(hash, ikm, salt), info, length); -//# sourceMappingURL=hkdf.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/hkdf.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/hkdf.js.map deleted file mode 100644 index 8984004f..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/hkdf.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hkdf.js","sourceRoot":"","sources":["../src/hkdf.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE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pC,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;IAClC,MAAM,CAAC,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACzC,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC;QAClD,YAAY,CAAC,CAAC,CAAC,GAAG,OAAO,GAAG,CAAC,CAAC;QAC9B,oCAAoC;QACpC,2CAA2C;QAC3C,OAAO,CAAC,MAAM,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;aAC7C,MAAM,CAAC,IAAI,CAAC;aACZ,MAAM,CAAC,YAAY,CAAC;aACpB,UAAU,CAAC,CAAC,CAAC,CAAC;QACjB,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC,CAAC;QAC3B,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;IACD,IAAI,CAAC,OAAO,EAAE,CAAC;IACf,OAAO,CAAC,OAAO,EAAE,CAAC;IAClB,KAAK,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;IACvB,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AAC9B,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAClB,IAAW,EACX,GAAU,EACV,IAAuB,EACvB,IAAuB,EACvB,MAAc,EACF,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/hmac.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/esm/hmac.d.ts deleted file mode 100644 index 86525f93..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/hmac.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * HMAC: RFC2104 message authentication code. - * @module - */ -import { Hash, type CHash, type Input } from './utils.ts'; -export declare class HMAC> extends Hash> { - oHash: T; - iHash: T; - blockLen: number; - outputLen: number; - private finished; - private destroyed; - constructor(hash: CHash, _key: Input); - update(buf: Input): this; - digestInto(out: Uint8Array): void; - digest(): Uint8Array; - _cloneInto(to?: HMAC): HMAC; - clone(): HMAC; - destroy(): void; -} -/** - * HMAC: RFC2104 message authentication code. - * @param hash - function that would be used e.g. sha256 - * @param key - message key - * @param message - message data - * @example - * import { hmac } from '@noble/hashes/hmac'; - * import { sha256 } from '@noble/hashes/sha2'; - * const mac1 = hmac(sha256, 'key', 'message'); - */ -export declare const hmac: { - (hash: CHash, key: Input, message: Input): Uint8Array; - create(hash: CHash, key: Input): HMAC; -}; -//# sourceMappingURL=hmac.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/hmac.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/hmac.d.ts.map deleted file mode 100644 index 7cea37df..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/hmac.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hmac.d.ts","sourceRoot":"","sources":["../src/hmac.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAiC,IAAI,EAAW,KAAK,KAAK,EAAE,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAElG,qBAAa,IAAI,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,CAAC,CAAE,SAAQ,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACxD,KAAK,EAAE,CAAC,CAAC;IACT,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,SAAS,CAAS;gBAEd,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK;IAsBpC,MAAM,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI;IAKxB,UAAU,CAAC,GAAG,EAAE,UAAU,GAAG,IAAI;IASjC,MAAM,IAAI,UAAU;IAKpB,UAAU,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;IAajC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC;IAGhB,OAAO,IAAI,IAAI;CAKhB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,IAAI,EAAE;IACjB,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,GAAG,UAAU,CAAC;IACtD,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;CAEM,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/hmac.js b/tools/mnemonic-test/node_modules/@noble/hashes/esm/hmac.js deleted file mode 100644 index 4636246b..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/hmac.js +++ /dev/null @@ -1,86 +0,0 @@ -/** - * HMAC: RFC2104 message authentication code. - * @module - */ -import { abytes, aexists, ahash, clean, Hash, toBytes } from "./utils.js"; -export class HMAC extends Hash { - constructor(hash, _key) { - super(); - this.finished = false; - this.destroyed = false; - ahash(hash); - const key = toBytes(_key); - this.iHash = hash.create(); - if (typeof this.iHash.update !== 'function') - throw new Error('Expected instance of class which extends utils.Hash'); - this.blockLen = this.iHash.blockLen; - this.outputLen = this.iHash.outputLen; - const blockLen = this.blockLen; - const pad = new Uint8Array(blockLen); - // blockLen can be bigger than outputLen - pad.set(key.length > blockLen ? hash.create().update(key).digest() : key); - for (let i = 0; i < pad.length; i++) - pad[i] ^= 0x36; - this.iHash.update(pad); - // By doing update (processing of first block) of outer hash here we can re-use it between multiple calls via clone - this.oHash = hash.create(); - // Undo internal XOR && apply outer XOR - for (let i = 0; i < pad.length; i++) - pad[i] ^= 0x36 ^ 0x5c; - this.oHash.update(pad); - clean(pad); - } - update(buf) { - aexists(this); - this.iHash.update(buf); - return this; - } - digestInto(out) { - aexists(this); - abytes(out, this.outputLen); - this.finished = true; - this.iHash.digestInto(out); - this.oHash.update(out); - this.oHash.digestInto(out); - this.destroy(); - } - digest() { - const out = new Uint8Array(this.oHash.outputLen); - this.digestInto(out); - return out; - } - _cloneInto(to) { - // Create new instance without calling constructor since key already in state and we don't know it. - to || (to = Object.create(Object.getPrototypeOf(this), {})); - const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this; - to = to; - to.finished = finished; - to.destroyed = destroyed; - to.blockLen = blockLen; - to.outputLen = outputLen; - to.oHash = oHash._cloneInto(to.oHash); - to.iHash = iHash._cloneInto(to.iHash); - return to; - } - clone() { - return this._cloneInto(); - } - destroy() { - this.destroyed = true; - this.oHash.destroy(); - this.iHash.destroy(); - } -} -/** - * HMAC: RFC2104 message authentication code. - * @param hash - function that would be used e.g. sha256 - * @param key - message key - * @param message - message data - * @example - * import { hmac } from '@noble/hashes/hmac'; - * import { sha256 } from '@noble/hashes/sha2'; - * const mac1 = hmac(sha256, 'key', 'message'); - */ -export const hmac = (hash, key, message) => new HMAC(hash, key).update(message).digest(); -hmac.create = (hash, key) => new HMAC(hash, key); -//# sourceMappingURL=hmac.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/hmac.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/hmac.js.map deleted file mode 100644 index dc621aa9..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/hmac.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hmac.js","sourceRoot":"","sources":["../src/hmac.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,EAAE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GAAG,IAAI,CAAC;QACxE,EAAE,GAAG,EAAU,CAAC;QAChB,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACvB,EAAE,CAAC,SAAS,GAAG,SAAS,CAAC;QACzB,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACvB,EAAE,CAAC,SAAS,GAAG,SAAS,CAAC;QACzB,EAAE,CAAC,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;QACtC,EAAE,CAAC,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;QACtC,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,KAAK;QACH,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;IAC3B,CAAC;IACD,OAAO;QACL,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QACrB,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;IACvB,CAAC;CACF;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,IAAI,GAGb,CAAC,IAAW,EAAE,GAAU,EAAE,OAAc,EAAc,EAAE,CAC1D,IAAI,IAAI,CAAM,IAAI,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC;AACpD,IAAI,CAAC,MAAM,GAAG,CAAC,IAAW,EAAE,GAAU,EAAE,EAAE,CAAC,IAAI,IAAI,CAAM,IAAI,EAAE,GAAG,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/index.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/esm/index.d.ts deleted file mode 100644 index e26a57a8..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/index.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/index.d.ts.map deleted file mode 100644 index 535b86d2..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/index.js b/tools/mnemonic-test/node_modules/@noble/hashes/esm/index.js deleted file mode 100644 index 3a2f1758..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/index.js +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Audited & minimal JS implementation of hash functions, MACs and KDFs. Check out individual modules. - * @module - * @example -```js -import { - sha256, sha384, sha512, sha224, sha512_224, sha512_256 -} from '@noble/hashes/sha2'; -import { - sha3_224, sha3_256, sha3_384, sha3_512, - keccak_224, keccak_256, keccak_384, keccak_512, - shake128, shake256 -} from '@noble/hashes/sha3'; -import { - cshake128, cshake256, - turboshake128, turboshake256, - kmac128, kmac256, - tuplehash256, parallelhash256, - k12, m14, keccakprg -} from '@noble/hashes/sha3-addons'; -import { blake3 } from '@noble/hashes/blake3'; -import { blake2b, blake2s } from '@noble/hashes/blake2'; -import { hmac } from '@noble/hashes/hmac'; -import { hkdf } from '@noble/hashes/hkdf'; -import { pbkdf2, pbkdf2Async } from '@noble/hashes/pbkdf2'; -import { scrypt, scryptAsync } from '@noble/hashes/scrypt'; -import { md5, ripemd160, sha1 } from '@noble/hashes/legacy'; -import * as utils from '@noble/hashes/utils'; -``` - */ -throw new Error('root module cannot be imported: import submodules instead. Check out README'); -export {}; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/index.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/index.js.map deleted file mode 100644 index 2b0c4cad..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,IAAI,KAAK,CAAC,6EAA6E,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/legacy.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/esm/legacy.d.ts deleted file mode 100644 index 39c2632d..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/legacy.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -/** - -SHA1 (RFC 3174), MD5 (RFC 1321) and RIPEMD160 (RFC 2286) legacy, weak hash functions. -Don't use them in a new protocol. What "weak" means: - -- Collisions can be made with 2^18 effort in MD5, 2^60 in SHA1, 2^80 in RIPEMD160. -- No practical pre-image attacks (only theoretical, 2^123.4) -- HMAC seems kinda ok: https://datatracker.ietf.org/doc/html/rfc6151 - * @module - */ -import { HashMD } from './_md.ts'; -import { type CHash } from './utils.ts'; -/** SHA1 legacy hash class. */ -export declare class SHA1 extends HashMD { - private A; - private B; - private C; - private D; - private E; - constructor(); - protected get(): [number, number, number, number, number]; - protected set(A: number, B: number, C: number, D: number, E: number): void; - protected process(view: DataView, offset: number): void; - protected roundClean(): void; - destroy(): void; -} -/** SHA1 (RFC 3174) legacy hash function. It was cryptographically broken. */ -export declare const sha1: CHash; -/** MD5 legacy hash class. */ -export declare class MD5 extends HashMD { - private A; - private B; - private C; - private D; - constructor(); - protected get(): [number, number, number, number]; - protected set(A: number, B: number, C: number, D: number): void; - protected process(view: DataView, offset: number): void; - protected roundClean(): void; - destroy(): void; -} -/** - * MD5 (RFC 1321) legacy hash function. It was cryptographically broken. - * MD5 architecture is similar to SHA1, with some differences: - * - Reduced output length: 16 bytes (128 bit) instead of 20 - * - 64 rounds, instead of 80 - * - Little-endian: could be faster, but will require more code - * - Non-linear index selection: huge speed-up for unroll - * - Per round constants: more memory accesses, additional speed-up for unroll - */ -export declare const md5: CHash; -export declare class RIPEMD160 extends HashMD { - private h0; - private h1; - private h2; - private h3; - private h4; - constructor(); - protected get(): [number, number, number, number, number]; - protected set(h0: number, h1: number, h2: number, h3: number, h4: number): void; - protected process(view: DataView, offset: number): void; - protected roundClean(): void; - destroy(): void; -} -/** - * RIPEMD-160 - a legacy hash function from 1990s. - * * https://homes.esat.kuleuven.be/~bosselae/ripemd160.html - * * https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf - */ -export declare const ripemd160: CHash; -//# sourceMappingURL=legacy.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/legacy.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/legacy.d.ts.map deleted file mode 100644 index 68a8353f..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/legacy.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"legacy.d.ts","sourceRoot":"","sources":["../src/legacy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAO,MAAM,EAAO,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,KAAK,KAAK,EAA6B,MAAM,YAAY,CAAC;AAUnE,8BAA8B;AAC9B,qBAAa,IAAK,SAAQ,MAAM,CAAC,IAAI,CAAC;IACpC,OAAO,CAAC,CAAC,CAAkB;IAC3B,OAAO,CAAC,CAAC,CAAkB;IAC3B,OAAO,CAAC,CAAC,CAAkB;IAC3B,OAAO,CAAC,CAAC,CAAkB;IAC3B,OAAO,CAAC,CAAC,CAAkB;;IAK3B,SAAS,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;IAIzD,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,E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AC;IAIzD,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI;IAO/E,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAmCvD,SAAS,CAAC,UAAU,IAAI,IAAI;IAG5B,OAAO,IAAI,IAAI;CAKhB;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,KAA2D,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/legacy.js b/tools/mnemonic-test/node_modules/@noble/hashes/esm/legacy.js deleted file mode 100644 index 7067dca1..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/legacy.js +++ /dev/null @@ -1,281 +0,0 @@ -/** - -SHA1 (RFC 3174), MD5 (RFC 1321) and RIPEMD160 (RFC 2286) legacy, weak hash functions. -Don't use them in a new protocol. What "weak" means: - -- Collisions can be made with 2^18 effort in MD5, 2^60 in SHA1, 2^80 in RIPEMD160. -- No practical pre-image attacks (only theoretical, 2^123.4) -- HMAC seems kinda ok: https://datatracker.ietf.org/doc/html/rfc6151 - * @module - */ -import { Chi, HashMD, Maj } from "./_md.js"; -import { clean, createHasher, rotl } from "./utils.js"; -/** Initial SHA1 state */ -const SHA1_IV = /* @__PURE__ */ Uint32Array.from([ - 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0, -]); -// Reusable temporary buffer -const SHA1_W = /* @__PURE__ */ new Uint32Array(80); -/** SHA1 legacy hash class. */ -export class SHA1 extends HashMD { - constructor() { - super(64, 20, 8, false); - this.A = SHA1_IV[0] | 0; - this.B = SHA1_IV[1] | 0; - this.C = SHA1_IV[2] | 0; - this.D = SHA1_IV[3] | 0; - this.E = SHA1_IV[4] | 0; - } - get() { - const { A, B, C, D, E } = this; - return [A, B, C, D, E]; - } - set(A, B, C, D, E) { - this.A = A | 0; - this.B = B | 0; - this.C = C | 0; - this.D = D | 0; - this.E = E | 0; - } - process(view, offset) { - for (let i = 0; i < 16; i++, offset += 4) - SHA1_W[i] = view.getUint32(offset, false); - for (let i = 16; i < 80; i++) - SHA1_W[i] = rotl(SHA1_W[i - 3] ^ SHA1_W[i - 8] ^ SHA1_W[i - 14] ^ SHA1_W[i - 16], 1); - // Compression function main loop, 80 rounds - let { A, B, C, D, E } = this; - for (let i = 0; i < 80; i++) { - let F, K; - if (i < 20) { - F = Chi(B, C, D); - K = 0x5a827999; - } - else if (i < 40) { - F = B ^ C ^ D; - K = 0x6ed9eba1; - } - else if (i < 60) { - F = Maj(B, C, D); - K = 0x8f1bbcdc; - } - else { - F = B ^ C ^ D; - K = 0xca62c1d6; - } - const T = (rotl(A, 5) + F + E + K + SHA1_W[i]) | 0; - E = D; - D = C; - C = rotl(B, 30); - B = A; - A = T; - } - // Add the compressed chunk to the current hash value - A = (A + this.A) | 0; - B = (B + this.B) | 0; - C = (C + this.C) | 0; - D = (D + this.D) | 0; - E = (E + this.E) | 0; - this.set(A, B, C, D, E); - } - roundClean() { - clean(SHA1_W); - } - destroy() { - this.set(0, 0, 0, 0, 0); - clean(this.buffer); - } -} -/** SHA1 (RFC 3174) legacy hash function. It was cryptographically broken. */ -export const sha1 = /* @__PURE__ */ createHasher(() => new SHA1()); -/** Per-round constants */ -const p32 = /* @__PURE__ */ Math.pow(2, 32); -const K = /* @__PURE__ */ Array.from({ length: 64 }, (_, i) => Math.floor(p32 * Math.abs(Math.sin(i + 1)))); -/** md5 initial state: same as sha1, but 4 u32 instead of 5. */ -const MD5_IV = /* @__PURE__ */ SHA1_IV.slice(0, 4); -// Reusable temporary buffer -const MD5_W = /* @__PURE__ */ new Uint32Array(16); -/** MD5 legacy hash class. */ -export class MD5 extends HashMD { - constructor() { - super(64, 16, 8, true); - this.A = MD5_IV[0] | 0; - this.B = MD5_IV[1] | 0; - this.C = MD5_IV[2] | 0; - this.D = MD5_IV[3] | 0; - } - get() { - const { A, B, C, D } = this; - return [A, B, C, D]; - } - set(A, B, C, D) { - this.A = A | 0; - this.B = B | 0; - this.C = C | 0; - this.D = D | 0; - } - process(view, offset) { - for (let i = 0; i < 16; i++, offset += 4) - MD5_W[i] = view.getUint32(offset, true); - // Compression function main loop, 64 rounds - let { A, B, C, D } = this; - for (let i = 0; i < 64; i++) { - let F, g, s; - if (i < 16) { - F = Chi(B, C, D); - g = i; - s = [7, 12, 17, 22]; - } - else if (i < 32) { - F = Chi(D, B, C); - g = (5 * i + 1) % 16; - s = [5, 9, 14, 20]; - } - else if (i < 48) { - F = B ^ C ^ D; - g = (3 * i + 5) % 16; - s = [4, 11, 16, 23]; - } - else { - F = C ^ (B | ~D); - g = (7 * i) % 16; - s = [6, 10, 15, 21]; - } - F = F + A + K[i] + MD5_W[g]; - A = D; - D = C; - C = B; - B = B + rotl(F, s[i % 4]); - } - // Add the compressed chunk to the current hash value - A = (A + this.A) | 0; - B = (B + this.B) | 0; - C = (C + this.C) | 0; - D = (D + this.D) | 0; - this.set(A, B, C, D); - } - roundClean() { - clean(MD5_W); - } - destroy() { - this.set(0, 0, 0, 0); - clean(this.buffer); - } -} -/** - * MD5 (RFC 1321) legacy hash function. It was cryptographically broken. - * MD5 architecture is similar to SHA1, with some differences: - * - Reduced output length: 16 bytes (128 bit) instead of 20 - * - 64 rounds, instead of 80 - * - Little-endian: could be faster, but will require more code - * - Non-linear index selection: huge speed-up for unroll - * - Per round constants: more memory accesses, additional speed-up for unroll - */ -export const md5 = /* @__PURE__ */ createHasher(() => new MD5()); -// RIPEMD-160 -const Rho160 = /* @__PURE__ */ Uint8Array.from([ - 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, -]); -const Id160 = /* @__PURE__ */ (() => Uint8Array.from(new Array(16).fill(0).map((_, i) => i)))(); -const Pi160 = /* @__PURE__ */ (() => Id160.map((i) => (9 * i + 5) % 16))(); -const idxLR = /* @__PURE__ */ (() => { - const L = [Id160]; - const R = [Pi160]; - const res = [L, R]; - for (let i = 0; i < 4; i++) - for (let j of res) - j.push(j[i].map((k) => Rho160[k])); - return res; -})(); -const idxL = /* @__PURE__ */ (() => idxLR[0])(); -const idxR = /* @__PURE__ */ (() => idxLR[1])(); -// const [idxL, idxR] = idxLR; -const shifts160 = /* @__PURE__ */ [ - [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8], - [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7], - [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9], - [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6], - [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5], -].map((i) => Uint8Array.from(i)); -const shiftsL160 = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts160[i][j])); -const shiftsR160 = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts160[i][j])); -const Kl160 = /* @__PURE__ */ Uint32Array.from([ - 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e, -]); -const Kr160 = /* @__PURE__ */ Uint32Array.from([ - 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000, -]); -// It's called f() in spec. -function ripemd_f(group, x, y, z) { - if (group === 0) - return x ^ y ^ z; - if (group === 1) - return (x & y) | (~x & z); - if (group === 2) - return (x | ~y) ^ z; - if (group === 3) - return (x & z) | (y & ~z); - return x ^ (y | ~z); -} -// Reusable temporary buffer -const BUF_160 = /* @__PURE__ */ new Uint32Array(16); -export class RIPEMD160 extends HashMD { - constructor() { - super(64, 20, 8, true); - this.h0 = 0x67452301 | 0; - this.h1 = 0xefcdab89 | 0; - this.h2 = 0x98badcfe | 0; - this.h3 = 0x10325476 | 0; - this.h4 = 0xc3d2e1f0 | 0; - } - get() { - const { h0, h1, h2, h3, h4 } = this; - return [h0, h1, h2, h3, h4]; - } - set(h0, h1, h2, h3, h4) { - this.h0 = h0 | 0; - this.h1 = h1 | 0; - this.h2 = h2 | 0; - this.h3 = h3 | 0; - this.h4 = h4 | 0; - } - process(view, offset) { - for (let i = 0; i < 16; i++, offset += 4) - BUF_160[i] = view.getUint32(offset, true); - // prettier-ignore - let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el; - // Instead of iterating 0 to 80, we split it into 5 groups - // And use the groups in constants, functions, etc. Much simpler - for (let group = 0; group < 5; group++) { - const rGroup = 4 - group; - const hbl = Kl160[group], hbr = Kr160[group]; // prettier-ignore - const rl = idxL[group], rr = idxR[group]; // prettier-ignore - const sl = shiftsL160[group], sr = shiftsR160[group]; // prettier-ignore - for (let i = 0; i < 16; i++) { - const tl = (rotl(al + ripemd_f(group, bl, cl, dl) + BUF_160[rl[i]] + hbl, sl[i]) + el) | 0; - al = el, el = dl, dl = rotl(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore - } - // 2 loops are 10% faster - for (let i = 0; i < 16; i++) { - const tr = (rotl(ar + ripemd_f(rGroup, br, cr, dr) + BUF_160[rr[i]] + hbr, sr[i]) + er) | 0; - ar = er, er = dr, dr = rotl(cr, 10) | 0, cr = br, br = tr; // prettier-ignore - } - } - // Add the compressed chunk to the current hash value - this.set((this.h1 + cl + dr) | 0, (this.h2 + dl + er) | 0, (this.h3 + el + ar) | 0, (this.h4 + al + br) | 0, (this.h0 + bl + cr) | 0); - } - roundClean() { - clean(BUF_160); - } - destroy() { - this.destroyed = true; - clean(this.buffer); - this.set(0, 0, 0, 0, 0); - } -} -/** - * RIPEMD-160 - a legacy hash function from 1990s. - * * https://homes.esat.kuleuven.be/~bosselae/ripemd160.html - * * https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf - */ -export const ripemd160 = /* @__PURE__ */ createHasher(() => new RIPEMD160()); -//# sourceMappingURL=legacy.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/legacy.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/legacy.js.map deleted file mode 100644 index c47bea78..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/legacy.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"legacy.js","sourceRoot":"","sources":["../src/legacy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAc,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEnE,yBAAyB;AACzB,MAAM,OAAO,GAAG,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC;IAC/C,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;CAC3D,CAAC,CAAC;AAEH,4BAA4B;AAC5B,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,WAAW,CAAC,EAAE,CAAC,CAAC;AAEnD,8BAA8B;AAC9B,MAAM,OAAO,IAAK,SAAQ,MAAY;IAOpC;QACE,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;QAPlB,MAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACnB,MAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACnB,MAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACnB,MAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACnB,MAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAI3B,CAAC;IACS,GAAG;QAC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AAC,CAAC;QACnB,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1B,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAU,eAAe,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/package.json b/tools/mnemonic-test/node_modules/@noble/hashes/esm/package.json deleted file mode 100644 index f42e46b1..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "module", - "sideEffects": false, - "browser": { - "node:crypto": false - }, - "node": { - "./crypto": "./esm/cryptoNode.js" - } -} diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/pbkdf2.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/esm/pbkdf2.d.ts deleted file mode 100644 index 0697c694..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/pbkdf2.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { type CHash, type KDFInput } from './utils.ts'; -export type Pbkdf2Opt = { - c: number; - dkLen?: number; - asyncTick?: number; -}; -/** - * PBKDF2-HMAC: RFC 2898 key derivation function - * @param hash - hash function that would be used e.g. sha256 - * @param password - password from which a derived key is generated - * @param salt - cryptographic salt - * @param opts - {c, dkLen} where c is work factor and dkLen is output message size - * @example - * const key = pbkdf2(sha256, 'password', 'salt', { dkLen: 32, c: Math.pow(2, 18) }); - */ -export declare function pbkdf2(hash: CHash, password: KDFInput, salt: KDFInput, opts: Pbkdf2Opt): Uint8Array; -/** - * PBKDF2-HMAC: RFC 2898 key derivation function. Async version. - * @example - * await pbkdf2Async(sha256, 'password', 'salt', { dkLen: 32, c: 500_000 }); - */ -export declare function pbkdf2Async(hash: CHash, password: KDFInput, salt: KDFInput, opts: Pbkdf2Opt): Promise; -//# sourceMappingURL=pbkdf2.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/pbkdf2.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/pbkdf2.d.ts.map deleted file mode 100644 index 033d374f..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/pbkdf2.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pbkdf2.d.ts","sourceRoot":"","sources":["../src/pbkdf2.ts"],"names":[],"mappings":"AAMA,OAAO,EAGL,KAAK,KAAK,EACV,KAAK,QAAQ,EACd,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,SAAS,GAAG;IACtB,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAkCF;;;;;;;;GAQG;AACH,wBAAgB,MAAM,CACpB,IAAI,EAAE,KAAK,EACX,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,SAAS,GACd,UAAU,CAsBZ;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,KAAK,EACX,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,SAAS,GACd,OAAO,CAAC,UAAU,CAAC,CAsBrB"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/pbkdf2.js b/tools/mnemonic-test/node_modules/@noble/hashes/esm/pbkdf2.js deleted file mode 100644 index 42e78dc8..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/pbkdf2.js +++ /dev/null @@ -1,97 +0,0 @@ -/** - * PBKDF (RFC 2898). Can be used to create a key from password and salt. - * @module - */ -import { hmac } from "./hmac.js"; -// prettier-ignore -import { ahash, anumber, asyncLoop, checkOpts, clean, createView, Hash, kdfInputToBytes } from "./utils.js"; -// Common prologue and epilogue for sync/async functions -function pbkdf2Init(hash, _password, _salt, _opts) { - ahash(hash); - const opts = checkOpts({ dkLen: 32, asyncTick: 10 }, _opts); - const { c, dkLen, asyncTick } = opts; - anumber(c); - anumber(dkLen); - anumber(asyncTick); - if (c < 1) - throw new Error('iterations (c) should be >= 1'); - const password = kdfInputToBytes(_password); - const salt = kdfInputToBytes(_salt); - // DK = PBKDF2(PRF, Password, Salt, c, dkLen); - const DK = new Uint8Array(dkLen); - // U1 = PRF(Password, Salt + INT_32_BE(i)) - const PRF = hmac.create(hash, password); - const PRFSalt = PRF._cloneInto().update(salt); - return { c, dkLen, asyncTick, DK, PRF, PRFSalt }; -} -function pbkdf2Output(PRF, PRFSalt, DK, prfW, u) { - PRF.destroy(); - PRFSalt.destroy(); - if (prfW) - prfW.destroy(); - clean(u); - return DK; -} -/** - * PBKDF2-HMAC: RFC 2898 key derivation function - * @param hash - hash function that would be used e.g. sha256 - * @param password - password from which a derived key is generated - * @param salt - cryptographic salt - * @param opts - {c, dkLen} where c is work factor and dkLen is output message size - * @example - * const key = pbkdf2(sha256, 'password', 'salt', { dkLen: 32, c: Math.pow(2, 18) }); - */ -export function pbkdf2(hash, password, salt, opts) { - const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts); - let prfW; // Working copy - const arr = new Uint8Array(4); - const view = createView(arr); - const u = new Uint8Array(PRF.outputLen); - // DK = T1 + T2 + ⋯ + Tdklen/hlen - for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { - // Ti = F(Password, Salt, c, i) - const Ti = DK.subarray(pos, pos + PRF.outputLen); - view.setInt32(0, ti, false); - // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc - // U1 = PRF(Password, Salt + INT_32_BE(i)) - (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); - Ti.set(u.subarray(0, Ti.length)); - for (let ui = 1; ui < c; ui++) { - // Uc = PRF(Password, Uc−1) - PRF._cloneInto(prfW).update(u).digestInto(u); - for (let i = 0; i < Ti.length; i++) - Ti[i] ^= u[i]; - } - } - return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); -} -/** - * PBKDF2-HMAC: RFC 2898 key derivation function. Async version. - * @example - * await pbkdf2Async(sha256, 'password', 'salt', { dkLen: 32, c: 500_000 }); - */ -export async function pbkdf2Async(hash, password, salt, opts) { - const { c, dkLen, asyncTick, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts); - let prfW; // Working copy - const arr = new Uint8Array(4); - const view = createView(arr); - const u = new Uint8Array(PRF.outputLen); - // DK = T1 + T2 + ⋯ + Tdklen/hlen - for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { - // Ti = F(Password, Salt, c, i) - const Ti = DK.subarray(pos, pos + PRF.outputLen); - view.setInt32(0, ti, false); - // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc - // U1 = PRF(Password, Salt + INT_32_BE(i)) - (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); - Ti.set(u.subarray(0, Ti.length)); - await asyncLoop(c - 1, asyncTick, () => { - // Uc = PRF(Password, Uc−1) - PRF._cloneInto(prfW).update(u).digestInto(u); - for (let i = 0; i < Ti.length; i++) - Ti[i] ^= u[i]; - }); - } - return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); -} -//# sourceMappingURL=pbkdf2.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/pbkdf2.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/pbkdf2.js.map deleted file mode 100644 index 01ffaed8..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/pbkdf2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pbkdf2.js","sourceRoot":"","sources":["../src/pbkdf2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,kBAAk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E,GAAG,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC;QACjD,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;QAC5B,6CAA6C;QAC7C,0CAA0C;QAC1C,CAAC,IAAI,GAAG,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAC5D,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;QACjC,MAAM,SAAS,CAAC,CAAC,GAAG,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE;YACrC,2BAA2B;YAC3B,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YAC7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE;gBAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;IACL,CAAC;IACD,OAAO,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACjD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/ripemd160.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/esm/ripemd160.d.ts deleted file mode 100644 index 2fb0fa7a..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/ripemd160.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * RIPEMD-160 legacy hash function. - * https://homes.esat.kuleuven.be/~bosselae/ripemd160.html - * https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf - * @module - * @deprecated - */ -import { RIPEMD160 as RIPEMD160n, ripemd160 as ripemd160n } from './legacy.ts'; -/** @deprecated Use import from `noble/hashes/legacy` module */ -export declare const RIPEMD160: typeof RIPEMD160n; -/** @deprecated Use import from `noble/hashes/legacy` module */ -export declare const ripemd160: typeof ripemd160n; -//# sourceMappingURL=ripemd160.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/ripemd160.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/ripemd160.d.ts.map deleted file mode 100644 index a04f75b5..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/ripemd160.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ripemd160.d.ts","sourceRoot":"","sources":["../src/ripemd160.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,SAAS,IAAI,UAAU,EAAE,SAAS,IAAI,UAAU,EAAE,MAAM,aAAa,CAAC;AAC/E,+DAA+D;AAC/D,eAAO,MAAM,SAAS,EAAE,OAAO,UAAuB,CAAC;AACvD,+DAA+D;AAC/D,eAAO,MAAM,SAAS,EAAE,OAAO,UAAuB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/ripemd160.js b/tools/mnemonic-test/node_modules/@noble/hashes/esm/ripemd160.js deleted file mode 100644 index cdcac9b9..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/ripemd160.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * RIPEMD-160 legacy hash function. - * https://homes.esat.kuleuven.be/~bosselae/ripemd160.html - * https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf - * @module - * @deprecated - */ -import { RIPEMD160 as RIPEMD160n, ripemd160 as ripemd160n } from "./legacy.js"; -/** @deprecated Use import from `noble/hashes/legacy` module */ -export const RIPEMD160 = RIPEMD160n; -/** @deprecated Use import from `noble/hashes/legacy` module */ -export const ripemd160 = ripemd160n; -//# sourceMappingURL=ripemd160.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/ripemd160.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/ripemd160.js.map deleted file mode 100644 index 82324f44..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/ripemd160.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ripemd160.js","sourceRoot":"","sources":["../src/ripemd160.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,SAAS,IAAI,UAAU,EAAE,SAAS,IAAI,UAAU,EAAE,MAAM,aAAa,CAAC;AAC/E,+DAA+D;AAC/D,MAAM,CAAC,MAAM,SAAS,GAAsB,UAAU,CAAC;AACvD,+DAA+D;AAC/D,MAAM,CAAC,MAAM,SAAS,GAAsB,UAAU,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/scrypt.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/esm/scrypt.d.ts deleted file mode 100644 index 38d0ef97..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/scrypt.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { type KDFInput } from './utils.ts'; -export type ScryptOpts = { - N: number; - r: number; - p: number; - dkLen?: number; - asyncTick?: number; - maxmem?: number; - onProgress?: (progress: number) => void; -}; -/** - * Scrypt KDF from RFC 7914. - * @param password - pass - * @param salt - salt - * @param opts - parameters - * - `N` is cpu/mem work factor (power of 2 e.g. 2**18) - * - `r` is block size (8 is common), fine-tunes sequential memory read size and performance - * - `p` is parallelization factor (1 is common) - * - `dkLen` is output key length in bytes e.g. 32. - * - `asyncTick` - (default: 10) max time in ms for which async function can block execution - * - `maxmem` - (default: `1024 ** 3 + 1024` aka 1GB+1KB). A limit that the app could use for scrypt - * - `onProgress` - callback function that would be executed for progress report - * @returns Derived key - * @example - * scrypt('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 }); - */ -export declare function scrypt(password: KDFInput, salt: KDFInput, opts: ScryptOpts): Uint8Array; -/** - * Scrypt KDF from RFC 7914. Async version. - * @example - * await scryptAsync('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 }); - */ -export declare function scryptAsync(password: KDFInput, salt: KDFInput, opts: ScryptOpts): Promise; -//# sourceMappingURL=scrypt.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/scrypt.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/scrypt.d.ts.map deleted file mode 100644 index b47cc92a..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/scrypt.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"scrypt.d.ts","sourceRoot":"","sources":["../src/scrypt.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,KAAK,QAAQ,EAGd,MAAM,YAAY,CAAC;AAuEpB,MAAM,MAAM,UAAU,GAAG;IACvB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC,CAAC;AAoFF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,GAAG,UAAU,CA0BvF;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,UAAU,GACf,OAAO,CAAC,UAAU,CAAC,CA2BrB"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/scrypt.js b/tools/mnemonic-test/node_modules/@noble/hashes/esm/scrypt.js deleted file mode 100644 index 9b7e9a00..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/scrypt.js +++ /dev/null @@ -1,228 +0,0 @@ -/** - * RFC 7914 Scrypt KDF. Can be used to create a key from password and salt. - * @module - */ -import { pbkdf2 } from "./pbkdf2.js"; -import { sha256 } from "./sha2.js"; -// prettier-ignore -import { anumber, asyncLoop, checkOpts, clean, rotl, swap32IfBE, u32 } from "./utils.js"; -// The main Scrypt loop: uses Salsa extensively. -// Six versions of the function were tried, this is the fastest one. -// prettier-ignore -function XorAndSalsa(prev, pi, input, ii, out, oi) { - // Based on https://cr.yp.to/salsa20.html - // Xor blocks - let y00 = prev[pi++] ^ input[ii++], y01 = prev[pi++] ^ input[ii++]; - let y02 = prev[pi++] ^ input[ii++], y03 = prev[pi++] ^ input[ii++]; - let y04 = prev[pi++] ^ input[ii++], y05 = prev[pi++] ^ input[ii++]; - let y06 = prev[pi++] ^ input[ii++], y07 = prev[pi++] ^ input[ii++]; - let y08 = prev[pi++] ^ input[ii++], y09 = prev[pi++] ^ input[ii++]; - let y10 = prev[pi++] ^ input[ii++], y11 = prev[pi++] ^ input[ii++]; - let y12 = prev[pi++] ^ input[ii++], y13 = prev[pi++] ^ input[ii++]; - let y14 = prev[pi++] ^ input[ii++], y15 = prev[pi++] ^ input[ii++]; - // Save state to temporary variables (salsa) - let x00 = y00, x01 = y01, x02 = y02, x03 = y03, x04 = y04, x05 = y05, x06 = y06, x07 = y07, x08 = y08, x09 = y09, x10 = y10, x11 = y11, x12 = y12, x13 = y13, x14 = y14, x15 = y15; - // Main loop (salsa) - for (let i = 0; i < 8; i += 2) { - x04 ^= rotl(x00 + x12 | 0, 7); - x08 ^= rotl(x04 + x00 | 0, 9); - x12 ^= rotl(x08 + x04 | 0, 13); - x00 ^= rotl(x12 + x08 | 0, 18); - x09 ^= rotl(x05 + x01 | 0, 7); - x13 ^= rotl(x09 + x05 | 0, 9); - x01 ^= rotl(x13 + x09 | 0, 13); - x05 ^= rotl(x01 + x13 | 0, 18); - x14 ^= rotl(x10 + x06 | 0, 7); - x02 ^= rotl(x14 + x10 | 0, 9); - x06 ^= rotl(x02 + x14 | 0, 13); - x10 ^= rotl(x06 + x02 | 0, 18); - x03 ^= rotl(x15 + x11 | 0, 7); - x07 ^= rotl(x03 + x15 | 0, 9); - x11 ^= rotl(x07 + x03 | 0, 13); - x15 ^= rotl(x11 + x07 | 0, 18); - x01 ^= rotl(x00 + x03 | 0, 7); - x02 ^= rotl(x01 + x00 | 0, 9); - x03 ^= rotl(x02 + x01 | 0, 13); - x00 ^= rotl(x03 + x02 | 0, 18); - x06 ^= rotl(x05 + x04 | 0, 7); - x07 ^= rotl(x06 + x05 | 0, 9); - x04 ^= rotl(x07 + x06 | 0, 13); - x05 ^= rotl(x04 + x07 | 0, 18); - x11 ^= rotl(x10 + x09 | 0, 7); - x08 ^= rotl(x11 + x10 | 0, 9); - x09 ^= rotl(x08 + x11 | 0, 13); - x10 ^= rotl(x09 + x08 | 0, 18); - x12 ^= rotl(x15 + x14 | 0, 7); - x13 ^= rotl(x12 + x15 | 0, 9); - x14 ^= rotl(x13 + x12 | 0, 13); - x15 ^= rotl(x14 + x13 | 0, 18); - } - // Write output (salsa) - out[oi++] = (y00 + x00) | 0; - out[oi++] = (y01 + x01) | 0; - out[oi++] = (y02 + x02) | 0; - out[oi++] = (y03 + x03) | 0; - out[oi++] = (y04 + x04) | 0; - out[oi++] = (y05 + x05) | 0; - out[oi++] = (y06 + x06) | 0; - out[oi++] = (y07 + x07) | 0; - out[oi++] = (y08 + x08) | 0; - out[oi++] = (y09 + x09) | 0; - out[oi++] = (y10 + x10) | 0; - out[oi++] = (y11 + x11) | 0; - out[oi++] = (y12 + x12) | 0; - out[oi++] = (y13 + x13) | 0; - out[oi++] = (y14 + x14) | 0; - out[oi++] = (y15 + x15) | 0; -} -function BlockMix(input, ii, out, oi, r) { - // The block B is r 128-byte chunks (which is equivalent of 2r 64-byte chunks) - let head = oi + 0; - let tail = oi + 16 * r; - for (let i = 0; i < 16; i++) - out[tail + i] = input[ii + (2 * r - 1) * 16 + i]; // X ← B[2r−1] - for (let i = 0; i < r; i++, head += 16, ii += 16) { - // We write odd & even Yi at same time. Even: 0bXXXXX0 Odd: 0bXXXXX1 - XorAndSalsa(out, tail, input, ii, out, head); // head[i] = Salsa(blockIn[2*i] ^ tail[i-1]) - if (i > 0) - tail += 16; // First iteration overwrites tmp value in tail - XorAndSalsa(out, head, input, (ii += 16), out, tail); // tail[i] = Salsa(blockIn[2*i+1] ^ head[i]) - } -} -// Common prologue and epilogue for sync/async functions -function scryptInit(password, salt, _opts) { - // Maxmem - 1GB+1KB by default - const opts = checkOpts({ - dkLen: 32, - asyncTick: 10, - maxmem: 1024 ** 3 + 1024, - }, _opts); - const { N, r, p, dkLen, asyncTick, maxmem, onProgress } = opts; - anumber(N); - anumber(r); - anumber(p); - anumber(dkLen); - anumber(asyncTick); - anumber(maxmem); - if (onProgress !== undefined && typeof onProgress !== 'function') - throw new Error('progressCb should be function'); - const blockSize = 128 * r; - const blockSize32 = blockSize / 4; - // Max N is 2^32 (Integrify is 32-bit). Real limit is 2^22: JS engines Uint8Array limit is 4GB in 2024. - // Spec check `N >= 2^(blockSize / 8)` is not done for compat with popular libs, - // which used incorrect r: 1, p: 8. Also, the check seems to be a spec error: - // https://www.rfc-editor.org/errata_search.php?rfc=7914 - const pow32 = Math.pow(2, 32); - if (N <= 1 || (N & (N - 1)) !== 0 || N > pow32) { - throw new Error('Scrypt: N must be larger than 1, a power of 2, and less than 2^32'); - } - if (p < 0 || p > ((pow32 - 1) * 32) / blockSize) { - throw new Error('Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)'); - } - if (dkLen < 0 || dkLen > (pow32 - 1) * 32) { - throw new Error('Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32'); - } - const memUsed = blockSize * (N + p); - if (memUsed > maxmem) { - throw new Error('Scrypt: memused is bigger than maxMem. Expected 128 * r * (N + p) > maxmem of ' + maxmem); - } - // [B0...Bp−1] ← PBKDF2HMAC-SHA256(Passphrase, Salt, 1, blockSize*ParallelizationFactor) - // Since it has only one iteration there is no reason to use async variant - const B = pbkdf2(sha256, password, salt, { c: 1, dkLen: blockSize * p }); - const B32 = u32(B); - // Re-used between parallel iterations. Array(iterations) of B - const V = u32(new Uint8Array(blockSize * N)); - const tmp = u32(new Uint8Array(blockSize)); - let blockMixCb = () => { }; - if (onProgress) { - const totalBlockMix = 2 * N * p; - // Invoke callback if progress changes from 10.01 to 10.02 - // Allows to draw smooth progress bar on up to 8K screen - const callbackPer = Math.max(Math.floor(totalBlockMix / 10000), 1); - let blockMixCnt = 0; - blockMixCb = () => { - blockMixCnt++; - if (onProgress && (!(blockMixCnt % callbackPer) || blockMixCnt === totalBlockMix)) - onProgress(blockMixCnt / totalBlockMix); - }; - } - return { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick }; -} -function scryptOutput(password, dkLen, B, V, tmp) { - const res = pbkdf2(sha256, password, B, { c: 1, dkLen }); - clean(B, V, tmp); - return res; -} -/** - * Scrypt KDF from RFC 7914. - * @param password - pass - * @param salt - salt - * @param opts - parameters - * - `N` is cpu/mem work factor (power of 2 e.g. 2**18) - * - `r` is block size (8 is common), fine-tunes sequential memory read size and performance - * - `p` is parallelization factor (1 is common) - * - `dkLen` is output key length in bytes e.g. 32. - * - `asyncTick` - (default: 10) max time in ms for which async function can block execution - * - `maxmem` - (default: `1024 ** 3 + 1024` aka 1GB+1KB). A limit that the app could use for scrypt - * - `onProgress` - callback function that would be executed for progress report - * @returns Derived key - * @example - * scrypt('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 }); - */ -export function scrypt(password, salt, opts) { - const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb } = scryptInit(password, salt, opts); - swap32IfBE(B32); - for (let pi = 0; pi < p; pi++) { - const Pi = blockSize32 * pi; - for (let i = 0; i < blockSize32; i++) - V[i] = B32[Pi + i]; // V[0] = B[i] - for (let i = 0, pos = 0; i < N - 1; i++) { - BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]); - blockMixCb(); - } - BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element - blockMixCb(); - for (let i = 0; i < N; i++) { - // First u32 of the last 64-byte block (u32 is LE) - const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations - for (let k = 0; k < blockSize32; k++) - tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j] - BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) - blockMixCb(); - } - } - swap32IfBE(B32); - return scryptOutput(password, dkLen, B, V, tmp); -} -/** - * Scrypt KDF from RFC 7914. Async version. - * @example - * await scryptAsync('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 }); - */ -export async function scryptAsync(password, salt, opts) { - const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick } = scryptInit(password, salt, opts); - swap32IfBE(B32); - for (let pi = 0; pi < p; pi++) { - const Pi = blockSize32 * pi; - for (let i = 0; i < blockSize32; i++) - V[i] = B32[Pi + i]; // V[0] = B[i] - let pos = 0; - await asyncLoop(N - 1, asyncTick, () => { - BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]); - blockMixCb(); - }); - BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element - blockMixCb(); - await asyncLoop(N, asyncTick, () => { - // First u32 of the last 64-byte block (u32 is LE) - const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations - for (let k = 0; k < blockSize32; k++) - tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j] - BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) - blockMixCb(); - }); - } - swap32IfBE(B32); - return scryptOutput(password, dkLen, B, V, tmp); -} -//# sourceMappingURL=scrypt.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/scrypt.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/scrypt.js.map deleted file mode 100644 index cb5628bd..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/scrypt.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"scrypt.js","sourceRoot":"","sources":["../src/scrypt.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,kBAAkB;AAClB,OAAO,EACL,OAAO,EAAE,SAAS,EAClB,SAAS,EAAE,KAAK,EACD,IAAI,EACnB,UAAU,EACV,GAAG,EACJ,MAAM,YAAY,CAAC;AAEpB,gDAAgD;AAChD,oEAAoE;AACpE,kBAAkB;AAClB,SAAS,WAAW,CAClB,IAAiB,EACjB,EAAU,EACV,KAAkB,EAClB,EAAU,EACV,GAAgB,EAChB,EAAU;IAEV,yCAAyC;IACzC,aAAa;IACb,IAAI,GAAG,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,EAAE,EAAE,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;IACnE,IAAI,GAAG,GAAG,IAAI,CAAC,EAAE,EA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G,CAAC,CAAC;AAClD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha1.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha1.d.ts deleted file mode 100644 index 7c36b9f9..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha1.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * SHA1 (RFC 3174) legacy hash function. - * @module - * @deprecated - */ -import { SHA1 as SHA1n, sha1 as sha1n } from './legacy.ts'; -/** @deprecated Use import from `noble/hashes/legacy` module */ -export declare const SHA1: typeof SHA1n; -/** @deprecated Use import from `noble/hashes/legacy` module */ -export declare const sha1: typeof sha1n; -//# sourceMappingURL=sha1.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha1.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha1.d.ts.map deleted file mode 100644 index 908753db..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha1.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha1.d.ts","sourceRoot":"","sources":["../src/sha1.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,IAAI,IAAI,KAAK,EAAE,IAAI,IAAI,KAAK,EAAE,MAAM,aAAa,CAAC;AAC3D,+DAA+D;AAC/D,eAAO,MAAM,IAAI,EAAE,OAAO,KAAa,CAAC;AACxC,+DAA+D;AAC/D,eAAO,MAAM,IAAI,EAAE,OAAO,KAAa,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha1.js b/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha1.js deleted file mode 100644 index c8451df5..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha1.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * SHA1 (RFC 3174) legacy hash function. - * @module - * @deprecated - */ -import { SHA1 as SHA1n, sha1 as sha1n } from "./legacy.js"; -/** @deprecated Use import from `noble/hashes/legacy` module */ -export const SHA1 = SHA1n; -/** @deprecated Use import from `noble/hashes/legacy` module */ -export const sha1 = sha1n; -//# sourceMappingURL=sha1.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha1.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha1.js.map deleted file mode 100644 index 2e28aab2..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha1.js","sourceRoot":"","sources":["../src/sha1.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,IAAI,IAAI,KAAK,EAAE,IAAI,IAAI,KAAK,EAAE,MAAM,aAAa,CAAC;AAC3D,+DAA+D;AAC/D,MAAM,CAAC,MAAM,IAAI,GAAiB,KAAK,CAAC;AACxC,+DAA+D;AAC/D,MAAM,CAAC,MAAM,IAAI,GAAiB,KAAK,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha2.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha2.d.ts deleted file mode 100644 index 33f2f7f8..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha2.d.ts +++ /dev/null @@ -1,159 +0,0 @@ -/** - * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256. - * SHA256 is the fastest hash implementable in JS, even faster than Blake3. - * Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and - * [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf). - * @module - */ -import { HashMD } from './_md.ts'; -import { type CHash } from './utils.ts'; -export declare class SHA256 extends HashMD { - protected A: number; - protected B: number; - protected C: number; - protected D: number; - protected E: number; - protected F: number; - protected G: number; - protected H: number; - constructor(outputLen?: number); - protected get(): [number, number, number, number, number, number, number, number]; - protected set(A: number, B: number, C: number, D: number, E: number, F: number, G: number, H: number): void; - protected process(view: DataView, offset: number): void; - protected roundClean(): void; - destroy(): void; -} -export declare class SHA224 extends SHA256 { - protected A: number; - protected B: number; - protected C: number; - protected D: number; - protected E: number; - protected F: number; - protected G: number; - protected H: number; - constructor(); -} -export declare class SHA512 extends HashMD { - protected Ah: number; - protected Al: number; - protected Bh: number; - protected Bl: number; - protected Ch: number; - protected Cl: number; - protected Dh: number; - protected Dl: number; - protected Eh: number; - protected El: number; - protected Fh: number; - protected Fl: number; - protected Gh: number; - protected Gl: number; - protected Hh: number; - protected Hl: number; - constructor(outputLen?: number); - protected get(): [ - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number - ]; - protected set(Ah: number, Al: number, Bh: number, Bl: number, Ch: number, Cl: number, Dh: number, Dl: number, Eh: number, El: number, Fh: number, Fl: number, Gh: number, Gl: number, Hh: number, Hl: number): void; - protected process(view: DataView, offset: number): void; - protected roundClean(): void; - destroy(): void; -} -export declare class SHA384 extends SHA512 { - protected Ah: number; - protected Al: number; - protected Bh: number; - protected Bl: number; - protected Ch: number; - protected Cl: number; - protected Dh: number; - protected Dl: number; - protected Eh: number; - protected El: number; - protected Fh: number; - protected Fl: number; - protected Gh: number; - protected Gl: number; - protected Hh: number; - protected Hl: number; - constructor(); -} -export declare class SHA512_224 extends SHA512 { - protected Ah: number; - protected Al: number; - protected Bh: number; - protected Bl: number; - protected Ch: number; - protected Cl: number; - protected Dh: number; - protected Dl: number; - protected Eh: number; - protected El: number; - protected Fh: number; - protected Fl: number; - protected Gh: number; - protected Gl: number; - protected Hh: number; - protected Hl: number; - constructor(); -} -export declare class SHA512_256 extends SHA512 { - protected Ah: number; - protected Al: number; - protected Bh: number; - protected Bl: number; - protected Ch: number; - protected Cl: number; - protected Dh: number; - protected Dl: number; - protected Eh: number; - protected El: number; - protected Fh: number; - protected Fl: number; - protected Gh: number; - protected Gl: number; - protected Hh: number; - protected Hl: number; - constructor(); -} -/** - * SHA2-256 hash function from RFC 4634. - * - * It is the fastest JS hash, even faster than Blake3. - * To break sha256 using birthday attack, attackers need to try 2^128 hashes. - * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025. - */ -export declare const sha256: CHash; -/** SHA2-224 hash function from RFC 4634 */ -export declare const sha224: CHash; -/** SHA2-512 hash function from RFC 4634. */ -export declare const sha512: CHash; -/** SHA2-384 hash function from RFC 4634. */ -export declare const sha384: CHash; -/** - * SHA2-512/256 "truncated" hash function, with improved resistance to length extension attacks. - * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf). - */ -export declare const sha512_256: CHash; -/** - * SHA2-512/224 "truncated" hash function, with improved resistance to length extension attacks. - * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf). - */ -export declare const sha512_224: CHash; -//# sourceMappingURL=sha2.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha2.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha2.d.ts.map deleted file mode 100644 index 4be58812..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha2.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha2.d.ts","sourceRoot":"","sources":["../src/sha2.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAO,MAAM,EAAmD,MAAM,UAAU,CAAC;AAExF,OAAO,EAAE,KAAK,KAAK,EAA6B,MAAM,YAAY,CAAC;AAoBnE,qBAAa,MAAO,SAAQ,MAAM,CAAC,MAAM,CAAC;IAGxC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAoB;IACvC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAoB;IACvC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAoB;IACvC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAoB;IACvC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAoB;IACvC,SAAS,CAAC,CAAC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KAAwD,CAAC;AAE9E,4CAA4C;AAC5C,eAAO,MAAM,MAAM,EAAE,KAAwD,CAAC;AAC9E,4CAA4C;AAC5C,eAAO,MAAM,MAAM,EAAE,KAAwD,CAAC;AAE9E;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,KAA4D,CAAC;AACtF;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,KAA4D,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha2.js b/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha2.js deleted file mode 100644 index 9795cc5e..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha2.js +++ /dev/null @@ -1,375 +0,0 @@ -/** - * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256. - * SHA256 is the fastest hash implementable in JS, even faster than Blake3. - * Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and - * [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf). - * @module - */ -import { Chi, HashMD, Maj, SHA224_IV, SHA256_IV, SHA384_IV, SHA512_IV } from "./_md.js"; -import * as u64 from "./_u64.js"; -import { clean, createHasher, rotr } from "./utils.js"; -/** - * Round constants: - * First 32 bits of fractional parts of the cube roots of the first 64 primes 2..311) - */ -// prettier-ignore -const SHA256_K = /* @__PURE__ */ Uint32Array.from([ - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 -]); -/** Reusable temporary buffer. "W" comes straight from spec. */ -const SHA256_W = /* @__PURE__ */ new Uint32Array(64); -export class SHA256 extends HashMD { - constructor(outputLen = 32) { - super(64, outputLen, 8, false); - // We cannot use array here since array allows indexing by variable - // which means optimizer/compiler cannot use registers. - this.A = SHA256_IV[0] | 0; - this.B = SHA256_IV[1] | 0; - this.C = SHA256_IV[2] | 0; - this.D = SHA256_IV[3] | 0; - this.E = SHA256_IV[4] | 0; - this.F = SHA256_IV[5] | 0; - this.G = SHA256_IV[6] | 0; - this.H = SHA256_IV[7] | 0; - } - get() { - const { A, B, C, D, E, F, G, H } = this; - return [A, B, C, D, E, F, G, H]; - } - // prettier-ignore - set(A, B, C, D, E, F, G, H) { - this.A = A | 0; - this.B = B | 0; - this.C = C | 0; - this.D = D | 0; - this.E = E | 0; - this.F = F | 0; - this.G = G | 0; - this.H = H | 0; - } - process(view, offset) { - // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array - for (let i = 0; i < 16; i++, offset += 4) - SHA256_W[i] = view.getUint32(offset, false); - for (let i = 16; i < 64; i++) { - const W15 = SHA256_W[i - 15]; - const W2 = SHA256_W[i - 2]; - const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3); - const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10); - SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0; - } - // Compression function main loop, 64 rounds - let { A, B, C, D, E, F, G, H } = this; - for (let i = 0; i < 64; i++) { - const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25); - const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; - const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22); - const T2 = (sigma0 + Maj(A, B, C)) | 0; - H = G; - G = F; - F = E; - E = (D + T1) | 0; - D = C; - C = B; - B = A; - A = (T1 + T2) | 0; - } - // Add the compressed chunk to the current hash value - A = (A + this.A) | 0; - B = (B + this.B) | 0; - C = (C + this.C) | 0; - D = (D + this.D) | 0; - E = (E + this.E) | 0; - F = (F + this.F) | 0; - G = (G + this.G) | 0; - H = (H + this.H) | 0; - this.set(A, B, C, D, E, F, G, H); - } - roundClean() { - clean(SHA256_W); - } - destroy() { - this.set(0, 0, 0, 0, 0, 0, 0, 0); - clean(this.buffer); - } -} -export class SHA224 extends SHA256 { - constructor() { - super(28); - this.A = SHA224_IV[0] | 0; - this.B = SHA224_IV[1] | 0; - this.C = SHA224_IV[2] | 0; - this.D = SHA224_IV[3] | 0; - this.E = SHA224_IV[4] | 0; - this.F = SHA224_IV[5] | 0; - this.G = SHA224_IV[6] | 0; - this.H = SHA224_IV[7] | 0; - } -} -// SHA2-512 is slower than sha256 in js because u64 operations are slow. -// Round contants -// First 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409 -// prettier-ignore -const K512 = /* @__PURE__ */ (() => u64.split([ - '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc', - '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118', - '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2', - '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694', - '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65', - '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5', - '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4', - '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70', - '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df', - '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b', - '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30', - '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8', - '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8', - '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3', - '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec', - '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b', - '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178', - '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b', - '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c', - '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817' -].map(n => BigInt(n))))(); -const SHA512_Kh = /* @__PURE__ */ (() => K512[0])(); -const SHA512_Kl = /* @__PURE__ */ (() => K512[1])(); -// Reusable temporary buffers -const SHA512_W_H = /* @__PURE__ */ new Uint32Array(80); -const SHA512_W_L = /* @__PURE__ */ new Uint32Array(80); -export class SHA512 extends HashMD { - constructor(outputLen = 64) { - super(128, outputLen, 16, false); - // We cannot use array here since array allows indexing by variable - // which means optimizer/compiler cannot use registers. - // h -- high 32 bits, l -- low 32 bits - this.Ah = SHA512_IV[0] | 0; - this.Al = SHA512_IV[1] | 0; - this.Bh = SHA512_IV[2] | 0; - this.Bl = SHA512_IV[3] | 0; - this.Ch = SHA512_IV[4] | 0; - this.Cl = SHA512_IV[5] | 0; - this.Dh = SHA512_IV[6] | 0; - this.Dl = SHA512_IV[7] | 0; - this.Eh = SHA512_IV[8] | 0; - this.El = SHA512_IV[9] | 0; - this.Fh = SHA512_IV[10] | 0; - this.Fl = SHA512_IV[11] | 0; - this.Gh = SHA512_IV[12] | 0; - this.Gl = SHA512_IV[13] | 0; - this.Hh = SHA512_IV[14] | 0; - this.Hl = SHA512_IV[15] | 0; - } - // prettier-ignore - get() { - const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; - return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl]; - } - // prettier-ignore - set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) { - this.Ah = Ah | 0; - this.Al = Al | 0; - this.Bh = Bh | 0; - this.Bl = Bl | 0; - this.Ch = Ch | 0; - this.Cl = Cl | 0; - this.Dh = Dh | 0; - this.Dl = Dl | 0; - this.Eh = Eh | 0; - this.El = El | 0; - this.Fh = Fh | 0; - this.Fl = Fl | 0; - this.Gh = Gh | 0; - this.Gl = Gl | 0; - this.Hh = Hh | 0; - this.Hl = Hl | 0; - } - process(view, offset) { - // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array - for (let i = 0; i < 16; i++, offset += 4) { - SHA512_W_H[i] = view.getUint32(offset); - SHA512_W_L[i] = view.getUint32((offset += 4)); - } - for (let i = 16; i < 80; i++) { - // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7) - const W15h = SHA512_W_H[i - 15] | 0; - const W15l = SHA512_W_L[i - 15] | 0; - const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7); - const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7); - // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6) - const W2h = SHA512_W_H[i - 2] | 0; - const W2l = SHA512_W_L[i - 2] | 0; - const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6); - const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6); - // SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16]; - const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]); - const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]); - SHA512_W_H[i] = SUMh | 0; - SHA512_W_L[i] = SUMl | 0; - } - let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; - // Compression function main loop, 80 rounds - for (let i = 0; i < 80; i++) { - // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41) - const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41); - const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41); - //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; - const CHIh = (Eh & Fh) ^ (~Eh & Gh); - const CHIl = (El & Fl) ^ (~El & Gl); - // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i] - // prettier-ignore - const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]); - const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]); - const T1l = T1ll | 0; - // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39) - const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39); - const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39); - const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch); - const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl); - Hh = Gh | 0; - Hl = Gl | 0; - Gh = Fh | 0; - Gl = Fl | 0; - Fh = Eh | 0; - Fl = El | 0; - ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0)); - Dh = Ch | 0; - Dl = Cl | 0; - Ch = Bh | 0; - Cl = Bl | 0; - Bh = Ah | 0; - Bl = Al | 0; - const All = u64.add3L(T1l, sigma0l, MAJl); - Ah = u64.add3H(All, T1h, sigma0h, MAJh); - Al = All | 0; - } - // Add the compressed chunk to the current hash value - ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0)); - ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0)); - ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0)); - ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0)); - ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0)); - ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0)); - ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0)); - ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0)); - this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl); - } - roundClean() { - clean(SHA512_W_H, SHA512_W_L); - } - destroy() { - clean(this.buffer); - this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - } -} -export class SHA384 extends SHA512 { - constructor() { - super(48); - this.Ah = SHA384_IV[0] | 0; - this.Al = SHA384_IV[1] | 0; - this.Bh = SHA384_IV[2] | 0; - this.Bl = SHA384_IV[3] | 0; - this.Ch = SHA384_IV[4] | 0; - this.Cl = SHA384_IV[5] | 0; - this.Dh = SHA384_IV[6] | 0; - this.Dl = SHA384_IV[7] | 0; - this.Eh = SHA384_IV[8] | 0; - this.El = SHA384_IV[9] | 0; - this.Fh = SHA384_IV[10] | 0; - this.Fl = SHA384_IV[11] | 0; - this.Gh = SHA384_IV[12] | 0; - this.Gl = SHA384_IV[13] | 0; - this.Hh = SHA384_IV[14] | 0; - this.Hl = SHA384_IV[15] | 0; - } -} -/** - * Truncated SHA512/256 and SHA512/224. - * SHA512_IV is XORed with 0xa5a5a5a5a5a5a5a5, then used as "intermediary" IV of SHA512/t. - * Then t hashes string to produce result IV. - * See `test/misc/sha2-gen-iv.js`. - */ -/** SHA512/224 IV */ -const T224_IV = /* @__PURE__ */ Uint32Array.from([ - 0x8c3d37c8, 0x19544da2, 0x73e19966, 0x89dcd4d6, 0x1dfab7ae, 0x32ff9c82, 0x679dd514, 0x582f9fcf, - 0x0f6d2b69, 0x7bd44da8, 0x77e36f73, 0x04c48942, 0x3f9d85a8, 0x6a1d36c8, 0x1112e6ad, 0x91d692a1, -]); -/** SHA512/256 IV */ -const T256_IV = /* @__PURE__ */ Uint32Array.from([ - 0x22312194, 0xfc2bf72c, 0x9f555fa3, 0xc84c64c2, 0x2393b86b, 0x6f53b151, 0x96387719, 0x5940eabd, - 0x96283ee2, 0xa88effe3, 0xbe5e1e25, 0x53863992, 0x2b0199fc, 0x2c85b8aa, 0x0eb72ddc, 0x81c52ca2, -]); -export class SHA512_224 extends SHA512 { - constructor() { - super(28); - this.Ah = T224_IV[0] | 0; - this.Al = T224_IV[1] | 0; - this.Bh = T224_IV[2] | 0; - this.Bl = T224_IV[3] | 0; - this.Ch = T224_IV[4] | 0; - this.Cl = T224_IV[5] | 0; - this.Dh = T224_IV[6] | 0; - this.Dl = T224_IV[7] | 0; - this.Eh = T224_IV[8] | 0; - this.El = T224_IV[9] | 0; - this.Fh = T224_IV[10] | 0; - this.Fl = T224_IV[11] | 0; - this.Gh = T224_IV[12] | 0; - this.Gl = T224_IV[13] | 0; - this.Hh = T224_IV[14] | 0; - this.Hl = T224_IV[15] | 0; - } -} -export class SHA512_256 extends SHA512 { - constructor() { - super(32); - this.Ah = T256_IV[0] | 0; - this.Al = T256_IV[1] | 0; - this.Bh = T256_IV[2] | 0; - this.Bl = T256_IV[3] | 0; - this.Ch = T256_IV[4] | 0; - this.Cl = T256_IV[5] | 0; - this.Dh = T256_IV[6] | 0; - this.Dl = T256_IV[7] | 0; - this.Eh = T256_IV[8] | 0; - this.El = T256_IV[9] | 0; - this.Fh = T256_IV[10] | 0; - this.Fl = T256_IV[11] | 0; - this.Gh = T256_IV[12] | 0; - this.Gl = T256_IV[13] | 0; - this.Hh = T256_IV[14] | 0; - this.Hl = T256_IV[15] | 0; - } -} -/** - * SHA2-256 hash function from RFC 4634. - * - * It is the fastest JS hash, even faster than Blake3. - * To break sha256 using birthday attack, attackers need to try 2^128 hashes. - * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025. - */ -export const sha256 = /* @__PURE__ */ createHasher(() => new SHA256()); -/** SHA2-224 hash function from RFC 4634 */ -export const sha224 = /* @__PURE__ */ createHasher(() => new SHA224()); -/** SHA2-512 hash function from RFC 4634. */ -export const sha512 = /* @__PURE__ */ createHasher(() => new SHA512()); -/** SHA2-384 hash function from RFC 4634. */ -export const sha384 = /* @__PURE__ */ createHasher(() => new SHA384()); -/** - * SHA2-512/256 "truncated" hash function, with improved resistance to length extension attacks. - * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf). - */ -export const sha512_256 = /* @__PURE__ */ createHasher(() => new SHA512_256()); -/** - * SHA2-512/224 "truncated" hash function, with improved resistance to length extension attacks. - * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf). - */ -export const sha512_224 = /* @__PURE__ */ createHasher(() => new SHA512_224()); -//# sourceMappingURL=sha2.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha2.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha2.js.map deleted file mode 100644 index f3fc0323..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha2.js","sourceRoot":"","sources":["../src/sha2.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACxF,OAAO,KAAK,GAAG,MAAM,WAAW,CAAC;AACjC,OAAO,EAAc,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEnE;;;GAGG;AACH,kBAAkB;AAClB,MAAM,QAAQ,GAAG,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC;IAChD,UAAU,EAAE,UAAU,EAAE,UAAU,E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ACH,MAAM,CAAC,MAAM,MAAM,GAAU,eAAe,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC;AAC9E,2CAA2C;AAC3C,MAAM,CAAC,MAAM,MAAM,GAAU,eAAe,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC;AAE9E,4CAA4C;AAC5C,MAAM,CAAC,MAAM,MAAM,GAAU,eAAe,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC;AAC9E,4CAA4C;AAC5C,MAAM,CAAC,MAAM,MAAM,GAAU,eAAe,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC;AAE9E;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAU,eAAe,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,IAAI,UAAU,EAAE,CAAC,CAAC;AACtF;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAU,eAAe,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,IAAI,UAAU,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha256.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha256.d.ts deleted file mode 100644 index ed04fe88..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha256.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * SHA2-256 a.k.a. sha256. In JS, it is the fastest hash, even faster than Blake3. - * - * To break sha256 using birthday attack, attackers need to try 2^128 hashes. - * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025. - * - * Check out [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf). - * @module - * @deprecated - */ -import { SHA224 as SHA224n, sha224 as sha224n, SHA256 as SHA256n, sha256 as sha256n } from './sha2.ts'; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export declare const SHA256: typeof SHA256n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export declare const sha256: typeof sha256n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export declare const SHA224: typeof SHA224n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export declare const sha224: typeof sha224n; -//# sourceMappingURL=sha256.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha256.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha256.d.ts.map deleted file mode 100644 index 2912e85b..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha256.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha256.d.ts","sourceRoot":"","sources":["../src/sha256.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EACL,MAAM,IAAI,OAAO,EACjB,MAAM,IAAI,OAAO,EACjB,MAAM,IAAI,OAAO,EACjB,MAAM,IAAI,OAAO,EAClB,MAAM,WAAW,CAAC;AACnB,6DAA6D;AAC7D,eAAO,MAAM,MAAM,EAAE,OAAO,OAAiB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,MAAM,EAAE,OAAO,OAAiB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,MAAM,EAAE,OAAO,OAAiB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,MAAM,EAAE,OAAO,OAAiB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha256.js b/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha256.js deleted file mode 100644 index 6bdee7ce..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha256.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * SHA2-256 a.k.a. sha256. In JS, it is the fastest hash, even faster than Blake3. - * - * To break sha256 using birthday attack, attackers need to try 2^128 hashes. - * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025. - * - * Check out [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf). - * @module - * @deprecated - */ -import { SHA224 as SHA224n, sha224 as sha224n, SHA256 as SHA256n, sha256 as sha256n, } from "./sha2.js"; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export const SHA256 = SHA256n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export const sha256 = sha256n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export const SHA224 = SHA224n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export const sha224 = sha224n; -//# sourceMappingURL=sha256.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha256.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha256.js.map deleted file mode 100644 index 6df7235b..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha256.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha256.js","sourceRoot":"","sources":["../src/sha256.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EACL,MAAM,IAAI,OAAO,EACjB,MAAM,IAAI,OAAO,EACjB,MAAM,IAAI,OAAO,EACjB,MAAM,IAAI,OAAO,GAClB,MAAM,WAAW,CAAC;AACnB,6DAA6D;AAC7D,MAAM,CAAC,MAAM,MAAM,GAAmB,OAAO,CAAC;AAC9C,6DAA6D;AAC7D,MAAM,CAAC,MAAM,MAAM,GAAmB,OAAO,CAAC;AAC9C,6DAA6D;AAC7D,MAAM,CAAC,MAAM,MAAM,GAAmB,OAAO,CAAC;AAC9C,6DAA6D;AAC7D,MAAM,CAAC,MAAM,MAAM,GAAmB,OAAO,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha3-addons.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha3-addons.d.ts deleted file mode 100644 index 5bd2fe62..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha3-addons.d.ts +++ /dev/null @@ -1,142 +0,0 @@ -/** - * SHA3 (keccak) addons. - * - * * Full [NIST SP 800-185](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-185.pdf): - * cSHAKE, KMAC, TupleHash, ParallelHash + XOF variants - * * Reduced-round Keccak [(draft)](https://datatracker.ietf.org/doc/draft-irtf-cfrg-kangarootwelve/): - * * 🦘 K12 aka KangarooTwelve - * * M14 aka MarsupilamiFourteen - * * TurboSHAKE - * * KeccakPRG: Pseudo-random generator based on Keccak [(pdf)](https://keccak.team/files/CSF-0.1.pdf) - * @module - */ -import { Keccak, type ShakeOpts } from './sha3.ts'; -import { type CHashO, type CHashXO, Hash, type HashXOF, type Input } from './utils.ts'; -export type cShakeOpts = ShakeOpts & { - personalization?: Input; - NISTfn?: Input; -}; -export type ICShake = { - (msg: Input, opts?: cShakeOpts): Uint8Array; - outputLen: number; - blockLen: number; - create(opts: cShakeOpts): HashXOF; -}; -export type ITupleHash = { - (messages: Input[], opts?: cShakeOpts): Uint8Array; - create(opts?: cShakeOpts): TupleHash; -}; -export type IParHash = { - (message: Input, opts?: ParallelOpts): Uint8Array; - create(opts?: ParallelOpts): ParallelHash; -}; -export declare const cshake128: ICShake; -export declare const cshake256: ICShake; -export declare class KMAC extends Keccak implements HashXOF { - constructor(blockLen: number, outputLen: number, enableXOF: boolean, key: Input, opts?: cShakeOpts); - protected finish(): void; - _cloneInto(to?: KMAC): KMAC; - clone(): KMAC; -} -export declare const kmac128: { - (key: Input, message: Input, opts?: cShakeOpts): Uint8Array; - create(key: Input, opts?: cShakeOpts): KMAC; -}; -export declare const kmac256: { - (key: Input, message: Input, opts?: cShakeOpts): Uint8Array; - create(key: Input, opts?: cShakeOpts): KMAC; -}; -export declare const kmac128xof: { - (key: Input, message: Input, opts?: cShakeOpts): Uint8Array; - create(key: Input, opts?: cShakeOpts): KMAC; -}; -export declare const kmac256xof: { - (key: Input, message: Input, opts?: cShakeOpts): Uint8Array; - create(key: Input, opts?: cShakeOpts): KMAC; -}; -export declare class TupleHash extends Keccak implements HashXOF { - constructor(blockLen: number, outputLen: number, enableXOF: boolean, opts?: cShakeOpts); - protected finish(): void; - _cloneInto(to?: TupleHash): TupleHash; - clone(): TupleHash; -} -/** 128-bit TupleHASH. */ -export declare const tuplehash128: ITupleHash; -/** 256-bit TupleHASH. */ -export declare const tuplehash256: ITupleHash; -/** 128-bit TupleHASH XOF. */ -export declare const tuplehash128xof: ITupleHash; -/** 256-bit TupleHASH XOF. */ -export declare const tuplehash256xof: ITupleHash; -type ParallelOpts = cShakeOpts & { - blockLen?: number; -}; -export declare class ParallelHash extends Keccak implements HashXOF { - private leafHash?; - protected leafCons: () => Hash; - private chunkPos; - private chunksDone; - private chunkLen; - constructor(blockLen: number, outputLen: number, leafCons: () => Hash, enableXOF: boolean, opts?: ParallelOpts); - protected finish(): void; - _cloneInto(to?: ParallelHash): ParallelHash; - destroy(): void; - clone(): ParallelHash; -} -/** 128-bit ParallelHash. In JS, it is not parallel. */ -export declare const parallelhash128: IParHash; -/** 256-bit ParallelHash. In JS, it is not parallel. */ -export declare const parallelhash256: IParHash; -/** 128-bit ParallelHash XOF. In JS, it is not parallel. */ -export declare const parallelhash128xof: IParHash; -/** 256-bit ParallelHash. In JS, it is not parallel. */ -export declare const parallelhash256xof: IParHash; -export type TurboshakeOpts = ShakeOpts & { - D?: number; -}; -/** TurboSHAKE 128-bit: reduced 12-round keccak. */ -export declare const turboshake128: CHashXO; -/** TurboSHAKE 256-bit: reduced 12-round keccak. */ -export declare const turboshake256: CHashXO; -export type KangarooOpts = { - dkLen?: number; - personalization?: Input; -}; -export declare class KangarooTwelve extends Keccak implements HashXOF { - readonly chunkLen = 8192; - private leafHash?; - protected leafLen: number; - private personalization; - private chunkPos; - private chunksDone; - constructor(blockLen: number, leafLen: number, outputLen: number, rounds: number, opts: KangarooOpts); - update(data: Input): this; - protected finish(): void; - destroy(): void; - _cloneInto(to?: KangarooTwelve): KangarooTwelve; - clone(): KangarooTwelve; -} -/** KangarooTwelve: reduced 12-round keccak. */ -export declare const k12: CHashO; -/** MarsupilamiFourteen: reduced 14-round keccak. */ -export declare const m14: CHashO; -/** - * More at https://github.com/XKCP/XKCP/tree/master/lib/high/Keccak/PRG. - */ -export declare class KeccakPRG extends Keccak { - protected rate: number; - constructor(capacity: number); - keccak(): void; - update(data: Input): this; - feed(data: Input): this; - protected finish(): void; - digestInto(_out: Uint8Array): Uint8Array; - fetch(bytes: number): Uint8Array; - forget(): void; - _cloneInto(to?: KeccakPRG): KeccakPRG; - clone(): KeccakPRG; -} -/** KeccakPRG: Pseudo-random generator based on Keccak. https://keccak.team/files/CSF-0.1.pdf */ -export declare const keccakprg: (capacity?: number) => KeccakPRG; -export {}; -//# sourceMappingURL=sha3-addons.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha3-addons.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha3-addons.d.ts.map deleted file mode 100644 index 4f4b11b6..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha3-addons.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha3-addons.d.ts","sourceRoot":"","sources":["../src/sha3-addons.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAGL,KAAK,MAAM,EACX,KAAK,OAAO,EAGZ,IAAI,EACJ,KAAK,OAAO,EACZ,KAAK,KAAK,EAGX,MAAM,YAAY,CAAC;AAoCpB,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG;IAAE,eAAe,CAAC,EAAE,KAAK,CAAC;IAAC,MAAM,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AA0BjF,MAAM,MAAM,OAAO,GAAG;IACpB,CAAC,GAAG,EAAE,KAA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ools/mnemonic-test/node_modules/@noble/hashes/esm/sha3-addons.js deleted file mode 100644 index ec9c664c..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha3-addons.js +++ /dev/null @@ -1,393 +0,0 @@ -/** - * SHA3 (keccak) addons. - * - * * Full [NIST SP 800-185](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-185.pdf): - * cSHAKE, KMAC, TupleHash, ParallelHash + XOF variants - * * Reduced-round Keccak [(draft)](https://datatracker.ietf.org/doc/draft-irtf-cfrg-kangarootwelve/): - * * 🦘 K12 aka KangarooTwelve - * * M14 aka MarsupilamiFourteen - * * TurboSHAKE - * * KeccakPRG: Pseudo-random generator based on Keccak [(pdf)](https://keccak.team/files/CSF-0.1.pdf) - * @module - */ -import { Keccak } from "./sha3.js"; -import { abytes, anumber, createOptHasher, createXOFer, Hash, toBytes, u32, } from "./utils.js"; -// cSHAKE && KMAC (NIST SP800-185) -const _8n = BigInt(8); -const _ffn = BigInt(0xff); -// NOTE: it is safe to use bigints here, since they used only for length encoding (not actual data). -// We use bigints in sha256 for lengths too. -function leftEncode(n) { - n = BigInt(n); - const res = [Number(n & _ffn)]; - n >>= _8n; - for (; n > 0; n >>= _8n) - res.unshift(Number(n & _ffn)); - res.unshift(res.length); - return new Uint8Array(res); -} -function rightEncode(n) { - n = BigInt(n); - const res = [Number(n & _ffn)]; - n >>= _8n; - for (; n > 0; n >>= _8n) - res.unshift(Number(n & _ffn)); - res.push(res.length); - return new Uint8Array(res); -} -function chooseLen(opts, outputLen) { - return opts.dkLen === undefined ? outputLen : opts.dkLen; -} -const abytesOrZero = (buf) => { - if (buf === undefined) - return Uint8Array.of(); - return toBytes(buf); -}; -// NOTE: second modulo is necessary since we don't need to add padding if current element takes whole block -const getPadding = (len, block) => new Uint8Array((block - (len % block)) % block); -// Personalization -function cshakePers(hash, opts = {}) { - if (!opts || (!opts.personalization && !opts.NISTfn)) - return hash; - // Encode and pad inplace to avoid unneccesary memory copies/slices (so we don't need to zero them later) - // bytepad(encode_string(N) || encode_string(S), 168) - const blockLenBytes = leftEncode(hash.blockLen); - const fn = abytesOrZero(opts.NISTfn); - const fnLen = leftEncode(_8n * BigInt(fn.length)); // length in bits - const pers = abytesOrZero(opts.personalization); - const persLen = leftEncode(_8n * BigInt(pers.length)); // length in bits - if (!fn.length && !pers.length) - return hash; - hash.suffix = 0x04; - hash.update(blockLenBytes).update(fnLen).update(fn).update(persLen).update(pers); - let totalLen = blockLenBytes.length + fnLen.length + fn.length + persLen.length + pers.length; - hash.update(getPadding(totalLen, hash.blockLen)); - return hash; -} -const gencShake = (suffix, blockLen, outputLen) => createXOFer((opts = {}) => cshakePers(new Keccak(blockLen, suffix, chooseLen(opts, outputLen), true), opts)); -export const cshake128 = /* @__PURE__ */ (() => gencShake(0x1f, 168, 128 / 8))(); -export const cshake256 = /* @__PURE__ */ (() => gencShake(0x1f, 136, 256 / 8))(); -export class KMAC extends Keccak { - constructor(blockLen, outputLen, enableXOF, key, opts = {}) { - super(blockLen, 0x1f, outputLen, enableXOF); - cshakePers(this, { NISTfn: 'KMAC', personalization: opts.personalization }); - key = toBytes(key); - abytes(key); - // 1. newX = bytepad(encode_string(K), 168) || X || right_encode(L). - const blockLenBytes = leftEncode(this.blockLen); - const keyLen = leftEncode(_8n * BigInt(key.length)); - this.update(blockLenBytes).update(keyLen).update(key); - const totalLen = blockLenBytes.length + keyLen.length + key.length; - this.update(getPadding(totalLen, this.blockLen)); - } - finish() { - if (!this.finished) - this.update(rightEncode(this.enableXOF ? 0 : _8n * BigInt(this.outputLen))); // outputLen in bits - super.finish(); - } - _cloneInto(to) { - // Create new instance without calling constructor since key already in state and we don't know it. - // Force "to" to be instance of KMAC instead of Sha3. - if (!to) { - to = Object.create(Object.getPrototypeOf(this), {}); - to.state = this.state.slice(); - to.blockLen = this.blockLen; - to.state32 = u32(to.state); - } - return super._cloneInto(to); - } - clone() { - return this._cloneInto(); - } -} -function genKmac(blockLen, outputLen, xof = false) { - const kmac = (key, message, opts) => kmac.create(key, opts).update(message).digest(); - kmac.create = (key, opts = {}) => new KMAC(blockLen, chooseLen(opts, outputLen), xof, key, opts); - return kmac; -} -export const kmac128 = /* @__PURE__ */ (() => genKmac(168, 128 / 8))(); -export const kmac256 = /* @__PURE__ */ (() => genKmac(136, 256 / 8))(); -export const kmac128xof = /* @__PURE__ */ (() => genKmac(168, 128 / 8, true))(); -export const kmac256xof = /* @__PURE__ */ (() => genKmac(136, 256 / 8, true))(); -// TupleHash -// Usage: tuple(['ab', 'cd']) != tuple(['a', 'bcd']) -export class TupleHash extends Keccak { - constructor(blockLen, outputLen, enableXOF, opts = {}) { - super(blockLen, 0x1f, outputLen, enableXOF); - cshakePers(this, { NISTfn: 'TupleHash', personalization: opts.personalization }); - // Change update after cshake processed - this.update = (data) => { - data = toBytes(data); - abytes(data); - super.update(leftEncode(_8n * BigInt(data.length))); - super.update(data); - return this; - }; - } - finish() { - if (!this.finished) - super.update(rightEncode(this.enableXOF ? 0 : _8n * BigInt(this.outputLen))); // outputLen in bits - super.finish(); - } - _cloneInto(to) { - to || (to = new TupleHash(this.blockLen, this.outputLen, this.enableXOF)); - return super._cloneInto(to); - } - clone() { - return this._cloneInto(); - } -} -function genTuple(blockLen, outputLen, xof = false) { - const tuple = (messages, opts) => { - const h = tuple.create(opts); - for (const msg of messages) - h.update(msg); - return h.digest(); - }; - tuple.create = (opts = {}) => new TupleHash(blockLen, chooseLen(opts, outputLen), xof, opts); - return tuple; -} -/** 128-bit TupleHASH. */ -export const tuplehash128 = /* @__PURE__ */ (() => genTuple(168, 128 / 8))(); -/** 256-bit TupleHASH. */ -export const tuplehash256 = /* @__PURE__ */ (() => genTuple(136, 256 / 8))(); -/** 128-bit TupleHASH XOF. */ -export const tuplehash128xof = /* @__PURE__ */ (() => genTuple(168, 128 / 8, true))(); -/** 256-bit TupleHASH XOF. */ -export const tuplehash256xof = /* @__PURE__ */ (() => genTuple(136, 256 / 8, true))(); -export class ParallelHash extends Keccak { - constructor(blockLen, outputLen, leafCons, enableXOF, opts = {}) { - super(blockLen, 0x1f, outputLen, enableXOF); - this.chunkPos = 0; // Position of current block in chunk - this.chunksDone = 0; // How many chunks we already have - cshakePers(this, { NISTfn: 'ParallelHash', personalization: opts.personalization }); - this.leafCons = leafCons; - let { blockLen: B } = opts; - B || (B = 8); - anumber(B); - this.chunkLen = B; - super.update(leftEncode(B)); - // Change update after cshake processed - this.update = (data) => { - data = toBytes(data); - abytes(data); - const { chunkLen, leafCons } = this; - for (let pos = 0, len = data.length; pos < len;) { - if (this.chunkPos == chunkLen || !this.leafHash) { - if (this.leafHash) { - super.update(this.leafHash.digest()); - this.chunksDone++; - } - this.leafHash = leafCons(); - this.chunkPos = 0; - } - const take = Math.min(chunkLen - this.chunkPos, len - pos); - this.leafHash.update(data.subarray(pos, pos + take)); - this.chunkPos += take; - pos += take; - } - return this; - }; - } - finish() { - if (this.finished) - return; - if (this.leafHash) { - super.update(this.leafHash.digest()); - this.chunksDone++; - } - super.update(rightEncode(this.chunksDone)); - super.update(rightEncode(this.enableXOF ? 0 : _8n * BigInt(this.outputLen))); // outputLen in bits - super.finish(); - } - _cloneInto(to) { - to || (to = new ParallelHash(this.blockLen, this.outputLen, this.leafCons, this.enableXOF)); - if (this.leafHash) - to.leafHash = this.leafHash._cloneInto(to.leafHash); - to.chunkPos = this.chunkPos; - to.chunkLen = this.chunkLen; - to.chunksDone = this.chunksDone; - return super._cloneInto(to); - } - destroy() { - super.destroy.call(this); - if (this.leafHash) - this.leafHash.destroy(); - } - clone() { - return this._cloneInto(); - } -} -function genPrl(blockLen, outputLen, leaf, xof = false) { - const parallel = (message, opts) => parallel.create(opts).update(message).digest(); - parallel.create = (opts = {}) => new ParallelHash(blockLen, chooseLen(opts, outputLen), () => leaf.create({ dkLen: 2 * outputLen }), xof, opts); - return parallel; -} -/** 128-bit ParallelHash. In JS, it is not parallel. */ -export const parallelhash128 = /* @__PURE__ */ (() => genPrl(168, 128 / 8, cshake128))(); -/** 256-bit ParallelHash. In JS, it is not parallel. */ -export const parallelhash256 = /* @__PURE__ */ (() => genPrl(136, 256 / 8, cshake256))(); -/** 128-bit ParallelHash XOF. In JS, it is not parallel. */ -export const parallelhash128xof = /* @__PURE__ */ (() => genPrl(168, 128 / 8, cshake128, true))(); -/** 256-bit ParallelHash. In JS, it is not parallel. */ -export const parallelhash256xof = /* @__PURE__ */ (() => genPrl(136, 256 / 8, cshake256, true))(); -const genTurboshake = (blockLen, outputLen) => createXOFer((opts = {}) => { - const D = opts.D === undefined ? 0x1f : opts.D; - // Section 2.1 of https://datatracker.ietf.org/doc/draft-irtf-cfrg-kangarootwelve/ - if (!Number.isSafeInteger(D) || D < 0x01 || D > 0x7f) - throw new Error('invalid domain separation byte must be 0x01..0x7f, got: ' + D); - return new Keccak(blockLen, D, opts.dkLen === undefined ? outputLen : opts.dkLen, true, 12); -}); -/** TurboSHAKE 128-bit: reduced 12-round keccak. */ -export const turboshake128 = /* @__PURE__ */ genTurboshake(168, 256 / 8); -/** TurboSHAKE 256-bit: reduced 12-round keccak. */ -export const turboshake256 = /* @__PURE__ */ genTurboshake(136, 512 / 8); -// Kangaroo -// Same as NIST rightEncode, but returns [0] for zero string -function rightEncodeK12(n) { - n = BigInt(n); - const res = []; - for (; n > 0; n >>= _8n) - res.unshift(Number(n & _ffn)); - res.push(res.length); - return Uint8Array.from(res); -} -const EMPTY_BUFFER = /* @__PURE__ */ Uint8Array.of(); -export class KangarooTwelve extends Keccak { - constructor(blockLen, leafLen, outputLen, rounds, opts) { - super(blockLen, 0x07, outputLen, true, rounds); - this.chunkLen = 8192; - this.chunkPos = 0; // Position of current block in chunk - this.chunksDone = 0; // How many chunks we already have - this.leafLen = leafLen; - this.personalization = abytesOrZero(opts.personalization); - } - update(data) { - data = toBytes(data); - abytes(data); - const { chunkLen, blockLen, leafLen, rounds } = this; - for (let pos = 0, len = data.length; pos < len;) { - if (this.chunkPos == chunkLen) { - if (this.leafHash) - super.update(this.leafHash.digest()); - else { - this.suffix = 0x06; // Its safe to change suffix here since its used only in digest() - super.update(Uint8Array.from([3, 0, 0, 0, 0, 0, 0, 0])); - } - this.leafHash = new Keccak(blockLen, 0x0b, leafLen, false, rounds); - this.chunksDone++; - this.chunkPos = 0; - } - const take = Math.min(chunkLen - this.chunkPos, len - pos); - const chunk = data.subarray(pos, pos + take); - if (this.leafHash) - this.leafHash.update(chunk); - else - super.update(chunk); - this.chunkPos += take; - pos += take; - } - return this; - } - finish() { - if (this.finished) - return; - const { personalization } = this; - this.update(personalization).update(rightEncodeK12(personalization.length)); - // Leaf hash - if (this.leafHash) { - super.update(this.leafHash.digest()); - super.update(rightEncodeK12(this.chunksDone)); - super.update(Uint8Array.from([0xff, 0xff])); - } - super.finish.call(this); - } - destroy() { - super.destroy.call(this); - if (this.leafHash) - this.leafHash.destroy(); - // We cannot zero personalization buffer since it is user provided and we don't want to mutate user input - this.personalization = EMPTY_BUFFER; - } - _cloneInto(to) { - const { blockLen, leafLen, leafHash, outputLen, rounds } = this; - to || (to = new KangarooTwelve(blockLen, leafLen, outputLen, rounds, {})); - super._cloneInto(to); - if (leafHash) - to.leafHash = leafHash._cloneInto(to.leafHash); - to.personalization.set(this.personalization); - to.leafLen = this.leafLen; - to.chunkPos = this.chunkPos; - to.chunksDone = this.chunksDone; - return to; - } - clone() { - return this._cloneInto(); - } -} -/** KangarooTwelve: reduced 12-round keccak. */ -export const k12 = /* @__PURE__ */ (() => createOptHasher((opts = {}) => new KangarooTwelve(168, 32, chooseLen(opts, 32), 12, opts)))(); -/** MarsupilamiFourteen: reduced 14-round keccak. */ -export const m14 = /* @__PURE__ */ (() => createOptHasher((opts = {}) => new KangarooTwelve(136, 64, chooseLen(opts, 64), 14, opts)))(); -/** - * More at https://github.com/XKCP/XKCP/tree/master/lib/high/Keccak/PRG. - */ -export class KeccakPRG extends Keccak { - constructor(capacity) { - anumber(capacity); - // Rho should be full bytes - if (capacity < 0 || capacity > 1600 - 10 || (1600 - capacity - 2) % 8) - throw new Error('invalid capacity'); - // blockLen = rho in bytes - super((1600 - capacity - 2) / 8, 0, 0, true); - this.rate = 1600 - capacity; - this.posOut = Math.floor((this.rate + 7) / 8); - } - keccak() { - // Duplex padding - this.state[this.pos] ^= 0x01; - this.state[this.blockLen] ^= 0x02; // Rho is full bytes - super.keccak(); - this.pos = 0; - this.posOut = 0; - } - update(data) { - super.update(data); - this.posOut = this.blockLen; - return this; - } - feed(data) { - return this.update(data); - } - finish() { } - digestInto(_out) { - throw new Error('digest is not allowed, use .fetch instead'); - } - fetch(bytes) { - return this.xof(bytes); - } - // Ensure irreversibility (even if state leaked previous outputs cannot be computed) - forget() { - if (this.rate < 1600 / 2 + 1) - throw new Error('rate is too low to use .forget()'); - this.keccak(); - for (let i = 0; i < this.blockLen; i++) - this.state[i] = 0; - this.pos = this.blockLen; - this.keccak(); - this.posOut = this.blockLen; - } - _cloneInto(to) { - const { rate } = this; - to || (to = new KeccakPRG(1600 - rate)); - super._cloneInto(to); - to.rate = rate; - return to; - } - clone() { - return this._cloneInto(); - } -} -/** KeccakPRG: Pseudo-random generator based on Keccak. https://keccak.team/files/CSF-0.1.pdf */ -export const keccakprg = (capacity = 254) => new KeccakPRG(capacity); -//# sourceMappingURL=sha3-addons.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha3-addons.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha3-addons.js.map deleted file mode 100644 index 6587b0bb..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha3-addons.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha3-addons.js","sourceRoot":"","sources":["../src/sha3-addons.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,MAAM,EAAkB,MAAM,WAAW,CAAC;AACnD,OAAO,EACL,MAAM,EACN,OAAO,EAGP,eAAe,EACf,WAAW,EACX,IAAI,EAGJ,OAAO,EACP,GAAG,GACJ,MA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E,CAAC;QACd,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,EAAE;YAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QAC1D,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC;QACzB,IAAI,CAAC,MAAM,EAAE,CAAC;QACd,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC;IAC9B,CAAC;IACD,UAAU,CAAC,EAAc;QACvB,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;QACtB,EAAE,KAAF,EAAE,GAAK,IAAI,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,EAAC;QAClC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;QACrB,EAAE,CAAC,IAAI,GAAG,IAAI,CAAC;QACf,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,KAAK;QACH,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;IAC3B,CAAC;CACF;AAED,gGAAgG;AAChG,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,QAAQ,GAAG,GAAG,EAAa,EAAE,CAAC,IAAI,SAAS,CAAC,QAAQ,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha3.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha3.d.ts deleted file mode 100644 index 9df47b19..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha3.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { Hash, type CHash, type CHashXO, type HashXOF, type Input } from './utils.ts'; -/** `keccakf1600` internal function, additionally allows to adjust round count. */ -export declare function keccakP(s: Uint32Array, rounds?: number): void; -/** Keccak sponge function. */ -export declare class Keccak extends Hash implements HashXOF { - protected state: Uint8Array; - protected pos: number; - protected posOut: number; - protected finished: boolean; - protected state32: Uint32Array; - protected destroyed: boolean; - blockLen: number; - suffix: number; - outputLen: number; - protected enableXOF: boolean; - protected rounds: number; - constructor(blockLen: number, suffix: number, outputLen: number, enableXOF?: boolean, rounds?: number); - clone(): Keccak; - protected keccak(): void; - update(data: Input): this; - protected finish(): void; - protected writeInto(out: Uint8Array): Uint8Array; - xofInto(out: Uint8Array): Uint8Array; - xof(bytes: number): Uint8Array; - digestInto(out: Uint8Array): Uint8Array; - digest(): Uint8Array; - destroy(): void; - _cloneInto(to?: Keccak): Keccak; -} -/** SHA3-224 hash function. */ -export declare const sha3_224: CHash; -/** SHA3-256 hash function. Different from keccak-256. */ -export declare const sha3_256: CHash; -/** SHA3-384 hash function. */ -export declare const sha3_384: CHash; -/** SHA3-512 hash function. */ -export declare const sha3_512: CHash; -/** keccak-224 hash function. */ -export declare const keccak_224: CHash; -/** keccak-256 hash function. Different from SHA3-256. */ -export declare const keccak_256: CHash; -/** keccak-384 hash function. */ -export declare const keccak_384: CHash; -/** keccak-512 hash function. */ -export declare const keccak_512: CHash; -export type ShakeOpts = { - dkLen?: number; -}; -/** SHAKE128 XOF with 128-bit security. */ -export declare const shake128: CHashXO; -/** SHAKE256 XOF with 256-bit security. */ -export declare const shake256: CHashXO; -//# sourceMappingURL=sha3.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha3.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha3.d.ts.map deleted file mode 100644 index 60241338..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha3.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha3.d.ts","sourceRoot":"","sources":["../src/sha3.ts"],"names":[],"mappings":"AAaA,OAAO,EAE6B,IAAI,EAGtC,KAAK,KAAK,EAAE,KAAK,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EACnD,MAAM,YAAY,CAAC;AAoCpB,kFAAkF;AAClF,wBAAgB,OAAO,CAAC,CAAC,EAAE,WAA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;AAC9B,eAAO,MAAM,QAAQ,EAAE,KAAyD,CAAC;AACjF,8BAA8B;AAC9B,eAAO,MAAM,QAAQ,EAAE,KAAwD,CAAC;AAEhF,gCAAgC;AAChC,eAAO,MAAM,UAAU,EAAE,KAAyD,CAAC;AACnF,yDAAyD;AACzD,eAAO,MAAM,UAAU,EAAE,KAAyD,CAAC;AACnF,gCAAgC;AAChC,eAAO,MAAM,UAAU,EAAE,KAAyD,CAAC;AACnF,gCAAgC;AAChC,eAAO,MAAM,UAAU,EAAE,KAAwD,CAAC;AAElF,MAAM,MAAM,SAAS,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAQ3C,0CAA0C;AAC1C,eAAO,MAAM,QAAQ,EAAE,OAAgE,CAAC;AACxF,0CAA0C;AAC1C,eAAO,MAAM,QAAQ,EAAE,OAAgE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha3.js b/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha3.js deleted file mode 100644 index ed813d18..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha3.js +++ /dev/null @@ -1,234 +0,0 @@ -/** - * SHA3 (keccak) hash function, based on a new "Sponge function" design. - * Different from older hashes, the internal state is bigger than output size. - * - * Check out [FIPS-202](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf), - * [Website](https://keccak.team/keccak.html), - * [the differences between SHA-3 and Keccak](https://crypto.stackexchange.com/questions/15727/what-are-the-key-differences-between-the-draft-sha-3-standard-and-the-keccak-sub). - * - * Check out `sha3-addons` module for cSHAKE, k12, and others. - * @module - */ -import { rotlBH, rotlBL, rotlSH, rotlSL, split } from "./_u64.js"; -// prettier-ignore -import { abytes, aexists, anumber, aoutput, clean, createHasher, createXOFer, Hash, swap32IfBE, toBytes, u32 } from "./utils.js"; -// No __PURE__ annotations in sha3 header: -// EVERYTHING is in fact used on every export. -// Various per round constants calculations -const _0n = BigInt(0); -const _1n = BigInt(1); -const _2n = BigInt(2); -const _7n = BigInt(7); -const _256n = BigInt(256); -const _0x71n = BigInt(0x71); -const SHA3_PI = []; -const SHA3_ROTL = []; -const _SHA3_IOTA = []; -for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) { - // Pi - [x, y] = [y, (2 * x + 3 * y) % 5]; - SHA3_PI.push(2 * (5 * y + x)); - // Rotational - SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64); - // Iota - let t = _0n; - for (let j = 0; j < 7; j++) { - R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n; - if (R & _2n) - t ^= _1n << ((_1n << /* @__PURE__ */ BigInt(j)) - _1n); - } - _SHA3_IOTA.push(t); -} -const IOTAS = split(_SHA3_IOTA, true); -const SHA3_IOTA_H = IOTAS[0]; -const SHA3_IOTA_L = IOTAS[1]; -// Left rotation (without 0, 32, 64) -const rotlH = (h, l, s) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s)); -const rotlL = (h, l, s) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s)); -/** `keccakf1600` internal function, additionally allows to adjust round count. */ -export function keccakP(s, rounds = 24) { - const B = new Uint32Array(5 * 2); - // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js) - for (let round = 24 - rounds; round < 24; round++) { - // Theta θ - for (let x = 0; x < 10; x++) - B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40]; - for (let x = 0; x < 10; x += 2) { - const idx1 = (x + 8) % 10; - const idx0 = (x + 2) % 10; - const B0 = B[idx0]; - const B1 = B[idx0 + 1]; - const Th = rotlH(B0, B1, 1) ^ B[idx1]; - const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1]; - for (let y = 0; y < 50; y += 10) { - s[x + y] ^= Th; - s[x + y + 1] ^= Tl; - } - } - // Rho (ρ) and Pi (π) - let curH = s[2]; - let curL = s[3]; - for (let t = 0; t < 24; t++) { - const shift = SHA3_ROTL[t]; - const Th = rotlH(curH, curL, shift); - const Tl = rotlL(curH, curL, shift); - const PI = SHA3_PI[t]; - curH = s[PI]; - curL = s[PI + 1]; - s[PI] = Th; - s[PI + 1] = Tl; - } - // Chi (χ) - for (let y = 0; y < 50; y += 10) { - for (let x = 0; x < 10; x++) - B[x] = s[y + x]; - for (let x = 0; x < 10; x++) - s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10]; - } - // Iota (ι) - s[0] ^= SHA3_IOTA_H[round]; - s[1] ^= SHA3_IOTA_L[round]; - } - clean(B); -} -/** Keccak sponge function. */ -export class Keccak extends Hash { - // NOTE: we accept arguments in bytes instead of bits here. - constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) { - super(); - this.pos = 0; - this.posOut = 0; - this.finished = false; - this.destroyed = false; - this.enableXOF = false; - this.blockLen = blockLen; - this.suffix = suffix; - this.outputLen = outputLen; - this.enableXOF = enableXOF; - this.rounds = rounds; - // Can be passed from user as dkLen - anumber(outputLen); - // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes - // 0 < blockLen < 200 - if (!(0 < blockLen && blockLen < 200)) - throw new Error('only keccak-f1600 function is supported'); - this.state = new Uint8Array(200); - this.state32 = u32(this.state); - } - clone() { - return this._cloneInto(); - } - keccak() { - swap32IfBE(this.state32); - keccakP(this.state32, this.rounds); - swap32IfBE(this.state32); - this.posOut = 0; - this.pos = 0; - } - update(data) { - aexists(this); - data = toBytes(data); - abytes(data); - const { blockLen, state } = this; - const len = data.length; - for (let pos = 0; pos < len;) { - const take = Math.min(blockLen - this.pos, len - pos); - for (let i = 0; i < take; i++) - state[this.pos++] ^= data[pos++]; - if (this.pos === blockLen) - this.keccak(); - } - return this; - } - finish() { - if (this.finished) - return; - this.finished = true; - const { state, suffix, pos, blockLen } = this; - // Do the padding - state[pos] ^= suffix; - if ((suffix & 0x80) !== 0 && pos === blockLen - 1) - this.keccak(); - state[blockLen - 1] ^= 0x80; - this.keccak(); - } - writeInto(out) { - aexists(this, false); - abytes(out); - this.finish(); - const bufferOut = this.state; - const { blockLen } = this; - for (let pos = 0, len = out.length; pos < len;) { - if (this.posOut >= blockLen) - this.keccak(); - const take = Math.min(blockLen - this.posOut, len - pos); - out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); - this.posOut += take; - pos += take; - } - return out; - } - xofInto(out) { - // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF - if (!this.enableXOF) - throw new Error('XOF is not possible for this instance'); - return this.writeInto(out); - } - xof(bytes) { - anumber(bytes); - return this.xofInto(new Uint8Array(bytes)); - } - digestInto(out) { - aoutput(out, this); - if (this.finished) - throw new Error('digest() was already called'); - this.writeInto(out); - this.destroy(); - return out; - } - digest() { - return this.digestInto(new Uint8Array(this.outputLen)); - } - destroy() { - this.destroyed = true; - clean(this.state); - } - _cloneInto(to) { - const { blockLen, suffix, outputLen, rounds, enableXOF } = this; - to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds)); - to.state32.set(this.state32); - to.pos = this.pos; - to.posOut = this.posOut; - to.finished = this.finished; - to.rounds = rounds; - // Suffix can change in cSHAKE - to.suffix = suffix; - to.outputLen = outputLen; - to.enableXOF = enableXOF; - to.destroyed = this.destroyed; - return to; - } -} -const gen = (suffix, blockLen, outputLen) => createHasher(() => new Keccak(blockLen, suffix, outputLen)); -/** SHA3-224 hash function. */ -export const sha3_224 = /* @__PURE__ */ (() => gen(0x06, 144, 224 / 8))(); -/** SHA3-256 hash function. Different from keccak-256. */ -export const sha3_256 = /* @__PURE__ */ (() => gen(0x06, 136, 256 / 8))(); -/** SHA3-384 hash function. */ -export const sha3_384 = /* @__PURE__ */ (() => gen(0x06, 104, 384 / 8))(); -/** SHA3-512 hash function. */ -export const sha3_512 = /* @__PURE__ */ (() => gen(0x06, 72, 512 / 8))(); -/** keccak-224 hash function. */ -export const keccak_224 = /* @__PURE__ */ (() => gen(0x01, 144, 224 / 8))(); -/** keccak-256 hash function. Different from SHA3-256. */ -export const keccak_256 = /* @__PURE__ */ (() => gen(0x01, 136, 256 / 8))(); -/** keccak-384 hash function. */ -export const keccak_384 = /* @__PURE__ */ (() => gen(0x01, 104, 384 / 8))(); -/** keccak-512 hash function. */ -export const keccak_512 = /* @__PURE__ */ (() => gen(0x01, 72, 512 / 8))(); -const genShake = (suffix, blockLen, outputLen) => createXOFer((opts = {}) => new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true)); -/** SHAKE128 XOF with 128-bit security. */ -export const shake128 = /* @__PURE__ */ (() => genShake(0x1f, 168, 128 / 8))(); -/** SHAKE256 XOF with 256-bit security. */ -export const shake256 = /* @__PURE__ */ (() => genShake(0x1f, 136, 256 / 8))(); -//# sourceMappingURL=sha3.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha3.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha3.js.map deleted file mode 100644 index a0adf0ea..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha3.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha3.js","sourceRoot":"","sources":["../src/sha3.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClE,kBAAkB;AAClB,OAAO,EACL,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EACjC,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,IAAI,EACtC,UAAU,EACV,OAAO,EAAE,GAAG,EAEb,MAAM,YAAY,CAAC;AAEpB,0CAA0C;AAC1C,8CAA8C;AAC9C,2CAA2C;AAC3C,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,MAAM,CAAC,C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,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;AACnF,gCAAgC;AAChC,MAAM,CAAC,MAAM,UAAU,GAAU,eAAe,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;AAIlF,MAAM,QAAQ,GAAG,CAAC,MAAc,EAAE,QAAgB,EAAE,SAAiB,EAAE,EAAE,CACvE,WAAW,CACT,CAAC,OAAkB,EAAE,EAAE,EAAE,CACvB,IAAI,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CACxF,CAAC;AAEJ,0CAA0C;AAC1C,MAAM,CAAC,MAAM,QAAQ,GAAY,eAAe,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;AACxF,0CAA0C;AAC1C,MAAM,CAAC,MAAM,QAAQ,GAAY,eAAe,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha512.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha512.d.ts deleted file mode 100644 index 46a27d02..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha512.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * SHA2-512 a.k.a. sha512 and sha384. It is slower than sha256 in js because u64 operations are slow. - * - * Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and - * [the paper on truncated SHA512/256](https://eprint.iacr.org/2010/548.pdf). - * @module - * @deprecated - */ -import { SHA384 as SHA384n, sha384 as sha384n, sha512_224 as sha512_224n, SHA512_224 as SHA512_224n, sha512_256 as sha512_256n, SHA512_256 as SHA512_256n, SHA512 as SHA512n, sha512 as sha512n } from './sha2.ts'; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export declare const SHA512: typeof SHA512n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export declare const sha512: typeof sha512n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export declare const SHA384: typeof SHA384n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export declare const sha384: typeof sha384n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export declare const SHA512_224: typeof SHA512_224n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export declare const sha512_224: typeof sha512_224n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export declare const SHA512_256: typeof SHA512_256n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export declare const sha512_256: typeof sha512_256n; -//# sourceMappingURL=sha512.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha512.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha512.d.ts.map deleted file mode 100644 index 3886bc81..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha512.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha512.d.ts","sourceRoot":"","sources":["../src/sha512.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,MAAM,IAAI,OAAO,EACjB,MAAM,IAAI,OAAO,EACjB,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,EACzB,MAAM,IAAI,OAAO,EACjB,MAAM,IAAI,OAAO,EAClB,MAAM,WAAW,CAAC;AACnB,6DAA6D;AAC7D,eAAO,MAAM,MAAM,EAAE,OAAO,OAAiB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,MAAM,EAAE,OAAO,OAAiB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,MAAM,EAAE,OAAO,OAAiB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,MAAM,EAAE,OAAO,OAAiB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,UAAU,EAAE,OAAO,WAAyB,CAAC;AAC1D,6DAA6D;AAC7D,eAAO,MAAM,UAAU,EAAE,OAAO,WAAyB,CAAC;AAC1D,6DAA6D;AAC7D,eAAO,MAAM,UAAU,EAAE,OAAO,WAAyB,CAAC;AAC1D,6DAA6D;AAC7D,eAAO,MAAM,UAAU,EAAE,OAAO,WAAyB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha512.js b/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha512.js deleted file mode 100644 index d5f69106..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha512.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * SHA2-512 a.k.a. sha512 and sha384. It is slower than sha256 in js because u64 operations are slow. - * - * Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and - * [the paper on truncated SHA512/256](https://eprint.iacr.org/2010/548.pdf). - * @module - * @deprecated - */ -import { SHA384 as SHA384n, sha384 as sha384n, sha512_224 as sha512_224n, SHA512_224 as SHA512_224n, sha512_256 as sha512_256n, SHA512_256 as SHA512_256n, SHA512 as SHA512n, sha512 as sha512n, } from "./sha2.js"; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export const SHA512 = SHA512n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export const sha512 = sha512n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export const SHA384 = SHA384n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export const sha384 = sha384n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export const SHA512_224 = SHA512_224n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export const sha512_224 = sha512_224n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export const SHA512_256 = SHA512_256n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export const sha512_256 = sha512_256n; -//# sourceMappingURL=sha512.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha512.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha512.js.map deleted file mode 100644 index 03716555..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/sha512.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha512.js","sourceRoot":"","sources":["../src/sha512.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,MAAM,IAAI,OAAO,EACjB,MAAM,IAAI,OAAO,EACjB,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,EACzB,MAAM,IAAI,OAAO,EACjB,MAAM,IAAI,OAAO,GAClB,MAAM,WAAW,CAAC;AACnB,6DAA6D;AAC7D,MAAM,CAAC,MAAM,MAAM,GAAmB,OAAO,CAAC;AAC9C,6DAA6D;AAC7D,MAAM,CAAC,MAAM,MAAM,GAAmB,OAAO,CAAC;AAC9C,6DAA6D;AAC7D,MAAM,CAAC,MAAM,MAAM,GAAmB,OAAO,CAAC;AAC9C,6DAA6D;AAC7D,MAAM,CAAC,MAAM,MAAM,GAAmB,OAAO,CAAC;AAC9C,6DAA6D;AAC7D,MAAM,CAAC,MAAM,UAAU,GAAuB,WAAW,CAAC;AAC1D,6DAA6D;AAC7D,MAAM,CAAC,MAAM,UAAU,GAAuB,WAAW,CAAC;AAC1D,6DAA6D;AAC7D,MAAM,CAAC,MAAM,UAAU,GAAuB,WAAW,CAAC;AAC1D,6DAA6D;AAC7D,MAAM,CAAC,MAAM,UAAU,GAAuB,WAAW,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/utils.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/esm/utils.d.ts deleted file mode 100644 index 90b8439b..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/utils.d.ts +++ /dev/null @@ -1,161 +0,0 @@ -/** - * Utilities for hex, bytes, CSPRNG. - * @module - */ -/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */ -export declare function isBytes(a: unknown): a is Uint8Array; -/** Asserts something is positive integer. */ -export declare function anumber(n: number): void; -/** Asserts something is Uint8Array. */ -export declare function abytes(b: Uint8Array | undefined, ...lengths: number[]): void; -/** Asserts something is hash */ -export declare function ahash(h: IHash): void; -/** Asserts a hash instance has not been destroyed / finished */ -export declare function aexists(instance: any, checkFinished?: boolean): void; -/** Asserts output is properly-sized byte array */ -export declare function aoutput(out: any, instance: any): void; -/** Generic type encompassing 8/16/32-byte arrays - but not 64-byte. */ -export type TypedArray = Int8Array | Uint8ClampedArray | Uint8Array | Uint16Array | Int16Array | Uint32Array | Int32Array; -/** Cast u8 / u16 / u32 to u8. */ -export declare function u8(arr: TypedArray): Uint8Array; -/** Cast u8 / u16 / u32 to u32. */ -export declare function u32(arr: TypedArray): Uint32Array; -/** Zeroize a byte array. Warning: JS provides no guarantees. */ -export declare function clean(...arrays: TypedArray[]): void; -/** Create DataView of an array for easy byte-level manipulation. */ -export declare function createView(arr: TypedArray): DataView; -/** The rotate right (circular right shift) operation for uint32 */ -export declare function rotr(word: number, shift: number): number; -/** The rotate left (circular left shift) operation for uint32 */ -export declare function rotl(word: number, shift: number): number; -/** Is current platform little-endian? Most are. Big-Endian platform: IBM */ -export declare const isLE: boolean; -/** The byte swap operation for uint32 */ -export declare function byteSwap(word: number): number; -/** Conditionally byte swap if on a big-endian platform */ -export declare const swap8IfBE: (n: number) => number; -/** @deprecated */ -export declare const byteSwapIfBE: typeof swap8IfBE; -/** In place byte swap for Uint32Array */ -export declare function byteSwap32(arr: Uint32Array): Uint32Array; -export declare const swap32IfBE: (u: Uint32Array) => Uint32Array; -/** - * Convert byte array to hex string. Uses built-in function, when available. - * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123' - */ -export declare function bytesToHex(bytes: Uint8Array): string; -/** - * Convert hex string to byte array. Uses built-in function, when available. - * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23]) - */ -export declare function hexToBytes(hex: string): Uint8Array; -/** - * There is no setImmediate in browser and setTimeout is slow. - * Call of async fn will return Promise, which will be fullfiled only on - * next scheduler queue processing step and this is exactly what we need. - */ -export declare const nextTick: () => Promise; -/** Returns control to thread each 'tick' ms to avoid blocking. */ -export declare function asyncLoop(iters: number, tick: number, cb: (i: number) => void): Promise; -/** - * Converts string to bytes using UTF8 encoding. - * @example utf8ToBytes('abc') // Uint8Array.from([97, 98, 99]) - */ -export declare function utf8ToBytes(str: string): Uint8Array; -/** - * Converts bytes to string using UTF8 encoding. - * @example bytesToUtf8(Uint8Array.from([97, 98, 99])) // 'abc' - */ -export declare function bytesToUtf8(bytes: Uint8Array): string; -/** Accepted input of hash functions. Strings are converted to byte arrays. */ -export type Input = string | Uint8Array; -/** - * Normalizes (non-hex) string or Uint8Array to Uint8Array. - * Warning: when Uint8Array is passed, it would NOT get copied. - * Keep in mind for future mutable operations. - */ -export declare function toBytes(data: Input): Uint8Array; -/** KDFs can accept string or Uint8Array for user convenience. */ -export type KDFInput = string | Uint8Array; -/** - * Helper for KDFs: consumes uint8array or string. - * When string is passed, does utf8 decoding, using TextDecoder. - */ -export declare function kdfInputToBytes(data: KDFInput): Uint8Array; -/** Copies several Uint8Arrays into one. */ -export declare function concatBytes(...arrays: Uint8Array[]): Uint8Array; -type EmptyObj = {}; -export declare function checkOpts(defaults: T1, opts?: T2): T1 & T2; -/** Hash interface. */ -export type IHash = { - (data: Uint8Array): Uint8Array; - blockLen: number; - outputLen: number; - create: any; -}; -/** For runtime check if class implements interface */ -export declare abstract class Hash> { - abstract blockLen: number; - abstract outputLen: number; - abstract update(buf: Input): this; - abstract digestInto(buf: Uint8Array): void; - abstract digest(): Uint8Array; - /** - * Resets internal state. Makes Hash instance unusable. - * Reset is impossible for keyed hashes if key is consumed into state. If digest is not consumed - * by user, they will need to manually call `destroy()` when zeroing is necessary. - */ - abstract destroy(): void; - /** - * Clones hash instance. Unsafe: doesn't check whether `to` is valid. Can be used as `clone()` - * when no options are passed. - * Reasons to use `_cloneInto` instead of clone: 1) performance 2) reuse instance => all internal - * buffers are overwritten => causes buffer overwrite which is used for digest in some cases. - * There are no guarantees for clean-up because it's impossible in JS. - */ - abstract _cloneInto(to?: T): T; - abstract clone(): T; -} -/** - * XOF: streaming API to read digest in chunks. - * Same as 'squeeze' in keccak/k12 and 'seek' in blake3, but more generic name. - * When hash used in XOF mode it is up to user to call '.destroy' afterwards, since we cannot - * destroy state, next call can require more bytes. - */ -export type HashXOF> = Hash & { - xof(bytes: number): Uint8Array; - xofInto(buf: Uint8Array): Uint8Array; -}; -/** Hash function */ -export type CHash = ReturnType; -/** Hash function with output */ -export type CHashO = ReturnType; -/** XOF with output */ -export type CHashXO = ReturnType; -/** Wraps hash function, creating an interface on top of it */ -export declare function createHasher>(hashCons: () => Hash): { - (msg: Input): Uint8Array; - outputLen: number; - blockLen: number; - create(): Hash; -}; -export declare function createOptHasher, T extends Object>(hashCons: (opts?: T) => Hash): { - (msg: Input, opts?: T): Uint8Array; - outputLen: number; - blockLen: number; - create(opts?: T): Hash; -}; -export declare function createXOFer, T extends Object>(hashCons: (opts?: T) => HashXOF): { - (msg: Input, opts?: T): Uint8Array; - outputLen: number; - blockLen: number; - create(opts?: T): HashXOF; -}; -export declare const wrapConstructor: typeof createHasher; -export declare const wrapConstructorWithOpts: typeof createOptHasher; -export declare const wrapXOFConstructorWithOpts: typeof createXOFer; -/** Cryptographically secure PRNG. Uses internal OS-level `crypto.getRandomValues`. */ -export declare function randomBytes(bytesLength?: number): Uint8Array; -export {}; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/utils.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/utils.d.ts.map deleted file mode 100644 index 8ab65703..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,sEAAsE;AAUtE,qFAAqF;AACrF,wBAAgB,OAAO,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,UAAU,CAEnD;AAED,6CAA6C;AAC7C,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAEvC;AAED,uCAAuC;AACvC,wBAAgB,MAAM,CAAC,CAAC,EAAE,UAAU,GAAG,SAAS,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAI5E;AAED,gCAAgC;AAChC,wBAAgB,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI,CAKpC;AAED,gEAAgE;AAChE,wBAAgB,OAAO,CAAC,QAAQ,EAAE,GAAG,EAAE,aAAa,UAAO,GAAG,IAAI,CAGjE;AAED,kDAAkD;AAClD,wBAAgB,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,GAAG,IAAI,CAMrD;AAED,uEAAuE;AAEvE,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,iBAAiB,GAAG,UAAU,GACjE,WAAW,GAAG,UAAU,GAAG,WAAW,GAAG,UAAU,CAAC;AAEtD,iCAAiC;AACjC,wBAAgB,EAAE,CAAC,GAAG,EAAE,UAAU,GAAG,UAAU,CAE9C;AAED,kCAAkC;AAClC,wBAAgB,GAAG,CAAC,GAAG,EAAE,UAAU,GAAG,WAAW,CAEhD;AAED,gEAAgE;AAChE,wBAAgB,KAAK,CAAC,GAAG,MAAM,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,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;CAC3B,CAOA;AAED,wBAAgB,WAAW,CAAC,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,EAChE,QAAQ,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,GACjC;IACD,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CAC9B,CAOA;AACD,eAAO,MAAM,eAAe,EAAE,OAAO,YAA2B,CAAC;AACjE,eAAO,MAAM,uBAAuB,EAAE,OAAO,eAAiC,CAAC;AAC/E,eAAO,MAAM,0BAA0B,EAAE,OAAO,WAAyB,CAAC;AAE1E,sFAAsF;AACtF,wBAAgB,WAAW,CAAC,WAAW,SAAK,GAAG,UAAU,CASxD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/utils.js b/tools/mnemonic-test/node_modules/@noble/hashes/esm/utils.js deleted file mode 100644 index 9614c8e5..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/utils.js +++ /dev/null @@ -1,281 +0,0 @@ -/** - * Utilities for hex, bytes, CSPRNG. - * @module - */ -/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+. -// node.js versions earlier than v19 don't declare it in global scope. -// For node.js, package.json#exports field mapping rewrites import -// from `crypto` to `cryptoNode`, which imports native module. -// Makes the utils un-importable in browsers without a bundler. -// Once node.js 18 is deprecated (2025-04-30), we can just drop the import. -import { crypto } from '@noble/hashes/crypto'; -/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */ -export function isBytes(a) { - return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array'); -} -/** Asserts something is positive integer. */ -export function anumber(n) { - if (!Number.isSafeInteger(n) || n < 0) - throw new Error('positive integer expected, got ' + n); -} -/** Asserts something is Uint8Array. */ -export function abytes(b, ...lengths) { - if (!isBytes(b)) - throw new Error('Uint8Array expected'); - if (lengths.length > 0 && !lengths.includes(b.length)) - throw new Error('Uint8Array expected of length ' + lengths + ', got length=' + b.length); -} -/** Asserts something is hash */ -export function ahash(h) { - if (typeof h !== 'function' || typeof h.create !== 'function') - throw new Error('Hash should be wrapped by utils.createHasher'); - anumber(h.outputLen); - anumber(h.blockLen); -} -/** Asserts a hash instance has not been destroyed / finished */ -export function aexists(instance, checkFinished = true) { - if (instance.destroyed) - throw new Error('Hash instance has been destroyed'); - if (checkFinished && instance.finished) - throw new Error('Hash#digest() has already been called'); -} -/** Asserts output is properly-sized byte array */ -export function aoutput(out, instance) { - abytes(out); - const min = instance.outputLen; - if (out.length < min) { - throw new Error('digestInto() expects output buffer of length at least ' + min); - } -} -/** Cast u8 / u16 / u32 to u8. */ -export function u8(arr) { - return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength); -} -/** Cast u8 / u16 / u32 to u32. */ -export function u32(arr) { - return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); -} -/** Zeroize a byte array. Warning: JS provides no guarantees. */ -export function clean(...arrays) { - for (let i = 0; i < arrays.length; i++) { - arrays[i].fill(0); - } -} -/** Create DataView of an array for easy byte-level manipulation. */ -export function createView(arr) { - return new DataView(arr.buffer, arr.byteOffset, arr.byteLength); -} -/** The rotate right (circular right shift) operation for uint32 */ -export function rotr(word, shift) { - return (word << (32 - shift)) | (word >>> shift); -} -/** The rotate left (circular left shift) operation for uint32 */ -export function rotl(word, shift) { - return (word << shift) | ((word >>> (32 - shift)) >>> 0); -} -/** Is current platform little-endian? Most are. Big-Endian platform: IBM */ -export const isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)(); -/** The byte swap operation for uint32 */ -export function byteSwap(word) { - return (((word << 24) & 0xff000000) | - ((word << 8) & 0xff0000) | - ((word >>> 8) & 0xff00) | - ((word >>> 24) & 0xff)); -} -/** Conditionally byte swap if on a big-endian platform */ -export const swap8IfBE = isLE - ? (n) => n - : (n) => byteSwap(n); -/** @deprecated */ -export const byteSwapIfBE = swap8IfBE; -/** In place byte swap for Uint32Array */ -export function byteSwap32(arr) { - for (let i = 0; i < arr.length; i++) { - arr[i] = byteSwap(arr[i]); - } - return arr; -} -export const swap32IfBE = isLE - ? (u) => u - : byteSwap32; -// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex -const hasHexBuiltin = /* @__PURE__ */ (() => -// @ts-ignore -typeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function')(); -// Array where index 0xf0 (240) is mapped to string 'f0' -const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0')); -/** - * Convert byte array to hex string. Uses built-in function, when available. - * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123' - */ -export function bytesToHex(bytes) { - abytes(bytes); - // @ts-ignore - if (hasHexBuiltin) - return bytes.toHex(); - // pre-caching improves the speed 6x - let hex = ''; - for (let i = 0; i < bytes.length; i++) { - hex += hexes[bytes[i]]; - } - return hex; -} -// We use optimized technique to convert hex string to byte array -const asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 }; -function asciiToBase16(ch) { - if (ch >= asciis._0 && ch <= asciis._9) - return ch - asciis._0; // '2' => 50-48 - if (ch >= asciis.A && ch <= asciis.F) - return ch - (asciis.A - 10); // 'B' => 66-(65-10) - if (ch >= asciis.a && ch <= asciis.f) - return ch - (asciis.a - 10); // 'b' => 98-(97-10) - return; -} -/** - * Convert hex string to byte array. Uses built-in function, when available. - * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23]) - */ -export function hexToBytes(hex) { - if (typeof hex !== 'string') - throw new Error('hex string expected, got ' + typeof hex); - // @ts-ignore - if (hasHexBuiltin) - return Uint8Array.fromHex(hex); - const hl = hex.length; - const al = hl / 2; - if (hl % 2) - throw new Error('hex string expected, got unpadded hex of length ' + hl); - const array = new Uint8Array(al); - for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) { - const n1 = asciiToBase16(hex.charCodeAt(hi)); - const n2 = asciiToBase16(hex.charCodeAt(hi + 1)); - if (n1 === undefined || n2 === undefined) { - const char = hex[hi] + hex[hi + 1]; - throw new Error('hex string expected, got non-hex character "' + char + '" at index ' + hi); - } - array[ai] = n1 * 16 + n2; // multiply first octet, e.g. 'a3' => 10*16+3 => 160 + 3 => 163 - } - return array; -} -/** - * There is no setImmediate in browser and setTimeout is slow. - * Call of async fn will return Promise, which will be fullfiled only on - * next scheduler queue processing step and this is exactly what we need. - */ -export const nextTick = async () => { }; -/** Returns control to thread each 'tick' ms to avoid blocking. */ -export async function asyncLoop(iters, tick, cb) { - let ts = Date.now(); - for (let i = 0; i < iters; i++) { - cb(i); - // Date.now() is not monotonic, so in case if clock goes backwards we return return control too - const diff = Date.now() - ts; - if (diff >= 0 && diff < tick) - continue; - await nextTick(); - ts += diff; - } -} -/** - * Converts string to bytes using UTF8 encoding. - * @example utf8ToBytes('abc') // Uint8Array.from([97, 98, 99]) - */ -export function utf8ToBytes(str) { - if (typeof str !== 'string') - throw new Error('string expected'); - return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809 -} -/** - * Converts bytes to string using UTF8 encoding. - * @example bytesToUtf8(Uint8Array.from([97, 98, 99])) // 'abc' - */ -export function bytesToUtf8(bytes) { - return new TextDecoder().decode(bytes); -} -/** - * Normalizes (non-hex) string or Uint8Array to Uint8Array. - * Warning: when Uint8Array is passed, it would NOT get copied. - * Keep in mind for future mutable operations. - */ -export function toBytes(data) { - if (typeof data === 'string') - data = utf8ToBytes(data); - abytes(data); - return data; -} -/** - * Helper for KDFs: consumes uint8array or string. - * When string is passed, does utf8 decoding, using TextDecoder. - */ -export function kdfInputToBytes(data) { - if (typeof data === 'string') - data = utf8ToBytes(data); - abytes(data); - return data; -} -/** Copies several Uint8Arrays into one. */ -export function concatBytes(...arrays) { - let sum = 0; - for (let i = 0; i < arrays.length; i++) { - const a = arrays[i]; - abytes(a); - sum += a.length; - } - const res = new Uint8Array(sum); - for (let i = 0, pad = 0; i < arrays.length; i++) { - const a = arrays[i]; - res.set(a, pad); - pad += a.length; - } - return res; -} -export function checkOpts(defaults, opts) { - if (opts !== undefined && {}.toString.call(opts) !== '[object Object]') - throw new Error('options should be object or undefined'); - const merged = Object.assign(defaults, opts); - return merged; -} -/** For runtime check if class implements interface */ -export class Hash { -} -/** Wraps hash function, creating an interface on top of it */ -export function createHasher(hashCons) { - const hashC = (msg) => hashCons().update(toBytes(msg)).digest(); - const tmp = hashCons(); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = () => hashCons(); - return hashC; -} -export function createOptHasher(hashCons) { - const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest(); - const tmp = hashCons({}); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = (opts) => hashCons(opts); - return hashC; -} -export function createXOFer(hashCons) { - const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest(); - const tmp = hashCons({}); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = (opts) => hashCons(opts); - return hashC; -} -export const wrapConstructor = createHasher; -export const wrapConstructorWithOpts = createOptHasher; -export const wrapXOFConstructorWithOpts = createXOFer; -/** Cryptographically secure PRNG. Uses internal OS-level `crypto.getRandomValues`. */ -export function randomBytes(bytesLength = 32) { - if (crypto && typeof crypto.getRandomValues === 'function') { - return crypto.getRandomValues(new Uint8Array(bytesLength)); - } - // Legacy Node.js compatibility - if (crypto && typeof crypto.randomBytes === 'function') { - return Uint8Array.from(crypto.randomBytes(bytesLength)); - } - throw new Error('crypto.getRandomValues must be defined'); -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/esm/utils.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/esm/utils.js.map deleted file mode 100644 index 8a068c08..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/esm/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,sEAAsE;AAEtE,oFAAoF;AACpF,sEAAsE;AACtE,kEAAkE;AAClE,8DAA8D;AAC9D,+DAA+D;AAC/D,2EAA2E;AAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,qFAAqF;AACrF,MAAM,UAAU,OAAO,CAAC,CAAU;IAChC,OAAO,CAAC,YAAY,UAAU,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC;AACnG,CAAC;AAED,6CAA6C;AAC7C,MAAM,UAAU,OAAO,CAAC,CAAS;IAC/B,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,iCAAiC,GAAG,CAAC,CAAC,CAAC;AAChG,CAAC;AAED,uCAAuC;AACvC,MAAM,UAAU,MAAM,CAAC,CAAyB,EAAE,GAAG,OAAiB;IACpE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;IACxD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC;QAC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K,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC;IAChC,KAAK,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;IAC9B,KAAK,CAAC,MAAM,GAAG,CAAC,IAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC5C,OAAO,KAAK,CAAC;AACf,CAAC;AACD,MAAM,CAAC,MAAM,eAAe,GAAwB,YAAY,CAAC;AACjE,MAAM,CAAC,MAAM,uBAAuB,GAA2B,eAAe,CAAC;AAC/E,MAAM,CAAC,MAAM,0BAA0B,GAAuB,WAAW,CAAC;AAE1E,sFAAsF;AACtF,MAAM,UAAU,WAAW,CAAC,WAAW,GAAG,EAAE;IAC1C,IAAI,MAAM,IAAI,OAAO,MAAM,CAAC,eAAe,KAAK,UAAU,EAAE,CAAC;QAC3D,OAAO,MAAM,CAAC,eAAe,CAAC,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC;IAC7D,CAAC;IACD,+BAA+B;IAC/B,IAAI,MAAM,IAAI,OAAO,MAAM,CAAC,WAAW,KAAK,UAAU,EAAE,CAAC;QACvD,OAAO,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC;IAC1D,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;AAC5D,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/hkdf.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/hkdf.d.ts deleted file mode 100644 index c54c4ab2..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/hkdf.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { type CHash, type Input } from './utils.ts'; -/** - * HKDF-extract from spec. Less important part. `HKDF-Extract(IKM, salt) -> PRK` - * Arguments position differs from spec (IKM is first one, since it is not optional) - * @param hash - hash function that would be used (e.g. sha256) - * @param ikm - input keying material, the initial key - * @param salt - optional salt value (a non-secret random value) - */ -export declare function extract(hash: CHash, ikm: Input, salt?: Input): Uint8Array; -/** - * HKDF-expand from the spec. The most important part. `HKDF-Expand(PRK, info, L) -> OKM` - * @param hash - hash function that would be used (e.g. sha256) - * @param prk - a pseudorandom key of at least HashLen octets (usually, the output from the extract step) - * @param info - optional context and application specific information (can be a zero-length string) - * @param length - length of output keying material in bytes - */ -export declare function expand(hash: CHash, prk: Input, info?: Input, length?: number): Uint8Array; -/** - * HKDF (RFC 5869): derive keys from an initial input. - * Combines hkdf_extract + hkdf_expand in one step - * @param hash - hash function that would be used (e.g. sha256) - * @param ikm - input keying material, the initial key - * @param salt - optional salt value (a non-secret random value) - * @param info - optional context and application specific information (can be a zero-length string) - * @param length - length of output keying material in bytes - * @example - * import { hkdf } from '@noble/hashes/hkdf'; - * import { sha256 } from '@noble/hashes/sha2'; - * import { randomBytes } from '@noble/hashes/utils'; - * const inputKey = randomBytes(32); - * const salt = randomBytes(32); - * const info = 'application-key'; - * const hk1 = hkdf(sha256, inputKey, salt, info, 32); - */ -export declare const hkdf: (hash: CHash, ikm: Input, salt: Input | undefined, info: Input | undefined, length: number) => Uint8Array; -//# sourceMappingURL=hkdf.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/hkdf.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/hkdf.d.ts.map deleted file mode 100644 index 76b0ebb0..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/hkdf.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hkdf.d.ts","sourceRoot":"","sources":["src/hkdf.ts"],"names":[],"mappings":"AAMA,OAAO,EAAkB,KAAK,KAAK,EAAS,KAAK,KAAK,EAAW,MAAM,YAAY,CAAC;AAEpF;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,KAAK,GAAG,UAAU,CAOzE;AAKD;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,GAAE,MAAW,GAAG,UAAU,CA4B7F;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,IAAI,GACf,MAAM,KAAK,EACX,KAAK,KAAK,EACV,MAAM,KAAK,GAAG,SAAS,EACvB,MAAM,KAAK,GAAG,SAAS,EACvB,QAAQ,MAAM,KACb,UAAkE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/hkdf.js b/tools/mnemonic-test/node_modules/@noble/hashes/hkdf.js deleted file mode 100644 index aca16749..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/hkdf.js +++ /dev/null @@ -1,88 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.hkdf = void 0; -exports.extract = extract; -exports.expand = expand; -/** - * HKDF (RFC 5869): extract + expand in one step. - * See https://soatok.blog/2021/11/17/understanding-hkdf/. - * @module - */ -const hmac_ts_1 = require("./hmac.js"); -const utils_ts_1 = require("./utils.js"); -/** - * HKDF-extract from spec. Less important part. `HKDF-Extract(IKM, salt) -> PRK` - * Arguments position differs from spec (IKM is first one, since it is not optional) - * @param hash - hash function that would be used (e.g. sha256) - * @param ikm - input keying material, the initial key - * @param salt - optional salt value (a non-secret random value) - */ -function extract(hash, ikm, salt) { - (0, utils_ts_1.ahash)(hash); - // NOTE: some libraries treat zero-length array as 'not provided'; - // we don't, since we have undefined as 'not provided' - // https://github.com/RustCrypto/KDFs/issues/15 - if (salt === undefined) - salt = new Uint8Array(hash.outputLen); - return (0, hmac_ts_1.hmac)(hash, (0, utils_ts_1.toBytes)(salt), (0, utils_ts_1.toBytes)(ikm)); -} -const HKDF_COUNTER = /* @__PURE__ */ Uint8Array.from([0]); -const EMPTY_BUFFER = /* @__PURE__ */ Uint8Array.of(); -/** - * HKDF-expand from the spec. The most important part. `HKDF-Expand(PRK, info, L) -> OKM` - * @param hash - hash function that would be used (e.g. sha256) - * @param prk - a pseudorandom key of at least HashLen octets (usually, the output from the extract step) - * @param info - optional context and application specific information (can be a zero-length string) - * @param length - length of output keying material in bytes - */ -function expand(hash, prk, info, length = 32) { - (0, utils_ts_1.ahash)(hash); - (0, utils_ts_1.anumber)(length); - const olen = hash.outputLen; - if (length > 255 * olen) - throw new Error('Length should be <= 255*HashLen'); - const blocks = Math.ceil(length / olen); - if (info === undefined) - info = EMPTY_BUFFER; - // first L(ength) octets of T - const okm = new Uint8Array(blocks * olen); - // Re-use HMAC instance between blocks - const HMAC = hmac_ts_1.hmac.create(hash, prk); - const HMACTmp = HMAC._cloneInto(); - const T = new Uint8Array(HMAC.outputLen); - for (let counter = 0; counter < blocks; counter++) { - HKDF_COUNTER[0] = counter + 1; - // T(0) = empty string (zero length) - // T(N) = HMAC-Hash(PRK, T(N-1) | info | N) - HMACTmp.update(counter === 0 ? EMPTY_BUFFER : T) - .update(info) - .update(HKDF_COUNTER) - .digestInto(T); - okm.set(T, olen * counter); - HMAC._cloneInto(HMACTmp); - } - HMAC.destroy(); - HMACTmp.destroy(); - (0, utils_ts_1.clean)(T, HKDF_COUNTER); - return okm.slice(0, length); -} -/** - * HKDF (RFC 5869): derive keys from an initial input. - * Combines hkdf_extract + hkdf_expand in one step - * @param hash - hash function that would be used (e.g. sha256) - * @param ikm - input keying material, the initial key - * @param salt - optional salt value (a non-secret random value) - * @param info - optional context and application specific information (can be a zero-length string) - * @param length - length of output keying material in bytes - * @example - * import { hkdf } from '@noble/hashes/hkdf'; - * import { sha256 } from '@noble/hashes/sha2'; - * import { randomBytes } from '@noble/hashes/utils'; - * const inputKey = randomBytes(32); - * const salt = randomBytes(32); - * const info = 'application-key'; - * const hk1 = hkdf(sha256, inputKey, salt, info, 32); - */ -const hkdf = (hash, ikm, salt, info, length) => expand(hash, extract(hash, ikm, salt), info, length); -exports.hkdf = hkdf; -//# sourceMappingURL=hkdf.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/hkdf.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/hkdf.js.map deleted file mode 100644 index 3d6d4055..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/hkdf.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hkdf.js","sourceRoot":"","sources":["src/hkdf.ts"],"names":[],"mappings":";;;AAeA,0BAOC;AAYD,wBA4BC;AA9DD;;;;GAIG;AACH,uCAAiC;AACjC,yCAAoF;AAEpF;;;;;;GAMG;AACH,SAAgB,OAAO,CAAC,IAAW,EAAE,GAAU,EAAE,IAAY;IAC3D,IAAA,gBAAK,EAAC,IAAI,CAAC,CAAC;IACZ,kEAAkE;IAClE,sDAAsD;IACtD,+CAA+C;IAC/C,IAAI,IAAI,KAAK,SAAS;QAAE,IAAI,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC9D,OAAO,IAAA,cAAI,EAAC,IAAI,EAAE,IAAA,kBAAO,EAAC,IAAI,CAAC,EAAE,IAAA,kBAAO,EAAC,GAAG,CAAC,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,YAAY,GAAG,eAAe,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1D,MAAM,YAAY,GAAG,eAAe,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC;AAErD;;;;;;GAMG;AACH,SAAgB,MAAM,CAAC,IAAW,EAAE,GAAU,EAAE,IAAY,EAAE,SAAiB,EAAE;IAC/E,IAAA,gBAAK,EAAC,IAAI,CAAC,CAAC;IACZ,IAAA,kBAAO,EAAC,MAAM,CAAC,CAAC;IAChB,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC;IAC5B,IAAI,MAAM,GAAG,GAAG,GAAG,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IAC5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X,GAAU,EACV,IAAuB,EACvB,IAAuB,EACvB,MAAc,EACF,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AANzD,QAAA,IAAI,QAMqD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/hmac.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/hmac.d.ts deleted file mode 100644 index 86525f93..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/hmac.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * HMAC: RFC2104 message authentication code. - * @module - */ -import { Hash, type CHash, type Input } from './utils.ts'; -export declare class HMAC> extends Hash> { - oHash: T; - iHash: T; - blockLen: number; - outputLen: number; - private finished; - private destroyed; - constructor(hash: CHash, _key: Input); - update(buf: Input): this; - digestInto(out: Uint8Array): void; - digest(): Uint8Array; - _cloneInto(to?: HMAC): HMAC; - clone(): HMAC; - destroy(): void; -} -/** - * HMAC: RFC2104 message authentication code. - * @param hash - function that would be used e.g. sha256 - * @param key - message key - * @param message - message data - * @example - * import { hmac } from '@noble/hashes/hmac'; - * import { sha256 } from '@noble/hashes/sha2'; - * const mac1 = hmac(sha256, 'key', 'message'); - */ -export declare const hmac: { - (hash: CHash, key: Input, message: Input): Uint8Array; - create(hash: CHash, key: Input): HMAC; -}; -//# sourceMappingURL=hmac.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/hmac.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/hmac.d.ts.map deleted file mode 100644 index 5a7f0f3a..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/hmac.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hmac.d.ts","sourceRoot":"","sources":["src/hmac.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAiC,IAAI,EAAW,KAAK,KAAK,EAAE,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAElG,qBAAa,IAAI,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,CAAC,CAAE,SAAQ,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACxD,KAAK,EAAE,CAAC,CAAC;IACT,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,SAAS,CAAS;gBAEd,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK;IAsBpC,MAAM,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI;IAKxB,UAAU,CAAC,GAAG,EAAE,UAAU,GAAG,IAAI;IASjC,MAAM,IAAI,UAAU;IAKpB,UAAU,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;IAajC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC;IAGhB,OAAO,IAAI,IAAI;CAKhB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,IAAI,EAAE;IACjB,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,GAAG,UAAU,CAAC;IACtD,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;CAEM,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/hmac.js b/tools/mnemonic-test/node_modules/@noble/hashes/hmac.js deleted file mode 100644 index 060cf57d..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/hmac.js +++ /dev/null @@ -1,91 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.hmac = exports.HMAC = void 0; -/** - * HMAC: RFC2104 message authentication code. - * @module - */ -const utils_ts_1 = require("./utils.js"); -class HMAC extends utils_ts_1.Hash { - constructor(hash, _key) { - super(); - this.finished = false; - this.destroyed = false; - (0, utils_ts_1.ahash)(hash); - const key = (0, utils_ts_1.toBytes)(_key); - this.iHash = hash.create(); - if (typeof this.iHash.update !== 'function') - throw new Error('Expected instance of class which extends utils.Hash'); - this.blockLen = this.iHash.blockLen; - this.outputLen = this.iHash.outputLen; - const blockLen = this.blockLen; - const pad = new Uint8Array(blockLen); - // blockLen can be bigger than outputLen - pad.set(key.length > blockLen ? hash.create().update(key).digest() : key); - for (let i = 0; i < pad.length; i++) - pad[i] ^= 0x36; - this.iHash.update(pad); - // By doing update (processing of first block) of outer hash here we can re-use it between multiple calls via clone - this.oHash = hash.create(); - // Undo internal XOR && apply outer XOR - for (let i = 0; i < pad.length; i++) - pad[i] ^= 0x36 ^ 0x5c; - this.oHash.update(pad); - (0, utils_ts_1.clean)(pad); - } - update(buf) { - (0, utils_ts_1.aexists)(this); - this.iHash.update(buf); - return this; - } - digestInto(out) { - (0, utils_ts_1.aexists)(this); - (0, utils_ts_1.abytes)(out, this.outputLen); - this.finished = true; - this.iHash.digestInto(out); - this.oHash.update(out); - this.oHash.digestInto(out); - this.destroy(); - } - digest() { - const out = new Uint8Array(this.oHash.outputLen); - this.digestInto(out); - return out; - } - _cloneInto(to) { - // Create new instance without calling constructor since key already in state and we don't know it. - to || (to = Object.create(Object.getPrototypeOf(this), {})); - const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this; - to = to; - to.finished = finished; - to.destroyed = destroyed; - to.blockLen = blockLen; - to.outputLen = outputLen; - to.oHash = oHash._cloneInto(to.oHash); - to.iHash = iHash._cloneInto(to.iHash); - return to; - } - clone() { - return this._cloneInto(); - } - destroy() { - this.destroyed = true; - this.oHash.destroy(); - this.iHash.destroy(); - } -} -exports.HMAC = HMAC; -/** - * HMAC: RFC2104 message authentication code. - * @param hash - function that would be used e.g. sha256 - * @param key - message key - * @param message - message data - * @example - * import { hmac } from '@noble/hashes/hmac'; - * import { sha256 } from '@noble/hashes/sha2'; - * const mac1 = hmac(sha256, 'key', 'message'); - */ -const hmac = (hash, key, message) => new HMAC(hash, key).update(message).digest(); -exports.hmac = hmac; -exports.hmac.create = (hash, key) => new HMAC(hash, key); -//# sourceMappingURL=hmac.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/hmac.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/hmac.js.map deleted file mode 100644 index b99d61ad..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/hmac.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hmac.js","sourceRoot":"","sources":["src/hmac.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,yCAAkG;AAElG,MAAa,IAAwB,SAAQ,eAAa;IAQxD,YAAY,IAAW,EAAE,IAAW;QAClC,KAAK,EAAE,CAAC;QAJF,aAAQ,GAAG,KAAK,CAAC;QACjB,cAAS,GAAG,KAAK,CAAC;QAIxB,IAAA,gBAAK,EAAC,IAAI,CAAC,CAAC;QACZ,MAAM,GAAG,GAAG,IAAA,kBAAO,EAAC,IAAI,CAAC,CAAC;QAC1B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,EAAO,CAAC;QAChC,IAAI,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,UAAU;YACzC,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;QACzE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;QACpC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;QACtC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC/B,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAC;QACrC,wCAAwC;QACxC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,IAA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MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC;AAJvC,QAAA,IAAI,QAImC;AACpD,YAAI,CAAC,MAAM,GAAG,CAAC,IAAW,EAAE,GAAU,EAAE,EAAE,CAAC,IAAI,IAAI,CAAM,IAAI,EAAE,GAAG,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/index.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/index.d.ts deleted file mode 100644 index f36479a7..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/index.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/index.d.ts.map deleted file mode 100644 index 4e8c5816..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/index.js b/tools/mnemonic-test/node_modules/@noble/hashes/index.js deleted file mode 100644 index b6a9fe71..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/index.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -/** - * Audited & minimal JS implementation of hash functions, MACs and KDFs. Check out individual modules. - * @module - * @example -```js -import { - sha256, sha384, sha512, sha224, sha512_224, sha512_256 -} from '@noble/hashes/sha2'; -import { - sha3_224, sha3_256, sha3_384, sha3_512, - keccak_224, keccak_256, keccak_384, keccak_512, - shake128, shake256 -} from '@noble/hashes/sha3'; -import { - cshake128, cshake256, - turboshake128, turboshake256, - kmac128, kmac256, - tuplehash256, parallelhash256, - k12, m14, keccakprg -} from '@noble/hashes/sha3-addons'; -import { blake3 } from '@noble/hashes/blake3'; -import { blake2b, blake2s } from '@noble/hashes/blake2'; -import { hmac } from '@noble/hashes/hmac'; -import { hkdf } from '@noble/hashes/hkdf'; -import { pbkdf2, pbkdf2Async } from '@noble/hashes/pbkdf2'; -import { scrypt, scryptAsync } from '@noble/hashes/scrypt'; -import { md5, ripemd160, sha1 } from '@noble/hashes/legacy'; -import * as utils from '@noble/hashes/utils'; -``` - */ -throw new Error('root module cannot be imported: import submodules instead. Check out README'); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/index.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/index.js.map deleted file mode 100644 index 1759fc61..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,IAAI,KAAK,CAAC,6EAA6E,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/legacy.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/legacy.d.ts deleted file mode 100644 index 39c2632d..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/legacy.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -/** - -SHA1 (RFC 3174), MD5 (RFC 1321) and RIPEMD160 (RFC 2286) legacy, weak hash functions. -Don't use them in a new protocol. What "weak" means: - -- Collisions can be made with 2^18 effort in MD5, 2^60 in SHA1, 2^80 in RIPEMD160. -- No practical pre-image attacks (only theoretical, 2^123.4) -- HMAC seems kinda ok: https://datatracker.ietf.org/doc/html/rfc6151 - * @module - */ -import { HashMD } from './_md.ts'; -import { type CHash } from './utils.ts'; -/** SHA1 legacy hash class. */ -export declare class SHA1 extends HashMD { - private A; - private B; - private C; - private D; - private E; - constructor(); - protected get(): [number, number, number, number, number]; - protected set(A: number, B: number, C: number, D: number, E: number): void; - protected process(view: DataView, offset: number): void; - protected roundClean(): void; - destroy(): void; -} -/** SHA1 (RFC 3174) legacy hash function. It was cryptographically broken. */ -export declare const sha1: CHash; -/** MD5 legacy hash class. */ -export declare class MD5 extends HashMD { - private A; - private B; - private C; - private D; - constructor(); - protected get(): [number, number, number, number]; - protected set(A: number, B: number, C: number, D: number): void; - protected process(view: DataView, offset: number): void; - protected roundClean(): void; - destroy(): void; -} -/** - * MD5 (RFC 1321) legacy hash function. It was cryptographically broken. - * MD5 architecture is similar to SHA1, with some differences: - * - Reduced output length: 16 bytes (128 bit) instead of 20 - * - 64 rounds, instead of 80 - * - Little-endian: could be faster, but will require more code - * - Non-linear index selection: huge speed-up for unroll - * - Per round constants: more memory accesses, additional speed-up for unroll - */ -export declare const md5: CHash; -export declare class RIPEMD160 extends HashMD { - private h0; - private h1; - private h2; - private h3; - private h4; - constructor(); - protected get(): [number, number, number, number, number]; - protected set(h0: number, h1: number, h2: number, h3: number, h4: number): void; - protected process(view: DataView, offset: number): void; - protected roundClean(): void; - destroy(): void; -} -/** - * RIPEMD-160 - a legacy hash function from 1990s. - * * https://homes.esat.kuleuven.be/~bosselae/ripemd160.html - * * https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf - */ -export declare const ripemd160: CHash; -//# sourceMappingURL=legacy.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/legacy.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/legacy.d.ts.map deleted file mode 100644 index 0401f785..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/legacy.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"legacy.d.ts","sourceRoot":"","sources":["src/legacy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAO,MAAM,EAAO,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,KAAK,KAAK,EAA6B,MAAM,YAAY,CAAC;AAUnE,8BAA8B;AAC9B,qBAAa,IAAK,SAAQ,MAAM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;;;;;;GAQG;AACH,eAAO,MAAM,GAAG,EAAE,KAAqD,CAAC;AA6CxE,qBAAa,SAAU,SAAQ,MAAM,CAAC,SAAS,CAAC;IAC9C,OAAO,CAAC,EAAE,CAAkB;IAC5B,OAAO,CAAC,EAAE,CAAkB;IAC5B,OAAO,CAAC,EAAE,CAAkB;IAC5B,OAAO,CAAC,EAAE,CAAkB;IAC5B,OAAO,CAAC,EAAE,CAAkB;;IAK5B,SAAS,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;IAIzD,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI;IAO/E,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAmCvD,SAAS,CAAC,UAAU,IAAI,IAAI;IAG5B,OAAO,IAAI,IAAI;CAKhB;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,KAA2D,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/legacy.js b/tools/mnemonic-test/node_modules/@noble/hashes/legacy.js deleted file mode 100644 index 2f8f9c63..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/legacy.js +++ /dev/null @@ -1,287 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ripemd160 = exports.RIPEMD160 = exports.md5 = exports.MD5 = exports.sha1 = exports.SHA1 = void 0; -/** - -SHA1 (RFC 3174), MD5 (RFC 1321) and RIPEMD160 (RFC 2286) legacy, weak hash functions. -Don't use them in a new protocol. What "weak" means: - -- Collisions can be made with 2^18 effort in MD5, 2^60 in SHA1, 2^80 in RIPEMD160. -- No practical pre-image attacks (only theoretical, 2^123.4) -- HMAC seems kinda ok: https://datatracker.ietf.org/doc/html/rfc6151 - * @module - */ -const _md_ts_1 = require("./_md.js"); -const utils_ts_1 = require("./utils.js"); -/** Initial SHA1 state */ -const SHA1_IV = /* @__PURE__ */ Uint32Array.from([ - 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0, -]); -// Reusable temporary buffer -const SHA1_W = /* @__PURE__ */ new Uint32Array(80); -/** SHA1 legacy hash class. */ -class SHA1 extends _md_ts_1.HashMD { - constructor() { - super(64, 20, 8, false); - this.A = SHA1_IV[0] | 0; - this.B = SHA1_IV[1] | 0; - this.C = SHA1_IV[2] | 0; - this.D = SHA1_IV[3] | 0; - this.E = SHA1_IV[4] | 0; - } - get() { - const { A, B, C, D, E } = this; - return [A, B, C, D, E]; - } - set(A, B, C, D, E) { - this.A = A | 0; - this.B = B | 0; - this.C = C | 0; - this.D = D | 0; - this.E = E | 0; - } - process(view, offset) { - for (let i = 0; i < 16; i++, offset += 4) - SHA1_W[i] = view.getUint32(offset, false); - for (let i = 16; i < 80; i++) - SHA1_W[i] = (0, utils_ts_1.rotl)(SHA1_W[i - 3] ^ SHA1_W[i - 8] ^ SHA1_W[i - 14] ^ SHA1_W[i - 16], 1); - // Compression function main loop, 80 rounds - let { A, B, C, D, E } = this; - for (let i = 0; i < 80; i++) { - let F, K; - if (i < 20) { - F = (0, _md_ts_1.Chi)(B, C, D); - K = 0x5a827999; - } - else if (i < 40) { - F = B ^ C ^ D; - K = 0x6ed9eba1; - } - else if (i < 60) { - F = (0, _md_ts_1.Maj)(B, C, D); - K = 0x8f1bbcdc; - } - else { - F = B ^ C ^ D; - K = 0xca62c1d6; - } - const T = ((0, utils_ts_1.rotl)(A, 5) + F + E + K + SHA1_W[i]) | 0; - E = D; - D = C; - C = (0, utils_ts_1.rotl)(B, 30); - B = A; - A = T; - } - // Add the compressed chunk to the current hash value - A = (A + this.A) | 0; - B = (B + this.B) | 0; - C = (C + this.C) | 0; - D = (D + this.D) | 0; - E = (E + this.E) | 0; - this.set(A, B, C, D, E); - } - roundClean() { - (0, utils_ts_1.clean)(SHA1_W); - } - destroy() { - this.set(0, 0, 0, 0, 0); - (0, utils_ts_1.clean)(this.buffer); - } -} -exports.SHA1 = SHA1; -/** SHA1 (RFC 3174) legacy hash function. It was cryptographically broken. */ -exports.sha1 = (0, utils_ts_1.createHasher)(() => new SHA1()); -/** Per-round constants */ -const p32 = /* @__PURE__ */ Math.pow(2, 32); -const K = /* @__PURE__ */ Array.from({ length: 64 }, (_, i) => Math.floor(p32 * Math.abs(Math.sin(i + 1)))); -/** md5 initial state: same as sha1, but 4 u32 instead of 5. */ -const MD5_IV = /* @__PURE__ */ SHA1_IV.slice(0, 4); -// Reusable temporary buffer -const MD5_W = /* @__PURE__ */ new Uint32Array(16); -/** MD5 legacy hash class. */ -class MD5 extends _md_ts_1.HashMD { - constructor() { - super(64, 16, 8, true); - this.A = MD5_IV[0] | 0; - this.B = MD5_IV[1] | 0; - this.C = MD5_IV[2] | 0; - this.D = MD5_IV[3] | 0; - } - get() { - const { A, B, C, D } = this; - return [A, B, C, D]; - } - set(A, B, C, D) { - this.A = A | 0; - this.B = B | 0; - this.C = C | 0; - this.D = D | 0; - } - process(view, offset) { - for (let i = 0; i < 16; i++, offset += 4) - MD5_W[i] = view.getUint32(offset, true); - // Compression function main loop, 64 rounds - let { A, B, C, D } = this; - for (let i = 0; i < 64; i++) { - let F, g, s; - if (i < 16) { - F = (0, _md_ts_1.Chi)(B, C, D); - g = i; - s = [7, 12, 17, 22]; - } - else if (i < 32) { - F = (0, _md_ts_1.Chi)(D, B, C); - g = (5 * i + 1) % 16; - s = [5, 9, 14, 20]; - } - else if (i < 48) { - F = B ^ C ^ D; - g = (3 * i + 5) % 16; - s = [4, 11, 16, 23]; - } - else { - F = C ^ (B | ~D); - g = (7 * i) % 16; - s = [6, 10, 15, 21]; - } - F = F + A + K[i] + MD5_W[g]; - A = D; - D = C; - C = B; - B = B + (0, utils_ts_1.rotl)(F, s[i % 4]); - } - // Add the compressed chunk to the current hash value - A = (A + this.A) | 0; - B = (B + this.B) | 0; - C = (C + this.C) | 0; - D = (D + this.D) | 0; - this.set(A, B, C, D); - } - roundClean() { - (0, utils_ts_1.clean)(MD5_W); - } - destroy() { - this.set(0, 0, 0, 0); - (0, utils_ts_1.clean)(this.buffer); - } -} -exports.MD5 = MD5; -/** - * MD5 (RFC 1321) legacy hash function. It was cryptographically broken. - * MD5 architecture is similar to SHA1, with some differences: - * - Reduced output length: 16 bytes (128 bit) instead of 20 - * - 64 rounds, instead of 80 - * - Little-endian: could be faster, but will require more code - * - Non-linear index selection: huge speed-up for unroll - * - Per round constants: more memory accesses, additional speed-up for unroll - */ -exports.md5 = (0, utils_ts_1.createHasher)(() => new MD5()); -// RIPEMD-160 -const Rho160 = /* @__PURE__ */ Uint8Array.from([ - 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, -]); -const Id160 = /* @__PURE__ */ (() => Uint8Array.from(new Array(16).fill(0).map((_, i) => i)))(); -const Pi160 = /* @__PURE__ */ (() => Id160.map((i) => (9 * i + 5) % 16))(); -const idxLR = /* @__PURE__ */ (() => { - const L = [Id160]; - const R = [Pi160]; - const res = [L, R]; - for (let i = 0; i < 4; i++) - for (let j of res) - j.push(j[i].map((k) => Rho160[k])); - return res; -})(); -const idxL = /* @__PURE__ */ (() => idxLR[0])(); -const idxR = /* @__PURE__ */ (() => idxLR[1])(); -// const [idxL, idxR] = idxLR; -const shifts160 = /* @__PURE__ */ [ - [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8], - [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7], - [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9], - [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6], - [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5], -].map((i) => Uint8Array.from(i)); -const shiftsL160 = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts160[i][j])); -const shiftsR160 = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts160[i][j])); -const Kl160 = /* @__PURE__ */ Uint32Array.from([ - 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e, -]); -const Kr160 = /* @__PURE__ */ Uint32Array.from([ - 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000, -]); -// It's called f() in spec. -function ripemd_f(group, x, y, z) { - if (group === 0) - return x ^ y ^ z; - if (group === 1) - return (x & y) | (~x & z); - if (group === 2) - return (x | ~y) ^ z; - if (group === 3) - return (x & z) | (y & ~z); - return x ^ (y | ~z); -} -// Reusable temporary buffer -const BUF_160 = /* @__PURE__ */ new Uint32Array(16); -class RIPEMD160 extends _md_ts_1.HashMD { - constructor() { - super(64, 20, 8, true); - this.h0 = 0x67452301 | 0; - this.h1 = 0xefcdab89 | 0; - this.h2 = 0x98badcfe | 0; - this.h3 = 0x10325476 | 0; - this.h4 = 0xc3d2e1f0 | 0; - } - get() { - const { h0, h1, h2, h3, h4 } = this; - return [h0, h1, h2, h3, h4]; - } - set(h0, h1, h2, h3, h4) { - this.h0 = h0 | 0; - this.h1 = h1 | 0; - this.h2 = h2 | 0; - this.h3 = h3 | 0; - this.h4 = h4 | 0; - } - process(view, offset) { - for (let i = 0; i < 16; i++, offset += 4) - BUF_160[i] = view.getUint32(offset, true); - // prettier-ignore - let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el; - // Instead of iterating 0 to 80, we split it into 5 groups - // And use the groups in constants, functions, etc. Much simpler - for (let group = 0; group < 5; group++) { - const rGroup = 4 - group; - const hbl = Kl160[group], hbr = Kr160[group]; // prettier-ignore - const rl = idxL[group], rr = idxR[group]; // prettier-ignore - const sl = shiftsL160[group], sr = shiftsR160[group]; // prettier-ignore - for (let i = 0; i < 16; i++) { - const tl = ((0, utils_ts_1.rotl)(al + ripemd_f(group, bl, cl, dl) + BUF_160[rl[i]] + hbl, sl[i]) + el) | 0; - al = el, el = dl, dl = (0, utils_ts_1.rotl)(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore - } - // 2 loops are 10% faster - for (let i = 0; i < 16; i++) { - const tr = ((0, utils_ts_1.rotl)(ar + ripemd_f(rGroup, br, cr, dr) + BUF_160[rr[i]] + hbr, sr[i]) + er) | 0; - ar = er, er = dr, dr = (0, utils_ts_1.rotl)(cr, 10) | 0, cr = br, br = tr; // prettier-ignore - } - } - // Add the compressed chunk to the current hash value - this.set((this.h1 + cl + dr) | 0, (this.h2 + dl + er) | 0, (this.h3 + el + ar) | 0, (this.h4 + al + br) | 0, (this.h0 + bl + cr) | 0); - } - roundClean() { - (0, utils_ts_1.clean)(BUF_160); - } - destroy() { - this.destroyed = true; - (0, utils_ts_1.clean)(this.buffer); - this.set(0, 0, 0, 0, 0); - } -} -exports.RIPEMD160 = RIPEMD160; -/** - * RIPEMD-160 - a legacy hash function from 1990s. - * * https://homes.esat.kuleuven.be/~bosselae/ripemd160.html - * * https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf - */ -exports.ripemd160 = (0, utils_ts_1.createHasher)(() => new RIPEMD160()); -//# sourceMappingURL=legacy.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/legacy.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/legacy.js.map deleted file mode 100644 index f1c3a81a..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/legacy.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"legacy.js","sourceRoot":"","sources":["src/legacy.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;GASG;AACH,qCAA4C;AAC5C,yCAAmE;AAEnE,yBAAyB;AACzB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,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,IAAA,eAAI,EAAC,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,kBAAkB;YAC/E,CAAC;QACH,CAAC;QACD,qDAAqD;QACrD,IAAI,CAAC,GAAG,CACN,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EACvB,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EACvB,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EACvB,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EACvB,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CACxB,CAAC;IACJ,CAAC;IACS,UAAU;QAClB,IAAA,gBAAK,EAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IACD,OAAO;QACL,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAA,gBAAK,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnB,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1B,CAAC;CACF;AAhED,8BAgEC;AAED;;;;GAIG;AACU,QAAA,SAAS,GAA0B,IAAA,uBAAY,EAAC,GAAG,EAAE,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/package.json b/tools/mnemonic-test/node_modules/@noble/hashes/package.json deleted file mode 100644 index 4d2fc73b..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/package.json +++ /dev/null @@ -1,266 +0,0 @@ -{ - "name": "@noble/hashes", - "version": "1.8.0", - "description": "Audited & minimal 0-dependency JS implementation of SHA, RIPEMD, BLAKE, HMAC, HKDF, PBKDF & Scrypt", - "files": [ - "/*.js", - "/*.js.map", - "/*.d.ts", - "/*.d.ts.map", - "esm", - "src/*.ts" - ], - "scripts": { - "bench": "node benchmark/noble.js", - "bench:compare": "MBENCH_DIMS='algorithm,buffer,library' node benchmark/hashes.js", - "bench:compare-hkdf": "MBENCH_DIMS='algorithm,length,library' node benchmark/hkdf.js", - "bench:compare-scrypt": "MBENCH_DIMS='iters,library' MBENCH_FILTER='async' node benchmark/scrypt.js", - "bench:install": "cd benchmark; npm install; npm install .. --install-links", - "build": "npm run build:clean; tsc && tsc -p tsconfig.cjs.json", - "build:clean": "rm -f *.{js,d.ts,js.map,d.ts.map} esm/*.{js,js.map,d.ts.map}", - "build:release": "npx jsbt esbuild test/build", - "lint": "prettier --check 'src/**/*.{js,ts}' 'test/**/*.{js,ts}'", - "format": "prettier --write 'src/**/*.{js,ts}' 'test/**/*.{js,ts}'", - "test": "node --import ./test/esm-register.js test/index.js", - "test:bun": "bun test/index.js", - "test:deno": "deno --allow-env --allow-read --import-map=./test/import_map.json test/index.js", - "test:dos": "node --import ./test/esm-register.js test/slow-dos.test.js", - "test:big": "node --import ./test/esm-register.js test/slow-big.test.js", - "test:kdf": "node --import ./test/esm-register.js test/slow-kdf.test.js" - }, - "author": "Paul Miller (https://paulmillr.com)", - "homepage": "https://paulmillr.com/noble/", - "repository": { - "type": "git", - "url": "git+https://github.com/paulmillr/noble-hashes.git" - }, - "license": "MIT", - "devDependencies": { - "@paulmillr/jsbt": "0.3.3", - "fast-check": "3.0.0", - "micro-bmark": "0.4.1", - "micro-should": "0.5.2", - "prettier": "3.5.3", - "typescript": "5.8.3" - }, - "engines": { - "node": "^14.21.3 || >=16" - }, - "exports": { - ".": { - "import": "./esm/index.js", - "require": "./index.js" - }, - "./crypto": { - "node": { - "import": "./esm/cryptoNode.js", - "default": "./cryptoNode.js" - }, - "import": "./esm/crypto.js", - "default": "./crypto.js" - }, - "./_assert": { - "import": "./esm/_assert.js", - "require": "./_assert.js" - }, - "./_md": { - "import": "./esm/_md.js", - "require": "./_md.js" - }, - "./argon2": { - "import": "./esm/argon2.js", - "require": "./argon2.js" - }, - "./blake1": { - "import": "./esm/blake1.js", - "require": "./blake1.js" - }, - "./blake2": { - "import": "./esm/blake2.js", - "require": "./blake2.js" - }, - "./blake2b": { - "import": "./esm/blake2b.js", - "require": "./blake2b.js" - }, - "./blake2s": { - "import": "./esm/blake2s.js", - "require": "./blake2s.js" - }, - "./blake3": { - "import": "./esm/blake3.js", - "require": "./blake3.js" - }, - "./eskdf": { - "import": "./esm/eskdf.js", - "require": "./eskdf.js" - }, - "./hkdf": { - "import": "./esm/hkdf.js", - "require": "./hkdf.js" - }, - "./hmac": { - "import": "./esm/hmac.js", - "require": "./hmac.js" - }, - "./legacy": { - "import": "./esm/legacy.js", - "require": "./legacy.js" - }, - "./pbkdf2": { - "import": "./esm/pbkdf2.js", - "require": "./pbkdf2.js" - }, - "./ripemd160": { - "import": "./esm/ripemd160.js", - "require": "./ripemd160.js" - }, - "./scrypt": { - "import": "./esm/scrypt.js", - "require": "./scrypt.js" - }, - "./sha1": { - "import": "./esm/sha1.js", - "require": "./sha1.js" - }, - "./sha2": { - "import": "./esm/sha2.js", - "require": "./sha2.js" - }, - "./sha3-addons": { - "import": "./esm/sha3-addons.js", - "require": "./sha3-addons.js" - }, - "./sha3": { - "import": "./esm/sha3.js", - "require": "./sha3.js" - }, - "./sha256": { - "import": "./esm/sha256.js", - "require": "./sha256.js" - }, - "./sha512": { - "import": "./esm/sha512.js", - "require": "./sha512.js" - }, - "./utils": { - "import": "./esm/utils.js", - "require": "./utils.js" - }, - "./_assert.js": { - "import": "./esm/_assert.js", - "require": "./_assert.js" - }, - "./_md.js": { - "import": "./esm/_md.js", - "require": "./_md.js" - }, - "./argon2.js": { - "import": "./esm/argon2.js", - "require": "./argon2.js" - }, - "./blake1.js": { - "import": "./esm/blake1.js", - "require": "./blake1.js" - }, - "./blake2.js": { - "import": "./esm/blake2.js", - "require": "./blake2.js" - }, - "./blake2b.js": { - "import": "./esm/blake2b.js", - "require": "./blake2b.js" - }, - "./blake2s.js": { - "import": "./esm/blake2s.js", - "require": "./blake2s.js" - }, - "./blake3.js": { - "import": "./esm/blake3.js", - "require": "./blake3.js" - }, - "./eskdf.js": { - "import": "./esm/eskdf.js", - "require": "./eskdf.js" - }, - "./hkdf.js": { - "import": "./esm/hkdf.js", - "require": "./hkdf.js" - }, - "./hmac.js": { - "import": "./esm/hmac.js", - "require": "./hmac.js" - }, - "./legacy.js": { - "import": "./esm/legacy.js", - "require": "./legacy.js" - }, - "./pbkdf2.js": { - "import": "./esm/pbkdf2.js", - "require": "./pbkdf2.js" - }, - "./ripemd160.js": { - "import": "./esm/ripemd160.js", - "require": "./ripemd160.js" - }, - "./scrypt.js": { - "import": "./esm/scrypt.js", - "require": "./scrypt.js" - }, - "./sha1.js": { - "import": "./esm/sha1.js", - "require": "./sha1.js" - }, - "./sha2.js": { - "import": "./esm/sha2.js", - "require": "./sha2.js" - }, - "./sha3-addons.js": { - "import": "./esm/sha3-addons.js", - "require": "./sha3-addons.js" - }, - "./sha3.js": { - "import": "./esm/sha3.js", - "require": "./sha3.js" - }, - "./sha256.js": { - "import": "./esm/sha256.js", - "require": "./sha256.js" - }, - "./sha512.js": { - "import": "./esm/sha512.js", - "require": "./sha512.js" - }, - "./utils.js": { - "import": "./esm/utils.js", - "require": "./utils.js" - } - }, - "sideEffects": false, - "browser": { - "node:crypto": false, - "./crypto": "./crypto.js" - }, - "keywords": [ - "sha", - "sha2", - "sha3", - "sha256", - "sha512", - "keccak", - "kangarootwelve", - "ripemd160", - "blake2", - "blake3", - "hmac", - "hkdf", - "pbkdf2", - "scrypt", - "kdf", - "hash", - "cryptography", - "security", - "noble" - ], - "funding": "https://paulmillr.com/funding/" -} diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/pbkdf2.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/pbkdf2.d.ts deleted file mode 100644 index 0697c694..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/pbkdf2.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { type CHash, type KDFInput } from './utils.ts'; -export type Pbkdf2Opt = { - c: number; - dkLen?: number; - asyncTick?: number; -}; -/** - * PBKDF2-HMAC: RFC 2898 key derivation function - * @param hash - hash function that would be used e.g. sha256 - * @param password - password from which a derived key is generated - * @param salt - cryptographic salt - * @param opts - {c, dkLen} where c is work factor and dkLen is output message size - * @example - * const key = pbkdf2(sha256, 'password', 'salt', { dkLen: 32, c: Math.pow(2, 18) }); - */ -export declare function pbkdf2(hash: CHash, password: KDFInput, salt: KDFInput, opts: Pbkdf2Opt): Uint8Array; -/** - * PBKDF2-HMAC: RFC 2898 key derivation function. Async version. - * @example - * await pbkdf2Async(sha256, 'password', 'salt', { dkLen: 32, c: 500_000 }); - */ -export declare function pbkdf2Async(hash: CHash, password: KDFInput, salt: KDFInput, opts: Pbkdf2Opt): Promise; -//# sourceMappingURL=pbkdf2.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/pbkdf2.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/pbkdf2.d.ts.map deleted file mode 100644 index a4d30f3b..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/pbkdf2.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pbkdf2.d.ts","sourceRoot":"","sources":["src/pbkdf2.ts"],"names":[],"mappings":"AAMA,OAAO,EAGL,KAAK,KAAK,EACV,KAAK,QAAQ,EACd,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,SAAS,GAAG;IACtB,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAkCF;;;;;;;;GAQG;AACH,wBAAgB,MAAM,CACpB,IAAI,EAAE,KAAK,EACX,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,SAAS,GACd,UAAU,CAsBZ;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,KAAK,EACX,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,SAAS,GACd,OAAO,CAAC,UAAU,CAAC,CAsBrB"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/pbkdf2.js b/tools/mnemonic-test/node_modules/@noble/hashes/pbkdf2.js deleted file mode 100644 index 0d8cab0e..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/pbkdf2.js +++ /dev/null @@ -1,101 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.pbkdf2 = pbkdf2; -exports.pbkdf2Async = pbkdf2Async; -/** - * PBKDF (RFC 2898). Can be used to create a key from password and salt. - * @module - */ -const hmac_ts_1 = require("./hmac.js"); -// prettier-ignore -const utils_ts_1 = require("./utils.js"); -// Common prologue and epilogue for sync/async functions -function pbkdf2Init(hash, _password, _salt, _opts) { - (0, utils_ts_1.ahash)(hash); - const opts = (0, utils_ts_1.checkOpts)({ dkLen: 32, asyncTick: 10 }, _opts); - const { c, dkLen, asyncTick } = opts; - (0, utils_ts_1.anumber)(c); - (0, utils_ts_1.anumber)(dkLen); - (0, utils_ts_1.anumber)(asyncTick); - if (c < 1) - throw new Error('iterations (c) should be >= 1'); - const password = (0, utils_ts_1.kdfInputToBytes)(_password); - const salt = (0, utils_ts_1.kdfInputToBytes)(_salt); - // DK = PBKDF2(PRF, Password, Salt, c, dkLen); - const DK = new Uint8Array(dkLen); - // U1 = PRF(Password, Salt + INT_32_BE(i)) - const PRF = hmac_ts_1.hmac.create(hash, password); - const PRFSalt = PRF._cloneInto().update(salt); - return { c, dkLen, asyncTick, DK, PRF, PRFSalt }; -} -function pbkdf2Output(PRF, PRFSalt, DK, prfW, u) { - PRF.destroy(); - PRFSalt.destroy(); - if (prfW) - prfW.destroy(); - (0, utils_ts_1.clean)(u); - return DK; -} -/** - * PBKDF2-HMAC: RFC 2898 key derivation function - * @param hash - hash function that would be used e.g. sha256 - * @param password - password from which a derived key is generated - * @param salt - cryptographic salt - * @param opts - {c, dkLen} where c is work factor and dkLen is output message size - * @example - * const key = pbkdf2(sha256, 'password', 'salt', { dkLen: 32, c: Math.pow(2, 18) }); - */ -function pbkdf2(hash, password, salt, opts) { - const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts); - let prfW; // Working copy - const arr = new Uint8Array(4); - const view = (0, utils_ts_1.createView)(arr); - const u = new Uint8Array(PRF.outputLen); - // DK = T1 + T2 + ⋯ + Tdklen/hlen - for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { - // Ti = F(Password, Salt, c, i) - const Ti = DK.subarray(pos, pos + PRF.outputLen); - view.setInt32(0, ti, false); - // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc - // U1 = PRF(Password, Salt + INT_32_BE(i)) - (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); - Ti.set(u.subarray(0, Ti.length)); - for (let ui = 1; ui < c; ui++) { - // Uc = PRF(Password, Uc−1) - PRF._cloneInto(prfW).update(u).digestInto(u); - for (let i = 0; i < Ti.length; i++) - Ti[i] ^= u[i]; - } - } - return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); -} -/** - * PBKDF2-HMAC: RFC 2898 key derivation function. Async version. - * @example - * await pbkdf2Async(sha256, 'password', 'salt', { dkLen: 32, c: 500_000 }); - */ -async function pbkdf2Async(hash, password, salt, opts) { - const { c, dkLen, asyncTick, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts); - let prfW; // Working copy - const arr = new Uint8Array(4); - const view = (0, utils_ts_1.createView)(arr); - const u = new Uint8Array(PRF.outputLen); - // DK = T1 + T2 + ⋯ + Tdklen/hlen - for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { - // Ti = F(Password, Salt, c, i) - const Ti = DK.subarray(pos, pos + PRF.outputLen); - view.setInt32(0, ti, false); - // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc - // U1 = PRF(Password, Salt + INT_32_BE(i)) - (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); - Ti.set(u.subarray(0, Ti.length)); - await (0, utils_ts_1.asyncLoop)(c - 1, asyncTick, () => { - // Uc = PRF(Password, Uc−1) - PRF._cloneInto(prfW).update(u).digestInto(u); - for (let i = 0; i < Ti.length; i++) - Ti[i] ^= u[i]; - }); - } - return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); -} -//# sourceMappingURL=pbkdf2.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/pbkdf2.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/pbkdf2.js.map deleted file mode 100644 index 4579c9f8..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/pbkdf2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pbkdf2.js","sourceRoot":"","sources":["src/pbkdf2.ts"],"names":[],"mappings":";;AA4DA,wBA2BC;AAOD,kCA2BC;AAzHD;;;GAGG;AACH,uCAAiC;AACjC,kBAAkB;AAClB,yCAKoB;AAOpB,wDAAwD;AACxD,SAAS,UAAU,CAAC,IAAW,EAAE,SAAmB,EAAE,KAAe,EAAE,KAAgB;IACrF,IAAA,gBAAK,EAAC,IAAI,CAAC,CAAC;IACZ,MAAM,IAAI,GAAG,IAAA,oBAAS,EAAC,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;IAC5D,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;IACrC,IAAA,kBAAO,EAAC,CAAC,CAAC,CAAC;IACX,IAAA,kBA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G,EAAE;YACrC,2BAA2B;YAC3B,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YAC7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE;gBAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;IACL,CAAC;IACD,OAAO,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACjD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/ripemd160.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/ripemd160.d.ts deleted file mode 100644 index 2fb0fa7a..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/ripemd160.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * RIPEMD-160 legacy hash function. - * https://homes.esat.kuleuven.be/~bosselae/ripemd160.html - * https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf - * @module - * @deprecated - */ -import { RIPEMD160 as RIPEMD160n, ripemd160 as ripemd160n } from './legacy.ts'; -/** @deprecated Use import from `noble/hashes/legacy` module */ -export declare const RIPEMD160: typeof RIPEMD160n; -/** @deprecated Use import from `noble/hashes/legacy` module */ -export declare const ripemd160: typeof ripemd160n; -//# sourceMappingURL=ripemd160.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/ripemd160.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/ripemd160.d.ts.map deleted file mode 100644 index f2050f4b..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/ripemd160.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ripemd160.d.ts","sourceRoot":"","sources":["src/ripemd160.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,SAAS,IAAI,UAAU,EAAE,SAAS,IAAI,UAAU,EAAE,MAAM,aAAa,CAAC;AAC/E,+DAA+D;AAC/D,eAAO,MAAM,SAAS,EAAE,OAAO,UAAuB,CAAC;AACvD,+DAA+D;AAC/D,eAAO,MAAM,SAAS,EAAE,OAAO,UAAuB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/ripemd160.js b/tools/mnemonic-test/node_modules/@noble/hashes/ripemd160.js deleted file mode 100644 index 9561e7bb..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/ripemd160.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ripemd160 = exports.RIPEMD160 = void 0; -/** - * RIPEMD-160 legacy hash function. - * https://homes.esat.kuleuven.be/~bosselae/ripemd160.html - * https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf - * @module - * @deprecated - */ -const legacy_ts_1 = require("./legacy.js"); -/** @deprecated Use import from `noble/hashes/legacy` module */ -exports.RIPEMD160 = legacy_ts_1.RIPEMD160; -/** @deprecated Use import from `noble/hashes/legacy` module */ -exports.ripemd160 = legacy_ts_1.ripemd160; -//# sourceMappingURL=ripemd160.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/ripemd160.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/ripemd160.js.map deleted file mode 100644 index 5dc975ed..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/ripemd160.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ripemd160.js","sourceRoot":"","sources":["src/ripemd160.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,2CAA+E;AAC/E,+DAA+D;AAClD,QAAA,SAAS,GAAsB,qBAAU,CAAC;AACvD,+DAA+D;AAClD,QAAA,SAAS,GAAsB,qBAAU,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/scrypt.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/scrypt.d.ts deleted file mode 100644 index 38d0ef97..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/scrypt.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { type KDFInput } from './utils.ts'; -export type ScryptOpts = { - N: number; - r: number; - p: number; - dkLen?: number; - asyncTick?: number; - maxmem?: number; - onProgress?: (progress: number) => void; -}; -/** - * Scrypt KDF from RFC 7914. - * @param password - pass - * @param salt - salt - * @param opts - parameters - * - `N` is cpu/mem work factor (power of 2 e.g. 2**18) - * - `r` is block size (8 is common), fine-tunes sequential memory read size and performance - * - `p` is parallelization factor (1 is common) - * - `dkLen` is output key length in bytes e.g. 32. - * - `asyncTick` - (default: 10) max time in ms for which async function can block execution - * - `maxmem` - (default: `1024 ** 3 + 1024` aka 1GB+1KB). A limit that the app could use for scrypt - * - `onProgress` - callback function that would be executed for progress report - * @returns Derived key - * @example - * scrypt('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 }); - */ -export declare function scrypt(password: KDFInput, salt: KDFInput, opts: ScryptOpts): Uint8Array; -/** - * Scrypt KDF from RFC 7914. Async version. - * @example - * await scryptAsync('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 }); - */ -export declare function scryptAsync(password: KDFInput, salt: KDFInput, opts: ScryptOpts): Promise; -//# sourceMappingURL=scrypt.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/scrypt.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/scrypt.d.ts.map deleted file mode 100644 index 49860bc0..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/scrypt.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"scrypt.d.ts","sourceRoot":"","sources":["src/scrypt.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,KAAK,QAAQ,EAGd,MAAM,YAAY,CAAC;AAuEpB,MAAM,MAAM,UAAU,GAAG;IACvB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC,CAAC;AAoFF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,GAAG,UAAU,CA0BvF;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,UAAU,GACf,OAAO,CAAC,UAAU,CAAC,CA2BrB"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/scrypt.js b/tools/mnemonic-test/node_modules/@noble/hashes/scrypt.js deleted file mode 100644 index 18605c8c..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/scrypt.js +++ /dev/null @@ -1,232 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.scrypt = scrypt; -exports.scryptAsync = scryptAsync; -/** - * RFC 7914 Scrypt KDF. Can be used to create a key from password and salt. - * @module - */ -const pbkdf2_ts_1 = require("./pbkdf2.js"); -const sha2_ts_1 = require("./sha2.js"); -// prettier-ignore -const utils_ts_1 = require("./utils.js"); -// The main Scrypt loop: uses Salsa extensively. -// Six versions of the function were tried, this is the fastest one. -// prettier-ignore -function XorAndSalsa(prev, pi, input, ii, out, oi) { - // Based on https://cr.yp.to/salsa20.html - // Xor blocks - let y00 = prev[pi++] ^ input[ii++], y01 = prev[pi++] ^ input[ii++]; - let y02 = prev[pi++] ^ input[ii++], y03 = prev[pi++] ^ input[ii++]; - let y04 = prev[pi++] ^ input[ii++], y05 = prev[pi++] ^ input[ii++]; - let y06 = prev[pi++] ^ input[ii++], y07 = prev[pi++] ^ input[ii++]; - let y08 = prev[pi++] ^ input[ii++], y09 = prev[pi++] ^ input[ii++]; - let y10 = prev[pi++] ^ input[ii++], y11 = prev[pi++] ^ input[ii++]; - let y12 = prev[pi++] ^ input[ii++], y13 = prev[pi++] ^ input[ii++]; - let y14 = prev[pi++] ^ input[ii++], y15 = prev[pi++] ^ input[ii++]; - // Save state to temporary variables (salsa) - let x00 = y00, x01 = y01, x02 = y02, x03 = y03, x04 = y04, x05 = y05, x06 = y06, x07 = y07, x08 = y08, x09 = y09, x10 = y10, x11 = y11, x12 = y12, x13 = y13, x14 = y14, x15 = y15; - // Main loop (salsa) - for (let i = 0; i < 8; i += 2) { - x04 ^= (0, utils_ts_1.rotl)(x00 + x12 | 0, 7); - x08 ^= (0, utils_ts_1.rotl)(x04 + x00 | 0, 9); - x12 ^= (0, utils_ts_1.rotl)(x08 + x04 | 0, 13); - x00 ^= (0, utils_ts_1.rotl)(x12 + x08 | 0, 18); - x09 ^= (0, utils_ts_1.rotl)(x05 + x01 | 0, 7); - x13 ^= (0, utils_ts_1.rotl)(x09 + x05 | 0, 9); - x01 ^= (0, utils_ts_1.rotl)(x13 + x09 | 0, 13); - x05 ^= (0, utils_ts_1.rotl)(x01 + x13 | 0, 18); - x14 ^= (0, utils_ts_1.rotl)(x10 + x06 | 0, 7); - x02 ^= (0, utils_ts_1.rotl)(x14 + x10 | 0, 9); - x06 ^= (0, utils_ts_1.rotl)(x02 + x14 | 0, 13); - x10 ^= (0, utils_ts_1.rotl)(x06 + x02 | 0, 18); - x03 ^= (0, utils_ts_1.rotl)(x15 + x11 | 0, 7); - x07 ^= (0, utils_ts_1.rotl)(x03 + x15 | 0, 9); - x11 ^= (0, utils_ts_1.rotl)(x07 + x03 | 0, 13); - x15 ^= (0, utils_ts_1.rotl)(x11 + x07 | 0, 18); - x01 ^= (0, utils_ts_1.rotl)(x00 + x03 | 0, 7); - x02 ^= (0, utils_ts_1.rotl)(x01 + x00 | 0, 9); - x03 ^= (0, utils_ts_1.rotl)(x02 + x01 | 0, 13); - x00 ^= (0, utils_ts_1.rotl)(x03 + x02 | 0, 18); - x06 ^= (0, utils_ts_1.rotl)(x05 + x04 | 0, 7); - x07 ^= (0, utils_ts_1.rotl)(x06 + x05 | 0, 9); - x04 ^= (0, utils_ts_1.rotl)(x07 + x06 | 0, 13); - x05 ^= (0, utils_ts_1.rotl)(x04 + x07 | 0, 18); - x11 ^= (0, utils_ts_1.rotl)(x10 + x09 | 0, 7); - x08 ^= (0, utils_ts_1.rotl)(x11 + x10 | 0, 9); - x09 ^= (0, utils_ts_1.rotl)(x08 + x11 | 0, 13); - x10 ^= (0, utils_ts_1.rotl)(x09 + x08 | 0, 18); - x12 ^= (0, utils_ts_1.rotl)(x15 + x14 | 0, 7); - x13 ^= (0, utils_ts_1.rotl)(x12 + x15 | 0, 9); - x14 ^= (0, utils_ts_1.rotl)(x13 + x12 | 0, 13); - x15 ^= (0, utils_ts_1.rotl)(x14 + x13 | 0, 18); - } - // Write output (salsa) - out[oi++] = (y00 + x00) | 0; - out[oi++] = (y01 + x01) | 0; - out[oi++] = (y02 + x02) | 0; - out[oi++] = (y03 + x03) | 0; - out[oi++] = (y04 + x04) | 0; - out[oi++] = (y05 + x05) | 0; - out[oi++] = (y06 + x06) | 0; - out[oi++] = (y07 + x07) | 0; - out[oi++] = (y08 + x08) | 0; - out[oi++] = (y09 + x09) | 0; - out[oi++] = (y10 + x10) | 0; - out[oi++] = (y11 + x11) | 0; - out[oi++] = (y12 + x12) | 0; - out[oi++] = (y13 + x13) | 0; - out[oi++] = (y14 + x14) | 0; - out[oi++] = (y15 + x15) | 0; -} -function BlockMix(input, ii, out, oi, r) { - // The block B is r 128-byte chunks (which is equivalent of 2r 64-byte chunks) - let head = oi + 0; - let tail = oi + 16 * r; - for (let i = 0; i < 16; i++) - out[tail + i] = input[ii + (2 * r - 1) * 16 + i]; // X ← B[2r−1] - for (let i = 0; i < r; i++, head += 16, ii += 16) { - // We write odd & even Yi at same time. Even: 0bXXXXX0 Odd: 0bXXXXX1 - XorAndSalsa(out, tail, input, ii, out, head); // head[i] = Salsa(blockIn[2*i] ^ tail[i-1]) - if (i > 0) - tail += 16; // First iteration overwrites tmp value in tail - XorAndSalsa(out, head, input, (ii += 16), out, tail); // tail[i] = Salsa(blockIn[2*i+1] ^ head[i]) - } -} -// Common prologue and epilogue for sync/async functions -function scryptInit(password, salt, _opts) { - // Maxmem - 1GB+1KB by default - const opts = (0, utils_ts_1.checkOpts)({ - dkLen: 32, - asyncTick: 10, - maxmem: 1024 ** 3 + 1024, - }, _opts); - const { N, r, p, dkLen, asyncTick, maxmem, onProgress } = opts; - (0, utils_ts_1.anumber)(N); - (0, utils_ts_1.anumber)(r); - (0, utils_ts_1.anumber)(p); - (0, utils_ts_1.anumber)(dkLen); - (0, utils_ts_1.anumber)(asyncTick); - (0, utils_ts_1.anumber)(maxmem); - if (onProgress !== undefined && typeof onProgress !== 'function') - throw new Error('progressCb should be function'); - const blockSize = 128 * r; - const blockSize32 = blockSize / 4; - // Max N is 2^32 (Integrify is 32-bit). Real limit is 2^22: JS engines Uint8Array limit is 4GB in 2024. - // Spec check `N >= 2^(blockSize / 8)` is not done for compat with popular libs, - // which used incorrect r: 1, p: 8. Also, the check seems to be a spec error: - // https://www.rfc-editor.org/errata_search.php?rfc=7914 - const pow32 = Math.pow(2, 32); - if (N <= 1 || (N & (N - 1)) !== 0 || N > pow32) { - throw new Error('Scrypt: N must be larger than 1, a power of 2, and less than 2^32'); - } - if (p < 0 || p > ((pow32 - 1) * 32) / blockSize) { - throw new Error('Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)'); - } - if (dkLen < 0 || dkLen > (pow32 - 1) * 32) { - throw new Error('Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32'); - } - const memUsed = blockSize * (N + p); - if (memUsed > maxmem) { - throw new Error('Scrypt: memused is bigger than maxMem. Expected 128 * r * (N + p) > maxmem of ' + maxmem); - } - // [B0...Bp−1] ← PBKDF2HMAC-SHA256(Passphrase, Salt, 1, blockSize*ParallelizationFactor) - // Since it has only one iteration there is no reason to use async variant - const B = (0, pbkdf2_ts_1.pbkdf2)(sha2_ts_1.sha256, password, salt, { c: 1, dkLen: blockSize * p }); - const B32 = (0, utils_ts_1.u32)(B); - // Re-used between parallel iterations. Array(iterations) of B - const V = (0, utils_ts_1.u32)(new Uint8Array(blockSize * N)); - const tmp = (0, utils_ts_1.u32)(new Uint8Array(blockSize)); - let blockMixCb = () => { }; - if (onProgress) { - const totalBlockMix = 2 * N * p; - // Invoke callback if progress changes from 10.01 to 10.02 - // Allows to draw smooth progress bar on up to 8K screen - const callbackPer = Math.max(Math.floor(totalBlockMix / 10000), 1); - let blockMixCnt = 0; - blockMixCb = () => { - blockMixCnt++; - if (onProgress && (!(blockMixCnt % callbackPer) || blockMixCnt === totalBlockMix)) - onProgress(blockMixCnt / totalBlockMix); - }; - } - return { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick }; -} -function scryptOutput(password, dkLen, B, V, tmp) { - const res = (0, pbkdf2_ts_1.pbkdf2)(sha2_ts_1.sha256, password, B, { c: 1, dkLen }); - (0, utils_ts_1.clean)(B, V, tmp); - return res; -} -/** - * Scrypt KDF from RFC 7914. - * @param password - pass - * @param salt - salt - * @param opts - parameters - * - `N` is cpu/mem work factor (power of 2 e.g. 2**18) - * - `r` is block size (8 is common), fine-tunes sequential memory read size and performance - * - `p` is parallelization factor (1 is common) - * - `dkLen` is output key length in bytes e.g. 32. - * - `asyncTick` - (default: 10) max time in ms for which async function can block execution - * - `maxmem` - (default: `1024 ** 3 + 1024` aka 1GB+1KB). A limit that the app could use for scrypt - * - `onProgress` - callback function that would be executed for progress report - * @returns Derived key - * @example - * scrypt('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 }); - */ -function scrypt(password, salt, opts) { - const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb } = scryptInit(password, salt, opts); - (0, utils_ts_1.swap32IfBE)(B32); - for (let pi = 0; pi < p; pi++) { - const Pi = blockSize32 * pi; - for (let i = 0; i < blockSize32; i++) - V[i] = B32[Pi + i]; // V[0] = B[i] - for (let i = 0, pos = 0; i < N - 1; i++) { - BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]); - blockMixCb(); - } - BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element - blockMixCb(); - for (let i = 0; i < N; i++) { - // First u32 of the last 64-byte block (u32 is LE) - const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations - for (let k = 0; k < blockSize32; k++) - tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j] - BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) - blockMixCb(); - } - } - (0, utils_ts_1.swap32IfBE)(B32); - return scryptOutput(password, dkLen, B, V, tmp); -} -/** - * Scrypt KDF from RFC 7914. Async version. - * @example - * await scryptAsync('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 }); - */ -async function scryptAsync(password, salt, opts) { - const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick } = scryptInit(password, salt, opts); - (0, utils_ts_1.swap32IfBE)(B32); - for (let pi = 0; pi < p; pi++) { - const Pi = blockSize32 * pi; - for (let i = 0; i < blockSize32; i++) - V[i] = B32[Pi + i]; // V[0] = B[i] - let pos = 0; - await (0, utils_ts_1.asyncLoop)(N - 1, asyncTick, () => { - BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]); - blockMixCb(); - }); - BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element - blockMixCb(); - await (0, utils_ts_1.asyncLoop)(N, asyncTick, () => { - // First u32 of the last 64-byte block (u32 is LE) - const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations - for (let k = 0; k < blockSize32; k++) - tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j] - BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) - blockMixCb(); - }); - } - (0, utils_ts_1.swap32IfBE)(B32); - return scryptOutput(password, dkLen, B, V, tmp); -} -//# sourceMappingURL=scrypt.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/scrypt.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/scrypt.js.map deleted file mode 100644 index ded97a09..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/scrypt.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"scrypt.js","sourceRoot":"","sources":["src/scrypt.ts"],"names":[],"mappings":";;AAgMA,wBA0BC;AAOD,kCA+BC;AAhQD;;;GAGG;AACH,2CAAqC;AACrC,uCAAmC;AACnC,kBAAkB;AAClB,yCAMoB;AAEpB,gDAAgD;AAChD,oEAAoE;AACpE,kBAAkB;AAClB,SAAS,WAAW,CAClB,IAAiB,EACjB,EAAU,EACV,KAAkB,EAClB,EAAU,EACV,GAAgB,EAChB,EAAU;IAEV,yCAAyC;IACzC,aAAa;IACb,IAAI,GAAG,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,EAAE,EAAE,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;IACnE,IAAI,GAAG,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,EAAE,EAAE,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;IACnE,IAAI,GAAG,GAAG,IAAI,CAAC,EAAE,EA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;IACL,CAAC;IACD,IAAA,qBAAU,EAAC,GAAG,CAAC,CAAC;IAChB,OAAO,YAAY,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;AAClD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/sha1.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/sha1.d.ts deleted file mode 100644 index 7c36b9f9..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/sha1.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * SHA1 (RFC 3174) legacy hash function. - * @module - * @deprecated - */ -import { SHA1 as SHA1n, sha1 as sha1n } from './legacy.ts'; -/** @deprecated Use import from `noble/hashes/legacy` module */ -export declare const SHA1: typeof SHA1n; -/** @deprecated Use import from `noble/hashes/legacy` module */ -export declare const sha1: typeof sha1n; -//# sourceMappingURL=sha1.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/sha1.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/sha1.d.ts.map deleted file mode 100644 index f590e009..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/sha1.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha1.d.ts","sourceRoot":"","sources":["src/sha1.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,IAAI,IAAI,KAAK,EAAE,IAAI,IAAI,KAAK,EAAE,MAAM,aAAa,CAAC;AAC3D,+DAA+D;AAC/D,eAAO,MAAM,IAAI,EAAE,OAAO,KAAa,CAAC;AACxC,+DAA+D;AAC/D,eAAO,MAAM,IAAI,EAAE,OAAO,KAAa,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/sha1.js b/tools/mnemonic-test/node_modules/@noble/hashes/sha1.js deleted file mode 100644 index f881be16..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/sha1.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.sha1 = exports.SHA1 = void 0; -/** - * SHA1 (RFC 3174) legacy hash function. - * @module - * @deprecated - */ -const legacy_ts_1 = require("./legacy.js"); -/** @deprecated Use import from `noble/hashes/legacy` module */ -exports.SHA1 = legacy_ts_1.SHA1; -/** @deprecated Use import from `noble/hashes/legacy` module */ -exports.sha1 = legacy_ts_1.sha1; -//# sourceMappingURL=sha1.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/sha1.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/sha1.js.map deleted file mode 100644 index de5634af..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/sha1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha1.js","sourceRoot":"","sources":["src/sha1.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,2CAA2D;AAC3D,+DAA+D;AAClD,QAAA,IAAI,GAAiB,gBAAK,CAAC;AACxC,+DAA+D;AAClD,QAAA,IAAI,GAAiB,gBAAK,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/sha2.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/sha2.d.ts deleted file mode 100644 index 33f2f7f8..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/sha2.d.ts +++ /dev/null @@ -1,159 +0,0 @@ -/** - * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256. - * SHA256 is the fastest hash implementable in JS, even faster than Blake3. - * Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and - * [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf). - * @module - */ -import { HashMD } from './_md.ts'; -import { type CHash } from './utils.ts'; -export declare class SHA256 extends HashMD { - protected A: number; - protected B: number; - protected C: number; - protected D: number; - protected E: number; - protected F: number; - protected G: number; - protected H: number; - constructor(outputLen?: number); - protected get(): [number, number, number, number, number, number, number, number]; - protected set(A: number, B: number, C: number, D: number, E: number, F: number, G: number, H: number): void; - protected process(view: DataView, offset: number): void; - protected roundClean(): void; - destroy(): void; -} -export declare class SHA224 extends SHA256 { - protected A: number; - protected B: number; - protected C: number; - protected D: number; - protected E: number; - protected F: number; - protected G: number; - protected H: number; - constructor(); -} -export declare class SHA512 extends HashMD { - protected Ah: number; - protected Al: number; - protected Bh: number; - protected Bl: number; - protected Ch: number; - protected Cl: number; - protected Dh: number; - protected Dl: number; - protected Eh: number; - protected El: number; - protected Fh: number; - protected Fl: number; - protected Gh: number; - protected Gl: number; - protected Hh: number; - protected Hl: number; - constructor(outputLen?: number); - protected get(): [ - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number - ]; - protected set(Ah: number, Al: number, Bh: number, Bl: number, Ch: number, Cl: number, Dh: number, Dl: number, Eh: number, El: number, Fh: number, Fl: number, Gh: number, Gl: number, Hh: number, Hl: number): void; - protected process(view: DataView, offset: number): void; - protected roundClean(): void; - destroy(): void; -} -export declare class SHA384 extends SHA512 { - protected Ah: number; - protected Al: number; - protected Bh: number; - protected Bl: number; - protected Ch: number; - protected Cl: number; - protected Dh: number; - protected Dl: number; - protected Eh: number; - protected El: number; - protected Fh: number; - protected Fl: number; - protected Gh: number; - protected Gl: number; - protected Hh: number; - protected Hl: number; - constructor(); -} -export declare class SHA512_224 extends SHA512 { - protected Ah: number; - protected Al: number; - protected Bh: number; - protected Bl: number; - protected Ch: number; - protected Cl: number; - protected Dh: number; - protected Dl: number; - protected Eh: number; - protected El: number; - protected Fh: number; - protected Fl: number; - protected Gh: number; - protected Gl: number; - protected Hh: number; - protected Hl: number; - constructor(); -} -export declare class SHA512_256 extends SHA512 { - protected Ah: number; - protected Al: number; - protected Bh: number; - protected Bl: number; - protected Ch: number; - protected Cl: number; - protected Dh: number; - protected Dl: number; - protected Eh: number; - protected El: number; - protected Fh: number; - protected Fl: number; - protected Gh: number; - protected Gl: number; - protected Hh: number; - protected Hl: number; - constructor(); -} -/** - * SHA2-256 hash function from RFC 4634. - * - * It is the fastest JS hash, even faster than Blake3. - * To break sha256 using birthday attack, attackers need to try 2^128 hashes. - * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025. - */ -export declare const sha256: CHash; -/** SHA2-224 hash function from RFC 4634 */ -export declare const sha224: CHash; -/** SHA2-512 hash function from RFC 4634. */ -export declare const sha512: CHash; -/** SHA2-384 hash function from RFC 4634. */ -export declare const sha384: CHash; -/** - * SHA2-512/256 "truncated" hash function, with improved resistance to length extension attacks. - * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf). - */ -export declare const sha512_256: CHash; -/** - * SHA2-512/224 "truncated" hash function, with improved resistance to length extension attacks. - * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf). - */ -export declare const sha512_224: CHash; -//# sourceMappingURL=sha2.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/sha2.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/sha2.d.ts.map deleted file mode 100644 index 310e8130..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/sha2.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha2.d.ts","sourceRoot":"","sources":["src/sha2.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAO,MAAM,EAAmD,MAAM,UAAU,CAAC;AAExF,OAAO,EAAE,KAAK,KAAK,EAA6B,MAAM,YAAY,CAAC;AAoBnE,qBAAa,MAAO,SAAQ,MAAM,CAAC,MAAM,CAAC;IAGxC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAoB;IACvC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAoB;IACvC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAoB;IACvC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAoB;IACvC,SAAS,CAAC,CAAC,EAAE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AA2C;AAC3C,eAAO,MAAM,MAAM,EAAE,KAAwD,CAAC;AAE9E,4CAA4C;AAC5C,eAAO,MAAM,MAAM,EAAE,KAAwD,CAAC;AAC9E,4CAA4C;AAC5C,eAAO,MAAM,MAAM,EAAE,KAAwD,CAAC;AAE9E;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,KAA4D,CAAC;AACtF;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,KAA4D,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/sha2.js b/tools/mnemonic-test/node_modules/@noble/hashes/sha2.js deleted file mode 100644 index 962a9ac6..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/sha2.js +++ /dev/null @@ -1,384 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.sha512_224 = exports.sha512_256 = exports.sha384 = exports.sha512 = exports.sha224 = exports.sha256 = exports.SHA512_256 = exports.SHA512_224 = exports.SHA384 = exports.SHA512 = exports.SHA224 = exports.SHA256 = void 0; -/** - * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256. - * SHA256 is the fastest hash implementable in JS, even faster than Blake3. - * Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and - * [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf). - * @module - */ -const _md_ts_1 = require("./_md.js"); -const u64 = require("./_u64.js"); -const utils_ts_1 = require("./utils.js"); -/** - * Round constants: - * First 32 bits of fractional parts of the cube roots of the first 64 primes 2..311) - */ -// prettier-ignore -const SHA256_K = /* @__PURE__ */ Uint32Array.from([ - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 -]); -/** Reusable temporary buffer. "W" comes straight from spec. */ -const SHA256_W = /* @__PURE__ */ new Uint32Array(64); -class SHA256 extends _md_ts_1.HashMD { - constructor(outputLen = 32) { - super(64, outputLen, 8, false); - // We cannot use array here since array allows indexing by variable - // which means optimizer/compiler cannot use registers. - this.A = _md_ts_1.SHA256_IV[0] | 0; - this.B = _md_ts_1.SHA256_IV[1] | 0; - this.C = _md_ts_1.SHA256_IV[2] | 0; - this.D = _md_ts_1.SHA256_IV[3] | 0; - this.E = _md_ts_1.SHA256_IV[4] | 0; - this.F = _md_ts_1.SHA256_IV[5] | 0; - this.G = _md_ts_1.SHA256_IV[6] | 0; - this.H = _md_ts_1.SHA256_IV[7] | 0; - } - get() { - const { A, B, C, D, E, F, G, H } = this; - return [A, B, C, D, E, F, G, H]; - } - // prettier-ignore - set(A, B, C, D, E, F, G, H) { - this.A = A | 0; - this.B = B | 0; - this.C = C | 0; - this.D = D | 0; - this.E = E | 0; - this.F = F | 0; - this.G = G | 0; - this.H = H | 0; - } - process(view, offset) { - // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array - for (let i = 0; i < 16; i++, offset += 4) - SHA256_W[i] = view.getUint32(offset, false); - for (let i = 16; i < 64; i++) { - const W15 = SHA256_W[i - 15]; - const W2 = SHA256_W[i - 2]; - const s0 = (0, utils_ts_1.rotr)(W15, 7) ^ (0, utils_ts_1.rotr)(W15, 18) ^ (W15 >>> 3); - const s1 = (0, utils_ts_1.rotr)(W2, 17) ^ (0, utils_ts_1.rotr)(W2, 19) ^ (W2 >>> 10); - SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0; - } - // Compression function main loop, 64 rounds - let { A, B, C, D, E, F, G, H } = this; - for (let i = 0; i < 64; i++) { - const sigma1 = (0, utils_ts_1.rotr)(E, 6) ^ (0, utils_ts_1.rotr)(E, 11) ^ (0, utils_ts_1.rotr)(E, 25); - const T1 = (H + sigma1 + (0, _md_ts_1.Chi)(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; - const sigma0 = (0, utils_ts_1.rotr)(A, 2) ^ (0, utils_ts_1.rotr)(A, 13) ^ (0, utils_ts_1.rotr)(A, 22); - const T2 = (sigma0 + (0, _md_ts_1.Maj)(A, B, C)) | 0; - H = G; - G = F; - F = E; - E = (D + T1) | 0; - D = C; - C = B; - B = A; - A = (T1 + T2) | 0; - } - // Add the compressed chunk to the current hash value - A = (A + this.A) | 0; - B = (B + this.B) | 0; - C = (C + this.C) | 0; - D = (D + this.D) | 0; - E = (E + this.E) | 0; - F = (F + this.F) | 0; - G = (G + this.G) | 0; - H = (H + this.H) | 0; - this.set(A, B, C, D, E, F, G, H); - } - roundClean() { - (0, utils_ts_1.clean)(SHA256_W); - } - destroy() { - this.set(0, 0, 0, 0, 0, 0, 0, 0); - (0, utils_ts_1.clean)(this.buffer); - } -} -exports.SHA256 = SHA256; -class SHA224 extends SHA256 { - constructor() { - super(28); - this.A = _md_ts_1.SHA224_IV[0] | 0; - this.B = _md_ts_1.SHA224_IV[1] | 0; - this.C = _md_ts_1.SHA224_IV[2] | 0; - this.D = _md_ts_1.SHA224_IV[3] | 0; - this.E = _md_ts_1.SHA224_IV[4] | 0; - this.F = _md_ts_1.SHA224_IV[5] | 0; - this.G = _md_ts_1.SHA224_IV[6] | 0; - this.H = _md_ts_1.SHA224_IV[7] | 0; - } -} -exports.SHA224 = SHA224; -// SHA2-512 is slower than sha256 in js because u64 operations are slow. -// Round contants -// First 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409 -// prettier-ignore -const K512 = /* @__PURE__ */ (() => u64.split([ - '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc', - '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118', - '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2', - '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694', - '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65', - '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5', - '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4', - '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70', - '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df', - '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b', - '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30', - '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8', - '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8', - '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3', - '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec', - '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b', - '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178', - '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b', - '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c', - '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817' -].map(n => BigInt(n))))(); -const SHA512_Kh = /* @__PURE__ */ (() => K512[0])(); -const SHA512_Kl = /* @__PURE__ */ (() => K512[1])(); -// Reusable temporary buffers -const SHA512_W_H = /* @__PURE__ */ new Uint32Array(80); -const SHA512_W_L = /* @__PURE__ */ new Uint32Array(80); -class SHA512 extends _md_ts_1.HashMD { - constructor(outputLen = 64) { - super(128, outputLen, 16, false); - // We cannot use array here since array allows indexing by variable - // which means optimizer/compiler cannot use registers. - // h -- high 32 bits, l -- low 32 bits - this.Ah = _md_ts_1.SHA512_IV[0] | 0; - this.Al = _md_ts_1.SHA512_IV[1] | 0; - this.Bh = _md_ts_1.SHA512_IV[2] | 0; - this.Bl = _md_ts_1.SHA512_IV[3] | 0; - this.Ch = _md_ts_1.SHA512_IV[4] | 0; - this.Cl = _md_ts_1.SHA512_IV[5] | 0; - this.Dh = _md_ts_1.SHA512_IV[6] | 0; - this.Dl = _md_ts_1.SHA512_IV[7] | 0; - this.Eh = _md_ts_1.SHA512_IV[8] | 0; - this.El = _md_ts_1.SHA512_IV[9] | 0; - this.Fh = _md_ts_1.SHA512_IV[10] | 0; - this.Fl = _md_ts_1.SHA512_IV[11] | 0; - this.Gh = _md_ts_1.SHA512_IV[12] | 0; - this.Gl = _md_ts_1.SHA512_IV[13] | 0; - this.Hh = _md_ts_1.SHA512_IV[14] | 0; - this.Hl = _md_ts_1.SHA512_IV[15] | 0; - } - // prettier-ignore - get() { - const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; - return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl]; - } - // prettier-ignore - set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) { - this.Ah = Ah | 0; - this.Al = Al | 0; - this.Bh = Bh | 0; - this.Bl = Bl | 0; - this.Ch = Ch | 0; - this.Cl = Cl | 0; - this.Dh = Dh | 0; - this.Dl = Dl | 0; - this.Eh = Eh | 0; - this.El = El | 0; - this.Fh = Fh | 0; - this.Fl = Fl | 0; - this.Gh = Gh | 0; - this.Gl = Gl | 0; - this.Hh = Hh | 0; - this.Hl = Hl | 0; - } - process(view, offset) { - // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array - for (let i = 0; i < 16; i++, offset += 4) { - SHA512_W_H[i] = view.getUint32(offset); - SHA512_W_L[i] = view.getUint32((offset += 4)); - } - for (let i = 16; i < 80; i++) { - // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7) - const W15h = SHA512_W_H[i - 15] | 0; - const W15l = SHA512_W_L[i - 15] | 0; - const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7); - const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7); - // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6) - const W2h = SHA512_W_H[i - 2] | 0; - const W2l = SHA512_W_L[i - 2] | 0; - const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6); - const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6); - // SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16]; - const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]); - const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]); - SHA512_W_H[i] = SUMh | 0; - SHA512_W_L[i] = SUMl | 0; - } - let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; - // Compression function main loop, 80 rounds - for (let i = 0; i < 80; i++) { - // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41) - const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41); - const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41); - //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; - const CHIh = (Eh & Fh) ^ (~Eh & Gh); - const CHIl = (El & Fl) ^ (~El & Gl); - // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i] - // prettier-ignore - const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]); - const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]); - const T1l = T1ll | 0; - // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39) - const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39); - const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39); - const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch); - const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl); - Hh = Gh | 0; - Hl = Gl | 0; - Gh = Fh | 0; - Gl = Fl | 0; - Fh = Eh | 0; - Fl = El | 0; - ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0)); - Dh = Ch | 0; - Dl = Cl | 0; - Ch = Bh | 0; - Cl = Bl | 0; - Bh = Ah | 0; - Bl = Al | 0; - const All = u64.add3L(T1l, sigma0l, MAJl); - Ah = u64.add3H(All, T1h, sigma0h, MAJh); - Al = All | 0; - } - // Add the compressed chunk to the current hash value - ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0)); - ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0)); - ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0)); - ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0)); - ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0)); - ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0)); - ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0)); - ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0)); - this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl); - } - roundClean() { - (0, utils_ts_1.clean)(SHA512_W_H, SHA512_W_L); - } - destroy() { - (0, utils_ts_1.clean)(this.buffer); - this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - } -} -exports.SHA512 = SHA512; -class SHA384 extends SHA512 { - constructor() { - super(48); - this.Ah = _md_ts_1.SHA384_IV[0] | 0; - this.Al = _md_ts_1.SHA384_IV[1] | 0; - this.Bh = _md_ts_1.SHA384_IV[2] | 0; - this.Bl = _md_ts_1.SHA384_IV[3] | 0; - this.Ch = _md_ts_1.SHA384_IV[4] | 0; - this.Cl = _md_ts_1.SHA384_IV[5] | 0; - this.Dh = _md_ts_1.SHA384_IV[6] | 0; - this.Dl = _md_ts_1.SHA384_IV[7] | 0; - this.Eh = _md_ts_1.SHA384_IV[8] | 0; - this.El = _md_ts_1.SHA384_IV[9] | 0; - this.Fh = _md_ts_1.SHA384_IV[10] | 0; - this.Fl = _md_ts_1.SHA384_IV[11] | 0; - this.Gh = _md_ts_1.SHA384_IV[12] | 0; - this.Gl = _md_ts_1.SHA384_IV[13] | 0; - this.Hh = _md_ts_1.SHA384_IV[14] | 0; - this.Hl = _md_ts_1.SHA384_IV[15] | 0; - } -} -exports.SHA384 = SHA384; -/** - * Truncated SHA512/256 and SHA512/224. - * SHA512_IV is XORed with 0xa5a5a5a5a5a5a5a5, then used as "intermediary" IV of SHA512/t. - * Then t hashes string to produce result IV. - * See `test/misc/sha2-gen-iv.js`. - */ -/** SHA512/224 IV */ -const T224_IV = /* @__PURE__ */ Uint32Array.from([ - 0x8c3d37c8, 0x19544da2, 0x73e19966, 0x89dcd4d6, 0x1dfab7ae, 0x32ff9c82, 0x679dd514, 0x582f9fcf, - 0x0f6d2b69, 0x7bd44da8, 0x77e36f73, 0x04c48942, 0x3f9d85a8, 0x6a1d36c8, 0x1112e6ad, 0x91d692a1, -]); -/** SHA512/256 IV */ -const T256_IV = /* @__PURE__ */ Uint32Array.from([ - 0x22312194, 0xfc2bf72c, 0x9f555fa3, 0xc84c64c2, 0x2393b86b, 0x6f53b151, 0x96387719, 0x5940eabd, - 0x96283ee2, 0xa88effe3, 0xbe5e1e25, 0x53863992, 0x2b0199fc, 0x2c85b8aa, 0x0eb72ddc, 0x81c52ca2, -]); -class SHA512_224 extends SHA512 { - constructor() { - super(28); - this.Ah = T224_IV[0] | 0; - this.Al = T224_IV[1] | 0; - this.Bh = T224_IV[2] | 0; - this.Bl = T224_IV[3] | 0; - this.Ch = T224_IV[4] | 0; - this.Cl = T224_IV[5] | 0; - this.Dh = T224_IV[6] | 0; - this.Dl = T224_IV[7] | 0; - this.Eh = T224_IV[8] | 0; - this.El = T224_IV[9] | 0; - this.Fh = T224_IV[10] | 0; - this.Fl = T224_IV[11] | 0; - this.Gh = T224_IV[12] | 0; - this.Gl = T224_IV[13] | 0; - this.Hh = T224_IV[14] | 0; - this.Hl = T224_IV[15] | 0; - } -} -exports.SHA512_224 = SHA512_224; -class SHA512_256 extends SHA512 { - constructor() { - super(32); - this.Ah = T256_IV[0] | 0; - this.Al = T256_IV[1] | 0; - this.Bh = T256_IV[2] | 0; - this.Bl = T256_IV[3] | 0; - this.Ch = T256_IV[4] | 0; - this.Cl = T256_IV[5] | 0; - this.Dh = T256_IV[6] | 0; - this.Dl = T256_IV[7] | 0; - this.Eh = T256_IV[8] | 0; - this.El = T256_IV[9] | 0; - this.Fh = T256_IV[10] | 0; - this.Fl = T256_IV[11] | 0; - this.Gh = T256_IV[12] | 0; - this.Gl = T256_IV[13] | 0; - this.Hh = T256_IV[14] | 0; - this.Hl = T256_IV[15] | 0; - } -} -exports.SHA512_256 = SHA512_256; -/** - * SHA2-256 hash function from RFC 4634. - * - * It is the fastest JS hash, even faster than Blake3. - * To break sha256 using birthday attack, attackers need to try 2^128 hashes. - * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025. - */ -exports.sha256 = (0, utils_ts_1.createHasher)(() => new SHA256()); -/** SHA2-224 hash function from RFC 4634 */ -exports.sha224 = (0, utils_ts_1.createHasher)(() => new SHA224()); -/** SHA2-512 hash function from RFC 4634. */ -exports.sha512 = (0, utils_ts_1.createHasher)(() => new SHA512()); -/** SHA2-384 hash function from RFC 4634. */ -exports.sha384 = (0, utils_ts_1.createHasher)(() => new SHA384()); -/** - * SHA2-512/256 "truncated" hash function, with improved resistance to length extension attacks. - * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf). - */ -exports.sha512_256 = (0, utils_ts_1.createHasher)(() => new SHA512_256()); -/** - * SHA2-512/224 "truncated" hash function, with improved resistance to length extension attacks. - * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf). - */ -exports.sha512_224 = (0, utils_ts_1.createHasher)(() => new SHA512_224()); -//# sourceMappingURL=sha2.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/sha2.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/sha2.js.map deleted file mode 100644 index b5cfb670..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/sha2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha2.js","sourceRoot":"","sources":["src/sha2.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,qCAAwF;AACxF,iCAAiC;AACjC,yCAAmE;AAEnE;;;GAGG;AACH,kBAAkB;AAClB,MAAM,QAAQ,GAAG,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC;IAChD,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IAC9F,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IAC9F,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IAC9F,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IAC9F,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,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,GAA0B,IAAA,uBAAY,EAAC,GAAG,EAAE,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC;AAC9E,4CAA4C;AAC/B,QAAA,MAAM,GAA0B,IAAA,uBAAY,EAAC,GAAG,EAAE,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC;AAE9E;;;GAGG;AACU,QAAA,UAAU,GAA0B,IAAA,uBAAY,EAAC,GAAG,EAAE,CAAC,IAAI,UAAU,EAAE,CAAC,CAAC;AACtF;;;GAGG;AACU,QAAA,UAAU,GAA0B,IAAA,uBAAY,EAAC,GAAG,EAAE,CAAC,IAAI,UAAU,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/sha256.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/sha256.d.ts deleted file mode 100644 index ed04fe88..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/sha256.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * SHA2-256 a.k.a. sha256. In JS, it is the fastest hash, even faster than Blake3. - * - * To break sha256 using birthday attack, attackers need to try 2^128 hashes. - * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025. - * - * Check out [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf). - * @module - * @deprecated - */ -import { SHA224 as SHA224n, sha224 as sha224n, SHA256 as SHA256n, sha256 as sha256n } from './sha2.ts'; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export declare const SHA256: typeof SHA256n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export declare const sha256: typeof sha256n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export declare const SHA224: typeof SHA224n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export declare const sha224: typeof sha224n; -//# sourceMappingURL=sha256.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/sha256.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/sha256.d.ts.map deleted file mode 100644 index 15911baa..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/sha256.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha256.d.ts","sourceRoot":"","sources":["src/sha256.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EACL,MAAM,IAAI,OAAO,EACjB,MAAM,IAAI,OAAO,EACjB,MAAM,IAAI,OAAO,EACjB,MAAM,IAAI,OAAO,EAClB,MAAM,WAAW,CAAC;AACnB,6DAA6D;AAC7D,eAAO,MAAM,MAAM,EAAE,OAAO,OAAiB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,MAAM,EAAE,OAAO,OAAiB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,MAAM,EAAE,OAAO,OAAiB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,MAAM,EAAE,OAAO,OAAiB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/sha256.js b/tools/mnemonic-test/node_modules/@noble/hashes/sha256.js deleted file mode 100644 index 573bda94..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/sha256.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.sha224 = exports.SHA224 = exports.sha256 = exports.SHA256 = void 0; -/** - * SHA2-256 a.k.a. sha256. In JS, it is the fastest hash, even faster than Blake3. - * - * To break sha256 using birthday attack, attackers need to try 2^128 hashes. - * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025. - * - * Check out [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf). - * @module - * @deprecated - */ -const sha2_ts_1 = require("./sha2.js"); -/** @deprecated Use import from `noble/hashes/sha2` module */ -exports.SHA256 = sha2_ts_1.SHA256; -/** @deprecated Use import from `noble/hashes/sha2` module */ -exports.sha256 = sha2_ts_1.sha256; -/** @deprecated Use import from `noble/hashes/sha2` module */ -exports.SHA224 = sha2_ts_1.SHA224; -/** @deprecated Use import from `noble/hashes/sha2` module */ -exports.sha224 = sha2_ts_1.sha224; -//# sourceMappingURL=sha256.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/sha256.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/sha256.js.map deleted file mode 100644 index 69c5821d..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/sha256.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha256.js","sourceRoot":"","sources":["src/sha256.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;GASG;AACH,uCAKmB;AACnB,6DAA6D;AAChD,QAAA,MAAM,GAAmB,gBAAO,CAAC;AAC9C,6DAA6D;AAChD,QAAA,MAAM,GAAmB,gBAAO,CAAC;AAC9C,6DAA6D;AAChD,QAAA,MAAM,GAAmB,gBAAO,CAAC;AAC9C,6DAA6D;AAChD,QAAA,MAAM,GAAmB,gBAAO,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/sha3-addons.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/sha3-addons.d.ts deleted file mode 100644 index 5bd2fe62..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/sha3-addons.d.ts +++ /dev/null @@ -1,142 +0,0 @@ -/** - * SHA3 (keccak) addons. - * - * * Full [NIST SP 800-185](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-185.pdf): - * cSHAKE, KMAC, TupleHash, ParallelHash + XOF variants - * * Reduced-round Keccak [(draft)](https://datatracker.ietf.org/doc/draft-irtf-cfrg-kangarootwelve/): - * * 🦘 K12 aka KangarooTwelve - * * M14 aka MarsupilamiFourteen - * * TurboSHAKE - * * KeccakPRG: Pseudo-random generator based on Keccak [(pdf)](https://keccak.team/files/CSF-0.1.pdf) - * @module - */ -import { Keccak, type ShakeOpts } from './sha3.ts'; -import { type CHashO, type CHashXO, Hash, type HashXOF, type Input } from './utils.ts'; -export type cShakeOpts = ShakeOpts & { - personalization?: Input; - NISTfn?: Input; -}; -export type ICShake = { - (msg: Input, opts?: cShakeOpts): Uint8Array; - outputLen: number; - blockLen: number; - create(opts: cShakeOpts): HashXOF; -}; -export type ITupleHash = { - (messages: Input[], opts?: cShakeOpts): Uint8Array; - create(opts?: cShakeOpts): TupleHash; -}; -export type IParHash = { - (message: Input, opts?: ParallelOpts): Uint8Array; - create(opts?: ParallelOpts): ParallelHash; -}; -export declare const cshake128: ICShake; -export declare const cshake256: ICShake; -export declare class KMAC extends Keccak implements HashXOF { - constructor(blockLen: number, outputLen: number, enableXOF: boolean, key: Input, opts?: cShakeOpts); - protected finish(): void; - _cloneInto(to?: KMAC): KMAC; - clone(): KMAC; -} -export declare const kmac128: { - (key: Input, message: Input, opts?: cShakeOpts): Uint8Array; - create(key: Input, opts?: cShakeOpts): KMAC; -}; -export declare const kmac256: { - (key: Input, message: Input, opts?: cShakeOpts): Uint8Array; - create(key: Input, opts?: cShakeOpts): KMAC; -}; -export declare const kmac128xof: { - (key: Input, message: Input, opts?: cShakeOpts): Uint8Array; - create(key: Input, opts?: cShakeOpts): KMAC; -}; -export declare const kmac256xof: { - (key: Input, message: Input, opts?: cShakeOpts): Uint8Array; - create(key: Input, opts?: cShakeOpts): KMAC; -}; -export declare class TupleHash extends Keccak implements HashXOF { - constructor(blockLen: number, outputLen: number, enableXOF: boolean, opts?: cShakeOpts); - protected finish(): void; - _cloneInto(to?: TupleHash): TupleHash; - clone(): TupleHash; -} -/** 128-bit TupleHASH. */ -export declare const tuplehash128: ITupleHash; -/** 256-bit TupleHASH. */ -export declare const tuplehash256: ITupleHash; -/** 128-bit TupleHASH XOF. */ -export declare const tuplehash128xof: ITupleHash; -/** 256-bit TupleHASH XOF. */ -export declare const tuplehash256xof: ITupleHash; -type ParallelOpts = cShakeOpts & { - blockLen?: number; -}; -export declare class ParallelHash extends Keccak implements HashXOF { - private leafHash?; - protected leafCons: () => Hash; - private chunkPos; - private chunksDone; - private chunkLen; - constructor(blockLen: number, outputLen: number, leafCons: () => Hash, enableXOF: boolean, opts?: ParallelOpts); - protected finish(): void; - _cloneInto(to?: ParallelHash): ParallelHash; - destroy(): void; - clone(): ParallelHash; -} -/** 128-bit ParallelHash. In JS, it is not parallel. */ -export declare const parallelhash128: IParHash; -/** 256-bit ParallelHash. In JS, it is not parallel. */ -export declare const parallelhash256: IParHash; -/** 128-bit ParallelHash XOF. In JS, it is not parallel. */ -export declare const parallelhash128xof: IParHash; -/** 256-bit ParallelHash. In JS, it is not parallel. */ -export declare const parallelhash256xof: IParHash; -export type TurboshakeOpts = ShakeOpts & { - D?: number; -}; -/** TurboSHAKE 128-bit: reduced 12-round keccak. */ -export declare const turboshake128: CHashXO; -/** TurboSHAKE 256-bit: reduced 12-round keccak. */ -export declare const turboshake256: CHashXO; -export type KangarooOpts = { - dkLen?: number; - personalization?: Input; -}; -export declare class KangarooTwelve extends Keccak implements HashXOF { - readonly chunkLen = 8192; - private leafHash?; - protected leafLen: number; - private personalization; - private chunkPos; - private chunksDone; - constructor(blockLen: number, leafLen: number, outputLen: number, rounds: number, opts: KangarooOpts); - update(data: Input): this; - protected finish(): void; - destroy(): void; - _cloneInto(to?: KangarooTwelve): KangarooTwelve; - clone(): KangarooTwelve; -} -/** KangarooTwelve: reduced 12-round keccak. */ -export declare const k12: CHashO; -/** MarsupilamiFourteen: reduced 14-round keccak. */ -export declare const m14: CHashO; -/** - * More at https://github.com/XKCP/XKCP/tree/master/lib/high/Keccak/PRG. - */ -export declare class KeccakPRG extends Keccak { - protected rate: number; - constructor(capacity: number); - keccak(): void; - update(data: Input): this; - feed(data: Input): this; - protected finish(): void; - digestInto(_out: Uint8Array): Uint8Array; - fetch(bytes: number): Uint8Array; - forget(): void; - _cloneInto(to?: KeccakPRG): KeccakPRG; - clone(): KeccakPRG; -} -/** KeccakPRG: Pseudo-random generator based on Keccak. https://keccak.team/files/CSF-0.1.pdf */ -export declare const keccakprg: (capacity?: number) => KeccakPRG; -export {}; -//# sourceMappingURL=sha3-addons.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/sha3-addons.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/sha3-addons.d.ts.map deleted file mode 100644 index 7c2bee28..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/sha3-addons.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha3-addons.d.ts","sourceRoot":"","sources":["src/sha3-addons.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAGL,KAAK,MAAM,EACX,KAAK,OAAO,EAGZ,IAAI,EACJ,KAAK,OAAO,EACZ,KAAK,KAAK,EAGX,MAAM,YAAY,CAAC;AAoCpB,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG;IAAE,eAAe,CAAC,EAAE,KAAK,CAAC;IAAC,MAAM,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AA0BjF,MAAM,MAAM,OAAO,GAAG;IACpB,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IAC5C,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC3C,CAAC;AACF,MAAM,MAAM,UAAU,GAAG;IACvB,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,IAAI,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IACnD,MAAM,CAAC,IAAI,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;CACtC,CAAC;AACF,MAAM,MAAM,QAAQ,GAAG;IACrB,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,YAAY,GAA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AK,IAAI,cAAc;CAGxB;AACD,+CAA+C;AAC/C,eAAO,MAAM,GAAG,EAAE,MAGZ,CAAC;AACP,oDAAoD;AACpD,eAAO,MAAM,GAAG,EAAE,MAGZ,CAAC;AAEP;;GAEG;AACH,qBAAa,SAAU,SAAQ,MAAM;IACnC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC;gBACX,QAAQ,EAAE,MAAM;IAU5B,MAAM,IAAI,IAAI;IAQd,MAAM,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI;IAKzB,IAAI,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI;IAGvB,SAAS,CAAC,MAAM,IAAI,IAAI;IACxB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU;IAGxC,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU;IAIhC,MAAM,IAAI,IAAI;IAQd,UAAU,CAAC,EAAE,CAAC,EAAE,SAAS,GAAG,SAAS;IAOrC,KAAK,IAAI,SAAS;CAGnB;AAED,gGAAgG;AAChG,eAAO,MAAM,SAAS,GAAI,iBAAc,KAAG,SAAoC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/sha3-addons.js b/tools/mnemonic-test/node_modules/@noble/hashes/sha3-addons.js deleted file mode 100644 index ad75d78c..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/sha3-addons.js +++ /dev/null @@ -1,402 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.keccakprg = exports.KeccakPRG = exports.m14 = exports.k12 = exports.KangarooTwelve = exports.turboshake256 = exports.turboshake128 = exports.parallelhash256xof = exports.parallelhash128xof = exports.parallelhash256 = exports.parallelhash128 = exports.ParallelHash = exports.tuplehash256xof = exports.tuplehash128xof = exports.tuplehash256 = exports.tuplehash128 = exports.TupleHash = exports.kmac256xof = exports.kmac128xof = exports.kmac256 = exports.kmac128 = exports.KMAC = exports.cshake256 = exports.cshake128 = void 0; -/** - * SHA3 (keccak) addons. - * - * * Full [NIST SP 800-185](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-185.pdf): - * cSHAKE, KMAC, TupleHash, ParallelHash + XOF variants - * * Reduced-round Keccak [(draft)](https://datatracker.ietf.org/doc/draft-irtf-cfrg-kangarootwelve/): - * * 🦘 K12 aka KangarooTwelve - * * M14 aka MarsupilamiFourteen - * * TurboSHAKE - * * KeccakPRG: Pseudo-random generator based on Keccak [(pdf)](https://keccak.team/files/CSF-0.1.pdf) - * @module - */ -const sha3_ts_1 = require("./sha3.js"); -const utils_ts_1 = require("./utils.js"); -// cSHAKE && KMAC (NIST SP800-185) -const _8n = BigInt(8); -const _ffn = BigInt(0xff); -// NOTE: it is safe to use bigints here, since they used only for length encoding (not actual data). -// We use bigints in sha256 for lengths too. -function leftEncode(n) { - n = BigInt(n); - const res = [Number(n & _ffn)]; - n >>= _8n; - for (; n > 0; n >>= _8n) - res.unshift(Number(n & _ffn)); - res.unshift(res.length); - return new Uint8Array(res); -} -function rightEncode(n) { - n = BigInt(n); - const res = [Number(n & _ffn)]; - n >>= _8n; - for (; n > 0; n >>= _8n) - res.unshift(Number(n & _ffn)); - res.push(res.length); - return new Uint8Array(res); -} -function chooseLen(opts, outputLen) { - return opts.dkLen === undefined ? outputLen : opts.dkLen; -} -const abytesOrZero = (buf) => { - if (buf === undefined) - return Uint8Array.of(); - return (0, utils_ts_1.toBytes)(buf); -}; -// NOTE: second modulo is necessary since we don't need to add padding if current element takes whole block -const getPadding = (len, block) => new Uint8Array((block - (len % block)) % block); -// Personalization -function cshakePers(hash, opts = {}) { - if (!opts || (!opts.personalization && !opts.NISTfn)) - return hash; - // Encode and pad inplace to avoid unneccesary memory copies/slices (so we don't need to zero them later) - // bytepad(encode_string(N) || encode_string(S), 168) - const blockLenBytes = leftEncode(hash.blockLen); - const fn = abytesOrZero(opts.NISTfn); - const fnLen = leftEncode(_8n * BigInt(fn.length)); // length in bits - const pers = abytesOrZero(opts.personalization); - const persLen = leftEncode(_8n * BigInt(pers.length)); // length in bits - if (!fn.length && !pers.length) - return hash; - hash.suffix = 0x04; - hash.update(blockLenBytes).update(fnLen).update(fn).update(persLen).update(pers); - let totalLen = blockLenBytes.length + fnLen.length + fn.length + persLen.length + pers.length; - hash.update(getPadding(totalLen, hash.blockLen)); - return hash; -} -const gencShake = (suffix, blockLen, outputLen) => (0, utils_ts_1.createXOFer)((opts = {}) => cshakePers(new sha3_ts_1.Keccak(blockLen, suffix, chooseLen(opts, outputLen), true), opts)); -exports.cshake128 = (() => gencShake(0x1f, 168, 128 / 8))(); -exports.cshake256 = (() => gencShake(0x1f, 136, 256 / 8))(); -class KMAC extends sha3_ts_1.Keccak { - constructor(blockLen, outputLen, enableXOF, key, opts = {}) { - super(blockLen, 0x1f, outputLen, enableXOF); - cshakePers(this, { NISTfn: 'KMAC', personalization: opts.personalization }); - key = (0, utils_ts_1.toBytes)(key); - (0, utils_ts_1.abytes)(key); - // 1. newX = bytepad(encode_string(K), 168) || X || right_encode(L). - const blockLenBytes = leftEncode(this.blockLen); - const keyLen = leftEncode(_8n * BigInt(key.length)); - this.update(blockLenBytes).update(keyLen).update(key); - const totalLen = blockLenBytes.length + keyLen.length + key.length; - this.update(getPadding(totalLen, this.blockLen)); - } - finish() { - if (!this.finished) - this.update(rightEncode(this.enableXOF ? 0 : _8n * BigInt(this.outputLen))); // outputLen in bits - super.finish(); - } - _cloneInto(to) { - // Create new instance without calling constructor since key already in state and we don't know it. - // Force "to" to be instance of KMAC instead of Sha3. - if (!to) { - to = Object.create(Object.getPrototypeOf(this), {}); - to.state = this.state.slice(); - to.blockLen = this.blockLen; - to.state32 = (0, utils_ts_1.u32)(to.state); - } - return super._cloneInto(to); - } - clone() { - return this._cloneInto(); - } -} -exports.KMAC = KMAC; -function genKmac(blockLen, outputLen, xof = false) { - const kmac = (key, message, opts) => kmac.create(key, opts).update(message).digest(); - kmac.create = (key, opts = {}) => new KMAC(blockLen, chooseLen(opts, outputLen), xof, key, opts); - return kmac; -} -exports.kmac128 = (() => genKmac(168, 128 / 8))(); -exports.kmac256 = (() => genKmac(136, 256 / 8))(); -exports.kmac128xof = (() => genKmac(168, 128 / 8, true))(); -exports.kmac256xof = (() => genKmac(136, 256 / 8, true))(); -// TupleHash -// Usage: tuple(['ab', 'cd']) != tuple(['a', 'bcd']) -class TupleHash extends sha3_ts_1.Keccak { - constructor(blockLen, outputLen, enableXOF, opts = {}) { - super(blockLen, 0x1f, outputLen, enableXOF); - cshakePers(this, { NISTfn: 'TupleHash', personalization: opts.personalization }); - // Change update after cshake processed - this.update = (data) => { - data = (0, utils_ts_1.toBytes)(data); - (0, utils_ts_1.abytes)(data); - super.update(leftEncode(_8n * BigInt(data.length))); - super.update(data); - return this; - }; - } - finish() { - if (!this.finished) - super.update(rightEncode(this.enableXOF ? 0 : _8n * BigInt(this.outputLen))); // outputLen in bits - super.finish(); - } - _cloneInto(to) { - to || (to = new TupleHash(this.blockLen, this.outputLen, this.enableXOF)); - return super._cloneInto(to); - } - clone() { - return this._cloneInto(); - } -} -exports.TupleHash = TupleHash; -function genTuple(blockLen, outputLen, xof = false) { - const tuple = (messages, opts) => { - const h = tuple.create(opts); - for (const msg of messages) - h.update(msg); - return h.digest(); - }; - tuple.create = (opts = {}) => new TupleHash(blockLen, chooseLen(opts, outputLen), xof, opts); - return tuple; -} -/** 128-bit TupleHASH. */ -exports.tuplehash128 = (() => genTuple(168, 128 / 8))(); -/** 256-bit TupleHASH. */ -exports.tuplehash256 = (() => genTuple(136, 256 / 8))(); -/** 128-bit TupleHASH XOF. */ -exports.tuplehash128xof = (() => genTuple(168, 128 / 8, true))(); -/** 256-bit TupleHASH XOF. */ -exports.tuplehash256xof = (() => genTuple(136, 256 / 8, true))(); -class ParallelHash extends sha3_ts_1.Keccak { - constructor(blockLen, outputLen, leafCons, enableXOF, opts = {}) { - super(blockLen, 0x1f, outputLen, enableXOF); - this.chunkPos = 0; // Position of current block in chunk - this.chunksDone = 0; // How many chunks we already have - cshakePers(this, { NISTfn: 'ParallelHash', personalization: opts.personalization }); - this.leafCons = leafCons; - let { blockLen: B } = opts; - B || (B = 8); - (0, utils_ts_1.anumber)(B); - this.chunkLen = B; - super.update(leftEncode(B)); - // Change update after cshake processed - this.update = (data) => { - data = (0, utils_ts_1.toBytes)(data); - (0, utils_ts_1.abytes)(data); - const { chunkLen, leafCons } = this; - for (let pos = 0, len = data.length; pos < len;) { - if (this.chunkPos == chunkLen || !this.leafHash) { - if (this.leafHash) { - super.update(this.leafHash.digest()); - this.chunksDone++; - } - this.leafHash = leafCons(); - this.chunkPos = 0; - } - const take = Math.min(chunkLen - this.chunkPos, len - pos); - this.leafHash.update(data.subarray(pos, pos + take)); - this.chunkPos += take; - pos += take; - } - return this; - }; - } - finish() { - if (this.finished) - return; - if (this.leafHash) { - super.update(this.leafHash.digest()); - this.chunksDone++; - } - super.update(rightEncode(this.chunksDone)); - super.update(rightEncode(this.enableXOF ? 0 : _8n * BigInt(this.outputLen))); // outputLen in bits - super.finish(); - } - _cloneInto(to) { - to || (to = new ParallelHash(this.blockLen, this.outputLen, this.leafCons, this.enableXOF)); - if (this.leafHash) - to.leafHash = this.leafHash._cloneInto(to.leafHash); - to.chunkPos = this.chunkPos; - to.chunkLen = this.chunkLen; - to.chunksDone = this.chunksDone; - return super._cloneInto(to); - } - destroy() { - super.destroy.call(this); - if (this.leafHash) - this.leafHash.destroy(); - } - clone() { - return this._cloneInto(); - } -} -exports.ParallelHash = ParallelHash; -function genPrl(blockLen, outputLen, leaf, xof = false) { - const parallel = (message, opts) => parallel.create(opts).update(message).digest(); - parallel.create = (opts = {}) => new ParallelHash(blockLen, chooseLen(opts, outputLen), () => leaf.create({ dkLen: 2 * outputLen }), xof, opts); - return parallel; -} -/** 128-bit ParallelHash. In JS, it is not parallel. */ -exports.parallelhash128 = (() => genPrl(168, 128 / 8, exports.cshake128))(); -/** 256-bit ParallelHash. In JS, it is not parallel. */ -exports.parallelhash256 = (() => genPrl(136, 256 / 8, exports.cshake256))(); -/** 128-bit ParallelHash XOF. In JS, it is not parallel. */ -exports.parallelhash128xof = (() => genPrl(168, 128 / 8, exports.cshake128, true))(); -/** 256-bit ParallelHash. In JS, it is not parallel. */ -exports.parallelhash256xof = (() => genPrl(136, 256 / 8, exports.cshake256, true))(); -const genTurboshake = (blockLen, outputLen) => (0, utils_ts_1.createXOFer)((opts = {}) => { - const D = opts.D === undefined ? 0x1f : opts.D; - // Section 2.1 of https://datatracker.ietf.org/doc/draft-irtf-cfrg-kangarootwelve/ - if (!Number.isSafeInteger(D) || D < 0x01 || D > 0x7f) - throw new Error('invalid domain separation byte must be 0x01..0x7f, got: ' + D); - return new sha3_ts_1.Keccak(blockLen, D, opts.dkLen === undefined ? outputLen : opts.dkLen, true, 12); -}); -/** TurboSHAKE 128-bit: reduced 12-round keccak. */ -exports.turboshake128 = genTurboshake(168, 256 / 8); -/** TurboSHAKE 256-bit: reduced 12-round keccak. */ -exports.turboshake256 = genTurboshake(136, 512 / 8); -// Kangaroo -// Same as NIST rightEncode, but returns [0] for zero string -function rightEncodeK12(n) { - n = BigInt(n); - const res = []; - for (; n > 0; n >>= _8n) - res.unshift(Number(n & _ffn)); - res.push(res.length); - return Uint8Array.from(res); -} -const EMPTY_BUFFER = /* @__PURE__ */ Uint8Array.of(); -class KangarooTwelve extends sha3_ts_1.Keccak { - constructor(blockLen, leafLen, outputLen, rounds, opts) { - super(blockLen, 0x07, outputLen, true, rounds); - this.chunkLen = 8192; - this.chunkPos = 0; // Position of current block in chunk - this.chunksDone = 0; // How many chunks we already have - this.leafLen = leafLen; - this.personalization = abytesOrZero(opts.personalization); - } - update(data) { - data = (0, utils_ts_1.toBytes)(data); - (0, utils_ts_1.abytes)(data); - const { chunkLen, blockLen, leafLen, rounds } = this; - for (let pos = 0, len = data.length; pos < len;) { - if (this.chunkPos == chunkLen) { - if (this.leafHash) - super.update(this.leafHash.digest()); - else { - this.suffix = 0x06; // Its safe to change suffix here since its used only in digest() - super.update(Uint8Array.from([3, 0, 0, 0, 0, 0, 0, 0])); - } - this.leafHash = new sha3_ts_1.Keccak(blockLen, 0x0b, leafLen, false, rounds); - this.chunksDone++; - this.chunkPos = 0; - } - const take = Math.min(chunkLen - this.chunkPos, len - pos); - const chunk = data.subarray(pos, pos + take); - if (this.leafHash) - this.leafHash.update(chunk); - else - super.update(chunk); - this.chunkPos += take; - pos += take; - } - return this; - } - finish() { - if (this.finished) - return; - const { personalization } = this; - this.update(personalization).update(rightEncodeK12(personalization.length)); - // Leaf hash - if (this.leafHash) { - super.update(this.leafHash.digest()); - super.update(rightEncodeK12(this.chunksDone)); - super.update(Uint8Array.from([0xff, 0xff])); - } - super.finish.call(this); - } - destroy() { - super.destroy.call(this); - if (this.leafHash) - this.leafHash.destroy(); - // We cannot zero personalization buffer since it is user provided and we don't want to mutate user input - this.personalization = EMPTY_BUFFER; - } - _cloneInto(to) { - const { blockLen, leafLen, leafHash, outputLen, rounds } = this; - to || (to = new KangarooTwelve(blockLen, leafLen, outputLen, rounds, {})); - super._cloneInto(to); - if (leafHash) - to.leafHash = leafHash._cloneInto(to.leafHash); - to.personalization.set(this.personalization); - to.leafLen = this.leafLen; - to.chunkPos = this.chunkPos; - to.chunksDone = this.chunksDone; - return to; - } - clone() { - return this._cloneInto(); - } -} -exports.KangarooTwelve = KangarooTwelve; -/** KangarooTwelve: reduced 12-round keccak. */ -exports.k12 = (() => (0, utils_ts_1.createOptHasher)((opts = {}) => new KangarooTwelve(168, 32, chooseLen(opts, 32), 12, opts)))(); -/** MarsupilamiFourteen: reduced 14-round keccak. */ -exports.m14 = (() => (0, utils_ts_1.createOptHasher)((opts = {}) => new KangarooTwelve(136, 64, chooseLen(opts, 64), 14, opts)))(); -/** - * More at https://github.com/XKCP/XKCP/tree/master/lib/high/Keccak/PRG. - */ -class KeccakPRG extends sha3_ts_1.Keccak { - constructor(capacity) { - (0, utils_ts_1.anumber)(capacity); - // Rho should be full bytes - if (capacity < 0 || capacity > 1600 - 10 || (1600 - capacity - 2) % 8) - throw new Error('invalid capacity'); - // blockLen = rho in bytes - super((1600 - capacity - 2) / 8, 0, 0, true); - this.rate = 1600 - capacity; - this.posOut = Math.floor((this.rate + 7) / 8); - } - keccak() { - // Duplex padding - this.state[this.pos] ^= 0x01; - this.state[this.blockLen] ^= 0x02; // Rho is full bytes - super.keccak(); - this.pos = 0; - this.posOut = 0; - } - update(data) { - super.update(data); - this.posOut = this.blockLen; - return this; - } - feed(data) { - return this.update(data); - } - finish() { } - digestInto(_out) { - throw new Error('digest is not allowed, use .fetch instead'); - } - fetch(bytes) { - return this.xof(bytes); - } - // Ensure irreversibility (even if state leaked previous outputs cannot be computed) - forget() { - if (this.rate < 1600 / 2 + 1) - throw new Error('rate is too low to use .forget()'); - this.keccak(); - for (let i = 0; i < this.blockLen; i++) - this.state[i] = 0; - this.pos = this.blockLen; - this.keccak(); - this.posOut = this.blockLen; - } - _cloneInto(to) { - const { rate } = this; - to || (to = new KeccakPRG(1600 - rate)); - super._cloneInto(to); - to.rate = rate; - return to; - } - clone() { - return this._cloneInto(); - } -} -exports.KeccakPRG = KeccakPRG; -/** KeccakPRG: Pseudo-random generator based on Keccak. https://keccak.team/files/CSF-0.1.pdf */ -const keccakprg = (capacity = 254) => new KeccakPRG(capacity); -exports.keccakprg = keccakprg; -//# sourceMappingURL=sha3-addons.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/sha3-addons.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/sha3-addons.js.map deleted file mode 100644 index b37cd196..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/sha3-addons.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha3-addons.js","sourceRoot":"","sources":["src/sha3-addons.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;GAWG;AACH,uCAAmD;AACnD,yCAYoB;AAEpB,kCAAkC;AAClC,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MA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E,IAAI,EAAE,GAAG,IAAI,CAAC;QACtB,EAAE,KAAF,EAAE,GAAK,IAAI,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,EAAC;QAClC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;QACrB,EAAE,CAAC,IAAI,GAAG,IAAI,CAAC;QACf,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,KAAK;QACH,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;IAC3B,CAAC;CACF;AAtDD,8BAsDC;AAED,gGAAgG;AACzF,MAAM,SAAS,GAAG,CAAC,QAAQ,GAAG,GAAG,EAAa,EAAE,CAAC,IAAI,SAAS,CAAC,QAAQ,CAAC,CAAC;AAAnE,QAAA,SAAS,aAA0D"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/sha3.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/sha3.d.ts deleted file mode 100644 index 9df47b19..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/sha3.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { Hash, type CHash, type CHashXO, type HashXOF, type Input } from './utils.ts'; -/** `keccakf1600` internal function, additionally allows to adjust round count. */ -export declare function keccakP(s: Uint32Array, rounds?: number): void; -/** Keccak sponge function. */ -export declare class Keccak extends Hash implements HashXOF { - protected state: Uint8Array; - protected pos: number; - protected posOut: number; - protected finished: boolean; - protected state32: Uint32Array; - protected destroyed: boolean; - blockLen: number; - suffix: number; - outputLen: number; - protected enableXOF: boolean; - protected rounds: number; - constructor(blockLen: number, suffix: number, outputLen: number, enableXOF?: boolean, rounds?: number); - clone(): Keccak; - protected keccak(): void; - update(data: Input): this; - protected finish(): void; - protected writeInto(out: Uint8Array): Uint8Array; - xofInto(out: Uint8Array): Uint8Array; - xof(bytes: number): Uint8Array; - digestInto(out: Uint8Array): Uint8Array; - digest(): Uint8Array; - destroy(): void; - _cloneInto(to?: Keccak): Keccak; -} -/** SHA3-224 hash function. */ -export declare const sha3_224: CHash; -/** SHA3-256 hash function. Different from keccak-256. */ -export declare const sha3_256: CHash; -/** SHA3-384 hash function. */ -export declare const sha3_384: CHash; -/** SHA3-512 hash function. */ -export declare const sha3_512: CHash; -/** keccak-224 hash function. */ -export declare const keccak_224: CHash; -/** keccak-256 hash function. Different from SHA3-256. */ -export declare const keccak_256: CHash; -/** keccak-384 hash function. */ -export declare const keccak_384: CHash; -/** keccak-512 hash function. */ -export declare const keccak_512: CHash; -export type ShakeOpts = { - dkLen?: number; -}; -/** SHAKE128 XOF with 128-bit security. */ -export declare const shake128: CHashXO; -/** SHAKE256 XOF with 256-bit security. */ -export declare const shake256: CHashXO; -//# sourceMappingURL=sha3.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/sha3.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/sha3.d.ts.map deleted file mode 100644 index 979f89d4..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/sha3.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha3.d.ts","sourceRoot":"","sources":["src/sha3.ts"],"names":[],"mappings":"AAaA,OAAO,EAE6B,IAAI,EAGtC,KAAK,KAAK,EAAE,KAAK,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EACnD,MAAM,YAAY,CAAC;AAoCpB,kFAAkF;AAClF,wBAAgB,OAAO,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,GAAE,MAAW,GAAG,IAAI,CAyCjE;AAED,8BAA8B;AAC9B,qBAAa,MAAO,SAAQ,IAAI,CAAC,MAAM,CAAE,YAAW,OAAO,CAAC,MAAM,CAAC;IACjE,SAAS,CAAC,KAAK,EAAE,UAAU,CAAC;IAC5B,SAAS,CAAC,GAAG,SAAK;IAClB,SAAS,CAAC,MAAM,SAAK;IACrB,SAAS,CAAC,QAAQ,UAAS;IAC3B,SAAS,CAAC,OAAO,EAAE,WAAW,CAAC;IAC/B,SAAS,CAAC,SAAS,UA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AM,MAAM,SAAS,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAQ3C,0CAA0C;AAC1C,eAAO,MAAM,QAAQ,EAAE,OAAgE,CAAC;AACxF,0CAA0C;AAC1C,eAAO,MAAM,QAAQ,EAAE,OAAgE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/sha3.js b/tools/mnemonic-test/node_modules/@noble/hashes/sha3.js deleted file mode 100644 index bc612280..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/sha3.js +++ /dev/null @@ -1,239 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.shake256 = exports.shake128 = exports.keccak_512 = exports.keccak_384 = exports.keccak_256 = exports.keccak_224 = exports.sha3_512 = exports.sha3_384 = exports.sha3_256 = exports.sha3_224 = exports.Keccak = void 0; -exports.keccakP = keccakP; -/** - * SHA3 (keccak) hash function, based on a new "Sponge function" design. - * Different from older hashes, the internal state is bigger than output size. - * - * Check out [FIPS-202](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf), - * [Website](https://keccak.team/keccak.html), - * [the differences between SHA-3 and Keccak](https://crypto.stackexchange.com/questions/15727/what-are-the-key-differences-between-the-draft-sha-3-standard-and-the-keccak-sub). - * - * Check out `sha3-addons` module for cSHAKE, k12, and others. - * @module - */ -const _u64_ts_1 = require("./_u64.js"); -// prettier-ignore -const utils_ts_1 = require("./utils.js"); -// No __PURE__ annotations in sha3 header: -// EVERYTHING is in fact used on every export. -// Various per round constants calculations -const _0n = BigInt(0); -const _1n = BigInt(1); -const _2n = BigInt(2); -const _7n = BigInt(7); -const _256n = BigInt(256); -const _0x71n = BigInt(0x71); -const SHA3_PI = []; -const SHA3_ROTL = []; -const _SHA3_IOTA = []; -for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) { - // Pi - [x, y] = [y, (2 * x + 3 * y) % 5]; - SHA3_PI.push(2 * (5 * y + x)); - // Rotational - SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64); - // Iota - let t = _0n; - for (let j = 0; j < 7; j++) { - R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n; - if (R & _2n) - t ^= _1n << ((_1n << /* @__PURE__ */ BigInt(j)) - _1n); - } - _SHA3_IOTA.push(t); -} -const IOTAS = (0, _u64_ts_1.split)(_SHA3_IOTA, true); -const SHA3_IOTA_H = IOTAS[0]; -const SHA3_IOTA_L = IOTAS[1]; -// Left rotation (without 0, 32, 64) -const rotlH = (h, l, s) => (s > 32 ? (0, _u64_ts_1.rotlBH)(h, l, s) : (0, _u64_ts_1.rotlSH)(h, l, s)); -const rotlL = (h, l, s) => (s > 32 ? (0, _u64_ts_1.rotlBL)(h, l, s) : (0, _u64_ts_1.rotlSL)(h, l, s)); -/** `keccakf1600` internal function, additionally allows to adjust round count. */ -function keccakP(s, rounds = 24) { - const B = new Uint32Array(5 * 2); - // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js) - for (let round = 24 - rounds; round < 24; round++) { - // Theta θ - for (let x = 0; x < 10; x++) - B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40]; - for (let x = 0; x < 10; x += 2) { - const idx1 = (x + 8) % 10; - const idx0 = (x + 2) % 10; - const B0 = B[idx0]; - const B1 = B[idx0 + 1]; - const Th = rotlH(B0, B1, 1) ^ B[idx1]; - const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1]; - for (let y = 0; y < 50; y += 10) { - s[x + y] ^= Th; - s[x + y + 1] ^= Tl; - } - } - // Rho (ρ) and Pi (π) - let curH = s[2]; - let curL = s[3]; - for (let t = 0; t < 24; t++) { - const shift = SHA3_ROTL[t]; - const Th = rotlH(curH, curL, shift); - const Tl = rotlL(curH, curL, shift); - const PI = SHA3_PI[t]; - curH = s[PI]; - curL = s[PI + 1]; - s[PI] = Th; - s[PI + 1] = Tl; - } - // Chi (χ) - for (let y = 0; y < 50; y += 10) { - for (let x = 0; x < 10; x++) - B[x] = s[y + x]; - for (let x = 0; x < 10; x++) - s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10]; - } - // Iota (ι) - s[0] ^= SHA3_IOTA_H[round]; - s[1] ^= SHA3_IOTA_L[round]; - } - (0, utils_ts_1.clean)(B); -} -/** Keccak sponge function. */ -class Keccak extends utils_ts_1.Hash { - // NOTE: we accept arguments in bytes instead of bits here. - constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) { - super(); - this.pos = 0; - this.posOut = 0; - this.finished = false; - this.destroyed = false; - this.enableXOF = false; - this.blockLen = blockLen; - this.suffix = suffix; - this.outputLen = outputLen; - this.enableXOF = enableXOF; - this.rounds = rounds; - // Can be passed from user as dkLen - (0, utils_ts_1.anumber)(outputLen); - // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes - // 0 < blockLen < 200 - if (!(0 < blockLen && blockLen < 200)) - throw new Error('only keccak-f1600 function is supported'); - this.state = new Uint8Array(200); - this.state32 = (0, utils_ts_1.u32)(this.state); - } - clone() { - return this._cloneInto(); - } - keccak() { - (0, utils_ts_1.swap32IfBE)(this.state32); - keccakP(this.state32, this.rounds); - (0, utils_ts_1.swap32IfBE)(this.state32); - this.posOut = 0; - this.pos = 0; - } - update(data) { - (0, utils_ts_1.aexists)(this); - data = (0, utils_ts_1.toBytes)(data); - (0, utils_ts_1.abytes)(data); - const { blockLen, state } = this; - const len = data.length; - for (let pos = 0; pos < len;) { - const take = Math.min(blockLen - this.pos, len - pos); - for (let i = 0; i < take; i++) - state[this.pos++] ^= data[pos++]; - if (this.pos === blockLen) - this.keccak(); - } - return this; - } - finish() { - if (this.finished) - return; - this.finished = true; - const { state, suffix, pos, blockLen } = this; - // Do the padding - state[pos] ^= suffix; - if ((suffix & 0x80) !== 0 && pos === blockLen - 1) - this.keccak(); - state[blockLen - 1] ^= 0x80; - this.keccak(); - } - writeInto(out) { - (0, utils_ts_1.aexists)(this, false); - (0, utils_ts_1.abytes)(out); - this.finish(); - const bufferOut = this.state; - const { blockLen } = this; - for (let pos = 0, len = out.length; pos < len;) { - if (this.posOut >= blockLen) - this.keccak(); - const take = Math.min(blockLen - this.posOut, len - pos); - out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); - this.posOut += take; - pos += take; - } - return out; - } - xofInto(out) { - // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF - if (!this.enableXOF) - throw new Error('XOF is not possible for this instance'); - return this.writeInto(out); - } - xof(bytes) { - (0, utils_ts_1.anumber)(bytes); - return this.xofInto(new Uint8Array(bytes)); - } - digestInto(out) { - (0, utils_ts_1.aoutput)(out, this); - if (this.finished) - throw new Error('digest() was already called'); - this.writeInto(out); - this.destroy(); - return out; - } - digest() { - return this.digestInto(new Uint8Array(this.outputLen)); - } - destroy() { - this.destroyed = true; - (0, utils_ts_1.clean)(this.state); - } - _cloneInto(to) { - const { blockLen, suffix, outputLen, rounds, enableXOF } = this; - to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds)); - to.state32.set(this.state32); - to.pos = this.pos; - to.posOut = this.posOut; - to.finished = this.finished; - to.rounds = rounds; - // Suffix can change in cSHAKE - to.suffix = suffix; - to.outputLen = outputLen; - to.enableXOF = enableXOF; - to.destroyed = this.destroyed; - return to; - } -} -exports.Keccak = Keccak; -const gen = (suffix, blockLen, outputLen) => (0, utils_ts_1.createHasher)(() => new Keccak(blockLen, suffix, outputLen)); -/** SHA3-224 hash function. */ -exports.sha3_224 = (() => gen(0x06, 144, 224 / 8))(); -/** SHA3-256 hash function. Different from keccak-256. */ -exports.sha3_256 = (() => gen(0x06, 136, 256 / 8))(); -/** SHA3-384 hash function. */ -exports.sha3_384 = (() => gen(0x06, 104, 384 / 8))(); -/** SHA3-512 hash function. */ -exports.sha3_512 = (() => gen(0x06, 72, 512 / 8))(); -/** keccak-224 hash function. */ -exports.keccak_224 = (() => gen(0x01, 144, 224 / 8))(); -/** keccak-256 hash function. Different from SHA3-256. */ -exports.keccak_256 = (() => gen(0x01, 136, 256 / 8))(); -/** keccak-384 hash function. */ -exports.keccak_384 = (() => gen(0x01, 104, 384 / 8))(); -/** keccak-512 hash function. */ -exports.keccak_512 = (() => gen(0x01, 72, 512 / 8))(); -const genShake = (suffix, blockLen, outputLen) => (0, utils_ts_1.createXOFer)((opts = {}) => new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true)); -/** SHAKE128 XOF with 128-bit security. */ -exports.shake128 = (() => genShake(0x1f, 168, 128 / 8))(); -/** SHAKE256 XOF with 256-bit security. */ -exports.shake256 = (() => genShake(0x1f, 136, 256 / 8))(); -//# sourceMappingURL=sha3.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/sha3.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/sha3.js.map deleted file mode 100644 index 42b47f32..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/sha3.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha3.js","sourceRoot":"","sources":["src/sha3.ts"],"names":[],"mappings":";;;AAwDA,0BAyCC;AAjGD;;;;;;;;;;GAUG;AACH,uCAAkE;AAClE,kBAAkB;AAClB,yCAMoB;AAEpB,0CAA0C;AAC1C,8CAA8C;AAC9C,2CAA2C;AAC3C,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AAC1B,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;AAC5B,MAAM,OAAO,GAAa,EAAE,CAAC;AAC7B,MAAM,SAAS,GAAa,EAAE,CAAC;AAC/B,MAAM,UAAU,G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B,EAAE,EAAE,EAAE,CACvB,IAAI,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CACxF,CAAC;AAEJ,0CAA0C;AAC7B,QAAA,QAAQ,GAA4B,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;AACxF,0CAA0C;AAC7B,QAAA,QAAQ,GAA4B,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/sha512.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/sha512.d.ts deleted file mode 100644 index 46a27d02..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/sha512.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * SHA2-512 a.k.a. sha512 and sha384. It is slower than sha256 in js because u64 operations are slow. - * - * Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and - * [the paper on truncated SHA512/256](https://eprint.iacr.org/2010/548.pdf). - * @module - * @deprecated - */ -import { SHA384 as SHA384n, sha384 as sha384n, sha512_224 as sha512_224n, SHA512_224 as SHA512_224n, sha512_256 as sha512_256n, SHA512_256 as SHA512_256n, SHA512 as SHA512n, sha512 as sha512n } from './sha2.ts'; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export declare const SHA512: typeof SHA512n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export declare const sha512: typeof sha512n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export declare const SHA384: typeof SHA384n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export declare const sha384: typeof sha384n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export declare const SHA512_224: typeof SHA512_224n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export declare const sha512_224: typeof sha512_224n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export declare const SHA512_256: typeof SHA512_256n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export declare const sha512_256: typeof sha512_256n; -//# sourceMappingURL=sha512.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/sha512.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/sha512.d.ts.map deleted file mode 100644 index 4ed35ec3..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/sha512.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha512.d.ts","sourceRoot":"","sources":["src/sha512.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,MAAM,IAAI,OAAO,EACjB,MAAM,IAAI,OAAO,EACjB,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,EACzB,MAAM,IAAI,OAAO,EACjB,MAAM,IAAI,OAAO,EAClB,MAAM,WAAW,CAAC;AACnB,6DAA6D;AAC7D,eAAO,MAAM,MAAM,EAAE,OAAO,OAAiB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,MAAM,EAAE,OAAO,OAAiB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,MAAM,EAAE,OAAO,OAAiB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,MAAM,EAAE,OAAO,OAAiB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,UAAU,EAAE,OAAO,WAAyB,CAAC;AAC1D,6DAA6D;AAC7D,eAAO,MAAM,UAAU,EAAE,OAAO,WAAyB,CAAC;AAC1D,6DAA6D;AAC7D,eAAO,MAAM,UAAU,EAAE,OAAO,WAAyB,CAAC;AAC1D,6DAA6D;AAC7D,eAAO,MAAM,UAAU,EAAE,OAAO,WAAyB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/sha512.js b/tools/mnemonic-test/node_modules/@noble/hashes/sha512.js deleted file mode 100644 index 31cbbca3..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/sha512.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.sha512_256 = exports.SHA512_256 = exports.sha512_224 = exports.SHA512_224 = exports.sha384 = exports.SHA384 = exports.sha512 = exports.SHA512 = void 0; -/** - * SHA2-512 a.k.a. sha512 and sha384. It is slower than sha256 in js because u64 operations are slow. - * - * Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and - * [the paper on truncated SHA512/256](https://eprint.iacr.org/2010/548.pdf). - * @module - * @deprecated - */ -const sha2_ts_1 = require("./sha2.js"); -/** @deprecated Use import from `noble/hashes/sha2` module */ -exports.SHA512 = sha2_ts_1.SHA512; -/** @deprecated Use import from `noble/hashes/sha2` module */ -exports.sha512 = sha2_ts_1.sha512; -/** @deprecated Use import from `noble/hashes/sha2` module */ -exports.SHA384 = sha2_ts_1.SHA384; -/** @deprecated Use import from `noble/hashes/sha2` module */ -exports.sha384 = sha2_ts_1.sha384; -/** @deprecated Use import from `noble/hashes/sha2` module */ -exports.SHA512_224 = sha2_ts_1.SHA512_224; -/** @deprecated Use import from `noble/hashes/sha2` module */ -exports.sha512_224 = sha2_ts_1.sha512_224; -/** @deprecated Use import from `noble/hashes/sha2` module */ -exports.SHA512_256 = sha2_ts_1.SHA512_256; -/** @deprecated Use import from `noble/hashes/sha2` module */ -exports.sha512_256 = sha2_ts_1.sha512_256; -//# sourceMappingURL=sha512.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/sha512.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/sha512.js.map deleted file mode 100644 index e685b206..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/sha512.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha512.js","sourceRoot":"","sources":["src/sha512.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACH,uCASmB;AACnB,6DAA6D;AAChD,QAAA,MAAM,GAAmB,gBAAO,CAAC;AAC9C,6DAA6D;AAChD,QAAA,MAAM,GAAmB,gBAAO,CAAC;AAC9C,6DAA6D;AAChD,QAAA,MAAM,GAAmB,gBAAO,CAAC;AAC9C,6DAA6D;AAChD,QAAA,MAAM,GAAmB,gBAAO,CAAC;AAC9C,6DAA6D;AAChD,QAAA,UAAU,GAAuB,oBAAW,CAAC;AAC1D,6DAA6D;AAChD,QAAA,UAAU,GAAuB,oBAAW,CAAC;AAC1D,6DAA6D;AAChD,QAAA,UAAU,GAAuB,oBAAW,CAAC;AAC1D,6DAA6D;AAChD,QAAA,UAAU,GAAuB,oBAAW,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/src/_assert.ts b/tools/mnemonic-test/node_modules/@noble/hashes/src/_assert.ts deleted file mode 100644 index 3da1eb1e..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/src/_assert.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Internal assertion helpers. - * @module - * @deprecated - */ -import { - abytes as ab, - aexists as ae, - anumber as an, - aoutput as ao, - type IHash as H, -} from './utils.ts'; -/** @deprecated Use import from `noble/hashes/utils` module */ -export const abytes: typeof ab = ab; -/** @deprecated Use import from `noble/hashes/utils` module */ -export const aexists: typeof ae = ae; -/** @deprecated Use import from `noble/hashes/utils` module */ -export const anumber: typeof an = an; -/** @deprecated Use import from `noble/hashes/utils` module */ -export const aoutput: typeof ao = ao; -/** @deprecated Use import from `noble/hashes/utils` module */ -export type Hash = H; diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/src/_blake.ts b/tools/mnemonic-test/node_modules/@noble/hashes/src/_blake.ts deleted file mode 100644 index 2df27be0..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/src/_blake.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Internal helpers for blake hash. - * @module - */ -import { rotr } from './utils.ts'; - -/** - * Internal blake variable. - * For BLAKE2b, the two extra permutations for rounds 10 and 11 are SIGMA[10..11] = SIGMA[0..1]. - */ -// prettier-ignore -export const BSIGMA: Uint8Array = /* @__PURE__ */ Uint8Array.from([ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3, - 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4, - 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8, - 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13, - 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9, - 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11, - 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10, - 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5, - 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3, - // Blake1, unused in others - 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4, - 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8, - 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13, - 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9, -]); - -// prettier-ignore -export type Num4 = { a: number; b: number; c: number; d: number; }; - -// Mixing function G splitted in two halfs -export function G1s(a: number, b: number, c: number, d: number, x: number): Num4 { - a = (a + b + x) | 0; - d = rotr(d ^ a, 16); - c = (c + d) | 0; - b = rotr(b ^ c, 12); - return { a, b, c, d }; -} - -export function G2s(a: number, b: number, c: number, d: number, x: number): Num4 { - a = (a + b + x) | 0; - d = rotr(d ^ a, 8); - c = (c + d) | 0; - b = rotr(b ^ c, 7); - return { a, b, c, d }; -} diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/src/_md.ts b/tools/mnemonic-test/node_modules/@noble/hashes/src/_md.ts deleted file mode 100644 index 469b7815..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/src/_md.ts +++ /dev/null @@ -1,176 +0,0 @@ -/** - * Internal Merkle-Damgard hash utils. - * @module - */ -import { type Input, Hash, abytes, aexists, aoutput, clean, createView, toBytes } from './utils.ts'; - -/** Polyfill for Safari 14. https://caniuse.com/mdn-javascript_builtins_dataview_setbiguint64 */ -export function setBigUint64( - view: DataView, - byteOffset: number, - value: bigint, - isLE: boolean -): void { - if (typeof view.setBigUint64 === 'function') return view.setBigUint64(byteOffset, value, isLE); - const _32n = BigInt(32); - const _u32_max = BigInt(0xffffffff); - const wh = Number((value >> _32n) & _u32_max); - const wl = Number(value & _u32_max); - const h = isLE ? 4 : 0; - const l = isLE ? 0 : 4; - view.setUint32(byteOffset + h, wh, isLE); - view.setUint32(byteOffset + l, wl, isLE); -} - -/** Choice: a ? b : c */ -export function Chi(a: number, b: number, c: number): number { - return (a & b) ^ (~a & c); -} - -/** Majority function, true if any two inputs is true. */ -export function Maj(a: number, b: number, c: number): number { - return (a & b) ^ (a & c) ^ (b & c); -} - -/** - * Merkle-Damgard hash construction base class. - * Could be used to create MD5, RIPEMD, SHA1, SHA2. - */ -export abstract class HashMD> extends Hash { - protected abstract process(buf: DataView, offset: number): void; - protected abstract get(): number[]; - protected abstract set(...args: number[]): void; - abstract destroy(): void; - protected abstract roundClean(): void; - - readonly blockLen: number; - readonly outputLen: number; - readonly padOffset: number; - readonly isLE: boolean; - - // For partial updates less than block size - protected buffer: Uint8Array; - protected view: DataView; - protected finished = false; - protected length = 0; - protected pos = 0; - protected destroyed = false; - - constructor(blockLen: number, outputLen: number, padOffset: number, isLE: boolean) { - super(); - this.blockLen = blockLen; - this.outputLen = outputLen; - this.padOffset = padOffset; - this.isLE = isLE; - this.buffer = new Uint8Array(blockLen); - this.view = createView(this.buffer); - } - update(data: Input): this { - aexists(this); - data = toBytes(data); - abytes(data); - const { view, buffer, blockLen } = this; - const len = data.length; - for (let pos = 0; pos < len; ) { - const take = Math.min(blockLen - this.pos, len - pos); - // Fast path: we have at least one block in input, cast it to view and process - if (take === blockLen) { - const dataView = createView(data); - for (; blockLen <= len - pos; pos += blockLen) this.process(dataView, pos); - continue; - } - buffer.set(data.subarray(pos, pos + take), this.pos); - this.pos += take; - pos += take; - if (this.pos === blockLen) { - this.process(view, 0); - this.pos = 0; - } - } - this.length += data.length; - this.roundClean(); - return this; - } - digestInto(out: Uint8Array): void { - aexists(this); - aoutput(out, this); - this.finished = true; - // Padding - // We can avoid allocation of buffer for padding completely if it - // was previously not allocated here. But it won't change performance. - const { buffer, view, blockLen, isLE } = this; - let { pos } = this; - // append the bit '1' to the message - buffer[pos++] = 0b10000000; - clean(this.buffer.subarray(pos)); - // we have less than padOffset left in buffer, so we cannot put length in - // current block, need process it and pad again - if (this.padOffset > blockLen - pos) { - this.process(view, 0); - pos = 0; - } - // Pad until full block byte with zeros - for (let i = pos; i < blockLen; i++) buffer[i] = 0; - // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that - // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen. - // So we just write lowest 64 bits of that value. - setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE); - this.process(view, 0); - const oview = createView(out); - const len = this.outputLen; - // NOTE: we do division by 4 later, which should be fused in single op with modulo by JIT - if (len % 4) throw new Error('_sha2: outputLen should be aligned to 32bit'); - const outLen = len / 4; - const state = this.get(); - if (outLen > state.length) throw new Error('_sha2: outputLen bigger than state'); - for (let i = 0; i < outLen; i++) oview.setUint32(4 * i, state[i], isLE); - } - digest(): Uint8Array { - const { buffer, outputLen } = this; - this.digestInto(buffer); - const res = buffer.slice(0, outputLen); - this.destroy(); - return res; - } - _cloneInto(to?: T): T { - to ||= new (this.constructor as any)() as T; - to.set(...this.get()); - const { blockLen, buffer, length, finished, destroyed, pos } = this; - to.destroyed = destroyed; - to.finished = finished; - to.length = length; - to.pos = pos; - if (length % blockLen) to.buffer.set(buffer); - return to; - } - clone(): T { - return this._cloneInto(); - } -} - -/** - * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53. - * Check out `test/misc/sha2-gen-iv.js` for recomputation guide. - */ - -/** Initial SHA256 state. Bits 0..32 of frac part of sqrt of primes 2..19 */ -export const SHA256_IV: Uint32Array = /* @__PURE__ */ Uint32Array.from([ - 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19, -]); - -/** Initial SHA224 state. Bits 32..64 of frac part of sqrt of primes 23..53 */ -export const SHA224_IV: Uint32Array = /* @__PURE__ */ Uint32Array.from([ - 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4, -]); - -/** Initial SHA384 state. Bits 0..64 of frac part of sqrt of primes 23..53 */ -export const SHA384_IV: Uint32Array = /* @__PURE__ */ Uint32Array.from([ - 0xcbbb9d5d, 0xc1059ed8, 0x629a292a, 0x367cd507, 0x9159015a, 0x3070dd17, 0x152fecd8, 0xf70e5939, - 0x67332667, 0xffc00b31, 0x8eb44a87, 0x68581511, 0xdb0c2e0d, 0x64f98fa7, 0x47b5481d, 0xbefa4fa4, -]); - -/** Initial SHA512 state. Bits 0..64 of frac part of sqrt of primes 2..19 */ -export const SHA512_IV: Uint32Array = /* @__PURE__ */ Uint32Array.from([ - 0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1, - 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179, -]); diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/src/_u64.ts b/tools/mnemonic-test/node_modules/@noble/hashes/src/_u64.ts deleted file mode 100644 index 703c7da5..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/src/_u64.ts +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Internal helpers for u64. BigUint64Array is too slow as per 2025, so we implement it using Uint32Array. - * @todo re-check https://issues.chromium.org/issues/42212588 - * @module - */ -const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1); -const _32n = /* @__PURE__ */ BigInt(32); - -function fromBig( - n: bigint, - le = false -): { - h: number; - l: number; -} { - if (le) return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) }; - return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 }; -} - -function split(lst: bigint[], le = false): Uint32Array[] { - const len = lst.length; - let Ah = new Uint32Array(len); - let Al = new Uint32Array(len); - for (let i = 0; i < len; i++) { - const { h, l } = fromBig(lst[i], le); - [Ah[i], Al[i]] = [h, l]; - } - return [Ah, Al]; -} - -const toBig = (h: number, l: number): bigint => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0); -// for Shift in [0, 32) -const shrSH = (h: number, _l: number, s: number): number => h >>> s; -const shrSL = (h: number, l: number, s: number): number => (h << (32 - s)) | (l >>> s); -// Right rotate for Shift in [1, 32) -const rotrSH = (h: number, l: number, s: number): number => (h >>> s) | (l << (32 - s)); -const rotrSL = (h: number, l: number, s: number): number => (h << (32 - s)) | (l >>> s); -// Right rotate for Shift in (32, 64), NOTE: 32 is special case. -const rotrBH = (h: number, l: number, s: number): number => (h << (64 - s)) | (l >>> (s - 32)); -const rotrBL = (h: number, l: number, s: number): number => (h >>> (s - 32)) | (l << (64 - s)); -// Right rotate for shift===32 (just swaps l&h) -const rotr32H = (_h: number, l: number): number => l; -const rotr32L = (h: number, _l: number): number => h; -// Left rotate for Shift in [1, 32) -const rotlSH = (h: number, l: number, s: number): number => (h << s) | (l >>> (32 - s)); -const rotlSL = (h: number, l: number, s: number): number => (l << s) | (h >>> (32 - s)); -// Left rotate for Shift in (32, 64), NOTE: 32 is special case. -const rotlBH = (h: number, l: number, s: number): number => (l << (s - 32)) | (h >>> (64 - s)); -const rotlBL = (h: number, l: number, s: number): number => (h << (s - 32)) | (l >>> (64 - s)); - -// JS uses 32-bit signed integers for bitwise operations which means we cannot -// simple take carry out of low bit sum by shift, we need to use division. -function add( - Ah: number, - Al: number, - Bh: number, - Bl: number -): { - h: number; - l: number; -} { - const l = (Al >>> 0) + (Bl >>> 0); - return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 }; -} -// Addition with more than 2 elements -const add3L = (Al: number, Bl: number, Cl: number): number => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); -const add3H = (low: number, Ah: number, Bh: number, Ch: number): number => - (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0; -const add4L = (Al: number, Bl: number, Cl: number, Dl: number): number => - (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); -const add4H = (low: number, Ah: number, Bh: number, Ch: number, Dh: number): number => - (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0; -const add5L = (Al: number, Bl: number, Cl: number, Dl: number, El: number): number => - (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); -const add5H = (low: number, Ah: number, Bh: number, Ch: number, Dh: number, Eh: number): number => - (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0; - -// prettier-ignore -export { - add, add3H, add3L, add4H, add4L, add5H, add5L, fromBig, rotlBH, rotlBL, rotlSH, rotlSL, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL, shrSH, shrSL, split, toBig -}; -// prettier-ignore -const u64: { fromBig: typeof fromBig; split: typeof split; toBig: (h: number, l: number) => bigint; shrSH: (h: number, _l: number, s: number) => number; shrSL: (h: number, l: number, s: number) => number; rotrSH: (h: number, l: number, s: number) => number; rotrSL: (h: number, l: number, s: number) => number; rotrBH: (h: number, l: number, s: number) => number; rotrBL: (h: number, l: number, s: number) => number; rotr32H: (_h: number, l: number) => number; rotr32L: (h: number, _l: number) => number; rotlSH: (h: number, l: number, s: number) => number; rotlSL: (h: number, l: number, s: number) => number; rotlBH: (h: number, l: number, s: number) => number; rotlBL: (h: number, l: number, s: number) => number; add: typeof add; add3L: (Al: number, Bl: number, Cl: number) => number; add3H: (low: number, Ah: number, Bh: number, Ch: number) => number; add4L: (Al: number, Bl: number, Cl: number, Dl: number) => number; add4H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number) => number; add5H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number, Eh: number) => number; add5L: (Al: number, Bl: number, Cl: number, Dl: number, El: number) => number; } = { - fromBig, split, toBig, - shrSH, shrSL, - rotrSH, rotrSL, rotrBH, rotrBL, - rotr32H, rotr32L, - rotlSH, rotlSL, rotlBH, rotlBL, - add, add3L, add3H, add4L, add4H, add5H, add5L, -}; -export default u64; diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/src/argon2.ts b/tools/mnemonic-test/node_modules/@noble/hashes/src/argon2.ts deleted file mode 100644 index 9bf7a7ec..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/src/argon2.ts +++ /dev/null @@ -1,497 +0,0 @@ -/** - * Argon2 KDF from RFC 9106. Can be used to create a key from password and salt. - * We suggest to use Scrypt. JS Argon is 2-10x slower than native code because of 64-bitness: - * * argon uses uint64, but JS doesn't have fast uint64array - * * uint64 multiplication is 1/3 of time - * * `P` function would be very nice with u64, because most of value will be in registers, - * hovewer with u32 it will require 32 registers, which is too much. - * * JS arrays do slow bound checks, so reading from `A2_BUF` slows it down - * @module - */ -import { add3H, add3L, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL } from './_u64.ts'; -import { blake2b } from './blake2.ts'; -import { abytes, clean, kdfInputToBytes, nextTick, u32, u8, type KDFInput } from './utils.ts'; - -const AT = { Argond2d: 0, Argon2i: 1, Argon2id: 2 } as const; -type Types = (typeof AT)[keyof typeof AT]; - -const ARGON2_SYNC_POINTS = 4; -const abytesOrZero = (buf?: KDFInput) => { - if (buf === undefined) return Uint8Array.of(); - return kdfInputToBytes(buf); -}; - -// u32 * u32 = u64 -function mul(a: number, b: number) { - const aL = a & 0xffff; - const aH = a >>> 16; - const bL = b & 0xffff; - const bH = b >>> 16; - const ll = Math.imul(aL, bL); - const hl = Math.imul(aH, bL); - const lh = Math.imul(aL, bH); - const hh = Math.imul(aH, bH); - const carry = (ll >>> 16) + (hl & 0xffff) + lh; - const high = (hh + (hl >>> 16) + (carry >>> 16)) | 0; - const low = (carry << 16) | (ll & 0xffff); - return { h: high, l: low }; -} - -function mul2(a: number, b: number) { - // 2 * a * b (via shifts) - const { h, l } = mul(a, b); - return { h: ((h << 1) | (l >>> 31)) & 0xffff_ffff, l: (l << 1) & 0xffff_ffff }; -} - -// BlaMka permutation for Argon2 -// A + B + (2 * u32(A) * u32(B)) -function blamka(Ah: number, Al: number, Bh: number, Bl: number) { - const { h: Ch, l: Cl } = mul2(Al, Bl); - // A + B + (2 * A * B) - const Rll = add3L(Al, Bl, Cl); - return { h: add3H(Rll, Ah, Bh, Ch), l: Rll | 0 }; -} - -// Temporary block buffer -const A2_BUF = new Uint32Array(256); // 1024 bytes (matrix 16x16) - -function G(a: number, b: number, c: number, d: number) { - let Al = A2_BUF[2*a], Ah = A2_BUF[2*a + 1]; // prettier-ignore - let Bl = A2_BUF[2*b], Bh = A2_BUF[2*b + 1]; // prettier-ignore - let Cl = A2_BUF[2*c], Ch = A2_BUF[2*c + 1]; // prettier-ignore - let Dl = A2_BUF[2*d], Dh = A2_BUF[2*d + 1]; // prettier-ignore - - ({ h: Ah, l: Al } = blamka(Ah, Al, Bh, Bl)); - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: rotr32H(Dh, Dl), Dl: rotr32L(Dh, Dl) }); - - ({ h: Ch, l: Cl } = blamka(Ch, Cl, Dh, Dl)); - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: rotrSH(Bh, Bl, 24), Bl: rotrSL(Bh, Bl, 24) }); - - ({ h: Ah, l: Al } = blamka(Ah, Al, Bh, Bl)); - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: rotrSH(Dh, Dl, 16), Dl: rotrSL(Dh, Dl, 16) }); - - ({ h: Ch, l: Cl } = blamka(Ch, Cl, Dh, Dl)); - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: rotrBH(Bh, Bl, 63), Bl: rotrBL(Bh, Bl, 63) }); - - (A2_BUF[2 * a] = Al), (A2_BUF[2 * a + 1] = Ah); - (A2_BUF[2 * b] = Bl), (A2_BUF[2 * b + 1] = Bh); - (A2_BUF[2 * c] = Cl), (A2_BUF[2 * c + 1] = Ch); - (A2_BUF[2 * d] = Dl), (A2_BUF[2 * d + 1] = Dh); -} - -// prettier-ignore -function P( - v00: number, v01: number, v02: number, v03: number, v04: number, v05: number, v06: number, v07: number, - v08: number, v09: number, v10: number, v11: number, v12: number, v13: number, v14: number, v15: number, -) { - G(v00, v04, v08, v12); - G(v01, v05, v09, v13); - G(v02, v06, v10, v14); - G(v03, v07, v11, v15); - G(v00, v05, v10, v15); - G(v01, v06, v11, v12); - G(v02, v07, v08, v13); - G(v03, v04, v09, v14); -} - -function block(x: Uint32Array, xPos: number, yPos: number, outPos: number, needXor: boolean) { - for (let i = 0; i < 256; i++) A2_BUF[i] = x[xPos + i] ^ x[yPos + i]; - // columns (8) - for (let i = 0; i < 128; i += 16) { - // prettier-ignore - P( - i, i + 1, i + 2, i + 3, i + 4, i + 5, i + 6, i + 7, - i + 8, i + 9, i + 10, i + 11, i + 12, i + 13, i + 14, i + 15 - ); - } - // rows (8) - for (let i = 0; i < 16; i += 2) { - // prettier-ignore - P( - i, i + 1, i + 16, i + 17, i + 32, i + 33, i + 48, i + 49, - i + 64, i + 65, i + 80, i + 81, i + 96, i + 97, i + 112, i + 113 - ); - } - - if (needXor) for (let i = 0; i < 256; i++) x[outPos + i] ^= A2_BUF[i] ^ x[xPos + i] ^ x[yPos + i]; - else for (let i = 0; i < 256; i++) x[outPos + i] = A2_BUF[i] ^ x[xPos + i] ^ x[yPos + i]; - clean(A2_BUF); -} - -// Variable-Length Hash Function H' -function Hp(A: Uint32Array, dkLen: number) { - const A8 = u8(A); - const T = new Uint32Array(1); - const T8 = u8(T); - T[0] = dkLen; - // Fast path - if (dkLen <= 64) return blake2b.create({ dkLen }).update(T8).update(A8).digest(); - const out = new Uint8Array(dkLen); - let V = blake2b.create({}).update(T8).update(A8).digest(); - let pos = 0; - // First block - out.set(V.subarray(0, 32)); - pos += 32; - // Rest blocks - for (; dkLen - pos > 64; pos += 32) { - const Vh = blake2b.create({}).update(V); - Vh.digestInto(V); - Vh.destroy(); - out.set(V.subarray(0, 32), pos); - } - // Last block - out.set(blake2b(V, { dkLen: dkLen - pos }), pos); - clean(V, T); - return u32(out); -} - -// Used only inside process block! -function indexAlpha( - r: number, - s: number, - laneLen: number, - segmentLen: number, - index: number, - randL: number, - sameLane: boolean = false -) { - // This is ugly, but close enough to reference implementation. - let area: number; - if (r === 0) { - if (s === 0) area = index - 1; - else if (sameLane) area = s * segmentLen + index - 1; - else area = s * segmentLen + (index == 0 ? -1 : 0); - } else if (sameLane) area = laneLen - segmentLen + index - 1; - else area = laneLen - segmentLen + (index == 0 ? -1 : 0); - const startPos = r !== 0 && s !== ARGON2_SYNC_POINTS - 1 ? (s + 1) * segmentLen : 0; - const rel = area - 1 - mul(area, mul(randL, randL).h).h; - return (startPos + rel) % laneLen; -} - -/** - * Argon2 options. - * * t: time cost, m: mem cost in kb, p: parallelization. - * * key: optional key. personalization: arbitrary extra data. - * * dkLen: desired number of output bytes. - */ -export type ArgonOpts = { - t: number; // Time cost, iterations count - m: number; // Memory cost (in KB) - p: number; // Parallelization parameter - version?: number; // Default: 0x13 (19) - key?: KDFInput; // Optional key - personalization?: KDFInput; // Optional arbitrary extra data - dkLen?: number; // Desired number of returned bytes - asyncTick?: number; // Maximum time in ms for which async function can block execution - maxmem?: number; - onProgress?: (progress: number) => void; -}; - -const maxUint32 = Math.pow(2, 32); -function isU32(num: number) { - return Number.isSafeInteger(num) && num >= 0 && num < maxUint32; -} - -function argon2Opts(opts: ArgonOpts) { - const merged: any = { - version: 0x13, - dkLen: 32, - maxmem: maxUint32 - 1, - asyncTick: 10, - }; - for (let [k, v] of Object.entries(opts)) if (v != null) merged[k] = v; - - const { dkLen, p, m, t, version, onProgress } = merged; - if (!isU32(dkLen) || dkLen < 4) throw new Error('dkLen should be at least 4 bytes'); - if (!isU32(p) || p < 1 || p >= Math.pow(2, 24)) throw new Error('p should be 1 <= p < 2^24'); - if (!isU32(m)) throw new Error('m should be 0 <= m < 2^32'); - if (!isU32(t) || t < 1) throw new Error('t (iterations) should be 1 <= t < 2^32'); - if (onProgress !== undefined && typeof onProgress !== 'function') - throw new Error('progressCb should be function'); - /* - Memory size m MUST be an integer number of kibibytes from 8*p to 2^(32)-1. The actual number of blocks is m', which is m rounded down to the nearest multiple of 4*p. - */ - if (!isU32(m) || m < 8 * p) throw new Error('memory should be at least 8*p bytes'); - if (version !== 0x10 && version !== 0x13) throw new Error('unknown version=' + version); - return merged; -} - -function argon2Init(password: KDFInput, salt: KDFInput, type: Types, opts: ArgonOpts) { - password = kdfInputToBytes(password); - salt = kdfInputToBytes(salt); - abytes(password); - abytes(salt); - if (!isU32(password.length)) throw new Error('password should be less than 4 GB'); - if (!isU32(salt.length) || salt.length < 8) - throw new Error('salt should be at least 8 bytes and less than 4 GB'); - if (!Object.values(AT).includes(type)) throw new Error('invalid type'); - let { p, dkLen, m, t, version, key, personalization, maxmem, onProgress, asyncTick } = - argon2Opts(opts); - - // Validation - key = abytesOrZero(key); - personalization = abytesOrZero(personalization); - // H_0 = H^(64)(LE32(p) || LE32(T) || LE32(m) || LE32(t) || - // LE32(v) || LE32(y) || LE32(length(P)) || P || - // LE32(length(S)) || S || LE32(length(K)) || K || - // LE32(length(X)) || X) - const h = blake2b.create({}); - const BUF = new Uint32Array(1); - const BUF8 = u8(BUF); - for (let item of [p, dkLen, m, t, version, type]) { - BUF[0] = item; - h.update(BUF8); - } - for (let i of [password, salt, key, personalization]) { - BUF[0] = i.length; // BUF is u32 array, this is valid - h.update(BUF8).update(i); - } - const H0 = new Uint32Array(18); - const H0_8 = u8(H0); - h.digestInto(H0_8); - // 256 u32 = 1024 (BLOCK_SIZE), fills A2_BUF on processing - - // Params - const lanes = p; - // m' = 4 * p * floor (m / 4p) - const mP = 4 * p * Math.floor(m / (ARGON2_SYNC_POINTS * p)); - //q = m' / p columns - const laneLen = Math.floor(mP / p); - const segmentLen = Math.floor(laneLen / ARGON2_SYNC_POINTS); - const memUsed = mP * 256; - if (!isU32(maxmem) || memUsed > maxmem) - throw new Error( - 'mem should be less than 2**32, got: maxmem=' + maxmem + ', memused=' + memUsed - ); - const B = new Uint32Array(memUsed); - // Fill first blocks - for (let l = 0; l < p; l++) { - const i = 256 * laneLen * l; - // B[i][0] = H'^(1024)(H_0 || LE32(0) || LE32(i)) - H0[17] = l; - H0[16] = 0; - B.set(Hp(H0, 1024), i); - // B[i][1] = H'^(1024)(H_0 || LE32(1) || LE32(i)) - H0[16] = 1; - B.set(Hp(H0, 1024), i + 256); - } - let perBlock = () => {}; - if (onProgress) { - const totalBlock = t * ARGON2_SYNC_POINTS * p * segmentLen; - // Invoke callback if progress changes from 10.01 to 10.02 - // Allows to draw smooth progress bar on up to 8K screen - const callbackPer = Math.max(Math.floor(totalBlock / 10000), 1); - let blockCnt = 0; - perBlock = () => { - blockCnt++; - if (onProgress && (!(blockCnt % callbackPer) || blockCnt === totalBlock)) - onProgress(blockCnt / totalBlock); - }; - } - clean(BUF, H0); - return { type, mP, p, t, version, B, laneLen, lanes, segmentLen, dkLen, perBlock, asyncTick }; -} - -function argon2Output(B: Uint32Array, p: number, laneLen: number, dkLen: number) { - const B_final = new Uint32Array(256); - for (let l = 0; l < p; l++) - for (let j = 0; j < 256; j++) B_final[j] ^= B[256 * (laneLen * l + laneLen - 1) + j]; - const res = u8(Hp(B_final, dkLen)); - clean(B_final); - return res; -} - -function processBlock( - B: Uint32Array, - address: Uint32Array, - l: number, - r: number, - s: number, - index: number, - laneLen: number, - segmentLen: number, - lanes: number, - offset: number, - prev: number, - dataIndependent: boolean, - needXor: boolean -) { - if (offset % laneLen) prev = offset - 1; - let randL, randH; - if (dataIndependent) { - let i128 = index % 128; - if (i128 === 0) { - address[256 + 12]++; - block(address, 256, 2 * 256, 0, false); - block(address, 0, 2 * 256, 0, false); - } - randL = address[2 * i128]; - randH = address[2 * i128 + 1]; - } else { - const T = 256 * prev; - randL = B[T]; - randH = B[T + 1]; - } - // address block - const refLane = r === 0 && s === 0 ? l : randH % lanes; - const refPos = indexAlpha(r, s, laneLen, segmentLen, index, randL, refLane == l); - const refBlock = laneLen * refLane + refPos; - // B[i][j] = G(B[i][j-1], B[l][z]) - block(B, 256 * prev, 256 * refBlock, offset * 256, needXor); -} - -function argon2(type: Types, password: KDFInput, salt: KDFInput, opts: ArgonOpts) { - const { mP, p, t, version, B, laneLen, lanes, segmentLen, dkLen, perBlock } = argon2Init( - password, - salt, - type, - opts - ); - // Pre-loop setup - // [address, input, zero_block] format so we can pass single U32 to block function - const address = new Uint32Array(3 * 256); - address[256 + 6] = mP; - address[256 + 8] = t; - address[256 + 10] = type; - for (let r = 0; r < t; r++) { - const needXor = r !== 0 && version === 0x13; - address[256 + 0] = r; - for (let s = 0; s < ARGON2_SYNC_POINTS; s++) { - address[256 + 4] = s; - const dataIndependent = type == AT.Argon2i || (type == AT.Argon2id && r === 0 && s < 2); - for (let l = 0; l < p; l++) { - address[256 + 2] = l; - address[256 + 12] = 0; - let startPos = 0; - if (r === 0 && s === 0) { - startPos = 2; - if (dataIndependent) { - address[256 + 12]++; - block(address, 256, 2 * 256, 0, false); - block(address, 0, 2 * 256, 0, false); - } - } - // current block postion - let offset = l * laneLen + s * segmentLen + startPos; - // previous block position - let prev = offset % laneLen ? offset - 1 : offset + laneLen - 1; - for (let index = startPos; index < segmentLen; index++, offset++, prev++) { - perBlock(); - processBlock( - B, - address, - l, - r, - s, - index, - laneLen, - segmentLen, - lanes, - offset, - prev, - dataIndependent, - needXor - ); - } - } - } - } - clean(address); - return argon2Output(B, p, laneLen, dkLen); -} - -/** argon2d GPU-resistant version. */ -export const argon2d = (password: KDFInput, salt: KDFInput, opts: ArgonOpts): Uint8Array => - argon2(AT.Argond2d, password, salt, opts); -/** argon2i side-channel-resistant version. */ -export const argon2i = (password: KDFInput, salt: KDFInput, opts: ArgonOpts): Uint8Array => - argon2(AT.Argon2i, password, salt, opts); -/** argon2id, combining i+d, the most popular version from RFC 9106 */ -export const argon2id = (password: KDFInput, salt: KDFInput, opts: ArgonOpts): Uint8Array => - argon2(AT.Argon2id, password, salt, opts); - -async function argon2Async(type: Types, password: KDFInput, salt: KDFInput, opts: ArgonOpts) { - const { mP, p, t, version, B, laneLen, lanes, segmentLen, dkLen, perBlock, asyncTick } = - argon2Init(password, salt, type, opts); - // Pre-loop setup - // [address, input, zero_block] format so we can pass single U32 to block function - const address = new Uint32Array(3 * 256); - address[256 + 6] = mP; - address[256 + 8] = t; - address[256 + 10] = type; - let ts = Date.now(); - for (let r = 0; r < t; r++) { - const needXor = r !== 0 && version === 0x13; - address[256 + 0] = r; - for (let s = 0; s < ARGON2_SYNC_POINTS; s++) { - address[256 + 4] = s; - const dataIndependent = type == AT.Argon2i || (type == AT.Argon2id && r === 0 && s < 2); - for (let l = 0; l < p; l++) { - address[256 + 2] = l; - address[256 + 12] = 0; - let startPos = 0; - if (r === 0 && s === 0) { - startPos = 2; - if (dataIndependent) { - address[256 + 12]++; - block(address, 256, 2 * 256, 0, false); - block(address, 0, 2 * 256, 0, false); - } - } - // current block postion - let offset = l * laneLen + s * segmentLen + startPos; - // previous block position - let prev = offset % laneLen ? offset - 1 : offset + laneLen - 1; - for (let index = startPos; index < segmentLen; index++, offset++, prev++) { - perBlock(); - processBlock( - B, - address, - l, - r, - s, - index, - laneLen, - segmentLen, - lanes, - offset, - prev, - dataIndependent, - needXor - ); - // Date.now() is not monotonic, so in case if clock goes backwards we return return control too - const diff = Date.now() - ts; - if (!(diff >= 0 && diff < asyncTick)) { - await nextTick(); - ts += diff; - } - } - } - } - } - clean(address); - return argon2Output(B, p, laneLen, dkLen); -} - -/** argon2d async GPU-resistant version. */ -export const argon2dAsync = ( - password: KDFInput, - salt: KDFInput, - opts: ArgonOpts -): Promise => argon2Async(AT.Argond2d, password, salt, opts); -/** argon2i async side-channel-resistant version. */ -export const argon2iAsync = ( - password: KDFInput, - salt: KDFInput, - opts: ArgonOpts -): Promise => argon2Async(AT.Argon2i, password, salt, opts); -/** argon2id async, combining i+d, the most popular version from RFC 9106 */ -export const argon2idAsync = ( - password: KDFInput, - salt: KDFInput, - opts: ArgonOpts -): Promise => argon2Async(AT.Argon2id, password, salt, opts); diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/src/blake1.ts b/tools/mnemonic-test/node_modules/@noble/hashes/src/blake1.ts deleted file mode 100644 index d43ad268..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/src/blake1.ts +++ /dev/null @@ -1,534 +0,0 @@ -/** - * Blake1 legacy hash function, one of SHA3 proposals. - * Rarely used. Check out blake2 or blake3 instead. - * https://www.aumasson.jp/blake/blake.pdf - * - * In the best case, there are 0 allocations. - * - * Differences from blake2: - * - * - BE instead of LE - * - Paddings, similar to MD5, RIPEMD, SHA1, SHA2, but: - * - length flag is located before actual length - * - padding block is compressed differently (no lengths) - * Instead of msg[sigma[k]], we have `msg[sigma[k]] ^ constants[sigma[k-1]]` - * (-1 for g1, g2 without -1) - * - Salt is XOR-ed into constants instead of state - * - Salt is XOR-ed with output in `compress` - * - Additional rows (+64 bytes) in SIGMA for new rounds - * - Different round count: - * - 14 / 10 rounds in blake256 / blake2s - * - 16 / 12 rounds in blake512 / blake2b - * - blake512: G1b: rotr 24 -> 25, G2b: rotr 63 -> 11 - * @module - */ -import { BSIGMA, G1s, G2s } from './_blake.ts'; -import { setBigUint64, SHA224_IV, SHA256_IV, SHA384_IV, SHA512_IV } from './_md.ts'; -import * as u64 from './_u64.ts'; -// prettier-ignore -import { - abytes, aexists, aoutput, - clean, createOptHasher, - createView, Hash, toBytes, - type CHashO, type Input, -} from './utils.ts'; - -/** Blake1 options. Basically just "salt" */ -export type BlakeOpts = { - salt?: Uint8Array; -}; - -// Empty zero-filled salt -const EMPTY_SALT = /* @__PURE__ */ new Uint32Array(8); - -abstract class BLAKE1> extends Hash { - protected finished = false; - protected length = 0; - protected pos = 0; - protected destroyed = false; - // For partial updates less than block size - protected buffer: Uint8Array; - protected view: DataView; - protected salt: Uint32Array; - abstract compress(view: DataView, offset: number, withLength?: boolean): void; - protected abstract get(): number[]; - protected abstract set(...args: number[]): void; - - readonly blockLen: number; - readonly outputLen: number; - private lengthFlag: number; - private counterLen: number; - protected constants: Uint32Array; - - constructor( - blockLen: number, - outputLen: number, - lengthFlag: number, - counterLen: number, - saltLen: number, - constants: Uint32Array, - opts: BlakeOpts = {} - ) { - super(); - const { salt } = opts; - this.blockLen = blockLen; - this.outputLen = outputLen; - this.lengthFlag = lengthFlag; - this.counterLen = counterLen; - this.buffer = new Uint8Array(blockLen); - this.view = createView(this.buffer); - if (salt) { - let slt = salt; - slt = toBytes(slt); - abytes(slt); - if (slt.length !== 4 * saltLen) throw new Error('wrong salt length'); - const salt32 = (this.salt = new Uint32Array(saltLen)); - const sv = createView(slt); - this.constants = constants.slice(); - for (let i = 0, offset = 0; i < salt32.length; i++, offset += 4) { - salt32[i] = sv.getUint32(offset, false); - this.constants[i] ^= salt32[i]; - } - } else { - this.salt = EMPTY_SALT; - this.constants = constants; - } - } - update(data: Input): this { - aexists(this); - data = toBytes(data); - abytes(data); - // From _md, but update length before each compress - const { view, buffer, blockLen } = this; - const len = data.length; - let dataView; - for (let pos = 0; pos < len; ) { - const take = Math.min(blockLen - this.pos, len - pos); - // Fast path: we have at least one block in input, cast it to view and process - if (take === blockLen) { - if (!dataView) dataView = createView(data); - for (; blockLen <= len - pos; pos += blockLen) { - this.length += blockLen; - this.compress(dataView, pos); - } - continue; - } - buffer.set(data.subarray(pos, pos + take), this.pos); - this.pos += take; - pos += take; - if (this.pos === blockLen) { - this.length += blockLen; - this.compress(view, 0, true); - this.pos = 0; - } - } - return this; - } - destroy(): void { - this.destroyed = true; - if (this.salt !== EMPTY_SALT) { - clean(this.salt, this.constants); - } - } - _cloneInto(to?: T): T { - to ||= new (this.constructor as any)() as T; - to.set(...this.get()); - const { buffer, length, finished, destroyed, constants, salt, pos } = this; - to.buffer.set(buffer); - to.constants = constants.slice(); - to.destroyed = destroyed; - to.finished = finished; - to.length = length; - to.pos = pos; - to.salt = salt.slice(); - return to; - } - clone(): T { - return this._cloneInto(); - } - digestInto(out: Uint8Array): void { - aexists(this); - aoutput(out, this); - this.finished = true; - // Padding - const { buffer, blockLen, counterLen, lengthFlag, view } = this; - clean(buffer.subarray(this.pos)); // clean buf - const counter = BigInt((this.length + this.pos) * 8); - const counterPos = blockLen - counterLen - 1; - buffer[this.pos] |= 0b1000_0000; // End block flag - this.length += this.pos; // add unwritten length - // Not enough in buffer for length: write what we have. - if (this.pos > counterPos) { - this.compress(view, 0); - clean(buffer); - this.pos = 0; - } - // Difference with md: here we have lengthFlag! - buffer[counterPos] |= lengthFlag; // Length flag - // We always set 8 byte length flag. Because length will overflow significantly sooner. - setBigUint64(view, blockLen - 8, counter, false); - this.compress(view, 0, this.pos !== 0); // don't add length if length is not empty block? - // Write output - clean(buffer); - const v = createView(out); - const state = this.get(); - for (let i = 0; i < this.outputLen / 4; ++i) v.setUint32(i * 4, state[i]); - } - digest(): Uint8Array { - const { buffer, outputLen } = this; - this.digestInto(buffer); - const res = buffer.slice(0, outputLen); - this.destroy(); - return res; - } -} - -// Constants -const B64C = /* @__PURE__ */ Uint32Array.from([ - 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, - 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, - 0x9216d5d9, 0x8979fb1b, 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96, - 0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, 0x636920d8, 0x71574e69, -]); -// first half of C512 -const B32C = B64C.slice(0, 16); - -const B256_IV = SHA256_IV.slice(); -const B224_IV = SHA224_IV.slice(); -const B384_IV = SHA384_IV.slice(); -const B512_IV = SHA512_IV.slice(); - -function generateTBL256() { - const TBL = []; - for (let i = 0, j = 0; i < 14; i++, j += 16) { - for (let offset = 1; offset < 16; offset += 2) { - TBL.push(B32C[BSIGMA[j + offset]]); - TBL.push(B32C[BSIGMA[j + offset - 1]]); - } - } - return new Uint32Array(TBL); -} -const TBL256 = /* @__PURE__ */ generateTBL256(); // C256[SIGMA[X]] precompute - -// Reusable temporary buffer -const BLAKE256_W = /* @__PURE__ */ new Uint32Array(16); - -class Blake1_32 extends BLAKE1 { - private v0: number; - private v1: number; - private v2: number; - private v3: number; - private v4: number; - private v5: number; - private v6: number; - private v7: number; - constructor(outputLen: number, IV: Uint32Array, lengthFlag: number, opts: BlakeOpts = {}) { - super(64, outputLen, lengthFlag, 8, 4, B32C, opts); - this.v0 = IV[0] | 0; - this.v1 = IV[1] | 0; - this.v2 = IV[2] | 0; - this.v3 = IV[3] | 0; - this.v4 = IV[4] | 0; - this.v5 = IV[5] | 0; - this.v6 = IV[6] | 0; - this.v7 = IV[7] | 0; - } - protected get(): [number, number, number, number, number, number, number, number] { - const { v0, v1, v2, v3, v4, v5, v6, v7 } = this; - return [v0, v1, v2, v3, v4, v5, v6, v7]; - } - // prettier-ignore - protected set( - v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number - ): void { - this.v0 = v0 | 0; - this.v1 = v1 | 0; - this.v2 = v2 | 0; - this.v3 = v3 | 0; - this.v4 = v4 | 0; - this.v5 = v5 | 0; - this.v6 = v6 | 0; - this.v7 = v7 | 0; - } - destroy(): void { - super.destroy(); - this.set(0, 0, 0, 0, 0, 0, 0, 0); - } - compress(view: DataView, offset: number, withLength = true): void { - for (let i = 0; i < 16; i++, offset += 4) BLAKE256_W[i] = view.getUint32(offset, false); - // NOTE: we cannot re-use compress from blake2s, since there is additional xor over u256[SIGMA[e]] - let v00 = this.v0 | 0; - let v01 = this.v1 | 0; - let v02 = this.v2 | 0; - let v03 = this.v3 | 0; - let v04 = this.v4 | 0; - let v05 = this.v5 | 0; - let v06 = this.v6 | 0; - let v07 = this.v7 | 0; - let v08 = this.constants[0] | 0; - let v09 = this.constants[1] | 0; - let v10 = this.constants[2] | 0; - let v11 = this.constants[3] | 0; - const { h, l } = u64.fromBig(BigInt(withLength ? this.length * 8 : 0)); - let v12 = (this.constants[4] ^ l) >>> 0; - let v13 = (this.constants[5] ^ l) >>> 0; - let v14 = (this.constants[6] ^ h) >>> 0; - let v15 = (this.constants[7] ^ h) >>> 0; - // prettier-ignore - for (let i = 0, k = 0, j = 0; i < 14; i++) { - ({ a: v00, b: v04, c: v08, d: v12 } = G1s(v00, v04, v08, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v00, b: v04, c: v08, d: v12 } = G2s(v00, v04, v08, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v01, b: v05, c: v09, d: v13 } = G1s(v01, v05, v09, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v01, b: v05, c: v09, d: v13 } = G2s(v01, v05, v09, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v02, b: v06, c: v10, d: v14 } = G1s(v02, v06, v10, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v02, b: v06, c: v10, d: v14 } = G2s(v02, v06, v10, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v03, b: v07, c: v11, d: v15 } = G1s(v03, v07, v11, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v03, b: v07, c: v11, d: v15 } = G2s(v03, v07, v11, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v00, b: v05, c: v10, d: v15 } = G1s(v00, v05, v10, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v00, b: v05, c: v10, d: v15 } = G2s(v00, v05, v10, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v01, b: v06, c: v11, d: v12 } = G1s(v01, v06, v11, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v01, b: v06, c: v11, d: v12 } = G2s(v01, v06, v11, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v02, b: v07, c: v08, d: v13 } = G1s(v02, v07, v08, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v02, b: v07, c: v08, d: v13 } = G2s(v02, v07, v08, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v03, b: v04, c: v09, d: v14 } = G1s(v03, v04, v09, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v03, b: v04, c: v09, d: v14 } = G2s(v03, v04, v09, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - } - this.v0 = (this.v0 ^ v00 ^ v08 ^ this.salt[0]) >>> 0; - this.v1 = (this.v1 ^ v01 ^ v09 ^ this.salt[1]) >>> 0; - this.v2 = (this.v2 ^ v02 ^ v10 ^ this.salt[2]) >>> 0; - this.v3 = (this.v3 ^ v03 ^ v11 ^ this.salt[3]) >>> 0; - this.v4 = (this.v4 ^ v04 ^ v12 ^ this.salt[0]) >>> 0; - this.v5 = (this.v5 ^ v05 ^ v13 ^ this.salt[1]) >>> 0; - this.v6 = (this.v6 ^ v06 ^ v14 ^ this.salt[2]) >>> 0; - this.v7 = (this.v7 ^ v07 ^ v15 ^ this.salt[3]) >>> 0; - clean(BLAKE256_W); - } -} - -const BBUF = /* @__PURE__ */ new Uint32Array(32); -const BLAKE512_W = /* @__PURE__ */ new Uint32Array(32); - -function generateTBL512() { - const TBL = []; - for (let r = 0, k = 0; r < 16; r++, k += 16) { - for (let offset = 1; offset < 16; offset += 2) { - TBL.push(B64C[BSIGMA[k + offset] * 2 + 0]); - TBL.push(B64C[BSIGMA[k + offset] * 2 + 1]); - TBL.push(B64C[BSIGMA[k + offset - 1] * 2 + 0]); - TBL.push(B64C[BSIGMA[k + offset - 1] * 2 + 1]); - } - } - return new Uint32Array(TBL); -} -const TBL512 = /* @__PURE__ */ generateTBL512(); // C512[SIGMA[X]] precompute - -// Mixing function G splitted in two halfs -function G1b(a: number, b: number, c: number, d: number, msg: Uint32Array, k: number) { - const Xpos = 2 * BSIGMA[k]; - const Xl = msg[Xpos + 1] ^ TBL512[k * 2 + 1], Xh = msg[Xpos] ^ TBL512[k * 2]; // prettier-ignore - let Al = BBUF[2 * a + 1], Ah = BBUF[2 * a]; // prettier-ignore - let Bl = BBUF[2 * b + 1], Bh = BBUF[2 * b]; // prettier-ignore - let Cl = BBUF[2 * c + 1], Ch = BBUF[2 * c]; // prettier-ignore - let Dl = BBUF[2 * d + 1], Dh = BBUF[2 * d]; // prettier-ignore - // v[a] = (v[a] + v[b] + x) | 0; - let ll = u64.add3L(Al, Bl, Xl); - Ah = u64.add3H(ll, Ah, Bh, Xh) >>> 0; - Al = (ll | 0) >>> 0; - // v[d] = rotr(v[d] ^ v[a], 32) - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: u64.rotr32H(Dh, Dl), Dl: u64.rotr32L(Dh, Dl) }); - // v[c] = (v[c] + v[d]) | 0; - ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); - // v[b] = rotr(v[b] ^ v[c], 25) - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: u64.rotrSH(Bh, Bl, 25), Bl: u64.rotrSL(Bh, Bl, 25) }); - (BBUF[2 * a + 1] = Al), (BBUF[2 * a] = Ah); - (BBUF[2 * b + 1] = Bl), (BBUF[2 * b] = Bh); - (BBUF[2 * c + 1] = Cl), (BBUF[2 * c] = Ch); - (BBUF[2 * d + 1] = Dl), (BBUF[2 * d] = Dh); -} - -function G2b(a: number, b: number, c: number, d: number, msg: Uint32Array, k: number) { - const Xpos = 2 * BSIGMA[k]; - const Xl = msg[Xpos + 1] ^ TBL512[k * 2 + 1], Xh = msg[Xpos] ^ TBL512[k * 2]; // prettier-ignore - let Al = BBUF[2 * a + 1], Ah = BBUF[2 * a]; // prettier-ignore - let Bl = BBUF[2 * b + 1], Bh = BBUF[2 * b]; // prettier-ignore - let Cl = BBUF[2 * c + 1], Ch = BBUF[2 * c]; // prettier-ignore - let Dl = BBUF[2 * d + 1], Dh = BBUF[2 * d]; // prettier-ignore - // v[a] = (v[a] + v[b] + x) | 0; - let ll = u64.add3L(Al, Bl, Xl); - Ah = u64.add3H(ll, Ah, Bh, Xh); - Al = ll | 0; - // v[d] = rotr(v[d] ^ v[a], 16) - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: u64.rotrSH(Dh, Dl, 16), Dl: u64.rotrSL(Dh, Dl, 16) }); - // v[c] = (v[c] + v[d]) | 0; - ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); - // v[b] = rotr(v[b] ^ v[c], 11) - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: u64.rotrSH(Bh, Bl, 11), Bl: u64.rotrSL(Bh, Bl, 11) }); - (BBUF[2 * a + 1] = Al), (BBUF[2 * a] = Ah); - (BBUF[2 * b + 1] = Bl), (BBUF[2 * b] = Bh); - (BBUF[2 * c + 1] = Cl), (BBUF[2 * c] = Ch); - (BBUF[2 * d + 1] = Dl), (BBUF[2 * d] = Dh); -} - -class Blake1_64 extends BLAKE1 { - private v0l: number; - private v0h: number; - private v1l: number; - private v1h: number; - private v2l: number; - private v2h: number; - private v3l: number; - private v3h: number; - private v4l: number; - private v4h: number; - private v5l: number; - private v5h: number; - private v6l: number; - private v6h: number; - private v7l: number; - private v7h: number; - constructor(outputLen: number, IV: Uint32Array, lengthFlag: number, opts: BlakeOpts = {}) { - super(128, outputLen, lengthFlag, 16, 8, B64C, opts); - this.v0l = IV[0] | 0; - this.v0h = IV[1] | 0; - this.v1l = IV[2] | 0; - this.v1h = IV[3] | 0; - this.v2l = IV[4] | 0; - this.v2h = IV[5] | 0; - this.v3l = IV[6] | 0; - this.v3h = IV[7] | 0; - this.v4l = IV[8] | 0; - this.v4h = IV[9] | 0; - this.v5l = IV[10] | 0; - this.v5h = IV[11] | 0; - this.v6l = IV[12] | 0; - this.v6h = IV[13] | 0; - this.v7l = IV[14] | 0; - this.v7h = IV[15] | 0; - } - // prettier-ignore - protected get(): [ - number, number, number, number, number, number, number, number, - number, number, number, number, number, number, number, number - ] { - let { v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h } = this; - return [v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h]; - } - // prettier-ignore - protected set( - v0l: number, v0h: number, v1l: number, v1h: number, - v2l: number, v2h: number, v3l: number, v3h: number, - v4l: number, v4h: number, v5l: number, v5h: number, - v6l: number, v6h: number, v7l: number, v7h: number - ): void { - this.v0l = v0l | 0; - this.v0h = v0h | 0; - this.v1l = v1l | 0; - this.v1h = v1h | 0; - this.v2l = v2l | 0; - this.v2h = v2h | 0; - this.v3l = v3l | 0; - this.v3h = v3h | 0; - this.v4l = v4l | 0; - this.v4h = v4h | 0; - this.v5l = v5l | 0; - this.v5h = v5h | 0; - this.v6l = v6l | 0; - this.v6h = v6h | 0; - this.v7l = v7l | 0; - this.v7h = v7h | 0; - } - destroy(): void { - super.destroy(); - this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - } - compress(view: DataView, offset: number, withLength = true): void { - for (let i = 0; i < 32; i++, offset += 4) BLAKE512_W[i] = view.getUint32(offset, false); - - this.get().forEach((v, i) => (BBUF[i] = v)); // First half from state. - BBUF.set(this.constants.subarray(0, 16), 16); - if (withLength) { - const { h, l } = u64.fromBig(BigInt(this.length * 8)); - BBUF[24] = (BBUF[24] ^ h) >>> 0; - BBUF[25] = (BBUF[25] ^ l) >>> 0; - BBUF[26] = (BBUF[26] ^ h) >>> 0; - BBUF[27] = (BBUF[27] ^ l) >>> 0; - } - for (let i = 0, k = 0; i < 16; i++) { - G1b(0, 4, 8, 12, BLAKE512_W, k++); - G2b(0, 4, 8, 12, BLAKE512_W, k++); - G1b(1, 5, 9, 13, BLAKE512_W, k++); - G2b(1, 5, 9, 13, BLAKE512_W, k++); - G1b(2, 6, 10, 14, BLAKE512_W, k++); - G2b(2, 6, 10, 14, BLAKE512_W, k++); - G1b(3, 7, 11, 15, BLAKE512_W, k++); - G2b(3, 7, 11, 15, BLAKE512_W, k++); - - G1b(0, 5, 10, 15, BLAKE512_W, k++); - G2b(0, 5, 10, 15, BLAKE512_W, k++); - G1b(1, 6, 11, 12, BLAKE512_W, k++); - G2b(1, 6, 11, 12, BLAKE512_W, k++); - G1b(2, 7, 8, 13, BLAKE512_W, k++); - G2b(2, 7, 8, 13, BLAKE512_W, k++); - G1b(3, 4, 9, 14, BLAKE512_W, k++); - G2b(3, 4, 9, 14, BLAKE512_W, k++); - } - this.v0l ^= BBUF[0] ^ BBUF[16] ^ this.salt[0]; - this.v0h ^= BBUF[1] ^ BBUF[17] ^ this.salt[1]; - this.v1l ^= BBUF[2] ^ BBUF[18] ^ this.salt[2]; - this.v1h ^= BBUF[3] ^ BBUF[19] ^ this.salt[3]; - this.v2l ^= BBUF[4] ^ BBUF[20] ^ this.salt[4]; - this.v2h ^= BBUF[5] ^ BBUF[21] ^ this.salt[5]; - this.v3l ^= BBUF[6] ^ BBUF[22] ^ this.salt[6]; - this.v3h ^= BBUF[7] ^ BBUF[23] ^ this.salt[7]; - this.v4l ^= BBUF[8] ^ BBUF[24] ^ this.salt[0]; - this.v4h ^= BBUF[9] ^ BBUF[25] ^ this.salt[1]; - this.v5l ^= BBUF[10] ^ BBUF[26] ^ this.salt[2]; - this.v5h ^= BBUF[11] ^ BBUF[27] ^ this.salt[3]; - this.v6l ^= BBUF[12] ^ BBUF[28] ^ this.salt[4]; - this.v6h ^= BBUF[13] ^ BBUF[29] ^ this.salt[5]; - this.v7l ^= BBUF[14] ^ BBUF[30] ^ this.salt[6]; - this.v7h ^= BBUF[15] ^ BBUF[31] ^ this.salt[7]; - clean(BBUF, BLAKE512_W); - } -} - -export class BLAKE224 extends Blake1_32 { - constructor(opts: BlakeOpts = {}) { - super(28, B224_IV, 0b0000_0000, opts); - } -} -export class BLAKE256 extends Blake1_32 { - constructor(opts: BlakeOpts = {}) { - super(32, B256_IV, 0b0000_0001, opts); - } -} -export class BLAKE384 extends Blake1_64 { - constructor(opts: BlakeOpts = {}) { - super(48, B384_IV, 0b0000_0000, opts); - } -} -export class BLAKE512 extends Blake1_64 { - constructor(opts: BlakeOpts = {}) { - super(64, B512_IV, 0b0000_0001, opts); - } -} -/** blake1-224 hash function */ -export const blake224: CHashO = /* @__PURE__ */ createOptHasher( - (opts) => new BLAKE224(opts) -); -/** blake1-256 hash function */ -export const blake256: CHashO = /* @__PURE__ */ createOptHasher( - (opts) => new BLAKE256(opts) -); -/** blake1-384 hash function */ -export const blake384: CHashO = /* @__PURE__ */ createOptHasher( - (opts) => new BLAKE384(opts) -); -/** blake1-512 hash function */ -export const blake512: CHashO = /* @__PURE__ */ createOptHasher( - (opts) => new BLAKE512(opts) -); diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/src/blake2.ts b/tools/mnemonic-test/node_modules/@noble/hashes/src/blake2.ts deleted file mode 100644 index 3f8509fa..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/src/blake2.ts +++ /dev/null @@ -1,486 +0,0 @@ -/** - * blake2b (64-bit) & blake2s (8 to 32-bit) hash functions. - * b could have been faster, but there is no fast u64 in js, so s is 1.5x faster. - * @module - */ -import { BSIGMA, G1s, G2s } from './_blake.ts'; -import { SHA256_IV } from './_md.ts'; -import * as u64 from './_u64.ts'; -// prettier-ignore -import { - abytes, aexists, anumber, aoutput, - clean, createOptHasher, Hash, swap32IfBE, swap8IfBE, toBytes, u32, - type CHashO, type Input -} from './utils.ts'; - -/** Blake hash options. dkLen is output length. key is used in MAC mode. salt is used in KDF mode. */ -export type Blake2Opts = { - dkLen?: number; - key?: Input; - salt?: Input; - personalization?: Input; -}; - -// Same as SHA512_IV, but swapped endianness: LE instead of BE. iv[1] is iv[0], etc. -const B2B_IV = /* @__PURE__ */ Uint32Array.from([ - 0xf3bcc908, 0x6a09e667, 0x84caa73b, 0xbb67ae85, 0xfe94f82b, 0x3c6ef372, 0x5f1d36f1, 0xa54ff53a, - 0xade682d1, 0x510e527f, 0x2b3e6c1f, 0x9b05688c, 0xfb41bd6b, 0x1f83d9ab, 0x137e2179, 0x5be0cd19, -]); -// Temporary buffer -const BBUF = /* @__PURE__ */ new Uint32Array(32); - -// Mixing function G splitted in two halfs -function G1b(a: number, b: number, c: number, d: number, msg: Uint32Array, x: number) { - // NOTE: V is LE here - const Xl = msg[x], Xh = msg[x + 1]; // prettier-ignore - let Al = BBUF[2 * a], Ah = BBUF[2 * a + 1]; // prettier-ignore - let Bl = BBUF[2 * b], Bh = BBUF[2 * b + 1]; // prettier-ignore - let Cl = BBUF[2 * c], Ch = BBUF[2 * c + 1]; // prettier-ignore - let Dl = BBUF[2 * d], Dh = BBUF[2 * d + 1]; // prettier-ignore - // v[a] = (v[a] + v[b] + x) | 0; - let ll = u64.add3L(Al, Bl, Xl); - Ah = u64.add3H(ll, Ah, Bh, Xh); - Al = ll | 0; - // v[d] = rotr(v[d] ^ v[a], 32) - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: u64.rotr32H(Dh, Dl), Dl: u64.rotr32L(Dh, Dl) }); - // v[c] = (v[c] + v[d]) | 0; - ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); - // v[b] = rotr(v[b] ^ v[c], 24) - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: u64.rotrSH(Bh, Bl, 24), Bl: u64.rotrSL(Bh, Bl, 24) }); - (BBUF[2 * a] = Al), (BBUF[2 * a + 1] = Ah); - (BBUF[2 * b] = Bl), (BBUF[2 * b + 1] = Bh); - (BBUF[2 * c] = Cl), (BBUF[2 * c + 1] = Ch); - (BBUF[2 * d] = Dl), (BBUF[2 * d + 1] = Dh); -} - -function G2b(a: number, b: number, c: number, d: number, msg: Uint32Array, x: number) { - // NOTE: V is LE here - const Xl = msg[x], Xh = msg[x + 1]; // prettier-ignore - let Al = BBUF[2 * a], Ah = BBUF[2 * a + 1]; // prettier-ignore - let Bl = BBUF[2 * b], Bh = BBUF[2 * b + 1]; // prettier-ignore - let Cl = BBUF[2 * c], Ch = BBUF[2 * c + 1]; // prettier-ignore - let Dl = BBUF[2 * d], Dh = BBUF[2 * d + 1]; // prettier-ignore - // v[a] = (v[a] + v[b] + x) | 0; - let ll = u64.add3L(Al, Bl, Xl); - Ah = u64.add3H(ll, Ah, Bh, Xh); - Al = ll | 0; - // v[d] = rotr(v[d] ^ v[a], 16) - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: u64.rotrSH(Dh, Dl, 16), Dl: u64.rotrSL(Dh, Dl, 16) }); - // v[c] = (v[c] + v[d]) | 0; - ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); - // v[b] = rotr(v[b] ^ v[c], 63) - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: u64.rotrBH(Bh, Bl, 63), Bl: u64.rotrBL(Bh, Bl, 63) }); - (BBUF[2 * a] = Al), (BBUF[2 * a + 1] = Ah); - (BBUF[2 * b] = Bl), (BBUF[2 * b + 1] = Bh); - (BBUF[2 * c] = Cl), (BBUF[2 * c + 1] = Ch); - (BBUF[2 * d] = Dl), (BBUF[2 * d + 1] = Dh); -} - -function checkBlake2Opts( - outputLen: number, - opts: Blake2Opts | undefined = {}, - keyLen: number, - saltLen: number, - persLen: number -) { - anumber(keyLen); - if (outputLen < 0 || outputLen > keyLen) throw new Error('outputLen bigger than keyLen'); - const { key, salt, personalization } = opts; - if (key !== undefined && (key.length < 1 || key.length > keyLen)) - throw new Error('key length must be undefined or 1..' + keyLen); - if (salt !== undefined && salt.length !== saltLen) - throw new Error('salt must be undefined or ' + saltLen); - if (personalization !== undefined && personalization.length !== persLen) - throw new Error('personalization must be undefined or ' + persLen); -} - -/** Class, from which others are subclassed. */ -export abstract class BLAKE2> extends Hash { - protected abstract compress(msg: Uint32Array, offset: number, isLast: boolean): void; - protected abstract get(): number[]; - protected abstract set(...args: number[]): void; - abstract destroy(): void; - protected buffer: Uint8Array; - protected buffer32: Uint32Array; - protected finished = false; - protected destroyed = false; - protected length: number = 0; - protected pos: number = 0; - readonly blockLen: number; - readonly outputLen: number; - - constructor(blockLen: number, outputLen: number) { - super(); - anumber(blockLen); - anumber(outputLen); - this.blockLen = blockLen; - this.outputLen = outputLen; - this.buffer = new Uint8Array(blockLen); - this.buffer32 = u32(this.buffer); - } - update(data: Input): this { - aexists(this); - data = toBytes(data); - abytes(data); - // Main difference with other hashes: there is flag for last block, - // so we cannot process current block before we know that there - // is the next one. This significantly complicates logic and reduces ability - // to do zero-copy processing - const { blockLen, buffer, buffer32 } = this; - const len = data.length; - const offset = data.byteOffset; - const buf = data.buffer; - for (let pos = 0; pos < len; ) { - // If buffer is full and we still have input (don't process last block, same as blake2s) - if (this.pos === blockLen) { - swap32IfBE(buffer32); - this.compress(buffer32, 0, false); - swap32IfBE(buffer32); - this.pos = 0; - } - const take = Math.min(blockLen - this.pos, len - pos); - const dataOffset = offset + pos; - // full block && aligned to 4 bytes && not last in input - if (take === blockLen && !(dataOffset % 4) && pos + take < len) { - const data32 = new Uint32Array(buf, dataOffset, Math.floor((len - pos) / 4)); - swap32IfBE(data32); - for (let pos32 = 0; pos + blockLen < len; pos32 += buffer32.length, pos += blockLen) { - this.length += blockLen; - this.compress(data32, pos32, false); - } - swap32IfBE(data32); - continue; - } - buffer.set(data.subarray(pos, pos + take), this.pos); - this.pos += take; - this.length += take; - pos += take; - } - return this; - } - digestInto(out: Uint8Array): void { - aexists(this); - aoutput(out, this); - const { pos, buffer32 } = this; - this.finished = true; - // Padding - clean(this.buffer.subarray(pos)); - swap32IfBE(buffer32); - this.compress(buffer32, 0, true); - swap32IfBE(buffer32); - const out32 = u32(out); - this.get().forEach((v, i) => (out32[i] = swap8IfBE(v))); - } - digest(): Uint8Array { - const { buffer, outputLen } = this; - this.digestInto(buffer); - const res = buffer.slice(0, outputLen); - this.destroy(); - return res; - } - _cloneInto(to?: T): T { - const { buffer, length, finished, destroyed, outputLen, pos } = this; - to ||= new (this.constructor as any)({ dkLen: outputLen }) as T; - to.set(...this.get()); - to.buffer.set(buffer); - to.destroyed = destroyed; - to.finished = finished; - to.length = length; - to.pos = pos; - // @ts-ignore - to.outputLen = outputLen; - return to; - } - clone(): T { - return this._cloneInto(); - } -} - -export class BLAKE2b extends BLAKE2 { - // Same as SHA-512, but LE - private v0l = B2B_IV[0] | 0; - private v0h = B2B_IV[1] | 0; - private v1l = B2B_IV[2] | 0; - private v1h = B2B_IV[3] | 0; - private v2l = B2B_IV[4] | 0; - private v2h = B2B_IV[5] | 0; - private v3l = B2B_IV[6] | 0; - private v3h = B2B_IV[7] | 0; - private v4l = B2B_IV[8] | 0; - private v4h = B2B_IV[9] | 0; - private v5l = B2B_IV[10] | 0; - private v5h = B2B_IV[11] | 0; - private v6l = B2B_IV[12] | 0; - private v6h = B2B_IV[13] | 0; - private v7l = B2B_IV[14] | 0; - private v7h = B2B_IV[15] | 0; - - constructor(opts: Blake2Opts = {}) { - const olen = opts.dkLen === undefined ? 64 : opts.dkLen; - super(128, olen); - checkBlake2Opts(olen, opts, 64, 16, 16); - let { key, personalization, salt } = opts; - let keyLength = 0; - if (key !== undefined) { - key = toBytes(key); - keyLength = key.length; - } - this.v0l ^= this.outputLen | (keyLength << 8) | (0x01 << 16) | (0x01 << 24); - if (salt !== undefined) { - salt = toBytes(salt); - const slt = u32(salt); - this.v4l ^= swap8IfBE(slt[0]); - this.v4h ^= swap8IfBE(slt[1]); - this.v5l ^= swap8IfBE(slt[2]); - this.v5h ^= swap8IfBE(slt[3]); - } - if (personalization !== undefined) { - personalization = toBytes(personalization); - const pers = u32(personalization); - this.v6l ^= swap8IfBE(pers[0]); - this.v6h ^= swap8IfBE(pers[1]); - this.v7l ^= swap8IfBE(pers[2]); - this.v7h ^= swap8IfBE(pers[3]); - } - if (key !== undefined) { - // Pad to blockLen and update - const tmp = new Uint8Array(this.blockLen); - tmp.set(key); - this.update(tmp); - } - } - // prettier-ignore - protected get(): [ - number, number, number, number, number, number, number, number, - number, number, number, number, number, number, number, number - ] { - let { v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h } = this; - return [v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h]; - } - // prettier-ignore - protected set( - v0l: number, v0h: number, v1l: number, v1h: number, - v2l: number, v2h: number, v3l: number, v3h: number, - v4l: number, v4h: number, v5l: number, v5h: number, - v6l: number, v6h: number, v7l: number, v7h: number - ): void { - this.v0l = v0l | 0; - this.v0h = v0h | 0; - this.v1l = v1l | 0; - this.v1h = v1h | 0; - this.v2l = v2l | 0; - this.v2h = v2h | 0; - this.v3l = v3l | 0; - this.v3h = v3h | 0; - this.v4l = v4l | 0; - this.v4h = v4h | 0; - this.v5l = v5l | 0; - this.v5h = v5h | 0; - this.v6l = v6l | 0; - this.v6h = v6h | 0; - this.v7l = v7l | 0; - this.v7h = v7h | 0; - } - protected compress(msg: Uint32Array, offset: number, isLast: boolean): void { - this.get().forEach((v, i) => (BBUF[i] = v)); // First half from state. - BBUF.set(B2B_IV, 16); // Second half from IV. - let { h, l } = u64.fromBig(BigInt(this.length)); - BBUF[24] = B2B_IV[8] ^ l; // Low word of the offset. - BBUF[25] = B2B_IV[9] ^ h; // High word. - // Invert all bits for last block - if (isLast) { - BBUF[28] = ~BBUF[28]; - BBUF[29] = ~BBUF[29]; - } - let j = 0; - const s = BSIGMA; - for (let i = 0; i < 12; i++) { - G1b(0, 4, 8, 12, msg, offset + 2 * s[j++]); - G2b(0, 4, 8, 12, msg, offset + 2 * s[j++]); - G1b(1, 5, 9, 13, msg, offset + 2 * s[j++]); - G2b(1, 5, 9, 13, msg, offset + 2 * s[j++]); - G1b(2, 6, 10, 14, msg, offset + 2 * s[j++]); - G2b(2, 6, 10, 14, msg, offset + 2 * s[j++]); - G1b(3, 7, 11, 15, msg, offset + 2 * s[j++]); - G2b(3, 7, 11, 15, msg, offset + 2 * s[j++]); - - G1b(0, 5, 10, 15, msg, offset + 2 * s[j++]); - G2b(0, 5, 10, 15, msg, offset + 2 * s[j++]); - G1b(1, 6, 11, 12, msg, offset + 2 * s[j++]); - G2b(1, 6, 11, 12, msg, offset + 2 * s[j++]); - G1b(2, 7, 8, 13, msg, offset + 2 * s[j++]); - G2b(2, 7, 8, 13, msg, offset + 2 * s[j++]); - G1b(3, 4, 9, 14, msg, offset + 2 * s[j++]); - G2b(3, 4, 9, 14, msg, offset + 2 * s[j++]); - } - this.v0l ^= BBUF[0] ^ BBUF[16]; - this.v0h ^= BBUF[1] ^ BBUF[17]; - this.v1l ^= BBUF[2] ^ BBUF[18]; - this.v1h ^= BBUF[3] ^ BBUF[19]; - this.v2l ^= BBUF[4] ^ BBUF[20]; - this.v2h ^= BBUF[5] ^ BBUF[21]; - this.v3l ^= BBUF[6] ^ BBUF[22]; - this.v3h ^= BBUF[7] ^ BBUF[23]; - this.v4l ^= BBUF[8] ^ BBUF[24]; - this.v4h ^= BBUF[9] ^ BBUF[25]; - this.v5l ^= BBUF[10] ^ BBUF[26]; - this.v5h ^= BBUF[11] ^ BBUF[27]; - this.v6l ^= BBUF[12] ^ BBUF[28]; - this.v6h ^= BBUF[13] ^ BBUF[29]; - this.v7l ^= BBUF[14] ^ BBUF[30]; - this.v7h ^= BBUF[15] ^ BBUF[31]; - clean(BBUF); - } - destroy(): void { - this.destroyed = true; - clean(this.buffer32); - this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - } -} - -/** - * Blake2b hash function. 64-bit. 1.5x slower than blake2s in JS. - * @param msg - message that would be hashed - * @param opts - dkLen output length, key for MAC mode, salt, personalization - */ -export const blake2b: CHashO = /* @__PURE__ */ createOptHasher( - (opts) => new BLAKE2b(opts) -); - -// ================= -// Blake2S -// ================= - -// prettier-ignore -export type Num16 = { - v0: number; v1: number; v2: number; v3: number; - v4: number; v5: number; v6: number; v7: number; - v8: number; v9: number; v10: number; v11: number; - v12: number; v13: number; v14: number; v15: number; -}; - -// prettier-ignore -export function compress(s: Uint8Array, offset: number, msg: Uint32Array, rounds: number, - v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, - v8: number, v9: number, v10: number, v11: number, v12: number, v13: number, v14: number, v15: number, -): Num16 { - let j = 0; - for (let i = 0; i < rounds; i++) { - ({ a: v0, b: v4, c: v8, d: v12 } = G1s(v0, v4, v8, v12, msg[offset + s[j++]])); - ({ a: v0, b: v4, c: v8, d: v12 } = G2s(v0, v4, v8, v12, msg[offset + s[j++]])); - ({ a: v1, b: v5, c: v9, d: v13 } = G1s(v1, v5, v9, v13, msg[offset + s[j++]])); - ({ a: v1, b: v5, c: v9, d: v13 } = G2s(v1, v5, v9, v13, msg[offset + s[j++]])); - ({ a: v2, b: v6, c: v10, d: v14 } = G1s(v2, v6, v10, v14, msg[offset + s[j++]])); - ({ a: v2, b: v6, c: v10, d: v14 } = G2s(v2, v6, v10, v14, msg[offset + s[j++]])); - ({ a: v3, b: v7, c: v11, d: v15 } = G1s(v3, v7, v11, v15, msg[offset + s[j++]])); - ({ a: v3, b: v7, c: v11, d: v15 } = G2s(v3, v7, v11, v15, msg[offset + s[j++]])); - - ({ a: v0, b: v5, c: v10, d: v15 } = G1s(v0, v5, v10, v15, msg[offset + s[j++]])); - ({ a: v0, b: v5, c: v10, d: v15 } = G2s(v0, v5, v10, v15, msg[offset + s[j++]])); - ({ a: v1, b: v6, c: v11, d: v12 } = G1s(v1, v6, v11, v12, msg[offset + s[j++]])); - ({ a: v1, b: v6, c: v11, d: v12 } = G2s(v1, v6, v11, v12, msg[offset + s[j++]])); - ({ a: v2, b: v7, c: v8, d: v13 } = G1s(v2, v7, v8, v13, msg[offset + s[j++]])); - ({ a: v2, b: v7, c: v8, d: v13 } = G2s(v2, v7, v8, v13, msg[offset + s[j++]])); - ({ a: v3, b: v4, c: v9, d: v14 } = G1s(v3, v4, v9, v14, msg[offset + s[j++]])); - ({ a: v3, b: v4, c: v9, d: v14 } = G2s(v3, v4, v9, v14, msg[offset + s[j++]])); - } - return { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 }; -} - -const B2S_IV = SHA256_IV; -export class BLAKE2s extends BLAKE2 { - // Internal state, same as SHA-256 - private v0 = B2S_IV[0] | 0; - private v1 = B2S_IV[1] | 0; - private v2 = B2S_IV[2] | 0; - private v3 = B2S_IV[3] | 0; - private v4 = B2S_IV[4] | 0; - private v5 = B2S_IV[5] | 0; - private v6 = B2S_IV[6] | 0; - private v7 = B2S_IV[7] | 0; - - constructor(opts: Blake2Opts = {}) { - const olen = opts.dkLen === undefined ? 32 : opts.dkLen; - super(64, olen); - checkBlake2Opts(olen, opts, 32, 8, 8); - let { key, personalization, salt } = opts; - let keyLength = 0; - if (key !== undefined) { - key = toBytes(key); - keyLength = key.length; - } - this.v0 ^= this.outputLen | (keyLength << 8) | (0x01 << 16) | (0x01 << 24); - if (salt !== undefined) { - salt = toBytes(salt); - const slt = u32(salt as Uint8Array); - this.v4 ^= swap8IfBE(slt[0]); - this.v5 ^= swap8IfBE(slt[1]); - } - if (personalization !== undefined) { - personalization = toBytes(personalization); - const pers = u32(personalization as Uint8Array); - this.v6 ^= swap8IfBE(pers[0]); - this.v7 ^= swap8IfBE(pers[1]); - } - if (key !== undefined) { - // Pad to blockLen and update - abytes(key); - const tmp = new Uint8Array(this.blockLen); - tmp.set(key); - this.update(tmp); - } - } - protected get(): [number, number, number, number, number, number, number, number] { - const { v0, v1, v2, v3, v4, v5, v6, v7 } = this; - return [v0, v1, v2, v3, v4, v5, v6, v7]; - } - // prettier-ignore - protected set( - v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number - ): void { - this.v0 = v0 | 0; - this.v1 = v1 | 0; - this.v2 = v2 | 0; - this.v3 = v3 | 0; - this.v4 = v4 | 0; - this.v5 = v5 | 0; - this.v6 = v6 | 0; - this.v7 = v7 | 0; - } - protected compress(msg: Uint32Array, offset: number, isLast: boolean): void { - const { h, l } = u64.fromBig(BigInt(this.length)); - // prettier-ignore - const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = - compress( - BSIGMA, offset, msg, 10, - this.v0, this.v1, this.v2, this.v3, this.v4, this.v5, this.v6, this.v7, - B2S_IV[0], B2S_IV[1], B2S_IV[2], B2S_IV[3], l ^ B2S_IV[4], h ^ B2S_IV[5], isLast ? ~B2S_IV[6] : B2S_IV[6], B2S_IV[7] - ); - this.v0 ^= v0 ^ v8; - this.v1 ^= v1 ^ v9; - this.v2 ^= v2 ^ v10; - this.v3 ^= v3 ^ v11; - this.v4 ^= v4 ^ v12; - this.v5 ^= v5 ^ v13; - this.v6 ^= v6 ^ v14; - this.v7 ^= v7 ^ v15; - } - destroy(): void { - this.destroyed = true; - clean(this.buffer32); - this.set(0, 0, 0, 0, 0, 0, 0, 0); - } -} - -/** - * Blake2s hash function. Focuses on 8-bit to 32-bit platforms. 1.5x faster than blake2b in JS. - * @param msg - message that would be hashed - * @param opts - dkLen output length, key for MAC mode, salt, personalization - */ -export const blake2s: CHashO = /* @__PURE__ */ createOptHasher( - (opts) => new BLAKE2s(opts) -); diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/src/blake2b.ts b/tools/mnemonic-test/node_modules/@noble/hashes/src/blake2b.ts deleted file mode 100644 index ddfeadfd..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/src/blake2b.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Blake2b hash function. Focuses on 64-bit platforms, but in JS speed different from Blake2s is negligible. - * @module - * @deprecated - */ -import { BLAKE2b as B2B, blake2b as b2b } from './blake2.ts'; -/** @deprecated Use import from `noble/hashes/blake2` module */ -export const BLAKE2b: typeof B2B = B2B; -/** @deprecated Use import from `noble/hashes/blake2` module */ -export const blake2b: typeof b2b = b2b; diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/src/blake2s.ts b/tools/mnemonic-test/node_modules/@noble/hashes/src/blake2s.ts deleted file mode 100644 index 7c753b70..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/src/blake2s.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Blake2s hash function. Focuses on 8-bit to 32-bit platforms. blake2b for 64-bit, but in JS it is slower. - * @module - * @deprecated - */ -import { G1s as G1s_n, G2s as G2s_n } from './_blake.ts'; -import { SHA256_IV } from './_md.ts'; -import { BLAKE2s as B2S, blake2s as b2s, compress as compress_n } from './blake2.ts'; -/** @deprecated Use import from `noble/hashes/blake2` module */ -export const B2S_IV: Uint32Array = SHA256_IV; -/** @deprecated Use import from `noble/hashes/blake2` module */ -export const G1s: typeof G1s_n = G1s_n; -/** @deprecated Use import from `noble/hashes/blake2` module */ -export const G2s: typeof G2s_n = G2s_n; -/** @deprecated Use import from `noble/hashes/blake2` module */ -export const compress: typeof compress_n = compress_n; -/** @deprecated Use import from `noble/hashes/blake2` module */ -export const BLAKE2s: typeof B2S = B2S; -/** @deprecated Use import from `noble/hashes/blake2` module */ -export const blake2s: typeof b2s = b2s; diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/src/blake3.ts b/tools/mnemonic-test/node_modules/@noble/hashes/src/blake3.ts deleted file mode 100644 index e08395b9..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/src/blake3.ts +++ /dev/null @@ -1,272 +0,0 @@ -/** - * Blake3 fast hash is Blake2 with reduced security (round count). Can also be used as MAC & KDF. - * - * It is advertised as "the fastest cryptographic hash". However, it isn't true in JS. - * Why is this so slow? While it should be 6x faster than blake2b, perf diff is only 20%: - * - * * There is only 30% reduction in number of rounds from blake2s - * * Speed-up comes from tree structure, which is parallelized using SIMD & threading. - * These features are not present in JS, so we only get overhead from trees. - * * Parallelization only happens on 1024-byte chunks: there is no benefit for small inputs. - * * It is still possible to make it faster using: a) loop unrolling b) web workers c) wasm - * @module - */ -import { SHA256_IV } from './_md.ts'; -import { fromBig } from './_u64.ts'; -import { BLAKE2, compress } from './blake2.ts'; -// prettier-ignore -import { - abytes, aexists, anumber, aoutput, - clean, createXOFer, swap32IfBE, toBytes, u32, u8, - type CHashXO, type HashXOF, type Input -} from './utils.ts'; - -// Flag bitset -const B3_Flags = { - CHUNK_START: 0b1, - CHUNK_END: 0b10, - PARENT: 0b100, - ROOT: 0b1000, - KEYED_HASH: 0b10000, - DERIVE_KEY_CONTEXT: 0b100000, - DERIVE_KEY_MATERIAL: 0b1000000, -} as const; - -const B3_IV = SHA256_IV.slice(); - -const B3_SIGMA: Uint8Array = /* @__PURE__ */ (() => { - const Id = Array.from({ length: 16 }, (_, i) => i); - const permute = (arr: number[]) => - [2, 6, 3, 10, 7, 0, 4, 13, 1, 11, 12, 5, 9, 14, 15, 8].map((i) => arr[i]); - const res: number[] = []; - for (let i = 0, v = Id; i < 7; i++, v = permute(v)) res.push(...v); - return Uint8Array.from(res); -})(); - -/** - * Ensure to use EITHER `key` OR `context`, not both. - * - * * `key`: 32-byte MAC key. - * * `context`: string for KDF. Should be hardcoded, globally unique, and application - specific. - * A good default format for the context string is "[application] [commit timestamp] [purpose]". - */ -export type Blake3Opts = { dkLen?: number; key?: Input; context?: Input }; - -/** Blake3 hash. Can be used as MAC and KDF. */ -export class BLAKE3 extends BLAKE2 implements HashXOF { - private chunkPos = 0; // Position of current block in chunk - private chunksDone = 0; // How many chunks we already have - private flags = 0 | 0; - private IV: Uint32Array; - private state: Uint32Array; - private stack: Uint32Array[] = []; - // Output - private posOut = 0; - private bufferOut32 = new Uint32Array(16); - private bufferOut: Uint8Array; - private chunkOut = 0; // index of output chunk - private enableXOF = true; - - constructor(opts: Blake3Opts = {}, flags = 0) { - super(64, opts.dkLen === undefined ? 32 : opts.dkLen); - const { key, context } = opts; - const hasContext = context !== undefined; - if (key !== undefined) { - if (hasContext) throw new Error('Only "key" or "context" can be specified at same time'); - const k = toBytes(key).slice(); - abytes(k, 32); - this.IV = u32(k); - swap32IfBE(this.IV); - this.flags = flags | B3_Flags.KEYED_HASH; - } else if (hasContext) { - const ctx = toBytes(context); - const contextKey = new BLAKE3({ dkLen: 32 }, B3_Flags.DERIVE_KEY_CONTEXT) - .update(ctx) - .digest(); - this.IV = u32(contextKey); - swap32IfBE(this.IV); - this.flags = flags | B3_Flags.DERIVE_KEY_MATERIAL; - } else { - this.IV = B3_IV.slice(); - this.flags = flags; - } - this.state = this.IV.slice(); - this.bufferOut = u8(this.bufferOut32); - } - // Unused - protected get(): [] { - return []; - } - protected set(): void {} - private b2Compress(counter: number, flags: number, buf: Uint32Array, bufPos: number = 0) { - const { state: s, pos } = this; - const { h, l } = fromBig(BigInt(counter), true); - // prettier-ignore - const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = - compress( - B3_SIGMA, bufPos, buf, 7, - s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], - B3_IV[0], B3_IV[1], B3_IV[2], B3_IV[3], h, l, pos, flags - ); - s[0] = v0 ^ v8; - s[1] = v1 ^ v9; - s[2] = v2 ^ v10; - s[3] = v3 ^ v11; - s[4] = v4 ^ v12; - s[5] = v5 ^ v13; - s[6] = v6 ^ v14; - s[7] = v7 ^ v15; - } - protected compress(buf: Uint32Array, bufPos: number = 0, isLast: boolean = false): void { - // Compress last block - let flags = this.flags; - if (!this.chunkPos) flags |= B3_Flags.CHUNK_START; - if (this.chunkPos === 15 || isLast) flags |= B3_Flags.CHUNK_END; - if (!isLast) this.pos = this.blockLen; - this.b2Compress(this.chunksDone, flags, buf, bufPos); - this.chunkPos += 1; - // If current block is last in chunk (16 blocks), then compress chunks - if (this.chunkPos === 16 || isLast) { - let chunk = this.state; - this.state = this.IV.slice(); - // If not the last one, compress only when there are trailing zeros in chunk counter - // chunks used as binary tree where current stack is path. Zero means current leaf is finished and can be compressed. - // 1 (001) - leaf not finished (just push current chunk to stack) - // 2 (010) - leaf finished at depth=1 (merge with last elm on stack and push back) - // 3 (011) - last leaf not finished - // 4 (100) - leafs finished at depth=1 and depth=2 - for (let last, chunks = this.chunksDone + 1; isLast || !(chunks & 1); chunks >>= 1) { - if (!(last = this.stack.pop())) break; - this.buffer32.set(last, 0); - this.buffer32.set(chunk, 8); - this.pos = this.blockLen; - this.b2Compress(0, this.flags | B3_Flags.PARENT, this.buffer32, 0); - chunk = this.state; - this.state = this.IV.slice(); - } - this.chunksDone++; - this.chunkPos = 0; - this.stack.push(chunk); - } - this.pos = 0; - } - _cloneInto(to?: BLAKE3): BLAKE3 { - to = super._cloneInto(to) as BLAKE3; - const { IV, flags, state, chunkPos, posOut, chunkOut, stack, chunksDone } = this; - to.state.set(state.slice()); - to.stack = stack.map((i) => Uint32Array.from(i)); - to.IV.set(IV); - to.flags = flags; - to.chunkPos = chunkPos; - to.chunksDone = chunksDone; - to.posOut = posOut; - to.chunkOut = chunkOut; - to.enableXOF = this.enableXOF; - to.bufferOut32.set(this.bufferOut32); - return to; - } - destroy(): void { - this.destroyed = true; - clean(this.state, this.buffer32, this.IV, this.bufferOut32); - clean(...this.stack); - } - // Same as b2Compress, but doesn't modify state and returns 16 u32 array (instead of 8) - private b2CompressOut() { - const { state: s, pos, flags, buffer32, bufferOut32: out32 } = this; - const { h, l } = fromBig(BigInt(this.chunkOut++)); - swap32IfBE(buffer32); - // prettier-ignore - const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = - compress( - B3_SIGMA, 0, buffer32, 7, - s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], - B3_IV[0], B3_IV[1], B3_IV[2], B3_IV[3], l, h, pos, flags - ); - out32[0] = v0 ^ v8; - out32[1] = v1 ^ v9; - out32[2] = v2 ^ v10; - out32[3] = v3 ^ v11; - out32[4] = v4 ^ v12; - out32[5] = v5 ^ v13; - out32[6] = v6 ^ v14; - out32[7] = v7 ^ v15; - out32[8] = s[0] ^ v8; - out32[9] = s[1] ^ v9; - out32[10] = s[2] ^ v10; - out32[11] = s[3] ^ v11; - out32[12] = s[4] ^ v12; - out32[13] = s[5] ^ v13; - out32[14] = s[6] ^ v14; - out32[15] = s[7] ^ v15; - swap32IfBE(buffer32); - swap32IfBE(out32); - this.posOut = 0; - } - protected finish(): void { - if (this.finished) return; - this.finished = true; - // Padding - clean(this.buffer.subarray(this.pos)); - // Process last chunk - let flags = this.flags | B3_Flags.ROOT; - if (this.stack.length) { - flags |= B3_Flags.PARENT; - swap32IfBE(this.buffer32); - this.compress(this.buffer32, 0, true); - swap32IfBE(this.buffer32); - this.chunksDone = 0; - this.pos = this.blockLen; - } else { - flags |= (!this.chunkPos ? B3_Flags.CHUNK_START : 0) | B3_Flags.CHUNK_END; - } - this.flags = flags; - this.b2CompressOut(); - } - private writeInto(out: Uint8Array) { - aexists(this, false); - abytes(out); - this.finish(); - const { blockLen, bufferOut } = this; - for (let pos = 0, len = out.length; pos < len; ) { - if (this.posOut >= blockLen) this.b2CompressOut(); - const take = Math.min(blockLen - this.posOut, len - pos); - out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); - this.posOut += take; - pos += take; - } - return out; - } - xofInto(out: Uint8Array): Uint8Array { - if (!this.enableXOF) throw new Error('XOF is not possible after digest call'); - return this.writeInto(out); - } - xof(bytes: number): Uint8Array { - anumber(bytes); - return this.xofInto(new Uint8Array(bytes)); - } - digestInto(out: Uint8Array): Uint8Array { - aoutput(out, this); - if (this.finished) throw new Error('digest() was already called'); - this.enableXOF = false; - this.writeInto(out); - this.destroy(); - return out; - } - digest(): Uint8Array { - return this.digestInto(new Uint8Array(this.outputLen)); - } -} - -/** - * BLAKE3 hash function. Can be used as MAC and KDF. - * @param msg - message that would be hashed - * @param opts - `dkLen` for output length, `key` for MAC mode, `context` for KDF mode - * @example - * const data = new Uint8Array(32); - * const hash = blake3(data); - * const mac = blake3(data, { key: new Uint8Array(32) }); - * const kdf = blake3(data, { context: 'application name' }); - */ -export const blake3: CHashXO = /* @__PURE__ */ createXOFer( - (opts) => new BLAKE3(opts) -); diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/src/crypto.ts b/tools/mnemonic-test/node_modules/@noble/hashes/src/crypto.ts deleted file mode 100644 index 61a59cff..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/src/crypto.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Internal webcrypto alias. - * We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+. - * See utils.ts for details. - * @module - */ -declare const globalThis: Record | undefined; -export const crypto: any = - typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined; diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/src/cryptoNode.ts b/tools/mnemonic-test/node_modules/@noble/hashes/src/cryptoNode.ts deleted file mode 100644 index 53a3cc71..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/src/cryptoNode.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Internal webcrypto alias. - * We prefer WebCrypto aka globalThis.crypto, which exists in node.js 16+. - * Falls back to Node.js built-in crypto for Node.js <=v14. - * See utils.ts for details. - * @module - */ -// @ts-ignore -import * as nc from 'node:crypto'; -export const crypto: any = - nc && typeof nc === 'object' && 'webcrypto' in nc - ? (nc.webcrypto as any) - : nc && typeof nc === 'object' && 'randomBytes' in nc - ? nc - : undefined; diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/src/eskdf.ts b/tools/mnemonic-test/node_modules/@noble/hashes/src/eskdf.ts deleted file mode 100644 index 58707d15..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/src/eskdf.ts +++ /dev/null @@ -1,187 +0,0 @@ -/** - * Experimental KDF for AES. - */ -import { hkdf } from './hkdf.ts'; -import { pbkdf2 as _pbkdf2 } from './pbkdf2.ts'; -import { scrypt as _scrypt } from './scrypt.ts'; -import { sha256 } from './sha256.ts'; -import { abytes, bytesToHex, clean, createView, hexToBytes, kdfInputToBytes } from './utils.ts'; - -// A tiny KDF for various applications like AES key-gen. -// Uses HKDF in a non-standard way, so it's not "KDF-secure", only "PRF-secure". -// Which is good enough: assume sha2-256 retained preimage resistance. - -const SCRYPT_FACTOR = 2 ** 19; -const PBKDF2_FACTOR = 2 ** 17; - -// Scrypt KDF -export function scrypt(password: string, salt: string): Uint8Array { - return _scrypt(password, salt, { N: SCRYPT_FACTOR, r: 8, p: 1, dkLen: 32 }); -} - -// PBKDF2-HMAC-SHA256 -export function pbkdf2(password: string, salt: string): Uint8Array { - return _pbkdf2(sha256, password, salt, { c: PBKDF2_FACTOR, dkLen: 32 }); -} - -// Combines two 32-byte byte arrays -function xor32(a: Uint8Array, b: Uint8Array): Uint8Array { - abytes(a, 32); - abytes(b, 32); - const arr = new Uint8Array(32); - for (let i = 0; i < 32; i++) { - arr[i] = a[i] ^ b[i]; - } - return arr; -} - -function strHasLength(str: string, min: number, max: number): boolean { - return typeof str === 'string' && str.length >= min && str.length <= max; -} - -/** - * Derives main seed. Takes a lot of time. Prefer `eskdf` method instead. - */ -export function deriveMainSeed(username: string, password: string): Uint8Array { - if (!strHasLength(username, 8, 255)) throw new Error('invalid username'); - if (!strHasLength(password, 8, 255)) throw new Error('invalid password'); - // Declared like this to throw off minifiers which auto-convert .fromCharCode(1) to actual string. - // String with non-ascii may be problematic in some envs - const codes = { _1: 1, _2: 2 }; - const sep = { s: String.fromCharCode(codes._1), p: String.fromCharCode(codes._2) }; - const scr = scrypt(password + sep.s, username + sep.s); - const pbk = pbkdf2(password + sep.p, username + sep.p); - const res = xor32(scr, pbk); - clean(scr, pbk); - return res; -} - -type AccountID = number | string; - -/** - * Converts protocol & accountId pair to HKDF salt & info params. - */ -function getSaltInfo(protocol: string, accountId: AccountID = 0) { - // Note that length here also repeats two lines below - // We do an additional length check here to reduce the scope of DoS attacks - if (!(strHasLength(protocol, 3, 15) && /^[a-z0-9]{3,15}$/.test(protocol))) { - throw new Error('invalid protocol'); - } - - // Allow string account ids for some protocols - const allowsStr = /^password\d{0,3}|ssh|tor|file$/.test(protocol); - let salt: Uint8Array; // Extract salt. Default is undefined. - if (typeof accountId === 'string') { - if (!allowsStr) throw new Error('accountId must be a number'); - if (!strHasLength(accountId, 1, 255)) - throw new Error('accountId must be string of length 1..255'); - salt = kdfInputToBytes(accountId); - } else if (Number.isSafeInteger(accountId)) { - if (accountId < 0 || accountId > Math.pow(2, 32) - 1) throw new Error('invalid accountId'); - // Convert to Big Endian Uint32 - salt = new Uint8Array(4); - createView(salt).setUint32(0, accountId, false); - } else { - throw new Error('accountId must be a number' + (allowsStr ? ' or string' : '')); - } - const info = kdfInputToBytes(protocol); - return { salt, info }; -} - -type OptsLength = { keyLength: number }; -type OptsMod = { modulus: bigint }; -type KeyOpts = undefined | OptsLength | OptsMod; - -function countBytes(num: bigint): number { - if (typeof num !== 'bigint' || num <= BigInt(128)) throw new Error('invalid number'); - return Math.ceil(num.toString(2).length / 8); -} - -/** - * Parses keyLength and modulus options to extract length of result key. - * If modulus is used, adds 64 bits to it as per FIPS 186 B.4.1 to combat modulo bias. - */ -function getKeyLength(options: KeyOpts): number { - if (!options || typeof options !== 'object') return 32; - const hasLen = 'keyLength' in options; - const hasMod = 'modulus' in options; - if (hasLen && hasMod) throw new Error('cannot combine keyLength and modulus options'); - if (!hasLen && !hasMod) throw new Error('must have either keyLength or modulus option'); - // FIPS 186 B.4.1 requires at least 64 more bits - const l = hasMod ? countBytes(options.modulus) + 8 : options.keyLength; - if (!(typeof l === 'number' && l >= 16 && l <= 8192)) throw new Error('invalid keyLength'); - return l; -} - -/** - * Converts key to bigint and divides it by modulus. Big Endian. - * Implements FIPS 186 B.4.1, which removes 0 and modulo bias from output. - */ -function modReduceKey(key: Uint8Array, modulus: bigint): Uint8Array { - const _1 = BigInt(1); - const num = BigInt('0x' + bytesToHex(key)); // check for ui8a, then bytesToNumber() - const res = (num % (modulus - _1)) + _1; // Remove 0 from output - if (res < _1) throw new Error('expected positive number'); // Guard against bad values - const len = key.length - 8; // FIPS requires 64 more bits = 8 bytes - const hex = res.toString(16).padStart(len * 2, '0'); // numberToHex() - const bytes = hexToBytes(hex); - if (bytes.length !== len) throw new Error('invalid length of result key'); - return bytes; -} - -// We are not using classes because constructor cannot be async -export interface ESKDF { - /** - * Derives a child key. Child key will not be associated with any - * other child key because of properties of underlying KDF. - * - * @param protocol - 3-15 character protocol name - * @param accountId - numeric identifier of account - * @param options - `keyLength: 64` or `modulus: 41920438n` - * @example deriveChildKey('aes', 0) - */ - deriveChildKey: (protocol: string, accountId: AccountID, options?: KeyOpts) => Uint8Array; - /** - * Deletes the main seed from eskdf instance - */ - expire: () => void; - /** - * Account fingerprint - */ - fingerprint: string; -} - -/** - * ESKDF - * @param username - username, email, or identifier, min: 8 characters, should have enough entropy - * @param password - password, min: 8 characters, should have enough entropy - * @example - * const kdf = await eskdf('example-university', 'beginning-new-example'); - * const key = kdf.deriveChildKey('aes', 0); - * console.log(kdf.fingerprint); - * kdf.expire(); - */ -export async function eskdf(username: string, password: string): Promise { - // We are using closure + object instead of class because - // we want to make `seed` non-accessible for any external function. - let seed: Uint8Array | undefined = deriveMainSeed(username, password); - - function deriveCK(protocol: string, accountId: AccountID = 0, options?: KeyOpts): Uint8Array { - abytes(seed, 32); - const { salt, info } = getSaltInfo(protocol, accountId); // validate protocol & accountId - const keyLength = getKeyLength(options); // validate options - const key = hkdf(sha256, seed!, salt, info, keyLength); - // Modulus has already been validated - return options && 'modulus' in options ? modReduceKey(key, options.modulus) : key; - } - function expire() { - if (seed) seed.fill(1); - seed = undefined; - } - // prettier-ignore - const fingerprint = Array.from(deriveCK('fingerprint', 0)) - .slice(0, 6) - .map((char) => char.toString(16).padStart(2, '0').toUpperCase()) - .join(':'); - return Object.freeze({ deriveChildKey: deriveCK, expire, fingerprint }); -} diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/src/hkdf.ts b/tools/mnemonic-test/node_modules/@noble/hashes/src/hkdf.ts deleted file mode 100644 index acdc24e2..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/src/hkdf.ts +++ /dev/null @@ -1,88 +0,0 @@ -/** - * HKDF (RFC 5869): extract + expand in one step. - * See https://soatok.blog/2021/11/17/understanding-hkdf/. - * @module - */ -import { hmac } from './hmac.ts'; -import { ahash, anumber, type CHash, clean, type Input, toBytes } from './utils.ts'; - -/** - * HKDF-extract from spec. Less important part. `HKDF-Extract(IKM, salt) -> PRK` - * Arguments position differs from spec (IKM is first one, since it is not optional) - * @param hash - hash function that would be used (e.g. sha256) - * @param ikm - input keying material, the initial key - * @param salt - optional salt value (a non-secret random value) - */ -export function extract(hash: CHash, ikm: Input, salt?: Input): Uint8Array { - ahash(hash); - // NOTE: some libraries treat zero-length array as 'not provided'; - // we don't, since we have undefined as 'not provided' - // https://github.com/RustCrypto/KDFs/issues/15 - if (salt === undefined) salt = new Uint8Array(hash.outputLen); - return hmac(hash, toBytes(salt), toBytes(ikm)); -} - -const HKDF_COUNTER = /* @__PURE__ */ Uint8Array.from([0]); -const EMPTY_BUFFER = /* @__PURE__ */ Uint8Array.of(); - -/** - * HKDF-expand from the spec. The most important part. `HKDF-Expand(PRK, info, L) -> OKM` - * @param hash - hash function that would be used (e.g. sha256) - * @param prk - a pseudorandom key of at least HashLen octets (usually, the output from the extract step) - * @param info - optional context and application specific information (can be a zero-length string) - * @param length - length of output keying material in bytes - */ -export function expand(hash: CHash, prk: Input, info?: Input, length: number = 32): Uint8Array { - ahash(hash); - anumber(length); - const olen = hash.outputLen; - if (length > 255 * olen) throw new Error('Length should be <= 255*HashLen'); - const blocks = Math.ceil(length / olen); - if (info === undefined) info = EMPTY_BUFFER; - // first L(ength) octets of T - const okm = new Uint8Array(blocks * olen); - // Re-use HMAC instance between blocks - const HMAC = hmac.create(hash, prk); - const HMACTmp = HMAC._cloneInto(); - const T = new Uint8Array(HMAC.outputLen); - for (let counter = 0; counter < blocks; counter++) { - HKDF_COUNTER[0] = counter + 1; - // T(0) = empty string (zero length) - // T(N) = HMAC-Hash(PRK, T(N-1) | info | N) - HMACTmp.update(counter === 0 ? EMPTY_BUFFER : T) - .update(info) - .update(HKDF_COUNTER) - .digestInto(T); - okm.set(T, olen * counter); - HMAC._cloneInto(HMACTmp); - } - HMAC.destroy(); - HMACTmp.destroy(); - clean(T, HKDF_COUNTER); - return okm.slice(0, length); -} - -/** - * HKDF (RFC 5869): derive keys from an initial input. - * Combines hkdf_extract + hkdf_expand in one step - * @param hash - hash function that would be used (e.g. sha256) - * @param ikm - input keying material, the initial key - * @param salt - optional salt value (a non-secret random value) - * @param info - optional context and application specific information (can be a zero-length string) - * @param length - length of output keying material in bytes - * @example - * import { hkdf } from '@noble/hashes/hkdf'; - * import { sha256 } from '@noble/hashes/sha2'; - * import { randomBytes } from '@noble/hashes/utils'; - * const inputKey = randomBytes(32); - * const salt = randomBytes(32); - * const info = 'application-key'; - * const hk1 = hkdf(sha256, inputKey, salt, info, 32); - */ -export const hkdf = ( - hash: CHash, - ikm: Input, - salt: Input | undefined, - info: Input | undefined, - length: number -): Uint8Array => expand(hash, extract(hash, ikm, salt), info, length); diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/src/hmac.ts b/tools/mnemonic-test/node_modules/@noble/hashes/src/hmac.ts deleted file mode 100644 index 7cf028aa..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/src/hmac.ts +++ /dev/null @@ -1,94 +0,0 @@ -/** - * HMAC: RFC2104 message authentication code. - * @module - */ -import { abytes, aexists, ahash, clean, Hash, toBytes, type CHash, type Input } from './utils.ts'; - -export class HMAC> extends Hash> { - oHash: T; - iHash: T; - blockLen: number; - outputLen: number; - private finished = false; - private destroyed = false; - - constructor(hash: CHash, _key: Input) { - super(); - ahash(hash); - const key = toBytes(_key); - this.iHash = hash.create() as T; - if (typeof this.iHash.update !== 'function') - throw new Error('Expected instance of class which extends utils.Hash'); - this.blockLen = this.iHash.blockLen; - this.outputLen = this.iHash.outputLen; - const blockLen = this.blockLen; - const pad = new Uint8Array(blockLen); - // blockLen can be bigger than outputLen - pad.set(key.length > blockLen ? hash.create().update(key).digest() : key); - for (let i = 0; i < pad.length; i++) pad[i] ^= 0x36; - this.iHash.update(pad); - // By doing update (processing of first block) of outer hash here we can re-use it between multiple calls via clone - this.oHash = hash.create() as T; - // Undo internal XOR && apply outer XOR - for (let i = 0; i < pad.length; i++) pad[i] ^= 0x36 ^ 0x5c; - this.oHash.update(pad); - clean(pad); - } - update(buf: Input): this { - aexists(this); - this.iHash.update(buf); - return this; - } - digestInto(out: Uint8Array): void { - aexists(this); - abytes(out, this.outputLen); - this.finished = true; - this.iHash.digestInto(out); - this.oHash.update(out); - this.oHash.digestInto(out); - this.destroy(); - } - digest(): Uint8Array { - const out = new Uint8Array(this.oHash.outputLen); - this.digestInto(out); - return out; - } - _cloneInto(to?: HMAC): HMAC { - // Create new instance without calling constructor since key already in state and we don't know it. - to ||= Object.create(Object.getPrototypeOf(this), {}); - const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this; - to = to as this; - to.finished = finished; - to.destroyed = destroyed; - to.blockLen = blockLen; - to.outputLen = outputLen; - to.oHash = oHash._cloneInto(to.oHash); - to.iHash = iHash._cloneInto(to.iHash); - return to; - } - clone(): HMAC { - return this._cloneInto(); - } - destroy(): void { - this.destroyed = true; - this.oHash.destroy(); - this.iHash.destroy(); - } -} - -/** - * HMAC: RFC2104 message authentication code. - * @param hash - function that would be used e.g. sha256 - * @param key - message key - * @param message - message data - * @example - * import { hmac } from '@noble/hashes/hmac'; - * import { sha256 } from '@noble/hashes/sha2'; - * const mac1 = hmac(sha256, 'key', 'message'); - */ -export const hmac: { - (hash: CHash, key: Input, message: Input): Uint8Array; - create(hash: CHash, key: Input): HMAC; -} = (hash: CHash, key: Input, message: Input): Uint8Array => - new HMAC(hash, key).update(message).digest(); -hmac.create = (hash: CHash, key: Input) => new HMAC(hash, key); diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/src/index.ts b/tools/mnemonic-test/node_modules/@noble/hashes/src/index.ts deleted file mode 100644 index 485d7627..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/src/index.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Audited & minimal JS implementation of hash functions, MACs and KDFs. Check out individual modules. - * @module - * @example -```js -import { - sha256, sha384, sha512, sha224, sha512_224, sha512_256 -} from '@noble/hashes/sha2'; -import { - sha3_224, sha3_256, sha3_384, sha3_512, - keccak_224, keccak_256, keccak_384, keccak_512, - shake128, shake256 -} from '@noble/hashes/sha3'; -import { - cshake128, cshake256, - turboshake128, turboshake256, - kmac128, kmac256, - tuplehash256, parallelhash256, - k12, m14, keccakprg -} from '@noble/hashes/sha3-addons'; -import { blake3 } from '@noble/hashes/blake3'; -import { blake2b, blake2s } from '@noble/hashes/blake2'; -import { hmac } from '@noble/hashes/hmac'; -import { hkdf } from '@noble/hashes/hkdf'; -import { pbkdf2, pbkdf2Async } from '@noble/hashes/pbkdf2'; -import { scrypt, scryptAsync } from '@noble/hashes/scrypt'; -import { md5, ripemd160, sha1 } from '@noble/hashes/legacy'; -import * as utils from '@noble/hashes/utils'; -``` - */ -throw new Error('root module cannot be imported: import submodules instead. Check out README'); diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/src/legacy.ts b/tools/mnemonic-test/node_modules/@noble/hashes/src/legacy.ts deleted file mode 100644 index 47eaddc7..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/src/legacy.ts +++ /dev/null @@ -1,293 +0,0 @@ -/** - -SHA1 (RFC 3174), MD5 (RFC 1321) and RIPEMD160 (RFC 2286) legacy, weak hash functions. -Don't use them in a new protocol. What "weak" means: - -- Collisions can be made with 2^18 effort in MD5, 2^60 in SHA1, 2^80 in RIPEMD160. -- No practical pre-image attacks (only theoretical, 2^123.4) -- HMAC seems kinda ok: https://datatracker.ietf.org/doc/html/rfc6151 - * @module - */ -import { Chi, HashMD, Maj } from './_md.ts'; -import { type CHash, clean, createHasher, rotl } from './utils.ts'; - -/** Initial SHA1 state */ -const SHA1_IV = /* @__PURE__ */ Uint32Array.from([ - 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0, -]); - -// Reusable temporary buffer -const SHA1_W = /* @__PURE__ */ new Uint32Array(80); - -/** SHA1 legacy hash class. */ -export class SHA1 extends HashMD { - private A = SHA1_IV[0] | 0; - private B = SHA1_IV[1] | 0; - private C = SHA1_IV[2] | 0; - private D = SHA1_IV[3] | 0; - private E = SHA1_IV[4] | 0; - - constructor() { - super(64, 20, 8, false); - } - protected get(): [number, number, number, number, number] { - const { A, B, C, D, E } = this; - return [A, B, C, D, E]; - } - protected set(A: number, B: number, C: number, D: number, E: number): void { - this.A = A | 0; - this.B = B | 0; - this.C = C | 0; - this.D = D | 0; - this.E = E | 0; - } - protected process(view: DataView, offset: number): void { - for (let i = 0; i < 16; i++, offset += 4) SHA1_W[i] = view.getUint32(offset, false); - for (let i = 16; i < 80; i++) - SHA1_W[i] = rotl(SHA1_W[i - 3] ^ SHA1_W[i - 8] ^ SHA1_W[i - 14] ^ SHA1_W[i - 16], 1); - // Compression function main loop, 80 rounds - let { A, B, C, D, E } = this; - for (let i = 0; i < 80; i++) { - let F, K; - if (i < 20) { - F = Chi(B, C, D); - K = 0x5a827999; - } else if (i < 40) { - F = B ^ C ^ D; - K = 0x6ed9eba1; - } else if (i < 60) { - F = Maj(B, C, D); - K = 0x8f1bbcdc; - } else { - F = B ^ C ^ D; - K = 0xca62c1d6; - } - const T = (rotl(A, 5) + F + E + K + SHA1_W[i]) | 0; - E = D; - D = C; - C = rotl(B, 30); - B = A; - A = T; - } - // Add the compressed chunk to the current hash value - A = (A + this.A) | 0; - B = (B + this.B) | 0; - C = (C + this.C) | 0; - D = (D + this.D) | 0; - E = (E + this.E) | 0; - this.set(A, B, C, D, E); - } - protected roundClean(): void { - clean(SHA1_W); - } - destroy(): void { - this.set(0, 0, 0, 0, 0); - clean(this.buffer); - } -} - -/** SHA1 (RFC 3174) legacy hash function. It was cryptographically broken. */ -export const sha1: CHash = /* @__PURE__ */ createHasher(() => new SHA1()); - -/** Per-round constants */ -const p32 = /* @__PURE__ */ Math.pow(2, 32); -const K = /* @__PURE__ */ Array.from({ length: 64 }, (_, i) => - Math.floor(p32 * Math.abs(Math.sin(i + 1))) -); - -/** md5 initial state: same as sha1, but 4 u32 instead of 5. */ -const MD5_IV = /* @__PURE__ */ SHA1_IV.slice(0, 4); - -// Reusable temporary buffer -const MD5_W = /* @__PURE__ */ new Uint32Array(16); -/** MD5 legacy hash class. */ -export class MD5 extends HashMD { - private A = MD5_IV[0] | 0; - private B = MD5_IV[1] | 0; - private C = MD5_IV[2] | 0; - private D = MD5_IV[3] | 0; - - constructor() { - super(64, 16, 8, true); - } - protected get(): [number, number, number, number] { - const { A, B, C, D } = this; - return [A, B, C, D]; - } - protected set(A: number, B: number, C: number, D: number): void { - this.A = A | 0; - this.B = B | 0; - this.C = C | 0; - this.D = D | 0; - } - protected process(view: DataView, offset: number): void { - for (let i = 0; i < 16; i++, offset += 4) MD5_W[i] = view.getUint32(offset, true); - // Compression function main loop, 64 rounds - let { A, B, C, D } = this; - for (let i = 0; i < 64; i++) { - let F, g, s; - if (i < 16) { - F = Chi(B, C, D); - g = i; - s = [7, 12, 17, 22]; - } else if (i < 32) { - F = Chi(D, B, C); - g = (5 * i + 1) % 16; - s = [5, 9, 14, 20]; - } else if (i < 48) { - F = B ^ C ^ D; - g = (3 * i + 5) % 16; - s = [4, 11, 16, 23]; - } else { - F = C ^ (B | ~D); - g = (7 * i) % 16; - s = [6, 10, 15, 21]; - } - F = F + A + K[i] + MD5_W[g]; - A = D; - D = C; - C = B; - B = B + rotl(F, s[i % 4]); - } - // Add the compressed chunk to the current hash value - A = (A + this.A) | 0; - B = (B + this.B) | 0; - C = (C + this.C) | 0; - D = (D + this.D) | 0; - this.set(A, B, C, D); - } - protected roundClean(): void { - clean(MD5_W); - } - destroy(): void { - this.set(0, 0, 0, 0); - clean(this.buffer); - } -} - -/** - * MD5 (RFC 1321) legacy hash function. It was cryptographically broken. - * MD5 architecture is similar to SHA1, with some differences: - * - Reduced output length: 16 bytes (128 bit) instead of 20 - * - 64 rounds, instead of 80 - * - Little-endian: could be faster, but will require more code - * - Non-linear index selection: huge speed-up for unroll - * - Per round constants: more memory accesses, additional speed-up for unroll - */ -export const md5: CHash = /* @__PURE__ */ createHasher(() => new MD5()); - -// RIPEMD-160 - -const Rho160 = /* @__PURE__ */ Uint8Array.from([ - 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, -]); -const Id160 = /* @__PURE__ */ (() => Uint8Array.from(new Array(16).fill(0).map((_, i) => i)))(); -const Pi160 = /* @__PURE__ */ (() => Id160.map((i) => (9 * i + 5) % 16))(); -const idxLR = /* @__PURE__ */ (() => { - const L = [Id160]; - const R = [Pi160]; - const res = [L, R]; - for (let i = 0; i < 4; i++) for (let j of res) j.push(j[i].map((k) => Rho160[k])); - return res; -})(); -const idxL = /* @__PURE__ */ (() => idxLR[0])(); -const idxR = /* @__PURE__ */ (() => idxLR[1])(); -// const [idxL, idxR] = idxLR; - -const shifts160 = /* @__PURE__ */ [ - [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8], - [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7], - [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9], - [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6], - [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5], -].map((i) => Uint8Array.from(i)); -const shiftsL160 = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts160[i][j])); -const shiftsR160 = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts160[i][j])); -const Kl160 = /* @__PURE__ */ Uint32Array.from([ - 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e, -]); -const Kr160 = /* @__PURE__ */ Uint32Array.from([ - 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000, -]); -// It's called f() in spec. -function ripemd_f(group: number, x: number, y: number, z: number): number { - if (group === 0) return x ^ y ^ z; - if (group === 1) return (x & y) | (~x & z); - if (group === 2) return (x | ~y) ^ z; - if (group === 3) return (x & z) | (y & ~z); - return x ^ (y | ~z); -} -// Reusable temporary buffer -const BUF_160 = /* @__PURE__ */ new Uint32Array(16); -export class RIPEMD160 extends HashMD { - private h0 = 0x67452301 | 0; - private h1 = 0xefcdab89 | 0; - private h2 = 0x98badcfe | 0; - private h3 = 0x10325476 | 0; - private h4 = 0xc3d2e1f0 | 0; - - constructor() { - super(64, 20, 8, true); - } - protected get(): [number, number, number, number, number] { - const { h0, h1, h2, h3, h4 } = this; - return [h0, h1, h2, h3, h4]; - } - protected set(h0: number, h1: number, h2: number, h3: number, h4: number): void { - this.h0 = h0 | 0; - this.h1 = h1 | 0; - this.h2 = h2 | 0; - this.h3 = h3 | 0; - this.h4 = h4 | 0; - } - protected process(view: DataView, offset: number): void { - for (let i = 0; i < 16; i++, offset += 4) BUF_160[i] = view.getUint32(offset, true); - // prettier-ignore - let al = this.h0 | 0, ar = al, - bl = this.h1 | 0, br = bl, - cl = this.h2 | 0, cr = cl, - dl = this.h3 | 0, dr = dl, - el = this.h4 | 0, er = el; - - // Instead of iterating 0 to 80, we split it into 5 groups - // And use the groups in constants, functions, etc. Much simpler - for (let group = 0; group < 5; group++) { - const rGroup = 4 - group; - const hbl = Kl160[group], hbr = Kr160[group]; // prettier-ignore - const rl = idxL[group], rr = idxR[group]; // prettier-ignore - const sl = shiftsL160[group], sr = shiftsR160[group]; // prettier-ignore - for (let i = 0; i < 16; i++) { - const tl = (rotl(al + ripemd_f(group, bl, cl, dl) + BUF_160[rl[i]] + hbl, sl[i]) + el) | 0; - al = el, el = dl, dl = rotl(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore - } - // 2 loops are 10% faster - for (let i = 0; i < 16; i++) { - const tr = (rotl(ar + ripemd_f(rGroup, br, cr, dr) + BUF_160[rr[i]] + hbr, sr[i]) + er) | 0; - ar = er, er = dr, dr = rotl(cr, 10) | 0, cr = br, br = tr; // prettier-ignore - } - } - // Add the compressed chunk to the current hash value - this.set( - (this.h1 + cl + dr) | 0, - (this.h2 + dl + er) | 0, - (this.h3 + el + ar) | 0, - (this.h4 + al + br) | 0, - (this.h0 + bl + cr) | 0 - ); - } - protected roundClean(): void { - clean(BUF_160); - } - destroy(): void { - this.destroyed = true; - clean(this.buffer); - this.set(0, 0, 0, 0, 0); - } -} - -/** - * RIPEMD-160 - a legacy hash function from 1990s. - * * https://homes.esat.kuleuven.be/~bosselae/ripemd160.html - * * https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf - */ -export const ripemd160: CHash = /* @__PURE__ */ createHasher(() => new RIPEMD160()); diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/src/pbkdf2.ts b/tools/mnemonic-test/node_modules/@noble/hashes/src/pbkdf2.ts deleted file mode 100644 index ba2007c6..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/src/pbkdf2.ts +++ /dev/null @@ -1,122 +0,0 @@ -/** - * PBKDF (RFC 2898). Can be used to create a key from password and salt. - * @module - */ -import { hmac } from './hmac.ts'; -// prettier-ignore -import { - ahash, anumber, - asyncLoop, checkOpts, clean, createView, Hash, kdfInputToBytes, - type CHash, - type KDFInput -} from './utils.ts'; - -export type Pbkdf2Opt = { - c: number; // Iterations - dkLen?: number; // Desired key length in bytes (Intended output length in octets of the derived key - asyncTick?: number; // Maximum time in ms for which async function can block execution -}; -// Common prologue and epilogue for sync/async functions -function pbkdf2Init(hash: CHash, _password: KDFInput, _salt: KDFInput, _opts: Pbkdf2Opt) { - ahash(hash); - const opts = checkOpts({ dkLen: 32, asyncTick: 10 }, _opts); - const { c, dkLen, asyncTick } = opts; - anumber(c); - anumber(dkLen); - anumber(asyncTick); - if (c < 1) throw new Error('iterations (c) should be >= 1'); - const password = kdfInputToBytes(_password); - const salt = kdfInputToBytes(_salt); - // DK = PBKDF2(PRF, Password, Salt, c, dkLen); - const DK = new Uint8Array(dkLen); - // U1 = PRF(Password, Salt + INT_32_BE(i)) - const PRF = hmac.create(hash, password); - const PRFSalt = PRF._cloneInto().update(salt); - return { c, dkLen, asyncTick, DK, PRF, PRFSalt }; -} - -function pbkdf2Output>( - PRF: Hash, - PRFSalt: Hash, - DK: Uint8Array, - prfW: Hash, - u: Uint8Array -) { - PRF.destroy(); - PRFSalt.destroy(); - if (prfW) prfW.destroy(); - clean(u); - return DK; -} - -/** - * PBKDF2-HMAC: RFC 2898 key derivation function - * @param hash - hash function that would be used e.g. sha256 - * @param password - password from which a derived key is generated - * @param salt - cryptographic salt - * @param opts - {c, dkLen} where c is work factor and dkLen is output message size - * @example - * const key = pbkdf2(sha256, 'password', 'salt', { dkLen: 32, c: Math.pow(2, 18) }); - */ -export function pbkdf2( - hash: CHash, - password: KDFInput, - salt: KDFInput, - opts: Pbkdf2Opt -): Uint8Array { - const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts); - let prfW: any; // Working copy - const arr = new Uint8Array(4); - const view = createView(arr); - const u = new Uint8Array(PRF.outputLen); - // DK = T1 + T2 + ⋯ + Tdklen/hlen - for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { - // Ti = F(Password, Salt, c, i) - const Ti = DK.subarray(pos, pos + PRF.outputLen); - view.setInt32(0, ti, false); - // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc - // U1 = PRF(Password, Salt + INT_32_BE(i)) - (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); - Ti.set(u.subarray(0, Ti.length)); - for (let ui = 1; ui < c; ui++) { - // Uc = PRF(Password, Uc−1) - PRF._cloneInto(prfW).update(u).digestInto(u); - for (let i = 0; i < Ti.length; i++) Ti[i] ^= u[i]; - } - } - return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); -} - -/** - * PBKDF2-HMAC: RFC 2898 key derivation function. Async version. - * @example - * await pbkdf2Async(sha256, 'password', 'salt', { dkLen: 32, c: 500_000 }); - */ -export async function pbkdf2Async( - hash: CHash, - password: KDFInput, - salt: KDFInput, - opts: Pbkdf2Opt -): Promise { - const { c, dkLen, asyncTick, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts); - let prfW: any; // Working copy - const arr = new Uint8Array(4); - const view = createView(arr); - const u = new Uint8Array(PRF.outputLen); - // DK = T1 + T2 + ⋯ + Tdklen/hlen - for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { - // Ti = F(Password, Salt, c, i) - const Ti = DK.subarray(pos, pos + PRF.outputLen); - view.setInt32(0, ti, false); - // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc - // U1 = PRF(Password, Salt + INT_32_BE(i)) - (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); - Ti.set(u.subarray(0, Ti.length)); - await asyncLoop(c - 1, asyncTick, () => { - // Uc = PRF(Password, Uc−1) - PRF._cloneInto(prfW).update(u).digestInto(u); - for (let i = 0; i < Ti.length; i++) Ti[i] ^= u[i]; - }); - } - return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); -} diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/src/ripemd160.ts b/tools/mnemonic-test/node_modules/@noble/hashes/src/ripemd160.ts deleted file mode 100644 index 73f72a5b..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/src/ripemd160.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * RIPEMD-160 legacy hash function. - * https://homes.esat.kuleuven.be/~bosselae/ripemd160.html - * https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf - * @module - * @deprecated - */ -import { RIPEMD160 as RIPEMD160n, ripemd160 as ripemd160n } from './legacy.ts'; -/** @deprecated Use import from `noble/hashes/legacy` module */ -export const RIPEMD160: typeof RIPEMD160n = RIPEMD160n; -/** @deprecated Use import from `noble/hashes/legacy` module */ -export const ripemd160: typeof ripemd160n = ripemd160n; diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/src/scrypt.ts b/tools/mnemonic-test/node_modules/@noble/hashes/src/scrypt.ts deleted file mode 100644 index 143054e3..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/src/scrypt.ts +++ /dev/null @@ -1,257 +0,0 @@ -/** - * RFC 7914 Scrypt KDF. Can be used to create a key from password and salt. - * @module - */ -import { pbkdf2 } from './pbkdf2.ts'; -import { sha256 } from './sha2.ts'; -// prettier-ignore -import { - anumber, asyncLoop, - checkOpts, clean, - type KDFInput, rotl, - swap32IfBE, - u32 -} from './utils.ts'; - -// The main Scrypt loop: uses Salsa extensively. -// Six versions of the function were tried, this is the fastest one. -// prettier-ignore -function XorAndSalsa( - prev: Uint32Array, - pi: number, - input: Uint32Array, - ii: number, - out: Uint32Array, - oi: number -) { - // Based on https://cr.yp.to/salsa20.html - // Xor blocks - let y00 = prev[pi++] ^ input[ii++], y01 = prev[pi++] ^ input[ii++]; - let y02 = prev[pi++] ^ input[ii++], y03 = prev[pi++] ^ input[ii++]; - let y04 = prev[pi++] ^ input[ii++], y05 = prev[pi++] ^ input[ii++]; - let y06 = prev[pi++] ^ input[ii++], y07 = prev[pi++] ^ input[ii++]; - let y08 = prev[pi++] ^ input[ii++], y09 = prev[pi++] ^ input[ii++]; - let y10 = prev[pi++] ^ input[ii++], y11 = prev[pi++] ^ input[ii++]; - let y12 = prev[pi++] ^ input[ii++], y13 = prev[pi++] ^ input[ii++]; - let y14 = prev[pi++] ^ input[ii++], y15 = prev[pi++] ^ input[ii++]; - // Save state to temporary variables (salsa) - let x00 = y00, x01 = y01, x02 = y02, x03 = y03, - x04 = y04, x05 = y05, x06 = y06, x07 = y07, - x08 = y08, x09 = y09, x10 = y10, x11 = y11, - x12 = y12, x13 = y13, x14 = y14, x15 = y15; - // Main loop (salsa) - for (let i = 0; i < 8; i += 2) { - x04 ^= rotl(x00 + x12 | 0, 7); x08 ^= rotl(x04 + x00 | 0, 9); - x12 ^= rotl(x08 + x04 | 0, 13); x00 ^= rotl(x12 + x08 | 0, 18); - x09 ^= rotl(x05 + x01 | 0, 7); x13 ^= rotl(x09 + x05 | 0, 9); - x01 ^= rotl(x13 + x09 | 0, 13); x05 ^= rotl(x01 + x13 | 0, 18); - x14 ^= rotl(x10 + x06 | 0, 7); x02 ^= rotl(x14 + x10 | 0, 9); - x06 ^= rotl(x02 + x14 | 0, 13); x10 ^= rotl(x06 + x02 | 0, 18); - x03 ^= rotl(x15 + x11 | 0, 7); x07 ^= rotl(x03 + x15 | 0, 9); - x11 ^= rotl(x07 + x03 | 0, 13); x15 ^= rotl(x11 + x07 | 0, 18); - x01 ^= rotl(x00 + x03 | 0, 7); x02 ^= rotl(x01 + x00 | 0, 9); - x03 ^= rotl(x02 + x01 | 0, 13); x00 ^= rotl(x03 + x02 | 0, 18); - x06 ^= rotl(x05 + x04 | 0, 7); x07 ^= rotl(x06 + x05 | 0, 9); - x04 ^= rotl(x07 + x06 | 0, 13); x05 ^= rotl(x04 + x07 | 0, 18); - x11 ^= rotl(x10 + x09 | 0, 7); x08 ^= rotl(x11 + x10 | 0, 9); - x09 ^= rotl(x08 + x11 | 0, 13); x10 ^= rotl(x09 + x08 | 0, 18); - x12 ^= rotl(x15 + x14 | 0, 7); x13 ^= rotl(x12 + x15 | 0, 9); - x14 ^= rotl(x13 + x12 | 0, 13); x15 ^= rotl(x14 + x13 | 0, 18); - } - // Write output (salsa) - out[oi++] = (y00 + x00) | 0; out[oi++] = (y01 + x01) | 0; - out[oi++] = (y02 + x02) | 0; out[oi++] = (y03 + x03) | 0; - out[oi++] = (y04 + x04) | 0; out[oi++] = (y05 + x05) | 0; - out[oi++] = (y06 + x06) | 0; out[oi++] = (y07 + x07) | 0; - out[oi++] = (y08 + x08) | 0; out[oi++] = (y09 + x09) | 0; - out[oi++] = (y10 + x10) | 0; out[oi++] = (y11 + x11) | 0; - out[oi++] = (y12 + x12) | 0; out[oi++] = (y13 + x13) | 0; - out[oi++] = (y14 + x14) | 0; out[oi++] = (y15 + x15) | 0; -} - -function BlockMix(input: Uint32Array, ii: number, out: Uint32Array, oi: number, r: number) { - // The block B is r 128-byte chunks (which is equivalent of 2r 64-byte chunks) - let head = oi + 0; - let tail = oi + 16 * r; - for (let i = 0; i < 16; i++) out[tail + i] = input[ii + (2 * r - 1) * 16 + i]; // X ← B[2r−1] - for (let i = 0; i < r; i++, head += 16, ii += 16) { - // We write odd & even Yi at same time. Even: 0bXXXXX0 Odd: 0bXXXXX1 - XorAndSalsa(out, tail, input, ii, out, head); // head[i] = Salsa(blockIn[2*i] ^ tail[i-1]) - if (i > 0) tail += 16; // First iteration overwrites tmp value in tail - XorAndSalsa(out, head, input, (ii += 16), out, tail); // tail[i] = Salsa(blockIn[2*i+1] ^ head[i]) - } -} - -export type ScryptOpts = { - N: number; // cost factor - r: number; // block size - p: number; // parallelization - dkLen?: number; // key length - asyncTick?: number; // block execution max time - maxmem?: number; - onProgress?: (progress: number) => void; -}; - -// Common prologue and epilogue for sync/async functions -function scryptInit(password: KDFInput, salt: KDFInput, _opts?: ScryptOpts) { - // Maxmem - 1GB+1KB by default - const opts = checkOpts( - { - dkLen: 32, - asyncTick: 10, - maxmem: 1024 ** 3 + 1024, - }, - _opts - ); - const { N, r, p, dkLen, asyncTick, maxmem, onProgress } = opts; - anumber(N); - anumber(r); - anumber(p); - anumber(dkLen); - anumber(asyncTick); - anumber(maxmem); - if (onProgress !== undefined && typeof onProgress !== 'function') - throw new Error('progressCb should be function'); - const blockSize = 128 * r; - const blockSize32 = blockSize / 4; - - // Max N is 2^32 (Integrify is 32-bit). Real limit is 2^22: JS engines Uint8Array limit is 4GB in 2024. - // Spec check `N >= 2^(blockSize / 8)` is not done for compat with popular libs, - // which used incorrect r: 1, p: 8. Also, the check seems to be a spec error: - // https://www.rfc-editor.org/errata_search.php?rfc=7914 - const pow32 = Math.pow(2, 32); - if (N <= 1 || (N & (N - 1)) !== 0 || N > pow32) { - throw new Error('Scrypt: N must be larger than 1, a power of 2, and less than 2^32'); - } - if (p < 0 || p > ((pow32 - 1) * 32) / blockSize) { - throw new Error( - 'Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)' - ); - } - if (dkLen < 0 || dkLen > (pow32 - 1) * 32) { - throw new Error( - 'Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32' - ); - } - const memUsed = blockSize * (N + p); - if (memUsed > maxmem) { - throw new Error( - 'Scrypt: memused is bigger than maxMem. Expected 128 * r * (N + p) > maxmem of ' + maxmem - ); - } - // [B0...Bp−1] ← PBKDF2HMAC-SHA256(Passphrase, Salt, 1, blockSize*ParallelizationFactor) - // Since it has only one iteration there is no reason to use async variant - const B = pbkdf2(sha256, password, salt, { c: 1, dkLen: blockSize * p }); - const B32 = u32(B); - // Re-used between parallel iterations. Array(iterations) of B - const V = u32(new Uint8Array(blockSize * N)); - const tmp = u32(new Uint8Array(blockSize)); - let blockMixCb = () => {}; - if (onProgress) { - const totalBlockMix = 2 * N * p; - // Invoke callback if progress changes from 10.01 to 10.02 - // Allows to draw smooth progress bar on up to 8K screen - const callbackPer = Math.max(Math.floor(totalBlockMix / 10000), 1); - let blockMixCnt = 0; - blockMixCb = () => { - blockMixCnt++; - if (onProgress && (!(blockMixCnt % callbackPer) || blockMixCnt === totalBlockMix)) - onProgress(blockMixCnt / totalBlockMix); - }; - } - return { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick }; -} - -function scryptOutput( - password: KDFInput, - dkLen: number, - B: Uint8Array, - V: Uint32Array, - tmp: Uint32Array -) { - const res = pbkdf2(sha256, password, B, { c: 1, dkLen }); - clean(B, V, tmp); - return res; -} - -/** - * Scrypt KDF from RFC 7914. - * @param password - pass - * @param salt - salt - * @param opts - parameters - * - `N` is cpu/mem work factor (power of 2 e.g. 2**18) - * - `r` is block size (8 is common), fine-tunes sequential memory read size and performance - * - `p` is parallelization factor (1 is common) - * - `dkLen` is output key length in bytes e.g. 32. - * - `asyncTick` - (default: 10) max time in ms for which async function can block execution - * - `maxmem` - (default: `1024 ** 3 + 1024` aka 1GB+1KB). A limit that the app could use for scrypt - * - `onProgress` - callback function that would be executed for progress report - * @returns Derived key - * @example - * scrypt('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 }); - */ -export function scrypt(password: KDFInput, salt: KDFInput, opts: ScryptOpts): Uint8Array { - const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb } = scryptInit( - password, - salt, - opts - ); - swap32IfBE(B32); - for (let pi = 0; pi < p; pi++) { - const Pi = blockSize32 * pi; - for (let i = 0; i < blockSize32; i++) V[i] = B32[Pi + i]; // V[0] = B[i] - for (let i = 0, pos = 0; i < N - 1; i++) { - BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]); - blockMixCb(); - } - BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element - blockMixCb(); - for (let i = 0; i < N; i++) { - // First u32 of the last 64-byte block (u32 is LE) - const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations - for (let k = 0; k < blockSize32; k++) tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j] - BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) - blockMixCb(); - } - } - swap32IfBE(B32); - return scryptOutput(password, dkLen, B, V, tmp); -} - -/** - * Scrypt KDF from RFC 7914. Async version. - * @example - * await scryptAsync('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 }); - */ -export async function scryptAsync( - password: KDFInput, - salt: KDFInput, - opts: ScryptOpts -): Promise { - const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick } = scryptInit( - password, - salt, - opts - ); - swap32IfBE(B32); - for (let pi = 0; pi < p; pi++) { - const Pi = blockSize32 * pi; - for (let i = 0; i < blockSize32; i++) V[i] = B32[Pi + i]; // V[0] = B[i] - let pos = 0; - await asyncLoop(N - 1, asyncTick, () => { - BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]); - blockMixCb(); - }); - BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element - blockMixCb(); - await asyncLoop(N, asyncTick, () => { - // First u32 of the last 64-byte block (u32 is LE) - const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations - for (let k = 0; k < blockSize32; k++) tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j] - BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) - blockMixCb(); - }); - } - swap32IfBE(B32); - return scryptOutput(password, dkLen, B, V, tmp); -} diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/src/sha1.ts b/tools/mnemonic-test/node_modules/@noble/hashes/src/sha1.ts deleted file mode 100644 index 9a18822c..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/src/sha1.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * SHA1 (RFC 3174) legacy hash function. - * @module - * @deprecated - */ -import { SHA1 as SHA1n, sha1 as sha1n } from './legacy.ts'; -/** @deprecated Use import from `noble/hashes/legacy` module */ -export const SHA1: typeof SHA1n = SHA1n; -/** @deprecated Use import from `noble/hashes/legacy` module */ -export const sha1: typeof sha1n = sha1n; diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/src/sha2.ts b/tools/mnemonic-test/node_modules/@noble/hashes/src/sha2.ts deleted file mode 100644 index 7f1e722e..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/src/sha2.ts +++ /dev/null @@ -1,402 +0,0 @@ -/** - * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256. - * SHA256 is the fastest hash implementable in JS, even faster than Blake3. - * Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and - * [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf). - * @module - */ -import { Chi, HashMD, Maj, SHA224_IV, SHA256_IV, SHA384_IV, SHA512_IV } from './_md.ts'; -import * as u64 from './_u64.ts'; -import { type CHash, clean, createHasher, rotr } from './utils.ts'; - -/** - * Round constants: - * First 32 bits of fractional parts of the cube roots of the first 64 primes 2..311) - */ -// prettier-ignore -const SHA256_K = /* @__PURE__ */ Uint32Array.from([ - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 -]); - -/** Reusable temporary buffer. "W" comes straight from spec. */ -const SHA256_W = /* @__PURE__ */ new Uint32Array(64); -export class SHA256 extends HashMD { - // We cannot use array here since array allows indexing by variable - // which means optimizer/compiler cannot use registers. - protected A: number = SHA256_IV[0] | 0; - protected B: number = SHA256_IV[1] | 0; - protected C: number = SHA256_IV[2] | 0; - protected D: number = SHA256_IV[3] | 0; - protected E: number = SHA256_IV[4] | 0; - protected F: number = SHA256_IV[5] | 0; - protected G: number = SHA256_IV[6] | 0; - protected H: number = SHA256_IV[7] | 0; - - constructor(outputLen: number = 32) { - super(64, outputLen, 8, false); - } - protected get(): [number, number, number, number, number, number, number, number] { - const { A, B, C, D, E, F, G, H } = this; - return [A, B, C, D, E, F, G, H]; - } - // prettier-ignore - protected set( - A: number, B: number, C: number, D: number, E: number, F: number, G: number, H: number - ): void { - this.A = A | 0; - this.B = B | 0; - this.C = C | 0; - this.D = D | 0; - this.E = E | 0; - this.F = F | 0; - this.G = G | 0; - this.H = H | 0; - } - protected process(view: DataView, offset: number): void { - // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array - for (let i = 0; i < 16; i++, offset += 4) SHA256_W[i] = view.getUint32(offset, false); - for (let i = 16; i < 64; i++) { - const W15 = SHA256_W[i - 15]; - const W2 = SHA256_W[i - 2]; - const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3); - const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10); - SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0; - } - // Compression function main loop, 64 rounds - let { A, B, C, D, E, F, G, H } = this; - for (let i = 0; i < 64; i++) { - const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25); - const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; - const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22); - const T2 = (sigma0 + Maj(A, B, C)) | 0; - H = G; - G = F; - F = E; - E = (D + T1) | 0; - D = C; - C = B; - B = A; - A = (T1 + T2) | 0; - } - // Add the compressed chunk to the current hash value - A = (A + this.A) | 0; - B = (B + this.B) | 0; - C = (C + this.C) | 0; - D = (D + this.D) | 0; - E = (E + this.E) | 0; - F = (F + this.F) | 0; - G = (G + this.G) | 0; - H = (H + this.H) | 0; - this.set(A, B, C, D, E, F, G, H); - } - protected roundClean(): void { - clean(SHA256_W); - } - destroy(): void { - this.set(0, 0, 0, 0, 0, 0, 0, 0); - clean(this.buffer); - } -} - -export class SHA224 extends SHA256 { - protected A: number = SHA224_IV[0] | 0; - protected B: number = SHA224_IV[1] | 0; - protected C: number = SHA224_IV[2] | 0; - protected D: number = SHA224_IV[3] | 0; - protected E: number = SHA224_IV[4] | 0; - protected F: number = SHA224_IV[5] | 0; - protected G: number = SHA224_IV[6] | 0; - protected H: number = SHA224_IV[7] | 0; - constructor() { - super(28); - } -} - -// SHA2-512 is slower than sha256 in js because u64 operations are slow. - -// Round contants -// First 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409 -// prettier-ignore -const K512 = /* @__PURE__ */ (() => u64.split([ - '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc', - '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118', - '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2', - '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694', - '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65', - '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5', - '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4', - '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70', - '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df', - '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b', - '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30', - '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8', - '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8', - '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3', - '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec', - '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b', - '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178', - '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b', - '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c', - '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817' -].map(n => BigInt(n))))(); -const SHA512_Kh = /* @__PURE__ */ (() => K512[0])(); -const SHA512_Kl = /* @__PURE__ */ (() => K512[1])(); - -// Reusable temporary buffers -const SHA512_W_H = /* @__PURE__ */ new Uint32Array(80); -const SHA512_W_L = /* @__PURE__ */ new Uint32Array(80); - -export class SHA512 extends HashMD { - // We cannot use array here since array allows indexing by variable - // which means optimizer/compiler cannot use registers. - // h -- high 32 bits, l -- low 32 bits - protected Ah: number = SHA512_IV[0] | 0; - protected Al: number = SHA512_IV[1] | 0; - protected Bh: number = SHA512_IV[2] | 0; - protected Bl: number = SHA512_IV[3] | 0; - protected Ch: number = SHA512_IV[4] | 0; - protected Cl: number = SHA512_IV[5] | 0; - protected Dh: number = SHA512_IV[6] | 0; - protected Dl: number = SHA512_IV[7] | 0; - protected Eh: number = SHA512_IV[8] | 0; - protected El: number = SHA512_IV[9] | 0; - protected Fh: number = SHA512_IV[10] | 0; - protected Fl: number = SHA512_IV[11] | 0; - protected Gh: number = SHA512_IV[12] | 0; - protected Gl: number = SHA512_IV[13] | 0; - protected Hh: number = SHA512_IV[14] | 0; - protected Hl: number = SHA512_IV[15] | 0; - - constructor(outputLen: number = 64) { - super(128, outputLen, 16, false); - } - // prettier-ignore - protected get(): [ - number, number, number, number, number, number, number, number, - number, number, number, number, number, number, number, number - ] { - const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; - return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl]; - } - // prettier-ignore - protected set( - Ah: number, Al: number, Bh: number, Bl: number, Ch: number, Cl: number, Dh: number, Dl: number, - Eh: number, El: number, Fh: number, Fl: number, Gh: number, Gl: number, Hh: number, Hl: number - ): void { - this.Ah = Ah | 0; - this.Al = Al | 0; - this.Bh = Bh | 0; - this.Bl = Bl | 0; - this.Ch = Ch | 0; - this.Cl = Cl | 0; - this.Dh = Dh | 0; - this.Dl = Dl | 0; - this.Eh = Eh | 0; - this.El = El | 0; - this.Fh = Fh | 0; - this.Fl = Fl | 0; - this.Gh = Gh | 0; - this.Gl = Gl | 0; - this.Hh = Hh | 0; - this.Hl = Hl | 0; - } - protected process(view: DataView, offset: number): void { - // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array - for (let i = 0; i < 16; i++, offset += 4) { - SHA512_W_H[i] = view.getUint32(offset); - SHA512_W_L[i] = view.getUint32((offset += 4)); - } - for (let i = 16; i < 80; i++) { - // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7) - const W15h = SHA512_W_H[i - 15] | 0; - const W15l = SHA512_W_L[i - 15] | 0; - const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7); - const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7); - // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6) - const W2h = SHA512_W_H[i - 2] | 0; - const W2l = SHA512_W_L[i - 2] | 0; - const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6); - const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6); - // SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16]; - const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]); - const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]); - SHA512_W_H[i] = SUMh | 0; - SHA512_W_L[i] = SUMl | 0; - } - let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; - // Compression function main loop, 80 rounds - for (let i = 0; i < 80; i++) { - // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41) - const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41); - const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41); - //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; - const CHIh = (Eh & Fh) ^ (~Eh & Gh); - const CHIl = (El & Fl) ^ (~El & Gl); - // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i] - // prettier-ignore - const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]); - const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]); - const T1l = T1ll | 0; - // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39) - const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39); - const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39); - const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch); - const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl); - Hh = Gh | 0; - Hl = Gl | 0; - Gh = Fh | 0; - Gl = Fl | 0; - Fh = Eh | 0; - Fl = El | 0; - ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0)); - Dh = Ch | 0; - Dl = Cl | 0; - Ch = Bh | 0; - Cl = Bl | 0; - Bh = Ah | 0; - Bl = Al | 0; - const All = u64.add3L(T1l, sigma0l, MAJl); - Ah = u64.add3H(All, T1h, sigma0h, MAJh); - Al = All | 0; - } - // Add the compressed chunk to the current hash value - ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0)); - ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0)); - ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0)); - ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0)); - ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0)); - ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0)); - ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0)); - ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0)); - this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl); - } - protected roundClean(): void { - clean(SHA512_W_H, SHA512_W_L); - } - destroy(): void { - clean(this.buffer); - this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - } -} - -export class SHA384 extends SHA512 { - protected Ah: number = SHA384_IV[0] | 0; - protected Al: number = SHA384_IV[1] | 0; - protected Bh: number = SHA384_IV[2] | 0; - protected Bl: number = SHA384_IV[3] | 0; - protected Ch: number = SHA384_IV[4] | 0; - protected Cl: number = SHA384_IV[5] | 0; - protected Dh: number = SHA384_IV[6] | 0; - protected Dl: number = SHA384_IV[7] | 0; - protected Eh: number = SHA384_IV[8] | 0; - protected El: number = SHA384_IV[9] | 0; - protected Fh: number = SHA384_IV[10] | 0; - protected Fl: number = SHA384_IV[11] | 0; - protected Gh: number = SHA384_IV[12] | 0; - protected Gl: number = SHA384_IV[13] | 0; - protected Hh: number = SHA384_IV[14] | 0; - protected Hl: number = SHA384_IV[15] | 0; - - constructor() { - super(48); - } -} - -/** - * Truncated SHA512/256 and SHA512/224. - * SHA512_IV is XORed with 0xa5a5a5a5a5a5a5a5, then used as "intermediary" IV of SHA512/t. - * Then t hashes string to produce result IV. - * See `test/misc/sha2-gen-iv.js`. - */ - -/** SHA512/224 IV */ -const T224_IV = /* @__PURE__ */ Uint32Array.from([ - 0x8c3d37c8, 0x19544da2, 0x73e19966, 0x89dcd4d6, 0x1dfab7ae, 0x32ff9c82, 0x679dd514, 0x582f9fcf, - 0x0f6d2b69, 0x7bd44da8, 0x77e36f73, 0x04c48942, 0x3f9d85a8, 0x6a1d36c8, 0x1112e6ad, 0x91d692a1, -]); - -/** SHA512/256 IV */ -const T256_IV = /* @__PURE__ */ Uint32Array.from([ - 0x22312194, 0xfc2bf72c, 0x9f555fa3, 0xc84c64c2, 0x2393b86b, 0x6f53b151, 0x96387719, 0x5940eabd, - 0x96283ee2, 0xa88effe3, 0xbe5e1e25, 0x53863992, 0x2b0199fc, 0x2c85b8aa, 0x0eb72ddc, 0x81c52ca2, -]); - -export class SHA512_224 extends SHA512 { - protected Ah: number = T224_IV[0] | 0; - protected Al: number = T224_IV[1] | 0; - protected Bh: number = T224_IV[2] | 0; - protected Bl: number = T224_IV[3] | 0; - protected Ch: number = T224_IV[4] | 0; - protected Cl: number = T224_IV[5] | 0; - protected Dh: number = T224_IV[6] | 0; - protected Dl: number = T224_IV[7] | 0; - protected Eh: number = T224_IV[8] | 0; - protected El: number = T224_IV[9] | 0; - protected Fh: number = T224_IV[10] | 0; - protected Fl: number = T224_IV[11] | 0; - protected Gh: number = T224_IV[12] | 0; - protected Gl: number = T224_IV[13] | 0; - protected Hh: number = T224_IV[14] | 0; - protected Hl: number = T224_IV[15] | 0; - - constructor() { - super(28); - } -} - -export class SHA512_256 extends SHA512 { - protected Ah: number = T256_IV[0] | 0; - protected Al: number = T256_IV[1] | 0; - protected Bh: number = T256_IV[2] | 0; - protected Bl: number = T256_IV[3] | 0; - protected Ch: number = T256_IV[4] | 0; - protected Cl: number = T256_IV[5] | 0; - protected Dh: number = T256_IV[6] | 0; - protected Dl: number = T256_IV[7] | 0; - protected Eh: number = T256_IV[8] | 0; - protected El: number = T256_IV[9] | 0; - protected Fh: number = T256_IV[10] | 0; - protected Fl: number = T256_IV[11] | 0; - protected Gh: number = T256_IV[12] | 0; - protected Gl: number = T256_IV[13] | 0; - protected Hh: number = T256_IV[14] | 0; - protected Hl: number = T256_IV[15] | 0; - - constructor() { - super(32); - } -} - -/** - * SHA2-256 hash function from RFC 4634. - * - * It is the fastest JS hash, even faster than Blake3. - * To break sha256 using birthday attack, attackers need to try 2^128 hashes. - * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025. - */ -export const sha256: CHash = /* @__PURE__ */ createHasher(() => new SHA256()); -/** SHA2-224 hash function from RFC 4634 */ -export const sha224: CHash = /* @__PURE__ */ createHasher(() => new SHA224()); - -/** SHA2-512 hash function from RFC 4634. */ -export const sha512: CHash = /* @__PURE__ */ createHasher(() => new SHA512()); -/** SHA2-384 hash function from RFC 4634. */ -export const sha384: CHash = /* @__PURE__ */ createHasher(() => new SHA384()); - -/** - * SHA2-512/256 "truncated" hash function, with improved resistance to length extension attacks. - * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf). - */ -export const sha512_256: CHash = /* @__PURE__ */ createHasher(() => new SHA512_256()); -/** - * SHA2-512/224 "truncated" hash function, with improved resistance to length extension attacks. - * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf). - */ -export const sha512_224: CHash = /* @__PURE__ */ createHasher(() => new SHA512_224()); diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/src/sha256.ts b/tools/mnemonic-test/node_modules/@noble/hashes/src/sha256.ts deleted file mode 100644 index 61ea0eb2..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/src/sha256.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * SHA2-256 a.k.a. sha256. In JS, it is the fastest hash, even faster than Blake3. - * - * To break sha256 using birthday attack, attackers need to try 2^128 hashes. - * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025. - * - * Check out [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf). - * @module - * @deprecated - */ -import { - SHA224 as SHA224n, - sha224 as sha224n, - SHA256 as SHA256n, - sha256 as sha256n, -} from './sha2.ts'; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export const SHA256: typeof SHA256n = SHA256n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export const sha256: typeof sha256n = sha256n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export const SHA224: typeof SHA224n = SHA224n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export const sha224: typeof sha224n = sha224n; diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/src/sha3-addons.ts b/tools/mnemonic-test/node_modules/@noble/hashes/src/sha3-addons.ts deleted file mode 100644 index 724a769c..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/src/sha3-addons.ts +++ /dev/null @@ -1,499 +0,0 @@ -/** - * SHA3 (keccak) addons. - * - * * Full [NIST SP 800-185](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-185.pdf): - * cSHAKE, KMAC, TupleHash, ParallelHash + XOF variants - * * Reduced-round Keccak [(draft)](https://datatracker.ietf.org/doc/draft-irtf-cfrg-kangarootwelve/): - * * 🦘 K12 aka KangarooTwelve - * * M14 aka MarsupilamiFourteen - * * TurboSHAKE - * * KeccakPRG: Pseudo-random generator based on Keccak [(pdf)](https://keccak.team/files/CSF-0.1.pdf) - * @module - */ -import { Keccak, type ShakeOpts } from './sha3.ts'; -import { - abytes, - anumber, - type CHashO, - type CHashXO, - createOptHasher, - createXOFer, - Hash, - type HashXOF, - type Input, - toBytes, - u32, -} from './utils.ts'; - -// cSHAKE && KMAC (NIST SP800-185) -const _8n = BigInt(8); -const _ffn = BigInt(0xff); - -// NOTE: it is safe to use bigints here, since they used only for length encoding (not actual data). -// We use bigints in sha256 for lengths too. -function leftEncode(n: number | bigint): Uint8Array { - n = BigInt(n); - const res = [Number(n & _ffn)]; - n >>= _8n; - for (; n > 0; n >>= _8n) res.unshift(Number(n & _ffn)); - res.unshift(res.length); - return new Uint8Array(res); -} - -function rightEncode(n: number | bigint): Uint8Array { - n = BigInt(n); - const res = [Number(n & _ffn)]; - n >>= _8n; - for (; n > 0; n >>= _8n) res.unshift(Number(n & _ffn)); - res.push(res.length); - return new Uint8Array(res); -} - -function chooseLen(opts: ShakeOpts, outputLen: number): number { - return opts.dkLen === undefined ? outputLen : opts.dkLen; -} - -const abytesOrZero = (buf?: Input) => { - if (buf === undefined) return Uint8Array.of(); - return toBytes(buf); -}; -// NOTE: second modulo is necessary since we don't need to add padding if current element takes whole block -const getPadding = (len: number, block: number) => new Uint8Array((block - (len % block)) % block); -export type cShakeOpts = ShakeOpts & { personalization?: Input; NISTfn?: Input }; - -// Personalization -function cshakePers(hash: Keccak, opts: cShakeOpts = {}): Keccak { - if (!opts || (!opts.personalization && !opts.NISTfn)) return hash; - // Encode and pad inplace to avoid unneccesary memory copies/slices (so we don't need to zero them later) - // bytepad(encode_string(N) || encode_string(S), 168) - const blockLenBytes = leftEncode(hash.blockLen); - const fn = abytesOrZero(opts.NISTfn); - const fnLen = leftEncode(_8n * BigInt(fn.length)); // length in bits - const pers = abytesOrZero(opts.personalization); - const persLen = leftEncode(_8n * BigInt(pers.length)); // length in bits - if (!fn.length && !pers.length) return hash; - hash.suffix = 0x04; - hash.update(blockLenBytes).update(fnLen).update(fn).update(persLen).update(pers); - let totalLen = blockLenBytes.length + fnLen.length + fn.length + persLen.length + pers.length; - hash.update(getPadding(totalLen, hash.blockLen)); - return hash; -} - -const gencShake = (suffix: number, blockLen: number, outputLen: number) => - createXOFer((opts: cShakeOpts = {}) => - cshakePers(new Keccak(blockLen, suffix, chooseLen(opts, outputLen), true), opts) - ); - -// TODO: refactor -export type ICShake = { - (msg: Input, opts?: cShakeOpts): Uint8Array; - outputLen: number; - blockLen: number; - create(opts: cShakeOpts): HashXOF; -}; -export type ITupleHash = { - (messages: Input[], opts?: cShakeOpts): Uint8Array; - create(opts?: cShakeOpts): TupleHash; -}; -export type IParHash = { - (message: Input, opts?: ParallelOpts): Uint8Array; - create(opts?: ParallelOpts): ParallelHash; -}; -export const cshake128: ICShake = /* @__PURE__ */ (() => gencShake(0x1f, 168, 128 / 8))(); -export const cshake256: ICShake = /* @__PURE__ */ (() => gencShake(0x1f, 136, 256 / 8))(); - -export class KMAC extends Keccak implements HashXOF { - constructor( - blockLen: number, - outputLen: number, - enableXOF: boolean, - key: Input, - opts: cShakeOpts = {} - ) { - super(blockLen, 0x1f, outputLen, enableXOF); - cshakePers(this, { NISTfn: 'KMAC', personalization: opts.personalization }); - key = toBytes(key); - abytes(key); - // 1. newX = bytepad(encode_string(K), 168) || X || right_encode(L). - const blockLenBytes = leftEncode(this.blockLen); - const keyLen = leftEncode(_8n * BigInt(key.length)); - this.update(blockLenBytes).update(keyLen).update(key); - const totalLen = blockLenBytes.length + keyLen.length + key.length; - this.update(getPadding(totalLen, this.blockLen)); - } - protected finish(): void { - if (!this.finished) this.update(rightEncode(this.enableXOF ? 0 : _8n * BigInt(this.outputLen))); // outputLen in bits - super.finish(); - } - _cloneInto(to?: KMAC): KMAC { - // Create new instance without calling constructor since key already in state and we don't know it. - // Force "to" to be instance of KMAC instead of Sha3. - if (!to) { - to = Object.create(Object.getPrototypeOf(this), {}) as KMAC; - to.state = this.state.slice(); - to.blockLen = this.blockLen; - to.state32 = u32(to.state); - } - return super._cloneInto(to) as KMAC; - } - clone(): KMAC { - return this._cloneInto(); - } -} - -function genKmac(blockLen: number, outputLen: number, xof = false) { - const kmac = (key: Input, message: Input, opts?: cShakeOpts): Uint8Array => - kmac.create(key, opts).update(message).digest(); - kmac.create = (key: Input, opts: cShakeOpts = {}) => - new KMAC(blockLen, chooseLen(opts, outputLen), xof, key, opts); - return kmac; -} - -export const kmac128: { - (key: Input, message: Input, opts?: cShakeOpts): Uint8Array; - create(key: Input, opts?: cShakeOpts): KMAC; -} = /* @__PURE__ */ (() => genKmac(168, 128 / 8))(); -export const kmac256: { - (key: Input, message: Input, opts?: cShakeOpts): Uint8Array; - create(key: Input, opts?: cShakeOpts): KMAC; -} = /* @__PURE__ */ (() => genKmac(136, 256 / 8))(); -export const kmac128xof: { - (key: Input, message: Input, opts?: cShakeOpts): Uint8Array; - create(key: Input, opts?: cShakeOpts): KMAC; -} = /* @__PURE__ */ (() => genKmac(168, 128 / 8, true))(); -export const kmac256xof: { - (key: Input, message: Input, opts?: cShakeOpts): Uint8Array; - create(key: Input, opts?: cShakeOpts): KMAC; -} = /* @__PURE__ */ (() => genKmac(136, 256 / 8, true))(); - -// TupleHash -// Usage: tuple(['ab', 'cd']) != tuple(['a', 'bcd']) -export class TupleHash extends Keccak implements HashXOF { - constructor(blockLen: number, outputLen: number, enableXOF: boolean, opts: cShakeOpts = {}) { - super(blockLen, 0x1f, outputLen, enableXOF); - cshakePers(this, { NISTfn: 'TupleHash', personalization: opts.personalization }); - // Change update after cshake processed - this.update = (data: Input) => { - data = toBytes(data); - abytes(data); - super.update(leftEncode(_8n * BigInt(data.length))); - super.update(data); - return this; - }; - } - protected finish(): void { - if (!this.finished) - super.update(rightEncode(this.enableXOF ? 0 : _8n * BigInt(this.outputLen))); // outputLen in bits - super.finish(); - } - _cloneInto(to?: TupleHash): TupleHash { - to ||= new TupleHash(this.blockLen, this.outputLen, this.enableXOF); - return super._cloneInto(to) as TupleHash; - } - clone(): TupleHash { - return this._cloneInto(); - } -} - -function genTuple(blockLen: number, outputLen: number, xof = false) { - const tuple = (messages: Input[], opts?: cShakeOpts): Uint8Array => { - const h = tuple.create(opts); - for (const msg of messages) h.update(msg); - return h.digest(); - }; - tuple.create = (opts: cShakeOpts = {}) => - new TupleHash(blockLen, chooseLen(opts, outputLen), xof, opts); - return tuple; -} - -/** 128-bit TupleHASH. */ -export const tuplehash128: ITupleHash = /* @__PURE__ */ (() => genTuple(168, 128 / 8))(); -/** 256-bit TupleHASH. */ -export const tuplehash256: ITupleHash = /* @__PURE__ */ (() => genTuple(136, 256 / 8))(); -/** 128-bit TupleHASH XOF. */ -export const tuplehash128xof: ITupleHash = /* @__PURE__ */ (() => genTuple(168, 128 / 8, true))(); -/** 256-bit TupleHASH XOF. */ -export const tuplehash256xof: ITupleHash = /* @__PURE__ */ (() => genTuple(136, 256 / 8, true))(); - -// ParallelHash (same as K12/M14, but without speedup for inputs less 8kb, reduced number of rounds and more simple) -type ParallelOpts = cShakeOpts & { blockLen?: number }; - -export class ParallelHash extends Keccak implements HashXOF { - private leafHash?: Hash; - protected leafCons: () => Hash; - private chunkPos = 0; // Position of current block in chunk - private chunksDone = 0; // How many chunks we already have - private chunkLen: number; - constructor( - blockLen: number, - outputLen: number, - leafCons: () => Hash, - enableXOF: boolean, - opts: ParallelOpts = {} - ) { - super(blockLen, 0x1f, outputLen, enableXOF); - cshakePers(this, { NISTfn: 'ParallelHash', personalization: opts.personalization }); - this.leafCons = leafCons; - let { blockLen: B } = opts; - B ||= 8; - anumber(B); - this.chunkLen = B; - super.update(leftEncode(B)); - // Change update after cshake processed - this.update = (data: Input) => { - data = toBytes(data); - abytes(data); - const { chunkLen, leafCons } = this; - for (let pos = 0, len = data.length; pos < len; ) { - if (this.chunkPos == chunkLen || !this.leafHash) { - if (this.leafHash) { - super.update(this.leafHash.digest()); - this.chunksDone++; - } - this.leafHash = leafCons(); - this.chunkPos = 0; - } - const take = Math.min(chunkLen - this.chunkPos, len - pos); - this.leafHash.update(data.subarray(pos, pos + take)); - this.chunkPos += take; - pos += take; - } - return this; - }; - } - protected finish(): void { - if (this.finished) return; - if (this.leafHash) { - super.update(this.leafHash.digest()); - this.chunksDone++; - } - super.update(rightEncode(this.chunksDone)); - super.update(rightEncode(this.enableXOF ? 0 : _8n * BigInt(this.outputLen))); // outputLen in bits - super.finish(); - } - _cloneInto(to?: ParallelHash): ParallelHash { - to ||= new ParallelHash(this.blockLen, this.outputLen, this.leafCons, this.enableXOF); - if (this.leafHash) to.leafHash = this.leafHash._cloneInto(to.leafHash as Keccak); - to.chunkPos = this.chunkPos; - to.chunkLen = this.chunkLen; - to.chunksDone = this.chunksDone; - return super._cloneInto(to) as ParallelHash; - } - destroy(): void { - super.destroy.call(this); - if (this.leafHash) this.leafHash.destroy(); - } - clone(): ParallelHash { - return this._cloneInto(); - } -} - -function genPrl( - blockLen: number, - outputLen: number, - leaf: ReturnType, - xof = false -) { - const parallel = (message: Input, opts?: ParallelOpts): Uint8Array => - parallel.create(opts).update(message).digest(); - parallel.create = (opts: ParallelOpts = {}) => - new ParallelHash( - blockLen, - chooseLen(opts, outputLen), - () => leaf.create({ dkLen: 2 * outputLen }), - xof, - opts - ); - return parallel; -} - -/** 128-bit ParallelHash. In JS, it is not parallel. */ -export const parallelhash128: IParHash = /* @__PURE__ */ (() => genPrl(168, 128 / 8, cshake128))(); -/** 256-bit ParallelHash. In JS, it is not parallel. */ -export const parallelhash256: IParHash = /* @__PURE__ */ (() => genPrl(136, 256 / 8, cshake256))(); -/** 128-bit ParallelHash XOF. In JS, it is not parallel. */ -export const parallelhash128xof: IParHash = /* @__PURE__ */ (() => - genPrl(168, 128 / 8, cshake128, true))(); -/** 256-bit ParallelHash. In JS, it is not parallel. */ -export const parallelhash256xof: IParHash = /* @__PURE__ */ (() => - genPrl(136, 256 / 8, cshake256, true))(); - -// Should be simple 'shake with 12 rounds', but no, we got whole new spec about Turbo SHAKE Pro MAX. -export type TurboshakeOpts = ShakeOpts & { - D?: number; // Domain separation byte -}; - -const genTurboshake = (blockLen: number, outputLen: number) => - createXOFer, TurboshakeOpts>((opts: TurboshakeOpts = {}) => { - const D = opts.D === undefined ? 0x1f : opts.D; - // Section 2.1 of https://datatracker.ietf.org/doc/draft-irtf-cfrg-kangarootwelve/ - if (!Number.isSafeInteger(D) || D < 0x01 || D > 0x7f) - throw new Error('invalid domain separation byte must be 0x01..0x7f, got: ' + D); - return new Keccak(blockLen, D, opts.dkLen === undefined ? outputLen : opts.dkLen, true, 12); - }); - -/** TurboSHAKE 128-bit: reduced 12-round keccak. */ -export const turboshake128: CHashXO = /* @__PURE__ */ genTurboshake(168, 256 / 8); -/** TurboSHAKE 256-bit: reduced 12-round keccak. */ -export const turboshake256: CHashXO = /* @__PURE__ */ genTurboshake(136, 512 / 8); - -// Kangaroo -// Same as NIST rightEncode, but returns [0] for zero string -function rightEncodeK12(n: number | bigint): Uint8Array { - n = BigInt(n); - const res: number[] = []; - for (; n > 0; n >>= _8n) res.unshift(Number(n & _ffn)); - res.push(res.length); - return Uint8Array.from(res); -} - -export type KangarooOpts = { dkLen?: number; personalization?: Input }; -const EMPTY_BUFFER = /* @__PURE__ */ Uint8Array.of(); - -export class KangarooTwelve extends Keccak implements HashXOF { - readonly chunkLen = 8192; - private leafHash?: Keccak; - protected leafLen: number; - private personalization: Uint8Array; - private chunkPos = 0; // Position of current block in chunk - private chunksDone = 0; // How many chunks we already have - constructor( - blockLen: number, - leafLen: number, - outputLen: number, - rounds: number, - opts: KangarooOpts - ) { - super(blockLen, 0x07, outputLen, true, rounds); - this.leafLen = leafLen; - this.personalization = abytesOrZero(opts.personalization); - } - update(data: Input): this { - data = toBytes(data); - abytes(data); - const { chunkLen, blockLen, leafLen, rounds } = this; - for (let pos = 0, len = data.length; pos < len; ) { - if (this.chunkPos == chunkLen) { - if (this.leafHash) super.update(this.leafHash.digest()); - else { - this.suffix = 0x06; // Its safe to change suffix here since its used only in digest() - super.update(Uint8Array.from([3, 0, 0, 0, 0, 0, 0, 0])); - } - this.leafHash = new Keccak(blockLen, 0x0b, leafLen, false, rounds); - this.chunksDone++; - this.chunkPos = 0; - } - const take = Math.min(chunkLen - this.chunkPos, len - pos); - const chunk = data.subarray(pos, pos + take); - if (this.leafHash) this.leafHash.update(chunk); - else super.update(chunk); - this.chunkPos += take; - pos += take; - } - return this; - } - protected finish(): void { - if (this.finished) return; - const { personalization } = this; - this.update(personalization).update(rightEncodeK12(personalization.length)); - // Leaf hash - if (this.leafHash) { - super.update(this.leafHash.digest()); - super.update(rightEncodeK12(this.chunksDone)); - super.update(Uint8Array.from([0xff, 0xff])); - } - super.finish.call(this); - } - destroy(): void { - super.destroy.call(this); - if (this.leafHash) this.leafHash.destroy(); - // We cannot zero personalization buffer since it is user provided and we don't want to mutate user input - this.personalization = EMPTY_BUFFER; - } - _cloneInto(to?: KangarooTwelve): KangarooTwelve { - const { blockLen, leafLen, leafHash, outputLen, rounds } = this; - to ||= new KangarooTwelve(blockLen, leafLen, outputLen, rounds, {}); - super._cloneInto(to); - if (leafHash) to.leafHash = leafHash._cloneInto(to.leafHash); - to.personalization.set(this.personalization); - to.leafLen = this.leafLen; - to.chunkPos = this.chunkPos; - to.chunksDone = this.chunksDone; - return to; - } - clone(): KangarooTwelve { - return this._cloneInto(); - } -} -/** KangarooTwelve: reduced 12-round keccak. */ -export const k12: CHashO = /* @__PURE__ */ (() => - createOptHasher( - (opts: KangarooOpts = {}) => new KangarooTwelve(168, 32, chooseLen(opts, 32), 12, opts) - ))(); -/** MarsupilamiFourteen: reduced 14-round keccak. */ -export const m14: CHashO = /* @__PURE__ */ (() => - createOptHasher( - (opts: KangarooOpts = {}) => new KangarooTwelve(136, 64, chooseLen(opts, 64), 14, opts) - ))(); - -/** - * More at https://github.com/XKCP/XKCP/tree/master/lib/high/Keccak/PRG. - */ -export class KeccakPRG extends Keccak { - protected rate: number; - constructor(capacity: number) { - anumber(capacity); - // Rho should be full bytes - if (capacity < 0 || capacity > 1600 - 10 || (1600 - capacity - 2) % 8) - throw new Error('invalid capacity'); - // blockLen = rho in bytes - super((1600 - capacity - 2) / 8, 0, 0, true); - this.rate = 1600 - capacity; - this.posOut = Math.floor((this.rate + 7) / 8); - } - keccak(): void { - // Duplex padding - this.state[this.pos] ^= 0x01; - this.state[this.blockLen] ^= 0x02; // Rho is full bytes - super.keccak(); - this.pos = 0; - this.posOut = 0; - } - update(data: Input): this { - super.update(data); - this.posOut = this.blockLen; - return this; - } - feed(data: Input): this { - return this.update(data); - } - protected finish(): void {} - digestInto(_out: Uint8Array): Uint8Array { - throw new Error('digest is not allowed, use .fetch instead'); - } - fetch(bytes: number): Uint8Array { - return this.xof(bytes); - } - // Ensure irreversibility (even if state leaked previous outputs cannot be computed) - forget(): void { - if (this.rate < 1600 / 2 + 1) throw new Error('rate is too low to use .forget()'); - this.keccak(); - for (let i = 0; i < this.blockLen; i++) this.state[i] = 0; - this.pos = this.blockLen; - this.keccak(); - this.posOut = this.blockLen; - } - _cloneInto(to?: KeccakPRG): KeccakPRG { - const { rate } = this; - to ||= new KeccakPRG(1600 - rate); - super._cloneInto(to); - to.rate = rate; - return to; - } - clone(): KeccakPRG { - return this._cloneInto(); - } -} - -/** KeccakPRG: Pseudo-random generator based on Keccak. https://keccak.team/files/CSF-0.1.pdf */ -export const keccakprg = (capacity = 254): KeccakPRG => new KeccakPRG(capacity); diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/src/sha3.ts b/tools/mnemonic-test/node_modules/@noble/hashes/src/sha3.ts deleted file mode 100644 index bb7b6763..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/src/sha3.ts +++ /dev/null @@ -1,258 +0,0 @@ -/** - * SHA3 (keccak) hash function, based on a new "Sponge function" design. - * Different from older hashes, the internal state is bigger than output size. - * - * Check out [FIPS-202](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf), - * [Website](https://keccak.team/keccak.html), - * [the differences between SHA-3 and Keccak](https://crypto.stackexchange.com/questions/15727/what-are-the-key-differences-between-the-draft-sha-3-standard-and-the-keccak-sub). - * - * Check out `sha3-addons` module for cSHAKE, k12, and others. - * @module - */ -import { rotlBH, rotlBL, rotlSH, rotlSL, split } from './_u64.ts'; -// prettier-ignore -import { - abytes, aexists, anumber, aoutput, - clean, createHasher, createXOFer, Hash, - swap32IfBE, - toBytes, u32, - type CHash, type CHashXO, type HashXOF, type Input -} from './utils.ts'; - -// No __PURE__ annotations in sha3 header: -// EVERYTHING is in fact used on every export. -// Various per round constants calculations -const _0n = BigInt(0); -const _1n = BigInt(1); -const _2n = BigInt(2); -const _7n = BigInt(7); -const _256n = BigInt(256); -const _0x71n = BigInt(0x71); -const SHA3_PI: number[] = []; -const SHA3_ROTL: number[] = []; -const _SHA3_IOTA: bigint[] = []; -for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) { - // Pi - [x, y] = [y, (2 * x + 3 * y) % 5]; - SHA3_PI.push(2 * (5 * y + x)); - // Rotational - SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64); - // Iota - let t = _0n; - for (let j = 0; j < 7; j++) { - R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n; - if (R & _2n) t ^= _1n << ((_1n << /* @__PURE__ */ BigInt(j)) - _1n); - } - _SHA3_IOTA.push(t); -} -const IOTAS = split(_SHA3_IOTA, true); -const SHA3_IOTA_H = IOTAS[0]; -const SHA3_IOTA_L = IOTAS[1]; - -// Left rotation (without 0, 32, 64) -const rotlH = (h: number, l: number, s: number) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s)); -const rotlL = (h: number, l: number, s: number) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s)); - -/** `keccakf1600` internal function, additionally allows to adjust round count. */ -export function keccakP(s: Uint32Array, rounds: number = 24): void { - const B = new Uint32Array(5 * 2); - // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js) - for (let round = 24 - rounds; round < 24; round++) { - // Theta θ - for (let x = 0; x < 10; x++) B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40]; - for (let x = 0; x < 10; x += 2) { - const idx1 = (x + 8) % 10; - const idx0 = (x + 2) % 10; - const B0 = B[idx0]; - const B1 = B[idx0 + 1]; - const Th = rotlH(B0, B1, 1) ^ B[idx1]; - const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1]; - for (let y = 0; y < 50; y += 10) { - s[x + y] ^= Th; - s[x + y + 1] ^= Tl; - } - } - // Rho (ρ) and Pi (π) - let curH = s[2]; - let curL = s[3]; - for (let t = 0; t < 24; t++) { - const shift = SHA3_ROTL[t]; - const Th = rotlH(curH, curL, shift); - const Tl = rotlL(curH, curL, shift); - const PI = SHA3_PI[t]; - curH = s[PI]; - curL = s[PI + 1]; - s[PI] = Th; - s[PI + 1] = Tl; - } - // Chi (χ) - for (let y = 0; y < 50; y += 10) { - for (let x = 0; x < 10; x++) B[x] = s[y + x]; - for (let x = 0; x < 10; x++) s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10]; - } - // Iota (ι) - s[0] ^= SHA3_IOTA_H[round]; - s[1] ^= SHA3_IOTA_L[round]; - } - clean(B); -} - -/** Keccak sponge function. */ -export class Keccak extends Hash implements HashXOF { - protected state: Uint8Array; - protected pos = 0; - protected posOut = 0; - protected finished = false; - protected state32: Uint32Array; - protected destroyed = false; - - public blockLen: number; - public suffix: number; - public outputLen: number; - protected enableXOF = false; - protected rounds: number; - - // NOTE: we accept arguments in bytes instead of bits here. - constructor( - blockLen: number, - suffix: number, - outputLen: number, - enableXOF = false, - rounds: number = 24 - ) { - super(); - this.blockLen = blockLen; - this.suffix = suffix; - this.outputLen = outputLen; - this.enableXOF = enableXOF; - this.rounds = rounds; - // Can be passed from user as dkLen - anumber(outputLen); - // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes - // 0 < blockLen < 200 - if (!(0 < blockLen && blockLen < 200)) - throw new Error('only keccak-f1600 function is supported'); - this.state = new Uint8Array(200); - this.state32 = u32(this.state); - } - clone(): Keccak { - return this._cloneInto(); - } - protected keccak(): void { - swap32IfBE(this.state32); - keccakP(this.state32, this.rounds); - swap32IfBE(this.state32); - this.posOut = 0; - this.pos = 0; - } - update(data: Input): this { - aexists(this); - data = toBytes(data); - abytes(data); - const { blockLen, state } = this; - const len = data.length; - for (let pos = 0; pos < len; ) { - const take = Math.min(blockLen - this.pos, len - pos); - for (let i = 0; i < take; i++) state[this.pos++] ^= data[pos++]; - if (this.pos === blockLen) this.keccak(); - } - return this; - } - protected finish(): void { - if (this.finished) return; - this.finished = true; - const { state, suffix, pos, blockLen } = this; - // Do the padding - state[pos] ^= suffix; - if ((suffix & 0x80) !== 0 && pos === blockLen - 1) this.keccak(); - state[blockLen - 1] ^= 0x80; - this.keccak(); - } - protected writeInto(out: Uint8Array): Uint8Array { - aexists(this, false); - abytes(out); - this.finish(); - const bufferOut = this.state; - const { blockLen } = this; - for (let pos = 0, len = out.length; pos < len; ) { - if (this.posOut >= blockLen) this.keccak(); - const take = Math.min(blockLen - this.posOut, len - pos); - out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); - this.posOut += take; - pos += take; - } - return out; - } - xofInto(out: Uint8Array): Uint8Array { - // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF - if (!this.enableXOF) throw new Error('XOF is not possible for this instance'); - return this.writeInto(out); - } - xof(bytes: number): Uint8Array { - anumber(bytes); - return this.xofInto(new Uint8Array(bytes)); - } - digestInto(out: Uint8Array): Uint8Array { - aoutput(out, this); - if (this.finished) throw new Error('digest() was already called'); - this.writeInto(out); - this.destroy(); - return out; - } - digest(): Uint8Array { - return this.digestInto(new Uint8Array(this.outputLen)); - } - destroy(): void { - this.destroyed = true; - clean(this.state); - } - _cloneInto(to?: Keccak): Keccak { - const { blockLen, suffix, outputLen, rounds, enableXOF } = this; - to ||= new Keccak(blockLen, suffix, outputLen, enableXOF, rounds); - to.state32.set(this.state32); - to.pos = this.pos; - to.posOut = this.posOut; - to.finished = this.finished; - to.rounds = rounds; - // Suffix can change in cSHAKE - to.suffix = suffix; - to.outputLen = outputLen; - to.enableXOF = enableXOF; - to.destroyed = this.destroyed; - return to; - } -} - -const gen = (suffix: number, blockLen: number, outputLen: number) => - createHasher(() => new Keccak(blockLen, suffix, outputLen)); - -/** SHA3-224 hash function. */ -export const sha3_224: CHash = /* @__PURE__ */ (() => gen(0x06, 144, 224 / 8))(); -/** SHA3-256 hash function. Different from keccak-256. */ -export const sha3_256: CHash = /* @__PURE__ */ (() => gen(0x06, 136, 256 / 8))(); -/** SHA3-384 hash function. */ -export const sha3_384: CHash = /* @__PURE__ */ (() => gen(0x06, 104, 384 / 8))(); -/** SHA3-512 hash function. */ -export const sha3_512: CHash = /* @__PURE__ */ (() => gen(0x06, 72, 512 / 8))(); - -/** keccak-224 hash function. */ -export const keccak_224: CHash = /* @__PURE__ */ (() => gen(0x01, 144, 224 / 8))(); -/** keccak-256 hash function. Different from SHA3-256. */ -export const keccak_256: CHash = /* @__PURE__ */ (() => gen(0x01, 136, 256 / 8))(); -/** keccak-384 hash function. */ -export const keccak_384: CHash = /* @__PURE__ */ (() => gen(0x01, 104, 384 / 8))(); -/** keccak-512 hash function. */ -export const keccak_512: CHash = /* @__PURE__ */ (() => gen(0x01, 72, 512 / 8))(); - -export type ShakeOpts = { dkLen?: number }; - -const genShake = (suffix: number, blockLen: number, outputLen: number) => - createXOFer, ShakeOpts>( - (opts: ShakeOpts = {}) => - new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true) - ); - -/** SHAKE128 XOF with 128-bit security. */ -export const shake128: CHashXO = /* @__PURE__ */ (() => genShake(0x1f, 168, 128 / 8))(); -/** SHAKE256 XOF with 256-bit security. */ -export const shake256: CHashXO = /* @__PURE__ */ (() => genShake(0x1f, 136, 256 / 8))(); diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/src/sha512.ts b/tools/mnemonic-test/node_modules/@noble/hashes/src/sha512.ts deleted file mode 100644 index 15bd2523..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/src/sha512.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * SHA2-512 a.k.a. sha512 and sha384. It is slower than sha256 in js because u64 operations are slow. - * - * Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and - * [the paper on truncated SHA512/256](https://eprint.iacr.org/2010/548.pdf). - * @module - * @deprecated - */ -import { - SHA384 as SHA384n, - sha384 as sha384n, - sha512_224 as sha512_224n, - SHA512_224 as SHA512_224n, - sha512_256 as sha512_256n, - SHA512_256 as SHA512_256n, - SHA512 as SHA512n, - sha512 as sha512n, -} from './sha2.ts'; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export const SHA512: typeof SHA512n = SHA512n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export const sha512: typeof sha512n = sha512n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export const SHA384: typeof SHA384n = SHA384n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export const sha384: typeof sha384n = sha384n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export const SHA512_224: typeof SHA512_224n = SHA512_224n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export const sha512_224: typeof sha512_224n = sha512_224n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export const SHA512_256: typeof SHA512_256n = SHA512_256n; -/** @deprecated Use import from `noble/hashes/sha2` module */ -export const sha512_256: typeof sha512_256n = sha512_256n; diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/src/utils.ts b/tools/mnemonic-test/node_modules/@noble/hashes/src/utils.ts deleted file mode 100644 index 4c8a6798..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/src/utils.ts +++ /dev/null @@ -1,395 +0,0 @@ -/** - * Utilities for hex, bytes, CSPRNG. - * @module - */ -/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ - -// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+. -// node.js versions earlier than v19 don't declare it in global scope. -// For node.js, package.json#exports field mapping rewrites import -// from `crypto` to `cryptoNode`, which imports native module. -// Makes the utils un-importable in browsers without a bundler. -// Once node.js 18 is deprecated (2025-04-30), we can just drop the import. -import { crypto } from '@noble/hashes/crypto'; - -/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */ -export function isBytes(a: unknown): a is Uint8Array { - return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array'); -} - -/** Asserts something is positive integer. */ -export function anumber(n: number): void { - if (!Number.isSafeInteger(n) || n < 0) throw new Error('positive integer expected, got ' + n); -} - -/** Asserts something is Uint8Array. */ -export function abytes(b: Uint8Array | undefined, ...lengths: number[]): void { - if (!isBytes(b)) throw new Error('Uint8Array expected'); - if (lengths.length > 0 && !lengths.includes(b.length)) - throw new Error('Uint8Array expected of length ' + lengths + ', got length=' + b.length); -} - -/** Asserts something is hash */ -export function ahash(h: IHash): void { - if (typeof h !== 'function' || typeof h.create !== 'function') - throw new Error('Hash should be wrapped by utils.createHasher'); - anumber(h.outputLen); - anumber(h.blockLen); -} - -/** Asserts a hash instance has not been destroyed / finished */ -export function aexists(instance: any, checkFinished = true): void { - if (instance.destroyed) throw new Error('Hash instance has been destroyed'); - if (checkFinished && instance.finished) throw new Error('Hash#digest() has already been called'); -} - -/** Asserts output is properly-sized byte array */ -export function aoutput(out: any, instance: any): void { - abytes(out); - const min = instance.outputLen; - if (out.length < min) { - throw new Error('digestInto() expects output buffer of length at least ' + min); - } -} - -/** Generic type encompassing 8/16/32-byte arrays - but not 64-byte. */ -// prettier-ignore -export type TypedArray = Int8Array | Uint8ClampedArray | Uint8Array | - Uint16Array | Int16Array | Uint32Array | Int32Array; - -/** Cast u8 / u16 / u32 to u8. */ -export function u8(arr: TypedArray): Uint8Array { - return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength); -} - -/** Cast u8 / u16 / u32 to u32. */ -export function u32(arr: TypedArray): Uint32Array { - return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); -} - -/** Zeroize a byte array. Warning: JS provides no guarantees. */ -export function clean(...arrays: TypedArray[]): void { - for (let i = 0; i < arrays.length; i++) { - arrays[i].fill(0); - } -} - -/** Create DataView of an array for easy byte-level manipulation. */ -export function createView(arr: TypedArray): DataView { - return new DataView(arr.buffer, arr.byteOffset, arr.byteLength); -} - -/** The rotate right (circular right shift) operation for uint32 */ -export function rotr(word: number, shift: number): number { - return (word << (32 - shift)) | (word >>> shift); -} - -/** The rotate left (circular left shift) operation for uint32 */ -export function rotl(word: number, shift: number): number { - return (word << shift) | ((word >>> (32 - shift)) >>> 0); -} - -/** Is current platform little-endian? Most are. Big-Endian platform: IBM */ -export const isLE: boolean = /* @__PURE__ */ (() => - new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)(); - -/** The byte swap operation for uint32 */ -export function byteSwap(word: number): number { - return ( - ((word << 24) & 0xff000000) | - ((word << 8) & 0xff0000) | - ((word >>> 8) & 0xff00) | - ((word >>> 24) & 0xff) - ); -} -/** Conditionally byte swap if on a big-endian platform */ -export const swap8IfBE: (n: number) => number = isLE - ? (n: number) => n - : (n: number) => byteSwap(n); - -/** @deprecated */ -export const byteSwapIfBE: typeof swap8IfBE = swap8IfBE; -/** In place byte swap for Uint32Array */ -export function byteSwap32(arr: Uint32Array): Uint32Array { - for (let i = 0; i < arr.length; i++) { - arr[i] = byteSwap(arr[i]); - } - return arr; -} - -export const swap32IfBE: (u: Uint32Array) => Uint32Array = isLE - ? (u: Uint32Array) => u - : byteSwap32; - -// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex -const hasHexBuiltin: boolean = /* @__PURE__ */ (() => - // @ts-ignore - typeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function')(); - -// Array where index 0xf0 (240) is mapped to string 'f0' -const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => - i.toString(16).padStart(2, '0') -); - -/** - * Convert byte array to hex string. Uses built-in function, when available. - * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123' - */ -export function bytesToHex(bytes: Uint8Array): string { - abytes(bytes); - // @ts-ignore - if (hasHexBuiltin) return bytes.toHex(); - // pre-caching improves the speed 6x - let hex = ''; - for (let i = 0; i < bytes.length; i++) { - hex += hexes[bytes[i]]; - } - return hex; -} - -// We use optimized technique to convert hex string to byte array -const asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 } as const; -function asciiToBase16(ch: number): number | undefined { - if (ch >= asciis._0 && ch <= asciis._9) return ch - asciis._0; // '2' => 50-48 - if (ch >= asciis.A && ch <= asciis.F) return ch - (asciis.A - 10); // 'B' => 66-(65-10) - if (ch >= asciis.a && ch <= asciis.f) return ch - (asciis.a - 10); // 'b' => 98-(97-10) - return; -} - -/** - * Convert hex string to byte array. Uses built-in function, when available. - * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23]) - */ -export function hexToBytes(hex: string): Uint8Array { - if (typeof hex !== 'string') throw new Error('hex string expected, got ' + typeof hex); - // @ts-ignore - if (hasHexBuiltin) return Uint8Array.fromHex(hex); - const hl = hex.length; - const al = hl / 2; - if (hl % 2) throw new Error('hex string expected, got unpadded hex of length ' + hl); - const array = new Uint8Array(al); - for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) { - const n1 = asciiToBase16(hex.charCodeAt(hi)); - const n2 = asciiToBase16(hex.charCodeAt(hi + 1)); - if (n1 === undefined || n2 === undefined) { - const char = hex[hi] + hex[hi + 1]; - throw new Error('hex string expected, got non-hex character "' + char + '" at index ' + hi); - } - array[ai] = n1 * 16 + n2; // multiply first octet, e.g. 'a3' => 10*16+3 => 160 + 3 => 163 - } - return array; -} - -/** - * There is no setImmediate in browser and setTimeout is slow. - * Call of async fn will return Promise, which will be fullfiled only on - * next scheduler queue processing step and this is exactly what we need. - */ -export const nextTick = async (): Promise => {}; - -/** Returns control to thread each 'tick' ms to avoid blocking. */ -export async function asyncLoop( - iters: number, - tick: number, - cb: (i: number) => void -): Promise { - let ts = Date.now(); - for (let i = 0; i < iters; i++) { - cb(i); - // Date.now() is not monotonic, so in case if clock goes backwards we return return control too - const diff = Date.now() - ts; - if (diff >= 0 && diff < tick) continue; - await nextTick(); - ts += diff; - } -} - -// Global symbols, but ts doesn't see them: https://github.com/microsoft/TypeScript/issues/31535 -declare const TextEncoder: any; -declare const TextDecoder: any; - -/** - * Converts string to bytes using UTF8 encoding. - * @example utf8ToBytes('abc') // Uint8Array.from([97, 98, 99]) - */ -export function utf8ToBytes(str: string): Uint8Array { - if (typeof str !== 'string') throw new Error('string expected'); - return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809 -} - -/** - * Converts bytes to string using UTF8 encoding. - * @example bytesToUtf8(Uint8Array.from([97, 98, 99])) // 'abc' - */ -export function bytesToUtf8(bytes: Uint8Array): string { - return new TextDecoder().decode(bytes); -} - -/** Accepted input of hash functions. Strings are converted to byte arrays. */ -export type Input = string | Uint8Array; -/** - * Normalizes (non-hex) string or Uint8Array to Uint8Array. - * Warning: when Uint8Array is passed, it would NOT get copied. - * Keep in mind for future mutable operations. - */ -export function toBytes(data: Input): Uint8Array { - if (typeof data === 'string') data = utf8ToBytes(data); - abytes(data); - return data; -} - -/** KDFs can accept string or Uint8Array for user convenience. */ -export type KDFInput = string | Uint8Array; -/** - * Helper for KDFs: consumes uint8array or string. - * When string is passed, does utf8 decoding, using TextDecoder. - */ -export function kdfInputToBytes(data: KDFInput): Uint8Array { - if (typeof data === 'string') data = utf8ToBytes(data); - abytes(data); - return data; -} - -/** Copies several Uint8Arrays into one. */ -export function concatBytes(...arrays: Uint8Array[]): Uint8Array { - let sum = 0; - for (let i = 0; i < arrays.length; i++) { - const a = arrays[i]; - abytes(a); - sum += a.length; - } - const res = new Uint8Array(sum); - for (let i = 0, pad = 0; i < arrays.length; i++) { - const a = arrays[i]; - res.set(a, pad); - pad += a.length; - } - return res; -} - -type EmptyObj = {}; -export function checkOpts( - defaults: T1, - opts?: T2 -): T1 & T2 { - if (opts !== undefined && {}.toString.call(opts) !== '[object Object]') - throw new Error('options should be object or undefined'); - const merged = Object.assign(defaults, opts); - return merged as T1 & T2; -} - -/** Hash interface. */ -export type IHash = { - (data: Uint8Array): Uint8Array; - blockLen: number; - outputLen: number; - create: any; -}; - -/** For runtime check if class implements interface */ -export abstract class Hash> { - abstract blockLen: number; // Bytes per block - abstract outputLen: number; // Bytes in output - abstract update(buf: Input): this; - // Writes digest into buf - abstract digestInto(buf: Uint8Array): void; - abstract digest(): Uint8Array; - /** - * Resets internal state. Makes Hash instance unusable. - * Reset is impossible for keyed hashes if key is consumed into state. If digest is not consumed - * by user, they will need to manually call `destroy()` when zeroing is necessary. - */ - abstract destroy(): void; - /** - * Clones hash instance. Unsafe: doesn't check whether `to` is valid. Can be used as `clone()` - * when no options are passed. - * Reasons to use `_cloneInto` instead of clone: 1) performance 2) reuse instance => all internal - * buffers are overwritten => causes buffer overwrite which is used for digest in some cases. - * There are no guarantees for clean-up because it's impossible in JS. - */ - abstract _cloneInto(to?: T): T; - // Safe version that clones internal state - abstract clone(): T; -} - -/** - * XOF: streaming API to read digest in chunks. - * Same as 'squeeze' in keccak/k12 and 'seek' in blake3, but more generic name. - * When hash used in XOF mode it is up to user to call '.destroy' afterwards, since we cannot - * destroy state, next call can require more bytes. - */ -export type HashXOF> = Hash & { - xof(bytes: number): Uint8Array; // Read 'bytes' bytes from digest stream - xofInto(buf: Uint8Array): Uint8Array; // read buf.length bytes from digest stream into buf -}; - -/** Hash function */ -export type CHash = ReturnType; -/** Hash function with output */ -export type CHashO = ReturnType; -/** XOF with output */ -export type CHashXO = ReturnType; - -/** Wraps hash function, creating an interface on top of it */ -export function createHasher>( - hashCons: () => Hash -): { - (msg: Input): Uint8Array; - outputLen: number; - blockLen: number; - create(): Hash; -} { - const hashC = (msg: Input): Uint8Array => hashCons().update(toBytes(msg)).digest(); - const tmp = hashCons(); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = () => hashCons(); - return hashC; -} - -export function createOptHasher, T extends Object>( - hashCons: (opts?: T) => Hash -): { - (msg: Input, opts?: T): Uint8Array; - outputLen: number; - blockLen: number; - create(opts?: T): Hash; -} { - const hashC = (msg: Input, opts?: T): Uint8Array => hashCons(opts).update(toBytes(msg)).digest(); - const tmp = hashCons({} as T); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = (opts?: T) => hashCons(opts); - return hashC; -} - -export function createXOFer, T extends Object>( - hashCons: (opts?: T) => HashXOF -): { - (msg: Input, opts?: T): Uint8Array; - outputLen: number; - blockLen: number; - create(opts?: T): HashXOF; -} { - const hashC = (msg: Input, opts?: T): Uint8Array => hashCons(opts).update(toBytes(msg)).digest(); - const tmp = hashCons({} as T); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = (opts?: T) => hashCons(opts); - return hashC; -} -export const wrapConstructor: typeof createHasher = createHasher; -export const wrapConstructorWithOpts: typeof createOptHasher = createOptHasher; -export const wrapXOFConstructorWithOpts: typeof createXOFer = createXOFer; - -/** Cryptographically secure PRNG. Uses internal OS-level `crypto.getRandomValues`. */ -export function randomBytes(bytesLength = 32): Uint8Array { - if (crypto && typeof crypto.getRandomValues === 'function') { - return crypto.getRandomValues(new Uint8Array(bytesLength)); - } - // Legacy Node.js compatibility - if (crypto && typeof crypto.randomBytes === 'function') { - return Uint8Array.from(crypto.randomBytes(bytesLength)); - } - throw new Error('crypto.getRandomValues must be defined'); -} diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/utils.d.ts b/tools/mnemonic-test/node_modules/@noble/hashes/utils.d.ts deleted file mode 100644 index 90b8439b..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/utils.d.ts +++ /dev/null @@ -1,161 +0,0 @@ -/** - * Utilities for hex, bytes, CSPRNG. - * @module - */ -/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */ -export declare function isBytes(a: unknown): a is Uint8Array; -/** Asserts something is positive integer. */ -export declare function anumber(n: number): void; -/** Asserts something is Uint8Array. */ -export declare function abytes(b: Uint8Array | undefined, ...lengths: number[]): void; -/** Asserts something is hash */ -export declare function ahash(h: IHash): void; -/** Asserts a hash instance has not been destroyed / finished */ -export declare function aexists(instance: any, checkFinished?: boolean): void; -/** Asserts output is properly-sized byte array */ -export declare function aoutput(out: any, instance: any): void; -/** Generic type encompassing 8/16/32-byte arrays - but not 64-byte. */ -export type TypedArray = Int8Array | Uint8ClampedArray | Uint8Array | Uint16Array | Int16Array | Uint32Array | Int32Array; -/** Cast u8 / u16 / u32 to u8. */ -export declare function u8(arr: TypedArray): Uint8Array; -/** Cast u8 / u16 / u32 to u32. */ -export declare function u32(arr: TypedArray): Uint32Array; -/** Zeroize a byte array. Warning: JS provides no guarantees. */ -export declare function clean(...arrays: TypedArray[]): void; -/** Create DataView of an array for easy byte-level manipulation. */ -export declare function createView(arr: TypedArray): DataView; -/** The rotate right (circular right shift) operation for uint32 */ -export declare function rotr(word: number, shift: number): number; -/** The rotate left (circular left shift) operation for uint32 */ -export declare function rotl(word: number, shift: number): number; -/** Is current platform little-endian? Most are. Big-Endian platform: IBM */ -export declare const isLE: boolean; -/** The byte swap operation for uint32 */ -export declare function byteSwap(word: number): number; -/** Conditionally byte swap if on a big-endian platform */ -export declare const swap8IfBE: (n: number) => number; -/** @deprecated */ -export declare const byteSwapIfBE: typeof swap8IfBE; -/** In place byte swap for Uint32Array */ -export declare function byteSwap32(arr: Uint32Array): Uint32Array; -export declare const swap32IfBE: (u: Uint32Array) => Uint32Array; -/** - * Convert byte array to hex string. Uses built-in function, when available. - * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123' - */ -export declare function bytesToHex(bytes: Uint8Array): string; -/** - * Convert hex string to byte array. Uses built-in function, when available. - * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23]) - */ -export declare function hexToBytes(hex: string): Uint8Array; -/** - * There is no setImmediate in browser and setTimeout is slow. - * Call of async fn will return Promise, which will be fullfiled only on - * next scheduler queue processing step and this is exactly what we need. - */ -export declare const nextTick: () => Promise; -/** Returns control to thread each 'tick' ms to avoid blocking. */ -export declare function asyncLoop(iters: number, tick: number, cb: (i: number) => void): Promise; -/** - * Converts string to bytes using UTF8 encoding. - * @example utf8ToBytes('abc') // Uint8Array.from([97, 98, 99]) - */ -export declare function utf8ToBytes(str: string): Uint8Array; -/** - * Converts bytes to string using UTF8 encoding. - * @example bytesToUtf8(Uint8Array.from([97, 98, 99])) // 'abc' - */ -export declare function bytesToUtf8(bytes: Uint8Array): string; -/** Accepted input of hash functions. Strings are converted to byte arrays. */ -export type Input = string | Uint8Array; -/** - * Normalizes (non-hex) string or Uint8Array to Uint8Array. - * Warning: when Uint8Array is passed, it would NOT get copied. - * Keep in mind for future mutable operations. - */ -export declare function toBytes(data: Input): Uint8Array; -/** KDFs can accept string or Uint8Array for user convenience. */ -export type KDFInput = string | Uint8Array; -/** - * Helper for KDFs: consumes uint8array or string. - * When string is passed, does utf8 decoding, using TextDecoder. - */ -export declare function kdfInputToBytes(data: KDFInput): Uint8Array; -/** Copies several Uint8Arrays into one. */ -export declare function concatBytes(...arrays: Uint8Array[]): Uint8Array; -type EmptyObj = {}; -export declare function checkOpts(defaults: T1, opts?: T2): T1 & T2; -/** Hash interface. */ -export type IHash = { - (data: Uint8Array): Uint8Array; - blockLen: number; - outputLen: number; - create: any; -}; -/** For runtime check if class implements interface */ -export declare abstract class Hash> { - abstract blockLen: number; - abstract outputLen: number; - abstract update(buf: Input): this; - abstract digestInto(buf: Uint8Array): void; - abstract digest(): Uint8Array; - /** - * Resets internal state. Makes Hash instance unusable. - * Reset is impossible for keyed hashes if key is consumed into state. If digest is not consumed - * by user, they will need to manually call `destroy()` when zeroing is necessary. - */ - abstract destroy(): void; - /** - * Clones hash instance. Unsafe: doesn't check whether `to` is valid. Can be used as `clone()` - * when no options are passed. - * Reasons to use `_cloneInto` instead of clone: 1) performance 2) reuse instance => all internal - * buffers are overwritten => causes buffer overwrite which is used for digest in some cases. - * There are no guarantees for clean-up because it's impossible in JS. - */ - abstract _cloneInto(to?: T): T; - abstract clone(): T; -} -/** - * XOF: streaming API to read digest in chunks. - * Same as 'squeeze' in keccak/k12 and 'seek' in blake3, but more generic name. - * When hash used in XOF mode it is up to user to call '.destroy' afterwards, since we cannot - * destroy state, next call can require more bytes. - */ -export type HashXOF> = Hash & { - xof(bytes: number): Uint8Array; - xofInto(buf: Uint8Array): Uint8Array; -}; -/** Hash function */ -export type CHash = ReturnType; -/** Hash function with output */ -export type CHashO = ReturnType; -/** XOF with output */ -export type CHashXO = ReturnType; -/** Wraps hash function, creating an interface on top of it */ -export declare function createHasher>(hashCons: () => Hash): { - (msg: Input): Uint8Array; - outputLen: number; - blockLen: number; - create(): Hash; -}; -export declare function createOptHasher, T extends Object>(hashCons: (opts?: T) => Hash): { - (msg: Input, opts?: T): Uint8Array; - outputLen: number; - blockLen: number; - create(opts?: T): Hash; -}; -export declare function createXOFer, T extends Object>(hashCons: (opts?: T) => HashXOF): { - (msg: Input, opts?: T): Uint8Array; - outputLen: number; - blockLen: number; - create(opts?: T): HashXOF; -}; -export declare const wrapConstructor: typeof createHasher; -export declare const wrapConstructorWithOpts: typeof createOptHasher; -export declare const wrapXOFConstructorWithOpts: typeof createXOFer; -/** Cryptographically secure PRNG. Uses internal OS-level `crypto.getRandomValues`. */ -export declare function randomBytes(bytesLength?: number): Uint8Array; -export {}; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/utils.d.ts.map b/tools/mnemonic-test/node_modules/@noble/hashes/utils.d.ts.map deleted file mode 100644 index dd08975d..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,sEAAsE;AAUtE,qFAAqF;AACrF,wBAAgB,OAAO,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,UAAU,CAEnD;AAED,6CAA6C;AAC7C,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAEvC;AAED,uCAAuC;AACvC,wBAAgB,MAAM,CAAC,CAAC,EAAE,UAAU,GAAG,SAAS,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAI5E;AAED,gCAAgC;AAChC,wBAAgB,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI,CAKpC;AAED,gEAAgE;AAChE,wBAAgB,OAAO,CAAC,QAAQ,EAAE,GAAG,EAAE,aAAa,UAAO,GAAG,IAAI,CAGjE;AAED,kDAAkD;AAClD,wBAAgB,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,GAAG,IAAI,CAMrD;AAED,uEAAuE;AAEvE,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,iBAAiB,GAAG,UAAU,GACjE,WAAW,GAAG,UAAU,GAAG,WAAW,GAAG,UAAU,CAAC;AAEtD,iCAAiC;AACjC,wBAAgB,EAAE,CAAC,GAAG,EAAE,UAAU,GAAG,UAAU,CAE9C;AAED,k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K,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;CAC3B,CAOA;AAED,wBAAgB,WAAW,CAAC,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,EAChE,QAAQ,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,GACjC;IACD,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CAC9B,CAOA;AACD,eAAO,MAAM,eAAe,EAAE,OAAO,YAA2B,CAAC;AACjE,eAAO,MAAM,uBAAuB,EAAE,OAAO,eAAiC,CAAC;AAC/E,eAAO,MAAM,0BAA0B,EAAE,OAAO,WAAyB,CAAC;AAE1E,sFAAsF;AACtF,wBAAgB,WAAW,CAAC,WAAW,SAAK,GAAG,UAAU,CASxD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/utils.js b/tools/mnemonic-test/node_modules/@noble/hashes/utils.js deleted file mode 100644 index aed91998..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/utils.js +++ /dev/null @@ -1,313 +0,0 @@ -"use strict"; -/** - * Utilities for hex, bytes, CSPRNG. - * @module - */ -/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.wrapXOFConstructorWithOpts = exports.wrapConstructorWithOpts = exports.wrapConstructor = exports.Hash = exports.nextTick = exports.swap32IfBE = exports.byteSwapIfBE = exports.swap8IfBE = exports.isLE = void 0; -exports.isBytes = isBytes; -exports.anumber = anumber; -exports.abytes = abytes; -exports.ahash = ahash; -exports.aexists = aexists; -exports.aoutput = aoutput; -exports.u8 = u8; -exports.u32 = u32; -exports.clean = clean; -exports.createView = createView; -exports.rotr = rotr; -exports.rotl = rotl; -exports.byteSwap = byteSwap; -exports.byteSwap32 = byteSwap32; -exports.bytesToHex = bytesToHex; -exports.hexToBytes = hexToBytes; -exports.asyncLoop = asyncLoop; -exports.utf8ToBytes = utf8ToBytes; -exports.bytesToUtf8 = bytesToUtf8; -exports.toBytes = toBytes; -exports.kdfInputToBytes = kdfInputToBytes; -exports.concatBytes = concatBytes; -exports.checkOpts = checkOpts; -exports.createHasher = createHasher; -exports.createOptHasher = createOptHasher; -exports.createXOFer = createXOFer; -exports.randomBytes = randomBytes; -// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+. -// node.js versions earlier than v19 don't declare it in global scope. -// For node.js, package.json#exports field mapping rewrites import -// from `crypto` to `cryptoNode`, which imports native module. -// Makes the utils un-importable in browsers without a bundler. -// Once node.js 18 is deprecated (2025-04-30), we can just drop the import. -const crypto_1 = require("@noble/hashes/crypto"); -/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */ -function isBytes(a) { - return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array'); -} -/** Asserts something is positive integer. */ -function anumber(n) { - if (!Number.isSafeInteger(n) || n < 0) - throw new Error('positive integer expected, got ' + n); -} -/** Asserts something is Uint8Array. */ -function abytes(b, ...lengths) { - if (!isBytes(b)) - throw new Error('Uint8Array expected'); - if (lengths.length > 0 && !lengths.includes(b.length)) - throw new Error('Uint8Array expected of length ' + lengths + ', got length=' + b.length); -} -/** Asserts something is hash */ -function ahash(h) { - if (typeof h !== 'function' || typeof h.create !== 'function') - throw new Error('Hash should be wrapped by utils.createHasher'); - anumber(h.outputLen); - anumber(h.blockLen); -} -/** Asserts a hash instance has not been destroyed / finished */ -function aexists(instance, checkFinished = true) { - if (instance.destroyed) - throw new Error('Hash instance has been destroyed'); - if (checkFinished && instance.finished) - throw new Error('Hash#digest() has already been called'); -} -/** Asserts output is properly-sized byte array */ -function aoutput(out, instance) { - abytes(out); - const min = instance.outputLen; - if (out.length < min) { - throw new Error('digestInto() expects output buffer of length at least ' + min); - } -} -/** Cast u8 / u16 / u32 to u8. */ -function u8(arr) { - return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength); -} -/** Cast u8 / u16 / u32 to u32. */ -function u32(arr) { - return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); -} -/** Zeroize a byte array. Warning: JS provides no guarantees. */ -function clean(...arrays) { - for (let i = 0; i < arrays.length; i++) { - arrays[i].fill(0); - } -} -/** Create DataView of an array for easy byte-level manipulation. */ -function createView(arr) { - return new DataView(arr.buffer, arr.byteOffset, arr.byteLength); -} -/** The rotate right (circular right shift) operation for uint32 */ -function rotr(word, shift) { - return (word << (32 - shift)) | (word >>> shift); -} -/** The rotate left (circular left shift) operation for uint32 */ -function rotl(word, shift) { - return (word << shift) | ((word >>> (32 - shift)) >>> 0); -} -/** Is current platform little-endian? Most are. Big-Endian platform: IBM */ -exports.isLE = (() => new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)(); -/** The byte swap operation for uint32 */ -function byteSwap(word) { - return (((word << 24) & 0xff000000) | - ((word << 8) & 0xff0000) | - ((word >>> 8) & 0xff00) | - ((word >>> 24) & 0xff)); -} -/** Conditionally byte swap if on a big-endian platform */ -exports.swap8IfBE = exports.isLE - ? (n) => n - : (n) => byteSwap(n); -/** @deprecated */ -exports.byteSwapIfBE = exports.swap8IfBE; -/** In place byte swap for Uint32Array */ -function byteSwap32(arr) { - for (let i = 0; i < arr.length; i++) { - arr[i] = byteSwap(arr[i]); - } - return arr; -} -exports.swap32IfBE = exports.isLE - ? (u) => u - : byteSwap32; -// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex -const hasHexBuiltin = /* @__PURE__ */ (() => -// @ts-ignore -typeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function')(); -// Array where index 0xf0 (240) is mapped to string 'f0' -const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0')); -/** - * Convert byte array to hex string. Uses built-in function, when available. - * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123' - */ -function bytesToHex(bytes) { - abytes(bytes); - // @ts-ignore - if (hasHexBuiltin) - return bytes.toHex(); - // pre-caching improves the speed 6x - let hex = ''; - for (let i = 0; i < bytes.length; i++) { - hex += hexes[bytes[i]]; - } - return hex; -} -// We use optimized technique to convert hex string to byte array -const asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 }; -function asciiToBase16(ch) { - if (ch >= asciis._0 && ch <= asciis._9) - return ch - asciis._0; // '2' => 50-48 - if (ch >= asciis.A && ch <= asciis.F) - return ch - (asciis.A - 10); // 'B' => 66-(65-10) - if (ch >= asciis.a && ch <= asciis.f) - return ch - (asciis.a - 10); // 'b' => 98-(97-10) - return; -} -/** - * Convert hex string to byte array. Uses built-in function, when available. - * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23]) - */ -function hexToBytes(hex) { - if (typeof hex !== 'string') - throw new Error('hex string expected, got ' + typeof hex); - // @ts-ignore - if (hasHexBuiltin) - return Uint8Array.fromHex(hex); - const hl = hex.length; - const al = hl / 2; - if (hl % 2) - throw new Error('hex string expected, got unpadded hex of length ' + hl); - const array = new Uint8Array(al); - for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) { - const n1 = asciiToBase16(hex.charCodeAt(hi)); - const n2 = asciiToBase16(hex.charCodeAt(hi + 1)); - if (n1 === undefined || n2 === undefined) { - const char = hex[hi] + hex[hi + 1]; - throw new Error('hex string expected, got non-hex character "' + char + '" at index ' + hi); - } - array[ai] = n1 * 16 + n2; // multiply first octet, e.g. 'a3' => 10*16+3 => 160 + 3 => 163 - } - return array; -} -/** - * There is no setImmediate in browser and setTimeout is slow. - * Call of async fn will return Promise, which will be fullfiled only on - * next scheduler queue processing step and this is exactly what we need. - */ -const nextTick = async () => { }; -exports.nextTick = nextTick; -/** Returns control to thread each 'tick' ms to avoid blocking. */ -async function asyncLoop(iters, tick, cb) { - let ts = Date.now(); - for (let i = 0; i < iters; i++) { - cb(i); - // Date.now() is not monotonic, so in case if clock goes backwards we return return control too - const diff = Date.now() - ts; - if (diff >= 0 && diff < tick) - continue; - await (0, exports.nextTick)(); - ts += diff; - } -} -/** - * Converts string to bytes using UTF8 encoding. - * @example utf8ToBytes('abc') // Uint8Array.from([97, 98, 99]) - */ -function utf8ToBytes(str) { - if (typeof str !== 'string') - throw new Error('string expected'); - return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809 -} -/** - * Converts bytes to string using UTF8 encoding. - * @example bytesToUtf8(Uint8Array.from([97, 98, 99])) // 'abc' - */ -function bytesToUtf8(bytes) { - return new TextDecoder().decode(bytes); -} -/** - * Normalizes (non-hex) string or Uint8Array to Uint8Array. - * Warning: when Uint8Array is passed, it would NOT get copied. - * Keep in mind for future mutable operations. - */ -function toBytes(data) { - if (typeof data === 'string') - data = utf8ToBytes(data); - abytes(data); - return data; -} -/** - * Helper for KDFs: consumes uint8array or string. - * When string is passed, does utf8 decoding, using TextDecoder. - */ -function kdfInputToBytes(data) { - if (typeof data === 'string') - data = utf8ToBytes(data); - abytes(data); - return data; -} -/** Copies several Uint8Arrays into one. */ -function concatBytes(...arrays) { - let sum = 0; - for (let i = 0; i < arrays.length; i++) { - const a = arrays[i]; - abytes(a); - sum += a.length; - } - const res = new Uint8Array(sum); - for (let i = 0, pad = 0; i < arrays.length; i++) { - const a = arrays[i]; - res.set(a, pad); - pad += a.length; - } - return res; -} -function checkOpts(defaults, opts) { - if (opts !== undefined && {}.toString.call(opts) !== '[object Object]') - throw new Error('options should be object or undefined'); - const merged = Object.assign(defaults, opts); - return merged; -} -/** For runtime check if class implements interface */ -class Hash { -} -exports.Hash = Hash; -/** Wraps hash function, creating an interface on top of it */ -function createHasher(hashCons) { - const hashC = (msg) => hashCons().update(toBytes(msg)).digest(); - const tmp = hashCons(); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = () => hashCons(); - return hashC; -} -function createOptHasher(hashCons) { - const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest(); - const tmp = hashCons({}); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = (opts) => hashCons(opts); - return hashC; -} -function createXOFer(hashCons) { - const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest(); - const tmp = hashCons({}); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = (opts) => hashCons(opts); - return hashC; -} -exports.wrapConstructor = createHasher; -exports.wrapConstructorWithOpts = createOptHasher; -exports.wrapXOFConstructorWithOpts = createXOFer; -/** Cryptographically secure PRNG. Uses internal OS-level `crypto.getRandomValues`. */ -function randomBytes(bytesLength = 32) { - if (crypto_1.crypto && typeof crypto_1.crypto.getRandomValues === 'function') { - return crypto_1.crypto.getRandomValues(new Uint8Array(bytesLength)); - } - // Legacy Node.js compatibility - if (crypto_1.crypto && typeof crypto_1.crypto.randomBytes === 'function') { - return Uint8Array.from(crypto_1.crypto.randomBytes(bytesLength)); - } - throw new Error('crypto.getRandomValues must be defined'); -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@noble/hashes/utils.js.map b/tools/mnemonic-test/node_modules/@noble/hashes/utils.js.map deleted file mode 100644 index 9e5e2f74..00000000 --- a/tools/mnemonic-test/node_modules/@noble/hashes/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["src/utils.ts"],"names":[],"mappings":";AAAA;;;GAGG;AACH,sEAAsE;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AwB,YAAY,CAAC;AACpD,QAAA,uBAAuB,GAA2B,eAAe,CAAC;AAClE,QAAA,0BAA0B,GAAuB,WAAW,CAAC;AAE1E,sFAAsF;AACtF,SAAgB,WAAW,CAAC,WAAW,GAAG,EAAE;IAC1C,IAAI,eAAM,IAAI,OAAO,eAAM,CAAC,eAAe,KAAK,UAAU,EAAE,CAAC;QAC3D,OAAO,eAAM,CAAC,eAAe,CAAC,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC;IAC7D,CAAC;IACD,+BAA+B;IAC/B,IAAI,eAAM,IAAI,OAAO,eAAM,CAAC,WAAW,KAAK,UAAU,EAAE,CAAC;QACvD,OAAO,UAAU,CAAC,IAAI,CAAC,eAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC;IAC1D,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;AAC5D,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/base/LICENSE b/tools/mnemonic-test/node_modules/@scure/base/LICENSE deleted file mode 100644 index 5b91e4cb..00000000 --- a/tools/mnemonic-test/node_modules/@scure/base/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2022 Paul Miller (https://paulmillr.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the “Software”), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/mnemonic-test/node_modules/@scure/base/README.md b/tools/mnemonic-test/node_modules/@scure/base/README.md deleted file mode 100644 index aa7244db..00000000 --- a/tools/mnemonic-test/node_modules/@scure/base/README.md +++ /dev/null @@ -1,226 +0,0 @@ -# scure-base - -Audited & minimal implementation of bech32, base64, base58, base32 & base16. - -- 🔒 [Audited](#security) by an independent security firm -- 🔻 Tree-shakeable: unused code is excluded from your builds -- ✍️ Written in [functional style](#design-rationale), easily composable -- 💼 Matches specs - - [BIP173](https://en.bitcoin.it/wiki/BIP_0173), [BIP350](https://en.bitcoin.it/wiki/BIP_0350) for bech32 / bech32m - - [RFC 4648](https://datatracker.ietf.org/doc/html/rfc4648) (aka RFC 3548) for Base16, Base32, Base32Hex, Base64, Base64Url - - [Base58](https://www.ietf.org/archive/id/draft-msporny-base58-03.txt), - [Base58check](https://en.bitcoin.it/wiki/Base58Check_encoding), - [Base32 Crockford](https://www.crockford.com/base32.html) -- 🪶 4KB (gzipped) - -Check out [Projects using scure-base](#projects-using-scure-base). - -### This library belongs to _scure_ - -> **scure** — audited micro-libraries. - -- Zero or minimal dependencies -- Highly readable TypeScript / JS code -- PGP-signed releases and transparent NPM builds -- Check out [homepage](https://paulmillr.com/noble/#scure) & all libraries: - [base](https://github.com/paulmillr/scure-base), - [bip32](https://github.com/paulmillr/scure-bip32), - [bip39](https://github.com/paulmillr/scure-bip39), - [btc-signer](https://github.com/paulmillr/scure-btc-signer), - [sr25519](https://github.com/paulmillr/scure-sr25519), - [starknet](https://github.com/paulmillr/scure-starknet) - -## Usage - -> `npm install @scure/base` - -> `deno add jsr:@scure/base` - -We support all major platforms and runtimes. The library is hybrid ESM / Common.js package. - -```js -import { base16, base32, base64, base58 } from '@scure/base'; -// Flavors -import { - base58xmr, - base58xrp, - base32nopad, - base32hex, - base32hexnopad, - base32crockford, - base64nopad, - base64url, - base64urlnopad, -} from '@scure/base'; - -const data = Uint8Array.from([1, 2, 3]); -base64.decode(base64.encode(data)); - -// Convert utf8 string to Uint8Array -const data2 = new TextEncoder().encode('hello'); -base58.encode(data2); - -// Everything has the same API except for bech32 and base58check -base32.encode(data); -base16.encode(data); -base32hex.encode(data); -``` - -base58check is a special case: you need to pass `sha256()` function: - -```js -import { createBase58check } from '@scure/base'; -createBase58check(sha256).encode(data); -``` - -## Bech32, Bech32m and Bitcoin - -We provide low-level bech32 operations. -If you need high-level methods for BTC (addresses, and others), use -[scure-btc-signer](https://github.com/paulmillr/scure-btc-signer) instead. - -Bitcoin addresses use both 5-bit words and bytes representations. -They can't be parsed using `bech32.decodeToBytes`. - -Same applies to Lightning Invoice Protocol -[BOLT-11](https://github.com/lightning/bolts/blob/master/11-payment-encoding.md). -We have many tests in `./test/bip173.test.js` that serve as minimal examples of -Bitcoin address and Lightning Invoice Protocol parsers. -Keep in mind that you'll need to verify the examples before using them in your code. - -Do something like this: - -```ts -const decoded = bech32.decode(address); -// NOTE: words in bitcoin addresses contain version as first element, -// with actual witness program words in rest -// BIP-141: The value of the first push is called the "version byte". -// The following byte vector pushed is called the "witness program". -const [version, ...dataW] = decoded.words; -const program = bech32.fromWords(dataW); // actual witness program -``` - -## Design rationale - -The code may feel unnecessarily complicated; but actually it's much easier to reason about. -Any encoding library consists of two functions: - -``` -encode(A) -> B -decode(B) -> A - where X = decode(encode(X)) - # encode(decode(X)) can be !== X! - # because decoding can normalize input - -e.g. -base58checksum = { - encode(): { - // checksum - // radix conversion - // alphabet - }, - decode(): { - // alphabet - // radix conversion - // checksum - } -} -``` - -But instead of creating two big functions for each specific case, -we create them from tiny composable building blocks: - -``` -base58checksum = chain(checksum(), radix(), alphabet()) -``` - -Which is the same as chain/pipe/sequence function in Functional Programming, -but significantly more useful since it enforces same order of execution of encode/decode. -Basically you only define encode (in declarative way) and get correct decode for free. -So, instead of reasoning about two big functions you need only reason about primitives and encode chain. -The design revealed obvious bug in older version of the lib, -where xmr version of base58 had errors in decode's block processing. - -Besides base-encodings, we can reuse the same approach with any encode/decode function -(`bytes2number`, `bytes2u32`, etc). -For example, you can easily encode entropy to mnemonic (BIP-39): - -```ts -export function getCoder(wordlist: string[]) { - if (!Array.isArray(wordlist) || wordlist.length !== 2 ** 11 || typeof wordlist[0] !== 'string') { - throw new Error('Wordlist: expected array of 2048 strings'); - } - return mbc.chain(mbu.checksum(1, checksum), mbu.radix2(11, true), mbu.alphabet(wordlist)); -} -``` - -### base58 is O(n^2) and radixes - -`Uint8Array` is represented as big-endian number: - -``` -[1, 2, 3, 4, 5] -> 1*(256**4) + 2*(256**3) 3*(256**2) + 4*(256**1) + 5*(256**0) -where 256 = 2**8 (8 bits per byte) -``` - -which is then converted to a number in another radix/base (16/32/58/64, etc). - -However, generic conversion between bases has [quadratic O(n^2) time complexity](https://cs.stackexchange.com/q/21799). - -Which means base58 has quadratic time complexity too. Use base58 only when you have small -constant sized input, because variable length sized input from user can cause DoS. - -On the other hand, if both bases are power of same number (like `2**8 <-> 2**64`), -there is linear algorithm. For now we have implementation for power-of-two bases only (radix2). - -## Security - -The library has been independently audited: - -- at version 1.0.0, in Jan 2022, by [cure53](https://cure53.de) - - PDFs: [online](https://cure53.de/pentest-report_hashing-libs.pdf), [offline](./audit/2022-01-05-cure53-audit-nbl2.pdf) - - [Changes since audit](https://github.com/paulmillr/scure-base/compare/1.0.0..main). - - The audit has been funded by [Ethereum Foundation](https://ethereum.org/en/) with help of [Nomic Labs](https://nomiclabs.io) - -The library was initially developed for [js-ethereum-cryptography](https://github.com/ethereum/js-ethereum-cryptography). -At commit [ae00e6d7](https://github.com/ethereum/js-ethereum-cryptography/commit/ae00e6d7d24fb3c76a1c7fe10039f6ecd120b77e), -it was extracted to a separate package called `micro-base`. -After the audit we've decided to use `@scure` NPM namespace for security. - -### Supply chain security - -- **Commits** are signed with PGP keys, to prevent forgery. Make sure to verify commit signatures -- **Releases** are transparent and built on GitHub CI. Make sure to verify [provenance](https://docs.npmjs.com/generating-provenance-statements) logs - - Use GitHub CLI to verify single-file builds: - `gh attestation verify --owner paulmillr scure-base.js` -- **Rare releasing** is followed to ensure less re-audit need for end-users -- **Dependencies** are minimized and locked-down: any dependency could get hacked and users will be downloading malware with every install. - - We make sure to use as few dependencies as possible - - Automatic dep updates are prevented by locking-down version ranges; diffs are checked with `npm-diff` -- **Dev Dependencies** are disabled for end-users; they are only used to develop / build the source code - -For this package, there are 0 dependencies; and a few dev dependencies: - -- micro-bmark, micro-should and jsbt are used for benchmarking / testing / build tooling and developed by the same author -- prettier, fast-check and typescript are used for code quality / test generation / ts compilation. It's hard to audit their source code thoroughly and fully because of their size - -## Contributing & testing - -- `npm install && npm run build && npm test` will build the code and run tests. -- `npm run lint` / `npm run format` will run linter / fix linter issues. -- `npm run build:release` will build single file - -### Projects using scure-base - -- [scure-btc-signer](https://github.com/paulmillr/scure-btc-signer) -- [prefixed-api-key](https://github.com/truestamp/prefixed-api-key) -- [coinspace](https://github.com/CoinSpace/CoinSpace) wallet and its modules: - [ada](https://github.com/CoinSpace/cs-cardano-wallet), - [btc](https://github.com/CoinSpace/cs-bitcoin-wallet) - [eos](https://github.com/CoinSpace/cs-eos-wallet), - [sol](https://github.com/CoinSpace/cs-solana-wallet), - [xmr](https://github.com/CoinSpace/cs-monero-wallet) - -## License - -MIT (c) Paul Miller [(https://paulmillr.com)](https://paulmillr.com), see LICENSE file. diff --git a/tools/mnemonic-test/node_modules/@scure/base/index.d.ts b/tools/mnemonic-test/node_modules/@scure/base/index.d.ts deleted file mode 100644 index dde46dd3..00000000 --- a/tools/mnemonic-test/node_modules/@scure/base/index.d.ts +++ /dev/null @@ -1,294 +0,0 @@ -/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -export interface Coder { - encode(from: F): T; - decode(to: T): F; -} -export interface BytesCoder extends Coder { - encode: (data: Uint8Array) => string; - decode: (str: string) => Uint8Array; -} -type Chain = [Coder, ...Coder[]]; -type Input = F extends Coder ? T : never; -type Output = F extends Coder ? T : never; -type First = T extends [infer U, ...any[]] ? U : never; -type Last = T extends [...any[], infer U] ? U : never; -type Tail = T extends [any, ...infer U] ? U : never; -type AsChain> = { - [K in keyof C]: Coder, Input>; -}; -/** - * @__NO_SIDE_EFFECTS__ - */ -declare function chain>(...args: T): Coder>, Output>>; -/** - * Encodes integer radix representation to array of strings using alphabet and back. - * Could also be array of strings. - * @__NO_SIDE_EFFECTS__ - */ -declare function alphabet(letters: string | string[]): Coder; -/** - * @__NO_SIDE_EFFECTS__ - */ -declare function join(separator?: string): Coder; -/** - * Pad strings array so it has integer number of bits - * @__NO_SIDE_EFFECTS__ - */ -declare function padding(bits: number, chr?: string): Coder; -/** - * Slow: O(n^2) time complexity - */ -declare function convertRadix(data: number[], from: number, to: number): number[]; -/** - * Implemented with numbers, because BigInt is 5x slower - */ -declare function convertRadix2(data: number[], from: number, to: number, padding: boolean): number[]; -/** - * @__NO_SIDE_EFFECTS__ - */ -declare function radix(num: number): Coder; -/** - * If both bases are power of same number (like `2**8 <-> 2**64`), - * there is a linear algorithm. For now we have implementation for power-of-two bases only. - * @__NO_SIDE_EFFECTS__ - */ -declare function radix2(bits: number, revPadding?: boolean): Coder; -declare function checksum(len: number, fn: (data: Uint8Array) => Uint8Array): Coder; -export declare const utils: { - alphabet: typeof alphabet; - chain: typeof chain; - checksum: typeof checksum; - convertRadix: typeof convertRadix; - convertRadix2: typeof convertRadix2; - radix: typeof radix; - radix2: typeof radix2; - join: typeof join; - padding: typeof padding; -}; -/** - * base16 encoding from RFC 4648. - * @example - * ```js - * base16.encode(Uint8Array.from([0x12, 0xab])); - * // => '12AB' - * ``` - */ -export declare const base16: BytesCoder; -/** - * base32 encoding from RFC 4648. Has padding. - * Use `base32nopad` for unpadded version. - * Also check out `base32hex`, `base32hexnopad`, `base32crockford`. - * @example - * ```js - * base32.encode(Uint8Array.from([0x12, 0xab])); - * // => 'CKVQ====' - * base32.decode('CKVQ===='); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export declare const base32: BytesCoder; -/** - * base32 encoding from RFC 4648. No padding. - * Use `base32` for padded version. - * Also check out `base32hex`, `base32hexnopad`, `base32crockford`. - * @example - * ```js - * base32nopad.encode(Uint8Array.from([0x12, 0xab])); - * // => 'CKVQ' - * base32nopad.decode('CKVQ'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export declare const base32nopad: BytesCoder; -/** - * base32 encoding from RFC 4648. Padded. Compared to ordinary `base32`, slightly different alphabet. - * Use `base32hexnopad` for unpadded version. - * @example - * ```js - * base32hex.encode(Uint8Array.from([0x12, 0xab])); - * // => '2ALG====' - * base32hex.decode('2ALG===='); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export declare const base32hex: BytesCoder; -/** - * base32 encoding from RFC 4648. No padding. Compared to ordinary `base32`, slightly different alphabet. - * Use `base32hex` for padded version. - * @example - * ```js - * base32hexnopad.encode(Uint8Array.from([0x12, 0xab])); - * // => '2ALG' - * base32hexnopad.decode('2ALG'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export declare const base32hexnopad: BytesCoder; -/** - * base32 encoding from RFC 4648. Doug Crockford's version. - * https://www.crockford.com/base32.html - * @example - * ```js - * base32crockford.encode(Uint8Array.from([0x12, 0xab])); - * // => '2ANG' - * base32crockford.decode('2ANG'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export declare const base32crockford: BytesCoder; -/** - * base64 from RFC 4648. Padded. - * Use `base64nopad` for unpadded version. - * Also check out `base64url`, `base64urlnopad`. - * Falls back to built-in function, when available. - * @example - * ```js - * base64.encode(Uint8Array.from([0x12, 0xab])); - * // => 'Eqs=' - * base64.decode('Eqs='); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export declare const base64: BytesCoder; -/** - * base64 from RFC 4648. No padding. - * Use `base64` for padded version. - * @example - * ```js - * base64nopad.encode(Uint8Array.from([0x12, 0xab])); - * // => 'Eqs' - * base64nopad.decode('Eqs'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export declare const base64nopad: BytesCoder; -/** - * base64 from RFC 4648, using URL-safe alphabet. Padded. - * Use `base64urlnopad` for unpadded version. - * Falls back to built-in function, when available. - * @example - * ```js - * base64url.encode(Uint8Array.from([0x12, 0xab])); - * // => 'Eqs=' - * base64url.decode('Eqs='); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export declare const base64url: BytesCoder; -/** - * base64 from RFC 4648, using URL-safe alphabet. No padding. - * Use `base64url` for padded version. - * @example - * ```js - * base64urlnopad.encode(Uint8Array.from([0x12, 0xab])); - * // => 'Eqs' - * base64urlnopad.decode('Eqs'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export declare const base64urlnopad: BytesCoder; -/** - * base58: base64 without ambigous characters +, /, 0, O, I, l. - * Quadratic (O(n^2)) - so, can't be used on large inputs. - * @example - * ```js - * base58.decode('01abcdef'); - * // => '3UhJW' - * ``` - */ -export declare const base58: BytesCoder; -/** - * base58: flickr version. Check out `base58`. - */ -export declare const base58flickr: BytesCoder; -/** - * base58: XRP version. Check out `base58`. - */ -export declare const base58xrp: BytesCoder; -/** - * base58: XMR version. Check out `base58`. - * Done in 8-byte blocks (which equals 11 chars in decoding). Last (non-full) block padded with '1' to size in XMR_BLOCK_LEN. - * Block encoding significantly reduces quadratic complexity of base58. - */ -export declare const base58xmr: BytesCoder; -/** - * Method, which creates base58check encoder. - * Requires function, calculating sha256. - */ -export declare const createBase58check: (sha256: (data: Uint8Array) => Uint8Array) => BytesCoder; -/** - * Use `createBase58check` instead. - * @deprecated - */ -export declare const base58check: (sha256: (data: Uint8Array) => Uint8Array) => BytesCoder; -export interface Bech32Decoded { - prefix: Prefix; - words: number[]; -} -export interface Bech32DecodedWithArray { - prefix: Prefix; - words: number[]; - bytes: Uint8Array; -} -export interface Bech32 { - encode(prefix: Prefix, words: number[] | Uint8Array, limit?: number | false): `${Lowercase}1${string}`; - decode(str: `${Prefix}1${string}`, limit?: number | false): Bech32Decoded; - encodeFromBytes(prefix: string, bytes: Uint8Array): string; - decodeToBytes(str: string): Bech32DecodedWithArray; - decodeUnsafe(str: string, limit?: number | false): void | Bech32Decoded; - fromWords(to: number[]): Uint8Array; - fromWordsUnsafe(to: number[]): void | Uint8Array; - toWords(from: Uint8Array): number[]; -} -/** - * bech32 from BIP 173. Operates on words. - * For high-level, check out scure-btc-signer: - * https://github.com/paulmillr/scure-btc-signer. - */ -export declare const bech32: Bech32; -/** - * bech32m from BIP 350. Operates on words. - * It was to mitigate `bech32` weaknesses. - * For high-level, check out scure-btc-signer: - * https://github.com/paulmillr/scure-btc-signer. - */ -export declare const bech32m: Bech32; -/** - * UTF-8-to-byte decoder. Uses built-in TextDecoder / TextEncoder. - * @example - * ```js - * const b = utf8.decode("hey"); // => new Uint8Array([ 104, 101, 121 ]) - * const str = utf8.encode(b); // "hey" - * ``` - */ -export declare const utf8: BytesCoder; -/** - * hex string decoder. Uses built-in function, when available. - * @example - * ```js - * const b = hex.decode("0102ff"); // => new Uint8Array([ 1, 2, 255 ]) - * const str = hex.encode(b); // "0102ff" - * ``` - */ -export declare const hex: BytesCoder; -export type SomeCoders = { - utf8: BytesCoder; - hex: BytesCoder; - base16: BytesCoder; - base32: BytesCoder; - base64: BytesCoder; - base64url: BytesCoder; - base58: BytesCoder; - base58xmr: BytesCoder; -}; -type CoderType = keyof SomeCoders; -/** @deprecated */ -export declare const bytesToString: (type: CoderType, bytes: Uint8Array) => string; -/** @deprecated */ -export declare const str: (type: CoderType, bytes: Uint8Array) => string; -/** @deprecated */ -export declare const stringToBytes: (type: CoderType, str: string) => Uint8Array; -/** @deprecated */ -export declare const bytes: (type: CoderType, str: string) => Uint8Array; -export {}; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/base/index.d.ts.map b/tools/mnemonic-test/node_modules/@scure/base/index.d.ts.map deleted file mode 100644 index 87cf10a6..00000000 --- a/tools/mnemonic-test/node_modules/@scure/base/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,oEAAoE;AAEpE,MAAM,WAAW,KAAK,CAAC,CAAC,EAAE,CAAC;IACzB,MAAM,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC;IACnB,MAAM,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC;CAClB;AAED,MAAM,WAAW,UAAW,SAAQ,KAAK,CAAC,UAAU,EAAE,MAAM,CAAC;IAC3D,MAAM,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,MAAM,CAAC;IACrC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,UAAU,CAAC;CACrC;AA8CD,KAAK,KAAK,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;AAErD,KAAK,KAAK,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAC1D,KAAK,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAE3D,KAAK,KAAK,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAC1D,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,GAAG,EAAE,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AACzD,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,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AIlE,CAAC;AAEF,kBAAkB;AAClB,eAAO,MAAM,GAAG,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,KAAK,MAAsB,CAAC;AAEjF,kBAAkB;AAClB,eAAO,MAAM,aAAa,GAAI,MAAM,SAAS,EAAE,KAAK,MAAM,KAAG,UAI5D,CAAC;AACF,kBAAkB;AAClB,eAAO,MAAM,KAAK,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,KAAK,UAA0B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/base/index.js b/tools/mnemonic-test/node_modules/@scure/base/index.js deleted file mode 100644 index 56004e3e..00000000 --- a/tools/mnemonic-test/node_modules/@scure/base/index.js +++ /dev/null @@ -1,704 +0,0 @@ -/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -function isBytes(a) { - return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array'); -} -/** Asserts something is Uint8Array. */ -function abytes(b) { - if (!isBytes(b)) - throw new Error('Uint8Array expected'); -} -function isArrayOf(isString, arr) { - if (!Array.isArray(arr)) - return false; - if (arr.length === 0) - return true; - if (isString) { - return arr.every((item) => typeof item === 'string'); - } - else { - return arr.every((item) => Number.isSafeInteger(item)); - } -} -function afn(input) { - if (typeof input !== 'function') - throw new Error('function expected'); - return true; -} -function astr(label, input) { - if (typeof input !== 'string') - throw new Error(`${label}: string expected`); - return true; -} -function anumber(n) { - if (!Number.isSafeInteger(n)) - throw new Error(`invalid integer: ${n}`); -} -function aArr(input) { - if (!Array.isArray(input)) - throw new Error('array expected'); -} -function astrArr(label, input) { - if (!isArrayOf(true, input)) - throw new Error(`${label}: array of strings expected`); -} -function anumArr(label, input) { - if (!isArrayOf(false, input)) - throw new Error(`${label}: array of numbers expected`); -} -/** - * @__NO_SIDE_EFFECTS__ - */ -function chain(...args) { - const id = (a) => a; - // Wrap call in closure so JIT can inline calls - const wrap = (a, b) => (c) => a(b(c)); - // Construct chain of args[-1].encode(args[-2].encode([...])) - const encode = args.map((x) => x.encode).reduceRight(wrap, id); - // Construct chain of args[0].decode(args[1].decode(...)) - const decode = args.map((x) => x.decode).reduce(wrap, id); - return { encode, decode }; -} -/** - * Encodes integer radix representation to array of strings using alphabet and back. - * Could also be array of strings. - * @__NO_SIDE_EFFECTS__ - */ -function alphabet(letters) { - // mapping 1 to "b" - const lettersA = typeof letters === 'string' ? letters.split('') : letters; - const len = lettersA.length; - astrArr('alphabet', lettersA); - // mapping "b" to 1 - const indexes = new Map(lettersA.map((l, i) => [l, i])); - return { - encode: (digits) => { - aArr(digits); - return digits.map((i) => { - if (!Number.isSafeInteger(i) || i < 0 || i >= len) - throw new Error(`alphabet.encode: digit index outside alphabet "${i}". Allowed: ${letters}`); - return lettersA[i]; - }); - }, - decode: (input) => { - aArr(input); - return input.map((letter) => { - astr('alphabet.decode', letter); - const i = indexes.get(letter); - if (i === undefined) - throw new Error(`Unknown letter: "${letter}". Allowed: ${letters}`); - return i; - }); - }, - }; -} -/** - * @__NO_SIDE_EFFECTS__ - */ -function join(separator = '') { - astr('join', separator); - return { - encode: (from) => { - astrArr('join.decode', from); - return from.join(separator); - }, - decode: (to) => { - astr('join.decode', to); - return to.split(separator); - }, - }; -} -/** - * Pad strings array so it has integer number of bits - * @__NO_SIDE_EFFECTS__ - */ -function padding(bits, chr = '=') { - anumber(bits); - astr('padding', chr); - return { - encode(data) { - astrArr('padding.encode', data); - while ((data.length * bits) % 8) - data.push(chr); - return data; - }, - decode(input) { - astrArr('padding.decode', input); - let end = input.length; - if ((end * bits) % 8) - throw new Error('padding: invalid, string should have whole number of bytes'); - for (; end > 0 && input[end - 1] === chr; end--) { - const last = end - 1; - const byte = last * bits; - if (byte % 8 === 0) - throw new Error('padding: invalid, string has too much padding'); - } - return input.slice(0, end); - }, - }; -} -/** - * @__NO_SIDE_EFFECTS__ - */ -function normalize(fn) { - afn(fn); - return { encode: (from) => from, decode: (to) => fn(to) }; -} -/** - * Slow: O(n^2) time complexity - */ -function convertRadix(data, from, to) { - // base 1 is impossible - if (from < 2) - throw new Error(`convertRadix: invalid from=${from}, base cannot be less than 2`); - if (to < 2) - throw new Error(`convertRadix: invalid to=${to}, base cannot be less than 2`); - aArr(data); - if (!data.length) - return []; - let pos = 0; - const res = []; - const digits = Array.from(data, (d) => { - anumber(d); - if (d < 0 || d >= from) - throw new Error(`invalid integer: ${d}`); - return d; - }); - const dlen = digits.length; - while (true) { - let carry = 0; - let done = true; - for (let i = pos; i < dlen; i++) { - const digit = digits[i]; - const fromCarry = from * carry; - const digitBase = fromCarry + digit; - if (!Number.isSafeInteger(digitBase) || - fromCarry / from !== carry || - digitBase - digit !== fromCarry) { - throw new Error('convertRadix: carry overflow'); - } - const div = digitBase / to; - carry = digitBase % to; - const rounded = Math.floor(div); - digits[i] = rounded; - if (!Number.isSafeInteger(rounded) || rounded * to + carry !== digitBase) - throw new Error('convertRadix: carry overflow'); - if (!done) - continue; - else if (!rounded) - pos = i; - else - done = false; - } - res.push(carry); - if (done) - break; - } - for (let i = 0; i < data.length - 1 && data[i] === 0; i++) - res.push(0); - return res.reverse(); -} -const gcd = (a, b) => (b === 0 ? a : gcd(b, a % b)); -const radix2carry = /* @__NO_SIDE_EFFECTS__ */ (from, to) => from + (to - gcd(from, to)); -const powers = /* @__PURE__ */ (() => { - let res = []; - for (let i = 0; i < 40; i++) - res.push(2 ** i); - return res; -})(); -/** - * Implemented with numbers, because BigInt is 5x slower - */ -function convertRadix2(data, from, to, padding) { - aArr(data); - if (from <= 0 || from > 32) - throw new Error(`convertRadix2: wrong from=${from}`); - if (to <= 0 || to > 32) - throw new Error(`convertRadix2: wrong to=${to}`); - if (radix2carry(from, to) > 32) { - throw new Error(`convertRadix2: carry overflow from=${from} to=${to} carryBits=${radix2carry(from, to)}`); - } - let carry = 0; - let pos = 0; // bitwise position in current element - const max = powers[from]; - const mask = powers[to] - 1; - const res = []; - for (const n of data) { - anumber(n); - if (n >= max) - throw new Error(`convertRadix2: invalid data word=${n} from=${from}`); - carry = (carry << from) | n; - if (pos + from > 32) - throw new Error(`convertRadix2: carry overflow pos=${pos} from=${from}`); - pos += from; - for (; pos >= to; pos -= to) - res.push(((carry >> (pos - to)) & mask) >>> 0); - const pow = powers[pos]; - if (pow === undefined) - throw new Error('invalid carry'); - carry &= pow - 1; // clean carry, otherwise it will cause overflow - } - carry = (carry << (to - pos)) & mask; - if (!padding && pos >= from) - throw new Error('Excess padding'); - if (!padding && carry > 0) - throw new Error(`Non-zero padding: ${carry}`); - if (padding && pos > 0) - res.push(carry >>> 0); - return res; -} -/** - * @__NO_SIDE_EFFECTS__ - */ -function radix(num) { - anumber(num); - const _256 = 2 ** 8; - return { - encode: (bytes) => { - if (!isBytes(bytes)) - throw new Error('radix.encode input should be Uint8Array'); - return convertRadix(Array.from(bytes), _256, num); - }, - decode: (digits) => { - anumArr('radix.decode', digits); - return Uint8Array.from(convertRadix(digits, num, _256)); - }, - }; -} -/** - * If both bases are power of same number (like `2**8 <-> 2**64`), - * there is a linear algorithm. For now we have implementation for power-of-two bases only. - * @__NO_SIDE_EFFECTS__ - */ -function radix2(bits, revPadding = false) { - anumber(bits); - if (bits <= 0 || bits > 32) - throw new Error('radix2: bits should be in (0..32]'); - if (radix2carry(8, bits) > 32 || radix2carry(bits, 8) > 32) - throw new Error('radix2: carry overflow'); - return { - encode: (bytes) => { - if (!isBytes(bytes)) - throw new Error('radix2.encode input should be Uint8Array'); - return convertRadix2(Array.from(bytes), 8, bits, !revPadding); - }, - decode: (digits) => { - anumArr('radix2.decode', digits); - return Uint8Array.from(convertRadix2(digits, bits, 8, revPadding)); - }, - }; -} -function unsafeWrapper(fn) { - afn(fn); - return function (...args) { - try { - return fn.apply(null, args); - } - catch (e) { } - }; -} -function checksum(len, fn) { - anumber(len); - afn(fn); - return { - encode(data) { - if (!isBytes(data)) - throw new Error('checksum.encode: input should be Uint8Array'); - const sum = fn(data).slice(0, len); - const res = new Uint8Array(data.length + len); - res.set(data); - res.set(sum, data.length); - return res; - }, - decode(data) { - if (!isBytes(data)) - throw new Error('checksum.decode: input should be Uint8Array'); - const payload = data.slice(0, -len); - const oldChecksum = data.slice(-len); - const newChecksum = fn(payload).slice(0, len); - for (let i = 0; i < len; i++) - if (newChecksum[i] !== oldChecksum[i]) - throw new Error('Invalid checksum'); - return payload; - }, - }; -} -// prettier-ignore -export const utils = { - alphabet, chain, checksum, convertRadix, convertRadix2, radix, radix2, join, padding, -}; -// RFC 4648 aka RFC 3548 -// --------------------- -/** - * base16 encoding from RFC 4648. - * @example - * ```js - * base16.encode(Uint8Array.from([0x12, 0xab])); - * // => '12AB' - * ``` - */ -export const base16 = chain(radix2(4), alphabet('0123456789ABCDEF'), join('')); -/** - * base32 encoding from RFC 4648. Has padding. - * Use `base32nopad` for unpadded version. - * Also check out `base32hex`, `base32hexnopad`, `base32crockford`. - * @example - * ```js - * base32.encode(Uint8Array.from([0x12, 0xab])); - * // => 'CKVQ====' - * base32.decode('CKVQ===='); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export const base32 = chain(radix2(5), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'), padding(5), join('')); -/** - * base32 encoding from RFC 4648. No padding. - * Use `base32` for padded version. - * Also check out `base32hex`, `base32hexnopad`, `base32crockford`. - * @example - * ```js - * base32nopad.encode(Uint8Array.from([0x12, 0xab])); - * // => 'CKVQ' - * base32nopad.decode('CKVQ'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export const base32nopad = chain(radix2(5), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'), join('')); -/** - * base32 encoding from RFC 4648. Padded. Compared to ordinary `base32`, slightly different alphabet. - * Use `base32hexnopad` for unpadded version. - * @example - * ```js - * base32hex.encode(Uint8Array.from([0x12, 0xab])); - * // => '2ALG====' - * base32hex.decode('2ALG===='); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export const base32hex = chain(radix2(5), alphabet('0123456789ABCDEFGHIJKLMNOPQRSTUV'), padding(5), join('')); -/** - * base32 encoding from RFC 4648. No padding. Compared to ordinary `base32`, slightly different alphabet. - * Use `base32hex` for padded version. - * @example - * ```js - * base32hexnopad.encode(Uint8Array.from([0x12, 0xab])); - * // => '2ALG' - * base32hexnopad.decode('2ALG'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export const base32hexnopad = chain(radix2(5), alphabet('0123456789ABCDEFGHIJKLMNOPQRSTUV'), join('')); -/** - * base32 encoding from RFC 4648. Doug Crockford's version. - * https://www.crockford.com/base32.html - * @example - * ```js - * base32crockford.encode(Uint8Array.from([0x12, 0xab])); - * // => '2ANG' - * base32crockford.decode('2ANG'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export const base32crockford = chain(radix2(5), alphabet('0123456789ABCDEFGHJKMNPQRSTVWXYZ'), join(''), normalize((s) => s.toUpperCase().replace(/O/g, '0').replace(/[IL]/g, '1'))); -// Built-in base64 conversion https://caniuse.com/mdn-javascript_builtins_uint8array_frombase64 -// prettier-ignore -const hasBase64Builtin = /* @__PURE__ */ (() => typeof Uint8Array.from([]).toBase64 === 'function' && - typeof Uint8Array.fromBase64 === 'function')(); -const decodeBase64Builtin = (s, isUrl) => { - astr('base64', s); - const re = isUrl ? /^[A-Za-z0-9=_-]+$/ : /^[A-Za-z0-9=+/]+$/; - const alphabet = isUrl ? 'base64url' : 'base64'; - if (s.length > 0 && !re.test(s)) - throw new Error('invalid base64'); - return Uint8Array.fromBase64(s, { alphabet, lastChunkHandling: 'strict' }); -}; -/** - * base64 from RFC 4648. Padded. - * Use `base64nopad` for unpadded version. - * Also check out `base64url`, `base64urlnopad`. - * Falls back to built-in function, when available. - * @example - * ```js - * base64.encode(Uint8Array.from([0x12, 0xab])); - * // => 'Eqs=' - * base64.decode('Eqs='); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -// prettier-ignore -export const base64 = hasBase64Builtin ? { - encode(b) { abytes(b); return b.toBase64(); }, - decode(s) { return decodeBase64Builtin(s, false); }, -} : chain(radix2(6), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'), padding(6), join('')); -/** - * base64 from RFC 4648. No padding. - * Use `base64` for padded version. - * @example - * ```js - * base64nopad.encode(Uint8Array.from([0x12, 0xab])); - * // => 'Eqs' - * base64nopad.decode('Eqs'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export const base64nopad = chain(radix2(6), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'), join('')); -/** - * base64 from RFC 4648, using URL-safe alphabet. Padded. - * Use `base64urlnopad` for unpadded version. - * Falls back to built-in function, when available. - * @example - * ```js - * base64url.encode(Uint8Array.from([0x12, 0xab])); - * // => 'Eqs=' - * base64url.decode('Eqs='); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -// prettier-ignore -export const base64url = hasBase64Builtin ? { - encode(b) { abytes(b); return b.toBase64({ alphabet: 'base64url' }); }, - decode(s) { return decodeBase64Builtin(s, true); }, -} : chain(radix2(6), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'), padding(6), join('')); -/** - * base64 from RFC 4648, using URL-safe alphabet. No padding. - * Use `base64url` for padded version. - * @example - * ```js - * base64urlnopad.encode(Uint8Array.from([0x12, 0xab])); - * // => 'Eqs' - * base64urlnopad.decode('Eqs'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export const base64urlnopad = chain(radix2(6), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'), join('')); -// base58 code -// ----------- -const genBase58 = /* @__NO_SIDE_EFFECTS__ */ (abc) => chain(radix(58), alphabet(abc), join('')); -/** - * base58: base64 without ambigous characters +, /, 0, O, I, l. - * Quadratic (O(n^2)) - so, can't be used on large inputs. - * @example - * ```js - * base58.decode('01abcdef'); - * // => '3UhJW' - * ``` - */ -export const base58 = genBase58('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'); -/** - * base58: flickr version. Check out `base58`. - */ -export const base58flickr = genBase58('123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'); -/** - * base58: XRP version. Check out `base58`. - */ -export const base58xrp = genBase58('rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz'); -// Data len (index) -> encoded block len -const XMR_BLOCK_LEN = [0, 2, 3, 5, 6, 7, 9, 10, 11]; -/** - * base58: XMR version. Check out `base58`. - * Done in 8-byte blocks (which equals 11 chars in decoding). Last (non-full) block padded with '1' to size in XMR_BLOCK_LEN. - * Block encoding significantly reduces quadratic complexity of base58. - */ -export const base58xmr = { - encode(data) { - let res = ''; - for (let i = 0; i < data.length; i += 8) { - const block = data.subarray(i, i + 8); - res += base58.encode(block).padStart(XMR_BLOCK_LEN[block.length], '1'); - } - return res; - }, - decode(str) { - let res = []; - for (let i = 0; i < str.length; i += 11) { - const slice = str.slice(i, i + 11); - const blockLen = XMR_BLOCK_LEN.indexOf(slice.length); - const block = base58.decode(slice); - for (let j = 0; j < block.length - blockLen; j++) { - if (block[j] !== 0) - throw new Error('base58xmr: wrong padding'); - } - res = res.concat(Array.from(block.slice(block.length - blockLen))); - } - return Uint8Array.from(res); - }, -}; -/** - * Method, which creates base58check encoder. - * Requires function, calculating sha256. - */ -export const createBase58check = (sha256) => chain(checksum(4, (data) => sha256(sha256(data))), base58); -/** - * Use `createBase58check` instead. - * @deprecated - */ -export const base58check = createBase58check; -const BECH_ALPHABET = chain(alphabet('qpzry9x8gf2tvdw0s3jn54khce6mua7l'), join('')); -const POLYMOD_GENERATORS = [0x3b6a57b2, 0x26508e6d, 0x1ea119fa, 0x3d4233dd, 0x2a1462b3]; -function bech32Polymod(pre) { - const b = pre >> 25; - let chk = (pre & 0x1ffffff) << 5; - for (let i = 0; i < POLYMOD_GENERATORS.length; i++) { - if (((b >> i) & 1) === 1) - chk ^= POLYMOD_GENERATORS[i]; - } - return chk; -} -function bechChecksum(prefix, words, encodingConst = 1) { - const len = prefix.length; - let chk = 1; - for (let i = 0; i < len; i++) { - const c = prefix.charCodeAt(i); - if (c < 33 || c > 126) - throw new Error(`Invalid prefix (${prefix})`); - chk = bech32Polymod(chk) ^ (c >> 5); - } - chk = bech32Polymod(chk); - for (let i = 0; i < len; i++) - chk = bech32Polymod(chk) ^ (prefix.charCodeAt(i) & 0x1f); - for (let v of words) - chk = bech32Polymod(chk) ^ v; - for (let i = 0; i < 6; i++) - chk = bech32Polymod(chk); - chk ^= encodingConst; - return BECH_ALPHABET.encode(convertRadix2([chk % powers[30]], 30, 5, false)); -} -/** - * @__NO_SIDE_EFFECTS__ - */ -function genBech32(encoding) { - const ENCODING_CONST = encoding === 'bech32' ? 1 : 0x2bc830a3; - const _words = radix2(5); - const fromWords = _words.decode; - const toWords = _words.encode; - const fromWordsUnsafe = unsafeWrapper(fromWords); - function encode(prefix, words, limit = 90) { - astr('bech32.encode prefix', prefix); - if (isBytes(words)) - words = Array.from(words); - anumArr('bech32.encode', words); - const plen = prefix.length; - if (plen === 0) - throw new TypeError(`Invalid prefix length ${plen}`); - const actualLength = plen + 7 + words.length; - if (limit !== false && actualLength > limit) - throw new TypeError(`Length ${actualLength} exceeds limit ${limit}`); - const lowered = prefix.toLowerCase(); - const sum = bechChecksum(lowered, words, ENCODING_CONST); - return `${lowered}1${BECH_ALPHABET.encode(words)}${sum}`; - } - function decode(str, limit = 90) { - astr('bech32.decode input', str); - const slen = str.length; - if (slen < 8 || (limit !== false && slen > limit)) - throw new TypeError(`invalid string length: ${slen} (${str}). Expected (8..${limit})`); - // don't allow mixed case - const lowered = str.toLowerCase(); - if (str !== lowered && str !== str.toUpperCase()) - throw new Error(`String must be lowercase or uppercase`); - const sepIndex = lowered.lastIndexOf('1'); - if (sepIndex === 0 || sepIndex === -1) - throw new Error(`Letter "1" must be present between prefix and data only`); - const prefix = lowered.slice(0, sepIndex); - const data = lowered.slice(sepIndex + 1); - if (data.length < 6) - throw new Error('Data must be at least 6 characters long'); - const words = BECH_ALPHABET.decode(data).slice(0, -6); - const sum = bechChecksum(prefix, words, ENCODING_CONST); - if (!data.endsWith(sum)) - throw new Error(`Invalid checksum in ${str}: expected "${sum}"`); - return { prefix, words }; - } - const decodeUnsafe = unsafeWrapper(decode); - function decodeToBytes(str) { - const { prefix, words } = decode(str, false); - return { prefix, words, bytes: fromWords(words) }; - } - function encodeFromBytes(prefix, bytes) { - return encode(prefix, toWords(bytes)); - } - return { - encode, - decode, - encodeFromBytes, - decodeToBytes, - decodeUnsafe, - fromWords, - fromWordsUnsafe, - toWords, - }; -} -/** - * bech32 from BIP 173. Operates on words. - * For high-level, check out scure-btc-signer: - * https://github.com/paulmillr/scure-btc-signer. - */ -export const bech32 = genBech32('bech32'); -/** - * bech32m from BIP 350. Operates on words. - * It was to mitigate `bech32` weaknesses. - * For high-level, check out scure-btc-signer: - * https://github.com/paulmillr/scure-btc-signer. - */ -export const bech32m = genBech32('bech32m'); -/** - * UTF-8-to-byte decoder. Uses built-in TextDecoder / TextEncoder. - * @example - * ```js - * const b = utf8.decode("hey"); // => new Uint8Array([ 104, 101, 121 ]) - * const str = utf8.encode(b); // "hey" - * ``` - */ -export const utf8 = { - encode: (data) => new TextDecoder().decode(data), - decode: (str) => new TextEncoder().encode(str), -}; -// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex -// prettier-ignore -const hasHexBuiltin = /* @__PURE__ */ (() => typeof Uint8Array.from([]).toHex === 'function' && - typeof Uint8Array.fromHex === 'function')(); -// prettier-ignore -const hexBuiltin = { - encode(data) { abytes(data); return data.toHex(); }, - decode(s) { astr('hex', s); return Uint8Array.fromHex(s); }, -}; -/** - * hex string decoder. Uses built-in function, when available. - * @example - * ```js - * const b = hex.decode("0102ff"); // => new Uint8Array([ 1, 2, 255 ]) - * const str = hex.encode(b); // "0102ff" - * ``` - */ -export const hex = hasHexBuiltin - ? hexBuiltin - : chain(radix2(4), alphabet('0123456789abcdef'), join(''), normalize((s) => { - if (typeof s !== 'string' || s.length % 2 !== 0) - throw new TypeError(`hex.decode: expected string, got ${typeof s} with length ${s.length}`); - return s.toLowerCase(); - })); -// prettier-ignore -const CODERS = { - utf8, hex, base16, base32, base64, base64url, base58, base58xmr -}; -const coderTypeError = 'Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr'; -/** @deprecated */ -export const bytesToString = (type, bytes) => { - if (typeof type !== 'string' || !CODERS.hasOwnProperty(type)) - throw new TypeError(coderTypeError); - if (!isBytes(bytes)) - throw new TypeError('bytesToString() expects Uint8Array'); - return CODERS[type].encode(bytes); -}; -/** @deprecated */ -export const str = bytesToString; // as in python, but for bytes only -/** @deprecated */ -export const stringToBytes = (type, str) => { - if (!CODERS.hasOwnProperty(type)) - throw new TypeError(coderTypeError); - if (typeof str !== 'string') - throw new TypeError('stringToBytes() expects string'); - return CODERS[type].decode(str); -}; -/** @deprecated */ -export const bytes = stringToBytes; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/base/index.js.map b/tools/mnemonic-test/node_modules/@scure/base/index.js.map deleted file mode 100644 index ffbbce9e..00000000 --- a/tools/mnemonic-test/node_modules/@scure/base/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,oEAAoE;AAYpE,SAAS,OAAO,CAAC,CAAU;IACzB,OAAO,CAAC,YAAY,UAAU,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC;AACnG,CAAC;AACD,uCAAuC;AACvC,SAAS,MAAM,CAAC,CAAyB;IACvC,IAAI,CAAC,OAAO,CAAC,C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,IAAe,EAAE,GAAW,EAAc,EAAE;IACxE,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,cAAc,CAAC,CAAC;IACtE,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,MAAM,IAAI,SAAS,CAAC,gCAAgC,CAAC,CAAC;IACnF,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAClC,CAAC,CAAC;AACF,kBAAkB;AAClB,MAAM,CAAC,MAAM,KAAK,GAAiD,aAAa,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/base/index.ts b/tools/mnemonic-test/node_modules/@scure/base/index.ts deleted file mode 100644 index 9b260eee..00000000 --- a/tools/mnemonic-test/node_modules/@scure/base/index.ts +++ /dev/null @@ -1,857 +0,0 @@ -/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */ - -export interface Coder { - encode(from: F): T; - decode(to: T): F; -} - -export interface BytesCoder extends Coder { - encode: (data: Uint8Array) => string; - decode: (str: string) => Uint8Array; -} - -function isBytes(a: unknown): a is Uint8Array { - return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array'); -} -/** Asserts something is Uint8Array. */ -function abytes(b: Uint8Array | undefined): void { - if (!isBytes(b)) throw new Error('Uint8Array expected'); -} - -function isArrayOf(isString: boolean, arr: any[]) { - if (!Array.isArray(arr)) return false; - if (arr.length === 0) return true; - if (isString) { - return arr.every((item) => typeof item === 'string'); - } else { - return arr.every((item) => Number.isSafeInteger(item)); - } -} - -function afn(input: Function): input is Function { - if (typeof input !== 'function') throw new Error('function expected'); - return true; -} - -function astr(label: string, input: unknown): input is string { - if (typeof input !== 'string') throw new Error(`${label}: string expected`); - return true; -} - -function anumber(n: number): void { - if (!Number.isSafeInteger(n)) throw new Error(`invalid integer: ${n}`); -} - -function aArr(input: any[]) { - if (!Array.isArray(input)) throw new Error('array expected'); -} -function astrArr(label: string, input: string[]) { - if (!isArrayOf(true, input)) throw new Error(`${label}: array of strings expected`); -} -function anumArr(label: string, input: number[]) { - if (!isArrayOf(false, input)) throw new Error(`${label}: array of numbers expected`); -} - -// TODO: some recusive type inference so it would check correct order of input/output inside rest? -// like , , -type Chain = [Coder, ...Coder[]]; -// Extract info from Coder type -type Input = F extends Coder ? T : never; -type Output = F extends Coder ? T : never; -// Generic function for arrays -type First = T extends [infer U, ...any[]] ? U : never; -type Last = T extends [...any[], infer U] ? U : never; -type Tail = T extends [any, ...infer U] ? U : never; - -type AsChain> = { - // C[K] = Coder, Input> - [K in keyof C]: Coder, Input>; -}; - -/** - * @__NO_SIDE_EFFECTS__ - */ -function chain>(...args: T): Coder>, Output>> { - const id = (a: any) => a; - // Wrap call in closure so JIT can inline calls - const wrap = (a: any, b: any) => (c: any) => a(b(c)); - // Construct chain of args[-1].encode(args[-2].encode([...])) - const encode = args.map((x) => x.encode).reduceRight(wrap, id); - // Construct chain of args[0].decode(args[1].decode(...)) - const decode = args.map((x) => x.decode).reduce(wrap, id); - return { encode, decode }; -} - -/** - * Encodes integer radix representation to array of strings using alphabet and back. - * Could also be array of strings. - * @__NO_SIDE_EFFECTS__ - */ -function alphabet(letters: string | string[]): Coder { - // mapping 1 to "b" - const lettersA = typeof letters === 'string' ? letters.split('') : letters; - const len = lettersA.length; - astrArr('alphabet', lettersA); - - // mapping "b" to 1 - const indexes = new Map(lettersA.map((l, i) => [l, i])); - return { - encode: (digits: number[]) => { - aArr(digits); - return digits.map((i) => { - if (!Number.isSafeInteger(i) || i < 0 || i >= len) - throw new Error( - `alphabet.encode: digit index outside alphabet "${i}". Allowed: ${letters}` - ); - return lettersA[i]!; - }); - }, - decode: (input: string[]): number[] => { - aArr(input); - return input.map((letter) => { - astr('alphabet.decode', letter); - const i = indexes.get(letter); - if (i === undefined) throw new Error(`Unknown letter: "${letter}". Allowed: ${letters}`); - return i; - }); - }, - }; -} - -/** - * @__NO_SIDE_EFFECTS__ - */ -function join(separator = ''): Coder { - astr('join', separator); - return { - encode: (from) => { - astrArr('join.decode', from); - return from.join(separator); - }, - decode: (to) => { - astr('join.decode', to); - return to.split(separator); - }, - }; -} - -/** - * Pad strings array so it has integer number of bits - * @__NO_SIDE_EFFECTS__ - */ -function padding(bits: number, chr = '='): Coder { - anumber(bits); - astr('padding', chr); - return { - encode(data: string[]): string[] { - astrArr('padding.encode', data); - while ((data.length * bits) % 8) data.push(chr); - return data; - }, - decode(input: string[]): string[] { - astrArr('padding.decode', input); - let end = input.length; - if ((end * bits) % 8) - throw new Error('padding: invalid, string should have whole number of bytes'); - for (; end > 0 && input[end - 1] === chr; end--) { - const last = end - 1; - const byte = last * bits; - if (byte % 8 === 0) throw new Error('padding: invalid, string has too much padding'); - } - return input.slice(0, end); - }, - }; -} - -/** - * @__NO_SIDE_EFFECTS__ - */ -function normalize(fn: (val: T) => T): Coder { - afn(fn); - return { encode: (from: T) => from, decode: (to: T) => fn(to) }; -} - -/** - * Slow: O(n^2) time complexity - */ -function convertRadix(data: number[], from: number, to: number): number[] { - // base 1 is impossible - if (from < 2) throw new Error(`convertRadix: invalid from=${from}, base cannot be less than 2`); - if (to < 2) throw new Error(`convertRadix: invalid to=${to}, base cannot be less than 2`); - aArr(data); - if (!data.length) return []; - let pos = 0; - const res = []; - const digits = Array.from(data, (d) => { - anumber(d); - if (d < 0 || d >= from) throw new Error(`invalid integer: ${d}`); - return d; - }); - const dlen = digits.length; - while (true) { - let carry = 0; - let done = true; - for (let i = pos; i < dlen; i++) { - const digit = digits[i]!; - const fromCarry = from * carry; - const digitBase = fromCarry + digit; - if ( - !Number.isSafeInteger(digitBase) || - fromCarry / from !== carry || - digitBase - digit !== fromCarry - ) { - throw new Error('convertRadix: carry overflow'); - } - const div = digitBase / to; - carry = digitBase % to; - const rounded = Math.floor(div); - digits[i] = rounded; - if (!Number.isSafeInteger(rounded) || rounded * to + carry !== digitBase) - throw new Error('convertRadix: carry overflow'); - if (!done) continue; - else if (!rounded) pos = i; - else done = false; - } - res.push(carry); - if (done) break; - } - for (let i = 0; i < data.length - 1 && data[i] === 0; i++) res.push(0); - return res.reverse(); -} - -const gcd = (a: number, b: number): number => (b === 0 ? a : gcd(b, a % b)); -const radix2carry = /* @__NO_SIDE_EFFECTS__ */ (from: number, to: number) => - from + (to - gcd(from, to)); -const powers: number[] = /* @__PURE__ */ (() => { - let res = []; - for (let i = 0; i < 40; i++) res.push(2 ** i); - return res; -})(); -/** - * Implemented with numbers, because BigInt is 5x slower - */ -function convertRadix2(data: number[], from: number, to: number, padding: boolean): number[] { - aArr(data); - if (from <= 0 || from > 32) throw new Error(`convertRadix2: wrong from=${from}`); - if (to <= 0 || to > 32) throw new Error(`convertRadix2: wrong to=${to}`); - if (radix2carry(from, to) > 32) { - throw new Error( - `convertRadix2: carry overflow from=${from} to=${to} carryBits=${radix2carry(from, to)}` - ); - } - let carry = 0; - let pos = 0; // bitwise position in current element - const max = powers[from]!; - const mask = powers[to]! - 1; - const res: number[] = []; - for (const n of data) { - anumber(n); - if (n >= max) throw new Error(`convertRadix2: invalid data word=${n} from=${from}`); - carry = (carry << from) | n; - if (pos + from > 32) throw new Error(`convertRadix2: carry overflow pos=${pos} from=${from}`); - pos += from; - for (; pos >= to; pos -= to) res.push(((carry >> (pos - to)) & mask) >>> 0); - const pow = powers[pos]; - if (pow === undefined) throw new Error('invalid carry'); - carry &= pow - 1; // clean carry, otherwise it will cause overflow - } - carry = (carry << (to - pos)) & mask; - if (!padding && pos >= from) throw new Error('Excess padding'); - if (!padding && carry > 0) throw new Error(`Non-zero padding: ${carry}`); - if (padding && pos > 0) res.push(carry >>> 0); - return res; -} - -/** - * @__NO_SIDE_EFFECTS__ - */ -function radix(num: number): Coder { - anumber(num); - const _256 = 2 ** 8; - return { - encode: (bytes: Uint8Array) => { - if (!isBytes(bytes)) throw new Error('radix.encode input should be Uint8Array'); - return convertRadix(Array.from(bytes), _256, num); - }, - decode: (digits: number[]) => { - anumArr('radix.decode', digits); - return Uint8Array.from(convertRadix(digits, num, _256)); - }, - }; -} - -/** - * If both bases are power of same number (like `2**8 <-> 2**64`), - * there is a linear algorithm. For now we have implementation for power-of-two bases only. - * @__NO_SIDE_EFFECTS__ - */ -function radix2(bits: number, revPadding = false): Coder { - anumber(bits); - if (bits <= 0 || bits > 32) throw new Error('radix2: bits should be in (0..32]'); - if (radix2carry(8, bits) > 32 || radix2carry(bits, 8) > 32) - throw new Error('radix2: carry overflow'); - return { - encode: (bytes: Uint8Array) => { - if (!isBytes(bytes)) throw new Error('radix2.encode input should be Uint8Array'); - return convertRadix2(Array.from(bytes), 8, bits, !revPadding); - }, - decode: (digits: number[]) => { - anumArr('radix2.decode', digits); - return Uint8Array.from(convertRadix2(digits, bits, 8, revPadding)); - }, - }; -} - -type ArgumentTypes = F extends (...args: infer A) => any ? A : never; -function unsafeWrapper any>(fn: T) { - afn(fn); - return function (...args: ArgumentTypes): ReturnType | void { - try { - return fn.apply(null, args); - } catch (e) {} - }; -} - -function checksum( - len: number, - fn: (data: Uint8Array) => Uint8Array -): Coder { - anumber(len); - afn(fn); - return { - encode(data: Uint8Array) { - if (!isBytes(data)) throw new Error('checksum.encode: input should be Uint8Array'); - const sum = fn(data).slice(0, len); - const res = new Uint8Array(data.length + len); - res.set(data); - res.set(sum, data.length); - return res; - }, - decode(data: Uint8Array) { - if (!isBytes(data)) throw new Error('checksum.decode: input should be Uint8Array'); - const payload = data.slice(0, -len); - const oldChecksum = data.slice(-len); - const newChecksum = fn(payload).slice(0, len); - for (let i = 0; i < len; i++) - if (newChecksum[i] !== oldChecksum[i]) throw new Error('Invalid checksum'); - return payload; - }, - }; -} - -// prettier-ignore -export const utils: { alphabet: typeof alphabet; chain: typeof chain; checksum: typeof checksum; convertRadix: typeof convertRadix; convertRadix2: typeof convertRadix2; radix: typeof radix; radix2: typeof radix2; join: typeof join; padding: typeof padding; } = { - alphabet, chain, checksum, convertRadix, convertRadix2, radix, radix2, join, padding, -}; - -// RFC 4648 aka RFC 3548 -// --------------------- - -/** - * base16 encoding from RFC 4648. - * @example - * ```js - * base16.encode(Uint8Array.from([0x12, 0xab])); - * // => '12AB' - * ``` - */ -export const base16: BytesCoder = chain(radix2(4), alphabet('0123456789ABCDEF'), join('')); - -/** - * base32 encoding from RFC 4648. Has padding. - * Use `base32nopad` for unpadded version. - * Also check out `base32hex`, `base32hexnopad`, `base32crockford`. - * @example - * ```js - * base32.encode(Uint8Array.from([0x12, 0xab])); - * // => 'CKVQ====' - * base32.decode('CKVQ===='); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export const base32: BytesCoder = chain( - radix2(5), - alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'), - padding(5), - join('') -); - -/** - * base32 encoding from RFC 4648. No padding. - * Use `base32` for padded version. - * Also check out `base32hex`, `base32hexnopad`, `base32crockford`. - * @example - * ```js - * base32nopad.encode(Uint8Array.from([0x12, 0xab])); - * // => 'CKVQ' - * base32nopad.decode('CKVQ'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export const base32nopad: BytesCoder = chain( - radix2(5), - alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'), - join('') -); -/** - * base32 encoding from RFC 4648. Padded. Compared to ordinary `base32`, slightly different alphabet. - * Use `base32hexnopad` for unpadded version. - * @example - * ```js - * base32hex.encode(Uint8Array.from([0x12, 0xab])); - * // => '2ALG====' - * base32hex.decode('2ALG===='); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export const base32hex: BytesCoder = chain( - radix2(5), - alphabet('0123456789ABCDEFGHIJKLMNOPQRSTUV'), - padding(5), - join('') -); - -/** - * base32 encoding from RFC 4648. No padding. Compared to ordinary `base32`, slightly different alphabet. - * Use `base32hex` for padded version. - * @example - * ```js - * base32hexnopad.encode(Uint8Array.from([0x12, 0xab])); - * // => '2ALG' - * base32hexnopad.decode('2ALG'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export const base32hexnopad: BytesCoder = chain( - radix2(5), - alphabet('0123456789ABCDEFGHIJKLMNOPQRSTUV'), - join('') -); -/** - * base32 encoding from RFC 4648. Doug Crockford's version. - * https://www.crockford.com/base32.html - * @example - * ```js - * base32crockford.encode(Uint8Array.from([0x12, 0xab])); - * // => '2ANG' - * base32crockford.decode('2ANG'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export const base32crockford: BytesCoder = chain( - radix2(5), - alphabet('0123456789ABCDEFGHJKMNPQRSTVWXYZ'), - join(''), - normalize((s: string) => s.toUpperCase().replace(/O/g, '0').replace(/[IL]/g, '1')) -); - -// Built-in base64 conversion https://caniuse.com/mdn-javascript_builtins_uint8array_frombase64 -// prettier-ignore -const hasBase64Builtin: boolean = /* @__PURE__ */ (() => - typeof (Uint8Array as any).from([]).toBase64 === 'function' && - typeof (Uint8Array as any).fromBase64 === 'function')(); - -const decodeBase64Builtin = (s: string, isUrl: boolean) => { - astr('base64', s); - const re = isUrl ? /^[A-Za-z0-9=_-]+$/ : /^[A-Za-z0-9=+/]+$/; - const alphabet = isUrl ? 'base64url' : 'base64'; - if (s.length > 0 && !re.test(s)) throw new Error('invalid base64'); - return (Uint8Array as any).fromBase64(s, { alphabet, lastChunkHandling: 'strict' }); -}; - -/** - * base64 from RFC 4648. Padded. - * Use `base64nopad` for unpadded version. - * Also check out `base64url`, `base64urlnopad`. - * Falls back to built-in function, when available. - * @example - * ```js - * base64.encode(Uint8Array.from([0x12, 0xab])); - * // => 'Eqs=' - * base64.decode('Eqs='); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -// prettier-ignore -export const base64: BytesCoder = hasBase64Builtin ? { - encode(b) { abytes(b); return (b as any).toBase64(); }, - decode(s) { return decodeBase64Builtin(s, false); }, -} : chain( - radix2(6), - alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'), - padding(6), - join('') -); -/** - * base64 from RFC 4648. No padding. - * Use `base64` for padded version. - * @example - * ```js - * base64nopad.encode(Uint8Array.from([0x12, 0xab])); - * // => 'Eqs' - * base64nopad.decode('Eqs'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export const base64nopad: BytesCoder = chain( - radix2(6), - alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'), - join('') -); - -/** - * base64 from RFC 4648, using URL-safe alphabet. Padded. - * Use `base64urlnopad` for unpadded version. - * Falls back to built-in function, when available. - * @example - * ```js - * base64url.encode(Uint8Array.from([0x12, 0xab])); - * // => 'Eqs=' - * base64url.decode('Eqs='); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -// prettier-ignore -export const base64url: BytesCoder = hasBase64Builtin ? { - encode(b) { abytes(b); return (b as any).toBase64({ alphabet: 'base64url' }); }, - decode(s) { return decodeBase64Builtin(s, true); }, -} : chain( - radix2(6), - alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'), - padding(6), - join('') -); - -/** - * base64 from RFC 4648, using URL-safe alphabet. No padding. - * Use `base64url` for padded version. - * @example - * ```js - * base64urlnopad.encode(Uint8Array.from([0x12, 0xab])); - * // => 'Eqs' - * base64urlnopad.decode('Eqs'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export const base64urlnopad: BytesCoder = chain( - radix2(6), - alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'), - join('') -); - -// base58 code -// ----------- -const genBase58 = /* @__NO_SIDE_EFFECTS__ */ (abc: string) => - chain(radix(58), alphabet(abc), join('')); - -/** - * base58: base64 without ambigous characters +, /, 0, O, I, l. - * Quadratic (O(n^2)) - so, can't be used on large inputs. - * @example - * ```js - * base58.decode('01abcdef'); - * // => '3UhJW' - * ``` - */ -export const base58: BytesCoder = genBase58( - '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' -); -/** - * base58: flickr version. Check out `base58`. - */ -export const base58flickr: BytesCoder = genBase58( - '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' -); -/** - * base58: XRP version. Check out `base58`. - */ -export const base58xrp: BytesCoder = genBase58( - 'rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz' -); - -// Data len (index) -> encoded block len -const XMR_BLOCK_LEN = [0, 2, 3, 5, 6, 7, 9, 10, 11]; - -/** - * base58: XMR version. Check out `base58`. - * Done in 8-byte blocks (which equals 11 chars in decoding). Last (non-full) block padded with '1' to size in XMR_BLOCK_LEN. - * Block encoding significantly reduces quadratic complexity of base58. - */ -export const base58xmr: BytesCoder = { - encode(data: Uint8Array) { - let res = ''; - for (let i = 0; i < data.length; i += 8) { - const block = data.subarray(i, i + 8); - res += base58.encode(block).padStart(XMR_BLOCK_LEN[block.length]!, '1'); - } - return res; - }, - decode(str: string) { - let res: number[] = []; - for (let i = 0; i < str.length; i += 11) { - const slice = str.slice(i, i + 11); - const blockLen = XMR_BLOCK_LEN.indexOf(slice.length); - const block = base58.decode(slice); - for (let j = 0; j < block.length - blockLen; j++) { - if (block[j] !== 0) throw new Error('base58xmr: wrong padding'); - } - res = res.concat(Array.from(block.slice(block.length - blockLen))); - } - return Uint8Array.from(res); - }, -}; - -/** - * Method, which creates base58check encoder. - * Requires function, calculating sha256. - */ -export const createBase58check = (sha256: (data: Uint8Array) => Uint8Array): BytesCoder => - chain( - checksum(4, (data) => sha256(sha256(data))), - base58 - ); - -/** - * Use `createBase58check` instead. - * @deprecated - */ -export const base58check: (sha256: (data: Uint8Array) => Uint8Array) => BytesCoder = - createBase58check; - -// Bech32 code -// ----------- -export interface Bech32Decoded { - prefix: Prefix; - words: number[]; -} -export interface Bech32DecodedWithArray { - prefix: Prefix; - words: number[]; - bytes: Uint8Array; -} - -const BECH_ALPHABET: Coder = chain( - alphabet('qpzry9x8gf2tvdw0s3jn54khce6mua7l'), - join('') -); - -const POLYMOD_GENERATORS = [0x3b6a57b2, 0x26508e6d, 0x1ea119fa, 0x3d4233dd, 0x2a1462b3]; -function bech32Polymod(pre: number): number { - const b = pre >> 25; - let chk = (pre & 0x1ffffff) << 5; - for (let i = 0; i < POLYMOD_GENERATORS.length; i++) { - if (((b >> i) & 1) === 1) chk ^= POLYMOD_GENERATORS[i]!; - } - return chk; -} - -function bechChecksum(prefix: string, words: number[], encodingConst = 1): string { - const len = prefix.length; - let chk = 1; - for (let i = 0; i < len; i++) { - const c = prefix.charCodeAt(i); - if (c < 33 || c > 126) throw new Error(`Invalid prefix (${prefix})`); - chk = bech32Polymod(chk) ^ (c >> 5); - } - chk = bech32Polymod(chk); - for (let i = 0; i < len; i++) chk = bech32Polymod(chk) ^ (prefix.charCodeAt(i) & 0x1f); - for (let v of words) chk = bech32Polymod(chk) ^ v; - for (let i = 0; i < 6; i++) chk = bech32Polymod(chk); - chk ^= encodingConst; - return BECH_ALPHABET.encode(convertRadix2([chk % powers[30]!], 30, 5, false)); -} - -export interface Bech32 { - encode( - prefix: Prefix, - words: number[] | Uint8Array, - limit?: number | false - ): `${Lowercase}1${string}`; - decode( - str: `${Prefix}1${string}`, - limit?: number | false - ): Bech32Decoded; - encodeFromBytes(prefix: string, bytes: Uint8Array): string; - decodeToBytes(str: string): Bech32DecodedWithArray; - decodeUnsafe(str: string, limit?: number | false): void | Bech32Decoded; - fromWords(to: number[]): Uint8Array; - fromWordsUnsafe(to: number[]): void | Uint8Array; - toWords(from: Uint8Array): number[]; -} -/** - * @__NO_SIDE_EFFECTS__ - */ -function genBech32(encoding: 'bech32' | 'bech32m'): Bech32 { - const ENCODING_CONST = encoding === 'bech32' ? 1 : 0x2bc830a3; - const _words = radix2(5); - const fromWords = _words.decode; - const toWords = _words.encode; - const fromWordsUnsafe = unsafeWrapper(fromWords); - - function encode( - prefix: Prefix, - words: number[] | Uint8Array, - limit: number | false = 90 - ): `${Lowercase}1${string}` { - astr('bech32.encode prefix', prefix); - if (isBytes(words)) words = Array.from(words); - anumArr('bech32.encode', words); - const plen = prefix.length; - if (plen === 0) throw new TypeError(`Invalid prefix length ${plen}`); - const actualLength = plen + 7 + words.length; - if (limit !== false && actualLength > limit) - throw new TypeError(`Length ${actualLength} exceeds limit ${limit}`); - const lowered = prefix.toLowerCase(); - const sum = bechChecksum(lowered, words, ENCODING_CONST); - return `${lowered}1${BECH_ALPHABET.encode(words)}${sum}` as `${Lowercase}1${string}`; - } - - function decode( - str: `${Prefix}1${string}`, - limit?: number | false - ): Bech32Decoded; - function decode(str: string, limit?: number | false): Bech32Decoded; - function decode(str: string, limit: number | false = 90): Bech32Decoded { - astr('bech32.decode input', str); - const slen = str.length; - if (slen < 8 || (limit !== false && slen > limit)) - throw new TypeError(`invalid string length: ${slen} (${str}). Expected (8..${limit})`); - // don't allow mixed case - const lowered = str.toLowerCase(); - if (str !== lowered && str !== str.toUpperCase()) - throw new Error(`String must be lowercase or uppercase`); - const sepIndex = lowered.lastIndexOf('1'); - if (sepIndex === 0 || sepIndex === -1) - throw new Error(`Letter "1" must be present between prefix and data only`); - const prefix = lowered.slice(0, sepIndex); - const data = lowered.slice(sepIndex + 1); - if (data.length < 6) throw new Error('Data must be at least 6 characters long'); - const words = BECH_ALPHABET.decode(data).slice(0, -6); - const sum = bechChecksum(prefix, words, ENCODING_CONST); - if (!data.endsWith(sum)) throw new Error(`Invalid checksum in ${str}: expected "${sum}"`); - return { prefix, words }; - } - - const decodeUnsafe = unsafeWrapper(decode); - - function decodeToBytes(str: string): Bech32DecodedWithArray { - const { prefix, words } = decode(str, false); - return { prefix, words, bytes: fromWords(words) }; - } - - function encodeFromBytes(prefix: string, bytes: Uint8Array) { - return encode(prefix, toWords(bytes)); - } - - return { - encode, - decode, - encodeFromBytes, - decodeToBytes, - decodeUnsafe, - fromWords, - fromWordsUnsafe, - toWords, - }; -} - -/** - * bech32 from BIP 173. Operates on words. - * For high-level, check out scure-btc-signer: - * https://github.com/paulmillr/scure-btc-signer. - */ -export const bech32: Bech32 = genBech32('bech32'); - -/** - * bech32m from BIP 350. Operates on words. - * It was to mitigate `bech32` weaknesses. - * For high-level, check out scure-btc-signer: - * https://github.com/paulmillr/scure-btc-signer. - */ -export const bech32m: Bech32 = genBech32('bech32m'); - -declare const TextEncoder: any; -declare const TextDecoder: any; - -/** - * UTF-8-to-byte decoder. Uses built-in TextDecoder / TextEncoder. - * @example - * ```js - * const b = utf8.decode("hey"); // => new Uint8Array([ 104, 101, 121 ]) - * const str = utf8.encode(b); // "hey" - * ``` - */ -export const utf8: BytesCoder = { - encode: (data) => new TextDecoder().decode(data), - decode: (str) => new TextEncoder().encode(str), -}; - -// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex -// prettier-ignore -const hasHexBuiltin: boolean = /* @__PURE__ */ (() => - typeof (Uint8Array as any).from([]).toHex === 'function' && - typeof (Uint8Array as any).fromHex === 'function')(); -// prettier-ignore -const hexBuiltin: BytesCoder = { - encode(data) { abytes(data); return (data as any).toHex(); }, - decode(s) { astr('hex', s); return (Uint8Array as any).fromHex(s); }, -}; -/** - * hex string decoder. Uses built-in function, when available. - * @example - * ```js - * const b = hex.decode("0102ff"); // => new Uint8Array([ 1, 2, 255 ]) - * const str = hex.encode(b); // "0102ff" - * ``` - */ -export const hex: BytesCoder = hasHexBuiltin - ? hexBuiltin - : chain( - radix2(4), - alphabet('0123456789abcdef'), - join(''), - normalize((s: string) => { - if (typeof s !== 'string' || s.length % 2 !== 0) - throw new TypeError( - `hex.decode: expected string, got ${typeof s} with length ${s.length}` - ); - return s.toLowerCase(); - }) - ); - -export type SomeCoders = { - utf8: BytesCoder; - hex: BytesCoder; - base16: BytesCoder; - base32: BytesCoder; - base64: BytesCoder; - base64url: BytesCoder; - base58: BytesCoder; - base58xmr: BytesCoder; -}; -// prettier-ignore -const CODERS: SomeCoders = { - utf8, hex, base16, base32, base64, base64url, base58, base58xmr -}; -type CoderType = keyof SomeCoders; -const coderTypeError = - 'Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr'; - -/** @deprecated */ -export const bytesToString = (type: CoderType, bytes: Uint8Array): string => { - if (typeof type !== 'string' || !CODERS.hasOwnProperty(type)) throw new TypeError(coderTypeError); - if (!isBytes(bytes)) throw new TypeError('bytesToString() expects Uint8Array'); - return CODERS[type].encode(bytes); -}; - -/** @deprecated */ -export const str: (type: CoderType, bytes: Uint8Array) => string = bytesToString; // as in python, but for bytes only - -/** @deprecated */ -export const stringToBytes = (type: CoderType, str: string): Uint8Array => { - if (!CODERS.hasOwnProperty(type)) throw new TypeError(coderTypeError); - if (typeof str !== 'string') throw new TypeError('stringToBytes() expects string'); - return CODERS[type].decode(str); -}; -/** @deprecated */ -export const bytes: (type: CoderType, str: string) => Uint8Array = stringToBytes; diff --git a/tools/mnemonic-test/node_modules/@scure/base/package.json b/tools/mnemonic-test/node_modules/@scure/base/package.json deleted file mode 100644 index 784cc2f1..00000000 --- a/tools/mnemonic-test/node_modules/@scure/base/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "@scure/base", - "version": "2.0.0", - "description": "Secure, audited & 0-dep implementation of base64, bech32, base58, base32 & base16", - "files": [ - "index.js", - "index.js.map", - "index.d.ts", - "index.d.ts.map", - "index.ts" - ], - "devDependencies": { - "@noble/hashes": "2.0.0", - "@paulmillr/jsbt": "0.4.4", - "@types/node": "24.2.1", - "fast-check": "4.2.0", - "prettier": "3.6.2", - "typescript": "5.9.2" - }, - "scripts": { - "bench": "node test/benchmark/index.ts", - "build": "tsc", - "build:release": "npx --no @paulmillr/jsbt esbuild test/build", - "format": "prettier --write index.ts test/*.test.ts", - "test": "node test/index.ts", - "test:bun": "bun test/index.ts", - "test:deno": "deno --allow-env --allow-read test/index.ts && deno test/deno.ts", - "test:node20": "cd test; npx tsc; node compiled/test/index.js" - }, - "keywords": [ - "bech32", - "bech32m", - "base64", - "base58", - "base32", - "base16", - "rfc4648", - "rfc3548", - "crockford", - "encode", - "encoder", - "base-x", - "base" - ], - "homepage": "https://paulmillr.com/noble/#scure", - "funding": "https://paulmillr.com/funding/", - "repository": { - "type": "git", - "url": "git+https://github.com/paulmillr/scure-base.git" - }, - "type": "module", - "main": "index.js", - "module": "index.js", - "types": "index.d.ts", - "sideEffects": false, - "author": "Paul Miller (https://paulmillr.com)", - "license": "MIT" -} diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/LICENSE b/tools/mnemonic-test/node_modules/@scure/bip32/LICENSE deleted file mode 100644 index 68222b80..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the “Software”), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/README.md b/tools/mnemonic-test/node_modules/@scure/bip32/README.md deleted file mode 100644 index cf39ce97..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/README.md +++ /dev/null @@ -1,158 +0,0 @@ -# scure-bip32 - -Audited & minimal implementation of BIP32 hierarchical deterministic (HD) wallets over secp256k1. - -- 🔒 [Audited](#security) by an independent security firm -- 🔻 Tree-shakeable: unused code is excluded from your builds -- 📦 ESM -- ➰ Only 3 audited dependencies by the same author: - [noble-curves](https://github.com/paulmillr/noble-curves), - [noble-hashes](https://github.com/paulmillr/noble-hashes), - and [scure-base](https://github.com/paulmillr/scure-base) -- 🪶 18KB gzipped with all dependencies bundled - -Check out [scure-bip39](https://github.com/paulmillr/scure-bip39) if you need mnemonic phrases. -See [key-producer](https://github.com/paulmillr/micro-key-producer) if you need SLIP-0010/BIP32 ed25519 hdkey implementation. -Notice [Warnings about BIP32](#warnings-about-bip32). - -### This library belongs to _scure_ - -> **scure** — audited micro-libraries. - -- Zero or minimal dependencies -- Highly readable TypeScript / JS code -- PGP-signed releases and transparent NPM builds -- Check out [homepage](https://paulmillr.com/noble/#scure) & all libraries: - [base](https://github.com/paulmillr/scure-base), - [bip32](https://github.com/paulmillr/scure-bip32), - [bip39](https://github.com/paulmillr/scure-bip39), - [btc-signer](https://github.com/paulmillr/scure-btc-signer), - [sr25519](https://github.com/paulmillr/scure-sr25519), - [starknet](https://github.com/paulmillr/scure-starknet) - -## Usage - -> `npm install @scure/bip32` - -> `deno add jsr:@scure/bip32` - -This module exports a single class `HDKey`, which should be used like this: - -```ts -import { HDKey } from '@scure/bip32'; -const hdkey1 = HDKey.fromMasterSeed(seed); -const hdkey2 = HDKey.fromExtendedKey(base58key); -const hdkey3 = HDKey.fromJSON({ xpriv: string }); - -// props -[hdkey1.depth, hdkey1.index, hdkey1.chainCode]; -console.log(hdkey2.privateKey, hdkey2.publicKey); -console.log(hdkey3.derive("m/0/2147483647'/1")); -const sig = hdkey3.sign(hash); -hdkey3.verify(hash, sig); -``` - -Note: `chainCode` property is essentially a private part -of a secret "master" key, it should be guarded from unauthorized access. - -The full API is: - -```ts -class HDKey { - public static HARDENED_OFFSET: number; - public static fromMasterSeed(seed: Uint8Array, versions: Versions): HDKey; - public static fromExtendedKey(base58key: string, versions: Versions): HDKey; - public static fromJSON(json: { xpriv: string }): HDKey; - - readonly versions: Versions; - readonly depth: number = 0; - readonly index: number = 0; - readonly chainCode: Uint8Array | null = null; - readonly parentFingerprint: number = 0; - - get fingerprint(): number; - get identifier(): Uint8Array | undefined; - get pubKeyHash(): Uint8Array | undefined; - get privateKey(): Uint8Array | null; - get publicKey(): Uint8Array | null; - get privateExtendedKey(): string; - get publicExtendedKey(): string; - - derive(path: string): HDKey; - deriveChild(index: number): HDKey; - sign(hash: Uint8Array): Uint8Array; - verify(hash: Uint8Array, signature: Uint8Array): boolean; - wipePrivateData(): this; -} - -interface Versions { - private: number; - public: number; -} -``` - -The module implements [bip32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki) standard: -check it out for additional documentation. - -The implementation is loosely based on cryptocoinjs/hdkey, [which has MIT License](#LICENSE). - -## Warnings about BIP32 - -BIP32 is a bad standard. It would be great if we've had something better. - -- Network IDs (different currencies) are taken from a single GitHub document - called SLIP-0044 -- There were new projects, which did not yet have SLIP. Exchanges added support of - those projects to their cold wallets. Then after the projects were added to SLIP, - the exchanges were required to re-generate their cold wallets - a complicated task -- BIP32 is unusable for many different elliptic curves. For example, ETH2 uses bls12-381 - curve, and with bip32 54% of generated keys would be invalid. So, they’re using much better - BLS-only EIP-2333 as a replacement. -- It’s easy to shoot yourself in foot with non-hardened keys, which - could allow simple de-anonimization of all addresses - -## Security - -The library has been independently audited: - -- at version 1.0.1, in Jan 2022, by [cure53](https://cure53.de) - - PDFs: [online](https://cure53.de/pentest-report_hashing-libs.pdf), [offline](./audit/2022-01-05-cure53-audit-nbl2.pdf) - - [Changes since audit](https://github.com/paulmillr/scure-bip32/compare/1.0.0..main). - - The audit has been funded by [Ethereum Foundation](https://ethereum.org/en/) with help of [Nomic Labs](https://nomiclabs.io) - -The library was initially developed for [js-ethereum-cryptography](https://github.com/ethereum/js-ethereum-cryptography). -At commit [ae00e6d7](https://github.com/ethereum/js-ethereum-cryptography/commit/ae00e6d7d24fb3c76a1c7fe10039f6ecd120b77e), -it was extracted to a separate package called `micro-bip32`. -After the audit we've decided to use `@scure` NPM namespace for security. - -### Supply chain security - -- **Commits** are signed with PGP keys, to prevent forgery. Make sure to verify commit signatures -- **Releases** are transparent and built on GitHub CI. Make sure to verify [provenance](https://docs.npmjs.com/generating-provenance-statements) logs - - Use GitHub CLI to verify single-file builds: - `gh attestation verify --owner paulmillr scure-bip32.js` -- **Rare releasing** is followed to ensure less re-audit need for end-users -- **Dependencies** are minimized and locked-down: any dependency could get hacked and users will be downloading malware with every install. - - We make sure to use as few dependencies as possible - - Automatic dep updates are prevented by locking-down version ranges; diffs are checked with `npm-diff` -- **Dev Dependencies** are disabled for end-users; they are only used to develop / build the source code - -For this package, there are 3 dependencies; and a few dev dependencies: - -- [noble-hashes](https://github.com/paulmillr/noble-hashes) provides cryptographic hashing functionality -- [noble-curves](https://github.com/paulmillr/noble-curves) provides ECDSA -- [scure-base](https://github.com/paulmillr/scure-base) provides base58 -- micro-bmark, micro-should and jsbt are used for benchmarking / testing / build tooling and developed by the same author -- prettier, fast-check and typescript are used for code quality / test generation / ts compilation. It's hard to audit their source code thoroughly and fully because of their size - -## Contributing & testing - -- `npm install && npm run build && npm test` will build the code and run tests. -- `npm run lint` / `npm run format` will run linter / fix linter issues. -- `npm run build:release` will build single file - -## License - -[MIT License](./LICENSE) - -Copyright (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/index.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/index.d.ts deleted file mode 100644 index 9f79aa18..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/index.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -/** Network-specific versioning. */ -export interface Versions { - private: number; - public: number; -} -/** Hardened offset from Bitcoin, default */ -export declare const HARDENED_OFFSET: number; -interface HDKeyOpt { - versions?: Versions; - depth?: number; - index?: number; - parentFingerprint?: number; - chainCode?: Uint8Array; - publicKey?: Uint8Array; - privateKey?: Uint8Array; -} -/** - * HDKey from BIP32 - * @example -```js -const hdkey1 = HDKey.fromMasterSeed(seed); -const hdkey2 = HDKey.fromExtendedKey(base58key); -const hdkey3 = HDKey.fromJSON({ xpriv: string }); -``` - */ -export declare class HDKey { - get fingerprint(): number; - get identifier(): Uint8Array | undefined; - get pubKeyHash(): Uint8Array | undefined; - get privateKey(): Uint8Array | null; - get publicKey(): Uint8Array | null; - get privateExtendedKey(): string; - get publicExtendedKey(): string; - static fromMasterSeed(seed: Uint8Array, versions?: Versions): HDKey; - static fromExtendedKey(base58key: string, versions?: Versions): HDKey; - static fromJSON(json: { - xpriv: string; - }): HDKey; - readonly versions: Versions; - readonly depth: number; - readonly index: number; - readonly chainCode: Uint8Array | null; - readonly parentFingerprint: number; - private _privateKey?; - private _publicKey?; - private pubHash; - constructor(opt: HDKeyOpt); - derive(path: string): HDKey; - deriveChild(index: number): HDKey; - sign(hash: Uint8Array): Uint8Array; - verify(hash: Uint8Array, signature: Uint8Array): boolean; - wipePrivateData(): this; - toJSON(): { - xpriv: string; - xpub: string; - }; - private serialize; -} -export {}; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/index.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/index.d.ts.map deleted file mode 100644 index 14e4eca0..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAgCA,mCAAmC;AACnC,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAGD,4CAA4C;AAC5C,eAAO,MAAM,eAAe,EAAE,MAAmB,CAAC;AAalD,UAAU,QAAQ;IAChB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,K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AE,MAAM,GAAG,KAAK;IAqDjC,IAAI,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU;IAQlC,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,GAAG,OAAO;IASxD,eAAe,IAAI,IAAI;IAOvB,MAAM,IAAI;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE;IAOzC,OAAO,CAAC,SAAS;CAelB"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/index.js b/tools/mnemonic-test/node_modules/@scure/bip32/index.js deleted file mode 100644 index 935277b9..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/index.js +++ /dev/null @@ -1,283 +0,0 @@ -/** - * BIP32 hierarchical deterministic (HD) wallets over secp256k1. - * @module - * @example - * ```js - * import { HDKey } from "@scure/bip32"; - * const hdkey1 = HDKey.fromMasterSeed(seed); - * const hdkey2 = HDKey.fromExtendedKey(base58key); - * const hdkey3 = HDKey.fromJSON({ xpriv: string }); - * - * // props - * [hdkey1.depth, hdkey1.index, hdkey1.chainCode]; - * console.log(hdkey2.privateKey, hdkey2.publicKey); - * console.log(hdkey3.derive("m/0/2147483647'/1")); - * const sig = hdkey3.sign(hash); - * hdkey3.verify(hash, sig); - * ``` - */ -/*! scure-bip32 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) */ -import { secp256k1 as secp } from '@noble/curves/secp256k1.js'; -import { hmac } from '@noble/hashes/hmac.js'; -import { ripemd160 } from '@noble/hashes/legacy.js'; -import { sha256, sha512 } from '@noble/hashes/sha2.js'; -import { abytes, concatBytes, createView } from '@noble/hashes/utils.js'; -import { createBase58check } from '@scure/base'; -const Point = secp.Point; -const { Fn } = Point; -const base58check = createBase58check(sha256); -const MASTER_SECRET = Uint8Array.from('Bitcoin seed'.split(''), (char) => char.charCodeAt(0)); -const BITCOIN_VERSIONS = { private: 0x0488ade4, public: 0x0488b21e }; -/** Hardened offset from Bitcoin, default */ -export const HARDENED_OFFSET = 0x80000000; -const hash160 = (data) => ripemd160(sha256(data)); -const fromU32 = (data) => createView(data).getUint32(0, false); -const toU32 = (n) => { - if (!Number.isSafeInteger(n) || n < 0 || n > 2 ** 32 - 1) { - throw new Error('invalid number, should be from 0 to 2**32-1, got ' + n); - } - const buf = new Uint8Array(4); - createView(buf).setUint32(0, n, false); - return buf; -}; -/** - * HDKey from BIP32 - * @example -```js -const hdkey1 = HDKey.fromMasterSeed(seed); -const hdkey2 = HDKey.fromExtendedKey(base58key); -const hdkey3 = HDKey.fromJSON({ xpriv: string }); -``` - */ -export class HDKey { - get fingerprint() { - if (!this.pubHash) { - throw new Error('No publicKey set!'); - } - return fromU32(this.pubHash); - } - get identifier() { - return this.pubHash; - } - get pubKeyHash() { - return this.pubHash; - } - get privateKey() { - return this._privateKey || null; - } - get publicKey() { - return this._publicKey || null; - } - get privateExtendedKey() { - const priv = this._privateKey; - if (!priv) { - throw new Error('No private key'); - } - return base58check.encode(this.serialize(this.versions.private, concatBytes(Uint8Array.of(0), priv))); - } - get publicExtendedKey() { - if (!this._publicKey) { - throw new Error('No public key'); - } - return base58check.encode(this.serialize(this.versions.public, this._publicKey)); - } - static fromMasterSeed(seed, versions = BITCOIN_VERSIONS) { - abytes(seed); - if (8 * seed.length < 128 || 8 * seed.length > 512) { - throw new Error('HDKey: seed length must be between 128 and 512 bits; 256 bits is advised, got ' + - seed.length); - } - const I = hmac(sha512, MASTER_SECRET, seed); - const privateKey = I.slice(0, 32); - const chainCode = I.slice(32); - return new HDKey({ versions, chainCode, privateKey }); - } - static fromExtendedKey(base58key, versions = BITCOIN_VERSIONS) { - // => version(4) || depth(1) || fingerprint(4) || index(4) || chain(32) || key(33) - const keyBuffer = base58check.decode(base58key); - const keyView = createView(keyBuffer); - const version = keyView.getUint32(0, false); - const opt = { - versions, - depth: keyBuffer[4], - parentFingerprint: keyView.getUint32(5, false), - index: keyView.getUint32(9, false), - chainCode: keyBuffer.slice(13, 45), - }; - const key = keyBuffer.slice(45); - const isPriv = key[0] === 0; - if (version !== versions[isPriv ? 'private' : 'public']) { - throw new Error('Version mismatch'); - } - if (isPriv) { - return new HDKey({ ...opt, privateKey: key.slice(1) }); - } - else { - return new HDKey({ ...opt, publicKey: key }); - } - } - static fromJSON(json) { - return HDKey.fromExtendedKey(json.xpriv); - } - versions; - depth = 0; - index = 0; - chainCode = null; - parentFingerprint = 0; - _privateKey; - _publicKey; - pubHash; - constructor(opt) { - if (!opt || typeof opt !== 'object') { - throw new Error('HDKey.constructor must not be called directly'); - } - this.versions = opt.versions || BITCOIN_VERSIONS; - this.depth = opt.depth || 0; - this.chainCode = opt.chainCode || null; - this.index = opt.index || 0; - this.parentFingerprint = opt.parentFingerprint || 0; - if (!this.depth) { - if (this.parentFingerprint || this.index) { - throw new Error('HDKey: zero depth with non-zero index/parent fingerprint'); - } - } - if (this.depth > 255) { - throw new Error('HDKey: depth exceeds the serializable value 255'); - } - if (opt.publicKey && opt.privateKey) { - throw new Error('HDKey: publicKey and privateKey at same time.'); - } - if (opt.privateKey) { - if (!secp.utils.isValidSecretKey(opt.privateKey)) - throw new Error('Invalid private key'); - this._privateKey = opt.privateKey; - this._publicKey = secp.getPublicKey(opt.privateKey, true); - } - else if (opt.publicKey) { - this._publicKey = Point.fromBytes(opt.publicKey).toBytes(true); // force compressed point - } - else { - throw new Error('HDKey: no public or private key provided'); - } - this.pubHash = hash160(this._publicKey); - } - derive(path) { - if (!/^[mM]'?/.test(path)) { - throw new Error('Path must start with "m" or "M"'); - } - if (/^[mM]'?$/.test(path)) { - return this; - } - const parts = path.replace(/^[mM]'?\//, '').split('/'); - // tslint:disable-next-line - let child = this; - for (const c of parts) { - const m = /^(\d+)('?)$/.exec(c); - const m1 = m && m[1]; - if (!m || m.length !== 3 || typeof m1 !== 'string') - throw new Error('invalid child index: ' + c); - let idx = +m1; - if (!Number.isSafeInteger(idx) || idx >= HARDENED_OFFSET) { - throw new Error('Invalid index'); - } - // hardened key - if (m[2] === "'") { - idx += HARDENED_OFFSET; - } - child = child.deriveChild(idx); - } - return child; - } - deriveChild(index) { - if (!this._publicKey || !this.chainCode) { - throw new Error('No publicKey or chainCode set'); - } - let data = toU32(index); - if (index >= HARDENED_OFFSET) { - // Hardened - const priv = this._privateKey; - if (!priv) { - throw new Error('Could not derive hardened child key'); - } - // Hardened child: 0x00 || ser256(kpar) || ser32(index) - data = concatBytes(Uint8Array.of(0), priv, data); - } - else { - // Normal child: serP(point(kpar)) || ser32(index) - data = concatBytes(this._publicKey, data); - } - const I = hmac(sha512, this.chainCode, data); - const childTweak = I.slice(0, 32); - const chainCode = I.slice(32); - if (!secp.utils.isValidSecretKey(childTweak)) { - throw new Error('Tweak bigger than curve order'); - } - const opt = { - versions: this.versions, - chainCode, - depth: this.depth + 1, - parentFingerprint: this.fingerprint, - index, - }; - const ctweak = Fn.fromBytes(childTweak); - try { - // Private parent key -> private child key - if (this._privateKey) { - const added = Fn.create(Fn.fromBytes(this._privateKey) + ctweak); - if (!Fn.isValidNot0(added)) { - throw new Error('The tweak was out of range or the resulted private key is invalid'); - } - opt.privateKey = Fn.toBytes(added); - } - else { - const added = Point.fromBytes(this._publicKey).add(Point.BASE.multiply(ctweak)); - // Cryptographically impossible: hmac-sha512 preimage would need to be found - if (added.equals(Point.ZERO)) { - throw new Error('The tweak was equal to negative P, which made the result key invalid'); - } - opt.publicKey = added.toBytes(true); - } - return new HDKey(opt); - } - catch (err) { - return this.deriveChild(index + 1); - } - } - sign(hash) { - if (!this._privateKey) { - throw new Error('No privateKey set!'); - } - abytes(hash, 32); - return secp.sign(hash, this._privateKey, { prehash: false }); - } - verify(hash, signature) { - abytes(hash, 32); - abytes(signature, 64); - if (!this._publicKey) { - throw new Error('No publicKey set!'); - } - return secp.verify(signature, hash, this._publicKey, { prehash: false }); - } - wipePrivateData() { - if (this._privateKey) { - this._privateKey.fill(0); - this._privateKey = undefined; - } - return this; - } - toJSON() { - return { - xpriv: this.privateExtendedKey, - xpub: this.publicExtendedKey, - }; - } - serialize(version, key) { - if (!this.chainCode) { - throw new Error('No chainCode set'); - } - abytes(key, 33); - // version(4) || depth(1) || fingerprint(4) || index(4) || chain(32) || key(33) - return concatBytes(toU32(version), new Uint8Array([this.depth]), toU32(this.parentFingerprint), toU32(this.index), this.chainCode, key); - } -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/index.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/index.js.map deleted file mode 100644 index f17c0a63..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,yFAAyF;AACzF,OAAO,EAAE,SAAS,IAAI,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;AACzB,MAAM,EAAE,EAAE,EAAE,GAAG,KAAK,CAAC;AACrB,MAAM,WAAW,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;AAE9C,MAAM,aAAa,GAAG,UAAU,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;AAQ9F,MAAM,gBAAgB,GAAa,EAAE,OAAO,EAAE,UA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AAC,CAAC,CAAC,CAAC;YACzB,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;QAC/B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM;QACJ,OAAO;YACL,KAAK,EAAE,IAAI,CAAC,kBAAkB;YAC9B,IAAI,EAAE,IAAI,CAAC,iBAAiB;SAC7B,CAAC;IACJ,CAAC;IAEO,SAAS,CAAC,OAAe,EAAE,GAAe;QAChD,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;QACtC,CAAC;QACD,MAAM,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAChB,+EAA+E;QAC/E,OAAO,WAAW,CAChB,KAAK,CAAC,OAAO,CAAC,EACd,IAAI,UAAU,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAC5B,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,EAC7B,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EACjB,IAAI,CAAC,SAAS,EACd,GAAG,CACJ,CAAC;IACJ,CAAC;CACF"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/index.ts b/tools/mnemonic-test/node_modules/@scure/bip32/index.ts deleted file mode 100644 index ae239aab..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/index.ts +++ /dev/null @@ -1,317 +0,0 @@ -/** - * BIP32 hierarchical deterministic (HD) wallets over secp256k1. - * @module - * @example - * ```js - * import { HDKey } from "@scure/bip32"; - * const hdkey1 = HDKey.fromMasterSeed(seed); - * const hdkey2 = HDKey.fromExtendedKey(base58key); - * const hdkey3 = HDKey.fromJSON({ xpriv: string }); - * - * // props - * [hdkey1.depth, hdkey1.index, hdkey1.chainCode]; - * console.log(hdkey2.privateKey, hdkey2.publicKey); - * console.log(hdkey3.derive("m/0/2147483647'/1")); - * const sig = hdkey3.sign(hash); - * hdkey3.verify(hash, sig); - * ``` - */ -/*! scure-bip32 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) */ -import { secp256k1 as secp } from '@noble/curves/secp256k1.js'; -import { hmac } from '@noble/hashes/hmac.js'; -import { ripemd160 } from '@noble/hashes/legacy.js'; -import { sha256, sha512 } from '@noble/hashes/sha2.js'; -import { abytes, concatBytes, createView } from '@noble/hashes/utils.js'; -import { createBase58check } from '@scure/base'; - -const Point = secp.Point; -const { Fn } = Point; -const base58check = createBase58check(sha256); - -const MASTER_SECRET = Uint8Array.from('Bitcoin seed'.split(''), (char) => char.charCodeAt(0)); - -/** Network-specific versioning. */ -export interface Versions { - private: number; - public: number; -} - -const BITCOIN_VERSIONS: Versions = { private: 0x0488ade4, public: 0x0488b21e }; -/** Hardened offset from Bitcoin, default */ -export const HARDENED_OFFSET: number = 0x80000000; - -const hash160 = (data: Uint8Array) => ripemd160(sha256(data)); -const fromU32 = (data: Uint8Array) => createView(data).getUint32(0, false); -const toU32 = (n: number): Uint8Array => { - if (!Number.isSafeInteger(n) || n < 0 || n > 2 ** 32 - 1) { - throw new Error('invalid number, should be from 0 to 2**32-1, got ' + n); - } - const buf = new Uint8Array(4); - createView(buf).setUint32(0, n, false); - return buf; -}; - -interface HDKeyOpt { - versions?: Versions; - depth?: number; - index?: number; - parentFingerprint?: number; - chainCode?: Uint8Array; - publicKey?: Uint8Array; - privateKey?: Uint8Array; -} - -/** - * HDKey from BIP32 - * @example -```js -const hdkey1 = HDKey.fromMasterSeed(seed); -const hdkey2 = HDKey.fromExtendedKey(base58key); -const hdkey3 = HDKey.fromJSON({ xpriv: string }); -``` - */ -export class HDKey { - get fingerprint(): number { - if (!this.pubHash) { - throw new Error('No publicKey set!'); - } - return fromU32(this.pubHash); - } - get identifier(): Uint8Array | undefined { - return this.pubHash; - } - get pubKeyHash(): Uint8Array | undefined { - return this.pubHash; - } - get privateKey(): Uint8Array | null { - return this._privateKey || null; - } - get publicKey(): Uint8Array | null { - return this._publicKey || null; - } - get privateExtendedKey(): string { - const priv = this._privateKey; - if (!priv) { - throw new Error('No private key'); - } - return base58check.encode( - this.serialize(this.versions.private, concatBytes(Uint8Array.of(0), priv)) - ); - } - get publicExtendedKey(): string { - if (!this._publicKey) { - throw new Error('No public key'); - } - return base58check.encode(this.serialize(this.versions.public, this._publicKey)); - } - - static fromMasterSeed(seed: Uint8Array, versions: Versions = BITCOIN_VERSIONS): HDKey { - abytes(seed); - if (8 * seed.length < 128 || 8 * seed.length > 512) { - throw new Error( - 'HDKey: seed length must be between 128 and 512 bits; 256 bits is advised, got ' + - seed.length - ); - } - const I = hmac(sha512, MASTER_SECRET, seed); - const privateKey = I.slice(0, 32); - const chainCode = I.slice(32); - return new HDKey({ versions, chainCode, privateKey }); - } - - static fromExtendedKey(base58key: string, versions: Versions = BITCOIN_VERSIONS): HDKey { - // => version(4) || depth(1) || fingerprint(4) || index(4) || chain(32) || key(33) - const keyBuffer: Uint8Array = base58check.decode(base58key); - const keyView = createView(keyBuffer); - const version = keyView.getUint32(0, false); - const opt = { - versions, - depth: keyBuffer[4], - parentFingerprint: keyView.getUint32(5, false), - index: keyView.getUint32(9, false), - chainCode: keyBuffer.slice(13, 45), - }; - const key = keyBuffer.slice(45); - const isPriv = key[0] === 0; - if (version !== versions[isPriv ? 'private' : 'public']) { - throw new Error('Version mismatch'); - } - if (isPriv) { - return new HDKey({ ...opt, privateKey: key.slice(1) }); - } else { - return new HDKey({ ...opt, publicKey: key }); - } - } - - public static fromJSON(json: { xpriv: string }): HDKey { - return HDKey.fromExtendedKey(json.xpriv); - } - readonly versions: Versions; - readonly depth: number = 0; - readonly index: number = 0; - readonly chainCode: Uint8Array | null = null; - readonly parentFingerprint: number = 0; - private _privateKey?: Uint8Array; - private _publicKey?: Uint8Array; - private pubHash: Uint8Array | undefined; - - constructor(opt: HDKeyOpt) { - if (!opt || typeof opt !== 'object') { - throw new Error('HDKey.constructor must not be called directly'); - } - this.versions = opt.versions || BITCOIN_VERSIONS; - this.depth = opt.depth || 0; - this.chainCode = opt.chainCode || null; - this.index = opt.index || 0; - this.parentFingerprint = opt.parentFingerprint || 0; - if (!this.depth) { - if (this.parentFingerprint || this.index) { - throw new Error('HDKey: zero depth with non-zero index/parent fingerprint'); - } - } - if (this.depth > 255) { - throw new Error('HDKey: depth exceeds the serializable value 255'); - } - if (opt.publicKey && opt.privateKey) { - throw new Error('HDKey: publicKey and privateKey at same time.'); - } - if (opt.privateKey) { - if (!secp.utils.isValidSecretKey(opt.privateKey)) throw new Error('Invalid private key'); - this._privateKey = opt.privateKey; - this._publicKey = secp.getPublicKey(opt.privateKey, true); - } else if (opt.publicKey) { - this._publicKey = Point.fromBytes(opt.publicKey).toBytes(true); // force compressed point - } else { - throw new Error('HDKey: no public or private key provided'); - } - this.pubHash = hash160(this._publicKey); - } - - derive(path: string): HDKey { - if (!/^[mM]'?/.test(path)) { - throw new Error('Path must start with "m" or "M"'); - } - if (/^[mM]'?$/.test(path)) { - return this; - } - const parts = path.replace(/^[mM]'?\//, '').split('/'); - // tslint:disable-next-line - let child: HDKey = this; - for (const c of parts) { - const m = /^(\d+)('?)$/.exec(c); - const m1 = m && m[1]; - if (!m || m.length !== 3 || typeof m1 !== 'string') - throw new Error('invalid child index: ' + c); - let idx = +m1; - if (!Number.isSafeInteger(idx) || idx >= HARDENED_OFFSET) { - throw new Error('Invalid index'); - } - // hardened key - if (m[2] === "'") { - idx += HARDENED_OFFSET; - } - child = child.deriveChild(idx); - } - return child; - } - - deriveChild(index: number): HDKey { - if (!this._publicKey || !this.chainCode) { - throw new Error('No publicKey or chainCode set'); - } - let data = toU32(index); - if (index >= HARDENED_OFFSET) { - // Hardened - const priv = this._privateKey; - if (!priv) { - throw new Error('Could not derive hardened child key'); - } - // Hardened child: 0x00 || ser256(kpar) || ser32(index) - data = concatBytes(Uint8Array.of(0), priv, data); - } else { - // Normal child: serP(point(kpar)) || ser32(index) - data = concatBytes(this._publicKey, data); - } - const I = hmac(sha512, this.chainCode, data); - const childTweak = I.slice(0, 32); - const chainCode = I.slice(32); - if (!secp.utils.isValidSecretKey(childTweak)) { - throw new Error('Tweak bigger than curve order'); - } - const opt: HDKeyOpt = { - versions: this.versions, - chainCode, - depth: this.depth + 1, - parentFingerprint: this.fingerprint, - index, - }; - const ctweak = Fn.fromBytes(childTweak); - try { - // Private parent key -> private child key - if (this._privateKey) { - const added = Fn.create(Fn.fromBytes(this._privateKey) + ctweak); - if (!Fn.isValidNot0(added)) { - throw new Error('The tweak was out of range or the resulted private key is invalid'); - } - opt.privateKey = Fn.toBytes(added); - } else { - const added = Point.fromBytes(this._publicKey).add(Point.BASE.multiply(ctweak)); - // Cryptographically impossible: hmac-sha512 preimage would need to be found - if (added.equals(Point.ZERO)) { - throw new Error('The tweak was equal to negative P, which made the result key invalid'); - } - opt.publicKey = added.toBytes(true); - } - return new HDKey(opt); - } catch (err) { - return this.deriveChild(index + 1); - } - } - - sign(hash: Uint8Array): Uint8Array { - if (!this._privateKey) { - throw new Error('No privateKey set!'); - } - abytes(hash, 32); - return secp.sign(hash, this._privateKey, { prehash: false }); - } - - verify(hash: Uint8Array, signature: Uint8Array): boolean { - abytes(hash, 32); - abytes(signature, 64); - if (!this._publicKey) { - throw new Error('No publicKey set!'); - } - return secp.verify(signature, hash, this._publicKey, { prehash: false }); - } - - wipePrivateData(): this { - if (this._privateKey) { - this._privateKey.fill(0); - this._privateKey = undefined; - } - return this; - } - toJSON(): { xpriv: string; xpub: string } { - return { - xpriv: this.privateExtendedKey, - xpub: this.publicExtendedKey, - }; - } - - private serialize(version: number, key: Uint8Array) { - if (!this.chainCode) { - throw new Error('No chainCode set'); - } - abytes(key, 33); - // version(4) || depth(1) || fingerprint(4) || index(4) || chain(32) || key(33) - return concatBytes( - toU32(version), - new Uint8Array([this.depth]), - toU32(this.parentFingerprint), - toU32(this.index), - this.chainCode, - key - ); - } -} diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/LICENSE b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/LICENSE deleted file mode 100644 index 9297a046..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2022 Paul Miller (https://paulmillr.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the “Software”), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/README.md b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/README.md deleted file mode 100644 index 755601e3..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/README.md +++ /dev/null @@ -1,1037 +0,0 @@ -# noble-curves - -Audited & minimal JS implementation of elliptic curve cryptography. - -- 🔒 [**Audited**](#security) by independent security firms -- 🔻 Tree-shakeable: unused code is excluded from your builds -- 🏎 Fast: hand-optimized for caveats of JS engines -- 🔍 Reliable: cross-library / wycheproof tests and fuzzing ensure correctness -- ➰ Weierstrass, Edwards, Montgomery curves; ECDSA, EdDSA, Schnorr, BLS signatures -- ✍️ ECDH, hash-to-curve, OPRF, Poseidon ZK-friendly hash -- 🔖 Non-repudiation (SUF-CMA, SBS) & consensus-friendliness (ZIP215) in ed25519, ed448 -- 🥈 Optional, friendly wrapper over native WebCrypto -- 🪶 29KB (gzipped) including bundled hashes, 11KB for single-curve build - -Curves have 5kb sister projects -[secp256k1](https://github.com/paulmillr/noble-secp256k1) & [ed25519](https://github.com/paulmillr/noble-ed25519). -They have smaller attack surface, but less features. - -Take a glance at [GitHub Discussions](https://github.com/paulmillr/noble-curves/discussions) for questions and support. - -### This library belongs to _noble_ cryptography - -> **noble cryptography** — high-security, easily auditable set of contained cryptographic libraries and tools. - -- Zero or minimal dependencies -- Highly readable TypeScript / JS code -- PGP-signed releases and transparent NPM builds -- All libraries: - [ciphers](https://github.com/paulmillr/noble-ciphers), - [curves](https://github.com/paulmillr/noble-curves), - [hashes](https://github.com/paulmillr/noble-hashes), - [post-quantum](https://github.com/paulmillr/noble-post-quantum), - 5kb [secp256k1](https://github.com/paulmillr/noble-secp256k1) / - [ed25519](https://github.com/paulmillr/noble-ed25519) -- [Check out homepage](https://paulmillr.com/noble/) - for reading resources, documentation and apps built with noble - -## Usage - -> `npm install @noble/curves` - -> `deno add jsr:@noble/curves` - -We support all major platforms and runtimes. -For React Native, you may need a [polyfill for getRandomValues](https://github.com/LinusU/react-native-get-random-values). -A standalone file [noble-curves.js](https://github.com/paulmillr/noble-curves/releases) is also available. - -```ts -// import * from '@noble/curves'; // Error: use sub-imports, to ensure small app size -import { secp256k1, schnorr } from '@noble/curves/secp256k1.js'; -import { ed25519, ed25519ph, ed25519ctx, x25519, ristretto255 } from '@noble/curves/ed25519.js'; -import { ed448, ed448ph, x448, decaf448 } from '@noble/curves/ed448.js'; -import { p256, p384, p521 } from '@noble/curves/nist.js'; -import { bls12_381 } from '@noble/curves/bls12-381.js'; -import { bn254 } from '@noble/curves/bn254.js'; -import { jubjub, babyjubjub, brainpoolP256r1, brainpoolP384r1, brainpoolP512r1 } from '@noble/curves/misc.js'; - -// hash-to-curve -import { secp256k1_hasher } from '@noble/curves/secp256k1.js'; -import { p256_hasher, p384_hasher, p521_hasher } from '@noble/curves/nist.js'; -import { ristretto255_hasher } from '@noble/curves/ed25519.js'; -import { decaf448_hasher } from '@noble/curves/ed448.js'; - -// OPRFs -import { p256_oprf, p384_oprf, p521_oprf } from '@noble/curves/nist.js'; -import { ristretto255_oprf } from '@noble/curves/ed25519.js'; -import { decaf448_oprf } from '@noble/curves/ed448.js'; - -// utils -import { bytesToHex, hexToBytes, concatBytes } from '@noble/curves/abstract/utils.js'; -import { Field } from '@noble/curves/abstract/modular.js'; -import { weierstrass, ecdsa } from '@noble/curves/abstract/weierstrass.js'; -import { edwards, eddsa } from '@noble/curves/abstract/edwards.js'; -import { poseidon, poseidonSponge } from '@noble/curves/abstract/poseidon.js'; -import { FFT, poly } from '@noble/curves/abstract/fft.js'; -``` - -- Examples - - [ECDSA, EdDSA, Schnorr signatures](#ecdsa-eddsa-schnorr-signatures) - - [secp256k1, p256, p384, p521, ed25519, ed448, brainpool](#secp256k1-p256-p384-p521-ed25519-ed448-brainpool) - - [ristretto255, decaf448](#ristretto255-decaf448) - - [Prehashed signing](#prehashed-signing) - - [Hedged ECDSA with noise](#hedged-ecdsa-with-noise) - - [Consensus-friendliness vs e-voting](#consensus-friendliness-vs-e-voting) - - [ECDH: Diffie-Hellman shared secrets](#ecdh-diffie-hellman-shared-secrets) - - [webcrypto: Friendly wrapper](#webcrypto-friendly-wrapper) - - [BLS signatures, bls12-381, bn254 aka alt\_bn128](#bls-signatures-bls12-381-bn254-aka-alt_bn128) - - [Hashing to curve points](#hash-to-curve-hashing-to-curve-points) - - [OPRFs](#oprfs) - - [Poseidon hash](#poseidon-poseidon-hash) - - [Fast Fourier Transform](#fft-fast-fourier-transform) - - [utils](#utils-byte-shuffling-conversion) -- [Internals](#internals) - - [Elliptic curve Point math](#elliptic-curve-point-math) - - [modular: Modular arithmetics \& finite fields](#modular-modular-arithmetics--finite-fields) - - [weierstrass: Custom Weierstrass curve](#weierstrass-custom-weierstrass-curve) - - [edwards: Custom Edwards curve](#edwards-custom-edwards-curve) - - [Custom ECDSA instance](#custom-ecdsa-instance) -- [Security](#security) -- [Speed](#speed) -- [Contributing & testing](#contributing--testing) -- [Upgrading](#upgrading) - -### ECDSA, EdDSA, Schnorr signatures - -#### secp256k1, p256, p384, p521, ed25519, ed448, brainpool - -```js -import { secp256k1, schnorr } from '@noble/curves/secp256k1.js'; -import { p256, p384, p521 } from '@noble/curves/nist.js'; -import { ed25519 } from '@noble/curves/ed25519.js'; -import { ed448 } from '@noble/curves/ed448.js'; -import { brainpoolP256r1, brainpoolP384r1, brainpoolP512r1 } from '@noble/curves/misc.js'; -for (const curve of [ - secp256k1, schnorr, - p256, p384, p521, - ed25519, ed448, - brainpoolP256r1, brainpoolP384r1, brainpoolP512r1 -]) { - const { secretKey, publicKey } = curve.keygen(); - const msg = new TextEncoder().encode('hello noble'); - const sig = curve.sign(msg, secretKey); - const isValid = curve.verify(sig, msg, publicKey); - console.log(curve, secretKey, publicKey, sig, isValid); -} - -// Specific private key -import { hexToBytes } from '@noble/curves/utils.js'; -const secret2 = hexToBytes('46c930bc7bb4db7f55da20798697421b98c4175a52c630294d75a84b9c126236'); -const pub2 = secp256k1.getPublicKey(secret2); -``` - -ECDSA signatures use deterministic k, conforming to [RFC 6979](https://www.rfc-editor.org/rfc/rfc6979). -EdDSA conforms to [RFC 8032](https://www.rfc-editor.org/rfc/rfc8032). -Schnorr (secp256k1-only) conforms to [BIP 340](https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki). - -#### ristretto255, decaf448 - -```ts -import { ristretto255, ristretto255_hasher, ristretto255_oprf } from '@noble/curves/ed25519.js'; -import { decaf448, decaf448_hasher, decaf448_oprf } from '@noble/curves/ed448.js'; - -console.log(ristretto255.Point, decaf448.Point); -``` - -Check out [RFC 9496](https://www.rfc-editor.org/rfc/rfc9496) more info on ristretto255 & decaf448. -Check out separate documentation for [Point](#elliptic-curve-point-math), [hasher](#hash-to-curve-hashing-to-curve-points) and [oprf](#oprfs). - -#### Prehashed signing - -```js -import { secp256k1 } from '@noble/curves/secp256k1.js'; -import { keccak256 } from '@noble/hashes/sha3.js'; -const { secretKey } = curve.keygen(); -const msg = new TextEncoder().encode('hello noble'); -// prehash: true (default) - hash using secp256k1.hash (sha256) -const sig = secp256k1.sign(msg, secretKey); -// prehash: false - hash using custom hash -const sigKeccak = secp256k1.sign(keccak256(msg), secretKey, { prehash: false }); -``` - -ECDSA `sign()` allows providing `prehash: false`, which enables using custom hashes. - -A ECDSA signature is not just "math over elliptic curve points". -It's actually math + hashing: p256 is in fact p256 point + sha256 hash. -By default, we hash messages. To use custom hash methods, -make sure to disable prehashing. - -> [!NOTE] -> Previously, in noble-curves v1, `prehash: false` was the default. -> Some other libraries (like libsecp256k1) have no prehashing. - -#### Hedged ECDSA with noise - -```js -import { secp256k1 } from '@noble/curves/secp256k1.js'; -const { secretKey } = curve.keygen(); -const msg = new TextEncoder().encode('hello noble'); -// extraEntropy: false - default, hedging disabled -const sigNoisy = secp256k1.sign(msg, secretKey); -// extraEntropy: true - fetch 32 random bytes from CSPRNG -const sigNoisy = secp256k1.sign(msg, secretKey, { extraEntropy: true }); -// extraEntropy: bytes - specific extra entropy -const ent = Uint8Array.from([0xca, 0xfe, 0x01, 0x23]); -const sigNoisy2 = secp256k1.sign(msg, secretKey, { extraEntropy: ent }); -``` - -ECDSA `sign()` allows providing `extraEntropy`, which switches sig generation to hedged mode. - -By default, ECDSA signatures are generated deterministically, -following [RFC 6979](https://www.rfc-editor.org/rfc/rfc6979). -However, purely deterministic signatures are vulnerable to fault attacks. -Newer signature schemes, such as BIP340 schnorr, switched to hedged signatures because of this. -Hedging is basically incorporating some randomness into sig generation process. - -For more info, check out -[Deterministic signatures are not your friends](https://paulmillr.com/posts/deterministic-signatures/), -[RFC 6979](https://www.rfc-editor.org/rfc/rfc6979) section 3.6, -and [cfrg-det-sigs-with-noise draft](https://datatracker.ietf.org/doc/draft-irtf-cfrg-det-sigs-with-noise/). - -#### Consensus-friendliness vs e-voting - -```js -import { ed25519 } from '@noble/curves/ed25519.js'; -const { secretKey, publicKey } = ed25519.keygen(); -const msg = new TextEncoder().encode('hello noble'); -const sig = ed25519.sign(msg, secretKey); -// zip215: true -const isValid = ed25519.verify(sig, msg, pub); -// SBS / e-voting / RFC8032 / FIPS 186-5 -const isValidRfc = ed25519.verify(sig, msg, pub, { zip215: false }); -``` - -In ed25519, there is an ability to choose between consensus-friendliness vs e-voting mode. - -- `zip215: true` is default behavior. It has slightly looser verification logic - to be [consensus-friendly](https://hdevalence.ca/blog/2020-10-04-its-25519am), following [ZIP215](https://zips.z.cash/zip-0215) rules -- `zip215: false` switches verification criteria to strict - [RFC 8032](https://www.rfc-editor.org/rfc/rfc8032) / [FIPS 186-5](https://csrc.nist.gov/publications/detail/fips/186/5/final) - and additionally provides [non-repudiation with SBS](https://eprint.iacr.org/2020/1244), - which is useful for: - - Contract Signing: if A signed an agreement with B using key that allows repudiation, it can later claim that it signed a different contract - - E-voting: malicious voters may pick keys that allow repudiation in order to deny results - - Blockchains: transaction of amount X might also be valid for a different amount Y - -Both modes have SUF-CMA (strong unforgeability under chosen message attacks). - -### ECDH: Diffie-Hellman shared secrets - -```js -import { secp256k1 } from '@noble/curves/secp256k1.js'; -import { x25519 } from '@noble/curves/ed25519.js'; -import { x448 } from '@noble/curves/ed448.js'; -import { p256, p384, p521 } from '@noble/curves/nist.js'; - -for (const curve of [secp256k1, schnorr, x25519, x448, p256, p384, p521]) { - const alice = curve.keygen(); - const bob = curve.keygen(); - const sharedKey = curve.getSharedSecret(alice.secretKey, bob.publicKey); - console.log('alice', alice, 'bob', bob, 'shared', sharedKey); -} - -// x25519 & x448 specific methods -import { ed25519 } from '@noble/curves/ed25519.js'; -const alice = ed25519.keygen(); -const bob = ed25519.keygen(); -const aliceSecX = ed25519.utils.toMontgomerySecret(alice.secretKey); -const bobPubX = ed25519.utils.toMontgomery(bob.publicKey); -const sharedKey = x25519.getSharedSecret(aliceSecX, bobPubX); -``` - -We provide ECDH over all Weierstrass curves, and over 2 Montgomery curves -X25519 (Curve25519) & X448 (Curve448), conforming to [RFC 7748](https://www.rfc-editor.org/rfc/rfc7748). - -In Weierstrass curves, shared secrets: - -- Include y-parity bytes: use `key.slice(1)` to strip it -- Are not hashed: use hashing or KDF on top, like `sha256(shared)` or `hkdf(shared)` - -#### webcrypto: Friendly wrapper - -> [!NOTE] -> Webcrypto methods are always async. - -##### webcrypto signatures - -```js -import { ed25519, ed448, p256, p384, p521 } from './src/webcrypto.ts'; - -(async () => { - for (let [name, curve] of Object.entries({ p256, p384, p521, ed25519, ed448 })) { - console.log('curve', name); - if (!await curve.isSupported()) { - console.log('is not supported, skipping'); - continue; - } - const keys = await curve.keygen(); - const msg = new TextEncoder().encode('hello noble'); - const sig = await curve.sign(msg, keys.secretKey); - const isValid = await curve.verify(sig, msg, keys.publicKey); - console.log({ - keys, msg, sig, isValid - }); - } -})(); -``` - -##### webcrypto ecdh - -```js -import { p256, p384, p521, x25519, x448 } from './src/webcrypto.ts'; - -(async () => { - for (let [name, curve] of Object.entries({ p256, p384, p521, x25519, x448 })) { - console.log('curve', name); - if (!await curve.isSupported()) { - console.log('is not supported, skipping'); - continue; - } - const alice = await curve.keygen(); - const bob = await curve.keygen(); - const shared = await curve.getSharedSecret(alice.secretKey, bob.publicKey); - const shared2 = await curve.getSharedSecret(bob.secretKey, alice.publicKey); - console.log({shared}); - } -})(); -``` - -##### Key conversion from noble to webcrypto and back - -```js -import { p256 as p256n } from './src/nist.ts'; -import { p256 } from './src/webcrypto.ts'; -(async () => { - const nobleKeys = p256n.keygen(); - // convert noble keys to webcrypto - const webKeys = { - secretKey: await p256.utils.convertSecretKey(nobleKeys.secretKey, 'raw', 'pkcs8'), - publicKey: await p256.utils.convertPublicKey(nobleKeys.publicKey, 'raw', 'spki') - }; - // convert webcrypto keys to noble - const nobleKeys2 = { - secretKey: await p256.utils.convertSecretKey(webKeys.secretKey, 'pkcs8', 'raw'), - publicKey: await p256.utils.convertPublicKey(webKeys.publicKey, 'spki', 'raw') - }; -})(); -``` - -Check out [micro-key-producer](https://github.com/paulmillr/micro-key-producer) for -pure JS key conversion utils. - -### BLS signatures, bls12-381, bn254 aka alt_bn128 - -```ts -import { bls12_381 } from '@noble/curves/bls12-381.js'; - -// G1 pubkeys, G2 sigs -const blsl = bls12_381.longSignatures; -const { secretKey, publicKey } = blsl.keygen(); -// const publicKey = blsl.getPublicKey(secretKey); -const msg = new TextEncoder().encode('hello noble'); -// default DST -const msgp = blsl.hash(msg); -// custom DST (Ethereum) -const msgpd = blsl.hash(msg, 'BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_'); -const signature = blsl.sign(msgp, secretKey); -const isValid = blsl.verify(signature, msgp, publicKey); -console.log('long', { publicKey, signature, isValid }); - -// G1 sigs, G2 pubkeys -const blss = bls12_381.shortSignatures; -const publicKey2 = blss.getPublicKey(secretKey); -const msgp2 = blss.hash(msg, 'BLS_SIG_BLS12381G1_XMD:SHA-256_SSWU_RO_NUL_'); -const signature2 = blss.sign(msgp2, secretKey); -const isValid2 = blss.verify(signature2, msgp2, publicKey); -console.log({ publicKey2, signature2, isValid2 }); - -// Aggregation -const aggregatedKey = bls12_381.longSignatures.aggregatePublicKeys([ - bls12_381.utils.randomSecretKey(), - bls12_381.utils.randomSecretKey(), -]); -// const aggregatedSig = bls.aggregateSignatures(sigs) - -// Pairings, with and without final exponentiation -// bls.pairing(PointG1, PointG2); -// bls.pairing(PointG1, PointG2, false); -// bls.fields.Fp12.finalExponentiate(bls.fields.Fp12.mul(PointG1, PointG2)); - -// Others -// bls.G1.Point.BASE, bls.G2.Point.BASE; -// bls.fields.Fp, bls.fields.Fp2, bls.fields.Fp12, bls.fields.Fr; -``` - -See [abstract/bls](#bls-barreto-lynn-scott-curves). -For example usage, check out [the implementation of BLS EVM precompiles](https://github.com/ethereumjs/ethereumjs-monorepo/blob/361f4edbc239e795a411ac2da7e5567298b9e7e5/packages/evm/src/precompiles/bls12_381/noble.ts). - -The BN254 API mirrors [BLS](#bls12-381). The curve was previously called alt_bn128. -The implementation is compatible with [EIP-196](https://eips.ethereum.org/EIPS/eip-196) and -[EIP-197](https://eips.ethereum.org/EIPS/eip-197). - -For BN254 usage, check out [the implementation of bn254 EVM precompiles](https://github.com/paulmillr/noble-curves/blob/3ed792f8ad9932765b84d1064afea8663a255457/test/bn254.test.js#L697). -We don't implement Point methods toBytes. To work around this limitation, has to initialize points on their own from BigInts. Reason it's not implemented is because [there is no standard](https://github.com/privacy-scaling-explorations/halo2curves/issues/109). -Points of divergence: - -- Endianness: LE vs BE (byte-swapped) -- Flags as first hex bits (similar to BLS) vs no-flags -- Imaginary part last in G2 vs first (c0, c1 vs c1, c0) - -### hash-to-curve: hashing to curve points - -```ts -import { bls12_381 } from './src/bls12-381.ts'; -import { ed25519_hasher, ristretto255_hasher } from './src/ed25519.ts'; -import { decaf448_hasher, ed448_hasher } from './src/ed448.ts'; -import { p256_hasher, p384_hasher, p521_hasher } from './src/nist.ts'; -import { secp256k1_hasher } from './src/secp256k1.ts'; - -const h = { - secp256k1_hasher, - p256_hasher, p384_hasher, p521_hasher, - ed25519_hasher, - ed448_hasher, - ristretto255_hasher, - decaf448_hasher, - bls_G1: bls12_381.G1, - bls_G2: bls12_381.G2 -}; - -const msg = Uint8Array.from([0xca, 0xfe, 0x01, 0x23]); -console.log('msg', msg); -for (let [name, c] of Object.entries(h)) { - const hashToCurve = c.hashToCurve(msg).toHex(); - const hashToCurve_customDST = c.hashToCurve(msg, { DST: 'hello noble' }).toHex(); - const encodeToCurve = 'encodeToCurve' in c ? c.encodeToCurve(msg).toHex() : undefined; - // ristretto255, decaf448 only - const deriveToCurve = 'deriveToCurve' in c ? - c.deriveToCurve!(new Uint8Array(c.Point.Fp.BYTES * 2)).toHex() : undefined; - const hashToScalar = c.hashToScalar(msg); - console.log({ - name, hashToCurve, hashToCurve_customDST, encodeToCurve, deriveToCurve, hashToScalar - }); -} - -// abstract methods -import { expand_message_xmd, expand_message_xof, hash_to_field } from '@noble/curves/abstract/hash-to-curve.js'; -``` - -The module allows to hash arbitrary strings to elliptic curve points. Implements [RFC 9380](https://www.rfc-editor.org/rfc/rfc9380). - -> [!NOTE] -> Why is `p256_hasher` separate from `p256`? -> The methods reside in separate _hasher namespace for tree-shaking: -> this way users who don't need hash-to-curve, won't have it in their builds. - -### OPRFs - -```js -import { p256_oprf, p384_oprf, p521_oprf } from '@noble/curves/nist.js'; -import { ristretto255_oprf } from '@noble/curves/ed25519.js'; -import { decaf448_orpf } from '@noble/curves/ed448.js'; -``` - -We provide OPRFs (oblivious pseudorandom functions), -conforming to [RFC 9497](https://www.rfc-editor.org/rfc/rfc9497). - -OPRF allows to interactively create an `Output = PRF(Input, serverSecretKey)`: - -- Server cannot calculate Output by itself: it doesn't know Input -- Client cannot calculate Output by itself: it doesn't know server secretKey -- An attacker interception the communication can't restore Input/Output/serverSecretKey and can't - link Input to some value. - -### poseidon: Poseidon hash - -Implements [Poseidon](https://www.poseidon-hash.info) ZK-friendly hash: -permutation and sponge. - -There are many poseidon variants with different constants. -We don't provide them: you should construct them manually. -Check out [scure-starknet](https://github.com/paulmillr/scure-starknet) package for a proper example. - -```ts -import { poseidon, poseidonSponge } from '@noble/curves/abstract/poseidon.js'; - -const rate = 2; -const capacity = 1; -const { mds, roundConstants } = poseidon.grainGenConstants({ - Fp, - t: rate + capacity, - roundsFull: 8, - roundsPartial: 31, -}); -const opts = { - Fp, - rate, - capacity, - sboxPower: 17, - mds, - roundConstants, - roundsFull: 8, - roundsPartial: 31, -}; -const permutation = poseidon.poseidon(opts); -const sponge = poseidon.poseidonSponge(opts); // use carefully, not specced -``` - -### fft: Fast Fourier Transform - -```ts -import * as fft from '@noble/curves/abstract/fft.js'; -import { bls12_381 } from '@noble/curves/bls12-381.js'; -const Fr = bls12_381.fields.Fr; -const roots = fft.rootsOfUnity(Fr, 7n); -const fftFr = fft.FFT(roots, Fr); -``` - -Experimental implementation of NTT / FFT (Fast Fourier Transform) over finite fields. -API may change at any time. The code has not been audited. Feature requests are welcome. - -### utils: byte shuffling, conversion - -```ts -import { bytesToHex, concatBytes, equalBytes, hexToBytes } from '@noble/curves/abstract/utils.js'; - -bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])); -hexToBytes('cafe0123'); -concatBytes(Uint8Array.from([0xca, 0xfe]), Uint8Array.from([0x01, 0x23])); -equalBytes(Uint8Array.of(0xca), Uint8Array.of(0xca)); -``` - -### Internals - -#### Elliptic curve Point math - -```js -import { secp256k1, schnorr } from '@noble/curves/secp256k1.js'; -import { p256, p384, p521 } from '@noble/curves/nist.js'; -import { ed25519, ristretto255 } from '@noble/curves/ed25519.js'; -import { ed448, decaf448 } from '@noble/curves/ed448.js'; -import { bls12_381 } from '@noble/curves/bls12-381.js' -import { bn254 } from '@noble/curves/bn254.js'; -import { jubjub, babyjubjub } from '@noble/curves/misc.js'; - -const curves = [ - secp256k1, schnorr, p256, p384, p521, ed25519, ed448, - ristretto255, decaf448, - bls12_381.G1, bls12_381.G2, bn254.G1, bn254.G2, - jubjub, babyjubjub -]; -for (const curve of curves) { - const { Point } = curve; - const { BASE, ZERO, Fp, Fn } = Point; - const p = BASE.multiply(2n); - - // Initialization - if (info.type === 'weierstrass') { - // projective (homogeneous) coordinates: (X, Y, Z) ∋ (x=X/Z, y=Y/Z) - const p_ = new Point(BASE.X, BASE.Y, BASE.Z); - } else if (info.type === 'edwards') { - // extended coordinates: (X, Y, Z, T) ∋ (x=X/Z, y=Y/Z) - const p_ = new Point(BASE.X, BASE.Y, BASE.Z, BASE.T); - } - - // Math - const p1 = p.add(p); - const p2 = p.double(); - const p3 = p.subtract(p); - const p4 = p.negate(); - const p5 = p.multiply(451n); - - // MSM (multi-scalar multiplication) - const pa = [BASE, BASE.multiply(2n), BASE.multiply(4n), BASE.multiply(8n)]; - const p6 = Point.msm(pa, [3n, 5n, 7n, 11n]); - const _true3 = p6.equals(BASE.multiply(129n)); // 129*G - - const pcl = p.clearCofactor(); - console.log(p.isTorsionFree(), p.isSmallOrder()); - - const r1 = p.toBytes(); - const r1_ = Point.fromBytes(r1); - const r2 = p.toAffine(); - const { x, y } = r2; - const r2_ = Point.fromAffine(r2); -} -``` - -#### modular: Modular arithmetics & finite fields - -```js -import { mod, invert, Field } from '@noble/curves/abstract/modular.js'; - -// Finite Field utils -const fp = Field(2n ** 255n - 19n); // Finite field over 2^255-19 -fp.mul(591n, 932n); // multiplication -fp.pow(481n, 11024858120n); // exponentiation -fp.div(5n, 17n); // division: 5/17 mod 2^255-19 == 5 * invert(17) -fp.inv(5n); // modular inverse -fp.sqrt(21n); // square root - -// Non-Field generic utils are also available -mod(21n, 10n); // 21 mod 10 == 1n; fixed version of 21 % 10 -invert(17n, 10n); // invert(17) mod 10; modular multiplicative inverse -``` - -All arithmetics is done with JS bigints over finite fields, -which is defined from `modular` sub-module. - -Field operations are not constant-time: see [security](#security). -The fact is mostly irrelevant, but the important method to keep in mind is `pow`, -which may leak exponent bits, when used naïvely. - -#### weierstrass: Custom Weierstrass curve - -```js -import { weierstrass } from '@noble/curves/abstract/weierstrass.js'; -// NIST secp192r1 aka p192. https://www.secg.org/sec2-v2.pdf -const p192_CURVE = { - p: 0xfffffffffffffffffffffffffffffffeffffffffffffffffn, - n: 0xffffffffffffffffffffffff99def836146bc9b1b4d22831n, - h: 1n, - a: 0xfffffffffffffffffffffffffffffffefffffffffffffffcn, - b: 0x64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1n, - Gx: 0x188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012n, - Gy: 0x07192b95ffc8da78631011ed6b24cdd573f977a11e794811n, -}; -const p192_Point = weierstrass(p192_CURVE); -``` - -Short Weierstrass curve's formula is `y² = x³ + ax + b`. `weierstrass` -expects arguments `a`, `b`, field characteristic `p`, curve order `n`, -cofactor `h` and coordinates `Gx`, `Gy` of generator point. - -#### edwards: Custom Edwards curve - -```js -import { edwards } from '@noble/curves/abstract/edwards.js'; -const ed25519_CURVE = { - p: 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffedn, - n: 0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3edn, - h: 8n, - a: 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffecn, - d: 0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3n, - Gx: 0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51an, - Gy: 0x6666666666666666666666666666666666666666666666666666666666666658n, -}; -const ed25519_Point = edwards(ed25519_CURVE); -``` - -Twisted Edwards curve's formula is `ax² + y² = 1 + dx²y²`. -You must specify `a`, `d`, field characteristic `p`, curve order `n` (sometimes named as `L`), -cofactor `h` and coordinates `Gx`, `Gy` of generator point. - -#### Custom ECDSA instance - -```js -import { ecdsa } from '@noble/curves/abstract/weierstrass.js'; -import { sha256 } from '@noble/hashes/sha2.js'; -const p192_sha256 = ecdsa(p192_Point, sha256); -// or -const p192_sha224 = ecdsa(p192.Point, sha224); - -const keys = p192_sha256.keygen(); -const msg = new TextEncoder().encode('custom curve'); -const sig = p192_sha256.sign(msg, keys.secretKey); -const isValid = p192_sha256.verify(sig, msg, keys.publicKey); -``` - -## Security - -The library has been independently audited: - -- at version 1.6.0, in Sep 2024, by [Cure53](https://cure53.de) - - PDFs: [website](https://cure53.de/audit-report_noble-crypto-libs.pdf), [in-repo](./audit/2024-09-cure53-audit-nbl4.pdf) - - [Changes since audit](https://github.com/paulmillr/noble-curves/compare/1.6.0..main) - - Scope: ed25519, ed448, their add-ons, bls12-381, bn254, - hash-to-curve, low-level primitives bls, tower, edwards, montgomery. - - The audit has been funded by [OpenSats](https://opensats.org) -- at version 1.2.0, in Sep 2023, by [Kudelski Security](https://kudelskisecurity.com) - - PDFs: [in-repo](./audit/2023-09-kudelski-audit-starknet.pdf) - - [Changes since audit](https://github.com/paulmillr/noble-curves/compare/1.2.0..main) - - Scope: [scure-starknet](https://github.com/paulmillr/scure-starknet) and its related - abstract modules of noble-curves: `curve`, `modular`, `poseidon`, `weierstrass` - - The audit has been funded by [Starkware](https://starkware.co) -- at version 0.7.3, in Feb 2023, by [Trail of Bits](https://www.trailofbits.com) - - PDFs: [website](https://github.com/trailofbits/publications/blob/master/reviews/2023-01-ryanshea-noblecurveslibrary-securityreview.pdf), - [in-repo](./audit/2023-01-trailofbits-audit-curves.pdf) - - [Changes since audit](https://github.com/paulmillr/noble-curves/compare/0.7.3..main) - - Scope: abstract modules `curve`, `hash-to-curve`, `modular`, `poseidon`, `utils`, `weierstrass` and - top-level modules `_shortw_utils` and `secp256k1` - - The audit has been funded by [Ryan Shea](https://www.shea.io) - -It is tested against property-based, cross-library and Wycheproof vectors, -and is being fuzzed in [the separate repo](https://github.com/paulmillr/integration-tests). - -If you see anything unusual: investigate and report. - -### Constant-timeness - -We're targetting algorithmic constant time. _JIT-compiler_ and _Garbage Collector_ make "constant time" -extremely hard to achieve [timing attack](https://en.wikipedia.org/wiki/Timing_attack) resistance -in a scripting language. Which means _any other JS library can't have -constant-timeness_. Even statically typed Rust, a language without GC, -[makes it harder to achieve constant-time](https://www.chosenplaintext.ca/open-source/rust-timing-shield/security) -for some cases. If your goal is absolute security, don't use any JS lib — including bindings to native ones. -Use low-level libraries & languages. - -### Memory dumping - -Use low-level languages instead of JS / WASM if your goal is absolute security. - -The library mostly uses Uint8Arrays and bigints. - -- Uint8Arrays have `.fill(0)` which instructs to fill content with zeroes - but there are no guarantees in JS -- bigints are immutable and don't have a method to zeroize their content: - a user needs to wait until the next garbage collection cycle -- hex strings are also immutable: there is no way to zeroize them -- `await fn()` will write all internal variables to memory. With - async functions there are no guarantees when the code - chunk would be executed. Which means attacker can have - plenty of time to read data from memory. - -This means some secrets could stay in memory longer than anticipated. -However, if an attacker can read application memory, it's doomed anyway: -there is no way to guarantee anything about zeroizing sensitive data without -complex tests-suite which will dump process memory and verify that there is -no sensitive data left. For JS it means testing all browsers (including mobile). -And, of course, it will be useless without using the same -test-suite in the actual application that consumes the library. - -### Supply chain security - -- **Commits** are signed with PGP keys, to prevent forgery. Make sure to verify commit signatures -- **Releases** are transparent and built on GitHub CI. Make sure to verify [provenance](https://docs.npmjs.com/generating-provenance-statements) logs - - Use GitHub CLI to verify single-file builds: - `gh attestation verify --owner paulmillr noble-curves.js` -- **Rare releasing** is followed to ensure less re-audit need for end-users -- **Dependencies** are minimized and locked-down: any dependency could get hacked and users will be downloading malware with every install. - - We make sure to use as few dependencies as possible - - Automatic dep updates are prevented by locking-down version ranges; diffs are checked with `npm-diff` -- **Dev Dependencies** are disabled for end-users; they are only used to develop / build the source code - -For this package, there is 1 dependency; and a few dev dependencies: - -- [noble-hashes](https://github.com/paulmillr/noble-hashes) provides cryptographic hashing functionality -- micro-bmark, micro-should and jsbt are used for benchmarking / testing / build tooling and developed by the same author -- prettier, fast-check and typescript are used for code quality / test generation / ts compilation. It's hard to audit their source code thoroughly and fully because of their size - -### Randomness - -We're deferring to built-in -[crypto.getRandomValues](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues) -which is considered cryptographically secure (CSPRNG). - -In the past, browsers had bugs that made it weak: it may happen again. -Implementing a userspace CSPRNG to get resilient to the weakness -is even worse: there is no reliable userspace source of quality entropy. - -### Quantum computers - -Cryptographically relevant quantum computer, if built, will allow to -break elliptic curve cryptography (both ECDSA / EdDSA & ECDH) using Shor's algorithm. - -Consider switching to newer / hybrid algorithms, such as SPHINCS+. They are available in -[noble-post-quantum](https://github.com/paulmillr/noble-post-quantum). - -NIST prohibits classical cryptography (RSA, DSA, ECDSA, ECDH) [after 2035](https://nvlpubs.nist.gov/nistpubs/ir/2024/NIST.IR.8547.ipd.pdf). Australian ASD prohibits it [after 2030](https://www.cyber.gov.au/resources-business-and-government/essential-cyber-security/ism/cyber-security-guidelines/guidelines-cryptography). - -## Speed - -```sh -npm run bench -``` - -noble-curves spends 10+ ms to generate 20MB+ of base point precomputes. -This is done **one-time** per curve. - -The generation is deferred until any method (pubkey, sign, verify) is called. -User can force precompute generation by manually calling `Point.BASE.precompute(windowSize, false)`. -Check out the source code. - -Benchmark results on Apple M4: - -``` -# secp256k1 -init 10ms -getPublicKey x 9,099 ops/sec @ 109μs/op -sign x 7,182 ops/sec @ 139μs/op -verify x 1,188 ops/sec @ 841μs/op -recoverPublicKey x 1,265 ops/sec @ 790μs/op -getSharedSecret x 735 ops/sec @ 1ms/op -schnorr.sign x 957 ops/sec @ 1ms/op -schnorr.verify x 1,210 ops/sec @ 825μs/op - -# ed25519 -init 14ms -getPublicKey x 14,216 ops/sec @ 70μs/op -sign x 6,849 ops/sec @ 145μs/op -verify x 1,400 ops/sec @ 713μs/op - -# ed448 -init 37ms -getPublicKey x 5,273 ops/sec @ 189μs/op -sign x 2,494 ops/sec @ 400μs/op -verify x 476 ops/sec @ 2ms/op - -# p256 -init 17ms -getPublicKey x 8,977 ops/sec @ 111μs/op -sign x 7,236 ops/sec @ 138μs/op -verify x 877 ops/sec @ 1ms/op - -# p384 -init 42ms -getPublicKey x 4,084 ops/sec @ 244μs/op -sign x 3,247 ops/sec @ 307μs/op -verify x 331 ops/sec @ 3ms/op - -# p521 -init 83ms -getPublicKey x 2,049 ops/sec @ 487μs/op -sign x 1,748 ops/sec @ 571μs/op -verify x 170 ops/sec @ 5ms/op - -# ristretto255 -add x 931,966 ops/sec @ 1μs/op -multiply x 15,444 ops/sec @ 64μs/op -encode x 21,367 ops/sec @ 46μs/op -decode x 21,715 ops/sec @ 46μs/op - -# decaf448 -add x 478,011 ops/sec @ 2μs/op -multiply x 416 ops/sec @ 2ms/op -encode x 8,562 ops/sec @ 116μs/op -decode x 8,636 ops/sec @ 115μs/op - -# ECDH -x25519 x 1,981 ops/sec @ 504μs/op -x448 x 743 ops/sec @ 1ms/op -secp256k1 x 728 ops/sec @ 1ms/op -p256 x 705 ops/sec @ 1ms/op -p384 x 268 ops/sec @ 3ms/op -p521 x 137 ops/sec @ 7ms/op - -# hash-to-curve -hashToPrivateScalar x 1,754,385 ops/sec @ 570ns/op -hash_to_field x 135,703 ops/sec @ 7μs/op -hashToCurve secp256k1 x 3,194 ops/sec @ 313μs/op -hashToCurve p256 x 5,962 ops/sec @ 167μs/op -hashToCurve p384 x 2,230 ops/sec @ 448μs/op -hashToCurve p521 x 1,063 ops/sec @ 940μs/op -hashToCurve ed25519 x 4,047 ops/sec @ 247μs/op -hashToCurve ed448 x 1,691 ops/sec @ 591μs/op -hash_to_ristretto255 x 8,733 ops/sec @ 114μs/op -hash_to_decaf448 x 3,882 ops/sec @ 257μs/op - -# modular over secp256k1 P field -invert a x 866,551 ops/sec @ 1μs/op -invert b x 693,962 ops/sec @ 1μs/op -sqrt p = 3 mod 4 x 25,738 ops/sec @ 38μs/op -sqrt tonneli-shanks x 847 ops/sec @ 1ms/op - -# bls12-381 -init 22ms -getPublicKey x 1,325 ops/sec @ 754μs/op -sign x 80 ops/sec @ 12ms/op -verify x 62 ops/sec @ 15ms/op -pairing x 166 ops/sec @ 6ms/op -pairing10 x 54 ops/sec @ 18ms/op ± 23.48% (15ms..36ms) -MSM 4096 scalars x points 3286ms -aggregatePublicKeys/8 x 173 ops/sec @ 5ms/op -aggregatePublicKeys/32 x 46 ops/sec @ 21ms/op -aggregatePublicKeys/128 x 11 ops/sec @ 84ms/op -aggregatePublicKeys/512 x 2 ops/sec @ 335ms/op -aggregatePublicKeys/2048 x 0 ops/sec @ 1346ms/op -aggregateSignatures/8 x 82 ops/sec @ 12ms/op -aggregateSignatures/32 x 21 ops/sec @ 45ms/op -aggregateSignatures/128 x 5 ops/sec @ 178ms/op -aggregateSignatures/512 x 1 ops/sec @ 705ms/op -aggregateSignatures/2048 x 0 ops/sec @ 2823ms/op -``` - -## Upgrading - -Supported node.js versions: - -- v2 (2025-08): v20.19+ (ESM-only) -- v1 (2023-04): v14.21+ (ESM & CJS) - -### Changelog of curves v1 to curves v2 - -v2 massively simplifies internals, improves security, reduces bundle size and lays path for the future. -We tried to keep v2 as much backwards-compatible as possible. - -To simplify upgrading, upgrade first to curves 1.9.x. It would show deprecations in vscode-like text editor. -Fix them first. - -- The package is now ESM-only. ESM can finally be loaded from common.js on node v20.19+ -- `.js` extension must be used for all modules - - Old: `@noble/curves/ed25519` - - New: `@noble/curves/ed25519.js` - - This simplifies working in browsers natively without transpilers - -New features: - -- webcrypto: create friendly noble-like wrapper over built-in WebCrypto -- oprf: implement RFC 9497 OPRFs (oblivious pseudorandom functions) - - We support p256, p384, p521, ristretto255 and decaf448 -- weierstrass, edwards: add `isValidSecretKey`, `isValidPublicKey` -- misc: add Brainpool curves: brainpoolP256r1, brainpoolP384r1, brainpoolP512r1 - -Changes: - -- Most methods now expect Uint8Array, string hex inputs are prohibited - - The change simplifies reasoning, improves security and reduces malleability - - `Point.fromHex` now expects string-only hex inputs, use `Point.fromBytes` for Uint8Array -- Breaking changes of ECDSA (secp256k1, p256, p384...): - - sign, verify: Switch to **prehashed messages**. Instead of - messageHash, the methods now expect unhashed message. - To bring back old behavior, use option `{prehash: false}` - - sign, verify: Switch to **lowS signatures** by default. - This change doesn't affect secp256k1, which has been using lowS since beginning. - To bring back old behavior, use option `{lowS: true}` - - sign, verify: Switch to **Uint8Array signatures** (format: 'compact') by default. - - verify: **der format must be explicitly specified** in `{format: 'der'}`. - This reduces malleability - - verify: **prohibit Signature-instance** signature. User must now always do - `signature.toBytes()` -- Breaking changes of BLS signatures (bls12-381, bn254): - - Move getPublicKey, sign, verify, signShortSignature etc into two new namespaces: - bls.longSignatures (G1 pubkeys, G2 sigs) and bls.shortSignatures (G1 sigs, G2 pubkeys). - - verifyBatch now expects array of inputs `{message: ..., publicKey: ...}[]` -- Curve changes: - - Massively simplify curve creation, split it into point creation & sig generator creation - - New methods are `weierstrass() + ecdsa()` / `edwards() + eddsa()` - - weierstrass / edwards expect simplified curve params (Fp became p) - - ecdsa / eddsa expect Point class and hash - - Remove unnecessary Fn argument in `pippenger` -- modular changes: - - Field#fromBytes() now validates elements to be in 0..order-1 range -- Massively improve error messages, make them more descriptive - -Renamings: - -- Module changes - - `p256`, `p384`, `p521` modules have been moved into `nist` - - `jubjub` module has been moved into `misc` -- Point changes - - ExtendedPoint, ProjectivePoint => Point - - Point coordinates (projective / extended) from px/ex, py/ey, pz/ez, et => X, Y, Z, T - - Point.normalizeZ, Point.msm => separate methods in `abstract/curve.js` submodule - - Point.fromPrivateKey() got removed, use `Point.BASE.multiply()` and `Point.Fn.fromBytes(secretKey)` - - toRawBytes, fromRawBytes => toBytes, fromBytes - - RistrettoPoint => ristretto255.Point, DecafPoiont => decaf448.Point -- Signature (ECDSA) changes - - toCompactRawBytes, toDERRawBytes => toBytes('compact'), toBytes('der') - - toCompactHex, toDERHex => toHex('compact'), toHex('der') - - fromCompact, fromDER => fromBytes(format), fromHex(format) -- utils changes - - randomPrivateKey => randomSecretKey - - utils.precompute, Point#_setWindowSize => Point#precompute - - edwardsToMontgomery => utils.toMontgomery - - edwardsToMontgomeryPriv => utils.toMontgomerySecret -- Rename all curve-specific hash-to-curve methods to `*curve*_hasher`. - Example: `secp256k1.hashToCurve` => `secp256k1_hasher.hashToCurve()` -- Massive type renamings and improvements - -Removed features: - -- Point#multiplyAndAddUnsafe, Point#hasEvenY -- CURVE property with all kinds of random stuff. Point.CURVE() now replaces it, but only provides - curve parameters -- Remove `pasta`, `bn254_weierstrass` (NOT pairing-based bn254) curves -- Field.MASK -- utils.normPrivateKeyToScalar - -### noble-secp256k1 v1 to curves v1 - -Previously, the library was split into single-feature packages -[noble-secp256k1](https://github.com/paulmillr/noble-secp256k1), -[noble-ed25519](https://github.com/paulmillr/noble-ed25519) and -[noble-bls12-381](https://github.com/paulmillr/noble-bls12-381). - -Curves continue their original work. The single-feature packages changed their -direction towards providing minimal 5kb implementations of cryptography, -which means they have less features. - -- `getPublicKey` - - now produce 33-byte compressed signatures by default - - to use old behavior, which produced 65-byte uncompressed keys, set - argument `isCompressed` to `false`: `getPublicKey(priv, false)` -- `sign` - - is now sync - - now returns `Signature` instance with `{ r, s, recovery }` properties - - `canonical` option was renamed to `lowS` - - `recovered` option has been removed because recovery bit is always returned now - - `der` option has been removed. There are 2 options: - 1. Use compact encoding: `fromCompact`, `toCompactRawBytes`, `toCompactHex`. - Compact encoding is simply a concatenation of 32-byte r and 32-byte s. - 2. If you must use DER encoding, switch to noble-curves (see above). -- `verify` - - is now sync - - `strict` option was renamed to `lowS` -- `getSharedSecret` - - now produce 33-byte compressed signatures by default - - to use old behavior, which produced 65-byte uncompressed keys, set - argument `isCompressed` to `false`: `getSharedSecret(a, b, false)` -- `recoverPublicKey(msg, sig, rec)` was changed to `sig.recoverPublicKey(msg)` -- `number` type for private keys have been removed: use `bigint` instead -- `Point` (2d xy) has been changed to `ProjectivePoint` (3d xyz) -- `utils` were split into `utils` (same api as in noble-curves) and - `etc` (`hmacSha256Sync` and others) - -### noble-ed25519 v1 to curves v1 - -Upgrading from [@noble/ed25519](https://github.com/paulmillr/noble-ed25519): - -- Methods are now sync by default -- `bigint` is no longer allowed in `getPublicKey`, `sign`, `verify`. Reason: ed25519 is LE, can lead to bugs -- `Point` (2d xy) has been changed to `ExtendedPoint` (xyzt) -- `Signature` was removed: just use raw bytes or hex now -- `utils` were split into `utils` (same api as in noble-curves) and - `etc` (`sha512Sync` and others) -- `getSharedSecret` was moved to `x25519` module -- `toX25519` has been moved to `edwardsToMontgomeryPub` and `edwardsToMontgomeryPriv` methods - -### noble-bls12-381 to curves v1 - -Upgrading from [@noble/bls12-381](https://github.com/paulmillr/noble-bls12-381): - -- Methods and classes were renamed: - - PointG1 -> G1.Point, PointG2 -> G2.Point - - PointG2.fromSignature -> Signature.decode, PointG2.toSignature -> Signature.encode -- Fp2 ORDER was corrected - -## Contributing & testing - -- `npm install && npm run build && npm test` will build the code and run tests. -- `npm run lint` / `npm run format` will run linter / fix linter issues. -- `npm run bench` will run benchmarks -- `npm run build:release` will build single file - -See [paulmillr.com/noble](https://paulmillr.com/noble/) -for useful resources, articles, documentation and demos -related to the library. - -MuSig2 signature scheme and BIP324 ElligatorSwift mapping for secp256k1 -are available [in a separate package](https://github.com/paulmillr/scure-btc-signer). - -## License - -The MIT License (MIT) - -Copyright (c) 2022 Paul Miller [(https://paulmillr.com)](https://paulmillr.com) - -See LICENSE file. diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/bls.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/bls.d.ts deleted file mode 100644 index 553df9fa..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/bls.d.ts +++ /dev/null @@ -1,128 +0,0 @@ -import { type CurveLengths } from './curve.ts'; -import { type H2CHasher, type H2CHashOpts, type H2COpts, type MapToCurve } from './hash-to-curve.ts'; -import { type IField } from './modular.ts'; -import type { Fp12, Fp12Bls, Fp2, Fp2Bls, Fp6Bls } from './tower.ts'; -import { type WeierstrassPoint, type WeierstrassPointCons } from './weierstrass.ts'; -type Fp = bigint; -export type BlsTwistType = 'multiplicative' | 'divisive'; -export type BlsShortSignatureCoder = { - fromBytes(bytes: Uint8Array): WeierstrassPoint; - fromHex(hex: string): WeierstrassPoint; - toBytes(point: WeierstrassPoint): Uint8Array; - toHex(point: WeierstrassPoint): string; -}; -export type BlsLongSignatureCoder = { - fromBytes(bytes: Uint8Array): WeierstrassPoint; - fromHex(hex: string): WeierstrassPoint; - toBytes(point: WeierstrassPoint): Uint8Array; - toHex(point: WeierstrassPoint): string; -}; -export type BlsFields = { - Fp: IField; - Fr: IField; - Fp2: Fp2Bls; - Fp6: Fp6Bls; - Fp12: Fp12Bls; -}; -export type BlsPostPrecomputePointAddFn = (Rx: Fp2, Ry: Fp2, Rz: Fp2, Qx: Fp2, Qy: Fp2) => { - Rx: Fp2; - Ry: Fp2; - Rz: Fp2; -}; -export type BlsPostPrecomputeFn = (Rx: Fp2, Ry: Fp2, Rz: Fp2, Qx: Fp2, Qy: Fp2, pointAdd: BlsPostPrecomputePointAddFn) => void; -export type BlsPairing = { - lengths: CurveLengths; - Fr: IField; - Fp12: Fp12Bls; - calcPairingPrecomputes: (p: WeierstrassPoint) => Precompute; - millerLoopBatch: (pairs: [Precompute, Fp, Fp][]) => Fp12; - pairing: (P: WeierstrassPoint, Q: WeierstrassPoint, withFinalExponent?: boolean) => Fp12; - pairingBatch: (pairs: { - g1: WeierstrassPoint; - g2: WeierstrassPoint; - }[], withFinalExponent?: boolean) => Fp12; - randomSecretKey: (seed?: Uint8Array) => Uint8Array; -}; -export type BlsPairingParams = { - ateLoopSize: bigint; - xNegative: boolean; - twistType: BlsTwistType; - randomBytes?: (len?: number) => Uint8Array; - postPrecompute?: BlsPostPrecomputeFn; -}; -export type BlsHasherParams = { - mapToG1?: MapToCurve; - mapToG2?: MapToCurve; - hasherOpts: H2COpts; - hasherOptsG1: H2COpts; - hasherOptsG2: H2COpts; -}; -type PrecomputeSingle = [Fp2, Fp2, Fp2][]; -type Precompute = PrecomputeSingle[]; -/** - * BLS consists of two curves: G1 and G2: - * - G1 is a subgroup of (x, y) E(Fq) over y² = x³ + 4. - * - G2 is a subgroup of ((x₁, x₂+i), (y₁, y₂+i)) E(Fq²) over y² = x³ + 4(1 + i) where i is √-1 - */ -export interface BlsCurvePair { - lengths: CurveLengths; - millerLoopBatch: BlsPairing['millerLoopBatch']; - pairing: BlsPairing['pairing']; - pairingBatch: BlsPairing['pairingBatch']; - G1: { - Point: WeierstrassPointCons; - }; - G2: { - Point: WeierstrassPointCons; - }; - fields: { - Fp: IField; - Fp2: Fp2Bls; - Fp6: Fp6Bls; - Fp12: Fp12Bls; - Fr: IField; - }; - utils: { - randomSecretKey: (seed?: Uint8Array) => Uint8Array; - calcPairingPrecomputes: BlsPairing['calcPairingPrecomputes']; - }; - params: { - ateLoopSize: bigint; - twistType: BlsTwistType; - }; -} -export interface BlsCurvePairWithHashers extends BlsCurvePair { - G1: H2CHasher>; - G2: H2CHasher>; -} -export interface BlsCurvePairWithSignatures extends BlsCurvePairWithHashers { - longSignatures: BlsSigs; - shortSignatures: BlsSigs; -} -type BLSInput = Uint8Array; -export interface BlsSigs { - lengths: CurveLengths; - keygen(seed?: Uint8Array): { - secretKey: Uint8Array; - publicKey: WeierstrassPoint

; - }; - getPublicKey(secretKey: Uint8Array): WeierstrassPoint

; - sign(hashedMessage: WeierstrassPoint, secretKey: Uint8Array): WeierstrassPoint; - verify(signature: WeierstrassPoint | BLSInput, message: WeierstrassPoint, publicKey: WeierstrassPoint

| BLSInput): boolean; - verifyBatch: (signature: WeierstrassPoint | BLSInput, items: { - message: WeierstrassPoint; - publicKey: WeierstrassPoint

| BLSInput; - }[]) => boolean; - aggregatePublicKeys(publicKeys: (WeierstrassPoint

| BLSInput)[]): WeierstrassPoint

; - aggregateSignatures(signatures: (WeierstrassPoint | BLSInput)[]): WeierstrassPoint; - hash(message: Uint8Array, DST?: string | Uint8Array, hashOpts?: H2CHashOpts): WeierstrassPoint; - Signature: BlsLongSignatureCoder; -} -type BlsSignatureCoders = Partial<{ - LongSignature: BlsLongSignatureCoder; - ShortSignature: BlsShortSignatureCoder; -}>; -export declare function blsBasic(fields: BlsFields, G1_Point: WeierstrassPointCons, G2_Point: WeierstrassPointCons, params: BlsPairingParams): BlsCurvePair; -export declare function bls(fields: BlsFields, G1_Point: WeierstrassPointCons, G2_Point: WeierstrassPointCons, params: BlsPairingParams, hasherParams: BlsHasherParams, signatureCoders: BlsSignatureCoders): BlsCurvePairWithSignatures; -export {}; -//# sourceMappingURL=bls.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/bls.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/bls.d.ts.map deleted file mode 100644 index c902a4af..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/bls.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bls.d.ts","sourceRoot":"","sources":["../src/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D,wBAAgB,GAAG,CACjB,MAAM,EAAE,SAAS,EACjB,QAAQ,EAAE,oBAAoB,CAAC,EAAE,CAAC,EAClC,QAAQ,EAAE,oBAAoB,CAAC,GAAG,CAAC,EACnC,MAAM,EAAE,gBAAgB,EACxB,YAAY,EAAE,eAAe,EAC7B,eAAe,EAAE,kBAAkB,GAClC,0BAA0B,CA0B5B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/bls.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/bls.js deleted file mode 100644 index ebeead74..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/bls.js +++ /dev/null @@ -1,372 +0,0 @@ -/** - * BLS != BLS. - * The file implements BLS (Boneh-Lynn-Shacham) signatures. - * Used in both BLS (Barreto-Lynn-Scott) and BN (Barreto-Naehrig) - * families of pairing-friendly curves. - * Consists of two curves: G1 and G2: - * - G1 is a subgroup of (x, y) E(Fq) over y² = x³ + 4. - * - G2 is a subgroup of ((x₁, x₂+i), (y₁, y₂+i)) E(Fq²) over y² = x³ + 4(1 + i) where i is √-1 - * - Gt, created by bilinear (ate) pairing e(G1, G2), consists of p-th roots of unity in - * Fq^k where k is embedding degree. Only degree 12 is currently supported, 24 is not. - * Pairing is used to aggregate and verify signatures. - * There are two modes of operation: - * - Long signatures: X-byte keys + 2X-byte sigs (G1 keys + G2 sigs). - * - Short signatures: 2X-byte keys + X-byte sigs (G2 keys + G1 sigs). - * @module - **/ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { abytes, memoized, notImplemented, randomBytes } from "../utils.js"; -import { normalizeZ } from "./curve.js"; -import { createHasher, } from "./hash-to-curve.js"; -import { getMinHashLength, mapHashToField } from "./modular.js"; -import {} from "./weierstrass.js"; -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3); -// Not used with BLS12-381 (no sequential `11` in X). Useful for other curves. -function NAfDecomposition(a) { - const res = []; - // a>1 because of marker bit - for (; a > _1n; a >>= _1n) { - if ((a & _1n) === _0n) - res.unshift(0); - else if ((a & _3n) === _3n) { - res.unshift(-1); - a += _1n; - } - else - res.unshift(1); - } - return res; -} -function aNonEmpty(arr) { - if (!Array.isArray(arr) || arr.length === 0) - throw new Error('expected non-empty array'); -} -// This should be enough for bn254, no need to export full stuff? -function createBlsPairing(fields, G1, G2, params) { - const { Fr, Fp2, Fp12 } = fields; - const { twistType, ateLoopSize, xNegative, postPrecompute } = params; - // Applies sparse multiplication as line function - let lineFunction; - if (twistType === 'multiplicative') { - lineFunction = (c0, c1, c2, f, Px, Py) => Fp12.mul014(f, c0, Fp2.mul(c1, Px), Fp2.mul(c2, Py)); - } - else if (twistType === 'divisive') { - // NOTE: it should be [c0, c1, c2], but we use different order here to reduce complexity of - // precompute calculations. - lineFunction = (c0, c1, c2, f, Px, Py) => Fp12.mul034(f, Fp2.mul(c2, Py), Fp2.mul(c1, Px), c0); - } - else - throw new Error('bls: unknown twist type'); - const Fp2div2 = Fp2.div(Fp2.ONE, Fp2.mul(Fp2.ONE, _2n)); - function pointDouble(ell, Rx, Ry, Rz) { - const t0 = Fp2.sqr(Ry); // Ry² - const t1 = Fp2.sqr(Rz); // Rz² - const t2 = Fp2.mulByB(Fp2.mul(t1, _3n)); // 3 * T1 * B - const t3 = Fp2.mul(t2, _3n); // 3 * T2 - const t4 = Fp2.sub(Fp2.sub(Fp2.sqr(Fp2.add(Ry, Rz)), t1), t0); // (Ry + Rz)² - T1 - T0 - const c0 = Fp2.sub(t2, t0); // T2 - T0 (i) - const c1 = Fp2.mul(Fp2.sqr(Rx), _3n); // 3 * Rx² - const c2 = Fp2.neg(t4); // -T4 (-h) - ell.push([c0, c1, c2]); - Rx = Fp2.mul(Fp2.mul(Fp2.mul(Fp2.sub(t0, t3), Rx), Ry), Fp2div2); // ((T0 - T3) * Rx * Ry) / 2 - Ry = Fp2.sub(Fp2.sqr(Fp2.mul(Fp2.add(t0, t3), Fp2div2)), Fp2.mul(Fp2.sqr(t2), _3n)); // ((T0 + T3) / 2)² - 3 * T2² - Rz = Fp2.mul(t0, t4); // T0 * T4 - return { Rx, Ry, Rz }; - } - function pointAdd(ell, Rx, Ry, Rz, Qx, Qy) { - // Addition - const t0 = Fp2.sub(Ry, Fp2.mul(Qy, Rz)); // Ry - Qy * Rz - const t1 = Fp2.sub(Rx, Fp2.mul(Qx, Rz)); // Rx - Qx * Rz - const c0 = Fp2.sub(Fp2.mul(t0, Qx), Fp2.mul(t1, Qy)); // T0 * Qx - T1 * Qy == Ry * Qx - Rx * Qy - const c1 = Fp2.neg(t0); // -T0 == Qy * Rz - Ry - const c2 = t1; // == Rx - Qx * Rz - ell.push([c0, c1, c2]); - const t2 = Fp2.sqr(t1); // T1² - const t3 = Fp2.mul(t2, t1); // T2 * T1 - const t4 = Fp2.mul(t2, Rx); // T2 * Rx - const t5 = Fp2.add(Fp2.sub(t3, Fp2.mul(t4, _2n)), Fp2.mul(Fp2.sqr(t0), Rz)); // T3 - 2 * T4 + T0² * Rz - Rx = Fp2.mul(t1, t5); // T1 * T5 - Ry = Fp2.sub(Fp2.mul(Fp2.sub(t4, t5), t0), Fp2.mul(t3, Ry)); // (T4 - T5) * T0 - T3 * Ry - Rz = Fp2.mul(Rz, t3); // Rz * T3 - return { Rx, Ry, Rz }; - } - // Pre-compute coefficients for sparse multiplication - // Point addition and point double calculations is reused for coefficients - // pointAdd happens only if bit set, so wNAF is reasonable. Unfortunately we cannot combine - // add + double in windowed precomputes here, otherwise it would be single op (since X is static) - const ATE_NAF = NAfDecomposition(ateLoopSize); - const calcPairingPrecomputes = memoized((point) => { - const p = point; - const { x, y } = p.toAffine(); - // prettier-ignore - const Qx = x, Qy = y, negQy = Fp2.neg(y); - // prettier-ignore - let Rx = Qx, Ry = Qy, Rz = Fp2.ONE; - const ell = []; - for (const bit of ATE_NAF) { - const cur = []; - ({ Rx, Ry, Rz } = pointDouble(cur, Rx, Ry, Rz)); - if (bit) - ({ Rx, Ry, Rz } = pointAdd(cur, Rx, Ry, Rz, Qx, bit === -1 ? negQy : Qy)); - ell.push(cur); - } - if (postPrecompute) { - const last = ell[ell.length - 1]; - postPrecompute(Rx, Ry, Rz, Qx, Qy, pointAdd.bind(null, last)); - } - return ell; - }); - function millerLoopBatch(pairs, withFinalExponent = false) { - let f12 = Fp12.ONE; - if (pairs.length) { - const ellLen = pairs[0][0].length; - for (let i = 0; i < ellLen; i++) { - f12 = Fp12.sqr(f12); // This allows us to do sqr only one time for all pairings - // NOTE: we apply multiple pairings in parallel here - for (const [ell, Px, Py] of pairs) { - for (const [c0, c1, c2] of ell[i]) - f12 = lineFunction(c0, c1, c2, f12, Px, Py); - } - } - } - if (xNegative) - f12 = Fp12.conjugate(f12); - return withFinalExponent ? Fp12.finalExponentiate(f12) : f12; - } - // Calculates product of multiple pairings - // This up to x2 faster than just `map(({g1, g2})=>pairing({g1,g2}))` - function pairingBatch(pairs, withFinalExponent = true) { - const res = []; - // Cache precomputed toAffine for all points - normalizeZ(G1, pairs.map(({ g1 }) => g1)); - normalizeZ(G2, pairs.map(({ g2 }) => g2)); - for (const { g1, g2 } of pairs) { - if (g1.is0() || g2.is0()) - throw new Error('pairing is not available for ZERO point'); - // This uses toAffine inside - g1.assertValidity(); - g2.assertValidity(); - const Qa = g1.toAffine(); - res.push([calcPairingPrecomputes(g2), Qa.x, Qa.y]); - } - return millerLoopBatch(res, withFinalExponent); - } - // Calculates bilinear pairing - function pairing(Q, P, withFinalExponent = true) { - return pairingBatch([{ g1: Q, g2: P }], withFinalExponent); - } - const lengths = { - seed: getMinHashLength(Fr.ORDER), - }; - const rand = params.randomBytes || randomBytes; - const randomSecretKey = (seed = rand(lengths.seed)) => { - abytes(seed, lengths.seed, 'seed'); - return mapHashToField(seed, Fr.ORDER); - }; - return { - lengths, - Fr, - Fp12, // NOTE: we re-export Fp12 here because pairing results are Fp12! - millerLoopBatch, - pairing, - pairingBatch, - calcPairingPrecomputes, - randomSecretKey, - }; -} -function createBlsSig(blsPairing, PubPoint, SigPoint, isSigG1, hashToSigCurve, SignatureCoder) { - const { Fr, Fp12, pairingBatch, randomSecretKey, lengths } = blsPairing; - if (!SignatureCoder) { - SignatureCoder = { - fromBytes: notImplemented, - fromHex: notImplemented, - toBytes: notImplemented, - toHex: notImplemented, - }; - } - function normPub(point) { - return point instanceof PubPoint ? point : PubPoint.fromBytes(point); - } - function normSig(point) { - return point instanceof SigPoint ? point : SigPoint.fromBytes(point); - } - function amsg(m) { - if (!(m instanceof SigPoint)) - throw new Error(`expected valid message hashed to ${!isSigG1 ? 'G2' : 'G1'} curve`); - return m; - } - // What matters here is what point pairing API accepts as G1 or G2, not actual size or names - const pair = !isSigG1 - ? (a, b) => ({ g1: a, g2: b }) - : (a, b) => ({ g1: b, g2: a }); - return Object.freeze({ - lengths: { ...lengths, secretKey: Fr.BYTES }, - keygen(seed) { - const secretKey = randomSecretKey(seed); - const publicKey = this.getPublicKey(secretKey); - return { secretKey, publicKey }; - }, - // P = pk x G - getPublicKey(secretKey) { - let sec; - try { - sec = PubPoint.Fn.fromBytes(secretKey); - } - catch (error) { - // @ts-ignore - throw new Error('invalid private key: ' + typeof secretKey, { cause: error }); - } - return PubPoint.BASE.multiply(sec); - }, - // S = pk x H(m) - sign(message, secretKey, unusedArg) { - if (unusedArg != null) - throw new Error('sign() expects 2 arguments'); - const sec = PubPoint.Fn.fromBytes(secretKey); - amsg(message).assertValidity(); - return message.multiply(sec); - }, - // Checks if pairing of public key & hash is equal to pairing of generator & signature. - // e(P, H(m)) == e(G, S) - // e(S, G) == e(H(m), P) - verify(signature, message, publicKey, unusedArg) { - if (unusedArg != null) - throw new Error('verify() expects 3 arguments'); - signature = normSig(signature); - publicKey = normPub(publicKey); - const P = publicKey.negate(); - const G = PubPoint.BASE; - const Hm = amsg(message); - const S = signature; - // This code was changed in 1.9.x: - // Before it was G.negate() in G2, now it's always pubKey.negate - // e(P, -Q)===e(-P, Q)==e(P, Q)^-1. Negate can be done anywhere (as long it is done once per pair). - // We just moving sign, but since pairing is multiplicative, we doing X * X^-1 = 1 - try { - const exp = pairingBatch([pair(P, Hm), pair(G, S)]); - return Fp12.eql(exp, Fp12.ONE); - } - catch { - return false; - } - }, - // https://ethresear.ch/t/fast-verification-of-multiple-bls-signatures/5407 - // e(G, S) = e(G, SUM(n)(Si)) = MUL(n)(e(G, Si)) - // TODO: maybe `{message: G2Hex, publicKey: G1Hex}[]` instead? - verifyBatch(signature, items) { - aNonEmpty(items); - const sig = normSig(signature); - const nMessages = items.map((i) => i.message); - const nPublicKeys = items.map((i) => normPub(i.publicKey)); - // NOTE: this works only for exact same object - const messagePubKeyMap = new Map(); - for (let i = 0; i < nPublicKeys.length; i++) { - const pub = nPublicKeys[i]; - const msg = nMessages[i]; - let keys = messagePubKeyMap.get(msg); - if (keys === undefined) { - keys = []; - messagePubKeyMap.set(msg, keys); - } - keys.push(pub); - } - const paired = []; - const G = PubPoint.BASE; - try { - for (const [msg, keys] of messagePubKeyMap) { - const groupPublicKey = keys.reduce((acc, msg) => acc.add(msg)); - paired.push(pair(groupPublicKey, msg)); - } - paired.push(pair(G.negate(), sig)); - return Fp12.eql(pairingBatch(paired), Fp12.ONE); - } - catch { - return false; - } - }, - // Adds a bunch of public key points together. - // pk1 + pk2 + pk3 = pkA - aggregatePublicKeys(publicKeys) { - aNonEmpty(publicKeys); - publicKeys = publicKeys.map((pub) => normPub(pub)); - const agg = publicKeys.reduce((sum, p) => sum.add(p), PubPoint.ZERO); - agg.assertValidity(); - return agg; - }, - // Adds a bunch of signature points together. - // pk1 + pk2 + pk3 = pkA - aggregateSignatures(signatures) { - aNonEmpty(signatures); - signatures = signatures.map((sig) => normSig(sig)); - const agg = signatures.reduce((sum, s) => sum.add(s), SigPoint.ZERO); - agg.assertValidity(); - return agg; - }, - hash(messageBytes, DST) { - abytes(messageBytes); - const opts = DST ? { DST } : undefined; - return hashToSigCurve(messageBytes, opts); - }, - Signature: SignatureCoder, - }) /*satisfies Signer */; -} -// NOTE: separate function instead of function override, so we don't depend on hasher in bn254. -export function blsBasic(fields, G1_Point, G2_Point, params) { - // Fields are specific for curve, so for now we'll need to pass them with opts - const { Fp, Fr, Fp2, Fp6, Fp12 } = fields; - // Point on G1 curve: (x, y) - // const G1_Point = weierstrass(CURVE.G1, { Fn: Fr }); - const G1 = { Point: G1_Point }; - // Point on G2 curve (complex numbers): (x₁, x₂+i), (y₁, y₂+i) - const G2 = { Point: G2_Point }; - const pairingRes = createBlsPairing(fields, G1_Point, G2_Point, params); - const { millerLoopBatch, pairing, pairingBatch, calcPairingPrecomputes, randomSecretKey, lengths, } = pairingRes; - G1.Point.BASE.precompute(4); - return Object.freeze({ - lengths, - millerLoopBatch, - pairing, - pairingBatch, - G1, - G2, - fields: { Fr, Fp, Fp2, Fp6, Fp12 }, - params: { - ateLoopSize: params.ateLoopSize, - twistType: params.twistType, - }, - utils: { - randomSecretKey, - calcPairingPrecomputes, - }, - }); -} -// We can export this too, but seems there is not much reasons for now? If user wants hasher, they can just create hasher. -function blsHashers(fields, G1_Point, G2_Point, params, hasherParams) { - const base = blsBasic(fields, G1_Point, G2_Point, params); - const G1Hasher = createHasher(G1_Point, hasherParams.mapToG1 || notImplemented, { - ...hasherParams.hasherOpts, - ...hasherParams.hasherOptsG1, - }); - const G2Hasher = createHasher(G2_Point, hasherParams.mapToG2 || notImplemented, { - ...hasherParams.hasherOpts, - ...hasherParams.hasherOptsG2, - }); - return Object.freeze({ ...base, G1: G1Hasher, G2: G2Hasher }); -} -// G1_Point: ProjConstructor, G2_Point: ProjConstructor, -// Rename to blsSignatures? -export function bls(fields, G1_Point, G2_Point, params, hasherParams, signatureCoders) { - const base = blsHashers(fields, G1_Point, G2_Point, params, hasherParams); - const pairingRes = { - ...base, - Fr: base.fields.Fr, - Fp12: base.fields.Fp12, - calcPairingPrecomputes: base.utils.calcPairingPrecomputes, - randomSecretKey: base.utils.randomSecretKey, - }; - const longSignatures = createBlsSig(pairingRes, G1_Point, G2_Point, false, base.G2.hashToCurve, signatureCoders?.LongSignature); - const shortSignatures = createBlsSig(pairingRes, G2_Point, G1_Point, true, base.G1.hashToCurve, signatureCoders?.ShortSignature); - return Object.freeze({ ...base, longSignatures, shortSignatures }); -} -//# sourceMappingURL=bls.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/bls.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/bls.js.map deleted file mode 100644 index c378693b..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/bls.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bls.js","sourceRoot":"","sources":["../src/abstract/bls.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;IAeI;AACJ,sEAAsE;AACtE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAqB,MAAM,YAAY,CAAC;AAC3D,OAAO,EACL,YAAY,GAMb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAe,MAAM,cAAc,CAAC;AAE7E,OAAO,EAAoD,MAAM,kBAAkB,CAAC;AAIpF,kBAAkB;AAClB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAyIzE,8EAA8E;AAC9E,SAAS,gBAAgB,CAAC,CAAS;IACjC,MAAM,GAAG,GAAG,EAAE,CAAC;IACf,4BAA4B;IAC5B,OAAO,CAAC,GAAG,GAAG,EAAE,CAAC,KAAK,GAAG,EAAE,CAAC;QAC1B,IAAI,CAAC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MAAM,cAAc,GAAG,YAAY,CACjC,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,IAAI,CAAC,EAAE,CAAC,WAAW,EACnB,eAAe,EAAE,aAAa,CAC/B,CAAC;IACF,MAAM,eAAe,GAAG,YAAY,CAClC,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,IAAI,CAAC,EAAE,CAAC,WAAW,EACnB,eAAe,EAAE,cAAc,CAChC,CAAC;IACF,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,EAAE,cAAc,EAAE,eAAe,EAAE,CAAC,CAAC;AACrE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/curve.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/curve.d.ts deleted file mode 100644 index 0da52795..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/curve.d.ts +++ /dev/null @@ -1,195 +0,0 @@ -/** - * Methods for elliptic curve multiplication by scalars. - * Contains wNAF, pippenger. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { type Signer } from '../utils.ts'; -import { type IField } from './modular.ts'; -export type AffinePoint = { - x: T; - y: T; -} & { - Z?: never; -}; -/** Base interface for all elliptic curve Points. */ -export interface CurvePoint> { - /** Affine x coordinate. Different from projective / extended X coordinate. */ - x: F; - /** Affine y coordinate. Different from projective / extended Y coordinate. */ - y: F; - Z?: F; - double(): P; - negate(): P; - add(other: P): P; - subtract(other: P): P; - equals(other: P): boolean; - multiply(scalar: bigint): P; - assertValidity(): void; - clearCofactor(): P; - is0(): boolean; - isTorsionFree(): boolean; - isSmallOrder(): boolean; - multiplyUnsafe(scalar: bigint): P; - /** - * Massively speeds up `p.multiply(n)` by using precompute tables (caching). See {@link wNAF}. - * @param isLazy calculate cache now. Default (true) ensures it's deferred to first `multiply()` - */ - precompute(windowSize?: number, isLazy?: boolean): P; - /** Converts point to 2D xy affine coordinates */ - toAffine(invertedZ?: F): AffinePoint; - toBytes(): Uint8Array; - toHex(): string; -} -/** Base interface for all elliptic curve Point constructors. */ -export interface CurvePointCons

> { - [Symbol.hasInstance]: (item: unknown) => boolean; - BASE: P; - ZERO: P; - /** Field for basic curve math */ - Fp: IField>; - /** Scalar field, for scalars in multiply and others */ - Fn: IField; - /** Creates point from x, y. Does NOT validate if the point is valid. Use `.assertValidity()`. */ - fromAffine(p: AffinePoint>): P; - fromBytes(bytes: Uint8Array): P; - fromHex(hex: string): P; -} -/** Returns Fp type from Point (P_F

== P.F) */ -export type P_F

> = P extends CurvePoint ? F : never; -/** Returns Fp type from PointCons (PC_F == PC.P.F) */ -export type PC_F>> = PC['Fp']['ZERO']; -/** Returns Point type from PointCons (PC_P == PC.P) */ -export type PC_P>> = PC['ZERO']; -export type PC_ANY = CurvePointCons>>>>>>>>>>; -export interface CurveLengths { - secretKey?: number; - publicKey?: number; - publicKeyUncompressed?: number; - publicKeyHasPrefix?: boolean; - signature?: number; - seed?: number; -} -export type Mapper = (i: T[]) => T[]; -export declare function negateCt T; -}>(condition: boolean, item: T): T; -/** - * Takes a bunch of Projective Points but executes only one - * inversion on all of them. Inversion is very slow operation, - * so this improves performance massively. - * Optimization: converts a list of projective points to a list of identical points with Z=1. - */ -export declare function normalizeZ

, PC extends CurvePointCons

>(c: PC, points: P[]): P[]; -/** - * Elliptic curve multiplication of Point by scalar. Fragile. - * Table generation takes **30MB of ram and 10ms on high-end CPU**, - * but may take much longer on slow devices. Actual generation will happen on - * first call of `multiply()`. By default, `BASE` point is precomputed. - * - * Scalars should always be less than curve order: this should be checked inside of a curve itself. - * Creates precomputation tables for fast multiplication: - * - private scalar is split by fixed size windows of W bits - * - every window point is collected from window's table & added to accumulator - * - since windows are different, same point inside tables won't be accessed more than once per calc - * - each multiplication is 'Math.ceil(CURVE_ORDER / 𝑊) + 1' point additions (fixed for any scalar) - * - +1 window is neccessary for wNAF - * - wNAF reduces table size: 2x less memory + 2x faster generation, but 10% slower multiplication - * - * @todo Research returning 2d JS array of windows, instead of a single window. - * This would allow windows to be in different memory locations - */ -export declare class wNAF { - private readonly BASE; - private readonly ZERO; - private readonly Fn; - readonly bits: number; - constructor(Point: PC, bits: number); - _unsafeLadder(elm: PC_P, n: bigint, p?: PC_P): PC_P; - /** - * Creates a wNAF precomputation window. Used for caching. - * Default window size is set by `utils.precompute()` and is equal to 8. - * Number of precomputed points depends on the curve size: - * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where: - * - 𝑊 is the window size - * - 𝑛 is the bitlength of the curve order. - * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224. - * @param point Point instance - * @param W window size - * @returns precomputed point tables flattened to a single array - */ - private precomputeWindow; - /** - * Implements ec multiplication using precomputed tables and w-ary non-adjacent form. - * More compact implementation: - * https://github.com/paulmillr/noble-secp256k1/blob/47cb1669b6e506ad66b35fe7d76132ae97465da2/index.ts#L502-L541 - * @returns real and fake (for const-time) points - */ - private wNAF; - /** - * Implements ec unsafe (non const-time) multiplication using precomputed tables and w-ary non-adjacent form. - * @param acc accumulator point to add result of multiplication - * @returns point - */ - private wNAFUnsafe; - private getPrecomputes; - cached(point: PC_P, scalar: bigint, transform?: Mapper>): { - p: PC_P; - f: PC_P; - }; - unsafe(point: PC_P, scalar: bigint, transform?: Mapper>, prev?: PC_P): PC_P; - createCache(P: PC_P, W: number): void; - hasCache(elm: PC_P): boolean; -} -/** - * Endomorphism-specific multiplication for Koblitz curves. - * Cost: 128 dbl, 0-256 adds. - */ -export declare function mulEndoUnsafe

, PC extends CurvePointCons

>(Point: PC, point: P, k1: bigint, k2: bigint): { - p1: P; - p2: P; -}; -/** - * Pippenger algorithm for multi-scalar multiplication (MSM, Pa + Qb + Rc + ...). - * 30x faster vs naive addition on L=4096, 10x faster than precomputes. - * For N=254bit, L=1, it does: 1024 ADD + 254 DBL. For L=5: 1536 ADD + 254 DBL. - * Algorithmically constant-time (for same L), even when 1 point + scalar, or when scalar = 0. - * @param c Curve Point constructor - * @param fieldN field over CURVE.N - important that it's not over CURVE.P - * @param points array of L curve points - * @param scalars array of L scalars (aka secret keys / bigints) - */ -export declare function pippenger

, PC extends CurvePointCons

>(c: PC, points: P[], scalars: bigint[]): P; -/** - * Precomputed multi-scalar multiplication (MSM, Pa + Qb + Rc + ...). - * @param c Curve Point constructor - * @param fieldN field over CURVE.N - important that it's not over CURVE.P - * @param points array of L curve points - * @returns function which multiplies points with scaars - */ -export declare function precomputeMSMUnsafe

, PC extends CurvePointCons

>(c: PC, points: P[], windowSize: number): (scalars: bigint[]) => P; -export type ValidCurveParams = { - p: bigint; - n: bigint; - h: bigint; - a: T; - b?: T; - d?: T; - Gx: T; - Gy: T; -}; -export type FpFn = { - Fp: IField; - Fn: IField; -}; -/** Validates CURVE opts and creates fields */ -export declare function createCurveFields(type: 'weierstrass' | 'edwards', CURVE: ValidCurveParams, curveOpts?: Partial>, FpFnLE?: boolean): FpFn & { - CURVE: ValidCurveParams; -}; -type KeygenFn = (seed?: Uint8Array, isCompressed?: boolean) => { - secretKey: Uint8Array; - publicKey: Uint8Array; -}; -export declare function createKeygen(randomSecretKey: Function, getPublicKey: Signer['getPublicKey']): KeygenFn; -export {}; -//# sourceMappingURL=curve.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/curve.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/curve.d.ts.map deleted file mode 100644 index a1013f00..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/curve.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"curve.d.ts","sourceRoot":"","sources":["../src/abstract/curve.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,sEAAsE;AACtE,OAAO,EAAmB,KAAK,MAAM,EAAE,MAAM,aAAa,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,CAAA;CAAE,CAmB1C;AAED,KAAK,QAAQ,GAAG,CACd,IAAI,CAAC,EAAE,UAAU,EACjB,YAAY,CAAC,EAAE,OAAO,KACnB;IAAE,SAAS,EAAE,UAAU,CAAC;IAAC,SAAS,EAAE,UAAU,CAAA;CAAE,CAAC;AACtD,wBAAgB,YAAY,CAC1B,eAAe,EAAE,QAAQ,EACzB,YAAY,EAAE,MAAM,CAAC,cAAc,CAAC,GACnC,QAAQ,CAKV"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/curve.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/curve.js deleted file mode 100644 index 2198cd9e..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/curve.js +++ /dev/null @@ -1,457 +0,0 @@ -/** - * Methods for elliptic curve multiplication by scalars. - * Contains wNAF, pippenger. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { bitLen, bitMask } from "../utils.js"; -import { Field, FpInvertBatch, validateField } from "./modular.js"; -const _0n = /* @__PURE__ */ BigInt(0); -const _1n = /* @__PURE__ */ BigInt(1); -export function negateCt(condition, item) { - const neg = item.negate(); - return condition ? neg : item; -} -/** - * Takes a bunch of Projective Points but executes only one - * inversion on all of them. Inversion is very slow operation, - * so this improves performance massively. - * Optimization: converts a list of projective points to a list of identical points with Z=1. - */ -export function normalizeZ(c, points) { - const invertedZs = FpInvertBatch(c.Fp, points.map((p) => p.Z)); - return points.map((p, i) => c.fromAffine(p.toAffine(invertedZs[i]))); -} -function validateW(W, bits) { - if (!Number.isSafeInteger(W) || W <= 0 || W > bits) - throw new Error('invalid window size, expected [1..' + bits + '], got W=' + W); -} -function calcWOpts(W, scalarBits) { - validateW(W, scalarBits); - const windows = Math.ceil(scalarBits / W) + 1; // W=8 33. Not 32, because we skip zero - const windowSize = 2 ** (W - 1); // W=8 128. Not 256, because we skip zero - const maxNumber = 2 ** W; // W=8 256 - const mask = bitMask(W); // W=8 255 == mask 0b11111111 - const shiftBy = BigInt(W); // W=8 8 - return { windows, windowSize, mask, maxNumber, shiftBy }; -} -function calcOffsets(n, window, wOpts) { - const { windowSize, mask, maxNumber, shiftBy } = wOpts; - let wbits = Number(n & mask); // extract W bits. - let nextN = n >> shiftBy; // shift number by W bits. - // What actually happens here: - // const highestBit = Number(mask ^ (mask >> 1n)); - // let wbits2 = wbits - 1; // skip zero - // if (wbits2 & highestBit) { wbits2 ^= Number(mask); // (~); - // split if bits > max: +224 => 256-32 - if (wbits > windowSize) { - // we skip zero, which means instead of `>= size-1`, we do `> size` - wbits -= maxNumber; // -32, can be maxNumber - wbits, but then we need to set isNeg here. - nextN += _1n; // +256 (carry) - } - const offsetStart = window * windowSize; - const offset = offsetStart + Math.abs(wbits) - 1; // -1 because we skip zero - const isZero = wbits === 0; // is current window slice a 0? - const isNeg = wbits < 0; // is current window slice negative? - const isNegF = window % 2 !== 0; // fake random statement for noise - const offsetF = offsetStart; // fake offset for noise - return { nextN, offset, isZero, isNeg, isNegF, offsetF }; -} -function validateMSMPoints(points, c) { - if (!Array.isArray(points)) - throw new Error('array expected'); - points.forEach((p, i) => { - if (!(p instanceof c)) - throw new Error('invalid point at index ' + i); - }); -} -function validateMSMScalars(scalars, field) { - if (!Array.isArray(scalars)) - throw new Error('array of scalars expected'); - scalars.forEach((s, i) => { - if (!field.isValid(s)) - throw new Error('invalid scalar at index ' + i); - }); -} -// Since points in different groups cannot be equal (different object constructor), -// we can have single place to store precomputes. -// Allows to make points frozen / immutable. -const pointPrecomputes = new WeakMap(); -const pointWindowSizes = new WeakMap(); -function getW(P) { - // To disable precomputes: - // return 1; - return pointWindowSizes.get(P) || 1; -} -function assert0(n) { - if (n !== _0n) - throw new Error('invalid wNAF'); -} -/** - * Elliptic curve multiplication of Point by scalar. Fragile. - * Table generation takes **30MB of ram and 10ms on high-end CPU**, - * but may take much longer on slow devices. Actual generation will happen on - * first call of `multiply()`. By default, `BASE` point is precomputed. - * - * Scalars should always be less than curve order: this should be checked inside of a curve itself. - * Creates precomputation tables for fast multiplication: - * - private scalar is split by fixed size windows of W bits - * - every window point is collected from window's table & added to accumulator - * - since windows are different, same point inside tables won't be accessed more than once per calc - * - each multiplication is 'Math.ceil(CURVE_ORDER / 𝑊) + 1' point additions (fixed for any scalar) - * - +1 window is neccessary for wNAF - * - wNAF reduces table size: 2x less memory + 2x faster generation, but 10% slower multiplication - * - * @todo Research returning 2d JS array of windows, instead of a single window. - * This would allow windows to be in different memory locations - */ -export class wNAF { - BASE; - ZERO; - Fn; - bits; - // Parametrized with a given Point class (not individual point) - constructor(Point, bits) { - this.BASE = Point.BASE; - this.ZERO = Point.ZERO; - this.Fn = Point.Fn; - this.bits = bits; - } - // non-const time multiplication ladder - _unsafeLadder(elm, n, p = this.ZERO) { - let d = elm; - while (n > _0n) { - if (n & _1n) - p = p.add(d); - d = d.double(); - n >>= _1n; - } - return p; - } - /** - * Creates a wNAF precomputation window. Used for caching. - * Default window size is set by `utils.precompute()` and is equal to 8. - * Number of precomputed points depends on the curve size: - * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where: - * - 𝑊 is the window size - * - 𝑛 is the bitlength of the curve order. - * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224. - * @param point Point instance - * @param W window size - * @returns precomputed point tables flattened to a single array - */ - precomputeWindow(point, W) { - const { windows, windowSize } = calcWOpts(W, this.bits); - const points = []; - let p = point; - let base = p; - for (let window = 0; window < windows; window++) { - base = p; - points.push(base); - // i=1, bc we skip 0 - for (let i = 1; i < windowSize; i++) { - base = base.add(p); - points.push(base); - } - p = base.double(); - } - return points; - } - /** - * Implements ec multiplication using precomputed tables and w-ary non-adjacent form. - * More compact implementation: - * https://github.com/paulmillr/noble-secp256k1/blob/47cb1669b6e506ad66b35fe7d76132ae97465da2/index.ts#L502-L541 - * @returns real and fake (for const-time) points - */ - wNAF(W, precomputes, n) { - // Scalar should be smaller than field order - if (!this.Fn.isValid(n)) - throw new Error('invalid scalar'); - // Accumulators - let p = this.ZERO; - let f = this.BASE; - // This code was first written with assumption that 'f' and 'p' will never be infinity point: - // since each addition is multiplied by 2 ** W, it cannot cancel each other. However, - // there is negate now: it is possible that negated element from low value - // would be the same as high element, which will create carry into next window. - // It's not obvious how this can fail, but still worth investigating later. - const wo = calcWOpts(W, this.bits); - for (let window = 0; window < wo.windows; window++) { - // (n === _0n) is handled and not early-exited. isEven and offsetF are used for noise - const { nextN, offset, isZero, isNeg, isNegF, offsetF } = calcOffsets(n, window, wo); - n = nextN; - if (isZero) { - // bits are 0: add garbage to fake point - // Important part for const-time getPublicKey: add random "noise" point to f. - f = f.add(negateCt(isNegF, precomputes[offsetF])); - } - else { - // bits are 1: add to result point - p = p.add(negateCt(isNeg, precomputes[offset])); - } - } - assert0(n); - // Return both real and fake points: JIT won't eliminate f. - // At this point there is a way to F be infinity-point even if p is not, - // which makes it less const-time: around 1 bigint multiply. - return { p, f }; - } - /** - * Implements ec unsafe (non const-time) multiplication using precomputed tables and w-ary non-adjacent form. - * @param acc accumulator point to add result of multiplication - * @returns point - */ - wNAFUnsafe(W, precomputes, n, acc = this.ZERO) { - const wo = calcWOpts(W, this.bits); - for (let window = 0; window < wo.windows; window++) { - if (n === _0n) - break; // Early-exit, skip 0 value - const { nextN, offset, isZero, isNeg } = calcOffsets(n, window, wo); - n = nextN; - if (isZero) { - // Window bits are 0: skip processing. - // Move to next window. - continue; - } - else { - const item = precomputes[offset]; - acc = acc.add(isNeg ? item.negate() : item); // Re-using acc allows to save adds in MSM - } - } - assert0(n); - return acc; - } - getPrecomputes(W, point, transform) { - // Calculate precomputes on a first run, reuse them after - let comp = pointPrecomputes.get(point); - if (!comp) { - comp = this.precomputeWindow(point, W); - if (W !== 1) { - // Doing transform outside of if brings 15% perf hit - if (typeof transform === 'function') - comp = transform(comp); - pointPrecomputes.set(point, comp); - } - } - return comp; - } - cached(point, scalar, transform) { - const W = getW(point); - return this.wNAF(W, this.getPrecomputes(W, point, transform), scalar); - } - unsafe(point, scalar, transform, prev) { - const W = getW(point); - if (W === 1) - return this._unsafeLadder(point, scalar, prev); // For W=1 ladder is ~x2 faster - return this.wNAFUnsafe(W, this.getPrecomputes(W, point, transform), scalar, prev); - } - // We calculate precomputes for elliptic curve point multiplication - // using windowed method. This specifies window size and - // stores precomputed values. Usually only base point would be precomputed. - createCache(P, W) { - validateW(W, this.bits); - pointWindowSizes.set(P, W); - pointPrecomputes.delete(P); - } - hasCache(elm) { - return getW(elm) !== 1; - } -} -/** - * Endomorphism-specific multiplication for Koblitz curves. - * Cost: 128 dbl, 0-256 adds. - */ -export function mulEndoUnsafe(Point, point, k1, k2) { - let acc = point; - let p1 = Point.ZERO; - let p2 = Point.ZERO; - while (k1 > _0n || k2 > _0n) { - if (k1 & _1n) - p1 = p1.add(acc); - if (k2 & _1n) - p2 = p2.add(acc); - acc = acc.double(); - k1 >>= _1n; - k2 >>= _1n; - } - return { p1, p2 }; -} -/** - * Pippenger algorithm for multi-scalar multiplication (MSM, Pa + Qb + Rc + ...). - * 30x faster vs naive addition on L=4096, 10x faster than precomputes. - * For N=254bit, L=1, it does: 1024 ADD + 254 DBL. For L=5: 1536 ADD + 254 DBL. - * Algorithmically constant-time (for same L), even when 1 point + scalar, or when scalar = 0. - * @param c Curve Point constructor - * @param fieldN field over CURVE.N - important that it's not over CURVE.P - * @param points array of L curve points - * @param scalars array of L scalars (aka secret keys / bigints) - */ -export function pippenger(c, points, scalars) { - // If we split scalars by some window (let's say 8 bits), every chunk will only - // take 256 buckets even if there are 4096 scalars, also re-uses double. - // TODO: - // - https://eprint.iacr.org/2024/750.pdf - // - https://tches.iacr.org/index.php/TCHES/article/view/10287 - // 0 is accepted in scalars - const fieldN = c.Fn; - validateMSMPoints(points, c); - validateMSMScalars(scalars, fieldN); - const plength = points.length; - const slength = scalars.length; - if (plength !== slength) - throw new Error('arrays of points and scalars must have equal length'); - // if (plength === 0) throw new Error('array must be of length >= 2'); - const zero = c.ZERO; - const wbits = bitLen(BigInt(plength)); - let windowSize = 1; // bits - if (wbits > 12) - windowSize = wbits - 3; - else if (wbits > 4) - windowSize = wbits - 2; - else if (wbits > 0) - windowSize = 2; - const MASK = bitMask(windowSize); - const buckets = new Array(Number(MASK) + 1).fill(zero); // +1 for zero array - const lastBits = Math.floor((fieldN.BITS - 1) / windowSize) * windowSize; - let sum = zero; - for (let i = lastBits; i >= 0; i -= windowSize) { - buckets.fill(zero); - for (let j = 0; j < slength; j++) { - const scalar = scalars[j]; - const wbits = Number((scalar >> BigInt(i)) & MASK); - buckets[wbits] = buckets[wbits].add(points[j]); - } - let resI = zero; // not using this will do small speed-up, but will lose ct - // Skip first bucket, because it is zero - for (let j = buckets.length - 1, sumI = zero; j > 0; j--) { - sumI = sumI.add(buckets[j]); - resI = resI.add(sumI); - } - sum = sum.add(resI); - if (i !== 0) - for (let j = 0; j < windowSize; j++) - sum = sum.double(); - } - return sum; -} -/** - * Precomputed multi-scalar multiplication (MSM, Pa + Qb + Rc + ...). - * @param c Curve Point constructor - * @param fieldN field over CURVE.N - important that it's not over CURVE.P - * @param points array of L curve points - * @returns function which multiplies points with scaars - */ -export function precomputeMSMUnsafe(c, points, windowSize) { - /** - * Performance Analysis of Window-based Precomputation - * - * Base Case (256-bit scalar, 8-bit window): - * - Standard precomputation requires: - * - 31 additions per scalar × 256 scalars = 7,936 ops - * - Plus 255 summary additions = 8,191 total ops - * Note: Summary additions can be optimized via accumulator - * - * Chunked Precomputation Analysis: - * - Using 32 chunks requires: - * - 255 additions per chunk - * - 256 doublings - * - Total: (255 × 32) + 256 = 8,416 ops - * - * Memory Usage Comparison: - * Window Size | Standard Points | Chunked Points - * ------------|-----------------|--------------- - * 4-bit | 520 | 15 - * 8-bit | 4,224 | 255 - * 10-bit | 13,824 | 1,023 - * 16-bit | 557,056 | 65,535 - * - * Key Advantages: - * 1. Enables larger window sizes due to reduced memory overhead - * 2. More efficient for smaller scalar counts: - * - 16 chunks: (16 × 255) + 256 = 4,336 ops - * - ~2x faster than standard 8,191 ops - * - * Limitations: - * - Not suitable for plain precomputes (requires 256 constant doublings) - * - Performance degrades with larger scalar counts: - * - Optimal for ~256 scalars - * - Less efficient for 4096+ scalars (Pippenger preferred) - */ - const fieldN = c.Fn; - validateW(windowSize, fieldN.BITS); - validateMSMPoints(points, c); - const zero = c.ZERO; - const tableSize = 2 ** windowSize - 1; // table size (without zero) - const chunks = Math.ceil(fieldN.BITS / windowSize); // chunks of item - const MASK = bitMask(windowSize); - const tables = points.map((p) => { - const res = []; - for (let i = 0, acc = p; i < tableSize; i++) { - res.push(acc); - acc = acc.add(p); - } - return res; - }); - return (scalars) => { - validateMSMScalars(scalars, fieldN); - if (scalars.length > points.length) - throw new Error('array of scalars must be smaller than array of points'); - let res = zero; - for (let i = 0; i < chunks; i++) { - // No need to double if accumulator is still zero. - if (res !== zero) - for (let j = 0; j < windowSize; j++) - res = res.double(); - const shiftBy = BigInt(chunks * windowSize - (i + 1) * windowSize); - for (let j = 0; j < scalars.length; j++) { - const n = scalars[j]; - const curr = Number((n >> shiftBy) & MASK); - if (!curr) - continue; // skip zero scalars chunks - res = res.add(tables[j][curr - 1]); - } - } - return res; - }; -} -function createField(order, field, isLE) { - if (field) { - if (field.ORDER !== order) - throw new Error('Field.ORDER must match order: Fp == p, Fn == n'); - validateField(field); - return field; - } - else { - return Field(order, { isLE }); - } -} -/** Validates CURVE opts and creates fields */ -export function createCurveFields(type, CURVE, curveOpts = {}, FpFnLE) { - if (FpFnLE === undefined) - FpFnLE = type === 'edwards'; - if (!CURVE || typeof CURVE !== 'object') - throw new Error(`expected valid ${type} CURVE object`); - for (const p of ['p', 'n', 'h']) { - const val = CURVE[p]; - if (!(typeof val === 'bigint' && val > _0n)) - throw new Error(`CURVE.${p} must be positive bigint`); - } - const Fp = createField(CURVE.p, curveOpts.Fp, FpFnLE); - const Fn = createField(CURVE.n, curveOpts.Fn, FpFnLE); - const _b = type === 'weierstrass' ? 'b' : 'd'; - const params = ['Gx', 'Gy', 'a', _b]; - for (const p of params) { - // @ts-ignore - if (!Fp.isValid(CURVE[p])) - throw new Error(`CURVE.${p} must be valid field element of CURVE.Fp`); - } - CURVE = Object.freeze(Object.assign({}, CURVE)); - return { CURVE, Fp, Fn }; -} -export function createKeygen(randomSecretKey, getPublicKey) { - return function keygen(seed) { - const secretKey = randomSecretKey(seed); - return { secretKey, publicKey: getPublicKey(secretKey) }; - }; -} -//# sourceMappingURL=curve.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/curve.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/curve.js.map deleted file mode 100644 index e18e7993..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/curve.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"curve.js","sourceRoot":"","sources":["../src/abstract/curve.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,sEAAsE;AACtE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAe,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,aAAa,EAAe,MAAM,cAAc,CAAC;AAEhF,MAAM,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACtC,MAAM,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAqHtC,MAAM,UAAU,QAAQ,CAAgC,SAAkB,EAAE,IAAO;IACjF,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;IAC1B,OAAO,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;AAChC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CACxB,CAAK,EACL,MAAW;IAEX,MAAM,UAAU,GAAG,aAAa,CAC9B,CAAC,CAAC,E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AG,EAAE,EAAE,CAAU,CAAC;IAC9C,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;QACvB,aAAa;QACb,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,SAAS,CAAC,0CAA0C,CAAC,CAAC;IAC1E,CAAC;IACD,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;IAChD,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;AAC3B,CAAC;AAMD,MAAM,UAAU,YAAY,CAC1B,eAAyB,EACzB,YAAoC;IAEpC,OAAO,SAAS,MAAM,CAAC,IAAiB;QACtC,MAAM,SAAS,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;QACxC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,CAAC,SAAS,CAAC,EAAE,CAAC;IAC3D,CAAC,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/edwards.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/edwards.d.ts deleted file mode 100644 index 1b6f9bfb..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/edwards.d.ts +++ /dev/null @@ -1,184 +0,0 @@ -/** - * Twisted Edwards curve. The formula is: ax² + y² = 1 + dx²y². - * For design rationale of types / exports, see weierstrass module documentation. - * Untwisted Edwards curves exist, but they aren't used in real-world protocols. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { type FHash } from '../utils.ts'; -import { type AffinePoint, type CurveLengths, type CurvePoint, type CurvePointCons } from './curve.ts'; -import { type IField } from './modular.ts'; -/** Instance of Extended Point with coordinates in X, Y, Z, T. */ -export interface EdwardsPoint extends CurvePoint { - /** extended X coordinate. Different from affine x. */ - readonly X: bigint; - /** extended Y coordinate. Different from affine y. */ - readonly Y: bigint; - /** extended Z coordinate */ - readonly Z: bigint; - /** extended T coordinate */ - readonly T: bigint; -} -/** Static methods of Extended Point with coordinates in X, Y, Z, T. */ -export interface EdwardsPointCons extends CurvePointCons { - new (X: bigint, Y: bigint, Z: bigint, T: bigint): EdwardsPoint; - CURVE(): EdwardsOpts; - fromBytes(bytes: Uint8Array, zip215?: boolean): EdwardsPoint; - fromHex(hex: string, zip215?: boolean): EdwardsPoint; -} -/** - * Twisted Edwards curve options. - * - * * a: formula param - * * d: formula param - * * p: prime characteristic (order) of finite field, in which arithmetics is done - * * n: order of prime subgroup a.k.a total amount of valid curve points - * * h: cofactor. h*n is group order; n is subgroup order - * * Gx: x coordinate of generator point a.k.a. base point - * * Gy: y coordinate of generator point - */ -export type EdwardsOpts = Readonly<{ - p: bigint; - n: bigint; - h: bigint; - a: bigint; - d: bigint; - Gx: bigint; - Gy: bigint; -}>; -/** - * Extra curve options for Twisted Edwards. - * - * * Fp: redefined Field over curve.p - * * Fn: redefined Field over curve.n - * * uvRatio: helper function for decompression, calculating √(u/v) - */ -export type EdwardsExtraOpts = Partial<{ - Fp: IField; - Fn: IField; - FpFnLE: boolean; - uvRatio: (u: bigint, v: bigint) => { - isValid: boolean; - value: bigint; - }; -}>; -/** - * EdDSA (Edwards Digital Signature algorithm) options. - * - * * hash: hash function used to hash secret keys and messages - * * adjustScalarBytes: clears bits to get valid field element - * * domain: Used for hashing - * * mapToCurve: for hash-to-curve standard - * * prehash: RFC 8032 pre-hashing of messages to sign() / verify() - * * randomBytes: function generating random bytes, used for randomSecretKey - */ -export type EdDSAOpts = Partial<{ - adjustScalarBytes: (bytes: Uint8Array) => Uint8Array; - domain: (data: Uint8Array, ctx: Uint8Array, phflag: boolean) => Uint8Array; - mapToCurve: (scalar: bigint[]) => AffinePoint; - prehash: FHash; - randomBytes: (bytesLength?: number) => Uint8Array; -}>; -/** - * EdDSA (Edwards Digital Signature algorithm) interface. - * - * Allows to create and verify signatures, create public and secret keys. - */ -export interface EdDSA { - keygen: (seed?: Uint8Array) => { - secretKey: Uint8Array; - publicKey: Uint8Array; - }; - getPublicKey: (secretKey: Uint8Array) => Uint8Array; - sign: (message: Uint8Array, secretKey: Uint8Array, options?: { - context?: Uint8Array; - }) => Uint8Array; - verify: (sig: Uint8Array, message: Uint8Array, publicKey: Uint8Array, options?: { - context?: Uint8Array; - zip215: boolean; - }) => boolean; - Point: EdwardsPointCons; - utils: { - randomSecretKey: (seed?: Uint8Array) => Uint8Array; - isValidSecretKey: (secretKey: Uint8Array) => boolean; - isValidPublicKey: (publicKey: Uint8Array, zip215?: boolean) => boolean; - /** - * Converts ed public key to x public key. - * - * There is NO `fromMontgomery`: - * - There are 2 valid ed25519 points for every x25519, with flipped coordinate - * - Sometimes there are 0 valid ed25519 points, because x25519 *additionally* - * accepts inputs on the quadratic twist, which can't be moved to ed25519 - * - * @example - * ```js - * const someonesPub_ed = ed25519.getPublicKey(ed25519.utils.randomSecretKey()); - * const someonesPub = ed25519.utils.toMontgomery(someonesPub); - * const aPriv = x25519.utils.randomSecretKey(); - * const shared = x25519.getSharedSecret(aPriv, someonesPub) - * ``` - */ - toMontgomery: (publicKey: Uint8Array) => Uint8Array; - /** - * Converts ed secret key to x secret key. - * @example - * ```js - * const someonesPub = x25519.getPublicKey(x25519.utils.randomSecretKey()); - * const aPriv_ed = ed25519.utils.randomSecretKey(); - * const aPriv = ed25519.utils.toMontgomerySecret(aPriv_ed); - * const shared = x25519.getSharedSecret(aPriv, someonesPub) - * ``` - */ - toMontgomerySecret: (secretKey: Uint8Array) => Uint8Array; - getExtendedPublicKey: (key: Uint8Array) => { - head: Uint8Array; - prefix: Uint8Array; - scalar: bigint; - point: EdwardsPoint; - pointBytes: Uint8Array; - }; - }; - lengths: CurveLengths; -} -export declare function edwards(params: EdwardsOpts, extraOpts?: EdwardsExtraOpts): EdwardsPointCons; -/** - * Base class for prime-order points like Ristretto255 and Decaf448. - * These points eliminate cofactor issues by representing equivalence classes - * of Edwards curve points. - */ -export declare abstract class PrimeEdwardsPoint> implements CurvePoint { - static BASE: PrimeEdwardsPoint; - static ZERO: PrimeEdwardsPoint; - static Fp: IField; - static Fn: IField; - protected readonly ep: EdwardsPoint; - constructor(ep: EdwardsPoint); - abstract toBytes(): Uint8Array; - abstract equals(other: T): boolean; - static fromBytes(_bytes: Uint8Array): any; - static fromHex(_hex: string): any; - get x(): bigint; - get y(): bigint; - clearCofactor(): T; - assertValidity(): void; - toAffine(invertedZ?: bigint): AffinePoint; - toHex(): string; - toString(): string; - isTorsionFree(): boolean; - isSmallOrder(): boolean; - add(other: T): T; - subtract(other: T): T; - multiply(scalar: bigint): T; - multiplyUnsafe(scalar: bigint): T; - double(): T; - negate(): T; - precompute(windowSize?: number, isLazy?: boolean): T; - abstract is0(): boolean; - protected abstract assertSame(other: T): void; - protected abstract init(ep: EdwardsPoint): T; -} -/** - * Initializes EdDSA signatures over given Edwards curve. - */ -export declare function eddsa(Point: EdwardsPointCons, cHash: FHash, eddsaOpts?: EdDSAOpts): EdDSA; -//# sourceMappingURL=edwards.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/edwards.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/edwards.d.ts.map deleted file mode 100644 index 370f238f..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/edwards.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"edwards.d.ts","sourceRoot":"","sources":["../src/abstract/edwards.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,sEAAsE;AACtE,OAAO,EAcL,KAAK,KAAK,EAEX,MAAM,aAAa,CAAC;AACrB,OAAO,EAKL,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,cAA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ble/curves/abstract/edwards.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/edwards.js deleted file mode 100644 index 8d7b06d4..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/edwards.js +++ /dev/null @@ -1,558 +0,0 @@ -/** - * Twisted Edwards curve. The formula is: ax² + y² = 1 + dx²y². - * For design rationale of types / exports, see weierstrass module documentation. - * Untwisted Edwards curves exist, but they aren't used in real-world protocols. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { abool, abytes, aInRange, bytesToHex, bytesToNumberLE, concatBytes, copyBytes, hexToBytes, isBytes, memoized, notImplemented, validateObject, randomBytes as wcRandomBytes, } from "../utils.js"; -import { createCurveFields, createKeygen, normalizeZ, wNAF, } from "./curve.js"; -import {} from "./modular.js"; -// Be friendly to bad ECMAScript parsers by not using bigint literals -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _8n = BigInt(8); -function isEdValidXY(Fp, CURVE, x, y) { - const x2 = Fp.sqr(x); - const y2 = Fp.sqr(y); - const left = Fp.add(Fp.mul(CURVE.a, x2), y2); - const right = Fp.add(Fp.ONE, Fp.mul(CURVE.d, Fp.mul(x2, y2))); - return Fp.eql(left, right); -} -export function edwards(params, extraOpts = {}) { - const validated = createCurveFields('edwards', params, extraOpts, extraOpts.FpFnLE); - const { Fp, Fn } = validated; - let CURVE = validated.CURVE; - const { h: cofactor } = CURVE; - validateObject(extraOpts, {}, { uvRatio: 'function' }); - // Important: - // There are some places where Fp.BYTES is used instead of nByteLength. - // So far, everything has been tested with curves of Fp.BYTES == nByteLength. - // TODO: test and find curves which behave otherwise. - const MASK = _2n << (BigInt(Fn.BYTES * 8) - _1n); - const modP = (n) => Fp.create(n); // Function overrides - // sqrt(u/v) - const uvRatio = extraOpts.uvRatio || - ((u, v) => { - try { - return { isValid: true, value: Fp.sqrt(Fp.div(u, v)) }; - } - catch (e) { - return { isValid: false, value: _0n }; - } - }); - // Validate whether the passed curve params are valid. - // equation ax² + y² = 1 + dx²y² should work for generator point. - if (!isEdValidXY(Fp, CURVE, CURVE.Gx, CURVE.Gy)) - throw new Error('bad curve params: generator point'); - /** - * Asserts coordinate is valid: 0 <= n < MASK. - * Coordinates >= Fp.ORDER are allowed for zip215. - */ - function acoord(title, n, banZero = false) { - const min = banZero ? _1n : _0n; - aInRange('coordinate ' + title, n, min, MASK); - return n; - } - function aedpoint(other) { - if (!(other instanceof Point)) - throw new Error('EdwardsPoint expected'); - } - // Converts Extended point to default (x, y) coordinates. - // Can accept precomputed Z^-1 - for example, from invertBatch. - const toAffineMemo = memoized((p, iz) => { - const { X, Y, Z } = p; - const is0 = p.is0(); - if (iz == null) - iz = is0 ? _8n : Fp.inv(Z); // 8 was chosen arbitrarily - const x = modP(X * iz); - const y = modP(Y * iz); - const zz = Fp.mul(Z, iz); - if (is0) - return { x: _0n, y: _1n }; - if (zz !== _1n) - throw new Error('invZ was invalid'); - return { x, y }; - }); - const assertValidMemo = memoized((p) => { - const { a, d } = CURVE; - if (p.is0()) - throw new Error('bad point: ZERO'); // TODO: optimize, with vars below? - // Equation in affine coordinates: ax² + y² = 1 + dx²y² - // Equation in projective coordinates (X/Z, Y/Z, Z): (aX² + Y²)Z² = Z⁴ + dX²Y² - const { X, Y, Z, T } = p; - const X2 = modP(X * X); // X² - const Y2 = modP(Y * Y); // Y² - const Z2 = modP(Z * Z); // Z² - const Z4 = modP(Z2 * Z2); // Z⁴ - const aX2 = modP(X2 * a); // aX² - const left = modP(Z2 * modP(aX2 + Y2)); // (aX² + Y²)Z² - const right = modP(Z4 + modP(d * modP(X2 * Y2))); // Z⁴ + dX²Y² - if (left !== right) - throw new Error('bad point: equation left != right (1)'); - // In Extended coordinates we also have T, which is x*y=T/Z: check X*Y == Z*T - const XY = modP(X * Y); - const ZT = modP(Z * T); - if (XY !== ZT) - throw new Error('bad point: equation left != right (2)'); - return true; - }); - // Extended Point works in extended coordinates: (X, Y, Z, T) ∋ (x=X/Z, y=Y/Z, T=xy). - // https://en.wikipedia.org/wiki/Twisted_Edwards_curve#Extended_coordinates - class Point { - // base / generator point - static BASE = new Point(CURVE.Gx, CURVE.Gy, _1n, modP(CURVE.Gx * CURVE.Gy)); - // zero / infinity / identity point - static ZERO = new Point(_0n, _1n, _1n, _0n); // 0, 1, 1, 0 - // math field - static Fp = Fp; - // scalar field - static Fn = Fn; - X; - Y; - Z; - T; - constructor(X, Y, Z, T) { - this.X = acoord('x', X); - this.Y = acoord('y', Y); - this.Z = acoord('z', Z, true); - this.T = acoord('t', T); - Object.freeze(this); - } - static CURVE() { - return CURVE; - } - static fromAffine(p) { - if (p instanceof Point) - throw new Error('extended point not allowed'); - const { x, y } = p || {}; - acoord('x', x); - acoord('y', y); - return new Point(x, y, _1n, modP(x * y)); - } - // Uses algo from RFC8032 5.1.3. - static fromBytes(bytes, zip215 = false) { - const len = Fp.BYTES; - const { a, d } = CURVE; - bytes = copyBytes(abytes(bytes, len, 'point')); - abool(zip215, 'zip215'); - const normed = copyBytes(bytes); // copy again, we'll manipulate it - const lastByte = bytes[len - 1]; // select last byte - normed[len - 1] = lastByte & ~0x80; // clear last bit - const y = bytesToNumberLE(normed); - // zip215=true is good for consensus-critical apps. =false follows RFC8032 / NIST186-5. - // RFC8032 prohibits >= p, but ZIP215 doesn't - // zip215=true: 0 <= y < MASK (2^256 for ed25519) - // zip215=false: 0 <= y < P (2^255-19 for ed25519) - const max = zip215 ? MASK : Fp.ORDER; - aInRange('point.y', y, _0n, max); - // Ed25519: x² = (y²-1)/(dy²+1) mod p. Ed448: x² = (y²-1)/(dy²-1) mod p. Generic case: - // ax²+y²=1+dx²y² => y²-1=dx²y²-ax² => y²-1=x²(dy²-a) => x²=(y²-1)/(dy²-a) - const y2 = modP(y * y); // denominator is always non-0 mod p. - const u = modP(y2 - _1n); // u = y² - 1 - const v = modP(d * y2 - a); // v = d y² + 1. - let { isValid, value: x } = uvRatio(u, v); // √(u/v) - if (!isValid) - throw new Error('bad point: invalid y coordinate'); - const isXOdd = (x & _1n) === _1n; // There are 2 square roots. Use x_0 bit to select proper - const isLastByteOdd = (lastByte & 0x80) !== 0; // x_0, last bit - if (!zip215 && x === _0n && isLastByteOdd) - // if x=0 and x_0 = 1, fail - throw new Error('bad point: x=0 and x_0=1'); - if (isLastByteOdd !== isXOdd) - x = modP(-x); // if x_0 != x mod 2, set x = p-x - return Point.fromAffine({ x, y }); - } - static fromHex(hex, zip215 = false) { - return Point.fromBytes(hexToBytes(hex), zip215); - } - get x() { - return this.toAffine().x; - } - get y() { - return this.toAffine().y; - } - precompute(windowSize = 8, isLazy = true) { - wnaf.createCache(this, windowSize); - if (!isLazy) - this.multiply(_2n); // random number - return this; - } - // Useful in fromAffine() - not for fromBytes(), which always created valid points. - assertValidity() { - assertValidMemo(this); - } - // Compare one point to another. - equals(other) { - aedpoint(other); - const { X: X1, Y: Y1, Z: Z1 } = this; - const { X: X2, Y: Y2, Z: Z2 } = other; - const X1Z2 = modP(X1 * Z2); - const X2Z1 = modP(X2 * Z1); - const Y1Z2 = modP(Y1 * Z2); - const Y2Z1 = modP(Y2 * Z1); - return X1Z2 === X2Z1 && Y1Z2 === Y2Z1; - } - is0() { - return this.equals(Point.ZERO); - } - negate() { - // Flips point sign to a negative one (-x, y in affine coords) - return new Point(modP(-this.X), this.Y, this.Z, modP(-this.T)); - } - // Fast algo for doubling Extended Point. - // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-dbl-2008-hwcd - // Cost: 4M + 4S + 1*a + 6add + 1*2. - double() { - const { a } = CURVE; - const { X: X1, Y: Y1, Z: Z1 } = this; - const A = modP(X1 * X1); // A = X12 - const B = modP(Y1 * Y1); // B = Y12 - const C = modP(_2n * modP(Z1 * Z1)); // C = 2*Z12 - const D = modP(a * A); // D = a*A - const x1y1 = X1 + Y1; - const E = modP(modP(x1y1 * x1y1) - A - B); // E = (X1+Y1)2-A-B - const G = D + B; // G = D+B - const F = G - C; // F = G-C - const H = D - B; // H = D-B - const X3 = modP(E * F); // X3 = E*F - const Y3 = modP(G * H); // Y3 = G*H - const T3 = modP(E * H); // T3 = E*H - const Z3 = modP(F * G); // Z3 = F*G - return new Point(X3, Y3, Z3, T3); - } - // Fast algo for adding 2 Extended Points. - // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-add-2008-hwcd - // Cost: 9M + 1*a + 1*d + 7add. - add(other) { - aedpoint(other); - const { a, d } = CURVE; - const { X: X1, Y: Y1, Z: Z1, T: T1 } = this; - const { X: X2, Y: Y2, Z: Z2, T: T2 } = other; - const A = modP(X1 * X2); // A = X1*X2 - const B = modP(Y1 * Y2); // B = Y1*Y2 - const C = modP(T1 * d * T2); // C = T1*d*T2 - const D = modP(Z1 * Z2); // D = Z1*Z2 - const E = modP((X1 + Y1) * (X2 + Y2) - A - B); // E = (X1+Y1)*(X2+Y2)-A-B - const F = D - C; // F = D-C - const G = D + C; // G = D+C - const H = modP(B - a * A); // H = B-a*A - const X3 = modP(E * F); // X3 = E*F - const Y3 = modP(G * H); // Y3 = G*H - const T3 = modP(E * H); // T3 = E*H - const Z3 = modP(F * G); // Z3 = F*G - return new Point(X3, Y3, Z3, T3); - } - subtract(other) { - return this.add(other.negate()); - } - // Constant-time multiplication. - multiply(scalar) { - // 1 <= scalar < L - if (!Fn.isValidNot0(scalar)) - throw new Error('invalid scalar: expected 1 <= sc < curve.n'); - const { p, f } = wnaf.cached(this, scalar, (p) => normalizeZ(Point, p)); - return normalizeZ(Point, [p, f])[0]; - } - // Non-constant-time multiplication. Uses double-and-add algorithm. - // It's faster, but should only be used when you don't care about - // an exposed private key e.g. sig verification. - // Does NOT allow scalars higher than CURVE.n. - // Accepts optional accumulator to merge with multiply (important for sparse scalars) - multiplyUnsafe(scalar, acc = Point.ZERO) { - // 0 <= scalar < L - if (!Fn.isValid(scalar)) - throw new Error('invalid scalar: expected 0 <= sc < curve.n'); - if (scalar === _0n) - return Point.ZERO; - if (this.is0() || scalar === _1n) - return this; - return wnaf.unsafe(this, scalar, (p) => normalizeZ(Point, p), acc); - } - // Checks if point is of small order. - // If you add something to small order point, you will have "dirty" - // point with torsion component. - // Multiplies point by cofactor and checks if the result is 0. - isSmallOrder() { - return this.multiplyUnsafe(cofactor).is0(); - } - // Multiplies point by curve order and checks if the result is 0. - // Returns `false` is the point is dirty. - isTorsionFree() { - return wnaf.unsafe(this, CURVE.n).is0(); - } - // Converts Extended point to default (x, y) coordinates. - // Can accept precomputed Z^-1 - for example, from invertBatch. - toAffine(invertedZ) { - return toAffineMemo(this, invertedZ); - } - clearCofactor() { - if (cofactor === _1n) - return this; - return this.multiplyUnsafe(cofactor); - } - toBytes() { - const { x, y } = this.toAffine(); - // Fp.toBytes() allows non-canonical encoding of y (>= p). - const bytes = Fp.toBytes(y); - // Each y has 2 valid points: (x, y), (x,-y). - // When compressing, it's enough to store y and use the last byte to encode sign of x - bytes[bytes.length - 1] |= x & _1n ? 0x80 : 0; - return bytes; - } - toHex() { - return bytesToHex(this.toBytes()); - } - toString() { - return ``; - } - } - const wnaf = new wNAF(Point, Fn.BITS); - Point.BASE.precompute(8); // Enable precomputes. Slows down first publicKey computation by 20ms. - return Point; -} -/** - * Base class for prime-order points like Ristretto255 and Decaf448. - * These points eliminate cofactor issues by representing equivalence classes - * of Edwards curve points. - */ -export class PrimeEdwardsPoint { - static BASE; - static ZERO; - static Fp; - static Fn; - ep; - constructor(ep) { - this.ep = ep; - } - // Static methods that must be implemented by subclasses - static fromBytes(_bytes) { - notImplemented(); - } - static fromHex(_hex) { - notImplemented(); - } - get x() { - return this.toAffine().x; - } - get y() { - return this.toAffine().y; - } - // Common implementations - clearCofactor() { - // no-op for prime-order groups - return this; - } - assertValidity() { - this.ep.assertValidity(); - } - toAffine(invertedZ) { - return this.ep.toAffine(invertedZ); - } - toHex() { - return bytesToHex(this.toBytes()); - } - toString() { - return this.toHex(); - } - isTorsionFree() { - return true; - } - isSmallOrder() { - return false; - } - add(other) { - this.assertSame(other); - return this.init(this.ep.add(other.ep)); - } - subtract(other) { - this.assertSame(other); - return this.init(this.ep.subtract(other.ep)); - } - multiply(scalar) { - return this.init(this.ep.multiply(scalar)); - } - multiplyUnsafe(scalar) { - return this.init(this.ep.multiplyUnsafe(scalar)); - } - double() { - return this.init(this.ep.double()); - } - negate() { - return this.init(this.ep.negate()); - } - precompute(windowSize, isLazy) { - return this.init(this.ep.precompute(windowSize, isLazy)); - } -} -/** - * Initializes EdDSA signatures over given Edwards curve. - */ -export function eddsa(Point, cHash, eddsaOpts = {}) { - if (typeof cHash !== 'function') - throw new Error('"hash" function param is required'); - validateObject(eddsaOpts, {}, { - adjustScalarBytes: 'function', - randomBytes: 'function', - domain: 'function', - prehash: 'function', - mapToCurve: 'function', - }); - const { prehash } = eddsaOpts; - const { BASE, Fp, Fn } = Point; - const randomBytes = eddsaOpts.randomBytes || wcRandomBytes; - const adjustScalarBytes = eddsaOpts.adjustScalarBytes || ((bytes) => bytes); - const domain = eddsaOpts.domain || - ((data, ctx, phflag) => { - abool(phflag, 'phflag'); - if (ctx.length || phflag) - throw new Error('Contexts/pre-hash are not supported'); - return data; - }); // NOOP - // Little-endian SHA512 with modulo n - function modN_LE(hash) { - return Fn.create(bytesToNumberLE(hash)); // Not Fn.fromBytes: it has length limit - } - // Get the hashed private scalar per RFC8032 5.1.5 - function getPrivateScalar(key) { - const len = lengths.secretKey; - abytes(key, lengths.secretKey, 'secretKey'); - // Hash private key with curve's hash function to produce uniformingly random input - // Check byte lengths: ensure(64, h(ensure(32, key))) - const hashed = abytes(cHash(key), 2 * len, 'hashedSecretKey'); - const head = adjustScalarBytes(hashed.slice(0, len)); // clear first half bits, produce FE - const prefix = hashed.slice(len, 2 * len); // second half is called key prefix (5.1.6) - const scalar = modN_LE(head); // The actual private scalar - return { head, prefix, scalar }; - } - /** Convenience method that creates public key from scalar. RFC8032 5.1.5 */ - function getExtendedPublicKey(secretKey) { - const { head, prefix, scalar } = getPrivateScalar(secretKey); - const point = BASE.multiply(scalar); // Point on Edwards curve aka public key - const pointBytes = point.toBytes(); - return { head, prefix, scalar, point, pointBytes }; - } - /** Calculates EdDSA pub key. RFC8032 5.1.5. */ - function getPublicKey(secretKey) { - return getExtendedPublicKey(secretKey).pointBytes; - } - // int('LE', SHA512(dom2(F, C) || msgs)) mod N - function hashDomainToScalar(context = Uint8Array.of(), ...msgs) { - const msg = concatBytes(...msgs); - return modN_LE(cHash(domain(msg, abytes(context, undefined, 'context'), !!prehash))); - } - /** Signs message with secret key. RFC8032 5.1.6 */ - function sign(msg, secretKey, options = {}) { - msg = abytes(msg, undefined, 'message'); - if (prehash) - msg = prehash(msg); // for ed25519ph etc. - const { prefix, scalar, pointBytes } = getExtendedPublicKey(secretKey); - const r = hashDomainToScalar(options.context, prefix, msg); // r = dom2(F, C) || prefix || PH(M) - const R = BASE.multiply(r).toBytes(); // R = rG - const k = hashDomainToScalar(options.context, R, pointBytes, msg); // R || A || PH(M) - const s = Fn.create(r + k * scalar); // S = (r + k * s) mod L - if (!Fn.isValid(s)) - throw new Error('sign failed: invalid s'); // 0 <= s < L - const rs = concatBytes(R, Fn.toBytes(s)); - return abytes(rs, lengths.signature, 'result'); - } - // verification rule is either zip215 or rfc8032 / nist186-5. Consult fromHex: - const verifyOpts = { zip215: true }; - /** - * Verifies EdDSA signature against message and public key. RFC8032 5.1.7. - * An extended group equation is checked. - */ - function verify(sig, msg, publicKey, options = verifyOpts) { - const { context, zip215 } = options; - const len = lengths.signature; - sig = abytes(sig, len, 'signature'); - msg = abytes(msg, undefined, 'message'); - publicKey = abytes(publicKey, lengths.publicKey, 'publicKey'); - if (zip215 !== undefined) - abool(zip215, 'zip215'); - if (prehash) - msg = prehash(msg); // for ed25519ph, etc - const mid = len / 2; - const r = sig.subarray(0, mid); - const s = bytesToNumberLE(sig.subarray(mid, len)); - let A, R, SB; - try { - // zip215=true is good for consensus-critical apps. =false follows RFC8032 / NIST186-5. - // zip215=true: 0 <= y < MASK (2^256 for ed25519) - // zip215=false: 0 <= y < P (2^255-19 for ed25519) - A = Point.fromBytes(publicKey, zip215); - R = Point.fromBytes(r, zip215); - SB = BASE.multiplyUnsafe(s); // 0 <= s < l is done inside - } - catch (error) { - return false; - } - if (!zip215 && A.isSmallOrder()) - return false; // zip215 allows public keys of small order - const k = hashDomainToScalar(context, R.toBytes(), A.toBytes(), msg); - const RkA = R.add(A.multiplyUnsafe(k)); - // Extended group equation - // [8][S]B = [8]R + [8][k]A' - return RkA.subtract(SB).clearCofactor().is0(); - } - const _size = Fp.BYTES; // 32 for ed25519, 57 for ed448 - const lengths = { - secretKey: _size, - publicKey: _size, - signature: 2 * _size, - seed: _size, - }; - function randomSecretKey(seed = randomBytes(lengths.seed)) { - return abytes(seed, lengths.seed, 'seed'); - } - function isValidSecretKey(key) { - return isBytes(key) && key.length === Fn.BYTES; - } - function isValidPublicKey(key, zip215) { - try { - return !!Point.fromBytes(key, zip215); - } - catch (error) { - return false; - } - } - const utils = { - getExtendedPublicKey, - randomSecretKey, - isValidSecretKey, - isValidPublicKey, - /** - * Converts ed public key to x public key. Uses formula: - * - ed25519: - * - `(u, v) = ((1+y)/(1-y), sqrt(-486664)*u/x)` - * - `(x, y) = (sqrt(-486664)*u/v, (u-1)/(u+1))` - * - ed448: - * - `(u, v) = ((y-1)/(y+1), sqrt(156324)*u/x)` - * - `(x, y) = (sqrt(156324)*u/v, (1+u)/(1-u))` - */ - toMontgomery(publicKey) { - const { y } = Point.fromBytes(publicKey); - const size = lengths.publicKey; - const is25519 = size === 32; - if (!is25519 && size !== 57) - throw new Error('only defined for 25519 and 448'); - const u = is25519 ? Fp.div(_1n + y, _1n - y) : Fp.div(y - _1n, y + _1n); - return Fp.toBytes(u); - }, - toMontgomerySecret(secretKey) { - const size = lengths.secretKey; - abytes(secretKey, size); - const hashed = cHash(secretKey.subarray(0, size)); - return adjustScalarBytes(hashed).subarray(0, size); - }, - }; - return Object.freeze({ - keygen: createKeygen(randomSecretKey, getPublicKey), - getPublicKey, - sign, - verify, - utils, - Point, - lengths, - }); -} -//# sourceMappingURL=edwards.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/edwards.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/edwards.js.map deleted file mode 100644 index e990322b..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/edwards.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"edwards.js","sourceRoot":"","sources":["../src/abstract/edwards.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,sEAAsE;AACtE,OAAO,EACL,KAAK,EACL,MAAM,EACN,QAAQ,EACR,UAAU,EACV,eAAe,EACf,WAAW,EACX,SAAS,EACT,UAAU,EACV,OAAO,EACP,QAAQ,EACR,cAAc,EACd,cAAc,EACd,WAAW,IAAI,aAAa,GAG7B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,UAAU,EACV,IAAI,GAKL,MAAM,YAAY,CAAC;AACpB,OAAO,EAAe,MAAM,cAAc,CAAC;AAE3C,qEAAqE;AACrE,kBAAkB;AAClB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AA0IzE,SAAS,WAAW,CAAC,EAAkB,EAAE,KAAkB,EAAE,CAAS,EAAE,CAAS;IAC/E,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACrB,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACrB,MAAM,IAAI,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,EAA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AAC,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;YAClD,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;QACrD,CAAC;KACF,CAAC;IAEF,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,MAAM,EAAE,YAAY,CAAC,eAAe,EAAE,YAAY,CAAC;QACnD,YAAY;QACZ,IAAI;QACJ,MAAM;QACN,KAAK;QACL,KAAK;QACL,OAAO;KACR,CAAkB,CAAC;AACtB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/fft.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/fft.d.ts deleted file mode 100644 index f3210b12..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/fft.d.ts +++ /dev/null @@ -1,127 +0,0 @@ -/** - * Experimental implementation of NTT / FFT (Fast Fourier Transform) over finite fields. - * API may change at any time. The code has not been audited. Feature requests are welcome. - * @module - */ -import type { IField } from './modular.ts'; -export interface MutableArrayLike { - [index: number]: T; - length: number; - slice(start?: number, end?: number): this; - [Symbol.iterator](): Iterator; -} -/** Checks if integer is in form of `1 << X` */ -export declare function isPowerOfTwo(x: number): boolean; -export declare function nextPowerOfTwo(n: number): number; -export declare function reverseBits(n: number, bits: number): number; -/** Similar to `bitLen(x)-1` but much faster for small integers, like indices */ -export declare function log2(n: number): number; -/** - * Moves lowest bit to highest position, which at first step splits - * array on even and odd indices, then it applied again to each part, - * which is core of fft - */ -export declare function bitReversalInplace>(values: T): T; -export declare function bitReversalPermutation(values: T[]): T[]; -export type RootsOfUnity = { - info: { - G: bigint; - oddFactor: bigint; - powerOfTwo: number; - }; - roots: (bits: number) => bigint[]; - brp(bits: number): bigint[]; - inverse(bits: number): bigint[]; - omega: (bits: number) => bigint; - clear: () => void; -}; -/** We limit roots up to 2**31, which is a lot: 2-billion polynomimal should be rare. */ -export declare function rootsOfUnity(field: IField, generator?: bigint): RootsOfUnity; -export type Polynomial = MutableArrayLike; -/** - * Maps great to Field, but not to Group (EC points): - * - inv from scalar field - * - we need multiplyUnsafe here, instead of multiply for speed - * - multiplyUnsafe is safe in the context: we do mul(rootsOfUnity), which are public and sparse - */ -export type FFTOpts = { - add: (a: T, b: T) => T; - sub: (a: T, b: T) => T; - mul: (a: T, scalar: R) => T; - inv: (a: R) => R; -}; -export type FFTCoreOpts = { - N: number; - roots: Polynomial; - dit: boolean; - invertButterflies?: boolean; - skipStages?: number; - brp?: boolean; -}; -export type FFTCoreLoop =

>(values: P) => P; -/** - * Constructs different flavors of FFT. radix2 implementation of low level mutating API. Flavors: - * - * - DIT (Decimation-in-Time): Bottom-Up (leaves -> root), Cool-Turkey - * - DIF (Decimation-in-Frequency): Top-Down (root -> leaves), Gentleman–Sande - * - * DIT takes brp input, returns natural output. - * DIF takes natural input, returns brp output. - * - * The output is actually identical. Time / frequence distinction is not meaningful - * for Polynomial multiplication in fields. - * Which means if protocol supports/needs brp output/inputs, then we can skip this step. - * - * Cyclic NTT: Rq = Zq[x]/(x^n-1). butterfly_DIT+loop_DIT OR butterfly_DIF+loop_DIT, roots are omega - * Negacyclic NTT: Rq = Zq[x]/(x^n+1). butterfly_DIT+loop_DIF, at least for mlkem / mldsa - */ -export declare const FFTCore: (F: FFTOpts, coreOpts: FFTCoreOpts) => FFTCoreLoop; -export type FFTMethods = { - direct

>(values: P, brpInput?: boolean, brpOutput?: boolean): P; - inverse

>(values: P, brpInput?: boolean, brpOutput?: boolean): P; -}; -/** - * NTT aka FFT over finite field (NOT over complex numbers). - * Naming mirrors other libraries. - */ -export declare function FFT(roots: RootsOfUnity, opts: FFTOpts): FFTMethods; -export type CreatePolyFn

, T> = (len: number, elm?: T) => P; -export type PolyFn

, T> = { - roots: RootsOfUnity; - create: CreatePolyFn; - length?: number; - degree: (a: P) => number; - extend: (a: P, len: number) => P; - add: (a: P, b: P) => P; - sub: (a: P, b: P) => P; - mul: (a: P, b: P | T) => P; - dot: (a: P, b: P) => P; - convolve: (a: P, b: P) => P; - shift: (p: P, factor: bigint) => P; - clone: (a: P) => P; - eval: (a: P, basis: P) => T; - monomial: { - basis: (x: T, n: number) => P; - eval: (a: P, x: T) => T; - }; - lagrange: { - basis: (x: T, n: number, brp?: boolean) => P; - eval: (a: P, x: T, brp?: boolean) => T; - }; - vanishing: (roots: P) => P; -}; -/** - * Poly wants a cracker. - * - * Polynomials are functions like `y=f(x)`, which means when we multiply two polynomials, result is - * function `f3(x) = f1(x) * f2(x)`, we don't multiply values. Key takeaways: - * - * - **Polynomial** is an array of coefficients: `f(x) = sum(coeff[i] * basis[i](x))` - * - **Basis** is array of functions - * - **Monominal** is Polynomial where `basis[i](x) == x**i` (powers) - * - **Array size** is domain size - * - **Lattice** is matrix (Polynomial of Polynomials) - */ -export declare function poly(field: IField, roots: RootsOfUnity, create?: undefined, fft?: FFTMethods, length?: number): PolyFn; -export declare function poly>(field: IField, roots: RootsOfUnity, create: CreatePolyFn, fft?: FFTMethods, length?: number): PolyFn; -//# sourceMappingURL=fft.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/fft.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/fft.d.ts.map deleted file mode 100644 index c4d82170..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/fft.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fft.d.ts","sourceRoot":"","sources":["../src/abstract/fft.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,CAAC;IACnB,MAAM,EAAE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,CAAC,CAAC,CAAC,EAC7C,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,EAChB,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,EAC1B,GAAG,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,EACnB,MAAM,CAAC,EAAE,MAAM,GACd,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/fft.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/fft.js deleted file mode 100644 index 31cd227c..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/fft.js +++ /dev/null @@ -1,426 +0,0 @@ -function checkU32(n) { - // 0xff_ff_ff_ff - if (!Number.isSafeInteger(n) || n < 0 || n > 0xffffffff) - throw new Error('wrong u32 integer:' + n); - return n; -} -/** Checks if integer is in form of `1 << X` */ -export function isPowerOfTwo(x) { - checkU32(x); - return (x & (x - 1)) === 0 && x !== 0; -} -export function nextPowerOfTwo(n) { - checkU32(n); - if (n <= 1) - return 1; - return (1 << (log2(n - 1) + 1)) >>> 0; -} -export function reverseBits(n, bits) { - checkU32(n); - let reversed = 0; - for (let i = 0; i < bits; i++, n >>>= 1) - reversed = (reversed << 1) | (n & 1); - return reversed; -} -/** Similar to `bitLen(x)-1` but much faster for small integers, like indices */ -export function log2(n) { - checkU32(n); - return 31 - Math.clz32(n); -} -/** - * Moves lowest bit to highest position, which at first step splits - * array on even and odd indices, then it applied again to each part, - * which is core of fft - */ -export function bitReversalInplace(values) { - const n = values.length; - if (n < 2 || !isPowerOfTwo(n)) - throw new Error('n must be a power of 2 and greater than 1. Got ' + n); - const bits = log2(n); - for (let i = 0; i < n; i++) { - const j = reverseBits(i, bits); - if (i < j) { - const tmp = values[i]; - values[i] = values[j]; - values[j] = tmp; - } - } - return values; -} -export function bitReversalPermutation(values) { - return bitReversalInplace(values.slice()); -} -const _1n = /** @__PURE__ */ BigInt(1); -function findGenerator(field) { - let G = BigInt(2); - for (; field.eql(field.pow(G, field.ORDER >> _1n), field.ONE); G++) - ; - return G; -} -/** We limit roots up to 2**31, which is a lot: 2-billion polynomimal should be rare. */ -export function rootsOfUnity(field, generator) { - // Factor field.ORDER-1 as oddFactor * 2^powerOfTwo - let oddFactor = field.ORDER - _1n; - let powerOfTwo = 0; - for (; (oddFactor & _1n) !== _1n; powerOfTwo++, oddFactor >>= _1n) - ; - // Find non quadratic residue - let G = generator !== undefined ? BigInt(generator) : findGenerator(field); - // Powers of generator - const omegas = new Array(powerOfTwo + 1); - omegas[powerOfTwo] = field.pow(G, oddFactor); - for (let i = powerOfTwo; i > 0; i--) - omegas[i - 1] = field.sqr(omegas[i]); - // Compute all roots of unity for powers up to maxPower - const rootsCache = []; - const checkBits = (bits) => { - checkU32(bits); - if (bits > 31 || bits > powerOfTwo) - throw new Error('rootsOfUnity: wrong bits ' + bits + ' powerOfTwo=' + powerOfTwo); - return bits; - }; - const precomputeRoots = (maxPower) => { - checkBits(maxPower); - for (let power = maxPower; power >= 0; power--) { - if (rootsCache[power]) - continue; // Skip if we've already computed roots for this power - const rootsAtPower = []; - for (let j = 0, cur = field.ONE; j < 2 ** power; j++, cur = field.mul(cur, omegas[power])) - rootsAtPower.push(cur); - rootsCache[power] = rootsAtPower; - } - return rootsCache[maxPower]; - }; - const brpCache = new Map(); - const inverseCache = new Map(); - // NOTE: we use bits instead of power, because power = 2**bits, - // but power is not neccesary isPowerOfTwo(power)! - return { - info: { G, powerOfTwo, oddFactor }, - roots: (bits) => { - const b = checkBits(bits); - return precomputeRoots(b); - }, - brp(bits) { - const b = checkBits(bits); - if (brpCache.has(b)) - return brpCache.get(b); - else { - const res = bitReversalPermutation(this.roots(b)); - brpCache.set(b, res); - return res; - } - }, - inverse(bits) { - const b = checkBits(bits); - if (inverseCache.has(b)) - return inverseCache.get(b); - else { - const res = field.invertBatch(this.roots(b)); - inverseCache.set(b, res); - return res; - } - }, - omega: (bits) => omegas[checkBits(bits)], - clear: () => { - rootsCache.splice(0, rootsCache.length); - brpCache.clear(); - }, - }; -} -/** - * Constructs different flavors of FFT. radix2 implementation of low level mutating API. Flavors: - * - * - DIT (Decimation-in-Time): Bottom-Up (leaves -> root), Cool-Turkey - * - DIF (Decimation-in-Frequency): Top-Down (root -> leaves), Gentleman–Sande - * - * DIT takes brp input, returns natural output. - * DIF takes natural input, returns brp output. - * - * The output is actually identical. Time / frequence distinction is not meaningful - * for Polynomial multiplication in fields. - * Which means if protocol supports/needs brp output/inputs, then we can skip this step. - * - * Cyclic NTT: Rq = Zq[x]/(x^n-1). butterfly_DIT+loop_DIT OR butterfly_DIF+loop_DIT, roots are omega - * Negacyclic NTT: Rq = Zq[x]/(x^n+1). butterfly_DIT+loop_DIF, at least for mlkem / mldsa - */ -export const FFTCore = (F, coreOpts) => { - const { N, roots, dit, invertButterflies = false, skipStages = 0, brp = true } = coreOpts; - const bits = log2(N); - if (!isPowerOfTwo(N)) - throw new Error('FFT: Polynomial size should be power of two'); - const isDit = dit !== invertButterflies; - isDit; - return (values) => { - if (values.length !== N) - throw new Error('FFT: wrong Polynomial length'); - if (dit && brp) - bitReversalInplace(values); - for (let i = 0, g = 1; i < bits - skipStages; i++) { - // For each stage s (sub-FFT length m = 2^s) - const s = dit ? i + 1 + skipStages : bits - i; - const m = 1 << s; - const m2 = m >> 1; - const stride = N >> s; - // Loop over each subarray of length m - for (let k = 0; k < N; k += m) { - // Loop over each butterfly within the subarray - for (let j = 0, grp = g++; j < m2; j++) { - const rootPos = invertButterflies ? (dit ? N - grp : grp) : j * stride; - const i0 = k + j; - const i1 = k + j + m2; - const omega = roots[rootPos]; - const b = values[i1]; - const a = values[i0]; - // Inlining gives us 10% perf in kyber vs functions - if (isDit) { - const t = F.mul(b, omega); // Standard DIT butterfly - values[i0] = F.add(a, t); - values[i1] = F.sub(a, t); - } - else if (invertButterflies) { - values[i0] = F.add(b, a); // DIT loop + inverted butterflies (Kyber decode) - values[i1] = F.mul(F.sub(b, a), omega); - } - else { - values[i0] = F.add(a, b); // Standard DIF butterfly - values[i1] = F.mul(F.sub(a, b), omega); - } - } - } - } - if (!dit && brp) - bitReversalInplace(values); - return values; - }; -}; -/** - * NTT aka FFT over finite field (NOT over complex numbers). - * Naming mirrors other libraries. - */ -export function FFT(roots, opts) { - const getLoop = (N, roots, brpInput = false, brpOutput = false) => { - if (brpInput && brpOutput) { - // we cannot optimize this case, but lets support it anyway - return (values) => FFTCore(opts, { N, roots, dit: false, brp: false })(bitReversalInplace(values)); - } - if (brpInput) - return FFTCore(opts, { N, roots, dit: true, brp: false }); - if (brpOutput) - return FFTCore(opts, { N, roots, dit: false, brp: false }); - return FFTCore(opts, { N, roots, dit: true, brp: true }); // all natural - }; - return { - direct(values, brpInput = false, brpOutput = false) { - const N = values.length; - if (!isPowerOfTwo(N)) - throw new Error('FFT: Polynomial size should be power of two'); - const bits = log2(N); - return getLoop(N, roots.roots(bits), brpInput, brpOutput)(values.slice()); - }, - inverse(values, brpInput = false, brpOutput = false) { - const N = values.length; - const bits = log2(N); - const res = getLoop(N, roots.inverse(bits), brpInput, brpOutput)(values.slice()); - const ivm = opts.inv(BigInt(values.length)); // scale - // we can get brp output if we use dif instead of dit! - for (let i = 0; i < res.length; i++) - res[i] = opts.mul(res[i], ivm); - // Allows to re-use non-inverted roots, but is VERY fragile - // return [res[0]].concat(res.slice(1).reverse()); - // inverse calculated as pow(-1), which transforms into ω^{-kn} (-> reverses indices) - return res; - }, - }; -} -export function poly(field, roots, create, fft, length) { - const F = field; - const _create = create || - ((len, elm) => new Array(len).fill(elm ?? F.ZERO)); - const isPoly = (x) => Array.isArray(x) || ArrayBuffer.isView(x); - const checkLength = (...lst) => { - if (!lst.length) - return 0; - for (const i of lst) - if (!isPoly(i)) - throw new Error('poly: not polynomial: ' + i); - const L = lst[0].length; - for (let i = 1; i < lst.length; i++) - if (lst[i].length !== L) - throw new Error(`poly: mismatched lengths ${L} vs ${lst[i].length}`); - if (length !== undefined && L !== length) - throw new Error(`poly: expected fixed length ${length}, got ${L}`); - return L; - }; - function findOmegaIndex(x, n, brp = false) { - const bits = log2(n); - const omega = brp ? roots.brp(bits) : roots.roots(bits); - for (let i = 0; i < n; i++) - if (F.eql(x, omega[i])) - return i; - return -1; - } - // TODO: mutating versions for mlkem/mldsa - return { - roots, - create: _create, - length, - extend: (a, len) => { - checkLength(a); - const out = _create(len, F.ZERO); - for (let i = 0; i < a.length; i++) - out[i] = a[i]; - return out; - }, - degree: (a) => { - checkLength(a); - for (let i = a.length - 1; i >= 0; i--) - if (!F.is0(a[i])) - return i; - return -1; - }, - add: (a, b) => { - const len = checkLength(a, b); - const out = _create(len); - for (let i = 0; i < len; i++) - out[i] = F.add(a[i], b[i]); - return out; - }, - sub: (a, b) => { - const len = checkLength(a, b); - const out = _create(len); - for (let i = 0; i < len; i++) - out[i] = F.sub(a[i], b[i]); - return out; - }, - dot: (a, b) => { - const len = checkLength(a, b); - const out = _create(len); - for (let i = 0; i < len; i++) - out[i] = F.mul(a[i], b[i]); - return out; - }, - mul: (a, b) => { - if (isPoly(b)) { - const len = checkLength(a, b); - if (fft) { - const A = fft.direct(a, false, true); - const B = fft.direct(b, false, true); - for (let i = 0; i < A.length; i++) - A[i] = F.mul(A[i], B[i]); - return fft.inverse(A, true, false); - } - else { - // NOTE: this is quadratic and mostly for compat tests with FFT - const res = _create(len); - for (let i = 0; i < len; i++) { - for (let j = 0; j < len; j++) { - const k = (i + j) % len; // wrap mod length - res[k] = F.add(res[k], F.mul(a[i], b[j])); - } - } - return res; - } - } - else { - const out = _create(checkLength(a)); - for (let i = 0; i < out.length; i++) - out[i] = F.mul(a[i], b); - return out; - } - }, - convolve(a, b) { - const len = nextPowerOfTwo(a.length + b.length - 1); - return this.mul(this.extend(a, len), this.extend(b, len)); - }, - shift(p, factor) { - const out = _create(checkLength(p)); - out[0] = p[0]; - for (let i = 1, power = F.ONE; i < p.length; i++) { - power = F.mul(power, factor); - out[i] = F.mul(p[i], power); - } - return out; - }, - clone: (a) => { - checkLength(a); - const out = _create(a.length); - for (let i = 0; i < a.length; i++) - out[i] = a[i]; - return out; - }, - eval: (a, basis) => { - checkLength(a); - let acc = F.ZERO; - for (let i = 0; i < a.length; i++) - acc = F.add(acc, F.mul(a[i], basis[i])); - return acc; - }, - monomial: { - basis: (x, n) => { - const out = _create(n); - let pow = F.ONE; - for (let i = 0; i < n; i++) { - out[i] = pow; - pow = F.mul(pow, x); - } - return out; - }, - eval: (a, x) => { - checkLength(a); - // Same as eval(a, monomialBasis(x, a.length)), but it is faster this way - let acc = F.ZERO; - for (let i = a.length - 1; i >= 0; i--) - acc = F.add(F.mul(acc, x), a[i]); - return acc; - }, - }, - lagrange: { - basis: (x, n, brp = false, weights) => { - const bits = log2(n); - const cache = weights || brp ? roots.brp(bits) : roots.roots(bits); // [ω⁰, ω¹, ..., ωⁿ⁻¹] - const out = _create(n); - // Fast Kronecker-δ shortcut - const idx = findOmegaIndex(x, n, brp); - if (idx !== -1) { - out[idx] = F.ONE; - return out; - } - const tm = F.pow(x, BigInt(n)); - const c = F.mul(F.sub(tm, F.ONE), F.inv(BigInt(n))); // c = (xⁿ - 1)/n - const denom = _create(n); - for (let i = 0; i < n; i++) - denom[i] = F.sub(x, cache[i]); - const inv = F.invertBatch(denom); - for (let i = 0; i < n; i++) - out[i] = F.mul(c, F.mul(cache[i], inv[i])); - return out; - }, - eval(a, x, brp = false) { - checkLength(a); - const idx = findOmegaIndex(x, a.length, brp); - if (idx !== -1) - return a[idx]; // fast path - const L = this.basis(x, a.length, brp); // Lᵢ(x) - let acc = F.ZERO; - for (let i = 0; i < a.length; i++) - if (!F.is0(a[i])) - acc = F.add(acc, F.mul(a[i], L[i])); - return acc; - }, - }, - vanishing(roots) { - checkLength(roots); - const out = _create(roots.length + 1, F.ZERO); - out[0] = F.ONE; - for (const r of roots) { - const neg = F.neg(r); - for (let j = out.length - 1; j > 0; j--) - out[j] = F.add(F.mul(out[j], neg), out[j - 1]); - out[0] = F.mul(out[0], neg); - } - return out; - }, - }; -} -//# sourceMappingURL=fft.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/fft.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/fft.js.map deleted file mode 100644 index 97b5a1e5..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/fft.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fft.js","sourceRoot":"","sources":["../src/abstract/fft.ts"],"names":[],"mappings":"AAcA,SAAS,QAAQ,CAAC,CAAS;IACzB,gBAAgB;IAChB,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,UAAU;QACrD,MAAM,IAAI,KAAK,CAAC,oBAAoB,GAAG,CAAC,CAAC,CAAC;IAC5C,OAAO,CAAC,CAAC;AACX,CAAC;AAED,+CAA+C;AAC/C,MAAM,UAAU,YAAY,CAAC,CAAS;IACpC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACZ,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,CAAS;IACtC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACZ,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC;IACrB,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,CAAS,EAAE,IAAY;IACjD,QAAQ,CAAC,CAAC,CAAC,CAAC;IACZ,IAAI,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GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACzF,OAAO,GAAG,CAAC;YACb,CAAC;SACF;QACD,SAAS,CAAC,KAAQ;YAChB,WAAW,CAAC,KAAK,CAAC,CAAC;YACnB,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;YAC9C,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC;YACf,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;gBACtB,MAAM,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBACrB,KAAK,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;oBAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBACxF,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;YAC9B,CAAC;YACD,OAAO,GAAG,CAAC;QACb,CAAC;KACF,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/hash-to-curve.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/hash-to-curve.d.ts deleted file mode 100644 index f55730d7..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/hash-to-curve.d.ts +++ /dev/null @@ -1,90 +0,0 @@ -/** - * hash-to-curve from RFC 9380. - * Hashes arbitrary-length byte strings to a list of one or more elements of a finite field F. - * https://www.rfc-editor.org/rfc/rfc9380 - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import type { CHash } from '../utils.ts'; -import type { AffinePoint, PC_ANY, PC_F, PC_P } from './curve.ts'; -import { type IField } from './modular.ts'; -export type AsciiOrBytes = string | Uint8Array; -/** - * * `DST` is a domain separation tag, defined in section 2.2.5 - * * `p` characteristic of F, where F is a finite field of characteristic p and order q = p^m - * * `m` is extension degree (1 for prime fields) - * * `k` is the target security target in bits (e.g. 128), from section 5.1 - * * `expand` is `xmd` (SHA2, SHA3, BLAKE) or `xof` (SHAKE, BLAKE-XOF) - * * `hash` conforming to `utils.CHash` interface, with `outputLen` / `blockLen` props - */ -export type H2COpts = { - DST: AsciiOrBytes; - expand: 'xmd' | 'xof'; - hash: CHash; - p: bigint; - m: number; - k: number; -}; -export type H2CHashOpts = { - expand: 'xmd' | 'xof'; - hash: CHash; -}; -export type MapToCurve = (scalar: bigint[]) => AffinePoint; -export type H2CDSTOpts = { - DST: AsciiOrBytes; -}; -export type H2CHasherBase = { - hashToCurve(msg: Uint8Array, options?: H2CDSTOpts): PC_P; - hashToScalar(msg: Uint8Array, options?: H2CDSTOpts): bigint; - deriveToCurve?(msg: Uint8Array, options?: H2CDSTOpts): PC_P; - Point: PC; -}; -/** - * RFC 9380 methods, with cofactor clearing. See https://www.rfc-editor.org/rfc/rfc9380#section-3. - * - * * hashToCurve: `map(hash(input))`, encodes RANDOM bytes to curve (WITH hashing) - * * encodeToCurve: `map(hash(input))`, encodes NON-UNIFORM bytes to curve (WITH hashing) - * * mapToCurve: `map(scalars)`, encodes NON-UNIFORM scalars to curve (NO hashing) - */ -export type H2CHasher = H2CHasherBase & { - encodeToCurve(msg: Uint8Array, options?: H2CDSTOpts): PC_P; - mapToCurve: MapToCurve>; - defaults: H2COpts & { - encodeDST?: AsciiOrBytes; - }; -}; -/** - * Produces a uniformly random byte string using a cryptographic hash function H that outputs b bits. - * [RFC 9380 5.3.1](https://www.rfc-editor.org/rfc/rfc9380#section-5.3.1). - */ -export declare function expand_message_xmd(msg: Uint8Array, DST: AsciiOrBytes, lenInBytes: number, H: CHash): Uint8Array; -/** - * Produces a uniformly random byte string using an extendable-output function (XOF) H. - * 1. The collision resistance of H MUST be at least k bits. - * 2. H MUST be an XOF that has been proved indifferentiable from - * a random oracle under a reasonable cryptographic assumption. - * [RFC 9380 5.3.2](https://www.rfc-editor.org/rfc/rfc9380#section-5.3.2). - */ -export declare function expand_message_xof(msg: Uint8Array, DST: AsciiOrBytes, lenInBytes: number, k: number, H: CHash): Uint8Array; -/** - * Hashes arbitrary-length byte strings to a list of one or more elements of a finite field F. - * [RFC 9380 5.2](https://www.rfc-editor.org/rfc/rfc9380#section-5.2). - * @param msg a byte string containing the message to hash - * @param count the number of elements of F to output - * @param options `{DST: string, p: bigint, m: number, k: number, expand: 'xmd' | 'xof', hash: H}`, see above - * @returns [u_0, ..., u_(count - 1)], a list of field elements. - */ -export declare function hash_to_field(msg: Uint8Array, count: number, options: H2COpts): bigint[][]; -type XY = (x: T, y: T) => { - x: T; - y: T; -}; -type XYRatio = [T[], T[], T[], T[]]; -export declare function isogenyMap>(field: F, map: XYRatio): XY; -export declare const _DST_scalar: Uint8Array; -/** Creates hash-to-curve methods from EC Point and mapToCurve function. See {@link H2CHasher}. */ -export declare function createHasher(Point: PC, mapToCurve: MapToCurve>, defaults: H2COpts & { - encodeDST?: AsciiOrBytes; -}): H2CHasher; -export {}; -//# sourceMappingURL=hash-to-curve.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/hash-to-curve.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/hash-to-curve.d.ts.map deleted file mode 100644 index fa2504a6..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/hash-to-curve.d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,UAAU,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAgBnF;AAED,eAAO,MAAM,WAAW,EAAE,UAA0C,CAAC;AAErE,kGAAkG;AAClG,wBAAgB,YAAY,CAAC,EAAE,SAAS,MAAM,EAC5C,KAAK,EAAE,EAAE,EACT,UAAU,EAAE,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,EAChC,QAAQ,EAAE,OAAO,GAAG;IAAE,SAAS,CAAC,EAAE,YAAY,CAAA;CAAE,GAC/C,SAAS,CAAC,EAAE,CAAC,CAoDf"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/hash-to-curve.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/hash-to-curve.js deleted file mode 100644 index 23d2a66a..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/hash-to-curve.js +++ /dev/null @@ -1,207 +0,0 @@ -import { abytes, asafenumber, asciiToBytes, bytesToNumberBE, concatBytes, isBytes, validateObject, } from "../utils.js"; -import { FpInvertBatch, mod } from "./modular.js"; -// Octet Stream to Integer. "spec" implementation of os2ip is 2.5x slower vs bytesToNumberBE. -const os2ip = bytesToNumberBE; -// Integer to Octet Stream (numberToBytesBE) -function i2osp(value, length) { - asafenumber(value); - asafenumber(length); - if (value < 0 || value >= 1 << (8 * length)) - throw new Error('invalid I2OSP input: ' + value); - const res = Array.from({ length }).fill(0); - for (let i = length - 1; i >= 0; i--) { - res[i] = value & 0xff; - value >>>= 8; - } - return new Uint8Array(res); -} -function strxor(a, b) { - const arr = new Uint8Array(a.length); - for (let i = 0; i < a.length; i++) { - arr[i] = a[i] ^ b[i]; - } - return arr; -} -// User can always use utf8 if they want, by passing Uint8Array. -// If string is passed, we treat it as ASCII: other formats are likely a mistake. -function normDST(DST) { - if (!isBytes(DST) && typeof DST !== 'string') - throw new Error('DST must be Uint8Array or ascii string'); - return typeof DST === 'string' ? asciiToBytes(DST) : DST; -} -/** - * Produces a uniformly random byte string using a cryptographic hash function H that outputs b bits. - * [RFC 9380 5.3.1](https://www.rfc-editor.org/rfc/rfc9380#section-5.3.1). - */ -export function expand_message_xmd(msg, DST, lenInBytes, H) { - abytes(msg); - asafenumber(lenInBytes); - DST = normDST(DST); - // https://www.rfc-editor.org/rfc/rfc9380#section-5.3.3 - if (DST.length > 255) - DST = H(concatBytes(asciiToBytes('H2C-OVERSIZE-DST-'), DST)); - const { outputLen: b_in_bytes, blockLen: r_in_bytes } = H; - const ell = Math.ceil(lenInBytes / b_in_bytes); - if (lenInBytes > 65535 || ell > 255) - throw new Error('expand_message_xmd: invalid lenInBytes'); - const DST_prime = concatBytes(DST, i2osp(DST.length, 1)); - const Z_pad = i2osp(0, r_in_bytes); - const l_i_b_str = i2osp(lenInBytes, 2); // len_in_bytes_str - const b = new Array(ell); - const b_0 = H(concatBytes(Z_pad, msg, l_i_b_str, i2osp(0, 1), DST_prime)); - b[0] = H(concatBytes(b_0, i2osp(1, 1), DST_prime)); - for (let i = 1; i <= ell; i++) { - const args = [strxor(b_0, b[i - 1]), i2osp(i + 1, 1), DST_prime]; - b[i] = H(concatBytes(...args)); - } - const pseudo_random_bytes = concatBytes(...b); - return pseudo_random_bytes.slice(0, lenInBytes); -} -/** - * Produces a uniformly random byte string using an extendable-output function (XOF) H. - * 1. The collision resistance of H MUST be at least k bits. - * 2. H MUST be an XOF that has been proved indifferentiable from - * a random oracle under a reasonable cryptographic assumption. - * [RFC 9380 5.3.2](https://www.rfc-editor.org/rfc/rfc9380#section-5.3.2). - */ -export function expand_message_xof(msg, DST, lenInBytes, k, H) { - abytes(msg); - asafenumber(lenInBytes); - DST = normDST(DST); - // https://www.rfc-editor.org/rfc/rfc9380#section-5.3.3 - // DST = H('H2C-OVERSIZE-DST-' || a_very_long_DST, Math.ceil((lenInBytes * k) / 8)); - if (DST.length > 255) { - const dkLen = Math.ceil((2 * k) / 8); - DST = H.create({ dkLen }).update(asciiToBytes('H2C-OVERSIZE-DST-')).update(DST).digest(); - } - if (lenInBytes > 65535 || DST.length > 255) - throw new Error('expand_message_xof: invalid lenInBytes'); - return (H.create({ dkLen: lenInBytes }) - .update(msg) - .update(i2osp(lenInBytes, 2)) - // 2. DST_prime = DST || I2OSP(len(DST), 1) - .update(DST) - .update(i2osp(DST.length, 1)) - .digest()); -} -/** - * Hashes arbitrary-length byte strings to a list of one or more elements of a finite field F. - * [RFC 9380 5.2](https://www.rfc-editor.org/rfc/rfc9380#section-5.2). - * @param msg a byte string containing the message to hash - * @param count the number of elements of F to output - * @param options `{DST: string, p: bigint, m: number, k: number, expand: 'xmd' | 'xof', hash: H}`, see above - * @returns [u_0, ..., u_(count - 1)], a list of field elements. - */ -export function hash_to_field(msg, count, options) { - validateObject(options, { - p: 'bigint', - m: 'number', - k: 'number', - hash: 'function', - }); - const { p, k, m, hash, expand, DST } = options; - asafenumber(hash.outputLen, 'valid hash'); - abytes(msg); - asafenumber(count); - const log2p = p.toString(2).length; - const L = Math.ceil((log2p + k) / 8); // section 5.1 of ietf draft link above - const len_in_bytes = count * m * L; - let prb; // pseudo_random_bytes - if (expand === 'xmd') { - prb = expand_message_xmd(msg, DST, len_in_bytes, hash); - } - else if (expand === 'xof') { - prb = expand_message_xof(msg, DST, len_in_bytes, k, hash); - } - else if (expand === '_internal_pass') { - // for internal tests only - prb = msg; - } - else { - throw new Error('expand must be "xmd" or "xof"'); - } - const u = new Array(count); - for (let i = 0; i < count; i++) { - const e = new Array(m); - for (let j = 0; j < m; j++) { - const elm_offset = L * (j + i * m); - const tv = prb.subarray(elm_offset, elm_offset + L); - e[j] = mod(os2ip(tv), p); - } - u[i] = e; - } - return u; -} -export function isogenyMap(field, map) { - // Make same order as in spec - const coeff = map.map((i) => Array.from(i).reverse()); - return (x, y) => { - const [xn, xd, yn, yd] = coeff.map((val) => val.reduce((acc, i) => field.add(field.mul(acc, x), i))); - // 6.6.3 - // Exceptional cases of iso_map are inputs that cause the denominator of - // either rational function to evaluate to zero; such cases MUST return - // the identity point on E. - const [xd_inv, yd_inv] = FpInvertBatch(field, [xd, yd], true); - x = field.mul(xn, xd_inv); // xNum / xDen - y = field.mul(y, field.mul(yn, yd_inv)); // y * (yNum / yDev) - return { x, y }; - }; -} -export const _DST_scalar = asciiToBytes('HashToScalar-'); -/** Creates hash-to-curve methods from EC Point and mapToCurve function. See {@link H2CHasher}. */ -export function createHasher(Point, mapToCurve, defaults) { - if (typeof mapToCurve !== 'function') - throw new Error('mapToCurve() must be defined'); - function map(num) { - return Point.fromAffine(mapToCurve(num)); - } - function clear(initial) { - const P = initial.clearCofactor(); - if (P.equals(Point.ZERO)) - return Point.ZERO; // zero will throw in assert - P.assertValidity(); - return P; - } - return { - defaults: Object.freeze(defaults), - Point, - hashToCurve(msg, options) { - const opts = Object.assign({}, defaults, options); - const u = hash_to_field(msg, 2, opts); - const u0 = map(u[0]); - const u1 = map(u[1]); - return clear(u0.add(u1)); - }, - encodeToCurve(msg, options) { - const optsDst = defaults.encodeDST ? { DST: defaults.encodeDST } : {}; - const opts = Object.assign({}, defaults, optsDst, options); - const u = hash_to_field(msg, 1, opts); - const u0 = map(u[0]); - return clear(u0); - }, - /** See {@link H2CHasher} */ - mapToCurve(scalars) { - // Curves with m=1 accept only single scalar - if (defaults.m === 1) { - if (typeof scalars !== 'bigint') - throw new Error('expected bigint (m=1)'); - return clear(map([scalars])); - } - if (!Array.isArray(scalars)) - throw new Error('expected array of bigints'); - for (const i of scalars) - if (typeof i !== 'bigint') - throw new Error('expected array of bigints'); - return clear(map(scalars)); - }, - // hash_to_scalar can produce 0: https://www.rfc-editor.org/errata/eid8393 - // RFC 9380, draft-irtf-cfrg-bbs-signatures-08 - hashToScalar(msg, options) { - // @ts-ignore - const N = Point.Fn.ORDER; - const opts = Object.assign({}, defaults, { p: N, m: 1, DST: _DST_scalar }, options); - return hash_to_field(msg, 1, opts)[0][0]; - }, - }; -} -//# sourceMappingURL=hash-to-curve.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/hash-to-curve.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/hash-to-curve.js.map deleted file mode 100644 index c3d49943..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/hash-to-curve.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hash-to-curve.js","sourceRoot":"","sources":["../src/abstract/hash-to-curve.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,MAAM,EACN,WAAW,EACX,YAAY,EACZ,eAAe,EACf,WAAW,EACX,OAAO,EACP,cAAc,GACf,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,aAAa,EAAE,GAAG,EAAe,MAAM,cAAc,CAAC;AAgD/D,6FAA6F;AAC7F,MAAM,KAAK,GAAG,eAAe,CAAC;AAE9B,4CAA4C;AAC5C,SAAS,KAAK,CAAC,KAAa,EAAE,MAAc;IAC1C,WAAW,CAAC,KAAK,CAAC,CAAC;IACnB,WAAW,CAAC,MAAM,CAAC,CAAC;IACpB,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,GAAG,KAAK,CAAC,CAAC;IAC9F,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAa,CAAC;IACvD,KAAK,IAAI,CAAC,GAAG,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC;QACtB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,CAAC;YAC1E,OAAO,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;QAC7B,CAAC;QAED,0EAA0E;QAC1E,8CAA8C;QAC9C,YAAY,CAAC,GAAe,EAAE,OAAoB;YAChD,aAAa;YACb,MAAM,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC;YACzB,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,WAAW,EAAE,EAAE,OAAO,CAAC,CAAC;YACpF,OAAO,aAAa,CAAC,GAAG,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3C,CAAC;KACF,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/modular.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/modular.d.ts deleted file mode 100644 index 8f7cfd10..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/modular.d.ts +++ /dev/null @@ -1,159 +0,0 @@ -export declare function mod(a: bigint, b: bigint): bigint; -/** - * Efficiently raise num to power and do modular division. - * Unsafe in some contexts: uses ladder, so can expose bigint bits. - * @example - * pow(2n, 6n, 11n) // 64n % 11n == 9n - */ -export declare function pow(num: bigint, power: bigint, modulo: bigint): bigint; -/** Does `x^(2^power)` mod p. `pow2(30, 4)` == `30^(2^4)` */ -export declare function pow2(x: bigint, power: bigint, modulo: bigint): bigint; -/** - * Inverses number over modulo. - * Implemented using [Euclidean GCD](https://brilliant.org/wiki/extended-euclidean-algorithm/). - */ -export declare function invert(number: bigint, modulo: bigint): bigint; -/** - * Tonelli-Shanks square root search algorithm. - * 1. https://eprint.iacr.org/2012/685.pdf (page 12) - * 2. Square Roots from 1; 24, 51, 10 to Dan Shanks - * @param P field order - * @returns function that takes field Fp (created from P) and number n - */ -export declare function tonelliShanks(P: bigint): (Fp: IField, n: T) => T; -/** - * Square root for a finite field. Will try optimized versions first: - * - * 1. P ≡ 3 (mod 4) - * 2. P ≡ 5 (mod 8) - * 3. P ≡ 9 (mod 16) - * 4. Tonelli-Shanks algorithm - * - * Different algorithms can give different roots, it is up to user to decide which one they want. - * For example there is FpSqrtOdd/FpSqrtEven to choice root based on oddness (used for hash-to-curve). - */ -export declare function FpSqrt(P: bigint): (Fp: IField, n: T) => T; -export declare const isNegativeLE: (num: bigint, modulo: bigint) => boolean; -/** Field is not always over prime: for example, Fp2 has ORDER(q)=p^m. */ -export interface IField { - ORDER: bigint; - BYTES: number; - BITS: number; - isLE: boolean; - ZERO: T; - ONE: T; - create: (num: T) => T; - isValid: (num: T) => boolean; - is0: (num: T) => boolean; - isValidNot0: (num: T) => boolean; - neg(num: T): T; - inv(num: T): T; - sqrt(num: T): T; - sqr(num: T): T; - eql(lhs: T, rhs: T): boolean; - add(lhs: T, rhs: T): T; - sub(lhs: T, rhs: T): T; - mul(lhs: T, rhs: T | bigint): T; - pow(lhs: T, power: bigint): T; - div(lhs: T, rhs: T | bigint): T; - addN(lhs: T, rhs: T): T; - subN(lhs: T, rhs: T): T; - mulN(lhs: T, rhs: T | bigint): T; - sqrN(num: T): T; - isOdd?(num: T): boolean; - invertBatch: (lst: T[]) => T[]; - toBytes(num: T): Uint8Array; - fromBytes(bytes: Uint8Array, skipValidation?: boolean): T; - cmov(a: T, b: T, c: boolean): T; -} -export declare function validateField(field: IField): IField; -/** - * Same as `pow` but for Fp: non-constant-time. - * Unsafe in some contexts: uses ladder, so can expose bigint bits. - */ -export declare function FpPow(Fp: IField, num: T, power: bigint): T; -/** - * Efficiently invert an array of Field elements. - * Exception-free. Will return `undefined` for 0 elements. - * @param passZero map 0 to 0 (instead of undefined) - */ -export declare function FpInvertBatch(Fp: IField, nums: T[], passZero?: boolean): T[]; -export declare function FpDiv(Fp: IField, lhs: T, rhs: T | bigint): T; -/** - * Legendre symbol. - * Legendre constant is used to calculate Legendre symbol (a | p) - * which denotes the value of a^((p-1)/2) (mod p). - * - * * (a | p) ≡ 1 if a is a square (mod p), quadratic residue - * * (a | p) ≡ -1 if a is not a square (mod p), quadratic non residue - * * (a | p) ≡ 0 if a ≡ 0 (mod p) - */ -export declare function FpLegendre(Fp: IField, n: T): -1 | 0 | 1; -export declare function FpIsSquare(Fp: IField, n: T): boolean; -export type NLength = { - nByteLength: number; - nBitLength: number; -}; -export declare function nLength(n: bigint, nBitLength?: number): NLength; -type FpField = IField & Required, 'isOdd'>>; -type SqrtFn = (n: bigint) => bigint; -type FieldOpts = Partial<{ - isLE: boolean; - BITS: number; - sqrt: SqrtFn; - allowedLengths?: readonly number[]; - modFromBytes: boolean; -}>; -/** - * Creates a finite field. Major performance optimizations: - * * 1. Denormalized operations like mulN instead of mul. - * * 2. Identical object shape: never add or remove keys. - * * 3. `Object.freeze`. - * Fragile: always run a benchmark on a change. - * Security note: operations don't check 'isValid' for all elements for performance reasons, - * it is caller responsibility to check this. - * This is low-level code, please make sure you know what you're doing. - * - * Note about field properties: - * * CHARACTERISTIC p = prime number, number of elements in main subgroup. - * * ORDER q = similar to cofactor in curves, may be composite `q = p^m`. - * - * @param ORDER field order, probably prime, or could be composite - * @param bitLen how many bits the field consumes - * @param isLE (default: false) if encoding / decoding should be in little-endian - * @param redef optional faster redefinitions of sqrt and other methods - */ -export declare function Field(ORDER: bigint, opts?: FieldOpts): Readonly; -export declare function FpSqrtOdd(Fp: IField, elm: T): T; -export declare function FpSqrtEven(Fp: IField, elm: T): T; -/** - * Returns total number of bytes consumed by the field element. - * For example, 32 bytes for usual 256-bit weierstrass curve. - * @param fieldOrder number of field elements, usually CURVE.n - * @returns byte length of field - */ -export declare function getFieldBytesLength(fieldOrder: bigint): number; -/** - * Returns minimal amount of bytes that can be safely reduced - * by field order. - * Should be 2^-128 for 128-bit curve such as P256. - * @param fieldOrder number of field elements, usually CURVE.n - * @returns byte length of target hash - */ -export declare function getMinHashLength(fieldOrder: bigint): number; -/** - * "Constant-time" private key generation utility. - * Can take (n + n/2) or more bytes of uniform input e.g. from CSPRNG or KDF - * and convert them into private scalar, with the modulo bias being negligible. - * Needs at least 48 bytes of input for 32-byte private key. - * https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/ - * FIPS 186-5, A.2 https://csrc.nist.gov/publications/detail/fips/186/5/final - * RFC 9380, https://www.rfc-editor.org/rfc/rfc9380#section-5 - * @param hash hash output from SHA3 or a similar function - * @param groupOrder size of subgroup - (e.g. secp256k1.Point.Fn.ORDER) - * @param isLE interpret hash bytes as LE num - * @returns valid private scalar - */ -export declare function mapHashToField(key: Uint8Array, fieldOrder: bigint, isLE?: boolean): Uint8Array; -export {}; -//# sourceMappingURL=modular.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/modular.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/modular.d.ts.map deleted file mode 100644 index 1b7a4cbd..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/modular.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"modular.d.ts","sourceRoot":"","sources":["../src/abstract/modular.ts"],"names":[],"mappings":"AA2BA,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAGhD;AACD;;;;;GAKG;AACH,wBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED,4DAA4D;AAC5D,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAOrE;AA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O,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC,CAAC;AAwIH;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,GAAE,SAAc,GAAG,QAAQ,CAAC,OAAO,CAAC,CAE5E;AAgBD,wBAAgB,SAAS,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAIrD;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAItD;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAI9D;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAG3D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,UAAQ,GAAG,UAAU,CAY5F"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/modular.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/modular.js deleted file mode 100644 index 05a0d5d1..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/modular.js +++ /dev/null @@ -1,555 +0,0 @@ -/** - * Utils for modular division and fields. - * Field over 11 is a finite (Galois) field is integer number operations `mod 11`. - * There is no division: it is replaced by modular multiplicative inverse. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { abytes, anumber, bytesToNumberBE, bytesToNumberLE, numberToBytesBE, numberToBytesLE, validateObject, } from "../utils.js"; -// Numbers aren't used in x25519 / x448 builds -// prettier-ignore -const _0n = /* @__PURE__ */ BigInt(0), _1n = /* @__PURE__ */ BigInt(1), _2n = /* @__PURE__ */ BigInt(2); -// prettier-ignore -const _3n = /* @__PURE__ */ BigInt(3), _4n = /* @__PURE__ */ BigInt(4), _5n = /* @__PURE__ */ BigInt(5); -// prettier-ignore -const _7n = /* @__PURE__ */ BigInt(7), _8n = /* @__PURE__ */ BigInt(8), _9n = /* @__PURE__ */ BigInt(9); -const _16n = /* @__PURE__ */ BigInt(16); -// Calculates a modulo b -export function mod(a, b) { - const result = a % b; - return result >= _0n ? result : b + result; -} -/** - * Efficiently raise num to power and do modular division. - * Unsafe in some contexts: uses ladder, so can expose bigint bits. - * @example - * pow(2n, 6n, 11n) // 64n % 11n == 9n - */ -export function pow(num, power, modulo) { - return FpPow(Field(modulo), num, power); -} -/** Does `x^(2^power)` mod p. `pow2(30, 4)` == `30^(2^4)` */ -export function pow2(x, power, modulo) { - let res = x; - while (power-- > _0n) { - res *= res; - res %= modulo; - } - return res; -} -/** - * Inverses number over modulo. - * Implemented using [Euclidean GCD](https://brilliant.org/wiki/extended-euclidean-algorithm/). - */ -export function invert(number, modulo) { - if (number === _0n) - throw new Error('invert: expected non-zero number'); - if (modulo <= _0n) - throw new Error('invert: expected positive modulus, got ' + modulo); - // Fermat's little theorem "CT-like" version inv(n) = n^(m-2) mod m is 30x slower. - let a = mod(number, modulo); - let b = modulo; - // prettier-ignore - let x = _0n, y = _1n, u = _1n, v = _0n; - while (a !== _0n) { - // JIT applies optimization if those two lines follow each other - const q = b / a; - const r = b % a; - const m = x - u * q; - const n = y - v * q; - // prettier-ignore - b = a, a = r, x = u, y = v, u = m, v = n; - } - const gcd = b; - if (gcd !== _1n) - throw new Error('invert: does not exist'); - return mod(x, modulo); -} -function assertIsSquare(Fp, root, n) { - if (!Fp.eql(Fp.sqr(root), n)) - throw new Error('Cannot find square root'); -} -// Not all roots are possible! Example which will throw: -// const NUM = -// n = 72057594037927816n; -// Fp = Field(BigInt('0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab')); -function sqrt3mod4(Fp, n) { - const p1div4 = (Fp.ORDER + _1n) / _4n; - const root = Fp.pow(n, p1div4); - assertIsSquare(Fp, root, n); - return root; -} -function sqrt5mod8(Fp, n) { - const p5div8 = (Fp.ORDER - _5n) / _8n; - const n2 = Fp.mul(n, _2n); - const v = Fp.pow(n2, p5div8); - const nv = Fp.mul(n, v); - const i = Fp.mul(Fp.mul(nv, _2n), v); - const root = Fp.mul(nv, Fp.sub(i, Fp.ONE)); - assertIsSquare(Fp, root, n); - return root; -} -// Based on RFC9380, Kong algorithm -// prettier-ignore -function sqrt9mod16(P) { - const Fp_ = Field(P); - const tn = tonelliShanks(P); - const c1 = tn(Fp_, Fp_.neg(Fp_.ONE)); // 1. c1 = sqrt(-1) in F, i.e., (c1^2) == -1 in F - const c2 = tn(Fp_, c1); // 2. c2 = sqrt(c1) in F, i.e., (c2^2) == c1 in F - const c3 = tn(Fp_, Fp_.neg(c1)); // 3. c3 = sqrt(-c1) in F, i.e., (c3^2) == -c1 in F - const c4 = (P + _7n) / _16n; // 4. c4 = (q + 7) / 16 # Integer arithmetic - return (Fp, n) => { - let tv1 = Fp.pow(n, c4); // 1. tv1 = x^c4 - let tv2 = Fp.mul(tv1, c1); // 2. tv2 = c1 * tv1 - const tv3 = Fp.mul(tv1, c2); // 3. tv3 = c2 * tv1 - const tv4 = Fp.mul(tv1, c3); // 4. tv4 = c3 * tv1 - const e1 = Fp.eql(Fp.sqr(tv2), n); // 5. e1 = (tv2^2) == x - const e2 = Fp.eql(Fp.sqr(tv3), n); // 6. e2 = (tv3^2) == x - tv1 = Fp.cmov(tv1, tv2, e1); // 7. tv1 = CMOV(tv1, tv2, e1) # Select tv2 if (tv2^2) == x - tv2 = Fp.cmov(tv4, tv3, e2); // 8. tv2 = CMOV(tv4, tv3, e2) # Select tv3 if (tv3^2) == x - const e3 = Fp.eql(Fp.sqr(tv2), n); // 9. e3 = (tv2^2) == x - const root = Fp.cmov(tv1, tv2, e3); // 10. z = CMOV(tv1, tv2, e3) # Select sqrt from tv1 & tv2 - assertIsSquare(Fp, root, n); - return root; - }; -} -/** - * Tonelli-Shanks square root search algorithm. - * 1. https://eprint.iacr.org/2012/685.pdf (page 12) - * 2. Square Roots from 1; 24, 51, 10 to Dan Shanks - * @param P field order - * @returns function that takes field Fp (created from P) and number n - */ -export function tonelliShanks(P) { - // Initialization (precomputation). - // Caching initialization could boost perf by 7%. - if (P < _3n) - throw new Error('sqrt is not defined for small field'); - // Factor P - 1 = Q * 2^S, where Q is odd - let Q = P - _1n; - let S = 0; - while (Q % _2n === _0n) { - Q /= _2n; - S++; - } - // Find the first quadratic non-residue Z >= 2 - let Z = _2n; - const _Fp = Field(P); - while (FpLegendre(_Fp, Z) === 1) { - // Basic primality test for P. After x iterations, chance of - // not finding quadratic non-residue is 2^x, so 2^1000. - if (Z++ > 1000) - throw new Error('Cannot find square root: probably non-prime P'); - } - // Fast-path; usually done before Z, but we do "primality test". - if (S === 1) - return sqrt3mod4; - // Slow-path - // TODO: test on Fp2 and others - let cc = _Fp.pow(Z, Q); // c = z^Q - const Q1div2 = (Q + _1n) / _2n; - return function tonelliSlow(Fp, n) { - if (Fp.is0(n)) - return n; - // Check if n is a quadratic residue using Legendre symbol - if (FpLegendre(Fp, n) !== 1) - throw new Error('Cannot find square root'); - // Initialize variables for the main loop - let M = S; - let c = Fp.mul(Fp.ONE, cc); // c = z^Q, move cc from field _Fp into field Fp - let t = Fp.pow(n, Q); // t = n^Q, first guess at the fudge factor - let R = Fp.pow(n, Q1div2); // R = n^((Q+1)/2), first guess at the square root - // Main loop - // while t != 1 - while (!Fp.eql(t, Fp.ONE)) { - if (Fp.is0(t)) - return Fp.ZERO; // if t=0 return R=0 - let i = 1; - // Find the smallest i >= 1 such that t^(2^i) ≡ 1 (mod P) - let t_tmp = Fp.sqr(t); // t^(2^1) - while (!Fp.eql(t_tmp, Fp.ONE)) { - i++; - t_tmp = Fp.sqr(t_tmp); // t^(2^2)... - if (i === M) - throw new Error('Cannot find square root'); - } - // Calculate the exponent for b: 2^(M - i - 1) - const exponent = _1n << BigInt(M - i - 1); // bigint is important - const b = Fp.pow(c, exponent); // b = 2^(M - i - 1) - // Update variables - M = i; - c = Fp.sqr(b); // c = b^2 - t = Fp.mul(t, c); // t = (t * b^2) - R = Fp.mul(R, b); // R = R*b - } - return R; - }; -} -/** - * Square root for a finite field. Will try optimized versions first: - * - * 1. P ≡ 3 (mod 4) - * 2. P ≡ 5 (mod 8) - * 3. P ≡ 9 (mod 16) - * 4. Tonelli-Shanks algorithm - * - * Different algorithms can give different roots, it is up to user to decide which one they want. - * For example there is FpSqrtOdd/FpSqrtEven to choice root based on oddness (used for hash-to-curve). - */ -export function FpSqrt(P) { - // P ≡ 3 (mod 4) => √n = n^((P+1)/4) - if (P % _4n === _3n) - return sqrt3mod4; - // P ≡ 5 (mod 8) => Atkin algorithm, page 10 of https://eprint.iacr.org/2012/685.pdf - if (P % _8n === _5n) - return sqrt5mod8; - // P ≡ 9 (mod 16) => Kong algorithm, page 11 of https://eprint.iacr.org/2012/685.pdf (algorithm 4) - if (P % _16n === _9n) - return sqrt9mod16(P); - // Tonelli-Shanks algorithm - return tonelliShanks(P); -} -// Little-endian check for first LE bit (last BE bit); -export const isNegativeLE = (num, modulo) => (mod(num, modulo) & _1n) === _1n; -// prettier-ignore -const FIELD_FIELDS = [ - 'create', 'isValid', 'is0', 'neg', 'inv', 'sqrt', 'sqr', - 'eql', 'add', 'sub', 'mul', 'pow', 'div', - 'addN', 'subN', 'mulN', 'sqrN' -]; -export function validateField(field) { - const initial = { - ORDER: 'bigint', - BYTES: 'number', - BITS: 'number', - }; - const opts = FIELD_FIELDS.reduce((map, val) => { - map[val] = 'function'; - return map; - }, initial); - validateObject(field, opts); - // const max = 16384; - // if (field.BYTES < 1 || field.BYTES > max) throw new Error('invalid field'); - // if (field.BITS < 1 || field.BITS > 8 * max) throw new Error('invalid field'); - return field; -} -// Generic field functions -/** - * Same as `pow` but for Fp: non-constant-time. - * Unsafe in some contexts: uses ladder, so can expose bigint bits. - */ -export function FpPow(Fp, num, power) { - if (power < _0n) - throw new Error('invalid exponent, negatives unsupported'); - if (power === _0n) - return Fp.ONE; - if (power === _1n) - return num; - let p = Fp.ONE; - let d = num; - while (power > _0n) { - if (power & _1n) - p = Fp.mul(p, d); - d = Fp.sqr(d); - power >>= _1n; - } - return p; -} -/** - * Efficiently invert an array of Field elements. - * Exception-free. Will return `undefined` for 0 elements. - * @param passZero map 0 to 0 (instead of undefined) - */ -export function FpInvertBatch(Fp, nums, passZero = false) { - const inverted = new Array(nums.length).fill(passZero ? Fp.ZERO : undefined); - // Walk from first to last, multiply them by each other MOD p - const multipliedAcc = nums.reduce((acc, num, i) => { - if (Fp.is0(num)) - return acc; - inverted[i] = acc; - return Fp.mul(acc, num); - }, Fp.ONE); - // Invert last element - const invertedAcc = Fp.inv(multipliedAcc); - // Walk from last to first, multiply them by inverted each other MOD p - nums.reduceRight((acc, num, i) => { - if (Fp.is0(num)) - return acc; - inverted[i] = Fp.mul(acc, inverted[i]); - return Fp.mul(acc, num); - }, invertedAcc); - return inverted; -} -// TODO: remove -export function FpDiv(Fp, lhs, rhs) { - return Fp.mul(lhs, typeof rhs === 'bigint' ? invert(rhs, Fp.ORDER) : Fp.inv(rhs)); -} -/** - * Legendre symbol. - * Legendre constant is used to calculate Legendre symbol (a | p) - * which denotes the value of a^((p-1)/2) (mod p). - * - * * (a | p) ≡ 1 if a is a square (mod p), quadratic residue - * * (a | p) ≡ -1 if a is not a square (mod p), quadratic non residue - * * (a | p) ≡ 0 if a ≡ 0 (mod p) - */ -export function FpLegendre(Fp, n) { - // We can use 3rd argument as optional cache of this value - // but seems unneeded for now. The operation is very fast. - const p1mod2 = (Fp.ORDER - _1n) / _2n; - const powered = Fp.pow(n, p1mod2); - const yes = Fp.eql(powered, Fp.ONE); - const zero = Fp.eql(powered, Fp.ZERO); - const no = Fp.eql(powered, Fp.neg(Fp.ONE)); - if (!yes && !zero && !no) - throw new Error('invalid Legendre symbol result'); - return yes ? 1 : zero ? 0 : -1; -} -// This function returns True whenever the value x is a square in the field F. -export function FpIsSquare(Fp, n) { - const l = FpLegendre(Fp, n); - return l === 1; -} -// CURVE.n lengths -export function nLength(n, nBitLength) { - // Bit size, byte size of CURVE.n - if (nBitLength !== undefined) - anumber(nBitLength); - const _nBitLength = nBitLength !== undefined ? nBitLength : n.toString(2).length; - const nByteLength = Math.ceil(_nBitLength / 8); - return { nBitLength: _nBitLength, nByteLength }; -} -class _Field { - ORDER; - BITS; - BYTES; - isLE; - ZERO = _0n; - ONE = _1n; - _lengths; - _sqrt; // cached sqrt - _mod; - constructor(ORDER, opts = {}) { - if (ORDER <= _0n) - throw new Error('invalid field: expected ORDER > 0, got ' + ORDER); - let _nbitLength = undefined; - this.isLE = false; - if (opts != null && typeof opts === 'object') { - if (typeof opts.BITS === 'number') - _nbitLength = opts.BITS; - if (typeof opts.sqrt === 'function') - this.sqrt = opts.sqrt; - if (typeof opts.isLE === 'boolean') - this.isLE = opts.isLE; - if (opts.allowedLengths) - this._lengths = opts.allowedLengths?.slice(); - if (typeof opts.modFromBytes === 'boolean') - this._mod = opts.modFromBytes; - } - const { nBitLength, nByteLength } = nLength(ORDER, _nbitLength); - if (nByteLength > 2048) - throw new Error('invalid field: expected ORDER of <= 2048 bytes'); - this.ORDER = ORDER; - this.BITS = nBitLength; - this.BYTES = nByteLength; - this._sqrt = undefined; - Object.preventExtensions(this); - } - create(num) { - return mod(num, this.ORDER); - } - isValid(num) { - if (typeof num !== 'bigint') - throw new Error('invalid field element: expected bigint, got ' + typeof num); - return _0n <= num && num < this.ORDER; // 0 is valid element, but it's not invertible - } - is0(num) { - return num === _0n; - } - // is valid and invertible - isValidNot0(num) { - return !this.is0(num) && this.isValid(num); - } - isOdd(num) { - return (num & _1n) === _1n; - } - neg(num) { - return mod(-num, this.ORDER); - } - eql(lhs, rhs) { - return lhs === rhs; - } - sqr(num) { - return mod(num * num, this.ORDER); - } - add(lhs, rhs) { - return mod(lhs + rhs, this.ORDER); - } - sub(lhs, rhs) { - return mod(lhs - rhs, this.ORDER); - } - mul(lhs, rhs) { - return mod(lhs * rhs, this.ORDER); - } - pow(num, power) { - return FpPow(this, num, power); - } - div(lhs, rhs) { - return mod(lhs * invert(rhs, this.ORDER), this.ORDER); - } - // Same as above, but doesn't normalize - sqrN(num) { - return num * num; - } - addN(lhs, rhs) { - return lhs + rhs; - } - subN(lhs, rhs) { - return lhs - rhs; - } - mulN(lhs, rhs) { - return lhs * rhs; - } - inv(num) { - return invert(num, this.ORDER); - } - sqrt(num) { - // Caching _sqrt speeds up sqrt9mod16 by 5x and tonneli-shanks by 10% - if (!this._sqrt) - this._sqrt = FpSqrt(this.ORDER); - return this._sqrt(this, num); - } - toBytes(num) { - return this.isLE ? numberToBytesLE(num, this.BYTES) : numberToBytesBE(num, this.BYTES); - } - fromBytes(bytes, skipValidation = false) { - abytes(bytes); - const { _lengths: allowedLengths, BYTES, isLE, ORDER, _mod: modFromBytes } = this; - if (allowedLengths) { - if (!allowedLengths.includes(bytes.length) || bytes.length > BYTES) { - throw new Error('Field.fromBytes: expected ' + allowedLengths + ' bytes, got ' + bytes.length); - } - const padded = new Uint8Array(BYTES); - // isLE add 0 to right, !isLE to the left. - padded.set(bytes, isLE ? 0 : padded.length - bytes.length); - bytes = padded; - } - if (bytes.length !== BYTES) - throw new Error('Field.fromBytes: expected ' + BYTES + ' bytes, got ' + bytes.length); - let scalar = isLE ? bytesToNumberLE(bytes) : bytesToNumberBE(bytes); - if (modFromBytes) - scalar = mod(scalar, ORDER); - if (!skipValidation) - if (!this.isValid(scalar)) - throw new Error('invalid field element: outside of range 0..ORDER'); - // NOTE: we don't validate scalar here, please use isValid. This done such way because some - // protocol may allow non-reduced scalar that reduced later or changed some other way. - return scalar; - } - // TODO: we don't need it here, move out to separate fn - invertBatch(lst) { - return FpInvertBatch(this, lst); - } - // We can't move this out because Fp6, Fp12 implement it - // and it's unclear what to return in there. - cmov(a, b, condition) { - return condition ? b : a; - } -} -/** - * Creates a finite field. Major performance optimizations: - * * 1. Denormalized operations like mulN instead of mul. - * * 2. Identical object shape: never add or remove keys. - * * 3. `Object.freeze`. - * Fragile: always run a benchmark on a change. - * Security note: operations don't check 'isValid' for all elements for performance reasons, - * it is caller responsibility to check this. - * This is low-level code, please make sure you know what you're doing. - * - * Note about field properties: - * * CHARACTERISTIC p = prime number, number of elements in main subgroup. - * * ORDER q = similar to cofactor in curves, may be composite `q = p^m`. - * - * @param ORDER field order, probably prime, or could be composite - * @param bitLen how many bits the field consumes - * @param isLE (default: false) if encoding / decoding should be in little-endian - * @param redef optional faster redefinitions of sqrt and other methods - */ -export function Field(ORDER, opts = {}) { - return new _Field(ORDER, opts); -} -// Generic random scalar, we can do same for other fields if via Fp2.mul(Fp2.ONE, Fp2.random)? -// This allows unsafe methods like ignore bias or zero. These unsafe, but often used in different protocols (if deterministic RNG). -// which mean we cannot force this via opts. -// Not sure what to do with randomBytes, we can accept it inside opts if wanted. -// Probably need to export getMinHashLength somewhere? -// random(bytes?: Uint8Array, unsafeAllowZero = false, unsafeAllowBias = false) { -// const LEN = !unsafeAllowBias ? getMinHashLength(ORDER) : BYTES; -// if (bytes === undefined) bytes = randomBytes(LEN); // _opts.randomBytes? -// const num = isLE ? bytesToNumberLE(bytes) : bytesToNumberBE(bytes); -// // `mod(x, 11)` can sometimes produce 0. `mod(x, 10) + 1` is the same, but no 0 -// const reduced = unsafeAllowZero ? mod(num, ORDER) : mod(num, ORDER - _1n) + _1n; -// return reduced; -// }, -export function FpSqrtOdd(Fp, elm) { - if (!Fp.isOdd) - throw new Error("Field doesn't have isOdd"); - const root = Fp.sqrt(elm); - return Fp.isOdd(root) ? root : Fp.neg(root); -} -export function FpSqrtEven(Fp, elm) { - if (!Fp.isOdd) - throw new Error("Field doesn't have isOdd"); - const root = Fp.sqrt(elm); - return Fp.isOdd(root) ? Fp.neg(root) : root; -} -/** - * Returns total number of bytes consumed by the field element. - * For example, 32 bytes for usual 256-bit weierstrass curve. - * @param fieldOrder number of field elements, usually CURVE.n - * @returns byte length of field - */ -export function getFieldBytesLength(fieldOrder) { - if (typeof fieldOrder !== 'bigint') - throw new Error('field order must be bigint'); - const bitLength = fieldOrder.toString(2).length; - return Math.ceil(bitLength / 8); -} -/** - * Returns minimal amount of bytes that can be safely reduced - * by field order. - * Should be 2^-128 for 128-bit curve such as P256. - * @param fieldOrder number of field elements, usually CURVE.n - * @returns byte length of target hash - */ -export function getMinHashLength(fieldOrder) { - const length = getFieldBytesLength(fieldOrder); - return length + Math.ceil(length / 2); -} -/** - * "Constant-time" private key generation utility. - * Can take (n + n/2) or more bytes of uniform input e.g. from CSPRNG or KDF - * and convert them into private scalar, with the modulo bias being negligible. - * Needs at least 48 bytes of input for 32-byte private key. - * https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/ - * FIPS 186-5, A.2 https://csrc.nist.gov/publications/detail/fips/186/5/final - * RFC 9380, https://www.rfc-editor.org/rfc/rfc9380#section-5 - * @param hash hash output from SHA3 or a similar function - * @param groupOrder size of subgroup - (e.g. secp256k1.Point.Fn.ORDER) - * @param isLE interpret hash bytes as LE num - * @returns valid private scalar - */ -export function mapHashToField(key, fieldOrder, isLE = false) { - abytes(key); - const len = key.length; - const fieldLen = getFieldBytesLength(fieldOrder); - const minLen = getMinHashLength(fieldOrder); - // No small numbers: need to understand bias story. No huge numbers: easier to detect JS timings. - if (len < 16 || len < minLen || len > 1024) - throw new Error('expected ' + minLen + '-1024 bytes of input, got ' + len); - const num = isLE ? bytesToNumberLE(key) : bytesToNumberBE(key); - // `mod(x, 11)` can sometimes produce 0. `mod(x, 10) + 1` is the same, but no 0 - const reduced = mod(num, fieldOrder - _1n) + _1n; - return isLE ? numberToBytesLE(reduced, fieldLen) : numberToBytesBE(reduced, fieldLen); -} -//# sourceMappingURL=modular.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/modular.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/modular.js.map deleted file mode 100644 index e17f07cf..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/modular.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"modular.js","sourceRoot":"","sources":["../src/abstract/modular.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,sEAAsE;AACtE,OAAO,EACL,MAAM,EACN,OAAO,EACP,eAAe,EACf,eAAe,EACf,eAAe,EACf,eAAe,EACf,cAAc,GACf,MAAM,aAAa,CAAC;AAErB,8CAA8C;AAC9C,kBAAkB;AAClB,MAAM,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACxG,kBAAkB;AAClB,MAAM,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACxG,kBAAkB;AAClB,MAAM,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACxG,MAAM,IAAI,GAAG,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAExC,wBAAwB;AACxB,MAAM,UAAU,GAAG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CAAC,CAAC;IAC7E,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;IAC/D,+EAA+E;IAC/E,MAAM,OAAO,GAAG,GAAG,CAAC,GAAG,EAAE,UAAU,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;IACjD,OAAO,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AACxF,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/montgomery.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/montgomery.d.ts deleted file mode 100644 index 7d447fdf..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/montgomery.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { type CurveLengths } from './curve.ts'; -export type MontgomeryOpts = { - P: bigint; - type: 'x25519' | 'x448'; - adjustScalarBytes: (bytes: Uint8Array) => Uint8Array; - powPminus2: (x: bigint) => bigint; - randomBytes?: (bytesLength?: number) => Uint8Array; -}; -export type MontgomeryECDH = { - scalarMult: (scalar: Uint8Array, u: Uint8Array) => Uint8Array; - scalarMultBase: (scalar: Uint8Array) => Uint8Array; - getSharedSecret: (secretKeyA: Uint8Array, publicKeyB: Uint8Array) => Uint8Array; - getPublicKey: (secretKey: Uint8Array) => Uint8Array; - utils: { - randomSecretKey: () => Uint8Array; - }; - GuBytes: Uint8Array; - lengths: CurveLengths; - keygen: (seed?: Uint8Array) => { - secretKey: Uint8Array; - publicKey: Uint8Array; - }; -}; -export declare function montgomery(curveDef: MontgomeryOpts): MontgomeryECDH; -//# sourceMappingURL=montgomery.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/montgomery.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/montgomery.d.ts.map deleted file mode 100644 index b6dc9883..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/montgomery.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"montgomery.d.ts","sourceRoot":"","sources":["../src/abstract/montgomery.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAO7D,MAAM,MAAM,cAAc,GAAG;IAC3B,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC;IACxB,iBAAiB,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,UAAU,CAAC;IACrD,UAAU,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAClC,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,EAAE,MAAM,KAAK,UAAU,CAAC;CACpD,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,KAAK,UAAU,CAAC;IAC9D,cAAc,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,UAAU,CAAC;IACnD,eAAe,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,KAAK,UAAU,CAAC;IAChF,YAAY,EAAE,CAAC,SAAS,EAAE,UAAU,KAAK,UAAU,CAAC;IACpD,KAAK,EAAE;QACL,eAAe,EAAE,MAAM,UAAU,CAAC;KACnC,CAAC;IACF,OAAO,EAAE,UAAU,CAAC;IACpB,OAAO,EAAE,YAAY,CAAC;IACtB,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,UAAU,KAAK;QAAE,SAAS,EAAE,UAAU,CAAC;QAAC,SAAS,EAAE,UAAU,CAAA;KAAE,CAAC;CACjF,CAAC;AAUF,wBAAgB,UAAU,CAAC,QAAQ,EAAE,cAAc,GAAG,cAAc,CAqInE"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/montgomery.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/montgomery.js deleted file mode 100644 index 3101f416..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/montgomery.js +++ /dev/null @@ -1,153 +0,0 @@ -/** - * Montgomery curve methods. It's not really whole montgomery curve, - * just bunch of very specific methods for X25519 / X448 from - * [RFC 7748](https://www.rfc-editor.org/rfc/rfc7748) - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { abytes, aInRange, bytesToNumberLE, copyBytes, numberToBytesLE, randomBytes, validateObject, } from "../utils.js"; -import { createKeygen } from "./curve.js"; -import { mod } from "./modular.js"; -const _0n = BigInt(0); -const _1n = BigInt(1); -const _2n = BigInt(2); -function validateOpts(curve) { - validateObject(curve, { - adjustScalarBytes: 'function', - powPminus2: 'function', - }); - return Object.freeze({ ...curve }); -} -export function montgomery(curveDef) { - const CURVE = validateOpts(curveDef); - const { P, type, adjustScalarBytes, powPminus2, randomBytes: rand } = CURVE; - const is25519 = type === 'x25519'; - if (!is25519 && type !== 'x448') - throw new Error('invalid type'); - const randomBytes_ = rand || randomBytes; - const montgomeryBits = is25519 ? 255 : 448; - const fieldLen = is25519 ? 32 : 56; - const Gu = is25519 ? BigInt(9) : BigInt(5); - // RFC 7748 #5: - // The constant a24 is (486662 - 2) / 4 = 121665 for curve25519/X25519 and - // (156326 - 2) / 4 = 39081 for curve448/X448 - // const a = is25519 ? 156326n : 486662n; - const a24 = is25519 ? BigInt(121665) : BigInt(39081); - // RFC: x25519 "the resulting integer is of the form 2^254 plus - // eight times a value between 0 and 2^251 - 1 (inclusive)" - // x448: "2^447 plus four times a value between 0 and 2^445 - 1 (inclusive)" - const minScalar = is25519 ? _2n ** BigInt(254) : _2n ** BigInt(447); - const maxAdded = is25519 - ? BigInt(8) * _2n ** BigInt(251) - _1n - : BigInt(4) * _2n ** BigInt(445) - _1n; - const maxScalar = minScalar + maxAdded + _1n; // (inclusive) - const modP = (n) => mod(n, P); - const GuBytes = encodeU(Gu); - function encodeU(u) { - return numberToBytesLE(modP(u), fieldLen); - } - function decodeU(u) { - const _u = copyBytes(abytes(u, fieldLen, 'uCoordinate')); - // RFC: When receiving such an array, implementations of X25519 - // (but not X448) MUST mask the most significant bit in the final byte. - if (is25519) - _u[31] &= 127; // 0b0111_1111 - // RFC: Implementations MUST accept non-canonical values and process them as - // if they had been reduced modulo the field prime. The non-canonical - // values are 2^255 - 19 through 2^255 - 1 for X25519 and 2^448 - 2^224 - // - 1 through 2^448 - 1 for X448. - return modP(bytesToNumberLE(_u)); - } - function decodeScalar(scalar) { - return bytesToNumberLE(adjustScalarBytes(copyBytes(abytes(scalar, fieldLen, 'scalar')))); - } - function scalarMult(scalar, u) { - const pu = montgomeryLadder(decodeU(u), decodeScalar(scalar)); - // Some public keys are useless, of low-order. Curve author doesn't think - // it needs to be validated, but we do it nonetheless. - // https://cr.yp.to/ecdh.html#validate - if (pu === _0n) - throw new Error('invalid private or public key received'); - return encodeU(pu); - } - // Computes public key from private. By doing scalar multiplication of base point. - function scalarMultBase(scalar) { - return scalarMult(scalar, GuBytes); - } - const getPublicKey = scalarMultBase; - const getSharedSecret = scalarMult; - // cswap from RFC7748 "example code" - function cswap(swap, x_2, x_3) { - // dummy = mask(swap) AND (x_2 XOR x_3) - // Where mask(swap) is the all-1 or all-0 word of the same length as x_2 - // and x_3, computed, e.g., as mask(swap) = 0 - swap. - const dummy = modP(swap * (x_2 - x_3)); - x_2 = modP(x_2 - dummy); // x_2 = x_2 XOR dummy - x_3 = modP(x_3 + dummy); // x_3 = x_3 XOR dummy - return { x_2, x_3 }; - } - /** - * Montgomery x-only multiplication ladder. - * @param pointU u coordinate (x) on Montgomery Curve 25519 - * @param scalar by which the point would be multiplied - * @returns new Point on Montgomery curve - */ - function montgomeryLadder(u, scalar) { - aInRange('u', u, _0n, P); - aInRange('scalar', scalar, minScalar, maxScalar); - const k = scalar; - const x_1 = u; - let x_2 = _1n; - let z_2 = _0n; - let x_3 = u; - let z_3 = _1n; - let swap = _0n; - for (let t = BigInt(montgomeryBits - 1); t >= _0n; t--) { - const k_t = (k >> t) & _1n; - swap ^= k_t; - ({ x_2, x_3 } = cswap(swap, x_2, x_3)); - ({ x_2: z_2, x_3: z_3 } = cswap(swap, z_2, z_3)); - swap = k_t; - const A = x_2 + z_2; - const AA = modP(A * A); - const B = x_2 - z_2; - const BB = modP(B * B); - const E = AA - BB; - const C = x_3 + z_3; - const D = x_3 - z_3; - const DA = modP(D * A); - const CB = modP(C * B); - const dacb = DA + CB; - const da_cb = DA - CB; - x_3 = modP(dacb * dacb); - z_3 = modP(x_1 * modP(da_cb * da_cb)); - x_2 = modP(AA * BB); - z_2 = modP(E * (AA + modP(a24 * E))); - } - ({ x_2, x_3 } = cswap(swap, x_2, x_3)); - ({ x_2: z_2, x_3: z_3 } = cswap(swap, z_2, z_3)); - const z2 = powPminus2(z_2); // `Fp.pow(x, P - _2n)` is much slower equivalent - return modP(x_2 * z2); // Return x_2 * (z_2^(p - 2)) - } - const lengths = { - secretKey: fieldLen, - publicKey: fieldLen, - seed: fieldLen, - }; - const randomSecretKey = (seed = randomBytes_(fieldLen)) => { - abytes(seed, lengths.seed, 'seed'); - return seed; - }; - const utils = { randomSecretKey }; - return Object.freeze({ - keygen: createKeygen(randomSecretKey, getPublicKey), - getSharedSecret, - getPublicKey, - scalarMult, - scalarMultBase, - utils, - GuBytes: GuBytes.slice(), - lengths, - }); -} -//# sourceMappingURL=montgomery.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/montgomery.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/montgomery.js.map deleted file mode 100644 index 5e6656ab..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/montgomery.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"montgomery.js","sourceRoot":"","sources":["../src/abstract/montgomery.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,sEAAsE;AACtE,OAAO,EACL,MAAM,EACN,QAAQ,EACR,eAAe,EACf,SAAS,EACT,eAAe,EACf,WAAW,EACX,cAAc,GAEf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAqB,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEnC,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAuBtB,SAAS,YAAY,CAAC,KAAqB;IACzC,cAAc,CAAC,KAAK,EAAE;QACpB,iBAAiB,EAAE,UAAU;QAC7B,UAAU,EAAE,UAAU;KACvB,CAAC,CAAC;IACH,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,EAAW,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,QAAwB;IACjD,MAAM,KAAK,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;IACrC,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,UAAU,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IAC5E,MAAM,OAAO,GAAG,IAAI,KAAK,QAAQ,CAAC;IAClC,IAAI,CAAC,OAAO,IAAI,IAAI,KAAK,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAC;IACjE,MAAM,YAAY,GAAG,IAAI,IAAI,WAAW,CAAC;IAEzC,MAAM,cAAc,GAAG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BAA6B;IACtD,CAAC;IACD,MAAM,OAAO,GAAG;QACd,SAAS,EAAE,QAAQ;QACnB,SAAS,EAAE,QAAQ;QACnB,IAAI,EAAE,QAAQ;KACf,CAAC;IACF,MAAM,eAAe,GAAG,CAAC,IAAI,GAAG,YAAY,CAAC,QAAQ,CAAC,EAAE,EAAE;QACxD,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACnC,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;IACF,MAAM,KAAK,GAAG,EAAE,eAAe,EAAE,CAAC;IAElC,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,MAAM,EAAE,YAAY,CAAC,eAAe,EAAE,YAAY,CAAC;QACnD,eAAe;QACf,YAAY;QACZ,UAAU;QACV,cAAc;QACd,KAAK;QACL,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE;QACxB,OAAO;KACR,CAAsB,CAAC;AAC1B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/oprf.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/oprf.d.ts deleted file mode 100644 index eef6bb99..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/oprf.d.ts +++ /dev/null @@ -1,282 +0,0 @@ -/** - * RFC 9497: Oblivious Pseudorandom Functions (OPRFs) Using Prime-Order Groups. - * https://www.rfc-editor.org/rfc/rfc9497 - * - -OPRF allows to interactively create an `Output = PRF(Input, serverSecretKey)`: - -- Server cannot calculate Output by itself: it doesn't know Input -- Client cannot calculate Output by itself: it doesn't know server secretKey -- An attacker interception the communication can't restore Input/Output/serverSecretKey and can't - link Input to some value. - -## Issues - -- Low-entropy inputs (e.g. password '123') enable brute-forced dictionary attacks by the server - (solveable by domain separation in POPRF) -- High-level protocol needs to be constructed on top, because OPRF is low-level - -## Use cases - -1. **Password-Authenticated Key Exchange (PAKE):** Enables secure password login (e.g., OPAQUE) - without revealing the password to the server. -2. **Private Set Intersection (PSI):** Allows two parties to compute the intersection of their - private sets without revealing non-intersecting elements. -3. **Anonymous Credential Systems:** Supports issuance of anonymous, unlinkable credentials - (e.g., Privacy Pass) using blind OPRF evaluation. -4. **Private Information Retrieval (PIR):** Helps users query databases without revealing which - item they accessed. -5. **Encrypted Search / Secure Indexing:** Enables keyword search over encrypted data while keeping - queries private. -6. **Spam Prevention and Rate-Limiting:** Issues anonymous tokens to prevent abuse - (e.g., CAPTCHA bypass) without compromising user privacy. - -## Modes - -- OPRF: simple mode, client doesn't need to know server public key -- VOPRF: verifable mode, allows client to verify that server used secret key corresponding to known public key -- POPRF: partially oblivious mode, VOPRF + domain separation - -There is also non-interactive mode (Evaluate) that supports creating Output in non-interactive mode with knowledge of secret key. - -Flow: -- (once) Server generates secret and public keys, distributes public keys to clients - - deterministically: `deriveKeyPair` or just random: `generateKeyPair` -- Client blinds input: `blind(secretInput)` -- Server evaluates blinded input: `blindEvaluate` generated by client, sends result to client -- Client creates output using result of evaluation via 'finalize' - - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { randomBytes } from '../utils.ts'; -import { type CurvePoint, type CurvePointCons } from './curve.ts'; -import { type H2CDSTOpts } from './hash-to-curve.ts'; -export type PointBytes = Uint8Array; -export type ScalarBytes = Uint8Array; -export type Bytes = Uint8Array; -export type RNG = typeof randomBytes; -export type OPRFOpts

> = { - name: string; - Point: CurvePointCons

; - hash(msg: Bytes): Bytes; - hashToScalar(msg: Uint8Array, options: H2CDSTOpts): bigint; - hashToGroup(msg: Uint8Array, options: H2CDSTOpts): P; -}; -export type OPRFKeys = { - secretKey: ScalarBytes; - publicKey: PointBytes; -}; -export type OPRFBlind = { - blind: Uint8Array; - blinded: Uint8Array; -}; -export type OPRFBlindEval = { - evaluated: PointBytes; - proof: Bytes; -}; -export type OPRFBlindEvalBatch = { - evaluated: PointBytes[]; - proof: Bytes; -}; -export type OPRFFinalizeItem = { - input: Bytes; - blind: ScalarBytes; - evaluated: PointBytes; - blinded: PointBytes; -}; -/** - * Represents a full OPRF ciphersuite implementation according to RFC 9497. - * This object bundles the three protocol variants (OPRF, VOPRF, POPRF) for a specific - * prime-order group and hash function combination. - * - * @see https://www.rfc-editor.org/rfc/rfc9497.html - */ -export type OPRF = { - /** - * The unique identifier for the ciphersuite, e.g., "ristretto255-SHA512". - * This name is used for domain separation to prevent cross-protocol attacks. - */ - readonly name: string; - /** - * The base Oblivious Pseudorandom Function (OPRF) mode (mode 0x00). - * This is a two-party protocol between a client and a server to compute F(k, x) - * where 'k' is the server's key and 'x' is the client's input. - * - * The client learns the output F(k, x) but nothing about 'k'. - * The server learns nothing about 'x' or F(k, x). - * This mode is NOT verifiable; the client cannot prove the server used a specific key. - */ - readonly oprf: { - /** - * (Server-side) Generates a new random private/public key pair for the server. - * @returns A new key pair. - */ - generateKeyPair(): OPRFKeys; - /** - * (Server-side) Deterministically derives a private/public key pair from a seed. - * @param seed A 32-byte cryptographically secure random seed. - * @param keyInfo An optional byte string for domain separation. - * @returns The derived key pair. - */ - deriveKeyPair(seed: Bytes, keyInfo: Bytes): OPRFKeys; - /** - * (Client-side) The first step of the protocol. The client blinds its private input. - * @param input The client's private input bytes. - * @param rng An optional cryptographically secure random number generator. - * @returns An object containing the `blind` scalar (which the client MUST keep secret) - * and the `blinded` element (which the client sends to the server). - */ - blind(input: Bytes, rng?: RNG): OPRFBlind; - /** - * (Server-side) The second step. The server evaluates the client's blinded element - * using its secret key. - * @param secretKey The server's private key. - * @param blinded The blinded group element received from the client. - * @returns The evaluated group element, to be sent back to the client. - */ - blindEvaluate(secretKey: ScalarBytes, blinded: PointBytes): PointBytes; - /** - * (Client-side) The final step. The client unblinds the server's response to - * compute the final OPRF output. - * @param input The original private input from the `blind` step. - * @param blind The secret scalar from the `blind` step. - * @param evaluated The evaluated group element received from the server. - * @returns The final OPRF output, `Hash(len(input)||input||len(unblinded)||unblinded||"Finalize")`. - */ - finalize(input: Bytes, blind: ScalarBytes, evaluated: PointBytes): Bytes; - }; - /** - * The Verifiable Oblivious Pseudorandom Function (VOPRF) mode (mode 0x01). - * This mode extends the base OPRF by providing a proof that the server used the - * secret key corresponding to its known public key. - */ - readonly voprf: { - /** (Server-side) Generates a key pair for the VOPRF mode. */ - generateKeyPair(): OPRFKeys; - /** (Server-side) Deterministically derives a key pair for the VOPRF mode. */ - deriveKeyPair(seed: Bytes, keyInfo: Bytes): OPRFKeys; - /** (Client-side) Blinds the client's private input for the VOPRF protocol. */ - blind(input: Bytes, rng?: RNG): OPRFBlind; - /** - * (Server-side) Evaluates the client's blinded element and generates a DLEQ proof - * of correctness. - * @param secretKey The server's private key. - * @param publicKey The server's public key, used in proof generation. - * @param blinded The blinded group element received from the client. - * @param rng An optional cryptographically secure random number generator for the proof. - * @returns The evaluated element and a proof of correct computation. - */ - blindEvaluate(secretKey: ScalarBytes, publicKey: PointBytes, blinded: PointBytes, rng?: RNG): OPRFBlindEval; - /** - * (Server-side) An optimized batch version of `blindEvaluate`. It evaluates multiple - * blinded elements and produces a single, constant-size proof for the entire batch, - * amortizing the cost of proof generation. - * @param secretKey The server's private key. - * @param publicKey The server's public key. - * @param blinded An array of blinded group elements from one or more clients. - * @param rng An optional cryptographically secure random number generator for the proof. - * @returns An array of evaluated elements and a single proof for the batch. - */ - blindEvaluateBatch(secretKey: ScalarBytes, publicKey: PointBytes, blinded: PointBytes[], rng?: RNG): OPRFBlindEvalBatch; - /** - * (Client-side) The final step. The client verifies the server's proof, and if valid, - * unblinds the result to compute the final VOPRF output. - * @param input The original private input. - * @param blind The secret scalar from the `blind` step. - * @param evaluated The evaluated element from the server. - * @param blinded The blinded element sent to the server (needed for proof verification). - * @param publicKey The server's public key against which the proof is verified. - * @param proof The DLEQ proof from the server. - * @returns The final VOPRF output. - * @throws If the proof verification fails. - */ - finalize(input: Bytes, blind: ScalarBytes, evaluated: PointBytes, blinded: PointBytes, publicKey: PointBytes, proof: Bytes): Bytes; - /** - * (Client-side) The batch-aware version of `finalize`. It verifies a single batch proof - * against a list of corresponding inputs and outputs. - * @param items An array of objects, each containing the parameters for a single finalization. - * @param publicKey The server's public key. - * @param proof The single DLEQ proof for the entire batch. - * @returns An array of final VOPRF outputs, one for each item in the input. - * @throws If the proof verification fails. - */ - finalizeBatch(items: OPRFFinalizeItem[], publicKey: PointBytes, proof: Bytes): Bytes[]; - }; - /** - * A factory for the Partially Oblivious Pseudorandom Function (POPRF) mode (mode 0x02). - * This mode extends VOPRF to include a public `info` parameter, known to both client and - * server, which is cryptographically bound to the final output. - * This is useful for domain separation at the application level. - * @param info A public byte string to be mixed into the computation. - * @returns An object with the POPRF protocol functions. - */ - readonly poprf: (info: Bytes) => { - /** (Server-side) Generates a key pair for the POPRF mode. */ - generateKeyPair(): OPRFKeys; - /** (Server-side) Deterministically derives a key pair for the POPRF mode. */ - deriveKeyPair(seed: Bytes, keyInfo: Bytes): OPRFKeys; - /** - * (Client-side) Blinds the client's private input and computes the "tweaked key". - * The tweaked key is a public value derived from the server's public key and the public `info`. - * @param input The client's private input. - * @param publicKey The server's public key. - * @param rng An optional cryptographically secure random number generator. - * @returns The `blind`, `blinded` element, and the `tweakedKey` which the client uses for verification. - */ - blind(input: Bytes, publicKey: PointBytes, rng?: RNG): OPRFBlind & { - tweakedKey: PointBytes; - }; - /** - * (Server-side) Evaluates the blinded element using a key derived from its secret key and the public `info`. - * It generates a DLEQ proof against the tweaked key. - * @param secretKey The server's private key. - * @param blinded The blinded element from the client. - * @param rng An optional RNG for the proof. - * @returns The evaluated element and a proof of correct computation. - */ - blindEvaluate(secretKey: ScalarBytes, blinded: PointBytes, rng?: RNG): OPRFBlindEval; - /** - * (Server-side) A batch-aware version of `blindEvaluate` for the POPRF mode. - * @param secretKey The server's private key. - * @param blinded An array of blinded elements. - * @param rng An optional RNG for the proof. - * @returns An array of evaluated elements and a single proof for the batch. - */ - blindEvaluateBatch(secretKey: ScalarBytes, blinded: PointBytes[], rng: RNG): OPRFBlindEvalBatch; - /** - * (Client-side) A batch-aware version of `finalize` for the POPRF mode. - * It verifies the proof against the tweaked key. - * @param items An array containing the parameters for each finalization. - * @param proof The single DLEQ proof for the batch. - * @param tweakedKey The tweaked key corresponding to the proof (all items must share the same `info` and `publicKey`). - * @returns An array of final POPRF outputs. - * @throws If proof verification fails. - */ - finalizeBatch(items: OPRFFinalizeItem[], proof: Bytes, tweakedKey: PointBytes): Bytes[]; - /** - * (Client-side) Finalizes the POPRF protocol. It verifies the server's proof against the - * `tweakedKey` computed in the `blind` step. The final output is bound to the public `info`. - * @param input The original private input. - * @param blind The secret scalar. - * @param evaluated The evaluated element from the server. - * @param blinded The blinded element sent to the server. - * @param proof The DLEQ proof from the server. - * @param tweakedKey The public tweaked key computed by the client during the `blind` step. - * @returns The final POPRF output. - * @throws If proof verification fails. - */ - finalize(input: Bytes, blind: ScalarBytes, evaluated: PointBytes, blinded: PointBytes, proof: Bytes, tweakedKey: PointBytes): Bytes; - /** - * A non-interactive evaluation function for an entity that knows all inputs. - * Computes the final POPRF output directly. Useful for testing or specific applications - * where the server needs to compute the output for a known input. - * @param secretKey The server's private key. - * @param input The client's private input. - * @returns The final POPRF output. - */ - evaluate(secretKey: ScalarBytes, input: Bytes): Bytes; - }; -}; -export declare function createORPF

>(opts: OPRFOpts

): OPRF; -//# sourceMappingURL=oprf.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/oprf.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/oprf.d.ts.map deleted file mode 100644 index 7af092b7..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/oprf.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"oprf.d.ts","sourceRoot":"","sources":["../src/abstract/oprf.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAE,UAAU,GAAG,KAAK,EAAE,CAAC;QAExF;;;;;;;;;;;WAWG;QACH,QAAQ,CACN,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,UAAU,EACrB,OAAO,EAAE,UAAU,EACnB,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,GACrB,KAAK,CAAC;QAET;;;;;;;WAOG;QACH,QAAQ,CAAC,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC;KACvD,CAAC;CACH,CAAC;AAGF,wBAAgB,UAAU,CAAC,CAAC,SAAS,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAkRhF"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/oprf.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/oprf.js deleted file mode 100644 index eabdea80..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/oprf.js +++ /dev/null @@ -1,297 +0,0 @@ -/** - * RFC 9497: Oblivious Pseudorandom Functions (OPRFs) Using Prime-Order Groups. - * https://www.rfc-editor.org/rfc/rfc9497 - * - -OPRF allows to interactively create an `Output = PRF(Input, serverSecretKey)`: - -- Server cannot calculate Output by itself: it doesn't know Input -- Client cannot calculate Output by itself: it doesn't know server secretKey -- An attacker interception the communication can't restore Input/Output/serverSecretKey and can't - link Input to some value. - -## Issues - -- Low-entropy inputs (e.g. password '123') enable brute-forced dictionary attacks by the server - (solveable by domain separation in POPRF) -- High-level protocol needs to be constructed on top, because OPRF is low-level - -## Use cases - -1. **Password-Authenticated Key Exchange (PAKE):** Enables secure password login (e.g., OPAQUE) - without revealing the password to the server. -2. **Private Set Intersection (PSI):** Allows two parties to compute the intersection of their - private sets without revealing non-intersecting elements. -3. **Anonymous Credential Systems:** Supports issuance of anonymous, unlinkable credentials - (e.g., Privacy Pass) using blind OPRF evaluation. -4. **Private Information Retrieval (PIR):** Helps users query databases without revealing which - item they accessed. -5. **Encrypted Search / Secure Indexing:** Enables keyword search over encrypted data while keeping - queries private. -6. **Spam Prevention and Rate-Limiting:** Issues anonymous tokens to prevent abuse - (e.g., CAPTCHA bypass) without compromising user privacy. - -## Modes - -- OPRF: simple mode, client doesn't need to know server public key -- VOPRF: verifable mode, allows client to verify that server used secret key corresponding to known public key -- POPRF: partially oblivious mode, VOPRF + domain separation - -There is also non-interactive mode (Evaluate) that supports creating Output in non-interactive mode with knowledge of secret key. - -Flow: -- (once) Server generates secret and public keys, distributes public keys to clients - - deterministically: `deriveKeyPair` or just random: `generateKeyPair` -- Client blinds input: `blind(secretInput)` -- Server evaluates blinded input: `blindEvaluate` generated by client, sends result to client -- Client creates output using result of evaluation via 'finalize' - - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { abytes, asciiToBytes, bytesToNumberBE, bytesToNumberLE, concatBytes, numberToBytesBE, randomBytes, validateObject, } from "../utils.js"; -import { pippenger } from "./curve.js"; -import { _DST_scalar } from "./hash-to-curve.js"; -import { getMinHashLength, mapHashToField } from "./modular.js"; -// welcome to generic hell -export function createORPF(opts) { - validateObject(opts, { - name: 'string', - hash: 'function', - hashToScalar: 'function', - hashToGroup: 'function', - }); - // TODO - // Point: 'point', - const { name, Point, hash } = opts; - const { Fn } = Point; - const hashToGroup = (msg, ctx) => opts.hashToGroup(msg, { - DST: concatBytes(asciiToBytes('HashToGroup-'), ctx), - }); - const hashToScalarPrefixed = (msg, ctx) => opts.hashToScalar(msg, { DST: concatBytes(_DST_scalar, ctx) }); - const randomScalar = (rng = randomBytes) => { - const t = mapHashToField(rng(getMinHashLength(Fn.ORDER)), Fn.ORDER, Fn.isLE); - // We cannot use Fn.fromBytes here, because field - // can have different number of bytes (like ed448) - return Fn.isLE ? bytesToNumberLE(t) : bytesToNumberBE(t); - }; - const msm = (points, scalars) => pippenger(Point, points, scalars); - const getCtx = (mode) => concatBytes(asciiToBytes('OPRFV1-'), new Uint8Array([mode]), asciiToBytes('-' + name)); - const ctxOPRF = getCtx(0x00); - const ctxVOPRF = getCtx(0x01); - const ctxPOPRF = getCtx(0x02); - function encode(...args) { - const res = []; - for (const a of args) { - if (typeof a === 'number') - res.push(numberToBytesBE(a, 2)); - else if (typeof a === 'string') - res.push(asciiToBytes(a)); - else { - abytes(a); - res.push(numberToBytesBE(a.length, 2), a); - } - } - // No wipe here, since will modify actual bytes - return concatBytes(...res); - } - const hashInput = (...bytes) => hash(encode(...bytes, 'Finalize')); - function getTranscripts(B, C, D, ctx) { - const Bm = B.toBytes(); - const seed = hash(encode(Bm, concatBytes(asciiToBytes('Seed-'), ctx))); - const res = []; - for (let i = 0; i < C.length; i++) { - const Ci = C[i].toBytes(); - const Di = D[i].toBytes(); - const di = hashToScalarPrefixed(encode(seed, i, Ci, Di, 'Composite'), ctx); - res.push(di); - } - return res; - } - function computeComposites(B, C, D, ctx) { - const T = getTranscripts(B, C, D, ctx); - const M = msm(C, T); - const Z = msm(D, T); - return { M, Z }; - } - function computeCompositesFast(k, B, C, D, ctx) { - const T = getTranscripts(B, C, D, ctx); - const M = msm(C, T); - const Z = M.multiply(k); - return { M, Z }; - } - function challengeTranscript(B, M, Z, t2, t3, ctx) { - const [Bm, a0, a1, a2, a3] = [B, M, Z, t2, t3].map((i) => i.toBytes()); - return hashToScalarPrefixed(encode(Bm, a0, a1, a2, a3, 'Challenge'), ctx); - } - function generateProof(ctx, k, B, C, D, rng) { - const { M, Z } = computeCompositesFast(k, B, C, D, ctx); - const r = randomScalar(rng); - const t2 = Point.BASE.multiply(r); - const t3 = M.multiply(r); - const c = challengeTranscript(B, M, Z, t2, t3, ctx); - const s = Fn.sub(r, Fn.mul(c, k)); // r - c*k - return concatBytes(...[c, s].map((i) => Fn.toBytes(i))); - } - function verifyProof(ctx, B, C, D, proof) { - abytes(proof, 2 * Fn.BYTES); - const { M, Z } = computeComposites(B, C, D, ctx); - const [c, s] = [proof.subarray(0, Fn.BYTES), proof.subarray(Fn.BYTES)].map((f) => Fn.fromBytes(f)); - const t2 = Point.BASE.multiply(s).add(B.multiply(c)); // s*G + c*B - const t3 = M.multiply(s).add(Z.multiply(c)); // s*M + c*Z - const expectedC = challengeTranscript(B, M, Z, t2, t3, ctx); - if (!Fn.eql(c, expectedC)) - throw new Error('proof verification failed'); - } - function generateKeyPair() { - const skS = randomScalar(); - const pkS = Point.BASE.multiply(skS); - return { secretKey: Fn.toBytes(skS), publicKey: pkS.toBytes() }; - } - function deriveKeyPair(ctx, seed, info) { - const dst = concatBytes(asciiToBytes('DeriveKeyPair'), ctx); - const msg = concatBytes(seed, encode(info), Uint8Array.of(0)); - for (let counter = 0; counter <= 255; counter++) { - msg[msg.length - 1] = counter; - const skS = opts.hashToScalar(msg, { DST: dst }); - if (Fn.is0(skS)) - continue; // should not happen - return { secretKey: Fn.toBytes(skS), publicKey: Point.BASE.multiply(skS).toBytes() }; - } - throw new Error('Cannot derive key'); - } - function blind(ctx, input, rng = randomBytes) { - const blind = randomScalar(rng); - const inputPoint = hashToGroup(input, ctx); - if (inputPoint.equals(Point.ZERO)) - throw new Error('Input point at infinity'); - const blinded = inputPoint.multiply(blind); - return { blind: Fn.toBytes(blind), blinded: blinded.toBytes() }; - } - function evaluate(ctx, secretKey, input) { - const skS = Fn.fromBytes(secretKey); - const inputPoint = hashToGroup(input, ctx); - if (inputPoint.equals(Point.ZERO)) - throw new Error('Input point at infinity'); - const unblinded = inputPoint.multiply(skS).toBytes(); - return hashInput(input, unblinded); - } - const oprf = { - generateKeyPair, - deriveKeyPair: (seed, keyInfo) => deriveKeyPair(ctxOPRF, seed, keyInfo), - blind: (input, rng = randomBytes) => blind(ctxOPRF, input, rng), - blindEvaluate(secretKey, blindedPoint) { - const skS = Fn.fromBytes(secretKey); - const elm = Point.fromBytes(blindedPoint); - return elm.multiply(skS).toBytes(); - }, - finalize(input, blindBytes, evaluatedBytes) { - const blind = Fn.fromBytes(blindBytes); - const evalPoint = Point.fromBytes(evaluatedBytes); - const unblinded = evalPoint.multiply(Fn.inv(blind)).toBytes(); - return hashInput(input, unblinded); - }, - evaluate: (secretKey, input) => evaluate(ctxOPRF, secretKey, input), - }; - const voprf = { - generateKeyPair, - deriveKeyPair: (seed, keyInfo) => deriveKeyPair(ctxVOPRF, seed, keyInfo), - blind: (input, rng = randomBytes) => blind(ctxVOPRF, input, rng), - blindEvaluateBatch(secretKey, publicKey, blinded, rng = randomBytes) { - if (!Array.isArray(blinded)) - throw new Error('expected array'); - const skS = Fn.fromBytes(secretKey); - const pkS = Point.fromBytes(publicKey); - const blindedPoints = blinded.map(Point.fromBytes); - const evaluated = blindedPoints.map((i) => i.multiply(skS)); - const proof = generateProof(ctxVOPRF, skS, pkS, blindedPoints, evaluated, rng); - return { evaluated: evaluated.map((i) => i.toBytes()), proof }; - }, - blindEvaluate(secretKey, publicKey, blinded, rng = randomBytes) { - const res = this.blindEvaluateBatch(secretKey, publicKey, [blinded], rng); - return { evaluated: res.evaluated[0], proof: res.proof }; - }, - finalizeBatch(items, publicKey, proof) { - if (!Array.isArray(items)) - throw new Error('expected array'); - const pkS = Point.fromBytes(publicKey); - const blindedPoints = items.map((i) => i.blinded).map(Point.fromBytes); - const evalPoints = items.map((i) => i.evaluated).map(Point.fromBytes); - verifyProof(ctxVOPRF, pkS, blindedPoints, evalPoints, proof); - return items.map((i) => oprf.finalize(i.input, i.blind, i.evaluated)); - }, - finalize(input, blind, evaluated, blinded, publicKey, proof) { - return this.finalizeBatch([{ input, blind, evaluated, blinded }], publicKey, proof)[0]; - }, - evaluate: (secretKey, input) => evaluate(ctxVOPRF, secretKey, input), - }; - // NOTE: info is domain separation - const poprf = (info) => { - const m = hashToScalarPrefixed(encode('Info', info), ctxPOPRF); - const T = Point.BASE.multiply(m); - return { - generateKeyPair, - deriveKeyPair: (seed, keyInfo) => deriveKeyPair(ctxPOPRF, seed, keyInfo), - blind(input, publicKey, rng = randomBytes) { - const pkS = Point.fromBytes(publicKey); - const tweakedKey = T.add(pkS); - if (tweakedKey.equals(Point.ZERO)) - throw new Error('tweakedKey point at infinity'); - const blind = randomScalar(rng); - const inputPoint = hashToGroup(input, ctxPOPRF); - if (inputPoint.equals(Point.ZERO)) - throw new Error('Input point at infinity'); - const blindedPoint = inputPoint.multiply(blind); - return { - blind: Fn.toBytes(blind), - blinded: blindedPoint.toBytes(), - tweakedKey: tweakedKey.toBytes(), - }; - }, - blindEvaluateBatch(secretKey, blinded, rng = randomBytes) { - if (!Array.isArray(blinded)) - throw new Error('expected array'); - const skS = Fn.fromBytes(secretKey); - const t = Fn.add(skS, m); - // "Hence, this error can be a signal for the server to replace its private key". We throw inside, - // should be impossible. - const invT = Fn.inv(t); - const blindedPoints = blinded.map(Point.fromBytes); - const evalPoints = blindedPoints.map((i) => i.multiply(invT)); - const tweakedKey = Point.BASE.multiply(t); - const proof = generateProof(ctxPOPRF, t, tweakedKey, evalPoints, blindedPoints, rng); - return { evaluated: evalPoints.map((i) => i.toBytes()), proof }; - }, - blindEvaluate(secretKey, blinded, rng = randomBytes) { - const res = this.blindEvaluateBatch(secretKey, [blinded], rng); - return { evaluated: res.evaluated[0], proof: res.proof }; - }, - finalizeBatch(items, proof, tweakedKey) { - if (!Array.isArray(items)) - throw new Error('expected array'); - const evalPoints = items.map((i) => i.evaluated).map(Point.fromBytes); - verifyProof(ctxPOPRF, Point.fromBytes(tweakedKey), evalPoints, items.map((i) => i.blinded).map(Point.fromBytes), proof); - return items.map((i, j) => { - const blind = Fn.fromBytes(i.blind); - const point = evalPoints[j].multiply(Fn.inv(blind)).toBytes(); - return hashInput(i.input, info, point); - }); - }, - finalize(input, blind, evaluated, blinded, proof, tweakedKey) { - return this.finalizeBatch([{ input, blind, evaluated, blinded }], proof, tweakedKey)[0]; - }, - evaluate(secretKey, input) { - const skS = Fn.fromBytes(secretKey); - const inputPoint = hashToGroup(input, ctxPOPRF); - if (inputPoint.equals(Point.ZERO)) - throw new Error('Input point at infinity'); - const t = Fn.add(skS, m); - const invT = Fn.inv(t); - const unblinded = inputPoint.multiply(invT).toBytes(); - return hashInput(input, info, unblinded); - }, - }; - }; - return Object.freeze({ name, oprf, voprf, poprf, __tests: { Fn } }); -} -//# sourceMappingURL=oprf.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/oprf.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/oprf.js.map deleted file mode 100644 index 5e0715cc..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/oprf.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"oprf.js","sourceRoot":"","sources":["../src/abstract/oprf.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,sEAAsE;AACtE,OAAO,EACL,MAAM,EACN,YAAY,EACZ,eAAe,EACf,eAAe,EACf,WAAW,EACX,eAAe,EACf,WAAW,EACX,cAAc,GACf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,SAAS,EAAwC,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAmB,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAqQhE,0BAA0B;AAC1B,MAAM,UAAU,UAAU,CAA+B,IAAiB;IACxE,cAAc,CAAC,IAAI,EAAE;QACnB,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,UAAU;QAChB,YAAY,EAAE,UAAU;QACxB,WAAW,EAAE,UAAU;KACxB,CAAC,CAAC;IACH,OAAO;IACP,kBAAkB;IAClB,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;IACnC,MAAM,EAAE,EAAE,EAAE,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AK,CAAC,CAAC;gBACzC,CAAC,CAAC,CAAC;YACL,CAAC;YACD,QAAQ,CACN,KAAY,EACZ,KAAkB,EAClB,SAAqB,EACrB,OAAmB,EACnB,KAAY,EACZ,UAAsB;gBAEtB,OAAO,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;YAC1F,CAAC;YACD,QAAQ,CAAC,SAAsB,EAAE,KAAY;gBAC3C,MAAM,GAAG,GAAG,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;gBACpC,MAAM,UAAU,GAAG,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;gBAChD,IAAI,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC;oBAAE,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;gBAC9E,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;gBACzB,MAAM,IAAI,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBACvB,MAAM,SAAS,GAAG,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;gBACtD,OAAO,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;YAC3C,CAAC;SACF,CAAC;IACJ,CAAC,CAAC;IACF,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;AACtE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/poseidon.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/poseidon.d.ts deleted file mode 100644 index e0684efc..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/poseidon.d.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { type IField } from './modular.ts'; -export type PoseidonBasicOpts = { - Fp: IField; - t: number; - roundsFull: number; - roundsPartial: number; - isSboxInverse?: boolean; -}; -export type PoseidonGrainOpts = PoseidonBasicOpts & { - sboxPower?: number; -}; -type PoseidonConstants = { - mds: bigint[][]; - roundConstants: bigint[][]; -}; -export declare function grainGenConstants(opts: PoseidonGrainOpts, skipMDS?: number): PoseidonConstants; -export type PoseidonOpts = PoseidonBasicOpts & PoseidonConstants & { - sboxPower?: number; - reversePartialPowIdx?: boolean; -}; -export declare function validateOpts(opts: PoseidonOpts): Readonly<{ - rounds: number; - sboxFn: (n: bigint) => bigint; - roundConstants: bigint[][]; - mds: bigint[][]; - Fp: IField; - t: number; - roundsFull: number; - roundsPartial: number; - sboxPower?: number; - reversePartialPowIdx?: boolean; -}>; -export declare function splitConstants(rc: bigint[], t: number): bigint[][]; -export type PoseidonFn = { - (values: bigint[]): bigint[]; - roundConstants: bigint[][]; -}; -/** Poseidon NTT-friendly hash. */ -export declare function poseidon(opts: PoseidonOpts): PoseidonFn; -export declare class PoseidonSponge { - private Fp; - readonly rate: number; - readonly capacity: number; - readonly hash: PoseidonFn; - private state; - private pos; - private isAbsorbing; - constructor(Fp: IField, rate: number, capacity: number, hash: PoseidonFn); - private process; - absorb(input: bigint[]): void; - squeeze(count: number): bigint[]; - clean(): void; - clone(): PoseidonSponge; -} -export type PoseidonSpongeOpts = Omit & { - rate: number; - capacity: number; -}; -/** - * The method is not defined in spec, but nevertheless used often. - * Check carefully for compatibility: there are many edge cases, like absorbing an empty array. - * We cross-test against: - * - https://github.com/ProvableHQ/snarkVM/tree/staging/algorithms - * - https://github.com/arkworks-rs/crypto-primitives/tree/main - */ -export declare function poseidonSponge(opts: PoseidonSpongeOpts): () => PoseidonSponge; -export {}; -//# sourceMappingURL=poseidon.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/poseidon.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/poseidon.d.ts.map deleted file mode 100644 index 0b126979..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/poseidon.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"poseidon.d.ts","sourceRoot":"","sources":["../src/abstract/poseidon.ts"],"names":[],"mappings":"AAUA,OAAO,EAAwB,KAAK,MAAM,EAAiB,MAAM,cAAc,CAAC;AAyBhF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACnB,CAAC,EAAE,MAAM,CAAC;IACV,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AA2DF,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,GAAG;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,KAAK,iBAAiB,GAAG;IAAE,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC;IAAC,cAAc,EAAE,MAAM,EAAE,EAAE,CAAA;CAAE,CAAC;AAIzE,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,EAAE,OAAO,GAAE,MAAU,GAAG,iBAAiB,CAuBjG;AAED,MAAM,MAAM,YAAY,GAAG,iBAAiB,GAC1C,iBAAiB,GAAG;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAEJ,wBAAgB,YAAY,CAAC,IAAI,EAAE,YAAY,GAAG,QAAQ,CAAC;IACzD,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK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Ac;CAMxB;AAED,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,YAAY,EAAE,GAAG,CAAC,GAAG;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,kBAAkB,GAAG,MAAM,cAAc,CAQ7E"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/poseidon.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/poseidon.js deleted file mode 100644 index 445d5254..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/poseidon.js +++ /dev/null @@ -1,300 +0,0 @@ -/** - * Implements [Poseidon](https://www.poseidon-hash.info) ZK-friendly hash. - * - * There are many poseidon variants with different constants. - * We don't provide them: you should construct them manually. - * Check out [micro-starknet](https://github.com/paulmillr/micro-starknet) package for a proper example. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { asafenumber, bitGet, validateObject } from "../utils.js"; -import { FpInvertBatch, FpPow, validateField } from "./modular.js"; -// Grain LFSR (Linear-Feedback Shift Register): https://eprint.iacr.org/2009/109.pdf -function grainLFSR(state) { - let pos = 0; - if (state.length !== 80) - throw new Error('grainLFRS: wrong state length, should be 80 bits'); - const getBit = () => { - const r = (offset) => state[(pos + offset) % 80]; - const bit = r(62) ^ r(51) ^ r(38) ^ r(23) ^ r(13) ^ r(0); - state[pos] = bit; - pos = ++pos % 80; - return !!bit; - }; - for (let i = 0; i < 160; i++) - getBit(); - return () => { - // https://en.wikipedia.org/wiki/Shrinking_generator - while (true) { - const b1 = getBit(); - const b2 = getBit(); - if (!b1) - continue; - return b2; - } - }; -} -function assertValidPosOpts(opts) { - const { Fp, roundsFull } = opts; - validateField(Fp); - validateObject(opts, { - t: 'number', - roundsFull: 'number', - roundsPartial: 'number', - }, { - isSboxInverse: 'boolean', - }); - for (const k of ['t', 'roundsFull', 'roundsPartial']) { - asafenumber(opts[k], k); - if (opts[k] < 1) - throw new Error('invalid number ' + k); - } - if (roundsFull & 1) - throw new Error('roundsFull is not even' + roundsFull); -} -function poseidonGrain(opts) { - assertValidPosOpts(opts); - const { Fp } = opts; - const state = Array(80).fill(1); - let pos = 0; - const writeBits = (value, bitCount) => { - for (let i = bitCount - 1; i >= 0; i--) - state[pos++] = Number(bitGet(value, i)); - }; - const _0n = BigInt(0); - const _1n = BigInt(1); - writeBits(_1n, 2); // prime field - writeBits(opts.isSboxInverse ? _1n : _0n, 4); // b2..b5 - writeBits(BigInt(Fp.BITS), 12); // b6..b17 - writeBits(BigInt(opts.t), 12); // b18..b29 - writeBits(BigInt(opts.roundsFull), 10); // b30..b39 - writeBits(BigInt(opts.roundsPartial), 10); // b40..b49 - const getBit = grainLFSR(state); - return (count, reject) => { - const res = []; - for (let i = 0; i < count; i++) { - while (true) { - let num = _0n; - for (let i = 0; i < Fp.BITS; i++) { - num <<= _1n; - if (getBit()) - num |= _1n; - } - if (reject && num >= Fp.ORDER) - continue; // rejection sampling - res.push(Fp.create(num)); - break; - } - } - return res; - }; -} -// NOTE: this is not standard but used often for constant generation for poseidon -// (grain LFRS-like structure) -export function grainGenConstants(opts, skipMDS = 0) { - const { Fp, t, roundsFull, roundsPartial } = opts; - const rounds = roundsFull + roundsPartial; - const sample = poseidonGrain(opts); - const roundConstants = []; - for (let r = 0; r < rounds; r++) - roundConstants.push(sample(t, true)); - if (skipMDS > 0) - for (let i = 0; i < skipMDS; i++) - sample(2 * t, false); - const xs = sample(t, false); - const ys = sample(t, false); - // Construct MDS Matrix M[i][j] = 1 / (xs[i] + ys[j]) - const mds = []; - for (let i = 0; i < t; i++) { - const row = []; - for (let j = 0; j < t; j++) { - const xy = Fp.add(xs[i], ys[j]); - if (Fp.is0(xy)) - throw new Error(`Error generating MDS matrix: xs[${i}] + ys[${j}] resulted in zero.`); - row.push(xy); - } - mds.push(FpInvertBatch(Fp, row)); - } - return { roundConstants, mds }; -} -export function validateOpts(opts) { - assertValidPosOpts(opts); - const { Fp, mds, reversePartialPowIdx: rev, roundConstants: rc } = opts; - const { roundsFull, roundsPartial, sboxPower, t } = opts; - // MDS is TxT matrix - if (!Array.isArray(mds) || mds.length !== t) - throw new Error('Poseidon: invalid MDS matrix'); - const _mds = mds.map((mdsRow) => { - if (!Array.isArray(mdsRow) || mdsRow.length !== t) - throw new Error('invalid MDS matrix row: ' + mdsRow); - return mdsRow.map((i) => { - if (typeof i !== 'bigint') - throw new Error('invalid MDS matrix bigint: ' + i); - return Fp.create(i); - }); - }); - if (rev !== undefined && typeof rev !== 'boolean') - throw new Error('invalid param reversePartialPowIdx=' + rev); - if (roundsFull & 1) - throw new Error('roundsFull is not even' + roundsFull); - const rounds = roundsFull + roundsPartial; - if (!Array.isArray(rc) || rc.length !== rounds) - throw new Error('Poseidon: invalid round constants'); - const roundConstants = rc.map((rc) => { - if (!Array.isArray(rc) || rc.length !== t) - throw new Error('invalid round constants'); - return rc.map((i) => { - if (typeof i !== 'bigint' || !Fp.isValid(i)) - throw new Error('invalid round constant'); - return Fp.create(i); - }); - }); - if (!sboxPower || ![3, 5, 7, 17].includes(sboxPower)) - throw new Error('invalid sboxPower'); - const _sboxPower = BigInt(sboxPower); - let sboxFn = (n) => FpPow(Fp, n, _sboxPower); - // Unwrapped sbox power for common cases (195->142μs) - if (sboxPower === 3) - sboxFn = (n) => Fp.mul(Fp.sqrN(n), n); - else if (sboxPower === 5) - sboxFn = (n) => Fp.mul(Fp.sqrN(Fp.sqrN(n)), n); - return Object.freeze({ ...opts, rounds, sboxFn, roundConstants, mds: _mds }); -} -export function splitConstants(rc, t) { - if (typeof t !== 'number') - throw new Error('poseidonSplitConstants: invalid t'); - if (!Array.isArray(rc) || rc.length % t) - throw new Error('poseidonSplitConstants: invalid rc'); - const res = []; - let tmp = []; - for (let i = 0; i < rc.length; i++) { - tmp.push(rc[i]); - if (tmp.length === t) { - res.push(tmp); - tmp = []; - } - } - return res; -} -/** Poseidon NTT-friendly hash. */ -export function poseidon(opts) { - const _opts = validateOpts(opts); - const { Fp, mds, roundConstants, rounds: totalRounds, roundsPartial, sboxFn, t } = _opts; - const halfRoundsFull = _opts.roundsFull / 2; - const partialIdx = _opts.reversePartialPowIdx ? t - 1 : 0; - const poseidonRound = (values, isFull, idx) => { - values = values.map((i, j) => Fp.add(i, roundConstants[idx][j])); - if (isFull) - values = values.map((i) => sboxFn(i)); - else - values[partialIdx] = sboxFn(values[partialIdx]); - // Matrix multiplication - values = mds.map((i) => i.reduce((acc, i, j) => Fp.add(acc, Fp.mulN(i, values[j])), Fp.ZERO)); - return values; - }; - const poseidonHash = function poseidonHash(values) { - if (!Array.isArray(values) || values.length !== t) - throw new Error('invalid values, expected array of bigints with length ' + t); - values = values.map((i) => { - if (typeof i !== 'bigint') - throw new Error('invalid bigint=' + i); - return Fp.create(i); - }); - let lastRound = 0; - // Apply r_f/2 full rounds. - for (let i = 0; i < halfRoundsFull; i++) - values = poseidonRound(values, true, lastRound++); - // Apply r_p partial rounds. - for (let i = 0; i < roundsPartial; i++) - values = poseidonRound(values, false, lastRound++); - // Apply r_f/2 full rounds. - for (let i = 0; i < halfRoundsFull; i++) - values = poseidonRound(values, true, lastRound++); - if (lastRound !== totalRounds) - throw new Error('invalid number of rounds'); - return values; - }; - // For verification in tests - poseidonHash.roundConstants = roundConstants; - return poseidonHash; -} -export class PoseidonSponge { - Fp; - rate; - capacity; - hash; - state; // [...capacity, ...rate] - pos = 0; - isAbsorbing = true; - constructor(Fp, rate, capacity, hash) { - this.Fp = Fp; - this.hash = hash; - this.rate = rate; - this.capacity = capacity; - this.state = new Array(rate + capacity); - this.clean(); - } - process() { - this.state = this.hash(this.state); - } - absorb(input) { - for (const i of input) - if (typeof i !== 'bigint' || !this.Fp.isValid(i)) - throw new Error('invalid input: ' + i); - for (let i = 0; i < input.length;) { - if (!this.isAbsorbing || this.pos === this.rate) { - this.process(); - this.pos = 0; - this.isAbsorbing = true; - } - const chunk = Math.min(this.rate - this.pos, input.length - i); - for (let j = 0; j < chunk; j++) { - const idx = this.capacity + this.pos++; - this.state[idx] = this.Fp.add(this.state[idx], input[i++]); - } - } - } - squeeze(count) { - const res = []; - while (res.length < count) { - if (this.isAbsorbing || this.pos === this.rate) { - this.process(); - this.pos = 0; - this.isAbsorbing = false; - } - const chunk = Math.min(this.rate - this.pos, count - res.length); - for (let i = 0; i < chunk; i++) - res.push(this.state[this.capacity + this.pos++]); - } - return res; - } - clean() { - this.state.fill(this.Fp.ZERO); - this.isAbsorbing = true; - this.pos = 0; - } - clone() { - const c = new PoseidonSponge(this.Fp, this.rate, this.capacity, this.hash); - c.pos = this.pos; - c.state = [...this.state]; - return c; - } -} -/** - * The method is not defined in spec, but nevertheless used often. - * Check carefully for compatibility: there are many edge cases, like absorbing an empty array. - * We cross-test against: - * - https://github.com/ProvableHQ/snarkVM/tree/staging/algorithms - * - https://github.com/arkworks-rs/crypto-primitives/tree/main - */ -export function poseidonSponge(opts) { - for (const k of ['rate', 'capacity']) - asafenumber(opts[k], k); - const { rate, capacity } = opts; - const t = opts.rate + opts.capacity; - // Re-use hash instance between multiple instances - const hash = poseidon({ ...opts, t }); - const { Fp } = opts; - return () => new PoseidonSponge(Fp, rate, capacity, hash); -} -//# sourceMappingURL=poseidon.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/poseidon.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/poseidon.js.map deleted file mode 100644 index 90813b78..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/poseidon.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"poseidon.js","sourceRoot":"","sources":["../src/abstract/poseidon.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,sEAAsE;AACtE,OAAO,EAAE,WAA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AC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;QAC9B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC;IACf,CAAC;IACD,KAAK;QACH,MAAM,CAAC,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3E,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;QACjB,CAAC,CAAC,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;QAC1B,OAAO,CAAC,CAAC;IACX,CAAC;CACF;AAOD;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,IAAwB;IACrD,KAAK,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAU;QAAE,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACvE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IAChC,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC;IACpC,kDAAkD;IAClD,MAAM,IAAI,GAAG,QAAQ,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;IACtC,MAAM,EAAE,EAAE,EAAE,GAAG,IAAI,CAAC;IACpB,OAAO,GAAG,EAAE,CAAC,IAAI,cAAc,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;AAC5D,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/tower.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/tower.d.ts deleted file mode 100644 index 262e04ac..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/tower.d.ts +++ /dev/null @@ -1,95 +0,0 @@ -import * as mod from './modular.ts'; -import type { WeierstrassPoint, WeierstrassPointCons } from './weierstrass.ts'; -export type BigintTuple = [bigint, bigint]; -export type Fp = bigint; -export type Fp2 = { - c0: bigint; - c1: bigint; -}; -export type BigintSix = [bigint, bigint, bigint, bigint, bigint, bigint]; -export type Fp6 = { - c0: Fp2; - c1: Fp2; - c2: Fp2; -}; -export type Fp12 = { - c0: Fp6; - c1: Fp6; -}; -export type BigintTwelve = [ - bigint, - bigint, - bigint, - bigint, - bigint, - bigint, - bigint, - bigint, - bigint, - bigint, - bigint, - bigint -]; -export type Fp2Bls = mod.IField & { - Fp: mod.IField; - frobeniusMap(num: Fp2, power: number): Fp2; - fromBigTuple(num: BigintTuple): Fp2; - mulByB: (num: Fp2) => Fp2; - mulByNonresidue: (num: Fp2) => Fp2; - reim: (num: Fp2) => { - re: Fp; - im: Fp; - }; - Fp4Square: (a: Fp2, b: Fp2) => { - first: Fp2; - second: Fp2; - }; - NONRESIDUE: Fp2; -}; -export type Fp6Bls = mod.IField & { - Fp2: Fp2Bls; - frobeniusMap(num: Fp6, power: number): Fp6; - fromBigSix: (tuple: BigintSix) => Fp6; - mul1(num: Fp6, b1: Fp2): Fp6; - mul01(num: Fp6, b0: Fp2, b1: Fp2): Fp6; - mulByFp2(lhs: Fp6, rhs: Fp2): Fp6; - mulByNonresidue: (num: Fp6) => Fp6; -}; -export type Fp12Bls = mod.IField & { - Fp6: Fp6Bls; - frobeniusMap(num: Fp12, power: number): Fp12; - fromBigTwelve: (t: BigintTwelve) => Fp12; - mul014(num: Fp12, o0: Fp2, o1: Fp2, o4: Fp2): Fp12; - mul034(num: Fp12, o0: Fp2, o3: Fp2, o4: Fp2): Fp12; - mulByFp2(lhs: Fp12, rhs: Fp2): Fp12; - conjugate(num: Fp12): Fp12; - finalExponentiate(num: Fp12): Fp12; - _cyclotomicSquare(num: Fp12): Fp12; - _cyclotomicExp(num: Fp12, n: bigint): Fp12; -}; -export declare function psiFrobenius(Fp: mod.IField, Fp2: Fp2Bls, base: Fp2): { - psi: (x: Fp2, y: Fp2) => [Fp2, Fp2]; - psi2: (x: Fp2, y: Fp2) => [Fp2, Fp2]; - G2psi: (c: WeierstrassPointCons, P: WeierstrassPoint) => WeierstrassPoint; - G2psi2: (c: WeierstrassPointCons, P: WeierstrassPoint) => WeierstrassPoint; - PSI_X: Fp2; - PSI_Y: Fp2; - PSI2_X: Fp2; - PSI2_Y: Fp2; -}; -export type Tower12Opts = { - ORDER: bigint; - X_LEN: number; - NONRESIDUE?: Fp; - FP2_NONRESIDUE: BigintTuple; - Fp2sqrt?: (num: Fp2) => Fp2; - Fp2mulByB: (num: Fp2) => Fp2; - Fp12finalExponentiate: (num: Fp12) => Fp12; -}; -export declare function tower12(opts: Tower12Opts): { - Fp: Readonly & Required, 'isOdd'>>>; - Fp2: Fp2Bls; - Fp6: Fp6Bls; - Fp12: Fp12Bls; -}; -//# sourceMappingURL=tower.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/tower.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/tower.d.ts.map deleted file mode 100644 index dd2d2f9d..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/tower.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tower.d.ts","sourceRoot":"","sources":["../src/abstract/tower.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAO/E,MAAM,MAAM,WAAW,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC3C,MAAM,MAAM,EAAE,GAAG,MAAM,CAAC;AAGxB,MAAM,MAAM,GAAG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,GAAG,CAAC;IAC5B,SAAS,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,CAAC;IAC7B,qBAAqB,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,IAAI,CAAC;CAC5C,CAAC;AAisBF,wBAAgB,OAAO,CAAC,IAAI,EAAE,WAAW,GAAG;IAC1C,EAAE,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAC/E,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,OAAO,CAAC;CACf,CAMA"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/tower.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/tower.js deleted file mode 100644 index 3d8d133b..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/tower.js +++ /dev/null @@ -1,742 +0,0 @@ -/** - * Towered extension fields. - * Rather than implementing a massive 12th-degree extension directly, it is more efficient - * to build it up from smaller extensions: a tower of extensions. - * - * For BLS12-381, the Fp12 field is implemented as a quadratic (degree two) extension, - * on top of a cubic (degree three) extension, on top of a quadratic extension of Fp. - * - * For more info: "Pairings for beginners" by Costello, section 7.3. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { bitGet, bitLen, concatBytes, notImplemented } from "../utils.js"; -import * as mod from "./modular.js"; -// Be friendly to bad ECMAScript parsers by not using bigint literals -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3); -function calcFrobeniusCoefficients(Fp, nonResidue, modulus, degree, num = 1, divisor) { - const _divisor = BigInt(divisor === undefined ? degree : divisor); - const towerModulus = modulus ** BigInt(degree); - const res = []; - for (let i = 0; i < num; i++) { - const a = BigInt(i + 1); - const powers = []; - for (let j = 0, qPower = _1n; j < degree; j++) { - const power = ((a * qPower - a) / _divisor) % towerModulus; - powers.push(Fp.pow(nonResidue, power)); - qPower *= modulus; - } - res.push(powers); - } - return res; -} -// This works same at least for bls12-381, bn254 and bls12-377 -export function psiFrobenius(Fp, Fp2, base) { - // GLV endomorphism Ψ(P) - const PSI_X = Fp2.pow(base, (Fp.ORDER - _1n) / _3n); // u^((p-1)/3) - const PSI_Y = Fp2.pow(base, (Fp.ORDER - _1n) / _2n); // u^((p-1)/2) - function psi(x, y) { - // This x10 faster than previous version in bls12-381 - const x2 = Fp2.mul(Fp2.frobeniusMap(x, 1), PSI_X); - const y2 = Fp2.mul(Fp2.frobeniusMap(y, 1), PSI_Y); - return [x2, y2]; - } - // Ψ²(P) endomorphism (psi2(x) = psi(psi(x))) - const PSI2_X = Fp2.pow(base, (Fp.ORDER ** _2n - _1n) / _3n); // u^((p^2 - 1)/3) - // This equals -1, which causes y to be Fp2.neg(y). - // But not sure if there are case when this is not true? - const PSI2_Y = Fp2.pow(base, (Fp.ORDER ** _2n - _1n) / _2n); // u^((p^2 - 1)/3) - if (!Fp2.eql(PSI2_Y, Fp2.neg(Fp2.ONE))) - throw new Error('psiFrobenius: PSI2_Y!==-1'); - function psi2(x, y) { - return [Fp2.mul(x, PSI2_X), Fp2.neg(y)]; - } - // Map points - const mapAffine = (fn) => (c, P) => { - const affine = P.toAffine(); - const p = fn(affine.x, affine.y); - return c.fromAffine({ x: p[0], y: p[1] }); - }; - const G2psi = mapAffine(psi); - const G2psi2 = mapAffine(psi2); - return { psi, psi2, G2psi, G2psi2, PSI_X, PSI_Y, PSI2_X, PSI2_Y }; -} -const Fp2fromBigTuple = (Fp, tuple) => { - if (tuple.length !== 2) - throw new Error('invalid tuple'); - const fps = tuple.map((n) => Fp.create(n)); - return { c0: fps[0], c1: fps[1] }; -}; -class _Field2 { - ORDER; - BITS; - BYTES; - isLE; - ZERO; - ONE; - Fp; - NONRESIDUE; - mulByB; - Fp_NONRESIDUE; - Fp_div2; - FROBENIUS_COEFFICIENTS; - constructor(Fp, opts = {}) { - const ORDER = Fp.ORDER; - const FP2_ORDER = ORDER * ORDER; - this.Fp = Fp; - this.ORDER = FP2_ORDER; - this.BITS = bitLen(FP2_ORDER); - this.BYTES = Math.ceil(bitLen(FP2_ORDER) / 8); - this.isLE = Fp.isLE; - this.ZERO = { c0: Fp.ZERO, c1: Fp.ZERO }; - this.ONE = { c0: Fp.ONE, c1: Fp.ZERO }; - this.Fp_NONRESIDUE = Fp.create(opts.NONRESIDUE || BigInt(-1)); - this.Fp_div2 = Fp.div(Fp.ONE, _2n); // 1/2 - this.NONRESIDUE = Fp2fromBigTuple(Fp, opts.FP2_NONRESIDUE); - // const Fp2Nonresidue = Fp2fromBigTuple(opts.FP2_NONRESIDUE); - this.FROBENIUS_COEFFICIENTS = calcFrobeniusCoefficients(Fp, this.Fp_NONRESIDUE, Fp.ORDER, 2)[0]; - this.mulByB = opts.Fp2mulByB; - Object.seal(this); - } - fromBigTuple(tuple) { - return Fp2fromBigTuple(this.Fp, tuple); - } - create(num) { - return num; - } - isValid({ c0, c1 }) { - function isValidC(num, ORDER) { - return typeof num === 'bigint' && _0n <= num && num < ORDER; - } - return isValidC(c0, this.ORDER) && isValidC(c1, this.ORDER); - } - is0({ c0, c1 }) { - return this.Fp.is0(c0) && this.Fp.is0(c1); - } - isValidNot0(num) { - return !this.is0(num) && this.isValid(num); - } - eql({ c0, c1 }, { c0: r0, c1: r1 }) { - return this.Fp.eql(c0, r0) && this.Fp.eql(c1, r1); - } - neg({ c0, c1 }) { - return { c0: this.Fp.neg(c0), c1: this.Fp.neg(c1) }; - } - pow(num, power) { - return mod.FpPow(this, num, power); - } - invertBatch(nums) { - return mod.FpInvertBatch(this, nums); - } - // Normalized - add(f1, f2) { - const { c0, c1 } = f1; - const { c0: r0, c1: r1 } = f2; - return { - c0: this.Fp.add(c0, r0), - c1: this.Fp.add(c1, r1), - }; - } - sub({ c0, c1 }, { c0: r0, c1: r1 }) { - return { - c0: this.Fp.sub(c0, r0), - c1: this.Fp.sub(c1, r1), - }; - } - mul({ c0, c1 }, rhs) { - const { Fp } = this; - if (typeof rhs === 'bigint') - return { c0: Fp.mul(c0, rhs), c1: Fp.mul(c1, rhs) }; - // (a+bi)(c+di) = (ac−bd) + (ad+bc)i - const { c0: r0, c1: r1 } = rhs; - let t1 = Fp.mul(c0, r0); // c0 * o0 - let t2 = Fp.mul(c1, r1); // c1 * o1 - // (T1 - T2) + ((c0 + c1) * (r0 + r1) - (T1 + T2))*i - const o0 = Fp.sub(t1, t2); - const o1 = Fp.sub(Fp.mul(Fp.add(c0, c1), Fp.add(r0, r1)), Fp.add(t1, t2)); - return { c0: o0, c1: o1 }; - } - sqr({ c0, c1 }) { - const { Fp } = this; - const a = Fp.add(c0, c1); - const b = Fp.sub(c0, c1); - const c = Fp.add(c0, c0); - return { c0: Fp.mul(a, b), c1: Fp.mul(c, c1) }; - } - // NonNormalized stuff - addN(a, b) { - return this.add(a, b); - } - subN(a, b) { - return this.sub(a, b); - } - mulN(a, b) { - return this.mul(a, b); - } - sqrN(a) { - return this.sqr(a); - } - // Why inversion for bigint inside Fp instead of Fp2? it is even used in that context? - div(lhs, rhs) { - const { Fp } = this; - // @ts-ignore - return this.mul(lhs, typeof rhs === 'bigint' ? Fp.inv(Fp.create(rhs)) : this.inv(rhs)); - } - inv({ c0: a, c1: b }) { - // We wish to find the multiplicative inverse of a nonzero - // element a + bu in Fp2. We leverage an identity - // - // (a + bu)(a - bu) = a² + b² - // - // which holds because u² = -1. This can be rewritten as - // - // (a + bu)(a - bu)/(a² + b²) = 1 - // - // because a² + b² = 0 has no nonzero solutions for (a, b). - // This gives that (a - bu)/(a² + b²) is the inverse - // of (a + bu). Importantly, this can be computing using - // only a single inversion in Fp. - const { Fp } = this; - const factor = Fp.inv(Fp.create(a * a + b * b)); - return { c0: Fp.mul(factor, Fp.create(a)), c1: Fp.mul(factor, Fp.create(-b)) }; - } - sqrt(num) { - // This is generic for all quadratic extensions (Fp2) - const { Fp } = this; - const Fp2 = this; - const { c0, c1 } = num; - if (Fp.is0(c1)) { - // if c0 is quadratic residue - if (mod.FpLegendre(Fp, c0) === 1) - return Fp2.create({ c0: Fp.sqrt(c0), c1: Fp.ZERO }); - else - return Fp2.create({ c0: Fp.ZERO, c1: Fp.sqrt(Fp.div(c0, this.Fp_NONRESIDUE)) }); - } - const a = Fp.sqrt(Fp.sub(Fp.sqr(c0), Fp.mul(Fp.sqr(c1), this.Fp_NONRESIDUE))); - let d = Fp.mul(Fp.add(a, c0), this.Fp_div2); - const legendre = mod.FpLegendre(Fp, d); - // -1, Quadratic non residue - if (legendre === -1) - d = Fp.sub(d, a); - const a0 = Fp.sqrt(d); - const candidateSqrt = Fp2.create({ c0: a0, c1: Fp.div(Fp.mul(c1, this.Fp_div2), a0) }); - if (!Fp2.eql(Fp2.sqr(candidateSqrt), num)) - throw new Error('Cannot find square root'); - // Normalize root: at this point candidateSqrt ** 2 = num, but also -candidateSqrt ** 2 = num - const x1 = candidateSqrt; - const x2 = Fp2.neg(x1); - const { re: re1, im: im1 } = Fp2.reim(x1); - const { re: re2, im: im2 } = Fp2.reim(x2); - if (im1 > im2 || (im1 === im2 && re1 > re2)) - return x1; - return x2; - } - // Same as sgn0_m_eq_2 in RFC 9380 - isOdd(x) { - const { re: x0, im: x1 } = this.reim(x); - const sign_0 = x0 % _2n; - const zero_0 = x0 === _0n; - const sign_1 = x1 % _2n; - return BigInt(sign_0 || (zero_0 && sign_1)) == _1n; - } - // Bytes util - fromBytes(b) { - const { Fp } = this; - if (b.length !== this.BYTES) - throw new Error('fromBytes invalid length=' + b.length); - return { c0: Fp.fromBytes(b.subarray(0, Fp.BYTES)), c1: Fp.fromBytes(b.subarray(Fp.BYTES)) }; - } - toBytes({ c0, c1 }) { - return concatBytes(this.Fp.toBytes(c0), this.Fp.toBytes(c1)); - } - cmov({ c0, c1 }, { c0: r0, c1: r1 }, c) { - return { - c0: this.Fp.cmov(c0, r0, c), - c1: this.Fp.cmov(c1, r1, c), - }; - } - reim({ c0, c1 }) { - return { re: c0, im: c1 }; - } - Fp4Square(a, b) { - const Fp2 = this; - const a2 = Fp2.sqr(a); - const b2 = Fp2.sqr(b); - return { - first: Fp2.add(Fp2.mulByNonresidue(b2), a2), // b² * Nonresidue + a² - second: Fp2.sub(Fp2.sub(Fp2.sqr(Fp2.add(a, b)), a2), b2), // (a + b)² - a² - b² - }; - } - // multiply by u + 1 - mulByNonresidue({ c0, c1 }) { - return this.mul({ c0, c1 }, this.NONRESIDUE); - } - frobeniusMap({ c0, c1 }, power) { - return { - c0, - c1: this.Fp.mul(c1, this.FROBENIUS_COEFFICIENTS[power % 2]), - }; - } -} -class _Field6 { - ORDER; - BITS; - BYTES; - isLE; - ZERO; - ONE; - Fp2; - FROBENIUS_COEFFICIENTS_1; - FROBENIUS_COEFFICIENTS_2; - constructor(Fp2) { - this.Fp2 = Fp2; - this.ORDER = Fp2.ORDER; // TODO: unused, but need to verify - this.BITS = 3 * Fp2.BITS; - this.BYTES = 3 * Fp2.BYTES; - this.isLE = Fp2.isLE; - this.ZERO = { c0: Fp2.ZERO, c1: Fp2.ZERO, c2: Fp2.ZERO }; - this.ONE = { c0: Fp2.ONE, c1: Fp2.ZERO, c2: Fp2.ZERO }; - const { Fp } = Fp2; - const frob = calcFrobeniusCoefficients(Fp2, Fp2.NONRESIDUE, Fp.ORDER, 6, 2, 3); - this.FROBENIUS_COEFFICIENTS_1 = frob[0]; - this.FROBENIUS_COEFFICIENTS_2 = frob[1]; - Object.seal(this); - } - add({ c0, c1, c2 }, { c0: r0, c1: r1, c2: r2 }) { - const { Fp2 } = this; - return { - c0: Fp2.add(c0, r0), - c1: Fp2.add(c1, r1), - c2: Fp2.add(c2, r2), - }; - } - sub({ c0, c1, c2 }, { c0: r0, c1: r1, c2: r2 }) { - const { Fp2 } = this; - return { - c0: Fp2.sub(c0, r0), - c1: Fp2.sub(c1, r1), - c2: Fp2.sub(c2, r2), - }; - } - mul({ c0, c1, c2 }, rhs) { - const { Fp2 } = this; - if (typeof rhs === 'bigint') { - return { - c0: Fp2.mul(c0, rhs), - c1: Fp2.mul(c1, rhs), - c2: Fp2.mul(c2, rhs), - }; - } - const { c0: r0, c1: r1, c2: r2 } = rhs; - const t0 = Fp2.mul(c0, r0); // c0 * o0 - const t1 = Fp2.mul(c1, r1); // c1 * o1 - const t2 = Fp2.mul(c2, r2); // c2 * o2 - return { - // t0 + (c1 + c2) * (r1 * r2) - (T1 + T2) * (u + 1) - c0: Fp2.add(t0, Fp2.mulByNonresidue(Fp2.sub(Fp2.mul(Fp2.add(c1, c2), Fp2.add(r1, r2)), Fp2.add(t1, t2)))), - // (c0 + c1) * (r0 + r1) - (T0 + T1) + T2 * (u + 1) - c1: Fp2.add(Fp2.sub(Fp2.mul(Fp2.add(c0, c1), Fp2.add(r0, r1)), Fp2.add(t0, t1)), Fp2.mulByNonresidue(t2)), - // T1 + (c0 + c2) * (r0 + r2) - T0 + T2 - c2: Fp2.sub(Fp2.add(t1, Fp2.mul(Fp2.add(c0, c2), Fp2.add(r0, r2))), Fp2.add(t0, t2)), - }; - } - sqr({ c0, c1, c2 }) { - const { Fp2 } = this; - let t0 = Fp2.sqr(c0); // c0² - let t1 = Fp2.mul(Fp2.mul(c0, c1), _2n); // 2 * c0 * c1 - let t3 = Fp2.mul(Fp2.mul(c1, c2), _2n); // 2 * c1 * c2 - let t4 = Fp2.sqr(c2); // c2² - return { - c0: Fp2.add(Fp2.mulByNonresidue(t3), t0), // T3 * (u + 1) + T0 - c1: Fp2.add(Fp2.mulByNonresidue(t4), t1), // T4 * (u + 1) + T1 - // T1 + (c0 - c1 + c2)² + T3 - T0 - T4 - c2: Fp2.sub(Fp2.sub(Fp2.add(Fp2.add(t1, Fp2.sqr(Fp2.add(Fp2.sub(c0, c1), c2))), t3), t0), t4), - }; - } - addN(a, b) { - return this.add(a, b); - } - subN(a, b) { - return this.sub(a, b); - } - mulN(a, b) { - return this.mul(a, b); - } - sqrN(a) { - return this.sqr(a); - } - create(num) { - return num; - } - isValid({ c0, c1, c2 }) { - const { Fp2 } = this; - return Fp2.isValid(c0) && Fp2.isValid(c1) && Fp2.isValid(c2); - } - is0({ c0, c1, c2 }) { - const { Fp2 } = this; - return Fp2.is0(c0) && Fp2.is0(c1) && Fp2.is0(c2); - } - isValidNot0(num) { - return !this.is0(num) && this.isValid(num); - } - neg({ c0, c1, c2 }) { - const { Fp2 } = this; - return { c0: Fp2.neg(c0), c1: Fp2.neg(c1), c2: Fp2.neg(c2) }; - } - eql({ c0, c1, c2 }, { c0: r0, c1: r1, c2: r2 }) { - const { Fp2 } = this; - return Fp2.eql(c0, r0) && Fp2.eql(c1, r1) && Fp2.eql(c2, r2); - } - sqrt(_) { - return notImplemented(); - } - // Do we need division by bigint at all? Should be done via order: - div(lhs, rhs) { - const { Fp2 } = this; - const { Fp } = Fp2; - return this.mul(lhs, typeof rhs === 'bigint' ? Fp.inv(Fp.create(rhs)) : this.inv(rhs)); - } - pow(num, power) { - return mod.FpPow(this, num, power); - } - invertBatch(nums) { - return mod.FpInvertBatch(this, nums); - } - inv({ c0, c1, c2 }) { - const { Fp2 } = this; - let t0 = Fp2.sub(Fp2.sqr(c0), Fp2.mulByNonresidue(Fp2.mul(c2, c1))); // c0² - c2 * c1 * (u + 1) - let t1 = Fp2.sub(Fp2.mulByNonresidue(Fp2.sqr(c2)), Fp2.mul(c0, c1)); // c2² * (u + 1) - c0 * c1 - let t2 = Fp2.sub(Fp2.sqr(c1), Fp2.mul(c0, c2)); // c1² - c0 * c2 - // 1/(((c2 * T1 + c1 * T2) * v) + c0 * T0) - let t4 = Fp2.inv(Fp2.add(Fp2.mulByNonresidue(Fp2.add(Fp2.mul(c2, t1), Fp2.mul(c1, t2))), Fp2.mul(c0, t0))); - return { c0: Fp2.mul(t4, t0), c1: Fp2.mul(t4, t1), c2: Fp2.mul(t4, t2) }; - } - // Bytes utils - fromBytes(b) { - const { Fp2 } = this; - if (b.length !== this.BYTES) - throw new Error('fromBytes invalid length=' + b.length); - const B2 = Fp2.BYTES; - return { - c0: Fp2.fromBytes(b.subarray(0, B2)), - c1: Fp2.fromBytes(b.subarray(B2, B2 * 2)), - c2: Fp2.fromBytes(b.subarray(2 * B2)), - }; - } - toBytes({ c0, c1, c2 }) { - const { Fp2 } = this; - return concatBytes(Fp2.toBytes(c0), Fp2.toBytes(c1), Fp2.toBytes(c2)); - } - cmov({ c0, c1, c2 }, { c0: r0, c1: r1, c2: r2 }, c) { - const { Fp2 } = this; - return { - c0: Fp2.cmov(c0, r0, c), - c1: Fp2.cmov(c1, r1, c), - c2: Fp2.cmov(c2, r2, c), - }; - } - fromBigSix(t) { - const { Fp2 } = this; - if (!Array.isArray(t) || t.length !== 6) - throw new Error('invalid Fp6 usage'); - return { - c0: Fp2.fromBigTuple(t.slice(0, 2)), - c1: Fp2.fromBigTuple(t.slice(2, 4)), - c2: Fp2.fromBigTuple(t.slice(4, 6)), - }; - } - frobeniusMap({ c0, c1, c2 }, power) { - const { Fp2 } = this; - return { - c0: Fp2.frobeniusMap(c0, power), - c1: Fp2.mul(Fp2.frobeniusMap(c1, power), this.FROBENIUS_COEFFICIENTS_1[power % 6]), - c2: Fp2.mul(Fp2.frobeniusMap(c2, power), this.FROBENIUS_COEFFICIENTS_2[power % 6]), - }; - } - mulByFp2({ c0, c1, c2 }, rhs) { - const { Fp2 } = this; - return { - c0: Fp2.mul(c0, rhs), - c1: Fp2.mul(c1, rhs), - c2: Fp2.mul(c2, rhs), - }; - } - mulByNonresidue({ c0, c1, c2 }) { - const { Fp2 } = this; - return { c0: Fp2.mulByNonresidue(c2), c1: c0, c2: c1 }; - } - // Sparse multiplication - mul1({ c0, c1, c2 }, b1) { - const { Fp2 } = this; - return { - c0: Fp2.mulByNonresidue(Fp2.mul(c2, b1)), - c1: Fp2.mul(c0, b1), - c2: Fp2.mul(c1, b1), - }; - } - // Sparse multiplication - mul01({ c0, c1, c2 }, b0, b1) { - const { Fp2 } = this; - let t0 = Fp2.mul(c0, b0); // c0 * b0 - let t1 = Fp2.mul(c1, b1); // c1 * b1 - return { - // ((c1 + c2) * b1 - T1) * (u + 1) + T0 - c0: Fp2.add(Fp2.mulByNonresidue(Fp2.sub(Fp2.mul(Fp2.add(c1, c2), b1), t1)), t0), - // (b0 + b1) * (c0 + c1) - T0 - T1 - c1: Fp2.sub(Fp2.sub(Fp2.mul(Fp2.add(b0, b1), Fp2.add(c0, c1)), t0), t1), - // (c0 + c2) * b0 - T0 + T1 - c2: Fp2.add(Fp2.sub(Fp2.mul(Fp2.add(c0, c2), b0), t0), t1), - }; - } -} -class _Field12 { - ORDER; - BITS; - BYTES; - isLE; - ZERO; - ONE; - Fp6; - FROBENIUS_COEFFICIENTS; - X_LEN; - finalExponentiate; - constructor(Fp6, opts) { - const { Fp2 } = Fp6; - const { Fp } = Fp2; - this.Fp6 = Fp6; - this.ORDER = Fp2.ORDER; // TODO: verify if it's unuesd - this.BITS = 2 * Fp6.BITS; - this.BYTES = 2 * Fp6.BYTES; - this.isLE = Fp6.isLE; - this.ZERO = { c0: Fp6.ZERO, c1: Fp6.ZERO }; - this.ONE = { c0: Fp6.ONE, c1: Fp6.ZERO }; - this.FROBENIUS_COEFFICIENTS = calcFrobeniusCoefficients(Fp2, Fp2.NONRESIDUE, Fp.ORDER, 12, 1, 6)[0]; - this.X_LEN = opts.X_LEN; - this.finalExponentiate = opts.Fp12finalExponentiate; - } - create(num) { - return num; - } - isValid({ c0, c1 }) { - const { Fp6 } = this; - return Fp6.isValid(c0) && Fp6.isValid(c1); - } - is0({ c0, c1 }) { - const { Fp6 } = this; - return Fp6.is0(c0) && Fp6.is0(c1); - } - isValidNot0(num) { - return !this.is0(num) && this.isValid(num); - } - neg({ c0, c1 }) { - const { Fp6 } = this; - return { c0: Fp6.neg(c0), c1: Fp6.neg(c1) }; - } - eql({ c0, c1 }, { c0: r0, c1: r1 }) { - const { Fp6 } = this; - return Fp6.eql(c0, r0) && Fp6.eql(c1, r1); - } - sqrt(_) { - notImplemented(); - } - inv({ c0, c1 }) { - const { Fp6 } = this; - let t = Fp6.inv(Fp6.sub(Fp6.sqr(c0), Fp6.mulByNonresidue(Fp6.sqr(c1)))); // 1 / (c0² - c1² * v) - return { c0: Fp6.mul(c0, t), c1: Fp6.neg(Fp6.mul(c1, t)) }; // ((C0 * T) * T) + (-C1 * T) * w - } - div(lhs, rhs) { - const { Fp6 } = this; - const { Fp2 } = Fp6; - const { Fp } = Fp2; - return this.mul(lhs, typeof rhs === 'bigint' ? Fp.inv(Fp.create(rhs)) : this.inv(rhs)); - } - pow(num, power) { - return mod.FpPow(this, num, power); - } - invertBatch(nums) { - return mod.FpInvertBatch(this, nums); - } - // Normalized - add({ c0, c1 }, { c0: r0, c1: r1 }) { - const { Fp6 } = this; - return { - c0: Fp6.add(c0, r0), - c1: Fp6.add(c1, r1), - }; - } - sub({ c0, c1 }, { c0: r0, c1: r1 }) { - const { Fp6 } = this; - return { - c0: Fp6.sub(c0, r0), - c1: Fp6.sub(c1, r1), - }; - } - mul({ c0, c1 }, rhs) { - const { Fp6 } = this; - if (typeof rhs === 'bigint') - return { c0: Fp6.mul(c0, rhs), c1: Fp6.mul(c1, rhs) }; - let { c0: r0, c1: r1 } = rhs; - let t1 = Fp6.mul(c0, r0); // c0 * r0 - let t2 = Fp6.mul(c1, r1); // c1 * r1 - return { - c0: Fp6.add(t1, Fp6.mulByNonresidue(t2)), // T1 + T2 * v - // (c0 + c1) * (r0 + r1) - (T1 + T2) - c1: Fp6.sub(Fp6.mul(Fp6.add(c0, c1), Fp6.add(r0, r1)), Fp6.add(t1, t2)), - }; - } - sqr({ c0, c1 }) { - const { Fp6 } = this; - let ab = Fp6.mul(c0, c1); // c0 * c1 - return { - // (c1 * v + c0) * (c0 + c1) - AB - AB * v - c0: Fp6.sub(Fp6.sub(Fp6.mul(Fp6.add(Fp6.mulByNonresidue(c1), c0), Fp6.add(c0, c1)), ab), Fp6.mulByNonresidue(ab)), - c1: Fp6.add(ab, ab), - }; // AB + AB - } - // NonNormalized stuff - addN(a, b) { - return this.add(a, b); - } - subN(a, b) { - return this.sub(a, b); - } - mulN(a, b) { - return this.mul(a, b); - } - sqrN(a) { - return this.sqr(a); - } - // Bytes utils - fromBytes(b) { - const { Fp6 } = this; - if (b.length !== this.BYTES) - throw new Error('fromBytes invalid length=' + b.length); - return { - c0: Fp6.fromBytes(b.subarray(0, Fp6.BYTES)), - c1: Fp6.fromBytes(b.subarray(Fp6.BYTES)), - }; - } - toBytes({ c0, c1 }) { - const { Fp6 } = this; - return concatBytes(Fp6.toBytes(c0), Fp6.toBytes(c1)); - } - cmov({ c0, c1 }, { c0: r0, c1: r1 }, c) { - const { Fp6 } = this; - return { - c0: Fp6.cmov(c0, r0, c), - c1: Fp6.cmov(c1, r1, c), - }; - } - // Utils - // toString() { - // return '' + 'Fp12(' + this.c0 + this.c1 + '* w'); - // }, - // fromTuple(c: [Fp6, Fp6]) { - // return new Fp12(...c); - // } - fromBigTwelve(t) { - const { Fp6 } = this; - return { - c0: Fp6.fromBigSix(t.slice(0, 6)), - c1: Fp6.fromBigSix(t.slice(6, 12)), - }; - } - // Raises to q**i -th power - frobeniusMap(lhs, power) { - const { Fp6 } = this; - const { Fp2 } = Fp6; - const { c0, c1, c2 } = Fp6.frobeniusMap(lhs.c1, power); - const coeff = this.FROBENIUS_COEFFICIENTS[power % 12]; - return { - c0: Fp6.frobeniusMap(lhs.c0, power), - c1: Fp6.create({ - c0: Fp2.mul(c0, coeff), - c1: Fp2.mul(c1, coeff), - c2: Fp2.mul(c2, coeff), - }), - }; - } - mulByFp2({ c0, c1 }, rhs) { - const { Fp6 } = this; - return { - c0: Fp6.mulByFp2(c0, rhs), - c1: Fp6.mulByFp2(c1, rhs), - }; - } - conjugate({ c0, c1 }) { - return { c0, c1: this.Fp6.neg(c1) }; - } - // Sparse multiplication - mul014({ c0, c1 }, o0, o1, o4) { - const { Fp6 } = this; - const { Fp2 } = Fp6; - let t0 = Fp6.mul01(c0, o0, o1); - let t1 = Fp6.mul1(c1, o4); - return { - c0: Fp6.add(Fp6.mulByNonresidue(t1), t0), // T1 * v + T0 - // (c1 + c0) * [o0, o1+o4] - T0 - T1 - c1: Fp6.sub(Fp6.sub(Fp6.mul01(Fp6.add(c1, c0), o0, Fp2.add(o1, o4)), t0), t1), - }; - } - mul034({ c0, c1 }, o0, o3, o4) { - const { Fp6 } = this; - const { Fp2 } = Fp6; - const a = Fp6.create({ - c0: Fp2.mul(c0.c0, o0), - c1: Fp2.mul(c0.c1, o0), - c2: Fp2.mul(c0.c2, o0), - }); - const b = Fp6.mul01(c1, o3, o4); - const e = Fp6.mul01(Fp6.add(c0, c1), Fp2.add(o0, o3), o4); - return { - c0: Fp6.add(Fp6.mulByNonresidue(b), a), - c1: Fp6.sub(e, Fp6.add(a, b)), - }; - } - // A cyclotomic group is a subgroup of Fp^n defined by - // GΦₙ(p) = {α ∈ Fpⁿ : α^Φₙ(p) = 1} - // The result of any pairing is in a cyclotomic subgroup - // https://eprint.iacr.org/2009/565.pdf - // https://eprint.iacr.org/2010/354.pdf - _cyclotomicSquare({ c0, c1 }) { - const { Fp6 } = this; - const { Fp2 } = Fp6; - const { c0: c0c0, c1: c0c1, c2: c0c2 } = c0; - const { c0: c1c0, c1: c1c1, c2: c1c2 } = c1; - const { first: t3, second: t4 } = Fp2.Fp4Square(c0c0, c1c1); - const { first: t5, second: t6 } = Fp2.Fp4Square(c1c0, c0c2); - const { first: t7, second: t8 } = Fp2.Fp4Square(c0c1, c1c2); - const t9 = Fp2.mulByNonresidue(t8); // T8 * (u + 1) - return { - c0: Fp6.create({ - c0: Fp2.add(Fp2.mul(Fp2.sub(t3, c0c0), _2n), t3), // 2 * (T3 - c0c0) + T3 - c1: Fp2.add(Fp2.mul(Fp2.sub(t5, c0c1), _2n), t5), // 2 * (T5 - c0c1) + T5 - c2: Fp2.add(Fp2.mul(Fp2.sub(t7, c0c2), _2n), t7), - }), // 2 * (T7 - c0c2) + T7 - c1: Fp6.create({ - c0: Fp2.add(Fp2.mul(Fp2.add(t9, c1c0), _2n), t9), // 2 * (T9 + c1c0) + T9 - c1: Fp2.add(Fp2.mul(Fp2.add(t4, c1c1), _2n), t4), // 2 * (T4 + c1c1) + T4 - c2: Fp2.add(Fp2.mul(Fp2.add(t6, c1c2), _2n), t6), - }), - }; // 2 * (T6 + c1c2) + T6 - } - // https://eprint.iacr.org/2009/565.pdf - _cyclotomicExp(num, n) { - let z = this.ONE; - for (let i = this.X_LEN - 1; i >= 0; i--) { - z = this._cyclotomicSquare(z); - if (bitGet(n, i)) - z = this.mul(z, num); - } - return z; - } -} -export function tower12(opts) { - const Fp = mod.Field(opts.ORDER); - const Fp2 = new _Field2(Fp, opts); - const Fp6 = new _Field6(Fp2); - const Fp12 = new _Field12(Fp6, opts); - return { Fp, Fp2, Fp6, Fp12 }; -} -//# sourceMappingURL=tower.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/tower.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/tower.js.map deleted file mode 100644 index 75d72981..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/tower.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tower.js","sourceRoot":"","sources":["../src/abstract/tower.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,sEAAsE;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AAGpC,qEAAqE;AACrE,kBAAkB;AAClB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,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AC;YACzC,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;YAC9B,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;gBAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QACzC,CAAC;QACD,OAAO,CAAC,CAAC;IACX,CAAC;CACF;AAED,MAAM,UAAU,OAAO,CAAC,IAAiB;IAMvC,MAAM,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACjC,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IAClC,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IAC7B,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACrC,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;AAChC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/weierstrass.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/weierstrass.d.ts deleted file mode 100644 index 8faf4d5d..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/weierstrass.d.ts +++ /dev/null @@ -1,325 +0,0 @@ -import { type CHash } from '../utils.ts'; -import { type AffinePoint, type CurveLengths, type CurvePoint, type CurvePointCons } from './curve.ts'; -import { type IField } from './modular.ts'; -export type { AffinePoint }; -type EndoBasis = [[bigint, bigint], [bigint, bigint]]; -/** - * When Weierstrass curve has `a=0`, it becomes Koblitz curve. - * Koblitz curves allow using **efficiently-computable GLV endomorphism ψ**. - * Endomorphism uses 2x less RAM, speeds up precomputation by 2x and ECDH / key recovery by 20%. - * For precomputed wNAF it trades off 1/2 init time & 1/3 ram for 20% perf hit. - * - * Endomorphism consists of beta, lambda and splitScalar: - * - * 1. GLV endomorphism ψ transforms a point: `P = (x, y) ↦ ψ(P) = (β·x mod p, y)` - * 2. GLV scalar decomposition transforms a scalar: `k ≡ k₁ + k₂·λ (mod n)` - * 3. Then these are combined: `k·P = k₁·P + k₂·ψ(P)` - * 4. Two 128-bit point-by-scalar multiplications + one point addition is faster than - * one 256-bit multiplication. - * - * where - * * beta: β ∈ Fₚ with β³ = 1, β ≠ 1 - * * lambda: λ ∈ Fₙ with λ³ = 1, λ ≠ 1 - * * splitScalar decomposes k ↦ k₁, k₂, by using reduced basis vectors. - * Gauss lattice reduction calculates them from initial basis vectors `(n, 0), (-λ, 0)` - * - * Check out `test/misc/endomorphism.js` and - * [gist](https://gist.github.com/paulmillr/eb670806793e84df628a7c434a873066). - */ -export type EndomorphismOpts = { - beta: bigint; - basises?: EndoBasis; - splitScalar?: (k: bigint) => { - k1neg: boolean; - k1: bigint; - k2neg: boolean; - k2: bigint; - }; -}; -export type ScalarEndoParts = { - k1neg: boolean; - k1: bigint; - k2neg: boolean; - k2: bigint; -}; -/** - * Splits scalar for GLV endomorphism. - */ -export declare function _splitEndoScalar(k: bigint, basis: EndoBasis, n: bigint): ScalarEndoParts; -/** - * Option to enable hedged signatures with improved security. - * - * * Randomly generated k is bad, because broken CSPRNG would leak private keys. - * * Deterministic k (RFC6979) is better; but is suspectible to fault attacks. - * - * We allow using technique described in RFC6979 3.6: additional k', a.k.a. adding randomness - * to deterministic sig. If CSPRNG is broken & randomness is weak, it would STILL be as secure - * as ordinary sig without ExtraEntropy. - * - * * `true` means "fetch data, from CSPRNG, incorporate it into k generation" - * * `false` means "disable extra entropy, use purely deterministic k" - * * `Uint8Array` passed means "incorporate following data into k generation" - * - * https://paulmillr.com/posts/deterministic-signatures/ - */ -export type ECDSAExtraEntropy = boolean | Uint8Array; -/** - * - `compact` is the default format - * - `recovered` is the same as compact, but with an extra byte indicating recovery byte - * - `der` is ASN.1 DER encoding - */ -export type ECDSASignatureFormat = 'compact' | 'recovered' | 'der'; -/** - * - `prehash`: (default: true) indicates whether to do sha256(message). - * When a custom hash is used, it must be set to `false`. - */ -export type ECDSARecoverOpts = { - prehash?: boolean; -}; -/** - * - `prehash`: (default: true) indicates whether to do sha256(message). - * When a custom hash is used, it must be set to `false`. - * - `lowS`: (default: true) prohibits signatures which have (sig.s >= CURVE.n/2n). - * Compatible with BTC/ETH. Setting `lowS: false` allows to create malleable signatures, - * which is default openssl behavior. - * Non-malleable signatures can still be successfully verified in openssl. - * - `format`: (default: 'compact') 'compact' or 'recovered' with recovery byte - */ -export type ECDSAVerifyOpts = { - prehash?: boolean; - lowS?: boolean; - format?: ECDSASignatureFormat; -}; -/** - * - `prehash`: (default: true) indicates whether to do sha256(message). - * When a custom hash is used, it must be set to `false`. - * - `lowS`: (default: true) prohibits signatures which have (sig.s >= CURVE.n/2n). - * Compatible with BTC/ETH. Setting `lowS: false` allows to create malleable signatures, - * which is default openssl behavior. - * Non-malleable signatures can still be successfully verified in openssl. - * - `format`: (default: 'compact') 'compact' or 'recovered' with recovery byte - * - `extraEntropy`: (default: false) creates sigs with increased security, see {@link ECDSAExtraEntropy} - */ -export type ECDSASignOpts = { - prehash?: boolean; - lowS?: boolean; - format?: ECDSASignatureFormat; - extraEntropy?: ECDSAExtraEntropy; -}; -/** Instance methods for 3D XYZ projective points. */ -export interface WeierstrassPoint extends CurvePoint> { - /** projective X coordinate. Different from affine x. */ - readonly X: T; - /** projective Y coordinate. Different from affine y. */ - readonly Y: T; - /** projective z coordinate */ - readonly Z: T; - /** affine x coordinate. Different from projective X. */ - get x(): T; - /** affine y coordinate. Different from projective Y. */ - get y(): T; - /** Encodes point using IEEE P1363 (DER) encoding. First byte is 2/3/4. Default = isCompressed. */ - toBytes(isCompressed?: boolean): Uint8Array; - toHex(isCompressed?: boolean): string; -} -/** Static methods for 3D XYZ projective points. */ -export interface WeierstrassPointCons extends CurvePointCons> { - /** Does NOT validate if the point is valid. Use `.assertValidity()`. */ - new (X: T, Y: T, Z: T): WeierstrassPoint; - CURVE(): WeierstrassOpts; -} -/** - * Weierstrass curve options. - * - * * p: prime characteristic (order) of finite field, in which arithmetics is done - * * n: order of prime subgroup a.k.a total amount of valid curve points - * * h: cofactor, usually 1. h*n is group order; n is subgroup order - * * a: formula param, must be in field of p - * * b: formula param, must be in field of p - * * Gx: x coordinate of generator point a.k.a. base point - * * Gy: y coordinate of generator point - */ -export type WeierstrassOpts = Readonly<{ - p: bigint; - n: bigint; - h: bigint; - a: T; - b: T; - Gx: T; - Gy: T; -}>; -export type WeierstrassExtraOpts = Partial<{ - Fp: IField; - Fn: IField; - allowInfinityPoint: boolean; - endo: EndomorphismOpts; - isTorsionFree: (c: WeierstrassPointCons, point: WeierstrassPoint) => boolean; - clearCofactor: (c: WeierstrassPointCons, point: WeierstrassPoint) => WeierstrassPoint; - fromBytes: (bytes: Uint8Array) => AffinePoint; - toBytes: (c: WeierstrassPointCons, point: WeierstrassPoint, isCompressed: boolean) => Uint8Array; -}>; -/** - * Options for ECDSA signatures over a Weierstrass curve. - * - * * lowS: (default: true) whether produced / verified signatures occupy low half of ecdsaOpts.p. Prevents malleability. - * * hmac: (default: noble-hashes hmac) function, would be used to init hmac-drbg for k generation. - * * randomBytes: (default: webcrypto os-level CSPRNG) custom method for fetching secure randomness. - * * bits2int, bits2int_modN: used in sigs, sometimes overridden by curves - */ -export type ECDSAOpts = Partial<{ - lowS: boolean; - hmac: (key: Uint8Array, message: Uint8Array) => Uint8Array; - randomBytes: (bytesLength?: number) => Uint8Array; - bits2int: (bytes: Uint8Array) => bigint; - bits2int_modN: (bytes: Uint8Array) => bigint; -}>; -/** - * Elliptic Curve Diffie-Hellman interface. - * Provides keygen, secret-to-public conversion, calculating shared secrets. - */ -export interface ECDH { - keygen: (seed?: Uint8Array) => { - secretKey: Uint8Array; - publicKey: Uint8Array; - }; - getPublicKey: (secretKey: Uint8Array, isCompressed?: boolean) => Uint8Array; - getSharedSecret: (secretKeyA: Uint8Array, publicKeyB: Uint8Array, isCompressed?: boolean) => Uint8Array; - Point: WeierstrassPointCons; - utils: { - isValidSecretKey: (secretKey: Uint8Array) => boolean; - isValidPublicKey: (publicKey: Uint8Array, isCompressed?: boolean) => boolean; - randomSecretKey: (seed?: Uint8Array) => Uint8Array; - }; - lengths: CurveLengths; -} -/** - * ECDSA interface. - * Only supported for prime fields, not Fp2 (extension fields). - */ -export interface ECDSA extends ECDH { - sign: (message: Uint8Array, secretKey: Uint8Array, opts?: ECDSASignOpts) => Uint8Array; - verify: (signature: Uint8Array, message: Uint8Array, publicKey: Uint8Array, opts?: ECDSAVerifyOpts) => boolean; - recoverPublicKey(signature: Uint8Array, message: Uint8Array, opts?: ECDSARecoverOpts): Uint8Array; - Signature: ECDSASignatureCons; -} -export declare class DERErr extends Error { - constructor(m?: string); -} -export type IDER = { - Err: typeof DERErr; - _tlv: { - encode: (tag: number, data: string) => string; - decode(tag: number, data: Uint8Array): { - v: Uint8Array; - l: Uint8Array; - }; - }; - _int: { - encode(num: bigint): string; - decode(data: Uint8Array): bigint; - }; - toSig(hex: string | Uint8Array): { - r: bigint; - s: bigint; - }; - hexFromSig(sig: { - r: bigint; - s: bigint; - }): string; -}; -/** - * ASN.1 DER encoding utilities. ASN is very complex & fragile. Format: - * - * [0x30 (SEQUENCE), bytelength, 0x02 (INTEGER), intLength, R, 0x02 (INTEGER), intLength, S] - * - * Docs: https://letsencrypt.org/docs/a-warm-welcome-to-asn1-and-der/, https://luca.ntop.org/Teaching/Appunti/asn1.html - */ -export declare const DER: IDER; -/** - * Creates weierstrass Point constructor, based on specified curve options. - * - * See {@link WeierstrassOpts}. - * - * @example -```js -const opts = { - p: 0xfffffffffffffffffffffffffffffffeffffac73n, - n: 0x100000000000000000001b8fa16dfab9aca16b6b3n, - h: 1n, - a: 0n, - b: 7n, - Gx: 0x3b4c382ce37aa192a4019e763036f4f5dd4d7ebbn, - Gy: 0x938cf935318fdced6bc28286531733c3f03c4feen, -}; -const secp160k1_Point = weierstrass(opts); -``` - */ -export declare function weierstrass(params: WeierstrassOpts, extraOpts?: WeierstrassExtraOpts): WeierstrassPointCons; -/** Methods of ECDSA signature instance. */ -export interface ECDSASignature { - readonly r: bigint; - readonly s: bigint; - readonly recovery?: number; - addRecoveryBit(recovery: number): ECDSASignature & { - readonly recovery: number; - }; - hasHighS(): boolean; - recoverPublicKey(messageHash: Uint8Array): WeierstrassPoint; - toBytes(format?: string): Uint8Array; - toHex(format?: string): string; -} -/** Methods of ECDSA signature constructor. */ -export type ECDSASignatureCons = { - new (r: bigint, s: bigint, recovery?: number): ECDSASignature; - fromBytes(bytes: Uint8Array, format?: ECDSASignatureFormat): ECDSASignature; - fromHex(hex: string, format?: ECDSASignatureFormat): ECDSASignature; -}; -/** - * Implementation of the Shallue and van de Woestijne method for any weierstrass curve. - * TODO: check if there is a way to merge this with uvRatio in Edwards; move to modular. - * b = True and y = sqrt(u / v) if (u / v) is square in F, and - * b = False and y = sqrt(Z * (u / v)) otherwise. - * @param Fp - * @param Z - * @returns - */ -export declare function SWUFpSqrtRatio(Fp: IField, Z: T): (u: T, v: T) => { - isValid: boolean; - value: T; -}; -/** - * Simplified Shallue-van de Woestijne-Ulas Method - * https://www.rfc-editor.org/rfc/rfc9380#section-6.6.2 - */ -export declare function mapToCurveSimpleSWU(Fp: IField, opts: { - A: T; - B: T; - Z: T; -}): (u: T) => { - x: T; - y: T; -}; -/** - * Sometimes users only need getPublicKey, getSharedSecret, and secret key handling. - * This helper ensures no signature functionality is present. Less code, smaller bundle size. - */ -export declare function ecdh(Point: WeierstrassPointCons, ecdhOpts?: { - randomBytes?: (bytesLength?: number) => Uint8Array; -}): ECDH; -/** - * Creates ECDSA signing interface for given elliptic curve `Point` and `hash` function. - * - * @param Point created using {@link weierstrass} function - * @param hash used for 1) message prehash-ing 2) k generation in `sign`, using hmac_drbg(hash) - * @param ecdsaOpts rarely needed, see {@link ECDSAOpts} - * - * @example - * ```js - * const p256_Point = weierstrass(...); - * const p256_sha256 = ecdsa(p256_Point, sha256); - * const p256_sha224 = ecdsa(p256_Point, sha224); - * const p256_sha224_r = ecdsa(p256_Point, sha224, { randomBytes: (length) => { ... } }); - * ``` - */ -export declare function ecdsa(Point: WeierstrassPointCons, hash: CHash, ecdsaOpts?: ECDSAOpts): ECDSA; -//# sourceMappingURL=weierstrass.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/weierstrass.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/weierstrass.d.ts.map deleted file mode 100644 index 032ab5f6..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/weierstrass.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"weierstrass.d.ts","sourceRoot":"","sources":["../src/abstract/weierstrass.ts"],"names":[],"mappings":"AA6BA,OAAO,EAgBL,KAAK,KAAK,EAEX,MAAM,aAAa,CAAC;AACrB,OAAO,EAOL,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,cAAc,EACpB,MAAM,YAAY,CAAC;AACpB,OAAO,EAKL,KAAK,MAAM,EACZ,MAAM,cAAc,CAAC;AAEtB,YAAY,EAAE,WAAW,EAAE,CAAC;AAE5B,KAAK,SAAS,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AACtD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAC;QAAC,EAAE,EAAE,M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CAAC;IAC5E,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,oBAAoB,GAAG,cAAc,CAAC;CACrE,CAAC;AAOF;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAC9B,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,EACb,CAAC,EAAE,CAAC,GACH,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,CAmEhD;AACD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,EACb,IAAI,EAAE;IACJ,CAAC,EAAE,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,CAAC;CACN,GACA,CAAC,CAAC,EAAE,CAAC,KAAK;IAAE,CAAC,EAAE,CAAC,CAAC;IAAC,CAAC,EAAE,CAAC,CAAA;CAAE,CAwC1B;AAYD;;;GAGG;AACH,wBAAgB,IAAI,CAClB,KAAK,EAAE,oBAAoB,CAAC,MAAM,CAAC,EACnC,QAAQ,GAAE;IAAE,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,EAAE,MAAM,KAAK,UAAU,CAAA;CAAO,GACpE,IAAI,CAkFN;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,KAAK,CACnB,KAAK,EAAE,oBAAoB,CAAC,MAAM,CAAC,EACnC,IAAI,EAAE,KAAK,EACX,SAAS,GAAE,SAAc,GACxB,KAAK,CAyUP"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/weierstrass.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/weierstrass.js deleted file mode 100644 index 446fccbc..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/weierstrass.js +++ /dev/null @@ -1,1222 +0,0 @@ -/** - * Short Weierstrass curve methods. The formula is: y² = x³ + ax + b. - * - * ### Design rationale for types - * - * * Interaction between classes from different curves should fail: - * `k256.Point.BASE.add(p256.Point.BASE)` - * * For this purpose we want to use `instanceof` operator, which is fast and works during runtime - * * Different calls of `curve()` would return different classes - - * `curve(params) !== curve(params)`: if somebody decided to monkey-patch their curve, - * it won't affect others - * - * TypeScript can't infer types for classes created inside a function. Classes is one instance - * of nominative types in TypeScript and interfaces only check for shape, so it's hard to create - * unique type for every function call. - * - * We can use generic types via some param, like curve opts, but that would: - * 1. Enable interaction between `curve(params)` and `curve(params)` (curves of same params) - * which is hard to debug. - * 2. Params can be generic and we can't enforce them to be constant value: - * if somebody creates curve from non-constant params, - * it would be allowed to interact with other curves with non-constant params - * - * @todo https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html#unique-symbol - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { hmac as nobleHmac } from '@noble/hashes/hmac.js'; -import { ahash } from '@noble/hashes/utils.js'; -import { abool, abytes, aInRange, bitLen, bitMask, bytesToHex, bytesToNumberBE, concatBytes, createHmacDrbg, hexToBytes, isBytes, memoized, numberToHexUnpadded, validateObject, randomBytes as wcRandomBytes, } from "../utils.js"; -import { createCurveFields, createKeygen, mulEndoUnsafe, negateCt, normalizeZ, wNAF, } from "./curve.js"; -import { FpInvertBatch, getMinHashLength, mapHashToField, validateField, } from "./modular.js"; -// We construct basis in such way that den is always positive and equals n, but num sign depends on basis (not on secret value) -const divNearest = (num, den) => (num + (num >= 0 ? den : -den) / _2n) / den; -/** - * Splits scalar for GLV endomorphism. - */ -export function _splitEndoScalar(k, basis, n) { - // Split scalar into two such that part is ~half bits: `abs(part) < sqrt(N)` - // Since part can be negative, we need to do this on point. - // TODO: verifyScalar function which consumes lambda - const [[a1, b1], [a2, b2]] = basis; - const c1 = divNearest(b2 * k, n); - const c2 = divNearest(-b1 * k, n); - // |k1|/|k2| is < sqrt(N), but can be negative. - // If we do `k1 mod N`, we'll get big scalar (`> sqrt(N)`): so, we do cheaper negation instead. - let k1 = k - c1 * a1 - c2 * a2; - let k2 = -c1 * b1 - c2 * b2; - const k1neg = k1 < _0n; - const k2neg = k2 < _0n; - if (k1neg) - k1 = -k1; - if (k2neg) - k2 = -k2; - // Double check that resulting scalar less than half bits of N: otherwise wNAF will fail. - // This should only happen on wrong basises. Also, math inside is too complex and I don't trust it. - const MAX_NUM = bitMask(Math.ceil(bitLen(n) / 2)) + _1n; // Half bits of N - if (k1 < _0n || k1 >= MAX_NUM || k2 < _0n || k2 >= MAX_NUM) { - throw new Error('splitScalar (endomorphism): failed, k=' + k); - } - return { k1neg, k1, k2neg, k2 }; -} -function validateSigFormat(format) { - if (!['compact', 'recovered', 'der'].includes(format)) - throw new Error('Signature format must be "compact", "recovered", or "der"'); - return format; -} -function validateSigOpts(opts, def) { - const optsn = {}; - for (let optName of Object.keys(def)) { - // @ts-ignore - optsn[optName] = opts[optName] === undefined ? def[optName] : opts[optName]; - } - abool(optsn.lowS, 'lowS'); - abool(optsn.prehash, 'prehash'); - if (optsn.format !== undefined) - validateSigFormat(optsn.format); - return optsn; -} -export class DERErr extends Error { - constructor(m = '') { - super(m); - } -} -/** - * ASN.1 DER encoding utilities. ASN is very complex & fragile. Format: - * - * [0x30 (SEQUENCE), bytelength, 0x02 (INTEGER), intLength, R, 0x02 (INTEGER), intLength, S] - * - * Docs: https://letsencrypt.org/docs/a-warm-welcome-to-asn1-and-der/, https://luca.ntop.org/Teaching/Appunti/asn1.html - */ -export const DER = { - // asn.1 DER encoding utils - Err: DERErr, - // Basic building block is TLV (Tag-Length-Value) - _tlv: { - encode: (tag, data) => { - const { Err: E } = DER; - if (tag < 0 || tag > 256) - throw new E('tlv.encode: wrong tag'); - if (data.length & 1) - throw new E('tlv.encode: unpadded data'); - const dataLen = data.length / 2; - const len = numberToHexUnpadded(dataLen); - if ((len.length / 2) & 0b1000_0000) - throw new E('tlv.encode: long form length too big'); - // length of length with long form flag - const lenLen = dataLen > 127 ? numberToHexUnpadded((len.length / 2) | 0b1000_0000) : ''; - const t = numberToHexUnpadded(tag); - return t + lenLen + len + data; - }, - // v - value, l - left bytes (unparsed) - decode(tag, data) { - const { Err: E } = DER; - let pos = 0; - if (tag < 0 || tag > 256) - throw new E('tlv.encode: wrong tag'); - if (data.length < 2 || data[pos++] !== tag) - throw new E('tlv.decode: wrong tlv'); - const first = data[pos++]; - const isLong = !!(first & 0b1000_0000); // First bit of first length byte is flag for short/long form - let length = 0; - if (!isLong) - length = first; - else { - // Long form: [longFlag(1bit), lengthLength(7bit), length (BE)] - const lenLen = first & 0b0111_1111; - if (!lenLen) - throw new E('tlv.decode(long): indefinite length not supported'); - if (lenLen > 4) - throw new E('tlv.decode(long): byte length is too big'); // this will overflow u32 in js - const lengthBytes = data.subarray(pos, pos + lenLen); - if (lengthBytes.length !== lenLen) - throw new E('tlv.decode: length bytes not complete'); - if (lengthBytes[0] === 0) - throw new E('tlv.decode(long): zero leftmost byte'); - for (const b of lengthBytes) - length = (length << 8) | b; - pos += lenLen; - if (length < 128) - throw new E('tlv.decode(long): not minimal encoding'); - } - const v = data.subarray(pos, pos + length); - if (v.length !== length) - throw new E('tlv.decode: wrong value length'); - return { v, l: data.subarray(pos + length) }; - }, - }, - // https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag, - // since we always use positive integers here. It must always be empty: - // - add zero byte if exists - // - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding) - _int: { - encode(num) { - const { Err: E } = DER; - if (num < _0n) - throw new E('integer: negative integers are not allowed'); - let hex = numberToHexUnpadded(num); - // Pad with zero byte if negative flag is present - if (Number.parseInt(hex[0], 16) & 0b1000) - hex = '00' + hex; - if (hex.length & 1) - throw new E('unexpected DER parsing assertion: unpadded hex'); - return hex; - }, - decode(data) { - const { Err: E } = DER; - if (data[0] & 0b1000_0000) - throw new E('invalid signature integer: negative'); - if (data[0] === 0x00 && !(data[1] & 0b1000_0000)) - throw new E('invalid signature integer: unnecessary leading zero'); - return bytesToNumberBE(data); - }, - }, - toSig(bytes) { - // parse DER signature - const { Err: E, _int: int, _tlv: tlv } = DER; - const data = abytes(bytes, undefined, 'signature'); - const { v: seqBytes, l: seqLeftBytes } = tlv.decode(0x30, data); - if (seqLeftBytes.length) - throw new E('invalid signature: left bytes after parsing'); - const { v: rBytes, l: rLeftBytes } = tlv.decode(0x02, seqBytes); - const { v: sBytes, l: sLeftBytes } = tlv.decode(0x02, rLeftBytes); - if (sLeftBytes.length) - throw new E('invalid signature: left bytes after parsing'); - return { r: int.decode(rBytes), s: int.decode(sBytes) }; - }, - hexFromSig(sig) { - const { _tlv: tlv, _int: int } = DER; - const rs = tlv.encode(0x02, int.encode(sig.r)); - const ss = tlv.encode(0x02, int.encode(sig.s)); - const seq = rs + ss; - return tlv.encode(0x30, seq); - }, -}; -// Be friendly to bad ECMAScript parsers by not using bigint literals -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = BigInt(4); -/** - * Creates weierstrass Point constructor, based on specified curve options. - * - * See {@link WeierstrassOpts}. - * - * @example -```js -const opts = { - p: 0xfffffffffffffffffffffffffffffffeffffac73n, - n: 0x100000000000000000001b8fa16dfab9aca16b6b3n, - h: 1n, - a: 0n, - b: 7n, - Gx: 0x3b4c382ce37aa192a4019e763036f4f5dd4d7ebbn, - Gy: 0x938cf935318fdced6bc28286531733c3f03c4feen, -}; -const secp160k1_Point = weierstrass(opts); -``` - */ -export function weierstrass(params, extraOpts = {}) { - const validated = createCurveFields('weierstrass', params, extraOpts); - const { Fp, Fn } = validated; - let CURVE = validated.CURVE; - const { h: cofactor, n: CURVE_ORDER } = CURVE; - validateObject(extraOpts, {}, { - allowInfinityPoint: 'boolean', - clearCofactor: 'function', - isTorsionFree: 'function', - fromBytes: 'function', - toBytes: 'function', - endo: 'object', - }); - const { endo } = extraOpts; - if (endo) { - // validateObject(endo, { beta: 'bigint', splitScalar: 'function' }); - if (!Fp.is0(CURVE.a) || typeof endo.beta !== 'bigint' || !Array.isArray(endo.basises)) { - throw new Error('invalid endo: expected "beta": bigint and "basises": array'); - } - } - const lengths = getWLengths(Fp, Fn); - function assertCompressionIsSupported() { - if (!Fp.isOdd) - throw new Error('compression is not supported: Field does not have .isOdd()'); - } - // Implements IEEE P1363 point encoding - function pointToBytes(_c, point, isCompressed) { - const { x, y } = point.toAffine(); - const bx = Fp.toBytes(x); - abool(isCompressed, 'isCompressed'); - if (isCompressed) { - assertCompressionIsSupported(); - const hasEvenY = !Fp.isOdd(y); - return concatBytes(pprefix(hasEvenY), bx); - } - else { - return concatBytes(Uint8Array.of(0x04), bx, Fp.toBytes(y)); - } - } - function pointFromBytes(bytes) { - abytes(bytes, undefined, 'Point'); - const { publicKey: comp, publicKeyUncompressed: uncomp } = lengths; // e.g. for 32-byte: 33, 65 - const length = bytes.length; - const head = bytes[0]; - const tail = bytes.subarray(1); - // No actual validation is done here: use .assertValidity() - if (length === comp && (head === 0x02 || head === 0x03)) { - const x = Fp.fromBytes(tail); - if (!Fp.isValid(x)) - throw new Error('bad point: is not on curve, wrong x'); - const y2 = weierstrassEquation(x); // y² = x³ + ax + b - let y; - try { - y = Fp.sqrt(y2); // y = y² ^ (p+1)/4 - } - catch (sqrtError) { - const err = sqrtError instanceof Error ? ': ' + sqrtError.message : ''; - throw new Error('bad point: is not on curve, sqrt error' + err); - } - assertCompressionIsSupported(); - const evenY = Fp.isOdd(y); - const evenH = (head & 1) === 1; // ECDSA-specific - if (evenH !== evenY) - y = Fp.neg(y); - return { x, y }; - } - else if (length === uncomp && head === 0x04) { - // TODO: more checks - const L = Fp.BYTES; - const x = Fp.fromBytes(tail.subarray(0, L)); - const y = Fp.fromBytes(tail.subarray(L, L * 2)); - if (!isValidXY(x, y)) - throw new Error('bad point: is not on curve'); - return { x, y }; - } - else { - throw new Error(`bad point: got length ${length}, expected compressed=${comp} or uncompressed=${uncomp}`); - } - } - const encodePoint = extraOpts.toBytes || pointToBytes; - const decodePoint = extraOpts.fromBytes || pointFromBytes; - function weierstrassEquation(x) { - const x2 = Fp.sqr(x); // x * x - const x3 = Fp.mul(x2, x); // x² * x - return Fp.add(Fp.add(x3, Fp.mul(x, CURVE.a)), CURVE.b); // x³ + a * x + b - } - // TODO: move top-level - /** Checks whether equation holds for given x, y: y² == x³ + ax + b */ - function isValidXY(x, y) { - const left = Fp.sqr(y); // y² - const right = weierstrassEquation(x); // x³ + ax + b - return Fp.eql(left, right); - } - // Validate whether the passed curve params are valid. - // Test 1: equation y² = x³ + ax + b should work for generator point. - if (!isValidXY(CURVE.Gx, CURVE.Gy)) - throw new Error('bad curve params: generator point'); - // Test 2: discriminant Δ part should be non-zero: 4a³ + 27b² != 0. - // Guarantees curve is genus-1, smooth (non-singular). - const _4a3 = Fp.mul(Fp.pow(CURVE.a, _3n), _4n); - const _27b2 = Fp.mul(Fp.sqr(CURVE.b), BigInt(27)); - if (Fp.is0(Fp.add(_4a3, _27b2))) - throw new Error('bad curve params: a or b'); - /** Asserts coordinate is valid: 0 <= n < Fp.ORDER. */ - function acoord(title, n, banZero = false) { - if (!Fp.isValid(n) || (banZero && Fp.is0(n))) - throw new Error(`bad point coordinate ${title}`); - return n; - } - function aprjpoint(other) { - if (!(other instanceof Point)) - throw new Error('Weierstrass Point expected'); - } - function splitEndoScalarN(k) { - if (!endo || !endo.basises) - throw new Error('no endo'); - return _splitEndoScalar(k, endo.basises, Fn.ORDER); - } - // Memoized toAffine / validity check. They are heavy. Points are immutable. - // Converts Projective point to affine (x, y) coordinates. - // Can accept precomputed Z^-1 - for example, from invertBatch. - // (X, Y, Z) ∋ (x=X/Z, y=Y/Z) - const toAffineMemo = memoized((p, iz) => { - const { X, Y, Z } = p; - // Fast-path for normalized points - if (Fp.eql(Z, Fp.ONE)) - return { x: X, y: Y }; - const is0 = p.is0(); - // If invZ was 0, we return zero point. However we still want to execute - // all operations, so we replace invZ with a random number, 1. - if (iz == null) - iz = is0 ? Fp.ONE : Fp.inv(Z); - const x = Fp.mul(X, iz); - const y = Fp.mul(Y, iz); - const zz = Fp.mul(Z, iz); - if (is0) - return { x: Fp.ZERO, y: Fp.ZERO }; - if (!Fp.eql(zz, Fp.ONE)) - throw new Error('invZ was invalid'); - return { x, y }; - }); - // NOTE: on exception this will crash 'cached' and no value will be set. - // Otherwise true will be return - const assertValidMemo = memoized((p) => { - if (p.is0()) { - // (0, 1, 0) aka ZERO is invalid in most contexts. - // In BLS, ZERO can be serialized, so we allow it. - // (0, 0, 0) is invalid representation of ZERO. - if (extraOpts.allowInfinityPoint && !Fp.is0(p.Y)) - return; - throw new Error('bad point: ZERO'); - } - // Some 3rd-party test vectors require different wording between here & `fromCompressedHex` - const { x, y } = p.toAffine(); - if (!Fp.isValid(x) || !Fp.isValid(y)) - throw new Error('bad point: x or y not field elements'); - if (!isValidXY(x, y)) - throw new Error('bad point: equation left != right'); - if (!p.isTorsionFree()) - throw new Error('bad point: not in prime-order subgroup'); - return true; - }); - function finishEndo(endoBeta, k1p, k2p, k1neg, k2neg) { - k2p = new Point(Fp.mul(k2p.X, endoBeta), k2p.Y, k2p.Z); - k1p = negateCt(k1neg, k1p); - k2p = negateCt(k2neg, k2p); - return k1p.add(k2p); - } - /** - * Projective Point works in 3d / projective (homogeneous) coordinates:(X, Y, Z) ∋ (x=X/Z, y=Y/Z). - * Default Point works in 2d / affine coordinates: (x, y). - * We're doing calculations in projective, because its operations don't require costly inversion. - */ - class Point { - // base / generator point - static BASE = new Point(CURVE.Gx, CURVE.Gy, Fp.ONE); - // zero / infinity / identity point - static ZERO = new Point(Fp.ZERO, Fp.ONE, Fp.ZERO); // 0, 1, 0 - // math field - static Fp = Fp; - // scalar field - static Fn = Fn; - X; - Y; - Z; - /** Does NOT validate if the point is valid. Use `.assertValidity()`. */ - constructor(X, Y, Z) { - this.X = acoord('x', X); - this.Y = acoord('y', Y, true); - this.Z = acoord('z', Z); - Object.freeze(this); - } - static CURVE() { - return CURVE; - } - /** Does NOT validate if the point is valid. Use `.assertValidity()`. */ - static fromAffine(p) { - const { x, y } = p || {}; - if (!p || !Fp.isValid(x) || !Fp.isValid(y)) - throw new Error('invalid affine point'); - if (p instanceof Point) - throw new Error('projective point not allowed'); - // (0, 0) would've produced (0, 0, 1) - instead, we need (0, 1, 0) - if (Fp.is0(x) && Fp.is0(y)) - return Point.ZERO; - return new Point(x, y, Fp.ONE); - } - static fromBytes(bytes) { - const P = Point.fromAffine(decodePoint(abytes(bytes, undefined, 'point'))); - P.assertValidity(); - return P; - } - static fromHex(hex) { - return Point.fromBytes(hexToBytes(hex)); - } - get x() { - return this.toAffine().x; - } - get y() { - return this.toAffine().y; - } - /** - * - * @param windowSize - * @param isLazy true will defer table computation until the first multiplication - * @returns - */ - precompute(windowSize = 8, isLazy = true) { - wnaf.createCache(this, windowSize); - if (!isLazy) - this.multiply(_3n); // random number - return this; - } - // TODO: return `this` - /** A point on curve is valid if it conforms to equation. */ - assertValidity() { - assertValidMemo(this); - } - hasEvenY() { - const { y } = this.toAffine(); - if (!Fp.isOdd) - throw new Error("Field doesn't support isOdd"); - return !Fp.isOdd(y); - } - /** Compare one point to another. */ - equals(other) { - aprjpoint(other); - const { X: X1, Y: Y1, Z: Z1 } = this; - const { X: X2, Y: Y2, Z: Z2 } = other; - const U1 = Fp.eql(Fp.mul(X1, Z2), Fp.mul(X2, Z1)); - const U2 = Fp.eql(Fp.mul(Y1, Z2), Fp.mul(Y2, Z1)); - return U1 && U2; - } - /** Flips point to one corresponding to (x, -y) in Affine coordinates. */ - negate() { - return new Point(this.X, Fp.neg(this.Y), this.Z); - } - // Renes-Costello-Batina exception-free doubling formula. - // There is 30% faster Jacobian formula, but it is not complete. - // https://eprint.iacr.org/2015/1060, algorithm 3 - // Cost: 8M + 3S + 3*a + 2*b3 + 15add. - double() { - const { a, b } = CURVE; - const b3 = Fp.mul(b, _3n); - const { X: X1, Y: Y1, Z: Z1 } = this; - let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore - let t0 = Fp.mul(X1, X1); // step 1 - let t1 = Fp.mul(Y1, Y1); - let t2 = Fp.mul(Z1, Z1); - let t3 = Fp.mul(X1, Y1); - t3 = Fp.add(t3, t3); // step 5 - Z3 = Fp.mul(X1, Z1); - Z3 = Fp.add(Z3, Z3); - X3 = Fp.mul(a, Z3); - Y3 = Fp.mul(b3, t2); - Y3 = Fp.add(X3, Y3); // step 10 - X3 = Fp.sub(t1, Y3); - Y3 = Fp.add(t1, Y3); - Y3 = Fp.mul(X3, Y3); - X3 = Fp.mul(t3, X3); - Z3 = Fp.mul(b3, Z3); // step 15 - t2 = Fp.mul(a, t2); - t3 = Fp.sub(t0, t2); - t3 = Fp.mul(a, t3); - t3 = Fp.add(t3, Z3); - Z3 = Fp.add(t0, t0); // step 20 - t0 = Fp.add(Z3, t0); - t0 = Fp.add(t0, t2); - t0 = Fp.mul(t0, t3); - Y3 = Fp.add(Y3, t0); - t2 = Fp.mul(Y1, Z1); // step 25 - t2 = Fp.add(t2, t2); - t0 = Fp.mul(t2, t3); - X3 = Fp.sub(X3, t0); - Z3 = Fp.mul(t2, t1); - Z3 = Fp.add(Z3, Z3); // step 30 - Z3 = Fp.add(Z3, Z3); - return new Point(X3, Y3, Z3); - } - // Renes-Costello-Batina exception-free addition formula. - // There is 30% faster Jacobian formula, but it is not complete. - // https://eprint.iacr.org/2015/1060, algorithm 1 - // Cost: 12M + 0S + 3*a + 3*b3 + 23add. - add(other) { - aprjpoint(other); - const { X: X1, Y: Y1, Z: Z1 } = this; - const { X: X2, Y: Y2, Z: Z2 } = other; - let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore - const a = CURVE.a; - const b3 = Fp.mul(CURVE.b, _3n); - let t0 = Fp.mul(X1, X2); // step 1 - let t1 = Fp.mul(Y1, Y2); - let t2 = Fp.mul(Z1, Z2); - let t3 = Fp.add(X1, Y1); - let t4 = Fp.add(X2, Y2); // step 5 - t3 = Fp.mul(t3, t4); - t4 = Fp.add(t0, t1); - t3 = Fp.sub(t3, t4); - t4 = Fp.add(X1, Z1); - let t5 = Fp.add(X2, Z2); // step 10 - t4 = Fp.mul(t4, t5); - t5 = Fp.add(t0, t2); - t4 = Fp.sub(t4, t5); - t5 = Fp.add(Y1, Z1); - X3 = Fp.add(Y2, Z2); // step 15 - t5 = Fp.mul(t5, X3); - X3 = Fp.add(t1, t2); - t5 = Fp.sub(t5, X3); - Z3 = Fp.mul(a, t4); - X3 = Fp.mul(b3, t2); // step 20 - Z3 = Fp.add(X3, Z3); - X3 = Fp.sub(t1, Z3); - Z3 = Fp.add(t1, Z3); - Y3 = Fp.mul(X3, Z3); - t1 = Fp.add(t0, t0); // step 25 - t1 = Fp.add(t1, t0); - t2 = Fp.mul(a, t2); - t4 = Fp.mul(b3, t4); - t1 = Fp.add(t1, t2); - t2 = Fp.sub(t0, t2); // step 30 - t2 = Fp.mul(a, t2); - t4 = Fp.add(t4, t2); - t0 = Fp.mul(t1, t4); - Y3 = Fp.add(Y3, t0); - t0 = Fp.mul(t5, t4); // step 35 - X3 = Fp.mul(t3, X3); - X3 = Fp.sub(X3, t0); - t0 = Fp.mul(t3, t1); - Z3 = Fp.mul(t5, Z3); - Z3 = Fp.add(Z3, t0); // step 40 - return new Point(X3, Y3, Z3); - } - subtract(other) { - return this.add(other.negate()); - } - is0() { - return this.equals(Point.ZERO); - } - /** - * Constant time multiplication. - * Uses wNAF method. Windowed method may be 10% faster, - * but takes 2x longer to generate and consumes 2x memory. - * Uses precomputes when available. - * Uses endomorphism for Koblitz curves. - * @param scalar by which the point would be multiplied - * @returns New point - */ - multiply(scalar) { - const { endo } = extraOpts; - if (!Fn.isValidNot0(scalar)) - throw new Error('invalid scalar: out of range'); // 0 is invalid - let point, fake; // Fake point is used to const-time mult - const mul = (n) => wnaf.cached(this, n, (p) => normalizeZ(Point, p)); - /** See docs for {@link EndomorphismOpts} */ - if (endo) { - const { k1neg, k1, k2neg, k2 } = splitEndoScalarN(scalar); - const { p: k1p, f: k1f } = mul(k1); - const { p: k2p, f: k2f } = mul(k2); - fake = k1f.add(k2f); - point = finishEndo(endo.beta, k1p, k2p, k1neg, k2neg); - } - else { - const { p, f } = mul(scalar); - point = p; - fake = f; - } - // Normalize `z` for both points, but return only real one - return normalizeZ(Point, [point, fake])[0]; - } - /** - * Non-constant-time multiplication. Uses double-and-add algorithm. - * It's faster, but should only be used when you don't care about - * an exposed secret key e.g. sig verification, which works over *public* keys. - */ - multiplyUnsafe(sc) { - const { endo } = extraOpts; - const p = this; - if (!Fn.isValid(sc)) - throw new Error('invalid scalar: out of range'); // 0 is valid - if (sc === _0n || p.is0()) - return Point.ZERO; // 0 - if (sc === _1n) - return p; // 1 - if (wnaf.hasCache(this)) - return this.multiply(sc); // precomputes - // We don't have method for double scalar multiplication (aP + bQ): - // Even with using Strauss-Shamir trick, it's 35% slower than naïve mul+add. - if (endo) { - const { k1neg, k1, k2neg, k2 } = splitEndoScalarN(sc); - const { p1, p2 } = mulEndoUnsafe(Point, p, k1, k2); // 30% faster vs wnaf.unsafe - return finishEndo(endo.beta, p1, p2, k1neg, k2neg); - } - else { - return wnaf.unsafe(p, sc); - } - } - /** - * Converts Projective point to affine (x, y) coordinates. - * @param invertedZ Z^-1 (inverted zero) - optional, precomputation is useful for invertBatch - */ - toAffine(invertedZ) { - return toAffineMemo(this, invertedZ); - } - /** - * Checks whether Point is free of torsion elements (is in prime subgroup). - * Always torsion-free for cofactor=1 curves. - */ - isTorsionFree() { - const { isTorsionFree } = extraOpts; - if (cofactor === _1n) - return true; - if (isTorsionFree) - return isTorsionFree(Point, this); - return wnaf.unsafe(this, CURVE_ORDER).is0(); - } - clearCofactor() { - const { clearCofactor } = extraOpts; - if (cofactor === _1n) - return this; // Fast-path - if (clearCofactor) - return clearCofactor(Point, this); - return this.multiplyUnsafe(cofactor); - } - isSmallOrder() { - // can we use this.clearCofactor()? - return this.multiplyUnsafe(cofactor).is0(); - } - toBytes(isCompressed = true) { - abool(isCompressed, 'isCompressed'); - this.assertValidity(); - return encodePoint(Point, this, isCompressed); - } - toHex(isCompressed = true) { - return bytesToHex(this.toBytes(isCompressed)); - } - toString() { - return ``; - } - } - const bits = Fn.BITS; - const wnaf = new wNAF(Point, extraOpts.endo ? Math.ceil(bits / 2) : bits); - Point.BASE.precompute(8); // Enable precomputes. Slows down first publicKey computation by 20ms. - return Point; -} -// Points start with byte 0x02 when y is even; otherwise 0x03 -function pprefix(hasEvenY) { - return Uint8Array.of(hasEvenY ? 0x02 : 0x03); -} -/** - * Implementation of the Shallue and van de Woestijne method for any weierstrass curve. - * TODO: check if there is a way to merge this with uvRatio in Edwards; move to modular. - * b = True and y = sqrt(u / v) if (u / v) is square in F, and - * b = False and y = sqrt(Z * (u / v)) otherwise. - * @param Fp - * @param Z - * @returns - */ -export function SWUFpSqrtRatio(Fp, Z) { - // Generic implementation - const q = Fp.ORDER; - let l = _0n; - for (let o = q - _1n; o % _2n === _0n; o /= _2n) - l += _1n; - const c1 = l; // 1. c1, the largest integer such that 2^c1 divides q - 1. - // We need 2n ** c1 and 2n ** (c1-1). We can't use **; but we can use <<. - // 2n ** c1 == 2n << (c1-1) - const _2n_pow_c1_1 = _2n << (c1 - _1n - _1n); - const _2n_pow_c1 = _2n_pow_c1_1 * _2n; - const c2 = (q - _1n) / _2n_pow_c1; // 2. c2 = (q - 1) / (2^c1) # Integer arithmetic - const c3 = (c2 - _1n) / _2n; // 3. c3 = (c2 - 1) / 2 # Integer arithmetic - const c4 = _2n_pow_c1 - _1n; // 4. c4 = 2^c1 - 1 # Integer arithmetic - const c5 = _2n_pow_c1_1; // 5. c5 = 2^(c1 - 1) # Integer arithmetic - const c6 = Fp.pow(Z, c2); // 6. c6 = Z^c2 - const c7 = Fp.pow(Z, (c2 + _1n) / _2n); // 7. c7 = Z^((c2 + 1) / 2) - let sqrtRatio = (u, v) => { - let tv1 = c6; // 1. tv1 = c6 - let tv2 = Fp.pow(v, c4); // 2. tv2 = v^c4 - let tv3 = Fp.sqr(tv2); // 3. tv3 = tv2^2 - tv3 = Fp.mul(tv3, v); // 4. tv3 = tv3 * v - let tv5 = Fp.mul(u, tv3); // 5. tv5 = u * tv3 - tv5 = Fp.pow(tv5, c3); // 6. tv5 = tv5^c3 - tv5 = Fp.mul(tv5, tv2); // 7. tv5 = tv5 * tv2 - tv2 = Fp.mul(tv5, v); // 8. tv2 = tv5 * v - tv3 = Fp.mul(tv5, u); // 9. tv3 = tv5 * u - let tv4 = Fp.mul(tv3, tv2); // 10. tv4 = tv3 * tv2 - tv5 = Fp.pow(tv4, c5); // 11. tv5 = tv4^c5 - let isQR = Fp.eql(tv5, Fp.ONE); // 12. isQR = tv5 == 1 - tv2 = Fp.mul(tv3, c7); // 13. tv2 = tv3 * c7 - tv5 = Fp.mul(tv4, tv1); // 14. tv5 = tv4 * tv1 - tv3 = Fp.cmov(tv2, tv3, isQR); // 15. tv3 = CMOV(tv2, tv3, isQR) - tv4 = Fp.cmov(tv5, tv4, isQR); // 16. tv4 = CMOV(tv5, tv4, isQR) - // 17. for i in (c1, c1 - 1, ..., 2): - for (let i = c1; i > _1n; i--) { - let tv5 = i - _2n; // 18. tv5 = i - 2 - tv5 = _2n << (tv5 - _1n); // 19. tv5 = 2^tv5 - let tvv5 = Fp.pow(tv4, tv5); // 20. tv5 = tv4^tv5 - const e1 = Fp.eql(tvv5, Fp.ONE); // 21. e1 = tv5 == 1 - tv2 = Fp.mul(tv3, tv1); // 22. tv2 = tv3 * tv1 - tv1 = Fp.mul(tv1, tv1); // 23. tv1 = tv1 * tv1 - tvv5 = Fp.mul(tv4, tv1); // 24. tv5 = tv4 * tv1 - tv3 = Fp.cmov(tv2, tv3, e1); // 25. tv3 = CMOV(tv2, tv3, e1) - tv4 = Fp.cmov(tvv5, tv4, e1); // 26. tv4 = CMOV(tv5, tv4, e1) - } - return { isValid: isQR, value: tv3 }; - }; - if (Fp.ORDER % _4n === _3n) { - // sqrt_ratio_3mod4(u, v) - const c1 = (Fp.ORDER - _3n) / _4n; // 1. c1 = (q - 3) / 4 # Integer arithmetic - const c2 = Fp.sqrt(Fp.neg(Z)); // 2. c2 = sqrt(-Z) - sqrtRatio = (u, v) => { - let tv1 = Fp.sqr(v); // 1. tv1 = v^2 - const tv2 = Fp.mul(u, v); // 2. tv2 = u * v - tv1 = Fp.mul(tv1, tv2); // 3. tv1 = tv1 * tv2 - let y1 = Fp.pow(tv1, c1); // 4. y1 = tv1^c1 - y1 = Fp.mul(y1, tv2); // 5. y1 = y1 * tv2 - const y2 = Fp.mul(y1, c2); // 6. y2 = y1 * c2 - const tv3 = Fp.mul(Fp.sqr(y1), v); // 7. tv3 = y1^2; 8. tv3 = tv3 * v - const isQR = Fp.eql(tv3, u); // 9. isQR = tv3 == u - let y = Fp.cmov(y2, y1, isQR); // 10. y = CMOV(y2, y1, isQR) - return { isValid: isQR, value: y }; // 11. return (isQR, y) isQR ? y : y*c2 - }; - } - // No curves uses that - // if (Fp.ORDER % _8n === _5n) // sqrt_ratio_5mod8 - return sqrtRatio; -} -/** - * Simplified Shallue-van de Woestijne-Ulas Method - * https://www.rfc-editor.org/rfc/rfc9380#section-6.6.2 - */ -export function mapToCurveSimpleSWU(Fp, opts) { - validateField(Fp); - const { A, B, Z } = opts; - if (!Fp.isValid(A) || !Fp.isValid(B) || !Fp.isValid(Z)) - throw new Error('mapToCurveSimpleSWU: invalid opts'); - const sqrtRatio = SWUFpSqrtRatio(Fp, Z); - if (!Fp.isOdd) - throw new Error('Field does not have .isOdd()'); - // Input: u, an element of F. - // Output: (x, y), a point on E. - return (u) => { - // prettier-ignore - let tv1, tv2, tv3, tv4, tv5, tv6, x, y; - tv1 = Fp.sqr(u); // 1. tv1 = u^2 - tv1 = Fp.mul(tv1, Z); // 2. tv1 = Z * tv1 - tv2 = Fp.sqr(tv1); // 3. tv2 = tv1^2 - tv2 = Fp.add(tv2, tv1); // 4. tv2 = tv2 + tv1 - tv3 = Fp.add(tv2, Fp.ONE); // 5. tv3 = tv2 + 1 - tv3 = Fp.mul(tv3, B); // 6. tv3 = B * tv3 - tv4 = Fp.cmov(Z, Fp.neg(tv2), !Fp.eql(tv2, Fp.ZERO)); // 7. tv4 = CMOV(Z, -tv2, tv2 != 0) - tv4 = Fp.mul(tv4, A); // 8. tv4 = A * tv4 - tv2 = Fp.sqr(tv3); // 9. tv2 = tv3^2 - tv6 = Fp.sqr(tv4); // 10. tv6 = tv4^2 - tv5 = Fp.mul(tv6, A); // 11. tv5 = A * tv6 - tv2 = Fp.add(tv2, tv5); // 12. tv2 = tv2 + tv5 - tv2 = Fp.mul(tv2, tv3); // 13. tv2 = tv2 * tv3 - tv6 = Fp.mul(tv6, tv4); // 14. tv6 = tv6 * tv4 - tv5 = Fp.mul(tv6, B); // 15. tv5 = B * tv6 - tv2 = Fp.add(tv2, tv5); // 16. tv2 = tv2 + tv5 - x = Fp.mul(tv1, tv3); // 17. x = tv1 * tv3 - const { isValid, value } = sqrtRatio(tv2, tv6); // 18. (is_gx1_square, y1) = sqrt_ratio(tv2, tv6) - y = Fp.mul(tv1, u); // 19. y = tv1 * u -> Z * u^3 * y1 - y = Fp.mul(y, value); // 20. y = y * y1 - x = Fp.cmov(x, tv3, isValid); // 21. x = CMOV(x, tv3, is_gx1_square) - y = Fp.cmov(y, value, isValid); // 22. y = CMOV(y, y1, is_gx1_square) - const e1 = Fp.isOdd(u) === Fp.isOdd(y); // 23. e1 = sgn0(u) == sgn0(y) - y = Fp.cmov(Fp.neg(y), y, e1); // 24. y = CMOV(-y, y, e1) - const tv4_inv = FpInvertBatch(Fp, [tv4], true)[0]; - x = Fp.mul(x, tv4_inv); // 25. x = x / tv4 - return { x, y }; - }; -} -function getWLengths(Fp, Fn) { - return { - secretKey: Fn.BYTES, - publicKey: 1 + Fp.BYTES, - publicKeyUncompressed: 1 + 2 * Fp.BYTES, - publicKeyHasPrefix: true, - signature: 2 * Fn.BYTES, - }; -} -/** - * Sometimes users only need getPublicKey, getSharedSecret, and secret key handling. - * This helper ensures no signature functionality is present. Less code, smaller bundle size. - */ -export function ecdh(Point, ecdhOpts = {}) { - const { Fn } = Point; - const randomBytes_ = ecdhOpts.randomBytes || wcRandomBytes; - const lengths = Object.assign(getWLengths(Point.Fp, Fn), { seed: getMinHashLength(Fn.ORDER) }); - function isValidSecretKey(secretKey) { - try { - const num = Fn.fromBytes(secretKey); - return Fn.isValidNot0(num); - } - catch (error) { - return false; - } - } - function isValidPublicKey(publicKey, isCompressed) { - const { publicKey: comp, publicKeyUncompressed } = lengths; - try { - const l = publicKey.length; - if (isCompressed === true && l !== comp) - return false; - if (isCompressed === false && l !== publicKeyUncompressed) - return false; - return !!Point.fromBytes(publicKey); - } - catch (error) { - return false; - } - } - /** - * Produces cryptographically secure secret key from random of size - * (groupLen + ceil(groupLen / 2)) with modulo bias being negligible. - */ - function randomSecretKey(seed = randomBytes_(lengths.seed)) { - return mapHashToField(abytes(seed, lengths.seed, 'seed'), Fn.ORDER); - } - /** - * Computes public key for a secret key. Checks for validity of the secret key. - * @param isCompressed whether to return compact (default), or full key - * @returns Public key, full when isCompressed=false; short when isCompressed=true - */ - function getPublicKey(secretKey, isCompressed = true) { - return Point.BASE.multiply(Fn.fromBytes(secretKey)).toBytes(isCompressed); - } - /** - * Quick and dirty check for item being public key. Does not validate hex, or being on-curve. - */ - function isProbPub(item) { - const { secretKey, publicKey, publicKeyUncompressed } = lengths; - if (!isBytes(item)) - return undefined; - if (('_lengths' in Fn && Fn._lengths) || secretKey === publicKey) - return undefined; - const l = abytes(item, undefined, 'key').length; - return l === publicKey || l === publicKeyUncompressed; - } - /** - * ECDH (Elliptic Curve Diffie Hellman). - * Computes shared public key from secret key A and public key B. - * Checks: 1) secret key validity 2) shared key is on-curve. - * Does NOT hash the result. - * @param isCompressed whether to return compact (default), or full key - * @returns shared public key - */ - function getSharedSecret(secretKeyA, publicKeyB, isCompressed = true) { - if (isProbPub(secretKeyA) === true) - throw new Error('first arg must be private key'); - if (isProbPub(publicKeyB) === false) - throw new Error('second arg must be public key'); - const s = Fn.fromBytes(secretKeyA); - const b = Point.fromBytes(publicKeyB); // checks for being on-curve - return b.multiply(s).toBytes(isCompressed); - } - const utils = { - isValidSecretKey, - isValidPublicKey, - randomSecretKey, - }; - const keygen = createKeygen(randomSecretKey, getPublicKey); - return Object.freeze({ getPublicKey, getSharedSecret, keygen, Point, utils, lengths }); -} -/** - * Creates ECDSA signing interface for given elliptic curve `Point` and `hash` function. - * - * @param Point created using {@link weierstrass} function - * @param hash used for 1) message prehash-ing 2) k generation in `sign`, using hmac_drbg(hash) - * @param ecdsaOpts rarely needed, see {@link ECDSAOpts} - * - * @example - * ```js - * const p256_Point = weierstrass(...); - * const p256_sha256 = ecdsa(p256_Point, sha256); - * const p256_sha224 = ecdsa(p256_Point, sha224); - * const p256_sha224_r = ecdsa(p256_Point, sha224, { randomBytes: (length) => { ... } }); - * ``` - */ -export function ecdsa(Point, hash, ecdsaOpts = {}) { - ahash(hash); - validateObject(ecdsaOpts, {}, { - hmac: 'function', - lowS: 'boolean', - randomBytes: 'function', - bits2int: 'function', - bits2int_modN: 'function', - }); - ecdsaOpts = Object.assign({}, ecdsaOpts); - const randomBytes = ecdsaOpts.randomBytes || wcRandomBytes; - const hmac = ecdsaOpts.hmac || ((key, msg) => nobleHmac(hash, key, msg)); - const { Fp, Fn } = Point; - const { ORDER: CURVE_ORDER, BITS: fnBits } = Fn; - const { keygen, getPublicKey, getSharedSecret, utils, lengths } = ecdh(Point, ecdsaOpts); - const defaultSigOpts = { - prehash: true, - lowS: typeof ecdsaOpts.lowS === 'boolean' ? ecdsaOpts.lowS : true, - format: 'compact', - extraEntropy: false, - }; - const hasLargeCofactor = CURVE_ORDER * _2n < Fp.ORDER; // Won't CURVE().h > 2n be more effective? - function isBiggerThanHalfOrder(number) { - const HALF = CURVE_ORDER >> _1n; - return number > HALF; - } - function validateRS(title, num) { - if (!Fn.isValidNot0(num)) - throw new Error(`invalid signature ${title}: out of range 1..Point.Fn.ORDER`); - return num; - } - function assertSmallCofactor() { - // ECDSA recovery is hard for cofactor > 1 curves. - // In sign, `r = q.x mod n`, and here we recover q.x from r. - // While recovering q.x >= n, we need to add r+n for cofactor=1 curves. - // However, for cofactor>1, r+n may not get q.x: - // r+n*i would need to be done instead where i is unknown. - // To easily get i, we either need to: - // a. increase amount of valid recid values (4, 5...); OR - // b. prohibit non-prime-order signatures (recid > 1). - if (hasLargeCofactor) - throw new Error('"recovered" sig type is not supported for cofactor >2 curves'); - } - function validateSigLength(bytes, format) { - validateSigFormat(format); - const size = lengths.signature; - const sizer = format === 'compact' ? size : format === 'recovered' ? size + 1 : undefined; - return abytes(bytes, sizer); - } - /** - * ECDSA signature with its (r, s) properties. Supports compact, recovered & DER representations. - */ - class Signature { - r; - s; - recovery; - constructor(r, s, recovery) { - this.r = validateRS('r', r); // r in [1..N-1]; - this.s = validateRS('s', s); // s in [1..N-1]; - if (recovery != null) { - assertSmallCofactor(); - if (![0, 1, 2, 3].includes(recovery)) - throw new Error('invalid recovery id'); - this.recovery = recovery; - } - Object.freeze(this); - } - static fromBytes(bytes, format = defaultSigOpts.format) { - validateSigLength(bytes, format); - let recid; - if (format === 'der') { - const { r, s } = DER.toSig(abytes(bytes)); - return new Signature(r, s); - } - if (format === 'recovered') { - recid = bytes[0]; - format = 'compact'; - bytes = bytes.subarray(1); - } - const L = lengths.signature / 2; - const r = bytes.subarray(0, L); - const s = bytes.subarray(L, L * 2); - return new Signature(Fn.fromBytes(r), Fn.fromBytes(s), recid); - } - static fromHex(hex, format) { - return this.fromBytes(hexToBytes(hex), format); - } - assertRecovery() { - const { recovery } = this; - if (recovery == null) - throw new Error('invalid recovery id: must be present'); - return recovery; - } - addRecoveryBit(recovery) { - return new Signature(this.r, this.s, recovery); - } - recoverPublicKey(messageHash) { - const { r, s } = this; - const recovery = this.assertRecovery(); - const radj = recovery === 2 || recovery === 3 ? r + CURVE_ORDER : r; - if (!Fp.isValid(radj)) - throw new Error('invalid recovery id: sig.r+curve.n != R.x'); - const x = Fp.toBytes(radj); - const R = Point.fromBytes(concatBytes(pprefix((recovery & 1) === 0), x)); - const ir = Fn.inv(radj); // r^-1 - const h = bits2int_modN(abytes(messageHash, undefined, 'msgHash')); // Truncate hash - const u1 = Fn.create(-h * ir); // -hr^-1 - const u2 = Fn.create(s * ir); // sr^-1 - // (sr^-1)R-(hr^-1)G = -(hr^-1)G + (sr^-1). unsafe is fine: there is no private data. - const Q = Point.BASE.multiplyUnsafe(u1).add(R.multiplyUnsafe(u2)); - if (Q.is0()) - throw new Error('invalid recovery: point at infinify'); - Q.assertValidity(); - return Q; - } - // Signatures should be low-s, to prevent malleability. - hasHighS() { - return isBiggerThanHalfOrder(this.s); - } - toBytes(format = defaultSigOpts.format) { - validateSigFormat(format); - if (format === 'der') - return hexToBytes(DER.hexFromSig(this)); - const { r, s } = this; - const rb = Fn.toBytes(r); - const sb = Fn.toBytes(s); - if (format === 'recovered') { - assertSmallCofactor(); - return concatBytes(Uint8Array.of(this.assertRecovery()), rb, sb); - } - return concatBytes(rb, sb); - } - toHex(format) { - return bytesToHex(this.toBytes(format)); - } - } - // RFC6979: ensure ECDSA msg is X bytes and < N. RFC suggests optional truncating via bits2octets. - // FIPS 186-4 4.6 suggests the leftmost min(nBitLen, outLen) bits, which matches bits2int. - // bits2int can produce res>N, we can do mod(res, N) since the bitLen is the same. - // int2octets can't be used; pads small msgs with 0: unacceptatble for trunc as per RFC vectors - const bits2int = ecdsaOpts.bits2int || - function bits2int_def(bytes) { - // Our custom check "just in case", for protection against DoS - if (bytes.length > 8192) - throw new Error('input is too large'); - // For curves with nBitLength % 8 !== 0: bits2octets(bits2octets(m)) !== bits2octets(m) - // for some cases, since bytes.length * 8 is not actual bitLength. - const num = bytesToNumberBE(bytes); // check for == u8 done here - const delta = bytes.length * 8 - fnBits; // truncate to nBitLength leftmost bits - return delta > 0 ? num >> BigInt(delta) : num; - }; - const bits2int_modN = ecdsaOpts.bits2int_modN || - function bits2int_modN_def(bytes) { - return Fn.create(bits2int(bytes)); // can't use bytesToNumberBE here - }; - // Pads output with zero as per spec - const ORDER_MASK = bitMask(fnBits); - /** Converts to bytes. Checks if num in `[0..ORDER_MASK-1]` e.g.: `[0..2^256-1]`. */ - function int2octets(num) { - // IMPORTANT: the check ensures working for case `Fn.BYTES != Fn.BITS * 8` - aInRange('num < 2^' + fnBits, num, _0n, ORDER_MASK); - return Fn.toBytes(num); - } - function validateMsgAndHash(message, prehash) { - abytes(message, undefined, 'message'); - return prehash ? abytes(hash(message), undefined, 'prehashed message') : message; - } - /** - * Steps A, D of RFC6979 3.2. - * Creates RFC6979 seed; converts msg/privKey to numbers. - * Used only in sign, not in verify. - * - * Warning: we cannot assume here that message has same amount of bytes as curve order, - * this will be invalid at least for P521. Also it can be bigger for P224 + SHA256. - */ - function prepSig(message, secretKey, opts) { - const { lowS, prehash, extraEntropy } = validateSigOpts(opts, defaultSigOpts); - message = validateMsgAndHash(message, prehash); // RFC6979 3.2 A: h1 = H(m) - // We can't later call bits2octets, since nested bits2int is broken for curves - // with fnBits % 8 !== 0. Because of that, we unwrap it here as int2octets call. - // const bits2octets = (bits) => int2octets(bits2int_modN(bits)) - const h1int = bits2int_modN(message); - const d = Fn.fromBytes(secretKey); // validate secret key, convert to bigint - if (!Fn.isValidNot0(d)) - throw new Error('invalid private key'); - const seedArgs = [int2octets(d), int2octets(h1int)]; - // extraEntropy. RFC6979 3.6: additional k' (optional). - if (extraEntropy != null && extraEntropy !== false) { - // K = HMAC_K(V || 0x00 || int2octets(x) || bits2octets(h1) || k') - // gen random bytes OR pass as-is - const e = extraEntropy === true ? randomBytes(lengths.secretKey) : extraEntropy; - seedArgs.push(abytes(e, undefined, 'extraEntropy')); // check for being bytes - } - const seed = concatBytes(...seedArgs); // Step D of RFC6979 3.2 - const m = h1int; // no need to call bits2int second time here, it is inside truncateHash! - // Converts signature params into point w r/s, checks result for validity. - // To transform k => Signature: - // q = k⋅G - // r = q.x mod n - // s = k^-1(m + rd) mod n - // Can use scalar blinding b^-1(bm + bdr) where b ∈ [1,q−1] according to - // https://tches.iacr.org/index.php/TCHES/article/view/7337/6509. We've decided against it: - // a) dependency on CSPRNG b) 15% slowdown c) doesn't really help since bigints are not CT - function k2sig(kBytes) { - // RFC 6979 Section 3.2, step 3: k = bits2int(T) - // Important: all mod() calls here must be done over N - const k = bits2int(kBytes); // Cannot use fields methods, since it is group element - if (!Fn.isValidNot0(k)) - return; // Valid scalars (including k) must be in 1..N-1 - const ik = Fn.inv(k); // k^-1 mod n - const q = Point.BASE.multiply(k).toAffine(); // q = k⋅G - const r = Fn.create(q.x); // r = q.x mod n - if (r === _0n) - return; - const s = Fn.create(ik * Fn.create(m + r * d)); // s = k^-1(m + rd) mod n - if (s === _0n) - return; - let recovery = (q.x === r ? 0 : 2) | Number(q.y & _1n); // recovery bit (2 or 3 when q.x>n) - let normS = s; - if (lowS && isBiggerThanHalfOrder(s)) { - normS = Fn.neg(s); // if lowS was passed, ensure s is always in the bottom half of N - recovery ^= 1; - } - return new Signature(r, normS, hasLargeCofactor ? undefined : recovery); - } - return { seed, k2sig }; - } - /** - * Signs message hash with a secret key. - * - * ``` - * sign(m, d) where - * k = rfc6979_hmac_drbg(m, d) - * (x, y) = G × k - * r = x mod n - * s = (m + dr) / k mod n - * ``` - */ - function sign(message, secretKey, opts = {}) { - const { seed, k2sig } = prepSig(message, secretKey, opts); // Steps A, D of RFC6979 3.2. - const drbg = createHmacDrbg(hash.outputLen, Fn.BYTES, hmac); - const sig = drbg(seed, k2sig); // Steps B, C, D, E, F, G - return sig.toBytes(opts.format); - } - /** - * Verifies a signature against message and public key. - * Rejects lowS signatures by default: see {@link ECDSAVerifyOpts}. - * Implements section 4.1.4 from https://www.secg.org/sec1-v2.pdf: - * - * ``` - * verify(r, s, h, P) where - * u1 = hs^-1 mod n - * u2 = rs^-1 mod n - * R = u1⋅G + u2⋅P - * mod(R.x, n) == r - * ``` - */ - function verify(signature, message, publicKey, opts = {}) { - const { lowS, prehash, format } = validateSigOpts(opts, defaultSigOpts); - publicKey = abytes(publicKey, undefined, 'publicKey'); - message = validateMsgAndHash(message, prehash); - if (!isBytes(signature)) { - const end = signature instanceof Signature ? ', use sig.toBytes()' : ''; - throw new Error('verify expects Uint8Array signature' + end); - } - validateSigLength(signature, format); // execute this twice because we want loud error - try { - const sig = Signature.fromBytes(signature, format); - const P = Point.fromBytes(publicKey); - if (lowS && sig.hasHighS()) - return false; - const { r, s } = sig; - const h = bits2int_modN(message); // mod n, not mod p - const is = Fn.inv(s); // s^-1 mod n - const u1 = Fn.create(h * is); // u1 = hs^-1 mod n - const u2 = Fn.create(r * is); // u2 = rs^-1 mod n - const R = Point.BASE.multiplyUnsafe(u1).add(P.multiplyUnsafe(u2)); // u1⋅G + u2⋅P - if (R.is0()) - return false; - const v = Fn.create(R.x); // v = r.x mod n - return v === r; - } - catch (e) { - return false; - } - } - function recoverPublicKey(signature, message, opts = {}) { - const { prehash } = validateSigOpts(opts, defaultSigOpts); - message = validateMsgAndHash(message, prehash); - return Signature.fromBytes(signature, 'recovered').recoverPublicKey(message).toBytes(); - } - return Object.freeze({ - keygen, - getPublicKey, - getSharedSecret, - utils, - lengths, - Point, - sign, - verify, - recoverPublicKey, - Signature, - hash, - }); -} -//# sourceMappingURL=weierstrass.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/weierstrass.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/weierstrass.js.map deleted file mode 100644 index b48484bf..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/weierstrass.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"weierstrass.js","sourceRoot":"","sources":["../src/abstract/weierstrass.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,sEAAsE;AACtE,OAAO,EAAE,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C,CAAC,CAAC,cAAc;YACjF,IAAI,CAAC,CAAC,GAAG,EAAE;gBAAE,OAAO,KAAK,CAAC;YAC1B,MAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB;YAC1C,OAAO,CAAC,KAAK,CAAC,CAAC;QACjB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,SAAS,gBAAgB,CACvB,SAAqB,EACrB,OAAmB,EACnB,OAAyB,EAAE;QAE3B,MAAM,EAAE,OAAO,EAAE,GAAG,eAAe,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;QAC1D,OAAO,GAAG,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC/C,OAAO,SAAS,CAAC,SAAS,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC;IACzF,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,MAAM;QACN,YAAY;QACZ,eAAe;QACf,KAAK;QACL,OAAO;QACP,KAAK;QACL,IAAI;QACJ,MAAM;QACN,gBAAgB;QAChB,SAAS;QACT,IAAI;KACL,CAAkB,CAAC;AACtB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/bls12-381.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/bls12-381.d.ts deleted file mode 100644 index 3e40d9e8..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/bls12-381.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { type BlsCurvePairWithSignatures } from './abstract/bls.ts'; -import { type IField } from './abstract/modular.ts'; -/** bls12-381 Fr (Fn) field. Note: does mod() on fromBytes, due to modFromBytes option. */ -export declare const bls12_381_Fr: IField; -/** - * bls12-381 pairing-friendly curve construction. - * Provides both longSignatures and shortSignatures. - */ -export declare const bls12_381: BlsCurvePairWithSignatures; -//# sourceMappingURL=bls12-381.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/bls12-381.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/bls12-381.d.ts.map deleted file mode 100644 index 4b3f6161..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/bls12-381.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bls12-381.d.ts","sourceRoot":"","sources":["src/bls12-381.ts"],"names":[],"mappings":"AAgFA,OAAO,EAAO,KAAK,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAS,KAAK,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAsE3D,0FAA0F;AAC1F,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,CAEtC,CAAC;AA4aH;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,0BAOvB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/bls12-381.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/bls12-381.js deleted file mode 100644 index e7afd29d..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/bls12-381.js +++ /dev/null @@ -1,688 +0,0 @@ -/** - * bls12-381 is pairing-friendly Barreto-Lynn-Scott elliptic curve construction allowing to: - -* Construct zk-SNARKs at the ~120-bit security, as per [Barbulescu-Duquesne 2017](https://hal.science/hal-01534101/file/main.pdf) -* Efficiently verify N aggregate signatures with 1 pairing and N ec additions: -the Boneh-Lynn-Shacham signature scheme is orders of magnitude more efficient than Schnorr - -BLS can mean 2 different things: - -* Barreto-Lynn-Scott: BLS12, a Pairing Friendly Elliptic Curve -* Boneh-Lynn-Shacham: A Signature Scheme. - -### Summary - -1. BLS Relies on expensive bilinear pairing -2. Secret Keys: 32 bytes -3. Public Keys: 48 OR 96 bytes - big-endian x coordinate of point on G1 OR G2 curve -4. Signatures: 96 OR 48 bytes - big-endian x coordinate of point on G2 OR G1 curve -5. The 12 stands for the Embedding degree. - -Modes of operation: - -* Long signatures: 48-byte keys + 96-byte sigs (G1 keys + G2 sigs). -* Short signatures: 96-byte keys + 48-byte sigs (G2 keys + G1 sigs). - -### Formulas - -- `P = pk x G` - public keys -- `S = pk x H(m)` - signing, uses hash-to-curve on m -- `e(P, H(m)) == e(G, S)` - verification using pairings -- `e(G, S) = e(G, SUM(n)(Si)) = MUL(n)(e(G, Si))` - signature aggregation - -### Curves - -G1 is ordinary elliptic curve. G2 is extension field curve, think "over complex numbers". - -- G1: y² = x³ + 4 -- G2: y² = x³ + 4(u + 1) where u = √−1; r-order subgroup of E'(Fp²), M-type twist - -### Towers - -Pairing G1 + G2 produces element in Fp₁₂, 12-degree polynomial. -Fp₁₂ is usually implemented using tower of lower-degree polynomials for speed. - -- Fp₁₂ = Fp₆² => Fp₂³ -- Fp(u) / (u² - β) where β = -1 -- Fp₂(v) / (v³ - ξ) where ξ = u + 1 -- Fp₆(w) / (w² - γ) where γ = v -- Fp²[u] = Fp/u²+1 -- Fp⁶[v] = Fp²/v³-1-u -- Fp¹²[w] = Fp⁶/w²-v - -### Params - -* Embedding degree (k): 12 -* Seed is sometimes named x or t -* t = -15132376222941642752 -* p = (t-1)² * (t⁴-t²+1)/3 + t -* r = t⁴-t²+1 -* Ate loop size: X - -To verify curve parameters, see -[pairing-friendly-curves spec](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-pairing-friendly-curves-11). -Basic math is done over finite fields over p. -More complicated math is done over polynominal extension fields. - -### Compatibility and notes -1. It is compatible with Algorand, Chia, Dfinity, Ethereum, Filecoin, ZEC. -Filecoin uses little endian byte arrays for secret keys - make sure to reverse byte order. -2. Make sure to correctly select mode: "long signature" or "short signature". -3. Compatible with specs: - RFC 9380, - [cfrg-pairing-friendly-curves-11](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-pairing-friendly-curves-11), - [cfrg-bls-signature-05](https://datatracker.ietf.org/doc/draft-irtf-cfrg-bls-signature/). - - * - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { sha256 } from '@noble/hashes/sha2.js'; -import { bls } from "./abstract/bls.js"; -import { Field } from "./abstract/modular.js"; -import { abytes, bitLen, bitMask, bytesToHex, bytesToNumberBE, concatBytes, copyBytes, hexToBytes, numberToBytesBE, randomBytes, } from "./utils.js"; -// Types -import { isogenyMap } from "./abstract/hash-to-curve.js"; -import { psiFrobenius, tower12 } from "./abstract/tower.js"; -import { mapToCurveSimpleSWU, weierstrass, } from "./abstract/weierstrass.js"; -// Be friendly to bad ECMAScript parsers by not using bigint literals -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = BigInt(4); -// To verify math: -// https://tools.ietf.org/html/draft-irtf-cfrg-pairing-friendly-curves-11 -// The BLS parameter x (seed) for BLS12-381. NOTE: it is negative! -// x = -2^63 - 2^62 - 2^60 - 2^57 - 2^48 - 2^16 -const BLS_X = BigInt('0xd201000000010000'); -// t = x (called differently in different places) -// const t = -BLS_X; -const BLS_X_LEN = bitLen(BLS_X); -// a=0, b=4 -// P is characteristic of field Fp, in which curve calculations are done. -// p = (t-1)² * (t⁴-t²+1)/3 + t -// bls12_381_Fp = (t-1n)**2n * (t**4n - t**2n + 1n) / 3n + t -// r*h is curve order, amount of points on curve, -// where r is order of prime subgroup and h is cofactor. -// r = t⁴-t²+1 -// r = (t**4n - t**2n + 1n) -// cofactor h of G1: (t - 1)²/3 -// cofactorG1 = (t-1n)**2n/3n -// x = 3685416753713387016781088315183077757961620795782546409894578378688607592378376318836054947676345821548104185464507 -// y = 1339506544944476473020471379941921221584933875938349620426543736416511423956333506472724655353366534992391756441569 -const bls12_381_CURVE_G1 = { - p: BigInt('0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab'), - n: BigInt('0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001'), - h: BigInt('0x396c8c005555e1568c00aaab0000aaab'), - a: _0n, - b: _4n, - Gx: BigInt('0x17f1d3a73197d7942695638c4fa9ac0fc3688c4f9774b905a14e3a3f171bac586c55e83ff97a1aeffb3af00adb22c6bb'), - Gy: BigInt('0x08b3f481e3aaa0f1a09e30ed741d8ae4fcf5e095d5d00af600db18cb2c04b3edd03cc744a2888ae40caa232946c5e7e1'), -}; -// CURVE FIELDS -// r = z⁴ − z² + 1; CURVE.n from other curves -/** bls12-381 Fr (Fn) field. Note: does mod() on fromBytes, due to modFromBytes option. */ -export const bls12_381_Fr = Field(bls12_381_CURVE_G1.n, { - modFromBytes: true, -}); -const { Fp, Fp2, Fp6, Fp12 } = tower12({ - ORDER: bls12_381_CURVE_G1.p, - X_LEN: BLS_X_LEN, - // Finite extension field over irreducible polynominal. - // Fp(u) / (u² - β) where β = -1 - FP2_NONRESIDUE: [_1n, _1n], - Fp2mulByB: ({ c0, c1 }) => { - const t0 = Fp.mul(c0, _4n); // 4 * c0 - const t1 = Fp.mul(c1, _4n); // 4 * c1 - // (T0-T1) + (T0+T1)*i - return { c0: Fp.sub(t0, t1), c1: Fp.add(t0, t1) }; - }, - Fp12finalExponentiate: (num) => { - const x = BLS_X; - // this^(q⁶) / this - const t0 = Fp12.div(Fp12.frobeniusMap(num, 6), num); - // t0^(q²) * t0 - const t1 = Fp12.mul(Fp12.frobeniusMap(t0, 2), t0); - const t2 = Fp12.conjugate(Fp12._cyclotomicExp(t1, x)); - const t3 = Fp12.mul(Fp12.conjugate(Fp12._cyclotomicSquare(t1)), t2); - const t4 = Fp12.conjugate(Fp12._cyclotomicExp(t3, x)); - const t5 = Fp12.conjugate(Fp12._cyclotomicExp(t4, x)); - const t6 = Fp12.mul(Fp12.conjugate(Fp12._cyclotomicExp(t5, x)), Fp12._cyclotomicSquare(t2)); - const t7 = Fp12.conjugate(Fp12._cyclotomicExp(t6, x)); - const t2_t5_pow_q2 = Fp12.frobeniusMap(Fp12.mul(t2, t5), 2); - const t4_t1_pow_q3 = Fp12.frobeniusMap(Fp12.mul(t4, t1), 3); - const t6_t1c_pow_q1 = Fp12.frobeniusMap(Fp12.mul(t6, Fp12.conjugate(t1)), 1); - const t7_t3c_t1 = Fp12.mul(Fp12.mul(t7, Fp12.conjugate(t3)), t1); - // (t2 * t5)^(q²) * (t4 * t1)^(q³) * (t6 * t1.conj)^(q^1) * t7 * t3.conj * t1 - return Fp12.mul(Fp12.mul(Fp12.mul(t2_t5_pow_q2, t4_t1_pow_q3), t6_t1c_pow_q1), t7_t3c_t1); - }, -}); -// GLV endomorphism Ψ(P), for fast cofactor clearing -const { G2psi, G2psi2 } = psiFrobenius(Fp, Fp2, Fp2.div(Fp2.ONE, Fp2.NONRESIDUE)); // 1/(u+1) -/** - * Default hash_to_field / hash-to-curve for BLS. - * m: 1 for G1, 2 for G2 - * k: target security level in bits - * hash: any function, e.g. BBS+ uses BLAKE2: see [github](https://github.com/hyperledger/aries-framework-go/issues/2247). - * Parameter values come from [section 8.8.2 of RFC 9380](https://www.rfc-editor.org/rfc/rfc9380#section-8.8.2). - */ -const hasher_opts = Object.freeze({ - DST: 'BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_NUL_', - encodeDST: 'BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_NUL_', - p: Fp.ORDER, - m: 2, - k: 128, - expand: 'xmd', - hash: sha256, -}); -// a=0, b=4 -// cofactor h of G2 -// (t^8 - 4t^7 + 5t^6 - 4t^4 + 6t^3 - 4t^2 - 4t + 13)/9 -// cofactorG2 = (t**8n - 4n*t**7n + 5n*t**6n - 4n*t**4n + 6n*t**3n - 4n*t**2n - 4n*t+13n)/9n -// x = 3059144344244213709971259814753781636986470325476647558659373206291635324768958432433509563104347017837885763365758*u + 352701069587466618187139116011060144890029952792775240219908644239793785735715026873347600343865175952761926303160 -// y = 927553665492332455747201965776037880757740193453592970025027978793976877002675564980949289727957565575433344219582*u + 1985150602287291935568054521177171638300868978215655730859378665066344726373823718423869104263333984641494340347905 -const bls12_381_CURVE_G2 = { - p: Fp2.ORDER, - n: bls12_381_CURVE_G1.n, - h: BigInt('0x5d543a95414e7f1091d50792876a202cd91de4547085abaa68a205b2e5a7ddfa628f1cb4d9e82ef21537e293a6691ae1616ec6e786f0c70cf1c38e31c7238e5'), - a: Fp2.ZERO, - b: Fp2.fromBigTuple([_4n, _4n]), - Gx: Fp2.fromBigTuple([ - BigInt('0x024aa2b2f08f0a91260805272dc51051c6e47ad4fa403b02b4510b647ae3d1770bac0326a805bbefd48056c8c121bdb8'), - BigInt('0x13e02b6052719f607dacd3a088274f65596bd0d09920b61ab5da61bbdc7f5049334cf11213945d57e5ac7d055d042b7e'), - ]), - Gy: Fp2.fromBigTuple([ - BigInt('0x0ce5d527727d6e118cc9cdc6da2e351aadfd9baa8cbdd3a76d429a695160d12c923ac9cc3baca289e193548608b82801'), - BigInt('0x0606c4a02ea734cc32acd2b02bc28b99cb3e287e85a763af267492ab572e99ab3f370d275cec1da1aaa9075ff05f79be'), - ]), -}; -// Encoding utils -// Compressed point of infinity -// Set compressed & point-at-infinity bits -const COMPZERO = setMask(Fp.toBytes(_0n), { infinity: true, compressed: true }); -function parseMask(bytes) { - // Copy, so we can remove mask data. - // It will be removed also later, when Fp.create will call modulo. - bytes = copyBytes(bytes); - const mask = bytes[0] & 0b1110_0000; - const compressed = !!((mask >> 7) & 1); // compression bit (0b1000_0000) - const infinity = !!((mask >> 6) & 1); // point at infinity bit (0b0100_0000) - const sort = !!((mask >> 5) & 1); // sort bit (0b0010_0000) - bytes[0] &= 0b0001_1111; // clear mask (zero first 3 bits) - return { compressed, infinity, sort, value: bytes }; -} -function setMask(bytes, mask) { - if (bytes[0] & 0b1110_0000) - throw new Error('setMask: non-empty mask'); - if (mask.compressed) - bytes[0] |= 0b1000_0000; - if (mask.infinity) - bytes[0] |= 0b0100_0000; - if (mask.sort) - bytes[0] |= 0b0010_0000; - return bytes; -} -function pointG1ToBytes(_c, point, isComp) { - const { BYTES: L, ORDER: P } = Fp; - const is0 = point.is0(); - const { x, y } = point.toAffine(); - if (isComp) { - if (is0) - return COMPZERO.slice(); - const sort = Boolean((y * _2n) / P); - return setMask(numberToBytesBE(x, L), { compressed: true, sort }); - } - else { - if (is0) { - return concatBytes(Uint8Array.of(0x40), new Uint8Array(2 * L - 1)); - } - else { - return concatBytes(numberToBytesBE(x, L), numberToBytesBE(y, L)); - } - } -} -function signatureG1ToBytes(point) { - point.assertValidity(); - const { BYTES: L, ORDER: P } = Fp; - const { x, y } = point.toAffine(); - if (point.is0()) - return COMPZERO.slice(); - const sort = Boolean((y * _2n) / P); - return setMask(numberToBytesBE(x, L), { compressed: true, sort }); -} -function pointG1FromBytes(bytes) { - const { compressed, infinity, sort, value } = parseMask(bytes); - const { BYTES: L, ORDER: P } = Fp; - if (value.length === 48 && compressed) { - const compressedValue = bytesToNumberBE(value); - // Zero - const x = Fp.create(compressedValue & bitMask(Fp.BITS)); - if (infinity) { - if (x !== _0n) - throw new Error('invalid G1 point: non-empty, at infinity, with compression'); - return { x: _0n, y: _0n }; - } - const right = Fp.add(Fp.pow(x, _3n), Fp.create(bls12_381_CURVE_G1.b)); // y² = x³ + b - let y = Fp.sqrt(right); - if (!y) - throw new Error('invalid G1 point: compressed point'); - if ((y * _2n) / P !== BigInt(sort)) - y = Fp.neg(y); - return { x: Fp.create(x), y: Fp.create(y) }; - } - else if (value.length === 96 && !compressed) { - // Check if the infinity flag is set - const x = bytesToNumberBE(value.subarray(0, L)); - const y = bytesToNumberBE(value.subarray(L)); - if (infinity) { - if (x !== _0n || y !== _0n) - throw new Error('G1: non-empty point at infinity'); - return bls12_381.G1.Point.ZERO.toAffine(); - } - return { x: Fp.create(x), y: Fp.create(y) }; - } - else { - throw new Error('invalid G1 point: expected 48/96 bytes'); - } -} -function signatureG1FromBytes(bytes) { - const { infinity, sort, value } = parseMask(abytes(bytes, 48, 'signature')); - const P = Fp.ORDER; - const Point = bls12_381.G1.Point; - const compressedValue = bytesToNumberBE(value); - // Zero - if (infinity) - return Point.ZERO; - const x = Fp.create(compressedValue & bitMask(Fp.BITS)); - const right = Fp.add(Fp.pow(x, _3n), Fp.create(bls12_381_CURVE_G1.b)); // y² = x³ + b - let y = Fp.sqrt(right); - if (!y) - throw new Error('invalid G1 point: compressed'); - const aflag = BigInt(sort); - if ((y * _2n) / P !== aflag) - y = Fp.neg(y); - const point = Point.fromAffine({ x, y }); - point.assertValidity(); - return point; -} -function pointG2ToBytes(_c, point, isComp) { - const { BYTES: L, ORDER: P } = Fp; - const is0 = point.is0(); - const { x, y } = point.toAffine(); - if (isComp) { - if (is0) - return concatBytes(COMPZERO, numberToBytesBE(_0n, L)); - const flag = Boolean(y.c1 === _0n ? (y.c0 * _2n) / P : (y.c1 * _2n) / P); - return concatBytes(setMask(numberToBytesBE(x.c1, L), { compressed: true, sort: flag }), numberToBytesBE(x.c0, L)); - } - else { - if (is0) - return concatBytes(Uint8Array.of(0x40), new Uint8Array(4 * L - 1)); - const { re: x0, im: x1 } = Fp2.reim(x); - const { re: y0, im: y1 } = Fp2.reim(y); - return concatBytes(numberToBytesBE(x1, L), numberToBytesBE(x0, L), numberToBytesBE(y1, L), numberToBytesBE(y0, L)); - } -} -function signatureG2ToBytes(point) { - point.assertValidity(); - const { BYTES: L } = Fp; - if (point.is0()) - return concatBytes(COMPZERO, numberToBytesBE(_0n, L)); - const { x, y } = point.toAffine(); - const { re: x0, im: x1 } = Fp2.reim(x); - const { re: y0, im: y1 } = Fp2.reim(y); - const tmp = y1 > _0n ? y1 * _2n : y0 * _2n; - const sort = Boolean((tmp / Fp.ORDER) & _1n); - const z2 = x0; - return concatBytes(setMask(numberToBytesBE(x1, L), { sort, compressed: true }), numberToBytesBE(z2, L)); -} -function pointG2FromBytes(bytes) { - const { BYTES: L, ORDER: P } = Fp; - const { compressed, infinity, sort, value } = parseMask(bytes); - if ((!compressed && !infinity && sort) || // 00100000 - (!compressed && infinity && sort) || // 01100000 - (sort && infinity && compressed) // 11100000 - ) { - throw new Error('invalid encoding flag: ' + (bytes[0] & 0b1110_0000)); - } - const slc = (b, from, to) => bytesToNumberBE(b.slice(from, to)); - if (value.length === 96 && compressed) { - if (infinity) { - // check that all bytes are 0 - if (value.reduce((p, c) => (p !== 0 ? c + 1 : c), 0) > 0) { - throw new Error('invalid G2 point: compressed'); - } - return { x: Fp2.ZERO, y: Fp2.ZERO }; - } - const x_1 = slc(value, 0, L); - const x_0 = slc(value, L, 2 * L); - const x = Fp2.create({ c0: Fp.create(x_0), c1: Fp.create(x_1) }); - const right = Fp2.add(Fp2.pow(x, _3n), bls12_381_CURVE_G2.b); // y² = x³ + 4 * (u+1) = x³ + b - let y = Fp2.sqrt(right); - const Y_bit = y.c1 === _0n ? (y.c0 * _2n) / P : (y.c1 * _2n) / P ? _1n : _0n; - y = sort && Y_bit > 0 ? y : Fp2.neg(y); - return { x, y }; - } - else if (value.length === 192 && !compressed) { - if (infinity) { - if (value.reduce((p, c) => (p !== 0 ? c + 1 : c), 0) > 0) { - throw new Error('invalid G2 point: uncompressed'); - } - return { x: Fp2.ZERO, y: Fp2.ZERO }; - } - const x1 = slc(value, 0 * L, 1 * L); - const x0 = slc(value, 1 * L, 2 * L); - const y1 = slc(value, 2 * L, 3 * L); - const y0 = slc(value, 3 * L, 4 * L); - return { x: Fp2.fromBigTuple([x0, x1]), y: Fp2.fromBigTuple([y0, y1]) }; - } - else { - throw new Error('invalid G2 point: expected 96/192 bytes'); - } -} -function signatureG2FromBytes(bytes) { - const { ORDER: P } = Fp; - // TODO: Optimize, it's very slow because of sqrt. - const { infinity, sort, value } = parseMask(abytes(bytes)); - const Point = bls12_381.G2.Point; - const half = value.length / 2; - if (half !== 48 && half !== 96) - throw new Error('invalid compressed signature length, expected 96/192 bytes'); - const z1 = bytesToNumberBE(value.slice(0, half)); - const z2 = bytesToNumberBE(value.slice(half)); - // Indicates the infinity point - if (infinity) - return Point.ZERO; - const x1 = Fp.create(z1 & bitMask(Fp.BITS)); - const x2 = Fp.create(z2); - const x = Fp2.create({ c0: x2, c1: x1 }); - const y2 = Fp2.add(Fp2.pow(x, _3n), bls12_381_CURVE_G2.b); // y² = x³ + 4 - // The slow part - let y = Fp2.sqrt(y2); - if (!y) - throw new Error('Failed to find a square root'); - // Choose the y whose leftmost bit of the imaginary part is equal to the a_flag1 - // If y1 happens to be zero, then use the bit of y0 - const { re: y0, im: y1 } = Fp2.reim(y); - const aflag1 = BigInt(sort); - const isGreater = y1 > _0n && (y1 * _2n) / P !== aflag1; - const is0 = y1 === _0n && (y0 * _2n) / P !== aflag1; - if (isGreater || is0) - y = Fp2.neg(y); - const point = Point.fromAffine({ x, y }); - point.assertValidity(); - return point; -} -const signatureCoders = { - ShortSignature: { - fromBytes(bytes) { - return signatureG1FromBytes(abytes(bytes)); - }, - fromHex(hex) { - return signatureG1FromBytes(hexToBytes(hex)); - }, - toBytes(point) { - return signatureG1ToBytes(point); - }, - toRawBytes(point) { - return signatureG1ToBytes(point); - }, - toHex(point) { - return bytesToHex(signatureG1ToBytes(point)); - }, - }, - LongSignature: { - fromBytes(bytes) { - return signatureG2FromBytes(abytes(bytes)); - }, - fromHex(hex) { - return signatureG2FromBytes(hexToBytes(hex)); - }, - toBytes(point) { - return signatureG2ToBytes(point); - }, - toRawBytes(point) { - return signatureG2ToBytes(point); - }, - toHex(point) { - return bytesToHex(signatureG2ToBytes(point)); - }, - }, -}; -const fields = { - Fp, - Fp2, - Fp6, - Fp12, - Fr: bls12_381_Fr, -}; -const G1_Point = weierstrass(bls12_381_CURVE_G1, { - allowInfinityPoint: true, - Fn: bls12_381_Fr, - fromBytes: pointG1FromBytes, - toBytes: pointG1ToBytes, - // Checks is the point resides in prime-order subgroup. - // point.isTorsionFree() should return true for valid points - // It returns false for shitty points. - // https://eprint.iacr.org/2021/1130.pdf - isTorsionFree: (c, point) => { - // GLV endomorphism ψ(P) - const beta = BigInt('0x5f19672fdf76ce51ba69c6076a0f77eaddb3a93be6f89688de17d813620a00022e01fffffffefffe'); - const phi = new c(Fp.mul(point.X, beta), point.Y, point.Z); - // TODO: unroll - const xP = point.multiplyUnsafe(BLS_X).negate(); // [x]P - const u2P = xP.multiplyUnsafe(BLS_X); // [u2]P - return u2P.equals(phi); - }, - // Clear cofactor of G1 - // https://eprint.iacr.org/2019/403 - clearCofactor: (_c, point) => { - // return this.multiplyUnsafe(CURVE.h); - return point.multiplyUnsafe(BLS_X).add(point); // x*P + P - }, -}); -const G2_Point = weierstrass(bls12_381_CURVE_G2, { - Fp: Fp2, - allowInfinityPoint: true, - Fn: bls12_381_Fr, - fromBytes: pointG2FromBytes, - toBytes: pointG2ToBytes, - // https://eprint.iacr.org/2021/1130.pdf - // Older version: https://eprint.iacr.org/2019/814.pdf - isTorsionFree: (c, P) => { - return P.multiplyUnsafe(BLS_X).negate().equals(G2psi(c, P)); // ψ(P) == [u](P) - }, - // clear_cofactor_bls12381_g2 from RFC 9380. - // https://eprint.iacr.org/2017/419.pdf - // prettier-ignore - clearCofactor: (c, P) => { - const x = BLS_X; - let t1 = P.multiplyUnsafe(x).negate(); // [-x]P - let t2 = G2psi(c, P); // Ψ(P) - let t3 = P.double(); // 2P - t3 = G2psi2(c, t3); // Ψ²(2P) - t3 = t3.subtract(t2); // Ψ²(2P) - Ψ(P) - t2 = t1.add(t2); // [-x]P + Ψ(P) - t2 = t2.multiplyUnsafe(x).negate(); // [x²]P - [x]Ψ(P) - t3 = t3.add(t2); // Ψ²(2P) - Ψ(P) + [x²]P - [x]Ψ(P) - t3 = t3.subtract(t1); // Ψ²(2P) - Ψ(P) + [x²]P - [x]Ψ(P) + [x]P - const Q = t3.subtract(P); // Ψ²(2P) - Ψ(P) + [x²]P - [x]Ψ(P) + [x]P - 1P - return Q; // [x²-x-1]P + [x-1]Ψ(P) + Ψ²(2P) - }, -}); -const bls12_hasher_opts = { - mapToG1: mapToG1, - mapToG2: mapToG2, - hasherOpts: hasher_opts, - hasherOptsG1: { ...hasher_opts, m: 1, DST: 'BLS_SIG_BLS12381G1_XMD:SHA-256_SSWU_RO_NUL_' }, - hasherOptsG2: { ...hasher_opts }, -}; -const bls12_params = { - ateLoopSize: BLS_X, // The BLS parameter x for BLS12-381 - xNegative: true, - twistType: 'multiplicative', - randomBytes: randomBytes, -}; -/** - * bls12-381 pairing-friendly curve construction. - * Provides both longSignatures and shortSignatures. - */ -export const bls12_381 = bls(fields, G1_Point, G2_Point, bls12_params, bls12_hasher_opts, signatureCoders); -// 3-isogeny map from E' to E https://www.rfc-editor.org/rfc/rfc9380#appendix-E.3 -const isogenyMapG2 = isogenyMap(Fp2, [ - // xNum - [ - [ - '0x5c759507e8e333ebb5b7a9a47d7ed8532c52d39fd3a042a88b58423c50ae15d5c2638e343d9c71c6238aaaaaaaa97d6', - '0x5c759507e8e333ebb5b7a9a47d7ed8532c52d39fd3a042a88b58423c50ae15d5c2638e343d9c71c6238aaaaaaaa97d6', - ], - [ - '0x0', - '0x11560bf17baa99bc32126fced787c88f984f87adf7ae0c7f9a208c6b4f20a4181472aaa9cb8d555526a9ffffffffc71a', - ], - [ - '0x11560bf17baa99bc32126fced787c88f984f87adf7ae0c7f9a208c6b4f20a4181472aaa9cb8d555526a9ffffffffc71e', - '0x8ab05f8bdd54cde190937e76bc3e447cc27c3d6fbd7063fcd104635a790520c0a395554e5c6aaaa9354ffffffffe38d', - ], - [ - '0x171d6541fa38ccfaed6dea691f5fb614cb14b4e7f4e810aa22d6108f142b85757098e38d0f671c7188e2aaaaaaaa5ed1', - '0x0', - ], - ], - // xDen - [ - [ - '0x0', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaa63', - ], - [ - '0xc', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaa9f', - ], - ['0x1', '0x0'], // LAST 1 - ], - // yNum - [ - [ - '0x1530477c7ab4113b59a4c18b076d11930f7da5d4a07f649bf54439d87d27e500fc8c25ebf8c92f6812cfc71c71c6d706', - '0x1530477c7ab4113b59a4c18b076d11930f7da5d4a07f649bf54439d87d27e500fc8c25ebf8c92f6812cfc71c71c6d706', - ], - [ - '0x0', - '0x5c759507e8e333ebb5b7a9a47d7ed8532c52d39fd3a042a88b58423c50ae15d5c2638e343d9c71c6238aaaaaaaa97be', - ], - [ - '0x11560bf17baa99bc32126fced787c88f984f87adf7ae0c7f9a208c6b4f20a4181472aaa9cb8d555526a9ffffffffc71c', - '0x8ab05f8bdd54cde190937e76bc3e447cc27c3d6fbd7063fcd104635a790520c0a395554e5c6aaaa9354ffffffffe38f', - ], - [ - '0x124c9ad43b6cf79bfbf7043de3811ad0761b0f37a1e26286b0e977c69aa274524e79097a56dc4bd9e1b371c71c718b10', - '0x0', - ], - ], - // yDen - [ - [ - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffa8fb', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffa8fb', - ], - [ - '0x0', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffa9d3', - ], - [ - '0x12', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaa99', - ], - ['0x1', '0x0'], // LAST 1 - ], -].map((i) => i.map((pair) => Fp2.fromBigTuple(pair.map(BigInt))))); -// 11-isogeny map from E' to E -const isogenyMapG1 = isogenyMap(Fp, [ - // xNum - [ - '0x11a05f2b1e833340b809101dd99815856b303e88a2d7005ff2627b56cdb4e2c85610c2d5f2e62d6eaeac1662734649b7', - '0x17294ed3e943ab2f0588bab22147a81c7c17e75b2f6a8417f565e33c70d1e86b4838f2a6f318c356e834eef1b3cb83bb', - '0xd54005db97678ec1d1048c5d10a9a1bce032473295983e56878e501ec68e25c958c3e3d2a09729fe0179f9dac9edcb0', - '0x1778e7166fcc6db74e0609d307e55412d7f5e4656a8dbf25f1b33289f1b330835336e25ce3107193c5b388641d9b6861', - '0xe99726a3199f4436642b4b3e4118e5499db995a1257fb3f086eeb65982fac18985a286f301e77c451154ce9ac8895d9', - '0x1630c3250d7313ff01d1201bf7a74ab5db3cb17dd952799b9ed3ab9097e68f90a0870d2dcae73d19cd13c1c66f652983', - '0xd6ed6553fe44d296a3726c38ae652bfb11586264f0f8ce19008e218f9c86b2a8da25128c1052ecaddd7f225a139ed84', - '0x17b81e7701abdbe2e8743884d1117e53356de5ab275b4db1a682c62ef0f2753339b7c8f8c8f475af9ccb5618e3f0c88e', - '0x80d3cf1f9a78fc47b90b33563be990dc43b756ce79f5574a2c596c928c5d1de4fa295f296b74e956d71986a8497e317', - '0x169b1f8e1bcfa7c42e0c37515d138f22dd2ecb803a0c5c99676314baf4bb1b7fa3190b2edc0327797f241067be390c9e', - '0x10321da079ce07e272d8ec09d2565b0dfa7dccdde6787f96d50af36003b14866f69b771f8c285decca67df3f1605fb7b', - '0x6e08c248e260e70bd1e962381edee3d31d79d7e22c837bc23c0bf1bc24c6b68c24b1b80b64d391fa9c8ba2e8ba2d229', - ], - // xDen - [ - '0x8ca8d548cff19ae18b2e62f4bd3fa6f01d5ef4ba35b48ba9c9588617fc8ac62b558d681be343df8993cf9fa40d21b1c', - '0x12561a5deb559c4348b4711298e536367041e8ca0cf0800c0126c2588c48bf5713daa8846cb026e9e5c8276ec82b3bff', - '0xb2962fe57a3225e8137e629bff2991f6f89416f5a718cd1fca64e00b11aceacd6a3d0967c94fedcfcc239ba5cb83e19', - '0x3425581a58ae2fec83aafef7c40eb545b08243f16b1655154cca8abc28d6fd04976d5243eecf5c4130de8938dc62cd8', - '0x13a8e162022914a80a6f1d5f43e7a07dffdfc759a12062bb8d6b44e833b306da9bd29ba81f35781d539d395b3532a21e', - '0xe7355f8e4e667b955390f7f0506c6e9395735e9ce9cad4d0a43bcef24b8982f7400d24bc4228f11c02df9a29f6304a5', - '0x772caacf16936190f3e0c63e0596721570f5799af53a1894e2e073062aede9cea73b3538f0de06cec2574496ee84a3a', - '0x14a7ac2a9d64a8b230b3f5b074cf01996e7f63c21bca68a81996e1cdf9822c580fa5b9489d11e2d311f7d99bbdcc5a5e', - '0xa10ecf6ada54f825e920b3dafc7a3cce07f8d1d7161366b74100da67f39883503826692abba43704776ec3a79a1d641', - '0x95fc13ab9e92ad4476d6e3eb3a56680f682b4ee96f7d03776df533978f31c1593174e4b4b7865002d6384d168ecdd0a', - '0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001', // LAST 1 - ], - // yNum - [ - '0x90d97c81ba24ee0259d1f094980dcfa11ad138e48a869522b52af6c956543d3cd0c7aee9b3ba3c2be9845719707bb33', - '0x134996a104ee5811d51036d776fb46831223e96c254f383d0f906343eb67ad34d6c56711962fa8bfe097e75a2e41c696', - '0xcc786baa966e66f4a384c86a3b49942552e2d658a31ce2c344be4b91400da7d26d521628b00523b8dfe240c72de1f6', - '0x1f86376e8981c217898751ad8746757d42aa7b90eeb791c09e4a3ec03251cf9de405aba9ec61deca6355c77b0e5f4cb', - '0x8cc03fdefe0ff135caf4fe2a21529c4195536fbe3ce50b879833fd221351adc2ee7f8dc099040a841b6daecf2e8fedb', - '0x16603fca40634b6a2211e11db8f0a6a074a7d0d4afadb7bd76505c3d3ad5544e203f6326c95a807299b23ab13633a5f0', - '0x4ab0b9bcfac1bbcb2c977d027796b3ce75bb8ca2be184cb5231413c4d634f3747a87ac2460f415ec961f8855fe9d6f2', - '0x987c8d5333ab86fde9926bd2ca6c674170a05bfe3bdd81ffd038da6c26c842642f64550fedfe935a15e4ca31870fb29', - '0x9fc4018bd96684be88c9e221e4da1bb8f3abd16679dc26c1e8b6e6a1f20cabe69d65201c78607a360370e577bdba587', - '0xe1bba7a1186bdb5223abde7ada14a23c42a0ca7915af6fe06985e7ed1e4d43b9b3f7055dd4eba6f2bafaaebca731c30', - '0x19713e47937cd1be0dfd0b8f1d43fb93cd2fcbcb6caf493fd1183e416389e61031bf3a5cce3fbafce813711ad011c132', - '0x18b46a908f36f6deb918c143fed2edcc523559b8aaf0c2462e6bfe7f911f643249d9cdf41b44d606ce07c8a4d0074d8e', - '0xb182cac101b9399d155096004f53f447aa7b12a3426b08ec02710e807b4633f06c851c1919211f20d4c04f00b971ef8', - '0x245a394ad1eca9b72fc00ae7be315dc757b3b080d4c158013e6632d3c40659cc6cf90ad1c232a6442d9d3f5db980133', - '0x5c129645e44cf1102a159f748c4a3fc5e673d81d7e86568d9ab0f5d396a7ce46ba1049b6579afb7866b1e715475224b', - '0x15e6be4e990f03ce4ea50b3b42df2eb5cb181d8f84965a3957add4fa95af01b2b665027efec01c7704b456be69c8b604', - ], - // yDen - [ - '0x16112c4c3a9c98b252181140fad0eae9601a6de578980be6eec3232b5be72e7a07f3688ef60c206d01479253b03663c1', - '0x1962d75c2381201e1a0cbd6c43c348b885c84ff731c4d59ca4a10356f453e01f78a4260763529e3532f6102c2e49a03d', - '0x58df3306640da276faaae7d6e8eb15778c4855551ae7f310c35a5dd279cd2eca6757cd636f96f891e2538b53dbf67f2', - '0x16b7d288798e5395f20d23bf89edb4d1d115c5dbddbcd30e123da489e726af41727364f2c28297ada8d26d98445f5416', - '0xbe0e079545f43e4b00cc912f8228ddcc6d19c9f0f69bbb0542eda0fc9dec916a20b15dc0fd2ededda39142311a5001d', - '0x8d9e5297186db2d9fb266eaac783182b70152c65550d881c5ecd87b6f0f5a6449f38db9dfa9cce202c6477faaf9b7ac', - '0x166007c08a99db2fc3ba8734ace9824b5eecfdfa8d0cf8ef5dd365bc400a0051d5fa9c01a58b1fb93d1a1399126a775c', - '0x16a3ef08be3ea7ea03bcddfabba6ff6ee5a4375efa1f4fd7feb34fd206357132b920f5b00801dee460ee415a15812ed9', - '0x1866c8ed336c61231a1be54fd1d74cc4f9fb0ce4c6af5920abc5750c4bf39b4852cfe2f7bb9248836b233d9d55535d4a', - '0x167a55cda70a6e1cea820597d94a84903216f763e13d87bb5308592e7ea7d4fbc7385ea3d529b35e346ef48bb8913f55', - '0x4d2f259eea405bd48f010a01ad2911d9c6dd039bb61a6290e591b36e636a5c871a5c29f4f83060400f8b49cba8f6aa8', - '0xaccbb67481d033ff5852c1e48c50c477f94ff8aefce42d28c0f9a88cea7913516f968986f7ebbea9684b529e2561092', - '0xad6b9514c767fe3c3613144b45f1496543346d98adf02267d5ceef9a00d9b8693000763e3b90ac11e99b138573345cc', - '0x2660400eb2e4f3b628bdd0d53cd76f2bf565b94e72927c1cb748df27942480e420517bd8714cc80d1fadc1326ed06f7', - '0xe0fa1d816ddc03e6b24255e0d7819c171c40f65e273b853324efcd6356caa205ca2f570f13497804415473a1d634b8f', - '0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001', // LAST 1 - ], -].map((i) => i.map((j) => BigInt(j)))); -// Optimized SWU Map - Fp to G1 -const G1_SWU = mapToCurveSimpleSWU(Fp, { - A: Fp.create(BigInt('0x144698a3b8e9433d693a02c96d4982b0ea985383ee66a8d8e8981aefd881ac98936f8da0e0f97f5cf428082d584c1d')), - B: Fp.create(BigInt('0x12e2908d11688030018b12e8753eee3b2016c1f0f24f4070a0b9c14fcef35ef55a23215a316ceaa5d1cc48e98e172be0')), - Z: Fp.create(BigInt(11)), -}); -// SWU Map - Fp2 to G2': y² = x³ + 240i * x + 1012 + 1012i -const G2_SWU = mapToCurveSimpleSWU(Fp2, { - A: Fp2.create({ c0: Fp.create(_0n), c1: Fp.create(BigInt(240)) }), // A' = 240 * I - B: Fp2.create({ c0: Fp.create(BigInt(1012)), c1: Fp.create(BigInt(1012)) }), // B' = 1012 * (1 + I) - Z: Fp2.create({ c0: Fp.create(BigInt(-2)), c1: Fp.create(BigInt(-1)) }), // Z: -(2 + I) -}); -function mapToG1(scalars) { - const { x, y } = G1_SWU(Fp.create(scalars[0])); - return isogenyMapG1(x, y); -} -function mapToG2(scalars) { - const { x, y } = G2_SWU(Fp2.fromBigTuple(scalars)); - return isogenyMapG2(x, y); -} -//# sourceMappingURL=bls12-381.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/bls12-381.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/bls12-381.js.map deleted file mode 100644 index e1655398..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/bls12-381.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bls12-381.js","sourceRoot":"","sources":["src/bls12-381.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6EG;AACH,sEAAsE;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAmC,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,KAAK,EAAe,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EACL,MAAM,EACN,MAAM,EACN,OAAO,EACP,UAAU,EACV,eAAe,EACf,WAAW,EACX,SAAS,EACT,UAAU,EACV,eAAe,EACf,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,QAAQ;AACR,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EACL,mBAAmB,EACnB,WAAW,GAKZ,MAAM,2BAA2B,CAAC;AAEnC,qEAAqE;AACrE,kBAAkB;AAClB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GA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AAG,mBAAmB,CAAC,GAAG,EAAE;IACtC,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,eAAe;IAClF,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,sBAAsB;IACnG,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,cAAc;CACxF,CAAC,CAAC;AAEH,SAAS,OAAO,CAAC,OAAiB;IAChC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/C,OAAO,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5B,CAAC;AACD,SAAS,OAAO,CAAC,OAAiB;IAChC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,OAAsB,CAAC,CAAC,CAAC;IAClE,OAAO,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/bn254.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/bn254.d.ts deleted file mode 100644 index 87961963..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/bn254.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -/** - * bn254, previously known as alt_bn_128, when it had 128-bit security. - -Barbulescu-Duquesne 2017 shown it's weaker: just about 100 bits, -so the naming has been adjusted to its prime bit count: -https://hal.science/hal-01534101/file/main.pdf. -Compatible with EIP-196 and EIP-197. - -There are huge compatibility issues in the ecosystem: - -1. Different libraries call it in different ways: "bn254", "bn256", "alt_bn128", "bn128". -2. libff has bn128, but it's a different curve with different G2: - https://github.com/scipr-lab/libff/blob/a44f482e18b8ac04d034c193bd9d7df7817ad73f/libff/algebra/curves/bn128/bn128_init.cpp#L166-L169 -3. halo2curves bn256 is also incompatible and returns different outputs - -We don't implement Point methods toHex / toBytes. -To work around this limitation, has to initialize points on their own from BigInts. -Reason it's not implemented is because [there is no standard](https://github.com/privacy-scaling-explorations/halo2curves/issues/109). -Points of divergence: - -- Endianness: LE vs BE (byte-swapped) -- Flags as first hex bits (similar to BLS) vs no-flags -- Imaginary part last in G2 vs first (c0, c1 vs c1, c0) - -The goal of our implementation is to support "Ethereum" variant of the curve, -because it at least has specs: - -- EIP196 (https://eips.ethereum.org/EIPS/eip-196) describes bn254 ECADD and ECMUL opcodes for EVM -- EIP197 (https://eips.ethereum.org/EIPS/eip-197) describes bn254 pairings -- It's hard: EIPs don't have proper tests. EIP-197 returns boolean output instead of Fp12 -- The existing implementations are bad. Some are deprecated: - - https://github.com/paritytech/bn (old version) - - https://github.com/ewasm/ethereum-bn128.rs (uses paritytech/bn) - - https://github.com/zcash-hackworks/bn - - https://github.com/arkworks-rs/curves/blob/master/bn254/src/lib.rs -- Python implementations use different towers and produce different Fp12 outputs: - - https://github.com/ethereum/py_pairing - - https://github.com/ethereum/py_ecc/tree/main/py_ecc/bn128 -- Points are encoded differently in different implementations - -### Params -Seed (X): 4965661367192848881 -Fr: (36x⁴+36x³+18x²+6x+1) -Fp: (36x⁴+36x³+24x²+6x+1) -(E / Fp ): Y² = X³+3 -(Et / Fp²): Y² = X³+3/(u+9) (D-type twist) -Ate loop size: 6x+2 - -### Towers -- Fp²[u] = Fp/u²+1 -- Fp⁶[v] = Fp²/v³-9-u -- Fp¹²[w] = Fp⁶/w²-v - - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { type BlsCurvePair, type BlsPostPrecomputeFn } from './abstract/bls.ts'; -import { type IField } from './abstract/modular.ts'; -export declare const bn254_Fr: IField; -export declare const _postPrecompute: BlsPostPrecomputeFn; -/** - * bn254 (a.k.a. alt_bn128) pairing-friendly curve. - * Contains G1 / G2 operations and pairings. - */ -export declare const bn254: BlsCurvePair; -//# sourceMappingURL=bn254.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/bn254.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/bn254.d.ts.map deleted file mode 100644 index 5a8693ad..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/bn254.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bn254.d.ts","sourceRoot":"","sources":["src/bn254.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,sEAAsE;AACtE,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,mBAAmB,EAEzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAS,KAAK,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAyB3D,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,CAA2B,CAAC;AAoChE,eAAO,MAAM,eAAe,EAAE,mBAY7B,CAAC;AA8EF;;;GAGG;AAEH,eAAO,MAAM,KAAK,EAAE,YAAiE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/bn254.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/bn254.js deleted file mode 100644 index ffbbe789..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/bn254.js +++ /dev/null @@ -1,190 +0,0 @@ -/** - * bn254, previously known as alt_bn_128, when it had 128-bit security. - -Barbulescu-Duquesne 2017 shown it's weaker: just about 100 bits, -so the naming has been adjusted to its prime bit count: -https://hal.science/hal-01534101/file/main.pdf. -Compatible with EIP-196 and EIP-197. - -There are huge compatibility issues in the ecosystem: - -1. Different libraries call it in different ways: "bn254", "bn256", "alt_bn128", "bn128". -2. libff has bn128, but it's a different curve with different G2: - https://github.com/scipr-lab/libff/blob/a44f482e18b8ac04d034c193bd9d7df7817ad73f/libff/algebra/curves/bn128/bn128_init.cpp#L166-L169 -3. halo2curves bn256 is also incompatible and returns different outputs - -We don't implement Point methods toHex / toBytes. -To work around this limitation, has to initialize points on their own from BigInts. -Reason it's not implemented is because [there is no standard](https://github.com/privacy-scaling-explorations/halo2curves/issues/109). -Points of divergence: - -- Endianness: LE vs BE (byte-swapped) -- Flags as first hex bits (similar to BLS) vs no-flags -- Imaginary part last in G2 vs first (c0, c1 vs c1, c0) - -The goal of our implementation is to support "Ethereum" variant of the curve, -because it at least has specs: - -- EIP196 (https://eips.ethereum.org/EIPS/eip-196) describes bn254 ECADD and ECMUL opcodes for EVM -- EIP197 (https://eips.ethereum.org/EIPS/eip-197) describes bn254 pairings -- It's hard: EIPs don't have proper tests. EIP-197 returns boolean output instead of Fp12 -- The existing implementations are bad. Some are deprecated: - - https://github.com/paritytech/bn (old version) - - https://github.com/ewasm/ethereum-bn128.rs (uses paritytech/bn) - - https://github.com/zcash-hackworks/bn - - https://github.com/arkworks-rs/curves/blob/master/bn254/src/lib.rs -- Python implementations use different towers and produce different Fp12 outputs: - - https://github.com/ethereum/py_pairing - - https://github.com/ethereum/py_ecc/tree/main/py_ecc/bn128 -- Points are encoded differently in different implementations - -### Params -Seed (X): 4965661367192848881 -Fr: (36x⁴+36x³+18x²+6x+1) -Fp: (36x⁴+36x³+24x²+6x+1) -(E / Fp ): Y² = X³+3 -(Et / Fp²): Y² = X³+3/(u+9) (D-type twist) -Ate loop size: 6x+2 - -### Towers -- Fp²[u] = Fp/u²+1 -- Fp⁶[v] = Fp²/v³-9-u -- Fp¹²[w] = Fp⁶/w²-v - - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { blsBasic, } from "./abstract/bls.js"; -import { Field } from "./abstract/modular.js"; -import { psiFrobenius, tower12 } from "./abstract/tower.js"; -import { weierstrass } from "./abstract/weierstrass.js"; -import { bitLen } from "./utils.js"; -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3); -const _6n = BigInt(6); -const BN_X = BigInt('4965661367192848881'); -const BN_X_LEN = bitLen(BN_X); -const SIX_X_SQUARED = _6n * BN_X ** _2n; -const bn254_G1_CURVE = { - p: BigInt('0x30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47'), - n: BigInt('0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001'), - h: _1n, - a: _0n, - b: _3n, - Gx: _1n, - Gy: BigInt(2), -}; -// r == n -// Finite field over r. It's for convenience and is not used in the code below. -export const bn254_Fr = Field(bn254_G1_CURVE.n); -// Fp2.div(Fp2.mul(Fp2.ONE, _3n), Fp2.NONRESIDUE) -const Fp2B = { - c0: BigInt('19485874751759354771024239261021720505790618469301721065564631296452457478373'), - c1: BigInt('266929791119991161246907387137283842545076965332900288569378510910307636690'), -}; -const { Fp, Fp2, Fp6, Fp12 } = tower12({ - ORDER: bn254_G1_CURVE.p, - X_LEN: BN_X_LEN, - FP2_NONRESIDUE: [BigInt(9), _1n], - Fp2mulByB: (num) => Fp2.mul(num, Fp2B), - Fp12finalExponentiate: (num) => { - const powMinusX = (num) => Fp12.conjugate(Fp12._cyclotomicExp(num, BN_X)); - const r0 = Fp12.mul(Fp12.conjugate(num), Fp12.inv(num)); - const r = Fp12.mul(Fp12.frobeniusMap(r0, 2), r0); - const y1 = Fp12._cyclotomicSquare(powMinusX(r)); - const y2 = Fp12.mul(Fp12._cyclotomicSquare(y1), y1); - const y4 = powMinusX(y2); - const y6 = powMinusX(Fp12._cyclotomicSquare(y4)); - const y8 = Fp12.mul(Fp12.mul(Fp12.conjugate(y6), y4), Fp12.conjugate(y2)); - const y9 = Fp12.mul(y8, y1); - return Fp12.mul(Fp12.frobeniusMap(Fp12.mul(Fp12.conjugate(r), y9), 3), Fp12.mul(Fp12.frobeniusMap(y8, 2), Fp12.mul(Fp12.frobeniusMap(y9, 1), Fp12.mul(Fp12.mul(y8, y4), r)))); - }, -}); -// END OF CURVE FIELDS -const { G2psi, psi } = psiFrobenius(Fp, Fp2, Fp2.NONRESIDUE); -export const _postPrecompute = (Rx, Ry, Rz, Qx, Qy, pointAdd) => { - const q = psi(Qx, Qy); - ({ Rx, Ry, Rz } = pointAdd(Rx, Ry, Rz, q[0], q[1])); - const q2 = psi(q[0], q[1]); - pointAdd(Rx, Ry, Rz, q2[0], Fp2.neg(q2[1])); -}; -// cofactor: (36 * X^4) + (36 * X^3) + (30 * X^2) + 6*X + 1 -const bn254_G2_CURVE = { - p: Fp2.ORDER, - n: bn254_G1_CURVE.n, - h: BigInt('0x30644e72e131a029b85045b68181585e06ceecda572a2489345f2299c0f9fa8d'), - a: Fp2.ZERO, - b: Fp2B, - Gx: Fp2.fromBigTuple([ - BigInt('10857046999023057135944570762232829481370756359578518086990519993285655852781'), - BigInt('11559732032986387107991004021392285783925812861821192530917403151452391805634'), - ]), - Gy: Fp2.fromBigTuple([ - BigInt('8495653923123431417604973247489272438418190587263600148770280649306958101930'), - BigInt('4082367875863433681332203403145435568316851327593401208105741076214120093531'), - ]), -}; -const fields = { Fp, Fp2, Fp6, Fp12, Fr: bn254_Fr }; -const bn254_G1 = weierstrass(bn254_G1_CURVE, { - Fp, - Fn: bn254_Fr, - allowInfinityPoint: true, -}); -const bn254_G2 = weierstrass(bn254_G2_CURVE, { - Fp: Fp2, - Fn: bn254_Fr, - allowInfinityPoint: true, - isTorsionFree: (c, P) => P.multiplyUnsafe(SIX_X_SQUARED).equals(G2psi(c, P)), // [p]P = [6X^2]P -}); -/* -No hashToCurve for now (and signatures): - -- RFC 9380 doesn't mention bn254 and doesn't provide test vectors -- Overall seems like nobody is using BLS signatures on top of bn254 -- Seems like it can utilize SVDW, which is not implemented yet -*/ -// const htfDefaults = Object.freeze({ -// // DST: a domain separation tag defined in section 2.2.5 -// DST: 'BN254G2_XMD:SHA-256_SVDW_RO_', -// encodeDST: 'BN254G2_XMD:SHA-256_SVDW_RO_', -// p: Fp.ORDER, -// m: 2, -// k: 128, -// expand: 'xmd', -// hash: sha256, -// }); -// const hasherOpts = { -// { ...htfDefaults, m: 1, DST: 'BN254G2_XMD:SHA-256_SVDW_RO_' } -// }; -const bn254_params = { - ateLoopSize: BN_X * _6n + _2n, - r: bn254_Fr.ORDER, - xNegative: false, - twistType: 'divisive', - postPrecompute: _postPrecompute, -}; -// const bn254_hasher = { -// hasherOpts: htfDefaults, -// hasherOptsG1: { m: 1, DST: 'BN254G2_XMD:SHA-256_SVDW_RO_' }, -// hasherOptsG2: htfDefaults -// }; -// G2_heff hEff: BigInt('21888242871839275222246405745257275088844257914179612981679871602714643921549'), -// fromBytes: notImplemented, -// toBytes: notImplemented, -// mapToCurve: notImplemented, -// fromBytes: notImplemented, -// toBytes: notImplemented, -// ShortSignature: { -// fromBytes: notImplemented, -// fromHex: notImplemented, -// toBytes: notImplemented, -// toRawBytes: notImplemented, -// toHex: notImplemented, -// }, -/** - * bn254 (a.k.a. alt_bn128) pairing-friendly curve. - * Contains G1 / G2 operations and pairings. - */ -// bn254_hasher -export const bn254 = blsBasic(fields, bn254_G1, bn254_G2, bn254_params); -//# sourceMappingURL=bn254.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/bn254.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/bn254.js.map deleted file mode 100644 index 3edcb95e..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/bn254.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bn254.js","sourceRoot":"","sources":["src/bn254.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,sEAAsE;AACtE,OAAO,EACL,QAAQ,GAIT,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,EAAe,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAwB,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,kBAAkB;AAClB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACzE,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAEtB,MAAM,IAAI,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAC3C,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;AAC9B,MAAM,aAAa,GAAG,GAAG,GAAG,IAAI,IAAI,GAAG,CAAC;AAExC,MAAM,cAAc,GAA4B;IAC9C,CAAC,EAAE,MAAM,CAAC,oEAAoE,CAAC;IAC/E,CAAC,EAAE,MAAM,CAAC,oEAAoE,CAAC;IAC/E,CAAC,EAAE,GAAG;IACN,CAAC,EAAE,GAAG;IACN,CAAC,EAAE,GAAG;IACN,EAAE,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,kBAAkB,EAAE,IAAI;IACxB,aAAa,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,iBAAiB;CAChG,CAAC,CAAC;AACH;;;;;;EAME;AACF,sCAAsC;AACtC,6DAA6D;AAC7D,yCAAyC;AACzC,+CAA+C;AAC/C,iBAAiB;AACjB,UAAU;AACV,YAAY;AACZ,mBAAmB;AACnB,kBAAkB;AAClB,MAAM;AACN,uBAAuB;AACvB,kEAAkE;AAClE,KAAK;AACL,MAAM,YAAY,GAAG;IACnB,WAAW,EAAE,IAAI,GAAG,GAAG,GAAG,GAAG;IAC7B,CAAC,EAAE,QAAQ,CAAC,KAAK;IACjB,SAAS,EAAE,KAAK;IAChB,SAAS,EAAE,UAAmB;IAC9B,cAAc,EAAE,eAAe;CAChC,CAAC;AACF,yBAAyB;AACzB,6BAA6B;AAC7B,iEAAiE;AACjE,8BAA8B;AAC9B,KAAK;AACL,6GAA6G;AAC7G,6BAA6B;AAC7B,2BAA2B;AAE3B,8BAA8B;AAC9B,6BAA6B;AAC7B,2BAA2B;AAC3B,oBAAoB;AACpB,+BAA+B;AAC/B,6BAA6B;AAC7B,6BAA6B;AAC7B,gCAAgC;AAChC,2BAA2B;AAC3B,KAAK;AAEL;;;GAGG;AACH,eAAe;AACf,MAAM,CAAC,MAAM,KAAK,GAAiB,QAAQ,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/ed25519.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/ed25519.d.ts deleted file mode 100644 index cfa8801f..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/ed25519.d.ts +++ /dev/null @@ -1,101 +0,0 @@ -import { type AffinePoint } from './abstract/curve.ts'; -import { PrimeEdwardsPoint, type EdDSA, type EdwardsPoint, type EdwardsPointCons } from './abstract/edwards.ts'; -import { type H2CHasher, type H2CHasherBase } from './abstract/hash-to-curve.ts'; -import { type IField } from './abstract/modular.ts'; -import { type MontgomeryECDH } from './abstract/montgomery.ts'; -import { type OPRF } from './abstract/oprf.ts'; -/** - * ed25519 curve with EdDSA signatures. - * @example - * ```js - * import { ed25519 } from '@noble/curves/ed25519.js'; - * const { secretKey, publicKey } = ed25519.keygen(); - * // const publicKey = ed25519.getPublicKey(secretKey); - * const msg = new TextEncoder().encode('hello noble'); - * const sig = ed25519.sign(msg, secretKey); - * const isValid = ed25519.verify(sig, msg, pub); // ZIP215 - * // RFC8032 / FIPS 186-5 - * const isValid2 = ed25519.verify(sig, msg, pub, { zip215: false }); - * ``` - */ -export declare const ed25519: EdDSA; -/** Context version of ed25519 (ctx for domain separation). See {@link ed25519} */ -export declare const ed25519ctx: EdDSA; -/** Prehashed version of ed25519. See {@link ed25519} */ -export declare const ed25519ph: EdDSA; -/** - * ECDH using curve25519 aka x25519. - * @example - * ```js - * import { x25519 } from '@noble/curves/ed25519.js'; - * const alice = x25519.keygen(); - * const bob = x25519.keygen(); - * const shared = x25519.getSharedSecret(alice.secretKey, bob.publicKey); - * ``` - */ -export declare const x25519: MontgomeryECDH; -/** - * RFC 9380 method `map_to_curve_elligator2_curve25519`. Experimental name: may be renamed later. - * @private - */ -export declare function _map_to_curve_elligator2_curve25519(u: bigint): { - xMn: bigint; - xMd: bigint; - yMn: bigint; - yMd: bigint; -}; -/** Hashing to ed25519 points / field. RFC 9380 methods. */ -export declare const ed25519_hasher: H2CHasher; -/** - * Wrapper over Edwards Point for ristretto255. - * - * Each ed25519/EdwardsPoint has 8 different equivalent points. This can be - * a source of bugs for protocols like ring signatures. Ristretto was created to solve this. - * Ristretto point operates in X:Y:Z:T extended coordinates like EdwardsPoint, - * but it should work in its own namespace: do not combine those two. - * See [RFC9496](https://www.rfc-editor.org/rfc/rfc9496). - */ -declare class _RistrettoPoint extends PrimeEdwardsPoint<_RistrettoPoint> { - static BASE: _RistrettoPoint; - static ZERO: _RistrettoPoint; - static Fp: IField; - static Fn: IField; - constructor(ep: EdwardsPoint); - static fromAffine(ap: AffinePoint): _RistrettoPoint; - protected assertSame(other: _RistrettoPoint): void; - protected init(ep: EdwardsPoint): _RistrettoPoint; - static fromBytes(bytes: Uint8Array): _RistrettoPoint; - /** - * Converts ristretto-encoded string to ristretto point. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-decode). - * @param hex Ristretto-encoded 32 bytes. Not every 32-byte string is valid ristretto encoding - */ - static fromHex(hex: string): _RistrettoPoint; - /** - * Encodes ristretto point to Uint8Array. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-encode). - */ - toBytes(): Uint8Array; - /** - * Compares two Ristretto points. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-equals). - */ - equals(other: _RistrettoPoint): boolean; - is0(): boolean; -} -export declare const ristretto255: { - Point: typeof _RistrettoPoint; -}; -/** Hashing to ristretto255 points / field. RFC 9380 methods. */ -export declare const ristretto255_hasher: H2CHasherBase; -/** ristretto255 OPRF, defined in RFC 9497. */ -export declare const ristretto255_oprf: OPRF; -/** - * Weird / bogus points, useful for debugging. - * All 8 ed25519 points of 8-torsion subgroup can be generated from the point - * T = `26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05`. - * ⟨T⟩ = { O, T, 2T, 3T, 4T, 5T, 6T, 7T } - */ -export declare const ED25519_TORSION_SUBGROUP: string[]; -export {}; -//# sourceMappingURL=ed25519.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/ed25519.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/ed25519.d.ts.map deleted file mode 100644 index 09a33c3f..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/ed25519.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed25519.d.ts","sourceRoot":"","sources":["src/ed25519.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAGL,iBAAiB,EACjB,KAAK,KAAK,EAGV,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,aAAa,EACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAML,KAAK,MAAM,EACZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAc,KAAK,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAmG3D;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,OAAO,EAAE,KAA8B,CAAC;AACrD,kFAAkF;AAClF,eAAO,MAAM,UAAU,EAAE,KAAsD,CAAC;AAChF,wDAAwD;AACxD,eAAO,MAAM,SAAS,EAAE,KAAuE,CAAC;AAEhG;;;;;;;;;GASG;AACH,eAAO,MAAM,MAAM,EAAE,cAYjB,CAAC;AASL;;;GAGG;AAEH,wBAAgB,mCAAmC,CAAC,CAAC,EAAE,MAAM,GAAG;IAC9D,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CACnD,CA2CA;AAqBD,2DAA2D;AAC3D,eAAO,MAAM,cAAc,EAAE,SAAS,CAAC,gBAAgB,CAajD,CAAC;AAuDP;;;;;;;;GAQG;AACH,cAAM,eAAgB,SAAQ,iBAAiB,CAAC,eAAe,CAAC;IAI9D,MAAM,CAAC,IAAI,EAAE,eAAe,CACwC;IAEpE,MAAM,CAAC,IAAI,EAAE,eAAe,CACwC;IAEpE,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,CACM;IAE/B,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,CACM;gBAEnB,EAAE,EAAE,YAAY;IAI5B,MAAM,CAAC,UAAU,CAAC,EAAE,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,eAAe;IAI3D,SAAS,CAAC,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI;IAIlD,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,YAAY,GAAG,eAAe;IAIjD,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,eAAe;IA4BpD;;;;OAIG;IACH,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe;IAI5C;;;OAGG;IACH,OAAO,IAAI,UAAU;IA4BrB;;;OAGG;IACH,MAAM,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO;IAWvC,GAAG,IAAI,OAAO;CAGf;AAED,eAAO,MAAM,YAAY,EAAE;IACzB,KAAK,EAAE,OAAO,eAAe,CAAC;CACF,CAAC;AAE/B,gEAAgE;AAChE,eAAO,MAAM,mBAAmB,EAAE,aAAa,CAAC,OAAO,eAAe,CA0CrE,CAAC;AAEF,8CAA8C;AAC9C,eAAO,MAAM,iBAAiB,EAAE,IAOzB,CAAC;AAER;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,EAAE,MAAM,EAS5C,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/ed25519.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/ed25519.js deleted file mode 100644 index 9740cebf..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/ed25519.js +++ /dev/null @@ -1,462 +0,0 @@ -/** - * ed25519 Twisted Edwards curve with following addons: - * - X25519 ECDH - * - Ristretto cofactor elimination - * - Elligator hash-to-group / point indistinguishability - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { sha512 } from '@noble/hashes/sha2.js'; -import { abytes, concatBytes, hexToBytes } from '@noble/hashes/utils.js'; -import {} from "./abstract/curve.js"; -import { eddsa, edwards, PrimeEdwardsPoint, } from "./abstract/edwards.js"; -import { _DST_scalar, createHasher, expand_message_xmd, } from "./abstract/hash-to-curve.js"; -import { FpInvertBatch, FpSqrtEven, isNegativeLE, mod, pow2, } from "./abstract/modular.js"; -import { montgomery } from "./abstract/montgomery.js"; -import { createORPF } from "./abstract/oprf.js"; -import { asciiToBytes, bytesToNumberLE, equalBytes } from "./utils.js"; -// prettier-ignore -const _0n = /* @__PURE__ */ BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = /* @__PURE__ */ BigInt(3); -// prettier-ignore -const _5n = BigInt(5), _8n = BigInt(8); -// P = 2n**255n - 19n -const ed25519_CURVE_p = BigInt('0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed'); -// N = 2n**252n + 27742317777372353535851937790883648493n -// a = Fp.create(BigInt(-1)) -// d = -121665/121666 a.k.a. Fp.neg(121665 * Fp.inv(121666)) -const ed25519_CURVE = /* @__PURE__ */ (() => ({ - p: ed25519_CURVE_p, - n: BigInt('0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed'), - h: _8n, - a: BigInt('0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec'), - d: BigInt('0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3'), - Gx: BigInt('0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a'), - Gy: BigInt('0x6666666666666666666666666666666666666666666666666666666666666658'), -}))(); -function ed25519_pow_2_252_3(x) { - // prettier-ignore - const _10n = BigInt(10), _20n = BigInt(20), _40n = BigInt(40), _80n = BigInt(80); - const P = ed25519_CURVE_p; - const x2 = (x * x) % P; - const b2 = (x2 * x) % P; // x^3, 11 - const b4 = (pow2(b2, _2n, P) * b2) % P; // x^15, 1111 - const b5 = (pow2(b4, _1n, P) * x) % P; // x^31 - const b10 = (pow2(b5, _5n, P) * b5) % P; - const b20 = (pow2(b10, _10n, P) * b10) % P; - const b40 = (pow2(b20, _20n, P) * b20) % P; - const b80 = (pow2(b40, _40n, P) * b40) % P; - const b160 = (pow2(b80, _80n, P) * b80) % P; - const b240 = (pow2(b160, _80n, P) * b80) % P; - const b250 = (pow2(b240, _10n, P) * b10) % P; - const pow_p_5_8 = (pow2(b250, _2n, P) * x) % P; - // ^ To pow to (p+3)/8, multiply it by x. - return { pow_p_5_8, b2 }; -} -function adjustScalarBytes(bytes) { - // Section 5: For X25519, in order to decode 32 random bytes as an integer scalar, - // set the three least significant bits of the first byte - bytes[0] &= 248; // 0b1111_1000 - // and the most significant bit of the last to zero, - bytes[31] &= 127; // 0b0111_1111 - // set the second most significant bit of the last byte to 1 - bytes[31] |= 64; // 0b0100_0000 - return bytes; -} -// √(-1) aka √(a) aka 2^((p-1)/4) -// Fp.sqrt(Fp.neg(1)) -const ED25519_SQRT_M1 = /* @__PURE__ */ BigInt('19681161376707505956807079304988542015446066515923890162744021073123829784752'); -// sqrt(u/v) -function uvRatio(u, v) { - const P = ed25519_CURVE_p; - const v3 = mod(v * v * v, P); // v³ - const v7 = mod(v3 * v3 * v, P); // v⁷ - // (p+3)/8 and (p-5)/8 - const pow = ed25519_pow_2_252_3(u * v7).pow_p_5_8; - let x = mod(u * v3 * pow, P); // (uv³)(uv⁷)^(p-5)/8 - const vx2 = mod(v * x * x, P); // vx² - const root1 = x; // First root candidate - const root2 = mod(x * ED25519_SQRT_M1, P); // Second root candidate - const useRoot1 = vx2 === u; // If vx² = u (mod p), x is a square root - const useRoot2 = vx2 === mod(-u, P); // If vx² = -u, set x <-- x * 2^((p-1)/4) - const noRoot = vx2 === mod(-u * ED25519_SQRT_M1, P); // There is no valid root, vx² = -u√(-1) - if (useRoot1) - x = root1; - if (useRoot2 || noRoot) - x = root2; // We return root2 anyway, for const-time - if (isNegativeLE(x, P)) - x = mod(-x, P); - return { isValid: useRoot1 || useRoot2, value: x }; -} -const ed25519_Point = /* @__PURE__ */ edwards(ed25519_CURVE, { uvRatio }); -const Fp = /* @__PURE__ */ (() => ed25519_Point.Fp)(); -const Fn = /* @__PURE__ */ (() => ed25519_Point.Fn)(); -function ed25519_domain(data, ctx, phflag) { - if (ctx.length > 255) - throw new Error('Context is too big'); - return concatBytes(asciiToBytes('SigEd25519 no Ed25519 collisions'), new Uint8Array([phflag ? 1 : 0, ctx.length]), ctx, data); -} -function ed(opts) { - return eddsa(ed25519_Point, sha512, Object.assign({ adjustScalarBytes }, opts)); -} -/** - * ed25519 curve with EdDSA signatures. - * @example - * ```js - * import { ed25519 } from '@noble/curves/ed25519.js'; - * const { secretKey, publicKey } = ed25519.keygen(); - * // const publicKey = ed25519.getPublicKey(secretKey); - * const msg = new TextEncoder().encode('hello noble'); - * const sig = ed25519.sign(msg, secretKey); - * const isValid = ed25519.verify(sig, msg, pub); // ZIP215 - * // RFC8032 / FIPS 186-5 - * const isValid2 = ed25519.verify(sig, msg, pub, { zip215: false }); - * ``` - */ -export const ed25519 = /* @__PURE__ */ ed({}); -/** Context version of ed25519 (ctx for domain separation). See {@link ed25519} */ -export const ed25519ctx = /* @__PURE__ */ ed({ domain: ed25519_domain }); -/** Prehashed version of ed25519. See {@link ed25519} */ -export const ed25519ph = /* @__PURE__ */ ed({ domain: ed25519_domain, prehash: sha512 }); -/** - * ECDH using curve25519 aka x25519. - * @example - * ```js - * import { x25519 } from '@noble/curves/ed25519.js'; - * const alice = x25519.keygen(); - * const bob = x25519.keygen(); - * const shared = x25519.getSharedSecret(alice.secretKey, bob.publicKey); - * ``` - */ -export const x25519 = /* @__PURE__ */ (() => { - const P = ed25519_CURVE_p; - return montgomery({ - P, - type: 'x25519', - powPminus2: (x) => { - // x^(p-2) aka x^(2^255-21) - const { pow_p_5_8, b2 } = ed25519_pow_2_252_3(x); - return mod(pow2(pow_p_5_8, _3n, P) * b2, P); - }, - adjustScalarBytes, - }); -})(); -// Hash To Curve Elligator2 Map (NOTE: different from ristretto255 elligator) -// NOTE: very important part is usage of FpSqrtEven for ELL2_C1_EDWARDS, since -// SageMath returns different root first and everything falls apart -const ELL2_C1 = /* @__PURE__ */ (() => (ed25519_CURVE_p + _3n) / _8n)(); // 1. c1 = (q + 3) / 8 # Integer arithmetic -const ELL2_C2 = /* @__PURE__ */ (() => Fp.pow(_2n, ELL2_C1))(); // 2. c2 = 2^c1 -const ELL2_C3 = /* @__PURE__ */ (() => Fp.sqrt(Fp.neg(Fp.ONE)))(); // 3. c3 = sqrt(-1) -/** - * RFC 9380 method `map_to_curve_elligator2_curve25519`. Experimental name: may be renamed later. - * @private - */ -// prettier-ignore -export function _map_to_curve_elligator2_curve25519(u) { - const ELL2_C4 = (ed25519_CURVE_p - _5n) / _8n; // 4. c4 = (q - 5) / 8 # Integer arithmetic - const ELL2_J = BigInt(486662); - let tv1 = Fp.sqr(u); // 1. tv1 = u^2 - tv1 = Fp.mul(tv1, _2n); // 2. tv1 = 2 * tv1 - let xd = Fp.add(tv1, Fp.ONE); // 3. xd = tv1 + 1 # Nonzero: -1 is square (mod p), tv1 is not - let x1n = Fp.neg(ELL2_J); // 4. x1n = -J # x1 = x1n / xd = -J / (1 + 2 * u^2) - let tv2 = Fp.sqr(xd); // 5. tv2 = xd^2 - let gxd = Fp.mul(tv2, xd); // 6. gxd = tv2 * xd # gxd = xd^3 - let gx1 = Fp.mul(tv1, ELL2_J); // 7. gx1 = J * tv1 # x1n + J * xd - gx1 = Fp.mul(gx1, x1n); // 8. gx1 = gx1 * x1n # x1n^2 + J * x1n * xd - gx1 = Fp.add(gx1, tv2); // 9. gx1 = gx1 + tv2 # x1n^2 + J * x1n * xd + xd^2 - gx1 = Fp.mul(gx1, x1n); // 10. gx1 = gx1 * x1n # x1n^3 + J * x1n^2 * xd + x1n * xd^2 - let tv3 = Fp.sqr(gxd); // 11. tv3 = gxd^2 - tv2 = Fp.sqr(tv3); // 12. tv2 = tv3^2 # gxd^4 - tv3 = Fp.mul(tv3, gxd); // 13. tv3 = tv3 * gxd # gxd^3 - tv3 = Fp.mul(tv3, gx1); // 14. tv3 = tv3 * gx1 # gx1 * gxd^3 - tv2 = Fp.mul(tv2, tv3); // 15. tv2 = tv2 * tv3 # gx1 * gxd^7 - let y11 = Fp.pow(tv2, ELL2_C4); // 16. y11 = tv2^c4 # (gx1 * gxd^7)^((p - 5) / 8) - y11 = Fp.mul(y11, tv3); // 17. y11 = y11 * tv3 # gx1*gxd^3*(gx1*gxd^7)^((p-5)/8) - let y12 = Fp.mul(y11, ELL2_C3); // 18. y12 = y11 * c3 - tv2 = Fp.sqr(y11); // 19. tv2 = y11^2 - tv2 = Fp.mul(tv2, gxd); // 20. tv2 = tv2 * gxd - let e1 = Fp.eql(tv2, gx1); // 21. e1 = tv2 == gx1 - let y1 = Fp.cmov(y12, y11, e1); // 22. y1 = CMOV(y12, y11, e1) # If g(x1) is square, this is its sqrt - let x2n = Fp.mul(x1n, tv1); // 23. x2n = x1n * tv1 # x2 = x2n / xd = 2 * u^2 * x1n / xd - let y21 = Fp.mul(y11, u); // 24. y21 = y11 * u - y21 = Fp.mul(y21, ELL2_C2); // 25. y21 = y21 * c2 - let y22 = Fp.mul(y21, ELL2_C3); // 26. y22 = y21 * c3 - let gx2 = Fp.mul(gx1, tv1); // 27. gx2 = gx1 * tv1 # g(x2) = gx2 / gxd = 2 * u^2 * g(x1) - tv2 = Fp.sqr(y21); // 28. tv2 = y21^2 - tv2 = Fp.mul(tv2, gxd); // 29. tv2 = tv2 * gxd - let e2 = Fp.eql(tv2, gx2); // 30. e2 = tv2 == gx2 - let y2 = Fp.cmov(y22, y21, e2); // 31. y2 = CMOV(y22, y21, e2) # If g(x2) is square, this is its sqrt - tv2 = Fp.sqr(y1); // 32. tv2 = y1^2 - tv2 = Fp.mul(tv2, gxd); // 33. tv2 = tv2 * gxd - let e3 = Fp.eql(tv2, gx1); // 34. e3 = tv2 == gx1 - let xn = Fp.cmov(x2n, x1n, e3); // 35. xn = CMOV(x2n, x1n, e3) # If e3, x = x1, else x = x2 - let y = Fp.cmov(y2, y1, e3); // 36. y = CMOV(y2, y1, e3) # If e3, y = y1, else y = y2 - let e4 = Fp.isOdd(y); // 37. e4 = sgn0(y) == 1 # Fix sign of y - y = Fp.cmov(y, Fp.neg(y), e3 !== e4); // 38. y = CMOV(y, -y, e3 XOR e4) - return { xMn: xn, xMd: xd, yMn: y, yMd: _1n }; // 39. return (xn, xd, y, 1) -} -const ELL2_C1_EDWARDS = /* @__PURE__ */ (() => FpSqrtEven(Fp, Fp.neg(BigInt(486664))))(); // sgn0(c1) MUST equal 0 -function map_to_curve_elligator2_edwards25519(u) { - const { xMn, xMd, yMn, yMd } = _map_to_curve_elligator2_curve25519(u); // 1. (xMn, xMd, yMn, yMd) = - // map_to_curve_elligator2_curve25519(u) - let xn = Fp.mul(xMn, yMd); // 2. xn = xMn * yMd - xn = Fp.mul(xn, ELL2_C1_EDWARDS); // 3. xn = xn * c1 - let xd = Fp.mul(xMd, yMn); // 4. xd = xMd * yMn # xn / xd = c1 * xM / yM - let yn = Fp.sub(xMn, xMd); // 5. yn = xMn - xMd - let yd = Fp.add(xMn, xMd); // 6. yd = xMn + xMd # (n / d - 1) / (n / d + 1) = (n - d) / (n + d) - let tv1 = Fp.mul(xd, yd); // 7. tv1 = xd * yd - let e = Fp.eql(tv1, Fp.ZERO); // 8. e = tv1 == 0 - xn = Fp.cmov(xn, Fp.ZERO, e); // 9. xn = CMOV(xn, 0, e) - xd = Fp.cmov(xd, Fp.ONE, e); // 10. xd = CMOV(xd, 1, e) - yn = Fp.cmov(yn, Fp.ONE, e); // 11. yn = CMOV(yn, 1, e) - yd = Fp.cmov(yd, Fp.ONE, e); // 12. yd = CMOV(yd, 1, e) - const [xd_inv, yd_inv] = FpInvertBatch(Fp, [xd, yd], true); // batch division - return { x: Fp.mul(xn, xd_inv), y: Fp.mul(yn, yd_inv) }; // 13. return (xn, xd, yn, yd) -} -/** Hashing to ed25519 points / field. RFC 9380 methods. */ -export const ed25519_hasher = /* @__PURE__ */ (() => createHasher(ed25519_Point, (scalars) => map_to_curve_elligator2_edwards25519(scalars[0]), { - DST: 'edwards25519_XMD:SHA-512_ELL2_RO_', - encodeDST: 'edwards25519_XMD:SHA-512_ELL2_NU_', - p: ed25519_CURVE_p, - m: 1, - k: 128, - expand: 'xmd', - hash: sha512, -}))(); -// √(-1) aka √(a) aka 2^((p-1)/4) -const SQRT_M1 = ED25519_SQRT_M1; -// √(ad - 1) -const SQRT_AD_MINUS_ONE = /* @__PURE__ */ BigInt('25063068953384623474111414158702152701244531502492656460079210482610430750235'); -// 1 / √(a-d) -const INVSQRT_A_MINUS_D = /* @__PURE__ */ BigInt('54469307008909316920995813868745141605393597292927456921205312896311721017578'); -// 1-d² -const ONE_MINUS_D_SQ = /* @__PURE__ */ BigInt('1159843021668779879193775521855586647937357759715417654439879720876111806838'); -// (d-1)² -const D_MINUS_ONE_SQ = /* @__PURE__ */ BigInt('40440834346308536858101042469323190826248399146238708352240133220865137265952'); -// Calculates 1/√(number) -const invertSqrt = (number) => uvRatio(_1n, number); -const MAX_255B = /* @__PURE__ */ BigInt('0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'); -const bytes255ToNumberLE = (bytes) => Fp.create(bytesToNumberLE(bytes) & MAX_255B); -/** - * Computes Elligator map for Ristretto255. - * Described in [RFC9380](https://www.rfc-editor.org/rfc/rfc9380#appendix-B) and on - * the [website](https://ristretto.group/formulas/elligator.html). - */ -function calcElligatorRistrettoMap(r0) { - const { d } = ed25519_CURVE; - const P = ed25519_CURVE_p; - const mod = (n) => Fp.create(n); - const r = mod(SQRT_M1 * r0 * r0); // 1 - const Ns = mod((r + _1n) * ONE_MINUS_D_SQ); // 2 - let c = BigInt(-1); // 3 - const D = mod((c - d * r) * mod(r + d)); // 4 - let { isValid: Ns_D_is_sq, value: s } = uvRatio(Ns, D); // 5 - let s_ = mod(s * r0); // 6 - if (!isNegativeLE(s_, P)) - s_ = mod(-s_); - if (!Ns_D_is_sq) - s = s_; // 7 - if (!Ns_D_is_sq) - c = r; // 8 - const Nt = mod(c * (r - _1n) * D_MINUS_ONE_SQ - D); // 9 - const s2 = s * s; - const W0 = mod((s + s) * D); // 10 - const W1 = mod(Nt * SQRT_AD_MINUS_ONE); // 11 - const W2 = mod(_1n - s2); // 12 - const W3 = mod(_1n + s2); // 13 - return new ed25519_Point(mod(W0 * W3), mod(W2 * W1), mod(W1 * W3), mod(W0 * W2)); -} -/** - * Wrapper over Edwards Point for ristretto255. - * - * Each ed25519/EdwardsPoint has 8 different equivalent points. This can be - * a source of bugs for protocols like ring signatures. Ristretto was created to solve this. - * Ristretto point operates in X:Y:Z:T extended coordinates like EdwardsPoint, - * but it should work in its own namespace: do not combine those two. - * See [RFC9496](https://www.rfc-editor.org/rfc/rfc9496). - */ -class _RistrettoPoint extends PrimeEdwardsPoint { - // Do NOT change syntax: the following gymnastics is done, - // because typescript strips comments, which makes bundlers disable tree-shaking. - // prettier-ignore - static BASE = - /* @__PURE__ */ (() => new _RistrettoPoint(ed25519_Point.BASE))(); - // prettier-ignore - static ZERO = - /* @__PURE__ */ (() => new _RistrettoPoint(ed25519_Point.ZERO))(); - // prettier-ignore - static Fp = - /* @__PURE__ */ (() => Fp)(); - // prettier-ignore - static Fn = - /* @__PURE__ */ (() => Fn)(); - constructor(ep) { - super(ep); - } - static fromAffine(ap) { - return new _RistrettoPoint(ed25519_Point.fromAffine(ap)); - } - assertSame(other) { - if (!(other instanceof _RistrettoPoint)) - throw new Error('RistrettoPoint expected'); - } - init(ep) { - return new _RistrettoPoint(ep); - } - static fromBytes(bytes) { - abytes(bytes, 32); - const { a, d } = ed25519_CURVE; - const P = ed25519_CURVE_p; - const mod = (n) => Fp.create(n); - const s = bytes255ToNumberLE(bytes); - // 1. Check that s_bytes is the canonical encoding of a field element, or else abort. - // 3. Check that s is non-negative, or else abort - if (!equalBytes(Fp.toBytes(s), bytes) || isNegativeLE(s, P)) - throw new Error('invalid ristretto255 encoding 1'); - const s2 = mod(s * s); - const u1 = mod(_1n + a * s2); // 4 (a is -1) - const u2 = mod(_1n - a * s2); // 5 - const u1_2 = mod(u1 * u1); - const u2_2 = mod(u2 * u2); - const v = mod(a * d * u1_2 - u2_2); // 6 - const { isValid, value: I } = invertSqrt(mod(v * u2_2)); // 7 - const Dx = mod(I * u2); // 8 - const Dy = mod(I * Dx * v); // 9 - let x = mod((s + s) * Dx); // 10 - if (isNegativeLE(x, P)) - x = mod(-x); // 10 - const y = mod(u1 * Dy); // 11 - const t = mod(x * y); // 12 - if (!isValid || isNegativeLE(t, P) || y === _0n) - throw new Error('invalid ristretto255 encoding 2'); - return new _RistrettoPoint(new ed25519_Point(x, y, _1n, t)); - } - /** - * Converts ristretto-encoded string to ristretto point. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-decode). - * @param hex Ristretto-encoded 32 bytes. Not every 32-byte string is valid ristretto encoding - */ - static fromHex(hex) { - return _RistrettoPoint.fromBytes(hexToBytes(hex)); - } - /** - * Encodes ristretto point to Uint8Array. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-encode). - */ - toBytes() { - let { X, Y, Z, T } = this.ep; - const P = ed25519_CURVE_p; - const mod = (n) => Fp.create(n); - const u1 = mod(mod(Z + Y) * mod(Z - Y)); // 1 - const u2 = mod(X * Y); // 2 - // Square root always exists - const u2sq = mod(u2 * u2); - const { value: invsqrt } = invertSqrt(mod(u1 * u2sq)); // 3 - const D1 = mod(invsqrt * u1); // 4 - const D2 = mod(invsqrt * u2); // 5 - const zInv = mod(D1 * D2 * T); // 6 - let D; // 7 - if (isNegativeLE(T * zInv, P)) { - let _x = mod(Y * SQRT_M1); - let _y = mod(X * SQRT_M1); - X = _x; - Y = _y; - D = mod(D1 * INVSQRT_A_MINUS_D); - } - else { - D = D2; // 8 - } - if (isNegativeLE(X * zInv, P)) - Y = mod(-Y); // 9 - let s = mod((Z - Y) * D); // 10 (check footer's note, no sqrt(-a)) - if (isNegativeLE(s, P)) - s = mod(-s); - return Fp.toBytes(s); // 11 - } - /** - * Compares two Ristretto points. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-equals). - */ - equals(other) { - this.assertSame(other); - const { X: X1, Y: Y1 } = this.ep; - const { X: X2, Y: Y2 } = other.ep; - const mod = (n) => Fp.create(n); - // (x1 * y2 == y1 * x2) | (y1 * y2 == x1 * x2) - const one = mod(X1 * Y2) === mod(Y1 * X2); - const two = mod(Y1 * Y2) === mod(X1 * X2); - return one || two; - } - is0() { - return this.equals(_RistrettoPoint.ZERO); - } -} -export const ristretto255 = { Point: _RistrettoPoint }; -/** Hashing to ristretto255 points / field. RFC 9380 methods. */ -export const ristretto255_hasher = { - Point: _RistrettoPoint, - /** - * Spec: https://www.rfc-editor.org/rfc/rfc9380.html#name-hashing-to-ristretto255. Caveats: - * * There are no test vectors - * * encodeToCurve / mapToCurve is undefined - * * mapToCurve would be `calcElligatorRistrettoMap(scalars[0])`, not ristretto255_map! - * * hashToScalar is undefined too, so we just use OPRF implementation - * * We cannot re-use 'createHasher', because ristretto255_map is different algorithm/RFC - (os2ip -> bytes255ToNumberLE) - * * mapToCurve == calcElligatorRistrettoMap, hashToCurve == ristretto255_map - * * hashToScalar is undefined in RFC9380 for ristretto, we are using version from OPRF here, using bytes255ToNumblerLE will create different result if we use bytes255ToNumberLE as os2ip - * * current version is closest to spec. - */ - hashToCurve(msg, options) { - // == 'hash_to_ristretto255' - const DST = options?.DST || 'ristretto255_XMD:SHA-512_R255MAP_RO_'; - const xmd = expand_message_xmd(msg, DST, 64, sha512); - // NOTE: RFC 9380 incorrectly calls this function 'ristretto255_map', in RFC 9496 map was function inside (per point) - // That also lead to confustion that ristretto255_map is mapToCurve (it is not! it is old hashToCurve) - return ristretto255_hasher.deriveToCurve(xmd); - }, - hashToScalar(msg, options = { DST: _DST_scalar }) { - const xmd = expand_message_xmd(msg, options.DST, 64, sha512); - return Fn.create(bytesToNumberLE(xmd)); - }, - /** - * HashToCurve-like construction based on RFC 9496 (Element Derivation). - * Converts 64 uniform random bytes into a curve point. - * - * WARNING: This represents an older hash-to-curve construction, preceding the finalization of RFC 9380. - * It was later reused as a component in the newer `hash_to_ristretto255` function defined in RFC 9380. - */ - deriveToCurve(bytes) { - // https://www.rfc-editor.org/rfc/rfc9496.html#name-element-derivation - abytes(bytes, 64); - const r1 = bytes255ToNumberLE(bytes.subarray(0, 32)); - const R1 = calcElligatorRistrettoMap(r1); - const r2 = bytes255ToNumberLE(bytes.subarray(32, 64)); - const R2 = calcElligatorRistrettoMap(r2); - return new _RistrettoPoint(R1.add(R2)); - }, -}; -/** ristretto255 OPRF, defined in RFC 9497. */ -export const ristretto255_oprf = /* @__PURE__ */ (() => createORPF({ - name: 'ristretto255-SHA512', - Point: _RistrettoPoint, - hash: sha512, - hashToGroup: ristretto255_hasher.hashToCurve, - hashToScalar: ristretto255_hasher.hashToScalar, -}))(); -/** - * Weird / bogus points, useful for debugging. - * All 8 ed25519 points of 8-torsion subgroup can be generated from the point - * T = `26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05`. - * ⟨T⟩ = { O, T, 2T, 3T, 4T, 5T, 6T, 7T } - */ -export const ED25519_TORSION_SUBGROUP = [ - '0100000000000000000000000000000000000000000000000000000000000000', - 'c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a', - '0000000000000000000000000000000000000000000000000000000000000080', - '26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05', - 'ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f', - '26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85', - '0000000000000000000000000000000000000000000000000000000000000000', - 'c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa', -]; -//# sourceMappingURL=ed25519.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/ed25519.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/ed25519.js.map deleted file mode 100644 index 29e0113a..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/ed25519.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed25519.js","sourceRoot":"","sources":["src/ed25519.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,sEAAsE;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAoB,MAAM,qBAAqB,CAAC;AACvD,OAAO,EACL,KAAK,EACL,OAAO,EACP,iBAAiB,GAMlB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,WAAW,EACX,YAAY,EACZ,kBAAkB,GAInB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,aAAa,EACb,UAAU,EACV,YAAY,EACZ,GAAG,EACH,IAAI,GAEL,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAuB,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAa,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAEvE,kBAAkB;AAClB,MAAM,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACzG,kBAAkB;AAClB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GA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AC;IACD;;;;;;OAMG;IACH,aAAa,CAAC,KAAiB;QAC7B,sEAAsE;QACtE,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAClB,MAAM,EAAE,GAAG,kBAAkB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QACrD,MAAM,EAAE,GAAG,yBAAyB,CAAC,EAAE,CAAC,CAAC;QACzC,MAAM,EAAE,GAAG,kBAAkB,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;QACtD,MAAM,EAAE,GAAG,yBAAyB,CAAC,EAAE,CAAC,CAAC;QACzC,OAAO,IAAI,eAAe,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IACzC,CAAC;CACF,CAAC;AAEF,8CAA8C;AAC9C,MAAM,CAAC,MAAM,iBAAiB,GAAS,eAAe,CAAC,CAAC,GAAG,EAAE,CAC3D,UAAU,CAAC;IACT,IAAI,EAAE,qBAAqB;IAC3B,KAAK,EAAE,eAAe;IACtB,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,mBAAmB,CAAC,WAAW;IAC5C,YAAY,EAAE,mBAAmB,CAAC,YAAY;CAC/C,CAAC,CAAC,EAAE,CAAC;AAER;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAa;IAChD,kEAAkE;IAClE,kEAAkE;IAClE,kEAAkE;IAClE,kEAAkE;IAClE,kEAAkE;IAClE,kEAAkE;IAClE,kEAAkE;IAClE,kEAAkE;CACnE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/ed448.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/ed448.d.ts deleted file mode 100644 index 73a5fa7e..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/ed448.d.ts +++ /dev/null @@ -1,91 +0,0 @@ -import type { AffinePoint } from './abstract/curve.ts'; -import { PrimeEdwardsPoint, type EdDSA, type EdwardsPoint, type EdwardsPointCons } from './abstract/edwards.ts'; -import { type H2CHasher, type H2CHasherBase } from './abstract/hash-to-curve.ts'; -import { type IField } from './abstract/modular.ts'; -import { type MontgomeryECDH } from './abstract/montgomery.ts'; -import { type OPRF } from './abstract/oprf.ts'; -/** - * ed448 EdDSA curve and methods. - * @example - * ```js - * import { ed448 } from '@noble/curves/ed448.js'; - * const { secretKey, publicKey } = ed448.keygen(); - * // const publicKey = ed448.getPublicKey(secretKey); - * const msg = new TextEncoder().encode('hello noble'); - * const sig = ed448.sign(msg, secretKey); - * const isValid = ed448.verify(sig, msg, publicKey); - * ``` - */ -export declare const ed448: EdDSA; -/** Prehashed version of ed448. See {@link ed448} */ -export declare const ed448ph: EdDSA; -/** - * E448 (NIST) != edwards448 used in ed448. - * E448 is birationally equivalent to edwards448. - */ -export declare const E448: EdwardsPointCons; -/** - * ECDH using curve448 aka x448. - * - * @example - * ```js - * import { x448 } from '@noble/curves/ed448.js'; - * const alice = x448.keygen(); - * const bob = x448.keygen(); - * const shared = x448.getSharedSecret(alice.secretKey, bob.publicKey); - * ``` - */ -export declare const x448: MontgomeryECDH; -/** Hashing / encoding to ed448 points / field. RFC 9380 methods. */ -export declare const ed448_hasher: H2CHasher; -/** - * Each ed448/EdwardsPoint has 4 different equivalent points. This can be - * a source of bugs for protocols like ring signatures. Decaf was created to solve this. - * Decaf point operates in X:Y:Z:T extended coordinates like EdwardsPoint, - * but it should work in its own namespace: do not combine those two. - * See [RFC9496](https://www.rfc-editor.org/rfc/rfc9496). - */ -declare class _DecafPoint extends PrimeEdwardsPoint<_DecafPoint> { - static BASE: _DecafPoint; - static ZERO: _DecafPoint; - static Fp: IField; - static Fn: IField; - constructor(ep: EdwardsPoint); - static fromAffine(ap: AffinePoint): _DecafPoint; - protected assertSame(other: _DecafPoint): void; - protected init(ep: EdwardsPoint): _DecafPoint; - static fromBytes(bytes: Uint8Array): _DecafPoint; - /** - * Converts decaf-encoded string to decaf point. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-decode-2). - * @param hex Decaf-encoded 56 bytes. Not every 56-byte string is valid decaf encoding - */ - static fromHex(hex: string): _DecafPoint; - /** - * Encodes decaf point to Uint8Array. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-encode-2). - */ - toBytes(): Uint8Array; - /** - * Compare one point to another. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-equals-2). - */ - equals(other: _DecafPoint): boolean; - is0(): boolean; -} -export declare const decaf448: { - Point: typeof _DecafPoint; -}; -/** Hashing to decaf448 points / field. RFC 9380 methods. */ -export declare const decaf448_hasher: H2CHasherBase; -/** decaf448 OPRF, defined in RFC 9497. */ -export declare const decaf448_oprf: OPRF; -/** - * Weird / bogus points, useful for debugging. - * Unlike ed25519, there is no ed448 generator point which can produce full T subgroup. - * Instead, there is a Klein four-group, which spans over 2 independent 2-torsion points: - * (0, 1), (0, -1), (-1, 0), (1, 0). - */ -export declare const ED448_TORSION_SUBGROUP: string[]; -export {}; -//# sourceMappingURL=ed448.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/ed448.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/ed448.d.ts.map deleted file mode 100644 index 9c86233b..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/ed448.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed448.d.ts","sourceRoot":"","sources":["src/ed448.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAGL,iBAAiB,EACjB,KAAK,KAAK,EAGV,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAKL,KAAK,SAAS,E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;;OAGG;IACH,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO;IAQnC,GAAG,IAAI,OAAO;CAGf;AAED,eAAO,MAAM,QAAQ,EAAE;IACrB,KAAK,EAAE,OAAO,WAAW,CAAC;CACF,CAAC;AAE3B,4DAA4D;AAC5D,eAAO,MAAM,eAAe,EAAE,aAAa,CAAC,OAAO,WAAW,CAmC7D,CAAC;AAEF,0CAA0C;AAC1C,eAAO,MAAM,aAAa,EAAE,IAOrB,CAAC;AAER;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,EAK1C,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/ed448.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/ed448.js deleted file mode 100644 index cd959024..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/ed448.js +++ /dev/null @@ -1,442 +0,0 @@ -/** - * Edwards448 (not Ed448-Goldilocks) curve with following addons: - * - X448 ECDH - * - Decaf cofactor elimination - * - Elligator hash-to-group / point indistinguishability - * Conforms to RFC 8032 https://www.rfc-editor.org/rfc/rfc8032.html#section-5.2 - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { shake256 } from '@noble/hashes/sha3.js'; -import { concatBytes, hexToBytes, createHasher as wrapConstructor } from '@noble/hashes/utils.js'; -import { eddsa, edwards, PrimeEdwardsPoint, } from "./abstract/edwards.js"; -import { _DST_scalar, createHasher, expand_message_xof, } from "./abstract/hash-to-curve.js"; -import { Field, FpInvertBatch, isNegativeLE, mod, pow2 } from "./abstract/modular.js"; -import { montgomery } from "./abstract/montgomery.js"; -import { createORPF } from "./abstract/oprf.js"; -import { abytes, asciiToBytes, bytesToNumberLE, equalBytes } from "./utils.js"; -// edwards448 curve -// a = 1n -// d = Fp.neg(39081n) -// Finite field 2n**448n - 2n**224n - 1n -// Subgroup order -// 2n**446n - 13818066809895115352007386748515426880336692474882178609894547503885n -const ed448_CURVE_p = BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffff'); -const ed448_CURVE = /* @__PURE__ */ (() => ({ - p: ed448_CURVE_p, - n: BigInt('0x3fffffffffffffffffffffffffffffffffffffffffffffffffffffff7cca23e9c44edb49aed63690216cc2728dc58f552378c292ab5844f3'), - h: BigInt(4), - a: BigInt(1), - d: BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffffffffffffffffffffffffffffffffffffffffffffffff6756'), - Gx: BigInt('0x4f1970c66bed0ded221d15a622bf36da9e146570470f1767ea6de324a3d3a46412ae1af72ab66511433b80e18b00938e2626a82bc70cc05e'), - Gy: BigInt('0x693f46716eb6bc248876203756c9c7624bea73736ca3984087789c1e05a0c2d73ad3ff1ce67c39c4fdbd132c4ed7c8ad9808795bf230fa14'), -}))(); -// E448 NIST curve is identical to edwards448, except for: -// d = 39082/39081 -// Gx = 3/2 -const E448_CURVE = /* @__PURE__ */ (() => Object.assign({}, ed448_CURVE, { - d: BigInt('0xd78b4bdc7f0daf19f24f38c29373a2ccad46157242a50f37809b1da3412a12e79ccc9c81264cfe9ad080997058fb61c4243cc32dbaa156b9'), - Gx: BigInt('0x79a70b2b70400553ae7c9df416c792c61128751ac92969240c25a07d728bdc93e21f7787ed6972249de732f38496cd11698713093e9c04fc'), - Gy: BigInt('0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffff80000000000000000000000000000000000000000000000000000001'), -}))(); -const shake256_114 = /* @__PURE__ */ wrapConstructor(() => shake256.create({ dkLen: 114 })); -const shake256_64 = /* @__PURE__ */ wrapConstructor(() => shake256.create({ dkLen: 64 })); -// prettier-ignore -const _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = /* @__PURE__ */ BigInt(4), _11n = BigInt(11); -// prettier-ignore -const _22n = BigInt(22), _44n = BigInt(44), _88n = BigInt(88), _223n = BigInt(223); -// powPminus3div4 calculates z = x^k mod p, where k = (p-3)/4. -// Used for efficient square root calculation. -// ((P-3)/4).toString(2) would produce bits [223x 1, 0, 222x 1] -function ed448_pow_Pminus3div4(x) { - const P = ed448_CURVE_p; - const b2 = (x * x * x) % P; - const b3 = (b2 * b2 * x) % P; - const b6 = (pow2(b3, _3n, P) * b3) % P; - const b9 = (pow2(b6, _3n, P) * b3) % P; - const b11 = (pow2(b9, _2n, P) * b2) % P; - const b22 = (pow2(b11, _11n, P) * b11) % P; - const b44 = (pow2(b22, _22n, P) * b22) % P; - const b88 = (pow2(b44, _44n, P) * b44) % P; - const b176 = (pow2(b88, _88n, P) * b88) % P; - const b220 = (pow2(b176, _44n, P) * b44) % P; - const b222 = (pow2(b220, _2n, P) * b2) % P; - const b223 = (pow2(b222, _1n, P) * x) % P; - return (pow2(b223, _223n, P) * b222) % P; -} -function adjustScalarBytes(bytes) { - // Section 5: Likewise, for X448, set the two least significant bits of the first byte to 0, - bytes[0] &= 252; // 0b11111100 - // and the most significant bit of the last byte to 1. - bytes[55] |= 128; // 0b10000000 - // NOTE: is NOOP for 56 bytes scalars (X25519/X448) - bytes[56] = 0; // Byte outside of group (456 buts vs 448 bits) - return bytes; -} -// Constant-time ratio of u to v. Allows to combine inversion and square root u/√v. -// Uses algo from RFC8032 5.1.3. -function uvRatio(u, v) { - const P = ed448_CURVE_p; - // https://www.rfc-editor.org/rfc/rfc8032#section-5.2.3 - // To compute the square root of (u/v), the first step is to compute the - // candidate root x = (u/v)^((p+1)/4). This can be done using the - // following trick, to use a single modular powering for both the - // inversion of v and the square root: - // x = (u/v)^((p+1)/4) = u³v(u⁵v³)^((p-3)/4) (mod p) - const u2v = mod(u * u * v, P); // u²v - const u3v = mod(u2v * u, P); // u³v - const u5v3 = mod(u3v * u2v * v, P); // u⁵v³ - const root = ed448_pow_Pminus3div4(u5v3); - const x = mod(u3v * root, P); - // Verify that root is exists - const x2 = mod(x * x, P); // x² - // If vx² = u, the recovered x-coordinate is x. Otherwise, no - // square root exists, and the decoding fails. - return { isValid: mod(x2 * v, P) === u, value: x }; -} -// Finite field 2n**448n - 2n**224n - 1n -// The value fits in 448 bits, but we use 456-bit (57-byte) elements because of bitflags. -// - ed25519 fits in 255 bits, allowing using last 1 byte for specifying bit flag of point negation. -// - ed448 fits in 448 bits. We can't use last 1 byte: we can only use a bit 224 in the middle. -const Fp = /* @__PURE__ */ (() => Field(ed448_CURVE_p, { BITS: 456, isLE: true }))(); -const Fn = /* @__PURE__ */ (() => Field(ed448_CURVE.n, { BITS: 456, isLE: true }))(); -// decaf448 uses 448-bit (56-byte) keys -const Fp448 = /* @__PURE__ */ (() => Field(ed448_CURVE_p, { BITS: 448, isLE: true }))(); -const Fn448 = /* @__PURE__ */ (() => Field(ed448_CURVE.n, { BITS: 448, isLE: true }))(); -// SHAKE256(dom4(phflag,context)||x, 114) -function dom4(data, ctx, phflag) { - if (ctx.length > 255) - throw new Error('context must be smaller than 255, got: ' + ctx.length); - return concatBytes(asciiToBytes('SigEd448'), new Uint8Array([phflag ? 1 : 0, ctx.length]), ctx, data); -} -const ed448_Point = /* @__PURE__ */ edwards(ed448_CURVE, { Fp, Fn, uvRatio }); -function ed4(opts) { - return eddsa(ed448_Point, shake256_114, Object.assign({ adjustScalarBytes, domain: dom4 }, opts)); -} -/** - * ed448 EdDSA curve and methods. - * @example - * ```js - * import { ed448 } from '@noble/curves/ed448.js'; - * const { secretKey, publicKey } = ed448.keygen(); - * // const publicKey = ed448.getPublicKey(secretKey); - * const msg = new TextEncoder().encode('hello noble'); - * const sig = ed448.sign(msg, secretKey); - * const isValid = ed448.verify(sig, msg, publicKey); - * ``` - */ -export const ed448 = /* @__PURE__ */ ed4({}); -// There is no ed448ctx, since ed448 supports ctx by default -/** Prehashed version of ed448. See {@link ed448} */ -export const ed448ph = /* @__PURE__ */ ed4({ prehash: shake256_64 }); -/** - * E448 (NIST) != edwards448 used in ed448. - * E448 is birationally equivalent to edwards448. - */ -export const E448 = /* @__PURE__ */ edwards(E448_CURVE); -/** - * ECDH using curve448 aka x448. - * - * @example - * ```js - * import { x448 } from '@noble/curves/ed448.js'; - * const alice = x448.keygen(); - * const bob = x448.keygen(); - * const shared = x448.getSharedSecret(alice.secretKey, bob.publicKey); - * ``` - */ -export const x448 = /* @__PURE__ */ (() => { - const P = ed448_CURVE_p; - return montgomery({ - P, - type: 'x448', - powPminus2: (x) => { - const Pminus3div4 = ed448_pow_Pminus3div4(x); - const Pminus3 = pow2(Pminus3div4, _2n, P); - return mod(Pminus3 * x, P); // Pminus3 * x = Pminus2 - }, - adjustScalarBytes, - }); -})(); -// Hash To Curve Elligator2 Map -const ELL2_C1 = /* @__PURE__ */ (() => (ed448_CURVE_p - BigInt(3)) / BigInt(4))(); // 1. c1 = (q - 3) / 4 # Integer arithmetic -const ELL2_J = /* @__PURE__ */ BigInt(156326); -function map_to_curve_elligator2_curve448(u) { - let tv1 = Fp.sqr(u); // 1. tv1 = u^2 - let e1 = Fp.eql(tv1, Fp.ONE); // 2. e1 = tv1 == 1 - tv1 = Fp.cmov(tv1, Fp.ZERO, e1); // 3. tv1 = CMOV(tv1, 0, e1) # If Z * u^2 == -1, set tv1 = 0 - let xd = Fp.sub(Fp.ONE, tv1); // 4. xd = 1 - tv1 - let x1n = Fp.neg(ELL2_J); // 5. x1n = -J - let tv2 = Fp.sqr(xd); // 6. tv2 = xd^2 - let gxd = Fp.mul(tv2, xd); // 7. gxd = tv2 * xd # gxd = xd^3 - let gx1 = Fp.mul(tv1, Fp.neg(ELL2_J)); // 8. gx1 = -J * tv1 # x1n + J * xd - gx1 = Fp.mul(gx1, x1n); // 9. gx1 = gx1 * x1n # x1n^2 + J * x1n * xd - gx1 = Fp.add(gx1, tv2); // 10. gx1 = gx1 + tv2 # x1n^2 + J * x1n * xd + xd^2 - gx1 = Fp.mul(gx1, x1n); // 11. gx1 = gx1 * x1n # x1n^3 + J * x1n^2 * xd + x1n * xd^2 - let tv3 = Fp.sqr(gxd); // 12. tv3 = gxd^2 - tv2 = Fp.mul(gx1, gxd); // 13. tv2 = gx1 * gxd # gx1 * gxd - tv3 = Fp.mul(tv3, tv2); // 14. tv3 = tv3 * tv2 # gx1 * gxd^3 - let y1 = Fp.pow(tv3, ELL2_C1); // 15. y1 = tv3^c1 # (gx1 * gxd^3)^((p - 3) / 4) - y1 = Fp.mul(y1, tv2); // 16. y1 = y1 * tv2 # gx1 * gxd * (gx1 * gxd^3)^((p - 3) / 4) - let x2n = Fp.mul(x1n, Fp.neg(tv1)); // 17. x2n = -tv1 * x1n # x2 = x2n / xd = -1 * u^2 * x1n / xd - let y2 = Fp.mul(y1, u); // 18. y2 = y1 * u - y2 = Fp.cmov(y2, Fp.ZERO, e1); // 19. y2 = CMOV(y2, 0, e1) - tv2 = Fp.sqr(y1); // 20. tv2 = y1^2 - tv2 = Fp.mul(tv2, gxd); // 21. tv2 = tv2 * gxd - let e2 = Fp.eql(tv2, gx1); // 22. e2 = tv2 == gx1 - let xn = Fp.cmov(x2n, x1n, e2); // 23. xn = CMOV(x2n, x1n, e2) # If e2, x = x1, else x = x2 - let y = Fp.cmov(y2, y1, e2); // 24. y = CMOV(y2, y1, e2) # If e2, y = y1, else y = y2 - let e3 = Fp.isOdd(y); // 25. e3 = sgn0(y) == 1 # Fix sign of y - y = Fp.cmov(y, Fp.neg(y), e2 !== e3); // 26. y = CMOV(y, -y, e2 XOR e3) - return { xn, xd, yn: y, yd: Fp.ONE }; // 27. return (xn, xd, y, 1) -} -function map_to_curve_elligator2_edwards448(u) { - let { xn, xd, yn, yd } = map_to_curve_elligator2_curve448(u); // 1. (xn, xd, yn, yd) = map_to_curve_elligator2_curve448(u) - let xn2 = Fp.sqr(xn); // 2. xn2 = xn^2 - let xd2 = Fp.sqr(xd); // 3. xd2 = xd^2 - let xd4 = Fp.sqr(xd2); // 4. xd4 = xd2^2 - let yn2 = Fp.sqr(yn); // 5. yn2 = yn^2 - let yd2 = Fp.sqr(yd); // 6. yd2 = yd^2 - let xEn = Fp.sub(xn2, xd2); // 7. xEn = xn2 - xd2 - let tv2 = Fp.sub(xEn, xd2); // 8. tv2 = xEn - xd2 - xEn = Fp.mul(xEn, xd2); // 9. xEn = xEn * xd2 - xEn = Fp.mul(xEn, yd); // 10. xEn = xEn * yd - xEn = Fp.mul(xEn, yn); // 11. xEn = xEn * yn - xEn = Fp.mul(xEn, _4n); // 12. xEn = xEn * 4 - tv2 = Fp.mul(tv2, xn2); // 13. tv2 = tv2 * xn2 - tv2 = Fp.mul(tv2, yd2); // 14. tv2 = tv2 * yd2 - let tv3 = Fp.mul(yn2, _4n); // 15. tv3 = 4 * yn2 - let tv1 = Fp.add(tv3, yd2); // 16. tv1 = tv3 + yd2 - tv1 = Fp.mul(tv1, xd4); // 17. tv1 = tv1 * xd4 - let xEd = Fp.add(tv1, tv2); // 18. xEd = tv1 + tv2 - tv2 = Fp.mul(tv2, xn); // 19. tv2 = tv2 * xn - let tv4 = Fp.mul(xn, xd4); // 20. tv4 = xn * xd4 - let yEn = Fp.sub(tv3, yd2); // 21. yEn = tv3 - yd2 - yEn = Fp.mul(yEn, tv4); // 22. yEn = yEn * tv4 - yEn = Fp.sub(yEn, tv2); // 23. yEn = yEn - tv2 - tv1 = Fp.add(xn2, xd2); // 24. tv1 = xn2 + xd2 - tv1 = Fp.mul(tv1, xd2); // 25. tv1 = tv1 * xd2 - tv1 = Fp.mul(tv1, xd); // 26. tv1 = tv1 * xd - tv1 = Fp.mul(tv1, yn2); // 27. tv1 = tv1 * yn2 - tv1 = Fp.mul(tv1, BigInt(-2)); // 28. tv1 = -2 * tv1 - let yEd = Fp.add(tv2, tv1); // 29. yEd = tv2 + tv1 - tv4 = Fp.mul(tv4, yd2); // 30. tv4 = tv4 * yd2 - yEd = Fp.add(yEd, tv4); // 31. yEd = yEd + tv4 - tv1 = Fp.mul(xEd, yEd); // 32. tv1 = xEd * yEd - let e = Fp.eql(tv1, Fp.ZERO); // 33. e = tv1 == 0 - xEn = Fp.cmov(xEn, Fp.ZERO, e); // 34. xEn = CMOV(xEn, 0, e) - xEd = Fp.cmov(xEd, Fp.ONE, e); // 35. xEd = CMOV(xEd, 1, e) - yEn = Fp.cmov(yEn, Fp.ONE, e); // 36. yEn = CMOV(yEn, 1, e) - yEd = Fp.cmov(yEd, Fp.ONE, e); // 37. yEd = CMOV(yEd, 1, e) - const inv = FpInvertBatch(Fp, [xEd, yEd], true); // batch division - return { x: Fp.mul(xEn, inv[0]), y: Fp.mul(yEn, inv[1]) }; // 38. return (xEn, xEd, yEn, yEd) -} -/** Hashing / encoding to ed448 points / field. RFC 9380 methods. */ -export const ed448_hasher = /* @__PURE__ */ (() => createHasher(ed448_Point, (scalars) => map_to_curve_elligator2_edwards448(scalars[0]), { - DST: 'edwards448_XOF:SHAKE256_ELL2_RO_', - encodeDST: 'edwards448_XOF:SHAKE256_ELL2_NU_', - p: ed448_CURVE_p, - m: 1, - k: 224, - expand: 'xof', - hash: shake256, -}))(); -// 1-d -const ONE_MINUS_D = /* @__PURE__ */ BigInt('39082'); -// 1-2d -const ONE_MINUS_TWO_D = /* @__PURE__ */ BigInt('78163'); -// √(-d) -const SQRT_MINUS_D = /* @__PURE__ */ BigInt('98944233647732219769177004876929019128417576295529901074099889598043702116001257856802131563896515373927712232092845883226922417596214'); -// 1 / √(-d) -const INVSQRT_MINUS_D = /* @__PURE__ */ BigInt('315019913931389607337177038330951043522456072897266928557328499619017160722351061360252776265186336876723201881398623946864393857820716'); -// Calculates 1/√(number) -const invertSqrt = (number) => uvRatio(_1n, number); -/** - * Elligator map for hash-to-curve of decaf448. - * Described in [RFC9380](https://www.rfc-editor.org/rfc/rfc9380#appendix-C) - * and [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-element-derivation-2). - */ -function calcElligatorDecafMap(r0) { - const { d, p: P } = ed448_CURVE; - const mod = (n) => Fp448.create(n); - const r = mod(-(r0 * r0)); // 1 - const u0 = mod(d * (r - _1n)); // 2 - const u1 = mod((u0 + _1n) * (u0 - r)); // 3 - const { isValid: was_square, value: v } = uvRatio(ONE_MINUS_TWO_D, mod((r + _1n) * u1)); // 4 - let v_prime = v; // 5 - if (!was_square) - v_prime = mod(r0 * v); - let sgn = _1n; // 6 - if (!was_square) - sgn = mod(-_1n); - const s = mod(v_prime * (r + _1n)); // 7 - let s_abs = s; - if (isNegativeLE(s, P)) - s_abs = mod(-s); - const s2 = s * s; - const W0 = mod(s_abs * _2n); // 8 - const W1 = mod(s2 + _1n); // 9 - const W2 = mod(s2 - _1n); // 10 - const W3 = mod(v_prime * s * (r - _1n) * ONE_MINUS_TWO_D + sgn); // 11 - return new ed448_Point(mod(W0 * W3), mod(W2 * W1), mod(W1 * W3), mod(W0 * W2)); -} -/** - * Each ed448/EdwardsPoint has 4 different equivalent points. This can be - * a source of bugs for protocols like ring signatures. Decaf was created to solve this. - * Decaf point operates in X:Y:Z:T extended coordinates like EdwardsPoint, - * but it should work in its own namespace: do not combine those two. - * See [RFC9496](https://www.rfc-editor.org/rfc/rfc9496). - */ -class _DecafPoint extends PrimeEdwardsPoint { - // The following gymnastics is done because typescript strips comments otherwise - // prettier-ignore - static BASE = - /* @__PURE__ */ (() => new _DecafPoint(ed448_Point.BASE).multiplyUnsafe(_2n))(); - // prettier-ignore - static ZERO = - /* @__PURE__ */ (() => new _DecafPoint(ed448_Point.ZERO))(); - // prettier-ignore - static Fp = - /* @__PURE__ */ (() => Fp448)(); - // prettier-ignore - static Fn = - /* @__PURE__ */ (() => Fn448)(); - constructor(ep) { - super(ep); - } - static fromAffine(ap) { - return new _DecafPoint(ed448_Point.fromAffine(ap)); - } - assertSame(other) { - if (!(other instanceof _DecafPoint)) - throw new Error('DecafPoint expected'); - } - init(ep) { - return new _DecafPoint(ep); - } - static fromBytes(bytes) { - abytes(bytes, 56); - const { d, p: P } = ed448_CURVE; - const mod = (n) => Fp448.create(n); - const s = Fp448.fromBytes(bytes); - // 1. Check that s_bytes is the canonical encoding of a field element, or else abort. - // 2. Check that s is non-negative, or else abort - if (!equalBytes(Fn448.toBytes(s), bytes) || isNegativeLE(s, P)) - throw new Error('invalid decaf448 encoding 1'); - const s2 = mod(s * s); // 1 - const u1 = mod(_1n + s2); // 2 - const u1sq = mod(u1 * u1); - const u2 = mod(u1sq - _4n * d * s2); // 3 - const { isValid, value: invsqrt } = invertSqrt(mod(u2 * u1sq)); // 4 - let u3 = mod((s + s) * invsqrt * u1 * SQRT_MINUS_D); // 5 - if (isNegativeLE(u3, P)) - u3 = mod(-u3); - const x = mod(u3 * invsqrt * u2 * INVSQRT_MINUS_D); // 6 - const y = mod((_1n - s2) * invsqrt * u1); // 7 - const t = mod(x * y); // 8 - if (!isValid) - throw new Error('invalid decaf448 encoding 2'); - return new _DecafPoint(new ed448_Point(x, y, _1n, t)); - } - /** - * Converts decaf-encoded string to decaf point. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-decode-2). - * @param hex Decaf-encoded 56 bytes. Not every 56-byte string is valid decaf encoding - */ - static fromHex(hex) { - return _DecafPoint.fromBytes(hexToBytes(hex)); - } - /** - * Encodes decaf point to Uint8Array. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-encode-2). - */ - toBytes() { - const { X, Z, T } = this.ep; - const P = ed448_CURVE.p; - const mod = (n) => Fp448.create(n); - const u1 = mod(mod(X + T) * mod(X - T)); // 1 - const x2 = mod(X * X); - const { value: invsqrt } = invertSqrt(mod(u1 * ONE_MINUS_D * x2)); // 2 - let ratio = mod(invsqrt * u1 * SQRT_MINUS_D); // 3 - if (isNegativeLE(ratio, P)) - ratio = mod(-ratio); - const u2 = mod(INVSQRT_MINUS_D * ratio * Z - T); // 4 - let s = mod(ONE_MINUS_D * invsqrt * X * u2); // 5 - if (isNegativeLE(s, P)) - s = mod(-s); - return Fn448.toBytes(s); - } - /** - * Compare one point to another. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-equals-2). - */ - equals(other) { - this.assertSame(other); - const { X: X1, Y: Y1 } = this.ep; - const { X: X2, Y: Y2 } = other.ep; - // (x1 * y2 == y1 * x2) - return Fp448.create(X1 * Y2) === Fp448.create(Y1 * X2); - } - is0() { - return this.equals(_DecafPoint.ZERO); - } -} -export const decaf448 = { Point: _DecafPoint }; -/** Hashing to decaf448 points / field. RFC 9380 methods. */ -export const decaf448_hasher = { - Point: _DecafPoint, - hashToCurve(msg, options) { - const DST = options?.DST || 'decaf448_XOF:SHAKE256_D448MAP_RO_'; - return decaf448_hasher.deriveToCurve(expand_message_xof(msg, DST, 112, 224, shake256)); - }, - /** - * Warning: has big modulo bias of 2^-64. - * RFC is invalid. RFC says "use 64-byte xof", while for 2^-112 bias - * it must use 84-byte xof (56+56/2), not 64. - */ - hashToScalar(msg, options = { DST: _DST_scalar }) { - // Can't use `Fn448.fromBytes()`. 64-byte input => 56-byte field element - const xof = expand_message_xof(msg, options.DST, 64, 256, shake256); - return Fn448.create(bytesToNumberLE(xof)); - }, - /** - * HashToCurve-like construction based on RFC 9496 (Element Derivation). - * Converts 112 uniform random bytes into a curve point. - * - * WARNING: This represents an older hash-to-curve construction, preceding the finalization of RFC 9380. - * It was later reused as a component in the newer `hash_to_ristretto255` function defined in RFC 9380. - */ - deriveToCurve(bytes) { - abytes(bytes, 112); - const skipValidation = true; - // Note: Similar to the field element decoding described in - // [RFC7748], and unlike the field element decoding described in - // Section 5.3.1, non-canonical values are accepted. - const r1 = Fp448.create(Fp448.fromBytes(bytes.subarray(0, 56), skipValidation)); - const R1 = calcElligatorDecafMap(r1); - const r2 = Fp448.create(Fp448.fromBytes(bytes.subarray(56, 112), skipValidation)); - const R2 = calcElligatorDecafMap(r2); - return new _DecafPoint(R1.add(R2)); - }, -}; -/** decaf448 OPRF, defined in RFC 9497. */ -export const decaf448_oprf = /* @__PURE__ */ (() => createORPF({ - name: 'decaf448-SHAKE256', - Point: _DecafPoint, - hash: (msg) => shake256(msg, { dkLen: 64 }), - hashToGroup: decaf448_hasher.hashToCurve, - hashToScalar: decaf448_hasher.hashToScalar, -}))(); -/** - * Weird / bogus points, useful for debugging. - * Unlike ed25519, there is no ed448 generator point which can produce full T subgroup. - * Instead, there is a Klein four-group, which spans over 2 independent 2-torsion points: - * (0, 1), (0, -1), (-1, 0), (1, 0). - */ -export const ED448_TORSION_SUBGROUP = [ - '010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', - 'fefffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffff00', - '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', - '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080', -]; -//# sourceMappingURL=ed448.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/ed448.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/ed448.js.map deleted file mode 100644 index 71dfbb9a..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/ed448.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed448.js","sourceRoot":"","sources":["src/ed448.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,sEAAsE;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,IAAI,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAElG,OAAO,EACL,KAAK,EACL,OAAO,EACP,iBAAiB,GAMlB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,WAAW,EACX,YAAY,EACZ,kBAAkB,GAInB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,EAAE,IAAI,EAAe,MAAM,uBAAuB,CAAC;AACnG,OAAO,EAAE,UAAU,EAAuB,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAa,MAAM,oBAAoB,CAAC;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AQ,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;IACvD,WAAW,EAAE,eAAe,CAAC,WAAW;IACxC,YAAY,EAAE,eAAe,CAAC,YAAY;CAC3C,CAAC,CAAC,EAAE,CAAC;AAER;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAa;IAC9C,oHAAoH;IACpH,oHAAoH;IACpH,oHAAoH;IACpH,oHAAoH;CACrH,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/index.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/index.d.ts deleted file mode 100644 index e26a57a8..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/index.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/index.d.ts.map deleted file mode 100644 index 4e8c5816..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/index.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/index.js deleted file mode 100644 index 9ef5788f..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/index.js +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Audited & minimal JS implementation of elliptic curve cryptography. - * @module - * @example -```js -import { secp256k1, schnorr } from '@noble/curves/secp256k1.js'; -import { ed25519, ed25519ph, ed25519ctx, x25519, ristretto255 } from '@noble/curves/ed25519.js'; -import { ed448, ed448ph, x448, decaf448 } from '@noble/curves/ed448.js'; -import { p256, p384, p521 } from '@noble/curves/nist.js'; -import { bls12_381 } from '@noble/curves/bls12-381.js'; -import { bn254 } from '@noble/curves/bn254.js'; -import { jubjub, babyjubjub, brainpoolP256r1, brainpoolP384r1, brainpoolP512r1 } from '@noble/curves/misc.js'; -import * as webcrypto from '@noble/curves/webcrypto.js'; - -// hash-to-curve -import { secp256k1_hasher } from '@noble/curves/secp256k1.js'; -import { p256_hasher, p384_hasher, p521_hasher } from '@noble/curves/nist.js'; -import { ristretto255_hasher } from '@noble/curves/ed25519.js'; -import { decaf448_hasher } from '@noble/curves/ed448.js'; - -// OPRFs -import { p256_oprf, p384_oprf, p521_oprf } from '@noble/curves/nist.js'; -import { ristretto255_oprf } from '@noble/curves/ed25519.js'; -import { decaf448_oprf } from '@noble/curves/ed448.js'; - -// utils -import { bytesToHex, hexToBytes, concatBytes } from '@noble/curves/abstract/utils.js'; -import { Field } from '@noble/curves/abstract/modular.js'; -``` - */ -throw new Error('root module cannot be imported: import submodules instead. Check out README'); -export {}; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/index.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/index.js.map deleted file mode 100644 index 2c796f21..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,IAAI,KAAK,CAAC,6EAA6E,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/misc.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/misc.d.ts deleted file mode 100644 index f904798e..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/misc.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { type EdDSA, type EdwardsPoint } from './abstract/edwards.ts'; -import { type ECDSA } from './abstract/weierstrass.ts'; -/** Curve over scalar field of bls12-381. jubjub Fp = bls n */ -export declare const jubjub: EdDSA; -/** Curve over scalar field of bn254. babyjubjub Fp = bn254 n */ -export declare const babyjubjub: EdDSA; -export declare function jubjub_groupHash(tag: Uint8Array, personalization: Uint8Array): EdwardsPoint; -export declare function jubjub_findGroupHash(m: Uint8Array, personalization: Uint8Array): EdwardsPoint; -/** Brainpool P256r1 with sha256, from RFC 5639. */ -export declare const brainpoolP256r1: ECDSA; -/** Brainpool P384r1 with sha384, from RFC 5639. */ -export declare const brainpoolP384r1: ECDSA; -/** Brainpool P521r1 with sha512, from RFC 5639. */ -export declare const brainpoolP512r1: ECDSA; -//# sourceMappingURL=misc.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/misc.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/misc.d.ts.map deleted file mode 100644 index db365625..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/misc.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["src/misc.ts"],"names":[],"mappings":"AAUA,OAAO,EAGL,KAAK,KAAK,EAEV,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAsB,KAAK,KAAK,EAAwB,MAAM,2BAA2B,CAAC;AAejG,8DAA8D;AAC9D,eAAO,MAAM,MAAM,EAAE,KAA4D,CAAC;AAYlF,gEAAgE;AAChE,eAAO,MAAM,UAAU,EAAE,KAAkE,CAAC;AAO5F,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,GAAG,YAAY,CAU3F;AAKD,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,GAAG,YAAY,CAW7F;AAWD,mDAAmD;AACnD,eAAO,MAAM,eAAe,EAAE,KAAyD,CAAC;AAuBxF,mDAAmD;AACnD,eAAO,MAAM,eAAe,EAAE,KAAyD,CAAC;AAuBxF,mDAAmD;AACnD,eAAO,MAAM,eAAe,EAAE,KAAyD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/misc.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/misc.js deleted file mode 100644 index 095ff55e..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/misc.js +++ /dev/null @@ -1,103 +0,0 @@ -/** - * Miscellaneous, rarely used curves. - * jubjub, babyjubjub, pallas, vesta. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { blake256 } from '@noble/hashes/blake1.js'; -import { blake2s } from '@noble/hashes/blake2.js'; -import { sha256, sha384, sha512 } from '@noble/hashes/sha2.js'; -import { concatBytes } from '@noble/hashes/utils.js'; -import { eddsa, edwards, } from "./abstract/edwards.js"; -import { ecdsa, weierstrass } from "./abstract/weierstrass.js"; -import { asciiToBytes } from "./utils.js"; -// Jubjub curves have 𝔽p over scalar fields of other curves. They are friendly to ZK proofs. -// jubjub p = bls n, verify in bls12-381.ts -const jubjub_CURVE = { - p: BigInt('0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001'), - n: BigInt('0xe7db4ea6533afa906673b0101343b00a6682093ccc81082d0970e5ed6f72cb7'), - h: BigInt(8), - a: BigInt('0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000000'), - d: BigInt('0x2a9318e74bfa2b48f5fd9207e6bd7fd4292d7f6d37579d2601065fd6d6343eb1'), - Gx: BigInt('0x11dafe5d23e1218086a365b99fbf3d3be72f6afd7d1f72623e6b071492d1122b'), - Gy: BigInt('0x1d523cf1ddab1a1793132e78c866c0c33e26ba5cc220fed7cc3f870e59d292aa'), -}; -/** Curve over scalar field of bls12-381. jubjub Fp = bls n */ -export const jubjub = /* @__PURE__ */ eddsa(edwards(jubjub_CURVE), sha512); -// babyjubjub p = bn254 n, verify in bn254.ts -const babyjubjub_CURVE = { - p: BigInt('0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001'), - n: BigInt('0x30644e72e131a029b85045b68181585d59f76dc1c90770533b94bee1c9093788'), - h: BigInt(8), - a: BigInt('168700'), - d: BigInt('168696'), - Gx: BigInt('0x23343e3445b673d38bcba38f25645adb494b1255b1162bb40f41a59f4d4b45e'), - Gy: BigInt('0xc19139cb84c680a6e14116da06056174a0cfa121e6e5c2450f87d64fc000001'), -}; -/** Curve over scalar field of bn254. babyjubjub Fp = bn254 n */ -export const babyjubjub = /* @__PURE__ */ eddsa(edwards(babyjubjub_CURVE), blake256); -const jubjub_gh_first_block = asciiToBytes('096b36a5804bfacef1691e173c366a47ff5ba84a44f26ddd7e8d9f79d5b42df0'); -// Returns point at JubJub curve which is prime order and not zero -export function jubjub_groupHash(tag, personalization) { - const h = blake2s.create({ personalization, dkLen: 32 }); - h.update(jubjub_gh_first_block); - h.update(tag); - // NOTE: returns EdwardsPoint, in case it will be multiplied later - let p = jubjub.Point.fromBytes(h.digest()); - // NOTE: cannot replace with isSmallOrder, returns Point*8 - p = p.multiply(jubjub_CURVE.h); - if (p.equals(jubjub.Point.ZERO)) - throw new Error('Point has small order'); - return p; -} -// No secret data is leaked here at all. -// It operates over public data: -// const G_SPEND = jubjub.findGroupHash(Uint8Array.of(), asciiToBytes('Item_G_')); -export function jubjub_findGroupHash(m, personalization) { - const tag = concatBytes(m, Uint8Array.of(0)); - const hashes = []; - for (let i = 0; i < 256; i++) { - tag[tag.length - 1] = i; - try { - hashes.push(jubjub_groupHash(tag, personalization)); - } - catch (e) { } - } - if (!hashes.length) - throw new Error('findGroupHash tag overflow'); - return hashes[0]; -} -const brainpoolP256r1_CURVE = { - p: BigInt('0xa9fb57dba1eea9bc3e660a909d838d726e3bf623d52620282013481d1f6e5377'), - a: BigInt('0x7d5a0975fc2c3057eef67530417affe7fb8055c126dc5c6ce94a4b44f330b5d9'), - b: BigInt('0x26dc5c6ce94a4b44f330b5d9bbd77cbf958416295cf7e1ce6bccdc18ff8c07b6'), - n: BigInt('0xa9fb57dba1eea9bc3e660a909d838d718c397aa3b561a6f7901e0e82974856a7'), - Gx: BigInt('0x8bd2aeb9cb7e57cb2c4b482ffc81b7afb9de27e1e3bd23c23a4453bd9ace3262'), - Gy: BigInt('0x547ef835c3dac4fd97f8461a14611dc9c27745132ded8e545c1d54c72f046997'), - h: BigInt(1), -}; -/** Brainpool P256r1 with sha256, from RFC 5639. */ -export const brainpoolP256r1 = ecdsa(weierstrass(brainpoolP256r1_CURVE), sha256); -const brainpoolP384r1_CURVE = { - p: BigInt('0x8cb91e82a3386d280f5d6f7e50e641df152f7109ed5456b412b1da197fb71123acd3a729901d1a71874700133107ec53'), - a: BigInt('0x7bc382c63d8c150c3c72080ace05afa0c2bea28e4fb22787139165efba91f90f8aa5814a503ad4eb04a8c7dd22ce2826'), - b: BigInt('0x04a8c7dd22ce28268b39b55416f0447c2fb77de107dcd2a62e880ea53eeb62d57cb4390295dbc9943ab78696fa504c11'), - n: BigInt('0x8cb91e82a3386d280f5d6f7e50e641df152f7109ed5456b31f166e6cac0425a7cf3ab6af6b7fc3103b883202e9046565'), - Gx: BigInt('0x1d1c64f068cf45ffa2a63a81b7c13f6b8847a3e77ef14fe3db7fcafe0cbd10e8e826e03436d646aaef87b2e247d4af1e'), - Gy: BigInt('0x8abe1d7520f9c2a45cb1eb8e95cfd55262b70b29feec5864e19c054ff99129280e4646217791811142820341263c5315'), - h: BigInt(1), -}; -/** Brainpool P384r1 with sha384, from RFC 5639. */ -export const brainpoolP384r1 = ecdsa(weierstrass(brainpoolP384r1_CURVE), sha384); -const brainpoolP512r1_CURVE = { - p: BigInt('0xaadd9db8dbe9c48b3fd4e6ae33c9fc07cb308db3b3c9d20ed6639cca703308717d4d9b009bc66842aecda12ae6a380e62881ff2f2d82c68528aa6056583a48f3'), - a: BigInt('0x7830a3318b603b89e2327145ac234cc594cbdd8d3df91610a83441caea9863bc2ded5d5aa8253aa10a2ef1c98b9ac8b57f1117a72bf2c7b9e7c1ac4d77fc94ca'), - b: BigInt('0x3df91610a83441caea9863bc2ded5d5aa8253aa10a2ef1c98b9ac8b57f1117a72bf2c7b9e7c1ac4d77fc94cadc083e67984050b75ebae5dd2809bd638016f723'), - n: BigInt('0xaadd9db8dbe9c48b3fd4e6ae33c9fc07cb308db3b3c9d20ed6639cca70330870553e5c414ca92619418661197fac10471db1d381085ddaddb58796829ca90069'), - Gx: BigInt('0x81aee4bdd82ed9645a21322e9c4c6a9385ed9f70b5d916c1b43b62eef4d0098eff3b1f78e2d0d48d50d1687b93b97d5f7c6d5047406a5e688b352209bcb9f822'), - Gy: BigInt('0x7dde385d566332ecc0eabfa9cf7822fdf209f70024a57b1aa000c55b881f8111b2dcde494a5f485e5bca4bd88a2763aed1ca2b2fa8f0540678cd1e0f3ad80892'), - h: BigInt(1), -}; -/** Brainpool P521r1 with sha512, from RFC 5639. */ -export const brainpoolP512r1 = ecdsa(weierstrass(brainpoolP512r1_CURVE), sha512); -//# sourceMappingURL=misc.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/misc.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/misc.js.map deleted file mode 100644 index e1d0448b..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/misc.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"misc.js","sourceRoot":"","sources":["src/misc.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,sEAAsE;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,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,MAAM,CACP,oIAAoI,CACrI;IACD,CAAC,EAAE,MAAM,CACP,oIAAoI,CACrI;IACD,CAAC,EAAE,MAAM,CACP,oIAAoI,CACrI;IACD,EAAE,EAAE,MAAM,CACR,oIAAoI,CACrI;IACD,EAAE,EAAE,MAAM,CACR,oIAAoI,CACrI;IACD,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;CACb,CAAC;AACF,mDAAmD;AACnD,MAAM,CAAC,MAAM,eAAe,GAAU,KAAK,CAAC,WAAW,CAAC,qBAAqB,CAAC,EAAE,MAAM,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/nist.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/nist.d.ts deleted file mode 100644 index 876af382..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/nist.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { type H2CHasher } from './abstract/hash-to-curve.ts'; -import { type OPRF } from './abstract/oprf.ts'; -import { type ECDSA, type WeierstrassPointCons } from './abstract/weierstrass.ts'; -/** - * NIST P256 (aka secp256r1, prime256v1) curve, ECDSA and ECDH methods. - * Hashes inputs with sha256 by default. - * - * @example - * ```js - * import { p256 } from '@noble/curves/nist.js'; - * const { secretKey, publicKey } = p256.keygen(); - * // const publicKey = p256.getPublicKey(secretKey); - * const msg = new TextEncoder().encode('hello noble'); - * const sig = p256.sign(msg, secretKey); - * const isValid = p256.verify(sig, msg, publicKey); - * // const sigKeccak = p256.sign(keccak256(msg), secretKey, { prehash: false }); - * ``` - */ -export declare const p256: ECDSA; -/** Hashing / encoding to p256 points / field. RFC 9380 methods. */ -export declare const p256_hasher: H2CHasher>; -/** p256 OPRF, defined in RFC 9497. */ -export declare const p256_oprf: OPRF; -/** NIST P384 (aka secp384r1) curve, ECDSA and ECDH methods. Hashes inputs with sha384 by default. */ -export declare const p384: ECDSA; -/** Hashing / encoding to p384 points / field. RFC 9380 methods. */ -export declare const p384_hasher: H2CHasher>; -/** p384 OPRF, defined in RFC 9497. */ -export declare const p384_oprf: OPRF; -/** NIST P521 (aka secp521r1) curve, ECDSA and ECDH methods. Hashes inputs with sha512 by default. */ -export declare const p521: ECDSA; -/** Hashing / encoding to p521 points / field. RFC 9380 methods. */ -export declare const p521_hasher: H2CHasher>; -/** p521 OPRF, defined in RFC 9497. */ -export declare const p521_oprf: OPRF; -//# sourceMappingURL=nist.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/nist.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/nist.d.ts.map deleted file mode 100644 index 43e05094..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/nist.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nist.d.ts","sourceRoot":"","sources":["src/nist.ts"],"names":[],"mappings":"AAOA,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAE3E,OAAO,EAAc,KAAK,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAIL,KAAK,KAAK,EAEV,KAAK,oBAAoB,EAC1B,MAAM,2BAA2B,CAAC;AAyEnC;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,IAAI,EAAE,KAAiD,CAAC;AACrE,mEAAmE;AACnE,eAAO,MAAM,WAAW,EAAE,SAAS,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAkB5D,CAAC;AACL,sCAAsC;AACtC,eAAO,MAAM,SAAS,EAAE,IAOjB,CAAC;AAIR,qGAAqG;AACrG,eAAO,MAAM,IAAI,EAAE,KAAiD,CAAC;AACrE,mEAAmE;AACnE,eAAO,MAAM,WAAW,EAAE,SAAS,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAkB5D,CAAC;AACL,sCAAsC;AACtC,eAAO,MAAM,SAAS,EAAE,IAOjB,CAAC;AAKR,qGAAqG;AACrG,eAAO,MAAM,IAAI,EAAE,KAAiD,CAAC;AACrE,mEAAmE;AACnE,eAAO,MAAM,WAAW,EAAE,SAAS,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAkB5D,CAAC;AACL,sCAAsC;AACtC,eAAO,MAAM,SAAS,EAAE,IAOjB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/nist.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/nist.js deleted file mode 100644 index 9b2d61c4..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/nist.js +++ /dev/null @@ -1,146 +0,0 @@ -/** - * Internal module for NIST P256, P384, P521 curves. - * Do not use for now. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { sha256, sha384, sha512 } from '@noble/hashes/sha2.js'; -import { createHasher } from "./abstract/hash-to-curve.js"; -import { Field } from "./abstract/modular.js"; -import { createORPF } from "./abstract/oprf.js"; -import { ecdsa, mapToCurveSimpleSWU, weierstrass, } from "./abstract/weierstrass.js"; -// p = 2n**224n * (2n**32n-1n) + 2n**192n + 2n**96n - 1n -// a = Fp256.create(BigInt('-3')); -const p256_CURVE = /* @__PURE__ */ (() => ({ - p: BigInt('0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff'), - n: BigInt('0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551'), - h: BigInt(1), - a: BigInt('0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc'), - b: BigInt('0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b'), - Gx: BigInt('0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296'), - Gy: BigInt('0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5'), -}))(); -// p = 2n**384n - 2n**128n - 2n**96n + 2n**32n - 1n -const p384_CURVE = /* @__PURE__ */ (() => ({ - p: BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff'), - n: BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973'), - h: BigInt(1), - a: BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffc'), - b: BigInt('0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef'), - Gx: BigInt('0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7'), - Gy: BigInt('0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f'), -}))(); -// p = 2n**521n - 1n -const p521_CURVE = /* @__PURE__ */ (() => ({ - p: BigInt('0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'), - n: BigInt('0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409'), - h: BigInt(1), - a: BigInt('0x1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc'), - b: BigInt('0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00'), - Gx: BigInt('0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66'), - Gy: BigInt('0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650'), -}))(); -function createSWU(Point, opts) { - const map = mapToCurveSimpleSWU(Point.Fp, opts); - return (scalars) => map(scalars[0]); -} -// NIST P256 -const p256_Point = /* @__PURE__ */ weierstrass(p256_CURVE); -/** - * NIST P256 (aka secp256r1, prime256v1) curve, ECDSA and ECDH methods. - * Hashes inputs with sha256 by default. - * - * @example - * ```js - * import { p256 } from '@noble/curves/nist.js'; - * const { secretKey, publicKey } = p256.keygen(); - * // const publicKey = p256.getPublicKey(secretKey); - * const msg = new TextEncoder().encode('hello noble'); - * const sig = p256.sign(msg, secretKey); - * const isValid = p256.verify(sig, msg, publicKey); - * // const sigKeccak = p256.sign(keccak256(msg), secretKey, { prehash: false }); - * ``` - */ -export const p256 = /* @__PURE__ */ ecdsa(p256_Point, sha256); -/** Hashing / encoding to p256 points / field. RFC 9380 methods. */ -export const p256_hasher = /* @__PURE__ */ (() => { - return createHasher(p256_Point, createSWU(p256_Point, { - A: p256_CURVE.a, - B: p256_CURVE.b, - Z: p256_Point.Fp.create(BigInt('-10')), - }), { - DST: 'P256_XMD:SHA-256_SSWU_RO_', - encodeDST: 'P256_XMD:SHA-256_SSWU_NU_', - p: p256_CURVE.p, - m: 1, - k: 128, - expand: 'xmd', - hash: sha256, - }); -})(); -/** p256 OPRF, defined in RFC 9497. */ -export const p256_oprf = /* @__PURE__ */ (() => createORPF({ - name: 'P256-SHA256', - Point: p256_Point, - hash: sha256, - hashToGroup: p256_hasher.hashToCurve, - hashToScalar: p256_hasher.hashToScalar, -}))(); -// NIST P384 -const p384_Point = /* @__PURE__ */ weierstrass(p384_CURVE); -/** NIST P384 (aka secp384r1) curve, ECDSA and ECDH methods. Hashes inputs with sha384 by default. */ -export const p384 = /* @__PURE__ */ ecdsa(p384_Point, sha384); -/** Hashing / encoding to p384 points / field. RFC 9380 methods. */ -export const p384_hasher = /* @__PURE__ */ (() => { - return createHasher(p384_Point, createSWU(p384_Point, { - A: p384_CURVE.a, - B: p384_CURVE.b, - Z: p384_Point.Fp.create(BigInt('-12')), - }), { - DST: 'P384_XMD:SHA-384_SSWU_RO_', - encodeDST: 'P384_XMD:SHA-384_SSWU_NU_', - p: p384_CURVE.p, - m: 1, - k: 192, - expand: 'xmd', - hash: sha384, - }); -})(); -/** p384 OPRF, defined in RFC 9497. */ -export const p384_oprf = /* @__PURE__ */ (() => createORPF({ - name: 'P384-SHA384', - Point: p384_Point, - hash: sha384, - hashToGroup: p384_hasher.hashToCurve, - hashToScalar: p384_hasher.hashToScalar, -}))(); -// NIST P521 -const Fn521 = /* @__PURE__ */ (() => Field(p521_CURVE.n, { allowedLengths: [65, 66] }))(); -const p521_Point = /* @__PURE__ */ weierstrass(p521_CURVE, { Fn: Fn521 }); -/** NIST P521 (aka secp521r1) curve, ECDSA and ECDH methods. Hashes inputs with sha512 by default. */ -export const p521 = /* @__PURE__ */ ecdsa(p521_Point, sha512); -/** Hashing / encoding to p521 points / field. RFC 9380 methods. */ -export const p521_hasher = /* @__PURE__ */ (() => { - return createHasher(p521_Point, createSWU(p521_Point, { - A: p521_CURVE.a, - B: p521_CURVE.b, - Z: p521_Point.Fp.create(BigInt('-4')), - }), { - DST: 'P521_XMD:SHA-512_SSWU_RO_', - encodeDST: 'P521_XMD:SHA-512_SSWU_NU_', - p: p521_CURVE.p, - m: 1, - k: 256, - expand: 'xmd', - hash: sha512, - }); -})(); -/** p521 OPRF, defined in RFC 9497. */ -export const p521_oprf = /* @__PURE__ */ (() => createORPF({ - name: 'P521-SHA512', - Point: p521_Point, - hash: sha512, - hashToGroup: p521_hasher.hashToCurve, - hashToScalar: p521_hasher.hashToScalar, // produces L=98 just like in RFC -}))(); -//# sourceMappingURL=nist.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/nist.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/nist.js.map deleted file mode 100644 index e396d621..00000000 --- a/tools/mnemonic-test/node_modules/@scure/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AG,EAAE,CACnD,UAAU,CAAC;IACT,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE,UAAU;IACjB,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,WAAW,CAAC,WAAW;IACpC,YAAY,EAAE,WAAW,CAAC,YAAY,EAAE,iCAAiC;CAC1E,CAAC,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/package.json b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/package.json deleted file mode 100644 index 5b706051..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/package.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "name": "@noble/curves", - "version": "2.0.1", - "description": "Audited & minimal JS implementation of elliptic curve cryptography", - "files": [ - "*.js", - "*.js.map", - "*.d.ts", - "*.d.ts.map", - "abstract", - "src" - ], - "dependencies": { - "@noble/hashes": "2.0.1" - }, - "devDependencies": { - "@paulmillr/jsbt": "0.4.4", - "@types/node": "24.2.1", - "fast-check": "4.2.0", - "prettier": "3.6.2", - "typescript": "5.9.2" - }, - "scripts": { - "bench": "cd test/benchmark; node secp256k1.ts; node curves.ts; node utils.ts; node bls.ts", - "bench:install": "cd test/benchmark; npm install; npm install ../.. --install-links", - "build": "tsc", - "build:release": "npx --no @paulmillr/jsbt esbuild test/build", - "build:clean": "rm {.,abstract}/*.{js,d.ts,d.ts.map,js.map} 2> /dev/null", - "format": "prettier --write 'src/**/*.{js,ts}' 'test/*.{js,ts}'", - "test": "node --experimental-strip-types --disable-warning=ExperimentalWarning test/index.ts", - "test:bun": "bun test/index.ts", - "test:deno": "deno --allow-env --allow-read test/index.ts", - "test:node20": "cd test; npx tsc; node compiled/test/index.js", - "test:coverage": "npm install --no-save c8@10.1.2 && npx c8 npm test" - }, - "exports": { - ".": "./index.js", - "./abstract/bls.js": "./abstract/bls.js", - "./abstract/curve.js": "./abstract/curve.js", - "./abstract/edwards.js": "./abstract/edwards.js", - "./abstract/fft.js": "./abstract/fft.js", - "./abstract/hash-to-curve.js": "./abstract/hash-to-curve.js", - "./abstract/modular.js": "./abstract/modular.js", - "./abstract/montgomery.js": "./abstract/montgomery.js", - "./abstract/oprf.js": "./abstract/oprf.js", - "./abstract/poseidon.js": "./abstract/poseidon.js", - "./abstract/tower.js": "./abstract/tower.js", - "./abstract/weierstrass.js": "./abstract/weierstrass.js", - "./bls12-381.js": "./bls12-381.js", - "./bn254.js": "./bn254.js", - "./ed448.js": "./ed448.js", - "./ed25519.js": "./ed25519.js", - "./misc.js": "./misc.js", - "./nist.js": "./nist.js", - "./secp256k1.js": "./secp256k1.js", - "./utils.js": "./utils.js", - "./webcrypto.js": "./webcrypto.js" - }, - "engines": { - "node": ">= 20.19.0" - }, - "keywords": [ - "cryptography", - "secp256k1", - "ed25519", - "p256", - "p384", - "p521", - "secp256r1", - "ed448", - "x25519", - "ed25519", - "bls12-381", - "bn254", - "alt_bn128", - "bls", - "noble", - "ecc", - "ecdsa", - "eddsa", - "oprf", - "schnorr", - "fft" - ], - "homepage": "https://paulmillr.com/noble/", - "funding": "https://paulmillr.com/funding/", - "repository": { - "type": "git", - "url": "git+https://github.com/paulmillr/noble-curves.git" - }, - "type": "module", - "main": "index.js", - "module": "index.js", - "types": "index.d.ts", - "sideEffects": false, - "author": "Paul Miller (https://paulmillr.com)", - "license": "MIT" -} diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/secp256k1.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/secp256k1.d.ts deleted file mode 100644 index b60c95f4..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/secp256k1.d.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { type CurveLengths } from './abstract/curve.ts'; -import { type H2CHasher } from './abstract/hash-to-curve.ts'; -import { type ECDSA, type WeierstrassPoint as PointType, type WeierstrassPointCons } from './abstract/weierstrass.ts'; -/** - * secp256k1 curve: ECDSA and ECDH methods. - * - * Uses sha256 to hash messages. To use a different hash, - * pass `{ prehash: false }` to sign / verify. - * - * @example - * ```js - * import { secp256k1 } from '@noble/curves/secp256k1.js'; - * const { secretKey, publicKey } = secp256k1.keygen(); - * // const publicKey = secp256k1.getPublicKey(secretKey); - * const msg = new TextEncoder().encode('hello noble'); - * const sig = secp256k1.sign(msg, secretKey); - * const isValid = secp256k1.verify(sig, msg, publicKey); - * // const sigKeccak = secp256k1.sign(keccak256(msg), secretKey, { prehash: false }); - * ``` - */ -export declare const secp256k1: ECDSA; -declare function taggedHash(tag: string, ...messages: Uint8Array[]): Uint8Array; -/** - * lift_x from BIP340. Convert 32-byte x coordinate to elliptic curve point. - * @returns valid point checked for being on-curve - */ -declare function lift_x(x: bigint): PointType; -/** - * Schnorr public key is just `x` coordinate of Point as per BIP340. - */ -declare function schnorrGetPublicKey(secretKey: Uint8Array): Uint8Array; -/** - * Creates Schnorr signature as per BIP340. Verifies itself before returning anything. - * auxRand is optional and is not the sole source of k generation: bad CSPRNG won't be dangerous. - */ -declare function schnorrSign(message: Uint8Array, secretKey: Uint8Array, auxRand?: Uint8Array): Uint8Array; -/** - * Verifies Schnorr signature. - * Will swallow errors & return false except for initial type validation of arguments. - */ -declare function schnorrVerify(signature: Uint8Array, message: Uint8Array, publicKey: Uint8Array): boolean; -export type SecpSchnorr = { - keygen: (seed?: Uint8Array) => { - secretKey: Uint8Array; - publicKey: Uint8Array; - }; - getPublicKey: typeof schnorrGetPublicKey; - sign: typeof schnorrSign; - verify: typeof schnorrVerify; - Point: WeierstrassPointCons; - utils: { - randomSecretKey: (seed?: Uint8Array) => Uint8Array; - pointToBytes: (point: PointType) => Uint8Array; - lift_x: typeof lift_x; - taggedHash: typeof taggedHash; - }; - lengths: CurveLengths; -}; -/** - * Schnorr signatures over secp256k1. - * https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki - * @example - * ```js - * import { schnorr } from '@noble/curves/secp256k1.js'; - * const { secretKey, publicKey } = schnorr.keygen(); - * // const publicKey = schnorr.getPublicKey(secretKey); - * const msg = new TextEncoder().encode('hello'); - * const sig = schnorr.sign(msg, secretKey); - * const isValid = schnorr.verify(sig, msg, publicKey); - * ``` - */ -export declare const schnorr: SecpSchnorr; -/** Hashing / encoding to secp256k1 points / field. RFC 9380 methods. */ -export declare const secp256k1_hasher: H2CHasher>; -export {}; -//# sourceMappingURL=secp256k1.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/secp256k1.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/secp256k1.d.ts.map deleted file mode 100644 index c167bf24..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/secp256k1.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"secp256k1.d.ts","sourceRoot":"","sources":["src/secp256k1.ts"],"names":[],"mappings":"AAUA,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAgB,KAAK,SAAS,EAAc,MAAM,6BAA6B,CAAC;AAEvF,OAAO,EACL,KAAK,KAAK,EAIV,KAAK,gBAAgB,IAAI,SAAS,EAGlC,KAAK,oBAAoB,EAC1B,MAAM,2BAA2B,CAAC;AA6DnC;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,SAAS,EAAE,KAA8C,CAAC;AAMvE,iBAAS,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,UAAU,EAAE,GAAG,UAAU,CAQtE;AAcD;;;GAGG;AACH,iBAAS,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,CAY5C;AASD;;GAEG;AACH,iBAAS,mBAAmB,CAAC,SAAS,EAAE,UAAU,GAAG,UAAU,CAE9D;AAED;;;GAGG;AACH,iBAAS,WAAW,CAClB,OAAO,EAAE,UAAU,EACnB,SAAS,EAAE,UAAU,EACrB,OAAO,GAAE,UAA4B,GACpC,UAAU,CAgBZ;AAED;;;GAGG;AACH,iBAAS,aAAa,CAAC,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,GAAG,OAAO,CAsBjG;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,UAAU,KAAK;QAAE,SAAS,EAAE,UAAU,CAAC;QAAC,SAAS,EAAE,UAAU,CAAA;KAAE,CAAC;IAChF,YAAY,EAAE,OAAO,mBAAmB,CAAC;IACzC,IAAI,EAAE,OAAO,WAAW,CAAC;IACzB,MAAM,EAAE,OAAO,aAAa,CAAC;IAC7B,KAAK,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAC;IACpC,KAAK,EAAE;QACL,eAAe,EAAE,CAAC,IAAI,CAAC,EAAE,UAAU,KAAK,UAAU,CAAC;QACnD,YAAY,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,KAAK,UAAU,CAAC;QACvD,MAAM,EAAE,OAAO,MAAM,CAAC;QACtB,UAAU,EAAE,OAAO,UAAU,CAAC;KAC/B,CAAC;IACF,OAAO,EAAE,YAAY,CAAC;CACvB,CAAC;AACF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,OAAO,EAAE,WA0BlB,CAAC;AA0CL,wEAAwE;AACxE,eAAO,MAAM,gBAAgB,EAAE,SAAS,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAgB/D,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/secp256k1.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/secp256k1.js deleted file mode 100644 index 6b988ad7..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/secp256k1.js +++ /dev/null @@ -1,283 +0,0 @@ -/** - * SECG secp256k1. See [pdf](https://www.secg.org/sec2-v2.pdf). - * - * Belongs to Koblitz curves: it has efficiently-computable GLV endomorphism ψ, - * check out {@link EndomorphismOpts}. Seems to be rigid (not backdoored). - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { sha256 } from '@noble/hashes/sha2.js'; -import { randomBytes } from '@noble/hashes/utils.js'; -import { createKeygen } from "./abstract/curve.js"; -import { createHasher, isogenyMap } from "./abstract/hash-to-curve.js"; -import { Field, mapHashToField, pow2 } from "./abstract/modular.js"; -import { ecdsa, mapToCurveSimpleSWU, weierstrass, } from "./abstract/weierstrass.js"; -import { abytes, asciiToBytes, bytesToNumberBE, concatBytes } from "./utils.js"; -// Seems like generator was produced from some seed: -// `Pointk1.BASE.multiply(Pointk1.Fn.inv(2n, N)).toAffine().x` -// // gives short x 0x3b78ce563f89a0ed9414f5aa28ad0d96d6795f9c63n -const secp256k1_CURVE = { - p: BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f'), - n: BigInt('0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141'), - h: BigInt(1), - a: BigInt(0), - b: BigInt(7), - Gx: BigInt('0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798'), - Gy: BigInt('0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8'), -}; -const secp256k1_ENDO = { - beta: BigInt('0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee'), - basises: [ - [BigInt('0x3086d221a7d46bcde86c90e49284eb15'), -BigInt('0xe4437ed6010e88286f547fa90abfe4c3')], - [BigInt('0x114ca50f7a8e2f3f657c1108d9d44cfd8'), BigInt('0x3086d221a7d46bcde86c90e49284eb15')], - ], -}; -const _0n = /* @__PURE__ */ BigInt(0); -const _2n = /* @__PURE__ */ BigInt(2); -/** - * √n = n^((p+1)/4) for fields p = 3 mod 4. We unwrap the loop and multiply bit-by-bit. - * (P+1n/4n).toString(2) would produce bits [223x 1, 0, 22x 1, 4x 0, 11, 00] - */ -function sqrtMod(y) { - const P = secp256k1_CURVE.p; - // prettier-ignore - const _3n = BigInt(3), _6n = BigInt(6), _11n = BigInt(11), _22n = BigInt(22); - // prettier-ignore - const _23n = BigInt(23), _44n = BigInt(44), _88n = BigInt(88); - const b2 = (y * y * y) % P; // x^3, 11 - const b3 = (b2 * b2 * y) % P; // x^7 - const b6 = (pow2(b3, _3n, P) * b3) % P; - const b9 = (pow2(b6, _3n, P) * b3) % P; - const b11 = (pow2(b9, _2n, P) * b2) % P; - const b22 = (pow2(b11, _11n, P) * b11) % P; - const b44 = (pow2(b22, _22n, P) * b22) % P; - const b88 = (pow2(b44, _44n, P) * b44) % P; - const b176 = (pow2(b88, _88n, P) * b88) % P; - const b220 = (pow2(b176, _44n, P) * b44) % P; - const b223 = (pow2(b220, _3n, P) * b3) % P; - const t1 = (pow2(b223, _23n, P) * b22) % P; - const t2 = (pow2(t1, _6n, P) * b2) % P; - const root = pow2(t2, _2n, P); - if (!Fpk1.eql(Fpk1.sqr(root), y)) - throw new Error('Cannot find square root'); - return root; -} -const Fpk1 = Field(secp256k1_CURVE.p, { sqrt: sqrtMod }); -const Pointk1 = /* @__PURE__ */ weierstrass(secp256k1_CURVE, { - Fp: Fpk1, - endo: secp256k1_ENDO, -}); -/** - * secp256k1 curve: ECDSA and ECDH methods. - * - * Uses sha256 to hash messages. To use a different hash, - * pass `{ prehash: false }` to sign / verify. - * - * @example - * ```js - * import { secp256k1 } from '@noble/curves/secp256k1.js'; - * const { secretKey, publicKey } = secp256k1.keygen(); - * // const publicKey = secp256k1.getPublicKey(secretKey); - * const msg = new TextEncoder().encode('hello noble'); - * const sig = secp256k1.sign(msg, secretKey); - * const isValid = secp256k1.verify(sig, msg, publicKey); - * // const sigKeccak = secp256k1.sign(keccak256(msg), secretKey, { prehash: false }); - * ``` - */ -export const secp256k1 = /* @__PURE__ */ ecdsa(Pointk1, sha256); -// Schnorr signatures are superior to ECDSA from above. Below is Schnorr-specific BIP0340 code. -// https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki -/** An object mapping tags to their tagged hash prefix of [SHA256(tag) | SHA256(tag)] */ -const TAGGED_HASH_PREFIXES = {}; -function taggedHash(tag, ...messages) { - let tagP = TAGGED_HASH_PREFIXES[tag]; - if (tagP === undefined) { - const tagH = sha256(asciiToBytes(tag)); - tagP = concatBytes(tagH, tagH); - TAGGED_HASH_PREFIXES[tag] = tagP; - } - return sha256(concatBytes(tagP, ...messages)); -} -// ECDSA compact points are 33-byte. Schnorr is 32: we strip first byte 0x02 or 0x03 -const pointToBytes = (point) => point.toBytes(true).slice(1); -const hasEven = (y) => y % _2n === _0n; -// Calculate point, scalar and bytes -function schnorrGetExtPubKey(priv) { - const { Fn, BASE } = Pointk1; - const d_ = Fn.fromBytes(priv); - const p = BASE.multiply(d_); // P = d'⋅G; 0 < d' < n check is done inside - const scalar = hasEven(p.y) ? d_ : Fn.neg(d_); - return { scalar, bytes: pointToBytes(p) }; -} -/** - * lift_x from BIP340. Convert 32-byte x coordinate to elliptic curve point. - * @returns valid point checked for being on-curve - */ -function lift_x(x) { - const Fp = Fpk1; - if (!Fp.isValidNot0(x)) - throw new Error('invalid x: Fail if x ≥ p'); - const xx = Fp.create(x * x); - const c = Fp.create(xx * x + BigInt(7)); // Let c = x³ + 7 mod p. - let y = Fp.sqrt(c); // Let y = c^(p+1)/4 mod p. Same as sqrt(). - // Return the unique point P such that x(P) = x and - // y(P) = y if y mod 2 = 0 or y(P) = p-y otherwise. - if (!hasEven(y)) - y = Fp.neg(y); - const p = Pointk1.fromAffine({ x, y }); - p.assertValidity(); - return p; -} -const num = bytesToNumberBE; -/** - * Create tagged hash, convert it to bigint, reduce modulo-n. - */ -function challenge(...args) { - return Pointk1.Fn.create(num(taggedHash('BIP0340/challenge', ...args))); -} -/** - * Schnorr public key is just `x` coordinate of Point as per BIP340. - */ -function schnorrGetPublicKey(secretKey) { - return schnorrGetExtPubKey(secretKey).bytes; // d'=int(sk). Fail if d'=0 or d'≥n. Ret bytes(d'⋅G) -} -/** - * Creates Schnorr signature as per BIP340. Verifies itself before returning anything. - * auxRand is optional and is not the sole source of k generation: bad CSPRNG won't be dangerous. - */ -function schnorrSign(message, secretKey, auxRand = randomBytes(32)) { - const { Fn } = Pointk1; - const m = abytes(message, undefined, 'message'); - const { bytes: px, scalar: d } = schnorrGetExtPubKey(secretKey); // checks for isWithinCurveOrder - const a = abytes(auxRand, 32, 'auxRand'); // Auxiliary random data a: a 32-byte array - const t = Fn.toBytes(d ^ num(taggedHash('BIP0340/aux', a))); // Let t be the byte-wise xor of bytes(d) and hash/aux(a) - const rand = taggedHash('BIP0340/nonce', t, px, m); // Let rand = hash/nonce(t || bytes(P) || m) - // Let k' = int(rand) mod n. Fail if k' = 0. Let R = k'⋅G - const { bytes: rx, scalar: k } = schnorrGetExtPubKey(rand); - const e = challenge(rx, px, m); // Let e = int(hash/challenge(bytes(R) || bytes(P) || m)) mod n. - const sig = new Uint8Array(64); // Let sig = bytes(R) || bytes((k + ed) mod n). - sig.set(rx, 0); - sig.set(Fn.toBytes(Fn.create(k + e * d)), 32); - // If Verify(bytes(P), m, sig) (see below) returns failure, abort - if (!schnorrVerify(sig, m, px)) - throw new Error('sign: Invalid signature produced'); - return sig; -} -/** - * Verifies Schnorr signature. - * Will swallow errors & return false except for initial type validation of arguments. - */ -function schnorrVerify(signature, message, publicKey) { - const { Fp, Fn, BASE } = Pointk1; - const sig = abytes(signature, 64, 'signature'); - const m = abytes(message, undefined, 'message'); - const pub = abytes(publicKey, 32, 'publicKey'); - try { - const P = lift_x(num(pub)); // P = lift_x(int(pk)); fail if that fails - const r = num(sig.subarray(0, 32)); // Let r = int(sig[0:32]); fail if r ≥ p. - if (!Fp.isValidNot0(r)) - return false; - const s = num(sig.subarray(32, 64)); // Let s = int(sig[32:64]); fail if s ≥ n. - if (!Fn.isValidNot0(s)) - return false; - const e = challenge(Fn.toBytes(r), pointToBytes(P), m); // int(challenge(bytes(r)||bytes(P)||m))%n - // R = s⋅G - e⋅P, where -eP == (n-e)P - const R = BASE.multiplyUnsafe(s).add(P.multiplyUnsafe(Fn.neg(e))); - const { x, y } = R.toAffine(); - // Fail if is_infinite(R) / not has_even_y(R) / x(R) ≠ r. - if (R.is0() || !hasEven(y) || x !== r) - return false; - return true; - } - catch (error) { - return false; - } -} -/** - * Schnorr signatures over secp256k1. - * https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki - * @example - * ```js - * import { schnorr } from '@noble/curves/secp256k1.js'; - * const { secretKey, publicKey } = schnorr.keygen(); - * // const publicKey = schnorr.getPublicKey(secretKey); - * const msg = new TextEncoder().encode('hello'); - * const sig = schnorr.sign(msg, secretKey); - * const isValid = schnorr.verify(sig, msg, publicKey); - * ``` - */ -export const schnorr = /* @__PURE__ */ (() => { - const size = 32; - const seedLength = 48; - const randomSecretKey = (seed = randomBytes(seedLength)) => { - return mapHashToField(seed, secp256k1_CURVE.n); - }; - return { - keygen: createKeygen(randomSecretKey, schnorrGetPublicKey), - getPublicKey: schnorrGetPublicKey, - sign: schnorrSign, - verify: schnorrVerify, - Point: Pointk1, - utils: { - randomSecretKey, - taggedHash, - lift_x, - pointToBytes, - }, - lengths: { - secretKey: size, - publicKey: size, - publicKeyHasPrefix: false, - signature: size * 2, - seed: seedLength, - }, - }; -})(); -const isoMap = /* @__PURE__ */ (() => isogenyMap(Fpk1, [ - // xNum - [ - '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7', - '0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581', - '0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262', - '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c', - ], - // xDen - [ - '0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b', - '0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14', - '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1 - ], - // yNum - [ - '0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c', - '0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3', - '0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931', - '0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84', - ], - // yDen - [ - '0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b', - '0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573', - '0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f', - '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1 - ], -].map((i) => i.map((j) => BigInt(j)))))(); -const mapSWU = /* @__PURE__ */ (() => mapToCurveSimpleSWU(Fpk1, { - A: BigInt('0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533'), - B: BigInt('1771'), - Z: Fpk1.create(BigInt('-11')), -}))(); -/** Hashing / encoding to secp256k1 points / field. RFC 9380 methods. */ -export const secp256k1_hasher = /* @__PURE__ */ (() => createHasher(Pointk1, (scalars) => { - const { x, y } = mapSWU(Fpk1.create(scalars[0])); - return isoMap(x, y); -}, { - DST: 'secp256k1_XMD:SHA-256_SSWU_RO_', - encodeDST: 'secp256k1_XMD:SHA-256_SSWU_NU_', - p: Fpk1.ORDER, - m: 1, - k: 128, - expand: 'xmd', - hash: sha256, -}))(); -//# sourceMappingURL=secp256k1.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/secp256k1.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/secp256k1.js.map deleted file mode 100644 index d949201e..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/secp256k1.js.map +++ /dev/null @@ -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AK;IACb,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,GAAG;IACN,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,MAAM;CACb,CACF,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/bls.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/bls.ts deleted file mode 100644 index 08e4e88a..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/bls.ts +++ /dev/null @@ -1,604 +0,0 @@ -/** - * BLS != BLS. - * The file implements BLS (Boneh-Lynn-Shacham) signatures. - * Used in both BLS (Barreto-Lynn-Scott) and BN (Barreto-Naehrig) - * families of pairing-friendly curves. - * Consists of two curves: G1 and G2: - * - G1 is a subgroup of (x, y) E(Fq) over y² = x³ + 4. - * - G2 is a subgroup of ((x₁, x₂+i), (y₁, y₂+i)) E(Fq²) over y² = x³ + 4(1 + i) where i is √-1 - * - Gt, created by bilinear (ate) pairing e(G1, G2), consists of p-th roots of unity in - * Fq^k where k is embedding degree. Only degree 12 is currently supported, 24 is not. - * Pairing is used to aggregate and verify signatures. - * There are two modes of operation: - * - Long signatures: X-byte keys + 2X-byte sigs (G1 keys + G2 sigs). - * - Short signatures: 2X-byte keys + X-byte sigs (G2 keys + G1 sigs). - * @module - **/ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { abytes, memoized, notImplemented, randomBytes } from '../utils.ts'; -import { normalizeZ, type CurveLengths } from './curve.ts'; -import { - createHasher, - type H2CDSTOpts, - type H2CHasher, - type H2CHashOpts, - type H2COpts, - type MapToCurve, -} from './hash-to-curve.ts'; -import { getMinHashLength, mapHashToField, type IField } from './modular.ts'; -import type { Fp12, Fp12Bls, Fp2, Fp2Bls, Fp6Bls } from './tower.ts'; -import { type WeierstrassPoint, type WeierstrassPointCons } from './weierstrass.ts'; - -type Fp = bigint; // Can be different field? - -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3); - -export type BlsTwistType = 'multiplicative' | 'divisive'; - -export type BlsShortSignatureCoder = { - fromBytes(bytes: Uint8Array): WeierstrassPoint; - fromHex(hex: string): WeierstrassPoint; - toBytes(point: WeierstrassPoint): Uint8Array; - toHex(point: WeierstrassPoint): string; -}; - -export type BlsLongSignatureCoder = { - fromBytes(bytes: Uint8Array): WeierstrassPoint; - fromHex(hex: string): WeierstrassPoint; - toBytes(point: WeierstrassPoint): Uint8Array; - toHex(point: WeierstrassPoint): string; -}; - -export type BlsFields = { - Fp: IField; - Fr: IField; - Fp2: Fp2Bls; - Fp6: Fp6Bls; - Fp12: Fp12Bls; -}; - -export type BlsPostPrecomputePointAddFn = ( - Rx: Fp2, - Ry: Fp2, - Rz: Fp2, - Qx: Fp2, - Qy: Fp2 -) => { Rx: Fp2; Ry: Fp2; Rz: Fp2 }; -export type BlsPostPrecomputeFn = ( - Rx: Fp2, - Ry: Fp2, - Rz: Fp2, - Qx: Fp2, - Qy: Fp2, - pointAdd: BlsPostPrecomputePointAddFn -) => void; -export type BlsPairing = { - lengths: CurveLengths; - Fr: IField; - Fp12: Fp12Bls; - calcPairingPrecomputes: (p: WeierstrassPoint) => Precompute; - millerLoopBatch: (pairs: [Precompute, Fp, Fp][]) => Fp12; - pairing: (P: WeierstrassPoint, Q: WeierstrassPoint, withFinalExponent?: boolean) => Fp12; - pairingBatch: ( - pairs: { g1: WeierstrassPoint; g2: WeierstrassPoint }[], - withFinalExponent?: boolean - ) => Fp12; - randomSecretKey: (seed?: Uint8Array) => Uint8Array; -}; - -export type BlsPairingParams = { - // MSB is always ignored and used as marker for length, otherwise leading zeros will be lost. - // Can be different from `X` (seed) param. - ateLoopSize: bigint; - xNegative: boolean; - twistType: BlsTwistType; // BLS12-381: Multiplicative, BN254: Divisive - randomBytes?: (len?: number) => Uint8Array; - postPrecompute?: BlsPostPrecomputeFn; // Ugly hack to untwist point in BN254 after miller loop -}; -export type BlsHasherParams = { - mapToG1?: MapToCurve; - mapToG2?: MapToCurve; - hasherOpts: H2COpts; - hasherOptsG1: H2COpts; - hasherOptsG2: H2COpts; -}; -type PrecomputeSingle = [Fp2, Fp2, Fp2][]; -type Precompute = PrecomputeSingle[]; - -/** - * BLS consists of two curves: G1 and G2: - * - G1 is a subgroup of (x, y) E(Fq) over y² = x³ + 4. - * - G2 is a subgroup of ((x₁, x₂+i), (y₁, y₂+i)) E(Fq²) over y² = x³ + 4(1 + i) where i is √-1 - */ -export interface BlsCurvePair { - lengths: CurveLengths; - millerLoopBatch: BlsPairing['millerLoopBatch']; - pairing: BlsPairing['pairing']; - pairingBatch: BlsPairing['pairingBatch']; - G1: { Point: WeierstrassPointCons }; - G2: { Point: WeierstrassPointCons }; - fields: { - Fp: IField; - Fp2: Fp2Bls; - Fp6: Fp6Bls; - Fp12: Fp12Bls; - Fr: IField; - }; - utils: { - randomSecretKey: (seed?: Uint8Array) => Uint8Array; - calcPairingPrecomputes: BlsPairing['calcPairingPrecomputes']; - }; - params: { - ateLoopSize: bigint; - twistType: BlsTwistType; - }; -} - -export interface BlsCurvePairWithHashers extends BlsCurvePair { - G1: H2CHasher>; - G2: H2CHasher>; -} - -export interface BlsCurvePairWithSignatures extends BlsCurvePairWithHashers { - longSignatures: BlsSigs; - shortSignatures: BlsSigs; -} - -type BLSInput = Uint8Array; -export interface BlsSigs { - lengths: CurveLengths; - keygen(seed?: Uint8Array): { - secretKey: Uint8Array; - publicKey: WeierstrassPoint

; - }; - getPublicKey(secretKey: Uint8Array): WeierstrassPoint

; - sign(hashedMessage: WeierstrassPoint, secretKey: Uint8Array): WeierstrassPoint; - verify( - signature: WeierstrassPoint | BLSInput, - message: WeierstrassPoint, - publicKey: WeierstrassPoint

| BLSInput - ): boolean; - verifyBatch: ( - signature: WeierstrassPoint | BLSInput, - items: { message: WeierstrassPoint; publicKey: WeierstrassPoint

| BLSInput }[] - ) => boolean; - aggregatePublicKeys(publicKeys: (WeierstrassPoint

| BLSInput)[]): WeierstrassPoint

; - aggregateSignatures(signatures: (WeierstrassPoint | BLSInput)[]): WeierstrassPoint; - hash(message: Uint8Array, DST?: string | Uint8Array, hashOpts?: H2CHashOpts): WeierstrassPoint; - Signature: BlsLongSignatureCoder; -} - -// Not used with BLS12-381 (no sequential `11` in X). Useful for other curves. -function NAfDecomposition(a: bigint) { - const res = []; - // a>1 because of marker bit - for (; a > _1n; a >>= _1n) { - if ((a & _1n) === _0n) res.unshift(0); - else if ((a & _3n) === _3n) { - res.unshift(-1); - a += _1n; - } else res.unshift(1); - } - return res; -} - -function aNonEmpty(arr: any[]) { - if (!Array.isArray(arr) || arr.length === 0) throw new Error('expected non-empty array'); -} - -// This should be enough for bn254, no need to export full stuff? -function createBlsPairing( - fields: BlsFields, - G1: WeierstrassPointCons, - G2: WeierstrassPointCons, - params: BlsPairingParams -): BlsPairing { - const { Fr, Fp2, Fp12 } = fields; - const { twistType, ateLoopSize, xNegative, postPrecompute } = params; - type G1 = typeof G1.BASE; - type G2 = typeof G2.BASE; - // Applies sparse multiplication as line function - let lineFunction: (c0: Fp2, c1: Fp2, c2: Fp2, f: Fp12, Px: Fp, Py: Fp) => Fp12; - if (twistType === 'multiplicative') { - lineFunction = (c0: Fp2, c1: Fp2, c2: Fp2, f: Fp12, Px: Fp, Py: Fp) => - Fp12.mul014(f, c0, Fp2.mul(c1, Px), Fp2.mul(c2, Py)); - } else if (twistType === 'divisive') { - // NOTE: it should be [c0, c1, c2], but we use different order here to reduce complexity of - // precompute calculations. - lineFunction = (c0: Fp2, c1: Fp2, c2: Fp2, f: Fp12, Px: Fp, Py: Fp) => - Fp12.mul034(f, Fp2.mul(c2, Py), Fp2.mul(c1, Px), c0); - } else throw new Error('bls: unknown twist type'); - - const Fp2div2 = Fp2.div(Fp2.ONE, Fp2.mul(Fp2.ONE, _2n)); - function pointDouble(ell: PrecomputeSingle, Rx: Fp2, Ry: Fp2, Rz: Fp2) { - const t0 = Fp2.sqr(Ry); // Ry² - const t1 = Fp2.sqr(Rz); // Rz² - const t2 = Fp2.mulByB(Fp2.mul(t1, _3n)); // 3 * T1 * B - const t3 = Fp2.mul(t2, _3n); // 3 * T2 - const t4 = Fp2.sub(Fp2.sub(Fp2.sqr(Fp2.add(Ry, Rz)), t1), t0); // (Ry + Rz)² - T1 - T0 - const c0 = Fp2.sub(t2, t0); // T2 - T0 (i) - const c1 = Fp2.mul(Fp2.sqr(Rx), _3n); // 3 * Rx² - const c2 = Fp2.neg(t4); // -T4 (-h) - - ell.push([c0, c1, c2]); - - Rx = Fp2.mul(Fp2.mul(Fp2.mul(Fp2.sub(t0, t3), Rx), Ry), Fp2div2); // ((T0 - T3) * Rx * Ry) / 2 - Ry = Fp2.sub(Fp2.sqr(Fp2.mul(Fp2.add(t0, t3), Fp2div2)), Fp2.mul(Fp2.sqr(t2), _3n)); // ((T0 + T3) / 2)² - 3 * T2² - Rz = Fp2.mul(t0, t4); // T0 * T4 - return { Rx, Ry, Rz }; - } - function pointAdd(ell: PrecomputeSingle, Rx: Fp2, Ry: Fp2, Rz: Fp2, Qx: Fp2, Qy: Fp2) { - // Addition - const t0 = Fp2.sub(Ry, Fp2.mul(Qy, Rz)); // Ry - Qy * Rz - const t1 = Fp2.sub(Rx, Fp2.mul(Qx, Rz)); // Rx - Qx * Rz - const c0 = Fp2.sub(Fp2.mul(t0, Qx), Fp2.mul(t1, Qy)); // T0 * Qx - T1 * Qy == Ry * Qx - Rx * Qy - const c1 = Fp2.neg(t0); // -T0 == Qy * Rz - Ry - const c2 = t1; // == Rx - Qx * Rz - - ell.push([c0, c1, c2]); - - const t2 = Fp2.sqr(t1); // T1² - const t3 = Fp2.mul(t2, t1); // T2 * T1 - const t4 = Fp2.mul(t2, Rx); // T2 * Rx - const t5 = Fp2.add(Fp2.sub(t3, Fp2.mul(t4, _2n)), Fp2.mul(Fp2.sqr(t0), Rz)); // T3 - 2 * T4 + T0² * Rz - Rx = Fp2.mul(t1, t5); // T1 * T5 - Ry = Fp2.sub(Fp2.mul(Fp2.sub(t4, t5), t0), Fp2.mul(t3, Ry)); // (T4 - T5) * T0 - T3 * Ry - Rz = Fp2.mul(Rz, t3); // Rz * T3 - return { Rx, Ry, Rz }; - } - - // Pre-compute coefficients for sparse multiplication - // Point addition and point double calculations is reused for coefficients - // pointAdd happens only if bit set, so wNAF is reasonable. Unfortunately we cannot combine - // add + double in windowed precomputes here, otherwise it would be single op (since X is static) - const ATE_NAF = NAfDecomposition(ateLoopSize); - - const calcPairingPrecomputes = memoized((point: G2) => { - const p = point; - const { x, y } = p.toAffine(); - // prettier-ignore - const Qx = x, Qy = y, negQy = Fp2.neg(y); - // prettier-ignore - let Rx = Qx, Ry = Qy, Rz = Fp2.ONE; - const ell: Precompute = []; - for (const bit of ATE_NAF) { - const cur: PrecomputeSingle = []; - ({ Rx, Ry, Rz } = pointDouble(cur, Rx, Ry, Rz)); - if (bit) ({ Rx, Ry, Rz } = pointAdd(cur, Rx, Ry, Rz, Qx, bit === -1 ? negQy : Qy)); - ell.push(cur); - } - if (postPrecompute) { - const last = ell[ell.length - 1]; - postPrecompute(Rx, Ry, Rz, Qx, Qy, pointAdd.bind(null, last)); - } - return ell; - }); - - // Main pairing logic is here. Computes product of miller loops + final exponentiate - // Applies calculated precomputes - type MillerInput = [Precompute, Fp, Fp][]; - function millerLoopBatch(pairs: MillerInput, withFinalExponent: boolean = false) { - let f12 = Fp12.ONE; - if (pairs.length) { - const ellLen = pairs[0][0].length; - for (let i = 0; i < ellLen; i++) { - f12 = Fp12.sqr(f12); // This allows us to do sqr only one time for all pairings - // NOTE: we apply multiple pairings in parallel here - for (const [ell, Px, Py] of pairs) { - for (const [c0, c1, c2] of ell[i]) f12 = lineFunction(c0, c1, c2, f12, Px, Py); - } - } - } - if (xNegative) f12 = Fp12.conjugate(f12); - return withFinalExponent ? Fp12.finalExponentiate(f12) : f12; - } - type PairingInput = { g1: G1; g2: G2 }; - // Calculates product of multiple pairings - // This up to x2 faster than just `map(({g1, g2})=>pairing({g1,g2}))` - function pairingBatch(pairs: PairingInput[], withFinalExponent: boolean = true) { - const res: MillerInput = []; - // Cache precomputed toAffine for all points - normalizeZ( - G1, - pairs.map(({ g1 }) => g1) - ); - normalizeZ( - G2, - pairs.map(({ g2 }) => g2) - ); - for (const { g1, g2 } of pairs) { - if (g1.is0() || g2.is0()) throw new Error('pairing is not available for ZERO point'); - // This uses toAffine inside - g1.assertValidity(); - g2.assertValidity(); - const Qa = g1.toAffine(); - res.push([calcPairingPrecomputes(g2), Qa.x, Qa.y]); - } - return millerLoopBatch(res, withFinalExponent); - } - // Calculates bilinear pairing - function pairing(Q: G1, P: G2, withFinalExponent: boolean = true): Fp12 { - return pairingBatch([{ g1: Q, g2: P }], withFinalExponent); - } - const lengths = { - seed: getMinHashLength(Fr.ORDER), - }; - const rand = params.randomBytes || randomBytes; - const randomSecretKey = (seed = rand(lengths.seed)): Uint8Array => { - abytes(seed, lengths.seed, 'seed'); - return mapHashToField(seed, Fr.ORDER); - }; - return { - lengths, - Fr, - Fp12, // NOTE: we re-export Fp12 here because pairing results are Fp12! - millerLoopBatch, - pairing, - pairingBatch, - calcPairingPrecomputes, - randomSecretKey, - }; -} - -function createBlsSig( - blsPairing: BlsPairing, - PubPoint: WeierstrassPointCons

, - SigPoint: WeierstrassPointCons, - isSigG1: boolean, - hashToSigCurve: (msg: Uint8Array, options?: H2CDSTOpts) => WeierstrassPoint, - SignatureCoder?: BlsLongSignatureCoder -): BlsSigs { - const { Fr, Fp12, pairingBatch, randomSecretKey, lengths } = blsPairing; - if (!SignatureCoder) { - SignatureCoder = { - fromBytes: notImplemented, - fromHex: notImplemented, - toBytes: notImplemented, - toHex: notImplemented, - }; - } - type PubPoint = WeierstrassPoint

; - type SigPoint = WeierstrassPoint; - function normPub(point: PubPoint | BLSInput): PubPoint { - return point instanceof PubPoint ? (point as PubPoint) : PubPoint.fromBytes(point); - } - function normSig(point: SigPoint | BLSInput): SigPoint { - return point instanceof SigPoint ? (point as SigPoint) : SigPoint.fromBytes(point); - } - function amsg(m: unknown): SigPoint { - if (!(m instanceof SigPoint)) - throw new Error(`expected valid message hashed to ${!isSigG1 ? 'G2' : 'G1'} curve`); - return m as SigPoint; - } - - type G1 = WeierstrassPoint; - type G2 = WeierstrassPoint; - type PairingInput = { g1: G1; g2: G2 }; - // What matters here is what point pairing API accepts as G1 or G2, not actual size or names - const pair: (a: PubPoint, b: SigPoint) => PairingInput = !isSigG1 - ? (a: PubPoint, b: SigPoint) => ({ g1: a, g2: b }) as PairingInput - : (a: PubPoint, b: SigPoint) => ({ g1: b, g2: a }) as PairingInput; - return Object.freeze({ - lengths: { ...lengths, secretKey: Fr.BYTES }, - keygen(seed?: Uint8Array) { - const secretKey = randomSecretKey(seed); - const publicKey = this.getPublicKey(secretKey); - return { secretKey, publicKey }; - }, - // P = pk x G - getPublicKey(secretKey: Uint8Array): PubPoint { - let sec; - try { - sec = PubPoint.Fn.fromBytes(secretKey); - } catch (error) { - // @ts-ignore - throw new Error('invalid private key: ' + typeof secretKey, { cause: error }); - } - return PubPoint.BASE.multiply(sec); - }, - // S = pk x H(m) - sign(message: SigPoint, secretKey: Uint8Array, unusedArg?: any): SigPoint { - if (unusedArg != null) throw new Error('sign() expects 2 arguments'); - const sec = PubPoint.Fn.fromBytes(secretKey); - amsg(message).assertValidity(); - return message.multiply(sec); - }, - // Checks if pairing of public key & hash is equal to pairing of generator & signature. - // e(P, H(m)) == e(G, S) - // e(S, G) == e(H(m), P) - verify( - signature: SigPoint | BLSInput, - message: SigPoint, - publicKey: PubPoint | BLSInput, - unusedArg?: any - ): boolean { - if (unusedArg != null) throw new Error('verify() expects 3 arguments'); - signature = normSig(signature); - publicKey = normPub(publicKey); - const P = publicKey.negate(); - const G = PubPoint.BASE; - const Hm = amsg(message); - const S = signature; - // This code was changed in 1.9.x: - // Before it was G.negate() in G2, now it's always pubKey.negate - // e(P, -Q)===e(-P, Q)==e(P, Q)^-1. Negate can be done anywhere (as long it is done once per pair). - // We just moving sign, but since pairing is multiplicative, we doing X * X^-1 = 1 - try { - const exp = pairingBatch([pair(P, Hm), pair(G, S)]); - return Fp12.eql(exp, Fp12.ONE); - } catch { - return false; - } - }, - // https://ethresear.ch/t/fast-verification-of-multiple-bls-signatures/5407 - // e(G, S) = e(G, SUM(n)(Si)) = MUL(n)(e(G, Si)) - // TODO: maybe `{message: G2Hex, publicKey: G1Hex}[]` instead? - verifyBatch( - signature: SigPoint | BLSInput, - items: { message: SigPoint; publicKey: PubPoint | BLSInput }[] - ): boolean { - aNonEmpty(items); - const sig = normSig(signature); - const nMessages = items.map((i) => i.message); - const nPublicKeys = items.map((i) => normPub(i.publicKey)); - // NOTE: this works only for exact same object - const messagePubKeyMap = new Map(); - for (let i = 0; i < nPublicKeys.length; i++) { - const pub = nPublicKeys[i]; - const msg = nMessages[i]; - let keys = messagePubKeyMap.get(msg); - if (keys === undefined) { - keys = []; - messagePubKeyMap.set(msg, keys); - } - keys.push(pub); - } - const paired = []; - const G = PubPoint.BASE; - try { - for (const [msg, keys] of messagePubKeyMap) { - const groupPublicKey = keys.reduce((acc, msg) => acc.add(msg)); - paired.push(pair(groupPublicKey, msg)); - } - paired.push(pair(G.negate(), sig)); - return Fp12.eql(pairingBatch(paired), Fp12.ONE); - } catch { - return false; - } - }, - // Adds a bunch of public key points together. - // pk1 + pk2 + pk3 = pkA - aggregatePublicKeys(publicKeys: (PubPoint | BLSInput)[]): PubPoint { - aNonEmpty(publicKeys); - publicKeys = publicKeys.map((pub) => normPub(pub)); - const agg = (publicKeys as PubPoint[]).reduce((sum, p) => sum.add(p), PubPoint.ZERO); - agg.assertValidity(); - return agg; - }, - - // Adds a bunch of signature points together. - // pk1 + pk2 + pk3 = pkA - aggregateSignatures(signatures: (SigPoint | BLSInput)[]): SigPoint { - aNonEmpty(signatures); - signatures = signatures.map((sig) => normSig(sig)); - const agg = (signatures as SigPoint[]).reduce((sum, s) => sum.add(s), SigPoint.ZERO); - agg.assertValidity(); - return agg; - }, - - hash(messageBytes: Uint8Array, DST?: string | Uint8Array): SigPoint { - abytes(messageBytes); - const opts = DST ? { DST } : undefined; - return hashToSigCurve(messageBytes, opts); - }, - Signature: SignatureCoder, - }) /*satisfies Signer */; -} - -type BlsSignatureCoders = Partial<{ - LongSignature: BlsLongSignatureCoder; - ShortSignature: BlsShortSignatureCoder; -}>; - -// NOTE: separate function instead of function override, so we don't depend on hasher in bn254. -export function blsBasic( - fields: BlsFields, - G1_Point: WeierstrassPointCons, - G2_Point: WeierstrassPointCons, - params: BlsPairingParams -): BlsCurvePair { - // Fields are specific for curve, so for now we'll need to pass them with opts - const { Fp, Fr, Fp2, Fp6, Fp12 } = fields; - // Point on G1 curve: (x, y) - // const G1_Point = weierstrass(CURVE.G1, { Fn: Fr }); - const G1 = { Point: G1_Point }; - // Point on G2 curve (complex numbers): (x₁, x₂+i), (y₁, y₂+i) - const G2 = { Point: G2_Point }; - - const pairingRes = createBlsPairing(fields, G1_Point, G2_Point, params); - const { - millerLoopBatch, - pairing, - pairingBatch, - calcPairingPrecomputes, - randomSecretKey, - lengths, - } = pairingRes; - - G1.Point.BASE.precompute(4); - return Object.freeze({ - lengths, - millerLoopBatch, - pairing, - pairingBatch, - G1, - G2, - fields: { Fr, Fp, Fp2, Fp6, Fp12 }, - params: { - ateLoopSize: params.ateLoopSize, - twistType: params.twistType, - }, - utils: { - randomSecretKey, - calcPairingPrecomputes, - }, - }); -} - -// We can export this too, but seems there is not much reasons for now? If user wants hasher, they can just create hasher. -function blsHashers( - fields: BlsFields, - G1_Point: WeierstrassPointCons, - G2_Point: WeierstrassPointCons, - params: BlsPairingParams, - hasherParams: BlsHasherParams -): BlsCurvePairWithHashers { - const base = blsBasic(fields, G1_Point, G2_Point, params); - const G1Hasher = createHasher(G1_Point, hasherParams.mapToG1 || notImplemented, { - ...hasherParams.hasherOpts, - ...hasherParams.hasherOptsG1, - }); - const G2Hasher = createHasher(G2_Point, hasherParams.mapToG2 || notImplemented, { - ...hasherParams.hasherOpts, - ...hasherParams.hasherOptsG2, - }); - return Object.freeze({ ...base, G1: G1Hasher, G2: G2Hasher }); -} - -// G1_Point: ProjConstructor, G2_Point: ProjConstructor, -// Rename to blsSignatures? -export function bls( - fields: BlsFields, - G1_Point: WeierstrassPointCons, - G2_Point: WeierstrassPointCons, - params: BlsPairingParams, - hasherParams: BlsHasherParams, - signatureCoders: BlsSignatureCoders -): BlsCurvePairWithSignatures { - const base = blsHashers(fields, G1_Point, G2_Point, params, hasherParams); - const pairingRes: BlsPairing = { - ...base, - Fr: base.fields.Fr, - Fp12: base.fields.Fp12, - calcPairingPrecomputes: base.utils.calcPairingPrecomputes, - randomSecretKey: base.utils.randomSecretKey, - }; - const longSignatures = createBlsSig( - pairingRes, - G1_Point, - G2_Point, - false, - base.G2.hashToCurve, - signatureCoders?.LongSignature - ); - const shortSignatures = createBlsSig( - pairingRes, - G2_Point, - G1_Point, - true, - base.G1.hashToCurve, - signatureCoders?.ShortSignature - ); - return Object.freeze({ ...base, longSignatures, shortSignatures }); -} diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/curve.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/curve.ts deleted file mode 100644 index ca82dd96..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/curve.ts +++ /dev/null @@ -1,633 +0,0 @@ -/** - * Methods for elliptic curve multiplication by scalars. - * Contains wNAF, pippenger. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { bitLen, bitMask, type Signer } from '../utils.ts'; -import { Field, FpInvertBatch, validateField, type IField } from './modular.ts'; - -const _0n = /* @__PURE__ */ BigInt(0); -const _1n = /* @__PURE__ */ BigInt(1); - -export type AffinePoint = { - x: T; - y: T; -} & { Z?: never }; - -// We can't "abstract out" coordinates (X, Y, Z; and T in Edwards): argument names of constructor -// are not accessible. See Typescript gh-56093, gh-41594. -// -// We have to use recursive types, so it will return actual point, not constained `CurvePoint`. -// If, at any point, P is `any`, it will erase all types and replace it -// with `any`, because of recursion, `any implements CurvePoint`, -// but we lose all constrains on methods. - -/** Base interface for all elliptic curve Points. */ -export interface CurvePoint> { - /** Affine x coordinate. Different from projective / extended X coordinate. */ - x: F; - /** Affine y coordinate. Different from projective / extended Y coordinate. */ - y: F; - Z?: F; - double(): P; - negate(): P; - add(other: P): P; - subtract(other: P): P; - equals(other: P): boolean; - multiply(scalar: bigint): P; - assertValidity(): void; - clearCofactor(): P; - is0(): boolean; - isTorsionFree(): boolean; - isSmallOrder(): boolean; - multiplyUnsafe(scalar: bigint): P; - /** - * Massively speeds up `p.multiply(n)` by using precompute tables (caching). See {@link wNAF}. - * @param isLazy calculate cache now. Default (true) ensures it's deferred to first `multiply()` - */ - precompute(windowSize?: number, isLazy?: boolean): P; - /** Converts point to 2D xy affine coordinates */ - toAffine(invertedZ?: F): AffinePoint; - toBytes(): Uint8Array; - toHex(): string; -} - -/** Base interface for all elliptic curve Point constructors. */ -export interface CurvePointCons

> { - [Symbol.hasInstance]: (item: unknown) => boolean; - BASE: P; - ZERO: P; - /** Field for basic curve math */ - Fp: IField>; - /** Scalar field, for scalars in multiply and others */ - Fn: IField; - /** Creates point from x, y. Does NOT validate if the point is valid. Use `.assertValidity()`. */ - fromAffine(p: AffinePoint>): P; - fromBytes(bytes: Uint8Array): P; - fromHex(hex: string): P; -} - -// Type inference helpers: PC - PointConstructor, P - Point, Fp - Field element -// Short names, because we use them a lot in result types: -// * we can't do 'P = GetCurvePoint': this is default value and doesn't constrain anything -// * we can't do 'type X = GetCurvePoint': it won't be accesible for arguments/return types -// * `CurvePointCons

>` constraints from interface definition -// won't propagate, if `PC extends CurvePointCons`: the P would be 'any', which is incorrect -// * PC could be super specific with super specific P, which implements CurvePoint. -// this means we need to do stuff like -// `function test

, PC extends CurvePointCons

>(` -// if we want type safety around P, otherwise PC_P will be any - -/** Returns Fp type from Point (P_F

== P.F) */ -export type P_F

> = P extends CurvePoint ? F : never; -/** Returns Fp type from PointCons (PC_F == PC.P.F) */ -export type PC_F>> = PC['Fp']['ZERO']; -/** Returns Point type from PointCons (PC_P == PC.P) */ -export type PC_P>> = PC['ZERO']; - -// Ugly hack to get proper type inference, because in typescript fails to infer resursively. -// The hack allows to do up to 10 chained operations without applying type erasure. -// -// Types which won't work: -// * `CurvePointCons>`, will return `any` after 1 operation -// * `CurvePointCons: WeierstrassPointCons extends CurvePointCons = false` -// * `P extends CurvePoint, PC extends CurvePointCons

` -// * It can't infer P from PC alone -// * Too many relations between F, P & PC -// * It will infer P/F if `arg: CurvePointCons`, but will fail if PC is generic -// * It will work correctly if there is an additional argument of type P -// * But generally, we don't want to parametrize `CurvePointCons` over `F`: it will complicate -// types, making them un-inferable -// prettier-ignore -export type PC_ANY = CurvePointCons< - CurvePoint - >>>>>>>>> ->; - -export interface CurveLengths { - secretKey?: number; - publicKey?: number; - publicKeyUncompressed?: number; - publicKeyHasPrefix?: boolean; - signature?: number; - seed?: number; -} - -export type Mapper = (i: T[]) => T[]; - -export function negateCt T }>(condition: boolean, item: T): T { - const neg = item.negate(); - return condition ? neg : item; -} - -/** - * Takes a bunch of Projective Points but executes only one - * inversion on all of them. Inversion is very slow operation, - * so this improves performance massively. - * Optimization: converts a list of projective points to a list of identical points with Z=1. - */ -export function normalizeZ

, PC extends CurvePointCons

>( - c: PC, - points: P[] -): P[] { - const invertedZs = FpInvertBatch( - c.Fp, - points.map((p) => p.Z!) - ); - return points.map((p, i) => c.fromAffine(p.toAffine(invertedZs[i]))); -} - -function validateW(W: number, bits: number) { - if (!Number.isSafeInteger(W) || W <= 0 || W > bits) - throw new Error('invalid window size, expected [1..' + bits + '], got W=' + W); -} - -/** Internal wNAF opts for specific W and scalarBits */ -type WOpts = { - windows: number; - windowSize: number; - mask: bigint; - maxNumber: number; - shiftBy: bigint; -}; - -function calcWOpts(W: number, scalarBits: number): WOpts { - validateW(W, scalarBits); - const windows = Math.ceil(scalarBits / W) + 1; // W=8 33. Not 32, because we skip zero - const windowSize = 2 ** (W - 1); // W=8 128. Not 256, because we skip zero - const maxNumber = 2 ** W; // W=8 256 - const mask = bitMask(W); // W=8 255 == mask 0b11111111 - const shiftBy = BigInt(W); // W=8 8 - return { windows, windowSize, mask, maxNumber, shiftBy }; -} - -function calcOffsets(n: bigint, window: number, wOpts: WOpts) { - const { windowSize, mask, maxNumber, shiftBy } = wOpts; - let wbits = Number(n & mask); // extract W bits. - let nextN = n >> shiftBy; // shift number by W bits. - - // What actually happens here: - // const highestBit = Number(mask ^ (mask >> 1n)); - // let wbits2 = wbits - 1; // skip zero - // if (wbits2 & highestBit) { wbits2 ^= Number(mask); // (~); - - // split if bits > max: +224 => 256-32 - if (wbits > windowSize) { - // we skip zero, which means instead of `>= size-1`, we do `> size` - wbits -= maxNumber; // -32, can be maxNumber - wbits, but then we need to set isNeg here. - nextN += _1n; // +256 (carry) - } - const offsetStart = window * windowSize; - const offset = offsetStart + Math.abs(wbits) - 1; // -1 because we skip zero - const isZero = wbits === 0; // is current window slice a 0? - const isNeg = wbits < 0; // is current window slice negative? - const isNegF = window % 2 !== 0; // fake random statement for noise - const offsetF = offsetStart; // fake offset for noise - return { nextN, offset, isZero, isNeg, isNegF, offsetF }; -} - -function validateMSMPoints(points: any[], c: any) { - if (!Array.isArray(points)) throw new Error('array expected'); - points.forEach((p, i) => { - if (!(p instanceof c)) throw new Error('invalid point at index ' + i); - }); -} -function validateMSMScalars(scalars: any[], field: any) { - if (!Array.isArray(scalars)) throw new Error('array of scalars expected'); - scalars.forEach((s, i) => { - if (!field.isValid(s)) throw new Error('invalid scalar at index ' + i); - }); -} - -// Since points in different groups cannot be equal (different object constructor), -// we can have single place to store precomputes. -// Allows to make points frozen / immutable. -const pointPrecomputes = new WeakMap(); -const pointWindowSizes = new WeakMap(); - -function getW(P: any): number { - // To disable precomputes: - // return 1; - return pointWindowSizes.get(P) || 1; -} - -function assert0(n: bigint): void { - if (n !== _0n) throw new Error('invalid wNAF'); -} - -/** - * Elliptic curve multiplication of Point by scalar. Fragile. - * Table generation takes **30MB of ram and 10ms on high-end CPU**, - * but may take much longer on slow devices. Actual generation will happen on - * first call of `multiply()`. By default, `BASE` point is precomputed. - * - * Scalars should always be less than curve order: this should be checked inside of a curve itself. - * Creates precomputation tables for fast multiplication: - * - private scalar is split by fixed size windows of W bits - * - every window point is collected from window's table & added to accumulator - * - since windows are different, same point inside tables won't be accessed more than once per calc - * - each multiplication is 'Math.ceil(CURVE_ORDER / 𝑊) + 1' point additions (fixed for any scalar) - * - +1 window is neccessary for wNAF - * - wNAF reduces table size: 2x less memory + 2x faster generation, but 10% slower multiplication - * - * @todo Research returning 2d JS array of windows, instead of a single window. - * This would allow windows to be in different memory locations - */ -export class wNAF { - private readonly BASE: PC_P; - private readonly ZERO: PC_P; - private readonly Fn: PC['Fn']; - readonly bits: number; - - // Parametrized with a given Point class (not individual point) - constructor(Point: PC, bits: number) { - this.BASE = Point.BASE; - this.ZERO = Point.ZERO; - this.Fn = Point.Fn; - this.bits = bits; - } - - // non-const time multiplication ladder - _unsafeLadder(elm: PC_P, n: bigint, p: PC_P = this.ZERO): PC_P { - let d: PC_P = elm; - while (n > _0n) { - if (n & _1n) p = p.add(d); - d = d.double(); - n >>= _1n; - } - return p; - } - - /** - * Creates a wNAF precomputation window. Used for caching. - * Default window size is set by `utils.precompute()` and is equal to 8. - * Number of precomputed points depends on the curve size: - * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where: - * - 𝑊 is the window size - * - 𝑛 is the bitlength of the curve order. - * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224. - * @param point Point instance - * @param W window size - * @returns precomputed point tables flattened to a single array - */ - private precomputeWindow(point: PC_P, W: number): PC_P[] { - const { windows, windowSize } = calcWOpts(W, this.bits); - const points: PC_P[] = []; - let p: PC_P = point; - let base = p; - for (let window = 0; window < windows; window++) { - base = p; - points.push(base); - // i=1, bc we skip 0 - for (let i = 1; i < windowSize; i++) { - base = base.add(p); - points.push(base); - } - p = base.double(); - } - return points; - } - - /** - * Implements ec multiplication using precomputed tables and w-ary non-adjacent form. - * More compact implementation: - * https://github.com/paulmillr/noble-secp256k1/blob/47cb1669b6e506ad66b35fe7d76132ae97465da2/index.ts#L502-L541 - * @returns real and fake (for const-time) points - */ - private wNAF(W: number, precomputes: PC_P[], n: bigint): { p: PC_P; f: PC_P } { - // Scalar should be smaller than field order - if (!this.Fn.isValid(n)) throw new Error('invalid scalar'); - // Accumulators - let p = this.ZERO; - let f = this.BASE; - // This code was first written with assumption that 'f' and 'p' will never be infinity point: - // since each addition is multiplied by 2 ** W, it cannot cancel each other. However, - // there is negate now: it is possible that negated element from low value - // would be the same as high element, which will create carry into next window. - // It's not obvious how this can fail, but still worth investigating later. - const wo = calcWOpts(W, this.bits); - for (let window = 0; window < wo.windows; window++) { - // (n === _0n) is handled and not early-exited. isEven and offsetF are used for noise - const { nextN, offset, isZero, isNeg, isNegF, offsetF } = calcOffsets(n, window, wo); - n = nextN; - if (isZero) { - // bits are 0: add garbage to fake point - // Important part for const-time getPublicKey: add random "noise" point to f. - f = f.add(negateCt(isNegF, precomputes[offsetF])); - } else { - // bits are 1: add to result point - p = p.add(negateCt(isNeg, precomputes[offset])); - } - } - assert0(n); - // Return both real and fake points: JIT won't eliminate f. - // At this point there is a way to F be infinity-point even if p is not, - // which makes it less const-time: around 1 bigint multiply. - return { p, f }; - } - - /** - * Implements ec unsafe (non const-time) multiplication using precomputed tables and w-ary non-adjacent form. - * @param acc accumulator point to add result of multiplication - * @returns point - */ - private wNAFUnsafe( - W: number, - precomputes: PC_P[], - n: bigint, - acc: PC_P = this.ZERO - ): PC_P { - const wo = calcWOpts(W, this.bits); - for (let window = 0; window < wo.windows; window++) { - if (n === _0n) break; // Early-exit, skip 0 value - const { nextN, offset, isZero, isNeg } = calcOffsets(n, window, wo); - n = nextN; - if (isZero) { - // Window bits are 0: skip processing. - // Move to next window. - continue; - } else { - const item = precomputes[offset]; - acc = acc.add(isNeg ? item.negate() : item); // Re-using acc allows to save adds in MSM - } - } - assert0(n); - return acc; - } - - private getPrecomputes(W: number, point: PC_P, transform?: Mapper>): PC_P[] { - // Calculate precomputes on a first run, reuse them after - let comp = pointPrecomputes.get(point); - if (!comp) { - comp = this.precomputeWindow(point, W) as PC_P[]; - if (W !== 1) { - // Doing transform outside of if brings 15% perf hit - if (typeof transform === 'function') comp = transform(comp); - pointPrecomputes.set(point, comp); - } - } - return comp; - } - - cached( - point: PC_P, - scalar: bigint, - transform?: Mapper> - ): { p: PC_P; f: PC_P } { - const W = getW(point); - return this.wNAF(W, this.getPrecomputes(W, point, transform), scalar); - } - - unsafe(point: PC_P, scalar: bigint, transform?: Mapper>, prev?: PC_P): PC_P { - const W = getW(point); - if (W === 1) return this._unsafeLadder(point, scalar, prev); // For W=1 ladder is ~x2 faster - return this.wNAFUnsafe(W, this.getPrecomputes(W, point, transform), scalar, prev); - } - - // We calculate precomputes for elliptic curve point multiplication - // using windowed method. This specifies window size and - // stores precomputed values. Usually only base point would be precomputed. - createCache(P: PC_P, W: number): void { - validateW(W, this.bits); - pointWindowSizes.set(P, W); - pointPrecomputes.delete(P); - } - - hasCache(elm: PC_P): boolean { - return getW(elm) !== 1; - } -} - -/** - * Endomorphism-specific multiplication for Koblitz curves. - * Cost: 128 dbl, 0-256 adds. - */ -export function mulEndoUnsafe

, PC extends CurvePointCons

>( - Point: PC, - point: P, - k1: bigint, - k2: bigint -): { p1: P; p2: P } { - let acc = point; - let p1 = Point.ZERO; - let p2 = Point.ZERO; - while (k1 > _0n || k2 > _0n) { - if (k1 & _1n) p1 = p1.add(acc); - if (k2 & _1n) p2 = p2.add(acc); - acc = acc.double(); - k1 >>= _1n; - k2 >>= _1n; - } - return { p1, p2 }; -} - -/** - * Pippenger algorithm for multi-scalar multiplication (MSM, Pa + Qb + Rc + ...). - * 30x faster vs naive addition on L=4096, 10x faster than precomputes. - * For N=254bit, L=1, it does: 1024 ADD + 254 DBL. For L=5: 1536 ADD + 254 DBL. - * Algorithmically constant-time (for same L), even when 1 point + scalar, or when scalar = 0. - * @param c Curve Point constructor - * @param fieldN field over CURVE.N - important that it's not over CURVE.P - * @param points array of L curve points - * @param scalars array of L scalars (aka secret keys / bigints) - */ -export function pippenger

, PC extends CurvePointCons

>( - c: PC, - points: P[], - scalars: bigint[] -): P { - // If we split scalars by some window (let's say 8 bits), every chunk will only - // take 256 buckets even if there are 4096 scalars, also re-uses double. - // TODO: - // - https://eprint.iacr.org/2024/750.pdf - // - https://tches.iacr.org/index.php/TCHES/article/view/10287 - // 0 is accepted in scalars - const fieldN = c.Fn; - validateMSMPoints(points, c); - validateMSMScalars(scalars, fieldN); - const plength = points.length; - const slength = scalars.length; - if (plength !== slength) throw new Error('arrays of points and scalars must have equal length'); - // if (plength === 0) throw new Error('array must be of length >= 2'); - const zero = c.ZERO; - const wbits = bitLen(BigInt(plength)); - let windowSize = 1; // bits - if (wbits > 12) windowSize = wbits - 3; - else if (wbits > 4) windowSize = wbits - 2; - else if (wbits > 0) windowSize = 2; - const MASK = bitMask(windowSize); - const buckets = new Array(Number(MASK) + 1).fill(zero); // +1 for zero array - const lastBits = Math.floor((fieldN.BITS - 1) / windowSize) * windowSize; - let sum = zero; - for (let i = lastBits; i >= 0; i -= windowSize) { - buckets.fill(zero); - for (let j = 0; j < slength; j++) { - const scalar = scalars[j]; - const wbits = Number((scalar >> BigInt(i)) & MASK); - buckets[wbits] = buckets[wbits].add(points[j]); - } - let resI = zero; // not using this will do small speed-up, but will lose ct - // Skip first bucket, because it is zero - for (let j = buckets.length - 1, sumI = zero; j > 0; j--) { - sumI = sumI.add(buckets[j]); - resI = resI.add(sumI); - } - sum = sum.add(resI); - if (i !== 0) for (let j = 0; j < windowSize; j++) sum = sum.double(); - } - return sum as P; -} -/** - * Precomputed multi-scalar multiplication (MSM, Pa + Qb + Rc + ...). - * @param c Curve Point constructor - * @param fieldN field over CURVE.N - important that it's not over CURVE.P - * @param points array of L curve points - * @returns function which multiplies points with scaars - */ -export function precomputeMSMUnsafe

, PC extends CurvePointCons

>( - c: PC, - points: P[], - windowSize: number -): (scalars: bigint[]) => P { - /** - * Performance Analysis of Window-based Precomputation - * - * Base Case (256-bit scalar, 8-bit window): - * - Standard precomputation requires: - * - 31 additions per scalar × 256 scalars = 7,936 ops - * - Plus 255 summary additions = 8,191 total ops - * Note: Summary additions can be optimized via accumulator - * - * Chunked Precomputation Analysis: - * - Using 32 chunks requires: - * - 255 additions per chunk - * - 256 doublings - * - Total: (255 × 32) + 256 = 8,416 ops - * - * Memory Usage Comparison: - * Window Size | Standard Points | Chunked Points - * ------------|-----------------|--------------- - * 4-bit | 520 | 15 - * 8-bit | 4,224 | 255 - * 10-bit | 13,824 | 1,023 - * 16-bit | 557,056 | 65,535 - * - * Key Advantages: - * 1. Enables larger window sizes due to reduced memory overhead - * 2. More efficient for smaller scalar counts: - * - 16 chunks: (16 × 255) + 256 = 4,336 ops - * - ~2x faster than standard 8,191 ops - * - * Limitations: - * - Not suitable for plain precomputes (requires 256 constant doublings) - * - Performance degrades with larger scalar counts: - * - Optimal for ~256 scalars - * - Less efficient for 4096+ scalars (Pippenger preferred) - */ - const fieldN = c.Fn; - validateW(windowSize, fieldN.BITS); - validateMSMPoints(points, c); - const zero = c.ZERO; - const tableSize = 2 ** windowSize - 1; // table size (without zero) - const chunks = Math.ceil(fieldN.BITS / windowSize); // chunks of item - const MASK = bitMask(windowSize); - const tables = points.map((p: P) => { - const res = []; - for (let i = 0, acc = p; i < tableSize; i++) { - res.push(acc); - acc = acc.add(p); - } - return res; - }); - return (scalars: bigint[]): P => { - validateMSMScalars(scalars, fieldN); - if (scalars.length > points.length) - throw new Error('array of scalars must be smaller than array of points'); - let res = zero; - for (let i = 0; i < chunks; i++) { - // No need to double if accumulator is still zero. - if (res !== zero) for (let j = 0; j < windowSize; j++) res = res.double(); - const shiftBy = BigInt(chunks * windowSize - (i + 1) * windowSize); - for (let j = 0; j < scalars.length; j++) { - const n = scalars[j]; - const curr = Number((n >> shiftBy) & MASK); - if (!curr) continue; // skip zero scalars chunks - res = res.add(tables[j][curr - 1]); - } - } - return res; - }; -} - -export type ValidCurveParams = { - p: bigint; - n: bigint; - h: bigint; - a: T; - b?: T; - d?: T; - Gx: T; - Gy: T; -}; - -function createField(order: bigint, field?: IField, isLE?: boolean): IField { - if (field) { - if (field.ORDER !== order) throw new Error('Field.ORDER must match order: Fp == p, Fn == n'); - validateField(field); - return field; - } else { - return Field(order, { isLE }) as unknown as IField; - } -} -export type FpFn = { Fp: IField; Fn: IField }; - -/** Validates CURVE opts and creates fields */ -export function createCurveFields( - type: 'weierstrass' | 'edwards', - CURVE: ValidCurveParams, - curveOpts: Partial> = {}, - FpFnLE?: boolean -): FpFn & { CURVE: ValidCurveParams } { - if (FpFnLE === undefined) FpFnLE = type === 'edwards'; - if (!CURVE || typeof CURVE !== 'object') throw new Error(`expected valid ${type} CURVE object`); - for (const p of ['p', 'n', 'h'] as const) { - const val = CURVE[p]; - if (!(typeof val === 'bigint' && val > _0n)) - throw new Error(`CURVE.${p} must be positive bigint`); - } - const Fp = createField(CURVE.p, curveOpts.Fp, FpFnLE); - const Fn = createField(CURVE.n, curveOpts.Fn, FpFnLE); - const _b: 'b' | 'd' = type === 'weierstrass' ? 'b' : 'd'; - const params = ['Gx', 'Gy', 'a', _b] as const; - for (const p of params) { - // @ts-ignore - if (!Fp.isValid(CURVE[p])) - throw new Error(`CURVE.${p} must be valid field element of CURVE.Fp`); - } - CURVE = Object.freeze(Object.assign({}, CURVE)); - return { CURVE, Fp, Fn }; -} - -type KeygenFn = ( - seed?: Uint8Array, - isCompressed?: boolean -) => { secretKey: Uint8Array; publicKey: Uint8Array }; -export function createKeygen( - randomSecretKey: Function, - getPublicKey: Signer['getPublicKey'] -): KeygenFn { - return function keygen(seed?: Uint8Array) { - const secretKey = randomSecretKey(seed); - return { secretKey, publicKey: getPublicKey(secretKey) }; - }; -} diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/edwards.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/edwards.ts deleted file mode 100644 index 5aefa5dc..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/edwards.ts +++ /dev/null @@ -1,789 +0,0 @@ -/** - * Twisted Edwards curve. The formula is: ax² + y² = 1 + dx²y². - * For design rationale of types / exports, see weierstrass module documentation. - * Untwisted Edwards curves exist, but they aren't used in real-world protocols. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { - abool, - abytes, - aInRange, - bytesToHex, - bytesToNumberLE, - concatBytes, - copyBytes, - hexToBytes, - isBytes, - memoized, - notImplemented, - validateObject, - randomBytes as wcRandomBytes, - type FHash, - type Signer, -} from '../utils.ts'; -import { - createCurveFields, - createKeygen, - normalizeZ, - wNAF, - type AffinePoint, - type CurveLengths, - type CurvePoint, - type CurvePointCons, -} from './curve.ts'; -import { type IField } from './modular.ts'; - -// Be friendly to bad ECMAScript parsers by not using bigint literals -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _8n = BigInt(8); - -/** Instance of Extended Point with coordinates in X, Y, Z, T. */ -export interface EdwardsPoint extends CurvePoint { - /** extended X coordinate. Different from affine x. */ - readonly X: bigint; - /** extended Y coordinate. Different from affine y. */ - readonly Y: bigint; - /** extended Z coordinate */ - readonly Z: bigint; - /** extended T coordinate */ - readonly T: bigint; -} -/** Static methods of Extended Point with coordinates in X, Y, Z, T. */ -export interface EdwardsPointCons extends CurvePointCons { - new (X: bigint, Y: bigint, Z: bigint, T: bigint): EdwardsPoint; - CURVE(): EdwardsOpts; - fromBytes(bytes: Uint8Array, zip215?: boolean): EdwardsPoint; - fromHex(hex: string, zip215?: boolean): EdwardsPoint; -} - -/** - * Twisted Edwards curve options. - * - * * a: formula param - * * d: formula param - * * p: prime characteristic (order) of finite field, in which arithmetics is done - * * n: order of prime subgroup a.k.a total amount of valid curve points - * * h: cofactor. h*n is group order; n is subgroup order - * * Gx: x coordinate of generator point a.k.a. base point - * * Gy: y coordinate of generator point - */ -export type EdwardsOpts = Readonly<{ - p: bigint; - n: bigint; - h: bigint; - a: bigint; - d: bigint; - Gx: bigint; - Gy: bigint; -}>; - -/** - * Extra curve options for Twisted Edwards. - * - * * Fp: redefined Field over curve.p - * * Fn: redefined Field over curve.n - * * uvRatio: helper function for decompression, calculating √(u/v) - */ -export type EdwardsExtraOpts = Partial<{ - Fp: IField; - Fn: IField; - FpFnLE: boolean; - uvRatio: (u: bigint, v: bigint) => { isValid: boolean; value: bigint }; -}>; - -/** - * EdDSA (Edwards Digital Signature algorithm) options. - * - * * hash: hash function used to hash secret keys and messages - * * adjustScalarBytes: clears bits to get valid field element - * * domain: Used for hashing - * * mapToCurve: for hash-to-curve standard - * * prehash: RFC 8032 pre-hashing of messages to sign() / verify() - * * randomBytes: function generating random bytes, used for randomSecretKey - */ -export type EdDSAOpts = Partial<{ - adjustScalarBytes: (bytes: Uint8Array) => Uint8Array; - domain: (data: Uint8Array, ctx: Uint8Array, phflag: boolean) => Uint8Array; - mapToCurve: (scalar: bigint[]) => AffinePoint; - prehash: FHash; - randomBytes: (bytesLength?: number) => Uint8Array; -}>; - -/** - * EdDSA (Edwards Digital Signature algorithm) interface. - * - * Allows to create and verify signatures, create public and secret keys. - */ -export interface EdDSA { - keygen: (seed?: Uint8Array) => { secretKey: Uint8Array; publicKey: Uint8Array }; - getPublicKey: (secretKey: Uint8Array) => Uint8Array; - sign: ( - message: Uint8Array, - secretKey: Uint8Array, - options?: { context?: Uint8Array } - ) => Uint8Array; - verify: ( - sig: Uint8Array, - message: Uint8Array, - publicKey: Uint8Array, - options?: { context?: Uint8Array; zip215: boolean } - ) => boolean; - Point: EdwardsPointCons; - utils: { - randomSecretKey: (seed?: Uint8Array) => Uint8Array; - isValidSecretKey: (secretKey: Uint8Array) => boolean; - isValidPublicKey: (publicKey: Uint8Array, zip215?: boolean) => boolean; - - /** - * Converts ed public key to x public key. - * - * There is NO `fromMontgomery`: - * - There are 2 valid ed25519 points for every x25519, with flipped coordinate - * - Sometimes there are 0 valid ed25519 points, because x25519 *additionally* - * accepts inputs on the quadratic twist, which can't be moved to ed25519 - * - * @example - * ```js - * const someonesPub_ed = ed25519.getPublicKey(ed25519.utils.randomSecretKey()); - * const someonesPub = ed25519.utils.toMontgomery(someonesPub); - * const aPriv = x25519.utils.randomSecretKey(); - * const shared = x25519.getSharedSecret(aPriv, someonesPub) - * ``` - */ - toMontgomery: (publicKey: Uint8Array) => Uint8Array; - /** - * Converts ed secret key to x secret key. - * @example - * ```js - * const someonesPub = x25519.getPublicKey(x25519.utils.randomSecretKey()); - * const aPriv_ed = ed25519.utils.randomSecretKey(); - * const aPriv = ed25519.utils.toMontgomerySecret(aPriv_ed); - * const shared = x25519.getSharedSecret(aPriv, someonesPub) - * ``` - */ - toMontgomerySecret: (secretKey: Uint8Array) => Uint8Array; - getExtendedPublicKey: (key: Uint8Array) => { - head: Uint8Array; - prefix: Uint8Array; - scalar: bigint; - point: EdwardsPoint; - pointBytes: Uint8Array; - }; - }; - lengths: CurveLengths; -} - -function isEdValidXY(Fp: IField, CURVE: EdwardsOpts, x: bigint, y: bigint): boolean { - const x2 = Fp.sqr(x); - const y2 = Fp.sqr(y); - const left = Fp.add(Fp.mul(CURVE.a, x2), y2); - const right = Fp.add(Fp.ONE, Fp.mul(CURVE.d, Fp.mul(x2, y2))); - return Fp.eql(left, right); -} - -export function edwards(params: EdwardsOpts, extraOpts: EdwardsExtraOpts = {}): EdwardsPointCons { - const validated = createCurveFields('edwards', params, extraOpts, extraOpts.FpFnLE); - const { Fp, Fn } = validated; - let CURVE = validated.CURVE as EdwardsOpts; - const { h: cofactor } = CURVE; - validateObject(extraOpts, {}, { uvRatio: 'function' }); - - // Important: - // There are some places where Fp.BYTES is used instead of nByteLength. - // So far, everything has been tested with curves of Fp.BYTES == nByteLength. - // TODO: test and find curves which behave otherwise. - const MASK = _2n << (BigInt(Fn.BYTES * 8) - _1n); - const modP = (n: bigint) => Fp.create(n); // Function overrides - - // sqrt(u/v) - const uvRatio = - extraOpts.uvRatio || - ((u: bigint, v: bigint) => { - try { - return { isValid: true, value: Fp.sqrt(Fp.div(u, v)) }; - } catch (e) { - return { isValid: false, value: _0n }; - } - }); - - // Validate whether the passed curve params are valid. - // equation ax² + y² = 1 + dx²y² should work for generator point. - if (!isEdValidXY(Fp, CURVE, CURVE.Gx, CURVE.Gy)) - throw new Error('bad curve params: generator point'); - - /** - * Asserts coordinate is valid: 0 <= n < MASK. - * Coordinates >= Fp.ORDER are allowed for zip215. - */ - function acoord(title: string, n: bigint, banZero = false) { - const min = banZero ? _1n : _0n; - aInRange('coordinate ' + title, n, min, MASK); - return n; - } - - function aedpoint(other: unknown) { - if (!(other instanceof Point)) throw new Error('EdwardsPoint expected'); - } - // Converts Extended point to default (x, y) coordinates. - // Can accept precomputed Z^-1 - for example, from invertBatch. - const toAffineMemo = memoized((p: Point, iz?: bigint): AffinePoint => { - const { X, Y, Z } = p; - const is0 = p.is0(); - if (iz == null) iz = is0 ? _8n : (Fp.inv(Z) as bigint); // 8 was chosen arbitrarily - const x = modP(X * iz); - const y = modP(Y * iz); - const zz = Fp.mul(Z, iz); - if (is0) return { x: _0n, y: _1n }; - if (zz !== _1n) throw new Error('invZ was invalid'); - return { x, y }; - }); - const assertValidMemo = memoized((p: Point) => { - const { a, d } = CURVE; - if (p.is0()) throw new Error('bad point: ZERO'); // TODO: optimize, with vars below? - // Equation in affine coordinates: ax² + y² = 1 + dx²y² - // Equation in projective coordinates (X/Z, Y/Z, Z): (aX² + Y²)Z² = Z⁴ + dX²Y² - const { X, Y, Z, T } = p; - const X2 = modP(X * X); // X² - const Y2 = modP(Y * Y); // Y² - const Z2 = modP(Z * Z); // Z² - const Z4 = modP(Z2 * Z2); // Z⁴ - const aX2 = modP(X2 * a); // aX² - const left = modP(Z2 * modP(aX2 + Y2)); // (aX² + Y²)Z² - const right = modP(Z4 + modP(d * modP(X2 * Y2))); // Z⁴ + dX²Y² - if (left !== right) throw new Error('bad point: equation left != right (1)'); - // In Extended coordinates we also have T, which is x*y=T/Z: check X*Y == Z*T - const XY = modP(X * Y); - const ZT = modP(Z * T); - if (XY !== ZT) throw new Error('bad point: equation left != right (2)'); - return true; - }); - - // Extended Point works in extended coordinates: (X, Y, Z, T) ∋ (x=X/Z, y=Y/Z, T=xy). - // https://en.wikipedia.org/wiki/Twisted_Edwards_curve#Extended_coordinates - class Point implements EdwardsPoint { - // base / generator point - static readonly BASE = new Point(CURVE.Gx, CURVE.Gy, _1n, modP(CURVE.Gx * CURVE.Gy)); - // zero / infinity / identity point - static readonly ZERO = new Point(_0n, _1n, _1n, _0n); // 0, 1, 1, 0 - // math field - static readonly Fp = Fp; - // scalar field - static readonly Fn = Fn; - - readonly X: bigint; - readonly Y: bigint; - readonly Z: bigint; - readonly T: bigint; - - constructor(X: bigint, Y: bigint, Z: bigint, T: bigint) { - this.X = acoord('x', X); - this.Y = acoord('y', Y); - this.Z = acoord('z', Z, true); - this.T = acoord('t', T); - Object.freeze(this); - } - - static CURVE(): EdwardsOpts { - return CURVE; - } - - static fromAffine(p: AffinePoint): Point { - if (p instanceof Point) throw new Error('extended point not allowed'); - const { x, y } = p || {}; - acoord('x', x); - acoord('y', y); - return new Point(x, y, _1n, modP(x * y)); - } - - // Uses algo from RFC8032 5.1.3. - static fromBytes(bytes: Uint8Array, zip215 = false): Point { - const len = Fp.BYTES; - const { a, d } = CURVE; - bytes = copyBytes(abytes(bytes, len, 'point')); - abool(zip215, 'zip215'); - const normed = copyBytes(bytes); // copy again, we'll manipulate it - const lastByte = bytes[len - 1]; // select last byte - normed[len - 1] = lastByte & ~0x80; // clear last bit - const y = bytesToNumberLE(normed); - - // zip215=true is good for consensus-critical apps. =false follows RFC8032 / NIST186-5. - // RFC8032 prohibits >= p, but ZIP215 doesn't - // zip215=true: 0 <= y < MASK (2^256 for ed25519) - // zip215=false: 0 <= y < P (2^255-19 for ed25519) - const max = zip215 ? MASK : Fp.ORDER; - aInRange('point.y', y, _0n, max); - - // Ed25519: x² = (y²-1)/(dy²+1) mod p. Ed448: x² = (y²-1)/(dy²-1) mod p. Generic case: - // ax²+y²=1+dx²y² => y²-1=dx²y²-ax² => y²-1=x²(dy²-a) => x²=(y²-1)/(dy²-a) - const y2 = modP(y * y); // denominator is always non-0 mod p. - const u = modP(y2 - _1n); // u = y² - 1 - const v = modP(d * y2 - a); // v = d y² + 1. - let { isValid, value: x } = uvRatio(u, v); // √(u/v) - if (!isValid) throw new Error('bad point: invalid y coordinate'); - const isXOdd = (x & _1n) === _1n; // There are 2 square roots. Use x_0 bit to select proper - const isLastByteOdd = (lastByte & 0x80) !== 0; // x_0, last bit - if (!zip215 && x === _0n && isLastByteOdd) - // if x=0 and x_0 = 1, fail - throw new Error('bad point: x=0 and x_0=1'); - if (isLastByteOdd !== isXOdd) x = modP(-x); // if x_0 != x mod 2, set x = p-x - return Point.fromAffine({ x, y }); - } - - static fromHex(hex: string, zip215 = false): Point { - return Point.fromBytes(hexToBytes(hex), zip215); - } - - get x(): bigint { - return this.toAffine().x; - } - get y(): bigint { - return this.toAffine().y; - } - - precompute(windowSize: number = 8, isLazy = true) { - wnaf.createCache(this, windowSize); - if (!isLazy) this.multiply(_2n); // random number - return this; - } - - // Useful in fromAffine() - not for fromBytes(), which always created valid points. - assertValidity(): void { - assertValidMemo(this); - } - - // Compare one point to another. - equals(other: Point): boolean { - aedpoint(other); - const { X: X1, Y: Y1, Z: Z1 } = this; - const { X: X2, Y: Y2, Z: Z2 } = other; - const X1Z2 = modP(X1 * Z2); - const X2Z1 = modP(X2 * Z1); - const Y1Z2 = modP(Y1 * Z2); - const Y2Z1 = modP(Y2 * Z1); - return X1Z2 === X2Z1 && Y1Z2 === Y2Z1; - } - - is0(): boolean { - return this.equals(Point.ZERO); - } - - negate(): Point { - // Flips point sign to a negative one (-x, y in affine coords) - return new Point(modP(-this.X), this.Y, this.Z, modP(-this.T)); - } - - // Fast algo for doubling Extended Point. - // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-dbl-2008-hwcd - // Cost: 4M + 4S + 1*a + 6add + 1*2. - double(): Point { - const { a } = CURVE; - const { X: X1, Y: Y1, Z: Z1 } = this; - const A = modP(X1 * X1); // A = X12 - const B = modP(Y1 * Y1); // B = Y12 - const C = modP(_2n * modP(Z1 * Z1)); // C = 2*Z12 - const D = modP(a * A); // D = a*A - const x1y1 = X1 + Y1; - const E = modP(modP(x1y1 * x1y1) - A - B); // E = (X1+Y1)2-A-B - const G = D + B; // G = D+B - const F = G - C; // F = G-C - const H = D - B; // H = D-B - const X3 = modP(E * F); // X3 = E*F - const Y3 = modP(G * H); // Y3 = G*H - const T3 = modP(E * H); // T3 = E*H - const Z3 = modP(F * G); // Z3 = F*G - return new Point(X3, Y3, Z3, T3); - } - - // Fast algo for adding 2 Extended Points. - // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-add-2008-hwcd - // Cost: 9M + 1*a + 1*d + 7add. - add(other: Point) { - aedpoint(other); - const { a, d } = CURVE; - const { X: X1, Y: Y1, Z: Z1, T: T1 } = this; - const { X: X2, Y: Y2, Z: Z2, T: T2 } = other; - const A = modP(X1 * X2); // A = X1*X2 - const B = modP(Y1 * Y2); // B = Y1*Y2 - const C = modP(T1 * d * T2); // C = T1*d*T2 - const D = modP(Z1 * Z2); // D = Z1*Z2 - const E = modP((X1 + Y1) * (X2 + Y2) - A - B); // E = (X1+Y1)*(X2+Y2)-A-B - const F = D - C; // F = D-C - const G = D + C; // G = D+C - const H = modP(B - a * A); // H = B-a*A - const X3 = modP(E * F); // X3 = E*F - const Y3 = modP(G * H); // Y3 = G*H - const T3 = modP(E * H); // T3 = E*H - const Z3 = modP(F * G); // Z3 = F*G - return new Point(X3, Y3, Z3, T3); - } - - subtract(other: Point): Point { - return this.add(other.negate()); - } - - // Constant-time multiplication. - multiply(scalar: bigint): Point { - // 1 <= scalar < L - if (!Fn.isValidNot0(scalar)) throw new Error('invalid scalar: expected 1 <= sc < curve.n'); - const { p, f } = wnaf.cached(this, scalar, (p) => normalizeZ(Point, p)); - return normalizeZ(Point, [p, f])[0]; - } - - // Non-constant-time multiplication. Uses double-and-add algorithm. - // It's faster, but should only be used when you don't care about - // an exposed private key e.g. sig verification. - // Does NOT allow scalars higher than CURVE.n. - // Accepts optional accumulator to merge with multiply (important for sparse scalars) - multiplyUnsafe(scalar: bigint, acc = Point.ZERO): Point { - // 0 <= scalar < L - if (!Fn.isValid(scalar)) throw new Error('invalid scalar: expected 0 <= sc < curve.n'); - if (scalar === _0n) return Point.ZERO; - if (this.is0() || scalar === _1n) return this; - return wnaf.unsafe(this, scalar, (p) => normalizeZ(Point, p), acc); - } - - // Checks if point is of small order. - // If you add something to small order point, you will have "dirty" - // point with torsion component. - // Multiplies point by cofactor and checks if the result is 0. - isSmallOrder(): boolean { - return this.multiplyUnsafe(cofactor).is0(); - } - - // Multiplies point by curve order and checks if the result is 0. - // Returns `false` is the point is dirty. - isTorsionFree(): boolean { - return wnaf.unsafe(this, CURVE.n).is0(); - } - - // Converts Extended point to default (x, y) coordinates. - // Can accept precomputed Z^-1 - for example, from invertBatch. - toAffine(invertedZ?: bigint): AffinePoint { - return toAffineMemo(this, invertedZ); - } - - clearCofactor(): Point { - if (cofactor === _1n) return this; - return this.multiplyUnsafe(cofactor); - } - - toBytes(): Uint8Array { - const { x, y } = this.toAffine(); - // Fp.toBytes() allows non-canonical encoding of y (>= p). - const bytes = Fp.toBytes(y); - // Each y has 2 valid points: (x, y), (x,-y). - // When compressing, it's enough to store y and use the last byte to encode sign of x - bytes[bytes.length - 1] |= x & _1n ? 0x80 : 0; - return bytes; - } - toHex(): string { - return bytesToHex(this.toBytes()); - } - - toString() { - return ``; - } - } - const wnaf = new wNAF(Point, Fn.BITS); - Point.BASE.precompute(8); // Enable precomputes. Slows down first publicKey computation by 20ms. - return Point; -} - -/** - * Base class for prime-order points like Ristretto255 and Decaf448. - * These points eliminate cofactor issues by representing equivalence classes - * of Edwards curve points. - */ -export abstract class PrimeEdwardsPoint> - implements CurvePoint -{ - static BASE: PrimeEdwardsPoint; - static ZERO: PrimeEdwardsPoint; - static Fp: IField; - static Fn: IField; - - protected readonly ep: EdwardsPoint; - - constructor(ep: EdwardsPoint) { - this.ep = ep; - } - - // Abstract methods that must be implemented by subclasses - abstract toBytes(): Uint8Array; - abstract equals(other: T): boolean; - - // Static methods that must be implemented by subclasses - static fromBytes(_bytes: Uint8Array): any { - notImplemented(); - } - - static fromHex(_hex: string): any { - notImplemented(); - } - - get x(): bigint { - return this.toAffine().x; - } - get y(): bigint { - return this.toAffine().y; - } - - // Common implementations - clearCofactor(): T { - // no-op for prime-order groups - return this as any; - } - - assertValidity(): void { - this.ep.assertValidity(); - } - - toAffine(invertedZ?: bigint): AffinePoint { - return this.ep.toAffine(invertedZ); - } - - toHex(): string { - return bytesToHex(this.toBytes()); - } - - toString(): string { - return this.toHex(); - } - - isTorsionFree(): boolean { - return true; - } - - isSmallOrder(): boolean { - return false; - } - - add(other: T): T { - this.assertSame(other); - return this.init(this.ep.add(other.ep)); - } - - subtract(other: T): T { - this.assertSame(other); - return this.init(this.ep.subtract(other.ep)); - } - - multiply(scalar: bigint): T { - return this.init(this.ep.multiply(scalar)); - } - - multiplyUnsafe(scalar: bigint): T { - return this.init(this.ep.multiplyUnsafe(scalar)); - } - - double(): T { - return this.init(this.ep.double()); - } - - negate(): T { - return this.init(this.ep.negate()); - } - - precompute(windowSize?: number, isLazy?: boolean): T { - return this.init(this.ep.precompute(windowSize, isLazy)); - } - - // Helper methods - abstract is0(): boolean; - protected abstract assertSame(other: T): void; - protected abstract init(ep: EdwardsPoint): T; -} - -/** - * Initializes EdDSA signatures over given Edwards curve. - */ -export function eddsa(Point: EdwardsPointCons, cHash: FHash, eddsaOpts: EdDSAOpts = {}): EdDSA { - if (typeof cHash !== 'function') throw new Error('"hash" function param is required'); - validateObject( - eddsaOpts, - {}, - { - adjustScalarBytes: 'function', - randomBytes: 'function', - domain: 'function', - prehash: 'function', - mapToCurve: 'function', - } - ); - - const { prehash } = eddsaOpts; - const { BASE, Fp, Fn } = Point; - - const randomBytes = eddsaOpts.randomBytes || wcRandomBytes; - const adjustScalarBytes = eddsaOpts.adjustScalarBytes || ((bytes: Uint8Array) => bytes); - const domain = - eddsaOpts.domain || - ((data: Uint8Array, ctx: Uint8Array, phflag: boolean) => { - abool(phflag, 'phflag'); - if (ctx.length || phflag) throw new Error('Contexts/pre-hash are not supported'); - return data; - }); // NOOP - - // Little-endian SHA512 with modulo n - function modN_LE(hash: Uint8Array): bigint { - return Fn.create(bytesToNumberLE(hash)); // Not Fn.fromBytes: it has length limit - } - - // Get the hashed private scalar per RFC8032 5.1.5 - function getPrivateScalar(key: Uint8Array) { - const len = lengths.secretKey; - abytes(key, lengths.secretKey, 'secretKey'); - // Hash private key with curve's hash function to produce uniformingly random input - // Check byte lengths: ensure(64, h(ensure(32, key))) - const hashed = abytes(cHash(key), 2 * len, 'hashedSecretKey'); - const head = adjustScalarBytes(hashed.slice(0, len)); // clear first half bits, produce FE - const prefix = hashed.slice(len, 2 * len); // second half is called key prefix (5.1.6) - const scalar = modN_LE(head); // The actual private scalar - return { head, prefix, scalar }; - } - - /** Convenience method that creates public key from scalar. RFC8032 5.1.5 */ - function getExtendedPublicKey(secretKey: Uint8Array) { - const { head, prefix, scalar } = getPrivateScalar(secretKey); - const point = BASE.multiply(scalar); // Point on Edwards curve aka public key - const pointBytes = point.toBytes(); - return { head, prefix, scalar, point, pointBytes }; - } - - /** Calculates EdDSA pub key. RFC8032 5.1.5. */ - function getPublicKey(secretKey: Uint8Array): Uint8Array { - return getExtendedPublicKey(secretKey).pointBytes; - } - - // int('LE', SHA512(dom2(F, C) || msgs)) mod N - function hashDomainToScalar(context: Uint8Array = Uint8Array.of(), ...msgs: Uint8Array[]) { - const msg = concatBytes(...msgs); - return modN_LE(cHash(domain(msg, abytes(context, undefined, 'context'), !!prehash))); - } - - /** Signs message with secret key. RFC8032 5.1.6 */ - function sign( - msg: Uint8Array, - secretKey: Uint8Array, - options: { context?: Uint8Array } = {} - ): Uint8Array { - msg = abytes(msg, undefined, 'message'); - if (prehash) msg = prehash(msg); // for ed25519ph etc. - const { prefix, scalar, pointBytes } = getExtendedPublicKey(secretKey); - const r = hashDomainToScalar(options.context, prefix, msg); // r = dom2(F, C) || prefix || PH(M) - const R = BASE.multiply(r).toBytes(); // R = rG - const k = hashDomainToScalar(options.context, R, pointBytes, msg); // R || A || PH(M) - const s = Fn.create(r + k * scalar); // S = (r + k * s) mod L - if (!Fn.isValid(s)) throw new Error('sign failed: invalid s'); // 0 <= s < L - const rs = concatBytes(R, Fn.toBytes(s)); - return abytes(rs, lengths.signature, 'result'); - } - - // verification rule is either zip215 or rfc8032 / nist186-5. Consult fromHex: - const verifyOpts: { context?: Uint8Array; zip215?: boolean } = { zip215: true }; - - /** - * Verifies EdDSA signature against message and public key. RFC8032 5.1.7. - * An extended group equation is checked. - */ - function verify( - sig: Uint8Array, - msg: Uint8Array, - publicKey: Uint8Array, - options = verifyOpts - ): boolean { - const { context, zip215 } = options; - const len = lengths.signature; - sig = abytes(sig, len, 'signature'); - msg = abytes(msg, undefined, 'message'); - publicKey = abytes(publicKey, lengths.publicKey, 'publicKey'); - if (zip215 !== undefined) abool(zip215, 'zip215'); - if (prehash) msg = prehash(msg); // for ed25519ph, etc - - const mid = len / 2; - const r = sig.subarray(0, mid); - const s = bytesToNumberLE(sig.subarray(mid, len)); - let A, R, SB; - try { - // zip215=true is good for consensus-critical apps. =false follows RFC8032 / NIST186-5. - // zip215=true: 0 <= y < MASK (2^256 for ed25519) - // zip215=false: 0 <= y < P (2^255-19 for ed25519) - A = Point.fromBytes(publicKey, zip215); - R = Point.fromBytes(r, zip215); - SB = BASE.multiplyUnsafe(s); // 0 <= s < l is done inside - } catch (error) { - return false; - } - if (!zip215 && A.isSmallOrder()) return false; // zip215 allows public keys of small order - - const k = hashDomainToScalar(context, R.toBytes(), A.toBytes(), msg); - const RkA = R.add(A.multiplyUnsafe(k)); - // Extended group equation - // [8][S]B = [8]R + [8][k]A' - return RkA.subtract(SB).clearCofactor().is0(); - } - - const _size = Fp.BYTES; // 32 for ed25519, 57 for ed448 - const lengths = { - secretKey: _size, - publicKey: _size, - signature: 2 * _size, - seed: _size, - }; - function randomSecretKey(seed = randomBytes(lengths.seed)): Uint8Array { - return abytes(seed, lengths.seed, 'seed'); - } - - function isValidSecretKey(key: Uint8Array): boolean { - return isBytes(key) && key.length === Fn.BYTES; - } - - function isValidPublicKey(key: Uint8Array, zip215?: boolean): boolean { - try { - return !!Point.fromBytes(key, zip215); - } catch (error) { - return false; - } - } - - const utils = { - getExtendedPublicKey, - randomSecretKey, - isValidSecretKey, - isValidPublicKey, - /** - * Converts ed public key to x public key. Uses formula: - * - ed25519: - * - `(u, v) = ((1+y)/(1-y), sqrt(-486664)*u/x)` - * - `(x, y) = (sqrt(-486664)*u/v, (u-1)/(u+1))` - * - ed448: - * - `(u, v) = ((y-1)/(y+1), sqrt(156324)*u/x)` - * - `(x, y) = (sqrt(156324)*u/v, (1+u)/(1-u))` - */ - toMontgomery(publicKey: Uint8Array): Uint8Array { - const { y } = Point.fromBytes(publicKey); - const size = lengths.publicKey; - const is25519 = size === 32; - if (!is25519 && size !== 57) throw new Error('only defined for 25519 and 448'); - const u = is25519 ? Fp.div(_1n + y, _1n - y) : Fp.div(y - _1n, y + _1n); - return Fp.toBytes(u); - }, - toMontgomerySecret(secretKey: Uint8Array): Uint8Array { - const size = lengths.secretKey; - abytes(secretKey, size); - const hashed = cHash(secretKey.subarray(0, size)); - return adjustScalarBytes(hashed).subarray(0, size); - }, - }; - - return Object.freeze({ - keygen: createKeygen(randomSecretKey, getPublicKey), - getPublicKey, - sign, - verify, - utils, - Point, - lengths, - }) satisfies Signer; -} diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/fft.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/fft.ts deleted file mode 100644 index f885bfc3..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/fft.ts +++ /dev/null @@ -1,521 +0,0 @@ -/** - * Experimental implementation of NTT / FFT (Fast Fourier Transform) over finite fields. - * API may change at any time. The code has not been audited. Feature requests are welcome. - * @module - */ -import type { IField } from './modular.ts'; - -export interface MutableArrayLike { - [index: number]: T; - length: number; - slice(start?: number, end?: number): this; - [Symbol.iterator](): Iterator; -} - -function checkU32(n: number) { - // 0xff_ff_ff_ff - if (!Number.isSafeInteger(n) || n < 0 || n > 0xffffffff) - throw new Error('wrong u32 integer:' + n); - return n; -} - -/** Checks if integer is in form of `1 << X` */ -export function isPowerOfTwo(x: number): boolean { - checkU32(x); - return (x & (x - 1)) === 0 && x !== 0; -} - -export function nextPowerOfTwo(n: number): number { - checkU32(n); - if (n <= 1) return 1; - return (1 << (log2(n - 1) + 1)) >>> 0; -} - -export function reverseBits(n: number, bits: number): number { - checkU32(n); - let reversed = 0; - for (let i = 0; i < bits; i++, n >>>= 1) reversed = (reversed << 1) | (n & 1); - return reversed; -} - -/** Similar to `bitLen(x)-1` but much faster for small integers, like indices */ -export function log2(n: number): number { - checkU32(n); - return 31 - Math.clz32(n); -} - -/** - * Moves lowest bit to highest position, which at first step splits - * array on even and odd indices, then it applied again to each part, - * which is core of fft - */ -export function bitReversalInplace>(values: T): T { - const n = values.length; - if (n < 2 || !isPowerOfTwo(n)) - throw new Error('n must be a power of 2 and greater than 1. Got ' + n); - const bits = log2(n); - for (let i = 0; i < n; i++) { - const j = reverseBits(i, bits); - if (i < j) { - const tmp = values[i]; - values[i] = values[j]; - values[j] = tmp; - } - } - return values; -} - -export function bitReversalPermutation(values: T[]): T[] { - return bitReversalInplace(values.slice()) as T[]; -} - -const _1n = /** @__PURE__ */ BigInt(1); -function findGenerator(field: IField) { - let G = BigInt(2); - for (; field.eql(field.pow(G, field.ORDER >> _1n), field.ONE); G++); - return G; -} - -export type RootsOfUnity = { - info: { G: bigint; oddFactor: bigint; powerOfTwo: number }; - roots: (bits: number) => bigint[]; - brp(bits: number): bigint[]; - inverse(bits: number): bigint[]; - omega: (bits: number) => bigint; - clear: () => void; -}; -/** We limit roots up to 2**31, which is a lot: 2-billion polynomimal should be rare. */ -export function rootsOfUnity(field: IField, generator?: bigint): RootsOfUnity { - // Factor field.ORDER-1 as oddFactor * 2^powerOfTwo - let oddFactor = field.ORDER - _1n; - let powerOfTwo = 0; - for (; (oddFactor & _1n) !== _1n; powerOfTwo++, oddFactor >>= _1n); - - // Find non quadratic residue - let G = generator !== undefined ? BigInt(generator) : findGenerator(field); - // Powers of generator - const omegas: bigint[] = new Array(powerOfTwo + 1); - omegas[powerOfTwo] = field.pow(G, oddFactor); - for (let i = powerOfTwo; i > 0; i--) omegas[i - 1] = field.sqr(omegas[i]); - // Compute all roots of unity for powers up to maxPower - const rootsCache: bigint[][] = []; - const checkBits = (bits: number) => { - checkU32(bits); - if (bits > 31 || bits > powerOfTwo) - throw new Error('rootsOfUnity: wrong bits ' + bits + ' powerOfTwo=' + powerOfTwo); - return bits; - }; - const precomputeRoots = (maxPower: number) => { - checkBits(maxPower); - for (let power = maxPower; power >= 0; power--) { - if (rootsCache[power]) continue; // Skip if we've already computed roots for this power - const rootsAtPower: bigint[] = []; - for (let j = 0, cur = field.ONE; j < 2 ** power; j++, cur = field.mul(cur, omegas[power])) - rootsAtPower.push(cur); - rootsCache[power] = rootsAtPower; - } - return rootsCache[maxPower]; - }; - const brpCache = new Map(); - const inverseCache = new Map(); - - // NOTE: we use bits instead of power, because power = 2**bits, - // but power is not neccesary isPowerOfTwo(power)! - return { - info: { G, powerOfTwo, oddFactor }, - roots: (bits: number): bigint[] => { - const b = checkBits(bits); - return precomputeRoots(b); - }, - brp(bits: number): bigint[] { - const b = checkBits(bits); - if (brpCache.has(b)) return brpCache.get(b)!; - else { - const res = bitReversalPermutation(this.roots(b)); - brpCache.set(b, res); - return res; - } - }, - inverse(bits: number): bigint[] { - const b = checkBits(bits); - if (inverseCache.has(b)) return inverseCache.get(b)!; - else { - const res = field.invertBatch(this.roots(b)); - inverseCache.set(b, res); - return res; - } - }, - omega: (bits: number): bigint => omegas[checkBits(bits)], - clear: (): void => { - rootsCache.splice(0, rootsCache.length); - brpCache.clear(); - }, - }; -} - -export type Polynomial = MutableArrayLike; - -/** - * Maps great to Field, but not to Group (EC points): - * - inv from scalar field - * - we need multiplyUnsafe here, instead of multiply for speed - * - multiplyUnsafe is safe in the context: we do mul(rootsOfUnity), which are public and sparse - */ -export type FFTOpts = { - add: (a: T, b: T) => T; - sub: (a: T, b: T) => T; - mul: (a: T, scalar: R) => T; - inv: (a: R) => R; -}; - -export type FFTCoreOpts = { - N: number; - roots: Polynomial; - dit: boolean; - invertButterflies?: boolean; - skipStages?: number; - brp?: boolean; -}; - -export type FFTCoreLoop =

>(values: P) => P; - -/** - * Constructs different flavors of FFT. radix2 implementation of low level mutating API. Flavors: - * - * - DIT (Decimation-in-Time): Bottom-Up (leaves -> root), Cool-Turkey - * - DIF (Decimation-in-Frequency): Top-Down (root -> leaves), Gentleman–Sande - * - * DIT takes brp input, returns natural output. - * DIF takes natural input, returns brp output. - * - * The output is actually identical. Time / frequence distinction is not meaningful - * for Polynomial multiplication in fields. - * Which means if protocol supports/needs brp output/inputs, then we can skip this step. - * - * Cyclic NTT: Rq = Zq[x]/(x^n-1). butterfly_DIT+loop_DIT OR butterfly_DIF+loop_DIT, roots are omega - * Negacyclic NTT: Rq = Zq[x]/(x^n+1). butterfly_DIT+loop_DIF, at least for mlkem / mldsa - */ -export const FFTCore = (F: FFTOpts, coreOpts: FFTCoreOpts): FFTCoreLoop => { - const { N, roots, dit, invertButterflies = false, skipStages = 0, brp = true } = coreOpts; - const bits = log2(N); - if (!isPowerOfTwo(N)) throw new Error('FFT: Polynomial size should be power of two'); - const isDit = dit !== invertButterflies; - isDit; - return

>(values: P): P => { - if (values.length !== N) throw new Error('FFT: wrong Polynomial length'); - if (dit && brp) bitReversalInplace(values); - for (let i = 0, g = 1; i < bits - skipStages; i++) { - // For each stage s (sub-FFT length m = 2^s) - const s = dit ? i + 1 + skipStages : bits - i; - const m = 1 << s; - const m2 = m >> 1; - const stride = N >> s; - // Loop over each subarray of length m - for (let k = 0; k < N; k += m) { - // Loop over each butterfly within the subarray - for (let j = 0, grp = g++; j < m2; j++) { - const rootPos = invertButterflies ? (dit ? N - grp : grp) : j * stride; - const i0 = k + j; - const i1 = k + j + m2; - const omega = roots[rootPos]; - const b = values[i1]; - const a = values[i0]; - // Inlining gives us 10% perf in kyber vs functions - if (isDit) { - const t = F.mul(b, omega); // Standard DIT butterfly - values[i0] = F.add(a, t); - values[i1] = F.sub(a, t); - } else if (invertButterflies) { - values[i0] = F.add(b, a); // DIT loop + inverted butterflies (Kyber decode) - values[i1] = F.mul(F.sub(b, a), omega); - } else { - values[i0] = F.add(a, b); // Standard DIF butterfly - values[i1] = F.mul(F.sub(a, b), omega); - } - } - } - } - if (!dit && brp) bitReversalInplace(values); - return values; - }; -}; - -export type FFTMethods = { - direct

>(values: P, brpInput?: boolean, brpOutput?: boolean): P; - inverse

>(values: P, brpInput?: boolean, brpOutput?: boolean): P; -}; - -/** - * NTT aka FFT over finite field (NOT over complex numbers). - * Naming mirrors other libraries. - */ -export function FFT(roots: RootsOfUnity, opts: FFTOpts): FFTMethods { - const getLoop = ( - N: number, - roots: Polynomial, - brpInput = false, - brpOutput = false - ): (

>(values: P) => P) => { - if (brpInput && brpOutput) { - // we cannot optimize this case, but lets support it anyway - return (values) => - FFTCore(opts, { N, roots, dit: false, brp: false })(bitReversalInplace(values)); - } - if (brpInput) return FFTCore(opts, { N, roots, dit: true, brp: false }); - if (brpOutput) return FFTCore(opts, { N, roots, dit: false, brp: false }); - return FFTCore(opts, { N, roots, dit: true, brp: true }); // all natural - }; - return { - direct

>(values: P, brpInput = false, brpOutput = false): P { - const N = values.length; - if (!isPowerOfTwo(N)) throw new Error('FFT: Polynomial size should be power of two'); - const bits = log2(N); - return getLoop(N, roots.roots(bits), brpInput, brpOutput)

(values.slice()); - }, - inverse

>(values: P, brpInput = false, brpOutput = false): P { - const N = values.length; - const bits = log2(N); - const res = getLoop(N, roots.inverse(bits), brpInput, brpOutput)(values.slice()); - const ivm = opts.inv(BigInt(values.length)); // scale - // we can get brp output if we use dif instead of dit! - for (let i = 0; i < res.length; i++) res[i] = opts.mul(res[i], ivm); - // Allows to re-use non-inverted roots, but is VERY fragile - // return [res[0]].concat(res.slice(1).reverse()); - // inverse calculated as pow(-1), which transforms into ω^{-kn} (-> reverses indices) - return res; - }, - }; -} - -export type CreatePolyFn

, T> = (len: number, elm?: T) => P; - -export type PolyFn

, T> = { - roots: RootsOfUnity; - create: CreatePolyFn; - length?: number; // optional enforced size - - degree: (a: P) => number; - extend: (a: P, len: number) => P; - add: (a: P, b: P) => P; // fc(x) = fa(x) + fb(x) - sub: (a: P, b: P) => P; // fc(x) = fa(x) - fb(x) - mul: (a: P, b: P | T) => P; // fc(x) = fa(x) * fb(x) OR fc(x) = fa(x) * scalar (same as field) - dot: (a: P, b: P) => P; // point-wise coeff multiplication - convolve: (a: P, b: P) => P; - shift: (p: P, factor: bigint) => P; // point-wise coeffcient shift - clone: (a: P) => P; - // Eval - eval: (a: P, basis: P) => T; // y = fc(x) - monomial: { - basis: (x: T, n: number) => P; - eval: (a: P, x: T) => T; - }; - lagrange: { - basis: (x: T, n: number, brp?: boolean) => P; - eval: (a: P, x: T, brp?: boolean) => T; - }; - // Complex - vanishing: (roots: P) => P; // f(x) = 0 for every x in roots -}; - -/** - * Poly wants a cracker. - * - * Polynomials are functions like `y=f(x)`, which means when we multiply two polynomials, result is - * function `f3(x) = f1(x) * f2(x)`, we don't multiply values. Key takeaways: - * - * - **Polynomial** is an array of coefficients: `f(x) = sum(coeff[i] * basis[i](x))` - * - **Basis** is array of functions - * - **Monominal** is Polynomial where `basis[i](x) == x**i` (powers) - * - **Array size** is domain size - * - **Lattice** is matrix (Polynomial of Polynomials) - */ -export function poly( - field: IField, - roots: RootsOfUnity, - create?: undefined, - fft?: FFTMethods, - length?: number -): PolyFn; -export function poly>( - field: IField, - roots: RootsOfUnity, - create: CreatePolyFn, - fft?: FFTMethods, - length?: number -): PolyFn; -export function poly>( - field: IField, - roots: RootsOfUnity, - create?: CreatePolyFn, - fft?: FFTMethods, - length?: number -): PolyFn { - const F = field; - const _create = - create || - (((len: number, elm?: T): Polynomial => new Array(len).fill(elm ?? F.ZERO)) as CreatePolyFn< - P, - T - >); - - const isPoly = (x: any): x is P => Array.isArray(x) || ArrayBuffer.isView(x); - const checkLength = (...lst: P[]): number => { - if (!lst.length) return 0; - for (const i of lst) if (!isPoly(i)) throw new Error('poly: not polynomial: ' + i); - const L = lst[0].length; - for (let i = 1; i < lst.length; i++) - if (lst[i].length !== L) throw new Error(`poly: mismatched lengths ${L} vs ${lst[i].length}`); - if (length !== undefined && L !== length) - throw new Error(`poly: expected fixed length ${length}, got ${L}`); - return L; - }; - function findOmegaIndex(x: T, n: number, brp = false): number { - const bits = log2(n); - const omega = brp ? roots.brp(bits) : roots.roots(bits); - for (let i = 0; i < n; i++) if (F.eql(x, omega[i] as T)) return i; - return -1; - } - // TODO: mutating versions for mlkem/mldsa - return { - roots, - create: _create, - length, - extend: (a: P, len: number): P => { - checkLength(a); - const out = _create(len, F.ZERO); - for (let i = 0; i < a.length; i++) out[i] = a[i]; - return out; - }, - degree: (a: P): number => { - checkLength(a); - for (let i = a.length - 1; i >= 0; i--) if (!F.is0(a[i])) return i; - return -1; - }, - add: (a: P, b: P): P => { - const len = checkLength(a, b); - const out = _create(len); - for (let i = 0; i < len; i++) out[i] = F.add(a[i], b[i]); - return out; - }, - sub: (a: P, b: P): P => { - const len = checkLength(a, b); - const out = _create(len); - for (let i = 0; i < len; i++) out[i] = F.sub(a[i], b[i]); - return out; - }, - dot: (a: P, b: P): P => { - const len = checkLength(a, b); - const out = _create(len); - for (let i = 0; i < len; i++) out[i] = F.mul(a[i], b[i]); - return out; - }, - mul: (a: P, b: P | T): P => { - if (isPoly(b)) { - const len = checkLength(a, b); - if (fft) { - const A = fft.direct(a, false, true); - const B = fft.direct(b, false, true); - for (let i = 0; i < A.length; i++) A[i] = F.mul(A[i], B[i]); - return fft.inverse(A, true, false) as P; - } else { - // NOTE: this is quadratic and mostly for compat tests with FFT - const res = _create(len); - for (let i = 0; i < len; i++) { - for (let j = 0; j < len; j++) { - const k = (i + j) % len; // wrap mod length - res[k] = F.add(res[k], F.mul(a[i], b[j])); - } - } - return res; - } - } else { - const out = _create(checkLength(a)); - for (let i = 0; i < out.length; i++) out[i] = F.mul(a[i], b); - return out; - } - }, - convolve(a: P, b: P): P { - const len = nextPowerOfTwo(a.length + b.length - 1); - return this.mul(this.extend(a, len), this.extend(b, len)); - }, - shift(p: P, factor: bigint): P { - const out = _create(checkLength(p)); - out[0] = p[0]; - for (let i = 1, power = F.ONE; i < p.length; i++) { - power = F.mul(power, factor); - out[i] = F.mul(p[i], power); - } - return out; - }, - clone: (a: P): P => { - checkLength(a); - const out = _create(a.length); - for (let i = 0; i < a.length; i++) out[i] = a[i]; - return out; - }, - eval: (a: P, basis: P): T => { - checkLength(a); - let acc = F.ZERO; - for (let i = 0; i < a.length; i++) acc = F.add(acc, F.mul(a[i], basis[i])); - return acc; - }, - monomial: { - basis: (x: T, n: number): P => { - const out = _create(n); - let pow = F.ONE; - for (let i = 0; i < n; i++) { - out[i] = pow; - pow = F.mul(pow, x); - } - return out; - }, - eval: (a: P, x: T): T => { - checkLength(a); - // Same as eval(a, monomialBasis(x, a.length)), but it is faster this way - let acc = F.ZERO; - for (let i = a.length - 1; i >= 0; i--) acc = F.add(F.mul(acc, x), a[i]); - return acc; - }, - }, - lagrange: { - basis: (x: T, n: number, brp = false, weights?: P): P => { - const bits = log2(n); - const cache = weights || brp ? roots.brp(bits) : roots.roots(bits); // [ω⁰, ω¹, ..., ωⁿ⁻¹] - const out = _create(n); - // Fast Kronecker-δ shortcut - const idx = findOmegaIndex(x, n, brp); - if (idx !== -1) { - out[idx] = F.ONE; - return out; - } - const tm = F.pow(x, BigInt(n)); - const c = F.mul(F.sub(tm, F.ONE), F.inv(BigInt(n) as T)); // c = (xⁿ - 1)/n - const denom = _create(n); - for (let i = 0; i < n; i++) denom[i] = F.sub(x, cache[i] as T); - const inv = F.invertBatch(denom as any as T[]); - for (let i = 0; i < n; i++) out[i] = F.mul(c, F.mul(cache[i] as T, inv[i])); - return out; - }, - eval(a: P, x: T, brp = false): T { - checkLength(a); - const idx = findOmegaIndex(x, a.length, brp); - if (idx !== -1) return a[idx]; // fast path - const L = this.basis(x, a.length, brp); // Lᵢ(x) - let acc = F.ZERO; - for (let i = 0; i < a.length; i++) if (!F.is0(a[i])) acc = F.add(acc, F.mul(a[i], L[i])); - return acc; - }, - }, - vanishing(roots: P): P { - checkLength(roots); - const out = _create(roots.length + 1, F.ZERO); - out[0] = F.ONE; - for (const r of roots) { - const neg = F.neg(r); - for (let j = out.length - 1; j > 0; j--) out[j] = F.add(F.mul(out[j], neg), out[j - 1]); - out[0] = F.mul(out[0], neg); - } - return out; - }, - }; -} diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/hash-to-curve.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/hash-to-curve.ts deleted file mode 100644 index b8a9ef2d..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/hash-to-curve.ts +++ /dev/null @@ -1,292 +0,0 @@ -/** - * hash-to-curve from RFC 9380. - * Hashes arbitrary-length byte strings to a list of one or more elements of a finite field F. - * https://www.rfc-editor.org/rfc/rfc9380 - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import type { CHash } from '../utils.ts'; -import { - abytes, - asafenumber, - asciiToBytes, - bytesToNumberBE, - concatBytes, - isBytes, - validateObject, -} from '../utils.ts'; -import type { AffinePoint, PC_ANY, PC_F, PC_P } from './curve.ts'; -import { FpInvertBatch, mod, type IField } from './modular.ts'; - -export type AsciiOrBytes = string | Uint8Array; - -/** - * * `DST` is a domain separation tag, defined in section 2.2.5 - * * `p` characteristic of F, where F is a finite field of characteristic p and order q = p^m - * * `m` is extension degree (1 for prime fields) - * * `k` is the target security target in bits (e.g. 128), from section 5.1 - * * `expand` is `xmd` (SHA2, SHA3, BLAKE) or `xof` (SHAKE, BLAKE-XOF) - * * `hash` conforming to `utils.CHash` interface, with `outputLen` / `blockLen` props - */ -export type H2COpts = { - DST: AsciiOrBytes; - expand: 'xmd' | 'xof'; - hash: CHash; - p: bigint; - m: number; - k: number; -}; -export type H2CHashOpts = { - expand: 'xmd' | 'xof'; - hash: CHash; -}; -export type MapToCurve = (scalar: bigint[]) => AffinePoint; - -// Separated from initialization opts, so users won't accidentally change per-curve parameters -// (changing DST is ok!) -export type H2CDSTOpts = { DST: AsciiOrBytes }; -export type H2CHasherBase = { - hashToCurve(msg: Uint8Array, options?: H2CDSTOpts): PC_P; - hashToScalar(msg: Uint8Array, options?: H2CDSTOpts): bigint; - deriveToCurve?(msg: Uint8Array, options?: H2CDSTOpts): PC_P; - Point: PC; -}; -/** - * RFC 9380 methods, with cofactor clearing. See https://www.rfc-editor.org/rfc/rfc9380#section-3. - * - * * hashToCurve: `map(hash(input))`, encodes RANDOM bytes to curve (WITH hashing) - * * encodeToCurve: `map(hash(input))`, encodes NON-UNIFORM bytes to curve (WITH hashing) - * * mapToCurve: `map(scalars)`, encodes NON-UNIFORM scalars to curve (NO hashing) - */ -export type H2CHasher = H2CHasherBase & { - encodeToCurve(msg: Uint8Array, options?: H2CDSTOpts): PC_P; - mapToCurve: MapToCurve>; - defaults: H2COpts & { encodeDST?: AsciiOrBytes }; -}; - -// Octet Stream to Integer. "spec" implementation of os2ip is 2.5x slower vs bytesToNumberBE. -const os2ip = bytesToNumberBE; - -// Integer to Octet Stream (numberToBytesBE) -function i2osp(value: number, length: number): Uint8Array { - asafenumber(value); - asafenumber(length); - if (value < 0 || value >= 1 << (8 * length)) throw new Error('invalid I2OSP input: ' + value); - const res = Array.from({ length }).fill(0) as number[]; - for (let i = length - 1; i >= 0; i--) { - res[i] = value & 0xff; - value >>>= 8; - } - return new Uint8Array(res); -} - -function strxor(a: Uint8Array, b: Uint8Array): Uint8Array { - const arr = new Uint8Array(a.length); - for (let i = 0; i < a.length; i++) { - arr[i] = a[i] ^ b[i]; - } - return arr; -} - -// User can always use utf8 if they want, by passing Uint8Array. -// If string is passed, we treat it as ASCII: other formats are likely a mistake. -function normDST(DST: AsciiOrBytes): Uint8Array { - if (!isBytes(DST) && typeof DST !== 'string') - throw new Error('DST must be Uint8Array or ascii string'); - return typeof DST === 'string' ? asciiToBytes(DST) : DST; -} - -/** - * Produces a uniformly random byte string using a cryptographic hash function H that outputs b bits. - * [RFC 9380 5.3.1](https://www.rfc-editor.org/rfc/rfc9380#section-5.3.1). - */ -export function expand_message_xmd( - msg: Uint8Array, - DST: AsciiOrBytes, - lenInBytes: number, - H: CHash -): Uint8Array { - abytes(msg); - asafenumber(lenInBytes); - DST = normDST(DST); - // https://www.rfc-editor.org/rfc/rfc9380#section-5.3.3 - if (DST.length > 255) DST = H(concatBytes(asciiToBytes('H2C-OVERSIZE-DST-'), DST)); - const { outputLen: b_in_bytes, blockLen: r_in_bytes } = H; - const ell = Math.ceil(lenInBytes / b_in_bytes); - if (lenInBytes > 65535 || ell > 255) throw new Error('expand_message_xmd: invalid lenInBytes'); - const DST_prime = concatBytes(DST, i2osp(DST.length, 1)); - const Z_pad = i2osp(0, r_in_bytes); - const l_i_b_str = i2osp(lenInBytes, 2); // len_in_bytes_str - const b = new Array(ell); - const b_0 = H(concatBytes(Z_pad, msg, l_i_b_str, i2osp(0, 1), DST_prime)); - b[0] = H(concatBytes(b_0, i2osp(1, 1), DST_prime)); - for (let i = 1; i <= ell; i++) { - const args = [strxor(b_0, b[i - 1]), i2osp(i + 1, 1), DST_prime]; - b[i] = H(concatBytes(...args)); - } - const pseudo_random_bytes = concatBytes(...b); - return pseudo_random_bytes.slice(0, lenInBytes); -} - -/** - * Produces a uniformly random byte string using an extendable-output function (XOF) H. - * 1. The collision resistance of H MUST be at least k bits. - * 2. H MUST be an XOF that has been proved indifferentiable from - * a random oracle under a reasonable cryptographic assumption. - * [RFC 9380 5.3.2](https://www.rfc-editor.org/rfc/rfc9380#section-5.3.2). - */ -export function expand_message_xof( - msg: Uint8Array, - DST: AsciiOrBytes, - lenInBytes: number, - k: number, - H: CHash -): Uint8Array { - abytes(msg); - asafenumber(lenInBytes); - DST = normDST(DST); - // https://www.rfc-editor.org/rfc/rfc9380#section-5.3.3 - // DST = H('H2C-OVERSIZE-DST-' || a_very_long_DST, Math.ceil((lenInBytes * k) / 8)); - if (DST.length > 255) { - const dkLen = Math.ceil((2 * k) / 8); - DST = H.create({ dkLen }).update(asciiToBytes('H2C-OVERSIZE-DST-')).update(DST).digest(); - } - if (lenInBytes > 65535 || DST.length > 255) - throw new Error('expand_message_xof: invalid lenInBytes'); - return ( - H.create({ dkLen: lenInBytes }) - .update(msg) - .update(i2osp(lenInBytes, 2)) - // 2. DST_prime = DST || I2OSP(len(DST), 1) - .update(DST) - .update(i2osp(DST.length, 1)) - .digest() - ); -} - -/** - * Hashes arbitrary-length byte strings to a list of one or more elements of a finite field F. - * [RFC 9380 5.2](https://www.rfc-editor.org/rfc/rfc9380#section-5.2). - * @param msg a byte string containing the message to hash - * @param count the number of elements of F to output - * @param options `{DST: string, p: bigint, m: number, k: number, expand: 'xmd' | 'xof', hash: H}`, see above - * @returns [u_0, ..., u_(count - 1)], a list of field elements. - */ -export function hash_to_field(msg: Uint8Array, count: number, options: H2COpts): bigint[][] { - validateObject(options, { - p: 'bigint', - m: 'number', - k: 'number', - hash: 'function', - }); - const { p, k, m, hash, expand, DST } = options; - asafenumber(hash.outputLen, 'valid hash'); - abytes(msg); - asafenumber(count); - const log2p = p.toString(2).length; - const L = Math.ceil((log2p + k) / 8); // section 5.1 of ietf draft link above - const len_in_bytes = count * m * L; - let prb; // pseudo_random_bytes - if (expand === 'xmd') { - prb = expand_message_xmd(msg, DST, len_in_bytes, hash); - } else if (expand === 'xof') { - prb = expand_message_xof(msg, DST, len_in_bytes, k, hash); - } else if (expand === '_internal_pass') { - // for internal tests only - prb = msg; - } else { - throw new Error('expand must be "xmd" or "xof"'); - } - const u = new Array(count); - for (let i = 0; i < count; i++) { - const e = new Array(m); - for (let j = 0; j < m; j++) { - const elm_offset = L * (j + i * m); - const tv = prb.subarray(elm_offset, elm_offset + L); - e[j] = mod(os2ip(tv), p); - } - u[i] = e; - } - return u; -} - -type XY = (x: T, y: T) => { x: T; y: T }; -type XYRatio = [T[], T[], T[], T[]]; // xn/xd, yn/yd -export function isogenyMap>(field: F, map: XYRatio): XY { - // Make same order as in spec - const coeff = map.map((i) => Array.from(i).reverse()); - return (x: T, y: T) => { - const [xn, xd, yn, yd] = coeff.map((val) => - val.reduce((acc, i) => field.add(field.mul(acc, x), i)) - ); - // 6.6.3 - // Exceptional cases of iso_map are inputs that cause the denominator of - // either rational function to evaluate to zero; such cases MUST return - // the identity point on E. - const [xd_inv, yd_inv] = FpInvertBatch(field, [xd, yd], true); - x = field.mul(xn, xd_inv); // xNum / xDen - y = field.mul(y, field.mul(yn, yd_inv)); // y * (yNum / yDev) - return { x, y }; - }; -} - -export const _DST_scalar: Uint8Array = asciiToBytes('HashToScalar-'); - -/** Creates hash-to-curve methods from EC Point and mapToCurve function. See {@link H2CHasher}. */ -export function createHasher( - Point: PC, - mapToCurve: MapToCurve>, - defaults: H2COpts & { encodeDST?: AsciiOrBytes } -): H2CHasher { - if (typeof mapToCurve !== 'function') throw new Error('mapToCurve() must be defined'); - function map(num: bigint[]): PC_P { - return Point.fromAffine(mapToCurve(num)) as PC_P; - } - function clear(initial: PC_P): PC_P { - const P = initial.clearCofactor(); - if (P.equals(Point.ZERO)) return Point.ZERO as PC_P; // zero will throw in assert - P.assertValidity(); - return P as PC_P; - } - - return { - defaults: Object.freeze(defaults), - Point, - - hashToCurve(msg: Uint8Array, options?: H2CDSTOpts): PC_P { - const opts = Object.assign({}, defaults, options); - const u = hash_to_field(msg, 2, opts); - const u0 = map(u[0]); - const u1 = map(u[1]); - return clear(u0.add(u1) as PC_P); - }, - encodeToCurve(msg: Uint8Array, options?: H2CDSTOpts): PC_P { - const optsDst = defaults.encodeDST ? { DST: defaults.encodeDST } : {}; - const opts = Object.assign({}, defaults, optsDst, options); - const u = hash_to_field(msg, 1, opts); - const u0 = map(u[0]); - return clear(u0); - }, - /** See {@link H2CHasher} */ - mapToCurve(scalars: bigint | bigint[]): PC_P { - // Curves with m=1 accept only single scalar - if (defaults.m === 1) { - if (typeof scalars !== 'bigint') throw new Error('expected bigint (m=1)'); - return clear(map([scalars])); - } - if (!Array.isArray(scalars)) throw new Error('expected array of bigints'); - for (const i of scalars) - if (typeof i !== 'bigint') throw new Error('expected array of bigints'); - return clear(map(scalars)); - }, - - // hash_to_scalar can produce 0: https://www.rfc-editor.org/errata/eid8393 - // RFC 9380, draft-irtf-cfrg-bbs-signatures-08 - hashToScalar(msg: Uint8Array, options?: H2CDSTOpts): bigint { - // @ts-ignore - const N = Point.Fn.ORDER; - const opts = Object.assign({}, defaults, { p: N, m: 1, DST: _DST_scalar }, options); - return hash_to_field(msg, 1, opts)[0][0]; - }, - }; -} diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/modular.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/modular.ts deleted file mode 100644 index 19e36927..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/modular.ts +++ /dev/null @@ -1,621 +0,0 @@ -/** - * Utils for modular division and fields. - * Field over 11 is a finite (Galois) field is integer number operations `mod 11`. - * There is no division: it is replaced by modular multiplicative inverse. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { - abytes, - anumber, - bytesToNumberBE, - bytesToNumberLE, - numberToBytesBE, - numberToBytesLE, - validateObject, -} from '../utils.ts'; - -// Numbers aren't used in x25519 / x448 builds -// prettier-ignore -const _0n = /* @__PURE__ */ BigInt(0), _1n = /* @__PURE__ */ BigInt(1), _2n = /* @__PURE__ */ BigInt(2); -// prettier-ignore -const _3n = /* @__PURE__ */ BigInt(3), _4n = /* @__PURE__ */ BigInt(4), _5n = /* @__PURE__ */ BigInt(5); -// prettier-ignore -const _7n = /* @__PURE__ */ BigInt(7), _8n = /* @__PURE__ */ BigInt(8), _9n = /* @__PURE__ */ BigInt(9); -const _16n = /* @__PURE__ */ BigInt(16); - -// Calculates a modulo b -export function mod(a: bigint, b: bigint): bigint { - const result = a % b; - return result >= _0n ? result : b + result; -} -/** - * Efficiently raise num to power and do modular division. - * Unsafe in some contexts: uses ladder, so can expose bigint bits. - * @example - * pow(2n, 6n, 11n) // 64n % 11n == 9n - */ -export function pow(num: bigint, power: bigint, modulo: bigint): bigint { - return FpPow(Field(modulo), num, power); -} - -/** Does `x^(2^power)` mod p. `pow2(30, 4)` == `30^(2^4)` */ -export function pow2(x: bigint, power: bigint, modulo: bigint): bigint { - let res = x; - while (power-- > _0n) { - res *= res; - res %= modulo; - } - return res; -} - -/** - * Inverses number over modulo. - * Implemented using [Euclidean GCD](https://brilliant.org/wiki/extended-euclidean-algorithm/). - */ -export function invert(number: bigint, modulo: bigint): bigint { - if (number === _0n) throw new Error('invert: expected non-zero number'); - if (modulo <= _0n) throw new Error('invert: expected positive modulus, got ' + modulo); - // Fermat's little theorem "CT-like" version inv(n) = n^(m-2) mod m is 30x slower. - let a = mod(number, modulo); - let b = modulo; - // prettier-ignore - let x = _0n, y = _1n, u = _1n, v = _0n; - while (a !== _0n) { - // JIT applies optimization if those two lines follow each other - const q = b / a; - const r = b % a; - const m = x - u * q; - const n = y - v * q; - // prettier-ignore - b = a, a = r, x = u, y = v, u = m, v = n; - } - const gcd = b; - if (gcd !== _1n) throw new Error('invert: does not exist'); - return mod(x, modulo); -} - -function assertIsSquare(Fp: IField, root: T, n: T): void { - if (!Fp.eql(Fp.sqr(root), n)) throw new Error('Cannot find square root'); -} - -// Not all roots are possible! Example which will throw: -// const NUM = -// n = 72057594037927816n; -// Fp = Field(BigInt('0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab')); -function sqrt3mod4(Fp: IField, n: T) { - const p1div4 = (Fp.ORDER + _1n) / _4n; - const root = Fp.pow(n, p1div4); - assertIsSquare(Fp, root, n); - return root; -} - -function sqrt5mod8(Fp: IField, n: T) { - const p5div8 = (Fp.ORDER - _5n) / _8n; - const n2 = Fp.mul(n, _2n); - const v = Fp.pow(n2, p5div8); - const nv = Fp.mul(n, v); - const i = Fp.mul(Fp.mul(nv, _2n), v); - const root = Fp.mul(nv, Fp.sub(i, Fp.ONE)); - assertIsSquare(Fp, root, n); - return root; -} - -// Based on RFC9380, Kong algorithm -// prettier-ignore -function sqrt9mod16(P: bigint): (Fp: IField, n: T) => T { - const Fp_ = Field(P); - const tn = tonelliShanks(P); - const c1 = tn(Fp_, Fp_.neg(Fp_.ONE));// 1. c1 = sqrt(-1) in F, i.e., (c1^2) == -1 in F - const c2 = tn(Fp_, c1); // 2. c2 = sqrt(c1) in F, i.e., (c2^2) == c1 in F - const c3 = tn(Fp_, Fp_.neg(c1)); // 3. c3 = sqrt(-c1) in F, i.e., (c3^2) == -c1 in F - const c4 = (P + _7n) / _16n; // 4. c4 = (q + 7) / 16 # Integer arithmetic - return (Fp: IField, n: T) => { - let tv1 = Fp.pow(n, c4); // 1. tv1 = x^c4 - let tv2 = Fp.mul(tv1, c1); // 2. tv2 = c1 * tv1 - const tv3 = Fp.mul(tv1, c2); // 3. tv3 = c2 * tv1 - const tv4 = Fp.mul(tv1, c3); // 4. tv4 = c3 * tv1 - const e1 = Fp.eql(Fp.sqr(tv2), n); // 5. e1 = (tv2^2) == x - const e2 = Fp.eql(Fp.sqr(tv3), n); // 6. e2 = (tv3^2) == x - tv1 = Fp.cmov(tv1, tv2, e1); // 7. tv1 = CMOV(tv1, tv2, e1) # Select tv2 if (tv2^2) == x - tv2 = Fp.cmov(tv4, tv3, e2); // 8. tv2 = CMOV(tv4, tv3, e2) # Select tv3 if (tv3^2) == x - const e3 = Fp.eql(Fp.sqr(tv2), n); // 9. e3 = (tv2^2) == x - const root = Fp.cmov(tv1, tv2, e3);// 10. z = CMOV(tv1, tv2, e3) # Select sqrt from tv1 & tv2 - assertIsSquare(Fp, root, n); - return root; - }; -} - -/** - * Tonelli-Shanks square root search algorithm. - * 1. https://eprint.iacr.org/2012/685.pdf (page 12) - * 2. Square Roots from 1; 24, 51, 10 to Dan Shanks - * @param P field order - * @returns function that takes field Fp (created from P) and number n - */ -export function tonelliShanks(P: bigint): (Fp: IField, n: T) => T { - // Initialization (precomputation). - // Caching initialization could boost perf by 7%. - if (P < _3n) throw new Error('sqrt is not defined for small field'); - // Factor P - 1 = Q * 2^S, where Q is odd - let Q = P - _1n; - let S = 0; - while (Q % _2n === _0n) { - Q /= _2n; - S++; - } - - // Find the first quadratic non-residue Z >= 2 - let Z = _2n; - const _Fp = Field(P); - while (FpLegendre(_Fp, Z) === 1) { - // Basic primality test for P. After x iterations, chance of - // not finding quadratic non-residue is 2^x, so 2^1000. - if (Z++ > 1000) throw new Error('Cannot find square root: probably non-prime P'); - } - // Fast-path; usually done before Z, but we do "primality test". - if (S === 1) return sqrt3mod4; - - // Slow-path - // TODO: test on Fp2 and others - let cc = _Fp.pow(Z, Q); // c = z^Q - const Q1div2 = (Q + _1n) / _2n; - return function tonelliSlow(Fp: IField, n: T): T { - if (Fp.is0(n)) return n; - // Check if n is a quadratic residue using Legendre symbol - if (FpLegendre(Fp, n) !== 1) throw new Error('Cannot find square root'); - - // Initialize variables for the main loop - let M = S; - let c = Fp.mul(Fp.ONE, cc); // c = z^Q, move cc from field _Fp into field Fp - let t = Fp.pow(n, Q); // t = n^Q, first guess at the fudge factor - let R = Fp.pow(n, Q1div2); // R = n^((Q+1)/2), first guess at the square root - - // Main loop - // while t != 1 - while (!Fp.eql(t, Fp.ONE)) { - if (Fp.is0(t)) return Fp.ZERO; // if t=0 return R=0 - let i = 1; - - // Find the smallest i >= 1 such that t^(2^i) ≡ 1 (mod P) - let t_tmp = Fp.sqr(t); // t^(2^1) - while (!Fp.eql(t_tmp, Fp.ONE)) { - i++; - t_tmp = Fp.sqr(t_tmp); // t^(2^2)... - if (i === M) throw new Error('Cannot find square root'); - } - - // Calculate the exponent for b: 2^(M - i - 1) - const exponent = _1n << BigInt(M - i - 1); // bigint is important - const b = Fp.pow(c, exponent); // b = 2^(M - i - 1) - - // Update variables - M = i; - c = Fp.sqr(b); // c = b^2 - t = Fp.mul(t, c); // t = (t * b^2) - R = Fp.mul(R, b); // R = R*b - } - return R; - }; -} - -/** - * Square root for a finite field. Will try optimized versions first: - * - * 1. P ≡ 3 (mod 4) - * 2. P ≡ 5 (mod 8) - * 3. P ≡ 9 (mod 16) - * 4. Tonelli-Shanks algorithm - * - * Different algorithms can give different roots, it is up to user to decide which one they want. - * For example there is FpSqrtOdd/FpSqrtEven to choice root based on oddness (used for hash-to-curve). - */ -export function FpSqrt(P: bigint): (Fp: IField, n: T) => T { - // P ≡ 3 (mod 4) => √n = n^((P+1)/4) - if (P % _4n === _3n) return sqrt3mod4; - // P ≡ 5 (mod 8) => Atkin algorithm, page 10 of https://eprint.iacr.org/2012/685.pdf - if (P % _8n === _5n) return sqrt5mod8; - // P ≡ 9 (mod 16) => Kong algorithm, page 11 of https://eprint.iacr.org/2012/685.pdf (algorithm 4) - if (P % _16n === _9n) return sqrt9mod16(P); - // Tonelli-Shanks algorithm - return tonelliShanks(P); -} - -// Little-endian check for first LE bit (last BE bit); -export const isNegativeLE = (num: bigint, modulo: bigint): boolean => - (mod(num, modulo) & _1n) === _1n; - -/** Field is not always over prime: for example, Fp2 has ORDER(q)=p^m. */ -export interface IField { - ORDER: bigint; - BYTES: number; - BITS: number; - isLE: boolean; - ZERO: T; - ONE: T; - // 1-arg - create: (num: T) => T; - isValid: (num: T) => boolean; - is0: (num: T) => boolean; - isValidNot0: (num: T) => boolean; - neg(num: T): T; - inv(num: T): T; - sqrt(num: T): T; - sqr(num: T): T; - // 2-args - eql(lhs: T, rhs: T): boolean; - add(lhs: T, rhs: T): T; - sub(lhs: T, rhs: T): T; - mul(lhs: T, rhs: T | bigint): T; - pow(lhs: T, power: bigint): T; - div(lhs: T, rhs: T | bigint): T; - // N for NonNormalized (for now) - addN(lhs: T, rhs: T): T; - subN(lhs: T, rhs: T): T; - mulN(lhs: T, rhs: T | bigint): T; - sqrN(num: T): T; - - // Optional - // Should be same as sgn0 function in - // [RFC9380](https://www.rfc-editor.org/rfc/rfc9380#section-4.1). - // NOTE: sgn0 is 'negative in LE', which is same as odd. And negative in LE is kinda strange definition anyway. - isOdd?(num: T): boolean; // Odd instead of even since we have it for Fp2 - // legendre?(num: T): T; - invertBatch: (lst: T[]) => T[]; - toBytes(num: T): Uint8Array; - fromBytes(bytes: Uint8Array, skipValidation?: boolean): T; - // If c is False, CMOV returns a, otherwise it returns b. - cmov(a: T, b: T, c: boolean): T; -} -// prettier-ignore -const FIELD_FIELDS = [ - 'create', 'isValid', 'is0', 'neg', 'inv', 'sqrt', 'sqr', - 'eql', 'add', 'sub', 'mul', 'pow', 'div', - 'addN', 'subN', 'mulN', 'sqrN' -] as const; -export function validateField(field: IField): IField { - const initial = { - ORDER: 'bigint', - BYTES: 'number', - BITS: 'number', - } as Record; - const opts = FIELD_FIELDS.reduce((map, val: string) => { - map[val] = 'function'; - return map; - }, initial); - validateObject(field, opts); - // const max = 16384; - // if (field.BYTES < 1 || field.BYTES > max) throw new Error('invalid field'); - // if (field.BITS < 1 || field.BITS > 8 * max) throw new Error('invalid field'); - return field; -} - -// Generic field functions - -/** - * Same as `pow` but for Fp: non-constant-time. - * Unsafe in some contexts: uses ladder, so can expose bigint bits. - */ -export function FpPow(Fp: IField, num: T, power: bigint): T { - if (power < _0n) throw new Error('invalid exponent, negatives unsupported'); - if (power === _0n) return Fp.ONE; - if (power === _1n) return num; - let p = Fp.ONE; - let d = num; - while (power > _0n) { - if (power & _1n) p = Fp.mul(p, d); - d = Fp.sqr(d); - power >>= _1n; - } - return p; -} - -/** - * Efficiently invert an array of Field elements. - * Exception-free. Will return `undefined` for 0 elements. - * @param passZero map 0 to 0 (instead of undefined) - */ -export function FpInvertBatch(Fp: IField, nums: T[], passZero = false): T[] { - const inverted = new Array(nums.length).fill(passZero ? Fp.ZERO : undefined); - // Walk from first to last, multiply them by each other MOD p - const multipliedAcc = nums.reduce((acc, num, i) => { - if (Fp.is0(num)) return acc; - inverted[i] = acc; - return Fp.mul(acc, num); - }, Fp.ONE); - // Invert last element - const invertedAcc = Fp.inv(multipliedAcc); - // Walk from last to first, multiply them by inverted each other MOD p - nums.reduceRight((acc, num, i) => { - if (Fp.is0(num)) return acc; - inverted[i] = Fp.mul(acc, inverted[i]); - return Fp.mul(acc, num); - }, invertedAcc); - return inverted; -} - -// TODO: remove -export function FpDiv(Fp: IField, lhs: T, rhs: T | bigint): T { - return Fp.mul(lhs, typeof rhs === 'bigint' ? invert(rhs, Fp.ORDER) : Fp.inv(rhs)); -} - -/** - * Legendre symbol. - * Legendre constant is used to calculate Legendre symbol (a | p) - * which denotes the value of a^((p-1)/2) (mod p). - * - * * (a | p) ≡ 1 if a is a square (mod p), quadratic residue - * * (a | p) ≡ -1 if a is not a square (mod p), quadratic non residue - * * (a | p) ≡ 0 if a ≡ 0 (mod p) - */ -export function FpLegendre(Fp: IField, n: T): -1 | 0 | 1 { - // We can use 3rd argument as optional cache of this value - // but seems unneeded for now. The operation is very fast. - const p1mod2 = (Fp.ORDER - _1n) / _2n; - const powered = Fp.pow(n, p1mod2); - const yes = Fp.eql(powered, Fp.ONE); - const zero = Fp.eql(powered, Fp.ZERO); - const no = Fp.eql(powered, Fp.neg(Fp.ONE)); - if (!yes && !zero && !no) throw new Error('invalid Legendre symbol result'); - return yes ? 1 : zero ? 0 : -1; -} - -// This function returns True whenever the value x is a square in the field F. -export function FpIsSquare(Fp: IField, n: T): boolean { - const l = FpLegendre(Fp, n); - return l === 1; -} - -export type NLength = { nByteLength: number; nBitLength: number }; -// CURVE.n lengths -export function nLength(n: bigint, nBitLength?: number): NLength { - // Bit size, byte size of CURVE.n - if (nBitLength !== undefined) anumber(nBitLength); - const _nBitLength = nBitLength !== undefined ? nBitLength : n.toString(2).length; - const nByteLength = Math.ceil(_nBitLength / 8); - return { nBitLength: _nBitLength, nByteLength }; -} - -type FpField = IField & Required, 'isOdd'>>; -type SqrtFn = (n: bigint) => bigint; -type FieldOpts = Partial<{ - isLE: boolean; - BITS: number; - sqrt: SqrtFn; - allowedLengths?: readonly number[]; // for P521 (adds padding for smaller sizes) - modFromBytes: boolean; // bls12-381 requires mod(n) instead of rejecting keys >= n -}>; -class _Field implements IField { - readonly ORDER: bigint; - readonly BITS: number; - readonly BYTES: number; - readonly isLE: boolean; - readonly ZERO = _0n; - readonly ONE = _1n; - readonly _lengths?: number[]; - private _sqrt: ReturnType | undefined; // cached sqrt - private readonly _mod?: boolean; - constructor(ORDER: bigint, opts: FieldOpts = {}) { - if (ORDER <= _0n) throw new Error('invalid field: expected ORDER > 0, got ' + ORDER); - let _nbitLength: number | undefined = undefined; - this.isLE = false; - if (opts != null && typeof opts === 'object') { - if (typeof opts.BITS === 'number') _nbitLength = opts.BITS; - if (typeof opts.sqrt === 'function') this.sqrt = opts.sqrt; - if (typeof opts.isLE === 'boolean') this.isLE = opts.isLE; - if (opts.allowedLengths) this._lengths = opts.allowedLengths?.slice(); - if (typeof opts.modFromBytes === 'boolean') this._mod = opts.modFromBytes; - } - const { nBitLength, nByteLength } = nLength(ORDER, _nbitLength); - if (nByteLength > 2048) throw new Error('invalid field: expected ORDER of <= 2048 bytes'); - this.ORDER = ORDER; - this.BITS = nBitLength; - this.BYTES = nByteLength; - this._sqrt = undefined; - Object.preventExtensions(this); - } - - create(num: bigint) { - return mod(num, this.ORDER); - } - isValid(num: bigint) { - if (typeof num !== 'bigint') - throw new Error('invalid field element: expected bigint, got ' + typeof num); - return _0n <= num && num < this.ORDER; // 0 is valid element, but it's not invertible - } - is0(num: bigint) { - return num === _0n; - } - // is valid and invertible - isValidNot0(num: bigint) { - return !this.is0(num) && this.isValid(num); - } - isOdd(num: bigint) { - return (num & _1n) === _1n; - } - neg(num: bigint) { - return mod(-num, this.ORDER); - } - eql(lhs: bigint, rhs: bigint) { - return lhs === rhs; - } - - sqr(num: bigint) { - return mod(num * num, this.ORDER); - } - add(lhs: bigint, rhs: bigint) { - return mod(lhs + rhs, this.ORDER); - } - sub(lhs: bigint, rhs: bigint) { - return mod(lhs - rhs, this.ORDER); - } - mul(lhs: bigint, rhs: bigint) { - return mod(lhs * rhs, this.ORDER); - } - pow(num: bigint, power: bigint): bigint { - return FpPow(this, num, power); - } - div(lhs: bigint, rhs: bigint) { - return mod(lhs * invert(rhs, this.ORDER), this.ORDER); - } - - // Same as above, but doesn't normalize - sqrN(num: bigint) { - return num * num; - } - addN(lhs: bigint, rhs: bigint) { - return lhs + rhs; - } - subN(lhs: bigint, rhs: bigint) { - return lhs - rhs; - } - mulN(lhs: bigint, rhs: bigint) { - return lhs * rhs; - } - - inv(num: bigint) { - return invert(num, this.ORDER); - } - sqrt(num: bigint): bigint { - // Caching _sqrt speeds up sqrt9mod16 by 5x and tonneli-shanks by 10% - if (!this._sqrt) this._sqrt = FpSqrt(this.ORDER); - return this._sqrt(this, num); - } - toBytes(num: bigint) { - return this.isLE ? numberToBytesLE(num, this.BYTES) : numberToBytesBE(num, this.BYTES); - } - fromBytes(bytes: Uint8Array, skipValidation = false) { - abytes(bytes); - const { _lengths: allowedLengths, BYTES, isLE, ORDER, _mod: modFromBytes } = this; - if (allowedLengths) { - if (!allowedLengths.includes(bytes.length) || bytes.length > BYTES) { - throw new Error( - 'Field.fromBytes: expected ' + allowedLengths + ' bytes, got ' + bytes.length - ); - } - const padded = new Uint8Array(BYTES); - // isLE add 0 to right, !isLE to the left. - padded.set(bytes, isLE ? 0 : padded.length - bytes.length); - bytes = padded; - } - if (bytes.length !== BYTES) - throw new Error('Field.fromBytes: expected ' + BYTES + ' bytes, got ' + bytes.length); - let scalar = isLE ? bytesToNumberLE(bytes) : bytesToNumberBE(bytes); - if (modFromBytes) scalar = mod(scalar, ORDER); - if (!skipValidation) - if (!this.isValid(scalar)) - throw new Error('invalid field element: outside of range 0..ORDER'); - // NOTE: we don't validate scalar here, please use isValid. This done such way because some - // protocol may allow non-reduced scalar that reduced later or changed some other way. - return scalar; - } - // TODO: we don't need it here, move out to separate fn - invertBatch(lst: bigint[]): bigint[] { - return FpInvertBatch(this, lst); - } - // We can't move this out because Fp6, Fp12 implement it - // and it's unclear what to return in there. - cmov(a: bigint, b: bigint, condition: boolean) { - return condition ? b : a; - } -} - -/** - * Creates a finite field. Major performance optimizations: - * * 1. Denormalized operations like mulN instead of mul. - * * 2. Identical object shape: never add or remove keys. - * * 3. `Object.freeze`. - * Fragile: always run a benchmark on a change. - * Security note: operations don't check 'isValid' for all elements for performance reasons, - * it is caller responsibility to check this. - * This is low-level code, please make sure you know what you're doing. - * - * Note about field properties: - * * CHARACTERISTIC p = prime number, number of elements in main subgroup. - * * ORDER q = similar to cofactor in curves, may be composite `q = p^m`. - * - * @param ORDER field order, probably prime, or could be composite - * @param bitLen how many bits the field consumes - * @param isLE (default: false) if encoding / decoding should be in little-endian - * @param redef optional faster redefinitions of sqrt and other methods - */ -export function Field(ORDER: bigint, opts: FieldOpts = {}): Readonly { - return new _Field(ORDER, opts); -} - -// Generic random scalar, we can do same for other fields if via Fp2.mul(Fp2.ONE, Fp2.random)? -// This allows unsafe methods like ignore bias or zero. These unsafe, but often used in different protocols (if deterministic RNG). -// which mean we cannot force this via opts. -// Not sure what to do with randomBytes, we can accept it inside opts if wanted. -// Probably need to export getMinHashLength somewhere? -// random(bytes?: Uint8Array, unsafeAllowZero = false, unsafeAllowBias = false) { -// const LEN = !unsafeAllowBias ? getMinHashLength(ORDER) : BYTES; -// if (bytes === undefined) bytes = randomBytes(LEN); // _opts.randomBytes? -// const num = isLE ? bytesToNumberLE(bytes) : bytesToNumberBE(bytes); -// // `mod(x, 11)` can sometimes produce 0. `mod(x, 10) + 1` is the same, but no 0 -// const reduced = unsafeAllowZero ? mod(num, ORDER) : mod(num, ORDER - _1n) + _1n; -// return reduced; -// }, - -export function FpSqrtOdd(Fp: IField, elm: T): T { - if (!Fp.isOdd) throw new Error("Field doesn't have isOdd"); - const root = Fp.sqrt(elm); - return Fp.isOdd(root) ? root : Fp.neg(root); -} - -export function FpSqrtEven(Fp: IField, elm: T): T { - if (!Fp.isOdd) throw new Error("Field doesn't have isOdd"); - const root = Fp.sqrt(elm); - return Fp.isOdd(root) ? Fp.neg(root) : root; -} - -/** - * Returns total number of bytes consumed by the field element. - * For example, 32 bytes for usual 256-bit weierstrass curve. - * @param fieldOrder number of field elements, usually CURVE.n - * @returns byte length of field - */ -export function getFieldBytesLength(fieldOrder: bigint): number { - if (typeof fieldOrder !== 'bigint') throw new Error('field order must be bigint'); - const bitLength = fieldOrder.toString(2).length; - return Math.ceil(bitLength / 8); -} - -/** - * Returns minimal amount of bytes that can be safely reduced - * by field order. - * Should be 2^-128 for 128-bit curve such as P256. - * @param fieldOrder number of field elements, usually CURVE.n - * @returns byte length of target hash - */ -export function getMinHashLength(fieldOrder: bigint): number { - const length = getFieldBytesLength(fieldOrder); - return length + Math.ceil(length / 2); -} - -/** - * "Constant-time" private key generation utility. - * Can take (n + n/2) or more bytes of uniform input e.g. from CSPRNG or KDF - * and convert them into private scalar, with the modulo bias being negligible. - * Needs at least 48 bytes of input for 32-byte private key. - * https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/ - * FIPS 186-5, A.2 https://csrc.nist.gov/publications/detail/fips/186/5/final - * RFC 9380, https://www.rfc-editor.org/rfc/rfc9380#section-5 - * @param hash hash output from SHA3 or a similar function - * @param groupOrder size of subgroup - (e.g. secp256k1.Point.Fn.ORDER) - * @param isLE interpret hash bytes as LE num - * @returns valid private scalar - */ -export function mapHashToField(key: Uint8Array, fieldOrder: bigint, isLE = false): Uint8Array { - abytes(key); - const len = key.length; - const fieldLen = getFieldBytesLength(fieldOrder); - const minLen = getMinHashLength(fieldOrder); - // No small numbers: need to understand bias story. No huge numbers: easier to detect JS timings. - if (len < 16 || len < minLen || len > 1024) - throw new Error('expected ' + minLen + '-1024 bytes of input, got ' + len); - const num = isLE ? bytesToNumberLE(key) : bytesToNumberBE(key); - // `mod(x, 11)` can sometimes produce 0. `mod(x, 10) + 1` is the same, but no 0 - const reduced = mod(num, fieldOrder - _1n) + _1n; - return isLE ? numberToBytesLE(reduced, fieldLen) : numberToBytesBE(reduced, fieldLen); -} diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/montgomery.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/montgomery.ts deleted file mode 100644 index ac3ec2f6..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/montgomery.ts +++ /dev/null @@ -1,187 +0,0 @@ -/** - * Montgomery curve methods. It's not really whole montgomery curve, - * just bunch of very specific methods for X25519 / X448 from - * [RFC 7748](https://www.rfc-editor.org/rfc/rfc7748) - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { - abytes, - aInRange, - bytesToNumberLE, - copyBytes, - numberToBytesLE, - randomBytes, - validateObject, - type CryptoKeys, -} from '../utils.ts'; -import { createKeygen, type CurveLengths } from './curve.ts'; -import { mod } from './modular.ts'; - -const _0n = BigInt(0); -const _1n = BigInt(1); -const _2n = BigInt(2); - -export type MontgomeryOpts = { - P: bigint; // finite field prime - type: 'x25519' | 'x448'; - adjustScalarBytes: (bytes: Uint8Array) => Uint8Array; - powPminus2: (x: bigint) => bigint; - randomBytes?: (bytesLength?: number) => Uint8Array; -}; - -export type MontgomeryECDH = { - scalarMult: (scalar: Uint8Array, u: Uint8Array) => Uint8Array; - scalarMultBase: (scalar: Uint8Array) => Uint8Array; - getSharedSecret: (secretKeyA: Uint8Array, publicKeyB: Uint8Array) => Uint8Array; - getPublicKey: (secretKey: Uint8Array) => Uint8Array; - utils: { - randomSecretKey: () => Uint8Array; - }; - GuBytes: Uint8Array; - lengths: CurveLengths; - keygen: (seed?: Uint8Array) => { secretKey: Uint8Array; publicKey: Uint8Array }; -}; - -function validateOpts(curve: MontgomeryOpts) { - validateObject(curve, { - adjustScalarBytes: 'function', - powPminus2: 'function', - }); - return Object.freeze({ ...curve } as const); -} - -export function montgomery(curveDef: MontgomeryOpts): MontgomeryECDH { - const CURVE = validateOpts(curveDef); - const { P, type, adjustScalarBytes, powPminus2, randomBytes: rand } = CURVE; - const is25519 = type === 'x25519'; - if (!is25519 && type !== 'x448') throw new Error('invalid type'); - const randomBytes_ = rand || randomBytes; - - const montgomeryBits = is25519 ? 255 : 448; - const fieldLen = is25519 ? 32 : 56; - const Gu = is25519 ? BigInt(9) : BigInt(5); - // RFC 7748 #5: - // The constant a24 is (486662 - 2) / 4 = 121665 for curve25519/X25519 and - // (156326 - 2) / 4 = 39081 for curve448/X448 - // const a = is25519 ? 156326n : 486662n; - const a24 = is25519 ? BigInt(121665) : BigInt(39081); - // RFC: x25519 "the resulting integer is of the form 2^254 plus - // eight times a value between 0 and 2^251 - 1 (inclusive)" - // x448: "2^447 plus four times a value between 0 and 2^445 - 1 (inclusive)" - const minScalar = is25519 ? _2n ** BigInt(254) : _2n ** BigInt(447); - const maxAdded = is25519 - ? BigInt(8) * _2n ** BigInt(251) - _1n - : BigInt(4) * _2n ** BigInt(445) - _1n; - const maxScalar = minScalar + maxAdded + _1n; // (inclusive) - const modP = (n: bigint) => mod(n, P); - const GuBytes = encodeU(Gu); - function encodeU(u: bigint): Uint8Array { - return numberToBytesLE(modP(u), fieldLen); - } - function decodeU(u: Uint8Array): bigint { - const _u = copyBytes(abytes(u, fieldLen, 'uCoordinate')); - // RFC: When receiving such an array, implementations of X25519 - // (but not X448) MUST mask the most significant bit in the final byte. - if (is25519) _u[31] &= 127; // 0b0111_1111 - // RFC: Implementations MUST accept non-canonical values and process them as - // if they had been reduced modulo the field prime. The non-canonical - // values are 2^255 - 19 through 2^255 - 1 for X25519 and 2^448 - 2^224 - // - 1 through 2^448 - 1 for X448. - return modP(bytesToNumberLE(_u)); - } - function decodeScalar(scalar: Uint8Array): bigint { - return bytesToNumberLE(adjustScalarBytes(copyBytes(abytes(scalar, fieldLen, 'scalar')))); - } - function scalarMult(scalar: Uint8Array, u: Uint8Array): Uint8Array { - const pu = montgomeryLadder(decodeU(u), decodeScalar(scalar)); - // Some public keys are useless, of low-order. Curve author doesn't think - // it needs to be validated, but we do it nonetheless. - // https://cr.yp.to/ecdh.html#validate - if (pu === _0n) throw new Error('invalid private or public key received'); - return encodeU(pu); - } - // Computes public key from private. By doing scalar multiplication of base point. - function scalarMultBase(scalar: Uint8Array): Uint8Array { - return scalarMult(scalar, GuBytes); - } - const getPublicKey = scalarMultBase; - const getSharedSecret = scalarMult; - - // cswap from RFC7748 "example code" - function cswap(swap: bigint, x_2: bigint, x_3: bigint): { x_2: bigint; x_3: bigint } { - // dummy = mask(swap) AND (x_2 XOR x_3) - // Where mask(swap) is the all-1 or all-0 word of the same length as x_2 - // and x_3, computed, e.g., as mask(swap) = 0 - swap. - const dummy = modP(swap * (x_2 - x_3)); - x_2 = modP(x_2 - dummy); // x_2 = x_2 XOR dummy - x_3 = modP(x_3 + dummy); // x_3 = x_3 XOR dummy - return { x_2, x_3 }; - } - - /** - * Montgomery x-only multiplication ladder. - * @param pointU u coordinate (x) on Montgomery Curve 25519 - * @param scalar by which the point would be multiplied - * @returns new Point on Montgomery curve - */ - function montgomeryLadder(u: bigint, scalar: bigint): bigint { - aInRange('u', u, _0n, P); - aInRange('scalar', scalar, minScalar, maxScalar); - const k = scalar; - const x_1 = u; - let x_2 = _1n; - let z_2 = _0n; - let x_3 = u; - let z_3 = _1n; - let swap = _0n; - for (let t = BigInt(montgomeryBits - 1); t >= _0n; t--) { - const k_t = (k >> t) & _1n; - swap ^= k_t; - ({ x_2, x_3 } = cswap(swap, x_2, x_3)); - ({ x_2: z_2, x_3: z_3 } = cswap(swap, z_2, z_3)); - swap = k_t; - - const A = x_2 + z_2; - const AA = modP(A * A); - const B = x_2 - z_2; - const BB = modP(B * B); - const E = AA - BB; - const C = x_3 + z_3; - const D = x_3 - z_3; - const DA = modP(D * A); - const CB = modP(C * B); - const dacb = DA + CB; - const da_cb = DA - CB; - x_3 = modP(dacb * dacb); - z_3 = modP(x_1 * modP(da_cb * da_cb)); - x_2 = modP(AA * BB); - z_2 = modP(E * (AA + modP(a24 * E))); - } - ({ x_2, x_3 } = cswap(swap, x_2, x_3)); - ({ x_2: z_2, x_3: z_3 } = cswap(swap, z_2, z_3)); - const z2 = powPminus2(z_2); // `Fp.pow(x, P - _2n)` is much slower equivalent - return modP(x_2 * z2); // Return x_2 * (z_2^(p - 2)) - } - const lengths = { - secretKey: fieldLen, - publicKey: fieldLen, - seed: fieldLen, - }; - const randomSecretKey = (seed = randomBytes_(fieldLen)) => { - abytes(seed, lengths.seed, 'seed'); - return seed; - }; - const utils = { randomSecretKey }; - - return Object.freeze({ - keygen: createKeygen(randomSecretKey, getPublicKey), - getSharedSecret, - getPublicKey, - scalarMult, - scalarMultBase, - utils, - GuBytes: GuBytes.slice(), - lengths, - }) satisfies CryptoKeys; -} diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/oprf.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/oprf.ts deleted file mode 100644 index 49016758..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/oprf.ts +++ /dev/null @@ -1,600 +0,0 @@ -/** - * RFC 9497: Oblivious Pseudorandom Functions (OPRFs) Using Prime-Order Groups. - * https://www.rfc-editor.org/rfc/rfc9497 - * - -OPRF allows to interactively create an `Output = PRF(Input, serverSecretKey)`: - -- Server cannot calculate Output by itself: it doesn't know Input -- Client cannot calculate Output by itself: it doesn't know server secretKey -- An attacker interception the communication can't restore Input/Output/serverSecretKey and can't - link Input to some value. - -## Issues - -- Low-entropy inputs (e.g. password '123') enable brute-forced dictionary attacks by the server - (solveable by domain separation in POPRF) -- High-level protocol needs to be constructed on top, because OPRF is low-level - -## Use cases - -1. **Password-Authenticated Key Exchange (PAKE):** Enables secure password login (e.g., OPAQUE) - without revealing the password to the server. -2. **Private Set Intersection (PSI):** Allows two parties to compute the intersection of their - private sets without revealing non-intersecting elements. -3. **Anonymous Credential Systems:** Supports issuance of anonymous, unlinkable credentials - (e.g., Privacy Pass) using blind OPRF evaluation. -4. **Private Information Retrieval (PIR):** Helps users query databases without revealing which - item they accessed. -5. **Encrypted Search / Secure Indexing:** Enables keyword search over encrypted data while keeping - queries private. -6. **Spam Prevention and Rate-Limiting:** Issues anonymous tokens to prevent abuse - (e.g., CAPTCHA bypass) without compromising user privacy. - -## Modes - -- OPRF: simple mode, client doesn't need to know server public key -- VOPRF: verifable mode, allows client to verify that server used secret key corresponding to known public key -- POPRF: partially oblivious mode, VOPRF + domain separation - -There is also non-interactive mode (Evaluate) that supports creating Output in non-interactive mode with knowledge of secret key. - -Flow: -- (once) Server generates secret and public keys, distributes public keys to clients - - deterministically: `deriveKeyPair` or just random: `generateKeyPair` -- Client blinds input: `blind(secretInput)` -- Server evaluates blinded input: `blindEvaluate` generated by client, sends result to client -- Client creates output using result of evaluation via 'finalize' - - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { - abytes, - asciiToBytes, - bytesToNumberBE, - bytesToNumberLE, - concatBytes, - numberToBytesBE, - randomBytes, - validateObject, -} from '../utils.ts'; -import { pippenger, type CurvePoint, type CurvePointCons } from './curve.ts'; -import { _DST_scalar, type H2CDSTOpts } from './hash-to-curve.ts'; -import { getMinHashLength, mapHashToField } from './modular.ts'; - -// OPRF is designed to be used across network, so we default to serialized values. -export type PointBytes = Uint8Array; -export type ScalarBytes = Uint8Array; -export type Bytes = Uint8Array; -export type RNG = typeof randomBytes; - -export type OPRFOpts

> = { - name: string; - Point: CurvePointCons

; // we don't return Point, so we need generic interface only - // Fn: IField; - hash(msg: Bytes): Bytes; - hashToScalar(msg: Uint8Array, options: H2CDSTOpts): bigint; - hashToGroup(msg: Uint8Array, options: H2CDSTOpts): P; -}; - -export type OPRFKeys = { secretKey: ScalarBytes; publicKey: PointBytes }; -export type OPRFBlind = { blind: Uint8Array; blinded: Uint8Array }; -export type OPRFBlindEval = { evaluated: PointBytes; proof: Bytes }; -export type OPRFBlindEvalBatch = { evaluated: PointBytes[]; proof: Bytes }; -export type OPRFFinalizeItem = { - input: Bytes; - blind: ScalarBytes; - evaluated: PointBytes; - blinded: PointBytes; -}; - -/** - * Represents a full OPRF ciphersuite implementation according to RFC 9497. - * This object bundles the three protocol variants (OPRF, VOPRF, POPRF) for a specific - * prime-order group and hash function combination. - * - * @see https://www.rfc-editor.org/rfc/rfc9497.html - */ -export type OPRF = { - /** - * The unique identifier for the ciphersuite, e.g., "ristretto255-SHA512". - * This name is used for domain separation to prevent cross-protocol attacks. - */ - readonly name: string; - - /** - * The base Oblivious Pseudorandom Function (OPRF) mode (mode 0x00). - * This is a two-party protocol between a client and a server to compute F(k, x) - * where 'k' is the server's key and 'x' is the client's input. - * - * The client learns the output F(k, x) but nothing about 'k'. - * The server learns nothing about 'x' or F(k, x). - * This mode is NOT verifiable; the client cannot prove the server used a specific key. - */ - readonly oprf: { - /** - * (Server-side) Generates a new random private/public key pair for the server. - * @returns A new key pair. - */ - generateKeyPair(): OPRFKeys; - - /** - * (Server-side) Deterministically derives a private/public key pair from a seed. - * @param seed A 32-byte cryptographically secure random seed. - * @param keyInfo An optional byte string for domain separation. - * @returns The derived key pair. - */ - deriveKeyPair(seed: Bytes, keyInfo: Bytes): OPRFKeys; - - /** - * (Client-side) The first step of the protocol. The client blinds its private input. - * @param input The client's private input bytes. - * @param rng An optional cryptographically secure random number generator. - * @returns An object containing the `blind` scalar (which the client MUST keep secret) - * and the `blinded` element (which the client sends to the server). - */ - blind(input: Bytes, rng?: RNG): OPRFBlind; - - /** - * (Server-side) The second step. The server evaluates the client's blinded element - * using its secret key. - * @param secretKey The server's private key. - * @param blinded The blinded group element received from the client. - * @returns The evaluated group element, to be sent back to the client. - */ - blindEvaluate(secretKey: ScalarBytes, blinded: PointBytes): PointBytes; - - /** - * (Client-side) The final step. The client unblinds the server's response to - * compute the final OPRF output. - * @param input The original private input from the `blind` step. - * @param blind The secret scalar from the `blind` step. - * @param evaluated The evaluated group element received from the server. - * @returns The final OPRF output, `Hash(len(input)||input||len(unblinded)||unblinded||"Finalize")`. - */ - finalize(input: Bytes, blind: ScalarBytes, evaluated: PointBytes): Bytes; - }; - - /** - * The Verifiable Oblivious Pseudorandom Function (VOPRF) mode (mode 0x01). - * This mode extends the base OPRF by providing a proof that the server used the - * secret key corresponding to its known public key. - */ - readonly voprf: { - /** (Server-side) Generates a key pair for the VOPRF mode. */ - generateKeyPair(): OPRFKeys; - /** (Server-side) Deterministically derives a key pair for the VOPRF mode. */ - deriveKeyPair(seed: Bytes, keyInfo: Bytes): OPRFKeys; - /** (Client-side) Blinds the client's private input for the VOPRF protocol. */ - blind(input: Bytes, rng?: RNG): OPRFBlind; - - /** - * (Server-side) Evaluates the client's blinded element and generates a DLEQ proof - * of correctness. - * @param secretKey The server's private key. - * @param publicKey The server's public key, used in proof generation. - * @param blinded The blinded group element received from the client. - * @param rng An optional cryptographically secure random number generator for the proof. - * @returns The evaluated element and a proof of correct computation. - */ - blindEvaluate( - secretKey: ScalarBytes, - publicKey: PointBytes, - blinded: PointBytes, - rng?: RNG - ): OPRFBlindEval; - - /** - * (Server-side) An optimized batch version of `blindEvaluate`. It evaluates multiple - * blinded elements and produces a single, constant-size proof for the entire batch, - * amortizing the cost of proof generation. - * @param secretKey The server's private key. - * @param publicKey The server's public key. - * @param blinded An array of blinded group elements from one or more clients. - * @param rng An optional cryptographically secure random number generator for the proof. - * @returns An array of evaluated elements and a single proof for the batch. - */ - blindEvaluateBatch( - secretKey: ScalarBytes, - publicKey: PointBytes, - blinded: PointBytes[], - rng?: RNG - ): OPRFBlindEvalBatch; - - /** - * (Client-side) The final step. The client verifies the server's proof, and if valid, - * unblinds the result to compute the final VOPRF output. - * @param input The original private input. - * @param blind The secret scalar from the `blind` step. - * @param evaluated The evaluated element from the server. - * @param blinded The blinded element sent to the server (needed for proof verification). - * @param publicKey The server's public key against which the proof is verified. - * @param proof The DLEQ proof from the server. - * @returns The final VOPRF output. - * @throws If the proof verification fails. - */ - finalize( - input: Bytes, - blind: ScalarBytes, - evaluated: PointBytes, - blinded: PointBytes, - publicKey: PointBytes, - proof: Bytes - ): Bytes; - - /** - * (Client-side) The batch-aware version of `finalize`. It verifies a single batch proof - * against a list of corresponding inputs and outputs. - * @param items An array of objects, each containing the parameters for a single finalization. - * @param publicKey The server's public key. - * @param proof The single DLEQ proof for the entire batch. - * @returns An array of final VOPRF outputs, one for each item in the input. - * @throws If the proof verification fails. - */ - finalizeBatch(items: OPRFFinalizeItem[], publicKey: PointBytes, proof: Bytes): Bytes[]; - }; - - /** - * A factory for the Partially Oblivious Pseudorandom Function (POPRF) mode (mode 0x02). - * This mode extends VOPRF to include a public `info` parameter, known to both client and - * server, which is cryptographically bound to the final output. - * This is useful for domain separation at the application level. - * @param info A public byte string to be mixed into the computation. - * @returns An object with the POPRF protocol functions. - */ - readonly poprf: (info: Bytes) => { - /** (Server-side) Generates a key pair for the POPRF mode. */ - generateKeyPair(): OPRFKeys; - /** (Server-side) Deterministically derives a key pair for the POPRF mode. */ - deriveKeyPair(seed: Bytes, keyInfo: Bytes): OPRFKeys; - - /** - * (Client-side) Blinds the client's private input and computes the "tweaked key". - * The tweaked key is a public value derived from the server's public key and the public `info`. - * @param input The client's private input. - * @param publicKey The server's public key. - * @param rng An optional cryptographically secure random number generator. - * @returns The `blind`, `blinded` element, and the `tweakedKey` which the client uses for verification. - */ - blind(input: Bytes, publicKey: PointBytes, rng?: RNG): OPRFBlind & { tweakedKey: PointBytes }; - - /** - * (Server-side) Evaluates the blinded element using a key derived from its secret key and the public `info`. - * It generates a DLEQ proof against the tweaked key. - * @param secretKey The server's private key. - * @param blinded The blinded element from the client. - * @param rng An optional RNG for the proof. - * @returns The evaluated element and a proof of correct computation. - */ - blindEvaluate(secretKey: ScalarBytes, blinded: PointBytes, rng?: RNG): OPRFBlindEval; - - /** - * (Server-side) A batch-aware version of `blindEvaluate` for the POPRF mode. - * @param secretKey The server's private key. - * @param blinded An array of blinded elements. - * @param rng An optional RNG for the proof. - * @returns An array of evaluated elements and a single proof for the batch. - */ - blindEvaluateBatch(secretKey: ScalarBytes, blinded: PointBytes[], rng: RNG): OPRFBlindEvalBatch; - - /** - * (Client-side) A batch-aware version of `finalize` for the POPRF mode. - * It verifies the proof against the tweaked key. - * @param items An array containing the parameters for each finalization. - * @param proof The single DLEQ proof for the batch. - * @param tweakedKey The tweaked key corresponding to the proof (all items must share the same `info` and `publicKey`). - * @returns An array of final POPRF outputs. - * @throws If proof verification fails. - */ - finalizeBatch(items: OPRFFinalizeItem[], proof: Bytes, tweakedKey: PointBytes): Bytes[]; - - /** - * (Client-side) Finalizes the POPRF protocol. It verifies the server's proof against the - * `tweakedKey` computed in the `blind` step. The final output is bound to the public `info`. - * @param input The original private input. - * @param blind The secret scalar. - * @param evaluated The evaluated element from the server. - * @param blinded The blinded element sent to the server. - * @param proof The DLEQ proof from the server. - * @param tweakedKey The public tweaked key computed by the client during the `blind` step. - * @returns The final POPRF output. - * @throws If proof verification fails. - */ - finalize( - input: Bytes, - blind: ScalarBytes, - evaluated: PointBytes, - blinded: PointBytes, - proof: Bytes, - tweakedKey: PointBytes - ): Bytes; - - /** - * A non-interactive evaluation function for an entity that knows all inputs. - * Computes the final POPRF output directly. Useful for testing or specific applications - * where the server needs to compute the output for a known input. - * @param secretKey The server's private key. - * @param input The client's private input. - * @returns The final POPRF output. - */ - evaluate(secretKey: ScalarBytes, input: Bytes): Bytes; - }; -}; - -// welcome to generic hell -export function createORPF

>(opts: OPRFOpts

): OPRF { - validateObject(opts, { - name: 'string', - hash: 'function', - hashToScalar: 'function', - hashToGroup: 'function', - }); - // TODO - // Point: 'point', - const { name, Point, hash } = opts; - const { Fn } = Point; - - const hashToGroup = (msg: Uint8Array, ctx: Uint8Array) => - opts.hashToGroup(msg, { - DST: concatBytes(asciiToBytes('HashToGroup-'), ctx), - }) as P; - const hashToScalarPrefixed = (msg: Uint8Array, ctx: Uint8Array) => - opts.hashToScalar(msg, { DST: concatBytes(_DST_scalar, ctx) }); - const randomScalar = (rng: RNG = randomBytes) => { - const t = mapHashToField(rng(getMinHashLength(Fn.ORDER)), Fn.ORDER, Fn.isLE); - // We cannot use Fn.fromBytes here, because field - // can have different number of bytes (like ed448) - return Fn.isLE ? bytesToNumberLE(t) : bytesToNumberBE(t); - }; - - const msm = (points: P[], scalars: bigint[]) => pippenger(Point, points, scalars); - - const getCtx = (mode: number) => - concatBytes(asciiToBytes('OPRFV1-'), new Uint8Array([mode]), asciiToBytes('-' + name)); - const ctxOPRF = getCtx(0x00); - const ctxVOPRF = getCtx(0x01); - const ctxPOPRF = getCtx(0x02); - - function encode(...args: (Uint8Array | number | string)[]) { - const res = []; - for (const a of args) { - if (typeof a === 'number') res.push(numberToBytesBE(a, 2)); - else if (typeof a === 'string') res.push(asciiToBytes(a)); - else { - abytes(a); - res.push(numberToBytesBE(a.length, 2), a); - } - } - // No wipe here, since will modify actual bytes - return concatBytes(...res); - } - const hashInput = (...bytes: Uint8Array[]) => hash(encode(...bytes, 'Finalize')); - - function getTranscripts(B: P, C: P[], D: P[], ctx: Bytes) { - const Bm = B.toBytes(); - const seed = hash(encode(Bm, concatBytes(asciiToBytes('Seed-'), ctx))); - const res: bigint[] = []; - for (let i = 0; i < C.length; i++) { - const Ci = C[i].toBytes(); - const Di = D[i].toBytes(); - const di = hashToScalarPrefixed(encode(seed, i, Ci, Di, 'Composite'), ctx); - res.push(di); - } - return res; - } - - function computeComposites(B: P, C: P[], D: P[], ctx: Bytes) { - const T = getTranscripts(B, C, D, ctx); - const M = msm(C, T); - const Z = msm(D, T); - return { M, Z }; - } - - function computeCompositesFast(k: bigint, B: P, C: P[], D: P[], ctx: Bytes): { M: P; Z: P } { - const T = getTranscripts(B, C, D, ctx); - const M = msm(C, T); - const Z = M.multiply(k); - return { M, Z }; - } - - function challengeTranscript(B: P, M: P, Z: P, t2: P, t3: P, ctx: Bytes) { - const [Bm, a0, a1, a2, a3] = [B, M, Z, t2, t3].map((i) => i.toBytes()); - return hashToScalarPrefixed(encode(Bm, a0, a1, a2, a3, 'Challenge'), ctx); - } - - function generateProof(ctx: Bytes, k: bigint, B: P, C: P[], D: P[], rng: RNG) { - const { M, Z } = computeCompositesFast(k, B, C, D, ctx); - const r = randomScalar(rng); - const t2 = Point.BASE.multiply(r); - const t3 = M.multiply(r); - const c = challengeTranscript(B, M, Z, t2, t3, ctx); - const s = Fn.sub(r, Fn.mul(c, k)); // r - c*k - return concatBytes(...[c, s].map((i) => Fn.toBytes(i))); - } - - function verifyProof(ctx: Bytes, B: P, C: P[], D: P[], proof: Bytes) { - abytes(proof, 2 * Fn.BYTES); - const { M, Z } = computeComposites(B, C, D, ctx); - const [c, s] = [proof.subarray(0, Fn.BYTES), proof.subarray(Fn.BYTES)].map((f) => - Fn.fromBytes(f) - ); - const t2 = Point.BASE.multiply(s).add(B.multiply(c)); // s*G + c*B - const t3 = M.multiply(s).add(Z.multiply(c)); // s*M + c*Z - const expectedC = challengeTranscript(B, M, Z, t2, t3, ctx); - if (!Fn.eql(c, expectedC)) throw new Error('proof verification failed'); - } - - function generateKeyPair() { - const skS = randomScalar(); - const pkS = Point.BASE.multiply(skS); - return { secretKey: Fn.toBytes(skS), publicKey: pkS.toBytes() }; - } - - function deriveKeyPair(ctx: Bytes, seed: Bytes, info: Bytes) { - const dst = concatBytes(asciiToBytes('DeriveKeyPair'), ctx); - const msg = concatBytes(seed, encode(info), Uint8Array.of(0)); - for (let counter = 0; counter <= 255; counter++) { - msg[msg.length - 1] = counter; - const skS = opts.hashToScalar(msg, { DST: dst }); - if (Fn.is0(skS)) continue; // should not happen - return { secretKey: Fn.toBytes(skS), publicKey: Point.BASE.multiply(skS).toBytes() }; - } - throw new Error('Cannot derive key'); - } - function blind(ctx: Bytes, input: Uint8Array, rng: RNG = randomBytes) { - const blind = randomScalar(rng); - const inputPoint = hashToGroup(input, ctx); - if (inputPoint.equals(Point.ZERO)) throw new Error('Input point at infinity'); - const blinded = inputPoint.multiply(blind); - return { blind: Fn.toBytes(blind), blinded: blinded.toBytes() }; - } - function evaluate(ctx: Bytes, secretKey: ScalarBytes, input: Bytes) { - const skS = Fn.fromBytes(secretKey); - const inputPoint = hashToGroup(input, ctx); - if (inputPoint.equals(Point.ZERO)) throw new Error('Input point at infinity'); - const unblinded = inputPoint.multiply(skS).toBytes(); - return hashInput(input, unblinded); - } - const oprf = { - generateKeyPair, - deriveKeyPair: (seed: Bytes, keyInfo: Bytes) => deriveKeyPair(ctxOPRF, seed, keyInfo), - blind: (input: Bytes, rng: RNG = randomBytes) => blind(ctxOPRF, input, rng), - blindEvaluate(secretKey: ScalarBytes, blindedPoint: PointBytes) { - const skS = Fn.fromBytes(secretKey); - const elm = Point.fromBytes(blindedPoint); - return elm.multiply(skS).toBytes(); - }, - finalize(input: Bytes, blindBytes: ScalarBytes, evaluatedBytes: PointBytes) { - const blind = Fn.fromBytes(blindBytes); - const evalPoint = Point.fromBytes(evaluatedBytes); - const unblinded = evalPoint.multiply(Fn.inv(blind)).toBytes(); - return hashInput(input, unblinded); - }, - evaluate: (secretKey: ScalarBytes, input: Bytes) => evaluate(ctxOPRF, secretKey, input), - }; - - const voprf = { - generateKeyPair, - deriveKeyPair: (seed: Bytes, keyInfo: Bytes) => deriveKeyPair(ctxVOPRF, seed, keyInfo), - blind: (input: Bytes, rng: RNG = randomBytes) => blind(ctxVOPRF, input, rng), - blindEvaluateBatch( - secretKey: ScalarBytes, - publicKey: PointBytes, - blinded: PointBytes[], - rng: RNG = randomBytes - ) { - if (!Array.isArray(blinded)) throw new Error('expected array'); - const skS = Fn.fromBytes(secretKey); - const pkS = Point.fromBytes(publicKey); - const blindedPoints = blinded.map(Point.fromBytes); - const evaluated = blindedPoints.map((i) => i.multiply(skS)); - const proof = generateProof(ctxVOPRF, skS, pkS, blindedPoints, evaluated, rng); - return { evaluated: evaluated.map((i) => i.toBytes()), proof }; - }, - blindEvaluate( - secretKey: ScalarBytes, - publicKey: PointBytes, - blinded: PointBytes, - rng: RNG = randomBytes - ) { - const res = this.blindEvaluateBatch(secretKey, publicKey, [blinded], rng); - return { evaluated: res.evaluated[0], proof: res.proof }; - }, - finalizeBatch(items: OPRFFinalizeItem[], publicKey: PointBytes, proof: Bytes) { - if (!Array.isArray(items)) throw new Error('expected array'); - const pkS = Point.fromBytes(publicKey); - const blindedPoints = items.map((i) => i.blinded).map(Point.fromBytes); - const evalPoints = items.map((i) => i.evaluated).map(Point.fromBytes); - verifyProof(ctxVOPRF, pkS, blindedPoints, evalPoints, proof); - return items.map((i) => oprf.finalize(i.input, i.blind, i.evaluated)); - }, - finalize( - input: Bytes, - blind: ScalarBytes, - evaluated: PointBytes, - blinded: PointBytes, - publicKey: PointBytes, - proof: Bytes - ) { - return this.finalizeBatch([{ input, blind, evaluated, blinded }], publicKey, proof)[0]; - }, - evaluate: (secretKey: ScalarBytes, input: Bytes) => evaluate(ctxVOPRF, secretKey, input), - }; - // NOTE: info is domain separation - const poprf = (info: Bytes) => { - const m = hashToScalarPrefixed(encode('Info', info), ctxPOPRF); - const T = Point.BASE.multiply(m); - return { - generateKeyPair, - deriveKeyPair: (seed: Bytes, keyInfo: Bytes) => deriveKeyPair(ctxPOPRF, seed, keyInfo), - blind(input: Bytes, publicKey: PointBytes, rng: RNG = randomBytes) { - const pkS = Point.fromBytes(publicKey); - const tweakedKey = T.add(pkS); - if (tweakedKey.equals(Point.ZERO)) throw new Error('tweakedKey point at infinity'); - const blind = randomScalar(rng); - const inputPoint = hashToGroup(input, ctxPOPRF); - if (inputPoint.equals(Point.ZERO)) throw new Error('Input point at infinity'); - const blindedPoint = inputPoint.multiply(blind); - return { - blind: Fn.toBytes(blind), - blinded: blindedPoint.toBytes(), - tweakedKey: tweakedKey.toBytes(), - }; - }, - blindEvaluateBatch(secretKey: ScalarBytes, blinded: PointBytes[], rng: RNG = randomBytes) { - if (!Array.isArray(blinded)) throw new Error('expected array'); - const skS = Fn.fromBytes(secretKey); - const t = Fn.add(skS, m); - // "Hence, this error can be a signal for the server to replace its private key". We throw inside, - // should be impossible. - const invT = Fn.inv(t); - const blindedPoints = blinded.map(Point.fromBytes); - const evalPoints = blindedPoints.map((i) => i.multiply(invT)); - const tweakedKey = Point.BASE.multiply(t); - const proof = generateProof(ctxPOPRF, t, tweakedKey, evalPoints, blindedPoints, rng); - return { evaluated: evalPoints.map((i) => i.toBytes()), proof }; - }, - blindEvaluate(secretKey: ScalarBytes, blinded: PointBytes, rng: RNG = randomBytes) { - const res = this.blindEvaluateBatch(secretKey, [blinded], rng); - return { evaluated: res.evaluated[0], proof: res.proof }; - }, - finalizeBatch(items: OPRFFinalizeItem[], proof: Bytes, tweakedKey: PointBytes) { - if (!Array.isArray(items)) throw new Error('expected array'); - const evalPoints = items.map((i) => i.evaluated).map(Point.fromBytes); - verifyProof( - ctxPOPRF, - Point.fromBytes(tweakedKey), - evalPoints, - items.map((i) => i.blinded).map(Point.fromBytes), - proof - ); - return items.map((i, j) => { - const blind = Fn.fromBytes(i.blind); - const point = evalPoints[j].multiply(Fn.inv(blind)).toBytes(); - return hashInput(i.input, info, point); - }); - }, - finalize( - input: Bytes, - blind: ScalarBytes, - evaluated: PointBytes, - blinded: PointBytes, - proof: Bytes, - tweakedKey: PointBytes - ) { - return this.finalizeBatch([{ input, blind, evaluated, blinded }], proof, tweakedKey)[0]; - }, - evaluate(secretKey: ScalarBytes, input: Bytes) { - const skS = Fn.fromBytes(secretKey); - const inputPoint = hashToGroup(input, ctxPOPRF); - if (inputPoint.equals(Point.ZERO)) throw new Error('Input point at infinity'); - const t = Fn.add(skS, m); - const invT = Fn.inv(t); - const unblinded = inputPoint.multiply(invT).toBytes(); - return hashInput(input, info, unblinded); - }, - }; - }; - return Object.freeze({ name, oprf, voprf, poprf, __tests: { Fn } }); -} diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/poseidon.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/poseidon.ts deleted file mode 100644 index cbc868ee..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/poseidon.ts +++ /dev/null @@ -1,333 +0,0 @@ -/** - * Implements [Poseidon](https://www.poseidon-hash.info) ZK-friendly hash. - * - * There are many poseidon variants with different constants. - * We don't provide them: you should construct them manually. - * Check out [micro-starknet](https://github.com/paulmillr/micro-starknet) package for a proper example. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { asafenumber, bitGet, validateObject } from '../utils.ts'; -import { FpInvertBatch, FpPow, type IField, validateField } from './modular.ts'; - -// Grain LFSR (Linear-Feedback Shift Register): https://eprint.iacr.org/2009/109.pdf -function grainLFSR(state: number[]): () => boolean { - let pos = 0; - if (state.length !== 80) throw new Error('grainLFRS: wrong state length, should be 80 bits'); - const getBit = (): boolean => { - const r = (offset: number) => state[(pos + offset) % 80]; - const bit = r(62) ^ r(51) ^ r(38) ^ r(23) ^ r(13) ^ r(0); - state[pos] = bit; - pos = ++pos % 80; - return !!bit; - }; - for (let i = 0; i < 160; i++) getBit(); - return () => { - // https://en.wikipedia.org/wiki/Shrinking_generator - while (true) { - const b1 = getBit(); - const b2 = getBit(); - if (!b1) continue; - return b2; - } - }; -} - -export type PoseidonBasicOpts = { - Fp: IField; - t: number; // t = rate + capacity - roundsFull: number; - roundsPartial: number; - isSboxInverse?: boolean; -}; - -function assertValidPosOpts(opts: PoseidonBasicOpts) { - const { Fp, roundsFull } = opts; - validateField(Fp); - validateObject( - opts, - { - t: 'number', - roundsFull: 'number', - roundsPartial: 'number', - }, - { - isSboxInverse: 'boolean', - } - ); - for (const k of ['t', 'roundsFull', 'roundsPartial'] as const) { - asafenumber(opts[k], k); - if (opts[k] < 1) throw new Error('invalid number ' + k); - } - if (roundsFull & 1) throw new Error('roundsFull is not even' + roundsFull); -} - -function poseidonGrain(opts: PoseidonBasicOpts) { - assertValidPosOpts(opts); - const { Fp } = opts; - const state = Array(80).fill(1); - let pos = 0; - const writeBits = (value: bigint, bitCount: number) => { - for (let i = bitCount - 1; i >= 0; i--) state[pos++] = Number(bitGet(value, i)); - }; - const _0n = BigInt(0); - const _1n = BigInt(1); - writeBits(_1n, 2); // prime field - writeBits(opts.isSboxInverse ? _1n : _0n, 4); // b2..b5 - writeBits(BigInt(Fp.BITS), 12); // b6..b17 - writeBits(BigInt(opts.t), 12); // b18..b29 - writeBits(BigInt(opts.roundsFull), 10); // b30..b39 - writeBits(BigInt(opts.roundsPartial), 10); // b40..b49 - - const getBit = grainLFSR(state); - return (count: number, reject: boolean): bigint[] => { - const res: bigint[] = []; - for (let i = 0; i < count; i++) { - while (true) { - let num = _0n; - for (let i = 0; i < Fp.BITS; i++) { - num <<= _1n; - if (getBit()) num |= _1n; - } - if (reject && num >= Fp.ORDER) continue; // rejection sampling - res.push(Fp.create(num)); - break; - } - } - return res; - }; -} - -export type PoseidonGrainOpts = PoseidonBasicOpts & { - sboxPower?: number; -}; - -type PoseidonConstants = { mds: bigint[][]; roundConstants: bigint[][] }; - -// NOTE: this is not standard but used often for constant generation for poseidon -// (grain LFRS-like structure) -export function grainGenConstants(opts: PoseidonGrainOpts, skipMDS: number = 0): PoseidonConstants { - const { Fp, t, roundsFull, roundsPartial } = opts; - const rounds = roundsFull + roundsPartial; - const sample = poseidonGrain(opts); - const roundConstants: bigint[][] = []; - for (let r = 0; r < rounds; r++) roundConstants.push(sample(t, true)); - if (skipMDS > 0) for (let i = 0; i < skipMDS; i++) sample(2 * t, false); - const xs = sample(t, false); - const ys = sample(t, false); - // Construct MDS Matrix M[i][j] = 1 / (xs[i] + ys[j]) - const mds: bigint[][] = []; - for (let i = 0; i < t; i++) { - const row: bigint[] = []; - for (let j = 0; j < t; j++) { - const xy = Fp.add(xs[i], ys[j]); - if (Fp.is0(xy)) - throw new Error(`Error generating MDS matrix: xs[${i}] + ys[${j}] resulted in zero.`); - row.push(xy); - } - mds.push(FpInvertBatch(Fp, row)); - } - - return { roundConstants, mds }; -} - -export type PoseidonOpts = PoseidonBasicOpts & - PoseidonConstants & { - sboxPower?: number; - reversePartialPowIdx?: boolean; // Hack for stark - }; - -export function validateOpts(opts: PoseidonOpts): Readonly<{ - rounds: number; - sboxFn: (n: bigint) => bigint; - roundConstants: bigint[][]; - mds: bigint[][]; - Fp: IField; - t: number; - roundsFull: number; - roundsPartial: number; - sboxPower?: number; - reversePartialPowIdx?: boolean; // Hack for stark -}> { - assertValidPosOpts(opts); - const { Fp, mds, reversePartialPowIdx: rev, roundConstants: rc } = opts; - const { roundsFull, roundsPartial, sboxPower, t } = opts; - - // MDS is TxT matrix - if (!Array.isArray(mds) || mds.length !== t) throw new Error('Poseidon: invalid MDS matrix'); - const _mds = mds.map((mdsRow) => { - if (!Array.isArray(mdsRow) || mdsRow.length !== t) - throw new Error('invalid MDS matrix row: ' + mdsRow); - return mdsRow.map((i) => { - if (typeof i !== 'bigint') throw new Error('invalid MDS matrix bigint: ' + i); - return Fp.create(i); - }); - }); - - if (rev !== undefined && typeof rev !== 'boolean') - throw new Error('invalid param reversePartialPowIdx=' + rev); - - if (roundsFull & 1) throw new Error('roundsFull is not even' + roundsFull); - const rounds = roundsFull + roundsPartial; - - if (!Array.isArray(rc) || rc.length !== rounds) - throw new Error('Poseidon: invalid round constants'); - const roundConstants = rc.map((rc) => { - if (!Array.isArray(rc) || rc.length !== t) throw new Error('invalid round constants'); - return rc.map((i) => { - if (typeof i !== 'bigint' || !Fp.isValid(i)) throw new Error('invalid round constant'); - return Fp.create(i); - }); - }); - - if (!sboxPower || ![3, 5, 7, 17].includes(sboxPower)) throw new Error('invalid sboxPower'); - const _sboxPower = BigInt(sboxPower); - let sboxFn = (n: bigint) => FpPow(Fp, n, _sboxPower); - // Unwrapped sbox power for common cases (195->142μs) - if (sboxPower === 3) sboxFn = (n: bigint) => Fp.mul(Fp.sqrN(n), n); - else if (sboxPower === 5) sboxFn = (n: bigint) => Fp.mul(Fp.sqrN(Fp.sqrN(n)), n); - - return Object.freeze({ ...opts, rounds, sboxFn, roundConstants, mds: _mds }); -} - -export function splitConstants(rc: bigint[], t: number): bigint[][] { - if (typeof t !== 'number') throw new Error('poseidonSplitConstants: invalid t'); - if (!Array.isArray(rc) || rc.length % t) throw new Error('poseidonSplitConstants: invalid rc'); - const res = []; - let tmp = []; - for (let i = 0; i < rc.length; i++) { - tmp.push(rc[i]); - if (tmp.length === t) { - res.push(tmp); - tmp = []; - } - } - return res; -} - -export type PoseidonFn = { - (values: bigint[]): bigint[]; - // For verification in tests - roundConstants: bigint[][]; -}; -/** Poseidon NTT-friendly hash. */ -export function poseidon(opts: PoseidonOpts): PoseidonFn { - const _opts = validateOpts(opts); - const { Fp, mds, roundConstants, rounds: totalRounds, roundsPartial, sboxFn, t } = _opts; - const halfRoundsFull = _opts.roundsFull / 2; - const partialIdx = _opts.reversePartialPowIdx ? t - 1 : 0; - const poseidonRound = (values: bigint[], isFull: boolean, idx: number) => { - values = values.map((i, j) => Fp.add(i, roundConstants[idx][j])); - - if (isFull) values = values.map((i) => sboxFn(i)); - else values[partialIdx] = sboxFn(values[partialIdx]); - // Matrix multiplication - values = mds.map((i) => i.reduce((acc, i, j) => Fp.add(acc, Fp.mulN(i, values[j])), Fp.ZERO)); - return values; - }; - const poseidonHash = function poseidonHash(values: bigint[]) { - if (!Array.isArray(values) || values.length !== t) - throw new Error('invalid values, expected array of bigints with length ' + t); - values = values.map((i) => { - if (typeof i !== 'bigint') throw new Error('invalid bigint=' + i); - return Fp.create(i); - }); - let lastRound = 0; - // Apply r_f/2 full rounds. - for (let i = 0; i < halfRoundsFull; i++) values = poseidonRound(values, true, lastRound++); - // Apply r_p partial rounds. - for (let i = 0; i < roundsPartial; i++) values = poseidonRound(values, false, lastRound++); - // Apply r_f/2 full rounds. - for (let i = 0; i < halfRoundsFull; i++) values = poseidonRound(values, true, lastRound++); - - if (lastRound !== totalRounds) throw new Error('invalid number of rounds'); - return values; - }; - // For verification in tests - poseidonHash.roundConstants = roundConstants; - return poseidonHash; -} - -export class PoseidonSponge { - private Fp: IField; - readonly rate: number; - readonly capacity: number; - readonly hash: PoseidonFn; - private state: bigint[]; // [...capacity, ...rate] - private pos = 0; - private isAbsorbing = true; - - constructor(Fp: IField, rate: number, capacity: number, hash: PoseidonFn) { - this.Fp = Fp; - this.hash = hash; - this.rate = rate; - this.capacity = capacity; - this.state = new Array(rate + capacity); - this.clean(); - } - private process(): void { - this.state = this.hash(this.state); - } - absorb(input: bigint[]): void { - for (const i of input) - if (typeof i !== 'bigint' || !this.Fp.isValid(i)) throw new Error('invalid input: ' + i); - for (let i = 0; i < input.length; ) { - if (!this.isAbsorbing || this.pos === this.rate) { - this.process(); - this.pos = 0; - this.isAbsorbing = true; - } - const chunk = Math.min(this.rate - this.pos, input.length - i); - for (let j = 0; j < chunk; j++) { - const idx = this.capacity + this.pos++; - this.state[idx] = this.Fp.add(this.state[idx], input[i++]); - } - } - } - squeeze(count: number): bigint[] { - const res: bigint[] = []; - while (res.length < count) { - if (this.isAbsorbing || this.pos === this.rate) { - this.process(); - this.pos = 0; - this.isAbsorbing = false; - } - const chunk = Math.min(this.rate - this.pos, count - res.length); - for (let i = 0; i < chunk; i++) res.push(this.state[this.capacity + this.pos++]); - } - return res; - } - clean(): void { - this.state.fill(this.Fp.ZERO); - this.isAbsorbing = true; - this.pos = 0; - } - clone(): PoseidonSponge { - const c = new PoseidonSponge(this.Fp, this.rate, this.capacity, this.hash); - c.pos = this.pos; - c.state = [...this.state]; - return c; - } -} - -export type PoseidonSpongeOpts = Omit & { - rate: number; - capacity: number; -}; - -/** - * The method is not defined in spec, but nevertheless used often. - * Check carefully for compatibility: there are many edge cases, like absorbing an empty array. - * We cross-test against: - * - https://github.com/ProvableHQ/snarkVM/tree/staging/algorithms - * - https://github.com/arkworks-rs/crypto-primitives/tree/main - */ -export function poseidonSponge(opts: PoseidonSpongeOpts): () => PoseidonSponge { - for (const k of ['rate', 'capacity'] as const) asafenumber(opts[k], k); - const { rate, capacity } = opts; - const t = opts.rate + opts.capacity; - // Re-use hash instance between multiple instances - const hash = poseidon({ ...opts, t }); - const { Fp } = opts; - return () => new PoseidonSponge(Fp, rate, capacity, hash); -} diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/tower.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/tower.ts deleted file mode 100644 index 6605c04f..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/tower.ts +++ /dev/null @@ -1,864 +0,0 @@ -/** - * Towered extension fields. - * Rather than implementing a massive 12th-degree extension directly, it is more efficient - * to build it up from smaller extensions: a tower of extensions. - * - * For BLS12-381, the Fp12 field is implemented as a quadratic (degree two) extension, - * on top of a cubic (degree three) extension, on top of a quadratic extension of Fp. - * - * For more info: "Pairings for beginners" by Costello, section 7.3. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { bitGet, bitLen, concatBytes, notImplemented } from '../utils.ts'; -import * as mod from './modular.ts'; -import type { WeierstrassPoint, WeierstrassPointCons } from './weierstrass.ts'; - -// Be friendly to bad ECMAScript parsers by not using bigint literals -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3); - -// Fp₂ over complex plane -export type BigintTuple = [bigint, bigint]; -export type Fp = bigint; -// Finite extension field over irreducible polynominal. -// Fp(u) / (u² - β) where β = -1 -export type Fp2 = { c0: bigint; c1: bigint }; -export type BigintSix = [bigint, bigint, bigint, bigint, bigint, bigint]; -export type Fp6 = { c0: Fp2; c1: Fp2; c2: Fp2 }; -export type Fp12 = { c0: Fp6; c1: Fp6 }; // Fp₁₂ = Fp₆² => Fp₂³, Fp₆(w) / (w² - γ) where γ = v -// prettier-ignore -export type BigintTwelve = [ - bigint, bigint, bigint, bigint, bigint, bigint, - bigint, bigint, bigint, bigint, bigint, bigint -]; - -export type Fp2Bls = mod.IField & { - Fp: mod.IField; - frobeniusMap(num: Fp2, power: number): Fp2; - fromBigTuple(num: BigintTuple): Fp2; - mulByB: (num: Fp2) => Fp2; - mulByNonresidue: (num: Fp2) => Fp2; - reim: (num: Fp2) => { re: Fp; im: Fp }; - Fp4Square: (a: Fp2, b: Fp2) => { first: Fp2; second: Fp2 }; - NONRESIDUE: Fp2; -}; - -export type Fp6Bls = mod.IField & { - Fp2: Fp2Bls; - frobeniusMap(num: Fp6, power: number): Fp6; - fromBigSix: (tuple: BigintSix) => Fp6; - mul1(num: Fp6, b1: Fp2): Fp6; - mul01(num: Fp6, b0: Fp2, b1: Fp2): Fp6; - mulByFp2(lhs: Fp6, rhs: Fp2): Fp6; - mulByNonresidue: (num: Fp6) => Fp6; -}; - -export type Fp12Bls = mod.IField & { - Fp6: Fp6Bls; - frobeniusMap(num: Fp12, power: number): Fp12; - fromBigTwelve: (t: BigintTwelve) => Fp12; - mul014(num: Fp12, o0: Fp2, o1: Fp2, o4: Fp2): Fp12; - mul034(num: Fp12, o0: Fp2, o3: Fp2, o4: Fp2): Fp12; - mulByFp2(lhs: Fp12, rhs: Fp2): Fp12; - conjugate(num: Fp12): Fp12; - finalExponentiate(num: Fp12): Fp12; - _cyclotomicSquare(num: Fp12): Fp12; - _cyclotomicExp(num: Fp12, n: bigint): Fp12; -}; - -function calcFrobeniusCoefficients( - Fp: mod.IField, - nonResidue: T, - modulus: bigint, - degree: number, - num: number = 1, - divisor?: number -) { - const _divisor = BigInt(divisor === undefined ? degree : divisor); - const towerModulus: any = modulus ** BigInt(degree); - const res: T[][] = []; - for (let i = 0; i < num; i++) { - const a = BigInt(i + 1); - const powers: T[] = []; - for (let j = 0, qPower = _1n; j < degree; j++) { - const power = ((a * qPower - a) / _divisor) % towerModulus; - powers.push(Fp.pow(nonResidue, power)); - qPower *= modulus; - } - res.push(powers); - } - return res; -} - -// This works same at least for bls12-381, bn254 and bls12-377 -export function psiFrobenius( - Fp: mod.IField, - Fp2: Fp2Bls, - base: Fp2 -): { - psi: (x: Fp2, y: Fp2) => [Fp2, Fp2]; - psi2: (x: Fp2, y: Fp2) => [Fp2, Fp2]; - G2psi: (c: WeierstrassPointCons, P: WeierstrassPoint) => WeierstrassPoint; - G2psi2: (c: WeierstrassPointCons, P: WeierstrassPoint) => WeierstrassPoint; - PSI_X: Fp2; - PSI_Y: Fp2; - PSI2_X: Fp2; - PSI2_Y: Fp2; -} { - // GLV endomorphism Ψ(P) - const PSI_X = Fp2.pow(base, (Fp.ORDER - _1n) / _3n); // u^((p-1)/3) - const PSI_Y = Fp2.pow(base, (Fp.ORDER - _1n) / _2n); // u^((p-1)/2) - function psi(x: Fp2, y: Fp2): [Fp2, Fp2] { - // This x10 faster than previous version in bls12-381 - const x2 = Fp2.mul(Fp2.frobeniusMap(x, 1), PSI_X); - const y2 = Fp2.mul(Fp2.frobeniusMap(y, 1), PSI_Y); - return [x2, y2]; - } - // Ψ²(P) endomorphism (psi2(x) = psi(psi(x))) - const PSI2_X = Fp2.pow(base, (Fp.ORDER ** _2n - _1n) / _3n); // u^((p^2 - 1)/3) - // This equals -1, which causes y to be Fp2.neg(y). - // But not sure if there are case when this is not true? - const PSI2_Y = Fp2.pow(base, (Fp.ORDER ** _2n - _1n) / _2n); // u^((p^2 - 1)/3) - if (!Fp2.eql(PSI2_Y, Fp2.neg(Fp2.ONE))) throw new Error('psiFrobenius: PSI2_Y!==-1'); - function psi2(x: Fp2, y: Fp2): [Fp2, Fp2] { - return [Fp2.mul(x, PSI2_X), Fp2.neg(y)]; - } - // Map points - const mapAffine = - (fn: (x: T, y: T) => [T, T]) => - (c: WeierstrassPointCons, P: WeierstrassPoint) => { - const affine = P.toAffine(); - const p = fn(affine.x, affine.y); - return c.fromAffine({ x: p[0], y: p[1] }); - }; - const G2psi = mapAffine(psi); - const G2psi2 = mapAffine(psi2); - return { psi, psi2, G2psi, G2psi2, PSI_X, PSI_Y, PSI2_X, PSI2_Y }; -} - -export type Tower12Opts = { - ORDER: bigint; - X_LEN: number; - NONRESIDUE?: Fp; - FP2_NONRESIDUE: BigintTuple; - Fp2sqrt?: (num: Fp2) => Fp2; - Fp2mulByB: (num: Fp2) => Fp2; - Fp12finalExponentiate: (num: Fp12) => Fp12; -}; - -const Fp2fromBigTuple = (Fp: mod.IField, tuple: BigintTuple | bigint[]) => { - if (tuple.length !== 2) throw new Error('invalid tuple'); - const fps = tuple.map((n) => Fp.create(n)) as BigintTuple; - return { c0: fps[0], c1: fps[1] }; -}; - -class _Field2 implements mod.IField { - readonly ORDER: bigint; - readonly BITS: number; - readonly BYTES: number; - readonly isLE: boolean; - - readonly ZERO: Fp2; - readonly ONE: Fp2; - readonly Fp: mod.IField; - - readonly NONRESIDUE: Fp2; - readonly mulByB: Tower12Opts['Fp2mulByB']; - readonly Fp_NONRESIDUE: bigint; - readonly Fp_div2: bigint; - readonly FROBENIUS_COEFFICIENTS: Fp[]; - - constructor( - Fp: mod.IField, - opts: Partial<{ - NONRESIDUE: bigint; - FP2_NONRESIDUE: BigintTuple; - Fp2mulByB: Tower12Opts['Fp2mulByB']; - }> = {} - ) { - const ORDER = Fp.ORDER; - const FP2_ORDER = ORDER * ORDER; - this.Fp = Fp; - this.ORDER = FP2_ORDER; - this.BITS = bitLen(FP2_ORDER); - this.BYTES = Math.ceil(bitLen(FP2_ORDER) / 8); - this.isLE = Fp.isLE; - this.ZERO = { c0: Fp.ZERO, c1: Fp.ZERO }; - this.ONE = { c0: Fp.ONE, c1: Fp.ZERO }; - - this.Fp_NONRESIDUE = Fp.create(opts.NONRESIDUE || BigInt(-1)); - this.Fp_div2 = Fp.div(Fp.ONE, _2n); // 1/2 - this.NONRESIDUE = Fp2fromBigTuple(Fp, opts.FP2_NONRESIDUE!); - // const Fp2Nonresidue = Fp2fromBigTuple(opts.FP2_NONRESIDUE); - this.FROBENIUS_COEFFICIENTS = calcFrobeniusCoefficients(Fp, this.Fp_NONRESIDUE, Fp.ORDER, 2)[0]; - this.mulByB = opts.Fp2mulByB!; - Object.seal(this); - } - fromBigTuple(tuple: BigintTuple) { - return Fp2fromBigTuple(this.Fp, tuple); - } - create(num: Fp2) { - return num; - } - isValid({ c0, c1 }: Fp2) { - function isValidC(num: bigint, ORDER: bigint) { - return typeof num === 'bigint' && _0n <= num && num < ORDER; - } - return isValidC(c0, this.ORDER) && isValidC(c1, this.ORDER); - } - is0({ c0, c1 }: Fp2) { - return this.Fp.is0(c0) && this.Fp.is0(c1); - } - isValidNot0(num: Fp2) { - return !this.is0(num) && this.isValid(num); - } - eql({ c0, c1 }: Fp2, { c0: r0, c1: r1 }: Fp2) { - return this.Fp.eql(c0, r0) && this.Fp.eql(c1, r1); - } - neg({ c0, c1 }: Fp2) { - return { c0: this.Fp.neg(c0), c1: this.Fp.neg(c1) }; - } - pow(num: Fp2, power: bigint): Fp2 { - return mod.FpPow(this, num, power); - } - invertBatch(nums: Fp2[]): Fp2[] { - return mod.FpInvertBatch(this, nums); - } - // Normalized - add(f1: Fp2, f2: Fp2): Fp2 { - const { c0, c1 } = f1; - const { c0: r0, c1: r1 } = f2; - return { - c0: this.Fp.add(c0, r0), - c1: this.Fp.add(c1, r1), - }; - } - sub({ c0, c1 }: Fp2, { c0: r0, c1: r1 }: Fp2) { - return { - c0: this.Fp.sub(c0, r0), - c1: this.Fp.sub(c1, r1), - }; - } - mul({ c0, c1 }: Fp2, rhs: Fp2) { - const { Fp } = this; - if (typeof rhs === 'bigint') return { c0: Fp.mul(c0, rhs), c1: Fp.mul(c1, rhs) }; - // (a+bi)(c+di) = (ac−bd) + (ad+bc)i - const { c0: r0, c1: r1 } = rhs; - let t1 = Fp.mul(c0, r0); // c0 * o0 - let t2 = Fp.mul(c1, r1); // c1 * o1 - // (T1 - T2) + ((c0 + c1) * (r0 + r1) - (T1 + T2))*i - const o0 = Fp.sub(t1, t2); - const o1 = Fp.sub(Fp.mul(Fp.add(c0, c1), Fp.add(r0, r1)), Fp.add(t1, t2)); - return { c0: o0, c1: o1 }; - } - sqr({ c0, c1 }: Fp2) { - const { Fp } = this; - const a = Fp.add(c0, c1); - const b = Fp.sub(c0, c1); - const c = Fp.add(c0, c0); - return { c0: Fp.mul(a, b), c1: Fp.mul(c, c1) }; - } - // NonNormalized stuff - addN(a: Fp2, b: Fp2): Fp2 { - return this.add(a, b); - } - subN(a: Fp2, b: Fp2): Fp2 { - return this.sub(a, b); - } - mulN(a: Fp2, b: Fp2): Fp2 { - return this.mul(a, b); - } - sqrN(a: Fp2): Fp2 { - return this.sqr(a); - } - // Why inversion for bigint inside Fp instead of Fp2? it is even used in that context? - div(lhs: Fp2, rhs: Fp2): Fp2 { - const { Fp } = this; - // @ts-ignore - return this.mul(lhs, typeof rhs === 'bigint' ? Fp.inv(Fp.create(rhs)) : this.inv(rhs)); - } - inv({ c0: a, c1: b }: Fp2): Fp2 { - // We wish to find the multiplicative inverse of a nonzero - // element a + bu in Fp2. We leverage an identity - // - // (a + bu)(a - bu) = a² + b² - // - // which holds because u² = -1. This can be rewritten as - // - // (a + bu)(a - bu)/(a² + b²) = 1 - // - // because a² + b² = 0 has no nonzero solutions for (a, b). - // This gives that (a - bu)/(a² + b²) is the inverse - // of (a + bu). Importantly, this can be computing using - // only a single inversion in Fp. - const { Fp } = this; - const factor = Fp.inv(Fp.create(a * a + b * b)); - return { c0: Fp.mul(factor, Fp.create(a)), c1: Fp.mul(factor, Fp.create(-b)) }; - } - sqrt(num: Fp2) { - // This is generic for all quadratic extensions (Fp2) - const { Fp } = this; - const Fp2 = this; - const { c0, c1 } = num; - if (Fp.is0(c1)) { - // if c0 is quadratic residue - if (mod.FpLegendre(Fp, c0) === 1) return Fp2.create({ c0: Fp.sqrt(c0), c1: Fp.ZERO }); - else return Fp2.create({ c0: Fp.ZERO, c1: Fp.sqrt(Fp.div(c0, this.Fp_NONRESIDUE)) }); - } - const a = Fp.sqrt(Fp.sub(Fp.sqr(c0), Fp.mul(Fp.sqr(c1), this.Fp_NONRESIDUE))); - let d = Fp.mul(Fp.add(a, c0), this.Fp_div2); - const legendre = mod.FpLegendre(Fp, d); - // -1, Quadratic non residue - if (legendre === -1) d = Fp.sub(d, a); - const a0 = Fp.sqrt(d); - const candidateSqrt = Fp2.create({ c0: a0, c1: Fp.div(Fp.mul(c1, this.Fp_div2), a0) }); - if (!Fp2.eql(Fp2.sqr(candidateSqrt), num)) throw new Error('Cannot find square root'); - // Normalize root: at this point candidateSqrt ** 2 = num, but also -candidateSqrt ** 2 = num - const x1 = candidateSqrt; - const x2 = Fp2.neg(x1); - const { re: re1, im: im1 } = Fp2.reim(x1); - const { re: re2, im: im2 } = Fp2.reim(x2); - if (im1 > im2 || (im1 === im2 && re1 > re2)) return x1; - return x2; - } - // Same as sgn0_m_eq_2 in RFC 9380 - isOdd(x: Fp2) { - const { re: x0, im: x1 } = this.reim(x); - const sign_0 = x0 % _2n; - const zero_0 = x0 === _0n; - const sign_1 = x1 % _2n; - return BigInt(sign_0 || (zero_0 && sign_1)) == _1n; - } - // Bytes util - fromBytes(b: Uint8Array): Fp2 { - const { Fp } = this; - if (b.length !== this.BYTES) throw new Error('fromBytes invalid length=' + b.length); - return { c0: Fp.fromBytes(b.subarray(0, Fp.BYTES)), c1: Fp.fromBytes(b.subarray(Fp.BYTES)) }; - } - toBytes({ c0, c1 }: Fp2) { - return concatBytes(this.Fp.toBytes(c0), this.Fp.toBytes(c1)); - } - cmov({ c0, c1 }: Fp2, { c0: r0, c1: r1 }: Fp2, c: boolean) { - return { - c0: this.Fp.cmov(c0, r0, c), - c1: this.Fp.cmov(c1, r1, c), - }; - } - reim({ c0, c1 }: Fp2) { - return { re: c0, im: c1 }; - } - Fp4Square(a: Fp2, b: Fp2): { first: Fp2; second: Fp2 } { - const Fp2 = this; - const a2 = Fp2.sqr(a); - const b2 = Fp2.sqr(b); - return { - first: Fp2.add(Fp2.mulByNonresidue(b2), a2), // b² * Nonresidue + a² - second: Fp2.sub(Fp2.sub(Fp2.sqr(Fp2.add(a, b)), a2), b2), // (a + b)² - a² - b² - }; - } - // multiply by u + 1 - mulByNonresidue({ c0, c1 }: Fp2) { - return this.mul({ c0, c1 }, this.NONRESIDUE); - } - frobeniusMap({ c0, c1 }: Fp2, power: number): Fp2 { - return { - c0, - c1: this.Fp.mul(c1, this.FROBENIUS_COEFFICIENTS[power % 2]), - }; - } -} - -class _Field6 implements Fp6Bls { - readonly ORDER: bigint; - readonly BITS: number; - readonly BYTES: number; - readonly isLE: boolean; - - readonly ZERO: Fp6; - readonly ONE: Fp6; - readonly Fp2: Fp2Bls; - readonly FROBENIUS_COEFFICIENTS_1: Fp2[]; - readonly FROBENIUS_COEFFICIENTS_2: Fp2[]; - - constructor(Fp2: Fp2Bls) { - this.Fp2 = Fp2; - this.ORDER = Fp2.ORDER; // TODO: unused, but need to verify - this.BITS = 3 * Fp2.BITS; - this.BYTES = 3 * Fp2.BYTES; - this.isLE = Fp2.isLE; - this.ZERO = { c0: Fp2.ZERO, c1: Fp2.ZERO, c2: Fp2.ZERO }; - this.ONE = { c0: Fp2.ONE, c1: Fp2.ZERO, c2: Fp2.ZERO }; - const { Fp } = Fp2; - const frob = calcFrobeniusCoefficients(Fp2, Fp2.NONRESIDUE, Fp.ORDER, 6, 2, 3); - this.FROBENIUS_COEFFICIENTS_1 = frob[0]; - this.FROBENIUS_COEFFICIENTS_2 = frob[1]; - Object.seal(this); - } - add({ c0, c1, c2 }: Fp6, { c0: r0, c1: r1, c2: r2 }: Fp6) { - const { Fp2 } = this; - return { - c0: Fp2.add(c0, r0), - c1: Fp2.add(c1, r1), - c2: Fp2.add(c2, r2), - }; - } - sub({ c0, c1, c2 }: Fp6, { c0: r0, c1: r1, c2: r2 }: Fp6) { - const { Fp2 } = this; - return { - c0: Fp2.sub(c0, r0), - c1: Fp2.sub(c1, r1), - c2: Fp2.sub(c2, r2), - }; - } - mul({ c0, c1, c2 }: Fp6, rhs: Fp6 | bigint) { - const { Fp2 } = this; - if (typeof rhs === 'bigint') { - return { - c0: Fp2.mul(c0, rhs), - c1: Fp2.mul(c1, rhs), - c2: Fp2.mul(c2, rhs), - }; - } - const { c0: r0, c1: r1, c2: r2 } = rhs; - const t0 = Fp2.mul(c0, r0); // c0 * o0 - const t1 = Fp2.mul(c1, r1); // c1 * o1 - const t2 = Fp2.mul(c2, r2); // c2 * o2 - return { - // t0 + (c1 + c2) * (r1 * r2) - (T1 + T2) * (u + 1) - c0: Fp2.add( - t0, - Fp2.mulByNonresidue(Fp2.sub(Fp2.mul(Fp2.add(c1, c2), Fp2.add(r1, r2)), Fp2.add(t1, t2))) - ), - // (c0 + c1) * (r0 + r1) - (T0 + T1) + T2 * (u + 1) - c1: Fp2.add( - Fp2.sub(Fp2.mul(Fp2.add(c0, c1), Fp2.add(r0, r1)), Fp2.add(t0, t1)), - Fp2.mulByNonresidue(t2) - ), - // T1 + (c0 + c2) * (r0 + r2) - T0 + T2 - c2: Fp2.sub(Fp2.add(t1, Fp2.mul(Fp2.add(c0, c2), Fp2.add(r0, r2))), Fp2.add(t0, t2)), - }; - } - sqr({ c0, c1, c2 }: Fp6) { - const { Fp2 } = this; - let t0 = Fp2.sqr(c0); // c0² - let t1 = Fp2.mul(Fp2.mul(c0, c1), _2n); // 2 * c0 * c1 - let t3 = Fp2.mul(Fp2.mul(c1, c2), _2n); // 2 * c1 * c2 - let t4 = Fp2.sqr(c2); // c2² - return { - c0: Fp2.add(Fp2.mulByNonresidue(t3), t0), // T3 * (u + 1) + T0 - c1: Fp2.add(Fp2.mulByNonresidue(t4), t1), // T4 * (u + 1) + T1 - // T1 + (c0 - c1 + c2)² + T3 - T0 - T4 - c2: Fp2.sub(Fp2.sub(Fp2.add(Fp2.add(t1, Fp2.sqr(Fp2.add(Fp2.sub(c0, c1), c2))), t3), t0), t4), - }; - } - addN(a: Fp6, b: Fp6): Fp6 { - return this.add(a, b); - } - subN(a: Fp6, b: Fp6): Fp6 { - return this.sub(a, b); - } - mulN(a: Fp6, b: Fp6): Fp6 { - return this.mul(a, b); - } - sqrN(a: Fp6): Fp6 { - return this.sqr(a); - } - - create(num: Fp6) { - return num; - } - - isValid({ c0, c1, c2 }: Fp6) { - const { Fp2 } = this; - return Fp2.isValid(c0) && Fp2.isValid(c1) && Fp2.isValid(c2); - } - is0({ c0, c1, c2 }: Fp6) { - const { Fp2 } = this; - return Fp2.is0(c0) && Fp2.is0(c1) && Fp2.is0(c2); - } - isValidNot0(num: Fp6) { - return !this.is0(num) && this.isValid(num); - } - neg({ c0, c1, c2 }: Fp6) { - const { Fp2 } = this; - return { c0: Fp2.neg(c0), c1: Fp2.neg(c1), c2: Fp2.neg(c2) }; - } - eql({ c0, c1, c2 }: Fp6, { c0: r0, c1: r1, c2: r2 }: Fp6) { - const { Fp2 } = this; - return Fp2.eql(c0, r0) && Fp2.eql(c1, r1) && Fp2.eql(c2, r2); - } - sqrt(_: Fp6) { - return notImplemented(); - } - // Do we need division by bigint at all? Should be done via order: - div(lhs: Fp6, rhs: Fp6) { - const { Fp2 } = this; - const { Fp } = Fp2; - return this.mul(lhs, typeof rhs === 'bigint' ? Fp.inv(Fp.create(rhs)) : this.inv(rhs)); - } - pow(num: Fp6, power: Fp): Fp6 { - return mod.FpPow(this, num, power); - } - invertBatch(nums: Fp6[]): Fp6[] { - return mod.FpInvertBatch(this, nums); - } - - inv({ c0, c1, c2 }: Fp6) { - const { Fp2 } = this; - let t0 = Fp2.sub(Fp2.sqr(c0), Fp2.mulByNonresidue(Fp2.mul(c2, c1))); // c0² - c2 * c1 * (u + 1) - let t1 = Fp2.sub(Fp2.mulByNonresidue(Fp2.sqr(c2)), Fp2.mul(c0, c1)); // c2² * (u + 1) - c0 * c1 - let t2 = Fp2.sub(Fp2.sqr(c1), Fp2.mul(c0, c2)); // c1² - c0 * c2 - // 1/(((c2 * T1 + c1 * T2) * v) + c0 * T0) - let t4 = Fp2.inv( - Fp2.add(Fp2.mulByNonresidue(Fp2.add(Fp2.mul(c2, t1), Fp2.mul(c1, t2))), Fp2.mul(c0, t0)) - ); - return { c0: Fp2.mul(t4, t0), c1: Fp2.mul(t4, t1), c2: Fp2.mul(t4, t2) }; - } - // Bytes utils - fromBytes(b: Uint8Array): Fp6 { - const { Fp2 } = this; - if (b.length !== this.BYTES) throw new Error('fromBytes invalid length=' + b.length); - const B2 = Fp2.BYTES; - return { - c0: Fp2.fromBytes(b.subarray(0, B2)), - c1: Fp2.fromBytes(b.subarray(B2, B2 * 2)), - c2: Fp2.fromBytes(b.subarray(2 * B2)), - }; - } - toBytes({ c0, c1, c2 }: Fp6): Uint8Array { - const { Fp2 } = this; - return concatBytes(Fp2.toBytes(c0), Fp2.toBytes(c1), Fp2.toBytes(c2)); - } - cmov({ c0, c1, c2 }: Fp6, { c0: r0, c1: r1, c2: r2 }: Fp6, c: boolean) { - const { Fp2 } = this; - return { - c0: Fp2.cmov(c0, r0, c), - c1: Fp2.cmov(c1, r1, c), - c2: Fp2.cmov(c2, r2, c), - }; - } - fromBigSix(t: BigintSix): Fp6 { - const { Fp2 } = this; - if (!Array.isArray(t) || t.length !== 6) throw new Error('invalid Fp6 usage'); - return { - c0: Fp2.fromBigTuple(t.slice(0, 2) as BigintTuple), - c1: Fp2.fromBigTuple(t.slice(2, 4) as BigintTuple), - c2: Fp2.fromBigTuple(t.slice(4, 6) as BigintTuple), - }; - } - frobeniusMap({ c0, c1, c2 }: Fp6, power: number) { - const { Fp2 } = this; - return { - c0: Fp2.frobeniusMap(c0, power), - c1: Fp2.mul(Fp2.frobeniusMap(c1, power), this.FROBENIUS_COEFFICIENTS_1[power % 6]), - c2: Fp2.mul(Fp2.frobeniusMap(c2, power), this.FROBENIUS_COEFFICIENTS_2[power % 6]), - }; - } - mulByFp2({ c0, c1, c2 }: Fp6, rhs: Fp2): Fp6 { - const { Fp2 } = this; - return { - c0: Fp2.mul(c0, rhs), - c1: Fp2.mul(c1, rhs), - c2: Fp2.mul(c2, rhs), - }; - } - mulByNonresidue({ c0, c1, c2 }: Fp6) { - const { Fp2 } = this; - return { c0: Fp2.mulByNonresidue(c2), c1: c0, c2: c1 }; - } - // Sparse multiplication - mul1({ c0, c1, c2 }: Fp6, b1: Fp2): Fp6 { - const { Fp2 } = this; - return { - c0: Fp2.mulByNonresidue(Fp2.mul(c2, b1)), - c1: Fp2.mul(c0, b1), - c2: Fp2.mul(c1, b1), - }; - } - // Sparse multiplication - mul01({ c0, c1, c2 }: Fp6, b0: Fp2, b1: Fp2): Fp6 { - const { Fp2 } = this; - let t0 = Fp2.mul(c0, b0); // c0 * b0 - let t1 = Fp2.mul(c1, b1); // c1 * b1 - return { - // ((c1 + c2) * b1 - T1) * (u + 1) + T0 - c0: Fp2.add(Fp2.mulByNonresidue(Fp2.sub(Fp2.mul(Fp2.add(c1, c2), b1), t1)), t0), - // (b0 + b1) * (c0 + c1) - T0 - T1 - c1: Fp2.sub(Fp2.sub(Fp2.mul(Fp2.add(b0, b1), Fp2.add(c0, c1)), t0), t1), - // (c0 + c2) * b0 - T0 + T1 - c2: Fp2.add(Fp2.sub(Fp2.mul(Fp2.add(c0, c2), b0), t0), t1), - }; - } -} - -class _Field12 implements Fp12Bls { - readonly ORDER: bigint; - readonly BITS: number; - readonly BYTES: number; - readonly isLE: boolean; - - readonly ZERO: Fp12; - readonly ONE: Fp12; - - readonly Fp6: Fp6Bls; - readonly FROBENIUS_COEFFICIENTS: Fp2[]; - readonly X_LEN: number; - readonly finalExponentiate: Tower12Opts['Fp12finalExponentiate']; - - constructor(Fp6: Fp6Bls, opts: Tower12Opts) { - const { Fp2 } = Fp6; - const { Fp } = Fp2; - this.Fp6 = Fp6; - - this.ORDER = Fp2.ORDER; // TODO: verify if it's unuesd - this.BITS = 2 * Fp6.BITS; - this.BYTES = 2 * Fp6.BYTES; - this.isLE = Fp6.isLE; - this.ZERO = { c0: Fp6.ZERO, c1: Fp6.ZERO }; - this.ONE = { c0: Fp6.ONE, c1: Fp6.ZERO }; - - this.FROBENIUS_COEFFICIENTS = calcFrobeniusCoefficients( - Fp2, - Fp2.NONRESIDUE, - Fp.ORDER, - 12, - 1, - 6 - )[0]; - this.X_LEN = opts.X_LEN; - this.finalExponentiate = opts.Fp12finalExponentiate; - } - create(num: Fp12) { - return num; - } - isValid({ c0, c1 }: Fp12) { - const { Fp6 } = this; - return Fp6.isValid(c0) && Fp6.isValid(c1); - } - is0({ c0, c1 }: Fp12) { - const { Fp6 } = this; - return Fp6.is0(c0) && Fp6.is0(c1); - } - isValidNot0(num: Fp12) { - return !this.is0(num) && this.isValid(num); - } - neg({ c0, c1 }: Fp12) { - const { Fp6 } = this; - return { c0: Fp6.neg(c0), c1: Fp6.neg(c1) }; - } - eql({ c0, c1 }: Fp12, { c0: r0, c1: r1 }: Fp12) { - const { Fp6 } = this; - return Fp6.eql(c0, r0) && Fp6.eql(c1, r1); - } - sqrt(_: any): any { - notImplemented(); - } - inv({ c0, c1 }: Fp12) { - const { Fp6 } = this; - let t = Fp6.inv(Fp6.sub(Fp6.sqr(c0), Fp6.mulByNonresidue(Fp6.sqr(c1)))); // 1 / (c0² - c1² * v) - return { c0: Fp6.mul(c0, t), c1: Fp6.neg(Fp6.mul(c1, t)) }; // ((C0 * T) * T) + (-C1 * T) * w - } - div(lhs: Fp12, rhs: Fp12) { - const { Fp6 } = this; - const { Fp2 } = Fp6; - const { Fp } = Fp2; - return this.mul(lhs, typeof rhs === 'bigint' ? Fp.inv(Fp.create(rhs)) : this.inv(rhs)); - } - pow(num: Fp12, power: bigint): Fp12 { - return mod.FpPow(this, num, power); - } - invertBatch(nums: Fp12[]): Fp12[] { - return mod.FpInvertBatch(this, nums); - } - - // Normalized - add({ c0, c1 }: Fp12, { c0: r0, c1: r1 }: Fp12) { - const { Fp6 } = this; - return { - c0: Fp6.add(c0, r0), - c1: Fp6.add(c1, r1), - }; - } - sub({ c0, c1 }: Fp12, { c0: r0, c1: r1 }: Fp12) { - const { Fp6 } = this; - return { - c0: Fp6.sub(c0, r0), - c1: Fp6.sub(c1, r1), - }; - } - mul({ c0, c1 }: Fp12, rhs: Fp12 | bigint) { - const { Fp6 } = this; - if (typeof rhs === 'bigint') return { c0: Fp6.mul(c0, rhs), c1: Fp6.mul(c1, rhs) }; - let { c0: r0, c1: r1 } = rhs; - let t1 = Fp6.mul(c0, r0); // c0 * r0 - let t2 = Fp6.mul(c1, r1); // c1 * r1 - return { - c0: Fp6.add(t1, Fp6.mulByNonresidue(t2)), // T1 + T2 * v - // (c0 + c1) * (r0 + r1) - (T1 + T2) - c1: Fp6.sub(Fp6.mul(Fp6.add(c0, c1), Fp6.add(r0, r1)), Fp6.add(t1, t2)), - }; - } - sqr({ c0, c1 }: Fp12) { - const { Fp6 } = this; - let ab = Fp6.mul(c0, c1); // c0 * c1 - return { - // (c1 * v + c0) * (c0 + c1) - AB - AB * v - c0: Fp6.sub( - Fp6.sub(Fp6.mul(Fp6.add(Fp6.mulByNonresidue(c1), c0), Fp6.add(c0, c1)), ab), - Fp6.mulByNonresidue(ab) - ), - c1: Fp6.add(ab, ab), - }; // AB + AB - } - // NonNormalized stuff - addN(a: Fp12, b: Fp12): Fp12 { - return this.add(a, b); - } - subN(a: Fp12, b: Fp12): Fp12 { - return this.sub(a, b); - } - mulN(a: Fp12, b: Fp12): Fp12 { - return this.mul(a, b); - } - sqrN(a: Fp12): Fp12 { - return this.sqr(a); - } - - // Bytes utils - fromBytes(b: Uint8Array): Fp12 { - const { Fp6 } = this; - if (b.length !== this.BYTES) throw new Error('fromBytes invalid length=' + b.length); - return { - c0: Fp6.fromBytes(b.subarray(0, Fp6.BYTES)), - c1: Fp6.fromBytes(b.subarray(Fp6.BYTES)), - }; - } - toBytes({ c0, c1 }: Fp12): Uint8Array { - const { Fp6 } = this; - return concatBytes(Fp6.toBytes(c0), Fp6.toBytes(c1)); - } - cmov({ c0, c1 }: Fp12, { c0: r0, c1: r1 }: Fp12, c: boolean) { - const { Fp6 } = this; - return { - c0: Fp6.cmov(c0, r0, c), - c1: Fp6.cmov(c1, r1, c), - }; - } - // Utils - // toString() { - // return '' + 'Fp12(' + this.c0 + this.c1 + '* w'); - // }, - // fromTuple(c: [Fp6, Fp6]) { - // return new Fp12(...c); - // } - fromBigTwelve(t: BigintTwelve): Fp12 { - const { Fp6 } = this; - return { - c0: Fp6.fromBigSix(t.slice(0, 6) as BigintSix), - c1: Fp6.fromBigSix(t.slice(6, 12) as BigintSix), - }; - } - // Raises to q**i -th power - frobeniusMap(lhs: Fp12, power: number) { - const { Fp6 } = this; - const { Fp2 } = Fp6; - const { c0, c1, c2 } = Fp6.frobeniusMap(lhs.c1, power); - const coeff = this.FROBENIUS_COEFFICIENTS[power % 12]; - return { - c0: Fp6.frobeniusMap(lhs.c0, power), - c1: Fp6.create({ - c0: Fp2.mul(c0, coeff), - c1: Fp2.mul(c1, coeff), - c2: Fp2.mul(c2, coeff), - }), - }; - } - mulByFp2({ c0, c1 }: Fp12, rhs: Fp2): Fp12 { - const { Fp6 } = this; - return { - c0: Fp6.mulByFp2(c0, rhs), - c1: Fp6.mulByFp2(c1, rhs), - }; - } - conjugate({ c0, c1 }: Fp12): Fp12 { - return { c0, c1: this.Fp6.neg(c1) }; - } - // Sparse multiplication - mul014({ c0, c1 }: Fp12, o0: Fp2, o1: Fp2, o4: Fp2) { - const { Fp6 } = this; - const { Fp2 } = Fp6; - let t0 = Fp6.mul01(c0, o0, o1); - let t1 = Fp6.mul1(c1, o4); - return { - c0: Fp6.add(Fp6.mulByNonresidue(t1), t0), // T1 * v + T0 - // (c1 + c0) * [o0, o1+o4] - T0 - T1 - c1: Fp6.sub(Fp6.sub(Fp6.mul01(Fp6.add(c1, c0), o0, Fp2.add(o1, o4)), t0), t1), - }; - } - mul034({ c0, c1 }: Fp12, o0: Fp2, o3: Fp2, o4: Fp2) { - const { Fp6 } = this; - const { Fp2 } = Fp6; - const a = Fp6.create({ - c0: Fp2.mul(c0.c0, o0), - c1: Fp2.mul(c0.c1, o0), - c2: Fp2.mul(c0.c2, o0), - }); - const b = Fp6.mul01(c1, o3, o4); - const e = Fp6.mul01(Fp6.add(c0, c1), Fp2.add(o0, o3), o4); - return { - c0: Fp6.add(Fp6.mulByNonresidue(b), a), - c1: Fp6.sub(e, Fp6.add(a, b)), - }; - } - - // A cyclotomic group is a subgroup of Fp^n defined by - // GΦₙ(p) = {α ∈ Fpⁿ : α^Φₙ(p) = 1} - // The result of any pairing is in a cyclotomic subgroup - // https://eprint.iacr.org/2009/565.pdf - // https://eprint.iacr.org/2010/354.pdf - _cyclotomicSquare({ c0, c1 }: Fp12): Fp12 { - const { Fp6 } = this; - const { Fp2 } = Fp6; - const { c0: c0c0, c1: c0c1, c2: c0c2 } = c0; - const { c0: c1c0, c1: c1c1, c2: c1c2 } = c1; - const { first: t3, second: t4 } = Fp2.Fp4Square(c0c0, c1c1); - const { first: t5, second: t6 } = Fp2.Fp4Square(c1c0, c0c2); - const { first: t7, second: t8 } = Fp2.Fp4Square(c0c1, c1c2); - const t9 = Fp2.mulByNonresidue(t8); // T8 * (u + 1) - return { - c0: Fp6.create({ - c0: Fp2.add(Fp2.mul(Fp2.sub(t3, c0c0), _2n), t3), // 2 * (T3 - c0c0) + T3 - c1: Fp2.add(Fp2.mul(Fp2.sub(t5, c0c1), _2n), t5), // 2 * (T5 - c0c1) + T5 - c2: Fp2.add(Fp2.mul(Fp2.sub(t7, c0c2), _2n), t7), - }), // 2 * (T7 - c0c2) + T7 - c1: Fp6.create({ - c0: Fp2.add(Fp2.mul(Fp2.add(t9, c1c0), _2n), t9), // 2 * (T9 + c1c0) + T9 - c1: Fp2.add(Fp2.mul(Fp2.add(t4, c1c1), _2n), t4), // 2 * (T4 + c1c1) + T4 - c2: Fp2.add(Fp2.mul(Fp2.add(t6, c1c2), _2n), t6), - }), - }; // 2 * (T6 + c1c2) + T6 - } - // https://eprint.iacr.org/2009/565.pdf - _cyclotomicExp(num: Fp12, n: bigint): Fp12 { - let z = this.ONE; - for (let i = this.X_LEN - 1; i >= 0; i--) { - z = this._cyclotomicSquare(z); - if (bitGet(n, i)) z = this.mul(z, num); - } - return z; - } -} - -export function tower12(opts: Tower12Opts): { - Fp: Readonly & Required, 'isOdd'>>>; - Fp2: Fp2Bls; - Fp6: Fp6Bls; - Fp12: Fp12Bls; -} { - const Fp = mod.Field(opts.ORDER); - const Fp2 = new _Field2(Fp, opts); - const Fp6 = new _Field6(Fp2); - const Fp12 = new _Field12(Fp6, opts); - return { Fp, Fp2, Fp6, Fp12 }; -} diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/weierstrass.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/weierstrass.ts deleted file mode 100644 index b52d213d..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/weierstrass.ts +++ /dev/null @@ -1,1562 +0,0 @@ -/** - * Short Weierstrass curve methods. The formula is: y² = x³ + ax + b. - * - * ### Design rationale for types - * - * * Interaction between classes from different curves should fail: - * `k256.Point.BASE.add(p256.Point.BASE)` - * * For this purpose we want to use `instanceof` operator, which is fast and works during runtime - * * Different calls of `curve()` would return different classes - - * `curve(params) !== curve(params)`: if somebody decided to monkey-patch their curve, - * it won't affect others - * - * TypeScript can't infer types for classes created inside a function. Classes is one instance - * of nominative types in TypeScript and interfaces only check for shape, so it's hard to create - * unique type for every function call. - * - * We can use generic types via some param, like curve opts, but that would: - * 1. Enable interaction between `curve(params)` and `curve(params)` (curves of same params) - * which is hard to debug. - * 2. Params can be generic and we can't enforce them to be constant value: - * if somebody creates curve from non-constant params, - * it would be allowed to interact with other curves with non-constant params - * - * @todo https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html#unique-symbol - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { hmac as nobleHmac } from '@noble/hashes/hmac.js'; -import { ahash } from '@noble/hashes/utils.js'; -import { - abool, - abytes, - aInRange, - bitLen, - bitMask, - bytesToHex, - bytesToNumberBE, - concatBytes, - createHmacDrbg, - hexToBytes, - isBytes, - memoized, - numberToHexUnpadded, - validateObject, - randomBytes as wcRandomBytes, - type CHash, - type Signer, -} from '../utils.ts'; -import { - createCurveFields, - createKeygen, - mulEndoUnsafe, - negateCt, - normalizeZ, - wNAF, - type AffinePoint, - type CurveLengths, - type CurvePoint, - type CurvePointCons, -} from './curve.ts'; -import { - FpInvertBatch, - getMinHashLength, - mapHashToField, - validateField, - type IField, -} from './modular.ts'; - -export type { AffinePoint }; - -type EndoBasis = [[bigint, bigint], [bigint, bigint]]; -/** - * When Weierstrass curve has `a=0`, it becomes Koblitz curve. - * Koblitz curves allow using **efficiently-computable GLV endomorphism ψ**. - * Endomorphism uses 2x less RAM, speeds up precomputation by 2x and ECDH / key recovery by 20%. - * For precomputed wNAF it trades off 1/2 init time & 1/3 ram for 20% perf hit. - * - * Endomorphism consists of beta, lambda and splitScalar: - * - * 1. GLV endomorphism ψ transforms a point: `P = (x, y) ↦ ψ(P) = (β·x mod p, y)` - * 2. GLV scalar decomposition transforms a scalar: `k ≡ k₁ + k₂·λ (mod n)` - * 3. Then these are combined: `k·P = k₁·P + k₂·ψ(P)` - * 4. Two 128-bit point-by-scalar multiplications + one point addition is faster than - * one 256-bit multiplication. - * - * where - * * beta: β ∈ Fₚ with β³ = 1, β ≠ 1 - * * lambda: λ ∈ Fₙ with λ³ = 1, λ ≠ 1 - * * splitScalar decomposes k ↦ k₁, k₂, by using reduced basis vectors. - * Gauss lattice reduction calculates them from initial basis vectors `(n, 0), (-λ, 0)` - * - * Check out `test/misc/endomorphism.js` and - * [gist](https://gist.github.com/paulmillr/eb670806793e84df628a7c434a873066). - */ -export type EndomorphismOpts = { - beta: bigint; - basises?: EndoBasis; - splitScalar?: (k: bigint) => { k1neg: boolean; k1: bigint; k2neg: boolean; k2: bigint }; -}; -// We construct basis in such way that den is always positive and equals n, but num sign depends on basis (not on secret value) -const divNearest = (num: bigint, den: bigint) => (num + (num >= 0 ? den : -den) / _2n) / den; - -export type ScalarEndoParts = { k1neg: boolean; k1: bigint; k2neg: boolean; k2: bigint }; - -/** - * Splits scalar for GLV endomorphism. - */ -export function _splitEndoScalar(k: bigint, basis: EndoBasis, n: bigint): ScalarEndoParts { - // Split scalar into two such that part is ~half bits: `abs(part) < sqrt(N)` - // Since part can be negative, we need to do this on point. - // TODO: verifyScalar function which consumes lambda - const [[a1, b1], [a2, b2]] = basis; - const c1 = divNearest(b2 * k, n); - const c2 = divNearest(-b1 * k, n); - // |k1|/|k2| is < sqrt(N), but can be negative. - // If we do `k1 mod N`, we'll get big scalar (`> sqrt(N)`): so, we do cheaper negation instead. - let k1 = k - c1 * a1 - c2 * a2; - let k2 = -c1 * b1 - c2 * b2; - const k1neg = k1 < _0n; - const k2neg = k2 < _0n; - if (k1neg) k1 = -k1; - if (k2neg) k2 = -k2; - // Double check that resulting scalar less than half bits of N: otherwise wNAF will fail. - // This should only happen on wrong basises. Also, math inside is too complex and I don't trust it. - const MAX_NUM = bitMask(Math.ceil(bitLen(n) / 2)) + _1n; // Half bits of N - if (k1 < _0n || k1 >= MAX_NUM || k2 < _0n || k2 >= MAX_NUM) { - throw new Error('splitScalar (endomorphism): failed, k=' + k); - } - return { k1neg, k1, k2neg, k2 }; -} - -/** - * Option to enable hedged signatures with improved security. - * - * * Randomly generated k is bad, because broken CSPRNG would leak private keys. - * * Deterministic k (RFC6979) is better; but is suspectible to fault attacks. - * - * We allow using technique described in RFC6979 3.6: additional k', a.k.a. adding randomness - * to deterministic sig. If CSPRNG is broken & randomness is weak, it would STILL be as secure - * as ordinary sig without ExtraEntropy. - * - * * `true` means "fetch data, from CSPRNG, incorporate it into k generation" - * * `false` means "disable extra entropy, use purely deterministic k" - * * `Uint8Array` passed means "incorporate following data into k generation" - * - * https://paulmillr.com/posts/deterministic-signatures/ - */ -export type ECDSAExtraEntropy = boolean | Uint8Array; -/** - * - `compact` is the default format - * - `recovered` is the same as compact, but with an extra byte indicating recovery byte - * - `der` is ASN.1 DER encoding - */ -export type ECDSASignatureFormat = 'compact' | 'recovered' | 'der'; -/** - * - `prehash`: (default: true) indicates whether to do sha256(message). - * When a custom hash is used, it must be set to `false`. - */ -export type ECDSARecoverOpts = { - prehash?: boolean; -}; -/** - * - `prehash`: (default: true) indicates whether to do sha256(message). - * When a custom hash is used, it must be set to `false`. - * - `lowS`: (default: true) prohibits signatures which have (sig.s >= CURVE.n/2n). - * Compatible with BTC/ETH. Setting `lowS: false` allows to create malleable signatures, - * which is default openssl behavior. - * Non-malleable signatures can still be successfully verified in openssl. - * - `format`: (default: 'compact') 'compact' or 'recovered' with recovery byte - */ -export type ECDSAVerifyOpts = { - prehash?: boolean; - lowS?: boolean; - format?: ECDSASignatureFormat; -}; -/** - * - `prehash`: (default: true) indicates whether to do sha256(message). - * When a custom hash is used, it must be set to `false`. - * - `lowS`: (default: true) prohibits signatures which have (sig.s >= CURVE.n/2n). - * Compatible with BTC/ETH. Setting `lowS: false` allows to create malleable signatures, - * which is default openssl behavior. - * Non-malleable signatures can still be successfully verified in openssl. - * - `format`: (default: 'compact') 'compact' or 'recovered' with recovery byte - * - `extraEntropy`: (default: false) creates sigs with increased security, see {@link ECDSAExtraEntropy} - */ -export type ECDSASignOpts = { - prehash?: boolean; - lowS?: boolean; - format?: ECDSASignatureFormat; - extraEntropy?: ECDSAExtraEntropy; -}; - -function validateSigFormat(format: string): ECDSASignatureFormat { - if (!['compact', 'recovered', 'der'].includes(format)) - throw new Error('Signature format must be "compact", "recovered", or "der"'); - return format as ECDSASignatureFormat; -} - -function validateSigOpts>( - opts: T, - def: D -): Required { - const optsn: ECDSASignOpts = {}; - for (let optName of Object.keys(def)) { - // @ts-ignore - optsn[optName] = opts[optName] === undefined ? def[optName] : opts[optName]; - } - abool(optsn.lowS!, 'lowS'); - abool(optsn.prehash!, 'prehash'); - if (optsn.format !== undefined) validateSigFormat(optsn.format); - return optsn as Required; -} - -/** Instance methods for 3D XYZ projective points. */ -export interface WeierstrassPoint extends CurvePoint> { - /** projective X coordinate. Different from affine x. */ - readonly X: T; - /** projective Y coordinate. Different from affine y. */ - readonly Y: T; - /** projective z coordinate */ - readonly Z: T; - /** affine x coordinate. Different from projective X. */ - get x(): T; - /** affine y coordinate. Different from projective Y. */ - get y(): T; - /** Encodes point using IEEE P1363 (DER) encoding. First byte is 2/3/4. Default = isCompressed. */ - toBytes(isCompressed?: boolean): Uint8Array; - toHex(isCompressed?: boolean): string; -} - -/** Static methods for 3D XYZ projective points. */ -export interface WeierstrassPointCons extends CurvePointCons> { - /** Does NOT validate if the point is valid. Use `.assertValidity()`. */ - new (X: T, Y: T, Z: T): WeierstrassPoint; - CURVE(): WeierstrassOpts; -} - -/** - * Weierstrass curve options. - * - * * p: prime characteristic (order) of finite field, in which arithmetics is done - * * n: order of prime subgroup a.k.a total amount of valid curve points - * * h: cofactor, usually 1. h*n is group order; n is subgroup order - * * a: formula param, must be in field of p - * * b: formula param, must be in field of p - * * Gx: x coordinate of generator point a.k.a. base point - * * Gy: y coordinate of generator point - */ -export type WeierstrassOpts = Readonly<{ - p: bigint; - n: bigint; - h: bigint; - a: T; - b: T; - Gx: T; - Gy: T; -}>; - -// When a cofactor != 1, there can be an effective methods to: -// 1. Determine whether a point is torsion-free -// 2. Clear torsion component -export type WeierstrassExtraOpts = Partial<{ - Fp: IField; - Fn: IField; - allowInfinityPoint: boolean; - endo: EndomorphismOpts; - isTorsionFree: (c: WeierstrassPointCons, point: WeierstrassPoint) => boolean; - clearCofactor: (c: WeierstrassPointCons, point: WeierstrassPoint) => WeierstrassPoint; - fromBytes: (bytes: Uint8Array) => AffinePoint; - toBytes: ( - c: WeierstrassPointCons, - point: WeierstrassPoint, - isCompressed: boolean - ) => Uint8Array; -}>; - -/** - * Options for ECDSA signatures over a Weierstrass curve. - * - * * lowS: (default: true) whether produced / verified signatures occupy low half of ecdsaOpts.p. Prevents malleability. - * * hmac: (default: noble-hashes hmac) function, would be used to init hmac-drbg for k generation. - * * randomBytes: (default: webcrypto os-level CSPRNG) custom method for fetching secure randomness. - * * bits2int, bits2int_modN: used in sigs, sometimes overridden by curves - */ -export type ECDSAOpts = Partial<{ - lowS: boolean; - hmac: (key: Uint8Array, message: Uint8Array) => Uint8Array; - randomBytes: (bytesLength?: number) => Uint8Array; - bits2int: (bytes: Uint8Array) => bigint; - bits2int_modN: (bytes: Uint8Array) => bigint; -}>; - -/** - * Elliptic Curve Diffie-Hellman interface. - * Provides keygen, secret-to-public conversion, calculating shared secrets. - */ -export interface ECDH { - keygen: (seed?: Uint8Array) => { secretKey: Uint8Array; publicKey: Uint8Array }; - getPublicKey: (secretKey: Uint8Array, isCompressed?: boolean) => Uint8Array; - getSharedSecret: ( - secretKeyA: Uint8Array, - publicKeyB: Uint8Array, - isCompressed?: boolean - ) => Uint8Array; - Point: WeierstrassPointCons; - utils: { - isValidSecretKey: (secretKey: Uint8Array) => boolean; - isValidPublicKey: (publicKey: Uint8Array, isCompressed?: boolean) => boolean; - randomSecretKey: (seed?: Uint8Array) => Uint8Array; - }; - lengths: CurveLengths; -} - -/** - * ECDSA interface. - * Only supported for prime fields, not Fp2 (extension fields). - */ -export interface ECDSA extends ECDH { - sign: (message: Uint8Array, secretKey: Uint8Array, opts?: ECDSASignOpts) => Uint8Array; - verify: ( - signature: Uint8Array, - message: Uint8Array, - publicKey: Uint8Array, - opts?: ECDSAVerifyOpts - ) => boolean; - recoverPublicKey(signature: Uint8Array, message: Uint8Array, opts?: ECDSARecoverOpts): Uint8Array; - Signature: ECDSASignatureCons; -} -export class DERErr extends Error { - constructor(m = '') { - super(m); - } -} -export type IDER = { - // asn.1 DER encoding utils - Err: typeof DERErr; - // Basic building block is TLV (Tag-Length-Value) - _tlv: { - encode: (tag: number, data: string) => string; - // v - value, l - left bytes (unparsed) - decode(tag: number, data: Uint8Array): { v: Uint8Array; l: Uint8Array }; - }; - // https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag, - // since we always use positive integers here. It must always be empty: - // - add zero byte if exists - // - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding) - _int: { - encode(num: bigint): string; - decode(data: Uint8Array): bigint; - }; - toSig(hex: string | Uint8Array): { r: bigint; s: bigint }; - hexFromSig(sig: { r: bigint; s: bigint }): string; -}; -/** - * ASN.1 DER encoding utilities. ASN is very complex & fragile. Format: - * - * [0x30 (SEQUENCE), bytelength, 0x02 (INTEGER), intLength, R, 0x02 (INTEGER), intLength, S] - * - * Docs: https://letsencrypt.org/docs/a-warm-welcome-to-asn1-and-der/, https://luca.ntop.org/Teaching/Appunti/asn1.html - */ -export const DER: IDER = { - // asn.1 DER encoding utils - Err: DERErr, - // Basic building block is TLV (Tag-Length-Value) - _tlv: { - encode: (tag: number, data: string): string => { - const { Err: E } = DER; - if (tag < 0 || tag > 256) throw new E('tlv.encode: wrong tag'); - if (data.length & 1) throw new E('tlv.encode: unpadded data'); - const dataLen = data.length / 2; - const len = numberToHexUnpadded(dataLen); - if ((len.length / 2) & 0b1000_0000) throw new E('tlv.encode: long form length too big'); - // length of length with long form flag - const lenLen = dataLen > 127 ? numberToHexUnpadded((len.length / 2) | 0b1000_0000) : ''; - const t = numberToHexUnpadded(tag); - return t + lenLen + len + data; - }, - // v - value, l - left bytes (unparsed) - decode(tag: number, data: Uint8Array): { v: Uint8Array; l: Uint8Array } { - const { Err: E } = DER; - let pos = 0; - if (tag < 0 || tag > 256) throw new E('tlv.encode: wrong tag'); - if (data.length < 2 || data[pos++] !== tag) throw new E('tlv.decode: wrong tlv'); - const first = data[pos++]; - const isLong = !!(first & 0b1000_0000); // First bit of first length byte is flag for short/long form - let length = 0; - if (!isLong) length = first; - else { - // Long form: [longFlag(1bit), lengthLength(7bit), length (BE)] - const lenLen = first & 0b0111_1111; - if (!lenLen) throw new E('tlv.decode(long): indefinite length not supported'); - if (lenLen > 4) throw new E('tlv.decode(long): byte length is too big'); // this will overflow u32 in js - const lengthBytes = data.subarray(pos, pos + lenLen); - if (lengthBytes.length !== lenLen) throw new E('tlv.decode: length bytes not complete'); - if (lengthBytes[0] === 0) throw new E('tlv.decode(long): zero leftmost byte'); - for (const b of lengthBytes) length = (length << 8) | b; - pos += lenLen; - if (length < 128) throw new E('tlv.decode(long): not minimal encoding'); - } - const v = data.subarray(pos, pos + length); - if (v.length !== length) throw new E('tlv.decode: wrong value length'); - return { v, l: data.subarray(pos + length) }; - }, - }, - // https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag, - // since we always use positive integers here. It must always be empty: - // - add zero byte if exists - // - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding) - _int: { - encode(num: bigint): string { - const { Err: E } = DER; - if (num < _0n) throw new E('integer: negative integers are not allowed'); - let hex = numberToHexUnpadded(num); - // Pad with zero byte if negative flag is present - if (Number.parseInt(hex[0], 16) & 0b1000) hex = '00' + hex; - if (hex.length & 1) throw new E('unexpected DER parsing assertion: unpadded hex'); - return hex; - }, - decode(data: Uint8Array): bigint { - const { Err: E } = DER; - if (data[0] & 0b1000_0000) throw new E('invalid signature integer: negative'); - if (data[0] === 0x00 && !(data[1] & 0b1000_0000)) - throw new E('invalid signature integer: unnecessary leading zero'); - return bytesToNumberBE(data); - }, - }, - toSig(bytes: Uint8Array): { r: bigint; s: bigint } { - // parse DER signature - const { Err: E, _int: int, _tlv: tlv } = DER; - const data = abytes(bytes, undefined, 'signature'); - const { v: seqBytes, l: seqLeftBytes } = tlv.decode(0x30, data); - if (seqLeftBytes.length) throw new E('invalid signature: left bytes after parsing'); - const { v: rBytes, l: rLeftBytes } = tlv.decode(0x02, seqBytes); - const { v: sBytes, l: sLeftBytes } = tlv.decode(0x02, rLeftBytes); - if (sLeftBytes.length) throw new E('invalid signature: left bytes after parsing'); - return { r: int.decode(rBytes), s: int.decode(sBytes) }; - }, - hexFromSig(sig: { r: bigint; s: bigint }): string { - const { _tlv: tlv, _int: int } = DER; - const rs = tlv.encode(0x02, int.encode(sig.r)); - const ss = tlv.encode(0x02, int.encode(sig.s)); - const seq = rs + ss; - return tlv.encode(0x30, seq); - }, -}; - -// Be friendly to bad ECMAScript parsers by not using bigint literals -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = BigInt(4); - -/** - * Creates weierstrass Point constructor, based on specified curve options. - * - * See {@link WeierstrassOpts}. - * - * @example -```js -const opts = { - p: 0xfffffffffffffffffffffffffffffffeffffac73n, - n: 0x100000000000000000001b8fa16dfab9aca16b6b3n, - h: 1n, - a: 0n, - b: 7n, - Gx: 0x3b4c382ce37aa192a4019e763036f4f5dd4d7ebbn, - Gy: 0x938cf935318fdced6bc28286531733c3f03c4feen, -}; -const secp160k1_Point = weierstrass(opts); -``` - */ -export function weierstrass( - params: WeierstrassOpts, - extraOpts: WeierstrassExtraOpts = {} -): WeierstrassPointCons { - const validated = createCurveFields('weierstrass', params, extraOpts); - const { Fp, Fn } = validated; - let CURVE = validated.CURVE as WeierstrassOpts; - const { h: cofactor, n: CURVE_ORDER } = CURVE; - validateObject( - extraOpts, - {}, - { - allowInfinityPoint: 'boolean', - clearCofactor: 'function', - isTorsionFree: 'function', - fromBytes: 'function', - toBytes: 'function', - endo: 'object', - } - ); - - const { endo } = extraOpts; - if (endo) { - // validateObject(endo, { beta: 'bigint', splitScalar: 'function' }); - if (!Fp.is0(CURVE.a) || typeof endo.beta !== 'bigint' || !Array.isArray(endo.basises)) { - throw new Error('invalid endo: expected "beta": bigint and "basises": array'); - } - } - - const lengths = getWLengths(Fp, Fn); - - function assertCompressionIsSupported() { - if (!Fp.isOdd) throw new Error('compression is not supported: Field does not have .isOdd()'); - } - - // Implements IEEE P1363 point encoding - function pointToBytes( - _c: WeierstrassPointCons, - point: WeierstrassPoint, - isCompressed: boolean - ): Uint8Array { - const { x, y } = point.toAffine(); - const bx = Fp.toBytes(x); - abool(isCompressed, 'isCompressed'); - if (isCompressed) { - assertCompressionIsSupported(); - const hasEvenY = !Fp.isOdd!(y); - return concatBytes(pprefix(hasEvenY), bx); - } else { - return concatBytes(Uint8Array.of(0x04), bx, Fp.toBytes(y)); - } - } - function pointFromBytes(bytes: Uint8Array) { - abytes(bytes, undefined, 'Point'); - const { publicKey: comp, publicKeyUncompressed: uncomp } = lengths; // e.g. for 32-byte: 33, 65 - const length = bytes.length; - const head = bytes[0]; - const tail = bytes.subarray(1); - // No actual validation is done here: use .assertValidity() - if (length === comp && (head === 0x02 || head === 0x03)) { - const x = Fp.fromBytes(tail); - if (!Fp.isValid(x)) throw new Error('bad point: is not on curve, wrong x'); - const y2 = weierstrassEquation(x); // y² = x³ + ax + b - let y: T; - try { - y = Fp.sqrt(y2); // y = y² ^ (p+1)/4 - } catch (sqrtError) { - const err = sqrtError instanceof Error ? ': ' + sqrtError.message : ''; - throw new Error('bad point: is not on curve, sqrt error' + err); - } - assertCompressionIsSupported(); - const evenY = Fp.isOdd!(y); - const evenH = (head & 1) === 1; // ECDSA-specific - if (evenH !== evenY) y = Fp.neg(y); - return { x, y }; - } else if (length === uncomp && head === 0x04) { - // TODO: more checks - const L = Fp.BYTES; - const x = Fp.fromBytes(tail.subarray(0, L)); - const y = Fp.fromBytes(tail.subarray(L, L * 2)); - if (!isValidXY(x, y)) throw new Error('bad point: is not on curve'); - return { x, y }; - } else { - throw new Error( - `bad point: got length ${length}, expected compressed=${comp} or uncompressed=${uncomp}` - ); - } - } - - const encodePoint = extraOpts.toBytes || pointToBytes; - const decodePoint = extraOpts.fromBytes || pointFromBytes; - function weierstrassEquation(x: T): T { - const x2 = Fp.sqr(x); // x * x - const x3 = Fp.mul(x2, x); // x² * x - return Fp.add(Fp.add(x3, Fp.mul(x, CURVE.a)), CURVE.b); // x³ + a * x + b - } - - // TODO: move top-level - /** Checks whether equation holds for given x, y: y² == x³ + ax + b */ - function isValidXY(x: T, y: T): boolean { - const left = Fp.sqr(y); // y² - const right = weierstrassEquation(x); // x³ + ax + b - return Fp.eql(left, right); - } - - // Validate whether the passed curve params are valid. - // Test 1: equation y² = x³ + ax + b should work for generator point. - if (!isValidXY(CURVE.Gx, CURVE.Gy)) throw new Error('bad curve params: generator point'); - - // Test 2: discriminant Δ part should be non-zero: 4a³ + 27b² != 0. - // Guarantees curve is genus-1, smooth (non-singular). - const _4a3 = Fp.mul(Fp.pow(CURVE.a, _3n), _4n); - const _27b2 = Fp.mul(Fp.sqr(CURVE.b), BigInt(27)); - if (Fp.is0(Fp.add(_4a3, _27b2))) throw new Error('bad curve params: a or b'); - - /** Asserts coordinate is valid: 0 <= n < Fp.ORDER. */ - function acoord(title: string, n: T, banZero = false) { - if (!Fp.isValid(n) || (banZero && Fp.is0(n))) throw new Error(`bad point coordinate ${title}`); - return n; - } - - function aprjpoint(other: unknown) { - if (!(other instanceof Point)) throw new Error('Weierstrass Point expected'); - } - - function splitEndoScalarN(k: bigint) { - if (!endo || !endo.basises) throw new Error('no endo'); - return _splitEndoScalar(k, endo.basises, Fn.ORDER); - } - - // Memoized toAffine / validity check. They are heavy. Points are immutable. - - // Converts Projective point to affine (x, y) coordinates. - // Can accept precomputed Z^-1 - for example, from invertBatch. - // (X, Y, Z) ∋ (x=X/Z, y=Y/Z) - const toAffineMemo = memoized((p: Point, iz?: T): AffinePoint => { - const { X, Y, Z } = p; - // Fast-path for normalized points - if (Fp.eql(Z, Fp.ONE)) return { x: X, y: Y }; - const is0 = p.is0(); - // If invZ was 0, we return zero point. However we still want to execute - // all operations, so we replace invZ with a random number, 1. - if (iz == null) iz = is0 ? Fp.ONE : Fp.inv(Z); - const x = Fp.mul(X, iz); - const y = Fp.mul(Y, iz); - const zz = Fp.mul(Z, iz); - if (is0) return { x: Fp.ZERO, y: Fp.ZERO }; - if (!Fp.eql(zz, Fp.ONE)) throw new Error('invZ was invalid'); - return { x, y }; - }); - // NOTE: on exception this will crash 'cached' and no value will be set. - // Otherwise true will be return - const assertValidMemo = memoized((p: Point) => { - if (p.is0()) { - // (0, 1, 0) aka ZERO is invalid in most contexts. - // In BLS, ZERO can be serialized, so we allow it. - // (0, 0, 0) is invalid representation of ZERO. - if (extraOpts.allowInfinityPoint && !Fp.is0(p.Y)) return; - throw new Error('bad point: ZERO'); - } - // Some 3rd-party test vectors require different wording between here & `fromCompressedHex` - const { x, y } = p.toAffine(); - if (!Fp.isValid(x) || !Fp.isValid(y)) throw new Error('bad point: x or y not field elements'); - if (!isValidXY(x, y)) throw new Error('bad point: equation left != right'); - if (!p.isTorsionFree()) throw new Error('bad point: not in prime-order subgroup'); - return true; - }); - - function finishEndo( - endoBeta: EndomorphismOpts['beta'], - k1p: Point, - k2p: Point, - k1neg: boolean, - k2neg: boolean - ) { - k2p = new Point(Fp.mul(k2p.X, endoBeta), k2p.Y, k2p.Z); - k1p = negateCt(k1neg, k1p); - k2p = negateCt(k2neg, k2p); - return k1p.add(k2p); - } - - /** - * Projective Point works in 3d / projective (homogeneous) coordinates:(X, Y, Z) ∋ (x=X/Z, y=Y/Z). - * Default Point works in 2d / affine coordinates: (x, y). - * We're doing calculations in projective, because its operations don't require costly inversion. - */ - class Point implements WeierstrassPoint { - // base / generator point - static readonly BASE = new Point(CURVE.Gx, CURVE.Gy, Fp.ONE); - // zero / infinity / identity point - static readonly ZERO = new Point(Fp.ZERO, Fp.ONE, Fp.ZERO); // 0, 1, 0 - // math field - static readonly Fp = Fp; - // scalar field - static readonly Fn = Fn; - - readonly X: T; - readonly Y: T; - readonly Z: T; - - /** Does NOT validate if the point is valid. Use `.assertValidity()`. */ - constructor(X: T, Y: T, Z: T) { - this.X = acoord('x', X); - this.Y = acoord('y', Y, true); - this.Z = acoord('z', Z); - Object.freeze(this); - } - - static CURVE(): WeierstrassOpts { - return CURVE; - } - - /** Does NOT validate if the point is valid. Use `.assertValidity()`. */ - static fromAffine(p: AffinePoint): Point { - const { x, y } = p || {}; - if (!p || !Fp.isValid(x) || !Fp.isValid(y)) throw new Error('invalid affine point'); - if (p instanceof Point) throw new Error('projective point not allowed'); - // (0, 0) would've produced (0, 0, 1) - instead, we need (0, 1, 0) - if (Fp.is0(x) && Fp.is0(y)) return Point.ZERO; - return new Point(x, y, Fp.ONE); - } - - static fromBytes(bytes: Uint8Array): Point { - const P = Point.fromAffine(decodePoint(abytes(bytes, undefined, 'point'))); - P.assertValidity(); - return P; - } - - static fromHex(hex: string): Point { - return Point.fromBytes(hexToBytes(hex)); - } - - get x(): T { - return this.toAffine().x; - } - get y(): T { - return this.toAffine().y; - } - - /** - * - * @param windowSize - * @param isLazy true will defer table computation until the first multiplication - * @returns - */ - precompute(windowSize: number = 8, isLazy = true): Point { - wnaf.createCache(this, windowSize); - if (!isLazy) this.multiply(_3n); // random number - return this; - } - - // TODO: return `this` - /** A point on curve is valid if it conforms to equation. */ - assertValidity(): void { - assertValidMemo(this); - } - - hasEvenY(): boolean { - const { y } = this.toAffine(); - if (!Fp.isOdd) throw new Error("Field doesn't support isOdd"); - return !Fp.isOdd(y); - } - - /** Compare one point to another. */ - equals(other: Point): boolean { - aprjpoint(other); - const { X: X1, Y: Y1, Z: Z1 } = this; - const { X: X2, Y: Y2, Z: Z2 } = other; - const U1 = Fp.eql(Fp.mul(X1, Z2), Fp.mul(X2, Z1)); - const U2 = Fp.eql(Fp.mul(Y1, Z2), Fp.mul(Y2, Z1)); - return U1 && U2; - } - - /** Flips point to one corresponding to (x, -y) in Affine coordinates. */ - negate(): Point { - return new Point(this.X, Fp.neg(this.Y), this.Z); - } - - // Renes-Costello-Batina exception-free doubling formula. - // There is 30% faster Jacobian formula, but it is not complete. - // https://eprint.iacr.org/2015/1060, algorithm 3 - // Cost: 8M + 3S + 3*a + 2*b3 + 15add. - double() { - const { a, b } = CURVE; - const b3 = Fp.mul(b, _3n); - const { X: X1, Y: Y1, Z: Z1 } = this; - let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore - let t0 = Fp.mul(X1, X1); // step 1 - let t1 = Fp.mul(Y1, Y1); - let t2 = Fp.mul(Z1, Z1); - let t3 = Fp.mul(X1, Y1); - t3 = Fp.add(t3, t3); // step 5 - Z3 = Fp.mul(X1, Z1); - Z3 = Fp.add(Z3, Z3); - X3 = Fp.mul(a, Z3); - Y3 = Fp.mul(b3, t2); - Y3 = Fp.add(X3, Y3); // step 10 - X3 = Fp.sub(t1, Y3); - Y3 = Fp.add(t1, Y3); - Y3 = Fp.mul(X3, Y3); - X3 = Fp.mul(t3, X3); - Z3 = Fp.mul(b3, Z3); // step 15 - t2 = Fp.mul(a, t2); - t3 = Fp.sub(t0, t2); - t3 = Fp.mul(a, t3); - t3 = Fp.add(t3, Z3); - Z3 = Fp.add(t0, t0); // step 20 - t0 = Fp.add(Z3, t0); - t0 = Fp.add(t0, t2); - t0 = Fp.mul(t0, t3); - Y3 = Fp.add(Y3, t0); - t2 = Fp.mul(Y1, Z1); // step 25 - t2 = Fp.add(t2, t2); - t0 = Fp.mul(t2, t3); - X3 = Fp.sub(X3, t0); - Z3 = Fp.mul(t2, t1); - Z3 = Fp.add(Z3, Z3); // step 30 - Z3 = Fp.add(Z3, Z3); - return new Point(X3, Y3, Z3); - } - - // Renes-Costello-Batina exception-free addition formula. - // There is 30% faster Jacobian formula, but it is not complete. - // https://eprint.iacr.org/2015/1060, algorithm 1 - // Cost: 12M + 0S + 3*a + 3*b3 + 23add. - add(other: Point): Point { - aprjpoint(other); - const { X: X1, Y: Y1, Z: Z1 } = this; - const { X: X2, Y: Y2, Z: Z2 } = other; - let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore - const a = CURVE.a; - const b3 = Fp.mul(CURVE.b, _3n); - let t0 = Fp.mul(X1, X2); // step 1 - let t1 = Fp.mul(Y1, Y2); - let t2 = Fp.mul(Z1, Z2); - let t3 = Fp.add(X1, Y1); - let t4 = Fp.add(X2, Y2); // step 5 - t3 = Fp.mul(t3, t4); - t4 = Fp.add(t0, t1); - t3 = Fp.sub(t3, t4); - t4 = Fp.add(X1, Z1); - let t5 = Fp.add(X2, Z2); // step 10 - t4 = Fp.mul(t4, t5); - t5 = Fp.add(t0, t2); - t4 = Fp.sub(t4, t5); - t5 = Fp.add(Y1, Z1); - X3 = Fp.add(Y2, Z2); // step 15 - t5 = Fp.mul(t5, X3); - X3 = Fp.add(t1, t2); - t5 = Fp.sub(t5, X3); - Z3 = Fp.mul(a, t4); - X3 = Fp.mul(b3, t2); // step 20 - Z3 = Fp.add(X3, Z3); - X3 = Fp.sub(t1, Z3); - Z3 = Fp.add(t1, Z3); - Y3 = Fp.mul(X3, Z3); - t1 = Fp.add(t0, t0); // step 25 - t1 = Fp.add(t1, t0); - t2 = Fp.mul(a, t2); - t4 = Fp.mul(b3, t4); - t1 = Fp.add(t1, t2); - t2 = Fp.sub(t0, t2); // step 30 - t2 = Fp.mul(a, t2); - t4 = Fp.add(t4, t2); - t0 = Fp.mul(t1, t4); - Y3 = Fp.add(Y3, t0); - t0 = Fp.mul(t5, t4); // step 35 - X3 = Fp.mul(t3, X3); - X3 = Fp.sub(X3, t0); - t0 = Fp.mul(t3, t1); - Z3 = Fp.mul(t5, Z3); - Z3 = Fp.add(Z3, t0); // step 40 - return new Point(X3, Y3, Z3); - } - - subtract(other: Point) { - return this.add(other.negate()); - } - - is0(): boolean { - return this.equals(Point.ZERO); - } - - /** - * Constant time multiplication. - * Uses wNAF method. Windowed method may be 10% faster, - * but takes 2x longer to generate and consumes 2x memory. - * Uses precomputes when available. - * Uses endomorphism for Koblitz curves. - * @param scalar by which the point would be multiplied - * @returns New point - */ - multiply(scalar: bigint): Point { - const { endo } = extraOpts; - if (!Fn.isValidNot0(scalar)) throw new Error('invalid scalar: out of range'); // 0 is invalid - let point: Point, fake: Point; // Fake point is used to const-time mult - const mul = (n: bigint) => wnaf.cached(this, n, (p) => normalizeZ(Point, p)); - /** See docs for {@link EndomorphismOpts} */ - if (endo) { - const { k1neg, k1, k2neg, k2 } = splitEndoScalarN(scalar); - const { p: k1p, f: k1f } = mul(k1); - const { p: k2p, f: k2f } = mul(k2); - fake = k1f.add(k2f); - point = finishEndo(endo.beta, k1p, k2p, k1neg, k2neg); - } else { - const { p, f } = mul(scalar); - point = p; - fake = f; - } - // Normalize `z` for both points, but return only real one - return normalizeZ(Point, [point, fake])[0]; - } - - /** - * Non-constant-time multiplication. Uses double-and-add algorithm. - * It's faster, but should only be used when you don't care about - * an exposed secret key e.g. sig verification, which works over *public* keys. - */ - multiplyUnsafe(sc: bigint): Point { - const { endo } = extraOpts; - const p = this as Point; - if (!Fn.isValid(sc)) throw new Error('invalid scalar: out of range'); // 0 is valid - if (sc === _0n || p.is0()) return Point.ZERO; // 0 - if (sc === _1n) return p; // 1 - if (wnaf.hasCache(this)) return this.multiply(sc); // precomputes - // We don't have method for double scalar multiplication (aP + bQ): - // Even with using Strauss-Shamir trick, it's 35% slower than naïve mul+add. - if (endo) { - const { k1neg, k1, k2neg, k2 } = splitEndoScalarN(sc); - const { p1, p2 } = mulEndoUnsafe(Point, p, k1, k2); // 30% faster vs wnaf.unsafe - return finishEndo(endo.beta, p1, p2, k1neg, k2neg); - } else { - return wnaf.unsafe(p, sc); - } - } - - /** - * Converts Projective point to affine (x, y) coordinates. - * @param invertedZ Z^-1 (inverted zero) - optional, precomputation is useful for invertBatch - */ - toAffine(invertedZ?: T): AffinePoint { - return toAffineMemo(this, invertedZ); - } - - /** - * Checks whether Point is free of torsion elements (is in prime subgroup). - * Always torsion-free for cofactor=1 curves. - */ - isTorsionFree(): boolean { - const { isTorsionFree } = extraOpts; - if (cofactor === _1n) return true; - if (isTorsionFree) return isTorsionFree(Point, this); - return wnaf.unsafe(this, CURVE_ORDER).is0(); - } - - clearCofactor(): Point { - const { clearCofactor } = extraOpts; - if (cofactor === _1n) return this; // Fast-path - if (clearCofactor) return clearCofactor(Point, this) as Point; - return this.multiplyUnsafe(cofactor); - } - - isSmallOrder(): boolean { - // can we use this.clearCofactor()? - return this.multiplyUnsafe(cofactor).is0(); - } - - toBytes(isCompressed = true): Uint8Array { - abool(isCompressed, 'isCompressed'); - this.assertValidity(); - return encodePoint(Point, this, isCompressed); - } - - toHex(isCompressed = true): string { - return bytesToHex(this.toBytes(isCompressed)); - } - - toString() { - return ``; - } - } - const bits = Fn.BITS; - const wnaf = new wNAF(Point, extraOpts.endo ? Math.ceil(bits / 2) : bits); - Point.BASE.precompute(8); // Enable precomputes. Slows down first publicKey computation by 20ms. - return Point; -} - -/** Methods of ECDSA signature instance. */ -export interface ECDSASignature { - readonly r: bigint; - readonly s: bigint; - readonly recovery?: number; - addRecoveryBit(recovery: number): ECDSASignature & { readonly recovery: number }; - hasHighS(): boolean; - recoverPublicKey(messageHash: Uint8Array): WeierstrassPoint; - toBytes(format?: string): Uint8Array; - toHex(format?: string): string; -} -/** Methods of ECDSA signature constructor. */ -export type ECDSASignatureCons = { - new (r: bigint, s: bigint, recovery?: number): ECDSASignature; - fromBytes(bytes: Uint8Array, format?: ECDSASignatureFormat): ECDSASignature; - fromHex(hex: string, format?: ECDSASignatureFormat): ECDSASignature; -}; - -// Points start with byte 0x02 when y is even; otherwise 0x03 -function pprefix(hasEvenY: boolean): Uint8Array { - return Uint8Array.of(hasEvenY ? 0x02 : 0x03); -} - -/** - * Implementation of the Shallue and van de Woestijne method for any weierstrass curve. - * TODO: check if there is a way to merge this with uvRatio in Edwards; move to modular. - * b = True and y = sqrt(u / v) if (u / v) is square in F, and - * b = False and y = sqrt(Z * (u / v)) otherwise. - * @param Fp - * @param Z - * @returns - */ -export function SWUFpSqrtRatio( - Fp: IField, - Z: T -): (u: T, v: T) => { isValid: boolean; value: T } { - // Generic implementation - const q = Fp.ORDER; - let l = _0n; - for (let o = q - _1n; o % _2n === _0n; o /= _2n) l += _1n; - const c1 = l; // 1. c1, the largest integer such that 2^c1 divides q - 1. - // We need 2n ** c1 and 2n ** (c1-1). We can't use **; but we can use <<. - // 2n ** c1 == 2n << (c1-1) - const _2n_pow_c1_1 = _2n << (c1 - _1n - _1n); - const _2n_pow_c1 = _2n_pow_c1_1 * _2n; - const c2 = (q - _1n) / _2n_pow_c1; // 2. c2 = (q - 1) / (2^c1) # Integer arithmetic - const c3 = (c2 - _1n) / _2n; // 3. c3 = (c2 - 1) / 2 # Integer arithmetic - const c4 = _2n_pow_c1 - _1n; // 4. c4 = 2^c1 - 1 # Integer arithmetic - const c5 = _2n_pow_c1_1; // 5. c5 = 2^(c1 - 1) # Integer arithmetic - const c6 = Fp.pow(Z, c2); // 6. c6 = Z^c2 - const c7 = Fp.pow(Z, (c2 + _1n) / _2n); // 7. c7 = Z^((c2 + 1) / 2) - let sqrtRatio = (u: T, v: T): { isValid: boolean; value: T } => { - let tv1 = c6; // 1. tv1 = c6 - let tv2 = Fp.pow(v, c4); // 2. tv2 = v^c4 - let tv3 = Fp.sqr(tv2); // 3. tv3 = tv2^2 - tv3 = Fp.mul(tv3, v); // 4. tv3 = tv3 * v - let tv5 = Fp.mul(u, tv3); // 5. tv5 = u * tv3 - tv5 = Fp.pow(tv5, c3); // 6. tv5 = tv5^c3 - tv5 = Fp.mul(tv5, tv2); // 7. tv5 = tv5 * tv2 - tv2 = Fp.mul(tv5, v); // 8. tv2 = tv5 * v - tv3 = Fp.mul(tv5, u); // 9. tv3 = tv5 * u - let tv4 = Fp.mul(tv3, tv2); // 10. tv4 = tv3 * tv2 - tv5 = Fp.pow(tv4, c5); // 11. tv5 = tv4^c5 - let isQR = Fp.eql(tv5, Fp.ONE); // 12. isQR = tv5 == 1 - tv2 = Fp.mul(tv3, c7); // 13. tv2 = tv3 * c7 - tv5 = Fp.mul(tv4, tv1); // 14. tv5 = tv4 * tv1 - tv3 = Fp.cmov(tv2, tv3, isQR); // 15. tv3 = CMOV(tv2, tv3, isQR) - tv4 = Fp.cmov(tv5, tv4, isQR); // 16. tv4 = CMOV(tv5, tv4, isQR) - // 17. for i in (c1, c1 - 1, ..., 2): - for (let i = c1; i > _1n; i--) { - let tv5 = i - _2n; // 18. tv5 = i - 2 - tv5 = _2n << (tv5 - _1n); // 19. tv5 = 2^tv5 - let tvv5 = Fp.pow(tv4, tv5); // 20. tv5 = tv4^tv5 - const e1 = Fp.eql(tvv5, Fp.ONE); // 21. e1 = tv5 == 1 - tv2 = Fp.mul(tv3, tv1); // 22. tv2 = tv3 * tv1 - tv1 = Fp.mul(tv1, tv1); // 23. tv1 = tv1 * tv1 - tvv5 = Fp.mul(tv4, tv1); // 24. tv5 = tv4 * tv1 - tv3 = Fp.cmov(tv2, tv3, e1); // 25. tv3 = CMOV(tv2, tv3, e1) - tv4 = Fp.cmov(tvv5, tv4, e1); // 26. tv4 = CMOV(tv5, tv4, e1) - } - return { isValid: isQR, value: tv3 }; - }; - if (Fp.ORDER % _4n === _3n) { - // sqrt_ratio_3mod4(u, v) - const c1 = (Fp.ORDER - _3n) / _4n; // 1. c1 = (q - 3) / 4 # Integer arithmetic - const c2 = Fp.sqrt(Fp.neg(Z)); // 2. c2 = sqrt(-Z) - sqrtRatio = (u: T, v: T) => { - let tv1 = Fp.sqr(v); // 1. tv1 = v^2 - const tv2 = Fp.mul(u, v); // 2. tv2 = u * v - tv1 = Fp.mul(tv1, tv2); // 3. tv1 = tv1 * tv2 - let y1 = Fp.pow(tv1, c1); // 4. y1 = tv1^c1 - y1 = Fp.mul(y1, tv2); // 5. y1 = y1 * tv2 - const y2 = Fp.mul(y1, c2); // 6. y2 = y1 * c2 - const tv3 = Fp.mul(Fp.sqr(y1), v); // 7. tv3 = y1^2; 8. tv3 = tv3 * v - const isQR = Fp.eql(tv3, u); // 9. isQR = tv3 == u - let y = Fp.cmov(y2, y1, isQR); // 10. y = CMOV(y2, y1, isQR) - return { isValid: isQR, value: y }; // 11. return (isQR, y) isQR ? y : y*c2 - }; - } - // No curves uses that - // if (Fp.ORDER % _8n === _5n) // sqrt_ratio_5mod8 - return sqrtRatio; -} -/** - * Simplified Shallue-van de Woestijne-Ulas Method - * https://www.rfc-editor.org/rfc/rfc9380#section-6.6.2 - */ -export function mapToCurveSimpleSWU( - Fp: IField, - opts: { - A: T; - B: T; - Z: T; - } -): (u: T) => { x: T; y: T } { - validateField(Fp); - const { A, B, Z } = opts; - if (!Fp.isValid(A) || !Fp.isValid(B) || !Fp.isValid(Z)) - throw new Error('mapToCurveSimpleSWU: invalid opts'); - const sqrtRatio = SWUFpSqrtRatio(Fp, Z); - if (!Fp.isOdd) throw new Error('Field does not have .isOdd()'); - // Input: u, an element of F. - // Output: (x, y), a point on E. - return (u: T): { x: T; y: T } => { - // prettier-ignore - let tv1, tv2, tv3, tv4, tv5, tv6, x, y; - tv1 = Fp.sqr(u); // 1. tv1 = u^2 - tv1 = Fp.mul(tv1, Z); // 2. tv1 = Z * tv1 - tv2 = Fp.sqr(tv1); // 3. tv2 = tv1^2 - tv2 = Fp.add(tv2, tv1); // 4. tv2 = tv2 + tv1 - tv3 = Fp.add(tv2, Fp.ONE); // 5. tv3 = tv2 + 1 - tv3 = Fp.mul(tv3, B); // 6. tv3 = B * tv3 - tv4 = Fp.cmov(Z, Fp.neg(tv2), !Fp.eql(tv2, Fp.ZERO)); // 7. tv4 = CMOV(Z, -tv2, tv2 != 0) - tv4 = Fp.mul(tv4, A); // 8. tv4 = A * tv4 - tv2 = Fp.sqr(tv3); // 9. tv2 = tv3^2 - tv6 = Fp.sqr(tv4); // 10. tv6 = tv4^2 - tv5 = Fp.mul(tv6, A); // 11. tv5 = A * tv6 - tv2 = Fp.add(tv2, tv5); // 12. tv2 = tv2 + tv5 - tv2 = Fp.mul(tv2, tv3); // 13. tv2 = tv2 * tv3 - tv6 = Fp.mul(tv6, tv4); // 14. tv6 = tv6 * tv4 - tv5 = Fp.mul(tv6, B); // 15. tv5 = B * tv6 - tv2 = Fp.add(tv2, tv5); // 16. tv2 = tv2 + tv5 - x = Fp.mul(tv1, tv3); // 17. x = tv1 * tv3 - const { isValid, value } = sqrtRatio(tv2, tv6); // 18. (is_gx1_square, y1) = sqrt_ratio(tv2, tv6) - y = Fp.mul(tv1, u); // 19. y = tv1 * u -> Z * u^3 * y1 - y = Fp.mul(y, value); // 20. y = y * y1 - x = Fp.cmov(x, tv3, isValid); // 21. x = CMOV(x, tv3, is_gx1_square) - y = Fp.cmov(y, value, isValid); // 22. y = CMOV(y, y1, is_gx1_square) - const e1 = Fp.isOdd!(u) === Fp.isOdd!(y); // 23. e1 = sgn0(u) == sgn0(y) - y = Fp.cmov(Fp.neg(y), y, e1); // 24. y = CMOV(-y, y, e1) - const tv4_inv = FpInvertBatch(Fp, [tv4], true)[0]; - x = Fp.mul(x, tv4_inv); // 25. x = x / tv4 - return { x, y }; - }; -} - -function getWLengths(Fp: IField, Fn: IField) { - return { - secretKey: Fn.BYTES, - publicKey: 1 + Fp.BYTES, - publicKeyUncompressed: 1 + 2 * Fp.BYTES, - publicKeyHasPrefix: true, - signature: 2 * Fn.BYTES, - }; -} - -/** - * Sometimes users only need getPublicKey, getSharedSecret, and secret key handling. - * This helper ensures no signature functionality is present. Less code, smaller bundle size. - */ -export function ecdh( - Point: WeierstrassPointCons, - ecdhOpts: { randomBytes?: (bytesLength?: number) => Uint8Array } = {} -): ECDH { - const { Fn } = Point; - const randomBytes_ = ecdhOpts.randomBytes || wcRandomBytes; - const lengths = Object.assign(getWLengths(Point.Fp, Fn), { seed: getMinHashLength(Fn.ORDER) }); - - function isValidSecretKey(secretKey: Uint8Array) { - try { - const num = Fn.fromBytes(secretKey); - return Fn.isValidNot0(num); - } catch (error) { - return false; - } - } - - function isValidPublicKey(publicKey: Uint8Array, isCompressed?: boolean): boolean { - const { publicKey: comp, publicKeyUncompressed } = lengths; - try { - const l = publicKey.length; - if (isCompressed === true && l !== comp) return false; - if (isCompressed === false && l !== publicKeyUncompressed) return false; - return !!Point.fromBytes(publicKey); - } catch (error) { - return false; - } - } - - /** - * Produces cryptographically secure secret key from random of size - * (groupLen + ceil(groupLen / 2)) with modulo bias being negligible. - */ - function randomSecretKey(seed = randomBytes_(lengths.seed)): Uint8Array { - return mapHashToField(abytes(seed, lengths.seed, 'seed'), Fn.ORDER); - } - - /** - * Computes public key for a secret key. Checks for validity of the secret key. - * @param isCompressed whether to return compact (default), or full key - * @returns Public key, full when isCompressed=false; short when isCompressed=true - */ - function getPublicKey(secretKey: Uint8Array, isCompressed = true): Uint8Array { - return Point.BASE.multiply(Fn.fromBytes(secretKey)).toBytes(isCompressed); - } - - /** - * Quick and dirty check for item being public key. Does not validate hex, or being on-curve. - */ - function isProbPub(item: Uint8Array): boolean | undefined { - const { secretKey, publicKey, publicKeyUncompressed } = lengths; - if (!isBytes(item)) return undefined; - if (('_lengths' in Fn && Fn._lengths) || secretKey === publicKey) return undefined; - const l = abytes(item, undefined, 'key').length; - return l === publicKey || l === publicKeyUncompressed; - } - - /** - * ECDH (Elliptic Curve Diffie Hellman). - * Computes shared public key from secret key A and public key B. - * Checks: 1) secret key validity 2) shared key is on-curve. - * Does NOT hash the result. - * @param isCompressed whether to return compact (default), or full key - * @returns shared public key - */ - function getSharedSecret( - secretKeyA: Uint8Array, - publicKeyB: Uint8Array, - isCompressed = true - ): Uint8Array { - if (isProbPub(secretKeyA) === true) throw new Error('first arg must be private key'); - if (isProbPub(publicKeyB) === false) throw new Error('second arg must be public key'); - const s = Fn.fromBytes(secretKeyA); - const b = Point.fromBytes(publicKeyB); // checks for being on-curve - return b.multiply(s).toBytes(isCompressed); - } - - const utils = { - isValidSecretKey, - isValidPublicKey, - randomSecretKey, - }; - const keygen = createKeygen(randomSecretKey, getPublicKey); - - return Object.freeze({ getPublicKey, getSharedSecret, keygen, Point, utils, lengths }); -} - -/** - * Creates ECDSA signing interface for given elliptic curve `Point` and `hash` function. - * - * @param Point created using {@link weierstrass} function - * @param hash used for 1) message prehash-ing 2) k generation in `sign`, using hmac_drbg(hash) - * @param ecdsaOpts rarely needed, see {@link ECDSAOpts} - * - * @example - * ```js - * const p256_Point = weierstrass(...); - * const p256_sha256 = ecdsa(p256_Point, sha256); - * const p256_sha224 = ecdsa(p256_Point, sha224); - * const p256_sha224_r = ecdsa(p256_Point, sha224, { randomBytes: (length) => { ... } }); - * ``` - */ -export function ecdsa( - Point: WeierstrassPointCons, - hash: CHash, - ecdsaOpts: ECDSAOpts = {} -): ECDSA { - ahash(hash); - validateObject( - ecdsaOpts, - {}, - { - hmac: 'function', - lowS: 'boolean', - randomBytes: 'function', - bits2int: 'function', - bits2int_modN: 'function', - } - ); - ecdsaOpts = Object.assign({}, ecdsaOpts); - const randomBytes = ecdsaOpts.randomBytes || wcRandomBytes; - const hmac = ecdsaOpts.hmac || ((key, msg) => nobleHmac(hash, key, msg)); - - const { Fp, Fn } = Point; - const { ORDER: CURVE_ORDER, BITS: fnBits } = Fn; - const { keygen, getPublicKey, getSharedSecret, utils, lengths } = ecdh(Point, ecdsaOpts); - const defaultSigOpts: Required = { - prehash: true, - lowS: typeof ecdsaOpts.lowS === 'boolean' ? ecdsaOpts.lowS : true, - format: 'compact' as ECDSASignatureFormat, - extraEntropy: false, - }; - const hasLargeCofactor = CURVE_ORDER * _2n < Fp.ORDER; // Won't CURVE().h > 2n be more effective? - - function isBiggerThanHalfOrder(number: bigint) { - const HALF = CURVE_ORDER >> _1n; - return number > HALF; - } - function validateRS(title: string, num: bigint): bigint { - if (!Fn.isValidNot0(num)) - throw new Error(`invalid signature ${title}: out of range 1..Point.Fn.ORDER`); - return num; - } - function assertSmallCofactor(): void { - // ECDSA recovery is hard for cofactor > 1 curves. - // In sign, `r = q.x mod n`, and here we recover q.x from r. - // While recovering q.x >= n, we need to add r+n for cofactor=1 curves. - // However, for cofactor>1, r+n may not get q.x: - // r+n*i would need to be done instead where i is unknown. - // To easily get i, we either need to: - // a. increase amount of valid recid values (4, 5...); OR - // b. prohibit non-prime-order signatures (recid > 1). - if (hasLargeCofactor) - throw new Error('"recovered" sig type is not supported for cofactor >2 curves'); - } - function validateSigLength(bytes: Uint8Array, format: ECDSASignatureFormat) { - validateSigFormat(format); - const size = lengths.signature!; - const sizer = format === 'compact' ? size : format === 'recovered' ? size + 1 : undefined; - return abytes(bytes, sizer); - } - - /** - * ECDSA signature with its (r, s) properties. Supports compact, recovered & DER representations. - */ - class Signature implements ECDSASignature { - readonly r: bigint; - readonly s: bigint; - readonly recovery?: number; - - constructor(r: bigint, s: bigint, recovery?: number) { - this.r = validateRS('r', r); // r in [1..N-1]; - this.s = validateRS('s', s); // s in [1..N-1]; - if (recovery != null) { - assertSmallCofactor(); - if (![0, 1, 2, 3].includes(recovery)) throw new Error('invalid recovery id'); - this.recovery = recovery; - } - Object.freeze(this); - } - - static fromBytes( - bytes: Uint8Array, - format: ECDSASignatureFormat = defaultSigOpts.format - ): Signature { - validateSigLength(bytes, format); - let recid: number | undefined; - if (format === 'der') { - const { r, s } = DER.toSig(abytes(bytes)); - return new Signature(r, s); - } - if (format === 'recovered') { - recid = bytes[0]; - format = 'compact'; - bytes = bytes.subarray(1); - } - const L = lengths.signature! / 2; - const r = bytes.subarray(0, L); - const s = bytes.subarray(L, L * 2); - return new Signature(Fn.fromBytes(r), Fn.fromBytes(s), recid); - } - - static fromHex(hex: string, format?: ECDSASignatureFormat) { - return this.fromBytes(hexToBytes(hex), format); - } - - private assertRecovery(): number { - const { recovery } = this; - if (recovery == null) throw new Error('invalid recovery id: must be present'); - return recovery; - } - - addRecoveryBit(recovery: number): RecoveredSignature { - return new Signature(this.r, this.s, recovery) as RecoveredSignature; - } - - recoverPublicKey(messageHash: Uint8Array): WeierstrassPoint { - const { r, s } = this; - const recovery = this.assertRecovery(); - const radj = recovery === 2 || recovery === 3 ? r + CURVE_ORDER : r; - if (!Fp.isValid(radj)) throw new Error('invalid recovery id: sig.r+curve.n != R.x'); - const x = Fp.toBytes(radj); - const R = Point.fromBytes(concatBytes(pprefix((recovery & 1) === 0), x)); - const ir = Fn.inv(radj); // r^-1 - const h = bits2int_modN(abytes(messageHash, undefined, 'msgHash')); // Truncate hash - const u1 = Fn.create(-h * ir); // -hr^-1 - const u2 = Fn.create(s * ir); // sr^-1 - // (sr^-1)R-(hr^-1)G = -(hr^-1)G + (sr^-1). unsafe is fine: there is no private data. - const Q = Point.BASE.multiplyUnsafe(u1).add(R.multiplyUnsafe(u2)); - if (Q.is0()) throw new Error('invalid recovery: point at infinify'); - Q.assertValidity(); - return Q; - } - - // Signatures should be low-s, to prevent malleability. - hasHighS(): boolean { - return isBiggerThanHalfOrder(this.s); - } - - toBytes(format: ECDSASignatureFormat = defaultSigOpts.format) { - validateSigFormat(format); - if (format === 'der') return hexToBytes(DER.hexFromSig(this)); - const { r, s } = this; - const rb = Fn.toBytes(r); - const sb = Fn.toBytes(s); - if (format === 'recovered') { - assertSmallCofactor(); - return concatBytes(Uint8Array.of(this.assertRecovery()), rb, sb); - } - return concatBytes(rb, sb); - } - - toHex(format?: ECDSASignatureFormat) { - return bytesToHex(this.toBytes(format)); - } - } - type RecoveredSignature = Signature & { recovery: number }; - - // RFC6979: ensure ECDSA msg is X bytes and < N. RFC suggests optional truncating via bits2octets. - // FIPS 186-4 4.6 suggests the leftmost min(nBitLen, outLen) bits, which matches bits2int. - // bits2int can produce res>N, we can do mod(res, N) since the bitLen is the same. - // int2octets can't be used; pads small msgs with 0: unacceptatble for trunc as per RFC vectors - const bits2int = - ecdsaOpts.bits2int || - function bits2int_def(bytes: Uint8Array): bigint { - // Our custom check "just in case", for protection against DoS - if (bytes.length > 8192) throw new Error('input is too large'); - // For curves with nBitLength % 8 !== 0: bits2octets(bits2octets(m)) !== bits2octets(m) - // for some cases, since bytes.length * 8 is not actual bitLength. - const num = bytesToNumberBE(bytes); // check for == u8 done here - const delta = bytes.length * 8 - fnBits; // truncate to nBitLength leftmost bits - return delta > 0 ? num >> BigInt(delta) : num; - }; - const bits2int_modN = - ecdsaOpts.bits2int_modN || - function bits2int_modN_def(bytes: Uint8Array): bigint { - return Fn.create(bits2int(bytes)); // can't use bytesToNumberBE here - }; - // Pads output with zero as per spec - const ORDER_MASK = bitMask(fnBits); - /** Converts to bytes. Checks if num in `[0..ORDER_MASK-1]` e.g.: `[0..2^256-1]`. */ - function int2octets(num: bigint): Uint8Array { - // IMPORTANT: the check ensures working for case `Fn.BYTES != Fn.BITS * 8` - aInRange('num < 2^' + fnBits, num, _0n, ORDER_MASK); - return Fn.toBytes(num); - } - - function validateMsgAndHash(message: Uint8Array, prehash: boolean) { - abytes(message, undefined, 'message'); - return prehash ? abytes(hash(message), undefined, 'prehashed message') : message; - } - - /** - * Steps A, D of RFC6979 3.2. - * Creates RFC6979 seed; converts msg/privKey to numbers. - * Used only in sign, not in verify. - * - * Warning: we cannot assume here that message has same amount of bytes as curve order, - * this will be invalid at least for P521. Also it can be bigger for P224 + SHA256. - */ - function prepSig(message: Uint8Array, secretKey: Uint8Array, opts: ECDSASignOpts) { - const { lowS, prehash, extraEntropy } = validateSigOpts(opts, defaultSigOpts); - message = validateMsgAndHash(message, prehash); // RFC6979 3.2 A: h1 = H(m) - // We can't later call bits2octets, since nested bits2int is broken for curves - // with fnBits % 8 !== 0. Because of that, we unwrap it here as int2octets call. - // const bits2octets = (bits) => int2octets(bits2int_modN(bits)) - const h1int = bits2int_modN(message); - const d = Fn.fromBytes(secretKey); // validate secret key, convert to bigint - if (!Fn.isValidNot0(d)) throw new Error('invalid private key'); - const seedArgs = [int2octets(d), int2octets(h1int)]; - // extraEntropy. RFC6979 3.6: additional k' (optional). - if (extraEntropy != null && extraEntropy !== false) { - // K = HMAC_K(V || 0x00 || int2octets(x) || bits2octets(h1) || k') - // gen random bytes OR pass as-is - const e = extraEntropy === true ? randomBytes(lengths.secretKey) : extraEntropy; - seedArgs.push(abytes(e, undefined, 'extraEntropy')); // check for being bytes - } - const seed = concatBytes(...seedArgs); // Step D of RFC6979 3.2 - const m = h1int; // no need to call bits2int second time here, it is inside truncateHash! - // Converts signature params into point w r/s, checks result for validity. - // To transform k => Signature: - // q = k⋅G - // r = q.x mod n - // s = k^-1(m + rd) mod n - // Can use scalar blinding b^-1(bm + bdr) where b ∈ [1,q−1] according to - // https://tches.iacr.org/index.php/TCHES/article/view/7337/6509. We've decided against it: - // a) dependency on CSPRNG b) 15% slowdown c) doesn't really help since bigints are not CT - function k2sig(kBytes: Uint8Array): Signature | undefined { - // RFC 6979 Section 3.2, step 3: k = bits2int(T) - // Important: all mod() calls here must be done over N - const k = bits2int(kBytes); // Cannot use fields methods, since it is group element - if (!Fn.isValidNot0(k)) return; // Valid scalars (including k) must be in 1..N-1 - const ik = Fn.inv(k); // k^-1 mod n - const q = Point.BASE.multiply(k).toAffine(); // q = k⋅G - const r = Fn.create(q.x); // r = q.x mod n - if (r === _0n) return; - const s = Fn.create(ik * Fn.create(m + r * d)); // s = k^-1(m + rd) mod n - if (s === _0n) return; - let recovery = (q.x === r ? 0 : 2) | Number(q.y & _1n); // recovery bit (2 or 3 when q.x>n) - let normS = s; - if (lowS && isBiggerThanHalfOrder(s)) { - normS = Fn.neg(s); // if lowS was passed, ensure s is always in the bottom half of N - recovery ^= 1; - } - return new Signature(r, normS, hasLargeCofactor ? undefined : recovery); - } - return { seed, k2sig }; - } - - /** - * Signs message hash with a secret key. - * - * ``` - * sign(m, d) where - * k = rfc6979_hmac_drbg(m, d) - * (x, y) = G × k - * r = x mod n - * s = (m + dr) / k mod n - * ``` - */ - function sign(message: Uint8Array, secretKey: Uint8Array, opts: ECDSASignOpts = {}): Uint8Array { - const { seed, k2sig } = prepSig(message, secretKey, opts); // Steps A, D of RFC6979 3.2. - const drbg = createHmacDrbg(hash.outputLen, Fn.BYTES, hmac); - const sig = drbg(seed, k2sig); // Steps B, C, D, E, F, G - return sig.toBytes(opts.format); - } - - /** - * Verifies a signature against message and public key. - * Rejects lowS signatures by default: see {@link ECDSAVerifyOpts}. - * Implements section 4.1.4 from https://www.secg.org/sec1-v2.pdf: - * - * ``` - * verify(r, s, h, P) where - * u1 = hs^-1 mod n - * u2 = rs^-1 mod n - * R = u1⋅G + u2⋅P - * mod(R.x, n) == r - * ``` - */ - function verify( - signature: Uint8Array, - message: Uint8Array, - publicKey: Uint8Array, - opts: ECDSAVerifyOpts = {} - ): boolean { - const { lowS, prehash, format } = validateSigOpts(opts, defaultSigOpts); - publicKey = abytes(publicKey, undefined, 'publicKey'); - message = validateMsgAndHash(message, prehash); - if (!isBytes(signature as any)) { - const end = signature instanceof Signature ? ', use sig.toBytes()' : ''; - throw new Error('verify expects Uint8Array signature' + end); - } - validateSigLength(signature, format); // execute this twice because we want loud error - try { - const sig = Signature.fromBytes(signature, format); - const P = Point.fromBytes(publicKey); - if (lowS && sig.hasHighS()) return false; - const { r, s } = sig; - const h = bits2int_modN(message); // mod n, not mod p - const is = Fn.inv(s); // s^-1 mod n - const u1 = Fn.create(h * is); // u1 = hs^-1 mod n - const u2 = Fn.create(r * is); // u2 = rs^-1 mod n - const R = Point.BASE.multiplyUnsafe(u1).add(P.multiplyUnsafe(u2)); // u1⋅G + u2⋅P - if (R.is0()) return false; - const v = Fn.create(R.x); // v = r.x mod n - return v === r; - } catch (e) { - return false; - } - } - - function recoverPublicKey( - signature: Uint8Array, - message: Uint8Array, - opts: ECDSARecoverOpts = {} - ): Uint8Array { - const { prehash } = validateSigOpts(opts, defaultSigOpts); - message = validateMsgAndHash(message, prehash); - return Signature.fromBytes(signature, 'recovered').recoverPublicKey(message).toBytes(); - } - - return Object.freeze({ - keygen, - getPublicKey, - getSharedSecret, - utils, - lengths, - Point, - sign, - verify, - recoverPublicKey, - Signature, - hash, - }) satisfies Signer; -} diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/bls12-381.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/bls12-381.ts deleted file mode 100644 index 18a03075..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/bls12-381.ts +++ /dev/null @@ -1,775 +0,0 @@ -/** - * bls12-381 is pairing-friendly Barreto-Lynn-Scott elliptic curve construction allowing to: - -* Construct zk-SNARKs at the ~120-bit security, as per [Barbulescu-Duquesne 2017](https://hal.science/hal-01534101/file/main.pdf) -* Efficiently verify N aggregate signatures with 1 pairing and N ec additions: -the Boneh-Lynn-Shacham signature scheme is orders of magnitude more efficient than Schnorr - -BLS can mean 2 different things: - -* Barreto-Lynn-Scott: BLS12, a Pairing Friendly Elliptic Curve -* Boneh-Lynn-Shacham: A Signature Scheme. - -### Summary - -1. BLS Relies on expensive bilinear pairing -2. Secret Keys: 32 bytes -3. Public Keys: 48 OR 96 bytes - big-endian x coordinate of point on G1 OR G2 curve -4. Signatures: 96 OR 48 bytes - big-endian x coordinate of point on G2 OR G1 curve -5. The 12 stands for the Embedding degree. - -Modes of operation: - -* Long signatures: 48-byte keys + 96-byte sigs (G1 keys + G2 sigs). -* Short signatures: 96-byte keys + 48-byte sigs (G2 keys + G1 sigs). - -### Formulas - -- `P = pk x G` - public keys -- `S = pk x H(m)` - signing, uses hash-to-curve on m -- `e(P, H(m)) == e(G, S)` - verification using pairings -- `e(G, S) = e(G, SUM(n)(Si)) = MUL(n)(e(G, Si))` - signature aggregation - -### Curves - -G1 is ordinary elliptic curve. G2 is extension field curve, think "over complex numbers". - -- G1: y² = x³ + 4 -- G2: y² = x³ + 4(u + 1) where u = √−1; r-order subgroup of E'(Fp²), M-type twist - -### Towers - -Pairing G1 + G2 produces element in Fp₁₂, 12-degree polynomial. -Fp₁₂ is usually implemented using tower of lower-degree polynomials for speed. - -- Fp₁₂ = Fp₆² => Fp₂³ -- Fp(u) / (u² - β) where β = -1 -- Fp₂(v) / (v³ - ξ) where ξ = u + 1 -- Fp₆(w) / (w² - γ) where γ = v -- Fp²[u] = Fp/u²+1 -- Fp⁶[v] = Fp²/v³-1-u -- Fp¹²[w] = Fp⁶/w²-v - -### Params - -* Embedding degree (k): 12 -* Seed is sometimes named x or t -* t = -15132376222941642752 -* p = (t-1)² * (t⁴-t²+1)/3 + t -* r = t⁴-t²+1 -* Ate loop size: X - -To verify curve parameters, see -[pairing-friendly-curves spec](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-pairing-friendly-curves-11). -Basic math is done over finite fields over p. -More complicated math is done over polynominal extension fields. - -### Compatibility and notes -1. It is compatible with Algorand, Chia, Dfinity, Ethereum, Filecoin, ZEC. -Filecoin uses little endian byte arrays for secret keys - make sure to reverse byte order. -2. Make sure to correctly select mode: "long signature" or "short signature". -3. Compatible with specs: - RFC 9380, - [cfrg-pairing-friendly-curves-11](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-pairing-friendly-curves-11), - [cfrg-bls-signature-05](https://datatracker.ietf.org/doc/draft-irtf-cfrg-bls-signature/). - - * - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { sha256 } from '@noble/hashes/sha2.js'; -import { bls, type BlsCurvePairWithSignatures } from './abstract/bls.ts'; -import { Field, type IField } from './abstract/modular.ts'; -import { - abytes, - bitLen, - bitMask, - bytesToHex, - bytesToNumberBE, - concatBytes, - copyBytes, - hexToBytes, - numberToBytesBE, - randomBytes, -} from './utils.ts'; -// Types -import { isogenyMap } from './abstract/hash-to-curve.ts'; -import type { BigintTuple, Fp, Fp12, Fp2, Fp6 } from './abstract/tower.ts'; -import { psiFrobenius, tower12 } from './abstract/tower.ts'; -import { - mapToCurveSimpleSWU, - weierstrass, - type AffinePoint, - type WeierstrassOpts, - type WeierstrassPoint, - type WeierstrassPointCons, -} from './abstract/weierstrass.ts'; - -// Be friendly to bad ECMAScript parsers by not using bigint literals -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = BigInt(4); - -// To verify math: -// https://tools.ietf.org/html/draft-irtf-cfrg-pairing-friendly-curves-11 - -// The BLS parameter x (seed) for BLS12-381. NOTE: it is negative! -// x = -2^63 - 2^62 - 2^60 - 2^57 - 2^48 - 2^16 -const BLS_X = BigInt('0xd201000000010000'); -// t = x (called differently in different places) -// const t = -BLS_X; -const BLS_X_LEN = bitLen(BLS_X); - -// a=0, b=4 -// P is characteristic of field Fp, in which curve calculations are done. -// p = (t-1)² * (t⁴-t²+1)/3 + t -// bls12_381_Fp = (t-1n)**2n * (t**4n - t**2n + 1n) / 3n + t -// r*h is curve order, amount of points on curve, -// where r is order of prime subgroup and h is cofactor. -// r = t⁴-t²+1 -// r = (t**4n - t**2n + 1n) -// cofactor h of G1: (t - 1)²/3 -// cofactorG1 = (t-1n)**2n/3n -// x = 3685416753713387016781088315183077757961620795782546409894578378688607592378376318836054947676345821548104185464507 -// y = 1339506544944476473020471379941921221584933875938349620426543736416511423956333506472724655353366534992391756441569 -const bls12_381_CURVE_G1: WeierstrassOpts = { - p: BigInt( - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab' - ), - n: BigInt('0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001'), - h: BigInt('0x396c8c005555e1568c00aaab0000aaab'), - a: _0n, - b: _4n, - Gx: BigInt( - '0x17f1d3a73197d7942695638c4fa9ac0fc3688c4f9774b905a14e3a3f171bac586c55e83ff97a1aeffb3af00adb22c6bb' - ), - Gy: BigInt( - '0x08b3f481e3aaa0f1a09e30ed741d8ae4fcf5e095d5d00af600db18cb2c04b3edd03cc744a2888ae40caa232946c5e7e1' - ), -}; - -// CURVE FIELDS -// r = z⁴ − z² + 1; CURVE.n from other curves -/** bls12-381 Fr (Fn) field. Note: does mod() on fromBytes, due to modFromBytes option. */ -export const bls12_381_Fr: IField = Field(bls12_381_CURVE_G1.n, { - modFromBytes: true, -}); -const { Fp, Fp2, Fp6, Fp12 } = tower12({ - ORDER: bls12_381_CURVE_G1.p, - X_LEN: BLS_X_LEN, - // Finite extension field over irreducible polynominal. - // Fp(u) / (u² - β) where β = -1 - FP2_NONRESIDUE: [_1n, _1n], - Fp2mulByB: ({ c0, c1 }) => { - const t0 = Fp.mul(c0, _4n); // 4 * c0 - const t1 = Fp.mul(c1, _4n); // 4 * c1 - // (T0-T1) + (T0+T1)*i - return { c0: Fp.sub(t0, t1), c1: Fp.add(t0, t1) }; - }, - Fp12finalExponentiate: (num) => { - const x = BLS_X; - // this^(q⁶) / this - const t0 = Fp12.div(Fp12.frobeniusMap(num, 6), num); - // t0^(q²) * t0 - const t1 = Fp12.mul(Fp12.frobeniusMap(t0, 2), t0); - const t2 = Fp12.conjugate(Fp12._cyclotomicExp(t1, x)); - const t3 = Fp12.mul(Fp12.conjugate(Fp12._cyclotomicSquare(t1)), t2); - const t4 = Fp12.conjugate(Fp12._cyclotomicExp(t3, x)); - const t5 = Fp12.conjugate(Fp12._cyclotomicExp(t4, x)); - const t6 = Fp12.mul(Fp12.conjugate(Fp12._cyclotomicExp(t5, x)), Fp12._cyclotomicSquare(t2)); - const t7 = Fp12.conjugate(Fp12._cyclotomicExp(t6, x)); - const t2_t5_pow_q2 = Fp12.frobeniusMap(Fp12.mul(t2, t5), 2); - const t4_t1_pow_q3 = Fp12.frobeniusMap(Fp12.mul(t4, t1), 3); - const t6_t1c_pow_q1 = Fp12.frobeniusMap(Fp12.mul(t6, Fp12.conjugate(t1)), 1); - const t7_t3c_t1 = Fp12.mul(Fp12.mul(t7, Fp12.conjugate(t3)), t1); - // (t2 * t5)^(q²) * (t4 * t1)^(q³) * (t6 * t1.conj)^(q^1) * t7 * t3.conj * t1 - return Fp12.mul(Fp12.mul(Fp12.mul(t2_t5_pow_q2, t4_t1_pow_q3), t6_t1c_pow_q1), t7_t3c_t1); - }, -}); - -// GLV endomorphism Ψ(P), for fast cofactor clearing -const { G2psi, G2psi2 } = psiFrobenius(Fp, Fp2, Fp2.div(Fp2.ONE, Fp2.NONRESIDUE)); // 1/(u+1) - -/** - * Default hash_to_field / hash-to-curve for BLS. - * m: 1 for G1, 2 for G2 - * k: target security level in bits - * hash: any function, e.g. BBS+ uses BLAKE2: see [github](https://github.com/hyperledger/aries-framework-go/issues/2247). - * Parameter values come from [section 8.8.2 of RFC 9380](https://www.rfc-editor.org/rfc/rfc9380#section-8.8.2). - */ -const hasher_opts = Object.freeze({ - DST: 'BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_NUL_', - encodeDST: 'BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_NUL_', - p: Fp.ORDER, - m: 2, - k: 128, - expand: 'xmd', - hash: sha256, -}); - -// a=0, b=4 -// cofactor h of G2 -// (t^8 - 4t^7 + 5t^6 - 4t^4 + 6t^3 - 4t^2 - 4t + 13)/9 -// cofactorG2 = (t**8n - 4n*t**7n + 5n*t**6n - 4n*t**4n + 6n*t**3n - 4n*t**2n - 4n*t+13n)/9n -// x = 3059144344244213709971259814753781636986470325476647558659373206291635324768958432433509563104347017837885763365758*u + 352701069587466618187139116011060144890029952792775240219908644239793785735715026873347600343865175952761926303160 -// y = 927553665492332455747201965776037880757740193453592970025027978793976877002675564980949289727957565575433344219582*u + 1985150602287291935568054521177171638300868978215655730859378665066344726373823718423869104263333984641494340347905 -const bls12_381_CURVE_G2 = { - p: Fp2.ORDER, - n: bls12_381_CURVE_G1.n, - h: BigInt( - '0x5d543a95414e7f1091d50792876a202cd91de4547085abaa68a205b2e5a7ddfa628f1cb4d9e82ef21537e293a6691ae1616ec6e786f0c70cf1c38e31c7238e5' - ), - a: Fp2.ZERO, - b: Fp2.fromBigTuple([_4n, _4n]), - Gx: Fp2.fromBigTuple([ - BigInt( - '0x024aa2b2f08f0a91260805272dc51051c6e47ad4fa403b02b4510b647ae3d1770bac0326a805bbefd48056c8c121bdb8' - ), - BigInt( - '0x13e02b6052719f607dacd3a088274f65596bd0d09920b61ab5da61bbdc7f5049334cf11213945d57e5ac7d055d042b7e' - ), - ]), - Gy: Fp2.fromBigTuple([ - BigInt( - '0x0ce5d527727d6e118cc9cdc6da2e351aadfd9baa8cbdd3a76d429a695160d12c923ac9cc3baca289e193548608b82801' - ), - BigInt( - '0x0606c4a02ea734cc32acd2b02bc28b99cb3e287e85a763af267492ab572e99ab3f370d275cec1da1aaa9075ff05f79be' - ), - ]), -}; - -// Encoding utils -// Compressed point of infinity -// Set compressed & point-at-infinity bits -const COMPZERO = setMask(Fp.toBytes(_0n), { infinity: true, compressed: true }); - -function parseMask(bytes: Uint8Array) { - // Copy, so we can remove mask data. - // It will be removed also later, when Fp.create will call modulo. - bytes = copyBytes(bytes); - const mask = bytes[0] & 0b1110_0000; - const compressed = !!((mask >> 7) & 1); // compression bit (0b1000_0000) - const infinity = !!((mask >> 6) & 1); // point at infinity bit (0b0100_0000) - const sort = !!((mask >> 5) & 1); // sort bit (0b0010_0000) - bytes[0] &= 0b0001_1111; // clear mask (zero first 3 bits) - return { compressed, infinity, sort, value: bytes }; -} - -function setMask( - bytes: Uint8Array, - mask: { compressed?: boolean; infinity?: boolean; sort?: boolean } -) { - if (bytes[0] & 0b1110_0000) throw new Error('setMask: non-empty mask'); - if (mask.compressed) bytes[0] |= 0b1000_0000; - if (mask.infinity) bytes[0] |= 0b0100_0000; - if (mask.sort) bytes[0] |= 0b0010_0000; - return bytes; -} - -function pointG1ToBytes( - _c: WeierstrassPointCons, - point: WeierstrassPoint, - isComp: boolean -) { - const { BYTES: L, ORDER: P } = Fp; - const is0 = point.is0(); - const { x, y } = point.toAffine(); - if (isComp) { - if (is0) return COMPZERO.slice(); - const sort = Boolean((y * _2n) / P); - return setMask(numberToBytesBE(x, L), { compressed: true, sort }); - } else { - if (is0) { - return concatBytes(Uint8Array.of(0x40), new Uint8Array(2 * L - 1)); - } else { - return concatBytes(numberToBytesBE(x, L), numberToBytesBE(y, L)); - } - } -} - -function signatureG1ToBytes(point: WeierstrassPoint) { - point.assertValidity(); - const { BYTES: L, ORDER: P } = Fp; - const { x, y } = point.toAffine(); - if (point.is0()) return COMPZERO.slice(); - const sort = Boolean((y * _2n) / P); - return setMask(numberToBytesBE(x, L), { compressed: true, sort }); -} - -function pointG1FromBytes(bytes: Uint8Array): AffinePoint { - const { compressed, infinity, sort, value } = parseMask(bytes); - const { BYTES: L, ORDER: P } = Fp; - if (value.length === 48 && compressed) { - const compressedValue = bytesToNumberBE(value); - // Zero - const x = Fp.create(compressedValue & bitMask(Fp.BITS)); - if (infinity) { - if (x !== _0n) throw new Error('invalid G1 point: non-empty, at infinity, with compression'); - return { x: _0n, y: _0n }; - } - const right = Fp.add(Fp.pow(x, _3n), Fp.create(bls12_381_CURVE_G1.b)); // y² = x³ + b - let y = Fp.sqrt(right); - if (!y) throw new Error('invalid G1 point: compressed point'); - if ((y * _2n) / P !== BigInt(sort)) y = Fp.neg(y); - return { x: Fp.create(x), y: Fp.create(y) }; - } else if (value.length === 96 && !compressed) { - // Check if the infinity flag is set - const x = bytesToNumberBE(value.subarray(0, L)); - const y = bytesToNumberBE(value.subarray(L)); - if (infinity) { - if (x !== _0n || y !== _0n) throw new Error('G1: non-empty point at infinity'); - return bls12_381.G1.Point.ZERO.toAffine(); - } - return { x: Fp.create(x), y: Fp.create(y) }; - } else { - throw new Error('invalid G1 point: expected 48/96 bytes'); - } -} - -function signatureG1FromBytes(bytes: Uint8Array): WeierstrassPoint { - const { infinity, sort, value } = parseMask(abytes(bytes, 48, 'signature')); - const P = Fp.ORDER; - const Point = bls12_381.G1.Point; - const compressedValue = bytesToNumberBE(value); - // Zero - if (infinity) return Point.ZERO; - const x = Fp.create(compressedValue & bitMask(Fp.BITS)); - const right = Fp.add(Fp.pow(x, _3n), Fp.create(bls12_381_CURVE_G1.b)); // y² = x³ + b - let y = Fp.sqrt(right); - if (!y) throw new Error('invalid G1 point: compressed'); - const aflag = BigInt(sort); - if ((y * _2n) / P !== aflag) y = Fp.neg(y); - const point = Point.fromAffine({ x, y }); - point.assertValidity(); - return point; -} - -function pointG2ToBytes( - _c: WeierstrassPointCons, - point: WeierstrassPoint, - isComp: boolean -) { - const { BYTES: L, ORDER: P } = Fp; - const is0 = point.is0(); - const { x, y } = point.toAffine(); - if (isComp) { - if (is0) return concatBytes(COMPZERO, numberToBytesBE(_0n, L)); - const flag = Boolean(y.c1 === _0n ? (y.c0 * _2n) / P : (y.c1 * _2n) / P); - return concatBytes( - setMask(numberToBytesBE(x.c1, L), { compressed: true, sort: flag }), - numberToBytesBE(x.c0, L) - ); - } else { - if (is0) return concatBytes(Uint8Array.of(0x40), new Uint8Array(4 * L - 1)); - const { re: x0, im: x1 } = Fp2.reim(x); - const { re: y0, im: y1 } = Fp2.reim(y); - return concatBytes( - numberToBytesBE(x1, L), - numberToBytesBE(x0, L), - numberToBytesBE(y1, L), - numberToBytesBE(y0, L) - ); - } -} - -function signatureG2ToBytes(point: WeierstrassPoint) { - point.assertValidity(); - const { BYTES: L } = Fp; - if (point.is0()) return concatBytes(COMPZERO, numberToBytesBE(_0n, L)); - const { x, y } = point.toAffine(); - const { re: x0, im: x1 } = Fp2.reim(x); - const { re: y0, im: y1 } = Fp2.reim(y); - const tmp = y1 > _0n ? y1 * _2n : y0 * _2n; - const sort = Boolean((tmp / Fp.ORDER) & _1n); - const z2 = x0; - return concatBytes( - setMask(numberToBytesBE(x1, L), { sort, compressed: true }), - numberToBytesBE(z2, L) - ); -} - -function pointG2FromBytes(bytes: Uint8Array): AffinePoint { - const { BYTES: L, ORDER: P } = Fp; - const { compressed, infinity, sort, value } = parseMask(bytes); - if ( - (!compressed && !infinity && sort) || // 00100000 - (!compressed && infinity && sort) || // 01100000 - (sort && infinity && compressed) // 11100000 - ) { - throw new Error('invalid encoding flag: ' + (bytes[0] & 0b1110_0000)); - } - const slc = (b: Uint8Array, from: number, to?: number) => bytesToNumberBE(b.slice(from, to)); - if (value.length === 96 && compressed) { - if (infinity) { - // check that all bytes are 0 - if (value.reduce((p, c) => (p !== 0 ? c + 1 : c), 0) > 0) { - throw new Error('invalid G2 point: compressed'); - } - return { x: Fp2.ZERO, y: Fp2.ZERO }; - } - const x_1 = slc(value, 0, L); - const x_0 = slc(value, L, 2 * L); - const x = Fp2.create({ c0: Fp.create(x_0), c1: Fp.create(x_1) }); - const right = Fp2.add(Fp2.pow(x, _3n), bls12_381_CURVE_G2.b); // y² = x³ + 4 * (u+1) = x³ + b - let y = Fp2.sqrt(right); - const Y_bit = y.c1 === _0n ? (y.c0 * _2n) / P : (y.c1 * _2n) / P ? _1n : _0n; - y = sort && Y_bit > 0 ? y : Fp2.neg(y); - return { x, y }; - } else if (value.length === 192 && !compressed) { - if (infinity) { - if (value.reduce((p, c) => (p !== 0 ? c + 1 : c), 0) > 0) { - throw new Error('invalid G2 point: uncompressed'); - } - return { x: Fp2.ZERO, y: Fp2.ZERO }; - } - const x1 = slc(value, 0 * L, 1 * L); - const x0 = slc(value, 1 * L, 2 * L); - const y1 = slc(value, 2 * L, 3 * L); - const y0 = slc(value, 3 * L, 4 * L); - return { x: Fp2.fromBigTuple([x0, x1]), y: Fp2.fromBigTuple([y0, y1]) }; - } else { - throw new Error('invalid G2 point: expected 96/192 bytes'); - } -} - -function signatureG2FromBytes(bytes: Uint8Array) { - const { ORDER: P } = Fp; - // TODO: Optimize, it's very slow because of sqrt. - const { infinity, sort, value } = parseMask(abytes(bytes)); - const Point = bls12_381.G2.Point; - const half = value.length / 2; - if (half !== 48 && half !== 96) - throw new Error('invalid compressed signature length, expected 96/192 bytes'); - const z1 = bytesToNumberBE(value.slice(0, half)); - const z2 = bytesToNumberBE(value.slice(half)); - // Indicates the infinity point - if (infinity) return Point.ZERO; - const x1 = Fp.create(z1 & bitMask(Fp.BITS)); - const x2 = Fp.create(z2); - const x = Fp2.create({ c0: x2, c1: x1 }); - const y2 = Fp2.add(Fp2.pow(x, _3n), bls12_381_CURVE_G2.b); // y² = x³ + 4 - // The slow part - let y = Fp2.sqrt(y2); - if (!y) throw new Error('Failed to find a square root'); - - // Choose the y whose leftmost bit of the imaginary part is equal to the a_flag1 - // If y1 happens to be zero, then use the bit of y0 - const { re: y0, im: y1 } = Fp2.reim(y); - const aflag1 = BigInt(sort); - const isGreater = y1 > _0n && (y1 * _2n) / P !== aflag1; - const is0 = y1 === _0n && (y0 * _2n) / P !== aflag1; - if (isGreater || is0) y = Fp2.neg(y); - const point = Point.fromAffine({ x, y }); - point.assertValidity(); - return point; -} - -const signatureCoders = { - ShortSignature: { - fromBytes(bytes: Uint8Array) { - return signatureG1FromBytes(abytes(bytes)); - }, - fromHex(hex: string): WeierstrassPoint { - return signatureG1FromBytes(hexToBytes(hex)); - }, - toBytes(point: WeierstrassPoint) { - return signatureG1ToBytes(point); - }, - toRawBytes(point: WeierstrassPoint) { - return signatureG1ToBytes(point); - }, - toHex(point: WeierstrassPoint) { - return bytesToHex(signatureG1ToBytes(point)); - }, - }, - LongSignature: { - fromBytes(bytes: Uint8Array): WeierstrassPoint { - return signatureG2FromBytes(abytes(bytes)); - }, - fromHex(hex: string): WeierstrassPoint { - return signatureG2FromBytes(hexToBytes(hex)); - }, - toBytes(point: WeierstrassPoint) { - return signatureG2ToBytes(point); - }, - toRawBytes(point: WeierstrassPoint) { - return signatureG2ToBytes(point); - }, - toHex(point: WeierstrassPoint) { - return bytesToHex(signatureG2ToBytes(point)); - }, - }, -}; - -const fields = { - Fp, - Fp2, - Fp6, - Fp12, - Fr: bls12_381_Fr, -}; -const G1_Point = weierstrass(bls12_381_CURVE_G1, { - allowInfinityPoint: true, - Fn: bls12_381_Fr, - fromBytes: pointG1FromBytes, - toBytes: pointG1ToBytes, - // Checks is the point resides in prime-order subgroup. - // point.isTorsionFree() should return true for valid points - // It returns false for shitty points. - // https://eprint.iacr.org/2021/1130.pdf - isTorsionFree: (c, point): boolean => { - // GLV endomorphism ψ(P) - const beta = BigInt( - '0x5f19672fdf76ce51ba69c6076a0f77eaddb3a93be6f89688de17d813620a00022e01fffffffefffe' - ); - const phi = new c(Fp.mul(point.X, beta), point.Y, point.Z); - // TODO: unroll - const xP = point.multiplyUnsafe(BLS_X).negate(); // [x]P - const u2P = xP.multiplyUnsafe(BLS_X); // [u2]P - return u2P.equals(phi); - }, - // Clear cofactor of G1 - // https://eprint.iacr.org/2019/403 - clearCofactor: (_c, point) => { - // return this.multiplyUnsafe(CURVE.h); - return point.multiplyUnsafe(BLS_X).add(point); // x*P + P - }, -}); -const G2_Point = weierstrass(bls12_381_CURVE_G2, { - Fp: Fp2, - allowInfinityPoint: true, - Fn: bls12_381_Fr, - fromBytes: pointG2FromBytes, - toBytes: pointG2ToBytes, - // https://eprint.iacr.org/2021/1130.pdf - // Older version: https://eprint.iacr.org/2019/814.pdf - isTorsionFree: (c, P): boolean => { - return P.multiplyUnsafe(BLS_X).negate().equals(G2psi(c, P)); // ψ(P) == [u](P) - }, - // clear_cofactor_bls12381_g2 from RFC 9380. - // https://eprint.iacr.org/2017/419.pdf - // prettier-ignore - clearCofactor: (c, P) => { - const x = BLS_X; - let t1 = P.multiplyUnsafe(x).negate(); // [-x]P - let t2 = G2psi(c, P); // Ψ(P) - let t3 = P.double(); // 2P - t3 = G2psi2(c, t3); // Ψ²(2P) - t3 = t3.subtract(t2); // Ψ²(2P) - Ψ(P) - t2 = t1.add(t2); // [-x]P + Ψ(P) - t2 = t2.multiplyUnsafe(x).negate(); // [x²]P - [x]Ψ(P) - t3 = t3.add(t2); // Ψ²(2P) - Ψ(P) + [x²]P - [x]Ψ(P) - t3 = t3.subtract(t1); // Ψ²(2P) - Ψ(P) + [x²]P - [x]Ψ(P) + [x]P - const Q = t3.subtract(P); // Ψ²(2P) - Ψ(P) + [x²]P - [x]Ψ(P) + [x]P - 1P - return Q; // [x²-x-1]P + [x-1]Ψ(P) + Ψ²(2P) - }, -}); - -const bls12_hasher_opts = { - mapToG1: mapToG1, - mapToG2: mapToG2, - hasherOpts: hasher_opts, - hasherOptsG1: { ...hasher_opts, m: 1, DST: 'BLS_SIG_BLS12381G1_XMD:SHA-256_SSWU_RO_NUL_' }, - hasherOptsG2: { ...hasher_opts }, -} as const; - -const bls12_params = { - ateLoopSize: BLS_X, // The BLS parameter x for BLS12-381 - xNegative: true, - twistType: 'multiplicative' as const, - randomBytes: randomBytes, -}; - -/** - * bls12-381 pairing-friendly curve construction. - * Provides both longSignatures and shortSignatures. - */ -export const bls12_381: BlsCurvePairWithSignatures = bls( - fields, - G1_Point, - G2_Point, - bls12_params, - bls12_hasher_opts, - signatureCoders -); - -// 3-isogeny map from E' to E https://www.rfc-editor.org/rfc/rfc9380#appendix-E.3 -const isogenyMapG2 = isogenyMap( - Fp2, - [ - // xNum - [ - [ - '0x5c759507e8e333ebb5b7a9a47d7ed8532c52d39fd3a042a88b58423c50ae15d5c2638e343d9c71c6238aaaaaaaa97d6', - '0x5c759507e8e333ebb5b7a9a47d7ed8532c52d39fd3a042a88b58423c50ae15d5c2638e343d9c71c6238aaaaaaaa97d6', - ], - [ - '0x0', - '0x11560bf17baa99bc32126fced787c88f984f87adf7ae0c7f9a208c6b4f20a4181472aaa9cb8d555526a9ffffffffc71a', - ], - [ - '0x11560bf17baa99bc32126fced787c88f984f87adf7ae0c7f9a208c6b4f20a4181472aaa9cb8d555526a9ffffffffc71e', - '0x8ab05f8bdd54cde190937e76bc3e447cc27c3d6fbd7063fcd104635a790520c0a395554e5c6aaaa9354ffffffffe38d', - ], - [ - '0x171d6541fa38ccfaed6dea691f5fb614cb14b4e7f4e810aa22d6108f142b85757098e38d0f671c7188e2aaaaaaaa5ed1', - '0x0', - ], - ], - // xDen - [ - [ - '0x0', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaa63', - ], - [ - '0xc', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaa9f', - ], - ['0x1', '0x0'], // LAST 1 - ], - // yNum - [ - [ - '0x1530477c7ab4113b59a4c18b076d11930f7da5d4a07f649bf54439d87d27e500fc8c25ebf8c92f6812cfc71c71c6d706', - '0x1530477c7ab4113b59a4c18b076d11930f7da5d4a07f649bf54439d87d27e500fc8c25ebf8c92f6812cfc71c71c6d706', - ], - [ - '0x0', - '0x5c759507e8e333ebb5b7a9a47d7ed8532c52d39fd3a042a88b58423c50ae15d5c2638e343d9c71c6238aaaaaaaa97be', - ], - [ - '0x11560bf17baa99bc32126fced787c88f984f87adf7ae0c7f9a208c6b4f20a4181472aaa9cb8d555526a9ffffffffc71c', - '0x8ab05f8bdd54cde190937e76bc3e447cc27c3d6fbd7063fcd104635a790520c0a395554e5c6aaaa9354ffffffffe38f', - ], - [ - '0x124c9ad43b6cf79bfbf7043de3811ad0761b0f37a1e26286b0e977c69aa274524e79097a56dc4bd9e1b371c71c718b10', - '0x0', - ], - ], - // yDen - [ - [ - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffa8fb', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffa8fb', - ], - [ - '0x0', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffa9d3', - ], - [ - '0x12', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaa99', - ], - ['0x1', '0x0'], // LAST 1 - ], - ].map((i) => i.map((pair) => Fp2.fromBigTuple(pair.map(BigInt) as BigintTuple))) as [ - Fp2[], - Fp2[], - Fp2[], - Fp2[], - ] -); -// 11-isogeny map from E' to E -const isogenyMapG1 = isogenyMap( - Fp, - [ - // xNum - [ - '0x11a05f2b1e833340b809101dd99815856b303e88a2d7005ff2627b56cdb4e2c85610c2d5f2e62d6eaeac1662734649b7', - '0x17294ed3e943ab2f0588bab22147a81c7c17e75b2f6a8417f565e33c70d1e86b4838f2a6f318c356e834eef1b3cb83bb', - '0xd54005db97678ec1d1048c5d10a9a1bce032473295983e56878e501ec68e25c958c3e3d2a09729fe0179f9dac9edcb0', - '0x1778e7166fcc6db74e0609d307e55412d7f5e4656a8dbf25f1b33289f1b330835336e25ce3107193c5b388641d9b6861', - '0xe99726a3199f4436642b4b3e4118e5499db995a1257fb3f086eeb65982fac18985a286f301e77c451154ce9ac8895d9', - '0x1630c3250d7313ff01d1201bf7a74ab5db3cb17dd952799b9ed3ab9097e68f90a0870d2dcae73d19cd13c1c66f652983', - '0xd6ed6553fe44d296a3726c38ae652bfb11586264f0f8ce19008e218f9c86b2a8da25128c1052ecaddd7f225a139ed84', - '0x17b81e7701abdbe2e8743884d1117e53356de5ab275b4db1a682c62ef0f2753339b7c8f8c8f475af9ccb5618e3f0c88e', - '0x80d3cf1f9a78fc47b90b33563be990dc43b756ce79f5574a2c596c928c5d1de4fa295f296b74e956d71986a8497e317', - '0x169b1f8e1bcfa7c42e0c37515d138f22dd2ecb803a0c5c99676314baf4bb1b7fa3190b2edc0327797f241067be390c9e', - '0x10321da079ce07e272d8ec09d2565b0dfa7dccdde6787f96d50af36003b14866f69b771f8c285decca67df3f1605fb7b', - '0x6e08c248e260e70bd1e962381edee3d31d79d7e22c837bc23c0bf1bc24c6b68c24b1b80b64d391fa9c8ba2e8ba2d229', - ], - // xDen - [ - '0x8ca8d548cff19ae18b2e62f4bd3fa6f01d5ef4ba35b48ba9c9588617fc8ac62b558d681be343df8993cf9fa40d21b1c', - '0x12561a5deb559c4348b4711298e536367041e8ca0cf0800c0126c2588c48bf5713daa8846cb026e9e5c8276ec82b3bff', - '0xb2962fe57a3225e8137e629bff2991f6f89416f5a718cd1fca64e00b11aceacd6a3d0967c94fedcfcc239ba5cb83e19', - '0x3425581a58ae2fec83aafef7c40eb545b08243f16b1655154cca8abc28d6fd04976d5243eecf5c4130de8938dc62cd8', - '0x13a8e162022914a80a6f1d5f43e7a07dffdfc759a12062bb8d6b44e833b306da9bd29ba81f35781d539d395b3532a21e', - '0xe7355f8e4e667b955390f7f0506c6e9395735e9ce9cad4d0a43bcef24b8982f7400d24bc4228f11c02df9a29f6304a5', - '0x772caacf16936190f3e0c63e0596721570f5799af53a1894e2e073062aede9cea73b3538f0de06cec2574496ee84a3a', - '0x14a7ac2a9d64a8b230b3f5b074cf01996e7f63c21bca68a81996e1cdf9822c580fa5b9489d11e2d311f7d99bbdcc5a5e', - '0xa10ecf6ada54f825e920b3dafc7a3cce07f8d1d7161366b74100da67f39883503826692abba43704776ec3a79a1d641', - '0x95fc13ab9e92ad4476d6e3eb3a56680f682b4ee96f7d03776df533978f31c1593174e4b4b7865002d6384d168ecdd0a', - '0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001', // LAST 1 - ], - // yNum - [ - '0x90d97c81ba24ee0259d1f094980dcfa11ad138e48a869522b52af6c956543d3cd0c7aee9b3ba3c2be9845719707bb33', - '0x134996a104ee5811d51036d776fb46831223e96c254f383d0f906343eb67ad34d6c56711962fa8bfe097e75a2e41c696', - '0xcc786baa966e66f4a384c86a3b49942552e2d658a31ce2c344be4b91400da7d26d521628b00523b8dfe240c72de1f6', - '0x1f86376e8981c217898751ad8746757d42aa7b90eeb791c09e4a3ec03251cf9de405aba9ec61deca6355c77b0e5f4cb', - '0x8cc03fdefe0ff135caf4fe2a21529c4195536fbe3ce50b879833fd221351adc2ee7f8dc099040a841b6daecf2e8fedb', - '0x16603fca40634b6a2211e11db8f0a6a074a7d0d4afadb7bd76505c3d3ad5544e203f6326c95a807299b23ab13633a5f0', - '0x4ab0b9bcfac1bbcb2c977d027796b3ce75bb8ca2be184cb5231413c4d634f3747a87ac2460f415ec961f8855fe9d6f2', - '0x987c8d5333ab86fde9926bd2ca6c674170a05bfe3bdd81ffd038da6c26c842642f64550fedfe935a15e4ca31870fb29', - '0x9fc4018bd96684be88c9e221e4da1bb8f3abd16679dc26c1e8b6e6a1f20cabe69d65201c78607a360370e577bdba587', - '0xe1bba7a1186bdb5223abde7ada14a23c42a0ca7915af6fe06985e7ed1e4d43b9b3f7055dd4eba6f2bafaaebca731c30', - '0x19713e47937cd1be0dfd0b8f1d43fb93cd2fcbcb6caf493fd1183e416389e61031bf3a5cce3fbafce813711ad011c132', - '0x18b46a908f36f6deb918c143fed2edcc523559b8aaf0c2462e6bfe7f911f643249d9cdf41b44d606ce07c8a4d0074d8e', - '0xb182cac101b9399d155096004f53f447aa7b12a3426b08ec02710e807b4633f06c851c1919211f20d4c04f00b971ef8', - '0x245a394ad1eca9b72fc00ae7be315dc757b3b080d4c158013e6632d3c40659cc6cf90ad1c232a6442d9d3f5db980133', - '0x5c129645e44cf1102a159f748c4a3fc5e673d81d7e86568d9ab0f5d396a7ce46ba1049b6579afb7866b1e715475224b', - '0x15e6be4e990f03ce4ea50b3b42df2eb5cb181d8f84965a3957add4fa95af01b2b665027efec01c7704b456be69c8b604', - ], - // yDen - [ - '0x16112c4c3a9c98b252181140fad0eae9601a6de578980be6eec3232b5be72e7a07f3688ef60c206d01479253b03663c1', - '0x1962d75c2381201e1a0cbd6c43c348b885c84ff731c4d59ca4a10356f453e01f78a4260763529e3532f6102c2e49a03d', - '0x58df3306640da276faaae7d6e8eb15778c4855551ae7f310c35a5dd279cd2eca6757cd636f96f891e2538b53dbf67f2', - '0x16b7d288798e5395f20d23bf89edb4d1d115c5dbddbcd30e123da489e726af41727364f2c28297ada8d26d98445f5416', - '0xbe0e079545f43e4b00cc912f8228ddcc6d19c9f0f69bbb0542eda0fc9dec916a20b15dc0fd2ededda39142311a5001d', - '0x8d9e5297186db2d9fb266eaac783182b70152c65550d881c5ecd87b6f0f5a6449f38db9dfa9cce202c6477faaf9b7ac', - '0x166007c08a99db2fc3ba8734ace9824b5eecfdfa8d0cf8ef5dd365bc400a0051d5fa9c01a58b1fb93d1a1399126a775c', - '0x16a3ef08be3ea7ea03bcddfabba6ff6ee5a4375efa1f4fd7feb34fd206357132b920f5b00801dee460ee415a15812ed9', - '0x1866c8ed336c61231a1be54fd1d74cc4f9fb0ce4c6af5920abc5750c4bf39b4852cfe2f7bb9248836b233d9d55535d4a', - '0x167a55cda70a6e1cea820597d94a84903216f763e13d87bb5308592e7ea7d4fbc7385ea3d529b35e346ef48bb8913f55', - '0x4d2f259eea405bd48f010a01ad2911d9c6dd039bb61a6290e591b36e636a5c871a5c29f4f83060400f8b49cba8f6aa8', - '0xaccbb67481d033ff5852c1e48c50c477f94ff8aefce42d28c0f9a88cea7913516f968986f7ebbea9684b529e2561092', - '0xad6b9514c767fe3c3613144b45f1496543346d98adf02267d5ceef9a00d9b8693000763e3b90ac11e99b138573345cc', - '0x2660400eb2e4f3b628bdd0d53cd76f2bf565b94e72927c1cb748df27942480e420517bd8714cc80d1fadc1326ed06f7', - '0xe0fa1d816ddc03e6b24255e0d7819c171c40f65e273b853324efcd6356caa205ca2f570f13497804415473a1d634b8f', - '0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001', // LAST 1 - ], - ].map((i) => i.map((j) => BigInt(j))) as [Fp[], Fp[], Fp[], Fp[]] -); - -// Optimized SWU Map - Fp to G1 -const G1_SWU = mapToCurveSimpleSWU(Fp, { - A: Fp.create( - BigInt( - '0x144698a3b8e9433d693a02c96d4982b0ea985383ee66a8d8e8981aefd881ac98936f8da0e0f97f5cf428082d584c1d' - ) - ), - B: Fp.create( - BigInt( - '0x12e2908d11688030018b12e8753eee3b2016c1f0f24f4070a0b9c14fcef35ef55a23215a316ceaa5d1cc48e98e172be0' - ) - ), - Z: Fp.create(BigInt(11)), -}); -// SWU Map - Fp2 to G2': y² = x³ + 240i * x + 1012 + 1012i -const G2_SWU = mapToCurveSimpleSWU(Fp2, { - A: Fp2.create({ c0: Fp.create(_0n), c1: Fp.create(BigInt(240)) }), // A' = 240 * I - B: Fp2.create({ c0: Fp.create(BigInt(1012)), c1: Fp.create(BigInt(1012)) }), // B' = 1012 * (1 + I) - Z: Fp2.create({ c0: Fp.create(BigInt(-2)), c1: Fp.create(BigInt(-1)) }), // Z: -(2 + I) -}); - -function mapToG1(scalars: bigint[]) { - const { x, y } = G1_SWU(Fp.create(scalars[0])); - return isogenyMapG1(x, y); -} -function mapToG2(scalars: bigint[]) { - const { x, y } = G2_SWU(Fp2.fromBigTuple(scalars as BigintTuple)); - return isogenyMapG2(x, y); -} diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/bn254.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/bn254.ts deleted file mode 100644 index b4d47a62..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/bn254.ts +++ /dev/null @@ -1,219 +0,0 @@ -/** - * bn254, previously known as alt_bn_128, when it had 128-bit security. - -Barbulescu-Duquesne 2017 shown it's weaker: just about 100 bits, -so the naming has been adjusted to its prime bit count: -https://hal.science/hal-01534101/file/main.pdf. -Compatible with EIP-196 and EIP-197. - -There are huge compatibility issues in the ecosystem: - -1. Different libraries call it in different ways: "bn254", "bn256", "alt_bn128", "bn128". -2. libff has bn128, but it's a different curve with different G2: - https://github.com/scipr-lab/libff/blob/a44f482e18b8ac04d034c193bd9d7df7817ad73f/libff/algebra/curves/bn128/bn128_init.cpp#L166-L169 -3. halo2curves bn256 is also incompatible and returns different outputs - -We don't implement Point methods toHex / toBytes. -To work around this limitation, has to initialize points on their own from BigInts. -Reason it's not implemented is because [there is no standard](https://github.com/privacy-scaling-explorations/halo2curves/issues/109). -Points of divergence: - -- Endianness: LE vs BE (byte-swapped) -- Flags as first hex bits (similar to BLS) vs no-flags -- Imaginary part last in G2 vs first (c0, c1 vs c1, c0) - -The goal of our implementation is to support "Ethereum" variant of the curve, -because it at least has specs: - -- EIP196 (https://eips.ethereum.org/EIPS/eip-196) describes bn254 ECADD and ECMUL opcodes for EVM -- EIP197 (https://eips.ethereum.org/EIPS/eip-197) describes bn254 pairings -- It's hard: EIPs don't have proper tests. EIP-197 returns boolean output instead of Fp12 -- The existing implementations are bad. Some are deprecated: - - https://github.com/paritytech/bn (old version) - - https://github.com/ewasm/ethereum-bn128.rs (uses paritytech/bn) - - https://github.com/zcash-hackworks/bn - - https://github.com/arkworks-rs/curves/blob/master/bn254/src/lib.rs -- Python implementations use different towers and produce different Fp12 outputs: - - https://github.com/ethereum/py_pairing - - https://github.com/ethereum/py_ecc/tree/main/py_ecc/bn128 -- Points are encoded differently in different implementations - -### Params -Seed (X): 4965661367192848881 -Fr: (36x⁴+36x³+18x²+6x+1) -Fp: (36x⁴+36x³+24x²+6x+1) -(E / Fp ): Y² = X³+3 -(Et / Fp²): Y² = X³+3/(u+9) (D-type twist) -Ate loop size: 6x+2 - -### Towers -- Fp²[u] = Fp/u²+1 -- Fp⁶[v] = Fp²/v³-9-u -- Fp¹²[w] = Fp⁶/w²-v - - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { - blsBasic, - type BlsCurvePair, - type BlsPostPrecomputeFn, - type BlsPostPrecomputePointAddFn, -} from './abstract/bls.ts'; -import { Field, type IField } from './abstract/modular.ts'; -import type { Fp, Fp12, Fp2, Fp6 } from './abstract/tower.ts'; -import { psiFrobenius, tower12 } from './abstract/tower.ts'; -import { weierstrass, type WeierstrassOpts } from './abstract/weierstrass.ts'; -import { bitLen } from './utils.ts'; -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3); -const _6n = BigInt(6); - -const BN_X = BigInt('4965661367192848881'); -const BN_X_LEN = bitLen(BN_X); -const SIX_X_SQUARED = _6n * BN_X ** _2n; - -const bn254_G1_CURVE: WeierstrassOpts = { - p: BigInt('0x30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47'), - n: BigInt('0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001'), - h: _1n, - a: _0n, - b: _3n, - Gx: _1n, - Gy: BigInt(2), -}; - -// r == n -// Finite field over r. It's for convenience and is not used in the code below. -export const bn254_Fr: IField = Field(bn254_G1_CURVE.n); - -// Fp2.div(Fp2.mul(Fp2.ONE, _3n), Fp2.NONRESIDUE) -const Fp2B = { - c0: BigInt('19485874751759354771024239261021720505790618469301721065564631296452457478373'), - c1: BigInt('266929791119991161246907387137283842545076965332900288569378510910307636690'), -}; - -const { Fp, Fp2, Fp6, Fp12 } = tower12({ - ORDER: bn254_G1_CURVE.p, - X_LEN: BN_X_LEN, - FP2_NONRESIDUE: [BigInt(9), _1n], - Fp2mulByB: (num) => Fp2.mul(num, Fp2B), - Fp12finalExponentiate: (num) => { - const powMinusX = (num: Fp12) => Fp12.conjugate(Fp12._cyclotomicExp(num, BN_X)); - const r0 = Fp12.mul(Fp12.conjugate(num), Fp12.inv(num)); - const r = Fp12.mul(Fp12.frobeniusMap(r0, 2), r0); - const y1 = Fp12._cyclotomicSquare(powMinusX(r)); - const y2 = Fp12.mul(Fp12._cyclotomicSquare(y1), y1); - const y4 = powMinusX(y2); - const y6 = powMinusX(Fp12._cyclotomicSquare(y4)); - const y8 = Fp12.mul(Fp12.mul(Fp12.conjugate(y6), y4), Fp12.conjugate(y2)); - const y9 = Fp12.mul(y8, y1); - return Fp12.mul( - Fp12.frobeniusMap(Fp12.mul(Fp12.conjugate(r), y9), 3), - Fp12.mul( - Fp12.frobeniusMap(y8, 2), - Fp12.mul(Fp12.frobeniusMap(y9, 1), Fp12.mul(Fp12.mul(y8, y4), r)) - ) - ); - }, -}); - -// END OF CURVE FIELDS -const { G2psi, psi } = psiFrobenius(Fp, Fp2, Fp2.NONRESIDUE); - -export const _postPrecompute: BlsPostPrecomputeFn = ( - Rx: Fp2, - Ry: Fp2, - Rz: Fp2, - Qx: Fp2, - Qy: Fp2, - pointAdd: BlsPostPrecomputePointAddFn -) => { - const q = psi(Qx, Qy); - ({ Rx, Ry, Rz } = pointAdd(Rx, Ry, Rz, q[0], q[1])); - const q2 = psi(q[0], q[1]); - pointAdd(Rx, Ry, Rz, q2[0], Fp2.neg(q2[1])); -}; - -// cofactor: (36 * X^4) + (36 * X^3) + (30 * X^2) + 6*X + 1 -const bn254_G2_CURVE: WeierstrassOpts = { - p: Fp2.ORDER, - n: bn254_G1_CURVE.n, - h: BigInt('0x30644e72e131a029b85045b68181585e06ceecda572a2489345f2299c0f9fa8d'), - a: Fp2.ZERO, - b: Fp2B, - Gx: Fp2.fromBigTuple([ - BigInt('10857046999023057135944570762232829481370756359578518086990519993285655852781'), - BigInt('11559732032986387107991004021392285783925812861821192530917403151452391805634'), - ]), - Gy: Fp2.fromBigTuple([ - BigInt('8495653923123431417604973247489272438418190587263600148770280649306958101930'), - BigInt('4082367875863433681332203403145435568316851327593401208105741076214120093531'), - ]), -}; - -const fields = { Fp, Fp2, Fp6, Fp12, Fr: bn254_Fr }; -const bn254_G1 = weierstrass(bn254_G1_CURVE, { - Fp, - Fn: bn254_Fr, - allowInfinityPoint: true, -}); -const bn254_G2 = weierstrass(bn254_G2_CURVE, { - Fp: Fp2, - Fn: bn254_Fr, - allowInfinityPoint: true, - isTorsionFree: (c, P) => P.multiplyUnsafe(SIX_X_SQUARED).equals(G2psi(c, P)), // [p]P = [6X^2]P -}); -/* -No hashToCurve for now (and signatures): - -- RFC 9380 doesn't mention bn254 and doesn't provide test vectors -- Overall seems like nobody is using BLS signatures on top of bn254 -- Seems like it can utilize SVDW, which is not implemented yet -*/ -// const htfDefaults = Object.freeze({ -// // DST: a domain separation tag defined in section 2.2.5 -// DST: 'BN254G2_XMD:SHA-256_SVDW_RO_', -// encodeDST: 'BN254G2_XMD:SHA-256_SVDW_RO_', -// p: Fp.ORDER, -// m: 2, -// k: 128, -// expand: 'xmd', -// hash: sha256, -// }); -// const hasherOpts = { -// { ...htfDefaults, m: 1, DST: 'BN254G2_XMD:SHA-256_SVDW_RO_' } -// }; -const bn254_params = { - ateLoopSize: BN_X * _6n + _2n, - r: bn254_Fr.ORDER, - xNegative: false, - twistType: 'divisive' as const, - postPrecompute: _postPrecompute, -}; -// const bn254_hasher = { -// hasherOpts: htfDefaults, -// hasherOptsG1: { m: 1, DST: 'BN254G2_XMD:SHA-256_SVDW_RO_' }, -// hasherOptsG2: htfDefaults -// }; -// G2_heff hEff: BigInt('21888242871839275222246405745257275088844257914179612981679871602714643921549'), -// fromBytes: notImplemented, -// toBytes: notImplemented, - -// mapToCurve: notImplemented, -// fromBytes: notImplemented, -// toBytes: notImplemented, -// ShortSignature: { -// fromBytes: notImplemented, -// fromHex: notImplemented, -// toBytes: notImplemented, -// toRawBytes: notImplemented, -// toHex: notImplemented, -// }, - -/** - * bn254 (a.k.a. alt_bn128) pairing-friendly curve. - * Contains G1 / G2 operations and pairings. - */ -// bn254_hasher -export const bn254: BlsCurvePair = blsBasic(fields, bn254_G1, bn254_G2, bn254_params); diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/ed25519.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/ed25519.ts deleted file mode 100644 index a4922297..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/ed25519.ts +++ /dev/null @@ -1,533 +0,0 @@ -/** - * ed25519 Twisted Edwards curve with following addons: - * - X25519 ECDH - * - Ristretto cofactor elimination - * - Elligator hash-to-group / point indistinguishability - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { sha512 } from '@noble/hashes/sha2.js'; -import { abytes, concatBytes, hexToBytes } from '@noble/hashes/utils.js'; -import { type AffinePoint } from './abstract/curve.ts'; -import { - eddsa, - edwards, - PrimeEdwardsPoint, - type EdDSA, - type EdDSAOpts, - type EdwardsOpts, - type EdwardsPoint, - type EdwardsPointCons, -} from './abstract/edwards.ts'; -import { - _DST_scalar, - createHasher, - expand_message_xmd, - type H2CDSTOpts, - type H2CHasher, - type H2CHasherBase, -} from './abstract/hash-to-curve.ts'; -import { - FpInvertBatch, - FpSqrtEven, - isNegativeLE, - mod, - pow2, - type IField, -} from './abstract/modular.ts'; -import { montgomery, type MontgomeryECDH } from './abstract/montgomery.ts'; -import { createORPF, type OPRF } from './abstract/oprf.ts'; -import { asciiToBytes, bytesToNumberLE, equalBytes } from './utils.ts'; - -// prettier-ignore -const _0n = /* @__PURE__ */ BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = /* @__PURE__ */ BigInt(3); -// prettier-ignore -const _5n = BigInt(5), _8n = BigInt(8); - -// P = 2n**255n - 19n -const ed25519_CURVE_p = BigInt( - '0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed' -); -// N = 2n**252n + 27742317777372353535851937790883648493n -// a = Fp.create(BigInt(-1)) -// d = -121665/121666 a.k.a. Fp.neg(121665 * Fp.inv(121666)) -const ed25519_CURVE: EdwardsOpts = /* @__PURE__ */ (() => ({ - p: ed25519_CURVE_p, - n: BigInt('0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed'), - h: _8n, - a: BigInt('0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec'), - d: BigInt('0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3'), - Gx: BigInt('0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a'), - Gy: BigInt('0x6666666666666666666666666666666666666666666666666666666666666658'), -}))(); - -function ed25519_pow_2_252_3(x: bigint) { - // prettier-ignore - const _10n = BigInt(10), _20n = BigInt(20), _40n = BigInt(40), _80n = BigInt(80); - const P = ed25519_CURVE_p; - const x2 = (x * x) % P; - const b2 = (x2 * x) % P; // x^3, 11 - const b4 = (pow2(b2, _2n, P) * b2) % P; // x^15, 1111 - const b5 = (pow2(b4, _1n, P) * x) % P; // x^31 - const b10 = (pow2(b5, _5n, P) * b5) % P; - const b20 = (pow2(b10, _10n, P) * b10) % P; - const b40 = (pow2(b20, _20n, P) * b20) % P; - const b80 = (pow2(b40, _40n, P) * b40) % P; - const b160 = (pow2(b80, _80n, P) * b80) % P; - const b240 = (pow2(b160, _80n, P) * b80) % P; - const b250 = (pow2(b240, _10n, P) * b10) % P; - const pow_p_5_8 = (pow2(b250, _2n, P) * x) % P; - // ^ To pow to (p+3)/8, multiply it by x. - return { pow_p_5_8, b2 }; -} - -function adjustScalarBytes(bytes: Uint8Array): Uint8Array { - // Section 5: For X25519, in order to decode 32 random bytes as an integer scalar, - // set the three least significant bits of the first byte - bytes[0] &= 248; // 0b1111_1000 - // and the most significant bit of the last to zero, - bytes[31] &= 127; // 0b0111_1111 - // set the second most significant bit of the last byte to 1 - bytes[31] |= 64; // 0b0100_0000 - return bytes; -} - -// √(-1) aka √(a) aka 2^((p-1)/4) -// Fp.sqrt(Fp.neg(1)) -const ED25519_SQRT_M1 = /* @__PURE__ */ BigInt( - '19681161376707505956807079304988542015446066515923890162744021073123829784752' -); -// sqrt(u/v) -function uvRatio(u: bigint, v: bigint): { isValid: boolean; value: bigint } { - const P = ed25519_CURVE_p; - const v3 = mod(v * v * v, P); // v³ - const v7 = mod(v3 * v3 * v, P); // v⁷ - // (p+3)/8 and (p-5)/8 - const pow = ed25519_pow_2_252_3(u * v7).pow_p_5_8; - let x = mod(u * v3 * pow, P); // (uv³)(uv⁷)^(p-5)/8 - const vx2 = mod(v * x * x, P); // vx² - const root1 = x; // First root candidate - const root2 = mod(x * ED25519_SQRT_M1, P); // Second root candidate - const useRoot1 = vx2 === u; // If vx² = u (mod p), x is a square root - const useRoot2 = vx2 === mod(-u, P); // If vx² = -u, set x <-- x * 2^((p-1)/4) - const noRoot = vx2 === mod(-u * ED25519_SQRT_M1, P); // There is no valid root, vx² = -u√(-1) - if (useRoot1) x = root1; - if (useRoot2 || noRoot) x = root2; // We return root2 anyway, for const-time - if (isNegativeLE(x, P)) x = mod(-x, P); - return { isValid: useRoot1 || useRoot2, value: x }; -} - -const ed25519_Point = /* @__PURE__ */ edwards(ed25519_CURVE, { uvRatio }); -const Fp = /* @__PURE__ */ (() => ed25519_Point.Fp)(); -const Fn = /* @__PURE__ */ (() => ed25519_Point.Fn)(); - -function ed25519_domain(data: Uint8Array, ctx: Uint8Array, phflag: boolean) { - if (ctx.length > 255) throw new Error('Context is too big'); - return concatBytes( - asciiToBytes('SigEd25519 no Ed25519 collisions'), - new Uint8Array([phflag ? 1 : 0, ctx.length]), - ctx, - data - ); -} - -function ed(opts: EdDSAOpts) { - return eddsa(ed25519_Point, sha512, Object.assign({ adjustScalarBytes }, opts)); -} - -/** - * ed25519 curve with EdDSA signatures. - * @example - * ```js - * import { ed25519 } from '@noble/curves/ed25519.js'; - * const { secretKey, publicKey } = ed25519.keygen(); - * // const publicKey = ed25519.getPublicKey(secretKey); - * const msg = new TextEncoder().encode('hello noble'); - * const sig = ed25519.sign(msg, secretKey); - * const isValid = ed25519.verify(sig, msg, pub); // ZIP215 - * // RFC8032 / FIPS 186-5 - * const isValid2 = ed25519.verify(sig, msg, pub, { zip215: false }); - * ``` - */ -export const ed25519: EdDSA = /* @__PURE__ */ ed({}); -/** Context version of ed25519 (ctx for domain separation). See {@link ed25519} */ -export const ed25519ctx: EdDSA = /* @__PURE__ */ ed({ domain: ed25519_domain }); -/** Prehashed version of ed25519. See {@link ed25519} */ -export const ed25519ph: EdDSA = /* @__PURE__ */ ed({ domain: ed25519_domain, prehash: sha512 }); - -/** - * ECDH using curve25519 aka x25519. - * @example - * ```js - * import { x25519 } from '@noble/curves/ed25519.js'; - * const alice = x25519.keygen(); - * const bob = x25519.keygen(); - * const shared = x25519.getSharedSecret(alice.secretKey, bob.publicKey); - * ``` - */ -export const x25519: MontgomeryECDH = /* @__PURE__ */ (() => { - const P = ed25519_CURVE_p; - return montgomery({ - P, - type: 'x25519', - powPminus2: (x: bigint): bigint => { - // x^(p-2) aka x^(2^255-21) - const { pow_p_5_8, b2 } = ed25519_pow_2_252_3(x); - return mod(pow2(pow_p_5_8, _3n, P) * b2, P); - }, - adjustScalarBytes, - }); -})(); - -// Hash To Curve Elligator2 Map (NOTE: different from ristretto255 elligator) -// NOTE: very important part is usage of FpSqrtEven for ELL2_C1_EDWARDS, since -// SageMath returns different root first and everything falls apart -const ELL2_C1 = /* @__PURE__ */ (() => (ed25519_CURVE_p + _3n) / _8n)(); // 1. c1 = (q + 3) / 8 # Integer arithmetic -const ELL2_C2 = /* @__PURE__ */ (() => Fp.pow(_2n, ELL2_C1))(); // 2. c2 = 2^c1 -const ELL2_C3 = /* @__PURE__ */ (() => Fp.sqrt(Fp.neg(Fp.ONE)))(); // 3. c3 = sqrt(-1) - -/** - * RFC 9380 method `map_to_curve_elligator2_curve25519`. Experimental name: may be renamed later. - * @private - */ -// prettier-ignore -export function _map_to_curve_elligator2_curve25519(u: bigint): { - xMn: bigint, xMd: bigint, yMn: bigint, yMd: bigint -} { - const ELL2_C4 = (ed25519_CURVE_p - _5n) / _8n; // 4. c4 = (q - 5) / 8 # Integer arithmetic - const ELL2_J = BigInt(486662); - - let tv1 = Fp.sqr(u); // 1. tv1 = u^2 - tv1 = Fp.mul(tv1, _2n); // 2. tv1 = 2 * tv1 - let xd = Fp.add(tv1, Fp.ONE); // 3. xd = tv1 + 1 # Nonzero: -1 is square (mod p), tv1 is not - let x1n = Fp.neg(ELL2_J); // 4. x1n = -J # x1 = x1n / xd = -J / (1 + 2 * u^2) - let tv2 = Fp.sqr(xd); // 5. tv2 = xd^2 - let gxd = Fp.mul(tv2, xd); // 6. gxd = tv2 * xd # gxd = xd^3 - let gx1 = Fp.mul(tv1, ELL2_J);// 7. gx1 = J * tv1 # x1n + J * xd - gx1 = Fp.mul(gx1, x1n); // 8. gx1 = gx1 * x1n # x1n^2 + J * x1n * xd - gx1 = Fp.add(gx1, tv2); // 9. gx1 = gx1 + tv2 # x1n^2 + J * x1n * xd + xd^2 - gx1 = Fp.mul(gx1, x1n); // 10. gx1 = gx1 * x1n # x1n^3 + J * x1n^2 * xd + x1n * xd^2 - let tv3 = Fp.sqr(gxd); // 11. tv3 = gxd^2 - tv2 = Fp.sqr(tv3); // 12. tv2 = tv3^2 # gxd^4 - tv3 = Fp.mul(tv3, gxd); // 13. tv3 = tv3 * gxd # gxd^3 - tv3 = Fp.mul(tv3, gx1); // 14. tv3 = tv3 * gx1 # gx1 * gxd^3 - tv2 = Fp.mul(tv2, tv3); // 15. tv2 = tv2 * tv3 # gx1 * gxd^7 - let y11 = Fp.pow(tv2, ELL2_C4); // 16. y11 = tv2^c4 # (gx1 * gxd^7)^((p - 5) / 8) - y11 = Fp.mul(y11, tv3); // 17. y11 = y11 * tv3 # gx1*gxd^3*(gx1*gxd^7)^((p-5)/8) - let y12 = Fp.mul(y11, ELL2_C3); // 18. y12 = y11 * c3 - tv2 = Fp.sqr(y11); // 19. tv2 = y11^2 - tv2 = Fp.mul(tv2, gxd); // 20. tv2 = tv2 * gxd - let e1 = Fp.eql(tv2, gx1); // 21. e1 = tv2 == gx1 - let y1 = Fp.cmov(y12, y11, e1); // 22. y1 = CMOV(y12, y11, e1) # If g(x1) is square, this is its sqrt - let x2n = Fp.mul(x1n, tv1); // 23. x2n = x1n * tv1 # x2 = x2n / xd = 2 * u^2 * x1n / xd - let y21 = Fp.mul(y11, u); // 24. y21 = y11 * u - y21 = Fp.mul(y21, ELL2_C2); // 25. y21 = y21 * c2 - let y22 = Fp.mul(y21, ELL2_C3); // 26. y22 = y21 * c3 - let gx2 = Fp.mul(gx1, tv1); // 27. gx2 = gx1 * tv1 # g(x2) = gx2 / gxd = 2 * u^2 * g(x1) - tv2 = Fp.sqr(y21); // 28. tv2 = y21^2 - tv2 = Fp.mul(tv2, gxd); // 29. tv2 = tv2 * gxd - let e2 = Fp.eql(tv2, gx2); // 30. e2 = tv2 == gx2 - let y2 = Fp.cmov(y22, y21, e2); // 31. y2 = CMOV(y22, y21, e2) # If g(x2) is square, this is its sqrt - tv2 = Fp.sqr(y1); // 32. tv2 = y1^2 - tv2 = Fp.mul(tv2, gxd); // 33. tv2 = tv2 * gxd - let e3 = Fp.eql(tv2, gx1); // 34. e3 = tv2 == gx1 - let xn = Fp.cmov(x2n, x1n, e3); // 35. xn = CMOV(x2n, x1n, e3) # If e3, x = x1, else x = x2 - let y = Fp.cmov(y2, y1, e3); // 36. y = CMOV(y2, y1, e3) # If e3, y = y1, else y = y2 - let e4 = Fp.isOdd!(y); // 37. e4 = sgn0(y) == 1 # Fix sign of y - y = Fp.cmov(y, Fp.neg(y), e3 !== e4); // 38. y = CMOV(y, -y, e3 XOR e4) - return { xMn: xn, xMd: xd, yMn: y, yMd: _1n }; // 39. return (xn, xd, y, 1) -} - -const ELL2_C1_EDWARDS = /* @__PURE__ */ (() => FpSqrtEven(Fp, Fp.neg(BigInt(486664))))(); // sgn0(c1) MUST equal 0 -function map_to_curve_elligator2_edwards25519(u: bigint) { - const { xMn, xMd, yMn, yMd } = _map_to_curve_elligator2_curve25519(u); // 1. (xMn, xMd, yMn, yMd) = - // map_to_curve_elligator2_curve25519(u) - let xn = Fp.mul(xMn, yMd); // 2. xn = xMn * yMd - xn = Fp.mul(xn, ELL2_C1_EDWARDS); // 3. xn = xn * c1 - let xd = Fp.mul(xMd, yMn); // 4. xd = xMd * yMn # xn / xd = c1 * xM / yM - let yn = Fp.sub(xMn, xMd); // 5. yn = xMn - xMd - let yd = Fp.add(xMn, xMd); // 6. yd = xMn + xMd # (n / d - 1) / (n / d + 1) = (n - d) / (n + d) - let tv1 = Fp.mul(xd, yd); // 7. tv1 = xd * yd - let e = Fp.eql(tv1, Fp.ZERO); // 8. e = tv1 == 0 - xn = Fp.cmov(xn, Fp.ZERO, e); // 9. xn = CMOV(xn, 0, e) - xd = Fp.cmov(xd, Fp.ONE, e); // 10. xd = CMOV(xd, 1, e) - yn = Fp.cmov(yn, Fp.ONE, e); // 11. yn = CMOV(yn, 1, e) - yd = Fp.cmov(yd, Fp.ONE, e); // 12. yd = CMOV(yd, 1, e) - const [xd_inv, yd_inv] = FpInvertBatch(Fp, [xd, yd], true); // batch division - return { x: Fp.mul(xn, xd_inv), y: Fp.mul(yn, yd_inv) }; // 13. return (xn, xd, yn, yd) -} - -/** Hashing to ed25519 points / field. RFC 9380 methods. */ -export const ed25519_hasher: H2CHasher = /* @__PURE__ */ (() => - createHasher( - ed25519_Point, - (scalars: bigint[]) => map_to_curve_elligator2_edwards25519(scalars[0]), - { - DST: 'edwards25519_XMD:SHA-512_ELL2_RO_', - encodeDST: 'edwards25519_XMD:SHA-512_ELL2_NU_', - p: ed25519_CURVE_p, - m: 1, - k: 128, - expand: 'xmd', - hash: sha512, - } - ))(); - -// √(-1) aka √(a) aka 2^((p-1)/4) -const SQRT_M1 = ED25519_SQRT_M1; -// √(ad - 1) -const SQRT_AD_MINUS_ONE = /* @__PURE__ */ BigInt( - '25063068953384623474111414158702152701244531502492656460079210482610430750235' -); -// 1 / √(a-d) -const INVSQRT_A_MINUS_D = /* @__PURE__ */ BigInt( - '54469307008909316920995813868745141605393597292927456921205312896311721017578' -); -// 1-d² -const ONE_MINUS_D_SQ = /* @__PURE__ */ BigInt( - '1159843021668779879193775521855586647937357759715417654439879720876111806838' -); -// (d-1)² -const D_MINUS_ONE_SQ = /* @__PURE__ */ BigInt( - '40440834346308536858101042469323190826248399146238708352240133220865137265952' -); -// Calculates 1/√(number) -const invertSqrt = (number: bigint) => uvRatio(_1n, number); - -const MAX_255B = /* @__PURE__ */ BigInt( - '0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff' -); -const bytes255ToNumberLE = (bytes: Uint8Array) => Fp.create(bytesToNumberLE(bytes) & MAX_255B); - -/** - * Computes Elligator map for Ristretto255. - * Described in [RFC9380](https://www.rfc-editor.org/rfc/rfc9380#appendix-B) and on - * the [website](https://ristretto.group/formulas/elligator.html). - */ -function calcElligatorRistrettoMap(r0: bigint): EdwardsPoint { - const { d } = ed25519_CURVE; - const P = ed25519_CURVE_p; - const mod = (n: bigint) => Fp.create(n); - const r = mod(SQRT_M1 * r0 * r0); // 1 - const Ns = mod((r + _1n) * ONE_MINUS_D_SQ); // 2 - let c = BigInt(-1); // 3 - const D = mod((c - d * r) * mod(r + d)); // 4 - let { isValid: Ns_D_is_sq, value: s } = uvRatio(Ns, D); // 5 - let s_ = mod(s * r0); // 6 - if (!isNegativeLE(s_, P)) s_ = mod(-s_); - if (!Ns_D_is_sq) s = s_; // 7 - if (!Ns_D_is_sq) c = r; // 8 - const Nt = mod(c * (r - _1n) * D_MINUS_ONE_SQ - D); // 9 - const s2 = s * s; - const W0 = mod((s + s) * D); // 10 - const W1 = mod(Nt * SQRT_AD_MINUS_ONE); // 11 - const W2 = mod(_1n - s2); // 12 - const W3 = mod(_1n + s2); // 13 - return new ed25519_Point(mod(W0 * W3), mod(W2 * W1), mod(W1 * W3), mod(W0 * W2)); -} - -/** - * Wrapper over Edwards Point for ristretto255. - * - * Each ed25519/EdwardsPoint has 8 different equivalent points. This can be - * a source of bugs for protocols like ring signatures. Ristretto was created to solve this. - * Ristretto point operates in X:Y:Z:T extended coordinates like EdwardsPoint, - * but it should work in its own namespace: do not combine those two. - * See [RFC9496](https://www.rfc-editor.org/rfc/rfc9496). - */ -class _RistrettoPoint extends PrimeEdwardsPoint<_RistrettoPoint> { - // Do NOT change syntax: the following gymnastics is done, - // because typescript strips comments, which makes bundlers disable tree-shaking. - // prettier-ignore - static BASE: _RistrettoPoint = - /* @__PURE__ */ (() => new _RistrettoPoint(ed25519_Point.BASE))(); - // prettier-ignore - static ZERO: _RistrettoPoint = - /* @__PURE__ */ (() => new _RistrettoPoint(ed25519_Point.ZERO))(); - // prettier-ignore - static Fp: IField = - /* @__PURE__ */ (() => Fp)(); - // prettier-ignore - static Fn: IField = - /* @__PURE__ */ (() => Fn)(); - - constructor(ep: EdwardsPoint) { - super(ep); - } - - static fromAffine(ap: AffinePoint): _RistrettoPoint { - return new _RistrettoPoint(ed25519_Point.fromAffine(ap)); - } - - protected assertSame(other: _RistrettoPoint): void { - if (!(other instanceof _RistrettoPoint)) throw new Error('RistrettoPoint expected'); - } - - protected init(ep: EdwardsPoint): _RistrettoPoint { - return new _RistrettoPoint(ep); - } - - static fromBytes(bytes: Uint8Array): _RistrettoPoint { - abytes(bytes, 32); - const { a, d } = ed25519_CURVE; - const P = ed25519_CURVE_p; - const mod = (n: bigint) => Fp.create(n); - const s = bytes255ToNumberLE(bytes); - // 1. Check that s_bytes is the canonical encoding of a field element, or else abort. - // 3. Check that s is non-negative, or else abort - if (!equalBytes(Fp.toBytes(s), bytes) || isNegativeLE(s, P)) - throw new Error('invalid ristretto255 encoding 1'); - const s2 = mod(s * s); - const u1 = mod(_1n + a * s2); // 4 (a is -1) - const u2 = mod(_1n - a * s2); // 5 - const u1_2 = mod(u1 * u1); - const u2_2 = mod(u2 * u2); - const v = mod(a * d * u1_2 - u2_2); // 6 - const { isValid, value: I } = invertSqrt(mod(v * u2_2)); // 7 - const Dx = mod(I * u2); // 8 - const Dy = mod(I * Dx * v); // 9 - let x = mod((s + s) * Dx); // 10 - if (isNegativeLE(x, P)) x = mod(-x); // 10 - const y = mod(u1 * Dy); // 11 - const t = mod(x * y); // 12 - if (!isValid || isNegativeLE(t, P) || y === _0n) - throw new Error('invalid ristretto255 encoding 2'); - return new _RistrettoPoint(new ed25519_Point(x, y, _1n, t)); - } - - /** - * Converts ristretto-encoded string to ristretto point. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-decode). - * @param hex Ristretto-encoded 32 bytes. Not every 32-byte string is valid ristretto encoding - */ - static fromHex(hex: string): _RistrettoPoint { - return _RistrettoPoint.fromBytes(hexToBytes(hex)); - } - - /** - * Encodes ristretto point to Uint8Array. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-encode). - */ - toBytes(): Uint8Array { - let { X, Y, Z, T } = this.ep; - const P = ed25519_CURVE_p; - const mod = (n: bigint) => Fp.create(n); - const u1 = mod(mod(Z + Y) * mod(Z - Y)); // 1 - const u2 = mod(X * Y); // 2 - // Square root always exists - const u2sq = mod(u2 * u2); - const { value: invsqrt } = invertSqrt(mod(u1 * u2sq)); // 3 - const D1 = mod(invsqrt * u1); // 4 - const D2 = mod(invsqrt * u2); // 5 - const zInv = mod(D1 * D2 * T); // 6 - let D: bigint; // 7 - if (isNegativeLE(T * zInv, P)) { - let _x = mod(Y * SQRT_M1); - let _y = mod(X * SQRT_M1); - X = _x; - Y = _y; - D = mod(D1 * INVSQRT_A_MINUS_D); - } else { - D = D2; // 8 - } - if (isNegativeLE(X * zInv, P)) Y = mod(-Y); // 9 - let s = mod((Z - Y) * D); // 10 (check footer's note, no sqrt(-a)) - if (isNegativeLE(s, P)) s = mod(-s); - return Fp.toBytes(s); // 11 - } - - /** - * Compares two Ristretto points. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-equals). - */ - equals(other: _RistrettoPoint): boolean { - this.assertSame(other); - const { X: X1, Y: Y1 } = this.ep; - const { X: X2, Y: Y2 } = other.ep; - const mod = (n: bigint) => Fp.create(n); - // (x1 * y2 == y1 * x2) | (y1 * y2 == x1 * x2) - const one = mod(X1 * Y2) === mod(Y1 * X2); - const two = mod(Y1 * Y2) === mod(X1 * X2); - return one || two; - } - - is0(): boolean { - return this.equals(_RistrettoPoint.ZERO); - } -} - -export const ristretto255: { - Point: typeof _RistrettoPoint; -} = { Point: _RistrettoPoint }; - -/** Hashing to ristretto255 points / field. RFC 9380 methods. */ -export const ristretto255_hasher: H2CHasherBase = { - Point: _RistrettoPoint, - /** - * Spec: https://www.rfc-editor.org/rfc/rfc9380.html#name-hashing-to-ristretto255. Caveats: - * * There are no test vectors - * * encodeToCurve / mapToCurve is undefined - * * mapToCurve would be `calcElligatorRistrettoMap(scalars[0])`, not ristretto255_map! - * * hashToScalar is undefined too, so we just use OPRF implementation - * * We cannot re-use 'createHasher', because ristretto255_map is different algorithm/RFC - (os2ip -> bytes255ToNumberLE) - * * mapToCurve == calcElligatorRistrettoMap, hashToCurve == ristretto255_map - * * hashToScalar is undefined in RFC9380 for ristretto, we are using version from OPRF here, using bytes255ToNumblerLE will create different result if we use bytes255ToNumberLE as os2ip - * * current version is closest to spec. - */ - hashToCurve(msg: Uint8Array, options?: H2CDSTOpts): _RistrettoPoint { - // == 'hash_to_ristretto255' - const DST = options?.DST || 'ristretto255_XMD:SHA-512_R255MAP_RO_'; - const xmd = expand_message_xmd(msg, DST, 64, sha512); - // NOTE: RFC 9380 incorrectly calls this function 'ristretto255_map', in RFC 9496 map was function inside (per point) - // That also lead to confustion that ristretto255_map is mapToCurve (it is not! it is old hashToCurve) - return ristretto255_hasher.deriveToCurve!(xmd); - }, - hashToScalar(msg: Uint8Array, options: H2CDSTOpts = { DST: _DST_scalar }) { - const xmd = expand_message_xmd(msg, options.DST, 64, sha512); - return Fn.create(bytesToNumberLE(xmd)); - }, - /** - * HashToCurve-like construction based on RFC 9496 (Element Derivation). - * Converts 64 uniform random bytes into a curve point. - * - * WARNING: This represents an older hash-to-curve construction, preceding the finalization of RFC 9380. - * It was later reused as a component in the newer `hash_to_ristretto255` function defined in RFC 9380. - */ - deriveToCurve(bytes: Uint8Array): _RistrettoPoint { - // https://www.rfc-editor.org/rfc/rfc9496.html#name-element-derivation - abytes(bytes, 64); - const r1 = bytes255ToNumberLE(bytes.subarray(0, 32)); - const R1 = calcElligatorRistrettoMap(r1); - const r2 = bytes255ToNumberLE(bytes.subarray(32, 64)); - const R2 = calcElligatorRistrettoMap(r2); - return new _RistrettoPoint(R1.add(R2)); - }, -}; - -/** ristretto255 OPRF, defined in RFC 9497. */ -export const ristretto255_oprf: OPRF = /* @__PURE__ */ (() => - createORPF({ - name: 'ristretto255-SHA512', - Point: _RistrettoPoint, - hash: sha512, - hashToGroup: ristretto255_hasher.hashToCurve, - hashToScalar: ristretto255_hasher.hashToScalar, - }))(); - -/** - * Weird / bogus points, useful for debugging. - * All 8 ed25519 points of 8-torsion subgroup can be generated from the point - * T = `26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05`. - * ⟨T⟩ = { O, T, 2T, 3T, 4T, 5T, 6T, 7T } - */ -export const ED25519_TORSION_SUBGROUP: string[] = [ - '0100000000000000000000000000000000000000000000000000000000000000', - 'c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a', - '0000000000000000000000000000000000000000000000000000000000000080', - '26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05', - 'ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f', - '26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85', - '0000000000000000000000000000000000000000000000000000000000000000', - 'c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa', -]; diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/ed448.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/ed448.ts deleted file mode 100644 index b9297098..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/ed448.ts +++ /dev/null @@ -1,525 +0,0 @@ -/** - * Edwards448 (not Ed448-Goldilocks) curve with following addons: - * - X448 ECDH - * - Decaf cofactor elimination - * - Elligator hash-to-group / point indistinguishability - * Conforms to RFC 8032 https://www.rfc-editor.org/rfc/rfc8032.html#section-5.2 - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { shake256 } from '@noble/hashes/sha3.js'; -import { concatBytes, hexToBytes, createHasher as wrapConstructor } from '@noble/hashes/utils.js'; -import type { AffinePoint } from './abstract/curve.ts'; -import { - eddsa, - edwards, - PrimeEdwardsPoint, - type EdDSA, - type EdDSAOpts, - type EdwardsOpts, - type EdwardsPoint, - type EdwardsPointCons, -} from './abstract/edwards.ts'; -import { - _DST_scalar, - createHasher, - expand_message_xof, - type H2CDSTOpts, - type H2CHasher, - type H2CHasherBase, -} from './abstract/hash-to-curve.ts'; -import { Field, FpInvertBatch, isNegativeLE, mod, pow2, type IField } from './abstract/modular.ts'; -import { montgomery, type MontgomeryECDH } from './abstract/montgomery.ts'; -import { createORPF, type OPRF } from './abstract/oprf.ts'; -import { abytes, asciiToBytes, bytesToNumberLE, equalBytes } from './utils.ts'; - -// edwards448 curve -// a = 1n -// d = Fp.neg(39081n) -// Finite field 2n**448n - 2n**224n - 1n -// Subgroup order -// 2n**446n - 13818066809895115352007386748515426880336692474882178609894547503885n -const ed448_CURVE_p = BigInt( - '0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffff' -); -const ed448_CURVE: EdwardsOpts = /* @__PURE__ */ (() => ({ - p: ed448_CURVE_p, - n: BigInt( - '0x3fffffffffffffffffffffffffffffffffffffffffffffffffffffff7cca23e9c44edb49aed63690216cc2728dc58f552378c292ab5844f3' - ), - h: BigInt(4), - a: BigInt(1), - d: BigInt( - '0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffffffffffffffffffffffffffffffffffffffffffffffff6756' - ), - Gx: BigInt( - '0x4f1970c66bed0ded221d15a622bf36da9e146570470f1767ea6de324a3d3a46412ae1af72ab66511433b80e18b00938e2626a82bc70cc05e' - ), - Gy: BigInt( - '0x693f46716eb6bc248876203756c9c7624bea73736ca3984087789c1e05a0c2d73ad3ff1ce67c39c4fdbd132c4ed7c8ad9808795bf230fa14' - ), -}))(); - -// E448 NIST curve is identical to edwards448, except for: -// d = 39082/39081 -// Gx = 3/2 -const E448_CURVE: EdwardsOpts = /* @__PURE__ */ (() => - Object.assign({}, ed448_CURVE, { - d: BigInt( - '0xd78b4bdc7f0daf19f24f38c29373a2ccad46157242a50f37809b1da3412a12e79ccc9c81264cfe9ad080997058fb61c4243cc32dbaa156b9' - ), - Gx: BigInt( - '0x79a70b2b70400553ae7c9df416c792c61128751ac92969240c25a07d728bdc93e21f7787ed6972249de732f38496cd11698713093e9c04fc' - ), - Gy: BigInt( - '0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffff80000000000000000000000000000000000000000000000000000001' - ), - }))(); - -const shake256_114 = /* @__PURE__ */ wrapConstructor(() => shake256.create({ dkLen: 114 })); -const shake256_64 = /* @__PURE__ */ wrapConstructor(() => shake256.create({ dkLen: 64 })); - -// prettier-ignore -const _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = /* @__PURE__ */ BigInt(4), _11n = BigInt(11); -// prettier-ignore -const _22n = BigInt(22), _44n = BigInt(44), _88n = BigInt(88), _223n = BigInt(223); - -// powPminus3div4 calculates z = x^k mod p, where k = (p-3)/4. -// Used for efficient square root calculation. -// ((P-3)/4).toString(2) would produce bits [223x 1, 0, 222x 1] -function ed448_pow_Pminus3div4(x: bigint): bigint { - const P = ed448_CURVE_p; - const b2 = (x * x * x) % P; - const b3 = (b2 * b2 * x) % P; - const b6 = (pow2(b3, _3n, P) * b3) % P; - const b9 = (pow2(b6, _3n, P) * b3) % P; - const b11 = (pow2(b9, _2n, P) * b2) % P; - const b22 = (pow2(b11, _11n, P) * b11) % P; - const b44 = (pow2(b22, _22n, P) * b22) % P; - const b88 = (pow2(b44, _44n, P) * b44) % P; - const b176 = (pow2(b88, _88n, P) * b88) % P; - const b220 = (pow2(b176, _44n, P) * b44) % P; - const b222 = (pow2(b220, _2n, P) * b2) % P; - const b223 = (pow2(b222, _1n, P) * x) % P; - return (pow2(b223, _223n, P) * b222) % P; -} - -function adjustScalarBytes(bytes: Uint8Array): Uint8Array { - // Section 5: Likewise, for X448, set the two least significant bits of the first byte to 0, - bytes[0] &= 252; // 0b11111100 - // and the most significant bit of the last byte to 1. - bytes[55] |= 128; // 0b10000000 - // NOTE: is NOOP for 56 bytes scalars (X25519/X448) - bytes[56] = 0; // Byte outside of group (456 buts vs 448 bits) - return bytes; -} - -// Constant-time ratio of u to v. Allows to combine inversion and square root u/√v. -// Uses algo from RFC8032 5.1.3. -function uvRatio(u: bigint, v: bigint): { isValid: boolean; value: bigint } { - const P = ed448_CURVE_p; - // https://www.rfc-editor.org/rfc/rfc8032#section-5.2.3 - // To compute the square root of (u/v), the first step is to compute the - // candidate root x = (u/v)^((p+1)/4). This can be done using the - // following trick, to use a single modular powering for both the - // inversion of v and the square root: - // x = (u/v)^((p+1)/4) = u³v(u⁵v³)^((p-3)/4) (mod p) - const u2v = mod(u * u * v, P); // u²v - const u3v = mod(u2v * u, P); // u³v - const u5v3 = mod(u3v * u2v * v, P); // u⁵v³ - const root = ed448_pow_Pminus3div4(u5v3); - const x = mod(u3v * root, P); - // Verify that root is exists - const x2 = mod(x * x, P); // x² - // If vx² = u, the recovered x-coordinate is x. Otherwise, no - // square root exists, and the decoding fails. - return { isValid: mod(x2 * v, P) === u, value: x }; -} - -// Finite field 2n**448n - 2n**224n - 1n -// The value fits in 448 bits, but we use 456-bit (57-byte) elements because of bitflags. -// - ed25519 fits in 255 bits, allowing using last 1 byte for specifying bit flag of point negation. -// - ed448 fits in 448 bits. We can't use last 1 byte: we can only use a bit 224 in the middle. -const Fp = /* @__PURE__ */ (() => Field(ed448_CURVE_p, { BITS: 456, isLE: true }))(); -const Fn = /* @__PURE__ */ (() => Field(ed448_CURVE.n, { BITS: 456, isLE: true }))(); -// decaf448 uses 448-bit (56-byte) keys -const Fp448 = /* @__PURE__ */ (() => Field(ed448_CURVE_p, { BITS: 448, isLE: true }))(); -const Fn448 = /* @__PURE__ */ (() => Field(ed448_CURVE.n, { BITS: 448, isLE: true }))(); - -// SHAKE256(dom4(phflag,context)||x, 114) -function dom4(data: Uint8Array, ctx: Uint8Array, phflag: boolean) { - if (ctx.length > 255) throw new Error('context must be smaller than 255, got: ' + ctx.length); - return concatBytes( - asciiToBytes('SigEd448'), - new Uint8Array([phflag ? 1 : 0, ctx.length]), - ctx, - data - ); -} -const ed448_Point = /* @__PURE__ */ edwards(ed448_CURVE, { Fp, Fn, uvRatio }); - -function ed4(opts: EdDSAOpts) { - return eddsa(ed448_Point, shake256_114, Object.assign({ adjustScalarBytes, domain: dom4 }, opts)); -} - -/** - * ed448 EdDSA curve and methods. - * @example - * ```js - * import { ed448 } from '@noble/curves/ed448.js'; - * const { secretKey, publicKey } = ed448.keygen(); - * // const publicKey = ed448.getPublicKey(secretKey); - * const msg = new TextEncoder().encode('hello noble'); - * const sig = ed448.sign(msg, secretKey); - * const isValid = ed448.verify(sig, msg, publicKey); - * ``` - */ -export const ed448: EdDSA = /* @__PURE__ */ ed4({}); - -// There is no ed448ctx, since ed448 supports ctx by default -/** Prehashed version of ed448. See {@link ed448} */ -export const ed448ph: EdDSA = /* @__PURE__ */ ed4({ prehash: shake256_64 }); -/** - * E448 (NIST) != edwards448 used in ed448. - * E448 is birationally equivalent to edwards448. - */ -export const E448: EdwardsPointCons = /* @__PURE__ */ edwards(E448_CURVE); - -/** - * ECDH using curve448 aka x448. - * - * @example - * ```js - * import { x448 } from '@noble/curves/ed448.js'; - * const alice = x448.keygen(); - * const bob = x448.keygen(); - * const shared = x448.getSharedSecret(alice.secretKey, bob.publicKey); - * ``` - */ -export const x448: MontgomeryECDH = /* @__PURE__ */ (() => { - const P = ed448_CURVE_p; - return montgomery({ - P, - type: 'x448', - powPminus2: (x: bigint): bigint => { - const Pminus3div4 = ed448_pow_Pminus3div4(x); - const Pminus3 = pow2(Pminus3div4, _2n, P); - return mod(Pminus3 * x, P); // Pminus3 * x = Pminus2 - }, - adjustScalarBytes, - }); -})(); - -// Hash To Curve Elligator2 Map -const ELL2_C1 = /* @__PURE__ */ (() => (ed448_CURVE_p - BigInt(3)) / BigInt(4))(); // 1. c1 = (q - 3) / 4 # Integer arithmetic -const ELL2_J = /* @__PURE__ */ BigInt(156326); - -function map_to_curve_elligator2_curve448(u: bigint) { - let tv1 = Fp.sqr(u); // 1. tv1 = u^2 - let e1 = Fp.eql(tv1, Fp.ONE); // 2. e1 = tv1 == 1 - tv1 = Fp.cmov(tv1, Fp.ZERO, e1); // 3. tv1 = CMOV(tv1, 0, e1) # If Z * u^2 == -1, set tv1 = 0 - let xd = Fp.sub(Fp.ONE, tv1); // 4. xd = 1 - tv1 - let x1n = Fp.neg(ELL2_J); // 5. x1n = -J - let tv2 = Fp.sqr(xd); // 6. tv2 = xd^2 - let gxd = Fp.mul(tv2, xd); // 7. gxd = tv2 * xd # gxd = xd^3 - let gx1 = Fp.mul(tv1, Fp.neg(ELL2_J)); // 8. gx1 = -J * tv1 # x1n + J * xd - gx1 = Fp.mul(gx1, x1n); // 9. gx1 = gx1 * x1n # x1n^2 + J * x1n * xd - gx1 = Fp.add(gx1, tv2); // 10. gx1 = gx1 + tv2 # x1n^2 + J * x1n * xd + xd^2 - gx1 = Fp.mul(gx1, x1n); // 11. gx1 = gx1 * x1n # x1n^3 + J * x1n^2 * xd + x1n * xd^2 - let tv3 = Fp.sqr(gxd); // 12. tv3 = gxd^2 - tv2 = Fp.mul(gx1, gxd); // 13. tv2 = gx1 * gxd # gx1 * gxd - tv3 = Fp.mul(tv3, tv2); // 14. tv3 = tv3 * tv2 # gx1 * gxd^3 - let y1 = Fp.pow(tv3, ELL2_C1); // 15. y1 = tv3^c1 # (gx1 * gxd^3)^((p - 3) / 4) - y1 = Fp.mul(y1, tv2); // 16. y1 = y1 * tv2 # gx1 * gxd * (gx1 * gxd^3)^((p - 3) / 4) - let x2n = Fp.mul(x1n, Fp.neg(tv1)); // 17. x2n = -tv1 * x1n # x2 = x2n / xd = -1 * u^2 * x1n / xd - let y2 = Fp.mul(y1, u); // 18. y2 = y1 * u - y2 = Fp.cmov(y2, Fp.ZERO, e1); // 19. y2 = CMOV(y2, 0, e1) - tv2 = Fp.sqr(y1); // 20. tv2 = y1^2 - tv2 = Fp.mul(tv2, gxd); // 21. tv2 = tv2 * gxd - let e2 = Fp.eql(tv2, gx1); // 22. e2 = tv2 == gx1 - let xn = Fp.cmov(x2n, x1n, e2); // 23. xn = CMOV(x2n, x1n, e2) # If e2, x = x1, else x = x2 - let y = Fp.cmov(y2, y1, e2); // 24. y = CMOV(y2, y1, e2) # If e2, y = y1, else y = y2 - let e3 = Fp.isOdd(y); // 25. e3 = sgn0(y) == 1 # Fix sign of y - y = Fp.cmov(y, Fp.neg(y), e2 !== e3); // 26. y = CMOV(y, -y, e2 XOR e3) - return { xn, xd, yn: y, yd: Fp.ONE }; // 27. return (xn, xd, y, 1) -} - -function map_to_curve_elligator2_edwards448(u: bigint) { - let { xn, xd, yn, yd } = map_to_curve_elligator2_curve448(u); // 1. (xn, xd, yn, yd) = map_to_curve_elligator2_curve448(u) - let xn2 = Fp.sqr(xn); // 2. xn2 = xn^2 - let xd2 = Fp.sqr(xd); // 3. xd2 = xd^2 - let xd4 = Fp.sqr(xd2); // 4. xd4 = xd2^2 - let yn2 = Fp.sqr(yn); // 5. yn2 = yn^2 - let yd2 = Fp.sqr(yd); // 6. yd2 = yd^2 - let xEn = Fp.sub(xn2, xd2); // 7. xEn = xn2 - xd2 - let tv2 = Fp.sub(xEn, xd2); // 8. tv2 = xEn - xd2 - xEn = Fp.mul(xEn, xd2); // 9. xEn = xEn * xd2 - xEn = Fp.mul(xEn, yd); // 10. xEn = xEn * yd - xEn = Fp.mul(xEn, yn); // 11. xEn = xEn * yn - xEn = Fp.mul(xEn, _4n); // 12. xEn = xEn * 4 - tv2 = Fp.mul(tv2, xn2); // 13. tv2 = tv2 * xn2 - tv2 = Fp.mul(tv2, yd2); // 14. tv2 = tv2 * yd2 - let tv3 = Fp.mul(yn2, _4n); // 15. tv3 = 4 * yn2 - let tv1 = Fp.add(tv3, yd2); // 16. tv1 = tv3 + yd2 - tv1 = Fp.mul(tv1, xd4); // 17. tv1 = tv1 * xd4 - let xEd = Fp.add(tv1, tv2); // 18. xEd = tv1 + tv2 - tv2 = Fp.mul(tv2, xn); // 19. tv2 = tv2 * xn - let tv4 = Fp.mul(xn, xd4); // 20. tv4 = xn * xd4 - let yEn = Fp.sub(tv3, yd2); // 21. yEn = tv3 - yd2 - yEn = Fp.mul(yEn, tv4); // 22. yEn = yEn * tv4 - yEn = Fp.sub(yEn, tv2); // 23. yEn = yEn - tv2 - tv1 = Fp.add(xn2, xd2); // 24. tv1 = xn2 + xd2 - tv1 = Fp.mul(tv1, xd2); // 25. tv1 = tv1 * xd2 - tv1 = Fp.mul(tv1, xd); // 26. tv1 = tv1 * xd - tv1 = Fp.mul(tv1, yn2); // 27. tv1 = tv1 * yn2 - tv1 = Fp.mul(tv1, BigInt(-2)); // 28. tv1 = -2 * tv1 - let yEd = Fp.add(tv2, tv1); // 29. yEd = tv2 + tv1 - tv4 = Fp.mul(tv4, yd2); // 30. tv4 = tv4 * yd2 - yEd = Fp.add(yEd, tv4); // 31. yEd = yEd + tv4 - tv1 = Fp.mul(xEd, yEd); // 32. tv1 = xEd * yEd - let e = Fp.eql(tv1, Fp.ZERO); // 33. e = tv1 == 0 - xEn = Fp.cmov(xEn, Fp.ZERO, e); // 34. xEn = CMOV(xEn, 0, e) - xEd = Fp.cmov(xEd, Fp.ONE, e); // 35. xEd = CMOV(xEd, 1, e) - yEn = Fp.cmov(yEn, Fp.ONE, e); // 36. yEn = CMOV(yEn, 1, e) - yEd = Fp.cmov(yEd, Fp.ONE, e); // 37. yEd = CMOV(yEd, 1, e) - - const inv = FpInvertBatch(Fp, [xEd, yEd], true); // batch division - return { x: Fp.mul(xEn, inv[0]), y: Fp.mul(yEn, inv[1]) }; // 38. return (xEn, xEd, yEn, yEd) -} - -/** Hashing / encoding to ed448 points / field. RFC 9380 methods. */ -export const ed448_hasher: H2CHasher = /* @__PURE__ */ (() => - createHasher(ed448_Point, (scalars: bigint[]) => map_to_curve_elligator2_edwards448(scalars[0]), { - DST: 'edwards448_XOF:SHAKE256_ELL2_RO_', - encodeDST: 'edwards448_XOF:SHAKE256_ELL2_NU_', - p: ed448_CURVE_p, - m: 1, - k: 224, - expand: 'xof', - hash: shake256, - }))(); - -// 1-d -const ONE_MINUS_D = /* @__PURE__ */ BigInt('39082'); -// 1-2d -const ONE_MINUS_TWO_D = /* @__PURE__ */ BigInt('78163'); -// √(-d) -const SQRT_MINUS_D = /* @__PURE__ */ BigInt( - '98944233647732219769177004876929019128417576295529901074099889598043702116001257856802131563896515373927712232092845883226922417596214' -); -// 1 / √(-d) -const INVSQRT_MINUS_D = /* @__PURE__ */ BigInt( - '315019913931389607337177038330951043522456072897266928557328499619017160722351061360252776265186336876723201881398623946864393857820716' -); -// Calculates 1/√(number) -const invertSqrt = (number: bigint) => uvRatio(_1n, number); - -/** - * Elligator map for hash-to-curve of decaf448. - * Described in [RFC9380](https://www.rfc-editor.org/rfc/rfc9380#appendix-C) - * and [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-element-derivation-2). - */ -function calcElligatorDecafMap(r0: bigint): EdwardsPoint { - const { d, p: P } = ed448_CURVE; - const mod = (n: bigint) => Fp448.create(n); - - const r = mod(-(r0 * r0)); // 1 - const u0 = mod(d * (r - _1n)); // 2 - const u1 = mod((u0 + _1n) * (u0 - r)); // 3 - - const { isValid: was_square, value: v } = uvRatio(ONE_MINUS_TWO_D, mod((r + _1n) * u1)); // 4 - - let v_prime = v; // 5 - if (!was_square) v_prime = mod(r0 * v); - - let sgn = _1n; // 6 - if (!was_square) sgn = mod(-_1n); - - const s = mod(v_prime * (r + _1n)); // 7 - let s_abs = s; - if (isNegativeLE(s, P)) s_abs = mod(-s); - - const s2 = s * s; - const W0 = mod(s_abs * _2n); // 8 - const W1 = mod(s2 + _1n); // 9 - const W2 = mod(s2 - _1n); // 10 - const W3 = mod(v_prime * s * (r - _1n) * ONE_MINUS_TWO_D + sgn); // 11 - return new ed448_Point(mod(W0 * W3), mod(W2 * W1), mod(W1 * W3), mod(W0 * W2)); -} - -/** - * Each ed448/EdwardsPoint has 4 different equivalent points. This can be - * a source of bugs for protocols like ring signatures. Decaf was created to solve this. - * Decaf point operates in X:Y:Z:T extended coordinates like EdwardsPoint, - * but it should work in its own namespace: do not combine those two. - * See [RFC9496](https://www.rfc-editor.org/rfc/rfc9496). - */ -class _DecafPoint extends PrimeEdwardsPoint<_DecafPoint> { - // The following gymnastics is done because typescript strips comments otherwise - // prettier-ignore - static BASE: _DecafPoint = - /* @__PURE__ */ (() => new _DecafPoint(ed448_Point.BASE).multiplyUnsafe(_2n))(); - // prettier-ignore - static ZERO: _DecafPoint = - /* @__PURE__ */ (() => new _DecafPoint(ed448_Point.ZERO))(); - // prettier-ignore - static Fp: IField = - /* @__PURE__ */ (() => Fp448)(); - // prettier-ignore - static Fn: IField = - /* @__PURE__ */ (() => Fn448)(); - - constructor(ep: EdwardsPoint) { - super(ep); - } - - static fromAffine(ap: AffinePoint): _DecafPoint { - return new _DecafPoint(ed448_Point.fromAffine(ap)); - } - - protected assertSame(other: _DecafPoint): void { - if (!(other instanceof _DecafPoint)) throw new Error('DecafPoint expected'); - } - - protected init(ep: EdwardsPoint): _DecafPoint { - return new _DecafPoint(ep); - } - - static fromBytes(bytes: Uint8Array): _DecafPoint { - abytes(bytes, 56); - const { d, p: P } = ed448_CURVE; - const mod = (n: bigint) => Fp448.create(n); - const s = Fp448.fromBytes(bytes); - - // 1. Check that s_bytes is the canonical encoding of a field element, or else abort. - // 2. Check that s is non-negative, or else abort - if (!equalBytes(Fn448.toBytes(s), bytes) || isNegativeLE(s, P)) - throw new Error('invalid decaf448 encoding 1'); - - const s2 = mod(s * s); // 1 - const u1 = mod(_1n + s2); // 2 - const u1sq = mod(u1 * u1); - const u2 = mod(u1sq - _4n * d * s2); // 3 - - const { isValid, value: invsqrt } = invertSqrt(mod(u2 * u1sq)); // 4 - - let u3 = mod((s + s) * invsqrt * u1 * SQRT_MINUS_D); // 5 - if (isNegativeLE(u3, P)) u3 = mod(-u3); - - const x = mod(u3 * invsqrt * u2 * INVSQRT_MINUS_D); // 6 - const y = mod((_1n - s2) * invsqrt * u1); // 7 - const t = mod(x * y); // 8 - - if (!isValid) throw new Error('invalid decaf448 encoding 2'); - return new _DecafPoint(new ed448_Point(x, y, _1n, t)); - } - - /** - * Converts decaf-encoded string to decaf point. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-decode-2). - * @param hex Decaf-encoded 56 bytes. Not every 56-byte string is valid decaf encoding - */ - static fromHex(hex: string): _DecafPoint { - return _DecafPoint.fromBytes(hexToBytes(hex)); - } - - /** - * Encodes decaf point to Uint8Array. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-encode-2). - */ - toBytes(): Uint8Array { - const { X, Z, T } = this.ep; - const P = ed448_CURVE.p; - const mod = (n: bigint) => Fp448.create(n); - const u1 = mod(mod(X + T) * mod(X - T)); // 1 - const x2 = mod(X * X); - const { value: invsqrt } = invertSqrt(mod(u1 * ONE_MINUS_D * x2)); // 2 - let ratio = mod(invsqrt * u1 * SQRT_MINUS_D); // 3 - if (isNegativeLE(ratio, P)) ratio = mod(-ratio); - const u2 = mod(INVSQRT_MINUS_D * ratio * Z - T); // 4 - let s = mod(ONE_MINUS_D * invsqrt * X * u2); // 5 - if (isNegativeLE(s, P)) s = mod(-s); - return Fn448.toBytes(s); - } - - /** - * Compare one point to another. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-equals-2). - */ - equals(other: _DecafPoint): boolean { - this.assertSame(other); - const { X: X1, Y: Y1 } = this.ep; - const { X: X2, Y: Y2 } = other.ep; - // (x1 * y2 == y1 * x2) - return Fp448.create(X1 * Y2) === Fp448.create(Y1 * X2); - } - - is0(): boolean { - return this.equals(_DecafPoint.ZERO); - } -} - -export const decaf448: { - Point: typeof _DecafPoint; -} = { Point: _DecafPoint }; - -/** Hashing to decaf448 points / field. RFC 9380 methods. */ -export const decaf448_hasher: H2CHasherBase = { - Point: _DecafPoint, - hashToCurve(msg: Uint8Array, options?: H2CDSTOpts): _DecafPoint { - const DST = options?.DST || 'decaf448_XOF:SHAKE256_D448MAP_RO_'; - return decaf448_hasher.deriveToCurve!(expand_message_xof(msg, DST, 112, 224, shake256)); - }, - /** - * Warning: has big modulo bias of 2^-64. - * RFC is invalid. RFC says "use 64-byte xof", while for 2^-112 bias - * it must use 84-byte xof (56+56/2), not 64. - */ - hashToScalar(msg: Uint8Array, options: H2CDSTOpts = { DST: _DST_scalar }): bigint { - // Can't use `Fn448.fromBytes()`. 64-byte input => 56-byte field element - const xof = expand_message_xof(msg, options.DST, 64, 256, shake256); - return Fn448.create(bytesToNumberLE(xof)); - }, - /** - * HashToCurve-like construction based on RFC 9496 (Element Derivation). - * Converts 112 uniform random bytes into a curve point. - * - * WARNING: This represents an older hash-to-curve construction, preceding the finalization of RFC 9380. - * It was later reused as a component in the newer `hash_to_ristretto255` function defined in RFC 9380. - */ - deriveToCurve(bytes: Uint8Array): _DecafPoint { - abytes(bytes, 112); - const skipValidation = true; - // Note: Similar to the field element decoding described in - // [RFC7748], and unlike the field element decoding described in - // Section 5.3.1, non-canonical values are accepted. - const r1 = Fp448.create(Fp448.fromBytes(bytes.subarray(0, 56), skipValidation)); - const R1 = calcElligatorDecafMap(r1); - const r2 = Fp448.create(Fp448.fromBytes(bytes.subarray(56, 112), skipValidation)); - const R2 = calcElligatorDecafMap(r2); - return new _DecafPoint(R1.add(R2)); - }, -}; - -/** decaf448 OPRF, defined in RFC 9497. */ -export const decaf448_oprf: OPRF = /* @__PURE__ */ (() => - createORPF({ - name: 'decaf448-SHAKE256', - Point: _DecafPoint, - hash: (msg: Uint8Array) => shake256(msg, { dkLen: 64 }), - hashToGroup: decaf448_hasher.hashToCurve, - hashToScalar: decaf448_hasher.hashToScalar, - }))(); - -/** - * Weird / bogus points, useful for debugging. - * Unlike ed25519, there is no ed448 generator point which can produce full T subgroup. - * Instead, there is a Klein four-group, which spans over 2 independent 2-torsion points: - * (0, 1), (0, -1), (-1, 0), (1, 0). - */ -export const ED448_TORSION_SUBGROUP: string[] = [ - '010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', - 'fefffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffff00', - '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', - '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080', -]; diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/index.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/index.ts deleted file mode 100644 index 2918fdab..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/index.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Audited & minimal JS implementation of elliptic curve cryptography. - * @module - * @example -```js -import { secp256k1, schnorr } from '@noble/curves/secp256k1.js'; -import { ed25519, ed25519ph, ed25519ctx, x25519, ristretto255 } from '@noble/curves/ed25519.js'; -import { ed448, ed448ph, x448, decaf448 } from '@noble/curves/ed448.js'; -import { p256, p384, p521 } from '@noble/curves/nist.js'; -import { bls12_381 } from '@noble/curves/bls12-381.js'; -import { bn254 } from '@noble/curves/bn254.js'; -import { jubjub, babyjubjub, brainpoolP256r1, brainpoolP384r1, brainpoolP512r1 } from '@noble/curves/misc.js'; -import * as webcrypto from '@noble/curves/webcrypto.js'; - -// hash-to-curve -import { secp256k1_hasher } from '@noble/curves/secp256k1.js'; -import { p256_hasher, p384_hasher, p521_hasher } from '@noble/curves/nist.js'; -import { ristretto255_hasher } from '@noble/curves/ed25519.js'; -import { decaf448_hasher } from '@noble/curves/ed448.js'; - -// OPRFs -import { p256_oprf, p384_oprf, p521_oprf } from '@noble/curves/nist.js'; -import { ristretto255_oprf } from '@noble/curves/ed25519.js'; -import { decaf448_oprf } from '@noble/curves/ed448.js'; - -// utils -import { bytesToHex, hexToBytes, concatBytes } from '@noble/curves/abstract/utils.js'; -import { Field } from '@noble/curves/abstract/modular.js'; -``` - */ -throw new Error('root module cannot be imported: import submodules instead. Check out README'); diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/misc.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/misc.ts deleted file mode 100644 index 9bbe9c73..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/misc.ts +++ /dev/null @@ -1,140 +0,0 @@ -/** - * Miscellaneous, rarely used curves. - * jubjub, babyjubjub, pallas, vesta. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { blake256 } from '@noble/hashes/blake1.js'; -import { blake2s } from '@noble/hashes/blake2.js'; -import { sha256, sha384, sha512 } from '@noble/hashes/sha2.js'; -import { concatBytes } from '@noble/hashes/utils.js'; -import { - eddsa, - edwards, - type EdDSA, - type EdwardsOpts, - type EdwardsPoint, -} from './abstract/edwards.ts'; -import { ecdsa, weierstrass, type ECDSA, type WeierstrassOpts } from './abstract/weierstrass.ts'; -import { asciiToBytes } from './utils.ts'; - -// Jubjub curves have 𝔽p over scalar fields of other curves. They are friendly to ZK proofs. - -// jubjub p = bls n, verify in bls12-381.ts -const jubjub_CURVE: EdwardsOpts = { - p: BigInt('0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001'), - n: BigInt('0xe7db4ea6533afa906673b0101343b00a6682093ccc81082d0970e5ed6f72cb7'), - h: BigInt(8), - a: BigInt('0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000000'), - d: BigInt('0x2a9318e74bfa2b48f5fd9207e6bd7fd4292d7f6d37579d2601065fd6d6343eb1'), - Gx: BigInt('0x11dafe5d23e1218086a365b99fbf3d3be72f6afd7d1f72623e6b071492d1122b'), - Gy: BigInt('0x1d523cf1ddab1a1793132e78c866c0c33e26ba5cc220fed7cc3f870e59d292aa'), -}; -/** Curve over scalar field of bls12-381. jubjub Fp = bls n */ -export const jubjub: EdDSA = /* @__PURE__ */ eddsa(edwards(jubjub_CURVE), sha512); - -// babyjubjub p = bn254 n, verify in bn254.ts -const babyjubjub_CURVE: EdwardsOpts = { - p: BigInt('0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001'), - n: BigInt('0x30644e72e131a029b85045b68181585d59f76dc1c90770533b94bee1c9093788'), - h: BigInt(8), - a: BigInt('168700'), - d: BigInt('168696'), - Gx: BigInt('0x23343e3445b673d38bcba38f25645adb494b1255b1162bb40f41a59f4d4b45e'), - Gy: BigInt('0xc19139cb84c680a6e14116da06056174a0cfa121e6e5c2450f87d64fc000001'), -}; -/** Curve over scalar field of bn254. babyjubjub Fp = bn254 n */ -export const babyjubjub: EdDSA = /* @__PURE__ */ eddsa(edwards(babyjubjub_CURVE), blake256); - -const jubjub_gh_first_block = asciiToBytes( - '096b36a5804bfacef1691e173c366a47ff5ba84a44f26ddd7e8d9f79d5b42df0' -); - -// Returns point at JubJub curve which is prime order and not zero -export function jubjub_groupHash(tag: Uint8Array, personalization: Uint8Array): EdwardsPoint { - const h = blake2s.create({ personalization, dkLen: 32 }); - h.update(jubjub_gh_first_block); - h.update(tag); - // NOTE: returns EdwardsPoint, in case it will be multiplied later - let p = jubjub.Point.fromBytes(h.digest()); - // NOTE: cannot replace with isSmallOrder, returns Point*8 - p = p.multiply(jubjub_CURVE.h); - if (p.equals(jubjub.Point.ZERO)) throw new Error('Point has small order'); - return p; -} - -// No secret data is leaked here at all. -// It operates over public data: -// const G_SPEND = jubjub.findGroupHash(Uint8Array.of(), asciiToBytes('Item_G_')); -export function jubjub_findGroupHash(m: Uint8Array, personalization: Uint8Array): EdwardsPoint { - const tag = concatBytes(m, Uint8Array.of(0)); - const hashes = []; - for (let i = 0; i < 256; i++) { - tag[tag.length - 1] = i; - try { - hashes.push(jubjub_groupHash(tag, personalization)); - } catch (e) {} - } - if (!hashes.length) throw new Error('findGroupHash tag overflow'); - return hashes[0]; -} - -const brainpoolP256r1_CURVE: WeierstrassOpts = { - p: BigInt('0xa9fb57dba1eea9bc3e660a909d838d726e3bf623d52620282013481d1f6e5377'), - a: BigInt('0x7d5a0975fc2c3057eef67530417affe7fb8055c126dc5c6ce94a4b44f330b5d9'), - b: BigInt('0x26dc5c6ce94a4b44f330b5d9bbd77cbf958416295cf7e1ce6bccdc18ff8c07b6'), - n: BigInt('0xa9fb57dba1eea9bc3e660a909d838d718c397aa3b561a6f7901e0e82974856a7'), - Gx: BigInt('0x8bd2aeb9cb7e57cb2c4b482ffc81b7afb9de27e1e3bd23c23a4453bd9ace3262'), - Gy: BigInt('0x547ef835c3dac4fd97f8461a14611dc9c27745132ded8e545c1d54c72f046997'), - h: BigInt(1), -}; -/** Brainpool P256r1 with sha256, from RFC 5639. */ -export const brainpoolP256r1: ECDSA = ecdsa(weierstrass(brainpoolP256r1_CURVE), sha256); - -const brainpoolP384r1_CURVE: WeierstrassOpts = { - p: BigInt( - '0x8cb91e82a3386d280f5d6f7e50e641df152f7109ed5456b412b1da197fb71123acd3a729901d1a71874700133107ec53' - ), - a: BigInt( - '0x7bc382c63d8c150c3c72080ace05afa0c2bea28e4fb22787139165efba91f90f8aa5814a503ad4eb04a8c7dd22ce2826' - ), - b: BigInt( - '0x04a8c7dd22ce28268b39b55416f0447c2fb77de107dcd2a62e880ea53eeb62d57cb4390295dbc9943ab78696fa504c11' - ), - n: BigInt( - '0x8cb91e82a3386d280f5d6f7e50e641df152f7109ed5456b31f166e6cac0425a7cf3ab6af6b7fc3103b883202e9046565' - ), - Gx: BigInt( - '0x1d1c64f068cf45ffa2a63a81b7c13f6b8847a3e77ef14fe3db7fcafe0cbd10e8e826e03436d646aaef87b2e247d4af1e' - ), - Gy: BigInt( - '0x8abe1d7520f9c2a45cb1eb8e95cfd55262b70b29feec5864e19c054ff99129280e4646217791811142820341263c5315' - ), - h: BigInt(1), -}; -/** Brainpool P384r1 with sha384, from RFC 5639. */ -export const brainpoolP384r1: ECDSA = ecdsa(weierstrass(brainpoolP384r1_CURVE), sha384); - -const brainpoolP512r1_CURVE: WeierstrassOpts = { - p: BigInt( - '0xaadd9db8dbe9c48b3fd4e6ae33c9fc07cb308db3b3c9d20ed6639cca703308717d4d9b009bc66842aecda12ae6a380e62881ff2f2d82c68528aa6056583a48f3' - ), - a: BigInt( - '0x7830a3318b603b89e2327145ac234cc594cbdd8d3df91610a83441caea9863bc2ded5d5aa8253aa10a2ef1c98b9ac8b57f1117a72bf2c7b9e7c1ac4d77fc94ca' - ), - b: BigInt( - '0x3df91610a83441caea9863bc2ded5d5aa8253aa10a2ef1c98b9ac8b57f1117a72bf2c7b9e7c1ac4d77fc94cadc083e67984050b75ebae5dd2809bd638016f723' - ), - n: BigInt( - '0xaadd9db8dbe9c48b3fd4e6ae33c9fc07cb308db3b3c9d20ed6639cca70330870553e5c414ca92619418661197fac10471db1d381085ddaddb58796829ca90069' - ), - Gx: BigInt( - '0x81aee4bdd82ed9645a21322e9c4c6a9385ed9f70b5d916c1b43b62eef4d0098eff3b1f78e2d0d48d50d1687b93b97d5f7c6d5047406a5e688b352209bcb9f822' - ), - Gy: BigInt( - '0x7dde385d566332ecc0eabfa9cf7822fdf209f70024a57b1aa000c55b881f8111b2dcde494a5f485e5bca4bd88a2763aed1ca2b2fa8f0540678cd1e0f3ad80892' - ), - h: BigInt(1), -}; -/** Brainpool P521r1 with sha512, from RFC 5639. */ -export const brainpoolP512r1: ECDSA = ecdsa(weierstrass(brainpoolP512r1_CURVE), sha512); diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/nist.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/nist.ts deleted file mode 100644 index 34b70d8d..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/nist.ts +++ /dev/null @@ -1,204 +0,0 @@ -/** - * Internal module for NIST P256, P384, P521 curves. - * Do not use for now. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { sha256, sha384, sha512 } from '@noble/hashes/sha2.js'; -import { createHasher, type H2CHasher } from './abstract/hash-to-curve.ts'; -import { Field } from './abstract/modular.ts'; -import { createORPF, type OPRF } from './abstract/oprf.ts'; -import { - ecdsa, - mapToCurveSimpleSWU, - weierstrass, - type ECDSA, - type WeierstrassOpts, - type WeierstrassPointCons, -} from './abstract/weierstrass.ts'; - -// p = 2n**224n * (2n**32n-1n) + 2n**192n + 2n**96n - 1n -// a = Fp256.create(BigInt('-3')); -const p256_CURVE: WeierstrassOpts = /* @__PURE__ */ (() => ({ - p: BigInt('0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff'), - n: BigInt('0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551'), - h: BigInt(1), - a: BigInt('0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc'), - b: BigInt('0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b'), - Gx: BigInt('0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296'), - Gy: BigInt('0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5'), -}))(); - -// p = 2n**384n - 2n**128n - 2n**96n + 2n**32n - 1n -const p384_CURVE: WeierstrassOpts = /* @__PURE__ */ (() => ({ - p: BigInt( - '0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff' - ), - n: BigInt( - '0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973' - ), - h: BigInt(1), - a: BigInt( - '0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffc' - ), - b: BigInt( - '0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef' - ), - Gx: BigInt( - '0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7' - ), - Gy: BigInt( - '0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f' - ), -}))(); - -// p = 2n**521n - 1n -const p521_CURVE: WeierstrassOpts = /* @__PURE__ */ (() => ({ - p: BigInt( - '0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff' - ), - n: BigInt( - '0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409' - ), - h: BigInt(1), - a: BigInt( - '0x1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc' - ), - b: BigInt( - '0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00' - ), - Gx: BigInt( - '0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66' - ), - Gy: BigInt( - '0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650' - ), -}))(); - -type SwuOpts = { - A: bigint; - B: bigint; - Z: bigint; -}; - -function createSWU(Point: WeierstrassPointCons, opts: SwuOpts) { - const map = mapToCurveSimpleSWU(Point.Fp, opts); - return (scalars: bigint[]) => map(scalars[0]); -} - -// NIST P256 -const p256_Point = /* @__PURE__ */ weierstrass(p256_CURVE); -/** - * NIST P256 (aka secp256r1, prime256v1) curve, ECDSA and ECDH methods. - * Hashes inputs with sha256 by default. - * - * @example - * ```js - * import { p256 } from '@noble/curves/nist.js'; - * const { secretKey, publicKey } = p256.keygen(); - * // const publicKey = p256.getPublicKey(secretKey); - * const msg = new TextEncoder().encode('hello noble'); - * const sig = p256.sign(msg, secretKey); - * const isValid = p256.verify(sig, msg, publicKey); - * // const sigKeccak = p256.sign(keccak256(msg), secretKey, { prehash: false }); - * ``` - */ -export const p256: ECDSA = /* @__PURE__ */ ecdsa(p256_Point, sha256); -/** Hashing / encoding to p256 points / field. RFC 9380 methods. */ -export const p256_hasher: H2CHasher> = /* @__PURE__ */ (() => { - return createHasher( - p256_Point, - createSWU(p256_Point, { - A: p256_CURVE.a, - B: p256_CURVE.b, - Z: p256_Point.Fp.create(BigInt('-10')), - }), - { - DST: 'P256_XMD:SHA-256_SSWU_RO_', - encodeDST: 'P256_XMD:SHA-256_SSWU_NU_', - p: p256_CURVE.p, - m: 1, - k: 128, - expand: 'xmd', - hash: sha256, - } - ); -})(); -/** p256 OPRF, defined in RFC 9497. */ -export const p256_oprf: OPRF = /* @__PURE__ */ (() => - createORPF({ - name: 'P256-SHA256', - Point: p256_Point, - hash: sha256, - hashToGroup: p256_hasher.hashToCurve, - hashToScalar: p256_hasher.hashToScalar, - }))(); - -// NIST P384 -const p384_Point = /* @__PURE__ */ weierstrass(p384_CURVE); -/** NIST P384 (aka secp384r1) curve, ECDSA and ECDH methods. Hashes inputs with sha384 by default. */ -export const p384: ECDSA = /* @__PURE__ */ ecdsa(p384_Point, sha384); -/** Hashing / encoding to p384 points / field. RFC 9380 methods. */ -export const p384_hasher: H2CHasher> = /* @__PURE__ */ (() => { - return createHasher( - p384_Point, - createSWU(p384_Point, { - A: p384_CURVE.a, - B: p384_CURVE.b, - Z: p384_Point.Fp.create(BigInt('-12')), - }), - { - DST: 'P384_XMD:SHA-384_SSWU_RO_', - encodeDST: 'P384_XMD:SHA-384_SSWU_NU_', - p: p384_CURVE.p, - m: 1, - k: 192, - expand: 'xmd', - hash: sha384, - } - ); -})(); -/** p384 OPRF, defined in RFC 9497. */ -export const p384_oprf: OPRF = /* @__PURE__ */ (() => - createORPF({ - name: 'P384-SHA384', - Point: p384_Point, - hash: sha384, - hashToGroup: p384_hasher.hashToCurve, - hashToScalar: p384_hasher.hashToScalar, - }))(); - -// NIST P521 -const Fn521 = /* @__PURE__ */ (() => Field(p521_CURVE.n, { allowedLengths: [65, 66] }))(); -const p521_Point = /* @__PURE__ */ weierstrass(p521_CURVE, { Fn: Fn521 }); -/** NIST P521 (aka secp521r1) curve, ECDSA and ECDH methods. Hashes inputs with sha512 by default. */ -export const p521: ECDSA = /* @__PURE__ */ ecdsa(p521_Point, sha512); -/** Hashing / encoding to p521 points / field. RFC 9380 methods. */ -export const p521_hasher: H2CHasher> = /* @__PURE__ */ (() => { - return createHasher( - p521_Point, - createSWU(p521_Point, { - A: p521_CURVE.a, - B: p521_CURVE.b, - Z: p521_Point.Fp.create(BigInt('-4')), - }), - { - DST: 'P521_XMD:SHA-512_SSWU_RO_', - encodeDST: 'P521_XMD:SHA-512_SSWU_NU_', - p: p521_CURVE.p, - m: 1, - k: 256, - expand: 'xmd', - hash: sha512, - } - ); -})(); -/** p521 OPRF, defined in RFC 9497. */ -export const p521_oprf: OPRF = /* @__PURE__ */ (() => - createORPF({ - name: 'P521-SHA512', - Point: p521_Point, - hash: sha512, - hashToGroup: p521_hasher.hashToCurve, - hashToScalar: p521_hasher.hashToScalar, // produces L=98 just like in RFC - }))(); diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/secp256k1.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/secp256k1.ts deleted file mode 100644 index 383412ff..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/secp256k1.ts +++ /dev/null @@ -1,327 +0,0 @@ -/** - * SECG secp256k1. See [pdf](https://www.secg.org/sec2-v2.pdf). - * - * Belongs to Koblitz curves: it has efficiently-computable GLV endomorphism ψ, - * check out {@link EndomorphismOpts}. Seems to be rigid (not backdoored). - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { sha256 } from '@noble/hashes/sha2.js'; -import { randomBytes } from '@noble/hashes/utils.js'; -import { createKeygen, type CurveLengths } from './abstract/curve.ts'; -import { createHasher, type H2CHasher, isogenyMap } from './abstract/hash-to-curve.ts'; -import { Field, mapHashToField, pow2 } from './abstract/modular.ts'; -import { - type ECDSA, - ecdsa, - type EndomorphismOpts, - mapToCurveSimpleSWU, - type WeierstrassPoint as PointType, - weierstrass, - type WeierstrassOpts, - type WeierstrassPointCons, -} from './abstract/weierstrass.ts'; -import { abytes, asciiToBytes, bytesToNumberBE, concatBytes } from './utils.ts'; - -// Seems like generator was produced from some seed: -// `Pointk1.BASE.multiply(Pointk1.Fn.inv(2n, N)).toAffine().x` -// // gives short x 0x3b78ce563f89a0ed9414f5aa28ad0d96d6795f9c63n -const secp256k1_CURVE: WeierstrassOpts = { - p: BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f'), - n: BigInt('0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141'), - h: BigInt(1), - a: BigInt(0), - b: BigInt(7), - Gx: BigInt('0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798'), - Gy: BigInt('0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8'), -}; - -const secp256k1_ENDO: EndomorphismOpts = { - beta: BigInt('0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee'), - basises: [ - [BigInt('0x3086d221a7d46bcde86c90e49284eb15'), -BigInt('0xe4437ed6010e88286f547fa90abfe4c3')], - [BigInt('0x114ca50f7a8e2f3f657c1108d9d44cfd8'), BigInt('0x3086d221a7d46bcde86c90e49284eb15')], - ], -}; - -const _0n = /* @__PURE__ */ BigInt(0); -const _2n = /* @__PURE__ */ BigInt(2); - -/** - * √n = n^((p+1)/4) for fields p = 3 mod 4. We unwrap the loop and multiply bit-by-bit. - * (P+1n/4n).toString(2) would produce bits [223x 1, 0, 22x 1, 4x 0, 11, 00] - */ -function sqrtMod(y: bigint): bigint { - const P = secp256k1_CURVE.p; - // prettier-ignore - const _3n = BigInt(3), _6n = BigInt(6), _11n = BigInt(11), _22n = BigInt(22); - // prettier-ignore - const _23n = BigInt(23), _44n = BigInt(44), _88n = BigInt(88); - const b2 = (y * y * y) % P; // x^3, 11 - const b3 = (b2 * b2 * y) % P; // x^7 - const b6 = (pow2(b3, _3n, P) * b3) % P; - const b9 = (pow2(b6, _3n, P) * b3) % P; - const b11 = (pow2(b9, _2n, P) * b2) % P; - const b22 = (pow2(b11, _11n, P) * b11) % P; - const b44 = (pow2(b22, _22n, P) * b22) % P; - const b88 = (pow2(b44, _44n, P) * b44) % P; - const b176 = (pow2(b88, _88n, P) * b88) % P; - const b220 = (pow2(b176, _44n, P) * b44) % P; - const b223 = (pow2(b220, _3n, P) * b3) % P; - const t1 = (pow2(b223, _23n, P) * b22) % P; - const t2 = (pow2(t1, _6n, P) * b2) % P; - const root = pow2(t2, _2n, P); - if (!Fpk1.eql(Fpk1.sqr(root), y)) throw new Error('Cannot find square root'); - return root; -} - -const Fpk1 = Field(secp256k1_CURVE.p, { sqrt: sqrtMod }); -const Pointk1 = /* @__PURE__ */ weierstrass(secp256k1_CURVE, { - Fp: Fpk1, - endo: secp256k1_ENDO, -}); - -/** - * secp256k1 curve: ECDSA and ECDH methods. - * - * Uses sha256 to hash messages. To use a different hash, - * pass `{ prehash: false }` to sign / verify. - * - * @example - * ```js - * import { secp256k1 } from '@noble/curves/secp256k1.js'; - * const { secretKey, publicKey } = secp256k1.keygen(); - * // const publicKey = secp256k1.getPublicKey(secretKey); - * const msg = new TextEncoder().encode('hello noble'); - * const sig = secp256k1.sign(msg, secretKey); - * const isValid = secp256k1.verify(sig, msg, publicKey); - * // const sigKeccak = secp256k1.sign(keccak256(msg), secretKey, { prehash: false }); - * ``` - */ -export const secp256k1: ECDSA = /* @__PURE__ */ ecdsa(Pointk1, sha256); - -// Schnorr signatures are superior to ECDSA from above. Below is Schnorr-specific BIP0340 code. -// https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki -/** An object mapping tags to their tagged hash prefix of [SHA256(tag) | SHA256(tag)] */ -const TAGGED_HASH_PREFIXES: { [tag: string]: Uint8Array } = {}; -function taggedHash(tag: string, ...messages: Uint8Array[]): Uint8Array { - let tagP = TAGGED_HASH_PREFIXES[tag]; - if (tagP === undefined) { - const tagH = sha256(asciiToBytes(tag)); - tagP = concatBytes(tagH, tagH); - TAGGED_HASH_PREFIXES[tag] = tagP; - } - return sha256(concatBytes(tagP, ...messages)); -} - -// ECDSA compact points are 33-byte. Schnorr is 32: we strip first byte 0x02 or 0x03 -const pointToBytes = (point: PointType) => point.toBytes(true).slice(1); -const hasEven = (y: bigint) => y % _2n === _0n; - -// Calculate point, scalar and bytes -function schnorrGetExtPubKey(priv: Uint8Array) { - const { Fn, BASE } = Pointk1; - const d_ = Fn.fromBytes(priv); - const p = BASE.multiply(d_); // P = d'⋅G; 0 < d' < n check is done inside - const scalar = hasEven(p.y) ? d_ : Fn.neg(d_); - return { scalar, bytes: pointToBytes(p) }; -} -/** - * lift_x from BIP340. Convert 32-byte x coordinate to elliptic curve point. - * @returns valid point checked for being on-curve - */ -function lift_x(x: bigint): PointType { - const Fp = Fpk1; - if (!Fp.isValidNot0(x)) throw new Error('invalid x: Fail if x ≥ p'); - const xx = Fp.create(x * x); - const c = Fp.create(xx * x + BigInt(7)); // Let c = x³ + 7 mod p. - let y = Fp.sqrt(c); // Let y = c^(p+1)/4 mod p. Same as sqrt(). - // Return the unique point P such that x(P) = x and - // y(P) = y if y mod 2 = 0 or y(P) = p-y otherwise. - if (!hasEven(y)) y = Fp.neg(y); - const p = Pointk1.fromAffine({ x, y }); - p.assertValidity(); - return p; -} -const num = bytesToNumberBE; -/** - * Create tagged hash, convert it to bigint, reduce modulo-n. - */ -function challenge(...args: Uint8Array[]): bigint { - return Pointk1.Fn.create(num(taggedHash('BIP0340/challenge', ...args))); -} - -/** - * Schnorr public key is just `x` coordinate of Point as per BIP340. - */ -function schnorrGetPublicKey(secretKey: Uint8Array): Uint8Array { - return schnorrGetExtPubKey(secretKey).bytes; // d'=int(sk). Fail if d'=0 or d'≥n. Ret bytes(d'⋅G) -} - -/** - * Creates Schnorr signature as per BIP340. Verifies itself before returning anything. - * auxRand is optional and is not the sole source of k generation: bad CSPRNG won't be dangerous. - */ -function schnorrSign( - message: Uint8Array, - secretKey: Uint8Array, - auxRand: Uint8Array = randomBytes(32) -): Uint8Array { - const { Fn } = Pointk1; - const m = abytes(message, undefined, 'message'); - const { bytes: px, scalar: d } = schnorrGetExtPubKey(secretKey); // checks for isWithinCurveOrder - const a = abytes(auxRand, 32, 'auxRand'); // Auxiliary random data a: a 32-byte array - const t = Fn.toBytes(d ^ num(taggedHash('BIP0340/aux', a))); // Let t be the byte-wise xor of bytes(d) and hash/aux(a) - const rand = taggedHash('BIP0340/nonce', t, px, m); // Let rand = hash/nonce(t || bytes(P) || m) - // Let k' = int(rand) mod n. Fail if k' = 0. Let R = k'⋅G - const { bytes: rx, scalar: k } = schnorrGetExtPubKey(rand); - const e = challenge(rx, px, m); // Let e = int(hash/challenge(bytes(R) || bytes(P) || m)) mod n. - const sig = new Uint8Array(64); // Let sig = bytes(R) || bytes((k + ed) mod n). - sig.set(rx, 0); - sig.set(Fn.toBytes(Fn.create(k + e * d)), 32); - // If Verify(bytes(P), m, sig) (see below) returns failure, abort - if (!schnorrVerify(sig, m, px)) throw new Error('sign: Invalid signature produced'); - return sig; -} - -/** - * Verifies Schnorr signature. - * Will swallow errors & return false except for initial type validation of arguments. - */ -function schnorrVerify(signature: Uint8Array, message: Uint8Array, publicKey: Uint8Array): boolean { - const { Fp, Fn, BASE } = Pointk1; - const sig = abytes(signature, 64, 'signature'); - const m = abytes(message, undefined, 'message'); - const pub = abytes(publicKey, 32, 'publicKey'); - try { - const P = lift_x(num(pub)); // P = lift_x(int(pk)); fail if that fails - const r = num(sig.subarray(0, 32)); // Let r = int(sig[0:32]); fail if r ≥ p. - if (!Fp.isValidNot0(r)) return false; - const s = num(sig.subarray(32, 64)); // Let s = int(sig[32:64]); fail if s ≥ n. - if (!Fn.isValidNot0(s)) return false; - - const e = challenge(Fn.toBytes(r), pointToBytes(P), m); // int(challenge(bytes(r)||bytes(P)||m))%n - // R = s⋅G - e⋅P, where -eP == (n-e)P - const R = BASE.multiplyUnsafe(s).add(P.multiplyUnsafe(Fn.neg(e))); - const { x, y } = R.toAffine(); - // Fail if is_infinite(R) / not has_even_y(R) / x(R) ≠ r. - if (R.is0() || !hasEven(y) || x !== r) return false; - return true; - } catch (error) { - return false; - } -} - -export type SecpSchnorr = { - keygen: (seed?: Uint8Array) => { secretKey: Uint8Array; publicKey: Uint8Array }; - getPublicKey: typeof schnorrGetPublicKey; - sign: typeof schnorrSign; - verify: typeof schnorrVerify; - Point: WeierstrassPointCons; - utils: { - randomSecretKey: (seed?: Uint8Array) => Uint8Array; - pointToBytes: (point: PointType) => Uint8Array; - lift_x: typeof lift_x; - taggedHash: typeof taggedHash; - }; - lengths: CurveLengths; -}; -/** - * Schnorr signatures over secp256k1. - * https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki - * @example - * ```js - * import { schnorr } from '@noble/curves/secp256k1.js'; - * const { secretKey, publicKey } = schnorr.keygen(); - * // const publicKey = schnorr.getPublicKey(secretKey); - * const msg = new TextEncoder().encode('hello'); - * const sig = schnorr.sign(msg, secretKey); - * const isValid = schnorr.verify(sig, msg, publicKey); - * ``` - */ -export const schnorr: SecpSchnorr = /* @__PURE__ */ (() => { - const size = 32; - const seedLength = 48; - const randomSecretKey = (seed = randomBytes(seedLength)): Uint8Array => { - return mapHashToField(seed, secp256k1_CURVE.n); - }; - return { - keygen: createKeygen(randomSecretKey, schnorrGetPublicKey), - getPublicKey: schnorrGetPublicKey, - sign: schnorrSign, - verify: schnorrVerify, - Point: Pointk1, - utils: { - randomSecretKey, - taggedHash, - lift_x, - pointToBytes, - }, - lengths: { - secretKey: size, - publicKey: size, - publicKeyHasPrefix: false, - signature: size * 2, - seed: seedLength, - }, - }; -})(); - -const isoMap = /* @__PURE__ */ (() => - isogenyMap( - Fpk1, - [ - // xNum - [ - '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7', - '0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581', - '0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262', - '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c', - ], - // xDen - [ - '0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b', - '0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14', - '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1 - ], - // yNum - [ - '0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c', - '0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3', - '0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931', - '0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84', - ], - // yDen - [ - '0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b', - '0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573', - '0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f', - '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1 - ], - ].map((i) => i.map((j) => BigInt(j))) as [bigint[], bigint[], bigint[], bigint[]] - ))(); -const mapSWU = /* @__PURE__ */ (() => - mapToCurveSimpleSWU(Fpk1, { - A: BigInt('0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533'), - B: BigInt('1771'), - Z: Fpk1.create(BigInt('-11')), - }))(); - -/** Hashing / encoding to secp256k1 points / field. RFC 9380 methods. */ -export const secp256k1_hasher: H2CHasher> = /* @__PURE__ */ (() => - createHasher( - Pointk1, - (scalars: bigint[]) => { - const { x, y } = mapSWU(Fpk1.create(scalars[0])); - return isoMap(x, y); - }, - { - DST: 'secp256k1_XMD:SHA-256_SSWU_RO_', - encodeDST: 'secp256k1_XMD:SHA-256_SSWU_NU_', - p: Fpk1.ORDER, - m: 1, - k: 128, - expand: 'xmd', - hash: sha256, - } - ))(); diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/utils.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/utils.ts deleted file mode 100644 index 82416b5d..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/utils.ts +++ /dev/null @@ -1,306 +0,0 @@ -/** - * Hex, bytes and number utilities. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { - abytes as abytes_, - anumber, - bytesToHex as bytesToHex_, - concatBytes as concatBytes_, - hexToBytes as hexToBytes_, -} from '@noble/hashes/utils.js'; -export { - abytes, - anumber, - bytesToHex, - concatBytes, - hexToBytes, - isBytes, - randomBytes, -} from '@noble/hashes/utils.js'; -const _0n = /* @__PURE__ */ BigInt(0); -const _1n = /* @__PURE__ */ BigInt(1); - -export type CHash = { - (message: Uint8Array): Uint8Array; - blockLen: number; - outputLen: number; - create(opts?: { dkLen?: number }): any; // For shake -}; -export type FHash = (message: Uint8Array) => Uint8Array; -export function abool(value: boolean, title: string = ''): boolean { - if (typeof value !== 'boolean') { - const prefix = title && `"${title}" `; - throw new Error(prefix + 'expected boolean, got type=' + typeof value); - } - return value; -} - -// Used in weierstrass, der -function abignumber(n: number | bigint) { - if (typeof n === 'bigint') { - if (!isPosBig(n)) throw new Error('positive bigint expected, got ' + n); - } else anumber(n); - return n; -} - -export function asafenumber(value: number, title: string = ''): void { - if (!Number.isSafeInteger(value)) { - const prefix = title && `"${title}" `; - throw new Error(prefix + 'expected safe integer, got type=' + typeof value); - } -} - -export function numberToHexUnpadded(num: number | bigint): string { - const hex = abignumber(num).toString(16); - return hex.length & 1 ? '0' + hex : hex; -} - -export function hexToNumber(hex: string): bigint { - if (typeof hex !== 'string') throw new Error('hex string expected, got ' + typeof hex); - return hex === '' ? _0n : BigInt('0x' + hex); // Big Endian -} - -// BE: Big Endian, LE: Little Endian -export function bytesToNumberBE(bytes: Uint8Array): bigint { - return hexToNumber(bytesToHex_(bytes)); -} -export function bytesToNumberLE(bytes: Uint8Array): bigint { - return hexToNumber(bytesToHex_(copyBytes(abytes_(bytes)).reverse())); -} - -export function numberToBytesBE(n: number | bigint, len: number): Uint8Array { - anumber(len); - n = abignumber(n); - const res = hexToBytes_(n.toString(16).padStart(len * 2, '0')); - if (res.length !== len) throw new Error('number too large'); - return res; -} -export function numberToBytesLE(n: number | bigint, len: number): Uint8Array { - return numberToBytesBE(n, len).reverse(); -} -// Unpadded, rarely used -export function numberToVarBytesBE(n: number | bigint): Uint8Array { - return hexToBytes_(numberToHexUnpadded(abignumber(n))); -} - -// Compares 2 u8a-s in kinda constant time -export function equalBytes(a: Uint8Array, b: Uint8Array): boolean { - if (a.length !== b.length) return false; - let diff = 0; - for (let i = 0; i < a.length; i++) diff |= a[i] ^ b[i]; - return diff === 0; -} - -/** - * Copies Uint8Array. We can't use u8a.slice(), because u8a can be Buffer, - * and Buffer#slice creates mutable copy. Never use Buffers! - */ -export function copyBytes(bytes: Uint8Array): Uint8Array { - return Uint8Array.from(bytes); -} - -/** - * Decodes 7-bit ASCII string to Uint8Array, throws on non-ascii symbols - * Should be safe to use for things expected to be ASCII. - * Returns exact same result as `TextEncoder` for ASCII or throws. - */ -export function asciiToBytes(ascii: string): Uint8Array { - return Uint8Array.from(ascii, (c, i) => { - const charCode = c.charCodeAt(0); - if (c.length !== 1 || charCode > 127) { - throw new Error( - `string contains non-ASCII character "${ascii[i]}" with code ${charCode} at position ${i}` - ); - } - return charCode; - }); -} - -// Is positive bigint -const isPosBig = (n: bigint) => typeof n === 'bigint' && _0n <= n; - -export function inRange(n: bigint, min: bigint, max: bigint): boolean { - return isPosBig(n) && isPosBig(min) && isPosBig(max) && min <= n && n < max; -} - -/** - * Asserts min <= n < max. NOTE: It's < max and not <= max. - * @example - * aInRange('x', x, 1n, 256n); // would assume x is in (1n..255n) - */ -export function aInRange(title: string, n: bigint, min: bigint, max: bigint): void { - // Why min <= n < max and not a (min < n < max) OR b (min <= n <= max)? - // consider P=256n, min=0n, max=P - // - a for min=0 would require -1: `inRange('x', x, -1n, P)` - // - b would commonly require subtraction: `inRange('x', x, 0n, P - 1n)` - // - our way is the cleanest: `inRange('x', x, 0n, P) - if (!inRange(n, min, max)) - throw new Error('expected valid ' + title + ': ' + min + ' <= n < ' + max + ', got ' + n); -} - -// Bit operations - -/** - * Calculates amount of bits in a bigint. - * Same as `n.toString(2).length` - * TODO: merge with nLength in modular - */ -export function bitLen(n: bigint): number { - let len; - for (len = 0; n > _0n; n >>= _1n, len += 1); - return len; -} - -/** - * Gets single bit at position. - * NOTE: first bit position is 0 (same as arrays) - * Same as `!!+Array.from(n.toString(2)).reverse()[pos]` - */ -export function bitGet(n: bigint, pos: number): bigint { - return (n >> BigInt(pos)) & _1n; -} - -/** - * Sets single bit at position. - */ -export function bitSet(n: bigint, pos: number, value: boolean): bigint { - return n | ((value ? _1n : _0n) << BigInt(pos)); -} - -/** - * Calculate mask for N bits. Not using ** operator with bigints because of old engines. - * Same as BigInt(`0b${Array(i).fill('1').join('')}`) - */ -export const bitMask = (n: number): bigint => (_1n << BigInt(n)) - _1n; - -// DRBG - -type Pred = (v: Uint8Array) => T | undefined; -/** - * Minimal HMAC-DRBG from NIST 800-90 for RFC6979 sigs. - * @returns function that will call DRBG until 2nd arg returns something meaningful - * @example - * const drbg = createHmacDRBG(32, 32, hmac); - * drbg(seed, bytesToKey); // bytesToKey must return Key or undefined - */ -export function createHmacDrbg( - hashLen: number, - qByteLen: number, - hmacFn: (key: Uint8Array, message: Uint8Array) => Uint8Array -): (seed: Uint8Array, predicate: Pred) => T { - anumber(hashLen, 'hashLen'); - anumber(qByteLen, 'qByteLen'); - if (typeof hmacFn !== 'function') throw new Error('hmacFn must be a function'); - const u8n = (len: number): Uint8Array => new Uint8Array(len); // creates Uint8Array - const NULL = Uint8Array.of(); - const byte0 = Uint8Array.of(0x00); - const byte1 = Uint8Array.of(0x01); - const _maxDrbgIters = 1000; - - // Step B, Step C: set hashLen to 8*ceil(hlen/8) - let v = u8n(hashLen); // Minimal non-full-spec HMAC-DRBG from NIST 800-90 for RFC6979 sigs. - let k = u8n(hashLen); // Steps B and C of RFC6979 3.2: set hashLen, in our case always same - let i = 0; // Iterations counter, will throw when over 1000 - const reset = () => { - v.fill(1); - k.fill(0); - i = 0; - }; - const h = (...msgs: Uint8Array[]) => hmacFn(k, concatBytes_(v, ...msgs)); // hmac(k)(v, ...values) - const reseed = (seed: Uint8Array = NULL) => { - // HMAC-DRBG reseed() function. Steps D-G - k = h(byte0, seed); // k = hmac(k || v || 0x00 || seed) - v = h(); // v = hmac(k || v) - if (seed.length === 0) return; - k = h(byte1, seed); // k = hmac(k || v || 0x01 || seed) - v = h(); // v = hmac(k || v) - }; - const gen = () => { - // HMAC-DRBG generate() function - if (i++ >= _maxDrbgIters) throw new Error('drbg: tried max amount of iterations'); - let len = 0; - const out: Uint8Array[] = []; - while (len < qByteLen) { - v = h(); - const sl = v.slice(); - out.push(sl); - len += v.length; - } - return concatBytes_(...out); - }; - const genUntil = (seed: Uint8Array, pred: Pred): T => { - reset(); - reseed(seed); // Steps D-G - let res: T | undefined = undefined; // Step H: grind until k is in [1..n-1] - while (!(res = pred(gen()))) reseed(); - reset(); - return res; - }; - return genUntil; -} - -export function validateObject( - object: Record, - fields: Record = {}, - optFields: Record = {} -): void { - if (!object || typeof object !== 'object') throw new Error('expected valid options object'); - type Item = keyof typeof object; - function checkField(fieldName: Item, expectedType: string, isOpt: boolean) { - const val = object[fieldName]; - if (isOpt && val === undefined) return; - const current = typeof val; - if (current !== expectedType || val === null) - throw new Error(`param "${fieldName}" is invalid: expected ${expectedType}, got ${current}`); - } - const iter = (f: typeof fields, isOpt: boolean) => - Object.entries(f).forEach(([k, v]) => checkField(k, v, isOpt)); - iter(fields, false); - iter(optFields, true); -} - -/** - * throws not implemented error - */ -export const notImplemented = (): never => { - throw new Error('not implemented'); -}; - -/** - * Memoizes (caches) computation result. - * Uses WeakMap: the value is going auto-cleaned by GC after last reference is removed. - */ -export function memoized( - fn: (arg: T, ...args: O) => R -): (arg: T, ...args: O) => R { - const map = new WeakMap(); - return (arg: T, ...args: O): R => { - const val = map.get(arg); - if (val !== undefined) return val; - const computed = fn(arg, ...args); - map.set(arg, computed); - return computed; - }; -} - -export interface CryptoKeys { - lengths: { seed?: number; public?: number; secret?: number }; - keygen: (seed?: Uint8Array) => { secretKey: Uint8Array; publicKey: Uint8Array }; - getPublicKey: (secretKey: Uint8Array) => Uint8Array; -} - -/** Generic interface for signatures. Has keygen, sign and verify. */ -export interface Signer extends CryptoKeys { - // Interfaces are fun. We cannot just add new fields without copying old ones. - lengths: { - seed?: number; - public?: number; - secret?: number; - signRand?: number; - signature?: number; - }; - sign: (msg: Uint8Array, secretKey: Uint8Array) => Uint8Array; - verify: (sig: Uint8Array, msg: Uint8Array, publicKey: Uint8Array) => boolean; -} diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/webcrypto.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/webcrypto.ts deleted file mode 100644 index f717d7f8..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/src/webcrypto.ts +++ /dev/null @@ -1,403 +0,0 @@ -/** - * Friendly wrapper over elliptic curves from built-in WebCrypto. Experimental: API may change. - -# WebCrypto issues - -## No way to get public keys - -- Export of raw secret key is prohibited by spec: - - https://w3c.github.io/webcrypto/#ecdsa-operations-export-key - -> "If format is "raw":" -> "If the [[type]] internal slot of key is not "public", - then throw an InvalidAccessError." -- Import of raw secret keys is prohibited by spec: - - https://w3c.github.io/webcrypto/#ecdsa-operations-import-key - -> "If format is "raw":" -> "If usages contains a value which is not "verify" - then throw a SyntaxError." -- SPKI (Simple public-key infrastructure) is public-key-only -- PKCS8 is secret-key-only -- No way to get public key from secret key, but we convert to jwk and then create it manually, since jwk secret key is priv+pub. -- Noble supports generating keys for both sign, verify & getSharedSecret, - but JWK key includes usage, which forces us to patch it (non-JWK is ok) -- We have import/export for 'raw', but it doesn't work in Firefox / Safari - -## Point encoding - -- Raw export of public points returns uncompressed points, - but this is implementation specific and not much we can do there. -- `getSharedSecret` differs for p256, p384, p521: - Noble returns 33-byte output (y-parity + x coordinate), - while in WebCrypto returns 32-byte output (x coordinate) -- `getSharedSecret` identical for X25519, X448 - -## Availability - -Node.js additionally supports ed448. -There seems no reasonable way to check for availability, other than actually calling methods. - - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ - -/** Raw type */ -const TYPE_RAW = 'raw'; -const TYPE_JWK = 'jwk'; -const TYPE_SPKI = 'spki'; -const TYPE_PKCS = 'pkcs8'; -export type WebCryptoFormat = - | typeof TYPE_RAW - | typeof TYPE_JWK - | typeof TYPE_SPKI - | typeof TYPE_PKCS; -/** WebCrypto keys can be in raw, jwk, pkcs8/spki formats. Raw is internal and fragile. */ -export type WebCryptoOpts = { - formatSec?: WebCryptoFormat; - formatPub?: WebCryptoFormat; -}; -// default formats -const dfsec = TYPE_PKCS; -const dfpub = TYPE_SPKI; - -function getSubtle(): any { - const s: any = globalThis?.crypto?.subtle; - if (typeof s === 'object' && s != null) return s; - throw new Error('crypto.subtle must be defined'); -} - -function createKeygenA(randomSecretKey: any, getPublicKey: any) { - return async function keygenA(_seed?: Uint8Array) { - const secretKey = await randomSecretKey(); - return { secretKey, publicKey: await getPublicKey(secretKey) }; - }; -} - -function hexToBytesUns(hex: string): Uint8Array { - return Uint8Array.from(hex.match(/(\w\w)/g)!, (b) => Number.parseInt(b, 16)); -} - -// Trying to do generics here creates hell on conversion and usage -type JsonWebKey = { - crv?: string; - d?: string; - kty?: string; - x?: string; - y?: string; - [key: string]: unknown; -}; -type Key = JsonWebKey | Uint8Array; -type CryptoKey = Awaited>; -type KeyUsage = 'deriveBits' | 'deriveKey' | 'sign' | 'verify'; -type Algo = string | { name: string; namedCurve: string }; -type SigAlgo = string | { name: string; hash?: { name: string } }; - -type KeyUtils = { - import(key: Key, format?: WebCryptoFormat): Promise; - export(key: CryptoKey, format?: WebCryptoFormat): Promise; - convert(key: Key, inFormat?: WebCryptoFormat, outFormat?: WebCryptoFormat): Promise; -}; - -function assertType(type: 'private' | 'public', key: any) { - if (key.type !== type) throw new Error(`invalid key type, expected ${type}`); -} - -function createKeyUtils(algo: Algo, derive: boolean, keyLen: number, pkcs8header: string) { - const secUsage: KeyUsage[] = derive ? ['deriveBits'] : ['sign']; - const pubUsage: KeyUsage[] = derive ? [] : ['verify']; - // Return Uint8Array instead of ArrayBuffer - const arrBufToU8 = (res: Key, format: WebCryptoFormat) => - format === TYPE_JWK ? res : new Uint8Array(res as unknown as ArrayBuffer); - const pub: KeyUtils = { - async import(key: Key, format: WebCryptoFormat): Promise { - const keyi: CryptoKey = await getSubtle().importKey(format, key, algo, true, pubUsage); - assertType('public', keyi); - return keyi; - }, - async export(key: CryptoKey, format: WebCryptoFormat): Promise { - assertType('public', key); - const keyi = await getSubtle().exportKey(format, key); - return arrBufToU8(keyi, format); - }, - async convert(key: Key, inFormat: WebCryptoFormat, outFormat: WebCryptoFormat): Promise { - return pub.export(await pub.import(key, inFormat), outFormat); - }, - }; - const priv: KeyUtils = { - async import(key: Key, format: WebCryptoFormat): Promise { - const crypto = getSubtle(); - let keyi: CryptoKey; - if (format === TYPE_RAW) { - // Chrome, node, bun, deno: works - // Safari, Firefox: Data provided to an operation does not meet requirements - // This is the best one can do. JWK can't be used: it contains public key component inside. - const k = key as Uint8Array; - const head = hexToBytesUns(pkcs8header); - const all = new Uint8Array(head.length + k.length); - all.set(head, 0); - all.set(k, head.length); - - keyi = await crypto.importKey(TYPE_PKCS, all, algo, true, secUsage); - } else { - // Fix import of ECDSA keys into ECDH, other formats are ok - if (derive && format === TYPE_JWK) key = { ...key, key_ops: secUsage }; - keyi = await crypto.importKey(format, key, algo, true, secUsage); - } - assertType('private', keyi); - return keyi; - }, - async export(key: CryptoKey, format: WebCryptoFormat): Promise { - const crypto = getSubtle(); - assertType('private', key); - if (format === TYPE_RAW) { - // scure-base base64urlnopad could have been used, but we can't add more deps. - // pkcs8 would be even more fragile - const jwk = await crypto.exportKey(TYPE_JWK, key); - const base64 = jwk.d.replace(/-/g, '+').replace(/_/g, '/'); // base64url - const pad = base64.length % 4 ? '='.repeat(4 - (base64.length % 4)) : ''; // add padding - const binary = atob(base64 + pad); - // This is not ASCII, and not text: this is only semi-safe with atob output - const raw = Uint8Array.from(binary, (c) => c.charCodeAt(0)); - // Pad key to key len because Bun strips leading zero for P-521 only - const res = new Uint8Array(keyLen); - res.set(raw, keyLen - raw.length); - return res as Key; - } - const keyi = await crypto.exportKey(format, key); - return arrBufToU8(keyi, format); - }, - async convert(key: Key, inFormat: WebCryptoFormat, outFormat: WebCryptoFormat): Promise { - return priv.export(await priv.import(key, inFormat), outFormat); - }, - }; - async function getPublicKey(secretKey: Key, opts: WebCryptoOpts = {}): Promise { - const fsec = opts.formatSec ?? dfsec; - const fpub = opts.formatPub ?? dfpub; - // Export to jwk, remove private scalar and then convert to format - const jwk = ( - fsec === TYPE_JWK ? { ...secretKey } : await priv.convert(secretKey, fsec, TYPE_JWK) - ) as JsonWebKey; - delete jwk.d; - jwk.key_ops = pubUsage; - if (fpub === TYPE_JWK) return jwk; - return pub.convert(jwk, TYPE_JWK, fpub); - } - async function randomSecretKey(format: WebCryptoFormat = dfsec): Promise { - const keyPair = await getSubtle().generateKey(algo, true, secUsage); - return priv.export(keyPair.privateKey, format); - } - // Key generation could be slow, so we cache result once. - let supported: boolean | undefined; - return { - pub: pub as KeyUtils, - priv: priv as KeyUtils, - async isSupported(): Promise { - if (supported !== undefined) return supported; - try { - const crypto = getSubtle(); - const key = await crypto.generateKey(algo, true, secUsage); - // Deno is broken and generates key for unsupported curves, but then fails on export - await priv.export(key.privateKey, TYPE_JWK); - // Bun fails on derive for x25519, but not x448 - if (derive) { - await crypto.deriveBits( - { name: typeof algo === 'string' ? algo : algo.name, public: key.publicKey }, - key.privateKey, - 8 - ); - } - return (supported = true); - } catch (e) { - return (supported = false); - } - }, - getPublicKey, - keygen: createKeygenA(randomSecretKey, getPublicKey), - utils: { - randomSecretKey, - convertPublicKey: pub.convert as KeyUtils['convert'], - convertSecretKey: priv.convert as KeyUtils['convert'], - }, - }; -} - -function createSigner(keys: ReturnType, algo: SigAlgo): WebCryptoSigner { - return { - async sign(msgHash: Uint8Array, secretKey: Key, opts: WebCryptoOpts = {}): Promise { - const key = await keys.priv.import(secretKey, opts.formatSec ?? dfsec); - const sig = await getSubtle().sign(algo, key, msgHash); - return new Uint8Array(sig); - }, - async verify( - signature: Uint8Array, - msgHash: Uint8Array, - publicKey: Key, - opts: WebCryptoOpts = {} - ): Promise { - const key = await keys.pub.import(publicKey, opts.formatPub ?? dfpub); - return await getSubtle().verify(algo, key, signature, msgHash); - }, - }; -} - -function createECDH( - keys: ReturnType, - algo: Algo, - keyLen: number -): WebCryptoECDH { - return { - async getSharedSecret( - secretKeyA: Uint8Array, - publicKeyB: Uint8Array, - opts: WebCryptoOpts = {} - ): Promise { - // if (_isCompressed !== true) throw new Error('WebCrypto only supports compressed keys'); - const secKey = await keys.priv.import(secretKeyA, opts.formatSec || dfsec); - const pubKey = await keys.pub.import(publicKeyB, opts.formatPub || dfpub); - const shared = await getSubtle().deriveBits( - { name: typeof algo === 'string' ? algo : algo.name, public: pubKey }, - secKey, - 8 * keyLen - ); - return new Uint8Array(shared); - }, - }; -} - -type WebCryptoBaseCurve = { - name: string; - isSupported(): Promise; - keygen(): Promise<{ secretKey: Uint8Array; publicKey: Uint8Array }>; - getPublicKey(secretKey: Key, opts?: WebCryptoOpts): Promise; - utils: { - randomSecretKey: (format?: WebCryptoFormat) => Promise; - convertSecretKey: ( - key: Key, - inFormat?: WebCryptoFormat, - outFormat?: WebCryptoFormat - ) => Promise; - convertPublicKey: ( - key: Key, - inFormat?: WebCryptoFormat, - outFormat?: WebCryptoFormat - ) => Promise; - }; -}; - -// Specific per-curve methods - no reason to export them; we can't "add" a new curve -export type WebCryptoSigner = { - sign(message: Uint8Array, secretKey: Key, opts?: WebCryptoOpts): Promise; - verify( - signature: Uint8Array, - message: Uint8Array, - publicKey: Key, - opts?: WebCryptoOpts - ): Promise; -}; -export type WebCryptoECDH = { - getSharedSecret(secA: Uint8Array, pubB: Uint8Array, opts?: WebCryptoOpts): Promise; -}; -export type WebCryptoECDSA = WebCryptoBaseCurve & WebCryptoSigner & WebCryptoECDH; -export type WebCryptoEdDSA = WebCryptoBaseCurve & WebCryptoSigner; -export type WebCryptoMontgomery = WebCryptoBaseCurve & WebCryptoECDH; - -function wrapECDSA( - curve: 'P-256' | 'P-384' | 'P-521', - hash: string, - keyLen: number, - pkcs8header: string -): WebCryptoECDSA { - const ECDH_ALGO = { name: 'ECDH', namedCurve: curve }; - const keys = createKeyUtils({ name: 'ECDSA', namedCurve: curve }, false, keyLen, pkcs8header); - const keysEcdh = createKeyUtils(ECDH_ALGO, true, keyLen, pkcs8header); - return Object.freeze({ - name: curve, - isSupported: keys.isSupported, - getPublicKey: keys.getPublicKey, - keygen: createKeygenA(keys.utils.randomSecretKey, keys.getPublicKey), - ...createSigner(keys, { name: 'ECDSA', hash: { name: hash } }), - ...createECDH(keysEcdh, ECDH_ALGO, keyLen), - utils: keys.utils, - }); -} - -function wrapEdDSA( - curve: 'Ed25519' | 'Ed448', - keyLen: number, - pkcs8header: string -): WebCryptoEdDSA { - const keys = createKeyUtils(curve, false, keyLen, pkcs8header); - return Object.freeze({ - name: curve, - isSupported: keys.isSupported, - getPublicKey: keys.getPublicKey, - keygen: createKeygenA(keys.utils.randomSecretKey, keys.getPublicKey), - ...createSigner(keys, { name: curve }), - utils: keys.utils, - }); -} - -function wrapMontgomery( - curve: 'X25519' | 'X448', - keyLen: number, - pkcs8header: string -): WebCryptoMontgomery { - const keys = createKeyUtils(curve, true, keyLen, pkcs8header); - return Object.freeze({ - name: curve, - isSupported: keys.isSupported, - getPublicKey: keys.getPublicKey, - keygen: createKeygenA(keys.utils.randomSecretKey, keys.getPublicKey), - ...createECDH(keys, curve, keyLen), - utils: keys.utils, - }); -} - -/** Friendly wrapper over built-in WebCrypto NIST P-256 (secp256r1). */ -export const p256: WebCryptoECDSA = /* @__PURE__ */ wrapECDSA( - 'P-256', - 'SHA-256', - 32, - '3041020100301306072a8648ce3d020106082a8648ce3d030107042730250201010420' -); - -/** Friendly wrapper over built-in WebCrypto NIST P-384 (secp384r1). */ -export const p384: WebCryptoECDSA = /* @__PURE__ */ wrapECDSA( - 'P-384', - 'SHA-384', - 48, - '304e020100301006072a8648ce3d020106052b81040022043730350201010430' -); - -/** Friendly wrapper over built-in WebCrypto NIST P-521 (secp521r1). */ -export const p521: WebCryptoECDSA = /* @__PURE__ */ wrapECDSA( - 'P-521', - 'SHA-512', - 66, - '3060020100301006072a8648ce3d020106052b81040023044930470201010442' -); - -/** Friendly wrapper over built-in WebCrypto ed25519. */ -export const ed25519: WebCryptoEdDSA = /* @__PURE__ */ wrapEdDSA( - 'Ed25519', - 32, - '302e020100300506032b657004220420' -); - -/** Friendly wrapper over built-in WebCrypto ed448. */ -export const ed448: WebCryptoEdDSA = /* @__PURE__ */ wrapEdDSA( - 'Ed448', - 57, - '3047020100300506032b6571043b0439' -); - -/** Friendly wrapper over built-in WebCrypto x25519 (ECDH over Curve25519). */ -export const x25519: WebCryptoMontgomery = /* @__PURE__ */ wrapMontgomery( - 'X25519', - 32, - '302e020100300506032b656e04220420' -); - -/** Friendly wrapper over built-in WebCrypto x448 (ECDH over Curve448). */ -export const x448: WebCryptoMontgomery = /* @__PURE__ */ wrapMontgomery( - 'X448', - 56, - '3046020100300506032b656f043a0438' -); diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/utils.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/utils.d.ts deleted file mode 100644 index 1124e806..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/utils.d.ts +++ /dev/null @@ -1,103 +0,0 @@ -export { abytes, anumber, bytesToHex, concatBytes, hexToBytes, isBytes, randomBytes, } from '@noble/hashes/utils.js'; -export type CHash = { - (message: Uint8Array): Uint8Array; - blockLen: number; - outputLen: number; - create(opts?: { - dkLen?: number; - }): any; -}; -export type FHash = (message: Uint8Array) => Uint8Array; -export declare function abool(value: boolean, title?: string): boolean; -export declare function asafenumber(value: number, title?: string): void; -export declare function numberToHexUnpadded(num: number | bigint): string; -export declare function hexToNumber(hex: string): bigint; -export declare function bytesToNumberBE(bytes: Uint8Array): bigint; -export declare function bytesToNumberLE(bytes: Uint8Array): bigint; -export declare function numberToBytesBE(n: number | bigint, len: number): Uint8Array; -export declare function numberToBytesLE(n: number | bigint, len: number): Uint8Array; -export declare function numberToVarBytesBE(n: number | bigint): Uint8Array; -export declare function equalBytes(a: Uint8Array, b: Uint8Array): boolean; -/** - * Copies Uint8Array. We can't use u8a.slice(), because u8a can be Buffer, - * and Buffer#slice creates mutable copy. Never use Buffers! - */ -export declare function copyBytes(bytes: Uint8Array): Uint8Array; -/** - * Decodes 7-bit ASCII string to Uint8Array, throws on non-ascii symbols - * Should be safe to use for things expected to be ASCII. - * Returns exact same result as `TextEncoder` for ASCII or throws. - */ -export declare function asciiToBytes(ascii: string): Uint8Array; -export declare function inRange(n: bigint, min: bigint, max: bigint): boolean; -/** - * Asserts min <= n < max. NOTE: It's < max and not <= max. - * @example - * aInRange('x', x, 1n, 256n); // would assume x is in (1n..255n) - */ -export declare function aInRange(title: string, n: bigint, min: bigint, max: bigint): void; -/** - * Calculates amount of bits in a bigint. - * Same as `n.toString(2).length` - * TODO: merge with nLength in modular - */ -export declare function bitLen(n: bigint): number; -/** - * Gets single bit at position. - * NOTE: first bit position is 0 (same as arrays) - * Same as `!!+Array.from(n.toString(2)).reverse()[pos]` - */ -export declare function bitGet(n: bigint, pos: number): bigint; -/** - * Sets single bit at position. - */ -export declare function bitSet(n: bigint, pos: number, value: boolean): bigint; -/** - * Calculate mask for N bits. Not using ** operator with bigints because of old engines. - * Same as BigInt(`0b${Array(i).fill('1').join('')}`) - */ -export declare const bitMask: (n: number) => bigint; -type Pred = (v: Uint8Array) => T | undefined; -/** - * Minimal HMAC-DRBG from NIST 800-90 for RFC6979 sigs. - * @returns function that will call DRBG until 2nd arg returns something meaningful - * @example - * const drbg = createHmacDRBG(32, 32, hmac); - * drbg(seed, bytesToKey); // bytesToKey must return Key or undefined - */ -export declare function createHmacDrbg(hashLen: number, qByteLen: number, hmacFn: (key: Uint8Array, message: Uint8Array) => Uint8Array): (seed: Uint8Array, predicate: Pred) => T; -export declare function validateObject(object: Record, fields?: Record, optFields?: Record): void; -/** - * throws not implemented error - */ -export declare const notImplemented: () => never; -/** - * Memoizes (caches) computation result. - * Uses WeakMap: the value is going auto-cleaned by GC after last reference is removed. - */ -export declare function memoized(fn: (arg: T, ...args: O) => R): (arg: T, ...args: O) => R; -export interface CryptoKeys { - lengths: { - seed?: number; - public?: number; - secret?: number; - }; - keygen: (seed?: Uint8Array) => { - secretKey: Uint8Array; - publicKey: Uint8Array; - }; - getPublicKey: (secretKey: Uint8Array) => Uint8Array; -} -/** Generic interface for signatures. Has keygen, sign and verify. */ -export interface Signer extends CryptoKeys { - lengths: { - seed?: number; - public?: number; - secret?: number; - signRand?: number; - signature?: number; - }; - sign: (msg: Uint8Array, secretKey: Uint8Array) => Uint8Array; - verify: (sig: Uint8Array, msg: Uint8Array, publicKey: Uint8Array) => boolean; -} -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/utils.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/utils.d.ts.map deleted file mode 100644 index 5464f93d..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["src/utils.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,MAAM,EACN,OAAO,EACP,UAAU,EACV,WAAW,EACX,UAAU,EACV,OAAO,EACP,WAAW,GACZ,MAAM,wBAAwB,CAAC;AAIhC,MAAM,MAAM,KAAK,GAAG;IAClB,CAAC,OAAO,EAAE,UAAU,GAAG,UAAU,CAAC;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,GAAG,CAAC;CACxC,CAAC;AACF,MAAM,MAAM,KAAK,G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AE,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,CAS3B;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7D,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,UAAU,KAAK;QAAE,SAAS,EAAE,UAAU,CAAC;QAAC,SAAS,EAAE,UAAU,CAAA;KAAE,CAAC;IAChF,YAAY,EAAE,CAAC,SAAS,EAAE,UAAU,KAAK,UAAU,CAAC;CACrD;AAED,qEAAqE;AACrE,MAAM,WAAW,MAAO,SAAQ,UAAU;IAExC,OAAO,EAAE;QACP,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,IAAI,EAAE,CAAC,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,KAAK,UAAU,CAAC;IAC7D,MAAM,EAAE,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,KAAK,OAAO,CAAC;CAC9E"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/utils.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/utils.js deleted file mode 100644 index 24a07049..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/utils.js +++ /dev/null @@ -1,241 +0,0 @@ -/** - * Hex, bytes and number utilities. - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { abytes as abytes_, anumber, bytesToHex as bytesToHex_, concatBytes as concatBytes_, hexToBytes as hexToBytes_, } from '@noble/hashes/utils.js'; -export { abytes, anumber, bytesToHex, concatBytes, hexToBytes, isBytes, randomBytes, } from '@noble/hashes/utils.js'; -const _0n = /* @__PURE__ */ BigInt(0); -const _1n = /* @__PURE__ */ BigInt(1); -export function abool(value, title = '') { - if (typeof value !== 'boolean') { - const prefix = title && `"${title}" `; - throw new Error(prefix + 'expected boolean, got type=' + typeof value); - } - return value; -} -// Used in weierstrass, der -function abignumber(n) { - if (typeof n === 'bigint') { - if (!isPosBig(n)) - throw new Error('positive bigint expected, got ' + n); - } - else - anumber(n); - return n; -} -export function asafenumber(value, title = '') { - if (!Number.isSafeInteger(value)) { - const prefix = title && `"${title}" `; - throw new Error(prefix + 'expected safe integer, got type=' + typeof value); - } -} -export function numberToHexUnpadded(num) { - const hex = abignumber(num).toString(16); - return hex.length & 1 ? '0' + hex : hex; -} -export function hexToNumber(hex) { - if (typeof hex !== 'string') - throw new Error('hex string expected, got ' + typeof hex); - return hex === '' ? _0n : BigInt('0x' + hex); // Big Endian -} -// BE: Big Endian, LE: Little Endian -export function bytesToNumberBE(bytes) { - return hexToNumber(bytesToHex_(bytes)); -} -export function bytesToNumberLE(bytes) { - return hexToNumber(bytesToHex_(copyBytes(abytes_(bytes)).reverse())); -} -export function numberToBytesBE(n, len) { - anumber(len); - n = abignumber(n); - const res = hexToBytes_(n.toString(16).padStart(len * 2, '0')); - if (res.length !== len) - throw new Error('number too large'); - return res; -} -export function numberToBytesLE(n, len) { - return numberToBytesBE(n, len).reverse(); -} -// Unpadded, rarely used -export function numberToVarBytesBE(n) { - return hexToBytes_(numberToHexUnpadded(abignumber(n))); -} -// Compares 2 u8a-s in kinda constant time -export function equalBytes(a, b) { - if (a.length !== b.length) - return false; - let diff = 0; - for (let i = 0; i < a.length; i++) - diff |= a[i] ^ b[i]; - return diff === 0; -} -/** - * Copies Uint8Array. We can't use u8a.slice(), because u8a can be Buffer, - * and Buffer#slice creates mutable copy. Never use Buffers! - */ -export function copyBytes(bytes) { - return Uint8Array.from(bytes); -} -/** - * Decodes 7-bit ASCII string to Uint8Array, throws on non-ascii symbols - * Should be safe to use for things expected to be ASCII. - * Returns exact same result as `TextEncoder` for ASCII or throws. - */ -export function asciiToBytes(ascii) { - return Uint8Array.from(ascii, (c, i) => { - const charCode = c.charCodeAt(0); - if (c.length !== 1 || charCode > 127) { - throw new Error(`string contains non-ASCII character "${ascii[i]}" with code ${charCode} at position ${i}`); - } - return charCode; - }); -} -// Is positive bigint -const isPosBig = (n) => typeof n === 'bigint' && _0n <= n; -export function inRange(n, min, max) { - return isPosBig(n) && isPosBig(min) && isPosBig(max) && min <= n && n < max; -} -/** - * Asserts min <= n < max. NOTE: It's < max and not <= max. - * @example - * aInRange('x', x, 1n, 256n); // would assume x is in (1n..255n) - */ -export function aInRange(title, n, min, max) { - // Why min <= n < max and not a (min < n < max) OR b (min <= n <= max)? - // consider P=256n, min=0n, max=P - // - a for min=0 would require -1: `inRange('x', x, -1n, P)` - // - b would commonly require subtraction: `inRange('x', x, 0n, P - 1n)` - // - our way is the cleanest: `inRange('x', x, 0n, P) - if (!inRange(n, min, max)) - throw new Error('expected valid ' + title + ': ' + min + ' <= n < ' + max + ', got ' + n); -} -// Bit operations -/** - * Calculates amount of bits in a bigint. - * Same as `n.toString(2).length` - * TODO: merge with nLength in modular - */ -export function bitLen(n) { - let len; - for (len = 0; n > _0n; n >>= _1n, len += 1) - ; - return len; -} -/** - * Gets single bit at position. - * NOTE: first bit position is 0 (same as arrays) - * Same as `!!+Array.from(n.toString(2)).reverse()[pos]` - */ -export function bitGet(n, pos) { - return (n >> BigInt(pos)) & _1n; -} -/** - * Sets single bit at position. - */ -export function bitSet(n, pos, value) { - return n | ((value ? _1n : _0n) << BigInt(pos)); -} -/** - * Calculate mask for N bits. Not using ** operator with bigints because of old engines. - * Same as BigInt(`0b${Array(i).fill('1').join('')}`) - */ -export const bitMask = (n) => (_1n << BigInt(n)) - _1n; -/** - * Minimal HMAC-DRBG from NIST 800-90 for RFC6979 sigs. - * @returns function that will call DRBG until 2nd arg returns something meaningful - * @example - * const drbg = createHmacDRBG(32, 32, hmac); - * drbg(seed, bytesToKey); // bytesToKey must return Key or undefined - */ -export function createHmacDrbg(hashLen, qByteLen, hmacFn) { - anumber(hashLen, 'hashLen'); - anumber(qByteLen, 'qByteLen'); - if (typeof hmacFn !== 'function') - throw new Error('hmacFn must be a function'); - const u8n = (len) => new Uint8Array(len); // creates Uint8Array - const NULL = Uint8Array.of(); - const byte0 = Uint8Array.of(0x00); - const byte1 = Uint8Array.of(0x01); - const _maxDrbgIters = 1000; - // Step B, Step C: set hashLen to 8*ceil(hlen/8) - let v = u8n(hashLen); // Minimal non-full-spec HMAC-DRBG from NIST 800-90 for RFC6979 sigs. - let k = u8n(hashLen); // Steps B and C of RFC6979 3.2: set hashLen, in our case always same - let i = 0; // Iterations counter, will throw when over 1000 - const reset = () => { - v.fill(1); - k.fill(0); - i = 0; - }; - const h = (...msgs) => hmacFn(k, concatBytes_(v, ...msgs)); // hmac(k)(v, ...values) - const reseed = (seed = NULL) => { - // HMAC-DRBG reseed() function. Steps D-G - k = h(byte0, seed); // k = hmac(k || v || 0x00 || seed) - v = h(); // v = hmac(k || v) - if (seed.length === 0) - return; - k = h(byte1, seed); // k = hmac(k || v || 0x01 || seed) - v = h(); // v = hmac(k || v) - }; - const gen = () => { - // HMAC-DRBG generate() function - if (i++ >= _maxDrbgIters) - throw new Error('drbg: tried max amount of iterations'); - let len = 0; - const out = []; - while (len < qByteLen) { - v = h(); - const sl = v.slice(); - out.push(sl); - len += v.length; - } - return concatBytes_(...out); - }; - const genUntil = (seed, pred) => { - reset(); - reseed(seed); // Steps D-G - let res = undefined; // Step H: grind until k is in [1..n-1] - while (!(res = pred(gen()))) - reseed(); - reset(); - return res; - }; - return genUntil; -} -export function validateObject(object, fields = {}, optFields = {}) { - if (!object || typeof object !== 'object') - throw new Error('expected valid options object'); - function checkField(fieldName, expectedType, isOpt) { - const val = object[fieldName]; - if (isOpt && val === undefined) - return; - const current = typeof val; - if (current !== expectedType || val === null) - throw new Error(`param "${fieldName}" is invalid: expected ${expectedType}, got ${current}`); - } - const iter = (f, isOpt) => Object.entries(f).forEach(([k, v]) => checkField(k, v, isOpt)); - iter(fields, false); - iter(optFields, true); -} -/** - * throws not implemented error - */ -export const notImplemented = () => { - throw new Error('not implemented'); -}; -/** - * Memoizes (caches) computation result. - * Uses WeakMap: the value is going auto-cleaned by GC after last reference is removed. - */ -export function memoized(fn) { - const map = new WeakMap(); - return (arg, ...args) => { - const val = map.get(arg); - if (val !== undefined) - return val; - const computed = fn(arg, ...args); - map.set(arg, computed); - return computed; - }; -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/utils.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/utils.js.map deleted file mode 100644 index f24eddf1..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,sEAAsE;AACtE,OAAO,EACL,MAAM,IAAI,OAAO,EACjB,OAAO,EACP,UAAU,IAAI,WAAW,EACzB,WAAW,IAAI,YAAY,EAC3B,UAAU,IAAI,WAAW,GAC1B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,MAAM,EACN,OAAO,EACP,UAAU,EACV,WAAW,EACX,UAAU,EACV,OAAO,EACP,WAAW,GACZ,MAAM,wBAAwB,CAAC;AAChC,MAAM,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACtC,MAAM,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAStC,MAAM,UAAU,KAAK,CAAC,KAAc,EAAE,QAAgB,EAAE;IACtD,IAAI,OAAO,KAAK,KAAK,SAAS,E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AAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/webcrypto.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/webcrypto.d.ts deleted file mode 100644 index 66aaf9ea..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/webcrypto.d.ts +++ /dev/null @@ -1,99 +0,0 @@ -/** - * Friendly wrapper over elliptic curves from built-in WebCrypto. Experimental: API may change. - -# WebCrypto issues - -## No way to get public keys - -- Export of raw secret key is prohibited by spec: - - https://w3c.github.io/webcrypto/#ecdsa-operations-export-key - -> "If format is "raw":" -> "If the [[type]] internal slot of key is not "public", - then throw an InvalidAccessError." -- Import of raw secret keys is prohibited by spec: - - https://w3c.github.io/webcrypto/#ecdsa-operations-import-key - -> "If format is "raw":" -> "If usages contains a value which is not "verify" - then throw a SyntaxError." -- SPKI (Simple public-key infrastructure) is public-key-only -- PKCS8 is secret-key-only -- No way to get public key from secret key, but we convert to jwk and then create it manually, since jwk secret key is priv+pub. -- Noble supports generating keys for both sign, verify & getSharedSecret, - but JWK key includes usage, which forces us to patch it (non-JWK is ok) -- We have import/export for 'raw', but it doesn't work in Firefox / Safari - -## Point encoding - -- Raw export of public points returns uncompressed points, - but this is implementation specific and not much we can do there. -- `getSharedSecret` differs for p256, p384, p521: - Noble returns 33-byte output (y-parity + x coordinate), - while in WebCrypto returns 32-byte output (x coordinate) -- `getSharedSecret` identical for X25519, X448 - -## Availability - -Node.js additionally supports ed448. -There seems no reasonable way to check for availability, other than actually calling methods. - - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -/** Raw type */ -declare const TYPE_RAW = "raw"; -declare const TYPE_JWK = "jwk"; -declare const TYPE_SPKI = "spki"; -declare const TYPE_PKCS = "pkcs8"; -export type WebCryptoFormat = typeof TYPE_RAW | typeof TYPE_JWK | typeof TYPE_SPKI | typeof TYPE_PKCS; -/** WebCrypto keys can be in raw, jwk, pkcs8/spki formats. Raw is internal and fragile. */ -export type WebCryptoOpts = { - formatSec?: WebCryptoFormat; - formatPub?: WebCryptoFormat; -}; -type JsonWebKey = { - crv?: string; - d?: string; - kty?: string; - x?: string; - y?: string; - [key: string]: unknown; -}; -type Key = JsonWebKey | Uint8Array; -type WebCryptoBaseCurve = { - name: string; - isSupported(): Promise; - keygen(): Promise<{ - secretKey: Uint8Array; - publicKey: Uint8Array; - }>; - getPublicKey(secretKey: Key, opts?: WebCryptoOpts): Promise; - utils: { - randomSecretKey: (format?: WebCryptoFormat) => Promise; - convertSecretKey: (key: Key, inFormat?: WebCryptoFormat, outFormat?: WebCryptoFormat) => Promise; - convertPublicKey: (key: Key, inFormat?: WebCryptoFormat, outFormat?: WebCryptoFormat) => Promise; - }; -}; -export type WebCryptoSigner = { - sign(message: Uint8Array, secretKey: Key, opts?: WebCryptoOpts): Promise; - verify(signature: Uint8Array, message: Uint8Array, publicKey: Key, opts?: WebCryptoOpts): Promise; -}; -export type WebCryptoECDH = { - getSharedSecret(secA: Uint8Array, pubB: Uint8Array, opts?: WebCryptoOpts): Promise; -}; -export type WebCryptoECDSA = WebCryptoBaseCurve & WebCryptoSigner & WebCryptoECDH; -export type WebCryptoEdDSA = WebCryptoBaseCurve & WebCryptoSigner; -export type WebCryptoMontgomery = WebCryptoBaseCurve & WebCryptoECDH; -/** Friendly wrapper over built-in WebCrypto NIST P-256 (secp256r1). */ -export declare const p256: WebCryptoECDSA; -/** Friendly wrapper over built-in WebCrypto NIST P-384 (secp384r1). */ -export declare const p384: WebCryptoECDSA; -/** Friendly wrapper over built-in WebCrypto NIST P-521 (secp521r1). */ -export declare const p521: WebCryptoECDSA; -/** Friendly wrapper over built-in WebCrypto ed25519. */ -export declare const ed25519: WebCryptoEdDSA; -/** Friendly wrapper over built-in WebCrypto ed448. */ -export declare const ed448: WebCryptoEdDSA; -/** Friendly wrapper over built-in WebCrypto x25519 (ECDH over Curve25519). */ -export declare const x25519: WebCryptoMontgomery; -/** Friendly wrapper over built-in WebCrypto x448 (ECDH over Curve448). */ -export declare const x448: WebCryptoMontgomery; -export {}; -//# sourceMappingURL=webcrypto.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/webcrypto.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/webcrypto.d.ts.map deleted file mode 100644 index d6fc6b1e..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/webcrypto.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"webcrypto.d.ts","sourceRoot":"","sources":["src/webcrypto.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,sEAAsE;AAEtE,eAAe;AACf,QAAA,MAAM,QAAQ,QAAQ,CAAC;AACvB,QAAA,MAAM,QAAQ,QAAQ,CAAC;AACvB,QAAA,MAAM,SAAS,SAAS,CAAC;AACzB,QAAA,MAAM,SAAS,UAAU,CAAC;AAC1B,MAAM,MAAM,eAAe,GACvB,OAAO,QAAQ,GACf,OAAO,QAAQ,GACf,OAAO,SAAS,GAChB,OAAO,SAAS,CAAC;AACrB,0FAA0F;AAC1F,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,SAAS,CAAC,EAAE,eAAe,CAAC;CAC7B,CAAC;AAuBF,KAAK,UAAU,GAAG;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AACF,KAAK,GAAG,GAAG,UAAU,GAAG,UAAU,CAAC;AAkLnC,KAAK,kBAAkB,GAA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Ae,GAAG,aAAa,CAAC;AAClF,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAAG,eAAe,CAAC;AAClE,MAAM,MAAM,mBAAmB,GAAG,kBAAkB,GAAG,aAAa,CAAC;AAsDrE,uEAAuE;AACvE,eAAO,MAAM,IAAI,EAAE,cAKlB,CAAC;AAEF,uEAAuE;AACvE,eAAO,MAAM,IAAI,EAAE,cAKlB,CAAC;AAEF,uEAAuE;AACvE,eAAO,MAAM,IAAI,EAAE,cAKlB,CAAC;AAEF,wDAAwD;AACxD,eAAO,MAAM,OAAO,EAAE,cAIrB,CAAC;AAEF,sDAAsD;AACtD,eAAO,MAAM,KAAK,EAAE,cAInB,CAAC;AAEF,8EAA8E;AAC9E,eAAO,MAAM,MAAM,EAAE,mBAIpB,CAAC;AAEF,0EAA0E;AAC1E,eAAO,MAAM,IAAI,EAAE,mBAIlB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/webcrypto.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/webcrypto.js deleted file mode 100644 index c5491851..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/webcrypto.js +++ /dev/null @@ -1,256 +0,0 @@ -/** - * Friendly wrapper over elliptic curves from built-in WebCrypto. Experimental: API may change. - -# WebCrypto issues - -## No way to get public keys - -- Export of raw secret key is prohibited by spec: - - https://w3c.github.io/webcrypto/#ecdsa-operations-export-key - -> "If format is "raw":" -> "If the [[type]] internal slot of key is not "public", - then throw an InvalidAccessError." -- Import of raw secret keys is prohibited by spec: - - https://w3c.github.io/webcrypto/#ecdsa-operations-import-key - -> "If format is "raw":" -> "If usages contains a value which is not "verify" - then throw a SyntaxError." -- SPKI (Simple public-key infrastructure) is public-key-only -- PKCS8 is secret-key-only -- No way to get public key from secret key, but we convert to jwk and then create it manually, since jwk secret key is priv+pub. -- Noble supports generating keys for both sign, verify & getSharedSecret, - but JWK key includes usage, which forces us to patch it (non-JWK is ok) -- We have import/export for 'raw', but it doesn't work in Firefox / Safari - -## Point encoding - -- Raw export of public points returns uncompressed points, - but this is implementation specific and not much we can do there. -- `getSharedSecret` differs for p256, p384, p521: - Noble returns 33-byte output (y-parity + x coordinate), - while in WebCrypto returns 32-byte output (x coordinate) -- `getSharedSecret` identical for X25519, X448 - -## Availability - -Node.js additionally supports ed448. -There seems no reasonable way to check for availability, other than actually calling methods. - - * @module - */ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -/** Raw type */ -const TYPE_RAW = 'raw'; -const TYPE_JWK = 'jwk'; -const TYPE_SPKI = 'spki'; -const TYPE_PKCS = 'pkcs8'; -// default formats -const dfsec = TYPE_PKCS; -const dfpub = TYPE_SPKI; -function getSubtle() { - const s = globalThis?.crypto?.subtle; - if (typeof s === 'object' && s != null) - return s; - throw new Error('crypto.subtle must be defined'); -} -function createKeygenA(randomSecretKey, getPublicKey) { - return async function keygenA(_seed) { - const secretKey = await randomSecretKey(); - return { secretKey, publicKey: await getPublicKey(secretKey) }; - }; -} -function hexToBytesUns(hex) { - return Uint8Array.from(hex.match(/(\w\w)/g), (b) => Number.parseInt(b, 16)); -} -function assertType(type, key) { - if (key.type !== type) - throw new Error(`invalid key type, expected ${type}`); -} -function createKeyUtils(algo, derive, keyLen, pkcs8header) { - const secUsage = derive ? ['deriveBits'] : ['sign']; - const pubUsage = derive ? [] : ['verify']; - // Return Uint8Array instead of ArrayBuffer - const arrBufToU8 = (res, format) => format === TYPE_JWK ? res : new Uint8Array(res); - const pub = { - async import(key, format) { - const keyi = await getSubtle().importKey(format, key, algo, true, pubUsage); - assertType('public', keyi); - return keyi; - }, - async export(key, format) { - assertType('public', key); - const keyi = await getSubtle().exportKey(format, key); - return arrBufToU8(keyi, format); - }, - async convert(key, inFormat, outFormat) { - return pub.export(await pub.import(key, inFormat), outFormat); - }, - }; - const priv = { - async import(key, format) { - const crypto = getSubtle(); - let keyi; - if (format === TYPE_RAW) { - // Chrome, node, bun, deno: works - // Safari, Firefox: Data provided to an operation does not meet requirements - // This is the best one can do. JWK can't be used: it contains public key component inside. - const k = key; - const head = hexToBytesUns(pkcs8header); - const all = new Uint8Array(head.length + k.length); - all.set(head, 0); - all.set(k, head.length); - keyi = await crypto.importKey(TYPE_PKCS, all, algo, true, secUsage); - } - else { - // Fix import of ECDSA keys into ECDH, other formats are ok - if (derive && format === TYPE_JWK) - key = { ...key, key_ops: secUsage }; - keyi = await crypto.importKey(format, key, algo, true, secUsage); - } - assertType('private', keyi); - return keyi; - }, - async export(key, format) { - const crypto = getSubtle(); - assertType('private', key); - if (format === TYPE_RAW) { - // scure-base base64urlnopad could have been used, but we can't add more deps. - // pkcs8 would be even more fragile - const jwk = await crypto.exportKey(TYPE_JWK, key); - const base64 = jwk.d.replace(/-/g, '+').replace(/_/g, '/'); // base64url - const pad = base64.length % 4 ? '='.repeat(4 - (base64.length % 4)) : ''; // add padding - const binary = atob(base64 + pad); - // This is not ASCII, and not text: this is only semi-safe with atob output - const raw = Uint8Array.from(binary, (c) => c.charCodeAt(0)); - // Pad key to key len because Bun strips leading zero for P-521 only - const res = new Uint8Array(keyLen); - res.set(raw, keyLen - raw.length); - return res; - } - const keyi = await crypto.exportKey(format, key); - return arrBufToU8(keyi, format); - }, - async convert(key, inFormat, outFormat) { - return priv.export(await priv.import(key, inFormat), outFormat); - }, - }; - async function getPublicKey(secretKey, opts = {}) { - const fsec = opts.formatSec ?? dfsec; - const fpub = opts.formatPub ?? dfpub; - // Export to jwk, remove private scalar and then convert to format - const jwk = (fsec === TYPE_JWK ? { ...secretKey } : await priv.convert(secretKey, fsec, TYPE_JWK)); - delete jwk.d; - jwk.key_ops = pubUsage; - if (fpub === TYPE_JWK) - return jwk; - return pub.convert(jwk, TYPE_JWK, fpub); - } - async function randomSecretKey(format = dfsec) { - const keyPair = await getSubtle().generateKey(algo, true, secUsage); - return priv.export(keyPair.privateKey, format); - } - // Key generation could be slow, so we cache result once. - let supported; - return { - pub: pub, - priv: priv, - async isSupported() { - if (supported !== undefined) - return supported; - try { - const crypto = getSubtle(); - const key = await crypto.generateKey(algo, true, secUsage); - // Deno is broken and generates key for unsupported curves, but then fails on export - await priv.export(key.privateKey, TYPE_JWK); - // Bun fails on derive for x25519, but not x448 - if (derive) { - await crypto.deriveBits({ name: typeof algo === 'string' ? algo : algo.name, public: key.publicKey }, key.privateKey, 8); - } - return (supported = true); - } - catch (e) { - return (supported = false); - } - }, - getPublicKey, - keygen: createKeygenA(randomSecretKey, getPublicKey), - utils: { - randomSecretKey, - convertPublicKey: pub.convert, - convertSecretKey: priv.convert, - }, - }; -} -function createSigner(keys, algo) { - return { - async sign(msgHash, secretKey, opts = {}) { - const key = await keys.priv.import(secretKey, opts.formatSec ?? dfsec); - const sig = await getSubtle().sign(algo, key, msgHash); - return new Uint8Array(sig); - }, - async verify(signature, msgHash, publicKey, opts = {}) { - const key = await keys.pub.import(publicKey, opts.formatPub ?? dfpub); - return await getSubtle().verify(algo, key, signature, msgHash); - }, - }; -} -function createECDH(keys, algo, keyLen) { - return { - async getSharedSecret(secretKeyA, publicKeyB, opts = {}) { - // if (_isCompressed !== true) throw new Error('WebCrypto only supports compressed keys'); - const secKey = await keys.priv.import(secretKeyA, opts.formatSec || dfsec); - const pubKey = await keys.pub.import(publicKeyB, opts.formatPub || dfpub); - const shared = await getSubtle().deriveBits({ name: typeof algo === 'string' ? algo : algo.name, public: pubKey }, secKey, 8 * keyLen); - return new Uint8Array(shared); - }, - }; -} -function wrapECDSA(curve, hash, keyLen, pkcs8header) { - const ECDH_ALGO = { name: 'ECDH', namedCurve: curve }; - const keys = createKeyUtils({ name: 'ECDSA', namedCurve: curve }, false, keyLen, pkcs8header); - const keysEcdh = createKeyUtils(ECDH_ALGO, true, keyLen, pkcs8header); - return Object.freeze({ - name: curve, - isSupported: keys.isSupported, - getPublicKey: keys.getPublicKey, - keygen: createKeygenA(keys.utils.randomSecretKey, keys.getPublicKey), - ...createSigner(keys, { name: 'ECDSA', hash: { name: hash } }), - ...createECDH(keysEcdh, ECDH_ALGO, keyLen), - utils: keys.utils, - }); -} -function wrapEdDSA(curve, keyLen, pkcs8header) { - const keys = createKeyUtils(curve, false, keyLen, pkcs8header); - return Object.freeze({ - name: curve, - isSupported: keys.isSupported, - getPublicKey: keys.getPublicKey, - keygen: createKeygenA(keys.utils.randomSecretKey, keys.getPublicKey), - ...createSigner(keys, { name: curve }), - utils: keys.utils, - }); -} -function wrapMontgomery(curve, keyLen, pkcs8header) { - const keys = createKeyUtils(curve, true, keyLen, pkcs8header); - return Object.freeze({ - name: curve, - isSupported: keys.isSupported, - getPublicKey: keys.getPublicKey, - keygen: createKeygenA(keys.utils.randomSecretKey, keys.getPublicKey), - ...createECDH(keys, curve, keyLen), - utils: keys.utils, - }); -} -/** Friendly wrapper over built-in WebCrypto NIST P-256 (secp256r1). */ -export const p256 = /* @__PURE__ */ wrapECDSA('P-256', 'SHA-256', 32, '3041020100301306072a8648ce3d020106082a8648ce3d030107042730250201010420'); -/** Friendly wrapper over built-in WebCrypto NIST P-384 (secp384r1). */ -export const p384 = /* @__PURE__ */ wrapECDSA('P-384', 'SHA-384', 48, '304e020100301006072a8648ce3d020106052b81040022043730350201010430'); -/** Friendly wrapper over built-in WebCrypto NIST P-521 (secp521r1). */ -export const p521 = /* @__PURE__ */ wrapECDSA('P-521', 'SHA-512', 66, '3060020100301006072a8648ce3d020106052b81040023044930470201010442'); -/** Friendly wrapper over built-in WebCrypto ed25519. */ -export const ed25519 = /* @__PURE__ */ wrapEdDSA('Ed25519', 32, '302e020100300506032b657004220420'); -/** Friendly wrapper over built-in WebCrypto ed448. */ -export const ed448 = /* @__PURE__ */ wrapEdDSA('Ed448', 57, '3047020100300506032b6571043b0439'); -/** Friendly wrapper over built-in WebCrypto x25519 (ECDH over Curve25519). */ -export const x25519 = /* @__PURE__ */ wrapMontgomery('X25519', 32, '302e020100300506032b656e04220420'); -/** Friendly wrapper over built-in WebCrypto x448 (ECDH over Curve448). */ -export const x448 = /* @__PURE__ */ wrapMontgomery('X448', 56, '3046020100300506032b656f043a0438'); -//# sourceMappingURL=webcrypto.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/webcrypto.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/webcrypto.js.map deleted file mode 100644 index d57b1a27..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/curves/webcrypto.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"webcrypto.js","sourceRoot":"","sources":["src/webcrypto.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,sEAAsE;AAEtE,eAAe;AACf,MAAM,QAAQ,GAAG,KAAK,CAAC;AACvB,MAAM,QAAQ,GAAG,KAAK,CAAC;AACvB,MAAM,SAAS,GAAG,MAAM,CAAC;AACzB,MAAM,SAAS,GAAG,OAAO,CAAC;AAW1B,kBAAkB;AAClB,MAAM,KAAK,GAAG,SAAS,CAAC;AACxB,MAAM,KAAK,GAAG,SAAS,CAAC;AAExB,SAAS,SAAS;IAChB,MAAM,CAAC,GAAQ,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC;IAC1C,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,IAAI,IAAI;QAAE,OAAO,CAAC,CAAC;IACjD,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;AACnD,CAAC;AAED,SAAS,aAAa,CAAC,eAAoB,EAAE,YAAiB;IAC5D,OAAO,KAAK,UAAU,OAAO,CAAC,KAAkB;QAC9C,MAAM,SAAS,GAAG,MAAM,eAAe,EAAE,CAAC;QAC1C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC,SAAS,CAAC,EAAE,CAAC;IACjE,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,GAAW;IAChC,OA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,EACP,EAAE,EACF,kCAAkC,CACnC,CAAC;AAEF,8EAA8E;AAC9E,MAAM,CAAC,MAAM,MAAM,GAAwB,eAAe,CAAC,cAAc,CACvE,QAAQ,EACR,EAAE,EACF,kCAAkC,CACnC,CAAC;AAEF,0EAA0E;AAC1E,MAAM,CAAC,MAAM,IAAI,GAAwB,eAAe,CAAC,cAAc,CACrE,MAAM,EACN,EAAE,EACF,kCAAkC,CACnC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/LICENSE b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/LICENSE deleted file mode 100644 index 9297a046..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2022 Paul Miller (https://paulmillr.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the “Software”), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/README.md b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/README.md deleted file mode 100644 index 5a34df64..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/README.md +++ /dev/null @@ -1,575 +0,0 @@ -# noble-hashes - -Audited & minimal JS implementation of hash functions, MACs and KDFs. - -- 🔒 [**Audited**](#security) by an independent security firm -- 🔻 Tree-shakeable: unused code is excluded from your builds -- 🏎 Fast: hand-optimized for caveats of JS engines -- 🔍 Reliable: chained / sliding window / DoS / ACVP tests and fuzzing -- 🔁 No unrolled loops: makes it easier to verify and reduces source code size up to 5x -- 🦘 Includes SHA, RIPEMD, BLAKE, HMAC, HKDF, PBKDF, Scrypt, Argon2 -- 🥈 Optional, friendly wrapper over native WebCrypto -- 🪶 21KB (gzipped) for everything, 2.4KB for single-hash build - -Check out [Upgrading](#upgrading) for information about upgrading from previous versions. -Take a glance at [GitHub Discussions](https://github.com/paulmillr/noble-hashes/discussions) for questions and support. -The library's initial development was funded by [Ethereum Foundation](https://ethereum.org/). - -### This library belongs to _noble_ cryptography - -> **noble cryptography** — high-security, easily auditable set of contained cryptographic libraries and tools. - -- Zero or minimal dependencies -- Highly readable TypeScript / JS code -- PGP-signed releases and transparent NPM builds -- All libraries: - [ciphers](https://github.com/paulmillr/noble-ciphers), - [curves](https://github.com/paulmillr/noble-curves), - [hashes](https://github.com/paulmillr/noble-hashes), - [post-quantum](https://github.com/paulmillr/noble-post-quantum), - 5kb [secp256k1](https://github.com/paulmillr/noble-secp256k1) / - [ed25519](https://github.com/paulmillr/noble-ed25519) -- [Check out homepage](https://paulmillr.com/noble/) - for reading resources, documentation and apps built with noble - -## Usage - -> `npm install @noble/hashes` - -> `deno add jsr:@noble/hashes` - -We support all major platforms and runtimes. -For React Native, you may need a [polyfill for getRandomValues](https://github.com/LinusU/react-native-get-random-values). -A standalone file [noble-hashes.js](https://github.com/paulmillr/noble-hashes/releases) is also available. - -```js -// import * from '@noble/hashes'; // Error: use sub-imports, to ensure small app size -import { sha256 } from '@noble/hashes/sha2.js'; -const hash = sha256(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])); - -// Available modules -import { sha256, sha384, sha512, sha224, sha512_224, sha512_256 } from '@noble/hashes/sha2.js'; -import { - sha3_256, sha3_512, - keccak_256, keccak_512, - shake128, shake256, -} from '@noble/hashes/sha3.js'; -import { - cshake256, turboshake256, kmac256, tuplehash256, - kt128, kt256, keccakprg, -} from '@noble/hashes/sha3-addons.js'; -import { blake3 } from '@noble/hashes/blake3.js'; -import { blake2b, blake2s } from '@noble/hashes/blake2.js'; -import { blake256, blake512 } from '@noble/hashes/blake1.js'; -import { sha1, md5, ripemd160 } from '@noble/hashes/legacy.js'; -import { hmac } from '@noble/hashes/hmac.js'; -import { hkdf } from '@noble/hashes/hkdf.js'; -import { pbkdf2, pbkdf2Async } from '@noble/hashes/pbkdf2.js'; -import { scrypt, scryptAsync } from '@noble/hashes/scrypt.js'; -import { argon2d, argon2i, argon2id } from '@noble/hashes/argon2.js'; -import * as webcrypto from '@noble/hashes/webcrypto.js'; -// const { sha256, sha384, sha512, hmac, hkdf, pbkdf2 } = webcrypto; -import * as utils from '@noble/hashes/utils.js'; -const { bytesToHex, concatBytes, equalBytes, hexToBytes } = utils; -``` - -- [sha2: sha256, sha384, sha512](#sha2-sha256-sha384-sha512-and-others) -- [sha3: FIPS, SHAKE, Keccak](#sha3-fips-shake-keccak) -- [sha3-addons: cSHAKE, KMAC, KT128, TurboSHAKE](#sha3-addons-cshake-kmac-kt128-turboshake) -- [blake1, blake2, blake3](#blake1-blake2-blake3) -- [legacy: sha1, md5, ripemd160](#legacy-sha1-md5-ripemd160) -- MACs: [hmac](#hmac) | [kmac](#sha3-addons-cshake-kmac-kt128-turboshake) | [blake3 key mode](#blake1-blake2-blake3) -- KDFs: [hkdf](#hkdf) | [pbkdf2](#pbkdf2) | [scrypt](#scrypt) | [argon2](#argon2) -- [webcrypto: friendly wrapper](#webcrypto-friendly-wrapper) -- [utils](#utils) -- [Security](#security) | [Speed](#speed) | [Contributing & testing](#contributing--testing) | [License](#license) - -### Implementations - -Hash functions: - -- `sha256()`: receive & return `Uint8Array` -- `sha256.create().update(a).update(b).digest()`: support partial updates -- `blake3.create({ context: 'e', dkLen: 32 })`: can have options -- support little-endian architecture; also experimentally big-endian -- can hash up to 4GB per chunk, with any amount of chunks - -#### sha2: sha256, sha384, sha512 and others - -```typescript -import { sha224, sha256, sha384, sha512, sha512_224, sha512_256 } from '@noble/hashes/sha2.js'; -const res = sha256(Uint8Array.from([0xbc])); // basic -for (let hash of [sha256, sha384, sha512, sha224, sha512_224, sha512_256]) { - const arr = Uint8Array.from([0x10, 0x20, 0x30]); - const a = hash(arr); - const b = hash.create().update(arr).digest(); -} -``` - -Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and -[the paper on truncated SHA512/256](https://eprint.iacr.org/2010/548.pdf). - -#### sha3: FIPS, SHAKE, Keccak - -```typescript -import { - sha3_224, sha3_256, sha3_384, sha3_512, - keccak_224, keccak_256, keccak_384, keccak_512, - shake128, shake256, -} from '@noble/hashes/sha3.js'; -for (let hash of [ - sha3_224, sha3_256, sha3_384, sha3_512, - keccak_224, keccak_256, keccak_384, keccak_512, -]) { - const arr = Uint8Array.from([0x10, 0x20, 0x30]); - const a = hash(arr); - const b = hash.create().update(arr).digest(); -} -const shka = shake128(Uint8Array.from([0x10]), { dkLen: 512 }); -const shkb = shake256(Uint8Array.from([0x30]), { dkLen: 512 }); -``` - -Check out [FIPS-202](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf), -[Website](https://keccak.team/keccak.html). - -Check out [the differences between SHA-3 and Keccak](https://crypto.stackexchange.com/questions/15727/what-are-the-key-differences-between-the-draft-sha-3-standard-and-the-keccak-sub) - -#### sha3-addons: cSHAKE, KMAC, K12, TurboSHAKE - -```typescript -import { - cshake128, cshake256, kt128, kt256, - keccakprg, kmac128, kmac256, - parallelhash256, tuplehash256, - turboshake128, turboshake256, -} from '@noble/hashes/sha3-addons.js'; -const data = Uint8Array.from([0x10, 0x20, 0x30]); -const ec1 = cshake128(data, { personalization: 'def' }); -const ec2 = cshake256(data, { personalization: 'def' }); -const et1 = turboshake128(data); -const et2 = turboshake256(data, { D: 0x05 }); -// tuplehash(['ab', 'c']) !== tuplehash(['a', 'bc']) !== tuplehash([data]) -const et3 = tuplehash256([new TextEncoder().encode('ab'), new TextEncoder().encode('c')]); -// Not parallel in JS (similar to blake3 / kt128), added for compat -const ep1 = parallelhash256(data, { blockLen: 8 }); -const kk = Uint8Array.from([0xca]); -const ek10 = kmac128(kk, data); -const ek11 = kmac256(kk, data); -const ek12 = kt128(data); // kangarootwelve 128-bit -const ek13 = kt256(data); // kangarootwelve 256-bit -// pseudo-random generator, first argument is capacity. XKCP recommends 254 bits capacity for 128-bit security strength. -// * with a capacity of 254 bits. -const p = keccakprg(254); -p.feed('test'); -const rand1b = p.fetch(1); -``` - -- cSHAKE, KMAC, TupleHash, ParallelHash + XOF are available, matching - [NIST SP 800-185](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-185.pdf) -- Reduced-round Keccak KT128 (KangarooTwelve 🦘, K12) and TurboSHAKE are available, matching - [kangaroo-draft-17](https://datatracker.ietf.org/doc/draft-irtf-cfrg-kangarootwelve/). -- [KeccakPRG](https://keccak.team/files/CSF-0.1.pdf): pseudo-random generator based on Keccak - -#### blake1, blake2, blake3 - -```typescript -import { blake224, blake256, blake384, blake512 } from '@noble/hashes/blake1.js'; -import { blake2b, blake2s } from '@noble/hashes/blake2.js'; -import { blake3 } from '@noble/hashes/blake3.js'; - -for (let hash of [blake224, blake256, blake384, blake512, blake2b, blake2s, blake3]) { - const arr = Uint8Array.from([0x10, 0x20, 0x30]); - const a = hash(arr); - const b = hash.create().update(arr).digest(); -} - -// blake2 advanced usage -const ab = Uint8Array.from([0x01]); -blake2s(ab); -blake2s(ab, { key: new Uint8Array(32) }); -blake2s(ab, { personalization: 'pers1234' }); -blake2s(ab, { salt: 'salt1234' }); -blake2b(ab); -blake2b(ab, { key: new Uint8Array(64) }); -blake2b(ab, { personalization: 'pers1234pers1234' }); -blake2b(ab, { salt: 'salt1234salt1234' }); - -// blake3 advanced usage -blake3(ab); -blake3(ab, { dkLen: 256 }); -blake3(ab, { key: new Uint8Array(32) }); -blake3(ab, { context: 'application-name' }); -``` - -- Blake1 is legacy hash, one of SHA3 proposals. It is rarely used anywhere. See [pdf](https://www.aumasson.jp/blake/blake.pdf). -- Blake2 is popular fast hash. blake2b focuses on 64-bit platforms while blake2s is for 8-bit to 32-bit ones. See [RFC 7693](https://datatracker.ietf.org/doc/html/rfc7693), [Website](https://www.blake2.net) -- Blake3 is faster, reduced-round blake2. See [Website & specs](https://blake3.io) - -#### legacy: sha1, md5, ripemd160 - -SHA1 (RFC 3174), MD5 (RFC 1321) and RIPEMD160 (RFC 2286) legacy, weak hash functions. -Don't use them in a new protocol. What "weak" means: - -- Collisions can be made with 2^18 effort in MD5, 2^60 in SHA1, 2^80 in RIPEMD160. -- No practical pre-image attacks (only theoretical, 2^123.4) -- HMAC seems kinda ok: https://datatracker.ietf.org/doc/html/rfc6151 - -```typescript -import { md5, ripemd160, sha1 } from '@noble/hashes/legacy.js'; -for (let hash of [md5, ripemd160, sha1]) { - const arr = Uint8Array.from([0x10, 0x20, 0x30]); - const a = hash(arr); - const b = hash.create().update(arr).digest(); -} -``` - -#### hmac - -```typescript -import { hmac } from '@noble/hashes/hmac.js'; -import { sha256 } from '@noble/hashes/sha2.js'; -const key = new Uint8Array(32).fill(1); -const msg = new Uint8Array(32).fill(2); -const mac1 = hmac(sha256, key, msg); -const mac2 = hmac.create(sha256, key).update(msg).digest(); -``` - -Conforms to [RFC 2104](https://datatracker.ietf.org/doc/html/rfc2104). - -#### hkdf - -```typescript -import { hkdf } from '@noble/hashes/hkdf.js'; -import { randomBytes } from '@noble/hashes/utils.js'; -import { sha256 } from '@noble/hashes/sha2.js'; -const inputKey = randomBytes(32); -const salt = randomBytes(32); -const info = 'application-key'; -const hk1 = hkdf(sha256, inputKey, salt, info, 32); - -// == same as -import { extract, expand } from '@noble/hashes/hkdf.js'; -import { sha256 } from '@noble/hashes/sha2.js'; -const prk = extract(sha256, inputKey, salt); -const hk2 = expand(sha256, prk, info, 32); -``` - -Conforms to [RFC 5869](https://datatracker.ietf.org/doc/html/rfc5869). - -#### pbkdf2 - -```typescript -import { pbkdf2, pbkdf2Async } from '@noble/hashes/pbkdf2.js'; -import { sha256 } from '@noble/hashes/sha2.js'; -const pbkey1 = pbkdf2(sha256, 'password', 'salt', { c: 524288, dkLen: 32 }); -const pbkey2 = await pbkdf2Async(sha256, 'password', 'salt', { c: 524288, dkLen: 32 }); -const pbkey3 = await pbkdf2Async(sha256, Uint8Array.from([1, 2, 3]), Uint8Array.from([4, 5, 6]), { - c: 524288, - dkLen: 32, -}); -``` - -Conforms to [RFC 2898](https://datatracker.ietf.org/doc/html/rfc2898). - -#### scrypt - -```typescript -import { scrypt, scryptAsync } from '@noble/hashes/scrypt.js'; -const scr1 = scrypt('password', 'salt', { N: 2 ** 16, r: 8, p: 1, dkLen: 32 }); -const scr2 = await scryptAsync('password', 'salt', { N: 2 ** 16, r: 8, p: 1, dkLen: 32 }); -const scr3 = await scryptAsync(Uint8Array.from([1, 2, 3]), Uint8Array.from([4, 5, 6]), { - N: 2 ** 17, - r: 8, - p: 1, - dkLen: 32, - onProgress(percentage) { - console.log('progress', percentage); - }, - maxmem: 2 ** 32 + 128 * 8 * 1, // N * r * p * 128 + (128*r*p) -}); -``` - -Conforms to [RFC 7914](https://datatracker.ietf.org/doc/html/rfc7914), -[Website](https://www.tarsnap.com/scrypt.html) - -- `N, r, p` are work factors. It is common to only adjust N, while keeping `r: 8, p: 1`. - See [the blog post](https://blog.filippo.io/the-scrypt-parameters/). - JS doesn't support parallelization, making increasing `p` meaningless. -- `dkLen` is the length of output bytes e.g. `32` or `64` -- `onProgress` can be used with async version of the function to report progress to a user. -- `maxmem` prevents DoS and is limited to `1GB + 1KB` (`2**30 + 2**10`), but can be adjusted using formula: `N * r * p * 128 + (128 * r * p)` - -Time it takes to derive Scrypt key under different values of N (2\*\*N) on Apple M4 (mobile phones can be 1x-4x slower): - -| N pow | Time | RAM | -| ----- | ---- | ----- | -| 16 | 0.1s | 64MB | -| 17 | 0.2s | 128MB | -| 18 | 0.4s | 256MB | -| 19 | 0.8s | 512MB | -| 20 | 1.5s | 1GB | -| 21 | 3.1s | 2GB | -| 22 | 6.2s | 4GB | -| 23 | 13s | 8GB | -| 24 | 27s | 16GB | - -> [!NOTE] -> We support N larger than `2**20` where available, however, -> not all JS engines support >= 2GB ArrayBuffer-s. -> When using such N, you'll need to manually adjust `maxmem`, using formula above. -> Other JS implementations don't support large N-s. - -#### argon2 - -```ts -import { argon2d, argon2i, argon2id } from '@noble/hashes/argon2.js'; -const arg1 = argon2id('password', 'saltsalt', { t: 2, m: 65536, p: 1, maxmem: 2 ** 32 - 1 }); -``` - -Argon2 [RFC 9106](https://datatracker.ietf.org/doc/html/rfc9106) implementation. - -> [!WARNING] -> Argon2 can't be fast in JS, because there is no fast Uint64Array. -> It is suggested to use [Scrypt](#scrypt) instead. -> Being 5x slower than native code means brute-forcing attackers have bigger advantage. - -#### webcrypto: friendly wrapper - -```js -import { sha256, sha384, sha512, hmac, hkdf, pbkdf2 } from '@noble/hashes/webcrypto.js'; -const whash = await sha256(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])); - -const key = new Uint8Array(32).fill(1); -const msg = new Uint8Array(32).fill(2); -const wmac = await hmac(sha256, key, msg); - -const inputKey = randomBytes(32); -const salt = randomBytes(32); -const info = 'application-key'; -const hk1 = await hkdf(sha256, inputKey, salt, info, 32); - -const pbkey1 = await pbkdf2(sha256, 'password', 'salt', { c: 524288, dkLen: 32 }); -``` - -Sometimes people want to use built-in `crypto.subtle` instead of pure JS implementation. -However, it has terrible API. - -We simplify access to built-ins with API which mirrors noble-hashes. -The overhead is minimal - just 30+ lines of code, which verify input correctness. - -> [!NOTE] -> Webcrypto methods are always async. - -#### utils - -```typescript -import { bytesToHex as toHex, randomBytes } from '@noble/hashes/utils.js'; -console.log(toHex(randomBytes(32))); -``` - -- `bytesToHex` will convert `Uint8Array` to a hex string -- `randomBytes(bytes)` will produce cryptographically secure random `Uint8Array` of length `bytes` - -## Security - -The library has been independently audited: - -- at version 1.0.0, in Jan 2022, by [Cure53](https://cure53.de) - - PDFs: [website](https://cure53.de/pentest-report_hashing-libs.pdf), [in-repo](./audit/2022-01-05-cure53-audit-nbl2.pdf) - - [Changes since audit](https://github.com/paulmillr/noble-hashes/compare/1.0.0..main). - - Scope: everything, besides `blake3`, `sha3-addons`, `sha1` and `argon2`, which have not been audited - - The audit has been funded by [Ethereum Foundation](https://ethereum.org/en/) with help of [Nomic Labs](https://nomiclabs.io) - -It is tested against property-based, cross-library and Wycheproof vectors, -and is being fuzzed in [the separate repo](https://github.com/paulmillr/fuzzing). - -If you see anything unusual: investigate and report. - -### Constant-timeness - -We're targetting algorithmic constant time. _JIT-compiler_ and _Garbage Collector_ make "constant time" -extremely hard to achieve [timing attack](https://en.wikipedia.org/wiki/Timing_attack) resistance -in a scripting language. Which means _any other JS library can't have -constant-timeness_. Even statically typed Rust, a language without GC, -[makes it harder to achieve constant-time](https://www.chosenplaintext.ca/open-source/rust-timing-shield/security) -for some cases. If your goal is absolute security, don't use any JS lib — including bindings to native ones. -Use low-level libraries & languages. - -### Memory dumping - -The library shares state buffers between hash -function calls. The buffers are zeroed-out after each call. However, if an attacker -can read application memory, you are doomed in any case: - -- At some point, input will be a string and strings are immutable in JS: - there is no way to overwrite them with zeros. For example: deriving - key from `scrypt(password, salt)` where password and salt are strings -- Input from a file will stay in file buffers -- Input / output will be re-used multiple times in application which means it could stay in memory -- `await anything()` will always write all internal variables (including numbers) - to memory. With async functions / Promises there are no guarantees when the code - chunk would be executed. Which means attacker can have plenty of time to read data from memory -- There is no way to guarantee anything about zeroing sensitive data without - complex tests-suite which will dump process memory and verify that there is - no sensitive data left. For JS it means testing all browsers (incl. mobile), - which is complex. And of course it will be useless without using the same - test-suite in the actual application that consumes the library - -### Supply chain security - -- **Commits** are signed with PGP keys, to prevent forgery. Make sure to verify commit signatures -- **Releases** are transparent and built on GitHub CI. - Check out [attested checksums of single-file builds](https://github.com/paulmillr/noble-hashes/attestations) - and [provenance logs](https://github.com/paulmillr/noble-hashes/actions/workflows/release.yml) -- **Rare releasing** is followed to ensure less re-audit need for end-users -- **Dependencies** are minimized and locked-down: any dependency could get hacked and users will be downloading malware with every install. - - We make sure to use as few dependencies as possible - - Automatic dep updates are prevented by locking-down version ranges; diffs are checked with `npm-diff` -- **Dev Dependencies** are disabled for end-users; they are only used to develop / build the source code - -For this package, there are 0 dependencies; and a few dev dependencies: - -- jsbt contains helpers for building, benchmarking & testing secure JS apps. It is developed by the same author -- prettier, fast-check and typescript are used for code quality / test generation / ts compilation. It's hard to audit their source code thoroughly and fully because of their size - -### Randomness - -We're deferring to built-in -[crypto.getRandomValues](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues) -which is considered cryptographically secure (CSPRNG). - -In the past, browsers had bugs that made it weak: it may happen again. -Implementing a userspace CSPRNG to get resilient to the weakness -is even worse: there is no reliable userspace source of quality entropy. - -### Quantum computers - -Cryptographically relevant quantum computer, if built, will allow to -utilize Grover's algorithm to break hashes in 2^n/2 operations, instead of 2^n. - -This means SHA256 should be replaced with SHA512, SHA3-256 with SHA3-512, SHAKE128 with SHAKE256 etc. - -Australian ASD prohibits SHA256 and similar hashes [after 2030](https://www.cyber.gov.au/resources-business-and-government/essential-cyber-security/ism/cyber-security-guidelines/guidelines-cryptography). - -## Speed - -```sh -npm run bench -``` - -Benchmarks measured on Apple M4. - -``` -# 32B -sha256 x 2,016,129 ops/sec @ 496ns/op -sha512 x 740,740 ops/sec @ 1μs/op -sha3_256 x 287,686 ops/sec @ 3μs/op -sha3_512 x 288,267 ops/sec @ 3μs/op -k12 x 476,190 ops/sec @ 2μs/op -blake2b x 464,252 ops/sec @ 2μs/op -blake2s x 766,871 ops/sec @ 1μs/op -blake3 x 879,507 ops/sec @ 1μs/op - -# 1MB -sha256 x 331 ops/sec @ 3ms/op -sha512 x 129 ops/sec @ 7ms/op -sha3_256 x 38 ops/sec @ 25ms/op -sha3_512 x 20 ops/sec @ 47ms/op -k12 x 88 ops/sec @ 11ms/op -blake2b x 69 ops/sec @ 14ms/op -blake2s x 57 ops/sec @ 17ms/op -blake3 x 72 ops/sec @ 13ms/op - -# MAC -hmac(sha256) x 599,880 ops/sec @ 1μs/op -hmac(sha512) x 197,122 ops/sec @ 5μs/op -kmac256 x 87,981 ops/sec @ 11μs/op -blake3(key) x 796,812 ops/sec @ 1μs/op - -# KDF -hkdf(sha256) x 259,942 ops/sec @ 3μs/op -blake3(context) x 424,808 ops/sec @ 2μs/op -pbkdf2(sha256, c: 2 ** 18) x 5 ops/sec @ 197ms/op -pbkdf2(sha512, c: 2 ** 18) x 1 ops/sec @ 630ms/op -scrypt(n: 2 ** 18, r: 8, p: 1) x 2 ops/sec @ 400ms/op -argon2id(t: 1, m: 256MB) 2881ms -``` - -Compare to native node.js implementation that uses C bindings instead of pure-js code: - -``` -# native (node) 32B -sha256 x 2,267,573 ops/sec -sha512 x 983,284 ops/sec -sha3_256 x 1,522,070 ops/sec -blake2b x 1,512,859 ops/sec -blake2s x 1,821,493 ops/sec -hmac(sha256) x 1,085,776 ops/sec -hkdf(sha256) x 312,109 ops/sec -# native (node) KDF -pbkdf2(sha256, c: 2 ** 18) x 5 ops/sec @ 197ms/op -pbkdf2(sha512, c: 2 ** 18) x 1 ops/sec @ 630ms/op -scrypt(n: 2 ** 18, r: 8, p: 1) x 2 ops/sec @ 378ms/op -``` - -It is possible to [make this library 3x+ faster](./test/benchmark/README.md) by -_doing code generation of full loop unrolls_. We've decided against it. Reasons: - -- current perf is good enough, even compared to other libraries - SHA256 only takes 500 nanoseconds -- the library must be auditable, with minimum amount of code, and zero dependencies -- most method invocations with the lib are going to be something like hashing 32b to 64kb of data -- hashing big inputs is 10x faster with low-level languages, which means you should probably pick 'em instead - -## Upgrading - -Supported node.js versions: - -- v2: v20.19+ (ESM-only) -- v1: v14.21+ (ESM & CJS) - -v2.0 changelog: - -- The package is now ESM-only. ESM can finally be loaded from common.js on node v20.19+ -- `.js` extension must be used for all modules - - Old: `@noble/hashes/sha3` - - New: `@noble/hashes/sha3.js` - - This simplifies working in browsers natively without transpilers -- Only allow Uint8Array as hash inputs, prohibit `string` - - Strict validation checks improve security - - To replicate previous behavior, use `utils.utf8ToBytes` -- Rename / remove some modules for consistency. Previously, sha384 resided in sha512, which was weird - - `sha256`, `sha512` => `sha2.js` (consistent with `sha3.js`) - - `blake2b`, `blake2s` => `blake2.js` (consistent with `blake3.js`, `blake1.js`) - - `ripemd160`, `sha1`, `md5` => `legacy.js` (all low-security hashes are there) - - `_assert` => `utils.js` - - `crypto` internal module got removed: use built-in WebCrypto instead -- Improve typescript types & option autocomplete -- Bump compilation target from es2020 to es2022 - -## Contributing & testing - -`test/misc` directory contains implementations of loop unrolling and md5. - -- `npm install && npm run build && npm test` will build the code and run tests. -- `npm run lint` / `npm run format` will run linter / fix linter issues. -- `npm run bench` will run benchmarks -- `npm run build:release` will build single file -- There is **additional** 20-min DoS test `npm run test:dos` and 2-hour "big" multicore test `npm run test:big`. - See [our approach to testing](./test/README.md) - -Additional resources: - -- NTT hashes are outside of scope of the library. They depend on some math which is not available in noble-hashes, it doesn't make sense to add it here. You can view some of them in different repos: - - [Pedersen in micro-zk-proofs](https://github.com/paulmillr/micro-zk-proofs/blob/1ed5ce1253583b2e540eef7f3477fb52bf5344ff/src/pedersen.ts) - - [Poseidon in noble-curves](https://github.com/paulmillr/noble-curves/blob/3d124dd3ecec8b6634cc0b2ba1c183aded5304f9/src/abstract/poseidon.ts) -- Polynomial MACs are also outside of scope of the library. They are rarely used outside of encryption. Check out [Poly1305 & GHash in noble-ciphers](https://github.com/paulmillr/noble-ciphers). -- See [paulmillr.com/noble](https://paulmillr.com/noble/) for useful resources, articles, documentation and demos - related to the library. - -## License - -The MIT License (MIT) - -Copyright (c) 2022 Paul Miller [(https://paulmillr.com)](https://paulmillr.com) - -See LICENSE file. diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_blake.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_blake.d.ts deleted file mode 100644 index 71ed85f9..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_blake.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Internal blake variable. - * For BLAKE2b, the two extra permutations for rounds 10 and 11 are SIGMA[10..11] = SIGMA[0..1]. - */ -export declare const BSIGMA: Uint8Array; -export type Num4 = { - a: number; - b: number; - c: number; - d: number; -}; -export declare function G1s(a: number, b: number, c: number, d: number, x: number): Num4; -export declare function G2s(a: number, b: number, c: number, d: number, x: number): Num4; -//# sourceMappingURL=_blake.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_blake.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_blake.d.ts.map deleted file mode 100644 index 7b11ac1f..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_blake.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_blake.d.ts","sourceRoot":"","sources":["src/_blake.ts"],"names":[],"mappings":"AAMA;;;GAGG;AAEH,eAAO,MAAM,MAAM,EAAE,UAkBnB,CAAC;AAGH,MAAM,MAAM,IAAI,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;CAAE,CAAC;AAGnE,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAM/E;AAED,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAM/E"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_blake.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_blake.js deleted file mode 100644 index 3573ee96..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_blake.js +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Internal helpers for blake hash. - * @module - */ -import { rotr } from "./utils.js"; -/** - * Internal blake variable. - * For BLAKE2b, the two extra permutations for rounds 10 and 11 are SIGMA[10..11] = SIGMA[0..1]. - */ -// prettier-ignore -export const BSIGMA = /* @__PURE__ */ Uint8Array.from([ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3, - 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4, - 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8, - 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13, - 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9, - 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11, - 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10, - 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5, - 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3, - // Blake1, unused in others - 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4, - 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8, - 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13, - 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9, -]); -// Mixing function G splitted in two halfs -export function G1s(a, b, c, d, x) { - a = (a + b + x) | 0; - d = rotr(d ^ a, 16); - c = (c + d) | 0; - b = rotr(b ^ c, 12); - return { a, b, c, d }; -} -export function G2s(a, b, c, d, x) { - a = (a + b + x) | 0; - d = rotr(d ^ a, 8); - c = (c + d) | 0; - b = rotr(b ^ c, 7); - return { a, b, c, d }; -} -//# sourceMappingURL=_blake.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_blake.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_blake.js.map deleted file mode 100644 index 4a418be4..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_blake.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_blake.js","sourceRoot":"","sources":["src/_blake.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC;;;GAGG;AACH,kBAAkB;AAClB,MAAM,CAAC,MAAM,MAAM,GAAe,eAAe,CAAC,UAAU,CAAC,IAAI,CAAC;IAChE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,E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C,CAAC,GAAG,CAAC,CAAC;IAChB,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IACnB,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_md.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_md.d.ts deleted file mode 100644 index c0f6ee82..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_md.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Internal Merkle-Damgard hash utils. - * @module - */ -import { type Hash } from './utils.ts'; -/** Choice: a ? b : c */ -export declare function Chi(a: number, b: number, c: number): number; -/** Majority function, true if any two inputs is true. */ -export declare function Maj(a: number, b: number, c: number): number; -/** - * Merkle-Damgard hash construction base class. - * Could be used to create MD5, RIPEMD, SHA1, SHA2. - */ -export declare abstract class HashMD> implements Hash { - protected abstract process(buf: DataView, offset: number): void; - protected abstract get(): number[]; - protected abstract set(...args: number[]): void; - abstract destroy(): void; - protected abstract roundClean(): void; - readonly blockLen: number; - readonly outputLen: number; - readonly padOffset: number; - readonly isLE: boolean; - protected buffer: Uint8Array; - protected view: DataView; - protected finished: boolean; - protected length: number; - protected pos: number; - protected destroyed: boolean; - constructor(blockLen: number, outputLen: number, padOffset: number, isLE: boolean); - update(data: Uint8Array): this; - digestInto(out: Uint8Array): void; - digest(): Uint8Array; - _cloneInto(to?: T): T; - clone(): T; -} -/** - * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53. - * Check out `test/misc/sha2-gen-iv.js` for recomputation guide. - */ -/** Initial SHA256 state. Bits 0..32 of frac part of sqrt of primes 2..19 */ -export declare const SHA256_IV: Uint32Array; -/** Initial SHA224 state. Bits 32..64 of frac part of sqrt of primes 23..53 */ -export declare const SHA224_IV: Uint32Array; -/** Initial SHA384 state. Bits 0..64 of frac part of sqrt of primes 23..53 */ -export declare const SHA384_IV: Uint32Array; -/** Initial SHA512 state. Bits 0..64 of frac part of sqrt of primes 2..19 */ -export declare const SHA512_IV: Uint32Array; -//# sourceMappingURL=_md.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_md.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_md.d.ts.map deleted file mode 100644 index 6e142896..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_md.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_md.d.ts","sourceRoot":"","sources":["src/_md.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAA+C,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAEpF,wBAAwB;AACxB,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,yDAAyD;AACzD,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED;;;GAGG;AACH,8BAAsB,MAAM,CAAC,CAAC,SAAS,MAAM,CAAC,CAAC,CAAC,CAAE,YAAW,IAAI,CAAC,CAAC,CAAC;IAClE,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAC/D,SAAS,CAAC,QAAQ,CAAC,GAAG,IAAI,MAAM,EAAE;IAClC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI;IAC/C,QAAQ,CAAC,OAAO,IAAI,IAAI;IACxB,SAAS,CAAC,QAAQ,CAAC,UAAU,IAAI,IAAI;IAErC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAGvB,SAAS,CAAC,MAAM,EAAE,UAAU,CAAC;IAC7B,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC;IACzB,SAAS,CAAC,QAAQ,UAAS;IAC3B,SAAS,CAAC,MAAM,SAAK;IACrB,SAAS,CAAC,GAAG,SAAK;IAClB,SAAS,CAAC,SAAS,UAAS;gBAEhB,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO;IAQjF,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI;IAyB9B,UAAU,CAAC,GAAG,EAAE,UAAU,GAAG,IAAI;IAkCjC,MAAM,IAAI,UAAU;IAOpB,UAAU,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC;IAWrB,KAAK,IAAI,CAAC;CAGX;AAED;;;GAGG;AAEH,4EAA4E;AAC5E,eAAO,MAAM,SAAS,EAAE,WAEtB,CAAC;AAEH,8EAA8E;AAC9E,eAAO,MAAM,SAAS,EAAE,WAEtB,CAAC;AAEH,6EAA6E;AAC7E,eAAO,MAAM,SAAS,EAAE,WAGtB,CAAC;AAEH,4EAA4E;AAC5E,eAAO,MAAM,SAAS,EAAE,WAGtB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_md.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_md.js deleted file mode 100644 index 9dd5b612..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_md.js +++ /dev/null @@ -1,147 +0,0 @@ -/** - * Internal Merkle-Damgard hash utils. - * @module - */ -import { abytes, aexists, aoutput, clean, createView } from "./utils.js"; -/** Choice: a ? b : c */ -export function Chi(a, b, c) { - return (a & b) ^ (~a & c); -} -/** Majority function, true if any two inputs is true. */ -export function Maj(a, b, c) { - return (a & b) ^ (a & c) ^ (b & c); -} -/** - * Merkle-Damgard hash construction base class. - * Could be used to create MD5, RIPEMD, SHA1, SHA2. - */ -export class HashMD { - blockLen; - outputLen; - padOffset; - isLE; - // For partial updates less than block size - buffer; - view; - finished = false; - length = 0; - pos = 0; - destroyed = false; - constructor(blockLen, outputLen, padOffset, isLE) { - this.blockLen = blockLen; - this.outputLen = outputLen; - this.padOffset = padOffset; - this.isLE = isLE; - this.buffer = new Uint8Array(blockLen); - this.view = createView(this.buffer); - } - update(data) { - aexists(this); - abytes(data); - const { view, buffer, blockLen } = this; - const len = data.length; - for (let pos = 0; pos < len;) { - const take = Math.min(blockLen - this.pos, len - pos); - // Fast path: we have at least one block in input, cast it to view and process - if (take === blockLen) { - const dataView = createView(data); - for (; blockLen <= len - pos; pos += blockLen) - this.process(dataView, pos); - continue; - } - buffer.set(data.subarray(pos, pos + take), this.pos); - this.pos += take; - pos += take; - if (this.pos === blockLen) { - this.process(view, 0); - this.pos = 0; - } - } - this.length += data.length; - this.roundClean(); - return this; - } - digestInto(out) { - aexists(this); - aoutput(out, this); - this.finished = true; - // Padding - // We can avoid allocation of buffer for padding completely if it - // was previously not allocated here. But it won't change performance. - const { buffer, view, blockLen, isLE } = this; - let { pos } = this; - // append the bit '1' to the message - buffer[pos++] = 0b10000000; - clean(this.buffer.subarray(pos)); - // we have less than padOffset left in buffer, so we cannot put length in - // current block, need process it and pad again - if (this.padOffset > blockLen - pos) { - this.process(view, 0); - pos = 0; - } - // Pad until full block byte with zeros - for (let i = pos; i < blockLen; i++) - buffer[i] = 0; - // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that - // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen. - // So we just write lowest 64 bits of that value. - view.setBigUint64(blockLen - 8, BigInt(this.length * 8), isLE); - this.process(view, 0); - const oview = createView(out); - const len = this.outputLen; - // NOTE: we do division by 4 later, which must be fused in single op with modulo by JIT - if (len % 4) - throw new Error('_sha2: outputLen must be aligned to 32bit'); - const outLen = len / 4; - const state = this.get(); - if (outLen > state.length) - throw new Error('_sha2: outputLen bigger than state'); - for (let i = 0; i < outLen; i++) - oview.setUint32(4 * i, state[i], isLE); - } - digest() { - const { buffer, outputLen } = this; - this.digestInto(buffer); - const res = buffer.slice(0, outputLen); - this.destroy(); - return res; - } - _cloneInto(to) { - to ||= new this.constructor(); - to.set(...this.get()); - const { blockLen, buffer, length, finished, destroyed, pos } = this; - to.destroyed = destroyed; - to.finished = finished; - to.length = length; - to.pos = pos; - if (length % blockLen) - to.buffer.set(buffer); - return to; - } - clone() { - return this._cloneInto(); - } -} -/** - * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53. - * Check out `test/misc/sha2-gen-iv.js` for recomputation guide. - */ -/** Initial SHA256 state. Bits 0..32 of frac part of sqrt of primes 2..19 */ -export const SHA256_IV = /* @__PURE__ */ Uint32Array.from([ - 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19, -]); -/** Initial SHA224 state. Bits 32..64 of frac part of sqrt of primes 23..53 */ -export const SHA224_IV = /* @__PURE__ */ Uint32Array.from([ - 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4, -]); -/** Initial SHA384 state. Bits 0..64 of frac part of sqrt of primes 23..53 */ -export const SHA384_IV = /* @__PURE__ */ Uint32Array.from([ - 0xcbbb9d5d, 0xc1059ed8, 0x629a292a, 0x367cd507, 0x9159015a, 0x3070dd17, 0x152fecd8, 0xf70e5939, - 0x67332667, 0xffc00b31, 0x8eb44a87, 0x68581511, 0xdb0c2e0d, 0x64f98fa7, 0x47b5481d, 0xbefa4fa4, -]); -/** Initial SHA512 state. Bits 0..64 of frac part of sqrt of primes 2..19 */ -export const SHA512_IV = /* @__PURE__ */ Uint32Array.from([ - 0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1, - 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179, -]); -//# sourceMappingURL=_md.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_md.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_md.js.map deleted file mode 100644 index b2c29d69..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_md.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_md.js","sourceRoot":"","sources":["src/_md.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAa,MAAM,YAAY,CAAC;AAEpF,wBAAwB;AACxB,MAAM,UAAU,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS;IACjD,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAC5B,CAAC;AAED,yDAAyD;AACzD,MAAM,UAAU,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS;IACjD,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AACrC,CAAC;AAED;;;GAGG;AACH,MAAM,OAAgB,MAAM;IAOjB,QAAQ,CAAS;IACjB,SAAS,CAAS;IAClB,SAAS,CAAS;IAClB,IAAI,CAAU;IAEvB,2CAA2C;IACjC,MAAM,CAAa;I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,EAAE,UAAU;CAC/F,CAAC,CAAC;AAEH,4EAA4E;AAC5E,MAAM,CAAC,MAAM,SAAS,GAAgB,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC;IACrE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IAC9F,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;CAC/F,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_u64.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_u64.d.ts deleted file mode 100644 index ac5523a3..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_u64.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -declare function fromBig(n: bigint, le?: boolean): { - h: number; - l: number; -}; -declare function split(lst: bigint[], le?: boolean): Uint32Array[]; -declare const toBig: (h: number, l: number) => bigint; -declare const shrSH: (h: number, _l: number, s: number) => number; -declare const shrSL: (h: number, l: number, s: number) => number; -declare const rotrSH: (h: number, l: number, s: number) => number; -declare const rotrSL: (h: number, l: number, s: number) => number; -declare const rotrBH: (h: number, l: number, s: number) => number; -declare const rotrBL: (h: number, l: number, s: number) => number; -declare const rotr32H: (_h: number, l: number) => number; -declare const rotr32L: (h: number, _l: number) => number; -declare const rotlSH: (h: number, l: number, s: number) => number; -declare const rotlSL: (h: number, l: number, s: number) => number; -declare const rotlBH: (h: number, l: number, s: number) => number; -declare const rotlBL: (h: number, l: number, s: number) => number; -declare function add(Ah: number, Al: number, Bh: number, Bl: number): { - h: number; - l: number; -}; -declare const add3L: (Al: number, Bl: number, Cl: number) => number; -declare const add3H: (low: number, Ah: number, Bh: number, Ch: number) => number; -declare const add4L: (Al: number, Bl: number, Cl: number, Dl: number) => number; -declare const add4H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number) => number; -declare const add5L: (Al: number, Bl: number, Cl: number, Dl: number, El: number) => number; -declare const add5H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number, Eh: number) => number; -export { add, add3H, add3L, add4H, add4L, add5H, add5L, fromBig, rotlBH, rotlBL, rotlSH, rotlSL, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL, shrSH, shrSL, split, toBig }; -declare const u64: { - fromBig: typeof fromBig; - split: typeof split; - toBig: (h: number, l: number) => bigint; - shrSH: (h: number, _l: number, s: number) => number; - shrSL: (h: number, l: number, s: number) => number; - rotrSH: (h: number, l: number, s: number) => number; - rotrSL: (h: number, l: number, s: number) => number; - rotrBH: (h: number, l: number, s: number) => number; - rotrBL: (h: number, l: number, s: number) => number; - rotr32H: (_h: number, l: number) => number; - rotr32L: (h: number, _l: number) => number; - rotlSH: (h: number, l: number, s: number) => number; - rotlSL: (h: number, l: number, s: number) => number; - rotlBH: (h: number, l: number, s: number) => number; - rotlBL: (h: number, l: number, s: number) => number; - add: typeof add; - add3L: (Al: number, Bl: number, Cl: number) => number; - add3H: (low: number, Ah: number, Bh: number, Ch: number) => number; - add4L: (Al: number, Bl: number, Cl: number, Dl: number) => number; - add4H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number) => number; - add5H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number, Eh: number) => number; - add5L: (Al: number, Bl: number, Cl: number, Dl: number, El: number) => number; -}; -export default u64; -//# sourceMappingURL=_u64.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_u64.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_u64.d.ts.map deleted file mode 100644 index 211a4c69..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_u64.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_u64.d.ts","sourceRoot":"","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,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;CAOrpC,CAAC;AACF,eAAe,GAAG,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_u64.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_u64.js deleted file mode 100644 index 65193543..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_u64.js +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Internal helpers for u64. BigUint64Array is too slow as per 2025, so we implement it using Uint32Array. - * @todo re-check https://issues.chromium.org/issues/42212588 - * @module - */ -const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1); -const _32n = /* @__PURE__ */ BigInt(32); -function fromBig(n, le = false) { - if (le) - return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) }; - return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 }; -} -function split(lst, le = false) { - const len = lst.length; - let Ah = new Uint32Array(len); - let Al = new Uint32Array(len); - for (let i = 0; i < len; i++) { - const { h, l } = fromBig(lst[i], le); - [Ah[i], Al[i]] = [h, l]; - } - return [Ah, Al]; -} -const toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0); -// for Shift in [0, 32) -const shrSH = (h, _l, s) => h >>> s; -const shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); -// Right rotate for Shift in [1, 32) -const rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s)); -const rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); -// Right rotate for Shift in (32, 64), NOTE: 32 is special case. -const rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32)); -const rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s)); -// Right rotate for shift===32 (just swaps l&h) -const rotr32H = (_h, l) => l; -const rotr32L = (h, _l) => h; -// Left rotate for Shift in [1, 32) -const rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s)); -const rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s)); -// Left rotate for Shift in (32, 64), NOTE: 32 is special case. -const rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s)); -const rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s)); -// JS uses 32-bit signed integers for bitwise operations which means we cannot -// simple take carry out of low bit sum by shift, we need to use division. -function add(Ah, Al, Bh, Bl) { - const l = (Al >>> 0) + (Bl >>> 0); - return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 }; -} -// Addition with more than 2 elements -const add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); -const add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0; -const add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); -const add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0; -const add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); -const add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0; -// prettier-ignore -export { add, add3H, add3L, add4H, add4L, add5H, add5L, fromBig, rotlBH, rotlBL, rotlSH, rotlSL, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL, shrSH, shrSL, split, toBig }; -// prettier-ignore -const u64 = { - fromBig, split, toBig, - shrSH, shrSL, - rotrSH, rotrSL, rotrBH, rotrBL, - rotr32H, rotr32L, - rotlSH, rotlSL, rotlBH, rotlBL, - add, add3L, add3H, add4L, add4H, add5H, add5L, -}; -export default u64; -//# sourceMappingURL=_u64.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_u64.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_u64.js.map deleted file mode 100644 index 558394bd..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/_u64.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_u64.js","sourceRoot":"","sources":["src/_u64.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;AACvD,MAAM,IAAI,GAAG,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAExC,SAAS,OAAO,CACd,CAAS,EACT,EAAE,GAAG,KAAK;IAKV,IAAI,EAAE;QAAE,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,UAAU,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,UAAU,CAAC,EAAE,CAAC;IAClF,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;AACpF,CAAC;AAED,SAAS,KAAK,CAAC,GAAa,EAAE,EAAE,GAAG,KAAK;IACtC,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC;IACvB,IAAI,EAAE,GAAG,IAAI,WAAW,CAAC,GAAG,CAAC,CAAC;IAC9B,IAAI,EAAE,GAAG,IAAI,WAAW,CAAC,GAAG,CAAC,CAAC;IAC9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;QAC7B,MAAM,EAAE,CAAC,EAA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9C,CAAC;AACF,eAAe,GAAG,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/argon2.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/argon2.d.ts deleted file mode 100644 index 67cb8f6b..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/argon2.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { type KDFInput } from './utils.ts'; -/** - * Argon2 options. - * * t: time cost, m: mem cost in kb, p: parallelization. - * * key: optional key. personalization: arbitrary extra data. - * * dkLen: desired number of output bytes. - */ -export type ArgonOpts = { - t: number; - m: number; - p: number; - version?: number; - key?: KDFInput; - personalization?: KDFInput; - dkLen?: number; - asyncTick?: number; - maxmem?: number; - onProgress?: (progress: number) => void; -}; -/** argon2d GPU-resistant version. */ -export declare const argon2d: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Uint8Array; -/** argon2i side-channel-resistant version. */ -export declare const argon2i: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Uint8Array; -/** argon2id, combining i+d, the most popular version from RFC 9106 */ -export declare const argon2id: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Uint8Array; -/** argon2d async GPU-resistant version. */ -export declare const argon2dAsync: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Promise; -/** argon2i async side-channel-resistant version. */ -export declare const argon2iAsync: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Promise; -/** argon2id async, combining i+d, the most popular version from RFC 9106 */ -export declare const argon2idAsync: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Promise; -//# sourceMappingURL=argon2.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/argon2.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/argon2.d.ts.map deleted file mode 100644 index 9d1bbbf6..00000000 --- a/tools/mnemonic-test/node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ACxE,4EAA4E;AAC5E,eAAO,MAAM,aAAa,GACxB,UAAU,QAAQ,EAClB,MAAM,QAAQ,EACd,MAAM,SAAS,KACd,OAAO,CAAC,UAAU,CAAmD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/argon2.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/argon2.js deleted file mode 100644 index eb8f3132..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/argon2.js +++ /dev/null @@ -1,391 +0,0 @@ -/** - * Argon2 KDF from RFC 9106. Can be used to create a key from password and salt. - * We suggest to use Scrypt. JS Argon is 2-10x slower than native code because of 64-bitness: - * * argon uses uint64, but JS doesn't have fast uint64array - * * uint64 multiplication is 1/3 of time - * * `P` function would be very nice with u64, because most of value will be in registers, - * hovewer with u32 it will require 32 registers, which is too much. - * * JS arrays do slow bound checks, so reading from `A2_BUF` slows it down - * @module - */ -import { add3H, add3L, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL } from "./_u64.js"; -import { blake2b } from "./blake2.js"; -import { anumber, clean, kdfInputToBytes, nextTick, u32, u8 } from "./utils.js"; -const AT = { Argond2d: 0, Argon2i: 1, Argon2id: 2 }; -const ARGON2_SYNC_POINTS = 4; -const abytesOrZero = (buf, errorTitle = '') => { - if (buf === undefined) - return Uint8Array.of(); - return kdfInputToBytes(buf, errorTitle); -}; -// u32 * u32 = u64 -function mul(a, b) { - const aL = a & 0xffff; - const aH = a >>> 16; - const bL = b & 0xffff; - const bH = b >>> 16; - const ll = Math.imul(aL, bL); - const hl = Math.imul(aH, bL); - const lh = Math.imul(aL, bH); - const hh = Math.imul(aH, bH); - const carry = (ll >>> 16) + (hl & 0xffff) + lh; - const high = (hh + (hl >>> 16) + (carry >>> 16)) | 0; - const low = (carry << 16) | (ll & 0xffff); - return { h: high, l: low }; -} -function mul2(a, b) { - // 2 * a * b (via shifts) - const { h, l } = mul(a, b); - return { h: ((h << 1) | (l >>> 31)) & 0xffff_ffff, l: (l << 1) & 0xffff_ffff }; -} -// BlaMka permutation for Argon2 -// A + B + (2 * u32(A) * u32(B)) -function blamka(Ah, Al, Bh, Bl) { - const { h: Ch, l: Cl } = mul2(Al, Bl); - // A + B + (2 * A * B) - const Rll = add3L(Al, Bl, Cl); - return { h: add3H(Rll, Ah, Bh, Ch), l: Rll | 0 }; -} -// Temporary block buffer -const A2_BUF = new Uint32Array(256); // 1024 bytes (matrix 16x16) -function G(a, b, c, d) { - let Al = A2_BUF[2 * a], Ah = A2_BUF[2 * a + 1]; // prettier-ignore - let Bl = A2_BUF[2 * b], Bh = A2_BUF[2 * b + 1]; // prettier-ignore - let Cl = A2_BUF[2 * c], Ch = A2_BUF[2 * c + 1]; // prettier-ignore - let Dl = A2_BUF[2 * d], Dh = A2_BUF[2 * d + 1]; // prettier-ignore - ({ h: Ah, l: Al } = blamka(Ah, Al, Bh, Bl)); - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: rotr32H(Dh, Dl), Dl: rotr32L(Dh, Dl) }); - ({ h: Ch, l: Cl } = blamka(Ch, Cl, Dh, Dl)); - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: rotrSH(Bh, Bl, 24), Bl: rotrSL(Bh, Bl, 24) }); - ({ h: Ah, l: Al } = blamka(Ah, Al, Bh, Bl)); - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: rotrSH(Dh, Dl, 16), Dl: rotrSL(Dh, Dl, 16) }); - ({ h: Ch, l: Cl } = blamka(Ch, Cl, Dh, Dl)); - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: rotrBH(Bh, Bl, 63), Bl: rotrBL(Bh, Bl, 63) }); - ((A2_BUF[2 * a] = Al), (A2_BUF[2 * a + 1] = Ah)); - ((A2_BUF[2 * b] = Bl), (A2_BUF[2 * b + 1] = Bh)); - ((A2_BUF[2 * c] = Cl), (A2_BUF[2 * c + 1] = Ch)); - ((A2_BUF[2 * d] = Dl), (A2_BUF[2 * d + 1] = Dh)); -} -// prettier-ignore -function P(v00, v01, v02, v03, v04, v05, v06, v07, v08, v09, v10, v11, v12, v13, v14, v15) { - G(v00, v04, v08, v12); - G(v01, v05, v09, v13); - G(v02, v06, v10, v14); - G(v03, v07, v11, v15); - G(v00, v05, v10, v15); - G(v01, v06, v11, v12); - G(v02, v07, v08, v13); - G(v03, v04, v09, v14); -} -function block(x, xPos, yPos, outPos, needXor) { - for (let i = 0; i < 256; i++) - A2_BUF[i] = x[xPos + i] ^ x[yPos + i]; - // columns (8) - for (let i = 0; i < 128; i += 16) { - // prettier-ignore - P(i, i + 1, i + 2, i + 3, i + 4, i + 5, i + 6, i + 7, i + 8, i + 9, i + 10, i + 11, i + 12, i + 13, i + 14, i + 15); - } - // rows (8) - for (let i = 0; i < 16; i += 2) { - // prettier-ignore - P(i, i + 1, i + 16, i + 17, i + 32, i + 33, i + 48, i + 49, i + 64, i + 65, i + 80, i + 81, i + 96, i + 97, i + 112, i + 113); - } - if (needXor) - for (let i = 0; i < 256; i++) - x[outPos + i] ^= A2_BUF[i] ^ x[xPos + i] ^ x[yPos + i]; - else - for (let i = 0; i < 256; i++) - x[outPos + i] = A2_BUF[i] ^ x[xPos + i] ^ x[yPos + i]; - clean(A2_BUF); -} -// Variable-Length Hash Function H' -function Hp(A, dkLen) { - const A8 = u8(A); - const T = new Uint32Array(1); - const T8 = u8(T); - T[0] = dkLen; - // Fast path - if (dkLen <= 64) - return blake2b.create({ dkLen }).update(T8).update(A8).digest(); - const out = new Uint8Array(dkLen); - let V = blake2b.create({}).update(T8).update(A8).digest(); - let pos = 0; - // First block - out.set(V.subarray(0, 32)); - pos += 32; - // Rest blocks - for (; dkLen - pos > 64; pos += 32) { - const Vh = blake2b.create({}).update(V); - Vh.digestInto(V); - Vh.destroy(); - out.set(V.subarray(0, 32), pos); - } - // Last block - out.set(blake2b(V, { dkLen: dkLen - pos }), pos); - clean(V, T); - return u32(out); -} -// Used only inside process block! -function indexAlpha(r, s, laneLen, segmentLen, index, randL, sameLane = false) { - // This is ugly, but close enough to reference implementation. - let area; - if (r === 0) { - if (s === 0) - area = index - 1; - else if (sameLane) - area = s * segmentLen + index - 1; - else - area = s * segmentLen + (index == 0 ? -1 : 0); - } - else if (sameLane) - area = laneLen - segmentLen + index - 1; - else - area = laneLen - segmentLen + (index == 0 ? -1 : 0); - const startPos = r !== 0 && s !== ARGON2_SYNC_POINTS - 1 ? (s + 1) * segmentLen : 0; - const rel = area - 1 - mul(area, mul(randL, randL).h).h; - return (startPos + rel) % laneLen; -} -const maxUint32 = Math.pow(2, 32); -function isU32(num) { - return Number.isSafeInteger(num) && num >= 0 && num < maxUint32; -} -function argon2Opts(opts) { - const merged = { - version: 0x13, - dkLen: 32, - maxmem: maxUint32 - 1, - asyncTick: 10, - }; - for (let [k, v] of Object.entries(opts)) - if (v !== undefined) - merged[k] = v; - const { dkLen, p, m, t, version, onProgress, asyncTick } = merged; - if (!isU32(dkLen) || dkLen < 4) - throw new Error('"dkLen" must be 4..'); - if (!isU32(p) || p < 1 || p >= Math.pow(2, 24)) - throw new Error('"p" must be 1..2^24'); - if (!isU32(m)) - throw new Error('"m" must be 0..2^32'); - if (!isU32(t) || t < 1) - throw new Error('"t" (iterations) must be 1..2^32'); - if (onProgress !== undefined && typeof onProgress !== 'function') - throw new Error('"progressCb" must be a function'); - anumber(asyncTick, 'asyncTick'); - /* - Memory size m MUST be an integer number of kibibytes from 8*p to 2^(32)-1. The actual number of blocks is m', which is m rounded down to the nearest multiple of 4*p. - */ - if (!isU32(m) || m < 8 * p) - throw new Error('"m" (memory) must be at least 8*p bytes'); - if (version !== 0x10 && version !== 0x13) - throw new Error('"version" must be 0x10 or 0x13, got ' + version); - return merged; -} -function argon2Init(password, salt, type, opts) { - password = kdfInputToBytes(password, 'password'); - salt = kdfInputToBytes(salt, 'salt'); - if (!isU32(password.length)) - throw new Error('"password" must be less of length 1..4Gb'); - if (!isU32(salt.length) || salt.length < 8) - throw new Error('"salt" must be of length 8..4Gb'); - if (!Object.values(AT).includes(type)) - throw new Error('"type" was invalid'); - let { p, dkLen, m, t, version, key, personalization, maxmem, onProgress, asyncTick } = argon2Opts(opts); - // Validation - key = abytesOrZero(key, 'key'); - personalization = abytesOrZero(personalization, 'personalization'); - // H_0 = H^(64)(LE32(p) || LE32(T) || LE32(m) || LE32(t) || - // LE32(v) || LE32(y) || LE32(length(P)) || P || - // LE32(length(S)) || S || LE32(length(K)) || K || - // LE32(length(X)) || X) - const h = blake2b.create(); - const BUF = new Uint32Array(1); - const BUF8 = u8(BUF); - for (let item of [p, dkLen, m, t, version, type]) { - BUF[0] = item; - h.update(BUF8); - } - for (let i of [password, salt, key, personalization]) { - BUF[0] = i.length; // BUF is u32 array, this is valid - h.update(BUF8).update(i); - } - const H0 = new Uint32Array(18); - const H0_8 = u8(H0); - h.digestInto(H0_8); - // 256 u32 = 1024 (BLOCK_SIZE), fills A2_BUF on processing - // Params - const lanes = p; - // m' = 4 * p * floor (m / 4p) - const mP = 4 * p * Math.floor(m / (ARGON2_SYNC_POINTS * p)); - //q = m' / p columns - const laneLen = Math.floor(mP / p); - const segmentLen = Math.floor(laneLen / ARGON2_SYNC_POINTS); - const memUsed = mP * 256; - if (!isU32(maxmem) || memUsed > maxmem) - throw new Error('"maxmem" expected <2**32, got: maxmem=' + maxmem + ', memused=' + memUsed); - const B = new Uint32Array(memUsed); - // Fill first blocks - for (let l = 0; l < p; l++) { - const i = 256 * laneLen * l; - // B[i][0] = H'^(1024)(H_0 || LE32(0) || LE32(i)) - H0[17] = l; - H0[16] = 0; - B.set(Hp(H0, 1024), i); - // B[i][1] = H'^(1024)(H_0 || LE32(1) || LE32(i)) - H0[16] = 1; - B.set(Hp(H0, 1024), i + 256); - } - let perBlock = () => { }; - if (onProgress) { - const totalBlock = t * ARGON2_SYNC_POINTS * p * segmentLen; - // Invoke callback if progress changes from 10.01 to 10.02 - // Allows to draw smooth progress bar on up to 8K screen - const callbackPer = Math.max(Math.floor(totalBlock / 10000), 1); - let blockCnt = 0; - perBlock = () => { - blockCnt++; - if (onProgress && (!(blockCnt % callbackPer) || blockCnt === totalBlock)) - onProgress(blockCnt / totalBlock); - }; - } - clean(BUF, H0); - return { type, mP, p, t, version, B, laneLen, lanes, segmentLen, dkLen, perBlock, asyncTick }; -} -function argon2Output(B, p, laneLen, dkLen) { - const B_final = new Uint32Array(256); - for (let l = 0; l < p; l++) - for (let j = 0; j < 256; j++) - B_final[j] ^= B[256 * (laneLen * l + laneLen - 1) + j]; - const res = u8(Hp(B_final, dkLen)); - clean(B_final); - return res; -} -function processBlock(B, address, l, r, s, index, laneLen, segmentLen, lanes, offset, prev, dataIndependent, needXor) { - if (offset % laneLen) - prev = offset - 1; - let randL, randH; - if (dataIndependent) { - let i128 = index % 128; - if (i128 === 0) { - address[256 + 12]++; - block(address, 256, 2 * 256, 0, false); - block(address, 0, 2 * 256, 0, false); - } - randL = address[2 * i128]; - randH = address[2 * i128 + 1]; - } - else { - const T = 256 * prev; - randL = B[T]; - randH = B[T + 1]; - } - // address block - const refLane = r === 0 && s === 0 ? l : randH % lanes; - const refPos = indexAlpha(r, s, laneLen, segmentLen, index, randL, refLane == l); - const refBlock = laneLen * refLane + refPos; - // B[i][j] = G(B[i][j-1], B[l][z]) - block(B, 256 * prev, 256 * refBlock, offset * 256, needXor); -} -function argon2(type, password, salt, opts) { - const { mP, p, t, version, B, laneLen, lanes, segmentLen, dkLen, perBlock } = argon2Init(password, salt, type, opts); - // Pre-loop setup - // [address, input, zero_block] format so we can pass single U32 to block function - const address = new Uint32Array(3 * 256); - address[256 + 6] = mP; - address[256 + 8] = t; - address[256 + 10] = type; - for (let r = 0; r < t; r++) { - const needXor = r !== 0 && version === 0x13; - address[256 + 0] = r; - for (let s = 0; s < ARGON2_SYNC_POINTS; s++) { - address[256 + 4] = s; - const dataIndependent = type == AT.Argon2i || (type == AT.Argon2id && r === 0 && s < 2); - for (let l = 0; l < p; l++) { - address[256 + 2] = l; - address[256 + 12] = 0; - let startPos = 0; - if (r === 0 && s === 0) { - startPos = 2; - if (dataIndependent) { - address[256 + 12]++; - block(address, 256, 2 * 256, 0, false); - block(address, 0, 2 * 256, 0, false); - } - } - // current block postion - let offset = l * laneLen + s * segmentLen + startPos; - // previous block position - let prev = offset % laneLen ? offset - 1 : offset + laneLen - 1; - for (let index = startPos; index < segmentLen; index++, offset++, prev++) { - perBlock(); - processBlock(B, address, l, r, s, index, laneLen, segmentLen, lanes, offset, prev, dataIndependent, needXor); - } - } - } - } - clean(address); - return argon2Output(B, p, laneLen, dkLen); -} -/** argon2d GPU-resistant version. */ -export const argon2d = (password, salt, opts) => argon2(AT.Argond2d, password, salt, opts); -/** argon2i side-channel-resistant version. */ -export const argon2i = (password, salt, opts) => argon2(AT.Argon2i, password, salt, opts); -/** argon2id, combining i+d, the most popular version from RFC 9106 */ -export const argon2id = (password, salt, opts) => argon2(AT.Argon2id, password, salt, opts); -async function argon2Async(type, password, salt, opts) { - const { mP, p, t, version, B, laneLen, lanes, segmentLen, dkLen, perBlock, asyncTick } = argon2Init(password, salt, type, opts); - // Pre-loop setup - // [address, input, zero_block] format so we can pass single U32 to block function - const address = new Uint32Array(3 * 256); - address[256 + 6] = mP; - address[256 + 8] = t; - address[256 + 10] = type; - let ts = Date.now(); - for (let r = 0; r < t; r++) { - const needXor = r !== 0 && version === 0x13; - address[256 + 0] = r; - for (let s = 0; s < ARGON2_SYNC_POINTS; s++) { - address[256 + 4] = s; - const dataIndependent = type == AT.Argon2i || (type == AT.Argon2id && r === 0 && s < 2); - for (let l = 0; l < p; l++) { - address[256 + 2] = l; - address[256 + 12] = 0; - let startPos = 0; - if (r === 0 && s === 0) { - startPos = 2; - if (dataIndependent) { - address[256 + 12]++; - block(address, 256, 2 * 256, 0, false); - block(address, 0, 2 * 256, 0, false); - } - } - // current block postion - let offset = l * laneLen + s * segmentLen + startPos; - // previous block position - let prev = offset % laneLen ? offset - 1 : offset + laneLen - 1; - for (let index = startPos; index < segmentLen; index++, offset++, prev++) { - perBlock(); - processBlock(B, address, l, r, s, index, laneLen, segmentLen, lanes, offset, prev, dataIndependent, needXor); - // Date.now() is not monotonic, so in case if clock goes backwards we return return control too - const diff = Date.now() - ts; - if (!(diff >= 0 && diff < asyncTick)) { - await nextTick(); - ts += diff; - } - } - } - } - } - clean(address); - return argon2Output(B, p, laneLen, dkLen); -} -/** argon2d async GPU-resistant version. */ -export const argon2dAsync = (password, salt, opts) => argon2Async(AT.Argond2d, password, salt, opts); -/** argon2i async side-channel-resistant version. */ -export const argon2iAsync = (password, salt, opts) => argon2Async(AT.Argon2i, password, salt, opts); -/** argon2id async, combining i+d, the most popular version from RFC 9106 */ -export const argon2idAsync = (password, salt, opts) => argon2Async(AT.Argon2id, password, salt, opts); -//# sourceMappingURL=argon2.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/argon2.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/argon2.js.map deleted file mode 100644 index 5620e5cc..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/argon2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"argon2.js","sourceRoot":"","sources":["src/argon2.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC3F,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE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IAAI,EAAE,IAAI,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/blake1.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/blake1.d.ts deleted file mode 100644 index 08af340a..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/blake1.d.ts +++ /dev/null @@ -1,110 +0,0 @@ -import { type CHash, type Hash } from './utils.ts'; -/** Blake1 options. Basically just "salt" */ -export type BlakeOpts = { - salt?: Uint8Array; -}; -declare abstract class BLAKE1> implements Hash { - protected finished: boolean; - protected length: number; - protected pos: number; - protected destroyed: boolean; - protected buffer: Uint8Array; - protected view: DataView; - protected salt: Uint32Array; - abstract compress(view: DataView, offset: number, withLength?: boolean): void; - protected abstract get(): number[]; - protected abstract set(...args: number[]): void; - readonly blockLen: number; - readonly outputLen: number; - private lengthFlag; - private counterLen; - protected constants: Uint32Array; - constructor(blockLen: number, outputLen: number, lengthFlag: number, counterLen: number, saltLen: number, constants: Uint32Array, opts?: BlakeOpts); - update(data: Uint8Array): this; - destroy(): void; - _cloneInto(to?: T): T; - clone(): T; - digestInto(out: Uint8Array): void; - digest(): Uint8Array; -} -declare class BLAKE1_32B extends BLAKE1 { - private v0; - private v1; - private v2; - private v3; - private v4; - private v5; - private v6; - private v7; - constructor(outputLen: number, IV: Uint32Array, lengthFlag: number, opts?: BlakeOpts); - protected get(): [number, number, number, number, number, number, number, number]; - protected set(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number): void; - destroy(): void; - compress(view: DataView, offset: number, withLength?: boolean): void; -} -declare class BLAKE1_64B extends BLAKE1 { - private v0l; - private v0h; - private v1l; - private v1h; - private v2l; - private v2h; - private v3l; - private v3h; - private v4l; - private v4h; - private v5l; - private v5h; - private v6l; - private v6h; - private v7l; - private v7h; - constructor(outputLen: number, IV: Uint32Array, lengthFlag: number, opts?: BlakeOpts); - protected get(): [ - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number - ]; - protected set(v0l: number, v0h: number, v1l: number, v1h: number, v2l: number, v2h: number, v3l: number, v3h: number, v4l: number, v4h: number, v5l: number, v5h: number, v6l: number, v6h: number, v7l: number, v7h: number): void; - destroy(): void; - compress(view: DataView, offset: number, withLength?: boolean): void; -} -/** Internal blake1-224 hash class. */ -export declare class _BLAKE224 extends BLAKE1_32B { - constructor(opts?: BlakeOpts); -} -/** Internal blake1-256 hash class. */ -export declare class _BLAKE256 extends BLAKE1_32B { - constructor(opts?: BlakeOpts); -} -/** Internal blake1-384 hash class. */ -export declare class _BLAKE384 extends BLAKE1_64B { - constructor(opts?: BlakeOpts); -} -/** Internal blake1-512 hash class. */ -export declare class _BLAKE512 extends BLAKE1_64B { - constructor(opts?: BlakeOpts); -} -/** blake1-224 hash function */ -export declare const blake224: CHash<_BLAKE224, BlakeOpts>; -/** blake1-256 hash function */ -export declare const blake256: CHash<_BLAKE256, BlakeOpts>; -/** blake1-384 hash function */ -export declare const blake384: CHash<_BLAKE384, BlakeOpts>; -/** blake1-512 hash function */ -export declare const blake512: CHash<_BLAKE512, BlakeOpts>; -export {}; -//# sourceMappingURL=blake1.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/blake1.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/blake1.d.ts.map deleted file mode 100644 index be0fe262..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/blake1.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blake1.d.ts","sourceRoot":"","sources":["src/blake1.ts"],"names":[],"mappings":"AA4BA,OAAO,EAIL,KAAK,KAAK,EACV,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAEpB,4CAA4C;AAC5C,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,CAAC,EAAE,UAAU,CAAC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SAAU,SAAQ,UAAU;gBAC3B,IAAI,GAAE,SAAc;CAGjC;AACD,sCAAsC;AACtC,qBAAa,SAAU,SAAQ,UAAU;gBAC3B,IAAI,GAAE,SAAc;CAGjC;AACD,+BAA+B;AAC/B,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,SAAS,EAAE,SAAS,CAEhD,CAAC;AACF,+BAA+B;AAC/B,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,SAAS,EAAE,SAAS,CAEhD,CAAC;AACF,+BAA+B;AAC/B,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,SAAS,EAAE,SAAS,CAEhD,CAAC;AACF,+BAA+B;AAC/B,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,SAAS,EAAE,SAAS,CAEhD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/blake1.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/blake1.js deleted file mode 100644 index 1472b71d..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/blake1.js +++ /dev/null @@ -1,485 +0,0 @@ -/** - * Blake1 legacy hash function, one of SHA3 proposals. - * Rarely used. Check out blake2 or blake3 instead. - * https://www.aumasson.jp/blake/blake.pdf - * - * In the best case, there are 0 allocations. - * - * Differences from blake2: - * - * - BE instead of LE - * - Paddings, similar to MD5, RIPEMD, SHA1, SHA2, but: - * - length flag is located before actual length - * - padding block is compressed differently (no lengths) - * Instead of msg[sigma[k]], we have `msg[sigma[k]] ^ constants[sigma[k-1]]` - * (-1 for g1, g2 without -1) - * - Salt is XOR-ed into constants instead of state - * - Salt is XOR-ed with output in `compress` - * - Additional rows (+64 bytes) in SIGMA for new rounds - * - Different round count: - * - 14 / 10 rounds in blake256 / blake2s - * - 16 / 12 rounds in blake512 / blake2b - * - blake512: G1b: rotr 24 -> 25, G2b: rotr 63 -> 11 - * @module - */ -import { BSIGMA, G1s, G2s } from "./_blake.js"; -import { SHA224_IV, SHA256_IV, SHA384_IV, SHA512_IV } from "./_md.js"; -import * as u64 from "./_u64.js"; -// prettier-ignore -import { abytes, aexists, aoutput, clean, createHasher, createView } from "./utils.js"; -// Empty zero-filled salt -const EMPTY_SALT = /* @__PURE__ */ new Uint32Array(8); -class BLAKE1 { - finished = false; - length = 0; - pos = 0; - destroyed = false; - // For partial updates less than block size - buffer; - view; - salt; - blockLen; - outputLen; - lengthFlag; - counterLen; - constants; - constructor(blockLen, outputLen, lengthFlag, counterLen, saltLen, constants, opts = {}) { - const { salt } = opts; - this.blockLen = blockLen; - this.outputLen = outputLen; - this.lengthFlag = lengthFlag; - this.counterLen = counterLen; - this.buffer = new Uint8Array(blockLen); - this.view = createView(this.buffer); - if (salt !== undefined) { - let slt = salt; - abytes(slt, 4 * saltLen, 'salt'); - // if (slt.length !== 4 * saltLen) throw new Error('wrong salt length'); - const salt32 = (this.salt = new Uint32Array(saltLen)); - const sv = createView(slt); - this.constants = constants.slice(); - for (let i = 0, offset = 0; i < salt32.length; i++, offset += 4) { - salt32[i] = sv.getUint32(offset, false); - this.constants[i] ^= salt32[i]; - } - } - else { - this.salt = EMPTY_SALT; - this.constants = constants; - } - } - update(data) { - aexists(this); - abytes(data); - // From _md, but update length before each compress - const { view, buffer, blockLen } = this; - const len = data.length; - let dataView; - for (let pos = 0; pos < len;) { - const take = Math.min(blockLen - this.pos, len - pos); - // Fast path: we have at least one block in input, cast it to view and process - if (take === blockLen) { - if (!dataView) - dataView = createView(data); - for (; blockLen <= len - pos; pos += blockLen) { - this.length += blockLen; - this.compress(dataView, pos); - } - continue; - } - buffer.set(data.subarray(pos, pos + take), this.pos); - this.pos += take; - pos += take; - if (this.pos === blockLen) { - this.length += blockLen; - this.compress(view, 0, true); - this.pos = 0; - } - } - return this; - } - destroy() { - this.destroyed = true; - if (this.salt !== EMPTY_SALT) { - clean(this.salt, this.constants); - } - } - _cloneInto(to) { - to ||= new this.constructor(); - to.set(...this.get()); - const { buffer, length, finished, destroyed, constants, salt, pos } = this; - to.buffer.set(buffer); - to.constants = constants.slice(); - to.destroyed = destroyed; - to.finished = finished; - to.length = length; - to.pos = pos; - to.salt = salt.slice(); - return to; - } - clone() { - return this._cloneInto(); - } - digestInto(out) { - aexists(this); - aoutput(out, this); - this.finished = true; - // Padding - const { buffer, blockLen, counterLen, lengthFlag, view } = this; - clean(buffer.subarray(this.pos)); // clean buf - const counter = BigInt((this.length + this.pos) * 8); - const counterPos = blockLen - counterLen - 1; - buffer[this.pos] |= 0b1000_0000; // End block flag - this.length += this.pos; // add unwritten length - // Not enough in buffer for length: write what we have. - if (this.pos > counterPos) { - this.compress(view, 0); - clean(buffer); - this.pos = 0; - } - // Difference with md: here we have lengthFlag! - buffer[counterPos] |= lengthFlag; // Length flag - // We always set 8 byte length flag. Because length will overflow significantly sooner. - view.setBigUint64(blockLen - 8, counter, false); - this.compress(view, 0, this.pos !== 0); // don't add length if length is not empty block? - // Write output - clean(buffer); - const v = createView(out); - const state = this.get(); - for (let i = 0; i < this.outputLen / 4; ++i) - v.setUint32(i * 4, state[i]); - } - digest() { - const { buffer, outputLen } = this; - this.digestInto(buffer); - const res = buffer.slice(0, outputLen); - this.destroy(); - return res; - } -} -// Constants -const B64C = /* @__PURE__ */ Uint32Array.from([ - 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, - 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, - 0x9216d5d9, 0x8979fb1b, 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96, - 0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, 0x636920d8, 0x71574e69, -]); -// first half of C512 -const B32C = B64C.slice(0, 16); -const B256_IV = /* @__PURE__ */ SHA256_IV.slice(); -const B224_IV = /* @__PURE__ */ SHA224_IV.slice(); -const B384_IV = /* @__PURE__ */ SHA384_IV.slice(); -const B512_IV = /* @__PURE__ */ SHA512_IV.slice(); -function generateTBL256() { - const TBL = []; - for (let i = 0, j = 0; i < 14; i++, j += 16) { - for (let offset = 1; offset < 16; offset += 2) { - TBL.push(B32C[BSIGMA[j + offset]]); - TBL.push(B32C[BSIGMA[j + offset - 1]]); - } - } - return new Uint32Array(TBL); -} -const TBL256 = /* @__PURE__ */ generateTBL256(); // C256[SIGMA[X]] precompute -// Reusable temporary buffer -const BLAKE256_W = /* @__PURE__ */ new Uint32Array(16); -class BLAKE1_32B extends BLAKE1 { - v0; - v1; - v2; - v3; - v4; - v5; - v6; - v7; - constructor(outputLen, IV, lengthFlag, opts = {}) { - super(64, outputLen, lengthFlag, 8, 4, B32C, opts); - this.v0 = IV[0] | 0; - this.v1 = IV[1] | 0; - this.v2 = IV[2] | 0; - this.v3 = IV[3] | 0; - this.v4 = IV[4] | 0; - this.v5 = IV[5] | 0; - this.v6 = IV[6] | 0; - this.v7 = IV[7] | 0; - } - get() { - const { v0, v1, v2, v3, v4, v5, v6, v7 } = this; - return [v0, v1, v2, v3, v4, v5, v6, v7]; - } - // prettier-ignore - set(v0, v1, v2, v3, v4, v5, v6, v7) { - this.v0 = v0 | 0; - this.v1 = v1 | 0; - this.v2 = v2 | 0; - this.v3 = v3 | 0; - this.v4 = v4 | 0; - this.v5 = v5 | 0; - this.v6 = v6 | 0; - this.v7 = v7 | 0; - } - destroy() { - super.destroy(); - this.set(0, 0, 0, 0, 0, 0, 0, 0); - } - compress(view, offset, withLength = true) { - for (let i = 0; i < 16; i++, offset += 4) - BLAKE256_W[i] = view.getUint32(offset, false); - // NOTE: we cannot re-use compress from blake2s, since there is additional xor over u256[SIGMA[e]] - let v00 = this.v0 | 0; - let v01 = this.v1 | 0; - let v02 = this.v2 | 0; - let v03 = this.v3 | 0; - let v04 = this.v4 | 0; - let v05 = this.v5 | 0; - let v06 = this.v6 | 0; - let v07 = this.v7 | 0; - let v08 = this.constants[0] | 0; - let v09 = this.constants[1] | 0; - let v10 = this.constants[2] | 0; - let v11 = this.constants[3] | 0; - const { h, l } = u64.fromBig(BigInt(withLength ? this.length * 8 : 0)); - let v12 = (this.constants[4] ^ l) >>> 0; - let v13 = (this.constants[5] ^ l) >>> 0; - let v14 = (this.constants[6] ^ h) >>> 0; - let v15 = (this.constants[7] ^ h) >>> 0; - // prettier-ignore - for (let i = 0, k = 0, j = 0; i < 14; i++) { - ({ a: v00, b: v04, c: v08, d: v12 } = G1s(v00, v04, v08, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v00, b: v04, c: v08, d: v12 } = G2s(v00, v04, v08, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v01, b: v05, c: v09, d: v13 } = G1s(v01, v05, v09, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v01, b: v05, c: v09, d: v13 } = G2s(v01, v05, v09, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v02, b: v06, c: v10, d: v14 } = G1s(v02, v06, v10, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v02, b: v06, c: v10, d: v14 } = G2s(v02, v06, v10, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v03, b: v07, c: v11, d: v15 } = G1s(v03, v07, v11, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v03, b: v07, c: v11, d: v15 } = G2s(v03, v07, v11, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v00, b: v05, c: v10, d: v15 } = G1s(v00, v05, v10, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v00, b: v05, c: v10, d: v15 } = G2s(v00, v05, v10, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v01, b: v06, c: v11, d: v12 } = G1s(v01, v06, v11, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v01, b: v06, c: v11, d: v12 } = G2s(v01, v06, v11, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v02, b: v07, c: v08, d: v13 } = G1s(v02, v07, v08, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v02, b: v07, c: v08, d: v13 } = G2s(v02, v07, v08, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v03, b: v04, c: v09, d: v14 } = G1s(v03, v04, v09, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v03, b: v04, c: v09, d: v14 } = G2s(v03, v04, v09, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - } - this.v0 = (this.v0 ^ v00 ^ v08 ^ this.salt[0]) >>> 0; - this.v1 = (this.v1 ^ v01 ^ v09 ^ this.salt[1]) >>> 0; - this.v2 = (this.v2 ^ v02 ^ v10 ^ this.salt[2]) >>> 0; - this.v3 = (this.v3 ^ v03 ^ v11 ^ this.salt[3]) >>> 0; - this.v4 = (this.v4 ^ v04 ^ v12 ^ this.salt[0]) >>> 0; - this.v5 = (this.v5 ^ v05 ^ v13 ^ this.salt[1]) >>> 0; - this.v6 = (this.v6 ^ v06 ^ v14 ^ this.salt[2]) >>> 0; - this.v7 = (this.v7 ^ v07 ^ v15 ^ this.salt[3]) >>> 0; - clean(BLAKE256_W); - } -} -const BBUF = /* @__PURE__ */ new Uint32Array(32); -const BLAKE512_W = /* @__PURE__ */ new Uint32Array(32); -function generateTBL512() { - const TBL = []; - for (let r = 0, k = 0; r < 16; r++, k += 16) { - for (let offset = 1; offset < 16; offset += 2) { - TBL.push(B64C[BSIGMA[k + offset] * 2 + 0]); - TBL.push(B64C[BSIGMA[k + offset] * 2 + 1]); - TBL.push(B64C[BSIGMA[k + offset - 1] * 2 + 0]); - TBL.push(B64C[BSIGMA[k + offset - 1] * 2 + 1]); - } - } - return new Uint32Array(TBL); -} -const TBL512 = /* @__PURE__ */ generateTBL512(); // C512[SIGMA[X]] precompute -// Mixing function G splitted in two halfs -function G1b(a, b, c, d, msg, k) { - const Xpos = 2 * BSIGMA[k]; - const Xl = msg[Xpos + 1] ^ TBL512[k * 2 + 1], Xh = msg[Xpos] ^ TBL512[k * 2]; // prettier-ignore - let Al = BBUF[2 * a + 1], Ah = BBUF[2 * a]; // prettier-ignore - let Bl = BBUF[2 * b + 1], Bh = BBUF[2 * b]; // prettier-ignore - let Cl = BBUF[2 * c + 1], Ch = BBUF[2 * c]; // prettier-ignore - let Dl = BBUF[2 * d + 1], Dh = BBUF[2 * d]; // prettier-ignore - // v[a] = (v[a] + v[b] + x) | 0; - let ll = u64.add3L(Al, Bl, Xl); - Ah = u64.add3H(ll, Ah, Bh, Xh) >>> 0; - Al = (ll | 0) >>> 0; - // v[d] = rotr(v[d] ^ v[a], 32) - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: u64.rotr32H(Dh, Dl), Dl: u64.rotr32L(Dh, Dl) }); - // v[c] = (v[c] + v[d]) | 0; - ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); - // v[b] = rotr(v[b] ^ v[c], 25) - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: u64.rotrSH(Bh, Bl, 25), Bl: u64.rotrSL(Bh, Bl, 25) }); - ((BBUF[2 * a + 1] = Al), (BBUF[2 * a] = Ah)); - ((BBUF[2 * b + 1] = Bl), (BBUF[2 * b] = Bh)); - ((BBUF[2 * c + 1] = Cl), (BBUF[2 * c] = Ch)); - ((BBUF[2 * d + 1] = Dl), (BBUF[2 * d] = Dh)); -} -function G2b(a, b, c, d, msg, k) { - const Xpos = 2 * BSIGMA[k]; - const Xl = msg[Xpos + 1] ^ TBL512[k * 2 + 1], Xh = msg[Xpos] ^ TBL512[k * 2]; // prettier-ignore - let Al = BBUF[2 * a + 1], Ah = BBUF[2 * a]; // prettier-ignore - let Bl = BBUF[2 * b + 1], Bh = BBUF[2 * b]; // prettier-ignore - let Cl = BBUF[2 * c + 1], Ch = BBUF[2 * c]; // prettier-ignore - let Dl = BBUF[2 * d + 1], Dh = BBUF[2 * d]; // prettier-ignore - // v[a] = (v[a] + v[b] + x) | 0; - let ll = u64.add3L(Al, Bl, Xl); - Ah = u64.add3H(ll, Ah, Bh, Xh); - Al = ll | 0; - // v[d] = rotr(v[d] ^ v[a], 16) - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: u64.rotrSH(Dh, Dl, 16), Dl: u64.rotrSL(Dh, Dl, 16) }); - // v[c] = (v[c] + v[d]) | 0; - ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); - // v[b] = rotr(v[b] ^ v[c], 11) - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: u64.rotrSH(Bh, Bl, 11), Bl: u64.rotrSL(Bh, Bl, 11) }); - ((BBUF[2 * a + 1] = Al), (BBUF[2 * a] = Ah)); - ((BBUF[2 * b + 1] = Bl), (BBUF[2 * b] = Bh)); - ((BBUF[2 * c + 1] = Cl), (BBUF[2 * c] = Ch)); - ((BBUF[2 * d + 1] = Dl), (BBUF[2 * d] = Dh)); -} -class BLAKE1_64B extends BLAKE1 { - v0l; - v0h; - v1l; - v1h; - v2l; - v2h; - v3l; - v3h; - v4l; - v4h; - v5l; - v5h; - v6l; - v6h; - v7l; - v7h; - constructor(outputLen, IV, lengthFlag, opts = {}) { - super(128, outputLen, lengthFlag, 16, 8, B64C, opts); - this.v0l = IV[0] | 0; - this.v0h = IV[1] | 0; - this.v1l = IV[2] | 0; - this.v1h = IV[3] | 0; - this.v2l = IV[4] | 0; - this.v2h = IV[5] | 0; - this.v3l = IV[6] | 0; - this.v3h = IV[7] | 0; - this.v4l = IV[8] | 0; - this.v4h = IV[9] | 0; - this.v5l = IV[10] | 0; - this.v5h = IV[11] | 0; - this.v6l = IV[12] | 0; - this.v6h = IV[13] | 0; - this.v7l = IV[14] | 0; - this.v7h = IV[15] | 0; - } - // prettier-ignore - get() { - let { v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h } = this; - return [v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h]; - } - // prettier-ignore - set(v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h) { - this.v0l = v0l | 0; - this.v0h = v0h | 0; - this.v1l = v1l | 0; - this.v1h = v1h | 0; - this.v2l = v2l | 0; - this.v2h = v2h | 0; - this.v3l = v3l | 0; - this.v3h = v3h | 0; - this.v4l = v4l | 0; - this.v4h = v4h | 0; - this.v5l = v5l | 0; - this.v5h = v5h | 0; - this.v6l = v6l | 0; - this.v6h = v6h | 0; - this.v7l = v7l | 0; - this.v7h = v7h | 0; - } - destroy() { - super.destroy(); - this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - } - compress(view, offset, withLength = true) { - for (let i = 0; i < 32; i++, offset += 4) - BLAKE512_W[i] = view.getUint32(offset, false); - this.get().forEach((v, i) => (BBUF[i] = v)); // First half from state. - BBUF.set(this.constants.subarray(0, 16), 16); - if (withLength) { - const { h, l } = u64.fromBig(BigInt(this.length * 8)); - BBUF[24] = (BBUF[24] ^ h) >>> 0; - BBUF[25] = (BBUF[25] ^ l) >>> 0; - BBUF[26] = (BBUF[26] ^ h) >>> 0; - BBUF[27] = (BBUF[27] ^ l) >>> 0; - } - for (let i = 0, k = 0; i < 16; i++) { - G1b(0, 4, 8, 12, BLAKE512_W, k++); - G2b(0, 4, 8, 12, BLAKE512_W, k++); - G1b(1, 5, 9, 13, BLAKE512_W, k++); - G2b(1, 5, 9, 13, BLAKE512_W, k++); - G1b(2, 6, 10, 14, BLAKE512_W, k++); - G2b(2, 6, 10, 14, BLAKE512_W, k++); - G1b(3, 7, 11, 15, BLAKE512_W, k++); - G2b(3, 7, 11, 15, BLAKE512_W, k++); - G1b(0, 5, 10, 15, BLAKE512_W, k++); - G2b(0, 5, 10, 15, BLAKE512_W, k++); - G1b(1, 6, 11, 12, BLAKE512_W, k++); - G2b(1, 6, 11, 12, BLAKE512_W, k++); - G1b(2, 7, 8, 13, BLAKE512_W, k++); - G2b(2, 7, 8, 13, BLAKE512_W, k++); - G1b(3, 4, 9, 14, BLAKE512_W, k++); - G2b(3, 4, 9, 14, BLAKE512_W, k++); - } - this.v0l ^= BBUF[0] ^ BBUF[16] ^ this.salt[0]; - this.v0h ^= BBUF[1] ^ BBUF[17] ^ this.salt[1]; - this.v1l ^= BBUF[2] ^ BBUF[18] ^ this.salt[2]; - this.v1h ^= BBUF[3] ^ BBUF[19] ^ this.salt[3]; - this.v2l ^= BBUF[4] ^ BBUF[20] ^ this.salt[4]; - this.v2h ^= BBUF[5] ^ BBUF[21] ^ this.salt[5]; - this.v3l ^= BBUF[6] ^ BBUF[22] ^ this.salt[6]; - this.v3h ^= BBUF[7] ^ BBUF[23] ^ this.salt[7]; - this.v4l ^= BBUF[8] ^ BBUF[24] ^ this.salt[0]; - this.v4h ^= BBUF[9] ^ BBUF[25] ^ this.salt[1]; - this.v5l ^= BBUF[10] ^ BBUF[26] ^ this.salt[2]; - this.v5h ^= BBUF[11] ^ BBUF[27] ^ this.salt[3]; - this.v6l ^= BBUF[12] ^ BBUF[28] ^ this.salt[4]; - this.v6h ^= BBUF[13] ^ BBUF[29] ^ this.salt[5]; - this.v7l ^= BBUF[14] ^ BBUF[30] ^ this.salt[6]; - this.v7h ^= BBUF[15] ^ BBUF[31] ^ this.salt[7]; - clean(BBUF, BLAKE512_W); - } -} -/** Internal blake1-224 hash class. */ -export class _BLAKE224 extends BLAKE1_32B { - constructor(opts = {}) { - super(28, B224_IV, 0b0000_0000, opts); - } -} -/** Internal blake1-256 hash class. */ -export class _BLAKE256 extends BLAKE1_32B { - constructor(opts = {}) { - super(32, B256_IV, 0b0000_0001, opts); - } -} -/** Internal blake1-384 hash class. */ -export class _BLAKE384 extends BLAKE1_64B { - constructor(opts = {}) { - super(48, B384_IV, 0b0000_0000, opts); - } -} -/** Internal blake1-512 hash class. */ -export class _BLAKE512 extends BLAKE1_64B { - constructor(opts = {}) { - super(64, B512_IV, 0b0000_0001, opts); - } -} -/** blake1-224 hash function */ -export const blake224 = /* @__PURE__ */ createHasher((opts) => new _BLAKE224(opts)); -/** blake1-256 hash function */ -export const blake256 = /* @__PURE__ */ createHasher((opts) => new _BLAKE256(opts)); -/** blake1-384 hash function */ -export const blake384 = /* @__PURE__ */ createHasher((opts) => new _BLAKE384(opts)); -/** blake1-512 hash function */ -export const blake512 = /* @__PURE__ */ createHasher((opts) => new _BLAKE512(opts)); -//# sourceMappingURL=blake1.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/blake1.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/blake1.js.map deleted file mode 100644 index a97bd58d..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/blake1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blake1.js","sourceRoot":"","sources":["src/blake1.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACtE,OAAO,KAAK,GAAG,MAAM,WAAW,CAAC;AACjC,kBAAkB;AAClB,OAAO,EACL,MA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CAC/E,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,CAC9B,CAAC;AACF,+BAA+B;AAC/B,MAAM,CAAC,MAAM,QAAQ,GAAgC,eAAe,CAAC,YAAY,CAC/E,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,CAC9B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/blake2.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/blake2.d.ts deleted file mode 100644 index 8c79b2d7..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/blake2.d.ts +++ /dev/null @@ -1,120 +0,0 @@ -import { type CHash, type Hash } from './utils.ts'; -/** Blake hash options. dkLen is output length. key is used in MAC mode. salt is used in KDF mode. */ -export type Blake2Opts = { - dkLen?: number; - key?: Uint8Array; - salt?: Uint8Array; - personalization?: Uint8Array; -}; -/** Internal base class for BLAKE2. */ -export declare abstract class _BLAKE2> implements Hash { - protected abstract compress(msg: Uint32Array, offset: number, isLast: boolean): void; - protected abstract get(): number[]; - protected abstract set(...args: number[]): void; - abstract destroy(): void; - protected buffer: Uint8Array; - protected buffer32: Uint32Array; - protected finished: boolean; - protected destroyed: boolean; - protected length: number; - protected pos: number; - readonly blockLen: number; - readonly outputLen: number; - constructor(blockLen: number, outputLen: number); - update(data: Uint8Array): this; - digestInto(out: Uint8Array): void; - digest(): Uint8Array; - _cloneInto(to?: T): T; - clone(): T; -} -/** Internal blake2b hash class. */ -export declare class _BLAKE2b extends _BLAKE2<_BLAKE2b> { - private v0l; - private v0h; - private v1l; - private v1h; - private v2l; - private v2h; - private v3l; - private v3h; - private v4l; - private v4h; - private v5l; - private v5h; - private v6l; - private v6h; - private v7l; - private v7h; - constructor(opts?: Blake2Opts); - protected get(): [ - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number - ]; - protected set(v0l: number, v0h: number, v1l: number, v1h: number, v2l: number, v2h: number, v3l: number, v3h: number, v4l: number, v4h: number, v5l: number, v5h: number, v6l: number, v6h: number, v7l: number, v7h: number): void; - protected compress(msg: Uint32Array, offset: number, isLast: boolean): void; - destroy(): void; -} -/** - * Blake2b hash function. 64-bit. 1.5x slower than blake2s in JS. - * @param msg - message that would be hashed - * @param opts - dkLen output length, key for MAC mode, salt, personalization - */ -export declare const blake2b: CHash<_BLAKE2b, Blake2Opts>; -/** Internal type, 16 numbers. */ -export type Num16 = { - v0: number; - v1: number; - v2: number; - v3: number; - v4: number; - v5: number; - v6: number; - v7: number; - v8: number; - v9: number; - v10: number; - v11: number; - v12: number; - v13: number; - v14: number; - v15: number; -}; -/** BLAKE2-compress core method. */ -export declare function compress(s: Uint8Array, offset: number, msg: Uint32Array, rounds: number, v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, v9: number, v10: number, v11: number, v12: number, v13: number, v14: number, v15: number): Num16; -/** Internal blake2s hash class. */ -export declare class _BLAKE2s extends _BLAKE2<_BLAKE2s> { - private v0; - private v1; - private v2; - private v3; - private v4; - private v5; - private v6; - private v7; - constructor(opts?: Blake2Opts); - protected get(): [number, number, number, number, number, number, number, number]; - protected set(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number): void; - protected compress(msg: Uint32Array, offset: number, isLast: boolean): void; - destroy(): void; -} -/** - * Blake2s hash function. Focuses on 8-bit to 32-bit platforms. 1.5x faster than blake2b in JS. - * @param msg - message that would be hashed - * @param opts - dkLen output length, key for MAC mode, salt, personalization - */ -export declare const blake2s: CHash<_BLAKE2s, Blake2Opts>; -//# sourceMappingURL=blake2.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/blake2.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/blake2.d.ts.map deleted file mode 100644 index 63d03f2f..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/blake2.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blake2.d.ts","sourceRoot":"","sources":["src/blake2.ts"],"names":[],"mappings":"AASA,OAAO,EAKL,KAAK,KAAK,EACV,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAEpB,qGAAqG;AACrG,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,eAAe,CAAC,EAAE,UAAU,CAAC;CAC9B,CAAC;AA6EF,sCAAsC;AACtC,8BAAsB,OAAO,CAAC,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC,CAAE,YAAW,IAAI,CAAC,CAAC,CAAC;IACpE,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI;IACpF,SAAS,CAAC,QAAQ,CAAC,GAAG,IAAI,MAAM,EAAE;IAClC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI;IAC/C,QAAQ,CAAC,OAAO,IAAI,IAAI;IACxB,SAAS,CAAC,MAAM,EAAE,UAAU,CAAC;IAC7B,SAAS,CAAC,QAAQ,EAAE,WAAW,CAAC;IAChC,SAAS,CAAC,QAAQ,UAAS;IAC3B,SAAS,CAAC,SAAS,UAAS;IAC5B,SAAS,CAAC,MAAM,EAAE,MAAM,CAAK;IAC7B,SAAS,CAAC,GAAG,EAAE,MAAM,CAAK;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;gBAEf,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAQ/C,M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,EAAE,UAAU,CAE/C,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/blake2.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/blake2.js deleted file mode 100644 index 792e689c..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/blake2.js +++ /dev/null @@ -1,417 +0,0 @@ -/** - * blake2b (64-bit) & blake2s (8 to 32-bit) hash functions. - * b could have been faster, but there is no fast u64 in js, so s is 1.5x faster. - * @module - */ -import { BSIGMA, G1s, G2s } from "./_blake.js"; -import { SHA256_IV } from "./_md.js"; -import * as u64 from "./_u64.js"; -// prettier-ignore -import { abytes, aexists, anumber, aoutput, clean, createHasher, swap32IfBE, swap8IfBE, u32 } from "./utils.js"; -// Same as SHA512_IV, but swapped endianness: LE instead of BE. iv[1] is iv[0], etc. -const B2B_IV = /* @__PURE__ */ Uint32Array.from([ - 0xf3bcc908, 0x6a09e667, 0x84caa73b, 0xbb67ae85, 0xfe94f82b, 0x3c6ef372, 0x5f1d36f1, 0xa54ff53a, - 0xade682d1, 0x510e527f, 0x2b3e6c1f, 0x9b05688c, 0xfb41bd6b, 0x1f83d9ab, 0x137e2179, 0x5be0cd19, -]); -// Temporary buffer -const BBUF = /* @__PURE__ */ new Uint32Array(32); -// Mixing function G splitted in two halfs -function G1b(a, b, c, d, msg, x) { - // NOTE: V is LE here - const Xl = msg[x], Xh = msg[x + 1]; // prettier-ignore - let Al = BBUF[2 * a], Ah = BBUF[2 * a + 1]; // prettier-ignore - let Bl = BBUF[2 * b], Bh = BBUF[2 * b + 1]; // prettier-ignore - let Cl = BBUF[2 * c], Ch = BBUF[2 * c + 1]; // prettier-ignore - let Dl = BBUF[2 * d], Dh = BBUF[2 * d + 1]; // prettier-ignore - // v[a] = (v[a] + v[b] + x) | 0; - let ll = u64.add3L(Al, Bl, Xl); - Ah = u64.add3H(ll, Ah, Bh, Xh); - Al = ll | 0; - // v[d] = rotr(v[d] ^ v[a], 32) - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: u64.rotr32H(Dh, Dl), Dl: u64.rotr32L(Dh, Dl) }); - // v[c] = (v[c] + v[d]) | 0; - ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); - // v[b] = rotr(v[b] ^ v[c], 24) - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: u64.rotrSH(Bh, Bl, 24), Bl: u64.rotrSL(Bh, Bl, 24) }); - ((BBUF[2 * a] = Al), (BBUF[2 * a + 1] = Ah)); - ((BBUF[2 * b] = Bl), (BBUF[2 * b + 1] = Bh)); - ((BBUF[2 * c] = Cl), (BBUF[2 * c + 1] = Ch)); - ((BBUF[2 * d] = Dl), (BBUF[2 * d + 1] = Dh)); -} -function G2b(a, b, c, d, msg, x) { - // NOTE: V is LE here - const Xl = msg[x], Xh = msg[x + 1]; // prettier-ignore - let Al = BBUF[2 * a], Ah = BBUF[2 * a + 1]; // prettier-ignore - let Bl = BBUF[2 * b], Bh = BBUF[2 * b + 1]; // prettier-ignore - let Cl = BBUF[2 * c], Ch = BBUF[2 * c + 1]; // prettier-ignore - let Dl = BBUF[2 * d], Dh = BBUF[2 * d + 1]; // prettier-ignore - // v[a] = (v[a] + v[b] + x) | 0; - let ll = u64.add3L(Al, Bl, Xl); - Ah = u64.add3H(ll, Ah, Bh, Xh); - Al = ll | 0; - // v[d] = rotr(v[d] ^ v[a], 16) - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: u64.rotrSH(Dh, Dl, 16), Dl: u64.rotrSL(Dh, Dl, 16) }); - // v[c] = (v[c] + v[d]) | 0; - ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); - // v[b] = rotr(v[b] ^ v[c], 63) - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: u64.rotrBH(Bh, Bl, 63), Bl: u64.rotrBL(Bh, Bl, 63) }); - ((BBUF[2 * a] = Al), (BBUF[2 * a + 1] = Ah)); - ((BBUF[2 * b] = Bl), (BBUF[2 * b + 1] = Bh)); - ((BBUF[2 * c] = Cl), (BBUF[2 * c + 1] = Ch)); - ((BBUF[2 * d] = Dl), (BBUF[2 * d + 1] = Dh)); -} -function checkBlake2Opts(outputLen, opts = {}, keyLen, saltLen, persLen) { - anumber(keyLen); - if (outputLen < 0 || outputLen > keyLen) - throw new Error('outputLen bigger than keyLen'); - const { key, salt, personalization } = opts; - if (key !== undefined && (key.length < 1 || key.length > keyLen)) - throw new Error('"key" expected to be undefined or of length=1..' + keyLen); - if (salt !== undefined) - abytes(salt, saltLen, 'salt'); - if (personalization !== undefined) - abytes(personalization, persLen, 'personalization'); -} -/** Internal base class for BLAKE2. */ -export class _BLAKE2 { - buffer; - buffer32; - finished = false; - destroyed = false; - length = 0; - pos = 0; - blockLen; - outputLen; - constructor(blockLen, outputLen) { - anumber(blockLen); - anumber(outputLen); - this.blockLen = blockLen; - this.outputLen = outputLen; - this.buffer = new Uint8Array(blockLen); - this.buffer32 = u32(this.buffer); - } - update(data) { - aexists(this); - abytes(data); - // Main difference with other hashes: there is flag for last block, - // so we cannot process current block before we know that there - // is the next one. This significantly complicates logic and reduces ability - // to do zero-copy processing - const { blockLen, buffer, buffer32 } = this; - const len = data.length; - const offset = data.byteOffset; - const buf = data.buffer; - for (let pos = 0; pos < len;) { - // If buffer is full and we still have input (don't process last block, same as blake2s) - if (this.pos === blockLen) { - swap32IfBE(buffer32); - this.compress(buffer32, 0, false); - swap32IfBE(buffer32); - this.pos = 0; - } - const take = Math.min(blockLen - this.pos, len - pos); - const dataOffset = offset + pos; - // full block && aligned to 4 bytes && not last in input - if (take === blockLen && !(dataOffset % 4) && pos + take < len) { - const data32 = new Uint32Array(buf, dataOffset, Math.floor((len - pos) / 4)); - swap32IfBE(data32); - for (let pos32 = 0; pos + blockLen < len; pos32 += buffer32.length, pos += blockLen) { - this.length += blockLen; - this.compress(data32, pos32, false); - } - swap32IfBE(data32); - continue; - } - buffer.set(data.subarray(pos, pos + take), this.pos); - this.pos += take; - this.length += take; - pos += take; - } - return this; - } - digestInto(out) { - aexists(this); - aoutput(out, this); - const { pos, buffer32 } = this; - this.finished = true; - // Padding - clean(this.buffer.subarray(pos)); - swap32IfBE(buffer32); - this.compress(buffer32, 0, true); - swap32IfBE(buffer32); - const out32 = u32(out); - this.get().forEach((v, i) => (out32[i] = swap8IfBE(v))); - } - digest() { - const { buffer, outputLen } = this; - this.digestInto(buffer); - const res = buffer.slice(0, outputLen); - this.destroy(); - return res; - } - _cloneInto(to) { - const { buffer, length, finished, destroyed, outputLen, pos } = this; - to ||= new this.constructor({ dkLen: outputLen }); - to.set(...this.get()); - to.buffer.set(buffer); - to.destroyed = destroyed; - to.finished = finished; - to.length = length; - to.pos = pos; - // @ts-ignore - to.outputLen = outputLen; - return to; - } - clone() { - return this._cloneInto(); - } -} -/** Internal blake2b hash class. */ -export class _BLAKE2b extends _BLAKE2 { - // Same as SHA-512, but LE - v0l = B2B_IV[0] | 0; - v0h = B2B_IV[1] | 0; - v1l = B2B_IV[2] | 0; - v1h = B2B_IV[3] | 0; - v2l = B2B_IV[4] | 0; - v2h = B2B_IV[5] | 0; - v3l = B2B_IV[6] | 0; - v3h = B2B_IV[7] | 0; - v4l = B2B_IV[8] | 0; - v4h = B2B_IV[9] | 0; - v5l = B2B_IV[10] | 0; - v5h = B2B_IV[11] | 0; - v6l = B2B_IV[12] | 0; - v6h = B2B_IV[13] | 0; - v7l = B2B_IV[14] | 0; - v7h = B2B_IV[15] | 0; - constructor(opts = {}) { - const olen = opts.dkLen === undefined ? 64 : opts.dkLen; - super(128, olen); - checkBlake2Opts(olen, opts, 64, 16, 16); - let { key, personalization, salt } = opts; - let keyLength = 0; - if (key !== undefined) { - abytes(key, undefined, 'key'); - keyLength = key.length; - } - this.v0l ^= this.outputLen | (keyLength << 8) | (0x01 << 16) | (0x01 << 24); - if (salt !== undefined) { - abytes(salt, undefined, 'salt'); - const slt = u32(salt); - this.v4l ^= swap8IfBE(slt[0]); - this.v4h ^= swap8IfBE(slt[1]); - this.v5l ^= swap8IfBE(slt[2]); - this.v5h ^= swap8IfBE(slt[3]); - } - if (personalization !== undefined) { - abytes(personalization, undefined, 'personalization'); - const pers = u32(personalization); - this.v6l ^= swap8IfBE(pers[0]); - this.v6h ^= swap8IfBE(pers[1]); - this.v7l ^= swap8IfBE(pers[2]); - this.v7h ^= swap8IfBE(pers[3]); - } - if (key !== undefined) { - // Pad to blockLen and update - const tmp = new Uint8Array(this.blockLen); - tmp.set(key); - this.update(tmp); - } - } - // prettier-ignore - get() { - let { v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h } = this; - return [v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h]; - } - // prettier-ignore - set(v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h) { - this.v0l = v0l | 0; - this.v0h = v0h | 0; - this.v1l = v1l | 0; - this.v1h = v1h | 0; - this.v2l = v2l | 0; - this.v2h = v2h | 0; - this.v3l = v3l | 0; - this.v3h = v3h | 0; - this.v4l = v4l | 0; - this.v4h = v4h | 0; - this.v5l = v5l | 0; - this.v5h = v5h | 0; - this.v6l = v6l | 0; - this.v6h = v6h | 0; - this.v7l = v7l | 0; - this.v7h = v7h | 0; - } - compress(msg, offset, isLast) { - this.get().forEach((v, i) => (BBUF[i] = v)); // First half from state. - BBUF.set(B2B_IV, 16); // Second half from IV. - let { h, l } = u64.fromBig(BigInt(this.length)); - BBUF[24] = B2B_IV[8] ^ l; // Low word of the offset. - BBUF[25] = B2B_IV[9] ^ h; // High word. - // Invert all bits for last block - if (isLast) { - BBUF[28] = ~BBUF[28]; - BBUF[29] = ~BBUF[29]; - } - let j = 0; - const s = BSIGMA; - for (let i = 0; i < 12; i++) { - G1b(0, 4, 8, 12, msg, offset + 2 * s[j++]); - G2b(0, 4, 8, 12, msg, offset + 2 * s[j++]); - G1b(1, 5, 9, 13, msg, offset + 2 * s[j++]); - G2b(1, 5, 9, 13, msg, offset + 2 * s[j++]); - G1b(2, 6, 10, 14, msg, offset + 2 * s[j++]); - G2b(2, 6, 10, 14, msg, offset + 2 * s[j++]); - G1b(3, 7, 11, 15, msg, offset + 2 * s[j++]); - G2b(3, 7, 11, 15, msg, offset + 2 * s[j++]); - G1b(0, 5, 10, 15, msg, offset + 2 * s[j++]); - G2b(0, 5, 10, 15, msg, offset + 2 * s[j++]); - G1b(1, 6, 11, 12, msg, offset + 2 * s[j++]); - G2b(1, 6, 11, 12, msg, offset + 2 * s[j++]); - G1b(2, 7, 8, 13, msg, offset + 2 * s[j++]); - G2b(2, 7, 8, 13, msg, offset + 2 * s[j++]); - G1b(3, 4, 9, 14, msg, offset + 2 * s[j++]); - G2b(3, 4, 9, 14, msg, offset + 2 * s[j++]); - } - this.v0l ^= BBUF[0] ^ BBUF[16]; - this.v0h ^= BBUF[1] ^ BBUF[17]; - this.v1l ^= BBUF[2] ^ BBUF[18]; - this.v1h ^= BBUF[3] ^ BBUF[19]; - this.v2l ^= BBUF[4] ^ BBUF[20]; - this.v2h ^= BBUF[5] ^ BBUF[21]; - this.v3l ^= BBUF[6] ^ BBUF[22]; - this.v3h ^= BBUF[7] ^ BBUF[23]; - this.v4l ^= BBUF[8] ^ BBUF[24]; - this.v4h ^= BBUF[9] ^ BBUF[25]; - this.v5l ^= BBUF[10] ^ BBUF[26]; - this.v5h ^= BBUF[11] ^ BBUF[27]; - this.v6l ^= BBUF[12] ^ BBUF[28]; - this.v6h ^= BBUF[13] ^ BBUF[29]; - this.v7l ^= BBUF[14] ^ BBUF[30]; - this.v7h ^= BBUF[15] ^ BBUF[31]; - clean(BBUF); - } - destroy() { - this.destroyed = true; - clean(this.buffer32); - this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - } -} -/** - * Blake2b hash function. 64-bit. 1.5x slower than blake2s in JS. - * @param msg - message that would be hashed - * @param opts - dkLen output length, key for MAC mode, salt, personalization - */ -export const blake2b = /* @__PURE__ */ createHasher((opts) => new _BLAKE2b(opts)); -/** BLAKE2-compress core method. */ -// prettier-ignore -export function compress(s, offset, msg, rounds, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) { - let j = 0; - for (let i = 0; i < rounds; i++) { - ({ a: v0, b: v4, c: v8, d: v12 } = G1s(v0, v4, v8, v12, msg[offset + s[j++]])); - ({ a: v0, b: v4, c: v8, d: v12 } = G2s(v0, v4, v8, v12, msg[offset + s[j++]])); - ({ a: v1, b: v5, c: v9, d: v13 } = G1s(v1, v5, v9, v13, msg[offset + s[j++]])); - ({ a: v1, b: v5, c: v9, d: v13 } = G2s(v1, v5, v9, v13, msg[offset + s[j++]])); - ({ a: v2, b: v6, c: v10, d: v14 } = G1s(v2, v6, v10, v14, msg[offset + s[j++]])); - ({ a: v2, b: v6, c: v10, d: v14 } = G2s(v2, v6, v10, v14, msg[offset + s[j++]])); - ({ a: v3, b: v7, c: v11, d: v15 } = G1s(v3, v7, v11, v15, msg[offset + s[j++]])); - ({ a: v3, b: v7, c: v11, d: v15 } = G2s(v3, v7, v11, v15, msg[offset + s[j++]])); - ({ a: v0, b: v5, c: v10, d: v15 } = G1s(v0, v5, v10, v15, msg[offset + s[j++]])); - ({ a: v0, b: v5, c: v10, d: v15 } = G2s(v0, v5, v10, v15, msg[offset + s[j++]])); - ({ a: v1, b: v6, c: v11, d: v12 } = G1s(v1, v6, v11, v12, msg[offset + s[j++]])); - ({ a: v1, b: v6, c: v11, d: v12 } = G2s(v1, v6, v11, v12, msg[offset + s[j++]])); - ({ a: v2, b: v7, c: v8, d: v13 } = G1s(v2, v7, v8, v13, msg[offset + s[j++]])); - ({ a: v2, b: v7, c: v8, d: v13 } = G2s(v2, v7, v8, v13, msg[offset + s[j++]])); - ({ a: v3, b: v4, c: v9, d: v14 } = G1s(v3, v4, v9, v14, msg[offset + s[j++]])); - ({ a: v3, b: v4, c: v9, d: v14 } = G2s(v3, v4, v9, v14, msg[offset + s[j++]])); - } - return { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 }; -} -const B2S_IV = /* @__PURE__ */ SHA256_IV.slice(); -/** Internal blake2s hash class. */ -export class _BLAKE2s extends _BLAKE2 { - // Internal state, same as SHA-256 - v0 = B2S_IV[0] | 0; - v1 = B2S_IV[1] | 0; - v2 = B2S_IV[2] | 0; - v3 = B2S_IV[3] | 0; - v4 = B2S_IV[4] | 0; - v5 = B2S_IV[5] | 0; - v6 = B2S_IV[6] | 0; - v7 = B2S_IV[7] | 0; - constructor(opts = {}) { - const olen = opts.dkLen === undefined ? 32 : opts.dkLen; - super(64, olen); - checkBlake2Opts(olen, opts, 32, 8, 8); - let { key, personalization, salt } = opts; - let keyLength = 0; - if (key !== undefined) { - abytes(key, undefined, 'key'); - keyLength = key.length; - } - this.v0 ^= this.outputLen | (keyLength << 8) | (0x01 << 16) | (0x01 << 24); - if (salt !== undefined) { - abytes(salt, undefined, 'salt'); - const slt = u32(salt); - this.v4 ^= swap8IfBE(slt[0]); - this.v5 ^= swap8IfBE(slt[1]); - } - if (personalization !== undefined) { - abytes(personalization, undefined, 'personalization'); - const pers = u32(personalization); - this.v6 ^= swap8IfBE(pers[0]); - this.v7 ^= swap8IfBE(pers[1]); - } - if (key !== undefined) { - // Pad to blockLen and update - const tmp = new Uint8Array(this.blockLen); - tmp.set(key); - this.update(tmp); - } - } - get() { - const { v0, v1, v2, v3, v4, v5, v6, v7 } = this; - return [v0, v1, v2, v3, v4, v5, v6, v7]; - } - // prettier-ignore - set(v0, v1, v2, v3, v4, v5, v6, v7) { - this.v0 = v0 | 0; - this.v1 = v1 | 0; - this.v2 = v2 | 0; - this.v3 = v3 | 0; - this.v4 = v4 | 0; - this.v5 = v5 | 0; - this.v6 = v6 | 0; - this.v7 = v7 | 0; - } - compress(msg, offset, isLast) { - const { h, l } = u64.fromBig(BigInt(this.length)); - // prettier-ignore - const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = compress(BSIGMA, offset, msg, 10, this.v0, this.v1, this.v2, this.v3, this.v4, this.v5, this.v6, this.v7, B2S_IV[0], B2S_IV[1], B2S_IV[2], B2S_IV[3], l ^ B2S_IV[4], h ^ B2S_IV[5], isLast ? ~B2S_IV[6] : B2S_IV[6], B2S_IV[7]); - this.v0 ^= v0 ^ v8; - this.v1 ^= v1 ^ v9; - this.v2 ^= v2 ^ v10; - this.v3 ^= v3 ^ v11; - this.v4 ^= v4 ^ v12; - this.v5 ^= v5 ^ v13; - this.v6 ^= v6 ^ v14; - this.v7 ^= v7 ^ v15; - } - destroy() { - this.destroyed = true; - clean(this.buffer32); - this.set(0, 0, 0, 0, 0, 0, 0, 0); - } -} -/** - * Blake2s hash function. Focuses on 8-bit to 32-bit platforms. 1.5x faster than blake2b in JS. - * @param msg - message that would be hashed - * @param opts - dkLen output length, key for MAC mode, salt, personalization - */ -export const blake2s = /* @__PURE__ */ createHasher((opts) => new _BLAKE2s(opts)); -//# sourceMappingURL=blake2.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/blake2.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/blake2.js.map deleted file mode 100644 index a1ed3072..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/blake2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blake2.js","sourceRoot":"","sources":["src/blake2.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,MAAM,EAAE,GAAG,E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,EAAE,GAAG,GAAG,CAAC;QACpB,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC;QACpB,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC;QACpB,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC;QACpB,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC;QACpB,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC;IACtB,CAAC;IACD,OAAO;QACL,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACrB,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACnC,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,OAAO,GAAgC,eAAe,CAAC,YAAY,CAC9E,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,CAC7B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/blake3.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/blake3.d.ts deleted file mode 100644 index 0607da7e..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/blake3.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { _BLAKE2 } from './blake2.ts'; -import { type CHashXOF, type HashXOF } from './utils.ts'; -/** - * Ensure to use EITHER `key` OR `context`, not both. - * - * * `key`: 32-byte MAC key. - * * `context`: string for KDF. must be hardcoded, globally unique, and application - specific. - * A good default format for the context string is "[application] [commit timestamp] [purpose]". - */ -export type Blake3Opts = { - dkLen?: number; - key?: Uint8Array; - context?: Uint8Array; -}; -/** Blake3 hash. Can be used as MAC and KDF. */ -export declare class _BLAKE3 extends _BLAKE2<_BLAKE3> implements HashXOF<_BLAKE3> { - private chunkPos; - private chunksDone; - private flags; - private IV; - private state; - private stack; - private posOut; - private bufferOut32; - private bufferOut; - private chunkOut; - private enableXOF; - constructor(opts?: Blake3Opts, flags?: number); - protected get(): []; - protected set(): void; - private b2Compress; - protected compress(buf: Uint32Array, bufPos?: number, isLast?: boolean): void; - _cloneInto(to?: _BLAKE3): _BLAKE3; - destroy(): void; - private b2CompressOut; - protected finish(): void; - private writeInto; - xofInto(out: Uint8Array): Uint8Array; - xof(bytes: number): Uint8Array; - digestInto(out: Uint8Array): Uint8Array; - digest(): Uint8Array; -} -/** - * BLAKE3 hash function. Can be used as MAC and KDF. - * @param msg - message that would be hashed - * @param opts - `dkLen` for output length, `key` for MAC mode, `context` for KDF mode - * @example - * const data = new Uint8Array(32); - * const hash = blake3(data); - * const mac = blake3(data, { key: new Uint8Array(32) }); - * const kdf = blake3(data, { context: 'application name' }); - */ -export declare const blake3: CHashXOF<_BLAKE3, Blake3Opts>; -//# sourceMappingURL=blake3.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/blake3.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/blake3.d.ts.map deleted file mode 100644 index 2bf8358b..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/blake3.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blake3.d.ts","sourceRoot":"","sources":["src/blake3.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,OAAO,EAAY,MAAM,aAAa,CAAC;AAEhD,OAAO,EAIL,KAAK,QAAQ,EACb,KAAK,OAAO,EACb,MAAM,YAAY,CAAC;AAwBpB;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,UAAU,CAAC;IAAC,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/@noble/hashes/blake3.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/blake3.js deleted file mode 100644 index 59e0aa15..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/blake3.js +++ /dev/null @@ -1,255 +0,0 @@ -/** - * Blake3 fast hash is Blake2 with reduced security (round count). Can also be used as MAC & KDF. - * - * It is advertised as "the fastest cryptographic hash". However, it isn't true in JS. - * Why is this so slow? While it must be 6x faster than blake2b, perf diff is only 20%: - * - * * There is only 30% reduction in number of rounds from blake2s - * * Speed-up comes from tree structure, which is parallelized using SIMD & threading. - * These features are not present in JS, so we only get overhead from trees. - * * Parallelization only happens on 1024-byte chunks: there is no benefit for small inputs. - * * It is still possible to make it faster using: a) loop unrolling b) web workers c) wasm - * @module - */ -import { SHA256_IV } from "./_md.js"; -import { fromBig } from "./_u64.js"; -import { _BLAKE2, compress } from "./blake2.js"; -// prettier-ignore -import { abytes, aexists, anumber, aoutput, clean, createHasher, swap32IfBE, u32, u8 } from "./utils.js"; -// Flag bitset -const B3_Flags = { - CHUNK_START: 0b1, - CHUNK_END: 0b10, - PARENT: 0b100, - ROOT: 0b1000, - KEYED_HASH: 0b10000, - DERIVE_KEY_CONTEXT: 0b100000, - DERIVE_KEY_MATERIAL: 0b1000000, -}; -const B3_IV = /* @__PURE__ */ SHA256_IV.slice(); -const B3_SIGMA = /* @__PURE__ */ (() => { - const Id = Array.from({ length: 16 }, (_, i) => i); - const permute = (arr) => [2, 6, 3, 10, 7, 0, 4, 13, 1, 11, 12, 5, 9, 14, 15, 8].map((i) => arr[i]); - const res = []; - for (let i = 0, v = Id; i < 7; i++, v = permute(v)) - res.push(...v); - return Uint8Array.from(res); -})(); -/** Blake3 hash. Can be used as MAC and KDF. */ -export class _BLAKE3 extends _BLAKE2 { - chunkPos = 0; // Position of current block in chunk - chunksDone = 0; // How many chunks we already have - flags = 0 | 0; - IV; - state; - stack = []; - // Output - posOut = 0; - bufferOut32 = new Uint32Array(16); - bufferOut; - chunkOut = 0; // index of output chunk - enableXOF = true; - constructor(opts = {}, flags = 0) { - super(64, opts.dkLen === undefined ? 32 : opts.dkLen); - const { key, context } = opts; - const hasContext = context !== undefined; - if (key !== undefined) { - if (hasContext) - throw new Error('Only "key" or "context" can be specified at same time'); - abytes(key, 32, 'key'); - const k = key.slice(); - this.IV = u32(k); - swap32IfBE(this.IV); - this.flags = flags | B3_Flags.KEYED_HASH; - } - else if (hasContext) { - abytes(context, undefined, 'context'); - const ctx = context; - const contextKey = new _BLAKE3({ dkLen: 32 }, B3_Flags.DERIVE_KEY_CONTEXT) - .update(ctx) - .digest(); - this.IV = u32(contextKey); - swap32IfBE(this.IV); - this.flags = flags | B3_Flags.DERIVE_KEY_MATERIAL; - } - else { - this.IV = B3_IV.slice(); - this.flags = flags; - } - this.state = this.IV.slice(); - this.bufferOut = u8(this.bufferOut32); - } - // Unused - get() { - return []; - } - set() { } - b2Compress(counter, flags, buf, bufPos = 0) { - const { state: s, pos } = this; - const { h, l } = fromBig(BigInt(counter), true); - // prettier-ignore - const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = compress(B3_SIGMA, bufPos, buf, 7, s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], B3_IV[0], B3_IV[1], B3_IV[2], B3_IV[3], h, l, pos, flags); - s[0] = v0 ^ v8; - s[1] = v1 ^ v9; - s[2] = v2 ^ v10; - s[3] = v3 ^ v11; - s[4] = v4 ^ v12; - s[5] = v5 ^ v13; - s[6] = v6 ^ v14; - s[7] = v7 ^ v15; - } - compress(buf, bufPos = 0, isLast = false) { - // Compress last block - let flags = this.flags; - if (!this.chunkPos) - flags |= B3_Flags.CHUNK_START; - if (this.chunkPos === 15 || isLast) - flags |= B3_Flags.CHUNK_END; - if (!isLast) - this.pos = this.blockLen; - this.b2Compress(this.chunksDone, flags, buf, bufPos); - this.chunkPos += 1; - // If current block is last in chunk (16 blocks), then compress chunks - if (this.chunkPos === 16 || isLast) { - let chunk = this.state; - this.state = this.IV.slice(); - // If not the last one, compress only when there are trailing zeros in chunk counter - // chunks used as binary tree where current stack is path. Zero means current leaf is finished and can be compressed. - // 1 (001) - leaf not finished (just push current chunk to stack) - // 2 (010) - leaf finished at depth=1 (merge with last elm on stack and push back) - // 3 (011) - last leaf not finished - // 4 (100) - leafs finished at depth=1 and depth=2 - for (let last, chunks = this.chunksDone + 1; isLast || !(chunks & 1); chunks >>= 1) { - if (!(last = this.stack.pop())) - break; - this.buffer32.set(last, 0); - this.buffer32.set(chunk, 8); - this.pos = this.blockLen; - this.b2Compress(0, this.flags | B3_Flags.PARENT, this.buffer32, 0); - chunk = this.state; - this.state = this.IV.slice(); - } - this.chunksDone++; - this.chunkPos = 0; - this.stack.push(chunk); - } - this.pos = 0; - } - _cloneInto(to) { - to = super._cloneInto(to); - const { IV, flags, state, chunkPos, posOut, chunkOut, stack, chunksDone } = this; - to.state.set(state.slice()); - to.stack = stack.map((i) => Uint32Array.from(i)); - to.IV.set(IV); - to.flags = flags; - to.chunkPos = chunkPos; - to.chunksDone = chunksDone; - to.posOut = posOut; - to.chunkOut = chunkOut; - to.enableXOF = this.enableXOF; - to.bufferOut32.set(this.bufferOut32); - return to; - } - destroy() { - this.destroyed = true; - clean(this.state, this.buffer32, this.IV, this.bufferOut32); - clean(...this.stack); - } - // Same as b2Compress, but doesn't modify state and returns 16 u32 array (instead of 8) - b2CompressOut() { - const { state: s, pos, flags, buffer32, bufferOut32: out32 } = this; - const { h, l } = fromBig(BigInt(this.chunkOut++)); - swap32IfBE(buffer32); - // prettier-ignore - const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = compress(B3_SIGMA, 0, buffer32, 7, s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], B3_IV[0], B3_IV[1], B3_IV[2], B3_IV[3], l, h, pos, flags); - out32[0] = v0 ^ v8; - out32[1] = v1 ^ v9; - out32[2] = v2 ^ v10; - out32[3] = v3 ^ v11; - out32[4] = v4 ^ v12; - out32[5] = v5 ^ v13; - out32[6] = v6 ^ v14; - out32[7] = v7 ^ v15; - out32[8] = s[0] ^ v8; - out32[9] = s[1] ^ v9; - out32[10] = s[2] ^ v10; - out32[11] = s[3] ^ v11; - out32[12] = s[4] ^ v12; - out32[13] = s[5] ^ v13; - out32[14] = s[6] ^ v14; - out32[15] = s[7] ^ v15; - swap32IfBE(buffer32); - swap32IfBE(out32); - this.posOut = 0; - } - finish() { - if (this.finished) - return; - this.finished = true; - // Padding - clean(this.buffer.subarray(this.pos)); - // Process last chunk - let flags = this.flags | B3_Flags.ROOT; - if (this.stack.length) { - flags |= B3_Flags.PARENT; - swap32IfBE(this.buffer32); - this.compress(this.buffer32, 0, true); - swap32IfBE(this.buffer32); - this.chunksDone = 0; - this.pos = this.blockLen; - } - else { - flags |= (!this.chunkPos ? B3_Flags.CHUNK_START : 0) | B3_Flags.CHUNK_END; - } - this.flags = flags; - this.b2CompressOut(); - } - writeInto(out) { - aexists(this, false); - abytes(out); - this.finish(); - const { blockLen, bufferOut } = this; - for (let pos = 0, len = out.length; pos < len;) { - if (this.posOut >= blockLen) - this.b2CompressOut(); - const take = Math.min(blockLen - this.posOut, len - pos); - out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); - this.posOut += take; - pos += take; - } - return out; - } - xofInto(out) { - if (!this.enableXOF) - throw new Error('XOF is not possible after digest call'); - return this.writeInto(out); - } - xof(bytes) { - anumber(bytes); - return this.xofInto(new Uint8Array(bytes)); - } - digestInto(out) { - aoutput(out, this); - if (this.finished) - throw new Error('digest() was already called'); - this.enableXOF = false; - this.writeInto(out); - this.destroy(); - return out; - } - digest() { - return this.digestInto(new Uint8Array(this.outputLen)); - } -} -/** - * BLAKE3 hash function. Can be used as MAC and KDF. - * @param msg - message that would be hashed - * @param opts - `dkLen` for output length, `key` for MAC mode, `context` for KDF mode - * @example - * const data = new Uint8Array(32); - * const hash = blake3(data); - * const mac = blake3(data, { key: new Uint8Array(32) }); - * const kdf = blake3(data, { context: 'application name' }); - */ -export const blake3 = /* @__PURE__ */ createHasher((opts = {}) => new _BLAKE3(opts)); -//# sourceMappingURL=blake3.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/blake3.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/blake3.js.map deleted file mode 100644 index abba8c04..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/blake3.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blake3.js","sourceRoot":"","sources":["src/blake3.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAChD,kBAAkB;AAClB,OAAO,EACL,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EACjC,KAAK,EAAE,YAAY,EAAE,UAAU,EAC/B,GAAG,EAAE,EAAE,EAGR,MAAM,YAAY,CAAC;AAEpB,cAAc;AACd,MAAM,QAAQ,GAAG;IACf,WAAW,EAAE,GAAG;IAChB,SAAS,EAAE,IAAI;IACf,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE,OAAO;IACnB,kBAAkB,EAAE,QAAQ;IAC5B,mBAAmB,EAAE,SAAS;CACtB,CAAC;AAEX,MAAM,KAAK,GAAG,eAAe,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;AAEhD,MAAM,QAAQ,GAAe,eAAe,CAAC,CAAC,GAAG,EAAE;IACjD,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,C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AAC,CAAC;IAC7B,CAAC;IACD,GAAG,CAAC,KAAa;QACf,OAAO,CAAC,KAAK,CAAC,CAAC;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7C,CAAC;IACD,UAAU,CAAC,GAAe;QACxB,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACnB,IAAI,IAAI,CAAC,QAAQ;YAAE,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;QAClE,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QACpB,IAAI,CAAC,OAAO,EAAE,CAAC;QACf,OAAO,GAAG,CAAC;IACb,CAAC;IACD,MAAM;QACJ,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IACzD,CAAC;CACF;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,MAAM,GAAkC,eAAe,CAAC,YAAY,CAC/E,CAAC,IAAI,GAAG,EAAE,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CACjC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/eskdf.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/eskdf.d.ts deleted file mode 100644 index 35ab42c1..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/eskdf.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** Scrypt KDF */ -export declare function scrypt(password: string, salt: string): Uint8Array; -/** PBKDF2-HMAC-SHA256 */ -export declare function pbkdf2(password: string, salt: string): Uint8Array; -/** - * Derives main seed. Takes a lot of time. Prefer `eskdf` method instead. - */ -export declare function deriveMainSeed(username: string, password: string): Uint8Array; -type AccountID = number | string; -type OptsLength = { - keyLength: number; -}; -type OptsMod = { - modulus: bigint; -}; -type KeyOpts = undefined | OptsLength | OptsMod; -/** Not using classes because constructor cannot be async */ -export interface ESKDF { - /** - * Derives a child key. Child key will not be associated with any - * other child key because of properties of underlying KDF. - * - * @param protocol - 3-15 character protocol name - * @param accountId - numeric identifier of account - * @param options - `keyLength: 64` or `modulus: 41920438n` - * @example deriveChildKey('aes', 0) - */ - deriveChildKey: (protocol: string, accountId: AccountID, options?: KeyOpts) => Uint8Array; - /** - * Deletes the main seed from eskdf instance - */ - expire: () => void; - /** - * Account fingerprint - */ - fingerprint: string; -} -/** - * ESKDF - * @param username - username, email, or identifier, min: 8 characters, should have enough entropy - * @param password - password, min: 8 characters, should have enough entropy - * @example - * const kdf = await eskdf('example-university', 'beginning-new-example'); - * const key = kdf.deriveChildKey('aes', 0); - * console.log(kdf.fingerprint); - * kdf.expire(); - */ -export declare function eskdf(username: string, password: string): Promise; -export {}; -//# sourceMappingURL=eskdf.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/eskdf.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/eskdf.d.ts.map deleted file mode 100644 index cb9bd4ee..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/eskdf.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"eskdf.d.ts","sourceRoot":"","sources":["src/eskdf.ts"],"names":[],"mappings":"AAiBA,iBAAiB;AACjB,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAEjE;AAED,yBAAyB;AACzB,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAEjE;AAiBD;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,UAAU,CAY7E;AAED,KAAK,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AAgCjC,KAAK,UAAU,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AACxC,KAAK,OAAO,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AACnC,KAAK,OAAO,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,CAAC;AAuChD,4DAA4D;AAC5D,MAAM,WAAW,KAAK;IACpB;;;;;;;;OAQG;IACH,cAAc,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,UAAU,CAAC;IAC1F;;OAEG;IACH,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;GASG;AACH,wBAAsB,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAuB9E"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/eskdf.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/eskdf.js deleted file mode 100644 index 3d417c1b..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/eskdf.js +++ /dev/null @@ -1,161 +0,0 @@ -/** - * Experimental KDF for AES. - * @module - */ -import { hkdf } from "./hkdf.js"; -import { pbkdf2 as _pbkdf2 } from "./pbkdf2.js"; -import { scrypt as _scrypt } from "./scrypt.js"; -import { sha256 } from "./sha2.js"; -import { abytes, bytesToHex, clean, createView, hexToBytes, kdfInputToBytes } from "./utils.js"; -// A tiny KDF for various applications like AES key-gen. -// Uses HKDF in a non-standard way, so it's not "KDF-secure", only "PRF-secure". -// Which is good enough: assume sha2-256 retained preimage resistance. -const SCRYPT_FACTOR = 2 ** 19; -const PBKDF2_FACTOR = 2 ** 17; -/** Scrypt KDF */ -export function scrypt(password, salt) { - return _scrypt(password, salt, { N: SCRYPT_FACTOR, r: 8, p: 1, dkLen: 32 }); -} -/** PBKDF2-HMAC-SHA256 */ -export function pbkdf2(password, salt) { - return _pbkdf2(sha256, password, salt, { c: PBKDF2_FACTOR, dkLen: 32 }); -} -// Combines two 32-byte byte arrays -function xor32(a, b) { - abytes(a, 32); - abytes(b, 32); - const arr = new Uint8Array(32); - for (let i = 0; i < 32; i++) { - arr[i] = a[i] ^ b[i]; - } - return arr; -} -function strHasLength(str, min, max) { - return typeof str === 'string' && str.length >= min && str.length <= max; -} -/** - * Derives main seed. Takes a lot of time. Prefer `eskdf` method instead. - */ -export function deriveMainSeed(username, password) { - if (!strHasLength(username, 8, 255)) - throw new Error('invalid username'); - if (!strHasLength(password, 8, 255)) - throw new Error('invalid password'); - // Declared like this to throw off minifiers which auto-convert .fromCharCode(1) to actual string. - // String with non-ascii may be problematic in some envs - const codes = { _1: 1, _2: 2 }; - const sep = { s: String.fromCharCode(codes._1), p: String.fromCharCode(codes._2) }; - const scr = scrypt(password + sep.s, username + sep.s); - const pbk = pbkdf2(password + sep.p, username + sep.p); - const res = xor32(scr, pbk); - clean(scr, pbk); - return res; -} -/** - * Converts protocol & accountId pair to HKDF salt & info params. - */ -function getSaltInfo(protocol, accountId = 0) { - // Note that length here also repeats two lines below - // We do an additional length check here to reduce the scope of DoS attacks - if (!(strHasLength(protocol, 3, 15) && /^[a-z0-9]{3,15}$/.test(protocol))) { - throw new Error('invalid protocol'); - } - // Allow string account ids for some protocols - const allowsStr = /^password\d{0,3}|ssh|tor|file$/.test(protocol); - let salt; // Extract salt. Default is undefined. - if (typeof accountId === 'string') { - if (!allowsStr) - throw new Error('accountId must be a number'); - if (!strHasLength(accountId, 1, 255)) - throw new Error('accountId must be string of length 1..255'); - salt = kdfInputToBytes(accountId); - } - else if (Number.isSafeInteger(accountId)) { - if (accountId < 0 || accountId > Math.pow(2, 32) - 1) - throw new Error('invalid accountId'); - // Convert to Big Endian Uint32 - salt = new Uint8Array(4); - createView(salt).setUint32(0, accountId, false); - } - else { - throw new Error('accountId must be a number' + (allowsStr ? ' or string' : '')); - } - const info = kdfInputToBytes(protocol); - return { salt, info }; -} -function countBytes(num) { - if (typeof num !== 'bigint' || num <= BigInt(128)) - throw new Error('invalid number'); - return Math.ceil(num.toString(2).length / 8); -} -/** - * Parses keyLength and modulus options to extract length of result key. - * If modulus is used, adds 64 bits to it as per FIPS 186 B.4.1 to combat modulo bias. - */ -function getKeyLength(options) { - if (!options || typeof options !== 'object') - return 32; - const hasLen = 'keyLength' in options; - const hasMod = 'modulus' in options; - if (hasLen && hasMod) - throw new Error('cannot combine keyLength and modulus options'); - if (!hasLen && !hasMod) - throw new Error('must have either keyLength or modulus option'); - // FIPS 186 B.4.1 requires at least 64 more bits - const l = hasMod ? countBytes(options.modulus) + 8 : options.keyLength; - if (!(typeof l === 'number' && l >= 16 && l <= 8192)) - throw new Error('invalid keyLength'); - return l; -} -/** - * Converts key to bigint and divides it by modulus. Big Endian. - * Implements FIPS 186 B.4.1, which removes 0 and modulo bias from output. - */ -function modReduceKey(key, modulus) { - const _1 = BigInt(1); - const num = BigInt('0x' + bytesToHex(key)); // check for ui8a, then bytesToNumber() - const res = (num % (modulus - _1)) + _1; // Remove 0 from output - if (res < _1) - throw new Error('expected positive number'); // Guard against bad values - const len = key.length - 8; // FIPS requires 64 more bits = 8 bytes - const hex = res.toString(16).padStart(len * 2, '0'); // numberToHex() - const bytes = hexToBytes(hex); - if (bytes.length !== len) - throw new Error('invalid length of result key'); - return bytes; -} -/** - * ESKDF - * @param username - username, email, or identifier, min: 8 characters, should have enough entropy - * @param password - password, min: 8 characters, should have enough entropy - * @example - * const kdf = await eskdf('example-university', 'beginning-new-example'); - * const key = kdf.deriveChildKey('aes', 0); - * console.log(kdf.fingerprint); - * kdf.expire(); - */ -export async function eskdf(username, password) { - // We are using closure + object instead of class because - // we want to make `seed` non-accessible for any external function. - let seed = deriveMainSeed(username, password); - function deriveCK(protocol, accountId = 0, options) { - abytes(seed, 32); - const { salt, info } = getSaltInfo(protocol, accountId); // validate protocol & accountId - const keyLength = getKeyLength(options); // validate options - const key = hkdf(sha256, seed, salt, info, keyLength); - // Modulus has already been validated - return options && 'modulus' in options ? modReduceKey(key, options.modulus) : key; - } - function expire() { - if (seed) - seed.fill(1); - seed = undefined; - } - // prettier-ignore - const fingerprint = Array.from(deriveCK('fingerprint', 0)) - .slice(0, 6) - .map((char) => char.toString(16).padStart(2, '0').toUpperCase()) - .join(':'); - return Object.freeze({ deriveChildKey: deriveCK, expire, fingerprint }); -} -//# sourceMappingURL=eskdf.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/eskdf.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/eskdf.js.map deleted file mode 100644 index 1e00dcee..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/eskdf.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"eskdf.js","sourceRoot":"","sources":["src/eskdf.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEhG,wDAAwD;AACxD,gFAAgF;AAChF,sEAAsE;AAEtE,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE,CAAC;AAC9B,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE,CAAC;AAE9B,iBAAiB;AACjB,MAAM,U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,CAAC,CAAC,CAAC;SACvD,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;SACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;SAC/D,IAAI,CAAC,GAAG,CAAC,CAAC;IACb,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC;AAC1E,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/hkdf.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/hkdf.d.ts deleted file mode 100644 index 494f9870..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/hkdf.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { type CHash } from './utils.ts'; -/** - * HKDF-extract from spec. Less important part. `HKDF-Extract(IKM, salt) -> PRK` - * Arguments position differs from spec (IKM is first one, since it is not optional) - * @param hash - hash function that would be used (e.g. sha256) - * @param ikm - input keying material, the initial key - * @param salt - optional salt value (a non-secret random value) - */ -export declare function extract(hash: CHash, ikm: Uint8Array, salt?: Uint8Array): Uint8Array; -/** - * HKDF-expand from the spec. The most important part. `HKDF-Expand(PRK, info, L) -> OKM` - * @param hash - hash function that would be used (e.g. sha256) - * @param prk - a pseudorandom key of at least HashLen octets (usually, the output from the extract step) - * @param info - optional context and application specific information (can be a zero-length string) - * @param length - length of output keying material in bytes - */ -export declare function expand(hash: CHash, prk: Uint8Array, info?: Uint8Array, length?: number): Uint8Array; -/** - * HKDF (RFC 5869): derive keys from an initial input. - * Combines hkdf_extract + hkdf_expand in one step - * @param hash - hash function that would be used (e.g. sha256) - * @param ikm - input keying material, the initial key - * @param salt - optional salt value (a non-secret random value) - * @param info - optional context and application specific information (can be a zero-length string) - * @param length - length of output keying material in bytes - * @example - * import { hkdf } from '@noble/hashes/hkdf'; - * import { sha256 } from '@noble/hashes/sha2'; - * import { randomBytes } from '@noble/hashes/utils'; - * const inputKey = randomBytes(32); - * const salt = randomBytes(32); - * const info = 'application-key'; - * const hk1 = hkdf(sha256, inputKey, salt, info, 32); - */ -export declare const hkdf: (hash: CHash, ikm: Uint8Array, salt: Uint8Array | undefined, info: Uint8Array | undefined, length: number) => Uint8Array; -//# sourceMappingURL=hkdf.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/hkdf.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/hkdf.d.ts.map deleted file mode 100644 index 98876695..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/hkdf.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hkdf.d.ts","sourceRoot":"","sources":["src/hkdf.ts"],"names":[],"mappings":"AAMA,OAAO,EAA0B,KAAK,KAAK,EAAS,MAAM,YAAY,CAAC;AAEvE;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,UAAU,GAAG,UAAU,CAOnF;AAKD;;;;;;GAMG;AACH,wBAAgB,MAAM,CACpB,IAAI,EAAE,KAAK,EACX,GAAG,EAAE,UAAU,EACf,IAAI,CAAC,EAAE,UAAU,EACjB,MAAM,GAAE,MAAW,GAClB,UAAU,CA6BZ;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,IAAI,GACf,MAAM,KAAK,EACX,KAAK,UAAU,EACf,MAAM,UAAU,GAAG,SAAS,EAC5B,MAAM,UAAU,GAAG,SAAS,EAC5B,QAAQ,MAAM,KACb,UAAkE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/hkdf.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/hkdf.js deleted file mode 100644 index e4185263..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/hkdf.js +++ /dev/null @@ -1,84 +0,0 @@ -/** - * HKDF (RFC 5869): extract + expand in one step. - * See https://soatok.blog/2021/11/17/understanding-hkdf/. - * @module - */ -import { hmac } from "./hmac.js"; -import { abytes, ahash, anumber, clean } from "./utils.js"; -/** - * HKDF-extract from spec. Less important part. `HKDF-Extract(IKM, salt) -> PRK` - * Arguments position differs from spec (IKM is first one, since it is not optional) - * @param hash - hash function that would be used (e.g. sha256) - * @param ikm - input keying material, the initial key - * @param salt - optional salt value (a non-secret random value) - */ -export function extract(hash, ikm, salt) { - ahash(hash); - // NOTE: some libraries treat zero-length array as 'not provided'; - // we don't, since we have undefined as 'not provided' - // https://github.com/RustCrypto/KDFs/issues/15 - if (salt === undefined) - salt = new Uint8Array(hash.outputLen); - return hmac(hash, salt, ikm); -} -const HKDF_COUNTER = /* @__PURE__ */ Uint8Array.of(0); -const EMPTY_BUFFER = /* @__PURE__ */ Uint8Array.of(); -/** - * HKDF-expand from the spec. The most important part. `HKDF-Expand(PRK, info, L) -> OKM` - * @param hash - hash function that would be used (e.g. sha256) - * @param prk - a pseudorandom key of at least HashLen octets (usually, the output from the extract step) - * @param info - optional context and application specific information (can be a zero-length string) - * @param length - length of output keying material in bytes - */ -export function expand(hash, prk, info, length = 32) { - ahash(hash); - anumber(length, 'length'); - const olen = hash.outputLen; - if (length > 255 * olen) - throw new Error('Length must be <= 255*HashLen'); - const blocks = Math.ceil(length / olen); - if (info === undefined) - info = EMPTY_BUFFER; - else - abytes(info, undefined, 'info'); - // first L(ength) octets of T - const okm = new Uint8Array(blocks * olen); - // Re-use HMAC instance between blocks - const HMAC = hmac.create(hash, prk); - const HMACTmp = HMAC._cloneInto(); - const T = new Uint8Array(HMAC.outputLen); - for (let counter = 0; counter < blocks; counter++) { - HKDF_COUNTER[0] = counter + 1; - // T(0) = empty string (zero length) - // T(N) = HMAC-Hash(PRK, T(N-1) | info | N) - HMACTmp.update(counter === 0 ? EMPTY_BUFFER : T) - .update(info) - .update(HKDF_COUNTER) - .digestInto(T); - okm.set(T, olen * counter); - HMAC._cloneInto(HMACTmp); - } - HMAC.destroy(); - HMACTmp.destroy(); - clean(T, HKDF_COUNTER); - return okm.slice(0, length); -} -/** - * HKDF (RFC 5869): derive keys from an initial input. - * Combines hkdf_extract + hkdf_expand in one step - * @param hash - hash function that would be used (e.g. sha256) - * @param ikm - input keying material, the initial key - * @param salt - optional salt value (a non-secret random value) - * @param info - optional context and application specific information (can be a zero-length string) - * @param length - length of output keying material in bytes - * @example - * import { hkdf } from '@noble/hashes/hkdf'; - * import { sha256 } from '@noble/hashes/sha2'; - * import { randomBytes } from '@noble/hashes/utils'; - * const inputKey = randomBytes(32); - * const salt = randomBytes(32); - * const info = 'application-key'; - * const hk1 = hkdf(sha256, inputKey, salt, info, 32); - */ -export const hkdf = (hash, ikm, salt, info, length) => expand(hash, extract(hash, ikm, salt), info, length); -//# sourceMappingURL=hkdf.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/hkdf.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/hkdf.js.map deleted file mode 100644 index 00bc982e..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/hkdf.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hkdf.js","sourceRoot":"","sources":["src/hkdf.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAc,KAAK,EAAE,MAAM,YAAY,CAAC;AAEvE;;;;;;GAMG;AACH,MAAM,UAAU,OAAO,CAAC,IAAW,EAAE,GAAe,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AS,CAAC,CAAC;IACzC,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC;QAClD,YAAY,CAAC,CAAC,CAAC,GAAG,OAAO,GAAG,CAAC,CAAC;QAC9B,oCAAoC;QACpC,2CAA2C;QAC3C,OAAO,CAAC,MAAM,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;aAC7C,MAAM,CAAC,IAAI,CAAC;aACZ,MAAM,CAAC,YAAY,CAAC;aACpB,UAAU,CAAC,CAAC,CAAC,CAAC;QACjB,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC,CAAC;QAC3B,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;IACD,IAAI,CAAC,OAAO,EAAE,CAAC;IACf,OAAO,CAAC,OAAO,EAAE,CAAC;IAClB,KAAK,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;IACvB,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AAC9B,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAClB,IAAW,EACX,GAAe,EACf,IAA4B,EAC5B,IAA4B,EAC5B,MAAc,EACF,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/hmac.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/hmac.d.ts deleted file mode 100644 index 96c921bb..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/hmac.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * HMAC: RFC2104 message authentication code. - * @module - */ -import { type CHash, type Hash } from './utils.ts'; -/** Internal class for HMAC. */ -export declare class _HMAC> implements Hash<_HMAC> { - oHash: T; - iHash: T; - blockLen: number; - outputLen: number; - private finished; - private destroyed; - constructor(hash: CHash, key: Uint8Array); - update(buf: Uint8Array): this; - digestInto(out: Uint8Array): void; - digest(): Uint8Array; - _cloneInto(to?: _HMAC): _HMAC; - clone(): _HMAC; - destroy(): void; -} -/** - * HMAC: RFC2104 message authentication code. - * @param hash - function that would be used e.g. sha256 - * @param key - message key - * @param message - message data - * @example - * import { hmac } from '@noble/hashes/hmac'; - * import { sha256 } from '@noble/hashes/sha2'; - * const mac1 = hmac(sha256, 'key', 'message'); - */ -export declare const hmac: { - (hash: CHash, key: Uint8Array, message: Uint8Array): Uint8Array; - create(hash: CHash, key: Uint8Array): _HMAC; -}; -//# sourceMappingURL=hmac.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/hmac.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/hmac.d.ts.map deleted file mode 100644 index 24bf5093..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/hmac.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hmac.d.ts","sourceRoot":"","sources":["src/hmac.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAiC,KAAK,KAAK,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAElF,+BAA+B;AAC/B,qBAAa,KAAK,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,CAAC,CAAE,YAAW,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC7D,KAAK,EAAE,CAAC,CAAC;IACT,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,SAAS,CAAS;gBAEd,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU;IAqBxC,MAAM,CAAC,GAAG,EAAE,UAAU,GAAG,IAAI;IAK7B,UAAU,CAAC,GAAG,EAAE,UAAU,GAAG,IAAI;IASjC,MAAM,IAAI,UAAU;IAKpB,UAAU,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;IAanC,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC;IAGjB,OAAO,IAAI,IAAI;CAKhB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,IAAI,EAAE;IACjB,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,GAAG,UAAU,CAAC;IAChE,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;CAEC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/hmac.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/hmac.js deleted file mode 100644 index 1d9ff793..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/hmac.js +++ /dev/null @@ -1,90 +0,0 @@ -/** - * HMAC: RFC2104 message authentication code. - * @module - */ -import { abytes, aexists, ahash, clean } from "./utils.js"; -/** Internal class for HMAC. */ -export class _HMAC { - oHash; - iHash; - blockLen; - outputLen; - finished = false; - destroyed = false; - constructor(hash, key) { - ahash(hash); - abytes(key, undefined, 'key'); - this.iHash = hash.create(); - if (typeof this.iHash.update !== 'function') - throw new Error('Expected instance of class which extends utils.Hash'); - this.blockLen = this.iHash.blockLen; - this.outputLen = this.iHash.outputLen; - const blockLen = this.blockLen; - const pad = new Uint8Array(blockLen); - // blockLen can be bigger than outputLen - pad.set(key.length > blockLen ? hash.create().update(key).digest() : key); - for (let i = 0; i < pad.length; i++) - pad[i] ^= 0x36; - this.iHash.update(pad); - // By doing update (processing of first block) of outer hash here we can re-use it between multiple calls via clone - this.oHash = hash.create(); - // Undo internal XOR && apply outer XOR - for (let i = 0; i < pad.length; i++) - pad[i] ^= 0x36 ^ 0x5c; - this.oHash.update(pad); - clean(pad); - } - update(buf) { - aexists(this); - this.iHash.update(buf); - return this; - } - digestInto(out) { - aexists(this); - abytes(out, this.outputLen, 'output'); - this.finished = true; - this.iHash.digestInto(out); - this.oHash.update(out); - this.oHash.digestInto(out); - this.destroy(); - } - digest() { - const out = new Uint8Array(this.oHash.outputLen); - this.digestInto(out); - return out; - } - _cloneInto(to) { - // Create new instance without calling constructor since key already in state and we don't know it. - to ||= Object.create(Object.getPrototypeOf(this), {}); - const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this; - to = to; - to.finished = finished; - to.destroyed = destroyed; - to.blockLen = blockLen; - to.outputLen = outputLen; - to.oHash = oHash._cloneInto(to.oHash); - to.iHash = iHash._cloneInto(to.iHash); - return to; - } - clone() { - return this._cloneInto(); - } - destroy() { - this.destroyed = true; - this.oHash.destroy(); - this.iHash.destroy(); - } -} -/** - * HMAC: RFC2104 message authentication code. - * @param hash - function that would be used e.g. sha256 - * @param key - message key - * @param message - message data - * @example - * import { hmac } from '@noble/hashes/hmac'; - * import { sha256 } from '@noble/hashes/sha2'; - * const mac1 = hmac(sha256, 'key', 'message'); - */ -export const hmac = (hash, key, message) => new _HMAC(hash, key).update(message).digest(); -hmac.create = (hash, key) => new _HMAC(hash, key); -//# sourceMappingURL=hmac.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/hmac.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/hmac.js.map deleted file mode 100644 index 5e2b11e7..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/hmac.js.map +++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ure/bip32/node_modules/@noble/hashes/index.d.ts deleted file mode 100644 index e26a57a8..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/index.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/index.d.ts.map deleted file mode 100644 index 4e8c5816..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/index.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/index.js deleted file mode 100644 index 56354cbe..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/index.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Audited & minimal JS implementation of hash functions, MACs and KDFs. Check out individual modules. - * @module - * @example -```js -import { - sha256, sha384, sha512, sha224, sha512_224, sha512_256 -} from '@noble/hashes/sha2.js'; -import { - sha3_224, sha3_256, sha3_384, sha3_512, - keccak_224, keccak_256, keccak_384, keccak_512, - shake128, shake256 -} from '@noble/hashes/sha3.js'; -import { - cshake128, cshake256, - turboshake128, turboshake256, - kt128, kt256, - kmac128, kmac256, - tuplehash256, parallelhash256, - keccakprg -} from '@noble/hashes/sha3-addons.js'; -import { blake3 } from '@noble/hashes/blake3.js'; -import { blake2b, blake2s } from '@noble/hashes/blake2.js'; -import { hmac } from '@noble/hashes/hmac.js'; -import { hkdf } from '@noble/hashes/hkdf.js'; -import { pbkdf2, pbkdf2Async } from '@noble/hashes/pbkdf2.js'; -import { scrypt, scryptAsync } from '@noble/hashes/scrypt.js'; -import { md5, ripemd160, sha1 } from '@noble/hashes/legacy.js'; -import * as utils from '@noble/hashes/utils.js'; -``` - */ -throw new Error('root module cannot be imported: import submodules instead. Check out README'); -export {}; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/index.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/index.js.map deleted file mode 100644 index d0d21b94..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,IAAI,KAAK,CAAC,6EAA6E,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/legacy.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/legacy.d.ts deleted file mode 100644 index e3645c00..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/legacy.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -/** - -SHA1 (RFC 3174), MD5 (RFC 1321) and RIPEMD160 (RFC 2286) legacy, weak hash functions. -Don't use them in a new protocol. What "weak" means: - -- Collisions can be made with 2^18 effort in MD5, 2^60 in SHA1, 2^80 in RIPEMD160. -- No practical pre-image attacks (only theoretical, 2^123.4) -- HMAC seems kinda ok: https://www.rfc-editor.org/rfc/rfc6151 - * @module - */ -import { HashMD } from './_md.ts'; -import { type CHash } from './utils.ts'; -/** Internal SHA1 legacy hash class. */ -export declare class _SHA1 extends HashMD<_SHA1> { - private A; - private B; - private C; - private D; - private E; - constructor(); - protected get(): [number, number, number, number, number]; - protected set(A: number, B: number, C: number, D: number, E: number): void; - protected process(view: DataView, offset: number): void; - protected roundClean(): void; - destroy(): void; -} -/** SHA1 (RFC 3174) legacy hash function. It was cryptographically broken. */ -export declare const sha1: CHash; -/** Internal MD5 legacy hash class. */ -export declare class _MD5 extends HashMD<_MD5> { - private A; - private B; - private C; - private D; - constructor(); - protected get(): [number, number, number, number]; - protected set(A: number, B: number, C: number, D: number): void; - protected process(view: DataView, offset: number): void; - protected roundClean(): void; - destroy(): void; -} -/** - * MD5 (RFC 1321) legacy hash function. It was cryptographically broken. - * MD5 architecture is similar to SHA1, with some differences: - * - Reduced output length: 16 bytes (128 bit) instead of 20 - * - 64 rounds, instead of 80 - * - Little-endian: could be faster, but will require more code - * - Non-linear index selection: huge speed-up for unroll - * - Per round constants: more memory accesses, additional speed-up for unroll - */ -export declare const md5: CHash; -export declare class _RIPEMD160 extends HashMD<_RIPEMD160> { - private h0; - private h1; - private h2; - private h3; - private h4; - constructor(); - protected get(): [number, number, number, number, number]; - protected set(h0: number, h1: number, h2: number, h3: number, h4: number): void; - protected process(view: DataView, offset: number): void; - protected roundClean(): void; - destroy(): void; -} -/** - * RIPEMD-160 - a legacy hash function from 1990s. - * * https://homes.esat.kuleuven.be/~bosselae/ripemd160.html - * * https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf - */ -export declare const ripemd160: CHash; -//# sourceMappingURL=legacy.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/legacy.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/legacy.d.ts.map deleted file mode 100644 index 344bcccf..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/legacy.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"legacy.d.ts","sourceRoot":"","sources":["src/legacy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAO,MAAM,EAAO,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,KAAK,KAAK,EAA6B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S,CAAC,UAAU,IAAI,IAAI;IAG5B,OAAO,IAAI,IAAI;CAIhB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,GAAG,EAAE,KAAsD,CAAC;AA6CzE,qBAAa,UAAW,SAAQ,MAAM,CAAC,UAAU,CAAC;IAChD,OAAO,CAAC,EAAE,CAAkB;IAC5B,OAAO,CAAC,EAAE,CAAkB;IAC5B,OAAO,CAAC,EAAE,CAAkB;IAC5B,OAAO,CAAC,EAAE,CAAkB;IAC5B,OAAO,CAAC,EAAE,CAAkB;;IAK5B,SAAS,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;IAIzD,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI;IAO/E,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAmCvD,SAAS,CAAC,UAAU,IAAI,IAAI;IAG5B,OAAO,IAAI,IAAI;CAKhB;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,KAA4D,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/legacy.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/legacy.js deleted file mode 100644 index 841667a6..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/legacy.js +++ /dev/null @@ -1,281 +0,0 @@ -/** - -SHA1 (RFC 3174), MD5 (RFC 1321) and RIPEMD160 (RFC 2286) legacy, weak hash functions. -Don't use them in a new protocol. What "weak" means: - -- Collisions can be made with 2^18 effort in MD5, 2^60 in SHA1, 2^80 in RIPEMD160. -- No practical pre-image attacks (only theoretical, 2^123.4) -- HMAC seems kinda ok: https://www.rfc-editor.org/rfc/rfc6151 - * @module - */ -import { Chi, HashMD, Maj } from "./_md.js"; -import { clean, createHasher, rotl } from "./utils.js"; -/** Initial SHA1 state */ -const SHA1_IV = /* @__PURE__ */ Uint32Array.from([ - 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0, -]); -// Reusable temporary buffer -const SHA1_W = /* @__PURE__ */ new Uint32Array(80); -/** Internal SHA1 legacy hash class. */ -export class _SHA1 extends HashMD { - A = SHA1_IV[0] | 0; - B = SHA1_IV[1] | 0; - C = SHA1_IV[2] | 0; - D = SHA1_IV[3] | 0; - E = SHA1_IV[4] | 0; - constructor() { - super(64, 20, 8, false); - } - get() { - const { A, B, C, D, E } = this; - return [A, B, C, D, E]; - } - set(A, B, C, D, E) { - this.A = A | 0; - this.B = B | 0; - this.C = C | 0; - this.D = D | 0; - this.E = E | 0; - } - process(view, offset) { - for (let i = 0; i < 16; i++, offset += 4) - SHA1_W[i] = view.getUint32(offset, false); - for (let i = 16; i < 80; i++) - SHA1_W[i] = rotl(SHA1_W[i - 3] ^ SHA1_W[i - 8] ^ SHA1_W[i - 14] ^ SHA1_W[i - 16], 1); - // Compression function main loop, 80 rounds - let { A, B, C, D, E } = this; - for (let i = 0; i < 80; i++) { - let F, K; - if (i < 20) { - F = Chi(B, C, D); - K = 0x5a827999; - } - else if (i < 40) { - F = B ^ C ^ D; - K = 0x6ed9eba1; - } - else if (i < 60) { - F = Maj(B, C, D); - K = 0x8f1bbcdc; - } - else { - F = B ^ C ^ D; - K = 0xca62c1d6; - } - const T = (rotl(A, 5) + F + E + K + SHA1_W[i]) | 0; - E = D; - D = C; - C = rotl(B, 30); - B = A; - A = T; - } - // Add the compressed chunk to the current hash value - A = (A + this.A) | 0; - B = (B + this.B) | 0; - C = (C + this.C) | 0; - D = (D + this.D) | 0; - E = (E + this.E) | 0; - this.set(A, B, C, D, E); - } - roundClean() { - clean(SHA1_W); - } - destroy() { - this.set(0, 0, 0, 0, 0); - clean(this.buffer); - } -} -/** SHA1 (RFC 3174) legacy hash function. It was cryptographically broken. */ -export const sha1 = /* @__PURE__ */ createHasher(() => new _SHA1()); -/** Per-round constants */ -const p32 = /* @__PURE__ */ Math.pow(2, 32); -const K = /* @__PURE__ */ Array.from({ length: 64 }, (_, i) => Math.floor(p32 * Math.abs(Math.sin(i + 1)))); -/** md5 initial state: same as sha1, but 4 u32 instead of 5. */ -const MD5_IV = /* @__PURE__ */ SHA1_IV.slice(0, 4); -// Reusable temporary buffer -const MD5_W = /* @__PURE__ */ new Uint32Array(16); -/** Internal MD5 legacy hash class. */ -export class _MD5 extends HashMD { - A = MD5_IV[0] | 0; - B = MD5_IV[1] | 0; - C = MD5_IV[2] | 0; - D = MD5_IV[3] | 0; - constructor() { - super(64, 16, 8, true); - } - get() { - const { A, B, C, D } = this; - return [A, B, C, D]; - } - set(A, B, C, D) { - this.A = A | 0; - this.B = B | 0; - this.C = C | 0; - this.D = D | 0; - } - process(view, offset) { - for (let i = 0; i < 16; i++, offset += 4) - MD5_W[i] = view.getUint32(offset, true); - // Compression function main loop, 64 rounds - let { A, B, C, D } = this; - for (let i = 0; i < 64; i++) { - let F, g, s; - if (i < 16) { - F = Chi(B, C, D); - g = i; - s = [7, 12, 17, 22]; - } - else if (i < 32) { - F = Chi(D, B, C); - g = (5 * i + 1) % 16; - s = [5, 9, 14, 20]; - } - else if (i < 48) { - F = B ^ C ^ D; - g = (3 * i + 5) % 16; - s = [4, 11, 16, 23]; - } - else { - F = C ^ (B | ~D); - g = (7 * i) % 16; - s = [6, 10, 15, 21]; - } - F = F + A + K[i] + MD5_W[g]; - A = D; - D = C; - C = B; - B = B + rotl(F, s[i % 4]); - } - // Add the compressed chunk to the current hash value - A = (A + this.A) | 0; - B = (B + this.B) | 0; - C = (C + this.C) | 0; - D = (D + this.D) | 0; - this.set(A, B, C, D); - } - roundClean() { - clean(MD5_W); - } - destroy() { - this.set(0, 0, 0, 0); - clean(this.buffer); - } -} -/** - * MD5 (RFC 1321) legacy hash function. It was cryptographically broken. - * MD5 architecture is similar to SHA1, with some differences: - * - Reduced output length: 16 bytes (128 bit) instead of 20 - * - 64 rounds, instead of 80 - * - Little-endian: could be faster, but will require more code - * - Non-linear index selection: huge speed-up for unroll - * - Per round constants: more memory accesses, additional speed-up for unroll - */ -export const md5 = /* @__PURE__ */ createHasher(() => new _MD5()); -// RIPEMD-160 -const Rho160 = /* @__PURE__ */ Uint8Array.from([ - 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, -]); -const Id160 = /* @__PURE__ */ (() => Uint8Array.from(new Array(16).fill(0).map((_, i) => i)))(); -const Pi160 = /* @__PURE__ */ (() => Id160.map((i) => (9 * i + 5) % 16))(); -const idxLR = /* @__PURE__ */ (() => { - const L = [Id160]; - const R = [Pi160]; - const res = [L, R]; - for (let i = 0; i < 4; i++) - for (let j of res) - j.push(j[i].map((k) => Rho160[k])); - return res; -})(); -const idxL = /* @__PURE__ */ (() => idxLR[0])(); -const idxR = /* @__PURE__ */ (() => idxLR[1])(); -// const [idxL, idxR] = idxLR; -const shifts160 = /* @__PURE__ */ [ - [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8], - [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7], - [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9], - [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6], - [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5], -].map((i) => Uint8Array.from(i)); -const shiftsL160 = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts160[i][j])); -const shiftsR160 = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts160[i][j])); -const Kl160 = /* @__PURE__ */ Uint32Array.from([ - 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e, -]); -const Kr160 = /* @__PURE__ */ Uint32Array.from([ - 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000, -]); -// It's called f() in spec. -function ripemd_f(group, x, y, z) { - if (group === 0) - return x ^ y ^ z; - if (group === 1) - return (x & y) | (~x & z); - if (group === 2) - return (x | ~y) ^ z; - if (group === 3) - return (x & z) | (y & ~z); - return x ^ (y | ~z); -} -// Reusable temporary buffer -const BUF_160 = /* @__PURE__ */ new Uint32Array(16); -export class _RIPEMD160 extends HashMD { - h0 = 0x67452301 | 0; - h1 = 0xefcdab89 | 0; - h2 = 0x98badcfe | 0; - h3 = 0x10325476 | 0; - h4 = 0xc3d2e1f0 | 0; - constructor() { - super(64, 20, 8, true); - } - get() { - const { h0, h1, h2, h3, h4 } = this; - return [h0, h1, h2, h3, h4]; - } - set(h0, h1, h2, h3, h4) { - this.h0 = h0 | 0; - this.h1 = h1 | 0; - this.h2 = h2 | 0; - this.h3 = h3 | 0; - this.h4 = h4 | 0; - } - process(view, offset) { - for (let i = 0; i < 16; i++, offset += 4) - BUF_160[i] = view.getUint32(offset, true); - // prettier-ignore - let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el; - // Instead of iterating 0 to 80, we split it into 5 groups - // And use the groups in constants, functions, etc. Much simpler - for (let group = 0; group < 5; group++) { - const rGroup = 4 - group; - const hbl = Kl160[group], hbr = Kr160[group]; // prettier-ignore - const rl = idxL[group], rr = idxR[group]; // prettier-ignore - const sl = shiftsL160[group], sr = shiftsR160[group]; // prettier-ignore - for (let i = 0; i < 16; i++) { - const tl = (rotl(al + ripemd_f(group, bl, cl, dl) + BUF_160[rl[i]] + hbl, sl[i]) + el) | 0; - al = el, el = dl, dl = rotl(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore - } - // 2 loops are 10% faster - for (let i = 0; i < 16; i++) { - const tr = (rotl(ar + ripemd_f(rGroup, br, cr, dr) + BUF_160[rr[i]] + hbr, sr[i]) + er) | 0; - ar = er, er = dr, dr = rotl(cr, 10) | 0, cr = br, br = tr; // prettier-ignore - } - } - // Add the compressed chunk to the current hash value - this.set((this.h1 + cl + dr) | 0, (this.h2 + dl + er) | 0, (this.h3 + el + ar) | 0, (this.h4 + al + br) | 0, (this.h0 + bl + cr) | 0); - } - roundClean() { - clean(BUF_160); - } - destroy() { - this.destroyed = true; - clean(this.buffer); - this.set(0, 0, 0, 0, 0); - } -} -/** - * RIPEMD-160 - a legacy hash function from 1990s. - * * https://homes.esat.kuleuven.be/~bosselae/ripemd160.html - * * https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf - */ -export const ripemd160 = /* @__PURE__ */ createHasher(() => new _RIPEMD160()); -//# sourceMappingURL=legacy.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/legacy.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/legacy.js.map deleted file mode 100644 index dda38088..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/legacy.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"legacy.js","sourceRoot":"","sources":["src/legacy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAc,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEnE,yBAAyB;AACzB,MAAM,OAAO,GAAG,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC;IAC/C,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;CAC3D,CAAC,CAAC;AAEH,4BAA4B;AAC5B,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,WAAW,CAAC,E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,GAAG,CAAC,EACvB,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EACvB,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EACvB,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EACvB,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CACxB,CAAC;IACJ,CAAC;IACS,UAAU;QAClB,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IACD,OAAO;QACL,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnB,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1B,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAU,eAAe,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,IAAI,UAAU,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/package.json b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/package.json deleted file mode 100644 index dc8e6730..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/package.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "name": "@noble/hashes", - "version": "2.0.1", - "description": "Audited & minimal 0-dependency JS implementation of SHA, RIPEMD, BLAKE, HMAC, HKDF, PBKDF & Scrypt", - "files": [ - "*.js", - "*.js.map", - "*.d.ts", - "*.d.ts.map", - "src" - ], - "devDependencies": { - "@paulmillr/jsbt": "0.4.4", - "@types/node": "24.2.1", - "fast-check": "4.2.0", - "prettier": "3.6.2", - "typescript": "5.9.2" - }, - "scripts": { - "bench": "node test/benchmark/noble.ts", - "bench:compare": "MBENCH_DIMS='algorithm,buffer,library' node test/benchmark/hashes.ts", - "bench:compare-scrypt": "MBENCH_DIMS='iters,library' MBENCH_FILTER='async' node test/benchmark/scrypt.ts", - "bench:install": "cd test/benchmark; npm install", - "build": "tsc", - "build:release": "npx --no @paulmillr/jsbt esbuild test/build", - "build:clean": "rm *.{js,js.map,d.ts,d.ts.map} 2> /dev/null", - "format": "prettier --write 'src/**/*.{js,ts}' 'test/**/*.{js,ts}'", - "test": "node --experimental-strip-types --no-warnings test/index.ts", - "test:bun": "bun test/index.ts", - "test:deno": "deno --allow-env --allow-read test/index.ts", - "test:node20": "cd test; npx tsc; node compiled/test/index.js", - "test:dos": "node --experimental-strip-types test/slow-dos.test.ts", - "test:big": "node --experimental-strip-types test/slow-big.test.ts", - "test:acvp": "node --experimental-strip-types test/slow-acvp.test.ts", - "test:kdf": "node --experimental-strip-types test/slow-kdf.test.ts" - }, - "exports": { - ".": "./index.js", - "./_md.js": "./_md.js", - "./argon2.js": "./argon2.js", - "./blake1.js": "./blake1.js", - "./blake2.js": "./blake2.js", - "./blake3.js": "./blake3.js", - "./eskdf.js": "./eskdf.js", - "./hkdf.js": "./hkdf.js", - "./hmac.js": "./hmac.js", - "./legacy.js": "./legacy.js", - "./pbkdf2.js": "./pbkdf2.js", - "./scrypt.js": "./scrypt.js", - "./sha2.js": "./sha2.js", - "./sha3-addons.js": "./sha3-addons.js", - "./sha3.js": "./sha3.js", - "./webcrypto.js": "./webcrypto.js", - "./utils.js": "./utils.js" - }, - "engines": { - "node": ">= 20.19.0" - }, - "keywords": [ - "sha1", - "sha2", - "sha3", - "blake", - "blake2", - "blake3", - "hmac", - "hkdf", - "pbkdf2", - "scrypt", - "sha256", - "sha512", - "keccak", - "ripemd160", - "kdf", - "hash", - "cryptography", - "security", - "noble" - ], - "homepage": "https://paulmillr.com/noble/", - "funding": "https://paulmillr.com/funding/", - "repository": { - "type": "git", - "url": "git+https://github.com/paulmillr/noble-hashes.git" - }, - "type": "module", - "main": "index.js", - "module": "index.js", - "types": "index.d.ts", - "sideEffects": false, - "author": "Paul Miller (https://paulmillr.com)", - "license": "MIT" -} diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/pbkdf2.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/pbkdf2.d.ts deleted file mode 100644 index 753b14f7..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/pbkdf2.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { type CHash, type KDFInput } from './utils.ts'; -/** - * PBKDF2 options: - * * c: iterations, should probably be higher than 100_000 - * * dkLen: desired length of derived key in bytes - * * asyncTick: max time in ms for which async function can block execution - */ -export type Pbkdf2Opt = { - c: number; - dkLen?: number; - asyncTick?: number; -}; -/** - * PBKDF2-HMAC: RFC 2898 key derivation function - * @param hash - hash function that would be used e.g. sha256 - * @param password - password from which a derived key is generated - * @param salt - cryptographic salt - * @param opts - {c, dkLen} where c is work factor and dkLen is output message size - * @example - * const key = pbkdf2(sha256, 'password', 'salt', { dkLen: 32, c: Math.pow(2, 18) }); - */ -export declare function pbkdf2(hash: CHash, password: KDFInput, salt: KDFInput, opts: Pbkdf2Opt): Uint8Array; -/** - * PBKDF2-HMAC: RFC 2898 key derivation function. Async version. - * @example - * await pbkdf2Async(sha256, 'password', 'salt', { dkLen: 32, c: 500_000 }); - */ -export declare function pbkdf2Async(hash: CHash, password: KDFInput, salt: KDFInput, opts: Pbkdf2Opt): Promise; -//# sourceMappingURL=pbkdf2.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/pbkdf2.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/pbkdf2.d.ts.map deleted file mode 100644 index 9932d164..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/pbkdf2.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pbkdf2.d.ts","sourceRoot":"","sources":["src/pbkdf2.ts"],"names":[],"mappings":"AAMA,OAAO,EAGL,KAAK,KAAK,EAEV,KAAK,QAAQ,EACd,MAAM,YAAY,CAAC;AAEpB;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAkCF;;;;;;;;GAQG;AACH,wBAAgB,MAAM,CACpB,IAAI,EAAE,KAAK,EACX,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,SAAS,GACd,UAAU,CAsBZ;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,KAAK,EACX,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,SAAS,GACd,OAAO,CAAC,UAAU,CAAC,CAsBrB"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/pbkdf2.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/pbkdf2.js deleted file mode 100644 index 927b0259..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/pbkdf2.js +++ /dev/null @@ -1,97 +0,0 @@ -/** - * PBKDF (RFC 2898). Can be used to create a key from password and salt. - * @module - */ -import { hmac } from "./hmac.js"; -// prettier-ignore -import { ahash, anumber, asyncLoop, checkOpts, clean, createView, kdfInputToBytes } from "./utils.js"; -// Common start and end for sync/async functions -function pbkdf2Init(hash, _password, _salt, _opts) { - ahash(hash); - const opts = checkOpts({ dkLen: 32, asyncTick: 10 }, _opts); - const { c, dkLen, asyncTick } = opts; - anumber(c, 'c'); - anumber(dkLen, 'dkLen'); - anumber(asyncTick, 'asyncTick'); - if (c < 1) - throw new Error('iterations (c) must be >= 1'); - const password = kdfInputToBytes(_password, 'password'); - const salt = kdfInputToBytes(_salt, 'salt'); - // DK = PBKDF2(PRF, Password, Salt, c, dkLen); - const DK = new Uint8Array(dkLen); - // U1 = PRF(Password, Salt + INT_32_BE(i)) - const PRF = hmac.create(hash, password); - const PRFSalt = PRF._cloneInto().update(salt); - return { c, dkLen, asyncTick, DK, PRF, PRFSalt }; -} -function pbkdf2Output(PRF, PRFSalt, DK, prfW, u) { - PRF.destroy(); - PRFSalt.destroy(); - if (prfW) - prfW.destroy(); - clean(u); - return DK; -} -/** - * PBKDF2-HMAC: RFC 2898 key derivation function - * @param hash - hash function that would be used e.g. sha256 - * @param password - password from which a derived key is generated - * @param salt - cryptographic salt - * @param opts - {c, dkLen} where c is work factor and dkLen is output message size - * @example - * const key = pbkdf2(sha256, 'password', 'salt', { dkLen: 32, c: Math.pow(2, 18) }); - */ -export function pbkdf2(hash, password, salt, opts) { - const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts); - let prfW; // Working copy - const arr = new Uint8Array(4); - const view = createView(arr); - const u = new Uint8Array(PRF.outputLen); - // DK = T1 + T2 + ⋯ + Tdklen/hlen - for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { - // Ti = F(Password, Salt, c, i) - const Ti = DK.subarray(pos, pos + PRF.outputLen); - view.setInt32(0, ti, false); - // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc - // U1 = PRF(Password, Salt + INT_32_BE(i)) - (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); - Ti.set(u.subarray(0, Ti.length)); - for (let ui = 1; ui < c; ui++) { - // Uc = PRF(Password, Uc−1) - PRF._cloneInto(prfW).update(u).digestInto(u); - for (let i = 0; i < Ti.length; i++) - Ti[i] ^= u[i]; - } - } - return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); -} -/** - * PBKDF2-HMAC: RFC 2898 key derivation function. Async version. - * @example - * await pbkdf2Async(sha256, 'password', 'salt', { dkLen: 32, c: 500_000 }); - */ -export async function pbkdf2Async(hash, password, salt, opts) { - const { c, dkLen, asyncTick, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts); - let prfW; // Working copy - const arr = new Uint8Array(4); - const view = createView(arr); - const u = new Uint8Array(PRF.outputLen); - // DK = T1 + T2 + ⋯ + Tdklen/hlen - for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { - // Ti = F(Password, Salt, c, i) - const Ti = DK.subarray(pos, pos + PRF.outputLen); - view.setInt32(0, ti, false); - // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc - // U1 = PRF(Password, Salt + INT_32_BE(i)) - (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); - Ti.set(u.subarray(0, Ti.length)); - await asyncLoop(c - 1, asyncTick, () => { - // Uc = PRF(Password, Uc−1) - PRF._cloneInto(prfW).update(u).digestInto(u); - for (let i = 0; i < Ti.length; i++) - Ti[i] ^= u[i]; - }); - } - return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); -} -//# sourceMappingURL=pbkdf2.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/pbkdf2.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/pbkdf2.js.map deleted file mode 100644 index 73a5afb0..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/pbkdf2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pbkdf2.js","sourceRoot":"","sources":["src/pbkdf2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,kBAAkB;AAClB,OAAO,EACL,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,eAAe,EAIzD,MAAM,YAAY,CAAC;AAapB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AAC,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;QAC5B,6CAA6C;QAC7C,0CAA0C;QAC1C,CAAC,IAAI,GAAG,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAC5D,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;QACjC,MAAM,SAAS,CAAC,CAAC,GAAG,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE;YACrC,2BAA2B;YAC3B,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YAC7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE;gBAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;IACL,CAAC;IACD,OAAO,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACjD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/scrypt.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/scrypt.d.ts deleted file mode 100644 index cb05a204..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/scrypt.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { type KDFInput } from './utils.ts'; -/** - * Scrypt options: - * - `N` is cpu/mem work factor (power of 2 e.g. `2**18`) - * - `r` is block size (8 is common), fine-tunes sequential memory read size and performance - * - `p` is parallelization factor (1 is common) - * - `dkLen` is output key length in bytes e.g. 32. - * - `asyncTick` - (default: 10) max time in ms for which async function can block execution - * - `maxmem` - (default: `1024 ** 3 + 1024` aka 1GB+1KB). A limit that the app could use for scrypt - * - `onProgress` - callback function that would be executed for progress report - */ -export type ScryptOpts = { - N: number; - r: number; - p: number; - dkLen?: number; - asyncTick?: number; - maxmem?: number; - onProgress?: (progress: number) => void; -}; -/** - * Scrypt KDF from RFC 7914. See {@link ScryptOpts}. - * @example - * scrypt('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 }); - */ -export declare function scrypt(password: KDFInput, salt: KDFInput, opts: ScryptOpts): Uint8Array; -/** - * Scrypt KDF from RFC 7914. Async version. See {@link ScryptOpts}. - * @example - * await scryptAsync('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 }); - */ -export declare function scryptAsync(password: KDFInput, salt: KDFInput, opts: ScryptOpts): Promise; -//# sourceMappingURL=scrypt.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/scrypt.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/scrypt.d.ts.map deleted file mode 100644 index 2d178f1a..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/scrypt.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"scrypt.d.ts","sourceRoot":"","sources":["src/scrypt.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,KAAK,QAAQ,EAGd,MAAM,YAAY,CAAC;AAuEpB;;;;;;;;;GASG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC,CAAC;AA2EF;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,GAAG,UAAU,CA2BvF;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,UAAU,GACf,OAAO,CAAC,UAAU,CAAC,CA4BrB"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/scrypt.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/scrypt.js deleted file mode 100644 index cb71fe8d..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/scrypt.js +++ /dev/null @@ -1,216 +0,0 @@ -/** - * RFC 7914 Scrypt KDF. Can be used to create a key from password and salt. - * @module - */ -import { pbkdf2 } from "./pbkdf2.js"; -import { sha256 } from "./sha2.js"; -// prettier-ignore -import { anumber, asyncLoop, checkOpts, clean, rotl, swap32IfBE, u32 } from "./utils.js"; -// The main Scrypt loop: uses Salsa extensively. -// Six versions of the function were tried, this is the fastest one. -// prettier-ignore -function XorAndSalsa(prev, pi, input, ii, out, oi) { - // Based on https://cr.yp.to/salsa20.html - // Xor blocks - let y00 = prev[pi++] ^ input[ii++], y01 = prev[pi++] ^ input[ii++]; - let y02 = prev[pi++] ^ input[ii++], y03 = prev[pi++] ^ input[ii++]; - let y04 = prev[pi++] ^ input[ii++], y05 = prev[pi++] ^ input[ii++]; - let y06 = prev[pi++] ^ input[ii++], y07 = prev[pi++] ^ input[ii++]; - let y08 = prev[pi++] ^ input[ii++], y09 = prev[pi++] ^ input[ii++]; - let y10 = prev[pi++] ^ input[ii++], y11 = prev[pi++] ^ input[ii++]; - let y12 = prev[pi++] ^ input[ii++], y13 = prev[pi++] ^ input[ii++]; - let y14 = prev[pi++] ^ input[ii++], y15 = prev[pi++] ^ input[ii++]; - // Save state to temporary variables (salsa) - let x00 = y00, x01 = y01, x02 = y02, x03 = y03, x04 = y04, x05 = y05, x06 = y06, x07 = y07, x08 = y08, x09 = y09, x10 = y10, x11 = y11, x12 = y12, x13 = y13, x14 = y14, x15 = y15; - // Main loop (salsa) - for (let i = 0; i < 8; i += 2) { - x04 ^= rotl(x00 + x12 | 0, 7); - x08 ^= rotl(x04 + x00 | 0, 9); - x12 ^= rotl(x08 + x04 | 0, 13); - x00 ^= rotl(x12 + x08 | 0, 18); - x09 ^= rotl(x05 + x01 | 0, 7); - x13 ^= rotl(x09 + x05 | 0, 9); - x01 ^= rotl(x13 + x09 | 0, 13); - x05 ^= rotl(x01 + x13 | 0, 18); - x14 ^= rotl(x10 + x06 | 0, 7); - x02 ^= rotl(x14 + x10 | 0, 9); - x06 ^= rotl(x02 + x14 | 0, 13); - x10 ^= rotl(x06 + x02 | 0, 18); - x03 ^= rotl(x15 + x11 | 0, 7); - x07 ^= rotl(x03 + x15 | 0, 9); - x11 ^= rotl(x07 + x03 | 0, 13); - x15 ^= rotl(x11 + x07 | 0, 18); - x01 ^= rotl(x00 + x03 | 0, 7); - x02 ^= rotl(x01 + x00 | 0, 9); - x03 ^= rotl(x02 + x01 | 0, 13); - x00 ^= rotl(x03 + x02 | 0, 18); - x06 ^= rotl(x05 + x04 | 0, 7); - x07 ^= rotl(x06 + x05 | 0, 9); - x04 ^= rotl(x07 + x06 | 0, 13); - x05 ^= rotl(x04 + x07 | 0, 18); - x11 ^= rotl(x10 + x09 | 0, 7); - x08 ^= rotl(x11 + x10 | 0, 9); - x09 ^= rotl(x08 + x11 | 0, 13); - x10 ^= rotl(x09 + x08 | 0, 18); - x12 ^= rotl(x15 + x14 | 0, 7); - x13 ^= rotl(x12 + x15 | 0, 9); - x14 ^= rotl(x13 + x12 | 0, 13); - x15 ^= rotl(x14 + x13 | 0, 18); - } - // Write output (salsa) - out[oi++] = (y00 + x00) | 0; - out[oi++] = (y01 + x01) | 0; - out[oi++] = (y02 + x02) | 0; - out[oi++] = (y03 + x03) | 0; - out[oi++] = (y04 + x04) | 0; - out[oi++] = (y05 + x05) | 0; - out[oi++] = (y06 + x06) | 0; - out[oi++] = (y07 + x07) | 0; - out[oi++] = (y08 + x08) | 0; - out[oi++] = (y09 + x09) | 0; - out[oi++] = (y10 + x10) | 0; - out[oi++] = (y11 + x11) | 0; - out[oi++] = (y12 + x12) | 0; - out[oi++] = (y13 + x13) | 0; - out[oi++] = (y14 + x14) | 0; - out[oi++] = (y15 + x15) | 0; -} -function BlockMix(input, ii, out, oi, r) { - // The block B is r 128-byte chunks (which is equivalent of 2r 64-byte chunks) - let head = oi + 0; - let tail = oi + 16 * r; - for (let i = 0; i < 16; i++) - out[tail + i] = input[ii + (2 * r - 1) * 16 + i]; // X ← B[2r−1] - for (let i = 0; i < r; i++, head += 16, ii += 16) { - // We write odd & even Yi at same time. Even: 0bXXXXX0 Odd: 0bXXXXX1 - XorAndSalsa(out, tail, input, ii, out, head); // head[i] = Salsa(blockIn[2*i] ^ tail[i-1]) - if (i > 0) - tail += 16; // First iteration overwrites tmp value in tail - XorAndSalsa(out, head, input, (ii += 16), out, tail); // tail[i] = Salsa(blockIn[2*i+1] ^ head[i]) - } -} -// Common prologue and epilogue for sync/async functions -function scryptInit(password, salt, _opts) { - // Maxmem - 1GB+1KB by default - const opts = checkOpts({ - dkLen: 32, - asyncTick: 10, - maxmem: 1024 ** 3 + 1024, - }, _opts); - const { N, r, p, dkLen, asyncTick, maxmem, onProgress } = opts; - anumber(N, 'N'); - anumber(r, 'r'); - anumber(p, 'p'); - anumber(dkLen, 'dkLen'); - anumber(asyncTick, 'asyncTick'); - anumber(maxmem, 'maxmem'); - if (onProgress !== undefined && typeof onProgress !== 'function') - throw new Error('progressCb must be a function'); - const blockSize = 128 * r; - const blockSize32 = blockSize / 4; - // Max N is 2^32 (Integrify is 32-bit). - // Real limit can be 2^22: some JS engines limit Uint8Array to 4GB. - // Spec check `N >= 2^(blockSize / 8)` is not done for compat with popular libs, - // which used incorrect r: 1, p: 8. Also, the check seems to be a spec error: - // https://www.rfc-editor.org/errata_search.php?rfc=7914 - const pow32 = Math.pow(2, 32); - if (N <= 1 || (N & (N - 1)) !== 0 || N > pow32) - throw new Error('"N" expected a power of 2, and 2^1 <= N <= 2^32'); - if (p < 1 || p > ((pow32 - 1) * 32) / blockSize) - throw new Error('"p" expected integer 1..((2^32 - 1) * 32) / (128 * r)'); - if (dkLen < 1 || dkLen > (pow32 - 1) * 32) - throw new Error('"dkLen" expected integer 1..(2^32 - 1) * 32'); - const memUsed = blockSize * (N + p); - if (memUsed > maxmem) - throw new Error('"maxmem" limit was hit, expected 128*r*(N+p) <= "maxmem"=' + maxmem); - // [B0...Bp−1] ← PBKDF2HMAC-SHA256(Passphrase, Salt, 1, blockSize*ParallelizationFactor) - // Since it has only one iteration there is no reason to use async variant - const B = pbkdf2(sha256, password, salt, { c: 1, dkLen: blockSize * p }); - const B32 = u32(B); - // Re-used between parallel iterations. Array(iterations) of B - const V = u32(new Uint8Array(blockSize * N)); - const tmp = u32(new Uint8Array(blockSize)); - let blockMixCb = () => { }; - if (onProgress) { - const totalBlockMix = 2 * N * p; - // Invoke callback if progress changes from 10.01 to 10.02 - // Allows to draw smooth progress bar on up to 8K screen - const callbackPer = Math.max(Math.floor(totalBlockMix / 10000), 1); - let blockMixCnt = 0; - blockMixCb = () => { - blockMixCnt++; - if (onProgress && (!(blockMixCnt % callbackPer) || blockMixCnt === totalBlockMix)) - onProgress(blockMixCnt / totalBlockMix); - }; - } - return { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick }; -} -function scryptOutput(password, dkLen, B, V, tmp) { - const res = pbkdf2(sha256, password, B, { c: 1, dkLen }); - clean(B, V, tmp); - return res; -} -/** - * Scrypt KDF from RFC 7914. See {@link ScryptOpts}. - * @example - * scrypt('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 }); - */ -export function scrypt(password, salt, opts) { - const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb } = scryptInit(password, salt, opts); - swap32IfBE(B32); - for (let pi = 0; pi < p; pi++) { - const Pi = blockSize32 * pi; - for (let i = 0; i < blockSize32; i++) - V[i] = B32[Pi + i]; // V[0] = B[i] - for (let i = 0, pos = 0; i < N - 1; i++) { - BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]); - blockMixCb(); - } - BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element - blockMixCb(); - for (let i = 0; i < N; i++) { - // First u32 of the last 64-byte block (u32 is LE) - // & (N - 1) is % N as N is a power of 2, N & (N - 1) = 0 is checked above; >>> 0 for unsigned, input fits in u32 - const j = (B32[Pi + blockSize32 - 16] & (N - 1)) >>> 0; // j = Integrify(X) % iterations - for (let k = 0; k < blockSize32; k++) - tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j] - BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) - blockMixCb(); - } - } - swap32IfBE(B32); - return scryptOutput(password, dkLen, B, V, tmp); -} -/** - * Scrypt KDF from RFC 7914. Async version. See {@link ScryptOpts}. - * @example - * await scryptAsync('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 }); - */ -export async function scryptAsync(password, salt, opts) { - const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick } = scryptInit(password, salt, opts); - swap32IfBE(B32); - for (let pi = 0; pi < p; pi++) { - const Pi = blockSize32 * pi; - for (let i = 0; i < blockSize32; i++) - V[i] = B32[Pi + i]; // V[0] = B[i] - let pos = 0; - await asyncLoop(N - 1, asyncTick, () => { - BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]); - blockMixCb(); - }); - BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element - blockMixCb(); - await asyncLoop(N, asyncTick, () => { - // First u32 of the last 64-byte block (u32 is LE) - // & (N - 1) is % N as N is a power of 2, N & (N - 1) = 0 is checked above; >>> 0 for unsigned, input fits in u32 - const j = (B32[Pi + blockSize32 - 16] & (N - 1)) >>> 0; // j = Integrify(X) % iterations - for (let k = 0; k < blockSize32; k++) - tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j] - BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) - blockMixCb(); - }); - } - swap32IfBE(B32); - return scryptOutput(password, dkLen, B, V, tmp); -} -//# sourceMappingURL=scrypt.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/scrypt.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/scrypt.js.map deleted file mode 100644 index ddb00d53..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/scrypt.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"scrypt.js","sourceRoot":"","sources":["src/scrypt.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,kBAAkB;AAClB,OAAO,EACL,OAAO,EAAE,SAAS,EAClB,SAAS,EAAE,KAAK,EACD,IAAI,EACnB,UAAU,EACV,GAAG,EACJ,MAAM,YAAY,CAAC;AAEpB,gDAAgD;AAChD,oEAAoE;AACpE,kBAAkB;AAClB,SAAS,WAAW,CAClB,IAAiB,EACjB,EAAU,EACV,KAAkB,EAClB,EAAU,EACV,GAAgB,EAChB,EAAU;IAEV,yCAAyC;IACzC,aAAa;IACb,IAAI,GAAG,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,EAAE,EAAE,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;IACnE,IAAI,GA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QACf,CAAC,CAAC,CAAC;IACL,CAAC;IACD,UAAU,CAAC,GAAG,CAAC,CAAC;IAChB,OAAO,YAAY,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;AAClD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha2.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha2.d.ts deleted file mode 100644 index 67270432..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha2.d.ts +++ /dev/null @@ -1,199 +0,0 @@ -/** - * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256. - * SHA256 is the fastest hash implementable in JS, even faster than Blake3. - * Check out [RFC 4634](https://www.rfc-editor.org/rfc/rfc4634) and - * [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf). - * @module - */ -import { HashMD } from './_md.ts'; -import { type CHash } from './utils.ts'; -/** Internal 32-byte base SHA2 hash class. */ -declare abstract class SHA2_32B> extends HashMD { - protected abstract A: number; - protected abstract B: number; - protected abstract C: number; - protected abstract D: number; - protected abstract E: number; - protected abstract F: number; - protected abstract G: number; - protected abstract H: number; - constructor(outputLen: number); - protected get(): [number, number, number, number, number, number, number, number]; - protected set(A: number, B: number, C: number, D: number, E: number, F: number, G: number, H: number): void; - protected process(view: DataView, offset: number): void; - protected roundClean(): void; - destroy(): void; -} -/** Internal SHA2-256 hash class. */ -export declare class _SHA256 extends SHA2_32B<_SHA256> { - protected A: number; - protected B: number; - protected C: number; - protected D: number; - protected E: number; - protected F: number; - protected G: number; - protected H: number; - constructor(); -} -/** Internal SHA2-224 hash class. */ -export declare class _SHA224 extends SHA2_32B<_SHA224> { - protected A: number; - protected B: number; - protected C: number; - protected D: number; - protected E: number; - protected F: number; - protected G: number; - protected H: number; - constructor(); -} -/** Internal 64-byte base SHA2 hash class. */ -declare abstract class SHA2_64B> extends HashMD { - protected abstract Ah: number; - protected abstract Al: number; - protected abstract Bh: number; - protected abstract Bl: number; - protected abstract Ch: number; - protected abstract Cl: number; - protected abstract Dh: number; - protected abstract Dl: number; - protected abstract Eh: number; - protected abstract El: number; - protected abstract Fh: number; - protected abstract Fl: number; - protected abstract Gh: number; - protected abstract Gl: number; - protected abstract Hh: number; - protected abstract Hl: number; - constructor(outputLen: number); - protected get(): [ - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number - ]; - protected set(Ah: number, Al: number, Bh: number, Bl: number, Ch: number, Cl: number, Dh: number, Dl: number, Eh: number, El: number, Fh: number, Fl: number, Gh: number, Gl: number, Hh: number, Hl: number): void; - protected process(view: DataView, offset: number): void; - protected roundClean(): void; - destroy(): void; -} -/** Internal SHA2-512 hash class. */ -export declare class _SHA512 extends SHA2_64B<_SHA512> { - protected Ah: number; - protected Al: number; - protected Bh: number; - protected Bl: number; - protected Ch: number; - protected Cl: number; - protected Dh: number; - protected Dl: number; - protected Eh: number; - protected El: number; - protected Fh: number; - protected Fl: number; - protected Gh: number; - protected Gl: number; - protected Hh: number; - protected Hl: number; - constructor(); -} -/** Internal SHA2-384 hash class. */ -export declare class _SHA384 extends SHA2_64B<_SHA384> { - protected Ah: number; - protected Al: number; - protected Bh: number; - protected Bl: number; - protected Ch: number; - protected Cl: number; - protected Dh: number; - protected Dl: number; - protected Eh: number; - protected El: number; - protected Fh: number; - protected Fl: number; - protected Gh: number; - protected Gl: number; - protected Hh: number; - protected Hl: number; - constructor(); -} -/** Internal SHA2-512/224 hash class. */ -export declare class _SHA512_224 extends SHA2_64B<_SHA512_224> { - protected Ah: number; - protected Al: number; - protected Bh: number; - protected Bl: number; - protected Ch: number; - protected Cl: number; - protected Dh: number; - protected Dl: number; - protected Eh: number; - protected El: number; - protected Fh: number; - protected Fl: number; - protected Gh: number; - protected Gl: number; - protected Hh: number; - protected Hl: number; - constructor(); -} -/** Internal SHA2-512/256 hash class. */ -export declare class _SHA512_256 extends SHA2_64B<_SHA512_256> { - protected Ah: number; - protected Al: number; - protected Bh: number; - protected Bl: number; - protected Ch: number; - protected Cl: number; - protected Dh: number; - protected Dl: number; - protected Eh: number; - protected El: number; - protected Fh: number; - protected Fl: number; - protected Gh: number; - protected Gl: number; - protected Hh: number; - protected Hl: number; - constructor(); -} -/** - * SHA2-256 hash function from RFC 4634. In JS it's the fastest: even faster than Blake3. Some info: - * - * - Trying 2^128 hashes would get 50% chance of collision, using birthday attack. - * - BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025. - * - Each sha256 hash is executing 2^18 bit operations. - * - Good 2024 ASICs can do 200Th/sec with 3500 watts of power, corresponding to 2^36 hashes/joule. - */ -export declare const sha256: CHash<_SHA256>; -/** SHA2-224 hash function from RFC 4634 */ -export declare const sha224: CHash<_SHA224>; -/** SHA2-512 hash function from RFC 4634. */ -export declare const sha512: CHash<_SHA512>; -/** SHA2-384 hash function from RFC 4634. */ -export declare const sha384: CHash<_SHA384>; -/** - * SHA2-512/256 "truncated" hash function, with improved resistance to length extension attacks. - * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf). - */ -export declare const sha512_256: CHash<_SHA512_256>; -/** - * SHA2-512/224 "truncated" hash function, with improved resistance to length extension attacks. - * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf). - */ -export declare const sha512_224: CHash<_SHA512_224>; -export {}; -//# sourceMappingURL=sha2.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha2.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha2.d.ts.map deleted file mode 100644 index 6096ce09..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha2.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha2.d.ts","sourceRoot":"","sources":["src/sha2.ts"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AAW,CAGzC,CAAC;AACF;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,WAAW,CAGzC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha2.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha2.js deleted file mode 100644 index 21553b1c..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha2.js +++ /dev/null @@ -1,397 +0,0 @@ -/** - * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256. - * SHA256 is the fastest hash implementable in JS, even faster than Blake3. - * Check out [RFC 4634](https://www.rfc-editor.org/rfc/rfc4634) and - * [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf). - * @module - */ -import { Chi, HashMD, Maj, SHA224_IV, SHA256_IV, SHA384_IV, SHA512_IV } from "./_md.js"; -import * as u64 from "./_u64.js"; -import { clean, createHasher, oidNist, rotr } from "./utils.js"; -/** - * Round constants: - * First 32 bits of fractional parts of the cube roots of the first 64 primes 2..311) - */ -// prettier-ignore -const SHA256_K = /* @__PURE__ */ Uint32Array.from([ - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 -]); -/** Reusable temporary buffer. "W" comes straight from spec. */ -const SHA256_W = /* @__PURE__ */ new Uint32Array(64); -/** Internal 32-byte base SHA2 hash class. */ -class SHA2_32B extends HashMD { - constructor(outputLen) { - super(64, outputLen, 8, false); - } - get() { - const { A, B, C, D, E, F, G, H } = this; - return [A, B, C, D, E, F, G, H]; - } - // prettier-ignore - set(A, B, C, D, E, F, G, H) { - this.A = A | 0; - this.B = B | 0; - this.C = C | 0; - this.D = D | 0; - this.E = E | 0; - this.F = F | 0; - this.G = G | 0; - this.H = H | 0; - } - process(view, offset) { - // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array - for (let i = 0; i < 16; i++, offset += 4) - SHA256_W[i] = view.getUint32(offset, false); - for (let i = 16; i < 64; i++) { - const W15 = SHA256_W[i - 15]; - const W2 = SHA256_W[i - 2]; - const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3); - const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10); - SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0; - } - // Compression function main loop, 64 rounds - let { A, B, C, D, E, F, G, H } = this; - for (let i = 0; i < 64; i++) { - const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25); - const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; - const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22); - const T2 = (sigma0 + Maj(A, B, C)) | 0; - H = G; - G = F; - F = E; - E = (D + T1) | 0; - D = C; - C = B; - B = A; - A = (T1 + T2) | 0; - } - // Add the compressed chunk to the current hash value - A = (A + this.A) | 0; - B = (B + this.B) | 0; - C = (C + this.C) | 0; - D = (D + this.D) | 0; - E = (E + this.E) | 0; - F = (F + this.F) | 0; - G = (G + this.G) | 0; - H = (H + this.H) | 0; - this.set(A, B, C, D, E, F, G, H); - } - roundClean() { - clean(SHA256_W); - } - destroy() { - this.set(0, 0, 0, 0, 0, 0, 0, 0); - clean(this.buffer); - } -} -/** Internal SHA2-256 hash class. */ -export class _SHA256 extends SHA2_32B { - // We cannot use array here since array allows indexing by variable - // which means optimizer/compiler cannot use registers. - A = SHA256_IV[0] | 0; - B = SHA256_IV[1] | 0; - C = SHA256_IV[2] | 0; - D = SHA256_IV[3] | 0; - E = SHA256_IV[4] | 0; - F = SHA256_IV[5] | 0; - G = SHA256_IV[6] | 0; - H = SHA256_IV[7] | 0; - constructor() { - super(32); - } -} -/** Internal SHA2-224 hash class. */ -export class _SHA224 extends SHA2_32B { - A = SHA224_IV[0] | 0; - B = SHA224_IV[1] | 0; - C = SHA224_IV[2] | 0; - D = SHA224_IV[3] | 0; - E = SHA224_IV[4] | 0; - F = SHA224_IV[5] | 0; - G = SHA224_IV[6] | 0; - H = SHA224_IV[7] | 0; - constructor() { - super(28); - } -} -// SHA2-512 is slower than sha256 in js because u64 operations are slow. -// Round contants -// First 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409 -// prettier-ignore -const K512 = /* @__PURE__ */ (() => u64.split([ - '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc', - '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118', - '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2', - '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694', - '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65', - '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5', - '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4', - '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70', - '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df', - '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b', - '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30', - '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8', - '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8', - '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3', - '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec', - '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b', - '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178', - '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b', - '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c', - '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817' -].map(n => BigInt(n))))(); -const SHA512_Kh = /* @__PURE__ */ (() => K512[0])(); -const SHA512_Kl = /* @__PURE__ */ (() => K512[1])(); -// Reusable temporary buffers -const SHA512_W_H = /* @__PURE__ */ new Uint32Array(80); -const SHA512_W_L = /* @__PURE__ */ new Uint32Array(80); -/** Internal 64-byte base SHA2 hash class. */ -class SHA2_64B extends HashMD { - constructor(outputLen) { - super(128, outputLen, 16, false); - } - // prettier-ignore - get() { - const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; - return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl]; - } - // prettier-ignore - set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) { - this.Ah = Ah | 0; - this.Al = Al | 0; - this.Bh = Bh | 0; - this.Bl = Bl | 0; - this.Ch = Ch | 0; - this.Cl = Cl | 0; - this.Dh = Dh | 0; - this.Dl = Dl | 0; - this.Eh = Eh | 0; - this.El = El | 0; - this.Fh = Fh | 0; - this.Fl = Fl | 0; - this.Gh = Gh | 0; - this.Gl = Gl | 0; - this.Hh = Hh | 0; - this.Hl = Hl | 0; - } - process(view, offset) { - // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array - for (let i = 0; i < 16; i++, offset += 4) { - SHA512_W_H[i] = view.getUint32(offset); - SHA512_W_L[i] = view.getUint32((offset += 4)); - } - for (let i = 16; i < 80; i++) { - // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7) - const W15h = SHA512_W_H[i - 15] | 0; - const W15l = SHA512_W_L[i - 15] | 0; - const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7); - const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7); - // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6) - const W2h = SHA512_W_H[i - 2] | 0; - const W2l = SHA512_W_L[i - 2] | 0; - const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6); - const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6); - // SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16]; - const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]); - const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]); - SHA512_W_H[i] = SUMh | 0; - SHA512_W_L[i] = SUMl | 0; - } - let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; - // Compression function main loop, 80 rounds - for (let i = 0; i < 80; i++) { - // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41) - const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41); - const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41); - //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; - const CHIh = (Eh & Fh) ^ (~Eh & Gh); - const CHIl = (El & Fl) ^ (~El & Gl); - // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i] - // prettier-ignore - const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]); - const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]); - const T1l = T1ll | 0; - // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39) - const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39); - const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39); - const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch); - const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl); - Hh = Gh | 0; - Hl = Gl | 0; - Gh = Fh | 0; - Gl = Fl | 0; - Fh = Eh | 0; - Fl = El | 0; - ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0)); - Dh = Ch | 0; - Dl = Cl | 0; - Ch = Bh | 0; - Cl = Bl | 0; - Bh = Ah | 0; - Bl = Al | 0; - const All = u64.add3L(T1l, sigma0l, MAJl); - Ah = u64.add3H(All, T1h, sigma0h, MAJh); - Al = All | 0; - } - // Add the compressed chunk to the current hash value - ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0)); - ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0)); - ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0)); - ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0)); - ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0)); - ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0)); - ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0)); - ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0)); - this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl); - } - roundClean() { - clean(SHA512_W_H, SHA512_W_L); - } - destroy() { - clean(this.buffer); - this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - } -} -/** Internal SHA2-512 hash class. */ -export class _SHA512 extends SHA2_64B { - Ah = SHA512_IV[0] | 0; - Al = SHA512_IV[1] | 0; - Bh = SHA512_IV[2] | 0; - Bl = SHA512_IV[3] | 0; - Ch = SHA512_IV[4] | 0; - Cl = SHA512_IV[5] | 0; - Dh = SHA512_IV[6] | 0; - Dl = SHA512_IV[7] | 0; - Eh = SHA512_IV[8] | 0; - El = SHA512_IV[9] | 0; - Fh = SHA512_IV[10] | 0; - Fl = SHA512_IV[11] | 0; - Gh = SHA512_IV[12] | 0; - Gl = SHA512_IV[13] | 0; - Hh = SHA512_IV[14] | 0; - Hl = SHA512_IV[15] | 0; - constructor() { - super(64); - } -} -/** Internal SHA2-384 hash class. */ -export class _SHA384 extends SHA2_64B { - Ah = SHA384_IV[0] | 0; - Al = SHA384_IV[1] | 0; - Bh = SHA384_IV[2] | 0; - Bl = SHA384_IV[3] | 0; - Ch = SHA384_IV[4] | 0; - Cl = SHA384_IV[5] | 0; - Dh = SHA384_IV[6] | 0; - Dl = SHA384_IV[7] | 0; - Eh = SHA384_IV[8] | 0; - El = SHA384_IV[9] | 0; - Fh = SHA384_IV[10] | 0; - Fl = SHA384_IV[11] | 0; - Gh = SHA384_IV[12] | 0; - Gl = SHA384_IV[13] | 0; - Hh = SHA384_IV[14] | 0; - Hl = SHA384_IV[15] | 0; - constructor() { - super(48); - } -} -/** - * Truncated SHA512/256 and SHA512/224. - * SHA512_IV is XORed with 0xa5a5a5a5a5a5a5a5, then used as "intermediary" IV of SHA512/t. - * Then t hashes string to produce result IV. - * See `test/misc/sha2-gen-iv.js`. - */ -/** SHA512/224 IV */ -const T224_IV = /* @__PURE__ */ Uint32Array.from([ - 0x8c3d37c8, 0x19544da2, 0x73e19966, 0x89dcd4d6, 0x1dfab7ae, 0x32ff9c82, 0x679dd514, 0x582f9fcf, - 0x0f6d2b69, 0x7bd44da8, 0x77e36f73, 0x04c48942, 0x3f9d85a8, 0x6a1d36c8, 0x1112e6ad, 0x91d692a1, -]); -/** SHA512/256 IV */ -const T256_IV = /* @__PURE__ */ Uint32Array.from([ - 0x22312194, 0xfc2bf72c, 0x9f555fa3, 0xc84c64c2, 0x2393b86b, 0x6f53b151, 0x96387719, 0x5940eabd, - 0x96283ee2, 0xa88effe3, 0xbe5e1e25, 0x53863992, 0x2b0199fc, 0x2c85b8aa, 0x0eb72ddc, 0x81c52ca2, -]); -/** Internal SHA2-512/224 hash class. */ -export class _SHA512_224 extends SHA2_64B { - Ah = T224_IV[0] | 0; - Al = T224_IV[1] | 0; - Bh = T224_IV[2] | 0; - Bl = T224_IV[3] | 0; - Ch = T224_IV[4] | 0; - Cl = T224_IV[5] | 0; - Dh = T224_IV[6] | 0; - Dl = T224_IV[7] | 0; - Eh = T224_IV[8] | 0; - El = T224_IV[9] | 0; - Fh = T224_IV[10] | 0; - Fl = T224_IV[11] | 0; - Gh = T224_IV[12] | 0; - Gl = T224_IV[13] | 0; - Hh = T224_IV[14] | 0; - Hl = T224_IV[15] | 0; - constructor() { - super(28); - } -} -/** Internal SHA2-512/256 hash class. */ -export class _SHA512_256 extends SHA2_64B { - Ah = T256_IV[0] | 0; - Al = T256_IV[1] | 0; - Bh = T256_IV[2] | 0; - Bl = T256_IV[3] | 0; - Ch = T256_IV[4] | 0; - Cl = T256_IV[5] | 0; - Dh = T256_IV[6] | 0; - Dl = T256_IV[7] | 0; - Eh = T256_IV[8] | 0; - El = T256_IV[9] | 0; - Fh = T256_IV[10] | 0; - Fl = T256_IV[11] | 0; - Gh = T256_IV[12] | 0; - Gl = T256_IV[13] | 0; - Hh = T256_IV[14] | 0; - Hl = T256_IV[15] | 0; - constructor() { - super(32); - } -} -/** - * SHA2-256 hash function from RFC 4634. In JS it's the fastest: even faster than Blake3. Some info: - * - * - Trying 2^128 hashes would get 50% chance of collision, using birthday attack. - * - BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025. - * - Each sha256 hash is executing 2^18 bit operations. - * - Good 2024 ASICs can do 200Th/sec with 3500 watts of power, corresponding to 2^36 hashes/joule. - */ -export const sha256 = /* @__PURE__ */ createHasher(() => new _SHA256(), -/* @__PURE__ */ oidNist(0x01)); -/** SHA2-224 hash function from RFC 4634 */ -export const sha224 = /* @__PURE__ */ createHasher(() => new _SHA224(), -/* @__PURE__ */ oidNist(0x04)); -/** SHA2-512 hash function from RFC 4634. */ -export const sha512 = /* @__PURE__ */ createHasher(() => new _SHA512(), -/* @__PURE__ */ oidNist(0x03)); -/** SHA2-384 hash function from RFC 4634. */ -export const sha384 = /* @__PURE__ */ createHasher(() => new _SHA384(), -/* @__PURE__ */ oidNist(0x02)); -/** - * SHA2-512/256 "truncated" hash function, with improved resistance to length extension attacks. - * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf). - */ -export const sha512_256 = /* @__PURE__ */ createHasher(() => new _SHA512_256(), -/* @__PURE__ */ oidNist(0x06)); -/** - * SHA2-512/224 "truncated" hash function, with improved resistance to length extension attacks. - * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf). - */ -export const sha512_224 = /* @__PURE__ */ createHasher(() => new _SHA512_224(), -/* @__PURE__ */ oidNist(0x05)); -//# sourceMappingURL=sha2.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha2.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha2.js.map deleted file mode 100644 index 4ddb77e8..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha2.js","sourceRoot":"","sources":["src/sha2.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACxF,OAAO,KAAK,GAAG,MAAM,WAAW,C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AAe,CAAC,OAAO,CAAC,IAAI,CAAC,CAC9B,CAAC;AACF;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAuB,eAAe,CAAC,YAAY,CACxE,GAAG,EAAE,CAAC,IAAI,WAAW,EAAE;AACvB,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,CAC9B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha3-addons.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha3-addons.d.ts deleted file mode 100644 index 32bc523b..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha3-addons.d.ts +++ /dev/null @@ -1,149 +0,0 @@ -/** - * SHA3 (keccak) addons. - * - * * cSHAKE, KMAC, TupleHash, ParallelHash + XOF variants from - * [NIST SP 800-185](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-185.pdf) - * * KangarooTwelve 🦘 and TurboSHAKE - reduced-round keccak from - * [k12-draft-17](https://datatracker.ietf.org/doc/draft-irtf-cfrg-kangarootwelve/17/) - * * KeccakPRG: Pseudo-random generator based on Keccak [(pdf)](https://keccak.team/files/CSF-0.1.pdf) - * @module - */ -import { Keccak, type ShakeOpts } from './sha3.ts'; -import { type CHash, type CHashXOF, type Hash, type HashXOF, type KDFInput, type PRG } from './utils.ts'; -export type cShakeOpts = ShakeOpts & { - personalization?: Uint8Array; - NISTfn?: KDFInput; -}; -export type ITupleHash = { - (messages: Uint8Array[], opts?: cShakeOpts): Uint8Array; - create(opts?: cShakeOpts): _TupleHash; -}; -/** 128-bit NIST cSHAKE XOF. */ -export declare const cshake128: CHashXOF; -/** 256-bit NIST cSHAKE XOF. */ -export declare const cshake256: CHashXOF; -/** Internal KMAC mac class. */ -export declare class _KMAC extends Keccak implements HashXOF<_KMAC> { - constructor(blockLen: number, outputLen: number, enableXOF: boolean, key: Uint8Array, opts?: cShakeOpts); - protected finish(): void; - _cloneInto(to?: _KMAC): _KMAC; - clone(): _KMAC; -} -export type IKMAC = { - (key: Uint8Array, message: Uint8Array, opts?: KangarooOpts): Uint8Array; - create(key: Uint8Array, opts?: cShakeOpts): _KMAC; -}; -/** 128-bit Keccak MAC. */ -export declare const kmac128: IKMAC; -/** 256-bit Keccak MAC. */ -export declare const kmac256: IKMAC; -/** 128-bit Keccak-MAC XOF. */ -export declare const kmac128xof: IKMAC; -/** 256-bit Keccak-MAC XOF. */ -export declare const kmac256xof: IKMAC; -/** Internal TupleHash class. */ -export declare class _TupleHash extends Keccak implements HashXOF<_TupleHash> { - constructor(blockLen: number, outputLen: number, enableXOF: boolean, opts?: cShakeOpts); - protected finish(): void; - _cloneInto(to?: _TupleHash): _TupleHash; - clone(): _TupleHash; -} -/** 128-bit TupleHASH. tuple(['ab', 'cd']) != tuple(['a', 'bcd']) */ -export declare const tuplehash128: ITupleHash; -/** 256-bit TupleHASH. tuple(['ab', 'cd']) != tuple(['a', 'bcd']) */ -export declare const tuplehash256: ITupleHash; -/** 128-bit TupleHASH XOF. */ -export declare const tuplehash128xof: ITupleHash; -/** 256-bit TupleHASH XOF. */ -export declare const tuplehash256xof: ITupleHash; -type ParallelOpts = KangarooOpts & { - blockLen?: number; -}; -/** Internal Parallel Keccak Hash class. */ -export declare class _ParallelHash extends Keccak implements HashXOF<_ParallelHash> { - private leafHash?; - protected leafCons: () => Hash; - private chunkPos; - private chunksDone; - private chunkLen; - constructor(blockLen: number, outputLen: number, leafCons: () => Hash, enableXOF: boolean, opts?: ParallelOpts); - protected finish(): void; - _cloneInto(to?: _ParallelHash): _ParallelHash; - destroy(): void; - clone(): _ParallelHash; -} -/** 128-bit ParallelHash. In JS, it is not parallel. */ -export declare const parallelhash128: CHash; -/** 256-bit ParallelHash. In JS, it is not parallel. */ -export declare const parallelhash256: CHash; -/** 128-bit ParallelHash XOF. In JS, it is not parallel. */ -export declare const parallelhash128xof: CHashXOF; -/** 256-bit ParallelHash. In JS, it is not parallel. */ -export declare const parallelhash256xof: CHashXOF; -/** D means Domain separation byte */ -export type TurboshakeOpts = ShakeOpts & { - D?: number; -}; -/** - * TurboSHAKE 128-bit: reduced 12-round keccak. - * Should've been a simple "shake with 12 rounds", but we got a whole new spec about Turbo SHAKE Pro MAX. - */ -export declare const turboshake128: CHashXOF; -/** TurboSHAKE 256-bit: reduced 12-round keccak. */ -export declare const turboshake256: CHashXOF; -/** K12 options. */ -export type KangarooOpts = { - dkLen?: number; - personalization?: Uint8Array; -}; -/** Internal K12 hash class. */ -export declare class _KangarooTwelve extends Keccak implements HashXOF<_KangarooTwelve> { - readonly chunkLen = 8192; - private leafHash?; - protected leafLen: number; - private personalization; - private chunkPos; - private chunksDone; - constructor(blockLen: number, leafLen: number, outputLen: number, rounds: number, opts: KangarooOpts); - update(data: Uint8Array): this; - protected finish(): void; - destroy(): void; - _cloneInto(to?: _KangarooTwelve): _KangarooTwelve; - clone(): _KangarooTwelve; -} -/** 128-bit KangarooTwelve (k12): reduced 12-round keccak. */ -export declare const kt128: CHash<_KangarooTwelve, KangarooOpts>; -/** 256-bit KangarooTwelve (k12): reduced 12-round keccak. */ -export declare const kt256: CHash<_KangarooTwelve, KangarooOpts>; -/** KangarooTwelve-based MAC options. */ -export type HopMAC = (key: Uint8Array, message: Uint8Array, personalization: Uint8Array, dkLen?: number) => Uint8Array; -/** - * 128-bit KangarooTwelve-based MAC. - * - * These untested (there is no test vectors or implementation available). Use at your own risk. - * HopMAC128(Key, M, C, L) = KT128(Key, KT128(M, C, 32), L) - * HopMAC256(Key, M, C, L) = KT256(Key, KT256(M, C, 64), L) - */ -export declare const HopMAC128: HopMAC; -/** 256-bit KangarooTwelve-based MAC. */ -export declare const HopMAC256: HopMAC; -/** - * More at https://github.com/XKCP/XKCP/tree/master/lib/high/Keccak/PRG. - */ -export declare class _KeccakPRG extends Keccak implements PRG { - protected rate: number; - constructor(capacity: number); - protected keccak(): void; - update(data: Uint8Array): this; - protected finish(): void; - digestInto(_out: Uint8Array): Uint8Array; - addEntropy(seed: Uint8Array): void; - randomBytes(length: number): Uint8Array; - clean(): void; - _cloneInto(to?: _KeccakPRG): _KeccakPRG; - clone(): _KeccakPRG; -} -/** KeccakPRG: Pseudo-random generator based on Keccak. https://keccak.team/files/CSF-0.1.pdf */ -export declare const keccakprg: (capacity?: number) => _KeccakPRG; -export {}; -//# sourceMappingURL=sha3-addons.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha3-addons.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha3-addons.d.ts.map deleted file mode 100644 index ed38b7c1..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha3-addons.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha3-addons.d.ts","sourceRoot":"","sources":["src/sha3-addons.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAGL,KAAK,KAAK,EACV,KAAK,QAAQ,EAEb,KAAK,IAAI,EACT,KAAK,OAAO,EACZ,KAAK,QAAQ,EAEb,KAAK,GAAG,EAET,MAAM,YAAY,CAAC;AAqCpB,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG;IAAE,eAAe,CAAC,EAAE,UAAU,CAAC;IAAC,MAAM,CAAC,EAAE,QAAQ,CAAA;CAAE,CAAC;AAyBzF,MAAM,MAAM,UAAU,GAAG;IACvB,CAAC,QAAQ,EAAE,UAAU,EAAE,EAAE,IAAI,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IACxD,MAAM,CAAC,IAAI,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;CACvC,CAAC;AACF,+BAA+B;AAC/B,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,MAAM,EAAE,UAAU,CAA4C,CAAC;AAChG,+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U,EACf,OAAO,EAAE,UAAU,EACnB,eAAe,EAAE,UAAU,EAC3B,KAAK,CAAC,EAAE,MAAM,KACX,UAAU,CAAC;AAMhB;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,EAAE,MAAyC,CAAC;AAClE,wCAAwC;AACxC,eAAO,MAAM,SAAS,EAAE,MAAyC,CAAC;AAElE;;GAEG;AACH,qBAAa,UAAW,SAAQ,MAAO,YAAW,GAAG;IACnD,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC;gBACX,QAAQ,EAAE,MAAM;IAW5B,SAAS,CAAC,MAAM,IAAI,IAAI;IAQxB,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI;IAK9B,SAAS,CAAC,MAAM,IAAI,IAAI;IACxB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU;IAGxC,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI;IAGlC,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU;IAGvC,KAAK,IAAI,IAAI;IAQb,UAAU,CAAC,EAAE,CAAC,EAAE,UAAU,GAAG,UAAU;IAOvC,KAAK,IAAI,UAAU;CAGpB;AAED,gGAAgG;AAChG,eAAO,MAAM,SAAS,GAAI,iBAAc,KAAG,UAAsC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha3-addons.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha3-addons.js deleted file mode 100644 index 50e34ad7..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha3-addons.js +++ /dev/null @@ -1,420 +0,0 @@ -/** - * SHA3 (keccak) addons. - * - * * cSHAKE, KMAC, TupleHash, ParallelHash + XOF variants from - * [NIST SP 800-185](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-185.pdf) - * * KangarooTwelve 🦘 and TurboSHAKE - reduced-round keccak from - * [k12-draft-17](https://datatracker.ietf.org/doc/draft-irtf-cfrg-kangarootwelve/17/) - * * KeccakPRG: Pseudo-random generator based on Keccak [(pdf)](https://keccak.team/files/CSF-0.1.pdf) - * @module - */ -import { Keccak } from "./sha3.js"; -import { abytes, anumber, createHasher, kdfInputToBytes, u32, } from "./utils.js"; -// cSHAKE && KMAC (NIST SP800-185) -const _8n = /* @__PURE__ */ BigInt(8); -const _ffn = /* @__PURE__ */ BigInt(0xff); -// It is safe to use bigints here, since they used only for length encoding (not actual data). -// We use bigints in sha256 for lengths too. -function leftEncode(n) { - n = BigInt(n); - const res = [Number(n & _ffn)]; - n >>= _8n; - for (; n > 0; n >>= _8n) - res.unshift(Number(n & _ffn)); - res.unshift(res.length); - return new Uint8Array(res); -} -function rightEncode(n) { - n = BigInt(n); - const res = [Number(n & _ffn)]; - n >>= _8n; - for (; n > 0; n >>= _8n) - res.unshift(Number(n & _ffn)); - res.push(res.length); - return new Uint8Array(res); -} -function chooseLen(opts, outputLen) { - return opts.dkLen === undefined ? outputLen : opts.dkLen; -} -const abytesOrZero = (buf, title = '') => { - if (buf === undefined) - return EMPTY_BUFFER; - abytes(buf, undefined, title); - return buf; -}; -// NOTE: second modulo is necessary since we don't need to add padding if current element takes whole block -const getPadding = (len, block) => new Uint8Array((block - (len % block)) % block); -// Personalization -function cshakePers(hash, opts = {}) { - if (!opts || (opts.personalization === undefined && opts.NISTfn === undefined)) - return hash; - // Encode and pad inplace to avoid unneccesary memory copies/slices (so we don't need to zero them later) - // bytepad(encode_string(N) || encode_string(S), 168) - const blockLenBytes = leftEncode(hash.blockLen); - const fn = opts.NISTfn === undefined ? EMPTY_BUFFER : kdfInputToBytes(opts.NISTfn); - const fnLen = leftEncode(_8n * BigInt(fn.length)); // length in bits - const pers = abytesOrZero(opts.personalization, 'personalization'); - const persLen = leftEncode(_8n * BigInt(pers.length)); // length in bits - if (!fn.length && !pers.length) - return hash; - hash.suffix = 0x04; - hash.update(blockLenBytes).update(fnLen).update(fn).update(persLen).update(pers); - let totalLen = blockLenBytes.length + fnLen.length + fn.length + persLen.length + pers.length; - hash.update(getPadding(totalLen, hash.blockLen)); - return hash; -} -const gencShake = (suffix, blockLen, outputLen) => createHasher((opts = {}) => cshakePers(new Keccak(blockLen, suffix, chooseLen(opts, outputLen), true), opts)); -/** 128-bit NIST cSHAKE XOF. */ -export const cshake128 = /* @__PURE__ */ gencShake(0x1f, 168, 16); -/** 256-bit NIST cSHAKE XOF. */ -export const cshake256 = /* @__PURE__ */ gencShake(0x1f, 136, 32); -/** Internal KMAC mac class. */ -export class _KMAC extends Keccak { - constructor(blockLen, outputLen, enableXOF, key, opts = {}) { - super(blockLen, 0x1f, outputLen, enableXOF); - cshakePers(this, { NISTfn: 'KMAC', personalization: opts.personalization }); - abytes(key, undefined, 'key'); - // 1. newX = bytepad(encode_string(K), 168) || X || right_encode(L). - const blockLenBytes = leftEncode(this.blockLen); - const keyLen = leftEncode(_8n * BigInt(key.length)); - this.update(blockLenBytes).update(keyLen).update(key); - const totalLen = blockLenBytes.length + keyLen.length + key.length; - this.update(getPadding(totalLen, this.blockLen)); - } - finish() { - if (!this.finished) - this.update(rightEncode(this.enableXOF ? 0 : _8n * BigInt(this.outputLen))); // outputLen in bits - super.finish(); - } - _cloneInto(to) { - // Create new instance without calling constructor since key already in state and we don't know it. - // Force "to" to be instance of KMAC instead of Sha3. - if (!to) { - to = Object.create(Object.getPrototypeOf(this), {}); - to.state = this.state.slice(); - to.blockLen = this.blockLen; - to.state32 = u32(to.state); - } - return super._cloneInto(to); - } - clone() { - return this._cloneInto(); - } -} -function genKmac(blockLen, outputLen, xof = false) { - const kmac = (key, message, opts) => kmac.create(key, opts).update(message).digest(); - kmac.create = (key, opts = {}) => new _KMAC(blockLen, chooseLen(opts, outputLen), xof, key, opts); - return kmac; -} -/** 128-bit Keccak MAC. */ -export const kmac128 = /* @__PURE__ */ genKmac(168, 16); -/** 256-bit Keccak MAC. */ -export const kmac256 = /* @__PURE__ */ genKmac(136, 32); -/** 128-bit Keccak-MAC XOF. */ -export const kmac128xof = /* @__PURE__ */ genKmac(168, 16, true); -/** 256-bit Keccak-MAC XOF. */ -export const kmac256xof = /* @__PURE__ */ genKmac(136, 32, true); -/** Internal TupleHash class. */ -export class _TupleHash extends Keccak { - constructor(blockLen, outputLen, enableXOF, opts = {}) { - super(blockLen, 0x1f, outputLen, enableXOF); - cshakePers(this, { NISTfn: 'TupleHash', personalization: opts.personalization }); - // Change update after cshake processed - this.update = (data) => { - abytes(data); - super.update(leftEncode(_8n * BigInt(data.length))); - super.update(data); - return this; - }; - } - finish() { - if (!this.finished) - super.update(rightEncode(this.enableXOF ? 0 : _8n * BigInt(this.outputLen))); // outputLen in bits - super.finish(); - } - _cloneInto(to) { - to ||= new _TupleHash(this.blockLen, this.outputLen, this.enableXOF); - return super._cloneInto(to); - } - clone() { - return this._cloneInto(); - } -} -function genTuple(blockLen, outputLen, xof = false) { - const tuple = (messages, opts) => { - const h = tuple.create(opts); - if (!Array.isArray(messages)) - throw new Error('expected array of messages'); - for (const msg of messages) - h.update(msg); - return h.digest(); - }; - tuple.create = (opts = {}) => new _TupleHash(blockLen, chooseLen(opts, outputLen), xof, opts); - return tuple; -} -/** 128-bit TupleHASH. tuple(['ab', 'cd']) != tuple(['a', 'bcd']) */ -export const tuplehash128 = /* @__PURE__ */ genTuple(168, 16); -/** 256-bit TupleHASH. tuple(['ab', 'cd']) != tuple(['a', 'bcd']) */ -export const tuplehash256 = /* @__PURE__ */ genTuple(136, 32); -/** 128-bit TupleHASH XOF. */ -export const tuplehash128xof = /* @__PURE__ */ genTuple(168, 16, true); -/** 256-bit TupleHASH XOF. */ -export const tuplehash256xof = /* @__PURE__ */ genTuple(136, 32, true); -/** Internal Parallel Keccak Hash class. */ -export class _ParallelHash extends Keccak { - leafHash; - leafCons; - chunkPos = 0; // Position of current block in chunk - chunksDone = 0; // How many chunks we already have - chunkLen; - constructor(blockLen, outputLen, leafCons, enableXOF, opts = {}) { - super(blockLen, 0x1f, outputLen, enableXOF); - cshakePers(this, { NISTfn: 'ParallelHash', personalization: opts.personalization }); - this.leafCons = leafCons; - let { blockLen: B = 8 } = opts; - anumber(B); - this.chunkLen = B; - super.update(leftEncode(B)); - // Change update after cshake processed - this.update = (data) => { - abytes(data); - const { chunkLen, leafCons } = this; - for (let pos = 0, len = data.length; pos < len;) { - if (this.chunkPos == chunkLen || !this.leafHash) { - if (this.leafHash) { - super.update(this.leafHash.digest()); - this.chunksDone++; - } - this.leafHash = leafCons(); - this.chunkPos = 0; - } - const take = Math.min(chunkLen - this.chunkPos, len - pos); - this.leafHash.update(data.subarray(pos, pos + take)); - this.chunkPos += take; - pos += take; - } - return this; - }; - } - finish() { - if (this.finished) - return; - if (this.leafHash) { - super.update(this.leafHash.digest()); - this.chunksDone++; - } - super.update(rightEncode(this.chunksDone)); - super.update(rightEncode(this.enableXOF ? 0 : _8n * BigInt(this.outputLen))); // outputLen in bits - super.finish(); - } - _cloneInto(to) { - to ||= new _ParallelHash(this.blockLen, this.outputLen, this.leafCons, this.enableXOF); - if (this.leafHash) - to.leafHash = this.leafHash._cloneInto(to.leafHash); - to.chunkPos = this.chunkPos; - to.chunkLen = this.chunkLen; - to.chunksDone = this.chunksDone; - return super._cloneInto(to); - } - destroy() { - super.destroy.call(this); - if (this.leafHash) - this.leafHash.destroy(); - } - clone() { - return this._cloneInto(); - } -} -function genPrl(blockLen, outputLen, leaf, xof = false) { - const parallel = (message, opts) => parallel.create(opts).update(message).digest(); - parallel.create = (opts = {}) => new _ParallelHash(blockLen, chooseLen(opts, outputLen), () => leaf.create({ dkLen: 2 * outputLen }), xof, opts); - parallel.outputLen = outputLen; - parallel.blockLen = blockLen; - return parallel; -} -/** 128-bit ParallelHash. In JS, it is not parallel. */ -export const parallelhash128 = /* @__PURE__ */ genPrl(168, 16, cshake128); -/** 256-bit ParallelHash. In JS, it is not parallel. */ -export const parallelhash256 = /* @__PURE__ */ genPrl(136, 32, cshake256); -/** 128-bit ParallelHash XOF. In JS, it is not parallel. */ -export const parallelhash128xof = /* @__PURE__ */ genPrl(168, 16, cshake128, true); -/** 256-bit ParallelHash. In JS, it is not parallel. */ -export const parallelhash256xof = /* @__PURE__ */ genPrl(136, 32, cshake256, true); -const genTurbo = (blockLen, outputLen) => createHasher((opts = {}) => { - const D = opts.D === undefined ? 0x1f : opts.D; - // Section 2.1 of https://datatracker.ietf.org/doc/draft-irtf-cfrg-kangarootwelve/17/ - if (!Number.isSafeInteger(D) || D < 0x01 || D > 0x7f) - throw new Error('"D" (domain separation byte) must be 0x01..0x7f, got: ' + D); - return new Keccak(blockLen, D, opts.dkLen === undefined ? outputLen : opts.dkLen, true, 12); -}); -/** - * TurboSHAKE 128-bit: reduced 12-round keccak. - * Should've been a simple "shake with 12 rounds", but we got a whole new spec about Turbo SHAKE Pro MAX. - */ -export const turboshake128 = /* @__PURE__ */ genTurbo(168, 32); -/** TurboSHAKE 256-bit: reduced 12-round keccak. */ -export const turboshake256 = /* @__PURE__ */ genTurbo(136, 64); -// Same as NIST rightEncode, but returns [0] for zero string -function rightEncodeK12(n) { - n = BigInt(n); - const res = []; - for (; n > 0; n >>= _8n) - res.unshift(Number(n & _ffn)); - res.push(res.length); - return Uint8Array.from(res); -} -const EMPTY_BUFFER = /* @__PURE__ */ Uint8Array.of(); -/** Internal K12 hash class. */ -export class _KangarooTwelve extends Keccak { - chunkLen = 8192; - leafHash; - leafLen; - personalization; - chunkPos = 0; // Position of current block in chunk - chunksDone = 0; // How many chunks we already have - constructor(blockLen, leafLen, outputLen, rounds, opts) { - super(blockLen, 0x07, outputLen, true, rounds); - this.leafLen = leafLen; - this.personalization = abytesOrZero(opts.personalization, 'personalization'); - } - update(data) { - abytes(data); - const { chunkLen, blockLen, leafLen, rounds } = this; - for (let pos = 0, len = data.length; pos < len;) { - if (this.chunkPos == chunkLen) { - if (this.leafHash) - super.update(this.leafHash.digest()); - else { - this.suffix = 0x06; // Its safe to change suffix here since its used only in digest() - super.update(Uint8Array.from([3, 0, 0, 0, 0, 0, 0, 0])); - } - this.leafHash = new Keccak(blockLen, 0x0b, leafLen, false, rounds); - this.chunksDone++; - this.chunkPos = 0; - } - const take = Math.min(chunkLen - this.chunkPos, len - pos); - const chunk = data.subarray(pos, pos + take); - if (this.leafHash) - this.leafHash.update(chunk); - else - super.update(chunk); - this.chunkPos += take; - pos += take; - } - return this; - } - finish() { - if (this.finished) - return; - const { personalization } = this; - this.update(personalization).update(rightEncodeK12(personalization.length)); - // Leaf hash - if (this.leafHash) { - super.update(this.leafHash.digest()); - super.update(rightEncodeK12(this.chunksDone)); - super.update(Uint8Array.from([0xff, 0xff])); - } - super.finish.call(this); - } - destroy() { - super.destroy.call(this); - if (this.leafHash) - this.leafHash.destroy(); - // We cannot zero personalization buffer since it is user provided and we don't want to mutate user input - this.personalization = EMPTY_BUFFER; - } - _cloneInto(to) { - const { blockLen, leafLen, leafHash, outputLen, rounds } = this; - to ||= new _KangarooTwelve(blockLen, leafLen, outputLen, rounds, {}); - super._cloneInto(to); - if (leafHash) - to.leafHash = leafHash._cloneInto(to.leafHash); - to.personalization.set(this.personalization); - to.leafLen = this.leafLen; - to.chunkPos = this.chunkPos; - to.chunksDone = this.chunksDone; - return to; - } - clone() { - return this._cloneInto(); - } -} -/** 128-bit KangarooTwelve (k12): reduced 12-round keccak. */ -export const kt128 = /* @__PURE__ */ createHasher((opts = {}) => new _KangarooTwelve(168, 32, chooseLen(opts, 32), 12, opts)); -/** 256-bit KangarooTwelve (k12): reduced 12-round keccak. */ -export const kt256 = /* @__PURE__ */ createHasher((opts = {}) => new _KangarooTwelve(136, 64, chooseLen(opts, 64), 12, opts)); -const genHopMAC = (hash) => (key, message, personalization, dkLen) => hash(key, { personalization: hash(message, { personalization }), dkLen }); -/** - * 128-bit KangarooTwelve-based MAC. - * - * These untested (there is no test vectors or implementation available). Use at your own risk. - * HopMAC128(Key, M, C, L) = KT128(Key, KT128(M, C, 32), L) - * HopMAC256(Key, M, C, L) = KT256(Key, KT256(M, C, 64), L) - */ -export const HopMAC128 = /* @__PURE__ */ genHopMAC(kt128); -/** 256-bit KangarooTwelve-based MAC. */ -export const HopMAC256 = /* @__PURE__ */ genHopMAC(kt256); -/** - * More at https://github.com/XKCP/XKCP/tree/master/lib/high/Keccak/PRG. - */ -export class _KeccakPRG extends Keccak { - rate; - constructor(capacity) { - anumber(capacity); - const rate = 1600 - capacity; - const rho = rate - 2; - // Rho must be full bytes - if (capacity < 0 || capacity > 1600 - 10 || rho % 8) - throw new Error('invalid capacity'); - // blockLen = rho in bytes - super(rho / 8, 0, 0, true); - this.rate = rate; - this.posOut = Math.floor((rate + 7) / 8); - } - keccak() { - // Duplex padding - this.state[this.pos] ^= 0x01; - this.state[this.blockLen] ^= 0x02; // Rho is full bytes - super.keccak(); - this.pos = 0; - this.posOut = 0; - } - update(data) { - super.update(data); - this.posOut = this.blockLen; - return this; - } - finish() { } - digestInto(_out) { - throw new Error('digest is not allowed, use .fetch instead'); - } - addEntropy(seed) { - this.update(seed); - } - randomBytes(length) { - return this.xof(length); - } - clean() { - if (this.rate < 1600 / 2 + 1) - throw new Error('rate is too low to use .forget()'); - this.keccak(); - for (let i = 0; i < this.blockLen; i++) - this.state[i] = 0; - this.pos = this.blockLen; - this.keccak(); - this.posOut = this.blockLen; - } - _cloneInto(to) { - const { rate } = this; - to ||= new _KeccakPRG(1600 - rate); - super._cloneInto(to); - to.rate = rate; - return to; - } - clone() { - return this._cloneInto(); - } -} -/** KeccakPRG: Pseudo-random generator based on Keccak. https://keccak.team/files/CSF-0.1.pdf */ -export const keccakprg = (capacity = 254) => new _KeccakPRG(capacity); -//# sourceMappingURL=sha3-addons.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha3-addons.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha3-addons.js.map deleted file mode 100644 index f31932f3..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha3-addons.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,MAAM,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;IACD,WAAW,CAAC,MAAc;QACxB,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC1B,CAAC;IACD,KAAK;QACH,IAAI,IAAI,CAAC,IAAI,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;QAClF,IAAI,CAAC,MAAM,EAAE,CAAC;QACd,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,EAAE;YAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QAC1D,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC;QACzB,IAAI,CAAC,MAAM,EAAE,CAAC;QACd,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC;IAC9B,CAAC;IACD,UAAU,CAAC,EAAe;QACxB,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;QACtB,EAAE,KAAK,IAAI,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;QACnC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;QACrB,EAAE,CAAC,IAAI,GAAG,IAAI,CAAC;QACf,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,KAAK;QACH,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;IAC3B,CAAC;CACF;AAED,gGAAgG;AAChG,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,QAAQ,GAAG,GAAG,EAAc,EAAE,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha3.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha3.d.ts deleted file mode 100644 index 901eba15..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha3.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { type CHash, type CHashXOF, type Hash, type HashXOF } from './utils.ts'; -/** `keccakf1600` internal function, additionally allows to adjust round count. */ -export declare function keccakP(s: Uint32Array, rounds?: number): void; -/** Keccak sponge function. */ -export declare class Keccak implements Hash, HashXOF { - protected state: Uint8Array; - protected pos: number; - protected posOut: number; - protected finished: boolean; - protected state32: Uint32Array; - protected destroyed: boolean; - blockLen: number; - suffix: number; - outputLen: number; - protected enableXOF: boolean; - protected rounds: number; - constructor(blockLen: number, suffix: number, outputLen: number, enableXOF?: boolean, rounds?: number); - clone(): Keccak; - protected keccak(): void; - update(data: Uint8Array): this; - protected finish(): void; - protected writeInto(out: Uint8Array): Uint8Array; - xofInto(out: Uint8Array): Uint8Array; - xof(bytes: number): Uint8Array; - digestInto(out: Uint8Array): Uint8Array; - digest(): Uint8Array; - destroy(): void; - _cloneInto(to?: Keccak): Keccak; -} -/** SHA3-224 hash function. */ -export declare const sha3_224: CHash; -/** SHA3-256 hash function. Different from keccak-256. */ -export declare const sha3_256: CHash; -/** SHA3-384 hash function. */ -export declare const sha3_384: CHash; -/** SHA3-512 hash function. */ -export declare const sha3_512: CHash; -/** keccak-224 hash function. */ -export declare const keccak_224: CHash; -/** keccak-256 hash function. Different from SHA3-256. */ -export declare const keccak_256: CHash; -/** keccak-384 hash function. */ -export declare const keccak_384: CHash; -/** keccak-512 hash function. */ -export declare const keccak_512: CHash; -/** Options for SHAKE XOF. */ -export type ShakeOpts = { - dkLen?: number; -}; -/** SHAKE128 XOF with 128-bit security. */ -export declare const shake128: CHashXOF; -/** SHAKE256 XOF with 256-bit security. */ -export declare const shake256: CHashXOF; -/** SHAKE128 XOF with 256-bit output (NIST version). */ -export declare const shake128_32: CHashXOF; -/** SHAKE256 XOF with 512-bit output (NIST version). */ -export declare const shake256_64: CHashXOF; -//# sourceMappingURL=sha3.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha3.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha3.d.ts.map deleted file mode 100644 index 0d85d5ec..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha3.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha3.d.ts","sourceRoot":"","sources":["src/sha3.ts"],"names":[],"mappings":"AAaA,OAAO,EAML,KAAK,KAAK,EAAE,KAAK,QAAQ,EACzB,KAAK,IAAI,EAET,KAAK,OAAO,EACb,MAAM,YAAY,CAAC;AAoCpB,kFAAkF;AAClF,wBAAgB,OAAO,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,GAAE,MAAW,GAAG,IAAI,CAyCjE;AAED,8BAA8B;AAC9B,qBAAa,MAAO,YAAW,IAAI,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC;IAC1D,SAAS,CAAC,KAAK,EAAE,UAAU,CAAC;IAC5B,SAAS,CAAC,GAAG,SAAK;IAClB,SAAS,CAAC,MAAM,SAAK;IACrB,SAAS,CAAC,QAAQ,UAAS;IAC3B,SAAS,CAAC,OAAO,EAAE,WAAW,CAAC;IAC/B,SAAS,CAAC,SAAS,UAAS;IAErB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,SAAS,UAAS;IAC5B,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;gBAIvB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,SAAS,UAAQ,EACjB,MAAM,GAAE,MAAW;IAgBrB,KAAK,IAAI,MAAM;IAGf,SAAS,CAAC,MAAM,IAAI,IAAI;IAOxB,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI;IAY9B,SAAS,CAAC,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AAM,EAAE,SAAS,CAEI,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha3.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha3.js deleted file mode 100644 index 055bd7b6..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha3.js +++ /dev/null @@ -1,254 +0,0 @@ -/** - * SHA3 (keccak) hash function, based on a new "Sponge function" design. - * Different from older hashes, the internal state is bigger than output size. - * - * Check out [FIPS-202](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf), - * [Website](https://keccak.team/keccak.html), - * [the differences between SHA-3 and Keccak](https://crypto.stackexchange.com/questions/15727/what-are-the-key-differences-between-the-draft-sha-3-standard-and-the-keccak-sub). - * - * Check out `sha3-addons` module for cSHAKE, k12, and others. - * @module - */ -import { rotlBH, rotlBL, rotlSH, rotlSL, split } from "./_u64.js"; -// prettier-ignore -import { abytes, aexists, anumber, aoutput, clean, createHasher, oidNist, swap32IfBE, u32 } from "./utils.js"; -// No __PURE__ annotations in sha3 header: -// EVERYTHING is in fact used on every export. -// Various per round constants calculations -const _0n = BigInt(0); -const _1n = BigInt(1); -const _2n = BigInt(2); -const _7n = BigInt(7); -const _256n = BigInt(256); -const _0x71n = BigInt(0x71); -const SHA3_PI = []; -const SHA3_ROTL = []; -const _SHA3_IOTA = []; // no pure annotation: var is always used -for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) { - // Pi - [x, y] = [y, (2 * x + 3 * y) % 5]; - SHA3_PI.push(2 * (5 * y + x)); - // Rotational - SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64); - // Iota - let t = _0n; - for (let j = 0; j < 7; j++) { - R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n; - if (R & _2n) - t ^= _1n << ((_1n << BigInt(j)) - _1n); - } - _SHA3_IOTA.push(t); -} -const IOTAS = split(_SHA3_IOTA, true); -const SHA3_IOTA_H = IOTAS[0]; -const SHA3_IOTA_L = IOTAS[1]; -// Left rotation (without 0, 32, 64) -const rotlH = (h, l, s) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s)); -const rotlL = (h, l, s) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s)); -/** `keccakf1600` internal function, additionally allows to adjust round count. */ -export function keccakP(s, rounds = 24) { - const B = new Uint32Array(5 * 2); - // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js) - for (let round = 24 - rounds; round < 24; round++) { - // Theta θ - for (let x = 0; x < 10; x++) - B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40]; - for (let x = 0; x < 10; x += 2) { - const idx1 = (x + 8) % 10; - const idx0 = (x + 2) % 10; - const B0 = B[idx0]; - const B1 = B[idx0 + 1]; - const Th = rotlH(B0, B1, 1) ^ B[idx1]; - const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1]; - for (let y = 0; y < 50; y += 10) { - s[x + y] ^= Th; - s[x + y + 1] ^= Tl; - } - } - // Rho (ρ) and Pi (π) - let curH = s[2]; - let curL = s[3]; - for (let t = 0; t < 24; t++) { - const shift = SHA3_ROTL[t]; - const Th = rotlH(curH, curL, shift); - const Tl = rotlL(curH, curL, shift); - const PI = SHA3_PI[t]; - curH = s[PI]; - curL = s[PI + 1]; - s[PI] = Th; - s[PI + 1] = Tl; - } - // Chi (χ) - for (let y = 0; y < 50; y += 10) { - for (let x = 0; x < 10; x++) - B[x] = s[y + x]; - for (let x = 0; x < 10; x++) - s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10]; - } - // Iota (ι) - s[0] ^= SHA3_IOTA_H[round]; - s[1] ^= SHA3_IOTA_L[round]; - } - clean(B); -} -/** Keccak sponge function. */ -export class Keccak { - state; - pos = 0; - posOut = 0; - finished = false; - state32; - destroyed = false; - blockLen; - suffix; - outputLen; - enableXOF = false; - rounds; - // NOTE: we accept arguments in bytes instead of bits here. - constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) { - this.blockLen = blockLen; - this.suffix = suffix; - this.outputLen = outputLen; - this.enableXOF = enableXOF; - this.rounds = rounds; - // Can be passed from user as dkLen - anumber(outputLen, 'outputLen'); - // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes - // 0 < blockLen < 200 - if (!(0 < blockLen && blockLen < 200)) - throw new Error('only keccak-f1600 function is supported'); - this.state = new Uint8Array(200); - this.state32 = u32(this.state); - } - clone() { - return this._cloneInto(); - } - keccak() { - swap32IfBE(this.state32); - keccakP(this.state32, this.rounds); - swap32IfBE(this.state32); - this.posOut = 0; - this.pos = 0; - } - update(data) { - aexists(this); - abytes(data); - const { blockLen, state } = this; - const len = data.length; - for (let pos = 0; pos < len;) { - const take = Math.min(blockLen - this.pos, len - pos); - for (let i = 0; i < take; i++) - state[this.pos++] ^= data[pos++]; - if (this.pos === blockLen) - this.keccak(); - } - return this; - } - finish() { - if (this.finished) - return; - this.finished = true; - const { state, suffix, pos, blockLen } = this; - // Do the padding - state[pos] ^= suffix; - if ((suffix & 0x80) !== 0 && pos === blockLen - 1) - this.keccak(); - state[blockLen - 1] ^= 0x80; - this.keccak(); - } - writeInto(out) { - aexists(this, false); - abytes(out); - this.finish(); - const bufferOut = this.state; - const { blockLen } = this; - for (let pos = 0, len = out.length; pos < len;) { - if (this.posOut >= blockLen) - this.keccak(); - const take = Math.min(blockLen - this.posOut, len - pos); - out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); - this.posOut += take; - pos += take; - } - return out; - } - xofInto(out) { - // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF - if (!this.enableXOF) - throw new Error('XOF is not possible for this instance'); - return this.writeInto(out); - } - xof(bytes) { - anumber(bytes); - return this.xofInto(new Uint8Array(bytes)); - } - digestInto(out) { - aoutput(out, this); - if (this.finished) - throw new Error('digest() was already called'); - this.writeInto(out); - this.destroy(); - return out; - } - digest() { - return this.digestInto(new Uint8Array(this.outputLen)); - } - destroy() { - this.destroyed = true; - clean(this.state); - } - _cloneInto(to) { - const { blockLen, suffix, outputLen, rounds, enableXOF } = this; - to ||= new Keccak(blockLen, suffix, outputLen, enableXOF, rounds); - to.state32.set(this.state32); - to.pos = this.pos; - to.posOut = this.posOut; - to.finished = this.finished; - to.rounds = rounds; - // Suffix can change in cSHAKE - to.suffix = suffix; - to.outputLen = outputLen; - to.enableXOF = enableXOF; - to.destroyed = this.destroyed; - return to; - } -} -const genKeccak = (suffix, blockLen, outputLen, info = {}) => createHasher(() => new Keccak(blockLen, suffix, outputLen), info); -/** SHA3-224 hash function. */ -export const sha3_224 = /* @__PURE__ */ genKeccak(0x06, 144, 28, -/* @__PURE__ */ oidNist(0x07)); -/** SHA3-256 hash function. Different from keccak-256. */ -export const sha3_256 = /* @__PURE__ */ genKeccak(0x06, 136, 32, -/* @__PURE__ */ oidNist(0x08)); -/** SHA3-384 hash function. */ -export const sha3_384 = /* @__PURE__ */ genKeccak(0x06, 104, 48, -/* @__PURE__ */ oidNist(0x09)); -/** SHA3-512 hash function. */ -export const sha3_512 = /* @__PURE__ */ genKeccak(0x06, 72, 64, -/* @__PURE__ */ oidNist(0x0a)); -/** keccak-224 hash function. */ -export const keccak_224 = /* @__PURE__ */ genKeccak(0x01, 144, 28); -/** keccak-256 hash function. Different from SHA3-256. */ -export const keccak_256 = /* @__PURE__ */ genKeccak(0x01, 136, 32); -/** keccak-384 hash function. */ -export const keccak_384 = /* @__PURE__ */ genKeccak(0x01, 104, 48); -/** keccak-512 hash function. */ -export const keccak_512 = /* @__PURE__ */ genKeccak(0x01, 72, 64); -const genShake = (suffix, blockLen, outputLen, info = {}) => createHasher((opts = {}) => new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true), info); -/** SHAKE128 XOF with 128-bit security. */ -export const shake128 = -/* @__PURE__ */ -genShake(0x1f, 168, 16, /* @__PURE__ */ oidNist(0x0b)); -/** SHAKE256 XOF with 256-bit security. */ -export const shake256 = -/* @__PURE__ */ -genShake(0x1f, 136, 32, /* @__PURE__ */ oidNist(0x0c)); -/** SHAKE128 XOF with 256-bit output (NIST version). */ -export const shake128_32 = -/* @__PURE__ */ -genShake(0x1f, 168, 32, /* @__PURE__ */ oidNist(0x0b)); -/** SHAKE256 XOF with 512-bit output (NIST version). */ -export const shake256_64 = -/* @__PURE__ */ -genShake(0x1f, 136, 64, /* @__PURE__ */ oidNist(0x0c)); -//# sourceMappingURL=sha3.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha3.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha3.js.map deleted file mode 100644 index 2a8e80f1..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/sha3.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha3.js","sourceRoot":"","sources":["src/sha3.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClE,kBAAkB;AAClB,OAAO,EACL,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EACjC,KAAK,EAAE,YAAY,EACnB,OAAO,EACP,UAAU,EACV,GAAG,EAKJ,MAAM,YAAY,CAAC;AAEpB,0CAA0C;AAC1C,8CAA8C;AAC9C,2CAA2C;AAC3C,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AAC1B,MAAM,MAAM,GAAG,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,CACV,CAAC,OAAkB,EAAE,EAAE,EAAE,CACvB,IAAI,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,EACvF,IAAI,CACL,CAAC;AAEJ,0CAA0C;AAC1C,MAAM,CAAC,MAAM,QAAQ;AACnB,eAAe;AACf,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AACzD,0CAA0C;AAC1C,MAAM,CAAC,MAAM,QAAQ;AACnB,eAAe;AACf,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AAEzD,uDAAuD;AACvD,MAAM,CAAC,MAAM,WAAW;AACtB,eAAe;AACf,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AACzD,uDAAuD;AACvD,MAAM,CAAC,MAAM,WAAW;AACtB,eAAe;AACf,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/_blake.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/_blake.ts deleted file mode 100644 index 2df27be0..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/_blake.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Internal helpers for blake hash. - * @module - */ -import { rotr } from './utils.ts'; - -/** - * Internal blake variable. - * For BLAKE2b, the two extra permutations for rounds 10 and 11 are SIGMA[10..11] = SIGMA[0..1]. - */ -// prettier-ignore -export const BSIGMA: Uint8Array = /* @__PURE__ */ Uint8Array.from([ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3, - 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4, - 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8, - 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13, - 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9, - 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11, - 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10, - 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5, - 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3, - // Blake1, unused in others - 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4, - 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8, - 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13, - 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9, -]); - -// prettier-ignore -export type Num4 = { a: number; b: number; c: number; d: number; }; - -// Mixing function G splitted in two halfs -export function G1s(a: number, b: number, c: number, d: number, x: number): Num4 { - a = (a + b + x) | 0; - d = rotr(d ^ a, 16); - c = (c + d) | 0; - b = rotr(b ^ c, 12); - return { a, b, c, d }; -} - -export function G2s(a: number, b: number, c: number, d: number, x: number): Num4 { - a = (a + b + x) | 0; - d = rotr(d ^ a, 8); - c = (c + d) | 0; - b = rotr(b ^ c, 7); - return { a, b, c, d }; -} diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/_md.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/_md.ts deleted file mode 100644 index 59474b16..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/_md.ts +++ /dev/null @@ -1,156 +0,0 @@ -/** - * Internal Merkle-Damgard hash utils. - * @module - */ -import { abytes, aexists, aoutput, clean, createView, type Hash } from './utils.ts'; - -/** Choice: a ? b : c */ -export function Chi(a: number, b: number, c: number): number { - return (a & b) ^ (~a & c); -} - -/** Majority function, true if any two inputs is true. */ -export function Maj(a: number, b: number, c: number): number { - return (a & b) ^ (a & c) ^ (b & c); -} - -/** - * Merkle-Damgard hash construction base class. - * Could be used to create MD5, RIPEMD, SHA1, SHA2. - */ -export abstract class HashMD> implements Hash { - protected abstract process(buf: DataView, offset: number): void; - protected abstract get(): number[]; - protected abstract set(...args: number[]): void; - abstract destroy(): void; - protected abstract roundClean(): void; - - readonly blockLen: number; - readonly outputLen: number; - readonly padOffset: number; - readonly isLE: boolean; - - // For partial updates less than block size - protected buffer: Uint8Array; - protected view: DataView; - protected finished = false; - protected length = 0; - protected pos = 0; - protected destroyed = false; - - constructor(blockLen: number, outputLen: number, padOffset: number, isLE: boolean) { - this.blockLen = blockLen; - this.outputLen = outputLen; - this.padOffset = padOffset; - this.isLE = isLE; - this.buffer = new Uint8Array(blockLen); - this.view = createView(this.buffer); - } - update(data: Uint8Array): this { - aexists(this); - abytes(data); - const { view, buffer, blockLen } = this; - const len = data.length; - for (let pos = 0; pos < len; ) { - const take = Math.min(blockLen - this.pos, len - pos); - // Fast path: we have at least one block in input, cast it to view and process - if (take === blockLen) { - const dataView = createView(data); - for (; blockLen <= len - pos; pos += blockLen) this.process(dataView, pos); - continue; - } - buffer.set(data.subarray(pos, pos + take), this.pos); - this.pos += take; - pos += take; - if (this.pos === blockLen) { - this.process(view, 0); - this.pos = 0; - } - } - this.length += data.length; - this.roundClean(); - return this; - } - digestInto(out: Uint8Array): void { - aexists(this); - aoutput(out, this); - this.finished = true; - // Padding - // We can avoid allocation of buffer for padding completely if it - // was previously not allocated here. But it won't change performance. - const { buffer, view, blockLen, isLE } = this; - let { pos } = this; - // append the bit '1' to the message - buffer[pos++] = 0b10000000; - clean(this.buffer.subarray(pos)); - // we have less than padOffset left in buffer, so we cannot put length in - // current block, need process it and pad again - if (this.padOffset > blockLen - pos) { - this.process(view, 0); - pos = 0; - } - // Pad until full block byte with zeros - for (let i = pos; i < blockLen; i++) buffer[i] = 0; - // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that - // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen. - // So we just write lowest 64 bits of that value. - view.setBigUint64(blockLen - 8, BigInt(this.length * 8), isLE); - this.process(view, 0); - const oview = createView(out); - const len = this.outputLen; - // NOTE: we do division by 4 later, which must be fused in single op with modulo by JIT - if (len % 4) throw new Error('_sha2: outputLen must be aligned to 32bit'); - const outLen = len / 4; - const state = this.get(); - if (outLen > state.length) throw new Error('_sha2: outputLen bigger than state'); - for (let i = 0; i < outLen; i++) oview.setUint32(4 * i, state[i], isLE); - } - digest(): Uint8Array { - const { buffer, outputLen } = this; - this.digestInto(buffer); - const res = buffer.slice(0, outputLen); - this.destroy(); - return res; - } - _cloneInto(to?: T): T { - to ||= new (this.constructor as any)() as T; - to.set(...this.get()); - const { blockLen, buffer, length, finished, destroyed, pos } = this; - to.destroyed = destroyed; - to.finished = finished; - to.length = length; - to.pos = pos; - if (length % blockLen) to.buffer.set(buffer); - return to as unknown as any; - } - clone(): T { - return this._cloneInto(); - } -} - -/** - * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53. - * Check out `test/misc/sha2-gen-iv.js` for recomputation guide. - */ - -/** Initial SHA256 state. Bits 0..32 of frac part of sqrt of primes 2..19 */ -export const SHA256_IV: Uint32Array = /* @__PURE__ */ Uint32Array.from([ - 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19, -]); - -/** Initial SHA224 state. Bits 32..64 of frac part of sqrt of primes 23..53 */ -export const SHA224_IV: Uint32Array = /* @__PURE__ */ Uint32Array.from([ - 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4, -]); - -/** Initial SHA384 state. Bits 0..64 of frac part of sqrt of primes 23..53 */ -export const SHA384_IV: Uint32Array = /* @__PURE__ */ Uint32Array.from([ - 0xcbbb9d5d, 0xc1059ed8, 0x629a292a, 0x367cd507, 0x9159015a, 0x3070dd17, 0x152fecd8, 0xf70e5939, - 0x67332667, 0xffc00b31, 0x8eb44a87, 0x68581511, 0xdb0c2e0d, 0x64f98fa7, 0x47b5481d, 0xbefa4fa4, -]); - -/** Initial SHA512 state. Bits 0..64 of frac part of sqrt of primes 2..19 */ -export const SHA512_IV: Uint32Array = /* @__PURE__ */ Uint32Array.from([ - 0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1, - 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179, -]); diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/_u64.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/_u64.ts deleted file mode 100644 index 703c7da5..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/_u64.ts +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Internal helpers for u64. BigUint64Array is too slow as per 2025, so we implement it using Uint32Array. - * @todo re-check https://issues.chromium.org/issues/42212588 - * @module - */ -const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1); -const _32n = /* @__PURE__ */ BigInt(32); - -function fromBig( - n: bigint, - le = false -): { - h: number; - l: number; -} { - if (le) return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) }; - return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 }; -} - -function split(lst: bigint[], le = false): Uint32Array[] { - const len = lst.length; - let Ah = new Uint32Array(len); - let Al = new Uint32Array(len); - for (let i = 0; i < len; i++) { - const { h, l } = fromBig(lst[i], le); - [Ah[i], Al[i]] = [h, l]; - } - return [Ah, Al]; -} - -const toBig = (h: number, l: number): bigint => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0); -// for Shift in [0, 32) -const shrSH = (h: number, _l: number, s: number): number => h >>> s; -const shrSL = (h: number, l: number, s: number): number => (h << (32 - s)) | (l >>> s); -// Right rotate for Shift in [1, 32) -const rotrSH = (h: number, l: number, s: number): number => (h >>> s) | (l << (32 - s)); -const rotrSL = (h: number, l: number, s: number): number => (h << (32 - s)) | (l >>> s); -// Right rotate for Shift in (32, 64), NOTE: 32 is special case. -const rotrBH = (h: number, l: number, s: number): number => (h << (64 - s)) | (l >>> (s - 32)); -const rotrBL = (h: number, l: number, s: number): number => (h >>> (s - 32)) | (l << (64 - s)); -// Right rotate for shift===32 (just swaps l&h) -const rotr32H = (_h: number, l: number): number => l; -const rotr32L = (h: number, _l: number): number => h; -// Left rotate for Shift in [1, 32) -const rotlSH = (h: number, l: number, s: number): number => (h << s) | (l >>> (32 - s)); -const rotlSL = (h: number, l: number, s: number): number => (l << s) | (h >>> (32 - s)); -// Left rotate for Shift in (32, 64), NOTE: 32 is special case. -const rotlBH = (h: number, l: number, s: number): number => (l << (s - 32)) | (h >>> (64 - s)); -const rotlBL = (h: number, l: number, s: number): number => (h << (s - 32)) | (l >>> (64 - s)); - -// JS uses 32-bit signed integers for bitwise operations which means we cannot -// simple take carry out of low bit sum by shift, we need to use division. -function add( - Ah: number, - Al: number, - Bh: number, - Bl: number -): { - h: number; - l: number; -} { - const l = (Al >>> 0) + (Bl >>> 0); - return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 }; -} -// Addition with more than 2 elements -const add3L = (Al: number, Bl: number, Cl: number): number => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); -const add3H = (low: number, Ah: number, Bh: number, Ch: number): number => - (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0; -const add4L = (Al: number, Bl: number, Cl: number, Dl: number): number => - (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); -const add4H = (low: number, Ah: number, Bh: number, Ch: number, Dh: number): number => - (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0; -const add5L = (Al: number, Bl: number, Cl: number, Dl: number, El: number): number => - (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); -const add5H = (low: number, Ah: number, Bh: number, Ch: number, Dh: number, Eh: number): number => - (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0; - -// prettier-ignore -export { - add, add3H, add3L, add4H, add4L, add5H, add5L, fromBig, rotlBH, rotlBL, rotlSH, rotlSL, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL, shrSH, shrSL, split, toBig -}; -// prettier-ignore -const u64: { fromBig: typeof fromBig; split: typeof split; toBig: (h: number, l: number) => bigint; shrSH: (h: number, _l: number, s: number) => number; shrSL: (h: number, l: number, s: number) => number; rotrSH: (h: number, l: number, s: number) => number; rotrSL: (h: number, l: number, s: number) => number; rotrBH: (h: number, l: number, s: number) => number; rotrBL: (h: number, l: number, s: number) => number; rotr32H: (_h: number, l: number) => number; rotr32L: (h: number, _l: number) => number; rotlSH: (h: number, l: number, s: number) => number; rotlSL: (h: number, l: number, s: number) => number; rotlBH: (h: number, l: number, s: number) => number; rotlBL: (h: number, l: number, s: number) => number; add: typeof add; add3L: (Al: number, Bl: number, Cl: number) => number; add3H: (low: number, Ah: number, Bh: number, Ch: number) => number; add4L: (Al: number, Bl: number, Cl: number, Dl: number) => number; add4H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number) => number; add5H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number, Eh: number) => number; add5L: (Al: number, Bl: number, Cl: number, Dl: number, El: number) => number; } = { - fromBig, split, toBig, - shrSH, shrSL, - rotrSH, rotrSL, rotrBH, rotrBL, - rotr32H, rotr32L, - rotlSH, rotlSL, rotlBH, rotlBL, - add, add3L, add3H, add4L, add4H, add5H, add5L, -}; -export default u64; diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/argon2.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/argon2.ts deleted file mode 100644 index d08e6250..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/argon2.ts +++ /dev/null @@ -1,493 +0,0 @@ -/** - * Argon2 KDF from RFC 9106. Can be used to create a key from password and salt. - * We suggest to use Scrypt. JS Argon is 2-10x slower than native code because of 64-bitness: - * * argon uses uint64, but JS doesn't have fast uint64array - * * uint64 multiplication is 1/3 of time - * * `P` function would be very nice with u64, because most of value will be in registers, - * hovewer with u32 it will require 32 registers, which is too much. - * * JS arrays do slow bound checks, so reading from `A2_BUF` slows it down - * @module - */ -import { add3H, add3L, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL } from './_u64.ts'; -import { blake2b } from './blake2.ts'; -import { anumber, clean, kdfInputToBytes, nextTick, u32, u8, type KDFInput } from './utils.ts'; - -const AT = { Argond2d: 0, Argon2i: 1, Argon2id: 2 } as const; -type Types = (typeof AT)[keyof typeof AT]; - -const ARGON2_SYNC_POINTS = 4; -const abytesOrZero = (buf?: KDFInput, errorTitle = '') => { - if (buf === undefined) return Uint8Array.of(); - return kdfInputToBytes(buf, errorTitle); -}; - -// u32 * u32 = u64 -function mul(a: number, b: number) { - const aL = a & 0xffff; - const aH = a >>> 16; - const bL = b & 0xffff; - const bH = b >>> 16; - const ll = Math.imul(aL, bL); - const hl = Math.imul(aH, bL); - const lh = Math.imul(aL, bH); - const hh = Math.imul(aH, bH); - const carry = (ll >>> 16) + (hl & 0xffff) + lh; - const high = (hh + (hl >>> 16) + (carry >>> 16)) | 0; - const low = (carry << 16) | (ll & 0xffff); - return { h: high, l: low }; -} - -function mul2(a: number, b: number) { - // 2 * a * b (via shifts) - const { h, l } = mul(a, b); - return { h: ((h << 1) | (l >>> 31)) & 0xffff_ffff, l: (l << 1) & 0xffff_ffff }; -} - -// BlaMka permutation for Argon2 -// A + B + (2 * u32(A) * u32(B)) -function blamka(Ah: number, Al: number, Bh: number, Bl: number) { - const { h: Ch, l: Cl } = mul2(Al, Bl); - // A + B + (2 * A * B) - const Rll = add3L(Al, Bl, Cl); - return { h: add3H(Rll, Ah, Bh, Ch), l: Rll | 0 }; -} - -// Temporary block buffer -const A2_BUF = new Uint32Array(256); // 1024 bytes (matrix 16x16) - -function G(a: number, b: number, c: number, d: number) { - let Al = A2_BUF[2*a], Ah = A2_BUF[2*a + 1]; // prettier-ignore - let Bl = A2_BUF[2*b], Bh = A2_BUF[2*b + 1]; // prettier-ignore - let Cl = A2_BUF[2*c], Ch = A2_BUF[2*c + 1]; // prettier-ignore - let Dl = A2_BUF[2*d], Dh = A2_BUF[2*d + 1]; // prettier-ignore - - ({ h: Ah, l: Al } = blamka(Ah, Al, Bh, Bl)); - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: rotr32H(Dh, Dl), Dl: rotr32L(Dh, Dl) }); - - ({ h: Ch, l: Cl } = blamka(Ch, Cl, Dh, Dl)); - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: rotrSH(Bh, Bl, 24), Bl: rotrSL(Bh, Bl, 24) }); - - ({ h: Ah, l: Al } = blamka(Ah, Al, Bh, Bl)); - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: rotrSH(Dh, Dl, 16), Dl: rotrSL(Dh, Dl, 16) }); - - ({ h: Ch, l: Cl } = blamka(Ch, Cl, Dh, Dl)); - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: rotrBH(Bh, Bl, 63), Bl: rotrBL(Bh, Bl, 63) }); - - ((A2_BUF[2 * a] = Al), (A2_BUF[2 * a + 1] = Ah)); - ((A2_BUF[2 * b] = Bl), (A2_BUF[2 * b + 1] = Bh)); - ((A2_BUF[2 * c] = Cl), (A2_BUF[2 * c + 1] = Ch)); - ((A2_BUF[2 * d] = Dl), (A2_BUF[2 * d + 1] = Dh)); -} - -// prettier-ignore -function P( - v00: number, v01: number, v02: number, v03: number, v04: number, v05: number, v06: number, v07: number, - v08: number, v09: number, v10: number, v11: number, v12: number, v13: number, v14: number, v15: number, -) { - G(v00, v04, v08, v12); - G(v01, v05, v09, v13); - G(v02, v06, v10, v14); - G(v03, v07, v11, v15); - G(v00, v05, v10, v15); - G(v01, v06, v11, v12); - G(v02, v07, v08, v13); - G(v03, v04, v09, v14); -} - -function block(x: Uint32Array, xPos: number, yPos: number, outPos: number, needXor: boolean) { - for (let i = 0; i < 256; i++) A2_BUF[i] = x[xPos + i] ^ x[yPos + i]; - // columns (8) - for (let i = 0; i < 128; i += 16) { - // prettier-ignore - P( - i, i + 1, i + 2, i + 3, i + 4, i + 5, i + 6, i + 7, - i + 8, i + 9, i + 10, i + 11, i + 12, i + 13, i + 14, i + 15 - ); - } - // rows (8) - for (let i = 0; i < 16; i += 2) { - // prettier-ignore - P( - i, i + 1, i + 16, i + 17, i + 32, i + 33, i + 48, i + 49, - i + 64, i + 65, i + 80, i + 81, i + 96, i + 97, i + 112, i + 113 - ); - } - - if (needXor) for (let i = 0; i < 256; i++) x[outPos + i] ^= A2_BUF[i] ^ x[xPos + i] ^ x[yPos + i]; - else for (let i = 0; i < 256; i++) x[outPos + i] = A2_BUF[i] ^ x[xPos + i] ^ x[yPos + i]; - clean(A2_BUF); -} - -// Variable-Length Hash Function H' -function Hp(A: Uint32Array, dkLen: number) { - const A8 = u8(A); - const T = new Uint32Array(1); - const T8 = u8(T); - T[0] = dkLen; - // Fast path - if (dkLen <= 64) return blake2b.create({ dkLen }).update(T8).update(A8).digest(); - const out = new Uint8Array(dkLen); - let V = blake2b.create({}).update(T8).update(A8).digest(); - let pos = 0; - // First block - out.set(V.subarray(0, 32)); - pos += 32; - // Rest blocks - for (; dkLen - pos > 64; pos += 32) { - const Vh = blake2b.create({}).update(V); - Vh.digestInto(V); - Vh.destroy(); - out.set(V.subarray(0, 32), pos); - } - // Last block - out.set(blake2b(V, { dkLen: dkLen - pos }), pos); - clean(V, T); - return u32(out); -} - -// Used only inside process block! -function indexAlpha( - r: number, - s: number, - laneLen: number, - segmentLen: number, - index: number, - randL: number, - sameLane: boolean = false -) { - // This is ugly, but close enough to reference implementation. - let area: number; - if (r === 0) { - if (s === 0) area = index - 1; - else if (sameLane) area = s * segmentLen + index - 1; - else area = s * segmentLen + (index == 0 ? -1 : 0); - } else if (sameLane) area = laneLen - segmentLen + index - 1; - else area = laneLen - segmentLen + (index == 0 ? -1 : 0); - const startPos = r !== 0 && s !== ARGON2_SYNC_POINTS - 1 ? (s + 1) * segmentLen : 0; - const rel = area - 1 - mul(area, mul(randL, randL).h).h; - return (startPos + rel) % laneLen; -} - -/** - * Argon2 options. - * * t: time cost, m: mem cost in kb, p: parallelization. - * * key: optional key. personalization: arbitrary extra data. - * * dkLen: desired number of output bytes. - */ -export type ArgonOpts = { - t: number; // Time cost, iterations count - m: number; // Memory cost (in KB) - p: number; // Parallelization parameter - version?: number; // Default: 0x13 (19) - key?: KDFInput; // Optional key - personalization?: KDFInput; // Optional arbitrary extra data - dkLen?: number; // Desired number of returned bytes - asyncTick?: number; // Maximum time in ms for which async function can block execution - maxmem?: number; - onProgress?: (progress: number) => void; -}; - -const maxUint32 = Math.pow(2, 32); -function isU32(num: number) { - return Number.isSafeInteger(num) && num >= 0 && num < maxUint32; -} - -function argon2Opts(opts: ArgonOpts) { - const merged: any = { - version: 0x13, - dkLen: 32, - maxmem: maxUint32 - 1, - asyncTick: 10, - }; - for (let [k, v] of Object.entries(opts)) if (v !== undefined) merged[k] = v; - - const { dkLen, p, m, t, version, onProgress, asyncTick } = merged; - if (!isU32(dkLen) || dkLen < 4) throw new Error('"dkLen" must be 4..'); - if (!isU32(p) || p < 1 || p >= Math.pow(2, 24)) throw new Error('"p" must be 1..2^24'); - if (!isU32(m)) throw new Error('"m" must be 0..2^32'); - if (!isU32(t) || t < 1) throw new Error('"t" (iterations) must be 1..2^32'); - if (onProgress !== undefined && typeof onProgress !== 'function') - throw new Error('"progressCb" must be a function'); - anumber(asyncTick, 'asyncTick'); - /* - Memory size m MUST be an integer number of kibibytes from 8*p to 2^(32)-1. The actual number of blocks is m', which is m rounded down to the nearest multiple of 4*p. - */ - if (!isU32(m) || m < 8 * p) throw new Error('"m" (memory) must be at least 8*p bytes'); - if (version !== 0x10 && version !== 0x13) - throw new Error('"version" must be 0x10 or 0x13, got ' + version); - return merged; -} - -function argon2Init(password: KDFInput, salt: KDFInput, type: Types, opts: ArgonOpts) { - password = kdfInputToBytes(password, 'password'); - salt = kdfInputToBytes(salt, 'salt'); - if (!isU32(password.length)) throw new Error('"password" must be less of length 1..4Gb'); - if (!isU32(salt.length) || salt.length < 8) throw new Error('"salt" must be of length 8..4Gb'); - if (!Object.values(AT).includes(type)) throw new Error('"type" was invalid'); - let { p, dkLen, m, t, version, key, personalization, maxmem, onProgress, asyncTick } = - argon2Opts(opts); - // Validation - key = abytesOrZero(key, 'key'); - personalization = abytesOrZero(personalization, 'personalization'); - // H_0 = H^(64)(LE32(p) || LE32(T) || LE32(m) || LE32(t) || - // LE32(v) || LE32(y) || LE32(length(P)) || P || - // LE32(length(S)) || S || LE32(length(K)) || K || - // LE32(length(X)) || X) - const h = blake2b.create(); - const BUF = new Uint32Array(1); - const BUF8 = u8(BUF); - for (let item of [p, dkLen, m, t, version, type]) { - BUF[0] = item; - h.update(BUF8); - } - for (let i of [password, salt, key, personalization]) { - BUF[0] = i.length; // BUF is u32 array, this is valid - h.update(BUF8).update(i); - } - const H0 = new Uint32Array(18); - const H0_8 = u8(H0); - h.digestInto(H0_8); - // 256 u32 = 1024 (BLOCK_SIZE), fills A2_BUF on processing - - // Params - const lanes = p; - // m' = 4 * p * floor (m / 4p) - const mP = 4 * p * Math.floor(m / (ARGON2_SYNC_POINTS * p)); - //q = m' / p columns - const laneLen = Math.floor(mP / p); - const segmentLen = Math.floor(laneLen / ARGON2_SYNC_POINTS); - const memUsed = mP * 256; - if (!isU32(maxmem) || memUsed > maxmem) - throw new Error('"maxmem" expected <2**32, got: maxmem=' + maxmem + ', memused=' + memUsed); - const B = new Uint32Array(memUsed); - // Fill first blocks - for (let l = 0; l < p; l++) { - const i = 256 * laneLen * l; - // B[i][0] = H'^(1024)(H_0 || LE32(0) || LE32(i)) - H0[17] = l; - H0[16] = 0; - B.set(Hp(H0, 1024), i); - // B[i][1] = H'^(1024)(H_0 || LE32(1) || LE32(i)) - H0[16] = 1; - B.set(Hp(H0, 1024), i + 256); - } - let perBlock = () => {}; - if (onProgress) { - const totalBlock = t * ARGON2_SYNC_POINTS * p * segmentLen; - // Invoke callback if progress changes from 10.01 to 10.02 - // Allows to draw smooth progress bar on up to 8K screen - const callbackPer = Math.max(Math.floor(totalBlock / 10000), 1); - let blockCnt = 0; - perBlock = () => { - blockCnt++; - if (onProgress && (!(blockCnt % callbackPer) || blockCnt === totalBlock)) - onProgress(blockCnt / totalBlock); - }; - } - clean(BUF, H0); - return { type, mP, p, t, version, B, laneLen, lanes, segmentLen, dkLen, perBlock, asyncTick }; -} - -function argon2Output(B: Uint32Array, p: number, laneLen: number, dkLen: number) { - const B_final = new Uint32Array(256); - for (let l = 0; l < p; l++) - for (let j = 0; j < 256; j++) B_final[j] ^= B[256 * (laneLen * l + laneLen - 1) + j]; - const res = u8(Hp(B_final, dkLen)); - clean(B_final); - return res; -} - -function processBlock( - B: Uint32Array, - address: Uint32Array, - l: number, - r: number, - s: number, - index: number, - laneLen: number, - segmentLen: number, - lanes: number, - offset: number, - prev: number, - dataIndependent: boolean, - needXor: boolean -) { - if (offset % laneLen) prev = offset - 1; - let randL, randH; - if (dataIndependent) { - let i128 = index % 128; - if (i128 === 0) { - address[256 + 12]++; - block(address, 256, 2 * 256, 0, false); - block(address, 0, 2 * 256, 0, false); - } - randL = address[2 * i128]; - randH = address[2 * i128 + 1]; - } else { - const T = 256 * prev; - randL = B[T]; - randH = B[T + 1]; - } - // address block - const refLane = r === 0 && s === 0 ? l : randH % lanes; - const refPos = indexAlpha(r, s, laneLen, segmentLen, index, randL, refLane == l); - const refBlock = laneLen * refLane + refPos; - // B[i][j] = G(B[i][j-1], B[l][z]) - block(B, 256 * prev, 256 * refBlock, offset * 256, needXor); -} - -function argon2(type: Types, password: KDFInput, salt: KDFInput, opts: ArgonOpts) { - const { mP, p, t, version, B, laneLen, lanes, segmentLen, dkLen, perBlock } = argon2Init( - password, - salt, - type, - opts - ); - // Pre-loop setup - // [address, input, zero_block] format so we can pass single U32 to block function - const address = new Uint32Array(3 * 256); - address[256 + 6] = mP; - address[256 + 8] = t; - address[256 + 10] = type; - for (let r = 0; r < t; r++) { - const needXor = r !== 0 && version === 0x13; - address[256 + 0] = r; - for (let s = 0; s < ARGON2_SYNC_POINTS; s++) { - address[256 + 4] = s; - const dataIndependent = type == AT.Argon2i || (type == AT.Argon2id && r === 0 && s < 2); - for (let l = 0; l < p; l++) { - address[256 + 2] = l; - address[256 + 12] = 0; - let startPos = 0; - if (r === 0 && s === 0) { - startPos = 2; - if (dataIndependent) { - address[256 + 12]++; - block(address, 256, 2 * 256, 0, false); - block(address, 0, 2 * 256, 0, false); - } - } - // current block postion - let offset = l * laneLen + s * segmentLen + startPos; - // previous block position - let prev = offset % laneLen ? offset - 1 : offset + laneLen - 1; - for (let index = startPos; index < segmentLen; index++, offset++, prev++) { - perBlock(); - processBlock( - B, - address, - l, - r, - s, - index, - laneLen, - segmentLen, - lanes, - offset, - prev, - dataIndependent, - needXor - ); - } - } - } - } - clean(address); - return argon2Output(B, p, laneLen, dkLen); -} - -/** argon2d GPU-resistant version. */ -export const argon2d = (password: KDFInput, salt: KDFInput, opts: ArgonOpts): Uint8Array => - argon2(AT.Argond2d, password, salt, opts); -/** argon2i side-channel-resistant version. */ -export const argon2i = (password: KDFInput, salt: KDFInput, opts: ArgonOpts): Uint8Array => - argon2(AT.Argon2i, password, salt, opts); -/** argon2id, combining i+d, the most popular version from RFC 9106 */ -export const argon2id = (password: KDFInput, salt: KDFInput, opts: ArgonOpts): Uint8Array => - argon2(AT.Argon2id, password, salt, opts); - -async function argon2Async(type: Types, password: KDFInput, salt: KDFInput, opts: ArgonOpts) { - const { mP, p, t, version, B, laneLen, lanes, segmentLen, dkLen, perBlock, asyncTick } = - argon2Init(password, salt, type, opts); - // Pre-loop setup - // [address, input, zero_block] format so we can pass single U32 to block function - const address = new Uint32Array(3 * 256); - address[256 + 6] = mP; - address[256 + 8] = t; - address[256 + 10] = type; - let ts = Date.now(); - for (let r = 0; r < t; r++) { - const needXor = r !== 0 && version === 0x13; - address[256 + 0] = r; - for (let s = 0; s < ARGON2_SYNC_POINTS; s++) { - address[256 + 4] = s; - const dataIndependent = type == AT.Argon2i || (type == AT.Argon2id && r === 0 && s < 2); - for (let l = 0; l < p; l++) { - address[256 + 2] = l; - address[256 + 12] = 0; - let startPos = 0; - if (r === 0 && s === 0) { - startPos = 2; - if (dataIndependent) { - address[256 + 12]++; - block(address, 256, 2 * 256, 0, false); - block(address, 0, 2 * 256, 0, false); - } - } - // current block postion - let offset = l * laneLen + s * segmentLen + startPos; - // previous block position - let prev = offset % laneLen ? offset - 1 : offset + laneLen - 1; - for (let index = startPos; index < segmentLen; index++, offset++, prev++) { - perBlock(); - processBlock( - B, - address, - l, - r, - s, - index, - laneLen, - segmentLen, - lanes, - offset, - prev, - dataIndependent, - needXor - ); - // Date.now() is not monotonic, so in case if clock goes backwards we return return control too - const diff = Date.now() - ts; - if (!(diff >= 0 && diff < asyncTick)) { - await nextTick(); - ts += diff; - } - } - } - } - } - clean(address); - return argon2Output(B, p, laneLen, dkLen); -} - -/** argon2d async GPU-resistant version. */ -export const argon2dAsync = ( - password: KDFInput, - salt: KDFInput, - opts: ArgonOpts -): Promise => argon2Async(AT.Argond2d, password, salt, opts); -/** argon2i async side-channel-resistant version. */ -export const argon2iAsync = ( - password: KDFInput, - salt: KDFInput, - opts: ArgonOpts -): Promise => argon2Async(AT.Argon2i, password, salt, opts); -/** argon2id async, combining i+d, the most popular version from RFC 9106 */ -export const argon2idAsync = ( - password: KDFInput, - salt: KDFInput, - opts: ArgonOpts -): Promise => argon2Async(AT.Argon2id, password, salt, opts); diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/blake1.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/blake1.ts deleted file mode 100644 index 6628a7b1..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/blake1.ts +++ /dev/null @@ -1,536 +0,0 @@ -/** - * Blake1 legacy hash function, one of SHA3 proposals. - * Rarely used. Check out blake2 or blake3 instead. - * https://www.aumasson.jp/blake/blake.pdf - * - * In the best case, there are 0 allocations. - * - * Differences from blake2: - * - * - BE instead of LE - * - Paddings, similar to MD5, RIPEMD, SHA1, SHA2, but: - * - length flag is located before actual length - * - padding block is compressed differently (no lengths) - * Instead of msg[sigma[k]], we have `msg[sigma[k]] ^ constants[sigma[k-1]]` - * (-1 for g1, g2 without -1) - * - Salt is XOR-ed into constants instead of state - * - Salt is XOR-ed with output in `compress` - * - Additional rows (+64 bytes) in SIGMA for new rounds - * - Different round count: - * - 14 / 10 rounds in blake256 / blake2s - * - 16 / 12 rounds in blake512 / blake2b - * - blake512: G1b: rotr 24 -> 25, G2b: rotr 63 -> 11 - * @module - */ -import { BSIGMA, G1s, G2s } from './_blake.ts'; -import { SHA224_IV, SHA256_IV, SHA384_IV, SHA512_IV } from './_md.ts'; -import * as u64 from './_u64.ts'; -// prettier-ignore -import { - abytes, aexists, aoutput, - clean, createHasher, - createView, - type CHash, - type Hash -} from './utils.ts'; - -/** Blake1 options. Basically just "salt" */ -export type BlakeOpts = { - salt?: Uint8Array; -}; - -// Empty zero-filled salt -const EMPTY_SALT = /* @__PURE__ */ new Uint32Array(8); - -abstract class BLAKE1> implements Hash { - protected finished = false; - protected length = 0; - protected pos = 0; - protected destroyed = false; - // For partial updates less than block size - protected buffer: Uint8Array; - protected view: DataView; - protected salt: Uint32Array; - abstract compress(view: DataView, offset: number, withLength?: boolean): void; - protected abstract get(): number[]; - protected abstract set(...args: number[]): void; - - readonly blockLen: number; - readonly outputLen: number; - private lengthFlag: number; - private counterLen: number; - protected constants: Uint32Array; - - constructor( - blockLen: number, - outputLen: number, - lengthFlag: number, - counterLen: number, - saltLen: number, - constants: Uint32Array, - opts: BlakeOpts = {} - ) { - const { salt } = opts; - this.blockLen = blockLen; - this.outputLen = outputLen; - this.lengthFlag = lengthFlag; - this.counterLen = counterLen; - this.buffer = new Uint8Array(blockLen); - this.view = createView(this.buffer); - if (salt !== undefined) { - let slt = salt; - abytes(slt, 4 * saltLen, 'salt'); - // if (slt.length !== 4 * saltLen) throw new Error('wrong salt length'); - const salt32 = (this.salt = new Uint32Array(saltLen)); - const sv = createView(slt); - this.constants = constants.slice(); - for (let i = 0, offset = 0; i < salt32.length; i++, offset += 4) { - salt32[i] = sv.getUint32(offset, false); - this.constants[i] ^= salt32[i]; - } - } else { - this.salt = EMPTY_SALT; - this.constants = constants; - } - } - update(data: Uint8Array): this { - aexists(this); - abytes(data); - // From _md, but update length before each compress - const { view, buffer, blockLen } = this; - const len = data.length; - let dataView; - for (let pos = 0; pos < len; ) { - const take = Math.min(blockLen - this.pos, len - pos); - // Fast path: we have at least one block in input, cast it to view and process - if (take === blockLen) { - if (!dataView) dataView = createView(data); - for (; blockLen <= len - pos; pos += blockLen) { - this.length += blockLen; - this.compress(dataView, pos); - } - continue; - } - buffer.set(data.subarray(pos, pos + take), this.pos); - this.pos += take; - pos += take; - if (this.pos === blockLen) { - this.length += blockLen; - this.compress(view, 0, true); - this.pos = 0; - } - } - return this; - } - destroy(): void { - this.destroyed = true; - if (this.salt !== EMPTY_SALT) { - clean(this.salt, this.constants); - } - } - _cloneInto(to?: T): T { - to ||= new (this.constructor as any)() as T; - to.set(...this.get()); - const { buffer, length, finished, destroyed, constants, salt, pos } = this; - to.buffer.set(buffer); - to.constants = constants.slice(); - to.destroyed = destroyed; - to.finished = finished; - to.length = length; - to.pos = pos; - to.salt = salt.slice(); - return to; - } - clone(): T { - return this._cloneInto(); - } - digestInto(out: Uint8Array): void { - aexists(this); - aoutput(out, this); - this.finished = true; - // Padding - const { buffer, blockLen, counterLen, lengthFlag, view } = this; - clean(buffer.subarray(this.pos)); // clean buf - const counter = BigInt((this.length + this.pos) * 8); - const counterPos = blockLen - counterLen - 1; - buffer[this.pos] |= 0b1000_0000; // End block flag - this.length += this.pos; // add unwritten length - // Not enough in buffer for length: write what we have. - if (this.pos > counterPos) { - this.compress(view, 0); - clean(buffer); - this.pos = 0; - } - // Difference with md: here we have lengthFlag! - buffer[counterPos] |= lengthFlag; // Length flag - // We always set 8 byte length flag. Because length will overflow significantly sooner. - view.setBigUint64(blockLen - 8, counter, false); - this.compress(view, 0, this.pos !== 0); // don't add length if length is not empty block? - // Write output - clean(buffer); - const v = createView(out); - const state = this.get(); - for (let i = 0; i < this.outputLen / 4; ++i) v.setUint32(i * 4, state[i]); - } - digest(): Uint8Array { - const { buffer, outputLen } = this; - this.digestInto(buffer); - const res = buffer.slice(0, outputLen); - this.destroy(); - return res; - } -} - -// Constants -const B64C = /* @__PURE__ */ Uint32Array.from([ - 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, - 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, - 0x9216d5d9, 0x8979fb1b, 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96, - 0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, 0x636920d8, 0x71574e69, -]); -// first half of C512 -const B32C = B64C.slice(0, 16); - -const B256_IV = /* @__PURE__ */ SHA256_IV.slice(); -const B224_IV = /* @__PURE__ */ SHA224_IV.slice(); -const B384_IV = /* @__PURE__ */ SHA384_IV.slice(); -const B512_IV = /* @__PURE__ */ SHA512_IV.slice(); - -function generateTBL256() { - const TBL = []; - for (let i = 0, j = 0; i < 14; i++, j += 16) { - for (let offset = 1; offset < 16; offset += 2) { - TBL.push(B32C[BSIGMA[j + offset]]); - TBL.push(B32C[BSIGMA[j + offset - 1]]); - } - } - return new Uint32Array(TBL); -} -const TBL256 = /* @__PURE__ */ generateTBL256(); // C256[SIGMA[X]] precompute - -// Reusable temporary buffer -const BLAKE256_W = /* @__PURE__ */ new Uint32Array(16); - -class BLAKE1_32B extends BLAKE1 { - private v0: number; - private v1: number; - private v2: number; - private v3: number; - private v4: number; - private v5: number; - private v6: number; - private v7: number; - constructor(outputLen: number, IV: Uint32Array, lengthFlag: number, opts: BlakeOpts = {}) { - super(64, outputLen, lengthFlag, 8, 4, B32C, opts); - this.v0 = IV[0] | 0; - this.v1 = IV[1] | 0; - this.v2 = IV[2] | 0; - this.v3 = IV[3] | 0; - this.v4 = IV[4] | 0; - this.v5 = IV[5] | 0; - this.v6 = IV[6] | 0; - this.v7 = IV[7] | 0; - } - protected get(): [number, number, number, number, number, number, number, number] { - const { v0, v1, v2, v3, v4, v5, v6, v7 } = this; - return [v0, v1, v2, v3, v4, v5, v6, v7]; - } - // prettier-ignore - protected set( - v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number - ): void { - this.v0 = v0 | 0; - this.v1 = v1 | 0; - this.v2 = v2 | 0; - this.v3 = v3 | 0; - this.v4 = v4 | 0; - this.v5 = v5 | 0; - this.v6 = v6 | 0; - this.v7 = v7 | 0; - } - destroy(): void { - super.destroy(); - this.set(0, 0, 0, 0, 0, 0, 0, 0); - } - compress(view: DataView, offset: number, withLength = true): void { - for (let i = 0; i < 16; i++, offset += 4) BLAKE256_W[i] = view.getUint32(offset, false); - // NOTE: we cannot re-use compress from blake2s, since there is additional xor over u256[SIGMA[e]] - let v00 = this.v0 | 0; - let v01 = this.v1 | 0; - let v02 = this.v2 | 0; - let v03 = this.v3 | 0; - let v04 = this.v4 | 0; - let v05 = this.v5 | 0; - let v06 = this.v6 | 0; - let v07 = this.v7 | 0; - let v08 = this.constants[0] | 0; - let v09 = this.constants[1] | 0; - let v10 = this.constants[2] | 0; - let v11 = this.constants[3] | 0; - const { h, l } = u64.fromBig(BigInt(withLength ? this.length * 8 : 0)); - let v12 = (this.constants[4] ^ l) >>> 0; - let v13 = (this.constants[5] ^ l) >>> 0; - let v14 = (this.constants[6] ^ h) >>> 0; - let v15 = (this.constants[7] ^ h) >>> 0; - // prettier-ignore - for (let i = 0, k = 0, j = 0; i < 14; i++) { - ({ a: v00, b: v04, c: v08, d: v12 } = G1s(v00, v04, v08, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v00, b: v04, c: v08, d: v12 } = G2s(v00, v04, v08, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v01, b: v05, c: v09, d: v13 } = G1s(v01, v05, v09, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v01, b: v05, c: v09, d: v13 } = G2s(v01, v05, v09, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v02, b: v06, c: v10, d: v14 } = G1s(v02, v06, v10, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v02, b: v06, c: v10, d: v14 } = G2s(v02, v06, v10, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v03, b: v07, c: v11, d: v15 } = G1s(v03, v07, v11, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v03, b: v07, c: v11, d: v15 } = G2s(v03, v07, v11, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v00, b: v05, c: v10, d: v15 } = G1s(v00, v05, v10, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v00, b: v05, c: v10, d: v15 } = G2s(v00, v05, v10, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v01, b: v06, c: v11, d: v12 } = G1s(v01, v06, v11, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v01, b: v06, c: v11, d: v12 } = G2s(v01, v06, v11, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v02, b: v07, c: v08, d: v13 } = G1s(v02, v07, v08, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v02, b: v07, c: v08, d: v13 } = G2s(v02, v07, v08, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v03, b: v04, c: v09, d: v14 } = G1s(v03, v04, v09, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - ({ a: v03, b: v04, c: v09, d: v14 } = G2s(v03, v04, v09, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); - } - this.v0 = (this.v0 ^ v00 ^ v08 ^ this.salt[0]) >>> 0; - this.v1 = (this.v1 ^ v01 ^ v09 ^ this.salt[1]) >>> 0; - this.v2 = (this.v2 ^ v02 ^ v10 ^ this.salt[2]) >>> 0; - this.v3 = (this.v3 ^ v03 ^ v11 ^ this.salt[3]) >>> 0; - this.v4 = (this.v4 ^ v04 ^ v12 ^ this.salt[0]) >>> 0; - this.v5 = (this.v5 ^ v05 ^ v13 ^ this.salt[1]) >>> 0; - this.v6 = (this.v6 ^ v06 ^ v14 ^ this.salt[2]) >>> 0; - this.v7 = (this.v7 ^ v07 ^ v15 ^ this.salt[3]) >>> 0; - clean(BLAKE256_W); - } -} - -const BBUF = /* @__PURE__ */ new Uint32Array(32); -const BLAKE512_W = /* @__PURE__ */ new Uint32Array(32); - -function generateTBL512() { - const TBL = []; - for (let r = 0, k = 0; r < 16; r++, k += 16) { - for (let offset = 1; offset < 16; offset += 2) { - TBL.push(B64C[BSIGMA[k + offset] * 2 + 0]); - TBL.push(B64C[BSIGMA[k + offset] * 2 + 1]); - TBL.push(B64C[BSIGMA[k + offset - 1] * 2 + 0]); - TBL.push(B64C[BSIGMA[k + offset - 1] * 2 + 1]); - } - } - return new Uint32Array(TBL); -} -const TBL512 = /* @__PURE__ */ generateTBL512(); // C512[SIGMA[X]] precompute - -// Mixing function G splitted in two halfs -function G1b(a: number, b: number, c: number, d: number, msg: Uint32Array, k: number) { - const Xpos = 2 * BSIGMA[k]; - const Xl = msg[Xpos + 1] ^ TBL512[k * 2 + 1], Xh = msg[Xpos] ^ TBL512[k * 2]; // prettier-ignore - let Al = BBUF[2 * a + 1], Ah = BBUF[2 * a]; // prettier-ignore - let Bl = BBUF[2 * b + 1], Bh = BBUF[2 * b]; // prettier-ignore - let Cl = BBUF[2 * c + 1], Ch = BBUF[2 * c]; // prettier-ignore - let Dl = BBUF[2 * d + 1], Dh = BBUF[2 * d]; // prettier-ignore - // v[a] = (v[a] + v[b] + x) | 0; - let ll = u64.add3L(Al, Bl, Xl); - Ah = u64.add3H(ll, Ah, Bh, Xh) >>> 0; - Al = (ll | 0) >>> 0; - // v[d] = rotr(v[d] ^ v[a], 32) - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: u64.rotr32H(Dh, Dl), Dl: u64.rotr32L(Dh, Dl) }); - // v[c] = (v[c] + v[d]) | 0; - ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); - // v[b] = rotr(v[b] ^ v[c], 25) - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: u64.rotrSH(Bh, Bl, 25), Bl: u64.rotrSL(Bh, Bl, 25) }); - ((BBUF[2 * a + 1] = Al), (BBUF[2 * a] = Ah)); - ((BBUF[2 * b + 1] = Bl), (BBUF[2 * b] = Bh)); - ((BBUF[2 * c + 1] = Cl), (BBUF[2 * c] = Ch)); - ((BBUF[2 * d + 1] = Dl), (BBUF[2 * d] = Dh)); -} - -function G2b(a: number, b: number, c: number, d: number, msg: Uint32Array, k: number) { - const Xpos = 2 * BSIGMA[k]; - const Xl = msg[Xpos + 1] ^ TBL512[k * 2 + 1], Xh = msg[Xpos] ^ TBL512[k * 2]; // prettier-ignore - let Al = BBUF[2 * a + 1], Ah = BBUF[2 * a]; // prettier-ignore - let Bl = BBUF[2 * b + 1], Bh = BBUF[2 * b]; // prettier-ignore - let Cl = BBUF[2 * c + 1], Ch = BBUF[2 * c]; // prettier-ignore - let Dl = BBUF[2 * d + 1], Dh = BBUF[2 * d]; // prettier-ignore - // v[a] = (v[a] + v[b] + x) | 0; - let ll = u64.add3L(Al, Bl, Xl); - Ah = u64.add3H(ll, Ah, Bh, Xh); - Al = ll | 0; - // v[d] = rotr(v[d] ^ v[a], 16) - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: u64.rotrSH(Dh, Dl, 16), Dl: u64.rotrSL(Dh, Dl, 16) }); - // v[c] = (v[c] + v[d]) | 0; - ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); - // v[b] = rotr(v[b] ^ v[c], 11) - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: u64.rotrSH(Bh, Bl, 11), Bl: u64.rotrSL(Bh, Bl, 11) }); - ((BBUF[2 * a + 1] = Al), (BBUF[2 * a] = Ah)); - ((BBUF[2 * b + 1] = Bl), (BBUF[2 * b] = Bh)); - ((BBUF[2 * c + 1] = Cl), (BBUF[2 * c] = Ch)); - ((BBUF[2 * d + 1] = Dl), (BBUF[2 * d] = Dh)); -} - -class BLAKE1_64B extends BLAKE1 { - private v0l: number; - private v0h: number; - private v1l: number; - private v1h: number; - private v2l: number; - private v2h: number; - private v3l: number; - private v3h: number; - private v4l: number; - private v4h: number; - private v5l: number; - private v5h: number; - private v6l: number; - private v6h: number; - private v7l: number; - private v7h: number; - constructor(outputLen: number, IV: Uint32Array, lengthFlag: number, opts: BlakeOpts = {}) { - super(128, outputLen, lengthFlag, 16, 8, B64C, opts); - this.v0l = IV[0] | 0; - this.v0h = IV[1] | 0; - this.v1l = IV[2] | 0; - this.v1h = IV[3] | 0; - this.v2l = IV[4] | 0; - this.v2h = IV[5] | 0; - this.v3l = IV[6] | 0; - this.v3h = IV[7] | 0; - this.v4l = IV[8] | 0; - this.v4h = IV[9] | 0; - this.v5l = IV[10] | 0; - this.v5h = IV[11] | 0; - this.v6l = IV[12] | 0; - this.v6h = IV[13] | 0; - this.v7l = IV[14] | 0; - this.v7h = IV[15] | 0; - } - // prettier-ignore - protected get(): [ - number, number, number, number, number, number, number, number, - number, number, number, number, number, number, number, number - ] { - let { v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h } = this; - return [v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h]; - } - // prettier-ignore - protected set( - v0l: number, v0h: number, v1l: number, v1h: number, - v2l: number, v2h: number, v3l: number, v3h: number, - v4l: number, v4h: number, v5l: number, v5h: number, - v6l: number, v6h: number, v7l: number, v7h: number - ): void { - this.v0l = v0l | 0; - this.v0h = v0h | 0; - this.v1l = v1l | 0; - this.v1h = v1h | 0; - this.v2l = v2l | 0; - this.v2h = v2h | 0; - this.v3l = v3l | 0; - this.v3h = v3h | 0; - this.v4l = v4l | 0; - this.v4h = v4h | 0; - this.v5l = v5l | 0; - this.v5h = v5h | 0; - this.v6l = v6l | 0; - this.v6h = v6h | 0; - this.v7l = v7l | 0; - this.v7h = v7h | 0; - } - destroy(): void { - super.destroy(); - this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - } - compress(view: DataView, offset: number, withLength = true): void { - for (let i = 0; i < 32; i++, offset += 4) BLAKE512_W[i] = view.getUint32(offset, false); - - this.get().forEach((v, i) => (BBUF[i] = v)); // First half from state. - BBUF.set(this.constants.subarray(0, 16), 16); - if (withLength) { - const { h, l } = u64.fromBig(BigInt(this.length * 8)); - BBUF[24] = (BBUF[24] ^ h) >>> 0; - BBUF[25] = (BBUF[25] ^ l) >>> 0; - BBUF[26] = (BBUF[26] ^ h) >>> 0; - BBUF[27] = (BBUF[27] ^ l) >>> 0; - } - for (let i = 0, k = 0; i < 16; i++) { - G1b(0, 4, 8, 12, BLAKE512_W, k++); - G2b(0, 4, 8, 12, BLAKE512_W, k++); - G1b(1, 5, 9, 13, BLAKE512_W, k++); - G2b(1, 5, 9, 13, BLAKE512_W, k++); - G1b(2, 6, 10, 14, BLAKE512_W, k++); - G2b(2, 6, 10, 14, BLAKE512_W, k++); - G1b(3, 7, 11, 15, BLAKE512_W, k++); - G2b(3, 7, 11, 15, BLAKE512_W, k++); - - G1b(0, 5, 10, 15, BLAKE512_W, k++); - G2b(0, 5, 10, 15, BLAKE512_W, k++); - G1b(1, 6, 11, 12, BLAKE512_W, k++); - G2b(1, 6, 11, 12, BLAKE512_W, k++); - G1b(2, 7, 8, 13, BLAKE512_W, k++); - G2b(2, 7, 8, 13, BLAKE512_W, k++); - G1b(3, 4, 9, 14, BLAKE512_W, k++); - G2b(3, 4, 9, 14, BLAKE512_W, k++); - } - this.v0l ^= BBUF[0] ^ BBUF[16] ^ this.salt[0]; - this.v0h ^= BBUF[1] ^ BBUF[17] ^ this.salt[1]; - this.v1l ^= BBUF[2] ^ BBUF[18] ^ this.salt[2]; - this.v1h ^= BBUF[3] ^ BBUF[19] ^ this.salt[3]; - this.v2l ^= BBUF[4] ^ BBUF[20] ^ this.salt[4]; - this.v2h ^= BBUF[5] ^ BBUF[21] ^ this.salt[5]; - this.v3l ^= BBUF[6] ^ BBUF[22] ^ this.salt[6]; - this.v3h ^= BBUF[7] ^ BBUF[23] ^ this.salt[7]; - this.v4l ^= BBUF[8] ^ BBUF[24] ^ this.salt[0]; - this.v4h ^= BBUF[9] ^ BBUF[25] ^ this.salt[1]; - this.v5l ^= BBUF[10] ^ BBUF[26] ^ this.salt[2]; - this.v5h ^= BBUF[11] ^ BBUF[27] ^ this.salt[3]; - this.v6l ^= BBUF[12] ^ BBUF[28] ^ this.salt[4]; - this.v6h ^= BBUF[13] ^ BBUF[29] ^ this.salt[5]; - this.v7l ^= BBUF[14] ^ BBUF[30] ^ this.salt[6]; - this.v7h ^= BBUF[15] ^ BBUF[31] ^ this.salt[7]; - clean(BBUF, BLAKE512_W); - } -} - -/** Internal blake1-224 hash class. */ -export class _BLAKE224 extends BLAKE1_32B { - constructor(opts: BlakeOpts = {}) { - super(28, B224_IV, 0b0000_0000, opts); - } -} -/** Internal blake1-256 hash class. */ -export class _BLAKE256 extends BLAKE1_32B { - constructor(opts: BlakeOpts = {}) { - super(32, B256_IV, 0b0000_0001, opts); - } -} -/** Internal blake1-384 hash class. */ -export class _BLAKE384 extends BLAKE1_64B { - constructor(opts: BlakeOpts = {}) { - super(48, B384_IV, 0b0000_0000, opts); - } -} -/** Internal blake1-512 hash class. */ -export class _BLAKE512 extends BLAKE1_64B { - constructor(opts: BlakeOpts = {}) { - super(64, B512_IV, 0b0000_0001, opts); - } -} -/** blake1-224 hash function */ -export const blake224: CHash<_BLAKE224, BlakeOpts> = /* @__PURE__ */ createHasher( - (opts) => new _BLAKE224(opts) -); -/** blake1-256 hash function */ -export const blake256: CHash<_BLAKE256, BlakeOpts> = /* @__PURE__ */ createHasher( - (opts) => new _BLAKE256(opts) -); -/** blake1-384 hash function */ -export const blake384: CHash<_BLAKE384, BlakeOpts> = /* @__PURE__ */ createHasher( - (opts) => new _BLAKE384(opts) -); -/** blake1-512 hash function */ -export const blake512: CHash<_BLAKE512, BlakeOpts> = /* @__PURE__ */ createHasher( - (opts) => new _BLAKE512(opts) -); diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/blake2.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/blake2.ts deleted file mode 100644 index acdb18ae..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/blake2.ts +++ /dev/null @@ -1,489 +0,0 @@ -/** - * blake2b (64-bit) & blake2s (8 to 32-bit) hash functions. - * b could have been faster, but there is no fast u64 in js, so s is 1.5x faster. - * @module - */ -import { BSIGMA, G1s, G2s } from './_blake.ts'; -import { SHA256_IV } from './_md.ts'; -import * as u64 from './_u64.ts'; -// prettier-ignore -import { - abytes, aexists, anumber, aoutput, - clean, createHasher, - swap32IfBE, swap8IfBE, - u32, - type CHash, - type Hash -} from './utils.ts'; - -/** Blake hash options. dkLen is output length. key is used in MAC mode. salt is used in KDF mode. */ -export type Blake2Opts = { - dkLen?: number; - key?: Uint8Array; - salt?: Uint8Array; - personalization?: Uint8Array; -}; - -// Same as SHA512_IV, but swapped endianness: LE instead of BE. iv[1] is iv[0], etc. -const B2B_IV = /* @__PURE__ */ Uint32Array.from([ - 0xf3bcc908, 0x6a09e667, 0x84caa73b, 0xbb67ae85, 0xfe94f82b, 0x3c6ef372, 0x5f1d36f1, 0xa54ff53a, - 0xade682d1, 0x510e527f, 0x2b3e6c1f, 0x9b05688c, 0xfb41bd6b, 0x1f83d9ab, 0x137e2179, 0x5be0cd19, -]); -// Temporary buffer -const BBUF = /* @__PURE__ */ new Uint32Array(32); - -// Mixing function G splitted in two halfs -function G1b(a: number, b: number, c: number, d: number, msg: Uint32Array, x: number) { - // NOTE: V is LE here - const Xl = msg[x], Xh = msg[x + 1]; // prettier-ignore - let Al = BBUF[2 * a], Ah = BBUF[2 * a + 1]; // prettier-ignore - let Bl = BBUF[2 * b], Bh = BBUF[2 * b + 1]; // prettier-ignore - let Cl = BBUF[2 * c], Ch = BBUF[2 * c + 1]; // prettier-ignore - let Dl = BBUF[2 * d], Dh = BBUF[2 * d + 1]; // prettier-ignore - // v[a] = (v[a] + v[b] + x) | 0; - let ll = u64.add3L(Al, Bl, Xl); - Ah = u64.add3H(ll, Ah, Bh, Xh); - Al = ll | 0; - // v[d] = rotr(v[d] ^ v[a], 32) - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: u64.rotr32H(Dh, Dl), Dl: u64.rotr32L(Dh, Dl) }); - // v[c] = (v[c] + v[d]) | 0; - ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); - // v[b] = rotr(v[b] ^ v[c], 24) - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: u64.rotrSH(Bh, Bl, 24), Bl: u64.rotrSL(Bh, Bl, 24) }); - ((BBUF[2 * a] = Al), (BBUF[2 * a + 1] = Ah)); - ((BBUF[2 * b] = Bl), (BBUF[2 * b + 1] = Bh)); - ((BBUF[2 * c] = Cl), (BBUF[2 * c + 1] = Ch)); - ((BBUF[2 * d] = Dl), (BBUF[2 * d + 1] = Dh)); -} - -function G2b(a: number, b: number, c: number, d: number, msg: Uint32Array, x: number) { - // NOTE: V is LE here - const Xl = msg[x], Xh = msg[x + 1]; // prettier-ignore - let Al = BBUF[2 * a], Ah = BBUF[2 * a + 1]; // prettier-ignore - let Bl = BBUF[2 * b], Bh = BBUF[2 * b + 1]; // prettier-ignore - let Cl = BBUF[2 * c], Ch = BBUF[2 * c + 1]; // prettier-ignore - let Dl = BBUF[2 * d], Dh = BBUF[2 * d + 1]; // prettier-ignore - // v[a] = (v[a] + v[b] + x) | 0; - let ll = u64.add3L(Al, Bl, Xl); - Ah = u64.add3H(ll, Ah, Bh, Xh); - Al = ll | 0; - // v[d] = rotr(v[d] ^ v[a], 16) - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: u64.rotrSH(Dh, Dl, 16), Dl: u64.rotrSL(Dh, Dl, 16) }); - // v[c] = (v[c] + v[d]) | 0; - ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); - // v[b] = rotr(v[b] ^ v[c], 63) - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: u64.rotrBH(Bh, Bl, 63), Bl: u64.rotrBL(Bh, Bl, 63) }); - ((BBUF[2 * a] = Al), (BBUF[2 * a + 1] = Ah)); - ((BBUF[2 * b] = Bl), (BBUF[2 * b + 1] = Bh)); - ((BBUF[2 * c] = Cl), (BBUF[2 * c + 1] = Ch)); - ((BBUF[2 * d] = Dl), (BBUF[2 * d + 1] = Dh)); -} - -function checkBlake2Opts( - outputLen: number, - opts: Blake2Opts | undefined = {}, - keyLen: number, - saltLen: number, - persLen: number -) { - anumber(keyLen); - if (outputLen < 0 || outputLen > keyLen) throw new Error('outputLen bigger than keyLen'); - const { key, salt, personalization } = opts; - if (key !== undefined && (key.length < 1 || key.length > keyLen)) - throw new Error('"key" expected to be undefined or of length=1..' + keyLen); - if (salt !== undefined) abytes(salt, saltLen, 'salt'); - if (personalization !== undefined) abytes(personalization, persLen, 'personalization'); -} - -/** Internal base class for BLAKE2. */ -export abstract class _BLAKE2> implements Hash { - protected abstract compress(msg: Uint32Array, offset: number, isLast: boolean): void; - protected abstract get(): number[]; - protected abstract set(...args: number[]): void; - abstract destroy(): void; - protected buffer: Uint8Array; - protected buffer32: Uint32Array; - protected finished = false; - protected destroyed = false; - protected length: number = 0; - protected pos: number = 0; - readonly blockLen: number; - readonly outputLen: number; - - constructor(blockLen: number, outputLen: number) { - anumber(blockLen); - anumber(outputLen); - this.blockLen = blockLen; - this.outputLen = outputLen; - this.buffer = new Uint8Array(blockLen); - this.buffer32 = u32(this.buffer); - } - update(data: Uint8Array): this { - aexists(this); - abytes(data); - // Main difference with other hashes: there is flag for last block, - // so we cannot process current block before we know that there - // is the next one. This significantly complicates logic and reduces ability - // to do zero-copy processing - const { blockLen, buffer, buffer32 } = this; - const len = data.length; - const offset = data.byteOffset; - const buf = data.buffer; - for (let pos = 0; pos < len; ) { - // If buffer is full and we still have input (don't process last block, same as blake2s) - if (this.pos === blockLen) { - swap32IfBE(buffer32); - this.compress(buffer32, 0, false); - swap32IfBE(buffer32); - this.pos = 0; - } - const take = Math.min(blockLen - this.pos, len - pos); - const dataOffset = offset + pos; - // full block && aligned to 4 bytes && not last in input - if (take === blockLen && !(dataOffset % 4) && pos + take < len) { - const data32 = new Uint32Array(buf, dataOffset, Math.floor((len - pos) / 4)); - swap32IfBE(data32); - for (let pos32 = 0; pos + blockLen < len; pos32 += buffer32.length, pos += blockLen) { - this.length += blockLen; - this.compress(data32, pos32, false); - } - swap32IfBE(data32); - continue; - } - buffer.set(data.subarray(pos, pos + take), this.pos); - this.pos += take; - this.length += take; - pos += take; - } - return this; - } - digestInto(out: Uint8Array): void { - aexists(this); - aoutput(out, this); - const { pos, buffer32 } = this; - this.finished = true; - // Padding - clean(this.buffer.subarray(pos)); - swap32IfBE(buffer32); - this.compress(buffer32, 0, true); - swap32IfBE(buffer32); - const out32 = u32(out); - this.get().forEach((v, i) => (out32[i] = swap8IfBE(v))); - } - digest(): Uint8Array { - const { buffer, outputLen } = this; - this.digestInto(buffer); - const res = buffer.slice(0, outputLen); - this.destroy(); - return res; - } - _cloneInto(to?: T): T { - const { buffer, length, finished, destroyed, outputLen, pos } = this; - to ||= new (this.constructor as any)({ dkLen: outputLen }) as T; - to.set(...this.get()); - to.buffer.set(buffer); - to.destroyed = destroyed; - to.finished = finished; - to.length = length; - to.pos = pos; - // @ts-ignore - to.outputLen = outputLen; - return to; - } - clone(): T { - return this._cloneInto(); - } -} - -/** Internal blake2b hash class. */ -export class _BLAKE2b extends _BLAKE2<_BLAKE2b> { - // Same as SHA-512, but LE - private v0l = B2B_IV[0] | 0; - private v0h = B2B_IV[1] | 0; - private v1l = B2B_IV[2] | 0; - private v1h = B2B_IV[3] | 0; - private v2l = B2B_IV[4] | 0; - private v2h = B2B_IV[5] | 0; - private v3l = B2B_IV[6] | 0; - private v3h = B2B_IV[7] | 0; - private v4l = B2B_IV[8] | 0; - private v4h = B2B_IV[9] | 0; - private v5l = B2B_IV[10] | 0; - private v5h = B2B_IV[11] | 0; - private v6l = B2B_IV[12] | 0; - private v6h = B2B_IV[13] | 0; - private v7l = B2B_IV[14] | 0; - private v7h = B2B_IV[15] | 0; - - constructor(opts: Blake2Opts = {}) { - const olen = opts.dkLen === undefined ? 64 : opts.dkLen; - super(128, olen); - checkBlake2Opts(olen, opts, 64, 16, 16); - let { key, personalization, salt } = opts; - let keyLength = 0; - if (key !== undefined) { - abytes(key, undefined, 'key'); - keyLength = key.length; - } - this.v0l ^= this.outputLen | (keyLength << 8) | (0x01 << 16) | (0x01 << 24); - if (salt !== undefined) { - abytes(salt, undefined, 'salt'); - const slt = u32(salt); - this.v4l ^= swap8IfBE(slt[0]); - this.v4h ^= swap8IfBE(slt[1]); - this.v5l ^= swap8IfBE(slt[2]); - this.v5h ^= swap8IfBE(slt[3]); - } - if (personalization !== undefined) { - abytes(personalization, undefined, 'personalization'); - const pers = u32(personalization); - this.v6l ^= swap8IfBE(pers[0]); - this.v6h ^= swap8IfBE(pers[1]); - this.v7l ^= swap8IfBE(pers[2]); - this.v7h ^= swap8IfBE(pers[3]); - } - if (key !== undefined) { - // Pad to blockLen and update - const tmp = new Uint8Array(this.blockLen); - tmp.set(key); - this.update(tmp); - } - } - // prettier-ignore - protected get(): [ - number, number, number, number, number, number, number, number, - number, number, number, number, number, number, number, number - ] { - let { v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h } = this; - return [v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h]; - } - // prettier-ignore - protected set( - v0l: number, v0h: number, v1l: number, v1h: number, - v2l: number, v2h: number, v3l: number, v3h: number, - v4l: number, v4h: number, v5l: number, v5h: number, - v6l: number, v6h: number, v7l: number, v7h: number - ): void { - this.v0l = v0l | 0; - this.v0h = v0h | 0; - this.v1l = v1l | 0; - this.v1h = v1h | 0; - this.v2l = v2l | 0; - this.v2h = v2h | 0; - this.v3l = v3l | 0; - this.v3h = v3h | 0; - this.v4l = v4l | 0; - this.v4h = v4h | 0; - this.v5l = v5l | 0; - this.v5h = v5h | 0; - this.v6l = v6l | 0; - this.v6h = v6h | 0; - this.v7l = v7l | 0; - this.v7h = v7h | 0; - } - protected compress(msg: Uint32Array, offset: number, isLast: boolean): void { - this.get().forEach((v, i) => (BBUF[i] = v)); // First half from state. - BBUF.set(B2B_IV, 16); // Second half from IV. - let { h, l } = u64.fromBig(BigInt(this.length)); - BBUF[24] = B2B_IV[8] ^ l; // Low word of the offset. - BBUF[25] = B2B_IV[9] ^ h; // High word. - // Invert all bits for last block - if (isLast) { - BBUF[28] = ~BBUF[28]; - BBUF[29] = ~BBUF[29]; - } - let j = 0; - const s = BSIGMA; - for (let i = 0; i < 12; i++) { - G1b(0, 4, 8, 12, msg, offset + 2 * s[j++]); - G2b(0, 4, 8, 12, msg, offset + 2 * s[j++]); - G1b(1, 5, 9, 13, msg, offset + 2 * s[j++]); - G2b(1, 5, 9, 13, msg, offset + 2 * s[j++]); - G1b(2, 6, 10, 14, msg, offset + 2 * s[j++]); - G2b(2, 6, 10, 14, msg, offset + 2 * s[j++]); - G1b(3, 7, 11, 15, msg, offset + 2 * s[j++]); - G2b(3, 7, 11, 15, msg, offset + 2 * s[j++]); - - G1b(0, 5, 10, 15, msg, offset + 2 * s[j++]); - G2b(0, 5, 10, 15, msg, offset + 2 * s[j++]); - G1b(1, 6, 11, 12, msg, offset + 2 * s[j++]); - G2b(1, 6, 11, 12, msg, offset + 2 * s[j++]); - G1b(2, 7, 8, 13, msg, offset + 2 * s[j++]); - G2b(2, 7, 8, 13, msg, offset + 2 * s[j++]); - G1b(3, 4, 9, 14, msg, offset + 2 * s[j++]); - G2b(3, 4, 9, 14, msg, offset + 2 * s[j++]); - } - this.v0l ^= BBUF[0] ^ BBUF[16]; - this.v0h ^= BBUF[1] ^ BBUF[17]; - this.v1l ^= BBUF[2] ^ BBUF[18]; - this.v1h ^= BBUF[3] ^ BBUF[19]; - this.v2l ^= BBUF[4] ^ BBUF[20]; - this.v2h ^= BBUF[5] ^ BBUF[21]; - this.v3l ^= BBUF[6] ^ BBUF[22]; - this.v3h ^= BBUF[7] ^ BBUF[23]; - this.v4l ^= BBUF[8] ^ BBUF[24]; - this.v4h ^= BBUF[9] ^ BBUF[25]; - this.v5l ^= BBUF[10] ^ BBUF[26]; - this.v5h ^= BBUF[11] ^ BBUF[27]; - this.v6l ^= BBUF[12] ^ BBUF[28]; - this.v6h ^= BBUF[13] ^ BBUF[29]; - this.v7l ^= BBUF[14] ^ BBUF[30]; - this.v7h ^= BBUF[15] ^ BBUF[31]; - clean(BBUF); - } - destroy(): void { - this.destroyed = true; - clean(this.buffer32); - this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - } -} - -/** - * Blake2b hash function. 64-bit. 1.5x slower than blake2s in JS. - * @param msg - message that would be hashed - * @param opts - dkLen output length, key for MAC mode, salt, personalization - */ -export const blake2b: CHash<_BLAKE2b, Blake2Opts> = /* @__PURE__ */ createHasher( - (opts) => new _BLAKE2b(opts) -); - -// ================= -// Blake2S -// ================= - -/** Internal type, 16 numbers. */ -// prettier-ignore -export type Num16 = { - v0: number; v1: number; v2: number; v3: number; - v4: number; v5: number; v6: number; v7: number; - v8: number; v9: number; v10: number; v11: number; - v12: number; v13: number; v14: number; v15: number; -}; - -/** BLAKE2-compress core method. */ -// prettier-ignore -export function compress(s: Uint8Array, offset: number, msg: Uint32Array, rounds: number, - v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, - v8: number, v9: number, v10: number, v11: number, v12: number, v13: number, v14: number, v15: number, -): Num16 { - let j = 0; - for (let i = 0; i < rounds; i++) { - ({ a: v0, b: v4, c: v8, d: v12 } = G1s(v0, v4, v8, v12, msg[offset + s[j++]])); - ({ a: v0, b: v4, c: v8, d: v12 } = G2s(v0, v4, v8, v12, msg[offset + s[j++]])); - ({ a: v1, b: v5, c: v9, d: v13 } = G1s(v1, v5, v9, v13, msg[offset + s[j++]])); - ({ a: v1, b: v5, c: v9, d: v13 } = G2s(v1, v5, v9, v13, msg[offset + s[j++]])); - ({ a: v2, b: v6, c: v10, d: v14 } = G1s(v2, v6, v10, v14, msg[offset + s[j++]])); - ({ a: v2, b: v6, c: v10, d: v14 } = G2s(v2, v6, v10, v14, msg[offset + s[j++]])); - ({ a: v3, b: v7, c: v11, d: v15 } = G1s(v3, v7, v11, v15, msg[offset + s[j++]])); - ({ a: v3, b: v7, c: v11, d: v15 } = G2s(v3, v7, v11, v15, msg[offset + s[j++]])); - - ({ a: v0, b: v5, c: v10, d: v15 } = G1s(v0, v5, v10, v15, msg[offset + s[j++]])); - ({ a: v0, b: v5, c: v10, d: v15 } = G2s(v0, v5, v10, v15, msg[offset + s[j++]])); - ({ a: v1, b: v6, c: v11, d: v12 } = G1s(v1, v6, v11, v12, msg[offset + s[j++]])); - ({ a: v1, b: v6, c: v11, d: v12 } = G2s(v1, v6, v11, v12, msg[offset + s[j++]])); - ({ a: v2, b: v7, c: v8, d: v13 } = G1s(v2, v7, v8, v13, msg[offset + s[j++]])); - ({ a: v2, b: v7, c: v8, d: v13 } = G2s(v2, v7, v8, v13, msg[offset + s[j++]])); - ({ a: v3, b: v4, c: v9, d: v14 } = G1s(v3, v4, v9, v14, msg[offset + s[j++]])); - ({ a: v3, b: v4, c: v9, d: v14 } = G2s(v3, v4, v9, v14, msg[offset + s[j++]])); - } - return { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 }; -} - -const B2S_IV = /* @__PURE__ */ SHA256_IV.slice(); - -/** Internal blake2s hash class. */ -export class _BLAKE2s extends _BLAKE2<_BLAKE2s> { - // Internal state, same as SHA-256 - private v0 = B2S_IV[0] | 0; - private v1 = B2S_IV[1] | 0; - private v2 = B2S_IV[2] | 0; - private v3 = B2S_IV[3] | 0; - private v4 = B2S_IV[4] | 0; - private v5 = B2S_IV[5] | 0; - private v6 = B2S_IV[6] | 0; - private v7 = B2S_IV[7] | 0; - - constructor(opts: Blake2Opts = {}) { - const olen = opts.dkLen === undefined ? 32 : opts.dkLen; - super(64, olen); - checkBlake2Opts(olen, opts, 32, 8, 8); - let { key, personalization, salt } = opts; - let keyLength = 0; - if (key !== undefined) { - abytes(key, undefined, 'key'); - keyLength = key.length; - } - this.v0 ^= this.outputLen | (keyLength << 8) | (0x01 << 16) | (0x01 << 24); - if (salt !== undefined) { - abytes(salt, undefined, 'salt'); - const slt = u32(salt as Uint8Array); - this.v4 ^= swap8IfBE(slt[0]); - this.v5 ^= swap8IfBE(slt[1]); - } - if (personalization !== undefined) { - abytes(personalization, undefined, 'personalization'); - const pers = u32(personalization as Uint8Array); - this.v6 ^= swap8IfBE(pers[0]); - this.v7 ^= swap8IfBE(pers[1]); - } - if (key !== undefined) { - // Pad to blockLen and update - const tmp = new Uint8Array(this.blockLen); - tmp.set(key); - this.update(tmp); - } - } - protected get(): [number, number, number, number, number, number, number, number] { - const { v0, v1, v2, v3, v4, v5, v6, v7 } = this; - return [v0, v1, v2, v3, v4, v5, v6, v7]; - } - // prettier-ignore - protected set( - v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number - ): void { - this.v0 = v0 | 0; - this.v1 = v1 | 0; - this.v2 = v2 | 0; - this.v3 = v3 | 0; - this.v4 = v4 | 0; - this.v5 = v5 | 0; - this.v6 = v6 | 0; - this.v7 = v7 | 0; - } - protected compress(msg: Uint32Array, offset: number, isLast: boolean): void { - const { h, l } = u64.fromBig(BigInt(this.length)); - // prettier-ignore - const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = - compress( - BSIGMA, offset, msg, 10, - this.v0, this.v1, this.v2, this.v3, this.v4, this.v5, this.v6, this.v7, - B2S_IV[0], B2S_IV[1], B2S_IV[2], B2S_IV[3], l ^ B2S_IV[4], h ^ B2S_IV[5], isLast ? ~B2S_IV[6] : B2S_IV[6], B2S_IV[7] - ); - this.v0 ^= v0 ^ v8; - this.v1 ^= v1 ^ v9; - this.v2 ^= v2 ^ v10; - this.v3 ^= v3 ^ v11; - this.v4 ^= v4 ^ v12; - this.v5 ^= v5 ^ v13; - this.v6 ^= v6 ^ v14; - this.v7 ^= v7 ^ v15; - } - destroy(): void { - this.destroyed = true; - clean(this.buffer32); - this.set(0, 0, 0, 0, 0, 0, 0, 0); - } -} - -/** - * Blake2s hash function. Focuses on 8-bit to 32-bit platforms. 1.5x faster than blake2b in JS. - * @param msg - message that would be hashed - * @param opts - dkLen output length, key for MAC mode, salt, personalization - */ -export const blake2s: CHash<_BLAKE2s, Blake2Opts> = /* @__PURE__ */ createHasher( - (opts) => new _BLAKE2s(opts) -); diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/blake3.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/blake3.ts deleted file mode 100644 index 1286f49e..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/blake3.ts +++ /dev/null @@ -1,275 +0,0 @@ -/** - * Blake3 fast hash is Blake2 with reduced security (round count). Can also be used as MAC & KDF. - * - * It is advertised as "the fastest cryptographic hash". However, it isn't true in JS. - * Why is this so slow? While it must be 6x faster than blake2b, perf diff is only 20%: - * - * * There is only 30% reduction in number of rounds from blake2s - * * Speed-up comes from tree structure, which is parallelized using SIMD & threading. - * These features are not present in JS, so we only get overhead from trees. - * * Parallelization only happens on 1024-byte chunks: there is no benefit for small inputs. - * * It is still possible to make it faster using: a) loop unrolling b) web workers c) wasm - * @module - */ -import { SHA256_IV } from './_md.ts'; -import { fromBig } from './_u64.ts'; -import { _BLAKE2, compress } from './blake2.ts'; -// prettier-ignore -import { - abytes, aexists, anumber, aoutput, - clean, createHasher, swap32IfBE, - u32, u8, - type CHashXOF, - type HashXOF -} from './utils.ts'; - -// Flag bitset -const B3_Flags = { - CHUNK_START: 0b1, - CHUNK_END: 0b10, - PARENT: 0b100, - ROOT: 0b1000, - KEYED_HASH: 0b10000, - DERIVE_KEY_CONTEXT: 0b100000, - DERIVE_KEY_MATERIAL: 0b1000000, -} as const; - -const B3_IV = /* @__PURE__ */ SHA256_IV.slice(); - -const B3_SIGMA: Uint8Array = /* @__PURE__ */ (() => { - const Id = Array.from({ length: 16 }, (_, i) => i); - const permute = (arr: number[]) => - [2, 6, 3, 10, 7, 0, 4, 13, 1, 11, 12, 5, 9, 14, 15, 8].map((i) => arr[i]); - const res: number[] = []; - for (let i = 0, v = Id; i < 7; i++, v = permute(v)) res.push(...v); - return Uint8Array.from(res); -})(); - -/** - * Ensure to use EITHER `key` OR `context`, not both. - * - * * `key`: 32-byte MAC key. - * * `context`: string for KDF. must be hardcoded, globally unique, and application - specific. - * A good default format for the context string is "[application] [commit timestamp] [purpose]". - */ -export type Blake3Opts = { dkLen?: number; key?: Uint8Array; context?: Uint8Array }; - -/** Blake3 hash. Can be used as MAC and KDF. */ -export class _BLAKE3 extends _BLAKE2<_BLAKE3> implements HashXOF<_BLAKE3> { - private chunkPos = 0; // Position of current block in chunk - private chunksDone = 0; // How many chunks we already have - private flags = 0 | 0; - private IV: Uint32Array; - private state: Uint32Array; - private stack: Uint32Array[] = []; - // Output - private posOut = 0; - private bufferOut32 = new Uint32Array(16); - private bufferOut: Uint8Array; - private chunkOut = 0; // index of output chunk - private enableXOF = true; - - constructor(opts: Blake3Opts = {}, flags = 0) { - super(64, opts.dkLen === undefined ? 32 : opts.dkLen); - const { key, context } = opts; - const hasContext = context !== undefined; - if (key !== undefined) { - if (hasContext) throw new Error('Only "key" or "context" can be specified at same time'); - abytes(key, 32, 'key'); - const k = key.slice(); - this.IV = u32(k); - swap32IfBE(this.IV); - this.flags = flags | B3_Flags.KEYED_HASH; - } else if (hasContext) { - abytes(context, undefined, 'context'); - const ctx = context; - const contextKey = new _BLAKE3({ dkLen: 32 }, B3_Flags.DERIVE_KEY_CONTEXT) - .update(ctx) - .digest(); - this.IV = u32(contextKey); - swap32IfBE(this.IV); - this.flags = flags | B3_Flags.DERIVE_KEY_MATERIAL; - } else { - this.IV = B3_IV.slice(); - this.flags = flags; - } - this.state = this.IV.slice(); - this.bufferOut = u8(this.bufferOut32); - } - // Unused - protected get(): [] { - return []; - } - protected set(): void {} - private b2Compress(counter: number, flags: number, buf: Uint32Array, bufPos: number = 0) { - const { state: s, pos } = this; - const { h, l } = fromBig(BigInt(counter), true); - // prettier-ignore - const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = - compress( - B3_SIGMA, bufPos, buf, 7, - s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], - B3_IV[0], B3_IV[1], B3_IV[2], B3_IV[3], h, l, pos, flags - ); - s[0] = v0 ^ v8; - s[1] = v1 ^ v9; - s[2] = v2 ^ v10; - s[3] = v3 ^ v11; - s[4] = v4 ^ v12; - s[5] = v5 ^ v13; - s[6] = v6 ^ v14; - s[7] = v7 ^ v15; - } - protected compress(buf: Uint32Array, bufPos: number = 0, isLast: boolean = false): void { - // Compress last block - let flags = this.flags; - if (!this.chunkPos) flags |= B3_Flags.CHUNK_START; - if (this.chunkPos === 15 || isLast) flags |= B3_Flags.CHUNK_END; - if (!isLast) this.pos = this.blockLen; - this.b2Compress(this.chunksDone, flags, buf, bufPos); - this.chunkPos += 1; - // If current block is last in chunk (16 blocks), then compress chunks - if (this.chunkPos === 16 || isLast) { - let chunk = this.state; - this.state = this.IV.slice(); - // If not the last one, compress only when there are trailing zeros in chunk counter - // chunks used as binary tree where current stack is path. Zero means current leaf is finished and can be compressed. - // 1 (001) - leaf not finished (just push current chunk to stack) - // 2 (010) - leaf finished at depth=1 (merge with last elm on stack and push back) - // 3 (011) - last leaf not finished - // 4 (100) - leafs finished at depth=1 and depth=2 - for (let last, chunks = this.chunksDone + 1; isLast || !(chunks & 1); chunks >>= 1) { - if (!(last = this.stack.pop())) break; - this.buffer32.set(last, 0); - this.buffer32.set(chunk, 8); - this.pos = this.blockLen; - this.b2Compress(0, this.flags | B3_Flags.PARENT, this.buffer32, 0); - chunk = this.state; - this.state = this.IV.slice(); - } - this.chunksDone++; - this.chunkPos = 0; - this.stack.push(chunk); - } - this.pos = 0; - } - _cloneInto(to?: _BLAKE3): _BLAKE3 { - to = super._cloneInto(to) as _BLAKE3; - const { IV, flags, state, chunkPos, posOut, chunkOut, stack, chunksDone } = this; - to.state.set(state.slice()); - to.stack = stack.map((i) => Uint32Array.from(i)); - to.IV.set(IV); - to.flags = flags; - to.chunkPos = chunkPos; - to.chunksDone = chunksDone; - to.posOut = posOut; - to.chunkOut = chunkOut; - to.enableXOF = this.enableXOF; - to.bufferOut32.set(this.bufferOut32); - return to; - } - destroy(): void { - this.destroyed = true; - clean(this.state, this.buffer32, this.IV, this.bufferOut32); - clean(...this.stack); - } - // Same as b2Compress, but doesn't modify state and returns 16 u32 array (instead of 8) - private b2CompressOut() { - const { state: s, pos, flags, buffer32, bufferOut32: out32 } = this; - const { h, l } = fromBig(BigInt(this.chunkOut++)); - swap32IfBE(buffer32); - // prettier-ignore - const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = - compress( - B3_SIGMA, 0, buffer32, 7, - s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], - B3_IV[0], B3_IV[1], B3_IV[2], B3_IV[3], l, h, pos, flags - ); - out32[0] = v0 ^ v8; - out32[1] = v1 ^ v9; - out32[2] = v2 ^ v10; - out32[3] = v3 ^ v11; - out32[4] = v4 ^ v12; - out32[5] = v5 ^ v13; - out32[6] = v6 ^ v14; - out32[7] = v7 ^ v15; - out32[8] = s[0] ^ v8; - out32[9] = s[1] ^ v9; - out32[10] = s[2] ^ v10; - out32[11] = s[3] ^ v11; - out32[12] = s[4] ^ v12; - out32[13] = s[5] ^ v13; - out32[14] = s[6] ^ v14; - out32[15] = s[7] ^ v15; - swap32IfBE(buffer32); - swap32IfBE(out32); - this.posOut = 0; - } - protected finish(): void { - if (this.finished) return; - this.finished = true; - // Padding - clean(this.buffer.subarray(this.pos)); - // Process last chunk - let flags = this.flags | B3_Flags.ROOT; - if (this.stack.length) { - flags |= B3_Flags.PARENT; - swap32IfBE(this.buffer32); - this.compress(this.buffer32, 0, true); - swap32IfBE(this.buffer32); - this.chunksDone = 0; - this.pos = this.blockLen; - } else { - flags |= (!this.chunkPos ? B3_Flags.CHUNK_START : 0) | B3_Flags.CHUNK_END; - } - this.flags = flags; - this.b2CompressOut(); - } - private writeInto(out: Uint8Array) { - aexists(this, false); - abytes(out); - this.finish(); - const { blockLen, bufferOut } = this; - for (let pos = 0, len = out.length; pos < len; ) { - if (this.posOut >= blockLen) this.b2CompressOut(); - const take = Math.min(blockLen - this.posOut, len - pos); - out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); - this.posOut += take; - pos += take; - } - return out; - } - xofInto(out: Uint8Array): Uint8Array { - if (!this.enableXOF) throw new Error('XOF is not possible after digest call'); - return this.writeInto(out); - } - xof(bytes: number): Uint8Array { - anumber(bytes); - return this.xofInto(new Uint8Array(bytes)); - } - digestInto(out: Uint8Array): Uint8Array { - aoutput(out, this); - if (this.finished) throw new Error('digest() was already called'); - this.enableXOF = false; - this.writeInto(out); - this.destroy(); - return out; - } - digest(): Uint8Array { - return this.digestInto(new Uint8Array(this.outputLen)); - } -} - -/** - * BLAKE3 hash function. Can be used as MAC and KDF. - * @param msg - message that would be hashed - * @param opts - `dkLen` for output length, `key` for MAC mode, `context` for KDF mode - * @example - * const data = new Uint8Array(32); - * const hash = blake3(data); - * const mac = blake3(data, { key: new Uint8Array(32) }); - * const kdf = blake3(data, { context: 'application name' }); - */ -export const blake3: CHashXOF<_BLAKE3, Blake3Opts> = /* @__PURE__ */ createHasher( - (opts = {}) => new _BLAKE3(opts) -); diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/eskdf.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/eskdf.ts deleted file mode 100644 index 6d2ad27e..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/eskdf.ts +++ /dev/null @@ -1,188 +0,0 @@ -/** - * Experimental KDF for AES. - * @module - */ -import { hkdf } from './hkdf.ts'; -import { pbkdf2 as _pbkdf2 } from './pbkdf2.ts'; -import { scrypt as _scrypt } from './scrypt.ts'; -import { sha256 } from './sha2.ts'; -import { abytes, bytesToHex, clean, createView, hexToBytes, kdfInputToBytes } from './utils.ts'; - -// A tiny KDF for various applications like AES key-gen. -// Uses HKDF in a non-standard way, so it's not "KDF-secure", only "PRF-secure". -// Which is good enough: assume sha2-256 retained preimage resistance. - -const SCRYPT_FACTOR = 2 ** 19; -const PBKDF2_FACTOR = 2 ** 17; - -/** Scrypt KDF */ -export function scrypt(password: string, salt: string): Uint8Array { - return _scrypt(password, salt, { N: SCRYPT_FACTOR, r: 8, p: 1, dkLen: 32 }); -} - -/** PBKDF2-HMAC-SHA256 */ -export function pbkdf2(password: string, salt: string): Uint8Array { - return _pbkdf2(sha256, password, salt, { c: PBKDF2_FACTOR, dkLen: 32 }); -} - -// Combines two 32-byte byte arrays -function xor32(a: Uint8Array, b: Uint8Array): Uint8Array { - abytes(a, 32); - abytes(b, 32); - const arr = new Uint8Array(32); - for (let i = 0; i < 32; i++) { - arr[i] = a[i] ^ b[i]; - } - return arr; -} - -function strHasLength(str: string, min: number, max: number): boolean { - return typeof str === 'string' && str.length >= min && str.length <= max; -} - -/** - * Derives main seed. Takes a lot of time. Prefer `eskdf` method instead. - */ -export function deriveMainSeed(username: string, password: string): Uint8Array { - if (!strHasLength(username, 8, 255)) throw new Error('invalid username'); - if (!strHasLength(password, 8, 255)) throw new Error('invalid password'); - // Declared like this to throw off minifiers which auto-convert .fromCharCode(1) to actual string. - // String with non-ascii may be problematic in some envs - const codes = { _1: 1, _2: 2 }; - const sep = { s: String.fromCharCode(codes._1), p: String.fromCharCode(codes._2) }; - const scr = scrypt(password + sep.s, username + sep.s); - const pbk = pbkdf2(password + sep.p, username + sep.p); - const res = xor32(scr, pbk); - clean(scr, pbk); - return res; -} - -type AccountID = number | string; - -/** - * Converts protocol & accountId pair to HKDF salt & info params. - */ -function getSaltInfo(protocol: string, accountId: AccountID = 0) { - // Note that length here also repeats two lines below - // We do an additional length check here to reduce the scope of DoS attacks - if (!(strHasLength(protocol, 3, 15) && /^[a-z0-9]{3,15}$/.test(protocol))) { - throw new Error('invalid protocol'); - } - - // Allow string account ids for some protocols - const allowsStr = /^password\d{0,3}|ssh|tor|file$/.test(protocol); - let salt: Uint8Array; // Extract salt. Default is undefined. - if (typeof accountId === 'string') { - if (!allowsStr) throw new Error('accountId must be a number'); - if (!strHasLength(accountId, 1, 255)) - throw new Error('accountId must be string of length 1..255'); - salt = kdfInputToBytes(accountId); - } else if (Number.isSafeInteger(accountId)) { - if (accountId < 0 || accountId > Math.pow(2, 32) - 1) throw new Error('invalid accountId'); - // Convert to Big Endian Uint32 - salt = new Uint8Array(4); - createView(salt).setUint32(0, accountId, false); - } else { - throw new Error('accountId must be a number' + (allowsStr ? ' or string' : '')); - } - const info = kdfInputToBytes(protocol); - return { salt, info }; -} - -type OptsLength = { keyLength: number }; -type OptsMod = { modulus: bigint }; -type KeyOpts = undefined | OptsLength | OptsMod; - -function countBytes(num: bigint): number { - if (typeof num !== 'bigint' || num <= BigInt(128)) throw new Error('invalid number'); - return Math.ceil(num.toString(2).length / 8); -} - -/** - * Parses keyLength and modulus options to extract length of result key. - * If modulus is used, adds 64 bits to it as per FIPS 186 B.4.1 to combat modulo bias. - */ -function getKeyLength(options: KeyOpts): number { - if (!options || typeof options !== 'object') return 32; - const hasLen = 'keyLength' in options; - const hasMod = 'modulus' in options; - if (hasLen && hasMod) throw new Error('cannot combine keyLength and modulus options'); - if (!hasLen && !hasMod) throw new Error('must have either keyLength or modulus option'); - // FIPS 186 B.4.1 requires at least 64 more bits - const l = hasMod ? countBytes(options.modulus) + 8 : options.keyLength; - if (!(typeof l === 'number' && l >= 16 && l <= 8192)) throw new Error('invalid keyLength'); - return l; -} - -/** - * Converts key to bigint and divides it by modulus. Big Endian. - * Implements FIPS 186 B.4.1, which removes 0 and modulo bias from output. - */ -function modReduceKey(key: Uint8Array, modulus: bigint): Uint8Array { - const _1 = BigInt(1); - const num = BigInt('0x' + bytesToHex(key)); // check for ui8a, then bytesToNumber() - const res = (num % (modulus - _1)) + _1; // Remove 0 from output - if (res < _1) throw new Error('expected positive number'); // Guard against bad values - const len = key.length - 8; // FIPS requires 64 more bits = 8 bytes - const hex = res.toString(16).padStart(len * 2, '0'); // numberToHex() - const bytes = hexToBytes(hex); - if (bytes.length !== len) throw new Error('invalid length of result key'); - return bytes; -} - -/** Not using classes because constructor cannot be async */ -export interface ESKDF { - /** - * Derives a child key. Child key will not be associated with any - * other child key because of properties of underlying KDF. - * - * @param protocol - 3-15 character protocol name - * @param accountId - numeric identifier of account - * @param options - `keyLength: 64` or `modulus: 41920438n` - * @example deriveChildKey('aes', 0) - */ - deriveChildKey: (protocol: string, accountId: AccountID, options?: KeyOpts) => Uint8Array; - /** - * Deletes the main seed from eskdf instance - */ - expire: () => void; - /** - * Account fingerprint - */ - fingerprint: string; -} - -/** - * ESKDF - * @param username - username, email, or identifier, min: 8 characters, should have enough entropy - * @param password - password, min: 8 characters, should have enough entropy - * @example - * const kdf = await eskdf('example-university', 'beginning-new-example'); - * const key = kdf.deriveChildKey('aes', 0); - * console.log(kdf.fingerprint); - * kdf.expire(); - */ -export async function eskdf(username: string, password: string): Promise { - // We are using closure + object instead of class because - // we want to make `seed` non-accessible for any external function. - let seed: Uint8Array | undefined = deriveMainSeed(username, password); - - function deriveCK(protocol: string, accountId: AccountID = 0, options?: KeyOpts): Uint8Array { - abytes(seed!, 32); - const { salt, info } = getSaltInfo(protocol, accountId); // validate protocol & accountId - const keyLength = getKeyLength(options); // validate options - const key = hkdf(sha256, seed!, salt, info, keyLength); - // Modulus has already been validated - return options && 'modulus' in options ? modReduceKey(key, options.modulus) : key; - } - function expire() { - if (seed) seed.fill(1); - seed = undefined; - } - // prettier-ignore - const fingerprint = Array.from(deriveCK('fingerprint', 0)) - .slice(0, 6) - .map((char) => char.toString(16).padStart(2, '0').toUpperCase()) - .join(':'); - return Object.freeze({ deriveChildKey: deriveCK, expire, fingerprint }); -} diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/hkdf.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/hkdf.ts deleted file mode 100644 index 5601d760..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/hkdf.ts +++ /dev/null @@ -1,94 +0,0 @@ -/** - * HKDF (RFC 5869): extract + expand in one step. - * See https://soatok.blog/2021/11/17/understanding-hkdf/. - * @module - */ -import { hmac } from './hmac.ts'; -import { abytes, ahash, anumber, type CHash, clean } from './utils.ts'; - -/** - * HKDF-extract from spec. Less important part. `HKDF-Extract(IKM, salt) -> PRK` - * Arguments position differs from spec (IKM is first one, since it is not optional) - * @param hash - hash function that would be used (e.g. sha256) - * @param ikm - input keying material, the initial key - * @param salt - optional salt value (a non-secret random value) - */ -export function extract(hash: CHash, ikm: Uint8Array, salt?: Uint8Array): Uint8Array { - ahash(hash); - // NOTE: some libraries treat zero-length array as 'not provided'; - // we don't, since we have undefined as 'not provided' - // https://github.com/RustCrypto/KDFs/issues/15 - if (salt === undefined) salt = new Uint8Array(hash.outputLen); - return hmac(hash, salt, ikm); -} - -const HKDF_COUNTER = /* @__PURE__ */ Uint8Array.of(0); -const EMPTY_BUFFER = /* @__PURE__ */ Uint8Array.of(); - -/** - * HKDF-expand from the spec. The most important part. `HKDF-Expand(PRK, info, L) -> OKM` - * @param hash - hash function that would be used (e.g. sha256) - * @param prk - a pseudorandom key of at least HashLen octets (usually, the output from the extract step) - * @param info - optional context and application specific information (can be a zero-length string) - * @param length - length of output keying material in bytes - */ -export function expand( - hash: CHash, - prk: Uint8Array, - info?: Uint8Array, - length: number = 32 -): Uint8Array { - ahash(hash); - anumber(length, 'length'); - const olen = hash.outputLen; - if (length > 255 * olen) throw new Error('Length must be <= 255*HashLen'); - const blocks = Math.ceil(length / olen); - if (info === undefined) info = EMPTY_BUFFER; - else abytes(info, undefined, 'info'); - // first L(ength) octets of T - const okm = new Uint8Array(blocks * olen); - // Re-use HMAC instance between blocks - const HMAC = hmac.create(hash, prk); - const HMACTmp = HMAC._cloneInto(); - const T = new Uint8Array(HMAC.outputLen); - for (let counter = 0; counter < blocks; counter++) { - HKDF_COUNTER[0] = counter + 1; - // T(0) = empty string (zero length) - // T(N) = HMAC-Hash(PRK, T(N-1) | info | N) - HMACTmp.update(counter === 0 ? EMPTY_BUFFER : T) - .update(info) - .update(HKDF_COUNTER) - .digestInto(T); - okm.set(T, olen * counter); - HMAC._cloneInto(HMACTmp); - } - HMAC.destroy(); - HMACTmp.destroy(); - clean(T, HKDF_COUNTER); - return okm.slice(0, length); -} - -/** - * HKDF (RFC 5869): derive keys from an initial input. - * Combines hkdf_extract + hkdf_expand in one step - * @param hash - hash function that would be used (e.g. sha256) - * @param ikm - input keying material, the initial key - * @param salt - optional salt value (a non-secret random value) - * @param info - optional context and application specific information (can be a zero-length string) - * @param length - length of output keying material in bytes - * @example - * import { hkdf } from '@noble/hashes/hkdf'; - * import { sha256 } from '@noble/hashes/sha2'; - * import { randomBytes } from '@noble/hashes/utils'; - * const inputKey = randomBytes(32); - * const salt = randomBytes(32); - * const info = 'application-key'; - * const hk1 = hkdf(sha256, inputKey, salt, info, 32); - */ -export const hkdf = ( - hash: CHash, - ikm: Uint8Array, - salt: Uint8Array | undefined, - info: Uint8Array | undefined, - length: number -): Uint8Array => expand(hash, extract(hash, ikm, salt), info, length); diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/hmac.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/hmac.ts deleted file mode 100644 index 6fdebdb3..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/hmac.ts +++ /dev/null @@ -1,94 +0,0 @@ -/** - * HMAC: RFC2104 message authentication code. - * @module - */ -import { abytes, aexists, ahash, clean, type CHash, type Hash } from './utils.ts'; - -/** Internal class for HMAC. */ -export class _HMAC> implements Hash<_HMAC> { - oHash: T; - iHash: T; - blockLen: number; - outputLen: number; - private finished = false; - private destroyed = false; - - constructor(hash: CHash, key: Uint8Array) { - ahash(hash); - abytes(key, undefined, 'key'); - this.iHash = hash.create() as T; - if (typeof this.iHash.update !== 'function') - throw new Error('Expected instance of class which extends utils.Hash'); - this.blockLen = this.iHash.blockLen; - this.outputLen = this.iHash.outputLen; - const blockLen = this.blockLen; - const pad = new Uint8Array(blockLen); - // blockLen can be bigger than outputLen - pad.set(key.length > blockLen ? hash.create().update(key).digest() : key); - for (let i = 0; i < pad.length; i++) pad[i] ^= 0x36; - this.iHash.update(pad); - // By doing update (processing of first block) of outer hash here we can re-use it between multiple calls via clone - this.oHash = hash.create() as T; - // Undo internal XOR && apply outer XOR - for (let i = 0; i < pad.length; i++) pad[i] ^= 0x36 ^ 0x5c; - this.oHash.update(pad); - clean(pad); - } - update(buf: Uint8Array): this { - aexists(this); - this.iHash.update(buf); - return this; - } - digestInto(out: Uint8Array): void { - aexists(this); - abytes(out, this.outputLen, 'output'); - this.finished = true; - this.iHash.digestInto(out); - this.oHash.update(out); - this.oHash.digestInto(out); - this.destroy(); - } - digest(): Uint8Array { - const out = new Uint8Array(this.oHash.outputLen); - this.digestInto(out); - return out; - } - _cloneInto(to?: _HMAC): _HMAC { - // Create new instance without calling constructor since key already in state and we don't know it. - to ||= Object.create(Object.getPrototypeOf(this), {}); - const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this; - to = to as this; - to.finished = finished; - to.destroyed = destroyed; - to.blockLen = blockLen; - to.outputLen = outputLen; - to.oHash = oHash._cloneInto(to.oHash); - to.iHash = iHash._cloneInto(to.iHash); - return to; - } - clone(): _HMAC { - return this._cloneInto(); - } - destroy(): void { - this.destroyed = true; - this.oHash.destroy(); - this.iHash.destroy(); - } -} - -/** - * HMAC: RFC2104 message authentication code. - * @param hash - function that would be used e.g. sha256 - * @param key - message key - * @param message - message data - * @example - * import { hmac } from '@noble/hashes/hmac'; - * import { sha256 } from '@noble/hashes/sha2'; - * const mac1 = hmac(sha256, 'key', 'message'); - */ -export const hmac: { - (hash: CHash, key: Uint8Array, message: Uint8Array): Uint8Array; - create(hash: CHash, key: Uint8Array): _HMAC; -} = (hash: CHash, key: Uint8Array, message: Uint8Array): Uint8Array => - new _HMAC(hash, key).update(message).digest(); -hmac.create = (hash: CHash, key: Uint8Array) => new _HMAC(hash, key); diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/index.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/index.ts deleted file mode 100644 index d128012a..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Audited & minimal JS implementation of hash functions, MACs and KDFs. Check out individual modules. - * @module - * @example -```js -import { - sha256, sha384, sha512, sha224, sha512_224, sha512_256 -} from '@noble/hashes/sha2.js'; -import { - sha3_224, sha3_256, sha3_384, sha3_512, - keccak_224, keccak_256, keccak_384, keccak_512, - shake128, shake256 -} from '@noble/hashes/sha3.js'; -import { - cshake128, cshake256, - turboshake128, turboshake256, - kt128, kt256, - kmac128, kmac256, - tuplehash256, parallelhash256, - keccakprg -} from '@noble/hashes/sha3-addons.js'; -import { blake3 } from '@noble/hashes/blake3.js'; -import { blake2b, blake2s } from '@noble/hashes/blake2.js'; -import { hmac } from '@noble/hashes/hmac.js'; -import { hkdf } from '@noble/hashes/hkdf.js'; -import { pbkdf2, pbkdf2Async } from '@noble/hashes/pbkdf2.js'; -import { scrypt, scryptAsync } from '@noble/hashes/scrypt.js'; -import { md5, ripemd160, sha1 } from '@noble/hashes/legacy.js'; -import * as utils from '@noble/hashes/utils.js'; -``` - */ -throw new Error('root module cannot be imported: import submodules instead. Check out README'); diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/legacy.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/legacy.ts deleted file mode 100644 index d3bb1a76..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/legacy.ts +++ /dev/null @@ -1,293 +0,0 @@ -/** - -SHA1 (RFC 3174), MD5 (RFC 1321) and RIPEMD160 (RFC 2286) legacy, weak hash functions. -Don't use them in a new protocol. What "weak" means: - -- Collisions can be made with 2^18 effort in MD5, 2^60 in SHA1, 2^80 in RIPEMD160. -- No practical pre-image attacks (only theoretical, 2^123.4) -- HMAC seems kinda ok: https://www.rfc-editor.org/rfc/rfc6151 - * @module - */ -import { Chi, HashMD, Maj } from './_md.ts'; -import { type CHash, clean, createHasher, rotl } from './utils.ts'; - -/** Initial SHA1 state */ -const SHA1_IV = /* @__PURE__ */ Uint32Array.from([ - 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0, -]); - -// Reusable temporary buffer -const SHA1_W = /* @__PURE__ */ new Uint32Array(80); - -/** Internal SHA1 legacy hash class. */ -export class _SHA1 extends HashMD<_SHA1> { - private A = SHA1_IV[0] | 0; - private B = SHA1_IV[1] | 0; - private C = SHA1_IV[2] | 0; - private D = SHA1_IV[3] | 0; - private E = SHA1_IV[4] | 0; - - constructor() { - super(64, 20, 8, false); - } - protected get(): [number, number, number, number, number] { - const { A, B, C, D, E } = this; - return [A, B, C, D, E]; - } - protected set(A: number, B: number, C: number, D: number, E: number): void { - this.A = A | 0; - this.B = B | 0; - this.C = C | 0; - this.D = D | 0; - this.E = E | 0; - } - protected process(view: DataView, offset: number): void { - for (let i = 0; i < 16; i++, offset += 4) SHA1_W[i] = view.getUint32(offset, false); - for (let i = 16; i < 80; i++) - SHA1_W[i] = rotl(SHA1_W[i - 3] ^ SHA1_W[i - 8] ^ SHA1_W[i - 14] ^ SHA1_W[i - 16], 1); - // Compression function main loop, 80 rounds - let { A, B, C, D, E } = this; - for (let i = 0; i < 80; i++) { - let F, K; - if (i < 20) { - F = Chi(B, C, D); - K = 0x5a827999; - } else if (i < 40) { - F = B ^ C ^ D; - K = 0x6ed9eba1; - } else if (i < 60) { - F = Maj(B, C, D); - K = 0x8f1bbcdc; - } else { - F = B ^ C ^ D; - K = 0xca62c1d6; - } - const T = (rotl(A, 5) + F + E + K + SHA1_W[i]) | 0; - E = D; - D = C; - C = rotl(B, 30); - B = A; - A = T; - } - // Add the compressed chunk to the current hash value - A = (A + this.A) | 0; - B = (B + this.B) | 0; - C = (C + this.C) | 0; - D = (D + this.D) | 0; - E = (E + this.E) | 0; - this.set(A, B, C, D, E); - } - protected roundClean(): void { - clean(SHA1_W); - } - destroy(): void { - this.set(0, 0, 0, 0, 0); - clean(this.buffer); - } -} - -/** SHA1 (RFC 3174) legacy hash function. It was cryptographically broken. */ -export const sha1: CHash = /* @__PURE__ */ createHasher(() => new _SHA1()); - -/** Per-round constants */ -const p32 = /* @__PURE__ */ Math.pow(2, 32); -const K = /* @__PURE__ */ Array.from({ length: 64 }, (_, i) => - Math.floor(p32 * Math.abs(Math.sin(i + 1))) -); - -/** md5 initial state: same as sha1, but 4 u32 instead of 5. */ -const MD5_IV = /* @__PURE__ */ SHA1_IV.slice(0, 4); - -// Reusable temporary buffer -const MD5_W = /* @__PURE__ */ new Uint32Array(16); -/** Internal MD5 legacy hash class. */ -export class _MD5 extends HashMD<_MD5> { - private A = MD5_IV[0] | 0; - private B = MD5_IV[1] | 0; - private C = MD5_IV[2] | 0; - private D = MD5_IV[3] | 0; - - constructor() { - super(64, 16, 8, true); - } - protected get(): [number, number, number, number] { - const { A, B, C, D } = this; - return [A, B, C, D]; - } - protected set(A: number, B: number, C: number, D: number): void { - this.A = A | 0; - this.B = B | 0; - this.C = C | 0; - this.D = D | 0; - } - protected process(view: DataView, offset: number): void { - for (let i = 0; i < 16; i++, offset += 4) MD5_W[i] = view.getUint32(offset, true); - // Compression function main loop, 64 rounds - let { A, B, C, D } = this; - for (let i = 0; i < 64; i++) { - let F, g, s; - if (i < 16) { - F = Chi(B, C, D); - g = i; - s = [7, 12, 17, 22]; - } else if (i < 32) { - F = Chi(D, B, C); - g = (5 * i + 1) % 16; - s = [5, 9, 14, 20]; - } else if (i < 48) { - F = B ^ C ^ D; - g = (3 * i + 5) % 16; - s = [4, 11, 16, 23]; - } else { - F = C ^ (B | ~D); - g = (7 * i) % 16; - s = [6, 10, 15, 21]; - } - F = F + A + K[i] + MD5_W[g]; - A = D; - D = C; - C = B; - B = B + rotl(F, s[i % 4]); - } - // Add the compressed chunk to the current hash value - A = (A + this.A) | 0; - B = (B + this.B) | 0; - C = (C + this.C) | 0; - D = (D + this.D) | 0; - this.set(A, B, C, D); - } - protected roundClean(): void { - clean(MD5_W); - } - destroy(): void { - this.set(0, 0, 0, 0); - clean(this.buffer); - } -} - -/** - * MD5 (RFC 1321) legacy hash function. It was cryptographically broken. - * MD5 architecture is similar to SHA1, with some differences: - * - Reduced output length: 16 bytes (128 bit) instead of 20 - * - 64 rounds, instead of 80 - * - Little-endian: could be faster, but will require more code - * - Non-linear index selection: huge speed-up for unroll - * - Per round constants: more memory accesses, additional speed-up for unroll - */ -export const md5: CHash = /* @__PURE__ */ createHasher(() => new _MD5()); - -// RIPEMD-160 - -const Rho160 = /* @__PURE__ */ Uint8Array.from([ - 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, -]); -const Id160 = /* @__PURE__ */ (() => Uint8Array.from(new Array(16).fill(0).map((_, i) => i)))(); -const Pi160 = /* @__PURE__ */ (() => Id160.map((i) => (9 * i + 5) % 16))(); -const idxLR = /* @__PURE__ */ (() => { - const L = [Id160]; - const R = [Pi160]; - const res = [L, R]; - for (let i = 0; i < 4; i++) for (let j of res) j.push(j[i].map((k) => Rho160[k])); - return res; -})(); -const idxL = /* @__PURE__ */ (() => idxLR[0])(); -const idxR = /* @__PURE__ */ (() => idxLR[1])(); -// const [idxL, idxR] = idxLR; - -const shifts160 = /* @__PURE__ */ [ - [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8], - [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7], - [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9], - [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6], - [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5], -].map((i) => Uint8Array.from(i)); -const shiftsL160 = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts160[i][j])); -const shiftsR160 = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts160[i][j])); -const Kl160 = /* @__PURE__ */ Uint32Array.from([ - 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e, -]); -const Kr160 = /* @__PURE__ */ Uint32Array.from([ - 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000, -]); -// It's called f() in spec. -function ripemd_f(group: number, x: number, y: number, z: number): number { - if (group === 0) return x ^ y ^ z; - if (group === 1) return (x & y) | (~x & z); - if (group === 2) return (x | ~y) ^ z; - if (group === 3) return (x & z) | (y & ~z); - return x ^ (y | ~z); -} -// Reusable temporary buffer -const BUF_160 = /* @__PURE__ */ new Uint32Array(16); -export class _RIPEMD160 extends HashMD<_RIPEMD160> { - private h0 = 0x67452301 | 0; - private h1 = 0xefcdab89 | 0; - private h2 = 0x98badcfe | 0; - private h3 = 0x10325476 | 0; - private h4 = 0xc3d2e1f0 | 0; - - constructor() { - super(64, 20, 8, true); - } - protected get(): [number, number, number, number, number] { - const { h0, h1, h2, h3, h4 } = this; - return [h0, h1, h2, h3, h4]; - } - protected set(h0: number, h1: number, h2: number, h3: number, h4: number): void { - this.h0 = h0 | 0; - this.h1 = h1 | 0; - this.h2 = h2 | 0; - this.h3 = h3 | 0; - this.h4 = h4 | 0; - } - protected process(view: DataView, offset: number): void { - for (let i = 0; i < 16; i++, offset += 4) BUF_160[i] = view.getUint32(offset, true); - // prettier-ignore - let al = this.h0 | 0, ar = al, - bl = this.h1 | 0, br = bl, - cl = this.h2 | 0, cr = cl, - dl = this.h3 | 0, dr = dl, - el = this.h4 | 0, er = el; - - // Instead of iterating 0 to 80, we split it into 5 groups - // And use the groups in constants, functions, etc. Much simpler - for (let group = 0; group < 5; group++) { - const rGroup = 4 - group; - const hbl = Kl160[group], hbr = Kr160[group]; // prettier-ignore - const rl = idxL[group], rr = idxR[group]; // prettier-ignore - const sl = shiftsL160[group], sr = shiftsR160[group]; // prettier-ignore - for (let i = 0; i < 16; i++) { - const tl = (rotl(al + ripemd_f(group, bl, cl, dl) + BUF_160[rl[i]] + hbl, sl[i]) + el) | 0; - al = el, el = dl, dl = rotl(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore - } - // 2 loops are 10% faster - for (let i = 0; i < 16; i++) { - const tr = (rotl(ar + ripemd_f(rGroup, br, cr, dr) + BUF_160[rr[i]] + hbr, sr[i]) + er) | 0; - ar = er, er = dr, dr = rotl(cr, 10) | 0, cr = br, br = tr; // prettier-ignore - } - } - // Add the compressed chunk to the current hash value - this.set( - (this.h1 + cl + dr) | 0, - (this.h2 + dl + er) | 0, - (this.h3 + el + ar) | 0, - (this.h4 + al + br) | 0, - (this.h0 + bl + cr) | 0 - ); - } - protected roundClean(): void { - clean(BUF_160); - } - destroy(): void { - this.destroyed = true; - clean(this.buffer); - this.set(0, 0, 0, 0, 0); - } -} - -/** - * RIPEMD-160 - a legacy hash function from 1990s. - * * https://homes.esat.kuleuven.be/~bosselae/ripemd160.html - * * https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf - */ -export const ripemd160: CHash = /* @__PURE__ */ createHasher(() => new _RIPEMD160()); diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/pbkdf2.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/pbkdf2.ts deleted file mode 100644 index 2d2e90bf..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/pbkdf2.ts +++ /dev/null @@ -1,129 +0,0 @@ -/** - * PBKDF (RFC 2898). Can be used to create a key from password and salt. - * @module - */ -import { hmac } from './hmac.ts'; -// prettier-ignore -import { - ahash, anumber, - asyncLoop, checkOpts, clean, createView, kdfInputToBytes, - type CHash, - type Hash, - type KDFInput -} from './utils.ts'; - -/** - * PBKDF2 options: - * * c: iterations, should probably be higher than 100_000 - * * dkLen: desired length of derived key in bytes - * * asyncTick: max time in ms for which async function can block execution - */ -export type Pbkdf2Opt = { - c: number; - dkLen?: number; - asyncTick?: number; -}; -// Common start and end for sync/async functions -function pbkdf2Init(hash: CHash, _password: KDFInput, _salt: KDFInput, _opts: Pbkdf2Opt) { - ahash(hash); - const opts = checkOpts({ dkLen: 32, asyncTick: 10 }, _opts); - const { c, dkLen, asyncTick } = opts; - anumber(c, 'c'); - anumber(dkLen, 'dkLen'); - anumber(asyncTick, 'asyncTick'); - if (c < 1) throw new Error('iterations (c) must be >= 1'); - const password = kdfInputToBytes(_password, 'password'); - const salt = kdfInputToBytes(_salt, 'salt'); - // DK = PBKDF2(PRF, Password, Salt, c, dkLen); - const DK = new Uint8Array(dkLen); - // U1 = PRF(Password, Salt + INT_32_BE(i)) - const PRF = hmac.create(hash, password); - const PRFSalt = PRF._cloneInto().update(salt); - return { c, dkLen, asyncTick, DK, PRF, PRFSalt }; -} - -function pbkdf2Output>( - PRF: Hash, - PRFSalt: Hash, - DK: Uint8Array, - prfW: Hash, - u: Uint8Array -) { - PRF.destroy(); - PRFSalt.destroy(); - if (prfW) prfW.destroy(); - clean(u); - return DK; -} - -/** - * PBKDF2-HMAC: RFC 2898 key derivation function - * @param hash - hash function that would be used e.g. sha256 - * @param password - password from which a derived key is generated - * @param salt - cryptographic salt - * @param opts - {c, dkLen} where c is work factor and dkLen is output message size - * @example - * const key = pbkdf2(sha256, 'password', 'salt', { dkLen: 32, c: Math.pow(2, 18) }); - */ -export function pbkdf2( - hash: CHash, - password: KDFInput, - salt: KDFInput, - opts: Pbkdf2Opt -): Uint8Array { - const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts); - let prfW: any; // Working copy - const arr = new Uint8Array(4); - const view = createView(arr); - const u = new Uint8Array(PRF.outputLen); - // DK = T1 + T2 + ⋯ + Tdklen/hlen - for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { - // Ti = F(Password, Salt, c, i) - const Ti = DK.subarray(pos, pos + PRF.outputLen); - view.setInt32(0, ti, false); - // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc - // U1 = PRF(Password, Salt + INT_32_BE(i)) - (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); - Ti.set(u.subarray(0, Ti.length)); - for (let ui = 1; ui < c; ui++) { - // Uc = PRF(Password, Uc−1) - PRF._cloneInto(prfW).update(u).digestInto(u); - for (let i = 0; i < Ti.length; i++) Ti[i] ^= u[i]; - } - } - return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); -} - -/** - * PBKDF2-HMAC: RFC 2898 key derivation function. Async version. - * @example - * await pbkdf2Async(sha256, 'password', 'salt', { dkLen: 32, c: 500_000 }); - */ -export async function pbkdf2Async( - hash: CHash, - password: KDFInput, - salt: KDFInput, - opts: Pbkdf2Opt -): Promise { - const { c, dkLen, asyncTick, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts); - let prfW: any; // Working copy - const arr = new Uint8Array(4); - const view = createView(arr); - const u = new Uint8Array(PRF.outputLen); - // DK = T1 + T2 + ⋯ + Tdklen/hlen - for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { - // Ti = F(Password, Salt, c, i) - const Ti = DK.subarray(pos, pos + PRF.outputLen); - view.setInt32(0, ti, false); - // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc - // U1 = PRF(Password, Salt + INT_32_BE(i)) - (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); - Ti.set(u.subarray(0, Ti.length)); - await asyncLoop(c - 1, asyncTick, () => { - // Uc = PRF(Password, Uc−1) - PRF._cloneInto(prfW).update(u).digestInto(u); - for (let i = 0; i < Ti.length; i++) Ti[i] ^= u[i]; - }); - } - return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); -} diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/scrypt.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/scrypt.ts deleted file mode 100644 index 619de53c..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/scrypt.ts +++ /dev/null @@ -1,249 +0,0 @@ -/** - * RFC 7914 Scrypt KDF. Can be used to create a key from password and salt. - * @module - */ -import { pbkdf2 } from './pbkdf2.ts'; -import { sha256 } from './sha2.ts'; -// prettier-ignore -import { - anumber, asyncLoop, - checkOpts, clean, - type KDFInput, rotl, - swap32IfBE, - u32 -} from './utils.ts'; - -// The main Scrypt loop: uses Salsa extensively. -// Six versions of the function were tried, this is the fastest one. -// prettier-ignore -function XorAndSalsa( - prev: Uint32Array, - pi: number, - input: Uint32Array, - ii: number, - out: Uint32Array, - oi: number -) { - // Based on https://cr.yp.to/salsa20.html - // Xor blocks - let y00 = prev[pi++] ^ input[ii++], y01 = prev[pi++] ^ input[ii++]; - let y02 = prev[pi++] ^ input[ii++], y03 = prev[pi++] ^ input[ii++]; - let y04 = prev[pi++] ^ input[ii++], y05 = prev[pi++] ^ input[ii++]; - let y06 = prev[pi++] ^ input[ii++], y07 = prev[pi++] ^ input[ii++]; - let y08 = prev[pi++] ^ input[ii++], y09 = prev[pi++] ^ input[ii++]; - let y10 = prev[pi++] ^ input[ii++], y11 = prev[pi++] ^ input[ii++]; - let y12 = prev[pi++] ^ input[ii++], y13 = prev[pi++] ^ input[ii++]; - let y14 = prev[pi++] ^ input[ii++], y15 = prev[pi++] ^ input[ii++]; - // Save state to temporary variables (salsa) - let x00 = y00, x01 = y01, x02 = y02, x03 = y03, - x04 = y04, x05 = y05, x06 = y06, x07 = y07, - x08 = y08, x09 = y09, x10 = y10, x11 = y11, - x12 = y12, x13 = y13, x14 = y14, x15 = y15; - // Main loop (salsa) - for (let i = 0; i < 8; i += 2) { - x04 ^= rotl(x00 + x12 | 0, 7); x08 ^= rotl(x04 + x00 | 0, 9); - x12 ^= rotl(x08 + x04 | 0, 13); x00 ^= rotl(x12 + x08 | 0, 18); - x09 ^= rotl(x05 + x01 | 0, 7); x13 ^= rotl(x09 + x05 | 0, 9); - x01 ^= rotl(x13 + x09 | 0, 13); x05 ^= rotl(x01 + x13 | 0, 18); - x14 ^= rotl(x10 + x06 | 0, 7); x02 ^= rotl(x14 + x10 | 0, 9); - x06 ^= rotl(x02 + x14 | 0, 13); x10 ^= rotl(x06 + x02 | 0, 18); - x03 ^= rotl(x15 + x11 | 0, 7); x07 ^= rotl(x03 + x15 | 0, 9); - x11 ^= rotl(x07 + x03 | 0, 13); x15 ^= rotl(x11 + x07 | 0, 18); - x01 ^= rotl(x00 + x03 | 0, 7); x02 ^= rotl(x01 + x00 | 0, 9); - x03 ^= rotl(x02 + x01 | 0, 13); x00 ^= rotl(x03 + x02 | 0, 18); - x06 ^= rotl(x05 + x04 | 0, 7); x07 ^= rotl(x06 + x05 | 0, 9); - x04 ^= rotl(x07 + x06 | 0, 13); x05 ^= rotl(x04 + x07 | 0, 18); - x11 ^= rotl(x10 + x09 | 0, 7); x08 ^= rotl(x11 + x10 | 0, 9); - x09 ^= rotl(x08 + x11 | 0, 13); x10 ^= rotl(x09 + x08 | 0, 18); - x12 ^= rotl(x15 + x14 | 0, 7); x13 ^= rotl(x12 + x15 | 0, 9); - x14 ^= rotl(x13 + x12 | 0, 13); x15 ^= rotl(x14 + x13 | 0, 18); - } - // Write output (salsa) - out[oi++] = (y00 + x00) | 0; out[oi++] = (y01 + x01) | 0; - out[oi++] = (y02 + x02) | 0; out[oi++] = (y03 + x03) | 0; - out[oi++] = (y04 + x04) | 0; out[oi++] = (y05 + x05) | 0; - out[oi++] = (y06 + x06) | 0; out[oi++] = (y07 + x07) | 0; - out[oi++] = (y08 + x08) | 0; out[oi++] = (y09 + x09) | 0; - out[oi++] = (y10 + x10) | 0; out[oi++] = (y11 + x11) | 0; - out[oi++] = (y12 + x12) | 0; out[oi++] = (y13 + x13) | 0; - out[oi++] = (y14 + x14) | 0; out[oi++] = (y15 + x15) | 0; -} - -function BlockMix(input: Uint32Array, ii: number, out: Uint32Array, oi: number, r: number) { - // The block B is r 128-byte chunks (which is equivalent of 2r 64-byte chunks) - let head = oi + 0; - let tail = oi + 16 * r; - for (let i = 0; i < 16; i++) out[tail + i] = input[ii + (2 * r - 1) * 16 + i]; // X ← B[2r−1] - for (let i = 0; i < r; i++, head += 16, ii += 16) { - // We write odd & even Yi at same time. Even: 0bXXXXX0 Odd: 0bXXXXX1 - XorAndSalsa(out, tail, input, ii, out, head); // head[i] = Salsa(blockIn[2*i] ^ tail[i-1]) - if (i > 0) tail += 16; // First iteration overwrites tmp value in tail - XorAndSalsa(out, head, input, (ii += 16), out, tail); // tail[i] = Salsa(blockIn[2*i+1] ^ head[i]) - } -} - -/** - * Scrypt options: - * - `N` is cpu/mem work factor (power of 2 e.g. `2**18`) - * - `r` is block size (8 is common), fine-tunes sequential memory read size and performance - * - `p` is parallelization factor (1 is common) - * - `dkLen` is output key length in bytes e.g. 32. - * - `asyncTick` - (default: 10) max time in ms for which async function can block execution - * - `maxmem` - (default: `1024 ** 3 + 1024` aka 1GB+1KB). A limit that the app could use for scrypt - * - `onProgress` - callback function that would be executed for progress report - */ -export type ScryptOpts = { - N: number; // cost factor - r: number; // block size - p: number; // parallelization - dkLen?: number; // key length - asyncTick?: number; // block execution max time - maxmem?: number; - onProgress?: (progress: number) => void; -}; - -// Common prologue and epilogue for sync/async functions -function scryptInit(password: KDFInput, salt: KDFInput, _opts?: ScryptOpts) { - // Maxmem - 1GB+1KB by default - const opts = checkOpts( - { - dkLen: 32, - asyncTick: 10, - maxmem: 1024 ** 3 + 1024, - }, - _opts - ); - const { N, r, p, dkLen, asyncTick, maxmem, onProgress } = opts; - anumber(N, 'N'); - anumber(r, 'r'); - anumber(p, 'p'); - anumber(dkLen, 'dkLen'); - anumber(asyncTick, 'asyncTick'); - anumber(maxmem, 'maxmem'); - if (onProgress !== undefined && typeof onProgress !== 'function') - throw new Error('progressCb must be a function'); - const blockSize = 128 * r; - const blockSize32 = blockSize / 4; - - // Max N is 2^32 (Integrify is 32-bit). - // Real limit can be 2^22: some JS engines limit Uint8Array to 4GB. - // Spec check `N >= 2^(blockSize / 8)` is not done for compat with popular libs, - // which used incorrect r: 1, p: 8. Also, the check seems to be a spec error: - // https://www.rfc-editor.org/errata_search.php?rfc=7914 - const pow32 = Math.pow(2, 32); - if (N <= 1 || (N & (N - 1)) !== 0 || N > pow32) - throw new Error('"N" expected a power of 2, and 2^1 <= N <= 2^32'); - if (p < 1 || p > ((pow32 - 1) * 32) / blockSize) - throw new Error('"p" expected integer 1..((2^32 - 1) * 32) / (128 * r)'); - if (dkLen < 1 || dkLen > (pow32 - 1) * 32) - throw new Error('"dkLen" expected integer 1..(2^32 - 1) * 32'); - const memUsed = blockSize * (N + p); - if (memUsed > maxmem) - throw new Error('"maxmem" limit was hit, expected 128*r*(N+p) <= "maxmem"=' + maxmem); - // [B0...Bp−1] ← PBKDF2HMAC-SHA256(Passphrase, Salt, 1, blockSize*ParallelizationFactor) - // Since it has only one iteration there is no reason to use async variant - const B = pbkdf2(sha256, password, salt, { c: 1, dkLen: blockSize * p }); - const B32 = u32(B); - // Re-used between parallel iterations. Array(iterations) of B - const V = u32(new Uint8Array(blockSize * N)); - const tmp = u32(new Uint8Array(blockSize)); - let blockMixCb = () => {}; - if (onProgress) { - const totalBlockMix = 2 * N * p; - // Invoke callback if progress changes from 10.01 to 10.02 - // Allows to draw smooth progress bar on up to 8K screen - const callbackPer = Math.max(Math.floor(totalBlockMix / 10000), 1); - let blockMixCnt = 0; - blockMixCb = () => { - blockMixCnt++; - if (onProgress && (!(blockMixCnt % callbackPer) || blockMixCnt === totalBlockMix)) - onProgress(blockMixCnt / totalBlockMix); - }; - } - return { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick }; -} - -function scryptOutput( - password: KDFInput, - dkLen: number, - B: Uint8Array, - V: Uint32Array, - tmp: Uint32Array -) { - const res = pbkdf2(sha256, password, B, { c: 1, dkLen }); - clean(B, V, tmp); - return res; -} - -/** - * Scrypt KDF from RFC 7914. See {@link ScryptOpts}. - * @example - * scrypt('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 }); - */ -export function scrypt(password: KDFInput, salt: KDFInput, opts: ScryptOpts): Uint8Array { - const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb } = scryptInit( - password, - salt, - opts - ); - swap32IfBE(B32); - for (let pi = 0; pi < p; pi++) { - const Pi = blockSize32 * pi; - for (let i = 0; i < blockSize32; i++) V[i] = B32[Pi + i]; // V[0] = B[i] - for (let i = 0, pos = 0; i < N - 1; i++) { - BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]); - blockMixCb(); - } - BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element - blockMixCb(); - for (let i = 0; i < N; i++) { - // First u32 of the last 64-byte block (u32 is LE) - // & (N - 1) is % N as N is a power of 2, N & (N - 1) = 0 is checked above; >>> 0 for unsigned, input fits in u32 - const j = (B32[Pi + blockSize32 - 16] & (N - 1)) >>> 0; // j = Integrify(X) % iterations - for (let k = 0; k < blockSize32; k++) tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j] - BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) - blockMixCb(); - } - } - swap32IfBE(B32); - return scryptOutput(password, dkLen, B, V, tmp); -} - -/** - * Scrypt KDF from RFC 7914. Async version. See {@link ScryptOpts}. - * @example - * await scryptAsync('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 }); - */ -export async function scryptAsync( - password: KDFInput, - salt: KDFInput, - opts: ScryptOpts -): Promise { - const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick } = scryptInit( - password, - salt, - opts - ); - swap32IfBE(B32); - for (let pi = 0; pi < p; pi++) { - const Pi = blockSize32 * pi; - for (let i = 0; i < blockSize32; i++) V[i] = B32[Pi + i]; // V[0] = B[i] - let pos = 0; - await asyncLoop(N - 1, asyncTick, () => { - BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]); - blockMixCb(); - }); - BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element - blockMixCb(); - await asyncLoop(N, asyncTick, () => { - // First u32 of the last 64-byte block (u32 is LE) - // & (N - 1) is % N as N is a power of 2, N & (N - 1) = 0 is checked above; >>> 0 for unsigned, input fits in u32 - const j = (B32[Pi + blockSize32 - 16] & (N - 1)) >>> 0; // j = Integrify(X) % iterations - for (let k = 0; k < blockSize32; k++) tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j] - BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) - blockMixCb(); - }); - } - swap32IfBE(B32); - return scryptOutput(password, dkLen, B, V, tmp); -} diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/sha2.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/sha2.ts deleted file mode 100644 index 73f8d17e..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/sha2.ts +++ /dev/null @@ -1,469 +0,0 @@ -/** - * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256. - * SHA256 is the fastest hash implementable in JS, even faster than Blake3. - * Check out [RFC 4634](https://www.rfc-editor.org/rfc/rfc4634) and - * [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf). - * @module - */ -import { Chi, HashMD, Maj, SHA224_IV, SHA256_IV, SHA384_IV, SHA512_IV } from './_md.ts'; -import * as u64 from './_u64.ts'; -import { type CHash, clean, createHasher, oidNist, rotr } from './utils.ts'; - -/** - * Round constants: - * First 32 bits of fractional parts of the cube roots of the first 64 primes 2..311) - */ -// prettier-ignore -const SHA256_K = /* @__PURE__ */ Uint32Array.from([ - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 -]); - -/** Reusable temporary buffer. "W" comes straight from spec. */ -const SHA256_W = /* @__PURE__ */ new Uint32Array(64); - -/** Internal 32-byte base SHA2 hash class. */ -abstract class SHA2_32B> extends HashMD { - // We cannot use array here since array allows indexing by variable - // which means optimizer/compiler cannot use registers. - protected abstract A: number; - protected abstract B: number; - protected abstract C: number; - protected abstract D: number; - protected abstract E: number; - protected abstract F: number; - protected abstract G: number; - protected abstract H: number; - - constructor(outputLen: number) { - super(64, outputLen, 8, false); - } - protected get(): [number, number, number, number, number, number, number, number] { - const { A, B, C, D, E, F, G, H } = this; - return [A, B, C, D, E, F, G, H]; - } - // prettier-ignore - protected set( - A: number, B: number, C: number, D: number, E: number, F: number, G: number, H: number - ): void { - this.A = A | 0; - this.B = B | 0; - this.C = C | 0; - this.D = D | 0; - this.E = E | 0; - this.F = F | 0; - this.G = G | 0; - this.H = H | 0; - } - protected process(view: DataView, offset: number): void { - // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array - for (let i = 0; i < 16; i++, offset += 4) SHA256_W[i] = view.getUint32(offset, false); - for (let i = 16; i < 64; i++) { - const W15 = SHA256_W[i - 15]; - const W2 = SHA256_W[i - 2]; - const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3); - const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10); - SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0; - } - // Compression function main loop, 64 rounds - let { A, B, C, D, E, F, G, H } = this; - for (let i = 0; i < 64; i++) { - const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25); - const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; - const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22); - const T2 = (sigma0 + Maj(A, B, C)) | 0; - H = G; - G = F; - F = E; - E = (D + T1) | 0; - D = C; - C = B; - B = A; - A = (T1 + T2) | 0; - } - // Add the compressed chunk to the current hash value - A = (A + this.A) | 0; - B = (B + this.B) | 0; - C = (C + this.C) | 0; - D = (D + this.D) | 0; - E = (E + this.E) | 0; - F = (F + this.F) | 0; - G = (G + this.G) | 0; - H = (H + this.H) | 0; - this.set(A, B, C, D, E, F, G, H); - } - protected roundClean(): void { - clean(SHA256_W); - } - destroy(): void { - this.set(0, 0, 0, 0, 0, 0, 0, 0); - clean(this.buffer); - } -} - -/** Internal SHA2-256 hash class. */ -export class _SHA256 extends SHA2_32B<_SHA256> { - // We cannot use array here since array allows indexing by variable - // which means optimizer/compiler cannot use registers. - protected A: number = SHA256_IV[0] | 0; - protected B: number = SHA256_IV[1] | 0; - protected C: number = SHA256_IV[2] | 0; - protected D: number = SHA256_IV[3] | 0; - protected E: number = SHA256_IV[4] | 0; - protected F: number = SHA256_IV[5] | 0; - protected G: number = SHA256_IV[6] | 0; - protected H: number = SHA256_IV[7] | 0; - constructor() { - super(32); - } -} - -/** Internal SHA2-224 hash class. */ -export class _SHA224 extends SHA2_32B<_SHA224> { - protected A: number = SHA224_IV[0] | 0; - protected B: number = SHA224_IV[1] | 0; - protected C: number = SHA224_IV[2] | 0; - protected D: number = SHA224_IV[3] | 0; - protected E: number = SHA224_IV[4] | 0; - protected F: number = SHA224_IV[5] | 0; - protected G: number = SHA224_IV[6] | 0; - protected H: number = SHA224_IV[7] | 0; - constructor() { - super(28); - } -} - -// SHA2-512 is slower than sha256 in js because u64 operations are slow. - -// Round contants -// First 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409 -// prettier-ignore -const K512 = /* @__PURE__ */ (() => u64.split([ - '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc', - '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118', - '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2', - '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694', - '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65', - '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5', - '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4', - '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70', - '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df', - '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b', - '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30', - '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8', - '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8', - '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3', - '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec', - '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b', - '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178', - '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b', - '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c', - '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817' -].map(n => BigInt(n))))(); -const SHA512_Kh = /* @__PURE__ */ (() => K512[0])(); -const SHA512_Kl = /* @__PURE__ */ (() => K512[1])(); - -// Reusable temporary buffers -const SHA512_W_H = /* @__PURE__ */ new Uint32Array(80); -const SHA512_W_L = /* @__PURE__ */ new Uint32Array(80); - -/** Internal 64-byte base SHA2 hash class. */ -abstract class SHA2_64B> extends HashMD { - // We cannot use array here since array allows indexing by variable - // which means optimizer/compiler cannot use registers. - // h -- high 32 bits, l -- low 32 bits - protected abstract Ah: number; - protected abstract Al: number; - protected abstract Bh: number; - protected abstract Bl: number; - protected abstract Ch: number; - protected abstract Cl: number; - protected abstract Dh: number; - protected abstract Dl: number; - protected abstract Eh: number; - protected abstract El: number; - protected abstract Fh: number; - protected abstract Fl: number; - protected abstract Gh: number; - protected abstract Gl: number; - protected abstract Hh: number; - protected abstract Hl: number; - - constructor(outputLen: number) { - super(128, outputLen, 16, false); - } - // prettier-ignore - protected get(): [ - number, number, number, number, number, number, number, number, - number, number, number, number, number, number, number, number - ] { - const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; - return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl]; - } - // prettier-ignore - protected set( - Ah: number, Al: number, Bh: number, Bl: number, Ch: number, Cl: number, Dh: number, Dl: number, - Eh: number, El: number, Fh: number, Fl: number, Gh: number, Gl: number, Hh: number, Hl: number - ): void { - this.Ah = Ah | 0; - this.Al = Al | 0; - this.Bh = Bh | 0; - this.Bl = Bl | 0; - this.Ch = Ch | 0; - this.Cl = Cl | 0; - this.Dh = Dh | 0; - this.Dl = Dl | 0; - this.Eh = Eh | 0; - this.El = El | 0; - this.Fh = Fh | 0; - this.Fl = Fl | 0; - this.Gh = Gh | 0; - this.Gl = Gl | 0; - this.Hh = Hh | 0; - this.Hl = Hl | 0; - } - protected process(view: DataView, offset: number): void { - // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array - for (let i = 0; i < 16; i++, offset += 4) { - SHA512_W_H[i] = view.getUint32(offset); - SHA512_W_L[i] = view.getUint32((offset += 4)); - } - for (let i = 16; i < 80; i++) { - // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7) - const W15h = SHA512_W_H[i - 15] | 0; - const W15l = SHA512_W_L[i - 15] | 0; - const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7); - const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7); - // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6) - const W2h = SHA512_W_H[i - 2] | 0; - const W2l = SHA512_W_L[i - 2] | 0; - const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6); - const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6); - // SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16]; - const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]); - const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]); - SHA512_W_H[i] = SUMh | 0; - SHA512_W_L[i] = SUMl | 0; - } - let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; - // Compression function main loop, 80 rounds - for (let i = 0; i < 80; i++) { - // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41) - const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41); - const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41); - //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; - const CHIh = (Eh & Fh) ^ (~Eh & Gh); - const CHIl = (El & Fl) ^ (~El & Gl); - // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i] - // prettier-ignore - const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]); - const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]); - const T1l = T1ll | 0; - // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39) - const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39); - const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39); - const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch); - const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl); - Hh = Gh | 0; - Hl = Gl | 0; - Gh = Fh | 0; - Gl = Fl | 0; - Fh = Eh | 0; - Fl = El | 0; - ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0)); - Dh = Ch | 0; - Dl = Cl | 0; - Ch = Bh | 0; - Cl = Bl | 0; - Bh = Ah | 0; - Bl = Al | 0; - const All = u64.add3L(T1l, sigma0l, MAJl); - Ah = u64.add3H(All, T1h, sigma0h, MAJh); - Al = All | 0; - } - // Add the compressed chunk to the current hash value - ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0)); - ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0)); - ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0)); - ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0)); - ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0)); - ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0)); - ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0)); - ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0)); - this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl); - } - protected roundClean(): void { - clean(SHA512_W_H, SHA512_W_L); - } - destroy(): void { - clean(this.buffer); - this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - } -} - -/** Internal SHA2-512 hash class. */ -export class _SHA512 extends SHA2_64B<_SHA512> { - protected Ah: number = SHA512_IV[0] | 0; - protected Al: number = SHA512_IV[1] | 0; - protected Bh: number = SHA512_IV[2] | 0; - protected Bl: number = SHA512_IV[3] | 0; - protected Ch: number = SHA512_IV[4] | 0; - protected Cl: number = SHA512_IV[5] | 0; - protected Dh: number = SHA512_IV[6] | 0; - protected Dl: number = SHA512_IV[7] | 0; - protected Eh: number = SHA512_IV[8] | 0; - protected El: number = SHA512_IV[9] | 0; - protected Fh: number = SHA512_IV[10] | 0; - protected Fl: number = SHA512_IV[11] | 0; - protected Gh: number = SHA512_IV[12] | 0; - protected Gl: number = SHA512_IV[13] | 0; - protected Hh: number = SHA512_IV[14] | 0; - protected Hl: number = SHA512_IV[15] | 0; - - constructor() { - super(64); - } -} - -/** Internal SHA2-384 hash class. */ -export class _SHA384 extends SHA2_64B<_SHA384> { - protected Ah: number = SHA384_IV[0] | 0; - protected Al: number = SHA384_IV[1] | 0; - protected Bh: number = SHA384_IV[2] | 0; - protected Bl: number = SHA384_IV[3] | 0; - protected Ch: number = SHA384_IV[4] | 0; - protected Cl: number = SHA384_IV[5] | 0; - protected Dh: number = SHA384_IV[6] | 0; - protected Dl: number = SHA384_IV[7] | 0; - protected Eh: number = SHA384_IV[8] | 0; - protected El: number = SHA384_IV[9] | 0; - protected Fh: number = SHA384_IV[10] | 0; - protected Fl: number = SHA384_IV[11] | 0; - protected Gh: number = SHA384_IV[12] | 0; - protected Gl: number = SHA384_IV[13] | 0; - protected Hh: number = SHA384_IV[14] | 0; - protected Hl: number = SHA384_IV[15] | 0; - - constructor() { - super(48); - } -} - -/** - * Truncated SHA512/256 and SHA512/224. - * SHA512_IV is XORed with 0xa5a5a5a5a5a5a5a5, then used as "intermediary" IV of SHA512/t. - * Then t hashes string to produce result IV. - * See `test/misc/sha2-gen-iv.js`. - */ - -/** SHA512/224 IV */ -const T224_IV = /* @__PURE__ */ Uint32Array.from([ - 0x8c3d37c8, 0x19544da2, 0x73e19966, 0x89dcd4d6, 0x1dfab7ae, 0x32ff9c82, 0x679dd514, 0x582f9fcf, - 0x0f6d2b69, 0x7bd44da8, 0x77e36f73, 0x04c48942, 0x3f9d85a8, 0x6a1d36c8, 0x1112e6ad, 0x91d692a1, -]); - -/** SHA512/256 IV */ -const T256_IV = /* @__PURE__ */ Uint32Array.from([ - 0x22312194, 0xfc2bf72c, 0x9f555fa3, 0xc84c64c2, 0x2393b86b, 0x6f53b151, 0x96387719, 0x5940eabd, - 0x96283ee2, 0xa88effe3, 0xbe5e1e25, 0x53863992, 0x2b0199fc, 0x2c85b8aa, 0x0eb72ddc, 0x81c52ca2, -]); - -/** Internal SHA2-512/224 hash class. */ -export class _SHA512_224 extends SHA2_64B<_SHA512_224> { - protected Ah: number = T224_IV[0] | 0; - protected Al: number = T224_IV[1] | 0; - protected Bh: number = T224_IV[2] | 0; - protected Bl: number = T224_IV[3] | 0; - protected Ch: number = T224_IV[4] | 0; - protected Cl: number = T224_IV[5] | 0; - protected Dh: number = T224_IV[6] | 0; - protected Dl: number = T224_IV[7] | 0; - protected Eh: number = T224_IV[8] | 0; - protected El: number = T224_IV[9] | 0; - protected Fh: number = T224_IV[10] | 0; - protected Fl: number = T224_IV[11] | 0; - protected Gh: number = T224_IV[12] | 0; - protected Gl: number = T224_IV[13] | 0; - protected Hh: number = T224_IV[14] | 0; - protected Hl: number = T224_IV[15] | 0; - - constructor() { - super(28); - } -} - -/** Internal SHA2-512/256 hash class. */ -export class _SHA512_256 extends SHA2_64B<_SHA512_256> { - protected Ah: number = T256_IV[0] | 0; - protected Al: number = T256_IV[1] | 0; - protected Bh: number = T256_IV[2] | 0; - protected Bl: number = T256_IV[3] | 0; - protected Ch: number = T256_IV[4] | 0; - protected Cl: number = T256_IV[5] | 0; - protected Dh: number = T256_IV[6] | 0; - protected Dl: number = T256_IV[7] | 0; - protected Eh: number = T256_IV[8] | 0; - protected El: number = T256_IV[9] | 0; - protected Fh: number = T256_IV[10] | 0; - protected Fl: number = T256_IV[11] | 0; - protected Gh: number = T256_IV[12] | 0; - protected Gl: number = T256_IV[13] | 0; - protected Hh: number = T256_IV[14] | 0; - protected Hl: number = T256_IV[15] | 0; - - constructor() { - super(32); - } -} - -/** - * SHA2-256 hash function from RFC 4634. In JS it's the fastest: even faster than Blake3. Some info: - * - * - Trying 2^128 hashes would get 50% chance of collision, using birthday attack. - * - BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025. - * - Each sha256 hash is executing 2^18 bit operations. - * - Good 2024 ASICs can do 200Th/sec with 3500 watts of power, corresponding to 2^36 hashes/joule. - */ -export const sha256: CHash<_SHA256> = /* @__PURE__ */ createHasher( - () => new _SHA256(), - /* @__PURE__ */ oidNist(0x01) -); -/** SHA2-224 hash function from RFC 4634 */ -export const sha224: CHash<_SHA224> = /* @__PURE__ */ createHasher( - () => new _SHA224(), - /* @__PURE__ */ oidNist(0x04) -); - -/** SHA2-512 hash function from RFC 4634. */ -export const sha512: CHash<_SHA512> = /* @__PURE__ */ createHasher( - () => new _SHA512(), - /* @__PURE__ */ oidNist(0x03) -); -/** SHA2-384 hash function from RFC 4634. */ -export const sha384: CHash<_SHA384> = /* @__PURE__ */ createHasher( - () => new _SHA384(), - /* @__PURE__ */ oidNist(0x02) -); - -/** - * SHA2-512/256 "truncated" hash function, with improved resistance to length extension attacks. - * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf). - */ -export const sha512_256: CHash<_SHA512_256> = /* @__PURE__ */ createHasher( - () => new _SHA512_256(), - /* @__PURE__ */ oidNist(0x06) -); -/** - * SHA2-512/224 "truncated" hash function, with improved resistance to length extension attacks. - * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf). - */ -export const sha512_224: CHash<_SHA512_224> = /* @__PURE__ */ createHasher( - () => new _SHA512_224(), - /* @__PURE__ */ oidNist(0x05) -); diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/sha3-addons.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/sha3-addons.ts deleted file mode 100644 index 88dfa60a..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/sha3-addons.ts +++ /dev/null @@ -1,530 +0,0 @@ -/** - * SHA3 (keccak) addons. - * - * * cSHAKE, KMAC, TupleHash, ParallelHash + XOF variants from - * [NIST SP 800-185](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-185.pdf) - * * KangarooTwelve 🦘 and TurboSHAKE - reduced-round keccak from - * [k12-draft-17](https://datatracker.ietf.org/doc/draft-irtf-cfrg-kangarootwelve/17/) - * * KeccakPRG: Pseudo-random generator based on Keccak [(pdf)](https://keccak.team/files/CSF-0.1.pdf) - * @module - */ -import { Keccak, type ShakeOpts } from './sha3.ts'; -import { - abytes, - anumber, - type CHash, - type CHashXOF, - createHasher, - type Hash, - type HashXOF, - type KDFInput, - kdfInputToBytes, - type PRG, - u32, -} from './utils.ts'; - -// cSHAKE && KMAC (NIST SP800-185) -const _8n = /* @__PURE__ */ BigInt(8); -const _ffn = /* @__PURE__ */ BigInt(0xff); - -// It is safe to use bigints here, since they used only for length encoding (not actual data). -// We use bigints in sha256 for lengths too. -function leftEncode(n: number | bigint): Uint8Array { - n = BigInt(n); - const res = [Number(n & _ffn)]; - n >>= _8n; - for (; n > 0; n >>= _8n) res.unshift(Number(n & _ffn)); - res.unshift(res.length); - return new Uint8Array(res); -} - -function rightEncode(n: number | bigint): Uint8Array { - n = BigInt(n); - const res = [Number(n & _ffn)]; - n >>= _8n; - for (; n > 0; n >>= _8n) res.unshift(Number(n & _ffn)); - res.push(res.length); - return new Uint8Array(res); -} - -function chooseLen(opts: ShakeOpts, outputLen: number): number { - return opts.dkLen === undefined ? outputLen : opts.dkLen; -} - -const abytesOrZero = (buf?: Uint8Array, title = '') => { - if (buf === undefined) return EMPTY_BUFFER; - abytes(buf, undefined, title); - return buf; -}; -// NOTE: second modulo is necessary since we don't need to add padding if current element takes whole block -const getPadding = (len: number, block: number) => new Uint8Array((block - (len % block)) % block); -export type cShakeOpts = ShakeOpts & { personalization?: Uint8Array; NISTfn?: KDFInput }; - -// Personalization -function cshakePers(hash: Keccak, opts: cShakeOpts = {}): Keccak { - if (!opts || (opts.personalization === undefined && opts.NISTfn === undefined)) return hash; - // Encode and pad inplace to avoid unneccesary memory copies/slices (so we don't need to zero them later) - // bytepad(encode_string(N) || encode_string(S), 168) - const blockLenBytes = leftEncode(hash.blockLen); - const fn = opts.NISTfn === undefined ? EMPTY_BUFFER : kdfInputToBytes(opts.NISTfn); - const fnLen = leftEncode(_8n * BigInt(fn.length)); // length in bits - const pers = abytesOrZero(opts.personalization, 'personalization'); - const persLen = leftEncode(_8n * BigInt(pers.length)); // length in bits - if (!fn.length && !pers.length) return hash; - hash.suffix = 0x04; - hash.update(blockLenBytes).update(fnLen).update(fn).update(persLen).update(pers); - let totalLen = blockLenBytes.length + fnLen.length + fn.length + persLen.length + pers.length; - hash.update(getPadding(totalLen, hash.blockLen)); - return hash; -} - -const gencShake = (suffix: number, blockLen: number, outputLen: number) => - createHasher((opts: cShakeOpts = {}) => - cshakePers(new Keccak(blockLen, suffix, chooseLen(opts, outputLen), true), opts) - ); - -export type ITupleHash = { - (messages: Uint8Array[], opts?: cShakeOpts): Uint8Array; - create(opts?: cShakeOpts): _TupleHash; -}; -/** 128-bit NIST cSHAKE XOF. */ -export const cshake128: CHashXOF = /* @__PURE__ */ gencShake(0x1f, 168, 16); -/** 256-bit NIST cSHAKE XOF. */ -export const cshake256: CHashXOF = /* @__PURE__ */ gencShake(0x1f, 136, 32); - -/** Internal KMAC mac class. */ -export class _KMAC extends Keccak implements HashXOF<_KMAC> { - constructor( - blockLen: number, - outputLen: number, - enableXOF: boolean, - key: Uint8Array, - opts: cShakeOpts = {} - ) { - super(blockLen, 0x1f, outputLen, enableXOF); - cshakePers(this, { NISTfn: 'KMAC', personalization: opts.personalization }); - abytes(key, undefined, 'key'); - // 1. newX = bytepad(encode_string(K), 168) || X || right_encode(L). - const blockLenBytes = leftEncode(this.blockLen); - const keyLen = leftEncode(_8n * BigInt(key.length)); - this.update(blockLenBytes).update(keyLen).update(key); - const totalLen = blockLenBytes.length + keyLen.length + key.length; - this.update(getPadding(totalLen, this.blockLen)); - } - protected finish(): void { - if (!this.finished) this.update(rightEncode(this.enableXOF ? 0 : _8n * BigInt(this.outputLen))); // outputLen in bits - super.finish(); - } - _cloneInto(to?: _KMAC): _KMAC { - // Create new instance without calling constructor since key already in state and we don't know it. - // Force "to" to be instance of KMAC instead of Sha3. - if (!to) { - to = Object.create(Object.getPrototypeOf(this), {}) as _KMAC; - to.state = this.state.slice(); - to.blockLen = this.blockLen; - to.state32 = u32(to.state); - } - return super._cloneInto(to) as _KMAC; - } - clone(): _KMAC { - return this._cloneInto(); - } -} - -function genKmac(blockLen: number, outputLen: number, xof = false) { - const kmac = (key: Uint8Array, message: Uint8Array, opts?: cShakeOpts): Uint8Array => - kmac.create(key, opts).update(message).digest(); - kmac.create = (key: Uint8Array, opts: cShakeOpts = {}) => - new _KMAC(blockLen, chooseLen(opts, outputLen), xof, key, opts); - return kmac; -} - -export type IKMAC = { - (key: Uint8Array, message: Uint8Array, opts?: KangarooOpts): Uint8Array; - create(key: Uint8Array, opts?: cShakeOpts): _KMAC; -}; -/** 128-bit Keccak MAC. */ -export const kmac128: IKMAC = /* @__PURE__ */ genKmac(168, 16); -/** 256-bit Keccak MAC. */ -export const kmac256: IKMAC = /* @__PURE__ */ genKmac(136, 32); -/** 128-bit Keccak-MAC XOF. */ -export const kmac128xof: IKMAC = /* @__PURE__ */ genKmac(168, 16, true); -/** 256-bit Keccak-MAC XOF. */ -export const kmac256xof: IKMAC = /* @__PURE__ */ genKmac(136, 32, true); - -/** Internal TupleHash class. */ -export class _TupleHash extends Keccak implements HashXOF<_TupleHash> { - constructor(blockLen: number, outputLen: number, enableXOF: boolean, opts: cShakeOpts = {}) { - super(blockLen, 0x1f, outputLen, enableXOF); - cshakePers(this, { NISTfn: 'TupleHash', personalization: opts.personalization }); - // Change update after cshake processed - this.update = (data: Uint8Array) => { - abytes(data); - super.update(leftEncode(_8n * BigInt(data.length))); - super.update(data); - return this; - }; - } - protected finish(): void { - if (!this.finished) - super.update(rightEncode(this.enableXOF ? 0 : _8n * BigInt(this.outputLen))); // outputLen in bits - super.finish(); - } - _cloneInto(to?: _TupleHash): _TupleHash { - to ||= new _TupleHash(this.blockLen, this.outputLen, this.enableXOF); - return super._cloneInto(to) as _TupleHash; - } - clone(): _TupleHash { - return this._cloneInto(); - } -} - -function genTuple(blockLen: number, outputLen: number, xof = false) { - const tuple = (messages: Uint8Array[], opts?: cShakeOpts): Uint8Array => { - const h = tuple.create(opts); - if (!Array.isArray(messages)) throw new Error('expected array of messages'); - for (const msg of messages) h.update(msg); - return h.digest(); - }; - tuple.create = (opts: cShakeOpts = {}) => - new _TupleHash(blockLen, chooseLen(opts, outputLen), xof, opts); - return tuple; -} - -/** 128-bit TupleHASH. tuple(['ab', 'cd']) != tuple(['a', 'bcd']) */ -export const tuplehash128: ITupleHash = /* @__PURE__ */ genTuple(168, 16); -/** 256-bit TupleHASH. tuple(['ab', 'cd']) != tuple(['a', 'bcd']) */ -export const tuplehash256: ITupleHash = /* @__PURE__ */ genTuple(136, 32); -/** 128-bit TupleHASH XOF. */ -export const tuplehash128xof: ITupleHash = /* @__PURE__ */ genTuple(168, 16, true); -/** 256-bit TupleHASH XOF. */ -export const tuplehash256xof: ITupleHash = /* @__PURE__ */ genTuple(136, 32, true); - -// Same as K12/M14, but without speedup for inputs less 8kb, -// reduced number of rounds and simpler. -type ParallelOpts = KangarooOpts & { blockLen?: number }; - -/** Internal Parallel Keccak Hash class. */ -export class _ParallelHash extends Keccak implements HashXOF<_ParallelHash> { - private leafHash?: Hash; - protected leafCons: () => Hash; - private chunkPos = 0; // Position of current block in chunk - private chunksDone = 0; // How many chunks we already have - private chunkLen: number; - constructor( - blockLen: number, - outputLen: number, - leafCons: () => Hash, - enableXOF: boolean, - opts: ParallelOpts = {} - ) { - super(blockLen, 0x1f, outputLen, enableXOF); - cshakePers(this, { NISTfn: 'ParallelHash', personalization: opts.personalization }); - this.leafCons = leafCons; - let { blockLen: B = 8 } = opts; - anumber(B); - this.chunkLen = B; - super.update(leftEncode(B)); - // Change update after cshake processed - this.update = (data: Uint8Array) => { - abytes(data); - const { chunkLen, leafCons } = this; - for (let pos = 0, len = data.length; pos < len; ) { - if (this.chunkPos == chunkLen || !this.leafHash) { - if (this.leafHash) { - super.update(this.leafHash.digest()); - this.chunksDone++; - } - this.leafHash = leafCons(); - this.chunkPos = 0; - } - const take = Math.min(chunkLen - this.chunkPos, len - pos); - this.leafHash.update(data.subarray(pos, pos + take)); - this.chunkPos += take; - pos += take; - } - return this; - }; - } - protected finish(): void { - if (this.finished) return; - if (this.leafHash) { - super.update(this.leafHash.digest()); - this.chunksDone++; - } - super.update(rightEncode(this.chunksDone)); - super.update(rightEncode(this.enableXOF ? 0 : _8n * BigInt(this.outputLen))); // outputLen in bits - super.finish(); - } - _cloneInto(to?: _ParallelHash): _ParallelHash { - to ||= new _ParallelHash(this.blockLen, this.outputLen, this.leafCons, this.enableXOF); - if (this.leafHash) to.leafHash = this.leafHash._cloneInto(to.leafHash as Keccak); - to.chunkPos = this.chunkPos; - to.chunkLen = this.chunkLen; - to.chunksDone = this.chunksDone; - return super._cloneInto(to) as _ParallelHash; - } - destroy(): void { - super.destroy.call(this); - if (this.leafHash) this.leafHash.destroy(); - } - clone(): _ParallelHash { - return this._cloneInto(); - } -} - -function genPrl( - blockLen: number, - outputLen: number, - leaf: ReturnType, - xof = false -) { - const parallel = (message: Uint8Array, opts?: ParallelOpts): Uint8Array => - parallel.create(opts).update(message).digest(); - parallel.create = (opts: ParallelOpts = {}) => - new _ParallelHash( - blockLen, - chooseLen(opts, outputLen), - () => leaf.create({ dkLen: 2 * outputLen }), - xof, - opts - ); - parallel.outputLen = outputLen; - parallel.blockLen = blockLen; - return parallel; -} - -/** 128-bit ParallelHash. In JS, it is not parallel. */ -export const parallelhash128: CHash = /* @__PURE__ */ genPrl( - 168, - 16, - cshake128 -); -/** 256-bit ParallelHash. In JS, it is not parallel. */ -export const parallelhash256: CHash = /* @__PURE__ */ genPrl( - 136, - 32, - cshake256 -); -/** 128-bit ParallelHash XOF. In JS, it is not parallel. */ -export const parallelhash128xof: CHashXOF = /* @__PURE__ */ genPrl( - 168, - 16, - cshake128, - true -); -/** 256-bit ParallelHash. In JS, it is not parallel. */ -export const parallelhash256xof: CHashXOF = /* @__PURE__ */ genPrl( - 136, - 32, - cshake256, - true -); - -/** D means Domain separation byte */ -export type TurboshakeOpts = ShakeOpts & { - D?: number; -}; - -const genTurbo = (blockLen: number, outputLen: number) => - createHasher((opts: TurboshakeOpts = {}) => { - const D = opts.D === undefined ? 0x1f : opts.D; - // Section 2.1 of https://datatracker.ietf.org/doc/draft-irtf-cfrg-kangarootwelve/17/ - if (!Number.isSafeInteger(D) || D < 0x01 || D > 0x7f) - throw new Error('"D" (domain separation byte) must be 0x01..0x7f, got: ' + D); - return new Keccak(blockLen, D, opts.dkLen === undefined ? outputLen : opts.dkLen, true, 12); - }); - -/** - * TurboSHAKE 128-bit: reduced 12-round keccak. - * Should've been a simple "shake with 12 rounds", but we got a whole new spec about Turbo SHAKE Pro MAX. - */ -export const turboshake128: CHashXOF = /* @__PURE__ */ genTurbo(168, 32); -/** TurboSHAKE 256-bit: reduced 12-round keccak. */ -export const turboshake256: CHashXOF = /* @__PURE__ */ genTurbo(136, 64); - -// Same as NIST rightEncode, but returns [0] for zero string -function rightEncodeK12(n: number | bigint): Uint8Array { - n = BigInt(n); - const res: number[] = []; - for (; n > 0; n >>= _8n) res.unshift(Number(n & _ffn)); - res.push(res.length); - return Uint8Array.from(res); -} - -/** K12 options. */ -export type KangarooOpts = { dkLen?: number; personalization?: Uint8Array }; -const EMPTY_BUFFER = /* @__PURE__ */ Uint8Array.of(); - -/** Internal K12 hash class. */ -export class _KangarooTwelve extends Keccak implements HashXOF<_KangarooTwelve> { - readonly chunkLen = 8192; - private leafHash?: Keccak; - protected leafLen: number; - private personalization: Uint8Array; - private chunkPos = 0; // Position of current block in chunk - private chunksDone = 0; // How many chunks we already have - constructor( - blockLen: number, - leafLen: number, - outputLen: number, - rounds: number, - opts: KangarooOpts - ) { - super(blockLen, 0x07, outputLen, true, rounds); - this.leafLen = leafLen; - this.personalization = abytesOrZero(opts.personalization, 'personalization'); - } - update(data: Uint8Array): this { - abytes(data); - const { chunkLen, blockLen, leafLen, rounds } = this; - for (let pos = 0, len = data.length; pos < len; ) { - if (this.chunkPos == chunkLen) { - if (this.leafHash) super.update(this.leafHash.digest()); - else { - this.suffix = 0x06; // Its safe to change suffix here since its used only in digest() - super.update(Uint8Array.from([3, 0, 0, 0, 0, 0, 0, 0])); - } - this.leafHash = new Keccak(blockLen, 0x0b, leafLen, false, rounds); - this.chunksDone++; - this.chunkPos = 0; - } - const take = Math.min(chunkLen - this.chunkPos, len - pos); - const chunk = data.subarray(pos, pos + take); - if (this.leafHash) this.leafHash.update(chunk); - else super.update(chunk); - this.chunkPos += take; - pos += take; - } - return this; - } - protected finish(): void { - if (this.finished) return; - const { personalization } = this; - this.update(personalization).update(rightEncodeK12(personalization.length)); - // Leaf hash - if (this.leafHash) { - super.update(this.leafHash.digest()); - super.update(rightEncodeK12(this.chunksDone)); - super.update(Uint8Array.from([0xff, 0xff])); - } - super.finish.call(this); - } - destroy(): void { - super.destroy.call(this); - if (this.leafHash) this.leafHash.destroy(); - // We cannot zero personalization buffer since it is user provided and we don't want to mutate user input - this.personalization = EMPTY_BUFFER; - } - _cloneInto(to?: _KangarooTwelve): _KangarooTwelve { - const { blockLen, leafLen, leafHash, outputLen, rounds } = this; - to ||= new _KangarooTwelve(blockLen, leafLen, outputLen, rounds, {}); - super._cloneInto(to); - if (leafHash) to.leafHash = leafHash._cloneInto(to.leafHash); - to.personalization.set(this.personalization); - to.leafLen = this.leafLen; - to.chunkPos = this.chunkPos; - to.chunksDone = this.chunksDone; - return to; - } - clone(): _KangarooTwelve { - return this._cloneInto(); - } -} - -/** 128-bit KangarooTwelve (k12): reduced 12-round keccak. */ -export const kt128: CHash<_KangarooTwelve, KangarooOpts> = /* @__PURE__ */ createHasher( - (opts: KangarooOpts = {}) => new _KangarooTwelve(168, 32, chooseLen(opts, 32), 12, opts) -); -/** 256-bit KangarooTwelve (k12): reduced 12-round keccak. */ -export const kt256: CHash<_KangarooTwelve, KangarooOpts> = /* @__PURE__ */ createHasher( - (opts: KangarooOpts = {}) => new _KangarooTwelve(136, 64, chooseLen(opts, 64), 12, opts) -); - -// MarsupilamiFourteen (14-rounds) can be defined as: -// `new KangarooTwelve(136, 64, chooseLen(opts, 64), 14, opts)` - -/** KangarooTwelve-based MAC options. */ -export type HopMAC = ( - key: Uint8Array, - message: Uint8Array, - personalization: Uint8Array, - dkLen?: number -) => Uint8Array; -const genHopMAC = - (hash: CHash<_KangarooTwelve, KangarooOpts>) => - (key: Uint8Array, message: Uint8Array, personalization: Uint8Array, dkLen?: number): Uint8Array => - hash(key, { personalization: hash(message, { personalization }), dkLen }); - -/** - * 128-bit KangarooTwelve-based MAC. - * - * These untested (there is no test vectors or implementation available). Use at your own risk. - * HopMAC128(Key, M, C, L) = KT128(Key, KT128(M, C, 32), L) - * HopMAC256(Key, M, C, L) = KT256(Key, KT256(M, C, 64), L) - */ -export const HopMAC128: HopMAC = /* @__PURE__ */ genHopMAC(kt128); -/** 256-bit KangarooTwelve-based MAC. */ -export const HopMAC256: HopMAC = /* @__PURE__ */ genHopMAC(kt256); - -/** - * More at https://github.com/XKCP/XKCP/tree/master/lib/high/Keccak/PRG. - */ -export class _KeccakPRG extends Keccak implements PRG { - protected rate: number; - constructor(capacity: number) { - anumber(capacity); - const rate = 1600 - capacity; - const rho = rate - 2; - // Rho must be full bytes - if (capacity < 0 || capacity > 1600 - 10 || rho % 8) throw new Error('invalid capacity'); - // blockLen = rho in bytes - super(rho / 8, 0, 0, true); - this.rate = rate; - this.posOut = Math.floor((rate + 7) / 8); - } - protected keccak(): void { - // Duplex padding - this.state[this.pos] ^= 0x01; - this.state[this.blockLen] ^= 0x02; // Rho is full bytes - super.keccak(); - this.pos = 0; - this.posOut = 0; - } - update(data: Uint8Array): this { - super.update(data); - this.posOut = this.blockLen; - return this; - } - protected finish(): void {} - digestInto(_out: Uint8Array): Uint8Array { - throw new Error('digest is not allowed, use .fetch instead'); - } - addEntropy(seed: Uint8Array): void { - this.update(seed); - } - randomBytes(length: number): Uint8Array { - return this.xof(length); - } - clean(): void { - if (this.rate < 1600 / 2 + 1) throw new Error('rate is too low to use .forget()'); - this.keccak(); - for (let i = 0; i < this.blockLen; i++) this.state[i] = 0; - this.pos = this.blockLen; - this.keccak(); - this.posOut = this.blockLen; - } - _cloneInto(to?: _KeccakPRG): _KeccakPRG { - const { rate } = this; - to ||= new _KeccakPRG(1600 - rate); - super._cloneInto(to); - to.rate = rate; - return to; - } - clone(): _KeccakPRG { - return this._cloneInto(); - } -} - -/** KeccakPRG: Pseudo-random generator based on Keccak. https://keccak.team/files/CSF-0.1.pdf */ -export const keccakprg = (capacity = 254): _KeccakPRG => new _KeccakPRG(capacity); diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/sha3.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/sha3.ts deleted file mode 100644 index cf257fcf..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/sha3.ts +++ /dev/null @@ -1,295 +0,0 @@ -/** - * SHA3 (keccak) hash function, based on a new "Sponge function" design. - * Different from older hashes, the internal state is bigger than output size. - * - * Check out [FIPS-202](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf), - * [Website](https://keccak.team/keccak.html), - * [the differences between SHA-3 and Keccak](https://crypto.stackexchange.com/questions/15727/what-are-the-key-differences-between-the-draft-sha-3-standard-and-the-keccak-sub). - * - * Check out `sha3-addons` module for cSHAKE, k12, and others. - * @module - */ -import { rotlBH, rotlBL, rotlSH, rotlSL, split } from './_u64.ts'; -// prettier-ignore -import { - abytes, aexists, anumber, aoutput, - clean, createHasher, - oidNist, - swap32IfBE, - u32, - type CHash, type CHashXOF, - type Hash, - type HashInfo, - type HashXOF -} from './utils.ts'; - -// No __PURE__ annotations in sha3 header: -// EVERYTHING is in fact used on every export. -// Various per round constants calculations -const _0n = BigInt(0); -const _1n = BigInt(1); -const _2n = BigInt(2); -const _7n = BigInt(7); -const _256n = BigInt(256); -const _0x71n = BigInt(0x71); -const SHA3_PI: number[] = []; -const SHA3_ROTL: number[] = []; -const _SHA3_IOTA: bigint[] = []; // no pure annotation: var is always used -for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) { - // Pi - [x, y] = [y, (2 * x + 3 * y) % 5]; - SHA3_PI.push(2 * (5 * y + x)); - // Rotational - SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64); - // Iota - let t = _0n; - for (let j = 0; j < 7; j++) { - R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n; - if (R & _2n) t ^= _1n << ((_1n << BigInt(j)) - _1n); - } - _SHA3_IOTA.push(t); -} -const IOTAS = split(_SHA3_IOTA, true); -const SHA3_IOTA_H = IOTAS[0]; -const SHA3_IOTA_L = IOTAS[1]; - -// Left rotation (without 0, 32, 64) -const rotlH = (h: number, l: number, s: number) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s)); -const rotlL = (h: number, l: number, s: number) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s)); - -/** `keccakf1600` internal function, additionally allows to adjust round count. */ -export function keccakP(s: Uint32Array, rounds: number = 24): void { - const B = new Uint32Array(5 * 2); - // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js) - for (let round = 24 - rounds; round < 24; round++) { - // Theta θ - for (let x = 0; x < 10; x++) B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40]; - for (let x = 0; x < 10; x += 2) { - const idx1 = (x + 8) % 10; - const idx0 = (x + 2) % 10; - const B0 = B[idx0]; - const B1 = B[idx0 + 1]; - const Th = rotlH(B0, B1, 1) ^ B[idx1]; - const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1]; - for (let y = 0; y < 50; y += 10) { - s[x + y] ^= Th; - s[x + y + 1] ^= Tl; - } - } - // Rho (ρ) and Pi (π) - let curH = s[2]; - let curL = s[3]; - for (let t = 0; t < 24; t++) { - const shift = SHA3_ROTL[t]; - const Th = rotlH(curH, curL, shift); - const Tl = rotlL(curH, curL, shift); - const PI = SHA3_PI[t]; - curH = s[PI]; - curL = s[PI + 1]; - s[PI] = Th; - s[PI + 1] = Tl; - } - // Chi (χ) - for (let y = 0; y < 50; y += 10) { - for (let x = 0; x < 10; x++) B[x] = s[y + x]; - for (let x = 0; x < 10; x++) s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10]; - } - // Iota (ι) - s[0] ^= SHA3_IOTA_H[round]; - s[1] ^= SHA3_IOTA_L[round]; - } - clean(B); -} - -/** Keccak sponge function. */ -export class Keccak implements Hash, HashXOF { - protected state: Uint8Array; - protected pos = 0; - protected posOut = 0; - protected finished = false; - protected state32: Uint32Array; - protected destroyed = false; - - public blockLen: number; - public suffix: number; - public outputLen: number; - protected enableXOF = false; - protected rounds: number; - - // NOTE: we accept arguments in bytes instead of bits here. - constructor( - blockLen: number, - suffix: number, - outputLen: number, - enableXOF = false, - rounds: number = 24 - ) { - this.blockLen = blockLen; - this.suffix = suffix; - this.outputLen = outputLen; - this.enableXOF = enableXOF; - this.rounds = rounds; - // Can be passed from user as dkLen - anumber(outputLen, 'outputLen'); - // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes - // 0 < blockLen < 200 - if (!(0 < blockLen && blockLen < 200)) - throw new Error('only keccak-f1600 function is supported'); - this.state = new Uint8Array(200); - this.state32 = u32(this.state); - } - clone(): Keccak { - return this._cloneInto(); - } - protected keccak(): void { - swap32IfBE(this.state32); - keccakP(this.state32, this.rounds); - swap32IfBE(this.state32); - this.posOut = 0; - this.pos = 0; - } - update(data: Uint8Array): this { - aexists(this); - abytes(data); - const { blockLen, state } = this; - const len = data.length; - for (let pos = 0; pos < len; ) { - const take = Math.min(blockLen - this.pos, len - pos); - for (let i = 0; i < take; i++) state[this.pos++] ^= data[pos++]; - if (this.pos === blockLen) this.keccak(); - } - return this; - } - protected finish(): void { - if (this.finished) return; - this.finished = true; - const { state, suffix, pos, blockLen } = this; - // Do the padding - state[pos] ^= suffix; - if ((suffix & 0x80) !== 0 && pos === blockLen - 1) this.keccak(); - state[blockLen - 1] ^= 0x80; - this.keccak(); - } - protected writeInto(out: Uint8Array): Uint8Array { - aexists(this, false); - abytes(out); - this.finish(); - const bufferOut = this.state; - const { blockLen } = this; - for (let pos = 0, len = out.length; pos < len; ) { - if (this.posOut >= blockLen) this.keccak(); - const take = Math.min(blockLen - this.posOut, len - pos); - out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); - this.posOut += take; - pos += take; - } - return out; - } - xofInto(out: Uint8Array): Uint8Array { - // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF - if (!this.enableXOF) throw new Error('XOF is not possible for this instance'); - return this.writeInto(out); - } - xof(bytes: number): Uint8Array { - anumber(bytes); - return this.xofInto(new Uint8Array(bytes)); - } - digestInto(out: Uint8Array): Uint8Array { - aoutput(out, this); - if (this.finished) throw new Error('digest() was already called'); - this.writeInto(out); - this.destroy(); - return out; - } - digest(): Uint8Array { - return this.digestInto(new Uint8Array(this.outputLen)); - } - destroy(): void { - this.destroyed = true; - clean(this.state); - } - _cloneInto(to?: Keccak): Keccak { - const { blockLen, suffix, outputLen, rounds, enableXOF } = this; - to ||= new Keccak(blockLen, suffix, outputLen, enableXOF, rounds); - to.state32.set(this.state32); - to.pos = this.pos; - to.posOut = this.posOut; - to.finished = this.finished; - to.rounds = rounds; - // Suffix can change in cSHAKE - to.suffix = suffix; - to.outputLen = outputLen; - to.enableXOF = enableXOF; - to.destroyed = this.destroyed; - return to; - } -} - -const genKeccak = (suffix: number, blockLen: number, outputLen: number, info: HashInfo = {}) => - createHasher(() => new Keccak(blockLen, suffix, outputLen), info); - -/** SHA3-224 hash function. */ -export const sha3_224: CHash = /* @__PURE__ */ genKeccak( - 0x06, - 144, - 28, - /* @__PURE__ */ oidNist(0x07) -); -/** SHA3-256 hash function. Different from keccak-256. */ -export const sha3_256: CHash = /* @__PURE__ */ genKeccak( - 0x06, - 136, - 32, - /* @__PURE__ */ oidNist(0x08) -); -/** SHA3-384 hash function. */ -export const sha3_384: CHash = /* @__PURE__ */ genKeccak( - 0x06, - 104, - 48, - /* @__PURE__ */ oidNist(0x09) -); -/** SHA3-512 hash function. */ -export const sha3_512: CHash = /* @__PURE__ */ genKeccak( - 0x06, - 72, - 64, - /* @__PURE__ */ oidNist(0x0a) -); - -/** keccak-224 hash function. */ -export const keccak_224: CHash = /* @__PURE__ */ genKeccak(0x01, 144, 28); -/** keccak-256 hash function. Different from SHA3-256. */ -export const keccak_256: CHash = /* @__PURE__ */ genKeccak(0x01, 136, 32); -/** keccak-384 hash function. */ -export const keccak_384: CHash = /* @__PURE__ */ genKeccak(0x01, 104, 48); -/** keccak-512 hash function. */ -export const keccak_512: CHash = /* @__PURE__ */ genKeccak(0x01, 72, 64); - -/** Options for SHAKE XOF. */ -export type ShakeOpts = { dkLen?: number }; - -const genShake = (suffix: number, blockLen: number, outputLen: number, info: HashInfo = {}) => - createHasher( - (opts: ShakeOpts = {}) => - new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true), - info - ); - -/** SHAKE128 XOF with 128-bit security. */ -export const shake128: CHashXOF = - /* @__PURE__ */ - genShake(0x1f, 168, 16, /* @__PURE__ */ oidNist(0x0b)); -/** SHAKE256 XOF with 256-bit security. */ -export const shake256: CHashXOF = - /* @__PURE__ */ - genShake(0x1f, 136, 32, /* @__PURE__ */ oidNist(0x0c)); - -/** SHAKE128 XOF with 256-bit output (NIST version). */ -export const shake128_32: CHashXOF = - /* @__PURE__ */ - genShake(0x1f, 168, 32, /* @__PURE__ */ oidNist(0x0b)); -/** SHAKE256 XOF with 512-bit output (NIST version). */ -export const shake256_64: CHashXOF = - /* @__PURE__ */ - genShake(0x1f, 136, 64, /* @__PURE__ */ oidNist(0x0c)); diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/utils.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/utils.ts deleted file mode 100644 index 8b3b1a9e..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/utils.ts +++ /dev/null @@ -1,338 +0,0 @@ -/** - * Utilities for hex, bytes, CSPRNG. - * @module - */ -/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */ -export function isBytes(a: unknown): a is Uint8Array { - return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array'); -} - -/** Asserts something is positive integer. */ -export function anumber(n: number, title: string = ''): void { - if (!Number.isSafeInteger(n) || n < 0) { - const prefix = title && `"${title}" `; - throw new Error(`${prefix}expected integer >= 0, got ${n}`); - } -} - -/** Asserts something is Uint8Array. */ -export function abytes(value: Uint8Array, length?: number, title: string = ''): Uint8Array { - const bytes = isBytes(value); - const len = value?.length; - const needsLen = length !== undefined; - if (!bytes || (needsLen && len !== length)) { - const prefix = title && `"${title}" `; - const ofLen = needsLen ? ` of length ${length}` : ''; - const got = bytes ? `length=${len}` : `type=${typeof value}`; - throw new Error(prefix + 'expected Uint8Array' + ofLen + ', got ' + got); - } - return value; -} - -/** Asserts something is hash */ -export function ahash(h: CHash): void { - if (typeof h !== 'function' || typeof h.create !== 'function') - throw new Error('Hash must wrapped by utils.createHasher'); - anumber(h.outputLen); - anumber(h.blockLen); -} - -/** Asserts a hash instance has not been destroyed / finished */ -export function aexists(instance: any, checkFinished = true): void { - if (instance.destroyed) throw new Error('Hash instance has been destroyed'); - if (checkFinished && instance.finished) throw new Error('Hash#digest() has already been called'); -} - -/** Asserts output is properly-sized byte array */ -export function aoutput(out: any, instance: any): void { - abytes(out, undefined, 'digestInto() output'); - const min = instance.outputLen; - if (out.length < min) { - throw new Error('"digestInto() output" expected to be of length >=' + min); - } -} - -/** Generic type encompassing 8/16/32-byte arrays - but not 64-byte. */ -// prettier-ignore -export type TypedArray = Int8Array | Uint8ClampedArray | Uint8Array | - Uint16Array | Int16Array | Uint32Array | Int32Array; - -/** Cast u8 / u16 / u32 to u8. */ -export function u8(arr: TypedArray): Uint8Array { - return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength); -} - -/** Cast u8 / u16 / u32 to u32. */ -export function u32(arr: TypedArray): Uint32Array { - return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); -} - -/** Zeroize a byte array. Warning: JS provides no guarantees. */ -export function clean(...arrays: TypedArray[]): void { - for (let i = 0; i < arrays.length; i++) { - arrays[i].fill(0); - } -} - -/** Create DataView of an array for easy byte-level manipulation. */ -export function createView(arr: TypedArray): DataView { - return new DataView(arr.buffer, arr.byteOffset, arr.byteLength); -} - -/** The rotate right (circular right shift) operation for uint32 */ -export function rotr(word: number, shift: number): number { - return (word << (32 - shift)) | (word >>> shift); -} - -/** The rotate left (circular left shift) operation for uint32 */ -export function rotl(word: number, shift: number): number { - return (word << shift) | ((word >>> (32 - shift)) >>> 0); -} - -/** Is current platform little-endian? Most are. Big-Endian platform: IBM */ -export const isLE: boolean = /* @__PURE__ */ (() => - new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)(); - -/** The byte swap operation for uint32 */ -export function byteSwap(word: number): number { - return ( - ((word << 24) & 0xff000000) | - ((word << 8) & 0xff0000) | - ((word >>> 8) & 0xff00) | - ((word >>> 24) & 0xff) - ); -} -/** Conditionally byte swap if on a big-endian platform */ -export const swap8IfBE: (n: number) => number = isLE - ? (n: number) => n - : (n: number) => byteSwap(n); - -/** In place byte swap for Uint32Array */ -export function byteSwap32(arr: Uint32Array): Uint32Array { - for (let i = 0; i < arr.length; i++) { - arr[i] = byteSwap(arr[i]); - } - return arr; -} - -export const swap32IfBE: (u: Uint32Array) => Uint32Array = isLE - ? (u: Uint32Array) => u - : byteSwap32; - -// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex -const hasHexBuiltin: boolean = /* @__PURE__ */ (() => - // @ts-ignore - typeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function')(); - -// Array where index 0xf0 (240) is mapped to string 'f0' -const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => - i.toString(16).padStart(2, '0') -); - -/** - * Convert byte array to hex string. Uses built-in function, when available. - * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123' - */ -export function bytesToHex(bytes: Uint8Array): string { - abytes(bytes); - // @ts-ignore - if (hasHexBuiltin) return bytes.toHex(); - // pre-caching improves the speed 6x - let hex = ''; - for (let i = 0; i < bytes.length; i++) { - hex += hexes[bytes[i]]; - } - return hex; -} - -// We use optimized technique to convert hex string to byte array -const asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 } as const; -function asciiToBase16(ch: number): number | undefined { - if (ch >= asciis._0 && ch <= asciis._9) return ch - asciis._0; // '2' => 50-48 - if (ch >= asciis.A && ch <= asciis.F) return ch - (asciis.A - 10); // 'B' => 66-(65-10) - if (ch >= asciis.a && ch <= asciis.f) return ch - (asciis.a - 10); // 'b' => 98-(97-10) - return; -} - -/** - * Convert hex string to byte array. Uses built-in function, when available. - * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23]) - */ -export function hexToBytes(hex: string): Uint8Array { - if (typeof hex !== 'string') throw new Error('hex string expected, got ' + typeof hex); - // @ts-ignore - if (hasHexBuiltin) return Uint8Array.fromHex(hex); - const hl = hex.length; - const al = hl / 2; - if (hl % 2) throw new Error('hex string expected, got unpadded hex of length ' + hl); - const array = new Uint8Array(al); - for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) { - const n1 = asciiToBase16(hex.charCodeAt(hi)); - const n2 = asciiToBase16(hex.charCodeAt(hi + 1)); - if (n1 === undefined || n2 === undefined) { - const char = hex[hi] + hex[hi + 1]; - throw new Error('hex string expected, got non-hex character "' + char + '" at index ' + hi); - } - array[ai] = n1 * 16 + n2; // multiply first octet, e.g. 'a3' => 10*16+3 => 160 + 3 => 163 - } - return array; -} - -/** - * There is no setImmediate in browser and setTimeout is slow. - * Call of async fn will return Promise, which will be fullfiled only on - * next scheduler queue processing step and this is exactly what we need. - */ -export const nextTick = async (): Promise => {}; - -/** Returns control to thread each 'tick' ms to avoid blocking. */ -export async function asyncLoop( - iters: number, - tick: number, - cb: (i: number) => void -): Promise { - let ts = Date.now(); - for (let i = 0; i < iters; i++) { - cb(i); - // Date.now() is not monotonic, so in case if clock goes backwards we return return control too - const diff = Date.now() - ts; - if (diff >= 0 && diff < tick) continue; - await nextTick(); - ts += diff; - } -} - -// Global symbols, but ts doesn't see them: https://github.com/microsoft/TypeScript/issues/31535 -declare const TextEncoder: any; - -/** - * Converts string to bytes using UTF8 encoding. - * Built-in doesn't validate input to be string: we do the check. - * @example utf8ToBytes('abc') // Uint8Array.from([97, 98, 99]) - */ -export function utf8ToBytes(str: string): Uint8Array { - if (typeof str !== 'string') throw new Error('string expected'); - return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809 -} - -/** KDFs can accept string or Uint8Array for user convenience. */ -export type KDFInput = string | Uint8Array; - -/** - * Helper for KDFs: consumes uint8array or string. - * When string is passed, does utf8 decoding, using TextDecoder. - */ -export function kdfInputToBytes(data: KDFInput, errorTitle = ''): Uint8Array { - if (typeof data === 'string') return utf8ToBytes(data); - return abytes(data, undefined, errorTitle); -} - -/** Copies several Uint8Arrays into one. */ -export function concatBytes(...arrays: Uint8Array[]): Uint8Array { - let sum = 0; - for (let i = 0; i < arrays.length; i++) { - const a = arrays[i]; - abytes(a); - sum += a.length; - } - const res = new Uint8Array(sum); - for (let i = 0, pad = 0; i < arrays.length; i++) { - const a = arrays[i]; - res.set(a, pad); - pad += a.length; - } - return res; -} - -type EmptyObj = {}; -/** Merges default options and passed options. */ -export function checkOpts( - defaults: T1, - opts?: T2 -): T1 & T2 { - if (opts !== undefined && {}.toString.call(opts) !== '[object Object]') - throw new Error('options must be object or undefined'); - const merged = Object.assign(defaults, opts); - return merged as T1 & T2; -} - -/** Common interface for all hashes. */ -export interface Hash { - blockLen: number; // Bytes per block - outputLen: number; // Bytes in output - update(buf: Uint8Array): this; - digestInto(buf: Uint8Array): void; - digest(): Uint8Array; - destroy(): void; - _cloneInto(to?: T): T; - clone(): T; -} - -/** PseudoRandom (number) Generator */ -export interface PRG { - addEntropy(seed: Uint8Array): void; - randomBytes(length: number): Uint8Array; - clean(): void; -} - -/** - * XOF: streaming API to read digest in chunks. - * Same as 'squeeze' in keccak/k12 and 'seek' in blake3, but more generic name. - * When hash used in XOF mode it is up to user to call '.destroy' afterwards, since we cannot - * destroy state, next call can require more bytes. - */ -export type HashXOF> = Hash & { - xof(bytes: number): Uint8Array; // Read 'bytes' bytes from digest stream - xofInto(buf: Uint8Array): Uint8Array; // read buf.length bytes from digest stream into buf -}; - -/** Hash constructor */ -export type HasherCons = Opts extends undefined ? () => T : (opts?: Opts) => T; -/** Optional hash params. */ -export type HashInfo = { - oid?: Uint8Array; // DER encoded OID in bytes -}; -/** Hash function */ -export type CHash = Hash, Opts = undefined> = { - outputLen: number; - blockLen: number; -} & HashInfo & - (Opts extends undefined - ? { - (msg: Uint8Array): Uint8Array; - create(): T; - } - : { - (msg: Uint8Array, opts?: Opts): Uint8Array; - create(opts?: Opts): T; - }); -/** XOF with output */ -export type CHashXOF = HashXOF, Opts = undefined> = CHash; - -/** Creates function with outputLen, blockLen, create properties from a class constructor. */ -export function createHasher, Opts = undefined>( - hashCons: HasherCons, - info: HashInfo = {} -): CHash { - const hashC: any = (msg: Uint8Array, opts?: Opts) => hashCons(opts).update(msg).digest(); - const tmp = hashCons(undefined); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = (opts?: Opts) => hashCons(opts); - Object.assign(hashC, info); - return Object.freeze(hashC); -} - -/** Cryptographically secure PRNG. Uses internal OS-level `crypto.getRandomValues`. */ -export function randomBytes(bytesLength = 32): Uint8Array { - const cr = typeof globalThis === 'object' ? (globalThis as any).crypto : null; - if (typeof cr?.getRandomValues !== 'function') - throw new Error('crypto.getRandomValues must be defined'); - return cr.getRandomValues(new Uint8Array(bytesLength)); -} - -/** Creates OID opts for NIST hashes, with prefix 06 09 60 86 48 01 65 03 04 02. */ -export const oidNist = (suffix: number): Required => ({ - oid: Uint8Array.from([0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, suffix]), -}); diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/webcrypto.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/webcrypto.ts deleted file mode 100644 index 939554ca..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/src/webcrypto.ts +++ /dev/null @@ -1,168 +0,0 @@ -import { type Pbkdf2Opt } from './pbkdf2.ts'; -import { - abytes, - ahash, - anumber, - checkOpts, - kdfInputToBytes, - type CHash, - type KDFInput, -} from './utils.ts'; - -function _subtle(): typeof crypto.subtle { - const cr = typeof globalThis === 'object' ? (globalThis as any).crypto : null; - const sb = cr?.subtle; - if (typeof sb === 'object' && sb != null) return sb; - throw new Error('crypto.subtle must be defined'); -} - -export type WebHash = { - (msg: Uint8Array): Promise; - webCryptoName: string; - outputLen: number; - blockLen: number; -}; - -function createWebHash(name: string, blockLen: number, outputLen: number): WebHash { - const hashC: any = async (msg: Uint8Array) => { - abytes(msg); - const crypto = _subtle(); - return new Uint8Array(await crypto.digest(name, msg as BufferSource)); - }; - hashC.webCryptoName = name; // make sure it won't interfere with function name - hashC.outputLen = outputLen; - hashC.blockLen = blockLen; - hashC.create = () => { - throw new Error('not implemented'); - }; - return hashC; -} - -function ahashWeb(hash: WebHash) { - ahash(hash as any as CHash); - if (typeof hash.webCryptoName !== 'string') throw new Error('non-web hash'); -} - -/** WebCrypto SHA1 (RFC 3174) legacy hash function. It was cryptographically broken. */ -// export const sha1: WebHash = createHash('SHA-1', 64, 20); - -/** WebCrypto SHA2-256 hash function from RFC 4634. */ -export const sha256: WebHash = /* @__PURE__ */ createWebHash('SHA-256', 64, 32); -/** WebCrypto SHA2-384 hash function from RFC 4634. */ -export const sha384: WebHash = /* @__PURE__ */ createWebHash('SHA-384', 128, 48); -/** WebCrypto SHA2-512 hash function from RFC 4634. */ -export const sha512: WebHash = /* @__PURE__ */ createWebHash('SHA-512', 128, 64); - -/** - * WebCrypto HMAC: RFC2104 message authentication code. - * @param hash - function that would be used e.g. sha256. Webcrypto version. - * @param key - key which would be used to authenticate message - * @param message - message - * @example - * ```js - * import { hmac, sha256 } from '@noble/hashes/webcrypto.js'; - * const mac1 = await hmac(sha256, 'key', 'message'); - * ``` - */ -export const hmac: { - (hash: WebHash, key: Uint8Array, message: Uint8Array): Promise; - create(hash: WebHash, key: Uint8Array): any; -} = /* @__PURE__ */ (() => { - const hmac_ = async ( - hash: WebHash, - key: Uint8Array, - message: Uint8Array - ): Promise => { - const crypto = _subtle(); - abytes(key, undefined, 'key'); - abytes(message, undefined, 'message'); - ahashWeb(hash); - // WebCrypto keys can't be zeroized - // prettier-ignore - const wkey = await crypto.importKey( - 'raw', - key as BufferSource, - { name: 'HMAC', hash: hash.webCryptoName }, - false, - ['sign'] - ); - return new Uint8Array(await crypto.sign('HMAC', wkey, message as BufferSource)); - }; - hmac_.create = (_hash: WebHash, _key: Uint8Array) => { - throw new Error('not implemented'); - }; - return hmac_; -})(); - -/** - * WebCrypto HKDF (RFC 5869): derive keys from an initial input. - * Combines hkdf_extract + hkdf_expand in one step - * @param hash - hash function that would be used (e.g. sha256). Webcrypto version. - * @param ikm - input keying material, the initial key - * @param salt - optional salt value (a non-secret random value) - * @param info - optional context and application specific information (can be a zero-length string) - * @param length - length of output keying material in bytes - * @example - * ```js - * import { hkdf, sha256 } from '@noble/hashes/webcrypto.js'; - * import { randomBytes } from '@noble/hashes/utils.js'; - * const inputKey = randomBytes(32); - * const salt = randomBytes(32); - * const info = 'application-key'; - * const hk1w = await hkdf(sha256, inputKey, salt, info, 32); - * ``` - */ -export async function hkdf( - hash: WebHash, - ikm: Uint8Array, - salt: Uint8Array | undefined, - info: Uint8Array | undefined, - length: number -): Promise { - const crypto = _subtle(); - ahashWeb(hash); - abytes(ikm, undefined, 'ikm'); - anumber(length, 'length'); - if (salt !== undefined) abytes(salt, undefined, 'salt'); - if (info !== undefined) abytes(info, undefined, 'info'); - const wkey = await crypto.importKey('raw', ikm as BufferSource, 'HKDF', false, ['deriveBits']); - const opts = { - name: 'HKDF', - hash: hash.webCryptoName, - salt: salt === undefined ? new Uint8Array(0) : salt, - info: info === undefined ? new Uint8Array(0) : info, - }; - return new Uint8Array(await crypto.deriveBits(opts, wkey, 8 * length)); -} - -/** - * WebCrypto PBKDF2-HMAC: RFC 2898 key derivation function - * @param hash - hash function that would be used e.g. sha256. Webcrypto version. - * @param password - password from which a derived key is generated - * @param salt - cryptographic salt - * @param opts - {c, dkLen} where c is work factor and dkLen is output message size - * @example - * ```js - * const key = await pbkdf2(sha256, 'password', 'salt', { dkLen: 32, c: Math.pow(2, 18) }); - * ``` - */ -export async function pbkdf2( - hash: WebHash, - password: KDFInput, - salt: KDFInput, - opts: Pbkdf2Opt -): Promise { - const crypto = _subtle(); - ahashWeb(hash); - const _opts = checkOpts({ dkLen: 32 }, opts); - const { c, dkLen } = _opts; - anumber(c, 'c'); - anumber(dkLen, 'dkLen'); - const _password = kdfInputToBytes(password, 'password'); - const _salt = kdfInputToBytes(salt, 'salt'); - const key = await crypto.importKey('raw', _password as BufferSource, 'PBKDF2', false, [ - 'deriveBits', - ]); - const deriveOpts = { name: 'PBKDF2', salt: _salt, iterations: c, hash: hash.webCryptoName }; - return new Uint8Array(await crypto.deriveBits(deriveOpts, key, 8 * dkLen)); -} diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/utils.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/utils.d.ts deleted file mode 100644 index be4af4f3..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/utils.d.ts +++ /dev/null @@ -1,130 +0,0 @@ -/** - * Utilities for hex, bytes, CSPRNG. - * @module - */ -/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */ -export declare function isBytes(a: unknown): a is Uint8Array; -/** Asserts something is positive integer. */ -export declare function anumber(n: number, title?: string): void; -/** Asserts something is Uint8Array. */ -export declare function abytes(value: Uint8Array, length?: number, title?: string): Uint8Array; -/** Asserts something is hash */ -export declare function ahash(h: CHash): void; -/** Asserts a hash instance has not been destroyed / finished */ -export declare function aexists(instance: any, checkFinished?: boolean): void; -/** Asserts output is properly-sized byte array */ -export declare function aoutput(out: any, instance: any): void; -/** Generic type encompassing 8/16/32-byte arrays - but not 64-byte. */ -export type TypedArray = Int8Array | Uint8ClampedArray | Uint8Array | Uint16Array | Int16Array | Uint32Array | Int32Array; -/** Cast u8 / u16 / u32 to u8. */ -export declare function u8(arr: TypedArray): Uint8Array; -/** Cast u8 / u16 / u32 to u32. */ -export declare function u32(arr: TypedArray): Uint32Array; -/** Zeroize a byte array. Warning: JS provides no guarantees. */ -export declare function clean(...arrays: TypedArray[]): void; -/** Create DataView of an array for easy byte-level manipulation. */ -export declare function createView(arr: TypedArray): DataView; -/** The rotate right (circular right shift) operation for uint32 */ -export declare function rotr(word: number, shift: number): number; -/** The rotate left (circular left shift) operation for uint32 */ -export declare function rotl(word: number, shift: number): number; -/** Is current platform little-endian? Most are. Big-Endian platform: IBM */ -export declare const isLE: boolean; -/** The byte swap operation for uint32 */ -export declare function byteSwap(word: number): number; -/** Conditionally byte swap if on a big-endian platform */ -export declare const swap8IfBE: (n: number) => number; -/** In place byte swap for Uint32Array */ -export declare function byteSwap32(arr: Uint32Array): Uint32Array; -export declare const swap32IfBE: (u: Uint32Array) => Uint32Array; -/** - * Convert byte array to hex string. Uses built-in function, when available. - * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123' - */ -export declare function bytesToHex(bytes: Uint8Array): string; -/** - * Convert hex string to byte array. Uses built-in function, when available. - * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23]) - */ -export declare function hexToBytes(hex: string): Uint8Array; -/** - * There is no setImmediate in browser and setTimeout is slow. - * Call of async fn will return Promise, which will be fullfiled only on - * next scheduler queue processing step and this is exactly what we need. - */ -export declare const nextTick: () => Promise; -/** Returns control to thread each 'tick' ms to avoid blocking. */ -export declare function asyncLoop(iters: number, tick: number, cb: (i: number) => void): Promise; -/** - * Converts string to bytes using UTF8 encoding. - * Built-in doesn't validate input to be string: we do the check. - * @example utf8ToBytes('abc') // Uint8Array.from([97, 98, 99]) - */ -export declare function utf8ToBytes(str: string): Uint8Array; -/** KDFs can accept string or Uint8Array for user convenience. */ -export type KDFInput = string | Uint8Array; -/** - * Helper for KDFs: consumes uint8array or string. - * When string is passed, does utf8 decoding, using TextDecoder. - */ -export declare function kdfInputToBytes(data: KDFInput, errorTitle?: string): Uint8Array; -/** Copies several Uint8Arrays into one. */ -export declare function concatBytes(...arrays: Uint8Array[]): Uint8Array; -type EmptyObj = {}; -/** Merges default options and passed options. */ -export declare function checkOpts(defaults: T1, opts?: T2): T1 & T2; -/** Common interface for all hashes. */ -export interface Hash { - blockLen: number; - outputLen: number; - update(buf: Uint8Array): this; - digestInto(buf: Uint8Array): void; - digest(): Uint8Array; - destroy(): void; - _cloneInto(to?: T): T; - clone(): T; -} -/** PseudoRandom (number) Generator */ -export interface PRG { - addEntropy(seed: Uint8Array): void; - randomBytes(length: number): Uint8Array; - clean(): void; -} -/** - * XOF: streaming API to read digest in chunks. - * Same as 'squeeze' in keccak/k12 and 'seek' in blake3, but more generic name. - * When hash used in XOF mode it is up to user to call '.destroy' afterwards, since we cannot - * destroy state, next call can require more bytes. - */ -export type HashXOF> = Hash & { - xof(bytes: number): Uint8Array; - xofInto(buf: Uint8Array): Uint8Array; -}; -/** Hash constructor */ -export type HasherCons = Opts extends undefined ? () => T : (opts?: Opts) => T; -/** Optional hash params. */ -export type HashInfo = { - oid?: Uint8Array; -}; -/** Hash function */ -export type CHash = Hash, Opts = undefined> = { - outputLen: number; - blockLen: number; -} & HashInfo & (Opts extends undefined ? { - (msg: Uint8Array): Uint8Array; - create(): T; -} : { - (msg: Uint8Array, opts?: Opts): Uint8Array; - create(opts?: Opts): T; -}); -/** XOF with output */ -export type CHashXOF = HashXOF, Opts = undefined> = CHash; -/** Creates function with outputLen, blockLen, create properties from a class constructor. */ -export declare function createHasher, Opts = undefined>(hashCons: HasherCons, info?: HashInfo): CHash; -/** Cryptographically secure PRNG. Uses internal OS-level `crypto.getRandomValues`. */ -export declare function randomBytes(bytesLength?: number): Uint8Array; -/** Creates OID opts for NIST hashes, with prefix 06 09 60 86 48 01 65 03 04 02. */ -export declare const oidNist: (suffix: number) => Required; -export {}; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/utils.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/utils.d.ts.map deleted file mode 100644 index 40bbb0c4..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,sEAAsE;AACtE,qFAAqF;AACrF,wBAAgB,OAAO,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,UAAU,CAEnD;AAED,6CAA6C;AAC7C,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,GAAE,MAAW,GAAG,IAAI,CAK3D;AAED,uCAAuC;AACvC,wBAAgB,MAAM,CAAC,KA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AC;IAC9B,MAAM,IAAI,CAAC,CAAC;CACb,GACD;IACE,CAAC,GAAG,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,UAAU,CAAC;IAC3C,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC;CACxB,CAAC,CAAC;AACT,sBAAsB;AACtB,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,SAAS,IAAI,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;AAE7F,6FAA6F;AAC7F,wBAAgB,YAAY,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,GAAG,SAAS,EAC9D,QAAQ,EAAE,UAAU,CAAC,CAAC,EAAE,IAAI,CAAC,EAC7B,IAAI,GAAE,QAAa,GAClB,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAQhB;AAED,sFAAsF;AACtF,wBAAgB,WAAW,CAAC,WAAW,SAAK,GAAG,UAAU,CAKxD;AAED,mFAAmF;AACnF,eAAO,MAAM,OAAO,GAAI,QAAQ,MAAM,KAAG,QAAQ,CAAC,QAAQ,CAExD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/utils.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/utils.js deleted file mode 100644 index f8b81c1a..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/utils.js +++ /dev/null @@ -1,242 +0,0 @@ -/** - * Utilities for hex, bytes, CSPRNG. - * @module - */ -/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */ -export function isBytes(a) { - return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array'); -} -/** Asserts something is positive integer. */ -export function anumber(n, title = '') { - if (!Number.isSafeInteger(n) || n < 0) { - const prefix = title && `"${title}" `; - throw new Error(`${prefix}expected integer >= 0, got ${n}`); - } -} -/** Asserts something is Uint8Array. */ -export function abytes(value, length, title = '') { - const bytes = isBytes(value); - const len = value?.length; - const needsLen = length !== undefined; - if (!bytes || (needsLen && len !== length)) { - const prefix = title && `"${title}" `; - const ofLen = needsLen ? ` of length ${length}` : ''; - const got = bytes ? `length=${len}` : `type=${typeof value}`; - throw new Error(prefix + 'expected Uint8Array' + ofLen + ', got ' + got); - } - return value; -} -/** Asserts something is hash */ -export function ahash(h) { - if (typeof h !== 'function' || typeof h.create !== 'function') - throw new Error('Hash must wrapped by utils.createHasher'); - anumber(h.outputLen); - anumber(h.blockLen); -} -/** Asserts a hash instance has not been destroyed / finished */ -export function aexists(instance, checkFinished = true) { - if (instance.destroyed) - throw new Error('Hash instance has been destroyed'); - if (checkFinished && instance.finished) - throw new Error('Hash#digest() has already been called'); -} -/** Asserts output is properly-sized byte array */ -export function aoutput(out, instance) { - abytes(out, undefined, 'digestInto() output'); - const min = instance.outputLen; - if (out.length < min) { - throw new Error('"digestInto() output" expected to be of length >=' + min); - } -} -/** Cast u8 / u16 / u32 to u8. */ -export function u8(arr) { - return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength); -} -/** Cast u8 / u16 / u32 to u32. */ -export function u32(arr) { - return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); -} -/** Zeroize a byte array. Warning: JS provides no guarantees. */ -export function clean(...arrays) { - for (let i = 0; i < arrays.length; i++) { - arrays[i].fill(0); - } -} -/** Create DataView of an array for easy byte-level manipulation. */ -export function createView(arr) { - return new DataView(arr.buffer, arr.byteOffset, arr.byteLength); -} -/** The rotate right (circular right shift) operation for uint32 */ -export function rotr(word, shift) { - return (word << (32 - shift)) | (word >>> shift); -} -/** The rotate left (circular left shift) operation for uint32 */ -export function rotl(word, shift) { - return (word << shift) | ((word >>> (32 - shift)) >>> 0); -} -/** Is current platform little-endian? Most are. Big-Endian platform: IBM */ -export const isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)(); -/** The byte swap operation for uint32 */ -export function byteSwap(word) { - return (((word << 24) & 0xff000000) | - ((word << 8) & 0xff0000) | - ((word >>> 8) & 0xff00) | - ((word >>> 24) & 0xff)); -} -/** Conditionally byte swap if on a big-endian platform */ -export const swap8IfBE = isLE - ? (n) => n - : (n) => byteSwap(n); -/** In place byte swap for Uint32Array */ -export function byteSwap32(arr) { - for (let i = 0; i < arr.length; i++) { - arr[i] = byteSwap(arr[i]); - } - return arr; -} -export const swap32IfBE = isLE - ? (u) => u - : byteSwap32; -// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex -const hasHexBuiltin = /* @__PURE__ */ (() => -// @ts-ignore -typeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function')(); -// Array where index 0xf0 (240) is mapped to string 'f0' -const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0')); -/** - * Convert byte array to hex string. Uses built-in function, when available. - * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123' - */ -export function bytesToHex(bytes) { - abytes(bytes); - // @ts-ignore - if (hasHexBuiltin) - return bytes.toHex(); - // pre-caching improves the speed 6x - let hex = ''; - for (let i = 0; i < bytes.length; i++) { - hex += hexes[bytes[i]]; - } - return hex; -} -// We use optimized technique to convert hex string to byte array -const asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 }; -function asciiToBase16(ch) { - if (ch >= asciis._0 && ch <= asciis._9) - return ch - asciis._0; // '2' => 50-48 - if (ch >= asciis.A && ch <= asciis.F) - return ch - (asciis.A - 10); // 'B' => 66-(65-10) - if (ch >= asciis.a && ch <= asciis.f) - return ch - (asciis.a - 10); // 'b' => 98-(97-10) - return; -} -/** - * Convert hex string to byte array. Uses built-in function, when available. - * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23]) - */ -export function hexToBytes(hex) { - if (typeof hex !== 'string') - throw new Error('hex string expected, got ' + typeof hex); - // @ts-ignore - if (hasHexBuiltin) - return Uint8Array.fromHex(hex); - const hl = hex.length; - const al = hl / 2; - if (hl % 2) - throw new Error('hex string expected, got unpadded hex of length ' + hl); - const array = new Uint8Array(al); - for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) { - const n1 = asciiToBase16(hex.charCodeAt(hi)); - const n2 = asciiToBase16(hex.charCodeAt(hi + 1)); - if (n1 === undefined || n2 === undefined) { - const char = hex[hi] + hex[hi + 1]; - throw new Error('hex string expected, got non-hex character "' + char + '" at index ' + hi); - } - array[ai] = n1 * 16 + n2; // multiply first octet, e.g. 'a3' => 10*16+3 => 160 + 3 => 163 - } - return array; -} -/** - * There is no setImmediate in browser and setTimeout is slow. - * Call of async fn will return Promise, which will be fullfiled only on - * next scheduler queue processing step and this is exactly what we need. - */ -export const nextTick = async () => { }; -/** Returns control to thread each 'tick' ms to avoid blocking. */ -export async function asyncLoop(iters, tick, cb) { - let ts = Date.now(); - for (let i = 0; i < iters; i++) { - cb(i); - // Date.now() is not monotonic, so in case if clock goes backwards we return return control too - const diff = Date.now() - ts; - if (diff >= 0 && diff < tick) - continue; - await nextTick(); - ts += diff; - } -} -/** - * Converts string to bytes using UTF8 encoding. - * Built-in doesn't validate input to be string: we do the check. - * @example utf8ToBytes('abc') // Uint8Array.from([97, 98, 99]) - */ -export function utf8ToBytes(str) { - if (typeof str !== 'string') - throw new Error('string expected'); - return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809 -} -/** - * Helper for KDFs: consumes uint8array or string. - * When string is passed, does utf8 decoding, using TextDecoder. - */ -export function kdfInputToBytes(data, errorTitle = '') { - if (typeof data === 'string') - return utf8ToBytes(data); - return abytes(data, undefined, errorTitle); -} -/** Copies several Uint8Arrays into one. */ -export function concatBytes(...arrays) { - let sum = 0; - for (let i = 0; i < arrays.length; i++) { - const a = arrays[i]; - abytes(a); - sum += a.length; - } - const res = new Uint8Array(sum); - for (let i = 0, pad = 0; i < arrays.length; i++) { - const a = arrays[i]; - res.set(a, pad); - pad += a.length; - } - return res; -} -/** Merges default options and passed options. */ -export function checkOpts(defaults, opts) { - if (opts !== undefined && {}.toString.call(opts) !== '[object Object]') - throw new Error('options must be object or undefined'); - const merged = Object.assign(defaults, opts); - return merged; -} -/** Creates function with outputLen, blockLen, create properties from a class constructor. */ -export function createHasher(hashCons, info = {}) { - const hashC = (msg, opts) => hashCons(opts).update(msg).digest(); - const tmp = hashCons(undefined); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = (opts) => hashCons(opts); - Object.assign(hashC, info); - return Object.freeze(hashC); -} -/** Cryptographically secure PRNG. Uses internal OS-level `crypto.getRandomValues`. */ -export function randomBytes(bytesLength = 32) { - const cr = typeof globalThis === 'object' ? globalThis.crypto : null; - if (typeof cr?.getRandomValues !== 'function') - throw new Error('crypto.getRandomValues must be defined'); - return cr.getRandomValues(new Uint8Array(bytesLength)); -} -/** Creates OID opts for NIST hashes, with prefix 06 09 60 86 48 01 65 03 04 02. */ -export const oidNist = (suffix) => ({ - oid: Uint8Array.from([0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, suffix]), -}); -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/utils.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/utils.js.map deleted file mode 100644 index de76cb1c..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,sEAAsE;AACtE,qFAAqF;AACrF,MA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C,IAAI,CAAC,CAAC;IAC/C,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC3B,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC;AAED,sFAAsF;AACtF,MAAM,UAAU,WAAW,CAAC,WAAW,GAAG,EAAE;IAC1C,MAAM,EAAE,GAAG,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAE,UAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;IAC9E,IAAI,OAAO,EAAE,EAAE,eAAe,KAAK,UAAU;QAC3C,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC5D,OAAO,EAAE,CAAC,eAAe,CAAC,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC;AACzD,CAAC;AAED,mFAAmF;AACnF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,MAAc,EAAsB,EAAE,CAAC,CAAC;IAC9D,GAAG,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;CAC3F,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/webcrypto.d.ts b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/webcrypto.d.ts deleted file mode 100644 index 59363732..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/webcrypto.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { type Pbkdf2Opt } from './pbkdf2.ts'; -import { type KDFInput } from './utils.ts'; -export type WebHash = { - (msg: Uint8Array): Promise; - webCryptoName: string; - outputLen: number; - blockLen: number; -}; -/** WebCrypto SHA1 (RFC 3174) legacy hash function. It was cryptographically broken. */ -/** WebCrypto SHA2-256 hash function from RFC 4634. */ -export declare const sha256: WebHash; -/** WebCrypto SHA2-384 hash function from RFC 4634. */ -export declare const sha384: WebHash; -/** WebCrypto SHA2-512 hash function from RFC 4634. */ -export declare const sha512: WebHash; -/** - * WebCrypto HMAC: RFC2104 message authentication code. - * @param hash - function that would be used e.g. sha256. Webcrypto version. - * @param key - key which would be used to authenticate message - * @param message - message - * @example - * ```js - * import { hmac, sha256 } from '@noble/hashes/webcrypto.js'; - * const mac1 = await hmac(sha256, 'key', 'message'); - * ``` - */ -export declare const hmac: { - (hash: WebHash, key: Uint8Array, message: Uint8Array): Promise; - create(hash: WebHash, key: Uint8Array): any; -}; -/** - * WebCrypto HKDF (RFC 5869): derive keys from an initial input. - * Combines hkdf_extract + hkdf_expand in one step - * @param hash - hash function that would be used (e.g. sha256). Webcrypto version. - * @param ikm - input keying material, the initial key - * @param salt - optional salt value (a non-secret random value) - * @param info - optional context and application specific information (can be a zero-length string) - * @param length - length of output keying material in bytes - * @example - * ```js - * import { hkdf, sha256 } from '@noble/hashes/webcrypto.js'; - * import { randomBytes } from '@noble/hashes/utils.js'; - * const inputKey = randomBytes(32); - * const salt = randomBytes(32); - * const info = 'application-key'; - * const hk1w = await hkdf(sha256, inputKey, salt, info, 32); - * ``` - */ -export declare function hkdf(hash: WebHash, ikm: Uint8Array, salt: Uint8Array | undefined, info: Uint8Array | undefined, length: number): Promise; -/** - * WebCrypto PBKDF2-HMAC: RFC 2898 key derivation function - * @param hash - hash function that would be used e.g. sha256. Webcrypto version. - * @param password - password from which a derived key is generated - * @param salt - cryptographic salt - * @param opts - {c, dkLen} where c is work factor and dkLen is output message size - * @example - * ```js - * const key = await pbkdf2(sha256, 'password', 'salt', { dkLen: 32, c: Math.pow(2, 18) }); - * ``` - */ -export declare function pbkdf2(hash: WebHash, password: KDFInput, salt: KDFInput, opts: Pbkdf2Opt): Promise; -//# sourceMappingURL=webcrypto.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/webcrypto.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/webcrypto.d.ts.map deleted file mode 100644 index f9fe0b02..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/webcrypto.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"webcrypto.d.ts","sourceRoot":"","sources":["src/webcrypto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAOL,KAAK,QAAQ,EACd,MAAM,YAAY,CAAC;AASpB,MAAM,MAAM,OAAO,GAAG;IACpB,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACvC,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAsBF,uFAAuF;AAGvF,sDAAsD;AACtD,eAAO,MAAM,MAAM,EAAE,OAA0D,CAAC;AAChF,sDAAsD;AACtD,eAAO,MAAM,MAAM,EAAE,OAA2D,CAAC;AACjF,sDAAsD;AACtD,eAAO,MAAM,MAAM,EAAE,OAA2D,CAAC;AAEjF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,IAAI,EAAE;IACjB,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAC3E,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,GAAG,GAAG,CAAC;CA0B1C,CAAC;AAEL;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,IAAI,CACxB,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,UAAU,EACf,IAAI,EAAE,UAAU,GAAG,SAAS,EAC5B,IAAI,EAAE,UAAU,GAAG,SAAS,EAC5B,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,UAAU,CAAC,CAerB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,MAAM,CAC1B,IAAI,EAAE,OAAO,EACb,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,SAAS,GACd,OAAO,CAAC,UAAU,CAAC,CAcrB"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/webcrypto.js b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/webcrypto.js deleted file mode 100644 index df96f363..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/webcrypto.js +++ /dev/null @@ -1,126 +0,0 @@ -import {} from "./pbkdf2.js"; -import { abytes, ahash, anumber, checkOpts, kdfInputToBytes, } from "./utils.js"; -function _subtle() { - const cr = typeof globalThis === 'object' ? globalThis.crypto : null; - const sb = cr?.subtle; - if (typeof sb === 'object' && sb != null) - return sb; - throw new Error('crypto.subtle must be defined'); -} -function createWebHash(name, blockLen, outputLen) { - const hashC = async (msg) => { - abytes(msg); - const crypto = _subtle(); - return new Uint8Array(await crypto.digest(name, msg)); - }; - hashC.webCryptoName = name; // make sure it won't interfere with function name - hashC.outputLen = outputLen; - hashC.blockLen = blockLen; - hashC.create = () => { - throw new Error('not implemented'); - }; - return hashC; -} -function ahashWeb(hash) { - ahash(hash); - if (typeof hash.webCryptoName !== 'string') - throw new Error('non-web hash'); -} -/** WebCrypto SHA1 (RFC 3174) legacy hash function. It was cryptographically broken. */ -// export const sha1: WebHash = createHash('SHA-1', 64, 20); -/** WebCrypto SHA2-256 hash function from RFC 4634. */ -export const sha256 = /* @__PURE__ */ createWebHash('SHA-256', 64, 32); -/** WebCrypto SHA2-384 hash function from RFC 4634. */ -export const sha384 = /* @__PURE__ */ createWebHash('SHA-384', 128, 48); -/** WebCrypto SHA2-512 hash function from RFC 4634. */ -export const sha512 = /* @__PURE__ */ createWebHash('SHA-512', 128, 64); -/** - * WebCrypto HMAC: RFC2104 message authentication code. - * @param hash - function that would be used e.g. sha256. Webcrypto version. - * @param key - key which would be used to authenticate message - * @param message - message - * @example - * ```js - * import { hmac, sha256 } from '@noble/hashes/webcrypto.js'; - * const mac1 = await hmac(sha256, 'key', 'message'); - * ``` - */ -export const hmac = /* @__PURE__ */ (() => { - const hmac_ = async (hash, key, message) => { - const crypto = _subtle(); - abytes(key, undefined, 'key'); - abytes(message, undefined, 'message'); - ahashWeb(hash); - // WebCrypto keys can't be zeroized - // prettier-ignore - const wkey = await crypto.importKey('raw', key, { name: 'HMAC', hash: hash.webCryptoName }, false, ['sign']); - return new Uint8Array(await crypto.sign('HMAC', wkey, message)); - }; - hmac_.create = (_hash, _key) => { - throw new Error('not implemented'); - }; - return hmac_; -})(); -/** - * WebCrypto HKDF (RFC 5869): derive keys from an initial input. - * Combines hkdf_extract + hkdf_expand in one step - * @param hash - hash function that would be used (e.g. sha256). Webcrypto version. - * @param ikm - input keying material, the initial key - * @param salt - optional salt value (a non-secret random value) - * @param info - optional context and application specific information (can be a zero-length string) - * @param length - length of output keying material in bytes - * @example - * ```js - * import { hkdf, sha256 } from '@noble/hashes/webcrypto.js'; - * import { randomBytes } from '@noble/hashes/utils.js'; - * const inputKey = randomBytes(32); - * const salt = randomBytes(32); - * const info = 'application-key'; - * const hk1w = await hkdf(sha256, inputKey, salt, info, 32); - * ``` - */ -export async function hkdf(hash, ikm, salt, info, length) { - const crypto = _subtle(); - ahashWeb(hash); - abytes(ikm, undefined, 'ikm'); - anumber(length, 'length'); - if (salt !== undefined) - abytes(salt, undefined, 'salt'); - if (info !== undefined) - abytes(info, undefined, 'info'); - const wkey = await crypto.importKey('raw', ikm, 'HKDF', false, ['deriveBits']); - const opts = { - name: 'HKDF', - hash: hash.webCryptoName, - salt: salt === undefined ? new Uint8Array(0) : salt, - info: info === undefined ? new Uint8Array(0) : info, - }; - return new Uint8Array(await crypto.deriveBits(opts, wkey, 8 * length)); -} -/** - * WebCrypto PBKDF2-HMAC: RFC 2898 key derivation function - * @param hash - hash function that would be used e.g. sha256. Webcrypto version. - * @param password - password from which a derived key is generated - * @param salt - cryptographic salt - * @param opts - {c, dkLen} where c is work factor and dkLen is output message size - * @example - * ```js - * const key = await pbkdf2(sha256, 'password', 'salt', { dkLen: 32, c: Math.pow(2, 18) }); - * ``` - */ -export async function pbkdf2(hash, password, salt, opts) { - const crypto = _subtle(); - ahashWeb(hash); - const _opts = checkOpts({ dkLen: 32 }, opts); - const { c, dkLen } = _opts; - anumber(c, 'c'); - anumber(dkLen, 'dkLen'); - const _password = kdfInputToBytes(password, 'password'); - const _salt = kdfInputToBytes(salt, 'salt'); - const key = await crypto.importKey('raw', _password, 'PBKDF2', false, [ - 'deriveBits', - ]); - const deriveOpts = { name: 'PBKDF2', salt: _salt, iterations: c, hash: hash.webCryptoName }; - return new Uint8Array(await crypto.deriveBits(deriveOpts, key, 8 * dkLen)); -} -//# sourceMappingURL=webcrypto.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/webcrypto.js.map b/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/webcrypto.js.map deleted file mode 100644 index 53fa3ef8..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/node_modules/@noble/hashes/webcrypto.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"webcrypto.js","sourceRoot":"","sources":["src/webcrypto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,MAAM,aAAa,CAAC;AAC7C,OAAO,EACL,MAAM,EACN,KAAK,EACL,OAAO,EACP,SAAS,EACT,eAAe,GAGhB,MAAM,YAAY,CAAC;AAEpB,SAAS,OAAO;IACd,MAAM,EAAE,GAAG,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAE,UAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;IAC9E,MAAM,EAAE,GAA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AAO,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACxB,MAAM,SAAS,GAAG,eAAe,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IACxD,MAAM,KAAK,GAAG,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC5C,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,SAAyB,EAAE,QAAQ,EAAE,KAAK,EAAE;QACpF,YAAY;KACb,CAAC,CAAC;IACH,MAAM,UAAU,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC;IAC5F,OAAO,IAAI,UAAU,CAAC,MAAM,MAAM,CAAC,UAAU,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;AAC7E,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip32/package.json b/tools/mnemonic-test/node_modules/@scure/bip32/package.json deleted file mode 100644 index 11424747..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip32/package.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "name": "@scure/bip32", - "version": "2.0.1", - "description": "Secure, audited & minimal implementation of BIP32 hierarchical deterministic (HD) wallets over secp256k1", - "files": [ - "index.js", - "index.js.map", - "index.d.ts", - "index.d.ts.map", - "index.ts" - ], - "dependencies": { - "@noble/curves": "2.0.1", - "@noble/hashes": "2.0.1", - "@scure/base": "2.0.0" - }, - "devDependencies": { - "@paulmillr/jsbt": "0.4.4", - "prettier": "3.6.2", - "typescript": "5.9.2" - }, - "scripts": { - "build": "tsc", - "build:release": "npx --no @paulmillr/jsbt esbuild test/build", - "format": "prettier --write 'index.ts' 'test/*.test.ts'", - "test": "node --experimental-strip-types --no-warnings test/index.ts", - "test:bun": "bun test/index.ts", - "test:deno": "deno --allow-env --allow-read test/index.ts" - }, - "keywords": [ - "bip32", - "hierarchical", - "deterministic", - "hd key", - "bip0032", - "bip-32", - "bip39", - "micro", - "scure", - "mnemonic", - "phrase", - "code" - ], - "homepage": "https://paulmillr.com/noble/#scure", - "funding": "https://paulmillr.com/funding/", - "repository": { - "type": "git", - "url": "git+https://github.com/paulmillr/scure-bip32.git" - }, - "type": "module", - "main": "index.js", - "module": "index.js", - "types": "index.d.ts", - "sideEffects": false, - "author": "Paul Miller (https://paulmillr.com)", - "license": "MIT" -} diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/LICENSE b/tools/mnemonic-test/node_modules/@scure/bip39/LICENSE deleted file mode 100644 index 68222b80..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the “Software”), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/README.md b/tools/mnemonic-test/node_modules/@scure/bip39/README.md deleted file mode 100644 index 34ca5493..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/README.md +++ /dev/null @@ -1,133 +0,0 @@ -# scure-bip39 - -Audited & minimal JS implementation of [BIP39 mnemonic phrases](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki). - -- 🔒 [**Audited**](#security) by an independent security firm -- 🔻 Tree-shakeable: unused code is excluded from your builds -- 📦 ESM and common.js -- ➰ Only 2 audited dependencies by the same author: - [noble-hashes](https://github.com/paulmillr/noble-hashes) and [scure-base](https://github.com/paulmillr/scure-base) -- 🪶 14KB gzipped with one wordlist, 79KB with all of them: much smaller than similar libraries - -Check out [scure-bip32](https://github.com/paulmillr/scure-bip32) if you need -hierarchical deterministic wallets ("HD Wallets"). - -### This library belongs to _scure_ - -> **scure** — audited micro-libraries. - -- Zero or minimal dependencies -- Highly readable TypeScript / JS code -- PGP-signed releases and transparent NPM builds -- Check out [homepage](https://paulmillr.com/noble/#scure) & all libraries: - [base](https://github.com/paulmillr/scure-base), - [bip32](https://github.com/paulmillr/scure-bip32), - [bip39](https://github.com/paulmillr/scure-bip39), - [btc-signer](https://github.com/paulmillr/scure-btc-signer), - [starknet](https://github.com/paulmillr/scure-starknet) - -## Usage - -> `npm install @scure/bip39` - -> `deno add jsr:@scure/bip39` - -> `deno doc jsr:@scure/bip39` # command-line documentation - -We don't provide source maps. -Wordlists are large, including source maps would double package size. - -```js -import * as bip39 from '@scure/bip39'; -import { wordlist } from '@scure/bip39/wordlists/english'; - -// Generate x random words. Uses Cryptographically-Secure Random Number Generator. -const mn = bip39.generateMnemonic(wordlist); -console.log(mn); - -// Reversible: Converts mnemonic string to raw entropy in form of byte array. -const ent = bip39.mnemonicToEntropy(mn, wordlist); - -// Reversible: Converts raw entropy in form of byte array to mnemonic string. -bip39.entropyToMnemonic(ent, wordlist); - -// Validates mnemonic for being 12-24 words contained in `wordlist`. -bip39.validateMnemonic(mn, wordlist); - -// Irreversible: Uses KDF to derive 64 bytes of key data from mnemonic + optional password. -await bip39.mnemonicToSeed(mn, 'password'); -bip39.mnemonicToSeedSync(mn, 'password'); -``` - -This submodule contains the word lists defined by BIP39 for Czech, English, French, Italian, Japanese, Korean, Portuguese, Simplified and Traditional Chinese, and Spanish. These are not imported by default, as that would increase bundle sizes too much. Instead, you should import and use them explicitly. - -```typescript -function generateMnemonic(wordlist: string[], strength?: number): string; -function mnemonicToEntropy(mnemonic: string, wordlist: string[]): Uint8Array; -function entropyToMnemonic(entropy: Uint8Array, wordlist: string[]): string; -function validateMnemonic(mnemonic: string, wordlist: string[]): boolean; -function mnemonicToSeed(mnemonic: string, passphrase?: string): Promise; -function mnemonicToSeedSync(mnemonic: string, passphrase?: string): Uint8Array; -``` - -All wordlists: - -```typescript -import { wordlist as czech } from '@scure/bip39/wordlists/czech'; -import { wordlist as english } from '@scure/bip39/wordlists/english'; -import { wordlist as french } from '@scure/bip39/wordlists/french'; -import { wordlist as italian } from '@scure/bip39/wordlists/italian'; -import { wordlist as japanese } from '@scure/bip39/wordlists/japanese'; -import { wordlist as korean } from '@scure/bip39/wordlists/korean'; -import { wordlist as portuguese } from '@scure/bip39/wordlists/portuguese'; -import { wordlist as simplifiedChinese } from '@scure/bip39/wordlists/simplified-chinese'; -import { wordlist as spanish } from '@scure/bip39/wordlists/spanish'; -import { wordlist as traditionalChinese } from '@scure/bip39/wordlists/traditional-chinese'; -``` - -## Security - -To audit wordlist content, run `node scripts/fetch-wordlist.js`. - -The library has been independently audited: - -- at version 1.0.0, in Jan 2022, by [cure53](https://cure53.de) - - PDFs: [online](https://cure53.de/pentest-report_hashing-libs.pdf), [offline](./audit/2022-01-05-cure53-audit-nbl2.pdf) - - [Changes since audit](https://github.com/paulmillr/scure-bip39/compare/1.0.0..main). - - The audit has been funded by [Ethereum Foundation](https://ethereum.org/en/) with help of [Nomic Labs](https://nomiclabs.io) - -The library was initially developed for [js-ethereum-cryptography](https://github.com/ethereum/js-ethereum-cryptography). -At commit [ae00e6d7](https://github.com/ethereum/js-ethereum-cryptography/commit/ae00e6d7d24fb3c76a1c7fe10039f6ecd120b77e), -it was extracted to a separate package called `micro-bip39`. -After the audit we've decided to use `@scure` NPM namespace for security. - -### Supply chain security - -- **Commits** are signed with PGP keys, to prevent forgery. Make sure to verify commit signatures -- **Releases** are transparent and built on GitHub CI. Make sure to verify [provenance](https://docs.npmjs.com/generating-provenance-statements) logs - - Use GitHub CLI to verify single-file builds: - `gh attestation verify --owner paulmillr scure-bip39.js` -- **Rare releasing** is followed to ensure less re-audit need for end-users -- **Dependencies** are minimized and locked-down: any dependency could get hacked and users will be downloading malware with every install. - - We make sure to use as few dependencies as possible - - Automatic dep updates are prevented by locking-down version ranges; diffs are checked with `npm-diff` -- **Dev Dependencies** are disabled for end-users; they are only used to develop / build the source code - -For this package, there are 2 dependencies; and a few dev dependencies: - -- [noble-hashes](https://github.com/paulmillr/noble-hashes) provides cryptographic hashing functionality -- [scure-base](https://github.com/paulmillr/scure-base) provides low-level wordlist utilities -- micro-bmark, micro-should and jsbt are used for benchmarking / testing / build tooling and developed by the same author -- prettier, fast-check and typescript are used for code quality / test generation / ts compilation. It's hard to audit their source code thoroughly and fully because of their size - -## Contributing & testing - -- `npm install && npm run build && npm test` will build the code and run tests. -- `npm run lint` / `npm run format` will run linter / fix linter issues. -- `npm run build:release` will build single file - -## License - -[MIT License](./LICENSE) - -Copyright (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/esm/index.d.ts b/tools/mnemonic-test/node_modules/@scure/bip39/esm/index.d.ts deleted file mode 100644 index 5dfbeb57..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/esm/index.d.ts +++ /dev/null @@ -1,92 +0,0 @@ -/** - * Audited & minimal JS implementation of - * [BIP39 mnemonic phrases](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki). - * @module - * @example -```js -import * as bip39 from '@scure/bip39'; -import { wordlist } from '@scure/bip39/wordlists/english'; -const mn = bip39.generateMnemonic(wordlist); -console.log(mn); -const ent = bip39.mnemonicToEntropy(mn, wordlist) -bip39.entropyToMnemonic(ent, wordlist); -bip39.validateMnemonic(mn, wordlist); -await bip39.mnemonicToSeed(mn, 'password'); -bip39.mnemonicToSeedSync(mn, 'password'); - -// Wordlists -import { wordlist as czech } from '@scure/bip39/wordlists/czech'; -import { wordlist as english } from '@scure/bip39/wordlists/english'; -import { wordlist as french } from '@scure/bip39/wordlists/french'; -import { wordlist as italian } from '@scure/bip39/wordlists/italian'; -import { wordlist as japanese } from '@scure/bip39/wordlists/japanese'; -import { wordlist as korean } from '@scure/bip39/wordlists/korean'; -import { wordlist as portuguese } from '@scure/bip39/wordlists/portuguese'; -import { wordlist as simplifiedChinese } from '@scure/bip39/wordlists/simplified-chinese'; -import { wordlist as spanish } from '@scure/bip39/wordlists/spanish'; -import { wordlist as traditionalChinese } from '@scure/bip39/wordlists/traditional-chinese'; -``` - */ -/** - * Generate x random words. Uses Cryptographically-Secure Random Number Generator. - * @param wordlist imported wordlist for specific language - * @param strength mnemonic strength 128-256 bits - * @example - * generateMnemonic(wordlist, 128) - * // 'legal winner thank year wave sausage worth useful legal winner thank yellow' - */ -export declare function generateMnemonic(wordlist: string[], strength?: number): string; -/** - * Reversible: Converts mnemonic string to raw entropy in form of byte array. - * @param mnemonic 12-24 words - * @param wordlist imported wordlist for specific language - * @example - * const mnem = 'legal winner thank year wave sausage worth useful legal winner thank yellow'; - * mnemonicToEntropy(mnem, wordlist) - * // Produces - * new Uint8Array([ - * 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, - * 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f - * ]) - */ -export declare function mnemonicToEntropy(mnemonic: string, wordlist: string[]): Uint8Array; -/** - * Reversible: Converts raw entropy in form of byte array to mnemonic string. - * @param entropy byte array - * @param wordlist imported wordlist for specific language - * @returns 12-24 words - * @example - * const ent = new Uint8Array([ - * 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, - * 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f - * ]); - * entropyToMnemonic(ent, wordlist); - * // 'legal winner thank year wave sausage worth useful legal winner thank yellow' - */ -export declare function entropyToMnemonic(entropy: Uint8Array, wordlist: string[]): string; -/** - * Validates mnemonic for being 12-24 words contained in `wordlist`. - */ -export declare function validateMnemonic(mnemonic: string, wordlist: string[]): boolean; -/** - * Irreversible: Uses KDF to derive 64 bytes of key data from mnemonic + optional password. - * @param mnemonic 12-24 words - * @param passphrase string that will additionally protect the key - * @returns 64 bytes of key data - * @example - * const mnem = 'legal winner thank year wave sausage worth useful legal winner thank yellow'; - * await mnemonicToSeed(mnem, 'password'); - * // new Uint8Array([...64 bytes]) - */ -export declare function mnemonicToSeed(mnemonic: string, passphrase?: string): Promise; -/** - * Irreversible: Uses KDF to derive 64 bytes of key data from mnemonic + optional password. - * @param mnemonic 12-24 words - * @param passphrase string that will additionally protect the key - * @returns 64 bytes of key data - * @example - * const mnem = 'legal winner thank year wave sausage worth useful legal winner thank yellow'; - * mnemonicToSeedSync(mnem, 'password'); - * // new Uint8Array([...64 bytes]) - */ -export declare function mnemonicToSeedSync(mnemonic: string, passphrase?: string): Uint8Array; diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/esm/index.js b/tools/mnemonic-test/node_modules/@scure/bip39/esm/index.js deleted file mode 100644 index d5734b0a..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/esm/index.js +++ /dev/null @@ -1,161 +0,0 @@ -/** - * Audited & minimal JS implementation of - * [BIP39 mnemonic phrases](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki). - * @module - * @example -```js -import * as bip39 from '@scure/bip39'; -import { wordlist } from '@scure/bip39/wordlists/english'; -const mn = bip39.generateMnemonic(wordlist); -console.log(mn); -const ent = bip39.mnemonicToEntropy(mn, wordlist) -bip39.entropyToMnemonic(ent, wordlist); -bip39.validateMnemonic(mn, wordlist); -await bip39.mnemonicToSeed(mn, 'password'); -bip39.mnemonicToSeedSync(mn, 'password'); - -// Wordlists -import { wordlist as czech } from '@scure/bip39/wordlists/czech'; -import { wordlist as english } from '@scure/bip39/wordlists/english'; -import { wordlist as french } from '@scure/bip39/wordlists/french'; -import { wordlist as italian } from '@scure/bip39/wordlists/italian'; -import { wordlist as japanese } from '@scure/bip39/wordlists/japanese'; -import { wordlist as korean } from '@scure/bip39/wordlists/korean'; -import { wordlist as portuguese } from '@scure/bip39/wordlists/portuguese'; -import { wordlist as simplifiedChinese } from '@scure/bip39/wordlists/simplified-chinese'; -import { wordlist as spanish } from '@scure/bip39/wordlists/spanish'; -import { wordlist as traditionalChinese } from '@scure/bip39/wordlists/traditional-chinese'; -``` - */ -/*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) */ -import { pbkdf2, pbkdf2Async } from '@noble/hashes/pbkdf2'; -import { sha256, sha512 } from '@noble/hashes/sha2'; -import { abytes, anumber, randomBytes } from '@noble/hashes/utils'; -import { utils as baseUtils } from '@scure/base'; -// Japanese wordlist -const isJapanese = (wordlist) => wordlist[0] === '\u3042\u3044\u3053\u304f\u3057\u3093'; -// Normalization replaces equivalent sequences of characters -// so that any two texts that are equivalent will be reduced -// to the same sequence of code points, called the normal form of the original text. -// https://tonsky.me/blog/unicode/#why-is-a---- -function nfkd(str) { - if (typeof str !== 'string') - throw new TypeError('invalid mnemonic type: ' + typeof str); - return str.normalize('NFKD'); -} -function normalize(str) { - const norm = nfkd(str); - const words = norm.split(' '); - if (![12, 15, 18, 21, 24].includes(words.length)) - throw new Error('Invalid mnemonic'); - return { nfkd: norm, words }; -} -function aentropy(ent) { - abytes(ent, 16, 20, 24, 28, 32); -} -/** - * Generate x random words. Uses Cryptographically-Secure Random Number Generator. - * @param wordlist imported wordlist for specific language - * @param strength mnemonic strength 128-256 bits - * @example - * generateMnemonic(wordlist, 128) - * // 'legal winner thank year wave sausage worth useful legal winner thank yellow' - */ -export function generateMnemonic(wordlist, strength = 128) { - anumber(strength); - if (strength % 32 !== 0 || strength > 256) - throw new TypeError('Invalid entropy'); - return entropyToMnemonic(randomBytes(strength / 8), wordlist); -} -const calcChecksum = (entropy) => { - // Checksum is ent.length/4 bits long - const bitsLeft = 8 - entropy.length / 4; - // Zero rightmost "bitsLeft" bits in byte - // For example: bitsLeft=4 val=10111101 -> 10110000 - return new Uint8Array([(sha256(entropy)[0] >> bitsLeft) << bitsLeft]); -}; -function getCoder(wordlist) { - if (!Array.isArray(wordlist) || wordlist.length !== 2048 || typeof wordlist[0] !== 'string') - throw new Error('Wordlist: expected array of 2048 strings'); - wordlist.forEach((i) => { - if (typeof i !== 'string') - throw new Error('wordlist: non-string element: ' + i); - }); - return baseUtils.chain(baseUtils.checksum(1, calcChecksum), baseUtils.radix2(11, true), baseUtils.alphabet(wordlist)); -} -/** - * Reversible: Converts mnemonic string to raw entropy in form of byte array. - * @param mnemonic 12-24 words - * @param wordlist imported wordlist for specific language - * @example - * const mnem = 'legal winner thank year wave sausage worth useful legal winner thank yellow'; - * mnemonicToEntropy(mnem, wordlist) - * // Produces - * new Uint8Array([ - * 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, - * 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f - * ]) - */ -export function mnemonicToEntropy(mnemonic, wordlist) { - const { words } = normalize(mnemonic); - const entropy = getCoder(wordlist).decode(words); - aentropy(entropy); - return entropy; -} -/** - * Reversible: Converts raw entropy in form of byte array to mnemonic string. - * @param entropy byte array - * @param wordlist imported wordlist for specific language - * @returns 12-24 words - * @example - * const ent = new Uint8Array([ - * 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, - * 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f - * ]); - * entropyToMnemonic(ent, wordlist); - * // 'legal winner thank year wave sausage worth useful legal winner thank yellow' - */ -export function entropyToMnemonic(entropy, wordlist) { - aentropy(entropy); - const words = getCoder(wordlist).encode(entropy); - return words.join(isJapanese(wordlist) ? '\u3000' : ' '); -} -/** - * Validates mnemonic for being 12-24 words contained in `wordlist`. - */ -export function validateMnemonic(mnemonic, wordlist) { - try { - mnemonicToEntropy(mnemonic, wordlist); - } - catch (e) { - return false; - } - return true; -} -const psalt = (passphrase) => nfkd('mnemonic' + passphrase); -/** - * Irreversible: Uses KDF to derive 64 bytes of key data from mnemonic + optional password. - * @param mnemonic 12-24 words - * @param passphrase string that will additionally protect the key - * @returns 64 bytes of key data - * @example - * const mnem = 'legal winner thank year wave sausage worth useful legal winner thank yellow'; - * await mnemonicToSeed(mnem, 'password'); - * // new Uint8Array([...64 bytes]) - */ -export function mnemonicToSeed(mnemonic, passphrase = '') { - return pbkdf2Async(sha512, normalize(mnemonic).nfkd, psalt(passphrase), { c: 2048, dkLen: 64 }); -} -/** - * Irreversible: Uses KDF to derive 64 bytes of key data from mnemonic + optional password. - * @param mnemonic 12-24 words - * @param passphrase string that will additionally protect the key - * @returns 64 bytes of key data - * @example - * const mnem = 'legal winner thank year wave sausage worth useful legal winner thank yellow'; - * mnemonicToSeedSync(mnem, 'password'); - * // new Uint8Array([...64 bytes]) - */ -export function mnemonicToSeedSync(mnemonic, passphrase = '') { - return pbkdf2(sha512, normalize(mnemonic).nfkd, psalt(passphrase), { c: 2048, dkLen: 64 }); -} diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/esm/package.json b/tools/mnemonic-test/node_modules/@scure/bip39/esm/package.json deleted file mode 100644 index aead43de..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/esm/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "module" -} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/czech.d.ts b/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/czech.d.ts deleted file mode 100644 index b566a1db..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/czech.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const wordlist: string[]; diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/czech.js b/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/czech.js deleted file mode 100644 index 12cdd267..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/czech.js +++ /dev/null @@ -1,2048 +0,0 @@ -export const wordlist = `abdikace -abeceda -adresa -agrese -akce -aktovka -alej -alkohol -amputace -ananas -andulka -anekdota -anketa -antika -anulovat -archa -arogance -asfalt -asistent -aspirace -astma -astronom -atlas -atletika -atol -autobus -azyl -babka -bachor -bacil -baculka -badatel -bageta -bagr -bahno -bakterie -balada -baletka -balkon -balonek -balvan -balza -bambus -bankomat -barbar -baret -barman -baroko -barva -baterka -batoh -bavlna -bazalka -bazilika -bazuka -bedna -beran -beseda -bestie -beton -bezinka -bezmoc -beztak -bicykl -bidlo -biftek -bikiny -bilance -biograf -biolog -bitva -bizon -blahobyt -blatouch -blecha -bledule -blesk -blikat -blizna -blokovat -bloudit -blud -bobek -bobr -bodlina -bodnout -bohatost -bojkot -bojovat -bokorys -bolest -borec -borovice -bota -boubel -bouchat -bouda -boule -bourat -boxer -bradavka -brambora -branka -bratr -brepta -briketa -brko -brloh -bronz -broskev -brunetka -brusinka -brzda -brzy -bublina -bubnovat -buchta -buditel -budka -budova -bufet -bujarost -bukvice -buldok -bulva -bunda -bunkr -burza -butik -buvol -buzola -bydlet -bylina -bytovka -bzukot -capart -carevna -cedr -cedule -cejch -cejn -cela -celer -celkem -celnice -cenina -cennost -cenovka -centrum -cenzor -cestopis -cetka -chalupa -chapadlo -charita -chata -chechtat -chemie -chichot -chirurg -chlad -chleba -chlubit -chmel -chmura -chobot -chochol -chodba -cholera -chomout -chopit -choroba -chov -chrapot -chrlit -chrt -chrup -chtivost -chudina -chutnat -chvat -chvilka -chvost -chyba -chystat -chytit -cibule -cigareta -cihelna -cihla -cinkot -cirkus -cisterna -citace -citrus -cizinec -cizost -clona -cokoliv -couvat -ctitel -ctnost -cudnost -cuketa -cukr -cupot -cvaknout -cval -cvik -cvrkot -cyklista -daleko -dareba -datel -datum -dcera -debata -dechovka -decibel -deficit -deflace -dekl -dekret -demokrat -deprese -derby -deska -detektiv -dikobraz -diktovat -dioda -diplom -disk -displej -divadlo -divoch -dlaha -dlouho -dluhopis -dnes -dobro -dobytek -docent -dochutit -dodnes -dohled -dohoda -dohra -dojem -dojnice -doklad -dokola -doktor -dokument -dolar -doleva -dolina -doma -dominant -domluvit -domov -donutit -dopad -dopis -doplnit -doposud -doprovod -dopustit -dorazit -dorost -dort -dosah -doslov -dostatek -dosud -dosyta -dotaz -dotek -dotknout -doufat -doutnat -dovozce -dozadu -doznat -dozorce -drahota -drak -dramatik -dravec -draze -drdol -drobnost -drogerie -drozd -drsnost -drtit -drzost -duben -duchovno -dudek -duha -duhovka -dusit -dusno -dutost -dvojice -dvorec -dynamit -ekolog -ekonomie -elektron -elipsa -email -emise -emoce -empatie -epizoda -epocha -epopej -epos -esej -esence -eskorta -eskymo -etiketa -euforie -evoluce -exekuce -exkurze -expedice -exploze -export -extrakt -facka -fajfka -fakulta -fanatik -fantazie -farmacie -favorit -fazole -federace -fejeton -fenka -fialka -figurant -filozof -filtr -finance -finta -fixace -fjord -flanel -flirt -flotila -fond -fosfor -fotbal -fotka -foton -frakce -freska -fronta -fukar -funkce -fyzika -galeje -garant -genetika -geolog -gilotina -glazura -glejt -golem -golfista -gotika -graf -gramofon -granule -grep -gril -grog -groteska -guma -hadice -hadr -hala -halenka -hanba -hanopis -harfa -harpuna -havran -hebkost -hejkal -hejno -hejtman -hektar -helma -hematom -herec -herna -heslo -hezky -historik -hladovka -hlasivky -hlava -hledat -hlen -hlodavec -hloh -hloupost -hltat -hlubina -hluchota -hmat -hmota -hmyz -hnis -hnojivo -hnout -hoblina -hoboj -hoch -hodiny -hodlat -hodnota -hodovat -hojnost -hokej -holinka -holka -holub -homole -honitba -honorace -horal -horda -horizont -horko -horlivec -hormon -hornina -horoskop -horstvo -hospoda -hostina -hotovost -houba -houf -houpat -houska -hovor -hradba -hranice -hravost -hrazda -hrbolek -hrdina -hrdlo -hrdost -hrnek -hrobka -hromada -hrot -hrouda -hrozen -hrstka -hrubost -hryzat -hubenost -hubnout -hudba -hukot -humr -husita -hustota -hvozd -hybnost -hydrant -hygiena -hymna -hysterik -idylka -ihned -ikona -iluze -imunita -infekce -inflace -inkaso -inovace -inspekce -internet -invalida -investor -inzerce -ironie -jablko -jachta -jahoda -jakmile -jakost -jalovec -jantar -jarmark -jaro -jasan -jasno -jatka -javor -jazyk -jedinec -jedle -jednatel -jehlan -jekot -jelen -jelito -jemnost -jenom -jepice -jeseter -jevit -jezdec -jezero -jinak -jindy -jinoch -jiskra -jistota -jitrnice -jizva -jmenovat -jogurt -jurta -kabaret -kabel -kabinet -kachna -kadet -kadidlo -kahan -kajak -kajuta -kakao -kaktus -kalamita -kalhoty -kalibr -kalnost -kamera -kamkoliv -kamna -kanibal -kanoe -kantor -kapalina -kapela -kapitola -kapka -kaple -kapota -kapr -kapusta -kapybara -karamel -karotka -karton -kasa -katalog -katedra -kauce -kauza -kavalec -kazajka -kazeta -kazivost -kdekoliv -kdesi -kedluben -kemp -keramika -kino -klacek -kladivo -klam -klapot -klasika -klaun -klec -klenba -klepat -klesnout -klid -klima -klisna -klobouk -klokan -klopa -kloub -klubovna -klusat -kluzkost -kmen -kmitat -kmotr -kniha -knot -koalice -koberec -kobka -kobliha -kobyla -kocour -kohout -kojenec -kokos -koktejl -kolaps -koleda -kolize -kolo -komando -kometa -komik -komnata -komora -kompas -komunita -konat -koncept -kondice -konec -konfese -kongres -konina -konkurs -kontakt -konzerva -kopanec -kopie -kopnout -koprovka -korbel -korektor -kormidlo -koroptev -korpus -koruna -koryto -korzet -kosatec -kostka -kotel -kotleta -kotoul -koukat -koupelna -kousek -kouzlo -kovboj -koza -kozoroh -krabice -krach -krajina -kralovat -krasopis -kravata -kredit -krejcar -kresba -kreveta -kriket -kritik -krize -krkavec -krmelec -krmivo -krocan -krok -kronika -kropit -kroupa -krovka -krtek -kruhadlo -krupice -krutost -krvinka -krychle -krypta -krystal -kryt -kudlanka -kufr -kujnost -kukla -kulajda -kulich -kulka -kulomet -kultura -kuna -kupodivu -kurt -kurzor -kutil -kvalita -kvasinka -kvestor -kynolog -kyselina -kytara -kytice -kytka -kytovec -kyvadlo -labrador -lachtan -ladnost -laik -lakomec -lamela -lampa -lanovka -lasice -laso -lastura -latinka -lavina -lebka -leckdy -leden -lednice -ledovka -ledvina -legenda -legie -legrace -lehce -lehkost -lehnout -lektvar -lenochod -lentilka -lepenka -lepidlo -letadlo -letec -letmo -letokruh -levhart -levitace -levobok -libra -lichotka -lidojed -lidskost -lihovina -lijavec -lilek -limetka -linie -linka -linoleum -listopad -litina -litovat -lobista -lodivod -logika -logoped -lokalita -loket -lomcovat -lopata -lopuch -lord -losos -lotr -loudal -louh -louka -louskat -lovec -lstivost -lucerna -lucifer -lump -lusk -lustrace -lvice -lyra -lyrika -lysina -madam -madlo -magistr -mahagon -majetek -majitel -majorita -makak -makovice -makrela -malba -malina -malovat -malvice -maminka -mandle -manko -marnost -masakr -maskot -masopust -matice -matrika -maturita -mazanec -mazivo -mazlit -mazurka -mdloba -mechanik -meditace -medovina -melasa -meloun -mentolka -metla -metoda -metr -mezera -migrace -mihnout -mihule -mikina -mikrofon -milenec -milimetr -milost -mimika -mincovna -minibar -minomet -minulost -miska -mistr -mixovat -mladost -mlha -mlhovina -mlok -mlsat -mluvit -mnich -mnohem -mobil -mocnost -modelka -modlitba -mohyla -mokro -molekula -momentka -monarcha -monokl -monstrum -montovat -monzun -mosaz -moskyt -most -motivace -motorka -motyka -moucha -moudrost -mozaika -mozek -mozol -mramor -mravenec -mrkev -mrtvola -mrzet -mrzutost -mstitel -mudrc -muflon -mulat -mumie -munice -muset -mutace -muzeum -muzikant -myslivec -mzda -nabourat -nachytat -nadace -nadbytek -nadhoz -nadobro -nadpis -nahlas -nahnat -nahodile -nahradit -naivita -najednou -najisto -najmout -naklonit -nakonec -nakrmit -nalevo -namazat -namluvit -nanometr -naoko -naopak -naostro -napadat -napevno -naplnit -napnout -naposled -naprosto -narodit -naruby -narychlo -nasadit -nasekat -naslepo -nastat -natolik -navenek -navrch -navzdory -nazvat -nebe -nechat -necky -nedaleko -nedbat -neduh -negace -nehet -nehoda -nejen -nejprve -neklid -nelibost -nemilost -nemoc -neochota -neonka -nepokoj -nerost -nerv -nesmysl -nesoulad -netvor -neuron -nevina -nezvykle -nicota -nijak -nikam -nikdy -nikl -nikterak -nitro -nocleh -nohavice -nominace -nora -norek -nositel -nosnost -nouze -noviny -novota -nozdra -nuda -nudle -nuget -nutit -nutnost -nutrie -nymfa -obal -obarvit -obava -obdiv -obec -obehnat -obejmout -obezita -obhajoba -obilnice -objasnit -objekt -obklopit -oblast -oblek -obliba -obloha -obluda -obnos -obohatit -obojek -obout -obrazec -obrna -obruba -obrys -obsah -obsluha -obstarat -obuv -obvaz -obvinit -obvod -obvykle -obyvatel -obzor -ocas -ocel -ocenit -ochladit -ochota -ochrana -ocitnout -odboj -odbyt -odchod -odcizit -odebrat -odeslat -odevzdat -odezva -odhadce -odhodit -odjet -odjinud -odkaz -odkoupit -odliv -odluka -odmlka -odolnost -odpad -odpis -odplout -odpor -odpustit -odpykat -odrazka -odsoudit -odstup -odsun -odtok -odtud -odvaha -odveta -odvolat -odvracet -odznak -ofina -ofsajd -ohlas -ohnisko -ohrada -ohrozit -ohryzek -okap -okenice -oklika -okno -okouzlit -okovy -okrasa -okres -okrsek -okruh -okupant -okurka -okusit -olejnina -olizovat -omak -omeleta -omezit -omladina -omlouvat -omluva -omyl -onehdy -opakovat -opasek -operace -opice -opilost -opisovat -opora -opozice -opravdu -oproti -orbital -orchestr -orgie -orlice -orloj -ortel -osada -oschnout -osika -osivo -oslava -oslepit -oslnit -oslovit -osnova -osoba -osolit -ospalec -osten -ostraha -ostuda -ostych -osvojit -oteplit -otisk -otop -otrhat -otrlost -otrok -otruby -otvor -ovanout -ovar -oves -ovlivnit -ovoce -oxid -ozdoba -pachatel -pacient -padouch -pahorek -pakt -palanda -palec -palivo -paluba -pamflet -pamlsek -panenka -panika -panna -panovat -panstvo -pantofle -paprika -parketa -parodie -parta -paruka -paryba -paseka -pasivita -pastelka -patent -patrona -pavouk -pazneht -pazourek -pecka -pedagog -pejsek -peklo -peloton -penalta -pendrek -penze -periskop -pero -pestrost -petarda -petice -petrolej -pevnina -pexeso -pianista -piha -pijavice -pikle -piknik -pilina -pilnost -pilulka -pinzeta -pipeta -pisatel -pistole -pitevna -pivnice -pivovar -placenta -plakat -plamen -planeta -plastika -platit -plavidlo -plaz -plech -plemeno -plenta -ples -pletivo -plevel -plivat -plnit -plno -plocha -plodina -plomba -plout -pluk -plyn -pobavit -pobyt -pochod -pocit -poctivec -podat -podcenit -podepsat -podhled -podivit -podklad -podmanit -podnik -podoba -podpora -podraz -podstata -podvod -podzim -poezie -pohanka -pohnutka -pohovor -pohroma -pohyb -pointa -pojistka -pojmout -pokazit -pokles -pokoj -pokrok -pokuta -pokyn -poledne -polibek -polknout -poloha -polynom -pomalu -pominout -pomlka -pomoc -pomsta -pomyslet -ponechat -ponorka -ponurost -popadat -popel -popisek -poplach -poprosit -popsat -popud -poradce -porce -porod -porucha -poryv -posadit -posed -posila -poskok -poslanec -posoudit -pospolu -postava -posudek -posyp -potah -potkan -potlesk -potomek -potrava -potupa -potvora -poukaz -pouto -pouzdro -povaha -povidla -povlak -povoz -povrch -povstat -povyk -povzdech -pozdrav -pozemek -poznatek -pozor -pozvat -pracovat -prahory -praktika -prales -praotec -praporek -prase -pravda -princip -prkno -probudit -procento -prodej -profese -prohra -projekt -prolomit -promile -pronikat -propad -prorok -prosba -proton -proutek -provaz -prskavka -prsten -prudkost -prut -prvek -prvohory -psanec -psovod -pstruh -ptactvo -puberta -puch -pudl -pukavec -puklina -pukrle -pult -pumpa -punc -pupen -pusa -pusinka -pustina -putovat -putyka -pyramida -pysk -pytel -racek -rachot -radiace -radnice -radon -raft -ragby -raketa -rakovina -rameno -rampouch -rande -rarach -rarita -rasovna -rastr -ratolest -razance -razidlo -reagovat -reakce -recept -redaktor -referent -reflex -rejnok -reklama -rekord -rekrut -rektor -reputace -revize -revma -revolver -rezerva -riskovat -riziko -robotika -rodokmen -rohovka -rokle -rokoko -romaneto -ropovod -ropucha -rorejs -rosol -rostlina -rotmistr -rotoped -rotunda -roubenka -roucho -roup -roura -rovina -rovnice -rozbor -rozchod -rozdat -rozeznat -rozhodce -rozinka -rozjezd -rozkaz -rozloha -rozmar -rozpad -rozruch -rozsah -roztok -rozum -rozvod -rubrika -ruchadlo -rukavice -rukopis -ryba -rybolov -rychlost -rydlo -rypadlo -rytina -ryzost -sadista -sahat -sako -samec -samizdat -samota -sanitka -sardinka -sasanka -satelit -sazba -sazenice -sbor -schovat -sebranka -secese -sedadlo -sediment -sedlo -sehnat -sejmout -sekera -sekta -sekunda -sekvoje -semeno -seno -servis -sesadit -seshora -seskok -seslat -sestra -sesuv -sesypat -setba -setina -setkat -setnout -setrvat -sever -seznam -shoda -shrnout -sifon -silnice -sirka -sirotek -sirup -situace -skafandr -skalisko -skanzen -skaut -skeptik -skica -skladba -sklenice -sklo -skluz -skoba -skokan -skoro -skripta -skrz -skupina -skvost -skvrna -slabika -sladidlo -slanina -slast -slavnost -sledovat -slepec -sleva -slezina -slib -slina -sliznice -slon -sloupek -slovo -sluch -sluha -slunce -slupka -slza -smaragd -smetana -smilstvo -smlouva -smog -smrad -smrk -smrtka -smutek -smysl -snad -snaha -snob -sobota -socha -sodovka -sokol -sopka -sotva -souboj -soucit -soudce -souhlas -soulad -soumrak -souprava -soused -soutok -souviset -spalovna -spasitel -spis -splav -spodek -spojenec -spolu -sponzor -spornost -spousta -sprcha -spustit -sranda -sraz -srdce -srna -srnec -srovnat -srpen -srst -srub -stanice -starosta -statika -stavba -stehno -stezka -stodola -stolek -stopa -storno -stoupat -strach -stres -strhnout -strom -struna -studna -stupnice -stvol -styk -subjekt -subtropy -suchar -sudost -sukno -sundat -sunout -surikata -surovina -svah -svalstvo -svetr -svatba -svazek -svisle -svitek -svoboda -svodidlo -svorka -svrab -sykavka -sykot -synek -synovec -sypat -sypkost -syrovost -sysel -sytost -tabletka -tabule -tahoun -tajemno -tajfun -tajga -tajit -tajnost -taktika -tamhle -tampon -tancovat -tanec -tanker -tapeta -tavenina -tazatel -technika -tehdy -tekutina -telefon -temnota -tendence -tenista -tenor -teplota -tepna -teprve -terapie -termoska -textil -ticho -tiskopis -titulek -tkadlec -tkanina -tlapka -tleskat -tlukot -tlupa -tmel -toaleta -topinka -topol -torzo -touha -toulec -tradice -traktor -tramp -trasa -traverza -trefit -trest -trezor -trhavina -trhlina -trochu -trojice -troska -trouba -trpce -trpitel -trpkost -trubec -truchlit -truhlice -trus -trvat -tudy -tuhnout -tuhost -tundra -turista -turnaj -tuzemsko -tvaroh -tvorba -tvrdost -tvrz -tygr -tykev -ubohost -uboze -ubrat -ubrousek -ubrus -ubytovna -ucho -uctivost -udivit -uhradit -ujednat -ujistit -ujmout -ukazatel -uklidnit -uklonit -ukotvit -ukrojit -ulice -ulita -ulovit -umyvadlo -unavit -uniforma -uniknout -upadnout -uplatnit -uplynout -upoutat -upravit -uran -urazit -usednout -usilovat -usmrtit -usnadnit -usnout -usoudit -ustlat -ustrnout -utahovat -utkat -utlumit -utonout -utopenec -utrousit -uvalit -uvolnit -uvozovka -uzdravit -uzel -uzenina -uzlina -uznat -vagon -valcha -valoun -vana -vandal -vanilka -varan -varhany -varovat -vcelku -vchod -vdova -vedro -vegetace -vejce -velbloud -veletrh -velitel -velmoc -velryba -venkov -veranda -verze -veselka -veskrze -vesnice -vespodu -vesta -veterina -veverka -vibrace -vichr -videohra -vidina -vidle -vila -vinice -viset -vitalita -vize -vizitka -vjezd -vklad -vkus -vlajka -vlak -vlasec -vlevo -vlhkost -vliv -vlnovka -vloupat -vnucovat -vnuk -voda -vodivost -vodoznak -vodstvo -vojensky -vojna -vojsko -volant -volba -volit -volno -voskovka -vozidlo -vozovna -vpravo -vrabec -vracet -vrah -vrata -vrba -vrcholek -vrhat -vrstva -vrtule -vsadit -vstoupit -vstup -vtip -vybavit -vybrat -vychovat -vydat -vydra -vyfotit -vyhledat -vyhnout -vyhodit -vyhradit -vyhubit -vyjasnit -vyjet -vyjmout -vyklopit -vykonat -vylekat -vymazat -vymezit -vymizet -vymyslet -vynechat -vynikat -vynutit -vypadat -vyplatit -vypravit -vypustit -vyrazit -vyrovnat -vyrvat -vyslovit -vysoko -vystavit -vysunout -vysypat -vytasit -vytesat -vytratit -vyvinout -vyvolat -vyvrhel -vyzdobit -vyznat -vzadu -vzbudit -vzchopit -vzdor -vzduch -vzdychat -vzestup -vzhledem -vzkaz -vzlykat -vznik -vzorek -vzpoura -vztah -vztek -xylofon -zabrat -zabydlet -zachovat -zadarmo -zadusit -zafoukat -zahltit -zahodit -zahrada -zahynout -zajatec -zajet -zajistit -zaklepat -zakoupit -zalepit -zamezit -zamotat -zamyslet -zanechat -zanikat -zaplatit -zapojit -zapsat -zarazit -zastavit -zasunout -zatajit -zatemnit -zatknout -zaujmout -zavalit -zavelet -zavinit -zavolat -zavrtat -zazvonit -zbavit -zbrusu -zbudovat -zbytek -zdaleka -zdarma -zdatnost -zdivo -zdobit -zdroj -zdvih -zdymadlo -zelenina -zeman -zemina -zeptat -zezadu -zezdola -zhatit -zhltnout -zhluboka -zhotovit -zhruba -zima -zimnice -zjemnit -zklamat -zkoumat -zkratka -zkumavka -zlato -zlehka -zloba -zlom -zlost -zlozvyk -zmapovat -zmar -zmatek -zmije -zmizet -zmocnit -zmodrat -zmrzlina -zmutovat -znak -znalost -znamenat -znovu -zobrazit -zotavit -zoubek -zoufale -zplodit -zpomalit -zprava -zprostit -zprudka -zprvu -zrada -zranit -zrcadlo -zrnitost -zrno -zrovna -zrychlit -zrzavost -zticha -ztratit -zubovina -zubr -zvednout -zvenku -zvesela -zvon -zvrat -zvukovod -zvyk`.split('\n'); diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/english.d.ts b/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/english.d.ts deleted file mode 100644 index b566a1db..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/english.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const wordlist: string[]; diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/english.js b/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/english.js deleted file mode 100644 index e996bc6c..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/english.js +++ /dev/null @@ -1,2048 +0,0 @@ -export const wordlist = `abandon -ability -able -about -above -absent -absorb -abstract -absurd -abuse -access -accident -account -accuse -achieve -acid -acoustic -acquire -across -act -action -actor -actress -actual -adapt -add -addict -address -adjust -admit -adult -advance -advice -aerobic -affair -afford -afraid -again -age -agent -agree -ahead -aim -air -airport -aisle -alarm -album -alcohol -alert -alien -all -alley -allow -almost -alone -alpha -already -also -alter -always -amateur -amazing -among -amount -amused -analyst -anchor -ancient -anger -angle -angry -animal -ankle -announce -annual -another -answer -antenna -antique -anxiety -any -apart -apology -appear -apple -approve -april -arch -arctic -area -arena -argue -arm -armed -armor -army -around -arrange -arrest -arrive -arrow -art -artefact -artist -artwork -ask -aspect -assault -asset -assist -assume -asthma -athlete -atom -attack -attend -attitude -attract -auction -audit -august -aunt -author -auto -autumn -average -avocado -avoid -awake -aware -away -awesome -awful -awkward -axis -baby -bachelor -bacon -badge -bag -balance -balcony -ball -bamboo -banana -banner -bar -barely -bargain -barrel -base -basic -basket -battle -beach -bean -beauty -because -become -beef -before -begin -behave -behind -believe -below -belt -bench -benefit -best -betray -better -between -beyond -bicycle -bid -bike -bind -biology -bird -birth -bitter -black -blade -blame -blanket -blast -bleak -bless -blind -blood -blossom -blouse -blue -blur -blush -board -boat -body -boil -bomb -bone -bonus -book -boost -border -boring -borrow -boss -bottom -bounce -box -boy -bracket -brain -brand -brass -brave -bread -breeze -brick -bridge -brief -bright -bring -brisk -broccoli -broken -bronze -broom -brother -brown -brush -bubble -buddy -budget -buffalo -build -bulb -bulk -bullet -bundle -bunker -burden -burger -burst -bus -business -busy -butter -buyer -buzz -cabbage -cabin -cable -cactus -cage -cake -call -calm -camera -camp -can -canal -cancel -candy -cannon -canoe -canvas -canyon -capable -capital -captain -car -carbon -card -cargo -carpet -carry -cart -case -cash -casino -castle -casual -cat -catalog -catch -category -cattle -caught -cause -caution -cave -ceiling -celery -cement -census -century -cereal -certain -chair -chalk -champion -change -chaos -chapter -charge -chase -chat -cheap -check -cheese -chef -cherry -chest -chicken -chief -child -chimney -choice -choose -chronic -chuckle -chunk -churn -cigar -cinnamon -circle -citizen -city -civil -claim -clap -clarify -claw -clay -clean -clerk -clever -click -client -cliff -climb -clinic -clip -clock -clog -close -cloth -cloud -clown -club -clump -cluster -clutch -coach -coast -coconut -code -coffee -coil -coin -collect -color -column -combine -come -comfort -comic -common -company -concert -conduct -confirm -congress -connect -consider -control -convince -cook -cool -copper -copy -coral -core -corn -correct -cost -cotton -couch -country -couple -course -cousin -cover -coyote -crack -cradle -craft -cram -crane -crash -crater -crawl -crazy -cream -credit -creek -crew -cricket -crime -crisp -critic -crop -cross -crouch -crowd -crucial -cruel -cruise -crumble -crunch -crush -cry -crystal -cube -culture -cup -cupboard -curious -current -curtain -curve -cushion -custom -cute -cycle -dad -damage -damp -dance -danger -daring -dash -daughter -dawn -day -deal -debate -debris -decade -december -decide -decline -decorate -decrease -deer -defense -define -defy -degree -delay -deliver -demand -demise -denial -dentist -deny -depart -depend -deposit -depth -deputy -derive -describe -desert -design -desk -despair -destroy -detail -detect -develop -device -devote -diagram -dial -diamond -diary -dice -diesel -diet -differ -digital -dignity -dilemma -dinner -dinosaur -direct -dirt -disagree -discover -disease -dish -dismiss -disorder -display -distance -divert -divide -divorce -dizzy -doctor -document -dog -doll -dolphin -domain -donate -donkey -donor -door -dose -double -dove -draft -dragon -drama -drastic -draw -dream -dress -drift -drill -drink -drip -drive -drop -drum -dry -duck -dumb -dune -during -dust -dutch -duty -dwarf -dynamic -eager -eagle -early -earn -earth -easily -east -easy -echo -ecology -economy -edge -edit -educate -effort -egg -eight -either -elbow -elder -electric -elegant -element -elephant -elevator -elite -else -embark -embody -embrace -emerge -emotion -employ -empower -empty -enable -enact -end -endless -endorse -enemy -energy -enforce -engage -engine -enhance -enjoy -enlist -enough -enrich -enroll -ensure -enter -entire -entry -envelope -episode -equal -equip -era -erase -erode -erosion -error -erupt -escape -essay -essence -estate -eternal -ethics -evidence -evil -evoke -evolve -exact -example -excess -exchange -excite -exclude -excuse -execute -exercise -exhaust -exhibit -exile -exist -exit -exotic -expand -expect -expire -explain -expose -express -extend -extra -eye -eyebrow -fabric -face -faculty -fade -faint -faith -fall -false -fame -family -famous -fan -fancy -fantasy -farm -fashion -fat -fatal -father -fatigue -fault -favorite -feature -february -federal -fee -feed -feel -female -fence -festival -fetch -fever -few -fiber -fiction -field -figure -file -film -filter -final -find -fine -finger -finish -fire -firm -first -fiscal -fish -fit -fitness -fix -flag -flame -flash -flat -flavor -flee -flight -flip -float -flock -floor -flower -fluid -flush -fly -foam -focus -fog -foil -fold -follow -food -foot -force -forest -forget -fork -fortune -forum -forward -fossil -foster -found -fox -fragile -frame -frequent -fresh -friend -fringe -frog -front -frost -frown -frozen -fruit -fuel -fun -funny -furnace -fury -future -gadget -gain -galaxy -gallery -game -gap -garage -garbage -garden -garlic -garment -gas -gasp -gate -gather -gauge -gaze -general -genius -genre -gentle -genuine -gesture -ghost -giant -gift -giggle -ginger -giraffe -girl -give -glad -glance -glare -glass -glide -glimpse -globe -gloom -glory -glove -glow -glue -goat -goddess -gold -good -goose -gorilla -gospel -gossip -govern -gown -grab -grace -grain -grant -grape -grass -gravity -great -green -grid -grief -grit -grocery -group -grow -grunt -guard -guess -guide -guilt -guitar -gun -gym -habit -hair -half -hammer -hamster -hand -happy -harbor -hard -harsh -harvest -hat -have -hawk -hazard -head -health -heart -heavy -hedgehog -height -hello -helmet -help -hen -hero -hidden -high -hill -hint -hip -hire -history -hobby -hockey -hold -hole -holiday -hollow -home -honey -hood -hope -horn -horror -horse -hospital -host -hotel -hour -hover -hub -huge -human -humble -humor -hundred -hungry -hunt -hurdle -hurry -hurt -husband -hybrid -ice -icon -idea -identify -idle -ignore -ill -illegal -illness -image -imitate -immense -immune -impact -impose -improve -impulse -inch -include -income -increase -index -indicate -indoor -industry -infant -inflict -inform -inhale -inherit -initial -inject -injury -inmate -inner -innocent -input -inquiry -insane -insect -inside -inspire -install -intact -interest -into -invest -invite -involve -iron -island -isolate -issue -item -ivory -jacket -jaguar -jar -jazz -jealous -jeans -jelly -jewel -job -join -joke -journey -joy -judge -juice -jump -jungle -junior -junk -just -kangaroo -keen -keep -ketchup -key -kick -kid -kidney -kind -kingdom -kiss -kit -kitchen -kite -kitten -kiwi -knee -knife -knock -know -lab -label -labor -ladder -lady -lake -lamp -language -laptop -large -later -latin -laugh -laundry -lava -law -lawn -lawsuit -layer -lazy -leader -leaf -learn -leave -lecture -left -leg -legal -legend -leisure -lemon -lend -length -lens -leopard -lesson -letter -level -liar -liberty -library -license -life -lift -light -like -limb -limit -link -lion -liquid -list -little -live -lizard -load -loan -lobster -local -lock -logic -lonely -long -loop -lottery -loud -lounge -love -loyal -lucky -luggage -lumber -lunar -lunch -luxury -lyrics -machine -mad -magic -magnet -maid -mail -main -major -make -mammal -man -manage -mandate -mango -mansion -manual -maple -marble -march -margin -marine -market -marriage -mask -mass -master -match -material -math -matrix -matter -maximum -maze -meadow -mean -measure -meat -mechanic -medal -media -melody -melt -member -memory -mention -menu -mercy -merge -merit -merry -mesh -message -metal -method -middle -midnight -milk -million -mimic -mind -minimum -minor -minute -miracle -mirror -misery -miss -mistake -mix -mixed -mixture -mobile -model -modify -mom -moment -monitor -monkey -monster -month -moon -moral -more -morning -mosquito -mother -motion -motor -mountain -mouse -move -movie -much -muffin -mule -multiply -muscle -museum -mushroom -music -must -mutual -myself -mystery -myth -naive -name -napkin -narrow -nasty -nation -nature -near -neck -need -negative -neglect -neither -nephew -nerve -nest -net -network -neutral -never -news -next -nice -night -noble -noise -nominee -noodle -normal -north -nose -notable -note -nothing -notice -novel -now -nuclear -number -nurse -nut -oak -obey -object -oblige -obscure -observe -obtain -obvious -occur -ocean -october -odor -off -offer -office -often -oil -okay -old -olive -olympic -omit -once -one -onion -online -only -open -opera -opinion -oppose -option -orange -orbit -orchard -order -ordinary -organ -orient -original -orphan -ostrich -other -outdoor -outer -output -outside -oval -oven -over -own -owner -oxygen -oyster -ozone -pact -paddle -page -pair -palace -palm -panda -panel -panic -panther -paper -parade -parent -park -parrot -party -pass -patch -path -patient -patrol -pattern -pause -pave -payment -peace -peanut -pear -peasant -pelican -pen -penalty -pencil -people -pepper -perfect -permit -person -pet -phone -photo -phrase -physical -piano -picnic -picture -piece -pig -pigeon -pill -pilot -pink -pioneer -pipe -pistol -pitch -pizza -place -planet -plastic -plate -play -please -pledge -pluck -plug -plunge -poem -poet -point -polar -pole -police -pond -pony -pool -popular -portion -position -possible -post -potato -pottery -poverty -powder -power -practice -praise -predict -prefer -prepare -present -pretty -prevent -price -pride -primary -print -priority -prison -private -prize -problem -process -produce -profit -program -project -promote -proof -property -prosper -protect -proud -provide -public -pudding -pull -pulp -pulse -pumpkin -punch -pupil -puppy -purchase -purity -purpose -purse -push -put -puzzle -pyramid -quality -quantum -quarter -question -quick -quit -quiz -quote -rabbit -raccoon -race -rack -radar -radio -rail -rain -raise -rally -ramp -ranch -random -range -rapid -rare -rate -rather -raven -raw -razor -ready -real -reason -rebel -rebuild -recall -receive -recipe -record -recycle -reduce -reflect -reform -refuse -region -regret -regular -reject -relax -release -relief -rely -remain -remember -remind -remove -render -renew -rent -reopen -repair -repeat -replace -report -require -rescue -resemble -resist -resource -response -result -retire -retreat -return -reunion -reveal -review -reward -rhythm -rib -ribbon -rice -rich -ride -ridge -rifle -right -rigid -ring -riot -ripple -risk -ritual -rival -river -road -roast -robot -robust -rocket -romance -roof -rookie -room -rose -rotate -rough -round -route -royal -rubber -rude -rug -rule -run -runway -rural -sad -saddle -sadness -safe -sail -salad -salmon -salon -salt -salute -same -sample -sand -satisfy -satoshi -sauce -sausage -save -say -scale -scan -scare -scatter -scene -scheme -school -science -scissors -scorpion -scout -scrap -screen -script -scrub -sea -search -season -seat -second -secret -section -security -seed -seek -segment -select -sell -seminar -senior -sense -sentence -series -service -session -settle -setup -seven -shadow -shaft -shallow -share -shed -shell -sheriff -shield -shift -shine -ship -shiver -shock -shoe -shoot -shop -short -shoulder -shove -shrimp -shrug -shuffle -shy -sibling -sick -side -siege -sight -sign -silent -silk -silly -silver -similar -simple -since -sing -siren -sister -situate -six -size -skate -sketch -ski -skill -skin -skirt -skull -slab -slam -sleep -slender -slice -slide -slight -slim -slogan -slot -slow -slush -small -smart -smile -smoke -smooth -snack -snake -snap -sniff -snow -soap -soccer -social -sock -soda -soft -solar -soldier -solid -solution -solve -someone -song -soon -sorry -sort -soul -sound -soup -source -south -space -spare -spatial -spawn -speak -special -speed -spell -spend -sphere -spice -spider -spike -spin -spirit -split -spoil -sponsor -spoon -sport -spot -spray -spread -spring -spy -square -squeeze -squirrel -stable -stadium -staff -stage -stairs -stamp -stand -start -state -stay -steak -steel -stem -step -stereo -stick -still -sting -stock -stomach -stone -stool -story -stove -strategy -street -strike -strong -struggle -student -stuff -stumble -style -subject -submit -subway -success -such -sudden -suffer -sugar -suggest -suit -summer -sun -sunny -sunset -super -supply -supreme -sure -surface -surge -surprise -surround -survey -suspect -sustain -swallow -swamp -swap -swarm -swear -sweet -swift -swim -swing -switch -sword -symbol -symptom -syrup -system -table -tackle -tag -tail -talent -talk -tank -tape -target -task -taste -tattoo -taxi -teach -team -tell -ten -tenant -tennis -tent -term -test -text -thank -that -theme -then -theory -there -they -thing -this -thought -three -thrive -throw -thumb -thunder -ticket -tide -tiger -tilt -timber -time -tiny -tip -tired -tissue -title -toast -tobacco -today -toddler -toe -together -toilet -token -tomato -tomorrow -tone -tongue -tonight -tool -tooth -top -topic -topple -torch -tornado -tortoise -toss -total -tourist -toward -tower -town -toy -track -trade -traffic -tragic -train -transfer -trap -trash -travel -tray -treat -tree -trend -trial -tribe -trick -trigger -trim -trip -trophy -trouble -truck -true -truly -trumpet -trust -truth -try -tube -tuition -tumble -tuna -tunnel -turkey -turn -turtle -twelve -twenty -twice -twin -twist -two -type -typical -ugly -umbrella -unable -unaware -uncle -uncover -under -undo -unfair -unfold -unhappy -uniform -unique -unit -universe -unknown -unlock -until -unusual -unveil -update -upgrade -uphold -upon -upper -upset -urban -urge -usage -use -used -useful -useless -usual -utility -vacant -vacuum -vague -valid -valley -valve -van -vanish -vapor -various -vast -vault -vehicle -velvet -vendor -venture -venue -verb -verify -version -very -vessel -veteran -viable -vibrant -vicious -victory -video -view -village -vintage -violin -virtual -virus -visa -visit -visual -vital -vivid -vocal -voice -void -volcano -volume -vote -voyage -wage -wagon -wait -walk -wall -walnut -want -warfare -warm -warrior -wash -wasp -waste -water -wave -way -wealth -weapon -wear -weasel -weather -web -wedding -weekend -weird -welcome -west -wet -whale -what -wheat -wheel -when -where -whip -whisper -wide -width -wife -wild -will -win -window -wine -wing -wink -winner -winter -wire -wisdom -wise -wish -witness -wolf -woman -wonder -wood -wool -word -work -world -worry -worth -wrap -wreck -wrestle -wrist -write -wrong -yard -year -yellow -you -young -youth -zebra -zero -zone -zoo`.split('\n'); diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/french.d.ts b/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/french.d.ts deleted file mode 100644 index b566a1db..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/french.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const wordlist: string[]; diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/french.js b/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/french.js deleted file mode 100644 index 4a67ca45..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/french.js +++ /dev/null @@ -1,2048 +0,0 @@ -export const wordlist = `abaisser -abandon -abdiquer -abeille -abolir -aborder -aboutir -aboyer -abrasif -abreuver -abriter -abroger -abrupt -absence -absolu -absurde -abusif -abyssal -académie -acajou -acarien -accabler -accepter -acclamer -accolade -accroche -accuser -acerbe -achat -acheter -aciduler -acier -acompte -acquérir -acronyme -acteur -actif -actuel -adepte -adéquat -adhésif -adjectif -adjuger -admettre -admirer -adopter -adorer -adoucir -adresse -adroit -adulte -adverbe -aérer -aéronef -affaire -affecter -affiche -affreux -affubler -agacer -agencer -agile -agiter -agrafer -agréable -agrume -aider -aiguille -ailier -aimable -aisance -ajouter -ajuster -alarmer -alchimie -alerte -algèbre -algue -aliéner -aliment -alléger -alliage -allouer -allumer -alourdir -alpaga -altesse -alvéole -amateur -ambigu -ambre -aménager -amertume -amidon -amiral -amorcer -amour -amovible -amphibie -ampleur -amusant -analyse -anaphore -anarchie -anatomie -ancien -anéantir -angle -angoisse -anguleux -animal -annexer -annonce -annuel -anodin -anomalie -anonyme -anormal -antenne -antidote -anxieux -apaiser -apéritif -aplanir -apologie -appareil -appeler -apporter -appuyer -aquarium -aqueduc -arbitre -arbuste -ardeur -ardoise -argent -arlequin -armature -armement -armoire -armure -arpenter -arracher -arriver -arroser -arsenic -artériel -article -aspect -asphalte -aspirer -assaut -asservir -assiette -associer -assurer -asticot -astre -astuce -atelier -atome -atrium -atroce -attaque -attentif -attirer -attraper -aubaine -auberge -audace -audible -augurer -aurore -automne -autruche -avaler -avancer -avarice -avenir -averse -aveugle -aviateur -avide -avion -aviser -avoine -avouer -avril -axial -axiome -badge -bafouer -bagage -baguette -baignade -balancer -balcon -baleine -balisage -bambin -bancaire -bandage -banlieue -bannière -banquier -barbier -baril -baron -barque -barrage -bassin -bastion -bataille -bateau -batterie -baudrier -bavarder -belette -bélier -belote -bénéfice -berceau -berger -berline -bermuda -besace -besogne -bétail -beurre -biberon -bicycle -bidule -bijou -bilan -bilingue -billard -binaire -biologie -biopsie -biotype -biscuit -bison -bistouri -bitume -bizarre -blafard -blague -blanchir -blessant -blinder -blond -bloquer -blouson -bobard -bobine -boire -boiser -bolide -bonbon -bondir -bonheur -bonifier -bonus -bordure -borne -botte -boucle -boueux -bougie -boulon -bouquin -bourse -boussole -boutique -boxeur -branche -brasier -brave -brebis -brèche -breuvage -bricoler -brigade -brillant -brioche -brique -brochure -broder -bronzer -brousse -broyeur -brume -brusque -brutal -bruyant -buffle -buisson -bulletin -bureau -burin -bustier -butiner -butoir -buvable -buvette -cabanon -cabine -cachette -cadeau -cadre -caféine -caillou -caisson -calculer -calepin -calibre -calmer -calomnie -calvaire -camarade -caméra -camion -campagne -canal -caneton -canon -cantine -canular -capable -caporal -caprice -capsule -capter -capuche -carabine -carbone -caresser -caribou -carnage -carotte -carreau -carton -cascade -casier -casque -cassure -causer -caution -cavalier -caverne -caviar -cédille -ceinture -céleste -cellule -cendrier -censurer -central -cercle -cérébral -cerise -cerner -cerveau -cesser -chagrin -chaise -chaleur -chambre -chance -chapitre -charbon -chasseur -chaton -chausson -chavirer -chemise -chenille -chéquier -chercher -cheval -chien -chiffre -chignon -chimère -chiot -chlorure -chocolat -choisir -chose -chouette -chrome -chute -cigare -cigogne -cimenter -cinéma -cintrer -circuler -cirer -cirque -citerne -citoyen -citron -civil -clairon -clameur -claquer -classe -clavier -client -cligner -climat -clivage -cloche -clonage -cloporte -cobalt -cobra -cocasse -cocotier -coder -codifier -coffre -cogner -cohésion -coiffer -coincer -colère -colibri -colline -colmater -colonel -combat -comédie -commande -compact -concert -conduire -confier -congeler -connoter -consonne -contact -convexe -copain -copie -corail -corbeau -cordage -corniche -corpus -correct -cortège -cosmique -costume -coton -coude -coupure -courage -couteau -couvrir -coyote -crabe -crainte -cravate -crayon -créature -créditer -crémeux -creuser -crevette -cribler -crier -cristal -critère -croire -croquer -crotale -crucial -cruel -crypter -cubique -cueillir -cuillère -cuisine -cuivre -culminer -cultiver -cumuler -cupide -curatif -curseur -cyanure -cycle -cylindre -cynique -daigner -damier -danger -danseur -dauphin -débattre -débiter -déborder -débrider -débutant -décaler -décembre -déchirer -décider -déclarer -décorer -décrire -décupler -dédale -déductif -déesse -défensif -défiler -défrayer -dégager -dégivrer -déglutir -dégrafer -déjeuner -délice -déloger -demander -demeurer -démolir -dénicher -dénouer -dentelle -dénuder -départ -dépenser -déphaser -déplacer -déposer -déranger -dérober -désastre -descente -désert -désigner -désobéir -dessiner -destrier -détacher -détester -détourer -détresse -devancer -devenir -deviner -devoir -diable -dialogue -diamant -dicter -différer -digérer -digital -digne -diluer -dimanche -diminuer -dioxyde -directif -diriger -discuter -disposer -dissiper -distance -divertir -diviser -docile -docteur -dogme -doigt -domaine -domicile -dompter -donateur -donjon -donner -dopamine -dortoir -dorure -dosage -doseur -dossier -dotation -douanier -double -douceur -douter -doyen -dragon -draper -dresser -dribbler -droiture -duperie -duplexe -durable -durcir -dynastie -éblouir -écarter -écharpe -échelle -éclairer -éclipse -éclore -écluse -école -économie -écorce -écouter -écraser -écrémer -écrivain -écrou -écume -écureuil -édifier -éduquer -effacer -effectif -effigie -effort -effrayer -effusion -égaliser -égarer -éjecter -élaborer -élargir -électron -élégant -éléphant -élève -éligible -élitisme -éloge -élucider -éluder -emballer -embellir -embryon -émeraude -émission -emmener -émotion -émouvoir -empereur -employer -emporter -emprise -émulsion -encadrer -enchère -enclave -encoche -endiguer -endosser -endroit -enduire -énergie -enfance -enfermer -enfouir -engager -engin -englober -énigme -enjamber -enjeu -enlever -ennemi -ennuyeux -enrichir -enrobage -enseigne -entasser -entendre -entier -entourer -entraver -énumérer -envahir -enviable -envoyer -enzyme -éolien -épaissir -épargne -épatant -épaule -épicerie -épidémie -épier -épilogue -épine -épisode -épitaphe -époque -épreuve -éprouver -épuisant -équerre -équipe -ériger -érosion -erreur -éruption -escalier -espadon -espèce -espiègle -espoir -esprit -esquiver -essayer -essence -essieu -essorer -estime -estomac -estrade -étagère -étaler -étanche -étatique -éteindre -étendoir -éternel -éthanol -éthique -ethnie -étirer -étoffer -étoile -étonnant -étourdir -étrange -étroit -étude -euphorie -évaluer -évasion -éventail -évidence -éviter -évolutif -évoquer -exact -exagérer -exaucer -exceller -excitant -exclusif -excuse -exécuter -exemple -exercer -exhaler -exhorter -exigence -exiler -exister -exotique -expédier -explorer -exposer -exprimer -exquis -extensif -extraire -exulter -fable -fabuleux -facette -facile -facture -faiblir -falaise -fameux -famille -farceur -farfelu -farine -farouche -fasciner -fatal -fatigue -faucon -fautif -faveur -favori -fébrile -féconder -fédérer -félin -femme -fémur -fendoir -féodal -fermer -féroce -ferveur -festival -feuille -feutre -février -fiasco -ficeler -fictif -fidèle -figure -filature -filetage -filière -filleul -filmer -filou -filtrer -financer -finir -fiole -firme -fissure -fixer -flairer -flamme -flasque -flatteur -fléau -flèche -fleur -flexion -flocon -flore -fluctuer -fluide -fluvial -folie -fonderie -fongible -fontaine -forcer -forgeron -formuler -fortune -fossile -foudre -fougère -fouiller -foulure -fourmi -fragile -fraise -franchir -frapper -frayeur -frégate -freiner -frelon -frémir -frénésie -frère -friable -friction -frisson -frivole -froid -fromage -frontal -frotter -fruit -fugitif -fuite -fureur -furieux -furtif -fusion -futur -gagner -galaxie -galerie -gambader -garantir -gardien -garnir -garrigue -gazelle -gazon -géant -gélatine -gélule -gendarme -général -génie -genou -gentil -géologie -géomètre -géranium -germe -gestuel -geyser -gibier -gicler -girafe -givre -glace -glaive -glisser -globe -gloire -glorieux -golfeur -gomme -gonfler -gorge -gorille -goudron -gouffre -goulot -goupille -gourmand -goutte -graduel -graffiti -graine -grand -grappin -gratuit -gravir -grenat -griffure -griller -grimper -grogner -gronder -grotte -groupe -gruger -grutier -gruyère -guépard -guerrier -guide -guimauve -guitare -gustatif -gymnaste -gyrostat -habitude -hachoir -halte -hameau -hangar -hanneton -haricot -harmonie -harpon -hasard -hélium -hématome -herbe -hérisson -hermine -héron -hésiter -heureux -hiberner -hibou -hilarant -histoire -hiver -homard -hommage -homogène -honneur -honorer -honteux -horde -horizon -horloge -hormone -horrible -houleux -housse -hublot -huileux -humain -humble -humide -humour -hurler -hydromel -hygiène -hymne -hypnose -idylle -ignorer -iguane -illicite -illusion -image -imbiber -imiter -immense -immobile -immuable -impact -impérial -implorer -imposer -imprimer -imputer -incarner -incendie -incident -incliner -incolore -indexer -indice -inductif -inédit -ineptie -inexact -infini -infliger -informer -infusion -ingérer -inhaler -inhiber -injecter -injure -innocent -inoculer -inonder -inscrire -insecte -insigne -insolite -inspirer -instinct -insulter -intact -intense -intime -intrigue -intuitif -inutile -invasion -inventer -inviter -invoquer -ironique -irradier -irréel -irriter -isoler -ivoire -ivresse -jaguar -jaillir -jambe -janvier -jardin -jauger -jaune -javelot -jetable -jeton -jeudi -jeunesse -joindre -joncher -jongler -joueur -jouissif -journal -jovial -joyau -joyeux -jubiler -jugement -junior -jupon -juriste -justice -juteux -juvénile -kayak -kimono -kiosque -label -labial -labourer -lacérer -lactose -lagune -laine -laisser -laitier -lambeau -lamelle -lampe -lanceur -langage -lanterne -lapin -largeur -larme -laurier -lavabo -lavoir -lecture -légal -léger -légume -lessive -lettre -levier -lexique -lézard -liasse -libérer -libre -licence -licorne -liège -lièvre -ligature -ligoter -ligue -limer -limite -limonade -limpide -linéaire -lingot -lionceau -liquide -lisière -lister -lithium -litige -littoral -livreur -logique -lointain -loisir -lombric -loterie -louer -lourd -loutre -louve -loyal -lubie -lucide -lucratif -lueur -lugubre -luisant -lumière -lunaire -lundi -luron -lutter -luxueux -machine -magasin -magenta -magique -maigre -maillon -maintien -mairie -maison -majorer -malaxer -maléfice -malheur -malice -mallette -mammouth -mandater -maniable -manquant -manteau -manuel -marathon -marbre -marchand -mardi -maritime -marqueur -marron -marteler -mascotte -massif -matériel -matière -matraque -maudire -maussade -mauve -maximal -méchant -méconnu -médaille -médecin -méditer -méduse -meilleur -mélange -mélodie -membre -mémoire -menacer -mener -menhir -mensonge -mentor -mercredi -mérite -merle -messager -mesure -métal -météore -méthode -métier -meuble -miauler -microbe -miette -mignon -migrer -milieu -million -mimique -mince -minéral -minimal -minorer -minute -miracle -miroiter -missile -mixte -mobile -moderne -moelleux -mondial -moniteur -monnaie -monotone -monstre -montagne -monument -moqueur -morceau -morsure -mortier -moteur -motif -mouche -moufle -moulin -mousson -mouton -mouvant -multiple -munition -muraille -murène -murmure -muscle -muséum -musicien -mutation -muter -mutuel -myriade -myrtille -mystère -mythique -nageur -nappe -narquois -narrer -natation -nation -nature -naufrage -nautique -navire -nébuleux -nectar -néfaste -négation -négliger -négocier -neige -nerveux -nettoyer -neurone -neutron -neveu -niche -nickel -nitrate -niveau -noble -nocif -nocturne -noirceur -noisette -nomade -nombreux -nommer -normatif -notable -notifier -notoire -nourrir -nouveau -novateur -novembre -novice -nuage -nuancer -nuire -nuisible -numéro -nuptial -nuque -nutritif -obéir -objectif -obliger -obscur -observer -obstacle -obtenir -obturer -occasion -occuper -océan -octobre -octroyer -octupler -oculaire -odeur -odorant -offenser -officier -offrir -ogive -oiseau -oisillon -olfactif -olivier -ombrage -omettre -onctueux -onduler -onéreux -onirique -opale -opaque -opérer -opinion -opportun -opprimer -opter -optique -orageux -orange -orbite -ordonner -oreille -organe -orgueil -orifice -ornement -orque -ortie -osciller -osmose -ossature -otarie -ouragan -ourson -outil -outrager -ouvrage -ovation -oxyde -oxygène -ozone -paisible -palace -palmarès -palourde -palper -panache -panda -pangolin -paniquer -panneau -panorama -pantalon -papaye -papier -papoter -papyrus -paradoxe -parcelle -paresse -parfumer -parler -parole -parrain -parsemer -partager -parure -parvenir -passion -pastèque -paternel -patience -patron -pavillon -pavoiser -payer -paysage -peigne -peintre -pelage -pélican -pelle -pelouse -peluche -pendule -pénétrer -pénible -pensif -pénurie -pépite -péplum -perdrix -perforer -période -permuter -perplexe -persil -perte -peser -pétale -petit -pétrir -peuple -pharaon -phobie -phoque -photon -phrase -physique -piano -pictural -pièce -pierre -pieuvre -pilote -pinceau -pipette -piquer -pirogue -piscine -piston -pivoter -pixel -pizza -placard -plafond -plaisir -planer -plaque -plastron -plateau -pleurer -plexus -pliage -plomb -plonger -pluie -plumage -pochette -poésie -poète -pointe -poirier -poisson -poivre -polaire -policier -pollen -polygone -pommade -pompier -ponctuel -pondérer -poney -portique -position -posséder -posture -potager -poteau -potion -pouce -poulain -poumon -pourpre -poussin -pouvoir -prairie -pratique -précieux -prédire -préfixe -prélude -prénom -présence -prétexte -prévoir -primitif -prince -prison -priver -problème -procéder -prodige -profond -progrès -proie -projeter -prologue -promener -propre -prospère -protéger -prouesse -proverbe -prudence -pruneau -psychose -public -puceron -puiser -pulpe -pulsar -punaise -punitif -pupitre -purifier -puzzle -pyramide -quasar -querelle -question -quiétude -quitter -quotient -racine -raconter -radieux -ragondin -raideur -raisin -ralentir -rallonge -ramasser -rapide -rasage -ratisser -ravager -ravin -rayonner -réactif -réagir -réaliser -réanimer -recevoir -réciter -réclamer -récolter -recruter -reculer -recycler -rédiger -redouter -refaire -réflexe -réformer -refrain -refuge -régalien -région -réglage -régulier -réitérer -rejeter -rejouer -relatif -relever -relief -remarque -remède -remise -remonter -remplir -remuer -renard -renfort -renifler -renoncer -rentrer -renvoi -replier -reporter -reprise -reptile -requin -réserve -résineux -résoudre -respect -rester -résultat -rétablir -retenir -réticule -retomber -retracer -réunion -réussir -revanche -revivre -révolte -révulsif -richesse -rideau -rieur -rigide -rigoler -rincer -riposter -risible -risque -rituel -rival -rivière -rocheux -romance -rompre -ronce -rondin -roseau -rosier -rotatif -rotor -rotule -rouge -rouille -rouleau -routine -royaume -ruban -rubis -ruche -ruelle -rugueux -ruiner -ruisseau -ruser -rustique -rythme -sabler -saboter -sabre -sacoche -safari -sagesse -saisir -salade -salive -salon -saluer -samedi -sanction -sanglier -sarcasme -sardine -saturer -saugrenu -saumon -sauter -sauvage -savant -savonner -scalpel -scandale -scélérat -scénario -sceptre -schéma -science -scinder -score -scrutin -sculpter -séance -sécable -sécher -secouer -sécréter -sédatif -séduire -seigneur -séjour -sélectif -semaine -sembler -semence -séminal -sénateur -sensible -sentence -séparer -séquence -serein -sergent -sérieux -serrure -sérum -service -sésame -sévir -sevrage -sextuple -sidéral -siècle -siéger -siffler -sigle -signal -silence -silicium -simple -sincère -sinistre -siphon -sirop -sismique -situer -skier -social -socle -sodium -soigneux -soldat -soleil -solitude -soluble -sombre -sommeil -somnoler -sonde -songeur -sonnette -sonore -sorcier -sortir -sosie -sottise -soucieux -soudure -souffle -soulever -soupape -source -soutirer -souvenir -spacieux -spatial -spécial -sphère -spiral -stable -station -sternum -stimulus -stipuler -strict -studieux -stupeur -styliste -sublime -substrat -subtil -subvenir -succès -sucre -suffixe -suggérer -suiveur -sulfate -superbe -supplier -surface -suricate -surmener -surprise -sursaut -survie -suspect -syllabe -symbole -symétrie -synapse -syntaxe -système -tabac -tablier -tactile -tailler -talent -talisman -talonner -tambour -tamiser -tangible -tapis -taquiner -tarder -tarif -tartine -tasse -tatami -tatouage -taupe -taureau -taxer -témoin -temporel -tenaille -tendre -teneur -tenir -tension -terminer -terne -terrible -tétine -texte -thème -théorie -thérapie -thorax -tibia -tiède -timide -tirelire -tiroir -tissu -titane -titre -tituber -toboggan -tolérant -tomate -tonique -tonneau -toponyme -torche -tordre -tornade -torpille -torrent -torse -tortue -totem -toucher -tournage -tousser -toxine -traction -trafic -tragique -trahir -train -trancher -travail -trèfle -tremper -trésor -treuil -triage -tribunal -tricoter -trilogie -triomphe -tripler -triturer -trivial -trombone -tronc -tropical -troupeau -tuile -tulipe -tumulte -tunnel -turbine -tuteur -tutoyer -tuyau -tympan -typhon -typique -tyran -ubuesque -ultime -ultrason -unanime -unifier -union -unique -unitaire -univers -uranium -urbain -urticant -usage -usine -usuel -usure -utile -utopie -vacarme -vaccin -vagabond -vague -vaillant -vaincre -vaisseau -valable -valise -vallon -valve -vampire -vanille -vapeur -varier -vaseux -vassal -vaste -vecteur -vedette -végétal -véhicule -veinard -véloce -vendredi -vénérer -venger -venimeux -ventouse -verdure -vérin -vernir -verrou -verser -vertu -veston -vétéran -vétuste -vexant -vexer -viaduc -viande -victoire -vidange -vidéo -vignette -vigueur -vilain -village -vinaigre -violon -vipère -virement -virtuose -virus -visage -viseur -vision -visqueux -visuel -vital -vitesse -viticole -vitrine -vivace -vivipare -vocation -voguer -voile -voisin -voiture -volaille -volcan -voltiger -volume -vorace -vortex -voter -vouloir -voyage -voyelle -wagon -xénon -yacht -zèbre -zénith -zeste -zoologie`.split('\n'); diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/italian.d.ts b/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/italian.d.ts deleted file mode 100644 index b566a1db..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/italian.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const wordlist: string[]; diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/italian.js b/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/italian.js deleted file mode 100644 index f273f2ea..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/italian.js +++ /dev/null @@ -1,2048 +0,0 @@ -export const wordlist = `abaco -abbaglio -abbinato -abete -abisso -abolire -abrasivo -abrogato -accadere -accenno -accusato -acetone -achille -acido -acqua -acre -acrilico -acrobata -acuto -adagio -addebito -addome -adeguato -aderire -adipe -adottare -adulare -affabile -affetto -affisso -affranto -aforisma -afoso -africano -agave -agente -agevole -aggancio -agire -agitare -agonismo -agricolo -agrumeto -aguzzo -alabarda -alato -albatro -alberato -albo -albume -alce -alcolico -alettone -alfa -algebra -aliante -alibi -alimento -allagato -allegro -allievo -allodola -allusivo -almeno -alogeno -alpaca -alpestre -altalena -alterno -alticcio -altrove -alunno -alveolo -alzare -amalgama -amanita -amarena -ambito -ambrato -ameba -america -ametista -amico -ammasso -ammenda -ammirare -ammonito -amore -ampio -ampliare -amuleto -anacardo -anagrafe -analista -anarchia -anatra -anca -ancella -ancora -andare -andrea -anello -angelo -angolare -angusto -anima -annegare -annidato -anno -annuncio -anonimo -anticipo -anzi -apatico -apertura -apode -apparire -appetito -appoggio -approdo -appunto -aprile -arabica -arachide -aragosta -araldica -arancio -aratura -arazzo -arbitro -archivio -ardito -arenile -argento -argine -arguto -aria -armonia -arnese -arredato -arringa -arrosto -arsenico -arso -artefice -arzillo -asciutto -ascolto -asepsi -asettico -asfalto -asino -asola -aspirato -aspro -assaggio -asse -assoluto -assurdo -asta -astenuto -astice -astratto -atavico -ateismo -atomico -atono -attesa -attivare -attorno -attrito -attuale -ausilio -austria -autista -autonomo -autunno -avanzato -avere -avvenire -avviso -avvolgere -azione -azoto -azzimo -azzurro -babele -baccano -bacino -baco -badessa -badilata -bagnato -baita -balcone -baldo -balena -ballata -balzano -bambino -bandire -baraonda -barbaro -barca -baritono -barlume -barocco -basilico -basso -batosta -battuto -baule -bava -bavosa -becco -beffa -belgio -belva -benda -benevole -benigno -benzina -bere -berlina -beta -bibita -bici -bidone -bifido -biga -bilancia -bimbo -binocolo -biologo -bipede -bipolare -birbante -birra -biscotto -bisesto -bisnonno -bisonte -bisturi -bizzarro -blando -blatta -bollito -bonifico -bordo -bosco -botanico -bottino -bozzolo -braccio -bradipo -brama -branca -bravura -bretella -brevetto -brezza -briglia -brillante -brindare -broccolo -brodo -bronzina -brullo -bruno -bubbone -buca -budino -buffone -buio -bulbo -buono -burlone -burrasca -bussola -busta -cadetto -caduco -calamaro -calcolo -calesse -calibro -calmo -caloria -cambusa -camerata -camicia -cammino -camola -campale -canapa -candela -cane -canino -canotto -cantina -capace -capello -capitolo -capogiro -cappero -capra -capsula -carapace -carcassa -cardo -carisma -carovana -carretto -cartolina -casaccio -cascata -caserma -caso -cassone -castello -casuale -catasta -catena -catrame -cauto -cavillo -cedibile -cedrata -cefalo -celebre -cellulare -cena -cenone -centesimo -ceramica -cercare -certo -cerume -cervello -cesoia -cespo -ceto -chela -chiaro -chicca -chiedere -chimera -china -chirurgo -chitarra -ciao -ciclismo -cifrare -cigno -cilindro -ciottolo -circa -cirrosi -citrico -cittadino -ciuffo -civetta -civile -classico -clinica -cloro -cocco -codardo -codice -coerente -cognome -collare -colmato -colore -colposo -coltivato -colza -coma -cometa -commando -comodo -computer -comune -conciso -condurre -conferma -congelare -coniuge -connesso -conoscere -consumo -continuo -convegno -coperto -copione -coppia -copricapo -corazza -cordata -coricato -cornice -corolla -corpo -corredo -corsia -cortese -cosmico -costante -cottura -covato -cratere -cravatta -creato -credere -cremoso -crescita -creta -criceto -crinale -crisi -critico -croce -cronaca -crostata -cruciale -crusca -cucire -cuculo -cugino -cullato -cupola -curatore -cursore -curvo -cuscino -custode -dado -daino -dalmata -damerino -daniela -dannoso -danzare -datato -davanti -davvero -debutto -decennio -deciso -declino -decollo -decreto -dedicato -definito -deforme -degno -delegare -delfino -delirio -delta -demenza -denotato -dentro -deposito -derapata -derivare -deroga -descritto -deserto -desiderio -desumere -detersivo -devoto -diametro -dicembre -diedro -difeso -diffuso -digerire -digitale -diluvio -dinamico -dinnanzi -dipinto -diploma -dipolo -diradare -dire -dirotto -dirupo -disagio -discreto -disfare -disgelo -disposto -distanza -disumano -dito -divano -divelto -dividere -divorato -doblone -docente -doganale -dogma -dolce -domato -domenica -dominare -dondolo -dono -dormire -dote -dottore -dovuto -dozzina -drago -druido -dubbio -dubitare -ducale -duna -duomo -duplice -duraturo -ebano -eccesso -ecco -eclissi -economia -edera -edicola -edile -editoria -educare -egemonia -egli -egoismo -egregio -elaborato -elargire -elegante -elencato -eletto -elevare -elfico -elica -elmo -elsa -eluso -emanato -emblema -emesso -emiro -emotivo -emozione -empirico -emulo -endemico -enduro -energia -enfasi -enoteca -entrare -enzima -epatite -epilogo -episodio -epocale -eppure -equatore -erario -erba -erboso -erede -eremita -erigere -ermetico -eroe -erosivo -errante -esagono -esame -esanime -esaudire -esca -esempio -esercito -esibito -esigente -esistere -esito -esofago -esortato -esoso -espanso -espresso -essenza -esso -esteso -estimare -estonia -estroso -esultare -etilico -etnico -etrusco -etto -euclideo -europa -evaso -evidenza -evitato -evoluto -evviva -fabbrica -faccenda -fachiro -falco -famiglia -fanale -fanfara -fango -fantasma -fare -farfalla -farinoso -farmaco -fascia -fastoso -fasullo -faticare -fato -favoloso -febbre -fecola -fede -fegato -felpa -feltro -femmina -fendere -fenomeno -fermento -ferro -fertile -fessura -festivo -fetta -feudo -fiaba -fiducia -fifa -figurato -filo -finanza -finestra -finire -fiore -fiscale -fisico -fiume -flacone -flamenco -flebo -flemma -florido -fluente -fluoro -fobico -focaccia -focoso -foderato -foglio -folata -folclore -folgore -fondente -fonetico -fonia -fontana -forbito -forchetta -foresta -formica -fornaio -foro -fortezza -forzare -fosfato -fosso -fracasso -frana -frassino -fratello -freccetta -frenata -fresco -frigo -frollino -fronde -frugale -frutta -fucilata -fucsia -fuggente -fulmine -fulvo -fumante -fumetto -fumoso -fune -funzione -fuoco -furbo -furgone -furore -fuso -futile -gabbiano -gaffe -galateo -gallina -galoppo -gambero -gamma -garanzia -garbo -garofano -garzone -gasdotto -gasolio -gastrico -gatto -gaudio -gazebo -gazzella -geco -gelatina -gelso -gemello -gemmato -gene -genitore -gennaio -genotipo -gergo -ghepardo -ghiaccio -ghisa -giallo -gilda -ginepro -giocare -gioiello -giorno -giove -girato -girone -gittata -giudizio -giurato -giusto -globulo -glutine -gnomo -gobba -golf -gomito -gommone -gonfio -gonna -governo -gracile -grado -grafico -grammo -grande -grattare -gravoso -grazia -greca -gregge -grifone -grigio -grinza -grotta -gruppo -guadagno -guaio -guanto -guardare -gufo -guidare -ibernato -icona -identico -idillio -idolo -idra -idrico -idrogeno -igiene -ignaro -ignorato -ilare -illeso -illogico -illudere -imballo -imbevuto -imbocco -imbuto -immane -immerso -immolato -impacco -impeto -impiego -importo -impronta -inalare -inarcare -inattivo -incanto -incendio -inchino -incisivo -incluso -incontro -incrocio -incubo -indagine -india -indole -inedito -infatti -infilare -inflitto -ingaggio -ingegno -inglese -ingordo -ingrosso -innesco -inodore -inoltrare -inondato -insano -insetto -insieme -insonnia -insulina -intasato -intero -intonaco -intuito -inumidire -invalido -invece -invito -iperbole -ipnotico -ipotesi -ippica -iride -irlanda -ironico -irrigato -irrorare -isolato -isotopo -isterico -istituto -istrice -italia -iterare -labbro -labirinto -lacca -lacerato -lacrima -lacuna -laddove -lago -lampo -lancetta -lanterna -lardoso -larga -laringe -lastra -latenza -latino -lattuga -lavagna -lavoro -legale -leggero -lembo -lentezza -lenza -leone -lepre -lesivo -lessato -lesto -letterale -leva -levigato -libero -lido -lievito -lilla -limatura -limitare -limpido -lineare -lingua -liquido -lira -lirica -lisca -lite -litigio -livrea -locanda -lode -logica -lombare -londra -longevo -loquace -lorenzo -loto -lotteria -luce -lucidato -lumaca -luminoso -lungo -lupo -luppolo -lusinga -lusso -lutto -macabro -macchina -macero -macinato -madama -magico -maglia -magnete -magro -maiolica -malafede -malgrado -malinteso -malsano -malto -malumore -mana -mancia -mandorla -mangiare -manifesto -mannaro -manovra -mansarda -mantide -manubrio -mappa -maratona -marcire -maretta -marmo -marsupio -maschera -massaia -mastino -materasso -matricola -mattone -maturo -mazurca -meandro -meccanico -mecenate -medesimo -meditare -mega -melassa -melis -melodia -meninge -meno -mensola -mercurio -merenda -merlo -meschino -mese -messere -mestolo -metallo -metodo -mettere -miagolare -mica -micelio -michele -microbo -midollo -miele -migliore -milano -milite -mimosa -minerale -mini -minore -mirino -mirtillo -miscela -missiva -misto -misurare -mitezza -mitigare -mitra -mittente -mnemonico -modello -modifica -modulo -mogano -mogio -mole -molosso -monastero -monco -mondina -monetario -monile -monotono -monsone -montato -monviso -mora -mordere -morsicato -mostro -motivato -motosega -motto -movenza -movimento -mozzo -mucca -mucosa -muffa -mughetto -mugnaio -mulatto -mulinello -multiplo -mummia -munto -muovere -murale -musa -muscolo -musica -mutevole -muto -nababbo -nafta -nanometro -narciso -narice -narrato -nascere -nastrare -naturale -nautica -naviglio -nebulosa -necrosi -negativo -negozio -nemmeno -neofita -neretto -nervo -nessuno -nettuno -neutrale -neve -nevrotico -nicchia -ninfa -nitido -nobile -nocivo -nodo -nome -nomina -nordico -normale -norvegese -nostrano -notare -notizia -notturno -novella -nucleo -nulla -numero -nuovo -nutrire -nuvola -nuziale -oasi -obbedire -obbligo -obelisco -oblio -obolo -obsoleto -occasione -occhio -occidente -occorrere -occultare -ocra -oculato -odierno -odorare -offerta -offrire -offuscato -oggetto -oggi -ognuno -olandese -olfatto -oliato -oliva -ologramma -oltre -omaggio -ombelico -ombra -omega -omissione -ondoso -onere -onice -onnivoro -onorevole -onta -operato -opinione -opposto -oracolo -orafo -ordine -orecchino -orefice -orfano -organico -origine -orizzonte -orma -ormeggio -ornativo -orologio -orrendo -orribile -ortensia -ortica -orzata -orzo -osare -oscurare -osmosi -ospedale -ospite -ossa -ossidare -ostacolo -oste -otite -otre -ottagono -ottimo -ottobre -ovale -ovest -ovino -oviparo -ovocito -ovunque -ovviare -ozio -pacchetto -pace -pacifico -padella -padrone -paese -paga -pagina -palazzina -palesare -pallido -palo -palude -pandoro -pannello -paolo -paonazzo -paprica -parabola -parcella -parere -pargolo -pari -parlato -parola -partire -parvenza -parziale -passivo -pasticca -patacca -patologia -pattume -pavone -peccato -pedalare -pedonale -peggio -peloso -penare -pendice -penisola -pennuto -penombra -pensare -pentola -pepe -pepita -perbene -percorso -perdonato -perforare -pergamena -periodo -permesso -perno -perplesso -persuaso -pertugio -pervaso -pesatore -pesista -peso -pestifero -petalo -pettine -petulante -pezzo -piacere -pianta -piattino -piccino -picozza -piega -pietra -piffero -pigiama -pigolio -pigro -pila -pilifero -pillola -pilota -pimpante -pineta -pinna -pinolo -pioggia -piombo -piramide -piretico -pirite -pirolisi -pitone -pizzico -placebo -planare -plasma -platano -plenario -pochezza -poderoso -podismo -poesia -poggiare -polenta -poligono -pollice -polmonite -polpetta -polso -poltrona -polvere -pomice -pomodoro -ponte -popoloso -porfido -poroso -porpora -porre -portata -posa -positivo -possesso -postulato -potassio -potere -pranzo -prassi -pratica -precluso -predica -prefisso -pregiato -prelievo -premere -prenotare -preparato -presenza -pretesto -prevalso -prima -principe -privato -problema -procura -produrre -profumo -progetto -prolunga -promessa -pronome -proposta -proroga -proteso -prova -prudente -prugna -prurito -psiche -pubblico -pudica -pugilato -pugno -pulce -pulito -pulsante -puntare -pupazzo -pupilla -puro -quadro -qualcosa -quasi -querela -quota -raccolto -raddoppio -radicale -radunato -raffica -ragazzo -ragione -ragno -ramarro -ramingo -ramo -randagio -rantolare -rapato -rapina -rappreso -rasatura -raschiato -rasente -rassegna -rastrello -rata -ravveduto -reale -recepire -recinto -recluta -recondito -recupero -reddito -redimere -regalato -registro -regola -regresso -relazione -remare -remoto -renna -replica -reprimere -reputare -resa -residente -responso -restauro -rete -retina -retorica -rettifica -revocato -riassunto -ribadire -ribelle -ribrezzo -ricarica -ricco -ricevere -riciclato -ricordo -ricreduto -ridicolo -ridurre -rifasare -riflesso -riforma -rifugio -rigare -rigettato -righello -rilassato -rilevato -rimanere -rimbalzo -rimedio -rimorchio -rinascita -rincaro -rinforzo -rinnovo -rinomato -rinsavito -rintocco -rinuncia -rinvenire -riparato -ripetuto -ripieno -riportare -ripresa -ripulire -risata -rischio -riserva -risibile -riso -rispetto -ristoro -risultato -risvolto -ritardo -ritegno -ritmico -ritrovo -riunione -riva -riverso -rivincita -rivolto -rizoma -roba -robotico -robusto -roccia -roco -rodaggio -rodere -roditore -rogito -rollio -romantico -rompere -ronzio -rosolare -rospo -rotante -rotondo -rotula -rovescio -rubizzo -rubrica -ruga -rullino -rumine -rumoroso -ruolo -rupe -russare -rustico -sabato -sabbiare -sabotato -sagoma -salasso -saldatura -salgemma -salivare -salmone -salone -saltare -saluto -salvo -sapere -sapido -saporito -saraceno -sarcasmo -sarto -sassoso -satellite -satira -satollo -saturno -savana -savio -saziato -sbadiglio -sbalzo -sbancato -sbarra -sbattere -sbavare -sbendare -sbirciare -sbloccato -sbocciato -sbrinare -sbruffone -sbuffare -scabroso -scadenza -scala -scambiare -scandalo -scapola -scarso -scatenare -scavato -scelto -scenico -scettro -scheda -schiena -sciarpa -scienza -scindere -scippo -sciroppo -scivolo -sclerare -scodella -scolpito -scomparto -sconforto -scoprire -scorta -scossone -scozzese -scriba -scrollare -scrutinio -scuderia -scultore -scuola -scuro -scusare -sdebitare -sdoganare -seccatura -secondo -sedano -seggiola -segnalato -segregato -seguito -selciato -selettivo -sella -selvaggio -semaforo -sembrare -seme -seminato -sempre -senso -sentire -sepolto -sequenza -serata -serbato -sereno -serio -serpente -serraglio -servire -sestina -setola -settimana -sfacelo -sfaldare -sfamato -sfarzoso -sfaticato -sfera -sfida -sfilato -sfinge -sfocato -sfoderare -sfogo -sfoltire -sforzato -sfratto -sfruttato -sfuggito -sfumare -sfuso -sgabello -sgarbato -sgonfiare -sgorbio -sgrassato -sguardo -sibilo -siccome -sierra -sigla -signore -silenzio -sillaba -simbolo -simpatico -simulato -sinfonia -singolo -sinistro -sino -sintesi -sinusoide -sipario -sisma -sistole -situato -slitta -slogatura -sloveno -smarrito -smemorato -smentito -smeraldo -smilzo -smontare -smottato -smussato -snellire -snervato -snodo -sobbalzo -sobrio -soccorso -sociale -sodale -soffitto -sogno -soldato -solenne -solido -sollazzo -solo -solubile -solvente -somatico -somma -sonda -sonetto -sonnifero -sopire -soppeso -sopra -sorgere -sorpasso -sorriso -sorso -sorteggio -sorvolato -sospiro -sosta -sottile -spada -spalla -spargere -spatola -spavento -spazzola -specie -spedire -spegnere -spelatura -speranza -spessore -spettrale -spezzato -spia -spigoloso -spillato -spinoso -spirale -splendido -sportivo -sposo -spranga -sprecare -spronato -spruzzo -spuntino -squillo -sradicare -srotolato -stabile -stacco -staffa -stagnare -stampato -stantio -starnuto -stasera -statuto -stelo -steppa -sterzo -stiletto -stima -stirpe -stivale -stizzoso -stonato -storico -strappo -stregato -stridulo -strozzare -strutto -stuccare -stufo -stupendo -subentro -succoso -sudore -suggerito -sugo -sultano -suonare -superbo -supporto -surgelato -surrogato -sussurro -sutura -svagare -svedese -sveglio -svelare -svenuto -svezia -sviluppo -svista -svizzera -svolta -svuotare -tabacco -tabulato -tacciare -taciturno -tale -talismano -tampone -tannino -tara -tardivo -targato -tariffa -tarpare -tartaruga -tasto -tattico -taverna -tavolata -tazza -teca -tecnico -telefono -temerario -tempo -temuto -tendone -tenero -tensione -tentacolo -teorema -terme -terrazzo -terzetto -tesi -tesserato -testato -tetro -tettoia -tifare -tigella -timbro -tinto -tipico -tipografo -tiraggio -tiro -titanio -titolo -titubante -tizio -tizzone -toccare -tollerare -tolto -tombola -tomo -tonfo -tonsilla -topazio -topologia -toppa -torba -tornare -torrone -tortora -toscano -tossire -tostatura -totano -trabocco -trachea -trafila -tragedia -tralcio -tramonto -transito -trapano -trarre -trasloco -trattato -trave -treccia -tremolio -trespolo -tributo -tricheco -trifoglio -trillo -trincea -trio -tristezza -triturato -trivella -tromba -trono -troppo -trottola -trovare -truccato -tubatura -tuffato -tulipano -tumulto -tunisia -turbare -turchino -tuta -tutela -ubicato -uccello -uccisore -udire -uditivo -uffa -ufficio -uguale -ulisse -ultimato -umano -umile -umorismo -uncinetto -ungere -ungherese -unicorno -unificato -unisono -unitario -unte -uovo -upupa -uragano -urgenza -urlo -usanza -usato -uscito -usignolo -usuraio -utensile -utilizzo -utopia -vacante -vaccinato -vagabondo -vagliato -valanga -valgo -valico -valletta -valoroso -valutare -valvola -vampata -vangare -vanitoso -vano -vantaggio -vanvera -vapore -varano -varcato -variante -vasca -vedetta -vedova -veduto -vegetale -veicolo -velcro -velina -velluto -veloce -venato -vendemmia -vento -verace -verbale -vergogna -verifica -vero -verruca -verticale -vescica -vessillo -vestale -veterano -vetrina -vetusto -viandante -vibrante -vicenda -vichingo -vicinanza -vidimare -vigilia -vigneto -vigore -vile -villano -vimini -vincitore -viola -vipera -virgola -virologo -virulento -viscoso -visione -vispo -vissuto -visura -vita -vitello -vittima -vivanda -vivido -viziare -voce -voga -volatile -volere -volpe -voragine -vulcano -zampogna -zanna -zappato -zattera -zavorra -zefiro -zelante -zelo -zenzero -zerbino -zibetto -zinco -zircone -zitto -zolla -zotico -zucchero -zufolo -zulu -zuppa`.split('\n'); diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/japanese.d.ts b/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/japanese.d.ts deleted file mode 100644 index b566a1db..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/japanese.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const wordlist: string[]; diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/japanese.js b/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/japanese.js deleted file mode 100644 index d0501299..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/japanese.js +++ /dev/null @@ -1,2048 +0,0 @@ -export const wordlist = `あいこくしん -あいさつ -あいだ -あおぞら -あかちゃん -あきる -あけがた -あける -あこがれる -あさい -あさひ -あしあと -あじわう -あずかる -あずき -あそぶ -あたえる -あたためる -あたりまえ -あたる -あつい -あつかう -あっしゅく -あつまり -あつめる -あてな -あてはまる -あひる -あぶら -あぶる -あふれる -あまい -あまど -あまやかす -あまり -あみもの -あめりか -あやまる -あゆむ -あらいぐま -あらし -あらすじ -あらためる -あらゆる -あらわす -ありがとう -あわせる -あわてる -あんい -あんがい -あんこ -あんぜん -あんてい -あんない -あんまり -いいだす -いおん -いがい -いがく -いきおい -いきなり -いきもの -いきる -いくじ -いくぶん -いけばな -いけん -いこう -いこく -いこつ -いさましい -いさん -いしき -いじゅう -いじょう -いじわる -いずみ -いずれ -いせい -いせえび -いせかい -いせき -いぜん -いそうろう -いそがしい -いだい -いだく -いたずら -いたみ -いたりあ -いちおう -いちじ -いちど -いちば -いちぶ -いちりゅう -いつか -いっしゅん -いっせい -いっそう -いったん -いっち -いってい -いっぽう -いてざ -いてん -いどう -いとこ -いない -いなか -いねむり -いのち -いのる -いはつ -いばる -いはん -いびき -いひん -いふく -いへん -いほう -いみん -いもうと -いもたれ -いもり -いやがる -いやす -いよかん -いよく -いらい -いらすと -いりぐち -いりょう -いれい -いれもの -いれる -いろえんぴつ -いわい -いわう -いわかん -いわば -いわゆる -いんげんまめ -いんさつ -いんしょう -いんよう -うえき -うえる -うおざ -うがい -うかぶ -うかべる -うきわ -うくらいな -うくれれ -うけたまわる -うけつけ -うけとる -うけもつ -うける -うごかす -うごく -うこん -うさぎ -うしなう -うしろがみ -うすい -うすぎ -うすぐらい -うすめる -うせつ -うちあわせ -うちがわ -うちき -うちゅう -うっかり -うつくしい -うったえる -うつる -うどん -うなぎ -うなじ -うなずく -うなる -うねる -うのう -うぶげ -うぶごえ -うまれる -うめる -うもう -うやまう -うよく -うらがえす -うらぐち -うらない -うりあげ -うりきれ -うるさい -うれしい -うれゆき -うれる -うろこ -うわき -うわさ -うんこう -うんちん -うんてん -うんどう -えいえん -えいが -えいきょう -えいご -えいせい -えいぶん -えいよう -えいわ -えおり -えがお -えがく -えきたい -えくせる -えしゃく -えすて -えつらん -えのぐ -えほうまき -えほん -えまき -えもじ -えもの -えらい -えらぶ -えりあ -えんえん -えんかい -えんぎ -えんげき -えんしゅう -えんぜつ -えんそく -えんちょう -えんとつ -おいかける -おいこす -おいしい -おいつく -おうえん -おうさま -おうじ -おうせつ -おうたい -おうふく -おうべい -おうよう -おえる -おおい -おおう -おおどおり -おおや -おおよそ -おかえり -おかず -おがむ -おかわり -おぎなう -おきる -おくさま -おくじょう -おくりがな -おくる -おくれる -おこす -おこなう -おこる -おさえる -おさない -おさめる -おしいれ -おしえる -おじぎ -おじさん -おしゃれ -おそらく -おそわる -おたがい -おたく -おだやか -おちつく -おっと -おつり -おでかけ -おとしもの -おとなしい -おどり -おどろかす -おばさん -おまいり -おめでとう -おもいで -おもう -おもたい -おもちゃ -おやつ -おやゆび -およぼす -おらんだ -おろす -おんがく -おんけい -おんしゃ -おんせん -おんだん -おんちゅう -おんどけい -かあつ -かいが -がいき -がいけん -がいこう -かいさつ -かいしゃ -かいすいよく -かいぜん -かいぞうど -かいつう -かいてん -かいとう -かいふく -がいへき -かいほう -かいよう -がいらい -かいわ -かえる -かおり -かかえる -かがく -かがし -かがみ -かくご -かくとく -かざる -がぞう -かたい -かたち -がちょう -がっきゅう -がっこう -がっさん -がっしょう -かなざわし -かのう -がはく -かぶか -かほう -かほご -かまう -かまぼこ -かめれおん -かゆい -かようび -からい -かるい -かろう -かわく -かわら -がんか -かんけい -かんこう -かんしゃ -かんそう -かんたん -かんち -がんばる -きあい -きあつ -きいろ -ぎいん -きうい -きうん -きえる -きおう -きおく -きおち -きおん -きかい -きかく -きかんしゃ -ききて -きくばり -きくらげ -きけんせい -きこう -きこえる -きこく -きさい -きさく -きさま -きさらぎ -ぎじかがく -ぎしき -ぎじたいけん -ぎじにってい -ぎじゅつしゃ -きすう -きせい -きせき -きせつ -きそう -きぞく -きぞん -きたえる -きちょう -きつえん -ぎっちり -きつつき -きつね -きてい -きどう -きどく -きない -きなが -きなこ -きぬごし -きねん -きのう -きのした -きはく -きびしい -きひん -きふく -きぶん -きぼう -きほん -きまる -きみつ -きむずかしい -きめる -きもだめし -きもち -きもの -きゃく -きやく -ぎゅうにく -きよう -きょうりゅう -きらい -きらく -きりん -きれい -きれつ -きろく -ぎろん -きわめる -ぎんいろ -きんかくじ -きんじょ -きんようび -ぐあい -くいず -くうかん -くうき -くうぐん -くうこう -ぐうせい -くうそう -ぐうたら -くうふく -くうぼ -くかん -くきょう -くげん -ぐこう -くさい -くさき -くさばな -くさる -くしゃみ -くしょう -くすのき -くすりゆび -くせげ -くせん -ぐたいてき -くださる -くたびれる -くちこみ -くちさき -くつした -ぐっすり -くつろぐ -くとうてん -くどく -くなん -くねくね -くのう -くふう -くみあわせ -くみたてる -くめる -くやくしょ -くらす -くらべる -くるま -くれる -くろう -くわしい -ぐんかん -ぐんしょく -ぐんたい -ぐんて -けあな -けいかく -けいけん -けいこ -けいさつ -げいじゅつ -けいたい -げいのうじん -けいれき -けいろ -けおとす -けおりもの -げきか -げきげん -げきだん -げきちん -げきとつ -げきは -げきやく -げこう -げこくじょう -げざい -けさき -げざん -けしき -けしごむ -けしょう -げすと -けたば -けちゃっぷ -けちらす -けつあつ -けつい -けつえき -けっこん -けつじょ -けっせき -けってい -けつまつ -げつようび -げつれい -けつろん -げどく -けとばす -けとる -けなげ -けなす -けなみ -けぬき -げねつ -けねん -けはい -げひん -けぶかい -げぼく -けまり -けみかる -けむし -けむり -けもの -けらい -けろけろ -けわしい -けんい -けんえつ -けんお -けんか -げんき -けんげん -けんこう -けんさく -けんしゅう -けんすう -げんそう -けんちく -けんてい -けんとう -けんない -けんにん -げんぶつ -けんま -けんみん -けんめい -けんらん -けんり -こあくま -こいぬ -こいびと -ごうい -こうえん -こうおん -こうかん -ごうきゅう -ごうけい -こうこう -こうさい -こうじ -こうすい -ごうせい -こうそく -こうたい -こうちゃ -こうつう -こうてい -こうどう -こうない -こうはい -ごうほう -ごうまん -こうもく -こうりつ -こえる -こおり -ごかい -ごがつ -ごかん -こくご -こくさい -こくとう -こくない -こくはく -こぐま -こけい -こける -ここのか -こころ -こさめ -こしつ -こすう -こせい -こせき -こぜん -こそだて -こたい -こたえる -こたつ -こちょう -こっか -こつこつ -こつばん -こつぶ -こてい -こてん -ことがら -ことし -ことば -ことり -こなごな -こねこね -このまま -このみ -このよ -ごはん -こひつじ -こふう -こふん -こぼれる -ごまあぶら -こまかい -ごますり -こまつな -こまる -こむぎこ -こもじ -こもち -こもの -こもん -こやく -こやま -こゆう -こゆび -こよい -こよう -こりる -これくしょん -ころっけ -こわもて -こわれる -こんいん -こんかい -こんき -こんしゅう -こんすい -こんだて -こんとん -こんなん -こんびに -こんぽん -こんまけ -こんや -こんれい -こんわく -ざいえき -さいかい -さいきん -ざいげん -ざいこ -さいしょ -さいせい -ざいたく -ざいちゅう -さいてき -ざいりょう -さうな -さかいし -さがす -さかな -さかみち -さがる -さぎょう -さくし -さくひん -さくら -さこく -さこつ -さずかる -ざせき -さたん -さつえい -ざつおん -ざっか -ざつがく -さっきょく -ざっし -さつじん -ざっそう -さつたば -さつまいも -さてい -さといも -さとう -さとおや -さとし -さとる -さのう -さばく -さびしい -さべつ -さほう -さほど -さます -さみしい -さみだれ -さむけ -さめる -さやえんどう -さゆう -さよう -さよく -さらだ -ざるそば -さわやか -さわる -さんいん -さんか -さんきゃく -さんこう -さんさい -ざんしょ -さんすう -さんせい -さんそ -さんち -さんま -さんみ -さんらん -しあい -しあげ -しあさって -しあわせ -しいく -しいん -しうち -しえい -しおけ -しかい -しかく -じかん -しごと -しすう -じだい -したうけ -したぎ -したて -したみ -しちょう -しちりん -しっかり -しつじ -しつもん -してい -してき -してつ -じてん -じどう -しなぎれ -しなもの -しなん -しねま -しねん -しのぐ -しのぶ -しはい -しばかり -しはつ -しはらい -しはん -しひょう -しふく -じぶん -しへい -しほう -しほん -しまう -しまる -しみん -しむける -じむしょ -しめい -しめる -しもん -しゃいん -しゃうん -しゃおん -じゃがいも -しやくしょ -しゃくほう -しゃけん -しゃこ -しゃざい -しゃしん -しゃせん -しゃそう -しゃたい -しゃちょう -しゃっきん -じゃま -しゃりん -しゃれい -じゆう -じゅうしょ -しゅくはく -じゅしん -しゅっせき -しゅみ -しゅらば -じゅんばん -しょうかい -しょくたく -しょっけん -しょどう -しょもつ -しらせる -しらべる -しんか -しんこう -じんじゃ -しんせいじ -しんちく -しんりん -すあげ -すあし -すあな -ずあん -すいえい -すいか -すいとう -ずいぶん -すいようび -すうがく -すうじつ -すうせん -すおどり -すきま -すくう -すくない -すける -すごい -すこし -ずさん -すずしい -すすむ -すすめる -すっかり -ずっしり -ずっと -すてき -すてる -すねる -すのこ -すはだ -すばらしい -ずひょう -ずぶぬれ -すぶり -すふれ -すべて -すべる -ずほう -すぼん -すまい -すめし -すもう -すやき -すらすら -するめ -すれちがう -すろっと -すわる -すんぜん -すんぽう -せあぶら -せいかつ -せいげん -せいじ -せいよう -せおう -せかいかん -せきにん -せきむ -せきゆ -せきらんうん -せけん -せこう -せすじ -せたい -せたけ -せっかく -せっきゃく -ぜっく -せっけん -せっこつ -せっさたくま -せつぞく -せつだん -せつでん -せっぱん -せつび -せつぶん -せつめい -せつりつ -せなか -せのび -せはば -せびろ -せぼね -せまい -せまる -せめる -せもたれ -せりふ -ぜんあく -せんい -せんえい -せんか -せんきょ -せんく -せんげん -ぜんご -せんさい -せんしゅ -せんすい -せんせい -せんぞ -せんたく -せんちょう -せんてい -せんとう -せんぬき -せんねん -せんぱい -ぜんぶ -ぜんぽう -せんむ -せんめんじょ -せんもん -せんやく -せんゆう -せんよう -ぜんら -ぜんりゃく -せんれい -せんろ -そあく -そいとげる -そいね -そうがんきょう -そうき -そうご -そうしん -そうだん -そうなん -そうび -そうめん -そうり -そえもの -そえん -そがい -そげき -そこう -そこそこ -そざい -そしな -そせい -そせん -そそぐ -そだてる -そつう -そつえん -そっかん -そつぎょう -そっけつ -そっこう -そっせん -そっと -そとがわ -そとづら -そなえる -そなた -そふぼ -そぼく -そぼろ -そまつ -そまる -そむく -そむりえ -そめる -そもそも -そよかぜ -そらまめ -そろう -そんかい -そんけい -そんざい -そんしつ -そんぞく -そんちょう -ぞんび -ぞんぶん -そんみん -たあい -たいいん -たいうん -たいえき -たいおう -だいがく -たいき -たいぐう -たいけん -たいこ -たいざい -だいじょうぶ -だいすき -たいせつ -たいそう -だいたい -たいちょう -たいてい -だいどころ -たいない -たいねつ -たいのう -たいはん -だいひょう -たいふう -たいへん -たいほ -たいまつばな -たいみんぐ -たいむ -たいめん -たいやき -たいよう -たいら -たいりょく -たいる -たいわん -たうえ -たえる -たおす -たおる -たおれる -たかい -たかね -たきび -たくさん -たこく -たこやき -たさい -たしざん -だじゃれ -たすける -たずさわる -たそがれ -たたかう -たたく -ただしい -たたみ -たちばな -だっかい -だっきゃく -だっこ -だっしゅつ -だったい -たてる -たとえる -たなばた -たにん -たぬき -たのしみ -たはつ -たぶん -たべる -たぼう -たまご -たまる -だむる -ためいき -ためす -ためる -たもつ -たやすい -たよる -たらす -たりきほんがん -たりょう -たりる -たると -たれる -たれんと -たろっと -たわむれる -だんあつ -たんい -たんおん -たんか -たんき -たんけん -たんご -たんさん -たんじょうび -だんせい -たんそく -たんたい -だんち -たんてい -たんとう -だんな -たんにん -だんねつ -たんのう -たんぴん -だんぼう -たんまつ -たんめい -だんれつ -だんろ -だんわ -ちあい -ちあん -ちいき -ちいさい -ちえん -ちかい -ちから -ちきゅう -ちきん -ちけいず -ちけん -ちこく -ちさい -ちしき -ちしりょう -ちせい -ちそう -ちたい -ちたん -ちちおや -ちつじょ -ちてき -ちてん -ちぬき -ちぬり -ちのう -ちひょう -ちへいせん -ちほう -ちまた -ちみつ -ちみどろ -ちめいど -ちゃんこなべ -ちゅうい -ちゆりょく -ちょうし -ちょさくけん -ちらし -ちらみ -ちりがみ -ちりょう -ちるど -ちわわ -ちんたい -ちんもく -ついか -ついたち -つうか -つうじょう -つうはん -つうわ -つかう -つかれる -つくね -つくる -つけね -つける -つごう -つたえる -つづく -つつじ -つつむ -つとめる -つながる -つなみ -つねづね -つのる -つぶす -つまらない -つまる -つみき -つめたい -つもり -つもる -つよい -つるぼ -つるみく -つわもの -つわり -てあし -てあて -てあみ -ていおん -ていか -ていき -ていけい -ていこく -ていさつ -ていし -ていせい -ていたい -ていど -ていねい -ていひょう -ていへん -ていぼう -てうち -ておくれ -てきとう -てくび -でこぼこ -てさぎょう -てさげ -てすり -てそう -てちがい -てちょう -てつがく -てつづき -でっぱ -てつぼう -てつや -でぬかえ -てぬき -てぬぐい -てのひら -てはい -てぶくろ -てふだ -てほどき -てほん -てまえ -てまきずし -てみじか -てみやげ -てらす -てれび -てわけ -てわたし -でんあつ -てんいん -てんかい -てんき -てんぐ -てんけん -てんごく -てんさい -てんし -てんすう -でんち -てんてき -てんとう -てんない -てんぷら -てんぼうだい -てんめつ -てんらんかい -でんりょく -でんわ -どあい -といれ -どうかん -とうきゅう -どうぐ -とうし -とうむぎ -とおい -とおか -とおく -とおす -とおる -とかい -とかす -ときおり -ときどき -とくい -とくしゅう -とくてん -とくに -とくべつ -とけい -とける -とこや -とさか -としょかん -とそう -とたん -とちゅう -とっきゅう -とっくん -とつぜん -とつにゅう -とどける -ととのえる -とない -となえる -となり -とのさま -とばす -どぶがわ -とほう -とまる -とめる -ともだち -ともる -どようび -とらえる -とんかつ -どんぶり -ないかく -ないこう -ないしょ -ないす -ないせん -ないそう -なおす -ながい -なくす -なげる -なこうど -なさけ -なたでここ -なっとう -なつやすみ -ななおし -なにごと -なにもの -なにわ -なのか -なふだ -なまいき -なまえ -なまみ -なみだ -なめらか -なめる -なやむ -ならう -ならび -ならぶ -なれる -なわとび -なわばり -にあう -にいがた -にうけ -におい -にかい -にがて -にきび -にくしみ -にくまん -にげる -にさんかたんそ -にしき -にせもの -にちじょう -にちようび -にっか -にっき -にっけい -にっこう -にっさん -にっしょく -にっすう -にっせき -にってい -になう -にほん -にまめ -にもつ -にやり -にゅういん -にりんしゃ -にわとり -にんい -にんか -にんき -にんげん -にんしき -にんずう -にんそう -にんたい -にんち -にんてい -にんにく -にんぷ -にんまり -にんむ -にんめい -にんよう -ぬいくぎ -ぬかす -ぬぐいとる -ぬぐう -ぬくもり -ぬすむ -ぬまえび -ぬめり -ぬらす -ぬんちゃく -ねあげ -ねいき -ねいる -ねいろ -ねぐせ -ねくたい -ねくら -ねこぜ -ねこむ -ねさげ -ねすごす -ねそべる -ねだん -ねつい -ねっしん -ねつぞう -ねったいぎょ -ねぶそく -ねふだ -ねぼう -ねほりはほり -ねまき -ねまわし -ねみみ -ねむい -ねむたい -ねもと -ねらう -ねわざ -ねんいり -ねんおし -ねんかん -ねんきん -ねんぐ -ねんざ -ねんし -ねんちゃく -ねんど -ねんぴ -ねんぶつ -ねんまつ -ねんりょう -ねんれい -のいず -のおづま -のがす -のきなみ -のこぎり -のこす -のこる -のせる -のぞく -のぞむ -のたまう -のちほど -のっく -のばす -のはら -のべる -のぼる -のみもの -のやま -のらいぬ -のらねこ -のりもの -のりゆき -のれん -のんき -ばあい -はあく -ばあさん -ばいか -ばいく -はいけん -はいご -はいしん -はいすい -はいせん -はいそう -はいち -ばいばい -はいれつ -はえる -はおる -はかい -ばかり -はかる -はくしゅ -はけん -はこぶ -はさみ -はさん -はしご -ばしょ -はしる -はせる -ぱそこん -はそん -はたん -はちみつ -はつおん -はっかく -はづき -はっきり -はっくつ -はっけん -はっこう -はっさん -はっしん -はったつ -はっちゅう -はってん -はっぴょう -はっぽう -はなす -はなび -はにかむ -はぶらし -はみがき -はむかう -はめつ -はやい -はやし -はらう -はろうぃん -はわい -はんい -はんえい -はんおん -はんかく -はんきょう -ばんぐみ -はんこ -はんしゃ -はんすう -はんだん -ぱんち -ぱんつ -はんてい -はんとし -はんのう -はんぱ -はんぶん -はんぺん -はんぼうき -はんめい -はんらん -はんろん -ひいき -ひうん -ひえる -ひかく -ひかり -ひかる -ひかん -ひくい -ひけつ -ひこうき -ひこく -ひさい -ひさしぶり -ひさん -びじゅつかん -ひしょ -ひそか -ひそむ -ひたむき -ひだり -ひたる -ひつぎ -ひっこし -ひっし -ひつじゅひん -ひっす -ひつぜん -ぴったり -ぴっちり -ひつよう -ひてい -ひとごみ -ひなまつり -ひなん -ひねる -ひはん -ひびく -ひひょう -ひほう -ひまわり -ひまん -ひみつ -ひめい -ひめじし -ひやけ -ひやす -ひよう -びょうき -ひらがな -ひらく -ひりつ -ひりょう -ひるま -ひるやすみ -ひれい -ひろい -ひろう -ひろき -ひろゆき -ひんかく -ひんけつ -ひんこん -ひんしゅ -ひんそう -ぴんち -ひんぱん -びんぼう -ふあん -ふいうち -ふうけい -ふうせん -ぷうたろう -ふうとう -ふうふ -ふえる -ふおん -ふかい -ふきん -ふくざつ -ふくぶくろ -ふこう -ふさい -ふしぎ -ふじみ -ふすま -ふせい -ふせぐ -ふそく -ぶたにく -ふたん -ふちょう -ふつう -ふつか -ふっかつ -ふっき -ふっこく -ぶどう -ふとる -ふとん -ふのう -ふはい -ふひょう -ふへん -ふまん -ふみん -ふめつ -ふめん -ふよう -ふりこ -ふりる -ふるい -ふんいき -ぶんがく -ぶんぐ -ふんしつ -ぶんせき -ふんそう -ぶんぽう -へいあん -へいおん -へいがい -へいき -へいげん -へいこう -へいさ -へいしゃ -へいせつ -へいそ -へいたく -へいてん -へいねつ -へいわ -へきが -へこむ -べにいろ -べにしょうが -へらす -へんかん -べんきょう -べんごし -へんさい -へんたい -べんり -ほあん -ほいく -ぼうぎょ -ほうこく -ほうそう -ほうほう -ほうもん -ほうりつ -ほえる -ほおん -ほかん -ほきょう -ぼきん -ほくろ -ほけつ -ほけん -ほこう -ほこる -ほしい -ほしつ -ほしゅ -ほしょう -ほせい -ほそい -ほそく -ほたて -ほたる -ぽちぶくろ -ほっきょく -ほっさ -ほったん -ほとんど -ほめる -ほんい -ほんき -ほんけ -ほんしつ -ほんやく -まいにち -まかい -まかせる -まがる -まける -まこと -まさつ -まじめ -ますく -まぜる -まつり -まとめ -まなぶ -まぬけ -まねく -まほう -まもる -まゆげ -まよう -まろやか -まわす -まわり -まわる -まんが -まんきつ -まんぞく -まんなか -みいら -みうち -みえる -みがく -みかた -みかん -みけん -みこん -みじかい -みすい -みすえる -みせる -みっか -みつかる -みつける -みてい -みとめる -みなと -みなみかさい -みねらる -みのう -みのがす -みほん -みもと -みやげ -みらい -みりょく -みわく -みんか -みんぞく -むいか -むえき -むえん -むかい -むかう -むかえ -むかし -むぎちゃ -むける -むげん -むさぼる -むしあつい -むしば -むじゅん -むしろ -むすう -むすこ -むすぶ -むすめ -むせる -むせん -むちゅう -むなしい -むのう -むやみ -むよう -むらさき -むりょう -むろん -めいあん -めいうん -めいえん -めいかく -めいきょく -めいさい -めいし -めいそう -めいぶつ -めいれい -めいわく -めぐまれる -めざす -めした -めずらしい -めだつ -めまい -めやす -めんきょ -めんせき -めんどう -もうしあげる -もうどうけん -もえる -もくし -もくてき -もくようび -もちろん -もどる -もらう -もんく -もんだい -やおや -やける -やさい -やさしい -やすい -やすたろう -やすみ -やせる -やそう -やたい -やちん -やっと -やっぱり -やぶる -やめる -ややこしい -やよい -やわらかい -ゆうき -ゆうびんきょく -ゆうべ -ゆうめい -ゆけつ -ゆしゅつ -ゆせん -ゆそう -ゆたか -ゆちゃく -ゆでる -ゆにゅう -ゆびわ -ゆらい -ゆれる -ようい -ようか -ようきゅう -ようじ -ようす -ようちえん -よかぜ -よかん -よきん -よくせい -よくぼう -よけい -よごれる -よさん -よしゅう -よそう -よそく -よっか -よてい -よどがわく -よねつ -よやく -よゆう -よろこぶ -よろしい -らいう -らくがき -らくご -らくさつ -らくだ -らしんばん -らせん -らぞく -らたい -らっか -られつ -りえき -りかい -りきさく -りきせつ -りくぐん -りくつ -りけん -りこう -りせい -りそう -りそく -りてん -りねん -りゆう -りゅうがく -りよう -りょうり -りょかん -りょくちゃ -りょこう -りりく -りれき -りろん -りんご -るいけい -るいさい -るいじ -るいせき -るすばん -るりがわら -れいかん -れいぎ -れいせい -れいぞうこ -れいとう -れいぼう -れきし -れきだい -れんあい -れんけい -れんこん -れんさい -れんしゅう -れんぞく -れんらく -ろうか -ろうご -ろうじん -ろうそく -ろくが -ろこつ -ろじうら -ろしゅつ -ろせん -ろてん -ろめん -ろれつ -ろんぎ -ろんぱ -ろんぶん -ろんり -わかす -わかめ -わかやま -わかれる -わしつ -わじまし -わすれもの -わらう -われる`.split('\n'); diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/korean.d.ts b/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/korean.d.ts deleted file mode 100644 index b566a1db..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/korean.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const wordlist: string[]; diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/korean.js b/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/korean.js deleted file mode 100644 index 2ec7d6fd..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/korean.js +++ /dev/null @@ -1,2048 +0,0 @@ -export const wordlist = `가격 -가끔 -가난 -가능 -가득 -가르침 -가뭄 -가방 -가상 -가슴 -가운데 -가을 -가이드 -가입 -가장 -가정 -가족 -가죽 -각오 -각자 -간격 -간부 -간섭 -간장 -간접 -간판 -갈등 -갈비 -갈색 -갈증 -감각 -감기 -감소 -감수성 -감자 -감정 -갑자기 -강남 -강당 -강도 -강력히 -강변 -강북 -강사 -강수량 -강아지 -강원도 -강의 -강제 -강조 -같이 -개구리 -개나리 -개방 -개별 -개선 -개성 -개인 -객관적 -거실 -거액 -거울 -거짓 -거품 -걱정 -건강 -건물 -건설 -건조 -건축 -걸음 -검사 -검토 -게시판 -게임 -겨울 -견해 -결과 -결국 -결론 -결석 -결승 -결심 -결정 -결혼 -경계 -경고 -경기 -경력 -경복궁 -경비 -경상도 -경영 -경우 -경쟁 -경제 -경주 -경찰 -경치 -경향 -경험 -계곡 -계단 -계란 -계산 -계속 -계약 -계절 -계층 -계획 -고객 -고구려 -고궁 -고급 -고등학생 -고무신 -고민 -고양이 -고장 -고전 -고집 -고춧가루 -고통 -고향 -곡식 -골목 -골짜기 -골프 -공간 -공개 -공격 -공군 -공급 -공기 -공동 -공무원 -공부 -공사 -공식 -공업 -공연 -공원 -공장 -공짜 -공책 -공통 -공포 -공항 -공휴일 -과목 -과일 -과장 -과정 -과학 -관객 -관계 -관광 -관념 -관람 -관련 -관리 -관습 -관심 -관점 -관찰 -광경 -광고 -광장 -광주 -괴로움 -굉장히 -교과서 -교문 -교복 -교실 -교양 -교육 -교장 -교직 -교통 -교환 -교훈 -구경 -구름 -구멍 -구별 -구분 -구석 -구성 -구속 -구역 -구입 -구청 -구체적 -국가 -국기 -국내 -국립 -국물 -국민 -국수 -국어 -국왕 -국적 -국제 -국회 -군대 -군사 -군인 -궁극적 -권리 -권위 -권투 -귀국 -귀신 -규정 -규칙 -균형 -그날 -그냥 -그늘 -그러나 -그룹 -그릇 -그림 -그제서야 -그토록 -극복 -극히 -근거 -근교 -근래 -근로 -근무 -근본 -근원 -근육 -근처 -글씨 -글자 -금강산 -금고 -금년 -금메달 -금액 -금연 -금요일 -금지 -긍정적 -기간 -기관 -기념 -기능 -기독교 -기둥 -기록 -기름 -기법 -기본 -기분 -기쁨 -기숙사 -기술 -기억 -기업 -기온 -기운 -기원 -기적 -기준 -기침 -기혼 -기획 -긴급 -긴장 -길이 -김밥 -김치 -김포공항 -깍두기 -깜빡 -깨달음 -깨소금 -껍질 -꼭대기 -꽃잎 -나들이 -나란히 -나머지 -나물 -나침반 -나흘 -낙엽 -난방 -날개 -날씨 -날짜 -남녀 -남대문 -남매 -남산 -남자 -남편 -남학생 -낭비 -낱말 -내년 -내용 -내일 -냄비 -냄새 -냇물 -냉동 -냉면 -냉방 -냉장고 -넥타이 -넷째 -노동 -노란색 -노력 -노인 -녹음 -녹차 -녹화 -논리 -논문 -논쟁 -놀이 -농구 -농담 -농민 -농부 -농업 -농장 -농촌 -높이 -눈동자 -눈물 -눈썹 -뉴욕 -느낌 -늑대 -능동적 -능력 -다방 -다양성 -다음 -다이어트 -다행 -단계 -단골 -단독 -단맛 -단순 -단어 -단위 -단점 -단체 -단추 -단편 -단풍 -달걀 -달러 -달력 -달리 -닭고기 -담당 -담배 -담요 -담임 -답변 -답장 -당근 -당분간 -당연히 -당장 -대규모 -대낮 -대단히 -대답 -대도시 -대략 -대량 -대륙 -대문 -대부분 -대신 -대응 -대장 -대전 -대접 -대중 -대책 -대출 -대충 -대통령 -대학 -대한민국 -대합실 -대형 -덩어리 -데이트 -도대체 -도덕 -도둑 -도망 -도서관 -도심 -도움 -도입 -도자기 -도저히 -도전 -도중 -도착 -독감 -독립 -독서 -독일 -독창적 -동화책 -뒷모습 -뒷산 -딸아이 -마누라 -마늘 -마당 -마라톤 -마련 -마무리 -마사지 -마약 -마요네즈 -마을 -마음 -마이크 -마중 -마지막 -마찬가지 -마찰 -마흔 -막걸리 -막내 -막상 -만남 -만두 -만세 -만약 -만일 -만점 -만족 -만화 -많이 -말기 -말씀 -말투 -맘대로 -망원경 -매년 -매달 -매력 -매번 -매스컴 -매일 -매장 -맥주 -먹이 -먼저 -먼지 -멀리 -메일 -며느리 -며칠 -면담 -멸치 -명단 -명령 -명예 -명의 -명절 -명칭 -명함 -모금 -모니터 -모델 -모든 -모범 -모습 -모양 -모임 -모조리 -모집 -모퉁이 -목걸이 -목록 -목사 -목소리 -목숨 -목적 -목표 -몰래 -몸매 -몸무게 -몸살 -몸속 -몸짓 -몸통 -몹시 -무관심 -무궁화 -무더위 -무덤 -무릎 -무슨 -무엇 -무역 -무용 -무조건 -무지개 -무척 -문구 -문득 -문법 -문서 -문제 -문학 -문화 -물가 -물건 -물결 -물고기 -물론 -물리학 -물음 -물질 -물체 -미국 -미디어 -미사일 -미술 -미역 -미용실 -미움 -미인 -미팅 -미혼 -민간 -민족 -민주 -믿음 -밀가루 -밀리미터 -밑바닥 -바가지 -바구니 -바나나 -바늘 -바닥 -바닷가 -바람 -바이러스 -바탕 -박물관 -박사 -박수 -반대 -반드시 -반말 -반발 -반성 -반응 -반장 -반죽 -반지 -반찬 -받침 -발가락 -발걸음 -발견 -발달 -발레 -발목 -발바닥 -발생 -발음 -발자국 -발전 -발톱 -발표 -밤하늘 -밥그릇 -밥맛 -밥상 -밥솥 -방금 -방면 -방문 -방바닥 -방법 -방송 -방식 -방안 -방울 -방지 -방학 -방해 -방향 -배경 -배꼽 -배달 -배드민턴 -백두산 -백색 -백성 -백인 -백제 -백화점 -버릇 -버섯 -버튼 -번개 -번역 -번지 -번호 -벌금 -벌레 -벌써 -범위 -범인 -범죄 -법률 -법원 -법적 -법칙 -베이징 -벨트 -변경 -변동 -변명 -변신 -변호사 -변화 -별도 -별명 -별일 -병실 -병아리 -병원 -보관 -보너스 -보라색 -보람 -보름 -보상 -보안 -보자기 -보장 -보전 -보존 -보통 -보편적 -보험 -복도 -복사 -복숭아 -복습 -볶음 -본격적 -본래 -본부 -본사 -본성 -본인 -본질 -볼펜 -봉사 -봉지 -봉투 -부근 -부끄러움 -부담 -부동산 -부문 -부분 -부산 -부상 -부엌 -부인 -부작용 -부장 -부정 -부족 -부지런히 -부친 -부탁 -부품 -부회장 -북부 -북한 -분노 -분량 -분리 -분명 -분석 -분야 -분위기 -분필 -분홍색 -불고기 -불과 -불교 -불꽃 -불만 -불법 -불빛 -불안 -불이익 -불행 -브랜드 -비극 -비난 -비닐 -비둘기 -비디오 -비로소 -비만 -비명 -비밀 -비바람 -비빔밥 -비상 -비용 -비율 -비중 -비타민 -비판 -빌딩 -빗물 -빗방울 -빗줄기 -빛깔 -빨간색 -빨래 -빨리 -사건 -사계절 -사나이 -사냥 -사람 -사랑 -사립 -사모님 -사물 -사방 -사상 -사생활 -사설 -사슴 -사실 -사업 -사용 -사월 -사장 -사전 -사진 -사촌 -사춘기 -사탕 -사투리 -사흘 -산길 -산부인과 -산업 -산책 -살림 -살인 -살짝 -삼계탕 -삼국 -삼십 -삼월 -삼촌 -상관 -상금 -상대 -상류 -상반기 -상상 -상식 -상업 -상인 -상자 -상점 -상처 -상추 -상태 -상표 -상품 -상황 -새벽 -색깔 -색연필 -생각 -생명 -생물 -생방송 -생산 -생선 -생신 -생일 -생활 -서랍 -서른 -서명 -서민 -서비스 -서양 -서울 -서적 -서점 -서쪽 -서클 -석사 -석유 -선거 -선물 -선배 -선생 -선수 -선원 -선장 -선전 -선택 -선풍기 -설거지 -설날 -설렁탕 -설명 -설문 -설사 -설악산 -설치 -설탕 -섭씨 -성공 -성당 -성명 -성별 -성인 -성장 -성적 -성질 -성함 -세금 -세미나 -세상 -세월 -세종대왕 -세탁 -센터 -센티미터 -셋째 -소규모 -소극적 -소금 -소나기 -소년 -소득 -소망 -소문 -소설 -소속 -소아과 -소용 -소원 -소음 -소중히 -소지품 -소질 -소풍 -소형 -속담 -속도 -속옷 -손가락 -손길 -손녀 -손님 -손등 -손목 -손뼉 -손실 -손질 -손톱 -손해 -솔직히 -솜씨 -송아지 -송이 -송편 -쇠고기 -쇼핑 -수건 -수년 -수단 -수돗물 -수동적 -수면 -수명 -수박 -수상 -수석 -수술 -수시로 -수업 -수염 -수영 -수입 -수준 -수집 -수출 -수컷 -수필 -수학 -수험생 -수화기 -숙녀 -숙소 -숙제 -순간 -순서 -순수 -순식간 -순위 -숟가락 -술병 -술집 -숫자 -스님 -스물 -스스로 -스승 -스웨터 -스위치 -스케이트 -스튜디오 -스트레스 -스포츠 -슬쩍 -슬픔 -습관 -습기 -승객 -승리 -승부 -승용차 -승진 -시각 -시간 -시골 -시금치 -시나리오 -시댁 -시리즈 -시멘트 -시민 -시부모 -시선 -시설 -시스템 -시아버지 -시어머니 -시월 -시인 -시일 -시작 -시장 -시절 -시점 -시중 -시즌 -시집 -시청 -시합 -시험 -식구 -식기 -식당 -식량 -식료품 -식물 -식빵 -식사 -식생활 -식초 -식탁 -식품 -신고 -신규 -신념 -신문 -신발 -신비 -신사 -신세 -신용 -신제품 -신청 -신체 -신화 -실감 -실내 -실력 -실례 -실망 -실수 -실습 -실시 -실장 -실정 -실질적 -실천 -실체 -실컷 -실태 -실패 -실험 -실현 -심리 -심부름 -심사 -심장 -심정 -심판 -쌍둥이 -씨름 -씨앗 -아가씨 -아나운서 -아드님 -아들 -아쉬움 -아스팔트 -아시아 -아울러 -아저씨 -아줌마 -아직 -아침 -아파트 -아프리카 -아픔 -아홉 -아흔 -악기 -악몽 -악수 -안개 -안경 -안과 -안내 -안녕 -안동 -안방 -안부 -안주 -알루미늄 -알코올 -암시 -암컷 -압력 -앞날 -앞문 -애인 -애정 -액수 -앨범 -야간 -야단 -야옹 -약간 -약국 -약속 -약수 -약점 -약품 -약혼녀 -양념 -양력 -양말 -양배추 -양주 -양파 -어둠 -어려움 -어른 -어젯밤 -어쨌든 -어쩌다가 -어쩐지 -언니 -언덕 -언론 -언어 -얼굴 -얼른 -얼음 -얼핏 -엄마 -업무 -업종 -업체 -엉덩이 -엉망 -엉터리 -엊그제 -에너지 -에어컨 -엔진 -여건 -여고생 -여관 -여군 -여권 -여대생 -여덟 -여동생 -여든 -여론 -여름 -여섯 -여성 -여왕 -여인 -여전히 -여직원 -여학생 -여행 -역사 -역시 -역할 -연결 -연구 -연극 -연기 -연락 -연설 -연세 -연속 -연습 -연애 -연예인 -연인 -연장 -연주 -연출 -연필 -연합 -연휴 -열기 -열매 -열쇠 -열심히 -열정 -열차 -열흘 -염려 -엽서 -영국 -영남 -영상 -영양 -영역 -영웅 -영원히 -영하 -영향 -영혼 -영화 -옆구리 -옆방 -옆집 -예감 -예금 -예방 -예산 -예상 -예선 -예술 -예습 -예식장 -예약 -예전 -예절 -예정 -예컨대 -옛날 -오늘 -오락 -오랫동안 -오렌지 -오로지 -오른발 -오븐 -오십 -오염 -오월 -오전 -오직 -오징어 -오페라 -오피스텔 -오히려 -옥상 -옥수수 -온갖 -온라인 -온몸 -온종일 -온통 -올가을 -올림픽 -올해 -옷차림 -와이셔츠 -와인 -완성 -완전 -왕비 -왕자 -왜냐하면 -왠지 -외갓집 -외국 -외로움 -외삼촌 -외출 -외침 -외할머니 -왼발 -왼손 -왼쪽 -요금 -요일 -요즘 -요청 -용기 -용서 -용어 -우산 -우선 -우승 -우연히 -우정 -우체국 -우편 -운동 -운명 -운반 -운전 -운행 -울산 -울음 -움직임 -웃어른 -웃음 -워낙 -원고 -원래 -원서 -원숭이 -원인 -원장 -원피스 -월급 -월드컵 -월세 -월요일 -웨이터 -위반 -위법 -위성 -위원 -위험 -위협 -윗사람 -유난히 -유럽 -유명 -유물 -유산 -유적 -유치원 -유학 -유행 -유형 -육군 -육상 -육십 -육체 -은행 -음력 -음료 -음반 -음성 -음식 -음악 -음주 -의견 -의논 -의문 -의복 -의식 -의심 -의외로 -의욕 -의원 -의학 -이것 -이곳 -이념 -이놈 -이달 -이대로 -이동 -이렇게 -이력서 -이론적 -이름 -이민 -이발소 -이별 -이불 -이빨 -이상 -이성 -이슬 -이야기 -이용 -이웃 -이월 -이윽고 -이익 -이전 -이중 -이튿날 -이틀 -이혼 -인간 -인격 -인공 -인구 -인근 -인기 -인도 -인류 -인물 -인생 -인쇄 -인연 -인원 -인재 -인종 -인천 -인체 -인터넷 -인하 -인형 -일곱 -일기 -일단 -일대 -일등 -일반 -일본 -일부 -일상 -일생 -일손 -일요일 -일월 -일정 -일종 -일주일 -일찍 -일체 -일치 -일행 -일회용 -임금 -임무 -입대 -입력 -입맛 -입사 -입술 -입시 -입원 -입장 -입학 -자가용 -자격 -자극 -자동 -자랑 -자부심 -자식 -자신 -자연 -자원 -자율 -자전거 -자정 -자존심 -자판 -작가 -작년 -작성 -작업 -작용 -작은딸 -작품 -잔디 -잔뜩 -잔치 -잘못 -잠깐 -잠수함 -잠시 -잠옷 -잠자리 -잡지 -장관 -장군 -장기간 -장래 -장례 -장르 -장마 -장면 -장모 -장미 -장비 -장사 -장소 -장식 -장애인 -장인 -장점 -장차 -장학금 -재능 -재빨리 -재산 -재생 -재작년 -재정 -재채기 -재판 -재학 -재활용 -저것 -저고리 -저곳 -저녁 -저런 -저렇게 -저번 -저울 -저절로 -저축 -적극 -적당히 -적성 -적용 -적응 -전개 -전공 -전기 -전달 -전라도 -전망 -전문 -전반 -전부 -전세 -전시 -전용 -전자 -전쟁 -전주 -전철 -전체 -전통 -전혀 -전후 -절대 -절망 -절반 -절약 -절차 -점검 -점수 -점심 -점원 -점점 -점차 -접근 -접시 -접촉 -젓가락 -정거장 -정도 -정류장 -정리 -정말 -정면 -정문 -정반대 -정보 -정부 -정비 -정상 -정성 -정오 -정원 -정장 -정지 -정치 -정확히 -제공 -제과점 -제대로 -제목 -제발 -제법 -제삿날 -제안 -제일 -제작 -제주도 -제출 -제품 -제한 -조각 -조건 -조금 -조깅 -조명 -조미료 -조상 -조선 -조용히 -조절 -조정 -조직 -존댓말 -존재 -졸업 -졸음 -종교 -종로 -종류 -종소리 -종업원 -종종 -종합 -좌석 -죄인 -주관적 -주름 -주말 -주머니 -주먹 -주문 -주민 -주방 -주변 -주식 -주인 -주일 -주장 -주전자 -주택 -준비 -줄거리 -줄기 -줄무늬 -중간 -중계방송 -중국 -중년 -중단 -중독 -중반 -중부 -중세 -중소기업 -중순 -중앙 -중요 -중학교 -즉석 -즉시 -즐거움 -증가 -증거 -증권 -증상 -증세 -지각 -지갑 -지경 -지극히 -지금 -지급 -지능 -지름길 -지리산 -지방 -지붕 -지식 -지역 -지우개 -지원 -지적 -지점 -지진 -지출 -직선 -직업 -직원 -직장 -진급 -진동 -진로 -진료 -진리 -진짜 -진찰 -진출 -진통 -진행 -질문 -질병 -질서 -짐작 -집단 -집안 -집중 -짜증 -찌꺼기 -차남 -차라리 -차량 -차림 -차별 -차선 -차츰 -착각 -찬물 -찬성 -참가 -참기름 -참새 -참석 -참여 -참외 -참조 -찻잔 -창가 -창고 -창구 -창문 -창밖 -창작 -창조 -채널 -채점 -책가방 -책방 -책상 -책임 -챔피언 -처벌 -처음 -천국 -천둥 -천장 -천재 -천천히 -철도 -철저히 -철학 -첫날 -첫째 -청년 -청바지 -청소 -청춘 -체계 -체력 -체온 -체육 -체중 -체험 -초등학생 -초반 -초밥 -초상화 -초순 -초여름 -초원 -초저녁 -초점 -초청 -초콜릿 -촛불 -총각 -총리 -총장 -촬영 -최근 -최상 -최선 -최신 -최악 -최종 -추석 -추억 -추진 -추천 -추측 -축구 -축소 -축제 -축하 -출근 -출발 -출산 -출신 -출연 -출입 -출장 -출판 -충격 -충고 -충돌 -충분히 -충청도 -취업 -취직 -취향 -치약 -친구 -친척 -칠십 -칠월 -칠판 -침대 -침묵 -침실 -칫솔 -칭찬 -카메라 -카운터 -칼국수 -캐릭터 -캠퍼스 -캠페인 -커튼 -컨디션 -컬러 -컴퓨터 -코끼리 -코미디 -콘서트 -콜라 -콤플렉스 -콩나물 -쾌감 -쿠데타 -크림 -큰길 -큰딸 -큰소리 -큰아들 -큰어머니 -큰일 -큰절 -클래식 -클럽 -킬로 -타입 -타자기 -탁구 -탁자 -탄생 -태권도 -태양 -태풍 -택시 -탤런트 -터널 -터미널 -테니스 -테스트 -테이블 -텔레비전 -토론 -토마토 -토요일 -통계 -통과 -통로 -통신 -통역 -통일 -통장 -통제 -통증 -통합 -통화 -퇴근 -퇴원 -퇴직금 -튀김 -트럭 -특급 -특별 -특성 -특수 -특징 -특히 -튼튼히 -티셔츠 -파란색 -파일 -파출소 -판결 -판단 -판매 -판사 -팔십 -팔월 -팝송 -패션 -팩스 -팩시밀리 -팬티 -퍼센트 -페인트 -편견 -편의 -편지 -편히 -평가 -평균 -평생 -평소 -평양 -평일 -평화 -포스터 -포인트 -포장 -포함 -표면 -표정 -표준 -표현 -품목 -품질 -풍경 -풍속 -풍습 -프랑스 -프린터 -플라스틱 -피곤 -피망 -피아노 -필름 -필수 -필요 -필자 -필통 -핑계 -하느님 -하늘 -하드웨어 -하룻밤 -하반기 -하숙집 -하순 -하여튼 -하지만 -하천 -하품 -하필 -학과 -학교 -학급 -학기 -학년 -학력 -학번 -학부모 -학비 -학생 -학술 -학습 -학용품 -학원 -학위 -학자 -학점 -한계 -한글 -한꺼번에 -한낮 -한눈 -한동안 -한때 -한라산 -한마디 -한문 -한번 -한복 -한식 -한여름 -한쪽 -할머니 -할아버지 -할인 -함께 -함부로 -합격 -합리적 -항공 -항구 -항상 -항의 -해결 -해군 -해답 -해당 -해물 -해석 -해설 -해수욕장 -해안 -핵심 -핸드백 -햄버거 -햇볕 -햇살 -행동 -행복 -행사 -행운 -행위 -향기 -향상 -향수 -허락 -허용 -헬기 -현관 -현금 -현대 -현상 -현실 -현장 -현재 -현지 -혈액 -협력 -형부 -형사 -형수 -형식 -형제 -형태 -형편 -혜택 -호기심 -호남 -호랑이 -호박 -호텔 -호흡 -혹시 -홀로 -홈페이지 -홍보 -홍수 -홍차 -화면 -화분 -화살 -화요일 -화장 -화학 -확보 -확인 -확장 -확정 -환갑 -환경 -환영 -환율 -환자 -활기 -활동 -활발히 -활용 -활짝 -회견 -회관 -회복 -회색 -회원 -회장 -회전 -횟수 -횡단보도 -효율적 -후반 -후춧가루 -훈련 -훨씬 -휴식 -휴일 -흉내 -흐름 -흑백 -흑인 -흔적 -흔히 -흥미 -흥분 -희곡 -희망 -희생 -흰색 -힘껏`.split('\n'); diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/portuguese.d.ts b/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/portuguese.d.ts deleted file mode 100644 index b566a1db..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/portuguese.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const wordlist: string[]; diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/portuguese.js b/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/portuguese.js deleted file mode 100644 index 8359553c..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/portuguese.js +++ /dev/null @@ -1,2048 +0,0 @@ -export const wordlist = `abacate -abaixo -abalar -abater -abduzir -abelha -aberto -abismo -abotoar -abranger -abreviar -abrigar -abrupto -absinto -absoluto -absurdo -abutre -acabado -acalmar -acampar -acanhar -acaso -aceitar -acelerar -acenar -acervo -acessar -acetona -achatar -acidez -acima -acionado -acirrar -aclamar -aclive -acolhida -acomodar -acoplar -acordar -acumular -acusador -adaptar -adega -adentro -adepto -adequar -aderente -adesivo -adeus -adiante -aditivo -adjetivo -adjunto -admirar -adorar -adquirir -adubo -adverso -advogado -aeronave -afastar -aferir -afetivo -afinador -afivelar -aflito -afluente -afrontar -agachar -agarrar -agasalho -agenciar -agilizar -agiota -agitado -agora -agradar -agreste -agrupar -aguardar -agulha -ajoelhar -ajudar -ajustar -alameda -alarme -alastrar -alavanca -albergue -albino -alcatra -aldeia -alecrim -alegria -alertar -alface -alfinete -algum -alheio -aliar -alicate -alienar -alinhar -aliviar -almofada -alocar -alpiste -alterar -altitude -alucinar -alugar -aluno -alusivo -alvo -amaciar -amador -amarelo -amassar -ambas -ambiente -ameixa -amenizar -amido -amistoso -amizade -amolador -amontoar -amoroso -amostra -amparar -ampliar -ampola -anagrama -analisar -anarquia -anatomia -andaime -anel -anexo -angular -animar -anjo -anomalia -anotado -ansioso -anterior -anuidade -anunciar -anzol -apagador -apalpar -apanhado -apego -apelido -apertada -apesar -apetite -apito -aplauso -aplicada -apoio -apontar -aposta -aprendiz -aprovar -aquecer -arame -aranha -arara -arcada -ardente -areia -arejar -arenito -aresta -argiloso -argola -arma -arquivo -arraial -arrebate -arriscar -arroba -arrumar -arsenal -arterial -artigo -arvoredo -asfaltar -asilado -aspirar -assador -assinar -assoalho -assunto -astral -atacado -atadura -atalho -atarefar -atear -atender -aterro -ateu -atingir -atirador -ativo -atoleiro -atracar -atrevido -atriz -atual -atum -auditor -aumentar -aura -aurora -autismo -autoria -autuar -avaliar -avante -avaria -avental -avesso -aviador -avisar -avulso -axila -azarar -azedo -azeite -azulejo -babar -babosa -bacalhau -bacharel -bacia -bagagem -baiano -bailar -baioneta -bairro -baixista -bajular -baleia -baliza -balsa -banal -bandeira -banho -banir -banquete -barato -barbado -baronesa -barraca -barulho -baseado -bastante -batata -batedor -batida -batom -batucar -baunilha -beber -beijo -beirada -beisebol -beldade -beleza -belga -beliscar -bendito -bengala -benzer -berimbau -berlinda -berro -besouro -bexiga -bezerro -bico -bicudo -bienal -bifocal -bifurcar -bigorna -bilhete -bimestre -bimotor -biologia -biombo -biosfera -bipolar -birrento -biscoito -bisneto -bispo -bissexto -bitola -bizarro -blindado -bloco -bloquear -boato -bobagem -bocado -bocejo -bochecha -boicotar -bolada -boletim -bolha -bolo -bombeiro -bonde -boneco -bonita -borbulha -borda -boreal -borracha -bovino -boxeador -branco -brasa -braveza -breu -briga -brilho -brincar -broa -brochura -bronzear -broto -bruxo -bucha -budismo -bufar -bule -buraco -busca -busto -buzina -cabana -cabelo -cabide -cabo -cabrito -cacau -cacetada -cachorro -cacique -cadastro -cadeado -cafezal -caiaque -caipira -caixote -cajado -caju -calafrio -calcular -caldeira -calibrar -calmante -calota -camada -cambista -camisa -camomila -campanha -camuflar -canavial -cancelar -caneta -canguru -canhoto -canivete -canoa -cansado -cantar -canudo -capacho -capela -capinar -capotar -capricho -captador -capuz -caracol -carbono -cardeal -careca -carimbar -carneiro -carpete -carreira -cartaz -carvalho -casaco -casca -casebre -castelo -casulo -catarata -cativar -caule -causador -cautelar -cavalo -caverna -cebola -cedilha -cegonha -celebrar -celular -cenoura -censo -centeio -cercar -cerrado -certeiro -cerveja -cetim -cevada -chacota -chaleira -chamado -chapada -charme -chatice -chave -chefe -chegada -cheiro -cheque -chicote -chifre -chinelo -chocalho -chover -chumbo -chutar -chuva -cicatriz -ciclone -cidade -cidreira -ciente -cigana -cimento -cinto -cinza -ciranda -circuito -cirurgia -citar -clareza -clero -clicar -clone -clube -coado -coagir -cobaia -cobertor -cobrar -cocada -coelho -coentro -coeso -cogumelo -coibir -coifa -coiote -colar -coleira -colher -colidir -colmeia -colono -coluna -comando -combinar -comentar -comitiva -comover -complexo -comum -concha -condor -conectar -confuso -congelar -conhecer -conjugar -consumir -contrato -convite -cooperar -copeiro -copiador -copo -coquetel -coragem -cordial -corneta -coronha -corporal -correio -cortejo -coruja -corvo -cosseno -costela -cotonete -couro -couve -covil -cozinha -cratera -cravo -creche -credor -creme -crer -crespo -criada -criminal -crioulo -crise -criticar -crosta -crua -cruzeiro -cubano -cueca -cuidado -cujo -culatra -culminar -culpar -cultura -cumprir -cunhado -cupido -curativo -curral -cursar -curto -cuspir -custear -cutelo -damasco -datar -debater -debitar -deboche -debulhar -decalque -decimal -declive -decote -decretar -dedal -dedicado -deduzir -defesa -defumar -degelo -degrau -degustar -deitado -deixar -delator -delegado -delinear -delonga -demanda -demitir -demolido -dentista -depenado -depilar -depois -depressa -depurar -deriva -derramar -desafio -desbotar -descanso -desenho -desfiado -desgaste -desigual -deslize -desmamar -desova -despesa -destaque -desviar -detalhar -detentor -detonar -detrito -deusa -dever -devido -devotado -dezena -diagrama -dialeto -didata -difuso -digitar -dilatado -diluente -diminuir -dinastia -dinheiro -diocese -direto -discreta -disfarce -disparo -disquete -dissipar -distante -ditador -diurno -diverso -divisor -divulgar -dizer -dobrador -dolorido -domador -dominado -donativo -donzela -dormente -dorsal -dosagem -dourado -doutor -drenagem -drible -drogaria -duelar -duende -dueto -duplo -duquesa -durante -duvidoso -eclodir -ecoar -ecologia -edificar -edital -educado -efeito -efetivar -ejetar -elaborar -eleger -eleitor -elenco -elevador -eliminar -elogiar -embargo -embolado -embrulho -embutido -emenda -emergir -emissor -empatia -empenho -empinado -empolgar -emprego -empurrar -emulador -encaixe -encenado -enchente -encontro -endeusar -endossar -enfaixar -enfeite -enfim -engajado -engenho -englobar -engomado -engraxar -enguia -enjoar -enlatar -enquanto -enraizar -enrolado -enrugar -ensaio -enseada -ensino -ensopado -entanto -enteado -entidade -entortar -entrada -entulho -envergar -enviado -envolver -enxame -enxerto -enxofre -enxuto -epiderme -equipar -ereto -erguido -errata -erva -ervilha -esbanjar -esbelto -escama -escola -escrita -escuta -esfinge -esfolar -esfregar -esfumado -esgrima -esmalte -espanto -espelho -espiga -esponja -espreita -espumar -esquerda -estaca -esteira -esticar -estofado -estrela -estudo -esvaziar -etanol -etiqueta -euforia -europeu -evacuar -evaporar -evasivo -eventual -evidente -evoluir -exagero -exalar -examinar -exato -exausto -excesso -excitar -exclamar -executar -exemplo -exibir -exigente -exonerar -expandir -expelir -expirar -explanar -exposto -expresso -expulsar -externo -extinto -extrato -fabricar -fabuloso -faceta -facial -fada -fadiga -faixa -falar -falta -familiar -fandango -fanfarra -fantoche -fardado -farelo -farinha -farofa -farpa -fartura -fatia -fator -favorita -faxina -fazenda -fechado -feijoada -feirante -felino -feminino -fenda -feno -fera -feriado -ferrugem -ferver -festejar -fetal -feudal -fiapo -fibrose -ficar -ficheiro -figurado -fileira -filho -filme -filtrar -firmeza -fisgada -fissura -fita -fivela -fixador -fixo -flacidez -flamingo -flanela -flechada -flora -flutuar -fluxo -focal -focinho -fofocar -fogo -foguete -foice -folgado -folheto -forjar -formiga -forno -forte -fosco -fossa -fragata -fralda -frango -frasco -fraterno -freira -frente -fretar -frieza -friso -fritura -fronha -frustrar -fruteira -fugir -fulano -fuligem -fundar -fungo -funil -furador -furioso -futebol -gabarito -gabinete -gado -gaiato -gaiola -gaivota -galega -galho -galinha -galocha -ganhar -garagem -garfo -gargalo -garimpo -garoupa -garrafa -gasoduto -gasto -gata -gatilho -gaveta -gazela -gelado -geleia -gelo -gemada -gemer -gemido -generoso -gengiva -genial -genoma -genro -geologia -gerador -germinar -gesso -gestor -ginasta -gincana -gingado -girafa -girino -glacial -glicose -global -glorioso -goela -goiaba -golfe -golpear -gordura -gorjeta -gorro -gostoso -goteira -governar -gracejo -gradual -grafite -gralha -grampo -granada -gratuito -graveto -graxa -grego -grelhar -greve -grilo -grisalho -gritaria -grosso -grotesco -grudado -grunhido -gruta -guache -guarani -guaxinim -guerrear -guiar -guincho -guisado -gula -guloso -guru -habitar -harmonia -haste -haver -hectare -herdar -heresia -hesitar -hiato -hibernar -hidratar -hiena -hino -hipismo -hipnose -hipoteca -hoje -holofote -homem -honesto -honrado -hormonal -hospedar -humorado -iate -ideia -idoso -ignorado -igreja -iguana -ileso -ilha -iludido -iluminar -ilustrar -imagem -imediato -imenso -imersivo -iminente -imitador -imortal -impacto -impedir -implante -impor -imprensa -impune -imunizar -inalador -inapto -inativo -incenso -inchar -incidir -incluir -incolor -indeciso -indireto -indutor -ineficaz -inerente -infantil -infestar -infinito -inflamar -informal -infrator -ingerir -inibido -inicial -inimigo -injetar -inocente -inodoro -inovador -inox -inquieto -inscrito -inseto -insistir -inspetor -instalar -insulto -intacto -integral -intimar -intocado -intriga -invasor -inverno -invicto -invocar -iogurte -iraniano -ironizar -irreal -irritado -isca -isento -isolado -isqueiro -italiano -janeiro -jangada -janta -jararaca -jardim -jarro -jasmim -jato -javali -jazida -jejum -joaninha -joelhada -jogador -joia -jornal -jorrar -jovem -juba -judeu -judoca -juiz -julgador -julho -jurado -jurista -juro -justa -labareda -laboral -lacre -lactante -ladrilho -lagarta -lagoa -laje -lamber -lamentar -laminar -lampejo -lanche -lapidar -lapso -laranja -lareira -largura -lasanha -lastro -lateral -latido -lavanda -lavoura -lavrador -laxante -lazer -lealdade -lebre -legado -legendar -legista -leigo -leiloar -leitura -lembrete -leme -lenhador -lentilha -leoa -lesma -leste -letivo -letreiro -levar -leveza -levitar -liberal -libido -liderar -ligar -ligeiro -limitar -limoeiro -limpador -linda -linear -linhagem -liquidez -listagem -lisura -litoral -livro -lixa -lixeira -locador -locutor -lojista -lombo -lona -longe -lontra -lorde -lotado -loteria -loucura -lousa -louvar -luar -lucidez -lucro -luneta -lustre -lutador -luva -macaco -macete -machado -macio -madeira -madrinha -magnata -magreza -maior -mais -malandro -malha -malote -maluco -mamilo -mamoeiro -mamute -manada -mancha -mandato -manequim -manhoso -manivela -manobrar -mansa -manter -manusear -mapeado -maquinar -marcador -maresia -marfim -margem -marinho -marmita -maroto -marquise -marreco -martelo -marujo -mascote -masmorra -massagem -mastigar -matagal -materno -matinal -matutar -maxilar -medalha -medida -medusa -megafone -meiga -melancia -melhor -membro -memorial -menino -menos -mensagem -mental -merecer -mergulho -mesada -mesclar -mesmo -mesquita -mestre -metade -meteoro -metragem -mexer -mexicano -micro -migalha -migrar -milagre -milenar -milhar -mimado -minerar -minhoca -ministro -minoria -miolo -mirante -mirtilo -misturar -mocidade -moderno -modular -moeda -moer -moinho -moita -moldura -moleza -molho -molinete -molusco -montanha -moqueca -morango -morcego -mordomo -morena -mosaico -mosquete -mostarda -motel -motim -moto -motriz -muda -muito -mulata -mulher -multar -mundial -munido -muralha -murcho -muscular -museu -musical -nacional -nadador -naja -namoro -narina -narrado -nascer -nativa -natureza -navalha -navegar -navio -neblina -nebuloso -negativa -negociar -negrito -nervoso -neta -neural -nevasca -nevoeiro -ninar -ninho -nitidez -nivelar -nobreza -noite -noiva -nomear -nominal -nordeste -nortear -notar -noticiar -noturno -novelo -novilho -novo -nublado -nudez -numeral -nupcial -nutrir -nuvem -obcecado -obedecer -objetivo -obrigado -obscuro -obstetra -obter -obturar -ocidente -ocioso -ocorrer -oculista -ocupado -ofegante -ofensiva -oferenda -oficina -ofuscado -ogiva -olaria -oleoso -olhar -oliveira -ombro -omelete -omisso -omitir -ondulado -oneroso -ontem -opcional -operador -oponente -oportuno -oposto -orar -orbitar -ordem -ordinal -orfanato -orgasmo -orgulho -oriental -origem -oriundo -orla -ortodoxo -orvalho -oscilar -ossada -osso -ostentar -otimismo -ousadia -outono -outubro -ouvido -ovelha -ovular -oxidar -oxigenar -pacato -paciente -pacote -pactuar -padaria -padrinho -pagar -pagode -painel -pairar -paisagem -palavra -palestra -palheta -palito -palmada -palpitar -pancada -panela -panfleto -panqueca -pantanal -papagaio -papelada -papiro -parafina -parcial -pardal -parede -partida -pasmo -passado -pastel -patamar -patente -patinar -patrono -paulada -pausar -peculiar -pedalar -pedestre -pediatra -pedra -pegada -peitoral -peixe -pele -pelicano -penca -pendurar -peneira -penhasco -pensador -pente -perceber -perfeito -pergunta -perito -permitir -perna -perplexo -persiana -pertence -peruca -pescado -pesquisa -pessoa -petiscar -piada -picado -piedade -pigmento -pilastra -pilhado -pilotar -pimenta -pincel -pinguim -pinha -pinote -pintar -pioneiro -pipoca -piquete -piranha -pires -pirueta -piscar -pistola -pitanga -pivete -planta -plaqueta -platina -plebeu -plumagem -pluvial -pneu -poda -poeira -poetisa -polegada -policiar -poluente -polvilho -pomar -pomba -ponderar -pontaria -populoso -porta -possuir -postal -pote -poupar -pouso -povoar -praia -prancha -prato -praxe -prece -predador -prefeito -premiar -prensar -preparar -presilha -pretexto -prevenir -prezar -primata -princesa -prisma -privado -processo -produto -profeta -proibido -projeto -prometer -propagar -prosa -protetor -provador -publicar -pudim -pular -pulmonar -pulseira -punhal -punir -pupilo -pureza -puxador -quadra -quantia -quarto -quase -quebrar -queda -queijo -quente -querido -quimono -quina -quiosque -rabanada -rabisco -rachar -racionar -radial -raiar -rainha -raio -raiva -rajada -ralado -ramal -ranger -ranhura -rapadura -rapel -rapidez -raposa -raquete -raridade -rasante -rascunho -rasgar -raspador -rasteira -rasurar -ratazana -ratoeira -realeza -reanimar -reaver -rebaixar -rebelde -rebolar -recado -recente -recheio -recibo -recordar -recrutar -recuar -rede -redimir -redonda -reduzida -reenvio -refinar -refletir -refogar -refresco -refugiar -regalia -regime -regra -reinado -reitor -rejeitar -relativo -remador -remendo -remorso -renovado -reparo -repelir -repleto -repolho -represa -repudiar -requerer -resenha -resfriar -resgatar -residir -resolver -respeito -ressaca -restante -resumir -retalho -reter -retirar -retomada -retratar -revelar -revisor -revolta -riacho -rica -rigidez -rigoroso -rimar -ringue -risada -risco -risonho -robalo -rochedo -rodada -rodeio -rodovia -roedor -roleta -romano -roncar -rosado -roseira -rosto -rota -roteiro -rotina -rotular -rouco -roupa -roxo -rubro -rugido -rugoso -ruivo -rumo -rupestre -russo -sabor -saciar -sacola -sacudir -sadio -safira -saga -sagrada -saibro -salada -saleiro -salgado -saliva -salpicar -salsicha -saltar -salvador -sambar -samurai -sanar -sanfona -sangue -sanidade -sapato -sarda -sargento -sarjeta -saturar -saudade -saxofone -sazonal -secar -secular -seda -sedento -sediado -sedoso -sedutor -segmento -segredo -segundo -seiva -seleto -selvagem -semanal -semente -senador -senhor -sensual -sentado -separado -sereia -seringa -serra -servo -setembro -setor -sigilo -silhueta -silicone -simetria -simpatia -simular -sinal -sincero -singular -sinopse -sintonia -sirene -siri -situado -soberano -sobra -socorro -sogro -soja -solda -soletrar -solteiro -sombrio -sonata -sondar -sonegar -sonhador -sono -soprano -soquete -sorrir -sorteio -sossego -sotaque -soterrar -sovado -sozinho -suavizar -subida -submerso -subsolo -subtrair -sucata -sucesso -suco -sudeste -sufixo -sugador -sugerir -sujeito -sulfato -sumir -suor -superior -suplicar -suposto -suprimir -surdina -surfista -surpresa -surreal -surtir -suspiro -sustento -tabela -tablete -tabuada -tacho -tagarela -talher -talo -talvez -tamanho -tamborim -tampa -tangente -tanto -tapar -tapioca -tardio -tarefa -tarja -tarraxa -tatuagem -taurino -taxativo -taxista -teatral -tecer -tecido -teclado -tedioso -teia -teimar -telefone -telhado -tempero -tenente -tensor -tentar -termal -terno -terreno -tese -tesoura -testado -teto -textura -texugo -tiara -tigela -tijolo -timbrar -timidez -tingido -tinteiro -tiragem -titular -toalha -tocha -tolerar -tolice -tomada -tomilho -tonel -tontura -topete -tora -torcido -torneio -torque -torrada -torto -tostar -touca -toupeira -toxina -trabalho -tracejar -tradutor -trafegar -trajeto -trama -trancar -trapo -traseiro -tratador -travar -treino -tremer -trepidar -trevo -triagem -tribo -triciclo -tridente -trilogia -trindade -triplo -triturar -triunfal -trocar -trombeta -trova -trunfo -truque -tubular -tucano -tudo -tulipa -tupi -turbo -turma -turquesa -tutelar -tutorial -uivar -umbigo -unha -unidade -uniforme -urologia -urso -urtiga -urubu -usado -usina -usufruir -vacina -vadiar -vagaroso -vaidoso -vala -valente -validade -valores -vantagem -vaqueiro -varanda -vareta -varrer -vascular -vasilha -vassoura -vazar -vazio -veado -vedar -vegetar -veicular -veleiro -velhice -veludo -vencedor -vendaval -venerar -ventre -verbal -verdade -vereador -vergonha -vermelho -verniz -versar -vertente -vespa -vestido -vetorial -viaduto -viagem -viajar -viatura -vibrador -videira -vidraria -viela -viga -vigente -vigiar -vigorar -vilarejo -vinco -vinheta -vinil -violeta -virada -virtude -visitar -visto -vitral -viveiro -vizinho -voador -voar -vogal -volante -voleibol -voltagem -volumoso -vontade -vulto -vuvuzela -xadrez -xarope -xeque -xeretar -xerife -xingar -zangado -zarpar -zebu -zelador -zombar -zoologia -zumbido`.split('\n'); diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/simplified-chinese.d.ts b/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/simplified-chinese.d.ts deleted file mode 100644 index b566a1db..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/simplified-chinese.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const wordlist: string[]; diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/simplified-chinese.js b/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/simplified-chinese.js deleted file mode 100644 index 5989d01a..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/simplified-chinese.js +++ /dev/null @@ -1,2048 +0,0 @@ -export const wordlist = `的 -一 -是 -在 -不 -了 -有 -和 -人 -这 -中 -大 -为 -上 -个 -国 -我 -以 -要 -他 -时 -来 -用 -们 -生 -到 -作 -地 -于 -出 -就 -分 -对 -成 -会 -可 -主 -发 -年 -动 -同 -工 -也 -能 -下 -过 -子 -说 -产 -种 -面 -而 -方 -后 -多 -定 -行 -学 -法 -所 -民 -得 -经 -十 -三 -之 -进 -着 -等 -部 -度 -家 -电 -力 -里 -如 -水 -化 -高 -自 -二 -理 -起 -小 -物 -现 -实 -加 -量 -都 -两 -体 -制 -机 -当 -使 -点 -从 -业 -本 -去 -把 -性 -好 -应 -开 -它 -合 -还 -因 -由 -其 -些 -然 -前 -外 -天 -政 -四 -日 -那 -社 -义 -事 -平 -形 -相 -全 -表 -间 -样 -与 -关 -各 -重 -新 -线 -内 -数 -正 -心 -反 -你 -明 -看 -原 -又 -么 -利 -比 -或 -但 -质 -气 -第 -向 -道 -命 -此 -变 -条 -只 -没 -结 -解 -问 -意 -建 -月 -公 -无 -系 -军 -很 -情 -者 -最 -立 -代 -想 -已 -通 -并 -提 -直 -题 -党 -程 -展 -五 -果 -料 -象 -员 -革 -位 -入 -常 -文 -总 -次 -品 -式 -活 -设 -及 -管 -特 -件 -长 -求 -老 -头 -基 -资 -边 -流 -路 -级 -少 -图 -山 -统 -接 -知 -较 -将 -组 -见 -计 -别 -她 -手 -角 -期 -根 -论 -运 -农 -指 -几 -九 -区 -强 -放 -决 -西 -被 -干 -做 -必 -战 -先 -回 -则 -任 -取 -据 -处 -队 -南 -给 -色 -光 -门 -即 -保 -治 -北 -造 -百 -规 -热 -领 -七 -海 -口 -东 -导 -器 -压 -志 -世 -金 -增 -争 -济 -阶 -油 -思 -术 -极 -交 -受 -联 -什 -认 -六 -共 -权 -收 -证 -改 -清 -美 -再 -采 -转 -更 -单 -风 -切 -打 -白 -教 -速 -花 -带 -安 -场 -身 -车 -例 -真 -务 -具 -万 -每 -目 -至 -达 -走 -积 -示 -议 -声 -报 -斗 -完 -类 -八 -离 -华 -名 -确 -才 -科 -张 -信 -马 -节 -话 -米 -整 -空 -元 -况 -今 -集 -温 -传 -土 -许 -步 -群 -广 -石 -记 -需 -段 -研 -界 -拉 -林 -律 -叫 -且 -究 -观 -越 -织 -装 -影 -算 -低 -持 -音 -众 -书 -布 -复 -容 -儿 -须 -际 -商 -非 -验 -连 -断 -深 -难 -近 -矿 -千 -周 -委 -素 -技 -备 -半 -办 -青 -省 -列 -习 -响 -约 -支 -般 -史 -感 -劳 -便 -团 -往 -酸 -历 -市 -克 -何 -除 -消 -构 -府 -称 -太 -准 -精 -值 -号 -率 -族 -维 -划 -选 -标 -写 -存 -候 -毛 -亲 -快 -效 -斯 -院 -查 -江 -型 -眼 -王 -按 -格 -养 -易 -置 -派 -层 -片 -始 -却 -专 -状 -育 -厂 -京 -识 -适 -属 -圆 -包 -火 -住 -调 -满 -县 -局 -照 -参 -红 -细 -引 -听 -该 -铁 -价 -严 -首 -底 -液 -官 -德 -随 -病 -苏 -失 -尔 -死 -讲 -配 -女 -黄 -推 -显 -谈 -罪 -神 -艺 -呢 -席 -含 -企 -望 -密 -批 -营 -项 -防 -举 -球 -英 -氧 -势 -告 -李 -台 -落 -木 -帮 -轮 -破 -亚 -师 -围 -注 -远 -字 -材 -排 -供 -河 -态 -封 -另 -施 -减 -树 -溶 -怎 -止 -案 -言 -士 -均 -武 -固 -叶 -鱼 -波 -视 -仅 -费 -紧 -爱 -左 -章 -早 -朝 -害 -续 -轻 -服 -试 -食 -充 -兵 -源 -判 -护 -司 -足 -某 -练 -差 -致 -板 -田 -降 -黑 -犯 -负 -击 -范 -继 -兴 -似 -余 -坚 -曲 -输 -修 -故 -城 -夫 -够 -送 -笔 -船 -占 -右 -财 -吃 -富 -春 -职 -觉 -汉 -画 -功 -巴 -跟 -虽 -杂 -飞 -检 -吸 -助 -升 -阳 -互 -初 -创 -抗 -考 -投 -坏 -策 -古 -径 -换 -未 -跑 -留 -钢 -曾 -端 -责 -站 -简 -述 -钱 -副 -尽 -帝 -射 -草 -冲 -承 -独 -令 -限 -阿 -宣 -环 -双 -请 -超 -微 -让 -控 -州 -良 -轴 -找 -否 -纪 -益 -依 -优 -顶 -础 -载 -倒 -房 -突 -坐 -粉 -敌 -略 -客 -袁 -冷 -胜 -绝 -析 -块 -剂 -测 -丝 -协 -诉 -念 -陈 -仍 -罗 -盐 -友 -洋 -错 -苦 -夜 -刑 -移 -频 -逐 -靠 -混 -母 -短 -皮 -终 -聚 -汽 -村 -云 -哪 -既 -距 -卫 -停 -烈 -央 -察 -烧 -迅 -境 -若 -印 -洲 -刻 -括 -激 -孔 -搞 -甚 -室 -待 -核 -校 -散 -侵 -吧 -甲 -游 -久 -菜 -味 -旧 -模 -湖 -货 -损 -预 -阻 -毫 -普 -稳 -乙 -妈 -植 -息 -扩 -银 -语 -挥 -酒 -守 -拿 -序 -纸 -医 -缺 -雨 -吗 -针 -刘 -啊 -急 -唱 -误 -训 -愿 -审 -附 -获 -茶 -鲜 -粮 -斤 -孩 -脱 -硫 -肥 -善 -龙 -演 -父 -渐 -血 -欢 -械 -掌 -歌 -沙 -刚 -攻 -谓 -盾 -讨 -晚 -粒 -乱 -燃 -矛 -乎 -杀 -药 -宁 -鲁 -贵 -钟 -煤 -读 -班 -伯 -香 -介 -迫 -句 -丰 -培 -握 -兰 -担 -弦 -蛋 -沉 -假 -穿 -执 -答 -乐 -谁 -顺 -烟 -缩 -征 -脸 -喜 -松 -脚 -困 -异 -免 -背 -星 -福 -买 -染 -井 -概 -慢 -怕 -磁 -倍 -祖 -皇 -促 -静 -补 -评 -翻 -肉 -践 -尼 -衣 -宽 -扬 -棉 -希 -伤 -操 -垂 -秋 -宜 -氢 -套 -督 -振 -架 -亮 -末 -宪 -庆 -编 -牛 -触 -映 -雷 -销 -诗 -座 -居 -抓 -裂 -胞 -呼 -娘 -景 -威 -绿 -晶 -厚 -盟 -衡 -鸡 -孙 -延 -危 -胶 -屋 -乡 -临 -陆 -顾 -掉 -呀 -灯 -岁 -措 -束 -耐 -剧 -玉 -赵 -跳 -哥 -季 -课 -凯 -胡 -额 -款 -绍 -卷 -齐 -伟 -蒸 -殖 -永 -宗 -苗 -川 -炉 -岩 -弱 -零 -杨 -奏 -沿 -露 -杆 -探 -滑 -镇 -饭 -浓 -航 -怀 -赶 -库 -夺 -伊 -灵 -税 -途 -灭 -赛 -归 -召 -鼓 -播 -盘 -裁 -险 -康 -唯 -录 -菌 -纯 -借 -糖 -盖 -横 -符 -私 -努 -堂 -域 -枪 -润 -幅 -哈 -竟 -熟 -虫 -泽 -脑 -壤 -碳 -欧 -遍 -侧 -寨 -敢 -彻 -虑 -斜 -薄 -庭 -纳 -弹 -饲 -伸 -折 -麦 -湿 -暗 -荷 -瓦 -塞 -床 -筑 -恶 -户 -访 -塔 -奇 -透 -梁 -刀 -旋 -迹 -卡 -氯 -遇 -份 -毒 -泥 -退 -洗 -摆 -灰 -彩 -卖 -耗 -夏 -择 -忙 -铜 -献 -硬 -予 -繁 -圈 -雪 -函 -亦 -抽 -篇 -阵 -阴 -丁 -尺 -追 -堆 -雄 -迎 -泛 -爸 -楼 -避 -谋 -吨 -野 -猪 -旗 -累 -偏 -典 -馆 -索 -秦 -脂 -潮 -爷 -豆 -忽 -托 -惊 -塑 -遗 -愈 -朱 -替 -纤 -粗 -倾 -尚 -痛 -楚 -谢 -奋 -购 -磨 -君 -池 -旁 -碎 -骨 -监 -捕 -弟 -暴 -割 -贯 -殊 -释 -词 -亡 -壁 -顿 -宝 -午 -尘 -闻 -揭 -炮 -残 -冬 -桥 -妇 -警 -综 -招 -吴 -付 -浮 -遭 -徐 -您 -摇 -谷 -赞 -箱 -隔 -订 -男 -吹 -园 -纷 -唐 -败 -宋 -玻 -巨 -耕 -坦 -荣 -闭 -湾 -键 -凡 -驻 -锅 -救 -恩 -剥 -凝 -碱 -齿 -截 -炼 -麻 -纺 -禁 -废 -盛 -版 -缓 -净 -睛 -昌 -婚 -涉 -筒 -嘴 -插 -岸 -朗 -庄 -街 -藏 -姑 -贸 -腐 -奴 -啦 -惯 -乘 -伙 -恢 -匀 -纱 -扎 -辩 -耳 -彪 -臣 -亿 -璃 -抵 -脉 -秀 -萨 -俄 -网 -舞 -店 -喷 -纵 -寸 -汗 -挂 -洪 -贺 -闪 -柬 -爆 -烯 -津 -稻 -墙 -软 -勇 -像 -滚 -厘 -蒙 -芳 -肯 -坡 -柱 -荡 -腿 -仪 -旅 -尾 -轧 -冰 -贡 -登 -黎 -削 -钻 -勒 -逃 -障 -氨 -郭 -峰 -币 -港 -伏 -轨 -亩 -毕 -擦 -莫 -刺 -浪 -秘 -援 -株 -健 -售 -股 -岛 -甘 -泡 -睡 -童 -铸 -汤 -阀 -休 -汇 -舍 -牧 -绕 -炸 -哲 -磷 -绩 -朋 -淡 -尖 -启 -陷 -柴 -呈 -徒 -颜 -泪 -稍 -忘 -泵 -蓝 -拖 -洞 -授 -镜 -辛 -壮 -锋 -贫 -虚 -弯 -摩 -泰 -幼 -廷 -尊 -窗 -纲 -弄 -隶 -疑 -氏 -宫 -姐 -震 -瑞 -怪 -尤 -琴 -循 -描 -膜 -违 -夹 -腰 -缘 -珠 -穷 -森 -枝 -竹 -沟 -催 -绳 -忆 -邦 -剩 -幸 -浆 -栏 -拥 -牙 -贮 -礼 -滤 -钠 -纹 -罢 -拍 -咱 -喊 -袖 -埃 -勤 -罚 -焦 -潜 -伍 -墨 -欲 -缝 -姓 -刊 -饱 -仿 -奖 -铝 -鬼 -丽 -跨 -默 -挖 -链 -扫 -喝 -袋 -炭 -污 -幕 -诸 -弧 -励 -梅 -奶 -洁 -灾 -舟 -鉴 -苯 -讼 -抱 -毁 -懂 -寒 -智 -埔 -寄 -届 -跃 -渡 -挑 -丹 -艰 -贝 -碰 -拔 -爹 -戴 -码 -梦 -芽 -熔 -赤 -渔 -哭 -敬 -颗 -奔 -铅 -仲 -虎 -稀 -妹 -乏 -珍 -申 -桌 -遵 -允 -隆 -螺 -仓 -魏 -锐 -晓 -氮 -兼 -隐 -碍 -赫 -拨 -忠 -肃 -缸 -牵 -抢 -博 -巧 -壳 -兄 -杜 -讯 -诚 -碧 -祥 -柯 -页 -巡 -矩 -悲 -灌 -龄 -伦 -票 -寻 -桂 -铺 -圣 -恐 -恰 -郑 -趣 -抬 -荒 -腾 -贴 -柔 -滴 -猛 -阔 -辆 -妻 -填 -撤 -储 -签 -闹 -扰 -紫 -砂 -递 -戏 -吊 -陶 -伐 -喂 -疗 -瓶 -婆 -抚 -臂 -摸 -忍 -虾 -蜡 -邻 -胸 -巩 -挤 -偶 -弃 -槽 -劲 -乳 -邓 -吉 -仁 -烂 -砖 -租 -乌 -舰 -伴 -瓜 -浅 -丙 -暂 -燥 -橡 -柳 -迷 -暖 -牌 -秧 -胆 -详 -簧 -踏 -瓷 -谱 -呆 -宾 -糊 -洛 -辉 -愤 -竞 -隙 -怒 -粘 -乃 -绪 -肩 -籍 -敏 -涂 -熙 -皆 -侦 -悬 -掘 -享 -纠 -醒 -狂 -锁 -淀 -恨 -牲 -霸 -爬 -赏 -逆 -玩 -陵 -祝 -秒 -浙 -貌 -役 -彼 -悉 -鸭 -趋 -凤 -晨 -畜 -辈 -秩 -卵 -署 -梯 -炎 -滩 -棋 -驱 -筛 -峡 -冒 -啥 -寿 -译 -浸 -泉 -帽 -迟 -硅 -疆 -贷 -漏 -稿 -冠 -嫩 -胁 -芯 -牢 -叛 -蚀 -奥 -鸣 -岭 -羊 -凭 -串 -塘 -绘 -酵 -融 -盆 -锡 -庙 -筹 -冻 -辅 -摄 -袭 -筋 -拒 -僚 -旱 -钾 -鸟 -漆 -沈 -眉 -疏 -添 -棒 -穗 -硝 -韩 -逼 -扭 -侨 -凉 -挺 -碗 -栽 -炒 -杯 -患 -馏 -劝 -豪 -辽 -勃 -鸿 -旦 -吏 -拜 -狗 -埋 -辊 -掩 -饮 -搬 -骂 -辞 -勾 -扣 -估 -蒋 -绒 -雾 -丈 -朵 -姆 -拟 -宇 -辑 -陕 -雕 -偿 -蓄 -崇 -剪 -倡 -厅 -咬 -驶 -薯 -刷 -斥 -番 -赋 -奉 -佛 -浇 -漫 -曼 -扇 -钙 -桃 -扶 -仔 -返 -俗 -亏 -腔 -鞋 -棱 -覆 -框 -悄 -叔 -撞 -骗 -勘 -旺 -沸 -孤 -吐 -孟 -渠 -屈 -疾 -妙 -惜 -仰 -狠 -胀 -谐 -抛 -霉 -桑 -岗 -嘛 -衰 -盗 -渗 -脏 -赖 -涌 -甜 -曹 -阅 -肌 -哩 -厉 -烃 -纬 -毅 -昨 -伪 -症 -煮 -叹 -钉 -搭 -茎 -笼 -酷 -偷 -弓 -锥 -恒 -杰 -坑 -鼻 -翼 -纶 -叙 -狱 -逮 -罐 -络 -棚 -抑 -膨 -蔬 -寺 -骤 -穆 -冶 -枯 -册 -尸 -凸 -绅 -坯 -牺 -焰 -轰 -欣 -晋 -瘦 -御 -锭 -锦 -丧 -旬 -锻 -垄 -搜 -扑 -邀 -亭 -酯 -迈 -舒 -脆 -酶 -闲 -忧 -酚 -顽 -羽 -涨 -卸 -仗 -陪 -辟 -惩 -杭 -姚 -肚 -捉 -飘 -漂 -昆 -欺 -吾 -郎 -烷 -汁 -呵 -饰 -萧 -雅 -邮 -迁 -燕 -撒 -姻 -赴 -宴 -烦 -债 -帐 -斑 -铃 -旨 -醇 -董 -饼 -雏 -姿 -拌 -傅 -腹 -妥 -揉 -贤 -拆 -歪 -葡 -胺 -丢 -浩 -徽 -昂 -垫 -挡 -览 -贪 -慰 -缴 -汪 -慌 -冯 -诺 -姜 -谊 -凶 -劣 -诬 -耀 -昏 -躺 -盈 -骑 -乔 -溪 -丛 -卢 -抹 -闷 -咨 -刮 -驾 -缆 -悟 -摘 -铒 -掷 -颇 -幻 -柄 -惠 -惨 -佳 -仇 -腊 -窝 -涤 -剑 -瞧 -堡 -泼 -葱 -罩 -霍 -捞 -胎 -苍 -滨 -俩 -捅 -湘 -砍 -霞 -邵 -萄 -疯 -淮 -遂 -熊 -粪 -烘 -宿 -档 -戈 -驳 -嫂 -裕 -徙 -箭 -捐 -肠 -撑 -晒 -辨 -殿 -莲 -摊 -搅 -酱 -屏 -疫 -哀 -蔡 -堵 -沫 -皱 -畅 -叠 -阁 -莱 -敲 -辖 -钩 -痕 -坝 -巷 -饿 -祸 -丘 -玄 -溜 -曰 -逻 -彭 -尝 -卿 -妨 -艇 -吞 -韦 -怨 -矮 -歇`.split('\n'); diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/spanish.d.ts b/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/spanish.d.ts deleted file mode 100644 index b566a1db..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/spanish.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const wordlist: string[]; diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/spanish.js b/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/spanish.js deleted file mode 100644 index 92b3a9e0..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/spanish.js +++ /dev/null @@ -1,2048 +0,0 @@ -export const wordlist = `ábaco -abdomen -abeja -abierto -abogado -abono -aborto -abrazo -abrir -abuelo -abuso -acabar -academia -acceso -acción -aceite -acelga -acento -aceptar -ácido -aclarar -acné -acoger -acoso -activo -acto -actriz -actuar -acudir -acuerdo -acusar -adicto -admitir -adoptar -adorno -aduana -adulto -aéreo -afectar -afición -afinar -afirmar -ágil -agitar -agonía -agosto -agotar -agregar -agrio -agua -agudo -águila -aguja -ahogo -ahorro -aire -aislar -ajedrez -ajeno -ajuste -alacrán -alambre -alarma -alba -álbum -alcalde -aldea -alegre -alejar -alerta -aleta -alfiler -alga -algodón -aliado -aliento -alivio -alma -almeja -almíbar -altar -alteza -altivo -alto -altura -alumno -alzar -amable -amante -amapola -amargo -amasar -ámbar -ámbito -ameno -amigo -amistad -amor -amparo -amplio -ancho -anciano -ancla -andar -andén -anemia -ángulo -anillo -ánimo -anís -anotar -antena -antiguo -antojo -anual -anular -anuncio -añadir -añejo -año -apagar -aparato -apetito -apio -aplicar -apodo -aporte -apoyo -aprender -aprobar -apuesta -apuro -arado -araña -arar -árbitro -árbol -arbusto -archivo -arco -arder -ardilla -arduo -área -árido -aries -armonía -arnés -aroma -arpa -arpón -arreglo -arroz -arruga -arte -artista -asa -asado -asalto -ascenso -asegurar -aseo -asesor -asiento -asilo -asistir -asno -asombro -áspero -astilla -astro -astuto -asumir -asunto -atajo -ataque -atar -atento -ateo -ático -atleta -átomo -atraer -atroz -atún -audaz -audio -auge -aula -aumento -ausente -autor -aval -avance -avaro -ave -avellana -avena -avestruz -avión -aviso -ayer -ayuda -ayuno -azafrán -azar -azote -azúcar -azufre -azul -baba -babor -bache -bahía -baile -bajar -balanza -balcón -balde -bambú -banco -banda -baño -barba -barco -barniz -barro -báscula -bastón -basura -batalla -batería -batir -batuta -baúl -bazar -bebé -bebida -bello -besar -beso -bestia -bicho -bien -bingo -blanco -bloque -blusa -boa -bobina -bobo -boca -bocina -boda -bodega -boina -bola -bolero -bolsa -bomba -bondad -bonito -bono -bonsái -borde -borrar -bosque -bote -botín -bóveda -bozal -bravo -brazo -brecha -breve -brillo -brinco -brisa -broca -broma -bronce -brote -bruja -brusco -bruto -buceo -bucle -bueno -buey -bufanda -bufón -búho -buitre -bulto -burbuja -burla -burro -buscar -butaca -buzón -caballo -cabeza -cabina -cabra -cacao -cadáver -cadena -caer -café -caída -caimán -caja -cajón -cal -calamar -calcio -caldo -calidad -calle -calma -calor -calvo -cama -cambio -camello -camino -campo -cáncer -candil -canela -canguro -canica -canto -caña -cañón -caoba -caos -capaz -capitán -capote -captar -capucha -cara -carbón -cárcel -careta -carga -cariño -carne -carpeta -carro -carta -casa -casco -casero -caspa -castor -catorce -catre -caudal -causa -cazo -cebolla -ceder -cedro -celda -célebre -celoso -célula -cemento -ceniza -centro -cerca -cerdo -cereza -cero -cerrar -certeza -césped -cetro -chacal -chaleco -champú -chancla -chapa -charla -chico -chiste -chivo -choque -choza -chuleta -chupar -ciclón -ciego -cielo -cien -cierto -cifra -cigarro -cima -cinco -cine -cinta -ciprés -circo -ciruela -cisne -cita -ciudad -clamor -clan -claro -clase -clave -cliente -clima -clínica -cobre -cocción -cochino -cocina -coco -código -codo -cofre -coger -cohete -cojín -cojo -cola -colcha -colegio -colgar -colina -collar -colmo -columna -combate -comer -comida -cómodo -compra -conde -conejo -conga -conocer -consejo -contar -copa -copia -corazón -corbata -corcho -cordón -corona -correr -coser -cosmos -costa -cráneo -cráter -crear -crecer -creído -crema -cría -crimen -cripta -crisis -cromo -crónica -croqueta -crudo -cruz -cuadro -cuarto -cuatro -cubo -cubrir -cuchara -cuello -cuento -cuerda -cuesta -cueva -cuidar -culebra -culpa -culto -cumbre -cumplir -cuna -cuneta -cuota -cupón -cúpula -curar -curioso -curso -curva -cutis -dama -danza -dar -dardo -dátil -deber -débil -década -decir -dedo -defensa -definir -dejar -delfín -delgado -delito -demora -denso -dental -deporte -derecho -derrota -desayuno -deseo -desfile -desnudo -destino -desvío -detalle -detener -deuda -día -diablo -diadema -diamante -diana -diario -dibujo -dictar -diente -dieta -diez -difícil -digno -dilema -diluir -dinero -directo -dirigir -disco -diseño -disfraz -diva -divino -doble -doce -dolor -domingo -don -donar -dorado -dormir -dorso -dos -dosis -dragón -droga -ducha -duda -duelo -dueño -dulce -dúo -duque -durar -dureza -duro -ébano -ebrio -echar -eco -ecuador -edad -edición -edificio -editor -educar -efecto -eficaz -eje -ejemplo -elefante -elegir -elemento -elevar -elipse -élite -elixir -elogio -eludir -embudo -emitir -emoción -empate -empeño -empleo -empresa -enano -encargo -enchufe -encía -enemigo -enero -enfado -enfermo -engaño -enigma -enlace -enorme -enredo -ensayo -enseñar -entero -entrar -envase -envío -época -equipo -erizo -escala -escena -escolar -escribir -escudo -esencia -esfera -esfuerzo -espada -espejo -espía -esposa -espuma -esquí -estar -este -estilo -estufa -etapa -eterno -ética -etnia -evadir -evaluar -evento -evitar -exacto -examen -exceso -excusa -exento -exigir -exilio -existir -éxito -experto -explicar -exponer -extremo -fábrica -fábula -fachada -fácil -factor -faena -faja -falda -fallo -falso -faltar -fama -familia -famoso -faraón -farmacia -farol -farsa -fase -fatiga -fauna -favor -fax -febrero -fecha -feliz -feo -feria -feroz -fértil -fervor -festín -fiable -fianza -fiar -fibra -ficción -ficha -fideo -fiebre -fiel -fiera -fiesta -figura -fijar -fijo -fila -filete -filial -filtro -fin -finca -fingir -finito -firma -flaco -flauta -flecha -flor -flota -fluir -flujo -flúor -fobia -foca -fogata -fogón -folio -folleto -fondo -forma -forro -fortuna -forzar -fosa -foto -fracaso -frágil -franja -frase -fraude -freír -freno -fresa -frío -frito -fruta -fuego -fuente -fuerza -fuga -fumar -función -funda -furgón -furia -fusil -fútbol -futuro -gacela -gafas -gaita -gajo -gala -galería -gallo -gamba -ganar -gancho -ganga -ganso -garaje -garza -gasolina -gastar -gato -gavilán -gemelo -gemir -gen -género -genio -gente -geranio -gerente -germen -gesto -gigante -gimnasio -girar -giro -glaciar -globo -gloria -gol -golfo -goloso -golpe -goma -gordo -gorila -gorra -gota -goteo -gozar -grada -gráfico -grano -grasa -gratis -grave -grieta -grillo -gripe -gris -grito -grosor -grúa -grueso -grumo -grupo -guante -guapo -guardia -guerra -guía -guiño -guion -guiso -guitarra -gusano -gustar -haber -hábil -hablar -hacer -hacha -hada -hallar -hamaca -harina -haz -hazaña -hebilla -hebra -hecho -helado -helio -hembra -herir -hermano -héroe -hervir -hielo -hierro -hígado -higiene -hijo -himno -historia -hocico -hogar -hoguera -hoja -hombre -hongo -honor -honra -hora -hormiga -horno -hostil -hoyo -hueco -huelga -huerta -hueso -huevo -huida -huir -humano -húmedo -humilde -humo -hundir -huracán -hurto -icono -ideal -idioma -ídolo -iglesia -iglú -igual -ilegal -ilusión -imagen -imán -imitar -impar -imperio -imponer -impulso -incapaz -índice -inerte -infiel -informe -ingenio -inicio -inmenso -inmune -innato -insecto -instante -interés -íntimo -intuir -inútil -invierno -ira -iris -ironía -isla -islote -jabalí -jabón -jamón -jarabe -jardín -jarra -jaula -jazmín -jefe -jeringa -jinete -jornada -joroba -joven -joya -juerga -jueves -juez -jugador -jugo -juguete -juicio -junco -jungla -junio -juntar -júpiter -jurar -justo -juvenil -juzgar -kilo -koala -labio -lacio -lacra -lado -ladrón -lagarto -lágrima -laguna -laico -lamer -lámina -lámpara -lana -lancha -langosta -lanza -lápiz -largo -larva -lástima -lata -látex -latir -laurel -lavar -lazo -leal -lección -leche -lector -leer -legión -legumbre -lejano -lengua -lento -leña -león -leopardo -lesión -letal -letra -leve -leyenda -libertad -libro -licor -líder -lidiar -lienzo -liga -ligero -lima -límite -limón -limpio -lince -lindo -línea -lingote -lino -linterna -líquido -liso -lista -litera -litio -litro -llaga -llama -llanto -llave -llegar -llenar -llevar -llorar -llover -lluvia -lobo -loción -loco -locura -lógica -logro -lombriz -lomo -lonja -lote -lucha -lucir -lugar -lujo -luna -lunes -lupa -lustro -luto -luz -maceta -macho -madera -madre -maduro -maestro -mafia -magia -mago -maíz -maldad -maleta -malla -malo -mamá -mambo -mamut -manco -mando -manejar -manga -maniquí -manjar -mano -manso -manta -mañana -mapa -máquina -mar -marco -marea -marfil -margen -marido -mármol -marrón -martes -marzo -masa -máscara -masivo -matar -materia -matiz -matriz -máximo -mayor -mazorca -mecha -medalla -medio -médula -mejilla -mejor -melena -melón -memoria -menor -mensaje -mente -menú -mercado -merengue -mérito -mes -mesón -meta -meter -método -metro -mezcla -miedo -miel -miembro -miga -mil -milagro -militar -millón -mimo -mina -minero -mínimo -minuto -miope -mirar -misa -miseria -misil -mismo -mitad -mito -mochila -moción -moda -modelo -moho -mojar -molde -moler -molino -momento -momia -monarca -moneda -monja -monto -moño -morada -morder -moreno -morir -morro -morsa -mortal -mosca -mostrar -motivo -mover -móvil -mozo -mucho -mudar -mueble -muela -muerte -muestra -mugre -mujer -mula -muleta -multa -mundo -muñeca -mural -muro -músculo -museo -musgo -música -muslo -nácar -nación -nadar -naipe -naranja -nariz -narrar -nasal -natal -nativo -natural -náusea -naval -nave -navidad -necio -néctar -negar -negocio -negro -neón -nervio -neto -neutro -nevar -nevera -nicho -nido -niebla -nieto -niñez -niño -nítido -nivel -nobleza -noche -nómina -noria -norma -norte -nota -noticia -novato -novela -novio -nube -nuca -núcleo -nudillo -nudo -nuera -nueve -nuez -nulo -número -nutria -oasis -obeso -obispo -objeto -obra -obrero -observar -obtener -obvio -oca -ocaso -océano -ochenta -ocho -ocio -ocre -octavo -octubre -oculto -ocupar -ocurrir -odiar -odio -odisea -oeste -ofensa -oferta -oficio -ofrecer -ogro -oído -oír -ojo -ola -oleada -olfato -olivo -olla -olmo -olor -olvido -ombligo -onda -onza -opaco -opción -ópera -opinar -oponer -optar -óptica -opuesto -oración -orador -oral -órbita -orca -orden -oreja -órgano -orgía -orgullo -oriente -origen -orilla -oro -orquesta -oruga -osadía -oscuro -osezno -oso -ostra -otoño -otro -oveja -óvulo -óxido -oxígeno -oyente -ozono -pacto -padre -paella -página -pago -país -pájaro -palabra -palco -paleta -pálido -palma -paloma -palpar -pan -panal -pánico -pantera -pañuelo -papá -papel -papilla -paquete -parar -parcela -pared -parir -paro -párpado -parque -párrafo -parte -pasar -paseo -pasión -paso -pasta -pata -patio -patria -pausa -pauta -pavo -payaso -peatón -pecado -pecera -pecho -pedal -pedir -pegar -peine -pelar -peldaño -pelea -peligro -pellejo -pelo -peluca -pena -pensar -peñón -peón -peor -pepino -pequeño -pera -percha -perder -pereza -perfil -perico -perla -permiso -perro -persona -pesa -pesca -pésimo -pestaña -pétalo -petróleo -pez -pezuña -picar -pichón -pie -piedra -pierna -pieza -pijama -pilar -piloto -pimienta -pino -pintor -pinza -piña -piojo -pipa -pirata -pisar -piscina -piso -pista -pitón -pizca -placa -plan -plata -playa -plaza -pleito -pleno -plomo -pluma -plural -pobre -poco -poder -podio -poema -poesía -poeta -polen -policía -pollo -polvo -pomada -pomelo -pomo -pompa -poner -porción -portal -posada -poseer -posible -poste -potencia -potro -pozo -prado -precoz -pregunta -premio -prensa -preso -previo -primo -príncipe -prisión -privar -proa -probar -proceso -producto -proeza -profesor -programa -prole -promesa -pronto -propio -próximo -prueba -público -puchero -pudor -pueblo -puerta -puesto -pulga -pulir -pulmón -pulpo -pulso -puma -punto -puñal -puño -pupa -pupila -puré -quedar -queja -quemar -querer -queso -quieto -química -quince -quitar -rábano -rabia -rabo -ración -radical -raíz -rama -rampa -rancho -rango -rapaz -rápido -rapto -rasgo -raspa -rato -rayo -raza -razón -reacción -realidad -rebaño -rebote -recaer -receta -rechazo -recoger -recreo -recto -recurso -red -redondo -reducir -reflejo -reforma -refrán -refugio -regalo -regir -regla -regreso -rehén -reino -reír -reja -relato -relevo -relieve -relleno -reloj -remar -remedio -remo -rencor -rendir -renta -reparto -repetir -reposo -reptil -res -rescate -resina -respeto -resto -resumen -retiro -retorno -retrato -reunir -revés -revista -rey -rezar -rico -riego -rienda -riesgo -rifa -rígido -rigor -rincón -riñón -río -riqueza -risa -ritmo -rito -rizo -roble -roce -rociar -rodar -rodeo -rodilla -roer -rojizo -rojo -romero -romper -ron -ronco -ronda -ropa -ropero -rosa -rosca -rostro -rotar -rubí -rubor -rudo -rueda -rugir -ruido -ruina -ruleta -rulo -rumbo -rumor -ruptura -ruta -rutina -sábado -saber -sabio -sable -sacar -sagaz -sagrado -sala -saldo -salero -salir -salmón -salón -salsa -salto -salud -salvar -samba -sanción -sandía -sanear -sangre -sanidad -sano -santo -sapo -saque -sardina -sartén -sastre -satán -sauna -saxofón -sección -seco -secreto -secta -sed -seguir -seis -sello -selva -semana -semilla -senda -sensor -señal -señor -separar -sepia -sequía -ser -serie -sermón -servir -sesenta -sesión -seta -setenta -severo -sexo -sexto -sidra -siesta -siete -siglo -signo -sílaba -silbar -silencio -silla -símbolo -simio -sirena -sistema -sitio -situar -sobre -socio -sodio -sol -solapa -soldado -soledad -sólido -soltar -solución -sombra -sondeo -sonido -sonoro -sonrisa -sopa -soplar -soporte -sordo -sorpresa -sorteo -sostén -sótano -suave -subir -suceso -sudor -suegra -suelo -sueño -suerte -sufrir -sujeto -sultán -sumar -superar -suplir -suponer -supremo -sur -surco -sureño -surgir -susto -sutil -tabaco -tabique -tabla -tabú -taco -tacto -tajo -talar -talco -talento -talla -talón -tamaño -tambor -tango -tanque -tapa -tapete -tapia -tapón -taquilla -tarde -tarea -tarifa -tarjeta -tarot -tarro -tarta -tatuaje -tauro -taza -tazón -teatro -techo -tecla -técnica -tejado -tejer -tejido -tela -teléfono -tema -temor -templo -tenaz -tender -tener -tenis -tenso -teoría -terapia -terco -término -ternura -terror -tesis -tesoro -testigo -tetera -texto -tez -tibio -tiburón -tiempo -tienda -tierra -tieso -tigre -tijera -tilde -timbre -tímido -timo -tinta -tío -típico -tipo -tira -tirón -titán -títere -título -tiza -toalla -tobillo -tocar -tocino -todo -toga -toldo -tomar -tono -tonto -topar -tope -toque -tórax -torero -tormenta -torneo -toro -torpedo -torre -torso -tortuga -tos -tosco -toser -tóxico -trabajo -tractor -traer -tráfico -trago -traje -tramo -trance -trato -trauma -trazar -trébol -tregua -treinta -tren -trepar -tres -tribu -trigo -tripa -triste -triunfo -trofeo -trompa -tronco -tropa -trote -trozo -truco -trueno -trufa -tubería -tubo -tuerto -tumba -tumor -túnel -túnica -turbina -turismo -turno -tutor -ubicar -úlcera -umbral -unidad -unir -universo -uno -untar -uña -urbano -urbe -urgente -urna -usar -usuario -útil -utopía -uva -vaca -vacío -vacuna -vagar -vago -vaina -vajilla -vale -válido -valle -valor -válvula -vampiro -vara -variar -varón -vaso -vecino -vector -vehículo -veinte -vejez -vela -velero -veloz -vena -vencer -venda -veneno -vengar -venir -venta -venus -ver -verano -verbo -verde -vereda -verja -verso -verter -vía -viaje -vibrar -vicio -víctima -vida -vídeo -vidrio -viejo -viernes -vigor -vil -villa -vinagre -vino -viñedo -violín -viral -virgo -virtud -visor -víspera -vista -vitamina -viudo -vivaz -vivero -vivir -vivo -volcán -volumen -volver -voraz -votar -voto -voz -vuelo -vulgar -yacer -yate -yegua -yema -yerno -yeso -yodo -yoga -yogur -zafiro -zanja -zapato -zarza -zona -zorro -zumo -zurdo`.split('\n'); diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/traditional-chinese.d.ts b/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/traditional-chinese.d.ts deleted file mode 100644 index b566a1db..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/traditional-chinese.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const wordlist: string[]; diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/traditional-chinese.js b/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/traditional-chinese.js deleted file mode 100644 index 4075b3b9..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/esm/wordlists/traditional-chinese.js +++ /dev/null @@ -1,2048 +0,0 @@ -export const wordlist = `的 -一 -是 -在 -不 -了 -有 -和 -人 -這 -中 -大 -為 -上 -個 -國 -我 -以 -要 -他 -時 -來 -用 -們 -生 -到 -作 -地 -於 -出 -就 -分 -對 -成 -會 -可 -主 -發 -年 -動 -同 -工 -也 -能 -下 -過 -子 -說 -產 -種 -面 -而 -方 -後 -多 -定 -行 -學 -法 -所 -民 -得 -經 -十 -三 -之 -進 -著 -等 -部 -度 -家 -電 -力 -裡 -如 -水 -化 -高 -自 -二 -理 -起 -小 -物 -現 -實 -加 -量 -都 -兩 -體 -制 -機 -當 -使 -點 -從 -業 -本 -去 -把 -性 -好 -應 -開 -它 -合 -還 -因 -由 -其 -些 -然 -前 -外 -天 -政 -四 -日 -那 -社 -義 -事 -平 -形 -相 -全 -表 -間 -樣 -與 -關 -各 -重 -新 -線 -內 -數 -正 -心 -反 -你 -明 -看 -原 -又 -麼 -利 -比 -或 -但 -質 -氣 -第 -向 -道 -命 -此 -變 -條 -只 -沒 -結 -解 -問 -意 -建 -月 -公 -無 -系 -軍 -很 -情 -者 -最 -立 -代 -想 -已 -通 -並 -提 -直 -題 -黨 -程 -展 -五 -果 -料 -象 -員 -革 -位 -入 -常 -文 -總 -次 -品 -式 -活 -設 -及 -管 -特 -件 -長 -求 -老 -頭 -基 -資 -邊 -流 -路 -級 -少 -圖 -山 -統 -接 -知 -較 -將 -組 -見 -計 -別 -她 -手 -角 -期 -根 -論 -運 -農 -指 -幾 -九 -區 -強 -放 -決 -西 -被 -幹 -做 -必 -戰 -先 -回 -則 -任 -取 -據 -處 -隊 -南 -給 -色 -光 -門 -即 -保 -治 -北 -造 -百 -規 -熱 -領 -七 -海 -口 -東 -導 -器 -壓 -志 -世 -金 -增 -爭 -濟 -階 -油 -思 -術 -極 -交 -受 -聯 -什 -認 -六 -共 -權 -收 -證 -改 -清 -美 -再 -採 -轉 -更 -單 -風 -切 -打 -白 -教 -速 -花 -帶 -安 -場 -身 -車 -例 -真 -務 -具 -萬 -每 -目 -至 -達 -走 -積 -示 -議 -聲 -報 -鬥 -完 -類 -八 -離 -華 -名 -確 -才 -科 -張 -信 -馬 -節 -話 -米 -整 -空 -元 -況 -今 -集 -溫 -傳 -土 -許 -步 -群 -廣 -石 -記 -需 -段 -研 -界 -拉 -林 -律 -叫 -且 -究 -觀 -越 -織 -裝 -影 -算 -低 -持 -音 -眾 -書 -布 -复 -容 -兒 -須 -際 -商 -非 -驗 -連 -斷 -深 -難 -近 -礦 -千 -週 -委 -素 -技 -備 -半 -辦 -青 -省 -列 -習 -響 -約 -支 -般 -史 -感 -勞 -便 -團 -往 -酸 -歷 -市 -克 -何 -除 -消 -構 -府 -稱 -太 -準 -精 -值 -號 -率 -族 -維 -劃 -選 -標 -寫 -存 -候 -毛 -親 -快 -效 -斯 -院 -查 -江 -型 -眼 -王 -按 -格 -養 -易 -置 -派 -層 -片 -始 -卻 -專 -狀 -育 -廠 -京 -識 -適 -屬 -圓 -包 -火 -住 -調 -滿 -縣 -局 -照 -參 -紅 -細 -引 -聽 -該 -鐵 -價 -嚴 -首 -底 -液 -官 -德 -隨 -病 -蘇 -失 -爾 -死 -講 -配 -女 -黃 -推 -顯 -談 -罪 -神 -藝 -呢 -席 -含 -企 -望 -密 -批 -營 -項 -防 -舉 -球 -英 -氧 -勢 -告 -李 -台 -落 -木 -幫 -輪 -破 -亞 -師 -圍 -注 -遠 -字 -材 -排 -供 -河 -態 -封 -另 -施 -減 -樹 -溶 -怎 -止 -案 -言 -士 -均 -武 -固 -葉 -魚 -波 -視 -僅 -費 -緊 -愛 -左 -章 -早 -朝 -害 -續 -輕 -服 -試 -食 -充 -兵 -源 -判 -護 -司 -足 -某 -練 -差 -致 -板 -田 -降 -黑 -犯 -負 -擊 -范 -繼 -興 -似 -餘 -堅 -曲 -輸 -修 -故 -城 -夫 -夠 -送 -筆 -船 -佔 -右 -財 -吃 -富 -春 -職 -覺 -漢 -畫 -功 -巴 -跟 -雖 -雜 -飛 -檢 -吸 -助 -昇 -陽 -互 -初 -創 -抗 -考 -投 -壞 -策 -古 -徑 -換 -未 -跑 -留 -鋼 -曾 -端 -責 -站 -簡 -述 -錢 -副 -盡 -帝 -射 -草 -衝 -承 -獨 -令 -限 -阿 -宣 -環 -雙 -請 -超 -微 -讓 -控 -州 -良 -軸 -找 -否 -紀 -益 -依 -優 -頂 -礎 -載 -倒 -房 -突 -坐 -粉 -敵 -略 -客 -袁 -冷 -勝 -絕 -析 -塊 -劑 -測 -絲 -協 -訴 -念 -陳 -仍 -羅 -鹽 -友 -洋 -錯 -苦 -夜 -刑 -移 -頻 -逐 -靠 -混 -母 -短 -皮 -終 -聚 -汽 -村 -雲 -哪 -既 -距 -衛 -停 -烈 -央 -察 -燒 -迅 -境 -若 -印 -洲 -刻 -括 -激 -孔 -搞 -甚 -室 -待 -核 -校 -散 -侵 -吧 -甲 -遊 -久 -菜 -味 -舊 -模 -湖 -貨 -損 -預 -阻 -毫 -普 -穩 -乙 -媽 -植 -息 -擴 -銀 -語 -揮 -酒 -守 -拿 -序 -紙 -醫 -缺 -雨 -嗎 -針 -劉 -啊 -急 -唱 -誤 -訓 -願 -審 -附 -獲 -茶 -鮮 -糧 -斤 -孩 -脫 -硫 -肥 -善 -龍 -演 -父 -漸 -血 -歡 -械 -掌 -歌 -沙 -剛 -攻 -謂 -盾 -討 -晚 -粒 -亂 -燃 -矛 -乎 -殺 -藥 -寧 -魯 -貴 -鐘 -煤 -讀 -班 -伯 -香 -介 -迫 -句 -豐 -培 -握 -蘭 -擔 -弦 -蛋 -沉 -假 -穿 -執 -答 -樂 -誰 -順 -煙 -縮 -徵 -臉 -喜 -松 -腳 -困 -異 -免 -背 -星 -福 -買 -染 -井 -概 -慢 -怕 -磁 -倍 -祖 -皇 -促 -靜 -補 -評 -翻 -肉 -踐 -尼 -衣 -寬 -揚 -棉 -希 -傷 -操 -垂 -秋 -宜 -氫 -套 -督 -振 -架 -亮 -末 -憲 -慶 -編 -牛 -觸 -映 -雷 -銷 -詩 -座 -居 -抓 -裂 -胞 -呼 -娘 -景 -威 -綠 -晶 -厚 -盟 -衡 -雞 -孫 -延 -危 -膠 -屋 -鄉 -臨 -陸 -顧 -掉 -呀 -燈 -歲 -措 -束 -耐 -劇 -玉 -趙 -跳 -哥 -季 -課 -凱 -胡 -額 -款 -紹 -卷 -齊 -偉 -蒸 -殖 -永 -宗 -苗 -川 -爐 -岩 -弱 -零 -楊 -奏 -沿 -露 -桿 -探 -滑 -鎮 -飯 -濃 -航 -懷 -趕 -庫 -奪 -伊 -靈 -稅 -途 -滅 -賽 -歸 -召 -鼓 -播 -盤 -裁 -險 -康 -唯 -錄 -菌 -純 -借 -糖 -蓋 -橫 -符 -私 -努 -堂 -域 -槍 -潤 -幅 -哈 -竟 -熟 -蟲 -澤 -腦 -壤 -碳 -歐 -遍 -側 -寨 -敢 -徹 -慮 -斜 -薄 -庭 -納 -彈 -飼 -伸 -折 -麥 -濕 -暗 -荷 -瓦 -塞 -床 -築 -惡 -戶 -訪 -塔 -奇 -透 -梁 -刀 -旋 -跡 -卡 -氯 -遇 -份 -毒 -泥 -退 -洗 -擺 -灰 -彩 -賣 -耗 -夏 -擇 -忙 -銅 -獻 -硬 -予 -繁 -圈 -雪 -函 -亦 -抽 -篇 -陣 -陰 -丁 -尺 -追 -堆 -雄 -迎 -泛 -爸 -樓 -避 -謀 -噸 -野 -豬 -旗 -累 -偏 -典 -館 -索 -秦 -脂 -潮 -爺 -豆 -忽 -托 -驚 -塑 -遺 -愈 -朱 -替 -纖 -粗 -傾 -尚 -痛 -楚 -謝 -奮 -購 -磨 -君 -池 -旁 -碎 -骨 -監 -捕 -弟 -暴 -割 -貫 -殊 -釋 -詞 -亡 -壁 -頓 -寶 -午 -塵 -聞 -揭 -炮 -殘 -冬 -橋 -婦 -警 -綜 -招 -吳 -付 -浮 -遭 -徐 -您 -搖 -谷 -贊 -箱 -隔 -訂 -男 -吹 -園 -紛 -唐 -敗 -宋 -玻 -巨 -耕 -坦 -榮 -閉 -灣 -鍵 -凡 -駐 -鍋 -救 -恩 -剝 -凝 -鹼 -齒 -截 -煉 -麻 -紡 -禁 -廢 -盛 -版 -緩 -淨 -睛 -昌 -婚 -涉 -筒 -嘴 -插 -岸 -朗 -莊 -街 -藏 -姑 -貿 -腐 -奴 -啦 -慣 -乘 -夥 -恢 -勻 -紗 -扎 -辯 -耳 -彪 -臣 -億 -璃 -抵 -脈 -秀 -薩 -俄 -網 -舞 -店 -噴 -縱 -寸 -汗 -掛 -洪 -賀 -閃 -柬 -爆 -烯 -津 -稻 -牆 -軟 -勇 -像 -滾 -厘 -蒙 -芳 -肯 -坡 -柱 -盪 -腿 -儀 -旅 -尾 -軋 -冰 -貢 -登 -黎 -削 -鑽 -勒 -逃 -障 -氨 -郭 -峰 -幣 -港 -伏 -軌 -畝 -畢 -擦 -莫 -刺 -浪 -秘 -援 -株 -健 -售 -股 -島 -甘 -泡 -睡 -童 -鑄 -湯 -閥 -休 -匯 -舍 -牧 -繞 -炸 -哲 -磷 -績 -朋 -淡 -尖 -啟 -陷 -柴 -呈 -徒 -顏 -淚 -稍 -忘 -泵 -藍 -拖 -洞 -授 -鏡 -辛 -壯 -鋒 -貧 -虛 -彎 -摩 -泰 -幼 -廷 -尊 -窗 -綱 -弄 -隸 -疑 -氏 -宮 -姐 -震 -瑞 -怪 -尤 -琴 -循 -描 -膜 -違 -夾 -腰 -緣 -珠 -窮 -森 -枝 -竹 -溝 -催 -繩 -憶 -邦 -剩 -幸 -漿 -欄 -擁 -牙 -貯 -禮 -濾 -鈉 -紋 -罷 -拍 -咱 -喊 -袖 -埃 -勤 -罰 -焦 -潛 -伍 -墨 -欲 -縫 -姓 -刊 -飽 -仿 -獎 -鋁 -鬼 -麗 -跨 -默 -挖 -鏈 -掃 -喝 -袋 -炭 -污 -幕 -諸 -弧 -勵 -梅 -奶 -潔 -災 -舟 -鑑 -苯 -訟 -抱 -毀 -懂 -寒 -智 -埔 -寄 -屆 -躍 -渡 -挑 -丹 -艱 -貝 -碰 -拔 -爹 -戴 -碼 -夢 -芽 -熔 -赤 -漁 -哭 -敬 -顆 -奔 -鉛 -仲 -虎 -稀 -妹 -乏 -珍 -申 -桌 -遵 -允 -隆 -螺 -倉 -魏 -銳 -曉 -氮 -兼 -隱 -礙 -赫 -撥 -忠 -肅 -缸 -牽 -搶 -博 -巧 -殼 -兄 -杜 -訊 -誠 -碧 -祥 -柯 -頁 -巡 -矩 -悲 -灌 -齡 -倫 -票 -尋 -桂 -鋪 -聖 -恐 -恰 -鄭 -趣 -抬 -荒 -騰 -貼 -柔 -滴 -猛 -闊 -輛 -妻 -填 -撤 -儲 -簽 -鬧 -擾 -紫 -砂 -遞 -戲 -吊 -陶 -伐 -餵 -療 -瓶 -婆 -撫 -臂 -摸 -忍 -蝦 -蠟 -鄰 -胸 -鞏 -擠 -偶 -棄 -槽 -勁 -乳 -鄧 -吉 -仁 -爛 -磚 -租 -烏 -艦 -伴 -瓜 -淺 -丙 -暫 -燥 -橡 -柳 -迷 -暖 -牌 -秧 -膽 -詳 -簧 -踏 -瓷 -譜 -呆 -賓 -糊 -洛 -輝 -憤 -競 -隙 -怒 -粘 -乃 -緒 -肩 -籍 -敏 -塗 -熙 -皆 -偵 -懸 -掘 -享 -糾 -醒 -狂 -鎖 -淀 -恨 -牲 -霸 -爬 -賞 -逆 -玩 -陵 -祝 -秒 -浙 -貌 -役 -彼 -悉 -鴨 -趨 -鳳 -晨 -畜 -輩 -秩 -卵 -署 -梯 -炎 -灘 -棋 -驅 -篩 -峽 -冒 -啥 -壽 -譯 -浸 -泉 -帽 -遲 -矽 -疆 -貸 -漏 -稿 -冠 -嫩 -脅 -芯 -牢 -叛 -蝕 -奧 -鳴 -嶺 -羊 -憑 -串 -塘 -繪 -酵 -融 -盆 -錫 -廟 -籌 -凍 -輔 -攝 -襲 -筋 -拒 -僚 -旱 -鉀 -鳥 -漆 -沈 -眉 -疏 -添 -棒 -穗 -硝 -韓 -逼 -扭 -僑 -涼 -挺 -碗 -栽 -炒 -杯 -患 -餾 -勸 -豪 -遼 -勃 -鴻 -旦 -吏 -拜 -狗 -埋 -輥 -掩 -飲 -搬 -罵 -辭 -勾 -扣 -估 -蔣 -絨 -霧 -丈 -朵 -姆 -擬 -宇 -輯 -陝 -雕 -償 -蓄 -崇 -剪 -倡 -廳 -咬 -駛 -薯 -刷 -斥 -番 -賦 -奉 -佛 -澆 -漫 -曼 -扇 -鈣 -桃 -扶 -仔 -返 -俗 -虧 -腔 -鞋 -棱 -覆 -框 -悄 -叔 -撞 -騙 -勘 -旺 -沸 -孤 -吐 -孟 -渠 -屈 -疾 -妙 -惜 -仰 -狠 -脹 -諧 -拋 -黴 -桑 -崗 -嘛 -衰 -盜 -滲 -臟 -賴 -湧 -甜 -曹 -閱 -肌 -哩 -厲 -烴 -緯 -毅 -昨 -偽 -症 -煮 -嘆 -釘 -搭 -莖 -籠 -酷 -偷 -弓 -錐 -恆 -傑 -坑 -鼻 -翼 -綸 -敘 -獄 -逮 -罐 -絡 -棚 -抑 -膨 -蔬 -寺 -驟 -穆 -冶 -枯 -冊 -屍 -凸 -紳 -坯 -犧 -焰 -轟 -欣 -晉 -瘦 -禦 -錠 -錦 -喪 -旬 -鍛 -壟 -搜 -撲 -邀 -亭 -酯 -邁 -舒 -脆 -酶 -閒 -憂 -酚 -頑 -羽 -漲 -卸 -仗 -陪 -闢 -懲 -杭 -姚 -肚 -捉 -飄 -漂 -昆 -欺 -吾 -郎 -烷 -汁 -呵 -飾 -蕭 -雅 -郵 -遷 -燕 -撒 -姻 -赴 -宴 -煩 -債 -帳 -斑 -鈴 -旨 -醇 -董 -餅 -雛 -姿 -拌 -傅 -腹 -妥 -揉 -賢 -拆 -歪 -葡 -胺 -丟 -浩 -徽 -昂 -墊 -擋 -覽 -貪 -慰 -繳 -汪 -慌 -馮 -諾 -姜 -誼 -兇 -劣 -誣 -耀 -昏 -躺 -盈 -騎 -喬 -溪 -叢 -盧 -抹 -悶 -諮 -刮 -駕 -纜 -悟 -摘 -鉺 -擲 -頗 -幻 -柄 -惠 -慘 -佳 -仇 -臘 -窩 -滌 -劍 -瞧 -堡 -潑 -蔥 -罩 -霍 -撈 -胎 -蒼 -濱 -倆 -捅 -湘 -砍 -霞 -邵 -萄 -瘋 -淮 -遂 -熊 -糞 -烘 -宿 -檔 -戈 -駁 -嫂 -裕 -徙 -箭 -捐 -腸 -撐 -曬 -辨 -殿 -蓮 -攤 -攪 -醬 -屏 -疫 -哀 -蔡 -堵 -沫 -皺 -暢 -疊 -閣 -萊 -敲 -轄 -鉤 -痕 -壩 -巷 -餓 -禍 -丘 -玄 -溜 -曰 -邏 -彭 -嘗 -卿 -妨 -艇 -吞 -韋 -怨 -矮 -歇`.split('\n'); diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/index.d.ts b/tools/mnemonic-test/node_modules/@scure/bip39/index.d.ts deleted file mode 100644 index 5dfbeb57..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/index.d.ts +++ /dev/null @@ -1,92 +0,0 @@ -/** - * Audited & minimal JS implementation of - * [BIP39 mnemonic phrases](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki). - * @module - * @example -```js -import * as bip39 from '@scure/bip39'; -import { wordlist } from '@scure/bip39/wordlists/english'; -const mn = bip39.generateMnemonic(wordlist); -console.log(mn); -const ent = bip39.mnemonicToEntropy(mn, wordlist) -bip39.entropyToMnemonic(ent, wordlist); -bip39.validateMnemonic(mn, wordlist); -await bip39.mnemonicToSeed(mn, 'password'); -bip39.mnemonicToSeedSync(mn, 'password'); - -// Wordlists -import { wordlist as czech } from '@scure/bip39/wordlists/czech'; -import { wordlist as english } from '@scure/bip39/wordlists/english'; -import { wordlist as french } from '@scure/bip39/wordlists/french'; -import { wordlist as italian } from '@scure/bip39/wordlists/italian'; -import { wordlist as japanese } from '@scure/bip39/wordlists/japanese'; -import { wordlist as korean } from '@scure/bip39/wordlists/korean'; -import { wordlist as portuguese } from '@scure/bip39/wordlists/portuguese'; -import { wordlist as simplifiedChinese } from '@scure/bip39/wordlists/simplified-chinese'; -import { wordlist as spanish } from '@scure/bip39/wordlists/spanish'; -import { wordlist as traditionalChinese } from '@scure/bip39/wordlists/traditional-chinese'; -``` - */ -/** - * Generate x random words. Uses Cryptographically-Secure Random Number Generator. - * @param wordlist imported wordlist for specific language - * @param strength mnemonic strength 128-256 bits - * @example - * generateMnemonic(wordlist, 128) - * // 'legal winner thank year wave sausage worth useful legal winner thank yellow' - */ -export declare function generateMnemonic(wordlist: string[], strength?: number): string; -/** - * Reversible: Converts mnemonic string to raw entropy in form of byte array. - * @param mnemonic 12-24 words - * @param wordlist imported wordlist for specific language - * @example - * const mnem = 'legal winner thank year wave sausage worth useful legal winner thank yellow'; - * mnemonicToEntropy(mnem, wordlist) - * // Produces - * new Uint8Array([ - * 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, - * 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f - * ]) - */ -export declare function mnemonicToEntropy(mnemonic: string, wordlist: string[]): Uint8Array; -/** - * Reversible: Converts raw entropy in form of byte array to mnemonic string. - * @param entropy byte array - * @param wordlist imported wordlist for specific language - * @returns 12-24 words - * @example - * const ent = new Uint8Array([ - * 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, - * 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f - * ]); - * entropyToMnemonic(ent, wordlist); - * // 'legal winner thank year wave sausage worth useful legal winner thank yellow' - */ -export declare function entropyToMnemonic(entropy: Uint8Array, wordlist: string[]): string; -/** - * Validates mnemonic for being 12-24 words contained in `wordlist`. - */ -export declare function validateMnemonic(mnemonic: string, wordlist: string[]): boolean; -/** - * Irreversible: Uses KDF to derive 64 bytes of key data from mnemonic + optional password. - * @param mnemonic 12-24 words - * @param passphrase string that will additionally protect the key - * @returns 64 bytes of key data - * @example - * const mnem = 'legal winner thank year wave sausage worth useful legal winner thank yellow'; - * await mnemonicToSeed(mnem, 'password'); - * // new Uint8Array([...64 bytes]) - */ -export declare function mnemonicToSeed(mnemonic: string, passphrase?: string): Promise; -/** - * Irreversible: Uses KDF to derive 64 bytes of key data from mnemonic + optional password. - * @param mnemonic 12-24 words - * @param passphrase string that will additionally protect the key - * @returns 64 bytes of key data - * @example - * const mnem = 'legal winner thank year wave sausage worth useful legal winner thank yellow'; - * mnemonicToSeedSync(mnem, 'password'); - * // new Uint8Array([...64 bytes]) - */ -export declare function mnemonicToSeedSync(mnemonic: string, passphrase?: string): Uint8Array; diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/index.js b/tools/mnemonic-test/node_modules/@scure/bip39/index.js deleted file mode 100644 index 5292f989..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/index.js +++ /dev/null @@ -1,169 +0,0 @@ -"use strict"; -/** - * Audited & minimal JS implementation of - * [BIP39 mnemonic phrases](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki). - * @module - * @example -```js -import * as bip39 from '@scure/bip39'; -import { wordlist } from '@scure/bip39/wordlists/english'; -const mn = bip39.generateMnemonic(wordlist); -console.log(mn); -const ent = bip39.mnemonicToEntropy(mn, wordlist) -bip39.entropyToMnemonic(ent, wordlist); -bip39.validateMnemonic(mn, wordlist); -await bip39.mnemonicToSeed(mn, 'password'); -bip39.mnemonicToSeedSync(mn, 'password'); - -// Wordlists -import { wordlist as czech } from '@scure/bip39/wordlists/czech'; -import { wordlist as english } from '@scure/bip39/wordlists/english'; -import { wordlist as french } from '@scure/bip39/wordlists/french'; -import { wordlist as italian } from '@scure/bip39/wordlists/italian'; -import { wordlist as japanese } from '@scure/bip39/wordlists/japanese'; -import { wordlist as korean } from '@scure/bip39/wordlists/korean'; -import { wordlist as portuguese } from '@scure/bip39/wordlists/portuguese'; -import { wordlist as simplifiedChinese } from '@scure/bip39/wordlists/simplified-chinese'; -import { wordlist as spanish } from '@scure/bip39/wordlists/spanish'; -import { wordlist as traditionalChinese } from '@scure/bip39/wordlists/traditional-chinese'; -``` - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.generateMnemonic = generateMnemonic; -exports.mnemonicToEntropy = mnemonicToEntropy; -exports.entropyToMnemonic = entropyToMnemonic; -exports.validateMnemonic = validateMnemonic; -exports.mnemonicToSeed = mnemonicToSeed; -exports.mnemonicToSeedSync = mnemonicToSeedSync; -/*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) */ -const pbkdf2_1 = require("@noble/hashes/pbkdf2"); -const sha2_1 = require("@noble/hashes/sha2"); -const utils_1 = require("@noble/hashes/utils"); -const base_1 = require("@scure/base"); -// Japanese wordlist -const isJapanese = (wordlist) => wordlist[0] === '\u3042\u3044\u3053\u304f\u3057\u3093'; -// Normalization replaces equivalent sequences of characters -// so that any two texts that are equivalent will be reduced -// to the same sequence of code points, called the normal form of the original text. -// https://tonsky.me/blog/unicode/#why-is-a---- -function nfkd(str) { - if (typeof str !== 'string') - throw new TypeError('invalid mnemonic type: ' + typeof str); - return str.normalize('NFKD'); -} -function normalize(str) { - const norm = nfkd(str); - const words = norm.split(' '); - if (![12, 15, 18, 21, 24].includes(words.length)) - throw new Error('Invalid mnemonic'); - return { nfkd: norm, words }; -} -function aentropy(ent) { - (0, utils_1.abytes)(ent, 16, 20, 24, 28, 32); -} -/** - * Generate x random words. Uses Cryptographically-Secure Random Number Generator. - * @param wordlist imported wordlist for specific language - * @param strength mnemonic strength 128-256 bits - * @example - * generateMnemonic(wordlist, 128) - * // 'legal winner thank year wave sausage worth useful legal winner thank yellow' - */ -function generateMnemonic(wordlist, strength = 128) { - (0, utils_1.anumber)(strength); - if (strength % 32 !== 0 || strength > 256) - throw new TypeError('Invalid entropy'); - return entropyToMnemonic((0, utils_1.randomBytes)(strength / 8), wordlist); -} -const calcChecksum = (entropy) => { - // Checksum is ent.length/4 bits long - const bitsLeft = 8 - entropy.length / 4; - // Zero rightmost "bitsLeft" bits in byte - // For example: bitsLeft=4 val=10111101 -> 10110000 - return new Uint8Array([((0, sha2_1.sha256)(entropy)[0] >> bitsLeft) << bitsLeft]); -}; -function getCoder(wordlist) { - if (!Array.isArray(wordlist) || wordlist.length !== 2048 || typeof wordlist[0] !== 'string') - throw new Error('Wordlist: expected array of 2048 strings'); - wordlist.forEach((i) => { - if (typeof i !== 'string') - throw new Error('wordlist: non-string element: ' + i); - }); - return base_1.utils.chain(base_1.utils.checksum(1, calcChecksum), base_1.utils.radix2(11, true), base_1.utils.alphabet(wordlist)); -} -/** - * Reversible: Converts mnemonic string to raw entropy in form of byte array. - * @param mnemonic 12-24 words - * @param wordlist imported wordlist for specific language - * @example - * const mnem = 'legal winner thank year wave sausage worth useful legal winner thank yellow'; - * mnemonicToEntropy(mnem, wordlist) - * // Produces - * new Uint8Array([ - * 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, - * 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f - * ]) - */ -function mnemonicToEntropy(mnemonic, wordlist) { - const { words } = normalize(mnemonic); - const entropy = getCoder(wordlist).decode(words); - aentropy(entropy); - return entropy; -} -/** - * Reversible: Converts raw entropy in form of byte array to mnemonic string. - * @param entropy byte array - * @param wordlist imported wordlist for specific language - * @returns 12-24 words - * @example - * const ent = new Uint8Array([ - * 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, - * 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f - * ]); - * entropyToMnemonic(ent, wordlist); - * // 'legal winner thank year wave sausage worth useful legal winner thank yellow' - */ -function entropyToMnemonic(entropy, wordlist) { - aentropy(entropy); - const words = getCoder(wordlist).encode(entropy); - return words.join(isJapanese(wordlist) ? '\u3000' : ' '); -} -/** - * Validates mnemonic for being 12-24 words contained in `wordlist`. - */ -function validateMnemonic(mnemonic, wordlist) { - try { - mnemonicToEntropy(mnemonic, wordlist); - } - catch (e) { - return false; - } - return true; -} -const psalt = (passphrase) => nfkd('mnemonic' + passphrase); -/** - * Irreversible: Uses KDF to derive 64 bytes of key data from mnemonic + optional password. - * @param mnemonic 12-24 words - * @param passphrase string that will additionally protect the key - * @returns 64 bytes of key data - * @example - * const mnem = 'legal winner thank year wave sausage worth useful legal winner thank yellow'; - * await mnemonicToSeed(mnem, 'password'); - * // new Uint8Array([...64 bytes]) - */ -function mnemonicToSeed(mnemonic, passphrase = '') { - return (0, pbkdf2_1.pbkdf2Async)(sha2_1.sha512, normalize(mnemonic).nfkd, psalt(passphrase), { c: 2048, dkLen: 64 }); -} -/** - * Irreversible: Uses KDF to derive 64 bytes of key data from mnemonic + optional password. - * @param mnemonic 12-24 words - * @param passphrase string that will additionally protect the key - * @returns 64 bytes of key data - * @example - * const mnem = 'legal winner thank year wave sausage worth useful legal winner thank yellow'; - * mnemonicToSeedSync(mnem, 'password'); - * // new Uint8Array([...64 bytes]) - */ -function mnemonicToSeedSync(mnemonic, passphrase = '') { - return (0, pbkdf2_1.pbkdf2)(sha2_1.sha512, normalize(mnemonic).nfkd, psalt(passphrase), { c: 2048, dkLen: 64 }); -} diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/LICENSE b/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/LICENSE deleted file mode 100644 index 5b91e4cb..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2022 Paul Miller (https://paulmillr.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the “Software”), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/README.md b/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/README.md deleted file mode 100644 index 9493be50..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/README.md +++ /dev/null @@ -1,228 +0,0 @@ -# scure-base - -Audited & minimal implementation of bech32, base64, base58, base32 & base16. - -- 🔒 [Audited](#security) by an independent security firm -- 🔻 Tree-shakeable: unused code is excluded from your builds -- 📦 ESM and common.js -- ✍️ Written in [functional style](#design-rationale), easily composable -- 💼 Matches specs - - [BIP173](https://en.bitcoin.it/wiki/BIP_0173), [BIP350](https://en.bitcoin.it/wiki/BIP_0350) for bech32 / bech32m - - [RFC 4648](https://datatracker.ietf.org/doc/html/rfc4648) (aka RFC 3548) for Base16, Base32, Base32Hex, Base64, Base64Url - - [Base58](https://www.ietf.org/archive/id/draft-msporny-base58-03.txt), - [Base58check](https://en.bitcoin.it/wiki/Base58Check_encoding), - [Base32 Crockford](https://www.crockford.com/base32.html) -- 🪶 4KB gzipped - -Check out [Projects using scure-base](#projects-using-scure-base). - -### This library belongs to _scure_ - -> **scure** — audited micro-libraries. - -- Zero or minimal dependencies -- Highly readable TypeScript / JS code -- PGP-signed releases and transparent NPM builds -- Check out [homepage](https://paulmillr.com/noble/#scure) & all libraries: - [base](https://github.com/paulmillr/scure-base), - [bip32](https://github.com/paulmillr/scure-bip32), - [bip39](https://github.com/paulmillr/scure-bip39), - [btc-signer](https://github.com/paulmillr/scure-btc-signer), - [starknet](https://github.com/paulmillr/scure-starknet) - -## Usage - -> `npm install @scure/base` - -> `deno add jsr:@scure/base` - -> `deno doc jsr:@scure/base` # command-line documentation - -We support all major platforms and runtimes. The library is hybrid ESM / Common.js package. - -```js -import { base16, base32, base64, base58 } from '@scure/base'; -// Flavors -import { - base58xmr, - base58xrp, - base32nopad, - base32hex, - base32hexnopad, - base32crockford, - base64nopad, - base64url, - base64urlnopad, -} from '@scure/base'; - -const data = Uint8Array.from([1, 2, 3]); -base64.decode(base64.encode(data)); - -// Convert utf8 string to Uint8Array -const data2 = new TextEncoder().encode('hello'); -base58.encode(data2); - -// Everything has the same API except for bech32 and base58check -base32.encode(data); -base16.encode(data); -base32hex.encode(data); -``` - -base58check is a special case: you need to pass `sha256()` function: - -```js -import { createBase58check } from '@scure/base'; -createBase58check(sha256).encode(data); -``` - -## Bech32, Bech32m and Bitcoin - -We provide low-level bech32 operations. -If you need high-level methods for BTC (addresses, and others), use -[scure-btc-signer](https://github.com/paulmillr/scure-btc-signer) instead. - -Bitcoin addresses use both 5-bit words and bytes representations. -They can't be parsed using `bech32.decodeToBytes`. - -Same applies to Lightning Invoice Protocol -[BOLT-11](https://github.com/lightning/bolts/blob/master/11-payment-encoding.md). -We have many tests in `./test/bip173.test.js` that serve as minimal examples of -Bitcoin address and Lightning Invoice Protocol parsers. -Keep in mind that you'll need to verify the examples before using them in your code. - -Do something like this: - -```ts -const decoded = bech32.decode(address); -// NOTE: words in bitcoin addresses contain version as first element, -// with actual witness program words in rest -// BIP-141: The value of the first push is called the "version byte". -// The following byte vector pushed is called the "witness program". -const [version, ...dataW] = decoded.words; -const program = bech32.fromWords(dataW); // actual witness program -``` - -## Design rationale - -The code may feel unnecessarily complicated; but actually it's much easier to reason about. -Any encoding library consists of two functions: - -``` -encode(A) -> B -decode(B) -> A - where X = decode(encode(X)) - # encode(decode(X)) can be !== X! - # because decoding can normalize input - -e.g. -base58checksum = { - encode(): { - // checksum - // radix conversion - // alphabet - }, - decode(): { - // alphabet - // radix conversion - // checksum - } -} -``` - -But instead of creating two big functions for each specific case, -we create them from tiny composable building blocks: - -``` -base58checksum = chain(checksum(), radix(), alphabet()) -``` - -Which is the same as chain/pipe/sequence function in Functional Programming, -but significantly more useful since it enforces same order of execution of encode/decode. -Basically you only define encode (in declarative way) and get correct decode for free. -So, instead of reasoning about two big functions you need only reason about primitives and encode chain. -The design revealed obvious bug in older version of the lib, -where xmr version of base58 had errors in decode's block processing. - -Besides base-encodings, we can reuse the same approach with any encode/decode function -(`bytes2number`, `bytes2u32`, etc). -For example, you can easily encode entropy to mnemonic (BIP-39): - -```ts -export function getCoder(wordlist: string[]) { - if (!Array.isArray(wordlist) || wordlist.length !== 2 ** 11 || typeof wordlist[0] !== 'string') { - throw new Error('Wordlist: expected array of 2048 strings'); - } - return mbc.chain(mbu.checksum(1, checksum), mbu.radix2(11, true), mbu.alphabet(wordlist)); -} -``` - -### base58 is O(n^2) and radixes - -`Uint8Array` is represented as big-endian number: - -``` -[1, 2, 3, 4, 5] -> 1*(256**4) + 2*(256**3) 3*(256**2) + 4*(256**1) + 5*(256**0) -where 256 = 2**8 (8 bits per byte) -``` - -which is then converted to a number in another radix/base (16/32/58/64, etc). - -However, generic conversion between bases has [quadratic O(n^2) time complexity](https://cs.stackexchange.com/q/21799). - -Which means base58 has quadratic time complexity too. Use base58 only when you have small -constant sized input, because variable length sized input from user can cause DoS. - -On the other hand, if both bases are power of same number (like `2**8 <-> 2**64`), -there is linear algorithm. For now we have implementation for power-of-two bases only (radix2). - -## Security - -The library has been independently audited: - -- at version 1.0.0, in Jan 2022, by [cure53](https://cure53.de) - - PDFs: [online](https://cure53.de/pentest-report_hashing-libs.pdf), [offline](./audit/2022-01-05-cure53-audit-nbl2.pdf) - - [Changes since audit](https://github.com/paulmillr/scure-base/compare/1.0.0..main). - - The audit has been funded by [Ethereum Foundation](https://ethereum.org/en/) with help of [Nomic Labs](https://nomiclabs.io) - -The library was initially developed for [js-ethereum-cryptography](https://github.com/ethereum/js-ethereum-cryptography). -At commit [ae00e6d7](https://github.com/ethereum/js-ethereum-cryptography/commit/ae00e6d7d24fb3c76a1c7fe10039f6ecd120b77e), -it was extracted to a separate package called `micro-base`. -After the audit we've decided to use `@scure` NPM namespace for security. - -### Supply chain security - -- **Commits** are signed with PGP keys, to prevent forgery. Make sure to verify commit signatures -- **Releases** are transparent and built on GitHub CI. Make sure to verify [provenance](https://docs.npmjs.com/generating-provenance-statements) logs - - Use GitHub CLI to verify single-file builds: - `gh attestation verify --owner paulmillr scure-base.js` -- **Rare releasing** is followed to ensure less re-audit need for end-users -- **Dependencies** are minimized and locked-down: any dependency could get hacked and users will be downloading malware with every install. - - We make sure to use as few dependencies as possible - - Automatic dep updates are prevented by locking-down version ranges; diffs are checked with `npm-diff` -- **Dev Dependencies** are disabled for end-users; they are only used to develop / build the source code - -For this package, there are 0 dependencies; and a few dev dependencies: - -- micro-bmark, micro-should and jsbt are used for benchmarking / testing / build tooling and developed by the same author -- prettier, fast-check and typescript are used for code quality / test generation / ts compilation. It's hard to audit their source code thoroughly and fully because of their size - -## Contributing & testing - -- `npm install && npm run build && npm test` will build the code and run tests. -- `npm run lint` / `npm run format` will run linter / fix linter issues. -- `npm run build:release` will build single file - -### Projects using scure-base - -- [scure-btc-signer](https://github.com/paulmillr/scure-btc-signer) -- [prefixed-api-key](https://github.com/truestamp/prefixed-api-key) -- [coinspace](https://github.com/CoinSpace/CoinSpace) wallet and its modules: - [ada](https://github.com/CoinSpace/cs-cardano-wallet), - [btc](https://github.com/CoinSpace/cs-bitcoin-wallet) - [eos](https://github.com/CoinSpace/cs-eos-wallet), - [sol](https://github.com/CoinSpace/cs-solana-wallet), - [xmr](https://github.com/CoinSpace/cs-monero-wallet) - -## License - -MIT (c) Paul Miller [(https://paulmillr.com)](https://paulmillr.com), see LICENSE file. diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/index.ts b/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/index.ts deleted file mode 100644 index 1887d2c1..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/index.ts +++ /dev/null @@ -1,861 +0,0 @@ -/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */ - -export interface Coder { - encode(from: F): T; - decode(to: T): F; -} - -export interface BytesCoder extends Coder { - encode: (data: Uint8Array) => string; - decode: (str: string) => Uint8Array; -} - -function isBytes(a: unknown): a is Uint8Array { - return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array'); -} -/** Asserts something is Uint8Array. */ -function abytes(b: Uint8Array | undefined, ...lengths: number[]): void { - if (!isBytes(b)) throw new Error('Uint8Array expected'); - if (lengths.length > 0 && !lengths.includes(b.length)) - throw new Error('Uint8Array expected of length ' + lengths + ', got length=' + b.length); -} - -function isArrayOf(isString: boolean, arr: any[]) { - if (!Array.isArray(arr)) return false; - if (arr.length === 0) return true; - if (isString) { - return arr.every((item) => typeof item === 'string'); - } else { - return arr.every((item) => Number.isSafeInteger(item)); - } -} - -// no abytes: seems to have 10% slowdown. Why?! - -function afn(input: Function): input is Function { - if (typeof input !== 'function') throw new Error('function expected'); - return true; -} - -function astr(label: string, input: unknown): input is string { - if (typeof input !== 'string') throw new Error(`${label}: string expected`); - return true; -} - -function anumber(n: number): void { - if (!Number.isSafeInteger(n)) throw new Error(`invalid integer: ${n}`); -} - -function aArr(input: any[]) { - if (!Array.isArray(input)) throw new Error('array expected'); -} -function astrArr(label: string, input: string[]) { - if (!isArrayOf(true, input)) throw new Error(`${label}: array of strings expected`); -} -function anumArr(label: string, input: number[]) { - if (!isArrayOf(false, input)) throw new Error(`${label}: array of numbers expected`); -} - -// TODO: some recusive type inference so it would check correct order of input/output inside rest? -// like , , -type Chain = [Coder, ...Coder[]]; -// Extract info from Coder type -type Input = F extends Coder ? T : never; -type Output = F extends Coder ? T : never; -// Generic function for arrays -type First = T extends [infer U, ...any[]] ? U : never; -type Last = T extends [...any[], infer U] ? U : never; -type Tail = T extends [any, ...infer U] ? U : never; - -type AsChain> = { - // C[K] = Coder, Input> - [K in keyof C]: Coder, Input>; -}; - -/** - * @__NO_SIDE_EFFECTS__ - */ -function chain>(...args: T): Coder>, Output>> { - const id = (a: any) => a; - // Wrap call in closure so JIT can inline calls - const wrap = (a: any, b: any) => (c: any) => a(b(c)); - // Construct chain of args[-1].encode(args[-2].encode([...])) - const encode = args.map((x) => x.encode).reduceRight(wrap, id); - // Construct chain of args[0].decode(args[1].decode(...)) - const decode = args.map((x) => x.decode).reduce(wrap, id); - return { encode, decode }; -} - -/** - * Encodes integer radix representation to array of strings using alphabet and back. - * Could also be array of strings. - * @__NO_SIDE_EFFECTS__ - */ -function alphabet(letters: string | string[]): Coder { - // mapping 1 to "b" - const lettersA = typeof letters === 'string' ? letters.split('') : letters; - const len = lettersA.length; - astrArr('alphabet', lettersA); - - // mapping "b" to 1 - const indexes = new Map(lettersA.map((l, i) => [l, i])); - return { - encode: (digits: number[]) => { - aArr(digits); - return digits.map((i) => { - if (!Number.isSafeInteger(i) || i < 0 || i >= len) - throw new Error( - `alphabet.encode: digit index outside alphabet "${i}". Allowed: ${letters}` - ); - return lettersA[i]!; - }); - }, - decode: (input: string[]): number[] => { - aArr(input); - return input.map((letter) => { - astr('alphabet.decode', letter); - const i = indexes.get(letter); - if (i === undefined) throw new Error(`Unknown letter: "${letter}". Allowed: ${letters}`); - return i; - }); - }, - }; -} - -/** - * @__NO_SIDE_EFFECTS__ - */ -function join(separator = ''): Coder { - astr('join', separator); - return { - encode: (from) => { - astrArr('join.decode', from); - return from.join(separator); - }, - decode: (to) => { - astr('join.decode', to); - return to.split(separator); - }, - }; -} - -/** - * Pad strings array so it has integer number of bits - * @__NO_SIDE_EFFECTS__ - */ -function padding(bits: number, chr = '='): Coder { - anumber(bits); - astr('padding', chr); - return { - encode(data: string[]): string[] { - astrArr('padding.encode', data); - while ((data.length * bits) % 8) data.push(chr); - return data; - }, - decode(input: string[]): string[] { - astrArr('padding.decode', input); - let end = input.length; - if ((end * bits) % 8) - throw new Error('padding: invalid, string should have whole number of bytes'); - for (; end > 0 && input[end - 1] === chr; end--) { - const last = end - 1; - const byte = last * bits; - if (byte % 8 === 0) throw new Error('padding: invalid, string has too much padding'); - } - return input.slice(0, end); - }, - }; -} - -/** - * @__NO_SIDE_EFFECTS__ - */ -function normalize(fn: (val: T) => T): Coder { - afn(fn); - return { encode: (from: T) => from, decode: (to: T) => fn(to) }; -} - -/** - * Slow: O(n^2) time complexity - */ -function convertRadix(data: number[], from: number, to: number): number[] { - // base 1 is impossible - if (from < 2) throw new Error(`convertRadix: invalid from=${from}, base cannot be less than 2`); - if (to < 2) throw new Error(`convertRadix: invalid to=${to}, base cannot be less than 2`); - aArr(data); - if (!data.length) return []; - let pos = 0; - const res = []; - const digits = Array.from(data, (d) => { - anumber(d); - if (d < 0 || d >= from) throw new Error(`invalid integer: ${d}`); - return d; - }); - const dlen = digits.length; - while (true) { - let carry = 0; - let done = true; - for (let i = pos; i < dlen; i++) { - const digit = digits[i]!; - const fromCarry = from * carry; - const digitBase = fromCarry + digit; - if ( - !Number.isSafeInteger(digitBase) || - fromCarry / from !== carry || - digitBase - digit !== fromCarry - ) { - throw new Error('convertRadix: carry overflow'); - } - const div = digitBase / to; - carry = digitBase % to; - const rounded = Math.floor(div); - digits[i] = rounded; - if (!Number.isSafeInteger(rounded) || rounded * to + carry !== digitBase) - throw new Error('convertRadix: carry overflow'); - if (!done) continue; - else if (!rounded) pos = i; - else done = false; - } - res.push(carry); - if (done) break; - } - for (let i = 0; i < data.length - 1 && data[i] === 0; i++) res.push(0); - return res.reverse(); -} - -const gcd = (a: number, b: number): number => (b === 0 ? a : gcd(b, a % b)); -const radix2carry = /* @__NO_SIDE_EFFECTS__ */ (from: number, to: number) => - from + (to - gcd(from, to)); -const powers: number[] = /* @__PURE__ */ (() => { - let res = []; - for (let i = 0; i < 40; i++) res.push(2 ** i); - return res; -})(); -/** - * Implemented with numbers, because BigInt is 5x slower - */ -function convertRadix2(data: number[], from: number, to: number, padding: boolean): number[] { - aArr(data); - if (from <= 0 || from > 32) throw new Error(`convertRadix2: wrong from=${from}`); - if (to <= 0 || to > 32) throw new Error(`convertRadix2: wrong to=${to}`); - if (radix2carry(from, to) > 32) { - throw new Error( - `convertRadix2: carry overflow from=${from} to=${to} carryBits=${radix2carry(from, to)}` - ); - } - let carry = 0; - let pos = 0; // bitwise position in current element - const max = powers[from]!; - const mask = powers[to]! - 1; - const res: number[] = []; - for (const n of data) { - anumber(n); - if (n >= max) throw new Error(`convertRadix2: invalid data word=${n} from=${from}`); - carry = (carry << from) | n; - if (pos + from > 32) throw new Error(`convertRadix2: carry overflow pos=${pos} from=${from}`); - pos += from; - for (; pos >= to; pos -= to) res.push(((carry >> (pos - to)) & mask) >>> 0); - const pow = powers[pos]; - if (pow === undefined) throw new Error('invalid carry'); - carry &= pow - 1; // clean carry, otherwise it will cause overflow - } - carry = (carry << (to - pos)) & mask; - if (!padding && pos >= from) throw new Error('Excess padding'); - if (!padding && carry > 0) throw new Error(`Non-zero padding: ${carry}`); - if (padding && pos > 0) res.push(carry >>> 0); - return res; -} - -/** - * @__NO_SIDE_EFFECTS__ - */ -function radix(num: number): Coder { - anumber(num); - const _256 = 2 ** 8; - return { - encode: (bytes: Uint8Array) => { - if (!isBytes(bytes)) throw new Error('radix.encode input should be Uint8Array'); - return convertRadix(Array.from(bytes), _256, num); - }, - decode: (digits: number[]) => { - anumArr('radix.decode', digits); - return Uint8Array.from(convertRadix(digits, num, _256)); - }, - }; -} - -/** - * If both bases are power of same number (like `2**8 <-> 2**64`), - * there is a linear algorithm. For now we have implementation for power-of-two bases only. - * @__NO_SIDE_EFFECTS__ - */ -function radix2(bits: number, revPadding = false): Coder { - anumber(bits); - if (bits <= 0 || bits > 32) throw new Error('radix2: bits should be in (0..32]'); - if (radix2carry(8, bits) > 32 || radix2carry(bits, 8) > 32) - throw new Error('radix2: carry overflow'); - return { - encode: (bytes: Uint8Array) => { - if (!isBytes(bytes)) throw new Error('radix2.encode input should be Uint8Array'); - return convertRadix2(Array.from(bytes), 8, bits, !revPadding); - }, - decode: (digits: number[]) => { - anumArr('radix2.decode', digits); - return Uint8Array.from(convertRadix2(digits, bits, 8, revPadding)); - }, - }; -} - -type ArgumentTypes = F extends (...args: infer A) => any ? A : never; -function unsafeWrapper any>(fn: T) { - afn(fn); - return function (...args: ArgumentTypes): ReturnType | void { - try { - return fn.apply(null, args); - } catch (e) {} - }; -} - -function checksum( - len: number, - fn: (data: Uint8Array) => Uint8Array -): Coder { - anumber(len); - afn(fn); - return { - encode(data: Uint8Array) { - if (!isBytes(data)) throw new Error('checksum.encode: input should be Uint8Array'); - const sum = fn(data).slice(0, len); - const res = new Uint8Array(data.length + len); - res.set(data); - res.set(sum, data.length); - return res; - }, - decode(data: Uint8Array) { - if (!isBytes(data)) throw new Error('checksum.decode: input should be Uint8Array'); - const payload = data.slice(0, -len); - const oldChecksum = data.slice(-len); - const newChecksum = fn(payload).slice(0, len); - for (let i = 0; i < len; i++) - if (newChecksum[i] !== oldChecksum[i]) throw new Error('Invalid checksum'); - return payload; - }, - }; -} - -// prettier-ignore -export const utils: { alphabet: typeof alphabet; chain: typeof chain; checksum: typeof checksum; convertRadix: typeof convertRadix; convertRadix2: typeof convertRadix2; radix: typeof radix; radix2: typeof radix2; join: typeof join; padding: typeof padding; } = { - alphabet, chain, checksum, convertRadix, convertRadix2, radix, radix2, join, padding, -}; - -// RFC 4648 aka RFC 3548 -// --------------------- - -/** - * base16 encoding from RFC 4648. - * @example - * ```js - * base16.encode(Uint8Array.from([0x12, 0xab])); - * // => '12AB' - * ``` - */ -export const base16: BytesCoder = chain(radix2(4), alphabet('0123456789ABCDEF'), join('')); - -/** - * base32 encoding from RFC 4648. Has padding. - * Use `base32nopad` for unpadded version. - * Also check out `base32hex`, `base32hexnopad`, `base32crockford`. - * @example - * ```js - * base32.encode(Uint8Array.from([0x12, 0xab])); - * // => 'CKVQ====' - * base32.decode('CKVQ===='); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export const base32: BytesCoder = chain( - radix2(5), - alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'), - padding(5), - join('') -); - -/** - * base32 encoding from RFC 4648. No padding. - * Use `base32` for padded version. - * Also check out `base32hex`, `base32hexnopad`, `base32crockford`. - * @example - * ```js - * base32nopad.encode(Uint8Array.from([0x12, 0xab])); - * // => 'CKVQ' - * base32nopad.decode('CKVQ'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export const base32nopad: BytesCoder = chain( - radix2(5), - alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'), - join('') -); -/** - * base32 encoding from RFC 4648. Padded. Compared to ordinary `base32`, slightly different alphabet. - * Use `base32hexnopad` for unpadded version. - * @example - * ```js - * base32hex.encode(Uint8Array.from([0x12, 0xab])); - * // => '2ALG====' - * base32hex.decode('2ALG===='); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export const base32hex: BytesCoder = chain( - radix2(5), - alphabet('0123456789ABCDEFGHIJKLMNOPQRSTUV'), - padding(5), - join('') -); - -/** - * base32 encoding from RFC 4648. No padding. Compared to ordinary `base32`, slightly different alphabet. - * Use `base32hex` for padded version. - * @example - * ```js - * base32hexnopad.encode(Uint8Array.from([0x12, 0xab])); - * // => '2ALG' - * base32hexnopad.decode('2ALG'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export const base32hexnopad: BytesCoder = chain( - radix2(5), - alphabet('0123456789ABCDEFGHIJKLMNOPQRSTUV'), - join('') -); -/** - * base32 encoding from RFC 4648. Doug Crockford's version. - * https://www.crockford.com/base32.html - * @example - * ```js - * base32crockford.encode(Uint8Array.from([0x12, 0xab])); - * // => '2ANG' - * base32crockford.decode('2ANG'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export const base32crockford: BytesCoder = chain( - radix2(5), - alphabet('0123456789ABCDEFGHJKMNPQRSTVWXYZ'), - join(''), - normalize((s: string) => s.toUpperCase().replace(/O/g, '0').replace(/[IL]/g, '1')) -); - -// Built-in base64 conversion https://caniuse.com/mdn-javascript_builtins_uint8array_frombase64 -// prettier-ignore -const hasBase64Builtin: boolean = /* @__PURE__ */ (() => - typeof (Uint8Array as any).from([]).toBase64 === 'function' && - typeof (Uint8Array as any).fromBase64 === 'function')(); - -const decodeBase64Builtin = (s: string, isUrl: boolean) => { - astr('base64', s); - const re = isUrl ? /^[A-Za-z0-9=_-]+$/ : /^[A-Za-z0-9=+/]+$/; - const alphabet = isUrl ? 'base64url' : 'base64'; - if (s.length > 0 && !re.test(s)) throw new Error('invalid base64'); - return (Uint8Array as any).fromBase64(s, { alphabet, lastChunkHandling: 'strict' }); -}; - -/** - * base64 from RFC 4648. Padded. - * Use `base64nopad` for unpadded version. - * Also check out `base64url`, `base64urlnopad`. - * Falls back to built-in function, when available. - * @example - * ```js - * base64.encode(Uint8Array.from([0x12, 0xab])); - * // => 'Eqs=' - * base64.decode('Eqs='); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -// prettier-ignore -export const base64: BytesCoder = hasBase64Builtin ? { - encode(b) { abytes(b); return (b as any).toBase64(); }, - decode(s) { return decodeBase64Builtin(s, false); }, -} : chain( - radix2(6), - alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'), - padding(6), - join('') -); -/** - * base64 from RFC 4648. No padding. - * Use `base64` for padded version. - * @example - * ```js - * base64nopad.encode(Uint8Array.from([0x12, 0xab])); - * // => 'Eqs' - * base64nopad.decode('Eqs'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export const base64nopad: BytesCoder = chain( - radix2(6), - alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'), - join('') -); - -/** - * base64 from RFC 4648, using URL-safe alphabet. Padded. - * Use `base64urlnopad` for unpadded version. - * Falls back to built-in function, when available. - * @example - * ```js - * base64url.encode(Uint8Array.from([0x12, 0xab])); - * // => 'Eqs=' - * base64url.decode('Eqs='); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -// prettier-ignore -export const base64url: BytesCoder = hasBase64Builtin ? { - encode(b) { abytes(b); return (b as any).toBase64({ alphabet: 'base64url' }); }, - decode(s) { return decodeBase64Builtin(s, true); }, -} : chain( - radix2(6), - alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'), - padding(6), - join('') -); - -/** - * base64 from RFC 4648, using URL-safe alphabet. No padding. - * Use `base64url` for padded version. - * @example - * ```js - * base64urlnopad.encode(Uint8Array.from([0x12, 0xab])); - * // => 'Eqs' - * base64urlnopad.decode('Eqs'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export const base64urlnopad: BytesCoder = chain( - radix2(6), - alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'), - join('') -); - -// base58 code -// ----------- -const genBase58 = /* @__NO_SIDE_EFFECTS__ */ (abc: string) => - chain(radix(58), alphabet(abc), join('')); - -/** - * base58: base64 without ambigous characters +, /, 0, O, I, l. - * Quadratic (O(n^2)) - so, can't be used on large inputs. - * @example - * ```js - * base58.decode('01abcdef'); - * // => '3UhJW' - * ``` - */ -export const base58: BytesCoder = genBase58( - '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' -); -/** - * base58: flickr version. Check out `base58`. - */ -export const base58flickr: BytesCoder = genBase58( - '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' -); -/** - * base58: XRP version. Check out `base58`. - */ -export const base58xrp: BytesCoder = genBase58( - 'rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz' -); - -// Data len (index) -> encoded block len -const XMR_BLOCK_LEN = [0, 2, 3, 5, 6, 7, 9, 10, 11]; - -/** - * base58: XMR version. Check out `base58`. - * Done in 8-byte blocks (which equals 11 chars in decoding). Last (non-full) block padded with '1' to size in XMR_BLOCK_LEN. - * Block encoding significantly reduces quadratic complexity of base58. - */ -export const base58xmr: BytesCoder = { - encode(data: Uint8Array) { - let res = ''; - for (let i = 0; i < data.length; i += 8) { - const block = data.subarray(i, i + 8); - res += base58.encode(block).padStart(XMR_BLOCK_LEN[block.length]!, '1'); - } - return res; - }, - decode(str: string) { - let res: number[] = []; - for (let i = 0; i < str.length; i += 11) { - const slice = str.slice(i, i + 11); - const blockLen = XMR_BLOCK_LEN.indexOf(slice.length); - const block = base58.decode(slice); - for (let j = 0; j < block.length - blockLen; j++) { - if (block[j] !== 0) throw new Error('base58xmr: wrong padding'); - } - res = res.concat(Array.from(block.slice(block.length - blockLen))); - } - return Uint8Array.from(res); - }, -}; - -/** - * Method, which creates base58check encoder. - * Requires function, calculating sha256. - */ -export const createBase58check = (sha256: (data: Uint8Array) => Uint8Array): BytesCoder => - chain( - checksum(4, (data) => sha256(sha256(data))), - base58 - ); - -/** - * Use `createBase58check` instead. - * @deprecated - */ -export const base58check: (sha256: (data: Uint8Array) => Uint8Array) => BytesCoder = - createBase58check; - -// Bech32 code -// ----------- -export interface Bech32Decoded { - prefix: Prefix; - words: number[]; -} -export interface Bech32DecodedWithArray { - prefix: Prefix; - words: number[]; - bytes: Uint8Array; -} - -const BECH_ALPHABET: Coder = chain( - alphabet('qpzry9x8gf2tvdw0s3jn54khce6mua7l'), - join('') -); - -const POLYMOD_GENERATORS = [0x3b6a57b2, 0x26508e6d, 0x1ea119fa, 0x3d4233dd, 0x2a1462b3]; -function bech32Polymod(pre: number): number { - const b = pre >> 25; - let chk = (pre & 0x1ffffff) << 5; - for (let i = 0; i < POLYMOD_GENERATORS.length; i++) { - if (((b >> i) & 1) === 1) chk ^= POLYMOD_GENERATORS[i]!; - } - return chk; -} - -function bechChecksum(prefix: string, words: number[], encodingConst = 1): string { - const len = prefix.length; - let chk = 1; - for (let i = 0; i < len; i++) { - const c = prefix.charCodeAt(i); - if (c < 33 || c > 126) throw new Error(`Invalid prefix (${prefix})`); - chk = bech32Polymod(chk) ^ (c >> 5); - } - chk = bech32Polymod(chk); - for (let i = 0; i < len; i++) chk = bech32Polymod(chk) ^ (prefix.charCodeAt(i) & 0x1f); - for (let v of words) chk = bech32Polymod(chk) ^ v; - for (let i = 0; i < 6; i++) chk = bech32Polymod(chk); - chk ^= encodingConst; - return BECH_ALPHABET.encode(convertRadix2([chk % powers[30]!], 30, 5, false)); -} - -export interface Bech32 { - encode( - prefix: Prefix, - words: number[] | Uint8Array, - limit?: number | false - ): `${Lowercase}1${string}`; - decode( - str: `${Prefix}1${string}`, - limit?: number | false - ): Bech32Decoded; - encodeFromBytes(prefix: string, bytes: Uint8Array): string; - decodeToBytes(str: string): Bech32DecodedWithArray; - decodeUnsafe(str: string, limit?: number | false): void | Bech32Decoded; - fromWords(to: number[]): Uint8Array; - fromWordsUnsafe(to: number[]): void | Uint8Array; - toWords(from: Uint8Array): number[]; -} -/** - * @__NO_SIDE_EFFECTS__ - */ -function genBech32(encoding: 'bech32' | 'bech32m'): Bech32 { - const ENCODING_CONST = encoding === 'bech32' ? 1 : 0x2bc830a3; - const _words = radix2(5); - const fromWords = _words.decode; - const toWords = _words.encode; - const fromWordsUnsafe = unsafeWrapper(fromWords); - - function encode( - prefix: Prefix, - words: number[] | Uint8Array, - limit: number | false = 90 - ): `${Lowercase}1${string}` { - astr('bech32.encode prefix', prefix); - if (isBytes(words)) words = Array.from(words); - anumArr('bech32.encode', words); - const plen = prefix.length; - if (plen === 0) throw new TypeError(`Invalid prefix length ${plen}`); - const actualLength = plen + 7 + words.length; - if (limit !== false && actualLength > limit) - throw new TypeError(`Length ${actualLength} exceeds limit ${limit}`); - const lowered = prefix.toLowerCase(); - const sum = bechChecksum(lowered, words, ENCODING_CONST); - return `${lowered}1${BECH_ALPHABET.encode(words)}${sum}` as `${Lowercase}1${string}`; - } - - function decode( - str: `${Prefix}1${string}`, - limit?: number | false - ): Bech32Decoded; - function decode(str: string, limit?: number | false): Bech32Decoded; - function decode(str: string, limit: number | false = 90): Bech32Decoded { - astr('bech32.decode input', str); - const slen = str.length; - if (slen < 8 || (limit !== false && slen > limit)) - throw new TypeError(`invalid string length: ${slen} (${str}). Expected (8..${limit})`); - // don't allow mixed case - const lowered = str.toLowerCase(); - if (str !== lowered && str !== str.toUpperCase()) - throw new Error(`String must be lowercase or uppercase`); - const sepIndex = lowered.lastIndexOf('1'); - if (sepIndex === 0 || sepIndex === -1) - throw new Error(`Letter "1" must be present between prefix and data only`); - const prefix = lowered.slice(0, sepIndex); - const data = lowered.slice(sepIndex + 1); - if (data.length < 6) throw new Error('Data must be at least 6 characters long'); - const words = BECH_ALPHABET.decode(data).slice(0, -6); - const sum = bechChecksum(prefix, words, ENCODING_CONST); - if (!data.endsWith(sum)) throw new Error(`Invalid checksum in ${str}: expected "${sum}"`); - return { prefix, words }; - } - - const decodeUnsafe = unsafeWrapper(decode); - - function decodeToBytes(str: string): Bech32DecodedWithArray { - const { prefix, words } = decode(str, false); - return { prefix, words, bytes: fromWords(words) }; - } - - function encodeFromBytes(prefix: string, bytes: Uint8Array) { - return encode(prefix, toWords(bytes)); - } - - return { - encode, - decode, - encodeFromBytes, - decodeToBytes, - decodeUnsafe, - fromWords, - fromWordsUnsafe, - toWords, - }; -} - -/** - * bech32 from BIP 173. Operates on words. - * For high-level, check out scure-btc-signer: - * https://github.com/paulmillr/scure-btc-signer. - */ -export const bech32: Bech32 = genBech32('bech32'); - -/** - * bech32m from BIP 350. Operates on words. - * It was to mitigate `bech32` weaknesses. - * For high-level, check out scure-btc-signer: - * https://github.com/paulmillr/scure-btc-signer. - */ -export const bech32m: Bech32 = genBech32('bech32m'); - -declare const TextEncoder: any; -declare const TextDecoder: any; - -/** - * UTF-8-to-byte decoder. Uses built-in TextDecoder / TextEncoder. - * @example - * ```js - * const b = utf8.decode("hey"); // => new Uint8Array([ 104, 101, 121 ]) - * const str = utf8.encode(b); // "hey" - * ``` - */ -export const utf8: BytesCoder = { - encode: (data) => new TextDecoder().decode(data), - decode: (str) => new TextEncoder().encode(str), -}; - -// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex -// prettier-ignore -const hasHexBuiltin: boolean = /* @__PURE__ */ (() => - typeof (Uint8Array as any).from([]).toHex === 'function' && - typeof (Uint8Array as any).fromHex === 'function')(); -// prettier-ignore -const hexBuiltin: BytesCoder = { - encode(data) { abytes(data); return (data as any).toHex(); }, - decode(s) { astr('hex', s); return (Uint8Array as any).fromHex(s); }, -}; -/** - * hex string decoder. Uses built-in function, when available. - * @example - * ```js - * const b = hex.decode("0102ff"); // => new Uint8Array([ 1, 2, 255 ]) - * const str = hex.encode(b); // "0102ff" - * ``` - */ -export const hex: BytesCoder = hasHexBuiltin - ? hexBuiltin - : chain( - radix2(4), - alphabet('0123456789abcdef'), - join(''), - normalize((s: string) => { - if (typeof s !== 'string' || s.length % 2 !== 0) - throw new TypeError( - `hex.decode: expected string, got ${typeof s} with length ${s.length}` - ); - return s.toLowerCase(); - }) - ); - -export type SomeCoders = { - utf8: BytesCoder; - hex: BytesCoder; - base16: BytesCoder; - base32: BytesCoder; - base64: BytesCoder; - base64url: BytesCoder; - base58: BytesCoder; - base58xmr: BytesCoder; -}; -// prettier-ignore -const CODERS: SomeCoders = { - utf8, hex, base16, base32, base64, base64url, base58, base58xmr -}; -type CoderType = keyof SomeCoders; -const coderTypeError = - 'Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr'; - -/** @deprecated */ -export const bytesToString = (type: CoderType, bytes: Uint8Array): string => { - if (typeof type !== 'string' || !CODERS.hasOwnProperty(type)) throw new TypeError(coderTypeError); - if (!isBytes(bytes)) throw new TypeError('bytesToString() expects Uint8Array'); - return CODERS[type].encode(bytes); -}; - -/** @deprecated */ -export const str: (type: CoderType, bytes: Uint8Array) => string = bytesToString; // as in python, but for bytes only - -/** @deprecated */ -export const stringToBytes = (type: CoderType, str: string): Uint8Array => { - if (!CODERS.hasOwnProperty(type)) throw new TypeError(coderTypeError); - if (typeof str !== 'string') throw new TypeError('stringToBytes() expects string'); - return CODERS[type].decode(str); -}; -/** @deprecated */ -export const bytes: (type: CoderType, str: string) => Uint8Array = stringToBytes; diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/lib/esm/index.d.ts b/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/lib/esm/index.d.ts deleted file mode 100644 index dde46dd3..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/lib/esm/index.d.ts +++ /dev/null @@ -1,294 +0,0 @@ -/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -export interface Coder { - encode(from: F): T; - decode(to: T): F; -} -export interface BytesCoder extends Coder { - encode: (data: Uint8Array) => string; - decode: (str: string) => Uint8Array; -} -type Chain = [Coder, ...Coder[]]; -type Input = F extends Coder ? T : never; -type Output = F extends Coder ? T : never; -type First = T extends [infer U, ...any[]] ? U : never; -type Last = T extends [...any[], infer U] ? U : never; -type Tail = T extends [any, ...infer U] ? U : never; -type AsChain> = { - [K in keyof C]: Coder, Input>; -}; -/** - * @__NO_SIDE_EFFECTS__ - */ -declare function chain>(...args: T): Coder>, Output>>; -/** - * Encodes integer radix representation to array of strings using alphabet and back. - * Could also be array of strings. - * @__NO_SIDE_EFFECTS__ - */ -declare function alphabet(letters: string | string[]): Coder; -/** - * @__NO_SIDE_EFFECTS__ - */ -declare function join(separator?: string): Coder; -/** - * Pad strings array so it has integer number of bits - * @__NO_SIDE_EFFECTS__ - */ -declare function padding(bits: number, chr?: string): Coder; -/** - * Slow: O(n^2) time complexity - */ -declare function convertRadix(data: number[], from: number, to: number): number[]; -/** - * Implemented with numbers, because BigInt is 5x slower - */ -declare function convertRadix2(data: number[], from: number, to: number, padding: boolean): number[]; -/** - * @__NO_SIDE_EFFECTS__ - */ -declare function radix(num: number): Coder; -/** - * If both bases are power of same number (like `2**8 <-> 2**64`), - * there is a linear algorithm. For now we have implementation for power-of-two bases only. - * @__NO_SIDE_EFFECTS__ - */ -declare function radix2(bits: number, revPadding?: boolean): Coder; -declare function checksum(len: number, fn: (data: Uint8Array) => Uint8Array): Coder; -export declare const utils: { - alphabet: typeof alphabet; - chain: typeof chain; - checksum: typeof checksum; - convertRadix: typeof convertRadix; - convertRadix2: typeof convertRadix2; - radix: typeof radix; - radix2: typeof radix2; - join: typeof join; - padding: typeof padding; -}; -/** - * base16 encoding from RFC 4648. - * @example - * ```js - * base16.encode(Uint8Array.from([0x12, 0xab])); - * // => '12AB' - * ``` - */ -export declare const base16: BytesCoder; -/** - * base32 encoding from RFC 4648. Has padding. - * Use `base32nopad` for unpadded version. - * Also check out `base32hex`, `base32hexnopad`, `base32crockford`. - * @example - * ```js - * base32.encode(Uint8Array.from([0x12, 0xab])); - * // => 'CKVQ====' - * base32.decode('CKVQ===='); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export declare const base32: BytesCoder; -/** - * base32 encoding from RFC 4648. No padding. - * Use `base32` for padded version. - * Also check out `base32hex`, `base32hexnopad`, `base32crockford`. - * @example - * ```js - * base32nopad.encode(Uint8Array.from([0x12, 0xab])); - * // => 'CKVQ' - * base32nopad.decode('CKVQ'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export declare const base32nopad: BytesCoder; -/** - * base32 encoding from RFC 4648. Padded. Compared to ordinary `base32`, slightly different alphabet. - * Use `base32hexnopad` for unpadded version. - * @example - * ```js - * base32hex.encode(Uint8Array.from([0x12, 0xab])); - * // => '2ALG====' - * base32hex.decode('2ALG===='); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export declare const base32hex: BytesCoder; -/** - * base32 encoding from RFC 4648. No padding. Compared to ordinary `base32`, slightly different alphabet. - * Use `base32hex` for padded version. - * @example - * ```js - * base32hexnopad.encode(Uint8Array.from([0x12, 0xab])); - * // => '2ALG' - * base32hexnopad.decode('2ALG'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export declare const base32hexnopad: BytesCoder; -/** - * base32 encoding from RFC 4648. Doug Crockford's version. - * https://www.crockford.com/base32.html - * @example - * ```js - * base32crockford.encode(Uint8Array.from([0x12, 0xab])); - * // => '2ANG' - * base32crockford.decode('2ANG'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export declare const base32crockford: BytesCoder; -/** - * base64 from RFC 4648. Padded. - * Use `base64nopad` for unpadded version. - * Also check out `base64url`, `base64urlnopad`. - * Falls back to built-in function, when available. - * @example - * ```js - * base64.encode(Uint8Array.from([0x12, 0xab])); - * // => 'Eqs=' - * base64.decode('Eqs='); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export declare const base64: BytesCoder; -/** - * base64 from RFC 4648. No padding. - * Use `base64` for padded version. - * @example - * ```js - * base64nopad.encode(Uint8Array.from([0x12, 0xab])); - * // => 'Eqs' - * base64nopad.decode('Eqs'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export declare const base64nopad: BytesCoder; -/** - * base64 from RFC 4648, using URL-safe alphabet. Padded. - * Use `base64urlnopad` for unpadded version. - * Falls back to built-in function, when available. - * @example - * ```js - * base64url.encode(Uint8Array.from([0x12, 0xab])); - * // => 'Eqs=' - * base64url.decode('Eqs='); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export declare const base64url: BytesCoder; -/** - * base64 from RFC 4648, using URL-safe alphabet. No padding. - * Use `base64url` for padded version. - * @example - * ```js - * base64urlnopad.encode(Uint8Array.from([0x12, 0xab])); - * // => 'Eqs' - * base64urlnopad.decode('Eqs'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export declare const base64urlnopad: BytesCoder; -/** - * base58: base64 without ambigous characters +, /, 0, O, I, l. - * Quadratic (O(n^2)) - so, can't be used on large inputs. - * @example - * ```js - * base58.decode('01abcdef'); - * // => '3UhJW' - * ``` - */ -export declare const base58: BytesCoder; -/** - * base58: flickr version. Check out `base58`. - */ -export declare const base58flickr: BytesCoder; -/** - * base58: XRP version. Check out `base58`. - */ -export declare const base58xrp: BytesCoder; -/** - * base58: XMR version. Check out `base58`. - * Done in 8-byte blocks (which equals 11 chars in decoding). Last (non-full) block padded with '1' to size in XMR_BLOCK_LEN. - * Block encoding significantly reduces quadratic complexity of base58. - */ -export declare const base58xmr: BytesCoder; -/** - * Method, which creates base58check encoder. - * Requires function, calculating sha256. - */ -export declare const createBase58check: (sha256: (data: Uint8Array) => Uint8Array) => BytesCoder; -/** - * Use `createBase58check` instead. - * @deprecated - */ -export declare const base58check: (sha256: (data: Uint8Array) => Uint8Array) => BytesCoder; -export interface Bech32Decoded { - prefix: Prefix; - words: number[]; -} -export interface Bech32DecodedWithArray { - prefix: Prefix; - words: number[]; - bytes: Uint8Array; -} -export interface Bech32 { - encode(prefix: Prefix, words: number[] | Uint8Array, limit?: number | false): `${Lowercase}1${string}`; - decode(str: `${Prefix}1${string}`, limit?: number | false): Bech32Decoded; - encodeFromBytes(prefix: string, bytes: Uint8Array): string; - decodeToBytes(str: string): Bech32DecodedWithArray; - decodeUnsafe(str: string, limit?: number | false): void | Bech32Decoded; - fromWords(to: number[]): Uint8Array; - fromWordsUnsafe(to: number[]): void | Uint8Array; - toWords(from: Uint8Array): number[]; -} -/** - * bech32 from BIP 173. Operates on words. - * For high-level, check out scure-btc-signer: - * https://github.com/paulmillr/scure-btc-signer. - */ -export declare const bech32: Bech32; -/** - * bech32m from BIP 350. Operates on words. - * It was to mitigate `bech32` weaknesses. - * For high-level, check out scure-btc-signer: - * https://github.com/paulmillr/scure-btc-signer. - */ -export declare const bech32m: Bech32; -/** - * UTF-8-to-byte decoder. Uses built-in TextDecoder / TextEncoder. - * @example - * ```js - * const b = utf8.decode("hey"); // => new Uint8Array([ 104, 101, 121 ]) - * const str = utf8.encode(b); // "hey" - * ``` - */ -export declare const utf8: BytesCoder; -/** - * hex string decoder. Uses built-in function, when available. - * @example - * ```js - * const b = hex.decode("0102ff"); // => new Uint8Array([ 1, 2, 255 ]) - * const str = hex.encode(b); // "0102ff" - * ``` - */ -export declare const hex: BytesCoder; -export type SomeCoders = { - utf8: BytesCoder; - hex: BytesCoder; - base16: BytesCoder; - base32: BytesCoder; - base64: BytesCoder; - base64url: BytesCoder; - base58: BytesCoder; - base58xmr: BytesCoder; -}; -type CoderType = keyof SomeCoders; -/** @deprecated */ -export declare const bytesToString: (type: CoderType, bytes: Uint8Array) => string; -/** @deprecated */ -export declare const str: (type: CoderType, bytes: Uint8Array) => string; -/** @deprecated */ -export declare const stringToBytes: (type: CoderType, str: string) => Uint8Array; -/** @deprecated */ -export declare const bytes: (type: CoderType, str: string) => Uint8Array; -export {}; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/lib/esm/index.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/lib/esm/index.d.ts.map deleted file mode 100644 index beda1cec..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/lib/esm/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,oEAAoE;AAEpE,MAAM,WAAW,KAAK,CAAC,CAAC,EAAE,CAAC;IACzB,MAAM,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC;IACnB,MAAM,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC;CAClB;AAED,MAAM,WAAW,UAAW,SAAQ,KAAK,CAAC,UAAU,EAAE,MAAM,CAAC;IAC3D,MAAM,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,MAAM,CAAC;IACrC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,UAAU,CAAC;CACrC;AAkDD,KAAK,KAAK,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;AAErD,KAAK,KAAK,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAC1D,KAAK,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAE3D,KAAK,KAAK,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAC1D,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,GAAG,EAAE,EAA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AS,GAAG,MAAM,UAAU,CAAC;AAIlC,kBAAkB;AAClB,eAAO,MAAM,aAAa,GAAI,MAAM,SAAS,EAAE,OAAO,UAAU,KAAG,MAIlE,CAAC;AAEF,kBAAkB;AAClB,eAAO,MAAM,GAAG,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,KAAK,MAAsB,CAAC;AAEjF,kBAAkB;AAClB,eAAO,MAAM,aAAa,GAAI,MAAM,SAAS,EAAE,KAAK,MAAM,KAAG,UAI5D,CAAC;AACF,kBAAkB;AAClB,eAAO,MAAM,KAAK,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,KAAK,UAA0B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/lib/esm/index.js b/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/lib/esm/index.js deleted file mode 100644 index a15066d1..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/lib/esm/index.js +++ /dev/null @@ -1,707 +0,0 @@ -/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -function isBytes(a) { - return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array'); -} -/** Asserts something is Uint8Array. */ -function abytes(b, ...lengths) { - if (!isBytes(b)) - throw new Error('Uint8Array expected'); - if (lengths.length > 0 && !lengths.includes(b.length)) - throw new Error('Uint8Array expected of length ' + lengths + ', got length=' + b.length); -} -function isArrayOf(isString, arr) { - if (!Array.isArray(arr)) - return false; - if (arr.length === 0) - return true; - if (isString) { - return arr.every((item) => typeof item === 'string'); - } - else { - return arr.every((item) => Number.isSafeInteger(item)); - } -} -// no abytes: seems to have 10% slowdown. Why?! -function afn(input) { - if (typeof input !== 'function') - throw new Error('function expected'); - return true; -} -function astr(label, input) { - if (typeof input !== 'string') - throw new Error(`${label}: string expected`); - return true; -} -function anumber(n) { - if (!Number.isSafeInteger(n)) - throw new Error(`invalid integer: ${n}`); -} -function aArr(input) { - if (!Array.isArray(input)) - throw new Error('array expected'); -} -function astrArr(label, input) { - if (!isArrayOf(true, input)) - throw new Error(`${label}: array of strings expected`); -} -function anumArr(label, input) { - if (!isArrayOf(false, input)) - throw new Error(`${label}: array of numbers expected`); -} -/** - * @__NO_SIDE_EFFECTS__ - */ -function chain(...args) { - const id = (a) => a; - // Wrap call in closure so JIT can inline calls - const wrap = (a, b) => (c) => a(b(c)); - // Construct chain of args[-1].encode(args[-2].encode([...])) - const encode = args.map((x) => x.encode).reduceRight(wrap, id); - // Construct chain of args[0].decode(args[1].decode(...)) - const decode = args.map((x) => x.decode).reduce(wrap, id); - return { encode, decode }; -} -/** - * Encodes integer radix representation to array of strings using alphabet and back. - * Could also be array of strings. - * @__NO_SIDE_EFFECTS__ - */ -function alphabet(letters) { - // mapping 1 to "b" - const lettersA = typeof letters === 'string' ? letters.split('') : letters; - const len = lettersA.length; - astrArr('alphabet', lettersA); - // mapping "b" to 1 - const indexes = new Map(lettersA.map((l, i) => [l, i])); - return { - encode: (digits) => { - aArr(digits); - return digits.map((i) => { - if (!Number.isSafeInteger(i) || i < 0 || i >= len) - throw new Error(`alphabet.encode: digit index outside alphabet "${i}". Allowed: ${letters}`); - return lettersA[i]; - }); - }, - decode: (input) => { - aArr(input); - return input.map((letter) => { - astr('alphabet.decode', letter); - const i = indexes.get(letter); - if (i === undefined) - throw new Error(`Unknown letter: "${letter}". Allowed: ${letters}`); - return i; - }); - }, - }; -} -/** - * @__NO_SIDE_EFFECTS__ - */ -function join(separator = '') { - astr('join', separator); - return { - encode: (from) => { - astrArr('join.decode', from); - return from.join(separator); - }, - decode: (to) => { - astr('join.decode', to); - return to.split(separator); - }, - }; -} -/** - * Pad strings array so it has integer number of bits - * @__NO_SIDE_EFFECTS__ - */ -function padding(bits, chr = '=') { - anumber(bits); - astr('padding', chr); - return { - encode(data) { - astrArr('padding.encode', data); - while ((data.length * bits) % 8) - data.push(chr); - return data; - }, - decode(input) { - astrArr('padding.decode', input); - let end = input.length; - if ((end * bits) % 8) - throw new Error('padding: invalid, string should have whole number of bytes'); - for (; end > 0 && input[end - 1] === chr; end--) { - const last = end - 1; - const byte = last * bits; - if (byte % 8 === 0) - throw new Error('padding: invalid, string has too much padding'); - } - return input.slice(0, end); - }, - }; -} -/** - * @__NO_SIDE_EFFECTS__ - */ -function normalize(fn) { - afn(fn); - return { encode: (from) => from, decode: (to) => fn(to) }; -} -/** - * Slow: O(n^2) time complexity - */ -function convertRadix(data, from, to) { - // base 1 is impossible - if (from < 2) - throw new Error(`convertRadix: invalid from=${from}, base cannot be less than 2`); - if (to < 2) - throw new Error(`convertRadix: invalid to=${to}, base cannot be less than 2`); - aArr(data); - if (!data.length) - return []; - let pos = 0; - const res = []; - const digits = Array.from(data, (d) => { - anumber(d); - if (d < 0 || d >= from) - throw new Error(`invalid integer: ${d}`); - return d; - }); - const dlen = digits.length; - while (true) { - let carry = 0; - let done = true; - for (let i = pos; i < dlen; i++) { - const digit = digits[i]; - const fromCarry = from * carry; - const digitBase = fromCarry + digit; - if (!Number.isSafeInteger(digitBase) || - fromCarry / from !== carry || - digitBase - digit !== fromCarry) { - throw new Error('convertRadix: carry overflow'); - } - const div = digitBase / to; - carry = digitBase % to; - const rounded = Math.floor(div); - digits[i] = rounded; - if (!Number.isSafeInteger(rounded) || rounded * to + carry !== digitBase) - throw new Error('convertRadix: carry overflow'); - if (!done) - continue; - else if (!rounded) - pos = i; - else - done = false; - } - res.push(carry); - if (done) - break; - } - for (let i = 0; i < data.length - 1 && data[i] === 0; i++) - res.push(0); - return res.reverse(); -} -const gcd = (a, b) => (b === 0 ? a : gcd(b, a % b)); -const radix2carry = /* @__NO_SIDE_EFFECTS__ */ (from, to) => from + (to - gcd(from, to)); -const powers = /* @__PURE__ */ (() => { - let res = []; - for (let i = 0; i < 40; i++) - res.push(2 ** i); - return res; -})(); -/** - * Implemented with numbers, because BigInt is 5x slower - */ -function convertRadix2(data, from, to, padding) { - aArr(data); - if (from <= 0 || from > 32) - throw new Error(`convertRadix2: wrong from=${from}`); - if (to <= 0 || to > 32) - throw new Error(`convertRadix2: wrong to=${to}`); - if (radix2carry(from, to) > 32) { - throw new Error(`convertRadix2: carry overflow from=${from} to=${to} carryBits=${radix2carry(from, to)}`); - } - let carry = 0; - let pos = 0; // bitwise position in current element - const max = powers[from]; - const mask = powers[to] - 1; - const res = []; - for (const n of data) { - anumber(n); - if (n >= max) - throw new Error(`convertRadix2: invalid data word=${n} from=${from}`); - carry = (carry << from) | n; - if (pos + from > 32) - throw new Error(`convertRadix2: carry overflow pos=${pos} from=${from}`); - pos += from; - for (; pos >= to; pos -= to) - res.push(((carry >> (pos - to)) & mask) >>> 0); - const pow = powers[pos]; - if (pow === undefined) - throw new Error('invalid carry'); - carry &= pow - 1; // clean carry, otherwise it will cause overflow - } - carry = (carry << (to - pos)) & mask; - if (!padding && pos >= from) - throw new Error('Excess padding'); - if (!padding && carry > 0) - throw new Error(`Non-zero padding: ${carry}`); - if (padding && pos > 0) - res.push(carry >>> 0); - return res; -} -/** - * @__NO_SIDE_EFFECTS__ - */ -function radix(num) { - anumber(num); - const _256 = 2 ** 8; - return { - encode: (bytes) => { - if (!isBytes(bytes)) - throw new Error('radix.encode input should be Uint8Array'); - return convertRadix(Array.from(bytes), _256, num); - }, - decode: (digits) => { - anumArr('radix.decode', digits); - return Uint8Array.from(convertRadix(digits, num, _256)); - }, - }; -} -/** - * If both bases are power of same number (like `2**8 <-> 2**64`), - * there is a linear algorithm. For now we have implementation for power-of-two bases only. - * @__NO_SIDE_EFFECTS__ - */ -function radix2(bits, revPadding = false) { - anumber(bits); - if (bits <= 0 || bits > 32) - throw new Error('radix2: bits should be in (0..32]'); - if (radix2carry(8, bits) > 32 || radix2carry(bits, 8) > 32) - throw new Error('radix2: carry overflow'); - return { - encode: (bytes) => { - if (!isBytes(bytes)) - throw new Error('radix2.encode input should be Uint8Array'); - return convertRadix2(Array.from(bytes), 8, bits, !revPadding); - }, - decode: (digits) => { - anumArr('radix2.decode', digits); - return Uint8Array.from(convertRadix2(digits, bits, 8, revPadding)); - }, - }; -} -function unsafeWrapper(fn) { - afn(fn); - return function (...args) { - try { - return fn.apply(null, args); - } - catch (e) { } - }; -} -function checksum(len, fn) { - anumber(len); - afn(fn); - return { - encode(data) { - if (!isBytes(data)) - throw new Error('checksum.encode: input should be Uint8Array'); - const sum = fn(data).slice(0, len); - const res = new Uint8Array(data.length + len); - res.set(data); - res.set(sum, data.length); - return res; - }, - decode(data) { - if (!isBytes(data)) - throw new Error('checksum.decode: input should be Uint8Array'); - const payload = data.slice(0, -len); - const oldChecksum = data.slice(-len); - const newChecksum = fn(payload).slice(0, len); - for (let i = 0; i < len; i++) - if (newChecksum[i] !== oldChecksum[i]) - throw new Error('Invalid checksum'); - return payload; - }, - }; -} -// prettier-ignore -export const utils = { - alphabet, chain, checksum, convertRadix, convertRadix2, radix, radix2, join, padding, -}; -// RFC 4648 aka RFC 3548 -// --------------------- -/** - * base16 encoding from RFC 4648. - * @example - * ```js - * base16.encode(Uint8Array.from([0x12, 0xab])); - * // => '12AB' - * ``` - */ -export const base16 = chain(radix2(4), alphabet('0123456789ABCDEF'), join('')); -/** - * base32 encoding from RFC 4648. Has padding. - * Use `base32nopad` for unpadded version. - * Also check out `base32hex`, `base32hexnopad`, `base32crockford`. - * @example - * ```js - * base32.encode(Uint8Array.from([0x12, 0xab])); - * // => 'CKVQ====' - * base32.decode('CKVQ===='); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export const base32 = chain(radix2(5), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'), padding(5), join('')); -/** - * base32 encoding from RFC 4648. No padding. - * Use `base32` for padded version. - * Also check out `base32hex`, `base32hexnopad`, `base32crockford`. - * @example - * ```js - * base32nopad.encode(Uint8Array.from([0x12, 0xab])); - * // => 'CKVQ' - * base32nopad.decode('CKVQ'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export const base32nopad = chain(radix2(5), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'), join('')); -/** - * base32 encoding from RFC 4648. Padded. Compared to ordinary `base32`, slightly different alphabet. - * Use `base32hexnopad` for unpadded version. - * @example - * ```js - * base32hex.encode(Uint8Array.from([0x12, 0xab])); - * // => '2ALG====' - * base32hex.decode('2ALG===='); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export const base32hex = chain(radix2(5), alphabet('0123456789ABCDEFGHIJKLMNOPQRSTUV'), padding(5), join('')); -/** - * base32 encoding from RFC 4648. No padding. Compared to ordinary `base32`, slightly different alphabet. - * Use `base32hex` for padded version. - * @example - * ```js - * base32hexnopad.encode(Uint8Array.from([0x12, 0xab])); - * // => '2ALG' - * base32hexnopad.decode('2ALG'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export const base32hexnopad = chain(radix2(5), alphabet('0123456789ABCDEFGHIJKLMNOPQRSTUV'), join('')); -/** - * base32 encoding from RFC 4648. Doug Crockford's version. - * https://www.crockford.com/base32.html - * @example - * ```js - * base32crockford.encode(Uint8Array.from([0x12, 0xab])); - * // => '2ANG' - * base32crockford.decode('2ANG'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export const base32crockford = chain(radix2(5), alphabet('0123456789ABCDEFGHJKMNPQRSTVWXYZ'), join(''), normalize((s) => s.toUpperCase().replace(/O/g, '0').replace(/[IL]/g, '1'))); -// Built-in base64 conversion https://caniuse.com/mdn-javascript_builtins_uint8array_frombase64 -// prettier-ignore -const hasBase64Builtin = /* @__PURE__ */ (() => typeof Uint8Array.from([]).toBase64 === 'function' && - typeof Uint8Array.fromBase64 === 'function')(); -const decodeBase64Builtin = (s, isUrl) => { - astr('base64', s); - const re = isUrl ? /^[A-Za-z0-9=_-]+$/ : /^[A-Za-z0-9=+/]+$/; - const alphabet = isUrl ? 'base64url' : 'base64'; - if (s.length > 0 && !re.test(s)) - throw new Error('invalid base64'); - return Uint8Array.fromBase64(s, { alphabet, lastChunkHandling: 'strict' }); -}; -/** - * base64 from RFC 4648. Padded. - * Use `base64nopad` for unpadded version. - * Also check out `base64url`, `base64urlnopad`. - * Falls back to built-in function, when available. - * @example - * ```js - * base64.encode(Uint8Array.from([0x12, 0xab])); - * // => 'Eqs=' - * base64.decode('Eqs='); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -// prettier-ignore -export const base64 = hasBase64Builtin ? { - encode(b) { abytes(b); return b.toBase64(); }, - decode(s) { return decodeBase64Builtin(s, false); }, -} : chain(radix2(6), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'), padding(6), join('')); -/** - * base64 from RFC 4648. No padding. - * Use `base64` for padded version. - * @example - * ```js - * base64nopad.encode(Uint8Array.from([0x12, 0xab])); - * // => 'Eqs' - * base64nopad.decode('Eqs'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export const base64nopad = chain(radix2(6), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'), join('')); -/** - * base64 from RFC 4648, using URL-safe alphabet. Padded. - * Use `base64urlnopad` for unpadded version. - * Falls back to built-in function, when available. - * @example - * ```js - * base64url.encode(Uint8Array.from([0x12, 0xab])); - * // => 'Eqs=' - * base64url.decode('Eqs='); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -// prettier-ignore -export const base64url = hasBase64Builtin ? { - encode(b) { abytes(b); return b.toBase64({ alphabet: 'base64url' }); }, - decode(s) { return decodeBase64Builtin(s, true); }, -} : chain(radix2(6), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'), padding(6), join('')); -/** - * base64 from RFC 4648, using URL-safe alphabet. No padding. - * Use `base64url` for padded version. - * @example - * ```js - * base64urlnopad.encode(Uint8Array.from([0x12, 0xab])); - * // => 'Eqs' - * base64urlnopad.decode('Eqs'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export const base64urlnopad = chain(radix2(6), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'), join('')); -// base58 code -// ----------- -const genBase58 = /* @__NO_SIDE_EFFECTS__ */ (abc) => chain(radix(58), alphabet(abc), join('')); -/** - * base58: base64 without ambigous characters +, /, 0, O, I, l. - * Quadratic (O(n^2)) - so, can't be used on large inputs. - * @example - * ```js - * base58.decode('01abcdef'); - * // => '3UhJW' - * ``` - */ -export const base58 = genBase58('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'); -/** - * base58: flickr version. Check out `base58`. - */ -export const base58flickr = genBase58('123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'); -/** - * base58: XRP version. Check out `base58`. - */ -export const base58xrp = genBase58('rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz'); -// Data len (index) -> encoded block len -const XMR_BLOCK_LEN = [0, 2, 3, 5, 6, 7, 9, 10, 11]; -/** - * base58: XMR version. Check out `base58`. - * Done in 8-byte blocks (which equals 11 chars in decoding). Last (non-full) block padded with '1' to size in XMR_BLOCK_LEN. - * Block encoding significantly reduces quadratic complexity of base58. - */ -export const base58xmr = { - encode(data) { - let res = ''; - for (let i = 0; i < data.length; i += 8) { - const block = data.subarray(i, i + 8); - res += base58.encode(block).padStart(XMR_BLOCK_LEN[block.length], '1'); - } - return res; - }, - decode(str) { - let res = []; - for (let i = 0; i < str.length; i += 11) { - const slice = str.slice(i, i + 11); - const blockLen = XMR_BLOCK_LEN.indexOf(slice.length); - const block = base58.decode(slice); - for (let j = 0; j < block.length - blockLen; j++) { - if (block[j] !== 0) - throw new Error('base58xmr: wrong padding'); - } - res = res.concat(Array.from(block.slice(block.length - blockLen))); - } - return Uint8Array.from(res); - }, -}; -/** - * Method, which creates base58check encoder. - * Requires function, calculating sha256. - */ -export const createBase58check = (sha256) => chain(checksum(4, (data) => sha256(sha256(data))), base58); -/** - * Use `createBase58check` instead. - * @deprecated - */ -export const base58check = createBase58check; -const BECH_ALPHABET = chain(alphabet('qpzry9x8gf2tvdw0s3jn54khce6mua7l'), join('')); -const POLYMOD_GENERATORS = [0x3b6a57b2, 0x26508e6d, 0x1ea119fa, 0x3d4233dd, 0x2a1462b3]; -function bech32Polymod(pre) { - const b = pre >> 25; - let chk = (pre & 0x1ffffff) << 5; - for (let i = 0; i < POLYMOD_GENERATORS.length; i++) { - if (((b >> i) & 1) === 1) - chk ^= POLYMOD_GENERATORS[i]; - } - return chk; -} -function bechChecksum(prefix, words, encodingConst = 1) { - const len = prefix.length; - let chk = 1; - for (let i = 0; i < len; i++) { - const c = prefix.charCodeAt(i); - if (c < 33 || c > 126) - throw new Error(`Invalid prefix (${prefix})`); - chk = bech32Polymod(chk) ^ (c >> 5); - } - chk = bech32Polymod(chk); - for (let i = 0; i < len; i++) - chk = bech32Polymod(chk) ^ (prefix.charCodeAt(i) & 0x1f); - for (let v of words) - chk = bech32Polymod(chk) ^ v; - for (let i = 0; i < 6; i++) - chk = bech32Polymod(chk); - chk ^= encodingConst; - return BECH_ALPHABET.encode(convertRadix2([chk % powers[30]], 30, 5, false)); -} -/** - * @__NO_SIDE_EFFECTS__ - */ -function genBech32(encoding) { - const ENCODING_CONST = encoding === 'bech32' ? 1 : 0x2bc830a3; - const _words = radix2(5); - const fromWords = _words.decode; - const toWords = _words.encode; - const fromWordsUnsafe = unsafeWrapper(fromWords); - function encode(prefix, words, limit = 90) { - astr('bech32.encode prefix', prefix); - if (isBytes(words)) - words = Array.from(words); - anumArr('bech32.encode', words); - const plen = prefix.length; - if (plen === 0) - throw new TypeError(`Invalid prefix length ${plen}`); - const actualLength = plen + 7 + words.length; - if (limit !== false && actualLength > limit) - throw new TypeError(`Length ${actualLength} exceeds limit ${limit}`); - const lowered = prefix.toLowerCase(); - const sum = bechChecksum(lowered, words, ENCODING_CONST); - return `${lowered}1${BECH_ALPHABET.encode(words)}${sum}`; - } - function decode(str, limit = 90) { - astr('bech32.decode input', str); - const slen = str.length; - if (slen < 8 || (limit !== false && slen > limit)) - throw new TypeError(`invalid string length: ${slen} (${str}). Expected (8..${limit})`); - // don't allow mixed case - const lowered = str.toLowerCase(); - if (str !== lowered && str !== str.toUpperCase()) - throw new Error(`String must be lowercase or uppercase`); - const sepIndex = lowered.lastIndexOf('1'); - if (sepIndex === 0 || sepIndex === -1) - throw new Error(`Letter "1" must be present between prefix and data only`); - const prefix = lowered.slice(0, sepIndex); - const data = lowered.slice(sepIndex + 1); - if (data.length < 6) - throw new Error('Data must be at least 6 characters long'); - const words = BECH_ALPHABET.decode(data).slice(0, -6); - const sum = bechChecksum(prefix, words, ENCODING_CONST); - if (!data.endsWith(sum)) - throw new Error(`Invalid checksum in ${str}: expected "${sum}"`); - return { prefix, words }; - } - const decodeUnsafe = unsafeWrapper(decode); - function decodeToBytes(str) { - const { prefix, words } = decode(str, false); - return { prefix, words, bytes: fromWords(words) }; - } - function encodeFromBytes(prefix, bytes) { - return encode(prefix, toWords(bytes)); - } - return { - encode, - decode, - encodeFromBytes, - decodeToBytes, - decodeUnsafe, - fromWords, - fromWordsUnsafe, - toWords, - }; -} -/** - * bech32 from BIP 173. Operates on words. - * For high-level, check out scure-btc-signer: - * https://github.com/paulmillr/scure-btc-signer. - */ -export const bech32 = genBech32('bech32'); -/** - * bech32m from BIP 350. Operates on words. - * It was to mitigate `bech32` weaknesses. - * For high-level, check out scure-btc-signer: - * https://github.com/paulmillr/scure-btc-signer. - */ -export const bech32m = genBech32('bech32m'); -/** - * UTF-8-to-byte decoder. Uses built-in TextDecoder / TextEncoder. - * @example - * ```js - * const b = utf8.decode("hey"); // => new Uint8Array([ 104, 101, 121 ]) - * const str = utf8.encode(b); // "hey" - * ``` - */ -export const utf8 = { - encode: (data) => new TextDecoder().decode(data), - decode: (str) => new TextEncoder().encode(str), -}; -// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex -// prettier-ignore -const hasHexBuiltin = /* @__PURE__ */ (() => typeof Uint8Array.from([]).toHex === 'function' && - typeof Uint8Array.fromHex === 'function')(); -// prettier-ignore -const hexBuiltin = { - encode(data) { abytes(data); return data.toHex(); }, - decode(s) { astr('hex', s); return Uint8Array.fromHex(s); }, -}; -/** - * hex string decoder. Uses built-in function, when available. - * @example - * ```js - * const b = hex.decode("0102ff"); // => new Uint8Array([ 1, 2, 255 ]) - * const str = hex.encode(b); // "0102ff" - * ``` - */ -export const hex = hasHexBuiltin - ? hexBuiltin - : chain(radix2(4), alphabet('0123456789abcdef'), join(''), normalize((s) => { - if (typeof s !== 'string' || s.length % 2 !== 0) - throw new TypeError(`hex.decode: expected string, got ${typeof s} with length ${s.length}`); - return s.toLowerCase(); - })); -// prettier-ignore -const CODERS = { - utf8, hex, base16, base32, base64, base64url, base58, base58xmr -}; -const coderTypeError = 'Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr'; -/** @deprecated */ -export const bytesToString = (type, bytes) => { - if (typeof type !== 'string' || !CODERS.hasOwnProperty(type)) - throw new TypeError(coderTypeError); - if (!isBytes(bytes)) - throw new TypeError('bytesToString() expects Uint8Array'); - return CODERS[type].encode(bytes); -}; -/** @deprecated */ -export const str = bytesToString; // as in python, but for bytes only -/** @deprecated */ -export const stringToBytes = (type, str) => { - if (!CODERS.hasOwnProperty(type)) - throw new TypeError(coderTypeError); - if (typeof str !== 'string') - throw new TypeError('stringToBytes() expects string'); - return CODERS[type].decode(str); -}; -/** @deprecated */ -export const bytes = stringToBytes; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/lib/esm/index.js.map b/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/lib/esm/index.js.map deleted file mode 100644 index f7ffba94..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/lib/esm/index.js.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S;CAChE,CAAC;AAEF,MAAM,cAAc,GAClB,yGAAyG,CAAC;AAE5G,kBAAkB;AAClB,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAAe,EAAE,KAAiB,EAAU,EAAE;IAC1E,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,cAAc,CAAC,CAAC;IAClG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,oCAAoC,CAAC,CAAC;IAC/E,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACpC,CAAC,CAAC;AAEF,kBAAkB;AAClB,MAAM,CAAC,MAAM,GAAG,GAAmD,aAAa,CAAC,CAAC,mCAAmC;AAErH,kBAAkB;AAClB,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAAe,EAAE,GAAW,EAAc,EAAE;IACxE,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,cAAc,CAAC,CAAC;IACtE,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,MAAM,IAAI,SAAS,CAAC,gCAAgC,CAAC,CAAC;IACnF,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAClC,CAAC,CAAC;AACF,kBAAkB;AAClB,MAAM,CAAC,MAAM,KAAK,GAAiD,aAAa,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/lib/esm/package.json b/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/lib/esm/package.json deleted file mode 100644 index 87696418..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/lib/esm/package.json +++ /dev/null @@ -1 +0,0 @@ -{ "type": "module", "sideEffects": false } diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/lib/index.d.ts b/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/lib/index.d.ts deleted file mode 100644 index dde46dd3..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/lib/index.d.ts +++ /dev/null @@ -1,294 +0,0 @@ -/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -export interface Coder { - encode(from: F): T; - decode(to: T): F; -} -export interface BytesCoder extends Coder { - encode: (data: Uint8Array) => string; - decode: (str: string) => Uint8Array; -} -type Chain = [Coder, ...Coder[]]; -type Input = F extends Coder ? T : never; -type Output = F extends Coder ? T : never; -type First = T extends [infer U, ...any[]] ? U : never; -type Last = T extends [...any[], infer U] ? U : never; -type Tail = T extends [any, ...infer U] ? U : never; -type AsChain> = { - [K in keyof C]: Coder, Input>; -}; -/** - * @__NO_SIDE_EFFECTS__ - */ -declare function chain>(...args: T): Coder>, Output>>; -/** - * Encodes integer radix representation to array of strings using alphabet and back. - * Could also be array of strings. - * @__NO_SIDE_EFFECTS__ - */ -declare function alphabet(letters: string | string[]): Coder; -/** - * @__NO_SIDE_EFFECTS__ - */ -declare function join(separator?: string): Coder; -/** - * Pad strings array so it has integer number of bits - * @__NO_SIDE_EFFECTS__ - */ -declare function padding(bits: number, chr?: string): Coder; -/** - * Slow: O(n^2) time complexity - */ -declare function convertRadix(data: number[], from: number, to: number): number[]; -/** - * Implemented with numbers, because BigInt is 5x slower - */ -declare function convertRadix2(data: number[], from: number, to: number, padding: boolean): number[]; -/** - * @__NO_SIDE_EFFECTS__ - */ -declare function radix(num: number): Coder; -/** - * If both bases are power of same number (like `2**8 <-> 2**64`), - * there is a linear algorithm. For now we have implementation for power-of-two bases only. - * @__NO_SIDE_EFFECTS__ - */ -declare function radix2(bits: number, revPadding?: boolean): Coder; -declare function checksum(len: number, fn: (data: Uint8Array) => Uint8Array): Coder; -export declare const utils: { - alphabet: typeof alphabet; - chain: typeof chain; - checksum: typeof checksum; - convertRadix: typeof convertRadix; - convertRadix2: typeof convertRadix2; - radix: typeof radix; - radix2: typeof radix2; - join: typeof join; - padding: typeof padding; -}; -/** - * base16 encoding from RFC 4648. - * @example - * ```js - * base16.encode(Uint8Array.from([0x12, 0xab])); - * // => '12AB' - * ``` - */ -export declare const base16: BytesCoder; -/** - * base32 encoding from RFC 4648. Has padding. - * Use `base32nopad` for unpadded version. - * Also check out `base32hex`, `base32hexnopad`, `base32crockford`. - * @example - * ```js - * base32.encode(Uint8Array.from([0x12, 0xab])); - * // => 'CKVQ====' - * base32.decode('CKVQ===='); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export declare const base32: BytesCoder; -/** - * base32 encoding from RFC 4648. No padding. - * Use `base32` for padded version. - * Also check out `base32hex`, `base32hexnopad`, `base32crockford`. - * @example - * ```js - * base32nopad.encode(Uint8Array.from([0x12, 0xab])); - * // => 'CKVQ' - * base32nopad.decode('CKVQ'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export declare const base32nopad: BytesCoder; -/** - * base32 encoding from RFC 4648. Padded. Compared to ordinary `base32`, slightly different alphabet. - * Use `base32hexnopad` for unpadded version. - * @example - * ```js - * base32hex.encode(Uint8Array.from([0x12, 0xab])); - * // => '2ALG====' - * base32hex.decode('2ALG===='); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export declare const base32hex: BytesCoder; -/** - * base32 encoding from RFC 4648. No padding. Compared to ordinary `base32`, slightly different alphabet. - * Use `base32hex` for padded version. - * @example - * ```js - * base32hexnopad.encode(Uint8Array.from([0x12, 0xab])); - * // => '2ALG' - * base32hexnopad.decode('2ALG'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export declare const base32hexnopad: BytesCoder; -/** - * base32 encoding from RFC 4648. Doug Crockford's version. - * https://www.crockford.com/base32.html - * @example - * ```js - * base32crockford.encode(Uint8Array.from([0x12, 0xab])); - * // => '2ANG' - * base32crockford.decode('2ANG'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export declare const base32crockford: BytesCoder; -/** - * base64 from RFC 4648. Padded. - * Use `base64nopad` for unpadded version. - * Also check out `base64url`, `base64urlnopad`. - * Falls back to built-in function, when available. - * @example - * ```js - * base64.encode(Uint8Array.from([0x12, 0xab])); - * // => 'Eqs=' - * base64.decode('Eqs='); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export declare const base64: BytesCoder; -/** - * base64 from RFC 4648. No padding. - * Use `base64` for padded version. - * @example - * ```js - * base64nopad.encode(Uint8Array.from([0x12, 0xab])); - * // => 'Eqs' - * base64nopad.decode('Eqs'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export declare const base64nopad: BytesCoder; -/** - * base64 from RFC 4648, using URL-safe alphabet. Padded. - * Use `base64urlnopad` for unpadded version. - * Falls back to built-in function, when available. - * @example - * ```js - * base64url.encode(Uint8Array.from([0x12, 0xab])); - * // => 'Eqs=' - * base64url.decode('Eqs='); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export declare const base64url: BytesCoder; -/** - * base64 from RFC 4648, using URL-safe alphabet. No padding. - * Use `base64url` for padded version. - * @example - * ```js - * base64urlnopad.encode(Uint8Array.from([0x12, 0xab])); - * // => 'Eqs' - * base64urlnopad.decode('Eqs'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -export declare const base64urlnopad: BytesCoder; -/** - * base58: base64 without ambigous characters +, /, 0, O, I, l. - * Quadratic (O(n^2)) - so, can't be used on large inputs. - * @example - * ```js - * base58.decode('01abcdef'); - * // => '3UhJW' - * ``` - */ -export declare const base58: BytesCoder; -/** - * base58: flickr version. Check out `base58`. - */ -export declare const base58flickr: BytesCoder; -/** - * base58: XRP version. Check out `base58`. - */ -export declare const base58xrp: BytesCoder; -/** - * base58: XMR version. Check out `base58`. - * Done in 8-byte blocks (which equals 11 chars in decoding). Last (non-full) block padded with '1' to size in XMR_BLOCK_LEN. - * Block encoding significantly reduces quadratic complexity of base58. - */ -export declare const base58xmr: BytesCoder; -/** - * Method, which creates base58check encoder. - * Requires function, calculating sha256. - */ -export declare const createBase58check: (sha256: (data: Uint8Array) => Uint8Array) => BytesCoder; -/** - * Use `createBase58check` instead. - * @deprecated - */ -export declare const base58check: (sha256: (data: Uint8Array) => Uint8Array) => BytesCoder; -export interface Bech32Decoded { - prefix: Prefix; - words: number[]; -} -export interface Bech32DecodedWithArray { - prefix: Prefix; - words: number[]; - bytes: Uint8Array; -} -export interface Bech32 { - encode(prefix: Prefix, words: number[] | Uint8Array, limit?: number | false): `${Lowercase}1${string}`; - decode(str: `${Prefix}1${string}`, limit?: number | false): Bech32Decoded; - encodeFromBytes(prefix: string, bytes: Uint8Array): string; - decodeToBytes(str: string): Bech32DecodedWithArray; - decodeUnsafe(str: string, limit?: number | false): void | Bech32Decoded; - fromWords(to: number[]): Uint8Array; - fromWordsUnsafe(to: number[]): void | Uint8Array; - toWords(from: Uint8Array): number[]; -} -/** - * bech32 from BIP 173. Operates on words. - * For high-level, check out scure-btc-signer: - * https://github.com/paulmillr/scure-btc-signer. - */ -export declare const bech32: Bech32; -/** - * bech32m from BIP 350. Operates on words. - * It was to mitigate `bech32` weaknesses. - * For high-level, check out scure-btc-signer: - * https://github.com/paulmillr/scure-btc-signer. - */ -export declare const bech32m: Bech32; -/** - * UTF-8-to-byte decoder. Uses built-in TextDecoder / TextEncoder. - * @example - * ```js - * const b = utf8.decode("hey"); // => new Uint8Array([ 104, 101, 121 ]) - * const str = utf8.encode(b); // "hey" - * ``` - */ -export declare const utf8: BytesCoder; -/** - * hex string decoder. Uses built-in function, when available. - * @example - * ```js - * const b = hex.decode("0102ff"); // => new Uint8Array([ 1, 2, 255 ]) - * const str = hex.encode(b); // "0102ff" - * ``` - */ -export declare const hex: BytesCoder; -export type SomeCoders = { - utf8: BytesCoder; - hex: BytesCoder; - base16: BytesCoder; - base32: BytesCoder; - base64: BytesCoder; - base64url: BytesCoder; - base58: BytesCoder; - base58xmr: BytesCoder; -}; -type CoderType = keyof SomeCoders; -/** @deprecated */ -export declare const bytesToString: (type: CoderType, bytes: Uint8Array) => string; -/** @deprecated */ -export declare const str: (type: CoderType, bytes: Uint8Array) => string; -/** @deprecated */ -export declare const stringToBytes: (type: CoderType, str: string) => Uint8Array; -/** @deprecated */ -export declare const bytes: (type: CoderType, str: string) => Uint8Array; -export {}; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/lib/index.d.ts.map b/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/lib/index.d.ts.map deleted file mode 100644 index b42496fe..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/lib/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,oEAAoE;AAEpE,MAAM,WAAW,KAAK,CAAC,CAAC,EAAE,CAAC;IACzB,MAAM,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC;IACnB,MAAM,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC;CAClB;AAED,MAAM,WAAW,UAAW,SAAQ,KAAK,CAAC,UAAU,EAAE,MAAM,CAAC;IAC3D,MAAM,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,MAAM,CAAC;IACrC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,UAAU,CAAC;CACrC;AAkDD,KAAK,KAAK,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;AAErD,KAAK,KAAK,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAC1D,KAAK,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,K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U,GAAG;IACvB,IAAI,EAAE,UAAU,CAAC;IACjB,GAAG,EAAE,UAAU,CAAC;IAChB,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,EAAE,UAAU,CAAC;IACnB,SAAS,EAAE,UAAU,CAAC;IACtB,MAAM,EAAE,UAAU,CAAC;IACnB,SAAS,EAAE,UAAU,CAAC;CACvB,CAAC;AAKF,KAAK,SAAS,GAAG,MAAM,UAAU,CAAC;AAIlC,kBAAkB;AAClB,eAAO,MAAM,aAAa,GAAI,MAAM,SAAS,EAAE,OAAO,UAAU,KAAG,MAIlE,CAAC;AAEF,kBAAkB;AAClB,eAAO,MAAM,GAAG,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,KAAK,MAAsB,CAAC;AAEjF,kBAAkB;AAClB,eAAO,MAAM,aAAa,GAAI,MAAM,SAAS,EAAE,KAAK,MAAM,KAAG,UAI5D,CAAC;AACF,kBAAkB;AAClB,eAAO,MAAM,KAAK,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,KAAK,UAA0B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/lib/index.js b/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/lib/index.js deleted file mode 100644 index 6fc68a6d..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/lib/index.js +++ /dev/null @@ -1,713 +0,0 @@ -"use strict"; -/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.bytes = exports.stringToBytes = exports.str = exports.bytesToString = exports.hex = exports.utf8 = exports.bech32m = exports.bech32 = exports.base58check = exports.createBase58check = exports.base58xmr = exports.base58xrp = exports.base58flickr = exports.base58 = exports.base64urlnopad = exports.base64url = exports.base64nopad = exports.base64 = exports.base32crockford = exports.base32hexnopad = exports.base32hex = exports.base32nopad = exports.base32 = exports.base16 = exports.utils = void 0; -function isBytes(a) { - return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array'); -} -/** Asserts something is Uint8Array. */ -function abytes(b, ...lengths) { - if (!isBytes(b)) - throw new Error('Uint8Array expected'); - if (lengths.length > 0 && !lengths.includes(b.length)) - throw new Error('Uint8Array expected of length ' + lengths + ', got length=' + b.length); -} -function isArrayOf(isString, arr) { - if (!Array.isArray(arr)) - return false; - if (arr.length === 0) - return true; - if (isString) { - return arr.every((item) => typeof item === 'string'); - } - else { - return arr.every((item) => Number.isSafeInteger(item)); - } -} -// no abytes: seems to have 10% slowdown. Why?! -function afn(input) { - if (typeof input !== 'function') - throw new Error('function expected'); - return true; -} -function astr(label, input) { - if (typeof input !== 'string') - throw new Error(`${label}: string expected`); - return true; -} -function anumber(n) { - if (!Number.isSafeInteger(n)) - throw new Error(`invalid integer: ${n}`); -} -function aArr(input) { - if (!Array.isArray(input)) - throw new Error('array expected'); -} -function astrArr(label, input) { - if (!isArrayOf(true, input)) - throw new Error(`${label}: array of strings expected`); -} -function anumArr(label, input) { - if (!isArrayOf(false, input)) - throw new Error(`${label}: array of numbers expected`); -} -/** - * @__NO_SIDE_EFFECTS__ - */ -function chain(...args) { - const id = (a) => a; - // Wrap call in closure so JIT can inline calls - const wrap = (a, b) => (c) => a(b(c)); - // Construct chain of args[-1].encode(args[-2].encode([...])) - const encode = args.map((x) => x.encode).reduceRight(wrap, id); - // Construct chain of args[0].decode(args[1].decode(...)) - const decode = args.map((x) => x.decode).reduce(wrap, id); - return { encode, decode }; -} -/** - * Encodes integer radix representation to array of strings using alphabet and back. - * Could also be array of strings. - * @__NO_SIDE_EFFECTS__ - */ -function alphabet(letters) { - // mapping 1 to "b" - const lettersA = typeof letters === 'string' ? letters.split('') : letters; - const len = lettersA.length; - astrArr('alphabet', lettersA); - // mapping "b" to 1 - const indexes = new Map(lettersA.map((l, i) => [l, i])); - return { - encode: (digits) => { - aArr(digits); - return digits.map((i) => { - if (!Number.isSafeInteger(i) || i < 0 || i >= len) - throw new Error(`alphabet.encode: digit index outside alphabet "${i}". Allowed: ${letters}`); - return lettersA[i]; - }); - }, - decode: (input) => { - aArr(input); - return input.map((letter) => { - astr('alphabet.decode', letter); - const i = indexes.get(letter); - if (i === undefined) - throw new Error(`Unknown letter: "${letter}". Allowed: ${letters}`); - return i; - }); - }, - }; -} -/** - * @__NO_SIDE_EFFECTS__ - */ -function join(separator = '') { - astr('join', separator); - return { - encode: (from) => { - astrArr('join.decode', from); - return from.join(separator); - }, - decode: (to) => { - astr('join.decode', to); - return to.split(separator); - }, - }; -} -/** - * Pad strings array so it has integer number of bits - * @__NO_SIDE_EFFECTS__ - */ -function padding(bits, chr = '=') { - anumber(bits); - astr('padding', chr); - return { - encode(data) { - astrArr('padding.encode', data); - while ((data.length * bits) % 8) - data.push(chr); - return data; - }, - decode(input) { - astrArr('padding.decode', input); - let end = input.length; - if ((end * bits) % 8) - throw new Error('padding: invalid, string should have whole number of bytes'); - for (; end > 0 && input[end - 1] === chr; end--) { - const last = end - 1; - const byte = last * bits; - if (byte % 8 === 0) - throw new Error('padding: invalid, string has too much padding'); - } - return input.slice(0, end); - }, - }; -} -/** - * @__NO_SIDE_EFFECTS__ - */ -function normalize(fn) { - afn(fn); - return { encode: (from) => from, decode: (to) => fn(to) }; -} -/** - * Slow: O(n^2) time complexity - */ -function convertRadix(data, from, to) { - // base 1 is impossible - if (from < 2) - throw new Error(`convertRadix: invalid from=${from}, base cannot be less than 2`); - if (to < 2) - throw new Error(`convertRadix: invalid to=${to}, base cannot be less than 2`); - aArr(data); - if (!data.length) - return []; - let pos = 0; - const res = []; - const digits = Array.from(data, (d) => { - anumber(d); - if (d < 0 || d >= from) - throw new Error(`invalid integer: ${d}`); - return d; - }); - const dlen = digits.length; - while (true) { - let carry = 0; - let done = true; - for (let i = pos; i < dlen; i++) { - const digit = digits[i]; - const fromCarry = from * carry; - const digitBase = fromCarry + digit; - if (!Number.isSafeInteger(digitBase) || - fromCarry / from !== carry || - digitBase - digit !== fromCarry) { - throw new Error('convertRadix: carry overflow'); - } - const div = digitBase / to; - carry = digitBase % to; - const rounded = Math.floor(div); - digits[i] = rounded; - if (!Number.isSafeInteger(rounded) || rounded * to + carry !== digitBase) - throw new Error('convertRadix: carry overflow'); - if (!done) - continue; - else if (!rounded) - pos = i; - else - done = false; - } - res.push(carry); - if (done) - break; - } - for (let i = 0; i < data.length - 1 && data[i] === 0; i++) - res.push(0); - return res.reverse(); -} -const gcd = (a, b) => (b === 0 ? a : gcd(b, a % b)); -const radix2carry = /* @__NO_SIDE_EFFECTS__ */ (from, to) => from + (to - gcd(from, to)); -const powers = /* @__PURE__ */ (() => { - let res = []; - for (let i = 0; i < 40; i++) - res.push(2 ** i); - return res; -})(); -/** - * Implemented with numbers, because BigInt is 5x slower - */ -function convertRadix2(data, from, to, padding) { - aArr(data); - if (from <= 0 || from > 32) - throw new Error(`convertRadix2: wrong from=${from}`); - if (to <= 0 || to > 32) - throw new Error(`convertRadix2: wrong to=${to}`); - if (radix2carry(from, to) > 32) { - throw new Error(`convertRadix2: carry overflow from=${from} to=${to} carryBits=${radix2carry(from, to)}`); - } - let carry = 0; - let pos = 0; // bitwise position in current element - const max = powers[from]; - const mask = powers[to] - 1; - const res = []; - for (const n of data) { - anumber(n); - if (n >= max) - throw new Error(`convertRadix2: invalid data word=${n} from=${from}`); - carry = (carry << from) | n; - if (pos + from > 32) - throw new Error(`convertRadix2: carry overflow pos=${pos} from=${from}`); - pos += from; - for (; pos >= to; pos -= to) - res.push(((carry >> (pos - to)) & mask) >>> 0); - const pow = powers[pos]; - if (pow === undefined) - throw new Error('invalid carry'); - carry &= pow - 1; // clean carry, otherwise it will cause overflow - } - carry = (carry << (to - pos)) & mask; - if (!padding && pos >= from) - throw new Error('Excess padding'); - if (!padding && carry > 0) - throw new Error(`Non-zero padding: ${carry}`); - if (padding && pos > 0) - res.push(carry >>> 0); - return res; -} -/** - * @__NO_SIDE_EFFECTS__ - */ -function radix(num) { - anumber(num); - const _256 = 2 ** 8; - return { - encode: (bytes) => { - if (!isBytes(bytes)) - throw new Error('radix.encode input should be Uint8Array'); - return convertRadix(Array.from(bytes), _256, num); - }, - decode: (digits) => { - anumArr('radix.decode', digits); - return Uint8Array.from(convertRadix(digits, num, _256)); - }, - }; -} -/** - * If both bases are power of same number (like `2**8 <-> 2**64`), - * there is a linear algorithm. For now we have implementation for power-of-two bases only. - * @__NO_SIDE_EFFECTS__ - */ -function radix2(bits, revPadding = false) { - anumber(bits); - if (bits <= 0 || bits > 32) - throw new Error('radix2: bits should be in (0..32]'); - if (radix2carry(8, bits) > 32 || radix2carry(bits, 8) > 32) - throw new Error('radix2: carry overflow'); - return { - encode: (bytes) => { - if (!isBytes(bytes)) - throw new Error('radix2.encode input should be Uint8Array'); - return convertRadix2(Array.from(bytes), 8, bits, !revPadding); - }, - decode: (digits) => { - anumArr('radix2.decode', digits); - return Uint8Array.from(convertRadix2(digits, bits, 8, revPadding)); - }, - }; -} -function unsafeWrapper(fn) { - afn(fn); - return function (...args) { - try { - return fn.apply(null, args); - } - catch (e) { } - }; -} -function checksum(len, fn) { - anumber(len); - afn(fn); - return { - encode(data) { - if (!isBytes(data)) - throw new Error('checksum.encode: input should be Uint8Array'); - const sum = fn(data).slice(0, len); - const res = new Uint8Array(data.length + len); - res.set(data); - res.set(sum, data.length); - return res; - }, - decode(data) { - if (!isBytes(data)) - throw new Error('checksum.decode: input should be Uint8Array'); - const payload = data.slice(0, -len); - const oldChecksum = data.slice(-len); - const newChecksum = fn(payload).slice(0, len); - for (let i = 0; i < len; i++) - if (newChecksum[i] !== oldChecksum[i]) - throw new Error('Invalid checksum'); - return payload; - }, - }; -} -// prettier-ignore -exports.utils = { - alphabet, chain, checksum, convertRadix, convertRadix2, radix, radix2, join, padding, -}; -// RFC 4648 aka RFC 3548 -// --------------------- -/** - * base16 encoding from RFC 4648. - * @example - * ```js - * base16.encode(Uint8Array.from([0x12, 0xab])); - * // => '12AB' - * ``` - */ -exports.base16 = chain(radix2(4), alphabet('0123456789ABCDEF'), join('')); -/** - * base32 encoding from RFC 4648. Has padding. - * Use `base32nopad` for unpadded version. - * Also check out `base32hex`, `base32hexnopad`, `base32crockford`. - * @example - * ```js - * base32.encode(Uint8Array.from([0x12, 0xab])); - * // => 'CKVQ====' - * base32.decode('CKVQ===='); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -exports.base32 = chain(radix2(5), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'), padding(5), join('')); -/** - * base32 encoding from RFC 4648. No padding. - * Use `base32` for padded version. - * Also check out `base32hex`, `base32hexnopad`, `base32crockford`. - * @example - * ```js - * base32nopad.encode(Uint8Array.from([0x12, 0xab])); - * // => 'CKVQ' - * base32nopad.decode('CKVQ'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -exports.base32nopad = chain(radix2(5), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'), join('')); -/** - * base32 encoding from RFC 4648. Padded. Compared to ordinary `base32`, slightly different alphabet. - * Use `base32hexnopad` for unpadded version. - * @example - * ```js - * base32hex.encode(Uint8Array.from([0x12, 0xab])); - * // => '2ALG====' - * base32hex.decode('2ALG===='); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -exports.base32hex = chain(radix2(5), alphabet('0123456789ABCDEFGHIJKLMNOPQRSTUV'), padding(5), join('')); -/** - * base32 encoding from RFC 4648. No padding. Compared to ordinary `base32`, slightly different alphabet. - * Use `base32hex` for padded version. - * @example - * ```js - * base32hexnopad.encode(Uint8Array.from([0x12, 0xab])); - * // => '2ALG' - * base32hexnopad.decode('2ALG'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -exports.base32hexnopad = chain(radix2(5), alphabet('0123456789ABCDEFGHIJKLMNOPQRSTUV'), join('')); -/** - * base32 encoding from RFC 4648. Doug Crockford's version. - * https://www.crockford.com/base32.html - * @example - * ```js - * base32crockford.encode(Uint8Array.from([0x12, 0xab])); - * // => '2ANG' - * base32crockford.decode('2ANG'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -exports.base32crockford = chain(radix2(5), alphabet('0123456789ABCDEFGHJKMNPQRSTVWXYZ'), join(''), normalize((s) => s.toUpperCase().replace(/O/g, '0').replace(/[IL]/g, '1'))); -// Built-in base64 conversion https://caniuse.com/mdn-javascript_builtins_uint8array_frombase64 -// prettier-ignore -const hasBase64Builtin = /* @__PURE__ */ (() => typeof Uint8Array.from([]).toBase64 === 'function' && - typeof Uint8Array.fromBase64 === 'function')(); -const decodeBase64Builtin = (s, isUrl) => { - astr('base64', s); - const re = isUrl ? /^[A-Za-z0-9=_-]+$/ : /^[A-Za-z0-9=+/]+$/; - const alphabet = isUrl ? 'base64url' : 'base64'; - if (s.length > 0 && !re.test(s)) - throw new Error('invalid base64'); - return Uint8Array.fromBase64(s, { alphabet, lastChunkHandling: 'strict' }); -}; -/** - * base64 from RFC 4648. Padded. - * Use `base64nopad` for unpadded version. - * Also check out `base64url`, `base64urlnopad`. - * Falls back to built-in function, when available. - * @example - * ```js - * base64.encode(Uint8Array.from([0x12, 0xab])); - * // => 'Eqs=' - * base64.decode('Eqs='); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -// prettier-ignore -exports.base64 = hasBase64Builtin ? { - encode(b) { abytes(b); return b.toBase64(); }, - decode(s) { return decodeBase64Builtin(s, false); }, -} : chain(radix2(6), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'), padding(6), join('')); -/** - * base64 from RFC 4648. No padding. - * Use `base64` for padded version. - * @example - * ```js - * base64nopad.encode(Uint8Array.from([0x12, 0xab])); - * // => 'Eqs' - * base64nopad.decode('Eqs'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -exports.base64nopad = chain(radix2(6), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'), join('')); -/** - * base64 from RFC 4648, using URL-safe alphabet. Padded. - * Use `base64urlnopad` for unpadded version. - * Falls back to built-in function, when available. - * @example - * ```js - * base64url.encode(Uint8Array.from([0x12, 0xab])); - * // => 'Eqs=' - * base64url.decode('Eqs='); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -// prettier-ignore -exports.base64url = hasBase64Builtin ? { - encode(b) { abytes(b); return b.toBase64({ alphabet: 'base64url' }); }, - decode(s) { return decodeBase64Builtin(s, true); }, -} : chain(radix2(6), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'), padding(6), join('')); -/** - * base64 from RFC 4648, using URL-safe alphabet. No padding. - * Use `base64url` for padded version. - * @example - * ```js - * base64urlnopad.encode(Uint8Array.from([0x12, 0xab])); - * // => 'Eqs' - * base64urlnopad.decode('Eqs'); - * // => Uint8Array.from([0x12, 0xab]) - * ``` - */ -exports.base64urlnopad = chain(radix2(6), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'), join('')); -// base58 code -// ----------- -const genBase58 = /* @__NO_SIDE_EFFECTS__ */ (abc) => chain(radix(58), alphabet(abc), join('')); -/** - * base58: base64 without ambigous characters +, /, 0, O, I, l. - * Quadratic (O(n^2)) - so, can't be used on large inputs. - * @example - * ```js - * base58.decode('01abcdef'); - * // => '3UhJW' - * ``` - */ -exports.base58 = genBase58('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'); -/** - * base58: flickr version. Check out `base58`. - */ -exports.base58flickr = genBase58('123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'); -/** - * base58: XRP version. Check out `base58`. - */ -exports.base58xrp = genBase58('rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz'); -// Data len (index) -> encoded block len -const XMR_BLOCK_LEN = [0, 2, 3, 5, 6, 7, 9, 10, 11]; -/** - * base58: XMR version. Check out `base58`. - * Done in 8-byte blocks (which equals 11 chars in decoding). Last (non-full) block padded with '1' to size in XMR_BLOCK_LEN. - * Block encoding significantly reduces quadratic complexity of base58. - */ -exports.base58xmr = { - encode(data) { - let res = ''; - for (let i = 0; i < data.length; i += 8) { - const block = data.subarray(i, i + 8); - res += exports.base58.encode(block).padStart(XMR_BLOCK_LEN[block.length], '1'); - } - return res; - }, - decode(str) { - let res = []; - for (let i = 0; i < str.length; i += 11) { - const slice = str.slice(i, i + 11); - const blockLen = XMR_BLOCK_LEN.indexOf(slice.length); - const block = exports.base58.decode(slice); - for (let j = 0; j < block.length - blockLen; j++) { - if (block[j] !== 0) - throw new Error('base58xmr: wrong padding'); - } - res = res.concat(Array.from(block.slice(block.length - blockLen))); - } - return Uint8Array.from(res); - }, -}; -/** - * Method, which creates base58check encoder. - * Requires function, calculating sha256. - */ -const createBase58check = (sha256) => chain(checksum(4, (data) => sha256(sha256(data))), exports.base58); -exports.createBase58check = createBase58check; -/** - * Use `createBase58check` instead. - * @deprecated - */ -exports.base58check = exports.createBase58check; -const BECH_ALPHABET = chain(alphabet('qpzry9x8gf2tvdw0s3jn54khce6mua7l'), join('')); -const POLYMOD_GENERATORS = [0x3b6a57b2, 0x26508e6d, 0x1ea119fa, 0x3d4233dd, 0x2a1462b3]; -function bech32Polymod(pre) { - const b = pre >> 25; - let chk = (pre & 0x1ffffff) << 5; - for (let i = 0; i < POLYMOD_GENERATORS.length; i++) { - if (((b >> i) & 1) === 1) - chk ^= POLYMOD_GENERATORS[i]; - } - return chk; -} -function bechChecksum(prefix, words, encodingConst = 1) { - const len = prefix.length; - let chk = 1; - for (let i = 0; i < len; i++) { - const c = prefix.charCodeAt(i); - if (c < 33 || c > 126) - throw new Error(`Invalid prefix (${prefix})`); - chk = bech32Polymod(chk) ^ (c >> 5); - } - chk = bech32Polymod(chk); - for (let i = 0; i < len; i++) - chk = bech32Polymod(chk) ^ (prefix.charCodeAt(i) & 0x1f); - for (let v of words) - chk = bech32Polymod(chk) ^ v; - for (let i = 0; i < 6; i++) - chk = bech32Polymod(chk); - chk ^= encodingConst; - return BECH_ALPHABET.encode(convertRadix2([chk % powers[30]], 30, 5, false)); -} -/** - * @__NO_SIDE_EFFECTS__ - */ -function genBech32(encoding) { - const ENCODING_CONST = encoding === 'bech32' ? 1 : 0x2bc830a3; - const _words = radix2(5); - const fromWords = _words.decode; - const toWords = _words.encode; - const fromWordsUnsafe = unsafeWrapper(fromWords); - function encode(prefix, words, limit = 90) { - astr('bech32.encode prefix', prefix); - if (isBytes(words)) - words = Array.from(words); - anumArr('bech32.encode', words); - const plen = prefix.length; - if (plen === 0) - throw new TypeError(`Invalid prefix length ${plen}`); - const actualLength = plen + 7 + words.length; - if (limit !== false && actualLength > limit) - throw new TypeError(`Length ${actualLength} exceeds limit ${limit}`); - const lowered = prefix.toLowerCase(); - const sum = bechChecksum(lowered, words, ENCODING_CONST); - return `${lowered}1${BECH_ALPHABET.encode(words)}${sum}`; - } - function decode(str, limit = 90) { - astr('bech32.decode input', str); - const slen = str.length; - if (slen < 8 || (limit !== false && slen > limit)) - throw new TypeError(`invalid string length: ${slen} (${str}). Expected (8..${limit})`); - // don't allow mixed case - const lowered = str.toLowerCase(); - if (str !== lowered && str !== str.toUpperCase()) - throw new Error(`String must be lowercase or uppercase`); - const sepIndex = lowered.lastIndexOf('1'); - if (sepIndex === 0 || sepIndex === -1) - throw new Error(`Letter "1" must be present between prefix and data only`); - const prefix = lowered.slice(0, sepIndex); - const data = lowered.slice(sepIndex + 1); - if (data.length < 6) - throw new Error('Data must be at least 6 characters long'); - const words = BECH_ALPHABET.decode(data).slice(0, -6); - const sum = bechChecksum(prefix, words, ENCODING_CONST); - if (!data.endsWith(sum)) - throw new Error(`Invalid checksum in ${str}: expected "${sum}"`); - return { prefix, words }; - } - const decodeUnsafe = unsafeWrapper(decode); - function decodeToBytes(str) { - const { prefix, words } = decode(str, false); - return { prefix, words, bytes: fromWords(words) }; - } - function encodeFromBytes(prefix, bytes) { - return encode(prefix, toWords(bytes)); - } - return { - encode, - decode, - encodeFromBytes, - decodeToBytes, - decodeUnsafe, - fromWords, - fromWordsUnsafe, - toWords, - }; -} -/** - * bech32 from BIP 173. Operates on words. - * For high-level, check out scure-btc-signer: - * https://github.com/paulmillr/scure-btc-signer. - */ -exports.bech32 = genBech32('bech32'); -/** - * bech32m from BIP 350. Operates on words. - * It was to mitigate `bech32` weaknesses. - * For high-level, check out scure-btc-signer: - * https://github.com/paulmillr/scure-btc-signer. - */ -exports.bech32m = genBech32('bech32m'); -/** - * UTF-8-to-byte decoder. Uses built-in TextDecoder / TextEncoder. - * @example - * ```js - * const b = utf8.decode("hey"); // => new Uint8Array([ 104, 101, 121 ]) - * const str = utf8.encode(b); // "hey" - * ``` - */ -exports.utf8 = { - encode: (data) => new TextDecoder().decode(data), - decode: (str) => new TextEncoder().encode(str), -}; -// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex -// prettier-ignore -const hasHexBuiltin = /* @__PURE__ */ (() => typeof Uint8Array.from([]).toHex === 'function' && - typeof Uint8Array.fromHex === 'function')(); -// prettier-ignore -const hexBuiltin = { - encode(data) { abytes(data); return data.toHex(); }, - decode(s) { astr('hex', s); return Uint8Array.fromHex(s); }, -}; -/** - * hex string decoder. Uses built-in function, when available. - * @example - * ```js - * const b = hex.decode("0102ff"); // => new Uint8Array([ 1, 2, 255 ]) - * const str = hex.encode(b); // "0102ff" - * ``` - */ -exports.hex = hasHexBuiltin - ? hexBuiltin - : chain(radix2(4), alphabet('0123456789abcdef'), join(''), normalize((s) => { - if (typeof s !== 'string' || s.length % 2 !== 0) - throw new TypeError(`hex.decode: expected string, got ${typeof s} with length ${s.length}`); - return s.toLowerCase(); - })); -// prettier-ignore -const CODERS = { - utf8: exports.utf8, hex: exports.hex, base16: exports.base16, base32: exports.base32, base64: exports.base64, base64url: exports.base64url, base58: exports.base58, base58xmr: exports.base58xmr -}; -const coderTypeError = 'Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr'; -/** @deprecated */ -const bytesToString = (type, bytes) => { - if (typeof type !== 'string' || !CODERS.hasOwnProperty(type)) - throw new TypeError(coderTypeError); - if (!isBytes(bytes)) - throw new TypeError('bytesToString() expects Uint8Array'); - return CODERS[type].encode(bytes); -}; -exports.bytesToString = bytesToString; -/** @deprecated */ -exports.str = exports.bytesToString; // as in python, but for bytes only -/** @deprecated */ -const stringToBytes = (type, str) => { - if (!CODERS.hasOwnProperty(type)) - throw new TypeError(coderTypeError); - if (typeof str !== 'string') - throw new TypeError('stringToBytes() expects string'); - return CODERS[type].decode(str); -}; -exports.stringToBytes = stringToBytes; -/** @deprecated */ -exports.bytes = exports.stringToBytes; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/lib/index.js.map b/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/lib/index.js.map deleted file mode 100644 index f15ad63c..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";AAAA,oEAAoE;;;AAYpE,SAAS,OAAO,CAAC,CAAU;IACzB,OAAO,CAAC,YAAY,UAAU,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC;AACnG,CAAC;AACD,uCAAuC;AACvC,SAAS,MAAM,CAAC,CAAyB,EAAE,GAAG,OAAiB;IAC7D,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;IACxD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,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AAc,CAAC,IAAI,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,cAAc,CAAC,CAAC;IACtE,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,MAAM,IAAI,SAAS,CAAC,gCAAgC,CAAC,CAAC;IACnF,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAClC,CAAC,CAAC;AAJW,QAAA,aAAa,iBAIxB;AACF,kBAAkB;AACL,QAAA,KAAK,GAAiD,qBAAa,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/package.json b/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/package.json deleted file mode 100644 index 6b95d621..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/node_modules/@scure/base/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "@scure/base", - "version": "1.2.6", - "description": "Secure, audited & 0-dep implementation of base64, bech32, base58, base32 & base16", - "files": [ - "lib/index.js", - "lib/index.js.map", - "lib/index.d.ts", - "lib/index.d.ts.map", - "lib/esm/index.js", - "lib/esm/index.js.map", - "lib/esm/index.d.ts", - "lib/esm/index.d.ts.map", - "lib/esm/package.json", - "index.ts" - ], - "main": "./lib/index.js", - "module": "./lib/esm/index.js", - "types": "./lib/index.d.ts", - "exports": { - ".": { - "import": "./lib/esm/index.js", - "require": "./lib/index.js" - } - }, - "scripts": { - "bench": "node test/benchmark/index.js", - "build": "tsc && tsc -p tsconfig.cjs.json", - "build:release": "npx jsbt esbuild test/build", - "lint": "prettier --check index.ts", - "format": "prettier --write index.ts", - "test": "node test/index.js", - "test:bun": "bun test/index.js", - "test:deno": "deno --allow-env --allow-read test/index.js && deno test/deno.ts" - }, - "sideEffects": false, - "author": "Paul Miller (https://paulmillr.com)", - "license": "MIT", - "homepage": "https://paulmillr.com/noble/#scure", - "repository": { - "type": "git", - "url": "git+https://github.com/paulmillr/scure-base.git" - }, - "devDependencies": { - "@noble/hashes": "1.8.0", - "@paulmillr/jsbt": "0.3.3", - "@types/node": "22.15.23", - "fast-check": "4.1.1", - "micro-bmark": "0.4.2", - "micro-should": "0.5.3", - "prettier": "3.5.3", - "typescript": "5.8.3" - }, - "keywords": [ - "bech32", - "bech32m", - "base64", - "base58", - "base32", - "base16", - "rfc4648", - "rfc3548", - "crockford", - "encode", - "encoder", - "base-x", - "base" - ], - "funding": "https://paulmillr.com/funding/" -} diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/package.json b/tools/mnemonic-test/node_modules/@scure/bip39/package.json deleted file mode 100644 index 270060d5..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/package.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "name": "@scure/bip39", - "version": "1.6.0", - "description": "Secure, audited & minimal implementation of BIP39 mnemonic phrases", - "files": [ - "index.js", - "index.d.ts", - "wordlists/*.js", - "wordlists/*.d.ts", - "esm", - "src/index.ts" - ], - "dependencies": { - "@noble/hashes": "~1.8.0", - "@scure/base": "~1.2.5" - }, - "devDependencies": { - "@paulmillr/jsbt": "0.3.3", - "micro-bmark": "0.4.1", - "micro-should": "0.5.2", - "prettier": "3.5.3", - "typescript": "5.8.3" - }, - "author": "Paul Miller (https://paulmillr.com)", - "homepage": "https://paulmillr.com/", - "repository": { - "type": "git", - "url": "git+https://github.com/paulmillr/scure-bip39.git" - }, - "license": "MIT", - "scripts": { - "build": "tsc && tsc -p tsconfig.cjs.json", - "build:release": "npx jsbt esbuild test/build", - "lint": "prettier --check 'src/**/*.ts' 'test/*.test.ts' 'scripts/*.js'", - "format": "prettier --write 'src/**/*.ts' 'test/*.test.ts' 'scripts/*.js'", - "test": "node test/index.js", - "test:bun": "bun test/index.js", - "test:deno": "deno --allow-env --allow-read test/index.js", - "fetch-wordlist": "./scripts/fetch-wordlist.js" - }, - "sideEffects": false, - "main": "index.js", - "types": "./index.d.ts", - "exports": { - ".": { - "import": "./esm/index.js", - "require": "./index.js" - }, - "./index": { - "import": "./esm/index.js", - "require": "./index.js" - }, - "./wordlists/czech": { - "import": "./esm/wordlists/czech.js", - "require": "./wordlists/czech.js" - }, - "./wordlists/english": { - "import": "./esm/wordlists/english.js", - "require": "./wordlists/english.js" - }, - "./wordlists/french": { - "import": "./esm/wordlists/french.js", - "require": "./wordlists/french.js" - }, - "./wordlists/italian": { - "import": "./esm/wordlists/italian.js", - "require": "./wordlists/italian.js" - }, - "./wordlists/japanese": { - "import": "./esm/wordlists/japanese.js", - "require": "./wordlists/japanese.js" - }, - "./wordlists/korean": { - "import": "./esm/wordlists/korean.js", - "require": "./wordlists/korean.js" - }, - "./wordlists/portuguese": { - "import": "./esm/wordlists/portuguese.js", - "require": "./wordlists/portuguese.js" - }, - "./wordlists/simplified-chinese": { - "import": "./esm/wordlists/simplified-chinese.js", - "require": "./wordlists/simplified-chinese.js" - }, - "./wordlists/spanish": { - "import": "./esm/wordlists/spanish.js", - "require": "./wordlists/spanish.js" - }, - "./wordlists/traditional-chinese": { - "import": "./esm/wordlists/traditional-chinese.js", - "require": "./wordlists/traditional-chinese.js" - } - }, - "keywords": [ - "bip39", - "mnemonic", - "phrase", - "code", - "bip0039", - "bip-39", - "wordlist", - "scure", - "noble" - ], - "funding": "https://paulmillr.com/funding/" -} diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/src/index.ts b/tools/mnemonic-test/node_modules/@scure/bip39/src/index.ts deleted file mode 100644 index 4284c3e6..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/src/index.ts +++ /dev/null @@ -1,174 +0,0 @@ -/** - * Audited & minimal JS implementation of - * [BIP39 mnemonic phrases](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki). - * @module - * @example -```js -import * as bip39 from '@scure/bip39'; -import { wordlist } from '@scure/bip39/wordlists/english'; -const mn = bip39.generateMnemonic(wordlist); -console.log(mn); -const ent = bip39.mnemonicToEntropy(mn, wordlist) -bip39.entropyToMnemonic(ent, wordlist); -bip39.validateMnemonic(mn, wordlist); -await bip39.mnemonicToSeed(mn, 'password'); -bip39.mnemonicToSeedSync(mn, 'password'); - -// Wordlists -import { wordlist as czech } from '@scure/bip39/wordlists/czech'; -import { wordlist as english } from '@scure/bip39/wordlists/english'; -import { wordlist as french } from '@scure/bip39/wordlists/french'; -import { wordlist as italian } from '@scure/bip39/wordlists/italian'; -import { wordlist as japanese } from '@scure/bip39/wordlists/japanese'; -import { wordlist as korean } from '@scure/bip39/wordlists/korean'; -import { wordlist as portuguese } from '@scure/bip39/wordlists/portuguese'; -import { wordlist as simplifiedChinese } from '@scure/bip39/wordlists/simplified-chinese'; -import { wordlist as spanish } from '@scure/bip39/wordlists/spanish'; -import { wordlist as traditionalChinese } from '@scure/bip39/wordlists/traditional-chinese'; -``` - */ - -/*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) */ -import { pbkdf2, pbkdf2Async } from '@noble/hashes/pbkdf2'; -import { sha256, sha512 } from '@noble/hashes/sha2'; -import { abytes, anumber, randomBytes } from '@noble/hashes/utils'; -import { utils as baseUtils } from '@scure/base'; - -// Japanese wordlist -const isJapanese = (wordlist: string[]) => wordlist[0] === '\u3042\u3044\u3053\u304f\u3057\u3093'; - -// Normalization replaces equivalent sequences of characters -// so that any two texts that are equivalent will be reduced -// to the same sequence of code points, called the normal form of the original text. -// https://tonsky.me/blog/unicode/#why-is-a---- -function nfkd(str: string) { - if (typeof str !== 'string') throw new TypeError('invalid mnemonic type: ' + typeof str); - return str.normalize('NFKD'); -} - -function normalize(str: string) { - const norm = nfkd(str); - const words = norm.split(' '); - if (![12, 15, 18, 21, 24].includes(words.length)) throw new Error('Invalid mnemonic'); - return { nfkd: norm, words }; -} - -function aentropy(ent: Uint8Array) { - abytes(ent, 16, 20, 24, 28, 32); -} - -/** - * Generate x random words. Uses Cryptographically-Secure Random Number Generator. - * @param wordlist imported wordlist for specific language - * @param strength mnemonic strength 128-256 bits - * @example - * generateMnemonic(wordlist, 128) - * // 'legal winner thank year wave sausage worth useful legal winner thank yellow' - */ -export function generateMnemonic(wordlist: string[], strength: number = 128): string { - anumber(strength); - if (strength % 32 !== 0 || strength > 256) throw new TypeError('Invalid entropy'); - return entropyToMnemonic(randomBytes(strength / 8), wordlist); -} - -const calcChecksum = (entropy: Uint8Array) => { - // Checksum is ent.length/4 bits long - const bitsLeft = 8 - entropy.length / 4; - // Zero rightmost "bitsLeft" bits in byte - // For example: bitsLeft=4 val=10111101 -> 10110000 - return new Uint8Array([(sha256(entropy)[0]! >> bitsLeft) << bitsLeft]); -}; - -function getCoder(wordlist: string[]) { - if (!Array.isArray(wordlist) || wordlist.length !== 2048 || typeof wordlist[0] !== 'string') - throw new Error('Wordlist: expected array of 2048 strings'); - wordlist.forEach((i) => { - if (typeof i !== 'string') throw new Error('wordlist: non-string element: ' + i); - }); - return baseUtils.chain( - baseUtils.checksum(1, calcChecksum), - baseUtils.radix2(11, true), - baseUtils.alphabet(wordlist) - ); -} - -/** - * Reversible: Converts mnemonic string to raw entropy in form of byte array. - * @param mnemonic 12-24 words - * @param wordlist imported wordlist for specific language - * @example - * const mnem = 'legal winner thank year wave sausage worth useful legal winner thank yellow'; - * mnemonicToEntropy(mnem, wordlist) - * // Produces - * new Uint8Array([ - * 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, - * 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f - * ]) - */ -export function mnemonicToEntropy(mnemonic: string, wordlist: string[]): Uint8Array { - const { words } = normalize(mnemonic); - const entropy = getCoder(wordlist).decode(words); - aentropy(entropy); - return entropy; -} - -/** - * Reversible: Converts raw entropy in form of byte array to mnemonic string. - * @param entropy byte array - * @param wordlist imported wordlist for specific language - * @returns 12-24 words - * @example - * const ent = new Uint8Array([ - * 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, - * 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f - * ]); - * entropyToMnemonic(ent, wordlist); - * // 'legal winner thank year wave sausage worth useful legal winner thank yellow' - */ -export function entropyToMnemonic(entropy: Uint8Array, wordlist: string[]): string { - aentropy(entropy); - const words = getCoder(wordlist).encode(entropy); - return words.join(isJapanese(wordlist) ? '\u3000' : ' '); -} - -/** - * Validates mnemonic for being 12-24 words contained in `wordlist`. - */ -export function validateMnemonic(mnemonic: string, wordlist: string[]): boolean { - try { - mnemonicToEntropy(mnemonic, wordlist); - } catch (e) { - return false; - } - return true; -} - -const psalt = (passphrase: string) => nfkd('mnemonic' + passphrase); - -/** - * Irreversible: Uses KDF to derive 64 bytes of key data from mnemonic + optional password. - * @param mnemonic 12-24 words - * @param passphrase string that will additionally protect the key - * @returns 64 bytes of key data - * @example - * const mnem = 'legal winner thank year wave sausage worth useful legal winner thank yellow'; - * await mnemonicToSeed(mnem, 'password'); - * // new Uint8Array([...64 bytes]) - */ -export function mnemonicToSeed(mnemonic: string, passphrase = ''): Promise { - return pbkdf2Async(sha512, normalize(mnemonic).nfkd, psalt(passphrase), { c: 2048, dkLen: 64 }); -} - -/** - * Irreversible: Uses KDF to derive 64 bytes of key data from mnemonic + optional password. - * @param mnemonic 12-24 words - * @param passphrase string that will additionally protect the key - * @returns 64 bytes of key data - * @example - * const mnem = 'legal winner thank year wave sausage worth useful legal winner thank yellow'; - * mnemonicToSeedSync(mnem, 'password'); - * // new Uint8Array([...64 bytes]) - */ -export function mnemonicToSeedSync(mnemonic: string, passphrase = ''): Uint8Array { - return pbkdf2(sha512, normalize(mnemonic).nfkd, psalt(passphrase), { c: 2048, dkLen: 64 }); -} diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/czech.d.ts b/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/czech.d.ts deleted file mode 100644 index b566a1db..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/czech.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const wordlist: string[]; diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/czech.js b/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/czech.js deleted file mode 100644 index 0295622f..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/czech.js +++ /dev/null @@ -1,2051 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.wordlist = void 0; -exports.wordlist = `abdikace -abeceda -adresa -agrese -akce -aktovka -alej -alkohol -amputace -ananas -andulka -anekdota -anketa -antika -anulovat -archa -arogance -asfalt -asistent -aspirace -astma -astronom -atlas -atletika -atol -autobus -azyl -babka -bachor -bacil -baculka -badatel -bageta -bagr -bahno -bakterie -balada -baletka -balkon -balonek -balvan -balza -bambus -bankomat -barbar -baret -barman -baroko -barva -baterka -batoh -bavlna -bazalka -bazilika -bazuka -bedna -beran -beseda -bestie -beton -bezinka -bezmoc -beztak -bicykl -bidlo -biftek -bikiny -bilance -biograf -biolog -bitva -bizon -blahobyt -blatouch -blecha -bledule -blesk -blikat -blizna -blokovat -bloudit -blud -bobek -bobr -bodlina -bodnout -bohatost -bojkot -bojovat -bokorys -bolest -borec -borovice -bota -boubel -bouchat -bouda -boule -bourat -boxer -bradavka -brambora -branka -bratr -brepta -briketa -brko -brloh -bronz -broskev -brunetka -brusinka -brzda -brzy -bublina -bubnovat -buchta -buditel -budka -budova -bufet -bujarost -bukvice -buldok -bulva -bunda -bunkr -burza -butik -buvol -buzola -bydlet -bylina -bytovka -bzukot -capart -carevna -cedr -cedule -cejch -cejn -cela -celer -celkem -celnice -cenina -cennost -cenovka -centrum -cenzor -cestopis -cetka -chalupa -chapadlo -charita -chata -chechtat -chemie -chichot -chirurg -chlad -chleba -chlubit -chmel -chmura -chobot -chochol -chodba -cholera -chomout -chopit -choroba -chov -chrapot -chrlit -chrt -chrup -chtivost -chudina -chutnat -chvat -chvilka -chvost -chyba -chystat -chytit -cibule -cigareta -cihelna -cihla -cinkot -cirkus -cisterna -citace -citrus -cizinec -cizost -clona -cokoliv -couvat -ctitel -ctnost -cudnost -cuketa -cukr -cupot -cvaknout -cval -cvik -cvrkot -cyklista -daleko -dareba -datel -datum -dcera -debata -dechovka -decibel -deficit -deflace -dekl -dekret -demokrat -deprese -derby -deska -detektiv -dikobraz -diktovat -dioda -diplom -disk -displej -divadlo -divoch -dlaha -dlouho -dluhopis -dnes -dobro -dobytek -docent -dochutit -dodnes -dohled -dohoda -dohra -dojem -dojnice -doklad -dokola -doktor -dokument -dolar -doleva -dolina -doma -dominant -domluvit -domov -donutit -dopad -dopis -doplnit -doposud -doprovod -dopustit -dorazit -dorost -dort -dosah -doslov -dostatek -dosud -dosyta -dotaz -dotek -dotknout -doufat -doutnat -dovozce -dozadu -doznat -dozorce -drahota -drak -dramatik -dravec -draze -drdol -drobnost -drogerie -drozd -drsnost -drtit -drzost -duben -duchovno -dudek -duha -duhovka -dusit -dusno -dutost -dvojice -dvorec -dynamit -ekolog -ekonomie -elektron -elipsa -email -emise -emoce -empatie -epizoda -epocha -epopej -epos -esej -esence -eskorta -eskymo -etiketa -euforie -evoluce -exekuce -exkurze -expedice -exploze -export -extrakt -facka -fajfka -fakulta -fanatik -fantazie -farmacie -favorit -fazole -federace -fejeton -fenka -fialka -figurant -filozof -filtr -finance -finta -fixace -fjord -flanel -flirt -flotila -fond -fosfor -fotbal -fotka -foton -frakce -freska -fronta -fukar -funkce -fyzika -galeje -garant -genetika -geolog -gilotina -glazura -glejt -golem -golfista -gotika -graf -gramofon -granule -grep -gril -grog -groteska -guma -hadice -hadr -hala -halenka -hanba -hanopis -harfa -harpuna -havran -hebkost -hejkal -hejno -hejtman -hektar -helma -hematom -herec -herna -heslo -hezky -historik -hladovka -hlasivky -hlava -hledat -hlen -hlodavec -hloh -hloupost -hltat -hlubina -hluchota -hmat -hmota -hmyz -hnis -hnojivo -hnout -hoblina -hoboj -hoch -hodiny -hodlat -hodnota -hodovat -hojnost -hokej -holinka -holka -holub -homole -honitba -honorace -horal -horda -horizont -horko -horlivec -hormon -hornina -horoskop -horstvo -hospoda -hostina -hotovost -houba -houf -houpat -houska -hovor -hradba -hranice -hravost -hrazda -hrbolek -hrdina -hrdlo -hrdost -hrnek -hrobka -hromada -hrot -hrouda -hrozen -hrstka -hrubost -hryzat -hubenost -hubnout -hudba -hukot -humr -husita -hustota -hvozd -hybnost -hydrant -hygiena -hymna -hysterik -idylka -ihned -ikona -iluze -imunita -infekce -inflace -inkaso -inovace -inspekce -internet -invalida -investor -inzerce -ironie -jablko -jachta -jahoda -jakmile -jakost -jalovec -jantar -jarmark -jaro -jasan -jasno -jatka -javor -jazyk -jedinec -jedle -jednatel -jehlan -jekot -jelen -jelito -jemnost -jenom -jepice -jeseter -jevit -jezdec -jezero -jinak -jindy -jinoch -jiskra -jistota -jitrnice -jizva -jmenovat -jogurt -jurta -kabaret -kabel -kabinet -kachna -kadet -kadidlo -kahan -kajak -kajuta -kakao -kaktus -kalamita -kalhoty -kalibr -kalnost -kamera -kamkoliv -kamna -kanibal -kanoe -kantor -kapalina -kapela -kapitola -kapka -kaple -kapota -kapr -kapusta -kapybara -karamel -karotka -karton -kasa -katalog -katedra -kauce -kauza -kavalec -kazajka -kazeta -kazivost -kdekoliv -kdesi -kedluben -kemp -keramika -kino -klacek -kladivo -klam -klapot -klasika -klaun -klec -klenba -klepat -klesnout -klid -klima -klisna -klobouk -klokan -klopa -kloub -klubovna -klusat -kluzkost -kmen -kmitat -kmotr -kniha -knot -koalice -koberec -kobka -kobliha -kobyla -kocour -kohout -kojenec -kokos -koktejl -kolaps -koleda -kolize -kolo -komando -kometa -komik -komnata -komora -kompas -komunita -konat -koncept -kondice -konec -konfese -kongres -konina -konkurs -kontakt -konzerva -kopanec -kopie -kopnout -koprovka -korbel -korektor -kormidlo -koroptev -korpus -koruna -koryto -korzet -kosatec -kostka -kotel -kotleta -kotoul -koukat -koupelna -kousek -kouzlo -kovboj -koza -kozoroh -krabice -krach -krajina -kralovat -krasopis -kravata -kredit -krejcar -kresba -kreveta -kriket -kritik -krize -krkavec -krmelec -krmivo -krocan -krok -kronika -kropit -kroupa -krovka -krtek -kruhadlo -krupice -krutost -krvinka -krychle -krypta -krystal -kryt -kudlanka -kufr -kujnost -kukla -kulajda -kulich -kulka -kulomet -kultura -kuna -kupodivu -kurt -kurzor -kutil -kvalita -kvasinka -kvestor -kynolog -kyselina -kytara -kytice -kytka -kytovec -kyvadlo -labrador -lachtan -ladnost -laik -lakomec -lamela -lampa -lanovka -lasice -laso -lastura -latinka -lavina -lebka -leckdy -leden -lednice -ledovka -ledvina -legenda -legie -legrace -lehce -lehkost -lehnout -lektvar -lenochod -lentilka -lepenka -lepidlo -letadlo -letec -letmo -letokruh -levhart -levitace -levobok -libra -lichotka -lidojed -lidskost -lihovina -lijavec -lilek -limetka -linie -linka -linoleum -listopad -litina -litovat -lobista -lodivod -logika -logoped -lokalita -loket -lomcovat -lopata -lopuch -lord -losos -lotr -loudal -louh -louka -louskat -lovec -lstivost -lucerna -lucifer -lump -lusk -lustrace -lvice -lyra -lyrika -lysina -madam -madlo -magistr -mahagon -majetek -majitel -majorita -makak -makovice -makrela -malba -malina -malovat -malvice -maminka -mandle -manko -marnost -masakr -maskot -masopust -matice -matrika -maturita -mazanec -mazivo -mazlit -mazurka -mdloba -mechanik -meditace -medovina -melasa -meloun -mentolka -metla -metoda -metr -mezera -migrace -mihnout -mihule -mikina -mikrofon -milenec -milimetr -milost -mimika -mincovna -minibar -minomet -minulost -miska -mistr -mixovat -mladost -mlha -mlhovina -mlok -mlsat -mluvit -mnich -mnohem -mobil -mocnost -modelka -modlitba -mohyla -mokro -molekula -momentka -monarcha -monokl -monstrum -montovat -monzun -mosaz -moskyt -most -motivace -motorka -motyka -moucha -moudrost -mozaika -mozek -mozol -mramor -mravenec -mrkev -mrtvola -mrzet -mrzutost -mstitel -mudrc -muflon -mulat -mumie -munice -muset -mutace -muzeum -muzikant -myslivec -mzda -nabourat -nachytat -nadace -nadbytek -nadhoz -nadobro -nadpis -nahlas -nahnat -nahodile -nahradit -naivita -najednou -najisto -najmout -naklonit -nakonec -nakrmit -nalevo -namazat -namluvit -nanometr -naoko -naopak -naostro -napadat -napevno -naplnit -napnout -naposled -naprosto -narodit -naruby -narychlo -nasadit -nasekat -naslepo -nastat -natolik -navenek -navrch -navzdory -nazvat -nebe -nechat -necky -nedaleko -nedbat -neduh -negace -nehet -nehoda -nejen -nejprve -neklid -nelibost -nemilost -nemoc -neochota -neonka -nepokoj -nerost -nerv -nesmysl -nesoulad -netvor -neuron -nevina -nezvykle -nicota -nijak -nikam -nikdy -nikl -nikterak -nitro -nocleh -nohavice -nominace -nora -norek -nositel -nosnost -nouze -noviny -novota -nozdra -nuda -nudle -nuget -nutit -nutnost -nutrie -nymfa -obal -obarvit -obava -obdiv -obec -obehnat -obejmout -obezita -obhajoba -obilnice -objasnit -objekt -obklopit -oblast -oblek -obliba -obloha -obluda -obnos -obohatit -obojek -obout -obrazec -obrna -obruba -obrys -obsah -obsluha -obstarat -obuv -obvaz -obvinit -obvod -obvykle -obyvatel -obzor -ocas -ocel -ocenit -ochladit -ochota -ochrana -ocitnout -odboj -odbyt -odchod -odcizit -odebrat -odeslat -odevzdat -odezva -odhadce -odhodit -odjet -odjinud -odkaz -odkoupit -odliv -odluka -odmlka -odolnost -odpad -odpis -odplout -odpor -odpustit -odpykat -odrazka -odsoudit -odstup -odsun -odtok -odtud -odvaha -odveta -odvolat -odvracet -odznak -ofina -ofsajd -ohlas -ohnisko -ohrada -ohrozit -ohryzek -okap -okenice -oklika -okno -okouzlit -okovy -okrasa -okres -okrsek -okruh -okupant -okurka -okusit -olejnina -olizovat -omak -omeleta -omezit -omladina -omlouvat -omluva -omyl -onehdy -opakovat -opasek -operace -opice -opilost -opisovat -opora -opozice -opravdu -oproti -orbital -orchestr -orgie -orlice -orloj -ortel -osada -oschnout -osika -osivo -oslava -oslepit -oslnit -oslovit -osnova -osoba -osolit -ospalec -osten -ostraha -ostuda -ostych -osvojit -oteplit -otisk -otop -otrhat -otrlost -otrok -otruby -otvor -ovanout -ovar -oves -ovlivnit -ovoce -oxid -ozdoba -pachatel -pacient -padouch -pahorek -pakt -palanda -palec -palivo -paluba -pamflet -pamlsek -panenka -panika -panna -panovat -panstvo -pantofle -paprika -parketa -parodie -parta -paruka -paryba -paseka -pasivita -pastelka -patent -patrona -pavouk -pazneht -pazourek -pecka -pedagog -pejsek -peklo -peloton -penalta -pendrek -penze -periskop -pero -pestrost -petarda -petice -petrolej -pevnina -pexeso -pianista -piha -pijavice -pikle -piknik -pilina -pilnost -pilulka -pinzeta -pipeta -pisatel -pistole -pitevna -pivnice -pivovar -placenta -plakat -plamen -planeta -plastika -platit -plavidlo -plaz -plech -plemeno -plenta -ples -pletivo -plevel -plivat -plnit -plno -plocha -plodina -plomba -plout -pluk -plyn -pobavit -pobyt -pochod -pocit -poctivec -podat -podcenit -podepsat -podhled -podivit -podklad -podmanit -podnik -podoba -podpora -podraz -podstata -podvod -podzim -poezie -pohanka -pohnutka -pohovor -pohroma -pohyb -pointa -pojistka -pojmout -pokazit -pokles -pokoj -pokrok -pokuta -pokyn -poledne -polibek -polknout -poloha -polynom -pomalu -pominout -pomlka -pomoc -pomsta -pomyslet -ponechat -ponorka -ponurost -popadat -popel -popisek -poplach -poprosit -popsat -popud -poradce -porce -porod -porucha -poryv -posadit -posed -posila -poskok -poslanec -posoudit -pospolu -postava -posudek -posyp -potah -potkan -potlesk -potomek -potrava -potupa -potvora -poukaz -pouto -pouzdro -povaha -povidla -povlak -povoz -povrch -povstat -povyk -povzdech -pozdrav -pozemek -poznatek -pozor -pozvat -pracovat -prahory -praktika -prales -praotec -praporek -prase -pravda -princip -prkno -probudit -procento -prodej -profese -prohra -projekt -prolomit -promile -pronikat -propad -prorok -prosba -proton -proutek -provaz -prskavka -prsten -prudkost -prut -prvek -prvohory -psanec -psovod -pstruh -ptactvo -puberta -puch -pudl -pukavec -puklina -pukrle -pult -pumpa -punc -pupen -pusa -pusinka -pustina -putovat -putyka -pyramida -pysk -pytel -racek -rachot -radiace -radnice -radon -raft -ragby -raketa -rakovina -rameno -rampouch -rande -rarach -rarita -rasovna -rastr -ratolest -razance -razidlo -reagovat -reakce -recept -redaktor -referent -reflex -rejnok -reklama -rekord -rekrut -rektor -reputace -revize -revma -revolver -rezerva -riskovat -riziko -robotika -rodokmen -rohovka -rokle -rokoko -romaneto -ropovod -ropucha -rorejs -rosol -rostlina -rotmistr -rotoped -rotunda -roubenka -roucho -roup -roura -rovina -rovnice -rozbor -rozchod -rozdat -rozeznat -rozhodce -rozinka -rozjezd -rozkaz -rozloha -rozmar -rozpad -rozruch -rozsah -roztok -rozum -rozvod -rubrika -ruchadlo -rukavice -rukopis -ryba -rybolov -rychlost -rydlo -rypadlo -rytina -ryzost -sadista -sahat -sako -samec -samizdat -samota -sanitka -sardinka -sasanka -satelit -sazba -sazenice -sbor -schovat -sebranka -secese -sedadlo -sediment -sedlo -sehnat -sejmout -sekera -sekta -sekunda -sekvoje -semeno -seno -servis -sesadit -seshora -seskok -seslat -sestra -sesuv -sesypat -setba -setina -setkat -setnout -setrvat -sever -seznam -shoda -shrnout -sifon -silnice -sirka -sirotek -sirup -situace -skafandr -skalisko -skanzen -skaut -skeptik -skica -skladba -sklenice -sklo -skluz -skoba -skokan -skoro -skripta -skrz -skupina -skvost -skvrna -slabika -sladidlo -slanina -slast -slavnost -sledovat -slepec -sleva -slezina -slib -slina -sliznice -slon -sloupek -slovo -sluch -sluha -slunce -slupka -slza -smaragd -smetana -smilstvo -smlouva -smog -smrad -smrk -smrtka -smutek -smysl -snad -snaha -snob -sobota -socha -sodovka -sokol -sopka -sotva -souboj -soucit -soudce -souhlas -soulad -soumrak -souprava -soused -soutok -souviset -spalovna -spasitel -spis -splav -spodek -spojenec -spolu -sponzor -spornost -spousta -sprcha -spustit -sranda -sraz -srdce -srna -srnec -srovnat -srpen -srst -srub -stanice -starosta -statika -stavba -stehno -stezka -stodola -stolek -stopa -storno -stoupat -strach -stres -strhnout -strom -struna -studna -stupnice -stvol -styk -subjekt -subtropy -suchar -sudost -sukno -sundat -sunout -surikata -surovina -svah -svalstvo -svetr -svatba -svazek -svisle -svitek -svoboda -svodidlo -svorka -svrab -sykavka -sykot -synek -synovec -sypat -sypkost -syrovost -sysel -sytost -tabletka -tabule -tahoun -tajemno -tajfun -tajga -tajit -tajnost -taktika -tamhle -tampon -tancovat -tanec -tanker -tapeta -tavenina -tazatel -technika -tehdy -tekutina -telefon -temnota -tendence -tenista -tenor -teplota -tepna -teprve -terapie -termoska -textil -ticho -tiskopis -titulek -tkadlec -tkanina -tlapka -tleskat -tlukot -tlupa -tmel -toaleta -topinka -topol -torzo -touha -toulec -tradice -traktor -tramp -trasa -traverza -trefit -trest -trezor -trhavina -trhlina -trochu -trojice -troska -trouba -trpce -trpitel -trpkost -trubec -truchlit -truhlice -trus -trvat -tudy -tuhnout -tuhost -tundra -turista -turnaj -tuzemsko -tvaroh -tvorba -tvrdost -tvrz -tygr -tykev -ubohost -uboze -ubrat -ubrousek -ubrus -ubytovna -ucho -uctivost -udivit -uhradit -ujednat -ujistit -ujmout -ukazatel -uklidnit -uklonit -ukotvit -ukrojit -ulice -ulita -ulovit -umyvadlo -unavit -uniforma -uniknout -upadnout -uplatnit -uplynout -upoutat -upravit -uran -urazit -usednout -usilovat -usmrtit -usnadnit -usnout -usoudit -ustlat -ustrnout -utahovat -utkat -utlumit -utonout -utopenec -utrousit -uvalit -uvolnit -uvozovka -uzdravit -uzel -uzenina -uzlina -uznat -vagon -valcha -valoun -vana -vandal -vanilka -varan -varhany -varovat -vcelku -vchod -vdova -vedro -vegetace -vejce -velbloud -veletrh -velitel -velmoc -velryba -venkov -veranda -verze -veselka -veskrze -vesnice -vespodu -vesta -veterina -veverka -vibrace -vichr -videohra -vidina -vidle -vila -vinice -viset -vitalita -vize -vizitka -vjezd -vklad -vkus -vlajka -vlak -vlasec -vlevo -vlhkost -vliv -vlnovka -vloupat -vnucovat -vnuk -voda -vodivost -vodoznak -vodstvo -vojensky -vojna -vojsko -volant -volba -volit -volno -voskovka -vozidlo -vozovna -vpravo -vrabec -vracet -vrah -vrata -vrba -vrcholek -vrhat -vrstva -vrtule -vsadit -vstoupit -vstup -vtip -vybavit -vybrat -vychovat -vydat -vydra -vyfotit -vyhledat -vyhnout -vyhodit -vyhradit -vyhubit -vyjasnit -vyjet -vyjmout -vyklopit -vykonat -vylekat -vymazat -vymezit -vymizet -vymyslet -vynechat -vynikat -vynutit -vypadat -vyplatit -vypravit -vypustit -vyrazit -vyrovnat -vyrvat -vyslovit -vysoko -vystavit -vysunout -vysypat -vytasit -vytesat -vytratit -vyvinout -vyvolat -vyvrhel -vyzdobit -vyznat -vzadu -vzbudit -vzchopit -vzdor -vzduch -vzdychat -vzestup -vzhledem -vzkaz -vzlykat -vznik -vzorek -vzpoura -vztah -vztek -xylofon -zabrat -zabydlet -zachovat -zadarmo -zadusit -zafoukat -zahltit -zahodit -zahrada -zahynout -zajatec -zajet -zajistit -zaklepat -zakoupit -zalepit -zamezit -zamotat -zamyslet -zanechat -zanikat -zaplatit -zapojit -zapsat -zarazit -zastavit -zasunout -zatajit -zatemnit -zatknout -zaujmout -zavalit -zavelet -zavinit -zavolat -zavrtat -zazvonit -zbavit -zbrusu -zbudovat -zbytek -zdaleka -zdarma -zdatnost -zdivo -zdobit -zdroj -zdvih -zdymadlo -zelenina -zeman -zemina -zeptat -zezadu -zezdola -zhatit -zhltnout -zhluboka -zhotovit -zhruba -zima -zimnice -zjemnit -zklamat -zkoumat -zkratka -zkumavka -zlato -zlehka -zloba -zlom -zlost -zlozvyk -zmapovat -zmar -zmatek -zmije -zmizet -zmocnit -zmodrat -zmrzlina -zmutovat -znak -znalost -znamenat -znovu -zobrazit -zotavit -zoubek -zoufale -zplodit -zpomalit -zprava -zprostit -zprudka -zprvu -zrada -zranit -zrcadlo -zrnitost -zrno -zrovna -zrychlit -zrzavost -zticha -ztratit -zubovina -zubr -zvednout -zvenku -zvesela -zvon -zvrat -zvukovod -zvyk`.split('\n'); diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/english.d.ts b/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/english.d.ts deleted file mode 100644 index b566a1db..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/english.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const wordlist: string[]; diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/english.js b/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/english.js deleted file mode 100644 index 10c9c190..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/english.js +++ /dev/null @@ -1,2051 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.wordlist = void 0; -exports.wordlist = `abandon -ability -able -about -above -absent -absorb -abstract -absurd -abuse -access -accident -account -accuse -achieve -acid -acoustic -acquire -across -act -action -actor -actress -actual -adapt -add -addict -address -adjust -admit -adult -advance -advice -aerobic -affair -afford -afraid -again -age -agent -agree -ahead -aim -air -airport -aisle -alarm -album -alcohol -alert -alien -all -alley -allow -almost -alone -alpha -already -also -alter -always -amateur -amazing -among -amount -amused -analyst -anchor -ancient -anger -angle -angry -animal -ankle -announce -annual -another -answer -antenna -antique -anxiety -any -apart -apology -appear -apple -approve -april -arch -arctic -area -arena -argue -arm -armed -armor -army -around -arrange -arrest -arrive -arrow -art -artefact -artist -artwork -ask -aspect -assault -asset -assist -assume -asthma -athlete -atom -attack -attend -attitude -attract -auction -audit -august -aunt -author -auto -autumn -average -avocado -avoid -awake -aware -away -awesome -awful -awkward -axis -baby -bachelor -bacon -badge -bag -balance -balcony -ball -bamboo -banana -banner -bar -barely -bargain -barrel -base -basic -basket -battle -beach -bean -beauty -because -become -beef -before -begin -behave -behind -believe -below -belt -bench -benefit -best -betray -better -between -beyond -bicycle -bid -bike -bind -biology -bird -birth -bitter -black -blade -blame -blanket -blast -bleak -bless -blind -blood -blossom -blouse -blue -blur -blush -board -boat -body -boil -bomb -bone -bonus -book -boost -border -boring -borrow -boss -bottom -bounce -box -boy -bracket -brain -brand -brass -brave -bread -breeze -brick -bridge -brief -bright -bring -brisk -broccoli -broken -bronze -broom -brother -brown -brush -bubble -buddy -budget -buffalo -build -bulb -bulk -bullet -bundle -bunker -burden -burger -burst -bus -business -busy -butter -buyer -buzz -cabbage -cabin -cable -cactus -cage -cake -call -calm -camera -camp -can -canal -cancel -candy -cannon -canoe -canvas -canyon -capable -capital -captain -car -carbon -card -cargo -carpet -carry -cart -case -cash -casino -castle -casual -cat -catalog -catch -category -cattle -caught -cause -caution -cave -ceiling -celery -cement -census -century -cereal -certain -chair -chalk -champion -change -chaos -chapter -charge -chase -chat -cheap -check -cheese -chef -cherry -chest -chicken -chief -child -chimney -choice -choose -chronic -chuckle -chunk -churn -cigar -cinnamon -circle -citizen -city -civil -claim -clap -clarify -claw -clay -clean -clerk -clever -click -client -cliff -climb -clinic -clip -clock -clog -close -cloth -cloud -clown -club -clump -cluster -clutch -coach -coast -coconut -code -coffee -coil -coin -collect -color -column -combine -come -comfort -comic -common -company -concert -conduct -confirm -congress -connect -consider -control -convince -cook -cool -copper -copy -coral -core -corn -correct -cost -cotton -couch -country -couple -course -cousin -cover -coyote -crack -cradle -craft -cram -crane -crash -crater -crawl -crazy -cream -credit -creek -crew -cricket -crime -crisp -critic -crop -cross -crouch -crowd -crucial -cruel -cruise -crumble -crunch -crush -cry -crystal -cube -culture -cup -cupboard -curious -current -curtain -curve -cushion -custom -cute -cycle -dad -damage -damp -dance -danger -daring -dash -daughter -dawn -day -deal -debate -debris -decade -december -decide -decline -decorate -decrease -deer -defense -define -defy -degree -delay -deliver -demand -demise -denial -dentist -deny -depart -depend -deposit -depth -deputy -derive -describe -desert -design -desk -despair -destroy -detail -detect -develop -device -devote -diagram -dial -diamond -diary -dice -diesel -diet -differ -digital -dignity -dilemma -dinner -dinosaur -direct -dirt -disagree -discover -disease -dish -dismiss -disorder -display -distance -divert -divide -divorce -dizzy -doctor -document -dog -doll -dolphin -domain -donate -donkey -donor -door -dose -double -dove -draft -dragon -drama -drastic -draw -dream -dress -drift -drill -drink -drip -drive -drop -drum -dry -duck -dumb -dune -during -dust -dutch -duty -dwarf -dynamic -eager -eagle -early -earn -earth -easily -east -easy -echo -ecology -economy -edge -edit -educate -effort -egg -eight -either -elbow -elder -electric -elegant -element -elephant -elevator -elite -else -embark -embody -embrace -emerge -emotion -employ -empower -empty -enable -enact -end -endless -endorse -enemy -energy -enforce -engage -engine -enhance -enjoy -enlist -enough -enrich -enroll -ensure -enter -entire -entry -envelope -episode -equal -equip -era -erase -erode -erosion -error -erupt -escape -essay -essence -estate -eternal -ethics -evidence -evil -evoke -evolve -exact -example -excess -exchange -excite -exclude -excuse -execute -exercise -exhaust -exhibit -exile -exist -exit -exotic -expand -expect -expire -explain -expose -express -extend -extra -eye -eyebrow -fabric -face -faculty -fade -faint -faith -fall -false -fame -family -famous -fan -fancy -fantasy -farm -fashion -fat -fatal -father -fatigue -fault -favorite -feature -february -federal -fee -feed -feel -female -fence -festival -fetch -fever -few -fiber -fiction -field -figure -file -film -filter -final -find -fine -finger -finish -fire -firm -first -fiscal -fish -fit -fitness -fix -flag -flame -flash -flat -flavor -flee -flight -flip -float -flock -floor -flower -fluid -flush -fly -foam -focus -fog -foil -fold -follow -food -foot -force -forest -forget -fork -fortune -forum -forward -fossil -foster -found -fox -fragile -frame -frequent -fresh -friend -fringe -frog -front -frost -frown -frozen -fruit -fuel -fun -funny -furnace -fury -future -gadget -gain -galaxy -gallery -game -gap -garage -garbage -garden -garlic -garment -gas -gasp -gate -gather -gauge -gaze -general -genius -genre -gentle -genuine -gesture -ghost -giant -gift -giggle -ginger -giraffe -girl -give -glad -glance -glare -glass -glide -glimpse -globe -gloom -glory -glove -glow -glue -goat -goddess -gold -good -goose -gorilla -gospel -gossip -govern -gown -grab -grace -grain -grant -grape -grass -gravity -great -green -grid -grief -grit -grocery -group -grow -grunt -guard -guess -guide -guilt -guitar -gun -gym -habit -hair -half -hammer -hamster -hand -happy -harbor -hard -harsh -harvest -hat -have -hawk -hazard -head -health -heart -heavy -hedgehog -height -hello -helmet -help -hen -hero -hidden -high -hill -hint -hip -hire -history -hobby -hockey -hold -hole -holiday -hollow -home -honey -hood -hope -horn -horror -horse -hospital -host -hotel -hour -hover -hub -huge -human -humble -humor -hundred -hungry -hunt -hurdle -hurry -hurt -husband -hybrid -ice -icon -idea -identify -idle -ignore -ill -illegal -illness -image -imitate -immense -immune -impact -impose -improve -impulse -inch -include -income -increase -index -indicate -indoor -industry -infant -inflict -inform -inhale -inherit -initial -inject -injury -inmate -inner -innocent -input -inquiry -insane -insect -inside -inspire -install -intact -interest -into -invest -invite -involve -iron -island -isolate -issue -item -ivory -jacket -jaguar -jar -jazz -jealous -jeans -jelly -jewel -job -join -joke -journey -joy -judge -juice -jump -jungle -junior -junk -just -kangaroo -keen -keep -ketchup -key -kick -kid -kidney -kind -kingdom -kiss -kit -kitchen -kite -kitten -kiwi -knee -knife -knock -know -lab -label -labor -ladder -lady -lake -lamp -language -laptop -large -later -latin -laugh -laundry -lava -law -lawn -lawsuit -layer -lazy -leader -leaf -learn -leave -lecture -left -leg -legal -legend -leisure -lemon -lend -length -lens -leopard -lesson -letter -level -liar -liberty -library -license -life -lift -light -like -limb -limit -link -lion -liquid -list -little -live -lizard -load -loan -lobster -local -lock -logic -lonely -long -loop -lottery -loud -lounge -love -loyal -lucky -luggage -lumber -lunar -lunch -luxury -lyrics -machine -mad -magic -magnet -maid -mail -main -major -make -mammal -man -manage -mandate -mango -mansion -manual -maple -marble -march -margin -marine -market -marriage -mask -mass -master -match -material -math -matrix -matter -maximum -maze -meadow -mean -measure -meat -mechanic -medal -media -melody -melt -member -memory -mention -menu -mercy -merge -merit -merry -mesh -message -metal -method -middle -midnight -milk -million -mimic -mind -minimum -minor -minute -miracle -mirror -misery -miss -mistake -mix -mixed -mixture -mobile -model -modify -mom -moment -monitor -monkey -monster -month -moon -moral -more -morning -mosquito -mother -motion -motor -mountain -mouse -move -movie -much -muffin -mule -multiply -muscle -museum -mushroom -music -must -mutual -myself -mystery -myth -naive -name -napkin -narrow -nasty -nation -nature -near -neck -need -negative -neglect -neither -nephew -nerve -nest -net -network -neutral -never -news -next -nice -night -noble -noise -nominee -noodle -normal -north -nose -notable -note -nothing -notice -novel -now -nuclear -number -nurse -nut -oak -obey -object -oblige -obscure -observe -obtain -obvious -occur -ocean -october -odor -off -offer -office -often -oil -okay -old -olive -olympic -omit -once -one -onion -online -only -open -opera -opinion -oppose -option -orange -orbit -orchard -order -ordinary -organ -orient -original -orphan -ostrich -other -outdoor -outer -output -outside -oval -oven -over -own -owner -oxygen -oyster -ozone -pact -paddle -page -pair -palace -palm -panda -panel -panic -panther -paper -parade -parent -park -parrot -party -pass -patch -path -patient -patrol -pattern -pause -pave -payment -peace -peanut -pear -peasant -pelican -pen -penalty -pencil -people -pepper -perfect -permit -person -pet -phone -photo -phrase -physical -piano -picnic -picture -piece -pig -pigeon -pill -pilot -pink -pioneer -pipe -pistol -pitch -pizza -place -planet -plastic -plate -play -please -pledge -pluck -plug -plunge -poem -poet -point -polar -pole -police -pond -pony -pool -popular -portion -position -possible -post -potato -pottery -poverty -powder -power -practice -praise -predict -prefer -prepare -present -pretty -prevent -price -pride -primary -print -priority -prison -private -prize -problem -process -produce -profit -program -project -promote -proof -property -prosper -protect -proud -provide -public -pudding -pull -pulp -pulse -pumpkin -punch -pupil -puppy -purchase -purity -purpose -purse -push -put -puzzle -pyramid -quality -quantum -quarter -question -quick -quit -quiz -quote -rabbit -raccoon -race -rack -radar -radio -rail -rain -raise -rally -ramp -ranch -random -range -rapid -rare -rate -rather -raven -raw -razor -ready -real -reason -rebel -rebuild -recall -receive -recipe -record -recycle -reduce -reflect -reform -refuse -region -regret -regular -reject -relax -release -relief -rely -remain -remember -remind -remove -render -renew -rent -reopen -repair -repeat -replace -report -require -rescue -resemble -resist -resource -response -result -retire -retreat -return -reunion -reveal -review -reward -rhythm -rib -ribbon -rice -rich -ride -ridge -rifle -right -rigid -ring -riot -ripple -risk -ritual -rival -river -road -roast -robot -robust -rocket -romance -roof -rookie -room -rose -rotate -rough -round -route -royal -rubber -rude -rug -rule -run -runway -rural -sad -saddle -sadness -safe -sail -salad -salmon -salon -salt -salute -same -sample -sand -satisfy -satoshi -sauce -sausage -save -say -scale -scan -scare -scatter -scene -scheme -school -science -scissors -scorpion -scout -scrap -screen -script -scrub -sea -search -season -seat -second -secret -section -security -seed -seek -segment -select -sell -seminar -senior -sense -sentence -series -service -session -settle -setup -seven -shadow -shaft -shallow -share -shed -shell -sheriff -shield -shift -shine -ship -shiver -shock -shoe -shoot -shop -short -shoulder -shove -shrimp -shrug -shuffle -shy -sibling -sick -side -siege -sight -sign -silent -silk -silly -silver -similar -simple -since -sing -siren -sister -situate -six -size -skate -sketch -ski -skill -skin -skirt -skull -slab -slam -sleep -slender -slice -slide -slight -slim -slogan -slot -slow -slush -small -smart -smile -smoke -smooth -snack -snake -snap -sniff -snow -soap -soccer -social -sock -soda -soft -solar -soldier -solid -solution -solve -someone -song -soon -sorry -sort -soul -sound -soup -source -south -space -spare -spatial -spawn -speak -special -speed -spell -spend -sphere -spice -spider -spike -spin -spirit -split -spoil -sponsor -spoon -sport -spot -spray -spread -spring -spy -square -squeeze -squirrel -stable -stadium -staff -stage -stairs -stamp -stand -start -state -stay -steak -steel -stem -step -stereo -stick -still -sting -stock -stomach -stone -stool -story -stove -strategy -street -strike -strong -struggle -student -stuff -stumble -style -subject -submit -subway -success -such -sudden -suffer -sugar -suggest -suit -summer -sun -sunny -sunset -super -supply -supreme -sure -surface -surge -surprise -surround -survey -suspect -sustain -swallow -swamp -swap -swarm -swear -sweet -swift -swim -swing -switch -sword -symbol -symptom -syrup -system -table -tackle -tag -tail -talent -talk -tank -tape -target -task -taste -tattoo -taxi -teach -team -tell -ten -tenant -tennis -tent -term -test -text -thank -that -theme -then -theory -there -they -thing -this -thought -three -thrive -throw -thumb -thunder -ticket -tide -tiger -tilt -timber -time -tiny -tip -tired -tissue -title -toast -tobacco -today -toddler -toe -together -toilet -token -tomato -tomorrow -tone -tongue -tonight -tool -tooth -top -topic -topple -torch -tornado -tortoise -toss -total -tourist -toward -tower -town -toy -track -trade -traffic -tragic -train -transfer -trap -trash -travel -tray -treat -tree -trend -trial -tribe -trick -trigger -trim -trip -trophy -trouble -truck -true -truly -trumpet -trust -truth -try -tube -tuition -tumble -tuna -tunnel -turkey -turn -turtle -twelve -twenty -twice -twin -twist -two -type -typical -ugly -umbrella -unable -unaware -uncle -uncover -under -undo -unfair -unfold -unhappy -uniform -unique -unit -universe -unknown -unlock -until -unusual -unveil -update -upgrade -uphold -upon -upper -upset -urban -urge -usage -use -used -useful -useless -usual -utility -vacant -vacuum -vague -valid -valley -valve -van -vanish -vapor -various -vast -vault -vehicle -velvet -vendor -venture -venue -verb -verify -version -very -vessel -veteran -viable -vibrant -vicious -victory -video -view -village -vintage -violin -virtual -virus -visa -visit -visual -vital -vivid -vocal -voice -void -volcano -volume -vote -voyage -wage -wagon -wait -walk -wall -walnut -want -warfare -warm -warrior -wash -wasp -waste -water -wave -way -wealth -weapon -wear -weasel -weather -web -wedding -weekend -weird -welcome -west -wet -whale -what -wheat -wheel -when -where -whip -whisper -wide -width -wife -wild -will -win -window -wine -wing -wink -winner -winter -wire -wisdom -wise -wish -witness -wolf -woman -wonder -wood -wool -word -work -world -worry -worth -wrap -wreck -wrestle -wrist -write -wrong -yard -year -yellow -you -young -youth -zebra -zero -zone -zoo`.split('\n'); diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/french.d.ts b/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/french.d.ts deleted file mode 100644 index b566a1db..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/french.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const wordlist: string[]; diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/french.js b/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/french.js deleted file mode 100644 index 60105821..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/french.js +++ /dev/null @@ -1,2051 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.wordlist = void 0; -exports.wordlist = `abaisser -abandon -abdiquer -abeille -abolir -aborder -aboutir -aboyer -abrasif -abreuver -abriter -abroger -abrupt -absence -absolu -absurde -abusif -abyssal -académie -acajou -acarien -accabler -accepter -acclamer -accolade -accroche -accuser -acerbe -achat -acheter -aciduler -acier -acompte -acquérir -acronyme -acteur -actif -actuel -adepte -adéquat -adhésif -adjectif -adjuger -admettre -admirer -adopter -adorer -adoucir -adresse -adroit -adulte -adverbe -aérer -aéronef -affaire -affecter -affiche -affreux -affubler -agacer -agencer -agile -agiter -agrafer -agréable -agrume -aider -aiguille -ailier -aimable -aisance -ajouter -ajuster -alarmer -alchimie -alerte -algèbre -algue -aliéner -aliment -alléger -alliage -allouer -allumer -alourdir -alpaga -altesse -alvéole -amateur -ambigu -ambre -aménager -amertume -amidon -amiral -amorcer -amour -amovible -amphibie -ampleur -amusant -analyse -anaphore -anarchie -anatomie -ancien -anéantir -angle -angoisse -anguleux -animal -annexer -annonce -annuel -anodin -anomalie -anonyme -anormal -antenne -antidote -anxieux -apaiser -apéritif -aplanir -apologie -appareil -appeler -apporter -appuyer -aquarium -aqueduc -arbitre -arbuste -ardeur -ardoise -argent -arlequin -armature -armement -armoire -armure -arpenter -arracher -arriver -arroser -arsenic -artériel -article -aspect -asphalte -aspirer -assaut -asservir -assiette -associer -assurer -asticot -astre -astuce -atelier -atome -atrium -atroce -attaque -attentif -attirer -attraper -aubaine -auberge -audace -audible -augurer -aurore -automne -autruche -avaler -avancer -avarice -avenir -averse -aveugle -aviateur -avide -avion -aviser -avoine -avouer -avril -axial -axiome -badge -bafouer -bagage -baguette -baignade -balancer -balcon -baleine -balisage -bambin -bancaire -bandage -banlieue -bannière -banquier -barbier -baril -baron -barque -barrage -bassin -bastion -bataille -bateau -batterie -baudrier -bavarder -belette -bélier -belote -bénéfice -berceau -berger -berline -bermuda -besace -besogne -bétail -beurre -biberon -bicycle -bidule -bijou -bilan -bilingue -billard -binaire -biologie -biopsie -biotype -biscuit -bison -bistouri -bitume -bizarre -blafard -blague -blanchir -blessant -blinder -blond -bloquer -blouson -bobard -bobine -boire -boiser -bolide -bonbon -bondir -bonheur -bonifier -bonus -bordure -borne -botte -boucle -boueux -bougie -boulon -bouquin -bourse -boussole -boutique -boxeur -branche -brasier -brave -brebis -brèche -breuvage -bricoler -brigade -brillant -brioche -brique -brochure -broder -bronzer -brousse -broyeur -brume -brusque -brutal -bruyant -buffle -buisson -bulletin -bureau -burin -bustier -butiner -butoir -buvable -buvette -cabanon -cabine -cachette -cadeau -cadre -caféine -caillou -caisson -calculer -calepin -calibre -calmer -calomnie -calvaire -camarade -caméra -camion -campagne -canal -caneton -canon -cantine -canular -capable -caporal -caprice -capsule -capter -capuche -carabine -carbone -caresser -caribou -carnage -carotte -carreau -carton -cascade -casier -casque -cassure -causer -caution -cavalier -caverne -caviar -cédille -ceinture -céleste -cellule -cendrier -censurer -central -cercle -cérébral -cerise -cerner -cerveau -cesser -chagrin -chaise -chaleur -chambre -chance -chapitre -charbon -chasseur -chaton -chausson -chavirer -chemise -chenille -chéquier -chercher -cheval -chien -chiffre -chignon -chimère -chiot -chlorure -chocolat -choisir -chose -chouette -chrome -chute -cigare -cigogne -cimenter -cinéma -cintrer -circuler -cirer -cirque -citerne -citoyen -citron -civil -clairon -clameur -claquer -classe -clavier -client -cligner -climat -clivage -cloche -clonage -cloporte -cobalt -cobra -cocasse -cocotier -coder -codifier -coffre -cogner -cohésion -coiffer -coincer -colère -colibri -colline -colmater -colonel -combat -comédie -commande -compact -concert -conduire -confier -congeler -connoter -consonne -contact -convexe -copain -copie -corail -corbeau -cordage -corniche -corpus -correct -cortège -cosmique -costume -coton -coude -coupure -courage -couteau -couvrir -coyote -crabe -crainte -cravate -crayon -créature -créditer -crémeux -creuser -crevette -cribler -crier -cristal -critère -croire -croquer -crotale -crucial -cruel -crypter -cubique -cueillir -cuillère -cuisine -cuivre -culminer -cultiver -cumuler -cupide -curatif -curseur -cyanure -cycle -cylindre -cynique -daigner -damier -danger -danseur -dauphin -débattre -débiter -déborder -débrider -débutant -décaler -décembre -déchirer -décider -déclarer -décorer -décrire -décupler -dédale -déductif -déesse -défensif -défiler -défrayer -dégager -dégivrer -déglutir -dégrafer -déjeuner -délice -déloger -demander -demeurer -démolir -dénicher -dénouer -dentelle -dénuder -départ -dépenser -déphaser -déplacer -déposer -déranger -dérober -désastre -descente -désert -désigner -désobéir -dessiner -destrier -détacher -détester -détourer -détresse -devancer -devenir -deviner -devoir -diable -dialogue -diamant -dicter -différer -digérer -digital -digne -diluer -dimanche -diminuer -dioxyde -directif -diriger -discuter -disposer -dissiper -distance -divertir -diviser -docile -docteur -dogme -doigt -domaine -domicile -dompter -donateur -donjon -donner -dopamine -dortoir -dorure -dosage -doseur -dossier -dotation -douanier -double -douceur -douter -doyen -dragon -draper -dresser -dribbler -droiture -duperie -duplexe -durable -durcir -dynastie -éblouir -écarter -écharpe -échelle -éclairer -éclipse -éclore -écluse -école -économie -écorce -écouter -écraser -écrémer -écrivain -écrou -écume -écureuil -édifier -éduquer -effacer -effectif -effigie -effort -effrayer -effusion -égaliser -égarer -éjecter -élaborer -élargir -électron -élégant -éléphant -élève -éligible -élitisme -éloge -élucider -éluder -emballer -embellir -embryon -émeraude -émission -emmener -émotion -émouvoir -empereur -employer -emporter -emprise -émulsion -encadrer -enchère -enclave -encoche -endiguer -endosser -endroit -enduire -énergie -enfance -enfermer -enfouir -engager -engin -englober -énigme -enjamber -enjeu -enlever -ennemi -ennuyeux -enrichir -enrobage -enseigne -entasser -entendre -entier -entourer -entraver -énumérer -envahir -enviable -envoyer -enzyme -éolien -épaissir -épargne -épatant -épaule -épicerie -épidémie -épier -épilogue -épine -épisode -épitaphe -époque -épreuve -éprouver -épuisant -équerre -équipe -ériger -érosion -erreur -éruption -escalier -espadon -espèce -espiègle -espoir -esprit -esquiver -essayer -essence -essieu -essorer -estime -estomac -estrade -étagère -étaler -étanche -étatique -éteindre -étendoir -éternel -éthanol -éthique -ethnie -étirer -étoffer -étoile -étonnant -étourdir -étrange -étroit -étude -euphorie -évaluer -évasion -éventail -évidence -éviter -évolutif -évoquer -exact -exagérer -exaucer -exceller -excitant -exclusif -excuse -exécuter -exemple -exercer -exhaler -exhorter -exigence -exiler -exister -exotique -expédier -explorer -exposer -exprimer -exquis -extensif -extraire -exulter -fable -fabuleux -facette -facile -facture -faiblir -falaise -fameux -famille -farceur -farfelu -farine -farouche -fasciner -fatal -fatigue -faucon -fautif -faveur -favori -fébrile -féconder -fédérer -félin -femme -fémur -fendoir -féodal -fermer -féroce -ferveur -festival -feuille -feutre -février -fiasco -ficeler -fictif -fidèle -figure -filature -filetage -filière -filleul -filmer -filou -filtrer -financer -finir -fiole -firme -fissure -fixer -flairer -flamme -flasque -flatteur -fléau -flèche -fleur -flexion -flocon -flore -fluctuer -fluide -fluvial -folie -fonderie -fongible -fontaine -forcer -forgeron -formuler -fortune -fossile -foudre -fougère -fouiller -foulure -fourmi -fragile -fraise -franchir -frapper -frayeur -frégate -freiner -frelon -frémir -frénésie -frère -friable -friction -frisson -frivole -froid -fromage -frontal -frotter -fruit -fugitif -fuite -fureur -furieux -furtif -fusion -futur -gagner -galaxie -galerie -gambader -garantir -gardien -garnir -garrigue -gazelle -gazon -géant -gélatine -gélule -gendarme -général -génie -genou -gentil -géologie -géomètre -géranium -germe -gestuel -geyser -gibier -gicler -girafe -givre -glace -glaive -glisser -globe -gloire -glorieux -golfeur -gomme -gonfler -gorge -gorille -goudron -gouffre -goulot -goupille -gourmand -goutte -graduel -graffiti -graine -grand -grappin -gratuit -gravir -grenat -griffure -griller -grimper -grogner -gronder -grotte -groupe -gruger -grutier -gruyère -guépard -guerrier -guide -guimauve -guitare -gustatif -gymnaste -gyrostat -habitude -hachoir -halte -hameau -hangar -hanneton -haricot -harmonie -harpon -hasard -hélium -hématome -herbe -hérisson -hermine -héron -hésiter -heureux -hiberner -hibou -hilarant -histoire -hiver -homard -hommage -homogène -honneur -honorer -honteux -horde -horizon -horloge -hormone -horrible -houleux -housse -hublot -huileux -humain -humble -humide -humour -hurler -hydromel -hygiène -hymne -hypnose -idylle -ignorer -iguane -illicite -illusion -image -imbiber -imiter -immense -immobile -immuable -impact -impérial -implorer -imposer -imprimer -imputer -incarner -incendie -incident -incliner -incolore -indexer -indice -inductif -inédit -ineptie -inexact -infini -infliger -informer -infusion -ingérer -inhaler -inhiber -injecter -injure -innocent -inoculer -inonder -inscrire -insecte -insigne -insolite -inspirer -instinct -insulter -intact -intense -intime -intrigue -intuitif -inutile -invasion -inventer -inviter -invoquer -ironique -irradier -irréel -irriter -isoler -ivoire -ivresse -jaguar -jaillir -jambe -janvier -jardin -jauger -jaune -javelot -jetable -jeton -jeudi -jeunesse -joindre -joncher -jongler -joueur -jouissif -journal -jovial -joyau -joyeux -jubiler -jugement -junior -jupon -juriste -justice -juteux -juvénile -kayak -kimono -kiosque -label -labial -labourer -lacérer -lactose -lagune -laine -laisser -laitier -lambeau -lamelle -lampe -lanceur -langage -lanterne -lapin -largeur -larme -laurier -lavabo -lavoir -lecture -légal -léger -légume -lessive -lettre -levier -lexique -lézard -liasse -libérer -libre -licence -licorne -liège -lièvre -ligature -ligoter -ligue -limer -limite -limonade -limpide -linéaire -lingot -lionceau -liquide -lisière -lister -lithium -litige -littoral -livreur -logique -lointain -loisir -lombric -loterie -louer -lourd -loutre -louve -loyal -lubie -lucide -lucratif -lueur -lugubre -luisant -lumière -lunaire -lundi -luron -lutter -luxueux -machine -magasin -magenta -magique -maigre -maillon -maintien -mairie -maison -majorer -malaxer -maléfice -malheur -malice -mallette -mammouth -mandater -maniable -manquant -manteau -manuel -marathon -marbre -marchand -mardi -maritime -marqueur -marron -marteler -mascotte -massif -matériel -matière -matraque -maudire -maussade -mauve -maximal -méchant -méconnu -médaille -médecin -méditer -méduse -meilleur -mélange -mélodie -membre -mémoire -menacer -mener -menhir -mensonge -mentor -mercredi -mérite -merle -messager -mesure -métal -météore -méthode -métier -meuble -miauler -microbe -miette -mignon -migrer -milieu -million -mimique -mince -minéral -minimal -minorer -minute -miracle -miroiter -missile -mixte -mobile -moderne -moelleux -mondial -moniteur -monnaie -monotone -monstre -montagne -monument -moqueur -morceau -morsure -mortier -moteur -motif -mouche -moufle -moulin -mousson -mouton -mouvant -multiple -munition -muraille -murène -murmure -muscle -muséum -musicien -mutation -muter -mutuel -myriade -myrtille -mystère -mythique -nageur -nappe -narquois -narrer -natation -nation -nature -naufrage -nautique -navire -nébuleux -nectar -néfaste -négation -négliger -négocier -neige -nerveux -nettoyer -neurone -neutron -neveu -niche -nickel -nitrate -niveau -noble -nocif -nocturne -noirceur -noisette -nomade -nombreux -nommer -normatif -notable -notifier -notoire -nourrir -nouveau -novateur -novembre -novice -nuage -nuancer -nuire -nuisible -numéro -nuptial -nuque -nutritif -obéir -objectif -obliger -obscur -observer -obstacle -obtenir -obturer -occasion -occuper -océan -octobre -octroyer -octupler -oculaire -odeur -odorant -offenser -officier -offrir -ogive -oiseau -oisillon -olfactif -olivier -ombrage -omettre -onctueux -onduler -onéreux -onirique -opale -opaque -opérer -opinion -opportun -opprimer -opter -optique -orageux -orange -orbite -ordonner -oreille -organe -orgueil -orifice -ornement -orque -ortie -osciller -osmose -ossature -otarie -ouragan -ourson -outil -outrager -ouvrage -ovation -oxyde -oxygène -ozone -paisible -palace -palmarès -palourde -palper -panache -panda -pangolin -paniquer -panneau -panorama -pantalon -papaye -papier -papoter -papyrus -paradoxe -parcelle -paresse -parfumer -parler -parole -parrain -parsemer -partager -parure -parvenir -passion -pastèque -paternel -patience -patron -pavillon -pavoiser -payer -paysage -peigne -peintre -pelage -pélican -pelle -pelouse -peluche -pendule -pénétrer -pénible -pensif -pénurie -pépite -péplum -perdrix -perforer -période -permuter -perplexe -persil -perte -peser -pétale -petit -pétrir -peuple -pharaon -phobie -phoque -photon -phrase -physique -piano -pictural -pièce -pierre -pieuvre -pilote -pinceau -pipette -piquer -pirogue -piscine -piston -pivoter -pixel -pizza -placard -plafond -plaisir -planer -plaque -plastron -plateau -pleurer -plexus -pliage -plomb -plonger -pluie -plumage -pochette -poésie -poète -pointe -poirier -poisson -poivre -polaire -policier -pollen -polygone -pommade -pompier -ponctuel -pondérer -poney -portique -position -posséder -posture -potager -poteau -potion -pouce -poulain -poumon -pourpre -poussin -pouvoir -prairie -pratique -précieux -prédire -préfixe -prélude -prénom -présence -prétexte -prévoir -primitif -prince -prison -priver -problème -procéder -prodige -profond -progrès -proie -projeter -prologue -promener -propre -prospère -protéger -prouesse -proverbe -prudence -pruneau -psychose -public -puceron -puiser -pulpe -pulsar -punaise -punitif -pupitre -purifier -puzzle -pyramide -quasar -querelle -question -quiétude -quitter -quotient -racine -raconter -radieux -ragondin -raideur -raisin -ralentir -rallonge -ramasser -rapide -rasage -ratisser -ravager -ravin -rayonner -réactif -réagir -réaliser -réanimer -recevoir -réciter -réclamer -récolter -recruter -reculer -recycler -rédiger -redouter -refaire -réflexe -réformer -refrain -refuge -régalien -région -réglage -régulier -réitérer -rejeter -rejouer -relatif -relever -relief -remarque -remède -remise -remonter -remplir -remuer -renard -renfort -renifler -renoncer -rentrer -renvoi -replier -reporter -reprise -reptile -requin -réserve -résineux -résoudre -respect -rester -résultat -rétablir -retenir -réticule -retomber -retracer -réunion -réussir -revanche -revivre -révolte -révulsif -richesse -rideau -rieur -rigide -rigoler -rincer -riposter -risible -risque -rituel -rival -rivière -rocheux -romance -rompre -ronce -rondin -roseau -rosier -rotatif -rotor -rotule -rouge -rouille -rouleau -routine -royaume -ruban -rubis -ruche -ruelle -rugueux -ruiner -ruisseau -ruser -rustique -rythme -sabler -saboter -sabre -sacoche -safari -sagesse -saisir -salade -salive -salon -saluer -samedi -sanction -sanglier -sarcasme -sardine -saturer -saugrenu -saumon -sauter -sauvage -savant -savonner -scalpel -scandale -scélérat -scénario -sceptre -schéma -science -scinder -score -scrutin -sculpter -séance -sécable -sécher -secouer -sécréter -sédatif -séduire -seigneur -séjour -sélectif -semaine -sembler -semence -séminal -sénateur -sensible -sentence -séparer -séquence -serein -sergent -sérieux -serrure -sérum -service -sésame -sévir -sevrage -sextuple -sidéral -siècle -siéger -siffler -sigle -signal -silence -silicium -simple -sincère -sinistre -siphon -sirop -sismique -situer -skier -social -socle -sodium -soigneux -soldat -soleil -solitude -soluble -sombre -sommeil -somnoler -sonde -songeur -sonnette -sonore -sorcier -sortir -sosie -sottise -soucieux -soudure -souffle -soulever -soupape -source -soutirer -souvenir -spacieux -spatial -spécial -sphère -spiral -stable -station -sternum -stimulus -stipuler -strict -studieux -stupeur -styliste -sublime -substrat -subtil -subvenir -succès -sucre -suffixe -suggérer -suiveur -sulfate -superbe -supplier -surface -suricate -surmener -surprise -sursaut -survie -suspect -syllabe -symbole -symétrie -synapse -syntaxe -système -tabac -tablier -tactile -tailler -talent -talisman -talonner -tambour -tamiser -tangible -tapis -taquiner -tarder -tarif -tartine -tasse -tatami -tatouage -taupe -taureau -taxer -témoin -temporel -tenaille -tendre -teneur -tenir -tension -terminer -terne -terrible -tétine -texte -thème -théorie -thérapie -thorax -tibia -tiède -timide -tirelire -tiroir -tissu -titane -titre -tituber -toboggan -tolérant -tomate -tonique -tonneau -toponyme -torche -tordre -tornade -torpille -torrent -torse -tortue -totem -toucher -tournage -tousser -toxine -traction -trafic -tragique -trahir -train -trancher -travail -trèfle -tremper -trésor -treuil -triage -tribunal -tricoter -trilogie -triomphe -tripler -triturer -trivial -trombone -tronc -tropical -troupeau -tuile -tulipe -tumulte -tunnel -turbine -tuteur -tutoyer -tuyau -tympan -typhon -typique -tyran -ubuesque -ultime -ultrason -unanime -unifier -union -unique -unitaire -univers -uranium -urbain -urticant -usage -usine -usuel -usure -utile -utopie -vacarme -vaccin -vagabond -vague -vaillant -vaincre -vaisseau -valable -valise -vallon -valve -vampire -vanille -vapeur -varier -vaseux -vassal -vaste -vecteur -vedette -végétal -véhicule -veinard -véloce -vendredi -vénérer -venger -venimeux -ventouse -verdure -vérin -vernir -verrou -verser -vertu -veston -vétéran -vétuste -vexant -vexer -viaduc -viande -victoire -vidange -vidéo -vignette -vigueur -vilain -village -vinaigre -violon -vipère -virement -virtuose -virus -visage -viseur -vision -visqueux -visuel -vital -vitesse -viticole -vitrine -vivace -vivipare -vocation -voguer -voile -voisin -voiture -volaille -volcan -voltiger -volume -vorace -vortex -voter -vouloir -voyage -voyelle -wagon -xénon -yacht -zèbre -zénith -zeste -zoologie`.split('\n'); diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/italian.d.ts b/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/italian.d.ts deleted file mode 100644 index b566a1db..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/italian.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const wordlist: string[]; diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/italian.js b/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/italian.js deleted file mode 100644 index 7eabb0e4..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/italian.js +++ /dev/null @@ -1,2051 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.wordlist = void 0; -exports.wordlist = `abaco -abbaglio -abbinato -abete -abisso -abolire -abrasivo -abrogato -accadere -accenno -accusato -acetone -achille -acido -acqua -acre -acrilico -acrobata -acuto -adagio -addebito -addome -adeguato -aderire -adipe -adottare -adulare -affabile -affetto -affisso -affranto -aforisma -afoso -africano -agave -agente -agevole -aggancio -agire -agitare -agonismo -agricolo -agrumeto -aguzzo -alabarda -alato -albatro -alberato -albo -albume -alce -alcolico -alettone -alfa -algebra -aliante -alibi -alimento -allagato -allegro -allievo -allodola -allusivo -almeno -alogeno -alpaca -alpestre -altalena -alterno -alticcio -altrove -alunno -alveolo -alzare -amalgama -amanita -amarena -ambito -ambrato -ameba -america -ametista -amico -ammasso -ammenda -ammirare -ammonito -amore -ampio -ampliare -amuleto -anacardo -anagrafe -analista -anarchia -anatra -anca -ancella -ancora -andare -andrea -anello -angelo -angolare -angusto -anima -annegare -annidato -anno -annuncio -anonimo -anticipo -anzi -apatico -apertura -apode -apparire -appetito -appoggio -approdo -appunto -aprile -arabica -arachide -aragosta -araldica -arancio -aratura -arazzo -arbitro -archivio -ardito -arenile -argento -argine -arguto -aria -armonia -arnese -arredato -arringa -arrosto -arsenico -arso -artefice -arzillo -asciutto -ascolto -asepsi -asettico -asfalto -asino -asola -aspirato -aspro -assaggio -asse -assoluto -assurdo -asta -astenuto -astice -astratto -atavico -ateismo -atomico -atono -attesa -attivare -attorno -attrito -attuale -ausilio -austria -autista -autonomo -autunno -avanzato -avere -avvenire -avviso -avvolgere -azione -azoto -azzimo -azzurro -babele -baccano -bacino -baco -badessa -badilata -bagnato -baita -balcone -baldo -balena -ballata -balzano -bambino -bandire -baraonda -barbaro -barca -baritono -barlume -barocco -basilico -basso -batosta -battuto -baule -bava -bavosa -becco -beffa -belgio -belva -benda -benevole -benigno -benzina -bere -berlina -beta -bibita -bici -bidone -bifido -biga -bilancia -bimbo -binocolo -biologo -bipede -bipolare -birbante -birra -biscotto -bisesto -bisnonno -bisonte -bisturi -bizzarro -blando -blatta -bollito -bonifico -bordo -bosco -botanico -bottino -bozzolo -braccio -bradipo -brama -branca -bravura -bretella -brevetto -brezza -briglia -brillante -brindare -broccolo -brodo -bronzina -brullo -bruno -bubbone -buca -budino -buffone -buio -bulbo -buono -burlone -burrasca -bussola -busta -cadetto -caduco -calamaro -calcolo -calesse -calibro -calmo -caloria -cambusa -camerata -camicia -cammino -camola -campale -canapa -candela -cane -canino -canotto -cantina -capace -capello -capitolo -capogiro -cappero -capra -capsula -carapace -carcassa -cardo -carisma -carovana -carretto -cartolina -casaccio -cascata -caserma -caso -cassone -castello -casuale -catasta -catena -catrame -cauto -cavillo -cedibile -cedrata -cefalo -celebre -cellulare -cena -cenone -centesimo -ceramica -cercare -certo -cerume -cervello -cesoia -cespo -ceto -chela -chiaro -chicca -chiedere -chimera -china -chirurgo -chitarra -ciao -ciclismo -cifrare -cigno -cilindro -ciottolo -circa -cirrosi -citrico -cittadino -ciuffo -civetta -civile -classico -clinica -cloro -cocco -codardo -codice -coerente -cognome -collare -colmato -colore -colposo -coltivato -colza -coma -cometa -commando -comodo -computer -comune -conciso -condurre -conferma -congelare -coniuge -connesso -conoscere -consumo -continuo -convegno -coperto -copione -coppia -copricapo -corazza -cordata -coricato -cornice -corolla -corpo -corredo -corsia -cortese -cosmico -costante -cottura -covato -cratere -cravatta -creato -credere -cremoso -crescita -creta -criceto -crinale -crisi -critico -croce -cronaca -crostata -cruciale -crusca -cucire -cuculo -cugino -cullato -cupola -curatore -cursore -curvo -cuscino -custode -dado -daino -dalmata -damerino -daniela -dannoso -danzare -datato -davanti -davvero -debutto -decennio -deciso -declino -decollo -decreto -dedicato -definito -deforme -degno -delegare -delfino -delirio -delta -demenza -denotato -dentro -deposito -derapata -derivare -deroga -descritto -deserto -desiderio -desumere -detersivo -devoto -diametro -dicembre -diedro -difeso -diffuso -digerire -digitale -diluvio -dinamico -dinnanzi -dipinto -diploma -dipolo -diradare -dire -dirotto -dirupo -disagio -discreto -disfare -disgelo -disposto -distanza -disumano -dito -divano -divelto -dividere -divorato -doblone -docente -doganale -dogma -dolce -domato -domenica -dominare -dondolo -dono -dormire -dote -dottore -dovuto -dozzina -drago -druido -dubbio -dubitare -ducale -duna -duomo -duplice -duraturo -ebano -eccesso -ecco -eclissi -economia -edera -edicola -edile -editoria -educare -egemonia -egli -egoismo -egregio -elaborato -elargire -elegante -elencato -eletto -elevare -elfico -elica -elmo -elsa -eluso -emanato -emblema -emesso -emiro -emotivo -emozione -empirico -emulo -endemico -enduro -energia -enfasi -enoteca -entrare -enzima -epatite -epilogo -episodio -epocale -eppure -equatore -erario -erba -erboso -erede -eremita -erigere -ermetico -eroe -erosivo -errante -esagono -esame -esanime -esaudire -esca -esempio -esercito -esibito -esigente -esistere -esito -esofago -esortato -esoso -espanso -espresso -essenza -esso -esteso -estimare -estonia -estroso -esultare -etilico -etnico -etrusco -etto -euclideo -europa -evaso -evidenza -evitato -evoluto -evviva -fabbrica -faccenda -fachiro -falco -famiglia -fanale -fanfara -fango -fantasma -fare -farfalla -farinoso -farmaco -fascia -fastoso -fasullo -faticare -fato -favoloso -febbre -fecola -fede -fegato -felpa -feltro -femmina -fendere -fenomeno -fermento -ferro -fertile -fessura -festivo -fetta -feudo -fiaba -fiducia -fifa -figurato -filo -finanza -finestra -finire -fiore -fiscale -fisico -fiume -flacone -flamenco -flebo -flemma -florido -fluente -fluoro -fobico -focaccia -focoso -foderato -foglio -folata -folclore -folgore -fondente -fonetico -fonia -fontana -forbito -forchetta -foresta -formica -fornaio -foro -fortezza -forzare -fosfato -fosso -fracasso -frana -frassino -fratello -freccetta -frenata -fresco -frigo -frollino -fronde -frugale -frutta -fucilata -fucsia -fuggente -fulmine -fulvo -fumante -fumetto -fumoso -fune -funzione -fuoco -furbo -furgone -furore -fuso -futile -gabbiano -gaffe -galateo -gallina -galoppo -gambero -gamma -garanzia -garbo -garofano -garzone -gasdotto -gasolio -gastrico -gatto -gaudio -gazebo -gazzella -geco -gelatina -gelso -gemello -gemmato -gene -genitore -gennaio -genotipo -gergo -ghepardo -ghiaccio -ghisa -giallo -gilda -ginepro -giocare -gioiello -giorno -giove -girato -girone -gittata -giudizio -giurato -giusto -globulo -glutine -gnomo -gobba -golf -gomito -gommone -gonfio -gonna -governo -gracile -grado -grafico -grammo -grande -grattare -gravoso -grazia -greca -gregge -grifone -grigio -grinza -grotta -gruppo -guadagno -guaio -guanto -guardare -gufo -guidare -ibernato -icona -identico -idillio -idolo -idra -idrico -idrogeno -igiene -ignaro -ignorato -ilare -illeso -illogico -illudere -imballo -imbevuto -imbocco -imbuto -immane -immerso -immolato -impacco -impeto -impiego -importo -impronta -inalare -inarcare -inattivo -incanto -incendio -inchino -incisivo -incluso -incontro -incrocio -incubo -indagine -india -indole -inedito -infatti -infilare -inflitto -ingaggio -ingegno -inglese -ingordo -ingrosso -innesco -inodore -inoltrare -inondato -insano -insetto -insieme -insonnia -insulina -intasato -intero -intonaco -intuito -inumidire -invalido -invece -invito -iperbole -ipnotico -ipotesi -ippica -iride -irlanda -ironico -irrigato -irrorare -isolato -isotopo -isterico -istituto -istrice -italia -iterare -labbro -labirinto -lacca -lacerato -lacrima -lacuna -laddove -lago -lampo -lancetta -lanterna -lardoso -larga -laringe -lastra -latenza -latino -lattuga -lavagna -lavoro -legale -leggero -lembo -lentezza -lenza -leone -lepre -lesivo -lessato -lesto -letterale -leva -levigato -libero -lido -lievito -lilla -limatura -limitare -limpido -lineare -lingua -liquido -lira -lirica -lisca -lite -litigio -livrea -locanda -lode -logica -lombare -londra -longevo -loquace -lorenzo -loto -lotteria -luce -lucidato -lumaca -luminoso -lungo -lupo -luppolo -lusinga -lusso -lutto -macabro -macchina -macero -macinato -madama -magico -maglia -magnete -magro -maiolica -malafede -malgrado -malinteso -malsano -malto -malumore -mana -mancia -mandorla -mangiare -manifesto -mannaro -manovra -mansarda -mantide -manubrio -mappa -maratona -marcire -maretta -marmo -marsupio -maschera -massaia -mastino -materasso -matricola -mattone -maturo -mazurca -meandro -meccanico -mecenate -medesimo -meditare -mega -melassa -melis -melodia -meninge -meno -mensola -mercurio -merenda -merlo -meschino -mese -messere -mestolo -metallo -metodo -mettere -miagolare -mica -micelio -michele -microbo -midollo -miele -migliore -milano -milite -mimosa -minerale -mini -minore -mirino -mirtillo -miscela -missiva -misto -misurare -mitezza -mitigare -mitra -mittente -mnemonico -modello -modifica -modulo -mogano -mogio -mole -molosso -monastero -monco -mondina -monetario -monile -monotono -monsone -montato -monviso -mora -mordere -morsicato -mostro -motivato -motosega -motto -movenza -movimento -mozzo -mucca -mucosa -muffa -mughetto -mugnaio -mulatto -mulinello -multiplo -mummia -munto -muovere -murale -musa -muscolo -musica -mutevole -muto -nababbo -nafta -nanometro -narciso -narice -narrato -nascere -nastrare -naturale -nautica -naviglio -nebulosa -necrosi -negativo -negozio -nemmeno -neofita -neretto -nervo -nessuno -nettuno -neutrale -neve -nevrotico -nicchia -ninfa -nitido -nobile -nocivo -nodo -nome -nomina -nordico -normale -norvegese -nostrano -notare -notizia -notturno -novella -nucleo -nulla -numero -nuovo -nutrire -nuvola -nuziale -oasi -obbedire -obbligo -obelisco -oblio -obolo -obsoleto -occasione -occhio -occidente -occorrere -occultare -ocra -oculato -odierno -odorare -offerta -offrire -offuscato -oggetto -oggi -ognuno -olandese -olfatto -oliato -oliva -ologramma -oltre -omaggio -ombelico -ombra -omega -omissione -ondoso -onere -onice -onnivoro -onorevole -onta -operato -opinione -opposto -oracolo -orafo -ordine -orecchino -orefice -orfano -organico -origine -orizzonte -orma -ormeggio -ornativo -orologio -orrendo -orribile -ortensia -ortica -orzata -orzo -osare -oscurare -osmosi -ospedale -ospite -ossa -ossidare -ostacolo -oste -otite -otre -ottagono -ottimo -ottobre -ovale -ovest -ovino -oviparo -ovocito -ovunque -ovviare -ozio -pacchetto -pace -pacifico -padella -padrone -paese -paga -pagina -palazzina -palesare -pallido -palo -palude -pandoro -pannello -paolo -paonazzo -paprica -parabola -parcella -parere -pargolo -pari -parlato -parola -partire -parvenza -parziale -passivo -pasticca -patacca -patologia -pattume -pavone -peccato -pedalare -pedonale -peggio -peloso -penare -pendice -penisola -pennuto -penombra -pensare -pentola -pepe -pepita -perbene -percorso -perdonato -perforare -pergamena -periodo -permesso -perno -perplesso -persuaso -pertugio -pervaso -pesatore -pesista -peso -pestifero -petalo -pettine -petulante -pezzo -piacere -pianta -piattino -piccino -picozza -piega -pietra -piffero -pigiama -pigolio -pigro -pila -pilifero -pillola -pilota -pimpante -pineta -pinna -pinolo -pioggia -piombo -piramide -piretico -pirite -pirolisi -pitone -pizzico -placebo -planare -plasma -platano -plenario -pochezza -poderoso -podismo -poesia -poggiare -polenta -poligono -pollice -polmonite -polpetta -polso -poltrona -polvere -pomice -pomodoro -ponte -popoloso -porfido -poroso -porpora -porre -portata -posa -positivo -possesso -postulato -potassio -potere -pranzo -prassi -pratica -precluso -predica -prefisso -pregiato -prelievo -premere -prenotare -preparato -presenza -pretesto -prevalso -prima -principe -privato -problema -procura -produrre -profumo -progetto -prolunga -promessa -pronome -proposta -proroga -proteso -prova -prudente -prugna -prurito -psiche -pubblico -pudica -pugilato -pugno -pulce -pulito -pulsante -puntare -pupazzo -pupilla -puro -quadro -qualcosa -quasi -querela -quota -raccolto -raddoppio -radicale -radunato -raffica -ragazzo -ragione -ragno -ramarro -ramingo -ramo -randagio -rantolare -rapato -rapina -rappreso -rasatura -raschiato -rasente -rassegna -rastrello -rata -ravveduto -reale -recepire -recinto -recluta -recondito -recupero -reddito -redimere -regalato -registro -regola -regresso -relazione -remare -remoto -renna -replica -reprimere -reputare -resa -residente -responso -restauro -rete -retina -retorica -rettifica -revocato -riassunto -ribadire -ribelle -ribrezzo -ricarica -ricco -ricevere -riciclato -ricordo -ricreduto -ridicolo -ridurre -rifasare -riflesso -riforma -rifugio -rigare -rigettato -righello -rilassato -rilevato -rimanere -rimbalzo -rimedio -rimorchio -rinascita -rincaro -rinforzo -rinnovo -rinomato -rinsavito -rintocco -rinuncia -rinvenire -riparato -ripetuto -ripieno -riportare -ripresa -ripulire -risata -rischio -riserva -risibile -riso -rispetto -ristoro -risultato -risvolto -ritardo -ritegno -ritmico -ritrovo -riunione -riva -riverso -rivincita -rivolto -rizoma -roba -robotico -robusto -roccia -roco -rodaggio -rodere -roditore -rogito -rollio -romantico -rompere -ronzio -rosolare -rospo -rotante -rotondo -rotula -rovescio -rubizzo -rubrica -ruga -rullino -rumine -rumoroso -ruolo -rupe -russare -rustico -sabato -sabbiare -sabotato -sagoma -salasso -saldatura -salgemma -salivare -salmone -salone -saltare -saluto -salvo -sapere -sapido -saporito -saraceno -sarcasmo -sarto -sassoso -satellite -satira -satollo -saturno -savana -savio -saziato -sbadiglio -sbalzo -sbancato -sbarra -sbattere -sbavare -sbendare -sbirciare -sbloccato -sbocciato -sbrinare -sbruffone -sbuffare -scabroso -scadenza -scala -scambiare -scandalo -scapola -scarso -scatenare -scavato -scelto -scenico -scettro -scheda -schiena -sciarpa -scienza -scindere -scippo -sciroppo -scivolo -sclerare -scodella -scolpito -scomparto -sconforto -scoprire -scorta -scossone -scozzese -scriba -scrollare -scrutinio -scuderia -scultore -scuola -scuro -scusare -sdebitare -sdoganare -seccatura -secondo -sedano -seggiola -segnalato -segregato -seguito -selciato -selettivo -sella -selvaggio -semaforo -sembrare -seme -seminato -sempre -senso -sentire -sepolto -sequenza -serata -serbato -sereno -serio -serpente -serraglio -servire -sestina -setola -settimana -sfacelo -sfaldare -sfamato -sfarzoso -sfaticato -sfera -sfida -sfilato -sfinge -sfocato -sfoderare -sfogo -sfoltire -sforzato -sfratto -sfruttato -sfuggito -sfumare -sfuso -sgabello -sgarbato -sgonfiare -sgorbio -sgrassato -sguardo -sibilo -siccome -sierra -sigla -signore -silenzio -sillaba -simbolo -simpatico -simulato -sinfonia -singolo -sinistro -sino -sintesi -sinusoide -sipario -sisma -sistole -situato -slitta -slogatura -sloveno -smarrito -smemorato -smentito -smeraldo -smilzo -smontare -smottato -smussato -snellire -snervato -snodo -sobbalzo -sobrio -soccorso -sociale -sodale -soffitto -sogno -soldato -solenne -solido -sollazzo -solo -solubile -solvente -somatico -somma -sonda -sonetto -sonnifero -sopire -soppeso -sopra -sorgere -sorpasso -sorriso -sorso -sorteggio -sorvolato -sospiro -sosta -sottile -spada -spalla -spargere -spatola -spavento -spazzola -specie -spedire -spegnere -spelatura -speranza -spessore -spettrale -spezzato -spia -spigoloso -spillato -spinoso -spirale -splendido -sportivo -sposo -spranga -sprecare -spronato -spruzzo -spuntino -squillo -sradicare -srotolato -stabile -stacco -staffa -stagnare -stampato -stantio -starnuto -stasera -statuto -stelo -steppa -sterzo -stiletto -stima -stirpe -stivale -stizzoso -stonato -storico -strappo -stregato -stridulo -strozzare -strutto -stuccare -stufo -stupendo -subentro -succoso -sudore -suggerito -sugo -sultano -suonare -superbo -supporto -surgelato -surrogato -sussurro -sutura -svagare -svedese -sveglio -svelare -svenuto -svezia -sviluppo -svista -svizzera -svolta -svuotare -tabacco -tabulato -tacciare -taciturno -tale -talismano -tampone -tannino -tara -tardivo -targato -tariffa -tarpare -tartaruga -tasto -tattico -taverna -tavolata -tazza -teca -tecnico -telefono -temerario -tempo -temuto -tendone -tenero -tensione -tentacolo -teorema -terme -terrazzo -terzetto -tesi -tesserato -testato -tetro -tettoia -tifare -tigella -timbro -tinto -tipico -tipografo -tiraggio -tiro -titanio -titolo -titubante -tizio -tizzone -toccare -tollerare -tolto -tombola -tomo -tonfo -tonsilla -topazio -topologia -toppa -torba -tornare -torrone -tortora -toscano -tossire -tostatura -totano -trabocco -trachea -trafila -tragedia -tralcio -tramonto -transito -trapano -trarre -trasloco -trattato -trave -treccia -tremolio -trespolo -tributo -tricheco -trifoglio -trillo -trincea -trio -tristezza -triturato -trivella -tromba -trono -troppo -trottola -trovare -truccato -tubatura -tuffato -tulipano -tumulto -tunisia -turbare -turchino -tuta -tutela -ubicato -uccello -uccisore -udire -uditivo -uffa -ufficio -uguale -ulisse -ultimato -umano -umile -umorismo -uncinetto -ungere -ungherese -unicorno -unificato -unisono -unitario -unte -uovo -upupa -uragano -urgenza -urlo -usanza -usato -uscito -usignolo -usuraio -utensile -utilizzo -utopia -vacante -vaccinato -vagabondo -vagliato -valanga -valgo -valico -valletta -valoroso -valutare -valvola -vampata -vangare -vanitoso -vano -vantaggio -vanvera -vapore -varano -varcato -variante -vasca -vedetta -vedova -veduto -vegetale -veicolo -velcro -velina -velluto -veloce -venato -vendemmia -vento -verace -verbale -vergogna -verifica -vero -verruca -verticale -vescica -vessillo -vestale -veterano -vetrina -vetusto -viandante -vibrante -vicenda -vichingo -vicinanza -vidimare -vigilia -vigneto -vigore -vile -villano -vimini -vincitore -viola -vipera -virgola -virologo -virulento -viscoso -visione -vispo -vissuto -visura -vita -vitello -vittima -vivanda -vivido -viziare -voce -voga -volatile -volere -volpe -voragine -vulcano -zampogna -zanna -zappato -zattera -zavorra -zefiro -zelante -zelo -zenzero -zerbino -zibetto -zinco -zircone -zitto -zolla -zotico -zucchero -zufolo -zulu -zuppa`.split('\n'); diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/japanese.d.ts b/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/japanese.d.ts deleted file mode 100644 index b566a1db..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/japanese.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const wordlist: string[]; diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/japanese.js b/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/japanese.js deleted file mode 100644 index 82eda6be..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/japanese.js +++ /dev/null @@ -1,2051 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.wordlist = void 0; -exports.wordlist = `あいこくしん -あいさつ -あいだ -あおぞら -あかちゃん -あきる -あけがた -あける -あこがれる -あさい -あさひ -あしあと -あじわう -あずかる -あずき -あそぶ -あたえる -あたためる -あたりまえ -あたる -あつい -あつかう -あっしゅく -あつまり -あつめる -あてな -あてはまる -あひる -あぶら -あぶる -あふれる -あまい -あまど -あまやかす -あまり -あみもの -あめりか -あやまる -あゆむ -あらいぐま -あらし -あらすじ -あらためる -あらゆる -あらわす -ありがとう -あわせる -あわてる -あんい -あんがい -あんこ -あんぜん -あんてい -あんない -あんまり -いいだす -いおん -いがい -いがく -いきおい -いきなり -いきもの -いきる -いくじ -いくぶん -いけばな -いけん -いこう -いこく -いこつ -いさましい -いさん -いしき -いじゅう -いじょう -いじわる -いずみ -いずれ -いせい -いせえび -いせかい -いせき -いぜん -いそうろう -いそがしい -いだい -いだく -いたずら -いたみ -いたりあ -いちおう -いちじ -いちど -いちば -いちぶ -いちりゅう -いつか -いっしゅん -いっせい -いっそう -いったん -いっち -いってい -いっぽう -いてざ -いてん -いどう -いとこ -いない -いなか -いねむり -いのち -いのる -いはつ -いばる -いはん -いびき -いひん -いふく -いへん -いほう -いみん -いもうと -いもたれ -いもり -いやがる -いやす -いよかん -いよく -いらい -いらすと -いりぐち -いりょう -いれい -いれもの -いれる -いろえんぴつ -いわい -いわう -いわかん -いわば -いわゆる -いんげんまめ -いんさつ -いんしょう -いんよう -うえき -うえる -うおざ -うがい -うかぶ -うかべる -うきわ -うくらいな -うくれれ -うけたまわる -うけつけ -うけとる -うけもつ -うける -うごかす -うごく -うこん -うさぎ -うしなう -うしろがみ -うすい -うすぎ -うすぐらい -うすめる -うせつ -うちあわせ -うちがわ -うちき -うちゅう -うっかり -うつくしい -うったえる -うつる -うどん -うなぎ -うなじ -うなずく -うなる -うねる -うのう -うぶげ -うぶごえ -うまれる -うめる -うもう -うやまう -うよく -うらがえす -うらぐち -うらない -うりあげ -うりきれ -うるさい -うれしい -うれゆき -うれる -うろこ -うわき -うわさ -うんこう -うんちん -うんてん -うんどう -えいえん -えいが -えいきょう -えいご -えいせい -えいぶん -えいよう -えいわ -えおり -えがお -えがく -えきたい -えくせる -えしゃく -えすて -えつらん -えのぐ -えほうまき -えほん -えまき -えもじ -えもの -えらい -えらぶ -えりあ -えんえん -えんかい -えんぎ -えんげき -えんしゅう -えんぜつ -えんそく -えんちょう -えんとつ -おいかける -おいこす -おいしい -おいつく -おうえん -おうさま -おうじ -おうせつ -おうたい -おうふく -おうべい -おうよう -おえる -おおい -おおう -おおどおり -おおや -おおよそ -おかえり -おかず -おがむ -おかわり -おぎなう -おきる -おくさま -おくじょう -おくりがな -おくる -おくれる -おこす -おこなう -おこる -おさえる -おさない -おさめる -おしいれ -おしえる -おじぎ -おじさん -おしゃれ -おそらく -おそわる -おたがい -おたく -おだやか -おちつく -おっと -おつり -おでかけ -おとしもの -おとなしい -おどり -おどろかす -おばさん -おまいり -おめでとう -おもいで -おもう -おもたい -おもちゃ -おやつ -おやゆび -およぼす -おらんだ -おろす -おんがく -おんけい -おんしゃ -おんせん -おんだん -おんちゅう -おんどけい -かあつ -かいが -がいき -がいけん -がいこう -かいさつ -かいしゃ -かいすいよく -かいぜん -かいぞうど -かいつう -かいてん -かいとう -かいふく -がいへき -かいほう -かいよう -がいらい -かいわ -かえる -かおり -かかえる -かがく -かがし -かがみ -かくご -かくとく -かざる -がぞう -かたい -かたち -がちょう -がっきゅう -がっこう -がっさん -がっしょう -かなざわし -かのう -がはく -かぶか -かほう -かほご -かまう -かまぼこ -かめれおん -かゆい -かようび -からい -かるい -かろう -かわく -かわら -がんか -かんけい -かんこう -かんしゃ -かんそう -かんたん -かんち -がんばる -きあい -きあつ -きいろ -ぎいん -きうい -きうん -きえる -きおう -きおく -きおち -きおん -きかい -きかく -きかんしゃ -ききて -きくばり -きくらげ -きけんせい -きこう -きこえる -きこく -きさい -きさく -きさま -きさらぎ -ぎじかがく -ぎしき -ぎじたいけん -ぎじにってい -ぎじゅつしゃ -きすう -きせい -きせき -きせつ -きそう -きぞく -きぞん -きたえる -きちょう -きつえん -ぎっちり -きつつき -きつね -きてい -きどう -きどく -きない -きなが -きなこ -きぬごし -きねん -きのう -きのした -きはく -きびしい -きひん -きふく -きぶん -きぼう -きほん -きまる -きみつ -きむずかしい -きめる -きもだめし -きもち -きもの -きゃく -きやく -ぎゅうにく -きよう -きょうりゅう -きらい -きらく -きりん -きれい -きれつ -きろく -ぎろん -きわめる -ぎんいろ -きんかくじ -きんじょ -きんようび -ぐあい -くいず -くうかん -くうき -くうぐん -くうこう -ぐうせい -くうそう -ぐうたら -くうふく -くうぼ -くかん -くきょう -くげん -ぐこう -くさい -くさき -くさばな -くさる -くしゃみ -くしょう -くすのき -くすりゆび -くせげ -くせん -ぐたいてき -くださる -くたびれる -くちこみ -くちさき -くつした -ぐっすり -くつろぐ -くとうてん -くどく -くなん -くねくね -くのう -くふう -くみあわせ -くみたてる -くめる -くやくしょ -くらす -くらべる -くるま -くれる -くろう -くわしい -ぐんかん -ぐんしょく -ぐんたい -ぐんて -けあな -けいかく -けいけん -けいこ -けいさつ -げいじゅつ -けいたい -げいのうじん -けいれき -けいろ -けおとす -けおりもの -げきか -げきげん -げきだん -げきちん -げきとつ -げきは -げきやく -げこう -げこくじょう -げざい -けさき -げざん -けしき -けしごむ -けしょう -げすと -けたば -けちゃっぷ -けちらす -けつあつ -けつい -けつえき -けっこん -けつじょ -けっせき -けってい -けつまつ -げつようび -げつれい -けつろん -げどく -けとばす -けとる -けなげ -けなす -けなみ -けぬき -げねつ -けねん -けはい -げひん -けぶかい -げぼく -けまり -けみかる -けむし -けむり -けもの -けらい -けろけろ -けわしい -けんい -けんえつ -けんお -けんか -げんき -けんげん -けんこう -けんさく -けんしゅう -けんすう -げんそう -けんちく -けんてい -けんとう -けんない -けんにん -げんぶつ -けんま -けんみん -けんめい -けんらん -けんり -こあくま -こいぬ -こいびと -ごうい -こうえん -こうおん -こうかん -ごうきゅう -ごうけい -こうこう -こうさい -こうじ -こうすい -ごうせい -こうそく -こうたい -こうちゃ -こうつう -こうてい -こうどう -こうない -こうはい -ごうほう -ごうまん -こうもく -こうりつ -こえる -こおり -ごかい -ごがつ -ごかん -こくご -こくさい -こくとう -こくない -こくはく -こぐま -こけい -こける -ここのか -こころ -こさめ -こしつ -こすう -こせい -こせき -こぜん -こそだて -こたい -こたえる -こたつ -こちょう -こっか -こつこつ -こつばん -こつぶ -こてい -こてん -ことがら -ことし -ことば -ことり -こなごな -こねこね -このまま -このみ -このよ -ごはん -こひつじ -こふう -こふん -こぼれる -ごまあぶら -こまかい -ごますり -こまつな -こまる -こむぎこ -こもじ -こもち -こもの -こもん -こやく -こやま -こゆう -こゆび -こよい -こよう -こりる -これくしょん -ころっけ -こわもて -こわれる -こんいん -こんかい -こんき -こんしゅう -こんすい -こんだて -こんとん -こんなん -こんびに -こんぽん -こんまけ -こんや -こんれい -こんわく -ざいえき -さいかい -さいきん -ざいげん -ざいこ -さいしょ -さいせい -ざいたく -ざいちゅう -さいてき -ざいりょう -さうな -さかいし -さがす -さかな -さかみち -さがる -さぎょう -さくし -さくひん -さくら -さこく -さこつ -さずかる -ざせき -さたん -さつえい -ざつおん -ざっか -ざつがく -さっきょく -ざっし -さつじん -ざっそう -さつたば -さつまいも -さてい -さといも -さとう -さとおや -さとし -さとる -さのう -さばく -さびしい -さべつ -さほう -さほど -さます -さみしい -さみだれ -さむけ -さめる -さやえんどう -さゆう -さよう -さよく -さらだ -ざるそば -さわやか -さわる -さんいん -さんか -さんきゃく -さんこう -さんさい -ざんしょ -さんすう -さんせい -さんそ -さんち -さんま -さんみ -さんらん -しあい -しあげ -しあさって -しあわせ -しいく -しいん -しうち -しえい -しおけ -しかい -しかく -じかん -しごと -しすう -じだい -したうけ -したぎ -したて -したみ -しちょう -しちりん -しっかり -しつじ -しつもん -してい -してき -してつ -じてん -じどう -しなぎれ -しなもの -しなん -しねま -しねん -しのぐ -しのぶ -しはい -しばかり -しはつ -しはらい -しはん -しひょう -しふく -じぶん -しへい -しほう -しほん -しまう -しまる -しみん -しむける -じむしょ -しめい -しめる -しもん -しゃいん -しゃうん -しゃおん -じゃがいも -しやくしょ -しゃくほう -しゃけん -しゃこ -しゃざい -しゃしん -しゃせん -しゃそう -しゃたい -しゃちょう -しゃっきん -じゃま -しゃりん -しゃれい -じゆう -じゅうしょ -しゅくはく -じゅしん -しゅっせき -しゅみ -しゅらば -じゅんばん -しょうかい -しょくたく -しょっけん -しょどう -しょもつ -しらせる -しらべる -しんか -しんこう -じんじゃ -しんせいじ -しんちく -しんりん -すあげ -すあし -すあな -ずあん -すいえい -すいか -すいとう -ずいぶん -すいようび -すうがく -すうじつ -すうせん -すおどり -すきま -すくう -すくない -すける -すごい -すこし -ずさん -すずしい -すすむ -すすめる -すっかり -ずっしり -ずっと -すてき -すてる -すねる -すのこ -すはだ -すばらしい -ずひょう -ずぶぬれ -すぶり -すふれ -すべて -すべる -ずほう -すぼん -すまい -すめし -すもう -すやき -すらすら -するめ -すれちがう -すろっと -すわる -すんぜん -すんぽう -せあぶら -せいかつ -せいげん -せいじ -せいよう -せおう -せかいかん -せきにん -せきむ -せきゆ -せきらんうん -せけん -せこう -せすじ -せたい -せたけ -せっかく -せっきゃく -ぜっく -せっけん -せっこつ -せっさたくま -せつぞく -せつだん -せつでん -せっぱん -せつび -せつぶん -せつめい -せつりつ -せなか -せのび -せはば -せびろ -せぼね -せまい -せまる -せめる -せもたれ -せりふ -ぜんあく -せんい -せんえい -せんか -せんきょ -せんく -せんげん -ぜんご -せんさい -せんしゅ -せんすい -せんせい -せんぞ -せんたく -せんちょう -せんてい -せんとう -せんぬき -せんねん -せんぱい -ぜんぶ -ぜんぽう -せんむ -せんめんじょ -せんもん -せんやく -せんゆう -せんよう -ぜんら -ぜんりゃく -せんれい -せんろ -そあく -そいとげる -そいね -そうがんきょう -そうき -そうご -そうしん -そうだん -そうなん -そうび -そうめん -そうり -そえもの -そえん -そがい -そげき -そこう -そこそこ -そざい -そしな -そせい -そせん -そそぐ -そだてる -そつう -そつえん -そっかん -そつぎょう -そっけつ -そっこう -そっせん -そっと -そとがわ -そとづら -そなえる -そなた -そふぼ -そぼく -そぼろ -そまつ -そまる -そむく -そむりえ -そめる -そもそも -そよかぜ -そらまめ -そろう -そんかい -そんけい -そんざい -そんしつ -そんぞく -そんちょう -ぞんび -ぞんぶん -そんみん -たあい -たいいん -たいうん -たいえき -たいおう -だいがく -たいき -たいぐう -たいけん -たいこ -たいざい -だいじょうぶ -だいすき -たいせつ -たいそう -だいたい -たいちょう -たいてい -だいどころ -たいない -たいねつ -たいのう -たいはん -だいひょう -たいふう -たいへん -たいほ -たいまつばな -たいみんぐ -たいむ -たいめん -たいやき -たいよう -たいら -たいりょく -たいる -たいわん -たうえ -たえる -たおす -たおる -たおれる -たかい -たかね -たきび -たくさん -たこく -たこやき -たさい -たしざん -だじゃれ -たすける -たずさわる -たそがれ -たたかう -たたく -ただしい -たたみ -たちばな -だっかい -だっきゃく -だっこ -だっしゅつ -だったい -たてる -たとえる -たなばた -たにん -たぬき -たのしみ -たはつ -たぶん -たべる -たぼう -たまご -たまる -だむる -ためいき -ためす -ためる -たもつ -たやすい -たよる -たらす -たりきほんがん -たりょう -たりる -たると -たれる -たれんと -たろっと -たわむれる -だんあつ -たんい -たんおん -たんか -たんき -たんけん -たんご -たんさん -たんじょうび -だんせい -たんそく -たんたい -だんち -たんてい -たんとう -だんな -たんにん -だんねつ -たんのう -たんぴん -だんぼう -たんまつ -たんめい -だんれつ -だんろ -だんわ -ちあい -ちあん -ちいき -ちいさい -ちえん -ちかい -ちから -ちきゅう -ちきん -ちけいず -ちけん -ちこく -ちさい -ちしき -ちしりょう -ちせい -ちそう -ちたい -ちたん -ちちおや -ちつじょ -ちてき -ちてん -ちぬき -ちぬり -ちのう -ちひょう -ちへいせん -ちほう -ちまた -ちみつ -ちみどろ -ちめいど -ちゃんこなべ -ちゅうい -ちゆりょく -ちょうし -ちょさくけん -ちらし -ちらみ -ちりがみ -ちりょう -ちるど -ちわわ -ちんたい -ちんもく -ついか -ついたち -つうか -つうじょう -つうはん -つうわ -つかう -つかれる -つくね -つくる -つけね -つける -つごう -つたえる -つづく -つつじ -つつむ -つとめる -つながる -つなみ -つねづね -つのる -つぶす -つまらない -つまる -つみき -つめたい -つもり -つもる -つよい -つるぼ -つるみく -つわもの -つわり -てあし -てあて -てあみ -ていおん -ていか -ていき -ていけい -ていこく -ていさつ -ていし -ていせい -ていたい -ていど -ていねい -ていひょう -ていへん -ていぼう -てうち -ておくれ -てきとう -てくび -でこぼこ -てさぎょう -てさげ -てすり -てそう -てちがい -てちょう -てつがく -てつづき -でっぱ -てつぼう -てつや -でぬかえ -てぬき -てぬぐい -てのひら -てはい -てぶくろ -てふだ -てほどき -てほん -てまえ -てまきずし -てみじか -てみやげ -てらす -てれび -てわけ -てわたし -でんあつ -てんいん -てんかい -てんき -てんぐ -てんけん -てんごく -てんさい -てんし -てんすう -でんち -てんてき -てんとう -てんない -てんぷら -てんぼうだい -てんめつ -てんらんかい -でんりょく -でんわ -どあい -といれ -どうかん -とうきゅう -どうぐ -とうし -とうむぎ -とおい -とおか -とおく -とおす -とおる -とかい -とかす -ときおり -ときどき -とくい -とくしゅう -とくてん -とくに -とくべつ -とけい -とける -とこや -とさか -としょかん -とそう -とたん -とちゅう -とっきゅう -とっくん -とつぜん -とつにゅう -とどける -ととのえる -とない -となえる -となり -とのさま -とばす -どぶがわ -とほう -とまる -とめる -ともだち -ともる -どようび -とらえる -とんかつ -どんぶり -ないかく -ないこう -ないしょ -ないす -ないせん -ないそう -なおす -ながい -なくす -なげる -なこうど -なさけ -なたでここ -なっとう -なつやすみ -ななおし -なにごと -なにもの -なにわ -なのか -なふだ -なまいき -なまえ -なまみ -なみだ -なめらか -なめる -なやむ -ならう -ならび -ならぶ -なれる -なわとび -なわばり -にあう -にいがた -にうけ -におい -にかい -にがて -にきび -にくしみ -にくまん -にげる -にさんかたんそ -にしき -にせもの -にちじょう -にちようび -にっか -にっき -にっけい -にっこう -にっさん -にっしょく -にっすう -にっせき -にってい -になう -にほん -にまめ -にもつ -にやり -にゅういん -にりんしゃ -にわとり -にんい -にんか -にんき -にんげん -にんしき -にんずう -にんそう -にんたい -にんち -にんてい -にんにく -にんぷ -にんまり -にんむ -にんめい -にんよう -ぬいくぎ -ぬかす -ぬぐいとる -ぬぐう -ぬくもり -ぬすむ -ぬまえび -ぬめり -ぬらす -ぬんちゃく -ねあげ -ねいき -ねいる -ねいろ -ねぐせ -ねくたい -ねくら -ねこぜ -ねこむ -ねさげ -ねすごす -ねそべる -ねだん -ねつい -ねっしん -ねつぞう -ねったいぎょ -ねぶそく -ねふだ -ねぼう -ねほりはほり -ねまき -ねまわし -ねみみ -ねむい -ねむたい -ねもと -ねらう -ねわざ -ねんいり -ねんおし -ねんかん -ねんきん -ねんぐ -ねんざ -ねんし -ねんちゃく -ねんど -ねんぴ -ねんぶつ -ねんまつ -ねんりょう -ねんれい -のいず -のおづま -のがす -のきなみ -のこぎり -のこす -のこる -のせる -のぞく -のぞむ -のたまう -のちほど -のっく -のばす -のはら -のべる -のぼる -のみもの -のやま -のらいぬ -のらねこ -のりもの -のりゆき -のれん -のんき -ばあい -はあく -ばあさん -ばいか -ばいく -はいけん -はいご -はいしん -はいすい -はいせん -はいそう -はいち -ばいばい -はいれつ -はえる -はおる -はかい -ばかり -はかる -はくしゅ -はけん -はこぶ -はさみ -はさん -はしご -ばしょ -はしる -はせる -ぱそこん -はそん -はたん -はちみつ -はつおん -はっかく -はづき -はっきり -はっくつ -はっけん -はっこう -はっさん -はっしん -はったつ -はっちゅう -はってん -はっぴょう -はっぽう -はなす -はなび -はにかむ -はぶらし -はみがき -はむかう -はめつ -はやい -はやし -はらう -はろうぃん -はわい -はんい -はんえい -はんおん -はんかく -はんきょう -ばんぐみ -はんこ -はんしゃ -はんすう -はんだん -ぱんち -ぱんつ -はんてい -はんとし -はんのう -はんぱ -はんぶん -はんぺん -はんぼうき -はんめい -はんらん -はんろん -ひいき -ひうん -ひえる -ひかく -ひかり -ひかる -ひかん -ひくい -ひけつ -ひこうき -ひこく -ひさい -ひさしぶり -ひさん -びじゅつかん -ひしょ -ひそか -ひそむ -ひたむき -ひだり -ひたる -ひつぎ -ひっこし -ひっし -ひつじゅひん -ひっす -ひつぜん -ぴったり -ぴっちり -ひつよう -ひてい -ひとごみ -ひなまつり -ひなん -ひねる -ひはん -ひびく -ひひょう -ひほう -ひまわり -ひまん -ひみつ -ひめい -ひめじし -ひやけ -ひやす -ひよう -びょうき -ひらがな -ひらく -ひりつ -ひりょう -ひるま -ひるやすみ -ひれい -ひろい -ひろう -ひろき -ひろゆき -ひんかく -ひんけつ -ひんこん -ひんしゅ -ひんそう -ぴんち -ひんぱん -びんぼう -ふあん -ふいうち -ふうけい -ふうせん -ぷうたろう -ふうとう -ふうふ -ふえる -ふおん -ふかい -ふきん -ふくざつ -ふくぶくろ -ふこう -ふさい -ふしぎ -ふじみ -ふすま -ふせい -ふせぐ -ふそく -ぶたにく -ふたん -ふちょう -ふつう -ふつか -ふっかつ -ふっき -ふっこく -ぶどう -ふとる -ふとん -ふのう -ふはい -ふひょう -ふへん -ふまん -ふみん -ふめつ -ふめん -ふよう -ふりこ -ふりる -ふるい -ふんいき -ぶんがく -ぶんぐ -ふんしつ -ぶんせき -ふんそう -ぶんぽう -へいあん -へいおん -へいがい -へいき -へいげん -へいこう -へいさ -へいしゃ -へいせつ -へいそ -へいたく -へいてん -へいねつ -へいわ -へきが -へこむ -べにいろ -べにしょうが -へらす -へんかん -べんきょう -べんごし -へんさい -へんたい -べんり -ほあん -ほいく -ぼうぎょ -ほうこく -ほうそう -ほうほう -ほうもん -ほうりつ -ほえる -ほおん -ほかん -ほきょう -ぼきん -ほくろ -ほけつ -ほけん -ほこう -ほこる -ほしい -ほしつ -ほしゅ -ほしょう -ほせい -ほそい -ほそく -ほたて -ほたる -ぽちぶくろ -ほっきょく -ほっさ -ほったん -ほとんど -ほめる -ほんい -ほんき -ほんけ -ほんしつ -ほんやく -まいにち -まかい -まかせる -まがる -まける -まこと -まさつ -まじめ -ますく -まぜる -まつり -まとめ -まなぶ -まぬけ -まねく -まほう -まもる -まゆげ -まよう -まろやか -まわす -まわり -まわる -まんが -まんきつ -まんぞく -まんなか -みいら -みうち -みえる -みがく -みかた -みかん -みけん -みこん -みじかい -みすい -みすえる -みせる -みっか -みつかる -みつける -みてい -みとめる -みなと -みなみかさい -みねらる -みのう -みのがす -みほん -みもと -みやげ -みらい -みりょく -みわく -みんか -みんぞく -むいか -むえき -むえん -むかい -むかう -むかえ -むかし -むぎちゃ -むける -むげん -むさぼる -むしあつい -むしば -むじゅん -むしろ -むすう -むすこ -むすぶ -むすめ -むせる -むせん -むちゅう -むなしい -むのう -むやみ -むよう -むらさき -むりょう -むろん -めいあん -めいうん -めいえん -めいかく -めいきょく -めいさい -めいし -めいそう -めいぶつ -めいれい -めいわく -めぐまれる -めざす -めした -めずらしい -めだつ -めまい -めやす -めんきょ -めんせき -めんどう -もうしあげる -もうどうけん -もえる -もくし -もくてき -もくようび -もちろん -もどる -もらう -もんく -もんだい -やおや -やける -やさい -やさしい -やすい -やすたろう -やすみ -やせる -やそう -やたい -やちん -やっと -やっぱり -やぶる -やめる -ややこしい -やよい -やわらかい -ゆうき -ゆうびんきょく -ゆうべ -ゆうめい -ゆけつ -ゆしゅつ -ゆせん -ゆそう -ゆたか -ゆちゃく -ゆでる -ゆにゅう -ゆびわ -ゆらい -ゆれる -ようい -ようか -ようきゅう -ようじ -ようす -ようちえん -よかぜ -よかん -よきん -よくせい -よくぼう -よけい -よごれる -よさん -よしゅう -よそう -よそく -よっか -よてい -よどがわく -よねつ -よやく -よゆう -よろこぶ -よろしい -らいう -らくがき -らくご -らくさつ -らくだ -らしんばん -らせん -らぞく -らたい -らっか -られつ -りえき -りかい -りきさく -りきせつ -りくぐん -りくつ -りけん -りこう -りせい -りそう -りそく -りてん -りねん -りゆう -りゅうがく -りよう -りょうり -りょかん -りょくちゃ -りょこう -りりく -りれき -りろん -りんご -るいけい -るいさい -るいじ -るいせき -るすばん -るりがわら -れいかん -れいぎ -れいせい -れいぞうこ -れいとう -れいぼう -れきし -れきだい -れんあい -れんけい -れんこん -れんさい -れんしゅう -れんぞく -れんらく -ろうか -ろうご -ろうじん -ろうそく -ろくが -ろこつ -ろじうら -ろしゅつ -ろせん -ろてん -ろめん -ろれつ -ろんぎ -ろんぱ -ろんぶん -ろんり -わかす -わかめ -わかやま -わかれる -わしつ -わじまし -わすれもの -わらう -われる`.split('\n'); diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/korean.d.ts b/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/korean.d.ts deleted file mode 100644 index b566a1db..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/korean.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const wordlist: string[]; diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/korean.js b/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/korean.js deleted file mode 100644 index 15ba4425..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/korean.js +++ /dev/null @@ -1,2051 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.wordlist = void 0; -exports.wordlist = `가격 -가끔 -가난 -가능 -가득 -가르침 -가뭄 -가방 -가상 -가슴 -가운데 -가을 -가이드 -가입 -가장 -가정 -가족 -가죽 -각오 -각자 -간격 -간부 -간섭 -간장 -간접 -간판 -갈등 -갈비 -갈색 -갈증 -감각 -감기 -감소 -감수성 -감자 -감정 -갑자기 -강남 -강당 -강도 -강력히 -강변 -강북 -강사 -강수량 -강아지 -강원도 -강의 -강제 -강조 -같이 -개구리 -개나리 -개방 -개별 -개선 -개성 -개인 -객관적 -거실 -거액 -거울 -거짓 -거품 -걱정 -건강 -건물 -건설 -건조 -건축 -걸음 -검사 -검토 -게시판 -게임 -겨울 -견해 -결과 -결국 -결론 -결석 -결승 -결심 -결정 -결혼 -경계 -경고 -경기 -경력 -경복궁 -경비 -경상도 -경영 -경우 -경쟁 -경제 -경주 -경찰 -경치 -경향 -경험 -계곡 -계단 -계란 -계산 -계속 -계약 -계절 -계층 -계획 -고객 -고구려 -고궁 -고급 -고등학생 -고무신 -고민 -고양이 -고장 -고전 -고집 -고춧가루 -고통 -고향 -곡식 -골목 -골짜기 -골프 -공간 -공개 -공격 -공군 -공급 -공기 -공동 -공무원 -공부 -공사 -공식 -공업 -공연 -공원 -공장 -공짜 -공책 -공통 -공포 -공항 -공휴일 -과목 -과일 -과장 -과정 -과학 -관객 -관계 -관광 -관념 -관람 -관련 -관리 -관습 -관심 -관점 -관찰 -광경 -광고 -광장 -광주 -괴로움 -굉장히 -교과서 -교문 -교복 -교실 -교양 -교육 -교장 -교직 -교통 -교환 -교훈 -구경 -구름 -구멍 -구별 -구분 -구석 -구성 -구속 -구역 -구입 -구청 -구체적 -국가 -국기 -국내 -국립 -국물 -국민 -국수 -국어 -국왕 -국적 -국제 -국회 -군대 -군사 -군인 -궁극적 -권리 -권위 -권투 -귀국 -귀신 -규정 -규칙 -균형 -그날 -그냥 -그늘 -그러나 -그룹 -그릇 -그림 -그제서야 -그토록 -극복 -극히 -근거 -근교 -근래 -근로 -근무 -근본 -근원 -근육 -근처 -글씨 -글자 -금강산 -금고 -금년 -금메달 -금액 -금연 -금요일 -금지 -긍정적 -기간 -기관 -기념 -기능 -기독교 -기둥 -기록 -기름 -기법 -기본 -기분 -기쁨 -기숙사 -기술 -기억 -기업 -기온 -기운 -기원 -기적 -기준 -기침 -기혼 -기획 -긴급 -긴장 -길이 -김밥 -김치 -김포공항 -깍두기 -깜빡 -깨달음 -깨소금 -껍질 -꼭대기 -꽃잎 -나들이 -나란히 -나머지 -나물 -나침반 -나흘 -낙엽 -난방 -날개 -날씨 -날짜 -남녀 -남대문 -남매 -남산 -남자 -남편 -남학생 -낭비 -낱말 -내년 -내용 -내일 -냄비 -냄새 -냇물 -냉동 -냉면 -냉방 -냉장고 -넥타이 -넷째 -노동 -노란색 -노력 -노인 -녹음 -녹차 -녹화 -논리 -논문 -논쟁 -놀이 -농구 -농담 -농민 -농부 -농업 -농장 -농촌 -높이 -눈동자 -눈물 -눈썹 -뉴욕 -느낌 -늑대 -능동적 -능력 -다방 -다양성 -다음 -다이어트 -다행 -단계 -단골 -단독 -단맛 -단순 -단어 -단위 -단점 -단체 -단추 -단편 -단풍 -달걀 -달러 -달력 -달리 -닭고기 -담당 -담배 -담요 -담임 -답변 -답장 -당근 -당분간 -당연히 -당장 -대규모 -대낮 -대단히 -대답 -대도시 -대략 -대량 -대륙 -대문 -대부분 -대신 -대응 -대장 -대전 -대접 -대중 -대책 -대출 -대충 -대통령 -대학 -대한민국 -대합실 -대형 -덩어리 -데이트 -도대체 -도덕 -도둑 -도망 -도서관 -도심 -도움 -도입 -도자기 -도저히 -도전 -도중 -도착 -독감 -독립 -독서 -독일 -독창적 -동화책 -뒷모습 -뒷산 -딸아이 -마누라 -마늘 -마당 -마라톤 -마련 -마무리 -마사지 -마약 -마요네즈 -마을 -마음 -마이크 -마중 -마지막 -마찬가지 -마찰 -마흔 -막걸리 -막내 -막상 -만남 -만두 -만세 -만약 -만일 -만점 -만족 -만화 -많이 -말기 -말씀 -말투 -맘대로 -망원경 -매년 -매달 -매력 -매번 -매스컴 -매일 -매장 -맥주 -먹이 -먼저 -먼지 -멀리 -메일 -며느리 -며칠 -면담 -멸치 -명단 -명령 -명예 -명의 -명절 -명칭 -명함 -모금 -모니터 -모델 -모든 -모범 -모습 -모양 -모임 -모조리 -모집 -모퉁이 -목걸이 -목록 -목사 -목소리 -목숨 -목적 -목표 -몰래 -몸매 -몸무게 -몸살 -몸속 -몸짓 -몸통 -몹시 -무관심 -무궁화 -무더위 -무덤 -무릎 -무슨 -무엇 -무역 -무용 -무조건 -무지개 -무척 -문구 -문득 -문법 -문서 -문제 -문학 -문화 -물가 -물건 -물결 -물고기 -물론 -물리학 -물음 -물질 -물체 -미국 -미디어 -미사일 -미술 -미역 -미용실 -미움 -미인 -미팅 -미혼 -민간 -민족 -민주 -믿음 -밀가루 -밀리미터 -밑바닥 -바가지 -바구니 -바나나 -바늘 -바닥 -바닷가 -바람 -바이러스 -바탕 -박물관 -박사 -박수 -반대 -반드시 -반말 -반발 -반성 -반응 -반장 -반죽 -반지 -반찬 -받침 -발가락 -발걸음 -발견 -발달 -발레 -발목 -발바닥 -발생 -발음 -발자국 -발전 -발톱 -발표 -밤하늘 -밥그릇 -밥맛 -밥상 -밥솥 -방금 -방면 -방문 -방바닥 -방법 -방송 -방식 -방안 -방울 -방지 -방학 -방해 -방향 -배경 -배꼽 -배달 -배드민턴 -백두산 -백색 -백성 -백인 -백제 -백화점 -버릇 -버섯 -버튼 -번개 -번역 -번지 -번호 -벌금 -벌레 -벌써 -범위 -범인 -범죄 -법률 -법원 -법적 -법칙 -베이징 -벨트 -변경 -변동 -변명 -변신 -변호사 -변화 -별도 -별명 -별일 -병실 -병아리 -병원 -보관 -보너스 -보라색 -보람 -보름 -보상 -보안 -보자기 -보장 -보전 -보존 -보통 -보편적 -보험 -복도 -복사 -복숭아 -복습 -볶음 -본격적 -본래 -본부 -본사 -본성 -본인 -본질 -볼펜 -봉사 -봉지 -봉투 -부근 -부끄러움 -부담 -부동산 -부문 -부분 -부산 -부상 -부엌 -부인 -부작용 -부장 -부정 -부족 -부지런히 -부친 -부탁 -부품 -부회장 -북부 -북한 -분노 -분량 -분리 -분명 -분석 -분야 -분위기 -분필 -분홍색 -불고기 -불과 -불교 -불꽃 -불만 -불법 -불빛 -불안 -불이익 -불행 -브랜드 -비극 -비난 -비닐 -비둘기 -비디오 -비로소 -비만 -비명 -비밀 -비바람 -비빔밥 -비상 -비용 -비율 -비중 -비타민 -비판 -빌딩 -빗물 -빗방울 -빗줄기 -빛깔 -빨간색 -빨래 -빨리 -사건 -사계절 -사나이 -사냥 -사람 -사랑 -사립 -사모님 -사물 -사방 -사상 -사생활 -사설 -사슴 -사실 -사업 -사용 -사월 -사장 -사전 -사진 -사촌 -사춘기 -사탕 -사투리 -사흘 -산길 -산부인과 -산업 -산책 -살림 -살인 -살짝 -삼계탕 -삼국 -삼십 -삼월 -삼촌 -상관 -상금 -상대 -상류 -상반기 -상상 -상식 -상업 -상인 -상자 -상점 -상처 -상추 -상태 -상표 -상품 -상황 -새벽 -색깔 -색연필 -생각 -생명 -생물 -생방송 -생산 -생선 -생신 -생일 -생활 -서랍 -서른 -서명 -서민 -서비스 -서양 -서울 -서적 -서점 -서쪽 -서클 -석사 -석유 -선거 -선물 -선배 -선생 -선수 -선원 -선장 -선전 -선택 -선풍기 -설거지 -설날 -설렁탕 -설명 -설문 -설사 -설악산 -설치 -설탕 -섭씨 -성공 -성당 -성명 -성별 -성인 -성장 -성적 -성질 -성함 -세금 -세미나 -세상 -세월 -세종대왕 -세탁 -센터 -센티미터 -셋째 -소규모 -소극적 -소금 -소나기 -소년 -소득 -소망 -소문 -소설 -소속 -소아과 -소용 -소원 -소음 -소중히 -소지품 -소질 -소풍 -소형 -속담 -속도 -속옷 -손가락 -손길 -손녀 -손님 -손등 -손목 -손뼉 -손실 -손질 -손톱 -손해 -솔직히 -솜씨 -송아지 -송이 -송편 -쇠고기 -쇼핑 -수건 -수년 -수단 -수돗물 -수동적 -수면 -수명 -수박 -수상 -수석 -수술 -수시로 -수업 -수염 -수영 -수입 -수준 -수집 -수출 -수컷 -수필 -수학 -수험생 -수화기 -숙녀 -숙소 -숙제 -순간 -순서 -순수 -순식간 -순위 -숟가락 -술병 -술집 -숫자 -스님 -스물 -스스로 -스승 -스웨터 -스위치 -스케이트 -스튜디오 -스트레스 -스포츠 -슬쩍 -슬픔 -습관 -습기 -승객 -승리 -승부 -승용차 -승진 -시각 -시간 -시골 -시금치 -시나리오 -시댁 -시리즈 -시멘트 -시민 -시부모 -시선 -시설 -시스템 -시아버지 -시어머니 -시월 -시인 -시일 -시작 -시장 -시절 -시점 -시중 -시즌 -시집 -시청 -시합 -시험 -식구 -식기 -식당 -식량 -식료품 -식물 -식빵 -식사 -식생활 -식초 -식탁 -식품 -신고 -신규 -신념 -신문 -신발 -신비 -신사 -신세 -신용 -신제품 -신청 -신체 -신화 -실감 -실내 -실력 -실례 -실망 -실수 -실습 -실시 -실장 -실정 -실질적 -실천 -실체 -실컷 -실태 -실패 -실험 -실현 -심리 -심부름 -심사 -심장 -심정 -심판 -쌍둥이 -씨름 -씨앗 -아가씨 -아나운서 -아드님 -아들 -아쉬움 -아스팔트 -아시아 -아울러 -아저씨 -아줌마 -아직 -아침 -아파트 -아프리카 -아픔 -아홉 -아흔 -악기 -악몽 -악수 -안개 -안경 -안과 -안내 -안녕 -안동 -안방 -안부 -안주 -알루미늄 -알코올 -암시 -암컷 -압력 -앞날 -앞문 -애인 -애정 -액수 -앨범 -야간 -야단 -야옹 -약간 -약국 -약속 -약수 -약점 -약품 -약혼녀 -양념 -양력 -양말 -양배추 -양주 -양파 -어둠 -어려움 -어른 -어젯밤 -어쨌든 -어쩌다가 -어쩐지 -언니 -언덕 -언론 -언어 -얼굴 -얼른 -얼음 -얼핏 -엄마 -업무 -업종 -업체 -엉덩이 -엉망 -엉터리 -엊그제 -에너지 -에어컨 -엔진 -여건 -여고생 -여관 -여군 -여권 -여대생 -여덟 -여동생 -여든 -여론 -여름 -여섯 -여성 -여왕 -여인 -여전히 -여직원 -여학생 -여행 -역사 -역시 -역할 -연결 -연구 -연극 -연기 -연락 -연설 -연세 -연속 -연습 -연애 -연예인 -연인 -연장 -연주 -연출 -연필 -연합 -연휴 -열기 -열매 -열쇠 -열심히 -열정 -열차 -열흘 -염려 -엽서 -영국 -영남 -영상 -영양 -영역 -영웅 -영원히 -영하 -영향 -영혼 -영화 -옆구리 -옆방 -옆집 -예감 -예금 -예방 -예산 -예상 -예선 -예술 -예습 -예식장 -예약 -예전 -예절 -예정 -예컨대 -옛날 -오늘 -오락 -오랫동안 -오렌지 -오로지 -오른발 -오븐 -오십 -오염 -오월 -오전 -오직 -오징어 -오페라 -오피스텔 -오히려 -옥상 -옥수수 -온갖 -온라인 -온몸 -온종일 -온통 -올가을 -올림픽 -올해 -옷차림 -와이셔츠 -와인 -완성 -완전 -왕비 -왕자 -왜냐하면 -왠지 -외갓집 -외국 -외로움 -외삼촌 -외출 -외침 -외할머니 -왼발 -왼손 -왼쪽 -요금 -요일 -요즘 -요청 -용기 -용서 -용어 -우산 -우선 -우승 -우연히 -우정 -우체국 -우편 -운동 -운명 -운반 -운전 -운행 -울산 -울음 -움직임 -웃어른 -웃음 -워낙 -원고 -원래 -원서 -원숭이 -원인 -원장 -원피스 -월급 -월드컵 -월세 -월요일 -웨이터 -위반 -위법 -위성 -위원 -위험 -위협 -윗사람 -유난히 -유럽 -유명 -유물 -유산 -유적 -유치원 -유학 -유행 -유형 -육군 -육상 -육십 -육체 -은행 -음력 -음료 -음반 -음성 -음식 -음악 -음주 -의견 -의논 -의문 -의복 -의식 -의심 -의외로 -의욕 -의원 -의학 -이것 -이곳 -이념 -이놈 -이달 -이대로 -이동 -이렇게 -이력서 -이론적 -이름 -이민 -이발소 -이별 -이불 -이빨 -이상 -이성 -이슬 -이야기 -이용 -이웃 -이월 -이윽고 -이익 -이전 -이중 -이튿날 -이틀 -이혼 -인간 -인격 -인공 -인구 -인근 -인기 -인도 -인류 -인물 -인생 -인쇄 -인연 -인원 -인재 -인종 -인천 -인체 -인터넷 -인하 -인형 -일곱 -일기 -일단 -일대 -일등 -일반 -일본 -일부 -일상 -일생 -일손 -일요일 -일월 -일정 -일종 -일주일 -일찍 -일체 -일치 -일행 -일회용 -임금 -임무 -입대 -입력 -입맛 -입사 -입술 -입시 -입원 -입장 -입학 -자가용 -자격 -자극 -자동 -자랑 -자부심 -자식 -자신 -자연 -자원 -자율 -자전거 -자정 -자존심 -자판 -작가 -작년 -작성 -작업 -작용 -작은딸 -작품 -잔디 -잔뜩 -잔치 -잘못 -잠깐 -잠수함 -잠시 -잠옷 -잠자리 -잡지 -장관 -장군 -장기간 -장래 -장례 -장르 -장마 -장면 -장모 -장미 -장비 -장사 -장소 -장식 -장애인 -장인 -장점 -장차 -장학금 -재능 -재빨리 -재산 -재생 -재작년 -재정 -재채기 -재판 -재학 -재활용 -저것 -저고리 -저곳 -저녁 -저런 -저렇게 -저번 -저울 -저절로 -저축 -적극 -적당히 -적성 -적용 -적응 -전개 -전공 -전기 -전달 -전라도 -전망 -전문 -전반 -전부 -전세 -전시 -전용 -전자 -전쟁 -전주 -전철 -전체 -전통 -전혀 -전후 -절대 -절망 -절반 -절약 -절차 -점검 -점수 -점심 -점원 -점점 -점차 -접근 -접시 -접촉 -젓가락 -정거장 -정도 -정류장 -정리 -정말 -정면 -정문 -정반대 -정보 -정부 -정비 -정상 -정성 -정오 -정원 -정장 -정지 -정치 -정확히 -제공 -제과점 -제대로 -제목 -제발 -제법 -제삿날 -제안 -제일 -제작 -제주도 -제출 -제품 -제한 -조각 -조건 -조금 -조깅 -조명 -조미료 -조상 -조선 -조용히 -조절 -조정 -조직 -존댓말 -존재 -졸업 -졸음 -종교 -종로 -종류 -종소리 -종업원 -종종 -종합 -좌석 -죄인 -주관적 -주름 -주말 -주머니 -주먹 -주문 -주민 -주방 -주변 -주식 -주인 -주일 -주장 -주전자 -주택 -준비 -줄거리 -줄기 -줄무늬 -중간 -중계방송 -중국 -중년 -중단 -중독 -중반 -중부 -중세 -중소기업 -중순 -중앙 -중요 -중학교 -즉석 -즉시 -즐거움 -증가 -증거 -증권 -증상 -증세 -지각 -지갑 -지경 -지극히 -지금 -지급 -지능 -지름길 -지리산 -지방 -지붕 -지식 -지역 -지우개 -지원 -지적 -지점 -지진 -지출 -직선 -직업 -직원 -직장 -진급 -진동 -진로 -진료 -진리 -진짜 -진찰 -진출 -진통 -진행 -질문 -질병 -질서 -짐작 -집단 -집안 -집중 -짜증 -찌꺼기 -차남 -차라리 -차량 -차림 -차별 -차선 -차츰 -착각 -찬물 -찬성 -참가 -참기름 -참새 -참석 -참여 -참외 -참조 -찻잔 -창가 -창고 -창구 -창문 -창밖 -창작 -창조 -채널 -채점 -책가방 -책방 -책상 -책임 -챔피언 -처벌 -처음 -천국 -천둥 -천장 -천재 -천천히 -철도 -철저히 -철학 -첫날 -첫째 -청년 -청바지 -청소 -청춘 -체계 -체력 -체온 -체육 -체중 -체험 -초등학생 -초반 -초밥 -초상화 -초순 -초여름 -초원 -초저녁 -초점 -초청 -초콜릿 -촛불 -총각 -총리 -총장 -촬영 -최근 -최상 -최선 -최신 -최악 -최종 -추석 -추억 -추진 -추천 -추측 -축구 -축소 -축제 -축하 -출근 -출발 -출산 -출신 -출연 -출입 -출장 -출판 -충격 -충고 -충돌 -충분히 -충청도 -취업 -취직 -취향 -치약 -친구 -친척 -칠십 -칠월 -칠판 -침대 -침묵 -침실 -칫솔 -칭찬 -카메라 -카운터 -칼국수 -캐릭터 -캠퍼스 -캠페인 -커튼 -컨디션 -컬러 -컴퓨터 -코끼리 -코미디 -콘서트 -콜라 -콤플렉스 -콩나물 -쾌감 -쿠데타 -크림 -큰길 -큰딸 -큰소리 -큰아들 -큰어머니 -큰일 -큰절 -클래식 -클럽 -킬로 -타입 -타자기 -탁구 -탁자 -탄생 -태권도 -태양 -태풍 -택시 -탤런트 -터널 -터미널 -테니스 -테스트 -테이블 -텔레비전 -토론 -토마토 -토요일 -통계 -통과 -통로 -통신 -통역 -통일 -통장 -통제 -통증 -통합 -통화 -퇴근 -퇴원 -퇴직금 -튀김 -트럭 -특급 -특별 -특성 -특수 -특징 -특히 -튼튼히 -티셔츠 -파란색 -파일 -파출소 -판결 -판단 -판매 -판사 -팔십 -팔월 -팝송 -패션 -팩스 -팩시밀리 -팬티 -퍼센트 -페인트 -편견 -편의 -편지 -편히 -평가 -평균 -평생 -평소 -평양 -평일 -평화 -포스터 -포인트 -포장 -포함 -표면 -표정 -표준 -표현 -품목 -품질 -풍경 -풍속 -풍습 -프랑스 -프린터 -플라스틱 -피곤 -피망 -피아노 -필름 -필수 -필요 -필자 -필통 -핑계 -하느님 -하늘 -하드웨어 -하룻밤 -하반기 -하숙집 -하순 -하여튼 -하지만 -하천 -하품 -하필 -학과 -학교 -학급 -학기 -학년 -학력 -학번 -학부모 -학비 -학생 -학술 -학습 -학용품 -학원 -학위 -학자 -학점 -한계 -한글 -한꺼번에 -한낮 -한눈 -한동안 -한때 -한라산 -한마디 -한문 -한번 -한복 -한식 -한여름 -한쪽 -할머니 -할아버지 -할인 -함께 -함부로 -합격 -합리적 -항공 -항구 -항상 -항의 -해결 -해군 -해답 -해당 -해물 -해석 -해설 -해수욕장 -해안 -핵심 -핸드백 -햄버거 -햇볕 -햇살 -행동 -행복 -행사 -행운 -행위 -향기 -향상 -향수 -허락 -허용 -헬기 -현관 -현금 -현대 -현상 -현실 -현장 -현재 -현지 -혈액 -협력 -형부 -형사 -형수 -형식 -형제 -형태 -형편 -혜택 -호기심 -호남 -호랑이 -호박 -호텔 -호흡 -혹시 -홀로 -홈페이지 -홍보 -홍수 -홍차 -화면 -화분 -화살 -화요일 -화장 -화학 -확보 -확인 -확장 -확정 -환갑 -환경 -환영 -환율 -환자 -활기 -활동 -활발히 -활용 -활짝 -회견 -회관 -회복 -회색 -회원 -회장 -회전 -횟수 -횡단보도 -효율적 -후반 -후춧가루 -훈련 -훨씬 -휴식 -휴일 -흉내 -흐름 -흑백 -흑인 -흔적 -흔히 -흥미 -흥분 -희곡 -희망 -희생 -흰색 -힘껏`.split('\n'); diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/portuguese.d.ts b/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/portuguese.d.ts deleted file mode 100644 index b566a1db..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/portuguese.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const wordlist: string[]; diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/portuguese.js b/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/portuguese.js deleted file mode 100644 index 5eac9efe..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/portuguese.js +++ /dev/null @@ -1,2051 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.wordlist = void 0; -exports.wordlist = `abacate -abaixo -abalar -abater -abduzir -abelha -aberto -abismo -abotoar -abranger -abreviar -abrigar -abrupto -absinto -absoluto -absurdo -abutre -acabado -acalmar -acampar -acanhar -acaso -aceitar -acelerar -acenar -acervo -acessar -acetona -achatar -acidez -acima -acionado -acirrar -aclamar -aclive -acolhida -acomodar -acoplar -acordar -acumular -acusador -adaptar -adega -adentro -adepto -adequar -aderente -adesivo -adeus -adiante -aditivo -adjetivo -adjunto -admirar -adorar -adquirir -adubo -adverso -advogado -aeronave -afastar -aferir -afetivo -afinador -afivelar -aflito -afluente -afrontar -agachar -agarrar -agasalho -agenciar -agilizar -agiota -agitado -agora -agradar -agreste -agrupar -aguardar -agulha -ajoelhar -ajudar -ajustar -alameda -alarme -alastrar -alavanca -albergue -albino -alcatra -aldeia -alecrim -alegria -alertar -alface -alfinete -algum -alheio -aliar -alicate -alienar -alinhar -aliviar -almofada -alocar -alpiste -alterar -altitude -alucinar -alugar -aluno -alusivo -alvo -amaciar -amador -amarelo -amassar -ambas -ambiente -ameixa -amenizar -amido -amistoso -amizade -amolador -amontoar -amoroso -amostra -amparar -ampliar -ampola -anagrama -analisar -anarquia -anatomia -andaime -anel -anexo -angular -animar -anjo -anomalia -anotado -ansioso -anterior -anuidade -anunciar -anzol -apagador -apalpar -apanhado -apego -apelido -apertada -apesar -apetite -apito -aplauso -aplicada -apoio -apontar -aposta -aprendiz -aprovar -aquecer -arame -aranha -arara -arcada -ardente -areia -arejar -arenito -aresta -argiloso -argola -arma -arquivo -arraial -arrebate -arriscar -arroba -arrumar -arsenal -arterial -artigo -arvoredo -asfaltar -asilado -aspirar -assador -assinar -assoalho -assunto -astral -atacado -atadura -atalho -atarefar -atear -atender -aterro -ateu -atingir -atirador -ativo -atoleiro -atracar -atrevido -atriz -atual -atum -auditor -aumentar -aura -aurora -autismo -autoria -autuar -avaliar -avante -avaria -avental -avesso -aviador -avisar -avulso -axila -azarar -azedo -azeite -azulejo -babar -babosa -bacalhau -bacharel -bacia -bagagem -baiano -bailar -baioneta -bairro -baixista -bajular -baleia -baliza -balsa -banal -bandeira -banho -banir -banquete -barato -barbado -baronesa -barraca -barulho -baseado -bastante -batata -batedor -batida -batom -batucar -baunilha -beber -beijo -beirada -beisebol -beldade -beleza -belga -beliscar -bendito -bengala -benzer -berimbau -berlinda -berro -besouro -bexiga -bezerro -bico -bicudo -bienal -bifocal -bifurcar -bigorna -bilhete -bimestre -bimotor -biologia -biombo -biosfera -bipolar -birrento -biscoito -bisneto -bispo -bissexto -bitola -bizarro -blindado -bloco -bloquear -boato -bobagem -bocado -bocejo -bochecha -boicotar -bolada -boletim -bolha -bolo -bombeiro -bonde -boneco -bonita -borbulha -borda -boreal -borracha -bovino -boxeador -branco -brasa -braveza -breu -briga -brilho -brincar -broa -brochura -bronzear -broto -bruxo -bucha -budismo -bufar -bule -buraco -busca -busto -buzina -cabana -cabelo -cabide -cabo -cabrito -cacau -cacetada -cachorro -cacique -cadastro -cadeado -cafezal -caiaque -caipira -caixote -cajado -caju -calafrio -calcular -caldeira -calibrar -calmante -calota -camada -cambista -camisa -camomila -campanha -camuflar -canavial -cancelar -caneta -canguru -canhoto -canivete -canoa -cansado -cantar -canudo -capacho -capela -capinar -capotar -capricho -captador -capuz -caracol -carbono -cardeal -careca -carimbar -carneiro -carpete -carreira -cartaz -carvalho -casaco -casca -casebre -castelo -casulo -catarata -cativar -caule -causador -cautelar -cavalo -caverna -cebola -cedilha -cegonha -celebrar -celular -cenoura -censo -centeio -cercar -cerrado -certeiro -cerveja -cetim -cevada -chacota -chaleira -chamado -chapada -charme -chatice -chave -chefe -chegada -cheiro -cheque -chicote -chifre -chinelo -chocalho -chover -chumbo -chutar -chuva -cicatriz -ciclone -cidade -cidreira -ciente -cigana -cimento -cinto -cinza -ciranda -circuito -cirurgia -citar -clareza -clero -clicar -clone -clube -coado -coagir -cobaia -cobertor -cobrar -cocada -coelho -coentro -coeso -cogumelo -coibir -coifa -coiote -colar -coleira -colher -colidir -colmeia -colono -coluna -comando -combinar -comentar -comitiva -comover -complexo -comum -concha -condor -conectar -confuso -congelar -conhecer -conjugar -consumir -contrato -convite -cooperar -copeiro -copiador -copo -coquetel -coragem -cordial -corneta -coronha -corporal -correio -cortejo -coruja -corvo -cosseno -costela -cotonete -couro -couve -covil -cozinha -cratera -cravo -creche -credor -creme -crer -crespo -criada -criminal -crioulo -crise -criticar -crosta -crua -cruzeiro -cubano -cueca -cuidado -cujo -culatra -culminar -culpar -cultura -cumprir -cunhado -cupido -curativo -curral -cursar -curto -cuspir -custear -cutelo -damasco -datar -debater -debitar -deboche -debulhar -decalque -decimal -declive -decote -decretar -dedal -dedicado -deduzir -defesa -defumar -degelo -degrau -degustar -deitado -deixar -delator -delegado -delinear -delonga -demanda -demitir -demolido -dentista -depenado -depilar -depois -depressa -depurar -deriva -derramar -desafio -desbotar -descanso -desenho -desfiado -desgaste -desigual -deslize -desmamar -desova -despesa -destaque -desviar -detalhar -detentor -detonar -detrito -deusa -dever -devido -devotado -dezena -diagrama -dialeto -didata -difuso -digitar -dilatado -diluente -diminuir -dinastia -dinheiro -diocese -direto -discreta -disfarce -disparo -disquete -dissipar -distante -ditador -diurno -diverso -divisor -divulgar -dizer -dobrador -dolorido -domador -dominado -donativo -donzela -dormente -dorsal -dosagem -dourado -doutor -drenagem -drible -drogaria -duelar -duende -dueto -duplo -duquesa -durante -duvidoso -eclodir -ecoar -ecologia -edificar -edital -educado -efeito -efetivar -ejetar -elaborar -eleger -eleitor -elenco -elevador -eliminar -elogiar -embargo -embolado -embrulho -embutido -emenda -emergir -emissor -empatia -empenho -empinado -empolgar -emprego -empurrar -emulador -encaixe -encenado -enchente -encontro -endeusar -endossar -enfaixar -enfeite -enfim -engajado -engenho -englobar -engomado -engraxar -enguia -enjoar -enlatar -enquanto -enraizar -enrolado -enrugar -ensaio -enseada -ensino -ensopado -entanto -enteado -entidade -entortar -entrada -entulho -envergar -enviado -envolver -enxame -enxerto -enxofre -enxuto -epiderme -equipar -ereto -erguido -errata -erva -ervilha -esbanjar -esbelto -escama -escola -escrita -escuta -esfinge -esfolar -esfregar -esfumado -esgrima -esmalte -espanto -espelho -espiga -esponja -espreita -espumar -esquerda -estaca -esteira -esticar -estofado -estrela -estudo -esvaziar -etanol -etiqueta -euforia -europeu -evacuar -evaporar -evasivo -eventual -evidente -evoluir -exagero -exalar -examinar -exato -exausto -excesso -excitar -exclamar -executar -exemplo -exibir -exigente -exonerar -expandir -expelir -expirar -explanar -exposto -expresso -expulsar -externo -extinto -extrato -fabricar -fabuloso -faceta -facial -fada -fadiga -faixa -falar -falta -familiar -fandango -fanfarra -fantoche -fardado -farelo -farinha -farofa -farpa -fartura -fatia -fator -favorita -faxina -fazenda -fechado -feijoada -feirante -felino -feminino -fenda -feno -fera -feriado -ferrugem -ferver -festejar -fetal -feudal -fiapo -fibrose -ficar -ficheiro -figurado -fileira -filho -filme -filtrar -firmeza -fisgada -fissura -fita -fivela -fixador -fixo -flacidez -flamingo -flanela -flechada -flora -flutuar -fluxo -focal -focinho -fofocar -fogo -foguete -foice -folgado -folheto -forjar -formiga -forno -forte -fosco -fossa -fragata -fralda -frango -frasco -fraterno -freira -frente -fretar -frieza -friso -fritura -fronha -frustrar -fruteira -fugir -fulano -fuligem -fundar -fungo -funil -furador -furioso -futebol -gabarito -gabinete -gado -gaiato -gaiola -gaivota -galega -galho -galinha -galocha -ganhar -garagem -garfo -gargalo -garimpo -garoupa -garrafa -gasoduto -gasto -gata -gatilho -gaveta -gazela -gelado -geleia -gelo -gemada -gemer -gemido -generoso -gengiva -genial -genoma -genro -geologia -gerador -germinar -gesso -gestor -ginasta -gincana -gingado -girafa -girino -glacial -glicose -global -glorioso -goela -goiaba -golfe -golpear -gordura -gorjeta -gorro -gostoso -goteira -governar -gracejo -gradual -grafite -gralha -grampo -granada -gratuito -graveto -graxa -grego -grelhar -greve -grilo -grisalho -gritaria -grosso -grotesco -grudado -grunhido -gruta -guache -guarani -guaxinim -guerrear -guiar -guincho -guisado -gula -guloso -guru -habitar -harmonia -haste -haver -hectare -herdar -heresia -hesitar -hiato -hibernar -hidratar -hiena -hino -hipismo -hipnose -hipoteca -hoje -holofote -homem -honesto -honrado -hormonal -hospedar -humorado -iate -ideia -idoso -ignorado -igreja -iguana -ileso -ilha -iludido -iluminar -ilustrar -imagem -imediato -imenso -imersivo -iminente -imitador -imortal -impacto -impedir -implante -impor -imprensa -impune -imunizar -inalador -inapto -inativo -incenso -inchar -incidir -incluir -incolor -indeciso -indireto -indutor -ineficaz -inerente -infantil -infestar -infinito -inflamar -informal -infrator -ingerir -inibido -inicial -inimigo -injetar -inocente -inodoro -inovador -inox -inquieto -inscrito -inseto -insistir -inspetor -instalar -insulto -intacto -integral -intimar -intocado -intriga -invasor -inverno -invicto -invocar -iogurte -iraniano -ironizar -irreal -irritado -isca -isento -isolado -isqueiro -italiano -janeiro -jangada -janta -jararaca -jardim -jarro -jasmim -jato -javali -jazida -jejum -joaninha -joelhada -jogador -joia -jornal -jorrar -jovem -juba -judeu -judoca -juiz -julgador -julho -jurado -jurista -juro -justa -labareda -laboral -lacre -lactante -ladrilho -lagarta -lagoa -laje -lamber -lamentar -laminar -lampejo -lanche -lapidar -lapso -laranja -lareira -largura -lasanha -lastro -lateral -latido -lavanda -lavoura -lavrador -laxante -lazer -lealdade -lebre -legado -legendar -legista -leigo -leiloar -leitura -lembrete -leme -lenhador -lentilha -leoa -lesma -leste -letivo -letreiro -levar -leveza -levitar -liberal -libido -liderar -ligar -ligeiro -limitar -limoeiro -limpador -linda -linear -linhagem -liquidez -listagem -lisura -litoral -livro -lixa -lixeira -locador -locutor -lojista -lombo -lona -longe -lontra -lorde -lotado -loteria -loucura -lousa -louvar -luar -lucidez -lucro -luneta -lustre -lutador -luva -macaco -macete -machado -macio -madeira -madrinha -magnata -magreza -maior -mais -malandro -malha -malote -maluco -mamilo -mamoeiro -mamute -manada -mancha -mandato -manequim -manhoso -manivela -manobrar -mansa -manter -manusear -mapeado -maquinar -marcador -maresia -marfim -margem -marinho -marmita -maroto -marquise -marreco -martelo -marujo -mascote -masmorra -massagem -mastigar -matagal -materno -matinal -matutar -maxilar -medalha -medida -medusa -megafone -meiga -melancia -melhor -membro -memorial -menino -menos -mensagem -mental -merecer -mergulho -mesada -mesclar -mesmo -mesquita -mestre -metade -meteoro -metragem -mexer -mexicano -micro -migalha -migrar -milagre -milenar -milhar -mimado -minerar -minhoca -ministro -minoria -miolo -mirante -mirtilo -misturar -mocidade -moderno -modular -moeda -moer -moinho -moita -moldura -moleza -molho -molinete -molusco -montanha -moqueca -morango -morcego -mordomo -morena -mosaico -mosquete -mostarda -motel -motim -moto -motriz -muda -muito -mulata -mulher -multar -mundial -munido -muralha -murcho -muscular -museu -musical -nacional -nadador -naja -namoro -narina -narrado -nascer -nativa -natureza -navalha -navegar -navio -neblina -nebuloso -negativa -negociar -negrito -nervoso -neta -neural -nevasca -nevoeiro -ninar -ninho -nitidez -nivelar -nobreza -noite -noiva -nomear -nominal -nordeste -nortear -notar -noticiar -noturno -novelo -novilho -novo -nublado -nudez -numeral -nupcial -nutrir -nuvem -obcecado -obedecer -objetivo -obrigado -obscuro -obstetra -obter -obturar -ocidente -ocioso -ocorrer -oculista -ocupado -ofegante -ofensiva -oferenda -oficina -ofuscado -ogiva -olaria -oleoso -olhar -oliveira -ombro -omelete -omisso -omitir -ondulado -oneroso -ontem -opcional -operador -oponente -oportuno -oposto -orar -orbitar -ordem -ordinal -orfanato -orgasmo -orgulho -oriental -origem -oriundo -orla -ortodoxo -orvalho -oscilar -ossada -osso -ostentar -otimismo -ousadia -outono -outubro -ouvido -ovelha -ovular -oxidar -oxigenar -pacato -paciente -pacote -pactuar -padaria -padrinho -pagar -pagode -painel -pairar -paisagem -palavra -palestra -palheta -palito -palmada -palpitar -pancada -panela -panfleto -panqueca -pantanal -papagaio -papelada -papiro -parafina -parcial -pardal -parede -partida -pasmo -passado -pastel -patamar -patente -patinar -patrono -paulada -pausar -peculiar -pedalar -pedestre -pediatra -pedra -pegada -peitoral -peixe -pele -pelicano -penca -pendurar -peneira -penhasco -pensador -pente -perceber -perfeito -pergunta -perito -permitir -perna -perplexo -persiana -pertence -peruca -pescado -pesquisa -pessoa -petiscar -piada -picado -piedade -pigmento -pilastra -pilhado -pilotar -pimenta -pincel -pinguim -pinha -pinote -pintar -pioneiro -pipoca -piquete -piranha -pires -pirueta -piscar -pistola -pitanga -pivete -planta -plaqueta -platina -plebeu -plumagem -pluvial -pneu -poda -poeira -poetisa -polegada -policiar -poluente -polvilho -pomar -pomba -ponderar -pontaria -populoso -porta -possuir -postal -pote -poupar -pouso -povoar -praia -prancha -prato -praxe -prece -predador -prefeito -premiar -prensar -preparar -presilha -pretexto -prevenir -prezar -primata -princesa -prisma -privado -processo -produto -profeta -proibido -projeto -prometer -propagar -prosa -protetor -provador -publicar -pudim -pular -pulmonar -pulseira -punhal -punir -pupilo -pureza -puxador -quadra -quantia -quarto -quase -quebrar -queda -queijo -quente -querido -quimono -quina -quiosque -rabanada -rabisco -rachar -racionar -radial -raiar -rainha -raio -raiva -rajada -ralado -ramal -ranger -ranhura -rapadura -rapel -rapidez -raposa -raquete -raridade -rasante -rascunho -rasgar -raspador -rasteira -rasurar -ratazana -ratoeira -realeza -reanimar -reaver -rebaixar -rebelde -rebolar -recado -recente -recheio -recibo -recordar -recrutar -recuar -rede -redimir -redonda -reduzida -reenvio -refinar -refletir -refogar -refresco -refugiar -regalia -regime -regra -reinado -reitor -rejeitar -relativo -remador -remendo -remorso -renovado -reparo -repelir -repleto -repolho -represa -repudiar -requerer -resenha -resfriar -resgatar -residir -resolver -respeito -ressaca -restante -resumir -retalho -reter -retirar -retomada -retratar -revelar -revisor -revolta -riacho -rica -rigidez -rigoroso -rimar -ringue -risada -risco -risonho -robalo -rochedo -rodada -rodeio -rodovia -roedor -roleta -romano -roncar -rosado -roseira -rosto -rota -roteiro -rotina -rotular -rouco -roupa -roxo -rubro -rugido -rugoso -ruivo -rumo -rupestre -russo -sabor -saciar -sacola -sacudir -sadio -safira -saga -sagrada -saibro -salada -saleiro -salgado -saliva -salpicar -salsicha -saltar -salvador -sambar -samurai -sanar -sanfona -sangue -sanidade -sapato -sarda -sargento -sarjeta -saturar -saudade -saxofone -sazonal -secar -secular -seda -sedento -sediado -sedoso -sedutor -segmento -segredo -segundo -seiva -seleto -selvagem -semanal -semente -senador -senhor -sensual -sentado -separado -sereia -seringa -serra -servo -setembro -setor -sigilo -silhueta -silicone -simetria -simpatia -simular -sinal -sincero -singular -sinopse -sintonia -sirene -siri -situado -soberano -sobra -socorro -sogro -soja -solda -soletrar -solteiro -sombrio -sonata -sondar -sonegar -sonhador -sono -soprano -soquete -sorrir -sorteio -sossego -sotaque -soterrar -sovado -sozinho -suavizar -subida -submerso -subsolo -subtrair -sucata -sucesso -suco -sudeste -sufixo -sugador -sugerir -sujeito -sulfato -sumir -suor -superior -suplicar -suposto -suprimir -surdina -surfista -surpresa -surreal -surtir -suspiro -sustento -tabela -tablete -tabuada -tacho -tagarela -talher -talo -talvez -tamanho -tamborim -tampa -tangente -tanto -tapar -tapioca -tardio -tarefa -tarja -tarraxa -tatuagem -taurino -taxativo -taxista -teatral -tecer -tecido -teclado -tedioso -teia -teimar -telefone -telhado -tempero -tenente -tensor -tentar -termal -terno -terreno -tese -tesoura -testado -teto -textura -texugo -tiara -tigela -tijolo -timbrar -timidez -tingido -tinteiro -tiragem -titular -toalha -tocha -tolerar -tolice -tomada -tomilho -tonel -tontura -topete -tora -torcido -torneio -torque -torrada -torto -tostar -touca -toupeira -toxina -trabalho -tracejar -tradutor -trafegar -trajeto -trama -trancar -trapo -traseiro -tratador -travar -treino -tremer -trepidar -trevo -triagem -tribo -triciclo -tridente -trilogia -trindade -triplo -triturar -triunfal -trocar -trombeta -trova -trunfo -truque -tubular -tucano -tudo -tulipa -tupi -turbo -turma -turquesa -tutelar -tutorial -uivar -umbigo -unha -unidade -uniforme -urologia -urso -urtiga -urubu -usado -usina -usufruir -vacina -vadiar -vagaroso -vaidoso -vala -valente -validade -valores -vantagem -vaqueiro -varanda -vareta -varrer -vascular -vasilha -vassoura -vazar -vazio -veado -vedar -vegetar -veicular -veleiro -velhice -veludo -vencedor -vendaval -venerar -ventre -verbal -verdade -vereador -vergonha -vermelho -verniz -versar -vertente -vespa -vestido -vetorial -viaduto -viagem -viajar -viatura -vibrador -videira -vidraria -viela -viga -vigente -vigiar -vigorar -vilarejo -vinco -vinheta -vinil -violeta -virada -virtude -visitar -visto -vitral -viveiro -vizinho -voador -voar -vogal -volante -voleibol -voltagem -volumoso -vontade -vulto -vuvuzela -xadrez -xarope -xeque -xeretar -xerife -xingar -zangado -zarpar -zebu -zelador -zombar -zoologia -zumbido`.split('\n'); diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/simplified-chinese.d.ts b/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/simplified-chinese.d.ts deleted file mode 100644 index b566a1db..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/simplified-chinese.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const wordlist: string[]; diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/simplified-chinese.js b/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/simplified-chinese.js deleted file mode 100644 index 43ac9d2c..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/simplified-chinese.js +++ /dev/null @@ -1,2051 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.wordlist = void 0; -exports.wordlist = `的 -一 -是 -在 -不 -了 -有 -和 -人 -这 -中 -大 -为 -上 -个 -国 -我 -以 -要 -他 -时 -来 -用 -们 -生 -到 -作 -地 -于 -出 -就 -分 -对 -成 -会 -可 -主 -发 -年 -动 -同 -工 -也 -能 -下 -过 -子 -说 -产 -种 -面 -而 -方 -后 -多 -定 -行 -学 -法 -所 -民 -得 -经 -十 -三 -之 -进 -着 -等 -部 -度 -家 -电 -力 -里 -如 -水 -化 -高 -自 -二 -理 -起 -小 -物 -现 -实 -加 -量 -都 -两 -体 -制 -机 -当 -使 -点 -从 -业 -本 -去 -把 -性 -好 -应 -开 -它 -合 -还 -因 -由 -其 -些 -然 -前 -外 -天 -政 -四 -日 -那 -社 -义 -事 -平 -形 -相 -全 -表 -间 -样 -与 -关 -各 -重 -新 -线 -内 -数 -正 -心 -反 -你 -明 -看 -原 -又 -么 -利 -比 -或 -但 -质 -气 -第 -向 -道 -命 -此 -变 -条 -只 -没 -结 -解 -问 -意 -建 -月 -公 -无 -系 -军 -很 -情 -者 -最 -立 -代 -想 -已 -通 -并 -提 -直 -题 -党 -程 -展 -五 -果 -料 -象 -员 -革 -位 -入 -常 -文 -总 -次 -品 -式 -活 -设 -及 -管 -特 -件 -长 -求 -老 -头 -基 -资 -边 -流 -路 -级 -少 -图 -山 -统 -接 -知 -较 -将 -组 -见 -计 -别 -她 -手 -角 -期 -根 -论 -运 -农 -指 -几 -九 -区 -强 -放 -决 -西 -被 -干 -做 -必 -战 -先 -回 -则 -任 -取 -据 -处 -队 -南 -给 -色 -光 -门 -即 -保 -治 -北 -造 -百 -规 -热 -领 -七 -海 -口 -东 -导 -器 -压 -志 -世 -金 -增 -争 -济 -阶 -油 -思 -术 -极 -交 -受 -联 -什 -认 -六 -共 -权 -收 -证 -改 -清 -美 -再 -采 -转 -更 -单 -风 -切 -打 -白 -教 -速 -花 -带 -安 -场 -身 -车 -例 -真 -务 -具 -万 -每 -目 -至 -达 -走 -积 -示 -议 -声 -报 -斗 -完 -类 -八 -离 -华 -名 -确 -才 -科 -张 -信 -马 -节 -话 -米 -整 -空 -元 -况 -今 -集 -温 -传 -土 -许 -步 -群 -广 -石 -记 -需 -段 -研 -界 -拉 -林 -律 -叫 -且 -究 -观 -越 -织 -装 -影 -算 -低 -持 -音 -众 -书 -布 -复 -容 -儿 -须 -际 -商 -非 -验 -连 -断 -深 -难 -近 -矿 -千 -周 -委 -素 -技 -备 -半 -办 -青 -省 -列 -习 -响 -约 -支 -般 -史 -感 -劳 -便 -团 -往 -酸 -历 -市 -克 -何 -除 -消 -构 -府 -称 -太 -准 -精 -值 -号 -率 -族 -维 -划 -选 -标 -写 -存 -候 -毛 -亲 -快 -效 -斯 -院 -查 -江 -型 -眼 -王 -按 -格 -养 -易 -置 -派 -层 -片 -始 -却 -专 -状 -育 -厂 -京 -识 -适 -属 -圆 -包 -火 -住 -调 -满 -县 -局 -照 -参 -红 -细 -引 -听 -该 -铁 -价 -严 -首 -底 -液 -官 -德 -随 -病 -苏 -失 -尔 -死 -讲 -配 -女 -黄 -推 -显 -谈 -罪 -神 -艺 -呢 -席 -含 -企 -望 -密 -批 -营 -项 -防 -举 -球 -英 -氧 -势 -告 -李 -台 -落 -木 -帮 -轮 -破 -亚 -师 -围 -注 -远 -字 -材 -排 -供 -河 -态 -封 -另 -施 -减 -树 -溶 -怎 -止 -案 -言 -士 -均 -武 -固 -叶 -鱼 -波 -视 -仅 -费 -紧 -爱 -左 -章 -早 -朝 -害 -续 -轻 -服 -试 -食 -充 -兵 -源 -判 -护 -司 -足 -某 -练 -差 -致 -板 -田 -降 -黑 -犯 -负 -击 -范 -继 -兴 -似 -余 -坚 -曲 -输 -修 -故 -城 -夫 -够 -送 -笔 -船 -占 -右 -财 -吃 -富 -春 -职 -觉 -汉 -画 -功 -巴 -跟 -虽 -杂 -飞 -检 -吸 -助 -升 -阳 -互 -初 -创 -抗 -考 -投 -坏 -策 -古 -径 -换 -未 -跑 -留 -钢 -曾 -端 -责 -站 -简 -述 -钱 -副 -尽 -帝 -射 -草 -冲 -承 -独 -令 -限 -阿 -宣 -环 -双 -请 -超 -微 -让 -控 -州 -良 -轴 -找 -否 -纪 -益 -依 -优 -顶 -础 -载 -倒 -房 -突 -坐 -粉 -敌 -略 -客 -袁 -冷 -胜 -绝 -析 -块 -剂 -测 -丝 -协 -诉 -念 -陈 -仍 -罗 -盐 -友 -洋 -错 -苦 -夜 -刑 -移 -频 -逐 -靠 -混 -母 -短 -皮 -终 -聚 -汽 -村 -云 -哪 -既 -距 -卫 -停 -烈 -央 -察 -烧 -迅 -境 -若 -印 -洲 -刻 -括 -激 -孔 -搞 -甚 -室 -待 -核 -校 -散 -侵 -吧 -甲 -游 -久 -菜 -味 -旧 -模 -湖 -货 -损 -预 -阻 -毫 -普 -稳 -乙 -妈 -植 -息 -扩 -银 -语 -挥 -酒 -守 -拿 -序 -纸 -医 -缺 -雨 -吗 -针 -刘 -啊 -急 -唱 -误 -训 -愿 -审 -附 -获 -茶 -鲜 -粮 -斤 -孩 -脱 -硫 -肥 -善 -龙 -演 -父 -渐 -血 -欢 -械 -掌 -歌 -沙 -刚 -攻 -谓 -盾 -讨 -晚 -粒 -乱 -燃 -矛 -乎 -杀 -药 -宁 -鲁 -贵 -钟 -煤 -读 -班 -伯 -香 -介 -迫 -句 -丰 -培 -握 -兰 -担 -弦 -蛋 -沉 -假 -穿 -执 -答 -乐 -谁 -顺 -烟 -缩 -征 -脸 -喜 -松 -脚 -困 -异 -免 -背 -星 -福 -买 -染 -井 -概 -慢 -怕 -磁 -倍 -祖 -皇 -促 -静 -补 -评 -翻 -肉 -践 -尼 -衣 -宽 -扬 -棉 -希 -伤 -操 -垂 -秋 -宜 -氢 -套 -督 -振 -架 -亮 -末 -宪 -庆 -编 -牛 -触 -映 -雷 -销 -诗 -座 -居 -抓 -裂 -胞 -呼 -娘 -景 -威 -绿 -晶 -厚 -盟 -衡 -鸡 -孙 -延 -危 -胶 -屋 -乡 -临 -陆 -顾 -掉 -呀 -灯 -岁 -措 -束 -耐 -剧 -玉 -赵 -跳 -哥 -季 -课 -凯 -胡 -额 -款 -绍 -卷 -齐 -伟 -蒸 -殖 -永 -宗 -苗 -川 -炉 -岩 -弱 -零 -杨 -奏 -沿 -露 -杆 -探 -滑 -镇 -饭 -浓 -航 -怀 -赶 -库 -夺 -伊 -灵 -税 -途 -灭 -赛 -归 -召 -鼓 -播 -盘 -裁 -险 -康 -唯 -录 -菌 -纯 -借 -糖 -盖 -横 -符 -私 -努 -堂 -域 -枪 -润 -幅 -哈 -竟 -熟 -虫 -泽 -脑 -壤 -碳 -欧 -遍 -侧 -寨 -敢 -彻 -虑 -斜 -薄 -庭 -纳 -弹 -饲 -伸 -折 -麦 -湿 -暗 -荷 -瓦 -塞 -床 -筑 -恶 -户 -访 -塔 -奇 -透 -梁 -刀 -旋 -迹 -卡 -氯 -遇 -份 -毒 -泥 -退 -洗 -摆 -灰 -彩 -卖 -耗 -夏 -择 -忙 -铜 -献 -硬 -予 -繁 -圈 -雪 -函 -亦 -抽 -篇 -阵 -阴 -丁 -尺 -追 -堆 -雄 -迎 -泛 -爸 -楼 -避 -谋 -吨 -野 -猪 -旗 -累 -偏 -典 -馆 -索 -秦 -脂 -潮 -爷 -豆 -忽 -托 -惊 -塑 -遗 -愈 -朱 -替 -纤 -粗 -倾 -尚 -痛 -楚 -谢 -奋 -购 -磨 -君 -池 -旁 -碎 -骨 -监 -捕 -弟 -暴 -割 -贯 -殊 -释 -词 -亡 -壁 -顿 -宝 -午 -尘 -闻 -揭 -炮 -残 -冬 -桥 -妇 -警 -综 -招 -吴 -付 -浮 -遭 -徐 -您 -摇 -谷 -赞 -箱 -隔 -订 -男 -吹 -园 -纷 -唐 -败 -宋 -玻 -巨 -耕 -坦 -荣 -闭 -湾 -键 -凡 -驻 -锅 -救 -恩 -剥 -凝 -碱 -齿 -截 -炼 -麻 -纺 -禁 -废 -盛 -版 -缓 -净 -睛 -昌 -婚 -涉 -筒 -嘴 -插 -岸 -朗 -庄 -街 -藏 -姑 -贸 -腐 -奴 -啦 -惯 -乘 -伙 -恢 -匀 -纱 -扎 -辩 -耳 -彪 -臣 -亿 -璃 -抵 -脉 -秀 -萨 -俄 -网 -舞 -店 -喷 -纵 -寸 -汗 -挂 -洪 -贺 -闪 -柬 -爆 -烯 -津 -稻 -墙 -软 -勇 -像 -滚 -厘 -蒙 -芳 -肯 -坡 -柱 -荡 -腿 -仪 -旅 -尾 -轧 -冰 -贡 -登 -黎 -削 -钻 -勒 -逃 -障 -氨 -郭 -峰 -币 -港 -伏 -轨 -亩 -毕 -擦 -莫 -刺 -浪 -秘 -援 -株 -健 -售 -股 -岛 -甘 -泡 -睡 -童 -铸 -汤 -阀 -休 -汇 -舍 -牧 -绕 -炸 -哲 -磷 -绩 -朋 -淡 -尖 -启 -陷 -柴 -呈 -徒 -颜 -泪 -稍 -忘 -泵 -蓝 -拖 -洞 -授 -镜 -辛 -壮 -锋 -贫 -虚 -弯 -摩 -泰 -幼 -廷 -尊 -窗 -纲 -弄 -隶 -疑 -氏 -宫 -姐 -震 -瑞 -怪 -尤 -琴 -循 -描 -膜 -违 -夹 -腰 -缘 -珠 -穷 -森 -枝 -竹 -沟 -催 -绳 -忆 -邦 -剩 -幸 -浆 -栏 -拥 -牙 -贮 -礼 -滤 -钠 -纹 -罢 -拍 -咱 -喊 -袖 -埃 -勤 -罚 -焦 -潜 -伍 -墨 -欲 -缝 -姓 -刊 -饱 -仿 -奖 -铝 -鬼 -丽 -跨 -默 -挖 -链 -扫 -喝 -袋 -炭 -污 -幕 -诸 -弧 -励 -梅 -奶 -洁 -灾 -舟 -鉴 -苯 -讼 -抱 -毁 -懂 -寒 -智 -埔 -寄 -届 -跃 -渡 -挑 -丹 -艰 -贝 -碰 -拔 -爹 -戴 -码 -梦 -芽 -熔 -赤 -渔 -哭 -敬 -颗 -奔 -铅 -仲 -虎 -稀 -妹 -乏 -珍 -申 -桌 -遵 -允 -隆 -螺 -仓 -魏 -锐 -晓 -氮 -兼 -隐 -碍 -赫 -拨 -忠 -肃 -缸 -牵 -抢 -博 -巧 -壳 -兄 -杜 -讯 -诚 -碧 -祥 -柯 -页 -巡 -矩 -悲 -灌 -龄 -伦 -票 -寻 -桂 -铺 -圣 -恐 -恰 -郑 -趣 -抬 -荒 -腾 -贴 -柔 -滴 -猛 -阔 -辆 -妻 -填 -撤 -储 -签 -闹 -扰 -紫 -砂 -递 -戏 -吊 -陶 -伐 -喂 -疗 -瓶 -婆 -抚 -臂 -摸 -忍 -虾 -蜡 -邻 -胸 -巩 -挤 -偶 -弃 -槽 -劲 -乳 -邓 -吉 -仁 -烂 -砖 -租 -乌 -舰 -伴 -瓜 -浅 -丙 -暂 -燥 -橡 -柳 -迷 -暖 -牌 -秧 -胆 -详 -簧 -踏 -瓷 -谱 -呆 -宾 -糊 -洛 -辉 -愤 -竞 -隙 -怒 -粘 -乃 -绪 -肩 -籍 -敏 -涂 -熙 -皆 -侦 -悬 -掘 -享 -纠 -醒 -狂 -锁 -淀 -恨 -牲 -霸 -爬 -赏 -逆 -玩 -陵 -祝 -秒 -浙 -貌 -役 -彼 -悉 -鸭 -趋 -凤 -晨 -畜 -辈 -秩 -卵 -署 -梯 -炎 -滩 -棋 -驱 -筛 -峡 -冒 -啥 -寿 -译 -浸 -泉 -帽 -迟 -硅 -疆 -贷 -漏 -稿 -冠 -嫩 -胁 -芯 -牢 -叛 -蚀 -奥 -鸣 -岭 -羊 -凭 -串 -塘 -绘 -酵 -融 -盆 -锡 -庙 -筹 -冻 -辅 -摄 -袭 -筋 -拒 -僚 -旱 -钾 -鸟 -漆 -沈 -眉 -疏 -添 -棒 -穗 -硝 -韩 -逼 -扭 -侨 -凉 -挺 -碗 -栽 -炒 -杯 -患 -馏 -劝 -豪 -辽 -勃 -鸿 -旦 -吏 -拜 -狗 -埋 -辊 -掩 -饮 -搬 -骂 -辞 -勾 -扣 -估 -蒋 -绒 -雾 -丈 -朵 -姆 -拟 -宇 -辑 -陕 -雕 -偿 -蓄 -崇 -剪 -倡 -厅 -咬 -驶 -薯 -刷 -斥 -番 -赋 -奉 -佛 -浇 -漫 -曼 -扇 -钙 -桃 -扶 -仔 -返 -俗 -亏 -腔 -鞋 -棱 -覆 -框 -悄 -叔 -撞 -骗 -勘 -旺 -沸 -孤 -吐 -孟 -渠 -屈 -疾 -妙 -惜 -仰 -狠 -胀 -谐 -抛 -霉 -桑 -岗 -嘛 -衰 -盗 -渗 -脏 -赖 -涌 -甜 -曹 -阅 -肌 -哩 -厉 -烃 -纬 -毅 -昨 -伪 -症 -煮 -叹 -钉 -搭 -茎 -笼 -酷 -偷 -弓 -锥 -恒 -杰 -坑 -鼻 -翼 -纶 -叙 -狱 -逮 -罐 -络 -棚 -抑 -膨 -蔬 -寺 -骤 -穆 -冶 -枯 -册 -尸 -凸 -绅 -坯 -牺 -焰 -轰 -欣 -晋 -瘦 -御 -锭 -锦 -丧 -旬 -锻 -垄 -搜 -扑 -邀 -亭 -酯 -迈 -舒 -脆 -酶 -闲 -忧 -酚 -顽 -羽 -涨 -卸 -仗 -陪 -辟 -惩 -杭 -姚 -肚 -捉 -飘 -漂 -昆 -欺 -吾 -郎 -烷 -汁 -呵 -饰 -萧 -雅 -邮 -迁 -燕 -撒 -姻 -赴 -宴 -烦 -债 -帐 -斑 -铃 -旨 -醇 -董 -饼 -雏 -姿 -拌 -傅 -腹 -妥 -揉 -贤 -拆 -歪 -葡 -胺 -丢 -浩 -徽 -昂 -垫 -挡 -览 -贪 -慰 -缴 -汪 -慌 -冯 -诺 -姜 -谊 -凶 -劣 -诬 -耀 -昏 -躺 -盈 -骑 -乔 -溪 -丛 -卢 -抹 -闷 -咨 -刮 -驾 -缆 -悟 -摘 -铒 -掷 -颇 -幻 -柄 -惠 -惨 -佳 -仇 -腊 -窝 -涤 -剑 -瞧 -堡 -泼 -葱 -罩 -霍 -捞 -胎 -苍 -滨 -俩 -捅 -湘 -砍 -霞 -邵 -萄 -疯 -淮 -遂 -熊 -粪 -烘 -宿 -档 -戈 -驳 -嫂 -裕 -徙 -箭 -捐 -肠 -撑 -晒 -辨 -殿 -莲 -摊 -搅 -酱 -屏 -疫 -哀 -蔡 -堵 -沫 -皱 -畅 -叠 -阁 -莱 -敲 -辖 -钩 -痕 -坝 -巷 -饿 -祸 -丘 -玄 -溜 -曰 -逻 -彭 -尝 -卿 -妨 -艇 -吞 -韦 -怨 -矮 -歇`.split('\n'); diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/spanish.d.ts b/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/spanish.d.ts deleted file mode 100644 index b566a1db..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/spanish.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const wordlist: string[]; diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/spanish.js b/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/spanish.js deleted file mode 100644 index 0a8328a1..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/spanish.js +++ /dev/null @@ -1,2051 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.wordlist = void 0; -exports.wordlist = `ábaco -abdomen -abeja -abierto -abogado -abono -aborto -abrazo -abrir -abuelo -abuso -acabar -academia -acceso -acción -aceite -acelga -acento -aceptar -ácido -aclarar -acné -acoger -acoso -activo -acto -actriz -actuar -acudir -acuerdo -acusar -adicto -admitir -adoptar -adorno -aduana -adulto -aéreo -afectar -afición -afinar -afirmar -ágil -agitar -agonía -agosto -agotar -agregar -agrio -agua -agudo -águila -aguja -ahogo -ahorro -aire -aislar -ajedrez -ajeno -ajuste -alacrán -alambre -alarma -alba -álbum -alcalde -aldea -alegre -alejar -alerta -aleta -alfiler -alga -algodón -aliado -aliento -alivio -alma -almeja -almíbar -altar -alteza -altivo -alto -altura -alumno -alzar -amable -amante -amapola -amargo -amasar -ámbar -ámbito -ameno -amigo -amistad -amor -amparo -amplio -ancho -anciano -ancla -andar -andén -anemia -ángulo -anillo -ánimo -anís -anotar -antena -antiguo -antojo -anual -anular -anuncio -añadir -añejo -año -apagar -aparato -apetito -apio -aplicar -apodo -aporte -apoyo -aprender -aprobar -apuesta -apuro -arado -araña -arar -árbitro -árbol -arbusto -archivo -arco -arder -ardilla -arduo -área -árido -aries -armonía -arnés -aroma -arpa -arpón -arreglo -arroz -arruga -arte -artista -asa -asado -asalto -ascenso -asegurar -aseo -asesor -asiento -asilo -asistir -asno -asombro -áspero -astilla -astro -astuto -asumir -asunto -atajo -ataque -atar -atento -ateo -ático -atleta -átomo -atraer -atroz -atún -audaz -audio -auge -aula -aumento -ausente -autor -aval -avance -avaro -ave -avellana -avena -avestruz -avión -aviso -ayer -ayuda -ayuno -azafrán -azar -azote -azúcar -azufre -azul -baba -babor -bache -bahía -baile -bajar -balanza -balcón -balde -bambú -banco -banda -baño -barba -barco -barniz -barro -báscula -bastón -basura -batalla -batería -batir -batuta -baúl -bazar -bebé -bebida -bello -besar -beso -bestia -bicho -bien -bingo -blanco -bloque -blusa -boa -bobina -bobo -boca -bocina -boda -bodega -boina -bola -bolero -bolsa -bomba -bondad -bonito -bono -bonsái -borde -borrar -bosque -bote -botín -bóveda -bozal -bravo -brazo -brecha -breve -brillo -brinco -brisa -broca -broma -bronce -brote -bruja -brusco -bruto -buceo -bucle -bueno -buey -bufanda -bufón -búho -buitre -bulto -burbuja -burla -burro -buscar -butaca -buzón -caballo -cabeza -cabina -cabra -cacao -cadáver -cadena -caer -café -caída -caimán -caja -cajón -cal -calamar -calcio -caldo -calidad -calle -calma -calor -calvo -cama -cambio -camello -camino -campo -cáncer -candil -canela -canguro -canica -canto -caña -cañón -caoba -caos -capaz -capitán -capote -captar -capucha -cara -carbón -cárcel -careta -carga -cariño -carne -carpeta -carro -carta -casa -casco -casero -caspa -castor -catorce -catre -caudal -causa -cazo -cebolla -ceder -cedro -celda -célebre -celoso -célula -cemento -ceniza -centro -cerca -cerdo -cereza -cero -cerrar -certeza -césped -cetro -chacal -chaleco -champú -chancla -chapa -charla -chico -chiste -chivo -choque -choza -chuleta -chupar -ciclón -ciego -cielo -cien -cierto -cifra -cigarro -cima -cinco -cine -cinta -ciprés -circo -ciruela -cisne -cita -ciudad -clamor -clan -claro -clase -clave -cliente -clima -clínica -cobre -cocción -cochino -cocina -coco -código -codo -cofre -coger -cohete -cojín -cojo -cola -colcha -colegio -colgar -colina -collar -colmo -columna -combate -comer -comida -cómodo -compra -conde -conejo -conga -conocer -consejo -contar -copa -copia -corazón -corbata -corcho -cordón -corona -correr -coser -cosmos -costa -cráneo -cráter -crear -crecer -creído -crema -cría -crimen -cripta -crisis -cromo -crónica -croqueta -crudo -cruz -cuadro -cuarto -cuatro -cubo -cubrir -cuchara -cuello -cuento -cuerda -cuesta -cueva -cuidar -culebra -culpa -culto -cumbre -cumplir -cuna -cuneta -cuota -cupón -cúpula -curar -curioso -curso -curva -cutis -dama -danza -dar -dardo -dátil -deber -débil -década -decir -dedo -defensa -definir -dejar -delfín -delgado -delito -demora -denso -dental -deporte -derecho -derrota -desayuno -deseo -desfile -desnudo -destino -desvío -detalle -detener -deuda -día -diablo -diadema -diamante -diana -diario -dibujo -dictar -diente -dieta -diez -difícil -digno -dilema -diluir -dinero -directo -dirigir -disco -diseño -disfraz -diva -divino -doble -doce -dolor -domingo -don -donar -dorado -dormir -dorso -dos -dosis -dragón -droga -ducha -duda -duelo -dueño -dulce -dúo -duque -durar -dureza -duro -ébano -ebrio -echar -eco -ecuador -edad -edición -edificio -editor -educar -efecto -eficaz -eje -ejemplo -elefante -elegir -elemento -elevar -elipse -élite -elixir -elogio -eludir -embudo -emitir -emoción -empate -empeño -empleo -empresa -enano -encargo -enchufe -encía -enemigo -enero -enfado -enfermo -engaño -enigma -enlace -enorme -enredo -ensayo -enseñar -entero -entrar -envase -envío -época -equipo -erizo -escala -escena -escolar -escribir -escudo -esencia -esfera -esfuerzo -espada -espejo -espía -esposa -espuma -esquí -estar -este -estilo -estufa -etapa -eterno -ética -etnia -evadir -evaluar -evento -evitar -exacto -examen -exceso -excusa -exento -exigir -exilio -existir -éxito -experto -explicar -exponer -extremo -fábrica -fábula -fachada -fácil -factor -faena -faja -falda -fallo -falso -faltar -fama -familia -famoso -faraón -farmacia -farol -farsa -fase -fatiga -fauna -favor -fax -febrero -fecha -feliz -feo -feria -feroz -fértil -fervor -festín -fiable -fianza -fiar -fibra -ficción -ficha -fideo -fiebre -fiel -fiera -fiesta -figura -fijar -fijo -fila -filete -filial -filtro -fin -finca -fingir -finito -firma -flaco -flauta -flecha -flor -flota -fluir -flujo -flúor -fobia -foca -fogata -fogón -folio -folleto -fondo -forma -forro -fortuna -forzar -fosa -foto -fracaso -frágil -franja -frase -fraude -freír -freno -fresa -frío -frito -fruta -fuego -fuente -fuerza -fuga -fumar -función -funda -furgón -furia -fusil -fútbol -futuro -gacela -gafas -gaita -gajo -gala -galería -gallo -gamba -ganar -gancho -ganga -ganso -garaje -garza -gasolina -gastar -gato -gavilán -gemelo -gemir -gen -género -genio -gente -geranio -gerente -germen -gesto -gigante -gimnasio -girar -giro -glaciar -globo -gloria -gol -golfo -goloso -golpe -goma -gordo -gorila -gorra -gota -goteo -gozar -grada -gráfico -grano -grasa -gratis -grave -grieta -grillo -gripe -gris -grito -grosor -grúa -grueso -grumo -grupo -guante -guapo -guardia -guerra -guía -guiño -guion -guiso -guitarra -gusano -gustar -haber -hábil -hablar -hacer -hacha -hada -hallar -hamaca -harina -haz -hazaña -hebilla -hebra -hecho -helado -helio -hembra -herir -hermano -héroe -hervir -hielo -hierro -hígado -higiene -hijo -himno -historia -hocico -hogar -hoguera -hoja -hombre -hongo -honor -honra -hora -hormiga -horno -hostil -hoyo -hueco -huelga -huerta -hueso -huevo -huida -huir -humano -húmedo -humilde -humo -hundir -huracán -hurto -icono -ideal -idioma -ídolo -iglesia -iglú -igual -ilegal -ilusión -imagen -imán -imitar -impar -imperio -imponer -impulso -incapaz -índice -inerte -infiel -informe -ingenio -inicio -inmenso -inmune -innato -insecto -instante -interés -íntimo -intuir -inútil -invierno -ira -iris -ironía -isla -islote -jabalí -jabón -jamón -jarabe -jardín -jarra -jaula -jazmín -jefe -jeringa -jinete -jornada -joroba -joven -joya -juerga -jueves -juez -jugador -jugo -juguete -juicio -junco -jungla -junio -juntar -júpiter -jurar -justo -juvenil -juzgar -kilo -koala -labio -lacio -lacra -lado -ladrón -lagarto -lágrima -laguna -laico -lamer -lámina -lámpara -lana -lancha -langosta -lanza -lápiz -largo -larva -lástima -lata -látex -latir -laurel -lavar -lazo -leal -lección -leche -lector -leer -legión -legumbre -lejano -lengua -lento -leña -león -leopardo -lesión -letal -letra -leve -leyenda -libertad -libro -licor -líder -lidiar -lienzo -liga -ligero -lima -límite -limón -limpio -lince -lindo -línea -lingote -lino -linterna -líquido -liso -lista -litera -litio -litro -llaga -llama -llanto -llave -llegar -llenar -llevar -llorar -llover -lluvia -lobo -loción -loco -locura -lógica -logro -lombriz -lomo -lonja -lote -lucha -lucir -lugar -lujo -luna -lunes -lupa -lustro -luto -luz -maceta -macho -madera -madre -maduro -maestro -mafia -magia -mago -maíz -maldad -maleta -malla -malo -mamá -mambo -mamut -manco -mando -manejar -manga -maniquí -manjar -mano -manso -manta -mañana -mapa -máquina -mar -marco -marea -marfil -margen -marido -mármol -marrón -martes -marzo -masa -máscara -masivo -matar -materia -matiz -matriz -máximo -mayor -mazorca -mecha -medalla -medio -médula -mejilla -mejor -melena -melón -memoria -menor -mensaje -mente -menú -mercado -merengue -mérito -mes -mesón -meta -meter -método -metro -mezcla -miedo -miel -miembro -miga -mil -milagro -militar -millón -mimo -mina -minero -mínimo -minuto -miope -mirar -misa -miseria -misil -mismo -mitad -mito -mochila -moción -moda -modelo -moho -mojar -molde -moler -molino -momento -momia -monarca -moneda -monja -monto -moño -morada -morder -moreno -morir -morro -morsa -mortal -mosca -mostrar -motivo -mover -móvil -mozo -mucho -mudar -mueble -muela -muerte -muestra -mugre -mujer -mula -muleta -multa -mundo -muñeca -mural -muro -músculo -museo -musgo -música -muslo -nácar -nación -nadar -naipe -naranja -nariz -narrar -nasal -natal -nativo -natural -náusea -naval -nave -navidad -necio -néctar -negar -negocio -negro -neón -nervio -neto -neutro -nevar -nevera -nicho -nido -niebla -nieto -niñez -niño -nítido -nivel -nobleza -noche -nómina -noria -norma -norte -nota -noticia -novato -novela -novio -nube -nuca -núcleo -nudillo -nudo -nuera -nueve -nuez -nulo -número -nutria -oasis -obeso -obispo -objeto -obra -obrero -observar -obtener -obvio -oca -ocaso -océano -ochenta -ocho -ocio -ocre -octavo -octubre -oculto -ocupar -ocurrir -odiar -odio -odisea -oeste -ofensa -oferta -oficio -ofrecer -ogro -oído -oír -ojo -ola -oleada -olfato -olivo -olla -olmo -olor -olvido -ombligo -onda -onza -opaco -opción -ópera -opinar -oponer -optar -óptica -opuesto -oración -orador -oral -órbita -orca -orden -oreja -órgano -orgía -orgullo -oriente -origen -orilla -oro -orquesta -oruga -osadía -oscuro -osezno -oso -ostra -otoño -otro -oveja -óvulo -óxido -oxígeno -oyente -ozono -pacto -padre -paella -página -pago -país -pájaro -palabra -palco -paleta -pálido -palma -paloma -palpar -pan -panal -pánico -pantera -pañuelo -papá -papel -papilla -paquete -parar -parcela -pared -parir -paro -párpado -parque -párrafo -parte -pasar -paseo -pasión -paso -pasta -pata -patio -patria -pausa -pauta -pavo -payaso -peatón -pecado -pecera -pecho -pedal -pedir -pegar -peine -pelar -peldaño -pelea -peligro -pellejo -pelo -peluca -pena -pensar -peñón -peón -peor -pepino -pequeño -pera -percha -perder -pereza -perfil -perico -perla -permiso -perro -persona -pesa -pesca -pésimo -pestaña -pétalo -petróleo -pez -pezuña -picar -pichón -pie -piedra -pierna -pieza -pijama -pilar -piloto -pimienta -pino -pintor -pinza -piña -piojo -pipa -pirata -pisar -piscina -piso -pista -pitón -pizca -placa -plan -plata -playa -plaza -pleito -pleno -plomo -pluma -plural -pobre -poco -poder -podio -poema -poesía -poeta -polen -policía -pollo -polvo -pomada -pomelo -pomo -pompa -poner -porción -portal -posada -poseer -posible -poste -potencia -potro -pozo -prado -precoz -pregunta -premio -prensa -preso -previo -primo -príncipe -prisión -privar -proa -probar -proceso -producto -proeza -profesor -programa -prole -promesa -pronto -propio -próximo -prueba -público -puchero -pudor -pueblo -puerta -puesto -pulga -pulir -pulmón -pulpo -pulso -puma -punto -puñal -puño -pupa -pupila -puré -quedar -queja -quemar -querer -queso -quieto -química -quince -quitar -rábano -rabia -rabo -ración -radical -raíz -rama -rampa -rancho -rango -rapaz -rápido -rapto -rasgo -raspa -rato -rayo -raza -razón -reacción -realidad -rebaño -rebote -recaer -receta -rechazo -recoger -recreo -recto -recurso -red -redondo -reducir -reflejo -reforma -refrán -refugio -regalo -regir -regla -regreso -rehén -reino -reír -reja -relato -relevo -relieve -relleno -reloj -remar -remedio -remo -rencor -rendir -renta -reparto -repetir -reposo -reptil -res -rescate -resina -respeto -resto -resumen -retiro -retorno -retrato -reunir -revés -revista -rey -rezar -rico -riego -rienda -riesgo -rifa -rígido -rigor -rincón -riñón -río -riqueza -risa -ritmo -rito -rizo -roble -roce -rociar -rodar -rodeo -rodilla -roer -rojizo -rojo -romero -romper -ron -ronco -ronda -ropa -ropero -rosa -rosca -rostro -rotar -rubí -rubor -rudo -rueda -rugir -ruido -ruina -ruleta -rulo -rumbo -rumor -ruptura -ruta -rutina -sábado -saber -sabio -sable -sacar -sagaz -sagrado -sala -saldo -salero -salir -salmón -salón -salsa -salto -salud -salvar -samba -sanción -sandía -sanear -sangre -sanidad -sano -santo -sapo -saque -sardina -sartén -sastre -satán -sauna -saxofón -sección -seco -secreto -secta -sed -seguir -seis -sello -selva -semana -semilla -senda -sensor -señal -señor -separar -sepia -sequía -ser -serie -sermón -servir -sesenta -sesión -seta -setenta -severo -sexo -sexto -sidra -siesta -siete -siglo -signo -sílaba -silbar -silencio -silla -símbolo -simio -sirena -sistema -sitio -situar -sobre -socio -sodio -sol -solapa -soldado -soledad -sólido -soltar -solución -sombra -sondeo -sonido -sonoro -sonrisa -sopa -soplar -soporte -sordo -sorpresa -sorteo -sostén -sótano -suave -subir -suceso -sudor -suegra -suelo -sueño -suerte -sufrir -sujeto -sultán -sumar -superar -suplir -suponer -supremo -sur -surco -sureño -surgir -susto -sutil -tabaco -tabique -tabla -tabú -taco -tacto -tajo -talar -talco -talento -talla -talón -tamaño -tambor -tango -tanque -tapa -tapete -tapia -tapón -taquilla -tarde -tarea -tarifa -tarjeta -tarot -tarro -tarta -tatuaje -tauro -taza -tazón -teatro -techo -tecla -técnica -tejado -tejer -tejido -tela -teléfono -tema -temor -templo -tenaz -tender -tener -tenis -tenso -teoría -terapia -terco -término -ternura -terror -tesis -tesoro -testigo -tetera -texto -tez -tibio -tiburón -tiempo -tienda -tierra -tieso -tigre -tijera -tilde -timbre -tímido -timo -tinta -tío -típico -tipo -tira -tirón -titán -títere -título -tiza -toalla -tobillo -tocar -tocino -todo -toga -toldo -tomar -tono -tonto -topar -tope -toque -tórax -torero -tormenta -torneo -toro -torpedo -torre -torso -tortuga -tos -tosco -toser -tóxico -trabajo -tractor -traer -tráfico -trago -traje -tramo -trance -trato -trauma -trazar -trébol -tregua -treinta -tren -trepar -tres -tribu -trigo -tripa -triste -triunfo -trofeo -trompa -tronco -tropa -trote -trozo -truco -trueno -trufa -tubería -tubo -tuerto -tumba -tumor -túnel -túnica -turbina -turismo -turno -tutor -ubicar -úlcera -umbral -unidad -unir -universo -uno -untar -uña -urbano -urbe -urgente -urna -usar -usuario -útil -utopía -uva -vaca -vacío -vacuna -vagar -vago -vaina -vajilla -vale -válido -valle -valor -válvula -vampiro -vara -variar -varón -vaso -vecino -vector -vehículo -veinte -vejez -vela -velero -veloz -vena -vencer -venda -veneno -vengar -venir -venta -venus -ver -verano -verbo -verde -vereda -verja -verso -verter -vía -viaje -vibrar -vicio -víctima -vida -vídeo -vidrio -viejo -viernes -vigor -vil -villa -vinagre -vino -viñedo -violín -viral -virgo -virtud -visor -víspera -vista -vitamina -viudo -vivaz -vivero -vivir -vivo -volcán -volumen -volver -voraz -votar -voto -voz -vuelo -vulgar -yacer -yate -yegua -yema -yerno -yeso -yodo -yoga -yogur -zafiro -zanja -zapato -zarza -zona -zorro -zumo -zurdo`.split('\n'); diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/traditional-chinese.d.ts b/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/traditional-chinese.d.ts deleted file mode 100644 index b566a1db..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/traditional-chinese.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const wordlist: string[]; diff --git a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/traditional-chinese.js b/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/traditional-chinese.js deleted file mode 100644 index 789a0bc7..00000000 --- a/tools/mnemonic-test/node_modules/@scure/bip39/wordlists/traditional-chinese.js +++ /dev/null @@ -1,2051 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.wordlist = void 0; -exports.wordlist = `的 -一 -是 -在 -不 -了 -有 -和 -人 -這 -中 -大 -為 -上 -個 -國 -我 -以 -要 -他 -時 -來 -用 -們 -生 -到 -作 -地 -於 -出 -就 -分 -對 -成 -會 -可 -主 -發 -年 -動 -同 -工 -也 -能 -下 -過 -子 -說 -產 -種 -面 -而 -方 -後 -多 -定 -行 -學 -法 -所 -民 -得 -經 -十 -三 -之 -進 -著 -等 -部 -度 -家 -電 -力 -裡 -如 -水 -化 -高 -自 -二 -理 -起 -小 -物 -現 -實 -加 -量 -都 -兩 -體 -制 -機 -當 -使 -點 -從 -業 -本 -去 -把 -性 -好 -應 -開 -它 -合 -還 -因 -由 -其 -些 -然 -前 -外 -天 -政 -四 -日 -那 -社 -義 -事 -平 -形 -相 -全 -表 -間 -樣 -與 -關 -各 -重 -新 -線 -內 -數 -正 -心 -反 -你 -明 -看 -原 -又 -麼 -利 -比 -或 -但 -質 -氣 -第 -向 -道 -命 -此 -變 -條 -只 -沒 -結 -解 -問 -意 -建 -月 -公 -無 -系 -軍 -很 -情 -者 -最 -立 -代 -想 -已 -通 -並 -提 -直 -題 -黨 -程 -展 -五 -果 -料 -象 -員 -革 -位 -入 -常 -文 -總 -次 -品 -式 -活 -設 -及 -管 -特 -件 -長 -求 -老 -頭 -基 -資 -邊 -流 -路 -級 -少 -圖 -山 -統 -接 -知 -較 -將 -組 -見 -計 -別 -她 -手 -角 -期 -根 -論 -運 -農 -指 -幾 -九 -區 -強 -放 -決 -西 -被 -幹 -做 -必 -戰 -先 -回 -則 -任 -取 -據 -處 -隊 -南 -給 -色 -光 -門 -即 -保 -治 -北 -造 -百 -規 -熱 -領 -七 -海 -口 -東 -導 -器 -壓 -志 -世 -金 -增 -爭 -濟 -階 -油 -思 -術 -極 -交 -受 -聯 -什 -認 -六 -共 -權 -收 -證 -改 -清 -美 -再 -採 -轉 -更 -單 -風 -切 -打 -白 -教 -速 -花 -帶 -安 -場 -身 -車 -例 -真 -務 -具 -萬 -每 -目 -至 -達 -走 -積 -示 -議 -聲 -報 -鬥 -完 -類 -八 -離 -華 -名 -確 -才 -科 -張 -信 -馬 -節 -話 -米 -整 -空 -元 -況 -今 -集 -溫 -傳 -土 -許 -步 -群 -廣 -石 -記 -需 -段 -研 -界 -拉 -林 -律 -叫 -且 -究 -觀 -越 -織 -裝 -影 -算 -低 -持 -音 -眾 -書 -布 -复 -容 -兒 -須 -際 -商 -非 -驗 -連 -斷 -深 -難 -近 -礦 -千 -週 -委 -素 -技 -備 -半 -辦 -青 -省 -列 -習 -響 -約 -支 -般 -史 -感 -勞 -便 -團 -往 -酸 -歷 -市 -克 -何 -除 -消 -構 -府 -稱 -太 -準 -精 -值 -號 -率 -族 -維 -劃 -選 -標 -寫 -存 -候 -毛 -親 -快 -效 -斯 -院 -查 -江 -型 -眼 -王 -按 -格 -養 -易 -置 -派 -層 -片 -始 -卻 -專 -狀 -育 -廠 -京 -識 -適 -屬 -圓 -包 -火 -住 -調 -滿 -縣 -局 -照 -參 -紅 -細 -引 -聽 -該 -鐵 -價 -嚴 -首 -底 -液 -官 -德 -隨 -病 -蘇 -失 -爾 -死 -講 -配 -女 -黃 -推 -顯 -談 -罪 -神 -藝 -呢 -席 -含 -企 -望 -密 -批 -營 -項 -防 -舉 -球 -英 -氧 -勢 -告 -李 -台 -落 -木 -幫 -輪 -破 -亞 -師 -圍 -注 -遠 -字 -材 -排 -供 -河 -態 -封 -另 -施 -減 -樹 -溶 -怎 -止 -案 -言 -士 -均 -武 -固 -葉 -魚 -波 -視 -僅 -費 -緊 -愛 -左 -章 -早 -朝 -害 -續 -輕 -服 -試 -食 -充 -兵 -源 -判 -護 -司 -足 -某 -練 -差 -致 -板 -田 -降 -黑 -犯 -負 -擊 -范 -繼 -興 -似 -餘 -堅 -曲 -輸 -修 -故 -城 -夫 -夠 -送 -筆 -船 -佔 -右 -財 -吃 -富 -春 -職 -覺 -漢 -畫 -功 -巴 -跟 -雖 -雜 -飛 -檢 -吸 -助 -昇 -陽 -互 -初 -創 -抗 -考 -投 -壞 -策 -古 -徑 -換 -未 -跑 -留 -鋼 -曾 -端 -責 -站 -簡 -述 -錢 -副 -盡 -帝 -射 -草 -衝 -承 -獨 -令 -限 -阿 -宣 -環 -雙 -請 -超 -微 -讓 -控 -州 -良 -軸 -找 -否 -紀 -益 -依 -優 -頂 -礎 -載 -倒 -房 -突 -坐 -粉 -敵 -略 -客 -袁 -冷 -勝 -絕 -析 -塊 -劑 -測 -絲 -協 -訴 -念 -陳 -仍 -羅 -鹽 -友 -洋 -錯 -苦 -夜 -刑 -移 -頻 -逐 -靠 -混 -母 -短 -皮 -終 -聚 -汽 -村 -雲 -哪 -既 -距 -衛 -停 -烈 -央 -察 -燒 -迅 -境 -若 -印 -洲 -刻 -括 -激 -孔 -搞 -甚 -室 -待 -核 -校 -散 -侵 -吧 -甲 -遊 -久 -菜 -味 -舊 -模 -湖 -貨 -損 -預 -阻 -毫 -普 -穩 -乙 -媽 -植 -息 -擴 -銀 -語 -揮 -酒 -守 -拿 -序 -紙 -醫 -缺 -雨 -嗎 -針 -劉 -啊 -急 -唱 -誤 -訓 -願 -審 -附 -獲 -茶 -鮮 -糧 -斤 -孩 -脫 -硫 -肥 -善 -龍 -演 -父 -漸 -血 -歡 -械 -掌 -歌 -沙 -剛 -攻 -謂 -盾 -討 -晚 -粒 -亂 -燃 -矛 -乎 -殺 -藥 -寧 -魯 -貴 -鐘 -煤 -讀 -班 -伯 -香 -介 -迫 -句 -豐 -培 -握 -蘭 -擔 -弦 -蛋 -沉 -假 -穿 -執 -答 -樂 -誰 -順 -煙 -縮 -徵 -臉 -喜 -松 -腳 -困 -異 -免 -背 -星 -福 -買 -染 -井 -概 -慢 -怕 -磁 -倍 -祖 -皇 -促 -靜 -補 -評 -翻 -肉 -踐 -尼 -衣 -寬 -揚 -棉 -希 -傷 -操 -垂 -秋 -宜 -氫 -套 -督 -振 -架 -亮 -末 -憲 -慶 -編 -牛 -觸 -映 -雷 -銷 -詩 -座 -居 -抓 -裂 -胞 -呼 -娘 -景 -威 -綠 -晶 -厚 -盟 -衡 -雞 -孫 -延 -危 -膠 -屋 -鄉 -臨 -陸 -顧 -掉 -呀 -燈 -歲 -措 -束 -耐 -劇 -玉 -趙 -跳 -哥 -季 -課 -凱 -胡 -額 -款 -紹 -卷 -齊 -偉 -蒸 -殖 -永 -宗 -苗 -川 -爐 -岩 -弱 -零 -楊 -奏 -沿 -露 -桿 -探 -滑 -鎮 -飯 -濃 -航 -懷 -趕 -庫 -奪 -伊 -靈 -稅 -途 -滅 -賽 -歸 -召 -鼓 -播 -盤 -裁 -險 -康 -唯 -錄 -菌 -純 -借 -糖 -蓋 -橫 -符 -私 -努 -堂 -域 -槍 -潤 -幅 -哈 -竟 -熟 -蟲 -澤 -腦 -壤 -碳 -歐 -遍 -側 -寨 -敢 -徹 -慮 -斜 -薄 -庭 -納 -彈 -飼 -伸 -折 -麥 -濕 -暗 -荷 -瓦 -塞 -床 -築 -惡 -戶 -訪 -塔 -奇 -透 -梁 -刀 -旋 -跡 -卡 -氯 -遇 -份 -毒 -泥 -退 -洗 -擺 -灰 -彩 -賣 -耗 -夏 -擇 -忙 -銅 -獻 -硬 -予 -繁 -圈 -雪 -函 -亦 -抽 -篇 -陣 -陰 -丁 -尺 -追 -堆 -雄 -迎 -泛 -爸 -樓 -避 -謀 -噸 -野 -豬 -旗 -累 -偏 -典 -館 -索 -秦 -脂 -潮 -爺 -豆 -忽 -托 -驚 -塑 -遺 -愈 -朱 -替 -纖 -粗 -傾 -尚 -痛 -楚 -謝 -奮 -購 -磨 -君 -池 -旁 -碎 -骨 -監 -捕 -弟 -暴 -割 -貫 -殊 -釋 -詞 -亡 -壁 -頓 -寶 -午 -塵 -聞 -揭 -炮 -殘 -冬 -橋 -婦 -警 -綜 -招 -吳 -付 -浮 -遭 -徐 -您 -搖 -谷 -贊 -箱 -隔 -訂 -男 -吹 -園 -紛 -唐 -敗 -宋 -玻 -巨 -耕 -坦 -榮 -閉 -灣 -鍵 -凡 -駐 -鍋 -救 -恩 -剝 -凝 -鹼 -齒 -截 -煉 -麻 -紡 -禁 -廢 -盛 -版 -緩 -淨 -睛 -昌 -婚 -涉 -筒 -嘴 -插 -岸 -朗 -莊 -街 -藏 -姑 -貿 -腐 -奴 -啦 -慣 -乘 -夥 -恢 -勻 -紗 -扎 -辯 -耳 -彪 -臣 -億 -璃 -抵 -脈 -秀 -薩 -俄 -網 -舞 -店 -噴 -縱 -寸 -汗 -掛 -洪 -賀 -閃 -柬 -爆 -烯 -津 -稻 -牆 -軟 -勇 -像 -滾 -厘 -蒙 -芳 -肯 -坡 -柱 -盪 -腿 -儀 -旅 -尾 -軋 -冰 -貢 -登 -黎 -削 -鑽 -勒 -逃 -障 -氨 -郭 -峰 -幣 -港 -伏 -軌 -畝 -畢 -擦 -莫 -刺 -浪 -秘 -援 -株 -健 -售 -股 -島 -甘 -泡 -睡 -童 -鑄 -湯 -閥 -休 -匯 -舍 -牧 -繞 -炸 -哲 -磷 -績 -朋 -淡 -尖 -啟 -陷 -柴 -呈 -徒 -顏 -淚 -稍 -忘 -泵 -藍 -拖 -洞 -授 -鏡 -辛 -壯 -鋒 -貧 -虛 -彎 -摩 -泰 -幼 -廷 -尊 -窗 -綱 -弄 -隸 -疑 -氏 -宮 -姐 -震 -瑞 -怪 -尤 -琴 -循 -描 -膜 -違 -夾 -腰 -緣 -珠 -窮 -森 -枝 -竹 -溝 -催 -繩 -憶 -邦 -剩 -幸 -漿 -欄 -擁 -牙 -貯 -禮 -濾 -鈉 -紋 -罷 -拍 -咱 -喊 -袖 -埃 -勤 -罰 -焦 -潛 -伍 -墨 -欲 -縫 -姓 -刊 -飽 -仿 -獎 -鋁 -鬼 -麗 -跨 -默 -挖 -鏈 -掃 -喝 -袋 -炭 -污 -幕 -諸 -弧 -勵 -梅 -奶 -潔 -災 -舟 -鑑 -苯 -訟 -抱 -毀 -懂 -寒 -智 -埔 -寄 -屆 -躍 -渡 -挑 -丹 -艱 -貝 -碰 -拔 -爹 -戴 -碼 -夢 -芽 -熔 -赤 -漁 -哭 -敬 -顆 -奔 -鉛 -仲 -虎 -稀 -妹 -乏 -珍 -申 -桌 -遵 -允 -隆 -螺 -倉 -魏 -銳 -曉 -氮 -兼 -隱 -礙 -赫 -撥 -忠 -肅 -缸 -牽 -搶 -博 -巧 -殼 -兄 -杜 -訊 -誠 -碧 -祥 -柯 -頁 -巡 -矩 -悲 -灌 -齡 -倫 -票 -尋 -桂 -鋪 -聖 -恐 -恰 -鄭 -趣 -抬 -荒 -騰 -貼 -柔 -滴 -猛 -闊 -輛 -妻 -填 -撤 -儲 -簽 -鬧 -擾 -紫 -砂 -遞 -戲 -吊 -陶 -伐 -餵 -療 -瓶 -婆 -撫 -臂 -摸 -忍 -蝦 -蠟 -鄰 -胸 -鞏 -擠 -偶 -棄 -槽 -勁 -乳 -鄧 -吉 -仁 -爛 -磚 -租 -烏 -艦 -伴 -瓜 -淺 -丙 -暫 -燥 -橡 -柳 -迷 -暖 -牌 -秧 -膽 -詳 -簧 -踏 -瓷 -譜 -呆 -賓 -糊 -洛 -輝 -憤 -競 -隙 -怒 -粘 -乃 -緒 -肩 -籍 -敏 -塗 -熙 -皆 -偵 -懸 -掘 -享 -糾 -醒 -狂 -鎖 -淀 -恨 -牲 -霸 -爬 -賞 -逆 -玩 -陵 -祝 -秒 -浙 -貌 -役 -彼 -悉 -鴨 -趨 -鳳 -晨 -畜 -輩 -秩 -卵 -署 -梯 -炎 -灘 -棋 -驅 -篩 -峽 -冒 -啥 -壽 -譯 -浸 -泉 -帽 -遲 -矽 -疆 -貸 -漏 -稿 -冠 -嫩 -脅 -芯 -牢 -叛 -蝕 -奧 -鳴 -嶺 -羊 -憑 -串 -塘 -繪 -酵 -融 -盆 -錫 -廟 -籌 -凍 -輔 -攝 -襲 -筋 -拒 -僚 -旱 -鉀 -鳥 -漆 -沈 -眉 -疏 -添 -棒 -穗 -硝 -韓 -逼 -扭 -僑 -涼 -挺 -碗 -栽 -炒 -杯 -患 -餾 -勸 -豪 -遼 -勃 -鴻 -旦 -吏 -拜 -狗 -埋 -輥 -掩 -飲 -搬 -罵 -辭 -勾 -扣 -估 -蔣 -絨 -霧 -丈 -朵 -姆 -擬 -宇 -輯 -陝 -雕 -償 -蓄 -崇 -剪 -倡 -廳 -咬 -駛 -薯 -刷 -斥 -番 -賦 -奉 -佛 -澆 -漫 -曼 -扇 -鈣 -桃 -扶 -仔 -返 -俗 -虧 -腔 -鞋 -棱 -覆 -框 -悄 -叔 -撞 -騙 -勘 -旺 -沸 -孤 -吐 -孟 -渠 -屈 -疾 -妙 -惜 -仰 -狠 -脹 -諧 -拋 -黴 -桑 -崗 -嘛 -衰 -盜 -滲 -臟 -賴 -湧 -甜 -曹 -閱 -肌 -哩 -厲 -烴 -緯 -毅 -昨 -偽 -症 -煮 -嘆 -釘 -搭 -莖 -籠 -酷 -偷 -弓 -錐 -恆 -傑 -坑 -鼻 -翼 -綸 -敘 -獄 -逮 -罐 -絡 -棚 -抑 -膨 -蔬 -寺 -驟 -穆 -冶 -枯 -冊 -屍 -凸 -紳 -坯 -犧 -焰 -轟 -欣 -晉 -瘦 -禦 -錠 -錦 -喪 -旬 -鍛 -壟 -搜 -撲 -邀 -亭 -酯 -邁 -舒 -脆 -酶 -閒 -憂 -酚 -頑 -羽 -漲 -卸 -仗 -陪 -闢 -懲 -杭 -姚 -肚 -捉 -飄 -漂 -昆 -欺 -吾 -郎 -烷 -汁 -呵 -飾 -蕭 -雅 -郵 -遷 -燕 -撒 -姻 -赴 -宴 -煩 -債 -帳 -斑 -鈴 -旨 -醇 -董 -餅 -雛 -姿 -拌 -傅 -腹 -妥 -揉 -賢 -拆 -歪 -葡 -胺 -丟 -浩 -徽 -昂 -墊 -擋 -覽 -貪 -慰 -繳 -汪 -慌 -馮 -諾 -姜 -誼 -兇 -劣 -誣 -耀 -昏 -躺 -盈 -騎 -喬 -溪 -叢 -盧 -抹 -悶 -諮 -刮 -駕 -纜 -悟 -摘 -鉺 -擲 -頗 -幻 -柄 -惠 -慘 -佳 -仇 -臘 -窩 -滌 -劍 -瞧 -堡 -潑 -蔥 -罩 -霍 -撈 -胎 -蒼 -濱 -倆 -捅 -湘 -砍 -霞 -邵 -萄 -瘋 -淮 -遂 -熊 -糞 -烘 -宿 -檔 -戈 -駁 -嫂 -裕 -徙 -箭 -捐 -腸 -撐 -曬 -辨 -殿 -蓮 -攤 -攪 -醬 -屏 -疫 -哀 -蔡 -堵 -沫 -皺 -暢 -疊 -閣 -萊 -敲 -轄 -鉤 -痕 -壩 -巷 -餓 -禍 -丘 -玄 -溜 -曰 -邏 -彭 -嘗 -卿 -妨 -艇 -吞 -韋 -怨 -矮 -歇`.split('\n'); diff --git a/tools/mnemonic-test/node_modules/@types/node/LICENSE b/tools/mnemonic-test/node_modules/@types/node/LICENSE deleted file mode 100644 index 9e841e7a..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - MIT License - - Copyright (c) Microsoft Corporation. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE diff --git a/tools/mnemonic-test/node_modules/@types/node/README.md b/tools/mnemonic-test/node_modules/@types/node/README.md deleted file mode 100644 index a0050e10..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# Installation -> `npm install --save @types/node` - -# Summary -This package contains type definitions for node (https://nodejs.org/). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node. - -### Additional Details - * Last updated: Mon, 07 Oct 2024 22:07:58 GMT - * Dependencies: [undici-types](https://npmjs.com/package/undici-types) - -# Credits -These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), and [Dmitry Semigradsky](https://github.com/Semigradsky). diff --git a/tools/mnemonic-test/node_modules/@types/node/assert.d.ts b/tools/mnemonic-test/node_modules/@types/node/assert.d.ts deleted file mode 100644 index 35917ca6..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/assert.d.ts +++ /dev/null @@ -1,1040 +0,0 @@ -/** - * The `node:assert` module provides a set of assertion functions for verifying - * invariants. - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/assert.js) - */ -declare module "assert" { - /** - * An alias of {@link ok}. - * @since v0.5.9 - * @param value The input that is checked for being truthy. - */ - function assert(value: unknown, message?: string | Error): asserts value; - namespace assert { - /** - * Indicates the failure of an assertion. All errors thrown by the `node:assert` module will be instances of the `AssertionError` class. - */ - class AssertionError extends Error { - /** - * Set to the `actual` argument for methods such as {@link assert.strictEqual()}. - */ - actual: unknown; - /** - * Set to the `expected` argument for methods such as {@link assert.strictEqual()}. - */ - expected: unknown; - /** - * Set to the passed in operator value. - */ - operator: string; - /** - * Indicates if the message was auto-generated (`true`) or not. - */ - generatedMessage: boolean; - /** - * Value is always `ERR_ASSERTION` to show that the error is an assertion error. - */ - code: "ERR_ASSERTION"; - constructor(options?: { - /** If provided, the error message is set to this value. */ - message?: string | undefined; - /** The `actual` property on the error instance. */ - actual?: unknown | undefined; - /** The `expected` property on the error instance. */ - expected?: unknown | undefined; - /** The `operator` property on the error instance. */ - operator?: string | undefined; - /** If provided, the generated stack trace omits frames before this function. */ - // eslint-disable-next-line @typescript-eslint/ban-types - stackStartFn?: Function | undefined; - }); - } - /** - * This feature is deprecated and will be removed in a future version. - * Please consider using alternatives such as the `mock` helper function. - * @since v14.2.0, v12.19.0 - * @deprecated Deprecated - */ - class CallTracker { - /** - * The wrapper function is expected to be called exactly `exact` times. If the - * function has not been called exactly `exact` times when `tracker.verify()` is called, then `tracker.verify()` will throw an - * error. - * - * ```js - * import assert from 'node:assert'; - * - * // Creates call tracker. - * const tracker = new assert.CallTracker(); - * - * function func() {} - * - * // Returns a function that wraps func() that must be called exact times - * // before tracker.verify(). - * const callsfunc = tracker.calls(func); - * ``` - * @since v14.2.0, v12.19.0 - * @param [fn='A no-op function'] - * @param [exact=1] - * @return A function that wraps `fn`. - */ - calls(exact?: number): () => void; - calls any>(fn?: Func, exact?: number): Func; - /** - * Example: - * - * ```js - * import assert from 'node:assert'; - * - * const tracker = new assert.CallTracker(); - * - * function func() {} - * const callsfunc = tracker.calls(func); - * callsfunc(1, 2, 3); - * - * assert.deepStrictEqual(tracker.getCalls(callsfunc), - * [{ thisArg: undefined, arguments: [1, 2, 3] }]); - * ``` - * @since v18.8.0, v16.18.0 - * @return An array with all the calls to a tracked function. - */ - getCalls(fn: Function): CallTrackerCall[]; - /** - * The arrays contains information about the expected and actual number of calls of - * the functions that have not been called the expected number of times. - * - * ```js - * import assert from 'node:assert'; - * - * // Creates call tracker. - * const tracker = new assert.CallTracker(); - * - * function func() {} - * - * // Returns a function that wraps func() that must be called exact times - * // before tracker.verify(). - * const callsfunc = tracker.calls(func, 2); - * - * // Returns an array containing information on callsfunc() - * console.log(tracker.report()); - * // [ - * // { - * // message: 'Expected the func function to be executed 2 time(s) but was - * // executed 0 time(s).', - * // actual: 0, - * // expected: 2, - * // operator: 'func', - * // stack: stack trace - * // } - * // ] - * ``` - * @since v14.2.0, v12.19.0 - * @return An array of objects containing information about the wrapper functions returned by {@link tracker.calls()}. - */ - report(): CallTrackerReportInformation[]; - /** - * Reset calls of the call tracker. If a tracked function is passed as an argument, the calls will be reset for it. - * If no arguments are passed, all tracked functions will be reset. - * - * ```js - * import assert from 'node:assert'; - * - * const tracker = new assert.CallTracker(); - * - * function func() {} - * const callsfunc = tracker.calls(func); - * - * callsfunc(); - * // Tracker was called once - * assert.strictEqual(tracker.getCalls(callsfunc).length, 1); - * - * tracker.reset(callsfunc); - * assert.strictEqual(tracker.getCalls(callsfunc).length, 0); - * ``` - * @since v18.8.0, v16.18.0 - * @param fn a tracked function to reset. - */ - reset(fn?: Function): void; - /** - * Iterates through the list of functions passed to {@link tracker.calls()} and will throw an error for functions that - * have not been called the expected number of times. - * - * ```js - * import assert from 'node:assert'; - * - * // Creates call tracker. - * const tracker = new assert.CallTracker(); - * - * function func() {} - * - * // Returns a function that wraps func() that must be called exact times - * // before tracker.verify(). - * const callsfunc = tracker.calls(func, 2); - * - * callsfunc(); - * - * // Will throw an error since callsfunc() was only called once. - * tracker.verify(); - * ``` - * @since v14.2.0, v12.19.0 - */ - verify(): void; - } - interface CallTrackerCall { - thisArg: object; - arguments: unknown[]; - } - interface CallTrackerReportInformation { - message: string; - /** The actual number of times the function was called. */ - actual: number; - /** The number of times the function was expected to be called. */ - expected: number; - /** The name of the function that is wrapped. */ - operator: string; - /** A stack trace of the function. */ - stack: object; - } - type AssertPredicate = RegExp | (new() => object) | ((thrown: unknown) => boolean) | object | Error; - /** - * Throws an `AssertionError` with the provided error message or a default - * error message. If the `message` parameter is an instance of an `Error` then - * it will be thrown instead of the `AssertionError`. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.fail(); - * // AssertionError [ERR_ASSERTION]: Failed - * - * assert.fail('boom'); - * // AssertionError [ERR_ASSERTION]: boom - * - * assert.fail(new TypeError('need array')); - * // TypeError: need array - * ``` - * - * Using `assert.fail()` with more than two arguments is possible but deprecated. - * See below for further details. - * @since v0.1.21 - * @param [message='Failed'] - */ - function fail(message?: string | Error): never; - /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */ - function fail( - actual: unknown, - expected: unknown, - message?: string | Error, - operator?: string, - // eslint-disable-next-line @typescript-eslint/ban-types - stackStartFn?: Function, - ): never; - /** - * Tests if `value` is truthy. It is equivalent to `assert.equal(!!value, true, message)`. - * - * If `value` is not truthy, an `AssertionError` is thrown with a `message` property set equal to the value of the `message` parameter. If the `message` parameter is `undefined`, a default - * error message is assigned. If the `message` parameter is an instance of an `Error` then it will be thrown instead of the `AssertionError`. - * If no arguments are passed in at all `message` will be set to the string:`` 'No value argument passed to `assert.ok()`' ``. - * - * Be aware that in the `repl` the error message will be different to the one - * thrown in a file! See below for further details. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.ok(true); - * // OK - * assert.ok(1); - * // OK - * - * assert.ok(); - * // AssertionError: No value argument passed to `assert.ok()` - * - * assert.ok(false, 'it\'s false'); - * // AssertionError: it's false - * - * // In the repl: - * assert.ok(typeof 123 === 'string'); - * // AssertionError: false == true - * - * // In a file (e.g. test.js): - * assert.ok(typeof 123 === 'string'); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert.ok(typeof 123 === 'string') - * - * assert.ok(false); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert.ok(false) - * - * assert.ok(0); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert.ok(0) - * ``` - * - * ```js - * import assert from 'node:assert/strict'; - * - * // Using `assert()` works the same: - * assert(0); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert(0) - * ``` - * @since v0.1.21 - */ - function ok(value: unknown, message?: string | Error): asserts value; - /** - * **Strict assertion mode** - * - * An alias of {@link strictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link strictEqual} instead. - * - * Tests shallow, coercive equality between the `actual` and `expected` parameters - * using the [`==` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Equality). `NaN` is specially handled - * and treated as being identical if both sides are `NaN`. - * - * ```js - * import assert from 'node:assert'; - * - * assert.equal(1, 1); - * // OK, 1 == 1 - * assert.equal(1, '1'); - * // OK, 1 == '1' - * assert.equal(NaN, NaN); - * // OK - * - * assert.equal(1, 2); - * // AssertionError: 1 == 2 - * assert.equal({ a: { b: 1 } }, { a: { b: 1 } }); - * // AssertionError: { a: { b: 1 } } == { a: { b: 1 } } - * ``` - * - * If the values are not equal, an `AssertionError` is thrown with a `message` property set equal to the value of the `message` parameter. If the `message` parameter is undefined, a default - * error message is assigned. If the `message` parameter is an instance of an `Error` then it will be thrown instead of the `AssertionError`. - * @since v0.1.21 - */ - function equal(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * **Strict assertion mode** - * - * An alias of {@link notStrictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link notStrictEqual} instead. - * - * Tests shallow, coercive inequality with the [`!=` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Inequality). `NaN` is - * specially handled and treated as being identical if both sides are `NaN`. - * - * ```js - * import assert from 'node:assert'; - * - * assert.notEqual(1, 2); - * // OK - * - * assert.notEqual(1, 1); - * // AssertionError: 1 != 1 - * - * assert.notEqual(1, '1'); - * // AssertionError: 1 != '1' - * ``` - * - * If the values are equal, an `AssertionError` is thrown with a `message` property set equal to the value of the `message` parameter. If the `message` parameter is undefined, a default error - * message is assigned. If the `message` parameter is an instance of an `Error` then it will be thrown instead of the `AssertionError`. - * @since v0.1.21 - */ - function notEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * **Strict assertion mode** - * - * An alias of {@link deepStrictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link deepStrictEqual} instead. - * - * Tests for deep equality between the `actual` and `expected` parameters. Consider - * using {@link deepStrictEqual} instead. {@link deepEqual} can have - * surprising results. - * - * _Deep equality_ means that the enumerable "own" properties of child objects - * are also recursively evaluated by the following rules. - * @since v0.1.21 - */ - function deepEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * **Strict assertion mode** - * - * An alias of {@link notDeepStrictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link notDeepStrictEqual} instead. - * - * Tests for any deep inequality. Opposite of {@link deepEqual}. - * - * ```js - * import assert from 'node:assert'; - * - * const obj1 = { - * a: { - * b: 1, - * }, - * }; - * const obj2 = { - * a: { - * b: 2, - * }, - * }; - * const obj3 = { - * a: { - * b: 1, - * }, - * }; - * const obj4 = { __proto__: obj1 }; - * - * assert.notDeepEqual(obj1, obj1); - * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } - * - * assert.notDeepEqual(obj1, obj2); - * // OK - * - * assert.notDeepEqual(obj1, obj3); - * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } - * - * assert.notDeepEqual(obj1, obj4); - * // OK - * ``` - * - * If the values are deeply equal, an `AssertionError` is thrown with a `message` property set equal to the value of the `message` parameter. If the `message` parameter is undefined, a default - * error message is assigned. If the `message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v0.1.21 - */ - function notDeepEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * Tests strict equality between the `actual` and `expected` parameters as - * determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.strictEqual(1, 2); - * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal: - * // - * // 1 !== 2 - * - * assert.strictEqual(1, 1); - * // OK - * - * assert.strictEqual('Hello foobar', 'Hello World!'); - * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal: - * // + actual - expected - * // - * // + 'Hello foobar' - * // - 'Hello World!' - * // ^ - * - * const apples = 1; - * const oranges = 2; - * assert.strictEqual(apples, oranges, `apples ${apples} !== oranges ${oranges}`); - * // AssertionError [ERR_ASSERTION]: apples 1 !== oranges 2 - * - * assert.strictEqual(1, '1', new TypeError('Inputs are not identical')); - * // TypeError: Inputs are not identical - * ``` - * - * If the values are not strictly equal, an `AssertionError` is thrown with a `message` property set equal to the value of the `message` parameter. If the `message` parameter is undefined, a - * default error message is assigned. If the `message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v0.1.21 - */ - function strictEqual(actual: unknown, expected: T, message?: string | Error): asserts actual is T; - /** - * Tests strict inequality between the `actual` and `expected` parameters as - * determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.notStrictEqual(1, 2); - * // OK - * - * assert.notStrictEqual(1, 1); - * // AssertionError [ERR_ASSERTION]: Expected "actual" to be strictly unequal to: - * // - * // 1 - * - * assert.notStrictEqual(1, '1'); - * // OK - * ``` - * - * If the values are strictly equal, an `AssertionError` is thrown with a `message` property set equal to the value of the `message` parameter. If the `message` parameter is undefined, a - * default error message is assigned. If the `message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v0.1.21 - */ - function notStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * Tests for deep equality between the `actual` and `expected` parameters. - * "Deep" equality means that the enumerable "own" properties of child objects - * are recursively evaluated also by the following rules. - * @since v1.2.0 - */ - function deepStrictEqual(actual: unknown, expected: T, message?: string | Error): asserts actual is T; - /** - * Tests for deep strict inequality. Opposite of {@link deepStrictEqual}. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.notDeepStrictEqual({ a: 1 }, { a: '1' }); - * // OK - * ``` - * - * If the values are deeply and strictly equal, an `AssertionError` is thrown - * with a `message` property set equal to the value of the `message` parameter. If - * the `message` parameter is undefined, a default error message is assigned. If - * the `message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v1.2.0 - */ - function notDeepStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * Expects the function `fn` to throw an error. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), a validation function, - * a validation object where each property will be tested for strict deep equality, - * or an instance of error where each property will be tested for strict deep - * equality including the non-enumerable `message` and `name` properties. When - * using an object, it is also possible to use a regular expression, when - * validating against a string property. See below for examples. - * - * If specified, `message` will be appended to the message provided by the `AssertionError` if the `fn` call fails to throw or in case the error validation - * fails. - * - * Custom validation object/error instance: - * - * ```js - * import assert from 'node:assert/strict'; - * - * const err = new TypeError('Wrong value'); - * err.code = 404; - * err.foo = 'bar'; - * err.info = { - * nested: true, - * baz: 'text', - * }; - * err.reg = /abc/i; - * - * assert.throws( - * () => { - * throw err; - * }, - * { - * name: 'TypeError', - * message: 'Wrong value', - * info: { - * nested: true, - * baz: 'text', - * }, - * // Only properties on the validation object will be tested for. - * // Using nested objects requires all properties to be present. Otherwise - * // the validation is going to fail. - * }, - * ); - * - * // Using regular expressions to validate error properties: - * assert.throws( - * () => { - * throw err; - * }, - * { - * // The `name` and `message` properties are strings and using regular - * // expressions on those will match against the string. If they fail, an - * // error is thrown. - * name: /^TypeError$/, - * message: /Wrong/, - * foo: 'bar', - * info: { - * nested: true, - * // It is not possible to use regular expressions for nested properties! - * baz: 'text', - * }, - * // The `reg` property contains a regular expression and only if the - * // validation object contains an identical regular expression, it is going - * // to pass. - * reg: /abc/i, - * }, - * ); - * - * // Fails due to the different `message` and `name` properties: - * assert.throws( - * () => { - * const otherErr = new Error('Not found'); - * // Copy all enumerable properties from `err` to `otherErr`. - * for (const [key, value] of Object.entries(err)) { - * otherErr[key] = value; - * } - * throw otherErr; - * }, - * // The error's `message` and `name` properties will also be checked when using - * // an error as validation object. - * err, - * ); - * ``` - * - * Validate instanceof using constructor: - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.throws( - * () => { - * throw new Error('Wrong value'); - * }, - * Error, - * ); - * ``` - * - * Validate error message using [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions): - * - * Using a regular expression runs `.toString` on the error object, and will - * therefore also include the error name. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.throws( - * () => { - * throw new Error('Wrong value'); - * }, - * /^Error: Wrong value$/, - * ); - * ``` - * - * Custom error validation: - * - * The function must return `true` to indicate all internal validations passed. - * It will otherwise fail with an `AssertionError`. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.throws( - * () => { - * throw new Error('Wrong value'); - * }, - * (err) => { - * assert(err instanceof Error); - * assert(/value/.test(err)); - * // Avoid returning anything from validation functions besides `true`. - * // Otherwise, it's not clear what part of the validation failed. Instead, - * // throw an error about the specific validation that failed (as done in this - * // example) and add as much helpful debugging information to that error as - * // possible. - * return true; - * }, - * 'unexpected error', - * ); - * ``` - * - * `error` cannot be a string. If a string is provided as the second - * argument, then `error` is assumed to be omitted and the string will be used for `message` instead. This can lead to easy-to-miss mistakes. Using the same - * message as the thrown error message is going to result in an `ERR_AMBIGUOUS_ARGUMENT` error. Please read the example below carefully if using - * a string as the second argument gets considered: - * - * ```js - * import assert from 'node:assert/strict'; - * - * function throwingFirst() { - * throw new Error('First'); - * } - * - * function throwingSecond() { - * throw new Error('Second'); - * } - * - * function notThrowing() {} - * - * // The second argument is a string and the input function threw an Error. - * // The first case will not throw as it does not match for the error message - * // thrown by the input function! - * assert.throws(throwingFirst, 'Second'); - * // In the next example the message has no benefit over the message from the - * // error and since it is not clear if the user intended to actually match - * // against the error message, Node.js throws an `ERR_AMBIGUOUS_ARGUMENT` error. - * assert.throws(throwingSecond, 'Second'); - * // TypeError [ERR_AMBIGUOUS_ARGUMENT] - * - * // The string is only used (as message) in case the function does not throw: - * assert.throws(notThrowing, 'Second'); - * // AssertionError [ERR_ASSERTION]: Missing expected exception: Second - * - * // If it was intended to match for the error message do this instead: - * // It does not throw because the error messages match. - * assert.throws(throwingSecond, /Second$/); - * - * // If the error message does not match, an AssertionError is thrown. - * assert.throws(throwingFirst, /Second$/); - * // AssertionError [ERR_ASSERTION] - * ``` - * - * Due to the confusing error-prone notation, avoid a string as the second - * argument. - * @since v0.1.21 - */ - function throws(block: () => unknown, message?: string | Error): void; - function throws(block: () => unknown, error: AssertPredicate, message?: string | Error): void; - /** - * Asserts that the function `fn` does not throw an error. - * - * Using `assert.doesNotThrow()` is actually not useful because there - * is no benefit in catching an error and then rethrowing it. Instead, consider - * adding a comment next to the specific code path that should not throw and keep - * error messages as expressive as possible. - * - * When `assert.doesNotThrow()` is called, it will immediately call the `fn` function. - * - * If an error is thrown and it is the same type as that specified by the `error` parameter, then an `AssertionError` is thrown. If the error is of a - * different type, or if the `error` parameter is undefined, the error is - * propagated back to the caller. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), or a validation - * function. See {@link throws} for more details. - * - * The following, for instance, will throw the `TypeError` because there is no - * matching error type in the assertion: - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.doesNotThrow( - * () => { - * throw new TypeError('Wrong value'); - * }, - * SyntaxError, - * ); - * ``` - * - * However, the following will result in an `AssertionError` with the message - * 'Got unwanted exception...': - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.doesNotThrow( - * () => { - * throw new TypeError('Wrong value'); - * }, - * TypeError, - * ); - * ``` - * - * If an `AssertionError` is thrown and a value is provided for the `message` parameter, the value of `message` will be appended to the `AssertionError` message: - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.doesNotThrow( - * () => { - * throw new TypeError('Wrong value'); - * }, - * /Wrong value/, - * 'Whoops', - * ); - * // Throws: AssertionError: Got unwanted exception: Whoops - * ``` - * @since v0.1.21 - */ - function doesNotThrow(block: () => unknown, message?: string | Error): void; - function doesNotThrow(block: () => unknown, error: AssertPredicate, message?: string | Error): void; - /** - * Throws `value` if `value` is not `undefined` or `null`. This is useful when - * testing the `error` argument in callbacks. The stack trace contains all frames - * from the error passed to `ifError()` including the potential new frames for `ifError()` itself. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.ifError(null); - * // OK - * assert.ifError(0); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 0 - * assert.ifError('error'); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 'error' - * assert.ifError(new Error()); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: Error - * - * // Create some random error frames. - * let err; - * (function errorFrame() { - * err = new Error('test error'); - * })(); - * - * (function ifErrorFrame() { - * assert.ifError(err); - * })(); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: test error - * // at ifErrorFrame - * // at errorFrame - * ``` - * @since v0.1.97 - */ - function ifError(value: unknown): asserts value is null | undefined; - /** - * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately - * calls the function and awaits the returned promise to complete. It will then - * check that the promise is rejected. - * - * If `asyncFn` is a function and it throws an error synchronously, `assert.rejects()` will return a rejected `Promise` with that error. If the - * function does not return a promise, `assert.rejects()` will return a rejected `Promise` with an [ERR_INVALID_RETURN_VALUE](https://nodejs.org/docs/latest-v22.x/api/errors.html#err_invalid_return_value) - * error. In both cases the error handler is skipped. - * - * Besides the async nature to await the completion behaves identically to {@link throws}. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), a validation function, - * an object where each property will be tested for, or an instance of error where - * each property will be tested for including the non-enumerable `message` and `name` properties. - * - * If specified, `message` will be the message provided by the `{@link AssertionError}` if the `asyncFn` fails to reject. - * - * ```js - * import assert from 'node:assert/strict'; - * - * await assert.rejects( - * async () => { - * throw new TypeError('Wrong value'); - * }, - * { - * name: 'TypeError', - * message: 'Wrong value', - * }, - * ); - * ``` - * - * ```js - * import assert from 'node:assert/strict'; - * - * await assert.rejects( - * async () => { - * throw new TypeError('Wrong value'); - * }, - * (err) => { - * assert.strictEqual(err.name, 'TypeError'); - * assert.strictEqual(err.message, 'Wrong value'); - * return true; - * }, - * ); - * ``` - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.rejects( - * Promise.reject(new Error('Wrong value')), - * Error, - * ).then(() => { - * // ... - * }); - * ``` - * - * `error` cannot be a string. If a string is provided as the second argument, then `error` is assumed to - * be omitted and the string will be used for `message` instead. This can lead to easy-to-miss mistakes. Please read the - * example in {@link throws} carefully if using a string as the second argument gets considered. - * @since v10.0.0 - */ - function rejects(block: (() => Promise) | Promise, message?: string | Error): Promise; - function rejects( - block: (() => Promise) | Promise, - error: AssertPredicate, - message?: string | Error, - ): Promise; - /** - * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately - * calls the function and awaits the returned promise to complete. It will then - * check that the promise is not rejected. - * - * If `asyncFn` is a function and it throws an error synchronously, `assert.doesNotReject()` will return a rejected `Promise` with that error. If - * the function does not return a promise, `assert.doesNotReject()` will return a - * rejected `Promise` with an [ERR_INVALID_RETURN_VALUE](https://nodejs.org/docs/latest-v22.x/api/errors.html#err_invalid_return_value) error. In both cases - * the error handler is skipped. - * - * Using `assert.doesNotReject()` is actually not useful because there is little - * benefit in catching a rejection and then rejecting it again. Instead, consider - * adding a comment next to the specific code path that should not reject and keep - * error messages as expressive as possible. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), or a validation - * function. See {@link throws} for more details. - * - * Besides the async nature to await the completion behaves identically to {@link doesNotThrow}. - * - * ```js - * import assert from 'node:assert/strict'; - * - * await assert.doesNotReject( - * async () => { - * throw new TypeError('Wrong value'); - * }, - * SyntaxError, - * ); - * ``` - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.doesNotReject(Promise.reject(new TypeError('Wrong value'))) - * .then(() => { - * // ... - * }); - * ``` - * @since v10.0.0 - */ - function doesNotReject( - block: (() => Promise) | Promise, - message?: string | Error, - ): Promise; - function doesNotReject( - block: (() => Promise) | Promise, - error: AssertPredicate, - message?: string | Error, - ): Promise; - /** - * Expects the `string` input to match the regular expression. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.match('I will fail', /pass/); - * // AssertionError [ERR_ASSERTION]: The input did not match the regular ... - * - * assert.match(123, /pass/); - * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string. - * - * assert.match('I will pass', /pass/); - * // OK - * ``` - * - * If the values do not match, or if the `string` argument is of another type than `string`, an `{@link AssertionError}` is thrown with a `message` property set equal - * to the value of the `message` parameter. If the `message` parameter is - * undefined, a default error message is assigned. If the `message` parameter is an - * instance of an [Error](https://nodejs.org/docs/latest-v22.x/api/errors.html#class-error) then it will be thrown instead of the `{@link AssertionError}`. - * @since v13.6.0, v12.16.0 - */ - function match(value: string, regExp: RegExp, message?: string | Error): void; - /** - * Expects the `string` input not to match the regular expression. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.doesNotMatch('I will fail', /fail/); - * // AssertionError [ERR_ASSERTION]: The input was expected to not match the ... - * - * assert.doesNotMatch(123, /pass/); - * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string. - * - * assert.doesNotMatch('I will pass', /different/); - * // OK - * ``` - * - * If the values do match, or if the `string` argument is of another type than `string`, an `{@link AssertionError}` is thrown with a `message` property set equal - * to the value of the `message` parameter. If the `message` parameter is - * undefined, a default error message is assigned. If the `message` parameter is an - * instance of an [Error](https://nodejs.org/docs/latest-v22.x/api/errors.html#class-error) then it will be thrown instead of the `{@link AssertionError}`. - * @since v13.6.0, v12.16.0 - */ - function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void; - /** - * In strict assertion mode, non-strict methods behave like their corresponding strict methods. For example, - * {@link deepEqual} will behave like {@link deepStrictEqual}. - * - * In strict assertion mode, error messages for objects display a diff. In legacy assertion mode, error - * messages for objects display the objects, often truncated. - * - * To use strict assertion mode: - * - * ```js - * import { strict as assert } from 'node:assert'; - * import assert from 'node:assert/strict'; - * ``` - * - * Example error diff: - * - * ```js - * import { strict as assert } from 'node:assert'; - * - * assert.deepEqual([[[1, 2, 3]], 4, 5], [[[1, 2, '3']], 4, 5]); - * // AssertionError: Expected inputs to be strictly deep-equal: - * // + actual - expected ... Lines skipped - * // - * // [ - * // [ - * // ... - * // 2, - * // + 3 - * // - '3' - * // ], - * // ... - * // 5 - * // ] - * ``` - * - * To deactivate the colors, use the `NO_COLOR` or `NODE_DISABLE_COLORS` environment variables. This will also - * deactivate the colors in the REPL. For more on color support in terminal environments, read the tty - * `getColorDepth()` documentation. - * - * @since v15.0.0, v13.9.0, v12.16.2, v9.9.0 - */ - namespace strict { - type AssertionError = assert.AssertionError; - type AssertPredicate = assert.AssertPredicate; - type CallTrackerCall = assert.CallTrackerCall; - type CallTrackerReportInformation = assert.CallTrackerReportInformation; - } - const strict: - & Omit< - typeof assert, - | "equal" - | "notEqual" - | "deepEqual" - | "notDeepEqual" - | "ok" - | "strictEqual" - | "deepStrictEqual" - | "ifError" - | "strict" - > - & { - (value: unknown, message?: string | Error): asserts value; - equal: typeof strictEqual; - notEqual: typeof notStrictEqual; - deepEqual: typeof deepStrictEqual; - notDeepEqual: typeof notDeepStrictEqual; - // Mapped types and assertion functions are incompatible? - // TS2775: Assertions require every name in the call target - // to be declared with an explicit type annotation. - ok: typeof ok; - strictEqual: typeof strictEqual; - deepStrictEqual: typeof deepStrictEqual; - ifError: typeof ifError; - strict: typeof strict; - }; - } - export = assert; -} -declare module "node:assert" { - import assert = require("assert"); - export = assert; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/assert/strict.d.ts b/tools/mnemonic-test/node_modules/@types/node/assert/strict.d.ts deleted file mode 100644 index f333913a..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/assert/strict.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -declare module "assert/strict" { - import { strict } from "node:assert"; - export = strict; -} -declare module "node:assert/strict" { - import { strict } from "node:assert"; - export = strict; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/async_hooks.d.ts b/tools/mnemonic-test/node_modules/@types/node/async_hooks.d.ts deleted file mode 100644 index 4d6df815..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/async_hooks.d.ts +++ /dev/null @@ -1,541 +0,0 @@ -/** - * We strongly discourage the use of the `async_hooks` API. - * Other APIs that can cover most of its use cases include: - * - * * [`AsyncLocalStorage`](https://nodejs.org/docs/latest-v22.x/api/async_context.html#class-asynclocalstorage) tracks async context - * * [`process.getActiveResourcesInfo()`](https://nodejs.org/docs/latest-v22.x/api/process.html#processgetactiveresourcesinfo) tracks active resources - * - * The `node:async_hooks` module provides an API to track asynchronous resources. - * It can be accessed using: - * - * ```js - * import async_hooks from 'node:async_hooks'; - * ``` - * @experimental - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/async_hooks.js) - */ -declare module "async_hooks" { - /** - * ```js - * import { executionAsyncId } from 'node:async_hooks'; - * import fs from 'node:fs'; - * - * console.log(executionAsyncId()); // 1 - bootstrap - * const path = '.'; - * fs.open(path, 'r', (err, fd) => { - * console.log(executionAsyncId()); // 6 - open() - * }); - * ``` - * - * The ID returned from `executionAsyncId()` is related to execution timing, not - * causality (which is covered by `triggerAsyncId()`): - * - * ```js - * const server = net.createServer((conn) => { - * // Returns the ID of the server, not of the new connection, because the - * // callback runs in the execution scope of the server's MakeCallback(). - * async_hooks.executionAsyncId(); - * - * }).listen(port, () => { - * // Returns the ID of a TickObject (process.nextTick()) because all - * // callbacks passed to .listen() are wrapped in a nextTick(). - * async_hooks.executionAsyncId(); - * }); - * ``` - * - * Promise contexts may not get precise `executionAsyncIds` by default. - * See the section on [promise execution tracking](https://nodejs.org/docs/latest-v22.x/api/async_hooks.html#promise-execution-tracking). - * @since v8.1.0 - * @return The `asyncId` of the current execution context. Useful to track when something calls. - */ - function executionAsyncId(): number; - /** - * Resource objects returned by `executionAsyncResource()` are most often internal - * Node.js handle objects with undocumented APIs. Using any functions or properties - * on the object is likely to crash your application and should be avoided. - * - * Using `executionAsyncResource()` in the top-level execution context will - * return an empty object as there is no handle or request object to use, - * but having an object representing the top-level can be helpful. - * - * ```js - * import { open } from 'node:fs'; - * import { executionAsyncId, executionAsyncResource } from 'node:async_hooks'; - * - * console.log(executionAsyncId(), executionAsyncResource()); // 1 {} - * open(new URL(import.meta.url), 'r', (err, fd) => { - * console.log(executionAsyncId(), executionAsyncResource()); // 7 FSReqWrap - * }); - * ``` - * - * This can be used to implement continuation local storage without the - * use of a tracking `Map` to store the metadata: - * - * ```js - * import { createServer } from 'node:http'; - * import { - * executionAsyncId, - * executionAsyncResource, - * createHook, - * } from 'node:async_hooks'; - * const sym = Symbol('state'); // Private symbol to avoid pollution - * - * createHook({ - * init(asyncId, type, triggerAsyncId, resource) { - * const cr = executionAsyncResource(); - * if (cr) { - * resource[sym] = cr[sym]; - * } - * }, - * }).enable(); - * - * const server = createServer((req, res) => { - * executionAsyncResource()[sym] = { state: req.url }; - * setTimeout(function() { - * res.end(JSON.stringify(executionAsyncResource()[sym])); - * }, 100); - * }).listen(3000); - * ``` - * @since v13.9.0, v12.17.0 - * @return The resource representing the current execution. Useful to store data within the resource. - */ - function executionAsyncResource(): object; - /** - * ```js - * const server = net.createServer((conn) => { - * // The resource that caused (or triggered) this callback to be called - * // was that of the new connection. Thus the return value of triggerAsyncId() - * // is the asyncId of "conn". - * async_hooks.triggerAsyncId(); - * - * }).listen(port, () => { - * // Even though all callbacks passed to .listen() are wrapped in a nextTick() - * // the callback itself exists because the call to the server's .listen() - * // was made. So the return value would be the ID of the server. - * async_hooks.triggerAsyncId(); - * }); - * ``` - * - * Promise contexts may not get valid `triggerAsyncId`s by default. See - * the section on [promise execution tracking](https://nodejs.org/docs/latest-v22.x/api/async_hooks.html#promise-execution-tracking). - * @return The ID of the resource responsible for calling the callback that is currently being executed. - */ - function triggerAsyncId(): number; - interface HookCallbacks { - /** - * Called when a class is constructed that has the possibility to emit an asynchronous event. - * @param asyncId A unique ID for the async resource - * @param type The type of the async resource - * @param triggerAsyncId The unique ID of the async resource in whose execution context this async resource was created - * @param resource Reference to the resource representing the async operation, needs to be released during destroy - */ - init?(asyncId: number, type: string, triggerAsyncId: number, resource: object): void; - /** - * When an asynchronous operation is initiated or completes a callback is called to notify the user. - * The before callback is called just before said callback is executed. - * @param asyncId the unique identifier assigned to the resource about to execute the callback. - */ - before?(asyncId: number): void; - /** - * Called immediately after the callback specified in `before` is completed. - * - * If an uncaught exception occurs during execution of the callback, then `after` will run after the `'uncaughtException'` event is emitted or a `domain`'s handler runs. - * @param asyncId the unique identifier assigned to the resource which has executed the callback. - */ - after?(asyncId: number): void; - /** - * Called when a promise has resolve() called. This may not be in the same execution id - * as the promise itself. - * @param asyncId the unique id for the promise that was resolve()d. - */ - promiseResolve?(asyncId: number): void; - /** - * Called after the resource corresponding to asyncId is destroyed - * @param asyncId a unique ID for the async resource - */ - destroy?(asyncId: number): void; - } - interface AsyncHook { - /** - * Enable the callbacks for a given AsyncHook instance. If no callbacks are provided enabling is a noop. - */ - enable(): this; - /** - * Disable the callbacks for a given AsyncHook instance from the global pool of AsyncHook callbacks to be executed. Once a hook has been disabled it will not be called again until enabled. - */ - disable(): this; - } - /** - * Registers functions to be called for different lifetime events of each async - * operation. - * - * The callbacks `init()`/`before()`/`after()`/`destroy()` are called for the - * respective asynchronous event during a resource's lifetime. - * - * All callbacks are optional. For example, if only resource cleanup needs to - * be tracked, then only the `destroy` callback needs to be passed. The - * specifics of all functions that can be passed to `callbacks` is in the `Hook Callbacks` section. - * - * ```js - * import { createHook } from 'node:async_hooks'; - * - * const asyncHook = createHook({ - * init(asyncId, type, triggerAsyncId, resource) { }, - * destroy(asyncId) { }, - * }); - * ``` - * - * The callbacks will be inherited via the prototype chain: - * - * ```js - * class MyAsyncCallbacks { - * init(asyncId, type, triggerAsyncId, resource) { } - * destroy(asyncId) {} - * } - * - * class MyAddedCallbacks extends MyAsyncCallbacks { - * before(asyncId) { } - * after(asyncId) { } - * } - * - * const asyncHook = async_hooks.createHook(new MyAddedCallbacks()); - * ``` - * - * Because promises are asynchronous resources whose lifecycle is tracked - * via the async hooks mechanism, the `init()`, `before()`, `after()`, and`destroy()` callbacks _must not_ be async functions that return promises. - * @since v8.1.0 - * @param callbacks The `Hook Callbacks` to register - * @return Instance used for disabling and enabling hooks - */ - function createHook(callbacks: HookCallbacks): AsyncHook; - interface AsyncResourceOptions { - /** - * The ID of the execution context that created this async event. - * @default executionAsyncId() - */ - triggerAsyncId?: number | undefined; - /** - * Disables automatic `emitDestroy` when the object is garbage collected. - * This usually does not need to be set (even if `emitDestroy` is called - * manually), unless the resource's `asyncId` is retrieved and the - * sensitive API's `emitDestroy` is called with it. - * @default false - */ - requireManualDestroy?: boolean | undefined; - } - /** - * The class `AsyncResource` is designed to be extended by the embedder's async - * resources. Using this, users can easily trigger the lifetime events of their - * own resources. - * - * The `init` hook will trigger when an `AsyncResource` is instantiated. - * - * The following is an overview of the `AsyncResource` API. - * - * ```js - * import { AsyncResource, executionAsyncId } from 'node:async_hooks'; - * - * // AsyncResource() is meant to be extended. Instantiating a - * // new AsyncResource() also triggers init. If triggerAsyncId is omitted then - * // async_hook.executionAsyncId() is used. - * const asyncResource = new AsyncResource( - * type, { triggerAsyncId: executionAsyncId(), requireManualDestroy: false }, - * ); - * - * // Run a function in the execution context of the resource. This will - * // * establish the context of the resource - * // * trigger the AsyncHooks before callbacks - * // * call the provided function `fn` with the supplied arguments - * // * trigger the AsyncHooks after callbacks - * // * restore the original execution context - * asyncResource.runInAsyncScope(fn, thisArg, ...args); - * - * // Call AsyncHooks destroy callbacks. - * asyncResource.emitDestroy(); - * - * // Return the unique ID assigned to the AsyncResource instance. - * asyncResource.asyncId(); - * - * // Return the trigger ID for the AsyncResource instance. - * asyncResource.triggerAsyncId(); - * ``` - */ - class AsyncResource { - /** - * AsyncResource() is meant to be extended. Instantiating a - * new AsyncResource() also triggers init. If triggerAsyncId is omitted then - * async_hook.executionAsyncId() is used. - * @param type The type of async event. - * @param triggerAsyncId The ID of the execution context that created - * this async event (default: `executionAsyncId()`), or an - * AsyncResourceOptions object (since v9.3.0) - */ - constructor(type: string, triggerAsyncId?: number | AsyncResourceOptions); - /** - * Binds the given function to the current execution context. - * @since v14.8.0, v12.19.0 - * @param fn The function to bind to the current execution context. - * @param type An optional name to associate with the underlying `AsyncResource`. - */ - static bind any, ThisArg>( - fn: Func, - type?: string, - thisArg?: ThisArg, - ): Func; - /** - * Binds the given function to execute to this `AsyncResource`'s scope. - * @since v14.8.0, v12.19.0 - * @param fn The function to bind to the current `AsyncResource`. - */ - bind any>(fn: Func): Func; - /** - * Call the provided function with the provided arguments in the execution context - * of the async resource. This will establish the context, trigger the AsyncHooks - * before callbacks, call the function, trigger the AsyncHooks after callbacks, and - * then restore the original execution context. - * @since v9.6.0 - * @param fn The function to call in the execution context of this async resource. - * @param thisArg The receiver to be used for the function call. - * @param args Optional arguments to pass to the function. - */ - runInAsyncScope( - fn: (this: This, ...args: any[]) => Result, - thisArg?: This, - ...args: any[] - ): Result; - /** - * Call all `destroy` hooks. This should only ever be called once. An error will - * be thrown if it is called more than once. This **must** be manually called. If - * the resource is left to be collected by the GC then the `destroy` hooks will - * never be called. - * @return A reference to `asyncResource`. - */ - emitDestroy(): this; - /** - * @return The unique `asyncId` assigned to the resource. - */ - asyncId(): number; - /** - * @return The same `triggerAsyncId` that is passed to the `AsyncResource` constructor. - */ - triggerAsyncId(): number; - } - /** - * This class creates stores that stay coherent through asynchronous operations. - * - * While you can create your own implementation on top of the `node:async_hooks` module, `AsyncLocalStorage` should be preferred as it is a performant and memory - * safe implementation that involves significant optimizations that are non-obvious - * to implement. - * - * The following example uses `AsyncLocalStorage` to build a simple logger - * that assigns IDs to incoming HTTP requests and includes them in messages - * logged within each request. - * - * ```js - * import http from 'node:http'; - * import { AsyncLocalStorage } from 'node:async_hooks'; - * - * const asyncLocalStorage = new AsyncLocalStorage(); - * - * function logWithId(msg) { - * const id = asyncLocalStorage.getStore(); - * console.log(`${id !== undefined ? id : '-'}:`, msg); - * } - * - * let idSeq = 0; - * http.createServer((req, res) => { - * asyncLocalStorage.run(idSeq++, () => { - * logWithId('start'); - * // Imagine any chain of async operations here - * setImmediate(() => { - * logWithId('finish'); - * res.end(); - * }); - * }); - * }).listen(8080); - * - * http.get('http://localhost:8080'); - * http.get('http://localhost:8080'); - * // Prints: - * // 0: start - * // 1: start - * // 0: finish - * // 1: finish - * ``` - * - * Each instance of `AsyncLocalStorage` maintains an independent storage context. - * Multiple instances can safely exist simultaneously without risk of interfering - * with each other's data. - * @since v13.10.0, v12.17.0 - */ - class AsyncLocalStorage { - /** - * Binds the given function to the current execution context. - * @since v19.8.0 - * @experimental - * @param fn The function to bind to the current execution context. - * @return A new function that calls `fn` within the captured execution context. - */ - static bind any>(fn: Func): Func; - /** - * Captures the current execution context and returns a function that accepts a - * function as an argument. Whenever the returned function is called, it - * calls the function passed to it within the captured context. - * - * ```js - * const asyncLocalStorage = new AsyncLocalStorage(); - * const runInAsyncScope = asyncLocalStorage.run(123, () => AsyncLocalStorage.snapshot()); - * const result = asyncLocalStorage.run(321, () => runInAsyncScope(() => asyncLocalStorage.getStore())); - * console.log(result); // returns 123 - * ``` - * - * AsyncLocalStorage.snapshot() can replace the use of AsyncResource for simple - * async context tracking purposes, for example: - * - * ```js - * class Foo { - * #runInAsyncScope = AsyncLocalStorage.snapshot(); - * - * get() { return this.#runInAsyncScope(() => asyncLocalStorage.getStore()); } - * } - * - * const foo = asyncLocalStorage.run(123, () => new Foo()); - * console.log(asyncLocalStorage.run(321, () => foo.get())); // returns 123 - * ``` - * @since v19.8.0 - * @experimental - * @return A new function with the signature `(fn: (...args) : R, ...args) : R`. - */ - static snapshot(): (fn: (...args: TArgs) => R, ...args: TArgs) => R; - /** - * Disables the instance of `AsyncLocalStorage`. All subsequent calls - * to `asyncLocalStorage.getStore()` will return `undefined` until `asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again. - * - * When calling `asyncLocalStorage.disable()`, all current contexts linked to the - * instance will be exited. - * - * Calling `asyncLocalStorage.disable()` is required before the `asyncLocalStorage` can be garbage collected. This does not apply to stores - * provided by the `asyncLocalStorage`, as those objects are garbage collected - * along with the corresponding async resources. - * - * Use this method when the `asyncLocalStorage` is not in use anymore - * in the current process. - * @since v13.10.0, v12.17.0 - * @experimental - */ - disable(): void; - /** - * Returns the current store. - * If called outside of an asynchronous context initialized by - * calling `asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()`, it - * returns `undefined`. - * @since v13.10.0, v12.17.0 - */ - getStore(): T | undefined; - /** - * Runs a function synchronously within a context and returns its - * return value. The store is not accessible outside of the callback function. - * The store is accessible to any asynchronous operations created within the - * callback. - * - * The optional `args` are passed to the callback function. - * - * If the callback function throws an error, the error is thrown by `run()` too. - * The stacktrace is not impacted by this call and the context is exited. - * - * Example: - * - * ```js - * const store = { id: 2 }; - * try { - * asyncLocalStorage.run(store, () => { - * asyncLocalStorage.getStore(); // Returns the store object - * setTimeout(() => { - * asyncLocalStorage.getStore(); // Returns the store object - * }, 200); - * throw new Error(); - * }); - * } catch (e) { - * asyncLocalStorage.getStore(); // Returns undefined - * // The error will be caught here - * } - * ``` - * @since v13.10.0, v12.17.0 - */ - run(store: T, callback: () => R): R; - run(store: T, callback: (...args: TArgs) => R, ...args: TArgs): R; - /** - * Runs a function synchronously outside of a context and returns its - * return value. The store is not accessible within the callback function or - * the asynchronous operations created within the callback. Any `getStore()` call done within the callback function will always return `undefined`. - * - * The optional `args` are passed to the callback function. - * - * If the callback function throws an error, the error is thrown by `exit()` too. - * The stacktrace is not impacted by this call and the context is re-entered. - * - * Example: - * - * ```js - * // Within a call to run - * try { - * asyncLocalStorage.getStore(); // Returns the store object or value - * asyncLocalStorage.exit(() => { - * asyncLocalStorage.getStore(); // Returns undefined - * throw new Error(); - * }); - * } catch (e) { - * asyncLocalStorage.getStore(); // Returns the same object or value - * // The error will be caught here - * } - * ``` - * @since v13.10.0, v12.17.0 - * @experimental - */ - exit(callback: (...args: TArgs) => R, ...args: TArgs): R; - /** - * Transitions into the context for the remainder of the current - * synchronous execution and then persists the store through any following - * asynchronous calls. - * - * Example: - * - * ```js - * const store = { id: 1 }; - * // Replaces previous store with the given store object - * asyncLocalStorage.enterWith(store); - * asyncLocalStorage.getStore(); // Returns the store object - * someAsyncOperation(() => { - * asyncLocalStorage.getStore(); // Returns the same object - * }); - * ``` - * - * This transition will continue for the _entire_ synchronous execution. - * This means that if, for example, the context is entered within an event - * handler subsequent event handlers will also run within that context unless - * specifically bound to another context with an `AsyncResource`. That is why `run()` should be preferred over `enterWith()` unless there are strong reasons - * to use the latter method. - * - * ```js - * const store = { id: 1 }; - * - * emitter.on('my-event', () => { - * asyncLocalStorage.enterWith(store); - * }); - * emitter.on('my-event', () => { - * asyncLocalStorage.getStore(); // Returns the same object - * }); - * - * asyncLocalStorage.getStore(); // Returns undefined - * emitter.emit('my-event'); - * asyncLocalStorage.getStore(); // Returns the same object - * ``` - * @since v13.11.0, v12.17.0 - * @experimental - */ - enterWith(store: T): void; - } -} -declare module "node:async_hooks" { - export * from "async_hooks"; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/buffer.buffer.d.ts b/tools/mnemonic-test/node_modules/@types/node/buffer.buffer.d.ts deleted file mode 100644 index 0b6c49a6..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/buffer.buffer.d.ts +++ /dev/null @@ -1,385 +0,0 @@ -declare module "buffer" { - global { - interface BufferConstructor { - // see buffer.d.ts for implementation shared with all TypeScript versions - - /** - * Allocates a new buffer containing the given {str}. - * - * @param str String to store in buffer. - * @param encoding encoding to use, optional. Default is 'utf8' - * @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead. - */ - new(str: string, encoding?: BufferEncoding): Buffer; - /** - * Allocates a new buffer of {size} octets. - * - * @param size count of octets to allocate. - * @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`). - */ - new(size: number): Buffer; - /** - * Allocates a new buffer containing the given {array} of octets. - * - * @param array The octets to store. - * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. - */ - new(array: Uint8Array): Buffer; - /** - * Produces a Buffer backed by the same allocated memory as - * the given {ArrayBuffer}/{SharedArrayBuffer}. - * - * @param arrayBuffer The ArrayBuffer with which to share memory. - * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead. - */ - new(arrayBuffer: TArrayBuffer): Buffer; - /** - * Allocates a new buffer containing the given {array} of octets. - * - * @param array The octets to store. - * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. - */ - new(array: readonly any[]): Buffer; - /** - * Copies the passed {buffer} data onto a new {Buffer} instance. - * - * @param buffer The buffer to copy. - * @deprecated since v10.0.0 - Use `Buffer.from(buffer)` instead. - */ - new(buffer: Buffer): Buffer; - /** - * Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`. - * Array entries outside that range will be truncated to fit into it. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'. - * const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); - * ``` - * - * If `array` is an `Array`\-like object (that is, one with a `length` property of - * type `number`), it is treated as if it is an array, unless it is a `Buffer` or - * a `Uint8Array`. This means all other `TypedArray` variants get treated as an `Array`. To create a `Buffer` from the bytes backing a `TypedArray`, use `Buffer.copyBytesFrom()`. - * - * A `TypeError` will be thrown if `array` is not an `Array` or another type - * appropriate for `Buffer.from()` variants. - * - * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does. - * @since v5.10.0 - */ - from( - arrayBuffer: WithImplicitCoercion, - byteOffset?: number, - length?: number, - ): Buffer; - /** - * Creates a new Buffer using the passed {data} - * @param data data to create a new Buffer - */ - from(data: Uint8Array | readonly number[]): Buffer; - from(data: WithImplicitCoercion): Buffer; - /** - * Creates a new Buffer containing the given JavaScript string {str}. - * If provided, the {encoding} parameter identifies the character encoding. - * If not provided, {encoding} defaults to 'utf8'. - */ - from( - str: - | WithImplicitCoercion - | { - [Symbol.toPrimitive](hint: "string"): string; - }, - encoding?: BufferEncoding, - ): Buffer; - /** - * Creates a new Buffer using the passed {data} - * @param values to create a new Buffer - */ - of(...items: number[]): Buffer; - /** - * Returns a new `Buffer` which is the result of concatenating all the `Buffer` instances in the `list` together. - * - * If the list has no items, or if the `totalLength` is 0, then a new zero-length `Buffer` is returned. - * - * If `totalLength` is not provided, it is calculated from the `Buffer` instances - * in `list` by adding their lengths. - * - * If `totalLength` is provided, it is coerced to an unsigned integer. If the - * combined length of the `Buffer`s in `list` exceeds `totalLength`, the result is - * truncated to `totalLength`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Create a single `Buffer` from a list of three `Buffer` instances. - * - * const buf1 = Buffer.alloc(10); - * const buf2 = Buffer.alloc(14); - * const buf3 = Buffer.alloc(18); - * const totalLength = buf1.length + buf2.length + buf3.length; - * - * console.log(totalLength); - * // Prints: 42 - * - * const bufA = Buffer.concat([buf1, buf2, buf3], totalLength); - * - * console.log(bufA); - * // Prints: - * console.log(bufA.length); - * // Prints: 42 - * ``` - * - * `Buffer.concat()` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does. - * @since v0.7.11 - * @param list List of `Buffer` or {@link Uint8Array} instances to concatenate. - * @param totalLength Total length of the `Buffer` instances in `list` when concatenated. - */ - concat(list: readonly Uint8Array[], totalLength?: number): Buffer; - /** - * Copies the underlying memory of `view` into a new `Buffer`. - * - * ```js - * const u16 = new Uint16Array([0, 0xffff]); - * const buf = Buffer.copyBytesFrom(u16, 1, 1); - * u16[1] = 0; - * console.log(buf.length); // 2 - * console.log(buf[0]); // 255 - * console.log(buf[1]); // 255 - * ``` - * @since v19.8.0 - * @param view The {TypedArray} to copy. - * @param [offset=0] The starting offset within `view`. - * @param [length=view.length - offset] The number of elements from `view` to copy. - */ - copyBytesFrom(view: NodeJS.TypedArray, offset?: number, length?: number): Buffer; - /** - * Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the`Buffer` will be zero-filled. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.alloc(5); - * - * console.log(buf); - * // Prints: - * ``` - * - * If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. - * - * If `fill` is specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill)`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.alloc(5, 'a'); - * - * console.log(buf); - * // Prints: - * ``` - * - * If both `fill` and `encoding` are specified, the allocated `Buffer` will be - * initialized by calling `buf.fill(fill, encoding)`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); - * - * console.log(buf); - * // Prints: - * ``` - * - * Calling `Buffer.alloc()` can be measurably slower than the alternative `Buffer.allocUnsafe()` but ensures that the newly created `Buffer` instance - * contents will never contain sensitive data from previous allocations, including - * data that might not have been allocated for `Buffer`s. - * - * A `TypeError` will be thrown if `size` is not a number. - * @since v5.10.0 - * @param size The desired length of the new `Buffer`. - * @param [fill=0] A value to pre-fill the new `Buffer` with. - * @param [encoding='utf8'] If `fill` is a string, this is its encoding. - */ - alloc(size: number, fill?: string | Uint8Array | number, encoding?: BufferEncoding): Buffer; - /** - * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. - * - * The underlying memory for `Buffer` instances created in this way is _not_ - * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `Buffer.alloc()` instead to initialize`Buffer` instances with zeroes. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(10); - * - * console.log(buf); - * // Prints (contents may vary): - * - * buf.fill(0); - * - * console.log(buf); - * // Prints: - * ``` - * - * A `TypeError` will be thrown if `size` is not a number. - * - * The `Buffer` module pre-allocates an internal `Buffer` instance of - * size `Buffer.poolSize` that is used as a pool for the fast allocation of new `Buffer` instances created using `Buffer.allocUnsafe()`, `Buffer.from(array)`, - * and `Buffer.concat()` only when `size` is less than `Buffer.poolSize >>> 1` (floor of `Buffer.poolSize` divided by two). - * - * Use of this pre-allocated internal memory pool is a key difference between - * calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. - * Specifically, `Buffer.alloc(size, fill)` will _never_ use the internal `Buffer`pool, while `Buffer.allocUnsafe(size).fill(fill)`_will_ use the internal`Buffer` pool if `size` is less - * than or equal to half `Buffer.poolSize`. The - * difference is subtle but can be important when an application requires the - * additional performance that `Buffer.allocUnsafe()` provides. - * @since v5.10.0 - * @param size The desired length of the new `Buffer`. - */ - allocUnsafe(size: number): Buffer; - /** - * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. A zero-length `Buffer` is created if - * `size` is 0. - * - * The underlying memory for `Buffer` instances created in this way is _not_ - * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `buf.fill(0)` to initialize - * such `Buffer` instances with zeroes. - * - * When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, - * allocations under 4 KiB are sliced from a single pre-allocated `Buffer`. This - * allows applications to avoid the garbage collection overhead of creating many - * individually allocated `Buffer` instances. This approach improves both - * performance and memory usage by eliminating the need to track and clean up as - * many individual `ArrayBuffer` objects. - * - * However, in the case where a developer may need to retain a small chunk of - * memory from a pool for an indeterminate amount of time, it may be appropriate - * to create an un-pooled `Buffer` instance using `Buffer.allocUnsafeSlow()` and - * then copying out the relevant bits. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Need to keep around a few small chunks of memory. - * const store = []; - * - * socket.on('readable', () => { - * let data; - * while (null !== (data = readable.read())) { - * // Allocate for retained data. - * const sb = Buffer.allocUnsafeSlow(10); - * - * // Copy the data into the new allocation. - * data.copy(sb, 0, 0, 10); - * - * store.push(sb); - * } - * }); - * ``` - * - * A `TypeError` will be thrown if `size` is not a number. - * @since v5.12.0 - * @param size The desired length of the new `Buffer`. - */ - allocUnsafeSlow(size: number): Buffer; - } - interface Buffer extends Uint8Array { - // see buffer.d.ts for implementation shared with all TypeScript versions - - /** - * Returns a new `Buffer` that references the same memory as the original, but - * offset and cropped by the `start` and `end` indices. - * - * This method is not compatible with the `Uint8Array.prototype.slice()`, - * which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('buffer'); - * - * const copiedBuf = Uint8Array.prototype.slice.call(buf); - * copiedBuf[0]++; - * console.log(copiedBuf.toString()); - * // Prints: cuffer - * - * console.log(buf.toString()); - * // Prints: buffer - * - * // With buf.slice(), the original buffer is modified. - * const notReallyCopiedBuf = buf.slice(); - * notReallyCopiedBuf[0]++; - * console.log(notReallyCopiedBuf.toString()); - * // Prints: cuffer - * console.log(buf.toString()); - * // Also prints: cuffer (!) - * ``` - * @since v0.3.0 - * @deprecated Use `subarray` instead. - * @param [start=0] Where the new `Buffer` will start. - * @param [end=buf.length] Where the new `Buffer` will end (not inclusive). - */ - slice(start?: number, end?: number): Buffer; - /** - * Returns a new `Buffer` that references the same memory as the original, but - * offset and cropped by the `start` and `end` indices. - * - * Specifying `end` greater than `buf.length` will return the same result as - * that of `end` equal to `buf.length`. - * - * This method is inherited from [`TypedArray.prototype.subarray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray). - * - * Modifying the new `Buffer` slice will modify the memory in the original `Buffer`because the allocated memory of the two objects overlap. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Create a `Buffer` with the ASCII alphabet, take a slice, and modify one byte - * // from the original `Buffer`. - * - * const buf1 = Buffer.allocUnsafe(26); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf1[i] = i + 97; - * } - * - * const buf2 = buf1.subarray(0, 3); - * - * console.log(buf2.toString('ascii', 0, buf2.length)); - * // Prints: abc - * - * buf1[0] = 33; - * - * console.log(buf2.toString('ascii', 0, buf2.length)); - * // Prints: !bc - * ``` - * - * Specifying negative indexes causes the slice to be generated relative to the - * end of `buf` rather than the beginning. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('buffer'); - * - * console.log(buf.subarray(-6, -1).toString()); - * // Prints: buffe - * // (Equivalent to buf.subarray(0, 5).) - * - * console.log(buf.subarray(-6, -2).toString()); - * // Prints: buff - * // (Equivalent to buf.subarray(0, 4).) - * - * console.log(buf.subarray(-5, -2).toString()); - * // Prints: uff - * // (Equivalent to buf.subarray(1, 4).) - * ``` - * @since v3.0.0 - * @param [start=0] Where the new `Buffer` will start. - * @param [end=buf.length] Where the new `Buffer` will end (not inclusive). - */ - subarray(start?: number, end?: number): Buffer; - } - } -} diff --git a/tools/mnemonic-test/node_modules/@types/node/buffer.d.ts b/tools/mnemonic-test/node_modules/@types/node/buffer.d.ts deleted file mode 100644 index 792bf4d7..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/buffer.d.ts +++ /dev/null @@ -1,1933 +0,0 @@ -// If lib.dom.d.ts or lib.webworker.d.ts is loaded, then use the global types. -// Otherwise, use the types from node. -type _Blob = typeof globalThis extends { onmessage: any; Blob: any } ? {} : import("buffer").Blob; -type _File = typeof globalThis extends { onmessage: any; File: any } ? {} : import("buffer").File; - -/** - * `Buffer` objects are used to represent a fixed-length sequence of bytes. Many - * Node.js APIs support `Buffer`s. - * - * The `Buffer` class is a subclass of JavaScript's [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) class and - * extends it with methods that cover additional use cases. Node.js APIs accept - * plain [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) s wherever `Buffer`s are supported as well. - * - * While the `Buffer` class is available within the global scope, it is still - * recommended to explicitly reference it via an import or require statement. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Creates a zero-filled Buffer of length 10. - * const buf1 = Buffer.alloc(10); - * - * // Creates a Buffer of length 10, - * // filled with bytes which all have the value `1`. - * const buf2 = Buffer.alloc(10, 1); - * - * // Creates an uninitialized buffer of length 10. - * // This is faster than calling Buffer.alloc() but the returned - * // Buffer instance might contain old data that needs to be - * // overwritten using fill(), write(), or other functions that fill the Buffer's - * // contents. - * const buf3 = Buffer.allocUnsafe(10); - * - * // Creates a Buffer containing the bytes [1, 2, 3]. - * const buf4 = Buffer.from([1, 2, 3]); - * - * // Creates a Buffer containing the bytes [1, 1, 1, 1] – the entries - * // are all truncated using `(value & 255)` to fit into the range 0–255. - * const buf5 = Buffer.from([257, 257.5, -255, '1']); - * - * // Creates a Buffer containing the UTF-8-encoded bytes for the string 'tést': - * // [0x74, 0xc3, 0xa9, 0x73, 0x74] (in hexadecimal notation) - * // [116, 195, 169, 115, 116] (in decimal notation) - * const buf6 = Buffer.from('tést'); - * - * // Creates a Buffer containing the Latin-1 bytes [0x74, 0xe9, 0x73, 0x74]. - * const buf7 = Buffer.from('tést', 'latin1'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/buffer.js) - */ -declare module "buffer" { - import { BinaryLike } from "node:crypto"; - import { ReadableStream as WebReadableStream } from "node:stream/web"; - /** - * This function returns `true` if `input` contains only valid UTF-8-encoded data, - * including the case in which `input` is empty. - * - * Throws if the `input` is a detached array buffer. - * @since v19.4.0, v18.14.0 - * @param input The input to validate. - */ - export function isUtf8(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean; - /** - * This function returns `true` if `input` contains only valid ASCII-encoded data, - * including the case in which `input` is empty. - * - * Throws if the `input` is a detached array buffer. - * @since v19.6.0, v18.15.0 - * @param input The input to validate. - */ - export function isAscii(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean; - export const INSPECT_MAX_BYTES: number; - export const kMaxLength: number; - export const kStringMaxLength: number; - export const constants: { - MAX_LENGTH: number; - MAX_STRING_LENGTH: number; - }; - export type TranscodeEncoding = - | "ascii" - | "utf8" - | "utf-8" - | "utf16le" - | "utf-16le" - | "ucs2" - | "ucs-2" - | "latin1" - | "binary"; - /** - * Re-encodes the given `Buffer` or `Uint8Array` instance from one character - * encoding to another. Returns a new `Buffer` instance. - * - * Throws if the `fromEnc` or `toEnc` specify invalid character encodings or if - * conversion from `fromEnc` to `toEnc` is not permitted. - * - * Encodings supported by `buffer.transcode()` are: `'ascii'`, `'utf8'`, `'utf16le'`, `'ucs2'`, `'latin1'`, and `'binary'`. - * - * The transcoding process will use substitution characters if a given byte - * sequence cannot be adequately represented in the target encoding. For instance: - * - * ```js - * import { Buffer, transcode } from 'node:buffer'; - * - * const newBuf = transcode(Buffer.from('€'), 'utf8', 'ascii'); - * console.log(newBuf.toString('ascii')); - * // Prints: '?' - * ``` - * - * Because the Euro (`€`) sign is not representable in US-ASCII, it is replaced - * with `?` in the transcoded `Buffer`. - * @since v7.1.0 - * @param source A `Buffer` or `Uint8Array` instance. - * @param fromEnc The current encoding. - * @param toEnc To target encoding. - */ - export function transcode(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer; - export const SlowBuffer: { - /** @deprecated since v6.0.0, use `Buffer.allocUnsafeSlow()` */ - new(size: number): Buffer; - prototype: Buffer; - }; - /** - * Resolves a `'blob:nodedata:...'` an associated `Blob` object registered using - * a prior call to `URL.createObjectURL()`. - * @since v16.7.0 - * @experimental - * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`. - */ - export function resolveObjectURL(id: string): Blob | undefined; - export { Buffer }; - /** - * @experimental - */ - export interface BlobOptions { - /** - * One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts - * will be converted to the platform native line-ending as specified by `import { EOL } from 'node:os'`. - */ - endings?: "transparent" | "native"; - /** - * The Blob content-type. The intent is for `type` to convey - * the MIME media type of the data, however no validation of the type format - * is performed. - */ - type?: string | undefined; - } - /** - * A [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) encapsulates immutable, raw data that can be safely shared across - * multiple worker threads. - * @since v15.7.0, v14.18.0 - */ - export class Blob { - /** - * The total size of the `Blob` in bytes. - * @since v15.7.0, v14.18.0 - */ - readonly size: number; - /** - * The content-type of the `Blob`. - * @since v15.7.0, v14.18.0 - */ - readonly type: string; - /** - * Creates a new `Blob` object containing a concatenation of the given sources. - * - * {ArrayBuffer}, {TypedArray}, {DataView}, and {Buffer} sources are copied into - * the 'Blob' and can therefore be safely modified after the 'Blob' is created. - * - * String sources are also copied into the `Blob`. - */ - constructor(sources: Array, options?: BlobOptions); - /** - * Returns a promise that fulfills with an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) containing a copy of - * the `Blob` data. - * @since v15.7.0, v14.18.0 - */ - arrayBuffer(): Promise; - /** - * The `blob.bytes()` method returns the byte of the `Blob` object as a `Promise`. - * - * ```js - * const blob = new Blob(['hello']); - * blob.bytes().then((bytes) => { - * console.log(bytes); // Outputs: Uint8Array(5) [ 104, 101, 108, 108, 111 ] - * }); - * ``` - */ - bytes(): Promise; - /** - * Creates and returns a new `Blob` containing a subset of this `Blob` objects - * data. The original `Blob` is not altered. - * @since v15.7.0, v14.18.0 - * @param start The starting index. - * @param end The ending index. - * @param type The content-type for the new `Blob` - */ - slice(start?: number, end?: number, type?: string): Blob; - /** - * Returns a promise that fulfills with the contents of the `Blob` decoded as a - * UTF-8 string. - * @since v15.7.0, v14.18.0 - */ - text(): Promise; - /** - * Returns a new `ReadableStream` that allows the content of the `Blob` to be read. - * @since v16.7.0 - */ - stream(): WebReadableStream; - } - export interface FileOptions { - /** - * One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts will be - * converted to the platform native line-ending as specified by `import { EOL } from 'node:os'`. - */ - endings?: "native" | "transparent"; - /** The File content-type. */ - type?: string; - /** The last modified date of the file. `Default`: Date.now(). */ - lastModified?: number; - } - /** - * A [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) provides information about files. - * @since v19.2.0, v18.13.0 - */ - export class File extends Blob { - constructor(sources: Array, fileName: string, options?: FileOptions); - /** - * The name of the `File`. - * @since v19.2.0, v18.13.0 - */ - readonly name: string; - /** - * The last modified date of the `File`. - * @since v19.2.0, v18.13.0 - */ - readonly lastModified: number; - } - export import atob = globalThis.atob; - export import btoa = globalThis.btoa; - - global { - namespace NodeJS { - export { BufferEncoding }; - } - // Buffer class - type BufferEncoding = - | "ascii" - | "utf8" - | "utf-8" - | "utf16le" - | "utf-16le" - | "ucs2" - | "ucs-2" - | "base64" - | "base64url" - | "latin1" - | "binary" - | "hex"; - type WithImplicitCoercion = - | T - | { - valueOf(): T; - }; - /** - * Raw data is stored in instances of the Buffer class. - * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized. - * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'base64url'|'binary'(deprecated)|'hex' - */ - interface BufferConstructor { - // see buffer.buffer.d.ts for implementation specific to TypeScript 5.7 and later - // see ts5.6/buffer.buffer.d.ts for implementation specific to TypeScript 5.6 and earlier - - /** - * Returns `true` if `obj` is a `Buffer`, `false` otherwise. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * Buffer.isBuffer(Buffer.alloc(10)); // true - * Buffer.isBuffer(Buffer.from('foo')); // true - * Buffer.isBuffer('a string'); // false - * Buffer.isBuffer([]); // false - * Buffer.isBuffer(new Uint8Array(1024)); // false - * ``` - * @since v0.1.101 - */ - isBuffer(obj: any): obj is Buffer; - /** - * Returns `true` if `encoding` is the name of a supported character encoding, - * or `false` otherwise. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * console.log(Buffer.isEncoding('utf8')); - * // Prints: true - * - * console.log(Buffer.isEncoding('hex')); - * // Prints: true - * - * console.log(Buffer.isEncoding('utf/8')); - * // Prints: false - * - * console.log(Buffer.isEncoding('')); - * // Prints: false - * ``` - * @since v0.9.1 - * @param encoding A character encoding name to check. - */ - isEncoding(encoding: string): encoding is BufferEncoding; - /** - * Returns the byte length of a string when encoded using `encoding`. - * This is not the same as [`String.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length), which does not account - * for the encoding that is used to convert the string into bytes. - * - * For `'base64'`, `'base64url'`, and `'hex'`, this function assumes valid input. - * For strings that contain non-base64/hex-encoded data (e.g. whitespace), the - * return value might be greater than the length of a `Buffer` created from the - * string. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const str = '\u00bd + \u00bc = \u00be'; - * - * console.log(`${str}: ${str.length} characters, ` + - * `${Buffer.byteLength(str, 'utf8')} bytes`); - * // Prints: ½ + ¼ = ¾: 9 characters, 12 bytes - * ``` - * - * When `string` is a - * `Buffer`/[`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)/[`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/- - * Reference/Global_Objects/TypedArray)/[`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)/[`SharedArrayBuffer`](https://develop- - * er.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer), the byte length as reported by `.byteLength`is returned. - * @since v0.1.90 - * @param string A value to calculate the length of. - * @param [encoding='utf8'] If `string` is a string, this is its encoding. - * @return The number of bytes contained within `string`. - */ - byteLength( - string: string | Buffer | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer, - encoding?: BufferEncoding, - ): number; - /** - * Compares `buf1` to `buf2`, typically for the purpose of sorting arrays of `Buffer` instances. This is equivalent to calling `buf1.compare(buf2)`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from('1234'); - * const buf2 = Buffer.from('0123'); - * const arr = [buf1, buf2]; - * - * console.log(arr.sort(Buffer.compare)); - * // Prints: [ , ] - * // (This result is equal to: [buf2, buf1].) - * ``` - * @since v0.11.13 - * @return Either `-1`, `0`, or `1`, depending on the result of the comparison. See `compare` for details. - */ - compare(buf1: Uint8Array, buf2: Uint8Array): -1 | 0 | 1; - /** - * This is the size (in bytes) of pre-allocated internal `Buffer` instances used - * for pooling. This value may be modified. - * @since v0.11.3 - */ - poolSize: number; - } - interface Buffer { - // see buffer.buffer.d.ts for implementation specific to TypeScript 5.7 and later - // see ts5.6/buffer.buffer.d.ts for implementation specific to TypeScript 5.6 and earlier - - /** - * Writes `string` to `buf` at `offset` according to the character encoding in`encoding`. The `length` parameter is the number of bytes to write. If `buf` did - * not contain enough space to fit the entire string, only part of `string` will be - * written. However, partially encoded characters will not be written. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.alloc(256); - * - * const len = buf.write('\u00bd + \u00bc = \u00be', 0); - * - * console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`); - * // Prints: 12 bytes: ½ + ¼ = ¾ - * - * const buffer = Buffer.alloc(10); - * - * const length = buffer.write('abcd', 8); - * - * console.log(`${length} bytes: ${buffer.toString('utf8', 8, 10)}`); - * // Prints: 2 bytes : ab - * ``` - * @since v0.1.90 - * @param string String to write to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write `string`. - * @param [length=buf.length - offset] Maximum number of bytes to write (written bytes will not exceed `buf.length - offset`). - * @param [encoding='utf8'] The character encoding of `string`. - * @return Number of bytes written. - */ - write(string: string, encoding?: BufferEncoding): number; - write(string: string, offset: number, encoding?: BufferEncoding): number; - write(string: string, offset: number, length: number, encoding?: BufferEncoding): number; - /** - * Decodes `buf` to a string according to the specified character encoding in`encoding`. `start` and `end` may be passed to decode only a subset of `buf`. - * - * If `encoding` is `'utf8'` and a byte sequence in the input is not valid UTF-8, - * then each invalid byte is replaced with the replacement character `U+FFFD`. - * - * The maximum length of a string instance (in UTF-16 code units) is available - * as {@link constants.MAX_STRING_LENGTH}. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.allocUnsafe(26); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf1[i] = i + 97; - * } - * - * console.log(buf1.toString('utf8')); - * // Prints: abcdefghijklmnopqrstuvwxyz - * console.log(buf1.toString('utf8', 0, 5)); - * // Prints: abcde - * - * const buf2 = Buffer.from('tést'); - * - * console.log(buf2.toString('hex')); - * // Prints: 74c3a97374 - * console.log(buf2.toString('utf8', 0, 3)); - * // Prints: té - * console.log(buf2.toString(undefined, 0, 3)); - * // Prints: té - * ``` - * @since v0.1.90 - * @param [encoding='utf8'] The character encoding to use. - * @param [start=0] The byte offset to start decoding at. - * @param [end=buf.length] The byte offset to stop decoding at (not inclusive). - */ - toString(encoding?: BufferEncoding, start?: number, end?: number): string; - /** - * Returns a JSON representation of `buf`. [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) implicitly calls - * this function when stringifying a `Buffer` instance. - * - * `Buffer.from()` accepts objects in the format returned from this method. - * In particular, `Buffer.from(buf.toJSON())` works like `Buffer.from(buf)`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5]); - * const json = JSON.stringify(buf); - * - * console.log(json); - * // Prints: {"type":"Buffer","data":[1,2,3,4,5]} - * - * const copy = JSON.parse(json, (key, value) => { - * return value && value.type === 'Buffer' ? - * Buffer.from(value) : - * value; - * }); - * - * console.log(copy); - * // Prints: - * ``` - * @since v0.9.2 - */ - toJSON(): { - type: "Buffer"; - data: number[]; - }; - /** - * Returns `true` if both `buf` and `otherBuffer` have exactly the same bytes,`false` otherwise. Equivalent to `buf.compare(otherBuffer) === 0`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from('ABC'); - * const buf2 = Buffer.from('414243', 'hex'); - * const buf3 = Buffer.from('ABCD'); - * - * console.log(buf1.equals(buf2)); - * // Prints: true - * console.log(buf1.equals(buf3)); - * // Prints: false - * ``` - * @since v0.11.13 - * @param otherBuffer A `Buffer` or {@link Uint8Array} with which to compare `buf`. - */ - equals(otherBuffer: Uint8Array): boolean; - /** - * Compares `buf` with `target` and returns a number indicating whether `buf`comes before, after, or is the same as `target` in sort order. - * Comparison is based on the actual sequence of bytes in each `Buffer`. - * - * * `0` is returned if `target` is the same as `buf` - * * `1` is returned if `target` should come _before_`buf` when sorted. - * * `-1` is returned if `target` should come _after_`buf` when sorted. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from('ABC'); - * const buf2 = Buffer.from('BCD'); - * const buf3 = Buffer.from('ABCD'); - * - * console.log(buf1.compare(buf1)); - * // Prints: 0 - * console.log(buf1.compare(buf2)); - * // Prints: -1 - * console.log(buf1.compare(buf3)); - * // Prints: -1 - * console.log(buf2.compare(buf1)); - * // Prints: 1 - * console.log(buf2.compare(buf3)); - * // Prints: 1 - * console.log([buf1, buf2, buf3].sort(Buffer.compare)); - * // Prints: [ , , ] - * // (This result is equal to: [buf1, buf3, buf2].) - * ``` - * - * The optional `targetStart`, `targetEnd`, `sourceStart`, and `sourceEnd` arguments can be used to limit the comparison to specific ranges within `target` and `buf` respectively. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8, 9]); - * const buf2 = Buffer.from([5, 6, 7, 8, 9, 1, 2, 3, 4]); - * - * console.log(buf1.compare(buf2, 5, 9, 0, 4)); - * // Prints: 0 - * console.log(buf1.compare(buf2, 0, 6, 4)); - * // Prints: -1 - * console.log(buf1.compare(buf2, 5, 6, 5)); - * // Prints: 1 - * ``` - * - * `ERR_OUT_OF_RANGE` is thrown if `targetStart < 0`, `sourceStart < 0`, `targetEnd > target.byteLength`, or `sourceEnd > source.byteLength`. - * @since v0.11.13 - * @param target A `Buffer` or {@link Uint8Array} with which to compare `buf`. - * @param [targetStart=0] The offset within `target` at which to begin comparison. - * @param [targetEnd=target.length] The offset within `target` at which to end comparison (not inclusive). - * @param [sourceStart=0] The offset within `buf` at which to begin comparison. - * @param [sourceEnd=buf.length] The offset within `buf` at which to end comparison (not inclusive). - */ - compare( - target: Uint8Array, - targetStart?: number, - targetEnd?: number, - sourceStart?: number, - sourceEnd?: number, - ): -1 | 0 | 1; - /** - * Copies data from a region of `buf` to a region in `target`, even if the `target`memory region overlaps with `buf`. - * - * [`TypedArray.prototype.set()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) performs the same operation, and is available - * for all TypedArrays, including Node.js `Buffer`s, although it takes - * different function arguments. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Create two `Buffer` instances. - * const buf1 = Buffer.allocUnsafe(26); - * const buf2 = Buffer.allocUnsafe(26).fill('!'); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf1[i] = i + 97; - * } - * - * // Copy `buf1` bytes 16 through 19 into `buf2` starting at byte 8 of `buf2`. - * buf1.copy(buf2, 8, 16, 20); - * // This is equivalent to: - * // buf2.set(buf1.subarray(16, 20), 8); - * - * console.log(buf2.toString('ascii', 0, 25)); - * // Prints: !!!!!!!!qrst!!!!!!!!!!!!! - * ``` - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Create a `Buffer` and copy data from one region to an overlapping region - * // within the same `Buffer`. - * - * const buf = Buffer.allocUnsafe(26); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf[i] = i + 97; - * } - * - * buf.copy(buf, 0, 4, 10); - * - * console.log(buf.toString()); - * // Prints: efghijghijklmnopqrstuvwxyz - * ``` - * @since v0.1.90 - * @param target A `Buffer` or {@link Uint8Array} to copy into. - * @param [targetStart=0] The offset within `target` at which to begin writing. - * @param [sourceStart=0] The offset within `buf` from which to begin copying. - * @param [sourceEnd=buf.length] The offset within `buf` at which to stop copying (not inclusive). - * @return The number of bytes copied. - */ - copy(target: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. - * - * `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigInt64BE(0x0102030405060708n, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigInt64BE(value: bigint, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. - * - * `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigInt64LE(0x0102030405060708n, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigInt64LE(value: bigint, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. - * - * This function is also available under the `writeBigUint64BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigUInt64BE(0xdecafafecacefaden, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigUInt64BE(value: bigint, offset?: number): number; - /** - * @alias Buffer.writeBigUInt64BE - * @since v14.10.0, v12.19.0 - */ - writeBigUint64BE(value: bigint, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigUInt64LE(0xdecafafecacefaden, 0); - * - * console.log(buf); - * // Prints: - * ``` - * - * This function is also available under the `writeBigUint64LE` alias. - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigUInt64LE(value: bigint, offset?: number): number; - /** - * @alias Buffer.writeBigUInt64LE - * @since v14.10.0, v12.19.0 - */ - writeBigUint64LE(value: bigint, offset?: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined - * when `value` is anything other than an unsigned integer. - * - * This function is also available under the `writeUintLE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeUIntLE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeUIntLE(value: number, offset: number, byteLength: number): number; - /** - * @alias Buffer.writeUIntLE - * @since v14.9.0, v12.19.0 - */ - writeUintLE(value: number, offset: number, byteLength: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined - * when `value` is anything other than an unsigned integer. - * - * This function is also available under the `writeUintBE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeUIntBE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeUIntBE(value: number, offset: number, byteLength: number): number; - /** - * @alias Buffer.writeUIntBE - * @since v14.9.0, v12.19.0 - */ - writeUintBE(value: number, offset: number, byteLength: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined - * when `value` is anything other than a signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeIntLE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeIntLE(value: number, offset: number, byteLength: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined when`value` is anything other than a - * signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeIntBE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeIntBE(value: number, offset: number, byteLength: number): number; - /** - * Reads an unsigned, big-endian 64-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readBigUint64BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]); - * - * console.log(buf.readBigUInt64BE(0)); - * // Prints: 4294967295n - * ``` - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigUInt64BE(offset?: number): bigint; - /** - * @alias Buffer.readBigUInt64BE - * @since v14.10.0, v12.19.0 - */ - readBigUint64BE(offset?: number): bigint; - /** - * Reads an unsigned, little-endian 64-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readBigUint64LE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]); - * - * console.log(buf.readBigUInt64LE(0)); - * // Prints: 18446744069414584320n - * ``` - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigUInt64LE(offset?: number): bigint; - /** - * @alias Buffer.readBigUInt64LE - * @since v14.10.0, v12.19.0 - */ - readBigUint64LE(offset?: number): bigint; - /** - * Reads a signed, big-endian 64-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed - * values. - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigInt64BE(offset?: number): bigint; - /** - * Reads a signed, little-endian 64-bit integer from `buf` at the specified`offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed - * values. - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigInt64LE(offset?: number): bigint; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset` and interprets the result as an unsigned, little-endian integer supporting - * up to 48 bits of accuracy. - * - * This function is also available under the `readUintLE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readUIntLE(0, 6).toString(16)); - * // Prints: ab9078563412 - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readUIntLE(offset: number, byteLength: number): number; - /** - * @alias Buffer.readUIntLE - * @since v14.9.0, v12.19.0 - */ - readUintLE(offset: number, byteLength: number): number; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset` and interprets the result as an unsigned big-endian integer supporting - * up to 48 bits of accuracy. - * - * This function is also available under the `readUintBE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readUIntBE(0, 6).toString(16)); - * // Prints: 1234567890ab - * console.log(buf.readUIntBE(1, 6).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readUIntBE(offset: number, byteLength: number): number; - /** - * @alias Buffer.readUIntBE - * @since v14.9.0, v12.19.0 - */ - readUintBE(offset: number, byteLength: number): number; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset` and interprets the result as a little-endian, two's complement signed value - * supporting up to 48 bits of accuracy. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readIntLE(0, 6).toString(16)); - * // Prints: -546f87a9cbee - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readIntLE(offset: number, byteLength: number): number; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset` and interprets the result as a big-endian, two's complement signed value - * supporting up to 48 bits of accuracy. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readIntBE(0, 6).toString(16)); - * // Prints: 1234567890ab - * console.log(buf.readIntBE(1, 6).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * console.log(buf.readIntBE(1, 0).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readIntBE(offset: number, byteLength: number): number; - /** - * Reads an unsigned 8-bit integer from `buf` at the specified `offset`. - * - * This function is also available under the `readUint8` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([1, -2]); - * - * console.log(buf.readUInt8(0)); - * // Prints: 1 - * console.log(buf.readUInt8(1)); - * // Prints: 254 - * console.log(buf.readUInt8(2)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`. - */ - readUInt8(offset?: number): number; - /** - * @alias Buffer.readUInt8 - * @since v14.9.0, v12.19.0 - */ - readUint8(offset?: number): number; - /** - * Reads an unsigned, little-endian 16-bit integer from `buf` at the specified `offset`. - * - * This function is also available under the `readUint16LE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56]); - * - * console.log(buf.readUInt16LE(0).toString(16)); - * // Prints: 3412 - * console.log(buf.readUInt16LE(1).toString(16)); - * // Prints: 5634 - * console.log(buf.readUInt16LE(2).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readUInt16LE(offset?: number): number; - /** - * @alias Buffer.readUInt16LE - * @since v14.9.0, v12.19.0 - */ - readUint16LE(offset?: number): number; - /** - * Reads an unsigned, big-endian 16-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint16BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56]); - * - * console.log(buf.readUInt16BE(0).toString(16)); - * // Prints: 1234 - * console.log(buf.readUInt16BE(1).toString(16)); - * // Prints: 3456 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readUInt16BE(offset?: number): number; - /** - * @alias Buffer.readUInt16BE - * @since v14.9.0, v12.19.0 - */ - readUint16BE(offset?: number): number; - /** - * Reads an unsigned, little-endian 32-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint32LE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]); - * - * console.log(buf.readUInt32LE(0).toString(16)); - * // Prints: 78563412 - * console.log(buf.readUInt32LE(1).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readUInt32LE(offset?: number): number; - /** - * @alias Buffer.readUInt32LE - * @since v14.9.0, v12.19.0 - */ - readUint32LE(offset?: number): number; - /** - * Reads an unsigned, big-endian 32-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint32BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]); - * - * console.log(buf.readUInt32BE(0).toString(16)); - * // Prints: 12345678 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readUInt32BE(offset?: number): number; - /** - * @alias Buffer.readUInt32BE - * @since v14.9.0, v12.19.0 - */ - readUint32BE(offset?: number): number; - /** - * Reads a signed 8-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([-1, 5]); - * - * console.log(buf.readInt8(0)); - * // Prints: -1 - * console.log(buf.readInt8(1)); - * // Prints: 5 - * console.log(buf.readInt8(2)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`. - */ - readInt8(offset?: number): number; - /** - * Reads a signed, little-endian 16-bit integer from `buf` at the specified`offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0, 5]); - * - * console.log(buf.readInt16LE(0)); - * // Prints: 1280 - * console.log(buf.readInt16LE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readInt16LE(offset?: number): number; - /** - * Reads a signed, big-endian 16-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0, 5]); - * - * console.log(buf.readInt16BE(0)); - * // Prints: 5 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readInt16BE(offset?: number): number; - /** - * Reads a signed, little-endian 32-bit integer from `buf` at the specified`offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0, 0, 0, 5]); - * - * console.log(buf.readInt32LE(0)); - * // Prints: 83886080 - * console.log(buf.readInt32LE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readInt32LE(offset?: number): number; - /** - * Reads a signed, big-endian 32-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0, 0, 0, 5]); - * - * console.log(buf.readInt32BE(0)); - * // Prints: 5 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readInt32BE(offset?: number): number; - /** - * Reads a 32-bit, little-endian float from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4]); - * - * console.log(buf.readFloatLE(0)); - * // Prints: 1.539989614439558e-36 - * console.log(buf.readFloatLE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readFloatLE(offset?: number): number; - /** - * Reads a 32-bit, big-endian float from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4]); - * - * console.log(buf.readFloatBE(0)); - * // Prints: 2.387939260590663e-38 - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readFloatBE(offset?: number): number; - /** - * Reads a 64-bit, little-endian double from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); - * - * console.log(buf.readDoubleLE(0)); - * // Prints: 5.447603722011605e-270 - * console.log(buf.readDoubleLE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`. - */ - readDoubleLE(offset?: number): number; - /** - * Reads a 64-bit, big-endian double from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); - * - * console.log(buf.readDoubleBE(0)); - * // Prints: 8.20788039913184e-304 - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`. - */ - readDoubleBE(offset?: number): number; - reverse(): this; - /** - * Interprets `buf` as an array of unsigned 16-bit integers and swaps the - * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 2. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); - * - * console.log(buf1); - * // Prints: - * - * buf1.swap16(); - * - * console.log(buf1); - * // Prints: - * - * const buf2 = Buffer.from([0x1, 0x2, 0x3]); - * - * buf2.swap16(); - * // Throws ERR_INVALID_BUFFER_SIZE. - * ``` - * - * One convenient use of `buf.swap16()` is to perform a fast in-place conversion - * between UTF-16 little-endian and UTF-16 big-endian: - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('This is little-endian UTF-16', 'utf16le'); - * buf.swap16(); // Convert to big-endian UTF-16 text. - * ``` - * @since v5.10.0 - * @return A reference to `buf`. - */ - swap16(): this; - /** - * Interprets `buf` as an array of unsigned 32-bit integers and swaps the - * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 4. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); - * - * console.log(buf1); - * // Prints: - * - * buf1.swap32(); - * - * console.log(buf1); - * // Prints: - * - * const buf2 = Buffer.from([0x1, 0x2, 0x3]); - * - * buf2.swap32(); - * // Throws ERR_INVALID_BUFFER_SIZE. - * ``` - * @since v5.10.0 - * @return A reference to `buf`. - */ - swap32(): this; - /** - * Interprets `buf` as an array of 64-bit numbers and swaps byte order _in-place_. - * Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 8. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); - * - * console.log(buf1); - * // Prints: - * - * buf1.swap64(); - * - * console.log(buf1); - * // Prints: - * - * const buf2 = Buffer.from([0x1, 0x2, 0x3]); - * - * buf2.swap64(); - * // Throws ERR_INVALID_BUFFER_SIZE. - * ``` - * @since v6.3.0 - * @return A reference to `buf`. - */ - swap64(): this; - /** - * Writes `value` to `buf` at the specified `offset`. `value` must be a - * valid unsigned 8-bit integer. Behavior is undefined when `value` is anything - * other than an unsigned 8-bit integer. - * - * This function is also available under the `writeUint8` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt8(0x3, 0); - * buf.writeUInt8(0x4, 1); - * buf.writeUInt8(0x23, 2); - * buf.writeUInt8(0x42, 3); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`. - * @return `offset` plus the number of bytes written. - */ - writeUInt8(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt8 - * @since v14.9.0, v12.19.0 - */ - writeUint8(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a valid unsigned 16-bit integer. Behavior is undefined when `value` is - * anything other than an unsigned 16-bit integer. - * - * This function is also available under the `writeUint16LE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt16LE(0xdead, 0); - * buf.writeUInt16LE(0xbeef, 2); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeUInt16LE(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt16LE - * @since v14.9.0, v12.19.0 - */ - writeUint16LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a valid unsigned 16-bit integer. Behavior is undefined when `value`is anything other than an - * unsigned 16-bit integer. - * - * This function is also available under the `writeUint16BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt16BE(0xdead, 0); - * buf.writeUInt16BE(0xbeef, 2); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeUInt16BE(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt16BE - * @since v14.9.0, v12.19.0 - */ - writeUint16BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a valid unsigned 32-bit integer. Behavior is undefined when `value` is - * anything other than an unsigned 32-bit integer. - * - * This function is also available under the `writeUint32LE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt32LE(0xfeedface, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeUInt32LE(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt32LE - * @since v14.9.0, v12.19.0 - */ - writeUint32LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a valid unsigned 32-bit integer. Behavior is undefined when `value`is anything other than an - * unsigned 32-bit integer. - * - * This function is also available under the `writeUint32BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt32BE(0xfeedface, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeUInt32BE(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt32BE - * @since v14.9.0, v12.19.0 - */ - writeUint32BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset`. `value` must be a valid - * signed 8-bit integer. Behavior is undefined when `value` is anything other than - * a signed 8-bit integer. - * - * `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(2); - * - * buf.writeInt8(2, 0); - * buf.writeInt8(-2, 1); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`. - * @return `offset` plus the number of bytes written. - */ - writeInt8(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a valid signed 16-bit integer. Behavior is undefined when `value` is - * anything other than a signed 16-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(2); - * - * buf.writeInt16LE(0x0304, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeInt16LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a valid signed 16-bit integer. Behavior is undefined when `value` is - * anything other than a signed 16-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(2); - * - * buf.writeInt16BE(0x0102, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeInt16BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a valid signed 32-bit integer. Behavior is undefined when `value` is - * anything other than a signed 32-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeInt32LE(0x05060708, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeInt32LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a valid signed 32-bit integer. Behavior is undefined when `value` is - * anything other than a signed 32-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeInt32BE(0x01020304, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeInt32BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. Behavior is - * undefined when `value` is anything other than a JavaScript number. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeFloatLE(0xcafebabe, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeFloatLE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. Behavior is - * undefined when `value` is anything other than a JavaScript number. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeFloatBE(0xcafebabe, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeFloatBE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a JavaScript number. Behavior is undefined when `value` is anything - * other than a JavaScript number. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeDoubleLE(123.456, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeDoubleLE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a JavaScript number. Behavior is undefined when `value` is anything - * other than a JavaScript number. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeDoubleBE(123.456, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeDoubleBE(value: number, offset?: number): number; - /** - * Fills `buf` with the specified `value`. If the `offset` and `end` are not given, - * the entire `buf` will be filled: - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Fill a `Buffer` with the ASCII character 'h'. - * - * const b = Buffer.allocUnsafe(50).fill('h'); - * - * console.log(b.toString()); - * // Prints: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh - * - * // Fill a buffer with empty string - * const c = Buffer.allocUnsafe(5).fill(''); - * - * console.log(c.fill('')); - * // Prints: - * ``` - * - * `value` is coerced to a `uint32` value if it is not a string, `Buffer`, or - * integer. If the resulting integer is greater than `255` (decimal), `buf` will be - * filled with `value & 255`. - * - * If the final write of a `fill()` operation falls on a multi-byte character, - * then only the bytes of that character that fit into `buf` are written: - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Fill a `Buffer` with character that takes up two bytes in UTF-8. - * - * console.log(Buffer.allocUnsafe(5).fill('\u0222')); - * // Prints: - * ``` - * - * If `value` contains invalid characters, it is truncated; if no valid - * fill data remains, an exception is thrown: - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(5); - * - * console.log(buf.fill('a')); - * // Prints: - * console.log(buf.fill('aazz', 'hex')); - * // Prints: - * console.log(buf.fill('zz', 'hex')); - * // Throws an exception. - * ``` - * @since v0.5.0 - * @param value The value with which to fill `buf`. Empty value (string, Uint8Array, Buffer) is coerced to `0`. - * @param [offset=0] Number of bytes to skip before starting to fill `buf`. - * @param [end=buf.length] Where to stop filling `buf` (not inclusive). - * @param [encoding='utf8'] The encoding for `value` if `value` is a string. - * @return A reference to `buf`. - */ - fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this; - /** - * If `value` is: - * - * * a string, `value` is interpreted according to the character encoding in `encoding`. - * * a `Buffer` or [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array), `value` will be used in its entirety. - * To compare a partial `Buffer`, use `buf.subarray`. - * * a number, `value` will be interpreted as an unsigned 8-bit integer - * value between `0` and `255`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('this is a buffer'); - * - * console.log(buf.indexOf('this')); - * // Prints: 0 - * console.log(buf.indexOf('is')); - * // Prints: 2 - * console.log(buf.indexOf(Buffer.from('a buffer'))); - * // Prints: 8 - * console.log(buf.indexOf(97)); - * // Prints: 8 (97 is the decimal ASCII value for 'a') - * console.log(buf.indexOf(Buffer.from('a buffer example'))); - * // Prints: -1 - * console.log(buf.indexOf(Buffer.from('a buffer example').slice(0, 8))); - * // Prints: 8 - * - * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le'); - * - * console.log(utf16Buffer.indexOf('\u03a3', 0, 'utf16le')); - * // Prints: 4 - * console.log(utf16Buffer.indexOf('\u03a3', -4, 'utf16le')); - * // Prints: 6 - * ``` - * - * If `value` is not a string, number, or `Buffer`, this method will throw a `TypeError`. If `value` is a number, it will be coerced to a valid byte value, - * an integer between 0 and 255. - * - * If `byteOffset` is not a number, it will be coerced to a number. If the result - * of coercion is `NaN` or `0`, then the entire buffer will be searched. This - * behavior matches [`String.prototype.indexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf). - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const b = Buffer.from('abcdef'); - * - * // Passing a value that's a number, but not a valid byte. - * // Prints: 2, equivalent to searching for 99 or 'c'. - * console.log(b.indexOf(99.9)); - * console.log(b.indexOf(256 + 99)); - * - * // Passing a byteOffset that coerces to NaN or 0. - * // Prints: 1, searching the whole buffer. - * console.log(b.indexOf('b', undefined)); - * console.log(b.indexOf('b', {})); - * console.log(b.indexOf('b', null)); - * console.log(b.indexOf('b', [])); - * ``` - * - * If `value` is an empty string or empty `Buffer` and `byteOffset` is less - * than `buf.length`, `byteOffset` will be returned. If `value` is empty and`byteOffset` is at least `buf.length`, `buf.length` will be returned. - * @since v1.5.0 - * @param value What to search for. - * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. - * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`. - * @return The index of the first occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`. - */ - indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; - /** - * Identical to `buf.indexOf()`, except the last occurrence of `value` is found - * rather than the first occurrence. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('this buffer is a buffer'); - * - * console.log(buf.lastIndexOf('this')); - * // Prints: 0 - * console.log(buf.lastIndexOf('buffer')); - * // Prints: 17 - * console.log(buf.lastIndexOf(Buffer.from('buffer'))); - * // Prints: 17 - * console.log(buf.lastIndexOf(97)); - * // Prints: 15 (97 is the decimal ASCII value for 'a') - * console.log(buf.lastIndexOf(Buffer.from('yolo'))); - * // Prints: -1 - * console.log(buf.lastIndexOf('buffer', 5)); - * // Prints: 5 - * console.log(buf.lastIndexOf('buffer', 4)); - * // Prints: -1 - * - * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le'); - * - * console.log(utf16Buffer.lastIndexOf('\u03a3', undefined, 'utf16le')); - * // Prints: 6 - * console.log(utf16Buffer.lastIndexOf('\u03a3', -5, 'utf16le')); - * // Prints: 4 - * ``` - * - * If `value` is not a string, number, or `Buffer`, this method will throw a `TypeError`. If `value` is a number, it will be coerced to a valid byte value, - * an integer between 0 and 255. - * - * If `byteOffset` is not a number, it will be coerced to a number. Any arguments - * that coerce to `NaN`, like `{}` or `undefined`, will search the whole buffer. - * This behavior matches [`String.prototype.lastIndexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf). - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const b = Buffer.from('abcdef'); - * - * // Passing a value that's a number, but not a valid byte. - * // Prints: 2, equivalent to searching for 99 or 'c'. - * console.log(b.lastIndexOf(99.9)); - * console.log(b.lastIndexOf(256 + 99)); - * - * // Passing a byteOffset that coerces to NaN. - * // Prints: 1, searching the whole buffer. - * console.log(b.lastIndexOf('b', undefined)); - * console.log(b.lastIndexOf('b', {})); - * - * // Passing a byteOffset that coerces to 0. - * // Prints: -1, equivalent to passing 0. - * console.log(b.lastIndexOf('b', null)); - * console.log(b.lastIndexOf('b', [])); - * ``` - * - * If `value` is an empty string or empty `Buffer`, `byteOffset` will be returned. - * @since v6.0.0 - * @param value What to search for. - * @param [byteOffset=buf.length - 1] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. - * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`. - * @return The index of the last occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`. - */ - lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; - /** - * Equivalent to `buf.indexOf() !== -1`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('this is a buffer'); - * - * console.log(buf.includes('this')); - * // Prints: true - * console.log(buf.includes('is')); - * // Prints: true - * console.log(buf.includes(Buffer.from('a buffer'))); - * // Prints: true - * console.log(buf.includes(97)); - * // Prints: true (97 is the decimal ASCII value for 'a') - * console.log(buf.includes(Buffer.from('a buffer example'))); - * // Prints: false - * console.log(buf.includes(Buffer.from('a buffer example').slice(0, 8))); - * // Prints: true - * console.log(buf.includes('this', 4)); - * // Prints: false - * ``` - * @since v5.3.0 - * @param value What to search for. - * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. - * @param [encoding='utf8'] If `value` is a string, this is its encoding. - * @return `true` if `value` was found in `buf`, `false` otherwise. - */ - includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean; - } - var Buffer: BufferConstructor; - /** - * Decodes a string of Base64-encoded data into bytes, and encodes those bytes - * into a string using Latin-1 (ISO-8859-1). - * - * The `data` may be any JavaScript-value that can be coerced into a string. - * - * **This function is only provided for compatibility with legacy web platform APIs** - * **and should never be used in new code, because they use strings to represent** - * **binary data and predate the introduction of typed arrays in JavaScript.** - * **For code running using Node.js APIs, converting between base64-encoded strings** - * **and binary data should be performed using `Buffer.from(str, 'base64')` and `buf.toString('base64')`.** - * @since v15.13.0, v14.17.0 - * @legacy Use `Buffer.from(data, 'base64')` instead. - * @param data The Base64-encoded input string. - */ - function atob(data: string): string; - /** - * Decodes a string into bytes using Latin-1 (ISO-8859), and encodes those bytes - * into a string using Base64. - * - * The `data` may be any JavaScript-value that can be coerced into a string. - * - * **This function is only provided for compatibility with legacy web platform APIs** - * **and should never be used in new code, because they use strings to represent** - * **binary data and predate the introduction of typed arrays in JavaScript.** - * **For code running using Node.js APIs, converting between base64-encoded strings** - * **and binary data should be performed using `Buffer.from(str, 'base64')` and `buf.toString('base64')`.** - * @since v15.13.0, v14.17.0 - * @legacy Use `buf.toString('base64')` instead. - * @param data An ASCII (Latin1) string. - */ - function btoa(data: string): string; - interface Blob extends _Blob {} - /** - * `Blob` class is a global reference for `import { Blob } from 'node:buffer'` - * https://nodejs.org/api/buffer.html#class-blob - * @since v18.0.0 - */ - var Blob: typeof globalThis extends { onmessage: any; Blob: infer T } ? T - : typeof import("buffer").Blob; - interface File extends _File {} - /** - * `File` class is a global reference for `import { File } from 'node:buffer'` - * https://nodejs.org/api/buffer.html#class-file - * @since v20.0.0 - */ - var File: typeof globalThis extends { onmessage: any; File: infer T } ? T - : typeof import("buffer").File; - } -} -declare module "node:buffer" { - export * from "buffer"; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/child_process.d.ts b/tools/mnemonic-test/node_modules/@types/node/child_process.d.ts deleted file mode 100644 index 09f181f9..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/child_process.d.ts +++ /dev/null @@ -1,1549 +0,0 @@ -/** - * The `node:child_process` module provides the ability to spawn subprocesses in - * a manner that is similar, but not identical, to [`popen(3)`](http://man7.org/linux/man-pages/man3/popen.3.html). This capability - * is primarily provided by the {@link spawn} function: - * - * ```js - * import { spawn } from 'node:child_process'; - * const ls = spawn('ls', ['-lh', '/usr']); - * - * ls.stdout.on('data', (data) => { - * console.log(`stdout: ${data}`); - * }); - * - * ls.stderr.on('data', (data) => { - * console.error(`stderr: ${data}`); - * }); - * - * ls.on('close', (code) => { - * console.log(`child process exited with code ${code}`); - * }); - * ``` - * - * By default, pipes for `stdin`, `stdout`, and `stderr` are established between - * the parent Node.js process and the spawned subprocess. These pipes have - * limited (and platform-specific) capacity. If the subprocess writes to - * stdout in excess of that limit without the output being captured, the - * subprocess blocks waiting for the pipe buffer to accept more data. This is - * identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }` option if the output will not be consumed. - * - * The command lookup is performed using the `options.env.PATH` environment - * variable if `env` is in the `options` object. Otherwise, `process.env.PATH` is - * used. If `options.env` is set without `PATH`, lookup on Unix is performed - * on a default search path search of `/usr/bin:/bin` (see your operating system's - * manual for execvpe/execvp), on Windows the current processes environment - * variable `PATH` is used. - * - * On Windows, environment variables are case-insensitive. Node.js - * lexicographically sorts the `env` keys and uses the first one that - * case-insensitively matches. Only first (in lexicographic order) entry will be - * passed to the subprocess. This might lead to issues on Windows when passing - * objects to the `env` option that have multiple variants of the same key, such as `PATH` and `Path`. - * - * The {@link spawn} method spawns the child process asynchronously, - * without blocking the Node.js event loop. The {@link spawnSync} function provides equivalent functionality in a synchronous manner that blocks - * the event loop until the spawned process either exits or is terminated. - * - * For convenience, the `node:child_process` module provides a handful of - * synchronous and asynchronous alternatives to {@link spawn} and {@link spawnSync}. Each of these alternatives are implemented on - * top of {@link spawn} or {@link spawnSync}. - * - * * {@link exec}: spawns a shell and runs a command within that - * shell, passing the `stdout` and `stderr` to a callback function when - * complete. - * * {@link execFile}: similar to {@link exec} except - * that it spawns the command directly without first spawning a shell by - * default. - * * {@link fork}: spawns a new Node.js process and invokes a - * specified module with an IPC communication channel established that allows - * sending messages between parent and child. - * * {@link execSync}: a synchronous version of {@link exec} that will block the Node.js event loop. - * * {@link execFileSync}: a synchronous version of {@link execFile} that will block the Node.js event loop. - * - * For certain use cases, such as automating shell scripts, the `synchronous counterparts` may be more convenient. In many cases, however, - * the synchronous methods can have significant impact on performance due to - * stalling the event loop while spawned processes complete. - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/child_process.js) - */ -declare module "child_process" { - import { ObjectEncodingOptions } from "node:fs"; - import { Abortable, EventEmitter } from "node:events"; - import * as dgram from "node:dgram"; - import * as net from "node:net"; - import { Pipe, Readable, Stream, Writable } from "node:stream"; - import { URL } from "node:url"; - type Serializable = string | object | number | boolean | bigint; - type SendHandle = net.Socket | net.Server | dgram.Socket | undefined; - /** - * Instances of the `ChildProcess` represent spawned child processes. - * - * Instances of `ChildProcess` are not intended to be created directly. Rather, - * use the {@link spawn}, {@link exec},{@link execFile}, or {@link fork} methods to create - * instances of `ChildProcess`. - * @since v2.2.0 - */ - class ChildProcess extends EventEmitter { - /** - * A `Writable Stream` that represents the child process's `stdin`. - * - * If a child process waits to read all of its input, the child will not continue - * until this stream has been closed via `end()`. - * - * If the child was spawned with `stdio[0]` set to anything other than `'pipe'`, - * then this will be `null`. - * - * `subprocess.stdin` is an alias for `subprocess.stdio[0]`. Both properties will - * refer to the same value. - * - * The `subprocess.stdin` property can be `null` or `undefined` if the child process could not be successfully spawned. - * @since v0.1.90 - */ - stdin: Writable | null; - /** - * A `Readable Stream` that represents the child process's `stdout`. - * - * If the child was spawned with `stdio[1]` set to anything other than `'pipe'`, - * then this will be `null`. - * - * `subprocess.stdout` is an alias for `subprocess.stdio[1]`. Both properties will - * refer to the same value. - * - * ```js - * import { spawn } from 'node:child_process'; - * - * const subprocess = spawn('ls'); - * - * subprocess.stdout.on('data', (data) => { - * console.log(`Received chunk ${data}`); - * }); - * ``` - * - * The `subprocess.stdout` property can be `null` or `undefined` if the child process could not be successfully spawned. - * @since v0.1.90 - */ - stdout: Readable | null; - /** - * A `Readable Stream` that represents the child process's `stderr`. - * - * If the child was spawned with `stdio[2]` set to anything other than `'pipe'`, - * then this will be `null`. - * - * `subprocess.stderr` is an alias for `subprocess.stdio[2]`. Both properties will - * refer to the same value. - * - * The `subprocess.stderr` property can be `null` or `undefined` if the child process could not be successfully spawned. - * @since v0.1.90 - */ - stderr: Readable | null; - /** - * The `subprocess.channel` property is a reference to the child's IPC channel. If - * no IPC channel exists, this property is `undefined`. - * @since v7.1.0 - */ - readonly channel?: Pipe | null | undefined; - /** - * A sparse array of pipes to the child process, corresponding with positions in - * the `stdio` option passed to {@link spawn} that have been set - * to the value `'pipe'`. `subprocess.stdio[0]`, `subprocess.stdio[1]`, and `subprocess.stdio[2]` are also available as `subprocess.stdin`, `subprocess.stdout`, and `subprocess.stderr`, - * respectively. - * - * In the following example, only the child's fd `1` (stdout) is configured as a - * pipe, so only the parent's `subprocess.stdio[1]` is a stream, all other values - * in the array are `null`. - * - * ```js - * import assert from 'node:assert'; - * import fs from 'node:fs'; - * import child_process from 'node:child_process'; - * - * const subprocess = child_process.spawn('ls', { - * stdio: [ - * 0, // Use parent's stdin for child. - * 'pipe', // Pipe child's stdout to parent. - * fs.openSync('err.out', 'w'), // Direct child's stderr to a file. - * ], - * }); - * - * assert.strictEqual(subprocess.stdio[0], null); - * assert.strictEqual(subprocess.stdio[0], subprocess.stdin); - * - * assert(subprocess.stdout); - * assert.strictEqual(subprocess.stdio[1], subprocess.stdout); - * - * assert.strictEqual(subprocess.stdio[2], null); - * assert.strictEqual(subprocess.stdio[2], subprocess.stderr); - * ``` - * - * The `subprocess.stdio` property can be `undefined` if the child process could - * not be successfully spawned. - * @since v0.7.10 - */ - readonly stdio: [ - Writable | null, - // stdin - Readable | null, - // stdout - Readable | null, - // stderr - Readable | Writable | null | undefined, - // extra - Readable | Writable | null | undefined, // extra - ]; - /** - * The `subprocess.killed` property indicates whether the child process - * successfully received a signal from `subprocess.kill()`. The `killed` property - * does not indicate that the child process has been terminated. - * @since v0.5.10 - */ - readonly killed: boolean; - /** - * Returns the process identifier (PID) of the child process. If the child process - * fails to spawn due to errors, then the value is `undefined` and `error` is - * emitted. - * - * ```js - * import { spawn } from 'node:child_process'; - * const grep = spawn('grep', ['ssh']); - * - * console.log(`Spawned child pid: ${grep.pid}`); - * grep.stdin.end(); - * ``` - * @since v0.1.90 - */ - readonly pid?: number | undefined; - /** - * The `subprocess.connected` property indicates whether it is still possible to - * send and receive messages from a child process. When `subprocess.connected` is `false`, it is no longer possible to send or receive messages. - * @since v0.7.2 - */ - readonly connected: boolean; - /** - * The `subprocess.exitCode` property indicates the exit code of the child process. - * If the child process is still running, the field will be `null`. - */ - readonly exitCode: number | null; - /** - * The `subprocess.signalCode` property indicates the signal received by - * the child process if any, else `null`. - */ - readonly signalCode: NodeJS.Signals | null; - /** - * The `subprocess.spawnargs` property represents the full list of command-line - * arguments the child process was launched with. - */ - readonly spawnargs: string[]; - /** - * The `subprocess.spawnfile` property indicates the executable file name of - * the child process that is launched. - * - * For {@link fork}, its value will be equal to `process.execPath`. - * For {@link spawn}, its value will be the name of - * the executable file. - * For {@link exec}, its value will be the name of the shell - * in which the child process is launched. - */ - readonly spawnfile: string; - /** - * The `subprocess.kill()` method sends a signal to the child process. If no - * argument is given, the process will be sent the `'SIGTERM'` signal. See [`signal(7)`](http://man7.org/linux/man-pages/man7/signal.7.html) for a list of available signals. This function - * returns `true` if [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) succeeds, and `false` otherwise. - * - * ```js - * import { spawn } from 'node:child_process'; - * const grep = spawn('grep', ['ssh']); - * - * grep.on('close', (code, signal) => { - * console.log( - * `child process terminated due to receipt of signal ${signal}`); - * }); - * - * // Send SIGHUP to process. - * grep.kill('SIGHUP'); - * ``` - * - * The `ChildProcess` object may emit an `'error'` event if the signal - * cannot be delivered. Sending a signal to a child process that has already exited - * is not an error but may have unforeseen consequences. Specifically, if the - * process identifier (PID) has been reassigned to another process, the signal will - * be delivered to that process instead which can have unexpected results. - * - * While the function is called `kill`, the signal delivered to the child process - * may not actually terminate the process. - * - * See [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for reference. - * - * On Windows, where POSIX signals do not exist, the `signal` argument will be - * ignored, and the process will be killed forcefully and abruptly (similar to `'SIGKILL'`). - * See `Signal Events` for more details. - * - * On Linux, child processes of child processes will not be terminated - * when attempting to kill their parent. This is likely to happen when running a - * new process in a shell or with the use of the `shell` option of `ChildProcess`: - * - * ```js - * 'use strict'; - * import { spawn } from 'node:child_process'; - * - * const subprocess = spawn( - * 'sh', - * [ - * '-c', - * `node -e "setInterval(() => { - * console.log(process.pid, 'is alive') - * }, 500);"`, - * ], { - * stdio: ['inherit', 'inherit', 'inherit'], - * }, - * ); - * - * setTimeout(() => { - * subprocess.kill(); // Does not terminate the Node.js process in the shell. - * }, 2000); - * ``` - * @since v0.1.90 - */ - kill(signal?: NodeJS.Signals | number): boolean; - /** - * Calls {@link ChildProcess.kill} with `'SIGTERM'`. - * @since v20.5.0 - */ - [Symbol.dispose](): void; - /** - * When an IPC channel has been established between the parent and child ( - * i.e. when using {@link fork}), the `subprocess.send()` method can - * be used to send messages to the child process. When the child process is a - * Node.js instance, these messages can be received via the `'message'` event. - * - * The message goes through serialization and parsing. The resulting - * message might not be the same as what is originally sent. - * - * For example, in the parent script: - * - * ```js - * import cp from 'node:child_process'; - * const n = cp.fork(`${__dirname}/sub.js`); - * - * n.on('message', (m) => { - * console.log('PARENT got message:', m); - * }); - * - * // Causes the child to print: CHILD got message: { hello: 'world' } - * n.send({ hello: 'world' }); - * ``` - * - * And then the child script, `'sub.js'` might look like this: - * - * ```js - * process.on('message', (m) => { - * console.log('CHILD got message:', m); - * }); - * - * // Causes the parent to print: PARENT got message: { foo: 'bar', baz: null } - * process.send({ foo: 'bar', baz: NaN }); - * ``` - * - * Child Node.js processes will have a `process.send()` method of their own - * that allows the child to send messages back to the parent. - * - * There is a special case when sending a `{cmd: 'NODE_foo'}` message. Messages - * containing a `NODE_` prefix in the `cmd` property are reserved for use within - * Node.js core and will not be emitted in the child's `'message'` event. Rather, such messages are emitted using the `'internalMessage'` event and are consumed internally by Node.js. - * Applications should avoid using such messages or listening for `'internalMessage'` events as it is subject to change without notice. - * - * The optional `sendHandle` argument that may be passed to `subprocess.send()` is - * for passing a TCP server or socket object to the child process. The child will - * receive the object as the second argument passed to the callback function - * registered on the `'message'` event. Any data that is received and buffered in - * the socket will not be sent to the child. Sending IPC sockets is not supported on Windows. - * - * The optional `callback` is a function that is invoked after the message is - * sent but before the child may have received it. The function is called with a - * single argument: `null` on success, or an `Error` object on failure. - * - * If no `callback` function is provided and the message cannot be sent, an `'error'` event will be emitted by the `ChildProcess` object. This can - * happen, for instance, when the child process has already exited. - * - * `subprocess.send()` will return `false` if the channel has closed or when the - * backlog of unsent messages exceeds a threshold that makes it unwise to send - * more. Otherwise, the method returns `true`. The `callback` function can be - * used to implement flow control. - * - * #### Example: sending a server object - * - * The `sendHandle` argument can be used, for instance, to pass the handle of - * a TCP server object to the child process as illustrated in the example below: - * - * ```js - * import { createServer } from 'node:net'; - * import { fork } from 'node:child_process'; - * const subprocess = fork('subprocess.js'); - * - * // Open up the server object and send the handle. - * const server = createServer(); - * server.on('connection', (socket) => { - * socket.end('handled by parent'); - * }); - * server.listen(1337, () => { - * subprocess.send('server', server); - * }); - * ``` - * - * The child would then receive the server object as: - * - * ```js - * process.on('message', (m, server) => { - * if (m === 'server') { - * server.on('connection', (socket) => { - * socket.end('handled by child'); - * }); - * } - * }); - * ``` - * - * Once the server is now shared between the parent and child, some connections - * can be handled by the parent and some by the child. - * - * While the example above uses a server created using the `node:net` module, `node:dgram` module servers use exactly the same workflow with the exceptions of - * listening on a `'message'` event instead of `'connection'` and using `server.bind()` instead of `server.listen()`. This is, however, only - * supported on Unix platforms. - * - * #### Example: sending a socket object - * - * Similarly, the `sendHandler` argument can be used to pass the handle of a - * socket to the child process. The example below spawns two children that each - * handle connections with "normal" or "special" priority: - * - * ```js - * import { createServer } from 'node:net'; - * import { fork } from 'node:child_process'; - * const normal = fork('subprocess.js', ['normal']); - * const special = fork('subprocess.js', ['special']); - * - * // Open up the server and send sockets to child. Use pauseOnConnect to prevent - * // the sockets from being read before they are sent to the child process. - * const server = createServer({ pauseOnConnect: true }); - * server.on('connection', (socket) => { - * - * // If this is special priority... - * if (socket.remoteAddress === '74.125.127.100') { - * special.send('socket', socket); - * return; - * } - * // This is normal priority. - * normal.send('socket', socket); - * }); - * server.listen(1337); - * ``` - * - * The `subprocess.js` would receive the socket handle as the second argument - * passed to the event callback function: - * - * ```js - * process.on('message', (m, socket) => { - * if (m === 'socket') { - * if (socket) { - * // Check that the client socket exists. - * // It is possible for the socket to be closed between the time it is - * // sent and the time it is received in the child process. - * socket.end(`Request handled with ${process.argv[2]} priority`); - * } - * } - * }); - * ``` - * - * Do not use `.maxConnections` on a socket that has been passed to a subprocess. - * The parent cannot track when the socket is destroyed. - * - * Any `'message'` handlers in the subprocess should verify that `socket` exists, - * as the connection may have been closed during the time it takes to send the - * connection to the child. - * @since v0.5.9 - * @param sendHandle `undefined`, or a [`net.Socket`](https://nodejs.org/docs/latest-v22.x/api/net.html#class-netsocket), [`net.Server`](https://nodejs.org/docs/latest-v22.x/api/net.html#class-netserver), or [`dgram.Socket`](https://nodejs.org/docs/latest-v22.x/api/dgram.html#class-dgramsocket) object. - * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties: - */ - send(message: Serializable, callback?: (error: Error | null) => void): boolean; - send(message: Serializable, sendHandle?: SendHandle, callback?: (error: Error | null) => void): boolean; - send( - message: Serializable, - sendHandle?: SendHandle, - options?: MessageOptions, - callback?: (error: Error | null) => void, - ): boolean; - /** - * Closes the IPC channel between parent and child, allowing the child to exit - * gracefully once there are no other connections keeping it alive. After calling - * this method the `subprocess.connected` and `process.connected` properties in - * both the parent and child (respectively) will be set to `false`, and it will be - * no longer possible to pass messages between the processes. - * - * The `'disconnect'` event will be emitted when there are no messages in the - * process of being received. This will most often be triggered immediately after - * calling `subprocess.disconnect()`. - * - * When the child process is a Node.js instance (e.g. spawned using {@link fork}), the `process.disconnect()` method can be invoked - * within the child process to close the IPC channel as well. - * @since v0.7.2 - */ - disconnect(): void; - /** - * By default, the parent will wait for the detached child to exit. To prevent the - * parent from waiting for a given `subprocess` to exit, use the `subprocess.unref()` method. Doing so will cause the parent's event loop to not - * include the child in its reference count, allowing the parent to exit - * independently of the child, unless there is an established IPC channel between - * the child and the parent. - * - * ```js - * import { spawn } from 'node:child_process'; - * - * const subprocess = spawn(process.argv[0], ['child_program.js'], { - * detached: true, - * stdio: 'ignore', - * }); - * - * subprocess.unref(); - * ``` - * @since v0.7.10 - */ - unref(): void; - /** - * Calling `subprocess.ref()` after making a call to `subprocess.unref()` will - * restore the removed reference count for the child process, forcing the parent - * to wait for the child to exit before exiting itself. - * - * ```js - * import { spawn } from 'node:child_process'; - * - * const subprocess = spawn(process.argv[0], ['child_program.js'], { - * detached: true, - * stdio: 'ignore', - * }); - * - * subprocess.unref(); - * subprocess.ref(); - * ``` - * @since v0.7.10 - */ - ref(): void; - /** - * events.EventEmitter - * 1. close - * 2. disconnect - * 3. error - * 4. exit - * 5. message - * 6. spawn - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - addListener(event: "disconnect", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - addListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; - addListener(event: "spawn", listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close", code: number | null, signal: NodeJS.Signals | null): boolean; - emit(event: "disconnect"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "exit", code: number | null, signal: NodeJS.Signals | null): boolean; - emit(event: "message", message: Serializable, sendHandle: SendHandle): boolean; - emit(event: "spawn", listener: () => void): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - on(event: "disconnect", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - on(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; - on(event: "spawn", listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - once(event: "disconnect", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - once(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; - once(event: "spawn", listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - prependListener(event: "disconnect", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - prependListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; - prependListener(event: "spawn", listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener( - event: "close", - listener: (code: number | null, signal: NodeJS.Signals | null) => void, - ): this; - prependOnceListener(event: "disconnect", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener( - event: "exit", - listener: (code: number | null, signal: NodeJS.Signals | null) => void, - ): this; - prependOnceListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; - prependOnceListener(event: "spawn", listener: () => void): this; - } - // return this object when stdio option is undefined or not specified - interface ChildProcessWithoutNullStreams extends ChildProcess { - stdin: Writable; - stdout: Readable; - stderr: Readable; - readonly stdio: [ - Writable, - Readable, - Readable, - // stderr - Readable | Writable | null | undefined, - // extra, no modification - Readable | Writable | null | undefined, // extra, no modification - ]; - } - // return this object when stdio option is a tuple of 3 - interface ChildProcessByStdio - extends ChildProcess - { - stdin: I; - stdout: O; - stderr: E; - readonly stdio: [ - I, - O, - E, - Readable | Writable | null | undefined, - // extra, no modification - Readable | Writable | null | undefined, // extra, no modification - ]; - } - interface MessageOptions { - keepOpen?: boolean | undefined; - } - type IOType = "overlapped" | "pipe" | "ignore" | "inherit"; - type StdioOptions = IOType | Array; - type SerializationType = "json" | "advanced"; - interface MessagingOptions extends Abortable { - /** - * Specify the kind of serialization used for sending messages between processes. - * @default 'json' - */ - serialization?: SerializationType | undefined; - /** - * The signal value to be used when the spawned process will be killed by the abort signal. - * @default 'SIGTERM' - */ - killSignal?: NodeJS.Signals | number | undefined; - /** - * In milliseconds the maximum amount of time the process is allowed to run. - */ - timeout?: number | undefined; - } - interface ProcessEnvOptions { - uid?: number | undefined; - gid?: number | undefined; - cwd?: string | URL | undefined; - env?: NodeJS.ProcessEnv | undefined; - } - interface CommonOptions extends ProcessEnvOptions { - /** - * @default false - */ - windowsHide?: boolean | undefined; - /** - * @default 0 - */ - timeout?: number | undefined; - } - interface CommonSpawnOptions extends CommonOptions, MessagingOptions, Abortable { - argv0?: string | undefined; - /** - * Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings. - * If passed as an array, the first element is used for `stdin`, the second for - * `stdout`, and the third for `stderr`. A fourth element can be used to - * specify the `stdio` behavior beyond the standard streams. See - * {@link ChildProcess.stdio} for more information. - * - * @default 'pipe' - */ - stdio?: StdioOptions | undefined; - shell?: boolean | string | undefined; - windowsVerbatimArguments?: boolean | undefined; - } - interface SpawnOptions extends CommonSpawnOptions { - detached?: boolean | undefined; - } - interface SpawnOptionsWithoutStdio extends SpawnOptions { - stdio?: StdioPipeNamed | StdioPipe[] | undefined; - } - type StdioNull = "inherit" | "ignore" | Stream; - type StdioPipeNamed = "pipe" | "overlapped"; - type StdioPipe = undefined | null | StdioPipeNamed; - interface SpawnOptionsWithStdioTuple< - Stdin extends StdioNull | StdioPipe, - Stdout extends StdioNull | StdioPipe, - Stderr extends StdioNull | StdioPipe, - > extends SpawnOptions { - stdio: [Stdin, Stdout, Stderr]; - } - /** - * The `child_process.spawn()` method spawns a new process using the given `command`, with command-line arguments in `args`. If omitted, `args` defaults - * to an empty array. - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * - * A third argument may be used to specify additional options, with these defaults: - * - * ```js - * const defaults = { - * cwd: undefined, - * env: process.env, - * }; - * ``` - * - * Use `cwd` to specify the working directory from which the process is spawned. - * If not given, the default is to inherit the current working directory. If given, - * but the path does not exist, the child process emits an `ENOENT` error - * and exits immediately. `ENOENT` is also emitted when the command - * does not exist. - * - * Use `env` to specify environment variables that will be visible to the new - * process, the default is `process.env`. - * - * `undefined` values in `env` will be ignored. - * - * Example of running `ls -lh /usr`, capturing `stdout`, `stderr`, and the - * exit code: - * - * ```js - * import { spawn } from 'node:child_process'; - * const ls = spawn('ls', ['-lh', '/usr']); - * - * ls.stdout.on('data', (data) => { - * console.log(`stdout: ${data}`); - * }); - * - * ls.stderr.on('data', (data) => { - * console.error(`stderr: ${data}`); - * }); - * - * ls.on('close', (code) => { - * console.log(`child process exited with code ${code}`); - * }); - * ``` - * - * Example: A very elaborate way to run `ps ax | grep ssh` - * - * ```js - * import { spawn } from 'node:child_process'; - * const ps = spawn('ps', ['ax']); - * const grep = spawn('grep', ['ssh']); - * - * ps.stdout.on('data', (data) => { - * grep.stdin.write(data); - * }); - * - * ps.stderr.on('data', (data) => { - * console.error(`ps stderr: ${data}`); - * }); - * - * ps.on('close', (code) => { - * if (code !== 0) { - * console.log(`ps process exited with code ${code}`); - * } - * grep.stdin.end(); - * }); - * - * grep.stdout.on('data', (data) => { - * console.log(data.toString()); - * }); - * - * grep.stderr.on('data', (data) => { - * console.error(`grep stderr: ${data}`); - * }); - * - * grep.on('close', (code) => { - * if (code !== 0) { - * console.log(`grep process exited with code ${code}`); - * } - * }); - * ``` - * - * Example of checking for failed `spawn`: - * - * ```js - * import { spawn } from 'node:child_process'; - * const subprocess = spawn('bad_command'); - * - * subprocess.on('error', (err) => { - * console.error('Failed to start subprocess.'); - * }); - * ``` - * - * Certain platforms (macOS, Linux) will use the value of `argv[0]` for the process - * title while others (Windows, SunOS) will use `command`. - * - * Node.js overwrites `argv[0]` with `process.execPath` on startup, so `process.argv[0]` in a Node.js child process will not match the `argv0` parameter passed to `spawn` from the parent. Retrieve - * it with the `process.argv0` property instead. - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding `AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * import { spawn } from 'node:child_process'; - * const controller = new AbortController(); - * const { signal } = controller; - * const grep = spawn('grep', ['ssh'], { signal }); - * grep.on('error', (err) => { - * // This will be called with err being an AbortError if the controller aborts - * }); - * controller.abort(); // Stops the child process - * ``` - * @since v0.1.90 - * @param command The command to run. - * @param args List of string arguments. - */ - function spawn(command: string, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptions): ChildProcess; - // overloads of spawn with 'args' - function spawn( - command: string, - args?: readonly string[], - options?: SpawnOptionsWithoutStdio, - ): ChildProcessWithoutNullStreams; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn(command: string, args: readonly string[], options: SpawnOptions): ChildProcess; - interface ExecOptions extends CommonOptions { - shell?: string | undefined; - signal?: AbortSignal | undefined; - maxBuffer?: number | undefined; - killSignal?: NodeJS.Signals | number | undefined; - } - interface ExecOptionsWithStringEncoding extends ExecOptions { - encoding: BufferEncoding; - } - interface ExecOptionsWithBufferEncoding extends ExecOptions { - encoding: BufferEncoding | null; // specify `null`. - } - interface ExecException extends Error { - cmd?: string | undefined; - killed?: boolean | undefined; - code?: number | undefined; - signal?: NodeJS.Signals | undefined; - stdout?: string; - stderr?: string; - } - /** - * Spawns a shell then executes the `command` within that shell, buffering any - * generated output. The `command` string passed to the exec function is processed - * directly by the shell and special characters (vary based on [shell](https://en.wikipedia.org/wiki/List_of_command-line_interpreters)) - * need to be dealt with accordingly: - * - * ```js - * import { exec } from 'node:child_process'; - * - * exec('"/path/to/test file/test.sh" arg1 arg2'); - * // Double quotes are used so that the space in the path is not interpreted as - * // a delimiter of multiple arguments. - * - * exec('echo "The \\$HOME variable is $HOME"'); - * // The $HOME variable is escaped in the first instance, but not in the second. - * ``` - * - * **Never pass unsanitized user input to this function. Any input containing shell** - * **metacharacters may be used to trigger arbitrary command execution.** - * - * If a `callback` function is provided, it is called with the arguments `(error, stdout, stderr)`. On success, `error` will be `null`. On error, `error` will be an instance of `Error`. The - * `error.code` property will be - * the exit code of the process. By convention, any exit code other than `0` indicates an error. `error.signal` will be the signal that terminated the - * process. - * - * The `stdout` and `stderr` arguments passed to the callback will contain the - * stdout and stderr output of the child process. By default, Node.js will decode - * the output as UTF-8 and pass strings to the callback. The `encoding` option - * can be used to specify the character encoding used to decode the stdout and - * stderr output. If `encoding` is `'buffer'`, or an unrecognized character - * encoding, `Buffer` objects will be passed to the callback instead. - * - * ```js - * import { exec } from 'node:child_process'; - * exec('cat *.js missing_file | wc -l', (error, stdout, stderr) => { - * if (error) { - * console.error(`exec error: ${error}`); - * return; - * } - * console.log(`stdout: ${stdout}`); - * console.error(`stderr: ${stderr}`); - * }); - * ``` - * - * If `timeout` is greater than `0`, the parent will send the signal - * identified by the `killSignal` property (the default is `'SIGTERM'`) if the - * child runs longer than `timeout` milliseconds. - * - * Unlike the [`exec(3)`](http://man7.org/linux/man-pages/man3/exec.3.html) POSIX system call, `child_process.exec()` does not replace - * the existing process and uses a shell to execute the command. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned `ChildProcess` instance is attached to the `Promise` as a `child` property. In - * case of an error (including any error resulting in an exit code other than 0), a - * rejected promise is returned, with the same `error` object given in the - * callback, but with two additional properties `stdout` and `stderr`. - * - * ```js - * import util from 'node:util'; - * import child_process from 'node:child_process'; - * const exec = util.promisify(child_process.exec); - * - * async function lsExample() { - * const { stdout, stderr } = await exec('ls'); - * console.log('stdout:', stdout); - * console.error('stderr:', stderr); - * } - * lsExample(); - * ``` - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding `AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * import { exec } from 'node:child_process'; - * const controller = new AbortController(); - * const { signal } = controller; - * const child = exec('grep ssh', { signal }, (error) => { - * console.error(error); // an AbortError - * }); - * controller.abort(); - * ``` - * @since v0.1.90 - * @param command The command to run, with space-separated arguments. - * @param callback called with the output when process terminates. - */ - function exec( - command: string, - callback?: (error: ExecException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. - function exec( - command: string, - options: { - encoding: "buffer" | null; - } & ExecOptions, - callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void, - ): ChildProcess; - // `options` with well known `encoding` means stdout/stderr are definitely `string`. - function exec( - command: string, - options: { - encoding: BufferEncoding; - } & ExecOptions, - callback?: (error: ExecException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`. - // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`. - function exec( - command: string, - options: { - encoding: BufferEncoding; - } & ExecOptions, - callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void, - ): ChildProcess; - // `options` without an `encoding` means stdout/stderr are definitely `string`. - function exec( - command: string, - options: ExecOptions, - callback?: (error: ExecException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - // fallback if nothing else matches. Worst case is always `string | Buffer`. - function exec( - command: string, - options: (ObjectEncodingOptions & ExecOptions) | undefined | null, - callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void, - ): ChildProcess; - interface PromiseWithChild extends Promise { - child: ChildProcess; - } - namespace exec { - function __promisify__(command: string): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - command: string, - options: { - encoding: "buffer" | null; - } & ExecOptions, - ): PromiseWithChild<{ - stdout: Buffer; - stderr: Buffer; - }>; - function __promisify__( - command: string, - options: { - encoding: BufferEncoding; - } & ExecOptions, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - command: string, - options: ExecOptions, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - command: string, - options?: (ObjectEncodingOptions & ExecOptions) | null, - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - } - interface ExecFileOptions extends CommonOptions, Abortable { - maxBuffer?: number | undefined; - killSignal?: NodeJS.Signals | number | undefined; - windowsVerbatimArguments?: boolean | undefined; - shell?: boolean | string | undefined; - signal?: AbortSignal | undefined; - } - interface ExecFileOptionsWithStringEncoding extends ExecFileOptions { - encoding: BufferEncoding; - } - interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions { - encoding: "buffer" | null; - } - interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions { - encoding: BufferEncoding; - } - type ExecFileException = - & Omit - & Omit - & { code?: string | number | undefined | null }; - /** - * The `child_process.execFile()` function is similar to {@link exec} except that it does not spawn a shell by default. Rather, the specified - * executable `file` is spawned directly as a new process making it slightly more - * efficient than {@link exec}. - * - * The same options as {@link exec} are supported. Since a shell is - * not spawned, behaviors such as I/O redirection and file globbing are not - * supported. - * - * ```js - * import { execFile } from 'node:child_process'; - * const child = execFile('node', ['--version'], (error, stdout, stderr) => { - * if (error) { - * throw error; - * } - * console.log(stdout); - * }); - * ``` - * - * The `stdout` and `stderr` arguments passed to the callback will contain the - * stdout and stderr output of the child process. By default, Node.js will decode - * the output as UTF-8 and pass strings to the callback. The `encoding` option - * can be used to specify the character encoding used to decode the stdout and - * stderr output. If `encoding` is `'buffer'`, or an unrecognized character - * encoding, `Buffer` objects will be passed to the callback instead. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned `ChildProcess` instance is attached to the `Promise` as a `child` property. In - * case of an error (including any error resulting in an exit code other than 0), a - * rejected promise is returned, with the same `error` object given in the - * callback, but with two additional properties `stdout` and `stderr`. - * - * ```js - * import util from 'node:util'; - * import child_process from 'node:child_process'; - * const execFile = util.promisify(child_process.execFile); - * async function getVersion() { - * const { stdout } = await execFile('node', ['--version']); - * console.log(stdout); - * } - * getVersion(); - * ``` - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding `AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * import { execFile } from 'node:child_process'; - * const controller = new AbortController(); - * const { signal } = controller; - * const child = execFile('node', ['--version'], { signal }, (error) => { - * console.error(error); // an AbortError - * }); - * controller.abort(); - * ``` - * @since v0.1.91 - * @param file The name or path of the executable file to run. - * @param args List of string arguments. - * @param callback Called with the output when process terminates. - */ - function execFile(file: string): ChildProcess; - function execFile( - file: string, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, - ): ChildProcess; - function execFile(file: string, args?: readonly string[] | null): ChildProcess; - function execFile( - file: string, - args: readonly string[] | undefined | null, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, - ): ChildProcess; - // no `options` definitely means stdout/stderr are `string`. - function execFile( - file: string, - callback: (error: ExecFileException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - function execFile( - file: string, - args: readonly string[] | undefined | null, - callback: (error: ExecFileException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. - function execFile( - file: string, - options: ExecFileOptionsWithBufferEncoding, - callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void, - ): ChildProcess; - function execFile( - file: string, - args: readonly string[] | undefined | null, - options: ExecFileOptionsWithBufferEncoding, - callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void, - ): ChildProcess; - // `options` with well known `encoding` means stdout/stderr are definitely `string`. - function execFile( - file: string, - options: ExecFileOptionsWithStringEncoding, - callback: (error: ExecFileException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - function execFile( - file: string, - args: readonly string[] | undefined | null, - options: ExecFileOptionsWithStringEncoding, - callback: (error: ExecFileException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`. - // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`. - function execFile( - file: string, - options: ExecFileOptionsWithOtherEncoding, - callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void, - ): ChildProcess; - function execFile( - file: string, - args: readonly string[] | undefined | null, - options: ExecFileOptionsWithOtherEncoding, - callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void, - ): ChildProcess; - // `options` without an `encoding` means stdout/stderr are definitely `string`. - function execFile( - file: string, - options: ExecFileOptions, - callback: (error: ExecFileException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - function execFile( - file: string, - args: readonly string[] | undefined | null, - options: ExecFileOptions, - callback: (error: ExecFileException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - // fallback if nothing else matches. Worst case is always `string | Buffer`. - function execFile( - file: string, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, - callback: - | ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) - | undefined - | null, - ): ChildProcess; - function execFile( - file: string, - args: readonly string[] | undefined | null, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, - callback: - | ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) - | undefined - | null, - ): ChildProcess; - namespace execFile { - function __promisify__(file: string): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - args: readonly string[] | undefined | null, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - options: ExecFileOptionsWithBufferEncoding, - ): PromiseWithChild<{ - stdout: Buffer; - stderr: Buffer; - }>; - function __promisify__( - file: string, - args: readonly string[] | undefined | null, - options: ExecFileOptionsWithBufferEncoding, - ): PromiseWithChild<{ - stdout: Buffer; - stderr: Buffer; - }>; - function __promisify__( - file: string, - options: ExecFileOptionsWithStringEncoding, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - args: readonly string[] | undefined | null, - options: ExecFileOptionsWithStringEncoding, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - options: ExecFileOptionsWithOtherEncoding, - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - function __promisify__( - file: string, - args: readonly string[] | undefined | null, - options: ExecFileOptionsWithOtherEncoding, - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - function __promisify__( - file: string, - options: ExecFileOptions, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - args: readonly string[] | undefined | null, - options: ExecFileOptions, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - function __promisify__( - file: string, - args: readonly string[] | undefined | null, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - } - interface ForkOptions extends ProcessEnvOptions, MessagingOptions, Abortable { - execPath?: string | undefined; - execArgv?: string[] | undefined; - silent?: boolean | undefined; - /** - * Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings. - * If passed as an array, the first element is used for `stdin`, the second for - * `stdout`, and the third for `stderr`. A fourth element can be used to - * specify the `stdio` behavior beyond the standard streams. See - * {@link ChildProcess.stdio} for more information. - * - * @default 'pipe' - */ - stdio?: StdioOptions | undefined; - detached?: boolean | undefined; - windowsVerbatimArguments?: boolean | undefined; - } - /** - * The `child_process.fork()` method is a special case of {@link spawn} used specifically to spawn new Node.js processes. - * Like {@link spawn}, a `ChildProcess` object is returned. The - * returned `ChildProcess` will have an additional communication channel - * built-in that allows messages to be passed back and forth between the parent and - * child. See `subprocess.send()` for details. - * - * Keep in mind that spawned Node.js child processes are - * independent of the parent with exception of the IPC communication channel - * that is established between the two. Each process has its own memory, with - * their own V8 instances. Because of the additional resource allocations - * required, spawning a large number of child Node.js processes is not - * recommended. - * - * By default, `child_process.fork()` will spawn new Node.js instances using the `process.execPath` of the parent process. The `execPath` property in the `options` object allows for an alternative - * execution path to be used. - * - * Node.js processes launched with a custom `execPath` will communicate with the - * parent process using the file descriptor (fd) identified using the - * environment variable `NODE_CHANNEL_FD` on the child process. - * - * Unlike the [`fork(2)`](http://man7.org/linux/man-pages/man2/fork.2.html) POSIX system call, `child_process.fork()` does not clone the - * current process. - * - * The `shell` option available in {@link spawn} is not supported by `child_process.fork()` and will be ignored if set. - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding `AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * if (process.argv[2] === 'child') { - * setTimeout(() => { - * console.log(`Hello from ${process.argv[2]}!`); - * }, 1_000); - * } else { - * import { fork } from 'node:child_process'; - * const controller = new AbortController(); - * const { signal } = controller; - * const child = fork(__filename, ['child'], { signal }); - * child.on('error', (err) => { - * // This will be called with err being an AbortError if the controller aborts - * }); - * controller.abort(); // Stops the child process - * } - * ``` - * @since v0.5.0 - * @param modulePath The module to run in the child. - * @param args List of string arguments. - */ - function fork(modulePath: string | URL, options?: ForkOptions): ChildProcess; - function fork(modulePath: string | URL, args?: readonly string[], options?: ForkOptions): ChildProcess; - interface SpawnSyncOptions extends CommonSpawnOptions { - input?: string | NodeJS.ArrayBufferView | undefined; - maxBuffer?: number | undefined; - encoding?: BufferEncoding | "buffer" | null | undefined; - } - interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions { - encoding: BufferEncoding; - } - interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions { - encoding?: "buffer" | null | undefined; - } - interface SpawnSyncReturns { - pid: number; - output: Array; - stdout: T; - stderr: T; - status: number | null; - signal: NodeJS.Signals | null; - error?: Error | undefined; - } - /** - * The `child_process.spawnSync()` method is generally identical to {@link spawn} with the exception that the function will not return - * until the child process has fully closed. When a timeout has been encountered - * and `killSignal` is sent, the method won't return until the process has - * completely exited. If the process intercepts and handles the `SIGTERM` signal - * and doesn't exit, the parent process will wait until the child process has - * exited. - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * @since v0.11.12 - * @param command The command to run. - * @param args List of string arguments. - */ - function spawnSync(command: string): SpawnSyncReturns; - function spawnSync(command: string, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; - function spawnSync(command: string, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; - function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns; - function spawnSync(command: string, args: readonly string[]): SpawnSyncReturns; - function spawnSync( - command: string, - args: readonly string[], - options: SpawnSyncOptionsWithStringEncoding, - ): SpawnSyncReturns; - function spawnSync( - command: string, - args: readonly string[], - options: SpawnSyncOptionsWithBufferEncoding, - ): SpawnSyncReturns; - function spawnSync( - command: string, - args?: readonly string[], - options?: SpawnSyncOptions, - ): SpawnSyncReturns; - interface CommonExecOptions extends CommonOptions { - input?: string | NodeJS.ArrayBufferView | undefined; - /** - * Can be set to 'pipe', 'inherit, or 'ignore', or an array of these strings. - * If passed as an array, the first element is used for `stdin`, the second for - * `stdout`, and the third for `stderr`. A fourth element can be used to - * specify the `stdio` behavior beyond the standard streams. See - * {@link ChildProcess.stdio} for more information. - * - * @default 'pipe' - */ - stdio?: StdioOptions | undefined; - killSignal?: NodeJS.Signals | number | undefined; - maxBuffer?: number | undefined; - encoding?: BufferEncoding | "buffer" | null | undefined; - } - interface ExecSyncOptions extends CommonExecOptions { - shell?: string | undefined; - } - interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions { - encoding: BufferEncoding; - } - interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions { - encoding?: "buffer" | null | undefined; - } - /** - * The `child_process.execSync()` method is generally identical to {@link exec} with the exception that the method will not return - * until the child process has fully closed. When a timeout has been encountered - * and `killSignal` is sent, the method won't return until the process has - * completely exited. If the child process intercepts and handles the `SIGTERM` signal and doesn't exit, the parent process will wait until the child process - * has exited. - * - * If the process times out or has a non-zero exit code, this method will throw. - * The `Error` object will contain the entire result from {@link spawnSync}. - * - * **Never pass unsanitized user input to this function. Any input containing shell** - * **metacharacters may be used to trigger arbitrary command execution.** - * @since v0.11.12 - * @param command The command to run. - * @return The stdout from the command. - */ - function execSync(command: string): Buffer; - function execSync(command: string, options: ExecSyncOptionsWithStringEncoding): string; - function execSync(command: string, options: ExecSyncOptionsWithBufferEncoding): Buffer; - function execSync(command: string, options?: ExecSyncOptions): string | Buffer; - interface ExecFileSyncOptions extends CommonExecOptions { - shell?: boolean | string | undefined; - } - interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions { - encoding: BufferEncoding; - } - interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions { - encoding?: "buffer" | null; // specify `null`. - } - /** - * The `child_process.execFileSync()` method is generally identical to {@link execFile} with the exception that the method will not - * return until the child process has fully closed. When a timeout has been - * encountered and `killSignal` is sent, the method won't return until the process - * has completely exited. - * - * If the child process intercepts and handles the `SIGTERM` signal and - * does not exit, the parent process will still wait until the child process has - * exited. - * - * If the process times out or has a non-zero exit code, this method will throw an `Error` that will include the full result of the underlying {@link spawnSync}. - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * @since v0.11.12 - * @param file The name or path of the executable file to run. - * @param args List of string arguments. - * @return The stdout from the command. - */ - function execFileSync(file: string): Buffer; - function execFileSync(file: string, options: ExecFileSyncOptionsWithStringEncoding): string; - function execFileSync(file: string, options: ExecFileSyncOptionsWithBufferEncoding): Buffer; - function execFileSync(file: string, options?: ExecFileSyncOptions): string | Buffer; - function execFileSync(file: string, args: readonly string[]): Buffer; - function execFileSync( - file: string, - args: readonly string[], - options: ExecFileSyncOptionsWithStringEncoding, - ): string; - function execFileSync( - file: string, - args: readonly string[], - options: ExecFileSyncOptionsWithBufferEncoding, - ): Buffer; - function execFileSync(file: string, args?: readonly string[], options?: ExecFileSyncOptions): string | Buffer; -} -declare module "node:child_process" { - export * from "child_process"; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/cluster.d.ts b/tools/mnemonic-test/node_modules/@types/node/cluster.d.ts deleted file mode 100644 index 86b48d9b..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/cluster.d.ts +++ /dev/null @@ -1,579 +0,0 @@ -/** - * Clusters of Node.js processes can be used to run multiple instances of Node.js - * that can distribute workloads among their application threads. When process isolation - * is not needed, use the [`worker_threads`](https://nodejs.org/docs/latest-v22.x/api/worker_threads.html) - * module instead, which allows running multiple application threads within a single Node.js instance. - * - * The cluster module allows easy creation of child processes that all share - * server ports. - * - * ```js - * import cluster from 'node:cluster'; - * import http from 'node:http'; - * import { availableParallelism } from 'node:os'; - * import process from 'node:process'; - * - * const numCPUs = availableParallelism(); - * - * if (cluster.isPrimary) { - * console.log(`Primary ${process.pid} is running`); - * - * // Fork workers. - * for (let i = 0; i < numCPUs; i++) { - * cluster.fork(); - * } - * - * cluster.on('exit', (worker, code, signal) => { - * console.log(`worker ${worker.process.pid} died`); - * }); - * } else { - * // Workers can share any TCP connection - * // In this case it is an HTTP server - * http.createServer((req, res) => { - * res.writeHead(200); - * res.end('hello world\n'); - * }).listen(8000); - * - * console.log(`Worker ${process.pid} started`); - * } - * ``` - * - * Running Node.js will now share port 8000 between the workers: - * - * ```console - * $ node server.js - * Primary 3596 is running - * Worker 4324 started - * Worker 4520 started - * Worker 6056 started - * Worker 5644 started - * ``` - * - * On Windows, it is not yet possible to set up a named pipe server in a worker. - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/cluster.js) - */ -declare module "cluster" { - import * as child from "node:child_process"; - import EventEmitter = require("node:events"); - import * as net from "node:net"; - type SerializationType = "json" | "advanced"; - export interface ClusterSettings { - /** - * List of string arguments passed to the Node.js executable. - * @default process.execArgv - */ - execArgv?: string[] | undefined; - /** - * File path to worker file. - * @default process.argv[1] - */ - exec?: string | undefined; - /** - * String arguments passed to worker. - * @default process.argv.slice(2) - */ - args?: string[] | undefined; - /** - * Whether or not to send output to parent's stdio. - * @default false - */ - silent?: boolean | undefined; - /** - * Configures the stdio of forked processes. Because the cluster module relies on IPC to function, this configuration must - * contain an `'ipc'` entry. When this option is provided, it overrides `silent`. See [`child_prcess.spawn()`](https://nodejs.org/docs/latest-v22.x/api/child_process.html#child_processspawncommand-args-options)'s - * [`stdio`](https://nodejs.org/docs/latest-v22.x/api/child_process.html#optionsstdio). - */ - stdio?: any[] | undefined; - /** - * Sets the user identity of the process. (See [`setuid(2)`](https://man7.org/linux/man-pages/man2/setuid.2.html).) - */ - uid?: number | undefined; - /** - * Sets the group identity of the process. (See [`setgid(2)`](https://man7.org/linux/man-pages/man2/setgid.2.html).) - */ - gid?: number | undefined; - /** - * Sets inspector port of worker. This can be a number, or a function that takes no arguments and returns a number. - * By default each worker gets its own port, incremented from the primary's `process.debugPort`. - */ - inspectPort?: number | (() => number) | undefined; - /** - * Specify the kind of serialization used for sending messages between processes. Possible values are `'json'` and `'advanced'`. - * See [Advanced serialization for `child_process`](https://nodejs.org/docs/latest-v22.x/api/child_process.html#advanced-serialization) for more details. - * @default false - */ - serialization?: SerializationType | undefined; - /** - * Current working directory of the worker process. - * @default undefined (inherits from parent process) - */ - cwd?: string | undefined; - /** - * Hide the forked processes console window that would normally be created on Windows systems. - * @default false - */ - windowsHide?: boolean | undefined; - } - export interface Address { - address: string; - port: number; - /** - * The `addressType` is one of: - * - * * `4` (TCPv4) - * * `6` (TCPv6) - * * `-1` (Unix domain socket) - * * `'udp4'` or `'udp6'` (UDPv4 or UDPv6) - */ - addressType: 4 | 6 | -1 | "udp4" | "udp6"; - } - /** - * A `Worker` object contains all public information and method about a worker. - * In the primary it can be obtained using `cluster.workers`. In a worker - * it can be obtained using `cluster.worker`. - * @since v0.7.0 - */ - export class Worker extends EventEmitter { - /** - * Each new worker is given its own unique id, this id is stored in the `id`. - * - * While a worker is alive, this is the key that indexes it in `cluster.workers`. - * @since v0.8.0 - */ - id: number; - /** - * All workers are created using [`child_process.fork()`](https://nodejs.org/docs/latest-v22.x/api/child_process.html#child_processforkmodulepath-args-options), the returned object - * from this function is stored as `.process`. In a worker, the global `process` is stored. - * - * See: [Child Process module](https://nodejs.org/docs/latest-v22.x/api/child_process.html#child_processforkmodulepath-args-options). - * - * Workers will call `process.exit(0)` if the `'disconnect'` event occurs - * on `process` and `.exitedAfterDisconnect` is not `true`. This protects against - * accidental disconnection. - * @since v0.7.0 - */ - process: child.ChildProcess; - /** - * Send a message to a worker or primary, optionally with a handle. - * - * In the primary, this sends a message to a specific worker. It is identical to [`ChildProcess.send()`](https://nodejs.org/docs/latest-v22.x/api/child_process.html#subprocesssendmessage-sendhandle-options-callback). - * - * In a worker, this sends a message to the primary. It is identical to `process.send()`. - * - * This example will echo back all messages from the primary: - * - * ```js - * if (cluster.isPrimary) { - * const worker = cluster.fork(); - * worker.send('hi there'); - * - * } else if (cluster.isWorker) { - * process.on('message', (msg) => { - * process.send(msg); - * }); - * } - * ``` - * @since v0.7.0 - * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. - */ - send(message: child.Serializable, callback?: (error: Error | null) => void): boolean; - send( - message: child.Serializable, - sendHandle: child.SendHandle, - callback?: (error: Error | null) => void, - ): boolean; - send( - message: child.Serializable, - sendHandle: child.SendHandle, - options?: child.MessageOptions, - callback?: (error: Error | null) => void, - ): boolean; - /** - * This function will kill the worker. In the primary worker, it does this by - * disconnecting the `worker.process`, and once disconnected, killing with `signal`. In the worker, it does it by killing the process with `signal`. - * - * The `kill()` function kills the worker process without waiting for a graceful - * disconnect, it has the same behavior as `worker.process.kill()`. - * - * This method is aliased as `worker.destroy()` for backwards compatibility. - * - * In a worker, `process.kill()` exists, but it is not this function; - * it is [`kill()`](https://nodejs.org/docs/latest-v22.x/api/process.html#processkillpid-signal). - * @since v0.9.12 - * @param [signal='SIGTERM'] Name of the kill signal to send to the worker process. - */ - kill(signal?: string): void; - destroy(signal?: string): void; - /** - * In a worker, this function will close all servers, wait for the `'close'` event - * on those servers, and then disconnect the IPC channel. - * - * In the primary, an internal message is sent to the worker causing it to call `.disconnect()` on itself. - * - * Causes `.exitedAfterDisconnect` to be set. - * - * After a server is closed, it will no longer accept new connections, - * but connections may be accepted by any other listening worker. Existing - * connections will be allowed to close as usual. When no more connections exist, - * see `server.close()`, the IPC channel to the worker will close allowing it - * to die gracefully. - * - * The above applies _only_ to server connections, client connections are not - * automatically closed by workers, and disconnect does not wait for them to close - * before exiting. - * - * In a worker, `process.disconnect` exists, but it is not this function; - * it is `disconnect()`. - * - * Because long living server connections may block workers from disconnecting, it - * may be useful to send a message, so application specific actions may be taken to - * close them. It also may be useful to implement a timeout, killing a worker if - * the `'disconnect'` event has not been emitted after some time. - * - * ```js - * import net from 'node:net'; - * - * if (cluster.isPrimary) { - * const worker = cluster.fork(); - * let timeout; - * - * worker.on('listening', (address) => { - * worker.send('shutdown'); - * worker.disconnect(); - * timeout = setTimeout(() => { - * worker.kill(); - * }, 2000); - * }); - * - * worker.on('disconnect', () => { - * clearTimeout(timeout); - * }); - * - * } else if (cluster.isWorker) { - * const server = net.createServer((socket) => { - * // Connections never end - * }); - * - * server.listen(8000); - * - * process.on('message', (msg) => { - * if (msg === 'shutdown') { - * // Initiate graceful close of any connections to server - * } - * }); - * } - * ``` - * @since v0.7.7 - * @return A reference to `worker`. - */ - disconnect(): void; - /** - * This function returns `true` if the worker is connected to its primary via its - * IPC channel, `false` otherwise. A worker is connected to its primary after it - * has been created. It is disconnected after the `'disconnect'` event is emitted. - * @since v0.11.14 - */ - isConnected(): boolean; - /** - * This function returns `true` if the worker's process has terminated (either - * because of exiting or being signaled). Otherwise, it returns `false`. - * - * ```js - * import cluster from 'node:cluster'; - * import http from 'node:http'; - * import { availableParallelism } from 'node:os'; - * import process from 'node:process'; - * - * const numCPUs = availableParallelism(); - * - * if (cluster.isPrimary) { - * console.log(`Primary ${process.pid} is running`); - * - * // Fork workers. - * for (let i = 0; i < numCPUs; i++) { - * cluster.fork(); - * } - * - * cluster.on('fork', (worker) => { - * console.log('worker is dead:', worker.isDead()); - * }); - * - * cluster.on('exit', (worker, code, signal) => { - * console.log('worker is dead:', worker.isDead()); - * }); - * } else { - * // Workers can share any TCP connection. In this case, it is an HTTP server. - * http.createServer((req, res) => { - * res.writeHead(200); - * res.end(`Current process\n ${process.pid}`); - * process.kill(process.pid); - * }).listen(8000); - * } - * ``` - * @since v0.11.14 - */ - isDead(): boolean; - /** - * This property is `true` if the worker exited due to `.disconnect()`. - * If the worker exited any other way, it is `false`. If the - * worker has not exited, it is `undefined`. - * - * The boolean `worker.exitedAfterDisconnect` allows distinguishing between - * voluntary and accidental exit, the primary may choose not to respawn a worker - * based on this value. - * - * ```js - * cluster.on('exit', (worker, code, signal) => { - * if (worker.exitedAfterDisconnect === true) { - * console.log('Oh, it was just voluntary – no need to worry'); - * } - * }); - * - * // kill worker - * worker.kill(); - * ``` - * @since v6.0.0 - */ - exitedAfterDisconnect: boolean; - /** - * events.EventEmitter - * 1. disconnect - * 2. error - * 3. exit - * 4. listening - * 5. message - * 6. online - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "disconnect", listener: () => void): this; - addListener(event: "error", listener: (error: Error) => void): this; - addListener(event: "exit", listener: (code: number, signal: string) => void): this; - addListener(event: "listening", listener: (address: Address) => void): this; - addListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - addListener(event: "online", listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "disconnect"): boolean; - emit(event: "error", error: Error): boolean; - emit(event: "exit", code: number, signal: string): boolean; - emit(event: "listening", address: Address): boolean; - emit(event: "message", message: any, handle: net.Socket | net.Server): boolean; - emit(event: "online"): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "disconnect", listener: () => void): this; - on(event: "error", listener: (error: Error) => void): this; - on(event: "exit", listener: (code: number, signal: string) => void): this; - on(event: "listening", listener: (address: Address) => void): this; - on(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - on(event: "online", listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "disconnect", listener: () => void): this; - once(event: "error", listener: (error: Error) => void): this; - once(event: "exit", listener: (code: number, signal: string) => void): this; - once(event: "listening", listener: (address: Address) => void): this; - once(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - once(event: "online", listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "disconnect", listener: () => void): this; - prependListener(event: "error", listener: (error: Error) => void): this; - prependListener(event: "exit", listener: (code: number, signal: string) => void): this; - prependListener(event: "listening", listener: (address: Address) => void): this; - prependListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - prependListener(event: "online", listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "disconnect", listener: () => void): this; - prependOnceListener(event: "error", listener: (error: Error) => void): this; - prependOnceListener(event: "exit", listener: (code: number, signal: string) => void): this; - prependOnceListener(event: "listening", listener: (address: Address) => void): this; - prependOnceListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - prependOnceListener(event: "online", listener: () => void): this; - } - export interface Cluster extends EventEmitter { - disconnect(callback?: () => void): void; - /** - * Spawn a new worker process. - * - * This can only be called from the primary process. - * @param env Key/value pairs to add to worker process environment. - * @since v0.6.0 - */ - fork(env?: any): Worker; - /** @deprecated since v16.0.0 - use isPrimary. */ - readonly isMaster: boolean; - /** - * True if the process is a primary. This is determined by the `process.env.NODE_UNIQUE_ID`. If `process.env.NODE_UNIQUE_ID` - * is undefined, then `isPrimary` is `true`. - * @since v16.0.0 - */ - readonly isPrimary: boolean; - /** - * True if the process is not a primary (it is the negation of `cluster.isPrimary`). - * @since v0.6.0 - */ - readonly isWorker: boolean; - /** - * The scheduling policy, either `cluster.SCHED_RR` for round-robin or `cluster.SCHED_NONE` to leave it to the operating system. This is a - * global setting and effectively frozen once either the first worker is spawned, or [`.setupPrimary()`](https://nodejs.org/docs/latest-v22.x/api/cluster.html#clustersetupprimarysettings) - * is called, whichever comes first. - * - * `SCHED_RR` is the default on all operating systems except Windows. Windows will change to `SCHED_RR` once libuv is able to effectively distribute - * IOCP handles without incurring a large performance hit. - * - * `cluster.schedulingPolicy` can also be set through the `NODE_CLUSTER_SCHED_POLICY` environment variable. Valid values are `'rr'` and `'none'`. - * @since v0.11.2 - */ - schedulingPolicy: number; - /** - * After calling [`.setupPrimary()`](https://nodejs.org/docs/latest-v22.x/api/cluster.html#clustersetupprimarysettings) - * (or [`.fork()`](https://nodejs.org/docs/latest-v22.x/api/cluster.html#clusterforkenv)) this settings object will contain - * the settings, including the default values. - * - * This object is not intended to be changed or set manually. - * @since v0.7.1 - */ - readonly settings: ClusterSettings; - /** @deprecated since v16.0.0 - use [`.setupPrimary()`](https://nodejs.org/docs/latest-v22.x/api/cluster.html#clustersetupprimarysettings) instead. */ - setupMaster(settings?: ClusterSettings): void; - /** - * `setupPrimary` is used to change the default 'fork' behavior. Once called, the settings will be present in `cluster.settings`. - * - * Any settings changes only affect future calls to [`.fork()`](https://nodejs.org/docs/latest-v22.x/api/cluster.html#clusterforkenv) - * and have no effect on workers that are already running. - * - * The only attribute of a worker that cannot be set via `.setupPrimary()` is the `env` passed to - * [`.fork()`](https://nodejs.org/docs/latest-v22.x/api/cluster.html#clusterforkenv). - * - * The defaults above apply to the first call only; the defaults for later calls are the current values at the time of - * `cluster.setupPrimary()` is called. - * - * ```js - * import cluster from 'node:cluster'; - * - * cluster.setupPrimary({ - * exec: 'worker.js', - * args: ['--use', 'https'], - * silent: true, - * }); - * cluster.fork(); // https worker - * cluster.setupPrimary({ - * exec: 'worker.js', - * args: ['--use', 'http'], - * }); - * cluster.fork(); // http worker - * ``` - * - * This can only be called from the primary process. - * @since v16.0.0 - */ - setupPrimary(settings?: ClusterSettings): void; - /** - * A reference to the current worker object. Not available in the primary process. - * - * ```js - * import cluster from 'node:cluster'; - * - * if (cluster.isPrimary) { - * console.log('I am primary'); - * cluster.fork(); - * cluster.fork(); - * } else if (cluster.isWorker) { - * console.log(`I am worker #${cluster.worker.id}`); - * } - * ``` - * @since v0.7.0 - */ - readonly worker?: Worker | undefined; - /** - * A hash that stores the active worker objects, keyed by `id` field. This makes it easy to loop through all the workers. It is only available in the primary process. - * - * A worker is removed from `cluster.workers` after the worker has disconnected _and_ exited. The order between these two events cannot be determined in advance. However, it - * is guaranteed that the removal from the `cluster.workers` list happens before the last `'disconnect'` or `'exit'` event is emitted. - * - * ```js - * import cluster from 'node:cluster'; - * - * for (const worker of Object.values(cluster.workers)) { - * worker.send('big announcement to all workers'); - * } - * ``` - * @since v0.7.0 - */ - readonly workers?: NodeJS.Dict | undefined; - readonly SCHED_NONE: number; - readonly SCHED_RR: number; - /** - * events.EventEmitter - * 1. disconnect - * 2. exit - * 3. fork - * 4. listening - * 5. message - * 6. online - * 7. setup - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "disconnect", listener: (worker: Worker) => void): this; - addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - addListener(event: "fork", listener: (worker: Worker) => void): this; - addListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; - addListener( - event: "message", - listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void, - ): this; // the handle is a net.Socket or net.Server object, or undefined. - addListener(event: "online", listener: (worker: Worker) => void): this; - addListener(event: "setup", listener: (settings: ClusterSettings) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "disconnect", worker: Worker): boolean; - emit(event: "exit", worker: Worker, code: number, signal: string): boolean; - emit(event: "fork", worker: Worker): boolean; - emit(event: "listening", worker: Worker, address: Address): boolean; - emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean; - emit(event: "online", worker: Worker): boolean; - emit(event: "setup", settings: ClusterSettings): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "disconnect", listener: (worker: Worker) => void): this; - on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - on(event: "fork", listener: (worker: Worker) => void): this; - on(event: "listening", listener: (worker: Worker, address: Address) => void): this; - on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - on(event: "online", listener: (worker: Worker) => void): this; - on(event: "setup", listener: (settings: ClusterSettings) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "disconnect", listener: (worker: Worker) => void): this; - once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - once(event: "fork", listener: (worker: Worker) => void): this; - once(event: "listening", listener: (worker: Worker, address: Address) => void): this; - once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - once(event: "online", listener: (worker: Worker) => void): this; - once(event: "setup", listener: (settings: ClusterSettings) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "disconnect", listener: (worker: Worker) => void): this; - prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - prependListener(event: "fork", listener: (worker: Worker) => void): this; - prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; - // the handle is a net.Socket or net.Server object, or undefined. - prependListener( - event: "message", - listener: (worker: Worker, message: any, handle?: net.Socket | net.Server) => void, - ): this; - prependListener(event: "online", listener: (worker: Worker) => void): this; - prependListener(event: "setup", listener: (settings: ClusterSettings) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): this; - prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - prependOnceListener(event: "fork", listener: (worker: Worker) => void): this; - prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; - // the handle is a net.Socket or net.Server object, or undefined. - prependOnceListener( - event: "message", - listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void, - ): this; - prependOnceListener(event: "online", listener: (worker: Worker) => void): this; - prependOnceListener(event: "setup", listener: (settings: ClusterSettings) => void): this; - } - const cluster: Cluster; - export default cluster; -} -declare module "node:cluster" { - export * from "cluster"; - export { default as default } from "cluster"; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/console.d.ts b/tools/mnemonic-test/node_modules/@types/node/console.d.ts deleted file mode 100644 index 3e4c2d9a..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/console.d.ts +++ /dev/null @@ -1,452 +0,0 @@ -/** - * The `node:console` module provides a simple debugging console that is similar to - * the JavaScript console mechanism provided by web browsers. - * - * The module exports two specific components: - * - * * A `Console` class with methods such as `console.log()`, `console.error()`, and `console.warn()` that can be used to write to any Node.js stream. - * * A global `console` instance configured to write to [`process.stdout`](https://nodejs.org/docs/latest-v22.x/api/process.html#processstdout) and - * [`process.stderr`](https://nodejs.org/docs/latest-v22.x/api/process.html#processstderr). The global `console` can be used without importing the `node:console` module. - * - * _**Warning**_: The global console object's methods are neither consistently - * synchronous like the browser APIs they resemble, nor are they consistently - * asynchronous like all other Node.js streams. See the [`note on process I/O`](https://nodejs.org/docs/latest-v22.x/api/process.html#a-note-on-process-io) for - * more information. - * - * Example using the global `console`: - * - * ```js - * console.log('hello world'); - * // Prints: hello world, to stdout - * console.log('hello %s', 'world'); - * // Prints: hello world, to stdout - * console.error(new Error('Whoops, something bad happened')); - * // Prints error message and stack trace to stderr: - * // Error: Whoops, something bad happened - * // at [eval]:5:15 - * // at Script.runInThisContext (node:vm:132:18) - * // at Object.runInThisContext (node:vm:309:38) - * // at node:internal/process/execution:77:19 - * // at [eval]-wrapper:6:22 - * // at evalScript (node:internal/process/execution:76:60) - * // at node:internal/main/eval_string:23:3 - * - * const name = 'Will Robinson'; - * console.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to stderr - * ``` - * - * Example using the `Console` class: - * - * ```js - * const out = getStreamSomehow(); - * const err = getStreamSomehow(); - * const myConsole = new console.Console(out, err); - * - * myConsole.log('hello world'); - * // Prints: hello world, to out - * myConsole.log('hello %s', 'world'); - * // Prints: hello world, to out - * myConsole.error(new Error('Whoops, something bad happened')); - * // Prints: [Error: Whoops, something bad happened], to err - * - * const name = 'Will Robinson'; - * myConsole.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to err - * ``` - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/console.js) - */ -declare module "console" { - import console = require("node:console"); - export = console; -} -declare module "node:console" { - import { InspectOptions } from "node:util"; - global { - // This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build - interface Console { - Console: console.ConsoleConstructor; - /** - * `console.assert()` writes a message if `value` is [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy) or omitted. It only - * writes a message and does not otherwise affect execution. The output always - * starts with `"Assertion failed"`. If provided, `message` is formatted using - * [`util.format()`](https://nodejs.org/docs/latest-v22.x/api/util.html#utilformatformat-args). - * - * If `value` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy), nothing happens. - * - * ```js - * console.assert(true, 'does nothing'); - * - * console.assert(false, 'Whoops %s work', 'didn\'t'); - * // Assertion failed: Whoops didn't work - * - * console.assert(); - * // Assertion failed - * ``` - * @since v0.1.101 - * @param value The value tested for being truthy. - * @param message All arguments besides `value` are used as error message. - */ - assert(value: any, message?: string, ...optionalParams: any[]): void; - /** - * When `stdout` is a TTY, calling `console.clear()` will attempt to clear the - * TTY. When `stdout` is not a TTY, this method does nothing. - * - * The specific operation of `console.clear()` can vary across operating systems - * and terminal types. For most Linux operating systems, `console.clear()` operates similarly to the `clear` shell command. On Windows, `console.clear()` will clear only the output in the - * current terminal viewport for the Node.js - * binary. - * @since v8.3.0 - */ - clear(): void; - /** - * Maintains an internal counter specific to `label` and outputs to `stdout` the - * number of times `console.count()` has been called with the given `label`. - * - * ```js - * > console.count() - * default: 1 - * undefined - * > console.count('default') - * default: 2 - * undefined - * > console.count('abc') - * abc: 1 - * undefined - * > console.count('xyz') - * xyz: 1 - * undefined - * > console.count('abc') - * abc: 2 - * undefined - * > console.count() - * default: 3 - * undefined - * > - * ``` - * @since v8.3.0 - * @param [label='default'] The display label for the counter. - */ - count(label?: string): void; - /** - * Resets the internal counter specific to `label`. - * - * ```js - * > console.count('abc'); - * abc: 1 - * undefined - * > console.countReset('abc'); - * undefined - * > console.count('abc'); - * abc: 1 - * undefined - * > - * ``` - * @since v8.3.0 - * @param [label='default'] The display label for the counter. - */ - countReset(label?: string): void; - /** - * The `console.debug()` function is an alias for {@link log}. - * @since v8.0.0 - */ - debug(message?: any, ...optionalParams: any[]): void; - /** - * Uses [`util.inspect()`](https://nodejs.org/docs/latest-v22.x/api/util.html#utilinspectobject-options) on `obj` and prints the resulting string to `stdout`. - * This function bypasses any custom `inspect()` function defined on `obj`. - * @since v0.1.101 - */ - dir(obj: any, options?: InspectOptions): void; - /** - * This method calls `console.log()` passing it the arguments received. - * This method does not produce any XML formatting. - * @since v8.0.0 - */ - dirxml(...data: any[]): void; - /** - * Prints to `stderr` with newline. Multiple arguments can be passed, with the - * first used as the primary message and all additional used as substitution - * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) - * (the arguments are all passed to [`util.format()`](https://nodejs.org/docs/latest-v22.x/api/util.html#utilformatformat-args)). - * - * ```js - * const code = 5; - * console.error('error #%d', code); - * // Prints: error #5, to stderr - * console.error('error', code); - * // Prints: error 5, to stderr - * ``` - * - * If formatting elements (e.g. `%d`) are not found in the first string then - * [`util.inspect()`](https://nodejs.org/docs/latest-v22.x/api/util.html#utilinspectobject-options) is called on each argument and the - * resulting string values are concatenated. See [`util.format()`](https://nodejs.org/docs/latest-v22.x/api/util.html#utilformatformat-args) - * for more information. - * @since v0.1.100 - */ - error(message?: any, ...optionalParams: any[]): void; - /** - * Increases indentation of subsequent lines by spaces for `groupIndentation` length. - * - * If one or more `label`s are provided, those are printed first without the - * additional indentation. - * @since v8.5.0 - */ - group(...label: any[]): void; - /** - * An alias for {@link group}. - * @since v8.5.0 - */ - groupCollapsed(...label: any[]): void; - /** - * Decreases indentation of subsequent lines by spaces for `groupIndentation` length. - * @since v8.5.0 - */ - groupEnd(): void; - /** - * The `console.info()` function is an alias for {@link log}. - * @since v0.1.100 - */ - info(message?: any, ...optionalParams: any[]): void; - /** - * Prints to `stdout` with newline. Multiple arguments can be passed, with the - * first used as the primary message and all additional used as substitution - * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) - * (the arguments are all passed to [`util.format()`](https://nodejs.org/docs/latest-v22.x/api/util.html#utilformatformat-args)). - * - * ```js - * const count = 5; - * console.log('count: %d', count); - * // Prints: count: 5, to stdout - * console.log('count:', count); - * // Prints: count: 5, to stdout - * ``` - * - * See [`util.format()`](https://nodejs.org/docs/latest-v22.x/api/util.html#utilformatformat-args) for more information. - * @since v0.1.100 - */ - log(message?: any, ...optionalParams: any[]): void; - /** - * Try to construct a table with the columns of the properties of `tabularData` (or use `properties`) and rows of `tabularData` and log it. Falls back to just - * logging the argument if it can't be parsed as tabular. - * - * ```js - * // These can't be parsed as tabular data - * console.table(Symbol()); - * // Symbol() - * - * console.table(undefined); - * // undefined - * - * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }]); - * // ┌─────────┬─────┬─────┐ - * // │ (index) │ a │ b │ - * // ├─────────┼─────┼─────┤ - * // │ 0 │ 1 │ 'Y' │ - * // │ 1 │ 'Z' │ 2 │ - * // └─────────┴─────┴─────┘ - * - * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }], ['a']); - * // ┌─────────┬─────┐ - * // │ (index) │ a │ - * // ├─────────┼─────┤ - * // │ 0 │ 1 │ - * // │ 1 │ 'Z' │ - * // └─────────┴─────┘ - * ``` - * @since v10.0.0 - * @param properties Alternate properties for constructing the table. - */ - table(tabularData: any, properties?: readonly string[]): void; - /** - * Starts a timer that can be used to compute the duration of an operation. Timers - * are identified by a unique `label`. Use the same `label` when calling {@link timeEnd} to stop the timer and output the elapsed time in - * suitable time units to `stdout`. For example, if the elapsed - * time is 3869ms, `console.timeEnd()` displays "3.869s". - * @since v0.1.104 - * @param [label='default'] - */ - time(label?: string): void; - /** - * Stops a timer that was previously started by calling {@link time} and - * prints the result to `stdout`: - * - * ```js - * console.time('bunch-of-stuff'); - * // Do a bunch of stuff. - * console.timeEnd('bunch-of-stuff'); - * // Prints: bunch-of-stuff: 225.438ms - * ``` - * @since v0.1.104 - * @param [label='default'] - */ - timeEnd(label?: string): void; - /** - * For a timer that was previously started by calling {@link time}, prints - * the elapsed time and other `data` arguments to `stdout`: - * - * ```js - * console.time('process'); - * const value = expensiveProcess1(); // Returns 42 - * console.timeLog('process', value); - * // Prints "process: 365.227ms 42". - * doExpensiveProcess2(value); - * console.timeEnd('process'); - * ``` - * @since v10.7.0 - * @param [label='default'] - */ - timeLog(label?: string, ...data: any[]): void; - /** - * Prints to `stderr` the string `'Trace: '`, followed by the [`util.format()`](https://nodejs.org/docs/latest-v22.x/api/util.html#utilformatformat-args) - * formatted message and stack trace to the current position in the code. - * - * ```js - * console.trace('Show me'); - * // Prints: (stack trace will vary based on where trace is called) - * // Trace: Show me - * // at repl:2:9 - * // at REPLServer.defaultEval (repl.js:248:27) - * // at bound (domain.js:287:14) - * // at REPLServer.runBound [as eval] (domain.js:300:12) - * // at REPLServer. (repl.js:412:12) - * // at emitOne (events.js:82:20) - * // at REPLServer.emit (events.js:169:7) - * // at REPLServer.Interface._onLine (readline.js:210:10) - * // at REPLServer.Interface._line (readline.js:549:8) - * // at REPLServer.Interface._ttyWrite (readline.js:826:14) - * ``` - * @since v0.1.104 - */ - trace(message?: any, ...optionalParams: any[]): void; - /** - * The `console.warn()` function is an alias for {@link error}. - * @since v0.1.100 - */ - warn(message?: any, ...optionalParams: any[]): void; - // --- Inspector mode only --- - /** - * This method does not display anything unless used in the inspector. The `console.profile()` - * method starts a JavaScript CPU profile with an optional label until {@link profileEnd} - * is called. The profile is then added to the Profile panel of the inspector. - * - * ```js - * console.profile('MyLabel'); - * // Some code - * console.profileEnd('MyLabel'); - * // Adds the profile 'MyLabel' to the Profiles panel of the inspector. - * ``` - * @since v8.0.0 - */ - profile(label?: string): void; - /** - * This method does not display anything unless used in the inspector. Stops the current - * JavaScript CPU profiling session if one has been started and prints the report to the - * Profiles panel of the inspector. See {@link profile} for an example. - * - * If this method is called without a label, the most recently started profile is stopped. - * @since v8.0.0 - */ - profileEnd(label?: string): void; - /** - * This method does not display anything unless used in the inspector. The `console.timeStamp()` - * method adds an event with the label `'label'` to the Timeline panel of the inspector. - * @since v8.0.0 - */ - timeStamp(label?: string): void; - } - /** - * The `console` module provides a simple debugging console that is similar to the - * JavaScript console mechanism provided by web browsers. - * - * The module exports two specific components: - * - * * A `Console` class with methods such as `console.log()`, `console.error()` and `console.warn()` that can be used to write to any Node.js stream. - * * A global `console` instance configured to write to [`process.stdout`](https://nodejs.org/docs/latest-v22.x/api/process.html#processstdout) and - * [`process.stderr`](https://nodejs.org/docs/latest-v22.x/api/process.html#processstderr). The global `console` can be used without importing the `node:console` module. - * - * _**Warning**_: The global console object's methods are neither consistently - * synchronous like the browser APIs they resemble, nor are they consistently - * asynchronous like all other Node.js streams. See the [`note on process I/O`](https://nodejs.org/docs/latest-v22.x/api/process.html#a-note-on-process-io) for - * more information. - * - * Example using the global `console`: - * - * ```js - * console.log('hello world'); - * // Prints: hello world, to stdout - * console.log('hello %s', 'world'); - * // Prints: hello world, to stdout - * console.error(new Error('Whoops, something bad happened')); - * // Prints error message and stack trace to stderr: - * // Error: Whoops, something bad happened - * // at [eval]:5:15 - * // at Script.runInThisContext (node:vm:132:18) - * // at Object.runInThisContext (node:vm:309:38) - * // at node:internal/process/execution:77:19 - * // at [eval]-wrapper:6:22 - * // at evalScript (node:internal/process/execution:76:60) - * // at node:internal/main/eval_string:23:3 - * - * const name = 'Will Robinson'; - * console.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to stderr - * ``` - * - * Example using the `Console` class: - * - * ```js - * const out = getStreamSomehow(); - * const err = getStreamSomehow(); - * const myConsole = new console.Console(out, err); - * - * myConsole.log('hello world'); - * // Prints: hello world, to out - * myConsole.log('hello %s', 'world'); - * // Prints: hello world, to out - * myConsole.error(new Error('Whoops, something bad happened')); - * // Prints: [Error: Whoops, something bad happened], to err - * - * const name = 'Will Robinson'; - * myConsole.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to err - * ``` - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/console.js) - */ - namespace console { - interface ConsoleConstructorOptions { - stdout: NodeJS.WritableStream; - stderr?: NodeJS.WritableStream | undefined; - /** - * Ignore errors when writing to the underlying streams. - * @default true - */ - ignoreErrors?: boolean | undefined; - /** - * Set color support for this `Console` instance. Setting to true enables coloring while inspecting - * values. Setting to `false` disables coloring while inspecting values. Setting to `'auto'` makes color - * support depend on the value of the `isTTY` property and the value returned by `getColorDepth()` on the - * respective stream. This option can not be used, if `inspectOptions.colors` is set as well. - * @default auto - */ - colorMode?: boolean | "auto" | undefined; - /** - * Specifies options that are passed along to - * [`util.inspect()`](https://nodejs.org/docs/latest-v22.x/api/util.html#utilinspectobject-options). - */ - inspectOptions?: InspectOptions | undefined; - /** - * Set group indentation. - * @default 2 - */ - groupIndentation?: number | undefined; - } - interface ConsoleConstructor { - prototype: Console; - new(stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): Console; - new(options: ConsoleConstructorOptions): Console; - } - } - var console: Console; - } - export = globalThis.console; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/constants.d.ts b/tools/mnemonic-test/node_modules/@types/node/constants.d.ts deleted file mode 100644 index c3ac2b82..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/constants.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */ -declare module "constants" { - import { constants as osConstants, SignalConstants } from "node:os"; - import { constants as cryptoConstants } from "node:crypto"; - import { constants as fsConstants } from "node:fs"; - - const exp: - & typeof osConstants.errno - & typeof osConstants.priority - & SignalConstants - & typeof cryptoConstants - & typeof fsConstants; - export = exp; -} - -declare module "node:constants" { - import constants = require("constants"); - export = constants; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/crypto.d.ts b/tools/mnemonic-test/node_modules/@types/node/crypto.d.ts deleted file mode 100644 index 9b6bcf81..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/crypto.d.ts +++ /dev/null @@ -1,4451 +0,0 @@ -/** - * The `node:crypto` module provides cryptographic functionality that includes a - * set of wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify - * functions. - * - * ```js - * const { createHmac } = await import('node:crypto'); - * - * const secret = 'abcdefg'; - * const hash = createHmac('sha256', secret) - * .update('I love cupcakes') - * .digest('hex'); - * console.log(hash); - * // Prints: - * // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e - * ``` - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/crypto.js) - */ -declare module "crypto" { - import * as stream from "node:stream"; - import { PeerCertificate } from "node:tls"; - /** - * SPKAC is a Certificate Signing Request mechanism originally implemented by - * Netscape and was specified formally as part of HTML5's `keygen` element. - * - * `` is deprecated since [HTML 5.2](https://www.w3.org/TR/html52/changes.html#features-removed) and new projects - * should not use this element anymore. - * - * The `node:crypto` module provides the `Certificate` class for working with SPKAC - * data. The most common usage is handling output generated by the HTML5 `` element. Node.js uses [OpenSSL's SPKAC - * implementation](https://www.openssl.org/docs/man3.0/man1/openssl-spkac.html) internally. - * @since v0.11.8 - */ - class Certificate { - /** - * ```js - * const { Certificate } = await import('node:crypto'); - * const spkac = getSpkacSomehow(); - * const challenge = Certificate.exportChallenge(spkac); - * console.log(challenge.toString('utf8')); - * // Prints: the challenge as a UTF8 string - * ``` - * @since v9.0.0 - * @param encoding The `encoding` of the `spkac` string. - * @return The challenge component of the `spkac` data structure, which includes a public key and a challenge. - */ - static exportChallenge(spkac: BinaryLike): Buffer; - /** - * ```js - * const { Certificate } = await import('node:crypto'); - * const spkac = getSpkacSomehow(); - * const publicKey = Certificate.exportPublicKey(spkac); - * console.log(publicKey); - * // Prints: the public key as - * ``` - * @since v9.0.0 - * @param encoding The `encoding` of the `spkac` string. - * @return The public key component of the `spkac` data structure, which includes a public key and a challenge. - */ - static exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer; - /** - * ```js - * import { Buffer } from 'node:buffer'; - * const { Certificate } = await import('node:crypto'); - * - * const spkac = getSpkacSomehow(); - * console.log(Certificate.verifySpkac(Buffer.from(spkac))); - * // Prints: true or false - * ``` - * @since v9.0.0 - * @param encoding The `encoding` of the `spkac` string. - * @return `true` if the given `spkac` data structure is valid, `false` otherwise. - */ - static verifySpkac(spkac: NodeJS.ArrayBufferView): boolean; - /** - * @deprecated - * @param spkac - * @returns The challenge component of the `spkac` data structure, - * which includes a public key and a challenge. - */ - exportChallenge(spkac: BinaryLike): Buffer; - /** - * @deprecated - * @param spkac - * @param encoding The encoding of the spkac string. - * @returns The public key component of the `spkac` data structure, - * which includes a public key and a challenge. - */ - exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer; - /** - * @deprecated - * @param spkac - * @returns `true` if the given `spkac` data structure is valid, - * `false` otherwise. - */ - verifySpkac(spkac: NodeJS.ArrayBufferView): boolean; - } - namespace constants { - // https://nodejs.org/dist/latest-v22.x/docs/api/crypto.html#crypto-constants - const OPENSSL_VERSION_NUMBER: number; - /** Applies multiple bug workarounds within OpenSSL. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html for detail. */ - const SSL_OP_ALL: number; - /** Instructs OpenSSL to allow a non-[EC]DHE-based key exchange mode for TLS v1.3 */ - const SSL_OP_ALLOW_NO_DHE_KEX: number; - /** Allows legacy insecure renegotiation between OpenSSL and unpatched clients or servers. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ - const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number; - /** Attempts to use the server's preferences instead of the client's when selecting a cipher. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ - const SSL_OP_CIPHER_SERVER_PREFERENCE: number; - /** Instructs OpenSSL to use Cisco's version identifier of DTLS_BAD_VER. */ - const SSL_OP_CISCO_ANYCONNECT: number; - /** Instructs OpenSSL to turn on cookie exchange. */ - const SSL_OP_COOKIE_EXCHANGE: number; - /** Instructs OpenSSL to add server-hello extension from an early version of the cryptopro draft. */ - const SSL_OP_CRYPTOPRO_TLSEXT_BUG: number; - /** Instructs OpenSSL to disable a SSL 3.0/TLS 1.0 vulnerability workaround added in OpenSSL 0.9.6d. */ - const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number; - /** Allows initial connection to servers that do not support RI. */ - const SSL_OP_LEGACY_SERVER_CONNECT: number; - /** Instructs OpenSSL to disable support for SSL/TLS compression. */ - const SSL_OP_NO_COMPRESSION: number; - /** Instructs OpenSSL to disable encrypt-then-MAC. */ - const SSL_OP_NO_ENCRYPT_THEN_MAC: number; - const SSL_OP_NO_QUERY_MTU: number; - /** Instructs OpenSSL to disable renegotiation. */ - const SSL_OP_NO_RENEGOTIATION: number; - /** Instructs OpenSSL to always start a new session when performing renegotiation. */ - const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number; - /** Instructs OpenSSL to turn off SSL v2 */ - const SSL_OP_NO_SSLv2: number; - /** Instructs OpenSSL to turn off SSL v3 */ - const SSL_OP_NO_SSLv3: number; - /** Instructs OpenSSL to disable use of RFC4507bis tickets. */ - const SSL_OP_NO_TICKET: number; - /** Instructs OpenSSL to turn off TLS v1 */ - const SSL_OP_NO_TLSv1: number; - /** Instructs OpenSSL to turn off TLS v1.1 */ - const SSL_OP_NO_TLSv1_1: number; - /** Instructs OpenSSL to turn off TLS v1.2 */ - const SSL_OP_NO_TLSv1_2: number; - /** Instructs OpenSSL to turn off TLS v1.3 */ - const SSL_OP_NO_TLSv1_3: number; - /** Instructs OpenSSL server to prioritize ChaCha20-Poly1305 when the client does. This option has no effect if `SSL_OP_CIPHER_SERVER_PREFERENCE` is not enabled. */ - const SSL_OP_PRIORITIZE_CHACHA: number; - /** Instructs OpenSSL to disable version rollback attack detection. */ - const SSL_OP_TLS_ROLLBACK_BUG: number; - const ENGINE_METHOD_RSA: number; - const ENGINE_METHOD_DSA: number; - const ENGINE_METHOD_DH: number; - const ENGINE_METHOD_RAND: number; - const ENGINE_METHOD_EC: number; - const ENGINE_METHOD_CIPHERS: number; - const ENGINE_METHOD_DIGESTS: number; - const ENGINE_METHOD_PKEY_METHS: number; - const ENGINE_METHOD_PKEY_ASN1_METHS: number; - const ENGINE_METHOD_ALL: number; - const ENGINE_METHOD_NONE: number; - const DH_CHECK_P_NOT_SAFE_PRIME: number; - const DH_CHECK_P_NOT_PRIME: number; - const DH_UNABLE_TO_CHECK_GENERATOR: number; - const DH_NOT_SUITABLE_GENERATOR: number; - const RSA_PKCS1_PADDING: number; - const RSA_SSLV23_PADDING: number; - const RSA_NO_PADDING: number; - const RSA_PKCS1_OAEP_PADDING: number; - const RSA_X931_PADDING: number; - const RSA_PKCS1_PSS_PADDING: number; - /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the digest size when signing or verifying. */ - const RSA_PSS_SALTLEN_DIGEST: number; - /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the maximum permissible value when signing data. */ - const RSA_PSS_SALTLEN_MAX_SIGN: number; - /** Causes the salt length for RSA_PKCS1_PSS_PADDING to be determined automatically when verifying a signature. */ - const RSA_PSS_SALTLEN_AUTO: number; - const POINT_CONVERSION_COMPRESSED: number; - const POINT_CONVERSION_UNCOMPRESSED: number; - const POINT_CONVERSION_HYBRID: number; - /** Specifies the built-in default cipher list used by Node.js (colon-separated values). */ - const defaultCoreCipherList: string; - /** Specifies the active default cipher list used by the current Node.js process (colon-separated values). */ - const defaultCipherList: string; - } - interface HashOptions extends stream.TransformOptions { - /** - * For XOF hash functions such as `shake256`, the - * outputLength option can be used to specify the desired output length in bytes. - */ - outputLength?: number | undefined; - } - /** @deprecated since v10.0.0 */ - const fips: boolean; - /** - * Creates and returns a `Hash` object that can be used to generate hash digests - * using the given `algorithm`. Optional `options` argument controls stream - * behavior. For XOF hash functions such as `'shake256'`, the `outputLength` option - * can be used to specify the desired output length in bytes. - * - * The `algorithm` is dependent on the available algorithms supported by the - * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. - * On recent releases of OpenSSL, `openssl list -digest-algorithms` will - * display the available digest algorithms. - * - * Example: generating the sha256 sum of a file - * - * ```js - * import { - * createReadStream, - * } from 'node:fs'; - * import { argv } from 'node:process'; - * const { - * createHash, - * } = await import('node:crypto'); - * - * const filename = argv[2]; - * - * const hash = createHash('sha256'); - * - * const input = createReadStream(filename); - * input.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = input.read(); - * if (data) - * hash.update(data); - * else { - * console.log(`${hash.digest('hex')} ${filename}`); - * } - * }); - * ``` - * @since v0.1.92 - * @param options `stream.transform` options - */ - function createHash(algorithm: string, options?: HashOptions): Hash; - /** - * Creates and returns an `Hmac` object that uses the given `algorithm` and `key`. - * Optional `options` argument controls stream behavior. - * - * The `algorithm` is dependent on the available algorithms supported by the - * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. - * On recent releases of OpenSSL, `openssl list -digest-algorithms` will - * display the available digest algorithms. - * - * The `key` is the HMAC key used to generate the cryptographic HMAC hash. If it is - * a `KeyObject`, its type must be `secret`. If it is a string, please consider `caveats when using strings as inputs to cryptographic APIs`. If it was - * obtained from a cryptographically secure source of entropy, such as {@link randomBytes} or {@link generateKey}, its length should not - * exceed the block size of `algorithm` (e.g., 512 bits for SHA-256). - * - * Example: generating the sha256 HMAC of a file - * - * ```js - * import { - * createReadStream, - * } from 'node:fs'; - * import { argv } from 'node:process'; - * const { - * createHmac, - * } = await import('node:crypto'); - * - * const filename = argv[2]; - * - * const hmac = createHmac('sha256', 'a secret'); - * - * const input = createReadStream(filename); - * input.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = input.read(); - * if (data) - * hmac.update(data); - * else { - * console.log(`${hmac.digest('hex')} ${filename}`); - * } - * }); - * ``` - * @since v0.1.94 - * @param options `stream.transform` options - */ - function createHmac(algorithm: string, key: BinaryLike | KeyObject, options?: stream.TransformOptions): Hmac; - // https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings - type BinaryToTextEncoding = "base64" | "base64url" | "hex" | "binary"; - type CharacterEncoding = "utf8" | "utf-8" | "utf16le" | "utf-16le" | "latin1"; - type LegacyCharacterEncoding = "ascii" | "binary" | "ucs2" | "ucs-2"; - type Encoding = BinaryToTextEncoding | CharacterEncoding | LegacyCharacterEncoding; - type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid"; - /** - * The `Hash` class is a utility for creating hash digests of data. It can be - * used in one of two ways: - * - * * As a `stream` that is both readable and writable, where data is written - * to produce a computed hash digest on the readable side, or - * * Using the `hash.update()` and `hash.digest()` methods to produce the - * computed hash. - * - * The {@link createHash} method is used to create `Hash` instances. `Hash`objects are not to be created directly using the `new` keyword. - * - * Example: Using `Hash` objects as streams: - * - * ```js - * const { - * createHash, - * } = await import('node:crypto'); - * - * const hash = createHash('sha256'); - * - * hash.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = hash.read(); - * if (data) { - * console.log(data.toString('hex')); - * // Prints: - * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 - * } - * }); - * - * hash.write('some data to hash'); - * hash.end(); - * ``` - * - * Example: Using `Hash` and piped streams: - * - * ```js - * import { createReadStream } from 'node:fs'; - * import { stdout } from 'node:process'; - * const { createHash } = await import('node:crypto'); - * - * const hash = createHash('sha256'); - * - * const input = createReadStream('test.js'); - * input.pipe(hash).setEncoding('hex').pipe(stdout); - * ``` - * - * Example: Using the `hash.update()` and `hash.digest()` methods: - * - * ```js - * const { - * createHash, - * } = await import('node:crypto'); - * - * const hash = createHash('sha256'); - * - * hash.update('some data to hash'); - * console.log(hash.digest('hex')); - * // Prints: - * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 - * ``` - * @since v0.1.92 - */ - class Hash extends stream.Transform { - private constructor(); - /** - * Creates a new `Hash` object that contains a deep copy of the internal state - * of the current `Hash` object. - * - * The optional `options` argument controls stream behavior. For XOF hash - * functions such as `'shake256'`, the `outputLength` option can be used to - * specify the desired output length in bytes. - * - * An error is thrown when an attempt is made to copy the `Hash` object after - * its `hash.digest()` method has been called. - * - * ```js - * // Calculate a rolling hash. - * const { - * createHash, - * } = await import('node:crypto'); - * - * const hash = createHash('sha256'); - * - * hash.update('one'); - * console.log(hash.copy().digest('hex')); - * - * hash.update('two'); - * console.log(hash.copy().digest('hex')); - * - * hash.update('three'); - * console.log(hash.copy().digest('hex')); - * - * // Etc. - * ``` - * @since v13.1.0 - * @param options `stream.transform` options - */ - copy(options?: HashOptions): Hash; - /** - * Updates the hash content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `encoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.92 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): Hash; - update(data: string, inputEncoding: Encoding): Hash; - /** - * Calculates the digest of all of the data passed to be hashed (using the `hash.update()` method). - * If `encoding` is provided a string will be returned; otherwise - * a `Buffer` is returned. - * - * The `Hash` object can not be used again after `hash.digest()` method has been - * called. Multiple calls will cause an error to be thrown. - * @since v0.1.92 - * @param encoding The `encoding` of the return value. - */ - digest(): Buffer; - digest(encoding: BinaryToTextEncoding): string; - } - /** - * The `Hmac` class is a utility for creating cryptographic HMAC digests. It can - * be used in one of two ways: - * - * * As a `stream` that is both readable and writable, where data is written - * to produce a computed HMAC digest on the readable side, or - * * Using the `hmac.update()` and `hmac.digest()` methods to produce the - * computed HMAC digest. - * - * The {@link createHmac} method is used to create `Hmac` instances. `Hmac`objects are not to be created directly using the `new` keyword. - * - * Example: Using `Hmac` objects as streams: - * - * ```js - * const { - * createHmac, - * } = await import('node:crypto'); - * - * const hmac = createHmac('sha256', 'a secret'); - * - * hmac.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = hmac.read(); - * if (data) { - * console.log(data.toString('hex')); - * // Prints: - * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e - * } - * }); - * - * hmac.write('some data to hash'); - * hmac.end(); - * ``` - * - * Example: Using `Hmac` and piped streams: - * - * ```js - * import { createReadStream } from 'node:fs'; - * import { stdout } from 'node:process'; - * const { - * createHmac, - * } = await import('node:crypto'); - * - * const hmac = createHmac('sha256', 'a secret'); - * - * const input = createReadStream('test.js'); - * input.pipe(hmac).pipe(stdout); - * ``` - * - * Example: Using the `hmac.update()` and `hmac.digest()` methods: - * - * ```js - * const { - * createHmac, - * } = await import('node:crypto'); - * - * const hmac = createHmac('sha256', 'a secret'); - * - * hmac.update('some data to hash'); - * console.log(hmac.digest('hex')); - * // Prints: - * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e - * ``` - * @since v0.1.94 - * @deprecated Since v20.13.0 Calling `Hmac` class directly with `Hmac()` or `new Hmac()` is deprecated due to being internals, not intended for public use. Please use the {@link createHmac} method to create Hmac instances. - */ - class Hmac extends stream.Transform { - private constructor(); - /** - * Updates the `Hmac` content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `encoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.94 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): Hmac; - update(data: string, inputEncoding: Encoding): Hmac; - /** - * Calculates the HMAC digest of all of the data passed using `hmac.update()`. - * If `encoding` is - * provided a string is returned; otherwise a `Buffer` is returned; - * - * The `Hmac` object can not be used again after `hmac.digest()` has been - * called. Multiple calls to `hmac.digest()` will result in an error being thrown. - * @since v0.1.94 - * @param encoding The `encoding` of the return value. - */ - digest(): Buffer; - digest(encoding: BinaryToTextEncoding): string; - } - type KeyObjectType = "secret" | "public" | "private"; - interface KeyExportOptions { - type: "pkcs1" | "spki" | "pkcs8" | "sec1"; - format: T; - cipher?: string | undefined; - passphrase?: string | Buffer | undefined; - } - interface JwkKeyExportOptions { - format: "jwk"; - } - interface JsonWebKey { - crv?: string | undefined; - d?: string | undefined; - dp?: string | undefined; - dq?: string | undefined; - e?: string | undefined; - k?: string | undefined; - kty?: string | undefined; - n?: string | undefined; - p?: string | undefined; - q?: string | undefined; - qi?: string | undefined; - x?: string | undefined; - y?: string | undefined; - [key: string]: unknown; - } - interface AsymmetricKeyDetails { - /** - * Key size in bits (RSA, DSA). - */ - modulusLength?: number | undefined; - /** - * Public exponent (RSA). - */ - publicExponent?: bigint | undefined; - /** - * Name of the message digest (RSA-PSS). - */ - hashAlgorithm?: string | undefined; - /** - * Name of the message digest used by MGF1 (RSA-PSS). - */ - mgf1HashAlgorithm?: string | undefined; - /** - * Minimal salt length in bytes (RSA-PSS). - */ - saltLength?: number | undefined; - /** - * Size of q in bits (DSA). - */ - divisorLength?: number | undefined; - /** - * Name of the curve (EC). - */ - namedCurve?: string | undefined; - } - /** - * Node.js uses a `KeyObject` class to represent a symmetric or asymmetric key, - * and each kind of key exposes different functions. The {@link createSecretKey}, {@link createPublicKey} and {@link createPrivateKey} methods are used to create `KeyObject`instances. `KeyObject` - * objects are not to be created directly using the `new`keyword. - * - * Most applications should consider using the new `KeyObject` API instead of - * passing keys as strings or `Buffer`s due to improved security features. - * - * `KeyObject` instances can be passed to other threads via `postMessage()`. - * The receiver obtains a cloned `KeyObject`, and the `KeyObject` does not need to - * be listed in the `transferList` argument. - * @since v11.6.0 - */ - class KeyObject { - private constructor(); - /** - * Example: Converting a `CryptoKey` instance to a `KeyObject`: - * - * ```js - * const { KeyObject } = await import('node:crypto'); - * const { subtle } = globalThis.crypto; - * - * const key = await subtle.generateKey({ - * name: 'HMAC', - * hash: 'SHA-256', - * length: 256, - * }, true, ['sign', 'verify']); - * - * const keyObject = KeyObject.from(key); - * console.log(keyObject.symmetricKeySize); - * // Prints: 32 (symmetric key size in bytes) - * ``` - * @since v15.0.0 - */ - static from(key: webcrypto.CryptoKey): KeyObject; - /** - * For asymmetric keys, this property represents the type of the key. Supported key - * types are: - * - * * `'rsa'` (OID 1.2.840.113549.1.1.1) - * * `'rsa-pss'` (OID 1.2.840.113549.1.1.10) - * * `'dsa'` (OID 1.2.840.10040.4.1) - * * `'ec'` (OID 1.2.840.10045.2.1) - * * `'x25519'` (OID 1.3.101.110) - * * `'x448'` (OID 1.3.101.111) - * * `'ed25519'` (OID 1.3.101.112) - * * `'ed448'` (OID 1.3.101.113) - * * `'dh'` (OID 1.2.840.113549.1.3.1) - * - * This property is `undefined` for unrecognized `KeyObject` types and symmetric - * keys. - * @since v11.6.0 - */ - asymmetricKeyType?: KeyType | undefined; - /** - * For asymmetric keys, this property represents the size of the embedded key in - * bytes. This property is `undefined` for symmetric keys. - */ - asymmetricKeySize?: number | undefined; - /** - * This property exists only on asymmetric keys. Depending on the type of the key, - * this object contains information about the key. None of the information obtained - * through this property can be used to uniquely identify a key or to compromise - * the security of the key. - * - * For RSA-PSS keys, if the key material contains a `RSASSA-PSS-params` sequence, - * the `hashAlgorithm`, `mgf1HashAlgorithm`, and `saltLength` properties will be - * set. - * - * Other key details might be exposed via this API using additional attributes. - * @since v15.7.0 - */ - asymmetricKeyDetails?: AsymmetricKeyDetails | undefined; - /** - * For symmetric keys, the following encoding options can be used: - * - * For public keys, the following encoding options can be used: - * - * For private keys, the following encoding options can be used: - * - * The result type depends on the selected encoding format, when PEM the - * result is a string, when DER it will be a buffer containing the data - * encoded as DER, when [JWK](https://tools.ietf.org/html/rfc7517) it will be an object. - * - * When [JWK](https://tools.ietf.org/html/rfc7517) encoding format was selected, all other encoding options are - * ignored. - * - * PKCS#1, SEC1, and PKCS#8 type keys can be encrypted by using a combination of - * the `cipher` and `format` options. The PKCS#8 `type` can be used with any`format` to encrypt any key algorithm (RSA, EC, or DH) by specifying a`cipher`. PKCS#1 and SEC1 can only be - * encrypted by specifying a `cipher`when the PEM `format` is used. For maximum compatibility, use PKCS#8 for - * encrypted private keys. Since PKCS#8 defines its own - * encryption mechanism, PEM-level encryption is not supported when encrypting - * a PKCS#8 key. See [RFC 5208](https://www.rfc-editor.org/rfc/rfc5208.txt) for PKCS#8 encryption and [RFC 1421](https://www.rfc-editor.org/rfc/rfc1421.txt) for - * PKCS#1 and SEC1 encryption. - * @since v11.6.0 - */ - export(options: KeyExportOptions<"pem">): string | Buffer; - export(options?: KeyExportOptions<"der">): Buffer; - export(options?: JwkKeyExportOptions): JsonWebKey; - /** - * Returns `true` or `false` depending on whether the keys have exactly the same - * type, value, and parameters. This method is not [constant time](https://en.wikipedia.org/wiki/Timing_attack). - * @since v17.7.0, v16.15.0 - * @param otherKeyObject A `KeyObject` with which to compare `keyObject`. - */ - equals(otherKeyObject: KeyObject): boolean; - /** - * For secret keys, this property represents the size of the key in bytes. This - * property is `undefined` for asymmetric keys. - * @since v11.6.0 - */ - symmetricKeySize?: number | undefined; - /** - * Depending on the type of this `KeyObject`, this property is either`'secret'` for secret (symmetric) keys, `'public'` for public (asymmetric) keys - * or `'private'` for private (asymmetric) keys. - * @since v11.6.0 - */ - type: KeyObjectType; - } - type CipherCCMTypes = "aes-128-ccm" | "aes-192-ccm" | "aes-256-ccm" | "chacha20-poly1305"; - type CipherGCMTypes = "aes-128-gcm" | "aes-192-gcm" | "aes-256-gcm"; - type CipherOCBTypes = "aes-128-ocb" | "aes-192-ocb" | "aes-256-ocb"; - type BinaryLike = string | NodeJS.ArrayBufferView; - type CipherKey = BinaryLike | KeyObject; - interface CipherCCMOptions extends stream.TransformOptions { - authTagLength: number; - } - interface CipherGCMOptions extends stream.TransformOptions { - authTagLength?: number | undefined; - } - interface CipherOCBOptions extends stream.TransformOptions { - authTagLength: number; - } - /** - * Creates and returns a `Cipher` object, with the given `algorithm`, `key` and - * initialization vector (`iv`). - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication - * tag that will be returned by `getAuthTag()` and defaults to 16 bytes. - * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. - * - * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On - * recent OpenSSL releases, `openssl list -cipher-algorithms` will - * display the available cipher algorithms. - * - * The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded - * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be - * a `KeyObject` of type `secret`. If the cipher does not need - * an initialization vector, `iv` may be `null`. - * - * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * Initialization vectors should be unpredictable and unique; ideally, they will be - * cryptographically random. They do not have to be secret: IVs are typically just - * added to ciphertext messages unencrypted. It may sound contradictory that - * something has to be unpredictable and unique, but does not have to be secret; - * remember that an attacker must not be able to predict ahead of time what a - * given IV will be. - * @since v0.1.94 - * @param options `stream.transform` options - */ - function createCipheriv( - algorithm: CipherCCMTypes, - key: CipherKey, - iv: BinaryLike, - options: CipherCCMOptions, - ): CipherCCM; - function createCipheriv( - algorithm: CipherOCBTypes, - key: CipherKey, - iv: BinaryLike, - options: CipherOCBOptions, - ): CipherOCB; - function createCipheriv( - algorithm: CipherGCMTypes, - key: CipherKey, - iv: BinaryLike, - options?: CipherGCMOptions, - ): CipherGCM; - function createCipheriv( - algorithm: string, - key: CipherKey, - iv: BinaryLike | null, - options?: stream.TransformOptions, - ): Cipher; - /** - * Instances of the `Cipher` class are used to encrypt data. The class can be - * used in one of two ways: - * - * * As a `stream` that is both readable and writable, where plain unencrypted - * data is written to produce encrypted data on the readable side, or - * * Using the `cipher.update()` and `cipher.final()` methods to produce - * the encrypted data. - * - * The {@link createCipheriv} method is - * used to create `Cipher` instances. `Cipher` objects are not to be created - * directly using the `new` keyword. - * - * Example: Using `Cipher` objects as streams: - * - * ```js - * const { - * scrypt, - * randomFill, - * createCipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * - * // First, we'll generate the key. The key length is dependent on the algorithm. - * // In this case for aes192, it is 24 bytes (192 bits). - * scrypt(password, 'salt', 24, (err, key) => { - * if (err) throw err; - * // Then, we'll generate a random initialization vector - * randomFill(new Uint8Array(16), (err, iv) => { - * if (err) throw err; - * - * // Once we have the key and iv, we can create and use the cipher... - * const cipher = createCipheriv(algorithm, key, iv); - * - * let encrypted = ''; - * cipher.setEncoding('hex'); - * - * cipher.on('data', (chunk) => encrypted += chunk); - * cipher.on('end', () => console.log(encrypted)); - * - * cipher.write('some clear text data'); - * cipher.end(); - * }); - * }); - * ``` - * - * Example: Using `Cipher` and piped streams: - * - * ```js - * import { - * createReadStream, - * createWriteStream, - * } from 'node:fs'; - * - * import { - * pipeline, - * } from 'node:stream'; - * - * const { - * scrypt, - * randomFill, - * createCipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * - * // First, we'll generate the key. The key length is dependent on the algorithm. - * // In this case for aes192, it is 24 bytes (192 bits). - * scrypt(password, 'salt', 24, (err, key) => { - * if (err) throw err; - * // Then, we'll generate a random initialization vector - * randomFill(new Uint8Array(16), (err, iv) => { - * if (err) throw err; - * - * const cipher = createCipheriv(algorithm, key, iv); - * - * const input = createReadStream('test.js'); - * const output = createWriteStream('test.enc'); - * - * pipeline(input, cipher, output, (err) => { - * if (err) throw err; - * }); - * }); - * }); - * ``` - * - * Example: Using the `cipher.update()` and `cipher.final()` methods: - * - * ```js - * const { - * scrypt, - * randomFill, - * createCipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * - * // First, we'll generate the key. The key length is dependent on the algorithm. - * // In this case for aes192, it is 24 bytes (192 bits). - * scrypt(password, 'salt', 24, (err, key) => { - * if (err) throw err; - * // Then, we'll generate a random initialization vector - * randomFill(new Uint8Array(16), (err, iv) => { - * if (err) throw err; - * - * const cipher = createCipheriv(algorithm, key, iv); - * - * let encrypted = cipher.update('some clear text data', 'utf8', 'hex'); - * encrypted += cipher.final('hex'); - * console.log(encrypted); - * }); - * }); - * ``` - * @since v0.1.94 - */ - class Cipher extends stream.Transform { - private constructor(); - /** - * Updates the cipher with `data`. If the `inputEncoding` argument is given, - * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`, `TypedArray`, or `DataView`. If `data` is a `Buffer`, - * `TypedArray`, or `DataView`, then `inputEncoding` is ignored. - * - * The `outputEncoding` specifies the output format of the enciphered - * data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned. - * - * The `cipher.update()` method can be called multiple times with new data until `cipher.final()` is called. Calling `cipher.update()` after `cipher.final()` will result in an error being - * thrown. - * @since v0.1.94 - * @param inputEncoding The `encoding` of the data. - * @param outputEncoding The `encoding` of the return value. - */ - update(data: BinaryLike): Buffer; - update(data: string, inputEncoding: Encoding): Buffer; - update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string; - update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string; - /** - * Once the `cipher.final()` method has been called, the `Cipher` object can no - * longer be used to encrypt data. Attempts to call `cipher.final()` more than - * once will result in an error being thrown. - * @since v0.1.94 - * @param outputEncoding The `encoding` of the return value. - * @return Any remaining enciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned. - */ - final(): Buffer; - final(outputEncoding: BufferEncoding): string; - /** - * When using block encryption algorithms, the `Cipher` class will automatically - * add padding to the input data to the appropriate block size. To disable the - * default padding call `cipher.setAutoPadding(false)`. - * - * When `autoPadding` is `false`, the length of the entire input data must be a - * multiple of the cipher's block size or `cipher.final()` will throw an error. - * Disabling automatic padding is useful for non-standard padding, for instance - * using `0x0` instead of PKCS padding. - * - * The `cipher.setAutoPadding()` method must be called before `cipher.final()`. - * @since v0.7.1 - * @param [autoPadding=true] - * @return for method chaining. - */ - setAutoPadding(autoPadding?: boolean): this; - } - interface CipherCCM extends Cipher { - setAAD( - buffer: NodeJS.ArrayBufferView, - options: { - plaintextLength: number; - }, - ): this; - getAuthTag(): Buffer; - } - interface CipherGCM extends Cipher { - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - }, - ): this; - getAuthTag(): Buffer; - } - interface CipherOCB extends Cipher { - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - }, - ): this; - getAuthTag(): Buffer; - } - /** - * Creates and returns a `Decipher` object that uses the given `algorithm`, `key` and initialization vector (`iv`). - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the `authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength` option is not required but can be used to restrict accepted authentication tags - * to those with the specified length. - * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. - * - * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On - * recent OpenSSL releases, `openssl list -cipher-algorithms` will - * display the available cipher algorithms. - * - * The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded - * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be - * a `KeyObject` of type `secret`. If the cipher does not need - * an initialization vector, `iv` may be `null`. - * - * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * Initialization vectors should be unpredictable and unique; ideally, they will be - * cryptographically random. They do not have to be secret: IVs are typically just - * added to ciphertext messages unencrypted. It may sound contradictory that - * something has to be unpredictable and unique, but does not have to be secret; - * remember that an attacker must not be able to predict ahead of time what a given - * IV will be. - * @since v0.1.94 - * @param options `stream.transform` options - */ - function createDecipheriv( - algorithm: CipherCCMTypes, - key: CipherKey, - iv: BinaryLike, - options: CipherCCMOptions, - ): DecipherCCM; - function createDecipheriv( - algorithm: CipherOCBTypes, - key: CipherKey, - iv: BinaryLike, - options: CipherOCBOptions, - ): DecipherOCB; - function createDecipheriv( - algorithm: CipherGCMTypes, - key: CipherKey, - iv: BinaryLike, - options?: CipherGCMOptions, - ): DecipherGCM; - function createDecipheriv( - algorithm: string, - key: CipherKey, - iv: BinaryLike | null, - options?: stream.TransformOptions, - ): Decipher; - /** - * Instances of the `Decipher` class are used to decrypt data. The class can be - * used in one of two ways: - * - * * As a `stream` that is both readable and writable, where plain encrypted - * data is written to produce unencrypted data on the readable side, or - * * Using the `decipher.update()` and `decipher.final()` methods to - * produce the unencrypted data. - * - * The {@link createDecipheriv} method is - * used to create `Decipher` instances. `Decipher` objects are not to be created - * directly using the `new` keyword. - * - * Example: Using `Decipher` objects as streams: - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { - * scryptSync, - * createDecipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * // Key length is dependent on the algorithm. In this case for aes192, it is - * // 24 bytes (192 bits). - * // Use the async `crypto.scrypt()` instead. - * const key = scryptSync(password, 'salt', 24); - * // The IV is usually passed along with the ciphertext. - * const iv = Buffer.alloc(16, 0); // Initialization vector. - * - * const decipher = createDecipheriv(algorithm, key, iv); - * - * let decrypted = ''; - * decipher.on('readable', () => { - * let chunk; - * while (null !== (chunk = decipher.read())) { - * decrypted += chunk.toString('utf8'); - * } - * }); - * decipher.on('end', () => { - * console.log(decrypted); - * // Prints: some clear text data - * }); - * - * // Encrypted with same algorithm, key and iv. - * const encrypted = - * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa'; - * decipher.write(encrypted, 'hex'); - * decipher.end(); - * ``` - * - * Example: Using `Decipher` and piped streams: - * - * ```js - * import { - * createReadStream, - * createWriteStream, - * } from 'node:fs'; - * import { Buffer } from 'node:buffer'; - * const { - * scryptSync, - * createDecipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * // Use the async `crypto.scrypt()` instead. - * const key = scryptSync(password, 'salt', 24); - * // The IV is usually passed along with the ciphertext. - * const iv = Buffer.alloc(16, 0); // Initialization vector. - * - * const decipher = createDecipheriv(algorithm, key, iv); - * - * const input = createReadStream('test.enc'); - * const output = createWriteStream('test.js'); - * - * input.pipe(decipher).pipe(output); - * ``` - * - * Example: Using the `decipher.update()` and `decipher.final()` methods: - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { - * scryptSync, - * createDecipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * // Use the async `crypto.scrypt()` instead. - * const key = scryptSync(password, 'salt', 24); - * // The IV is usually passed along with the ciphertext. - * const iv = Buffer.alloc(16, 0); // Initialization vector. - * - * const decipher = createDecipheriv(algorithm, key, iv); - * - * // Encrypted using same algorithm, key and iv. - * const encrypted = - * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa'; - * let decrypted = decipher.update(encrypted, 'hex', 'utf8'); - * decrypted += decipher.final('utf8'); - * console.log(decrypted); - * // Prints: some clear text data - * ``` - * @since v0.1.94 - */ - class Decipher extends stream.Transform { - private constructor(); - /** - * Updates the decipher with `data`. If the `inputEncoding` argument is given, - * the `data` argument is a string using the specified encoding. If the `inputEncoding` argument is not given, `data` must be a `Buffer`. If `data` is a `Buffer` then `inputEncoding` is - * ignored. - * - * The `outputEncoding` specifies the output format of the enciphered - * data. If the `outputEncoding` is specified, a string using the specified encoding is returned. If no `outputEncoding` is provided, a `Buffer` is returned. - * - * The `decipher.update()` method can be called multiple times with new data until `decipher.final()` is called. Calling `decipher.update()` after `decipher.final()` will result in an error - * being thrown. - * @since v0.1.94 - * @param inputEncoding The `encoding` of the `data` string. - * @param outputEncoding The `encoding` of the return value. - */ - update(data: NodeJS.ArrayBufferView): Buffer; - update(data: string, inputEncoding: Encoding): Buffer; - update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string; - update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string; - /** - * Once the `decipher.final()` method has been called, the `Decipher` object can - * no longer be used to decrypt data. Attempts to call `decipher.final()` more - * than once will result in an error being thrown. - * @since v0.1.94 - * @param outputEncoding The `encoding` of the return value. - * @return Any remaining deciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned. - */ - final(): Buffer; - final(outputEncoding: BufferEncoding): string; - /** - * When data has been encrypted without standard block padding, calling `decipher.setAutoPadding(false)` will disable automatic padding to prevent `decipher.final()` from checking for and - * removing padding. - * - * Turning auto padding off will only work if the input data's length is a - * multiple of the ciphers block size. - * - * The `decipher.setAutoPadding()` method must be called before `decipher.final()`. - * @since v0.7.1 - * @param [autoPadding=true] - * @return for method chaining. - */ - setAutoPadding(auto_padding?: boolean): this; - } - interface DecipherCCM extends Decipher { - setAuthTag(buffer: NodeJS.ArrayBufferView): this; - setAAD( - buffer: NodeJS.ArrayBufferView, - options: { - plaintextLength: number; - }, - ): this; - } - interface DecipherGCM extends Decipher { - setAuthTag(buffer: NodeJS.ArrayBufferView): this; - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - }, - ): this; - } - interface DecipherOCB extends Decipher { - setAuthTag(buffer: NodeJS.ArrayBufferView): this; - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - }, - ): this; - } - interface PrivateKeyInput { - key: string | Buffer; - format?: KeyFormat | undefined; - type?: "pkcs1" | "pkcs8" | "sec1" | undefined; - passphrase?: string | Buffer | undefined; - encoding?: string | undefined; - } - interface PublicKeyInput { - key: string | Buffer; - format?: KeyFormat | undefined; - type?: "pkcs1" | "spki" | undefined; - encoding?: string | undefined; - } - /** - * Asynchronously generates a new random secret key of the given `length`. The `type` will determine which validations will be performed on the `length`. - * - * ```js - * const { - * generateKey, - * } = await import('node:crypto'); - * - * generateKey('hmac', { length: 512 }, (err, key) => { - * if (err) throw err; - * console.log(key.export().toString('hex')); // 46e..........620 - * }); - * ``` - * - * The size of a generated HMAC key should not exceed the block size of the - * underlying hash function. See {@link createHmac} for more information. - * @since v15.0.0 - * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`. - */ - function generateKey( - type: "hmac" | "aes", - options: { - length: number; - }, - callback: (err: Error | null, key: KeyObject) => void, - ): void; - /** - * Synchronously generates a new random secret key of the given `length`. The `type` will determine which validations will be performed on the `length`. - * - * ```js - * const { - * generateKeySync, - * } = await import('node:crypto'); - * - * const key = generateKeySync('hmac', { length: 512 }); - * console.log(key.export().toString('hex')); // e89..........41e - * ``` - * - * The size of a generated HMAC key should not exceed the block size of the - * underlying hash function. See {@link createHmac} for more information. - * @since v15.0.0 - * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`. - */ - function generateKeySync( - type: "hmac" | "aes", - options: { - length: number; - }, - ): KeyObject; - interface JsonWebKeyInput { - key: JsonWebKey; - format: "jwk"; - } - /** - * Creates and returns a new key object containing a private key. If `key` is a - * string or `Buffer`, `format` is assumed to be `'pem'`; otherwise, `key` must be an object with the properties described above. - * - * If the private key is encrypted, a `passphrase` must be specified. The length - * of the passphrase is limited to 1024 bytes. - * @since v11.6.0 - */ - function createPrivateKey(key: PrivateKeyInput | string | Buffer | JsonWebKeyInput): KeyObject; - /** - * Creates and returns a new key object containing a public key. If `key` is a - * string or `Buffer`, `format` is assumed to be `'pem'`; if `key` is a `KeyObject` with type `'private'`, the public key is derived from the given private key; - * otherwise, `key` must be an object with the properties described above. - * - * If the format is `'pem'`, the `'key'` may also be an X.509 certificate. - * - * Because public keys can be derived from private keys, a private key may be - * passed instead of a public key. In that case, this function behaves as if {@link createPrivateKey} had been called, except that the type of the - * returned `KeyObject` will be `'public'` and that the private key cannot be - * extracted from the returned `KeyObject`. Similarly, if a `KeyObject` with type `'private'` is given, a new `KeyObject` with type `'public'` will be returned - * and it will be impossible to extract the private key from the returned object. - * @since v11.6.0 - */ - function createPublicKey(key: PublicKeyInput | string | Buffer | KeyObject | JsonWebKeyInput): KeyObject; - /** - * Creates and returns a new key object containing a secret key for symmetric - * encryption or `Hmac`. - * @since v11.6.0 - * @param encoding The string encoding when `key` is a string. - */ - function createSecretKey(key: NodeJS.ArrayBufferView): KeyObject; - function createSecretKey(key: string, encoding: BufferEncoding): KeyObject; - /** - * Creates and returns a `Sign` object that uses the given `algorithm`. Use {@link getHashes} to obtain the names of the available digest algorithms. - * Optional `options` argument controls the `stream.Writable` behavior. - * - * In some cases, a `Sign` instance can be created using the name of a signature - * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use - * the corresponding digest algorithm. This does not work for all signature - * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest - * algorithm names. - * @since v0.1.92 - * @param options `stream.Writable` options - */ - function createSign(algorithm: string, options?: stream.WritableOptions): Sign; - type DSAEncoding = "der" | "ieee-p1363"; - interface SigningOptions { - /** - * @see crypto.constants.RSA_PKCS1_PADDING - */ - padding?: number | undefined; - saltLength?: number | undefined; - dsaEncoding?: DSAEncoding | undefined; - } - interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {} - interface SignKeyObjectInput extends SigningOptions { - key: KeyObject; - } - interface SignJsonWebKeyInput extends JsonWebKeyInput, SigningOptions {} - interface VerifyPublicKeyInput extends PublicKeyInput, SigningOptions {} - interface VerifyKeyObjectInput extends SigningOptions { - key: KeyObject; - } - interface VerifyJsonWebKeyInput extends JsonWebKeyInput, SigningOptions {} - type KeyLike = string | Buffer | KeyObject; - /** - * The `Sign` class is a utility for generating signatures. It can be used in one - * of two ways: - * - * * As a writable `stream`, where data to be signed is written and the `sign.sign()` method is used to generate and return the signature, or - * * Using the `sign.update()` and `sign.sign()` methods to produce the - * signature. - * - * The {@link createSign} method is used to create `Sign` instances. The - * argument is the string name of the hash function to use. `Sign` objects are not - * to be created directly using the `new` keyword. - * - * Example: Using `Sign` and `Verify` objects as streams: - * - * ```js - * const { - * generateKeyPairSync, - * createSign, - * createVerify, - * } = await import('node:crypto'); - * - * const { privateKey, publicKey } = generateKeyPairSync('ec', { - * namedCurve: 'sect239k1', - * }); - * - * const sign = createSign('SHA256'); - * sign.write('some data to sign'); - * sign.end(); - * const signature = sign.sign(privateKey, 'hex'); - * - * const verify = createVerify('SHA256'); - * verify.write('some data to sign'); - * verify.end(); - * console.log(verify.verify(publicKey, signature, 'hex')); - * // Prints: true - * ``` - * - * Example: Using the `sign.update()` and `verify.update()` methods: - * - * ```js - * const { - * generateKeyPairSync, - * createSign, - * createVerify, - * } = await import('node:crypto'); - * - * const { privateKey, publicKey } = generateKeyPairSync('rsa', { - * modulusLength: 2048, - * }); - * - * const sign = createSign('SHA256'); - * sign.update('some data to sign'); - * sign.end(); - * const signature = sign.sign(privateKey); - * - * const verify = createVerify('SHA256'); - * verify.update('some data to sign'); - * verify.end(); - * console.log(verify.verify(publicKey, signature)); - * // Prints: true - * ``` - * @since v0.1.92 - */ - class Sign extends stream.Writable { - private constructor(); - /** - * Updates the `Sign` content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `encoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.92 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): this; - update(data: string, inputEncoding: Encoding): this; - /** - * Calculates the signature on all the data passed through using either `sign.update()` or `sign.write()`. - * - * If `privateKey` is not a `KeyObject`, this function behaves as if `privateKey` had been passed to {@link createPrivateKey}. If it is an - * object, the following additional properties can be passed: - * - * If `outputEncoding` is provided a string is returned; otherwise a `Buffer` is returned. - * - * The `Sign` object can not be again used after `sign.sign()` method has been - * called. Multiple calls to `sign.sign()` will result in an error being thrown. - * @since v0.1.92 - */ - sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput): Buffer; - sign( - privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput, - outputFormat: BinaryToTextEncoding, - ): string; - } - /** - * Creates and returns a `Verify` object that uses the given algorithm. - * Use {@link getHashes} to obtain an array of names of the available - * signing algorithms. Optional `options` argument controls the `stream.Writable` behavior. - * - * In some cases, a `Verify` instance can be created using the name of a signature - * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use - * the corresponding digest algorithm. This does not work for all signature - * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest - * algorithm names. - * @since v0.1.92 - * @param options `stream.Writable` options - */ - function createVerify(algorithm: string, options?: stream.WritableOptions): Verify; - /** - * The `Verify` class is a utility for verifying signatures. It can be used in one - * of two ways: - * - * * As a writable `stream` where written data is used to validate against the - * supplied signature, or - * * Using the `verify.update()` and `verify.verify()` methods to verify - * the signature. - * - * The {@link createVerify} method is used to create `Verify` instances. `Verify` objects are not to be created directly using the `new` keyword. - * - * See `Sign` for examples. - * @since v0.1.92 - */ - class Verify extends stream.Writable { - private constructor(); - /** - * Updates the `Verify` content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `inputEncoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or `DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.92 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): Verify; - update(data: string, inputEncoding: Encoding): Verify; - /** - * Verifies the provided data using the given `object` and `signature`. - * - * If `object` is not a `KeyObject`, this function behaves as if `object` had been passed to {@link createPublicKey}. If it is an - * object, the following additional properties can be passed: - * - * The `signature` argument is the previously calculated signature for the data, in - * the `signatureEncoding`. - * If a `signatureEncoding` is specified, the `signature` is expected to be a - * string; otherwise `signature` is expected to be a `Buffer`, `TypedArray`, or `DataView`. - * - * The `verify` object can not be used again after `verify.verify()` has been - * called. Multiple calls to `verify.verify()` will result in an error being - * thrown. - * - * Because public keys can be derived from private keys, a private key may - * be passed instead of a public key. - * @since v0.1.92 - */ - verify( - object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, - signature: NodeJS.ArrayBufferView, - ): boolean; - verify( - object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, - signature: string, - signature_format?: BinaryToTextEncoding, - ): boolean; - } - /** - * Creates a `DiffieHellman` key exchange object using the supplied `prime` and an - * optional specific `generator`. - * - * The `generator` argument can be a number, string, or `Buffer`. If `generator` is not specified, the value `2` is used. - * - * If `primeEncoding` is specified, `prime` is expected to be a string; otherwise - * a `Buffer`, `TypedArray`, or `DataView` is expected. - * - * If `generatorEncoding` is specified, `generator` is expected to be a string; - * otherwise a number, `Buffer`, `TypedArray`, or `DataView` is expected. - * @since v0.11.12 - * @param primeEncoding The `encoding` of the `prime` string. - * @param [generator=2] - * @param generatorEncoding The `encoding` of the `generator` string. - */ - function createDiffieHellman(primeLength: number, generator?: number): DiffieHellman; - function createDiffieHellman( - prime: ArrayBuffer | NodeJS.ArrayBufferView, - generator?: number | ArrayBuffer | NodeJS.ArrayBufferView, - ): DiffieHellman; - function createDiffieHellman( - prime: ArrayBuffer | NodeJS.ArrayBufferView, - generator: string, - generatorEncoding: BinaryToTextEncoding, - ): DiffieHellman; - function createDiffieHellman( - prime: string, - primeEncoding: BinaryToTextEncoding, - generator?: number | ArrayBuffer | NodeJS.ArrayBufferView, - ): DiffieHellman; - function createDiffieHellman( - prime: string, - primeEncoding: BinaryToTextEncoding, - generator: string, - generatorEncoding: BinaryToTextEncoding, - ): DiffieHellman; - /** - * The `DiffieHellman` class is a utility for creating Diffie-Hellman key - * exchanges. - * - * Instances of the `DiffieHellman` class can be created using the {@link createDiffieHellman} function. - * - * ```js - * import assert from 'node:assert'; - * - * const { - * createDiffieHellman, - * } = await import('node:crypto'); - * - * // Generate Alice's keys... - * const alice = createDiffieHellman(2048); - * const aliceKey = alice.generateKeys(); - * - * // Generate Bob's keys... - * const bob = createDiffieHellman(alice.getPrime(), alice.getGenerator()); - * const bobKey = bob.generateKeys(); - * - * // Exchange and generate the secret... - * const aliceSecret = alice.computeSecret(bobKey); - * const bobSecret = bob.computeSecret(aliceKey); - * - * // OK - * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); - * ``` - * @since v0.5.0 - */ - class DiffieHellman { - private constructor(); - /** - * Generates private and public Diffie-Hellman key values unless they have been - * generated or computed already, and returns - * the public key in the specified `encoding`. This key should be - * transferred to the other party. - * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned. - * - * This function is a thin wrapper around [`DH_generate_key()`](https://www.openssl.org/docs/man3.0/man3/DH_generate_key.html). In particular, - * once a private key has been generated or set, calling this function only updates - * the public key but does not generate a new private key. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - generateKeys(): Buffer; - generateKeys(encoding: BinaryToTextEncoding): string; - /** - * Computes the shared secret using `otherPublicKey` as the other - * party's public key and returns the computed shared secret. The supplied - * key is interpreted using the specified `inputEncoding`, and secret is - * encoded using specified `outputEncoding`. - * If the `inputEncoding` is not - * provided, `otherPublicKey` is expected to be a `Buffer`, `TypedArray`, or `DataView`. - * - * If `outputEncoding` is given a string is returned; otherwise, a `Buffer` is returned. - * @since v0.5.0 - * @param inputEncoding The `encoding` of an `otherPublicKey` string. - * @param outputEncoding The `encoding` of the return value. - */ - computeSecret(otherPublicKey: NodeJS.ArrayBufferView, inputEncoding?: null, outputEncoding?: null): Buffer; - computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding?: null): Buffer; - computeSecret( - otherPublicKey: NodeJS.ArrayBufferView, - inputEncoding: null, - outputEncoding: BinaryToTextEncoding, - ): string; - computeSecret( - otherPublicKey: string, - inputEncoding: BinaryToTextEncoding, - outputEncoding: BinaryToTextEncoding, - ): string; - /** - * Returns the Diffie-Hellman prime in the specified `encoding`. - * If `encoding` is provided a string is - * returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getPrime(): Buffer; - getPrime(encoding: BinaryToTextEncoding): string; - /** - * Returns the Diffie-Hellman generator in the specified `encoding`. - * If `encoding` is provided a string is - * returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getGenerator(): Buffer; - getGenerator(encoding: BinaryToTextEncoding): string; - /** - * Returns the Diffie-Hellman public key in the specified `encoding`. - * If `encoding` is provided a - * string is returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getPublicKey(): Buffer; - getPublicKey(encoding: BinaryToTextEncoding): string; - /** - * Returns the Diffie-Hellman private key in the specified `encoding`. - * If `encoding` is provided a - * string is returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getPrivateKey(): Buffer; - getPrivateKey(encoding: BinaryToTextEncoding): string; - /** - * Sets the Diffie-Hellman public key. If the `encoding` argument is provided, `publicKey` is expected - * to be a string. If no `encoding` is provided, `publicKey` is expected - * to be a `Buffer`, `TypedArray`, or `DataView`. - * @since v0.5.0 - * @param encoding The `encoding` of the `publicKey` string. - */ - setPublicKey(publicKey: NodeJS.ArrayBufferView): void; - setPublicKey(publicKey: string, encoding: BufferEncoding): void; - /** - * Sets the Diffie-Hellman private key. If the `encoding` argument is provided,`privateKey` is expected - * to be a string. If no `encoding` is provided, `privateKey` is expected - * to be a `Buffer`, `TypedArray`, or `DataView`. - * - * This function does not automatically compute the associated public key. Either `diffieHellman.setPublicKey()` or `diffieHellman.generateKeys()` can be - * used to manually provide the public key or to automatically derive it. - * @since v0.5.0 - * @param encoding The `encoding` of the `privateKey` string. - */ - setPrivateKey(privateKey: NodeJS.ArrayBufferView): void; - setPrivateKey(privateKey: string, encoding: BufferEncoding): void; - /** - * A bit field containing any warnings and/or errors resulting from a check - * performed during initialization of the `DiffieHellman` object. - * - * The following values are valid for this property (as defined in `node:constants` module): - * - * * `DH_CHECK_P_NOT_SAFE_PRIME` - * * `DH_CHECK_P_NOT_PRIME` - * * `DH_UNABLE_TO_CHECK_GENERATOR` - * * `DH_NOT_SUITABLE_GENERATOR` - * @since v0.11.12 - */ - verifyError: number; - } - /** - * The `DiffieHellmanGroup` class takes a well-known modp group as its argument. - * It works the same as `DiffieHellman`, except that it does not allow changing its keys after creation. - * In other words, it does not implement `setPublicKey()` or `setPrivateKey()` methods. - * - * ```js - * const { createDiffieHellmanGroup } = await import('node:crypto'); - * const dh = createDiffieHellmanGroup('modp1'); - * ``` - * The name (e.g. `'modp1'`) is taken from [RFC 2412](https://www.rfc-editor.org/rfc/rfc2412.txt) (modp1 and 2) and [RFC 3526](https://www.rfc-editor.org/rfc/rfc3526.txt): - * ```bash - * $ perl -ne 'print "$1\n" if /"(modp\d+)"/' src/node_crypto_groups.h - * modp1 # 768 bits - * modp2 # 1024 bits - * modp5 # 1536 bits - * modp14 # 2048 bits - * modp15 # etc. - * modp16 - * modp17 - * modp18 - * ``` - * @since v0.7.5 - */ - const DiffieHellmanGroup: DiffieHellmanGroupConstructor; - interface DiffieHellmanGroupConstructor { - new(name: string): DiffieHellmanGroup; - (name: string): DiffieHellmanGroup; - readonly prototype: DiffieHellmanGroup; - } - type DiffieHellmanGroup = Omit; - /** - * Creates a predefined `DiffieHellmanGroup` key exchange object. The - * supported groups are listed in the documentation for `DiffieHellmanGroup`. - * - * The returned object mimics the interface of objects created by {@link createDiffieHellman}, but will not allow changing - * the keys (with `diffieHellman.setPublicKey()`, for example). The - * advantage of using this method is that the parties do not have to - * generate nor exchange a group modulus beforehand, saving both processor - * and communication time. - * - * Example (obtaining a shared secret): - * - * ```js - * const { - * getDiffieHellman, - * } = await import('node:crypto'); - * const alice = getDiffieHellman('modp14'); - * const bob = getDiffieHellman('modp14'); - * - * alice.generateKeys(); - * bob.generateKeys(); - * - * const aliceSecret = alice.computeSecret(bob.getPublicKey(), null, 'hex'); - * const bobSecret = bob.computeSecret(alice.getPublicKey(), null, 'hex'); - * - * // aliceSecret and bobSecret should be the same - * console.log(aliceSecret === bobSecret); - * ``` - * @since v0.7.5 - */ - function getDiffieHellman(groupName: string): DiffieHellmanGroup; - /** - * An alias for {@link getDiffieHellman} - * @since v0.9.3 - */ - function createDiffieHellmanGroup(name: string): DiffieHellmanGroup; - /** - * Provides an asynchronous Password-Based Key Derivation Function 2 (PBKDF2) - * implementation. A selected HMAC digest algorithm specified by `digest` is - * applied to derive a key of the requested byte length (`keylen`) from the `password`, `salt` and `iterations`. - * - * The supplied `callback` function is called with two arguments: `err` and `derivedKey`. If an error occurs while deriving the key, `err` will be set; - * otherwise `err` will be `null`. By default, the successfully generated `derivedKey` will be passed to the callback as a `Buffer`. An error will be - * thrown if any of the input arguments specify invalid values or types. - * - * The `iterations` argument must be a number set as high as possible. The - * higher the number of iterations, the more secure the derived key will be, - * but will take a longer amount of time to complete. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * ```js - * const { - * pbkdf2, - * } = await import('node:crypto'); - * - * pbkdf2('secret', 'salt', 100000, 64, 'sha512', (err, derivedKey) => { - * if (err) throw err; - * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae' - * }); - * ``` - * - * An array of supported digest functions can be retrieved using {@link getHashes}. - * - * This API uses libuv's threadpool, which can have surprising and - * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. - * @since v0.5.5 - */ - function pbkdf2( - password: BinaryLike, - salt: BinaryLike, - iterations: number, - keylen: number, - digest: string, - callback: (err: Error | null, derivedKey: Buffer) => void, - ): void; - /** - * Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2) - * implementation. A selected HMAC digest algorithm specified by `digest` is - * applied to derive a key of the requested byte length (`keylen`) from the `password`, `salt` and `iterations`. - * - * If an error occurs an `Error` will be thrown, otherwise the derived key will be - * returned as a `Buffer`. - * - * The `iterations` argument must be a number set as high as possible. The - * higher the number of iterations, the more secure the derived key will be, - * but will take a longer amount of time to complete. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * ```js - * const { - * pbkdf2Sync, - * } = await import('node:crypto'); - * - * const key = pbkdf2Sync('secret', 'salt', 100000, 64, 'sha512'); - * console.log(key.toString('hex')); // '3745e48...08d59ae' - * ``` - * - * An array of supported digest functions can be retrieved using {@link getHashes}. - * @since v0.9.3 - */ - function pbkdf2Sync( - password: BinaryLike, - salt: BinaryLike, - iterations: number, - keylen: number, - digest: string, - ): Buffer; - /** - * Generates cryptographically strong pseudorandom data. The `size` argument - * is a number indicating the number of bytes to generate. - * - * If a `callback` function is provided, the bytes are generated asynchronously - * and the `callback` function is invoked with two arguments: `err` and `buf`. - * If an error occurs, `err` will be an `Error` object; otherwise it is `null`. The `buf` argument is a `Buffer` containing the generated bytes. - * - * ```js - * // Asynchronous - * const { - * randomBytes, - * } = await import('node:crypto'); - * - * randomBytes(256, (err, buf) => { - * if (err) throw err; - * console.log(`${buf.length} bytes of random data: ${buf.toString('hex')}`); - * }); - * ``` - * - * If the `callback` function is not provided, the random bytes are generated - * synchronously and returned as a `Buffer`. An error will be thrown if - * there is a problem generating the bytes. - * - * ```js - * // Synchronous - * const { - * randomBytes, - * } = await import('node:crypto'); - * - * const buf = randomBytes(256); - * console.log( - * `${buf.length} bytes of random data: ${buf.toString('hex')}`); - * ``` - * - * The `crypto.randomBytes()` method will not complete until there is - * sufficient entropy available. - * This should normally never take longer than a few milliseconds. The only time - * when generating the random bytes may conceivably block for a longer period of - * time is right after boot, when the whole system is still low on entropy. - * - * This API uses libuv's threadpool, which can have surprising and - * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. - * - * The asynchronous version of `crypto.randomBytes()` is carried out in a single - * threadpool request. To minimize threadpool task length variation, partition - * large `randomBytes` requests when doing so as part of fulfilling a client - * request. - * @since v0.5.8 - * @param size The number of bytes to generate. The `size` must not be larger than `2**31 - 1`. - * @return if the `callback` function is not provided. - */ - function randomBytes(size: number): Buffer; - function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void; - function pseudoRandomBytes(size: number): Buffer; - function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void; - /** - * Return a random integer `n` such that `min <= n < max`. This - * implementation avoids [modulo bias](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#Modulo_bias). - * - * The range (`max - min`) must be less than 2**48. `min` and `max` must - * be [safe integers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger). - * - * If the `callback` function is not provided, the random integer is - * generated synchronously. - * - * ```js - * // Asynchronous - * const { - * randomInt, - * } = await import('node:crypto'); - * - * randomInt(3, (err, n) => { - * if (err) throw err; - * console.log(`Random number chosen from (0, 1, 2): ${n}`); - * }); - * ``` - * - * ```js - * // Synchronous - * const { - * randomInt, - * } = await import('node:crypto'); - * - * const n = randomInt(3); - * console.log(`Random number chosen from (0, 1, 2): ${n}`); - * ``` - * - * ```js - * // With `min` argument - * const { - * randomInt, - * } = await import('node:crypto'); - * - * const n = randomInt(1, 7); - * console.log(`The dice rolled: ${n}`); - * ``` - * @since v14.10.0, v12.19.0 - * @param [min=0] Start of random range (inclusive). - * @param max End of random range (exclusive). - * @param callback `function(err, n) {}`. - */ - function randomInt(max: number): number; - function randomInt(min: number, max: number): number; - function randomInt(max: number, callback: (err: Error | null, value: number) => void): void; - function randomInt(min: number, max: number, callback: (err: Error | null, value: number) => void): void; - /** - * Synchronous version of {@link randomFill}. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { randomFillSync } = await import('node:crypto'); - * - * const buf = Buffer.alloc(10); - * console.log(randomFillSync(buf).toString('hex')); - * - * randomFillSync(buf, 5); - * console.log(buf.toString('hex')); - * - * // The above is equivalent to the following: - * randomFillSync(buf, 5, 5); - * console.log(buf.toString('hex')); - * ``` - * - * Any `ArrayBuffer`, `TypedArray` or `DataView` instance may be passed as`buffer`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { randomFillSync } = await import('node:crypto'); - * - * const a = new Uint32Array(10); - * console.log(Buffer.from(randomFillSync(a).buffer, - * a.byteOffset, a.byteLength).toString('hex')); - * - * const b = new DataView(new ArrayBuffer(10)); - * console.log(Buffer.from(randomFillSync(b).buffer, - * b.byteOffset, b.byteLength).toString('hex')); - * - * const c = new ArrayBuffer(10); - * console.log(Buffer.from(randomFillSync(c)).toString('hex')); - * ``` - * @since v7.10.0, v6.13.0 - * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`. - * @param [offset=0] - * @param [size=buffer.length - offset] - * @return The object passed as `buffer` argument. - */ - function randomFillSync(buffer: T, offset?: number, size?: number): T; - /** - * This function is similar to {@link randomBytes} but requires the first - * argument to be a `Buffer` that will be filled. It also - * requires that a callback is passed in. - * - * If the `callback` function is not provided, an error will be thrown. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { randomFill } = await import('node:crypto'); - * - * const buf = Buffer.alloc(10); - * randomFill(buf, (err, buf) => { - * if (err) throw err; - * console.log(buf.toString('hex')); - * }); - * - * randomFill(buf, 5, (err, buf) => { - * if (err) throw err; - * console.log(buf.toString('hex')); - * }); - * - * // The above is equivalent to the following: - * randomFill(buf, 5, 5, (err, buf) => { - * if (err) throw err; - * console.log(buf.toString('hex')); - * }); - * ``` - * - * Any `ArrayBuffer`, `TypedArray`, or `DataView` instance may be passed as `buffer`. - * - * While this includes instances of `Float32Array` and `Float64Array`, this - * function should not be used to generate random floating-point numbers. The - * result may contain `+Infinity`, `-Infinity`, and `NaN`, and even if the array - * contains finite numbers only, they are not drawn from a uniform random - * distribution and have no meaningful lower or upper bounds. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { randomFill } = await import('node:crypto'); - * - * const a = new Uint32Array(10); - * randomFill(a, (err, buf) => { - * if (err) throw err; - * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength) - * .toString('hex')); - * }); - * - * const b = new DataView(new ArrayBuffer(10)); - * randomFill(b, (err, buf) => { - * if (err) throw err; - * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength) - * .toString('hex')); - * }); - * - * const c = new ArrayBuffer(10); - * randomFill(c, (err, buf) => { - * if (err) throw err; - * console.log(Buffer.from(buf).toString('hex')); - * }); - * ``` - * - * This API uses libuv's threadpool, which can have surprising and - * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. - * - * The asynchronous version of `crypto.randomFill()` is carried out in a single - * threadpool request. To minimize threadpool task length variation, partition - * large `randomFill` requests when doing so as part of fulfilling a client - * request. - * @since v7.10.0, v6.13.0 - * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`. - * @param [offset=0] - * @param [size=buffer.length - offset] - * @param callback `function(err, buf) {}`. - */ - function randomFill( - buffer: T, - callback: (err: Error | null, buf: T) => void, - ): void; - function randomFill( - buffer: T, - offset: number, - callback: (err: Error | null, buf: T) => void, - ): void; - function randomFill( - buffer: T, - offset: number, - size: number, - callback: (err: Error | null, buf: T) => void, - ): void; - interface ScryptOptions { - cost?: number | undefined; - blockSize?: number | undefined; - parallelization?: number | undefined; - N?: number | undefined; - r?: number | undefined; - p?: number | undefined; - maxmem?: number | undefined; - } - /** - * Provides an asynchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based - * key derivation function that is designed to be expensive computationally and - * memory-wise in order to make brute-force attacks unrewarding. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * The `callback` function is called with two arguments: `err` and `derivedKey`. `err` is an exception object when key derivation fails, otherwise `err` is `null`. `derivedKey` is passed to the - * callback as a `Buffer`. - * - * An exception is thrown when any of the input arguments specify invalid values - * or types. - * - * ```js - * const { - * scrypt, - * } = await import('node:crypto'); - * - * // Using the factory defaults. - * scrypt('password', 'salt', 64, (err, derivedKey) => { - * if (err) throw err; - * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae' - * }); - * // Using a custom N parameter. Must be a power of two. - * scrypt('password', 'salt', 64, { N: 1024 }, (err, derivedKey) => { - * if (err) throw err; - * console.log(derivedKey.toString('hex')); // '3745e48...aa39b34' - * }); - * ``` - * @since v10.5.0 - */ - function scrypt( - password: BinaryLike, - salt: BinaryLike, - keylen: number, - callback: (err: Error | null, derivedKey: Buffer) => void, - ): void; - function scrypt( - password: BinaryLike, - salt: BinaryLike, - keylen: number, - options: ScryptOptions, - callback: (err: Error | null, derivedKey: Buffer) => void, - ): void; - /** - * Provides a synchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based - * key derivation function that is designed to be expensive computationally and - * memory-wise in order to make brute-force attacks unrewarding. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * An exception is thrown when key derivation fails, otherwise the derived key is - * returned as a `Buffer`. - * - * An exception is thrown when any of the input arguments specify invalid values - * or types. - * - * ```js - * const { - * scryptSync, - * } = await import('node:crypto'); - * // Using the factory defaults. - * - * const key1 = scryptSync('password', 'salt', 64); - * console.log(key1.toString('hex')); // '3745e48...08d59ae' - * // Using a custom N parameter. Must be a power of two. - * const key2 = scryptSync('password', 'salt', 64, { N: 1024 }); - * console.log(key2.toString('hex')); // '3745e48...aa39b34' - * ``` - * @since v10.5.0 - */ - function scryptSync(password: BinaryLike, salt: BinaryLike, keylen: number, options?: ScryptOptions): Buffer; - interface RsaPublicKey { - key: KeyLike; - padding?: number | undefined; - } - interface RsaPrivateKey { - key: KeyLike; - passphrase?: string | undefined; - /** - * @default 'sha1' - */ - oaepHash?: string | undefined; - oaepLabel?: NodeJS.TypedArray | undefined; - padding?: number | undefined; - } - /** - * Encrypts the content of `buffer` with `key` and returns a new `Buffer` with encrypted content. The returned data can be decrypted using - * the corresponding private key, for example using {@link privateDecrypt}. - * - * If `key` is not a `KeyObject`, this function behaves as if `key` had been passed to {@link createPublicKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_OAEP_PADDING`. - * - * Because RSA public keys can be derived from private keys, a private key may - * be passed instead of a public key. - * @since v0.11.14 - */ - function publicEncrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * Decrypts `buffer` with `key`.`buffer` was previously encrypted using - * the corresponding private key, for example using {@link privateEncrypt}. - * - * If `key` is not a `KeyObject`, this function behaves as if `key` had been passed to {@link createPublicKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_PADDING`. - * - * Because RSA public keys can be derived from private keys, a private key may - * be passed instead of a public key. - * @since v1.1.0 - */ - function publicDecrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * Decrypts `buffer` with `privateKey`. `buffer` was previously encrypted using - * the corresponding public key, for example using {@link publicEncrypt}. - * - * If `privateKey` is not a `KeyObject`, this function behaves as if `privateKey` had been passed to {@link createPrivateKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_OAEP_PADDING`. - * @since v0.11.14 - */ - function privateDecrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * Encrypts `buffer` with `privateKey`. The returned data can be decrypted using - * the corresponding public key, for example using {@link publicDecrypt}. - * - * If `privateKey` is not a `KeyObject`, this function behaves as if `privateKey` had been passed to {@link createPrivateKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_PADDING`. - * @since v1.1.0 - */ - function privateEncrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * ```js - * const { - * getCiphers, - * } = await import('node:crypto'); - * - * console.log(getCiphers()); // ['aes-128-cbc', 'aes-128-ccm', ...] - * ``` - * @since v0.9.3 - * @return An array with the names of the supported cipher algorithms. - */ - function getCiphers(): string[]; - /** - * ```js - * const { - * getCurves, - * } = await import('node:crypto'); - * - * console.log(getCurves()); // ['Oakley-EC2N-3', 'Oakley-EC2N-4', ...] - * ``` - * @since v2.3.0 - * @return An array with the names of the supported elliptic curves. - */ - function getCurves(): string[]; - /** - * @since v10.0.0 - * @return `1` if and only if a FIPS compliant crypto provider is currently in use, `0` otherwise. A future semver-major release may change the return type of this API to a {boolean}. - */ - function getFips(): 1 | 0; - /** - * Enables the FIPS compliant crypto provider in a FIPS-enabled Node.js build. - * Throws an error if FIPS mode is not available. - * @since v10.0.0 - * @param bool `true` to enable FIPS mode. - */ - function setFips(bool: boolean): void; - /** - * ```js - * const { - * getHashes, - * } = await import('node:crypto'); - * - * console.log(getHashes()); // ['DSA', 'DSA-SHA', 'DSA-SHA1', ...] - * ``` - * @since v0.9.3 - * @return An array of the names of the supported hash algorithms, such as `'RSA-SHA256'`. Hash algorithms are also called "digest" algorithms. - */ - function getHashes(): string[]; - /** - * The `ECDH` class is a utility for creating Elliptic Curve Diffie-Hellman (ECDH) - * key exchanges. - * - * Instances of the `ECDH` class can be created using the {@link createECDH} function. - * - * ```js - * import assert from 'node:assert'; - * - * const { - * createECDH, - * } = await import('node:crypto'); - * - * // Generate Alice's keys... - * const alice = createECDH('secp521r1'); - * const aliceKey = alice.generateKeys(); - * - * // Generate Bob's keys... - * const bob = createECDH('secp521r1'); - * const bobKey = bob.generateKeys(); - * - * // Exchange and generate the secret... - * const aliceSecret = alice.computeSecret(bobKey); - * const bobSecret = bob.computeSecret(aliceKey); - * - * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); - * // OK - * ``` - * @since v0.11.14 - */ - class ECDH { - private constructor(); - /** - * Converts the EC Diffie-Hellman public key specified by `key` and `curve` to the - * format specified by `format`. The `format` argument specifies point encoding - * and can be `'compressed'`, `'uncompressed'` or `'hybrid'`. The supplied key is - * interpreted using the specified `inputEncoding`, and the returned key is encoded - * using the specified `outputEncoding`. - * - * Use {@link getCurves} to obtain a list of available curve names. - * On recent OpenSSL releases, `openssl ecparam -list_curves` will also display - * the name and description of each available elliptic curve. - * - * If `format` is not specified the point will be returned in `'uncompressed'` format. - * - * If the `inputEncoding` is not provided, `key` is expected to be a `Buffer`, `TypedArray`, or `DataView`. - * - * Example (uncompressing a key): - * - * ```js - * const { - * createECDH, - * ECDH, - * } = await import('node:crypto'); - * - * const ecdh = createECDH('secp256k1'); - * ecdh.generateKeys(); - * - * const compressedKey = ecdh.getPublicKey('hex', 'compressed'); - * - * const uncompressedKey = ECDH.convertKey(compressedKey, - * 'secp256k1', - * 'hex', - * 'hex', - * 'uncompressed'); - * - * // The converted key and the uncompressed public key should be the same - * console.log(uncompressedKey === ecdh.getPublicKey('hex')); - * ``` - * @since v10.0.0 - * @param inputEncoding The `encoding` of the `key` string. - * @param outputEncoding The `encoding` of the return value. - * @param [format='uncompressed'] - */ - static convertKey( - key: BinaryLike, - curve: string, - inputEncoding?: BinaryToTextEncoding, - outputEncoding?: "latin1" | "hex" | "base64" | "base64url", - format?: "uncompressed" | "compressed" | "hybrid", - ): Buffer | string; - /** - * Generates private and public EC Diffie-Hellman key values, and returns - * the public key in the specified `format` and `encoding`. This key should be - * transferred to the other party. - * - * The `format` argument specifies point encoding and can be `'compressed'` or `'uncompressed'`. If `format` is not specified, the point will be returned in`'uncompressed'` format. - * - * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned. - * @since v0.11.14 - * @param encoding The `encoding` of the return value. - * @param [format='uncompressed'] - */ - generateKeys(): Buffer; - generateKeys(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string; - /** - * Computes the shared secret using `otherPublicKey` as the other - * party's public key and returns the computed shared secret. The supplied - * key is interpreted using specified `inputEncoding`, and the returned secret - * is encoded using the specified `outputEncoding`. - * If the `inputEncoding` is not - * provided, `otherPublicKey` is expected to be a `Buffer`, `TypedArray`, or `DataView`. - * - * If `outputEncoding` is given a string will be returned; otherwise a `Buffer` is returned. - * - * `ecdh.computeSecret` will throw an`ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY` error when `otherPublicKey` lies outside of the elliptic curve. Since `otherPublicKey` is - * usually supplied from a remote user over an insecure network, - * be sure to handle this exception accordingly. - * @since v0.11.14 - * @param inputEncoding The `encoding` of the `otherPublicKey` string. - * @param outputEncoding The `encoding` of the return value. - */ - computeSecret(otherPublicKey: NodeJS.ArrayBufferView): Buffer; - computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): Buffer; - computeSecret(otherPublicKey: NodeJS.ArrayBufferView, outputEncoding: BinaryToTextEncoding): string; - computeSecret( - otherPublicKey: string, - inputEncoding: BinaryToTextEncoding, - outputEncoding: BinaryToTextEncoding, - ): string; - /** - * If `encoding` is specified, a string is returned; otherwise a `Buffer` is - * returned. - * @since v0.11.14 - * @param encoding The `encoding` of the return value. - * @return The EC Diffie-Hellman in the specified `encoding`. - */ - getPrivateKey(): Buffer; - getPrivateKey(encoding: BinaryToTextEncoding): string; - /** - * The `format` argument specifies point encoding and can be `'compressed'` or `'uncompressed'`. If `format` is not specified the point will be returned in`'uncompressed'` format. - * - * If `encoding` is specified, a string is returned; otherwise a `Buffer` is - * returned. - * @since v0.11.14 - * @param encoding The `encoding` of the return value. - * @param [format='uncompressed'] - * @return The EC Diffie-Hellman public key in the specified `encoding` and `format`. - */ - getPublicKey(encoding?: null, format?: ECDHKeyFormat): Buffer; - getPublicKey(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string; - /** - * Sets the EC Diffie-Hellman private key. - * If `encoding` is provided, `privateKey` is expected - * to be a string; otherwise `privateKey` is expected to be a `Buffer`, `TypedArray`, or `DataView`. - * - * If `privateKey` is not valid for the curve specified when the `ECDH` object was - * created, an error is thrown. Upon setting the private key, the associated - * public point (key) is also generated and set in the `ECDH` object. - * @since v0.11.14 - * @param encoding The `encoding` of the `privateKey` string. - */ - setPrivateKey(privateKey: NodeJS.ArrayBufferView): void; - setPrivateKey(privateKey: string, encoding: BinaryToTextEncoding): void; - } - /** - * Creates an Elliptic Curve Diffie-Hellman (`ECDH`) key exchange object using a - * predefined curve specified by the `curveName` string. Use {@link getCurves} to obtain a list of available curve names. On recent - * OpenSSL releases, `openssl ecparam -list_curves` will also display the name - * and description of each available elliptic curve. - * @since v0.11.14 - */ - function createECDH(curveName: string): ECDH; - /** - * This function compares the underlying bytes that represent the given `ArrayBuffer`, `TypedArray`, or `DataView` instances using a constant-time - * algorithm. - * - * This function does not leak timing information that - * would allow an attacker to guess one of the values. This is suitable for - * comparing HMAC digests or secret values like authentication cookies or [capability urls](https://www.w3.org/TR/capability-urls/). - * - * `a` and `b` must both be `Buffer`s, `TypedArray`s, or `DataView`s, and they - * must have the same byte length. An error is thrown if `a` and `b` have - * different byte lengths. - * - * If at least one of `a` and `b` is a `TypedArray` with more than one byte per - * entry, such as `Uint16Array`, the result will be computed using the platform - * byte order. - * - * **When both of the inputs are `Float32Array`s or `Float64Array`s, this function might return unexpected results due to IEEE 754** - * **encoding of floating-point numbers. In particular, neither `x === y` nor `Object.is(x, y)` implies that the byte representations of two floating-point** - * **numbers `x` and `y` are equal.** - * - * Use of `crypto.timingSafeEqual` does not guarantee that the _surrounding_ code - * is timing-safe. Care should be taken to ensure that the surrounding code does - * not introduce timing vulnerabilities. - * @since v6.6.0 - */ - function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean; - type KeyType = "rsa" | "rsa-pss" | "dsa" | "ec" | "ed25519" | "ed448" | "x25519" | "x448"; - type KeyFormat = "pem" | "der" | "jwk"; - interface BasePrivateKeyEncodingOptions { - format: T; - cipher?: string | undefined; - passphrase?: string | undefined; - } - interface KeyPairKeyObjectResult { - publicKey: KeyObject; - privateKey: KeyObject; - } - interface ED25519KeyPairKeyObjectOptions {} - interface ED448KeyPairKeyObjectOptions {} - interface X25519KeyPairKeyObjectOptions {} - interface X448KeyPairKeyObjectOptions {} - interface ECKeyPairKeyObjectOptions { - /** - * Name of the curve to use - */ - namedCurve: string; - /** - * Must be `'named'` or `'explicit'`. Default: `'named'`. - */ - paramEncoding?: "explicit" | "named" | undefined; - } - interface RSAKeyPairKeyObjectOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Public exponent - * @default 0x10001 - */ - publicExponent?: number | undefined; - } - interface RSAPSSKeyPairKeyObjectOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Public exponent - * @default 0x10001 - */ - publicExponent?: number | undefined; - /** - * Name of the message digest - */ - hashAlgorithm?: string; - /** - * Name of the message digest used by MGF1 - */ - mgf1HashAlgorithm?: string; - /** - * Minimal salt length in bytes - */ - saltLength?: string; - } - interface DSAKeyPairKeyObjectOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Size of q in bits - */ - divisorLength: number; - } - interface RSAKeyPairOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Public exponent - * @default 0x10001 - */ - publicExponent?: number | undefined; - publicKeyEncoding: { - type: "pkcs1" | "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs1" | "pkcs8"; - }; - } - interface RSAPSSKeyPairOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Public exponent - * @default 0x10001 - */ - publicExponent?: number | undefined; - /** - * Name of the message digest - */ - hashAlgorithm?: string; - /** - * Name of the message digest used by MGF1 - */ - mgf1HashAlgorithm?: string; - /** - * Minimal salt length in bytes - */ - saltLength?: string; - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface DSAKeyPairOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Size of q in bits - */ - divisorLength: number; - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface ECKeyPairOptions extends ECKeyPairKeyObjectOptions { - publicKeyEncoding: { - type: "pkcs1" | "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "sec1" | "pkcs8"; - }; - } - interface ED25519KeyPairOptions { - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface ED448KeyPairOptions { - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface X25519KeyPairOptions { - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface X448KeyPairOptions { - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface KeyPairSyncResult { - publicKey: T1; - privateKey: T2; - } - /** - * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC, - * Ed25519, Ed448, X25519, X448, and DH are currently supported. - * - * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function - * behaves as if `keyObject.export()` had been called on its result. Otherwise, - * the respective part of the key is returned as a `KeyObject`. - * - * When encoding public keys, it is recommended to use `'spki'`. When encoding - * private keys, it is recommended to use `'pkcs8'` with a strong passphrase, - * and to keep the passphrase confidential. - * - * ```js - * const { - * generateKeyPairSync, - * } = await import('node:crypto'); - * - * const { - * publicKey, - * privateKey, - * } = generateKeyPairSync('rsa', { - * modulusLength: 4096, - * publicKeyEncoding: { - * type: 'spki', - * format: 'pem', - * }, - * privateKeyEncoding: { - * type: 'pkcs8', - * format: 'pem', - * cipher: 'aes-256-cbc', - * passphrase: 'top secret', - * }, - * }); - * ``` - * - * The return value `{ publicKey, privateKey }` represents the generated key pair. - * When PEM encoding was selected, the respective key will be a string, otherwise - * it will be a buffer containing the data encoded as DER. - * @since v10.12.0 - * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`. - */ - function generateKeyPairSync( - type: "rsa", - options: RSAKeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa", - options: RSAKeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa", - options: RSAKeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa", - options: RSAKeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "rsa", options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "rsa-pss", options: RSAPSSKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "dsa", - options: DSAKeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "dsa", - options: DSAKeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "dsa", - options: DSAKeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "dsa", - options: DSAKeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "dsa", options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "ec", - options: ECKeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ec", - options: ECKeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ec", - options: ECKeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ec", - options: ECKeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "ec", options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "ed25519", options?: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "ed448", - options: ED448KeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed448", - options: ED448KeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed448", - options: ED448KeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed448", - options: ED448KeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "ed448", options?: ED448KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "x25519", - options: X25519KeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x25519", - options: X25519KeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x25519", - options: X25519KeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x25519", - options: X25519KeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "x25519", options?: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "x448", - options: X448KeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x448", - options: X448KeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x448", - options: X448KeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x448", - options: X448KeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "x448", options?: X448KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - /** - * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC, - * Ed25519, Ed448, X25519, X448, and DH are currently supported. - * - * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function - * behaves as if `keyObject.export()` had been called on its result. Otherwise, - * the respective part of the key is returned as a `KeyObject`. - * - * It is recommended to encode public keys as `'spki'` and private keys as `'pkcs8'` with encryption for long-term storage: - * - * ```js - * const { - * generateKeyPair, - * } = await import('node:crypto'); - * - * generateKeyPair('rsa', { - * modulusLength: 4096, - * publicKeyEncoding: { - * type: 'spki', - * format: 'pem', - * }, - * privateKeyEncoding: { - * type: 'pkcs8', - * format: 'pem', - * cipher: 'aes-256-cbc', - * passphrase: 'top secret', - * }, - * }, (err, publicKey, privateKey) => { - * // Handle errors and use the generated key pair. - * }); - * ``` - * - * On completion, `callback` will be called with `err` set to `undefined` and `publicKey` / `privateKey` representing the generated key pair. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a `Promise` for an `Object` with `publicKey` and `privateKey` properties. - * @since v10.12.0 - * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`. - */ - function generateKeyPair( - type: "rsa", - options: RSAKeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "rsa", - options: RSAKeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "rsa", - options: RSAKeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "rsa", - options: RSAKeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "rsa", - options: RSAKeyPairKeyObjectOptions, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "rsa-pss", - options: RSAPSSKeyPairKeyObjectOptions, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "dsa", - options: DSAKeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "dsa", - options: DSAKeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "dsa", - options: DSAKeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "dsa", - options: DSAKeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "dsa", - options: DSAKeyPairKeyObjectOptions, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "ec", - options: ECKeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ec", - options: ECKeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "ec", - options: ECKeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ec", - options: ECKeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "ec", - options: ECKeyPairKeyObjectOptions, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "ed25519", - options: ED25519KeyPairKeyObjectOptions | undefined, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "ed448", - options: ED448KeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ed448", - options: ED448KeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "ed448", - options: ED448KeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ed448", - options: ED448KeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "ed448", - options: ED448KeyPairKeyObjectOptions | undefined, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "x25519", - options: X25519KeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "x25519", - options: X25519KeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "x25519", - options: X25519KeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "x25519", - options: X25519KeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "x25519", - options: X25519KeyPairKeyObjectOptions | undefined, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "x448", - options: X448KeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "x448", - options: X448KeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "x448", - options: X448KeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "x448", - options: X448KeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "x448", - options: X448KeyPairKeyObjectOptions | undefined, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - namespace generateKeyPair { - function __promisify__( - type: "rsa", - options: RSAKeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "rsa", - options: RSAKeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "rsa", - options: RSAKeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "rsa", - options: RSAKeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: "rsa", options: RSAKeyPairKeyObjectOptions): Promise; - function __promisify__( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__( - type: "rsa-pss", - options: RSAPSSKeyPairKeyObjectOptions, - ): Promise; - function __promisify__( - type: "dsa", - options: DSAKeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "dsa", - options: DSAKeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "dsa", - options: DSAKeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "dsa", - options: DSAKeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: "dsa", options: DSAKeyPairKeyObjectOptions): Promise; - function __promisify__( - type: "ec", - options: ECKeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "ec", - options: ECKeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "ec", - options: ECKeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "ec", - options: ECKeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: "ec", options: ECKeyPairKeyObjectOptions): Promise; - function __promisify__( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__( - type: "ed25519", - options?: ED25519KeyPairKeyObjectOptions, - ): Promise; - function __promisify__( - type: "ed448", - options: ED448KeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "ed448", - options: ED448KeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "ed448", - options: ED448KeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "ed448", - options: ED448KeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: "ed448", options?: ED448KeyPairKeyObjectOptions): Promise; - function __promisify__( - type: "x25519", - options: X25519KeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "x25519", - options: X25519KeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "x25519", - options: X25519KeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "x25519", - options: X25519KeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__( - type: "x25519", - options?: X25519KeyPairKeyObjectOptions, - ): Promise; - function __promisify__( - type: "x448", - options: X448KeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "x448", - options: X448KeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "x448", - options: X448KeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "x448", - options: X448KeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: "x448", options?: X448KeyPairKeyObjectOptions): Promise; - } - /** - * Calculates and returns the signature for `data` using the given private key and - * algorithm. If `algorithm` is `null` or `undefined`, then the algorithm is - * dependent upon the key type (especially Ed25519 and Ed448). - * - * If `key` is not a `KeyObject`, this function behaves as if `key` had been - * passed to {@link createPrivateKey}. If it is an object, the following - * additional properties can be passed: - * - * If the `callback` function is provided this function uses libuv's threadpool. - * @since v12.0.0 - */ - function sign( - algorithm: string | null | undefined, - data: NodeJS.ArrayBufferView, - key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput, - ): Buffer; - function sign( - algorithm: string | null | undefined, - data: NodeJS.ArrayBufferView, - key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput, - callback: (error: Error | null, data: Buffer) => void, - ): void; - /** - * Verifies the given signature for `data` using the given key and algorithm. If `algorithm` is `null` or `undefined`, then the algorithm is dependent upon the - * key type (especially Ed25519 and Ed448). - * - * If `key` is not a `KeyObject`, this function behaves as if `key` had been - * passed to {@link createPublicKey}. If it is an object, the following - * additional properties can be passed: - * - * The `signature` argument is the previously calculated signature for the `data`. - * - * Because public keys can be derived from private keys, a private key or a public - * key may be passed for `key`. - * - * If the `callback` function is provided this function uses libuv's threadpool. - * @since v12.0.0 - */ - function verify( - algorithm: string | null | undefined, - data: NodeJS.ArrayBufferView, - key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, - signature: NodeJS.ArrayBufferView, - ): boolean; - function verify( - algorithm: string | null | undefined, - data: NodeJS.ArrayBufferView, - key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, - signature: NodeJS.ArrayBufferView, - callback: (error: Error | null, result: boolean) => void, - ): void; - /** - * Computes the Diffie-Hellman secret based on a `privateKey` and a `publicKey`. - * Both keys must have the same `asymmetricKeyType`, which must be one of `'dh'` (for Diffie-Hellman), `'ec'` (for ECDH), `'x448'`, or `'x25519'` (for ECDH-ES). - * @since v13.9.0, v12.17.0 - */ - function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): Buffer; - /** - * A utility for creating one-shot hash digests of data. It can be faster than the object-based `crypto.createHash()` when hashing a smaller amount of data - * (<= 5MB) that's readily available. If the data can be big or if it is streamed, it's still recommended to use `crypto.createHash()` instead. The `algorithm` - * is dependent on the available algorithms supported by the version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. On recent releases - * of OpenSSL, `openssl list -digest-algorithms` will display the available digest algorithms. - * - * Example: - * - * ```js - * import crypto from 'node:crypto'; - * import { Buffer } from 'node:buffer'; - * - * // Hashing a string and return the result as a hex-encoded string. - * const string = 'Node.js'; - * // 10b3493287f831e81a438811a1ffba01f8cec4b7 - * console.log(crypto.hash('sha1', string)); - * - * // Encode a base64-encoded string into a Buffer, hash it and return - * // the result as a buffer. - * const base64 = 'Tm9kZS5qcw=='; - * // - * console.log(crypto.hash('sha1', Buffer.from(base64, 'base64'), 'buffer')); - * ``` - * @since v21.7.0, v20.12.0 - * @param data When `data` is a string, it will be encoded as UTF-8 before being hashed. If a different input encoding is desired for a string input, user - * could encode the string into a `TypedArray` using either `TextEncoder` or `Buffer.from()` and passing the encoded `TypedArray` into this API instead. - * @param [outputEncoding='hex'] [Encoding](https://nodejs.org/docs/latest-v22.x/api/buffer.html#buffers-and-character-encodings) used to encode the returned digest. - */ - function hash(algorithm: string, data: BinaryLike, outputEncoding?: BinaryToTextEncoding): string; - function hash(algorithm: string, data: BinaryLike, outputEncoding: "buffer"): Buffer; - function hash( - algorithm: string, - data: BinaryLike, - outputEncoding?: BinaryToTextEncoding | "buffer", - ): string | Buffer; - type CipherMode = "cbc" | "ccm" | "cfb" | "ctr" | "ecb" | "gcm" | "ocb" | "ofb" | "stream" | "wrap" | "xts"; - interface CipherInfoOptions { - /** - * A test key length. - */ - keyLength?: number | undefined; - /** - * A test IV length. - */ - ivLength?: number | undefined; - } - interface CipherInfo { - /** - * The name of the cipher. - */ - name: string; - /** - * The nid of the cipher. - */ - nid: number; - /** - * The block size of the cipher in bytes. - * This property is omitted when mode is 'stream'. - */ - blockSize?: number | undefined; - /** - * The expected or default initialization vector length in bytes. - * This property is omitted if the cipher does not use an initialization vector. - */ - ivLength?: number | undefined; - /** - * The expected or default key length in bytes. - */ - keyLength: number; - /** - * The cipher mode. - */ - mode: CipherMode; - } - /** - * Returns information about a given cipher. - * - * Some ciphers accept variable length keys and initialization vectors. By default, - * the `crypto.getCipherInfo()` method will return the default values for these - * ciphers. To test if a given key length or iv length is acceptable for given - * cipher, use the `keyLength` and `ivLength` options. If the given values are - * unacceptable, `undefined` will be returned. - * @since v15.0.0 - * @param nameOrNid The name or nid of the cipher to query. - */ - function getCipherInfo(nameOrNid: string | number, options?: CipherInfoOptions): CipherInfo | undefined; - /** - * HKDF is a simple key derivation function defined in RFC 5869\. The given `ikm`, `salt` and `info` are used with the `digest` to derive a key of `keylen` bytes. - * - * The supplied `callback` function is called with two arguments: `err` and `derivedKey`. If an errors occurs while deriving the key, `err` will be set; - * otherwise `err` will be `null`. The successfully generated `derivedKey` will - * be passed to the callback as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). An error will be thrown if any - * of the input arguments specify invalid values or types. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { - * hkdf, - * } = await import('node:crypto'); - * - * hkdf('sha512', 'key', 'salt', 'info', 64, (err, derivedKey) => { - * if (err) throw err; - * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653' - * }); - * ``` - * @since v15.0.0 - * @param digest The digest algorithm to use. - * @param ikm The input keying material. Must be provided but can be zero-length. - * @param salt The salt value. Must be provided but can be zero-length. - * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes. - * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` - * generates 64-byte hashes, making the maximum HKDF output 16320 bytes). - */ - function hkdf( - digest: string, - irm: BinaryLike | KeyObject, - salt: BinaryLike, - info: BinaryLike, - keylen: number, - callback: (err: Error | null, derivedKey: ArrayBuffer) => void, - ): void; - /** - * Provides a synchronous HKDF key derivation function as defined in RFC 5869\. The - * given `ikm`, `salt` and `info` are used with the `digest` to derive a key of `keylen` bytes. - * - * The successfully generated `derivedKey` will be returned as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). - * - * An error will be thrown if any of the input arguments specify invalid values or - * types, or if the derived key cannot be generated. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { - * hkdfSync, - * } = await import('node:crypto'); - * - * const derivedKey = hkdfSync('sha512', 'key', 'salt', 'info', 64); - * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653' - * ``` - * @since v15.0.0 - * @param digest The digest algorithm to use. - * @param ikm The input keying material. Must be provided but can be zero-length. - * @param salt The salt value. Must be provided but can be zero-length. - * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes. - * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` - * generates 64-byte hashes, making the maximum HKDF output 16320 bytes). - */ - function hkdfSync( - digest: string, - ikm: BinaryLike | KeyObject, - salt: BinaryLike, - info: BinaryLike, - keylen: number, - ): ArrayBuffer; - interface SecureHeapUsage { - /** - * The total allocated secure heap size as specified using the `--secure-heap=n` command-line flag. - */ - total: number; - /** - * The minimum allocation from the secure heap as specified using the `--secure-heap-min` command-line flag. - */ - min: number; - /** - * The total number of bytes currently allocated from the secure heap. - */ - used: number; - /** - * The calculated ratio of `used` to `total` allocated bytes. - */ - utilization: number; - } - /** - * @since v15.6.0 - */ - function secureHeapUsed(): SecureHeapUsage; - interface RandomUUIDOptions { - /** - * By default, to improve performance, - * Node.js will pre-emptively generate and persistently cache enough - * random data to generate up to 128 random UUIDs. To generate a UUID - * without using the cache, set `disableEntropyCache` to `true`. - * - * @default `false` - */ - disableEntropyCache?: boolean | undefined; - } - type UUID = `${string}-${string}-${string}-${string}-${string}`; - /** - * Generates a random [RFC 4122](https://www.rfc-editor.org/rfc/rfc4122.txt) version 4 UUID. The UUID is generated using a - * cryptographic pseudorandom number generator. - * @since v15.6.0, v14.17.0 - */ - function randomUUID(options?: RandomUUIDOptions): UUID; - interface X509CheckOptions { - /** - * @default 'always' - */ - subject?: "always" | "default" | "never"; - /** - * @default true - */ - wildcards?: boolean; - /** - * @default true - */ - partialWildcards?: boolean; - /** - * @default false - */ - multiLabelWildcards?: boolean; - /** - * @default false - */ - singleLabelSubdomains?: boolean; - } - /** - * Encapsulates an X509 certificate and provides read-only access to - * its information. - * - * ```js - * const { X509Certificate } = await import('node:crypto'); - * - * const x509 = new X509Certificate('{... pem encoded cert ...}'); - * - * console.log(x509.subject); - * ``` - * @since v15.6.0 - */ - class X509Certificate { - /** - * Will be \`true\` if this is a Certificate Authority (CA) certificate. - * @since v15.6.0 - */ - readonly ca: boolean; - /** - * The SHA-1 fingerprint of this certificate. - * - * Because SHA-1 is cryptographically broken and because the security of SHA-1 is - * significantly worse than that of algorithms that are commonly used to sign - * certificates, consider using `x509.fingerprint256` instead. - * @since v15.6.0 - */ - readonly fingerprint: string; - /** - * The SHA-256 fingerprint of this certificate. - * @since v15.6.0 - */ - readonly fingerprint256: string; - /** - * The SHA-512 fingerprint of this certificate. - * - * Because computing the SHA-256 fingerprint is usually faster and because it is - * only half the size of the SHA-512 fingerprint, `x509.fingerprint256` may be - * a better choice. While SHA-512 presumably provides a higher level of security in - * general, the security of SHA-256 matches that of most algorithms that are - * commonly used to sign certificates. - * @since v17.2.0, v16.14.0 - */ - readonly fingerprint512: string; - /** - * The complete subject of this certificate. - * @since v15.6.0 - */ - readonly subject: string; - /** - * The subject alternative name specified for this certificate. - * - * This is a comma-separated list of subject alternative names. Each entry begins - * with a string identifying the kind of the subject alternative name followed by - * a colon and the value associated with the entry. - * - * Earlier versions of Node.js incorrectly assumed that it is safe to split this - * property at the two-character sequence `', '` (see [CVE-2021-44532](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44532)). However, - * both malicious and legitimate certificates can contain subject alternative names - * that include this sequence when represented as a string. - * - * After the prefix denoting the type of the entry, the remainder of each entry - * might be enclosed in quotes to indicate that the value is a JSON string literal. - * For backward compatibility, Node.js only uses JSON string literals within this - * property when necessary to avoid ambiguity. Third-party code should be prepared - * to handle both possible entry formats. - * @since v15.6.0 - */ - readonly subjectAltName: string | undefined; - /** - * A textual representation of the certificate's authority information access - * extension. - * - * This is a line feed separated list of access descriptions. Each line begins with - * the access method and the kind of the access location, followed by a colon and - * the value associated with the access location. - * - * After the prefix denoting the access method and the kind of the access location, - * the remainder of each line might be enclosed in quotes to indicate that the - * value is a JSON string literal. For backward compatibility, Node.js only uses - * JSON string literals within this property when necessary to avoid ambiguity. - * Third-party code should be prepared to handle both possible entry formats. - * @since v15.6.0 - */ - readonly infoAccess: string | undefined; - /** - * An array detailing the key usages for this certificate. - * @since v15.6.0 - */ - readonly keyUsage: string[]; - /** - * The issuer identification included in this certificate. - * @since v15.6.0 - */ - readonly issuer: string; - /** - * The issuer certificate or `undefined` if the issuer certificate is not - * available. - * @since v15.9.0 - */ - readonly issuerCertificate?: X509Certificate | undefined; - /** - * The public key `KeyObject` for this certificate. - * @since v15.6.0 - */ - readonly publicKey: KeyObject; - /** - * A `Buffer` containing the DER encoding of this certificate. - * @since v15.6.0 - */ - readonly raw: Buffer; - /** - * The serial number of this certificate. - * - * Serial numbers are assigned by certificate authorities and do not uniquely - * identify certificates. Consider using `x509.fingerprint256` as a unique - * identifier instead. - * @since v15.6.0 - */ - readonly serialNumber: string; - /** - * The date/time from which this certificate is considered valid. - * @since v15.6.0 - */ - readonly validFrom: string; - /** - * The date/time until which this certificate is considered valid. - * @since v15.6.0 - */ - readonly validTo: string; - constructor(buffer: BinaryLike); - /** - * Checks whether the certificate matches the given email address. - * - * If the `'subject'` option is undefined or set to `'default'`, the certificate - * subject is only considered if the subject alternative name extension either does - * not exist or does not contain any email addresses. - * - * If the `'subject'` option is set to `'always'` and if the subject alternative - * name extension either does not exist or does not contain a matching email - * address, the certificate subject is considered. - * - * If the `'subject'` option is set to `'never'`, the certificate subject is never - * considered, even if the certificate contains no subject alternative names. - * @since v15.6.0 - * @return Returns `email` if the certificate matches, `undefined` if it does not. - */ - checkEmail(email: string, options?: Pick): string | undefined; - /** - * Checks whether the certificate matches the given host name. - * - * If the certificate matches the given host name, the matching subject name is - * returned. The returned name might be an exact match (e.g., `foo.example.com`) - * or it might contain wildcards (e.g., `*.example.com`). Because host name - * comparisons are case-insensitive, the returned subject name might also differ - * from the given `name` in capitalization. - * - * If the `'subject'` option is undefined or set to `'default'`, the certificate - * subject is only considered if the subject alternative name extension either does - * not exist or does not contain any DNS names. This behavior is consistent with [RFC 2818](https://www.rfc-editor.org/rfc/rfc2818.txt) ("HTTP Over TLS"). - * - * If the `'subject'` option is set to `'always'` and if the subject alternative - * name extension either does not exist or does not contain a matching DNS name, - * the certificate subject is considered. - * - * If the `'subject'` option is set to `'never'`, the certificate subject is never - * considered, even if the certificate contains no subject alternative names. - * @since v15.6.0 - * @return Returns a subject name that matches `name`, or `undefined` if no subject name matches `name`. - */ - checkHost(name: string, options?: X509CheckOptions): string | undefined; - /** - * Checks whether the certificate matches the given IP address (IPv4 or IPv6). - * - * Only [RFC 5280](https://www.rfc-editor.org/rfc/rfc5280.txt) `iPAddress` subject alternative names are considered, and they - * must match the given `ip` address exactly. Other subject alternative names as - * well as the subject field of the certificate are ignored. - * @since v15.6.0 - * @return Returns `ip` if the certificate matches, `undefined` if it does not. - */ - checkIP(ip: string): string | undefined; - /** - * Checks whether this certificate was issued by the given `otherCert`. - * @since v15.6.0 - */ - checkIssued(otherCert: X509Certificate): boolean; - /** - * Checks whether the public key for this certificate is consistent with - * the given private key. - * @since v15.6.0 - * @param privateKey A private key. - */ - checkPrivateKey(privateKey: KeyObject): boolean; - /** - * There is no standard JSON encoding for X509 certificates. The`toJSON()` method returns a string containing the PEM encoded - * certificate. - * @since v15.6.0 - */ - toJSON(): string; - /** - * Returns information about this certificate using the legacy `certificate object` encoding. - * @since v15.6.0 - */ - toLegacyObject(): PeerCertificate; - /** - * Returns the PEM-encoded certificate. - * @since v15.6.0 - */ - toString(): string; - /** - * Verifies that this certificate was signed by the given public key. - * Does not perform any other validation checks on the certificate. - * @since v15.6.0 - * @param publicKey A public key. - */ - verify(publicKey: KeyObject): boolean; - } - type LargeNumberLike = NodeJS.ArrayBufferView | SharedArrayBuffer | ArrayBuffer | bigint; - interface GeneratePrimeOptions { - add?: LargeNumberLike | undefined; - rem?: LargeNumberLike | undefined; - /** - * @default false - */ - safe?: boolean | undefined; - bigint?: boolean | undefined; - } - interface GeneratePrimeOptionsBigInt extends GeneratePrimeOptions { - bigint: true; - } - interface GeneratePrimeOptionsArrayBuffer extends GeneratePrimeOptions { - bigint?: false | undefined; - } - /** - * Generates a pseudorandom prime of `size` bits. - * - * If `options.safe` is `true`, the prime will be a safe prime -- that is, `(prime - 1) / 2` will also be a prime. - * - * The `options.add` and `options.rem` parameters can be used to enforce additional - * requirements, e.g., for Diffie-Hellman: - * - * * If `options.add` and `options.rem` are both set, the prime will satisfy the - * condition that `prime % add = rem`. - * * If only `options.add` is set and `options.safe` is not `true`, the prime will - * satisfy the condition that `prime % add = 1`. - * * If only `options.add` is set and `options.safe` is set to `true`, the prime - * will instead satisfy the condition that `prime % add = 3`. This is necessary - * because `prime % add = 1` for `options.add > 2` would contradict the condition - * enforced by `options.safe`. - * * `options.rem` is ignored if `options.add` is not given. - * - * Both `options.add` and `options.rem` must be encoded as big-endian sequences - * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or `DataView`. - * - * By default, the prime is encoded as a big-endian sequence of octets - * in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a - * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) is provided. - * @since v15.8.0 - * @param size The size (in bits) of the prime to generate. - */ - function generatePrime(size: number, callback: (err: Error | null, prime: ArrayBuffer) => void): void; - function generatePrime( - size: number, - options: GeneratePrimeOptionsBigInt, - callback: (err: Error | null, prime: bigint) => void, - ): void; - function generatePrime( - size: number, - options: GeneratePrimeOptionsArrayBuffer, - callback: (err: Error | null, prime: ArrayBuffer) => void, - ): void; - function generatePrime( - size: number, - options: GeneratePrimeOptions, - callback: (err: Error | null, prime: ArrayBuffer | bigint) => void, - ): void; - /** - * Generates a pseudorandom prime of `size` bits. - * - * If `options.safe` is `true`, the prime will be a safe prime -- that is, `(prime - 1) / 2` will also be a prime. - * - * The `options.add` and `options.rem` parameters can be used to enforce additional - * requirements, e.g., for Diffie-Hellman: - * - * * If `options.add` and `options.rem` are both set, the prime will satisfy the - * condition that `prime % add = rem`. - * * If only `options.add` is set and `options.safe` is not `true`, the prime will - * satisfy the condition that `prime % add = 1`. - * * If only `options.add` is set and `options.safe` is set to `true`, the prime - * will instead satisfy the condition that `prime % add = 3`. This is necessary - * because `prime % add = 1` for `options.add > 2` would contradict the condition - * enforced by `options.safe`. - * * `options.rem` is ignored if `options.add` is not given. - * - * Both `options.add` and `options.rem` must be encoded as big-endian sequences - * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or `DataView`. - * - * By default, the prime is encoded as a big-endian sequence of octets - * in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a - * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) is provided. - * @since v15.8.0 - * @param size The size (in bits) of the prime to generate. - */ - function generatePrimeSync(size: number): ArrayBuffer; - function generatePrimeSync(size: number, options: GeneratePrimeOptionsBigInt): bigint; - function generatePrimeSync(size: number, options: GeneratePrimeOptionsArrayBuffer): ArrayBuffer; - function generatePrimeSync(size: number, options: GeneratePrimeOptions): ArrayBuffer | bigint; - interface CheckPrimeOptions { - /** - * The number of Miller-Rabin probabilistic primality iterations to perform. - * When the value is 0 (zero), a number of checks is used that yields a false positive rate of at most `2**-64` for random input. - * Care must be used when selecting a number of checks. - * Refer to the OpenSSL documentation for the BN_is_prime_ex function nchecks options for more details. - * - * @default 0 - */ - checks?: number | undefined; - } - /** - * Checks the primality of the `candidate`. - * @since v15.8.0 - * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length. - */ - function checkPrime(value: LargeNumberLike, callback: (err: Error | null, result: boolean) => void): void; - function checkPrime( - value: LargeNumberLike, - options: CheckPrimeOptions, - callback: (err: Error | null, result: boolean) => void, - ): void; - /** - * Checks the primality of the `candidate`. - * @since v15.8.0 - * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length. - * @return `true` if the candidate is a prime with an error probability less than `0.25 ** options.checks`. - */ - function checkPrimeSync(candidate: LargeNumberLike, options?: CheckPrimeOptions): boolean; - /** - * Load and set the `engine` for some or all OpenSSL functions (selected by flags). - * - * `engine` could be either an id or a path to the engine's shared library. - * - * The optional `flags` argument uses `ENGINE_METHOD_ALL` by default. The `flags` is a bit field taking one of or a mix of the following flags (defined in `crypto.constants`): - * - * * `crypto.constants.ENGINE_METHOD_RSA` - * * `crypto.constants.ENGINE_METHOD_DSA` - * * `crypto.constants.ENGINE_METHOD_DH` - * * `crypto.constants.ENGINE_METHOD_RAND` - * * `crypto.constants.ENGINE_METHOD_EC` - * * `crypto.constants.ENGINE_METHOD_CIPHERS` - * * `crypto.constants.ENGINE_METHOD_DIGESTS` - * * `crypto.constants.ENGINE_METHOD_PKEY_METHS` - * * `crypto.constants.ENGINE_METHOD_PKEY_ASN1_METHS` - * * `crypto.constants.ENGINE_METHOD_ALL` - * * `crypto.constants.ENGINE_METHOD_NONE` - * @since v0.11.11 - * @param flags - */ - function setEngine(engine: string, flags?: number): void; - /** - * A convenient alias for {@link webcrypto.getRandomValues}. This - * implementation is not compliant with the Web Crypto spec, to write - * web-compatible code use {@link webcrypto.getRandomValues} instead. - * @since v17.4.0 - * @return Returns `typedArray`. - */ - function getRandomValues(typedArray: T): T; - /** - * A convenient alias for `crypto.webcrypto.subtle`. - * @since v17.4.0 - */ - const subtle: webcrypto.SubtleCrypto; - /** - * An implementation of the Web Crypto API standard. - * - * See the {@link https://nodejs.org/docs/latest/api/webcrypto.html Web Crypto API documentation} for details. - * @since v15.0.0 - */ - const webcrypto: webcrypto.Crypto; - namespace webcrypto { - type BufferSource = ArrayBufferView | ArrayBuffer; - type KeyFormat = "jwk" | "pkcs8" | "raw" | "spki"; - type KeyType = "private" | "public" | "secret"; - type KeyUsage = - | "decrypt" - | "deriveBits" - | "deriveKey" - | "encrypt" - | "sign" - | "unwrapKey" - | "verify" - | "wrapKey"; - type AlgorithmIdentifier = Algorithm | string; - type HashAlgorithmIdentifier = AlgorithmIdentifier; - type NamedCurve = string; - type BigInteger = Uint8Array; - interface AesCbcParams extends Algorithm { - iv: BufferSource; - } - interface AesCtrParams extends Algorithm { - counter: BufferSource; - length: number; - } - interface AesDerivedKeyParams extends Algorithm { - length: number; - } - interface AesGcmParams extends Algorithm { - additionalData?: BufferSource; - iv: BufferSource; - tagLength?: number; - } - interface AesKeyAlgorithm extends KeyAlgorithm { - length: number; - } - interface AesKeyGenParams extends Algorithm { - length: number; - } - interface Algorithm { - name: string; - } - interface EcKeyAlgorithm extends KeyAlgorithm { - namedCurve: NamedCurve; - } - interface EcKeyGenParams extends Algorithm { - namedCurve: NamedCurve; - } - interface EcKeyImportParams extends Algorithm { - namedCurve: NamedCurve; - } - interface EcdhKeyDeriveParams extends Algorithm { - public: CryptoKey; - } - interface EcdsaParams extends Algorithm { - hash: HashAlgorithmIdentifier; - } - interface Ed448Params extends Algorithm { - context?: BufferSource; - } - interface HkdfParams extends Algorithm { - hash: HashAlgorithmIdentifier; - info: BufferSource; - salt: BufferSource; - } - interface HmacImportParams extends Algorithm { - hash: HashAlgorithmIdentifier; - length?: number; - } - interface HmacKeyAlgorithm extends KeyAlgorithm { - hash: KeyAlgorithm; - length: number; - } - interface HmacKeyGenParams extends Algorithm { - hash: HashAlgorithmIdentifier; - length?: number; - } - interface JsonWebKey { - alg?: string; - crv?: string; - d?: string; - dp?: string; - dq?: string; - e?: string; - ext?: boolean; - k?: string; - key_ops?: string[]; - kty?: string; - n?: string; - oth?: RsaOtherPrimesInfo[]; - p?: string; - q?: string; - qi?: string; - use?: string; - x?: string; - y?: string; - } - interface KeyAlgorithm { - name: string; - } - interface Pbkdf2Params extends Algorithm { - hash: HashAlgorithmIdentifier; - iterations: number; - salt: BufferSource; - } - interface RsaHashedImportParams extends Algorithm { - hash: HashAlgorithmIdentifier; - } - interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm { - hash: KeyAlgorithm; - } - interface RsaHashedKeyGenParams extends RsaKeyGenParams { - hash: HashAlgorithmIdentifier; - } - interface RsaKeyAlgorithm extends KeyAlgorithm { - modulusLength: number; - publicExponent: BigInteger; - } - interface RsaKeyGenParams extends Algorithm { - modulusLength: number; - publicExponent: BigInteger; - } - interface RsaOaepParams extends Algorithm { - label?: BufferSource; - } - interface RsaOtherPrimesInfo { - d?: string; - r?: string; - t?: string; - } - interface RsaPssParams extends Algorithm { - saltLength: number; - } - /** - * Importing the `webcrypto` object (`import { webcrypto } from 'node:crypto'`) gives an instance of the `Crypto` class. - * `Crypto` is a singleton that provides access to the remainder of the crypto API. - * @since v15.0.0 - */ - interface Crypto { - /** - * Provides access to the `SubtleCrypto` API. - * @since v15.0.0 - */ - readonly subtle: SubtleCrypto; - /** - * Generates cryptographically strong random values. - * The given `typedArray` is filled with random values, and a reference to `typedArray` is returned. - * - * The given `typedArray` must be an integer-based instance of {@link NodeJS.TypedArray}, i.e. `Float32Array` and `Float64Array` are not accepted. - * - * An error will be thrown if the given `typedArray` is larger than 65,536 bytes. - * @since v15.0.0 - */ - getRandomValues>(typedArray: T): T; - /** - * Generates a random {@link https://www.rfc-editor.org/rfc/rfc4122.txt RFC 4122} version 4 UUID. - * The UUID is generated using a cryptographic pseudorandom number generator. - * @since v16.7.0 - */ - randomUUID(): UUID; - CryptoKey: CryptoKeyConstructor; - } - // This constructor throws ILLEGAL_CONSTRUCTOR so it should not be newable. - interface CryptoKeyConstructor { - /** Illegal constructor */ - (_: { readonly _: unique symbol }): never; // Allows instanceof to work but not be callable by the user. - readonly length: 0; - readonly name: "CryptoKey"; - readonly prototype: CryptoKey; - } - /** - * @since v15.0.0 - */ - interface CryptoKey { - /** - * An object detailing the algorithm for which the key can be used along with additional algorithm-specific parameters. - * @since v15.0.0 - */ - readonly algorithm: KeyAlgorithm; - /** - * When `true`, the {@link CryptoKey} can be extracted using either `subtleCrypto.exportKey()` or `subtleCrypto.wrapKey()`. - * @since v15.0.0 - */ - readonly extractable: boolean; - /** - * A string identifying whether the key is a symmetric (`'secret'`) or asymmetric (`'private'` or `'public'`) key. - * @since v15.0.0 - */ - readonly type: KeyType; - /** - * An array of strings identifying the operations for which the key may be used. - * - * The possible usages are: - * - `'encrypt'` - The key may be used to encrypt data. - * - `'decrypt'` - The key may be used to decrypt data. - * - `'sign'` - The key may be used to generate digital signatures. - * - `'verify'` - The key may be used to verify digital signatures. - * - `'deriveKey'` - The key may be used to derive a new key. - * - `'deriveBits'` - The key may be used to derive bits. - * - `'wrapKey'` - The key may be used to wrap another key. - * - `'unwrapKey'` - The key may be used to unwrap another key. - * - * Valid key usages depend on the key algorithm (identified by `cryptokey.algorithm.name`). - * @since v15.0.0 - */ - readonly usages: KeyUsage[]; - } - /** - * The `CryptoKeyPair` is a simple dictionary object with `publicKey` and `privateKey` properties, representing an asymmetric key pair. - * @since v15.0.0 - */ - interface CryptoKeyPair { - /** - * A {@link CryptoKey} whose type will be `'private'`. - * @since v15.0.0 - */ - privateKey: CryptoKey; - /** - * A {@link CryptoKey} whose type will be `'public'`. - * @since v15.0.0 - */ - publicKey: CryptoKey; - } - /** - * @since v15.0.0 - */ - interface SubtleCrypto { - /** - * Using the method and parameters specified in `algorithm` and the keying material provided by `key`, - * `subtle.decrypt()` attempts to decipher the provided `data`. If successful, - * the returned promise will be resolved with an `` containing the plaintext result. - * - * The algorithms currently supported include: - * - * - `'RSA-OAEP'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * @since v15.0.0 - */ - decrypt( - algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, - key: CryptoKey, - data: BufferSource, - ): Promise; - /** - * Using the method and parameters specified in `algorithm` and the keying material provided by `baseKey`, - * `subtle.deriveBits()` attempts to generate `length` bits. - * The Node.js implementation requires that when `length` is a number it must be multiple of `8`. - * When `length` is `null` the maximum number of bits for a given algorithm is generated. This is allowed - * for the `'ECDH'`, `'X25519'`, and `'X448'` algorithms. - * If successful, the returned promise will be resolved with an `` containing the generated data. - * - * The algorithms currently supported include: - * - * - `'ECDH'` - * - `'X25519'` - * - `'X448'` - * - `'HKDF'` - * - `'PBKDF2'` - * @since v15.0.0 - */ - deriveBits(algorithm: EcdhKeyDeriveParams, baseKey: CryptoKey, length: number | null): Promise; - deriveBits( - algorithm: AlgorithmIdentifier | HkdfParams | Pbkdf2Params, - baseKey: CryptoKey, - length: number, - ): Promise; - /** - * Using the method and parameters specified in `algorithm`, and the keying material provided by `baseKey`, - * `subtle.deriveKey()` attempts to generate a new ` based on the method and parameters in `derivedKeyAlgorithm`. - * - * Calling `subtle.deriveKey()` is equivalent to calling `subtle.deriveBits()` to generate raw keying material, - * then passing the result into the `subtle.importKey()` method using the `deriveKeyAlgorithm`, `extractable`, and `keyUsages` parameters as input. - * - * The algorithms currently supported include: - * - * - `'ECDH'` - * - `'X25519'` - * - `'X448'` - * - `'HKDF'` - * - `'PBKDF2'` - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ - deriveKey( - algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, - baseKey: CryptoKey, - derivedKeyAlgorithm: - | AlgorithmIdentifier - | AesDerivedKeyParams - | HmacImportParams - | HkdfParams - | Pbkdf2Params, - extractable: boolean, - keyUsages: readonly KeyUsage[], - ): Promise; - /** - * Using the method identified by `algorithm`, `subtle.digest()` attempts to generate a digest of `data`. - * If successful, the returned promise is resolved with an `` containing the computed digest. - * - * If `algorithm` is provided as a ``, it must be one of: - * - * - `'SHA-1'` - * - `'SHA-256'` - * - `'SHA-384'` - * - `'SHA-512'` - * - * If `algorithm` is provided as an ``, it must have a `name` property whose value is one of the above. - * @since v15.0.0 - */ - digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise; - /** - * Using the method and parameters specified by `algorithm` and the keying material provided by `key`, - * `subtle.encrypt()` attempts to encipher `data`. If successful, - * the returned promise is resolved with an `` containing the encrypted result. - * - * The algorithms currently supported include: - * - * - `'RSA-OAEP'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * @since v15.0.0 - */ - encrypt( - algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, - key: CryptoKey, - data: BufferSource, - ): Promise; - /** - * Exports the given key into the specified format, if supported. - * - * If the `` is not extractable, the returned promise will reject. - * - * When `format` is either `'pkcs8'` or `'spki'` and the export is successful, - * the returned promise will be resolved with an `` containing the exported key data. - * - * When `format` is `'jwk'` and the export is successful, the returned promise will be resolved with a - * JavaScript object conforming to the {@link https://tools.ietf.org/html/rfc7517 JSON Web Key} specification. - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. - * @returns `` containing ``. - * @since v15.0.0 - */ - exportKey(format: "jwk", key: CryptoKey): Promise; - exportKey(format: Exclude, key: CryptoKey): Promise; - /** - * Using the method and parameters provided in `algorithm`, - * `subtle.generateKey()` attempts to generate new keying material. - * Depending the method used, the method may generate either a single `` or a ``. - * - * The `` (public and private key) generating algorithms supported include: - * - * - `'RSASSA-PKCS1-v1_5'` - * - `'RSA-PSS'` - * - `'RSA-OAEP'` - * - `'ECDSA'` - * - `'Ed25519'` - * - `'Ed448'` - * - `'ECDH'` - * - `'X25519'` - * - `'X448'` - * The `` (secret key) generating algorithms supported include: - * - * - `'HMAC'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * - `'AES-KW'` - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ - generateKey( - algorithm: RsaHashedKeyGenParams | EcKeyGenParams, - extractable: boolean, - keyUsages: readonly KeyUsage[], - ): Promise; - generateKey( - algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, - extractable: boolean, - keyUsages: readonly KeyUsage[], - ): Promise; - generateKey( - algorithm: AlgorithmIdentifier, - extractable: boolean, - keyUsages: KeyUsage[], - ): Promise; - /** - * The `subtle.importKey()` method attempts to interpret the provided `keyData` as the given `format` - * to create a `` instance using the provided `algorithm`, `extractable`, and `keyUsages` arguments. - * If the import is successful, the returned promise will be resolved with the created ``. - * - * If importing a `'PBKDF2'` key, `extractable` must be `false`. - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ - importKey( - format: "jwk", - keyData: JsonWebKey, - algorithm: - | AlgorithmIdentifier - | RsaHashedImportParams - | EcKeyImportParams - | HmacImportParams - | AesKeyAlgorithm, - extractable: boolean, - keyUsages: readonly KeyUsage[], - ): Promise; - importKey( - format: Exclude, - keyData: BufferSource, - algorithm: - | AlgorithmIdentifier - | RsaHashedImportParams - | EcKeyImportParams - | HmacImportParams - | AesKeyAlgorithm, - extractable: boolean, - keyUsages: KeyUsage[], - ): Promise; - /** - * Using the method and parameters given by `algorithm` and the keying material provided by `key`, - * `subtle.sign()` attempts to generate a cryptographic signature of `data`. If successful, - * the returned promise is resolved with an `` containing the generated signature. - * - * The algorithms currently supported include: - * - * - `'RSASSA-PKCS1-v1_5'` - * - `'RSA-PSS'` - * - `'ECDSA'` - * - `'Ed25519'` - * - `'Ed448'` - * - `'HMAC'` - * @since v15.0.0 - */ - sign( - algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params, - key: CryptoKey, - data: BufferSource, - ): Promise; - /** - * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material. - * The `subtle.unwrapKey()` method attempts to decrypt a wrapped key and create a `` instance. - * It is equivalent to calling `subtle.decrypt()` first on the encrypted key data (using the `wrappedKey`, `unwrapAlgo`, and `unwrappingKey` arguments as input) - * then passing the results in to the `subtle.importKey()` method using the `unwrappedKeyAlgo`, `extractable`, and `keyUsages` arguments as inputs. - * If successful, the returned promise is resolved with a `` object. - * - * The wrapping algorithms currently supported include: - * - * - `'RSA-OAEP'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * - `'AES-KW'` - * - * The unwrapped key algorithms supported include: - * - * - `'RSASSA-PKCS1-v1_5'` - * - `'RSA-PSS'` - * - `'RSA-OAEP'` - * - `'ECDSA'` - * - `'Ed25519'` - * - `'Ed448'` - * - `'ECDH'` - * - `'X25519'` - * - `'X448'` - * - `'HMAC'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * - `'AES-KW'` - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ - unwrapKey( - format: KeyFormat, - wrappedKey: BufferSource, - unwrappingKey: CryptoKey, - unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, - unwrappedKeyAlgorithm: - | AlgorithmIdentifier - | RsaHashedImportParams - | EcKeyImportParams - | HmacImportParams - | AesKeyAlgorithm, - extractable: boolean, - keyUsages: KeyUsage[], - ): Promise; - /** - * Using the method and parameters given in `algorithm` and the keying material provided by `key`, - * `subtle.verify()` attempts to verify that `signature` is a valid cryptographic signature of `data`. - * The returned promise is resolved with either `true` or `false`. - * - * The algorithms currently supported include: - * - * - `'RSASSA-PKCS1-v1_5'` - * - `'RSA-PSS'` - * - `'ECDSA'` - * - `'Ed25519'` - * - `'Ed448'` - * - `'HMAC'` - * @since v15.0.0 - */ - verify( - algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params, - key: CryptoKey, - signature: BufferSource, - data: BufferSource, - ): Promise; - /** - * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material. - * The `subtle.wrapKey()` method exports the keying material into the format identified by `format`, - * then encrypts it using the method and parameters specified by `wrapAlgo` and the keying material provided by `wrappingKey`. - * It is the equivalent to calling `subtle.exportKey()` using `format` and `key` as the arguments, - * then passing the result to the `subtle.encrypt()` method using `wrappingKey` and `wrapAlgo` as inputs. - * If successful, the returned promise will be resolved with an `` containing the encrypted key data. - * - * The wrapping algorithms currently supported include: - * - * - `'RSA-OAEP'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * - `'AES-KW'` - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. - * @since v15.0.0 - */ - wrapKey( - format: KeyFormat, - key: CryptoKey, - wrappingKey: CryptoKey, - wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, - ): Promise; - } - } - - global { - var crypto: typeof globalThis extends { - crypto: infer T; - onmessage: any; - } ? T - : webcrypto.Crypto; - } -} -declare module "node:crypto" { - export * from "crypto"; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/dgram.d.ts b/tools/mnemonic-test/node_modules/@types/node/dgram.d.ts deleted file mode 100644 index 8c2ac9b7..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/dgram.d.ts +++ /dev/null @@ -1,596 +0,0 @@ -/** - * The `node:dgram` module provides an implementation of UDP datagram sockets. - * - * ```js - * import dgram from 'node:dgram'; - * - * const server = dgram.createSocket('udp4'); - * - * server.on('error', (err) => { - * console.error(`server error:\n${err.stack}`); - * server.close(); - * }); - * - * server.on('message', (msg, rinfo) => { - * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); - * }); - * - * server.on('listening', () => { - * const address = server.address(); - * console.log(`server listening ${address.address}:${address.port}`); - * }); - * - * server.bind(41234); - * // Prints: server listening 0.0.0.0:41234 - * ``` - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/dgram.js) - */ -declare module "dgram" { - import { AddressInfo } from "node:net"; - import * as dns from "node:dns"; - import { Abortable, EventEmitter } from "node:events"; - interface RemoteInfo { - address: string; - family: "IPv4" | "IPv6"; - port: number; - size: number; - } - interface BindOptions { - port?: number | undefined; - address?: string | undefined; - exclusive?: boolean | undefined; - fd?: number | undefined; - } - type SocketType = "udp4" | "udp6"; - interface SocketOptions extends Abortable { - type: SocketType; - reuseAddr?: boolean | undefined; - /** - * @default false - */ - ipv6Only?: boolean | undefined; - recvBufferSize?: number | undefined; - sendBufferSize?: number | undefined; - lookup?: - | (( - hostname: string, - options: dns.LookupOneOptions, - callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void, - ) => void) - | undefined; - } - /** - * Creates a `dgram.Socket` object. Once the socket is created, calling `socket.bind()` will instruct the socket to begin listening for datagram - * messages. When `address` and `port` are not passed to `socket.bind()` the - * method will bind the socket to the "all interfaces" address on a random port - * (it does the right thing for both `udp4` and `udp6` sockets). The bound address - * and port can be retrieved using `socket.address().address` and `socket.address().port`. - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding `AbortController` is similar to calling `.close()` on the socket: - * - * ```js - * const controller = new AbortController(); - * const { signal } = controller; - * const server = dgram.createSocket({ type: 'udp4', signal }); - * server.on('message', (msg, rinfo) => { - * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); - * }); - * // Later, when you want to close the server. - * controller.abort(); - * ``` - * @since v0.11.13 - * @param options Available options are: - * @param callback Attached as a listener for `'message'` events. Optional. - */ - function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; - function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; - /** - * Encapsulates the datagram functionality. - * - * New instances of `dgram.Socket` are created using {@link createSocket}. - * The `new` keyword is not to be used to create `dgram.Socket` instances. - * @since v0.1.99 - */ - class Socket extends EventEmitter { - /** - * Tells the kernel to join a multicast group at the given `multicastAddress` and `multicastInterface` using the `IP_ADD_MEMBERSHIP` socket option. If the `multicastInterface` argument is not - * specified, the operating system will choose - * one interface and will add membership to it. To add membership to every - * available interface, call `addMembership` multiple times, once per interface. - * - * When called on an unbound socket, this method will implicitly bind to a random - * port, listening on all interfaces. - * - * When sharing a UDP socket across multiple `cluster` workers, the`socket.addMembership()` function must be called only once or an`EADDRINUSE` error will occur: - * - * ```js - * import cluster from 'node:cluster'; - * import dgram from 'node:dgram'; - * - * if (cluster.isPrimary) { - * cluster.fork(); // Works ok. - * cluster.fork(); // Fails with EADDRINUSE. - * } else { - * const s = dgram.createSocket('udp4'); - * s.bind(1234, () => { - * s.addMembership('224.0.0.114'); - * }); - * } - * ``` - * @since v0.6.9 - */ - addMembership(multicastAddress: string, multicastInterface?: string): void; - /** - * Returns an object containing the address information for a socket. - * For UDP sockets, this object will contain `address`, `family`, and `port` properties. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.1.99 - */ - address(): AddressInfo; - /** - * For UDP sockets, causes the `dgram.Socket` to listen for datagram - * messages on a named `port` and optional `address`. If `port` is not - * specified or is `0`, the operating system will attempt to bind to a - * random port. If `address` is not specified, the operating system will - * attempt to listen on all addresses. Once binding is complete, a `'listening'` event is emitted and the optional `callback` function is - * called. - * - * Specifying both a `'listening'` event listener and passing a `callback` to the `socket.bind()` method is not harmful but not very - * useful. - * - * A bound datagram socket keeps the Node.js process running to receive - * datagram messages. - * - * If binding fails, an `'error'` event is generated. In rare case (e.g. - * attempting to bind with a closed socket), an `Error` may be thrown. - * - * Example of a UDP server listening on port 41234: - * - * ```js - * import dgram from 'node:dgram'; - * - * const server = dgram.createSocket('udp4'); - * - * server.on('error', (err) => { - * console.error(`server error:\n${err.stack}`); - * server.close(); - * }); - * - * server.on('message', (msg, rinfo) => { - * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); - * }); - * - * server.on('listening', () => { - * const address = server.address(); - * console.log(`server listening ${address.address}:${address.port}`); - * }); - * - * server.bind(41234); - * // Prints: server listening 0.0.0.0:41234 - * ``` - * @since v0.1.99 - * @param callback with no parameters. Called when binding is complete. - */ - bind(port?: number, address?: string, callback?: () => void): this; - bind(port?: number, callback?: () => void): this; - bind(callback?: () => void): this; - bind(options: BindOptions, callback?: () => void): this; - /** - * Close the underlying socket and stop listening for data on it. If a callback is - * provided, it is added as a listener for the `'close'` event. - * @since v0.1.99 - * @param callback Called when the socket has been closed. - */ - close(callback?: () => void): this; - /** - * Associates the `dgram.Socket` to a remote address and port. Every - * message sent by this handle is automatically sent to that destination. Also, - * the socket will only receive messages from that remote peer. - * Trying to call `connect()` on an already connected socket will result - * in an `ERR_SOCKET_DGRAM_IS_CONNECTED` exception. If `address` is not - * provided, `'127.0.0.1'` (for `udp4` sockets) or `'::1'` (for `udp6` sockets) - * will be used by default. Once the connection is complete, a `'connect'` event - * is emitted and the optional `callback` function is called. In case of failure, - * the `callback` is called or, failing this, an `'error'` event is emitted. - * @since v12.0.0 - * @param callback Called when the connection is completed or on error. - */ - connect(port: number, address?: string, callback?: () => void): void; - connect(port: number, callback: () => void): void; - /** - * A synchronous function that disassociates a connected `dgram.Socket` from - * its remote address. Trying to call `disconnect()` on an unbound or already - * disconnected socket will result in an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception. - * @since v12.0.0 - */ - disconnect(): void; - /** - * Instructs the kernel to leave a multicast group at `multicastAddress` using the `IP_DROP_MEMBERSHIP` socket option. This method is automatically called by the - * kernel when the socket is closed or the process terminates, so most apps will - * never have reason to call this. - * - * If `multicastInterface` is not specified, the operating system will attempt to - * drop membership on all valid interfaces. - * @since v0.6.9 - */ - dropMembership(multicastAddress: string, multicastInterface?: string): void; - /** - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - * @return the `SO_RCVBUF` socket receive buffer size in bytes. - */ - getRecvBufferSize(): number; - /** - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - * @return the `SO_SNDBUF` socket send buffer size in bytes. - */ - getSendBufferSize(): number; - /** - * @since v18.8.0, v16.19.0 - * @return Number of bytes queued for sending. - */ - getSendQueueSize(): number; - /** - * @since v18.8.0, v16.19.0 - * @return Number of send requests currently in the queue awaiting to be processed. - */ - getSendQueueCount(): number; - /** - * By default, binding a socket will cause it to block the Node.js process from - * exiting as long as the socket is open. The `socket.unref()` method can be used - * to exclude the socket from the reference counting that keeps the Node.js - * process active. The `socket.ref()` method adds the socket back to the reference - * counting and restores the default behavior. - * - * Calling `socket.ref()` multiples times will have no additional effect. - * - * The `socket.ref()` method returns a reference to the socket so calls can be - * chained. - * @since v0.9.1 - */ - ref(): this; - /** - * Returns an object containing the `address`, `family`, and `port` of the remote - * endpoint. This method throws an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception - * if the socket is not connected. - * @since v12.0.0 - */ - remoteAddress(): AddressInfo; - /** - * Broadcasts a datagram on the socket. - * For connectionless sockets, the destination `port` and `address` must be - * specified. Connected sockets, on the other hand, will use their associated - * remote endpoint, so the `port` and `address` arguments must not be set. - * - * The `msg` argument contains the message to be sent. - * Depending on its type, different behavior can apply. If `msg` is a `Buffer`, - * any `TypedArray` or a `DataView`, - * the `offset` and `length` specify the offset within the `Buffer` where the - * message begins and the number of bytes in the message, respectively. - * If `msg` is a `String`, then it is automatically converted to a `Buffer` with `'utf8'` encoding. With messages that - * contain multi-byte characters, `offset` and `length` will be calculated with - * respect to `byte length` and not the character position. - * If `msg` is an array, `offset` and `length` must not be specified. - * - * The `address` argument is a string. If the value of `address` is a host name, - * DNS will be used to resolve the address of the host. If `address` is not - * provided or otherwise nullish, `'127.0.0.1'` (for `udp4` sockets) or `'::1'` (for `udp6` sockets) will be used by default. - * - * If the socket has not been previously bound with a call to `bind`, the socket - * is assigned a random port number and is bound to the "all interfaces" address - * (`'0.0.0.0'` for `udp4` sockets, `'::0'` for `udp6` sockets.) - * - * An optional `callback` function may be specified to as a way of reporting - * DNS errors or for determining when it is safe to reuse the `buf` object. - * DNS lookups delay the time to send for at least one tick of the - * Node.js event loop. - * - * The only way to know for sure that the datagram has been sent is by using a `callback`. If an error occurs and a `callback` is given, the error will be - * passed as the first argument to the `callback`. If a `callback` is not given, - * the error is emitted as an `'error'` event on the `socket` object. - * - * Offset and length are optional but both _must_ be set if either are used. - * They are supported only when the first argument is a `Buffer`, a `TypedArray`, - * or a `DataView`. - * - * This method throws `ERR_SOCKET_BAD_PORT` if called on an unbound socket. - * - * Example of sending a UDP packet to a port on `localhost`; - * - * ```js - * import dgram from 'node:dgram'; - * import { Buffer } from 'node:buffer'; - * - * const message = Buffer.from('Some bytes'); - * const client = dgram.createSocket('udp4'); - * client.send(message, 41234, 'localhost', (err) => { - * client.close(); - * }); - * ``` - * - * Example of sending a UDP packet composed of multiple buffers to a port on`127.0.0.1`; - * - * ```js - * import dgram from 'node:dgram'; - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from('Some '); - * const buf2 = Buffer.from('bytes'); - * const client = dgram.createSocket('udp4'); - * client.send([buf1, buf2], 41234, (err) => { - * client.close(); - * }); - * ``` - * - * Sending multiple buffers might be faster or slower depending on the - * application and operating system. Run benchmarks to - * determine the optimal strategy on a case-by-case basis. Generally speaking, - * however, sending multiple buffers is faster. - * - * Example of sending a UDP packet using a socket connected to a port on `localhost`: - * - * ```js - * import dgram from 'node:dgram'; - * import { Buffer } from 'node:buffer'; - * - * const message = Buffer.from('Some bytes'); - * const client = dgram.createSocket('udp4'); - * client.connect(41234, 'localhost', (err) => { - * client.send(message, (err) => { - * client.close(); - * }); - * }); - * ``` - * @since v0.1.99 - * @param msg Message to be sent. - * @param offset Offset in the buffer where the message starts. - * @param length Number of bytes in the message. - * @param port Destination port. - * @param address Destination host name or IP address. - * @param callback Called when the message has been sent. - */ - send( - msg: string | Uint8Array | readonly any[], - port?: number, - address?: string, - callback?: (error: Error | null, bytes: number) => void, - ): void; - send( - msg: string | Uint8Array | readonly any[], - port?: number, - callback?: (error: Error | null, bytes: number) => void, - ): void; - send( - msg: string | Uint8Array | readonly any[], - callback?: (error: Error | null, bytes: number) => void, - ): void; - send( - msg: string | Uint8Array, - offset: number, - length: number, - port?: number, - address?: string, - callback?: (error: Error | null, bytes: number) => void, - ): void; - send( - msg: string | Uint8Array, - offset: number, - length: number, - port?: number, - callback?: (error: Error | null, bytes: number) => void, - ): void; - send( - msg: string | Uint8Array, - offset: number, - length: number, - callback?: (error: Error | null, bytes: number) => void, - ): void; - /** - * Sets or clears the `SO_BROADCAST` socket option. When set to `true`, UDP - * packets may be sent to a local interface's broadcast address. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.6.9 - */ - setBroadcast(flag: boolean): void; - /** - * _All references to scope in this section are referring to [IPv6 Zone Indices](https://en.wikipedia.org/wiki/IPv6_address#Scoped_literal_IPv6_addresses), which are defined by [RFC - * 4007](https://tools.ietf.org/html/rfc4007). In string form, an IP_ - * _with a scope index is written as `'IP%scope'` where scope is an interface name_ - * _or interface number._ - * - * Sets the default outgoing multicast interface of the socket to a chosen - * interface or back to system interface selection. The `multicastInterface` must - * be a valid string representation of an IP from the socket's family. - * - * For IPv4 sockets, this should be the IP configured for the desired physical - * interface. All packets sent to multicast on the socket will be sent on the - * interface determined by the most recent successful use of this call. - * - * For IPv6 sockets, `multicastInterface` should include a scope to indicate the - * interface as in the examples that follow. In IPv6, individual `send` calls can - * also use explicit scope in addresses, so only packets sent to a multicast - * address without specifying an explicit scope are affected by the most recent - * successful use of this call. - * - * This method throws `EBADF` if called on an unbound socket. - * - * #### Example: IPv6 outgoing multicast interface - * - * On most systems, where scope format uses the interface name: - * - * ```js - * const socket = dgram.createSocket('udp6'); - * - * socket.bind(1234, () => { - * socket.setMulticastInterface('::%eth1'); - * }); - * ``` - * - * On Windows, where scope format uses an interface number: - * - * ```js - * const socket = dgram.createSocket('udp6'); - * - * socket.bind(1234, () => { - * socket.setMulticastInterface('::%2'); - * }); - * ``` - * - * #### Example: IPv4 outgoing multicast interface - * - * All systems use an IP of the host on the desired physical interface: - * - * ```js - * const socket = dgram.createSocket('udp4'); - * - * socket.bind(1234, () => { - * socket.setMulticastInterface('10.0.0.2'); - * }); - * ``` - * @since v8.6.0 - */ - setMulticastInterface(multicastInterface: string): void; - /** - * Sets or clears the `IP_MULTICAST_LOOP` socket option. When set to `true`, - * multicast packets will also be received on the local interface. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.3.8 - */ - setMulticastLoopback(flag: boolean): boolean; - /** - * Sets the `IP_MULTICAST_TTL` socket option. While TTL generally stands for - * "Time to Live", in this context it specifies the number of IP hops that a - * packet is allowed to travel through, specifically for multicast traffic. Each - * router or gateway that forwards a packet decrements the TTL. If the TTL is - * decremented to 0 by a router, it will not be forwarded. - * - * The `ttl` argument may be between 0 and 255\. The default on most systems is `1`. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.3.8 - */ - setMulticastTTL(ttl: number): number; - /** - * Sets the `SO_RCVBUF` socket option. Sets the maximum socket receive buffer - * in bytes. - * - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - */ - setRecvBufferSize(size: number): void; - /** - * Sets the `SO_SNDBUF` socket option. Sets the maximum socket send buffer - * in bytes. - * - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - */ - setSendBufferSize(size: number): void; - /** - * Sets the `IP_TTL` socket option. While TTL generally stands for "Time to Live", - * in this context it specifies the number of IP hops that a packet is allowed to - * travel through. Each router or gateway that forwards a packet decrements the - * TTL. If the TTL is decremented to 0 by a router, it will not be forwarded. - * Changing TTL values is typically done for network probes or when multicasting. - * - * The `ttl` argument may be between 1 and 255\. The default on most systems - * is 64. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.1.101 - */ - setTTL(ttl: number): number; - /** - * By default, binding a socket will cause it to block the Node.js process from - * exiting as long as the socket is open. The `socket.unref()` method can be used - * to exclude the socket from the reference counting that keeps the Node.js - * process active, allowing the process to exit even if the socket is still - * listening. - * - * Calling `socket.unref()` multiple times will have no additional effect. - * - * The `socket.unref()` method returns a reference to the socket so calls can be - * chained. - * @since v0.9.1 - */ - unref(): this; - /** - * Tells the kernel to join a source-specific multicast channel at the given `sourceAddress` and `groupAddress`, using the `multicastInterface` with the `IP_ADD_SOURCE_MEMBERSHIP` socket - * option. If the `multicastInterface` argument - * is not specified, the operating system will choose one interface and will add - * membership to it. To add membership to every available interface, call `socket.addSourceSpecificMembership()` multiple times, once per interface. - * - * When called on an unbound socket, this method will implicitly bind to a random - * port, listening on all interfaces. - * @since v13.1.0, v12.16.0 - */ - addSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; - /** - * Instructs the kernel to leave a source-specific multicast channel at the given `sourceAddress` and `groupAddress` using the `IP_DROP_SOURCE_MEMBERSHIP` socket option. This method is - * automatically called by the kernel when the - * socket is closed or the process terminates, so most apps will never have - * reason to call this. - * - * If `multicastInterface` is not specified, the operating system will attempt to - * drop membership on all valid interfaces. - * @since v13.1.0, v12.16.0 - */ - dropSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; - /** - * events.EventEmitter - * 1. close - * 2. connect - * 3. error - * 4. listening - * 5. message - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "connect", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "listening", listener: () => void): this; - addListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "connect"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "listening"): boolean; - emit(event: "message", msg: Buffer, rinfo: RemoteInfo): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "connect", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "listening", listener: () => void): this; - on(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "connect", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "listening", listener: () => void): this; - once(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "connect", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "listening", listener: () => void): this; - prependListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "connect", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "listening", listener: () => void): this; - prependOnceListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - /** - * Calls `socket.close()` and returns a promise that fulfills when the socket has closed. - * @since v20.5.0 - */ - [Symbol.asyncDispose](): Promise; - } -} -declare module "node:dgram" { - export * from "dgram"; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/diagnostics_channel.d.ts b/tools/mnemonic-test/node_modules/@types/node/diagnostics_channel.d.ts deleted file mode 100644 index 1cc7486b..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/diagnostics_channel.d.ts +++ /dev/null @@ -1,554 +0,0 @@ -/** - * The `node:diagnostics_channel` module provides an API to create named channels - * to report arbitrary message data for diagnostics purposes. - * - * It can be accessed using: - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * ``` - * - * It is intended that a module writer wanting to report diagnostics messages - * will create one or many top-level channels to report messages through. - * Channels may also be acquired at runtime but it is not encouraged - * due to the additional overhead of doing so. Channels may be exported for - * convenience, but as long as the name is known it can be acquired anywhere. - * - * If you intend for your module to produce diagnostics data for others to - * consume it is recommended that you include documentation of what named - * channels are used along with the shape of the message data. Channel names - * should generally include the module name to avoid collisions with data from - * other modules. - * @since v15.1.0, v14.17.0 - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/diagnostics_channel.js) - */ -declare module "diagnostics_channel" { - import { AsyncLocalStorage } from "node:async_hooks"; - /** - * Check if there are active subscribers to the named channel. This is helpful if - * the message you want to send might be expensive to prepare. - * - * This API is optional but helpful when trying to publish messages from very - * performance-sensitive code. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * if (diagnostics_channel.hasSubscribers('my-channel')) { - * // There are subscribers, prepare and publish message - * } - * ``` - * @since v15.1.0, v14.17.0 - * @param name The channel name - * @return If there are active subscribers - */ - function hasSubscribers(name: string | symbol): boolean; - /** - * This is the primary entry-point for anyone wanting to publish to a named - * channel. It produces a channel object which is optimized to reduce overhead at - * publish time as much as possible. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * ``` - * @since v15.1.0, v14.17.0 - * @param name The channel name - * @return The named channel object - */ - function channel(name: string | symbol): Channel; - type ChannelListener = (message: unknown, name: string | symbol) => void; - /** - * Register a message handler to subscribe to this channel. This message handler - * will be run synchronously whenever a message is published to the channel. Any - * errors thrown in the message handler will trigger an `'uncaughtException'`. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * diagnostics_channel.subscribe('my-channel', (message, name) => { - * // Received data - * }); - * ``` - * @since v18.7.0, v16.17.0 - * @param name The channel name - * @param onMessage The handler to receive channel messages - */ - function subscribe(name: string | symbol, onMessage: ChannelListener): void; - /** - * Remove a message handler previously registered to this channel with {@link subscribe}. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * function onMessage(message, name) { - * // Received data - * } - * - * diagnostics_channel.subscribe('my-channel', onMessage); - * - * diagnostics_channel.unsubscribe('my-channel', onMessage); - * ``` - * @since v18.7.0, v16.17.0 - * @param name The channel name - * @param onMessage The previous subscribed handler to remove - * @return `true` if the handler was found, `false` otherwise. - */ - function unsubscribe(name: string | symbol, onMessage: ChannelListener): boolean; - /** - * Creates a `TracingChannel` wrapper for the given `TracingChannel Channels`. If a name is given, the corresponding tracing - * channels will be created in the form of `tracing:${name}:${eventType}` where `eventType` corresponds to the types of `TracingChannel Channels`. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channelsByName = diagnostics_channel.tracingChannel('my-channel'); - * - * // or... - * - * const channelsByCollection = diagnostics_channel.tracingChannel({ - * start: diagnostics_channel.channel('tracing:my-channel:start'), - * end: diagnostics_channel.channel('tracing:my-channel:end'), - * asyncStart: diagnostics_channel.channel('tracing:my-channel:asyncStart'), - * asyncEnd: diagnostics_channel.channel('tracing:my-channel:asyncEnd'), - * error: diagnostics_channel.channel('tracing:my-channel:error'), - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param nameOrChannels Channel name or object containing all the `TracingChannel Channels` - * @return Collection of channels to trace with - */ - function tracingChannel< - StoreType = unknown, - ContextType extends object = StoreType extends object ? StoreType : object, - >( - nameOrChannels: string | TracingChannelCollection, - ): TracingChannel; - /** - * The class `Channel` represents an individual named channel within the data - * pipeline. It is used to track subscribers and to publish messages when there - * are subscribers present. It exists as a separate object to avoid channel - * lookups at publish time, enabling very fast publish speeds and allowing - * for heavy use while incurring very minimal cost. Channels are created with {@link channel}, constructing a channel directly - * with `new Channel(name)` is not supported. - * @since v15.1.0, v14.17.0 - */ - class Channel { - readonly name: string | symbol; - /** - * Check if there are active subscribers to this channel. This is helpful if - * the message you want to send might be expensive to prepare. - * - * This API is optional but helpful when trying to publish messages from very - * performance-sensitive code. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * if (channel.hasSubscribers) { - * // There are subscribers, prepare and publish message - * } - * ``` - * @since v15.1.0, v14.17.0 - */ - readonly hasSubscribers: boolean; - private constructor(name: string | symbol); - /** - * Publish a message to any subscribers to the channel. This will trigger - * message handlers synchronously so they will execute within the same context. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * channel.publish({ - * some: 'message', - * }); - * ``` - * @since v15.1.0, v14.17.0 - * @param message The message to send to the channel subscribers - */ - publish(message: unknown): void; - /** - * Register a message handler to subscribe to this channel. This message handler - * will be run synchronously whenever a message is published to the channel. Any - * errors thrown in the message handler will trigger an `'uncaughtException'`. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * channel.subscribe((message, name) => { - * // Received data - * }); - * ``` - * @since v15.1.0, v14.17.0 - * @deprecated Since v18.7.0,v16.17.0 - Use {@link subscribe(name, onMessage)} - * @param onMessage The handler to receive channel messages - */ - subscribe(onMessage: ChannelListener): void; - /** - * Remove a message handler previously registered to this channel with `channel.subscribe(onMessage)`. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * function onMessage(message, name) { - * // Received data - * } - * - * channel.subscribe(onMessage); - * - * channel.unsubscribe(onMessage); - * ``` - * @since v15.1.0, v14.17.0 - * @deprecated Since v18.7.0,v16.17.0 - Use {@link unsubscribe(name, onMessage)} - * @param onMessage The previous subscribed handler to remove - * @return `true` if the handler was found, `false` otherwise. - */ - unsubscribe(onMessage: ChannelListener): void; - /** - * When `channel.runStores(context, ...)` is called, the given context data - * will be applied to any store bound to the channel. If the store has already been - * bound the previous `transform` function will be replaced with the new one. - * The `transform` function may be omitted to set the given context data as the - * context directly. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * import { AsyncLocalStorage } from 'node:async_hooks'; - * - * const store = new AsyncLocalStorage(); - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * channel.bindStore(store, (data) => { - * return { data }; - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param store The store to which to bind the context data - * @param transform Transform context data before setting the store context - */ - bindStore(store: AsyncLocalStorage, transform?: (context: ContextType) => StoreType): void; - /** - * Remove a message handler previously registered to this channel with `channel.bindStore(store)`. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * import { AsyncLocalStorage } from 'node:async_hooks'; - * - * const store = new AsyncLocalStorage(); - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * channel.bindStore(store); - * channel.unbindStore(store); - * ``` - * @since v19.9.0 - * @experimental - * @param store The store to unbind from the channel. - * @return `true` if the store was found, `false` otherwise. - */ - unbindStore(store: any): void; - /** - * Applies the given data to any AsyncLocalStorage instances bound to the channel - * for the duration of the given function, then publishes to the channel within - * the scope of that data is applied to the stores. - * - * If a transform function was given to `channel.bindStore(store)` it will be - * applied to transform the message data before it becomes the context value for - * the store. The prior storage context is accessible from within the transform - * function in cases where context linking is required. - * - * The context applied to the store should be accessible in any async code which - * continues from execution which began during the given function, however - * there are some situations in which `context loss` may occur. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * import { AsyncLocalStorage } from 'node:async_hooks'; - * - * const store = new AsyncLocalStorage(); - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * channel.bindStore(store, (message) => { - * const parent = store.getStore(); - * return new Span(message, parent); - * }); - * channel.runStores({ some: 'message' }, () => { - * store.getStore(); // Span({ some: 'message' }) - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param context Message to send to subscribers and bind to stores - * @param fn Handler to run within the entered storage context - * @param thisArg The receiver to be used for the function call. - * @param args Optional arguments to pass to the function. - */ - runStores(): void; - } - interface TracingChannelSubscribers { - start: (message: ContextType) => void; - end: ( - message: ContextType & { - error?: unknown; - result?: unknown; - }, - ) => void; - asyncStart: ( - message: ContextType & { - error?: unknown; - result?: unknown; - }, - ) => void; - asyncEnd: ( - message: ContextType & { - error?: unknown; - result?: unknown; - }, - ) => void; - error: ( - message: ContextType & { - error: unknown; - }, - ) => void; - } - interface TracingChannelCollection { - start: Channel; - end: Channel; - asyncStart: Channel; - asyncEnd: Channel; - error: Channel; - } - /** - * The class `TracingChannel` is a collection of `TracingChannel Channels` which - * together express a single traceable action. It is used to formalize and - * simplify the process of producing events for tracing application flow. {@link tracingChannel} is used to construct a `TracingChannel`. As with `Channel` it is recommended to create and reuse a - * single `TracingChannel` at the top-level of the file rather than creating them - * dynamically. - * @since v19.9.0 - * @experimental - */ - class TracingChannel implements TracingChannelCollection { - start: Channel; - end: Channel; - asyncStart: Channel; - asyncEnd: Channel; - error: Channel; - /** - * Helper to subscribe a collection of functions to the corresponding channels. - * This is the same as calling `channel.subscribe(onMessage)` on each channel - * individually. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channels = diagnostics_channel.tracingChannel('my-channel'); - * - * channels.subscribe({ - * start(message) { - * // Handle start message - * }, - * end(message) { - * // Handle end message - * }, - * asyncStart(message) { - * // Handle asyncStart message - * }, - * asyncEnd(message) { - * // Handle asyncEnd message - * }, - * error(message) { - * // Handle error message - * }, - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param subscribers Set of `TracingChannel Channels` subscribers - */ - subscribe(subscribers: TracingChannelSubscribers): void; - /** - * Helper to unsubscribe a collection of functions from the corresponding channels. - * This is the same as calling `channel.unsubscribe(onMessage)` on each channel - * individually. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channels = diagnostics_channel.tracingChannel('my-channel'); - * - * channels.unsubscribe({ - * start(message) { - * // Handle start message - * }, - * end(message) { - * // Handle end message - * }, - * asyncStart(message) { - * // Handle asyncStart message - * }, - * asyncEnd(message) { - * // Handle asyncEnd message - * }, - * error(message) { - * // Handle error message - * }, - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param subscribers Set of `TracingChannel Channels` subscribers - * @return `true` if all handlers were successfully unsubscribed, and `false` otherwise. - */ - unsubscribe(subscribers: TracingChannelSubscribers): void; - /** - * Trace a synchronous function call. This will always produce a `start event` and `end event` around the execution and may produce an `error event` if the given function throws an error. - * This will run the given function using `channel.runStores(context, ...)` on the `start` channel which ensures all - * events should have any bound stores set to match this trace context. - * - * To ensure only correct trace graphs are formed, events will only be published if subscribers are present prior to starting the trace. Subscriptions - * which are added after the trace begins will not receive future events from that trace, only future traces will be seen. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channels = diagnostics_channel.tracingChannel('my-channel'); - * - * channels.traceSync(() => { - * // Do something - * }, { - * some: 'thing', - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param fn Function to wrap a trace around - * @param context Shared object to correlate events through - * @param thisArg The receiver to be used for the function call - * @param args Optional arguments to pass to the function - * @return The return value of the given function - */ - traceSync( - fn: (this: ThisArg, ...args: Args) => any, - context?: ContextType, - thisArg?: ThisArg, - ...args: Args - ): void; - /** - * Trace a promise-returning function call. This will always produce a `start event` and `end event` around the synchronous portion of the - * function execution, and will produce an `asyncStart event` and `asyncEnd event` when a promise continuation is reached. It may also - * produce an `error event` if the given function throws an error or the - * returned promise rejects. This will run the given function using `channel.runStores(context, ...)` on the `start` channel which ensures all - * events should have any bound stores set to match this trace context. - * - * To ensure only correct trace graphs are formed, events will only be published if subscribers are present prior to starting the trace. Subscriptions - * which are added after the trace begins will not receive future events from that trace, only future traces will be seen. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channels = diagnostics_channel.tracingChannel('my-channel'); - * - * channels.tracePromise(async () => { - * // Do something - * }, { - * some: 'thing', - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param fn Promise-returning function to wrap a trace around - * @param context Shared object to correlate trace events through - * @param thisArg The receiver to be used for the function call - * @param args Optional arguments to pass to the function - * @return Chained from promise returned by the given function - */ - tracePromise( - fn: (this: ThisArg, ...args: Args) => Promise, - context?: ContextType, - thisArg?: ThisArg, - ...args: Args - ): void; - /** - * Trace a callback-receiving function call. This will always produce a `start event` and `end event` around the synchronous portion of the - * function execution, and will produce a `asyncStart event` and `asyncEnd event` around the callback execution. It may also produce an `error event` if the given function throws an error or - * the returned - * promise rejects. This will run the given function using `channel.runStores(context, ...)` on the `start` channel which ensures all - * events should have any bound stores set to match this trace context. - * - * The `position` will be -1 by default to indicate the final argument should - * be used as the callback. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channels = diagnostics_channel.tracingChannel('my-channel'); - * - * channels.traceCallback((arg1, callback) => { - * // Do something - * callback(null, 'result'); - * }, 1, { - * some: 'thing', - * }, thisArg, arg1, callback); - * ``` - * - * The callback will also be run with `channel.runStores(context, ...)` which - * enables context loss recovery in some cases. - * - * To ensure only correct trace graphs are formed, events will only be published if subscribers are present prior to starting the trace. Subscriptions - * which are added after the trace begins will not receive future events from that trace, only future traces will be seen. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * import { AsyncLocalStorage } from 'node:async_hooks'; - * - * const channels = diagnostics_channel.tracingChannel('my-channel'); - * const myStore = new AsyncLocalStorage(); - * - * // The start channel sets the initial store data to something - * // and stores that store data value on the trace context object - * channels.start.bindStore(myStore, (data) => { - * const span = new Span(data); - * data.span = span; - * return span; - * }); - * - * // Then asyncStart can restore from that data it stored previously - * channels.asyncStart.bindStore(myStore, (data) => { - * return data.span; - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param fn callback using function to wrap a trace around - * @param position Zero-indexed argument position of expected callback - * @param context Shared object to correlate trace events through - * @param thisArg The receiver to be used for the function call - * @param args Optional arguments to pass to the function - * @return The return value of the given function - */ - traceCallback any>( - fn: Fn, - position?: number, - context?: ContextType, - thisArg?: any, - ...args: Parameters - ): void; - } -} -declare module "node:diagnostics_channel" { - export * from "diagnostics_channel"; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/dns.d.ts b/tools/mnemonic-test/node_modules/@types/node/dns.d.ts deleted file mode 100644 index af10fd92..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/dns.d.ts +++ /dev/null @@ -1,865 +0,0 @@ -/** - * The `node:dns` module enables name resolution. For example, use it to look up IP - * addresses of host names. - * - * Although named for the [Domain Name System (DNS)](https://en.wikipedia.org/wiki/Domain_Name_System), it does not always use the - * DNS protocol for lookups. {@link lookup} uses the operating system - * facilities to perform name resolution. It may not need to perform any network - * communication. To perform name resolution the way other applications on the same - * system do, use {@link lookup}. - * - * ```js - * import dns from 'node:dns'; - * - * dns.lookup('example.org', (err, address, family) => { - * console.log('address: %j family: IPv%s', address, family); - * }); - * // address: "93.184.216.34" family: IPv4 - * ``` - * - * All other functions in the `node:dns` module connect to an actual DNS server to - * perform name resolution. They will always use the network to perform DNS - * queries. These functions do not use the same set of configuration files used by {@link lookup} (e.g. `/etc/hosts`). Use these functions to always perform - * DNS queries, bypassing other name-resolution facilities. - * - * ```js - * import dns from 'node:dns'; - * - * dns.resolve4('archive.org', (err, addresses) => { - * if (err) throw err; - * - * console.log(`addresses: ${JSON.stringify(addresses)}`); - * - * addresses.forEach((a) => { - * dns.reverse(a, (err, hostnames) => { - * if (err) { - * throw err; - * } - * console.log(`reverse for ${a}: ${JSON.stringify(hostnames)}`); - * }); - * }); - * }); - * ``` - * - * See the [Implementation considerations section](https://nodejs.org/docs/latest-v22.x/api/dns.html#implementation-considerations) for more information. - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/dns.js) - */ -declare module "dns" { - import * as dnsPromises from "node:dns/promises"; - // Supported getaddrinfo flags. - /** - * Limits returned address types to the types of non-loopback addresses configured on the system. For example, IPv4 addresses are - * only returned if the current system has at least one IPv4 address configured. - */ - export const ADDRCONFIG: number; - /** - * If the IPv6 family was specified, but no IPv6 addresses were found, then return IPv4 mapped IPv6 addresses. It is not supported - * on some operating systems (e.g. FreeBSD 10.1). - */ - export const V4MAPPED: number; - /** - * If `dns.V4MAPPED` is specified, return resolved IPv6 addresses as - * well as IPv4 mapped IPv6 addresses. - */ - export const ALL: number; - export interface LookupOptions { - /** - * The record family. Must be `4`, `6`, or `0`. For backward compatibility reasons, `'IPv4'` and `'IPv6'` are interpreted - * as `4` and `6` respectively. The value 0 indicates that either an IPv4 or IPv6 address is returned. If the value `0` is used - * with `{ all: true } (see below)`, both IPv4 and IPv6 addresses are returned. - * @default 0 - */ - family?: number | "IPv4" | "IPv6" | undefined; - /** - * One or more [supported `getaddrinfo`](https://nodejs.org/docs/latest-v22.x/api/dns.html#supported-getaddrinfo-flags) flags. Multiple flags may be - * passed by bitwise `OR`ing their values. - */ - hints?: number | undefined; - /** - * When `true`, the callback returns all resolved addresses in an array. Otherwise, returns a single address. - * @default false - */ - all?: boolean | undefined; - /** - * When `verbatim`, the resolved addresses are return unsorted. When `ipv4first`, the resolved addresses are sorted - * by placing IPv4 addresses before IPv6 addresses. When `ipv6first`, the resolved addresses are sorted by placing IPv6 - * addresses before IPv4 addresses. Default value is configurable using - * {@link setDefaultResultOrder} or [`--dns-result-order`](https://nodejs.org/docs/latest-v22.x/api/cli.html#--dns-result-orderorder). - * @default `verbatim` (addresses are not reordered) - * @since v22.1.0 - */ - order?: "ipv4first" | "ipv6first" | "verbatim" | undefined; - /** - * When `true`, the callback receives IPv4 and IPv6 addresses in the order the DNS resolver returned them. When `false`, IPv4 - * addresses are placed before IPv6 addresses. This option will be deprecated in favor of `order`. When both are specified, - * `order` has higher precedence. New code should only use `order`. Default value is configurable using {@link setDefaultResultOrder} - * @default true (addresses are not reordered) - * @deprecated Please use `order` option - */ - verbatim?: boolean | undefined; - } - export interface LookupOneOptions extends LookupOptions { - all?: false | undefined; - } - export interface LookupAllOptions extends LookupOptions { - all: true; - } - export interface LookupAddress { - /** - * A string representation of an IPv4 or IPv6 address. - */ - address: string; - /** - * `4` or `6`, denoting the family of `address`, or `0` if the address is not an IPv4 or IPv6 address. `0` is a likely indicator of a - * bug in the name resolution service used by the operating system. - */ - family: number; - } - /** - * Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or - * AAAA (IPv6) record. All `option` properties are optional. If `options` is an - * integer, then it must be `4` or `6` – if `options` is `0` or not provided, then - * IPv4 and IPv6 addresses are both returned if found. - * - * With the `all` option set to `true`, the arguments for `callback` change to `(err, addresses)`, with `addresses` being an array of objects with the - * properties `address` and `family`. - * - * On error, `err` is an `Error` object, where `err.code` is the error code. - * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when - * the host name does not exist but also when the lookup fails in other ways - * such as no available file descriptors. - * - * `dns.lookup()` does not necessarily have anything to do with the DNS protocol. - * The implementation uses an operating system facility that can associate names - * with addresses and vice versa. This implementation can have subtle but - * important consequences on the behavior of any Node.js program. Please take some - * time to consult the [Implementation considerations section](https://nodejs.org/docs/latest-v22.x/api/dns.html#implementation-considerations) - * before using `dns.lookup()`. - * - * Example usage: - * - * ```js - * import dns from 'node:dns'; - * const options = { - * family: 6, - * hints: dns.ADDRCONFIG | dns.V4MAPPED, - * }; - * dns.lookup('example.com', options, (err, address, family) => - * console.log('address: %j family: IPv%s', address, family)); - * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6 - * - * // When options.all is true, the result will be an Array. - * options.all = true; - * dns.lookup('example.com', options, (err, addresses) => - * console.log('addresses: %j', addresses)); - * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}] - * ``` - * - * If this method is invoked as its [util.promisify()](https://nodejs.org/docs/latest-v22.x/api/util.html#utilpromisifyoriginal) ed - * version, and `all` is not set to `true`, it returns a `Promise` for an `Object` with `address` and `family` properties. - * @since v0.1.90 - */ - export function lookup( - hostname: string, - family: number, - callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void, - ): void; - export function lookup( - hostname: string, - options: LookupOneOptions, - callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void, - ): void; - export function lookup( - hostname: string, - options: LookupAllOptions, - callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void, - ): void; - export function lookup( - hostname: string, - options: LookupOptions, - callback: (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family: number) => void, - ): void; - export function lookup( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void, - ): void; - export namespace lookup { - function __promisify__(hostname: string, options: LookupAllOptions): Promise; - function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise; - function __promisify__(hostname: string, options: LookupOptions): Promise; - } - /** - * Resolves the given `address` and `port` into a host name and service using - * the operating system's underlying `getnameinfo` implementation. - * - * If `address` is not a valid IP address, a `TypeError` will be thrown. - * The `port` will be coerced to a number. If it is not a legal port, a `TypeError` will be thrown. - * - * On an error, `err` is an [`Error`](https://nodejs.org/docs/latest-v22.x/api/errors.html#class-error) object, - * where `err.code` is the error code. - * - * ```js - * import dns from 'node:dns'; - * dns.lookupService('127.0.0.1', 22, (err, hostname, service) => { - * console.log(hostname, service); - * // Prints: localhost ssh - * }); - * ``` - * - * If this method is invoked as its [util.promisify()](https://nodejs.org/docs/latest-v22.x/api/util.html#utilpromisifyoriginal) ed - * version, it returns a `Promise` for an `Object` with `hostname` and `service` properties. - * @since v0.11.14 - */ - export function lookupService( - address: string, - port: number, - callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void, - ): void; - export namespace lookupService { - function __promisify__( - address: string, - port: number, - ): Promise<{ - hostname: string; - service: string; - }>; - } - export interface ResolveOptions { - ttl: boolean; - } - export interface ResolveWithTtlOptions extends ResolveOptions { - ttl: true; - } - export interface RecordWithTtl { - address: string; - ttl: number; - } - /** @deprecated Use `AnyARecord` or `AnyAaaaRecord` instead. */ - export type AnyRecordWithTtl = AnyARecord | AnyAaaaRecord; - export interface AnyARecord extends RecordWithTtl { - type: "A"; - } - export interface AnyAaaaRecord extends RecordWithTtl { - type: "AAAA"; - } - export interface CaaRecord { - critical: number; - issue?: string | undefined; - issuewild?: string | undefined; - iodef?: string | undefined; - contactemail?: string | undefined; - contactphone?: string | undefined; - } - export interface MxRecord { - priority: number; - exchange: string; - } - export interface AnyMxRecord extends MxRecord { - type: "MX"; - } - export interface NaptrRecord { - flags: string; - service: string; - regexp: string; - replacement: string; - order: number; - preference: number; - } - export interface AnyNaptrRecord extends NaptrRecord { - type: "NAPTR"; - } - export interface SoaRecord { - nsname: string; - hostmaster: string; - serial: number; - refresh: number; - retry: number; - expire: number; - minttl: number; - } - export interface AnySoaRecord extends SoaRecord { - type: "SOA"; - } - export interface SrvRecord { - priority: number; - weight: number; - port: number; - name: string; - } - export interface AnySrvRecord extends SrvRecord { - type: "SRV"; - } - export interface AnyTxtRecord { - type: "TXT"; - entries: string[]; - } - export interface AnyNsRecord { - type: "NS"; - value: string; - } - export interface AnyPtrRecord { - type: "PTR"; - value: string; - } - export interface AnyCnameRecord { - type: "CNAME"; - value: string; - } - export type AnyRecord = - | AnyARecord - | AnyAaaaRecord - | AnyCnameRecord - | AnyMxRecord - | AnyNaptrRecord - | AnyNsRecord - | AnyPtrRecord - | AnySoaRecord - | AnySrvRecord - | AnyTxtRecord; - /** - * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array - * of the resource records. The `callback` function has arguments `(err, records)`. When successful, `records` will be an array of resource - * records. The type and structure of individual results varies based on `rrtype`: - * - * - * - * On error, `err` is an [`Error`](https://nodejs.org/docs/latest-v22.x/api/errors.html#class-error) object, - * where `err.code` is one of the `DNS error codes`. - * @since v0.1.27 - * @param hostname Host name to resolve. - * @param [rrtype='A'] Resource record type. - */ - export function resolve( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "A", - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "AAAA", - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "ANY", - callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "CNAME", - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "MX", - callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "NAPTR", - callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "NS", - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "PTR", - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "SOA", - callback: (err: NodeJS.ErrnoException | null, addresses: SoaRecord) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "SRV", - callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "TXT", - callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: string, - callback: ( - err: NodeJS.ErrnoException | null, - addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[], - ) => void, - ): void; - export namespace resolve { - function __promisify__(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise; - function __promisify__(hostname: string, rrtype: "ANY"): Promise; - function __promisify__(hostname: string, rrtype: "MX"): Promise; - function __promisify__(hostname: string, rrtype: "NAPTR"): Promise; - function __promisify__(hostname: string, rrtype: "SOA"): Promise; - function __promisify__(hostname: string, rrtype: "SRV"): Promise; - function __promisify__(hostname: string, rrtype: "TXT"): Promise; - function __promisify__( - hostname: string, - rrtype: string, - ): Promise; - } - /** - * Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the `hostname`. The `addresses` argument passed to the `callback` function - * will contain an array of IPv4 addresses (e.g.`['74.125.79.104', '74.125.79.105', '74.125.79.106']`). - * @since v0.1.16 - * @param hostname Host name to resolve. - */ - export function resolve4( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve4( - hostname: string, - options: ResolveWithTtlOptions, - callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void, - ): void; - export function resolve4( - hostname: string, - options: ResolveOptions, - callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void, - ): void; - export namespace resolve4 { - function __promisify__(hostname: string): Promise; - function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; - function __promisify__(hostname: string, options?: ResolveOptions): Promise; - } - /** - * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the `hostname`. The `addresses` argument passed to the `callback` function - * will contain an array of IPv6 addresses. - * @since v0.1.16 - * @param hostname Host name to resolve. - */ - export function resolve6( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve6( - hostname: string, - options: ResolveWithTtlOptions, - callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void, - ): void; - export function resolve6( - hostname: string, - options: ResolveOptions, - callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void, - ): void; - export namespace resolve6 { - function __promisify__(hostname: string): Promise; - function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; - function __promisify__(hostname: string, options?: ResolveOptions): Promise; - } - /** - * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. The `addresses` argument passed to the `callback` function - * will contain an array of canonical name records available for the `hostname` (e.g. `['bar.example.com']`). - * @since v0.3.2 - */ - export function resolveCname( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export namespace resolveCname { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve `CAA` records for the `hostname`. The `addresses` argument passed to the `callback` function - * will contain an array of certification authority authorization records - * available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'}, {critical: 128, issue: 'pki.example.com'}]`). - * @since v15.0.0, v14.17.0 - */ - export function resolveCaa( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void, - ): void; - export namespace resolveCaa { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the `hostname`. The `addresses` argument passed to the `callback` function will - * contain an array of objects containing both a `priority` and `exchange` property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`). - * @since v0.1.27 - */ - export function resolveMx( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void, - ): void; - export namespace resolveMx { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve regular expression-based records (`NAPTR` records) for the `hostname`. The `addresses` argument passed to the `callback` function will contain an array of - * objects with the following properties: - * - * * `flags` - * * `service` - * * `regexp` - * * `replacement` - * * `order` - * * `preference` - * - * ```js - * { - * flags: 's', - * service: 'SIP+D2U', - * regexp: '', - * replacement: '_sip._udp.example.com', - * order: 30, - * preference: 100 - * } - * ``` - * @since v0.9.12 - */ - export function resolveNaptr( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void, - ): void; - export namespace resolveNaptr { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve name server records (`NS` records) for the `hostname`. The `addresses` argument passed to the `callback` function will - * contain an array of name server records available for `hostname` (e.g. `['ns1.example.com', 'ns2.example.com']`). - * @since v0.1.90 - */ - export function resolveNs( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export namespace resolveNs { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve pointer records (`PTR` records) for the `hostname`. The `addresses` argument passed to the `callback` function will - * be an array of strings containing the reply records. - * @since v6.0.0 - */ - export function resolvePtr( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export namespace resolvePtr { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for - * the `hostname`. The `address` argument passed to the `callback` function will - * be an object with the following properties: - * - * * `nsname` - * * `hostmaster` - * * `serial` - * * `refresh` - * * `retry` - * * `expire` - * * `minttl` - * - * ```js - * { - * nsname: 'ns.example.com', - * hostmaster: 'root.example.com', - * serial: 2013101809, - * refresh: 10000, - * retry: 2400, - * expire: 604800, - * minttl: 3600 - * } - * ``` - * @since v0.11.10 - */ - export function resolveSoa( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void, - ): void; - export namespace resolveSoa { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve service records (`SRV` records) for the `hostname`. The `addresses` argument passed to the `callback` function will - * be an array of objects with the following properties: - * - * * `priority` - * * `weight` - * * `port` - * * `name` - * - * ```js - * { - * priority: 10, - * weight: 5, - * port: 21223, - * name: 'service.example.com' - * } - * ``` - * @since v0.1.27 - */ - export function resolveSrv( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void, - ): void; - export namespace resolveSrv { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve text queries (`TXT` records) for the `hostname`. The `records` argument passed to the `callback` function is a - * two-dimensional array of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of - * one record. Depending on the use case, these could be either joined together or - * treated separately. - * @since v0.1.27 - */ - export function resolveTxt( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void, - ): void; - export namespace resolveTxt { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query). - * The `ret` argument passed to the `callback` function will be an array containing - * various types of records. Each object has a property `type` that indicates the - * type of the current record. And depending on the `type`, additional properties - * will be present on the object: - * - * - * - * Here is an example of the `ret` object passed to the callback: - * - * ```js - * [ { type: 'A', address: '127.0.0.1', ttl: 299 }, - * { type: 'CNAME', value: 'example.com' }, - * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 }, - * { type: 'NS', value: 'ns1.example.com' }, - * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] }, - * { type: 'SOA', - * nsname: 'ns1.example.com', - * hostmaster: 'admin.example.com', - * serial: 156696742, - * refresh: 900, - * retry: 900, - * expire: 1800, - * minttl: 60 } ] - * ``` - * - * DNS server operators may choose not to respond to `ANY` queries. It may be better to call individual methods like {@link resolve4}, {@link resolveMx}, and so on. For more details, see - * [RFC 8482](https://tools.ietf.org/html/rfc8482). - */ - export function resolveAny( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void, - ): void; - export namespace resolveAny { - function __promisify__(hostname: string): Promise; - } - /** - * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an - * array of host names. - * - * On error, `err` is an [`Error`](https://nodejs.org/docs/latest-v22.x/api/errors.html#class-error) object, where `err.code` is - * one of the [DNS error codes](https://nodejs.org/docs/latest-v22.x/api/dns.html#error-codes). - * @since v0.1.16 - */ - export function reverse( - ip: string, - callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void, - ): void; - /** - * Get the default value for `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v22.x/api/dns.html#dnspromiseslookuphostname-options). - * The value could be: - * - * * `ipv4first`: for `order` defaulting to `ipv4first`. - * * `ipv6first`: for `order` defaulting to `ipv6first`. - * * `verbatim`: for `order` defaulting to `verbatim`. - * @since v18.17.0 - */ - export function getDefaultResultOrder(): "ipv4first" | "ipv6first" | "verbatim"; - /** - * Sets the IP address and port of servers to be used when performing DNS - * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted - * addresses. If the port is the IANA default DNS port (53) it can be omitted. - * - * ```js - * dns.setServers([ - * '4.4.4.4', - * '[2001:4860:4860::8888]', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ]); - * ``` - * - * An error will be thrown if an invalid address is provided. - * - * The `dns.setServers()` method must not be called while a DNS query is in - * progress. - * - * The {@link setServers} method affects only {@link resolve}, `dns.resolve*()` and {@link reverse} (and specifically _not_ {@link lookup}). - * - * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). - * That is, if attempting to resolve with the first server provided results in a `NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with - * subsequent servers provided. Fallback DNS servers will only be used if the - * earlier ones time out or result in some other error. - * @since v0.11.3 - * @param servers array of [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952#section-6) formatted addresses - */ - export function setServers(servers: readonly string[]): void; - /** - * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6), - * that are currently configured for DNS resolution. A string will include a port - * section if a custom port is used. - * - * ```js - * [ - * '4.4.4.4', - * '2001:4860:4860::8888', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ] - * ``` - * @since v0.11.3 - */ - export function getServers(): string[]; - /** - * Set the default value of `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v22.x/api/dns.html#dnspromiseslookuphostname-options). - * The value could be: - * - * * `ipv4first`: sets default `order` to `ipv4first`. - * * `ipv6first`: sets default `order` to `ipv6first`. - * * `verbatim`: sets default `order` to `verbatim`. - * - * The default is `verbatim` and {@link setDefaultResultOrder} have higher - * priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v22.x/api/cli.html#--dns-result-orderorder). When using - * [worker threads](https://nodejs.org/docs/latest-v22.x/api/worker_threads.html), {@link setDefaultResultOrder} from the main - * thread won't affect the default dns orders in workers. - * @since v16.4.0, v14.18.0 - * @param order must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`. - */ - export function setDefaultResultOrder(order: "ipv4first" | "ipv6first" | "verbatim"): void; - // Error codes - export const NODATA: "ENODATA"; - export const FORMERR: "EFORMERR"; - export const SERVFAIL: "ESERVFAIL"; - export const NOTFOUND: "ENOTFOUND"; - export const NOTIMP: "ENOTIMP"; - export const REFUSED: "EREFUSED"; - export const BADQUERY: "EBADQUERY"; - export const BADNAME: "EBADNAME"; - export const BADFAMILY: "EBADFAMILY"; - export const BADRESP: "EBADRESP"; - export const CONNREFUSED: "ECONNREFUSED"; - export const TIMEOUT: "ETIMEOUT"; - export const EOF: "EOF"; - export const FILE: "EFILE"; - export const NOMEM: "ENOMEM"; - export const DESTRUCTION: "EDESTRUCTION"; - export const BADSTR: "EBADSTR"; - export const BADFLAGS: "EBADFLAGS"; - export const NONAME: "ENONAME"; - export const BADHINTS: "EBADHINTS"; - export const NOTINITIALIZED: "ENOTINITIALIZED"; - export const LOADIPHLPAPI: "ELOADIPHLPAPI"; - export const ADDRGETNETWORKPARAMS: "EADDRGETNETWORKPARAMS"; - export const CANCELLED: "ECANCELLED"; - export interface ResolverOptions { - /** - * Query timeout in milliseconds, or `-1` to use the default timeout. - */ - timeout?: number | undefined; - /** - * The number of tries the resolver will try contacting each name server before giving up. - * @default 4 - */ - tries?: number; - } - /** - * An independent resolver for DNS requests. - * - * Creating a new resolver uses the default server settings. Setting - * the servers used for a resolver using [`resolver.setServers()`](https://nodejs.org/docs/latest-v22.x/api/dns.html#dnssetserversservers) does not affect - * other resolvers: - * - * ```js - * import { Resolver } from 'node:dns'; - * const resolver = new Resolver(); - * resolver.setServers(['4.4.4.4']); - * - * // This request will use the server at 4.4.4.4, independent of global settings. - * resolver.resolve4('example.org', (err, addresses) => { - * // ... - * }); - * ``` - * - * The following methods from the `node:dns` module are available: - * - * * `resolver.getServers()` - * * `resolver.resolve()` - * * `resolver.resolve4()` - * * `resolver.resolve6()` - * * `resolver.resolveAny()` - * * `resolver.resolveCaa()` - * * `resolver.resolveCname()` - * * `resolver.resolveMx()` - * * `resolver.resolveNaptr()` - * * `resolver.resolveNs()` - * * `resolver.resolvePtr()` - * * `resolver.resolveSoa()` - * * `resolver.resolveSrv()` - * * `resolver.resolveTxt()` - * * `resolver.reverse()` - * * `resolver.setServers()` - * @since v8.3.0 - */ - export class Resolver { - constructor(options?: ResolverOptions); - /** - * Cancel all outstanding DNS queries made by this resolver. The corresponding - * callbacks will be called with an error with code `ECANCELLED`. - * @since v8.3.0 - */ - cancel(): void; - getServers: typeof getServers; - resolve: typeof resolve; - resolve4: typeof resolve4; - resolve6: typeof resolve6; - resolveAny: typeof resolveAny; - resolveCaa: typeof resolveCaa; - resolveCname: typeof resolveCname; - resolveMx: typeof resolveMx; - resolveNaptr: typeof resolveNaptr; - resolveNs: typeof resolveNs; - resolvePtr: typeof resolvePtr; - resolveSoa: typeof resolveSoa; - resolveSrv: typeof resolveSrv; - resolveTxt: typeof resolveTxt; - reverse: typeof reverse; - /** - * The resolver instance will send its requests from the specified IP address. - * This allows programs to specify outbound interfaces when used on multi-homed - * systems. - * - * If a v4 or v6 address is not specified, it is set to the default and the - * operating system will choose a local address automatically. - * - * The resolver will use the v4 local address when making requests to IPv4 DNS - * servers, and the v6 local address when making requests to IPv6 DNS servers. - * The `rrtype` of resolution requests has no impact on the local address used. - * @since v15.1.0, v14.17.0 - * @param [ipv4='0.0.0.0'] A string representation of an IPv4 address. - * @param [ipv6='::0'] A string representation of an IPv6 address. - */ - setLocalAddress(ipv4?: string, ipv6?: string): void; - setServers: typeof setServers; - } - export { dnsPromises as promises }; -} -declare module "node:dns" { - export * from "dns"; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/dns/promises.d.ts b/tools/mnemonic-test/node_modules/@types/node/dns/promises.d.ts deleted file mode 100644 index 2b5dff02..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/dns/promises.d.ts +++ /dev/null @@ -1,476 +0,0 @@ -/** - * The `dns.promises` API provides an alternative set of asynchronous DNS methods - * that return `Promise` objects rather than using callbacks. The API is accessible - * via `import { promises as dnsPromises } from 'node:dns'` or `import dnsPromises from 'node:dns/promises'`. - * @since v10.6.0 - */ -declare module "dns/promises" { - import { - AnyRecord, - CaaRecord, - LookupAddress, - LookupAllOptions, - LookupOneOptions, - LookupOptions, - MxRecord, - NaptrRecord, - RecordWithTtl, - ResolveOptions, - ResolverOptions, - ResolveWithTtlOptions, - SoaRecord, - SrvRecord, - } from "node:dns"; - /** - * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6), - * that are currently configured for DNS resolution. A string will include a port - * section if a custom port is used. - * - * ```js - * [ - * '4.4.4.4', - * '2001:4860:4860::8888', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ] - * ``` - * @since v10.6.0 - */ - function getServers(): string[]; - /** - * Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or - * AAAA (IPv6) record. All `option` properties are optional. If `options` is an - * integer, then it must be `4` or `6` – if `options` is not provided, then IPv4 - * and IPv6 addresses are both returned if found. - * - * With the `all` option set to `true`, the `Promise` is resolved with `addresses` being an array of objects with the properties `address` and `family`. - * - * On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code` is the error code. - * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when - * the host name does not exist but also when the lookup fails in other ways - * such as no available file descriptors. - * - * [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options) does not necessarily have anything to do with the DNS - * protocol. The implementation uses an operating system facility that can - * associate names with addresses and vice versa. This implementation can have - * subtle but important consequences on the behavior of any Node.js program. Please - * take some time to consult the [Implementation considerations section](https://nodejs.org/docs/latest-v20.x/api/dns.html#implementation-considerations) before - * using `dnsPromises.lookup()`. - * - * Example usage: - * - * ```js - * import dns from 'node:dns'; - * const dnsPromises = dns.promises; - * const options = { - * family: 6, - * hints: dns.ADDRCONFIG | dns.V4MAPPED, - * }; - * - * dnsPromises.lookup('example.com', options).then((result) => { - * console.log('address: %j family: IPv%s', result.address, result.family); - * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6 - * }); - * - * // When options.all is true, the result will be an Array. - * options.all = true; - * dnsPromises.lookup('example.com', options).then((result) => { - * console.log('addresses: %j', result); - * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}] - * }); - * ``` - * @since v10.6.0 - */ - function lookup(hostname: string, family: number): Promise; - function lookup(hostname: string, options: LookupOneOptions): Promise; - function lookup(hostname: string, options: LookupAllOptions): Promise; - function lookup(hostname: string, options: LookupOptions): Promise; - function lookup(hostname: string): Promise; - /** - * Resolves the given `address` and `port` into a host name and service using - * the operating system's underlying `getnameinfo` implementation. - * - * If `address` is not a valid IP address, a `TypeError` will be thrown. - * The `port` will be coerced to a number. If it is not a legal port, a `TypeError` will be thrown. - * - * On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code` is the error code. - * - * ```js - * import dnsPromises from 'node:dns'; - * dnsPromises.lookupService('127.0.0.1', 22).then((result) => { - * console.log(result.hostname, result.service); - * // Prints: localhost ssh - * }); - * ``` - * @since v10.6.0 - */ - function lookupService( - address: string, - port: number, - ): Promise<{ - hostname: string; - service: string; - }>; - /** - * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array - * of the resource records. When successful, the `Promise` is resolved with an - * array of resource records. The type and structure of individual results vary - * based on `rrtype`: - * - * - * - * On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code` - * is one of the [DNS error codes](https://nodejs.org/docs/latest-v20.x/api/dns.html#error-codes). - * @since v10.6.0 - * @param hostname Host name to resolve. - * @param [rrtype='A'] Resource record type. - */ - function resolve(hostname: string): Promise; - function resolve(hostname: string, rrtype: "A"): Promise; - function resolve(hostname: string, rrtype: "AAAA"): Promise; - function resolve(hostname: string, rrtype: "ANY"): Promise; - function resolve(hostname: string, rrtype: "CAA"): Promise; - function resolve(hostname: string, rrtype: "CNAME"): Promise; - function resolve(hostname: string, rrtype: "MX"): Promise; - function resolve(hostname: string, rrtype: "NAPTR"): Promise; - function resolve(hostname: string, rrtype: "NS"): Promise; - function resolve(hostname: string, rrtype: "PTR"): Promise; - function resolve(hostname: string, rrtype: "SOA"): Promise; - function resolve(hostname: string, rrtype: "SRV"): Promise; - function resolve(hostname: string, rrtype: "TXT"): Promise; - function resolve( - hostname: string, - rrtype: string, - ): Promise; - /** - * Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the `hostname`. On success, the `Promise` is resolved with an array of IPv4 - * addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`). - * @since v10.6.0 - * @param hostname Host name to resolve. - */ - function resolve4(hostname: string): Promise; - function resolve4(hostname: string, options: ResolveWithTtlOptions): Promise; - function resolve4(hostname: string, options: ResolveOptions): Promise; - /** - * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the `hostname`. On success, the `Promise` is resolved with an array of IPv6 - * addresses. - * @since v10.6.0 - * @param hostname Host name to resolve. - */ - function resolve6(hostname: string): Promise; - function resolve6(hostname: string, options: ResolveWithTtlOptions): Promise; - function resolve6(hostname: string, options: ResolveOptions): Promise; - /** - * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query). - * On success, the `Promise` is resolved with an array containing various types of - * records. Each object has a property `type` that indicates the type of the - * current record. And depending on the `type`, additional properties will be - * present on the object: - * - * - * - * Here is an example of the result object: - * - * ```js - * [ { type: 'A', address: '127.0.0.1', ttl: 299 }, - * { type: 'CNAME', value: 'example.com' }, - * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 }, - * { type: 'NS', value: 'ns1.example.com' }, - * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] }, - * { type: 'SOA', - * nsname: 'ns1.example.com', - * hostmaster: 'admin.example.com', - * serial: 156696742, - * refresh: 900, - * retry: 900, - * expire: 1800, - * minttl: 60 } ] - * ``` - * @since v10.6.0 - */ - function resolveAny(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve `CAA` records for the `hostname`. On success, - * the `Promise` is resolved with an array of objects containing available - * certification authority authorization records available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'},{critical: 128, issue: 'pki.example.com'}]`). - * @since v15.0.0, v14.17.0 - */ - function resolveCaa(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. On success, - * the `Promise` is resolved with an array of canonical name records available for - * the `hostname` (e.g. `['bar.example.com']`). - * @since v10.6.0 - */ - function resolveCname(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the `hostname`. On success, the `Promise` is resolved with an array of objects - * containing both a `priority` and `exchange` property (e.g.`[{priority: 10, exchange: 'mx.example.com'}, ...]`). - * @since v10.6.0 - */ - function resolveMx(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve regular expression-based records (`NAPTR` records) for the `hostname`. On success, the `Promise` is resolved with an array - * of objects with the following properties: - * - * * `flags` - * * `service` - * * `regexp` - * * `replacement` - * * `order` - * * `preference` - * - * ```js - * { - * flags: 's', - * service: 'SIP+D2U', - * regexp: '', - * replacement: '_sip._udp.example.com', - * order: 30, - * preference: 100 - * } - * ``` - * @since v10.6.0 - */ - function resolveNaptr(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve name server records (`NS` records) for the `hostname`. On success, the `Promise` is resolved with an array of name server - * records available for `hostname` (e.g.`['ns1.example.com', 'ns2.example.com']`). - * @since v10.6.0 - */ - function resolveNs(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve pointer records (`PTR` records) for the `hostname`. On success, the `Promise` is resolved with an array of strings - * containing the reply records. - * @since v10.6.0 - */ - function resolvePtr(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for - * the `hostname`. On success, the `Promise` is resolved with an object with the - * following properties: - * - * * `nsname` - * * `hostmaster` - * * `serial` - * * `refresh` - * * `retry` - * * `expire` - * * `minttl` - * - * ```js - * { - * nsname: 'ns.example.com', - * hostmaster: 'root.example.com', - * serial: 2013101809, - * refresh: 10000, - * retry: 2400, - * expire: 604800, - * minttl: 3600 - * } - * ``` - * @since v10.6.0 - */ - function resolveSoa(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve service records (`SRV` records) for the `hostname`. On success, the `Promise` is resolved with an array of objects with - * the following properties: - * - * * `priority` - * * `weight` - * * `port` - * * `name` - * - * ```js - * { - * priority: 10, - * weight: 5, - * port: 21223, - * name: 'service.example.com' - * } - * ``` - * @since v10.6.0 - */ - function resolveSrv(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve text queries (`TXT` records) for the `hostname`. On success, the `Promise` is resolved with a two-dimensional array - * of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of - * one record. Depending on the use case, these could be either joined together or - * treated separately. - * @since v10.6.0 - */ - function resolveTxt(hostname: string): Promise; - /** - * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an - * array of host names. - * - * On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code` - * is one of the [DNS error codes](https://nodejs.org/docs/latest-v20.x/api/dns.html#error-codes). - * @since v10.6.0 - */ - function reverse(ip: string): Promise; - /** - * Get the default value for `verbatim` in {@link lookup} and [dnsPromises.lookup()](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options). - * The value could be: - * - * * `ipv4first`: for `verbatim` defaulting to `false`. - * * `verbatim`: for `verbatim` defaulting to `true`. - * @since v20.1.0 - */ - function getDefaultResultOrder(): "ipv4first" | "verbatim"; - /** - * Sets the IP address and port of servers to be used when performing DNS - * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted - * addresses. If the port is the IANA default DNS port (53) it can be omitted. - * - * ```js - * dnsPromises.setServers([ - * '4.4.4.4', - * '[2001:4860:4860::8888]', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ]); - * ``` - * - * An error will be thrown if an invalid address is provided. - * - * The `dnsPromises.setServers()` method must not be called while a DNS query is in - * progress. - * - * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). - * That is, if attempting to resolve with the first server provided results in a `NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with - * subsequent servers provided. Fallback DNS servers will only be used if the - * earlier ones time out or result in some other error. - * @since v10.6.0 - * @param servers array of `RFC 5952` formatted addresses - */ - function setServers(servers: readonly string[]): void; - /** - * Set the default value of `order` in `dns.lookup()` and `{@link lookup}`. The value could be: - * - * * `ipv4first`: sets default `order` to `ipv4first`. - * * `ipv6first`: sets default `order` to `ipv6first`. - * * `verbatim`: sets default `order` to `verbatim`. - * - * The default is `verbatim` and [dnsPromises.setDefaultResultOrder()](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromisessetdefaultresultorderorder) - * have higher priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder). - * When using [worker threads](https://nodejs.org/docs/latest-v20.x/api/worker_threads.html), [`dnsPromises.setDefaultResultOrder()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromisessetdefaultresultorderorder) - * from the main thread won't affect the default dns orders in workers. - * @since v16.4.0, v14.18.0 - * @param order must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`. - */ - function setDefaultResultOrder(order: "ipv4first" | "ipv6first" | "verbatim"): void; - // Error codes - const NODATA: "ENODATA"; - const FORMERR: "EFORMERR"; - const SERVFAIL: "ESERVFAIL"; - const NOTFOUND: "ENOTFOUND"; - const NOTIMP: "ENOTIMP"; - const REFUSED: "EREFUSED"; - const BADQUERY: "EBADQUERY"; - const BADNAME: "EBADNAME"; - const BADFAMILY: "EBADFAMILY"; - const BADRESP: "EBADRESP"; - const CONNREFUSED: "ECONNREFUSED"; - const TIMEOUT: "ETIMEOUT"; - const EOF: "EOF"; - const FILE: "EFILE"; - const NOMEM: "ENOMEM"; - const DESTRUCTION: "EDESTRUCTION"; - const BADSTR: "EBADSTR"; - const BADFLAGS: "EBADFLAGS"; - const NONAME: "ENONAME"; - const BADHINTS: "EBADHINTS"; - const NOTINITIALIZED: "ENOTINITIALIZED"; - const LOADIPHLPAPI: "ELOADIPHLPAPI"; - const ADDRGETNETWORKPARAMS: "EADDRGETNETWORKPARAMS"; - const CANCELLED: "ECANCELLED"; - - /** - * An independent resolver for DNS requests. - * - * Creating a new resolver uses the default server settings. Setting - * the servers used for a resolver using [`resolver.setServers()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromisessetserversservers) does not affect - * other resolvers: - * - * ```js - * import { promises } from 'node:dns'; - * const resolver = new promises.Resolver(); - * resolver.setServers(['4.4.4.4']); - * - * // This request will use the server at 4.4.4.4, independent of global settings. - * resolver.resolve4('example.org').then((addresses) => { - * // ... - * }); - * - * // Alternatively, the same code can be written using async-await style. - * (async function() { - * const addresses = await resolver.resolve4('example.org'); - * })(); - * ``` - * - * The following methods from the `dnsPromises` API are available: - * - * * `resolver.getServers()` - * * `resolver.resolve()` - * * `resolver.resolve4()` - * * `resolver.resolve6()` - * * `resolver.resolveAny()` - * * `resolver.resolveCaa()` - * * `resolver.resolveCname()` - * * `resolver.resolveMx()` - * * `resolver.resolveNaptr()` - * * `resolver.resolveNs()` - * * `resolver.resolvePtr()` - * * `resolver.resolveSoa()` - * * `resolver.resolveSrv()` - * * `resolver.resolveTxt()` - * * `resolver.reverse()` - * * `resolver.setServers()` - * @since v10.6.0 - */ - class Resolver { - constructor(options?: ResolverOptions); - /** - * Cancel all outstanding DNS queries made by this resolver. The corresponding - * callbacks will be called with an error with code `ECANCELLED`. - * @since v8.3.0 - */ - cancel(): void; - getServers: typeof getServers; - resolve: typeof resolve; - resolve4: typeof resolve4; - resolve6: typeof resolve6; - resolveAny: typeof resolveAny; - resolveCaa: typeof resolveCaa; - resolveCname: typeof resolveCname; - resolveMx: typeof resolveMx; - resolveNaptr: typeof resolveNaptr; - resolveNs: typeof resolveNs; - resolvePtr: typeof resolvePtr; - resolveSoa: typeof resolveSoa; - resolveSrv: typeof resolveSrv; - resolveTxt: typeof resolveTxt; - reverse: typeof reverse; - /** - * The resolver instance will send its requests from the specified IP address. - * This allows programs to specify outbound interfaces when used on multi-homed - * systems. - * - * If a v4 or v6 address is not specified, it is set to the default and the - * operating system will choose a local address automatically. - * - * The resolver will use the v4 local address when making requests to IPv4 DNS - * servers, and the v6 local address when making requests to IPv6 DNS servers. - * The `rrtype` of resolution requests has no impact on the local address used. - * @since v15.1.0, v14.17.0 - * @param [ipv4='0.0.0.0'] A string representation of an IPv4 address. - * @param [ipv6='::0'] A string representation of an IPv6 address. - */ - setLocalAddress(ipv4?: string, ipv6?: string): void; - setServers: typeof setServers; - } -} -declare module "node:dns/promises" { - export * from "dns/promises"; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/dom-events.d.ts b/tools/mnemonic-test/node_modules/@types/node/dom-events.d.ts deleted file mode 100644 index f47f71d6..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/dom-events.d.ts +++ /dev/null @@ -1,124 +0,0 @@ -export {}; // Don't export anything! - -//// DOM-like Events -// NB: The Event / EventTarget / EventListener implementations below were copied -// from lib.dom.d.ts, then edited to reflect Node's documentation at -// https://nodejs.org/api/events.html#class-eventtarget. -// Please read that link to understand important implementation differences. - -// This conditional type will be the existing global Event in a browser, or -// the copy below in a Node environment. -type __Event = typeof globalThis extends { onmessage: any; Event: any } ? {} - : { - /** This is not used in Node.js and is provided purely for completeness. */ - readonly bubbles: boolean; - /** Alias for event.stopPropagation(). This is not used in Node.js and is provided purely for completeness. */ - cancelBubble: () => void; - /** True if the event was created with the cancelable option */ - readonly cancelable: boolean; - /** This is not used in Node.js and is provided purely for completeness. */ - readonly composed: boolean; - /** Returns an array containing the current EventTarget as the only entry or empty if the event is not being dispatched. This is not used in Node.js and is provided purely for completeness. */ - composedPath(): [EventTarget?]; - /** Alias for event.target. */ - readonly currentTarget: EventTarget | null; - /** Is true if cancelable is true and event.preventDefault() has been called. */ - readonly defaultPrevented: boolean; - /** This is not used in Node.js and is provided purely for completeness. */ - readonly eventPhase: 0 | 2; - /** The `AbortSignal` "abort" event is emitted with `isTrusted` set to `true`. The value is `false` in all other cases. */ - readonly isTrusted: boolean; - /** Sets the `defaultPrevented` property to `true` if `cancelable` is `true`. */ - preventDefault(): void; - /** This is not used in Node.js and is provided purely for completeness. */ - returnValue: boolean; - /** Alias for event.target. */ - readonly srcElement: EventTarget | null; - /** Stops the invocation of event listeners after the current one completes. */ - stopImmediatePropagation(): void; - /** This is not used in Node.js and is provided purely for completeness. */ - stopPropagation(): void; - /** The `EventTarget` dispatching the event */ - readonly target: EventTarget | null; - /** The millisecond timestamp when the Event object was created. */ - readonly timeStamp: number; - /** Returns the type of event, e.g. "click", "hashchange", or "submit". */ - readonly type: string; - }; - -// See comment above explaining conditional type -type __EventTarget = typeof globalThis extends { onmessage: any; EventTarget: any } ? {} - : { - /** - * Adds a new handler for the `type` event. Any given `listener` is added only once per `type` and per `capture` option value. - * - * If the `once` option is true, the `listener` is removed after the next time a `type` event is dispatched. - * - * The `capture` option is not used by Node.js in any functional way other than tracking registered event listeners per the `EventTarget` specification. - * Specifically, the `capture` option is used as part of the key when registering a `listener`. - * Any individual `listener` may be added once with `capture = false`, and once with `capture = true`. - */ - addEventListener( - type: string, - listener: EventListener | EventListenerObject, - options?: AddEventListenerOptions | boolean, - ): void; - /** Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. */ - dispatchEvent(event: Event): boolean; - /** Removes the event listener in target's event listener list with the same type, callback, and options. */ - removeEventListener( - type: string, - listener: EventListener | EventListenerObject, - options?: EventListenerOptions | boolean, - ): void; - }; - -interface EventInit { - bubbles?: boolean; - cancelable?: boolean; - composed?: boolean; -} - -interface EventListenerOptions { - /** Not directly used by Node.js. Added for API completeness. Default: `false`. */ - capture?: boolean; -} - -interface AddEventListenerOptions extends EventListenerOptions { - /** When `true`, the listener is automatically removed when it is first invoked. Default: `false`. */ - once?: boolean; - /** When `true`, serves as a hint that the listener will not call the `Event` object's `preventDefault()` method. Default: false. */ - passive?: boolean; - /** The listener will be removed when the given AbortSignal object's `abort()` method is called. */ - signal?: AbortSignal; -} - -interface EventListener { - (evt: Event): void; -} - -interface EventListenerObject { - handleEvent(object: Event): void; -} - -import {} from "events"; // Make this an ambient declaration -declare global { - /** An event which takes place in the DOM. */ - interface Event extends __Event {} - var Event: typeof globalThis extends { onmessage: any; Event: infer T } ? T - : { - prototype: __Event; - new(type: string, eventInitDict?: EventInit): __Event; - }; - - /** - * EventTarget is a DOM interface implemented by objects that can - * receive events and may have listeners for them. - */ - interface EventTarget extends __EventTarget {} - var EventTarget: typeof globalThis extends { onmessage: any; EventTarget: infer T } ? T - : { - prototype: __EventTarget; - new(): __EventTarget; - }; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/domain.d.ts b/tools/mnemonic-test/node_modules/@types/node/domain.d.ts deleted file mode 100644 index ba8a02c1..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/domain.d.ts +++ /dev/null @@ -1,170 +0,0 @@ -/** - * **This module is pending deprecation.** Once a replacement API has been - * finalized, this module will be fully deprecated. Most developers should - * **not** have cause to use this module. Users who absolutely must have - * the functionality that domains provide may rely on it for the time being - * but should expect to have to migrate to a different solution - * in the future. - * - * Domains provide a way to handle multiple different IO operations as a - * single group. If any of the event emitters or callbacks registered to a - * domain emit an `'error'` event, or throw an error, then the domain object - * will be notified, rather than losing the context of the error in the `process.on('uncaughtException')` handler, or causing the program to - * exit immediately with an error code. - * @deprecated Since v1.4.2 - Deprecated - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/domain.js) - */ -declare module "domain" { - import EventEmitter = require("node:events"); - /** - * The `Domain` class encapsulates the functionality of routing errors and - * uncaught exceptions to the active `Domain` object. - * - * To handle the errors that it catches, listen to its `'error'` event. - */ - class Domain extends EventEmitter { - /** - * An array of timers and event emitters that have been explicitly added - * to the domain. - */ - members: Array; - /** - * The `enter()` method is plumbing used by the `run()`, `bind()`, and `intercept()` methods to set the active domain. It sets `domain.active` and `process.domain` to the domain, and implicitly - * pushes the domain onto the domain - * stack managed by the domain module (see {@link exit} for details on the - * domain stack). The call to `enter()` delimits the beginning of a chain of - * asynchronous calls and I/O operations bound to a domain. - * - * Calling `enter()` changes only the active domain, and does not alter the domain - * itself. `enter()` and `exit()` can be called an arbitrary number of times on a - * single domain. - */ - enter(): void; - /** - * The `exit()` method exits the current domain, popping it off the domain stack. - * Any time execution is going to switch to the context of a different chain of - * asynchronous calls, it's important to ensure that the current domain is exited. - * The call to `exit()` delimits either the end of or an interruption to the chain - * of asynchronous calls and I/O operations bound to a domain. - * - * If there are multiple, nested domains bound to the current execution context, `exit()` will exit any domains nested within this domain. - * - * Calling `exit()` changes only the active domain, and does not alter the domain - * itself. `enter()` and `exit()` can be called an arbitrary number of times on a - * single domain. - */ - exit(): void; - /** - * Run the supplied function in the context of the domain, implicitly - * binding all event emitters, timers, and low-level requests that are - * created in that context. Optionally, arguments can be passed to - * the function. - * - * This is the most basic way to use a domain. - * - * ```js - * import domain from 'node:domain'; - * import fs from 'node:fs'; - * const d = domain.create(); - * d.on('error', (er) => { - * console.error('Caught error!', er); - * }); - * d.run(() => { - * process.nextTick(() => { - * setTimeout(() => { // Simulating some various async stuff - * fs.open('non-existent file', 'r', (er, fd) => { - * if (er) throw er; - * // proceed... - * }); - * }, 100); - * }); - * }); - * ``` - * - * In this example, the `d.on('error')` handler will be triggered, rather - * than crashing the program. - */ - run(fn: (...args: any[]) => T, ...args: any[]): T; - /** - * Explicitly adds an emitter to the domain. If any event handlers called by - * the emitter throw an error, or if the emitter emits an `'error'` event, it - * will be routed to the domain's `'error'` event, just like with implicit - * binding. - * - * This also works with timers that are returned from `setInterval()` and `setTimeout()`. If their callback function throws, it will be caught by - * the domain `'error'` handler. - * - * If the Timer or `EventEmitter` was already bound to a domain, it is removed - * from that one, and bound to this one instead. - * @param emitter emitter or timer to be added to the domain - */ - add(emitter: EventEmitter | NodeJS.Timer): void; - /** - * The opposite of {@link add}. Removes domain handling from the - * specified emitter. - * @param emitter emitter or timer to be removed from the domain - */ - remove(emitter: EventEmitter | NodeJS.Timer): void; - /** - * The returned function will be a wrapper around the supplied callback - * function. When the returned function is called, any errors that are - * thrown will be routed to the domain's `'error'` event. - * - * ```js - * const d = domain.create(); - * - * function readSomeFile(filename, cb) { - * fs.readFile(filename, 'utf8', d.bind((er, data) => { - * // If this throws, it will also be passed to the domain. - * return cb(er, data ? JSON.parse(data) : null); - * })); - * } - * - * d.on('error', (er) => { - * // An error occurred somewhere. If we throw it now, it will crash the program - * // with the normal line number and stack message. - * }); - * ``` - * @param callback The callback function - * @return The bound function - */ - bind(callback: T): T; - /** - * This method is almost identical to {@link bind}. However, in - * addition to catching thrown errors, it will also intercept `Error` objects sent as the first argument to the function. - * - * In this way, the common `if (err) return callback(err);` pattern can be replaced - * with a single error handler in a single place. - * - * ```js - * const d = domain.create(); - * - * function readSomeFile(filename, cb) { - * fs.readFile(filename, 'utf8', d.intercept((data) => { - * // Note, the first argument is never passed to the - * // callback since it is assumed to be the 'Error' argument - * // and thus intercepted by the domain. - * - * // If this throws, it will also be passed to the domain - * // so the error-handling logic can be moved to the 'error' - * // event on the domain instead of being repeated throughout - * // the program. - * return cb(null, JSON.parse(data)); - * })); - * } - * - * d.on('error', (er) => { - * // An error occurred somewhere. If we throw it now, it will crash the program - * // with the normal line number and stack message. - * }); - * ``` - * @param callback The callback function - * @return The intercepted function - */ - intercept(callback: T): T; - } - function create(): Domain; -} -declare module "node:domain" { - export * from "domain"; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/events.d.ts b/tools/mnemonic-test/node_modules/@types/node/events.d.ts deleted file mode 100644 index 48a26f7e..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/events.d.ts +++ /dev/null @@ -1,931 +0,0 @@ -/** - * Much of the Node.js core API is built around an idiomatic asynchronous - * event-driven architecture in which certain kinds of objects (called "emitters") - * emit named events that cause `Function` objects ("listeners") to be called. - * - * For instance: a `net.Server` object emits an event each time a peer - * connects to it; a `fs.ReadStream` emits an event when the file is opened; - * a `stream` emits an event whenever data is available to be read. - * - * All objects that emit events are instances of the `EventEmitter` class. These - * objects expose an `eventEmitter.on()` function that allows one or more - * functions to be attached to named events emitted by the object. Typically, - * event names are camel-cased strings but any valid JavaScript property key - * can be used. - * - * When the `EventEmitter` object emits an event, all of the functions attached - * to that specific event are called _synchronously_. Any values returned by the - * called listeners are _ignored_ and discarded. - * - * The following example shows a simple `EventEmitter` instance with a single - * listener. The `eventEmitter.on()` method is used to register listeners, while - * the `eventEmitter.emit()` method is used to trigger the event. - * - * ```js - * import { EventEmitter } from 'node:events'; - * - * class MyEmitter extends EventEmitter {} - * - * const myEmitter = new MyEmitter(); - * myEmitter.on('event', () => { - * console.log('an event occurred!'); - * }); - * myEmitter.emit('event'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/events.js) - */ -declare module "events" { - import { AsyncResource, AsyncResourceOptions } from "node:async_hooks"; - // NOTE: This class is in the docs but is **not actually exported** by Node. - // If https://github.com/nodejs/node/issues/39903 gets resolved and Node - // actually starts exporting the class, uncomment below. - // import { EventListener, EventListenerObject } from '__dom-events'; - // /** The NodeEventTarget is a Node.js-specific extension to EventTarget that emulates a subset of the EventEmitter API. */ - // interface NodeEventTarget extends EventTarget { - // /** - // * Node.js-specific extension to the `EventTarget` class that emulates the equivalent `EventEmitter` API. - // * The only difference between `addListener()` and `addEventListener()` is that addListener() will return a reference to the EventTarget. - // */ - // addListener(type: string, listener: EventListener | EventListenerObject, options?: { once: boolean }): this; - // /** Node.js-specific extension to the `EventTarget` class that returns an array of event `type` names for which event listeners are registered. */ - // eventNames(): string[]; - // /** Node.js-specific extension to the `EventTarget` class that returns the number of event listeners registered for the `type`. */ - // listenerCount(type: string): number; - // /** Node.js-specific alias for `eventTarget.removeListener()`. */ - // off(type: string, listener: EventListener | EventListenerObject): this; - // /** Node.js-specific alias for `eventTarget.addListener()`. */ - // on(type: string, listener: EventListener | EventListenerObject, options?: { once: boolean }): this; - // /** Node.js-specific extension to the `EventTarget` class that adds a `once` listener for the given event `type`. This is equivalent to calling `on` with the `once` option set to `true`. */ - // once(type: string, listener: EventListener | EventListenerObject): this; - // /** - // * Node.js-specific extension to the `EventTarget` class. - // * If `type` is specified, removes all registered listeners for `type`, - // * otherwise removes all registered listeners. - // */ - // removeAllListeners(type: string): this; - // /** - // * Node.js-specific extension to the `EventTarget` class that removes the listener for the given `type`. - // * The only difference between `removeListener()` and `removeEventListener()` is that `removeListener()` will return a reference to the `EventTarget`. - // */ - // removeListener(type: string, listener: EventListener | EventListenerObject): this; - // } - interface EventEmitterOptions { - /** - * Enables automatic capturing of promise rejection. - */ - captureRejections?: boolean | undefined; - } - interface StaticEventEmitterOptions { - /** - * Can be used to cancel awaiting events. - */ - signal?: AbortSignal | undefined; - } - interface StaticEventEmitterIteratorOptions extends StaticEventEmitterOptions { - /** - * Names of events that will end the iteration. - */ - close?: string[] | undefined; - /** - * The high watermark. The emitter is paused every time the size of events being buffered is higher than it. - * Supported only on emitters implementing `pause()` and `resume()` methods. - * @default Number.MAX_SAFE_INTEGER - */ - highWaterMark?: number | undefined; - /** - * The low watermark. The emitter is resumed every time the size of events being buffered is lower than it. - * Supported only on emitters implementing `pause()` and `resume()` methods. - * @default 1 - */ - lowWaterMark?: number | undefined; - } - interface EventEmitter = DefaultEventMap> extends NodeJS.EventEmitter {} - type EventMap = Record | DefaultEventMap; - type DefaultEventMap = [never]; - type AnyRest = [...args: any[]]; - type Args = T extends DefaultEventMap ? AnyRest : ( - K extends keyof T ? T[K] : never - ); - type Key = T extends DefaultEventMap ? string | symbol : K | keyof T; - type Key2 = T extends DefaultEventMap ? string | symbol : K & keyof T; - type Listener = T extends DefaultEventMap ? F : ( - K extends keyof T ? ( - T[K] extends unknown[] ? (...args: T[K]) => void : never - ) - : never - ); - type Listener1 = Listener void>; - type Listener2 = Listener; - - /** - * The `EventEmitter` class is defined and exposed by the `node:events` module: - * - * ```js - * import { EventEmitter } from 'node:events'; - * ``` - * - * All `EventEmitter`s emit the event `'newListener'` when new listeners are - * added and `'removeListener'` when existing listeners are removed. - * - * It supports the following option: - * @since v0.1.26 - */ - class EventEmitter = DefaultEventMap> { - constructor(options?: EventEmitterOptions); - - [EventEmitter.captureRejectionSymbol]?(error: Error, event: Key, ...args: Args): void; - - /** - * Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given - * event or that is rejected if the `EventEmitter` emits `'error'` while waiting. - * The `Promise` will resolve with an array of all the arguments emitted to the - * given event. - * - * This method is intentionally generic and works with the web platform [EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event - * semantics and does not listen to the `'error'` event. - * - * ```js - * import { once, EventEmitter } from 'node:events'; - * import process from 'node:process'; - * - * const ee = new EventEmitter(); - * - * process.nextTick(() => { - * ee.emit('myevent', 42); - * }); - * - * const [value] = await once(ee, 'myevent'); - * console.log(value); - * - * const err = new Error('kaboom'); - * process.nextTick(() => { - * ee.emit('error', err); - * }); - * - * try { - * await once(ee, 'myevent'); - * } catch (err) { - * console.error('error happened', err); - * } - * ``` - * - * The special handling of the `'error'` event is only used when `events.once()` is used to wait for another event. If `events.once()` is used to wait for the - * '`error'` event itself, then it is treated as any other kind of event without - * special handling: - * - * ```js - * import { EventEmitter, once } from 'node:events'; - * - * const ee = new EventEmitter(); - * - * once(ee, 'error') - * .then(([err]) => console.log('ok', err.message)) - * .catch((err) => console.error('error', err.message)); - * - * ee.emit('error', new Error('boom')); - * - * // Prints: ok boom - * ``` - * - * An `AbortSignal` can be used to cancel waiting for the event: - * - * ```js - * import { EventEmitter, once } from 'node:events'; - * - * const ee = new EventEmitter(); - * const ac = new AbortController(); - * - * async function foo(emitter, event, signal) { - * try { - * await once(emitter, event, { signal }); - * console.log('event emitted!'); - * } catch (error) { - * if (error.name === 'AbortError') { - * console.error('Waiting for the event was canceled!'); - * } else { - * console.error('There was an error', error.message); - * } - * } - * } - * - * foo(ee, 'foo', ac.signal); - * ac.abort(); // Abort waiting for the event - * ee.emit('foo'); // Prints: Waiting for the event was canceled! - * ``` - * @since v11.13.0, v10.16.0 - */ - static once( - emitter: NodeJS.EventEmitter, - eventName: string | symbol, - options?: StaticEventEmitterOptions, - ): Promise; - static once(emitter: EventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise; - /** - * ```js - * import { on, EventEmitter } from 'node:events'; - * import process from 'node:process'; - * - * const ee = new EventEmitter(); - * - * // Emit later on - * process.nextTick(() => { - * ee.emit('foo', 'bar'); - * ee.emit('foo', 42); - * }); - * - * for await (const event of on(ee, 'foo')) { - * // The execution of this inner block is synchronous and it - * // processes one event at a time (even with await). Do not use - * // if concurrent execution is required. - * console.log(event); // prints ['bar'] [42] - * } - * // Unreachable here - * ``` - * - * Returns an `AsyncIterator` that iterates `eventName` events. It will throw - * if the `EventEmitter` emits `'error'`. It removes all listeners when - * exiting the loop. The `value` returned by each iteration is an array - * composed of the emitted event arguments. - * - * An `AbortSignal` can be used to cancel waiting on events: - * - * ```js - * import { on, EventEmitter } from 'node:events'; - * import process from 'node:process'; - * - * const ac = new AbortController(); - * - * (async () => { - * const ee = new EventEmitter(); - * - * // Emit later on - * process.nextTick(() => { - * ee.emit('foo', 'bar'); - * ee.emit('foo', 42); - * }); - * - * for await (const event of on(ee, 'foo', { signal: ac.signal })) { - * // The execution of this inner block is synchronous and it - * // processes one event at a time (even with await). Do not use - * // if concurrent execution is required. - * console.log(event); // prints ['bar'] [42] - * } - * // Unreachable here - * })(); - * - * process.nextTick(() => ac.abort()); - * ``` - * - * Use the `close` option to specify an array of event names that will end the iteration: - * - * ```js - * import { on, EventEmitter } from 'node:events'; - * import process from 'node:process'; - * - * const ee = new EventEmitter(); - * - * // Emit later on - * process.nextTick(() => { - * ee.emit('foo', 'bar'); - * ee.emit('foo', 42); - * ee.emit('close'); - * }); - * - * for await (const event of on(ee, 'foo', { close: ['close'] })) { - * console.log(event); // prints ['bar'] [42] - * } - * // the loop will exit after 'close' is emitted - * console.log('done'); // prints 'done' - * ``` - * @since v13.6.0, v12.16.0 - * @return An `AsyncIterator` that iterates `eventName` events emitted by the `emitter` - */ - static on( - emitter: NodeJS.EventEmitter, - eventName: string | symbol, - options?: StaticEventEmitterIteratorOptions, - ): AsyncIterableIterator; - static on( - emitter: EventTarget, - eventName: string, - options?: StaticEventEmitterIteratorOptions, - ): AsyncIterableIterator; - /** - * A class method that returns the number of listeners for the given `eventName` registered on the given `emitter`. - * - * ```js - * import { EventEmitter, listenerCount } from 'node:events'; - * - * const myEmitter = new EventEmitter(); - * myEmitter.on('event', () => {}); - * myEmitter.on('event', () => {}); - * console.log(listenerCount(myEmitter, 'event')); - * // Prints: 2 - * ``` - * @since v0.9.12 - * @deprecated Since v3.2.0 - Use `listenerCount` instead. - * @param emitter The emitter to query - * @param eventName The event name - */ - static listenerCount(emitter: NodeJS.EventEmitter, eventName: string | symbol): number; - /** - * Returns a copy of the array of listeners for the event named `eventName`. - * - * For `EventEmitter`s this behaves exactly the same as calling `.listeners` on - * the emitter. - * - * For `EventTarget`s this is the only way to get the event listeners for the - * event target. This is useful for debugging and diagnostic purposes. - * - * ```js - * import { getEventListeners, EventEmitter } from 'node:events'; - * - * { - * const ee = new EventEmitter(); - * const listener = () => console.log('Events are fun'); - * ee.on('foo', listener); - * console.log(getEventListeners(ee, 'foo')); // [ [Function: listener] ] - * } - * { - * const et = new EventTarget(); - * const listener = () => console.log('Events are fun'); - * et.addEventListener('foo', listener); - * console.log(getEventListeners(et, 'foo')); // [ [Function: listener] ] - * } - * ``` - * @since v15.2.0, v14.17.0 - */ - static getEventListeners(emitter: EventTarget | NodeJS.EventEmitter, name: string | symbol): Function[]; - /** - * Returns the currently set max amount of listeners. - * - * For `EventEmitter`s this behaves exactly the same as calling `.getMaxListeners` on - * the emitter. - * - * For `EventTarget`s this is the only way to get the max event listeners for the - * event target. If the number of event handlers on a single EventTarget exceeds - * the max set, the EventTarget will print a warning. - * - * ```js - * import { getMaxListeners, setMaxListeners, EventEmitter } from 'node:events'; - * - * { - * const ee = new EventEmitter(); - * console.log(getMaxListeners(ee)); // 10 - * setMaxListeners(11, ee); - * console.log(getMaxListeners(ee)); // 11 - * } - * { - * const et = new EventTarget(); - * console.log(getMaxListeners(et)); // 10 - * setMaxListeners(11, et); - * console.log(getMaxListeners(et)); // 11 - * } - * ``` - * @since v19.9.0 - */ - static getMaxListeners(emitter: EventTarget | NodeJS.EventEmitter): number; - /** - * ```js - * import { setMaxListeners, EventEmitter } from 'node:events'; - * - * const target = new EventTarget(); - * const emitter = new EventEmitter(); - * - * setMaxListeners(5, target, emitter); - * ``` - * @since v15.4.0 - * @param n A non-negative number. The maximum number of listeners per `EventTarget` event. - * @param eventTargets Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, `n` is set as the default max for all newly created {EventTarget} and {EventEmitter} - * objects. - */ - static setMaxListeners(n?: number, ...eventTargets: Array): void; - /** - * Listens once to the `abort` event on the provided `signal`. - * - * Listening to the `abort` event on abort signals is unsafe and may - * lead to resource leaks since another third party with the signal can - * call `e.stopImmediatePropagation()`. Unfortunately Node.js cannot change - * this since it would violate the web standard. Additionally, the original - * API makes it easy to forget to remove listeners. - * - * This API allows safely using `AbortSignal`s in Node.js APIs by solving these - * two issues by listening to the event such that `stopImmediatePropagation` does - * not prevent the listener from running. - * - * Returns a disposable so that it may be unsubscribed from more easily. - * - * ```js - * import { addAbortListener } from 'node:events'; - * - * function example(signal) { - * let disposable; - * try { - * signal.addEventListener('abort', (e) => e.stopImmediatePropagation()); - * disposable = addAbortListener(signal, (e) => { - * // Do something when signal is aborted. - * }); - * } finally { - * disposable?.[Symbol.dispose](); - * } - * } - * ``` - * @since v20.5.0 - * @experimental - * @return Disposable that removes the `abort` listener. - */ - static addAbortListener(signal: AbortSignal, resource: (event: Event) => void): Disposable; - /** - * This symbol shall be used to install a listener for only monitoring `'error'` events. Listeners installed using this symbol are called before the regular `'error'` listeners are called. - * - * Installing a listener using this symbol does not change the behavior once an `'error'` event is emitted. Therefore, the process will still crash if no - * regular `'error'` listener is installed. - * @since v13.6.0, v12.17.0 - */ - static readonly errorMonitor: unique symbol; - /** - * Value: `Symbol.for('nodejs.rejection')` - * - * See how to write a custom `rejection handler`. - * @since v13.4.0, v12.16.0 - */ - static readonly captureRejectionSymbol: unique symbol; - /** - * Value: [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) - * - * Change the default `captureRejections` option on all new `EventEmitter` objects. - * @since v13.4.0, v12.16.0 - */ - static captureRejections: boolean; - /** - * By default, a maximum of `10` listeners can be registered for any single - * event. This limit can be changed for individual `EventEmitter` instances - * using the `emitter.setMaxListeners(n)` method. To change the default - * for _all_`EventEmitter` instances, the `events.defaultMaxListeners` property - * can be used. If this value is not a positive number, a `RangeError` is thrown. - * - * Take caution when setting the `events.defaultMaxListeners` because the - * change affects _all_ `EventEmitter` instances, including those created before - * the change is made. However, calling `emitter.setMaxListeners(n)` still has - * precedence over `events.defaultMaxListeners`. - * - * This is not a hard limit. The `EventEmitter` instance will allow - * more listeners to be added but will output a trace warning to stderr indicating - * that a "possible EventEmitter memory leak" has been detected. For any single - * `EventEmitter`, the `emitter.getMaxListeners()` and `emitter.setMaxListeners()` methods can be used to - * temporarily avoid this warning: - * - * ```js - * import { EventEmitter } from 'node:events'; - * const emitter = new EventEmitter(); - * emitter.setMaxListeners(emitter.getMaxListeners() + 1); - * emitter.once('event', () => { - * // do stuff - * emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0)); - * }); - * ``` - * - * The `--trace-warnings` command-line flag can be used to display the - * stack trace for such warnings. - * - * The emitted warning can be inspected with `process.on('warning')` and will - * have the additional `emitter`, `type`, and `count` properties, referring to - * the event emitter instance, the event's name and the number of attached - * listeners, respectively. - * Its `name` property is set to `'MaxListenersExceededWarning'`. - * @since v0.11.2 - */ - static defaultMaxListeners: number; - } - import internal = require("node:events"); - namespace EventEmitter { - // Should just be `export { EventEmitter }`, but that doesn't work in TypeScript 3.4 - export { internal as EventEmitter }; - export interface Abortable { - /** - * When provided the corresponding `AbortController` can be used to cancel an asynchronous action. - */ - signal?: AbortSignal | undefined; - } - - export interface EventEmitterReferencingAsyncResource extends AsyncResource { - readonly eventEmitter: EventEmitterAsyncResource; - } - - export interface EventEmitterAsyncResourceOptions extends AsyncResourceOptions, EventEmitterOptions { - /** - * The type of async event, this is required when instantiating `EventEmitterAsyncResource` - * directly rather than as a child class. - * @default new.target.name if instantiated as a child class. - */ - name?: string; - } - - /** - * Integrates `EventEmitter` with `AsyncResource` for `EventEmitter`s that - * require manual async tracking. Specifically, all events emitted by instances - * of `events.EventEmitterAsyncResource` will run within its `async context`. - * - * ```js - * import { EventEmitterAsyncResource, EventEmitter } from 'node:events'; - * import { notStrictEqual, strictEqual } from 'node:assert'; - * import { executionAsyncId, triggerAsyncId } from 'node:async_hooks'; - * - * // Async tracking tooling will identify this as 'Q'. - * const ee1 = new EventEmitterAsyncResource({ name: 'Q' }); - * - * // 'foo' listeners will run in the EventEmitters async context. - * ee1.on('foo', () => { - * strictEqual(executionAsyncId(), ee1.asyncId); - * strictEqual(triggerAsyncId(), ee1.triggerAsyncId); - * }); - * - * const ee2 = new EventEmitter(); - * - * // 'foo' listeners on ordinary EventEmitters that do not track async - * // context, however, run in the same async context as the emit(). - * ee2.on('foo', () => { - * notStrictEqual(executionAsyncId(), ee2.asyncId); - * notStrictEqual(triggerAsyncId(), ee2.triggerAsyncId); - * }); - * - * Promise.resolve().then(() => { - * ee1.emit('foo'); - * ee2.emit('foo'); - * }); - * ``` - * - * The `EventEmitterAsyncResource` class has the same methods and takes the - * same options as `EventEmitter` and `AsyncResource` themselves. - * @since v17.4.0, v16.14.0 - */ - export class EventEmitterAsyncResource extends EventEmitter { - /** - * @param options Only optional in child class. - */ - constructor(options?: EventEmitterAsyncResourceOptions); - /** - * Call all `destroy` hooks. This should only ever be called once. An error will - * be thrown if it is called more than once. This **must** be manually called. If - * the resource is left to be collected by the GC then the `destroy` hooks will - * never be called. - */ - emitDestroy(): void; - /** - * The unique `asyncId` assigned to the resource. - */ - readonly asyncId: number; - /** - * The same triggerAsyncId that is passed to the AsyncResource constructor. - */ - readonly triggerAsyncId: number; - /** - * The returned `AsyncResource` object has an additional `eventEmitter` property - * that provides a reference to this `EventEmitterAsyncResource`. - */ - readonly asyncResource: EventEmitterReferencingAsyncResource; - } - } - global { - namespace NodeJS { - interface EventEmitter = DefaultEventMap> { - [EventEmitter.captureRejectionSymbol]?(error: Error, event: Key, ...args: Args): void; - /** - * Alias for `emitter.on(eventName, listener)`. - * @since v0.1.26 - */ - addListener(eventName: Key, listener: Listener1): this; - /** - * Adds the `listener` function to the end of the listeners array for the event - * named `eventName`. No checks are made to see if the `listener` has already - * been added. Multiple calls passing the same combination of `eventName` and - * `listener` will result in the `listener` being added, and called, multiple times. - * - * ```js - * server.on('connection', (stream) => { - * console.log('someone connected!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * - * By default, event listeners are invoked in the order they are added. The `emitter.prependListener()` method can be used as an alternative to add the - * event listener to the beginning of the listeners array. - * - * ```js - * import { EventEmitter } from 'node:events'; - * const myEE = new EventEmitter(); - * myEE.on('foo', () => console.log('a')); - * myEE.prependListener('foo', () => console.log('b')); - * myEE.emit('foo'); - * // Prints: - * // b - * // a - * ``` - * @since v0.1.101 - * @param eventName The name of the event. - * @param listener The callback function - */ - on(eventName: Key, listener: Listener1): this; - /** - * Adds a **one-time** `listener` function for the event named `eventName`. The - * next time `eventName` is triggered, this listener is removed and then invoked. - * - * ```js - * server.once('connection', (stream) => { - * console.log('Ah, we have our first user!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * - * By default, event listeners are invoked in the order they are added. The `emitter.prependOnceListener()` method can be used as an alternative to add the - * event listener to the beginning of the listeners array. - * - * ```js - * import { EventEmitter } from 'node:events'; - * const myEE = new EventEmitter(); - * myEE.once('foo', () => console.log('a')); - * myEE.prependOnceListener('foo', () => console.log('b')); - * myEE.emit('foo'); - * // Prints: - * // b - * // a - * ``` - * @since v0.3.0 - * @param eventName The name of the event. - * @param listener The callback function - */ - once(eventName: Key, listener: Listener1): this; - /** - * Removes the specified `listener` from the listener array for the event named `eventName`. - * - * ```js - * const callback = (stream) => { - * console.log('someone connected!'); - * }; - * server.on('connection', callback); - * // ... - * server.removeListener('connection', callback); - * ``` - * - * `removeListener()` will remove, at most, one instance of a listener from the - * listener array. If any single listener has been added multiple times to the - * listener array for the specified `eventName`, then `removeListener()` must be - * called multiple times to remove each instance. - * - * Once an event is emitted, all listeners attached to it at the - * time of emitting are called in order. This implies that any `removeListener()` or `removeAllListeners()` calls _after_ emitting and _before_ the last listener finishes execution - * will not remove them from`emit()` in progress. Subsequent events behave as expected. - * - * ```js - * import { EventEmitter } from 'node:events'; - * class MyEmitter extends EventEmitter {} - * const myEmitter = new MyEmitter(); - * - * const callbackA = () => { - * console.log('A'); - * myEmitter.removeListener('event', callbackB); - * }; - * - * const callbackB = () => { - * console.log('B'); - * }; - * - * myEmitter.on('event', callbackA); - * - * myEmitter.on('event', callbackB); - * - * // callbackA removes listener callbackB but it will still be called. - * // Internal listener array at time of emit [callbackA, callbackB] - * myEmitter.emit('event'); - * // Prints: - * // A - * // B - * - * // callbackB is now removed. - * // Internal listener array [callbackA] - * myEmitter.emit('event'); - * // Prints: - * // A - * ``` - * - * Because listeners are managed using an internal array, calling this will - * change the position indices of any listener registered _after_ the listener - * being removed. This will not impact the order in which listeners are called, - * but it means that any copies of the listener array as returned by - * the `emitter.listeners()` method will need to be recreated. - * - * When a single function has been added as a handler multiple times for a single - * event (as in the example below), `removeListener()` will remove the most - * recently added instance. In the example the `once('ping')` listener is removed: - * - * ```js - * import { EventEmitter } from 'node:events'; - * const ee = new EventEmitter(); - * - * function pong() { - * console.log('pong'); - * } - * - * ee.on('ping', pong); - * ee.once('ping', pong); - * ee.removeListener('ping', pong); - * - * ee.emit('ping'); - * ee.emit('ping'); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v0.1.26 - */ - removeListener(eventName: Key, listener: Listener1): this; - /** - * Alias for `emitter.removeListener()`. - * @since v10.0.0 - */ - off(eventName: Key, listener: Listener1): this; - /** - * Removes all listeners, or those of the specified `eventName`. - * - * It is bad practice to remove listeners added elsewhere in the code, - * particularly when the `EventEmitter` instance was created by some other - * component or module (e.g. sockets or file streams). - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v0.1.26 - */ - removeAllListeners(eventName?: Key): this; - /** - * By default `EventEmitter`s will print a warning if more than `10` listeners are - * added for a particular event. This is a useful default that helps finding - * memory leaks. The `emitter.setMaxListeners()` method allows the limit to be - * modified for this specific `EventEmitter` instance. The value can be set to `Infinity` (or `0`) to indicate an unlimited number of listeners. - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v0.3.5 - */ - setMaxListeners(n: number): this; - /** - * Returns the current max listener value for the `EventEmitter` which is either - * set by `emitter.setMaxListeners(n)` or defaults to {@link defaultMaxListeners}. - * @since v1.0.0 - */ - getMaxListeners(): number; - /** - * Returns a copy of the array of listeners for the event named `eventName`. - * - * ```js - * server.on('connection', (stream) => { - * console.log('someone connected!'); - * }); - * console.log(util.inspect(server.listeners('connection'))); - * // Prints: [ [Function] ] - * ``` - * @since v0.1.26 - */ - listeners(eventName: Key): Array>; - /** - * Returns a copy of the array of listeners for the event named `eventName`, - * including any wrappers (such as those created by `.once()`). - * - * ```js - * import { EventEmitter } from 'node:events'; - * const emitter = new EventEmitter(); - * emitter.once('log', () => console.log('log once')); - * - * // Returns a new Array with a function `onceWrapper` which has a property - * // `listener` which contains the original listener bound above - * const listeners = emitter.rawListeners('log'); - * const logFnWrapper = listeners[0]; - * - * // Logs "log once" to the console and does not unbind the `once` event - * logFnWrapper.listener(); - * - * // Logs "log once" to the console and removes the listener - * logFnWrapper(); - * - * emitter.on('log', () => console.log('log persistently')); - * // Will return a new Array with a single function bound by `.on()` above - * const newListeners = emitter.rawListeners('log'); - * - * // Logs "log persistently" twice - * newListeners[0](); - * emitter.emit('log'); - * ``` - * @since v9.4.0 - */ - rawListeners(eventName: Key): Array>; - /** - * Synchronously calls each of the listeners registered for the event named `eventName`, in the order they were registered, passing the supplied arguments - * to each. - * - * Returns `true` if the event had listeners, `false` otherwise. - * - * ```js - * import { EventEmitter } from 'node:events'; - * const myEmitter = new EventEmitter(); - * - * // First listener - * myEmitter.on('event', function firstListener() { - * console.log('Helloooo! first listener'); - * }); - * // Second listener - * myEmitter.on('event', function secondListener(arg1, arg2) { - * console.log(`event with parameters ${arg1}, ${arg2} in second listener`); - * }); - * // Third listener - * myEmitter.on('event', function thirdListener(...args) { - * const parameters = args.join(', '); - * console.log(`event with parameters ${parameters} in third listener`); - * }); - * - * console.log(myEmitter.listeners('event')); - * - * myEmitter.emit('event', 1, 2, 3, 4, 5); - * - * // Prints: - * // [ - * // [Function: firstListener], - * // [Function: secondListener], - * // [Function: thirdListener] - * // ] - * // Helloooo! first listener - * // event with parameters 1, 2 in second listener - * // event with parameters 1, 2, 3, 4, 5 in third listener - * ``` - * @since v0.1.26 - */ - emit(eventName: Key, ...args: Args): boolean; - /** - * Returns the number of listeners listening for the event named `eventName`. - * If `listener` is provided, it will return how many times the listener is found - * in the list of the listeners of the event. - * @since v3.2.0 - * @param eventName The name of the event being listened for - * @param listener The event handler function - */ - listenerCount(eventName: Key, listener?: Listener2): number; - /** - * Adds the `listener` function to the _beginning_ of the listeners array for the - * event named `eventName`. No checks are made to see if the `listener` has - * already been added. Multiple calls passing the same combination of `eventName` - * and `listener` will result in the `listener` being added, and called, multiple times. - * - * ```js - * server.prependListener('connection', (stream) => { - * console.log('someone connected!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v6.0.0 - * @param eventName The name of the event. - * @param listener The callback function - */ - prependListener(eventName: Key, listener: Listener1): this; - /** - * Adds a **one-time**`listener` function for the event named `eventName` to the _beginning_ of the listeners array. The next time `eventName` is triggered, this - * listener is removed, and then invoked. - * - * ```js - * server.prependOnceListener('connection', (stream) => { - * console.log('Ah, we have our first user!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v6.0.0 - * @param eventName The name of the event. - * @param listener The callback function - */ - prependOnceListener(eventName: Key, listener: Listener1): this; - /** - * Returns an array listing the events for which the emitter has registered - * listeners. The values in the array are strings or `Symbol`s. - * - * ```js - * import { EventEmitter } from 'node:events'; - * - * const myEE = new EventEmitter(); - * myEE.on('foo', () => {}); - * myEE.on('bar', () => {}); - * - * const sym = Symbol('symbol'); - * myEE.on(sym, () => {}); - * - * console.log(myEE.eventNames()); - * // Prints: [ 'foo', 'bar', Symbol(symbol) ] - * ``` - * @since v6.0.0 - */ - eventNames(): Array<(string | symbol) & Key2>; - } - } - } - export = EventEmitter; -} -declare module "node:events" { - import events = require("events"); - export = events; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/fs.d.ts b/tools/mnemonic-test/node_modules/@types/node/fs.d.ts deleted file mode 100644 index 9e3669fd..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/fs.d.ts +++ /dev/null @@ -1,4390 +0,0 @@ -/** - * The `node:fs` module enables interacting with the file system in a - * way modeled on standard POSIX functions. - * - * To use the promise-based APIs: - * - * ```js - * import * as fs from 'node:fs/promises'; - * ``` - * - * To use the callback and sync APIs: - * - * ```js - * import * as fs from 'node:fs'; - * ``` - * - * All file system operations have synchronous, callback, and promise-based - * forms, and are accessible using both CommonJS syntax and ES6 Modules (ESM). - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/fs.js) - */ -declare module "fs" { - import * as stream from "node:stream"; - import { Abortable, EventEmitter } from "node:events"; - import { URL } from "node:url"; - import * as promises from "node:fs/promises"; - export { promises }; - /** - * Valid types for path values in "fs". - */ - export type PathLike = string | Buffer | URL; - export type PathOrFileDescriptor = PathLike | number; - export type TimeLike = string | number | Date; - export type NoParamCallback = (err: NodeJS.ErrnoException | null) => void; - export type BufferEncodingOption = - | "buffer" - | { - encoding: "buffer"; - }; - export interface ObjectEncodingOptions { - encoding?: BufferEncoding | null | undefined; - } - export type EncodingOption = ObjectEncodingOptions | BufferEncoding | undefined | null; - export type OpenMode = number | string; - export type Mode = number | string; - export interface StatsBase { - isFile(): boolean; - isDirectory(): boolean; - isBlockDevice(): boolean; - isCharacterDevice(): boolean; - isSymbolicLink(): boolean; - isFIFO(): boolean; - isSocket(): boolean; - dev: T; - ino: T; - mode: T; - nlink: T; - uid: T; - gid: T; - rdev: T; - size: T; - blksize: T; - blocks: T; - atimeMs: T; - mtimeMs: T; - ctimeMs: T; - birthtimeMs: T; - atime: Date; - mtime: Date; - ctime: Date; - birthtime: Date; - } - export interface Stats extends StatsBase {} - /** - * A `fs.Stats` object provides information about a file. - * - * Objects returned from {@link stat}, {@link lstat}, {@link fstat}, and - * their synchronous counterparts are of this type. - * If `bigint` in the `options` passed to those methods is true, the numeric values - * will be `bigint` instead of `number`, and the object will contain additional - * nanosecond-precision properties suffixed with `Ns`. `Stat` objects are not to be created directly using the `new` keyword. - * - * ```console - * Stats { - * dev: 2114, - * ino: 48064969, - * mode: 33188, - * nlink: 1, - * uid: 85, - * gid: 100, - * rdev: 0, - * size: 527, - * blksize: 4096, - * blocks: 8, - * atimeMs: 1318289051000.1, - * mtimeMs: 1318289051000.1, - * ctimeMs: 1318289051000.1, - * birthtimeMs: 1318289051000.1, - * atime: Mon, 10 Oct 2011 23:24:11 GMT, - * mtime: Mon, 10 Oct 2011 23:24:11 GMT, - * ctime: Mon, 10 Oct 2011 23:24:11 GMT, - * birthtime: Mon, 10 Oct 2011 23:24:11 GMT } - * ``` - * - * `bigint` version: - * - * ```console - * BigIntStats { - * dev: 2114n, - * ino: 48064969n, - * mode: 33188n, - * nlink: 1n, - * uid: 85n, - * gid: 100n, - * rdev: 0n, - * size: 527n, - * blksize: 4096n, - * blocks: 8n, - * atimeMs: 1318289051000n, - * mtimeMs: 1318289051000n, - * ctimeMs: 1318289051000n, - * birthtimeMs: 1318289051000n, - * atimeNs: 1318289051000000000n, - * mtimeNs: 1318289051000000000n, - * ctimeNs: 1318289051000000000n, - * birthtimeNs: 1318289051000000000n, - * atime: Mon, 10 Oct 2011 23:24:11 GMT, - * mtime: Mon, 10 Oct 2011 23:24:11 GMT, - * ctime: Mon, 10 Oct 2011 23:24:11 GMT, - * birthtime: Mon, 10 Oct 2011 23:24:11 GMT } - * ``` - * @since v0.1.21 - */ - export class Stats { - private constructor(); - } - export interface StatsFsBase { - /** Type of file system. */ - type: T; - /** Optimal transfer block size. */ - bsize: T; - /** Total data blocks in file system. */ - blocks: T; - /** Free blocks in file system. */ - bfree: T; - /** Available blocks for unprivileged users */ - bavail: T; - /** Total file nodes in file system. */ - files: T; - /** Free file nodes in file system. */ - ffree: T; - } - export interface StatsFs extends StatsFsBase {} - /** - * Provides information about a mounted file system. - * - * Objects returned from {@link statfs} and its synchronous counterpart are of - * this type. If `bigint` in the `options` passed to those methods is `true`, the - * numeric values will be `bigint` instead of `number`. - * - * ```console - * StatFs { - * type: 1397114950, - * bsize: 4096, - * blocks: 121938943, - * bfree: 61058895, - * bavail: 61058895, - * files: 999, - * ffree: 1000000 - * } - * ``` - * - * `bigint` version: - * - * ```console - * StatFs { - * type: 1397114950n, - * bsize: 4096n, - * blocks: 121938943n, - * bfree: 61058895n, - * bavail: 61058895n, - * files: 999n, - * ffree: 1000000n - * } - * ``` - * @since v19.6.0, v18.15.0 - */ - export class StatsFs {} - export interface BigIntStatsFs extends StatsFsBase {} - export interface StatFsOptions { - bigint?: boolean | undefined; - } - /** - * A representation of a directory entry, which can be a file or a subdirectory - * within the directory, as returned by reading from an `fs.Dir`. The - * directory entry is a combination of the file name and file type pairs. - * - * Additionally, when {@link readdir} or {@link readdirSync} is called with - * the `withFileTypes` option set to `true`, the resulting array is filled with `fs.Dirent` objects, rather than strings or `Buffer` s. - * @since v10.10.0 - */ - export class Dirent { - /** - * Returns `true` if the `fs.Dirent` object describes a regular file. - * @since v10.10.0 - */ - isFile(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a file system - * directory. - * @since v10.10.0 - */ - isDirectory(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a block device. - * @since v10.10.0 - */ - isBlockDevice(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a character device. - * @since v10.10.0 - */ - isCharacterDevice(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a symbolic link. - * @since v10.10.0 - */ - isSymbolicLink(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a first-in-first-out - * (FIFO) pipe. - * @since v10.10.0 - */ - isFIFO(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a socket. - * @since v10.10.0 - */ - isSocket(): boolean; - /** - * The file name that this `fs.Dirent` object refers to. The type of this - * value is determined by the `options.encoding` passed to {@link readdir} or {@link readdirSync}. - * @since v10.10.0 - */ - name: string; - /** - * The base path that this `fs.Dirent` object refers to. - * @since v20.12.0 - */ - parentPath: string; - /** - * Alias for `dirent.parentPath`. - * @since v20.1.0 - * @deprecated Since v20.12.0 - */ - path: string; - } - /** - * A class representing a directory stream. - * - * Created by {@link opendir}, {@link opendirSync}, or `fsPromises.opendir()`. - * - * ```js - * import { opendir } from 'node:fs/promises'; - * - * try { - * const dir = await opendir('./'); - * for await (const dirent of dir) - * console.log(dirent.name); - * } catch (err) { - * console.error(err); - * } - * ``` - * - * When using the async iterator, the `fs.Dir` object will be automatically - * closed after the iterator exits. - * @since v12.12.0 - */ - export class Dir implements AsyncIterable { - /** - * The read-only path of this directory as was provided to {@link opendir},{@link opendirSync}, or `fsPromises.opendir()`. - * @since v12.12.0 - */ - readonly path: string; - /** - * Asynchronously iterates over the directory via `readdir(3)` until all entries have been read. - */ - [Symbol.asyncIterator](): AsyncIterableIterator; - /** - * Asynchronously close the directory's underlying resource handle. - * Subsequent reads will result in errors. - * - * A promise is returned that will be fulfilled after the resource has been - * closed. - * @since v12.12.0 - */ - close(): Promise; - close(cb: NoParamCallback): void; - /** - * Synchronously close the directory's underlying resource handle. - * Subsequent reads will result in errors. - * @since v12.12.0 - */ - closeSync(): void; - /** - * Asynchronously read the next directory entry via [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) as an `fs.Dirent`. - * - * A promise is returned that will be fulfilled with an `fs.Dirent`, or `null` if there are no more directory entries to read. - * - * Directory entries returned by this function are in no particular order as - * provided by the operating system's underlying directory mechanisms. - * Entries added or removed while iterating over the directory might not be - * included in the iteration results. - * @since v12.12.0 - * @return containing {fs.Dirent|null} - */ - read(): Promise; - read(cb: (err: NodeJS.ErrnoException | null, dirEnt: Dirent | null) => void): void; - /** - * Synchronously read the next directory entry as an `fs.Dirent`. See the - * POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more detail. - * - * If there are no more directory entries to read, `null` will be returned. - * - * Directory entries returned by this function are in no particular order as - * provided by the operating system's underlying directory mechanisms. - * Entries added or removed while iterating over the directory might not be - * included in the iteration results. - * @since v12.12.0 - */ - readSync(): Dirent | null; - } - /** - * Class: fs.StatWatcher - * @since v14.3.0, v12.20.0 - * Extends `EventEmitter` - * A successful call to {@link watchFile} method will return a new fs.StatWatcher object. - */ - export interface StatWatcher extends EventEmitter { - /** - * When called, requests that the Node.js event loop _not_ exit so long as the `fs.StatWatcher` is active. Calling `watcher.ref()` multiple times will have - * no effect. - * - * By default, all `fs.StatWatcher` objects are "ref'ed", making it normally - * unnecessary to call `watcher.ref()` unless `watcher.unref()` had been - * called previously. - * @since v14.3.0, v12.20.0 - */ - ref(): this; - /** - * When called, the active `fs.StatWatcher` object will not require the Node.js - * event loop to remain active. If there is no other activity keeping the - * event loop running, the process may exit before the `fs.StatWatcher` object's - * callback is invoked. Calling `watcher.unref()` multiple times will have - * no effect. - * @since v14.3.0, v12.20.0 - */ - unref(): this; - } - export interface FSWatcher extends EventEmitter { - /** - * Stop watching for changes on the given `fs.FSWatcher`. Once stopped, the `fs.FSWatcher` object is no longer usable. - * @since v0.5.8 - */ - close(): void; - /** - * When called, requests that the Node.js event loop _not_ exit so long as the `fs.FSWatcher` is active. Calling `watcher.ref()` multiple times will have - * no effect. - * - * By default, all `fs.FSWatcher` objects are "ref'ed", making it normally - * unnecessary to call `watcher.ref()` unless `watcher.unref()` had been - * called previously. - * @since v14.3.0, v12.20.0 - */ - ref(): this; - /** - * When called, the active `fs.FSWatcher` object will not require the Node.js - * event loop to remain active. If there is no other activity keeping the - * event loop running, the process may exit before the `fs.FSWatcher` object's - * callback is invoked. Calling `watcher.unref()` multiple times will have - * no effect. - * @since v14.3.0, v12.20.0 - */ - unref(): this; - /** - * events.EventEmitter - * 1. change - * 2. close - * 3. error - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "error", listener: (error: Error) => void): this; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - on(event: "close", listener: () => void): this; - on(event: "error", listener: (error: Error) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - once(event: "close", listener: () => void): this; - once(event: "error", listener: (error: Error) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "error", listener: (error: Error) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "error", listener: (error: Error) => void): this; - } - /** - * Instances of `fs.ReadStream` are created and returned using the {@link createReadStream} function. - * @since v0.1.93 - */ - export class ReadStream extends stream.Readable { - close(callback?: (err?: NodeJS.ErrnoException | null) => void): void; - /** - * The number of bytes that have been read so far. - * @since v6.4.0 - */ - bytesRead: number; - /** - * The path to the file the stream is reading from as specified in the first - * argument to `fs.createReadStream()`. If `path` is passed as a string, then`readStream.path` will be a string. If `path` is passed as a `Buffer`, then`readStream.path` will be a - * `Buffer`. If `fd` is specified, then`readStream.path` will be `undefined`. - * @since v0.1.93 - */ - path: string | Buffer; - /** - * This property is `true` if the underlying file has not been opened yet, - * i.e. before the `'ready'` event is emitted. - * @since v11.2.0, v10.16.0 - */ - pending: boolean; - /** - * events.EventEmitter - * 1. open - * 2. close - * 3. ready - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: Buffer | string) => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "open", listener: (fd: number) => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "readable", listener: () => void): this; - addListener(event: "ready", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: Buffer | string) => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "open", listener: (fd: number) => void): this; - on(event: "pause", listener: () => void): this; - on(event: "readable", listener: () => void): this; - on(event: "ready", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: Buffer | string) => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "open", listener: (fd: number) => void): this; - once(event: "pause", listener: () => void): this; - once(event: "readable", listener: () => void): this; - once(event: "ready", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "open", listener: (fd: number) => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "readable", listener: () => void): this; - prependListener(event: "ready", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "open", listener: (fd: number) => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "readable", listener: () => void): this; - prependOnceListener(event: "ready", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * * Extends `stream.Writable` - * - * Instances of `fs.WriteStream` are created and returned using the {@link createWriteStream} function. - * @since v0.1.93 - */ - export class WriteStream extends stream.Writable { - /** - * Closes `writeStream`. Optionally accepts a - * callback that will be executed once the `writeStream`is closed. - * @since v0.9.4 - */ - close(callback?: (err?: NodeJS.ErrnoException | null) => void): void; - /** - * The number of bytes written so far. Does not include data that is still queued - * for writing. - * @since v0.4.7 - */ - bytesWritten: number; - /** - * The path to the file the stream is writing to as specified in the first - * argument to {@link createWriteStream}. If `path` is passed as a string, then`writeStream.path` will be a string. If `path` is passed as a `Buffer`, then`writeStream.path` will be a - * `Buffer`. - * @since v0.1.93 - */ - path: string | Buffer; - /** - * This property is `true` if the underlying file has not been opened yet, - * i.e. before the `'ready'` event is emitted. - * @since v11.2.0 - */ - pending: boolean; - /** - * events.EventEmitter - * 1. open - * 2. close - * 3. ready - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "open", listener: (fd: number) => void): this; - addListener(event: "pipe", listener: (src: stream.Readable) => void): this; - addListener(event: "ready", listener: () => void): this; - addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "drain", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "open", listener: (fd: number) => void): this; - on(event: "pipe", listener: (src: stream.Readable) => void): this; - on(event: "ready", listener: () => void): this; - on(event: "unpipe", listener: (src: stream.Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "drain", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "open", listener: (fd: number) => void): this; - once(event: "pipe", listener: (src: stream.Readable) => void): this; - once(event: "ready", listener: () => void): this; - once(event: "unpipe", listener: (src: stream.Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "open", listener: (fd: number) => void): this; - prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "ready", listener: () => void): this; - prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "open", listener: (fd: number) => void): this; - prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "ready", listener: () => void): this; - prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * Asynchronously rename file at `oldPath` to the pathname provided - * as `newPath`. In the case that `newPath` already exists, it will - * be overwritten. If there is a directory at `newPath`, an error will - * be raised instead. No arguments other than a possible exception are - * given to the completion callback. - * - * See also: [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html). - * - * ```js - * import { rename } from 'node:fs'; - * - * rename('oldFile.txt', 'newFile.txt', (err) => { - * if (err) throw err; - * console.log('Rename complete!'); - * }); - * ``` - * @since v0.0.2 - */ - export function rename(oldPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; - export namespace rename { - /** - * Asynchronous rename(2) - Change the name or location of a file or directory. - * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - function __promisify__(oldPath: PathLike, newPath: PathLike): Promise; - } - /** - * Renames the file from `oldPath` to `newPath`. Returns `undefined`. - * - * See the POSIX [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html) documentation for more details. - * @since v0.1.21 - */ - export function renameSync(oldPath: PathLike, newPath: PathLike): void; - /** - * Truncates the file. No arguments other than a possible exception are - * given to the completion callback. A file descriptor can also be passed as the - * first argument. In this case, `fs.ftruncate()` is called. - * - * ```js - * import { truncate } from 'node:fs'; - * // Assuming that 'path/file.txt' is a regular file. - * truncate('path/file.txt', (err) => { - * if (err) throw err; - * console.log('path/file.txt was truncated'); - * }); - * ``` - * - * Passing a file descriptor is deprecated and may result in an error being thrown - * in the future. - * - * See the POSIX [`truncate(2)`](http://man7.org/linux/man-pages/man2/truncate.2.html) documentation for more details. - * @since v0.8.6 - * @param [len=0] - */ - export function truncate(path: PathLike, len: number | undefined | null, callback: NoParamCallback): void; - /** - * Asynchronous truncate(2) - Truncate a file to a specified length. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function truncate(path: PathLike, callback: NoParamCallback): void; - export namespace truncate { - /** - * Asynchronous truncate(2) - Truncate a file to a specified length. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param len If not specified, defaults to `0`. - */ - function __promisify__(path: PathLike, len?: number | null): Promise; - } - /** - * Truncates the file. Returns `undefined`. A file descriptor can also be - * passed as the first argument. In this case, `fs.ftruncateSync()` is called. - * - * Passing a file descriptor is deprecated and may result in an error being thrown - * in the future. - * @since v0.8.6 - * @param [len=0] - */ - export function truncateSync(path: PathLike, len?: number | null): void; - /** - * Truncates the file descriptor. No arguments other than a possible exception are - * given to the completion callback. - * - * See the POSIX [`ftruncate(2)`](http://man7.org/linux/man-pages/man2/ftruncate.2.html) documentation for more detail. - * - * If the file referred to by the file descriptor was larger than `len` bytes, only - * the first `len` bytes will be retained in the file. - * - * For example, the following program retains only the first four bytes of the - * file: - * - * ```js - * import { open, close, ftruncate } from 'node:fs'; - * - * function closeFd(fd) { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * - * open('temp.txt', 'r+', (err, fd) => { - * if (err) throw err; - * - * try { - * ftruncate(fd, 4, (err) => { - * closeFd(fd); - * if (err) throw err; - * }); - * } catch (err) { - * closeFd(fd); - * if (err) throw err; - * } - * }); - * ``` - * - * If the file previously was shorter than `len` bytes, it is extended, and the - * extended part is filled with null bytes (`'\0'`): - * - * If `len` is negative then `0` will be used. - * @since v0.8.6 - * @param [len=0] - */ - export function ftruncate(fd: number, len: number | undefined | null, callback: NoParamCallback): void; - /** - * Asynchronous ftruncate(2) - Truncate a file to a specified length. - * @param fd A file descriptor. - */ - export function ftruncate(fd: number, callback: NoParamCallback): void; - export namespace ftruncate { - /** - * Asynchronous ftruncate(2) - Truncate a file to a specified length. - * @param fd A file descriptor. - * @param len If not specified, defaults to `0`. - */ - function __promisify__(fd: number, len?: number | null): Promise; - } - /** - * Truncates the file descriptor. Returns `undefined`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link ftruncate}. - * @since v0.8.6 - * @param [len=0] - */ - export function ftruncateSync(fd: number, len?: number | null): void; - /** - * Asynchronously changes owner and group of a file. No arguments other than a - * possible exception are given to the completion callback. - * - * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail. - * @since v0.1.97 - */ - export function chown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; - export namespace chown { - /** - * Asynchronous chown(2) - Change ownership of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike, uid: number, gid: number): Promise; - } - /** - * Synchronously changes owner and group of a file. Returns `undefined`. - * This is the synchronous version of {@link chown}. - * - * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail. - * @since v0.1.97 - */ - export function chownSync(path: PathLike, uid: number, gid: number): void; - /** - * Sets the owner of the file. No arguments other than a possible exception are - * given to the completion callback. - * - * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail. - * @since v0.4.7 - */ - export function fchown(fd: number, uid: number, gid: number, callback: NoParamCallback): void; - export namespace fchown { - /** - * Asynchronous fchown(2) - Change ownership of a file. - * @param fd A file descriptor. - */ - function __promisify__(fd: number, uid: number, gid: number): Promise; - } - /** - * Sets the owner of the file. Returns `undefined`. - * - * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail. - * @since v0.4.7 - * @param uid The file's new owner's user id. - * @param gid The file's new group's group id. - */ - export function fchownSync(fd: number, uid: number, gid: number): void; - /** - * Set the owner of the symbolic link. No arguments other than a possible - * exception are given to the completion callback. - * - * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more detail. - */ - export function lchown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; - export namespace lchown { - /** - * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike, uid: number, gid: number): Promise; - } - /** - * Set the owner for the path. Returns `undefined`. - * - * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more details. - * @param uid The file's new owner's user id. - * @param gid The file's new group's group id. - */ - export function lchownSync(path: PathLike, uid: number, gid: number): void; - /** - * Changes the access and modification times of a file in the same way as {@link utimes}, with the difference that if the path refers to a symbolic - * link, then the link is not dereferenced: instead, the timestamps of the - * symbolic link itself are changed. - * - * No arguments other than a possible exception are given to the completion - * callback. - * @since v14.5.0, v12.19.0 - */ - export function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; - export namespace lutimes { - /** - * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, - * with the difference that if the path refers to a symbolic link, then the link is not - * dereferenced: instead, the timestamps of the symbolic link itself are changed. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - function __promisify__(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; - } - /** - * Change the file system timestamps of the symbolic link referenced by `path`. - * Returns `undefined`, or throws an exception when parameters are incorrect or - * the operation fails. This is the synchronous version of {@link lutimes}. - * @since v14.5.0, v12.19.0 - */ - export function lutimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void; - /** - * Asynchronously changes the permissions of a file. No arguments other than a - * possible exception are given to the completion callback. - * - * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail. - * - * ```js - * import { chmod } from 'node:fs'; - * - * chmod('my_file.txt', 0o775, (err) => { - * if (err) throw err; - * console.log('The permissions for file "my_file.txt" have been changed!'); - * }); - * ``` - * @since v0.1.30 - */ - export function chmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; - export namespace chmod { - /** - * Asynchronous chmod(2) - Change permissions of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - function __promisify__(path: PathLike, mode: Mode): Promise; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link chmod}. - * - * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail. - * @since v0.6.7 - */ - export function chmodSync(path: PathLike, mode: Mode): void; - /** - * Sets the permissions on the file. No arguments other than a possible exception - * are given to the completion callback. - * - * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail. - * @since v0.4.7 - */ - export function fchmod(fd: number, mode: Mode, callback: NoParamCallback): void; - export namespace fchmod { - /** - * Asynchronous fchmod(2) - Change permissions of a file. - * @param fd A file descriptor. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - function __promisify__(fd: number, mode: Mode): Promise; - } - /** - * Sets the permissions on the file. Returns `undefined`. - * - * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail. - * @since v0.4.7 - */ - export function fchmodSync(fd: number, mode: Mode): void; - /** - * Changes the permissions on a symbolic link. No arguments other than a possible - * exception are given to the completion callback. - * - * This method is only implemented on macOS. - * - * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail. - * @deprecated Since v0.4.7 - */ - export function lchmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; - /** @deprecated */ - export namespace lchmod { - /** - * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - function __promisify__(path: PathLike, mode: Mode): Promise; - } - /** - * Changes the permissions on a symbolic link. Returns `undefined`. - * - * This method is only implemented on macOS. - * - * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail. - * @deprecated Since v0.4.7 - */ - export function lchmodSync(path: PathLike, mode: Mode): void; - /** - * Asynchronous [`stat(2)`](http://man7.org/linux/man-pages/man2/stat.2.html). The callback gets two arguments `(err, stats)` where`stats` is an `fs.Stats` object. - * - * In case of an error, the `err.code` will be one of `Common System Errors`. - * - * {@link stat} follows symbolic links. Use {@link lstat} to look at the - * links themselves. - * - * Using `fs.stat()` to check for the existence of a file before calling`fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended. - * Instead, user code should open/read/write the file directly and handle the - * error raised if the file is not available. - * - * To check if a file exists without manipulating it afterwards, {@link access} is recommended. - * - * For example, given the following directory structure: - * - * ```text - * - txtDir - * -- file.txt - * - app.js - * ``` - * - * The next program will check for the stats of the given paths: - * - * ```js - * import { stat } from 'node:fs'; - * - * const pathsToCheck = ['./txtDir', './txtDir/file.txt']; - * - * for (let i = 0; i < pathsToCheck.length; i++) { - * stat(pathsToCheck[i], (err, stats) => { - * console.log(stats.isDirectory()); - * console.log(stats); - * }); - * } - * ``` - * - * The resulting output will resemble: - * - * ```console - * true - * Stats { - * dev: 16777220, - * mode: 16877, - * nlink: 3, - * uid: 501, - * gid: 20, - * rdev: 0, - * blksize: 4096, - * ino: 14214262, - * size: 96, - * blocks: 0, - * atimeMs: 1561174653071.963, - * mtimeMs: 1561174614583.3518, - * ctimeMs: 1561174626623.5366, - * birthtimeMs: 1561174126937.2893, - * atime: 2019-06-22T03:37:33.072Z, - * mtime: 2019-06-22T03:36:54.583Z, - * ctime: 2019-06-22T03:37:06.624Z, - * birthtime: 2019-06-22T03:28:46.937Z - * } - * false - * Stats { - * dev: 16777220, - * mode: 33188, - * nlink: 1, - * uid: 501, - * gid: 20, - * rdev: 0, - * blksize: 4096, - * ino: 14214074, - * size: 8, - * blocks: 8, - * atimeMs: 1561174616618.8555, - * mtimeMs: 1561174614584, - * ctimeMs: 1561174614583.8145, - * birthtimeMs: 1561174007710.7478, - * atime: 2019-06-22T03:36:56.619Z, - * mtime: 2019-06-22T03:36:54.584Z, - * ctime: 2019-06-22T03:36:54.584Z, - * birthtime: 2019-06-22T03:26:47.711Z - * } - * ``` - * @since v0.0.2 - */ - export function stat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - export function stat( - path: PathLike, - options: - | (StatOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void, - ): void; - export function stat( - path: PathLike, - options: StatOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void, - ): void; - export function stat( - path: PathLike, - options: StatOptions | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void, - ): void; - export namespace stat { - /** - * Asynchronous stat(2) - Get file status. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__( - path: PathLike, - options?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - function __promisify__( - path: PathLike, - options: StatOptions & { - bigint: true; - }, - ): Promise; - function __promisify__(path: PathLike, options?: StatOptions): Promise; - } - export interface StatSyncFn extends Function { - (path: PathLike, options?: undefined): Stats; - ( - path: PathLike, - options?: StatSyncOptions & { - bigint?: false | undefined; - throwIfNoEntry: false; - }, - ): Stats | undefined; - ( - path: PathLike, - options: StatSyncOptions & { - bigint: true; - throwIfNoEntry: false; - }, - ): BigIntStats | undefined; - ( - path: PathLike, - options?: StatSyncOptions & { - bigint?: false | undefined; - }, - ): Stats; - ( - path: PathLike, - options: StatSyncOptions & { - bigint: true; - }, - ): BigIntStats; - ( - path: PathLike, - options: StatSyncOptions & { - bigint: boolean; - throwIfNoEntry?: false | undefined; - }, - ): Stats | BigIntStats; - (path: PathLike, options?: StatSyncOptions): Stats | BigIntStats | undefined; - } - /** - * Synchronous stat(2) - Get file status. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export const statSync: StatSyncFn; - /** - * Invokes the callback with the `fs.Stats` for the file descriptor. - * - * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail. - * @since v0.1.95 - */ - export function fstat(fd: number, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - export function fstat( - fd: number, - options: - | (StatOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void, - ): void; - export function fstat( - fd: number, - options: StatOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void, - ): void; - export function fstat( - fd: number, - options: StatOptions | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void, - ): void; - export namespace fstat { - /** - * Asynchronous fstat(2) - Get file status. - * @param fd A file descriptor. - */ - function __promisify__( - fd: number, - options?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - function __promisify__( - fd: number, - options: StatOptions & { - bigint: true; - }, - ): Promise; - function __promisify__(fd: number, options?: StatOptions): Promise; - } - /** - * Retrieves the `fs.Stats` for the file descriptor. - * - * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail. - * @since v0.1.95 - */ - export function fstatSync( - fd: number, - options?: StatOptions & { - bigint?: false | undefined; - }, - ): Stats; - export function fstatSync( - fd: number, - options: StatOptions & { - bigint: true; - }, - ): BigIntStats; - export function fstatSync(fd: number, options?: StatOptions): Stats | BigIntStats; - /** - * Retrieves the `fs.Stats` for the symbolic link referred to by the path. - * The callback gets two arguments `(err, stats)` where `stats` is a `fs.Stats` object. `lstat()` is identical to `stat()`, except that if `path` is a symbolic - * link, then the link itself is stat-ed, not the file that it refers to. - * - * See the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) documentation for more details. - * @since v0.1.30 - */ - export function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - export function lstat( - path: PathLike, - options: - | (StatOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void, - ): void; - export function lstat( - path: PathLike, - options: StatOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void, - ): void; - export function lstat( - path: PathLike, - options: StatOptions | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void, - ): void; - export namespace lstat { - /** - * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__( - path: PathLike, - options?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - function __promisify__( - path: PathLike, - options: StatOptions & { - bigint: true; - }, - ): Promise; - function __promisify__(path: PathLike, options?: StatOptions): Promise; - } - /** - * Asynchronous [`statfs(2)`](http://man7.org/linux/man-pages/man2/statfs.2.html). Returns information about the mounted file system which - * contains `path`. The callback gets two arguments `(err, stats)` where `stats`is an `fs.StatFs` object. - * - * In case of an error, the `err.code` will be one of `Common System Errors`. - * @since v19.6.0, v18.15.0 - * @param path A path to an existing file or directory on the file system to be queried. - */ - export function statfs(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: StatsFs) => void): void; - export function statfs( - path: PathLike, - options: - | (StatFsOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: StatsFs) => void, - ): void; - export function statfs( - path: PathLike, - options: StatFsOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStatsFs) => void, - ): void; - export function statfs( - path: PathLike, - options: StatFsOptions | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: StatsFs | BigIntStatsFs) => void, - ): void; - export namespace statfs { - /** - * Asynchronous statfs(2) - Returns information about the mounted file system which contains path. The callback gets two arguments (err, stats) where stats is an object. - * @param path A path to an existing file or directory on the file system to be queried. - */ - function __promisify__( - path: PathLike, - options?: StatFsOptions & { - bigint?: false | undefined; - }, - ): Promise; - function __promisify__( - path: PathLike, - options: StatFsOptions & { - bigint: true; - }, - ): Promise; - function __promisify__(path: PathLike, options?: StatFsOptions): Promise; - } - /** - * Synchronous [`statfs(2)`](http://man7.org/linux/man-pages/man2/statfs.2.html). Returns information about the mounted file system which - * contains `path`. - * - * In case of an error, the `err.code` will be one of `Common System Errors`. - * @since v19.6.0, v18.15.0 - * @param path A path to an existing file or directory on the file system to be queried. - */ - export function statfsSync( - path: PathLike, - options?: StatFsOptions & { - bigint?: false | undefined; - }, - ): StatsFs; - export function statfsSync( - path: PathLike, - options: StatFsOptions & { - bigint: true; - }, - ): BigIntStatsFs; - export function statfsSync(path: PathLike, options?: StatFsOptions): StatsFs | BigIntStatsFs; - /** - * Synchronous lstat(2) - Get file status. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export const lstatSync: StatSyncFn; - /** - * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. No arguments other than - * a possible - * exception are given to the completion callback. - * @since v0.1.31 - */ - export function link(existingPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; - export namespace link { - /** - * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file. - * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(existingPath: PathLike, newPath: PathLike): Promise; - } - /** - * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. Returns `undefined`. - * @since v0.1.31 - */ - export function linkSync(existingPath: PathLike, newPath: PathLike): void; - /** - * Creates the link called `path` pointing to `target`. No arguments other than a - * possible exception are given to the completion callback. - * - * See the POSIX [`symlink(2)`](http://man7.org/linux/man-pages/man2/symlink.2.html) documentation for more details. - * - * The `type` argument is only available on Windows and ignored on other platforms. - * It can be set to `'dir'`, `'file'`, or `'junction'`. If the `type` argument is - * not a string, Node.js will autodetect `target` type and use `'file'` or `'dir'`. - * If the `target` does not exist, `'file'` will be used. Windows junction points - * require the destination path to be absolute. When using `'junction'`, the`target` argument will automatically be normalized to absolute path. Junction - * points on NTFS volumes can only point to directories. - * - * Relative targets are relative to the link's parent directory. - * - * ```js - * import { symlink } from 'node:fs'; - * - * symlink('./mew', './mewtwo', callback); - * ``` - * - * The above example creates a symbolic link `mewtwo` which points to `mew` in the - * same directory: - * - * ```bash - * $ tree . - * . - * ├── mew - * └── mewtwo -> ./mew - * ``` - * @since v0.1.31 - * @param [type='null'] - */ - export function symlink( - target: PathLike, - path: PathLike, - type: symlink.Type | undefined | null, - callback: NoParamCallback, - ): void; - /** - * Asynchronous symlink(2) - Create a new symbolic link to an existing file. - * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. - * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. - */ - export function symlink(target: PathLike, path: PathLike, callback: NoParamCallback): void; - export namespace symlink { - /** - * Asynchronous symlink(2) - Create a new symbolic link to an existing file. - * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. - * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. - * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). - * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. - */ - function __promisify__(target: PathLike, path: PathLike, type?: string | null): Promise; - type Type = "dir" | "file" | "junction"; - } - /** - * Returns `undefined`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link symlink}. - * @since v0.1.31 - * @param [type='null'] - */ - export function symlinkSync(target: PathLike, path: PathLike, type?: symlink.Type | null): void; - /** - * Reads the contents of the symbolic link referred to by `path`. The callback gets - * two arguments `(err, linkString)`. - * - * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the link path passed to the callback. If the `encoding` is set to `'buffer'`, - * the link path returned will be passed as a `Buffer` object. - * @since v0.1.31 - */ - export function readlink( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, linkString: string) => void, - ): void; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlink( - path: PathLike, - options: BufferEncodingOption, - callback: (err: NodeJS.ErrnoException | null, linkString: Buffer) => void, - ): void; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlink( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, linkString: string | Buffer) => void, - ): void; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function readlink( - path: PathLike, - callback: (err: NodeJS.ErrnoException | null, linkString: string) => void, - ): void; - export namespace readlink { - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: EncodingOption): Promise; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options: BufferEncodingOption): Promise; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: EncodingOption): Promise; - } - /** - * Returns the symbolic link's string value. - * - * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the link path returned. If the `encoding` is set to `'buffer'`, - * the link path returned will be passed as a `Buffer` object. - * @since v0.1.31 - */ - export function readlinkSync(path: PathLike, options?: EncodingOption): string; - /** - * Synchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlinkSync(path: PathLike, options: BufferEncodingOption): Buffer; - /** - * Synchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlinkSync(path: PathLike, options?: EncodingOption): string | Buffer; - /** - * Asynchronously computes the canonical pathname by resolving `.`, `..`, and - * symbolic links. - * - * A canonical pathname is not necessarily unique. Hard links and bind mounts can - * expose a file system entity through many pathnames. - * - * This function behaves like [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html), with some exceptions: - * - * 1. No case conversion is performed on case-insensitive file systems. - * 2. The maximum number of symbolic links is platform-independent and generally - * (much) higher than what the native [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html) implementation supports. - * - * The `callback` gets two arguments `(err, resolvedPath)`. May use `process.cwd` to resolve relative paths. - * - * Only paths that can be converted to UTF8 strings are supported. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the path passed to the callback. If the `encoding` is set to `'buffer'`, - * the path returned will be passed as a `Buffer` object. - * - * If `path` resolves to a socket or a pipe, the function will return a system - * dependent name for that object. - * @since v0.1.31 - */ - export function realpath( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void, - ): void; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpath( - path: PathLike, - options: BufferEncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void, - ): void; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpath( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void, - ): void; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function realpath( - path: PathLike, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void, - ): void; - export namespace realpath { - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: EncodingOption): Promise; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options: BufferEncodingOption): Promise; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: EncodingOption): Promise; - /** - * Asynchronous [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html). - * - * The `callback` gets two arguments `(err, resolvedPath)`. - * - * Only paths that can be converted to UTF8 strings are supported. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the path passed to the callback. If the `encoding` is set to `'buffer'`, - * the path returned will be passed as a `Buffer` object. - * - * On Linux, when Node.js is linked against musl libc, the procfs file system must - * be mounted on `/proc` in order for this function to work. Glibc does not have - * this restriction. - * @since v9.2.0 - */ - function native( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void, - ): void; - function native( - path: PathLike, - options: BufferEncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void, - ): void; - function native( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void, - ): void; - function native( - path: PathLike, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void, - ): void; - } - /** - * Returns the resolved pathname. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link realpath}. - * @since v0.1.31 - */ - export function realpathSync(path: PathLike, options?: EncodingOption): string; - /** - * Synchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpathSync(path: PathLike, options: BufferEncodingOption): Buffer; - /** - * Synchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpathSync(path: PathLike, options?: EncodingOption): string | Buffer; - export namespace realpathSync { - function native(path: PathLike, options?: EncodingOption): string; - function native(path: PathLike, options: BufferEncodingOption): Buffer; - function native(path: PathLike, options?: EncodingOption): string | Buffer; - } - /** - * Asynchronously removes a file or symbolic link. No arguments other than a - * possible exception are given to the completion callback. - * - * ```js - * import { unlink } from 'node:fs'; - * // Assuming that 'path/file.txt' is a regular file. - * unlink('path/file.txt', (err) => { - * if (err) throw err; - * console.log('path/file.txt was deleted'); - * }); - * ``` - * - * `fs.unlink()` will not work on a directory, empty or otherwise. To remove a - * directory, use {@link rmdir}. - * - * See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more details. - * @since v0.0.2 - */ - export function unlink(path: PathLike, callback: NoParamCallback): void; - export namespace unlink { - /** - * Asynchronous unlink(2) - delete a name and possibly the file it refers to. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike): Promise; - } - /** - * Synchronous [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html). Returns `undefined`. - * @since v0.1.21 - */ - export function unlinkSync(path: PathLike): void; - export interface RmDirOptions { - /** - * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or - * `EPERM` error is encountered, Node.js will retry the operation with a linear - * backoff wait of `retryDelay` ms longer on each try. This option represents the - * number of retries. This option is ignored if the `recursive` option is not - * `true`. - * @default 0 - */ - maxRetries?: number | undefined; - /** - * @deprecated since v14.14.0 In future versions of Node.js and will trigger a warning - * `fs.rmdir(path, { recursive: true })` will throw if `path` does not exist or is a file. - * Use `fs.rm(path, { recursive: true, force: true })` instead. - * - * If `true`, perform a recursive directory removal. In - * recursive mode, operations are retried on failure. - * @default false - */ - recursive?: boolean | undefined; - /** - * The amount of time in milliseconds to wait between retries. - * This option is ignored if the `recursive` option is not `true`. - * @default 100 - */ - retryDelay?: number | undefined; - } - /** - * Asynchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). No arguments other than a possible exception are given - * to the completion callback. - * - * Using `fs.rmdir()` on a file (not a directory) results in an `ENOENT` error on - * Windows and an `ENOTDIR` error on POSIX. - * - * To get a behavior similar to the `rm -rf` Unix command, use {@link rm} with options `{ recursive: true, force: true }`. - * @since v0.0.2 - */ - export function rmdir(path: PathLike, callback: NoParamCallback): void; - export function rmdir(path: PathLike, options: RmDirOptions, callback: NoParamCallback): void; - export namespace rmdir { - /** - * Asynchronous rmdir(2) - delete a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike, options?: RmDirOptions): Promise; - } - /** - * Synchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). Returns `undefined`. - * - * Using `fs.rmdirSync()` on a file (not a directory) results in an `ENOENT` error - * on Windows and an `ENOTDIR` error on POSIX. - * - * To get a behavior similar to the `rm -rf` Unix command, use {@link rmSync} with options `{ recursive: true, force: true }`. - * @since v0.1.21 - */ - export function rmdirSync(path: PathLike, options?: RmDirOptions): void; - export interface RmOptions { - /** - * When `true`, exceptions will be ignored if `path` does not exist. - * @default false - */ - force?: boolean | undefined; - /** - * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or - * `EPERM` error is encountered, Node.js will retry the operation with a linear - * backoff wait of `retryDelay` ms longer on each try. This option represents the - * number of retries. This option is ignored if the `recursive` option is not - * `true`. - * @default 0 - */ - maxRetries?: number | undefined; - /** - * If `true`, perform a recursive directory removal. In - * recursive mode, operations are retried on failure. - * @default false - */ - recursive?: boolean | undefined; - /** - * The amount of time in milliseconds to wait between retries. - * This option is ignored if the `recursive` option is not `true`. - * @default 100 - */ - retryDelay?: number | undefined; - } - /** - * Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility). No arguments other than a possible exception are given to the - * completion callback. - * @since v14.14.0 - */ - export function rm(path: PathLike, callback: NoParamCallback): void; - export function rm(path: PathLike, options: RmOptions, callback: NoParamCallback): void; - export namespace rm { - /** - * Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility). - */ - function __promisify__(path: PathLike, options?: RmOptions): Promise; - } - /** - * Synchronously removes files and directories (modeled on the standard POSIX `rm` utility). Returns `undefined`. - * @since v14.14.0 - */ - export function rmSync(path: PathLike, options?: RmOptions): void; - export interface MakeDirectoryOptions { - /** - * Indicates whether parent folders should be created. - * If a folder was created, the path to the first created folder will be returned. - * @default false - */ - recursive?: boolean | undefined; - /** - * A file mode. If a string is passed, it is parsed as an octal integer. If not specified - * @default 0o777 - */ - mode?: Mode | undefined; - } - /** - * Asynchronously creates a directory. - * - * The callback is given a possible exception and, if `recursive` is `true`, the - * first directory path created, `(err[, path])`.`path` can still be `undefined` when `recursive` is `true`, if no directory was - * created (for instance, if it was previously created). - * - * The optional `options` argument can be an integer specifying `mode` (permission - * and sticky bits), or an object with a `mode` property and a `recursive` property indicating whether parent directories should be created. Calling `fs.mkdir()` when `path` is a directory that - * exists results in an error only - * when `recursive` is false. If `recursive` is false and the directory exists, - * an `EEXIST` error occurs. - * - * ```js - * import { mkdir } from 'node:fs'; - * - * // Create ./tmp/a/apple, regardless of whether ./tmp and ./tmp/a exist. - * mkdir('./tmp/a/apple', { recursive: true }, (err) => { - * if (err) throw err; - * }); - * ``` - * - * On Windows, using `fs.mkdir()` on the root directory even with recursion will - * result in an error: - * - * ```js - * import { mkdir } from 'node:fs'; - * - * mkdir('/', { recursive: true }, (err) => { - * // => [Error: EPERM: operation not permitted, mkdir 'C:\'] - * }); - * ``` - * - * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details. - * @since v0.1.8 - */ - export function mkdir( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - }, - callback: (err: NodeJS.ErrnoException | null, path?: string) => void, - ): void; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdir( - path: PathLike, - options: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null - | undefined, - callback: NoParamCallback, - ): void; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdir( - path: PathLike, - options: Mode | MakeDirectoryOptions | null | undefined, - callback: (err: NodeJS.ErrnoException | null, path?: string) => void, - ): void; - /** - * Asynchronous mkdir(2) - create a directory with a mode of `0o777`. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function mkdir(path: PathLike, callback: NoParamCallback): void; - export namespace mkdir { - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function __promisify__( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - }, - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function __promisify__( - path: PathLike, - options?: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null, - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function __promisify__( - path: PathLike, - options?: Mode | MakeDirectoryOptions | null, - ): Promise; - } - /** - * Synchronously creates a directory. Returns `undefined`, or if `recursive` is `true`, the first directory path created. - * This is the synchronous version of {@link mkdir}. - * - * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details. - * @since v0.1.21 - */ - export function mkdirSync( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - }, - ): string | undefined; - /** - * Synchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdirSync( - path: PathLike, - options?: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null, - ): void; - /** - * Synchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdirSync(path: PathLike, options?: Mode | MakeDirectoryOptions | null): string | undefined; - /** - * Creates a unique temporary directory. - * - * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. Due to platform - * inconsistencies, avoid trailing `X` characters in `prefix`. Some platforms, - * notably the BSDs, can return more than six random characters, and replace - * trailing `X` characters in `prefix` with random characters. - * - * The created directory path is passed as a string to the callback's second - * parameter. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use. - * - * ```js - * import { mkdtemp } from 'node:fs'; - * import { join } from 'node:path'; - * import { tmpdir } from 'node:os'; - * - * mkdtemp(join(tmpdir(), 'foo-'), (err, directory) => { - * if (err) throw err; - * console.log(directory); - * // Prints: /tmp/foo-itXde2 or C:\Users\...\AppData\Local\Temp\foo-itXde2 - * }); - * ``` - * - * The `fs.mkdtemp()` method will append the six randomly selected characters - * directly to the `prefix` string. For instance, given a directory `/tmp`, if the - * intention is to create a temporary directory _within_`/tmp`, the `prefix`must end with a trailing platform-specific path separator - * (`import { sep } from 'node:path'`). - * - * ```js - * import { tmpdir } from 'node:os'; - * import { mkdtemp } from 'node:fs'; - * - * // The parent directory for the new temporary directory - * const tmpDir = tmpdir(); - * - * // This method is *INCORRECT*: - * mkdtemp(tmpDir, (err, directory) => { - * if (err) throw err; - * console.log(directory); - * // Will print something similar to `/tmpabc123`. - * // A new temporary directory is created at the file system root - * // rather than *within* the /tmp directory. - * }); - * - * // This method is *CORRECT*: - * import { sep } from 'node:path'; - * mkdtemp(`${tmpDir}${sep}`, (err, directory) => { - * if (err) throw err; - * console.log(directory); - * // Will print something similar to `/tmp/abc123`. - * // A new temporary directory is created within - * // the /tmp directory. - * }); - * ``` - * @since v5.10.0 - */ - export function mkdtemp( - prefix: string, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, folder: string) => void, - ): void; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtemp( - prefix: string, - options: - | "buffer" - | { - encoding: "buffer"; - }, - callback: (err: NodeJS.ErrnoException | null, folder: Buffer) => void, - ): void; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtemp( - prefix: string, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, folder: string | Buffer) => void, - ): void; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - */ - export function mkdtemp( - prefix: string, - callback: (err: NodeJS.ErrnoException | null, folder: string) => void, - ): void; - export namespace mkdtemp { - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(prefix: string, options?: EncodingOption): Promise; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(prefix: string, options: BufferEncodingOption): Promise; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(prefix: string, options?: EncodingOption): Promise; - } - /** - * Returns the created directory path. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link mkdtemp}. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use. - * @since v5.10.0 - */ - export function mkdtempSync(prefix: string, options?: EncodingOption): string; - /** - * Synchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtempSync(prefix: string, options: BufferEncodingOption): Buffer; - /** - * Synchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtempSync(prefix: string, options?: EncodingOption): string | Buffer; - /** - * Reads the contents of a directory. The callback gets two arguments `(err, files)` where `files` is an array of the names of the files in the directory excluding `'.'` and `'..'`. - * - * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the filenames passed to the callback. If the `encoding` is set to `'buffer'`, - * the filenames returned will be passed as `Buffer` objects. - * - * If `options.withFileTypes` is set to `true`, the `files` array will contain `fs.Dirent` objects. - * @since v0.1.8 - */ - export function readdir( - path: PathLike, - options: - | { - encoding: BufferEncoding | null; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | BufferEncoding - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, files: string[]) => void, - ): void; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdir( - path: PathLike, - options: - | { - encoding: "buffer"; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | "buffer", - callback: (err: NodeJS.ErrnoException | null, files: Buffer[]) => void, - ): void; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdir( - path: PathLike, - options: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }) - | BufferEncoding - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, files: string[] | Buffer[]) => void, - ): void; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function readdir( - path: PathLike, - callback: (err: NodeJS.ErrnoException | null, files: string[]) => void, - ): void; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. - */ - export function readdir( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - recursive?: boolean | undefined; - }, - callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void, - ): void; - export namespace readdir { - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__( - path: PathLike, - options?: - | { - encoding: BufferEncoding | null; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | BufferEncoding - | null, - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__( - path: PathLike, - options: - | "buffer" - | { - encoding: "buffer"; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }, - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }) - | BufferEncoding - | null, - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent - */ - function __promisify__( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - recursive?: boolean | undefined; - }, - ): Promise; - } - /** - * Reads the contents of the directory. - * - * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the filenames returned. If the `encoding` is set to `'buffer'`, - * the filenames returned will be passed as `Buffer` objects. - * - * If `options.withFileTypes` is set to `true`, the result will contain `fs.Dirent` objects. - * @since v0.1.21 - */ - export function readdirSync( - path: PathLike, - options?: - | { - encoding: BufferEncoding | null; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | BufferEncoding - | null, - ): string[]; - /** - * Synchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdirSync( - path: PathLike, - options: - | { - encoding: "buffer"; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | "buffer", - ): Buffer[]; - /** - * Synchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdirSync( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }) - | BufferEncoding - | null, - ): string[] | Buffer[]; - /** - * Synchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. - */ - export function readdirSync( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - recursive?: boolean | undefined; - }, - ): Dirent[]; - /** - * Closes the file descriptor. No arguments other than a possible exception are - * given to the completion callback. - * - * Calling `fs.close()` on any file descriptor (`fd`) that is currently in use - * through any other `fs` operation may lead to undefined behavior. - * - * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail. - * @since v0.0.2 - */ - export function close(fd: number, callback?: NoParamCallback): void; - export namespace close { - /** - * Asynchronous close(2) - close a file descriptor. - * @param fd A file descriptor. - */ - function __promisify__(fd: number): Promise; - } - /** - * Closes the file descriptor. Returns `undefined`. - * - * Calling `fs.closeSync()` on any file descriptor (`fd`) that is currently in use - * through any other `fs` operation may lead to undefined behavior. - * - * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail. - * @since v0.1.21 - */ - export function closeSync(fd: number): void; - /** - * Asynchronous file open. See the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more details. - * - * `mode` sets the file mode (permission and sticky bits), but only if the file was - * created. On Windows, only the write permission can be manipulated; see {@link chmod}. - * - * The callback gets two arguments `(err, fd)`. - * - * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented - * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains - * a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams). - * - * Functions based on `fs.open()` exhibit this behavior as well:`fs.writeFile()`, `fs.readFile()`, etc. - * @since v0.0.2 - * @param [flags='r'] See `support of file system `flags``. - * @param [mode=0o666] - */ - export function open( - path: PathLike, - flags: OpenMode | undefined, - mode: Mode | undefined | null, - callback: (err: NodeJS.ErrnoException | null, fd: number) => void, - ): void; - /** - * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param [flags='r'] See `support of file system `flags``. - */ - export function open( - path: PathLike, - flags: OpenMode | undefined, - callback: (err: NodeJS.ErrnoException | null, fd: number) => void, - ): void; - /** - * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function open(path: PathLike, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; - export namespace open { - /** - * Asynchronous open(2) - open and possibly create a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`. - */ - function __promisify__(path: PathLike, flags: OpenMode, mode?: Mode | null): Promise; - } - /** - * Returns an integer representing the file descriptor. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link open}. - * @since v0.1.21 - * @param [flags='r'] - * @param [mode=0o666] - */ - export function openSync(path: PathLike, flags: OpenMode, mode?: Mode | null): number; - /** - * Change the file system timestamps of the object referenced by `path`. - * - * The `atime` and `mtime` arguments follow these rules: - * - * * Values can be either numbers representing Unix epoch time in seconds, `Date`s, or a numeric string like `'123456789.0'`. - * * If the value can not be converted to a number, or is `NaN`, `Infinity`, or `-Infinity`, an `Error` will be thrown. - * @since v0.4.2 - */ - export function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; - export namespace utimes { - /** - * Asynchronously change file timestamps of the file referenced by the supplied path. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - function __promisify__(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; - } - /** - * Returns `undefined`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link utimes}. - * @since v0.4.2 - */ - export function utimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void; - /** - * Change the file system timestamps of the object referenced by the supplied file - * descriptor. See {@link utimes}. - * @since v0.4.2 - */ - export function futimes(fd: number, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; - export namespace futimes { - /** - * Asynchronously change file timestamps of the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - function __promisify__(fd: number, atime: TimeLike, mtime: TimeLike): Promise; - } - /** - * Synchronous version of {@link futimes}. Returns `undefined`. - * @since v0.4.2 - */ - export function futimesSync(fd: number, atime: TimeLike, mtime: TimeLike): void; - /** - * Request that all data for the open file descriptor is flushed to the storage - * device. The specific implementation is operating system and device specific. - * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. No arguments other - * than a possible exception are given to the completion callback. - * @since v0.1.96 - */ - export function fsync(fd: number, callback: NoParamCallback): void; - export namespace fsync { - /** - * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. - * @param fd A file descriptor. - */ - function __promisify__(fd: number): Promise; - } - /** - * Request that all data for the open file descriptor is flushed to the storage - * device. The specific implementation is operating system and device specific. - * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. Returns `undefined`. - * @since v0.1.96 - */ - export function fsyncSync(fd: number): void; - /** - * Write `buffer` to the file specified by `fd`. - * - * `offset` determines the part of the buffer to be written, and `length` is - * an integer specifying the number of bytes to write. - * - * `position` refers to the offset from the beginning of the file where this data - * should be written. If `typeof position !== 'number'`, the data will be written - * at the current position. See [`pwrite(2)`](http://man7.org/linux/man-pages/man2/pwrite.2.html). - * - * The callback will be given three arguments `(err, bytesWritten, buffer)` where `bytesWritten` specifies how many _bytes_ were written from `buffer`. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a promise for an `Object` with `bytesWritten` and `buffer` properties. - * - * It is unsafe to use `fs.write()` multiple times on the same file without waiting - * for the callback. For this scenario, {@link createWriteStream} is - * recommended. - * - * On Linux, positional writes don't work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v0.0.2 - * @param [offset=0] - * @param [length=buffer.byteLength - offset] - * @param [position='null'] - */ - export function write( - fd: number, - buffer: TBuffer, - offset: number | undefined | null, - length: number | undefined | null, - position: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, - ): void; - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. - * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. - */ - export function write( - fd: number, - buffer: TBuffer, - offset: number | undefined | null, - length: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, - ): void; - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. - */ - export function write( - fd: number, - buffer: TBuffer, - offset: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, - ): void; - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - */ - export function write( - fd: number, - buffer: TBuffer, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, - ): void; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - * @param encoding The expected string encoding. - */ - export function write( - fd: number, - string: string, - position: number | undefined | null, - encoding: BufferEncoding | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void, - ): void; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - */ - export function write( - fd: number, - string: string, - position: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void, - ): void; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - */ - export function write( - fd: number, - string: string, - callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void, - ): void; - export namespace write { - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. - * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - */ - function __promisify__( - fd: number, - buffer?: TBuffer, - offset?: number, - length?: number, - position?: number | null, - ): Promise<{ - bytesWritten: number; - buffer: TBuffer; - }>; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - * @param encoding The expected string encoding. - */ - function __promisify__( - fd: number, - string: string, - position?: number | null, - encoding?: BufferEncoding | null, - ): Promise<{ - bytesWritten: number; - buffer: string; - }>; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link write}. - * @since v0.1.21 - * @param [offset=0] - * @param [length=buffer.byteLength - offset] - * @param [position='null'] - * @return The number of bytes written. - */ - export function writeSync( - fd: number, - buffer: NodeJS.ArrayBufferView, - offset?: number | null, - length?: number | null, - position?: number | null, - ): number; - /** - * Synchronously writes `string` to the file referenced by the supplied file descriptor, returning the number of bytes written. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - * @param encoding The expected string encoding. - */ - export function writeSync( - fd: number, - string: string, - position?: number | null, - encoding?: BufferEncoding | null, - ): number; - export type ReadPosition = number | bigint; - export interface ReadSyncOptions { - /** - * @default 0 - */ - offset?: number | undefined; - /** - * @default `length of buffer` - */ - length?: number | undefined; - /** - * @default null - */ - position?: ReadPosition | null | undefined; - } - export interface ReadAsyncOptions extends ReadSyncOptions { - buffer?: TBuffer; - } - /** - * Read data from the file specified by `fd`. - * - * The callback is given the three arguments, `(err, bytesRead, buffer)`. - * - * If the file is not modified concurrently, the end-of-file is reached when the - * number of bytes read is zero. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a promise for an `Object` with `bytesRead` and `buffer` properties. - * @since v0.0.2 - * @param buffer The buffer that the data will be written to. - * @param offset The position in `buffer` to write the data to. - * @param length The number of bytes to read. - * @param position Specifies where to begin reading from in the file. If `position` is `null` or `-1 `, data will be read from the current file position, and the file position will be updated. If - * `position` is an integer, the file position will be unchanged. - */ - export function read( - fd: number, - buffer: TBuffer, - offset: number, - length: number, - position: ReadPosition | null, - callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void, - ): void; - /** - * Similar to the above `fs.read` function, this version takes an optional `options` object. - * If not otherwise specified in an `options` object, - * `buffer` defaults to `Buffer.alloc(16384)`, - * `offset` defaults to `0`, - * `length` defaults to `buffer.byteLength`, `- offset` as of Node 17.6.0 - * `position` defaults to `null` - * @since v12.17.0, 13.11.0 - */ - export function read( - fd: number, - options: ReadAsyncOptions, - callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void, - ): void; - export function read( - fd: number, - callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: NodeJS.ArrayBufferView) => void, - ): void; - export namespace read { - /** - * @param fd A file descriptor. - * @param buffer The buffer that the data will be written to. - * @param offset The offset in the buffer at which to start writing. - * @param length The number of bytes to read. - * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. - */ - function __promisify__( - fd: number, - buffer: TBuffer, - offset: number, - length: number, - position: number | null, - ): Promise<{ - bytesRead: number; - buffer: TBuffer; - }>; - function __promisify__( - fd: number, - options: ReadAsyncOptions, - ): Promise<{ - bytesRead: number; - buffer: TBuffer; - }>; - function __promisify__(fd: number): Promise<{ - bytesRead: number; - buffer: NodeJS.ArrayBufferView; - }>; - } - /** - * Returns the number of `bytesRead`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link read}. - * @since v0.1.21 - * @param [position='null'] - */ - export function readSync( - fd: number, - buffer: NodeJS.ArrayBufferView, - offset: number, - length: number, - position: ReadPosition | null, - ): number; - /** - * Similar to the above `fs.readSync` function, this version takes an optional `options` object. - * If no `options` object is specified, it will default with the above values. - */ - export function readSync(fd: number, buffer: NodeJS.ArrayBufferView, opts?: ReadSyncOptions): number; - /** - * Asynchronously reads the entire contents of a file. - * - * ```js - * import { readFile } from 'node:fs'; - * - * readFile('/etc/passwd', (err, data) => { - * if (err) throw err; - * console.log(data); - * }); - * ``` - * - * The callback is passed two arguments `(err, data)`, where `data` is the - * contents of the file. - * - * If no encoding is specified, then the raw buffer is returned. - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { readFile } from 'node:fs'; - * - * readFile('/etc/passwd', 'utf8', callback); - * ``` - * - * When the path is a directory, the behavior of `fs.readFile()` and {@link readFileSync} is platform-specific. On macOS, Linux, and Windows, an - * error will be returned. On FreeBSD, a representation of the directory's contents - * will be returned. - * - * ```js - * import { readFile } from 'node:fs'; - * - * // macOS, Linux, and Windows - * readFile('', (err, data) => { - * // => [Error: EISDIR: illegal operation on a directory, read ] - * }); - * - * // FreeBSD - * readFile('', (err, data) => { - * // => null, - * }); - * ``` - * - * It is possible to abort an ongoing request using an `AbortSignal`. If a - * request is aborted the callback is called with an `AbortError`: - * - * ```js - * import { readFile } from 'node:fs'; - * - * const controller = new AbortController(); - * const signal = controller.signal; - * readFile(fileInfo[0].name, { signal }, (err, buf) => { - * // ... - * }); - * // When you want to abort the request - * controller.abort(); - * ``` - * - * The `fs.readFile()` function buffers the entire file. To minimize memory costs, - * when possible prefer streaming via `fs.createReadStream()`. - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.readFile` performs. - * @since v0.1.29 - * @param path filename or file descriptor - */ - export function readFile( - path: PathOrFileDescriptor, - options: - | ({ - encoding?: null | undefined; - flag?: string | undefined; - } & Abortable) - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void, - ): void; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFile( - path: PathOrFileDescriptor, - options: - | ({ - encoding: BufferEncoding; - flag?: string | undefined; - } & Abortable) - | BufferEncoding, - callback: (err: NodeJS.ErrnoException | null, data: string) => void, - ): void; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFile( - path: PathOrFileDescriptor, - options: - | (ObjectEncodingOptions & { - flag?: string | undefined; - } & Abortable) - | BufferEncoding - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, data: string | Buffer) => void, - ): void; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - */ - export function readFile( - path: PathOrFileDescriptor, - callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void, - ): void; - export namespace readFile { - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function __promisify__( - path: PathOrFileDescriptor, - options?: { - encoding?: null | undefined; - flag?: string | undefined; - } | null, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function __promisify__( - path: PathOrFileDescriptor, - options: - | { - encoding: BufferEncoding; - flag?: string | undefined; - } - | BufferEncoding, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function __promisify__( - path: PathOrFileDescriptor, - options?: - | (ObjectEncodingOptions & { - flag?: string | undefined; - }) - | BufferEncoding - | null, - ): Promise; - } - /** - * Returns the contents of the `path`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link readFile}. - * - * If the `encoding` option is specified then this function returns a - * string. Otherwise it returns a buffer. - * - * Similar to {@link readFile}, when the path is a directory, the behavior of `fs.readFileSync()` is platform-specific. - * - * ```js - * import { readFileSync } from 'node:fs'; - * - * // macOS, Linux, and Windows - * readFileSync(''); - * // => [Error: EISDIR: illegal operation on a directory, read ] - * - * // FreeBSD - * readFileSync(''); // => - * ``` - * @since v0.1.8 - * @param path filename or file descriptor - */ - export function readFileSync( - path: PathOrFileDescriptor, - options?: { - encoding?: null | undefined; - flag?: string | undefined; - } | null, - ): Buffer; - /** - * Synchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFileSync( - path: PathOrFileDescriptor, - options: - | { - encoding: BufferEncoding; - flag?: string | undefined; - } - | BufferEncoding, - ): string; - /** - * Synchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFileSync( - path: PathOrFileDescriptor, - options?: - | (ObjectEncodingOptions & { - flag?: string | undefined; - }) - | BufferEncoding - | null, - ): string | Buffer; - export type WriteFileOptions = - | ( - & ObjectEncodingOptions - & Abortable - & { - mode?: Mode | undefined; - flag?: string | undefined; - flush?: boolean | undefined; - } - ) - | BufferEncoding - | null; - /** - * When `file` is a filename, asynchronously writes data to the file, replacing the - * file if it already exists. `data` can be a string or a buffer. - * - * When `file` is a file descriptor, the behavior is similar to calling `fs.write()` directly (which is recommended). See the notes below on using - * a file descriptor. - * - * The `encoding` option is ignored if `data` is a buffer. - * - * The `mode` option only affects the newly created file. See {@link open} for more details. - * - * ```js - * import { writeFile } from 'node:fs'; - * import { Buffer } from 'node:buffer'; - * - * const data = new Uint8Array(Buffer.from('Hello Node.js')); - * writeFile('message.txt', data, (err) => { - * if (err) throw err; - * console.log('The file has been saved!'); - * }); - * ``` - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { writeFile } from 'node:fs'; - * - * writeFile('message.txt', 'Hello Node.js', 'utf8', callback); - * ``` - * - * It is unsafe to use `fs.writeFile()` multiple times on the same file without - * waiting for the callback. For this scenario, {@link createWriteStream} is - * recommended. - * - * Similarly to `fs.readFile` \- `fs.writeFile` is a convenience method that - * performs multiple `write` calls internally to write the buffer passed to it. - * For performance sensitive code consider using {@link createWriteStream}. - * - * It is possible to use an `AbortSignal` to cancel an `fs.writeFile()`. - * Cancelation is "best effort", and some amount of data is likely still - * to be written. - * - * ```js - * import { writeFile } from 'node:fs'; - * import { Buffer } from 'node:buffer'; - * - * const controller = new AbortController(); - * const { signal } = controller; - * const data = new Uint8Array(Buffer.from('Hello Node.js')); - * writeFile('message.txt', data, { signal }, (err) => { - * // When a request is aborted - the callback is called with an AbortError - * }); - * // When the request should be aborted - * controller.abort(); - * ``` - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.writeFile` performs. - * @since v0.1.29 - * @param file filename or file descriptor - */ - export function writeFile( - file: PathOrFileDescriptor, - data: string | NodeJS.ArrayBufferView, - options: WriteFileOptions, - callback: NoParamCallback, - ): void; - /** - * Asynchronously writes data to a file, replacing the file if it already exists. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - */ - export function writeFile( - path: PathOrFileDescriptor, - data: string | NodeJS.ArrayBufferView, - callback: NoParamCallback, - ): void; - export namespace writeFile { - /** - * Asynchronously writes data to a file, replacing the file if it already exists. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `mode` is not supplied, the default of `0o666` is used. - * If `mode` is a string, it is parsed as an octal integer. - * If `flag` is not supplied, the default of `'w'` is used. - */ - function __promisify__( - path: PathOrFileDescriptor, - data: string | NodeJS.ArrayBufferView, - options?: WriteFileOptions, - ): Promise; - } - /** - * Returns `undefined`. - * - * The `mode` option only affects the newly created file. See {@link open} for more details. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link writeFile}. - * @since v0.1.29 - * @param file filename or file descriptor - */ - export function writeFileSync( - file: PathOrFileDescriptor, - data: string | NodeJS.ArrayBufferView, - options?: WriteFileOptions, - ): void; - /** - * Asynchronously append data to a file, creating the file if it does not yet - * exist. `data` can be a string or a `Buffer`. - * - * The `mode` option only affects the newly created file. See {@link open} for more details. - * - * ```js - * import { appendFile } from 'node:fs'; - * - * appendFile('message.txt', 'data to append', (err) => { - * if (err) throw err; - * console.log('The "data to append" was appended to file!'); - * }); - * ``` - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { appendFile } from 'node:fs'; - * - * appendFile('message.txt', 'data to append', 'utf8', callback); - * ``` - * - * The `path` may be specified as a numeric file descriptor that has been opened - * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will - * not be closed automatically. - * - * ```js - * import { open, close, appendFile } from 'node:fs'; - * - * function closeFd(fd) { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * - * open('message.txt', 'a', (err, fd) => { - * if (err) throw err; - * - * try { - * appendFile(fd, 'data to append', 'utf8', (err) => { - * closeFd(fd); - * if (err) throw err; - * }); - * } catch (err) { - * closeFd(fd); - * throw err; - * } - * }); - * ``` - * @since v0.6.7 - * @param path filename or file descriptor - */ - export function appendFile( - path: PathOrFileDescriptor, - data: string | Uint8Array, - options: WriteFileOptions, - callback: NoParamCallback, - ): void; - /** - * Asynchronously append data to a file, creating the file if it does not exist. - * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - */ - export function appendFile(file: PathOrFileDescriptor, data: string | Uint8Array, callback: NoParamCallback): void; - export namespace appendFile { - /** - * Asynchronously append data to a file, creating the file if it does not exist. - * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `mode` is not supplied, the default of `0o666` is used. - * If `mode` is a string, it is parsed as an octal integer. - * If `flag` is not supplied, the default of `'a'` is used. - */ - function __promisify__( - file: PathOrFileDescriptor, - data: string | Uint8Array, - options?: WriteFileOptions, - ): Promise; - } - /** - * Synchronously append data to a file, creating the file if it does not yet - * exist. `data` can be a string or a `Buffer`. - * - * The `mode` option only affects the newly created file. See {@link open} for more details. - * - * ```js - * import { appendFileSync } from 'node:fs'; - * - * try { - * appendFileSync('message.txt', 'data to append'); - * console.log('The "data to append" was appended to file!'); - * } catch (err) { - * // Handle the error - * } - * ``` - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { appendFileSync } from 'node:fs'; - * - * appendFileSync('message.txt', 'data to append', 'utf8'); - * ``` - * - * The `path` may be specified as a numeric file descriptor that has been opened - * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will - * not be closed automatically. - * - * ```js - * import { openSync, closeSync, appendFileSync } from 'node:fs'; - * - * let fd; - * - * try { - * fd = openSync('message.txt', 'a'); - * appendFileSync(fd, 'data to append', 'utf8'); - * } catch (err) { - * // Handle the error - * } finally { - * if (fd !== undefined) - * closeSync(fd); - * } - * ``` - * @since v0.6.7 - * @param path filename or file descriptor - */ - export function appendFileSync( - path: PathOrFileDescriptor, - data: string | Uint8Array, - options?: WriteFileOptions, - ): void; - /** - * Watch for changes on `filename`. The callback `listener` will be called each - * time the file is accessed. - * - * The `options` argument may be omitted. If provided, it should be an object. The `options` object may contain a boolean named `persistent` that indicates - * whether the process should continue to run as long as files are being watched. - * The `options` object may specify an `interval` property indicating how often the - * target should be polled in milliseconds. - * - * The `listener` gets two arguments the current stat object and the previous - * stat object: - * - * ```js - * import { watchFile } from 'node:fs'; - * - * watchFile('message.text', (curr, prev) => { - * console.log(`the current mtime is: ${curr.mtime}`); - * console.log(`the previous mtime was: ${prev.mtime}`); - * }); - * ``` - * - * These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`, - * the numeric values in these objects are specified as `BigInt`s. - * - * To be notified when the file was modified, not just accessed, it is necessary - * to compare `curr.mtimeMs` and `prev.mtimeMs`. - * - * When an `fs.watchFile` operation results in an `ENOENT` error, it - * will invoke the listener once, with all the fields zeroed (or, for dates, the - * Unix Epoch). If the file is created later on, the listener will be called - * again, with the latest stat objects. This is a change in functionality since - * v0.10. - * - * Using {@link watch} is more efficient than `fs.watchFile` and `fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and `fs.unwatchFile` when possible. - * - * When a file being watched by `fs.watchFile()` disappears and reappears, - * then the contents of `previous` in the second callback event (the file's - * reappearance) will be the same as the contents of `previous` in the first - * callback event (its disappearance). - * - * This happens when: - * - * * the file is deleted, followed by a restore - * * the file is renamed and then renamed a second time back to its original name - * @since v0.1.31 - */ - export interface WatchFileOptions { - bigint?: boolean | undefined; - persistent?: boolean | undefined; - interval?: number | undefined; - } - /** - * Watch for changes on `filename`. The callback `listener` will be called each - * time the file is accessed. - * - * The `options` argument may be omitted. If provided, it should be an object. The `options` object may contain a boolean named `persistent` that indicates - * whether the process should continue to run as long as files are being watched. - * The `options` object may specify an `interval` property indicating how often the - * target should be polled in milliseconds. - * - * The `listener` gets two arguments the current stat object and the previous - * stat object: - * - * ```js - * import { watchFile } from 'node:fs'; - * - * watchFile('message.text', (curr, prev) => { - * console.log(`the current mtime is: ${curr.mtime}`); - * console.log(`the previous mtime was: ${prev.mtime}`); - * }); - * ``` - * - * These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`, - * the numeric values in these objects are specified as `BigInt`s. - * - * To be notified when the file was modified, not just accessed, it is necessary - * to compare `curr.mtimeMs` and `prev.mtimeMs`. - * - * When an `fs.watchFile` operation results in an `ENOENT` error, it - * will invoke the listener once, with all the fields zeroed (or, for dates, the - * Unix Epoch). If the file is created later on, the listener will be called - * again, with the latest stat objects. This is a change in functionality since - * v0.10. - * - * Using {@link watch} is more efficient than `fs.watchFile` and `fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and `fs.unwatchFile` when possible. - * - * When a file being watched by `fs.watchFile()` disappears and reappears, - * then the contents of `previous` in the second callback event (the file's - * reappearance) will be the same as the contents of `previous` in the first - * callback event (its disappearance). - * - * This happens when: - * - * * the file is deleted, followed by a restore - * * the file is renamed and then renamed a second time back to its original name - * @since v0.1.31 - */ - export function watchFile( - filename: PathLike, - options: - | (WatchFileOptions & { - bigint?: false | undefined; - }) - | undefined, - listener: StatsListener, - ): StatWatcher; - export function watchFile( - filename: PathLike, - options: - | (WatchFileOptions & { - bigint: true; - }) - | undefined, - listener: BigIntStatsListener, - ): StatWatcher; - /** - * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - */ - export function watchFile(filename: PathLike, listener: StatsListener): StatWatcher; - /** - * Stop watching for changes on `filename`. If `listener` is specified, only that - * particular listener is removed. Otherwise, _all_ listeners are removed, - * effectively stopping watching of `filename`. - * - * Calling `fs.unwatchFile()` with a filename that is not being watched is a - * no-op, not an error. - * - * Using {@link watch} is more efficient than `fs.watchFile()` and `fs.unwatchFile()`. `fs.watch()` should be used instead of `fs.watchFile()` and `fs.unwatchFile()` when possible. - * @since v0.1.31 - * @param listener Optional, a listener previously attached using `fs.watchFile()` - */ - export function unwatchFile(filename: PathLike, listener?: StatsListener): void; - export function unwatchFile(filename: PathLike, listener?: BigIntStatsListener): void; - export interface WatchOptions extends Abortable { - encoding?: BufferEncoding | "buffer" | undefined; - persistent?: boolean | undefined; - recursive?: boolean | undefined; - } - export type WatchEventType = "rename" | "change"; - export type WatchListener = (event: WatchEventType, filename: T | null) => void; - export type StatsListener = (curr: Stats, prev: Stats) => void; - export type BigIntStatsListener = (curr: BigIntStats, prev: BigIntStats) => void; - /** - * Watch for changes on `filename`, where `filename` is either a file or a - * directory. - * - * The second argument is optional. If `options` is provided as a string, it - * specifies the `encoding`. Otherwise `options` should be passed as an object. - * - * The listener callback gets two arguments `(eventType, filename)`. `eventType`is either `'rename'` or `'change'`, and `filename` is the name of the file - * which triggered the event. - * - * On most platforms, `'rename'` is emitted whenever a filename appears or - * disappears in the directory. - * - * The listener callback is attached to the `'change'` event fired by `fs.FSWatcher`, but it is not the same thing as the `'change'` value of `eventType`. - * - * If a `signal` is passed, aborting the corresponding AbortController will close - * the returned `fs.FSWatcher`. - * @since v0.5.10 - * @param listener - */ - export function watch( - filename: PathLike, - options: - | (WatchOptions & { - encoding: "buffer"; - }) - | "buffer", - listener?: WatchListener, - ): FSWatcher; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `persistent` is not supplied, the default of `true` is used. - * If `recursive` is not supplied, the default of `false` is used. - */ - export function watch( - filename: PathLike, - options?: WatchOptions | BufferEncoding | null, - listener?: WatchListener, - ): FSWatcher; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `persistent` is not supplied, the default of `true` is used. - * If `recursive` is not supplied, the default of `false` is used. - */ - export function watch( - filename: PathLike, - options: WatchOptions | string, - listener?: WatchListener, - ): FSWatcher; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - */ - export function watch(filename: PathLike, listener?: WatchListener): FSWatcher; - /** - * Test whether or not the given path exists by checking with the file system. - * Then call the `callback` argument with either true or false: - * - * ```js - * import { exists } from 'node:fs'; - * - * exists('/etc/passwd', (e) => { - * console.log(e ? 'it exists' : 'no passwd!'); - * }); - * ``` - * - * **The parameters for this callback are not consistent with other Node.js** - * **callbacks.** Normally, the first parameter to a Node.js callback is an `err` parameter, optionally followed by other parameters. The `fs.exists()` callback - * has only one boolean parameter. This is one reason `fs.access()` is recommended - * instead of `fs.exists()`. - * - * Using `fs.exists()` to check for the existence of a file before calling `fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended. Doing - * so introduces a race condition, since other processes may change the file's - * state between the two calls. Instead, user code should open/read/write the - * file directly and handle the error raised if the file does not exist. - * - * **write (NOT RECOMMENDED)** - * - * ```js - * import { exists, open, close } from 'node:fs'; - * - * exists('myfile', (e) => { - * if (e) { - * console.error('myfile already exists'); - * } else { - * open('myfile', 'wx', (err, fd) => { - * if (err) throw err; - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * } - * }); - * ``` - * - * **write (RECOMMENDED)** - * - * ```js - * import { open, close } from 'node:fs'; - * open('myfile', 'wx', (err, fd) => { - * if (err) { - * if (err.code === 'EEXIST') { - * console.error('myfile already exists'); - * return; - * } - * - * throw err; - * } - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * **read (NOT RECOMMENDED)** - * - * ```js - * import { open, close, exists } from 'node:fs'; - * - * exists('myfile', (e) => { - * if (e) { - * open('myfile', 'r', (err, fd) => { - * if (err) throw err; - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * } else { - * console.error('myfile does not exist'); - * } - * }); - * ``` - * - * **read (RECOMMENDED)** - * - * ```js - * import { open, close } from 'node:fs'; - * - * open('myfile', 'r', (err, fd) => { - * if (err) { - * if (err.code === 'ENOENT') { - * console.error('myfile does not exist'); - * return; - * } - * - * throw err; - * } - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * The "not recommended" examples above check for existence and then use the - * file; the "recommended" examples are better because they use the file directly - * and handle the error, if any. - * - * In general, check for the existence of a file only if the file won't be - * used directly, for example when its existence is a signal from another - * process. - * @since v0.0.2 - * @deprecated Since v1.0.0 - Use {@link stat} or {@link access} instead. - */ - export function exists(path: PathLike, callback: (exists: boolean) => void): void; - /** @deprecated */ - export namespace exists { - /** - * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - function __promisify__(path: PathLike): Promise; - } - /** - * Returns `true` if the path exists, `false` otherwise. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link exists}. - * - * `fs.exists()` is deprecated, but `fs.existsSync()` is not. The `callback` parameter to `fs.exists()` accepts parameters that are inconsistent with other - * Node.js callbacks. `fs.existsSync()` does not use a callback. - * - * ```js - * import { existsSync } from 'node:fs'; - * - * if (existsSync('/etc/passwd')) - * console.log('The path exists.'); - * ``` - * @since v0.1.21 - */ - export function existsSync(path: PathLike): boolean; - export namespace constants { - // File Access Constants - /** Constant for fs.access(). File is visible to the calling process. */ - const F_OK: number; - /** Constant for fs.access(). File can be read by the calling process. */ - const R_OK: number; - /** Constant for fs.access(). File can be written by the calling process. */ - const W_OK: number; - /** Constant for fs.access(). File can be executed by the calling process. */ - const X_OK: number; - // File Copy Constants - /** Constant for fs.copyFile. Flag indicating the destination file should not be overwritten if it already exists. */ - const COPYFILE_EXCL: number; - /** - * Constant for fs.copyFile. copy operation will attempt to create a copy-on-write reflink. - * If the underlying platform does not support copy-on-write, then a fallback copy mechanism is used. - */ - const COPYFILE_FICLONE: number; - /** - * Constant for fs.copyFile. Copy operation will attempt to create a copy-on-write reflink. - * If the underlying platform does not support copy-on-write, then the operation will fail with an error. - */ - const COPYFILE_FICLONE_FORCE: number; - // File Open Constants - /** Constant for fs.open(). Flag indicating to open a file for read-only access. */ - const O_RDONLY: number; - /** Constant for fs.open(). Flag indicating to open a file for write-only access. */ - const O_WRONLY: number; - /** Constant for fs.open(). Flag indicating to open a file for read-write access. */ - const O_RDWR: number; - /** Constant for fs.open(). Flag indicating to create the file if it does not already exist. */ - const O_CREAT: number; - /** Constant for fs.open(). Flag indicating that opening a file should fail if the O_CREAT flag is set and the file already exists. */ - const O_EXCL: number; - /** - * Constant for fs.open(). Flag indicating that if path identifies a terminal device, - * opening the path shall not cause that terminal to become the controlling terminal for the process - * (if the process does not already have one). - */ - const O_NOCTTY: number; - /** Constant for fs.open(). Flag indicating that if the file exists and is a regular file, and the file is opened successfully for write access, its length shall be truncated to zero. */ - const O_TRUNC: number; - /** Constant for fs.open(). Flag indicating that data will be appended to the end of the file. */ - const O_APPEND: number; - /** Constant for fs.open(). Flag indicating that the open should fail if the path is not a directory. */ - const O_DIRECTORY: number; - /** - * constant for fs.open(). - * Flag indicating reading accesses to the file system will no longer result in - * an update to the atime information associated with the file. - * This flag is available on Linux operating systems only. - */ - const O_NOATIME: number; - /** Constant for fs.open(). Flag indicating that the open should fail if the path is a symbolic link. */ - const O_NOFOLLOW: number; - /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O. */ - const O_SYNC: number; - /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O with write operations waiting for data integrity. */ - const O_DSYNC: number; - /** Constant for fs.open(). Flag indicating to open the symbolic link itself rather than the resource it is pointing to. */ - const O_SYMLINK: number; - /** Constant for fs.open(). When set, an attempt will be made to minimize caching effects of file I/O. */ - const O_DIRECT: number; - /** Constant for fs.open(). Flag indicating to open the file in nonblocking mode when possible. */ - const O_NONBLOCK: number; - // File Type Constants - /** Constant for fs.Stats mode property for determining a file's type. Bit mask used to extract the file type code. */ - const S_IFMT: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a regular file. */ - const S_IFREG: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a directory. */ - const S_IFDIR: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a character-oriented device file. */ - const S_IFCHR: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a block-oriented device file. */ - const S_IFBLK: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a FIFO/pipe. */ - const S_IFIFO: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a symbolic link. */ - const S_IFLNK: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a socket. */ - const S_IFSOCK: number; - // File Mode Constants - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by owner. */ - const S_IRWXU: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by owner. */ - const S_IRUSR: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by owner. */ - const S_IWUSR: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by owner. */ - const S_IXUSR: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by group. */ - const S_IRWXG: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by group. */ - const S_IRGRP: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by group. */ - const S_IWGRP: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by group. */ - const S_IXGRP: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by others. */ - const S_IRWXO: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by others. */ - const S_IROTH: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by others. */ - const S_IWOTH: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by others. */ - const S_IXOTH: number; - /** - * When set, a memory file mapping is used to access the file. This flag - * is available on Windows operating systems only. On other operating systems, - * this flag is ignored. - */ - const UV_FS_O_FILEMAP: number; - } - /** - * Tests a user's permissions for the file or directory specified by `path`. - * The `mode` argument is an optional integer that specifies the accessibility - * checks to be performed. `mode` should be either the value `fs.constants.F_OK` or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`, `fs.constants.W_OK`, and `fs.constants.X_OK` - * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for - * possible values of `mode`. - * - * The final argument, `callback`, is a callback function that is invoked with - * a possible error argument. If any of the accessibility checks fail, the error - * argument will be an `Error` object. The following examples check if `package.json` exists, and if it is readable or writable. - * - * ```js - * import { access, constants } from 'node:fs'; - * - * const file = 'package.json'; - * - * // Check if the file exists in the current directory. - * access(file, constants.F_OK, (err) => { - * console.log(`${file} ${err ? 'does not exist' : 'exists'}`); - * }); - * - * // Check if the file is readable. - * access(file, constants.R_OK, (err) => { - * console.log(`${file} ${err ? 'is not readable' : 'is readable'}`); - * }); - * - * // Check if the file is writable. - * access(file, constants.W_OK, (err) => { - * console.log(`${file} ${err ? 'is not writable' : 'is writable'}`); - * }); - * - * // Check if the file is readable and writable. - * access(file, constants.R_OK | constants.W_OK, (err) => { - * console.log(`${file} ${err ? 'is not' : 'is'} readable and writable`); - * }); - * ``` - * - * Do not use `fs.access()` to check for the accessibility of a file before calling `fs.open()`, `fs.readFile()`, or `fs.writeFile()`. Doing - * so introduces a race condition, since other processes may change the file's - * state between the two calls. Instead, user code should open/read/write the - * file directly and handle the error raised if the file is not accessible. - * - * **write (NOT RECOMMENDED)** - * - * ```js - * import { access, open, close } from 'node:fs'; - * - * access('myfile', (err) => { - * if (!err) { - * console.error('myfile already exists'); - * return; - * } - * - * open('myfile', 'wx', (err, fd) => { - * if (err) throw err; - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * }); - * ``` - * - * **write (RECOMMENDED)** - * - * ```js - * import { open, close } from 'node:fs'; - * - * open('myfile', 'wx', (err, fd) => { - * if (err) { - * if (err.code === 'EEXIST') { - * console.error('myfile already exists'); - * return; - * } - * - * throw err; - * } - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * **read (NOT RECOMMENDED)** - * - * ```js - * import { access, open, close } from 'node:fs'; - * access('myfile', (err) => { - * if (err) { - * if (err.code === 'ENOENT') { - * console.error('myfile does not exist'); - * return; - * } - * - * throw err; - * } - * - * open('myfile', 'r', (err, fd) => { - * if (err) throw err; - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * }); - * ``` - * - * **read (RECOMMENDED)** - * - * ```js - * import { open, close } from 'node:fs'; - * - * open('myfile', 'r', (err, fd) => { - * if (err) { - * if (err.code === 'ENOENT') { - * console.error('myfile does not exist'); - * return; - * } - * - * throw err; - * } - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * The "not recommended" examples above check for accessibility and then use the - * file; the "recommended" examples are better because they use the file directly - * and handle the error, if any. - * - * In general, check for the accessibility of a file only if the file will not be - * used directly, for example when its accessibility is a signal from another - * process. - * - * On Windows, access-control policies (ACLs) on a directory may limit access to - * a file or directory. The `fs.access()` function, however, does not check the - * ACL and therefore may report that a path is accessible even if the ACL restricts - * the user from reading or writing to it. - * @since v0.11.15 - * @param [mode=fs.constants.F_OK] - */ - export function access(path: PathLike, mode: number | undefined, callback: NoParamCallback): void; - /** - * Asynchronously tests a user's permissions for the file specified by path. - * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - */ - export function access(path: PathLike, callback: NoParamCallback): void; - export namespace access { - /** - * Asynchronously tests a user's permissions for the file specified by path. - * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - function __promisify__(path: PathLike, mode?: number): Promise; - } - /** - * Synchronously tests a user's permissions for the file or directory specified - * by `path`. The `mode` argument is an optional integer that specifies the - * accessibility checks to be performed. `mode` should be either the value `fs.constants.F_OK` or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`, `fs.constants.W_OK`, and - * `fs.constants.X_OK` (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for - * possible values of `mode`. - * - * If any of the accessibility checks fail, an `Error` will be thrown. Otherwise, - * the method will return `undefined`. - * - * ```js - * import { accessSync, constants } from 'node:fs'; - * - * try { - * accessSync('etc/passwd', constants.R_OK | constants.W_OK); - * console.log('can read/write'); - * } catch (err) { - * console.error('no access!'); - * } - * ``` - * @since v0.11.15 - * @param [mode=fs.constants.F_OK] - */ - export function accessSync(path: PathLike, mode?: number): void; - interface StreamOptions { - flags?: string | undefined; - encoding?: BufferEncoding | undefined; - fd?: number | promises.FileHandle | undefined; - mode?: number | undefined; - autoClose?: boolean | undefined; - emitClose?: boolean | undefined; - start?: number | undefined; - signal?: AbortSignal | null | undefined; - highWaterMark?: number | undefined; - } - interface FSImplementation { - open?: (...args: any[]) => any; - close?: (...args: any[]) => any; - } - interface CreateReadStreamFSImplementation extends FSImplementation { - read: (...args: any[]) => any; - } - interface CreateWriteStreamFSImplementation extends FSImplementation { - write: (...args: any[]) => any; - writev?: (...args: any[]) => any; - } - interface ReadStreamOptions extends StreamOptions { - fs?: CreateReadStreamFSImplementation | null | undefined; - end?: number | undefined; - } - interface WriteStreamOptions extends StreamOptions { - fs?: CreateWriteStreamFSImplementation | null | undefined; - flush?: boolean | undefined; - } - /** - * Unlike the 16 KiB default `highWaterMark` for a `stream.Readable`, the stream - * returned by this method has a default `highWaterMark` of 64 KiB. - * - * `options` can include `start` and `end` values to read a range of bytes from - * the file instead of the entire file. Both `start` and `end` are inclusive and - * start counting at 0, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. If `fd` is specified and `start` is - * omitted or `undefined`, `fs.createReadStream()` reads sequentially from the - * current file position. The `encoding` can be any one of those accepted by `Buffer`. - * - * If `fd` is specified, `ReadStream` will ignore the `path` argument and will use - * the specified file descriptor. This means that no `'open'` event will be - * emitted. `fd` should be blocking; non-blocking `fd`s should be passed to `net.Socket`. - * - * If `fd` points to a character device that only supports blocking reads - * (such as keyboard or sound card), read operations do not finish until data is - * available. This can prevent the process from exiting and the stream from - * closing naturally. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed. Set the `emitClose` option to `false` to change this behavior. - * - * By providing the `fs` option, it is possible to override the corresponding `fs` implementations for `open`, `read`, and `close`. When providing the `fs` option, - * an override for `read` is required. If no `fd` is provided, an override for `open` is also required. If `autoClose` is `true`, an override for `close` is - * also required. - * - * ```js - * import { createReadStream } from 'node:fs'; - * - * // Create a stream from some character device. - * const stream = createReadStream('/dev/input/event0'); - * setTimeout(() => { - * stream.close(); // This may not close the stream. - * // Artificially marking end-of-stream, as if the underlying resource had - * // indicated end-of-file by itself, allows the stream to close. - * // This does not cancel pending read operations, and if there is such an - * // operation, the process may still not be able to exit successfully - * // until it finishes. - * stream.push(null); - * stream.read(0); - * }, 100); - * ``` - * - * If `autoClose` is false, then the file descriptor won't be closed, even if - * there's an error. It is the application's responsibility to close it and make - * sure there's no file descriptor leak. If `autoClose` is set to true (default - * behavior), on `'error'` or `'end'` the file descriptor will be closed - * automatically. - * - * `mode` sets the file mode (permission and sticky bits), but only if the - * file was created. - * - * An example to read the last 10 bytes of a file which is 100 bytes long: - * - * ```js - * import { createReadStream } from 'node:fs'; - * - * createReadStream('sample.txt', { start: 90, end: 99 }); - * ``` - * - * If `options` is a string, then it specifies the encoding. - * @since v0.1.31 - */ - export function createReadStream(path: PathLike, options?: BufferEncoding | ReadStreamOptions): ReadStream; - /** - * `options` may also include a `start` option to allow writing data at some - * position past the beginning of the file, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than - * replacing it may require the `flags` option to be set to `r+` rather than the - * default `w`. The `encoding` can be any one of those accepted by `Buffer`. - * - * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'` the file descriptor will be closed automatically. If `autoClose` is false, - * then the file descriptor won't be closed, even if there's an error. - * It is the application's responsibility to close it and make sure there's no - * file descriptor leak. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed. Set the `emitClose` option to `false` to change this behavior. - * - * By providing the `fs` option it is possible to override the corresponding `fs` implementations for `open`, `write`, `writev`, and `close`. Overriding `write()` without `writev()` can reduce - * performance as some optimizations (`_writev()`) - * will be disabled. When providing the `fs` option, overrides for at least one of `write` and `writev` are required. If no `fd` option is supplied, an override - * for `open` is also required. If `autoClose` is `true`, an override for `close` is also required. - * - * Like `fs.ReadStream`, if `fd` is specified, `fs.WriteStream` will ignore the `path` argument and will use the specified file descriptor. This means that no `'open'` event will be - * emitted. `fd` should be blocking; non-blocking `fd`s - * should be passed to `net.Socket`. - * - * If `options` is a string, then it specifies the encoding. - * @since v0.1.31 - */ - export function createWriteStream(path: PathLike, options?: BufferEncoding | WriteStreamOptions): WriteStream; - /** - * Forces all currently queued I/O operations associated with the file to the - * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. No arguments other - * than a possible - * exception are given to the completion callback. - * @since v0.1.96 - */ - export function fdatasync(fd: number, callback: NoParamCallback): void; - export namespace fdatasync { - /** - * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. - * @param fd A file descriptor. - */ - function __promisify__(fd: number): Promise; - } - /** - * Forces all currently queued I/O operations associated with the file to the - * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. Returns `undefined`. - * @since v0.1.96 - */ - export function fdatasyncSync(fd: number): void; - /** - * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it - * already exists. No arguments other than a possible exception are given to the - * callback function. Node.js makes no guarantees about the atomicity of the copy - * operation. If an error occurs after the destination file has been opened for - * writing, Node.js will attempt to remove the destination. - * - * `mode` is an optional integer that specifies the behavior - * of the copy operation. It is possible to create a mask consisting of the bitwise - * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`). - * - * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already - * exists. - * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a - * copy-on-write reflink. If the platform does not support copy-on-write, then a - * fallback copy mechanism is used. - * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to - * create a copy-on-write reflink. If the platform does not support - * copy-on-write, then the operation will fail. - * - * ```js - * import { copyFile, constants } from 'node:fs'; - * - * function callback(err) { - * if (err) throw err; - * console.log('source.txt was copied to destination.txt'); - * } - * - * // destination.txt will be created or overwritten by default. - * copyFile('source.txt', 'destination.txt', callback); - * - * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. - * copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL, callback); - * ``` - * @since v8.5.0 - * @param src source filename to copy - * @param dest destination filename of the copy operation - * @param [mode=0] modifiers for copy operation. - */ - export function copyFile(src: PathLike, dest: PathLike, callback: NoParamCallback): void; - export function copyFile(src: PathLike, dest: PathLike, mode: number, callback: NoParamCallback): void; - export namespace copyFile { - function __promisify__(src: PathLike, dst: PathLike, mode?: number): Promise; - } - /** - * Synchronously copies `src` to `dest`. By default, `dest` is overwritten if it - * already exists. Returns `undefined`. Node.js makes no guarantees about the - * atomicity of the copy operation. If an error occurs after the destination file - * has been opened for writing, Node.js will attempt to remove the destination. - * - * `mode` is an optional integer that specifies the behavior - * of the copy operation. It is possible to create a mask consisting of the bitwise - * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`). - * - * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already - * exists. - * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a - * copy-on-write reflink. If the platform does not support copy-on-write, then a - * fallback copy mechanism is used. - * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to - * create a copy-on-write reflink. If the platform does not support - * copy-on-write, then the operation will fail. - * - * ```js - * import { copyFileSync, constants } from 'node:fs'; - * - * // destination.txt will be created or overwritten by default. - * copyFileSync('source.txt', 'destination.txt'); - * console.log('source.txt was copied to destination.txt'); - * - * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. - * copyFileSync('source.txt', 'destination.txt', constants.COPYFILE_EXCL); - * ``` - * @since v8.5.0 - * @param src source filename to copy - * @param dest destination filename of the copy operation - * @param [mode=0] modifiers for copy operation. - */ - export function copyFileSync(src: PathLike, dest: PathLike, mode?: number): void; - /** - * Write an array of `ArrayBufferView`s to the file specified by `fd` using `writev()`. - * - * `position` is the offset from the beginning of the file where this data - * should be written. If `typeof position !== 'number'`, the data will be written - * at the current position. - * - * The callback will be given three arguments: `err`, `bytesWritten`, and `buffers`. `bytesWritten` is how many bytes were written from `buffers`. - * - * If this method is `util.promisify()` ed, it returns a promise for an `Object` with `bytesWritten` and `buffers` properties. - * - * It is unsafe to use `fs.writev()` multiple times on the same file without - * waiting for the callback. For this scenario, use {@link createWriteStream}. - * - * On Linux, positional writes don't work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v12.9.0 - * @param [position='null'] - */ - export function writev( - fd: number, - buffers: readonly NodeJS.ArrayBufferView[], - cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void, - ): void; - export function writev( - fd: number, - buffers: readonly NodeJS.ArrayBufferView[], - position: number, - cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void, - ): void; - export interface WriteVResult { - bytesWritten: number; - buffers: NodeJS.ArrayBufferView[]; - } - export namespace writev { - function __promisify__( - fd: number, - buffers: readonly NodeJS.ArrayBufferView[], - position?: number, - ): Promise; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link writev}. - * @since v12.9.0 - * @param [position='null'] - * @return The number of bytes written. - */ - export function writevSync(fd: number, buffers: readonly NodeJS.ArrayBufferView[], position?: number): number; - /** - * Read from a file specified by `fd` and write to an array of `ArrayBufferView`s - * using `readv()`. - * - * `position` is the offset from the beginning of the file from where data - * should be read. If `typeof position !== 'number'`, the data will be read - * from the current position. - * - * The callback will be given three arguments: `err`, `bytesRead`, and `buffers`. `bytesRead` is how many bytes were read from the file. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a promise for an `Object` with `bytesRead` and `buffers` properties. - * @since v13.13.0, v12.17.0 - * @param [position='null'] - */ - export function readv( - fd: number, - buffers: readonly NodeJS.ArrayBufferView[], - cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void, - ): void; - export function readv( - fd: number, - buffers: readonly NodeJS.ArrayBufferView[], - position: number, - cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void, - ): void; - export interface ReadVResult { - bytesRead: number; - buffers: NodeJS.ArrayBufferView[]; - } - export namespace readv { - function __promisify__( - fd: number, - buffers: readonly NodeJS.ArrayBufferView[], - position?: number, - ): Promise; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link readv}. - * @since v13.13.0, v12.17.0 - * @param [position='null'] - * @return The number of bytes read. - */ - export function readvSync(fd: number, buffers: readonly NodeJS.ArrayBufferView[], position?: number): number; - - export interface OpenAsBlobOptions { - /** - * An optional mime type for the blob. - * - * @default 'undefined' - */ - type?: string | undefined; - } - - /** - * Returns a `Blob` whose data is backed by the given file. - * - * The file must not be modified after the `Blob` is created. Any modifications - * will cause reading the `Blob` data to fail with a `DOMException` error. - * Synchronous stat operations on the file when the `Blob` is created, and before - * each read in order to detect whether the file data has been modified on disk. - * - * ```js - * import { openAsBlob } from 'node:fs'; - * - * const blob = await openAsBlob('the.file.txt'); - * const ab = await blob.arrayBuffer(); - * blob.stream(); - * ``` - * @since v19.8.0 - * @experimental - */ - export function openAsBlob(path: PathLike, options?: OpenAsBlobOptions): Promise; - - export interface OpenDirOptions { - /** - * @default 'utf8' - */ - encoding?: BufferEncoding | undefined; - /** - * Number of directory entries that are buffered - * internally when reading from the directory. Higher values lead to better - * performance but higher memory usage. - * @default 32 - */ - bufferSize?: number | undefined; - /** - * @default false - */ - recursive?: boolean; - } - /** - * Synchronously open a directory. See [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html). - * - * Creates an `fs.Dir`, which contains all further functions for reading from - * and cleaning up the directory. - * - * The `encoding` option sets the encoding for the `path` while opening the - * directory and subsequent read operations. - * @since v12.12.0 - */ - export function opendirSync(path: PathLike, options?: OpenDirOptions): Dir; - /** - * Asynchronously open a directory. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for - * more details. - * - * Creates an `fs.Dir`, which contains all further functions for reading from - * and cleaning up the directory. - * - * The `encoding` option sets the encoding for the `path` while opening the - * directory and subsequent read operations. - * @since v12.12.0 - */ - export function opendir(path: PathLike, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void; - export function opendir( - path: PathLike, - options: OpenDirOptions, - cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void, - ): void; - export namespace opendir { - function __promisify__(path: PathLike, options?: OpenDirOptions): Promise; - } - export interface BigIntStats extends StatsBase { - atimeNs: bigint; - mtimeNs: bigint; - ctimeNs: bigint; - birthtimeNs: bigint; - } - export interface BigIntOptions { - bigint: true; - } - export interface StatOptions { - bigint?: boolean | undefined; - } - export interface StatSyncOptions extends StatOptions { - throwIfNoEntry?: boolean | undefined; - } - interface CopyOptionsBase { - /** - * Dereference symlinks - * @default false - */ - dereference?: boolean; - /** - * When `force` is `false`, and the destination - * exists, throw an error. - * @default false - */ - errorOnExist?: boolean; - /** - * Overwrite existing file or directory. _The copy - * operation will ignore errors if you set this to false and the destination - * exists. Use the `errorOnExist` option to change this behavior. - * @default true - */ - force?: boolean; - /** - * Modifiers for copy operation. See `mode` flag of {@link copyFileSync()} - */ - mode?: number; - /** - * When `true` timestamps from `src` will - * be preserved. - * @default false - */ - preserveTimestamps?: boolean; - /** - * Copy directories recursively. - * @default false - */ - recursive?: boolean; - /** - * When true, path resolution for symlinks will be skipped - * @default false - */ - verbatimSymlinks?: boolean; - } - export interface CopyOptions extends CopyOptionsBase { - /** - * Function to filter copied files/directories. Return - * `true` to copy the item, `false` to ignore it. - */ - filter?(source: string, destination: string): boolean | Promise; - } - export interface CopySyncOptions extends CopyOptionsBase { - /** - * Function to filter copied files/directories. Return - * `true` to copy the item, `false` to ignore it. - */ - filter?(source: string, destination: string): boolean; - } - /** - * Asynchronously copies the entire directory structure from `src` to `dest`, - * including subdirectories and files. - * - * When copying a directory to another directory, globs are not supported and - * behavior is similar to `cp dir1/ dir2/`. - * @since v16.7.0 - * @experimental - * @param src source path to copy. - * @param dest destination path to copy to. - */ - export function cp( - source: string | URL, - destination: string | URL, - callback: (err: NodeJS.ErrnoException | null) => void, - ): void; - export function cp( - source: string | URL, - destination: string | URL, - opts: CopyOptions, - callback: (err: NodeJS.ErrnoException | null) => void, - ): void; - /** - * Synchronously copies the entire directory structure from `src` to `dest`, - * including subdirectories and files. - * - * When copying a directory to another directory, globs are not supported and - * behavior is similar to `cp dir1/ dir2/`. - * @since v16.7.0 - * @experimental - * @param src source path to copy. - * @param dest destination path to copy to. - */ - export function cpSync(source: string | URL, destination: string | URL, opts?: CopySyncOptions): void; - - export interface GlobOptions { - /** - * Current working directory. - * @default process.cwd() - */ - cwd?: string | undefined; - /** - * Function to filter out files/directories. Return true to exclude the item, false to include it. - */ - exclude?: ((fileName: string) => boolean) | undefined; - /** - * `true` if the glob should return paths as `Dirent`s, `false` otherwise. - * @default false - * @since v22.2.0 - */ - withFileTypes?: boolean | undefined; - } - export interface GlobOptionsWithFileTypes extends GlobOptions { - withFileTypes: true; - } - export interface GlobOptionsWithoutFileTypes extends GlobOptions { - withFileTypes?: false | undefined; - } - /** - * Retrieves the files matching the specified pattern. - */ - export function glob( - pattern: string | string[], - callback: (err: NodeJS.ErrnoException | null, matches: string[]) => void, - ): void; - export function glob( - pattern: string | string[], - options: GlobOptionsWithFileTypes, - callback: ( - err: NodeJS.ErrnoException | null, - matches: Dirent[], - ) => void, - ): void; - export function glob( - pattern: string | string[], - options: GlobOptionsWithoutFileTypes, - callback: ( - err: NodeJS.ErrnoException | null, - matches: string[], - ) => void, - ): void; - export function glob( - pattern: string | string[], - options: GlobOptions, - callback: ( - err: NodeJS.ErrnoException | null, - matches: Dirent[] | string[], - ) => void, - ): void; - /** - * Retrieves the files matching the specified pattern. - */ - export function globSync(pattern: string | string[]): string[]; - export function globSync( - pattern: string | string[], - options: GlobOptionsWithFileTypes, - ): Dirent[]; - export function globSync( - pattern: string | string[], - options: GlobOptionsWithoutFileTypes, - ): string[]; - export function globSync( - pattern: string | string[], - options: GlobOptions, - ): Dirent[] | string[]; -} -declare module "node:fs" { - export * from "fs"; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/fs/promises.d.ts b/tools/mnemonic-test/node_modules/@types/node/fs/promises.d.ts deleted file mode 100644 index e89010f1..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/fs/promises.d.ts +++ /dev/null @@ -1,1264 +0,0 @@ -/** - * The `fs/promises` API provides asynchronous file system methods that return - * promises. - * - * The promise APIs use the underlying Node.js threadpool to perform file - * system operations off the event loop thread. These operations are not - * synchronized or threadsafe. Care must be taken when performing multiple - * concurrent modifications on the same file or data corruption may occur. - * @since v10.0.0 - */ -declare module "fs/promises" { - import { Abortable } from "node:events"; - import { Stream } from "node:stream"; - import { ReadableStream } from "node:stream/web"; - import { - BigIntStats, - BigIntStatsFs, - BufferEncodingOption, - constants as fsConstants, - CopyOptions, - Dir, - Dirent, - GlobOptions, - GlobOptionsWithFileTypes, - GlobOptionsWithoutFileTypes, - MakeDirectoryOptions, - Mode, - ObjectEncodingOptions, - OpenDirOptions, - OpenMode, - PathLike, - ReadStream, - ReadVResult, - RmDirOptions, - RmOptions, - StatFsOptions, - StatOptions, - Stats, - StatsFs, - TimeLike, - WatchEventType, - WatchOptions, - WriteStream, - WriteVResult, - } from "node:fs"; - import { Interface as ReadlineInterface } from "node:readline"; - interface FileChangeInfo { - eventType: WatchEventType; - filename: T | null; - } - interface FlagAndOpenMode { - mode?: Mode | undefined; - flag?: OpenMode | undefined; - } - interface FileReadResult { - bytesRead: number; - buffer: T; - } - interface FileReadOptions { - /** - * @default `Buffer.alloc(0xffff)` - */ - buffer?: T; - /** - * @default 0 - */ - offset?: number | null; - /** - * @default `buffer.byteLength` - */ - length?: number | null; - position?: number | null; - } - interface CreateReadStreamOptions { - encoding?: BufferEncoding | null | undefined; - autoClose?: boolean | undefined; - emitClose?: boolean | undefined; - start?: number | undefined; - end?: number | undefined; - highWaterMark?: number | undefined; - } - interface CreateWriteStreamOptions { - encoding?: BufferEncoding | null | undefined; - autoClose?: boolean | undefined; - emitClose?: boolean | undefined; - start?: number | undefined; - highWaterMark?: number | undefined; - flush?: boolean | undefined; - } - interface ReadableWebStreamOptions { - /** - * Whether to open a normal or a `'bytes'` stream. - * @since v20.0.0 - */ - type?: "bytes" | undefined; - } - // TODO: Add `EventEmitter` close - interface FileHandle { - /** - * The numeric file descriptor managed by the {FileHandle} object. - * @since v10.0.0 - */ - readonly fd: number; - /** - * Alias of `filehandle.writeFile()`. - * - * When operating on file handles, the mode cannot be changed from what it was set - * to with `fsPromises.open()`. Therefore, this is equivalent to `filehandle.writeFile()`. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - appendFile( - data: string | Uint8Array, - options?: - | (ObjectEncodingOptions & FlagAndOpenMode & { flush?: boolean | undefined }) - | BufferEncoding - | null, - ): Promise; - /** - * Changes the ownership of the file. A wrapper for [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html). - * @since v10.0.0 - * @param uid The file's new owner's user id. - * @param gid The file's new group's group id. - * @return Fulfills with `undefined` upon success. - */ - chown(uid: number, gid: number): Promise; - /** - * Modifies the permissions on the file. See [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html). - * @since v10.0.0 - * @param mode the file mode bit mask. - * @return Fulfills with `undefined` upon success. - */ - chmod(mode: Mode): Promise; - /** - * Unlike the 16 KiB default `highWaterMark` for a `stream.Readable`, the stream - * returned by this method has a default `highWaterMark` of 64 KiB. - * - * `options` can include `start` and `end` values to read a range of bytes from - * the file instead of the entire file. Both `start` and `end` are inclusive and - * start counting at 0, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. If `start` is - * omitted or `undefined`, `filehandle.createReadStream()` reads sequentially from - * the current file position. The `encoding` can be any one of those accepted by `Buffer`. - * - * If the `FileHandle` points to a character device that only supports blocking - * reads (such as keyboard or sound card), read operations do not finish until data - * is available. This can prevent the process from exiting and the stream from - * closing naturally. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed. Set the `emitClose` option to `false` to change this behavior. - * - * ```js - * import { open } from 'node:fs/promises'; - * - * const fd = await open('/dev/input/event0'); - * // Create a stream from some character device. - * const stream = fd.createReadStream(); - * setTimeout(() => { - * stream.close(); // This may not close the stream. - * // Artificially marking end-of-stream, as if the underlying resource had - * // indicated end-of-file by itself, allows the stream to close. - * // This does not cancel pending read operations, and if there is such an - * // operation, the process may still not be able to exit successfully - * // until it finishes. - * stream.push(null); - * stream.read(0); - * }, 100); - * ``` - * - * If `autoClose` is false, then the file descriptor won't be closed, even if - * there's an error. It is the application's responsibility to close it and make - * sure there's no file descriptor leak. If `autoClose` is set to true (default - * behavior), on `'error'` or `'end'` the file descriptor will be closed - * automatically. - * - * An example to read the last 10 bytes of a file which is 100 bytes long: - * - * ```js - * import { open } from 'node:fs/promises'; - * - * const fd = await open('sample.txt'); - * fd.createReadStream({ start: 90, end: 99 }); - * ``` - * @since v16.11.0 - */ - createReadStream(options?: CreateReadStreamOptions): ReadStream; - /** - * `options` may also include a `start` option to allow writing data at some - * position past the beginning of the file, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than - * replacing it may require the `flags` `open` option to be set to `r+` rather than - * the default `r`. The `encoding` can be any one of those accepted by `Buffer`. - * - * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'` the file descriptor will be closed automatically. If `autoClose` is false, - * then the file descriptor won't be closed, even if there's an error. - * It is the application's responsibility to close it and make sure there's no - * file descriptor leak. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed. Set the `emitClose` option to `false` to change this behavior. - * @since v16.11.0 - */ - createWriteStream(options?: CreateWriteStreamOptions): WriteStream; - /** - * Forces all currently queued I/O operations associated with the file to the - * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. - * - * Unlike `filehandle.sync` this method does not flush modified metadata. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - datasync(): Promise; - /** - * Request that all data for the open file descriptor is flushed to the storage - * device. The specific implementation is operating system and device specific. - * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - sync(): Promise; - /** - * Reads data from the file and stores that in the given buffer. - * - * If the file is not modified concurrently, the end-of-file is reached when the - * number of bytes read is zero. - * @since v10.0.0 - * @param buffer A buffer that will be filled with the file data read. - * @param offset The location in the buffer at which to start filling. - * @param length The number of bytes to read. - * @param position The location where to begin reading data from the file. If `null`, data will be read from the current file position, and the position will be updated. If `position` is an - * integer, the current file position will remain unchanged. - * @return Fulfills upon success with an object with two properties: - */ - read( - buffer: T, - offset?: number | null, - length?: number | null, - position?: number | null, - ): Promise>; - read(options?: FileReadOptions): Promise>; - /** - * Returns a `ReadableStream` that may be used to read the files data. - * - * An error will be thrown if this method is called more than once or is called - * after the `FileHandle` is closed or closing. - * - * ```js - * import { - * open, - * } from 'node:fs/promises'; - * - * const file = await open('./some/file/to/read'); - * - * for await (const chunk of file.readableWebStream()) - * console.log(chunk); - * - * await file.close(); - * ``` - * - * While the `ReadableStream` will read the file to completion, it will not - * close the `FileHandle` automatically. User code must still call the`fileHandle.close()` method. - * @since v17.0.0 - * @experimental - */ - readableWebStream(options?: ReadableWebStreamOptions): ReadableStream; - /** - * Asynchronously reads the entire contents of a file. - * - * If `options` is a string, then it specifies the `encoding`. - * - * The `FileHandle` has to support reading. - * - * If one or more `filehandle.read()` calls are made on a file handle and then a `filehandle.readFile()` call is made, the data will be read from the current - * position till the end of the file. It doesn't always read from the beginning - * of the file. - * @since v10.0.0 - * @return Fulfills upon a successful read with the contents of the file. If no encoding is specified (using `options.encoding`), the data is returned as a {Buffer} object. Otherwise, the - * data will be a string. - */ - readFile( - options?: { - encoding?: null | undefined; - flag?: OpenMode | undefined; - } | null, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. - * The `FileHandle` must have been opened for reading. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - readFile( - options: - | { - encoding: BufferEncoding; - flag?: OpenMode | undefined; - } - | BufferEncoding, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. - * The `FileHandle` must have been opened for reading. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - readFile( - options?: - | (ObjectEncodingOptions & { - flag?: OpenMode | undefined; - }) - | BufferEncoding - | null, - ): Promise; - /** - * Convenience method to create a `readline` interface and stream over the file. - * See `filehandle.createReadStream()` for the options. - * - * ```js - * import { open } from 'node:fs/promises'; - * - * const file = await open('./some/file/to/read'); - * - * for await (const line of file.readLines()) { - * console.log(line); - * } - * ``` - * @since v18.11.0 - */ - readLines(options?: CreateReadStreamOptions): ReadlineInterface; - /** - * @since v10.0.0 - * @return Fulfills with an {fs.Stats} for the file. - */ - stat( - opts?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - stat( - opts: StatOptions & { - bigint: true; - }, - ): Promise; - stat(opts?: StatOptions): Promise; - /** - * Truncates the file. - * - * If the file was larger than `len` bytes, only the first `len` bytes will be - * retained in the file. - * - * The following example retains only the first four bytes of the file: - * - * ```js - * import { open } from 'node:fs/promises'; - * - * let filehandle = null; - * try { - * filehandle = await open('temp.txt', 'r+'); - * await filehandle.truncate(4); - * } finally { - * await filehandle?.close(); - * } - * ``` - * - * If the file previously was shorter than `len` bytes, it is extended, and the - * extended part is filled with null bytes (`'\0'`): - * - * If `len` is negative then `0` will be used. - * @since v10.0.0 - * @param [len=0] - * @return Fulfills with `undefined` upon success. - */ - truncate(len?: number): Promise; - /** - * Change the file system timestamps of the object referenced by the `FileHandle` then fulfills the promise with no arguments upon success. - * @since v10.0.0 - */ - utimes(atime: TimeLike, mtime: TimeLike): Promise; - /** - * Asynchronously writes data to a file, replacing the file if it already exists. `data` can be a string, a buffer, an - * [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface), or an - * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object. - * The promise is fulfilled with no arguments upon success. - * - * If `options` is a string, then it specifies the `encoding`. - * - * The `FileHandle` has to support writing. - * - * It is unsafe to use `filehandle.writeFile()` multiple times on the same file - * without waiting for the promise to be fulfilled (or rejected). - * - * If one or more `filehandle.write()` calls are made on a file handle and then a`filehandle.writeFile()` call is made, the data will be written from the - * current position till the end of the file. It doesn't always write from the - * beginning of the file. - * @since v10.0.0 - */ - writeFile( - data: string | Uint8Array, - options?: - | (ObjectEncodingOptions & FlagAndOpenMode & Abortable & { flush?: boolean | undefined }) - | BufferEncoding - | null, - ): Promise; - /** - * Write `buffer` to the file. - * - * The promise is fulfilled with an object containing two properties: - * - * It is unsafe to use `filehandle.write()` multiple times on the same file - * without waiting for the promise to be fulfilled (or rejected). For this - * scenario, use `filehandle.createWriteStream()`. - * - * On Linux, positional writes do not work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v10.0.0 - * @param offset The start position from within `buffer` where the data to write begins. - * @param [length=buffer.byteLength - offset] The number of bytes from `buffer` to write. - * @param [position='null'] The offset from the beginning of the file where the data from `buffer` should be written. If `position` is not a `number`, the data will be written at the current - * position. See the POSIX pwrite(2) documentation for more detail. - */ - write( - buffer: TBuffer, - offset?: number | null, - length?: number | null, - position?: number | null, - ): Promise<{ - bytesWritten: number; - buffer: TBuffer; - }>; - write( - data: string, - position?: number | null, - encoding?: BufferEncoding | null, - ): Promise<{ - bytesWritten: number; - buffer: string; - }>; - /** - * Write an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s to the file. - * - * The promise is fulfilled with an object containing a two properties: - * - * It is unsafe to call `writev()` multiple times on the same file without waiting - * for the promise to be fulfilled (or rejected). - * - * On Linux, positional writes don't work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v12.9.0 - * @param [position='null'] The offset from the beginning of the file where the data from `buffers` should be written. If `position` is not a `number`, the data will be written at the current - * position. - */ - writev(buffers: readonly NodeJS.ArrayBufferView[], position?: number): Promise; - /** - * Read from a file and write to an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s - * @since v13.13.0, v12.17.0 - * @param [position='null'] The offset from the beginning of the file where the data should be read from. If `position` is not a `number`, the data will be read from the current position. - * @return Fulfills upon success an object containing two properties: - */ - readv(buffers: readonly NodeJS.ArrayBufferView[], position?: number): Promise; - /** - * Closes the file handle after waiting for any pending operation on the handle to - * complete. - * - * ```js - * import { open } from 'node:fs/promises'; - * - * let filehandle; - * try { - * filehandle = await open('thefile.txt', 'r'); - * } finally { - * await filehandle?.close(); - * } - * ``` - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - close(): Promise; - /** - * An alias for {@link FileHandle.close()}. - * @since v20.4.0 - */ - [Symbol.asyncDispose](): Promise; - } - const constants: typeof fsConstants; - /** - * Tests a user's permissions for the file or directory specified by `path`. - * The `mode` argument is an optional integer that specifies the accessibility - * checks to be performed. `mode` should be either the value `fs.constants.F_OK` or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`, `fs.constants.W_OK`, and `fs.constants.X_OK` - * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for - * possible values of `mode`. - * - * If the accessibility check is successful, the promise is fulfilled with no - * value. If any of the accessibility checks fail, the promise is rejected - * with an [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object. The following example checks if the file`/etc/passwd` can be read and - * written by the current process. - * - * ```js - * import { access, constants } from 'node:fs/promises'; - * - * try { - * await access('/etc/passwd', constants.R_OK | constants.W_OK); - * console.log('can access'); - * } catch { - * console.error('cannot access'); - * } - * ``` - * - * Using `fsPromises.access()` to check for the accessibility of a file before - * calling `fsPromises.open()` is not recommended. Doing so introduces a race - * condition, since other processes may change the file's state between the two - * calls. Instead, user code should open/read/write the file directly and handle - * the error raised if the file is not accessible. - * @since v10.0.0 - * @param [mode=fs.constants.F_OK] - * @return Fulfills with `undefined` upon success. - */ - function access(path: PathLike, mode?: number): Promise; - /** - * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it - * already exists. - * - * No guarantees are made about the atomicity of the copy operation. If an - * error occurs after the destination file has been opened for writing, an attempt - * will be made to remove the destination. - * - * ```js - * import { copyFile, constants } from 'node:fs/promises'; - * - * try { - * await copyFile('source.txt', 'destination.txt'); - * console.log('source.txt was copied to destination.txt'); - * } catch { - * console.error('The file could not be copied'); - * } - * - * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. - * try { - * await copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL); - * console.log('source.txt was copied to destination.txt'); - * } catch { - * console.error('The file could not be copied'); - * } - * ``` - * @since v10.0.0 - * @param src source filename to copy - * @param dest destination filename of the copy operation - * @param [mode=0] Optional modifiers that specify the behavior of the copy operation. It is possible to create a mask consisting of the bitwise OR of two or more values (e.g. - * `fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`) - * @return Fulfills with `undefined` upon success. - */ - function copyFile(src: PathLike, dest: PathLike, mode?: number): Promise; - /** - * Opens a `FileHandle`. - * - * Refer to the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more detail. - * - * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented - * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains - * a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams). - * @since v10.0.0 - * @param [flags='r'] See `support of file system `flags``. - * @param [mode=0o666] Sets the file mode (permission and sticky bits) if the file is created. - * @return Fulfills with a {FileHandle} object. - */ - function open(path: PathLike, flags?: string | number, mode?: Mode): Promise; - /** - * Renames `oldPath` to `newPath`. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function rename(oldPath: PathLike, newPath: PathLike): Promise; - /** - * Truncates (shortens or extends the length) of the content at `path` to `len` bytes. - * @since v10.0.0 - * @param [len=0] - * @return Fulfills with `undefined` upon success. - */ - function truncate(path: PathLike, len?: number): Promise; - /** - * Removes the directory identified by `path`. - * - * Using `fsPromises.rmdir()` on a file (not a directory) results in the - * promise being rejected with an `ENOENT` error on Windows and an `ENOTDIR` error on POSIX. - * - * To get a behavior similar to the `rm -rf` Unix command, use `fsPromises.rm()` with options `{ recursive: true, force: true }`. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function rmdir(path: PathLike, options?: RmDirOptions): Promise; - /** - * Removes files and directories (modeled on the standard POSIX `rm` utility). - * @since v14.14.0 - * @return Fulfills with `undefined` upon success. - */ - function rm(path: PathLike, options?: RmOptions): Promise; - /** - * Asynchronously creates a directory. - * - * The optional `options` argument can be an integer specifying `mode` (permission - * and sticky bits), or an object with a `mode` property and a `recursive` property indicating whether parent directories should be created. Calling `fsPromises.mkdir()` when `path` is a directory - * that exists results in a - * rejection only when `recursive` is false. - * - * ```js - * import { mkdir } from 'node:fs/promises'; - * - * try { - * const projectFolder = new URL('./test/project/', import.meta.url); - * const createDir = await mkdir(projectFolder, { recursive: true }); - * - * console.log(`created ${createDir}`); - * } catch (err) { - * console.error(err.message); - * } - * ``` - * @since v10.0.0 - * @return Upon success, fulfills with `undefined` if `recursive` is `false`, or the first directory path created if `recursive` is `true`. - */ - function mkdir( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - }, - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function mkdir( - path: PathLike, - options?: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null, - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function mkdir(path: PathLike, options?: Mode | MakeDirectoryOptions | null): Promise; - /** - * Reads the contents of a directory. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the filenames. If the `encoding` is set to `'buffer'`, the filenames returned - * will be passed as `Buffer` objects. - * - * If `options.withFileTypes` is set to `true`, the returned array will contain `fs.Dirent` objects. - * - * ```js - * import { readdir } from 'node:fs/promises'; - * - * try { - * const files = await readdir(path); - * for (const file of files) - * console.log(file); - * } catch (err) { - * console.error(err); - * } - * ``` - * @since v10.0.0 - * @return Fulfills with an array of the names of the files in the directory excluding `'.'` and `'..'`. - */ - function readdir( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }) - | BufferEncoding - | null, - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readdir( - path: PathLike, - options: - | { - encoding: "buffer"; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | "buffer", - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readdir( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }) - | BufferEncoding - | null, - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. - */ - function readdir( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - recursive?: boolean | undefined; - }, - ): Promise; - /** - * Reads the contents of the symbolic link referred to by `path`. See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more detail. The promise is - * fulfilled with the`linkString` upon success. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the link path returned. If the `encoding` is set to `'buffer'`, the link path - * returned will be passed as a `Buffer` object. - * @since v10.0.0 - * @return Fulfills with the `linkString` upon success. - */ - function readlink(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readlink(path: PathLike, options: BufferEncodingOption): Promise; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readlink(path: PathLike, options?: ObjectEncodingOptions | string | null): Promise; - /** - * Creates a symbolic link. - * - * The `type` argument is only used on Windows platforms and can be one of `'dir'`, `'file'`, or `'junction'`. If the `type` argument is not a string, Node.js will - * autodetect `target` type and use `'file'` or `'dir'`. If the `target` does not - * exist, `'file'` will be used. Windows junction points require the destination - * path to be absolute. When using `'junction'`, the `target` argument will - * automatically be normalized to absolute path. Junction points on NTFS volumes - * can only point to directories. - * @since v10.0.0 - * @param [type='null'] - * @return Fulfills with `undefined` upon success. - */ - function symlink(target: PathLike, path: PathLike, type?: string | null): Promise; - /** - * Equivalent to `fsPromises.stat()` unless `path` refers to a symbolic link, - * in which case the link itself is stat-ed, not the file that it refers to. - * Refer to the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) document for more detail. - * @since v10.0.0 - * @return Fulfills with the {fs.Stats} object for the given symbolic link `path`. - */ - function lstat( - path: PathLike, - opts?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - function lstat( - path: PathLike, - opts: StatOptions & { - bigint: true; - }, - ): Promise; - function lstat(path: PathLike, opts?: StatOptions): Promise; - /** - * @since v10.0.0 - * @return Fulfills with the {fs.Stats} object for the given `path`. - */ - function stat( - path: PathLike, - opts?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - function stat( - path: PathLike, - opts: StatOptions & { - bigint: true; - }, - ): Promise; - function stat(path: PathLike, opts?: StatOptions): Promise; - /** - * @since v19.6.0, v18.15.0 - * @return Fulfills with the {fs.StatFs} object for the given `path`. - */ - function statfs( - path: PathLike, - opts?: StatFsOptions & { - bigint?: false | undefined; - }, - ): Promise; - function statfs( - path: PathLike, - opts: StatFsOptions & { - bigint: true; - }, - ): Promise; - function statfs(path: PathLike, opts?: StatFsOptions): Promise; - /** - * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function link(existingPath: PathLike, newPath: PathLike): Promise; - /** - * If `path` refers to a symbolic link, then the link is removed without affecting - * the file or directory to which that link refers. If the `path` refers to a file - * path that is not a symbolic link, the file is deleted. See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more detail. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function unlink(path: PathLike): Promise; - /** - * Changes the permissions of a file. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function chmod(path: PathLike, mode: Mode): Promise; - /** - * Changes the permissions on a symbolic link. - * - * This method is only implemented on macOS. - * @deprecated Since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function lchmod(path: PathLike, mode: Mode): Promise; - /** - * Changes the ownership on a symbolic link. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function lchown(path: PathLike, uid: number, gid: number): Promise; - /** - * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, with the difference that if the path refers to a - * symbolic link, then the link is not dereferenced: instead, the timestamps of - * the symbolic link itself are changed. - * @since v14.5.0, v12.19.0 - * @return Fulfills with `undefined` upon success. - */ - function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; - /** - * Changes the ownership of a file. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function chown(path: PathLike, uid: number, gid: number): Promise; - /** - * Change the file system timestamps of the object referenced by `path`. - * - * The `atime` and `mtime` arguments follow these rules: - * - * * Values can be either numbers representing Unix epoch time, `Date`s, or a - * numeric string like `'123456789.0'`. - * * If the value can not be converted to a number, or is `NaN`, `Infinity`, or `-Infinity`, an `Error` will be thrown. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; - /** - * Determines the actual location of `path` using the same semantics as the `fs.realpath.native()` function. - * - * Only paths that can be converted to UTF8 strings are supported. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the path. If the `encoding` is set to `'buffer'`, the path returned will be - * passed as a `Buffer` object. - * - * On Linux, when Node.js is linked against musl libc, the procfs file system must - * be mounted on `/proc` in order for this function to work. Glibc does not have - * this restriction. - * @since v10.0.0 - * @return Fulfills with the resolved path upon success. - */ - function realpath(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function realpath(path: PathLike, options: BufferEncodingOption): Promise; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function realpath( - path: PathLike, - options?: ObjectEncodingOptions | BufferEncoding | null, - ): Promise; - /** - * Creates a unique temporary directory. A unique directory name is generated by - * appending six random characters to the end of the provided `prefix`. Due to - * platform inconsistencies, avoid trailing `X` characters in `prefix`. Some - * platforms, notably the BSDs, can return more than six random characters, and - * replace trailing `X` characters in `prefix` with random characters. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use. - * - * ```js - * import { mkdtemp } from 'node:fs/promises'; - * import { join } from 'node:path'; - * import { tmpdir } from 'node:os'; - * - * try { - * await mkdtemp(join(tmpdir(), 'foo-')); - * } catch (err) { - * console.error(err); - * } - * ``` - * - * The `fsPromises.mkdtemp()` method will append the six randomly selected - * characters directly to the `prefix` string. For instance, given a directory `/tmp`, if the intention is to create a temporary directory _within_ `/tmp`, the `prefix` must end with a trailing - * platform-specific path separator - * (`import { sep } from 'node:path'`). - * @since v10.0.0 - * @return Fulfills with a string containing the file system path of the newly created temporary directory. - */ - function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function mkdtemp(prefix: string, options: BufferEncodingOption): Promise; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Asynchronously writes data to a file, replacing the file if it already exists. `data` can be a string, a buffer, an - * [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface), or an - * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object. - * - * The `encoding` option is ignored if `data` is a buffer. - * - * If `options` is a string, then it specifies the encoding. - * - * The `mode` option only affects the newly created file. See `fs.open()` for more details. - * - * Any specified `FileHandle` has to support writing. - * - * It is unsafe to use `fsPromises.writeFile()` multiple times on the same file - * without waiting for the promise to be settled. - * - * Similarly to `fsPromises.readFile` \- `fsPromises.writeFile` is a convenience - * method that performs multiple `write` calls internally to write the buffer - * passed to it. For performance sensitive code consider using `fs.createWriteStream()` or `filehandle.createWriteStream()`. - * - * It is possible to use an `AbortSignal` to cancel an `fsPromises.writeFile()`. - * Cancelation is "best effort", and some amount of data is likely still - * to be written. - * - * ```js - * import { writeFile } from 'node:fs/promises'; - * import { Buffer } from 'node:buffer'; - * - * try { - * const controller = new AbortController(); - * const { signal } = controller; - * const data = new Uint8Array(Buffer.from('Hello Node.js')); - * const promise = writeFile('message.txt', data, { signal }); - * - * // Abort the request before the promise settles. - * controller.abort(); - * - * await promise; - * } catch (err) { - * // When a request is aborted - err is an AbortError - * console.error(err); - * } - * ``` - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.writeFile` performs. - * @since v10.0.0 - * @param file filename or `FileHandle` - * @return Fulfills with `undefined` upon success. - */ - function writeFile( - file: PathLike | FileHandle, - data: - | string - | NodeJS.ArrayBufferView - | Iterable - | AsyncIterable - | Stream, - options?: - | (ObjectEncodingOptions & { - mode?: Mode | undefined; - flag?: OpenMode | undefined; - /** - * If all data is successfully written to the file, and `flush` - * is `true`, `filehandle.sync()` is used to flush the data. - * @default false - */ - flush?: boolean | undefined; - } & Abortable) - | BufferEncoding - | null, - ): Promise; - /** - * Asynchronously append data to a file, creating the file if it does not yet - * exist. `data` can be a string or a `Buffer`. - * - * If `options` is a string, then it specifies the `encoding`. - * - * The `mode` option only affects the newly created file. See `fs.open()` for more details. - * - * The `path` may be specified as a `FileHandle` that has been opened - * for appending (using `fsPromises.open()`). - * @since v10.0.0 - * @param path filename or {FileHandle} - * @return Fulfills with `undefined` upon success. - */ - function appendFile( - path: PathLike | FileHandle, - data: string | Uint8Array, - options?: (ObjectEncodingOptions & FlagAndOpenMode & { flush?: boolean | undefined }) | BufferEncoding | null, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * - * If no encoding is specified (using `options.encoding`), the data is returned - * as a `Buffer` object. Otherwise, the data will be a string. - * - * If `options` is a string, then it specifies the encoding. - * - * When the `path` is a directory, the behavior of `fsPromises.readFile()` is - * platform-specific. On macOS, Linux, and Windows, the promise will be rejected - * with an error. On FreeBSD, a representation of the directory's contents will be - * returned. - * - * An example of reading a `package.json` file located in the same directory of the - * running code: - * - * ```js - * import { readFile } from 'node:fs/promises'; - * try { - * const filePath = new URL('./package.json', import.meta.url); - * const contents = await readFile(filePath, { encoding: 'utf8' }); - * console.log(contents); - * } catch (err) { - * console.error(err.message); - * } - * ``` - * - * It is possible to abort an ongoing `readFile` using an `AbortSignal`. If a - * request is aborted the promise returned is rejected with an `AbortError`: - * - * ```js - * import { readFile } from 'node:fs/promises'; - * - * try { - * const controller = new AbortController(); - * const { signal } = controller; - * const promise = readFile(fileName, { signal }); - * - * // Abort the request before the promise settles. - * controller.abort(); - * - * await promise; - * } catch (err) { - * // When a request is aborted - err is an AbortError - * console.error(err); - * } - * ``` - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.readFile` performs. - * - * Any specified `FileHandle` has to support reading. - * @since v10.0.0 - * @param path filename or `FileHandle` - * @return Fulfills with the contents of the file. - */ - function readFile( - path: PathLike | FileHandle, - options?: - | ({ - encoding?: null | undefined; - flag?: OpenMode | undefined; - } & Abortable) - | null, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function readFile( - path: PathLike | FileHandle, - options: - | ({ - encoding: BufferEncoding; - flag?: OpenMode | undefined; - } & Abortable) - | BufferEncoding, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function readFile( - path: PathLike | FileHandle, - options?: - | ( - & ObjectEncodingOptions - & Abortable - & { - flag?: OpenMode | undefined; - } - ) - | BufferEncoding - | null, - ): Promise; - /** - * Asynchronously open a directory for iterative scanning. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for more detail. - * - * Creates an `fs.Dir`, which contains all further functions for reading from - * and cleaning up the directory. - * - * The `encoding` option sets the encoding for the `path` while opening the - * directory and subsequent read operations. - * - * Example using async iteration: - * - * ```js - * import { opendir } from 'node:fs/promises'; - * - * try { - * const dir = await opendir('./'); - * for await (const dirent of dir) - * console.log(dirent.name); - * } catch (err) { - * console.error(err); - * } - * ``` - * - * When using the async iterator, the `fs.Dir` object will be automatically - * closed after the iterator exits. - * @since v12.12.0 - * @return Fulfills with an {fs.Dir}. - */ - function opendir(path: PathLike, options?: OpenDirOptions): Promise; - /** - * Returns an async iterator that watches for changes on `filename`, where `filename`is either a file or a directory. - * - * ```js - * import { watch } from 'node:fs/promises'; - * - * const ac = new AbortController(); - * const { signal } = ac; - * setTimeout(() => ac.abort(), 10000); - * - * (async () => { - * try { - * const watcher = watch(__filename, { signal }); - * for await (const event of watcher) - * console.log(event); - * } catch (err) { - * if (err.name === 'AbortError') - * return; - * throw err; - * } - * })(); - * ``` - * - * On most platforms, `'rename'` is emitted whenever a filename appears or - * disappears in the directory. - * - * All the `caveats` for `fs.watch()` also apply to `fsPromises.watch()`. - * @since v15.9.0, v14.18.0 - * @return of objects with the properties: - */ - function watch( - filename: PathLike, - options: - | (WatchOptions & { - encoding: "buffer"; - }) - | "buffer", - ): AsyncIterable>; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `persistent` is not supplied, the default of `true` is used. - * If `recursive` is not supplied, the default of `false` is used. - */ - function watch(filename: PathLike, options?: WatchOptions | BufferEncoding): AsyncIterable>; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `persistent` is not supplied, the default of `true` is used. - * If `recursive` is not supplied, the default of `false` is used. - */ - function watch( - filename: PathLike, - options: WatchOptions | string, - ): AsyncIterable> | AsyncIterable>; - /** - * Asynchronously copies the entire directory structure from `src` to `dest`, - * including subdirectories and files. - * - * When copying a directory to another directory, globs are not supported and - * behavior is similar to `cp dir1/ dir2/`. - * @since v16.7.0 - * @experimental - * @param src source path to copy. - * @param dest destination path to copy to. - * @return Fulfills with `undefined` upon success. - */ - function cp(source: string | URL, destination: string | URL, opts?: CopyOptions): Promise; - /** - * Retrieves the files matching the specified pattern. - */ - function glob(pattern: string | string[]): AsyncIterableIterator; - function glob( - pattern: string | string[], - opt: GlobOptionsWithFileTypes, - ): AsyncIterableIterator; - function glob( - pattern: string | string[], - opt: GlobOptionsWithoutFileTypes, - ): AsyncIterableIterator; - function glob( - pattern: string | string[], - opt: GlobOptions, - ): AsyncIterableIterator | AsyncIterableIterator; -} -declare module "node:fs/promises" { - export * from "fs/promises"; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/globals.d.ts b/tools/mnemonic-test/node_modules/@types/node/globals.d.ts deleted file mode 100644 index 0899392d..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/globals.d.ts +++ /dev/null @@ -1,597 +0,0 @@ -export {}; // Make this a module - -// #region Fetch and friends -// Conditional type aliases, used at the end of this file. -// Will either be empty if lib.dom (or lib.webworker) is included, or the undici version otherwise. -type _Request = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Request; -type _Response = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Response; -type _FormData = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").FormData; -type _Headers = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Headers; -type _MessageEvent = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").MessageEvent; -type _RequestInit = typeof globalThis extends { onmessage: any } ? {} - : import("undici-types").RequestInit; -type _ResponseInit = typeof globalThis extends { onmessage: any } ? {} - : import("undici-types").ResponseInit; -type _WebSocket = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").WebSocket; -type _EventSource = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").EventSource; -// #endregion Fetch and friends - -// Conditional type definitions for webstorage interface, which conflicts with lib.dom otherwise. -type _Storage = typeof globalThis extends { onabort: any } ? {} : { - /** - * Returns the number of key/value pairs. - * - * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/length) - */ - readonly length: number; - /** - * Removes all key/value pairs, if there are any. - * - * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/clear) - */ - clear(): void; - /** - * Returns the current value associated with the given key, or null if the given key does not exist. - * - * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/getItem) - */ - getItem(key: string): string | null; - /** - * Returns the name of the nth key, or null if n is greater than or equal to the number of key/value pairs. - * - * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/key) - */ - key(index: number): string | null; - /** - * Removes the key/value pair with the given key, if a key/value pair with the given key exists. - * - * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/removeItem) - */ - removeItem(key: string): void; - /** - * Sets the value of the pair identified by key to value, creating a new key/value pair if none existed for key previously. - * - * Throws a "QuotaExceededError" DOMException exception if the new value couldn't be set. - * - * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/setItem) - */ - setItem(key: string, value: string): void; - [key: string]: any; -}; - -// #region DOMException -type _DOMException = typeof globalThis extends { onmessage: any } ? {} : NodeDOMException; -interface NodeDOMException extends Error { - /** - * @deprecated - * - * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code) - */ - readonly code: number; - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message) */ - readonly message: string; - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name) */ - readonly name: string; - readonly INDEX_SIZE_ERR: 1; - readonly DOMSTRING_SIZE_ERR: 2; - readonly HIERARCHY_REQUEST_ERR: 3; - readonly WRONG_DOCUMENT_ERR: 4; - readonly INVALID_CHARACTER_ERR: 5; - readonly NO_DATA_ALLOWED_ERR: 6; - readonly NO_MODIFICATION_ALLOWED_ERR: 7; - readonly NOT_FOUND_ERR: 8; - readonly NOT_SUPPORTED_ERR: 9; - readonly INUSE_ATTRIBUTE_ERR: 10; - readonly INVALID_STATE_ERR: 11; - readonly SYNTAX_ERR: 12; - readonly INVALID_MODIFICATION_ERR: 13; - readonly NAMESPACE_ERR: 14; - readonly INVALID_ACCESS_ERR: 15; - readonly VALIDATION_ERR: 16; - readonly TYPE_MISMATCH_ERR: 17; - readonly SECURITY_ERR: 18; - readonly NETWORK_ERR: 19; - readonly ABORT_ERR: 20; - readonly URL_MISMATCH_ERR: 21; - readonly QUOTA_EXCEEDED_ERR: 22; - readonly TIMEOUT_ERR: 23; - readonly INVALID_NODE_TYPE_ERR: 24; - readonly DATA_CLONE_ERR: 25; -} -interface NodeDOMExceptionConstructor { - prototype: DOMException; - new(message?: string, nameOrOptions?: string | { name?: string; cause?: unknown }): DOMException; - readonly INDEX_SIZE_ERR: 1; - readonly DOMSTRING_SIZE_ERR: 2; - readonly HIERARCHY_REQUEST_ERR: 3; - readonly WRONG_DOCUMENT_ERR: 4; - readonly INVALID_CHARACTER_ERR: 5; - readonly NO_DATA_ALLOWED_ERR: 6; - readonly NO_MODIFICATION_ALLOWED_ERR: 7; - readonly NOT_FOUND_ERR: 8; - readonly NOT_SUPPORTED_ERR: 9; - readonly INUSE_ATTRIBUTE_ERR: 10; - readonly INVALID_STATE_ERR: 11; - readonly SYNTAX_ERR: 12; - readonly INVALID_MODIFICATION_ERR: 13; - readonly NAMESPACE_ERR: 14; - readonly INVALID_ACCESS_ERR: 15; - readonly VALIDATION_ERR: 16; - readonly TYPE_MISMATCH_ERR: 17; - readonly SECURITY_ERR: 18; - readonly NETWORK_ERR: 19; - readonly ABORT_ERR: 20; - readonly URL_MISMATCH_ERR: 21; - readonly QUOTA_EXCEEDED_ERR: 22; - readonly TIMEOUT_ERR: 23; - readonly INVALID_NODE_TYPE_ERR: 24; - readonly DATA_CLONE_ERR: 25; -} -// #endregion DOMException - -declare global { - // Declare "static" methods in Error - interface ErrorConstructor { - /** Create .stack property on a target object */ - captureStackTrace(targetObject: object, constructorOpt?: Function): void; - - /** - * Optional override for formatting stack traces - * - * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces - */ - prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined; - - stackTraceLimit: number; - } - - /*-----------------------------------------------* - * * - * GLOBAL * - * * - ------------------------------------------------*/ - - // For backwards compability - interface NodeRequire extends NodeJS.Require {} - interface RequireResolve extends NodeJS.RequireResolve {} - interface NodeModule extends NodeJS.Module {} - - var process: NodeJS.Process; - var console: Console; - - var __filename: string; - var __dirname: string; - - var require: NodeRequire; - var module: NodeModule; - - // Same as module.exports - var exports: any; - - interface GCFunction { - (options: { - execution?: "sync"; - flavor?: "regular" | "last-resort"; - type?: "major-snapshot" | "major" | "minor"; - filename?: string; - }): void; - (options: { - execution: "async"; - flavor?: "regular" | "last-resort"; - type?: "major-snapshot" | "major" | "minor"; - filename?: string; - }): Promise; - (options?: boolean): void; - } - - /** - * Only available if `--expose-gc` is passed to the process. - */ - var gc: undefined | GCFunction; - - // #region borrowed - // from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib - /** A controller object that allows you to abort one or more DOM requests as and when desired. */ - interface AbortController { - /** - * Returns the AbortSignal object associated with this object. - */ - - readonly signal: AbortSignal; - /** - * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted. - */ - abort(reason?: any): void; - } - - /** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */ - interface AbortSignal extends EventTarget { - /** - * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. - */ - readonly aborted: boolean; - readonly reason: any; - onabort: null | ((this: AbortSignal, event: Event) => any); - throwIfAborted(): void; - } - - var AbortController: typeof globalThis extends { onmessage: any; AbortController: infer T } ? T - : { - prototype: AbortController; - new(): AbortController; - }; - - var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T - : { - prototype: AbortSignal; - new(): AbortSignal; - abort(reason?: any): AbortSignal; - timeout(milliseconds: number): AbortSignal; - any(signals: AbortSignal[]): AbortSignal; - }; - // #endregion borrowed - - // #region Storage - /** - * This Web Storage API interface provides access to a particular domain's session or local storage. It allows, for example, the addition, modification, or deletion of stored data items. - * - * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage) - */ - interface Storage extends _Storage {} - - // Conditional on `onabort` rather than `onmessage`, in order to exclude lib.webworker - var Storage: typeof globalThis extends { onabort: any; Storage: infer T } ? T - : { - prototype: Storage; - new(): Storage; - }; - - /** - * A browser-compatible implementation of [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage). - * Data is stored unencrypted in the file specified by the `--localstorage-file` CLI flag. - * Any modification of this data outside of the Web Storage API is not supported. - * Enable this API with the `--experimental-webstorage` CLI flag. - * @since v22.4.0 - */ - var localStorage: Storage; - - /** - * A browser-compatible implementation of [`sessionStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage). - * Data is stored in memory, with a storage quota of 10 MB. - * Any modification of this data outside of the Web Storage API is not supported. - * Enable this API with the `--experimental-webstorage` CLI flag. - * @since v22.4.0 - */ - var sessionStorage: Storage; - // #endregion Storage - - // #region Disposable - interface SymbolConstructor { - /** - * A method that is used to release resources held by an object. Called by the semantics of the `using` statement. - */ - readonly dispose: unique symbol; - - /** - * A method that is used to asynchronously release resources held by an object. Called by the semantics of the `await using` statement. - */ - readonly asyncDispose: unique symbol; - } - - interface Disposable { - [Symbol.dispose](): void; - } - - interface AsyncDisposable { - [Symbol.asyncDispose](): PromiseLike; - } - // #endregion Disposable - - // #region ArrayLike.at() - interface RelativeIndexable { - /** - * Takes an integer value and returns the item at that index, - * allowing for positive and negative integers. - * Negative integers count back from the last item in the array. - */ - at(index: number): T | undefined; - } - interface String extends RelativeIndexable {} - interface Array extends RelativeIndexable {} - interface ReadonlyArray extends RelativeIndexable {} - interface Int8Array extends RelativeIndexable {} - interface Uint8Array extends RelativeIndexable {} - interface Uint8ClampedArray extends RelativeIndexable {} - interface Int16Array extends RelativeIndexable {} - interface Uint16Array extends RelativeIndexable {} - interface Int32Array extends RelativeIndexable {} - interface Uint32Array extends RelativeIndexable {} - interface Float32Array extends RelativeIndexable {} - interface Float64Array extends RelativeIndexable {} - interface BigInt64Array extends RelativeIndexable {} - interface BigUint64Array extends RelativeIndexable {} - // #endregion ArrayLike.at() end - - /** - * @since v17.0.0 - * - * Creates a deep clone of an object. - */ - function structuredClone( - value: T, - transfer?: { transfer: ReadonlyArray }, - ): T; - - // #region DOMException - /** - * @since v17.0.0 - * An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API. - * - * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException) - */ - interface DOMException extends _DOMException {} - - /** - * @since v17.0.0 - * - * The WHATWG `DOMException` class. See [DOMException](https://developer.mozilla.org/docs/Web/API/DOMException) for more details. - */ - var DOMException: typeof globalThis extends { onmessage: any; DOMException: infer T } ? T - : NodeDOMExceptionConstructor; - // #endregion DOMException - - /*----------------------------------------------* - * * - * GLOBAL INTERFACES * - * * - *-----------------------------------------------*/ - namespace NodeJS { - interface CallSite { - /** - * Value of "this" - */ - getThis(): unknown; - - /** - * Type of "this" as a string. - * This is the name of the function stored in the constructor field of - * "this", if available. Otherwise the object's [[Class]] internal - * property. - */ - getTypeName(): string | null; - - /** - * Current function - */ - getFunction(): Function | undefined; - - /** - * Name of the current function, typically its name property. - * If a name property is not available an attempt will be made to try - * to infer a name from the function's context. - */ - getFunctionName(): string | null; - - /** - * Name of the property [of "this" or one of its prototypes] that holds - * the current function - */ - getMethodName(): string | null; - - /** - * Name of the script [if this function was defined in a script] - */ - getFileName(): string | undefined; - - /** - * Current line number [if this function was defined in a script] - */ - getLineNumber(): number | null; - - /** - * Current column number [if this function was defined in a script] - */ - getColumnNumber(): number | null; - - /** - * A call site object representing the location where eval was called - * [if this function was created using a call to eval] - */ - getEvalOrigin(): string | undefined; - - /** - * Is this a toplevel invocation, that is, is "this" the global object? - */ - isToplevel(): boolean; - - /** - * Does this call take place in code defined by a call to eval? - */ - isEval(): boolean; - - /** - * Is this call in native V8 code? - */ - isNative(): boolean; - - /** - * Is this a constructor call? - */ - isConstructor(): boolean; - - /** - * is this an async call (i.e. await, Promise.all(), or Promise.any())? - */ - isAsync(): boolean; - - /** - * is this an async call to Promise.all()? - */ - isPromiseAll(): boolean; - - /** - * returns the index of the promise element that was followed in - * Promise.all() or Promise.any() for async stack traces, or null - * if the CallSite is not an async - */ - getPromiseIndex(): number | null; - - getScriptNameOrSourceURL(): string; - getScriptHash(): string; - - getEnclosingColumnNumber(): number; - getEnclosingLineNumber(): number; - getPosition(): number; - - toString(): string; - } - - interface ErrnoException extends Error { - errno?: number | undefined; - code?: string | undefined; - path?: string | undefined; - syscall?: string | undefined; - } - - interface ReadableStream extends EventEmitter { - readable: boolean; - read(size?: number): string | Buffer; - setEncoding(encoding: BufferEncoding): this; - pause(): this; - resume(): this; - isPaused(): boolean; - pipe(destination: T, options?: { end?: boolean | undefined }): T; - unpipe(destination?: WritableStream): this; - unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void; - wrap(oldStream: ReadableStream): this; - [Symbol.asyncIterator](): AsyncIterableIterator; - } - - interface WritableStream extends EventEmitter { - writable: boolean; - write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean; - write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean; - end(cb?: () => void): this; - end(data: string | Uint8Array, cb?: () => void): this; - end(str: string, encoding?: BufferEncoding, cb?: () => void): this; - } - - interface ReadWriteStream extends ReadableStream, WritableStream {} - - interface RefCounted { - ref(): this; - unref(): this; - } - - interface Require { - (id: string): any; - resolve: RequireResolve; - cache: Dict; - /** - * @deprecated - */ - extensions: RequireExtensions; - main: Module | undefined; - } - - interface RequireResolve { - (id: string, options?: { paths?: string[] | undefined }): string; - paths(request: string): string[] | null; - } - - interface RequireExtensions extends Dict<(m: Module, filename: string) => any> { - ".js": (m: Module, filename: string) => any; - ".json": (m: Module, filename: string) => any; - ".node": (m: Module, filename: string) => any; - } - interface Module { - /** - * `true` if the module is running during the Node.js preload - */ - isPreloading: boolean; - exports: any; - require: Require; - id: string; - filename: string; - loaded: boolean; - /** @deprecated since v14.6.0 Please use `require.main` and `module.children` instead. */ - parent: Module | null | undefined; - children: Module[]; - /** - * @since v11.14.0 - * - * The directory name of the module. This is usually the same as the path.dirname() of the module.id. - */ - path: string; - paths: string[]; - } - - interface Dict { - [key: string]: T | undefined; - } - - interface ReadOnlyDict { - readonly [key: string]: T | undefined; - } - } - - interface RequestInit extends _RequestInit {} - - function fetch( - input: string | URL | globalThis.Request, - init?: RequestInit, - ): Promise; - - interface Request extends _Request {} - var Request: typeof globalThis extends { - onmessage: any; - Request: infer T; - } ? T - : typeof import("undici-types").Request; - - interface ResponseInit extends _ResponseInit {} - - interface Response extends _Response {} - var Response: typeof globalThis extends { - onmessage: any; - Response: infer T; - } ? T - : typeof import("undici-types").Response; - - interface FormData extends _FormData {} - var FormData: typeof globalThis extends { - onmessage: any; - FormData: infer T; - } ? T - : typeof import("undici-types").FormData; - - interface Headers extends _Headers {} - var Headers: typeof globalThis extends { - onmessage: any; - Headers: infer T; - } ? T - : typeof import("undici-types").Headers; - - interface MessageEvent extends _MessageEvent {} - /** - * @since v15.0.0 - */ - var MessageEvent: typeof globalThis extends { - onmessage: any; - MessageEvent: infer T; - } ? T - : typeof import("undici-types").MessageEvent; - - interface WebSocket extends _WebSocket {} - var WebSocket: typeof globalThis extends { onmessage: any; WebSocket: infer T } ? T - : typeof import("undici-types").WebSocket; - - interface EventSource extends _EventSource {} - /** - * Only available through the [--experimental-eventsource](https://nodejs.org/api/cli.html#--experimental-eventsource) flag. - * - * @since v22.3.0 - */ - var EventSource: typeof globalThis extends { onmessage: any; EventSource: infer T } ? T - : typeof import("undici-types").EventSource; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/globals.global.d.ts b/tools/mnemonic-test/node_modules/@types/node/globals.global.d.ts deleted file mode 100644 index ef1198c0..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/globals.global.d.ts +++ /dev/null @@ -1 +0,0 @@ -declare var global: typeof globalThis; diff --git a/tools/mnemonic-test/node_modules/@types/node/globals.typedarray.d.ts b/tools/mnemonic-test/node_modules/@types/node/globals.typedarray.d.ts deleted file mode 100644 index 0c7280c3..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/globals.typedarray.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -export {}; // Make this a module - -declare global { - namespace NodeJS { - type TypedArray = - | Uint8Array - | Uint8ClampedArray - | Uint16Array - | Uint32Array - | Int8Array - | Int16Array - | Int32Array - | BigUint64Array - | BigInt64Array - | Float32Array - | Float64Array; - type ArrayBufferView = - | TypedArray - | DataView; - } -} diff --git a/tools/mnemonic-test/node_modules/@types/node/http.d.ts b/tools/mnemonic-test/node_modules/@types/node/http.d.ts deleted file mode 100644 index e05e96a2..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/http.d.ts +++ /dev/null @@ -1,1921 +0,0 @@ -/** - * To use the HTTP server and client one must import the `node:http` module. - * - * The HTTP interfaces in Node.js are designed to support many features - * of the protocol which have been traditionally difficult to use. - * In particular, large, possibly chunk-encoded, messages. The interface is - * careful to never buffer entire requests or responses, so the - * user is able to stream data. - * - * HTTP message headers are represented by an object like this: - * - * ```json - * { "content-length": "123", - * "content-type": "text/plain", - * "connection": "keep-alive", - * "host": "example.com", - * "accept": "*" } - * ``` - * - * Keys are lowercased. Values are not modified. - * - * In order to support the full spectrum of possible HTTP applications, the Node.js - * HTTP API is very low-level. It deals with stream handling and message - * parsing only. It parses a message into headers and body but it does not - * parse the actual headers or the body. - * - * See `message.headers` for details on how duplicate headers are handled. - * - * The raw headers as they were received are retained in the `rawHeaders` property, which is an array of `[key, value, key2, value2, ...]`. For - * example, the previous message header object might have a `rawHeaders` list like the following: - * - * ```js - * [ 'ConTent-Length', '123456', - * 'content-LENGTH', '123', - * 'content-type', 'text/plain', - * 'CONNECTION', 'keep-alive', - * 'Host', 'example.com', - * 'accepT', '*' ] - * ``` - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/http.js) - */ -declare module "http" { - import * as stream from "node:stream"; - import { URL } from "node:url"; - import { LookupOptions } from "node:dns"; - import { EventEmitter } from "node:events"; - import { LookupFunction, Server as NetServer, Socket, TcpSocketConnectOpts } from "node:net"; - // incoming headers will never contain number - interface IncomingHttpHeaders extends NodeJS.Dict { - accept?: string | undefined; - "accept-language"?: string | undefined; - "accept-patch"?: string | undefined; - "accept-ranges"?: string | undefined; - "access-control-allow-credentials"?: string | undefined; - "access-control-allow-headers"?: string | undefined; - "access-control-allow-methods"?: string | undefined; - "access-control-allow-origin"?: string | undefined; - "access-control-expose-headers"?: string | undefined; - "access-control-max-age"?: string | undefined; - "access-control-request-headers"?: string | undefined; - "access-control-request-method"?: string | undefined; - age?: string | undefined; - allow?: string | undefined; - "alt-svc"?: string | undefined; - authorization?: string | undefined; - "cache-control"?: string | undefined; - connection?: string | undefined; - "content-disposition"?: string | undefined; - "content-encoding"?: string | undefined; - "content-language"?: string | undefined; - "content-length"?: string | undefined; - "content-location"?: string | undefined; - "content-range"?: string | undefined; - "content-type"?: string | undefined; - cookie?: string | undefined; - date?: string | undefined; - etag?: string | undefined; - expect?: string | undefined; - expires?: string | undefined; - forwarded?: string | undefined; - from?: string | undefined; - host?: string | undefined; - "if-match"?: string | undefined; - "if-modified-since"?: string | undefined; - "if-none-match"?: string | undefined; - "if-unmodified-since"?: string | undefined; - "last-modified"?: string | undefined; - location?: string | undefined; - origin?: string | undefined; - pragma?: string | undefined; - "proxy-authenticate"?: string | undefined; - "proxy-authorization"?: string | undefined; - "public-key-pins"?: string | undefined; - range?: string | undefined; - referer?: string | undefined; - "retry-after"?: string | undefined; - "sec-websocket-accept"?: string | undefined; - "sec-websocket-extensions"?: string | undefined; - "sec-websocket-key"?: string | undefined; - "sec-websocket-protocol"?: string | undefined; - "sec-websocket-version"?: string | undefined; - "set-cookie"?: string[] | undefined; - "strict-transport-security"?: string | undefined; - tk?: string | undefined; - trailer?: string | undefined; - "transfer-encoding"?: string | undefined; - upgrade?: string | undefined; - "user-agent"?: string | undefined; - vary?: string | undefined; - via?: string | undefined; - warning?: string | undefined; - "www-authenticate"?: string | undefined; - } - // outgoing headers allows numbers (as they are converted internally to strings) - type OutgoingHttpHeader = number | string | string[]; - interface OutgoingHttpHeaders extends NodeJS.Dict { - accept?: string | string[] | undefined; - "accept-charset"?: string | string[] | undefined; - "accept-encoding"?: string | string[] | undefined; - "accept-language"?: string | string[] | undefined; - "accept-ranges"?: string | undefined; - "access-control-allow-credentials"?: string | undefined; - "access-control-allow-headers"?: string | undefined; - "access-control-allow-methods"?: string | undefined; - "access-control-allow-origin"?: string | undefined; - "access-control-expose-headers"?: string | undefined; - "access-control-max-age"?: string | undefined; - "access-control-request-headers"?: string | undefined; - "access-control-request-method"?: string | undefined; - age?: string | undefined; - allow?: string | undefined; - authorization?: string | undefined; - "cache-control"?: string | undefined; - "cdn-cache-control"?: string | undefined; - connection?: string | string[] | undefined; - "content-disposition"?: string | undefined; - "content-encoding"?: string | undefined; - "content-language"?: string | undefined; - "content-length"?: string | number | undefined; - "content-location"?: string | undefined; - "content-range"?: string | undefined; - "content-security-policy"?: string | undefined; - "content-security-policy-report-only"?: string | undefined; - cookie?: string | string[] | undefined; - dav?: string | string[] | undefined; - dnt?: string | undefined; - date?: string | undefined; - etag?: string | undefined; - expect?: string | undefined; - expires?: string | undefined; - forwarded?: string | undefined; - from?: string | undefined; - host?: string | undefined; - "if-match"?: string | undefined; - "if-modified-since"?: string | undefined; - "if-none-match"?: string | undefined; - "if-range"?: string | undefined; - "if-unmodified-since"?: string | undefined; - "last-modified"?: string | undefined; - link?: string | string[] | undefined; - location?: string | undefined; - "max-forwards"?: string | undefined; - origin?: string | undefined; - prgama?: string | string[] | undefined; - "proxy-authenticate"?: string | string[] | undefined; - "proxy-authorization"?: string | undefined; - "public-key-pins"?: string | undefined; - "public-key-pins-report-only"?: string | undefined; - range?: string | undefined; - referer?: string | undefined; - "referrer-policy"?: string | undefined; - refresh?: string | undefined; - "retry-after"?: string | undefined; - "sec-websocket-accept"?: string | undefined; - "sec-websocket-extensions"?: string | string[] | undefined; - "sec-websocket-key"?: string | undefined; - "sec-websocket-protocol"?: string | string[] | undefined; - "sec-websocket-version"?: string | undefined; - server?: string | undefined; - "set-cookie"?: string | string[] | undefined; - "strict-transport-security"?: string | undefined; - te?: string | undefined; - trailer?: string | undefined; - "transfer-encoding"?: string | undefined; - "user-agent"?: string | undefined; - upgrade?: string | undefined; - "upgrade-insecure-requests"?: string | undefined; - vary?: string | undefined; - via?: string | string[] | undefined; - warning?: string | undefined; - "www-authenticate"?: string | string[] | undefined; - "x-content-type-options"?: string | undefined; - "x-dns-prefetch-control"?: string | undefined; - "x-frame-options"?: string | undefined; - "x-xss-protection"?: string | undefined; - } - interface ClientRequestArgs { - _defaultAgent?: Agent | undefined; - agent?: Agent | boolean | undefined; - auth?: string | null | undefined; - createConnection?: - | (( - options: ClientRequestArgs, - oncreate: (err: Error | null, socket: stream.Duplex) => void, - ) => stream.Duplex | null | undefined) - | undefined; - defaultPort?: number | string | undefined; - family?: number | undefined; - headers?: OutgoingHttpHeaders | undefined; - hints?: LookupOptions["hints"]; - host?: string | null | undefined; - hostname?: string | null | undefined; - insecureHTTPParser?: boolean | undefined; - localAddress?: string | undefined; - localPort?: number | undefined; - lookup?: LookupFunction | undefined; - /** - * @default 16384 - */ - maxHeaderSize?: number | undefined; - method?: string | undefined; - path?: string | null | undefined; - port?: number | string | null | undefined; - protocol?: string | null | undefined; - setHost?: boolean | undefined; - signal?: AbortSignal | undefined; - socketPath?: string | undefined; - timeout?: number | undefined; - uniqueHeaders?: Array | undefined; - joinDuplicateHeaders?: boolean; - } - interface ServerOptions< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse> = typeof ServerResponse, - > { - /** - * Specifies the `IncomingMessage` class to be used. Useful for extending the original `IncomingMessage`. - */ - IncomingMessage?: Request | undefined; - /** - * Specifies the `ServerResponse` class to be used. Useful for extending the original `ServerResponse`. - */ - ServerResponse?: Response | undefined; - /** - * Sets the timeout value in milliseconds for receiving the entire request from the client. - * @see Server.requestTimeout for more information. - * @default 300000 - * @since v18.0.0 - */ - requestTimeout?: number | undefined; - /** - * It joins the field line values of multiple headers in a request with `, ` instead of discarding the duplicates. - * @default false - * @since v18.14.0 - */ - joinDuplicateHeaders?: boolean; - /** - * The number of milliseconds of inactivity a server needs to wait for additional incoming data, - * after it has finished writing the last response, before a socket will be destroyed. - * @see Server.keepAliveTimeout for more information. - * @default 5000 - * @since v18.0.0 - */ - keepAliveTimeout?: number | undefined; - /** - * Sets the interval value in milliseconds to check for request and headers timeout in incomplete requests. - * @default 30000 - */ - connectionsCheckingInterval?: number | undefined; - /** - * Optionally overrides all `socket`s' `readableHighWaterMark` and `writableHighWaterMark`. - * This affects `highWaterMark` property of both `IncomingMessage` and `ServerResponse`. - * Default: @see stream.getDefaultHighWaterMark(). - * @since v20.1.0 - */ - highWaterMark?: number | undefined; - /** - * Use an insecure HTTP parser that accepts invalid HTTP headers when `true`. - * Using the insecure parser should be avoided. - * See --insecure-http-parser for more information. - * @default false - */ - insecureHTTPParser?: boolean | undefined; - /** - * Optionally overrides the value of `--max-http-header-size` for requests received by - * this server, i.e. the maximum length of request headers in bytes. - * @default 16384 - * @since v13.3.0 - */ - maxHeaderSize?: number | undefined; - /** - * If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received. - * @default true - * @since v16.5.0 - */ - noDelay?: boolean | undefined; - /** - * If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received, - * similarly on what is done in `socket.setKeepAlive([enable][, initialDelay])`. - * @default false - * @since v16.5.0 - */ - keepAlive?: boolean | undefined; - /** - * If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket. - * @default 0 - * @since v16.5.0 - */ - keepAliveInitialDelay?: number | undefined; - /** - * A list of response headers that should be sent only once. - * If the header's value is an array, the items will be joined using `; `. - */ - uniqueHeaders?: Array | undefined; - } - type RequestListener< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse> = typeof ServerResponse, - > = (req: InstanceType, res: InstanceType & { req: InstanceType }) => void; - /** - * @since v0.1.17 - */ - class Server< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse> = typeof ServerResponse, - > extends NetServer { - constructor(requestListener?: RequestListener); - constructor(options: ServerOptions, requestListener?: RequestListener); - /** - * Sets the timeout value for sockets, and emits a `'timeout'` event on - * the Server object, passing the socket as an argument, if a timeout - * occurs. - * - * If there is a `'timeout'` event listener on the Server object, then it - * will be called with the timed-out socket as an argument. - * - * By default, the Server does not timeout sockets. However, if a callback - * is assigned to the Server's `'timeout'` event, timeouts must be handled - * explicitly. - * @since v0.9.12 - * @param [msecs=0 (no timeout)] - */ - setTimeout(msecs?: number, callback?: () => void): this; - setTimeout(callback: () => void): this; - /** - * Limits maximum incoming headers count. If set to 0, no limit will be applied. - * @since v0.7.0 - */ - maxHeadersCount: number | null; - /** - * The maximum number of requests socket can handle - * before closing keep alive connection. - * - * A value of `0` will disable the limit. - * - * When the limit is reached it will set the `Connection` header value to `close`, - * but will not actually close the connection, subsequent requests sent - * after the limit is reached will get `503 Service Unavailable` as a response. - * @since v16.10.0 - */ - maxRequestsPerSocket: number | null; - /** - * The number of milliseconds of inactivity before a socket is presumed - * to have timed out. - * - * A value of `0` will disable the timeout behavior on incoming connections. - * - * The socket timeout logic is set up on connection, so changing this - * value only affects new connections to the server, not any existing connections. - * @since v0.9.12 - */ - timeout: number; - /** - * Limit the amount of time the parser will wait to receive the complete HTTP - * headers. - * - * If the timeout expires, the server responds with status 408 without - * forwarding the request to the request listener and then closes the connection. - * - * It must be set to a non-zero value (e.g. 120 seconds) to protect against - * potential Denial-of-Service attacks in case the server is deployed without a - * reverse proxy in front. - * @since v11.3.0, v10.14.0 - */ - headersTimeout: number; - /** - * The number of milliseconds of inactivity a server needs to wait for additional - * incoming data, after it has finished writing the last response, before a socket - * will be destroyed. If the server receives new data before the keep-alive - * timeout has fired, it will reset the regular inactivity timeout, i.e., `server.timeout`. - * - * A value of `0` will disable the keep-alive timeout behavior on incoming - * connections. - * A value of `0` makes the http server behave similarly to Node.js versions prior - * to 8.0.0, which did not have a keep-alive timeout. - * - * The socket timeout logic is set up on connection, so changing this value only - * affects new connections to the server, not any existing connections. - * @since v8.0.0 - */ - keepAliveTimeout: number; - /** - * Sets the timeout value in milliseconds for receiving the entire request from - * the client. - * - * If the timeout expires, the server responds with status 408 without - * forwarding the request to the request listener and then closes the connection. - * - * It must be set to a non-zero value (e.g. 120 seconds) to protect against - * potential Denial-of-Service attacks in case the server is deployed without a - * reverse proxy in front. - * @since v14.11.0 - */ - requestTimeout: number; - /** - * Closes all connections connected to this server. - * @since v18.2.0 - */ - closeAllConnections(): void; - /** - * Closes all connections connected to this server which are not sending a request - * or waiting for a response. - * @since v18.2.0 - */ - closeIdleConnections(): void; - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "connection", listener: (socket: Socket) => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "listening", listener: () => void): this; - addListener(event: "checkContinue", listener: RequestListener): this; - addListener(event: "checkExpectation", listener: RequestListener): this; - addListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this; - addListener( - event: "connect", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - addListener(event: "dropRequest", listener: (req: InstanceType, socket: stream.Duplex) => void): this; - addListener(event: "request", listener: RequestListener): this; - addListener( - event: "upgrade", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - emit(event: string, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "connection", socket: Socket): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "listening"): boolean; - emit( - event: "checkContinue", - req: InstanceType, - res: InstanceType & { req: InstanceType }, - ): boolean; - emit( - event: "checkExpectation", - req: InstanceType, - res: InstanceType & { req: InstanceType }, - ): boolean; - emit(event: "clientError", err: Error, socket: stream.Duplex): boolean; - emit(event: "connect", req: InstanceType, socket: stream.Duplex, head: Buffer): boolean; - emit(event: "dropRequest", req: InstanceType, socket: stream.Duplex): boolean; - emit( - event: "request", - req: InstanceType, - res: InstanceType & { req: InstanceType }, - ): boolean; - emit(event: "upgrade", req: InstanceType, socket: stream.Duplex, head: Buffer): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "connection", listener: (socket: Socket) => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "listening", listener: () => void): this; - on(event: "checkContinue", listener: RequestListener): this; - on(event: "checkExpectation", listener: RequestListener): this; - on(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this; - on(event: "connect", listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; - on(event: "dropRequest", listener: (req: InstanceType, socket: stream.Duplex) => void): this; - on(event: "request", listener: RequestListener): this; - on(event: "upgrade", listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "connection", listener: (socket: Socket) => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "listening", listener: () => void): this; - once(event: "checkContinue", listener: RequestListener): this; - once(event: "checkExpectation", listener: RequestListener): this; - once(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this; - once( - event: "connect", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - once(event: "dropRequest", listener: (req: InstanceType, socket: stream.Duplex) => void): this; - once(event: "request", listener: RequestListener): this; - once( - event: "upgrade", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "connection", listener: (socket: Socket) => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "listening", listener: () => void): this; - prependListener(event: "checkContinue", listener: RequestListener): this; - prependListener(event: "checkExpectation", listener: RequestListener): this; - prependListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this; - prependListener( - event: "connect", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - prependListener( - event: "dropRequest", - listener: (req: InstanceType, socket: stream.Duplex) => void, - ): this; - prependListener(event: "request", listener: RequestListener): this; - prependListener( - event: "upgrade", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "connection", listener: (socket: Socket) => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "listening", listener: () => void): this; - prependOnceListener(event: "checkContinue", listener: RequestListener): this; - prependOnceListener(event: "checkExpectation", listener: RequestListener): this; - prependOnceListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this; - prependOnceListener( - event: "connect", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - prependOnceListener( - event: "dropRequest", - listener: (req: InstanceType, socket: stream.Duplex) => void, - ): this; - prependOnceListener(event: "request", listener: RequestListener): this; - prependOnceListener( - event: "upgrade", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - } - /** - * This class serves as the parent class of {@link ClientRequest} and {@link ServerResponse}. It is an abstract outgoing message from - * the perspective of the participants of an HTTP transaction. - * @since v0.1.17 - */ - class OutgoingMessage extends stream.Writable { - readonly req: Request; - chunkedEncoding: boolean; - shouldKeepAlive: boolean; - useChunkedEncodingByDefault: boolean; - sendDate: boolean; - /** - * @deprecated Use `writableEnded` instead. - */ - finished: boolean; - /** - * Read-only. `true` if the headers were sent, otherwise `false`. - * @since v0.9.3 - */ - readonly headersSent: boolean; - /** - * Alias of `outgoingMessage.socket`. - * @since v0.3.0 - * @deprecated Since v15.12.0,v14.17.1 - Use `socket` instead. - */ - readonly connection: Socket | null; - /** - * Reference to the underlying socket. Usually, users will not want to access - * this property. - * - * After calling `outgoingMessage.end()`, this property will be nulled. - * @since v0.3.0 - */ - readonly socket: Socket | null; - constructor(); - /** - * Once a socket is associated with the message and is connected, `socket.setTimeout()` will be called with `msecs` as the first parameter. - * @since v0.9.12 - * @param callback Optional function to be called when a timeout occurs. Same as binding to the `timeout` event. - */ - setTimeout(msecs: number, callback?: () => void): this; - /** - * Sets a single header value. If the header already exists in the to-be-sent - * headers, its value will be replaced. Use an array of strings to send multiple - * headers with the same name. - * @since v0.4.0 - * @param name Header name - * @param value Header value - */ - setHeader(name: string, value: number | string | readonly string[]): this; - /** - * Append a single header value to the header object. - * - * If the value is an array, this is equivalent to calling this method multiple - * times. - * - * If there were no previous values for the header, this is equivalent to calling `outgoingMessage.setHeader(name, value)`. - * - * Depending of the value of `options.uniqueHeaders` when the client request or the - * server were created, this will end up in the header being sent multiple times or - * a single time with values joined using `; `. - * @since v18.3.0, v16.17.0 - * @param name Header name - * @param value Header value - */ - appendHeader(name: string, value: string | readonly string[]): this; - /** - * Gets the value of the HTTP header with the given name. If that header is not - * set, the returned value will be `undefined`. - * @since v0.4.0 - * @param name Name of header - */ - getHeader(name: string): number | string | string[] | undefined; - /** - * Returns a shallow copy of the current outgoing headers. Since a shallow - * copy is used, array values may be mutated without additional calls to - * various header-related HTTP module methods. The keys of the returned - * object are the header names and the values are the respective header - * values. All header names are lowercase. - * - * The object returned by the `outgoingMessage.getHeaders()` method does - * not prototypically inherit from the JavaScript `Object`. This means that - * typical `Object` methods such as `obj.toString()`, `obj.hasOwnProperty()`, - * and others are not defined and will not work. - * - * ```js - * outgoingMessage.setHeader('Foo', 'bar'); - * outgoingMessage.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headers = outgoingMessage.getHeaders(); - * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] } - * ``` - * @since v7.7.0 - */ - getHeaders(): OutgoingHttpHeaders; - /** - * Returns an array containing the unique names of the current outgoing headers. - * All names are lowercase. - * @since v7.7.0 - */ - getHeaderNames(): string[]; - /** - * Returns `true` if the header identified by `name` is currently set in the - * outgoing headers. The header name is case-insensitive. - * - * ```js - * const hasContentType = outgoingMessage.hasHeader('content-type'); - * ``` - * @since v7.7.0 - */ - hasHeader(name: string): boolean; - /** - * Removes a header that is queued for implicit sending. - * - * ```js - * outgoingMessage.removeHeader('Content-Encoding'); - * ``` - * @since v0.4.0 - * @param name Header name - */ - removeHeader(name: string): void; - /** - * Adds HTTP trailers (headers but at the end of the message) to the message. - * - * Trailers will **only** be emitted if the message is chunked encoded. If not, - * the trailers will be silently discarded. - * - * HTTP requires the `Trailer` header to be sent to emit trailers, - * with a list of header field names in its value, e.g. - * - * ```js - * message.writeHead(200, { 'Content-Type': 'text/plain', - * 'Trailer': 'Content-MD5' }); - * message.write(fileData); - * message.addTrailers({ 'Content-MD5': '7895bf4b8828b55ceaf47747b4bca667' }); - * message.end(); - * ``` - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * @since v0.3.0 - */ - addTrailers(headers: OutgoingHttpHeaders | ReadonlyArray<[string, string]>): void; - /** - * Flushes the message headers. - * - * For efficiency reason, Node.js normally buffers the message headers - * until `outgoingMessage.end()` is called or the first chunk of message data - * is written. It then tries to pack the headers and data into a single TCP - * packet. - * - * It is usually desired (it saves a TCP round-trip), but not when the first - * data is not sent until possibly much later. `outgoingMessage.flushHeaders()` bypasses the optimization and kickstarts the message. - * @since v1.6.0 - */ - flushHeaders(): void; - } - /** - * This object is created internally by an HTTP server, not by the user. It is - * passed as the second parameter to the `'request'` event. - * @since v0.1.17 - */ - class ServerResponse extends OutgoingMessage { - /** - * When using implicit headers (not calling `response.writeHead()` explicitly), - * this property controls the status code that will be sent to the client when - * the headers get flushed. - * - * ```js - * response.statusCode = 404; - * ``` - * - * After response header was sent to the client, this property indicates the - * status code which was sent out. - * @since v0.4.0 - */ - statusCode: number; - /** - * When using implicit headers (not calling `response.writeHead()` explicitly), - * this property controls the status message that will be sent to the client when - * the headers get flushed. If this is left as `undefined` then the standard - * message for the status code will be used. - * - * ```js - * response.statusMessage = 'Not found'; - * ``` - * - * After response header was sent to the client, this property indicates the - * status message which was sent out. - * @since v0.11.8 - */ - statusMessage: string; - /** - * If set to `true`, Node.js will check whether the `Content-Length` header value and the size of the body, in bytes, are equal. - * Mismatching the `Content-Length` header value will result - * in an `Error` being thrown, identified by `code:``'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`. - * @since v18.10.0, v16.18.0 - */ - strictContentLength: boolean; - constructor(req: Request); - assignSocket(socket: Socket): void; - detachSocket(socket: Socket): void; - /** - * Sends an HTTP/1.1 100 Continue message to the client, indicating that - * the request body should be sent. See the `'checkContinue'` event on `Server`. - * @since v0.3.0 - */ - writeContinue(callback?: () => void): void; - /** - * Sends an HTTP/1.1 103 Early Hints message to the client with a Link header, - * indicating that the user agent can preload/preconnect the linked resources. - * The `hints` is an object containing the values of headers to be sent with - * early hints message. The optional `callback` argument will be called when - * the response message has been written. - * - * **Example** - * - * ```js - * const earlyHintsLink = '; rel=preload; as=style'; - * response.writeEarlyHints({ - * 'link': earlyHintsLink, - * }); - * - * const earlyHintsLinks = [ - * '; rel=preload; as=style', - * '; rel=preload; as=script', - * ]; - * response.writeEarlyHints({ - * 'link': earlyHintsLinks, - * 'x-trace-id': 'id for diagnostics', - * }); - * - * const earlyHintsCallback = () => console.log('early hints message sent'); - * response.writeEarlyHints({ - * 'link': earlyHintsLinks, - * }, earlyHintsCallback); - * ``` - * @since v18.11.0 - * @param hints An object containing the values of headers - * @param callback Will be called when the response message has been written - */ - writeEarlyHints(hints: Record, callback?: () => void): void; - /** - * Sends a response header to the request. The status code is a 3-digit HTTP - * status code, like `404`. The last argument, `headers`, are the response headers. - * Optionally one can give a human-readable `statusMessage` as the second - * argument. - * - * `headers` may be an `Array` where the keys and values are in the same list. - * It is _not_ a list of tuples. So, the even-numbered offsets are key values, - * and the odd-numbered offsets are the associated values. The array is in the same - * format as `request.rawHeaders`. - * - * Returns a reference to the `ServerResponse`, so that calls can be chained. - * - * ```js - * const body = 'hello world'; - * response - * .writeHead(200, { - * 'Content-Length': Buffer.byteLength(body), - * 'Content-Type': 'text/plain', - * }) - * .end(body); - * ``` - * - * This method must only be called once on a message and it must - * be called before `response.end()` is called. - * - * If `response.write()` or `response.end()` are called before calling - * this, the implicit/mutable headers will be calculated and call this function. - * - * When headers have been set with `response.setHeader()`, they will be merged - * with any headers passed to `response.writeHead()`, with the headers passed - * to `response.writeHead()` given precedence. - * - * If this method is called and `response.setHeader()` has not been called, - * it will directly write the supplied header values onto the network channel - * without caching internally, and the `response.getHeader()` on the header - * will not yield the expected result. If progressive population of headers is - * desired with potential future retrieval and modification, use `response.setHeader()` instead. - * - * ```js - * // Returns content-type = text/plain - * const server = http.createServer((req, res) => { - * res.setHeader('Content-Type', 'text/html'); - * res.setHeader('X-Foo', 'bar'); - * res.writeHead(200, { 'Content-Type': 'text/plain' }); - * res.end('ok'); - * }); - * ``` - * - * `Content-Length` is read in bytes, not characters. Use `Buffer.byteLength()` to determine the length of the body in bytes. Node.js - * will check whether `Content-Length` and the length of the body which has - * been transmitted are equal or not. - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a \[`Error`\]\[\] being thrown. - * @since v0.1.30 - */ - writeHead( - statusCode: number, - statusMessage?: string, - headers?: OutgoingHttpHeaders | OutgoingHttpHeader[], - ): this; - writeHead(statusCode: number, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this; - /** - * Sends a HTTP/1.1 102 Processing message to the client, indicating that - * the request body should be sent. - * @since v10.0.0 - */ - writeProcessing(): void; - } - interface InformationEvent { - statusCode: number; - statusMessage: string; - httpVersion: string; - httpVersionMajor: number; - httpVersionMinor: number; - headers: IncomingHttpHeaders; - rawHeaders: string[]; - } - /** - * This object is created internally and returned from {@link request}. It - * represents an _in-progress_ request whose header has already been queued. The - * header is still mutable using the `setHeader(name, value)`, `getHeader(name)`, `removeHeader(name)` API. The actual header will - * be sent along with the first data chunk or when calling `request.end()`. - * - * To get the response, add a listener for `'response'` to the request object. `'response'` will be emitted from the request object when the response - * headers have been received. The `'response'` event is executed with one - * argument which is an instance of {@link IncomingMessage}. - * - * During the `'response'` event, one can add listeners to the - * response object; particularly to listen for the `'data'` event. - * - * If no `'response'` handler is added, then the response will be - * entirely discarded. However, if a `'response'` event handler is added, - * then the data from the response object **must** be consumed, either by - * calling `response.read()` whenever there is a `'readable'` event, or - * by adding a `'data'` handler, or by calling the `.resume()` method. - * Until the data is consumed, the `'end'` event will not fire. Also, until - * the data is read it will consume memory that can eventually lead to a - * 'process out of memory' error. - * - * For backward compatibility, `res` will only emit `'error'` if there is an `'error'` listener registered. - * - * Set `Content-Length` header to limit the response body size. - * If `response.strictContentLength` is set to `true`, mismatching the `Content-Length` header value will result in an `Error` being thrown, - * identified by `code:``'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`. - * - * `Content-Length` value should be in bytes, not characters. Use `Buffer.byteLength()` to determine the length of the body in bytes. - * @since v0.1.17 - */ - class ClientRequest extends OutgoingMessage { - /** - * The `request.aborted` property will be `true` if the request has - * been aborted. - * @since v0.11.14 - * @deprecated Since v17.0.0, v16.12.0 - Check `destroyed` instead. - */ - aborted: boolean; - /** - * The request host. - * @since v14.5.0, v12.19.0 - */ - host: string; - /** - * The request protocol. - * @since v14.5.0, v12.19.0 - */ - protocol: string; - /** - * When sending request through a keep-alive enabled agent, the underlying socket - * might be reused. But if server closes connection at unfortunate time, client - * may run into a 'ECONNRESET' error. - * - * ```js - * import http from 'node:http'; - * - * // Server has a 5 seconds keep-alive timeout by default - * http - * .createServer((req, res) => { - * res.write('hello\n'); - * res.end(); - * }) - * .listen(3000); - * - * setInterval(() => { - * // Adapting a keep-alive agent - * http.get('http://localhost:3000', { agent }, (res) => { - * res.on('data', (data) => { - * // Do nothing - * }); - * }); - * }, 5000); // Sending request on 5s interval so it's easy to hit idle timeout - * ``` - * - * By marking a request whether it reused socket or not, we can do - * automatic error retry base on it. - * - * ```js - * import http from 'node:http'; - * const agent = new http.Agent({ keepAlive: true }); - * - * function retriableRequest() { - * const req = http - * .get('http://localhost:3000', { agent }, (res) => { - * // ... - * }) - * .on('error', (err) => { - * // Check if retry is needed - * if (req.reusedSocket && err.code === 'ECONNRESET') { - * retriableRequest(); - * } - * }); - * } - * - * retriableRequest(); - * ``` - * @since v13.0.0, v12.16.0 - */ - reusedSocket: boolean; - /** - * Limits maximum response headers count. If set to 0, no limit will be applied. - */ - maxHeadersCount: number; - constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void); - /** - * The request method. - * @since v0.1.97 - */ - method: string; - /** - * The request path. - * @since v0.4.0 - */ - path: string; - /** - * Marks the request as aborting. Calling this will cause remaining data - * in the response to be dropped and the socket to be destroyed. - * @since v0.3.8 - * @deprecated Since v14.1.0,v13.14.0 - Use `destroy` instead. - */ - abort(): void; - onSocket(socket: Socket): void; - /** - * Once a socket is assigned to this request and is connected `socket.setTimeout()` will be called. - * @since v0.5.9 - * @param timeout Milliseconds before a request times out. - * @param callback Optional function to be called when a timeout occurs. Same as binding to the `'timeout'` event. - */ - setTimeout(timeout: number, callback?: () => void): this; - /** - * Once a socket is assigned to this request and is connected `socket.setNoDelay()` will be called. - * @since v0.5.9 - */ - setNoDelay(noDelay?: boolean): void; - /** - * Once a socket is assigned to this request and is connected `socket.setKeepAlive()` will be called. - * @since v0.5.9 - */ - setSocketKeepAlive(enable?: boolean, initialDelay?: number): void; - /** - * Returns an array containing the unique names of the current outgoing raw - * headers. Header names are returned with their exact casing being set. - * - * ```js - * request.setHeader('Foo', 'bar'); - * request.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headerNames = request.getRawHeaderNames(); - * // headerNames === ['Foo', 'Set-Cookie'] - * ``` - * @since v15.13.0, v14.17.0 - */ - getRawHeaderNames(): string[]; - /** - * @deprecated - */ - addListener(event: "abort", listener: () => void): this; - addListener( - event: "connect", - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - addListener(event: "continue", listener: () => void): this; - addListener(event: "information", listener: (info: InformationEvent) => void): this; - addListener(event: "response", listener: (response: IncomingMessage) => void): this; - addListener(event: "socket", listener: (socket: Socket) => void): this; - addListener(event: "timeout", listener: () => void): this; - addListener( - event: "upgrade", - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "pipe", listener: (src: stream.Readable) => void): this; - addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - on(event: "abort", listener: () => void): this; - on(event: "connect", listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - on(event: "continue", listener: () => void): this; - on(event: "information", listener: (info: InformationEvent) => void): this; - on(event: "response", listener: (response: IncomingMessage) => void): this; - on(event: "socket", listener: (socket: Socket) => void): this; - on(event: "timeout", listener: () => void): this; - on(event: "upgrade", listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - on(event: "close", listener: () => void): this; - on(event: "drain", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "pipe", listener: (src: stream.Readable) => void): this; - on(event: "unpipe", listener: (src: stream.Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - once(event: "abort", listener: () => void): this; - once(event: "connect", listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - once(event: "continue", listener: () => void): this; - once(event: "information", listener: (info: InformationEvent) => void): this; - once(event: "response", listener: (response: IncomingMessage) => void): this; - once(event: "socket", listener: (socket: Socket) => void): this; - once(event: "timeout", listener: () => void): this; - once(event: "upgrade", listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - once(event: "close", listener: () => void): this; - once(event: "drain", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "pipe", listener: (src: stream.Readable) => void): this; - once(event: "unpipe", listener: (src: stream.Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - prependListener(event: "abort", listener: () => void): this; - prependListener( - event: "connect", - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - prependListener(event: "continue", listener: () => void): this; - prependListener(event: "information", listener: (info: InformationEvent) => void): this; - prependListener(event: "response", listener: (response: IncomingMessage) => void): this; - prependListener(event: "socket", listener: (socket: Socket) => void): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener( - event: "upgrade", - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - prependOnceListener(event: "abort", listener: () => void): this; - prependOnceListener( - event: "connect", - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - prependOnceListener(event: "continue", listener: () => void): this; - prependOnceListener(event: "information", listener: (info: InformationEvent) => void): this; - prependOnceListener(event: "response", listener: (response: IncomingMessage) => void): this; - prependOnceListener(event: "socket", listener: (socket: Socket) => void): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener( - event: "upgrade", - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * An `IncomingMessage` object is created by {@link Server} or {@link ClientRequest} and passed as the first argument to the `'request'` and `'response'` event respectively. It may be used to - * access response - * status, headers, and data. - * - * Different from its `socket` value which is a subclass of `stream.Duplex`, the `IncomingMessage` itself extends `stream.Readable` and is created separately to - * parse and emit the incoming HTTP headers and payload, as the underlying socket - * may be reused multiple times in case of keep-alive. - * @since v0.1.17 - */ - class IncomingMessage extends stream.Readable { - constructor(socket: Socket); - /** - * The `message.aborted` property will be `true` if the request has - * been aborted. - * @since v10.1.0 - * @deprecated Since v17.0.0,v16.12.0 - Check `message.destroyed` from stream.Readable. - */ - aborted: boolean; - /** - * In case of server request, the HTTP version sent by the client. In the case of - * client response, the HTTP version of the connected-to server. - * Probably either `'1.1'` or `'1.0'`. - * - * Also `message.httpVersionMajor` is the first integer and `message.httpVersionMinor` is the second. - * @since v0.1.1 - */ - httpVersion: string; - httpVersionMajor: number; - httpVersionMinor: number; - /** - * The `message.complete` property will be `true` if a complete HTTP message has - * been received and successfully parsed. - * - * This property is particularly useful as a means of determining if a client or - * server fully transmitted a message before a connection was terminated: - * - * ```js - * const req = http.request({ - * host: '127.0.0.1', - * port: 8080, - * method: 'POST', - * }, (res) => { - * res.resume(); - * res.on('end', () => { - * if (!res.complete) - * console.error( - * 'The connection was terminated while the message was still being sent'); - * }); - * }); - * ``` - * @since v0.3.0 - */ - complete: boolean; - /** - * Alias for `message.socket`. - * @since v0.1.90 - * @deprecated Since v16.0.0 - Use `socket`. - */ - connection: Socket; - /** - * The `net.Socket` object associated with the connection. - * - * With HTTPS support, use `request.socket.getPeerCertificate()` to obtain the - * client's authentication details. - * - * This property is guaranteed to be an instance of the `net.Socket` class, - * a subclass of `stream.Duplex`, unless the user specified a socket - * type other than `net.Socket` or internally nulled. - * @since v0.3.0 - */ - socket: Socket; - /** - * The request/response headers object. - * - * Key-value pairs of header names and values. Header names are lower-cased. - * - * ```js - * // Prints something like: - * // - * // { 'user-agent': 'curl/7.22.0', - * // host: '127.0.0.1:8000', - * // accept: '*' } - * console.log(request.headers); - * ``` - * - * Duplicates in raw headers are handled in the following ways, depending on the - * header name: - * - * * Duplicates of `age`, `authorization`, `content-length`, `content-type`, `etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`, `last-modified`, `location`, - * `max-forwards`, `proxy-authorization`, `referer`, `retry-after`, `server`, or `user-agent` are discarded. - * To allow duplicate values of the headers listed above to be joined, - * use the option `joinDuplicateHeaders` in {@link request} and {@link createServer}. See RFC 9110 Section 5.3 for more - * information. - * * `set-cookie` is always an array. Duplicates are added to the array. - * * For duplicate `cookie` headers, the values are joined together with `; `. - * * For all other headers, the values are joined together with `, `. - * @since v0.1.5 - */ - headers: IncomingHttpHeaders; - /** - * Similar to `message.headers`, but there is no join logic and the values are - * always arrays of strings, even for headers received just once. - * - * ```js - * // Prints something like: - * // - * // { 'user-agent': ['curl/7.22.0'], - * // host: ['127.0.0.1:8000'], - * // accept: ['*'] } - * console.log(request.headersDistinct); - * ``` - * @since v18.3.0, v16.17.0 - */ - headersDistinct: NodeJS.Dict; - /** - * The raw request/response headers list exactly as they were received. - * - * The keys and values are in the same list. It is _not_ a - * list of tuples. So, the even-numbered offsets are key values, and the - * odd-numbered offsets are the associated values. - * - * Header names are not lowercased, and duplicates are not merged. - * - * ```js - * // Prints something like: - * // - * // [ 'user-agent', - * // 'this is invalid because there can be only one', - * // 'User-Agent', - * // 'curl/7.22.0', - * // 'Host', - * // '127.0.0.1:8000', - * // 'ACCEPT', - * // '*' ] - * console.log(request.rawHeaders); - * ``` - * @since v0.11.6 - */ - rawHeaders: string[]; - /** - * The request/response trailers object. Only populated at the `'end'` event. - * @since v0.3.0 - */ - trailers: NodeJS.Dict; - /** - * Similar to `message.trailers`, but there is no join logic and the values are - * always arrays of strings, even for headers received just once. - * Only populated at the `'end'` event. - * @since v18.3.0, v16.17.0 - */ - trailersDistinct: NodeJS.Dict; - /** - * The raw request/response trailer keys and values exactly as they were - * received. Only populated at the `'end'` event. - * @since v0.11.6 - */ - rawTrailers: string[]; - /** - * Calls `message.socket.setTimeout(msecs, callback)`. - * @since v0.5.9 - */ - setTimeout(msecs: number, callback?: () => void): this; - /** - * **Only valid for request obtained from {@link Server}.** - * - * The request method as a string. Read only. Examples: `'GET'`, `'DELETE'`. - * @since v0.1.1 - */ - method?: string | undefined; - /** - * **Only valid for request obtained from {@link Server}.** - * - * Request URL string. This contains only the URL that is present in the actual - * HTTP request. Take the following request: - * - * ```http - * GET /status?name=ryan HTTP/1.1 - * Accept: text/plain - * ``` - * - * To parse the URL into its parts: - * - * ```js - * new URL(`http://${process.env.HOST ?? 'localhost'}${request.url}`); - * ``` - * - * When `request.url` is `'/status?name=ryan'` and `process.env.HOST` is undefined: - * - * ```console - * $ node - * > new URL(`http://${process.env.HOST ?? 'localhost'}${request.url}`); - * URL { - * href: 'http://localhost/status?name=ryan', - * origin: 'http://localhost', - * protocol: 'http:', - * username: '', - * password: '', - * host: 'localhost', - * hostname: 'localhost', - * port: '', - * pathname: '/status', - * search: '?name=ryan', - * searchParams: URLSearchParams { 'name' => 'ryan' }, - * hash: '' - * } - * ``` - * - * Ensure that you set `process.env.HOST` to the server's host name, or consider replacing this part entirely. If using `req.headers.host`, ensure proper - * validation is used, as clients may specify a custom `Host` header. - * @since v0.1.90 - */ - url?: string | undefined; - /** - * **Only valid for response obtained from {@link ClientRequest}.** - * - * The 3-digit HTTP response status code. E.G. `404`. - * @since v0.1.1 - */ - statusCode?: number | undefined; - /** - * **Only valid for response obtained from {@link ClientRequest}.** - * - * The HTTP response status message (reason phrase). E.G. `OK` or `Internal Server Error`. - * @since v0.11.10 - */ - statusMessage?: string | undefined; - /** - * Calls `destroy()` on the socket that received the `IncomingMessage`. If `error` is provided, an `'error'` event is emitted on the socket and `error` is passed - * as an argument to any listeners on the event. - * @since v0.3.0 - */ - destroy(error?: Error): this; - } - interface AgentOptions extends Partial { - /** - * Keep sockets around in a pool to be used by other requests in the future. Default = false - */ - keepAlive?: boolean | undefined; - /** - * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000. - * Only relevant if keepAlive is set to true. - */ - keepAliveMsecs?: number | undefined; - /** - * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity - */ - maxSockets?: number | undefined; - /** - * Maximum number of sockets allowed for all hosts in total. Each request will use a new socket until the maximum is reached. Default: Infinity. - */ - maxTotalSockets?: number | undefined; - /** - * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256. - */ - maxFreeSockets?: number | undefined; - /** - * Socket timeout in milliseconds. This will set the timeout after the socket is connected. - */ - timeout?: number | undefined; - /** - * Scheduling strategy to apply when picking the next free socket to use. - * @default `lifo` - */ - scheduling?: "fifo" | "lifo" | undefined; - } - /** - * An `Agent` is responsible for managing connection persistence - * and reuse for HTTP clients. It maintains a queue of pending requests - * for a given host and port, reusing a single socket connection for each - * until the queue is empty, at which time the socket is either destroyed - * or put into a pool where it is kept to be used again for requests to the - * same host and port. Whether it is destroyed or pooled depends on the `keepAlive` `option`. - * - * Pooled connections have TCP Keep-Alive enabled for them, but servers may - * still close idle connections, in which case they will be removed from the - * pool and a new connection will be made when a new HTTP request is made for - * that host and port. Servers may also refuse to allow multiple requests - * over the same connection, in which case the connection will have to be - * remade for every request and cannot be pooled. The `Agent` will still make - * the requests to that server, but each one will occur over a new connection. - * - * When a connection is closed by the client or the server, it is removed - * from the pool. Any unused sockets in the pool will be unrefed so as not - * to keep the Node.js process running when there are no outstanding requests. - * (see `socket.unref()`). - * - * It is good practice, to `destroy()` an `Agent` instance when it is no - * longer in use, because unused sockets consume OS resources. - * - * Sockets are removed from an agent when the socket emits either - * a `'close'` event or an `'agentRemove'` event. When intending to keep one - * HTTP request open for a long time without keeping it in the agent, something - * like the following may be done: - * - * ```js - * http.get(options, (res) => { - * // Do stuff - * }).on('socket', (socket) => { - * socket.emit('agentRemove'); - * }); - * ``` - * - * An agent may also be used for an individual request. By providing `{agent: false}` as an option to the `http.get()` or `http.request()` functions, a one-time use `Agent` with default options - * will be used - * for the client connection. - * - * `agent:false`: - * - * ```js - * http.get({ - * hostname: 'localhost', - * port: 80, - * path: '/', - * agent: false, // Create a new agent just for this one request - * }, (res) => { - * // Do stuff with response - * }); - * ``` - * - * `options` in [`socket.connect()`](https://nodejs.org/docs/latest-v22.x/api/net.html#socketconnectoptions-connectlistener) are also supported. - * - * To configure any of them, a custom {@link Agent} instance must be created. - * - * ```js - * import http from 'node:http'; - * const keepAliveAgent = new http.Agent({ keepAlive: true }); - * options.agent = keepAliveAgent; - * http.request(options, onResponseCallback) - * ``` - * @since v0.3.4 - */ - class Agent extends EventEmitter { - /** - * By default set to 256. For agents with `keepAlive` enabled, this - * sets the maximum number of sockets that will be left open in the free - * state. - * @since v0.11.7 - */ - maxFreeSockets: number; - /** - * By default set to `Infinity`. Determines how many concurrent sockets the agent - * can have open per origin. Origin is the returned value of `agent.getName()`. - * @since v0.3.6 - */ - maxSockets: number; - /** - * By default set to `Infinity`. Determines how many concurrent sockets the agent - * can have open. Unlike `maxSockets`, this parameter applies across all origins. - * @since v14.5.0, v12.19.0 - */ - maxTotalSockets: number; - /** - * An object which contains arrays of sockets currently awaiting use by - * the agent when `keepAlive` is enabled. Do not modify. - * - * Sockets in the `freeSockets` list will be automatically destroyed and - * removed from the array on `'timeout'`. - * @since v0.11.4 - */ - readonly freeSockets: NodeJS.ReadOnlyDict; - /** - * An object which contains arrays of sockets currently in use by the - * agent. Do not modify. - * @since v0.3.6 - */ - readonly sockets: NodeJS.ReadOnlyDict; - /** - * An object which contains queues of requests that have not yet been assigned to - * sockets. Do not modify. - * @since v0.5.9 - */ - readonly requests: NodeJS.ReadOnlyDict; - constructor(opts?: AgentOptions); - /** - * Destroy any sockets that are currently in use by the agent. - * - * It is usually not necessary to do this. However, if using an - * agent with `keepAlive` enabled, then it is best to explicitly shut down - * the agent when it is no longer needed. Otherwise, - * sockets might stay open for quite a long time before the server - * terminates them. - * @since v0.11.4 - */ - destroy(): void; - } - const METHODS: string[]; - const STATUS_CODES: { - [errorCode: number]: string | undefined; - [errorCode: string]: string | undefined; - }; - /** - * Returns a new instance of {@link Server}. - * - * The `requestListener` is a function which is automatically - * added to the `'request'` event. - * - * ```js - * import http from 'node:http'; - * - * // Create a local server to receive data from - * const server = http.createServer((req, res) => { - * res.writeHead(200, { 'Content-Type': 'application/json' }); - * res.end(JSON.stringify({ - * data: 'Hello World!', - * })); - * }); - * - * server.listen(8000); - * ``` - * - * ```js - * import http from 'node:http'; - * - * // Create a local server to receive data from - * const server = http.createServer(); - * - * // Listen to the request event - * server.on('request', (request, res) => { - * res.writeHead(200, { 'Content-Type': 'application/json' }); - * res.end(JSON.stringify({ - * data: 'Hello World!', - * })); - * }); - * - * server.listen(8000); - * ``` - * @since v0.1.13 - */ - function createServer< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse> = typeof ServerResponse, - >(requestListener?: RequestListener): Server; - function createServer< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse> = typeof ServerResponse, - >( - options: ServerOptions, - requestListener?: RequestListener, - ): Server; - // although RequestOptions are passed as ClientRequestArgs to ClientRequest directly, - // create interface RequestOptions would make the naming more clear to developers - interface RequestOptions extends ClientRequestArgs {} - /** - * `options` in `socket.connect()` are also supported. - * - * Node.js maintains several connections per server to make HTTP requests. - * This function allows one to transparently issue requests. - * - * `url` can be a string or a `URL` object. If `url` is a - * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. - * - * If both `url` and `options` are specified, the objects are merged, with the `options` properties taking precedence. - * - * The optional `callback` parameter will be added as a one-time listener for - * the `'response'` event. - * - * `http.request()` returns an instance of the {@link ClientRequest} class. The `ClientRequest` instance is a writable stream. If one needs to - * upload a file with a POST request, then write to the `ClientRequest` object. - * - * ```js - * import http from 'node:http'; - * import { Buffer } from 'node:buffer'; - * - * const postData = JSON.stringify({ - * 'msg': 'Hello World!', - * }); - * - * const options = { - * hostname: 'www.google.com', - * port: 80, - * path: '/upload', - * method: 'POST', - * headers: { - * 'Content-Type': 'application/json', - * 'Content-Length': Buffer.byteLength(postData), - * }, - * }; - * - * const req = http.request(options, (res) => { - * console.log(`STATUS: ${res.statusCode}`); - * console.log(`HEADERS: ${JSON.stringify(res.headers)}`); - * res.setEncoding('utf8'); - * res.on('data', (chunk) => { - * console.log(`BODY: ${chunk}`); - * }); - * res.on('end', () => { - * console.log('No more data in response.'); - * }); - * }); - * - * req.on('error', (e) => { - * console.error(`problem with request: ${e.message}`); - * }); - * - * // Write data to request body - * req.write(postData); - * req.end(); - * ``` - * - * In the example `req.end()` was called. With `http.request()` one - * must always call `req.end()` to signify the end of the request - - * even if there is no data being written to the request body. - * - * If any error is encountered during the request (be that with DNS resolution, - * TCP level errors, or actual HTTP parse errors) an `'error'` event is emitted - * on the returned request object. As with all `'error'` events, if no listeners - * are registered the error will be thrown. - * - * There are a few special headers that should be noted. - * - * * Sending a 'Connection: keep-alive' will notify Node.js that the connection to - * the server should be persisted until the next request. - * * Sending a 'Content-Length' header will disable the default chunked encoding. - * * Sending an 'Expect' header will immediately send the request headers. - * Usually, when sending 'Expect: 100-continue', both a timeout and a listener - * for the `'continue'` event should be set. See RFC 2616 Section 8.2.3 for more - * information. - * * Sending an Authorization header will override using the `auth` option - * to compute basic authentication. - * - * Example using a `URL` as `options`: - * - * ```js - * const options = new URL('http://abc:xyz@example.com'); - * - * const req = http.request(options, (res) => { - * // ... - * }); - * ``` - * - * In a successful request, the following events will be emitted in the following - * order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * (`'data'` will not be emitted at all if the response body is empty, for - * instance, in most redirects) - * * `'end'` on the `res` object - * * `'close'` - * - * In the case of a connection error, the following events will be emitted: - * - * * `'socket'` - * * `'error'` - * * `'close'` - * - * In the case of a premature connection close before the response is received, - * the following events will be emitted in the following order: - * - * * `'socket'` - * * `'error'` with an error with message `'Error: socket hang up'` and code `'ECONNRESET'` - * * `'close'` - * - * In the case of a premature connection close after the response is received, - * the following events will be emitted in the following order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * * (connection closed here) - * * `'aborted'` on the `res` object - * * `'close'` - * * `'error'` on the `res` object with an error with message `'Error: aborted'` and code `'ECONNRESET'` - * * `'close'` on the `res` object - * - * If `req.destroy()` is called before a socket is assigned, the following - * events will be emitted in the following order: - * - * * (`req.destroy()` called here) - * * `'error'` with an error with message `'Error: socket hang up'` and code `'ECONNRESET'`, or the error with which `req.destroy()` was called - * * `'close'` - * - * If `req.destroy()` is called before the connection succeeds, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * (`req.destroy()` called here) - * * `'error'` with an error with message `'Error: socket hang up'` and code `'ECONNRESET'`, or the error with which `req.destroy()` was called - * * `'close'` - * - * If `req.destroy()` is called after the response is received, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * * (`req.destroy()` called here) - * * `'aborted'` on the `res` object - * * `'close'` - * * `'error'` on the `res` object with an error with message `'Error: aborted'` and code `'ECONNRESET'`, or the error with which `req.destroy()` was called - * * `'close'` on the `res` object - * - * If `req.abort()` is called before a socket is assigned, the following - * events will be emitted in the following order: - * - * * (`req.abort()` called here) - * * `'abort'` - * * `'close'` - * - * If `req.abort()` is called before the connection succeeds, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * (`req.abort()` called here) - * * `'abort'` - * * `'error'` with an error with message `'Error: socket hang up'` and code `'ECONNRESET'` - * * `'close'` - * - * If `req.abort()` is called after the response is received, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * * (`req.abort()` called here) - * * `'abort'` - * * `'aborted'` on the `res` object - * * `'error'` on the `res` object with an error with message `'Error: aborted'` and code `'ECONNRESET'`. - * * `'close'` - * * `'close'` on the `res` object - * - * Setting the `timeout` option or using the `setTimeout()` function will - * not abort the request or do anything besides add a `'timeout'` event. - * - * Passing an `AbortSignal` and then calling `abort()` on the corresponding `AbortController` will behave the same way as calling `.destroy()` on the - * request. Specifically, the `'error'` event will be emitted with an error with - * the message `'AbortError: The operation was aborted'`, the code `'ABORT_ERR'` and the `cause`, if one was provided. - * @since v0.3.6 - */ - function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; - function request( - url: string | URL, - options: RequestOptions, - callback?: (res: IncomingMessage) => void, - ): ClientRequest; - /** - * Since most requests are GET requests without bodies, Node.js provides this - * convenience method. The only difference between this method and {@link request} is that it sets the method to GET by default and calls `req.end()` automatically. The callback must take care to - * consume the response - * data for reasons stated in {@link ClientRequest} section. - * - * The `callback` is invoked with a single argument that is an instance of {@link IncomingMessage}. - * - * JSON fetching example: - * - * ```js - * http.get('http://localhost:8000/', (res) => { - * const { statusCode } = res; - * const contentType = res.headers['content-type']; - * - * let error; - * // Any 2xx status code signals a successful response but - * // here we're only checking for 200. - * if (statusCode !== 200) { - * error = new Error('Request Failed.\n' + - * `Status Code: ${statusCode}`); - * } else if (!/^application\/json/.test(contentType)) { - * error = new Error('Invalid content-type.\n' + - * `Expected application/json but received ${contentType}`); - * } - * if (error) { - * console.error(error.message); - * // Consume response data to free up memory - * res.resume(); - * return; - * } - * - * res.setEncoding('utf8'); - * let rawData = ''; - * res.on('data', (chunk) => { rawData += chunk; }); - * res.on('end', () => { - * try { - * const parsedData = JSON.parse(rawData); - * console.log(parsedData); - * } catch (e) { - * console.error(e.message); - * } - * }); - * }).on('error', (e) => { - * console.error(`Got error: ${e.message}`); - * }); - * - * // Create a local server to receive data from - * const server = http.createServer((req, res) => { - * res.writeHead(200, { 'Content-Type': 'application/json' }); - * res.end(JSON.stringify({ - * data: 'Hello World!', - * })); - * }); - * - * server.listen(8000); - * ``` - * @since v0.3.6 - * @param options Accepts the same `options` as {@link request}, with the method set to GET by default. - */ - function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; - function get(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; - /** - * Performs the low-level validations on the provided `name` that are done when `res.setHeader(name, value)` is called. - * - * Passing illegal value as `name` will result in a `TypeError` being thrown, - * identified by `code: 'ERR_INVALID_HTTP_TOKEN'`. - * - * It is not necessary to use this method before passing headers to an HTTP request - * or response. The HTTP module will automatically validate such headers. - * - * Example: - * - * ```js - * import { validateHeaderName } from 'node:http'; - * - * try { - * validateHeaderName(''); - * } catch (err) { - * console.error(err instanceof TypeError); // --> true - * console.error(err.code); // --> 'ERR_INVALID_HTTP_TOKEN' - * console.error(err.message); // --> 'Header name must be a valid HTTP token [""]' - * } - * ``` - * @since v14.3.0 - * @param [label='Header name'] Label for error message. - */ - function validateHeaderName(name: string): void; - /** - * Performs the low-level validations on the provided `value` that are done when `res.setHeader(name, value)` is called. - * - * Passing illegal value as `value` will result in a `TypeError` being thrown. - * - * * Undefined value error is identified by `code: 'ERR_HTTP_INVALID_HEADER_VALUE'`. - * * Invalid value character error is identified by `code: 'ERR_INVALID_CHAR'`. - * - * It is not necessary to use this method before passing headers to an HTTP request - * or response. The HTTP module will automatically validate such headers. - * - * Examples: - * - * ```js - * import { validateHeaderValue } from 'node:http'; - * - * try { - * validateHeaderValue('x-my-header', undefined); - * } catch (err) { - * console.error(err instanceof TypeError); // --> true - * console.error(err.code === 'ERR_HTTP_INVALID_HEADER_VALUE'); // --> true - * console.error(err.message); // --> 'Invalid value "undefined" for header "x-my-header"' - * } - * - * try { - * validateHeaderValue('x-my-header', 'oʊmɪɡə'); - * } catch (err) { - * console.error(err instanceof TypeError); // --> true - * console.error(err.code === 'ERR_INVALID_CHAR'); // --> true - * console.error(err.message); // --> 'Invalid character in header content ["x-my-header"]' - * } - * ``` - * @since v14.3.0 - * @param name Header name - * @param value Header value - */ - function validateHeaderValue(name: string, value: string): void; - /** - * Set the maximum number of idle HTTP parsers. - * @since v18.8.0, v16.18.0 - * @param [max=1000] - */ - function setMaxIdleHTTPParsers(max: number): void; - /** - * Global instance of `Agent` which is used as the default for all HTTP client - * requests. Diverges from a default `Agent` configuration by having `keepAlive` - * enabled and a `timeout` of 5 seconds. - * @since v0.5.9 - */ - let globalAgent: Agent; - /** - * Read-only property specifying the maximum allowed size of HTTP headers in bytes. - * Defaults to 16KB. Configurable using the `--max-http-header-size` CLI option. - */ - const maxHeaderSize: number; - /** - * A browser-compatible implementation of [WebSocket](https://nodejs.org/docs/latest/api/http.html#websocket). - * @since v22.5.0 - */ - const WebSocket: import("undici-types").WebSocket; - /** - * @since v22.5.0 - */ - const CloseEvent: import("undici-types").CloseEvent; - /** - * @since v22.5.0 - */ - const MessageEvent: import("undici-types").MessageEvent; -} -declare module "node:http" { - export * from "http"; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/http2.d.ts b/tools/mnemonic-test/node_modules/@types/node/http2.d.ts deleted file mode 100644 index 0838ae8b..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/http2.d.ts +++ /dev/null @@ -1,2555 +0,0 @@ -/** - * The `node:http2` module provides an implementation of the [HTTP/2](https://tools.ietf.org/html/rfc7540) protocol. - * It can be accessed using: - * - * ```js - * import http2 from 'node:http2'; - * ``` - * @since v8.4.0 - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/http2.js) - */ -declare module "http2" { - import EventEmitter = require("node:events"); - import * as fs from "node:fs"; - import * as net from "node:net"; - import * as stream from "node:stream"; - import * as tls from "node:tls"; - import * as url from "node:url"; - import { - IncomingHttpHeaders as Http1IncomingHttpHeaders, - IncomingMessage, - OutgoingHttpHeaders, - ServerResponse, - } from "node:http"; - export { OutgoingHttpHeaders } from "node:http"; - export interface IncomingHttpStatusHeader { - ":status"?: number | undefined; - } - export interface IncomingHttpHeaders extends Http1IncomingHttpHeaders { - ":path"?: string | undefined; - ":method"?: string | undefined; - ":authority"?: string | undefined; - ":scheme"?: string | undefined; - } - // Http2Stream - export interface StreamPriorityOptions { - exclusive?: boolean | undefined; - parent?: number | undefined; - weight?: number | undefined; - silent?: boolean | undefined; - } - export interface StreamState { - localWindowSize?: number | undefined; - state?: number | undefined; - localClose?: number | undefined; - remoteClose?: number | undefined; - sumDependencyWeight?: number | undefined; - weight?: number | undefined; - } - export interface ServerStreamResponseOptions { - endStream?: boolean | undefined; - waitForTrailers?: boolean | undefined; - } - export interface StatOptions { - offset: number; - length: number; - } - export interface ServerStreamFileResponseOptions { - // eslint-disable-next-line @typescript-eslint/no-invalid-void-type - statCheck?(stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions): void | boolean; - waitForTrailers?: boolean | undefined; - offset?: number | undefined; - length?: number | undefined; - } - export interface ServerStreamFileResponseOptionsWithError extends ServerStreamFileResponseOptions { - onError?(err: NodeJS.ErrnoException): void; - } - export interface Http2Stream extends stream.Duplex { - /** - * Set to `true` if the `Http2Stream` instance was aborted abnormally. When set, - * the `'aborted'` event will have been emitted. - * @since v8.4.0 - */ - readonly aborted: boolean; - /** - * This property shows the number of characters currently buffered to be written. - * See `net.Socket.bufferSize` for details. - * @since v11.2.0, v10.16.0 - */ - readonly bufferSize: number; - /** - * Set to `true` if the `Http2Stream` instance has been closed. - * @since v9.4.0 - */ - readonly closed: boolean; - /** - * Set to `true` if the `Http2Stream` instance has been destroyed and is no longer - * usable. - * @since v8.4.0 - */ - readonly destroyed: boolean; - /** - * Set to `true` if the `END_STREAM` flag was set in the request or response - * HEADERS frame received, indicating that no additional data should be received - * and the readable side of the `Http2Stream` will be closed. - * @since v10.11.0 - */ - readonly endAfterHeaders: boolean; - /** - * The numeric stream identifier of this `Http2Stream` instance. Set to `undefined` if the stream identifier has not yet been assigned. - * @since v8.4.0 - */ - readonly id?: number | undefined; - /** - * Set to `true` if the `Http2Stream` instance has not yet been assigned a - * numeric stream identifier. - * @since v9.4.0 - */ - readonly pending: boolean; - /** - * Set to the `RST_STREAM` `error code` reported when the `Http2Stream` is - * destroyed after either receiving an `RST_STREAM` frame from the connected peer, - * calling `http2stream.close()`, or `http2stream.destroy()`. Will be `undefined` if the `Http2Stream` has not been closed. - * @since v8.4.0 - */ - readonly rstCode: number; - /** - * An object containing the outbound headers sent for this `Http2Stream`. - * @since v9.5.0 - */ - readonly sentHeaders: OutgoingHttpHeaders; - /** - * An array of objects containing the outbound informational (additional) headers - * sent for this `Http2Stream`. - * @since v9.5.0 - */ - readonly sentInfoHeaders?: OutgoingHttpHeaders[] | undefined; - /** - * An object containing the outbound trailers sent for this `HttpStream`. - * @since v9.5.0 - */ - readonly sentTrailers?: OutgoingHttpHeaders | undefined; - /** - * A reference to the `Http2Session` instance that owns this `Http2Stream`. The - * value will be `undefined` after the `Http2Stream` instance is destroyed. - * @since v8.4.0 - */ - readonly session: Http2Session | undefined; - /** - * Provides miscellaneous information about the current state of the `Http2Stream`. - * - * A current state of this `Http2Stream`. - * @since v8.4.0 - */ - readonly state: StreamState; - /** - * Closes the `Http2Stream` instance by sending an `RST_STREAM` frame to the - * connected HTTP/2 peer. - * @since v8.4.0 - * @param [code=http2.constants.NGHTTP2_NO_ERROR] Unsigned 32-bit integer identifying the error code. - * @param callback An optional function registered to listen for the `'close'` event. - */ - close(code?: number, callback?: () => void): void; - /** - * Updates the priority for this `Http2Stream` instance. - * @since v8.4.0 - */ - priority(options: StreamPriorityOptions): void; - /** - * ```js - * import http2 from 'node:http2'; - * const client = http2.connect('http://example.org:8000'); - * const { NGHTTP2_CANCEL } = http2.constants; - * const req = client.request({ ':path': '/' }); - * - * // Cancel the stream if there's no activity after 5 seconds - * req.setTimeout(5000, () => req.close(NGHTTP2_CANCEL)); - * ``` - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - /** - * Sends a trailing `HEADERS` frame to the connected HTTP/2 peer. This method - * will cause the `Http2Stream` to be immediately closed and must only be - * called after the `'wantTrailers'` event has been emitted. When sending a - * request or sending a response, the `options.waitForTrailers` option must be set - * in order to keep the `Http2Stream` open after the final `DATA` frame so that - * trailers can be sent. - * - * ```js - * import http2 from 'node:http2'; - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond(undefined, { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ xyz: 'abc' }); - * }); - * stream.end('Hello World'); - * }); - * ``` - * - * The HTTP/1 specification forbids trailers from containing HTTP/2 pseudo-header - * fields (e.g. `':method'`, `':path'`, etc). - * @since v10.0.0 - */ - sendTrailers(headers: OutgoingHttpHeaders): void; - addListener(event: "aborted", listener: () => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: Buffer | string) => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - addListener(event: "pipe", listener: (src: stream.Readable) => void): this; - addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - addListener(event: "streamClosed", listener: (code: number) => void): this; - addListener(event: "timeout", listener: () => void): this; - addListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - addListener(event: "wantTrailers", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "aborted"): boolean; - emit(event: "close"): boolean; - emit(event: "data", chunk: Buffer | string): boolean; - emit(event: "drain"): boolean; - emit(event: "end"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "finish"): boolean; - emit(event: "frameError", frameType: number, errorCode: number): boolean; - emit(event: "pipe", src: stream.Readable): boolean; - emit(event: "unpipe", src: stream.Readable): boolean; - emit(event: "streamClosed", code: number): boolean; - emit(event: "timeout"): boolean; - emit(event: "trailers", trailers: IncomingHttpHeaders, flags: number): boolean; - emit(event: "wantTrailers"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "aborted", listener: () => void): this; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: Buffer | string) => void): this; - on(event: "drain", listener: () => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - on(event: "pipe", listener: (src: stream.Readable) => void): this; - on(event: "unpipe", listener: (src: stream.Readable) => void): this; - on(event: "streamClosed", listener: (code: number) => void): this; - on(event: "timeout", listener: () => void): this; - on(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - on(event: "wantTrailers", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "aborted", listener: () => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: Buffer | string) => void): this; - once(event: "drain", listener: () => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - once(event: "pipe", listener: (src: stream.Readable) => void): this; - once(event: "unpipe", listener: (src: stream.Readable) => void): this; - once(event: "streamClosed", listener: (code: number) => void): this; - once(event: "timeout", listener: () => void): this; - once(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - once(event: "wantTrailers", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "aborted", listener: () => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "streamClosed", listener: (code: number) => void): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - prependListener(event: "wantTrailers", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "aborted", listener: () => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "streamClosed", listener: (code: number) => void): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - prependOnceListener(event: "wantTrailers", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface ClientHttp2Stream extends Http2Stream { - addListener(event: "continue", listener: () => {}): this; - addListener( - event: "headers", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - addListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - addListener( - event: "response", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "continue"): boolean; - emit(event: "headers", headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; - emit(event: "push", headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: "response", headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "continue", listener: () => {}): this; - on( - event: "headers", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - on(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - on( - event: "response", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "continue", listener: () => {}): this; - once( - event: "headers", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - once(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - once( - event: "response", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "continue", listener: () => {}): this; - prependListener( - event: "headers", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - prependListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - prependListener( - event: "response", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "continue", listener: () => {}): this; - prependOnceListener( - event: "headers", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - prependOnceListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - prependOnceListener( - event: "response", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface ServerHttp2Stream extends Http2Stream { - /** - * True if headers were sent, false otherwise (read-only). - * @since v8.4.0 - */ - readonly headersSent: boolean; - /** - * Read-only property mapped to the `SETTINGS_ENABLE_PUSH` flag of the remote - * client's most recent `SETTINGS` frame. Will be `true` if the remote peer - * accepts push streams, `false` otherwise. Settings are the same for every `Http2Stream` in the same `Http2Session`. - * @since v8.4.0 - */ - readonly pushAllowed: boolean; - /** - * Sends an additional informational `HEADERS` frame to the connected HTTP/2 peer. - * @since v8.4.0 - */ - additionalHeaders(headers: OutgoingHttpHeaders): void; - /** - * Initiates a push stream. The callback is invoked with the new `Http2Stream` instance created for the push stream passed as the second argument, or an `Error` passed as the first argument. - * - * ```js - * import http2 from 'node:http2'; - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond({ ':status': 200 }); - * stream.pushStream({ ':path': '/' }, (err, pushStream, headers) => { - * if (err) throw err; - * pushStream.respond({ ':status': 200 }); - * pushStream.end('some pushed data'); - * }); - * stream.end('some data'); - * }); - * ``` - * - * Setting the weight of a push stream is not allowed in the `HEADERS` frame. Pass - * a `weight` value to `http2stream.priority` with the `silent` option set to `true` to enable server-side bandwidth balancing between concurrent streams. - * - * Calling `http2stream.pushStream()` from within a pushed stream is not permitted - * and will throw an error. - * @since v8.4.0 - * @param callback Callback that is called once the push stream has been initiated. - */ - pushStream( - headers: OutgoingHttpHeaders, - callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void, - ): void; - pushStream( - headers: OutgoingHttpHeaders, - options?: StreamPriorityOptions, - callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void, - ): void; - /** - * ```js - * import http2 from 'node:http2'; - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond({ ':status': 200 }); - * stream.end('some data'); - * }); - * ``` - * - * Initiates a response. When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * will be emitted immediately after queuing the last chunk of payload data to be sent. - * The `http2stream.sendTrailers()` method can then be used to send trailing header fields to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code must call either `http2stream.sendTrailers()` or `http2stream.close()` to close the `Http2Stream`. - * - * ```js - * import http2 from 'node:http2'; - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond({ ':status': 200 }, { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ ABC: 'some value to send' }); - * }); - * stream.end('some data'); - * }); - * ``` - * @since v8.4.0 - */ - respond(headers?: OutgoingHttpHeaders, options?: ServerStreamResponseOptions): void; - /** - * Initiates a response whose data is read from the given file descriptor. No - * validation is performed on the given file descriptor. If an error occurs while - * attempting to read data using the file descriptor, the `Http2Stream` will be - * closed using an `RST_STREAM` frame using the standard `INTERNAL_ERROR` code. - * - * When used, the `Http2Stream` object's `Duplex` interface will be closed - * automatically. - * - * ```js - * import http2 from 'node:http2'; - * import fs from 'node:fs'; - * - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * const fd = fs.openSync('/some/file', 'r'); - * - * const stat = fs.fstatSync(fd); - * const headers = { - * 'content-length': stat.size, - * 'last-modified': stat.mtime.toUTCString(), - * 'content-type': 'text/plain; charset=utf-8', - * }; - * stream.respondWithFD(fd, headers); - * stream.on('close', () => fs.closeSync(fd)); - * }); - * ``` - * - * The optional `options.statCheck` function may be specified to give user code - * an opportunity to set additional content headers based on the `fs.Stat` details - * of the given fd. If the `statCheck` function is provided, the `http2stream.respondWithFD()` method will - * perform an `fs.fstat()` call to collect details on the provided file descriptor. - * - * The `offset` and `length` options may be used to limit the response to a - * specific range subset. This can be used, for instance, to support HTTP Range - * requests. - * - * The file descriptor or `FileHandle` is not closed when the stream is closed, - * so it will need to be closed manually once it is no longer needed. - * Using the same file descriptor concurrently for multiple streams - * is not supported and may result in data loss. Re-using a file descriptor - * after a stream has finished is supported. - * - * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * will be emitted immediately after queuing the last chunk of payload data to be - * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing - * header fields to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code _must_ call either `http2stream.sendTrailers()` - * or `http2stream.close()` to close the `Http2Stream`. - * - * ```js - * import http2 from 'node:http2'; - * import fs from 'node:fs'; - * - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * const fd = fs.openSync('/some/file', 'r'); - * - * const stat = fs.fstatSync(fd); - * const headers = { - * 'content-length': stat.size, - * 'last-modified': stat.mtime.toUTCString(), - * 'content-type': 'text/plain; charset=utf-8', - * }; - * stream.respondWithFD(fd, headers, { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ ABC: 'some value to send' }); - * }); - * - * stream.on('close', () => fs.closeSync(fd)); - * }); - * ``` - * @since v8.4.0 - * @param fd A readable file descriptor. - */ - respondWithFD( - fd: number | fs.promises.FileHandle, - headers?: OutgoingHttpHeaders, - options?: ServerStreamFileResponseOptions, - ): void; - /** - * Sends a regular file as the response. The `path` must specify a regular file - * or an `'error'` event will be emitted on the `Http2Stream` object. - * - * When used, the `Http2Stream` object's `Duplex` interface will be closed - * automatically. - * - * The optional `options.statCheck` function may be specified to give user code - * an opportunity to set additional content headers based on the `fs.Stat` details - * of the given file: - * - * If an error occurs while attempting to read the file data, the `Http2Stream` will be closed using an - * `RST_STREAM` frame using the standard `INTERNAL_ERROR` code. - * If the `onError` callback is defined, then it will be called. Otherwise, the stream will be destroyed. - * - * Example using a file path: - * - * ```js - * import http2 from 'node:http2'; - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * function statCheck(stat, headers) { - * headers['last-modified'] = stat.mtime.toUTCString(); - * } - * - * function onError(err) { - * // stream.respond() can throw if the stream has been destroyed by - * // the other side. - * try { - * if (err.code === 'ENOENT') { - * stream.respond({ ':status': 404 }); - * } else { - * stream.respond({ ':status': 500 }); - * } - * } catch (err) { - * // Perform actual error handling. - * console.error(err); - * } - * stream.end(); - * } - * - * stream.respondWithFile('/some/file', - * { 'content-type': 'text/plain; charset=utf-8' }, - * { statCheck, onError }); - * }); - * ``` - * - * The `options.statCheck` function may also be used to cancel the send operation - * by returning `false`. For instance, a conditional request may check the stat - * results to determine if the file has been modified to return an appropriate `304` response: - * - * ```js - * import http2 from 'node:http2'; - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * function statCheck(stat, headers) { - * // Check the stat here... - * stream.respond({ ':status': 304 }); - * return false; // Cancel the send operation - * } - * stream.respondWithFile('/some/file', - * { 'content-type': 'text/plain; charset=utf-8' }, - * { statCheck }); - * }); - * ``` - * - * The `content-length` header field will be automatically set. - * - * The `offset` and `length` options may be used to limit the response to a - * specific range subset. This can be used, for instance, to support HTTP Range - * requests. - * - * The `options.onError` function may also be used to handle all the errors - * that could happen before the delivery of the file is initiated. The - * default behavior is to destroy the stream. - * - * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * will be emitted immediately after queuing the last chunk of payload data to be - * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing - * header fields to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. - * - * ```js - * import http2 from 'node:http2'; - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respondWithFile('/some/file', - * { 'content-type': 'text/plain; charset=utf-8' }, - * { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ ABC: 'some value to send' }); - * }); - * }); - * ``` - * @since v8.4.0 - */ - respondWithFile( - path: string, - headers?: OutgoingHttpHeaders, - options?: ServerStreamFileResponseOptionsWithError, - ): void; - } - // Http2Session - export interface Settings { - headerTableSize?: number | undefined; - enablePush?: boolean | undefined; - initialWindowSize?: number | undefined; - maxFrameSize?: number | undefined; - maxConcurrentStreams?: number | undefined; - maxHeaderListSize?: number | undefined; - enableConnectProtocol?: boolean | undefined; - } - export interface ClientSessionRequestOptions { - endStream?: boolean | undefined; - exclusive?: boolean | undefined; - parent?: number | undefined; - weight?: number | undefined; - waitForTrailers?: boolean | undefined; - signal?: AbortSignal | undefined; - } - export interface SessionState { - effectiveLocalWindowSize?: number | undefined; - effectiveRecvDataLength?: number | undefined; - nextStreamID?: number | undefined; - localWindowSize?: number | undefined; - lastProcStreamID?: number | undefined; - remoteWindowSize?: number | undefined; - outboundQueueSize?: number | undefined; - deflateDynamicTableSize?: number | undefined; - inflateDynamicTableSize?: number | undefined; - } - export interface Http2Session extends EventEmitter { - /** - * Value will be `undefined` if the `Http2Session` is not yet connected to a - * socket, `h2c` if the `Http2Session` is not connected to a `TLSSocket`, or - * will return the value of the connected `TLSSocket`'s own `alpnProtocol` property. - * @since v9.4.0 - */ - readonly alpnProtocol?: string | undefined; - /** - * Will be `true` if this `Http2Session` instance has been closed, otherwise `false`. - * @since v9.4.0 - */ - readonly closed: boolean; - /** - * Will be `true` if this `Http2Session` instance is still connecting, will be set - * to `false` before emitting `connect` event and/or calling the `http2.connect` callback. - * @since v10.0.0 - */ - readonly connecting: boolean; - /** - * Will be `true` if this `Http2Session` instance has been destroyed and must no - * longer be used, otherwise `false`. - * @since v8.4.0 - */ - readonly destroyed: boolean; - /** - * Value is `undefined` if the `Http2Session` session socket has not yet been - * connected, `true` if the `Http2Session` is connected with a `TLSSocket`, - * and `false` if the `Http2Session` is connected to any other kind of socket - * or stream. - * @since v9.4.0 - */ - readonly encrypted?: boolean | undefined; - /** - * A prototype-less object describing the current local settings of this `Http2Session`. - * The local settings are local to _this_`Http2Session` instance. - * @since v8.4.0 - */ - readonly localSettings: Settings; - /** - * If the `Http2Session` is connected to a `TLSSocket`, the `originSet` property - * will return an `Array` of origins for which the `Http2Session` may be - * considered authoritative. - * - * The `originSet` property is only available when using a secure TLS connection. - * @since v9.4.0 - */ - readonly originSet?: string[] | undefined; - /** - * Indicates whether the `Http2Session` is currently waiting for acknowledgment of - * a sent `SETTINGS` frame. Will be `true` after calling the `http2session.settings()` method. - * Will be `false` once all sent `SETTINGS` frames have been acknowledged. - * @since v8.4.0 - */ - readonly pendingSettingsAck: boolean; - /** - * A prototype-less object describing the current remote settings of this`Http2Session`. - * The remote settings are set by the _connected_ HTTP/2 peer. - * @since v8.4.0 - */ - readonly remoteSettings: Settings; - /** - * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but - * limits available methods to ones safe to use with HTTP/2. - * - * `destroy`, `emit`, `end`, `pause`, `read`, `resume`, and `write` will throw - * an error with code `ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for more information. - * - * `setTimeout` method will be called on this `Http2Session`. - * - * All other interactions will be routed directly to the socket. - * @since v8.4.0 - */ - readonly socket: net.Socket | tls.TLSSocket; - /** - * Provides miscellaneous information about the current state of the`Http2Session`. - * - * An object describing the current status of this `Http2Session`. - * @since v8.4.0 - */ - readonly state: SessionState; - /** - * The `http2session.type` will be equal to `http2.constants.NGHTTP2_SESSION_SERVER` if this `Http2Session` instance is a - * server, and `http2.constants.NGHTTP2_SESSION_CLIENT` if the instance is a - * client. - * @since v8.4.0 - */ - readonly type: number; - /** - * Gracefully closes the `Http2Session`, allowing any existing streams to - * complete on their own and preventing new `Http2Stream` instances from being - * created. Once closed, `http2session.destroy()`_might_ be called if there - * are no open `Http2Stream` instances. - * - * If specified, the `callback` function is registered as a handler for the`'close'` event. - * @since v9.4.0 - */ - close(callback?: () => void): void; - /** - * Immediately terminates the `Http2Session` and the associated `net.Socket` or `tls.TLSSocket`. - * - * Once destroyed, the `Http2Session` will emit the `'close'` event. If `error` is not undefined, an `'error'` event will be emitted immediately before the `'close'` event. - * - * If there are any remaining open `Http2Streams` associated with the `Http2Session`, those will also be destroyed. - * @since v8.4.0 - * @param error An `Error` object if the `Http2Session` is being destroyed due to an error. - * @param code The HTTP/2 error code to send in the final `GOAWAY` frame. If unspecified, and `error` is not undefined, the default is `INTERNAL_ERROR`, otherwise defaults to `NO_ERROR`. - */ - destroy(error?: Error, code?: number): void; - /** - * Transmits a `GOAWAY` frame to the connected peer _without_ shutting down the`Http2Session`. - * @since v9.4.0 - * @param code An HTTP/2 error code - * @param lastStreamID The numeric ID of the last processed `Http2Stream` - * @param opaqueData A `TypedArray` or `DataView` instance containing additional data to be carried within the `GOAWAY` frame. - */ - goaway(code?: number, lastStreamID?: number, opaqueData?: NodeJS.ArrayBufferView): void; - /** - * Sends a `PING` frame to the connected HTTP/2 peer. A `callback` function must - * be provided. The method will return `true` if the `PING` was sent, `false` otherwise. - * - * The maximum number of outstanding (unacknowledged) pings is determined by the `maxOutstandingPings` configuration option. The default maximum is 10. - * - * If provided, the `payload` must be a `Buffer`, `TypedArray`, or `DataView` containing 8 bytes of data that will be transmitted with the `PING` and - * returned with the ping acknowledgment. - * - * The callback will be invoked with three arguments: an error argument that will - * be `null` if the `PING` was successfully acknowledged, a `duration` argument - * that reports the number of milliseconds elapsed since the ping was sent and the - * acknowledgment was received, and a `Buffer` containing the 8-byte `PING` payload. - * - * ```js - * session.ping(Buffer.from('abcdefgh'), (err, duration, payload) => { - * if (!err) { - * console.log(`Ping acknowledged in ${duration} milliseconds`); - * console.log(`With payload '${payload.toString()}'`); - * } - * }); - * ``` - * - * If the `payload` argument is not specified, the default payload will be the - * 64-bit timestamp (little endian) marking the start of the `PING` duration. - * @since v8.9.3 - * @param payload Optional ping payload. - */ - ping(callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean; - ping( - payload: NodeJS.ArrayBufferView, - callback: (err: Error | null, duration: number, payload: Buffer) => void, - ): boolean; - /** - * Calls `ref()` on this `Http2Session` instance's underlying `net.Socket`. - * @since v9.4.0 - */ - ref(): void; - /** - * Sets the local endpoint's window size. - * The `windowSize` is the total window size to set, not - * the delta. - * - * ```js - * import http2 from 'node:http2'; - * - * const server = http2.createServer(); - * const expectedWindowSize = 2 ** 20; - * server.on('connect', (session) => { - * - * // Set local window size to be 2 ** 20 - * session.setLocalWindowSize(expectedWindowSize); - * }); - * ``` - * @since v15.3.0, v14.18.0 - */ - setLocalWindowSize(windowSize: number): void; - /** - * Used to set a callback function that is called when there is no activity on - * the `Http2Session` after `msecs` milliseconds. The given `callback` is - * registered as a listener on the `'timeout'` event. - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - /** - * Updates the current local settings for this `Http2Session` and sends a new `SETTINGS` frame to the connected HTTP/2 peer. - * - * Once called, the `http2session.pendingSettingsAck` property will be `true` while the session is waiting for the remote peer to acknowledge the new - * settings. - * - * The new settings will not become effective until the `SETTINGS` acknowledgment - * is received and the `'localSettings'` event is emitted. It is possible to send - * multiple `SETTINGS` frames while acknowledgment is still pending. - * @since v8.4.0 - * @param callback Callback that is called once the session is connected or right away if the session is already connected. - */ - settings( - settings: Settings, - callback?: (err: Error | null, settings: Settings, duration: number) => void, - ): void; - /** - * Calls `unref()` on this `Http2Session`instance's underlying `net.Socket`. - * @since v9.4.0 - */ - unref(): void; - addListener(event: "close", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener( - event: "frameError", - listener: (frameType: number, errorCode: number, streamID: number) => void, - ): this; - addListener( - event: "goaway", - listener: (errorCode: number, lastStreamID: number, opaqueData?: Buffer) => void, - ): this; - addListener(event: "localSettings", listener: (settings: Settings) => void): this; - addListener(event: "ping", listener: () => void): this; - addListener(event: "remoteSettings", listener: (settings: Settings) => void): this; - addListener(event: "timeout", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "close"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "frameError", frameType: number, errorCode: number, streamID: number): boolean; - emit(event: "goaway", errorCode: number, lastStreamID: number, opaqueData?: Buffer): boolean; - emit(event: "localSettings", settings: Settings): boolean; - emit(event: "ping"): boolean; - emit(event: "remoteSettings", settings: Settings): boolean; - emit(event: "timeout"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "close", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; - on(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData?: Buffer) => void): this; - on(event: "localSettings", listener: (settings: Settings) => void): this; - on(event: "ping", listener: () => void): this; - on(event: "remoteSettings", listener: (settings: Settings) => void): this; - on(event: "timeout", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; - once(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData?: Buffer) => void): this; - once(event: "localSettings", listener: (settings: Settings) => void): this; - once(event: "ping", listener: () => void): this; - once(event: "remoteSettings", listener: (settings: Settings) => void): this; - once(event: "timeout", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener( - event: "frameError", - listener: (frameType: number, errorCode: number, streamID: number) => void, - ): this; - prependListener( - event: "goaway", - listener: (errorCode: number, lastStreamID: number, opaqueData?: Buffer) => void, - ): this; - prependListener(event: "localSettings", listener: (settings: Settings) => void): this; - prependListener(event: "ping", listener: () => void): this; - prependListener(event: "remoteSettings", listener: (settings: Settings) => void): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener( - event: "frameError", - listener: (frameType: number, errorCode: number, streamID: number) => void, - ): this; - prependOnceListener( - event: "goaway", - listener: (errorCode: number, lastStreamID: number, opaqueData?: Buffer) => void, - ): this; - prependOnceListener(event: "localSettings", listener: (settings: Settings) => void): this; - prependOnceListener(event: "ping", listener: () => void): this; - prependOnceListener(event: "remoteSettings", listener: (settings: Settings) => void): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface ClientHttp2Session extends Http2Session { - /** - * For HTTP/2 Client `Http2Session` instances only, the `http2session.request()` creates and returns an `Http2Stream` instance that can be used to send an - * HTTP/2 request to the connected server. - * - * When a `ClientHttp2Session` is first created, the socket may not yet be - * connected. if `clienthttp2session.request()` is called during this time, the - * actual request will be deferred until the socket is ready to go. - * If the `session` is closed before the actual request be executed, an `ERR_HTTP2_GOAWAY_SESSION` is thrown. - * - * This method is only available if `http2session.type` is equal to `http2.constants.NGHTTP2_SESSION_CLIENT`. - * - * ```js - * import http2 from 'node:http2'; - * const clientSession = http2.connect('https://localhost:1234'); - * const { - * HTTP2_HEADER_PATH, - * HTTP2_HEADER_STATUS, - * } = http2.constants; - * - * const req = clientSession.request({ [HTTP2_HEADER_PATH]: '/' }); - * req.on('response', (headers) => { - * console.log(headers[HTTP2_HEADER_STATUS]); - * req.on('data', (chunk) => { // .. }); - * req.on('end', () => { // .. }); - * }); - * ``` - * - * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * is emitted immediately after queuing the last chunk of payload data to be sent. - * The `http2stream.sendTrailers()` method can then be called to send trailing - * headers to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. - * - * When `options.signal` is set with an `AbortSignal` and then `abort` on the - * corresponding `AbortController` is called, the request will emit an `'error'`event with an `AbortError` error. - * - * The `:method` and `:path` pseudo-headers are not specified within `headers`, - * they respectively default to: - * - * * `:method` \= `'GET'` - * * `:path` \= `/` - * @since v8.4.0 - */ - request(headers?: OutgoingHttpHeaders, options?: ClientSessionRequestOptions): ClientHttp2Stream; - addListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - addListener(event: "origin", listener: (origins: string[]) => void): this; - addListener( - event: "connect", - listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - addListener( - event: "stream", - listener: ( - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ) => void, - ): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "altsvc", alt: string, origin: string, stream: number): boolean; - emit(event: "origin", origins: readonly string[]): boolean; - emit(event: "connect", session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; - emit( - event: "stream", - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - on(event: "origin", listener: (origins: string[]) => void): this; - on(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - on( - event: "stream", - listener: ( - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ) => void, - ): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - once(event: "origin", listener: (origins: string[]) => void): this; - once( - event: "connect", - listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - once( - event: "stream", - listener: ( - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ) => void, - ): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - prependListener(event: "origin", listener: (origins: string[]) => void): this; - prependListener( - event: "connect", - listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - prependListener( - event: "stream", - listener: ( - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ) => void, - ): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - prependOnceListener(event: "origin", listener: (origins: string[]) => void): this; - prependOnceListener( - event: "connect", - listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - prependOnceListener( - event: "stream", - listener: ( - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ) => void, - ): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface AlternativeServiceOptions { - origin: number | string | url.URL; - } - export interface ServerHttp2Session< - Http1Request extends typeof IncomingMessage = typeof IncomingMessage, - Http1Response extends typeof ServerResponse> = typeof ServerResponse, - Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, - Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, - > extends Http2Session { - readonly server: - | Http2Server - | Http2SecureServer; - /** - * Submits an `ALTSVC` frame (as defined by [RFC 7838](https://tools.ietf.org/html/rfc7838)) to the connected client. - * - * ```js - * import http2 from 'node:http2'; - * - * const server = http2.createServer(); - * server.on('session', (session) => { - * // Set altsvc for origin https://example.org:80 - * session.altsvc('h2=":8000"', 'https://example.org:80'); - * }); - * - * server.on('stream', (stream) => { - * // Set altsvc for a specific stream - * stream.session.altsvc('h2=":8000"', stream.id); - * }); - * ``` - * - * Sending an `ALTSVC` frame with a specific stream ID indicates that the alternate - * service is associated with the origin of the given `Http2Stream`. - * - * The `alt` and origin string _must_ contain only ASCII bytes and are - * strictly interpreted as a sequence of ASCII bytes. The special value `'clear'`may be passed to clear any previously set alternative service for a given - * domain. - * - * When a string is passed for the `originOrStream` argument, it will be parsed as - * a URL and the origin will be derived. For instance, the origin for the - * HTTP URL `'https://example.org/foo/bar'` is the ASCII string`'https://example.org'`. An error will be thrown if either the given string - * cannot be parsed as a URL or if a valid origin cannot be derived. - * - * A `URL` object, or any object with an `origin` property, may be passed as`originOrStream`, in which case the value of the `origin` property will be - * used. The value of the `origin` property _must_ be a properly serialized - * ASCII origin. - * @since v9.4.0 - * @param alt A description of the alternative service configuration as defined by `RFC 7838`. - * @param originOrStream Either a URL string specifying the origin (or an `Object` with an `origin` property) or the numeric identifier of an active `Http2Stream` as given by the - * `http2stream.id` property. - */ - altsvc(alt: string, originOrStream: number | string | url.URL | AlternativeServiceOptions): void; - /** - * Submits an `ORIGIN` frame (as defined by [RFC 8336](https://tools.ietf.org/html/rfc8336)) to the connected client - * to advertise the set of origins for which the server is capable of providing - * authoritative responses. - * - * ```js - * import http2 from 'node:http2'; - * const options = getSecureOptionsSomehow(); - * const server = http2.createSecureServer(options); - * server.on('stream', (stream) => { - * stream.respond(); - * stream.end('ok'); - * }); - * server.on('session', (session) => { - * session.origin('https://example.com', 'https://example.org'); - * }); - * ``` - * - * When a string is passed as an `origin`, it will be parsed as a URL and the - * origin will be derived. For instance, the origin for the HTTP URL `'https://example.org/foo/bar'` is the ASCII string` 'https://example.org'`. An error will be thrown if either the given - * string - * cannot be parsed as a URL or if a valid origin cannot be derived. - * - * A `URL` object, or any object with an `origin` property, may be passed as - * an `origin`, in which case the value of the `origin` property will be - * used. The value of the `origin` property _must_ be a properly serialized - * ASCII origin. - * - * Alternatively, the `origins` option may be used when creating a new HTTP/2 - * server using the `http2.createSecureServer()` method: - * - * ```js - * import http2 from 'node:http2'; - * const options = getSecureOptionsSomehow(); - * options.origins = ['https://example.com', 'https://example.org']; - * const server = http2.createSecureServer(options); - * server.on('stream', (stream) => { - * stream.respond(); - * stream.end('ok'); - * }); - * ``` - * @since v10.12.0 - * @param origins One or more URL Strings passed as separate arguments. - */ - origin( - ...origins: Array< - | string - | url.URL - | { - origin: string; - } - > - ): void; - addListener( - event: "connect", - listener: ( - session: ServerHttp2Session, - socket: net.Socket | tls.TLSSocket, - ) => void, - ): this; - addListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit( - event: "connect", - session: ServerHttp2Session, - socket: net.Socket | tls.TLSSocket, - ): boolean; - emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on( - event: "connect", - listener: ( - session: ServerHttp2Session, - socket: net.Socket | tls.TLSSocket, - ) => void, - ): this; - on( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once( - event: "connect", - listener: ( - session: ServerHttp2Session, - socket: net.Socket | tls.TLSSocket, - ) => void, - ): this; - once( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener( - event: "connect", - listener: ( - session: ServerHttp2Session, - socket: net.Socket | tls.TLSSocket, - ) => void, - ): this; - prependListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener( - event: "connect", - listener: ( - session: ServerHttp2Session, - socket: net.Socket | tls.TLSSocket, - ) => void, - ): this; - prependOnceListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - // Http2Server - export interface SessionOptions { - maxDeflateDynamicTableSize?: number | undefined; - maxSessionMemory?: number | undefined; - maxHeaderListPairs?: number | undefined; - maxOutstandingPings?: number | undefined; - maxSendHeaderBlockLength?: number | undefined; - paddingStrategy?: number | undefined; - peerMaxConcurrentStreams?: number | undefined; - settings?: Settings | undefined; - remoteCustomSettings?: number[] | undefined; - /** - * Specifies a timeout in milliseconds that - * a server should wait when an [`'unknownProtocol'`][] is emitted. If the - * socket has not been destroyed by that time the server will destroy it. - * @default 100000 - */ - unknownProtocolTimeout?: number | undefined; - selectPadding?(frameLen: number, maxFrameLen: number): number; - } - export interface ClientSessionOptions extends SessionOptions { - maxReservedRemoteStreams?: number | undefined; - createConnection?: ((authority: url.URL, option: SessionOptions) => stream.Duplex) | undefined; - protocol?: "http:" | "https:" | undefined; - } - export interface ServerSessionOptions< - Http1Request extends typeof IncomingMessage = typeof IncomingMessage, - Http1Response extends typeof ServerResponse> = typeof ServerResponse, - Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, - Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, - > extends SessionOptions { - Http1IncomingMessage?: Http1Request | undefined; - Http1ServerResponse?: Http1Response | undefined; - Http2ServerRequest?: Http2Request | undefined; - Http2ServerResponse?: Http2Response | undefined; - } - export interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions {} - export interface SecureServerSessionOptions< - Http1Request extends typeof IncomingMessage = typeof IncomingMessage, - Http1Response extends typeof ServerResponse> = typeof ServerResponse, - Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, - Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, - > extends ServerSessionOptions, tls.TlsOptions {} - export interface ServerOptions< - Http1Request extends typeof IncomingMessage = typeof IncomingMessage, - Http1Response extends typeof ServerResponse> = typeof ServerResponse, - Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, - Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, - > extends ServerSessionOptions {} - export interface SecureServerOptions< - Http1Request extends typeof IncomingMessage = typeof IncomingMessage, - Http1Response extends typeof ServerResponse> = typeof ServerResponse, - Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, - Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, - > extends SecureServerSessionOptions { - allowHTTP1?: boolean | undefined; - origins?: string[] | undefined; - } - interface HTTP2ServerCommon { - setTimeout(msec?: number, callback?: () => void): this; - /** - * Throws ERR_HTTP2_INVALID_SETTING_VALUE for invalid settings values. - * Throws ERR_INVALID_ARG_TYPE for invalid settings argument. - */ - updateSettings(settings: Settings): void; - } - export interface Http2Server< - Http1Request extends typeof IncomingMessage = typeof IncomingMessage, - Http1Response extends typeof ServerResponse> = typeof ServerResponse, - Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, - Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, - > extends net.Server, HTTP2ServerCommon { - addListener( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - addListener( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - addListener( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - addListener(event: "sessionError", listener: (err: Error) => void): this; - addListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - addListener(event: "timeout", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit( - event: "checkContinue", - request: InstanceType, - response: InstanceType, - ): boolean; - emit(event: "request", request: InstanceType, response: InstanceType): boolean; - emit( - event: "session", - session: ServerHttp2Session, - ): boolean; - emit(event: "sessionError", err: Error): boolean; - emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: "timeout"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - on( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - on( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - on(event: "sessionError", listener: (err: Error) => void): this; - on( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - on(event: "timeout", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - once( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - once( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - once(event: "sessionError", listener: (err: Error) => void): this; - once( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - once(event: "timeout", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - prependListener( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - prependListener( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - prependListener(event: "sessionError", listener: (err: Error) => void): this; - prependListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - prependOnceListener( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - prependOnceListener( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - prependOnceListener(event: "sessionError", listener: (err: Error) => void): this; - prependOnceListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface Http2SecureServer< - Http1Request extends typeof IncomingMessage = typeof IncomingMessage, - Http1Response extends typeof ServerResponse> = typeof ServerResponse, - Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, - Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, - > extends tls.Server, HTTP2ServerCommon { - addListener( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - addListener( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - addListener( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - addListener(event: "sessionError", listener: (err: Error) => void): this; - addListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - addListener(event: "timeout", listener: () => void): this; - addListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit( - event: "checkContinue", - request: InstanceType, - response: InstanceType, - ): boolean; - emit(event: "request", request: InstanceType, response: InstanceType): boolean; - emit( - event: "session", - session: ServerHttp2Session, - ): boolean; - emit(event: "sessionError", err: Error): boolean; - emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: "timeout"): boolean; - emit(event: "unknownProtocol", socket: tls.TLSSocket): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - on( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - on( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - on(event: "sessionError", listener: (err: Error) => void): this; - on( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - on(event: "timeout", listener: () => void): this; - on(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - once( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - once( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - once(event: "sessionError", listener: (err: Error) => void): this; - once( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - once(event: "timeout", listener: () => void): this; - once(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - prependListener( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - prependListener( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - prependListener(event: "sessionError", listener: (err: Error) => void): this; - prependListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - prependOnceListener( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - prependOnceListener( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - prependOnceListener(event: "sessionError", listener: (err: Error) => void): this; - prependOnceListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * A `Http2ServerRequest` object is created by {@link Server} or {@link SecureServer} and passed as the first argument to the `'request'` event. It may be used to access a request status, - * headers, and - * data. - * @since v8.4.0 - */ - export class Http2ServerRequest extends stream.Readable { - constructor( - stream: ServerHttp2Stream, - headers: IncomingHttpHeaders, - options: stream.ReadableOptions, - rawHeaders: readonly string[], - ); - /** - * The `request.aborted` property will be `true` if the request has - * been aborted. - * @since v10.1.0 - */ - readonly aborted: boolean; - /** - * The request authority pseudo header field. Because HTTP/2 allows requests - * to set either `:authority` or `host`, this value is derived from `req.headers[':authority']` if present. Otherwise, it is derived from `req.headers['host']`. - * @since v8.4.0 - */ - readonly authority: string; - /** - * See `request.socket`. - * @since v8.4.0 - * @deprecated Since v13.0.0 - Use `socket`. - */ - readonly connection: net.Socket | tls.TLSSocket; - /** - * The `request.complete` property will be `true` if the request has - * been completed, aborted, or destroyed. - * @since v12.10.0 - */ - readonly complete: boolean; - /** - * The request/response headers object. - * - * Key-value pairs of header names and values. Header names are lower-cased. - * - * ```js - * // Prints something like: - * // - * // { 'user-agent': 'curl/7.22.0', - * // host: '127.0.0.1:8000', - * // accept: '*' } - * console.log(request.headers); - * ``` - * - * See `HTTP/2 Headers Object`. - * - * In HTTP/2, the request path, host name, protocol, and method are represented as - * special headers prefixed with the `:` character (e.g. `':path'`). These special - * headers will be included in the `request.headers` object. Care must be taken not - * to inadvertently modify these special headers or errors may occur. For instance, - * removing all headers from the request will cause errors to occur: - * - * ```js - * removeAllHeaders(request.headers); - * assert(request.url); // Fails because the :path header has been removed - * ``` - * @since v8.4.0 - */ - readonly headers: IncomingHttpHeaders; - /** - * In case of server request, the HTTP version sent by the client. In the case of - * client response, the HTTP version of the connected-to server. Returns `'2.0'`. - * - * Also `message.httpVersionMajor` is the first integer and `message.httpVersionMinor` is the second. - * @since v8.4.0 - */ - readonly httpVersion: string; - readonly httpVersionMinor: number; - readonly httpVersionMajor: number; - /** - * The request method as a string. Read-only. Examples: `'GET'`, `'DELETE'`. - * @since v8.4.0 - */ - readonly method: string; - /** - * The raw request/response headers list exactly as they were received. - * - * The keys and values are in the same list. It is _not_ a - * list of tuples. So, the even-numbered offsets are key values, and the - * odd-numbered offsets are the associated values. - * - * Header names are not lowercased, and duplicates are not merged. - * - * ```js - * // Prints something like: - * // - * // [ 'user-agent', - * // 'this is invalid because there can be only one', - * // 'User-Agent', - * // 'curl/7.22.0', - * // 'Host', - * // '127.0.0.1:8000', - * // 'ACCEPT', - * // '*' ] - * console.log(request.rawHeaders); - * ``` - * @since v8.4.0 - */ - readonly rawHeaders: string[]; - /** - * The raw request/response trailer keys and values exactly as they were - * received. Only populated at the `'end'` event. - * @since v8.4.0 - */ - readonly rawTrailers: string[]; - /** - * The request scheme pseudo header field indicating the scheme - * portion of the target URL. - * @since v8.4.0 - */ - readonly scheme: string; - /** - * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but - * applies getters, setters, and methods based on HTTP/2 logic. - * - * `destroyed`, `readable`, and `writable` properties will be retrieved from and - * set on `request.stream`. - * - * `destroy`, `emit`, `end`, `on` and `once` methods will be called on `request.stream`. - * - * `setTimeout` method will be called on `request.stream.session`. - * - * `pause`, `read`, `resume`, and `write` will throw an error with code `ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for - * more information. - * - * All other interactions will be routed directly to the socket. With TLS support, - * use `request.socket.getPeerCertificate()` to obtain the client's - * authentication details. - * @since v8.4.0 - */ - readonly socket: net.Socket | tls.TLSSocket; - /** - * The `Http2Stream` object backing the request. - * @since v8.4.0 - */ - readonly stream: ServerHttp2Stream; - /** - * The request/response trailers object. Only populated at the `'end'` event. - * @since v8.4.0 - */ - readonly trailers: IncomingHttpHeaders; - /** - * Request URL string. This contains only the URL that is present in the actual - * HTTP request. If the request is: - * - * ```http - * GET /status?name=ryan HTTP/1.1 - * Accept: text/plain - * ``` - * - * Then `request.url` will be: - * - * ```js - * '/status?name=ryan' - * ``` - * - * To parse the url into its parts, `new URL()` can be used: - * - * ```console - * $ node - * > new URL('/status?name=ryan', 'http://example.com') - * URL { - * href: 'http://example.com/status?name=ryan', - * origin: 'http://example.com', - * protocol: 'http:', - * username: '', - * password: '', - * host: 'example.com', - * hostname: 'example.com', - * port: '', - * pathname: '/status', - * search: '?name=ryan', - * searchParams: URLSearchParams { 'name' => 'ryan' }, - * hash: '' - * } - * ``` - * @since v8.4.0 - */ - url: string; - /** - * Sets the `Http2Stream`'s timeout value to `msecs`. If a callback is - * provided, then it is added as a listener on the `'timeout'` event on - * the response object. - * - * If no `'timeout'` listener is added to the request, the response, or - * the server, then `Http2Stream`s are destroyed when they time out. If a - * handler is assigned to the request, the response, or the server's `'timeout'`events, timed out sockets must be handled explicitly. - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - read(size?: number): Buffer | string | null; - addListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: Buffer | string) => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "readable", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "aborted", hadError: boolean, code: number): boolean; - emit(event: "close"): boolean; - emit(event: "data", chunk: Buffer | string): boolean; - emit(event: "end"): boolean; - emit(event: "readable"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: Buffer | string) => void): this; - on(event: "end", listener: () => void): this; - on(event: "readable", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: Buffer | string) => void): this; - once(event: "end", listener: () => void): this; - once(event: "readable", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "readable", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "readable", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * This object is created internally by an HTTP server, not by the user. It is - * passed as the second parameter to the `'request'` event. - * @since v8.4.0 - */ - export class Http2ServerResponse extends stream.Writable { - constructor(stream: ServerHttp2Stream); - /** - * See `response.socket`. - * @since v8.4.0 - * @deprecated Since v13.0.0 - Use `socket`. - */ - readonly connection: net.Socket | tls.TLSSocket; - /** - * Append a single header value to the header object. - * - * If the value is an array, this is equivalent to calling this method multiple times. - * - * If there were no previous values for the header, this is equivalent to calling {@link setHeader}. - * - * Attempting to set a header field name or value that contains invalid characters will result in a - * [TypeError](https://nodejs.org/docs/latest-v22.x/api/errors.html#class-typeerror) being thrown. - * - * ```js - * // Returns headers including "set-cookie: a" and "set-cookie: b" - * const server = http2.createServer((req, res) => { - * res.setHeader('set-cookie', 'a'); - * res.appendHeader('set-cookie', 'b'); - * res.writeHead(200); - * res.end('ok'); - * }); - * ``` - * @since v20.12.0 - */ - appendHeader(name: string, value: string | string[]): void; - /** - * Boolean value that indicates whether the response has completed. Starts - * as `false`. After `response.end()` executes, the value will be `true`. - * @since v8.4.0 - * @deprecated Since v13.4.0,v12.16.0 - Use `writableEnded`. - */ - readonly finished: boolean; - /** - * True if headers were sent, false otherwise (read-only). - * @since v8.4.0 - */ - readonly headersSent: boolean; - /** - * A reference to the original HTTP2 `request` object. - * @since v15.7.0 - */ - readonly req: Request; - /** - * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but - * applies getters, setters, and methods based on HTTP/2 logic. - * - * `destroyed`, `readable`, and `writable` properties will be retrieved from and - * set on `response.stream`. - * - * `destroy`, `emit`, `end`, `on` and `once` methods will be called on `response.stream`. - * - * `setTimeout` method will be called on `response.stream.session`. - * - * `pause`, `read`, `resume`, and `write` will throw an error with code `ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for - * more information. - * - * All other interactions will be routed directly to the socket. - * - * ```js - * import http2 from 'node:http2'; - * const server = http2.createServer((req, res) => { - * const ip = req.socket.remoteAddress; - * const port = req.socket.remotePort; - * res.end(`Your IP address is ${ip} and your source port is ${port}.`); - * }).listen(3000); - * ``` - * @since v8.4.0 - */ - readonly socket: net.Socket | tls.TLSSocket; - /** - * The `Http2Stream` object backing the response. - * @since v8.4.0 - */ - readonly stream: ServerHttp2Stream; - /** - * When true, the Date header will be automatically generated and sent in - * the response if it is not already present in the headers. Defaults to true. - * - * This should only be disabled for testing; HTTP requires the Date header - * in responses. - * @since v8.4.0 - */ - sendDate: boolean; - /** - * When using implicit headers (not calling `response.writeHead()` explicitly), - * this property controls the status code that will be sent to the client when - * the headers get flushed. - * - * ```js - * response.statusCode = 404; - * ``` - * - * After response header was sent to the client, this property indicates the - * status code which was sent out. - * @since v8.4.0 - */ - statusCode: number; - /** - * Status message is not supported by HTTP/2 (RFC 7540 8.1.2.4). It returns - * an empty string. - * @since v8.4.0 - */ - statusMessage: ""; - /** - * This method adds HTTP trailing headers (a header but at the end of the - * message) to the response. - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * @since v8.4.0 - */ - addTrailers(trailers: OutgoingHttpHeaders): void; - /** - * This method signals to the server that all of the response headers and body - * have been sent; that server should consider this message complete. - * The method, `response.end()`, MUST be called on each response. - * - * If `data` is specified, it is equivalent to calling `response.write(data, encoding)` followed by `response.end(callback)`. - * - * If `callback` is specified, it will be called when the response stream - * is finished. - * @since v8.4.0 - */ - end(callback?: () => void): this; - end(data: string | Uint8Array, callback?: () => void): this; - end(data: string | Uint8Array, encoding: BufferEncoding, callback?: () => void): this; - /** - * Reads out a header that has already been queued but not sent to the client. - * The name is case-insensitive. - * - * ```js - * const contentType = response.getHeader('content-type'); - * ``` - * @since v8.4.0 - */ - getHeader(name: string): string; - /** - * Returns an array containing the unique names of the current outgoing headers. - * All header names are lowercase. - * - * ```js - * response.setHeader('Foo', 'bar'); - * response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headerNames = response.getHeaderNames(); - * // headerNames === ['foo', 'set-cookie'] - * ``` - * @since v8.4.0 - */ - getHeaderNames(): string[]; - /** - * Returns a shallow copy of the current outgoing headers. Since a shallow copy - * is used, array values may be mutated without additional calls to various - * header-related http module methods. The keys of the returned object are the - * header names and the values are the respective header values. All header names - * are lowercase. - * - * The object returned by the `response.getHeaders()` method _does not_ prototypically inherit from the JavaScript `Object`. This means that typical `Object` methods such as `obj.toString()`, - * `obj.hasOwnProperty()`, and others - * are not defined and _will not work_. - * - * ```js - * response.setHeader('Foo', 'bar'); - * response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headers = response.getHeaders(); - * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] } - * ``` - * @since v8.4.0 - */ - getHeaders(): OutgoingHttpHeaders; - /** - * Returns `true` if the header identified by `name` is currently set in the - * outgoing headers. The header name matching is case-insensitive. - * - * ```js - * const hasContentType = response.hasHeader('content-type'); - * ``` - * @since v8.4.0 - */ - hasHeader(name: string): boolean; - /** - * Removes a header that has been queued for implicit sending. - * - * ```js - * response.removeHeader('Content-Encoding'); - * ``` - * @since v8.4.0 - */ - removeHeader(name: string): void; - /** - * Sets a single header value for implicit headers. If this header already exists - * in the to-be-sent headers, its value will be replaced. Use an array of strings - * here to send multiple headers with the same name. - * - * ```js - * response.setHeader('Content-Type', 'text/html; charset=utf-8'); - * ``` - * - * or - * - * ```js - * response.setHeader('Set-Cookie', ['type=ninja', 'language=javascript']); - * ``` - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * - * When headers have been set with `response.setHeader()`, they will be merged - * with any headers passed to `response.writeHead()`, with the headers passed - * to `response.writeHead()` given precedence. - * - * ```js - * // Returns content-type = text/plain - * const server = http2.createServer((req, res) => { - * res.setHeader('Content-Type', 'text/html; charset=utf-8'); - * res.setHeader('X-Foo', 'bar'); - * res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' }); - * res.end('ok'); - * }); - * ``` - * @since v8.4.0 - */ - setHeader(name: string, value: number | string | readonly string[]): void; - /** - * Sets the `Http2Stream`'s timeout value to `msecs`. If a callback is - * provided, then it is added as a listener on the `'timeout'` event on - * the response object. - * - * If no `'timeout'` listener is added to the request, the response, or - * the server, then `Http2Stream` s are destroyed when they time out. If a - * handler is assigned to the request, the response, or the server's `'timeout'` events, timed out sockets must be handled explicitly. - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - /** - * If this method is called and `response.writeHead()` has not been called, - * it will switch to implicit header mode and flush the implicit headers. - * - * This sends a chunk of the response body. This method may - * be called multiple times to provide successive parts of the body. - * - * In the `node:http` module, the response body is omitted when the - * request is a HEAD request. Similarly, the `204` and `304` responses _must not_ include a message body. - * - * `chunk` can be a string or a buffer. If `chunk` is a string, - * the second parameter specifies how to encode it into a byte stream. - * By default the `encoding` is `'utf8'`. `callback` will be called when this chunk - * of data is flushed. - * - * This is the raw HTTP body and has nothing to do with higher-level multi-part - * body encodings that may be used. - * - * The first time `response.write()` is called, it will send the buffered - * header information and the first chunk of the body to the client. The second - * time `response.write()` is called, Node.js assumes data will be streamed, - * and sends the new data separately. That is, the response is buffered up to the - * first chunk of the body. - * - * Returns `true` if the entire data was flushed successfully to the kernel - * buffer. Returns `false` if all or part of the data was queued in user memory.`'drain'` will be emitted when the buffer is free again. - * @since v8.4.0 - */ - write(chunk: string | Uint8Array, callback?: (err: Error) => void): boolean; - write(chunk: string | Uint8Array, encoding: BufferEncoding, callback?: (err: Error) => void): boolean; - /** - * Sends a status `100 Continue` to the client, indicating that the request body - * should be sent. See the `'checkContinue'` event on `Http2Server` and `Http2SecureServer`. - * @since v8.4.0 - */ - writeContinue(): void; - /** - * Sends a status `103 Early Hints` to the client with a Link header, - * indicating that the user agent can preload/preconnect the linked resources. - * The `hints` is an object containing the values of headers to be sent with - * early hints message. - * - * **Example** - * - * ```js - * const earlyHintsLink = '; rel=preload; as=style'; - * response.writeEarlyHints({ - * 'link': earlyHintsLink, - * }); - * - * const earlyHintsLinks = [ - * '; rel=preload; as=style', - * '; rel=preload; as=script', - * ]; - * response.writeEarlyHints({ - * 'link': earlyHintsLinks, - * }); - * ``` - * @since v18.11.0 - */ - writeEarlyHints(hints: Record): void; - /** - * Sends a response header to the request. The status code is a 3-digit HTTP - * status code, like `404`. The last argument, `headers`, are the response headers. - * - * Returns a reference to the `Http2ServerResponse`, so that calls can be chained. - * - * For compatibility with `HTTP/1`, a human-readable `statusMessage` may be - * passed as the second argument. However, because the `statusMessage` has no - * meaning within HTTP/2, the argument will have no effect and a process warning - * will be emitted. - * - * ```js - * const body = 'hello world'; - * response.writeHead(200, { - * 'Content-Length': Buffer.byteLength(body), - * 'Content-Type': 'text/plain; charset=utf-8', - * }); - * ``` - * - * `Content-Length` is given in bytes not characters. The`Buffer.byteLength()` API may be used to determine the number of bytes in a - * given encoding. On outbound messages, Node.js does not check if Content-Length - * and the length of the body being transmitted are equal or not. However, when - * receiving messages, Node.js will automatically reject messages when the `Content-Length` does not match the actual payload size. - * - * This method may be called at most one time on a message before `response.end()` is called. - * - * If `response.write()` or `response.end()` are called before calling - * this, the implicit/mutable headers will be calculated and call this function. - * - * When headers have been set with `response.setHeader()`, they will be merged - * with any headers passed to `response.writeHead()`, with the headers passed - * to `response.writeHead()` given precedence. - * - * ```js - * // Returns content-type = text/plain - * const server = http2.createServer((req, res) => { - * res.setHeader('Content-Type', 'text/html; charset=utf-8'); - * res.setHeader('X-Foo', 'bar'); - * res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' }); - * res.end('ok'); - * }); - * ``` - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * @since v8.4.0 - */ - writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this; - writeHead(statusCode: number, statusMessage: string, headers?: OutgoingHttpHeaders): this; - /** - * Call `http2stream.pushStream()` with the given headers, and wrap the - * given `Http2Stream` on a newly created `Http2ServerResponse` as the callback - * parameter if successful. When `Http2ServerRequest` is closed, the callback is - * called with an error `ERR_HTTP2_INVALID_STREAM`. - * @since v8.4.0 - * @param headers An object describing the headers - * @param callback Called once `http2stream.pushStream()` is finished, or either when the attempt to create the pushed `Http2Stream` has failed or has been rejected, or the state of - * `Http2ServerRequest` is closed prior to calling the `http2stream.pushStream()` method - */ - createPushResponse( - headers: OutgoingHttpHeaders, - callback: (err: Error | null, res: Http2ServerResponse) => void, - ): void; - addListener(event: "close", listener: () => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "error", listener: (error: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "pipe", listener: (src: stream.Readable) => void): this; - addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "close"): boolean; - emit(event: "drain"): boolean; - emit(event: "error", error: Error): boolean; - emit(event: "finish"): boolean; - emit(event: "pipe", src: stream.Readable): boolean; - emit(event: "unpipe", src: stream.Readable): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "close", listener: () => void): this; - on(event: "drain", listener: () => void): this; - on(event: "error", listener: (error: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "pipe", listener: (src: stream.Readable) => void): this; - on(event: "unpipe", listener: (src: stream.Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "drain", listener: () => void): this; - once(event: "error", listener: (error: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "pipe", listener: (src: stream.Readable) => void): this; - once(event: "unpipe", listener: (src: stream.Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "error", listener: (error: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "error", listener: (error: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export namespace constants { - const NGHTTP2_SESSION_SERVER: number; - const NGHTTP2_SESSION_CLIENT: number; - const NGHTTP2_STREAM_STATE_IDLE: number; - const NGHTTP2_STREAM_STATE_OPEN: number; - const NGHTTP2_STREAM_STATE_RESERVED_LOCAL: number; - const NGHTTP2_STREAM_STATE_RESERVED_REMOTE: number; - const NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL: number; - const NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE: number; - const NGHTTP2_STREAM_STATE_CLOSED: number; - const NGHTTP2_NO_ERROR: number; - const NGHTTP2_PROTOCOL_ERROR: number; - const NGHTTP2_INTERNAL_ERROR: number; - const NGHTTP2_FLOW_CONTROL_ERROR: number; - const NGHTTP2_SETTINGS_TIMEOUT: number; - const NGHTTP2_STREAM_CLOSED: number; - const NGHTTP2_FRAME_SIZE_ERROR: number; - const NGHTTP2_REFUSED_STREAM: number; - const NGHTTP2_CANCEL: number; - const NGHTTP2_COMPRESSION_ERROR: number; - const NGHTTP2_CONNECT_ERROR: number; - const NGHTTP2_ENHANCE_YOUR_CALM: number; - const NGHTTP2_INADEQUATE_SECURITY: number; - const NGHTTP2_HTTP_1_1_REQUIRED: number; - const NGHTTP2_ERR_FRAME_SIZE_ERROR: number; - const NGHTTP2_FLAG_NONE: number; - const NGHTTP2_FLAG_END_STREAM: number; - const NGHTTP2_FLAG_END_HEADERS: number; - const NGHTTP2_FLAG_ACK: number; - const NGHTTP2_FLAG_PADDED: number; - const NGHTTP2_FLAG_PRIORITY: number; - const DEFAULT_SETTINGS_HEADER_TABLE_SIZE: number; - const DEFAULT_SETTINGS_ENABLE_PUSH: number; - const DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: number; - const DEFAULT_SETTINGS_MAX_FRAME_SIZE: number; - const MAX_MAX_FRAME_SIZE: number; - const MIN_MAX_FRAME_SIZE: number; - const MAX_INITIAL_WINDOW_SIZE: number; - const NGHTTP2_DEFAULT_WEIGHT: number; - const NGHTTP2_SETTINGS_HEADER_TABLE_SIZE: number; - const NGHTTP2_SETTINGS_ENABLE_PUSH: number; - const NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS: number; - const NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: number; - const NGHTTP2_SETTINGS_MAX_FRAME_SIZE: number; - const NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: number; - const PADDING_STRATEGY_NONE: number; - const PADDING_STRATEGY_MAX: number; - const PADDING_STRATEGY_CALLBACK: number; - const HTTP2_HEADER_STATUS: string; - const HTTP2_HEADER_METHOD: string; - const HTTP2_HEADER_AUTHORITY: string; - const HTTP2_HEADER_SCHEME: string; - const HTTP2_HEADER_PATH: string; - const HTTP2_HEADER_ACCEPT_CHARSET: string; - const HTTP2_HEADER_ACCEPT_ENCODING: string; - const HTTP2_HEADER_ACCEPT_LANGUAGE: string; - const HTTP2_HEADER_ACCEPT_RANGES: string; - const HTTP2_HEADER_ACCEPT: string; - const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_CREDENTIALS: string; - const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_HEADERS: string; - const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_METHODS: string; - const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN: string; - const HTTP2_HEADER_ACCESS_CONTROL_EXPOSE_HEADERS: string; - const HTTP2_HEADER_ACCESS_CONTROL_REQUEST_HEADERS: string; - const HTTP2_HEADER_ACCESS_CONTROL_REQUEST_METHOD: string; - const HTTP2_HEADER_AGE: string; - const HTTP2_HEADER_ALLOW: string; - const HTTP2_HEADER_AUTHORIZATION: string; - const HTTP2_HEADER_CACHE_CONTROL: string; - const HTTP2_HEADER_CONNECTION: string; - const HTTP2_HEADER_CONTENT_DISPOSITION: string; - const HTTP2_HEADER_CONTENT_ENCODING: string; - const HTTP2_HEADER_CONTENT_LANGUAGE: string; - const HTTP2_HEADER_CONTENT_LENGTH: string; - const HTTP2_HEADER_CONTENT_LOCATION: string; - const HTTP2_HEADER_CONTENT_MD5: string; - const HTTP2_HEADER_CONTENT_RANGE: string; - const HTTP2_HEADER_CONTENT_TYPE: string; - const HTTP2_HEADER_COOKIE: string; - const HTTP2_HEADER_DATE: string; - const HTTP2_HEADER_ETAG: string; - const HTTP2_HEADER_EXPECT: string; - const HTTP2_HEADER_EXPIRES: string; - const HTTP2_HEADER_FROM: string; - const HTTP2_HEADER_HOST: string; - const HTTP2_HEADER_IF_MATCH: string; - const HTTP2_HEADER_IF_MODIFIED_SINCE: string; - const HTTP2_HEADER_IF_NONE_MATCH: string; - const HTTP2_HEADER_IF_RANGE: string; - const HTTP2_HEADER_IF_UNMODIFIED_SINCE: string; - const HTTP2_HEADER_LAST_MODIFIED: string; - const HTTP2_HEADER_LINK: string; - const HTTP2_HEADER_LOCATION: string; - const HTTP2_HEADER_MAX_FORWARDS: string; - const HTTP2_HEADER_PREFER: string; - const HTTP2_HEADER_PROXY_AUTHENTICATE: string; - const HTTP2_HEADER_PROXY_AUTHORIZATION: string; - const HTTP2_HEADER_RANGE: string; - const HTTP2_HEADER_REFERER: string; - const HTTP2_HEADER_REFRESH: string; - const HTTP2_HEADER_RETRY_AFTER: string; - const HTTP2_HEADER_SERVER: string; - const HTTP2_HEADER_SET_COOKIE: string; - const HTTP2_HEADER_STRICT_TRANSPORT_SECURITY: string; - const HTTP2_HEADER_TRANSFER_ENCODING: string; - const HTTP2_HEADER_TE: string; - const HTTP2_HEADER_UPGRADE: string; - const HTTP2_HEADER_USER_AGENT: string; - const HTTP2_HEADER_VARY: string; - const HTTP2_HEADER_VIA: string; - const HTTP2_HEADER_WWW_AUTHENTICATE: string; - const HTTP2_HEADER_HTTP2_SETTINGS: string; - const HTTP2_HEADER_KEEP_ALIVE: string; - const HTTP2_HEADER_PROXY_CONNECTION: string; - const HTTP2_METHOD_ACL: string; - const HTTP2_METHOD_BASELINE_CONTROL: string; - const HTTP2_METHOD_BIND: string; - const HTTP2_METHOD_CHECKIN: string; - const HTTP2_METHOD_CHECKOUT: string; - const HTTP2_METHOD_CONNECT: string; - const HTTP2_METHOD_COPY: string; - const HTTP2_METHOD_DELETE: string; - const HTTP2_METHOD_GET: string; - const HTTP2_METHOD_HEAD: string; - const HTTP2_METHOD_LABEL: string; - const HTTP2_METHOD_LINK: string; - const HTTP2_METHOD_LOCK: string; - const HTTP2_METHOD_MERGE: string; - const HTTP2_METHOD_MKACTIVITY: string; - const HTTP2_METHOD_MKCALENDAR: string; - const HTTP2_METHOD_MKCOL: string; - const HTTP2_METHOD_MKREDIRECTREF: string; - const HTTP2_METHOD_MKWORKSPACE: string; - const HTTP2_METHOD_MOVE: string; - const HTTP2_METHOD_OPTIONS: string; - const HTTP2_METHOD_ORDERPATCH: string; - const HTTP2_METHOD_PATCH: string; - const HTTP2_METHOD_POST: string; - const HTTP2_METHOD_PRI: string; - const HTTP2_METHOD_PROPFIND: string; - const HTTP2_METHOD_PROPPATCH: string; - const HTTP2_METHOD_PUT: string; - const HTTP2_METHOD_REBIND: string; - const HTTP2_METHOD_REPORT: string; - const HTTP2_METHOD_SEARCH: string; - const HTTP2_METHOD_TRACE: string; - const HTTP2_METHOD_UNBIND: string; - const HTTP2_METHOD_UNCHECKOUT: string; - const HTTP2_METHOD_UNLINK: string; - const HTTP2_METHOD_UNLOCK: string; - const HTTP2_METHOD_UPDATE: string; - const HTTP2_METHOD_UPDATEREDIRECTREF: string; - const HTTP2_METHOD_VERSION_CONTROL: string; - const HTTP_STATUS_CONTINUE: number; - const HTTP_STATUS_SWITCHING_PROTOCOLS: number; - const HTTP_STATUS_PROCESSING: number; - const HTTP_STATUS_OK: number; - const HTTP_STATUS_CREATED: number; - const HTTP_STATUS_ACCEPTED: number; - const HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION: number; - const HTTP_STATUS_NO_CONTENT: number; - const HTTP_STATUS_RESET_CONTENT: number; - const HTTP_STATUS_PARTIAL_CONTENT: number; - const HTTP_STATUS_MULTI_STATUS: number; - const HTTP_STATUS_ALREADY_REPORTED: number; - const HTTP_STATUS_IM_USED: number; - const HTTP_STATUS_MULTIPLE_CHOICES: number; - const HTTP_STATUS_MOVED_PERMANENTLY: number; - const HTTP_STATUS_FOUND: number; - const HTTP_STATUS_SEE_OTHER: number; - const HTTP_STATUS_NOT_MODIFIED: number; - const HTTP_STATUS_USE_PROXY: number; - const HTTP_STATUS_TEMPORARY_REDIRECT: number; - const HTTP_STATUS_PERMANENT_REDIRECT: number; - const HTTP_STATUS_BAD_REQUEST: number; - const HTTP_STATUS_UNAUTHORIZED: number; - const HTTP_STATUS_PAYMENT_REQUIRED: number; - const HTTP_STATUS_FORBIDDEN: number; - const HTTP_STATUS_NOT_FOUND: number; - const HTTP_STATUS_METHOD_NOT_ALLOWED: number; - const HTTP_STATUS_NOT_ACCEPTABLE: number; - const HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED: number; - const HTTP_STATUS_REQUEST_TIMEOUT: number; - const HTTP_STATUS_CONFLICT: number; - const HTTP_STATUS_GONE: number; - const HTTP_STATUS_LENGTH_REQUIRED: number; - const HTTP_STATUS_PRECONDITION_FAILED: number; - const HTTP_STATUS_PAYLOAD_TOO_LARGE: number; - const HTTP_STATUS_URI_TOO_LONG: number; - const HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: number; - const HTTP_STATUS_RANGE_NOT_SATISFIABLE: number; - const HTTP_STATUS_EXPECTATION_FAILED: number; - const HTTP_STATUS_TEAPOT: number; - const HTTP_STATUS_MISDIRECTED_REQUEST: number; - const HTTP_STATUS_UNPROCESSABLE_ENTITY: number; - const HTTP_STATUS_LOCKED: number; - const HTTP_STATUS_FAILED_DEPENDENCY: number; - const HTTP_STATUS_UNORDERED_COLLECTION: number; - const HTTP_STATUS_UPGRADE_REQUIRED: number; - const HTTP_STATUS_PRECONDITION_REQUIRED: number; - const HTTP_STATUS_TOO_MANY_REQUESTS: number; - const HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: number; - const HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: number; - const HTTP_STATUS_INTERNAL_SERVER_ERROR: number; - const HTTP_STATUS_NOT_IMPLEMENTED: number; - const HTTP_STATUS_BAD_GATEWAY: number; - const HTTP_STATUS_SERVICE_UNAVAILABLE: number; - const HTTP_STATUS_GATEWAY_TIMEOUT: number; - const HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED: number; - const HTTP_STATUS_VARIANT_ALSO_NEGOTIATES: number; - const HTTP_STATUS_INSUFFICIENT_STORAGE: number; - const HTTP_STATUS_LOOP_DETECTED: number; - const HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED: number; - const HTTP_STATUS_NOT_EXTENDED: number; - const HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: number; - } - /** - * This symbol can be set as a property on the HTTP/2 headers object with - * an array value in order to provide a list of headers considered sensitive. - */ - export const sensitiveHeaders: symbol; - /** - * Returns an object containing the default settings for an `Http2Session` instance. This method returns a new object instance every time it is called - * so instances returned may be safely modified for use. - * @since v8.4.0 - */ - export function getDefaultSettings(): Settings; - /** - * Returns a `Buffer` instance containing serialized representation of the given - * HTTP/2 settings as specified in the [HTTP/2](https://tools.ietf.org/html/rfc7540) specification. This is intended - * for use with the `HTTP2-Settings` header field. - * - * ```js - * import http2 from 'node:http2'; - * - * const packed = http2.getPackedSettings({ enablePush: false }); - * - * console.log(packed.toString('base64')); - * // Prints: AAIAAAAA - * ``` - * @since v8.4.0 - */ - export function getPackedSettings(settings: Settings): Buffer; - /** - * Returns a `HTTP/2 Settings Object` containing the deserialized settings from - * the given `Buffer` as generated by `http2.getPackedSettings()`. - * @since v8.4.0 - * @param buf The packed settings. - */ - export function getUnpackedSettings(buf: Uint8Array): Settings; - /** - * Returns a `net.Server` instance that creates and manages `Http2Session` instances. - * - * Since there are no browsers known that support [unencrypted HTTP/2](https://http2.github.io/faq/#does-http2-require-encryption), the use of {@link createSecureServer} is necessary when - * communicating - * with browser clients. - * - * ```js - * import http2 from 'node:http2'; - * - * // Create an unencrypted HTTP/2 server. - * // Since there are no browsers known that support - * // unencrypted HTTP/2, the use of `http2.createSecureServer()` - * // is necessary when communicating with browser clients. - * const server = http2.createServer(); - * - * server.on('stream', (stream, headers) => { - * stream.respond({ - * 'content-type': 'text/html; charset=utf-8', - * ':status': 200, - * }); - * stream.end('

Hello World

'); - * }); - * - * server.listen(8000); - * ``` - * @since v8.4.0 - * @param onRequestHandler See `Compatibility API` - */ - export function createServer( - onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): Http2Server; - export function createServer< - Http1Request extends typeof IncomingMessage = typeof IncomingMessage, - Http1Response extends typeof ServerResponse> = typeof ServerResponse, - Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, - Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, - >( - options: ServerOptions, - onRequestHandler?: (request: InstanceType, response: InstanceType) => void, - ): Http2Server; - /** - * Returns a `tls.Server` instance that creates and manages `Http2Session` instances. - * - * ```js - * import http2 from 'node:http2'; - * import fs from 'node:fs'; - * - * const options = { - * key: fs.readFileSync('server-key.pem'), - * cert: fs.readFileSync('server-cert.pem'), - * }; - * - * // Create a secure HTTP/2 server - * const server = http2.createSecureServer(options); - * - * server.on('stream', (stream, headers) => { - * stream.respond({ - * 'content-type': 'text/html; charset=utf-8', - * ':status': 200, - * }); - * stream.end('

Hello World

'); - * }); - * - * server.listen(8443); - * ``` - * @since v8.4.0 - * @param onRequestHandler See `Compatibility API` - */ - export function createSecureServer( - onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): Http2SecureServer; - export function createSecureServer< - Http1Request extends typeof IncomingMessage = typeof IncomingMessage, - Http1Response extends typeof ServerResponse> = typeof ServerResponse, - Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, - Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, - >( - options: SecureServerOptions, - onRequestHandler?: (request: InstanceType, response: InstanceType) => void, - ): Http2SecureServer; - /** - * Returns a `ClientHttp2Session` instance. - * - * ```js - * import http2 from 'node:http2'; - * const client = http2.connect('https://localhost:1234'); - * - * // Use the client - * - * client.close(); - * ``` - * @since v8.4.0 - * @param authority The remote HTTP/2 server to connect to. This must be in the form of a minimal, valid URL with the `http://` or `https://` prefix, host name, and IP port (if a non-default port - * is used). Userinfo (user ID and password), path, querystring, and fragment details in the URL will be ignored. - * @param listener Will be registered as a one-time listener of the {@link 'connect'} event. - */ - export function connect( - authority: string | url.URL, - listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): ClientHttp2Session; - export function connect( - authority: string | url.URL, - options?: ClientSessionOptions | SecureClientSessionOptions, - listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): ClientHttp2Session; - /** - * Create an HTTP/2 server session from an existing socket. - * @param socket A Duplex Stream - * @param options Any `{@link createServer}` options can be provided. - * @since v20.12.0 - */ - export function performServerHandshake< - Http1Request extends typeof IncomingMessage = typeof IncomingMessage, - Http1Response extends typeof ServerResponse> = typeof ServerResponse, - Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, - Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, - >( - socket: stream.Duplex, - options?: ServerOptions, - ): ServerHttp2Session; -} -declare module "node:http2" { - export * from "http2"; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/https.d.ts b/tools/mnemonic-test/node_modules/@types/node/https.d.ts deleted file mode 100644 index 7112b8d4..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/https.d.ts +++ /dev/null @@ -1,544 +0,0 @@ -/** - * HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a - * separate module. - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/https.js) - */ -declare module "https" { - import { Duplex } from "node:stream"; - import * as tls from "node:tls"; - import * as http from "node:http"; - import { URL } from "node:url"; - type ServerOptions< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse> = typeof http.ServerResponse, - > = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions; - type RequestOptions = - & http.RequestOptions - & tls.SecureContextOptions - & { - checkServerIdentity?: typeof tls.checkServerIdentity | undefined; - rejectUnauthorized?: boolean | undefined; // Defaults to true - servername?: string | undefined; // SNI TLS Extension - }; - interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions { - rejectUnauthorized?: boolean | undefined; - maxCachedSessions?: number | undefined; - } - /** - * An `Agent` object for HTTPS similar to `http.Agent`. See {@link request} for more information. - * @since v0.4.5 - */ - class Agent extends http.Agent { - constructor(options?: AgentOptions); - options: AgentOptions; - } - interface Server< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse> = typeof http.ServerResponse, - > extends http.Server {} - /** - * See `http.Server` for more information. - * @since v0.3.4 - */ - class Server< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse> = typeof http.ServerResponse, - > extends tls.Server { - constructor(requestListener?: http.RequestListener); - constructor( - options: ServerOptions, - requestListener?: http.RequestListener, - ); - /** - * Closes all connections connected to this server. - * @since v18.2.0 - */ - closeAllConnections(): void; - /** - * Closes all connections connected to this server which are not sending a request or waiting for a response. - * @since v18.2.0 - */ - closeIdleConnections(): void; - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - addListener( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, - ): this; - addListener( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - addListener( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, - ): this; - addListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this; - addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "connection", listener: (socket: Duplex) => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "listening", listener: () => void): this; - addListener(event: "checkContinue", listener: http.RequestListener): this; - addListener(event: "checkExpectation", listener: http.RequestListener): this; - addListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this; - addListener( - event: "connect", - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - addListener(event: "request", listener: http.RequestListener): this; - addListener( - event: "upgrade", - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - emit(event: string, ...args: any[]): boolean; - emit(event: "keylog", line: Buffer, tlsSocket: tls.TLSSocket): boolean; - emit( - event: "newSession", - sessionId: Buffer, - sessionData: Buffer, - callback: (err: Error, resp: Buffer) => void, - ): boolean; - emit( - event: "OCSPRequest", - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ): boolean; - emit(event: "resumeSession", sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void): boolean; - emit(event: "secureConnection", tlsSocket: tls.TLSSocket): boolean; - emit(event: "tlsClientError", err: Error, tlsSocket: tls.TLSSocket): boolean; - emit(event: "close"): boolean; - emit(event: "connection", socket: Duplex): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "listening"): boolean; - emit( - event: "checkContinue", - req: InstanceType, - res: InstanceType, - ): boolean; - emit( - event: "checkExpectation", - req: InstanceType, - res: InstanceType, - ): boolean; - emit(event: "clientError", err: Error, socket: Duplex): boolean; - emit(event: "connect", req: InstanceType, socket: Duplex, head: Buffer): boolean; - emit( - event: "request", - req: InstanceType, - res: InstanceType, - ): boolean; - emit(event: "upgrade", req: InstanceType, socket: Duplex, head: Buffer): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - on( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, - ): this; - on( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - on( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, - ): this; - on(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this; - on(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - on(event: "close", listener: () => void): this; - on(event: "connection", listener: (socket: Duplex) => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "listening", listener: () => void): this; - on(event: "checkContinue", listener: http.RequestListener): this; - on(event: "checkExpectation", listener: http.RequestListener): this; - on(event: "clientError", listener: (err: Error, socket: Duplex) => void): this; - on(event: "connect", listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; - on(event: "request", listener: http.RequestListener): this; - on(event: "upgrade", listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - once( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, - ): this; - once( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - once( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, - ): this; - once(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this; - once(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - once(event: "close", listener: () => void): this; - once(event: "connection", listener: (socket: Duplex) => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "listening", listener: () => void): this; - once(event: "checkContinue", listener: http.RequestListener): this; - once(event: "checkExpectation", listener: http.RequestListener): this; - once(event: "clientError", listener: (err: Error, socket: Duplex) => void): this; - once(event: "connect", listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; - once(event: "request", listener: http.RequestListener): this; - once(event: "upgrade", listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - prependListener( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, - ): this; - prependListener( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - prependListener( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, - ): this; - prependListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this; - prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "connection", listener: (socket: Duplex) => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "listening", listener: () => void): this; - prependListener(event: "checkContinue", listener: http.RequestListener): this; - prependListener(event: "checkExpectation", listener: http.RequestListener): this; - prependListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this; - prependListener( - event: "connect", - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - prependListener(event: "request", listener: http.RequestListener): this; - prependListener( - event: "upgrade", - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - prependOnceListener( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, - ): this; - prependOnceListener( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - prependOnceListener( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, - ): this; - prependOnceListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this; - prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "connection", listener: (socket: Duplex) => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "listening", listener: () => void): this; - prependOnceListener(event: "checkContinue", listener: http.RequestListener): this; - prependOnceListener(event: "checkExpectation", listener: http.RequestListener): this; - prependOnceListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this; - prependOnceListener( - event: "connect", - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - prependOnceListener(event: "request", listener: http.RequestListener): this; - prependOnceListener( - event: "upgrade", - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - } - /** - * ```js - * // curl -k https://localhost:8000/ - * import https from 'node:https'; - * import fs from 'node:fs'; - * - * const options = { - * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), - * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), - * }; - * - * https.createServer(options, (req, res) => { - * res.writeHead(200); - * res.end('hello world\n'); - * }).listen(8000); - * ``` - * - * Or - * - * ```js - * import https from 'node:https'; - * import fs from 'node:fs'; - * - * const options = { - * pfx: fs.readFileSync('test/fixtures/test_cert.pfx'), - * passphrase: 'sample', - * }; - * - * https.createServer(options, (req, res) => { - * res.writeHead(200); - * res.end('hello world\n'); - * }).listen(8000); - * ``` - * @since v0.3.4 - * @param options Accepts `options` from `createServer`, `createSecureContext` and `createServer`. - * @param requestListener A listener to be added to the `'request'` event. - */ - function createServer< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse> = typeof http.ServerResponse, - >(requestListener?: http.RequestListener): Server; - function createServer< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse> = typeof http.ServerResponse, - >( - options: ServerOptions, - requestListener?: http.RequestListener, - ): Server; - /** - * Makes a request to a secure web server. - * - * The following additional `options` from `tls.connect()` are also accepted: `ca`, `cert`, `ciphers`, `clientCertEngine`, `crl`, `dhparam`, `ecdhCurve`, `honorCipherOrder`, `key`, `passphrase`, - * `pfx`, `rejectUnauthorized`, `secureOptions`, `secureProtocol`, `servername`, `sessionIdContext`, `highWaterMark`. - * - * `options` can be an object, a string, or a `URL` object. If `options` is a - * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. - * - * `https.request()` returns an instance of the `http.ClientRequest` class. The `ClientRequest` instance is a writable stream. If one needs to - * upload a file with a POST request, then write to the `ClientRequest` object. - * - * ```js - * import https from 'node:https'; - * - * const options = { - * hostname: 'encrypted.google.com', - * port: 443, - * path: '/', - * method: 'GET', - * }; - * - * const req = https.request(options, (res) => { - * console.log('statusCode:', res.statusCode); - * console.log('headers:', res.headers); - * - * res.on('data', (d) => { - * process.stdout.write(d); - * }); - * }); - * - * req.on('error', (e) => { - * console.error(e); - * }); - * req.end(); - * ``` - * - * Example using options from `tls.connect()`: - * - * ```js - * const options = { - * hostname: 'encrypted.google.com', - * port: 443, - * path: '/', - * method: 'GET', - * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), - * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), - * }; - * options.agent = new https.Agent(options); - * - * const req = https.request(options, (res) => { - * // ... - * }); - * ``` - * - * Alternatively, opt out of connection pooling by not using an `Agent`. - * - * ```js - * const options = { - * hostname: 'encrypted.google.com', - * port: 443, - * path: '/', - * method: 'GET', - * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), - * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), - * agent: false, - * }; - * - * const req = https.request(options, (res) => { - * // ... - * }); - * ``` - * - * Example using a `URL` as `options`: - * - * ```js - * const options = new URL('https://abc:xyz@example.com'); - * - * const req = https.request(options, (res) => { - * // ... - * }); - * ``` - * - * Example pinning on certificate fingerprint, or the public key (similar to`pin-sha256`): - * - * ```js - * import tls from 'node:tls'; - * import https from 'node:https'; - * import crypto from 'node:crypto'; - * - * function sha256(s) { - * return crypto.createHash('sha256').update(s).digest('base64'); - * } - * const options = { - * hostname: 'github.com', - * port: 443, - * path: '/', - * method: 'GET', - * checkServerIdentity: function(host, cert) { - * // Make sure the certificate is issued to the host we are connected to - * const err = tls.checkServerIdentity(host, cert); - * if (err) { - * return err; - * } - * - * // Pin the public key, similar to HPKP pin-sha256 pinning - * const pubkey256 = 'pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU='; - * if (sha256(cert.pubkey) !== pubkey256) { - * const msg = 'Certificate verification error: ' + - * `The public key of '${cert.subject.CN}' ` + - * 'does not match our pinned fingerprint'; - * return new Error(msg); - * } - * - * // Pin the exact certificate, rather than the pub key - * const cert256 = '25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:' + - * 'D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16'; - * if (cert.fingerprint256 !== cert256) { - * const msg = 'Certificate verification error: ' + - * `The certificate of '${cert.subject.CN}' ` + - * 'does not match our pinned fingerprint'; - * return new Error(msg); - * } - * - * // This loop is informational only. - * // Print the certificate and public key fingerprints of all certs in the - * // chain. Its common to pin the public key of the issuer on the public - * // internet, while pinning the public key of the service in sensitive - * // environments. - * do { - * console.log('Subject Common Name:', cert.subject.CN); - * console.log(' Certificate SHA256 fingerprint:', cert.fingerprint256); - * - * hash = crypto.createHash('sha256'); - * console.log(' Public key ping-sha256:', sha256(cert.pubkey)); - * - * lastprint256 = cert.fingerprint256; - * cert = cert.issuerCertificate; - * } while (cert.fingerprint256 !== lastprint256); - * - * }, - * }; - * - * options.agent = new https.Agent(options); - * const req = https.request(options, (res) => { - * console.log('All OK. Server matched our pinned cert or public key'); - * console.log('statusCode:', res.statusCode); - * // Print the HPKP values - * console.log('headers:', res.headers['public-key-pins']); - * - * res.on('data', (d) => {}); - * }); - * - * req.on('error', (e) => { - * console.error(e.message); - * }); - * req.end(); - * ``` - * - * Outputs for example: - * - * ```text - * Subject Common Name: github.com - * Certificate SHA256 fingerprint: 25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16 - * Public key ping-sha256: pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU= - * Subject Common Name: DigiCert SHA2 Extended Validation Server CA - * Certificate SHA256 fingerprint: 40:3E:06:2A:26:53:05:91:13:28:5B:AF:80:A0:D4:AE:42:2C:84:8C:9F:78:FA:D0:1F:C9:4B:C5:B8:7F:EF:1A - * Public key ping-sha256: RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho= - * Subject Common Name: DigiCert High Assurance EV Root CA - * Certificate SHA256 fingerprint: 74:31:E5:F4:C3:C1:CE:46:90:77:4F:0B:61:E0:54:40:88:3B:A9:A0:1E:D0:0B:A6:AB:D7:80:6E:D3:B1:18:CF - * Public key ping-sha256: WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18= - * All OK. Server matched our pinned cert or public key - * statusCode: 200 - * headers: max-age=0; pin-sha256="WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18="; pin-sha256="RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho="; - * pin-sha256="k2v657xBsOVe1PQRwOsHsw3bsGT2VzIqz5K+59sNQws="; pin-sha256="K87oWBWM9UZfyddvDfoxL+8lpNyoUB2ptGtn0fv6G2Q="; pin-sha256="IQBnNBEiFuhj+8x6X8XLgh01V9Ic5/V3IRQLNFFc7v4="; - * pin-sha256="iie1VXtL7HzAMF+/PVPR9xzT80kQxdZeJ+zduCB3uj0="; pin-sha256="LvRiGEjRqfzurezaWuj8Wie2gyHMrW5Q06LspMnox7A="; includeSubDomains - * ``` - * @since v0.3.6 - * @param options Accepts all `options` from `request`, with some differences in default values: - */ - function request( - options: RequestOptions | string | URL, - callback?: (res: http.IncomingMessage) => void, - ): http.ClientRequest; - function request( - url: string | URL, - options: RequestOptions, - callback?: (res: http.IncomingMessage) => void, - ): http.ClientRequest; - /** - * Like `http.get()` but for HTTPS. - * - * `options` can be an object, a string, or a `URL` object. If `options` is a - * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. - * - * ```js - * import https from 'node:https'; - * - * https.get('https://encrypted.google.com/', (res) => { - * console.log('statusCode:', res.statusCode); - * console.log('headers:', res.headers); - * - * res.on('data', (d) => { - * process.stdout.write(d); - * }); - * - * }).on('error', (e) => { - * console.error(e); - * }); - * ``` - * @since v0.3.6 - * @param options Accepts the same `options` as {@link request}, with the `method` always set to `GET`. - */ - function get( - options: RequestOptions | string | URL, - callback?: (res: http.IncomingMessage) => void, - ): http.ClientRequest; - function get( - url: string | URL, - options: RequestOptions, - callback?: (res: http.IncomingMessage) => void, - ): http.ClientRequest; - let globalAgent: Agent; -} -declare module "node:https" { - export * from "https"; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/index.d.ts b/tools/mnemonic-test/node_modules/@types/node/index.d.ts deleted file mode 100644 index 1ddb0a67..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/index.d.ts +++ /dev/null @@ -1,94 +0,0 @@ -/** - * License for programmatically and manually incorporated - * documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc - * - * Copyright Node.js contributors. All rights reserved. - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - */ - -// NOTE: These definitions support NodeJS and TypeScript 5.7+. - -// Reference required types from the default lib: -/// -/// -/// -/// - -// Definitions specific to TypeScript 4.9 through 5.7+ -/// -/// - -// Base definitions for all NodeJS modules that are not specific to any version of TypeScript: -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// - -/// diff --git a/tools/mnemonic-test/node_modules/@types/node/inspector.d.ts b/tools/mnemonic-test/node_modules/@types/node/inspector.d.ts deleted file mode 100644 index 32d9ba4a..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/inspector.d.ts +++ /dev/null @@ -1,3966 +0,0 @@ -// These definitions are automatically generated by the generate-inspector script. -// Do not edit this file directly. -// See scripts/generate-inspector/README.md for information on how to update the protocol definitions. -// Changes to the module itself should be added to the generator template (scripts/generate-inspector/inspector.d.ts.template). - -/** - * The `node:inspector` module provides an API for interacting with the V8 - * inspector. - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/inspector.js) - */ -declare module 'inspector' { - import EventEmitter = require('node:events'); - - interface InspectorNotification { - method: string; - params: T; - } - - namespace Schema { - /** - * Description of the protocol domain. - */ - interface Domain { - /** - * Domain name. - */ - name: string; - /** - * Domain version. - */ - version: string; - } - interface GetDomainsReturnType { - /** - * List of supported domains. - */ - domains: Domain[]; - } - } - namespace Runtime { - /** - * Unique script identifier. - */ - type ScriptId = string; - /** - * Unique object identifier. - */ - type RemoteObjectId = string; - /** - * Primitive value which cannot be JSON-stringified. - */ - type UnserializableValue = string; - /** - * Mirror object referencing original JavaScript object. - */ - interface RemoteObject { - /** - * Object type. - */ - type: string; - /** - * Object subtype hint. Specified for object type values only. - */ - subtype?: string | undefined; - /** - * Object class (constructor) name. Specified for object type values only. - */ - className?: string | undefined; - /** - * Remote object value in case of primitive values or JSON values (if it was requested). - */ - value?: any; - /** - * Primitive value which can not be JSON-stringified does not have value, but gets this property. - */ - unserializableValue?: UnserializableValue | undefined; - /** - * String representation of the object. - */ - description?: string | undefined; - /** - * Unique object identifier (for non-primitive values). - */ - objectId?: RemoteObjectId | undefined; - /** - * Preview containing abbreviated property values. Specified for object type values only. - * @experimental - */ - preview?: ObjectPreview | undefined; - /** - * @experimental - */ - customPreview?: CustomPreview | undefined; - } - /** - * @experimental - */ - interface CustomPreview { - header: string; - hasBody: boolean; - formatterObjectId: RemoteObjectId; - bindRemoteObjectFunctionId: RemoteObjectId; - configObjectId?: RemoteObjectId | undefined; - } - /** - * Object containing abbreviated remote object value. - * @experimental - */ - interface ObjectPreview { - /** - * Object type. - */ - type: string; - /** - * Object subtype hint. Specified for object type values only. - */ - subtype?: string | undefined; - /** - * String representation of the object. - */ - description?: string | undefined; - /** - * True iff some of the properties or entries of the original object did not fit. - */ - overflow: boolean; - /** - * List of the properties. - */ - properties: PropertyPreview[]; - /** - * List of the entries. Specified for map and set subtype values only. - */ - entries?: EntryPreview[] | undefined; - } - /** - * @experimental - */ - interface PropertyPreview { - /** - * Property name. - */ - name: string; - /** - * Object type. Accessor means that the property itself is an accessor property. - */ - type: string; - /** - * User-friendly property value string. - */ - value?: string | undefined; - /** - * Nested value preview. - */ - valuePreview?: ObjectPreview | undefined; - /** - * Object subtype hint. Specified for object type values only. - */ - subtype?: string | undefined; - } - /** - * @experimental - */ - interface EntryPreview { - /** - * Preview of the key. Specified for map-like collection entries. - */ - key?: ObjectPreview | undefined; - /** - * Preview of the value. - */ - value: ObjectPreview; - } - /** - * Object property descriptor. - */ - interface PropertyDescriptor { - /** - * Property name or symbol description. - */ - name: string; - /** - * The value associated with the property. - */ - value?: RemoteObject | undefined; - /** - * True if the value associated with the property may be changed (data descriptors only). - */ - writable?: boolean | undefined; - /** - * A function which serves as a getter for the property, or undefined if there is no getter (accessor descriptors only). - */ - get?: RemoteObject | undefined; - /** - * A function which serves as a setter for the property, or undefined if there is no setter (accessor descriptors only). - */ - set?: RemoteObject | undefined; - /** - * True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object. - */ - configurable: boolean; - /** - * True if this property shows up during enumeration of the properties on the corresponding object. - */ - enumerable: boolean; - /** - * True if the result was thrown during the evaluation. - */ - wasThrown?: boolean | undefined; - /** - * True if the property is owned for the object. - */ - isOwn?: boolean | undefined; - /** - * Property symbol object, if the property is of the symbol type. - */ - symbol?: RemoteObject | undefined; - } - /** - * Object internal property descriptor. This property isn't normally visible in JavaScript code. - */ - interface InternalPropertyDescriptor { - /** - * Conventional property name. - */ - name: string; - /** - * The value associated with the property. - */ - value?: RemoteObject | undefined; - } - /** - * Represents function call argument. Either remote object id objectId, primitive value, unserializable primitive value or neither of (for undefined) them should be specified. - */ - interface CallArgument { - /** - * Primitive value or serializable javascript object. - */ - value?: any; - /** - * Primitive value which can not be JSON-stringified. - */ - unserializableValue?: UnserializableValue | undefined; - /** - * Remote object handle. - */ - objectId?: RemoteObjectId | undefined; - } - /** - * Id of an execution context. - */ - type ExecutionContextId = number; - /** - * Description of an isolated world. - */ - interface ExecutionContextDescription { - /** - * Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed. - */ - id: ExecutionContextId; - /** - * Execution context origin. - */ - origin: string; - /** - * Human readable name describing given context. - */ - name: string; - /** - * Embedder-specific auxiliary data. - */ - auxData?: {} | undefined; - } - /** - * Detailed information about exception (or error) that was thrown during script compilation or execution. - */ - interface ExceptionDetails { - /** - * Exception id. - */ - exceptionId: number; - /** - * Exception text, which should be used together with exception object when available. - */ - text: string; - /** - * Line number of the exception location (0-based). - */ - lineNumber: number; - /** - * Column number of the exception location (0-based). - */ - columnNumber: number; - /** - * Script ID of the exception location. - */ - scriptId?: ScriptId | undefined; - /** - * URL of the exception location, to be used when the script was not reported. - */ - url?: string | undefined; - /** - * JavaScript stack trace if available. - */ - stackTrace?: StackTrace | undefined; - /** - * Exception object if available. - */ - exception?: RemoteObject | undefined; - /** - * Identifier of the context where exception happened. - */ - executionContextId?: ExecutionContextId | undefined; - } - /** - * Number of milliseconds since epoch. - */ - type Timestamp = number; - /** - * Stack entry for runtime errors and assertions. - */ - interface CallFrame { - /** - * JavaScript function name. - */ - functionName: string; - /** - * JavaScript script id. - */ - scriptId: ScriptId; - /** - * JavaScript script name or url. - */ - url: string; - /** - * JavaScript script line number (0-based). - */ - lineNumber: number; - /** - * JavaScript script column number (0-based). - */ - columnNumber: number; - } - /** - * Call frames for assertions or error messages. - */ - interface StackTrace { - /** - * String label of this stack trace. For async traces this may be a name of the function that initiated the async call. - */ - description?: string | undefined; - /** - * JavaScript function name. - */ - callFrames: CallFrame[]; - /** - * Asynchronous JavaScript stack trace that preceded this stack, if available. - */ - parent?: StackTrace | undefined; - /** - * Asynchronous JavaScript stack trace that preceded this stack, if available. - * @experimental - */ - parentId?: StackTraceId | undefined; - } - /** - * Unique identifier of current debugger. - * @experimental - */ - type UniqueDebuggerId = string; - /** - * If debuggerId is set stack trace comes from another debugger and can be resolved there. This allows to track cross-debugger calls. See Runtime.StackTrace and Debugger.paused for usages. - * @experimental - */ - interface StackTraceId { - id: string; - debuggerId?: UniqueDebuggerId | undefined; - } - interface EvaluateParameterType { - /** - * Expression to evaluate. - */ - expression: string; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string | undefined; - /** - * Determines whether Command Line API should be available during the evaluation. - */ - includeCommandLineAPI?: boolean | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page. - */ - contextId?: ExecutionContextId | undefined; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean | undefined; - /** - * Whether execution should be treated as initiated by user in the UI. - */ - userGesture?: boolean | undefined; - /** - * Whether execution should await for resulting value and return once awaited promise is resolved. - */ - awaitPromise?: boolean | undefined; - } - interface AwaitPromiseParameterType { - /** - * Identifier of the promise. - */ - promiseObjectId: RemoteObjectId; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - */ - generatePreview?: boolean | undefined; - } - interface CallFunctionOnParameterType { - /** - * Declaration of the function to call. - */ - functionDeclaration: string; - /** - * Identifier of the object to call function on. Either objectId or executionContextId should be specified. - */ - objectId?: RemoteObjectId | undefined; - /** - * Call arguments. All call arguments must belong to the same JavaScript world as the target object. - */ - arguments?: CallArgument[] | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Whether the result is expected to be a JSON object which should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean | undefined; - /** - * Whether execution should be treated as initiated by user in the UI. - */ - userGesture?: boolean | undefined; - /** - * Whether execution should await for resulting value and return once awaited promise is resolved. - */ - awaitPromise?: boolean | undefined; - /** - * Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified. - */ - executionContextId?: ExecutionContextId | undefined; - /** - * Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object. - */ - objectGroup?: string | undefined; - } - interface GetPropertiesParameterType { - /** - * Identifier of the object to return properties for. - */ - objectId: RemoteObjectId; - /** - * If true, returns properties belonging only to the element itself, not to its prototype chain. - */ - ownProperties?: boolean | undefined; - /** - * If true, returns accessor properties (with getter/setter) only; internal properties are not returned either. - * @experimental - */ - accessorPropertiesOnly?: boolean | undefined; - /** - * Whether preview should be generated for the results. - * @experimental - */ - generatePreview?: boolean | undefined; - } - interface ReleaseObjectParameterType { - /** - * Identifier of the object to release. - */ - objectId: RemoteObjectId; - } - interface ReleaseObjectGroupParameterType { - /** - * Symbolic object group name. - */ - objectGroup: string; - } - interface SetCustomObjectFormatterEnabledParameterType { - enabled: boolean; - } - interface CompileScriptParameterType { - /** - * Expression to compile. - */ - expression: string; - /** - * Source url to be set for the script. - */ - sourceURL: string; - /** - * Specifies whether the compiled script should be persisted. - */ - persistScript: boolean; - /** - * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. - */ - executionContextId?: ExecutionContextId | undefined; - } - interface RunScriptParameterType { - /** - * Id of the script to run. - */ - scriptId: ScriptId; - /** - * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. - */ - executionContextId?: ExecutionContextId | undefined; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Determines whether Command Line API should be available during the evaluation. - */ - includeCommandLineAPI?: boolean | undefined; - /** - * Whether the result is expected to be a JSON object which should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - */ - generatePreview?: boolean | undefined; - /** - * Whether execution should await for resulting value and return once awaited promise is resolved. - */ - awaitPromise?: boolean | undefined; - } - interface QueryObjectsParameterType { - /** - * Identifier of the prototype to return objects for. - */ - prototypeObjectId: RemoteObjectId; - } - interface GlobalLexicalScopeNamesParameterType { - /** - * Specifies in which execution context to lookup global scope variables. - */ - executionContextId?: ExecutionContextId | undefined; - } - interface EvaluateReturnType { - /** - * Evaluation result. - */ - result: RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface AwaitPromiseReturnType { - /** - * Promise result. Will contain rejected value if promise was rejected. - */ - result: RemoteObject; - /** - * Exception details if stack strace is available. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface CallFunctionOnReturnType { - /** - * Call result. - */ - result: RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface GetPropertiesReturnType { - /** - * Object properties. - */ - result: PropertyDescriptor[]; - /** - * Internal object properties (only of the element itself). - */ - internalProperties?: InternalPropertyDescriptor[] | undefined; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface CompileScriptReturnType { - /** - * Id of the script. - */ - scriptId?: ScriptId | undefined; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface RunScriptReturnType { - /** - * Run result. - */ - result: RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface QueryObjectsReturnType { - /** - * Array with objects. - */ - objects: RemoteObject; - } - interface GlobalLexicalScopeNamesReturnType { - names: string[]; - } - interface ExecutionContextCreatedEventDataType { - /** - * A newly created execution context. - */ - context: ExecutionContextDescription; - } - interface ExecutionContextDestroyedEventDataType { - /** - * Id of the destroyed context - */ - executionContextId: ExecutionContextId; - } - interface ExceptionThrownEventDataType { - /** - * Timestamp of the exception. - */ - timestamp: Timestamp; - exceptionDetails: ExceptionDetails; - } - interface ExceptionRevokedEventDataType { - /** - * Reason describing why exception was revoked. - */ - reason: string; - /** - * The id of revoked exception, as reported in exceptionThrown. - */ - exceptionId: number; - } - interface ConsoleAPICalledEventDataType { - /** - * Type of the call. - */ - type: string; - /** - * Call arguments. - */ - args: RemoteObject[]; - /** - * Identifier of the context where the call was made. - */ - executionContextId: ExecutionContextId; - /** - * Call timestamp. - */ - timestamp: Timestamp; - /** - * Stack trace captured when the call was made. - */ - stackTrace?: StackTrace | undefined; - /** - * Console context descriptor for calls on non-default console context (not console.*): 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call on named context. - * @experimental - */ - context?: string | undefined; - } - interface InspectRequestedEventDataType { - object: RemoteObject; - hints: {}; - } - } - namespace Debugger { - /** - * Breakpoint identifier. - */ - type BreakpointId = string; - /** - * Call frame identifier. - */ - type CallFrameId = string; - /** - * Location in the source code. - */ - interface Location { - /** - * Script identifier as reported in the Debugger.scriptParsed. - */ - scriptId: Runtime.ScriptId; - /** - * Line number in the script (0-based). - */ - lineNumber: number; - /** - * Column number in the script (0-based). - */ - columnNumber?: number | undefined; - } - /** - * Location in the source code. - * @experimental - */ - interface ScriptPosition { - lineNumber: number; - columnNumber: number; - } - /** - * JavaScript call frame. Array of call frames form the call stack. - */ - interface CallFrame { - /** - * Call frame identifier. This identifier is only valid while the virtual machine is paused. - */ - callFrameId: CallFrameId; - /** - * Name of the JavaScript function called on this call frame. - */ - functionName: string; - /** - * Location in the source code. - */ - functionLocation?: Location | undefined; - /** - * Location in the source code. - */ - location: Location; - /** - * JavaScript script name or url. - */ - url: string; - /** - * Scope chain for this call frame. - */ - scopeChain: Scope[]; - /** - * this object for this call frame. - */ - this: Runtime.RemoteObject; - /** - * The value being returned, if the function is at return point. - */ - returnValue?: Runtime.RemoteObject | undefined; - } - /** - * Scope description. - */ - interface Scope { - /** - * Scope type. - */ - type: string; - /** - * Object representing the scope. For global and with scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties. - */ - object: Runtime.RemoteObject; - name?: string | undefined; - /** - * Location in the source code where scope starts - */ - startLocation?: Location | undefined; - /** - * Location in the source code where scope ends - */ - endLocation?: Location | undefined; - } - /** - * Search match for resource. - */ - interface SearchMatch { - /** - * Line number in resource content. - */ - lineNumber: number; - /** - * Line with match content. - */ - lineContent: string; - } - interface BreakLocation { - /** - * Script identifier as reported in the Debugger.scriptParsed. - */ - scriptId: Runtime.ScriptId; - /** - * Line number in the script (0-based). - */ - lineNumber: number; - /** - * Column number in the script (0-based). - */ - columnNumber?: number | undefined; - type?: string | undefined; - } - interface SetBreakpointsActiveParameterType { - /** - * New value for breakpoints active state. - */ - active: boolean; - } - interface SetSkipAllPausesParameterType { - /** - * New value for skip pauses state. - */ - skip: boolean; - } - interface SetBreakpointByUrlParameterType { - /** - * Line number to set breakpoint at. - */ - lineNumber: number; - /** - * URL of the resources to set breakpoint on. - */ - url?: string | undefined; - /** - * Regex pattern for the URLs of the resources to set breakpoints on. Either url or urlRegex must be specified. - */ - urlRegex?: string | undefined; - /** - * Script hash of the resources to set breakpoint on. - */ - scriptHash?: string | undefined; - /** - * Offset in the line to set breakpoint at. - */ - columnNumber?: number | undefined; - /** - * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. - */ - condition?: string | undefined; - } - interface SetBreakpointParameterType { - /** - * Location to set breakpoint in. - */ - location: Location; - /** - * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. - */ - condition?: string | undefined; - } - interface RemoveBreakpointParameterType { - breakpointId: BreakpointId; - } - interface GetPossibleBreakpointsParameterType { - /** - * Start of range to search possible breakpoint locations in. - */ - start: Location; - /** - * End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range. - */ - end?: Location | undefined; - /** - * Only consider locations which are in the same (non-nested) function as start. - */ - restrictToFunction?: boolean | undefined; - } - interface ContinueToLocationParameterType { - /** - * Location to continue to. - */ - location: Location; - targetCallFrames?: string | undefined; - } - interface PauseOnAsyncCallParameterType { - /** - * Debugger will pause when async call with given stack trace is started. - */ - parentStackTraceId: Runtime.StackTraceId; - } - interface StepIntoParameterType { - /** - * Debugger will issue additional Debugger.paused notification if any async task is scheduled before next pause. - * @experimental - */ - breakOnAsyncCall?: boolean | undefined; - } - interface GetStackTraceParameterType { - stackTraceId: Runtime.StackTraceId; - } - interface SearchInContentParameterType { - /** - * Id of the script to search in. - */ - scriptId: Runtime.ScriptId; - /** - * String to search for. - */ - query: string; - /** - * If true, search is case sensitive. - */ - caseSensitive?: boolean | undefined; - /** - * If true, treats string parameter as regex. - */ - isRegex?: boolean | undefined; - } - interface SetScriptSourceParameterType { - /** - * Id of the script to edit. - */ - scriptId: Runtime.ScriptId; - /** - * New content of the script. - */ - scriptSource: string; - /** - * If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code. - */ - dryRun?: boolean | undefined; - } - interface RestartFrameParameterType { - /** - * Call frame identifier to evaluate on. - */ - callFrameId: CallFrameId; - } - interface GetScriptSourceParameterType { - /** - * Id of the script to get source for. - */ - scriptId: Runtime.ScriptId; - } - interface SetPauseOnExceptionsParameterType { - /** - * Pause on exceptions mode. - */ - state: string; - } - interface EvaluateOnCallFrameParameterType { - /** - * Call frame identifier to evaluate on. - */ - callFrameId: CallFrameId; - /** - * Expression to evaluate. - */ - expression: string; - /** - * String object group name to put result into (allows rapid releasing resulting object handles using releaseObjectGroup). - */ - objectGroup?: string | undefined; - /** - * Specifies whether command line API should be available to the evaluated expression, defaults to false. - */ - includeCommandLineAPI?: boolean | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean | undefined; - /** - * Whether to throw an exception if side effect cannot be ruled out during evaluation. - */ - throwOnSideEffect?: boolean | undefined; - } - interface SetVariableValueParameterType { - /** - * 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually. - */ - scopeNumber: number; - /** - * Variable name. - */ - variableName: string; - /** - * New variable value. - */ - newValue: Runtime.CallArgument; - /** - * Id of callframe that holds variable. - */ - callFrameId: CallFrameId; - } - interface SetReturnValueParameterType { - /** - * New return value. - */ - newValue: Runtime.CallArgument; - } - interface SetAsyncCallStackDepthParameterType { - /** - * Maximum depth of async call stacks. Setting to 0 will effectively disable collecting async call stacks (default). - */ - maxDepth: number; - } - interface SetBlackboxPatternsParameterType { - /** - * Array of regexps that will be used to check script url for blackbox state. - */ - patterns: string[]; - } - interface SetBlackboxedRangesParameterType { - /** - * Id of the script. - */ - scriptId: Runtime.ScriptId; - positions: ScriptPosition[]; - } - interface EnableReturnType { - /** - * Unique identifier of the debugger. - * @experimental - */ - debuggerId: Runtime.UniqueDebuggerId; - } - interface SetBreakpointByUrlReturnType { - /** - * Id of the created breakpoint for further reference. - */ - breakpointId: BreakpointId; - /** - * List of the locations this breakpoint resolved into upon addition. - */ - locations: Location[]; - } - interface SetBreakpointReturnType { - /** - * Id of the created breakpoint for further reference. - */ - breakpointId: BreakpointId; - /** - * Location this breakpoint resolved into. - */ - actualLocation: Location; - } - interface GetPossibleBreakpointsReturnType { - /** - * List of the possible breakpoint locations. - */ - locations: BreakLocation[]; - } - interface GetStackTraceReturnType { - stackTrace: Runtime.StackTrace; - } - interface SearchInContentReturnType { - /** - * List of search matches. - */ - result: SearchMatch[]; - } - interface SetScriptSourceReturnType { - /** - * New stack trace in case editing has happened while VM was stopped. - */ - callFrames?: CallFrame[] | undefined; - /** - * Whether current call stack was modified after applying the changes. - */ - stackChanged?: boolean | undefined; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace | undefined; - /** - * Async stack trace, if any. - * @experimental - */ - asyncStackTraceId?: Runtime.StackTraceId | undefined; - /** - * Exception details if any. - */ - exceptionDetails?: Runtime.ExceptionDetails | undefined; - } - interface RestartFrameReturnType { - /** - * New stack trace. - */ - callFrames: CallFrame[]; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace | undefined; - /** - * Async stack trace, if any. - * @experimental - */ - asyncStackTraceId?: Runtime.StackTraceId | undefined; - } - interface GetScriptSourceReturnType { - /** - * Script source. - */ - scriptSource: string; - } - interface EvaluateOnCallFrameReturnType { - /** - * Object wrapper for the evaluation result. - */ - result: Runtime.RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: Runtime.ExceptionDetails | undefined; - } - interface ScriptParsedEventDataType { - /** - * Identifier of the script parsed. - */ - scriptId: Runtime.ScriptId; - /** - * URL or name of the script parsed (if any). - */ - url: string; - /** - * Line offset of the script within the resource with given URL (for script tags). - */ - startLine: number; - /** - * Column offset of the script within the resource with given URL. - */ - startColumn: number; - /** - * Last line of the script. - */ - endLine: number; - /** - * Length of the last line of the script. - */ - endColumn: number; - /** - * Specifies script creation context. - */ - executionContextId: Runtime.ExecutionContextId; - /** - * Content hash of the script. - */ - hash: string; - /** - * Embedder-specific auxiliary data. - */ - executionContextAuxData?: {} | undefined; - /** - * True, if this script is generated as a result of the live edit operation. - * @experimental - */ - isLiveEdit?: boolean | undefined; - /** - * URL of source map associated with script (if any). - */ - sourceMapURL?: string | undefined; - /** - * True, if this script has sourceURL. - */ - hasSourceURL?: boolean | undefined; - /** - * True, if this script is ES6 module. - */ - isModule?: boolean | undefined; - /** - * This script length. - */ - length?: number | undefined; - /** - * JavaScript top stack frame of where the script parsed event was triggered if available. - * @experimental - */ - stackTrace?: Runtime.StackTrace | undefined; - } - interface ScriptFailedToParseEventDataType { - /** - * Identifier of the script parsed. - */ - scriptId: Runtime.ScriptId; - /** - * URL or name of the script parsed (if any). - */ - url: string; - /** - * Line offset of the script within the resource with given URL (for script tags). - */ - startLine: number; - /** - * Column offset of the script within the resource with given URL. - */ - startColumn: number; - /** - * Last line of the script. - */ - endLine: number; - /** - * Length of the last line of the script. - */ - endColumn: number; - /** - * Specifies script creation context. - */ - executionContextId: Runtime.ExecutionContextId; - /** - * Content hash of the script. - */ - hash: string; - /** - * Embedder-specific auxiliary data. - */ - executionContextAuxData?: {} | undefined; - /** - * URL of source map associated with script (if any). - */ - sourceMapURL?: string | undefined; - /** - * True, if this script has sourceURL. - */ - hasSourceURL?: boolean | undefined; - /** - * True, if this script is ES6 module. - */ - isModule?: boolean | undefined; - /** - * This script length. - */ - length?: number | undefined; - /** - * JavaScript top stack frame of where the script parsed event was triggered if available. - * @experimental - */ - stackTrace?: Runtime.StackTrace | undefined; - } - interface BreakpointResolvedEventDataType { - /** - * Breakpoint unique identifier. - */ - breakpointId: BreakpointId; - /** - * Actual breakpoint location. - */ - location: Location; - } - interface PausedEventDataType { - /** - * Call stack the virtual machine stopped on. - */ - callFrames: CallFrame[]; - /** - * Pause reason. - */ - reason: string; - /** - * Object containing break-specific auxiliary properties. - */ - data?: {} | undefined; - /** - * Hit breakpoints IDs - */ - hitBreakpoints?: string[] | undefined; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace | undefined; - /** - * Async stack trace, if any. - * @experimental - */ - asyncStackTraceId?: Runtime.StackTraceId | undefined; - /** - * Just scheduled async call will have this stack trace as parent stack during async execution. This field is available only after Debugger.stepInto call with breakOnAsynCall flag. - * @experimental - */ - asyncCallStackTraceId?: Runtime.StackTraceId | undefined; - } - } - namespace Console { - /** - * Console message. - */ - interface ConsoleMessage { - /** - * Message source. - */ - source: string; - /** - * Message severity. - */ - level: string; - /** - * Message text. - */ - text: string; - /** - * URL of the message origin. - */ - url?: string | undefined; - /** - * Line number in the resource that generated this message (1-based). - */ - line?: number | undefined; - /** - * Column number in the resource that generated this message (1-based). - */ - column?: number | undefined; - } - interface MessageAddedEventDataType { - /** - * Console message that has been added. - */ - message: ConsoleMessage; - } - } - namespace Profiler { - /** - * Profile node. Holds callsite information, execution statistics and child nodes. - */ - interface ProfileNode { - /** - * Unique id of the node. - */ - id: number; - /** - * Function location. - */ - callFrame: Runtime.CallFrame; - /** - * Number of samples where this node was on top of the call stack. - */ - hitCount?: number | undefined; - /** - * Child node ids. - */ - children?: number[] | undefined; - /** - * The reason of being not optimized. The function may be deoptimized or marked as don't optimize. - */ - deoptReason?: string | undefined; - /** - * An array of source position ticks. - */ - positionTicks?: PositionTickInfo[] | undefined; - } - /** - * Profile. - */ - interface Profile { - /** - * The list of profile nodes. First item is the root node. - */ - nodes: ProfileNode[]; - /** - * Profiling start timestamp in microseconds. - */ - startTime: number; - /** - * Profiling end timestamp in microseconds. - */ - endTime: number; - /** - * Ids of samples top nodes. - */ - samples?: number[] | undefined; - /** - * Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime. - */ - timeDeltas?: number[] | undefined; - } - /** - * Specifies a number of samples attributed to a certain source position. - */ - interface PositionTickInfo { - /** - * Source line number (1-based). - */ - line: number; - /** - * Number of samples attributed to the source line. - */ - ticks: number; - } - /** - * Coverage data for a source range. - */ - interface CoverageRange { - /** - * JavaScript script source offset for the range start. - */ - startOffset: number; - /** - * JavaScript script source offset for the range end. - */ - endOffset: number; - /** - * Collected execution count of the source range. - */ - count: number; - } - /** - * Coverage data for a JavaScript function. - */ - interface FunctionCoverage { - /** - * JavaScript function name. - */ - functionName: string; - /** - * Source ranges inside the function with coverage data. - */ - ranges: CoverageRange[]; - /** - * Whether coverage data for this function has block granularity. - */ - isBlockCoverage: boolean; - } - /** - * Coverage data for a JavaScript script. - */ - interface ScriptCoverage { - /** - * JavaScript script id. - */ - scriptId: Runtime.ScriptId; - /** - * JavaScript script name or url. - */ - url: string; - /** - * Functions contained in the script that has coverage data. - */ - functions: FunctionCoverage[]; - } - interface SetSamplingIntervalParameterType { - /** - * New sampling interval in microseconds. - */ - interval: number; - } - interface StartPreciseCoverageParameterType { - /** - * Collect accurate call counts beyond simple 'covered' or 'not covered'. - */ - callCount?: boolean | undefined; - /** - * Collect block-based coverage. - */ - detailed?: boolean | undefined; - } - interface StopReturnType { - /** - * Recorded profile. - */ - profile: Profile; - } - interface TakePreciseCoverageReturnType { - /** - * Coverage data for the current isolate. - */ - result: ScriptCoverage[]; - } - interface GetBestEffortCoverageReturnType { - /** - * Coverage data for the current isolate. - */ - result: ScriptCoverage[]; - } - interface ConsoleProfileStartedEventDataType { - id: string; - /** - * Location of console.profile(). - */ - location: Debugger.Location; - /** - * Profile title passed as an argument to console.profile(). - */ - title?: string | undefined; - } - interface ConsoleProfileFinishedEventDataType { - id: string; - /** - * Location of console.profileEnd(). - */ - location: Debugger.Location; - profile: Profile; - /** - * Profile title passed as an argument to console.profile(). - */ - title?: string | undefined; - } - } - namespace HeapProfiler { - /** - * Heap snapshot object id. - */ - type HeapSnapshotObjectId = string; - /** - * Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes. - */ - interface SamplingHeapProfileNode { - /** - * Function location. - */ - callFrame: Runtime.CallFrame; - /** - * Allocations size in bytes for the node excluding children. - */ - selfSize: number; - /** - * Child nodes. - */ - children: SamplingHeapProfileNode[]; - } - /** - * Profile. - */ - interface SamplingHeapProfile { - head: SamplingHeapProfileNode; - } - interface StartTrackingHeapObjectsParameterType { - trackAllocations?: boolean | undefined; - } - interface StopTrackingHeapObjectsParameterType { - /** - * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped. - */ - reportProgress?: boolean | undefined; - } - interface TakeHeapSnapshotParameterType { - /** - * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken. - */ - reportProgress?: boolean | undefined; - } - interface GetObjectByHeapObjectIdParameterType { - objectId: HeapSnapshotObjectId; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string | undefined; - } - interface AddInspectedHeapObjectParameterType { - /** - * Heap snapshot object id to be accessible by means of $x command line API. - */ - heapObjectId: HeapSnapshotObjectId; - } - interface GetHeapObjectIdParameterType { - /** - * Identifier of the object to get heap object id for. - */ - objectId: Runtime.RemoteObjectId; - } - interface StartSamplingParameterType { - /** - * Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes. - */ - samplingInterval?: number | undefined; - } - interface GetObjectByHeapObjectIdReturnType { - /** - * Evaluation result. - */ - result: Runtime.RemoteObject; - } - interface GetHeapObjectIdReturnType { - /** - * Id of the heap snapshot object corresponding to the passed remote object id. - */ - heapSnapshotObjectId: HeapSnapshotObjectId; - } - interface StopSamplingReturnType { - /** - * Recorded sampling heap profile. - */ - profile: SamplingHeapProfile; - } - interface GetSamplingProfileReturnType { - /** - * Return the sampling profile being collected. - */ - profile: SamplingHeapProfile; - } - interface AddHeapSnapshotChunkEventDataType { - chunk: string; - } - interface ReportHeapSnapshotProgressEventDataType { - done: number; - total: number; - finished?: boolean | undefined; - } - interface LastSeenObjectIdEventDataType { - lastSeenObjectId: number; - timestamp: number; - } - interface HeapStatsUpdateEventDataType { - /** - * An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment. - */ - statsUpdate: number[]; - } - } - namespace NodeTracing { - interface TraceConfig { - /** - * Controls how the trace buffer stores data. - */ - recordMode?: string | undefined; - /** - * Included category filters. - */ - includedCategories: string[]; - } - interface StartParameterType { - traceConfig: TraceConfig; - } - interface GetCategoriesReturnType { - /** - * A list of supported tracing categories. - */ - categories: string[]; - } - interface DataCollectedEventDataType { - value: Array<{}>; - } - } - namespace NodeWorker { - type WorkerID = string; - /** - * Unique identifier of attached debugging session. - */ - type SessionID = string; - interface WorkerInfo { - workerId: WorkerID; - type: string; - title: string; - url: string; - } - interface SendMessageToWorkerParameterType { - message: string; - /** - * Identifier of the session. - */ - sessionId: SessionID; - } - interface EnableParameterType { - /** - * Whether to new workers should be paused until the frontend sends `Runtime.runIfWaitingForDebugger` - * message to run them. - */ - waitForDebuggerOnStart: boolean; - } - interface DetachParameterType { - sessionId: SessionID; - } - interface AttachedToWorkerEventDataType { - /** - * Identifier assigned to the session used to send/receive messages. - */ - sessionId: SessionID; - workerInfo: WorkerInfo; - waitingForDebugger: boolean; - } - interface DetachedFromWorkerEventDataType { - /** - * Detached session identifier. - */ - sessionId: SessionID; - } - interface ReceivedMessageFromWorkerEventDataType { - /** - * Identifier of a session which sends a message. - */ - sessionId: SessionID; - message: string; - } - } - namespace Network { - /** - * Resource type as it was perceived by the rendering engine. - */ - type ResourceType = string; - /** - * Unique request identifier. - */ - type RequestId = string; - /** - * UTC time in seconds, counted from January 1, 1970. - */ - type TimeSinceEpoch = number; - /** - * Monotonically increasing time in seconds since an arbitrary point in the past. - */ - type MonotonicTime = number; - /** - * HTTP request data. - */ - interface Request { - url: string; - method: string; - headers: Headers; - } - /** - * HTTP response data. - */ - interface Response { - url: string; - status: number; - statusText: string; - headers: Headers; - } - /** - * Request / response headers as keys / values of JSON object. - */ - interface Headers { - } - interface RequestWillBeSentEventDataType { - /** - * Request identifier. - */ - requestId: RequestId; - /** - * Request data. - */ - request: Request; - /** - * Timestamp. - */ - timestamp: MonotonicTime; - /** - * Timestamp. - */ - wallTime: TimeSinceEpoch; - } - interface ResponseReceivedEventDataType { - /** - * Request identifier. - */ - requestId: RequestId; - /** - * Timestamp. - */ - timestamp: MonotonicTime; - /** - * Resource type. - */ - type: ResourceType; - /** - * Response data. - */ - response: Response; - } - interface LoadingFailedEventDataType { - /** - * Request identifier. - */ - requestId: RequestId; - /** - * Timestamp. - */ - timestamp: MonotonicTime; - /** - * Resource type. - */ - type: ResourceType; - /** - * Error message. - */ - errorText: string; - } - interface LoadingFinishedEventDataType { - /** - * Request identifier. - */ - requestId: RequestId; - /** - * Timestamp. - */ - timestamp: MonotonicTime; - } - } - namespace NodeRuntime { - interface NotifyWhenWaitingForDisconnectParameterType { - enabled: boolean; - } - } - - /** - * The `inspector.Session` is used for dispatching messages to the V8 inspector - * back-end and receiving message responses and notifications. - */ - class Session extends EventEmitter { - /** - * Create a new instance of the inspector.Session class. - * The inspector session needs to be connected through `session.connect()` before the messages can be dispatched to the inspector backend. - */ - constructor(); - - /** - * Connects a session to the inspector back-end. - */ - connect(): void; - - /** - * Connects a session to the inspector back-end. - * An exception will be thrown if this API was not called on a Worker thread. - * @since v12.11.0 - */ - connectToMainThread(): void; - - /** - * Immediately close the session. All pending message callbacks will be called with an error. - * `session.connect()` will need to be called to be able to send messages again. - * Reconnected session will lose all inspector state, such as enabled agents or configured breakpoints. - */ - disconnect(): void; - - /** - * Posts a message to the inspector back-end. `callback` will be notified when - * a response is received. `callback` is a function that accepts two optional - * arguments: error and message-specific result. - * - * ```js - * session.post('Runtime.evaluate', { expression: '2 + 2' }, - * (error, { result }) => console.log(result)); - * // Output: { type: 'number', value: 4, description: '4' } - * ``` - * - * The latest version of the V8 inspector protocol is published on the - * [Chrome DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/v8/). - * - * Node.js inspector supports all the Chrome DevTools Protocol domains declared - * by V8. Chrome DevTools Protocol domain provides an interface for interacting - * with one of the runtime agents used to inspect the application state and listen - * to the run-time events. - */ - post(method: string, callback?: (err: Error | null, params?: object) => void): void; - post(method: string, params?: object, callback?: (err: Error | null, params?: object) => void): void; - /** - * Returns supported domains. - */ - post(method: 'Schema.getDomains', callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => void): void; - /** - * Evaluates expression on global object. - */ - post(method: 'Runtime.evaluate', params?: Runtime.EvaluateParameterType, callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; - post(method: 'Runtime.evaluate', callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; - /** - * Add handler to promise with given promise object id. - */ - post(method: 'Runtime.awaitPromise', params?: Runtime.AwaitPromiseParameterType, callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; - post(method: 'Runtime.awaitPromise', callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; - /** - * Calls function with given declaration on the given object. Object group of the result is inherited from the target object. - */ - post(method: 'Runtime.callFunctionOn', params?: Runtime.CallFunctionOnParameterType, callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; - post(method: 'Runtime.callFunctionOn', callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; - /** - * Returns properties of a given object. Object group of the result is inherited from the target object. - */ - post(method: 'Runtime.getProperties', params?: Runtime.GetPropertiesParameterType, callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; - post(method: 'Runtime.getProperties', callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; - /** - * Releases remote object with given id. - */ - post(method: 'Runtime.releaseObject', params?: Runtime.ReleaseObjectParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Runtime.releaseObject', callback?: (err: Error | null) => void): void; - /** - * Releases all remote objects that belong to a given group. - */ - post(method: 'Runtime.releaseObjectGroup', params?: Runtime.ReleaseObjectGroupParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Runtime.releaseObjectGroup', callback?: (err: Error | null) => void): void; - /** - * Tells inspected instance to run if it was waiting for debugger to attach. - */ - post(method: 'Runtime.runIfWaitingForDebugger', callback?: (err: Error | null) => void): void; - /** - * Enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context. - */ - post(method: 'Runtime.enable', callback?: (err: Error | null) => void): void; - /** - * Disables reporting of execution contexts creation. - */ - post(method: 'Runtime.disable', callback?: (err: Error | null) => void): void; - /** - * Discards collected exceptions and console API calls. - */ - post(method: 'Runtime.discardConsoleEntries', callback?: (err: Error | null) => void): void; - /** - * @experimental - */ - post(method: 'Runtime.setCustomObjectFormatterEnabled', params?: Runtime.SetCustomObjectFormatterEnabledParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Runtime.setCustomObjectFormatterEnabled', callback?: (err: Error | null) => void): void; - /** - * Compiles expression. - */ - post(method: 'Runtime.compileScript', params?: Runtime.CompileScriptParameterType, callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; - post(method: 'Runtime.compileScript', callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; - /** - * Runs script with given id in a given context. - */ - post(method: 'Runtime.runScript', params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; - post(method: 'Runtime.runScript', callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; - post(method: 'Runtime.queryObjects', params?: Runtime.QueryObjectsParameterType, callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; - post(method: 'Runtime.queryObjects', callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; - /** - * Returns all let, const and class variables from global scope. - */ - post( - method: 'Runtime.globalLexicalScopeNames', - params?: Runtime.GlobalLexicalScopeNamesParameterType, - callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void - ): void; - post(method: 'Runtime.globalLexicalScopeNames', callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void; - /** - * Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. - */ - post(method: 'Debugger.enable', callback?: (err: Error | null, params: Debugger.EnableReturnType) => void): void; - /** - * Disables debugger for given page. - */ - post(method: 'Debugger.disable', callback?: (err: Error | null) => void): void; - /** - * Activates / deactivates all breakpoints on the page. - */ - post(method: 'Debugger.setBreakpointsActive', params?: Debugger.SetBreakpointsActiveParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setBreakpointsActive', callback?: (err: Error | null) => void): void; - /** - * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). - */ - post(method: 'Debugger.setSkipAllPauses', params?: Debugger.SetSkipAllPausesParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setSkipAllPauses', callback?: (err: Error | null) => void): void; - /** - * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads. - */ - post(method: 'Debugger.setBreakpointByUrl', params?: Debugger.SetBreakpointByUrlParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; - post(method: 'Debugger.setBreakpointByUrl', callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; - /** - * Sets JavaScript breakpoint at a given location. - */ - post(method: 'Debugger.setBreakpoint', params?: Debugger.SetBreakpointParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; - post(method: 'Debugger.setBreakpoint', callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; - /** - * Removes JavaScript breakpoint. - */ - post(method: 'Debugger.removeBreakpoint', params?: Debugger.RemoveBreakpointParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.removeBreakpoint', callback?: (err: Error | null) => void): void; - /** - * Returns possible locations for breakpoint. scriptId in start and end range locations should be the same. - */ - post( - method: 'Debugger.getPossibleBreakpoints', - params?: Debugger.GetPossibleBreakpointsParameterType, - callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void - ): void; - post(method: 'Debugger.getPossibleBreakpoints', callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void; - /** - * Continues execution until specific location is reached. - */ - post(method: 'Debugger.continueToLocation', params?: Debugger.ContinueToLocationParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.continueToLocation', callback?: (err: Error | null) => void): void; - /** - * @experimental - */ - post(method: 'Debugger.pauseOnAsyncCall', params?: Debugger.PauseOnAsyncCallParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.pauseOnAsyncCall', callback?: (err: Error | null) => void): void; - /** - * Steps over the statement. - */ - post(method: 'Debugger.stepOver', callback?: (err: Error | null) => void): void; - /** - * Steps into the function call. - */ - post(method: 'Debugger.stepInto', params?: Debugger.StepIntoParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.stepInto', callback?: (err: Error | null) => void): void; - /** - * Steps out of the function call. - */ - post(method: 'Debugger.stepOut', callback?: (err: Error | null) => void): void; - /** - * Stops on the next JavaScript statement. - */ - post(method: 'Debugger.pause', callback?: (err: Error | null) => void): void; - /** - * This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and Debugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled before next pause. Returns success when async task is actually scheduled, returns error if no task were scheduled or another scheduleStepIntoAsync was called. - * @experimental - */ - post(method: 'Debugger.scheduleStepIntoAsync', callback?: (err: Error | null) => void): void; - /** - * Resumes JavaScript execution. - */ - post(method: 'Debugger.resume', callback?: (err: Error | null) => void): void; - /** - * Returns stack trace with given stackTraceId. - * @experimental - */ - post(method: 'Debugger.getStackTrace', params?: Debugger.GetStackTraceParameterType, callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; - post(method: 'Debugger.getStackTrace', callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; - /** - * Searches for given string in script content. - */ - post(method: 'Debugger.searchInContent', params?: Debugger.SearchInContentParameterType, callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; - post(method: 'Debugger.searchInContent', callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; - /** - * Edits JavaScript source live. - */ - post(method: 'Debugger.setScriptSource', params?: Debugger.SetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; - post(method: 'Debugger.setScriptSource', callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; - /** - * Restarts particular call frame from the beginning. - */ - post(method: 'Debugger.restartFrame', params?: Debugger.RestartFrameParameterType, callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; - post(method: 'Debugger.restartFrame', callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; - /** - * Returns source for the script with given id. - */ - post(method: 'Debugger.getScriptSource', params?: Debugger.GetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; - post(method: 'Debugger.getScriptSource', callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; - /** - * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none. - */ - post(method: 'Debugger.setPauseOnExceptions', params?: Debugger.SetPauseOnExceptionsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setPauseOnExceptions', callback?: (err: Error | null) => void): void; - /** - * Evaluates expression on a given call frame. - */ - post(method: 'Debugger.evaluateOnCallFrame', params?: Debugger.EvaluateOnCallFrameParameterType, callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; - post(method: 'Debugger.evaluateOnCallFrame', callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; - /** - * Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually. - */ - post(method: 'Debugger.setVariableValue', params?: Debugger.SetVariableValueParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setVariableValue', callback?: (err: Error | null) => void): void; - /** - * Changes return value in top frame. Available only at return break position. - * @experimental - */ - post(method: 'Debugger.setReturnValue', params?: Debugger.SetReturnValueParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setReturnValue', callback?: (err: Error | null) => void): void; - /** - * Enables or disables async call stacks tracking. - */ - post(method: 'Debugger.setAsyncCallStackDepth', params?: Debugger.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setAsyncCallStackDepth', callback?: (err: Error | null) => void): void; - /** - * Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. - * @experimental - */ - post(method: 'Debugger.setBlackboxPatterns', params?: Debugger.SetBlackboxPatternsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setBlackboxPatterns', callback?: (err: Error | null) => void): void; - /** - * Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn't blackboxed. Array should be sorted. - * @experimental - */ - post(method: 'Debugger.setBlackboxedRanges', params?: Debugger.SetBlackboxedRangesParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setBlackboxedRanges', callback?: (err: Error | null) => void): void; - /** - * Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification. - */ - post(method: 'Console.enable', callback?: (err: Error | null) => void): void; - /** - * Disables console domain, prevents further console messages from being reported to the client. - */ - post(method: 'Console.disable', callback?: (err: Error | null) => void): void; - /** - * Does nothing. - */ - post(method: 'Console.clearMessages', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.enable', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.disable', callback?: (err: Error | null) => void): void; - /** - * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. - */ - post(method: 'Profiler.setSamplingInterval', params?: Profiler.SetSamplingIntervalParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Profiler.setSamplingInterval', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.start', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.stop', callback?: (err: Error | null, params: Profiler.StopReturnType) => void): void; - /** - * Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters. - */ - post(method: 'Profiler.startPreciseCoverage', params?: Profiler.StartPreciseCoverageParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Profiler.startPreciseCoverage', callback?: (err: Error | null) => void): void; - /** - * Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code. - */ - post(method: 'Profiler.stopPreciseCoverage', callback?: (err: Error | null) => void): void; - /** - * Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started. - */ - post(method: 'Profiler.takePreciseCoverage', callback?: (err: Error | null, params: Profiler.TakePreciseCoverageReturnType) => void): void; - /** - * Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection. - */ - post(method: 'Profiler.getBestEffortCoverage', callback?: (err: Error | null, params: Profiler.GetBestEffortCoverageReturnType) => void): void; - post(method: 'HeapProfiler.enable', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.disable', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.startTrackingHeapObjects', params?: HeapProfiler.StartTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.startTrackingHeapObjects', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.stopTrackingHeapObjects', params?: HeapProfiler.StopTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.stopTrackingHeapObjects', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.takeHeapSnapshot', params?: HeapProfiler.TakeHeapSnapshotParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.takeHeapSnapshot', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.collectGarbage', callback?: (err: Error | null) => void): void; - post( - method: 'HeapProfiler.getObjectByHeapObjectId', - params?: HeapProfiler.GetObjectByHeapObjectIdParameterType, - callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void - ): void; - post(method: 'HeapProfiler.getObjectByHeapObjectId', callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void; - /** - * Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions). - */ - post(method: 'HeapProfiler.addInspectedHeapObject', params?: HeapProfiler.AddInspectedHeapObjectParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.addInspectedHeapObject', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.getHeapObjectId', params?: HeapProfiler.GetHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; - post(method: 'HeapProfiler.getHeapObjectId', callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; - post(method: 'HeapProfiler.startSampling', params?: HeapProfiler.StartSamplingParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.startSampling', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.stopSampling', callback?: (err: Error | null, params: HeapProfiler.StopSamplingReturnType) => void): void; - post(method: 'HeapProfiler.getSamplingProfile', callback?: (err: Error | null, params: HeapProfiler.GetSamplingProfileReturnType) => void): void; - /** - * Gets supported tracing categories. - */ - post(method: 'NodeTracing.getCategories', callback?: (err: Error | null, params: NodeTracing.GetCategoriesReturnType) => void): void; - /** - * Start trace events collection. - */ - post(method: 'NodeTracing.start', params?: NodeTracing.StartParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeTracing.start', callback?: (err: Error | null) => void): void; - /** - * Stop trace events collection. Remaining collected events will be sent as a sequence of - * dataCollected events followed by tracingComplete event. - */ - post(method: 'NodeTracing.stop', callback?: (err: Error | null) => void): void; - /** - * Sends protocol message over session with given id. - */ - post(method: 'NodeWorker.sendMessageToWorker', params?: NodeWorker.SendMessageToWorkerParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeWorker.sendMessageToWorker', callback?: (err: Error | null) => void): void; - /** - * Instructs the inspector to attach to running workers. Will also attach to new workers - * as they start - */ - post(method: 'NodeWorker.enable', params?: NodeWorker.EnableParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeWorker.enable', callback?: (err: Error | null) => void): void; - /** - * Detaches from all running workers and disables attaching to new workers as they are started. - */ - post(method: 'NodeWorker.disable', callback?: (err: Error | null) => void): void; - /** - * Detached from the worker with given sessionId. - */ - post(method: 'NodeWorker.detach', params?: NodeWorker.DetachParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeWorker.detach', callback?: (err: Error | null) => void): void; - /** - * Disables network tracking, prevents network events from being sent to the client. - */ - post(method: 'Network.disable', callback?: (err: Error | null) => void): void; - /** - * Enables network tracking, network events will now be delivered to the client. - */ - post(method: 'Network.enable', callback?: (err: Error | null) => void): void; - /** - * Enable the NodeRuntime events except by `NodeRuntime.waitingForDisconnect`. - */ - post(method: 'NodeRuntime.enable', callback?: (err: Error | null) => void): void; - /** - * Disable NodeRuntime events - */ - post(method: 'NodeRuntime.disable', callback?: (err: Error | null) => void): void; - /** - * Enable the `NodeRuntime.waitingForDisconnect`. - */ - post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', callback?: (err: Error | null) => void): void; - - addListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - addListener(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; - /** - * Issued when new execution context is created. - */ - addListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - addListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - addListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - addListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - addListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - addListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - addListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - addListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - addListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - addListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - addListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - addListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - addListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - addListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - addListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - addListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - addListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - addListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - addListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - addListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - addListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - addListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - addListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - addListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - addListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Fired when page is about to send HTTP request. - */ - addListener(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; - /** - * Fired when HTTP response is available. - */ - addListener(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - addListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - addListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - addListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - /** - * This event is fired when the runtime is waiting for the debugger. For - * example, when inspector.waitingForDebugger is called - */ - addListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'inspectorNotification', message: InspectorNotification): boolean; - emit(event: 'Runtime.executionContextCreated', message: InspectorNotification): boolean; - emit(event: 'Runtime.executionContextDestroyed', message: InspectorNotification): boolean; - emit(event: 'Runtime.executionContextsCleared'): boolean; - emit(event: 'Runtime.exceptionThrown', message: InspectorNotification): boolean; - emit(event: 'Runtime.exceptionRevoked', message: InspectorNotification): boolean; - emit(event: 'Runtime.consoleAPICalled', message: InspectorNotification): boolean; - emit(event: 'Runtime.inspectRequested', message: InspectorNotification): boolean; - emit(event: 'Debugger.scriptParsed', message: InspectorNotification): boolean; - emit(event: 'Debugger.scriptFailedToParse', message: InspectorNotification): boolean; - emit(event: 'Debugger.breakpointResolved', message: InspectorNotification): boolean; - emit(event: 'Debugger.paused', message: InspectorNotification): boolean; - emit(event: 'Debugger.resumed'): boolean; - emit(event: 'Console.messageAdded', message: InspectorNotification): boolean; - emit(event: 'Profiler.consoleProfileStarted', message: InspectorNotification): boolean; - emit(event: 'Profiler.consoleProfileFinished', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.addHeapSnapshotChunk', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.resetProfiles'): boolean; - emit(event: 'HeapProfiler.reportHeapSnapshotProgress', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.lastSeenObjectId', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.heapStatsUpdate', message: InspectorNotification): boolean; - emit(event: 'NodeTracing.dataCollected', message: InspectorNotification): boolean; - emit(event: 'NodeTracing.tracingComplete'): boolean; - emit(event: 'NodeWorker.attachedToWorker', message: InspectorNotification): boolean; - emit(event: 'NodeWorker.detachedFromWorker', message: InspectorNotification): boolean; - emit(event: 'NodeWorker.receivedMessageFromWorker', message: InspectorNotification): boolean; - emit(event: 'Network.requestWillBeSent', message: InspectorNotification): boolean; - emit(event: 'Network.responseReceived', message: InspectorNotification): boolean; - emit(event: 'Network.loadingFailed', message: InspectorNotification): boolean; - emit(event: 'Network.loadingFinished', message: InspectorNotification): boolean; - emit(event: 'NodeRuntime.waitingForDisconnect'): boolean; - emit(event: 'NodeRuntime.waitingForDebugger'): boolean; - on(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - on(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; - /** - * Issued when new execution context is created. - */ - on(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - on(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - on(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - on(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - on(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - on(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - on(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - on(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - on(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - on(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - on(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - on(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - on(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - on(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - on(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - on(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - on(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - on(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - on(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - on(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - on(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - on(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - on(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - on(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - on(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Fired when page is about to send HTTP request. - */ - on(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; - /** - * Fired when HTTP response is available. - */ - on(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - on(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - on(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - on(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - /** - * This event is fired when the runtime is waiting for the debugger. For - * example, when inspector.waitingForDebugger is called - */ - on(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - once(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; - /** - * Issued when new execution context is created. - */ - once(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - once(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - once(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - once(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - once(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - once(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - once(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - once(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - once(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - once(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - once(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - once(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - once(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - once(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - once(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - once(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - once(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - once(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - once(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - once(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - once(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - once(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - once(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - once(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - once(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Fired when page is about to send HTTP request. - */ - once(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; - /** - * Fired when HTTP response is available. - */ - once(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - once(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - once(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - once(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - /** - * This event is fired when the runtime is waiting for the debugger. For - * example, when inspector.waitingForDebugger is called - */ - once(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - prependListener(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; - /** - * Issued when new execution context is created. - */ - prependListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - prependListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - prependListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - prependListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - prependListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - prependListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - prependListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - prependListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - prependListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - prependListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - prependListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - prependListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - prependListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - prependListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - prependListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - prependListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - prependListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - prependListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - prependListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - prependListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - prependListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - prependListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Fired when page is about to send HTTP request. - */ - prependListener(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; - /** - * Fired when HTTP response is available. - */ - prependListener(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - prependListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - /** - * This event is fired when the runtime is waiting for the debugger. For - * example, when inspector.waitingForDebugger is called - */ - prependListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - prependOnceListener(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; - /** - * Issued when new execution context is created. - */ - prependOnceListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - prependOnceListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - prependOnceListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - prependOnceListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - prependOnceListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - prependOnceListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - prependOnceListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - prependOnceListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - prependOnceListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - prependOnceListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - prependOnceListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - prependOnceListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - prependOnceListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - prependOnceListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - prependOnceListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - prependOnceListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - prependOnceListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - prependOnceListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - prependOnceListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - prependOnceListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - prependOnceListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - prependOnceListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Fired when page is about to send HTTP request. - */ - prependOnceListener(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; - /** - * Fired when HTTP response is available. - */ - prependOnceListener(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - prependOnceListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - /** - * This event is fired when the runtime is waiting for the debugger. For - * example, when inspector.waitingForDebugger is called - */ - prependOnceListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - } - - /** - * Activate inspector on host and port. Equivalent to `node --inspect=[[host:]port]`, but can be done programmatically after node has - * started. - * - * If wait is `true`, will block until a client has connected to the inspect port - * and flow control has been passed to the debugger client. - * - * See the [security warning](https://nodejs.org/docs/latest-v22.x/api/cli.html#warning-binding-inspector-to-a-public-ipport-combination-is-insecure) - * regarding the `host` parameter usage. - * @param port Port to listen on for inspector connections. Defaults to what was specified on the CLI. - * @param host Host to listen on for inspector connections. Defaults to what was specified on the CLI. - * @param wait Block until a client has connected. Defaults to what was specified on the CLI. - * @returns Disposable that calls `inspector.close()`. - */ - function open(port?: number, host?: string, wait?: boolean): Disposable; - - /** - * Deactivate the inspector. Blocks until there are no active connections. - */ - function close(): void; - - /** - * Return the URL of the active inspector, or `undefined` if there is none. - * - * ```console - * $ node --inspect -p 'inspector.url()' - * Debugger listening on ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34 - * For help, see: https://nodejs.org/en/docs/inspector - * ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34 - * - * $ node --inspect=localhost:3000 -p 'inspector.url()' - * Debugger listening on ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a - * For help, see: https://nodejs.org/en/docs/inspector - * ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a - * - * $ node -p 'inspector.url()' - * undefined - * ``` - */ - function url(): string | undefined; - - /** - * Blocks until a client (existing or connected later) has sent `Runtime.runIfWaitingForDebugger` command. - * - * An exception will be thrown if there is no active inspector. - * @since v12.7.0 - */ - function waitForDebugger(): void; - - // These methods are exposed by the V8 inspector console API (inspector/v8-console.h). - // The method signatures differ from those of the Node.js console, and are deliberately - // typed permissively. - interface InspectorConsole { - debug(...data: any[]): void; - error(...data: any[]): void; - info(...data: any[]): void; - log(...data: any[]): void; - warn(...data: any[]): void; - dir(...data: any[]): void; - dirxml(...data: any[]): void; - table(...data: any[]): void; - trace(...data: any[]): void; - group(...data: any[]): void; - groupCollapsed(...data: any[]): void; - groupEnd(...data: any[]): void; - clear(...data: any[]): void; - count(label?: any): void; - countReset(label?: any): void; - assert(value?: any, ...data: any[]): void; - profile(label?: any): void; - profileEnd(label?: any): void; - time(label?: any): void; - timeLog(label?: any): void; - timeStamp(label?: any): void; - } - - /** - * An object to send messages to the remote inspector console. - * @since v11.0.0 - */ - const console: InspectorConsole; - - // DevTools protocol event broadcast methods - namespace Network { - /** - * This feature is only available with the `--experimental-network-inspection` flag enabled. - * - * Broadcasts the `Network.requestWillBeSent` event to connected frontends. This event indicates that - * the application is about to send an HTTP request. - * @since v22.6.0 - * @experimental - */ - function requestWillBeSent(params: RequestWillBeSentEventDataType): void; - /** - * This feature is only available with the `--experimental-network-inspection` flag enabled. - * - * Broadcasts the `Network.responseReceived` event to connected frontends. This event indicates that - * HTTP response is available. - * @since v22.6.0 - * @experimental - */ - function responseReceived(params: ResponseReceivedEventDataType): void; - /** - * This feature is only available with the `--experimental-network-inspection` flag enabled. - * - * Broadcasts the `Network.loadingFinished` event to connected frontends. This event indicates that - * HTTP request has finished loading. - * @since v22.6.0 - * @experimental - */ - function loadingFinished(params: LoadingFinishedEventDataType): void; - /** - * This feature is only available with the `--experimental-network-inspection` flag enabled. - * - * Broadcasts the `Network.loadingFailed` event to connected frontends. This event indicates that - * HTTP request has failed to load. - * @since v22.7.0 - * @experimental - */ - function loadingFailed(params: LoadingFailedEventDataType): void; - } -} - -/** - * The `node:inspector` module provides an API for interacting with the V8 - * inspector. - */ -declare module 'node:inspector' { - export * from 'inspector'; -} - -/** - * The `node:inspector/promises` module provides an API for interacting with the V8 - * inspector. - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/inspector/promises.js) - * @since v19.0.0 - */ -declare module 'inspector/promises' { - import EventEmitter = require('node:events'); - import { - open, - close, - url, - waitForDebugger, - console, - InspectorNotification, - Schema, - Runtime, - Debugger, - Console, - Profiler, - HeapProfiler, - NodeTracing, - NodeWorker, - Network, - NodeRuntime, - } from 'inspector'; - - /** - * The `inspector.Session` is used for dispatching messages to the V8 inspector - * back-end and receiving message responses and notifications. - * @since v19.0.0 - */ - class Session extends EventEmitter { - /** - * Create a new instance of the `inspector.Session` class. - * The inspector session needs to be connected through `session.connect()` before the messages can be dispatched to the inspector backend. - */ - constructor(); - - /** - * Connects a session to the inspector back-end. - */ - connect(): void; - - /** - * Connects a session to the inspector back-end. - * An exception will be thrown if this API was not called on a Worker thread. - */ - connectToMainThread(): void; - - /** - * Immediately close the session. All pending message callbacks will be called with an error. - * `session.connect()` will need to be called to be able to send messages again. - * Reconnected session will lose all inspector state, such as enabled agents or configured breakpoints. - */ - disconnect(): void; - - /** - * Posts a message to the inspector back-end. - * - * ```js - * import { Session } from 'node:inspector/promises'; - * try { - * const session = new Session(); - * session.connect(); - * const result = await session.post('Runtime.evaluate', { expression: '2 + 2' }); - * console.log(result); - * } catch (error) { - * console.error(error); - * } - * // Output: { result: { type: 'number', value: 4, description: '4' } } - * ``` - * - * The latest version of the V8 inspector protocol is published on the - * [Chrome DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/v8/). - * - * Node.js inspector supports all the Chrome DevTools Protocol domains declared - * by V8. Chrome DevTools Protocol domain provides an interface for interacting - * with one of the runtime agents used to inspect the application state and listen - * to the run-time events. - */ - post(method: string, params?: object): Promise; - /** - * Returns supported domains. - */ - post(method: 'Schema.getDomains'): Promise; - /** - * Evaluates expression on global object. - */ - post(method: 'Runtime.evaluate', params?: Runtime.EvaluateParameterType): Promise; - /** - * Add handler to promise with given promise object id. - */ - post(method: 'Runtime.awaitPromise', params?: Runtime.AwaitPromiseParameterType): Promise; - /** - * Calls function with given declaration on the given object. Object group of the result is inherited from the target object. - */ - post(method: 'Runtime.callFunctionOn', params?: Runtime.CallFunctionOnParameterType): Promise; - /** - * Returns properties of a given object. Object group of the result is inherited from the target object. - */ - post(method: 'Runtime.getProperties', params?: Runtime.GetPropertiesParameterType): Promise; - /** - * Releases remote object with given id. - */ - post(method: 'Runtime.releaseObject', params?: Runtime.ReleaseObjectParameterType): Promise; - /** - * Releases all remote objects that belong to a given group. - */ - post(method: 'Runtime.releaseObjectGroup', params?: Runtime.ReleaseObjectGroupParameterType): Promise; - /** - * Tells inspected instance to run if it was waiting for debugger to attach. - */ - post(method: 'Runtime.runIfWaitingForDebugger'): Promise; - /** - * Enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context. - */ - post(method: 'Runtime.enable'): Promise; - /** - * Disables reporting of execution contexts creation. - */ - post(method: 'Runtime.disable'): Promise; - /** - * Discards collected exceptions and console API calls. - */ - post(method: 'Runtime.discardConsoleEntries'): Promise; - /** - * @experimental - */ - post(method: 'Runtime.setCustomObjectFormatterEnabled', params?: Runtime.SetCustomObjectFormatterEnabledParameterType): Promise; - /** - * Compiles expression. - */ - post(method: 'Runtime.compileScript', params?: Runtime.CompileScriptParameterType): Promise; - /** - * Runs script with given id in a given context. - */ - post(method: 'Runtime.runScript', params?: Runtime.RunScriptParameterType): Promise; - post(method: 'Runtime.queryObjects', params?: Runtime.QueryObjectsParameterType): Promise; - /** - * Returns all let, const and class variables from global scope. - */ - post(method: 'Runtime.globalLexicalScopeNames', params?: Runtime.GlobalLexicalScopeNamesParameterType): Promise; - /** - * Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. - */ - post(method: 'Debugger.enable'): Promise; - /** - * Disables debugger for given page. - */ - post(method: 'Debugger.disable'): Promise; - /** - * Activates / deactivates all breakpoints on the page. - */ - post(method: 'Debugger.setBreakpointsActive', params?: Debugger.SetBreakpointsActiveParameterType): Promise; - /** - * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). - */ - post(method: 'Debugger.setSkipAllPauses', params?: Debugger.SetSkipAllPausesParameterType): Promise; - /** - * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads. - */ - post(method: 'Debugger.setBreakpointByUrl', params?: Debugger.SetBreakpointByUrlParameterType): Promise; - /** - * Sets JavaScript breakpoint at a given location. - */ - post(method: 'Debugger.setBreakpoint', params?: Debugger.SetBreakpointParameterType): Promise; - /** - * Removes JavaScript breakpoint. - */ - post(method: 'Debugger.removeBreakpoint', params?: Debugger.RemoveBreakpointParameterType): Promise; - /** - * Returns possible locations for breakpoint. scriptId in start and end range locations should be the same. - */ - post(method: 'Debugger.getPossibleBreakpoints', params?: Debugger.GetPossibleBreakpointsParameterType): Promise; - /** - * Continues execution until specific location is reached. - */ - post(method: 'Debugger.continueToLocation', params?: Debugger.ContinueToLocationParameterType): Promise; - /** - * @experimental - */ - post(method: 'Debugger.pauseOnAsyncCall', params?: Debugger.PauseOnAsyncCallParameterType): Promise; - /** - * Steps over the statement. - */ - post(method: 'Debugger.stepOver'): Promise; - /** - * Steps into the function call. - */ - post(method: 'Debugger.stepInto', params?: Debugger.StepIntoParameterType): Promise; - /** - * Steps out of the function call. - */ - post(method: 'Debugger.stepOut'): Promise; - /** - * Stops on the next JavaScript statement. - */ - post(method: 'Debugger.pause'): Promise; - /** - * This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and Debugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled before next pause. Returns success when async task is actually scheduled, returns error if no task were scheduled or another scheduleStepIntoAsync was called. - * @experimental - */ - post(method: 'Debugger.scheduleStepIntoAsync'): Promise; - /** - * Resumes JavaScript execution. - */ - post(method: 'Debugger.resume'): Promise; - /** - * Returns stack trace with given stackTraceId. - * @experimental - */ - post(method: 'Debugger.getStackTrace', params?: Debugger.GetStackTraceParameterType): Promise; - /** - * Searches for given string in script content. - */ - post(method: 'Debugger.searchInContent', params?: Debugger.SearchInContentParameterType): Promise; - /** - * Edits JavaScript source live. - */ - post(method: 'Debugger.setScriptSource', params?: Debugger.SetScriptSourceParameterType): Promise; - /** - * Restarts particular call frame from the beginning. - */ - post(method: 'Debugger.restartFrame', params?: Debugger.RestartFrameParameterType): Promise; - /** - * Returns source for the script with given id. - */ - post(method: 'Debugger.getScriptSource', params?: Debugger.GetScriptSourceParameterType): Promise; - /** - * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none. - */ - post(method: 'Debugger.setPauseOnExceptions', params?: Debugger.SetPauseOnExceptionsParameterType): Promise; - /** - * Evaluates expression on a given call frame. - */ - post(method: 'Debugger.evaluateOnCallFrame', params?: Debugger.EvaluateOnCallFrameParameterType): Promise; - /** - * Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually. - */ - post(method: 'Debugger.setVariableValue', params?: Debugger.SetVariableValueParameterType): Promise; - /** - * Changes return value in top frame. Available only at return break position. - * @experimental - */ - post(method: 'Debugger.setReturnValue', params?: Debugger.SetReturnValueParameterType): Promise; - /** - * Enables or disables async call stacks tracking. - */ - post(method: 'Debugger.setAsyncCallStackDepth', params?: Debugger.SetAsyncCallStackDepthParameterType): Promise; - /** - * Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. - * @experimental - */ - post(method: 'Debugger.setBlackboxPatterns', params?: Debugger.SetBlackboxPatternsParameterType): Promise; - /** - * Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn't blackboxed. Array should be sorted. - * @experimental - */ - post(method: 'Debugger.setBlackboxedRanges', params?: Debugger.SetBlackboxedRangesParameterType): Promise; - /** - * Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification. - */ - post(method: 'Console.enable'): Promise; - /** - * Disables console domain, prevents further console messages from being reported to the client. - */ - post(method: 'Console.disable'): Promise; - /** - * Does nothing. - */ - post(method: 'Console.clearMessages'): Promise; - post(method: 'Profiler.enable'): Promise; - post(method: 'Profiler.disable'): Promise; - /** - * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. - */ - post(method: 'Profiler.setSamplingInterval', params?: Profiler.SetSamplingIntervalParameterType): Promise; - post(method: 'Profiler.start'): Promise; - post(method: 'Profiler.stop'): Promise; - /** - * Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters. - */ - post(method: 'Profiler.startPreciseCoverage', params?: Profiler.StartPreciseCoverageParameterType): Promise; - /** - * Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code. - */ - post(method: 'Profiler.stopPreciseCoverage'): Promise; - /** - * Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started. - */ - post(method: 'Profiler.takePreciseCoverage'): Promise; - /** - * Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection. - */ - post(method: 'Profiler.getBestEffortCoverage'): Promise; - post(method: 'HeapProfiler.enable'): Promise; - post(method: 'HeapProfiler.disable'): Promise; - post(method: 'HeapProfiler.startTrackingHeapObjects', params?: HeapProfiler.StartTrackingHeapObjectsParameterType): Promise; - post(method: 'HeapProfiler.stopTrackingHeapObjects', params?: HeapProfiler.StopTrackingHeapObjectsParameterType): Promise; - post(method: 'HeapProfiler.takeHeapSnapshot', params?: HeapProfiler.TakeHeapSnapshotParameterType): Promise; - post(method: 'HeapProfiler.collectGarbage'): Promise; - post(method: 'HeapProfiler.getObjectByHeapObjectId', params?: HeapProfiler.GetObjectByHeapObjectIdParameterType): Promise; - /** - * Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions). - */ - post(method: 'HeapProfiler.addInspectedHeapObject', params?: HeapProfiler.AddInspectedHeapObjectParameterType): Promise; - post(method: 'HeapProfiler.getHeapObjectId', params?: HeapProfiler.GetHeapObjectIdParameterType): Promise; - post(method: 'HeapProfiler.startSampling', params?: HeapProfiler.StartSamplingParameterType): Promise; - post(method: 'HeapProfiler.stopSampling'): Promise; - post(method: 'HeapProfiler.getSamplingProfile'): Promise; - /** - * Gets supported tracing categories. - */ - post(method: 'NodeTracing.getCategories'): Promise; - /** - * Start trace events collection. - */ - post(method: 'NodeTracing.start', params?: NodeTracing.StartParameterType): Promise; - /** - * Stop trace events collection. Remaining collected events will be sent as a sequence of - * dataCollected events followed by tracingComplete event. - */ - post(method: 'NodeTracing.stop'): Promise; - /** - * Sends protocol message over session with given id. - */ - post(method: 'NodeWorker.sendMessageToWorker', params?: NodeWorker.SendMessageToWorkerParameterType): Promise; - /** - * Instructs the inspector to attach to running workers. Will also attach to new workers - * as they start - */ - post(method: 'NodeWorker.enable', params?: NodeWorker.EnableParameterType): Promise; - /** - * Detaches from all running workers and disables attaching to new workers as they are started. - */ - post(method: 'NodeWorker.disable'): Promise; - /** - * Detached from the worker with given sessionId. - */ - post(method: 'NodeWorker.detach', params?: NodeWorker.DetachParameterType): Promise; - /** - * Disables network tracking, prevents network events from being sent to the client. - */ - post(method: 'Network.disable'): Promise; - /** - * Enables network tracking, network events will now be delivered to the client. - */ - post(method: 'Network.enable'): Promise; - /** - * Enable the NodeRuntime events except by `NodeRuntime.waitingForDisconnect`. - */ - post(method: 'NodeRuntime.enable'): Promise; - /** - * Disable NodeRuntime events - */ - post(method: 'NodeRuntime.disable'): Promise; - /** - * Enable the `NodeRuntime.waitingForDisconnect`. - */ - post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType): Promise; - - addListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - addListener(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; - /** - * Issued when new execution context is created. - */ - addListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - addListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - addListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - addListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - addListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - addListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - addListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - addListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - addListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - addListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - addListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - addListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - addListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - addListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - addListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - addListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - addListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - addListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - addListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - addListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - addListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - addListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - addListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - addListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - addListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Fired when page is about to send HTTP request. - */ - addListener(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; - /** - * Fired when HTTP response is available. - */ - addListener(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - addListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - addListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - addListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - /** - * This event is fired when the runtime is waiting for the debugger. For - * example, when inspector.waitingForDebugger is called - */ - addListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'inspectorNotification', message: InspectorNotification): boolean; - emit(event: 'Runtime.executionContextCreated', message: InspectorNotification): boolean; - emit(event: 'Runtime.executionContextDestroyed', message: InspectorNotification): boolean; - emit(event: 'Runtime.executionContextsCleared'): boolean; - emit(event: 'Runtime.exceptionThrown', message: InspectorNotification): boolean; - emit(event: 'Runtime.exceptionRevoked', message: InspectorNotification): boolean; - emit(event: 'Runtime.consoleAPICalled', message: InspectorNotification): boolean; - emit(event: 'Runtime.inspectRequested', message: InspectorNotification): boolean; - emit(event: 'Debugger.scriptParsed', message: InspectorNotification): boolean; - emit(event: 'Debugger.scriptFailedToParse', message: InspectorNotification): boolean; - emit(event: 'Debugger.breakpointResolved', message: InspectorNotification): boolean; - emit(event: 'Debugger.paused', message: InspectorNotification): boolean; - emit(event: 'Debugger.resumed'): boolean; - emit(event: 'Console.messageAdded', message: InspectorNotification): boolean; - emit(event: 'Profiler.consoleProfileStarted', message: InspectorNotification): boolean; - emit(event: 'Profiler.consoleProfileFinished', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.addHeapSnapshotChunk', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.resetProfiles'): boolean; - emit(event: 'HeapProfiler.reportHeapSnapshotProgress', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.lastSeenObjectId', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.heapStatsUpdate', message: InspectorNotification): boolean; - emit(event: 'NodeTracing.dataCollected', message: InspectorNotification): boolean; - emit(event: 'NodeTracing.tracingComplete'): boolean; - emit(event: 'NodeWorker.attachedToWorker', message: InspectorNotification): boolean; - emit(event: 'NodeWorker.detachedFromWorker', message: InspectorNotification): boolean; - emit(event: 'NodeWorker.receivedMessageFromWorker', message: InspectorNotification): boolean; - emit(event: 'Network.requestWillBeSent', message: InspectorNotification): boolean; - emit(event: 'Network.responseReceived', message: InspectorNotification): boolean; - emit(event: 'Network.loadingFailed', message: InspectorNotification): boolean; - emit(event: 'Network.loadingFinished', message: InspectorNotification): boolean; - emit(event: 'NodeRuntime.waitingForDisconnect'): boolean; - emit(event: 'NodeRuntime.waitingForDebugger'): boolean; - on(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - on(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; - /** - * Issued when new execution context is created. - */ - on(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - on(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - on(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - on(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - on(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - on(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - on(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - on(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - on(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - on(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - on(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - on(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - on(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - on(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - on(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - on(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - on(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - on(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - on(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - on(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - on(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - on(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - on(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - on(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - on(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Fired when page is about to send HTTP request. - */ - on(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; - /** - * Fired when HTTP response is available. - */ - on(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - on(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - on(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - on(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - /** - * This event is fired when the runtime is waiting for the debugger. For - * example, when inspector.waitingForDebugger is called - */ - on(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - once(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; - /** - * Issued when new execution context is created. - */ - once(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - once(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - once(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - once(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - once(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - once(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - once(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - once(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - once(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - once(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - once(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - once(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - once(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - once(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - once(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - once(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - once(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - once(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - once(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - once(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - once(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - once(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - once(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - once(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - once(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Fired when page is about to send HTTP request. - */ - once(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; - /** - * Fired when HTTP response is available. - */ - once(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - once(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - once(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - once(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - /** - * This event is fired when the runtime is waiting for the debugger. For - * example, when inspector.waitingForDebugger is called - */ - once(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - prependListener(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; - /** - * Issued when new execution context is created. - */ - prependListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - prependListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - prependListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - prependListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - prependListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - prependListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - prependListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - prependListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - prependListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - prependListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - prependListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - prependListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - prependListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - prependListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - prependListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - prependListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - prependListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - prependListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - prependListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - prependListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - prependListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - prependListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Fired when page is about to send HTTP request. - */ - prependListener(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; - /** - * Fired when HTTP response is available. - */ - prependListener(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - prependListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - /** - * This event is fired when the runtime is waiting for the debugger. For - * example, when inspector.waitingForDebugger is called - */ - prependListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - prependOnceListener(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; - /** - * Issued when new execution context is created. - */ - prependOnceListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - prependOnceListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - prependOnceListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - prependOnceListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - prependOnceListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - prependOnceListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - prependOnceListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - prependOnceListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - prependOnceListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - prependOnceListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - prependOnceListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - prependOnceListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - prependOnceListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - prependOnceListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - prependOnceListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - prependOnceListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - prependOnceListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - prependOnceListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - prependOnceListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - prependOnceListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - prependOnceListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - prependOnceListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Fired when page is about to send HTTP request. - */ - prependOnceListener(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; - /** - * Fired when HTTP response is available. - */ - prependOnceListener(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - prependOnceListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - /** - * This event is fired when the runtime is waiting for the debugger. For - * example, when inspector.waitingForDebugger is called - */ - prependOnceListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - } - - export { - Session, - open, - close, - url, - waitForDebugger, - console, - InspectorNotification, - Schema, - Runtime, - Debugger, - Console, - Profiler, - HeapProfiler, - NodeTracing, - NodeWorker, - Network, - NodeRuntime, - }; -} - -/** - * The `node:inspector/promises` module provides an API for interacting with the V8 - * inspector. - * @since v19.0.0 - */ -declare module 'node:inspector/promises' { - export * from 'inspector/promises'; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/module.d.ts b/tools/mnemonic-test/node_modules/@types/node/module.d.ts deleted file mode 100644 index 4f386598..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/module.d.ts +++ /dev/null @@ -1,301 +0,0 @@ -/** - * @since v0.3.7 - * @experimental - */ -declare module "module" { - import { URL } from "node:url"; - import { MessagePort } from "node:worker_threads"; - namespace Module { - /** - * The `module.syncBuiltinESMExports()` method updates all the live bindings for - * builtin `ES Modules` to match the properties of the `CommonJS` exports. It - * does not add or remove exported names from the `ES Modules`. - * - * ```js - * import fs from 'node:fs'; - * import assert from 'node:assert'; - * import { syncBuiltinESMExports } from 'node:module'; - * - * fs.readFile = newAPI; - * - * delete fs.readFileSync; - * - * function newAPI() { - * // ... - * } - * - * fs.newAPI = newAPI; - * - * syncBuiltinESMExports(); - * - * import('node:fs').then((esmFS) => { - * // It syncs the existing readFile property with the new value - * assert.strictEqual(esmFS.readFile, newAPI); - * // readFileSync has been deleted from the required fs - * assert.strictEqual('readFileSync' in fs, false); - * // syncBuiltinESMExports() does not remove readFileSync from esmFS - * assert.strictEqual('readFileSync' in esmFS, true); - * // syncBuiltinESMExports() does not add names - * assert.strictEqual(esmFS.newAPI, undefined); - * }); - * ``` - * @since v12.12.0 - */ - function syncBuiltinESMExports(): void; - /** - * `path` is the resolved path for the file for which a corresponding source map - * should be fetched. - * @since v13.7.0, v12.17.0 - * @return Returns `module.SourceMap` if a source map is found, `undefined` otherwise. - */ - function findSourceMap(path: string, error?: Error): SourceMap; - interface SourceMapPayload { - file: string; - version: number; - sources: string[]; - sourcesContent: string[]; - names: string[]; - mappings: string; - sourceRoot: string; - } - interface SourceMapping { - generatedLine: number; - generatedColumn: number; - originalSource: string; - originalLine: number; - originalColumn: number; - } - interface SourceOrigin { - /** - * The name of the range in the source map, if one was provided - */ - name?: string; - /** - * The file name of the original source, as reported in the SourceMap - */ - fileName: string; - /** - * The 1-indexed lineNumber of the corresponding call site in the original source - */ - lineNumber: number; - /** - * The 1-indexed columnNumber of the corresponding call site in the original source - */ - columnNumber: number; - } - /** - * @since v13.7.0, v12.17.0 - */ - class SourceMap { - /** - * Getter for the payload used to construct the `SourceMap` instance. - */ - readonly payload: SourceMapPayload; - constructor(payload: SourceMapPayload); - /** - * Given a line offset and column offset in the generated source - * file, returns an object representing the SourceMap range in the - * original file if found, or an empty object if not. - * - * The object returned contains the following keys: - * - * The returned value represents the raw range as it appears in the - * SourceMap, based on zero-indexed offsets, _not_ 1-indexed line and - * column numbers as they appear in Error messages and CallSite - * objects. - * - * To get the corresponding 1-indexed line and column numbers from a - * lineNumber and columnNumber as they are reported by Error stacks - * and CallSite objects, use `sourceMap.findOrigin(lineNumber, columnNumber)` - * @param lineOffset The zero-indexed line number offset in the generated source - * @param columnOffset The zero-indexed column number offset in the generated source - */ - findEntry(lineOffset: number, columnOffset: number): SourceMapping; - /** - * Given a 1-indexed `lineNumber` and `columnNumber` from a call site in the generated source, - * find the corresponding call site location in the original source. - * - * If the `lineNumber` and `columnNumber` provided are not found in any source map, - * then an empty object is returned. - * @param lineNumber The 1-indexed line number of the call site in the generated source - * @param columnNumber The 1-indexed column number of the call site in the generated source - */ - findOrigin(lineNumber: number, columnNumber: number): SourceOrigin | {}; - } - interface ImportAttributes extends NodeJS.Dict { - type?: string | undefined; - } - type ModuleFormat = "builtin" | "commonjs" | "json" | "module" | "wasm"; - type ModuleSource = string | ArrayBuffer | NodeJS.TypedArray; - interface GlobalPreloadContext { - port: MessagePort; - } - /** - * @deprecated This hook will be removed in a future version. - * Use `initialize` instead. When a loader has an `initialize` export, `globalPreload` will be ignored. - * - * Sometimes it might be necessary to run some code inside of the same global scope that the application runs in. - * This hook allows the return of a string that is run as a sloppy-mode script on startup. - * - * @param context Information to assist the preload code - * @return Code to run before application startup - */ - type GlobalPreloadHook = (context: GlobalPreloadContext) => string; - /** - * The `initialize` hook provides a way to define a custom function that runs in the hooks thread - * when the hooks module is initialized. Initialization happens when the hooks module is registered via `register`. - * - * This hook can receive data from a `register` invocation, including ports and other transferrable objects. - * The return value of `initialize` can be a `Promise`, in which case it will be awaited before the main application thread execution resumes. - */ - type InitializeHook = (data: Data) => void | Promise; - interface ResolveHookContext { - /** - * Export conditions of the relevant `package.json` - */ - conditions: string[]; - /** - * An object whose key-value pairs represent the assertions for the module to import - */ - importAttributes: ImportAttributes; - /** - * The module importing this one, or undefined if this is the Node.js entry point - */ - parentURL: string | undefined; - } - interface ResolveFnOutput { - /** - * A hint to the load hook (it might be ignored) - */ - format?: ModuleFormat | null | undefined; - /** - * The import attributes to use when caching the module (optional; if excluded the input will be used) - */ - importAttributes?: ImportAttributes | undefined; - /** - * A signal that this hook intends to terminate the chain of `resolve` hooks. - * @default false - */ - shortCircuit?: boolean | undefined; - /** - * The absolute URL to which this input resolves - */ - url: string; - } - /** - * The `resolve` hook chain is responsible for resolving file URL for a given module specifier and parent URL, and optionally its format (such as `'module'`) as a hint to the `load` hook. - * If a format is specified, the load hook is ultimately responsible for providing the final `format` value (and it is free to ignore the hint provided by `resolve`); - * if `resolve` provides a format, a custom `load` hook is required even if only to pass the value to the Node.js default `load` hook. - * - * @param specifier The specified URL path of the module to be resolved - * @param context - * @param nextResolve The subsequent `resolve` hook in the chain, or the Node.js default `resolve` hook after the last user-supplied resolve hook - */ - type ResolveHook = ( - specifier: string, - context: ResolveHookContext, - nextResolve: ( - specifier: string, - context?: ResolveHookContext, - ) => ResolveFnOutput | Promise, - ) => ResolveFnOutput | Promise; - interface LoadHookContext { - /** - * Export conditions of the relevant `package.json` - */ - conditions: string[]; - /** - * The format optionally supplied by the `resolve` hook chain - */ - format: ModuleFormat; - /** - * An object whose key-value pairs represent the assertions for the module to import - */ - importAttributes: ImportAttributes; - } - interface LoadFnOutput { - format: ModuleFormat; - /** - * A signal that this hook intends to terminate the chain of `resolve` hooks. - * @default false - */ - shortCircuit?: boolean | undefined; - /** - * The source for Node.js to evaluate - */ - source?: ModuleSource; - } - /** - * The `load` hook provides a way to define a custom method of determining how a URL should be interpreted, retrieved, and parsed. - * It is also in charge of validating the import assertion. - * - * @param url The URL/path of the module to be loaded - * @param context Metadata about the module - * @param nextLoad The subsequent `load` hook in the chain, or the Node.js default `load` hook after the last user-supplied `load` hook - */ - type LoadHook = ( - url: string, - context: LoadHookContext, - nextLoad: (url: string, context?: LoadHookContext) => LoadFnOutput | Promise, - ) => LoadFnOutput | Promise; - } - interface RegisterOptions { - parentURL: string | URL; - data?: Data | undefined; - transferList?: any[] | undefined; - } - interface Module extends NodeModule {} - class Module { - static runMain(): void; - static wrap(code: string): string; - static createRequire(path: string | URL): NodeRequire; - static builtinModules: string[]; - static isBuiltin(moduleName: string): boolean; - static Module: typeof Module; - static register( - specifier: string | URL, - parentURL?: string | URL, - options?: RegisterOptions, - ): void; - static register(specifier: string | URL, options?: RegisterOptions): void; - constructor(id: string, parent?: Module); - } - global { - interface ImportMeta { - /** - * The directory name of the current module. This is the same as the `path.dirname()` of the `import.meta.filename`. - * **Caveat:** only present on `file:` modules. - */ - dirname: string; - /** - * The full absolute path and filename of the current module, with symlinks resolved. - * This is the same as the `url.fileURLToPath()` of the `import.meta.url`. - * **Caveat:** only local modules support this property. Modules not using the `file:` protocol will not provide it. - */ - filename: string; - /** - * The absolute `file:` URL of the module. - */ - url: string; - /** - * Provides a module-relative resolution function scoped to each module, returning - * the URL string. - * - * Second `parent` parameter is only used when the `--experimental-import-meta-resolve` - * command flag enabled. - * - * @since v20.6.0 - * - * @param specifier The module specifier to resolve relative to `parent`. - * @param parent The absolute parent module URL to resolve from. - * @returns The absolute (`file:`) URL string for the resolved module. - */ - resolve(specifier: string, parent?: string | URL | undefined): string; - } - } - export = Module; -} -declare module "node:module" { - import module = require("module"); - export = module; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/net.d.ts b/tools/mnemonic-test/node_modules/@types/node/net.d.ts deleted file mode 100644 index d113e21f..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/net.d.ts +++ /dev/null @@ -1,1001 +0,0 @@ -/** - * > Stability: 2 - Stable - * - * The `node:net` module provides an asynchronous network API for creating stream-based - * TCP or `IPC` servers ({@link createServer}) and clients - * ({@link createConnection}). - * - * It can be accessed using: - * - * ```js - * import net from 'node:net'; - * ``` - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/net.js) - */ -declare module "net" { - import * as stream from "node:stream"; - import { Abortable, EventEmitter } from "node:events"; - import * as dns from "node:dns"; - type LookupFunction = ( - hostname: string, - options: dns.LookupOptions, - callback: (err: NodeJS.ErrnoException | null, address: string | dns.LookupAddress[], family?: number) => void, - ) => void; - interface AddressInfo { - address: string; - family: string; - port: number; - } - interface SocketConstructorOpts { - fd?: number | undefined; - allowHalfOpen?: boolean | undefined; - onread?: OnReadOpts | undefined; - readable?: boolean | undefined; - writable?: boolean | undefined; - signal?: AbortSignal; - } - interface OnReadOpts { - buffer: Uint8Array | (() => Uint8Array); - /** - * This function is called for every chunk of incoming data. - * Two arguments are passed to it: the number of bytes written to `buffer` and a reference to `buffer`. - * Return `false` from this function to implicitly `pause()` the socket. - */ - callback(bytesWritten: number, buffer: Uint8Array): boolean; - } - // TODO: remove empty ConnectOpts placeholder at next major @types/node version. - /** @deprecated */ - interface ConnectOpts {} - interface TcpSocketConnectOpts { - port: number; - host?: string | undefined; - localAddress?: string | undefined; - localPort?: number | undefined; - hints?: number | undefined; - family?: number | undefined; - lookup?: LookupFunction | undefined; - noDelay?: boolean | undefined; - keepAlive?: boolean | undefined; - keepAliveInitialDelay?: number | undefined; - /** - * @since v18.13.0 - */ - autoSelectFamily?: boolean | undefined; - /** - * @since v18.13.0 - */ - autoSelectFamilyAttemptTimeout?: number | undefined; - } - interface IpcSocketConnectOpts { - path: string; - } - type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts; - type SocketReadyState = "opening" | "open" | "readOnly" | "writeOnly" | "closed"; - /** - * This class is an abstraction of a TCP socket or a streaming `IPC` endpoint - * (uses named pipes on Windows, and Unix domain sockets otherwise). It is also - * an `EventEmitter`. - * - * A `net.Socket` can be created by the user and used directly to interact with - * a server. For example, it is returned by {@link createConnection}, - * so the user can use it to talk to the server. - * - * It can also be created by Node.js and passed to the user when a connection - * is received. For example, it is passed to the listeners of a `'connection'` event emitted on a {@link Server}, so the user can use - * it to interact with the client. - * @since v0.3.4 - */ - class Socket extends stream.Duplex { - constructor(options?: SocketConstructorOpts); - /** - * Destroys the socket after all data is written. If the `finish` event was already emitted the socket is destroyed immediately. - * If the socket is still writable it implicitly calls `socket.end()`. - * @since v0.3.4 - */ - destroySoon(): void; - /** - * Sends data on the socket. The second parameter specifies the encoding in the - * case of a string. It defaults to UTF8 encoding. - * - * Returns `true` if the entire data was flushed successfully to the kernel - * buffer. Returns `false` if all or part of the data was queued in user memory.`'drain'` will be emitted when the buffer is again free. - * - * The optional `callback` parameter will be executed when the data is finally - * written out, which may not be immediately. - * - * See `Writable` stream `write()` method for more - * information. - * @since v0.1.90 - * @param [encoding='utf8'] Only used when data is `string`. - */ - write(buffer: Uint8Array | string, cb?: (err?: Error) => void): boolean; - write(str: Uint8Array | string, encoding?: BufferEncoding, cb?: (err?: Error) => void): boolean; - /** - * Initiate a connection on a given socket. - * - * Possible signatures: - * - * * `socket.connect(options[, connectListener])` - * * `socket.connect(path[, connectListener])` for `IPC` connections. - * * `socket.connect(port[, host][, connectListener])` for TCP connections. - * * Returns: `net.Socket` The socket itself. - * - * This function is asynchronous. When the connection is established, the `'connect'` event will be emitted. If there is a problem connecting, - * instead of a `'connect'` event, an `'error'` event will be emitted with - * the error passed to the `'error'` listener. - * The last parameter `connectListener`, if supplied, will be added as a listener - * for the `'connect'` event **once**. - * - * This function should only be used for reconnecting a socket after`'close'` has been emitted or otherwise it may lead to undefined - * behavior. - */ - connect(options: SocketConnectOpts, connectionListener?: () => void): this; - connect(port: number, host: string, connectionListener?: () => void): this; - connect(port: number, connectionListener?: () => void): this; - connect(path: string, connectionListener?: () => void): this; - /** - * Set the encoding for the socket as a `Readable Stream`. See `readable.setEncoding()` for more information. - * @since v0.1.90 - * @return The socket itself. - */ - setEncoding(encoding?: BufferEncoding): this; - /** - * Pauses the reading of data. That is, `'data'` events will not be emitted. - * Useful to throttle back an upload. - * @return The socket itself. - */ - pause(): this; - /** - * Close the TCP connection by sending an RST packet and destroy the stream. - * If this TCP socket is in connecting status, it will send an RST packet and destroy this TCP socket once it is connected. - * Otherwise, it will call `socket.destroy` with an `ERR_SOCKET_CLOSED` Error. - * If this is not a TCP socket (for example, a pipe), calling this method will immediately throw an `ERR_INVALID_HANDLE_TYPE` Error. - * @since v18.3.0, v16.17.0 - */ - resetAndDestroy(): this; - /** - * Resumes reading after a call to `socket.pause()`. - * @return The socket itself. - */ - resume(): this; - /** - * Sets the socket to timeout after `timeout` milliseconds of inactivity on - * the socket. By default `net.Socket` do not have a timeout. - * - * When an idle timeout is triggered the socket will receive a `'timeout'` event but the connection will not be severed. The user must manually call `socket.end()` or `socket.destroy()` to - * end the connection. - * - * ```js - * socket.setTimeout(3000); - * socket.on('timeout', () => { - * console.log('socket timeout'); - * socket.end(); - * }); - * ``` - * - * If `timeout` is 0, then the existing idle timeout is disabled. - * - * The optional `callback` parameter will be added as a one-time listener for the `'timeout'` event. - * @since v0.1.90 - * @return The socket itself. - */ - setTimeout(timeout: number, callback?: () => void): this; - /** - * Enable/disable the use of Nagle's algorithm. - * - * When a TCP connection is created, it will have Nagle's algorithm enabled. - * - * Nagle's algorithm delays data before it is sent via the network. It attempts - * to optimize throughput at the expense of latency. - * - * Passing `true` for `noDelay` or not passing an argument will disable Nagle's - * algorithm for the socket. Passing `false` for `noDelay` will enable Nagle's - * algorithm. - * @since v0.1.90 - * @param [noDelay=true] - * @return The socket itself. - */ - setNoDelay(noDelay?: boolean): this; - /** - * Enable/disable keep-alive functionality, and optionally set the initial - * delay before the first keepalive probe is sent on an idle socket. - * - * Set `initialDelay` (in milliseconds) to set the delay between the last - * data packet received and the first keepalive probe. Setting `0` for`initialDelay` will leave the value unchanged from the default - * (or previous) setting. - * - * Enabling the keep-alive functionality will set the following socket options: - * - * * `SO_KEEPALIVE=1` - * * `TCP_KEEPIDLE=initialDelay` - * * `TCP_KEEPCNT=10` - * * `TCP_KEEPINTVL=1` - * @since v0.1.92 - * @param [enable=false] - * @param [initialDelay=0] - * @return The socket itself. - */ - setKeepAlive(enable?: boolean, initialDelay?: number): this; - /** - * Returns the bound `address`, the address `family` name and `port` of the - * socket as reported by the operating system:`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }` - * @since v0.1.90 - */ - address(): AddressInfo | {}; - /** - * Calling `unref()` on a socket will allow the program to exit if this is the only - * active socket in the event system. If the socket is already `unref`ed calling`unref()` again will have no effect. - * @since v0.9.1 - * @return The socket itself. - */ - unref(): this; - /** - * Opposite of `unref()`, calling `ref()` on a previously `unref`ed socket will _not_ let the program exit if it's the only socket left (the default behavior). - * If the socket is `ref`ed calling `ref` again will have no effect. - * @since v0.9.1 - * @return The socket itself. - */ - ref(): this; - /** - * This property is only present if the family autoselection algorithm is enabled in `socket.connect(options)` - * and it is an array of the addresses that have been attempted. - * - * Each address is a string in the form of `$IP:$PORT`. - * If the connection was successful, then the last address is the one that the socket is currently connected to. - * @since v19.4.0 - */ - readonly autoSelectFamilyAttemptedAddresses: string[]; - /** - * This property shows the number of characters buffered for writing. The buffer - * may contain strings whose length after encoding is not yet known. So this number - * is only an approximation of the number of bytes in the buffer. - * - * `net.Socket` has the property that `socket.write()` always works. This is to - * help users get up and running quickly. The computer cannot always keep up - * with the amount of data that is written to a socket. The network connection - * simply might be too slow. Node.js will internally queue up the data written to a - * socket and send it out over the wire when it is possible. - * - * The consequence of this internal buffering is that memory may grow. - * Users who experience large or growing `bufferSize` should attempt to - * "throttle" the data flows in their program with `socket.pause()` and `socket.resume()`. - * @since v0.3.8 - * @deprecated Since v14.6.0 - Use `writableLength` instead. - */ - readonly bufferSize: number; - /** - * The amount of received bytes. - * @since v0.5.3 - */ - readonly bytesRead: number; - /** - * The amount of bytes sent. - * @since v0.5.3 - */ - readonly bytesWritten: number; - /** - * If `true`, `socket.connect(options[, connectListener])` was - * called and has not yet finished. It will stay `true` until the socket becomes - * connected, then it is set to `false` and the `'connect'` event is emitted. Note - * that the `socket.connect(options[, connectListener])` callback is a listener for the `'connect'` event. - * @since v6.1.0 - */ - readonly connecting: boolean; - /** - * This is `true` if the socket is not connected yet, either because `.connect()`has not yet been called or because it is still in the process of connecting - * (see `socket.connecting`). - * @since v11.2.0, v10.16.0 - */ - readonly pending: boolean; - /** - * See `writable.destroyed` for further details. - */ - readonly destroyed: boolean; - /** - * The string representation of the local IP address the remote client is - * connecting on. For example, in a server listening on `'0.0.0.0'`, if a client - * connects on `'192.168.1.1'`, the value of `socket.localAddress` would be`'192.168.1.1'`. - * @since v0.9.6 - */ - readonly localAddress?: string; - /** - * The numeric representation of the local port. For example, `80` or `21`. - * @since v0.9.6 - */ - readonly localPort?: number; - /** - * The string representation of the local IP family. `'IPv4'` or `'IPv6'`. - * @since v18.8.0, v16.18.0 - */ - readonly localFamily?: string; - /** - * This property represents the state of the connection as a string. - * - * * If the stream is connecting `socket.readyState` is `opening`. - * * If the stream is readable and writable, it is `open`. - * * If the stream is readable and not writable, it is `readOnly`. - * * If the stream is not readable and writable, it is `writeOnly`. - * @since v0.5.0 - */ - readonly readyState: SocketReadyState; - /** - * The string representation of the remote IP address. For example,`'74.125.127.100'` or `'2001:4860:a005::68'`. Value may be `undefined` if - * the socket is destroyed (for example, if the client disconnected). - * @since v0.5.10 - */ - readonly remoteAddress?: string | undefined; - /** - * The string representation of the remote IP family. `'IPv4'` or `'IPv6'`. Value may be `undefined` if - * the socket is destroyed (for example, if the client disconnected). - * @since v0.11.14 - */ - readonly remoteFamily?: string | undefined; - /** - * The numeric representation of the remote port. For example, `80` or `21`. Value may be `undefined` if - * the socket is destroyed (for example, if the client disconnected). - * @since v0.5.10 - */ - readonly remotePort?: number | undefined; - /** - * The socket timeout in milliseconds as set by `socket.setTimeout()`. - * It is `undefined` if a timeout has not been set. - * @since v10.7.0 - */ - readonly timeout?: number | undefined; - /** - * Half-closes the socket. i.e., it sends a FIN packet. It is possible the - * server will still send some data. - * - * See `writable.end()` for further details. - * @since v0.1.90 - * @param [encoding='utf8'] Only used when data is `string`. - * @param callback Optional callback for when the socket is finished. - * @return The socket itself. - */ - end(callback?: () => void): this; - end(buffer: Uint8Array | string, callback?: () => void): this; - end(str: Uint8Array | string, encoding?: BufferEncoding, callback?: () => void): this; - /** - * events.EventEmitter - * 1. close - * 2. connect - * 3. connectionAttempt - * 4. connectionAttemptFailed - * 5. connectionAttemptTimeout - * 6. data - * 7. drain - * 8. end - * 9. error - * 10. lookup - * 11. ready - * 12. timeout - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: (hadError: boolean) => void): this; - addListener(event: "connect", listener: () => void): this; - addListener(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this; - addListener( - event: "connectionAttemptFailed", - listener: (ip: string, port: number, family: number) => void, - ): this; - addListener( - event: "connectionAttemptTimeout", - listener: (ip: string, port: number, family: number) => void, - ): this; - addListener(event: "data", listener: (data: Buffer) => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener( - event: "lookup", - listener: (err: Error, address: string, family: string | number, host: string) => void, - ): this; - addListener(event: "ready", listener: () => void): this; - addListener(event: "timeout", listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close", hadError: boolean): boolean; - emit(event: "connect"): boolean; - emit(event: "connectionAttempt", ip: string, port: number, family: number): boolean; - emit(event: "connectionAttemptFailed", ip: string, port: number, family: number): boolean; - emit(event: "connectionAttemptTimeout", ip: string, port: number, family: number): boolean; - emit(event: "data", data: Buffer): boolean; - emit(event: "drain"): boolean; - emit(event: "end"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "lookup", err: Error, address: string, family: string | number, host: string): boolean; - emit(event: "ready"): boolean; - emit(event: "timeout"): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: (hadError: boolean) => void): this; - on(event: "connect", listener: () => void): this; - on(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this; - on(event: "connectionAttemptFailed", listener: (ip: string, port: number, family: number) => void): this; - on(event: "connectionAttemptTimeout", listener: (ip: string, port: number, family: number) => void): this; - on(event: "data", listener: (data: Buffer) => void): this; - on(event: "drain", listener: () => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on( - event: "lookup", - listener: (err: Error, address: string, family: string | number, host: string) => void, - ): this; - on(event: "ready", listener: () => void): this; - on(event: "timeout", listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: (hadError: boolean) => void): this; - once(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this; - once(event: "connectionAttemptFailed", listener: (ip: string, port: number, family: number) => void): this; - once(event: "connectionAttemptTimeout", listener: (ip: string, port: number, family: number) => void): this; - once(event: "connect", listener: () => void): this; - once(event: "data", listener: (data: Buffer) => void): this; - once(event: "drain", listener: () => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once( - event: "lookup", - listener: (err: Error, address: string, family: string | number, host: string) => void, - ): this; - once(event: "ready", listener: () => void): this; - once(event: "timeout", listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: (hadError: boolean) => void): this; - prependListener(event: "connect", listener: () => void): this; - prependListener(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this; - prependListener( - event: "connectionAttemptFailed", - listener: (ip: string, port: number, family: number) => void, - ): this; - prependListener( - event: "connectionAttemptTimeout", - listener: (ip: string, port: number, family: number) => void, - ): this; - prependListener(event: "data", listener: (data: Buffer) => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener( - event: "lookup", - listener: (err: Error, address: string, family: string | number, host: string) => void, - ): this; - prependListener(event: "ready", listener: () => void): this; - prependListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: (hadError: boolean) => void): this; - prependOnceListener(event: "connect", listener: () => void): this; - prependOnceListener( - event: "connectionAttempt", - listener: (ip: string, port: number, family: number) => void, - ): this; - prependOnceListener( - event: "connectionAttemptFailed", - listener: (ip: string, port: number, family: number) => void, - ): this; - prependOnceListener( - event: "connectionAttemptTimeout", - listener: (ip: string, port: number, family: number) => void, - ): this; - prependOnceListener(event: "data", listener: (data: Buffer) => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener( - event: "lookup", - listener: (err: Error, address: string, family: string | number, host: string) => void, - ): this; - prependOnceListener(event: "ready", listener: () => void): this; - prependOnceListener(event: "timeout", listener: () => void): this; - } - interface ListenOptions extends Abortable { - port?: number | undefined; - host?: string | undefined; - backlog?: number | undefined; - path?: string | undefined; - exclusive?: boolean | undefined; - readableAll?: boolean | undefined; - writableAll?: boolean | undefined; - /** - * @default false - */ - ipv6Only?: boolean | undefined; - } - interface ServerOpts { - /** - * Indicates whether half-opened TCP connections are allowed. - * @default false - */ - allowHalfOpen?: boolean | undefined; - /** - * Indicates whether the socket should be paused on incoming connections. - * @default false - */ - pauseOnConnect?: boolean | undefined; - /** - * If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received. - * @default false - * @since v16.5.0 - */ - noDelay?: boolean | undefined; - /** - * If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received, - * similarly on what is done in `socket.setKeepAlive([enable][, initialDelay])`. - * @default false - * @since v16.5.0 - */ - keepAlive?: boolean | undefined; - /** - * If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket. - * @default 0 - * @since v16.5.0 - */ - keepAliveInitialDelay?: number | undefined; - /** - * Optionally overrides all `net.Socket`s' `readableHighWaterMark` and `writableHighWaterMark`. - * @default See [stream.getDefaultHighWaterMark()](https://nodejs.org/docs/latest-v22.x/api/stream.html#streamgetdefaulthighwatermarkobjectmode). - * @since v18.17.0, v20.1.0 - */ - highWaterMark?: number | undefined; - } - interface DropArgument { - localAddress?: string; - localPort?: number; - localFamily?: string; - remoteAddress?: string; - remotePort?: number; - remoteFamily?: string; - } - /** - * This class is used to create a TCP or `IPC` server. - * @since v0.1.90 - */ - class Server extends EventEmitter { - constructor(connectionListener?: (socket: Socket) => void); - constructor(options?: ServerOpts, connectionListener?: (socket: Socket) => void); - /** - * Start a server listening for connections. A `net.Server` can be a TCP or - * an `IPC` server depending on what it listens to. - * - * Possible signatures: - * - * * `server.listen(handle[, backlog][, callback])` - * * `server.listen(options[, callback])` - * * `server.listen(path[, backlog][, callback])` for `IPC` servers - * * `server.listen([port[, host[, backlog]]][, callback])` for TCP servers - * - * This function is asynchronous. When the server starts listening, the `'listening'` event will be emitted. The last parameter `callback`will be added as a listener for the `'listening'` - * event. - * - * All `listen()` methods can take a `backlog` parameter to specify the maximum - * length of the queue of pending connections. The actual length will be determined - * by the OS through sysctl settings such as `tcp_max_syn_backlog` and `somaxconn` on Linux. The default value of this parameter is 511 (not 512). - * - * All {@link Socket} are set to `SO_REUSEADDR` (see [`socket(7)`](https://man7.org/linux/man-pages/man7/socket.7.html) for - * details). - * - * The `server.listen()` method can be called again if and only if there was an - * error during the first `server.listen()` call or `server.close()` has been - * called. Otherwise, an `ERR_SERVER_ALREADY_LISTEN` error will be thrown. - * - * One of the most common errors raised when listening is `EADDRINUSE`. - * This happens when another server is already listening on the requested`port`/`path`/`handle`. One way to handle this would be to retry - * after a certain amount of time: - * - * ```js - * server.on('error', (e) => { - * if (e.code === 'EADDRINUSE') { - * console.error('Address in use, retrying...'); - * setTimeout(() => { - * server.close(); - * server.listen(PORT, HOST); - * }, 1000); - * } - * }); - * ``` - */ - listen(port?: number, hostname?: string, backlog?: number, listeningListener?: () => void): this; - listen(port?: number, hostname?: string, listeningListener?: () => void): this; - listen(port?: number, backlog?: number, listeningListener?: () => void): this; - listen(port?: number, listeningListener?: () => void): this; - listen(path: string, backlog?: number, listeningListener?: () => void): this; - listen(path: string, listeningListener?: () => void): this; - listen(options: ListenOptions, listeningListener?: () => void): this; - listen(handle: any, backlog?: number, listeningListener?: () => void): this; - listen(handle: any, listeningListener?: () => void): this; - /** - * Stops the server from accepting new connections and keeps existing - * connections. This function is asynchronous, the server is finally closed - * when all connections are ended and the server emits a `'close'` event. - * The optional `callback` will be called once the `'close'` event occurs. Unlike - * that event, it will be called with an `Error` as its only argument if the server - * was not open when it was closed. - * @since v0.1.90 - * @param callback Called when the server is closed. - */ - close(callback?: (err?: Error) => void): this; - /** - * Returns the bound `address`, the address `family` name, and `port` of the server - * as reported by the operating system if listening on an IP socket - * (useful to find which port was assigned when getting an OS-assigned address):`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }`. - * - * For a server listening on a pipe or Unix domain socket, the name is returned - * as a string. - * - * ```js - * const server = net.createServer((socket) => { - * socket.end('goodbye\n'); - * }).on('error', (err) => { - * // Handle errors here. - * throw err; - * }); - * - * // Grab an arbitrary unused port. - * server.listen(() => { - * console.log('opened server on', server.address()); - * }); - * ``` - * - * `server.address()` returns `null` before the `'listening'` event has been - * emitted or after calling `server.close()`. - * @since v0.1.90 - */ - address(): AddressInfo | string | null; - /** - * Asynchronously get the number of concurrent connections on the server. Works - * when sockets were sent to forks. - * - * Callback should take two arguments `err` and `count`. - * @since v0.9.7 - */ - getConnections(cb: (error: Error | null, count: number) => void): void; - /** - * Opposite of `unref()`, calling `ref()` on a previously `unref`ed server will _not_ let the program exit if it's the only server left (the default behavior). - * If the server is `ref`ed calling `ref()` again will have no effect. - * @since v0.9.1 - */ - ref(): this; - /** - * Calling `unref()` on a server will allow the program to exit if this is the only - * active server in the event system. If the server is already `unref`ed calling`unref()` again will have no effect. - * @since v0.9.1 - */ - unref(): this; - /** - * Set this property to reject connections when the server's connection count gets - * high. - * - * It is not recommended to use this option once a socket has been sent to a child - * with `child_process.fork()`. - * @since v0.2.0 - */ - maxConnections: number; - connections: number; - /** - * Indicates whether or not the server is listening for connections. - * @since v5.7.0 - */ - readonly listening: boolean; - /** - * events.EventEmitter - * 1. close - * 2. connection - * 3. error - * 4. listening - * 5. drop - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "connection", listener: (socket: Socket) => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "listening", listener: () => void): this; - addListener(event: "drop", listener: (data?: DropArgument) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "connection", socket: Socket): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "listening"): boolean; - emit(event: "drop", data?: DropArgument): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "connection", listener: (socket: Socket) => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "listening", listener: () => void): this; - on(event: "drop", listener: (data?: DropArgument) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "connection", listener: (socket: Socket) => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "listening", listener: () => void): this; - once(event: "drop", listener: (data?: DropArgument) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "connection", listener: (socket: Socket) => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "listening", listener: () => void): this; - prependListener(event: "drop", listener: (data?: DropArgument) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "connection", listener: (socket: Socket) => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "listening", listener: () => void): this; - prependOnceListener(event: "drop", listener: (data?: DropArgument) => void): this; - /** - * Calls {@link Server.close()} and returns a promise that fulfills when the server has closed. - * @since v20.5.0 - */ - [Symbol.asyncDispose](): Promise; - } - type IPVersion = "ipv4" | "ipv6"; - /** - * The `BlockList` object can be used with some network APIs to specify rules for - * disabling inbound or outbound access to specific IP addresses, IP ranges, or - * IP subnets. - * @since v15.0.0, v14.18.0 - */ - class BlockList { - /** - * Adds a rule to block the given IP address. - * @since v15.0.0, v14.18.0 - * @param address An IPv4 or IPv6 address. - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - addAddress(address: string, type?: IPVersion): void; - addAddress(address: SocketAddress): void; - /** - * Adds a rule to block a range of IP addresses from `start` (inclusive) to`end` (inclusive). - * @since v15.0.0, v14.18.0 - * @param start The starting IPv4 or IPv6 address in the range. - * @param end The ending IPv4 or IPv6 address in the range. - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - addRange(start: string, end: string, type?: IPVersion): void; - addRange(start: SocketAddress, end: SocketAddress): void; - /** - * Adds a rule to block a range of IP addresses specified as a subnet mask. - * @since v15.0.0, v14.18.0 - * @param net The network IPv4 or IPv6 address. - * @param prefix The number of CIDR prefix bits. For IPv4, this must be a value between `0` and `32`. For IPv6, this must be between `0` and `128`. - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - addSubnet(net: SocketAddress, prefix: number): void; - addSubnet(net: string, prefix: number, type?: IPVersion): void; - /** - * Returns `true` if the given IP address matches any of the rules added to the`BlockList`. - * - * ```js - * const blockList = new net.BlockList(); - * blockList.addAddress('123.123.123.123'); - * blockList.addRange('10.0.0.1', '10.0.0.10'); - * blockList.addSubnet('8592:757c:efae:4e45::', 64, 'ipv6'); - * - * console.log(blockList.check('123.123.123.123')); // Prints: true - * console.log(blockList.check('10.0.0.3')); // Prints: true - * console.log(blockList.check('222.111.111.222')); // Prints: false - * - * // IPv6 notation for IPv4 addresses works: - * console.log(blockList.check('::ffff:7b7b:7b7b', 'ipv6')); // Prints: true - * console.log(blockList.check('::ffff:123.123.123.123', 'ipv6')); // Prints: true - * ``` - * @since v15.0.0, v14.18.0 - * @param address The IP address to check - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - check(address: SocketAddress): boolean; - check(address: string, type?: IPVersion): boolean; - /** - * The list of rules added to the blocklist. - * @since v15.0.0, v14.18.0 - */ - rules: readonly string[]; - } - interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts { - timeout?: number | undefined; - } - interface IpcNetConnectOpts extends IpcSocketConnectOpts, SocketConstructorOpts { - timeout?: number | undefined; - } - type NetConnectOpts = TcpNetConnectOpts | IpcNetConnectOpts; - /** - * Creates a new TCP or `IPC` server. - * - * If `allowHalfOpen` is set to `true`, when the other end of the socket - * signals the end of transmission, the server will only send back the end of - * transmission when `socket.end()` is explicitly called. For example, in the - * context of TCP, when a FIN packed is received, a FIN packed is sent - * back only when `socket.end()` is explicitly called. Until then the - * connection is half-closed (non-readable but still writable). See `'end'` event and [RFC 1122](https://tools.ietf.org/html/rfc1122) (section 4.2.2.13) for more information. - * - * If `pauseOnConnect` is set to `true`, then the socket associated with each - * incoming connection will be paused, and no data will be read from its handle. - * This allows connections to be passed between processes without any data being - * read by the original process. To begin reading data from a paused socket, call `socket.resume()`. - * - * The server can be a TCP server or an `IPC` server, depending on what it `listen()` to. - * - * Here is an example of a TCP echo server which listens for connections - * on port 8124: - * - * ```js - * import net from 'node:net'; - * const server = net.createServer((c) => { - * // 'connection' listener. - * console.log('client connected'); - * c.on('end', () => { - * console.log('client disconnected'); - * }); - * c.write('hello\r\n'); - * c.pipe(c); - * }); - * server.on('error', (err) => { - * throw err; - * }); - * server.listen(8124, () => { - * console.log('server bound'); - * }); - * ``` - * - * Test this by using `telnet`: - * - * ```bash - * telnet localhost 8124 - * ``` - * - * To listen on the socket `/tmp/echo.sock`: - * - * ```js - * server.listen('/tmp/echo.sock', () => { - * console.log('server bound'); - * }); - * ``` - * - * Use `nc` to connect to a Unix domain socket server: - * - * ```bash - * nc -U /tmp/echo.sock - * ``` - * @since v0.5.0 - * @param connectionListener Automatically set as a listener for the {@link 'connection'} event. - */ - function createServer(connectionListener?: (socket: Socket) => void): Server; - function createServer(options?: ServerOpts, connectionListener?: (socket: Socket) => void): Server; - /** - * Aliases to {@link createConnection}. - * - * Possible signatures: - * - * * {@link connect} - * * {@link connect} for `IPC` connections. - * * {@link connect} for TCP connections. - */ - function connect(options: NetConnectOpts, connectionListener?: () => void): Socket; - function connect(port: number, host?: string, connectionListener?: () => void): Socket; - function connect(path: string, connectionListener?: () => void): Socket; - /** - * A factory function, which creates a new {@link Socket}, - * immediately initiates connection with `socket.connect()`, - * then returns the `net.Socket` that starts the connection. - * - * When the connection is established, a `'connect'` event will be emitted - * on the returned socket. The last parameter `connectListener`, if supplied, - * will be added as a listener for the `'connect'` event **once**. - * - * Possible signatures: - * - * * {@link createConnection} - * * {@link createConnection} for `IPC` connections. - * * {@link createConnection} for TCP connections. - * - * The {@link connect} function is an alias to this function. - */ - function createConnection(options: NetConnectOpts, connectionListener?: () => void): Socket; - function createConnection(port: number, host?: string, connectionListener?: () => void): Socket; - function createConnection(path: string, connectionListener?: () => void): Socket; - /** - * Gets the current default value of the `autoSelectFamily` option of `socket.connect(options)`. - * The initial default value is `true`, unless the command line option`--no-network-family-autoselection` is provided. - * @since v19.4.0 - */ - function getDefaultAutoSelectFamily(): boolean; - /** - * Sets the default value of the `autoSelectFamily` option of `socket.connect(options)`. - * @since v19.4.0 - */ - function setDefaultAutoSelectFamily(value: boolean): void; - /** - * Gets the current default value of the `autoSelectFamilyAttemptTimeout` option of `socket.connect(options)`. - * The initial default value is `250` or the value specified via the command line option `--network-family-autoselection-attempt-timeout`. - * @returns The current default value of the `autoSelectFamilyAttemptTimeout` option. - * @since v19.8.0, v18.8.0 - */ - function getDefaultAutoSelectFamilyAttemptTimeout(): number; - /** - * Sets the default value of the `autoSelectFamilyAttemptTimeout` option of `socket.connect(options)`. - * @param value The new default value, which must be a positive number. If the number is less than `10`, the value `10` is used instead. The initial default value is `250` or the value specified via the command line - * option `--network-family-autoselection-attempt-timeout`. - * @since v19.8.0, v18.8.0 - */ - function setDefaultAutoSelectFamilyAttemptTimeout(value: number): void; - /** - * Returns `6` if `input` is an IPv6 address. Returns `4` if `input` is an IPv4 - * address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no leading zeroes. Otherwise, returns`0`. - * - * ```js - * net.isIP('::1'); // returns 6 - * net.isIP('127.0.0.1'); // returns 4 - * net.isIP('127.000.000.001'); // returns 0 - * net.isIP('127.0.0.1/24'); // returns 0 - * net.isIP('fhqwhgads'); // returns 0 - * ``` - * @since v0.3.0 - */ - function isIP(input: string): number; - /** - * Returns `true` if `input` is an IPv4 address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no - * leading zeroes. Otherwise, returns `false`. - * - * ```js - * net.isIPv4('127.0.0.1'); // returns true - * net.isIPv4('127.000.000.001'); // returns false - * net.isIPv4('127.0.0.1/24'); // returns false - * net.isIPv4('fhqwhgads'); // returns false - * ``` - * @since v0.3.0 - */ - function isIPv4(input: string): boolean; - /** - * Returns `true` if `input` is an IPv6 address. Otherwise, returns `false`. - * - * ```js - * net.isIPv6('::1'); // returns true - * net.isIPv6('fhqwhgads'); // returns false - * ``` - * @since v0.3.0 - */ - function isIPv6(input: string): boolean; - interface SocketAddressInitOptions { - /** - * The network address as either an IPv4 or IPv6 string. - * @default 127.0.0.1 - */ - address?: string | undefined; - /** - * @default `'ipv4'` - */ - family?: IPVersion | undefined; - /** - * An IPv6 flow-label used only if `family` is `'ipv6'`. - * @default 0 - */ - flowlabel?: number | undefined; - /** - * An IP port. - * @default 0 - */ - port?: number | undefined; - } - /** - * @since v15.14.0, v14.18.0 - */ - class SocketAddress { - constructor(options: SocketAddressInitOptions); - /** - * Either \`'ipv4'\` or \`'ipv6'\`. - * @since v15.14.0, v14.18.0 - */ - readonly address: string; - /** - * Either \`'ipv4'\` or \`'ipv6'\`. - * @since v15.14.0, v14.18.0 - */ - readonly family: IPVersion; - /** - * @since v15.14.0, v14.18.0 - */ - readonly port: number; - /** - * @since v15.14.0, v14.18.0 - */ - readonly flowlabel: number; - } -} -declare module "node:net" { - export * from "net"; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/os.d.ts b/tools/mnemonic-test/node_modules/@types/node/os.d.ts deleted file mode 100644 index 7f305358..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/os.d.ts +++ /dev/null @@ -1,495 +0,0 @@ -/** - * The `node:os` module provides operating system-related utility methods and - * properties. It can be accessed using: - * - * ```js - * import os from 'node:os'; - * ``` - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/os.js) - */ -declare module "os" { - interface CpuInfo { - model: string; - speed: number; - times: { - /** The number of milliseconds the CPU has spent in user mode. */ - user: number; - /** The number of milliseconds the CPU has spent in nice mode. */ - nice: number; - /** The number of milliseconds the CPU has spent in sys mode. */ - sys: number; - /** The number of milliseconds the CPU has spent in idle mode. */ - idle: number; - /** The number of milliseconds the CPU has spent in irq mode. */ - irq: number; - }; - } - interface NetworkInterfaceBase { - address: string; - netmask: string; - mac: string; - internal: boolean; - cidr: string | null; - } - interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase { - family: "IPv4"; - scopeid?: undefined; - } - interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase { - family: "IPv6"; - scopeid: number; - } - interface UserInfo { - username: T; - uid: number; - gid: number; - shell: T | null; - homedir: T; - } - type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6; - /** - * Returns the host name of the operating system as a string. - * @since v0.3.3 - */ - function hostname(): string; - /** - * Returns an array containing the 1, 5, and 15 minute load averages. - * - * The load average is a measure of system activity calculated by the operating - * system and expressed as a fractional number. - * - * The load average is a Unix-specific concept. On Windows, the return value is - * always `[0, 0, 0]`. - * @since v0.3.3 - */ - function loadavg(): number[]; - /** - * Returns the system uptime in number of seconds. - * @since v0.3.3 - */ - function uptime(): number; - /** - * Returns the amount of free system memory in bytes as an integer. - * @since v0.3.3 - */ - function freemem(): number; - /** - * Returns the total amount of system memory in bytes as an integer. - * @since v0.3.3 - */ - function totalmem(): number; - /** - * Returns an array of objects containing information about each logical CPU core. - * The array will be empty if no CPU information is available, such as if the `/proc` file system is unavailable. - * - * The properties included on each object include: - * - * ```js - * [ - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 252020, - * nice: 0, - * sys: 30340, - * idle: 1070356870, - * irq: 0, - * }, - * }, - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 306960, - * nice: 0, - * sys: 26980, - * idle: 1071569080, - * irq: 0, - * }, - * }, - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 248450, - * nice: 0, - * sys: 21750, - * idle: 1070919370, - * irq: 0, - * }, - * }, - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 256880, - * nice: 0, - * sys: 19430, - * idle: 1070905480, - * irq: 20, - * }, - * }, - * ] - * ``` - * - * `nice` values are POSIX-only. On Windows, the `nice` values of all processors - * are always 0. - * - * `os.cpus().length` should not be used to calculate the amount of parallelism - * available to an application. Use {@link availableParallelism} for this purpose. - * @since v0.3.3 - */ - function cpus(): CpuInfo[]; - /** - * Returns an estimate of the default amount of parallelism a program should use. - * Always returns a value greater than zero. - * - * This function is a small wrapper about libuv's [`uv_available_parallelism()`](https://docs.libuv.org/en/v1.x/misc.html#c.uv_available_parallelism). - * @since v19.4.0, v18.14.0 - */ - function availableParallelism(): number; - /** - * Returns the operating system name as returned by [`uname(3)`](https://linux.die.net/man/3/uname). For example, it - * returns `'Linux'` on Linux, `'Darwin'` on macOS, and `'Windows_NT'` on Windows. - * - * See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for additional information - * about the output of running [`uname(3)`](https://linux.die.net/man/3/uname) on various operating systems. - * @since v0.3.3 - */ - function type(): string; - /** - * Returns the operating system as a string. - * - * On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `GetVersionExW()` is used. See - * [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. - * @since v0.3.3 - */ - function release(): string; - /** - * Returns an object containing network interfaces that have been assigned a - * network address. - * - * Each key on the returned object identifies a network interface. The associated - * value is an array of objects that each describe an assigned network address. - * - * The properties available on the assigned network address object include: - * - * ```js - * { - * lo: [ - * { - * address: '127.0.0.1', - * netmask: '255.0.0.0', - * family: 'IPv4', - * mac: '00:00:00:00:00:00', - * internal: true, - * cidr: '127.0.0.1/8' - * }, - * { - * address: '::1', - * netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', - * family: 'IPv6', - * mac: '00:00:00:00:00:00', - * scopeid: 0, - * internal: true, - * cidr: '::1/128' - * } - * ], - * eth0: [ - * { - * address: '192.168.1.108', - * netmask: '255.255.255.0', - * family: 'IPv4', - * mac: '01:02:03:0a:0b:0c', - * internal: false, - * cidr: '192.168.1.108/24' - * }, - * { - * address: 'fe80::a00:27ff:fe4e:66a1', - * netmask: 'ffff:ffff:ffff:ffff::', - * family: 'IPv6', - * mac: '01:02:03:0a:0b:0c', - * scopeid: 1, - * internal: false, - * cidr: 'fe80::a00:27ff:fe4e:66a1/64' - * } - * ] - * } - * ``` - * @since v0.6.0 - */ - function networkInterfaces(): NodeJS.Dict; - /** - * Returns the string path of the current user's home directory. - * - * On POSIX, it uses the `$HOME` environment variable if defined. Otherwise it - * uses the [effective UID](https://en.wikipedia.org/wiki/User_identifier#Effective_user_ID) to look up the user's home directory. - * - * On Windows, it uses the `USERPROFILE` environment variable if defined. - * Otherwise it uses the path to the profile directory of the current user. - * @since v2.3.0 - */ - function homedir(): string; - /** - * Returns information about the currently effective user. On POSIX platforms, - * this is typically a subset of the password file. The returned object includes - * the `username`, `uid`, `gid`, `shell`, and `homedir`. On Windows, the `uid` and `gid` fields are `-1`, and `shell` is `null`. - * - * The value of `homedir` returned by `os.userInfo()` is provided by the operating - * system. This differs from the result of `os.homedir()`, which queries - * environment variables for the home directory before falling back to the - * operating system response. - * - * Throws a [`SystemError`](https://nodejs.org/docs/latest-v22.x/api/errors.html#class-systemerror) if a user has no `username` or `homedir`. - * @since v6.0.0 - */ - function userInfo(options: { encoding: "buffer" }): UserInfo; - function userInfo(options?: { encoding: BufferEncoding }): UserInfo; - type SignalConstants = { - [key in NodeJS.Signals]: number; - }; - namespace constants { - const UV_UDP_REUSEADDR: number; - namespace signals {} - const signals: SignalConstants; - namespace errno { - const E2BIG: number; - const EACCES: number; - const EADDRINUSE: number; - const EADDRNOTAVAIL: number; - const EAFNOSUPPORT: number; - const EAGAIN: number; - const EALREADY: number; - const EBADF: number; - const EBADMSG: number; - const EBUSY: number; - const ECANCELED: number; - const ECHILD: number; - const ECONNABORTED: number; - const ECONNREFUSED: number; - const ECONNRESET: number; - const EDEADLK: number; - const EDESTADDRREQ: number; - const EDOM: number; - const EDQUOT: number; - const EEXIST: number; - const EFAULT: number; - const EFBIG: number; - const EHOSTUNREACH: number; - const EIDRM: number; - const EILSEQ: number; - const EINPROGRESS: number; - const EINTR: number; - const EINVAL: number; - const EIO: number; - const EISCONN: number; - const EISDIR: number; - const ELOOP: number; - const EMFILE: number; - const EMLINK: number; - const EMSGSIZE: number; - const EMULTIHOP: number; - const ENAMETOOLONG: number; - const ENETDOWN: number; - const ENETRESET: number; - const ENETUNREACH: number; - const ENFILE: number; - const ENOBUFS: number; - const ENODATA: number; - const ENODEV: number; - const ENOENT: number; - const ENOEXEC: number; - const ENOLCK: number; - const ENOLINK: number; - const ENOMEM: number; - const ENOMSG: number; - const ENOPROTOOPT: number; - const ENOSPC: number; - const ENOSR: number; - const ENOSTR: number; - const ENOSYS: number; - const ENOTCONN: number; - const ENOTDIR: number; - const ENOTEMPTY: number; - const ENOTSOCK: number; - const ENOTSUP: number; - const ENOTTY: number; - const ENXIO: number; - const EOPNOTSUPP: number; - const EOVERFLOW: number; - const EPERM: number; - const EPIPE: number; - const EPROTO: number; - const EPROTONOSUPPORT: number; - const EPROTOTYPE: number; - const ERANGE: number; - const EROFS: number; - const ESPIPE: number; - const ESRCH: number; - const ESTALE: number; - const ETIME: number; - const ETIMEDOUT: number; - const ETXTBSY: number; - const EWOULDBLOCK: number; - const EXDEV: number; - const WSAEINTR: number; - const WSAEBADF: number; - const WSAEACCES: number; - const WSAEFAULT: number; - const WSAEINVAL: number; - const WSAEMFILE: number; - const WSAEWOULDBLOCK: number; - const WSAEINPROGRESS: number; - const WSAEALREADY: number; - const WSAENOTSOCK: number; - const WSAEDESTADDRREQ: number; - const WSAEMSGSIZE: number; - const WSAEPROTOTYPE: number; - const WSAENOPROTOOPT: number; - const WSAEPROTONOSUPPORT: number; - const WSAESOCKTNOSUPPORT: number; - const WSAEOPNOTSUPP: number; - const WSAEPFNOSUPPORT: number; - const WSAEAFNOSUPPORT: number; - const WSAEADDRINUSE: number; - const WSAEADDRNOTAVAIL: number; - const WSAENETDOWN: number; - const WSAENETUNREACH: number; - const WSAENETRESET: number; - const WSAECONNABORTED: number; - const WSAECONNRESET: number; - const WSAENOBUFS: number; - const WSAEISCONN: number; - const WSAENOTCONN: number; - const WSAESHUTDOWN: number; - const WSAETOOMANYREFS: number; - const WSAETIMEDOUT: number; - const WSAECONNREFUSED: number; - const WSAELOOP: number; - const WSAENAMETOOLONG: number; - const WSAEHOSTDOWN: number; - const WSAEHOSTUNREACH: number; - const WSAENOTEMPTY: number; - const WSAEPROCLIM: number; - const WSAEUSERS: number; - const WSAEDQUOT: number; - const WSAESTALE: number; - const WSAEREMOTE: number; - const WSASYSNOTREADY: number; - const WSAVERNOTSUPPORTED: number; - const WSANOTINITIALISED: number; - const WSAEDISCON: number; - const WSAENOMORE: number; - const WSAECANCELLED: number; - const WSAEINVALIDPROCTABLE: number; - const WSAEINVALIDPROVIDER: number; - const WSAEPROVIDERFAILEDINIT: number; - const WSASYSCALLFAILURE: number; - const WSASERVICE_NOT_FOUND: number; - const WSATYPE_NOT_FOUND: number; - const WSA_E_NO_MORE: number; - const WSA_E_CANCELLED: number; - const WSAEREFUSED: number; - } - namespace dlopen { - const RTLD_LAZY: number; - const RTLD_NOW: number; - const RTLD_GLOBAL: number; - const RTLD_LOCAL: number; - const RTLD_DEEPBIND: number; - } - namespace priority { - const PRIORITY_LOW: number; - const PRIORITY_BELOW_NORMAL: number; - const PRIORITY_NORMAL: number; - const PRIORITY_ABOVE_NORMAL: number; - const PRIORITY_HIGH: number; - const PRIORITY_HIGHEST: number; - } - } - const devNull: string; - /** - * The operating system-specific end-of-line marker. - * * `\n` on POSIX - * * `\r\n` on Windows - */ - const EOL: string; - /** - * Returns the operating system CPU architecture for which the Node.js binary was - * compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'loong64'`, `'mips'`, `'mipsel'`, `'ppc'`, `'ppc64'`, `'riscv64'`, `'s390'`, `'s390x'`, - * and `'x64'`. - * - * The return value is equivalent to [process.arch](https://nodejs.org/docs/latest-v22.x/api/process.html#processarch). - * @since v0.5.0 - */ - function arch(): string; - /** - * Returns a string identifying the kernel version. - * - * On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not - * available, `GetVersionExW()` will be used. See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. - * @since v13.11.0, v12.17.0 - */ - function version(): string; - /** - * Returns a string identifying the operating system platform for which - * the Node.js binary was compiled. The value is set at compile time. - * Possible values are `'aix'`, `'darwin'`, `'freebsd'`, `'linux'`, `'openbsd'`, `'sunos'`, and `'win32'`. - * - * The return value is equivalent to `process.platform`. - * - * The value `'android'` may also be returned if Node.js is built on the Android - * operating system. [Android support is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os). - * @since v0.5.0 - */ - function platform(): NodeJS.Platform; - /** - * Returns the machine type as a string, such as `arm`, `arm64`, `aarch64`, `mips`, `mips64`, `ppc64`, `ppc64le`, `s390`, `s390x`, `i386`, `i686`, `x86_64`. - * - * On POSIX systems, the machine type is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not - * available, `GetVersionExW()` will be used. See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. - * @since v18.9.0, v16.18.0 - */ - function machine(): string; - /** - * Returns the operating system's default directory for temporary files as a - * string. - * @since v0.9.9 - */ - function tmpdir(): string; - /** - * Returns a string identifying the endianness of the CPU for which the Node.js - * binary was compiled. - * - * Possible values are `'BE'` for big endian and `'LE'` for little endian. - * @since v0.9.4 - */ - function endianness(): "BE" | "LE"; - /** - * Returns the scheduling priority for the process specified by `pid`. If `pid` is - * not provided or is `0`, the priority of the current process is returned. - * @since v10.10.0 - * @param [pid=0] The process ID to retrieve scheduling priority for. - */ - function getPriority(pid?: number): number; - /** - * Attempts to set the scheduling priority for the process specified by `pid`. If `pid` is not provided or is `0`, the process ID of the current process is used. - * - * The `priority` input must be an integer between `-20` (high priority) and `19` (low priority). Due to differences between Unix priority levels and Windows - * priority classes, `priority` is mapped to one of six priority constants in `os.constants.priority`. When retrieving a process priority level, this range - * mapping may cause the return value to be slightly different on Windows. To avoid - * confusion, set `priority` to one of the priority constants. - * - * On Windows, setting priority to `PRIORITY_HIGHEST` requires elevated user - * privileges. Otherwise the set priority will be silently reduced to `PRIORITY_HIGH`. - * @since v10.10.0 - * @param [pid=0] The process ID to set scheduling priority for. - * @param priority The scheduling priority to assign to the process. - */ - function setPriority(priority: number): void; - function setPriority(pid: number, priority: number): void; -} -declare module "node:os" { - export * from "os"; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/package.json b/tools/mnemonic-test/node_modules/@types/node/package.json deleted file mode 100644 index 7d3c9423..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/package.json +++ /dev/null @@ -1,224 +0,0 @@ -{ - "name": "@types/node", - "version": "22.7.5", - "description": "TypeScript definitions for node", - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node", - "license": "MIT", - "contributors": [ - { - "name": "Microsoft TypeScript", - "githubUsername": "Microsoft", - "url": "https://github.com/Microsoft" - }, - { - "name": "Alberto Schiabel", - "githubUsername": "jkomyno", - "url": "https://github.com/jkomyno" - }, - { - "name": "Alvis HT Tang", - "githubUsername": "alvis", - "url": "https://github.com/alvis" - }, - { - "name": "Andrew Makarov", - "githubUsername": "r3nya", - "url": "https://github.com/r3nya" - }, - { - "name": "Benjamin Toueg", - "githubUsername": "btoueg", - "url": "https://github.com/btoueg" - }, - { - "name": "Chigozirim C.", - "githubUsername": "smac89", - "url": "https://github.com/smac89" - }, - { - "name": "David Junger", - "githubUsername": "touffy", - "url": "https://github.com/touffy" - }, - { - "name": "Deividas Bakanas", - "githubUsername": "DeividasBakanas", - "url": "https://github.com/DeividasBakanas" - }, - { - "name": "Eugene Y. Q. Shen", - "githubUsername": "eyqs", - "url": "https://github.com/eyqs" - }, - { - "name": "Hannes Magnusson", - "githubUsername": "Hannes-Magnusson-CK", - "url": "https://github.com/Hannes-Magnusson-CK" - }, - { - "name": "Huw", - "githubUsername": "hoo29", - "url": "https://github.com/hoo29" - }, - { - "name": "Kelvin Jin", - "githubUsername": "kjin", - "url": "https://github.com/kjin" - }, - { - "name": "Klaus Meinhardt", - "githubUsername": "ajafff", - "url": "https://github.com/ajafff" - }, - { - "name": "Lishude", - "githubUsername": "islishude", - "url": "https://github.com/islishude" - }, - { - "name": "Mariusz Wiktorczyk", - "githubUsername": "mwiktorczyk", - "url": "https://github.com/mwiktorczyk" - }, - { - "name": "Mohsen Azimi", - "githubUsername": "mohsen1", - "url": "https://github.com/mohsen1" - }, - { - "name": "Nikita Galkin", - "githubUsername": "galkin", - "url": "https://github.com/galkin" - }, - { - "name": "Parambir Singh", - "githubUsername": "parambirs", - "url": "https://github.com/parambirs" - }, - { - "name": "Sebastian Silbermann", - "githubUsername": "eps1lon", - "url": "https://github.com/eps1lon" - }, - { - "name": "Thomas den Hollander", - "githubUsername": "ThomasdenH", - "url": "https://github.com/ThomasdenH" - }, - { - "name": "Wilco Bakker", - "githubUsername": "WilcoBakker", - "url": "https://github.com/WilcoBakker" - }, - { - "name": "wwwy3y3", - "githubUsername": "wwwy3y3", - "url": "https://github.com/wwwy3y3" - }, - { - "name": "Samuel Ainsworth", - "githubUsername": "samuela", - "url": "https://github.com/samuela" - }, - { - "name": "Kyle Uehlein", - "githubUsername": "kuehlein", - "url": "https://github.com/kuehlein" - }, - { - "name": "Thanik Bhongbhibhat", - "githubUsername": "bhongy", - "url": "https://github.com/bhongy" - }, - { - "name": "Marcin Kopacz", - "githubUsername": "chyzwar", - "url": "https://github.com/chyzwar" - }, - { - "name": "Trivikram Kamat", - "githubUsername": "trivikr", - "url": "https://github.com/trivikr" - }, - { - "name": "Junxiao Shi", - "githubUsername": "yoursunny", - "url": "https://github.com/yoursunny" - }, - { - "name": "Ilia Baryshnikov", - "githubUsername": "qwelias", - "url": "https://github.com/qwelias" - }, - { - "name": "ExE Boss", - "githubUsername": "ExE-Boss", - "url": "https://github.com/ExE-Boss" - }, - { - "name": "Piotr Błażejewicz", - "githubUsername": "peterblazejewicz", - "url": "https://github.com/peterblazejewicz" - }, - { - "name": "Anna Henningsen", - "githubUsername": "addaleax", - "url": "https://github.com/addaleax" - }, - { - "name": "Victor Perin", - "githubUsername": "victorperin", - "url": "https://github.com/victorperin" - }, - { - "name": "Yongsheng Zhang", - "githubUsername": "ZYSzys", - "url": "https://github.com/ZYSzys" - }, - { - "name": "NodeJS Contributors", - "githubUsername": "NodeJS", - "url": "https://github.com/NodeJS" - }, - { - "name": "Linus Unnebäck", - "githubUsername": "LinusU", - "url": "https://github.com/LinusU" - }, - { - "name": "wafuwafu13", - "githubUsername": "wafuwafu13", - "url": "https://github.com/wafuwafu13" - }, - { - "name": "Matteo Collina", - "githubUsername": "mcollina", - "url": "https://github.com/mcollina" - }, - { - "name": "Dmitry Semigradsky", - "githubUsername": "Semigradsky", - "url": "https://github.com/Semigradsky" - } - ], - "main": "", - "types": "index.d.ts", - "typesVersions": { - "<=5.6": { - "*": [ - "ts5.6/*" - ] - } - }, - "repository": { - "type": "git", - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", - "directory": "types/node" - }, - "scripts": {}, - "dependencies": { - "undici-types": "~6.19.2" - }, - "typesPublisherContentHash": "09f00b18839b10dc7208a5ca277bf956cc26a57727a134678112fc8fc609127b", - "typeScriptVersion": "4.8" -} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/@types/node/path.d.ts b/tools/mnemonic-test/node_modules/@types/node/path.d.ts deleted file mode 100644 index 25bfc802..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/path.d.ts +++ /dev/null @@ -1,200 +0,0 @@ -declare module "path/posix" { - import path = require("path"); - export = path; -} -declare module "path/win32" { - import path = require("path"); - export = path; -} -/** - * The `node:path` module provides utilities for working with file and directory - * paths. It can be accessed using: - * - * ```js - * import path from 'node:path'; - * ``` - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/path.js) - */ -declare module "path" { - namespace path { - /** - * A parsed path object generated by path.parse() or consumed by path.format(). - */ - interface ParsedPath { - /** - * The root of the path such as '/' or 'c:\' - */ - root: string; - /** - * The full directory path such as '/home/user/dir' or 'c:\path\dir' - */ - dir: string; - /** - * The file name including extension (if any) such as 'index.html' - */ - base: string; - /** - * The file extension (if any) such as '.html' - */ - ext: string; - /** - * The file name without extension (if any) such as 'index' - */ - name: string; - } - interface FormatInputPathObject { - /** - * The root of the path such as '/' or 'c:\' - */ - root?: string | undefined; - /** - * The full directory path such as '/home/user/dir' or 'c:\path\dir' - */ - dir?: string | undefined; - /** - * The file name including extension (if any) such as 'index.html' - */ - base?: string | undefined; - /** - * The file extension (if any) such as '.html' - */ - ext?: string | undefined; - /** - * The file name without extension (if any) such as 'index' - */ - name?: string | undefined; - } - interface PlatformPath { - /** - * Normalize a string path, reducing '..' and '.' parts. - * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. - * - * @param path string path to normalize. - * @throws {TypeError} if `path` is not a string. - */ - normalize(path: string): string; - /** - * Join all arguments together and normalize the resulting path. - * - * @param paths paths to join. - * @throws {TypeError} if any of the path segments is not a string. - */ - join(...paths: string[]): string; - /** - * The right-most parameter is considered {to}. Other parameters are considered an array of {from}. - * - * Starting from leftmost {from} parameter, resolves {to} to an absolute path. - * - * If {to} isn't already absolute, {from} arguments are prepended in right to left order, - * until an absolute path is found. If after using all {from} paths still no absolute path is found, - * the current working directory is used as well. The resulting path is normalized, - * and trailing slashes are removed unless the path gets resolved to the root directory. - * - * @param paths A sequence of paths or path segments. - * @throws {TypeError} if any of the arguments is not a string. - */ - resolve(...paths: string[]): string; - /** - * The `path.matchesGlob()` method determines if `path` matches the `pattern`. - * @param path The path to glob-match against. - * @param pattern The glob to check the path against. - * @returns Whether or not the `path` matched the `pattern`. - * @throws {TypeError} if `path` or `pattern` are not strings. - * @since v22.5.0 - */ - matchesGlob(path: string, pattern: string): boolean; - /** - * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory. - * - * If the given {path} is a zero-length string, `false` will be returned. - * - * @param path path to test. - * @throws {TypeError} if `path` is not a string. - */ - isAbsolute(path: string): boolean; - /** - * Solve the relative path from {from} to {to} based on the current working directory. - * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve. - * - * @throws {TypeError} if either `from` or `to` is not a string. - */ - relative(from: string, to: string): string; - /** - * Return the directory name of a path. Similar to the Unix dirname command. - * - * @param path the path to evaluate. - * @throws {TypeError} if `path` is not a string. - */ - dirname(path: string): string; - /** - * Return the last portion of a path. Similar to the Unix basename command. - * Often used to extract the file name from a fully qualified path. - * - * @param path the path to evaluate. - * @param suffix optionally, an extension to remove from the result. - * @throws {TypeError} if `path` is not a string or if `ext` is given and is not a string. - */ - basename(path: string, suffix?: string): string; - /** - * Return the extension of the path, from the last '.' to end of string in the last portion of the path. - * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string. - * - * @param path the path to evaluate. - * @throws {TypeError} if `path` is not a string. - */ - extname(path: string): string; - /** - * The platform-specific file separator. '\\' or '/'. - */ - readonly sep: "\\" | "/"; - /** - * The platform-specific file delimiter. ';' or ':'. - */ - readonly delimiter: ";" | ":"; - /** - * Returns an object from a path string - the opposite of format(). - * - * @param path path to evaluate. - * @throws {TypeError} if `path` is not a string. - */ - parse(path: string): ParsedPath; - /** - * Returns a path string from an object - the opposite of parse(). - * - * @param pathObject path to evaluate. - */ - format(pathObject: FormatInputPathObject): string; - /** - * On Windows systems only, returns an equivalent namespace-prefixed path for the given path. - * If path is not a string, path will be returned without modifications. - * This method is meaningful only on Windows system. - * On POSIX systems, the method is non-operational and always returns path without modifications. - */ - toNamespacedPath(path: string): string; - /** - * Posix specific pathing. - * Same as parent object on posix. - */ - readonly posix: PlatformPath; - /** - * Windows specific pathing. - * Same as parent object on windows - */ - readonly win32: PlatformPath; - } - } - const path: path.PlatformPath; - export = path; -} -declare module "node:path" { - import path = require("path"); - export = path; -} -declare module "node:path/posix" { - import path = require("path/posix"); - export = path; -} -declare module "node:path/win32" { - import path = require("path/win32"); - export = path; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/perf_hooks.d.ts b/tools/mnemonic-test/node_modules/@types/node/perf_hooks.d.ts deleted file mode 100644 index bffdd3ee..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/perf_hooks.d.ts +++ /dev/null @@ -1,941 +0,0 @@ -/** - * This module provides an implementation of a subset of the W3C [Web Performance APIs](https://w3c.github.io/perf-timing-primer/) as well as additional APIs for - * Node.js-specific performance measurements. - * - * Node.js supports the following [Web Performance APIs](https://w3c.github.io/perf-timing-primer/): - * - * * [High Resolution Time](https://www.w3.org/TR/hr-time-2) - * * [Performance Timeline](https://w3c.github.io/performance-timeline/) - * * [User Timing](https://www.w3.org/TR/user-timing/) - * * [Resource Timing](https://www.w3.org/TR/resource-timing-2/) - * - * ```js - * import { PerformanceObserver, performance } from 'node:perf_hooks'; - * - * const obs = new PerformanceObserver((items) => { - * console.log(items.getEntries()[0].duration); - * performance.clearMarks(); - * }); - * obs.observe({ type: 'measure' }); - * performance.measure('Start to Now'); - * - * performance.mark('A'); - * doSomeLongRunningProcess(() => { - * performance.measure('A to Now', 'A'); - * - * performance.mark('B'); - * performance.measure('A to B', 'A', 'B'); - * }); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/perf_hooks.js) - */ -declare module "perf_hooks" { - import { AsyncResource } from "node:async_hooks"; - type EntryType = - | "dns" // Node.js only - | "function" // Node.js only - | "gc" // Node.js only - | "http2" // Node.js only - | "http" // Node.js only - | "mark" // available on the Web - | "measure" // available on the Web - | "net" // Node.js only - | "node" // Node.js only - | "resource"; // available on the Web - interface NodeGCPerformanceDetail { - /** - * When `performanceEntry.entryType` is equal to 'gc', the `performance.kind` property identifies - * the type of garbage collection operation that occurred. - * See perf_hooks.constants for valid values. - */ - readonly kind?: number | undefined; - /** - * When `performanceEntry.entryType` is equal to 'gc', the `performance.flags` - * property contains additional information about garbage collection operation. - * See perf_hooks.constants for valid values. - */ - readonly flags?: number | undefined; - } - /** - * The constructor of this class is not exposed to users directly. - * @since v8.5.0 - */ - class PerformanceEntry { - protected constructor(); - /** - * The total number of milliseconds elapsed for this entry. This value will not - * be meaningful for all Performance Entry types. - * @since v8.5.0 - */ - readonly duration: number; - /** - * The name of the performance entry. - * @since v8.5.0 - */ - readonly name: string; - /** - * The high resolution millisecond timestamp marking the starting time of the - * Performance Entry. - * @since v8.5.0 - */ - readonly startTime: number; - /** - * The type of the performance entry. It may be one of: - * - * * `'node'` (Node.js only) - * * `'mark'` (available on the Web) - * * `'measure'` (available on the Web) - * * `'gc'` (Node.js only) - * * `'function'` (Node.js only) - * * `'http2'` (Node.js only) - * * `'http'` (Node.js only) - * @since v8.5.0 - */ - readonly entryType: EntryType; - /** - * Additional detail specific to the `entryType`. - * @since v16.0.0 - */ - readonly detail?: NodeGCPerformanceDetail | unknown | undefined; // TODO: Narrow this based on entry type. - toJSON(): any; - } - /** - * Exposes marks created via the `Performance.mark()` method. - * @since v18.2.0, v16.17.0 - */ - class PerformanceMark extends PerformanceEntry { - readonly duration: 0; - readonly entryType: "mark"; - } - /** - * Exposes measures created via the `Performance.measure()` method. - * - * The constructor of this class is not exposed to users directly. - * @since v18.2.0, v16.17.0 - */ - class PerformanceMeasure extends PerformanceEntry { - readonly entryType: "measure"; - } - /** - * _This property is an extension by Node.js. It is not available in Web browsers._ - * - * Provides timing details for Node.js itself. The constructor of this class - * is not exposed to users. - * @since v8.5.0 - */ - class PerformanceNodeTiming extends PerformanceEntry { - readonly entryType: "node"; - /** - * The high resolution millisecond timestamp at which the Node.js process - * completed bootstrapping. If bootstrapping has not yet finished, the property - * has the value of -1. - * @since v8.5.0 - */ - readonly bootstrapComplete: number; - /** - * The high resolution millisecond timestamp at which the Node.js environment was - * initialized. - * @since v8.5.0 - */ - readonly environment: number; - /** - * The high resolution millisecond timestamp of the amount of time the event loop - * has been idle within the event loop's event provider (e.g. `epoll_wait`). This - * does not take CPU usage into consideration. If the event loop has not yet - * started (e.g., in the first tick of the main script), the property has the - * value of 0. - * @since v14.10.0, v12.19.0 - */ - readonly idleTime: number; - /** - * The high resolution millisecond timestamp at which the Node.js event loop - * exited. If the event loop has not yet exited, the property has the value of -1\. - * It can only have a value of not -1 in a handler of the `'exit'` event. - * @since v8.5.0 - */ - readonly loopExit: number; - /** - * The high resolution millisecond timestamp at which the Node.js event loop - * started. If the event loop has not yet started (e.g., in the first tick of the - * main script), the property has the value of -1. - * @since v8.5.0 - */ - readonly loopStart: number; - /** - * The high resolution millisecond timestamp at which the Node.js process was initialized. - * @since v8.5.0 - */ - readonly nodeStart: number; - /** - * The high resolution millisecond timestamp at which the V8 platform was - * initialized. - * @since v8.5.0 - */ - readonly v8Start: number; - } - interface EventLoopUtilization { - idle: number; - active: number; - utilization: number; - } - /** - * @param utilization1 The result of a previous call to `eventLoopUtilization()`. - * @param utilization2 The result of a previous call to `eventLoopUtilization()` prior to `utilization1`. - */ - type EventLoopUtilityFunction = ( - utilization1?: EventLoopUtilization, - utilization2?: EventLoopUtilization, - ) => EventLoopUtilization; - interface MarkOptions { - /** - * Additional optional detail to include with the mark. - */ - detail?: unknown | undefined; - /** - * An optional timestamp to be used as the mark time. - * @default `performance.now()` - */ - startTime?: number | undefined; - } - interface MeasureOptions { - /** - * Additional optional detail to include with the mark. - */ - detail?: unknown | undefined; - /** - * Duration between start and end times. - */ - duration?: number | undefined; - /** - * Timestamp to be used as the end time, or a string identifying a previously recorded mark. - */ - end?: number | string | undefined; - /** - * Timestamp to be used as the start time, or a string identifying a previously recorded mark. - */ - start?: number | string | undefined; - } - interface TimerifyOptions { - /** - * A histogram object created using `perf_hooks.createHistogram()` that will record runtime - * durations in nanoseconds. - */ - histogram?: RecordableHistogram | undefined; - } - interface Performance { - /** - * If `name` is not provided, removes all `PerformanceMark` objects from the Performance Timeline. - * If `name` is provided, removes only the named mark. - * @since v8.5.0 - */ - clearMarks(name?: string): void; - /** - * If `name` is not provided, removes all `PerformanceMeasure` objects from the Performance Timeline. - * If `name` is provided, removes only the named measure. - * @since v16.7.0 - */ - clearMeasures(name?: string): void; - /** - * If `name` is not provided, removes all `PerformanceResourceTiming` objects from the Resource Timeline. - * If `name` is provided, removes only the named resource. - * @since v18.2.0, v16.17.0 - */ - clearResourceTimings(name?: string): void; - /** - * eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time. - * It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. epoll_wait). - * No other CPU idle time is taken into consideration. - */ - eventLoopUtilization: EventLoopUtilityFunction; - /** - * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`. - * If you are only interested in performance entries of certain types or that have certain names, see - * `performance.getEntriesByType()` and `performance.getEntriesByName()`. - * @since v16.7.0 - */ - getEntries(): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime` - * whose `performanceEntry.name` is equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to `type`. - * @param name - * @param type - * @since v16.7.0 - */ - getEntriesByName(name: string, type?: EntryType): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime` - * whose `performanceEntry.entryType` is equal to `type`. - * @param type - * @since v16.7.0 - */ - getEntriesByType(type: EntryType): PerformanceEntry[]; - /** - * Creates a new `PerformanceMark` entry in the Performance Timeline. - * A `PerformanceMark` is a subclass of `PerformanceEntry` whose `performanceEntry.entryType` is always `'mark'`, - * and whose `performanceEntry.duration` is always `0`. - * Performance marks are used to mark specific significant moments in the Performance Timeline. - * - * The created `PerformanceMark` entry is put in the global Performance Timeline and can be queried with - * `performance.getEntries`, `performance.getEntriesByName`, and `performance.getEntriesByType`. When the observation is - * performed, the entries should be cleared from the global Performance Timeline manually with `performance.clearMarks`. - * @param name - */ - mark(name: string, options?: MarkOptions): PerformanceMark; - /** - * Creates a new `PerformanceResourceTiming` entry in the Resource Timeline. - * A `PerformanceResourceTiming` is a subclass of `PerformanceEntry` whose `performanceEntry.entryType` is always `'resource'`. - * Performance resources are used to mark moments in the Resource Timeline. - * @param timingInfo [Fetch Timing Info](https://fetch.spec.whatwg.org/#fetch-timing-info) - * @param requestedUrl The resource url - * @param initiatorType The initiator name, e.g: 'fetch' - * @param global - * @param cacheMode The cache mode must be an empty string ('') or 'local' - * @param bodyInfo [Fetch Response Body Info](https://fetch.spec.whatwg.org/#response-body-info) - * @param responseStatus The response's status code - * @param deliveryType The delivery type. Default: ''. - * @since v18.2.0, v16.17.0 - */ - markResourceTiming( - timingInfo: object, - requestedUrl: string, - initiatorType: string, - global: object, - cacheMode: "" | "local", - bodyInfo: object, - responseStatus: number, - deliveryType?: string, - ): PerformanceResourceTiming; - /** - * Creates a new PerformanceMeasure entry in the Performance Timeline. - * A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure', - * and whose performanceEntry.duration measures the number of milliseconds elapsed since startMark and endMark. - * - * The startMark argument may identify any existing PerformanceMark in the the Performance Timeline, or may identify - * any of the timestamp properties provided by the PerformanceNodeTiming class. If the named startMark does not exist, - * then startMark is set to timeOrigin by default. - * - * The endMark argument must identify any existing PerformanceMark in the the Performance Timeline or any of the timestamp - * properties provided by the PerformanceNodeTiming class. If the named endMark does not exist, an error will be thrown. - * @param name - * @param startMark - * @param endMark - * @return The PerformanceMeasure entry that was created - */ - measure(name: string, startMark?: string, endMark?: string): PerformanceMeasure; - measure(name: string, options: MeasureOptions): PerformanceMeasure; - /** - * _This property is an extension by Node.js. It is not available in Web browsers._ - * - * An instance of the `PerformanceNodeTiming` class that provides performance metrics for specific Node.js operational milestones. - * @since v8.5.0 - */ - readonly nodeTiming: PerformanceNodeTiming; - /** - * Returns the current high resolution millisecond timestamp, where 0 represents the start of the current `node` process. - * @since v8.5.0 - */ - now(): number; - /** - * Sets the global performance resource timing buffer size to the specified number of "resource" type performance entry objects. - * - * By default the max buffer size is set to 250. - * @since v18.8.0 - */ - setResourceTimingBufferSize(maxSize: number): void; - /** - * The [`timeOrigin`](https://w3c.github.io/hr-time/#dom-performance-timeorigin) specifies the high resolution millisecond timestamp - * at which the current `node` process began, measured in Unix time. - * @since v8.5.0 - */ - readonly timeOrigin: number; - /** - * _This property is an extension by Node.js. It is not available in Web browsers._ - * - * Wraps a function within a new function that measures the running time of the wrapped function. - * A `PerformanceObserver` must be subscribed to the `'function'` event type in order for the timing details to be accessed. - * - * ```js - * import { - * performance, - * PerformanceObserver, - * } from 'node:perf_hooks'; - * - * function someFunction() { - * console.log('hello world'); - * } - * - * const wrapped = performance.timerify(someFunction); - * - * const obs = new PerformanceObserver((list) => { - * console.log(list.getEntries()[0].duration); - * - * performance.clearMarks(); - * performance.clearMeasures(); - * obs.disconnect(); - * }); - * obs.observe({ entryTypes: ['function'] }); - * - * // A performance timeline entry will be created - * wrapped(); - * ``` - * - * If the wrapped function returns a promise, a finally handler will be attached to the promise and the duration will be reported - * once the finally handler is invoked. - * @param fn - */ - timerify any>(fn: T, options?: TimerifyOptions): T; - /** - * An object which is JSON representation of the performance object. It is similar to - * [`window.performance.toJSON`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/toJSON) in browsers. - * @since v16.1.0 - */ - toJSON(): any; - } - class PerformanceObserverEntryList { - /** - * Returns a list of `PerformanceEntry` objects in chronological order - * with respect to `performanceEntry.startTime`. - * - * ```js - * import { - * performance, - * PerformanceObserver, - * } from 'node:perf_hooks'; - * - * const obs = new PerformanceObserver((perfObserverList, observer) => { - * console.log(perfObserverList.getEntries()); - * - * * [ - * * PerformanceEntry { - * * name: 'test', - * * entryType: 'mark', - * * startTime: 81.465639, - * * duration: 0, - * * detail: null - * * }, - * * PerformanceEntry { - * * name: 'meow', - * * entryType: 'mark', - * * startTime: 81.860064, - * * duration: 0, - * * detail: null - * * } - * * ] - * - * performance.clearMarks(); - * performance.clearMeasures(); - * observer.disconnect(); - * }); - * obs.observe({ type: 'mark' }); - * - * performance.mark('test'); - * performance.mark('meow'); - * ``` - * @since v8.5.0 - */ - getEntries(): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order - * with respect to `performanceEntry.startTime` whose `performanceEntry.name` is - * equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to`type`. - * - * ```js - * import { - * performance, - * PerformanceObserver, - * } from 'node:perf_hooks'; - * - * const obs = new PerformanceObserver((perfObserverList, observer) => { - * console.log(perfObserverList.getEntriesByName('meow')); - * - * * [ - * * PerformanceEntry { - * * name: 'meow', - * * entryType: 'mark', - * * startTime: 98.545991, - * * duration: 0, - * * detail: null - * * } - * * ] - * - * console.log(perfObserverList.getEntriesByName('nope')); // [] - * - * console.log(perfObserverList.getEntriesByName('test', 'mark')); - * - * * [ - * * PerformanceEntry { - * * name: 'test', - * * entryType: 'mark', - * * startTime: 63.518931, - * * duration: 0, - * * detail: null - * * } - * * ] - * - * console.log(perfObserverList.getEntriesByName('test', 'measure')); // [] - * - * performance.clearMarks(); - * performance.clearMeasures(); - * observer.disconnect(); - * }); - * obs.observe({ entryTypes: ['mark', 'measure'] }); - * - * performance.mark('test'); - * performance.mark('meow'); - * ``` - * @since v8.5.0 - */ - getEntriesByName(name: string, type?: EntryType): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order - * with respect to `performanceEntry.startTime` whose `performanceEntry.entryType` is equal to `type`. - * - * ```js - * import { - * performance, - * PerformanceObserver, - * } from 'node:perf_hooks'; - * - * const obs = new PerformanceObserver((perfObserverList, observer) => { - * console.log(perfObserverList.getEntriesByType('mark')); - * - * * [ - * * PerformanceEntry { - * * name: 'test', - * * entryType: 'mark', - * * startTime: 55.897834, - * * duration: 0, - * * detail: null - * * }, - * * PerformanceEntry { - * * name: 'meow', - * * entryType: 'mark', - * * startTime: 56.350146, - * * duration: 0, - * * detail: null - * * } - * * ] - * - * performance.clearMarks(); - * performance.clearMeasures(); - * observer.disconnect(); - * }); - * obs.observe({ type: 'mark' }); - * - * performance.mark('test'); - * performance.mark('meow'); - * ``` - * @since v8.5.0 - */ - getEntriesByType(type: EntryType): PerformanceEntry[]; - } - type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void; - /** - * @since v8.5.0 - */ - class PerformanceObserver extends AsyncResource { - constructor(callback: PerformanceObserverCallback); - /** - * Disconnects the `PerformanceObserver` instance from all notifications. - * @since v8.5.0 - */ - disconnect(): void; - /** - * Subscribes the `PerformanceObserver` instance to notifications of new `PerformanceEntry` instances identified either by `options.entryTypes` or `options.type`: - * - * ```js - * import { - * performance, - * PerformanceObserver, - * } from 'node:perf_hooks'; - * - * const obs = new PerformanceObserver((list, observer) => { - * // Called once asynchronously. `list` contains three items. - * }); - * obs.observe({ type: 'mark' }); - * - * for (let n = 0; n < 3; n++) - * performance.mark(`test${n}`); - * ``` - * @since v8.5.0 - */ - observe( - options: - | { - entryTypes: readonly EntryType[]; - buffered?: boolean | undefined; - } - | { - type: EntryType; - buffered?: boolean | undefined; - }, - ): void; - } - /** - * Provides detailed network timing data regarding the loading of an application's resources. - * - * The constructor of this class is not exposed to users directly. - * @since v18.2.0, v16.17.0 - */ - class PerformanceResourceTiming extends PerformanceEntry { - readonly entryType: "resource"; - protected constructor(); - /** - * The high resolution millisecond timestamp at immediately before dispatching the `fetch` - * request. If the resource is not intercepted by a worker the property will always return 0. - * @since v18.2.0, v16.17.0 - */ - readonly workerStart: number; - /** - * The high resolution millisecond timestamp that represents the start time of the fetch which - * initiates the redirect. - * @since v18.2.0, v16.17.0 - */ - readonly redirectStart: number; - /** - * The high resolution millisecond timestamp that will be created immediately after receiving - * the last byte of the response of the last redirect. - * @since v18.2.0, v16.17.0 - */ - readonly redirectEnd: number; - /** - * The high resolution millisecond timestamp immediately before the Node.js starts to fetch the resource. - * @since v18.2.0, v16.17.0 - */ - readonly fetchStart: number; - /** - * The high resolution millisecond timestamp immediately before the Node.js starts the domain name lookup - * for the resource. - * @since v18.2.0, v16.17.0 - */ - readonly domainLookupStart: number; - /** - * The high resolution millisecond timestamp representing the time immediately after the Node.js finished - * the domain name lookup for the resource. - * @since v18.2.0, v16.17.0 - */ - readonly domainLookupEnd: number; - /** - * The high resolution millisecond timestamp representing the time immediately before Node.js starts to - * establish the connection to the server to retrieve the resource. - * @since v18.2.0, v16.17.0 - */ - readonly connectStart: number; - /** - * The high resolution millisecond timestamp representing the time immediately after Node.js finishes - * establishing the connection to the server to retrieve the resource. - * @since v18.2.0, v16.17.0 - */ - readonly connectEnd: number; - /** - * The high resolution millisecond timestamp representing the time immediately before Node.js starts the - * handshake process to secure the current connection. - * @since v18.2.0, v16.17.0 - */ - readonly secureConnectionStart: number; - /** - * The high resolution millisecond timestamp representing the time immediately before Node.js receives the - * first byte of the response from the server. - * @since v18.2.0, v16.17.0 - */ - readonly requestStart: number; - /** - * The high resolution millisecond timestamp representing the time immediately after Node.js receives the - * last byte of the resource or immediately before the transport connection is closed, whichever comes first. - * @since v18.2.0, v16.17.0 - */ - readonly responseEnd: number; - /** - * A number representing the size (in octets) of the fetched resource. The size includes the response header - * fields plus the response payload body. - * @since v18.2.0, v16.17.0 - */ - readonly transferSize: number; - /** - * A number representing the size (in octets) received from the fetch (HTTP or cache), of the payload body, before - * removing any applied content-codings. - * @since v18.2.0, v16.17.0 - */ - readonly encodedBodySize: number; - /** - * A number representing the size (in octets) received from the fetch (HTTP or cache), of the message body, after - * removing any applied content-codings. - * @since v18.2.0, v16.17.0 - */ - readonly decodedBodySize: number; - /** - * Returns a `object` that is the JSON representation of the `PerformanceResourceTiming` object - * @since v18.2.0, v16.17.0 - */ - toJSON(): any; - } - namespace constants { - const NODE_PERFORMANCE_GC_MAJOR: number; - const NODE_PERFORMANCE_GC_MINOR: number; - const NODE_PERFORMANCE_GC_INCREMENTAL: number; - const NODE_PERFORMANCE_GC_WEAKCB: number; - const NODE_PERFORMANCE_GC_FLAGS_NO: number; - const NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: number; - const NODE_PERFORMANCE_GC_FLAGS_FORCED: number; - const NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: number; - const NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: number; - const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: number; - const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: number; - } - const performance: Performance; - interface EventLoopMonitorOptions { - /** - * The sampling rate in milliseconds. - * Must be greater than zero. - * @default 10 - */ - resolution?: number | undefined; - } - interface Histogram { - /** - * The number of samples recorded by the histogram. - * @since v17.4.0, v16.14.0 - */ - readonly count: number; - /** - * The number of samples recorded by the histogram. - * v17.4.0, v16.14.0 - */ - readonly countBigInt: bigint; - /** - * The number of times the event loop delay exceeded the maximum 1 hour event - * loop delay threshold. - * @since v11.10.0 - */ - readonly exceeds: number; - /** - * The number of times the event loop delay exceeded the maximum 1 hour event loop delay threshold. - * @since v17.4.0, v16.14.0 - */ - readonly exceedsBigInt: bigint; - /** - * The maximum recorded event loop delay. - * @since v11.10.0 - */ - readonly max: number; - /** - * The maximum recorded event loop delay. - * v17.4.0, v16.14.0 - */ - readonly maxBigInt: number; - /** - * The mean of the recorded event loop delays. - * @since v11.10.0 - */ - readonly mean: number; - /** - * The minimum recorded event loop delay. - * @since v11.10.0 - */ - readonly min: number; - /** - * The minimum recorded event loop delay. - * v17.4.0, v16.14.0 - */ - readonly minBigInt: bigint; - /** - * Returns the value at the given percentile. - * @since v11.10.0 - * @param percentile A percentile value in the range (0, 100]. - */ - percentile(percentile: number): number; - /** - * Returns the value at the given percentile. - * @since v17.4.0, v16.14.0 - * @param percentile A percentile value in the range (0, 100]. - */ - percentileBigInt(percentile: number): bigint; - /** - * Returns a `Map` object detailing the accumulated percentile distribution. - * @since v11.10.0 - */ - readonly percentiles: Map; - /** - * Returns a `Map` object detailing the accumulated percentile distribution. - * @since v17.4.0, v16.14.0 - */ - readonly percentilesBigInt: Map; - /** - * Resets the collected histogram data. - * @since v11.10.0 - */ - reset(): void; - /** - * The standard deviation of the recorded event loop delays. - * @since v11.10.0 - */ - readonly stddev: number; - } - interface IntervalHistogram extends Histogram { - /** - * Enables the update interval timer. Returns `true` if the timer was - * started, `false` if it was already started. - * @since v11.10.0 - */ - enable(): boolean; - /** - * Disables the update interval timer. Returns `true` if the timer was - * stopped, `false` if it was already stopped. - * @since v11.10.0 - */ - disable(): boolean; - } - interface RecordableHistogram extends Histogram { - /** - * @since v15.9.0, v14.18.0 - * @param val The amount to record in the histogram. - */ - record(val: number | bigint): void; - /** - * Calculates the amount of time (in nanoseconds) that has passed since the - * previous call to `recordDelta()` and records that amount in the histogram. - * @since v15.9.0, v14.18.0 - */ - recordDelta(): void; - /** - * Adds the values from `other` to this histogram. - * @since v17.4.0, v16.14.0 - */ - add(other: RecordableHistogram): void; - } - /** - * _This property is an extension by Node.js. It is not available in Web browsers._ - * - * Creates an `IntervalHistogram` object that samples and reports the event loop - * delay over time. The delays will be reported in nanoseconds. - * - * Using a timer to detect approximate event loop delay works because the - * execution of timers is tied specifically to the lifecycle of the libuv - * event loop. That is, a delay in the loop will cause a delay in the execution - * of the timer, and those delays are specifically what this API is intended to - * detect. - * - * ```js - * import { monitorEventLoopDelay } from 'node:perf_hooks'; - * const h = monitorEventLoopDelay({ resolution: 20 }); - * h.enable(); - * // Do something. - * h.disable(); - * console.log(h.min); - * console.log(h.max); - * console.log(h.mean); - * console.log(h.stddev); - * console.log(h.percentiles); - * console.log(h.percentile(50)); - * console.log(h.percentile(99)); - * ``` - * @since v11.10.0 - */ - function monitorEventLoopDelay(options?: EventLoopMonitorOptions): IntervalHistogram; - interface CreateHistogramOptions { - /** - * The minimum recordable value. Must be an integer value greater than 0. - * @default 1 - */ - min?: number | bigint | undefined; - /** - * The maximum recordable value. Must be an integer value greater than min. - * @default Number.MAX_SAFE_INTEGER - */ - max?: number | bigint | undefined; - /** - * The number of accuracy digits. Must be a number between 1 and 5. - * @default 3 - */ - figures?: number | undefined; - } - /** - * Returns a `RecordableHistogram`. - * @since v15.9.0, v14.18.0 - */ - function createHistogram(options?: CreateHistogramOptions): RecordableHistogram; - import { - performance as _performance, - PerformanceEntry as _PerformanceEntry, - PerformanceMark as _PerformanceMark, - PerformanceMeasure as _PerformanceMeasure, - PerformanceObserver as _PerformanceObserver, - PerformanceObserverEntryList as _PerformanceObserverEntryList, - PerformanceResourceTiming as _PerformanceResourceTiming, - } from "perf_hooks"; - global { - /** - * `PerformanceEntry` is a global reference for `import { PerformanceEntry } from 'node:perf_hooks'` - * @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performanceentry - * @since v19.0.0 - */ - var PerformanceEntry: typeof globalThis extends { - onmessage: any; - PerformanceEntry: infer T; - } ? T - : typeof _PerformanceEntry; - /** - * `PerformanceMark` is a global reference for `import { PerformanceMark } from 'node:perf_hooks'` - * @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performancemark - * @since v19.0.0 - */ - var PerformanceMark: typeof globalThis extends { - onmessage: any; - PerformanceMark: infer T; - } ? T - : typeof _PerformanceMark; - /** - * `PerformanceMeasure` is a global reference for `import { PerformanceMeasure } from 'node:perf_hooks'` - * @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performancemeasure - * @since v19.0.0 - */ - var PerformanceMeasure: typeof globalThis extends { - onmessage: any; - PerformanceMeasure: infer T; - } ? T - : typeof _PerformanceMeasure; - /** - * `PerformanceObserver` is a global reference for `import { PerformanceObserver } from 'node:perf_hooks'` - * @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performanceobserver - * @since v19.0.0 - */ - var PerformanceObserver: typeof globalThis extends { - onmessage: any; - PerformanceObserver: infer T; - } ? T - : typeof _PerformanceObserver; - /** - * `PerformanceObserverEntryList` is a global reference for `import { PerformanceObserverEntryList } from 'node:perf_hooks'` - * @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performanceobserverentrylist - * @since v19.0.0 - */ - var PerformanceObserverEntryList: typeof globalThis extends { - onmessage: any; - PerformanceObserverEntryList: infer T; - } ? T - : typeof _PerformanceObserverEntryList; - /** - * `PerformanceResourceTiming` is a global reference for `import { PerformanceResourceTiming } from 'node:perf_hooks'` - * @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performanceresourcetiming - * @since v19.0.0 - */ - var PerformanceResourceTiming: typeof globalThis extends { - onmessage: any; - PerformanceResourceTiming: infer T; - } ? T - : typeof _PerformanceResourceTiming; - /** - * `performance` is a global reference for `import { performance } from 'node:perf_hooks'` - * @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performance - * @since v16.0.0 - */ - var performance: typeof globalThis extends { - onmessage: any; - performance: infer T; - } ? T - : typeof _performance; - } -} -declare module "node:perf_hooks" { - export * from "perf_hooks"; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/process.d.ts b/tools/mnemonic-test/node_modules/@types/node/process.d.ts deleted file mode 100644 index e7fd20bb..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/process.d.ts +++ /dev/null @@ -1,1912 +0,0 @@ -declare module "process" { - import * as tty from "node:tty"; - import { Worker } from "node:worker_threads"; - - interface BuiltInModule { - "assert": typeof import("assert"); - "node:assert": typeof import("node:assert"); - "assert/strict": typeof import("assert/strict"); - "node:assert/strict": typeof import("node:assert/strict"); - "async_hooks": typeof import("async_hooks"); - "node:async_hooks": typeof import("node:async_hooks"); - "buffer": typeof import("buffer"); - "node:buffer": typeof import("node:buffer"); - "child_process": typeof import("child_process"); - "node:child_process": typeof import("node:child_process"); - "cluster": typeof import("cluster"); - "node:cluster": typeof import("node:cluster"); - "console": typeof import("console"); - "node:console": typeof import("node:console"); - "constants": typeof import("constants"); - "node:constants": typeof import("node:constants"); - "crypto": typeof import("crypto"); - "node:crypto": typeof import("node:crypto"); - "dgram": typeof import("dgram"); - "node:dgram": typeof import("node:dgram"); - "diagnostics_channel": typeof import("diagnostics_channel"); - "node:diagnostics_channel": typeof import("node:diagnostics_channel"); - "dns": typeof import("dns"); - "node:dns": typeof import("node:dns"); - "dns/promises": typeof import("dns/promises"); - "node:dns/promises": typeof import("node:dns/promises"); - "domain": typeof import("domain"); - "node:domain": typeof import("node:domain"); - "events": typeof import("events"); - "node:events": typeof import("node:events"); - "fs": typeof import("fs"); - "node:fs": typeof import("node:fs"); - "fs/promises": typeof import("fs/promises"); - "node:fs/promises": typeof import("node:fs/promises"); - "http": typeof import("http"); - "node:http": typeof import("node:http"); - "http2": typeof import("http2"); - "node:http2": typeof import("node:http2"); - "https": typeof import("https"); - "node:https": typeof import("node:https"); - "inspector": typeof import("inspector"); - "node:inspector": typeof import("node:inspector"); - "inspector/promises": typeof import("inspector/promises"); - "node:inspector/promises": typeof import("node:inspector/promises"); - "module": typeof import("module"); - "node:module": typeof import("node:module"); - "net": typeof import("net"); - "node:net": typeof import("node:net"); - "os": typeof import("os"); - "node:os": typeof import("node:os"); - "path": typeof import("path"); - "node:path": typeof import("node:path"); - "path/posix": typeof import("path/posix"); - "node:path/posix": typeof import("node:path/posix"); - "path/win32": typeof import("path/win32"); - "node:path/win32": typeof import("node:path/win32"); - "perf_hooks": typeof import("perf_hooks"); - "node:perf_hooks": typeof import("node:perf_hooks"); - "process": typeof import("process"); - "node:process": typeof import("node:process"); - "punycode": typeof import("punycode"); - "node:punycode": typeof import("node:punycode"); - "querystring": typeof import("querystring"); - "node:querystring": typeof import("node:querystring"); - "readline": typeof import("readline"); - "node:readline": typeof import("node:readline"); - "readline/promises": typeof import("readline/promises"); - "node:readline/promises": typeof import("node:readline/promises"); - "repl": typeof import("repl"); - "node:repl": typeof import("node:repl"); - "node:sea": typeof import("node:sea"); - "node:sqlite": typeof import("node:sqlite"); - "stream": typeof import("stream"); - "node:stream": typeof import("node:stream"); - "stream/consumers": typeof import("stream/consumers"); - "node:stream/consumers": typeof import("node:stream/consumers"); - "stream/promises": typeof import("stream/promises"); - "node:stream/promises": typeof import("node:stream/promises"); - "stream/web": typeof import("stream/web"); - "node:stream/web": typeof import("node:stream/web"); - "string_decoder": typeof import("string_decoder"); - "node:string_decoder": typeof import("node:string_decoder"); - "node:test": typeof import("node:test"); - "node:test/reporters": typeof import("node:test/reporters"); - "timers": typeof import("timers"); - "node:timers": typeof import("node:timers"); - "timers/promises": typeof import("timers/promises"); - "node:timers/promises": typeof import("node:timers/promises"); - "tls": typeof import("tls"); - "node:tls": typeof import("node:tls"); - "trace_events": typeof import("trace_events"); - "node:trace_events": typeof import("node:trace_events"); - "tty": typeof import("tty"); - "node:tty": typeof import("node:tty"); - "url": typeof import("url"); - "node:url": typeof import("node:url"); - "util": typeof import("util"); - "node:util": typeof import("node:util"); - "sys": typeof import("util"); - "node:sys": typeof import("node:util"); - "util/types": typeof import("util/types"); - "node:util/types": typeof import("node:util/types"); - "v8": typeof import("v8"); - "node:v8": typeof import("node:v8"); - "vm": typeof import("vm"); - "node:vm": typeof import("node:vm"); - "wasi": typeof import("wasi"); - "node:wasi": typeof import("node:wasi"); - "worker_threads": typeof import("worker_threads"); - "node:worker_threads": typeof import("node:worker_threads"); - "zlib": typeof import("zlib"); - "node:zlib": typeof import("node:zlib"); - } - global { - var process: NodeJS.Process; - namespace NodeJS { - // this namespace merge is here because these are specifically used - // as the type for process.stdin, process.stdout, and process.stderr. - // they can't live in tty.d.ts because we need to disambiguate the imported name. - interface ReadStream extends tty.ReadStream {} - interface WriteStream extends tty.WriteStream {} - interface MemoryUsageFn { - /** - * The `process.memoryUsage()` method iterate over each page to gather informations about memory - * usage which can be slow depending on the program memory allocations. - */ - (): MemoryUsage; - /** - * method returns an integer representing the Resident Set Size (RSS) in bytes. - */ - rss(): number; - } - interface MemoryUsage { - /** - * Resident Set Size, is the amount of space occupied in the main memory device (that is a subset of the total allocated memory) for the - * process, including all C++ and JavaScript objects and code. - */ - rss: number; - /** - * Refers to V8's memory usage. - */ - heapTotal: number; - /** - * Refers to V8's memory usage. - */ - heapUsed: number; - external: number; - /** - * Refers to memory allocated for `ArrayBuffer`s and `SharedArrayBuffer`s, including all Node.js Buffers. This is also included - * in the external value. When Node.js is used as an embedded library, this value may be `0` because allocations for `ArrayBuffer`s - * may not be tracked in that case. - */ - arrayBuffers: number; - } - interface CpuUsage { - user: number; - system: number; - } - interface ProcessRelease { - name: string; - sourceUrl?: string | undefined; - headersUrl?: string | undefined; - libUrl?: string | undefined; - lts?: string | undefined; - } - interface ProcessVersions extends Dict { - http_parser: string; - node: string; - v8: string; - ares: string; - uv: string; - zlib: string; - modules: string; - openssl: string; - } - type Platform = - | "aix" - | "android" - | "darwin" - | "freebsd" - | "haiku" - | "linux" - | "openbsd" - | "sunos" - | "win32" - | "cygwin" - | "netbsd"; - type Architecture = - | "arm" - | "arm64" - | "ia32" - | "loong64" - | "mips" - | "mipsel" - | "ppc" - | "ppc64" - | "riscv64" - | "s390" - | "s390x" - | "x64"; - type Signals = - | "SIGABRT" - | "SIGALRM" - | "SIGBUS" - | "SIGCHLD" - | "SIGCONT" - | "SIGFPE" - | "SIGHUP" - | "SIGILL" - | "SIGINT" - | "SIGIO" - | "SIGIOT" - | "SIGKILL" - | "SIGPIPE" - | "SIGPOLL" - | "SIGPROF" - | "SIGPWR" - | "SIGQUIT" - | "SIGSEGV" - | "SIGSTKFLT" - | "SIGSTOP" - | "SIGSYS" - | "SIGTERM" - | "SIGTRAP" - | "SIGTSTP" - | "SIGTTIN" - | "SIGTTOU" - | "SIGUNUSED" - | "SIGURG" - | "SIGUSR1" - | "SIGUSR2" - | "SIGVTALRM" - | "SIGWINCH" - | "SIGXCPU" - | "SIGXFSZ" - | "SIGBREAK" - | "SIGLOST" - | "SIGINFO"; - type UncaughtExceptionOrigin = "uncaughtException" | "unhandledRejection"; - type MultipleResolveType = "resolve" | "reject"; - type BeforeExitListener = (code: number) => void; - type DisconnectListener = () => void; - type ExitListener = (code: number) => void; - type RejectionHandledListener = (promise: Promise) => void; - type UncaughtExceptionListener = (error: Error, origin: UncaughtExceptionOrigin) => void; - /** - * Most of the time the unhandledRejection will be an Error, but this should not be relied upon - * as *anything* can be thrown/rejected, it is therefore unsafe to assume that the value is an Error. - */ - type UnhandledRejectionListener = (reason: unknown, promise: Promise) => void; - type WarningListener = (warning: Error) => void; - type MessageListener = (message: unknown, sendHandle: unknown) => void; - type SignalsListener = (signal: Signals) => void; - type MultipleResolveListener = ( - type: MultipleResolveType, - promise: Promise, - value: unknown, - ) => void; - type WorkerListener = (worker: Worker) => void; - interface Socket extends ReadWriteStream { - isTTY?: true | undefined; - } - // Alias for compatibility - interface ProcessEnv extends Dict { - /** - * Can be used to change the default timezone at runtime - */ - TZ?: string; - } - interface HRTime { - (time?: [number, number]): [number, number]; - /** - * The `bigint` version of the `{@link hrtime()}` method returning the current high-resolution real time in nanoseconds as a `bigint`. - * - * Unlike `{@link hrtime()}`, it does not support an additional time argument since the difference can just be computed directly by subtraction of the two `bigint`s. - * ```js - * import { hrtime } from 'node:process'; - * - * const start = hrtime.bigint(); - * // 191051479007711n - * - * setTimeout(() => { - * const end = hrtime.bigint(); - * // 191052633396993n - * - * console.log(`Benchmark took ${end - start} nanoseconds`); - * // Benchmark took 1154389282 nanoseconds - * }, 1000); - * ``` - */ - bigint(): bigint; - } - interface ProcessPermission { - /** - * Verifies that the process is able to access the given scope and reference. - * If no reference is provided, a global scope is assumed, for instance, `process.permission.has('fs.read')` - * will check if the process has ALL file system read permissions. - * - * The reference has a meaning based on the provided scope. For example, the reference when the scope is File System means files and folders. - * - * The available scopes are: - * - * * `fs` - All File System - * * `fs.read` - File System read operations - * * `fs.write` - File System write operations - * * `child` - Child process spawning operations - * * `worker` - Worker thread spawning operation - * - * ```js - * // Check if the process has permission to read the README file - * process.permission.has('fs.read', './README.md'); - * // Check if the process has read permission operations - * process.permission.has('fs.read'); - * ``` - * @since v20.0.0 - */ - has(scope: string, reference?: string): boolean; - } - interface ProcessReport { - /** - * Write reports in a compact format, single-line JSON, more easily consumable by log processing systems - * than the default multi-line format designed for human consumption. - * @since v13.12.0, v12.17.0 - */ - compact: boolean; - /** - * Directory where the report is written. - * The default value is the empty string, indicating that reports are written to the current - * working directory of the Node.js process. - */ - directory: string; - /** - * Filename where the report is written. If set to the empty string, the output filename will be comprised - * of a timestamp, PID, and sequence number. The default value is the empty string. - */ - filename: string; - /** - * Returns a JavaScript Object representation of a diagnostic report for the running process. - * The report's JavaScript stack trace is taken from `err`, if present. - */ - getReport(err?: Error): object; - /** - * If true, a diagnostic report is generated on fatal errors, - * such as out of memory errors or failed C++ assertions. - * @default false - */ - reportOnFatalError: boolean; - /** - * If true, a diagnostic report is generated when the process - * receives the signal specified by process.report.signal. - * @default false - */ - reportOnSignal: boolean; - /** - * If true, a diagnostic report is generated on uncaught exception. - * @default false - */ - reportOnUncaughtException: boolean; - /** - * The signal used to trigger the creation of a diagnostic report. - * @default 'SIGUSR2' - */ - signal: Signals; - /** - * Writes a diagnostic report to a file. If filename is not provided, the default filename - * includes the date, time, PID, and a sequence number. - * The report's JavaScript stack trace is taken from `err`, if present. - * - * If the value of filename is set to `'stdout'` or `'stderr'`, the report is written - * to the stdout or stderr of the process respectively. - * @param fileName Name of the file where the report is written. - * This should be a relative path, that will be appended to the directory specified in - * `process.report.directory`, or the current working directory of the Node.js process, - * if unspecified. - * @param err A custom error used for reporting the JavaScript stack. - * @return Filename of the generated report. - */ - writeReport(fileName?: string, err?: Error): string; - writeReport(err?: Error): string; - } - interface ResourceUsage { - fsRead: number; - fsWrite: number; - involuntaryContextSwitches: number; - ipcReceived: number; - ipcSent: number; - majorPageFault: number; - maxRSS: number; - minorPageFault: number; - sharedMemorySize: number; - signalsCount: number; - swappedOut: number; - systemCPUTime: number; - unsharedDataSize: number; - unsharedStackSize: number; - userCPUTime: number; - voluntaryContextSwitches: number; - } - interface EmitWarningOptions { - /** - * When `warning` is a `string`, `type` is the name to use for the _type_ of warning being emitted. - * - * @default 'Warning' - */ - type?: string | undefined; - /** - * A unique identifier for the warning instance being emitted. - */ - code?: string | undefined; - /** - * When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace. - * - * @default process.emitWarning - */ - ctor?: Function | undefined; - /** - * Additional text to include with the error. - */ - detail?: string | undefined; - } - interface ProcessConfig { - readonly target_defaults: { - readonly cflags: any[]; - readonly default_configuration: string; - readonly defines: string[]; - readonly include_dirs: string[]; - readonly libraries: string[]; - }; - readonly variables: { - readonly clang: number; - readonly host_arch: string; - readonly node_install_npm: boolean; - readonly node_install_waf: boolean; - readonly node_prefix: string; - readonly node_shared_openssl: boolean; - readonly node_shared_v8: boolean; - readonly node_shared_zlib: boolean; - readonly node_use_dtrace: boolean; - readonly node_use_etw: boolean; - readonly node_use_openssl: boolean; - readonly target_arch: string; - readonly v8_no_strict_aliasing: number; - readonly v8_use_snapshot: boolean; - readonly visibility: string; - }; - } - interface Process extends EventEmitter { - /** - * The `process.stdout` property returns a stream connected to`stdout` (fd `1`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `1` refers to a file, in which case it is - * a `Writable` stream. - * - * For example, to copy `process.stdin` to `process.stdout`: - * - * ```js - * import { stdin, stdout } from 'node:process'; - * - * stdin.pipe(stdout); - * ``` - * - * `process.stdout` differs from other Node.js streams in important ways. See `note on process I/O` for more information. - */ - stdout: WriteStream & { - fd: 1; - }; - /** - * The `process.stderr` property returns a stream connected to`stderr` (fd `2`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `2` refers to a file, in which case it is - * a `Writable` stream. - * - * `process.stderr` differs from other Node.js streams in important ways. See `note on process I/O` for more information. - */ - stderr: WriteStream & { - fd: 2; - }; - /** - * The `process.stdin` property returns a stream connected to`stdin` (fd `0`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `0` refers to a file, in which case it is - * a `Readable` stream. - * - * For details of how to read from `stdin` see `readable.read()`. - * - * As a `Duplex` stream, `process.stdin` can also be used in "old" mode that - * is compatible with scripts written for Node.js prior to v0.10\. - * For more information see `Stream compatibility`. - * - * In "old" streams mode the `stdin` stream is paused by default, so one - * must call `process.stdin.resume()` to read from it. Note also that calling `process.stdin.resume()` itself would switch stream to "old" mode. - */ - stdin: ReadStream & { - fd: 0; - }; - /** - * The `process.argv` property returns an array containing the command-line - * arguments passed when the Node.js process was launched. The first element will - * be {@link execPath}. See `process.argv0` if access to the original value - * of `argv[0]` is needed. The second element will be the path to the JavaScript - * file being executed. The remaining elements will be any additional command-line - * arguments. - * - * For example, assuming the following script for `process-args.js`: - * - * ```js - * import { argv } from 'node:process'; - * - * // print process.argv - * argv.forEach((val, index) => { - * console.log(`${index}: ${val}`); - * }); - * ``` - * - * Launching the Node.js process as: - * - * ```bash - * node process-args.js one two=three four - * ``` - * - * Would generate the output: - * - * ```text - * 0: /usr/local/bin/node - * 1: /Users/mjr/work/node/process-args.js - * 2: one - * 3: two=three - * 4: four - * ``` - * @since v0.1.27 - */ - argv: string[]; - /** - * The `process.argv0` property stores a read-only copy of the original value of`argv[0]` passed when Node.js starts. - * - * ```console - * $ bash -c 'exec -a customArgv0 ./node' - * > process.argv[0] - * '/Volumes/code/external/node/out/Release/node' - * > process.argv0 - * 'customArgv0' - * ``` - * @since v6.4.0 - */ - argv0: string; - /** - * The `process.execArgv` property returns the set of Node.js-specific command-line - * options passed when the Node.js process was launched. These options do not - * appear in the array returned by the {@link argv} property, and do not - * include the Node.js executable, the name of the script, or any options following - * the script name. These options are useful in order to spawn child processes with - * the same execution environment as the parent. - * - * ```bash - * node --icu-data-dir=./foo --require ./bar.js script.js --version - * ``` - * - * Results in `process.execArgv`: - * - * ```js - * ["--icu-data-dir=./foo", "--require", "./bar.js"] - * ``` - * - * And `process.argv`: - * - * ```js - * ['/usr/local/bin/node', 'script.js', '--version'] - * ``` - * - * Refer to `Worker constructor` for the detailed behavior of worker - * threads with this property. - * @since v0.7.7 - */ - execArgv: string[]; - /** - * The `process.execPath` property returns the absolute pathname of the executable - * that started the Node.js process. Symbolic links, if any, are resolved. - * - * ```js - * '/usr/local/bin/node' - * ``` - * @since v0.1.100 - */ - execPath: string; - /** - * The `process.abort()` method causes the Node.js process to exit immediately and - * generate a core file. - * - * This feature is not available in `Worker` threads. - * @since v0.7.0 - */ - abort(): never; - /** - * The `process.chdir()` method changes the current working directory of the - * Node.js process or throws an exception if doing so fails (for instance, if - * the specified `directory` does not exist). - * - * ```js - * import { chdir, cwd } from 'node:process'; - * - * console.log(`Starting directory: ${cwd()}`); - * try { - * chdir('/tmp'); - * console.log(`New directory: ${cwd()}`); - * } catch (err) { - * console.error(`chdir: ${err}`); - * } - * ``` - * - * This feature is not available in `Worker` threads. - * @since v0.1.17 - */ - chdir(directory: string): void; - /** - * The `process.cwd()` method returns the current working directory of the Node.js - * process. - * - * ```js - * import { cwd } from 'node:process'; - * - * console.log(`Current directory: ${cwd()}`); - * ``` - * @since v0.1.8 - */ - cwd(): string; - /** - * The port used by the Node.js debugger when enabled. - * - * ```js - * import process from 'node:process'; - * - * process.debugPort = 5858; - * ``` - * @since v0.7.2 - */ - debugPort: number; - /** - * The `process.dlopen()` method allows dynamically loading shared objects. It is primarily used by `require()` to load C++ Addons, and - * should not be used directly, except in special cases. In other words, `require()` should be preferred over `process.dlopen()` - * unless there are specific reasons such as custom dlopen flags or loading from ES modules. - * - * The `flags` argument is an integer that allows to specify dlopen behavior. See the `[os.constants.dlopen](https://nodejs.org/docs/latest-v22.x/api/os.html#dlopen-constants)` - * documentation for details. - * - * An important requirement when calling `process.dlopen()` is that the `module` instance must be passed. Functions exported by the C++ Addon - * are then accessible via `module.exports`. - * - * The example below shows how to load a C++ Addon, named `local.node`, that exports a `foo` function. All the symbols are loaded before the call returns, by passing the `RTLD_NOW` constant. - * In this example the constant is assumed to be available. - * - * ```js - * import { dlopen } from 'node:process'; - * import { constants } from 'node:os'; - * import { fileURLToPath } from 'node:url'; - * - * const module = { exports: {} }; - * dlopen(module, fileURLToPath(new URL('local.node', import.meta.url)), - * constants.dlopen.RTLD_NOW); - * module.exports.foo(); - * ``` - */ - dlopen(module: object, filename: string, flags?: number): void; - /** - * The `process.emitWarning()` method can be used to emit custom or application - * specific process warnings. These can be listened for by adding a handler to the `'warning'` event. - * - * ```js - * import { emitWarning } from 'node:process'; - * - * // Emit a warning using a string. - * emitWarning('Something happened!'); - * // Emits: (node: 56338) Warning: Something happened! - * ``` - * - * ```js - * import { emitWarning } from 'node:process'; - * - * // Emit a warning using a string and a type. - * emitWarning('Something Happened!', 'CustomWarning'); - * // Emits: (node:56338) CustomWarning: Something Happened! - * ``` - * - * ```js - * import { emitWarning } from 'node:process'; - * - * emitWarning('Something happened!', 'CustomWarning', 'WARN001'); - * // Emits: (node:56338) [WARN001] CustomWarning: Something happened! - * ```js - * - * In each of the previous examples, an `Error` object is generated internally by `process.emitWarning()` and passed through to the `'warning'` handler. - * - * ```js - * import process from 'node:process'; - * - * process.on('warning', (warning) => { - * console.warn(warning.name); // 'Warning' - * console.warn(warning.message); // 'Something happened!' - * console.warn(warning.code); // 'MY_WARNING' - * console.warn(warning.stack); // Stack trace - * console.warn(warning.detail); // 'This is some additional information' - * }); - * ``` - * - * If `warning` is passed as an `Error` object, it will be passed through to the `'warning'` event handler - * unmodified (and the optional `type`, `code` and `ctor` arguments will be ignored): - * - * ```js - * import { emitWarning } from 'node:process'; - * - * // Emit a warning using an Error object. - * const myWarning = new Error('Something happened!'); - * // Use the Error name property to specify the type name - * myWarning.name = 'CustomWarning'; - * myWarning.code = 'WARN001'; - * - * emitWarning(myWarning); - * // Emits: (node:56338) [WARN001] CustomWarning: Something happened! - * ``` - * - * A `TypeError` is thrown if `warning` is anything other than a string or `Error` object. - * - * While process warnings use `Error` objects, the process warning mechanism is not a replacement for normal error handling mechanisms. - * - * The following additional handling is implemented if the warning `type` is `'DeprecationWarning'`: - * * If the `--throw-deprecation` command-line flag is used, the deprecation warning is thrown as an exception rather than being emitted as an event. - * * If the `--no-deprecation` command-line flag is used, the deprecation warning is suppressed. - * * If the `--trace-deprecation` command-line flag is used, the deprecation warning is printed to `stderr` along with the full stack trace. - * @since v8.0.0 - * @param warning The warning to emit. - */ - emitWarning(warning: string | Error, ctor?: Function): void; - emitWarning(warning: string | Error, type?: string, ctor?: Function): void; - emitWarning(warning: string | Error, type?: string, code?: string, ctor?: Function): void; - emitWarning(warning: string | Error, options?: EmitWarningOptions): void; - /** - * The `process.env` property returns an object containing the user environment. - * See [`environ(7)`](http://man7.org/linux/man-pages/man7/environ.7.html). - * - * An example of this object looks like: - * - * ```js - * { - * TERM: 'xterm-256color', - * SHELL: '/usr/local/bin/bash', - * USER: 'maciej', - * PATH: '~/.bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin', - * PWD: '/Users/maciej', - * EDITOR: 'vim', - * SHLVL: '1', - * HOME: '/Users/maciej', - * LOGNAME: 'maciej', - * _: '/usr/local/bin/node' - * } - * ``` - * - * It is possible to modify this object, but such modifications will not be - * reflected outside the Node.js process, or (unless explicitly requested) - * to other `Worker` threads. - * In other words, the following example would not work: - * - * ```bash - * node -e 'process.env.foo = "bar"' && echo $foo - * ``` - * - * While the following will: - * - * ```js - * import { env } from 'node:process'; - * - * env.foo = 'bar'; - * console.log(env.foo); - * ``` - * - * Assigning a property on `process.env` will implicitly convert the value - * to a string. **This behavior is deprecated.** Future versions of Node.js may - * throw an error when the value is not a string, number, or boolean. - * - * ```js - * import { env } from 'node:process'; - * - * env.test = null; - * console.log(env.test); - * // => 'null' - * env.test = undefined; - * console.log(env.test); - * // => 'undefined' - * ``` - * - * Use `delete` to delete a property from `process.env`. - * - * ```js - * import { env } from 'node:process'; - * - * env.TEST = 1; - * delete env.TEST; - * console.log(env.TEST); - * // => undefined - * ``` - * - * On Windows operating systems, environment variables are case-insensitive. - * - * ```js - * import { env } from 'node:process'; - * - * env.TEST = 1; - * console.log(env.test); - * // => 1 - * ``` - * - * Unless explicitly specified when creating a `Worker` instance, - * each `Worker` thread has its own copy of `process.env`, based on its - * parent thread's `process.env`, or whatever was specified as the `env` option - * to the `Worker` constructor. Changes to `process.env` will not be visible - * across `Worker` threads, and only the main thread can make changes that - * are visible to the operating system or to native add-ons. On Windows, a copy of `process.env` on a `Worker` instance operates in a case-sensitive manner - * unlike the main thread. - * @since v0.1.27 - */ - env: ProcessEnv; - /** - * The `process.exit()` method instructs Node.js to terminate the process - * synchronously with an exit status of `code`. If `code` is omitted, exit uses - * either the 'success' code `0` or the value of `process.exitCode` if it has been - * set. Node.js will not terminate until all the `'exit'` event listeners are - * called. - * - * To exit with a 'failure' code: - * - * ```js - * import { exit } from 'node:process'; - * - * exit(1); - * ``` - * - * The shell that executed Node.js should see the exit code as `1`. - * - * Calling `process.exit()` will force the process to exit as quickly as possible - * even if there are still asynchronous operations pending that have not yet - * completed fully, including I/O operations to `process.stdout` and `process.stderr`. - * - * In most situations, it is not actually necessary to call `process.exit()` explicitly. The Node.js process will exit on its own _if there is no additional_ - * _work pending_ in the event loop. The `process.exitCode` property can be set to - * tell the process which exit code to use when the process exits gracefully. - * - * For instance, the following example illustrates a _misuse_ of the `process.exit()` method that could lead to data printed to stdout being - * truncated and lost: - * - * ```js - * import { exit } from 'node:process'; - * - * // This is an example of what *not* to do: - * if (someConditionNotMet()) { - * printUsageToStdout(); - * exit(1); - * } - * ``` - * - * The reason this is problematic is because writes to `process.stdout` in Node.js - * are sometimes _asynchronous_ and may occur over multiple ticks of the Node.js - * event loop. Calling `process.exit()`, however, forces the process to exit _before_ those additional writes to `stdout` can be performed. - * - * Rather than calling `process.exit()` directly, the code _should_ set the `process.exitCode` and allow the process to exit naturally by avoiding - * scheduling any additional work for the event loop: - * - * ```js - * import process from 'node:process'; - * - * // How to properly set the exit code while letting - * // the process exit gracefully. - * if (someConditionNotMet()) { - * printUsageToStdout(); - * process.exitCode = 1; - * } - * ``` - * - * If it is necessary to terminate the Node.js process due to an error condition, - * throwing an _uncaught_ error and allowing the process to terminate accordingly - * is safer than calling `process.exit()`. - * - * In `Worker` threads, this function stops the current thread rather - * than the current process. - * @since v0.1.13 - * @param [code=0] The exit code. For string type, only integer strings (e.g.,'1') are allowed. - */ - exit(code?: number | string | null | undefined): never; - /** - * A number which will be the process exit code, when the process either - * exits gracefully, or is exited via {@link exit} without specifying - * a code. - * - * Specifying a code to {@link exit} will override any - * previous setting of `process.exitCode`. - * @default undefined - * @since v0.11.8 - */ - exitCode?: number | string | number | undefined; - finalization: { - /** - * This function registers a callback to be called when the process emits the `exit` event if the `ref` object was not garbage collected. - * If the object `ref` was garbage collected before the `exit` event is emitted, the callback will be removed from the finalization registry, and it will not be called on process exit. - * - * Inside the callback you can release the resources allocated by the `ref` object. - * Be aware that all limitations applied to the `beforeExit` event are also applied to the callback function, - * this means that there is a possibility that the callback will not be called under special circumstances. - * - * The idea of ​​this function is to help you free up resources when the starts process exiting, but also let the object be garbage collected if it is no longer being used. - * @param ref The reference to the resource that is being tracked. - * @param callback The callback function to be called when the resource is finalized. - * @since v22.5.0 - * @experimental - */ - register(ref: T, callback: (ref: T, event: "exit") => void): void; - /** - * This function behaves exactly like the `register`, except that the callback will be called when the process emits the `beforeExit` event if `ref` object was not garbage collected. - * - * Be aware that all limitations applied to the `beforeExit` event are also applied to the callback function, this means that there is a possibility that the callback will not be called under special circumstances. - * @param ref The reference to the resource that is being tracked. - * @param callback The callback function to be called when the resource is finalized. - * @since v22.5.0 - * @experimental - */ - registerBeforeExit(ref: T, callback: (ref: T, event: "beforeExit") => void): void; - /** - * This function remove the register of the object from the finalization registry, so the callback will not be called anymore. - * @param ref The reference to the resource that was registered previously. - * @since v22.5.0 - * @experimental - */ - unregister(ref: object): void; - }; - /** - * The `process.getActiveResourcesInfo()` method returns an array of strings containing - * the types of the active resources that are currently keeping the event loop alive. - * - * ```js - * import { getActiveResourcesInfo } from 'node:process'; - * import { setTimeout } from 'node:timers'; - - * console.log('Before:', getActiveResourcesInfo()); - * setTimeout(() => {}, 1000); - * console.log('After:', getActiveResourcesInfo()); - * // Prints: - * // Before: [ 'TTYWrap', 'TTYWrap', 'TTYWrap' ] - * // After: [ 'TTYWrap', 'TTYWrap', 'TTYWrap', 'Timeout' ] - * ``` - * @since v17.3.0, v16.14.0 - */ - getActiveResourcesInfo(): string[]; - /** - * Provides a way to load built-in modules in a globally available function. - * @param id ID of the built-in module being requested. - */ - getBuiltinModule(id: ID): BuiltInModule[ID]; - getBuiltinModule(id: string): object | undefined; - /** - * The `process.getgid()` method returns the numerical group identity of the - * process. (See [`getgid(2)`](http://man7.org/linux/man-pages/man2/getgid.2.html).) - * - * ```js - * import process from 'node:process'; - * - * if (process.getgid) { - * console.log(`Current gid: ${process.getgid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v0.1.31 - */ - getgid?: () => number; - /** - * The `process.setgid()` method sets the group identity of the process. (See [`setgid(2)`](http://man7.org/linux/man-pages/man2/setgid.2.html).) The `id` can be passed as either a - * numeric ID or a group name - * string. If a group name is specified, this method blocks while resolving the - * associated numeric ID. - * - * ```js - * import process from 'node:process'; - * - * if (process.getgid && process.setgid) { - * console.log(`Current gid: ${process.getgid()}`); - * try { - * process.setgid(501); - * console.log(`New gid: ${process.getgid()}`); - * } catch (err) { - * console.log(`Failed to set gid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v0.1.31 - * @param id The group name or ID - */ - setgid?: (id: number | string) => void; - /** - * The `process.getuid()` method returns the numeric user identity of the process. - * (See [`getuid(2)`](http://man7.org/linux/man-pages/man2/getuid.2.html).) - * - * ```js - * import process from 'node:process'; - * - * if (process.getuid) { - * console.log(`Current uid: ${process.getuid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v0.1.28 - */ - getuid?: () => number; - /** - * The `process.setuid(id)` method sets the user identity of the process. (See [`setuid(2)`](http://man7.org/linux/man-pages/man2/setuid.2.html).) The `id` can be passed as either a - * numeric ID or a username string. - * If a username is specified, the method blocks while resolving the associated - * numeric ID. - * - * ```js - * import process from 'node:process'; - * - * if (process.getuid && process.setuid) { - * console.log(`Current uid: ${process.getuid()}`); - * try { - * process.setuid(501); - * console.log(`New uid: ${process.getuid()}`); - * } catch (err) { - * console.log(`Failed to set uid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v0.1.28 - */ - setuid?: (id: number | string) => void; - /** - * The `process.geteuid()` method returns the numerical effective user identity of - * the process. (See [`geteuid(2)`](http://man7.org/linux/man-pages/man2/geteuid.2.html).) - * - * ```js - * import process from 'node:process'; - * - * if (process.geteuid) { - * console.log(`Current uid: ${process.geteuid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v2.0.0 - */ - geteuid?: () => number; - /** - * The `process.seteuid()` method sets the effective user identity of the process. - * (See [`seteuid(2)`](http://man7.org/linux/man-pages/man2/seteuid.2.html).) The `id` can be passed as either a numeric ID or a username - * string. If a username is specified, the method blocks while resolving the - * associated numeric ID. - * - * ```js - * import process from 'node:process'; - * - * if (process.geteuid && process.seteuid) { - * console.log(`Current uid: ${process.geteuid()}`); - * try { - * process.seteuid(501); - * console.log(`New uid: ${process.geteuid()}`); - * } catch (err) { - * console.log(`Failed to set uid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v2.0.0 - * @param id A user name or ID - */ - seteuid?: (id: number | string) => void; - /** - * The `process.getegid()` method returns the numerical effective group identity - * of the Node.js process. (See [`getegid(2)`](http://man7.org/linux/man-pages/man2/getegid.2.html).) - * - * ```js - * import process from 'node:process'; - * - * if (process.getegid) { - * console.log(`Current gid: ${process.getegid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v2.0.0 - */ - getegid?: () => number; - /** - * The `process.setegid()` method sets the effective group identity of the process. - * (See [`setegid(2)`](http://man7.org/linux/man-pages/man2/setegid.2.html).) The `id` can be passed as either a numeric ID or a group - * name string. If a group name is specified, this method blocks while resolving - * the associated a numeric ID. - * - * ```js - * import process from 'node:process'; - * - * if (process.getegid && process.setegid) { - * console.log(`Current gid: ${process.getegid()}`); - * try { - * process.setegid(501); - * console.log(`New gid: ${process.getegid()}`); - * } catch (err) { - * console.log(`Failed to set gid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v2.0.0 - * @param id A group name or ID - */ - setegid?: (id: number | string) => void; - /** - * The `process.getgroups()` method returns an array with the supplementary group - * IDs. POSIX leaves it unspecified if the effective group ID is included but - * Node.js ensures it always is. - * - * ```js - * import process from 'node:process'; - * - * if (process.getgroups) { - * console.log(process.getgroups()); // [ 16, 21, 297 ] - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v0.9.4 - */ - getgroups?: () => number[]; - /** - * The `process.setgroups()` method sets the supplementary group IDs for the - * Node.js process. This is a privileged operation that requires the Node.js - * process to have `root` or the `CAP_SETGID` capability. - * - * The `groups` array can contain numeric group IDs, group names, or both. - * - * ```js - * import process from 'node:process'; - * - * if (process.getgroups && process.setgroups) { - * try { - * process.setgroups([501]); - * console.log(process.getgroups()); // new groups - * } catch (err) { - * console.log(`Failed to set groups: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v0.9.4 - */ - setgroups?: (groups: ReadonlyArray) => void; - /** - * The `process.setUncaughtExceptionCaptureCallback()` function sets a function - * that will be invoked when an uncaught exception occurs, which will receive the - * exception value itself as its first argument. - * - * If such a function is set, the `'uncaughtException'` event will - * not be emitted. If `--abort-on-uncaught-exception` was passed from the - * command line or set through `v8.setFlagsFromString()`, the process will - * not abort. Actions configured to take place on exceptions such as report - * generations will be affected too - * - * To unset the capture function, `process.setUncaughtExceptionCaptureCallback(null)` may be used. Calling this - * method with a non-`null` argument while another capture function is set will - * throw an error. - * - * Using this function is mutually exclusive with using the deprecated `domain` built-in module. - * @since v9.3.0 - */ - setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void; - /** - * Indicates whether a callback has been set using {@link setUncaughtExceptionCaptureCallback}. - * @since v9.3.0 - */ - hasUncaughtExceptionCaptureCallback(): boolean; - /** - * The `process.sourceMapsEnabled` property returns whether the [Source Map v3](https://sourcemaps.info/spec.html) support for stack traces is enabled. - * @since v20.7.0 - * @experimental - */ - readonly sourceMapsEnabled: boolean; - /** - * This function enables or disables the [Source Map v3](https://sourcemaps.info/spec.html) support for - * stack traces. - * - * It provides same features as launching Node.js process with commandline options `--enable-source-maps`. - * - * Only source maps in JavaScript files that are loaded after source maps has been - * enabled will be parsed and loaded. - * @since v16.6.0, v14.18.0 - * @experimental - */ - setSourceMapsEnabled(value: boolean): void; - /** - * The `process.version` property contains the Node.js version string. - * - * ```js - * import { version } from 'node:process'; - * - * console.log(`Version: ${version}`); - * // Version: v14.8.0 - * ``` - * - * To get the version string without the prepended _v_, use`process.versions.node`. - * @since v0.1.3 - */ - readonly version: string; - /** - * The `process.versions` property returns an object listing the version strings of - * Node.js and its dependencies. `process.versions.modules` indicates the current - * ABI version, which is increased whenever a C++ API changes. Node.js will refuse - * to load modules that were compiled against a different module ABI version. - * - * ```js - * import { versions } from 'node:process'; - * - * console.log(versions); - * ``` - * - * Will generate an object similar to: - * - * ```console - * { node: '20.2.0', - * acorn: '8.8.2', - * ada: '2.4.0', - * ares: '1.19.0', - * base64: '0.5.0', - * brotli: '1.0.9', - * cjs_module_lexer: '1.2.2', - * cldr: '43.0', - * icu: '73.1', - * llhttp: '8.1.0', - * modules: '115', - * napi: '8', - * nghttp2: '1.52.0', - * nghttp3: '0.7.0', - * ngtcp2: '0.8.1', - * openssl: '3.0.8+quic', - * simdutf: '3.2.9', - * tz: '2023c', - * undici: '5.22.0', - * unicode: '15.0', - * uv: '1.44.2', - * uvwasi: '0.0.16', - * v8: '11.3.244.8-node.9', - * zlib: '1.2.13' } - * ``` - * @since v0.2.0 - */ - readonly versions: ProcessVersions; - /** - * The `process.config` property returns a frozen `Object` containing the - * JavaScript representation of the configure options used to compile the current - * Node.js executable. This is the same as the `config.gypi` file that was produced - * when running the `./configure` script. - * - * An example of the possible output looks like: - * - * ```js - * { - * target_defaults: - * { cflags: [], - * default_configuration: 'Release', - * defines: [], - * include_dirs: [], - * libraries: [] }, - * variables: - * { - * host_arch: 'x64', - * napi_build_version: 5, - * node_install_npm: 'true', - * node_prefix: '', - * node_shared_cares: 'false', - * node_shared_http_parser: 'false', - * node_shared_libuv: 'false', - * node_shared_zlib: 'false', - * node_use_openssl: 'true', - * node_shared_openssl: 'false', - * strict_aliasing: 'true', - * target_arch: 'x64', - * v8_use_snapshot: 1 - * } - * } - * ``` - * @since v0.7.7 - */ - readonly config: ProcessConfig; - /** - * The `process.kill()` method sends the `signal` to the process identified by`pid`. - * - * Signal names are strings such as `'SIGINT'` or `'SIGHUP'`. See `Signal Events` and [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for more information. - * - * This method will throw an error if the target `pid` does not exist. As a special - * case, a signal of `0` can be used to test for the existence of a process. - * Windows platforms will throw an error if the `pid` is used to kill a process - * group. - * - * Even though the name of this function is `process.kill()`, it is really just a - * signal sender, like the `kill` system call. The signal sent may do something - * other than kill the target process. - * - * ```js - * import process, { kill } from 'node:process'; - * - * process.on('SIGHUP', () => { - * console.log('Got SIGHUP signal.'); - * }); - * - * setTimeout(() => { - * console.log('Exiting.'); - * process.exit(0); - * }, 100); - * - * kill(process.pid, 'SIGHUP'); - * ``` - * - * When `SIGUSR1` is received by a Node.js process, Node.js will start the - * debugger. See `Signal Events`. - * @since v0.0.6 - * @param pid A process ID - * @param [signal='SIGTERM'] The signal to send, either as a string or number. - */ - kill(pid: number, signal?: string | number): true; - /** - * Loads the environment configuration from a `.env` file into `process.env`. If - * the file is not found, error will be thrown. - * - * To load a specific .env file by specifying its path, use the following code: - * - * ```js - * import { loadEnvFile } from 'node:process'; - * - * loadEnvFile('./development.env') - * ``` - * @since v20.12.0 - * @param path The path to the .env file - */ - loadEnvFile(path?: string | URL | Buffer): void; - /** - * The `process.pid` property returns the PID of the process. - * - * ```js - * import { pid } from 'node:process'; - * - * console.log(`This process is pid ${pid}`); - * ``` - * @since v0.1.15 - */ - readonly pid: number; - /** - * The `process.ppid` property returns the PID of the parent of the - * current process. - * - * ```js - * import { ppid } from 'node:process'; - * - * console.log(`The parent process is pid ${ppid}`); - * ``` - * @since v9.2.0, v8.10.0, v6.13.0 - */ - readonly ppid: number; - /** - * The `process.title` property returns the current process title (i.e. returns - * the current value of `ps`). Assigning a new value to `process.title` modifies - * the current value of `ps`. - * - * When a new value is assigned, different platforms will impose different maximum - * length restrictions on the title. Usually such restrictions are quite limited. - * For instance, on Linux and macOS, `process.title` is limited to the size of the - * binary name plus the length of the command-line arguments because setting the `process.title` overwrites the `argv` memory of the process. Node.js v0.8 - * allowed for longer process title strings by also overwriting the `environ` memory but that was potentially insecure and confusing in some (rather obscure) - * cases. - * - * Assigning a value to `process.title` might not result in an accurate label - * within process manager applications such as macOS Activity Monitor or Windows - * Services Manager. - * @since v0.1.104 - */ - title: string; - /** - * The operating system CPU architecture for which the Node.js binary was compiled. - * Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'loong64'`, `'mips'`, `'mipsel'`, `'ppc'`, `'ppc64'`, `'riscv64'`, `'s390'`, `'s390x'`, and `'x64'`. - * - * ```js - * import { arch } from 'node:process'; - * - * console.log(`This processor architecture is ${arch}`); - * ``` - * @since v0.5.0 - */ - readonly arch: Architecture; - /** - * The `process.platform` property returns a string identifying the operating - * system platform for which the Node.js binary was compiled. - * - * Currently possible values are: - * - * * `'aix'` - * * `'darwin'` - * * `'freebsd'` - * * `'linux'` - * * `'openbsd'` - * * `'sunos'` - * * `'win32'` - * - * ```js - * import { platform } from 'node:process'; - * - * console.log(`This platform is ${platform}`); - * ``` - * - * The value `'android'` may also be returned if the Node.js is built on the - * Android operating system. However, Android support in Node.js [is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os). - * @since v0.1.16 - */ - readonly platform: Platform; - /** - * The `process.mainModule` property provides an alternative way of retrieving `require.main`. The difference is that if the main module changes at - * runtime, `require.main` may still refer to the original main module in - * modules that were required before the change occurred. Generally, it's - * safe to assume that the two refer to the same module. - * - * As with `require.main`, `process.mainModule` will be `undefined` if there - * is no entry script. - * @since v0.1.17 - * @deprecated Since v14.0.0 - Use `main` instead. - */ - mainModule?: Module | undefined; - memoryUsage: MemoryUsageFn; - /** - * Gets the amount of memory available to the process (in bytes) based on - * limits imposed by the OS. If there is no such constraint, or the constraint - * is unknown, `0` is returned. - * - * See [`uv_get_constrained_memory`](https://docs.libuv.org/en/v1.x/misc.html#c.uv_get_constrained_memory) for more - * information. - * @since v19.6.0, v18.15.0 - * @experimental - */ - constrainedMemory(): number; - /** - * Gets the amount of free memory that is still available to the process (in bytes). - * See [`uv_get_available_memory`](https://nodejs.org/docs/latest-v22.x/api/process.html#processavailablememory) for more information. - * @experimental - * @since v20.13.0 - */ - availableMemory(): number; - /** - * The `process.cpuUsage()` method returns the user and system CPU time usage of - * the current process, in an object with properties `user` and `system`, whose - * values are microsecond values (millionth of a second). These values measure time - * spent in user and system code respectively, and may end up being greater than - * actual elapsed time if multiple CPU cores are performing work for this process. - * - * The result of a previous call to `process.cpuUsage()` can be passed as the - * argument to the function, to get a diff reading. - * - * ```js - * import { cpuUsage } from 'node:process'; - * - * const startUsage = cpuUsage(); - * // { user: 38579, system: 6986 } - * - * // spin the CPU for 500 milliseconds - * const now = Date.now(); - * while (Date.now() - now < 500); - * - * console.log(cpuUsage(startUsage)); - * // { user: 514883, system: 11226 } - * ``` - * @since v6.1.0 - * @param previousValue A previous return value from calling `process.cpuUsage()` - */ - cpuUsage(previousValue?: CpuUsage): CpuUsage; - /** - * `process.nextTick()` adds `callback` to the "next tick queue". This queue is - * fully drained after the current operation on the JavaScript stack runs to - * completion and before the event loop is allowed to continue. It's possible to - * create an infinite loop if one were to recursively call `process.nextTick()`. - * See the [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#process-nexttick) guide for more background. - * - * ```js - * import { nextTick } from 'node:process'; - * - * console.log('start'); - * nextTick(() => { - * console.log('nextTick callback'); - * }); - * console.log('scheduled'); - * // Output: - * // start - * // scheduled - * // nextTick callback - * ``` - * - * This is important when developing APIs in order to give users the opportunity - * to assign event handlers _after_ an object has been constructed but before any - * I/O has occurred: - * - * ```js - * import { nextTick } from 'node:process'; - * - * function MyThing(options) { - * this.setupOptions(options); - * - * nextTick(() => { - * this.startDoingStuff(); - * }); - * } - * - * const thing = new MyThing(); - * thing.getReadyForStuff(); - * - * // thing.startDoingStuff() gets called now, not before. - * ``` - * - * It is very important for APIs to be either 100% synchronous or 100% - * asynchronous. Consider this example: - * - * ```js - * // WARNING! DO NOT USE! BAD UNSAFE HAZARD! - * function maybeSync(arg, cb) { - * if (arg) { - * cb(); - * return; - * } - * - * fs.stat('file', cb); - * } - * ``` - * - * This API is hazardous because in the following case: - * - * ```js - * const maybeTrue = Math.random() > 0.5; - * - * maybeSync(maybeTrue, () => { - * foo(); - * }); - * - * bar(); - * ``` - * - * It is not clear whether `foo()` or `bar()` will be called first. - * - * The following approach is much better: - * - * ```js - * import { nextTick } from 'node:process'; - * - * function definitelyAsync(arg, cb) { - * if (arg) { - * nextTick(cb); - * return; - * } - * - * fs.stat('file', cb); - * } - * ``` - * @since v0.1.26 - * @param args Additional arguments to pass when invoking the `callback` - */ - nextTick(callback: Function, ...args: any[]): void; - /** - * This API is available through the [--experimental-permission](https://nodejs.org/api/cli.html#--experimental-permission) flag. - * - * `process.permission` is an object whose methods are used to manage permissions for the current process. - * Additional documentation is available in the [Permission Model](https://nodejs.org/api/permissions.html#permission-model). - * @since v20.0.0 - */ - permission: ProcessPermission; - /** - * The `process.release` property returns an `Object` containing metadata related - * to the current release, including URLs for the source tarball and headers-only - * tarball. - * - * `process.release` contains the following properties: - * - * ```js - * { - * name: 'node', - * lts: 'Hydrogen', - * sourceUrl: 'https://nodejs.org/download/release/v18.12.0/node-v18.12.0.tar.gz', - * headersUrl: 'https://nodejs.org/download/release/v18.12.0/node-v18.12.0-headers.tar.gz', - * libUrl: 'https://nodejs.org/download/release/v18.12.0/win-x64/node.lib' - * } - * ``` - * - * In custom builds from non-release versions of the source tree, only the `name` property may be present. The additional properties should not be - * relied upon to exist. - * @since v3.0.0 - */ - readonly release: ProcessRelease; - features: { - inspector: boolean; - debug: boolean; - uv: boolean; - ipv6: boolean; - tls_alpn: boolean; - tls_sni: boolean; - tls_ocsp: boolean; - tls: boolean; - }; - /** - * `process.umask()` returns the Node.js process's file mode creation mask. Child - * processes inherit the mask from the parent process. - * @since v0.1.19 - * @deprecated Calling `process.umask()` with no argument causes the process-wide umask to be written twice. This introduces a race condition between threads, and is a potential - * security vulnerability. There is no safe, cross-platform alternative API. - */ - umask(): number; - /** - * Can only be set if not in worker thread. - */ - umask(mask: string | number): number; - /** - * The `process.uptime()` method returns the number of seconds the current Node.js - * process has been running. - * - * The return value includes fractions of a second. Use `Math.floor()` to get whole - * seconds. - * @since v0.5.0 - */ - uptime(): number; - hrtime: HRTime; - /** - * If the Node.js process was spawned with an IPC channel, the process.channel property is a reference to the IPC channel. - * If no IPC channel exists, this property is undefined. - * @since v7.1.0 - */ - channel?: { - /** - * This method makes the IPC channel keep the event loop of the process running if .unref() has been called before. - * @since v7.1.0 - */ - ref(): void; - /** - * This method makes the IPC channel not keep the event loop of the process running, and lets it finish even while the channel is open. - * @since v7.1.0 - */ - unref(): void; - }; - /** - * If Node.js is spawned with an IPC channel, the `process.send()` method can be - * used to send messages to the parent process. Messages will be received as a `'message'` event on the parent's `ChildProcess` object. - * - * If Node.js was not spawned with an IPC channel, `process.send` will be `undefined`. - * - * The message goes through serialization and parsing. The resulting message might - * not be the same as what is originally sent. - * @since v0.5.9 - * @param options used to parameterize the sending of certain types of handles. `options` supports the following properties: - */ - send?( - message: any, - sendHandle?: any, - options?: { - keepOpen?: boolean | undefined; - }, - callback?: (error: Error | null) => void, - ): boolean; - /** - * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.disconnect()` method will close the - * IPC channel to the parent process, allowing the child process to exit gracefully - * once there are no other connections keeping it alive. - * - * The effect of calling `process.disconnect()` is the same as calling `ChildProcess.disconnect()` from the parent process. - * - * If the Node.js process was not spawned with an IPC channel, `process.disconnect()` will be `undefined`. - * @since v0.7.2 - */ - disconnect(): void; - /** - * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.connected` property will return `true` so long as the IPC - * channel is connected and will return `false` after `process.disconnect()` is called. - * - * Once `process.connected` is `false`, it is no longer possible to send messages - * over the IPC channel using `process.send()`. - * @since v0.7.2 - */ - connected: boolean; - /** - * The `process.allowedNodeEnvironmentFlags` property is a special, - * read-only `Set` of flags allowable within the `NODE_OPTIONS` environment variable. - * - * `process.allowedNodeEnvironmentFlags` extends `Set`, but overrides `Set.prototype.has` to recognize several different possible flag - * representations. `process.allowedNodeEnvironmentFlags.has()` will - * return `true` in the following cases: - * - * * Flags may omit leading single (`-`) or double (`--`) dashes; e.g., `inspect-brk` for `--inspect-brk`, or `r` for `-r`. - * * Flags passed through to V8 (as listed in `--v8-options`) may replace - * one or more _non-leading_ dashes for an underscore, or vice-versa; - * e.g., `--perf_basic_prof`, `--perf-basic-prof`, `--perf_basic-prof`, - * etc. - * * Flags may contain one or more equals (`=`) characters; all - * characters after and including the first equals will be ignored; - * e.g., `--stack-trace-limit=100`. - * * Flags _must_ be allowable within `NODE_OPTIONS`. - * - * When iterating over `process.allowedNodeEnvironmentFlags`, flags will - * appear only _once_; each will begin with one or more dashes. Flags - * passed through to V8 will contain underscores instead of non-leading - * dashes: - * - * ```js - * import { allowedNodeEnvironmentFlags } from 'node:process'; - * - * allowedNodeEnvironmentFlags.forEach((flag) => { - * // -r - * // --inspect-brk - * // --abort_on_uncaught_exception - * // ... - * }); - * ``` - * - * The methods `add()`, `clear()`, and `delete()` of`process.allowedNodeEnvironmentFlags` do nothing, and will fail - * silently. - * - * If Node.js was compiled _without_ `NODE_OPTIONS` support (shown in {@link config}), `process.allowedNodeEnvironmentFlags` will - * contain what _would have_ been allowable. - * @since v10.10.0 - */ - allowedNodeEnvironmentFlags: ReadonlySet; - /** - * `process.report` is an object whose methods are used to generate diagnostic reports for the current process. - * Additional documentation is available in the [report documentation](https://nodejs.org/docs/latest-v22.x/api/report.html). - * @since v11.8.0 - */ - report: ProcessReport; - /** - * ```js - * import { resourceUsage } from 'node:process'; - * - * console.log(resourceUsage()); - * /* - * Will output: - * { - * userCPUTime: 82872, - * systemCPUTime: 4143, - * maxRSS: 33164, - * sharedMemorySize: 0, - * unsharedDataSize: 0, - * unsharedStackSize: 0, - * minorPageFault: 2469, - * majorPageFault: 0, - * swappedOut: 0, - * fsRead: 0, - * fsWrite: 8, - * ipcSent: 0, - * ipcReceived: 0, - * signalsCount: 0, - * voluntaryContextSwitches: 79, - * involuntaryContextSwitches: 1 - * } - * - * ``` - * @since v12.6.0 - * @return the resource usage for the current process. All of these values come from the `uv_getrusage` call which returns a [`uv_rusage_t` struct][uv_rusage_t]. - */ - resourceUsage(): ResourceUsage; - /** - * The initial value of `process.throwDeprecation` indicates whether the `--throw-deprecation` flag is set on the current Node.js process. `process.throwDeprecation` - * is mutable, so whether or not deprecation warnings result in errors may be altered at runtime. See the documentation for the 'warning' event and the emitWarning() - * method for more information. - * - * ```bash - * $ node --throw-deprecation -p "process.throwDeprecation" - * true - * $ node -p "process.throwDeprecation" - * undefined - * $ node - * > process.emitWarning('test', 'DeprecationWarning'); - * undefined - * > (node:26598) DeprecationWarning: test - * > process.throwDeprecation = true; - * true - * > process.emitWarning('test', 'DeprecationWarning'); - * Thrown: - * [DeprecationWarning: test] { name: 'DeprecationWarning' } - * ``` - * @since v0.9.12 - */ - throwDeprecation: boolean; - /** - * The `process.traceDeprecation` property indicates whether the `--trace-deprecation` flag is set on the current Node.js process. See the - * documentation for the `'warning' event` and the `emitWarning() method` for more information about this - * flag's behavior. - * @since v0.8.0 - */ - traceDeprecation: boolean; - /* EventEmitter */ - addListener(event: "beforeExit", listener: BeforeExitListener): this; - addListener(event: "disconnect", listener: DisconnectListener): this; - addListener(event: "exit", listener: ExitListener): this; - addListener(event: "rejectionHandled", listener: RejectionHandledListener): this; - addListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; - addListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - addListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - addListener(event: "warning", listener: WarningListener): this; - addListener(event: "message", listener: MessageListener): this; - addListener(event: Signals, listener: SignalsListener): this; - addListener(event: "multipleResolves", listener: MultipleResolveListener): this; - addListener(event: "worker", listener: WorkerListener): this; - emit(event: "beforeExit", code: number): boolean; - emit(event: "disconnect"): boolean; - emit(event: "exit", code: number): boolean; - emit(event: "rejectionHandled", promise: Promise): boolean; - emit(event: "uncaughtException", error: Error): boolean; - emit(event: "uncaughtExceptionMonitor", error: Error): boolean; - emit(event: "unhandledRejection", reason: unknown, promise: Promise): boolean; - emit(event: "warning", warning: Error): boolean; - emit(event: "message", message: unknown, sendHandle: unknown): this; - emit(event: Signals, signal?: Signals): boolean; - emit( - event: "multipleResolves", - type: MultipleResolveType, - promise: Promise, - value: unknown, - ): this; - emit(event: "worker", listener: WorkerListener): this; - on(event: "beforeExit", listener: BeforeExitListener): this; - on(event: "disconnect", listener: DisconnectListener): this; - on(event: "exit", listener: ExitListener): this; - on(event: "rejectionHandled", listener: RejectionHandledListener): this; - on(event: "uncaughtException", listener: UncaughtExceptionListener): this; - on(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - on(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - on(event: "warning", listener: WarningListener): this; - on(event: "message", listener: MessageListener): this; - on(event: Signals, listener: SignalsListener): this; - on(event: "multipleResolves", listener: MultipleResolveListener): this; - on(event: "worker", listener: WorkerListener): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "beforeExit", listener: BeforeExitListener): this; - once(event: "disconnect", listener: DisconnectListener): this; - once(event: "exit", listener: ExitListener): this; - once(event: "rejectionHandled", listener: RejectionHandledListener): this; - once(event: "uncaughtException", listener: UncaughtExceptionListener): this; - once(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - once(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - once(event: "warning", listener: WarningListener): this; - once(event: "message", listener: MessageListener): this; - once(event: Signals, listener: SignalsListener): this; - once(event: "multipleResolves", listener: MultipleResolveListener): this; - once(event: "worker", listener: WorkerListener): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "beforeExit", listener: BeforeExitListener): this; - prependListener(event: "disconnect", listener: DisconnectListener): this; - prependListener(event: "exit", listener: ExitListener): this; - prependListener(event: "rejectionHandled", listener: RejectionHandledListener): this; - prependListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; - prependListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - prependListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - prependListener(event: "warning", listener: WarningListener): this; - prependListener(event: "message", listener: MessageListener): this; - prependListener(event: Signals, listener: SignalsListener): this; - prependListener(event: "multipleResolves", listener: MultipleResolveListener): this; - prependListener(event: "worker", listener: WorkerListener): this; - prependOnceListener(event: "beforeExit", listener: BeforeExitListener): this; - prependOnceListener(event: "disconnect", listener: DisconnectListener): this; - prependOnceListener(event: "exit", listener: ExitListener): this; - prependOnceListener(event: "rejectionHandled", listener: RejectionHandledListener): this; - prependOnceListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; - prependOnceListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - prependOnceListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - prependOnceListener(event: "warning", listener: WarningListener): this; - prependOnceListener(event: "message", listener: MessageListener): this; - prependOnceListener(event: Signals, listener: SignalsListener): this; - prependOnceListener(event: "multipleResolves", listener: MultipleResolveListener): this; - prependOnceListener(event: "worker", listener: WorkerListener): this; - listeners(event: "beforeExit"): BeforeExitListener[]; - listeners(event: "disconnect"): DisconnectListener[]; - listeners(event: "exit"): ExitListener[]; - listeners(event: "rejectionHandled"): RejectionHandledListener[]; - listeners(event: "uncaughtException"): UncaughtExceptionListener[]; - listeners(event: "uncaughtExceptionMonitor"): UncaughtExceptionListener[]; - listeners(event: "unhandledRejection"): UnhandledRejectionListener[]; - listeners(event: "warning"): WarningListener[]; - listeners(event: "message"): MessageListener[]; - listeners(event: Signals): SignalsListener[]; - listeners(event: "multipleResolves"): MultipleResolveListener[]; - listeners(event: "worker"): WorkerListener[]; - } - } - } - export = process; -} -declare module "node:process" { - import process = require("process"); - export = process; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/punycode.d.ts b/tools/mnemonic-test/node_modules/@types/node/punycode.d.ts deleted file mode 100644 index 655c47b6..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/punycode.d.ts +++ /dev/null @@ -1,117 +0,0 @@ -/** - * **The version of the punycode module bundled in Node.js is being deprecated. **In a future major version of Node.js this module will be removed. Users - * currently depending on the `punycode` module should switch to using the - * userland-provided [Punycode.js](https://github.com/bestiejs/punycode.js) module instead. For punycode-based URL - * encoding, see `url.domainToASCII` or, more generally, the `WHATWG URL API`. - * - * The `punycode` module is a bundled version of the [Punycode.js](https://github.com/bestiejs/punycode.js) module. It - * can be accessed using: - * - * ```js - * import punycode from 'node:punycode'; - * ``` - * - * [Punycode](https://tools.ietf.org/html/rfc3492) is a character encoding scheme defined by RFC 3492 that is - * primarily intended for use in Internationalized Domain Names. Because host - * names in URLs are limited to ASCII characters only, Domain Names that contain - * non-ASCII characters must be converted into ASCII using the Punycode scheme. - * For instance, the Japanese character that translates into the English word, `'example'` is `'例'`. The Internationalized Domain Name, `'例.com'` (equivalent - * to `'example.com'`) is represented by Punycode as the ASCII string `'xn--fsq.com'`. - * - * The `punycode` module provides a simple implementation of the Punycode standard. - * - * The `punycode` module is a third-party dependency used by Node.js and - * made available to developers as a convenience. Fixes or other modifications to - * the module must be directed to the [Punycode.js](https://github.com/bestiejs/punycode.js) project. - * @deprecated Since v7.0.0 - Deprecated - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/punycode.js) - */ -declare module "punycode" { - /** - * The `punycode.decode()` method converts a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only - * characters to the equivalent string of Unicode codepoints. - * - * ```js - * punycode.decode('maana-pta'); // 'mañana' - * punycode.decode('--dqo34k'); // '☃-⌘' - * ``` - * @since v0.5.1 - */ - function decode(string: string): string; - /** - * The `punycode.encode()` method converts a string of Unicode codepoints to a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only characters. - * - * ```js - * punycode.encode('mañana'); // 'maana-pta' - * punycode.encode('☃-⌘'); // '--dqo34k' - * ``` - * @since v0.5.1 - */ - function encode(string: string): string; - /** - * The `punycode.toUnicode()` method converts a string representing a domain name - * containing [Punycode](https://tools.ietf.org/html/rfc3492) encoded characters into Unicode. Only the [Punycode](https://tools.ietf.org/html/rfc3492) encoded parts of the domain name are be - * converted. - * - * ```js - * // decode domain names - * punycode.toUnicode('xn--maana-pta.com'); // 'mañana.com' - * punycode.toUnicode('xn----dqo34k.com'); // '☃-⌘.com' - * punycode.toUnicode('example.com'); // 'example.com' - * ``` - * @since v0.6.1 - */ - function toUnicode(domain: string): string; - /** - * The `punycode.toASCII()` method converts a Unicode string representing an - * Internationalized Domain Name to [Punycode](https://tools.ietf.org/html/rfc3492). Only the non-ASCII parts of the - * domain name will be converted. Calling `punycode.toASCII()` on a string that - * already only contains ASCII characters will have no effect. - * - * ```js - * // encode domain names - * punycode.toASCII('mañana.com'); // 'xn--maana-pta.com' - * punycode.toASCII('☃-⌘.com'); // 'xn----dqo34k.com' - * punycode.toASCII('example.com'); // 'example.com' - * ``` - * @since v0.6.1 - */ - function toASCII(domain: string): string; - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - const ucs2: ucs2; - interface ucs2 { - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - decode(string: string): number[]; - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - encode(codePoints: readonly number[]): string; - } - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - const version: string; -} -declare module "node:punycode" { - export * from "punycode"; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/querystring.d.ts b/tools/mnemonic-test/node_modules/@types/node/querystring.d.ts deleted file mode 100644 index 4d6dac18..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/querystring.d.ts +++ /dev/null @@ -1,153 +0,0 @@ -/** - * The `node:querystring` module provides utilities for parsing and formatting URL - * query strings. It can be accessed using: - * - * ```js - * import querystring from 'node:querystring'; - * ``` - * - * `querystring` is more performant than `URLSearchParams` but is not a - * standardized API. Use `URLSearchParams` when performance is not critical or - * when compatibility with browser code is desirable. - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/querystring.js) - */ -declare module "querystring" { - interface StringifyOptions { - /** - * The function to use when converting URL-unsafe characters to percent-encoding in the query string. - * @default `querystring.escape()` - */ - encodeURIComponent?: ((str: string) => string) | undefined; - } - interface ParseOptions { - /** - * Specifies the maximum number of keys to parse. Specify `0` to remove key counting limitations. - * @default 1000 - */ - maxKeys?: number | undefined; - /** - * The function to use when decoding percent-encoded characters in the query string. - * @default `querystring.unescape()` - */ - decodeURIComponent?: ((str: string) => string) | undefined; - } - interface ParsedUrlQuery extends NodeJS.Dict {} - interface ParsedUrlQueryInput extends - NodeJS.Dict< - | string - | number - | boolean - | readonly string[] - | readonly number[] - | readonly boolean[] - | null - > - {} - /** - * The `querystring.stringify()` method produces a URL query string from a - * given `obj` by iterating through the object's "own properties". - * - * It serializes the following types of values passed in `obj`: [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | - * [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) | - * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) | - * [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) | - * [string\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | - * [number\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) | - * [bigint\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) | - * [boolean\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) The numeric values must be finite. Any other input values will be coerced to - * empty strings. - * - * ```js - * querystring.stringify({ foo: 'bar', baz: ['qux', 'quux'], corge: '' }); - * // Returns 'foo=bar&baz=qux&baz=quux&corge=' - * - * querystring.stringify({ foo: 'bar', baz: 'qux' }, ';', ':'); - * // Returns 'foo:bar;baz:qux' - * ``` - * - * By default, characters requiring percent-encoding within the query string will - * be encoded as UTF-8\. If an alternative encoding is required, then an alternative `encodeURIComponent` option will need to be specified: - * - * ```js - * // Assuming gbkEncodeURIComponent function already exists, - * - * querystring.stringify({ w: '中文', foo: 'bar' }, null, null, - * { encodeURIComponent: gbkEncodeURIComponent }); - * ``` - * @since v0.1.25 - * @param obj The object to serialize into a URL query string - * @param [sep='&'] The substring used to delimit key and value pairs in the query string. - * @param [eq='='] . The substring used to delimit keys and values in the query string. - */ - function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string; - /** - * The `querystring.parse()` method parses a URL query string (`str`) into a - * collection of key and value pairs. - * - * For example, the query string `'foo=bar&abc=xyz&abc=123'` is parsed into: - * - * ```json - * { - * "foo": "bar", - * "abc": ["xyz", "123"] - * } - * ``` - * - * The object returned by the `querystring.parse()` method _does not_ prototypically inherit from the JavaScript `Object`. This means that typical `Object` methods such as `obj.toString()`, - * `obj.hasOwnProperty()`, and others - * are not defined and _will not work_. - * - * By default, percent-encoded characters within the query string will be assumed - * to use UTF-8 encoding. If an alternative character encoding is used, then an - * alternative `decodeURIComponent` option will need to be specified: - * - * ```js - * // Assuming gbkDecodeURIComponent function already exists... - * - * querystring.parse('w=%D6%D0%CE%C4&foo=bar', null, null, - * { decodeURIComponent: gbkDecodeURIComponent }); - * ``` - * @since v0.1.25 - * @param str The URL query string to parse - * @param [sep='&'] The substring used to delimit key and value pairs in the query string. - * @param [eq='='] The substring used to delimit keys and values in the query string. - */ - function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery; - /** - * The querystring.encode() function is an alias for querystring.stringify(). - */ - const encode: typeof stringify; - /** - * The querystring.decode() function is an alias for querystring.parse(). - */ - const decode: typeof parse; - /** - * The `querystring.escape()` method performs URL percent-encoding on the given `str` in a manner that is optimized for the specific requirements of URL - * query strings. - * - * The `querystring.escape()` method is used by `querystring.stringify()` and is - * generally not expected to be used directly. It is exported primarily to allow - * application code to provide a replacement percent-encoding implementation if - * necessary by assigning `querystring.escape` to an alternative function. - * @since v0.1.25 - */ - function escape(str: string): string; - /** - * The `querystring.unescape()` method performs decoding of URL percent-encoded - * characters on the given `str`. - * - * The `querystring.unescape()` method is used by `querystring.parse()` and is - * generally not expected to be used directly. It is exported primarily to allow - * application code to provide a replacement decoding implementation if - * necessary by assigning `querystring.unescape` to an alternative function. - * - * By default, the `querystring.unescape()` method will attempt to use the - * JavaScript built-in `decodeURIComponent()` method to decode. If that fails, - * a safer equivalent that does not throw on malformed URLs will be used. - * @since v0.1.25 - */ - function unescape(str: string): string; -} -declare module "node:querystring" { - export * from "querystring"; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/readline.d.ts b/tools/mnemonic-test/node_modules/@types/node/readline.d.ts deleted file mode 100644 index 02ce4d64..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/readline.d.ts +++ /dev/null @@ -1,540 +0,0 @@ -/** - * The `node:readline` module provides an interface for reading data from a [Readable](https://nodejs.org/docs/latest-v22.x/api/stream.html#readable-streams) stream - * (such as [`process.stdin`](https://nodejs.org/docs/latest-v22.x/api/process.html#processstdin)) one line at a time. - * - * To use the promise-based APIs: - * - * ```js - * import * as readline from 'node:readline/promises'; - * ``` - * - * To use the callback and sync APIs: - * - * ```js - * import * as readline from 'node:readline'; - * ``` - * - * The following simple example illustrates the basic use of the `node:readline` module. - * - * ```js - * import * as readline from 'node:readline/promises'; - * import { stdin as input, stdout as output } from 'node:process'; - * - * const rl = readline.createInterface({ input, output }); - * - * const answer = await rl.question('What do you think of Node.js? '); - * - * console.log(`Thank you for your valuable feedback: ${answer}`); - * - * rl.close(); - * ``` - * - * Once this code is invoked, the Node.js application will not terminate until the `readline.Interface` is closed because the interface waits for data to be - * received on the `input` stream. - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/readline.js) - */ -declare module "readline" { - import { Abortable, EventEmitter } from "node:events"; - import * as promises from "node:readline/promises"; - export { promises }; - export interface Key { - sequence?: string | undefined; - name?: string | undefined; - ctrl?: boolean | undefined; - meta?: boolean | undefined; - shift?: boolean | undefined; - } - /** - * Instances of the `readline.Interface` class are constructed using the `readline.createInterface()` method. Every instance is associated with a - * single `input` [Readable](https://nodejs.org/docs/latest-v22.x/api/stream.html#readable-streams) stream and a single `output` [Writable](https://nodejs.org/docs/latest-v22.x/api/stream.html#writable-streams) stream. - * The `output` stream is used to print prompts for user input that arrives on, - * and is read from, the `input` stream. - * @since v0.1.104 - */ - export class Interface extends EventEmitter { - readonly terminal: boolean; - /** - * The current input data being processed by node. - * - * This can be used when collecting input from a TTY stream to retrieve the - * current value that has been processed thus far, prior to the `line` event - * being emitted. Once the `line` event has been emitted, this property will - * be an empty string. - * - * Be aware that modifying the value during the instance runtime may have - * unintended consequences if `rl.cursor` is not also controlled. - * - * **If not using a TTY stream for input, use the `'line'` event.** - * - * One possible use case would be as follows: - * - * ```js - * const values = ['lorem ipsum', 'dolor sit amet']; - * const rl = readline.createInterface(process.stdin); - * const showResults = debounce(() => { - * console.log( - * '\n', - * values.filter((val) => val.startsWith(rl.line)).join(' '), - * ); - * }, 300); - * process.stdin.on('keypress', (c, k) => { - * showResults(); - * }); - * ``` - * @since v0.1.98 - */ - readonly line: string; - /** - * The cursor position relative to `rl.line`. - * - * This will track where the current cursor lands in the input string, when - * reading input from a TTY stream. The position of cursor determines the - * portion of the input string that will be modified as input is processed, - * as well as the column where the terminal caret will be rendered. - * @since v0.1.98 - */ - readonly cursor: number; - /** - * NOTE: According to the documentation: - * - * > Instances of the `readline.Interface` class are constructed using the - * > `readline.createInterface()` method. - * - * @see https://nodejs.org/dist/latest-v22.x/docs/api/readline.html#class-interfaceconstructor - */ - protected constructor( - input: NodeJS.ReadableStream, - output?: NodeJS.WritableStream, - completer?: Completer | AsyncCompleter, - terminal?: boolean, - ); - /** - * NOTE: According to the documentation: - * - * > Instances of the `readline.Interface` class are constructed using the - * > `readline.createInterface()` method. - * - * @see https://nodejs.org/dist/latest-v22.x/docs/api/readline.html#class-interfaceconstructor - */ - protected constructor(options: ReadLineOptions); - /** - * The `rl.getPrompt()` method returns the current prompt used by `rl.prompt()`. - * @since v15.3.0, v14.17.0 - * @return the current prompt string - */ - getPrompt(): string; - /** - * The `rl.setPrompt()` method sets the prompt that will be written to `output` whenever `rl.prompt()` is called. - * @since v0.1.98 - */ - setPrompt(prompt: string): void; - /** - * The `rl.prompt()` method writes the `Interface` instances configured`prompt` to a new line in `output` in order to provide a user with a new - * location at which to provide input. - * - * When called, `rl.prompt()` will resume the `input` stream if it has been - * paused. - * - * If the `Interface` was created with `output` set to `null` or `undefined` the prompt is not written. - * @since v0.1.98 - * @param preserveCursor If `true`, prevents the cursor placement from being reset to `0`. - */ - prompt(preserveCursor?: boolean): void; - /** - * The `rl.question()` method displays the `query` by writing it to the `output`, - * waits for user input to be provided on `input`, then invokes the `callback` function passing the provided input as the first argument. - * - * When called, `rl.question()` will resume the `input` stream if it has been - * paused. - * - * If the `Interface` was created with `output` set to `null` or `undefined` the `query` is not written. - * - * The `callback` function passed to `rl.question()` does not follow the typical - * pattern of accepting an `Error` object or `null` as the first argument. - * The `callback` is called with the provided answer as the only argument. - * - * An error will be thrown if calling `rl.question()` after `rl.close()`. - * - * Example usage: - * - * ```js - * rl.question('What is your favorite food? ', (answer) => { - * console.log(`Oh, so your favorite food is ${answer}`); - * }); - * ``` - * - * Using an `AbortController` to cancel a question. - * - * ```js - * const ac = new AbortController(); - * const signal = ac.signal; - * - * rl.question('What is your favorite food? ', { signal }, (answer) => { - * console.log(`Oh, so your favorite food is ${answer}`); - * }); - * - * signal.addEventListener('abort', () => { - * console.log('The food question timed out'); - * }, { once: true }); - * - * setTimeout(() => ac.abort(), 10000); - * ``` - * @since v0.3.3 - * @param query A statement or query to write to `output`, prepended to the prompt. - * @param callback A callback function that is invoked with the user's input in response to the `query`. - */ - question(query: string, callback: (answer: string) => void): void; - question(query: string, options: Abortable, callback: (answer: string) => void): void; - /** - * The `rl.pause()` method pauses the `input` stream, allowing it to be resumed - * later if necessary. - * - * Calling `rl.pause()` does not immediately pause other events (including `'line'`) from being emitted by the `Interface` instance. - * @since v0.3.4 - */ - pause(): this; - /** - * The `rl.resume()` method resumes the `input` stream if it has been paused. - * @since v0.3.4 - */ - resume(): this; - /** - * The `rl.close()` method closes the `Interface` instance and - * relinquishes control over the `input` and `output` streams. When called, - * the `'close'` event will be emitted. - * - * Calling `rl.close()` does not immediately stop other events (including `'line'`) - * from being emitted by the `Interface` instance. - * @since v0.1.98 - */ - close(): void; - /** - * The `rl.write()` method will write either `data` or a key sequence identified - * by `key` to the `output`. The `key` argument is supported only if `output` is - * a `TTY` text terminal. See `TTY keybindings` for a list of key - * combinations. - * - * If `key` is specified, `data` is ignored. - * - * When called, `rl.write()` will resume the `input` stream if it has been - * paused. - * - * If the `Interface` was created with `output` set to `null` or `undefined` the `data` and `key` are not written. - * - * ```js - * rl.write('Delete this!'); - * // Simulate Ctrl+U to delete the line written previously - * rl.write(null, { ctrl: true, name: 'u' }); - * ``` - * - * The `rl.write()` method will write the data to the `readline` `Interface`'s `input` _as if it were provided by the user_. - * @since v0.1.98 - */ - write(data: string | Buffer, key?: Key): void; - write(data: undefined | null | string | Buffer, key: Key): void; - /** - * Returns the real position of the cursor in relation to the input - * prompt + string. Long input (wrapping) strings, as well as multiple - * line prompts are included in the calculations. - * @since v13.5.0, v12.16.0 - */ - getCursorPos(): CursorPos; - /** - * events.EventEmitter - * 1. close - * 2. line - * 3. pause - * 4. resume - * 5. SIGCONT - * 6. SIGINT - * 7. SIGTSTP - * 8. history - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "line", listener: (input: string) => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: "SIGCONT", listener: () => void): this; - addListener(event: "SIGINT", listener: () => void): this; - addListener(event: "SIGTSTP", listener: () => void): this; - addListener(event: "history", listener: (history: string[]) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "line", input: string): boolean; - emit(event: "pause"): boolean; - emit(event: "resume"): boolean; - emit(event: "SIGCONT"): boolean; - emit(event: "SIGINT"): boolean; - emit(event: "SIGTSTP"): boolean; - emit(event: "history", history: string[]): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "line", listener: (input: string) => void): this; - on(event: "pause", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: "SIGCONT", listener: () => void): this; - on(event: "SIGINT", listener: () => void): this; - on(event: "SIGTSTP", listener: () => void): this; - on(event: "history", listener: (history: string[]) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "line", listener: (input: string) => void): this; - once(event: "pause", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: "SIGCONT", listener: () => void): this; - once(event: "SIGINT", listener: () => void): this; - once(event: "SIGTSTP", listener: () => void): this; - once(event: "history", listener: (history: string[]) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "line", listener: (input: string) => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: "SIGCONT", listener: () => void): this; - prependListener(event: "SIGINT", listener: () => void): this; - prependListener(event: "SIGTSTP", listener: () => void): this; - prependListener(event: "history", listener: (history: string[]) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "line", listener: (input: string) => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: "SIGCONT", listener: () => void): this; - prependOnceListener(event: "SIGINT", listener: () => void): this; - prependOnceListener(event: "SIGTSTP", listener: () => void): this; - prependOnceListener(event: "history", listener: (history: string[]) => void): this; - [Symbol.asyncIterator](): AsyncIterableIterator; - } - export type ReadLine = Interface; // type forwarded for backwards compatibility - export type Completer = (line: string) => CompleterResult; - export type AsyncCompleter = ( - line: string, - callback: (err?: null | Error, result?: CompleterResult) => void, - ) => void; - export type CompleterResult = [string[], string]; - export interface ReadLineOptions { - input: NodeJS.ReadableStream; - output?: NodeJS.WritableStream | undefined; - completer?: Completer | AsyncCompleter | undefined; - terminal?: boolean | undefined; - /** - * Initial list of history lines. This option makes sense - * only if `terminal` is set to `true` by the user or by an internal `output` - * check, otherwise the history caching mechanism is not initialized at all. - * @default [] - */ - history?: string[] | undefined; - historySize?: number | undefined; - prompt?: string | undefined; - crlfDelay?: number | undefined; - /** - * If `true`, when a new input line added - * to the history list duplicates an older one, this removes the older line - * from the list. - * @default false - */ - removeHistoryDuplicates?: boolean | undefined; - escapeCodeTimeout?: number | undefined; - tabSize?: number | undefined; - } - /** - * The `readline.createInterface()` method creates a new `readline.Interface` instance. - * - * ```js - * import readline from 'node:readline'; - * const rl = readline.createInterface({ - * input: process.stdin, - * output: process.stdout, - * }); - * ``` - * - * Once the `readline.Interface` instance is created, the most common case is to - * listen for the `'line'` event: - * - * ```js - * rl.on('line', (line) => { - * console.log(`Received: ${line}`); - * }); - * ``` - * - * If `terminal` is `true` for this instance then the `output` stream will get - * the best compatibility if it defines an `output.columns` property and emits - * a `'resize'` event on the `output` if or when the columns ever change - * (`process.stdout` does this automatically when it is a TTY). - * - * When creating a `readline.Interface` using `stdin` as input, the program - * will not terminate until it receives an [EOF character](https://en.wikipedia.org/wiki/End-of-file#EOF_character). To exit without - * waiting for user input, call `process.stdin.unref()`. - * @since v0.1.98 - */ - export function createInterface( - input: NodeJS.ReadableStream, - output?: NodeJS.WritableStream, - completer?: Completer | AsyncCompleter, - terminal?: boolean, - ): Interface; - export function createInterface(options: ReadLineOptions): Interface; - /** - * The `readline.emitKeypressEvents()` method causes the given `Readable` stream to begin emitting `'keypress'` events corresponding to received input. - * - * Optionally, `interface` specifies a `readline.Interface` instance for which - * autocompletion is disabled when copy-pasted input is detected. - * - * If the `stream` is a `TTY`, then it must be in raw mode. - * - * This is automatically called by any readline instance on its `input` if the `input` is a terminal. Closing the `readline` instance does not stop - * the `input` from emitting `'keypress'` events. - * - * ```js - * readline.emitKeypressEvents(process.stdin); - * if (process.stdin.isTTY) - * process.stdin.setRawMode(true); - * ``` - * - * ## Example: Tiny CLI - * - * The following example illustrates the use of `readline.Interface` class to - * implement a small command-line interface: - * - * ```js - * import readline from 'node:readline'; - * const rl = readline.createInterface({ - * input: process.stdin, - * output: process.stdout, - * prompt: 'OHAI> ', - * }); - * - * rl.prompt(); - * - * rl.on('line', (line) => { - * switch (line.trim()) { - * case 'hello': - * console.log('world!'); - * break; - * default: - * console.log(`Say what? I might have heard '${line.trim()}'`); - * break; - * } - * rl.prompt(); - * }).on('close', () => { - * console.log('Have a great day!'); - * process.exit(0); - * }); - * ``` - * - * ## Example: Read file stream line-by-Line - * - * A common use case for `readline` is to consume an input file one line at a - * time. The easiest way to do so is leveraging the `fs.ReadStream` API as - * well as a `for await...of` loop: - * - * ```js - * import fs from 'node:fs'; - * import readline from 'node:readline'; - * - * async function processLineByLine() { - * const fileStream = fs.createReadStream('input.txt'); - * - * const rl = readline.createInterface({ - * input: fileStream, - * crlfDelay: Infinity, - * }); - * // Note: we use the crlfDelay option to recognize all instances of CR LF - * // ('\r\n') in input.txt as a single line break. - * - * for await (const line of rl) { - * // Each line in input.txt will be successively available here as `line`. - * console.log(`Line from file: ${line}`); - * } - * } - * - * processLineByLine(); - * ``` - * - * Alternatively, one could use the `'line'` event: - * - * ```js - * import fs from 'node:fs'; - * import readline from 'node:readline'; - * - * const rl = readline.createInterface({ - * input: fs.createReadStream('sample.txt'), - * crlfDelay: Infinity, - * }); - * - * rl.on('line', (line) => { - * console.log(`Line from file: ${line}`); - * }); - * ``` - * - * Currently, `for await...of` loop can be a bit slower. If `async` / `await` flow and speed are both essential, a mixed approach can be applied: - * - * ```js - * import { once } from 'node:events'; - * import { createReadStream } from 'node:fs'; - * import { createInterface } from 'node:readline'; - * - * (async function processLineByLine() { - * try { - * const rl = createInterface({ - * input: createReadStream('big-file.txt'), - * crlfDelay: Infinity, - * }); - * - * rl.on('line', (line) => { - * // Process the line. - * }); - * - * await once(rl, 'close'); - * - * console.log('File processed.'); - * } catch (err) { - * console.error(err); - * } - * })(); - * ``` - * @since v0.7.7 - */ - export function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void; - export type Direction = -1 | 0 | 1; - export interface CursorPos { - rows: number; - cols: number; - } - /** - * The `readline.clearLine()` method clears current line of given [TTY](https://nodejs.org/docs/latest-v22.x/api/tty.html) stream - * in a specified direction identified by `dir`. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - export function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean; - /** - * The `readline.clearScreenDown()` method clears the given [TTY](https://nodejs.org/docs/latest-v22.x/api/tty.html) stream from - * the current position of the cursor down. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - export function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean; - /** - * The `readline.cursorTo()` method moves cursor to the specified position in a - * given [TTY](https://nodejs.org/docs/latest-v22.x/api/tty.html) `stream`. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - export function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean; - /** - * The `readline.moveCursor()` method moves the cursor _relative_ to its current - * position in a given [TTY](https://nodejs.org/docs/latest-v22.x/api/tty.html) `stream`. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - export function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean; -} -declare module "node:readline" { - export * from "readline"; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/readline/promises.d.ts b/tools/mnemonic-test/node_modules/@types/node/readline/promises.d.ts deleted file mode 100644 index 4d431065..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/readline/promises.d.ts +++ /dev/null @@ -1,150 +0,0 @@ -/** - * @since v17.0.0 - * @experimental - */ -declare module "readline/promises" { - import { AsyncCompleter, Completer, Direction, Interface as _Interface, ReadLineOptions } from "node:readline"; - import { Abortable } from "node:events"; - /** - * Instances of the `readlinePromises.Interface` class are constructed using the `readlinePromises.createInterface()` method. Every instance is associated with a - * single `input` `Readable` stream and a single `output` `Writable` stream. - * The `output` stream is used to print prompts for user input that arrives on, - * and is read from, the `input` stream. - * @since v17.0.0 - */ - class Interface extends _Interface { - /** - * The `rl.question()` method displays the `query` by writing it to the `output`, - * waits for user input to be provided on `input`, then invokes the `callback` function passing the provided input as the first argument. - * - * When called, `rl.question()` will resume the `input` stream if it has been - * paused. - * - * If the `Interface` was created with `output` set to `null` or `undefined` the `query` is not written. - * - * If the question is called after `rl.close()`, it returns a rejected promise. - * - * Example usage: - * - * ```js - * const answer = await rl.question('What is your favorite food? '); - * console.log(`Oh, so your favorite food is ${answer}`); - * ``` - * - * Using an `AbortSignal` to cancel a question. - * - * ```js - * const signal = AbortSignal.timeout(10_000); - * - * signal.addEventListener('abort', () => { - * console.log('The food question timed out'); - * }, { once: true }); - * - * const answer = await rl.question('What is your favorite food? ', { signal }); - * console.log(`Oh, so your favorite food is ${answer}`); - * ``` - * @since v17.0.0 - * @param query A statement or query to write to `output`, prepended to the prompt. - * @return A promise that is fulfilled with the user's input in response to the `query`. - */ - question(query: string): Promise; - question(query: string, options: Abortable): Promise; - } - /** - * @since v17.0.0 - */ - class Readline { - /** - * @param stream A TTY stream. - */ - constructor( - stream: NodeJS.WritableStream, - options?: { - autoCommit?: boolean; - }, - ); - /** - * The `rl.clearLine()` method adds to the internal list of pending action an - * action that clears current line of the associated `stream` in a specified - * direction identified by `dir`. - * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. - * @since v17.0.0 - * @return this - */ - clearLine(dir: Direction): this; - /** - * The `rl.clearScreenDown()` method adds to the internal list of pending action an - * action that clears the associated stream from the current position of the - * cursor down. - * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. - * @since v17.0.0 - * @return this - */ - clearScreenDown(): this; - /** - * The `rl.commit()` method sends all the pending actions to the associated `stream` and clears the internal list of pending actions. - * @since v17.0.0 - */ - commit(): Promise; - /** - * The `rl.cursorTo()` method adds to the internal list of pending action an action - * that moves cursor to the specified position in the associated `stream`. - * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. - * @since v17.0.0 - * @return this - */ - cursorTo(x: number, y?: number): this; - /** - * The `rl.moveCursor()` method adds to the internal list of pending action an - * action that moves the cursor _relative_ to its current position in the - * associated `stream`. - * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. - * @since v17.0.0 - * @return this - */ - moveCursor(dx: number, dy: number): this; - /** - * The `rl.rollback` methods clears the internal list of pending actions without - * sending it to the associated `stream`. - * @since v17.0.0 - * @return this - */ - rollback(): this; - } - /** - * The `readlinePromises.createInterface()` method creates a new `readlinePromises.Interface` instance. - * - * ```js - * import readlinePromises from 'node:readline/promises'; - * const rl = readlinePromises.createInterface({ - * input: process.stdin, - * output: process.stdout, - * }); - * ``` - * - * Once the `readlinePromises.Interface` instance is created, the most common case - * is to listen for the `'line'` event: - * - * ```js - * rl.on('line', (line) => { - * console.log(`Received: ${line}`); - * }); - * ``` - * - * If `terminal` is `true` for this instance then the `output` stream will get - * the best compatibility if it defines an `output.columns` property and emits - * a `'resize'` event on the `output` if or when the columns ever change - * (`process.stdout` does this automatically when it is a TTY). - * @since v17.0.0 - */ - function createInterface( - input: NodeJS.ReadableStream, - output?: NodeJS.WritableStream, - completer?: Completer | AsyncCompleter, - terminal?: boolean, - ): Interface; - function createInterface(options: ReadLineOptions): Interface; -} -declare module "node:readline/promises" { - export * from "readline/promises"; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/repl.d.ts b/tools/mnemonic-test/node_modules/@types/node/repl.d.ts deleted file mode 100644 index 5ff046ad..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/repl.d.ts +++ /dev/null @@ -1,430 +0,0 @@ -/** - * The `node:repl` module provides a Read-Eval-Print-Loop (REPL) implementation - * that is available both as a standalone program or includible in other - * applications. It can be accessed using: - * - * ```js - * import repl from 'node:repl'; - * ``` - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/repl.js) - */ -declare module "repl" { - import { AsyncCompleter, Completer, Interface } from "node:readline"; - import { Context } from "node:vm"; - import { InspectOptions } from "node:util"; - interface ReplOptions { - /** - * The input prompt to display. - * @default "> " - */ - prompt?: string | undefined; - /** - * The `Readable` stream from which REPL input will be read. - * @default process.stdin - */ - input?: NodeJS.ReadableStream | undefined; - /** - * The `Writable` stream to which REPL output will be written. - * @default process.stdout - */ - output?: NodeJS.WritableStream | undefined; - /** - * If `true`, specifies that the output should be treated as a TTY terminal, and have - * ANSI/VT100 escape codes written to it. - * Default: checking the value of the `isTTY` property on the output stream upon - * instantiation. - */ - terminal?: boolean | undefined; - /** - * The function to be used when evaluating each given line of input. - * Default: an async wrapper for the JavaScript `eval()` function. An `eval` function can - * error with `repl.Recoverable` to indicate the input was incomplete and prompt for - * additional lines. - * - * @see https://nodejs.org/dist/latest-v22.x/docs/api/repl.html#repl_default_evaluation - * @see https://nodejs.org/dist/latest-v22.x/docs/api/repl.html#repl_custom_evaluation_functions - */ - eval?: REPLEval | undefined; - /** - * Defines if the repl prints output previews or not. - * @default `true` Always `false` in case `terminal` is falsy. - */ - preview?: boolean | undefined; - /** - * If `true`, specifies that the default `writer` function should include ANSI color - * styling to REPL output. If a custom `writer` function is provided then this has no - * effect. - * @default the REPL instance's `terminal` value - */ - useColors?: boolean | undefined; - /** - * If `true`, specifies that the default evaluation function will use the JavaScript - * `global` as the context as opposed to creating a new separate context for the REPL - * instance. The node CLI REPL sets this value to `true`. - * @default false - */ - useGlobal?: boolean | undefined; - /** - * If `true`, specifies that the default writer will not output the return value of a - * command if it evaluates to `undefined`. - * @default false - */ - ignoreUndefined?: boolean | undefined; - /** - * The function to invoke to format the output of each command before writing to `output`. - * @default a wrapper for `util.inspect` - * - * @see https://nodejs.org/dist/latest-v22.x/docs/api/repl.html#repl_customizing_repl_output - */ - writer?: REPLWriter | undefined; - /** - * An optional function used for custom Tab auto completion. - * - * @see https://nodejs.org/dist/latest-v22.x/docs/api/readline.html#readline_use_of_the_completer_function - */ - completer?: Completer | AsyncCompleter | undefined; - /** - * A flag that specifies whether the default evaluator executes all JavaScript commands in - * strict mode or default (sloppy) mode. - * Accepted values are: - * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode. - * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to - * prefacing every repl statement with `'use strict'`. - */ - replMode?: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT | undefined; - /** - * Stop evaluating the current piece of code when `SIGINT` is received, i.e. `Ctrl+C` is - * pressed. This cannot be used together with a custom `eval` function. - * @default false - */ - breakEvalOnSigint?: boolean | undefined; - } - type REPLEval = ( - this: REPLServer, - evalCmd: string, - context: Context, - file: string, - cb: (err: Error | null, result: any) => void, - ) => void; - type REPLWriter = (this: REPLServer, obj: any) => string; - /** - * This is the default "writer" value, if none is passed in the REPL options, - * and it can be overridden by custom print functions. - */ - const writer: REPLWriter & { - options: InspectOptions; - }; - type REPLCommandAction = (this: REPLServer, text: string) => void; - interface REPLCommand { - /** - * Help text to be displayed when `.help` is entered. - */ - help?: string | undefined; - /** - * The function to execute, optionally accepting a single string argument. - */ - action: REPLCommandAction; - } - /** - * Instances of `repl.REPLServer` are created using the {@link start} method - * or directly using the JavaScript `new` keyword. - * - * ```js - * import repl from 'node:repl'; - * - * const options = { useColors: true }; - * - * const firstInstance = repl.start(options); - * const secondInstance = new repl.REPLServer(options); - * ``` - * @since v0.1.91 - */ - class REPLServer extends Interface { - /** - * The `vm.Context` provided to the `eval` function to be used for JavaScript - * evaluation. - */ - readonly context: Context; - /** - * @deprecated since v14.3.0 - Use `input` instead. - */ - readonly inputStream: NodeJS.ReadableStream; - /** - * @deprecated since v14.3.0 - Use `output` instead. - */ - readonly outputStream: NodeJS.WritableStream; - /** - * The `Readable` stream from which REPL input will be read. - */ - readonly input: NodeJS.ReadableStream; - /** - * The `Writable` stream to which REPL output will be written. - */ - readonly output: NodeJS.WritableStream; - /** - * The commands registered via `replServer.defineCommand()`. - */ - readonly commands: NodeJS.ReadOnlyDict; - /** - * A value indicating whether the REPL is currently in "editor mode". - * - * @see https://nodejs.org/dist/latest-v22.x/docs/api/repl.html#repl_commands_and_special_keys - */ - readonly editorMode: boolean; - /** - * A value indicating whether the `_` variable has been assigned. - * - * @see https://nodejs.org/dist/latest-v22.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly underscoreAssigned: boolean; - /** - * The last evaluation result from the REPL (assigned to the `_` variable inside of the REPL). - * - * @see https://nodejs.org/dist/latest-v22.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly last: any; - /** - * A value indicating whether the `_error` variable has been assigned. - * - * @since v9.8.0 - * @see https://nodejs.org/dist/latest-v22.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly underscoreErrAssigned: boolean; - /** - * The last error raised inside the REPL (assigned to the `_error` variable inside of the REPL). - * - * @since v9.8.0 - * @see https://nodejs.org/dist/latest-v22.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly lastError: any; - /** - * Specified in the REPL options, this is the function to be used when evaluating each - * given line of input. If not specified in the REPL options, this is an async wrapper - * for the JavaScript `eval()` function. - */ - readonly eval: REPLEval; - /** - * Specified in the REPL options, this is a value indicating whether the default - * `writer` function should include ANSI color styling to REPL output. - */ - readonly useColors: boolean; - /** - * Specified in the REPL options, this is a value indicating whether the default `eval` - * function will use the JavaScript `global` as the context as opposed to creating a new - * separate context for the REPL instance. - */ - readonly useGlobal: boolean; - /** - * Specified in the REPL options, this is a value indicating whether the default `writer` - * function should output the result of a command if it evaluates to `undefined`. - */ - readonly ignoreUndefined: boolean; - /** - * Specified in the REPL options, this is the function to invoke to format the output of - * each command before writing to `outputStream`. If not specified in the REPL options, - * this will be a wrapper for `util.inspect`. - */ - readonly writer: REPLWriter; - /** - * Specified in the REPL options, this is the function to use for custom Tab auto-completion. - */ - readonly completer: Completer | AsyncCompleter; - /** - * Specified in the REPL options, this is a flag that specifies whether the default `eval` - * function should execute all JavaScript commands in strict mode or default (sloppy) mode. - * Possible values are: - * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode. - * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to - * prefacing every repl statement with `'use strict'`. - */ - readonly replMode: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT; - /** - * NOTE: According to the documentation: - * - * > Instances of `repl.REPLServer` are created using the `repl.start()` method and - * > _should not_ be created directly using the JavaScript `new` keyword. - * - * `REPLServer` cannot be subclassed due to implementation specifics in NodeJS. - * - * @see https://nodejs.org/dist/latest-v22.x/docs/api/repl.html#repl_class_replserver - */ - private constructor(); - /** - * The `replServer.defineCommand()` method is used to add new `.`\-prefixed commands - * to the REPL instance. Such commands are invoked by typing a `.` followed by the `keyword`. The `cmd` is either a `Function` or an `Object` with the following - * properties: - * - * The following example shows two new commands added to the REPL instance: - * - * ```js - * import repl from 'node:repl'; - * - * const replServer = repl.start({ prompt: '> ' }); - * replServer.defineCommand('sayhello', { - * help: 'Say hello', - * action(name) { - * this.clearBufferedCommand(); - * console.log(`Hello, ${name}!`); - * this.displayPrompt(); - * }, - * }); - * replServer.defineCommand('saybye', function saybye() { - * console.log('Goodbye!'); - * this.close(); - * }); - * ``` - * - * The new commands can then be used from within the REPL instance: - * - * ```console - * > .sayhello Node.js User - * Hello, Node.js User! - * > .saybye - * Goodbye! - * ``` - * @since v0.3.0 - * @param keyword The command keyword (_without_ a leading `.` character). - * @param cmd The function to invoke when the command is processed. - */ - defineCommand(keyword: string, cmd: REPLCommandAction | REPLCommand): void; - /** - * The `replServer.displayPrompt()` method readies the REPL instance for input - * from the user, printing the configured `prompt` to a new line in the `output` and resuming the `input` to accept new input. - * - * When multi-line input is being entered, an ellipsis is printed rather than the - * 'prompt'. - * - * When `preserveCursor` is `true`, the cursor placement will not be reset to `0`. - * - * The `replServer.displayPrompt` method is primarily intended to be called from - * within the action function for commands registered using the `replServer.defineCommand()` method. - * @since v0.1.91 - */ - displayPrompt(preserveCursor?: boolean): void; - /** - * The `replServer.clearBufferedCommand()` method clears any command that has been - * buffered but not yet executed. This method is primarily intended to be - * called from within the action function for commands registered using the `replServer.defineCommand()` method. - * @since v9.0.0 - */ - clearBufferedCommand(): void; - /** - * Initializes a history log file for the REPL instance. When executing the - * Node.js binary and using the command-line REPL, a history file is initialized - * by default. However, this is not the case when creating a REPL - * programmatically. Use this method to initialize a history log file when working - * with REPL instances programmatically. - * @since v11.10.0 - * @param historyPath the path to the history file - * @param callback called when history writes are ready or upon error - */ - setupHistory(path: string, callback: (err: Error | null, repl: this) => void): void; - /** - * events.EventEmitter - * 1. close - inherited from `readline.Interface` - * 2. line - inherited from `readline.Interface` - * 3. pause - inherited from `readline.Interface` - * 4. resume - inherited from `readline.Interface` - * 5. SIGCONT - inherited from `readline.Interface` - * 6. SIGINT - inherited from `readline.Interface` - * 7. SIGTSTP - inherited from `readline.Interface` - * 8. exit - * 9. reset - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "line", listener: (input: string) => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: "SIGCONT", listener: () => void): this; - addListener(event: "SIGINT", listener: () => void): this; - addListener(event: "SIGTSTP", listener: () => void): this; - addListener(event: "exit", listener: () => void): this; - addListener(event: "reset", listener: (context: Context) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "line", input: string): boolean; - emit(event: "pause"): boolean; - emit(event: "resume"): boolean; - emit(event: "SIGCONT"): boolean; - emit(event: "SIGINT"): boolean; - emit(event: "SIGTSTP"): boolean; - emit(event: "exit"): boolean; - emit(event: "reset", context: Context): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "line", listener: (input: string) => void): this; - on(event: "pause", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: "SIGCONT", listener: () => void): this; - on(event: "SIGINT", listener: () => void): this; - on(event: "SIGTSTP", listener: () => void): this; - on(event: "exit", listener: () => void): this; - on(event: "reset", listener: (context: Context) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "line", listener: (input: string) => void): this; - once(event: "pause", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: "SIGCONT", listener: () => void): this; - once(event: "SIGINT", listener: () => void): this; - once(event: "SIGTSTP", listener: () => void): this; - once(event: "exit", listener: () => void): this; - once(event: "reset", listener: (context: Context) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "line", listener: (input: string) => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: "SIGCONT", listener: () => void): this; - prependListener(event: "SIGINT", listener: () => void): this; - prependListener(event: "SIGTSTP", listener: () => void): this; - prependListener(event: "exit", listener: () => void): this; - prependListener(event: "reset", listener: (context: Context) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "line", listener: (input: string) => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: "SIGCONT", listener: () => void): this; - prependOnceListener(event: "SIGINT", listener: () => void): this; - prependOnceListener(event: "SIGTSTP", listener: () => void): this; - prependOnceListener(event: "exit", listener: () => void): this; - prependOnceListener(event: "reset", listener: (context: Context) => void): this; - } - /** - * A flag passed in the REPL options. Evaluates expressions in sloppy mode. - */ - const REPL_MODE_SLOPPY: unique symbol; - /** - * A flag passed in the REPL options. Evaluates expressions in strict mode. - * This is equivalent to prefacing every repl statement with `'use strict'`. - */ - const REPL_MODE_STRICT: unique symbol; - /** - * The `repl.start()` method creates and starts a {@link REPLServer} instance. - * - * If `options` is a string, then it specifies the input prompt: - * - * ```js - * import repl from 'node:repl'; - * - * // a Unix style prompt - * repl.start('$ '); - * ``` - * @since v0.1.91 - */ - function start(options?: string | ReplOptions): REPLServer; - /** - * Indicates a recoverable error that a `REPLServer` can use to support multi-line input. - * - * @see https://nodejs.org/dist/latest-v22.x/docs/api/repl.html#repl_recoverable_errors - */ - class Recoverable extends SyntaxError { - err: Error; - constructor(err: Error); - } -} -declare module "node:repl" { - export * from "repl"; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/sea.d.ts b/tools/mnemonic-test/node_modules/@types/node/sea.d.ts deleted file mode 100644 index 0bedc625..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/sea.d.ts +++ /dev/null @@ -1,153 +0,0 @@ -/** - * This feature allows the distribution of a Node.js application conveniently to a - * system that does not have Node.js installed. - * - * Node.js supports the creation of [single executable applications](https://github.com/nodejs/single-executable) by allowing - * the injection of a blob prepared by Node.js, which can contain a bundled script, - * into the `node` binary. During start up, the program checks if anything has been - * injected. If the blob is found, it executes the script in the blob. Otherwise - * Node.js operates as it normally does. - * - * The single executable application feature currently only supports running a - * single embedded script using the `CommonJS` module system. - * - * Users can create a single executable application from their bundled script - * with the `node` binary itself and any tool which can inject resources into the - * binary. - * - * Here are the steps for creating a single executable application using one such - * tool, [postject](https://github.com/nodejs/postject): - * - * 1. Create a JavaScript file: - * ```bash - * echo 'console.log(`Hello, ${process.argv[2]}!`);' > hello.js - * ``` - * 2. Create a configuration file building a blob that can be injected into the - * single executable application (see `Generating single executable preparation blobs` for details): - * ```bash - * echo '{ "main": "hello.js", "output": "sea-prep.blob" }' > sea-config.json - * ``` - * 3. Generate the blob to be injected: - * ```bash - * node --experimental-sea-config sea-config.json - * ``` - * 4. Create a copy of the `node` executable and name it according to your needs: - * * On systems other than Windows: - * ```bash - * cp $(command -v node) hello - * ``` - * * On Windows: - * ```text - * node -e "require('fs').copyFileSync(process.execPath, 'hello.exe')" - * ``` - * The `.exe` extension is necessary. - * 5. Remove the signature of the binary (macOS and Windows only): - * * On macOS: - * ```bash - * codesign --remove-signature hello - * ``` - * * On Windows (optional): - * [signtool](https://learn.microsoft.com/en-us/windows/win32/seccrypto/signtool) can be used from the installed [Windows SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/). - * If this step is - * skipped, ignore any signature-related warning from postject. - * ```powershell - * signtool remove /s hello.exe - * ``` - * 6. Inject the blob into the copied binary by running `postject` with - * the following options: - * * `hello` / `hello.exe` \- The name of the copy of the `node` executable - * created in step 4. - * * `NODE_SEA_BLOB` \- The name of the resource / note / section in the binary - * where the contents of the blob will be stored. - * * `sea-prep.blob` \- The name of the blob created in step 1. - * * `--sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2` \- The [fuse](https://www.electronjs.org/docs/latest/tutorial/fuses) used by the Node.js project to detect if a file has been - * injected. - * * `--macho-segment-name NODE_SEA` (only needed on macOS) - The name of the - * segment in the binary where the contents of the blob will be - * stored. - * To summarize, here is the required command for each platform: - * * On Linux: - * ```bash - * npx postject hello NODE_SEA_BLOB sea-prep.blob \ - * --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 - * ``` - * * On Windows - PowerShell: - * ```powershell - * npx postject hello.exe NODE_SEA_BLOB sea-prep.blob ` - * --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 - * ``` - * * On Windows - Command Prompt: - * ```text - * npx postject hello.exe NODE_SEA_BLOB sea-prep.blob ^ - * --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 - * ``` - * * On macOS: - * ```bash - * npx postject hello NODE_SEA_BLOB sea-prep.blob \ - * --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 \ - * --macho-segment-name NODE_SEA - * ``` - * 7. Sign the binary (macOS and Windows only): - * * On macOS: - * ```bash - * codesign --sign - hello - * ``` - * * On Windows (optional): - * A certificate needs to be present for this to work. However, the unsigned - * binary would still be runnable. - * ```powershell - * signtool sign /fd SHA256 hello.exe - * ``` - * 8. Run the binary: - * * On systems other than Windows - * ```console - * $ ./hello world - * Hello, world! - * ``` - * * On Windows - * ```console - * $ .\hello.exe world - * Hello, world! - * ``` - * @since v19.7.0, v18.16.0 - * @experimental - * @see [source](https://github.com/nodejs/node/blob/v22.x/src/node_sea.cc) - */ -declare module "node:sea" { - type AssetKey = string; - /** - * @since v20.12.0 - * @return Whether this script is running inside a single-executable application. - */ - function isSea(): boolean; - /** - * This method can be used to retrieve the assets configured to be bundled into the - * single-executable application at build time. - * An error is thrown when no matching asset can be found. - * @since v20.12.0 - */ - function getAsset(key: AssetKey): ArrayBuffer; - function getAsset(key: AssetKey, encoding: string): string; - /** - * Similar to `sea.getAsset()`, but returns the result in a [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob). - * An error is thrown when no matching asset can be found. - * @since v20.12.0 - */ - function getAssetAsBlob(key: AssetKey, options?: { - type: string; - }): Blob; - /** - * This method can be used to retrieve the assets configured to be bundled into the - * single-executable application at build time. - * An error is thrown when no matching asset can be found. - * - * Unlike `sea.getRawAsset()` or `sea.getAssetAsBlob()`, this method does not - * return a copy. Instead, it returns the raw asset bundled inside the executable. - * - * For now, users should avoid writing to the returned array buffer. If the - * injected section is not marked as writable or not aligned properly, - * writes to the returned array buffer is likely to result in a crash. - * @since v20.12.0 - */ - function getRawAsset(key: AssetKey): string | ArrayBuffer; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/sqlite.d.ts b/tools/mnemonic-test/node_modules/@types/node/sqlite.d.ts deleted file mode 100644 index 9fa7babb..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/sqlite.d.ts +++ /dev/null @@ -1,213 +0,0 @@ -/** - * The `node:sqlite` module facilitates working with SQLite databases. - * To access it: - * - * ```js - * import sqlite from 'node:sqlite'; - * ``` - * - * This module is only available under the `node:` scheme. The following will not - * work: - * - * ```js - * import sqlite from 'node:sqlite'; - * ``` - * - * The following example shows the basic usage of the `node:sqlite` module to open - * an in-memory database, write data to the database, and then read the data back. - * - * ```js - * import { DatabaseSync } from 'node:sqlite'; - * const database = new DatabaseSync(':memory:'); - * - * // Execute SQL statements from strings. - * database.exec(` - * CREATE TABLE data( - * key INTEGER PRIMARY KEY, - * value TEXT - * ) STRICT - * `); - * // Create a prepared statement to insert data into the database. - * const insert = database.prepare('INSERT INTO data (key, value) VALUES (?, ?)'); - * // Execute the prepared statement with bound values. - * insert.run(1, 'hello'); - * insert.run(2, 'world'); - * // Create a prepared statement to read data from the database. - * const query = database.prepare('SELECT * FROM data ORDER BY key'); - * // Execute the prepared statement and log the result set. - * console.log(query.all()); - * // Prints: [ { key: 1, value: 'hello' }, { key: 2, value: 'world' } ] - * ``` - * @since v22.5.0 - * @experimental - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/sqlite.js) - */ -declare module "node:sqlite" { - interface DatabaseSyncOptions { - /** - * If `true`, the database is opened by the constructor. - * When this value is `false`, the database must be opened via the `open()` method. - */ - open?: boolean | undefined; - } - /** - * This class represents a single [connection](https://www.sqlite.org/c3ref/sqlite3.html) to a SQLite database. All APIs - * exposed by this class execute synchronously. - * @since v22.5.0 - */ - class DatabaseSync { - /** - * Constructs a new `DatabaseSync` instance. - * @param location The location of the database. - * A SQLite database can be stored in a file or completely [in memory](https://www.sqlite.org/inmemorydb.html). - * To use a file-backed database, the location should be a file path. - * To use an in-memory database, the location should be the special name `':memory:'`. - * @param options Configuration options for the database connection. - */ - constructor(location: string, options?: DatabaseSyncOptions); - /** - * Closes the database connection. An exception is thrown if the database is not - * open. This method is a wrapper around [`sqlite3_close_v2()`](https://www.sqlite.org/c3ref/close.html). - * @since v22.5.0 - */ - close(): void; - /** - * This method allows one or more SQL statements to be executed without returning - * any results. This method is useful when executing SQL statements read from a - * file. This method is a wrapper around [`sqlite3_exec()`](https://www.sqlite.org/c3ref/exec.html). - * @since v22.5.0 - * @param sql A SQL string to execute. - */ - exec(sql: string): void; - /** - * Opens the database specified in the `location` argument of the `DatabaseSync`constructor. This method should only be used when the database is not opened via - * the constructor. An exception is thrown if the database is already open. - * @since v22.5.0 - */ - open(): void; - /** - * Compiles a SQL statement into a [prepared statement](https://www.sqlite.org/c3ref/stmt.html). This method is a wrapper - * around [`sqlite3_prepare_v2()`](https://www.sqlite.org/c3ref/prepare.html). - * @since v22.5.0 - * @param sql A SQL string to compile to a prepared statement. - * @return The prepared statement. - */ - prepare(sql: string): StatementSync; - } - type SupportedValueType = null | number | bigint | string | Uint8Array; - interface StatementResultingChanges { - /** - * The number of rows modified, inserted, or deleted by the most recently completed `INSERT`, `UPDATE`, or `DELETE` statement. - * This field is either a number or a `BigInt` depending on the prepared statement's configuration. - * This property is the result of [`sqlite3_changes64()`](https://www.sqlite.org/c3ref/changes.html). - */ - changes: number | bigint; - /** - * The most recently inserted rowid. - * This field is either a number or a `BigInt` depending on the prepared statement's configuration. - * This property is the result of [`sqlite3_last_insert_rowid()`](https://www.sqlite.org/c3ref/last_insert_rowid.html). - */ - lastInsertRowid: number | bigint; - } - /** - * This class represents a single [prepared statement](https://www.sqlite.org/c3ref/stmt.html). This class cannot be - * instantiated via its constructor. Instead, instances are created via the`database.prepare()` method. All APIs exposed by this class execute - * synchronously. - * - * A prepared statement is an efficient binary representation of the SQL used to - * create it. Prepared statements are parameterizable, and can be invoked multiple - * times with different bound values. Parameters also offer protection against [SQL injection](https://en.wikipedia.org/wiki/SQL_injection) attacks. For these reasons, prepared statements are - * preferred - * over hand-crafted SQL strings when handling user input. - * @since v22.5.0 - */ - class StatementSync { - private constructor(); - /** - * This method executes a prepared statement and returns all results as an array of - * objects. If the prepared statement does not return any results, this method - * returns an empty array. The prepared statement [parameters are bound](https://www.sqlite.org/c3ref/bind_blob.html) using - * the values in `namedParameters` and `anonymousParameters`. - * @since v22.5.0 - * @param namedParameters An optional object used to bind named parameters. The keys of this object are used to configure the mapping. - * @param anonymousParameters Zero or more values to bind to anonymous parameters. - * @return An array of objects. Each object corresponds to a row returned by executing the prepared statement. The keys and values of each object correspond to the column names and values of - * the row. - */ - all(...anonymousParameters: SupportedValueType[]): unknown[]; - all( - namedParameters: Record, - ...anonymousParameters: SupportedValueType[] - ): unknown[]; - /** - * This method returns the source SQL of the prepared statement with parameter - * placeholders replaced by values. This method is a wrapper around [`sqlite3_expanded_sql()`](https://www.sqlite.org/c3ref/expanded_sql.html). - * @since v22.5.0 - * @return The source SQL expanded to include parameter values. - */ - expandedSQL(): string; - /** - * This method executes a prepared statement and returns the first result as an - * object. If the prepared statement does not return any results, this method - * returns `undefined`. The prepared statement [parameters are bound](https://www.sqlite.org/c3ref/bind_blob.html) using the - * values in `namedParameters` and `anonymousParameters`. - * @since v22.5.0 - * @param namedParameters An optional object used to bind named parameters. The keys of this object are used to configure the mapping. - * @param anonymousParameters Zero or more values to bind to anonymous parameters. - * @return An object corresponding to the first row returned by executing the prepared statement. The keys and values of the object correspond to the column names and values of the row. If no - * rows were returned from the database then this method returns `undefined`. - */ - get(...anonymousParameters: SupportedValueType[]): unknown; - get(namedParameters: Record, ...anonymousParameters: SupportedValueType[]): unknown; - /** - * This method executes a prepared statement and returns an object summarizing the - * resulting changes. The prepared statement [parameters are bound](https://www.sqlite.org/c3ref/bind_blob.html) using the - * values in `namedParameters` and `anonymousParameters`. - * @since v22.5.0 - * @param namedParameters An optional object used to bind named parameters. The keys of this object are used to configure the mapping. - * @param anonymousParameters Zero or more values to bind to anonymous parameters. - */ - run(...anonymousParameters: SupportedValueType[]): StatementResultingChanges; - run( - namedParameters: Record, - ...anonymousParameters: SupportedValueType[] - ): StatementResultingChanges; - /** - * The names of SQLite parameters begin with a prefix character. By default,`node:sqlite` requires that this prefix character is present when binding - * parameters. However, with the exception of dollar sign character, these - * prefix characters also require extra quoting when used in object keys. - * - * To improve ergonomics, this method can be used to also allow bare named - * parameters, which do not require the prefix character in JavaScript code. There - * are several caveats to be aware of when enabling bare named parameters: - * - * * The prefix character is still required in SQL. - * * The prefix character is still allowed in JavaScript. In fact, prefixed names - * will have slightly better binding performance. - * * Using ambiguous named parameters, such as `$k` and `@k`, in the same prepared - * statement will result in an exception as it cannot be determined how to bind - * a bare name. - * @since v22.5.0 - * @param enabled Enables or disables support for binding named parameters without the prefix character. - */ - setAllowBareNamedParameters(enabled: boolean): void; - /** - * When reading from the database, SQLite `INTEGER`s are mapped to JavaScript - * numbers by default. However, SQLite `INTEGER`s can store values larger than - * JavaScript numbers are capable of representing. In such cases, this method can - * be used to read `INTEGER` data using JavaScript `BigInt`s. This method has no - * impact on database write operations where numbers and `BigInt`s are both - * supported at all times. - * @since v22.5.0 - * @param enabled Enables or disables the use of `BigInt`s when reading `INTEGER` fields from the database. - */ - setReadBigInts(enabled: boolean): void; - /** - * This method returns the source SQL of the prepared statement. This method is a - * wrapper around [`sqlite3_sql()`](https://www.sqlite.org/c3ref/expanded_sql.html). - * @since v22.5.0 - * @return The source SQL used to create this prepared statement. - */ - sourceSQL(): string; - } -} diff --git a/tools/mnemonic-test/node_modules/@types/node/stream.d.ts b/tools/mnemonic-test/node_modules/@types/node/stream.d.ts deleted file mode 100644 index b9d210af..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/stream.d.ts +++ /dev/null @@ -1,1726 +0,0 @@ -/** - * A stream is an abstract interface for working with streaming data in Node.js. - * The `node:stream` module provides an API for implementing the stream interface. - * - * There are many stream objects provided by Node.js. For instance, a [request to an HTTP server](https://nodejs.org/docs/latest-v22.x/api/http.html#class-httpincomingmessage) - * and [`process.stdout`](https://nodejs.org/docs/latest-v22.x/api/process.html#processstdout) are both stream instances. - * - * Streams can be readable, writable, or both. All streams are instances of [`EventEmitter`](https://nodejs.org/docs/latest-v22.x/api/events.html#class-eventemitter). - * - * To access the `node:stream` module: - * - * ```js - * import stream from 'node:stream'; - * ``` - * - * The `node:stream` module is useful for creating new types of stream instances. - * It is usually not necessary to use the `node:stream` module to consume streams. - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/stream.js) - */ -declare module "stream" { - import { Abortable, EventEmitter } from "node:events"; - import { Blob as NodeBlob } from "node:buffer"; - import * as streamPromises from "node:stream/promises"; - import * as streamConsumers from "node:stream/consumers"; - import * as streamWeb from "node:stream/web"; - - type ComposeFnParam = (source: any) => void; - - class internal extends EventEmitter { - pipe( - destination: T, - options?: { - end?: boolean | undefined; - }, - ): T; - compose( - stream: T | ComposeFnParam | Iterable | AsyncIterable, - options?: { signal: AbortSignal }, - ): T; - } - import Stream = internal.Stream; - import Readable = internal.Readable; - import ReadableOptions = internal.ReadableOptions; - interface ArrayOptions { - /** - * The maximum concurrent invocations of `fn` to call on the stream at once. - * @default 1 - */ - concurrency?: number; - /** Allows destroying the stream if the signal is aborted. */ - signal?: AbortSignal; - } - class ReadableBase extends Stream implements NodeJS.ReadableStream { - /** - * A utility method for creating Readable Streams out of iterators. - * @since v12.3.0, v10.17.0 - * @param iterable Object implementing the `Symbol.asyncIterator` or `Symbol.iterator` iterable protocol. Emits an 'error' event if a null value is passed. - * @param options Options provided to `new stream.Readable([options])`. By default, `Readable.from()` will set `options.objectMode` to `true`, unless this is explicitly opted out by setting `options.objectMode` to `false`. - */ - static from(iterable: Iterable | AsyncIterable, options?: ReadableOptions): Readable; - /** - * Returns whether the stream has been read from or cancelled. - * @since v16.8.0 - */ - static isDisturbed(stream: Readable | NodeJS.ReadableStream): boolean; - /** - * Returns whether the stream was destroyed or errored before emitting `'end'`. - * @since v16.8.0 - * @experimental - */ - readonly readableAborted: boolean; - /** - * Is `true` if it is safe to call {@link read}, which means - * the stream has not been destroyed or emitted `'error'` or `'end'`. - * @since v11.4.0 - */ - readable: boolean; - /** - * Returns whether `'data'` has been emitted. - * @since v16.7.0, v14.18.0 - * @experimental - */ - readonly readableDidRead: boolean; - /** - * Getter for the property `encoding` of a given `Readable` stream. The `encoding` property can be set using the {@link setEncoding} method. - * @since v12.7.0 - */ - readonly readableEncoding: BufferEncoding | null; - /** - * Becomes `true` when [`'end'`](https://nodejs.org/docs/latest-v22.x/api/stream.html#event-end) event is emitted. - * @since v12.9.0 - */ - readonly readableEnded: boolean; - /** - * This property reflects the current state of a `Readable` stream as described - * in the [Three states](https://nodejs.org/docs/latest-v22.x/api/stream.html#three-states) section. - * @since v9.4.0 - */ - readonly readableFlowing: boolean | null; - /** - * Returns the value of `highWaterMark` passed when creating this `Readable`. - * @since v9.3.0 - */ - readonly readableHighWaterMark: number; - /** - * This property contains the number of bytes (or objects) in the queue - * ready to be read. The value provides introspection data regarding - * the status of the `highWaterMark`. - * @since v9.4.0 - */ - readonly readableLength: number; - /** - * Getter for the property `objectMode` of a given `Readable` stream. - * @since v12.3.0 - */ - readonly readableObjectMode: boolean; - /** - * Is `true` after `readable.destroy()` has been called. - * @since v8.0.0 - */ - destroyed: boolean; - /** - * Is `true` after `'close'` has been emitted. - * @since v18.0.0 - */ - readonly closed: boolean; - /** - * Returns error if the stream has been destroyed with an error. - * @since v18.0.0 - */ - readonly errored: Error | null; - constructor(opts?: ReadableOptions); - _construct?(callback: (error?: Error | null) => void): void; - _read(size: number): void; - /** - * The `readable.read()` method reads data out of the internal buffer and - * returns it. If no data is available to be read, `null` is returned. By default, - * the data is returned as a `Buffer` object unless an encoding has been - * specified using the `readable.setEncoding()` method or the stream is operating - * in object mode. - * - * The optional `size` argument specifies a specific number of bytes to read. If - * `size` bytes are not available to be read, `null` will be returned _unless_ the - * stream has ended, in which case all of the data remaining in the internal buffer - * will be returned. - * - * If the `size` argument is not specified, all of the data contained in the - * internal buffer will be returned. - * - * The `size` argument must be less than or equal to 1 GiB. - * - * The `readable.read()` method should only be called on `Readable` streams - * operating in paused mode. In flowing mode, `readable.read()` is called - * automatically until the internal buffer is fully drained. - * - * ```js - * const readable = getReadableStreamSomehow(); - * - * // 'readable' may be triggered multiple times as data is buffered in - * readable.on('readable', () => { - * let chunk; - * console.log('Stream is readable (new data received in buffer)'); - * // Use a loop to make sure we read all currently available data - * while (null !== (chunk = readable.read())) { - * console.log(`Read ${chunk.length} bytes of data...`); - * } - * }); - * - * // 'end' will be triggered once when there is no more data available - * readable.on('end', () => { - * console.log('Reached end of stream.'); - * }); - * ``` - * - * Each call to `readable.read()` returns a chunk of data, or `null`. The chunks - * are not concatenated. A `while` loop is necessary to consume all data - * currently in the buffer. When reading a large file `.read()` may return `null`, - * having consumed all buffered content so far, but there is still more data to - * come not yet buffered. In this case a new `'readable'` event will be emitted - * when there is more data in the buffer. Finally the `'end'` event will be - * emitted when there is no more data to come. - * - * Therefore to read a file's whole contents from a `readable`, it is necessary - * to collect chunks across multiple `'readable'` events: - * - * ```js - * const chunks = []; - * - * readable.on('readable', () => { - * let chunk; - * while (null !== (chunk = readable.read())) { - * chunks.push(chunk); - * } - * }); - * - * readable.on('end', () => { - * const content = chunks.join(''); - * }); - * ``` - * - * A `Readable` stream in object mode will always return a single item from - * a call to `readable.read(size)`, regardless of the value of the `size` argument. - * - * If the `readable.read()` method returns a chunk of data, a `'data'` event will - * also be emitted. - * - * Calling {@link read} after the `'end'` event has - * been emitted will return `null`. No runtime error will be raised. - * @since v0.9.4 - * @param size Optional argument to specify how much data to read. - */ - read(size?: number): any; - /** - * The `readable.setEncoding()` method sets the character encoding for - * data read from the `Readable` stream. - * - * By default, no encoding is assigned and stream data will be returned as `Buffer` objects. Setting an encoding causes the stream data - * to be returned as strings of the specified encoding rather than as `Buffer` objects. For instance, calling `readable.setEncoding('utf8')` will cause the - * output data to be interpreted as UTF-8 data, and passed as strings. Calling `readable.setEncoding('hex')` will cause the data to be encoded in hexadecimal - * string format. - * - * The `Readable` stream will properly handle multi-byte characters delivered - * through the stream that would otherwise become improperly decoded if simply - * pulled from the stream as `Buffer` objects. - * - * ```js - * const readable = getReadableStreamSomehow(); - * readable.setEncoding('utf8'); - * readable.on('data', (chunk) => { - * assert.equal(typeof chunk, 'string'); - * console.log('Got %d characters of string data:', chunk.length); - * }); - * ``` - * @since v0.9.4 - * @param encoding The encoding to use. - */ - setEncoding(encoding: BufferEncoding): this; - /** - * The `readable.pause()` method will cause a stream in flowing mode to stop - * emitting `'data'` events, switching out of flowing mode. Any data that - * becomes available will remain in the internal buffer. - * - * ```js - * const readable = getReadableStreamSomehow(); - * readable.on('data', (chunk) => { - * console.log(`Received ${chunk.length} bytes of data.`); - * readable.pause(); - * console.log('There will be no additional data for 1 second.'); - * setTimeout(() => { - * console.log('Now data will start flowing again.'); - * readable.resume(); - * }, 1000); - * }); - * ``` - * - * The `readable.pause()` method has no effect if there is a `'readable'` event listener. - * @since v0.9.4 - */ - pause(): this; - /** - * The `readable.resume()` method causes an explicitly paused `Readable` stream to - * resume emitting `'data'` events, switching the stream into flowing mode. - * - * The `readable.resume()` method can be used to fully consume the data from a - * stream without actually processing any of that data: - * - * ```js - * getReadableStreamSomehow() - * .resume() - * .on('end', () => { - * console.log('Reached the end, but did not read anything.'); - * }); - * ``` - * - * The `readable.resume()` method has no effect if there is a `'readable'` event listener. - * @since v0.9.4 - */ - resume(): this; - /** - * The `readable.isPaused()` method returns the current operating state of the `Readable`. - * This is used primarily by the mechanism that underlies the `readable.pipe()` method. - * In most typical cases, there will be no reason to use this method directly. - * - * ```js - * const readable = new stream.Readable(); - * - * readable.isPaused(); // === false - * readable.pause(); - * readable.isPaused(); // === true - * readable.resume(); - * readable.isPaused(); // === false - * ``` - * @since v0.11.14 - */ - isPaused(): boolean; - /** - * The `readable.unpipe()` method detaches a `Writable` stream previously attached - * using the {@link pipe} method. - * - * If the `destination` is not specified, then _all_ pipes are detached. - * - * If the `destination` is specified, but no pipe is set up for it, then - * the method does nothing. - * - * ```js - * import fs from 'node:fs'; - * const readable = getReadableStreamSomehow(); - * const writable = fs.createWriteStream('file.txt'); - * // All the data from readable goes into 'file.txt', - * // but only for the first second. - * readable.pipe(writable); - * setTimeout(() => { - * console.log('Stop writing to file.txt.'); - * readable.unpipe(writable); - * console.log('Manually close the file stream.'); - * writable.end(); - * }, 1000); - * ``` - * @since v0.9.4 - * @param destination Optional specific stream to unpipe - */ - unpipe(destination?: NodeJS.WritableStream): this; - /** - * Passing `chunk` as `null` signals the end of the stream (EOF) and behaves the - * same as `readable.push(null)`, after which no more data can be written. The EOF - * signal is put at the end of the buffer and any buffered data will still be - * flushed. - * - * The `readable.unshift()` method pushes a chunk of data back into the internal - * buffer. This is useful in certain situations where a stream is being consumed by - * code that needs to "un-consume" some amount of data that it has optimistically - * pulled out of the source, so that the data can be passed on to some other party. - * - * The `stream.unshift(chunk)` method cannot be called after the `'end'` event - * has been emitted or a runtime error will be thrown. - * - * Developers using `stream.unshift()` often should consider switching to - * use of a `Transform` stream instead. See the `API for stream implementers` section for more information. - * - * ```js - * // Pull off a header delimited by \n\n. - * // Use unshift() if we get too much. - * // Call the callback with (error, header, stream). - * import { StringDecoder } from 'node:string_decoder'; - * function parseHeader(stream, callback) { - * stream.on('error', callback); - * stream.on('readable', onReadable); - * const decoder = new StringDecoder('utf8'); - * let header = ''; - * function onReadable() { - * let chunk; - * while (null !== (chunk = stream.read())) { - * const str = decoder.write(chunk); - * if (str.includes('\n\n')) { - * // Found the header boundary. - * const split = str.split(/\n\n/); - * header += split.shift(); - * const remaining = split.join('\n\n'); - * const buf = Buffer.from(remaining, 'utf8'); - * stream.removeListener('error', callback); - * // Remove the 'readable' listener before unshifting. - * stream.removeListener('readable', onReadable); - * if (buf.length) - * stream.unshift(buf); - * // Now the body of the message can be read from the stream. - * callback(null, header, stream); - * return; - * } - * // Still reading the header. - * header += str; - * } - * } - * } - * ``` - * - * Unlike {@link push}, `stream.unshift(chunk)` will not - * end the reading process by resetting the internal reading state of the stream. - * This can cause unexpected results if `readable.unshift()` is called during a - * read (i.e. from within a {@link _read} implementation on a - * custom stream). Following the call to `readable.unshift()` with an immediate {@link push} will reset the reading state appropriately, - * however it is best to simply avoid calling `readable.unshift()` while in the - * process of performing a read. - * @since v0.9.11 - * @param chunk Chunk of data to unshift onto the read queue. For streams not operating in object mode, `chunk` must - * be a {string}, {Buffer}, {TypedArray}, {DataView} or `null`. For object mode streams, `chunk` may be any JavaScript value. - * @param encoding Encoding of string chunks. Must be a valid `Buffer` encoding, such as `'utf8'` or `'ascii'`. - */ - unshift(chunk: any, encoding?: BufferEncoding): void; - /** - * Prior to Node.js 0.10, streams did not implement the entire `node:stream` module API as it is currently defined. (See `Compatibility` for more - * information.) - * - * When using an older Node.js library that emits `'data'` events and has a {@link pause} method that is advisory only, the `readable.wrap()` method can be used to create a `Readable` - * stream that uses - * the old stream as its data source. - * - * It will rarely be necessary to use `readable.wrap()` but the method has been - * provided as a convenience for interacting with older Node.js applications and - * libraries. - * - * ```js - * import { OldReader } from './old-api-module.js'; - * import { Readable } from 'node:stream'; - * const oreader = new OldReader(); - * const myReader = new Readable().wrap(oreader); - * - * myReader.on('readable', () => { - * myReader.read(); // etc. - * }); - * ``` - * @since v0.9.4 - * @param stream An "old style" readable stream - */ - wrap(stream: NodeJS.ReadableStream): this; - push(chunk: any, encoding?: BufferEncoding): boolean; - /** - * The iterator created by this method gives users the option to cancel the destruction - * of the stream if the `for await...of` loop is exited by `return`, `break`, or `throw`, - * or if the iterator should destroy the stream if the stream emitted an error during iteration. - * @since v16.3.0 - * @param options.destroyOnReturn When set to `false`, calling `return` on the async iterator, - * or exiting a `for await...of` iteration using a `break`, `return`, or `throw` will not destroy the stream. - * **Default: `true`**. - */ - iterator(options?: { destroyOnReturn?: boolean }): AsyncIterableIterator; - /** - * This method allows mapping over the stream. The *fn* function will be called for every chunk in the stream. - * If the *fn* function returns a promise - that promise will be `await`ed before being passed to the result stream. - * @since v17.4.0, v16.14.0 - * @param fn a function to map over every chunk in the stream. Async or not. - * @returns a stream mapped with the function *fn*. - */ - map(fn: (data: any, options?: Pick) => any, options?: ArrayOptions): Readable; - /** - * This method allows filtering the stream. For each chunk in the stream the *fn* function will be called - * and if it returns a truthy value, the chunk will be passed to the result stream. - * If the *fn* function returns a promise - that promise will be `await`ed. - * @since v17.4.0, v16.14.0 - * @param fn a function to filter chunks from the stream. Async or not. - * @returns a stream filtered with the predicate *fn*. - */ - filter( - fn: (data: any, options?: Pick) => boolean | Promise, - options?: ArrayOptions, - ): Readable; - /** - * This method allows iterating a stream. For each chunk in the stream the *fn* function will be called. - * If the *fn* function returns a promise - that promise will be `await`ed. - * - * This method is different from `for await...of` loops in that it can optionally process chunks concurrently. - * In addition, a `forEach` iteration can only be stopped by having passed a `signal` option - * and aborting the related AbortController while `for await...of` can be stopped with `break` or `return`. - * In either case the stream will be destroyed. - * - * This method is different from listening to the `'data'` event in that it uses the `readable` event - * in the underlying machinary and can limit the number of concurrent *fn* calls. - * @since v17.5.0 - * @param fn a function to call on each chunk of the stream. Async or not. - * @returns a promise for when the stream has finished. - */ - forEach( - fn: (data: any, options?: Pick) => void | Promise, - options?: ArrayOptions, - ): Promise; - /** - * This method allows easily obtaining the contents of a stream. - * - * As this method reads the entire stream into memory, it negates the benefits of streams. It's intended - * for interoperability and convenience, not as the primary way to consume streams. - * @since v17.5.0 - * @returns a promise containing an array with the contents of the stream. - */ - toArray(options?: Pick): Promise; - /** - * This method is similar to `Array.prototype.some` and calls *fn* on each chunk in the stream - * until the awaited return value is `true` (or any truthy value). Once an *fn* call on a chunk - * `await`ed return value is truthy, the stream is destroyed and the promise is fulfilled with `true`. - * If none of the *fn* calls on the chunks return a truthy value, the promise is fulfilled with `false`. - * @since v17.5.0 - * @param fn a function to call on each chunk of the stream. Async or not. - * @returns a promise evaluating to `true` if *fn* returned a truthy value for at least one of the chunks. - */ - some( - fn: (data: any, options?: Pick) => boolean | Promise, - options?: ArrayOptions, - ): Promise; - /** - * This method is similar to `Array.prototype.find` and calls *fn* on each chunk in the stream - * to find a chunk with a truthy value for *fn*. Once an *fn* call's awaited return value is truthy, - * the stream is destroyed and the promise is fulfilled with value for which *fn* returned a truthy value. - * If all of the *fn* calls on the chunks return a falsy value, the promise is fulfilled with `undefined`. - * @since v17.5.0 - * @param fn a function to call on each chunk of the stream. Async or not. - * @returns a promise evaluating to the first chunk for which *fn* evaluated with a truthy value, - * or `undefined` if no element was found. - */ - find( - fn: (data: any, options?: Pick) => data is T, - options?: ArrayOptions, - ): Promise; - find( - fn: (data: any, options?: Pick) => boolean | Promise, - options?: ArrayOptions, - ): Promise; - /** - * This method is similar to `Array.prototype.every` and calls *fn* on each chunk in the stream - * to check if all awaited return values are truthy value for *fn*. Once an *fn* call on a chunk - * `await`ed return value is falsy, the stream is destroyed and the promise is fulfilled with `false`. - * If all of the *fn* calls on the chunks return a truthy value, the promise is fulfilled with `true`. - * @since v17.5.0 - * @param fn a function to call on each chunk of the stream. Async or not. - * @returns a promise evaluating to `true` if *fn* returned a truthy value for every one of the chunks. - */ - every( - fn: (data: any, options?: Pick) => boolean | Promise, - options?: ArrayOptions, - ): Promise; - /** - * This method returns a new stream by applying the given callback to each chunk of the stream - * and then flattening the result. - * - * It is possible to return a stream or another iterable or async iterable from *fn* and the result streams - * will be merged (flattened) into the returned stream. - * @since v17.5.0 - * @param fn a function to map over every chunk in the stream. May be async. May be a stream or generator. - * @returns a stream flat-mapped with the function *fn*. - */ - flatMap(fn: (data: any, options?: Pick) => any, options?: ArrayOptions): Readable; - /** - * This method returns a new stream with the first *limit* chunks dropped from the start. - * @since v17.5.0 - * @param limit the number of chunks to drop from the readable. - * @returns a stream with *limit* chunks dropped from the start. - */ - drop(limit: number, options?: Pick): Readable; - /** - * This method returns a new stream with the first *limit* chunks. - * @since v17.5.0 - * @param limit the number of chunks to take from the readable. - * @returns a stream with *limit* chunks taken. - */ - take(limit: number, options?: Pick): Readable; - /** - * This method returns a new stream with chunks of the underlying stream paired with a counter - * in the form `[index, chunk]`. The first index value is `0` and it increases by 1 for each chunk produced. - * @since v17.5.0 - * @returns a stream of indexed pairs. - */ - asIndexedPairs(options?: Pick): Readable; - /** - * This method calls *fn* on each chunk of the stream in order, passing it the result from the calculation - * on the previous element. It returns a promise for the final value of the reduction. - * - * If no *initial* value is supplied the first chunk of the stream is used as the initial value. - * If the stream is empty, the promise is rejected with a `TypeError` with the `ERR_INVALID_ARGS` code property. - * - * The reducer function iterates the stream element-by-element which means that there is no *concurrency* parameter - * or parallelism. To perform a reduce concurrently, you can extract the async function to `readable.map` method. - * @since v17.5.0 - * @param fn a reducer function to call over every chunk in the stream. Async or not. - * @param initial the initial value to use in the reduction. - * @returns a promise for the final value of the reduction. - */ - reduce( - fn: (previous: any, data: any, options?: Pick) => T, - initial?: undefined, - options?: Pick, - ): Promise; - reduce( - fn: (previous: T, data: any, options?: Pick) => T, - initial: T, - options?: Pick, - ): Promise; - _destroy(error: Error | null, callback: (error?: Error | null) => void): void; - /** - * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'` event (unless `emitClose` is set to `false`). After this call, the readable - * stream will release any internal resources and subsequent calls to `push()` will be ignored. - * - * Once `destroy()` has been called any further calls will be a no-op and no - * further errors except from `_destroy()` may be emitted as `'error'`. - * - * Implementors should not override this method, but instead implement `readable._destroy()`. - * @since v8.0.0 - * @param error Error which will be passed as payload in `'error'` event - */ - destroy(error?: Error): this; - /** - * Event emitter - * The defined events on documents including: - * 1. close - * 2. data - * 3. end - * 4. error - * 5. pause - * 6. readable - * 7. resume - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: any) => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "readable", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "close"): boolean; - emit(event: "data", chunk: any): boolean; - emit(event: "end"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "pause"): boolean; - emit(event: "readable"): boolean; - emit(event: "resume"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: any) => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "pause", listener: () => void): this; - on(event: "readable", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: any) => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "pause", listener: () => void): this; - once(event: "readable", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: any) => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "readable", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: any) => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "readable", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - removeListener(event: "close", listener: () => void): this; - removeListener(event: "data", listener: (chunk: any) => void): this; - removeListener(event: "end", listener: () => void): this; - removeListener(event: "error", listener: (err: Error) => void): this; - removeListener(event: "pause", listener: () => void): this; - removeListener(event: "readable", listener: () => void): this; - removeListener(event: "resume", listener: () => void): this; - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; - [Symbol.asyncIterator](): AsyncIterableIterator; - /** - * Calls `readable.destroy()` with an `AbortError` and returns a promise that fulfills when the stream is finished. - * @since v20.4.0 - */ - [Symbol.asyncDispose](): Promise; - } - import WritableOptions = internal.WritableOptions; - class WritableBase extends Stream implements NodeJS.WritableStream { - /** - * Is `true` if it is safe to call `writable.write()`, which means - * the stream has not been destroyed, errored, or ended. - * @since v11.4.0 - */ - readonly writable: boolean; - /** - * Is `true` after `writable.end()` has been called. This property - * does not indicate whether the data has been flushed, for this use `writable.writableFinished` instead. - * @since v12.9.0 - */ - readonly writableEnded: boolean; - /** - * Is set to `true` immediately before the `'finish'` event is emitted. - * @since v12.6.0 - */ - readonly writableFinished: boolean; - /** - * Return the value of `highWaterMark` passed when creating this `Writable`. - * @since v9.3.0 - */ - readonly writableHighWaterMark: number; - /** - * This property contains the number of bytes (or objects) in the queue - * ready to be written. The value provides introspection data regarding - * the status of the `highWaterMark`. - * @since v9.4.0 - */ - readonly writableLength: number; - /** - * Getter for the property `objectMode` of a given `Writable` stream. - * @since v12.3.0 - */ - readonly writableObjectMode: boolean; - /** - * Number of times `writable.uncork()` needs to be - * called in order to fully uncork the stream. - * @since v13.2.0, v12.16.0 - */ - readonly writableCorked: number; - /** - * Is `true` after `writable.destroy()` has been called. - * @since v8.0.0 - */ - destroyed: boolean; - /** - * Is `true` after `'close'` has been emitted. - * @since v18.0.0 - */ - readonly closed: boolean; - /** - * Returns error if the stream has been destroyed with an error. - * @since v18.0.0 - */ - readonly errored: Error | null; - /** - * Is `true` if the stream's buffer has been full and stream will emit `'drain'`. - * @since v15.2.0, v14.17.0 - */ - readonly writableNeedDrain: boolean; - constructor(opts?: WritableOptions); - _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - _writev?( - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void, - ): void; - _construct?(callback: (error?: Error | null) => void): void; - _destroy(error: Error | null, callback: (error?: Error | null) => void): void; - _final(callback: (error?: Error | null) => void): void; - /** - * The `writable.write()` method writes some data to the stream, and calls the - * supplied `callback` once the data has been fully handled. If an error - * occurs, the `callback` will be called with the error as its - * first argument. The `callback` is called asynchronously and before `'error'` is - * emitted. - * - * The return value is `true` if the internal buffer is less than the `highWaterMark` configured when the stream was created after admitting `chunk`. - * If `false` is returned, further attempts to write data to the stream should - * stop until the `'drain'` event is emitted. - * - * While a stream is not draining, calls to `write()` will buffer `chunk`, and - * return false. Once all currently buffered chunks are drained (accepted for - * delivery by the operating system), the `'drain'` event will be emitted. - * Once `write()` returns false, do not write more chunks - * until the `'drain'` event is emitted. While calling `write()` on a stream that - * is not draining is allowed, Node.js will buffer all written chunks until - * maximum memory usage occurs, at which point it will abort unconditionally. - * Even before it aborts, high memory usage will cause poor garbage collector - * performance and high RSS (which is not typically released back to the system, - * even after the memory is no longer required). Since TCP sockets may never - * drain if the remote peer does not read the data, writing a socket that is - * not draining may lead to a remotely exploitable vulnerability. - * - * Writing data while the stream is not draining is particularly - * problematic for a `Transform`, because the `Transform` streams are paused - * by default until they are piped or a `'data'` or `'readable'` event handler - * is added. - * - * If the data to be written can be generated or fetched on demand, it is - * recommended to encapsulate the logic into a `Readable` and use {@link pipe}. However, if calling `write()` is preferred, it is - * possible to respect backpressure and avoid memory issues using the `'drain'` event: - * - * ```js - * function write(data, cb) { - * if (!stream.write(data)) { - * stream.once('drain', cb); - * } else { - * process.nextTick(cb); - * } - * } - * - * // Wait for cb to be called before doing any other write. - * write('hello', () => { - * console.log('Write completed, do more writes now.'); - * }); - * ``` - * - * A `Writable` stream in object mode will always ignore the `encoding` argument. - * @since v0.9.4 - * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer}, - * {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`. - * @param [encoding='utf8'] The encoding, if `chunk` is a string. - * @param callback Callback for when this chunk of data is flushed. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - write(chunk: any, callback?: (error: Error | null | undefined) => void): boolean; - write(chunk: any, encoding: BufferEncoding, callback?: (error: Error | null | undefined) => void): boolean; - /** - * The `writable.setDefaultEncoding()` method sets the default `encoding` for a `Writable` stream. - * @since v0.11.15 - * @param encoding The new default encoding - */ - setDefaultEncoding(encoding: BufferEncoding): this; - /** - * Calling the `writable.end()` method signals that no more data will be written - * to the `Writable`. The optional `chunk` and `encoding` arguments allow one - * final additional chunk of data to be written immediately before closing the - * stream. - * - * Calling the {@link write} method after calling {@link end} will raise an error. - * - * ```js - * // Write 'hello, ' and then end with 'world!'. - * import fs from 'node:fs'; - * const file = fs.createWriteStream('example.txt'); - * file.write('hello, '); - * file.end('world!'); - * // Writing more now is not allowed! - * ``` - * @since v0.9.4 - * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer}, - * {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`. - * @param encoding The encoding if `chunk` is a string - * @param callback Callback for when the stream is finished. - */ - end(cb?: () => void): this; - end(chunk: any, cb?: () => void): this; - end(chunk: any, encoding: BufferEncoding, cb?: () => void): this; - /** - * The `writable.cork()` method forces all written data to be buffered in memory. - * The buffered data will be flushed when either the {@link uncork} or {@link end} methods are called. - * - * The primary intent of `writable.cork()` is to accommodate a situation in which - * several small chunks are written to the stream in rapid succession. Instead of - * immediately forwarding them to the underlying destination, `writable.cork()` buffers all the chunks until `writable.uncork()` is called, which will pass them - * all to `writable._writev()`, if present. This prevents a head-of-line blocking - * situation where data is being buffered while waiting for the first small chunk - * to be processed. However, use of `writable.cork()` without implementing `writable._writev()` may have an adverse effect on throughput. - * - * See also: `writable.uncork()`, `writable._writev()`. - * @since v0.11.2 - */ - cork(): void; - /** - * The `writable.uncork()` method flushes all data buffered since {@link cork} was called. - * - * When using `writable.cork()` and `writable.uncork()` to manage the buffering - * of writes to a stream, defer calls to `writable.uncork()` using `process.nextTick()`. Doing so allows batching of all `writable.write()` calls that occur within a given Node.js event - * loop phase. - * - * ```js - * stream.cork(); - * stream.write('some '); - * stream.write('data '); - * process.nextTick(() => stream.uncork()); - * ``` - * - * If the `writable.cork()` method is called multiple times on a stream, the - * same number of calls to `writable.uncork()` must be called to flush the buffered - * data. - * - * ```js - * stream.cork(); - * stream.write('some '); - * stream.cork(); - * stream.write('data '); - * process.nextTick(() => { - * stream.uncork(); - * // The data will not be flushed until uncork() is called a second time. - * stream.uncork(); - * }); - * ``` - * - * See also: `writable.cork()`. - * @since v0.11.2 - */ - uncork(): void; - /** - * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'` event (unless `emitClose` is set to `false`). After this call, the writable - * stream has ended and subsequent calls to `write()` or `end()` will result in - * an `ERR_STREAM_DESTROYED` error. - * This is a destructive and immediate way to destroy a stream. Previous calls to `write()` may not have drained, and may trigger an `ERR_STREAM_DESTROYED` error. - * Use `end()` instead of destroy if data should flush before close, or wait for - * the `'drain'` event before destroying the stream. - * - * Once `destroy()` has been called any further calls will be a no-op and no - * further errors except from `_destroy()` may be emitted as `'error'`. - * - * Implementors should not override this method, - * but instead implement `writable._destroy()`. - * @since v8.0.0 - * @param error Optional, an error to emit with `'error'` event. - */ - destroy(error?: Error): this; - /** - * Event emitter - * The defined events on documents including: - * 1. close - * 2. drain - * 3. error - * 4. finish - * 5. pipe - * 6. unpipe - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "pipe", listener: (src: Readable) => void): this; - addListener(event: "unpipe", listener: (src: Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "close"): boolean; - emit(event: "drain"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "finish"): boolean; - emit(event: "pipe", src: Readable): boolean; - emit(event: "unpipe", src: Readable): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "close", listener: () => void): this; - on(event: "drain", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "pipe", listener: (src: Readable) => void): this; - on(event: "unpipe", listener: (src: Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "drain", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "pipe", listener: (src: Readable) => void): this; - once(event: "unpipe", listener: (src: Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "pipe", listener: (src: Readable) => void): this; - prependListener(event: "unpipe", listener: (src: Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "pipe", listener: (src: Readable) => void): this; - prependOnceListener(event: "unpipe", listener: (src: Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - removeListener(event: "close", listener: () => void): this; - removeListener(event: "drain", listener: () => void): this; - removeListener(event: "error", listener: (err: Error) => void): this; - removeListener(event: "finish", listener: () => void): this; - removeListener(event: "pipe", listener: (src: Readable) => void): this; - removeListener(event: "unpipe", listener: (src: Readable) => void): this; - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - namespace internal { - class Stream extends internal { - constructor(opts?: ReadableOptions); - } - interface StreamOptions extends Abortable { - emitClose?: boolean | undefined; - highWaterMark?: number | undefined; - objectMode?: boolean | undefined; - construct?(this: T, callback: (error?: Error | null) => void): void; - destroy?(this: T, error: Error | null, callback: (error?: Error | null) => void): void; - autoDestroy?: boolean | undefined; - } - interface ReadableOptions extends StreamOptions { - encoding?: BufferEncoding | undefined; - read?(this: Readable, size: number): void; - } - /** - * @since v0.9.4 - */ - class Readable extends ReadableBase { - /** - * A utility method for creating a `Readable` from a web `ReadableStream`. - * @since v17.0.0 - * @experimental - */ - static fromWeb( - readableStream: streamWeb.ReadableStream, - options?: Pick, - ): Readable; - /** - * A utility method for creating a web `ReadableStream` from a `Readable`. - * @since v17.0.0 - * @experimental - */ - static toWeb(streamReadable: Readable): streamWeb.ReadableStream; - } - interface WritableOptions extends StreamOptions { - decodeStrings?: boolean | undefined; - defaultEncoding?: BufferEncoding | undefined; - write?( - this: Writable, - chunk: any, - encoding: BufferEncoding, - callback: (error?: Error | null) => void, - ): void; - writev?( - this: Writable, - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void, - ): void; - final?(this: Writable, callback: (error?: Error | null) => void): void; - } - /** - * @since v0.9.4 - */ - class Writable extends WritableBase { - /** - * A utility method for creating a `Writable` from a web `WritableStream`. - * @since v17.0.0 - * @experimental - */ - static fromWeb( - writableStream: streamWeb.WritableStream, - options?: Pick, - ): Writable; - /** - * A utility method for creating a web `WritableStream` from a `Writable`. - * @since v17.0.0 - * @experimental - */ - static toWeb(streamWritable: Writable): streamWeb.WritableStream; - } - interface DuplexOptions extends ReadableOptions, WritableOptions { - allowHalfOpen?: boolean | undefined; - readableObjectMode?: boolean | undefined; - writableObjectMode?: boolean | undefined; - readableHighWaterMark?: number | undefined; - writableHighWaterMark?: number | undefined; - writableCorked?: number | undefined; - construct?(this: Duplex, callback: (error?: Error | null) => void): void; - read?(this: Duplex, size: number): void; - write?(this: Duplex, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - writev?( - this: Duplex, - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void, - ): void; - final?(this: Duplex, callback: (error?: Error | null) => void): void; - destroy?(this: Duplex, error: Error | null, callback: (error?: Error | null) => void): void; - } - /** - * Duplex streams are streams that implement both the `Readable` and `Writable` interfaces. - * - * Examples of `Duplex` streams include: - * - * * `TCP sockets` - * * `zlib streams` - * * `crypto streams` - * @since v0.9.4 - */ - class Duplex extends ReadableBase implements WritableBase { - readonly writable: boolean; - readonly writableEnded: boolean; - readonly writableFinished: boolean; - readonly writableHighWaterMark: number; - readonly writableLength: number; - readonly writableObjectMode: boolean; - readonly writableCorked: number; - readonly writableNeedDrain: boolean; - readonly closed: boolean; - readonly errored: Error | null; - /** - * If `false` then the stream will automatically end the writable side when the - * readable side ends. Set initially by the `allowHalfOpen` constructor option, - * which defaults to `true`. - * - * This can be changed manually to change the half-open behavior of an existing - * `Duplex` stream instance, but must be changed before the `'end'` event is emitted. - * @since v0.9.4 - */ - allowHalfOpen: boolean; - constructor(opts?: DuplexOptions); - /** - * A utility method for creating duplex streams. - * - * - `Stream` converts writable stream into writable `Duplex` and readable stream - * to `Duplex`. - * - `Blob` converts into readable `Duplex`. - * - `string` converts into readable `Duplex`. - * - `ArrayBuffer` converts into readable `Duplex`. - * - `AsyncIterable` converts into a readable `Duplex`. Cannot yield `null`. - * - `AsyncGeneratorFunction` converts into a readable/writable transform - * `Duplex`. Must take a source `AsyncIterable` as first parameter. Cannot yield - * `null`. - * - `AsyncFunction` converts into a writable `Duplex`. Must return - * either `null` or `undefined` - * - `Object ({ writable, readable })` converts `readable` and - * `writable` into `Stream` and then combines them into `Duplex` where the - * `Duplex` will write to the `writable` and read from the `readable`. - * - `Promise` converts into readable `Duplex`. Value `null` is ignored. - * - * @since v16.8.0 - */ - static from( - src: - | Stream - | NodeBlob - | ArrayBuffer - | string - | Iterable - | AsyncIterable - | AsyncGeneratorFunction - | Promise - | Object, - ): Duplex; - _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - _writev?( - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void, - ): void; - _destroy(error: Error | null, callback: (error?: Error | null) => void): void; - _final(callback: (error?: Error | null) => void): void; - write(chunk: any, encoding?: BufferEncoding, cb?: (error: Error | null | undefined) => void): boolean; - write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean; - setDefaultEncoding(encoding: BufferEncoding): this; - end(cb?: () => void): this; - end(chunk: any, cb?: () => void): this; - end(chunk: any, encoding?: BufferEncoding, cb?: () => void): this; - cork(): void; - uncork(): void; - /** - * A utility method for creating a web `ReadableStream` and `WritableStream` from a `Duplex`. - * @since v17.0.0 - * @experimental - */ - static toWeb(streamDuplex: Duplex): { - readable: streamWeb.ReadableStream; - writable: streamWeb.WritableStream; - }; - /** - * A utility method for creating a `Duplex` from a web `ReadableStream` and `WritableStream`. - * @since v17.0.0 - * @experimental - */ - static fromWeb( - duplexStream: { - readable: streamWeb.ReadableStream; - writable: streamWeb.WritableStream; - }, - options?: Pick< - DuplexOptions, - "allowHalfOpen" | "decodeStrings" | "encoding" | "highWaterMark" | "objectMode" | "signal" - >, - ): Duplex; - /** - * Event emitter - * The defined events on documents including: - * 1. close - * 2. data - * 3. drain - * 4. end - * 5. error - * 6. finish - * 7. pause - * 8. pipe - * 9. readable - * 10. resume - * 11. unpipe - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: any) => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "pipe", listener: (src: Readable) => void): this; - addListener(event: "readable", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: "unpipe", listener: (src: Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "close"): boolean; - emit(event: "data", chunk: any): boolean; - emit(event: "drain"): boolean; - emit(event: "end"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "finish"): boolean; - emit(event: "pause"): boolean; - emit(event: "pipe", src: Readable): boolean; - emit(event: "readable"): boolean; - emit(event: "resume"): boolean; - emit(event: "unpipe", src: Readable): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: any) => void): this; - on(event: "drain", listener: () => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "pause", listener: () => void): this; - on(event: "pipe", listener: (src: Readable) => void): this; - on(event: "readable", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: "unpipe", listener: (src: Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: any) => void): this; - once(event: "drain", listener: () => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "pause", listener: () => void): this; - once(event: "pipe", listener: (src: Readable) => void): this; - once(event: "readable", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: "unpipe", listener: (src: Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: any) => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "pipe", listener: (src: Readable) => void): this; - prependListener(event: "readable", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: "unpipe", listener: (src: Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: any) => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "pipe", listener: (src: Readable) => void): this; - prependOnceListener(event: "readable", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: "unpipe", listener: (src: Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - removeListener(event: "close", listener: () => void): this; - removeListener(event: "data", listener: (chunk: any) => void): this; - removeListener(event: "drain", listener: () => void): this; - removeListener(event: "end", listener: () => void): this; - removeListener(event: "error", listener: (err: Error) => void): this; - removeListener(event: "finish", listener: () => void): this; - removeListener(event: "pause", listener: () => void): this; - removeListener(event: "pipe", listener: (src: Readable) => void): this; - removeListener(event: "readable", listener: () => void): this; - removeListener(event: "resume", listener: () => void): this; - removeListener(event: "unpipe", listener: (src: Readable) => void): this; - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * The utility function `duplexPair` returns an Array with two items, - * each being a `Duplex` stream connected to the other side: - * - * ```js - * const [ sideA, sideB ] = duplexPair(); - * ``` - * - * Whatever is written to one stream is made readable on the other. It provides - * behavior analogous to a network connection, where the data written by the client - * becomes readable by the server, and vice-versa. - * - * The Duplex streams are symmetrical; one or the other may be used without any - * difference in behavior. - * @param options A value to pass to both {@link Duplex} constructors, - * to set options such as buffering. - * @since v22.6.0 - */ - function duplexPair(options?: DuplexOptions): [Duplex, Duplex]; - type TransformCallback = (error?: Error | null, data?: any) => void; - interface TransformOptions extends DuplexOptions { - construct?(this: Transform, callback: (error?: Error | null) => void): void; - read?(this: Transform, size: number): void; - write?( - this: Transform, - chunk: any, - encoding: BufferEncoding, - callback: (error?: Error | null) => void, - ): void; - writev?( - this: Transform, - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void, - ): void; - final?(this: Transform, callback: (error?: Error | null) => void): void; - destroy?(this: Transform, error: Error | null, callback: (error?: Error | null) => void): void; - transform?(this: Transform, chunk: any, encoding: BufferEncoding, callback: TransformCallback): void; - flush?(this: Transform, callback: TransformCallback): void; - } - /** - * Transform streams are `Duplex` streams where the output is in some way - * related to the input. Like all `Duplex` streams, `Transform` streams - * implement both the `Readable` and `Writable` interfaces. - * - * Examples of `Transform` streams include: - * - * * `zlib streams` - * * `crypto streams` - * @since v0.9.4 - */ - class Transform extends Duplex { - constructor(opts?: TransformOptions); - _transform(chunk: any, encoding: BufferEncoding, callback: TransformCallback): void; - _flush(callback: TransformCallback): void; - } - /** - * The `stream.PassThrough` class is a trivial implementation of a `Transform` stream that simply passes the input bytes across to the output. Its purpose is - * primarily for examples and testing, but there are some use cases where `stream.PassThrough` is useful as a building block for novel sorts of streams. - */ - class PassThrough extends Transform {} - /** - * A stream to attach a signal to. - * - * Attaches an AbortSignal to a readable or writeable stream. This lets code - * control stream destruction using an `AbortController`. - * - * Calling `abort` on the `AbortController` corresponding to the passed `AbortSignal` will behave the same way as calling `.destroy(new AbortError())` on the - * stream, and `controller.error(new AbortError())` for webstreams. - * - * ```js - * import fs from 'node:fs'; - * - * const controller = new AbortController(); - * const read = addAbortSignal( - * controller.signal, - * fs.createReadStream(('object.json')), - * ); - * // Later, abort the operation closing the stream - * controller.abort(); - * ``` - * - * Or using an `AbortSignal` with a readable stream as an async iterable: - * - * ```js - * const controller = new AbortController(); - * setTimeout(() => controller.abort(), 10_000); // set a timeout - * const stream = addAbortSignal( - * controller.signal, - * fs.createReadStream(('object.json')), - * ); - * (async () => { - * try { - * for await (const chunk of stream) { - * await process(chunk); - * } - * } catch (e) { - * if (e.name === 'AbortError') { - * // The operation was cancelled - * } else { - * throw e; - * } - * } - * })(); - * ``` - * - * Or using an `AbortSignal` with a ReadableStream: - * - * ```js - * const controller = new AbortController(); - * const rs = new ReadableStream({ - * start(controller) { - * controller.enqueue('hello'); - * controller.enqueue('world'); - * controller.close(); - * }, - * }); - * - * addAbortSignal(controller.signal, rs); - * - * finished(rs, (err) => { - * if (err) { - * if (err.name === 'AbortError') { - * // The operation was cancelled - * } - * } - * }); - * - * const reader = rs.getReader(); - * - * reader.read().then(({ value, done }) => { - * console.log(value); // hello - * console.log(done); // false - * controller.abort(); - * }); - * ``` - * @since v15.4.0 - * @param signal A signal representing possible cancellation - * @param stream A stream to attach a signal to. - */ - function addAbortSignal(signal: AbortSignal, stream: T): T; - /** - * Returns the default highWaterMark used by streams. - * Defaults to `65536` (64 KiB), or `16` for `objectMode`. - * @since v19.9.0 - */ - function getDefaultHighWaterMark(objectMode: boolean): number; - /** - * Sets the default highWaterMark used by streams. - * @since v19.9.0 - * @param value highWaterMark value - */ - function setDefaultHighWaterMark(objectMode: boolean, value: number): void; - interface FinishedOptions extends Abortable { - error?: boolean | undefined; - readable?: boolean | undefined; - writable?: boolean | undefined; - } - /** - * A readable and/or writable stream/webstream. - * - * A function to get notified when a stream is no longer readable, writable - * or has experienced an error or a premature close event. - * - * ```js - * import { finished } from 'node:stream'; - * import fs from 'node:fs'; - * - * const rs = fs.createReadStream('archive.tar'); - * - * finished(rs, (err) => { - * if (err) { - * console.error('Stream failed.', err); - * } else { - * console.log('Stream is done reading.'); - * } - * }); - * - * rs.resume(); // Drain the stream. - * ``` - * - * Especially useful in error handling scenarios where a stream is destroyed - * prematurely (like an aborted HTTP request), and will not emit `'end'` or `'finish'`. - * - * The `finished` API provides [`promise version`](https://nodejs.org/docs/latest-v22.x/api/stream.html#streamfinishedstream-options). - * - * `stream.finished()` leaves dangling event listeners (in particular `'error'`, `'end'`, `'finish'` and `'close'`) after `callback` has been - * invoked. The reason for this is so that unexpected `'error'` events (due to - * incorrect stream implementations) do not cause unexpected crashes. - * If this is unwanted behavior then the returned cleanup function needs to be - * invoked in the callback: - * - * ```js - * const cleanup = finished(rs, (err) => { - * cleanup(); - * // ... - * }); - * ``` - * @since v10.0.0 - * @param stream A readable and/or writable stream. - * @param callback A callback function that takes an optional error argument. - * @returns A cleanup function which removes all registered listeners. - */ - function finished( - stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, - options: FinishedOptions, - callback: (err?: NodeJS.ErrnoException | null) => void, - ): () => void; - function finished( - stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, - callback: (err?: NodeJS.ErrnoException | null) => void, - ): () => void; - namespace finished { - function __promisify__( - stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, - options?: FinishedOptions, - ): Promise; - } - type PipelineSourceFunction = () => Iterable | AsyncIterable; - type PipelineSource = Iterable | AsyncIterable | NodeJS.ReadableStream | PipelineSourceFunction; - type PipelineTransform, U> = - | NodeJS.ReadWriteStream - | (( - source: S extends (...args: any[]) => Iterable | AsyncIterable ? AsyncIterable - : S, - ) => AsyncIterable); - type PipelineTransformSource = PipelineSource | PipelineTransform; - type PipelineDestinationIterableFunction = (source: AsyncIterable) => AsyncIterable; - type PipelineDestinationPromiseFunction = (source: AsyncIterable) => Promise

; - type PipelineDestination, P> = S extends - PipelineTransformSource ? - | NodeJS.WritableStream - | PipelineDestinationIterableFunction - | PipelineDestinationPromiseFunction - : never; - type PipelineCallback> = S extends - PipelineDestinationPromiseFunction ? (err: NodeJS.ErrnoException | null, value: P) => void - : (err: NodeJS.ErrnoException | null) => void; - type PipelinePromise> = S extends - PipelineDestinationPromiseFunction ? Promise

: Promise; - interface PipelineOptions { - signal?: AbortSignal | undefined; - end?: boolean | undefined; - } - /** - * A module method to pipe between streams and generators forwarding errors and - * properly cleaning up and provide a callback when the pipeline is complete. - * - * ```js - * import { pipeline } from 'node:stream'; - * import fs from 'node:fs'; - * import zlib from 'node:zlib'; - * - * // Use the pipeline API to easily pipe a series of streams - * // together and get notified when the pipeline is fully done. - * - * // A pipeline to gzip a potentially huge tar file efficiently: - * - * pipeline( - * fs.createReadStream('archive.tar'), - * zlib.createGzip(), - * fs.createWriteStream('archive.tar.gz'), - * (err) => { - * if (err) { - * console.error('Pipeline failed.', err); - * } else { - * console.log('Pipeline succeeded.'); - * } - * }, - * ); - * ``` - * - * The `pipeline` API provides a [`promise version`](https://nodejs.org/docs/latest-v22.x/api/stream.html#streampipelinesource-transforms-destination-options). - * - * `stream.pipeline()` will call `stream.destroy(err)` on all streams except: - * - * * `Readable` streams which have emitted `'end'` or `'close'`. - * * `Writable` streams which have emitted `'finish'` or `'close'`. - * - * `stream.pipeline()` leaves dangling event listeners on the streams - * after the `callback` has been invoked. In the case of reuse of streams after - * failure, this can cause event listener leaks and swallowed errors. If the last - * stream is readable, dangling event listeners will be removed so that the last - * stream can be consumed later. - * - * `stream.pipeline()` closes all the streams when an error is raised. - * The `IncomingRequest` usage with `pipeline` could lead to an unexpected behavior - * once it would destroy the socket without sending the expected response. - * See the example below: - * - * ```js - * import fs from 'node:fs'; - * import http from 'node:http'; - * import { pipeline } from 'node:stream'; - * - * const server = http.createServer((req, res) => { - * const fileStream = fs.createReadStream('./fileNotExist.txt'); - * pipeline(fileStream, res, (err) => { - * if (err) { - * console.log(err); // No such file - * // this message can't be sent once `pipeline` already destroyed the socket - * return res.end('error!!!'); - * } - * }); - * }); - * ``` - * @since v10.0.0 - * @param callback Called when the pipeline is fully done. - */ - function pipeline, B extends PipelineDestination>( - source: A, - destination: B, - callback: PipelineCallback, - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - destination: B, - callback: PipelineCallback, - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - destination: B, - callback: PipelineCallback, - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - destination: B, - callback: PipelineCallback, - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - T4 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - transform4: T4, - destination: B, - callback: PipelineCallback, - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline( - streams: ReadonlyArray, - callback: (err: NodeJS.ErrnoException | null) => void, - ): NodeJS.WritableStream; - function pipeline( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, - ...streams: Array< - NodeJS.ReadWriteStream | NodeJS.WritableStream | ((err: NodeJS.ErrnoException | null) => void) - > - ): NodeJS.WritableStream; - namespace pipeline { - function __promisify__, B extends PipelineDestination>( - source: A, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - T4 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - transform4: T4, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function __promisify__( - streams: ReadonlyArray, - options?: PipelineOptions, - ): Promise; - function __promisify__( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, - ...streams: Array - ): Promise; - } - interface Pipe { - close(): void; - hasRef(): boolean; - ref(): void; - unref(): void; - } - /** - * Returns whether the stream has encountered an error. - * @since v17.3.0, v16.14.0 - * @experimental - */ - function isErrored(stream: Readable | Writable | NodeJS.ReadableStream | NodeJS.WritableStream): boolean; - /** - * Returns whether the stream is readable. - * @since v17.4.0, v16.14.0 - * @experimental - */ - function isReadable(stream: Readable | NodeJS.ReadableStream): boolean; - const promises: typeof streamPromises; - const consumers: typeof streamConsumers; - } - export = internal; -} -declare module "node:stream" { - import stream = require("stream"); - export = stream; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/stream/consumers.d.ts b/tools/mnemonic-test/node_modules/@types/node/stream/consumers.d.ts deleted file mode 100644 index 5ad9cbab..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/stream/consumers.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -declare module "stream/consumers" { - import { Blob as NodeBlob } from "node:buffer"; - import { Readable } from "node:stream"; - function buffer(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; - function text(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; - function arrayBuffer(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; - function blob(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; - function json(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; -} -declare module "node:stream/consumers" { - export * from "stream/consumers"; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/stream/promises.d.ts b/tools/mnemonic-test/node_modules/@types/node/stream/promises.d.ts deleted file mode 100644 index 6eac5b71..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/stream/promises.d.ts +++ /dev/null @@ -1,83 +0,0 @@ -declare module "stream/promises" { - import { - FinishedOptions, - PipelineDestination, - PipelineOptions, - PipelinePromise, - PipelineSource, - PipelineTransform, - } from "node:stream"; - function finished( - stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, - options?: FinishedOptions, - ): Promise; - function pipeline, B extends PipelineDestination>( - source: A, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - T4 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - transform4: T4, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function pipeline( - streams: ReadonlyArray, - options?: PipelineOptions, - ): Promise; - function pipeline( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, - ...streams: Array - ): Promise; -} -declare module "node:stream/promises" { - export * from "stream/promises"; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/stream/web.d.ts b/tools/mnemonic-test/node_modules/@types/node/stream/web.d.ts deleted file mode 100644 index cb890ba1..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/stream/web.d.ts +++ /dev/null @@ -1,606 +0,0 @@ -type _ByteLengthQueuingStrategy = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").ByteLengthQueuingStrategy; -type _CompressionStream = typeof globalThis extends { onmessage: any; ReportingObserver: any } ? {} - : import("stream/web").CompressionStream; -type _CountQueuingStrategy = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").CountQueuingStrategy; -type _DecompressionStream = typeof globalThis extends { onmessage: any; ReportingObserver: any } ? {} - : import("stream/web").DecompressionStream; -type _ReadableByteStreamController = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").ReadableByteStreamController; -type _ReadableStream = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").ReadableStream; -type _ReadableStreamBYOBReader = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").ReadableStreamBYOBReader; -type _ReadableStreamBYOBRequest = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").ReadableStreamBYOBRequest; -type _ReadableStreamDefaultController = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").ReadableStreamDefaultController; -type _ReadableStreamDefaultReader = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").ReadableStreamDefaultReader; -type _TextDecoderStream = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").TextDecoderStream; -type _TextEncoderStream = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").TextEncoderStream; -type _TransformStream = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").TransformStream; -type _TransformStreamDefaultController = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").TransformStreamDefaultController; -type _WritableStream = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").WritableStream; -type _WritableStreamDefaultController = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").WritableStreamDefaultController; -type _WritableStreamDefaultWriter = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").WritableStreamDefaultWriter; - -declare module "stream/web" { - // stub module, pending copy&paste from .d.ts or manual impl - // copy from lib.dom.d.ts - interface ReadableWritablePair { - readable: ReadableStream; - /** - * Provides a convenient, chainable way of piping this readable stream - * through a transform stream (or any other { writable, readable } - * pair). It simply pipes the stream into the writable side of the - * supplied pair, and returns the readable side for further use. - * - * Piping a stream will lock it for the duration of the pipe, preventing - * any other consumer from acquiring a reader. - */ - writable: WritableStream; - } - interface StreamPipeOptions { - preventAbort?: boolean; - preventCancel?: boolean; - /** - * Pipes this readable stream to a given writable stream destination. - * The way in which the piping process behaves under various error - * conditions can be customized with a number of passed options. It - * returns a promise that fulfills when the piping process completes - * successfully, or rejects if any errors were encountered. - * - * Piping a stream will lock it for the duration of the pipe, preventing - * any other consumer from acquiring a reader. - * - * Errors and closures of the source and destination streams propagate - * as follows: - * - * An error in this source readable stream will abort destination, - * unless preventAbort is truthy. The returned promise will be rejected - * with the source's error, or with any error that occurs during - * aborting the destination. - * - * An error in destination will cancel this source readable stream, - * unless preventCancel is truthy. The returned promise will be rejected - * with the destination's error, or with any error that occurs during - * canceling the source. - * - * When this source readable stream closes, destination will be closed, - * unless preventClose is truthy. The returned promise will be fulfilled - * once this process completes, unless an error is encountered while - * closing the destination, in which case it will be rejected with that - * error. - * - * If destination starts out closed or closing, this source readable - * stream will be canceled, unless preventCancel is true. The returned - * promise will be rejected with an error indicating piping to a closed - * stream failed, or with any error that occurs during canceling the - * source. - * - * The signal option can be set to an AbortSignal to allow aborting an - * ongoing pipe operation via the corresponding AbortController. In this - * case, this source readable stream will be canceled, and destination - * aborted, unless the respective options preventCancel or preventAbort - * are set. - */ - preventClose?: boolean; - signal?: AbortSignal; - } - interface ReadableStreamGenericReader { - readonly closed: Promise; - cancel(reason?: any): Promise; - } - type ReadableStreamController = ReadableStreamDefaultController; - interface ReadableStreamReadValueResult { - done: false; - value: T; - } - interface ReadableStreamReadDoneResult { - done: true; - value?: T; - } - type ReadableStreamReadResult = ReadableStreamReadValueResult | ReadableStreamReadDoneResult; - interface ReadableByteStreamControllerCallback { - (controller: ReadableByteStreamController): void | PromiseLike; - } - interface UnderlyingSinkAbortCallback { - (reason?: any): void | PromiseLike; - } - interface UnderlyingSinkCloseCallback { - (): void | PromiseLike; - } - interface UnderlyingSinkStartCallback { - (controller: WritableStreamDefaultController): any; - } - interface UnderlyingSinkWriteCallback { - (chunk: W, controller: WritableStreamDefaultController): void | PromiseLike; - } - interface UnderlyingSourceCancelCallback { - (reason?: any): void | PromiseLike; - } - interface UnderlyingSourcePullCallback { - (controller: ReadableStreamController): void | PromiseLike; - } - interface UnderlyingSourceStartCallback { - (controller: ReadableStreamController): any; - } - interface TransformerFlushCallback { - (controller: TransformStreamDefaultController): void | PromiseLike; - } - interface TransformerStartCallback { - (controller: TransformStreamDefaultController): any; - } - interface TransformerTransformCallback { - (chunk: I, controller: TransformStreamDefaultController): void | PromiseLike; - } - interface UnderlyingByteSource { - autoAllocateChunkSize?: number; - cancel?: ReadableStreamErrorCallback; - pull?: ReadableByteStreamControllerCallback; - start?: ReadableByteStreamControllerCallback; - type: "bytes"; - } - interface UnderlyingSource { - cancel?: UnderlyingSourceCancelCallback; - pull?: UnderlyingSourcePullCallback; - start?: UnderlyingSourceStartCallback; - type?: undefined; - } - interface UnderlyingSink { - abort?: UnderlyingSinkAbortCallback; - close?: UnderlyingSinkCloseCallback; - start?: UnderlyingSinkStartCallback; - type?: undefined; - write?: UnderlyingSinkWriteCallback; - } - interface ReadableStreamErrorCallback { - (reason: any): void | PromiseLike; - } - /** This Streams API interface represents a readable stream of byte data. */ - interface ReadableStream { - readonly locked: boolean; - cancel(reason?: any): Promise; - getReader(options: { mode: "byob" }): ReadableStreamBYOBReader; - getReader(): ReadableStreamDefaultReader; - getReader(options?: ReadableStreamGetReaderOptions): ReadableStreamReader; - pipeThrough(transform: ReadableWritablePair, options?: StreamPipeOptions): ReadableStream; - pipeTo(destination: WritableStream, options?: StreamPipeOptions): Promise; - tee(): [ReadableStream, ReadableStream]; - values(options?: { preventCancel?: boolean }): AsyncIterableIterator; - [Symbol.asyncIterator](): AsyncIterableIterator; - } - const ReadableStream: { - prototype: ReadableStream; - from(iterable: Iterable | AsyncIterable): ReadableStream; - new(underlyingSource: UnderlyingByteSource, strategy?: QueuingStrategy): ReadableStream; - new(underlyingSource?: UnderlyingSource, strategy?: QueuingStrategy): ReadableStream; - }; - type ReadableStreamReaderMode = "byob"; - interface ReadableStreamGetReaderOptions { - /** - * Creates a ReadableStreamBYOBReader and locks the stream to the new reader. - * - * This call behaves the same way as the no-argument variant, except that it only works on readable byte streams, i.e. streams which were constructed specifically with the ability to handle "bring your own buffer" reading. The returned BYOB reader provides the ability to directly read individual chunks from the stream via its read() method, into developer-supplied buffers, allowing more precise control over allocation. - */ - mode?: ReadableStreamReaderMode; - } - type ReadableStreamReader = ReadableStreamDefaultReader | ReadableStreamBYOBReader; - interface ReadableStreamDefaultReader extends ReadableStreamGenericReader { - read(): Promise>; - releaseLock(): void; - } - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader) */ - interface ReadableStreamBYOBReader extends ReadableStreamGenericReader { - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */ - read(view: T): Promise>; - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */ - releaseLock(): void; - } - const ReadableStreamDefaultReader: { - prototype: ReadableStreamDefaultReader; - new(stream: ReadableStream): ReadableStreamDefaultReader; - }; - const ReadableStreamBYOBReader: { - prototype: ReadableStreamBYOBReader; - new(stream: ReadableStream): ReadableStreamBYOBReader; - }; - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) */ - interface ReadableStreamBYOBRequest { - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) */ - readonly view: ArrayBufferView | null; - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond) */ - respond(bytesWritten: number): void; - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView) */ - respondWithNewView(view: ArrayBufferView): void; - } - const ReadableStreamBYOBRequest: { - prototype: ReadableStreamBYOBRequest; - new(): ReadableStreamBYOBRequest; - }; - interface ReadableByteStreamController { - readonly byobRequest: undefined; - readonly desiredSize: number | null; - close(): void; - enqueue(chunk: ArrayBufferView): void; - error(error?: any): void; - } - const ReadableByteStreamController: { - prototype: ReadableByteStreamController; - new(): ReadableByteStreamController; - }; - interface ReadableStreamDefaultController { - readonly desiredSize: number | null; - close(): void; - enqueue(chunk?: R): void; - error(e?: any): void; - } - const ReadableStreamDefaultController: { - prototype: ReadableStreamDefaultController; - new(): ReadableStreamDefaultController; - }; - interface Transformer { - flush?: TransformerFlushCallback; - readableType?: undefined; - start?: TransformerStartCallback; - transform?: TransformerTransformCallback; - writableType?: undefined; - } - interface TransformStream { - readonly readable: ReadableStream; - readonly writable: WritableStream; - } - const TransformStream: { - prototype: TransformStream; - new( - transformer?: Transformer, - writableStrategy?: QueuingStrategy, - readableStrategy?: QueuingStrategy, - ): TransformStream; - }; - interface TransformStreamDefaultController { - readonly desiredSize: number | null; - enqueue(chunk?: O): void; - error(reason?: any): void; - terminate(): void; - } - const TransformStreamDefaultController: { - prototype: TransformStreamDefaultController; - new(): TransformStreamDefaultController; - }; - /** - * This Streams API interface provides a standard abstraction for writing - * streaming data to a destination, known as a sink. This object comes with - * built-in back pressure and queuing. - */ - interface WritableStream { - readonly locked: boolean; - abort(reason?: any): Promise; - close(): Promise; - getWriter(): WritableStreamDefaultWriter; - } - const WritableStream: { - prototype: WritableStream; - new(underlyingSink?: UnderlyingSink, strategy?: QueuingStrategy): WritableStream; - }; - /** - * This Streams API interface is the object returned by - * WritableStream.getWriter() and once created locks the < writer to the - * WritableStream ensuring that no other streams can write to the underlying - * sink. - */ - interface WritableStreamDefaultWriter { - readonly closed: Promise; - readonly desiredSize: number | null; - readonly ready: Promise; - abort(reason?: any): Promise; - close(): Promise; - releaseLock(): void; - write(chunk?: W): Promise; - } - const WritableStreamDefaultWriter: { - prototype: WritableStreamDefaultWriter; - new(stream: WritableStream): WritableStreamDefaultWriter; - }; - /** - * This Streams API interface represents a controller allowing control of a - * WritableStream's state. When constructing a WritableStream, the - * underlying sink is given a corresponding WritableStreamDefaultController - * instance to manipulate. - */ - interface WritableStreamDefaultController { - error(e?: any): void; - } - const WritableStreamDefaultController: { - prototype: WritableStreamDefaultController; - new(): WritableStreamDefaultController; - }; - interface QueuingStrategy { - highWaterMark?: number; - size?: QueuingStrategySize; - } - interface QueuingStrategySize { - (chunk?: T): number; - } - interface QueuingStrategyInit { - /** - * Creates a new ByteLengthQueuingStrategy with the provided high water - * mark. - * - * Note that the provided high water mark will not be validated ahead of - * time. Instead, if it is negative, NaN, or not a number, the resulting - * ByteLengthQueuingStrategy will cause the corresponding stream - * constructor to throw. - */ - highWaterMark: number; - } - /** - * This Streams API interface provides a built-in byte length queuing - * strategy that can be used when constructing streams. - */ - interface ByteLengthQueuingStrategy extends QueuingStrategy { - readonly highWaterMark: number; - readonly size: QueuingStrategySize; - } - const ByteLengthQueuingStrategy: { - prototype: ByteLengthQueuingStrategy; - new(init: QueuingStrategyInit): ByteLengthQueuingStrategy; - }; - /** - * This Streams API interface provides a built-in byte length queuing - * strategy that can be used when constructing streams. - */ - interface CountQueuingStrategy extends QueuingStrategy { - readonly highWaterMark: number; - readonly size: QueuingStrategySize; - } - const CountQueuingStrategy: { - prototype: CountQueuingStrategy; - new(init: QueuingStrategyInit): CountQueuingStrategy; - }; - interface TextEncoderStream { - /** Returns "utf-8". */ - readonly encoding: "utf-8"; - readonly readable: ReadableStream; - readonly writable: WritableStream; - readonly [Symbol.toStringTag]: string; - } - const TextEncoderStream: { - prototype: TextEncoderStream; - new(): TextEncoderStream; - }; - interface TextDecoderOptions { - fatal?: boolean; - ignoreBOM?: boolean; - } - type BufferSource = ArrayBufferView | ArrayBuffer; - interface TextDecoderStream { - /** Returns encoding's name, lower cased. */ - readonly encoding: string; - /** Returns `true` if error mode is "fatal", and `false` otherwise. */ - readonly fatal: boolean; - /** Returns `true` if ignore BOM flag is set, and `false` otherwise. */ - readonly ignoreBOM: boolean; - readonly readable: ReadableStream; - readonly writable: WritableStream; - readonly [Symbol.toStringTag]: string; - } - const TextDecoderStream: { - prototype: TextDecoderStream; - new(encoding?: string, options?: TextDecoderOptions): TextDecoderStream; - }; - interface CompressionStream { - readonly readable: ReadableStream; - readonly writable: WritableStream; - } - const CompressionStream: { - prototype: CompressionStream; - new(format: "deflate" | "deflate-raw" | "gzip"): CompressionStream; - }; - interface DecompressionStream { - readonly writable: WritableStream; - readonly readable: ReadableStream; - } - const DecompressionStream: { - prototype: DecompressionStream; - new(format: "deflate" | "deflate-raw" | "gzip"): DecompressionStream; - }; - - global { - interface ByteLengthQueuingStrategy extends _ByteLengthQueuingStrategy {} - /** - * `ByteLengthQueuingStrategy` class is a global reference for `import { ByteLengthQueuingStrategy } from 'node:stream/web'`. - * https://nodejs.org/api/globals.html#class-bytelengthqueuingstrategy - * @since v18.0.0 - */ - var ByteLengthQueuingStrategy: typeof globalThis extends { onmessage: any; ByteLengthQueuingStrategy: infer T } - ? T - : typeof import("stream/web").ByteLengthQueuingStrategy; - - interface CompressionStream extends _CompressionStream {} - /** - * `CompressionStream` class is a global reference for `import { CompressionStream } from 'node:stream/web'`. - * https://nodejs.org/api/globals.html#class-compressionstream - * @since v18.0.0 - */ - var CompressionStream: typeof globalThis extends { - onmessage: any; - // CompressionStream, DecompressionStream and ReportingObserver was introduced in the same commit. - // If ReportingObserver check is removed, the type here will form a circular reference in TS5.0+lib.dom.d.ts - ReportingObserver: any; - CompressionStream: infer T; - } ? T - // TS 4.8, 4.9, 5.0 - : typeof globalThis extends { onmessage: any; TransformStream: { prototype: infer T } } ? { - prototype: T; - new(format: "deflate" | "deflate-raw" | "gzip"): T; - } - : typeof import("stream/web").CompressionStream; - - interface CountQueuingStrategy extends _CountQueuingStrategy {} - /** - * `CountQueuingStrategy` class is a global reference for `import { CountQueuingStrategy } from 'node:stream/web'`. - * https://nodejs.org/api/globals.html#class-countqueuingstrategy - * @since v18.0.0 - */ - var CountQueuingStrategy: typeof globalThis extends { onmessage: any; CountQueuingStrategy: infer T } ? T - : typeof import("stream/web").CountQueuingStrategy; - - interface DecompressionStream extends _DecompressionStream {} - /** - * `DecompressionStream` class is a global reference for `import { DecompressionStream } from 'node:stream/web'`. - * https://nodejs.org/api/globals.html#class-decompressionstream - * @since v18.0.0 - */ - var DecompressionStream: typeof globalThis extends { - onmessage: any; - // CompressionStream, DecompressionStream and ReportingObserver was introduced in the same commit. - // If ReportingObserver check is removed, the type here will form a circular reference in TS5.0+lib.dom.d.ts - ReportingObserver: any; - DecompressionStream: infer T extends object; - } ? T - // TS 4.8, 4.9, 5.0 - : typeof globalThis extends { onmessage: any; TransformStream: { prototype: infer T } } ? { - prototype: T; - new(format: "deflate" | "deflate-raw" | "gzip"): T; - } - : typeof import("stream/web").DecompressionStream; - - interface ReadableByteStreamController extends _ReadableByteStreamController {} - /** - * `ReadableByteStreamController` class is a global reference for `import { ReadableByteStreamController } from 'node:stream/web'`. - * https://nodejs.org/api/globals.html#class-readablebytestreamcontroller - * @since v18.0.0 - */ - var ReadableByteStreamController: typeof globalThis extends - { onmessage: any; ReadableByteStreamController: infer T } ? T - : typeof import("stream/web").ReadableByteStreamController; - - interface ReadableStream extends _ReadableStream {} - /** - * `ReadableStream` class is a global reference for `import { ReadableStream } from 'node:stream/web'`. - * https://nodejs.org/api/globals.html#class-readablestream - * @since v18.0.0 - */ - var ReadableStream: typeof globalThis extends { onmessage: any; ReadableStream: infer T } ? T - : typeof import("stream/web").ReadableStream; - - interface ReadableStreamBYOBReader extends _ReadableStreamBYOBReader {} - /** - * `ReadableStreamBYOBReader` class is a global reference for `import { ReadableStreamBYOBReader } from 'node:stream/web'`. - * https://nodejs.org/api/globals.html#class-readablestreambyobreader - * @since v18.0.0 - */ - var ReadableStreamBYOBReader: typeof globalThis extends { onmessage: any; ReadableStreamBYOBReader: infer T } - ? T - : typeof import("stream/web").ReadableStreamBYOBReader; - - interface ReadableStreamBYOBRequest extends _ReadableStreamBYOBRequest {} - /** - * `ReadableStreamBYOBRequest` class is a global reference for `import { ReadableStreamBYOBRequest } from 'node:stream/web'`. - * https://nodejs.org/api/globals.html#class-readablestreambyobrequest - * @since v18.0.0 - */ - var ReadableStreamBYOBRequest: typeof globalThis extends { onmessage: any; ReadableStreamBYOBRequest: infer T } - ? T - : typeof import("stream/web").ReadableStreamBYOBRequest; - - interface ReadableStreamDefaultController extends _ReadableStreamDefaultController {} - /** - * `ReadableStreamDefaultController` class is a global reference for `import { ReadableStreamDefaultController } from 'node:stream/web'`. - * https://nodejs.org/api/globals.html#class-readablestreamdefaultcontroller - * @since v18.0.0 - */ - var ReadableStreamDefaultController: typeof globalThis extends - { onmessage: any; ReadableStreamDefaultController: infer T } ? T - : typeof import("stream/web").ReadableStreamDefaultController; - - interface ReadableStreamDefaultReader extends _ReadableStreamDefaultReader {} - /** - * `ReadableStreamDefaultReader` class is a global reference for `import { ReadableStreamDefaultReader } from 'node:stream/web'`. - * https://nodejs.org/api/globals.html#class-readablestreamdefaultreader - * @since v18.0.0 - */ - var ReadableStreamDefaultReader: typeof globalThis extends - { onmessage: any; ReadableStreamDefaultReader: infer T } ? T - : typeof import("stream/web").ReadableStreamDefaultReader; - - interface TextDecoderStream extends _TextDecoderStream {} - /** - * `TextDecoderStream` class is a global reference for `import { TextDecoderStream } from 'node:stream/web'`. - * https://nodejs.org/api/globals.html#class-textdecoderstream - * @since v18.0.0 - */ - var TextDecoderStream: typeof globalThis extends { onmessage: any; TextDecoderStream: infer T } ? T - : typeof import("stream/web").TextDecoderStream; - - interface TextEncoderStream extends _TextEncoderStream {} - /** - * `TextEncoderStream` class is a global reference for `import { TextEncoderStream } from 'node:stream/web'`. - * https://nodejs.org/api/globals.html#class-textencoderstream - * @since v18.0.0 - */ - var TextEncoderStream: typeof globalThis extends { onmessage: any; TextEncoderStream: infer T } ? T - : typeof import("stream/web").TextEncoderStream; - - interface TransformStream extends _TransformStream {} - /** - * `TransformStream` class is a global reference for `import { TransformStream } from 'node:stream/web'`. - * https://nodejs.org/api/globals.html#class-transformstream - * @since v18.0.0 - */ - var TransformStream: typeof globalThis extends { onmessage: any; TransformStream: infer T } ? T - : typeof import("stream/web").TransformStream; - - interface TransformStreamDefaultController extends _TransformStreamDefaultController {} - /** - * `TransformStreamDefaultController` class is a global reference for `import { TransformStreamDefaultController } from 'node:stream/web'`. - * https://nodejs.org/api/globals.html#class-transformstreamdefaultcontroller - * @since v18.0.0 - */ - var TransformStreamDefaultController: typeof globalThis extends - { onmessage: any; TransformStreamDefaultController: infer T } ? T - : typeof import("stream/web").TransformStreamDefaultController; - - interface WritableStream extends _WritableStream {} - /** - * `WritableStream` class is a global reference for `import { WritableStream } from 'node:stream/web'`. - * https://nodejs.org/api/globals.html#class-writablestream - * @since v18.0.0 - */ - var WritableStream: typeof globalThis extends { onmessage: any; WritableStream: infer T } ? T - : typeof import("stream/web").WritableStream; - - interface WritableStreamDefaultController extends _WritableStreamDefaultController {} - /** - * `WritableStreamDefaultController` class is a global reference for `import { WritableStreamDefaultController } from 'node:stream/web'`. - * https://nodejs.org/api/globals.html#class-writablestreamdefaultcontroller - * @since v18.0.0 - */ - var WritableStreamDefaultController: typeof globalThis extends - { onmessage: any; WritableStreamDefaultController: infer T } ? T - : typeof import("stream/web").WritableStreamDefaultController; - - interface WritableStreamDefaultWriter extends _WritableStreamDefaultWriter {} - /** - * `WritableStreamDefaultWriter` class is a global reference for `import { WritableStreamDefaultWriter } from 'node:stream/web'`. - * https://nodejs.org/api/globals.html#class-writablestreamdefaultwriter - * @since v18.0.0 - */ - var WritableStreamDefaultWriter: typeof globalThis extends - { onmessage: any; WritableStreamDefaultWriter: infer T } ? T - : typeof import("stream/web").WritableStreamDefaultWriter; - } -} -declare module "node:stream/web" { - export * from "stream/web"; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/string_decoder.d.ts b/tools/mnemonic-test/node_modules/@types/node/string_decoder.d.ts deleted file mode 100644 index 350aace2..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/string_decoder.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -/** - * The `node:string_decoder` module provides an API for decoding `Buffer` objects - * into strings in a manner that preserves encoded multi-byte UTF-8 and UTF-16 - * characters. It can be accessed using: - * - * ```js - * import { StringDecoder } from 'node:string_decoder'; - * ``` - * - * The following example shows the basic use of the `StringDecoder` class. - * - * ```js - * import { StringDecoder } from 'node:string_decoder'; - * const decoder = new StringDecoder('utf8'); - * - * const cent = Buffer.from([0xC2, 0xA2]); - * console.log(decoder.write(cent)); // Prints: ¢ - * - * const euro = Buffer.from([0xE2, 0x82, 0xAC]); - * console.log(decoder.write(euro)); // Prints: € - * ``` - * - * When a `Buffer` instance is written to the `StringDecoder` instance, an - * internal buffer is used to ensure that the decoded string does not contain - * any incomplete multibyte characters. These are held in the buffer until the - * next call to `stringDecoder.write()` or until `stringDecoder.end()` is called. - * - * In the following example, the three UTF-8 encoded bytes of the European Euro - * symbol (`€`) are written over three separate operations: - * - * ```js - * import { StringDecoder } from 'node:string_decoder'; - * const decoder = new StringDecoder('utf8'); - * - * decoder.write(Buffer.from([0xE2])); - * decoder.write(Buffer.from([0x82])); - * console.log(decoder.end(Buffer.from([0xAC]))); // Prints: € - * ``` - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/string_decoder.js) - */ -declare module "string_decoder" { - class StringDecoder { - constructor(encoding?: BufferEncoding); - /** - * Returns a decoded string, ensuring that any incomplete multibyte characters at - * the end of the `Buffer`, or `TypedArray`, or `DataView` are omitted from the - * returned string and stored in an internal buffer for the next call to `stringDecoder.write()` or `stringDecoder.end()`. - * @since v0.1.99 - * @param buffer The bytes to decode. - */ - write(buffer: string | Buffer | NodeJS.ArrayBufferView): string; - /** - * Returns any remaining input stored in the internal buffer as a string. Bytes - * representing incomplete UTF-8 and UTF-16 characters will be replaced with - * substitution characters appropriate for the character encoding. - * - * If the `buffer` argument is provided, one final call to `stringDecoder.write()` is performed before returning the remaining input. - * After `end()` is called, the `stringDecoder` object can be reused for new input. - * @since v0.9.3 - * @param buffer The bytes to decode. - */ - end(buffer?: string | Buffer | NodeJS.ArrayBufferView): string; - } -} -declare module "node:string_decoder" { - export * from "string_decoder"; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/test.d.ts b/tools/mnemonic-test/node_modules/@types/node/test.d.ts deleted file mode 100644 index 42ff08e1..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/test.d.ts +++ /dev/null @@ -1,2098 +0,0 @@ -/** - * The `node:test` module facilitates the creation of JavaScript tests. - * To access it: - * - * ```js - * import test from 'node:test'; - * ``` - * - * This module is only available under the `node:` scheme. The following will not - * work: - * - * ```js - * import test from 'node:test'; - * ``` - * - * Tests created via the `test` module consist of a single function that is - * processed in one of three ways: - * - * 1. A synchronous function that is considered failing if it throws an exception, - * and is considered passing otherwise. - * 2. A function that returns a `Promise` that is considered failing if the `Promise` rejects, and is considered passing if the `Promise` fulfills. - * 3. A function that receives a callback function. If the callback receives any - * truthy value as its first argument, the test is considered failing. If a - * falsy value is passed as the first argument to the callback, the test is - * considered passing. If the test function receives a callback function and - * also returns a `Promise`, the test will fail. - * - * The following example illustrates how tests are written using the `test` module. - * - * ```js - * test('synchronous passing test', (t) => { - * // This test passes because it does not throw an exception. - * assert.strictEqual(1, 1); - * }); - * - * test('synchronous failing test', (t) => { - * // This test fails because it throws an exception. - * assert.strictEqual(1, 2); - * }); - * - * test('asynchronous passing test', async (t) => { - * // This test passes because the Promise returned by the async - * // function is settled and not rejected. - * assert.strictEqual(1, 1); - * }); - * - * test('asynchronous failing test', async (t) => { - * // This test fails because the Promise returned by the async - * // function is rejected. - * assert.strictEqual(1, 2); - * }); - * - * test('failing test using Promises', (t) => { - * // Promises can be used directly as well. - * return new Promise((resolve, reject) => { - * setImmediate(() => { - * reject(new Error('this will cause the test to fail')); - * }); - * }); - * }); - * - * test('callback passing test', (t, done) => { - * // done() is the callback function. When the setImmediate() runs, it invokes - * // done() with no arguments. - * setImmediate(done); - * }); - * - * test('callback failing test', (t, done) => { - * // When the setImmediate() runs, done() is invoked with an Error object and - * // the test fails. - * setImmediate(() => { - * done(new Error('callback failure')); - * }); - * }); - * ``` - * - * If any tests fail, the process exit code is set to `1`. - * @since v18.0.0, v16.17.0 - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/test.js) - */ -declare module "node:test" { - import { Readable } from "node:stream"; - /** - * **Note:** `shard` is used to horizontally parallelize test running across - * machines or processes, ideal for large-scale executions across varied - * environments. It's incompatible with `watch` mode, tailored for rapid - * code iteration by automatically rerunning tests on file changes. - * - * ```js - * import { tap } from 'node:test/reporters'; - * import { run } from 'node:test'; - * import process from 'node:process'; - * import path from 'node:path'; - * - * run({ files: [path.resolve('./tests/test.js')] }) - * .compose(tap) - * .pipe(process.stdout); - * ``` - * @since v18.9.0, v16.19.0 - * @param options Configuration options for running tests. - */ - function run(options?: RunOptions): TestsStream; - /** - * The `test()` function is the value imported from the `test` module. Each - * invocation of this function results in reporting the test to the `TestsStream`. - * - * The `TestContext` object passed to the `fn` argument can be used to perform - * actions related to the current test. Examples include skipping the test, adding - * additional diagnostic information, or creating subtests. - * - * `test()` returns a `Promise` that fulfills once the test completes. - * if `test()` is called within a suite, it fulfills immediately. - * The return value can usually be discarded for top level tests. - * However, the return value from subtests should be used to prevent the parent - * test from finishing first and cancelling the subtest - * as shown in the following example. - * - * ```js - * test('top level test', async (t) => { - * // The setTimeout() in the following subtest would cause it to outlive its - * // parent test if 'await' is removed on the next line. Once the parent test - * // completes, it will cancel any outstanding subtests. - * await t.test('longer running subtest', async (t) => { - * return new Promise((resolve, reject) => { - * setTimeout(resolve, 1000); - * }); - * }); - * }); - * ``` - * - * The `timeout` option can be used to fail the test if it takes longer than `timeout` milliseconds to complete. However, it is not a reliable mechanism for - * canceling tests because a running test might block the application thread and - * thus prevent the scheduled cancellation. - * @since v18.0.0, v16.17.0 - * @param name The name of the test, which is displayed when reporting test results. - * Defaults to the `name` property of `fn`, or `''` if `fn` does not have a name. - * @param options Configuration options for the test. - * @param fn The function under test. The first argument to this function is a {@link TestContext} object. - * If the test uses callbacks, the callback function is passed as the second argument. - * @return Fulfilled with `undefined` once the test completes, or immediately if the test runs within a suite. - */ - function test(name?: string, fn?: TestFn): Promise; - function test(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function test(options?: TestOptions, fn?: TestFn): Promise; - function test(fn?: TestFn): Promise; - namespace test { - export { - after, - afterEach, - before, - beforeEach, - describe, - it, - mock, - only, - run, - skip, - snapshot, - suite, - test, - todo, - }; - } - /** - * The `suite()` function is imported from the `node:test` module. - * @param name The name of the suite, which is displayed when reporting test results. - * Defaults to the `name` property of `fn`, or `''` if `fn` does not have a name. - * @param options Configuration options for the suite. This supports the same options as {@link test}. - * @param fn The suite function declaring nested tests and suites. The first argument to this function is a {@link SuiteContext} object. - * @return Immediately fulfilled with `undefined`. - * @since v20.13.0 - */ - function suite(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; - function suite(name?: string, fn?: SuiteFn): Promise; - function suite(options?: TestOptions, fn?: SuiteFn): Promise; - function suite(fn?: SuiteFn): Promise; - namespace suite { - /** - * Shorthand for skipping a suite. This is the same as calling {@link suite} with `options.skip` set to `true`. - * @since v20.13.0 - */ - function skip(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; - function skip(name?: string, fn?: SuiteFn): Promise; - function skip(options?: TestOptions, fn?: SuiteFn): Promise; - function skip(fn?: SuiteFn): Promise; - /** - * Shorthand for marking a suite as `TODO`. This is the same as calling {@link suite} with `options.todo` set to `true`. - * @since v20.13.0 - */ - function todo(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; - function todo(name?: string, fn?: SuiteFn): Promise; - function todo(options?: TestOptions, fn?: SuiteFn): Promise; - function todo(fn?: SuiteFn): Promise; - /** - * Shorthand for marking a suite as `only`. This is the same as calling {@link suite} with `options.only` set to `true`. - * @since v20.13.0 - */ - function only(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; - function only(name?: string, fn?: SuiteFn): Promise; - function only(options?: TestOptions, fn?: SuiteFn): Promise; - function only(fn?: SuiteFn): Promise; - } - /** - * Alias for {@link suite}. - * - * The `describe()` function is imported from the `node:test` module. - */ - function describe(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; - function describe(name?: string, fn?: SuiteFn): Promise; - function describe(options?: TestOptions, fn?: SuiteFn): Promise; - function describe(fn?: SuiteFn): Promise; - namespace describe { - /** - * Shorthand for skipping a suite. This is the same as calling {@link describe} with `options.skip` set to `true`. - * @since v18.15.0 - */ - function skip(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; - function skip(name?: string, fn?: SuiteFn): Promise; - function skip(options?: TestOptions, fn?: SuiteFn): Promise; - function skip(fn?: SuiteFn): Promise; - /** - * Shorthand for marking a suite as `TODO`. This is the same as calling {@link describe} with `options.todo` set to `true`. - * @since v18.15.0 - */ - function todo(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; - function todo(name?: string, fn?: SuiteFn): Promise; - function todo(options?: TestOptions, fn?: SuiteFn): Promise; - function todo(fn?: SuiteFn): Promise; - /** - * Shorthand for marking a suite as `only`. This is the same as calling {@link describe} with `options.only` set to `true`. - * @since v18.15.0 - */ - function only(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; - function only(name?: string, fn?: SuiteFn): Promise; - function only(options?: TestOptions, fn?: SuiteFn): Promise; - function only(fn?: SuiteFn): Promise; - } - /** - * Alias for {@link test}. - * - * The `it()` function is imported from the `node:test` module. - * @since v18.6.0, v16.17.0 - */ - function it(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function it(name?: string, fn?: TestFn): Promise; - function it(options?: TestOptions, fn?: TestFn): Promise; - function it(fn?: TestFn): Promise; - namespace it { - /** - * Shorthand for skipping a test. This is the same as calling {@link it} with `options.skip` set to `true`. - */ - function skip(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function skip(name?: string, fn?: TestFn): Promise; - function skip(options?: TestOptions, fn?: TestFn): Promise; - function skip(fn?: TestFn): Promise; - /** - * Shorthand for marking a test as `TODO`. This is the same as calling {@link it} with `options.todo` set to `true`. - */ - function todo(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function todo(name?: string, fn?: TestFn): Promise; - function todo(options?: TestOptions, fn?: TestFn): Promise; - function todo(fn?: TestFn): Promise; - /** - * Shorthand for marking a test as `only`. This is the same as calling {@link it} with `options.only` set to `true`. - * @since v18.15.0 - */ - function only(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function only(name?: string, fn?: TestFn): Promise; - function only(options?: TestOptions, fn?: TestFn): Promise; - function only(fn?: TestFn): Promise; - } - /** - * Shorthand for skipping a test. This is the same as calling {@link test} with `options.skip` set to `true`. - * @since v20.2.0 - */ - function skip(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function skip(name?: string, fn?: TestFn): Promise; - function skip(options?: TestOptions, fn?: TestFn): Promise; - function skip(fn?: TestFn): Promise; - /** - * Shorthand for marking a test as `TODO`. This is the same as calling {@link test} with `options.todo` set to `true`. - * @since v20.2.0 - */ - function todo(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function todo(name?: string, fn?: TestFn): Promise; - function todo(options?: TestOptions, fn?: TestFn): Promise; - function todo(fn?: TestFn): Promise; - /** - * Shorthand for marking a test as `only`. This is the same as calling {@link test} with `options.only` set to `true`. - * @since v20.2.0 - */ - function only(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function only(name?: string, fn?: TestFn): Promise; - function only(options?: TestOptions, fn?: TestFn): Promise; - function only(fn?: TestFn): Promise; - /** - * The type of a function passed to {@link test}. The first argument to this function is a {@link TestContext} object. - * If the test uses callbacks, the callback function is passed as the second argument. - */ - type TestFn = (t: TestContext, done: (result?: any) => void) => void | Promise; - /** - * The type of a suite test function. The argument to this function is a {@link SuiteContext} object. - */ - type SuiteFn = (s: SuiteContext) => void | Promise; - interface TestShard { - /** - * A positive integer between 1 and `total` that specifies the index of the shard to run. - */ - index: number; - /** - * A positive integer that specifies the total number of shards to split the test files to. - */ - total: number; - } - interface RunOptions { - /** - * If a number is provided, then that many test processes would run in parallel, where each process corresponds to one test file. - * If `true`, it would run `os.availableParallelism() - 1` test files in parallel. If `false`, it would only run one test file at a time. - * @default false - */ - concurrency?: number | boolean | undefined; - /** - * An array containing the list of files to run. If omitted, files are run according to the - * [test runner execution model](https://nodejs.org/docs/latest-v22.x/api/test.html#test-runner-execution-model). - */ - files?: readonly string[] | undefined; - /** - * Configures the test runner to exit the process once all known - * tests have finished executing even if the event loop would - * otherwise remain active. - * @default false - */ - forceExit?: boolean | undefined; - /** - * An array containing the list of glob patterns to match test files. - * This option cannot be used together with `files`. If omitted, files are run according to the - * [test runner execution model](https://nodejs.org/docs/latest-v22.x/api/test.html#test-runner-execution-model). - * @since v22.6.0 - */ - globPatterns?: readonly string[] | undefined; - /** - * Sets inspector port of test child process. - * If a nullish value is provided, each process gets its own port, - * incremented from the primary's `process.debugPort`. - * @default undefined - */ - inspectPort?: number | (() => number) | undefined; - /** - * If truthy, the test context will only run tests that have the `only` option set - */ - only?: boolean | undefined; - /** - * A function that accepts the `TestsStream` instance and can be used to setup listeners before any tests are run. - * @default undefined - */ - setup?: ((reporter: TestsStream) => void | Promise) | undefined; - /** - * Allows aborting an in-progress test execution. - */ - signal?: AbortSignal | undefined; - /** - * If provided, only run tests whose name matches the provided pattern. - * Strings are interpreted as JavaScript regular expressions. - * @default undefined - */ - testNamePatterns?: string | RegExp | ReadonlyArray | undefined; - /** - * A String, RegExp or a RegExp Array, that can be used to exclude running tests whose - * name matches the provided pattern. Test name patterns are interpreted as JavaScript - * regular expressions. For each test that is executed, any corresponding test hooks, - * such as `beforeEach()`, are also run. - * @default undefined - * @since v22.1.0 - */ - testSkipPatterns?: string | RegExp | ReadonlyArray | undefined; - /** - * The number of milliseconds after which the test execution will fail. - * If unspecified, subtests inherit this value from their parent. - * @default Infinity - */ - timeout?: number | undefined; - /** - * Whether to run in watch mode or not. - * @default false - */ - watch?: boolean | undefined; - /** - * Running tests in a specific shard. - * @default undefined - */ - shard?: TestShard | undefined; - } - /** - * A successful call to `run()` will return a new `TestsStream` object, streaming a series of events representing the execution of the tests. - * - * Some of the events are guaranteed to be emitted in the same order as the tests are defined, while others are emitted in the order that the tests execute. - * @since v18.9.0, v16.19.0 - */ - class TestsStream extends Readable implements NodeJS.ReadableStream { - addListener(event: "test:coverage", listener: (data: TestCoverage) => void): this; - addListener(event: "test:complete", listener: (data: TestComplete) => void): this; - addListener(event: "test:dequeue", listener: (data: TestDequeue) => void): this; - addListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this; - addListener(event: "test:enqueue", listener: (data: TestEnqueue) => void): this; - addListener(event: "test:fail", listener: (data: TestFail) => void): this; - addListener(event: "test:pass", listener: (data: TestPass) => void): this; - addListener(event: "test:plan", listener: (data: TestPlan) => void): this; - addListener(event: "test:start", listener: (data: TestStart) => void): this; - addListener(event: "test:stderr", listener: (data: TestStderr) => void): this; - addListener(event: "test:stdout", listener: (data: TestStdout) => void): this; - addListener(event: "test:watch:drained", listener: () => void): this; - addListener(event: string, listener: (...args: any[]) => void): this; - emit(event: "test:coverage", data: TestCoverage): boolean; - emit(event: "test:complete", data: TestComplete): boolean; - emit(event: "test:dequeue", data: TestDequeue): boolean; - emit(event: "test:diagnostic", data: DiagnosticData): boolean; - emit(event: "test:enqueue", data: TestEnqueue): boolean; - emit(event: "test:fail", data: TestFail): boolean; - emit(event: "test:pass", data: TestPass): boolean; - emit(event: "test:plan", data: TestPlan): boolean; - emit(event: "test:start", data: TestStart): boolean; - emit(event: "test:stderr", data: TestStderr): boolean; - emit(event: "test:stdout", data: TestStdout): boolean; - emit(event: "test:watch:drained"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "test:coverage", listener: (data: TestCoverage) => void): this; - on(event: "test:complete", listener: (data: TestComplete) => void): this; - on(event: "test:dequeue", listener: (data: TestDequeue) => void): this; - on(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this; - on(event: "test:enqueue", listener: (data: TestEnqueue) => void): this; - on(event: "test:fail", listener: (data: TestFail) => void): this; - on(event: "test:pass", listener: (data: TestPass) => void): this; - on(event: "test:plan", listener: (data: TestPlan) => void): this; - on(event: "test:start", listener: (data: TestStart) => void): this; - on(event: "test:stderr", listener: (data: TestStderr) => void): this; - on(event: "test:stdout", listener: (data: TestStdout) => void): this; - on(event: "test:watch:drained", listener: () => void): this; - on(event: string, listener: (...args: any[]) => void): this; - once(event: "test:coverage", listener: (data: TestCoverage) => void): this; - once(event: "test:complete", listener: (data: TestComplete) => void): this; - once(event: "test:dequeue", listener: (data: TestDequeue) => void): this; - once(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this; - once(event: "test:enqueue", listener: (data: TestEnqueue) => void): this; - once(event: "test:fail", listener: (data: TestFail) => void): this; - once(event: "test:pass", listener: (data: TestPass) => void): this; - once(event: "test:plan", listener: (data: TestPlan) => void): this; - once(event: "test:start", listener: (data: TestStart) => void): this; - once(event: "test:stderr", listener: (data: TestStderr) => void): this; - once(event: "test:stdout", listener: (data: TestStdout) => void): this; - once(event: "test:watch:drained", listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "test:coverage", listener: (data: TestCoverage) => void): this; - prependListener(event: "test:complete", listener: (data: TestComplete) => void): this; - prependListener(event: "test:dequeue", listener: (data: TestDequeue) => void): this; - prependListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this; - prependListener(event: "test:enqueue", listener: (data: TestEnqueue) => void): this; - prependListener(event: "test:fail", listener: (data: TestFail) => void): this; - prependListener(event: "test:pass", listener: (data: TestPass) => void): this; - prependListener(event: "test:plan", listener: (data: TestPlan) => void): this; - prependListener(event: "test:start", listener: (data: TestStart) => void): this; - prependListener(event: "test:stderr", listener: (data: TestStderr) => void): this; - prependListener(event: "test:stdout", listener: (data: TestStdout) => void): this; - prependListener(event: "test:watch:drained", listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "test:coverage", listener: (data: TestCoverage) => void): this; - prependOnceListener(event: "test:complete", listener: (data: TestComplete) => void): this; - prependOnceListener(event: "test:dequeue", listener: (data: TestDequeue) => void): this; - prependOnceListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this; - prependOnceListener(event: "test:enqueue", listener: (data: TestEnqueue) => void): this; - prependOnceListener(event: "test:fail", listener: (data: TestFail) => void): this; - prependOnceListener(event: "test:pass", listener: (data: TestPass) => void): this; - prependOnceListener(event: "test:plan", listener: (data: TestPlan) => void): this; - prependOnceListener(event: "test:start", listener: (data: TestStart) => void): this; - prependOnceListener(event: "test:stderr", listener: (data: TestStderr) => void): this; - prependOnceListener(event: "test:stdout", listener: (data: TestStdout) => void): this; - prependOnceListener(event: "test:watch:drained", listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - } - /** - * An instance of `TestContext` is passed to each test function in order to - * interact with the test runner. However, the `TestContext` constructor is not - * exposed as part of the API. - * @since v18.0.0, v16.17.0 - */ - class TestContext { - /** - * An object containing assertion methods bound to the test context. - * The top-level functions from the `node:assert` module are exposed here for the purpose of creating test plans. - * @since v22.2.0, v20.15.0 - */ - readonly assert: TestContextAssert; - /** - * This function is used to create a hook running before subtest of the current test. - * @param fn The hook function. The first argument to this function is a `TestContext` object. - * If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. - * @since v20.1.0, v18.17.0 - */ - before(fn?: TestContextHookFn, options?: HookOptions): void; - /** - * This function is used to create a hook running before each subtest of the current test. - * @param fn The hook function. The first argument to this function is a `TestContext` object. - * If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. - * @since v18.8.0 - */ - beforeEach(fn?: TestContextHookFn, options?: HookOptions): void; - /** - * This function is used to create a hook that runs after the current test finishes. - * @param fn The hook function. The first argument to this function is a `TestContext` object. - * If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. - * @since v18.13.0 - */ - after(fn?: TestContextHookFn, options?: HookOptions): void; - /** - * This function is used to create a hook running after each subtest of the current test. - * @param fn The hook function. The first argument to this function is a `TestContext` object. - * If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. - * @since v18.8.0 - */ - afterEach(fn?: TestContextHookFn, options?: HookOptions): void; - /** - * This function is used to write diagnostics to the output. Any diagnostic - * information is included at the end of the test's results. This function does - * not return a value. - * - * ```js - * test('top level test', (t) => { - * t.diagnostic('A diagnostic message'); - * }); - * ``` - * @since v18.0.0, v16.17.0 - * @param message Message to be reported. - */ - diagnostic(message: string): void; - /** - * The absolute path of the test file that created the current test. If a test file imports - * additional modules that generate tests, the imported tests will return the path of the root test file. - * @since v22.6.0 - */ - readonly filePath: string | undefined; - /** - * The name of the test and each of its ancestors, separated by `>`. - * @since v22.3.0 - */ - readonly fullName: string; - /** - * The name of the test. - * @since v18.8.0, v16.18.0 - */ - readonly name: string; - /** - * Used to set the number of assertions and subtests that are expected to run within the test. - * If the number of assertions and subtests that run does not match the expected count, the test will fail. - * - * To make sure assertions are tracked, the assert functions on `context.assert` must be used, - * instead of importing from the `node:assert` module. - * ```js - * test('top level test', (t) => { - * t.plan(2); - * t.assert.ok('some relevant assertion here'); - * t.test('subtest', () => {}); - * }); - * ``` - * - * When working with asynchronous code, the `plan` function can be used to ensure that the correct number of assertions are run: - * ```js - * test('planning with streams', (t, done) => { - * function* generate() { - * yield 'a'; - * yield 'b'; - * yield 'c'; - * } - * const expected = ['a', 'b', 'c']; - * t.plan(expected.length); - * const stream = Readable.from(generate()); - * stream.on('data', (chunk) => { - * t.assert.strictEqual(chunk, expected.shift()); - * }); - * stream.on('end', () => { - * done(); - * }); - * }); - * ``` - * @since v22.2.0 - */ - plan(count: number): void; - /** - * If `shouldRunOnlyTests` is truthy, the test context will only run tests that - * have the `only` option set. Otherwise, all tests are run. If Node.js was not - * started with the `--test-only` command-line option, this function is a - * no-op. - * - * ```js - * test('top level test', (t) => { - * // The test context can be set to run subtests with the 'only' option. - * t.runOnly(true); - * return Promise.all([ - * t.test('this subtest is now skipped'), - * t.test('this subtest is run', { only: true }), - * ]); - * }); - * ``` - * @since v18.0.0, v16.17.0 - * @param shouldRunOnlyTests Whether or not to run `only` tests. - */ - runOnly(shouldRunOnlyTests: boolean): void; - /** - * ```js - * test('top level test', async (t) => { - * await fetch('some/uri', { signal: t.signal }); - * }); - * ``` - * @since v18.7.0, v16.17.0 - */ - readonly signal: AbortSignal; - /** - * This function causes the test's output to indicate the test as skipped. If `message` is provided, it is included in the output. Calling `skip()` does - * not terminate execution of the test function. This function does not return a - * value. - * - * ```js - * test('top level test', (t) => { - * // Make sure to return here as well if the test contains additional logic. - * t.skip('this is skipped'); - * }); - * ``` - * @since v18.0.0, v16.17.0 - * @param message Optional skip message. - */ - skip(message?: string): void; - /** - * This function adds a `TODO` directive to the test's output. If `message` is - * provided, it is included in the output. Calling `todo()` does not terminate - * execution of the test function. This function does not return a value. - * - * ```js - * test('top level test', (t) => { - * // This test is marked as `TODO` - * t.todo('this is a todo'); - * }); - * ``` - * @since v18.0.0, v16.17.0 - * @param message Optional `TODO` message. - */ - todo(message?: string): void; - /** - * This function is used to create subtests under the current test. This function behaves in - * the same fashion as the top level {@link test} function. - * @since v18.0.0 - * @param name The name of the test, which is displayed when reporting test results. - * Defaults to the `name` property of `fn`, or `''` if `fn` does not have a name. - * @param options Configuration options for the test. - * @param fn The function under test. This first argument to this function is a {@link TestContext} object. - * If the test uses callbacks, the callback function is passed as the second argument. - * @returns A {@link Promise} resolved with `undefined` once the test completes. - */ - test: typeof test; - /** - * Each test provides its own MockTracker instance. - */ - readonly mock: MockTracker; - } - interface TestContextAssert { - /** - * Identical to the `deepEqual` function from the `node:assert` module, but bound to the test context. - */ - deepEqual: typeof import("node:assert").deepEqual; - /** - * Identical to the `deepStrictEqual` function from the `node:assert` module, but bound to the test context. - * - * **Note:** as this method returns a type assertion, the context parameter in the callback signature must have a - * type annotation, otherwise an error will be raised by the TypeScript compiler: - * ```ts - * import { test, type TestContext } from 'node:test'; - * - * // The test function's context parameter must have a type annotation. - * test('example', (t: TestContext) => { - * t.assert.deepStrictEqual(actual, expected); - * }); - * - * // Omitting the type annotation will result in a compilation error. - * test('example', t => { - * t.assert.deepStrictEqual(actual, expected); // Error: 't' needs an explicit type annotation. - * }); - * ``` - */ - deepStrictEqual: typeof import("node:assert").deepStrictEqual; - /** - * Identical to the `doesNotMatch` function from the `node:assert` module, but bound to the test context. - */ - doesNotMatch: typeof import("node:assert").doesNotMatch; - /** - * Identical to the `doesNotReject` function from the `node:assert` module, but bound to the test context. - */ - doesNotReject: typeof import("node:assert").doesNotReject; - /** - * Identical to the `doesNotThrow` function from the `node:assert` module, but bound to the test context. - */ - doesNotThrow: typeof import("node:assert").doesNotThrow; - /** - * Identical to the `equal` function from the `node:assert` module, but bound to the test context. - */ - equal: typeof import("node:assert").equal; - /** - * Identical to the `fail` function from the `node:assert` module, but bound to the test context. - */ - fail: typeof import("node:assert").fail; - /** - * Identical to the `ifError` function from the `node:assert` module, but bound to the test context. - * - * **Note:** as this method returns a type assertion, the context parameter in the callback signature must have a - * type annotation, otherwise an error will be raised by the TypeScript compiler: - * ```ts - * import { test, type TestContext } from 'node:test'; - * - * // The test function's context parameter must have a type annotation. - * test('example', (t: TestContext) => { - * t.assert.ifError(err); - * }); - * - * // Omitting the type annotation will result in a compilation error. - * test('example', t => { - * t.assert.ifError(err); // Error: 't' needs an explicit type annotation. - * }); - * ``` - */ - ifError: typeof import("node:assert").ifError; - /** - * Identical to the `match` function from the `node:assert` module, but bound to the test context. - */ - match: typeof import("node:assert").match; - /** - * Identical to the `notDeepEqual` function from the `node:assert` module, but bound to the test context. - */ - notDeepEqual: typeof import("node:assert").notDeepEqual; - /** - * Identical to the `notDeepStrictEqual` function from the `node:assert` module, but bound to the test context. - */ - notDeepStrictEqual: typeof import("node:assert").notDeepStrictEqual; - /** - * Identical to the `notEqual` function from the `node:assert` module, but bound to the test context. - */ - notEqual: typeof import("node:assert").notEqual; - /** - * Identical to the `notStrictEqual` function from the `node:assert` module, but bound to the test context. - */ - notStrictEqual: typeof import("node:assert").notStrictEqual; - /** - * Identical to the `ok` function from the `node:assert` module, but bound to the test context. - * - * **Note:** as this method returns a type assertion, the context parameter in the callback signature must have a - * type annotation, otherwise an error will be raised by the TypeScript compiler: - * ```ts - * import { test, type TestContext } from 'node:test'; - * - * // The test function's context parameter must have a type annotation. - * test('example', (t: TestContext) => { - * t.assert.ok(condition); - * }); - * - * // Omitting the type annotation will result in a compilation error. - * test('example', t => { - * t.assert.ok(condition)); // Error: 't' needs an explicit type annotation. - * }); - * ``` - */ - ok: typeof import("node:assert").ok; - /** - * Identical to the `rejects` function from the `node:assert` module, but bound to the test context. - */ - rejects: typeof import("node:assert").rejects; - /** - * Identical to the `strictEqual` function from the `node:assert` module, but bound to the test context. - * - * **Note:** as this method returns a type assertion, the context parameter in the callback signature must have a - * type annotation, otherwise an error will be raised by the TypeScript compiler: - * ```ts - * import { test, type TestContext } from 'node:test'; - * - * // The test function's context parameter must have a type annotation. - * test('example', (t: TestContext) => { - * t.assert.strictEqual(actual, expected); - * }); - * - * // Omitting the type annotation will result in a compilation error. - * test('example', t => { - * t.assert.strictEqual(actual, expected); // Error: 't' needs an explicit type annotation. - * }); - * ``` - */ - strictEqual: typeof import("node:assert").strictEqual; - /** - * Identical to the `throws` function from the `node:assert` module, but bound to the test context. - */ - throws: typeof import("node:assert").throws; - /** - * This function implements assertions for snapshot testing. - * ```js - * test('snapshot test with default serialization', (t) => { - * t.assert.snapshot({ value1: 1, value2: 2 }); - * }); - * - * test('snapshot test with custom serialization', (t) => { - * t.assert.snapshot({ value3: 3, value4: 4 }, { - * serializers: [(value) => JSON.stringify(value)] - * }); - * }); - * ``` - * - * Only available through the [--experimental-test-snapshots](https://nodejs.org/api/cli.html#--experimental-test-snapshots) flag. - * @since v22.3.0 - * @experimental - */ - snapshot(value: any, options?: AssertSnapshotOptions): void; - } - interface AssertSnapshotOptions { - /** - * An array of synchronous functions used to serialize `value` into a string. - * `value` is passed as the only argument to the first serializer function. - * The return value of each serializer is passed as input to the next serializer. - * Once all serializers have run, the resulting value is coerced to a string. - * - * If no serializers are provided, the test runner's default serializers are used. - */ - serializers?: ReadonlyArray<(value: any) => any> | undefined; - } - - /** - * An instance of `SuiteContext` is passed to each suite function in order to - * interact with the test runner. However, the `SuiteContext` constructor is not - * exposed as part of the API. - * @since v18.7.0, v16.17.0 - */ - class SuiteContext { - /** - * The absolute path of the test file that created the current suite. If a test file imports - * additional modules that generate suites, the imported suites will return the path of the root test file. - * @since v22.6.0 - */ - readonly filePath: string | undefined; - /** - * The name of the suite. - * @since v18.8.0, v16.18.0 - */ - readonly name: string; - /** - * Can be used to abort test subtasks when the test has been aborted. - * @since v18.7.0, v16.17.0 - */ - readonly signal: AbortSignal; - } - interface TestOptions { - /** - * If a number is provided, then that many tests would run in parallel. - * If truthy, it would run (number of cpu cores - 1) tests in parallel. - * For subtests, it will be `Infinity` tests in parallel. - * If falsy, it would only run one test at a time. - * If unspecified, subtests inherit this value from their parent. - * @default false - */ - concurrency?: number | boolean | undefined; - /** - * If truthy, and the test context is configured to run `only` tests, then this test will be - * run. Otherwise, the test is skipped. - * @default false - */ - only?: boolean | undefined; - /** - * Allows aborting an in-progress test. - * @since v18.8.0 - */ - signal?: AbortSignal | undefined; - /** - * If truthy, the test is skipped. If a string is provided, that string is displayed in the - * test results as the reason for skipping the test. - * @default false - */ - skip?: boolean | string | undefined; - /** - * A number of milliseconds the test will fail after. If unspecified, subtests inherit this - * value from their parent. - * @default Infinity - * @since v18.7.0 - */ - timeout?: number | undefined; - /** - * If truthy, the test marked as `TODO`. If a string is provided, that string is displayed in - * the test results as the reason why the test is `TODO`. - * @default false - */ - todo?: boolean | string | undefined; - /** - * The number of assertions and subtests expected to be run in the test. - * If the number of assertions run in the test does not match the number - * specified in the plan, the test will fail. - * @default undefined - * @since v22.2.0 - */ - plan?: number | undefined; - } - /** - * This function creates a hook that runs before executing a suite. - * - * ```js - * describe('tests', async () => { - * before(() => console.log('about to run some test')); - * it('is a subtest', () => { - * assert.ok('some relevant assertion here'); - * }); - * }); - * ``` - * @since v18.8.0, v16.18.0 - * @param fn The hook function. If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. - */ - function before(fn?: HookFn, options?: HookOptions): void; - /** - * This function creates a hook that runs after executing a suite. - * - * ```js - * describe('tests', async () => { - * after(() => console.log('finished running tests')); - * it('is a subtest', () => { - * assert.ok('some relevant assertion here'); - * }); - * }); - * ``` - * @since v18.8.0, v16.18.0 - * @param fn The hook function. If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. - */ - function after(fn?: HookFn, options?: HookOptions): void; - /** - * This function creates a hook that runs before each test in the current suite. - * - * ```js - * describe('tests', async () => { - * beforeEach(() => console.log('about to run a test')); - * it('is a subtest', () => { - * assert.ok('some relevant assertion here'); - * }); - * }); - * ``` - * @since v18.8.0, v16.18.0 - * @param fn The hook function. If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. - */ - function beforeEach(fn?: HookFn, options?: HookOptions): void; - /** - * This function creates a hook that runs after each test in the current suite. - * The `afterEach()` hook is run even if the test fails. - * - * ```js - * describe('tests', async () => { - * afterEach(() => console.log('finished running a test')); - * it('is a subtest', () => { - * assert.ok('some relevant assertion here'); - * }); - * }); - * ``` - * @since v18.8.0, v16.18.0 - * @param fn The hook function. If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. - */ - function afterEach(fn?: HookFn, options?: HookOptions): void; - /** - * The hook function. The first argument is the context in which the hook is called. - * If the hook uses callbacks, the callback function is passed as the second argument. - */ - type HookFn = (c: TestContext | SuiteContext, done: (result?: any) => void) => any; - /** - * The hook function. The first argument is a `TestContext` object. - * If the hook uses callbacks, the callback function is passed as the second argument. - */ - type TestContextHookFn = (t: TestContext, done: (result?: any) => void) => any; - /** - * Configuration options for hooks. - * @since v18.8.0 - */ - interface HookOptions { - /** - * Allows aborting an in-progress hook. - */ - signal?: AbortSignal | undefined; - /** - * A number of milliseconds the hook will fail after. If unspecified, subtests inherit this - * value from their parent. - * @default Infinity - */ - timeout?: number | undefined; - } - interface MockFunctionOptions { - /** - * The number of times that the mock will use the behavior of `implementation`. - * Once the mock function has been called `times` times, - * it will automatically restore the behavior of `original`. - * This value must be an integer greater than zero. - * @default Infinity - */ - times?: number | undefined; - } - interface MockMethodOptions extends MockFunctionOptions { - /** - * If `true`, `object[methodName]` is treated as a getter. - * This option cannot be used with the `setter` option. - */ - getter?: boolean | undefined; - /** - * If `true`, `object[methodName]` is treated as a setter. - * This option cannot be used with the `getter` option. - */ - setter?: boolean | undefined; - } - type Mock = F & { - mock: MockFunctionContext; - }; - type NoOpFunction = (...args: any[]) => undefined; - type FunctionPropertyNames = { - [K in keyof T]: T[K] extends Function ? K : never; - }[keyof T]; - interface MockModuleOptions { - /** - * If false, each call to `require()` or `import()` generates a new mock module. - * If true, subsequent calls will return the same module mock, and the mock module is inserted into the CommonJS cache. - * @default false - */ - cache?: boolean | undefined; - /** - * The value to use as the mocked module's default export. - * - * If this value is not provided, ESM mocks do not include a default export. - * If the mock is a CommonJS or builtin module, this setting is used as the value of `module.exports`. - * If this value is not provided, CJS and builtin mocks use an empty object as the value of `module.exports`. - */ - defaultExport?: any; - /** - * An object whose keys and values are used to create the named exports of the mock module. - * - * If the mock is a CommonJS or builtin module, these values are copied onto `module.exports`. - * Therefore, if a mock is created with both named exports and a non-object default export, - * the mock will throw an exception when used as a CJS or builtin module. - */ - namedExports?: object | undefined; - } - /** - * The `MockTracker` class is used to manage mocking functionality. The test runner - * module provides a top level `mock` export which is a `MockTracker` instance. - * Each test also provides its own `MockTracker` instance via the test context's `mock` property. - * @since v19.1.0, v18.13.0 - */ - class MockTracker { - /** - * This function is used to create a mock function. - * - * The following example creates a mock function that increments a counter by one - * on each invocation. The `times` option is used to modify the mock behavior such - * that the first two invocations add two to the counter instead of one. - * - * ```js - * test('mocks a counting function', (t) => { - * let cnt = 0; - * - * function addOne() { - * cnt++; - * return cnt; - * } - * - * function addTwo() { - * cnt += 2; - * return cnt; - * } - * - * const fn = t.mock.fn(addOne, addTwo, { times: 2 }); - * - * assert.strictEqual(fn(), 2); - * assert.strictEqual(fn(), 4); - * assert.strictEqual(fn(), 5); - * assert.strictEqual(fn(), 6); - * }); - * ``` - * @since v19.1.0, v18.13.0 - * @param original An optional function to create a mock on. - * @param implementation An optional function used as the mock implementation for `original`. This is useful for creating mocks that exhibit one behavior for a specified number of calls and - * then restore the behavior of `original`. - * @param options Optional configuration options for the mock function. - * @return The mocked function. The mocked function contains a special `mock` property, which is an instance of {@link MockFunctionContext}, and can be used for inspecting and changing the - * behavior of the mocked function. - */ - fn(original?: F, options?: MockFunctionOptions): Mock; - fn( - original?: F, - implementation?: Implementation, - options?: MockFunctionOptions, - ): Mock; - /** - * This function is used to create a mock on an existing object method. The - * following example demonstrates how a mock is created on an existing object - * method. - * - * ```js - * test('spies on an object method', (t) => { - * const number = { - * value: 5, - * subtract(a) { - * return this.value - a; - * }, - * }; - * - * t.mock.method(number, 'subtract'); - * assert.strictEqual(number.subtract.mock.calls.length, 0); - * assert.strictEqual(number.subtract(3), 2); - * assert.strictEqual(number.subtract.mock.calls.length, 1); - * - * const call = number.subtract.mock.calls[0]; - * - * assert.deepStrictEqual(call.arguments, [3]); - * assert.strictEqual(call.result, 2); - * assert.strictEqual(call.error, undefined); - * assert.strictEqual(call.target, undefined); - * assert.strictEqual(call.this, number); - * }); - * ``` - * @since v19.1.0, v18.13.0 - * @param object The object whose method is being mocked. - * @param methodName The identifier of the method on `object` to mock. If `object[methodName]` is not a function, an error is thrown. - * @param implementation An optional function used as the mock implementation for `object[methodName]`. - * @param options Optional configuration options for the mock method. - * @return The mocked method. The mocked method contains a special `mock` property, which is an instance of {@link MockFunctionContext}, and can be used for inspecting and changing the - * behavior of the mocked method. - */ - method< - MockedObject extends object, - MethodName extends FunctionPropertyNames, - >( - object: MockedObject, - methodName: MethodName, - options?: MockFunctionOptions, - ): MockedObject[MethodName] extends Function ? Mock - : never; - method< - MockedObject extends object, - MethodName extends FunctionPropertyNames, - Implementation extends Function, - >( - object: MockedObject, - methodName: MethodName, - implementation: Implementation, - options?: MockFunctionOptions, - ): MockedObject[MethodName] extends Function ? Mock - : never; - method( - object: MockedObject, - methodName: keyof MockedObject, - options: MockMethodOptions, - ): Mock; - method( - object: MockedObject, - methodName: keyof MockedObject, - implementation: Function, - options: MockMethodOptions, - ): Mock; - - /** - * This function is syntax sugar for `MockTracker.method` with `options.getter` set to `true`. - * @since v19.3.0, v18.13.0 - */ - getter< - MockedObject extends object, - MethodName extends keyof MockedObject, - >( - object: MockedObject, - methodName: MethodName, - options?: MockFunctionOptions, - ): Mock<() => MockedObject[MethodName]>; - getter< - MockedObject extends object, - MethodName extends keyof MockedObject, - Implementation extends Function, - >( - object: MockedObject, - methodName: MethodName, - implementation?: Implementation, - options?: MockFunctionOptions, - ): Mock<(() => MockedObject[MethodName]) | Implementation>; - /** - * This function is syntax sugar for `MockTracker.method` with `options.setter` set to `true`. - * @since v19.3.0, v18.13.0 - */ - setter< - MockedObject extends object, - MethodName extends keyof MockedObject, - >( - object: MockedObject, - methodName: MethodName, - options?: MockFunctionOptions, - ): Mock<(value: MockedObject[MethodName]) => void>; - setter< - MockedObject extends object, - MethodName extends keyof MockedObject, - Implementation extends Function, - >( - object: MockedObject, - methodName: MethodName, - implementation?: Implementation, - options?: MockFunctionOptions, - ): Mock<((value: MockedObject[MethodName]) => void) | Implementation>; - - /** - * This function is used to mock the exports of ECMAScript modules, CommonJS modules, and Node.js builtin modules. - * Any references to the original module prior to mocking are not impacted. - * - * Only available through the [--experimental-test-module-mocks](https://nodejs.org/api/cli.html#--experimental-test-module-mocks) flag. - * @since v22.3.0 - * @experimental - * @param specifier A string identifying the module to mock. - * @param options Optional configuration options for the mock module. - */ - module(specifier: string, options?: MockModuleOptions): MockModuleContext; - - /** - * This function restores the default behavior of all mocks that were previously - * created by this `MockTracker` and disassociates the mocks from the `MockTracker` instance. Once disassociated, the mocks can still be used, but the `MockTracker` instance can no longer be - * used to reset their behavior or - * otherwise interact with them. - * - * After each test completes, this function is called on the test context's `MockTracker`. If the global `MockTracker` is used extensively, calling this - * function manually is recommended. - * @since v19.1.0, v18.13.0 - */ - reset(): void; - /** - * This function restores the default behavior of all mocks that were previously - * created by this `MockTracker`. Unlike `mock.reset()`, `mock.restoreAll()` does - * not disassociate the mocks from the `MockTracker` instance. - * @since v19.1.0, v18.13.0 - */ - restoreAll(): void; - - timers: MockTimers; - } - const mock: MockTracker; - interface MockFunctionCall< - F extends Function, - ReturnType = F extends (...args: any) => infer T ? T - : F extends abstract new(...args: any) => infer T ? T - : unknown, - Args = F extends (...args: infer Y) => any ? Y - : F extends abstract new(...args: infer Y) => any ? Y - : unknown[], - > { - /** - * An array of the arguments passed to the mock function. - */ - arguments: Args; - /** - * If the mocked function threw then this property contains the thrown value. - */ - error: unknown | undefined; - /** - * The value returned by the mocked function. - * - * If the mocked function threw, it will be `undefined`. - */ - result: ReturnType | undefined; - /** - * An `Error` object whose stack can be used to determine the callsite of the mocked function invocation. - */ - stack: Error; - /** - * If the mocked function is a constructor, this field contains the class being constructed. - * Otherwise this will be `undefined`. - */ - target: F extends abstract new(...args: any) => any ? F : undefined; - /** - * The mocked function's `this` value. - */ - this: unknown; - } - /** - * The `MockFunctionContext` class is used to inspect or manipulate the behavior of - * mocks created via the `MockTracker` APIs. - * @since v19.1.0, v18.13.0 - */ - class MockFunctionContext { - /** - * A getter that returns a copy of the internal array used to track calls to the - * mock. Each entry in the array is an object with the following properties. - * @since v19.1.0, v18.13.0 - */ - readonly calls: Array>; - /** - * This function returns the number of times that this mock has been invoked. This - * function is more efficient than checking `ctx.calls.length` because `ctx.calls` is a getter that creates a copy of the internal call tracking array. - * @since v19.1.0, v18.13.0 - * @return The number of times that this mock has been invoked. - */ - callCount(): number; - /** - * This function is used to change the behavior of an existing mock. - * - * The following example creates a mock function using `t.mock.fn()`, calls the - * mock function, and then changes the mock implementation to a different function. - * - * ```js - * test('changes a mock behavior', (t) => { - * let cnt = 0; - * - * function addOne() { - * cnt++; - * return cnt; - * } - * - * function addTwo() { - * cnt += 2; - * return cnt; - * } - * - * const fn = t.mock.fn(addOne); - * - * assert.strictEqual(fn(), 1); - * fn.mock.mockImplementation(addTwo); - * assert.strictEqual(fn(), 3); - * assert.strictEqual(fn(), 5); - * }); - * ``` - * @since v19.1.0, v18.13.0 - * @param implementation The function to be used as the mock's new implementation. - */ - mockImplementation(implementation: F): void; - /** - * This function is used to change the behavior of an existing mock for a single - * invocation. Once invocation `onCall` has occurred, the mock will revert to - * whatever behavior it would have used had `mockImplementationOnce()` not been - * called. - * - * The following example creates a mock function using `t.mock.fn()`, calls the - * mock function, changes the mock implementation to a different function for the - * next invocation, and then resumes its previous behavior. - * - * ```js - * test('changes a mock behavior once', (t) => { - * let cnt = 0; - * - * function addOne() { - * cnt++; - * return cnt; - * } - * - * function addTwo() { - * cnt += 2; - * return cnt; - * } - * - * const fn = t.mock.fn(addOne); - * - * assert.strictEqual(fn(), 1); - * fn.mock.mockImplementationOnce(addTwo); - * assert.strictEqual(fn(), 3); - * assert.strictEqual(fn(), 4); - * }); - * ``` - * @since v19.1.0, v18.13.0 - * @param implementation The function to be used as the mock's implementation for the invocation number specified by `onCall`. - * @param onCall The invocation number that will use `implementation`. If the specified invocation has already occurred then an exception is thrown. - */ - mockImplementationOnce(implementation: F, onCall?: number): void; - /** - * Resets the call history of the mock function. - * @since v19.3.0, v18.13.0 - */ - resetCalls(): void; - /** - * Resets the implementation of the mock function to its original behavior. The - * mock can still be used after calling this function. - * @since v19.1.0, v18.13.0 - */ - restore(): void; - } - /** - * @since v22.3.0 - * @experimental - */ - class MockModuleContext { - /** - * Resets the implementation of the mock module. - * @since v22.3.0 - */ - restore(): void; - } - - type Timer = "setInterval" | "setTimeout" | "setImmediate" | "Date"; - interface MockTimersOptions { - apis: Timer[]; - now?: number | Date | undefined; - } - /** - * Mocking timers is a technique commonly used in software testing to simulate and - * control the behavior of timers, such as `setInterval` and `setTimeout`, - * without actually waiting for the specified time intervals. - * - * The MockTimers API also allows for mocking of the `Date` constructor and - * `setImmediate`/`clearImmediate` functions. - * - * The `MockTracker` provides a top-level `timers` export - * which is a `MockTimers` instance. - * @since v20.4.0 - * @experimental - */ - class MockTimers { - /** - * Enables timer mocking for the specified timers. - * - * **Note:** When you enable mocking for a specific timer, its associated - * clear function will also be implicitly mocked. - * - * **Note:** Mocking `Date` will affect the behavior of the mocked timers - * as they use the same internal clock. - * - * Example usage without setting initial time: - * - * ```js - * import { mock } from 'node:test'; - * mock.timers.enable({ apis: ['setInterval', 'Date'], now: 1234 }); - * ``` - * - * The above example enables mocking for the `Date` constructor, `setInterval` timer and - * implicitly mocks the `clearInterval` function. Only the `Date` constructor from `globalThis`, - * `setInterval` and `clearInterval` functions from `node:timers`, `node:timers/promises`, and `globalThis` will be mocked. - * - * Example usage with initial time set - * - * ```js - * import { mock } from 'node:test'; - * mock.timers.enable({ apis: ['Date'], now: 1000 }); - * ``` - * - * Example usage with initial Date object as time set - * - * ```js - * import { mock } from 'node:test'; - * mock.timers.enable({ apis: ['Date'], now: new Date() }); - * ``` - * - * Alternatively, if you call `mock.timers.enable()` without any parameters: - * - * All timers (`'setInterval'`, `'clearInterval'`, `'Date'`, `'setImmediate'`, `'clearImmediate'`, `'setTimeout'`, and `'clearTimeout'`) - * will be mocked. - * - * The `setInterval`, `clearInterval`, `setTimeout`, and `clearTimeout` functions from `node:timers`, `node:timers/promises`, - * and `globalThis` will be mocked. - * The `Date` constructor from `globalThis` will be mocked. - * - * If there is no initial epoch set, the initial date will be based on 0 in the Unix epoch. This is `January 1st, 1970, 00:00:00 UTC`. You can - * set an initial date by passing a now property to the `.enable()` method. This value will be used as the initial date for the mocked Date - * object. It can either be a positive integer, or another Date object. - * @since v20.4.0 - */ - enable(options?: MockTimersOptions): void; - /** - * You can use the `.setTime()` method to manually move the mocked date to another time. This method only accepts a positive integer. - * Note: This method will execute any mocked timers that are in the past from the new time. - * In the below example we are setting a new time for the mocked date. - * ```js - * import assert from 'node:assert'; - * import { test } from 'node:test'; - * test('sets the time of a date object', (context) => { - * // Optionally choose what to mock - * context.mock.timers.enable({ apis: ['Date'], now: 100 }); - * assert.strictEqual(Date.now(), 100); - * // Advance in time will also advance the date - * context.mock.timers.setTime(1000); - * context.mock.timers.tick(200); - * assert.strictEqual(Date.now(), 1200); - * }); - * ``` - */ - setTime(time: number): void; - /** - * This function restores the default behavior of all mocks that were previously - * created by this `MockTimers` instance and disassociates the mocks - * from the `MockTracker` instance. - * - * **Note:** After each test completes, this function is called on - * the test context's `MockTracker`. - * - * ```js - * import { mock } from 'node:test'; - * mock.timers.reset(); - * ``` - * @since v20.4.0 - */ - reset(): void; - /** - * Advances time for all mocked timers. - * - * **Note:** This diverges from how `setTimeout` in Node.js behaves and accepts - * only positive numbers. In Node.js, `setTimeout` with negative numbers is - * only supported for web compatibility reasons. - * - * The following example mocks a `setTimeout` function and - * by using `.tick` advances in - * time triggering all pending timers. - * - * ```js - * import assert from 'node:assert'; - * import { test } from 'node:test'; - * - * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { - * const fn = context.mock.fn(); - * - * context.mock.timers.enable({ apis: ['setTimeout'] }); - * - * setTimeout(fn, 9999); - * - * assert.strictEqual(fn.mock.callCount(), 0); - * - * // Advance in time - * context.mock.timers.tick(9999); - * - * assert.strictEqual(fn.mock.callCount(), 1); - * }); - * ``` - * - * Alternativelly, the `.tick` function can be called many times - * - * ```js - * import assert from 'node:assert'; - * import { test } from 'node:test'; - * - * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { - * const fn = context.mock.fn(); - * context.mock.timers.enable({ apis: ['setTimeout'] }); - * const nineSecs = 9000; - * setTimeout(fn, nineSecs); - * - * const twoSeconds = 3000; - * context.mock.timers.tick(twoSeconds); - * context.mock.timers.tick(twoSeconds); - * context.mock.timers.tick(twoSeconds); - * - * assert.strictEqual(fn.mock.callCount(), 1); - * }); - * ``` - * - * Advancing time using `.tick` will also advance the time for any `Date` object - * created after the mock was enabled (if `Date` was also set to be mocked). - * - * ```js - * import assert from 'node:assert'; - * import { test } from 'node:test'; - * - * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { - * const fn = context.mock.fn(); - * - * context.mock.timers.enable({ apis: ['setTimeout', 'Date'] }); - * setTimeout(fn, 9999); - * - * assert.strictEqual(fn.mock.callCount(), 0); - * assert.strictEqual(Date.now(), 0); - * - * // Advance in time - * context.mock.timers.tick(9999); - * assert.strictEqual(fn.mock.callCount(), 1); - * assert.strictEqual(Date.now(), 9999); - * }); - * ``` - * @since v20.4.0 - */ - tick(milliseconds: number): void; - /** - * Triggers all pending mocked timers immediately. If the `Date` object is also - * mocked, it will also advance the `Date` object to the furthest timer's time. - * - * The example below triggers all pending timers immediately, - * causing them to execute without any delay. - * - * ```js - * import assert from 'node:assert'; - * import { test } from 'node:test'; - * - * test('runAll functions following the given order', (context) => { - * context.mock.timers.enable({ apis: ['setTimeout', 'Date'] }); - * const results = []; - * setTimeout(() => results.push(1), 9999); - * - * // Notice that if both timers have the same timeout, - * // the order of execution is guaranteed - * setTimeout(() => results.push(3), 8888); - * setTimeout(() => results.push(2), 8888); - * - * assert.deepStrictEqual(results, []); - * - * context.mock.timers.runAll(); - * assert.deepStrictEqual(results, [3, 2, 1]); - * // The Date object is also advanced to the furthest timer's time - * assert.strictEqual(Date.now(), 9999); - * }); - * ``` - * - * **Note:** The `runAll()` function is specifically designed for - * triggering timers in the context of timer mocking. - * It does not have any effect on real-time system - * clocks or actual timers outside of the mocking environment. - * @since v20.4.0 - */ - runAll(): void; - /** - * Calls {@link MockTimers.reset()}. - */ - [Symbol.dispose](): void; - } - /** - * Only available through the [--experimental-test-snapshots](https://nodejs.org/api/cli.html#--experimental-test-snapshots) flag. - * @since v22.3.0 - * @experimental - */ - namespace snapshot { - /** - * This function is used to customize the default serialization mechanism used by the test runner. - * - * By default, the test runner performs serialization by calling `JSON.stringify(value, null, 2)` on the provided value. - * `JSON.stringify()` does have limitations regarding circular structures and supported data types. - * If a more robust serialization mechanism is required, this function should be used to specify a list of custom serializers. - * - * Serializers are called in order, with the output of the previous serializer passed as input to the next. - * The final result must be a string value. - * @since v22.3.0 - * @param serializers An array of synchronous functions used as the default serializers for snapshot tests. - */ - function setDefaultSnapshotSerializers(serializers: ReadonlyArray<(value: any) => any>): void; - /** - * This function is used to set a custom resolver for the location of the snapshot file used for snapshot testing. - * By default, the snapshot filename is the same as the entry point filename with `.snapshot` appended. - * @since v22.3.0 - * @param fn A function which returns a string specifying the location of the snapshot file. - * The function receives the path of the test file as its only argument. - * If `process.argv[1]` is not associated with a file (for example in the REPL), the input is undefined. - */ - function setResolveSnapshotPath(fn: (path: string | undefined) => string): void; - } - export { - after, - afterEach, - before, - beforeEach, - describe, - it, - Mock, - mock, - only, - run, - skip, - snapshot, - suite, - SuiteContext, - test, - test as default, - TestContext, - todo, - }; -} - -interface TestError extends Error { - cause: Error; -} -interface TestLocationInfo { - /** - * The column number where the test is defined, or - * `undefined` if the test was run through the REPL. - */ - column?: number; - /** - * The path of the test file, `undefined` if test was run through the REPL. - */ - file?: string; - /** - * The line number where the test is defined, or `undefined` if the test was run through the REPL. - */ - line?: number; -} -interface DiagnosticData extends TestLocationInfo { - /** - * The diagnostic message. - */ - message: string; - /** - * The nesting level of the test. - */ - nesting: number; -} -interface TestCoverage { - /** - * An object containing the coverage report. - */ - summary: { - /** - * An array of coverage reports for individual files. - */ - files: Array<{ - /** - * The absolute path of the file. - */ - path: string; - /** - * The total number of lines. - */ - totalLineCount: number; - /** - * The total number of branches. - */ - totalBranchCount: number; - /** - * The total number of functions. - */ - totalFunctionCount: number; - /** - * The number of covered lines. - */ - coveredLineCount: number; - /** - * The number of covered branches. - */ - coveredBranchCount: number; - /** - * The number of covered functions. - */ - coveredFunctionCount: number; - /** - * The percentage of lines covered. - */ - coveredLinePercent: number; - /** - * The percentage of branches covered. - */ - coveredBranchPercent: number; - /** - * The percentage of functions covered. - */ - coveredFunctionPercent: number; - /** - * An array of functions representing function coverage. - */ - functions: Array<{ - /** - * The name of the function. - */ - name: string; - /** - * The line number where the function is defined. - */ - line: number; - /** - * The number of times the function was called. - */ - count: number; - }>; - /** - * An array of branches representing branch coverage. - */ - branches: Array<{ - /** - * The line number where the branch is defined. - */ - line: number; - /** - * The number of times the branch was taken. - */ - count: number; - }>; - /** - * An array of lines representing line numbers and the number of times they were covered. - */ - lines: Array<{ - /** - * The line number. - */ - line: number; - /** - * The number of times the line was covered. - */ - count: number; - }>; - }>; - /** - * An object containing a summary of coverage for all files. - */ - totals: { - /** - * The total number of lines. - */ - totalLineCount: number; - /** - * The total number of branches. - */ - totalBranchCount: number; - /** - * The total number of functions. - */ - totalFunctionCount: number; - /** - * The number of covered lines. - */ - coveredLineCount: number; - /** - * The number of covered branches. - */ - coveredBranchCount: number; - /** - * The number of covered functions. - */ - coveredFunctionCount: number; - /** - * The percentage of lines covered. - */ - coveredLinePercent: number; - /** - * The percentage of branches covered. - */ - coveredBranchPercent: number; - /** - * The percentage of functions covered. - */ - coveredFunctionPercent: number; - }; - /** - * The working directory when code coverage began. This - * is useful for displaying relative path names in case - * the tests changed the working directory of the Node.js process. - */ - workingDirectory: string; - }; - /** - * The nesting level of the test. - */ - nesting: number; -} -interface TestComplete extends TestLocationInfo { - /** - * Additional execution metadata. - */ - details: { - /** - * Whether the test passed or not. - */ - passed: boolean; - /** - * The duration of the test in milliseconds. - */ - duration_ms: number; - /** - * An error wrapping the error thrown by the test if it did not pass. - */ - error?: TestError; - /** - * The type of the test, used to denote whether this is a suite. - */ - type?: "suite"; - }; - /** - * The test name. - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; - /** - * The ordinal number of the test. - */ - testNumber: number; - /** - * Present if `context.todo` is called. - */ - todo?: string | boolean; - /** - * Present if `context.skip` is called. - */ - skip?: string | boolean; -} -interface TestDequeue extends TestLocationInfo { - /** - * The test name. - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; -} -interface TestEnqueue extends TestLocationInfo { - /** - * The test name. - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; -} -interface TestFail extends TestLocationInfo { - /** - * Additional execution metadata. - */ - details: { - /** - * The duration of the test in milliseconds. - */ - duration_ms: number; - /** - * An error wrapping the error thrown by the test. - */ - error: TestError; - /** - * The type of the test, used to denote whether this is a suite. - * @since v20.0.0, v19.9.0, v18.17.0 - */ - type?: "suite"; - }; - /** - * The test name. - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; - /** - * The ordinal number of the test. - */ - testNumber: number; - /** - * Present if `context.todo` is called. - */ - todo?: string | boolean; - /** - * Present if `context.skip` is called. - */ - skip?: string | boolean; -} -interface TestPass extends TestLocationInfo { - /** - * Additional execution metadata. - */ - details: { - /** - * The duration of the test in milliseconds. - */ - duration_ms: number; - /** - * The type of the test, used to denote whether this is a suite. - * @since 20.0.0, 19.9.0, 18.17.0 - */ - type?: "suite"; - }; - /** - * The test name. - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; - /** - * The ordinal number of the test. - */ - testNumber: number; - /** - * Present if `context.todo` is called. - */ - todo?: string | boolean; - /** - * Present if `context.skip` is called. - */ - skip?: string | boolean; -} -interface TestPlan extends TestLocationInfo { - /** - * The nesting level of the test. - */ - nesting: number; - /** - * The number of subtests that have ran. - */ - count: number; -} -interface TestStart extends TestLocationInfo { - /** - * The test name. - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; -} -interface TestStderr { - /** - * The path of the test file. - */ - file: string; - /** - * The message written to `stderr`. - */ - message: string; -} -interface TestStdout { - /** - * The path of the test file. - */ - file: string; - /** - * The message written to `stdout`. - */ - message: string; -} - -/** - * The `node:test/reporters` module exposes the builtin-reporters for `node:test`. - * To access it: - * - * ```js - * import test from 'node:test/reporters'; - * ``` - * - * This module is only available under the `node:` scheme. The following will not - * work: - * - * ```js - * import test from 'node:test/reporters'; - * ``` - * @since v19.9.0 - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/test/reporters.js) - */ -declare module "node:test/reporters" { - import { Transform, TransformOptions } from "node:stream"; - - type TestEvent = - | { type: "test:coverage"; data: TestCoverage } - | { type: "test:complete"; data: TestComplete } - | { type: "test:dequeue"; data: TestDequeue } - | { type: "test:diagnostic"; data: DiagnosticData } - | { type: "test:enqueue"; data: TestEnqueue } - | { type: "test:fail"; data: TestFail } - | { type: "test:pass"; data: TestPass } - | { type: "test:plan"; data: TestPlan } - | { type: "test:start"; data: TestStart } - | { type: "test:stderr"; data: TestStderr } - | { type: "test:stdout"; data: TestStdout } - | { type: "test:watch:drained"; data: undefined }; - type TestEventGenerator = AsyncGenerator; - - interface ReporterConstructorWrapper Transform> { - new(...args: ConstructorParameters): InstanceType; - (...args: ConstructorParameters): InstanceType; - } - - /** - * The `dot` reporter outputs the test results in a compact format, - * where each passing test is represented by a `.`, - * and each failing test is represented by a `X`. - * @since v20.0.0 - */ - function dot(source: TestEventGenerator): AsyncGenerator<"\n" | "." | "X", void>; - /** - * The `tap` reporter outputs the test results in the [TAP](https://testanything.org/) format. - * @since v20.0.0 - */ - function tap(source: TestEventGenerator): AsyncGenerator; - class SpecReporter extends Transform { - constructor(); - } - /** - * The `spec` reporter outputs the test results in a human-readable format. - * @since v20.0.0 - */ - const spec: ReporterConstructorWrapper; - /** - * The `junit` reporter outputs test results in a jUnit XML format. - * @since v21.0.0 - */ - function junit(source: TestEventGenerator): AsyncGenerator; - class LcovReporter extends Transform { - constructor(opts?: Omit); - } - /** - * The `lcov` reporter outputs test coverage when used with the - * [`--experimental-test-coverage`](https://nodejs.org/docs/latest-v22.x/api/cli.html#--experimental-test-coverage) flag. - * @since v22.0.0 - */ - // TODO: change the export to a wrapper function once node@0db38f0 is merged (breaking change) - // const lcov: ReporterConstructorWrapper; - const lcov: LcovReporter; - - export { dot, junit, lcov, spec, tap, TestEvent }; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/timers.d.ts b/tools/mnemonic-test/node_modules/@types/node/timers.d.ts deleted file mode 100644 index a4ea3e57..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/timers.d.ts +++ /dev/null @@ -1,240 +0,0 @@ -/** - * The `timer` module exposes a global API for scheduling functions to - * be called at some future period of time. Because the timer functions are - * globals, there is no need to import `node:timers` to use the API. - * - * The timer functions within Node.js implement a similar API as the timers API - * provided by Web Browsers but use a different internal implementation that is - * built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout). - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/timers.js) - */ -declare module "timers" { - import { Abortable } from "node:events"; - import { - setImmediate as setImmediatePromise, - setInterval as setIntervalPromise, - setTimeout as setTimeoutPromise, - } from "node:timers/promises"; - interface TimerOptions extends Abortable { - /** - * Set to `false` to indicate that the scheduled `Timeout` - * should not require the Node.js event loop to remain active. - * @default true - */ - ref?: boolean | undefined; - } - let setTimeout: typeof global.setTimeout; - let clearTimeout: typeof global.clearTimeout; - let setInterval: typeof global.setInterval; - let clearInterval: typeof global.clearInterval; - let setImmediate: typeof global.setImmediate; - let clearImmediate: typeof global.clearImmediate; - global { - namespace NodeJS { - // compatibility with older typings - interface Timer extends RefCounted { - hasRef(): boolean; - refresh(): this; - [Symbol.toPrimitive](): number; - } - /** - * This object is created internally and is returned from `setImmediate()`. It - * can be passed to `clearImmediate()` in order to cancel the scheduled - * actions. - * - * By default, when an immediate is scheduled, the Node.js event loop will continue - * running as long as the immediate is active. The `Immediate` object returned by `setImmediate()` exports both `immediate.ref()` and `immediate.unref()` functions that can be used to - * control this default behavior. - */ - class Immediate implements RefCounted { - /** - * When called, requests that the Node.js event loop _not_ exit so long as the `Immediate` is active. Calling `immediate.ref()` multiple times will have no - * effect. - * - * By default, all `Immediate` objects are "ref'ed", making it normally unnecessary - * to call `immediate.ref()` unless `immediate.unref()` had been called previously. - * @since v9.7.0 - * @return a reference to `immediate` - */ - ref(): this; - /** - * When called, the active `Immediate` object will not require the Node.js event - * loop to remain active. If there is no other activity keeping the event loop - * running, the process may exit before the `Immediate` object's callback is - * invoked. Calling `immediate.unref()` multiple times will have no effect. - * @since v9.7.0 - * @return a reference to `immediate` - */ - unref(): this; - /** - * If true, the `Immediate` object will keep the Node.js event loop active. - * @since v11.0.0 - */ - hasRef(): boolean; - _onImmediate: Function; // to distinguish it from the Timeout class - /** - * Cancels the immediate. This is similar to calling `clearImmediate()`. - * @since v20.5.0 - */ - [Symbol.dispose](): void; - } - /** - * This object is created internally and is returned from `setTimeout()` and `setInterval()`. It can be passed to either `clearTimeout()` or `clearInterval()` in order to cancel the - * scheduled actions. - * - * By default, when a timer is scheduled using either `setTimeout()` or `setInterval()`, the Node.js event loop will continue running as long as the - * timer is active. Each of the `Timeout` objects returned by these functions - * export both `timeout.ref()` and `timeout.unref()` functions that can be used to - * control this default behavior. - */ - class Timeout implements Timer { - /** - * When called, requests that the Node.js event loop _not_ exit so long as the`Timeout` is active. Calling `timeout.ref()` multiple times will have no effect. - * - * By default, all `Timeout` objects are "ref'ed", making it normally unnecessary - * to call `timeout.ref()` unless `timeout.unref()` had been called previously. - * @since v0.9.1 - * @return a reference to `timeout` - */ - ref(): this; - /** - * When called, the active `Timeout` object will not require the Node.js event loop - * to remain active. If there is no other activity keeping the event loop running, - * the process may exit before the `Timeout` object's callback is invoked. Calling `timeout.unref()` multiple times will have no effect. - * @since v0.9.1 - * @return a reference to `timeout` - */ - unref(): this; - /** - * If true, the `Timeout` object will keep the Node.js event loop active. - * @since v11.0.0 - */ - hasRef(): boolean; - /** - * Sets the timer's start time to the current time, and reschedules the timer to - * call its callback at the previously specified duration adjusted to the current - * time. This is useful for refreshing a timer without allocating a new - * JavaScript object. - * - * Using this on a timer that has already called its callback will reactivate the - * timer. - * @since v10.2.0 - * @return a reference to `timeout` - */ - refresh(): this; - [Symbol.toPrimitive](): number; - /** - * Cancels the timeout. - * @since v20.5.0 - */ - [Symbol.dispose](): void; - } - } - /** - * Schedules execution of a one-time `callback` after `delay` milliseconds. - * - * The `callback` will likely not be invoked in precisely `delay` milliseconds. - * Node.js makes no guarantees about the exact timing of when callbacks will fire, - * nor of their ordering. The callback will be called as close as possible to the - * time specified. - * - * When `delay` is larger than `2147483647` or less than `1`, the `delay` will be set to `1`. Non-integer delays are truncated to an integer. - * - * If `callback` is not a function, a `TypeError` will be thrown. - * - * This method has a custom variant for promises that is available using `timersPromises.setTimeout()`. - * @since v0.0.1 - * @param callback The function to call when the timer elapses. - * @param [delay=1] The number of milliseconds to wait before calling the `callback`. - * @param args Optional arguments to pass when the `callback` is called. - * @return for use with {@link clearTimeout} - */ - function setTimeout( - callback: (...args: TArgs) => void, - ms?: number, - ...args: TArgs - ): NodeJS.Timeout; - // util.promisify no rest args compability - // eslint-disable-next-line @typescript-eslint/no-invalid-void-type - function setTimeout(callback: (args: void) => void, ms?: number): NodeJS.Timeout; - namespace setTimeout { - const __promisify__: typeof setTimeoutPromise; - } - /** - * Cancels a `Timeout` object created by `setTimeout()`. - * @since v0.0.1 - * @param timeout A `Timeout` object as returned by {@link setTimeout} or the `primitive` of the `Timeout` object as a string or a number. - */ - function clearTimeout(timeoutId: NodeJS.Timeout | string | number | undefined): void; - /** - * Schedules repeated execution of `callback` every `delay` milliseconds. - * - * When `delay` is larger than `2147483647` or less than `1`, the `delay` will be - * set to `1`. Non-integer delays are truncated to an integer. - * - * If `callback` is not a function, a `TypeError` will be thrown. - * - * This method has a custom variant for promises that is available using `timersPromises.setInterval()`. - * @since v0.0.1 - * @param callback The function to call when the timer elapses. - * @param [delay=1] The number of milliseconds to wait before calling the `callback`. - * @param args Optional arguments to pass when the `callback` is called. - * @return for use with {@link clearInterval} - */ - function setInterval( - callback: (...args: TArgs) => void, - ms?: number, - ...args: TArgs - ): NodeJS.Timeout; - // util.promisify no rest args compability - // eslint-disable-next-line @typescript-eslint/no-invalid-void-type - function setInterval(callback: (args: void) => void, ms?: number): NodeJS.Timeout; - namespace setInterval { - const __promisify__: typeof setIntervalPromise; - } - /** - * Cancels a `Timeout` object created by `setInterval()`. - * @since v0.0.1 - * @param timeout A `Timeout` object as returned by {@link setInterval} or the `primitive` of the `Timeout` object as a string or a number. - */ - function clearInterval(intervalId: NodeJS.Timeout | string | number | undefined): void; - /** - * Schedules the "immediate" execution of the `callback` after I/O events' - * callbacks. - * - * When multiple calls to `setImmediate()` are made, the `callback` functions are - * queued for execution in the order in which they are created. The entire callback - * queue is processed every event loop iteration. If an immediate timer is queued - * from inside an executing callback, that timer will not be triggered until the - * next event loop iteration. - * - * If `callback` is not a function, a `TypeError` will be thrown. - * - * This method has a custom variant for promises that is available using `timersPromises.setImmediate()`. - * @since v0.9.1 - * @param callback The function to call at the end of this turn of the Node.js `Event Loop` - * @param args Optional arguments to pass when the `callback` is called. - * @return for use with {@link clearImmediate} - */ - function setImmediate( - callback: (...args: TArgs) => void, - ...args: TArgs - ): NodeJS.Immediate; - // util.promisify no rest args compability - // eslint-disable-next-line @typescript-eslint/no-invalid-void-type - function setImmediate(callback: (args: void) => void): NodeJS.Immediate; - namespace setImmediate { - const __promisify__: typeof setImmediatePromise; - } - /** - * Cancels an `Immediate` object created by `setImmediate()`. - * @since v0.9.1 - * @param immediate An `Immediate` object as returned by {@link setImmediate}. - */ - function clearImmediate(immediateId: NodeJS.Immediate | undefined): void; - function queueMicrotask(callback: () => void): void; - } -} -declare module "node:timers" { - export * from "timers"; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/timers/promises.d.ts b/tools/mnemonic-test/node_modules/@types/node/timers/promises.d.ts deleted file mode 100644 index 1e6eb65a..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/timers/promises.d.ts +++ /dev/null @@ -1,97 +0,0 @@ -/** - * The `timers/promises` API provides an alternative set of timer functions - * that return `Promise` objects. The API is accessible via `import timersPromises from 'node:timers/promises'`. - * - * ```js - * import { - * setTimeout, - * setImmediate, - * setInterval, - * } from 'node:timers/promises'; - * ``` - * @since v15.0.0 - */ -declare module "timers/promises" { - import { TimerOptions } from "node:timers"; - /** - * ```js - * import { - * setTimeout, - * } from 'node:timers/promises'; - * - * const res = await setTimeout(100, 'result'); - * - * console.log(res); // Prints 'result' - * ``` - * @since v15.0.0 - * @param [delay=1] The number of milliseconds to wait before fulfilling the promise. - * @param value A value with which the promise is fulfilled. - */ - function setTimeout(delay?: number, value?: T, options?: TimerOptions): Promise; - /** - * ```js - * import { - * setImmediate, - * } from 'node:timers/promises'; - * - * const res = await setImmediate('result'); - * - * console.log(res); // Prints 'result' - * ``` - * @since v15.0.0 - * @param value A value with which the promise is fulfilled. - */ - function setImmediate(value?: T, options?: TimerOptions): Promise; - /** - * Returns an async iterator that generates values in an interval of `delay` ms. - * If `ref` is `true`, you need to call `next()` of async iterator explicitly - * or implicitly to keep the event loop alive. - * - * ```js - * import { - * setInterval, - * } from 'node:timers/promises'; - * - * const interval = 100; - * for await (const startTime of setInterval(interval, Date.now())) { - * const now = Date.now(); - * console.log(now); - * if ((now - startTime) > 1000) - * break; - * } - * console.log(Date.now()); - * ``` - * @since v15.9.0 - */ - function setInterval(delay?: number, value?: T, options?: TimerOptions): AsyncIterable; - interface Scheduler { - /** - * An experimental API defined by the [Scheduling APIs](https://github.com/WICG/scheduling-apis) draft specification being developed as a standard Web Platform API. - * - * Calling `timersPromises.scheduler.wait(delay, options)` is roughly equivalent to calling `timersPromises.setTimeout(delay, undefined, options)` except that the `ref` - * option is not supported. - * - * ```js - * import { scheduler } from 'node:timers/promises'; - * - * await scheduler.wait(1000); // Wait one second before continuing - * ``` - * @since v16.14.0 - * @experimental - * @param [delay=1] The number of milliseconds to wait before fulfilling the promise. - */ - wait: (delay?: number, options?: Pick) => Promise; - /** - * An experimental API defined by the [Scheduling APIs](https://nodejs.org/docs/latest-v20.x/api/async_hooks.html#promise-execution-tracking) draft specification - * being developed as a standard Web Platform API. - * Calling `timersPromises.scheduler.yield()` is equivalent to calling `timersPromises.setImmediate()` with no arguments. - * @since v16.14.0 - * @experimental - */ - yield: () => Promise; - } - const scheduler: Scheduler; -} -declare module "node:timers/promises" { - export * from "timers/promises"; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/tls.d.ts b/tools/mnemonic-test/node_modules/@types/node/tls.d.ts deleted file mode 100644 index ee81ba21..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/tls.d.ts +++ /dev/null @@ -1,1220 +0,0 @@ -/** - * The `node:tls` module provides an implementation of the Transport Layer Security - * (TLS) and Secure Socket Layer (SSL) protocols that is built on top of OpenSSL. - * The module can be accessed using: - * - * ```js - * import tls from 'node:tls'; - * ``` - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/tls.js) - */ -declare module "tls" { - import { X509Certificate } from "node:crypto"; - import * as net from "node:net"; - import * as stream from "stream"; - const CLIENT_RENEG_LIMIT: number; - const CLIENT_RENEG_WINDOW: number; - interface Certificate { - /** - * Country code. - */ - C: string; - /** - * Street. - */ - ST: string; - /** - * Locality. - */ - L: string; - /** - * Organization. - */ - O: string; - /** - * Organizational unit. - */ - OU: string; - /** - * Common name. - */ - CN: string; - } - interface PeerCertificate { - /** - * `true` if a Certificate Authority (CA), `false` otherwise. - * @since v18.13.0 - */ - ca: boolean; - /** - * The DER encoded X.509 certificate data. - */ - raw: Buffer; - /** - * The certificate subject. - */ - subject: Certificate; - /** - * The certificate issuer, described in the same terms as the `subject`. - */ - issuer: Certificate; - /** - * The date-time the certificate is valid from. - */ - valid_from: string; - /** - * The date-time the certificate is valid to. - */ - valid_to: string; - /** - * The certificate serial number, as a hex string. - */ - serialNumber: string; - /** - * The SHA-1 digest of the DER encoded certificate. - * It is returned as a `:` separated hexadecimal string. - */ - fingerprint: string; - /** - * The SHA-256 digest of the DER encoded certificate. - * It is returned as a `:` separated hexadecimal string. - */ - fingerprint256: string; - /** - * The SHA-512 digest of the DER encoded certificate. - * It is returned as a `:` separated hexadecimal string. - */ - fingerprint512: string; - /** - * The extended key usage, a set of OIDs. - */ - ext_key_usage?: string[]; - /** - * A string containing concatenated names for the subject, - * an alternative to the `subject` names. - */ - subjectaltname?: string; - /** - * An array describing the AuthorityInfoAccess, used with OCSP. - */ - infoAccess?: NodeJS.Dict; - /** - * For RSA keys: The RSA bit size. - * - * For EC keys: The key size in bits. - */ - bits?: number; - /** - * The RSA exponent, as a string in hexadecimal number notation. - */ - exponent?: string; - /** - * The RSA modulus, as a hexadecimal string. - */ - modulus?: string; - /** - * The public key. - */ - pubkey?: Buffer; - /** - * The ASN.1 name of the OID of the elliptic curve. - * Well-known curves are identified by an OID. - * While it is unusual, it is possible that the curve - * is identified by its mathematical properties, - * in which case it will not have an OID. - */ - asn1Curve?: string; - /** - * The NIST name for the elliptic curve, if it has one - * (not all well-known curves have been assigned names by NIST). - */ - nistCurve?: string; - } - interface DetailedPeerCertificate extends PeerCertificate { - /** - * The issuer certificate object. - * For self-signed certificates, this may be a circular reference. - */ - issuerCertificate: DetailedPeerCertificate; - } - interface CipherNameAndProtocol { - /** - * The cipher name. - */ - name: string; - /** - * SSL/TLS protocol version. - */ - version: string; - /** - * IETF name for the cipher suite. - */ - standardName: string; - } - interface EphemeralKeyInfo { - /** - * The supported types are 'DH' and 'ECDH'. - */ - type: string; - /** - * The name property is available only when type is 'ECDH'. - */ - name?: string | undefined; - /** - * The size of parameter of an ephemeral key exchange. - */ - size: number; - } - interface KeyObject { - /** - * Private keys in PEM format. - */ - pem: string | Buffer; - /** - * Optional passphrase. - */ - passphrase?: string | undefined; - } - interface PxfObject { - /** - * PFX or PKCS12 encoded private key and certificate chain. - */ - buf: string | Buffer; - /** - * Optional passphrase. - */ - passphrase?: string | undefined; - } - interface TLSSocketOptions extends SecureContextOptions, CommonConnectionOptions { - /** - * If true the TLS socket will be instantiated in server-mode. - * Defaults to false. - */ - isServer?: boolean | undefined; - /** - * An optional net.Server instance. - */ - server?: net.Server | undefined; - /** - * An optional Buffer instance containing a TLS session. - */ - session?: Buffer | undefined; - /** - * If true, specifies that the OCSP status request extension will be - * added to the client hello and an 'OCSPResponse' event will be - * emitted on the socket before establishing a secure communication - */ - requestOCSP?: boolean | undefined; - } - /** - * Performs transparent encryption of written data and all required TLS - * negotiation. - * - * Instances of `tls.TLSSocket` implement the duplex `Stream` interface. - * - * Methods that return TLS connection metadata (e.g.{@link TLSSocket.getPeerCertificate}) will only return data while the - * connection is open. - * @since v0.11.4 - */ - class TLSSocket extends net.Socket { - /** - * Construct a new tls.TLSSocket object from an existing TCP socket. - */ - constructor(socket: net.Socket | stream.Duplex, options?: TLSSocketOptions); - /** - * This property is `true` if the peer certificate was signed by one of the CAs - * specified when creating the `tls.TLSSocket` instance, otherwise `false`. - * @since v0.11.4 - */ - authorized: boolean; - /** - * Returns the reason why the peer's certificate was not been verified. This - * property is set only when `tlsSocket.authorized === false`. - * @since v0.11.4 - */ - authorizationError: Error; - /** - * Always returns `true`. This may be used to distinguish TLS sockets from regular`net.Socket` instances. - * @since v0.11.4 - */ - encrypted: true; - /** - * String containing the selected ALPN protocol. - * Before a handshake has completed, this value is always null. - * When a handshake is completed but not ALPN protocol was selected, tlsSocket.alpnProtocol equals false. - */ - alpnProtocol: string | false | null; - /** - * Returns an object representing the local certificate. The returned object has - * some properties corresponding to the fields of the certificate. - * - * See {@link TLSSocket.getPeerCertificate} for an example of the certificate - * structure. - * - * If there is no local certificate, an empty object will be returned. If the - * socket has been destroyed, `null` will be returned. - * @since v11.2.0 - */ - getCertificate(): PeerCertificate | object | null; - /** - * Returns an object containing information on the negotiated cipher suite. - * - * For example, a TLSv1.2 protocol with AES256-SHA cipher: - * - * ```json - * { - * "name": "AES256-SHA", - * "standardName": "TLS_RSA_WITH_AES_256_CBC_SHA", - * "version": "SSLv3" - * } - * ``` - * - * See [SSL\_CIPHER\_get\_name](https://www.openssl.org/docs/man1.1.1/man3/SSL_CIPHER_get_name.html) for more information. - * @since v0.11.4 - */ - getCipher(): CipherNameAndProtocol; - /** - * Returns an object representing the type, name, and size of parameter of - * an ephemeral key exchange in `perfect forward secrecy` on a client - * connection. It returns an empty object when the key exchange is not - * ephemeral. As this is only supported on a client socket; `null` is returned - * if called on a server socket. The supported types are `'DH'` and `'ECDH'`. The `name` property is available only when type is `'ECDH'`. - * - * For example: `{ type: 'ECDH', name: 'prime256v1', size: 256 }`. - * @since v5.0.0 - */ - getEphemeralKeyInfo(): EphemeralKeyInfo | object | null; - /** - * As the `Finished` messages are message digests of the complete handshake - * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can - * be used for external authentication procedures when the authentication - * provided by SSL/TLS is not desired or is not enough. - * - * Corresponds to the `SSL_get_finished` routine in OpenSSL and may be used - * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929). - * @since v9.9.0 - * @return The latest `Finished` message that has been sent to the socket as part of a SSL/TLS handshake, or `undefined` if no `Finished` message has been sent yet. - */ - getFinished(): Buffer | undefined; - /** - * Returns an object representing the peer's certificate. If the peer does not - * provide a certificate, an empty object will be returned. If the socket has been - * destroyed, `null` will be returned. - * - * If the full certificate chain was requested, each certificate will include an`issuerCertificate` property containing an object representing its issuer's - * certificate. - * @since v0.11.4 - * @param detailed Include the full certificate chain if `true`, otherwise include just the peer's certificate. - * @return A certificate object. - */ - getPeerCertificate(detailed: true): DetailedPeerCertificate; - getPeerCertificate(detailed?: false): PeerCertificate; - getPeerCertificate(detailed?: boolean): PeerCertificate | DetailedPeerCertificate; - /** - * As the `Finished` messages are message digests of the complete handshake - * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can - * be used for external authentication procedures when the authentication - * provided by SSL/TLS is not desired or is not enough. - * - * Corresponds to the `SSL_get_peer_finished` routine in OpenSSL and may be used - * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929). - * @since v9.9.0 - * @return The latest `Finished` message that is expected or has actually been received from the socket as part of a SSL/TLS handshake, or `undefined` if there is no `Finished` message so - * far. - */ - getPeerFinished(): Buffer | undefined; - /** - * Returns a string containing the negotiated SSL/TLS protocol version of the - * current connection. The value `'unknown'` will be returned for connected - * sockets that have not completed the handshaking process. The value `null` will - * be returned for server sockets or disconnected client sockets. - * - * Protocol versions are: - * - * * `'SSLv3'` - * * `'TLSv1'` - * * `'TLSv1.1'` - * * `'TLSv1.2'` - * * `'TLSv1.3'` - * - * See the OpenSSL [`SSL_get_version`](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html) documentation for more information. - * @since v5.7.0 - */ - getProtocol(): string | null; - /** - * Returns the TLS session data or `undefined` if no session was - * negotiated. On the client, the data can be provided to the `session` option of {@link connect} to resume the connection. On the server, it may be useful - * for debugging. - * - * See `Session Resumption` for more information. - * - * Note: `getSession()` works only for TLSv1.2 and below. For TLSv1.3, applications - * must use the `'session'` event (it also works for TLSv1.2 and below). - * @since v0.11.4 - */ - getSession(): Buffer | undefined; - /** - * See [SSL\_get\_shared\_sigalgs](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html) for more information. - * @since v12.11.0 - * @return List of signature algorithms shared between the server and the client in the order of decreasing preference. - */ - getSharedSigalgs(): string[]; - /** - * For a client, returns the TLS session ticket if one is available, or`undefined`. For a server, always returns `undefined`. - * - * It may be useful for debugging. - * - * See `Session Resumption` for more information. - * @since v0.11.4 - */ - getTLSTicket(): Buffer | undefined; - /** - * See `Session Resumption` for more information. - * @since v0.5.6 - * @return `true` if the session was reused, `false` otherwise. - */ - isSessionReused(): boolean; - /** - * The `tlsSocket.renegotiate()` method initiates a TLS renegotiation process. - * Upon completion, the `callback` function will be passed a single argument - * that is either an `Error` (if the request failed) or `null`. - * - * This method can be used to request a peer's certificate after the secure - * connection has been established. - * - * When running as the server, the socket will be destroyed with an error after `handshakeTimeout` timeout. - * - * For TLSv1.3, renegotiation cannot be initiated, it is not supported by the - * protocol. - * @since v0.11.8 - * @param callback If `renegotiate()` returned `true`, callback is attached once to the `'secure'` event. If `renegotiate()` returned `false`, `callback` will be called in the next tick with - * an error, unless the `tlsSocket` has been destroyed, in which case `callback` will not be called at all. - * @return `true` if renegotiation was initiated, `false` otherwise. - */ - renegotiate( - options: { - rejectUnauthorized?: boolean | undefined; - requestCert?: boolean | undefined; - }, - callback: (err: Error | null) => void, - ): undefined | boolean; - /** - * The `tlsSocket.setMaxSendFragment()` method sets the maximum TLS fragment size. - * Returns `true` if setting the limit succeeded; `false` otherwise. - * - * Smaller fragment sizes decrease the buffering latency on the client: larger - * fragments are buffered by the TLS layer until the entire fragment is received - * and its integrity is verified; large fragments can span multiple roundtrips - * and their processing can be delayed due to packet loss or reordering. However, - * smaller fragments add extra TLS framing bytes and CPU overhead, which may - * decrease overall server throughput. - * @since v0.11.11 - * @param [size=16384] The maximum TLS fragment size. The maximum value is `16384`. - */ - setMaxSendFragment(size: number): boolean; - /** - * Disables TLS renegotiation for this `TLSSocket` instance. Once called, attempts - * to renegotiate will trigger an `'error'` event on the `TLSSocket`. - * @since v8.4.0 - */ - disableRenegotiation(): void; - /** - * When enabled, TLS packet trace information is written to `stderr`. This can be - * used to debug TLS connection problems. - * - * The format of the output is identical to the output of`openssl s_client -trace` or `openssl s_server -trace`. While it is produced by - * OpenSSL's `SSL_trace()` function, the format is undocumented, can change - * without notice, and should not be relied on. - * @since v12.2.0 - */ - enableTrace(): void; - /** - * Returns the peer certificate as an `X509Certificate` object. - * - * If there is no peer certificate, or the socket has been destroyed,`undefined` will be returned. - * @since v15.9.0 - */ - getPeerX509Certificate(): X509Certificate | undefined; - /** - * Returns the local certificate as an `X509Certificate` object. - * - * If there is no local certificate, or the socket has been destroyed,`undefined` will be returned. - * @since v15.9.0 - */ - getX509Certificate(): X509Certificate | undefined; - /** - * Keying material is used for validations to prevent different kind of attacks in - * network protocols, for example in the specifications of IEEE 802.1X. - * - * Example - * - * ```js - * const keyingMaterial = tlsSocket.exportKeyingMaterial( - * 128, - * 'client finished'); - * - * /* - * Example return value of keyingMaterial: - * - * - * ``` - * - * See the OpenSSL [`SSL_export_keying_material`](https://www.openssl.org/docs/man1.1.1/man3/SSL_export_keying_material.html) documentation for more - * information. - * @since v13.10.0, v12.17.0 - * @param length number of bytes to retrieve from keying material - * @param label an application specific label, typically this will be a value from the [IANA Exporter Label - * Registry](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#exporter-labels). - * @param context Optionally provide a context. - * @return requested bytes of the keying material - */ - exportKeyingMaterial(length: number, label: string, context: Buffer): Buffer; - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; - addListener(event: "secureConnect", listener: () => void): this; - addListener(event: "session", listener: (session: Buffer) => void): this; - addListener(event: "keylog", listener: (line: Buffer) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "OCSPResponse", response: Buffer): boolean; - emit(event: "secureConnect"): boolean; - emit(event: "session", session: Buffer): boolean; - emit(event: "keylog", line: Buffer): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "OCSPResponse", listener: (response: Buffer) => void): this; - on(event: "secureConnect", listener: () => void): this; - on(event: "session", listener: (session: Buffer) => void): this; - on(event: "keylog", listener: (line: Buffer) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "OCSPResponse", listener: (response: Buffer) => void): this; - once(event: "secureConnect", listener: () => void): this; - once(event: "session", listener: (session: Buffer) => void): this; - once(event: "keylog", listener: (line: Buffer) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; - prependListener(event: "secureConnect", listener: () => void): this; - prependListener(event: "session", listener: (session: Buffer) => void): this; - prependListener(event: "keylog", listener: (line: Buffer) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; - prependOnceListener(event: "secureConnect", listener: () => void): this; - prependOnceListener(event: "session", listener: (session: Buffer) => void): this; - prependOnceListener(event: "keylog", listener: (line: Buffer) => void): this; - } - interface CommonConnectionOptions { - /** - * An optional TLS context object from tls.createSecureContext() - */ - secureContext?: SecureContext | undefined; - /** - * When enabled, TLS packet trace information is written to `stderr`. This can be - * used to debug TLS connection problems. - * @default false - */ - enableTrace?: boolean | undefined; - /** - * If true the server will request a certificate from clients that - * connect and attempt to verify that certificate. Defaults to - * false. - */ - requestCert?: boolean | undefined; - /** - * An array of strings or a Buffer naming possible ALPN protocols. - * (Protocols should be ordered by their priority.) - */ - ALPNProtocols?: string[] | Uint8Array[] | Uint8Array | undefined; - /** - * SNICallback(servername, cb) A function that will be - * called if the client supports SNI TLS extension. Two arguments - * will be passed when called: servername and cb. SNICallback should - * invoke cb(null, ctx), where ctx is a SecureContext instance. - * (tls.createSecureContext(...) can be used to get a proper - * SecureContext.) If SNICallback wasn't provided the default callback - * with high-level API will be used (see below). - */ - SNICallback?: ((servername: string, cb: (err: Error | null, ctx?: SecureContext) => void) => void) | undefined; - /** - * If true the server will reject any connection which is not - * authorized with the list of supplied CAs. This option only has an - * effect if requestCert is true. - * @default true - */ - rejectUnauthorized?: boolean | undefined; - } - interface TlsOptions extends SecureContextOptions, CommonConnectionOptions, net.ServerOpts { - /** - * Abort the connection if the SSL/TLS handshake does not finish in the - * specified number of milliseconds. A 'tlsClientError' is emitted on - * the tls.Server object whenever a handshake times out. Default: - * 120000 (120 seconds). - */ - handshakeTimeout?: number | undefined; - /** - * The number of seconds after which a TLS session created by the - * server will no longer be resumable. See Session Resumption for more - * information. Default: 300. - */ - sessionTimeout?: number | undefined; - /** - * 48-bytes of cryptographically strong pseudo-random data. - */ - ticketKeys?: Buffer | undefined; - /** - * @param socket - * @param identity identity parameter sent from the client. - * @return pre-shared key that must either be - * a buffer or `null` to stop the negotiation process. Returned PSK must be - * compatible with the selected cipher's digest. - * - * When negotiating TLS-PSK (pre-shared keys), this function is called - * with the identity provided by the client. - * If the return value is `null` the negotiation process will stop and an - * "unknown_psk_identity" alert message will be sent to the other party. - * If the server wishes to hide the fact that the PSK identity was not known, - * the callback must provide some random data as `psk` to make the connection - * fail with "decrypt_error" before negotiation is finished. - * PSK ciphers are disabled by default, and using TLS-PSK thus - * requires explicitly specifying a cipher suite with the `ciphers` option. - * More information can be found in the RFC 4279. - */ - pskCallback?(socket: TLSSocket, identity: string): DataView | NodeJS.TypedArray | null; - /** - * hint to send to a client to help - * with selecting the identity during TLS-PSK negotiation. Will be ignored - * in TLS 1.3. Upon failing to set pskIdentityHint `tlsClientError` will be - * emitted with `ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED` code. - */ - pskIdentityHint?: string | undefined; - } - interface PSKCallbackNegotation { - psk: DataView | NodeJS.TypedArray; - identity: string; - } - interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions { - host?: string | undefined; - port?: number | undefined; - path?: string | undefined; // Creates unix socket connection to path. If this option is specified, `host` and `port` are ignored. - socket?: stream.Duplex | undefined; // Establish secure connection on a given socket rather than creating a new socket - checkServerIdentity?: typeof checkServerIdentity | undefined; - servername?: string | undefined; // SNI TLS Extension - session?: Buffer | undefined; - minDHSize?: number | undefined; - lookup?: net.LookupFunction | undefined; - timeout?: number | undefined; - /** - * When negotiating TLS-PSK (pre-shared keys), this function is called - * with optional identity `hint` provided by the server or `null` - * in case of TLS 1.3 where `hint` was removed. - * It will be necessary to provide a custom `tls.checkServerIdentity()` - * for the connection as the default one will try to check hostname/IP - * of the server against the certificate but that's not applicable for PSK - * because there won't be a certificate present. - * More information can be found in the RFC 4279. - * - * @param hint message sent from the server to help client - * decide which identity to use during negotiation. - * Always `null` if TLS 1.3 is used. - * @returns Return `null` to stop the negotiation process. `psk` must be - * compatible with the selected cipher's digest. - * `identity` must use UTF-8 encoding. - */ - pskCallback?(hint: string | null): PSKCallbackNegotation | null; - } - /** - * Accepts encrypted connections using TLS or SSL. - * @since v0.3.2 - */ - class Server extends net.Server { - constructor(secureConnectionListener?: (socket: TLSSocket) => void); - constructor(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void); - /** - * The `server.addContext()` method adds a secure context that will be used if - * the client request's SNI name matches the supplied `hostname` (or wildcard). - * - * When there are multiple matching contexts, the most recently added one is - * used. - * @since v0.5.3 - * @param hostname A SNI host name or wildcard (e.g. `'*'`) - * @param context An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc), or a TLS context object created - * with {@link createSecureContext} itself. - */ - addContext(hostname: string, context: SecureContextOptions): void; - /** - * Returns the session ticket keys. - * - * See `Session Resumption` for more information. - * @since v3.0.0 - * @return A 48-byte buffer containing the session ticket keys. - */ - getTicketKeys(): Buffer; - /** - * The `server.setSecureContext()` method replaces the secure context of an - * existing server. Existing connections to the server are not interrupted. - * @since v11.0.0 - * @param options An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc). - */ - setSecureContext(options: SecureContextOptions): void; - /** - * Sets the session ticket keys. - * - * Changes to the ticket keys are effective only for future server connections. - * Existing or currently pending server connections will use the previous keys. - * - * See `Session Resumption` for more information. - * @since v3.0.0 - * @param keys A 48-byte buffer containing the session ticket keys. - */ - setTicketKeys(keys: Buffer): void; - /** - * events.EventEmitter - * 1. tlsClientError - * 2. newSession - * 3. OCSPRequest - * 4. resumeSession - * 5. secureConnection - * 6. keylog - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - addListener( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void, - ): this; - addListener( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - addListener( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void, - ): this; - addListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; - addListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "tlsClientError", err: Error, tlsSocket: TLSSocket): boolean; - emit(event: "newSession", sessionId: Buffer, sessionData: Buffer, callback: () => void): boolean; - emit( - event: "OCSPRequest", - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ): boolean; - emit( - event: "resumeSession", - sessionId: Buffer, - callback: (err: Error | null, sessionData: Buffer | null) => void, - ): boolean; - emit(event: "secureConnection", tlsSocket: TLSSocket): boolean; - emit(event: "keylog", line: Buffer, tlsSocket: TLSSocket): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - on(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this; - on( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - on( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void, - ): this; - on(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; - on(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - once( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void, - ): this; - once( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - once( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void, - ): this; - once(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; - once(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - prependListener( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void, - ): this; - prependListener( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - prependListener( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void, - ): this; - prependListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; - prependListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - prependOnceListener( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void, - ): this; - prependOnceListener( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - prependOnceListener( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void, - ): this; - prependOnceListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; - prependOnceListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - } - /** - * @deprecated since v0.11.3 Use `tls.TLSSocket` instead. - */ - interface SecurePair { - encrypted: TLSSocket; - cleartext: TLSSocket; - } - type SecureVersion = "TLSv1.3" | "TLSv1.2" | "TLSv1.1" | "TLSv1"; - interface SecureContextOptions { - /** - * If set, this will be called when a client opens a connection using the ALPN extension. - * One argument will be passed to the callback: an object containing `servername` and `protocols` fields, - * respectively containing the server name from the SNI extension (if any) and an array of - * ALPN protocol name strings. The callback must return either one of the strings listed in `protocols`, - * which will be returned to the client as the selected ALPN protocol, or `undefined`, - * to reject the connection with a fatal alert. If a string is returned that does not match one of - * the client's ALPN protocols, an error will be thrown. - * This option cannot be used with the `ALPNProtocols` option, and setting both options will throw an error. - */ - ALPNCallback?: ((arg: { servername: string; protocols: string[] }) => string | undefined) | undefined; - /** - * Optionally override the trusted CA certificates. Default is to trust - * the well-known CAs curated by Mozilla. Mozilla's CAs are completely - * replaced when CAs are explicitly specified using this option. - */ - ca?: string | Buffer | Array | undefined; - /** - * Cert chains in PEM format. One cert chain should be provided per - * private key. Each cert chain should consist of the PEM formatted - * certificate for a provided private key, followed by the PEM - * formatted intermediate certificates (if any), in order, and not - * including the root CA (the root CA must be pre-known to the peer, - * see ca). When providing multiple cert chains, they do not have to - * be in the same order as their private keys in key. If the - * intermediate certificates are not provided, the peer will not be - * able to validate the certificate, and the handshake will fail. - */ - cert?: string | Buffer | Array | undefined; - /** - * Colon-separated list of supported signature algorithms. The list - * can contain digest algorithms (SHA256, MD5 etc.), public key - * algorithms (RSA-PSS, ECDSA etc.), combination of both (e.g - * 'RSA+SHA384') or TLS v1.3 scheme names (e.g. rsa_pss_pss_sha512). - */ - sigalgs?: string | undefined; - /** - * Cipher suite specification, replacing the default. For more - * information, see modifying the default cipher suite. Permitted - * ciphers can be obtained via tls.getCiphers(). Cipher names must be - * uppercased in order for OpenSSL to accept them. - */ - ciphers?: string | undefined; - /** - * Name of an OpenSSL engine which can provide the client certificate. - * @deprecated - */ - clientCertEngine?: string | undefined; - /** - * PEM formatted CRLs (Certificate Revocation Lists). - */ - crl?: string | Buffer | Array | undefined; - /** - * `'auto'` or custom Diffie-Hellman parameters, required for non-ECDHE perfect forward secrecy. - * If omitted or invalid, the parameters are silently discarded and DHE ciphers will not be available. - * ECDHE-based perfect forward secrecy will still be available. - */ - dhparam?: string | Buffer | undefined; - /** - * A string describing a named curve or a colon separated list of curve - * NIDs or names, for example P-521:P-384:P-256, to use for ECDH key - * agreement. Set to auto to select the curve automatically. Use - * crypto.getCurves() to obtain a list of available curve names. On - * recent releases, openssl ecparam -list_curves will also display the - * name and description of each available elliptic curve. Default: - * tls.DEFAULT_ECDH_CURVE. - */ - ecdhCurve?: string | undefined; - /** - * Attempt to use the server's cipher suite preferences instead of the - * client's. When true, causes SSL_OP_CIPHER_SERVER_PREFERENCE to be - * set in secureOptions - */ - honorCipherOrder?: boolean | undefined; - /** - * Private keys in PEM format. PEM allows the option of private keys - * being encrypted. Encrypted keys will be decrypted with - * options.passphrase. Multiple keys using different algorithms can be - * provided either as an array of unencrypted key strings or buffers, - * or an array of objects in the form {pem: [, - * passphrase: ]}. The object form can only occur in an array. - * object.passphrase is optional. Encrypted keys will be decrypted with - * object.passphrase if provided, or options.passphrase if it is not. - */ - key?: string | Buffer | Array | undefined; - /** - * Name of an OpenSSL engine to get private key from. Should be used - * together with privateKeyIdentifier. - * @deprecated - */ - privateKeyEngine?: string | undefined; - /** - * Identifier of a private key managed by an OpenSSL engine. Should be - * used together with privateKeyEngine. Should not be set together with - * key, because both options define a private key in different ways. - * @deprecated - */ - privateKeyIdentifier?: string | undefined; - /** - * Optionally set the maximum TLS version to allow. One - * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the - * `secureProtocol` option, use one or the other. - * **Default:** `'TLSv1.3'`, unless changed using CLI options. Using - * `--tls-max-v1.2` sets the default to `'TLSv1.2'`. Using `--tls-max-v1.3` sets the default to - * `'TLSv1.3'`. If multiple of the options are provided, the highest maximum is used. - */ - maxVersion?: SecureVersion | undefined; - /** - * Optionally set the minimum TLS version to allow. One - * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the - * `secureProtocol` option, use one or the other. It is not recommended to use - * less than TLSv1.2, but it may be required for interoperability. - * **Default:** `'TLSv1.2'`, unless changed using CLI options. Using - * `--tls-v1.0` sets the default to `'TLSv1'`. Using `--tls-v1.1` sets the default to - * `'TLSv1.1'`. Using `--tls-min-v1.3` sets the default to - * 'TLSv1.3'. If multiple of the options are provided, the lowest minimum is used. - */ - minVersion?: SecureVersion | undefined; - /** - * Shared passphrase used for a single private key and/or a PFX. - */ - passphrase?: string | undefined; - /** - * PFX or PKCS12 encoded private key and certificate chain. pfx is an - * alternative to providing key and cert individually. PFX is usually - * encrypted, if it is, passphrase will be used to decrypt it. Multiple - * PFX can be provided either as an array of unencrypted PFX buffers, - * or an array of objects in the form {buf: [, - * passphrase: ]}. The object form can only occur in an array. - * object.passphrase is optional. Encrypted PFX will be decrypted with - * object.passphrase if provided, or options.passphrase if it is not. - */ - pfx?: string | Buffer | Array | undefined; - /** - * Optionally affect the OpenSSL protocol behavior, which is not - * usually necessary. This should be used carefully if at all! Value is - * a numeric bitmask of the SSL_OP_* options from OpenSSL Options - */ - secureOptions?: number | undefined; // Value is a numeric bitmask of the `SSL_OP_*` options - /** - * Legacy mechanism to select the TLS protocol version to use, it does - * not support independent control of the minimum and maximum version, - * and does not support limiting the protocol to TLSv1.3. Use - * minVersion and maxVersion instead. The possible values are listed as - * SSL_METHODS, use the function names as strings. For example, use - * 'TLSv1_1_method' to force TLS version 1.1, or 'TLS_method' to allow - * any TLS protocol version up to TLSv1.3. It is not recommended to use - * TLS versions less than 1.2, but it may be required for - * interoperability. Default: none, see minVersion. - */ - secureProtocol?: string | undefined; - /** - * Opaque identifier used by servers to ensure session state is not - * shared between applications. Unused by clients. - */ - sessionIdContext?: string | undefined; - /** - * 48-bytes of cryptographically strong pseudo-random data. - * See Session Resumption for more information. - */ - ticketKeys?: Buffer | undefined; - /** - * The number of seconds after which a TLS session created by the - * server will no longer be resumable. See Session Resumption for more - * information. Default: 300. - */ - sessionTimeout?: number | undefined; - } - interface SecureContext { - context: any; - } - /** - * Verifies the certificate `cert` is issued to `hostname`. - * - * Returns [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object, populating it with `reason`, `host`, and `cert` on - * failure. On success, returns [undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Undefined_type). - * - * This function is intended to be used in combination with the`checkServerIdentity` option that can be passed to {@link connect} and as - * such operates on a `certificate object`. For other purposes, consider using `x509.checkHost()` instead. - * - * This function can be overwritten by providing an alternative function as the `options.checkServerIdentity` option that is passed to `tls.connect()`. The - * overwriting function can call `tls.checkServerIdentity()` of course, to augment - * the checks done with additional verification. - * - * This function is only called if the certificate passed all other checks, such as - * being issued by trusted CA (`options.ca`). - * - * Earlier versions of Node.js incorrectly accepted certificates for a given`hostname` if a matching `uniformResourceIdentifier` subject alternative name - * was present (see [CVE-2021-44531](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44531)). Applications that wish to accept`uniformResourceIdentifier` subject alternative names can use - * a custom `options.checkServerIdentity` function that implements the desired behavior. - * @since v0.8.4 - * @param hostname The host name or IP address to verify the certificate against. - * @param cert A `certificate object` representing the peer's certificate. - */ - function checkServerIdentity(hostname: string, cert: PeerCertificate): Error | undefined; - /** - * Creates a new {@link Server}. The `secureConnectionListener`, if provided, is - * automatically set as a listener for the `'secureConnection'` event. - * - * The `ticketKeys` options is automatically shared between `node:cluster` module - * workers. - * - * The following illustrates a simple echo server: - * - * ```js - * import tls from 'node:tls'; - * import fs from 'node:fs'; - * - * const options = { - * key: fs.readFileSync('server-key.pem'), - * cert: fs.readFileSync('server-cert.pem'), - * - * // This is necessary only if using client certificate authentication. - * requestCert: true, - * - * // This is necessary only if the client uses a self-signed certificate. - * ca: [ fs.readFileSync('client-cert.pem') ], - * }; - * - * const server = tls.createServer(options, (socket) => { - * console.log('server connected', - * socket.authorized ? 'authorized' : 'unauthorized'); - * socket.write('welcome!\n'); - * socket.setEncoding('utf8'); - * socket.pipe(socket); - * }); - * server.listen(8000, () => { - * console.log('server bound'); - * }); - * ``` - * - * The server can be tested by connecting to it using the example client from {@link connect}. - * @since v0.3.2 - */ - function createServer(secureConnectionListener?: (socket: TLSSocket) => void): Server; - function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server; - /** - * The `callback` function, if specified, will be added as a listener for the `'secureConnect'` event. - * - * `tls.connect()` returns a {@link TLSSocket} object. - * - * Unlike the `https` API, `tls.connect()` does not enable the - * SNI (Server Name Indication) extension by default, which may cause some - * servers to return an incorrect certificate or reject the connection - * altogether. To enable SNI, set the `servername` option in addition - * to `host`. - * - * The following illustrates a client for the echo server example from {@link createServer}: - * - * ```js - * // Assumes an echo server that is listening on port 8000. - * import tls from 'node:tls'; - * import fs from 'node:fs'; - * - * const options = { - * // Necessary only if the server requires client certificate authentication. - * key: fs.readFileSync('client-key.pem'), - * cert: fs.readFileSync('client-cert.pem'), - * - * // Necessary only if the server uses a self-signed certificate. - * ca: [ fs.readFileSync('server-cert.pem') ], - * - * // Necessary only if the server's cert isn't for "localhost". - * checkServerIdentity: () => { return null; }, - * }; - * - * const socket = tls.connect(8000, options, () => { - * console.log('client connected', - * socket.authorized ? 'authorized' : 'unauthorized'); - * process.stdin.pipe(socket); - * process.stdin.resume(); - * }); - * socket.setEncoding('utf8'); - * socket.on('data', (data) => { - * console.log(data); - * }); - * socket.on('end', () => { - * console.log('server ends connection'); - * }); - * ``` - * @since v0.11.3 - */ - function connect(options: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; - function connect( - port: number, - host?: string, - options?: ConnectionOptions, - secureConnectListener?: () => void, - ): TLSSocket; - function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; - /** - * Creates a new secure pair object with two streams, one of which reads and writes - * the encrypted data and the other of which reads and writes the cleartext data. - * Generally, the encrypted stream is piped to/from an incoming encrypted data - * stream and the cleartext one is used as a replacement for the initial encrypted - * stream. - * - * `tls.createSecurePair()` returns a `tls.SecurePair` object with `cleartext` and `encrypted` stream properties. - * - * Using `cleartext` has the same API as {@link TLSSocket}. - * - * The `tls.createSecurePair()` method is now deprecated in favor of`tls.TLSSocket()`. For example, the code: - * - * ```js - * pair = tls.createSecurePair(// ... ); - * pair.encrypted.pipe(socket); - * socket.pipe(pair.encrypted); - * ``` - * - * can be replaced by: - * - * ```js - * secureSocket = tls.TLSSocket(socket, options); - * ``` - * - * where `secureSocket` has the same API as `pair.cleartext`. - * @since v0.3.2 - * @deprecated Since v0.11.3 - Use {@link TLSSocket} instead. - * @param context A secure context object as returned by `tls.createSecureContext()` - * @param isServer `true` to specify that this TLS connection should be opened as a server. - * @param requestCert `true` to specify whether a server should request a certificate from a connecting client. Only applies when `isServer` is `true`. - * @param rejectUnauthorized If not `false` a server automatically reject clients with invalid certificates. Only applies when `isServer` is `true`. - */ - function createSecurePair( - context?: SecureContext, - isServer?: boolean, - requestCert?: boolean, - rejectUnauthorized?: boolean, - ): SecurePair; - /** - * `{@link createServer}` sets the default value of the `honorCipherOrder` option - * to `true`, other APIs that create secure contexts leave it unset. - * - * `{@link createServer}` uses a 128 bit truncated SHA1 hash value generated - * from `process.argv` as the default value of the `sessionIdContext` option, other - * APIs that create secure contexts have no default value. - * - * The `tls.createSecureContext()` method creates a `SecureContext` object. It is - * usable as an argument to several `tls` APIs, such as `server.addContext()`, - * but has no public methods. The {@link Server} constructor and the {@link createServer} method do not support the `secureContext` option. - * - * A key is _required_ for ciphers that use certificates. Either `key` or `pfx` can be used to provide it. - * - * If the `ca` option is not given, then Node.js will default to using [Mozilla's publicly trusted list of - * CAs](https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt). - * - * Custom DHE parameters are discouraged in favor of the new `dhparam: 'auto' `option. When set to `'auto'`, well-known DHE parameters of sufficient strength - * will be selected automatically. Otherwise, if necessary, `openssl dhparam` can - * be used to create custom parameters. The key length must be greater than or - * equal to 1024 bits or else an error will be thrown. Although 1024 bits is - * permissible, use 2048 bits or larger for stronger security. - * @since v0.11.13 - */ - function createSecureContext(options?: SecureContextOptions): SecureContext; - /** - * Returns an array with the names of the supported TLS ciphers. The names are - * lower-case for historical reasons, but must be uppercased to be used in - * the `ciphers` option of `{@link createSecureContext}`. - * - * Not all supported ciphers are enabled by default. See - * [Modifying the default TLS cipher suite](https://nodejs.org/docs/latest-v22.x/api/tls.html#modifying-the-default-tls-cipher-suite). - * - * Cipher names that start with `'tls_'` are for TLSv1.3, all the others are for - * TLSv1.2 and below. - * - * ```js - * console.log(tls.getCiphers()); // ['aes128-gcm-sha256', 'aes128-sha', ...] - * ``` - * @since v0.10.2 - */ - function getCiphers(): string[]; - /** - * The default curve name to use for ECDH key agreement in a tls server. - * The default value is `'auto'`. See `{@link createSecureContext()}` for further - * information. - * @since v0.11.13 - */ - let DEFAULT_ECDH_CURVE: string; - /** - * The default value of the `maxVersion` option of `{@link createSecureContext()}`. - * It can be assigned any of the supported TLS protocol versions, - * `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. **Default:** `'TLSv1.3'`, unless - * changed using CLI options. Using `--tls-max-v1.2` sets the default to `'TLSv1.2'`. Using - * `--tls-max-v1.3` sets the default to `'TLSv1.3'`. If multiple of the options - * are provided, the highest maximum is used. - * @since v11.4.0 - */ - let DEFAULT_MAX_VERSION: SecureVersion; - /** - * The default value of the `minVersion` option of `{@link createSecureContext()}`. - * It can be assigned any of the supported TLS protocol versions, - * `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. **Default:** `'TLSv1.2'`, unless - * changed using CLI options. Using `--tls-min-v1.0` sets the default to - * `'TLSv1'`. Using `--tls-min-v1.1` sets the default to `'TLSv1.1'`. Using - * `--tls-min-v1.3` sets the default to `'TLSv1.3'`. If multiple of the options - * are provided, the lowest minimum is used. - * @since v11.4.0 - */ - let DEFAULT_MIN_VERSION: SecureVersion; - /** - * The default value of the `ciphers` option of `{@link createSecureContext()}`. - * It can be assigned any of the supported OpenSSL ciphers. - * Defaults to the content of `crypto.constants.defaultCoreCipherList`, unless - * changed using CLI options using `--tls-default-ciphers`. - * @since v19.8.0 - */ - let DEFAULT_CIPHERS: string; - /** - * An immutable array of strings representing the root certificates (in PEM format) - * from the bundled Mozilla CA store as supplied by the current Node.js version. - * - * The bundled CA store, as supplied by Node.js, is a snapshot of Mozilla CA store - * that is fixed at release time. It is identical on all supported platforms. - * @since v12.3.0 - */ - const rootCertificates: readonly string[]; -} -declare module "node:tls" { - export * from "tls"; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/trace_events.d.ts b/tools/mnemonic-test/node_modules/@types/node/trace_events.d.ts deleted file mode 100644 index f334b0bc..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/trace_events.d.ts +++ /dev/null @@ -1,197 +0,0 @@ -/** - * The `node:trace_events` module provides a mechanism to centralize tracing information - * generated by V8, Node.js core, and userspace code. - * - * Tracing can be enabled with the `--trace-event-categories` command-line flag - * or by using the `trace_events` module. The `--trace-event-categories` flag - * accepts a list of comma-separated category names. - * - * The available categories are: - * - * * `node`: An empty placeholder. - * * `node.async_hooks`: Enables capture of detailed [`async_hooks`](https://nodejs.org/docs/latest-v22.x/api/async_hooks.html) trace data. - * The [`async_hooks`](https://nodejs.org/docs/latest-v22.x/api/async_hooks.html) events have a unique `asyncId` and a special `triggerId` `triggerAsyncId` property. - * * `node.bootstrap`: Enables capture of Node.js bootstrap milestones. - * * `node.console`: Enables capture of `console.time()` and `console.count()` output. - * * `node.threadpoolwork.sync`: Enables capture of trace data for threadpool synchronous operations, such as `blob`, `zlib`, `crypto` and `node_api`. - * * `node.threadpoolwork.async`: Enables capture of trace data for threadpool asynchronous operations, such as `blob`, `zlib`, `crypto` and `node_api`. - * * `node.dns.native`: Enables capture of trace data for DNS queries. - * * `node.net.native`: Enables capture of trace data for network. - * * `node.environment`: Enables capture of Node.js Environment milestones. - * * `node.fs.sync`: Enables capture of trace data for file system sync methods. - * * `node.fs_dir.sync`: Enables capture of trace data for file system sync directory methods. - * * `node.fs.async`: Enables capture of trace data for file system async methods. - * * `node.fs_dir.async`: Enables capture of trace data for file system async directory methods. - * * `node.perf`: Enables capture of [Performance API](https://nodejs.org/docs/latest-v22.x/api/perf_hooks.html) measurements. - * * `node.perf.usertiming`: Enables capture of only Performance API User Timing - * measures and marks. - * * `node.perf.timerify`: Enables capture of only Performance API timerify - * measurements. - * * `node.promises.rejections`: Enables capture of trace data tracking the number - * of unhandled Promise rejections and handled-after-rejections. - * * `node.vm.script`: Enables capture of trace data for the `node:vm` module's `runInNewContext()`, `runInContext()`, and `runInThisContext()` methods. - * * `v8`: The [V8](https://nodejs.org/docs/latest-v22.x/api/v8.html) events are GC, compiling, and execution related. - * * `node.http`: Enables capture of trace data for http request / response. - * - * By default the `node`, `node.async_hooks`, and `v8` categories are enabled. - * - * ```bash - * node --trace-event-categories v8,node,node.async_hooks server.js - * ``` - * - * Prior versions of Node.js required the use of the `--trace-events-enabled` flag to enable trace events. This requirement has been removed. However, the `--trace-events-enabled` flag _may_ still be - * used and will enable the `node`, `node.async_hooks`, and `v8` trace event categories by default. - * - * ```bash - * node --trace-events-enabled - * - * # is equivalent to - * - * node --trace-event-categories v8,node,node.async_hooks - * ``` - * - * Alternatively, trace events may be enabled using the `node:trace_events` module: - * - * ```js - * import trace_events from 'node:trace_events'; - * const tracing = trace_events.createTracing({ categories: ['node.perf'] }); - * tracing.enable(); // Enable trace event capture for the 'node.perf' category - * - * // do work - * - * tracing.disable(); // Disable trace event capture for the 'node.perf' category - * ``` - * - * Running Node.js with tracing enabled will produce log files that can be opened - * in the [`chrome://tracing`](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) tab of Chrome. - * - * The logging file is by default called `node_trace.${rotation}.log`, where `${rotation}` is an incrementing log-rotation id. The filepath pattern can - * be specified with `--trace-event-file-pattern` that accepts a template - * string that supports `${rotation}` and `${pid}`: - * - * ```bash - * node --trace-event-categories v8 --trace-event-file-pattern '${pid}-${rotation}.log' server.js - * ``` - * - * To guarantee that the log file is properly generated after signal events like `SIGINT`, `SIGTERM`, or `SIGBREAK`, make sure to have the appropriate handlers - * in your code, such as: - * - * ```js - * process.on('SIGINT', function onSigint() { - * console.info('Received SIGINT.'); - * process.exit(130); // Or applicable exit code depending on OS and signal - * }); - * ``` - * - * The tracing system uses the same time source - * as the one used by `process.hrtime()`. - * However the trace-event timestamps are expressed in microseconds, - * unlike `process.hrtime()` which returns nanoseconds. - * - * The features from this module are not available in [`Worker`](https://nodejs.org/docs/latest-v22.x/api/worker_threads.html#class-worker) threads. - * @experimental - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/trace_events.js) - */ -declare module "trace_events" { - /** - * The `Tracing` object is used to enable or disable tracing for sets of - * categories. Instances are created using the - * `trace_events.createTracing()` method. - * - * When created, the `Tracing` object is disabled. Calling the - * `tracing.enable()` method adds the categories to the set of enabled trace - * event categories. Calling `tracing.disable()` will remove the categories - * from the set of enabled trace event categories. - */ - interface Tracing { - /** - * A comma-separated list of the trace event categories covered by this - * `Tracing` object. - * @since v10.0.0 - */ - readonly categories: string; - /** - * Disables this `Tracing` object. - * - * Only trace event categories _not_ covered by other enabled `Tracing` - * objects and _not_ specified by the `--trace-event-categories` flag - * will be disabled. - * - * ```js - * import trace_events from 'node:trace_events'; - * const t1 = trace_events.createTracing({ categories: ['node', 'v8'] }); - * const t2 = trace_events.createTracing({ categories: ['node.perf', 'node'] }); - * t1.enable(); - * t2.enable(); - * - * // Prints 'node,node.perf,v8' - * console.log(trace_events.getEnabledCategories()); - * - * t2.disable(); // Will only disable emission of the 'node.perf' category - * - * // Prints 'node,v8' - * console.log(trace_events.getEnabledCategories()); - * ``` - * @since v10.0.0 - */ - disable(): void; - /** - * Enables this `Tracing` object for the set of categories covered by - * the `Tracing` object. - * @since v10.0.0 - */ - enable(): void; - /** - * `true` only if the `Tracing` object has been enabled. - * @since v10.0.0 - */ - readonly enabled: boolean; - } - interface CreateTracingOptions { - /** - * An array of trace category names. Values included in the array are - * coerced to a string when possible. An error will be thrown if the - * value cannot be coerced. - */ - categories: string[]; - } - /** - * Creates and returns a `Tracing` object for the given set of `categories`. - * - * ```js - * import trace_events from 'node:trace_events'; - * const categories = ['node.perf', 'node.async_hooks']; - * const tracing = trace_events.createTracing({ categories }); - * tracing.enable(); - * // do stuff - * tracing.disable(); - * ``` - * @since v10.0.0 - */ - function createTracing(options: CreateTracingOptions): Tracing; - /** - * Returns a comma-separated list of all currently-enabled trace event - * categories. The current set of enabled trace event categories is determined - * by the _union_ of all currently-enabled `Tracing` objects and any categories - * enabled using the `--trace-event-categories` flag. - * - * Given the file `test.js` below, the command `node --trace-event-categories node.perf test.js` will print `'node.async_hooks,node.perf'` to the console. - * - * ```js - * import trace_events from 'node:trace_events'; - * const t1 = trace_events.createTracing({ categories: ['node.async_hooks'] }); - * const t2 = trace_events.createTracing({ categories: ['node.perf'] }); - * const t3 = trace_events.createTracing({ categories: ['v8'] }); - * - * t1.enable(); - * t2.enable(); - * - * console.log(trace_events.getEnabledCategories()); - * ``` - * @since v10.0.0 - */ - function getEnabledCategories(): string | undefined; -} -declare module "node:trace_events" { - export * from "trace_events"; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/ts5.6/buffer.buffer.d.ts b/tools/mnemonic-test/node_modules/@types/node/ts5.6/buffer.buffer.d.ts deleted file mode 100644 index 21f72115..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +++ /dev/null @@ -1,385 +0,0 @@ -declare module "buffer" { - global { - interface BufferConstructor { - // see ../buffer.d.ts for implementation shared with all TypeScript versions - - /** - * Allocates a new buffer containing the given {str}. - * - * @param str String to store in buffer. - * @param encoding encoding to use, optional. Default is 'utf8' - * @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead. - */ - new(str: string, encoding?: BufferEncoding): Buffer; - /** - * Allocates a new buffer of {size} octets. - * - * @param size count of octets to allocate. - * @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`). - */ - new(size: number): Buffer; - /** - * Allocates a new buffer containing the given {array} of octets. - * - * @param array The octets to store. - * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. - */ - new(array: Uint8Array): Buffer; - /** - * Produces a Buffer backed by the same allocated memory as - * the given {ArrayBuffer}/{SharedArrayBuffer}. - * - * @param arrayBuffer The ArrayBuffer with which to share memory. - * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead. - */ - new(arrayBuffer: ArrayBuffer | SharedArrayBuffer): Buffer; - /** - * Allocates a new buffer containing the given {array} of octets. - * - * @param array The octets to store. - * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. - */ - new(array: readonly any[]): Buffer; - /** - * Copies the passed {buffer} data onto a new {Buffer} instance. - * - * @param buffer The buffer to copy. - * @deprecated since v10.0.0 - Use `Buffer.from(buffer)` instead. - */ - new(buffer: Buffer): Buffer; - /** - * Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`. - * Array entries outside that range will be truncated to fit into it. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'. - * const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); - * ``` - * - * If `array` is an `Array`\-like object (that is, one with a `length` property of - * type `number`), it is treated as if it is an array, unless it is a `Buffer` or - * a `Uint8Array`. This means all other `TypedArray` variants get treated as an `Array`. To create a `Buffer` from the bytes backing a `TypedArray`, use `Buffer.copyBytesFrom()`. - * - * A `TypeError` will be thrown if `array` is not an `Array` or another type - * appropriate for `Buffer.from()` variants. - * - * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does. - * @since v5.10.0 - */ - from( - arrayBuffer: WithImplicitCoercion, - byteOffset?: number, - length?: number, - ): Buffer; - /** - * Creates a new Buffer using the passed {data} - * @param data data to create a new Buffer - */ - from(data: Uint8Array | readonly number[]): Buffer; - from(data: WithImplicitCoercion): Buffer; - /** - * Creates a new Buffer containing the given JavaScript string {str}. - * If provided, the {encoding} parameter identifies the character encoding. - * If not provided, {encoding} defaults to 'utf8'. - */ - from( - str: - | WithImplicitCoercion - | { - [Symbol.toPrimitive](hint: "string"): string; - }, - encoding?: BufferEncoding, - ): Buffer; - /** - * Creates a new Buffer using the passed {data} - * @param values to create a new Buffer - */ - of(...items: number[]): Buffer; - /** - * Returns a new `Buffer` which is the result of concatenating all the `Buffer` instances in the `list` together. - * - * If the list has no items, or if the `totalLength` is 0, then a new zero-length `Buffer` is returned. - * - * If `totalLength` is not provided, it is calculated from the `Buffer` instances - * in `list` by adding their lengths. - * - * If `totalLength` is provided, it is coerced to an unsigned integer. If the - * combined length of the `Buffer`s in `list` exceeds `totalLength`, the result is - * truncated to `totalLength`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Create a single `Buffer` from a list of three `Buffer` instances. - * - * const buf1 = Buffer.alloc(10); - * const buf2 = Buffer.alloc(14); - * const buf3 = Buffer.alloc(18); - * const totalLength = buf1.length + buf2.length + buf3.length; - * - * console.log(totalLength); - * // Prints: 42 - * - * const bufA = Buffer.concat([buf1, buf2, buf3], totalLength); - * - * console.log(bufA); - * // Prints: - * console.log(bufA.length); - * // Prints: 42 - * ``` - * - * `Buffer.concat()` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does. - * @since v0.7.11 - * @param list List of `Buffer` or {@link Uint8Array} instances to concatenate. - * @param totalLength Total length of the `Buffer` instances in `list` when concatenated. - */ - concat(list: readonly Uint8Array[], totalLength?: number): Buffer; - /** - * Copies the underlying memory of `view` into a new `Buffer`. - * - * ```js - * const u16 = new Uint16Array([0, 0xffff]); - * const buf = Buffer.copyBytesFrom(u16, 1, 1); - * u16[1] = 0; - * console.log(buf.length); // 2 - * console.log(buf[0]); // 255 - * console.log(buf[1]); // 255 - * ``` - * @since v19.8.0 - * @param view The {TypedArray} to copy. - * @param [offset=0] The starting offset within `view`. - * @param [length=view.length - offset] The number of elements from `view` to copy. - */ - copyBytesFrom(view: NodeJS.TypedArray, offset?: number, length?: number): Buffer; - /** - * Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the`Buffer` will be zero-filled. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.alloc(5); - * - * console.log(buf); - * // Prints: - * ``` - * - * If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. - * - * If `fill` is specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill)`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.alloc(5, 'a'); - * - * console.log(buf); - * // Prints: - * ``` - * - * If both `fill` and `encoding` are specified, the allocated `Buffer` will be - * initialized by calling `buf.fill(fill, encoding)`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); - * - * console.log(buf); - * // Prints: - * ``` - * - * Calling `Buffer.alloc()` can be measurably slower than the alternative `Buffer.allocUnsafe()` but ensures that the newly created `Buffer` instance - * contents will never contain sensitive data from previous allocations, including - * data that might not have been allocated for `Buffer`s. - * - * A `TypeError` will be thrown if `size` is not a number. - * @since v5.10.0 - * @param size The desired length of the new `Buffer`. - * @param [fill=0] A value to pre-fill the new `Buffer` with. - * @param [encoding='utf8'] If `fill` is a string, this is its encoding. - */ - alloc(size: number, fill?: string | Uint8Array | number, encoding?: BufferEncoding): Buffer; - /** - * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. - * - * The underlying memory for `Buffer` instances created in this way is _not_ - * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `Buffer.alloc()` instead to initialize`Buffer` instances with zeroes. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(10); - * - * console.log(buf); - * // Prints (contents may vary): - * - * buf.fill(0); - * - * console.log(buf); - * // Prints: - * ``` - * - * A `TypeError` will be thrown if `size` is not a number. - * - * The `Buffer` module pre-allocates an internal `Buffer` instance of - * size `Buffer.poolSize` that is used as a pool for the fast allocation of new `Buffer` instances created using `Buffer.allocUnsafe()`, `Buffer.from(array)`, - * and `Buffer.concat()` only when `size` is less than `Buffer.poolSize >>> 1` (floor of `Buffer.poolSize` divided by two). - * - * Use of this pre-allocated internal memory pool is a key difference between - * calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. - * Specifically, `Buffer.alloc(size, fill)` will _never_ use the internal `Buffer`pool, while `Buffer.allocUnsafe(size).fill(fill)`_will_ use the internal`Buffer` pool if `size` is less - * than or equal to half `Buffer.poolSize`. The - * difference is subtle but can be important when an application requires the - * additional performance that `Buffer.allocUnsafe()` provides. - * @since v5.10.0 - * @param size The desired length of the new `Buffer`. - */ - allocUnsafe(size: number): Buffer; - /** - * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. A zero-length `Buffer` is created if - * `size` is 0. - * - * The underlying memory for `Buffer` instances created in this way is _not_ - * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `buf.fill(0)` to initialize - * such `Buffer` instances with zeroes. - * - * When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, - * allocations under 4 KiB are sliced from a single pre-allocated `Buffer`. This - * allows applications to avoid the garbage collection overhead of creating many - * individually allocated `Buffer` instances. This approach improves both - * performance and memory usage by eliminating the need to track and clean up as - * many individual `ArrayBuffer` objects. - * - * However, in the case where a developer may need to retain a small chunk of - * memory from a pool for an indeterminate amount of time, it may be appropriate - * to create an un-pooled `Buffer` instance using `Buffer.allocUnsafeSlow()` and - * then copying out the relevant bits. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Need to keep around a few small chunks of memory. - * const store = []; - * - * socket.on('readable', () => { - * let data; - * while (null !== (data = readable.read())) { - * // Allocate for retained data. - * const sb = Buffer.allocUnsafeSlow(10); - * - * // Copy the data into the new allocation. - * data.copy(sb, 0, 0, 10); - * - * store.push(sb); - * } - * }); - * ``` - * - * A `TypeError` will be thrown if `size` is not a number. - * @since v5.12.0 - * @param size The desired length of the new `Buffer`. - */ - allocUnsafeSlow(size: number): Buffer; - } - interface Buffer extends Uint8Array { - // see ../buffer.d.ts for implementation shared with all TypeScript versions - - /** - * Returns a new `Buffer` that references the same memory as the original, but - * offset and cropped by the `start` and `end` indices. - * - * This method is not compatible with the `Uint8Array.prototype.slice()`, - * which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('buffer'); - * - * const copiedBuf = Uint8Array.prototype.slice.call(buf); - * copiedBuf[0]++; - * console.log(copiedBuf.toString()); - * // Prints: cuffer - * - * console.log(buf.toString()); - * // Prints: buffer - * - * // With buf.slice(), the original buffer is modified. - * const notReallyCopiedBuf = buf.slice(); - * notReallyCopiedBuf[0]++; - * console.log(notReallyCopiedBuf.toString()); - * // Prints: cuffer - * console.log(buf.toString()); - * // Also prints: cuffer (!) - * ``` - * @since v0.3.0 - * @deprecated Use `subarray` instead. - * @param [start=0] Where the new `Buffer` will start. - * @param [end=buf.length] Where the new `Buffer` will end (not inclusive). - */ - slice(start?: number, end?: number): Buffer; - /** - * Returns a new `Buffer` that references the same memory as the original, but - * offset and cropped by the `start` and `end` indices. - * - * Specifying `end` greater than `buf.length` will return the same result as - * that of `end` equal to `buf.length`. - * - * This method is inherited from [`TypedArray.prototype.subarray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray). - * - * Modifying the new `Buffer` slice will modify the memory in the original `Buffer`because the allocated memory of the two objects overlap. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Create a `Buffer` with the ASCII alphabet, take a slice, and modify one byte - * // from the original `Buffer`. - * - * const buf1 = Buffer.allocUnsafe(26); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf1[i] = i + 97; - * } - * - * const buf2 = buf1.subarray(0, 3); - * - * console.log(buf2.toString('ascii', 0, buf2.length)); - * // Prints: abc - * - * buf1[0] = 33; - * - * console.log(buf2.toString('ascii', 0, buf2.length)); - * // Prints: !bc - * ``` - * - * Specifying negative indexes causes the slice to be generated relative to the - * end of `buf` rather than the beginning. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('buffer'); - * - * console.log(buf.subarray(-6, -1).toString()); - * // Prints: buffe - * // (Equivalent to buf.subarray(0, 5).) - * - * console.log(buf.subarray(-6, -2).toString()); - * // Prints: buff - * // (Equivalent to buf.subarray(0, 4).) - * - * console.log(buf.subarray(-5, -2).toString()); - * // Prints: uff - * // (Equivalent to buf.subarray(1, 4).) - * ``` - * @since v3.0.0 - * @param [start=0] Where the new `Buffer` will start. - * @param [end=buf.length] Where the new `Buffer` will end (not inclusive). - */ - subarray(start?: number, end?: number): Buffer; - } - } -} diff --git a/tools/mnemonic-test/node_modules/@types/node/ts5.6/globals.typedarray.d.ts b/tools/mnemonic-test/node_modules/@types/node/ts5.6/globals.typedarray.d.ts deleted file mode 100644 index 0e4633b9..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -export {}; // Make this a module - -declare global { - namespace NodeJS { - type TypedArray = - | Uint8Array - | Uint8ClampedArray - | Uint16Array - | Uint32Array - | Int8Array - | Int16Array - | Int32Array - | BigUint64Array - | BigInt64Array - | Float32Array - | Float64Array; - type ArrayBufferView = TypedArray | DataView; - } -} diff --git a/tools/mnemonic-test/node_modules/@types/node/ts5.6/index.d.ts b/tools/mnemonic-test/node_modules/@types/node/ts5.6/index.d.ts deleted file mode 100644 index 6fed96ea..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/ts5.6/index.d.ts +++ /dev/null @@ -1,94 +0,0 @@ -/** - * License for programmatically and manually incorporated - * documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc - * - * Copyright Node.js contributors. All rights reserved. - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - */ - -// NOTE: These definitions support NodeJS and TypeScript 4.9 through 5.6. - -// Reference required types from the default lib: -/// -/// -/// -/// - -// Definitions specific to TypeScript 4.9 through 5.6 -/// -/// - -// Base definitions for all NodeJS modules that are not specific to any version of TypeScript: -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// - -/// diff --git a/tools/mnemonic-test/node_modules/@types/node/tty.d.ts b/tools/mnemonic-test/node_modules/@types/node/tty.d.ts deleted file mode 100644 index f5679466..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/tty.d.ts +++ /dev/null @@ -1,208 +0,0 @@ -/** - * The `node:tty` module provides the `tty.ReadStream` and `tty.WriteStream` classes. In most cases, it will not be necessary or possible to use this module - * directly. However, it can be accessed using: - * - * ```js - * import tty from 'node:tty'; - * ``` - * - * When Node.js detects that it is being run with a text terminal ("TTY") - * attached, `process.stdin` will, by default, be initialized as an instance of `tty.ReadStream` and both `process.stdout` and `process.stderr` will, by - * default, be instances of `tty.WriteStream`. The preferred method of determining - * whether Node.js is being run within a TTY context is to check that the value of - * the `process.stdout.isTTY` property is `true`: - * - * ```console - * $ node -p -e "Boolean(process.stdout.isTTY)" - * true - * $ node -p -e "Boolean(process.stdout.isTTY)" | cat - * false - * ``` - * - * In most cases, there should be little to no reason for an application to - * manually create instances of the `tty.ReadStream` and `tty.WriteStream` classes. - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/tty.js) - */ -declare module "tty" { - import * as net from "node:net"; - /** - * The `tty.isatty()` method returns `true` if the given `fd` is associated with - * a TTY and `false` if it is not, including whenever `fd` is not a non-negative - * integer. - * @since v0.5.8 - * @param fd A numeric file descriptor - */ - function isatty(fd: number): boolean; - /** - * Represents the readable side of a TTY. In normal circumstances `process.stdin` will be the only `tty.ReadStream` instance in a Node.js - * process and there should be no reason to create additional instances. - * @since v0.5.8 - */ - class ReadStream extends net.Socket { - constructor(fd: number, options?: net.SocketConstructorOpts); - /** - * A `boolean` that is `true` if the TTY is currently configured to operate as a - * raw device. - * - * This flag is always `false` when a process starts, even if the terminal is - * operating in raw mode. Its value will change with subsequent calls to `setRawMode`. - * @since v0.7.7 - */ - isRaw: boolean; - /** - * Allows configuration of `tty.ReadStream` so that it operates as a raw device. - * - * When in raw mode, input is always available character-by-character, not - * including modifiers. Additionally, all special processing of characters by the - * terminal is disabled, including echoing input - * characters. Ctrl+C will no longer cause a `SIGINT` when - * in this mode. - * @since v0.7.7 - * @param mode If `true`, configures the `tty.ReadStream` to operate as a raw device. If `false`, configures the `tty.ReadStream` to operate in its default mode. The `readStream.isRaw` - * property will be set to the resulting mode. - * @return The read stream instance. - */ - setRawMode(mode: boolean): this; - /** - * A `boolean` that is always `true` for `tty.ReadStream` instances. - * @since v0.5.8 - */ - isTTY: boolean; - } - /** - * -1 - to the left from cursor - * 0 - the entire line - * 1 - to the right from cursor - */ - type Direction = -1 | 0 | 1; - /** - * Represents the writable side of a TTY. In normal circumstances, `process.stdout` and `process.stderr` will be the only`tty.WriteStream` instances created for a Node.js process and there - * should be no reason to create additional instances. - * @since v0.5.8 - */ - class WriteStream extends net.Socket { - constructor(fd: number); - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "resize", listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "resize"): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "resize", listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "resize", listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "resize", listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "resize", listener: () => void): this; - /** - * `writeStream.clearLine()` clears the current line of this `WriteStream` in a - * direction identified by `dir`. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - clearLine(dir: Direction, callback?: () => void): boolean; - /** - * `writeStream.clearScreenDown()` clears this `WriteStream` from the current - * cursor down. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - clearScreenDown(callback?: () => void): boolean; - /** - * `writeStream.cursorTo()` moves this `WriteStream`'s cursor to the specified - * position. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - cursorTo(x: number, y?: number, callback?: () => void): boolean; - cursorTo(x: number, callback: () => void): boolean; - /** - * `writeStream.moveCursor()` moves this `WriteStream`'s cursor _relative_ to its - * current position. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - moveCursor(dx: number, dy: number, callback?: () => void): boolean; - /** - * Returns: - * - * * `1` for 2, - * * `4` for 16, - * * `8` for 256, - * * `24` for 16,777,216 colors supported. - * - * Use this to determine what colors the terminal supports. Due to the nature of - * colors in terminals it is possible to either have false positives or false - * negatives. It depends on process information and the environment variables that - * may lie about what terminal is used. - * It is possible to pass in an `env` object to simulate the usage of a specific - * terminal. This can be useful to check how specific environment settings behave. - * - * To enforce a specific color support, use one of the below environment settings. - * - * * 2 colors: `FORCE_COLOR = 0` (Disables colors) - * * 16 colors: `FORCE_COLOR = 1` - * * 256 colors: `FORCE_COLOR = 2` - * * 16,777,216 colors: `FORCE_COLOR = 3` - * - * Disabling color support is also possible by using the `NO_COLOR` and `NODE_DISABLE_COLORS` environment variables. - * @since v9.9.0 - * @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal. - */ - getColorDepth(env?: object): number; - /** - * Returns `true` if the `writeStream` supports at least as many colors as provided - * in `count`. Minimum support is 2 (black and white). - * - * This has the same false positives and negatives as described in `writeStream.getColorDepth()`. - * - * ```js - * process.stdout.hasColors(); - * // Returns true or false depending on if `stdout` supports at least 16 colors. - * process.stdout.hasColors(256); - * // Returns true or false depending on if `stdout` supports at least 256 colors. - * process.stdout.hasColors({ TMUX: '1' }); - * // Returns true. - * process.stdout.hasColors(2 ** 24, { TMUX: '1' }); - * // Returns false (the environment setting pretends to support 2 ** 8 colors). - * ``` - * @since v11.13.0, v10.16.0 - * @param [count=16] The number of colors that are requested (minimum 2). - * @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal. - */ - hasColors(count?: number): boolean; - hasColors(env?: object): boolean; - hasColors(count: number, env?: object): boolean; - /** - * `writeStream.getWindowSize()` returns the size of the TTY - * corresponding to this `WriteStream`. The array is of the type `[numColumns, numRows]` where `numColumns` and `numRows` represent the number - * of columns and rows in the corresponding TTY. - * @since v0.7.7 - */ - getWindowSize(): [number, number]; - /** - * A `number` specifying the number of columns the TTY currently has. This property - * is updated whenever the `'resize'` event is emitted. - * @since v0.7.7 - */ - columns: number; - /** - * A `number` specifying the number of rows the TTY currently has. This property - * is updated whenever the `'resize'` event is emitted. - * @since v0.7.7 - */ - rows: number; - /** - * A `boolean` that is always `true`. - * @since v0.5.8 - */ - isTTY: boolean; - } -} -declare module "node:tty" { - export * from "tty"; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/url.d.ts b/tools/mnemonic-test/node_modules/@types/node/url.d.ts deleted file mode 100644 index 139af6d0..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/url.d.ts +++ /dev/null @@ -1,969 +0,0 @@ -/** - * The `node:url` module provides utilities for URL resolution and parsing. It can - * be accessed using: - * - * ```js - * import url from 'node:url'; - * ``` - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/url.js) - */ -declare module "url" { - import { Blob as NodeBlob } from "node:buffer"; - import { ClientRequestArgs } from "node:http"; - import { ParsedUrlQuery, ParsedUrlQueryInput } from "node:querystring"; - // Input to `url.format` - interface UrlObject { - auth?: string | null | undefined; - hash?: string | null | undefined; - host?: string | null | undefined; - hostname?: string | null | undefined; - href?: string | null | undefined; - pathname?: string | null | undefined; - protocol?: string | null | undefined; - search?: string | null | undefined; - slashes?: boolean | null | undefined; - port?: string | number | null | undefined; - query?: string | null | ParsedUrlQueryInput | undefined; - } - // Output of `url.parse` - interface Url { - auth: string | null; - hash: string | null; - host: string | null; - hostname: string | null; - href: string; - path: string | null; - pathname: string | null; - protocol: string | null; - search: string | null; - slashes: boolean | null; - port: string | null; - query: string | null | ParsedUrlQuery; - } - interface UrlWithParsedQuery extends Url { - query: ParsedUrlQuery; - } - interface UrlWithStringQuery extends Url { - query: string | null; - } - interface FileUrlToPathOptions { - /** - * `true` if the `path` should be return as a windows filepath, `false` for posix, and `undefined` for the system default. - * @default undefined - * @since v22.1.0 - */ - windows?: boolean | undefined; - } - interface PathToFileUrlOptions { - /** - * `true` if the `path` should be return as a windows filepath, `false` for posix, and `undefined` for the system default. - * @default undefined - * @since v22.1.0 - */ - windows?: boolean | undefined; - } - /** - * The `url.parse()` method takes a URL string, parses it, and returns a URL - * object. - * - * A `TypeError` is thrown if `urlString` is not a string. - * - * A `URIError` is thrown if the `auth` property is present but cannot be decoded. - * - * `url.parse()` uses a lenient, non-standard algorithm for parsing URL - * strings. It is prone to security issues such as [host name spoofing](https://hackerone.com/reports/678487) and incorrect handling of usernames and passwords. Do not use with untrusted - * input. CVEs are not issued for `url.parse()` vulnerabilities. Use the `WHATWG URL` API instead. - * @since v0.1.25 - * @deprecated Use the WHATWG URL API instead. - * @param urlString The URL string to parse. - * @param [parseQueryString=false] If `true`, the `query` property will always be set to an object returned by the {@link querystring} module's `parse()` method. If `false`, the `query` property - * on the returned URL object will be an unparsed, undecoded string. - * @param [slashesDenoteHost=false] If `true`, the first token after the literal string `//` and preceding the next `/` will be interpreted as the `host`. For instance, given `//foo/bar`, the - * result would be `{host: 'foo', pathname: '/bar'}` rather than `{pathname: '//foo/bar'}`. - */ - function parse(urlString: string): UrlWithStringQuery; - function parse( - urlString: string, - parseQueryString: false | undefined, - slashesDenoteHost?: boolean, - ): UrlWithStringQuery; - function parse(urlString: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery; - function parse(urlString: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url; - /** - * The `url.format()` method returns a formatted URL string derived from `urlObject`. - * - * ```js - * import url from 'node:url'; - * url.format({ - * protocol: 'https', - * hostname: 'example.com', - * pathname: '/some/path', - * query: { - * page: 1, - * format: 'json', - * }, - * }); - * - * // => 'https://example.com/some/path?page=1&format=json' - * ``` - * - * If `urlObject` is not an object or a string, `url.format()` will throw a `TypeError`. - * - * The formatting process operates as follows: - * - * * A new empty string `result` is created. - * * If `urlObject.protocol` is a string, it is appended as-is to `result`. - * * Otherwise, if `urlObject.protocol` is not `undefined` and is not a string, an `Error` is thrown. - * * For all string values of `urlObject.protocol` that _do not end_ with an ASCII - * colon (`:`) character, the literal string `:` will be appended to `result`. - * * If either of the following conditions is true, then the literal string `//` will be appended to `result`: - * * `urlObject.slashes` property is true; - * * `urlObject.protocol` begins with `http`, `https`, `ftp`, `gopher`, or `file`; - * * If the value of the `urlObject.auth` property is truthy, and either `urlObject.host` or `urlObject.hostname` are not `undefined`, the value of `urlObject.auth` will be coerced into a string - * and appended to `result` followed by the literal string `@`. - * * If the `urlObject.host` property is `undefined` then: - * * If the `urlObject.hostname` is a string, it is appended to `result`. - * * Otherwise, if `urlObject.hostname` is not `undefined` and is not a string, - * an `Error` is thrown. - * * If the `urlObject.port` property value is truthy, and `urlObject.hostname` is not `undefined`: - * * The literal string `:` is appended to `result`, and - * * The value of `urlObject.port` is coerced to a string and appended to `result`. - * * Otherwise, if the `urlObject.host` property value is truthy, the value of `urlObject.host` is coerced to a string and appended to `result`. - * * If the `urlObject.pathname` property is a string that is not an empty string: - * * If the `urlObject.pathname` _does not start_ with an ASCII forward slash - * (`/`), then the literal string `'/'` is appended to `result`. - * * The value of `urlObject.pathname` is appended to `result`. - * * Otherwise, if `urlObject.pathname` is not `undefined` and is not a string, an `Error` is thrown. - * * If the `urlObject.search` property is `undefined` and if the `urlObject.query`property is an `Object`, the literal string `?` is appended to `result` followed by the output of calling the - * `querystring` module's `stringify()` method passing the value of `urlObject.query`. - * * Otherwise, if `urlObject.search` is a string: - * * If the value of `urlObject.search` _does not start_ with the ASCII question - * mark (`?`) character, the literal string `?` is appended to `result`. - * * The value of `urlObject.search` is appended to `result`. - * * Otherwise, if `urlObject.search` is not `undefined` and is not a string, an `Error` is thrown. - * * If the `urlObject.hash` property is a string: - * * If the value of `urlObject.hash` _does not start_ with the ASCII hash (`#`) - * character, the literal string `#` is appended to `result`. - * * The value of `urlObject.hash` is appended to `result`. - * * Otherwise, if the `urlObject.hash` property is not `undefined` and is not a - * string, an `Error` is thrown. - * * `result` is returned. - * @since v0.1.25 - * @legacy Use the WHATWG URL API instead. - * @param urlObject A URL object (as returned by `url.parse()` or constructed otherwise). If a string, it is converted to an object by passing it to `url.parse()`. - */ - function format(urlObject: URL, options?: URLFormatOptions): string; - /** - * The `url.format()` method returns a formatted URL string derived from `urlObject`. - * - * ```js - * import url from 'node:url'; - * url.format({ - * protocol: 'https', - * hostname: 'example.com', - * pathname: '/some/path', - * query: { - * page: 1, - * format: 'json', - * }, - * }); - * - * // => 'https://example.com/some/path?page=1&format=json' - * ``` - * - * If `urlObject` is not an object or a string, `url.format()` will throw a `TypeError`. - * - * The formatting process operates as follows: - * - * * A new empty string `result` is created. - * * If `urlObject.protocol` is a string, it is appended as-is to `result`. - * * Otherwise, if `urlObject.protocol` is not `undefined` and is not a string, an `Error` is thrown. - * * For all string values of `urlObject.protocol` that _do not end_ with an ASCII - * colon (`:`) character, the literal string `:` will be appended to `result`. - * * If either of the following conditions is true, then the literal string `//` will be appended to `result`: - * * `urlObject.slashes` property is true; - * * `urlObject.protocol` begins with `http`, `https`, `ftp`, `gopher`, or `file`; - * * If the value of the `urlObject.auth` property is truthy, and either `urlObject.host` or `urlObject.hostname` are not `undefined`, the value of `urlObject.auth` will be coerced into a string - * and appended to `result` followed by the literal string `@`. - * * If the `urlObject.host` property is `undefined` then: - * * If the `urlObject.hostname` is a string, it is appended to `result`. - * * Otherwise, if `urlObject.hostname` is not `undefined` and is not a string, - * an `Error` is thrown. - * * If the `urlObject.port` property value is truthy, and `urlObject.hostname` is not `undefined`: - * * The literal string `:` is appended to `result`, and - * * The value of `urlObject.port` is coerced to a string and appended to `result`. - * * Otherwise, if the `urlObject.host` property value is truthy, the value of `urlObject.host` is coerced to a string and appended to `result`. - * * If the `urlObject.pathname` property is a string that is not an empty string: - * * If the `urlObject.pathname` _does not start_ with an ASCII forward slash - * (`/`), then the literal string `'/'` is appended to `result`. - * * The value of `urlObject.pathname` is appended to `result`. - * * Otherwise, if `urlObject.pathname` is not `undefined` and is not a string, an `Error` is thrown. - * * If the `urlObject.search` property is `undefined` and if the `urlObject.query`property is an `Object`, the literal string `?` is appended to `result` followed by the output of calling the - * `querystring` module's `stringify()` method passing the value of `urlObject.query`. - * * Otherwise, if `urlObject.search` is a string: - * * If the value of `urlObject.search` _does not start_ with the ASCII question - * mark (`?`) character, the literal string `?` is appended to `result`. - * * The value of `urlObject.search` is appended to `result`. - * * Otherwise, if `urlObject.search` is not `undefined` and is not a string, an `Error` is thrown. - * * If the `urlObject.hash` property is a string: - * * If the value of `urlObject.hash` _does not start_ with the ASCII hash (`#`) - * character, the literal string `#` is appended to `result`. - * * The value of `urlObject.hash` is appended to `result`. - * * Otherwise, if the `urlObject.hash` property is not `undefined` and is not a - * string, an `Error` is thrown. - * * `result` is returned. - * @since v0.1.25 - * @legacy Use the WHATWG URL API instead. - * @param urlObject A URL object (as returned by `url.parse()` or constructed otherwise). If a string, it is converted to an object by passing it to `url.parse()`. - */ - function format(urlObject: UrlObject | string): string; - /** - * The `url.resolve()` method resolves a target URL relative to a base URL in a - * manner similar to that of a web browser resolving an anchor tag. - * - * ```js - * import url from 'node:url'; - * url.resolve('/one/two/three', 'four'); // '/one/two/four' - * url.resolve('http://example.com/', '/one'); // 'http://example.com/one' - * url.resolve('http://example.com/one', '/two'); // 'http://example.com/two' - * ``` - * - * To achieve the same result using the WHATWG URL API: - * - * ```js - * function resolve(from, to) { - * const resolvedUrl = new URL(to, new URL(from, 'resolve://')); - * if (resolvedUrl.protocol === 'resolve:') { - * // `from` is a relative URL. - * const { pathname, search, hash } = resolvedUrl; - * return pathname + search + hash; - * } - * return resolvedUrl.toString(); - * } - * - * resolve('/one/two/three', 'four'); // '/one/two/four' - * resolve('http://example.com/', '/one'); // 'http://example.com/one' - * resolve('http://example.com/one', '/two'); // 'http://example.com/two' - * ``` - * @since v0.1.25 - * @legacy Use the WHATWG URL API instead. - * @param from The base URL to use if `to` is a relative URL. - * @param to The target URL to resolve. - */ - function resolve(from: string, to: string): string; - /** - * Returns the [Punycode](https://tools.ietf.org/html/rfc5891#section-4.4) ASCII serialization of the `domain`. If `domain` is an - * invalid domain, the empty string is returned. - * - * It performs the inverse operation to {@link domainToUnicode}. - * - * ```js - * import url from 'node:url'; - * - * console.log(url.domainToASCII('español.com')); - * // Prints xn--espaol-zwa.com - * console.log(url.domainToASCII('中文.com')); - * // Prints xn--fiq228c.com - * console.log(url.domainToASCII('xn--iñvalid.com')); - * // Prints an empty string - * ``` - * @since v7.4.0, v6.13.0 - */ - function domainToASCII(domain: string): string; - /** - * Returns the Unicode serialization of the `domain`. If `domain` is an invalid - * domain, the empty string is returned. - * - * It performs the inverse operation to {@link domainToASCII}. - * - * ```js - * import url from 'node:url'; - * - * console.log(url.domainToUnicode('xn--espaol-zwa.com')); - * // Prints español.com - * console.log(url.domainToUnicode('xn--fiq228c.com')); - * // Prints 中文.com - * console.log(url.domainToUnicode('xn--iñvalid.com')); - * // Prints an empty string - * ``` - * @since v7.4.0, v6.13.0 - */ - function domainToUnicode(domain: string): string; - /** - * This function ensures the correct decodings of percent-encoded characters as - * well as ensuring a cross-platform valid absolute path string. - * - * ```js - * import { fileURLToPath } from 'node:url'; - * - * const __filename = fileURLToPath(import.meta.url); - * - * new URL('file:///C:/path/').pathname; // Incorrect: /C:/path/ - * fileURLToPath('file:///C:/path/'); // Correct: C:\path\ (Windows) - * - * new URL('file://nas/foo.txt').pathname; // Incorrect: /foo.txt - * fileURLToPath('file://nas/foo.txt'); // Correct: \\nas\foo.txt (Windows) - * - * new URL('file:///你好.txt').pathname; // Incorrect: /%E4%BD%A0%E5%A5%BD.txt - * fileURLToPath('file:///你好.txt'); // Correct: /你好.txt (POSIX) - * - * new URL('file:///hello world').pathname; // Incorrect: /hello%20world - * fileURLToPath('file:///hello world'); // Correct: /hello world (POSIX) - * ``` - * @since v10.12.0 - * @param url The file URL string or URL object to convert to a path. - * @return The fully-resolved platform-specific Node.js file path. - */ - function fileURLToPath(url: string | URL, options?: FileUrlToPathOptions): string; - /** - * This function ensures that `path` is resolved absolutely, and that the URL - * control characters are correctly encoded when converting into a File URL. - * - * ```js - * import { pathToFileURL } from 'node:url'; - * - * new URL('/foo#1', 'file:'); // Incorrect: file:///foo#1 - * pathToFileURL('/foo#1'); // Correct: file:///foo%231 (POSIX) - * - * new URL('/some/path%.c', 'file:'); // Incorrect: file:///some/path%.c - * pathToFileURL('/some/path%.c'); // Correct: file:///some/path%25.c (POSIX) - * ``` - * @since v10.12.0 - * @param path The path to convert to a File URL. - * @return The file URL object. - */ - function pathToFileURL(path: string, options?: PathToFileUrlOptions): URL; - /** - * This utility function converts a URL object into an ordinary options object as - * expected by the `http.request()` and `https.request()` APIs. - * - * ```js - * import { urlToHttpOptions } from 'node:url'; - * const myURL = new URL('https://a:b@測試?abc#foo'); - * - * console.log(urlToHttpOptions(myURL)); - * /* - * { - * protocol: 'https:', - * hostname: 'xn--g6w251d', - * hash: '#foo', - * search: '?abc', - * pathname: '/', - * path: '/?abc', - * href: 'https://a:b@xn--g6w251d/?abc#foo', - * auth: 'a:b' - * } - * - * ``` - * @since v15.7.0, v14.18.0 - * @param url The `WHATWG URL` object to convert to an options object. - * @return Options object - */ - function urlToHttpOptions(url: URL): ClientRequestArgs; - interface URLFormatOptions { - /** - * `true` if the serialized URL string should include the username and password, `false` otherwise. - * @default true - */ - auth?: boolean | undefined; - /** - * `true` if the serialized URL string should include the fragment, `false` otherwise. - * @default true - */ - fragment?: boolean | undefined; - /** - * `true` if the serialized URL string should include the search query, `false` otherwise. - * @default true - */ - search?: boolean | undefined; - /** - * `true` if Unicode characters appearing in the host component of the URL string should be encoded directly as opposed to - * being Punycode encoded. - * @default false - */ - unicode?: boolean | undefined; - } - /** - * Browser-compatible `URL` class, implemented by following the WHATWG URL - * Standard. [Examples of parsed URLs](https://url.spec.whatwg.org/#example-url-parsing) may be found in the Standard itself. - * The `URL` class is also available on the global object. - * - * In accordance with browser conventions, all properties of `URL` objects - * are implemented as getters and setters on the class prototype, rather than as - * data properties on the object itself. Thus, unlike `legacy urlObject`s, - * using the `delete` keyword on any properties of `URL` objects (e.g. `delete myURL.protocol`, `delete myURL.pathname`, etc) has no effect but will still - * return `true`. - * @since v7.0.0, v6.13.0 - */ - class URL { - /** - * Creates a `'blob:nodedata:...'` URL string that represents the given `Blob` object and can be used to retrieve the `Blob` later. - * - * ```js - * import { - * Blob, - * resolveObjectURL, - * } from 'node:buffer'; - * - * const blob = new Blob(['hello']); - * const id = URL.createObjectURL(blob); - * - * // later... - * - * const otherBlob = resolveObjectURL(id); - * console.log(otherBlob.size); - * ``` - * - * The data stored by the registered `Blob` will be retained in memory until `URL.revokeObjectURL()` is called to remove it. - * - * `Blob` objects are registered within the current thread. If using Worker - * Threads, `Blob` objects registered within one Worker will not be available - * to other workers or the main thread. - * @since v16.7.0 - * @experimental - */ - static createObjectURL(blob: NodeBlob): string; - /** - * Removes the stored `Blob` identified by the given ID. Attempting to revoke a - * ID that isn't registered will silently fail. - * @since v16.7.0 - * @experimental - * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`. - */ - static revokeObjectURL(id: string): void; - /** - * Checks if an `input` relative to the `base` can be parsed to a `URL`. - * - * ```js - * const isValid = URL.canParse('/foo', 'https://example.org/'); // true - * - * const isNotValid = URL.canParse('/foo'); // false - * ``` - * @since v19.9.0 - * @param input The absolute or relative input URL to parse. If `input` is relative, then `base` is required. If `input` is absolute, the `base` is ignored. If `input` is not a string, it is - * `converted to a string` first. - * @param base The base URL to resolve against if the `input` is not absolute. If `base` is not a string, it is `converted to a string` first. - */ - static canParse(input: string, base?: string): boolean; - /** - * Parses a string as a URL. If `base` is provided, it will be used as the base URL for the purpose of resolving non-absolute `input` URLs. - * Returns `null` if `input` is not a valid. - * @param input The absolute or relative input URL to parse. If `input` is relative, then `base` is required. If `input` is absolute, the `base` is ignored. If `input` is not a string, it is - * `converted to a string` first. - * @param base The base URL to resolve against if the `input` is not absolute. If `base` is not a string, it is `converted to a string` first. - * @since v22.1.0 - */ - static parse(input: string, base?: string): URL | null; - constructor(input: string | { toString: () => string }, base?: string | URL); - /** - * Gets and sets the fragment portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org/foo#bar'); - * console.log(myURL.hash); - * // Prints #bar - * - * myURL.hash = 'baz'; - * console.log(myURL.href); - * // Prints https://example.org/foo#baz - * ``` - * - * Invalid URL characters included in the value assigned to the `hash` property - * are `percent-encoded`. The selection of which characters to - * percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - hash: string; - /** - * Gets and sets the host portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org:81/foo'); - * console.log(myURL.host); - * // Prints example.org:81 - * - * myURL.host = 'example.com:82'; - * console.log(myURL.href); - * // Prints https://example.com:82/foo - * ``` - * - * Invalid host values assigned to the `host` property are ignored. - */ - host: string; - /** - * Gets and sets the host name portion of the URL. The key difference between`url.host` and `url.hostname` is that `url.hostname` does _not_ include the - * port. - * - * ```js - * const myURL = new URL('https://example.org:81/foo'); - * console.log(myURL.hostname); - * // Prints example.org - * - * // Setting the hostname does not change the port - * myURL.hostname = 'example.com'; - * console.log(myURL.href); - * // Prints https://example.com:81/foo - * - * // Use myURL.host to change the hostname and port - * myURL.host = 'example.org:82'; - * console.log(myURL.href); - * // Prints https://example.org:82/foo - * ``` - * - * Invalid host name values assigned to the `hostname` property are ignored. - */ - hostname: string; - /** - * Gets and sets the serialized URL. - * - * ```js - * const myURL = new URL('https://example.org/foo'); - * console.log(myURL.href); - * // Prints https://example.org/foo - * - * myURL.href = 'https://example.com/bar'; - * console.log(myURL.href); - * // Prints https://example.com/bar - * ``` - * - * Getting the value of the `href` property is equivalent to calling {@link toString}. - * - * Setting the value of this property to a new value is equivalent to creating a - * new `URL` object using `new URL(value)`. Each of the `URL` object's properties will be modified. - * - * If the value assigned to the `href` property is not a valid URL, a `TypeError` will be thrown. - */ - href: string; - /** - * Gets the read-only serialization of the URL's origin. - * - * ```js - * const myURL = new URL('https://example.org/foo/bar?baz'); - * console.log(myURL.origin); - * // Prints https://example.org - * ``` - * - * ```js - * const idnURL = new URL('https://測試'); - * console.log(idnURL.origin); - * // Prints https://xn--g6w251d - * - * console.log(idnURL.hostname); - * // Prints xn--g6w251d - * ``` - */ - readonly origin: string; - /** - * Gets and sets the password portion of the URL. - * - * ```js - * const myURL = new URL('https://abc:xyz@example.com'); - * console.log(myURL.password); - * // Prints xyz - * - * myURL.password = '123'; - * console.log(myURL.href); - * // Prints https://abc:123@example.com/ - * ``` - * - * Invalid URL characters included in the value assigned to the `password` property - * are `percent-encoded`. The selection of which characters to - * percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - password: string; - /** - * Gets and sets the path portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org/abc/xyz?123'); - * console.log(myURL.pathname); - * // Prints /abc/xyz - * - * myURL.pathname = '/abcdef'; - * console.log(myURL.href); - * // Prints https://example.org/abcdef?123 - * ``` - * - * Invalid URL characters included in the value assigned to the `pathname` property are `percent-encoded`. The selection of which characters - * to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - pathname: string; - /** - * Gets and sets the port portion of the URL. - * - * The port value may be a number or a string containing a number in the range `0` to `65535` (inclusive). Setting the value to the default port of the `URL` objects given `protocol` will - * result in the `port` value becoming - * the empty string (`''`). - * - * The port value can be an empty string in which case the port depends on - * the protocol/scheme: - * - * - * - * Upon assigning a value to the port, the value will first be converted to a - * string using `.toString()`. - * - * If that string is invalid but it begins with a number, the leading number is - * assigned to `port`. - * If the number lies outside the range denoted above, it is ignored. - * - * ```js - * const myURL = new URL('https://example.org:8888'); - * console.log(myURL.port); - * // Prints 8888 - * - * // Default ports are automatically transformed to the empty string - * // (HTTPS protocol's default port is 443) - * myURL.port = '443'; - * console.log(myURL.port); - * // Prints the empty string - * console.log(myURL.href); - * // Prints https://example.org/ - * - * myURL.port = 1234; - * console.log(myURL.port); - * // Prints 1234 - * console.log(myURL.href); - * // Prints https://example.org:1234/ - * - * // Completely invalid port strings are ignored - * myURL.port = 'abcd'; - * console.log(myURL.port); - * // Prints 1234 - * - * // Leading numbers are treated as a port number - * myURL.port = '5678abcd'; - * console.log(myURL.port); - * // Prints 5678 - * - * // Non-integers are truncated - * myURL.port = 1234.5678; - * console.log(myURL.port); - * // Prints 1234 - * - * // Out-of-range numbers which are not represented in scientific notation - * // will be ignored. - * myURL.port = 1e10; // 10000000000, will be range-checked as described below - * console.log(myURL.port); - * // Prints 1234 - * ``` - * - * Numbers which contain a decimal point, - * such as floating-point numbers or numbers in scientific notation, - * are not an exception to this rule. - * Leading numbers up to the decimal point will be set as the URL's port, - * assuming they are valid: - * - * ```js - * myURL.port = 4.567e21; - * console.log(myURL.port); - * // Prints 4 (because it is the leading number in the string '4.567e21') - * ``` - */ - port: string; - /** - * Gets and sets the protocol portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org'); - * console.log(myURL.protocol); - * // Prints https: - * - * myURL.protocol = 'ftp'; - * console.log(myURL.href); - * // Prints ftp://example.org/ - * ``` - * - * Invalid URL protocol values assigned to the `protocol` property are ignored. - */ - protocol: string; - /** - * Gets and sets the serialized query portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org/abc?123'); - * console.log(myURL.search); - * // Prints ?123 - * - * myURL.search = 'abc=xyz'; - * console.log(myURL.href); - * // Prints https://example.org/abc?abc=xyz - * ``` - * - * Any invalid URL characters appearing in the value assigned the `search` property will be `percent-encoded`. The selection of which - * characters to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - search: string; - /** - * Gets the `URLSearchParams` object representing the query parameters of the - * URL. This property is read-only but the `URLSearchParams` object it provides - * can be used to mutate the URL instance; to replace the entirety of query - * parameters of the URL, use the {@link search} setter. See `URLSearchParams` documentation for details. - * - * Use care when using `.searchParams` to modify the `URL` because, - * per the WHATWG specification, the `URLSearchParams` object uses - * different rules to determine which characters to percent-encode. For - * instance, the `URL` object will not percent encode the ASCII tilde (`~`) - * character, while `URLSearchParams` will always encode it: - * - * ```js - * const myURL = new URL('https://example.org/abc?foo=~bar'); - * - * console.log(myURL.search); // prints ?foo=~bar - * - * // Modify the URL via searchParams... - * myURL.searchParams.sort(); - * - * console.log(myURL.search); // prints ?foo=%7Ebar - * ``` - */ - readonly searchParams: URLSearchParams; - /** - * Gets and sets the username portion of the URL. - * - * ```js - * const myURL = new URL('https://abc:xyz@example.com'); - * console.log(myURL.username); - * // Prints abc - * - * myURL.username = '123'; - * console.log(myURL.href); - * // Prints https://123:xyz@example.com/ - * ``` - * - * Any invalid URL characters appearing in the value assigned the `username` property will be `percent-encoded`. The selection of which - * characters to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - username: string; - /** - * The `toString()` method on the `URL` object returns the serialized URL. The - * value returned is equivalent to that of {@link href} and {@link toJSON}. - */ - toString(): string; - /** - * The `toJSON()` method on the `URL` object returns the serialized URL. The - * value returned is equivalent to that of {@link href} and {@link toString}. - * - * This method is automatically called when an `URL` object is serialized - * with [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). - * - * ```js - * const myURLs = [ - * new URL('https://www.example.com'), - * new URL('https://test.example.org'), - * ]; - * console.log(JSON.stringify(myURLs)); - * // Prints ["https://www.example.com/","https://test.example.org/"] - * ``` - */ - toJSON(): string; - } - /** - * The `URLSearchParams` API provides read and write access to the query of a `URL`. The `URLSearchParams` class can also be used standalone with one of the - * four following constructors. - * The `URLSearchParams` class is also available on the global object. - * - * The WHATWG `URLSearchParams` interface and the `querystring` module have - * similar purpose, but the purpose of the `querystring` module is more - * general, as it allows the customization of delimiter characters (`&` and `=`). - * On the other hand, this API is designed purely for URL query strings. - * - * ```js - * const myURL = new URL('https://example.org/?abc=123'); - * console.log(myURL.searchParams.get('abc')); - * // Prints 123 - * - * myURL.searchParams.append('abc', 'xyz'); - * console.log(myURL.href); - * // Prints https://example.org/?abc=123&abc=xyz - * - * myURL.searchParams.delete('abc'); - * myURL.searchParams.set('a', 'b'); - * console.log(myURL.href); - * // Prints https://example.org/?a=b - * - * const newSearchParams = new URLSearchParams(myURL.searchParams); - * // The above is equivalent to - * // const newSearchParams = new URLSearchParams(myURL.search); - * - * newSearchParams.append('a', 'c'); - * console.log(myURL.href); - * // Prints https://example.org/?a=b - * console.log(newSearchParams.toString()); - * // Prints a=b&a=c - * - * // newSearchParams.toString() is implicitly called - * myURL.search = newSearchParams; - * console.log(myURL.href); - * // Prints https://example.org/?a=b&a=c - * newSearchParams.delete('a'); - * console.log(myURL.href); - * // Prints https://example.org/?a=b&a=c - * ``` - * @since v7.5.0, v6.13.0 - */ - class URLSearchParams implements Iterable<[string, string]> { - constructor( - init?: - | URLSearchParams - | string - | Record - | Iterable<[string, string]> - | ReadonlyArray<[string, string]>, - ); - /** - * Append a new name-value pair to the query string. - */ - append(name: string, value: string): void; - /** - * If `value` is provided, removes all name-value pairs - * where name is `name` and value is `value`. - * - * If `value` is not provided, removes all name-value pairs whose name is `name`. - */ - delete(name: string, value?: string): void; - /** - * Returns an ES6 `Iterator` over each of the name-value pairs in the query. - * Each item of the iterator is a JavaScript `Array`. The first item of the `Array` is the `name`, the second item of the `Array` is the `value`. - * - * Alias for `urlSearchParams[@@iterator]()`. - */ - entries(): IterableIterator<[string, string]>; - /** - * Iterates over each name-value pair in the query and invokes the given function. - * - * ```js - * const myURL = new URL('https://example.org/?a=b&c=d'); - * myURL.searchParams.forEach((value, name, searchParams) => { - * console.log(name, value, myURL.searchParams === searchParams); - * }); - * // Prints: - * // a b true - * // c d true - * ``` - * @param fn Invoked for each name-value pair in the query - * @param thisArg To be used as `this` value for when `fn` is called - */ - forEach( - fn: (this: TThis, value: string, name: string, searchParams: URLSearchParams) => void, - thisArg?: TThis, - ): void; - /** - * Returns the value of the first name-value pair whose name is `name`. If there - * are no such pairs, `null` is returned. - * @return or `null` if there is no name-value pair with the given `name`. - */ - get(name: string): string | null; - /** - * Returns the values of all name-value pairs whose name is `name`. If there are - * no such pairs, an empty array is returned. - */ - getAll(name: string): string[]; - /** - * Checks if the `URLSearchParams` object contains key-value pair(s) based on `name` and an optional `value` argument. - * - * If `value` is provided, returns `true` when name-value pair with - * same `name` and `value` exists. - * - * If `value` is not provided, returns `true` if there is at least one name-value - * pair whose name is `name`. - */ - has(name: string, value?: string): boolean; - /** - * Returns an ES6 `Iterator` over the names of each name-value pair. - * - * ```js - * const params = new URLSearchParams('foo=bar&foo=baz'); - * for (const name of params.keys()) { - * console.log(name); - * } - * // Prints: - * // foo - * // foo - * ``` - */ - keys(): IterableIterator; - /** - * Sets the value in the `URLSearchParams` object associated with `name` to `value`. If there are any pre-existing name-value pairs whose names are `name`, - * set the first such pair's value to `value` and remove all others. If not, - * append the name-value pair to the query string. - * - * ```js - * const params = new URLSearchParams(); - * params.append('foo', 'bar'); - * params.append('foo', 'baz'); - * params.append('abc', 'def'); - * console.log(params.toString()); - * // Prints foo=bar&foo=baz&abc=def - * - * params.set('foo', 'def'); - * params.set('xyz', 'opq'); - * console.log(params.toString()); - * // Prints foo=def&abc=def&xyz=opq - * ``` - */ - set(name: string, value: string): void; - /** - * The total number of parameter entries. - * @since v19.8.0 - */ - readonly size: number; - /** - * Sort all existing name-value pairs in-place by their names. Sorting is done - * with a [stable sorting algorithm](https://en.wikipedia.org/wiki/Sorting_algorithm#Stability), so relative order between name-value pairs - * with the same name is preserved. - * - * This method can be used, in particular, to increase cache hits. - * - * ```js - * const params = new URLSearchParams('query[]=abc&type=search&query[]=123'); - * params.sort(); - * console.log(params.toString()); - * // Prints query%5B%5D=abc&query%5B%5D=123&type=search - * ``` - * @since v7.7.0, v6.13.0 - */ - sort(): void; - /** - * Returns the search parameters serialized as a string, with characters - * percent-encoded where necessary. - */ - toString(): string; - /** - * Returns an ES6 `Iterator` over the values of each name-value pair. - */ - values(): IterableIterator; - [Symbol.iterator](): IterableIterator<[string, string]>; - } - import { URL as _URL, URLSearchParams as _URLSearchParams } from "url"; - global { - interface URLSearchParams extends _URLSearchParams {} - interface URL extends _URL {} - interface Global { - URL: typeof _URL; - URLSearchParams: typeof _URLSearchParams; - } - /** - * `URL` class is a global reference for `import { URL } from 'url'` - * https://nodejs.org/api/url.html#the-whatwg-url-api - * @since v10.0.0 - */ - var URL: typeof globalThis extends { - onmessage: any; - URL: infer T; - } ? T - : typeof _URL; - /** - * `URLSearchParams` class is a global reference for `import { URLSearchParams } from 'node:url'` - * https://nodejs.org/api/url.html#class-urlsearchparams - * @since v10.0.0 - */ - var URLSearchParams: typeof globalThis extends { - onmessage: any; - URLSearchParams: infer T; - } ? T - : typeof _URLSearchParams; - } -} -declare module "node:url" { - export * from "url"; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/util.d.ts b/tools/mnemonic-test/node_modules/@types/node/util.d.ts deleted file mode 100644 index ae260788..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/util.d.ts +++ /dev/null @@ -1,2301 +0,0 @@ -/** - * The `node:util` module supports the needs of Node.js internal APIs. Many of the - * utilities are useful for application and module developers as well. To access - * it: - * - * ```js - * import util from 'node:util'; - * ``` - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/util.js) - */ -declare module "util" { - import * as types from "node:util/types"; - export interface InspectOptions { - /** - * If `true`, object's non-enumerable symbols and properties are included in the formatted result. - * `WeakMap` and `WeakSet` entries are also included as well as user defined prototype properties (excluding method properties). - * @default false - */ - showHidden?: boolean | undefined; - /** - * Specifies the number of times to recurse while formatting object. - * This is useful for inspecting large objects. - * To recurse up to the maximum call stack size pass `Infinity` or `null`. - * @default 2 - */ - depth?: number | null | undefined; - /** - * If `true`, the output is styled with ANSI color codes. Colors are customizable. - */ - colors?: boolean | undefined; - /** - * If `false`, `[util.inspect.custom](depth, opts, inspect)` functions are not invoked. - * @default true - */ - customInspect?: boolean | undefined; - /** - * If `true`, `Proxy` inspection includes the target and handler objects. - * @default false - */ - showProxy?: boolean | undefined; - /** - * Specifies the maximum number of `Array`, `TypedArray`, `WeakMap`, and `WeakSet` elements - * to include when formatting. Set to `null` or `Infinity` to show all elements. - * Set to `0` or negative to show no elements. - * @default 100 - */ - maxArrayLength?: number | null | undefined; - /** - * Specifies the maximum number of characters to - * include when formatting. Set to `null` or `Infinity` to show all elements. - * Set to `0` or negative to show no characters. - * @default 10000 - */ - maxStringLength?: number | null | undefined; - /** - * The length at which input values are split across multiple lines. - * Set to `Infinity` to format the input as a single line - * (in combination with `compact` set to `true` or any number >= `1`). - * @default 80 - */ - breakLength?: number | undefined; - /** - * Setting this to `false` causes each object key - * to be displayed on a new line. It will also add new lines to text that is - * longer than `breakLength`. If set to a number, the most `n` inner elements - * are united on a single line as long as all properties fit into - * `breakLength`. Short array elements are also grouped together. Note that no - * text will be reduced below 16 characters, no matter the `breakLength` size. - * For more information, see the example below. - * @default true - */ - compact?: boolean | number | undefined; - /** - * If set to `true` or a function, all properties of an object, and `Set` and `Map` - * entries are sorted in the resulting string. - * If set to `true` the default sort is used. - * If set to a function, it is used as a compare function. - */ - sorted?: boolean | ((a: string, b: string) => number) | undefined; - /** - * If set to `true`, getters are going to be - * inspected as well. If set to `'get'` only getters without setter are going - * to be inspected. If set to `'set'` only getters having a corresponding - * setter are going to be inspected. This might cause side effects depending on - * the getter function. - * @default false - */ - getters?: "get" | "set" | boolean | undefined; - /** - * If set to `true`, an underscore is used to separate every three digits in all bigints and numbers. - * @default false - */ - numericSeparator?: boolean | undefined; - } - export type Style = - | "special" - | "number" - | "bigint" - | "boolean" - | "undefined" - | "null" - | "string" - | "symbol" - | "date" - | "regexp" - | "module"; - export type CustomInspectFunction = (depth: number, options: InspectOptionsStylized) => any; // TODO: , inspect: inspect - export interface InspectOptionsStylized extends InspectOptions { - stylize(text: string, styleType: Style): string; - } - /** - * The `util.format()` method returns a formatted string using the first argument - * as a `printf`-like format string which can contain zero or more format - * specifiers. Each specifier is replaced with the converted value from the - * corresponding argument. Supported specifiers are: - * - * If a specifier does not have a corresponding argument, it is not replaced: - * - * ```js - * util.format('%s:%s', 'foo'); - * // Returns: 'foo:%s' - * ``` - * - * Values that are not part of the format string are formatted using `util.inspect()` if their type is not `string`. - * - * If there are more arguments passed to the `util.format()` method than the - * number of specifiers, the extra arguments are concatenated to the returned - * string, separated by spaces: - * - * ```js - * util.format('%s:%s', 'foo', 'bar', 'baz'); - * // Returns: 'foo:bar baz' - * ``` - * - * If the first argument does not contain a valid format specifier, `util.format()` returns a string that is the concatenation of all arguments separated by spaces: - * - * ```js - * util.format(1, 2, 3); - * // Returns: '1 2 3' - * ``` - * - * If only one argument is passed to `util.format()`, it is returned as it is - * without any formatting: - * - * ```js - * util.format('%% %s'); - * // Returns: '%% %s' - * ``` - * - * `util.format()` is a synchronous method that is intended as a debugging tool. - * Some input values can have a significant performance overhead that can block the - * event loop. Use this function with care and never in a hot code path. - * @since v0.5.3 - * @param format A `printf`-like format string. - */ - export function format(format?: any, ...param: any[]): string; - /** - * This function is identical to {@link format}, except in that it takes - * an `inspectOptions` argument which specifies options that are passed along to {@link inspect}. - * - * ```js - * util.formatWithOptions({ colors: true }, 'See object %O', { foo: 42 }); - * // Returns 'See object { foo: 42 }', where `42` is colored as a number - * // when printed to a terminal. - * ``` - * @since v10.0.0 - */ - export function formatWithOptions(inspectOptions: InspectOptions, format?: any, ...param: any[]): string; - /** - * Returns the string name for a numeric error code that comes from a Node.js API. - * The mapping between error codes and error names is platform-dependent. - * See `Common System Errors` for the names of common errors. - * - * ```js - * fs.access('file/that/does/not/exist', (err) => { - * const name = util.getSystemErrorName(err.errno); - * console.error(name); // ENOENT - * }); - * ``` - * @since v9.7.0 - */ - export function getSystemErrorName(err: number): string; - /** - * Returns a Map of all system error codes available from the Node.js API. - * The mapping between error codes and error names is platform-dependent. - * See `Common System Errors` for the names of common errors. - * - * ```js - * fs.access('file/that/does/not/exist', (err) => { - * const errorMap = util.getSystemErrorMap(); - * const name = errorMap.get(err.errno); - * console.error(name); // ENOENT - * }); - * ``` - * @since v16.0.0, v14.17.0 - */ - export function getSystemErrorMap(): Map; - /** - * The `util.log()` method prints the given `string` to `stdout` with an included - * timestamp. - * - * ```js - * import util from 'node:util'; - * - * util.log('Timestamped message.'); - * ``` - * @since v0.3.0 - * @deprecated Since v6.0.0 - Use a third party module instead. - */ - export function log(string: string): void; - /** - * Returns the `string` after replacing any surrogate code points - * (or equivalently, any unpaired surrogate code units) with the - * Unicode "replacement character" U+FFFD. - * @since v16.8.0, v14.18.0 - */ - export function toUSVString(string: string): string; - /** - * Creates and returns an `AbortController` instance whose `AbortSignal` is marked - * as transferable and can be used with `structuredClone()` or `postMessage()`. - * @since v18.11.0 - * @experimental - * @returns A transferable AbortController - */ - export function transferableAbortController(): AbortController; - /** - * Marks the given `AbortSignal` as transferable so that it can be used with`structuredClone()` and `postMessage()`. - * - * ```js - * const signal = transferableAbortSignal(AbortSignal.timeout(100)); - * const channel = new MessageChannel(); - * channel.port2.postMessage(signal, [signal]); - * ``` - * @since v18.11.0 - * @experimental - * @param signal The AbortSignal - * @returns The same AbortSignal - */ - export function transferableAbortSignal(signal: AbortSignal): AbortSignal; - /** - * Listens to abort event on the provided `signal` and - * returns a promise that is fulfilled when the `signal` is - * aborted. If the passed `resource` is garbage collected before the `signal` is - * aborted, the returned promise shall remain pending indefinitely. - * - * ```js - * import { aborted } from 'node:util'; - * - * const dependent = obtainSomethingAbortable(); - * - * aborted(dependent.signal, dependent).then(() => { - * // Do something when dependent is aborted. - * }); - * - * dependent.on('event', () => { - * dependent.abort(); - * }); - * ``` - * @since v19.7.0 - * @experimental - * @param resource Any non-null entity, reference to which is held weakly. - */ - export function aborted(signal: AbortSignal, resource: any): Promise; - /** - * The `util.inspect()` method returns a string representation of `object` that is - * intended for debugging. The output of `util.inspect` may change at any time - * and should not be depended upon programmatically. Additional `options` may be - * passed that alter the result. `util.inspect()` will use the constructor's name and/or `@@toStringTag` to make - * an identifiable tag for an inspected value. - * - * ```js - * class Foo { - * get [Symbol.toStringTag]() { - * return 'bar'; - * } - * } - * - * class Bar {} - * - * const baz = Object.create(null, { [Symbol.toStringTag]: { value: 'foo' } }); - * - * util.inspect(new Foo()); // 'Foo [bar] {}' - * util.inspect(new Bar()); // 'Bar {}' - * util.inspect(baz); // '[foo] {}' - * ``` - * - * Circular references point to their anchor by using a reference index: - * - * ```js - * import { inspect } from 'node:util'; - * - * const obj = {}; - * obj.a = [obj]; - * obj.b = {}; - * obj.b.inner = obj.b; - * obj.b.obj = obj; - * - * console.log(inspect(obj)); - * // { - * // a: [ [Circular *1] ], - * // b: { inner: [Circular *2], obj: [Circular *1] } - * // } - * ``` - * - * The following example inspects all properties of the `util` object: - * - * ```js - * import util from 'node:util'; - * - * console.log(util.inspect(util, { showHidden: true, depth: null })); - * ``` - * - * The following example highlights the effect of the `compact` option: - * - * ```js - * import util from 'node:util'; - * - * const o = { - * a: [1, 2, [[ - * 'Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit, sed do ' + - * 'eiusmod \ntempor incididunt ut labore et dolore magna aliqua.', - * 'test', - * 'foo']], 4], - * b: new Map([['za', 1], ['zb', 'test']]), - * }; - * console.log(util.inspect(o, { compact: true, depth: 5, breakLength: 80 })); - * - * // { a: - * // [ 1, - * // 2, - * // [ [ 'Lorem ipsum dolor sit amet,\nconsectetur [...]', // A long line - * // 'test', - * // 'foo' ] ], - * // 4 ], - * // b: Map(2) { 'za' => 1, 'zb' => 'test' } } - * - * // Setting `compact` to false or an integer creates more reader friendly output. - * console.log(util.inspect(o, { compact: false, depth: 5, breakLength: 80 })); - * - * // { - * // a: [ - * // 1, - * // 2, - * // [ - * // [ - * // 'Lorem ipsum dolor sit amet,\n' + - * // 'consectetur adipiscing elit, sed do eiusmod \n' + - * // 'tempor incididunt ut labore et dolore magna aliqua.', - * // 'test', - * // 'foo' - * // ] - * // ], - * // 4 - * // ], - * // b: Map(2) { - * // 'za' => 1, - * // 'zb' => 'test' - * // } - * // } - * - * // Setting `breakLength` to e.g. 150 will print the "Lorem ipsum" text in a - * // single line. - * ``` - * - * The `showHidden` option allows [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) and - * [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries to be - * inspected. If there are more entries than `maxArrayLength`, there is no - * guarantee which entries are displayed. That means retrieving the same [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries twice may - * result in different output. Furthermore, entries - * with no remaining strong references may be garbage collected at any time. - * - * ```js - * import { inspect } from 'node:util'; - * - * const obj = { a: 1 }; - * const obj2 = { b: 2 }; - * const weakSet = new WeakSet([obj, obj2]); - * - * console.log(inspect(weakSet, { showHidden: true })); - * // WeakSet { { a: 1 }, { b: 2 } } - * ``` - * - * The `sorted` option ensures that an object's property insertion order does not - * impact the result of `util.inspect()`. - * - * ```js - * import { inspect } from 'node:util'; - * import assert from 'node:assert'; - * - * const o1 = { - * b: [2, 3, 1], - * a: '`a` comes before `b`', - * c: new Set([2, 3, 1]), - * }; - * console.log(inspect(o1, { sorted: true })); - * // { a: '`a` comes before `b`', b: [ 2, 3, 1 ], c: Set(3) { 1, 2, 3 } } - * console.log(inspect(o1, { sorted: (a, b) => b.localeCompare(a) })); - * // { c: Set(3) { 3, 2, 1 }, b: [ 2, 3, 1 ], a: '`a` comes before `b`' } - * - * const o2 = { - * c: new Set([2, 1, 3]), - * a: '`a` comes before `b`', - * b: [2, 3, 1], - * }; - * assert.strict.equal( - * inspect(o1, { sorted: true }), - * inspect(o2, { sorted: true }), - * ); - * ``` - * - * The `numericSeparator` option adds an underscore every three digits to all - * numbers. - * - * ```js - * import { inspect } from 'node:util'; - * - * const thousand = 1_000; - * const million = 1_000_000; - * const bigNumber = 123_456_789n; - * const bigDecimal = 1_234.123_45; - * - * console.log(inspect(thousand, { numericSeparator: true })); - * // 1_000 - * console.log(inspect(million, { numericSeparator: true })); - * // 1_000_000 - * console.log(inspect(bigNumber, { numericSeparator: true })); - * // 123_456_789n - * console.log(inspect(bigDecimal, { numericSeparator: true })); - * // 1_234.123_45 - * ``` - * - * `util.inspect()` is a synchronous method intended for debugging. Its maximum - * output length is approximately 128 MiB. Inputs that result in longer output will - * be truncated. - * @since v0.3.0 - * @param object Any JavaScript primitive or `Object`. - * @return The representation of `object`. - */ - export function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string; - export function inspect(object: any, options?: InspectOptions): string; - export namespace inspect { - let colors: NodeJS.Dict<[number, number]>; - let styles: { - [K in Style]: string; - }; - let defaultOptions: InspectOptions; - /** - * Allows changing inspect settings from the repl. - */ - let replDefaults: InspectOptions; - /** - * That can be used to declare custom inspect functions. - */ - const custom: unique symbol; - } - /** - * Alias for [`Array.isArray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray). - * - * Returns `true` if the given `object` is an `Array`. Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * util.isArray([]); - * // Returns: true - * util.isArray(new Array()); - * // Returns: true - * util.isArray({}); - * // Returns: false - * ``` - * @since v0.6.0 - * @deprecated Since v4.0.0 - Use `isArray` instead. - */ - export function isArray(object: unknown): object is unknown[]; - /** - * Returns `true` if the given `object` is a `RegExp`. Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * util.isRegExp(/some regexp/); - * // Returns: true - * util.isRegExp(new RegExp('another regexp')); - * // Returns: true - * util.isRegExp({}); - * // Returns: false - * ``` - * @since v0.6.0 - * @deprecated Since v4.0.0 - Deprecated - */ - export function isRegExp(object: unknown): object is RegExp; - /** - * Returns `true` if the given `object` is a `Date`. Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * util.isDate(new Date()); - * // Returns: true - * util.isDate(Date()); - * // false (without 'new' returns a String) - * util.isDate({}); - * // Returns: false - * ``` - * @since v0.6.0 - * @deprecated Since v4.0.0 - Use {@link types.isDate} instead. - */ - export function isDate(object: unknown): object is Date; - /** - * Returns `true` if the given `object` is an `Error`. Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * util.isError(new Error()); - * // Returns: true - * util.isError(new TypeError()); - * // Returns: true - * util.isError({ name: 'Error', message: 'an error occurred' }); - * // Returns: false - * ``` - * - * This method relies on `Object.prototype.toString()` behavior. It is - * possible to obtain an incorrect result when the `object` argument manipulates `@@toStringTag`. - * - * ```js - * import util from 'node:util'; - * const obj = { name: 'Error', message: 'an error occurred' }; - * - * util.isError(obj); - * // Returns: false - * obj[Symbol.toStringTag] = 'Error'; - * util.isError(obj); - * // Returns: true - * ``` - * @since v0.6.0 - * @deprecated Since v4.0.0 - Use {@link types.isNativeError} instead. - */ - export function isError(object: unknown): object is Error; - /** - * Usage of `util.inherits()` is discouraged. Please use the ES6 `class` and `extends` keywords to get language level inheritance support. Also note - * that the two styles are [semantically incompatible](https://github.com/nodejs/node/issues/4179). - * - * Inherit the prototype methods from one [constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/constructor) into another. The - * prototype of `constructor` will be set to a new object created from `superConstructor`. - * - * This mainly adds some input validation on top of`Object.setPrototypeOf(constructor.prototype, superConstructor.prototype)`. - * As an additional convenience, `superConstructor` will be accessible - * through the `constructor.super_` property. - * - * ```js - * import util from 'node:util'; - * import EventEmitter from 'node:events'; - * - * function MyStream() { - * EventEmitter.call(this); - * } - * - * util.inherits(MyStream, EventEmitter); - * - * MyStream.prototype.write = function(data) { - * this.emit('data', data); - * }; - * - * const stream = new MyStream(); - * - * console.log(stream instanceof EventEmitter); // true - * console.log(MyStream.super_ === EventEmitter); // true - * - * stream.on('data', (data) => { - * console.log(`Received data: "${data}"`); - * }); - * stream.write('It works!'); // Received data: "It works!" - * ``` - * - * ES6 example using `class` and `extends`: - * - * ```js - * import EventEmitter from 'node:events'; - * - * class MyStream extends EventEmitter { - * write(data) { - * this.emit('data', data); - * } - * } - * - * const stream = new MyStream(); - * - * stream.on('data', (data) => { - * console.log(`Received data: "${data}"`); - * }); - * stream.write('With ES6'); - * ``` - * @since v0.3.0 - * @legacy Use ES2015 class syntax and `extends` keyword instead. - */ - export function inherits(constructor: unknown, superConstructor: unknown): void; - export type DebugLoggerFunction = (msg: string, ...param: unknown[]) => void; - export interface DebugLogger extends DebugLoggerFunction { - enabled: boolean; - } - /** - * The `util.debuglog()` method is used to create a function that conditionally - * writes debug messages to `stderr` based on the existence of the `NODE_DEBUG`environment variable. If the `section` name appears within the value of that - * environment variable, then the returned function operates similar to `console.error()`. If not, then the returned function is a no-op. - * - * ```js - * import util from 'node:util'; - * const debuglog = util.debuglog('foo'); - * - * debuglog('hello from foo [%d]', 123); - * ``` - * - * If this program is run with `NODE_DEBUG=foo` in the environment, then - * it will output something like: - * - * ```console - * FOO 3245: hello from foo [123] - * ``` - * - * where `3245` is the process id. If it is not run with that - * environment variable set, then it will not print anything. - * - * The `section` supports wildcard also: - * - * ```js - * import util from 'node:util'; - * const debuglog = util.debuglog('foo-bar'); - * - * debuglog('hi there, it\'s foo-bar [%d]', 2333); - * ``` - * - * if it is run with `NODE_DEBUG=foo*` in the environment, then it will output - * something like: - * - * ```console - * FOO-BAR 3257: hi there, it's foo-bar [2333] - * ``` - * - * Multiple comma-separated `section` names may be specified in the `NODE_DEBUG`environment variable: `NODE_DEBUG=fs,net,tls`. - * - * The optional `callback` argument can be used to replace the logging function - * with a different function that doesn't have any initialization or - * unnecessary wrapping. - * - * ```js - * import util from 'node:util'; - * let debuglog = util.debuglog('internals', (debug) => { - * // Replace with a logging function that optimizes out - * // testing if the section is enabled - * debuglog = debug; - * }); - * ``` - * @since v0.11.3 - * @param section A string identifying the portion of the application for which the `debuglog` function is being created. - * @param callback A callback invoked the first time the logging function is called with a function argument that is a more optimized logging function. - * @return The logging function - */ - export function debuglog(section: string, callback?: (fn: DebugLoggerFunction) => void): DebugLogger; - export const debug: typeof debuglog; - /** - * Returns `true` if the given `object` is a `Boolean`. Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * util.isBoolean(1); - * // Returns: false - * util.isBoolean(0); - * // Returns: false - * util.isBoolean(false); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'boolean'` instead. - */ - export function isBoolean(object: unknown): object is boolean; - /** - * Returns `true` if the given `object` is a `Buffer`. Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * util.isBuffer({ length: 0 }); - * // Returns: false - * util.isBuffer([]); - * // Returns: false - * util.isBuffer(Buffer.from('hello world')); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `isBuffer` instead. - */ - export function isBuffer(object: unknown): object is Buffer; - /** - * Returns `true` if the given `object` is a `Function`. Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * function Foo() {} - * const Bar = () => {}; - * - * util.isFunction({}); - * // Returns: false - * util.isFunction(Foo); - * // Returns: true - * util.isFunction(Bar); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'function'` instead. - */ - export function isFunction(object: unknown): boolean; - /** - * Returns `true` if the given `object` is strictly `null`. Otherwise, returns`false`. - * - * ```js - * import util from 'node:util'; - * - * util.isNull(0); - * // Returns: false - * util.isNull(undefined); - * // Returns: false - * util.isNull(null); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `value === null` instead. - */ - export function isNull(object: unknown): object is null; - /** - * Returns `true` if the given `object` is `null` or `undefined`. Otherwise, - * returns `false`. - * - * ```js - * import util from 'node:util'; - * - * util.isNullOrUndefined(0); - * // Returns: false - * util.isNullOrUndefined(undefined); - * // Returns: true - * util.isNullOrUndefined(null); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `value === undefined || value === null` instead. - */ - export function isNullOrUndefined(object: unknown): object is null | undefined; - /** - * Returns `true` if the given `object` is a `Number`. Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * util.isNumber(false); - * // Returns: false - * util.isNumber(Infinity); - * // Returns: true - * util.isNumber(0); - * // Returns: true - * util.isNumber(NaN); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'number'` instead. - */ - export function isNumber(object: unknown): object is number; - /** - * Returns `true` if the given `object` is strictly an `Object`**and** not a`Function` (even though functions are objects in JavaScript). - * Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * util.isObject(5); - * // Returns: false - * util.isObject(null); - * // Returns: false - * util.isObject({}); - * // Returns: true - * util.isObject(() => {}); - * // Returns: false - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `value !== null && typeof value === 'object'` instead. - */ - export function isObject(object: unknown): boolean; - /** - * Returns `true` if the given `object` is a primitive type. Otherwise, returns`false`. - * - * ```js - * import util from 'node:util'; - * - * util.isPrimitive(5); - * // Returns: true - * util.isPrimitive('foo'); - * // Returns: true - * util.isPrimitive(false); - * // Returns: true - * util.isPrimitive(null); - * // Returns: true - * util.isPrimitive(undefined); - * // Returns: true - * util.isPrimitive({}); - * // Returns: false - * util.isPrimitive(() => {}); - * // Returns: false - * util.isPrimitive(/^$/); - * // Returns: false - * util.isPrimitive(new Date()); - * // Returns: false - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `(typeof value !== 'object' && typeof value !== 'function') || value === null` instead. - */ - export function isPrimitive(object: unknown): boolean; - /** - * Returns `true` if the given `object` is a `string`. Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * util.isString(''); - * // Returns: true - * util.isString('foo'); - * // Returns: true - * util.isString(String('foo')); - * // Returns: true - * util.isString(5); - * // Returns: false - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'string'` instead. - */ - export function isString(object: unknown): object is string; - /** - * Returns `true` if the given `object` is a `Symbol`. Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * util.isSymbol(5); - * // Returns: false - * util.isSymbol('foo'); - * // Returns: false - * util.isSymbol(Symbol('foo')); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'symbol'` instead. - */ - export function isSymbol(object: unknown): object is symbol; - /** - * Returns `true` if the given `object` is `undefined`. Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * const foo = undefined; - * util.isUndefined(5); - * // Returns: false - * util.isUndefined(foo); - * // Returns: true - * util.isUndefined(null); - * // Returns: false - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `value === undefined` instead. - */ - export function isUndefined(object: unknown): object is undefined; - /** - * The `util.deprecate()` method wraps `fn` (which may be a function or class) in - * such a way that it is marked as deprecated. - * - * ```js - * import util from 'node:util'; - * - * exports.obsoleteFunction = util.deprecate(() => { - * // Do something here. - * }, 'obsoleteFunction() is deprecated. Use newShinyFunction() instead.'); - * ``` - * - * When called, `util.deprecate()` will return a function that will emit a `DeprecationWarning` using the `'warning'` event. The warning will - * be emitted and printed to `stderr` the first time the returned function is - * called. After the warning is emitted, the wrapped function is called without - * emitting a warning. - * - * If the same optional `code` is supplied in multiple calls to `util.deprecate()`, - * the warning will be emitted only once for that `code`. - * - * ```js - * import util from 'node:util'; - * - * const fn1 = util.deprecate(someFunction, someMessage, 'DEP0001'); - * const fn2 = util.deprecate(someOtherFunction, someOtherMessage, 'DEP0001'); - * fn1(); // Emits a deprecation warning with code DEP0001 - * fn2(); // Does not emit a deprecation warning because it has the same code - * ``` - * - * If either the `--no-deprecation` or `--no-warnings` command-line flags are - * used, or if the `process.noDeprecation` property is set to `true`_prior_ to - * the first deprecation warning, the `util.deprecate()` method does nothing. - * - * If the `--trace-deprecation` or `--trace-warnings` command-line flags are set, - * or the `process.traceDeprecation` property is set to `true`, a warning and a - * stack trace are printed to `stderr` the first time the deprecated function is - * called. - * - * If the `--throw-deprecation` command-line flag is set, or the `process.throwDeprecation` property is set to `true`, then an exception will be - * thrown when the deprecated function is called. - * - * The `--throw-deprecation` command-line flag and `process.throwDeprecation` property take precedence over `--trace-deprecation` and `process.traceDeprecation`. - * @since v0.8.0 - * @param fn The function that is being deprecated. - * @param msg A warning message to display when the deprecated function is invoked. - * @param code A deprecation code. See the `list of deprecated APIs` for a list of codes. - * @return The deprecated function wrapped to emit a warning. - */ - export function deprecate(fn: T, msg: string, code?: string): T; - /** - * Returns `true` if there is deep strict equality between `val1` and `val2`. - * Otherwise, returns `false`. - * - * See `assert.deepStrictEqual()` for more information about deep strict - * equality. - * @since v9.0.0 - */ - export function isDeepStrictEqual(val1: unknown, val2: unknown): boolean; - /** - * Returns `str` with any ANSI escape codes removed. - * - * ```js - * console.log(util.stripVTControlCharacters('\u001B[4mvalue\u001B[0m')); - * // Prints "value" - * ``` - * @since v16.11.0 - */ - export function stripVTControlCharacters(str: string): string; - /** - * Takes an `async` function (or a function that returns a `Promise`) and returns a - * function following the error-first callback style, i.e. taking - * an `(err, value) => ...` callback as the last argument. In the callback, the - * first argument will be the rejection reason (or `null` if the `Promise` resolved), and the second argument will be the resolved value. - * - * ```js - * import util from 'node:util'; - * - * async function fn() { - * return 'hello world'; - * } - * const callbackFunction = util.callbackify(fn); - * - * callbackFunction((err, ret) => { - * if (err) throw err; - * console.log(ret); - * }); - * ``` - * - * Will print: - * - * ```text - * hello world - * ``` - * - * The callback is executed asynchronously, and will have a limited stack trace. - * If the callback throws, the process will emit an `'uncaughtException'` event, and if not handled will exit. - * - * Since `null` has a special meaning as the first argument to a callback, if a - * wrapped function rejects a `Promise` with a falsy value as a reason, the value - * is wrapped in an `Error` with the original value stored in a field named `reason`. - * - * ```js - * function fn() { - * return Promise.reject(null); - * } - * const callbackFunction = util.callbackify(fn); - * - * callbackFunction((err, ret) => { - * // When the Promise was rejected with `null` it is wrapped with an Error and - * // the original value is stored in `reason`. - * err && Object.hasOwn(err, 'reason') && err.reason === null; // true - * }); - * ``` - * @since v8.2.0 - * @param fn An `async` function - * @return a callback style function - */ - export function callbackify(fn: () => Promise): (callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: () => Promise, - ): (callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; - export function callbackify( - fn: (arg1: T1) => Promise, - ): (arg1: T1, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: (arg1: T1) => Promise, - ): (arg1: T1, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2) => Promise, - ): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2) => Promise, - ): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3) => Promise, - ): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3) => Promise, - ): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise, - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise, - ): ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - callback: (err: NodeJS.ErrnoException | null, result: TResult) => void, - ) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise, - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise, - ): ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - callback: (err: NodeJS.ErrnoException | null, result: TResult) => void, - ) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise, - ): ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - arg6: T6, - callback: (err: NodeJS.ErrnoException) => void, - ) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise, - ): ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - arg6: T6, - callback: (err: NodeJS.ErrnoException | null, result: TResult) => void, - ) => void; - export interface CustomPromisifyLegacy extends Function { - __promisify__: TCustom; - } - export interface CustomPromisifySymbol extends Function { - [promisify.custom]: TCustom; - } - export type CustomPromisify = - | CustomPromisifySymbol - | CustomPromisifyLegacy; - /** - * Takes a function following the common error-first callback style, i.e. taking - * an `(err, value) => ...` callback as the last argument, and returns a version - * that returns promises. - * - * ```js - * import util from 'node:util'; - * import fs from 'node:fs'; - * - * const stat = util.promisify(fs.stat); - * stat('.').then((stats) => { - * // Do something with `stats` - * }).catch((error) => { - * // Handle the error. - * }); - * ``` - * - * Or, equivalently using `async function`s: - * - * ```js - * import util from 'node:util'; - * import fs from 'node:fs'; - * - * const stat = util.promisify(fs.stat); - * - * async function callStat() { - * const stats = await stat('.'); - * console.log(`This directory is owned by ${stats.uid}`); - * } - * - * callStat(); - * ``` - * - * If there is an `original[util.promisify.custom]` property present, `promisify` will return its value, see `Custom promisified functions`. - * - * `promisify()` assumes that `original` is a function taking a callback as its - * final argument in all cases. If `original` is not a function, `promisify()` will throw an error. If `original` is a function but its last argument is not - * an error-first callback, it will still be passed an error-first - * callback as its last argument. - * - * Using `promisify()` on class methods or other methods that use `this` may not - * work as expected unless handled specially: - * - * ```js - * import util from 'node:util'; - * - * class Foo { - * constructor() { - * this.a = 42; - * } - * - * bar(callback) { - * callback(null, this.a); - * } - * } - * - * const foo = new Foo(); - * - * const naiveBar = util.promisify(foo.bar); - * // TypeError: Cannot read property 'a' of undefined - * // naiveBar().then(a => console.log(a)); - * - * naiveBar.call(foo).then((a) => console.log(a)); // '42' - * - * const bindBar = naiveBar.bind(foo); - * bindBar().then((a) => console.log(a)); // '42' - * ``` - * @since v8.0.0 - */ - export function promisify(fn: CustomPromisify): TCustom; - export function promisify( - fn: (callback: (err: any, result: TResult) => void) => void, - ): () => Promise; - export function promisify(fn: (callback: (err?: any) => void) => void): () => Promise; - export function promisify( - fn: (arg1: T1, callback: (err: any, result: TResult) => void) => void, - ): (arg1: T1) => Promise; - export function promisify(fn: (arg1: T1, callback: (err?: any) => void) => void): (arg1: T1) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, callback: (err: any, result: TResult) => void) => void, - ): (arg1: T1, arg2: T2) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, callback: (err?: any) => void) => void, - ): (arg1: T1, arg2: T2) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: any, result: TResult) => void) => void, - ): (arg1: T1, arg2: T2, arg3: T3) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err?: any) => void) => void, - ): (arg1: T1, arg2: T2, arg3: T3) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: any, result: TResult) => void) => void, - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: any) => void) => void, - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: any, result: TResult) => void) => void, - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: any) => void) => void, - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; - export function promisify(fn: Function): Function; - export namespace promisify { - /** - * That can be used to declare custom promisified variants of functions. - */ - const custom: unique symbol; - } - /** - * Stability: 1.1 - Active development - * Given an example `.env` file: - * - * ```js - * import { parseEnv } from 'node:util'; - * - * parseEnv('HELLO=world\nHELLO=oh my\n'); - * // Returns: { HELLO: 'oh my' } - * ``` - * @param content The raw contents of a `.env` file. - * @since v20.12.0 - */ - export function parseEnv(content: string): object; - // https://nodejs.org/docs/latest/api/util.html#foreground-colors - type ForegroundColors = - | "black" - | "blackBright" - | "blue" - | "blueBright" - | "cyan" - | "cyanBright" - | "gray" - | "green" - | "greenBright" - | "grey" - | "magenta" - | "magentaBright" - | "red" - | "redBright" - | "white" - | "whiteBright" - | "yellow" - | "yellowBright"; - // https://nodejs.org/docs/latest/api/util.html#background-colors - type BackgroundColors = - | "bgBlack" - | "bgBlackBright" - | "bgBlue" - | "bgBlueBright" - | "bgCyan" - | "bgCyanBright" - | "bgGray" - | "bgGreen" - | "bgGreenBright" - | "bgGrey" - | "bgMagenta" - | "bgMagentaBright" - | "bgRed" - | "bgRedBright" - | "bgWhite" - | "bgWhiteBright" - | "bgYellow" - | "bgYellowBright"; - // https://nodejs.org/docs/latest/api/util.html#modifiers - type Modifiers = - | "blink" - | "bold" - | "dim" - | "doubleunderline" - | "framed" - | "hidden" - | "inverse" - | "italic" - | "overlined" - | "reset" - | "strikethrough" - | "underline"; - /** - * Stability: 1.1 - Active development - * - * This function returns a formatted text considering the `format` passed. - * - * ```js - * import { styleText } from 'node:util'; - * const errorMessage = styleText('red', 'Error! Error!'); - * console.log(errorMessage); - * ``` - * - * `util.inspect.colors` also provides text formats such as `italic`, and `underline` and you can combine both: - * - * ```js - * console.log( - * util.styleText(['underline', 'italic'], 'My italic underlined message'), - * ); - * ``` - * - * When passing an array of formats, the order of the format applied is left to right so the following style - * might overwrite the previous one. - * - * ```js - * console.log( - * util.styleText(['red', 'green'], 'text'), // green - * ); - * ``` - * - * The full list of formats can be found in [modifiers](https://nodejs.org/docs/latest-v22.x/api/util.html#modifiers). - * @param format A text format or an Array of text formats defined in `util.inspect.colors`. - * @param text The text to to be formatted. - * @since v20.12.0 - */ - export function styleText( - format: - | ForegroundColors - | BackgroundColors - | Modifiers - | Array, - text: string, - ): string; - /** - * An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextDecoder` API. - * - * ```js - * const decoder = new TextDecoder(); - * const u8arr = new Uint8Array([72, 101, 108, 108, 111]); - * console.log(decoder.decode(u8arr)); // Hello - * ``` - * @since v8.3.0 - */ - export class TextDecoder { - /** - * The encoding supported by the `TextDecoder` instance. - */ - readonly encoding: string; - /** - * The value will be `true` if decoding errors result in a `TypeError` being - * thrown. - */ - readonly fatal: boolean; - /** - * The value will be `true` if the decoding result will include the byte order - * mark. - */ - readonly ignoreBOM: boolean; - constructor( - encoding?: string, - options?: { - fatal?: boolean | undefined; - ignoreBOM?: boolean | undefined; - }, - ); - /** - * Decodes the `input` and returns a string. If `options.stream` is `true`, any - * incomplete byte sequences occurring at the end of the `input` are buffered - * internally and emitted after the next call to `textDecoder.decode()`. - * - * If `textDecoder.fatal` is `true`, decoding errors that occur will result in a `TypeError` being thrown. - * @param input An `ArrayBuffer`, `DataView`, or `TypedArray` instance containing the encoded data. - */ - decode( - input?: NodeJS.ArrayBufferView | ArrayBuffer | null, - options?: { - stream?: boolean | undefined; - }, - ): string; - } - export interface EncodeIntoResult { - /** - * The read Unicode code units of input. - */ - read: number; - /** - * The written UTF-8 bytes of output. - */ - written: number; - } - export { types }; - - //// TextEncoder/Decoder - /** - * An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextEncoder` API. All - * instances of `TextEncoder` only support UTF-8 encoding. - * - * ```js - * const encoder = new TextEncoder(); - * const uint8array = encoder.encode('this is some data'); - * ``` - * - * The `TextEncoder` class is also available on the global object. - * @since v8.3.0 - */ - export class TextEncoder { - /** - * The encoding supported by the `TextEncoder` instance. Always set to `'utf-8'`. - */ - readonly encoding: string; - /** - * UTF-8 encodes the `input` string and returns a `Uint8Array` containing the - * encoded bytes. - * @param [input='an empty string'] The text to encode. - */ - encode(input?: string): Uint8Array; - /** - * UTF-8 encodes the `src` string to the `dest` Uint8Array and returns an object - * containing the read Unicode code units and written UTF-8 bytes. - * - * ```js - * const encoder = new TextEncoder(); - * const src = 'this is some data'; - * const dest = new Uint8Array(10); - * const { read, written } = encoder.encodeInto(src, dest); - * ``` - * @param src The text to encode. - * @param dest The array to hold the encode result. - */ - encodeInto(src: string, dest: Uint8Array): EncodeIntoResult; - } - import { TextDecoder as _TextDecoder, TextEncoder as _TextEncoder } from "util"; - global { - /** - * `TextDecoder` class is a global reference for `import { TextDecoder } from 'node:util'` - * https://nodejs.org/api/globals.html#textdecoder - * @since v11.0.0 - */ - var TextDecoder: typeof globalThis extends { - onmessage: any; - TextDecoder: infer TextDecoder; - } ? TextDecoder - : typeof _TextDecoder; - /** - * `TextEncoder` class is a global reference for `import { TextEncoder } from 'node:util'` - * https://nodejs.org/api/globals.html#textencoder - * @since v11.0.0 - */ - var TextEncoder: typeof globalThis extends { - onmessage: any; - TextEncoder: infer TextEncoder; - } ? TextEncoder - : typeof _TextEncoder; - } - - //// parseArgs - /** - * Provides a higher level API for command-line argument parsing than interacting - * with `process.argv` directly. Takes a specification for the expected arguments - * and returns a structured object with the parsed options and positionals. - * - * ```js - * import { parseArgs } from 'node:util'; - * const args = ['-f', '--bar', 'b']; - * const options = { - * foo: { - * type: 'boolean', - * short: 'f', - * }, - * bar: { - * type: 'string', - * }, - * }; - * const { - * values, - * positionals, - * } = parseArgs({ args, options }); - * console.log(values, positionals); - * // Prints: [Object: null prototype] { foo: true, bar: 'b' } [] - * ``` - * @since v18.3.0, v16.17.0 - * @param config Used to provide arguments for parsing and to configure the parser. `config` supports the following properties: - * @return The parsed command line arguments: - */ - export function parseArgs(config?: T): ParsedResults; - interface ParseArgsOptionConfig { - /** - * Type of argument. - */ - type: "string" | "boolean"; - /** - * Whether this option can be provided multiple times. - * If `true`, all values will be collected in an array. - * If `false`, values for the option are last-wins. - * @default false. - */ - multiple?: boolean | undefined; - /** - * A single character alias for the option. - */ - short?: string | undefined; - /** - * The default option value when it is not set by args. - * It must be of the same type as the the `type` property. - * When `multiple` is `true`, it must be an array. - * @since v18.11.0 - */ - default?: string | boolean | string[] | boolean[] | undefined; - } - interface ParseArgsOptionsConfig { - [longOption: string]: ParseArgsOptionConfig; - } - export interface ParseArgsConfig { - /** - * Array of argument strings. - */ - args?: string[] | undefined; - /** - * Used to describe arguments known to the parser. - */ - options?: ParseArgsOptionsConfig | undefined; - /** - * Should an error be thrown when unknown arguments are encountered, - * or when arguments are passed that do not match the `type` configured in `options`. - * @default true - */ - strict?: boolean | undefined; - /** - * Whether this command accepts positional arguments. - */ - allowPositionals?: boolean | undefined; - /** - * If `true`, allows explicitly setting boolean options to `false` by prefixing the option name with `--no-`. - * @default false - * @since v22.4.0 - */ - allowNegative?: boolean | undefined; - /** - * Return the parsed tokens. This is useful for extending the built-in behavior, - * from adding additional checks through to reprocessing the tokens in different ways. - * @default false - */ - tokens?: boolean | undefined; - } - /* - IfDefaultsTrue and IfDefaultsFalse are helpers to handle default values for missing boolean properties. - TypeScript does not have exact types for objects: https://github.com/microsoft/TypeScript/issues/12936 - This means it is impossible to distinguish between "field X is definitely not present" and "field X may or may not be present". - But we expect users to generally provide their config inline or `as const`, which means TS will always know whether a given field is present. - So this helper treats "not definitely present" (i.e., not `extends boolean`) as being "definitely not present", i.e. it should have its default value. - This is technically incorrect but is a much nicer UX for the common case. - The IfDefaultsTrue version is for things which default to true; the IfDefaultsFalse version is for things which default to false. - */ - type IfDefaultsTrue = T extends true ? IfTrue - : T extends false ? IfFalse - : IfTrue; - - // we put the `extends false` condition first here because `undefined` compares like `any` when `strictNullChecks: false` - type IfDefaultsFalse = T extends false ? IfFalse - : T extends true ? IfTrue - : IfFalse; - - type ExtractOptionValue = IfDefaultsTrue< - T["strict"], - O["type"] extends "string" ? string : O["type"] extends "boolean" ? boolean : string | boolean, - string | boolean - >; - - type ParsedValues = - & IfDefaultsTrue - & (T["options"] extends ParseArgsOptionsConfig ? { - -readonly [LongOption in keyof T["options"]]: - // when "default" is not undefined, the value will be present - | (T["options"][LongOption]["default"] extends {} ? never : undefined) - | IfDefaultsFalse< - T["options"][LongOption]["multiple"], - Array>, - ExtractOptionValue - >; - } - : {}); - - type ParsedPositionals = IfDefaultsTrue< - T["strict"], - IfDefaultsFalse, - IfDefaultsTrue - >; - - type PreciseTokenForOptions< - K extends string, - O extends ParseArgsOptionConfig, - > = O["type"] extends "string" ? { - kind: "option"; - index: number; - name: K; - rawName: string; - value: string; - inlineValue: boolean; - } - : O["type"] extends "boolean" ? { - kind: "option"; - index: number; - name: K; - rawName: string; - value: undefined; - inlineValue: undefined; - } - : OptionToken & { name: K }; - - type TokenForOptions< - T extends ParseArgsConfig, - K extends keyof T["options"] = keyof T["options"], - > = K extends unknown - ? T["options"] extends ParseArgsOptionsConfig ? PreciseTokenForOptions - : OptionToken - : never; - - type ParsedOptionToken = IfDefaultsTrue, OptionToken>; - - type ParsedPositionalToken = IfDefaultsTrue< - T["strict"], - IfDefaultsFalse, - IfDefaultsTrue - >; - - type ParsedTokens = Array< - ParsedOptionToken | ParsedPositionalToken | { kind: "option-terminator"; index: number } - >; - - type PreciseParsedResults = IfDefaultsFalse< - T["tokens"], - { - values: ParsedValues; - positionals: ParsedPositionals; - tokens: ParsedTokens; - }, - { - values: ParsedValues; - positionals: ParsedPositionals; - } - >; - - type OptionToken = - | { kind: "option"; index: number; name: string; rawName: string; value: string; inlineValue: boolean } - | { - kind: "option"; - index: number; - name: string; - rawName: string; - value: undefined; - inlineValue: undefined; - }; - - type Token = - | OptionToken - | { kind: "positional"; index: number; value: string } - | { kind: "option-terminator"; index: number }; - - // If ParseArgsConfig extends T, then the user passed config constructed elsewhere. - // So we can't rely on the `"not definitely present" implies "definitely not present"` assumption mentioned above. - type ParsedResults = ParseArgsConfig extends T ? { - values: { - [longOption: string]: undefined | string | boolean | Array; - }; - positionals: string[]; - tokens?: Token[]; - } - : PreciseParsedResults; - - /** - * An implementation of [the MIMEType class](https://bmeck.github.io/node-proposal-mime-api/). - * - * In accordance with browser conventions, all properties of `MIMEType` objects - * are implemented as getters and setters on the class prototype, rather than as - * data properties on the object itself. - * - * A MIME string is a structured string containing multiple meaningful - * components. When parsed, a `MIMEType` object is returned containing - * properties for each of these components. - * @since v19.1.0, v18.13.0 - * @experimental - */ - export class MIMEType { - /** - * Creates a new MIMEType object by parsing the input. - * - * A `TypeError` will be thrown if the `input` is not a valid MIME. - * Note that an effort will be made to coerce the given values into strings. - * @param input The input MIME to parse. - */ - constructor(input: string | { toString: () => string }); - - /** - * Gets and sets the type portion of the MIME. - * - * ```js - * import { MIMEType } from 'node:util'; - * - * const myMIME = new MIMEType('text/javascript'); - * console.log(myMIME.type); - * // Prints: text - * myMIME.type = 'application'; - * console.log(myMIME.type); - * // Prints: application - * console.log(String(myMIME)); - * // Prints: application/javascript - * ``` - */ - type: string; - /** - * Gets and sets the subtype portion of the MIME. - * - * ```js - * import { MIMEType } from 'node:util'; - * - * const myMIME = new MIMEType('text/ecmascript'); - * console.log(myMIME.subtype); - * // Prints: ecmascript - * myMIME.subtype = 'javascript'; - * console.log(myMIME.subtype); - * // Prints: javascript - * console.log(String(myMIME)); - * // Prints: text/javascript - * ``` - */ - subtype: string; - /** - * Gets the essence of the MIME. This property is read only. - * Use `mime.type` or `mime.subtype` to alter the MIME. - * - * ```js - * import { MIMEType } from 'node:util'; - * - * const myMIME = new MIMEType('text/javascript;key=value'); - * console.log(myMIME.essence); - * // Prints: text/javascript - * myMIME.type = 'application'; - * console.log(myMIME.essence); - * // Prints: application/javascript - * console.log(String(myMIME)); - * // Prints: application/javascript;key=value - * ``` - */ - readonly essence: string; - /** - * Gets the `MIMEParams` object representing the - * parameters of the MIME. This property is read-only. See `MIMEParams` documentation for details. - */ - readonly params: MIMEParams; - /** - * The `toString()` method on the `MIMEType` object returns the serialized MIME. - * - * Because of the need for standard compliance, this method does not allow users - * to customize the serialization process of the MIME. - */ - toString(): string; - } - /** - * The `MIMEParams` API provides read and write access to the parameters of a `MIMEType`. - * @since v19.1.0, v18.13.0 - */ - export class MIMEParams { - /** - * Remove all name-value pairs whose name is `name`. - */ - delete(name: string): void; - /** - * Returns an iterator over each of the name-value pairs in the parameters. - * Each item of the iterator is a JavaScript `Array`. The first item of the array - * is the `name`, the second item of the array is the `value`. - */ - entries(): IterableIterator<[name: string, value: string]>; - /** - * Returns the value of the first name-value pair whose name is `name`. If there - * are no such pairs, `null` is returned. - * @return or `null` if there is no name-value pair with the given `name`. - */ - get(name: string): string | null; - /** - * Returns `true` if there is at least one name-value pair whose name is `name`. - */ - has(name: string): boolean; - /** - * Returns an iterator over the names of each name-value pair. - * - * ```js - * import { MIMEType } from 'node:util'; - * - * const { params } = new MIMEType('text/plain;foo=0;bar=1'); - * for (const name of params.keys()) { - * console.log(name); - * } - * // Prints: - * // foo - * // bar - * ``` - */ - keys(): IterableIterator; - /** - * Sets the value in the `MIMEParams` object associated with `name` to `value`. If there are any pre-existing name-value pairs whose names are `name`, - * set the first such pair's value to `value`. - * - * ```js - * import { MIMEType } from 'node:util'; - * - * const { params } = new MIMEType('text/plain;foo=0;bar=1'); - * params.set('foo', 'def'); - * params.set('baz', 'xyz'); - * console.log(params.toString()); - * // Prints: foo=def;bar=1;baz=xyz - * ``` - */ - set(name: string, value: string): void; - /** - * Returns an iterator over the values of each name-value pair. - */ - values(): IterableIterator; - /** - * Returns an iterator over each of the name-value pairs in the parameters. - */ - [Symbol.iterator]: typeof MIMEParams.prototype.entries; - } -} -declare module "util/types" { - import { KeyObject, webcrypto } from "node:crypto"; - /** - * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) or - * [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance. - * - * See also `util.types.isArrayBuffer()` and `util.types.isSharedArrayBuffer()`. - * - * ```js - * util.types.isAnyArrayBuffer(new ArrayBuffer()); // Returns true - * util.types.isAnyArrayBuffer(new SharedArrayBuffer()); // Returns true - * ``` - * @since v10.0.0 - */ - function isAnyArrayBuffer(object: unknown): object is ArrayBufferLike; - /** - * Returns `true` if the value is an `arguments` object. - * - * ```js - * function foo() { - * util.types.isArgumentsObject(arguments); // Returns true - * } - * ``` - * @since v10.0.0 - */ - function isArgumentsObject(object: unknown): object is IArguments; - /** - * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instance. - * This does _not_ include [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instances. Usually, it is - * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that. - * - * ```js - * util.types.isArrayBuffer(new ArrayBuffer()); // Returns true - * util.types.isArrayBuffer(new SharedArrayBuffer()); // Returns false - * ``` - * @since v10.0.0 - */ - function isArrayBuffer(object: unknown): object is ArrayBuffer; - /** - * Returns `true` if the value is an instance of one of the [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) views, such as typed - * array objects or [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView). Equivalent to - * [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). - * - * ```js - * util.types.isArrayBufferView(new Int8Array()); // true - * util.types.isArrayBufferView(Buffer.from('hello world')); // true - * util.types.isArrayBufferView(new DataView(new ArrayBuffer(16))); // true - * util.types.isArrayBufferView(new ArrayBuffer()); // false - * ``` - * @since v10.0.0 - */ - function isArrayBufferView(object: unknown): object is NodeJS.ArrayBufferView; - /** - * Returns `true` if the value is an [async function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function). - * This only reports back what the JavaScript engine is seeing; - * in particular, the return value may not match the original source code if - * a transpilation tool was used. - * - * ```js - * util.types.isAsyncFunction(function foo() {}); // Returns false - * util.types.isAsyncFunction(async function foo() {}); // Returns true - * ``` - * @since v10.0.0 - */ - function isAsyncFunction(object: unknown): boolean; - /** - * Returns `true` if the value is a `BigInt64Array` instance. - * - * ```js - * util.types.isBigInt64Array(new BigInt64Array()); // Returns true - * util.types.isBigInt64Array(new BigUint64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isBigInt64Array(value: unknown): value is BigInt64Array; - /** - * Returns `true` if the value is a `BigUint64Array` instance. - * - * ```js - * util.types.isBigUint64Array(new BigInt64Array()); // Returns false - * util.types.isBigUint64Array(new BigUint64Array()); // Returns true - * ``` - * @since v10.0.0 - */ - function isBigUint64Array(value: unknown): value is BigUint64Array; - /** - * Returns `true` if the value is a boolean object, e.g. created - * by `new Boolean()`. - * - * ```js - * util.types.isBooleanObject(false); // Returns false - * util.types.isBooleanObject(true); // Returns false - * util.types.isBooleanObject(new Boolean(false)); // Returns true - * util.types.isBooleanObject(new Boolean(true)); // Returns true - * util.types.isBooleanObject(Boolean(false)); // Returns false - * util.types.isBooleanObject(Boolean(true)); // Returns false - * ``` - * @since v10.0.0 - */ - function isBooleanObject(object: unknown): object is Boolean; - /** - * Returns `true` if the value is any boxed primitive object, e.g. created - * by `new Boolean()`, `new String()` or `Object(Symbol())`. - * - * For example: - * - * ```js - * util.types.isBoxedPrimitive(false); // Returns false - * util.types.isBoxedPrimitive(new Boolean(false)); // Returns true - * util.types.isBoxedPrimitive(Symbol('foo')); // Returns false - * util.types.isBoxedPrimitive(Object(Symbol('foo'))); // Returns true - * util.types.isBoxedPrimitive(Object(BigInt(5))); // Returns true - * ``` - * @since v10.11.0 - */ - function isBoxedPrimitive(object: unknown): object is String | Number | BigInt | Boolean | Symbol; - /** - * Returns `true` if the value is a built-in [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) instance. - * - * ```js - * const ab = new ArrayBuffer(20); - * util.types.isDataView(new DataView(ab)); // Returns true - * util.types.isDataView(new Float64Array()); // Returns false - * ``` - * - * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). - * @since v10.0.0 - */ - function isDataView(object: unknown): object is DataView; - /** - * Returns `true` if the value is a built-in [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) instance. - * - * ```js - * util.types.isDate(new Date()); // Returns true - * ``` - * @since v10.0.0 - */ - function isDate(object: unknown): object is Date; - /** - * Returns `true` if the value is a native `External` value. - * - * A native `External` value is a special type of object that contains a - * raw C++ pointer (`void*`) for access from native code, and has no other - * properties. Such objects are created either by Node.js internals or native - * addons. In JavaScript, they are [frozen](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze) objects with a`null` prototype. - * - * ```c - * #include - * #include - * napi_value result; - * static napi_value MyNapi(napi_env env, napi_callback_info info) { - * int* raw = (int*) malloc(1024); - * napi_status status = napi_create_external(env, (void*) raw, NULL, NULL, &result); - * if (status != napi_ok) { - * napi_throw_error(env, NULL, "napi_create_external failed"); - * return NULL; - * } - * return result; - * } - * ... - * DECLARE_NAPI_PROPERTY("myNapi", MyNapi) - * ... - * ``` - * - * ```js - * const native = require('napi_addon.node'); - * const data = native.myNapi(); - * util.types.isExternal(data); // returns true - * util.types.isExternal(0); // returns false - * util.types.isExternal(new String('foo')); // returns false - * ``` - * - * For further information on `napi_create_external`, refer to `napi_create_external()`. - * @since v10.0.0 - */ - function isExternal(object: unknown): boolean; - /** - * Returns `true` if the value is a built-in [`Float32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array) instance. - * - * ```js - * util.types.isFloat32Array(new ArrayBuffer()); // Returns false - * util.types.isFloat32Array(new Float32Array()); // Returns true - * util.types.isFloat32Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isFloat32Array(object: unknown): object is Float32Array; - /** - * Returns `true` if the value is a built-in [`Float64Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array) instance. - * - * ```js - * util.types.isFloat64Array(new ArrayBuffer()); // Returns false - * util.types.isFloat64Array(new Uint8Array()); // Returns false - * util.types.isFloat64Array(new Float64Array()); // Returns true - * ``` - * @since v10.0.0 - */ - function isFloat64Array(object: unknown): object is Float64Array; - /** - * Returns `true` if the value is a generator function. - * This only reports back what the JavaScript engine is seeing; - * in particular, the return value may not match the original source code if - * a transpilation tool was used. - * - * ```js - * util.types.isGeneratorFunction(function foo() {}); // Returns false - * util.types.isGeneratorFunction(function* foo() {}); // Returns true - * ``` - * @since v10.0.0 - */ - function isGeneratorFunction(object: unknown): object is GeneratorFunction; - /** - * Returns `true` if the value is a generator object as returned from a - * built-in generator function. - * This only reports back what the JavaScript engine is seeing; - * in particular, the return value may not match the original source code if - * a transpilation tool was used. - * - * ```js - * function* foo() {} - * const generator = foo(); - * util.types.isGeneratorObject(generator); // Returns true - * ``` - * @since v10.0.0 - */ - function isGeneratorObject(object: unknown): object is Generator; - /** - * Returns `true` if the value is a built-in [`Int8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array) instance. - * - * ```js - * util.types.isInt8Array(new ArrayBuffer()); // Returns false - * util.types.isInt8Array(new Int8Array()); // Returns true - * util.types.isInt8Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isInt8Array(object: unknown): object is Int8Array; - /** - * Returns `true` if the value is a built-in [`Int16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array) instance. - * - * ```js - * util.types.isInt16Array(new ArrayBuffer()); // Returns false - * util.types.isInt16Array(new Int16Array()); // Returns true - * util.types.isInt16Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isInt16Array(object: unknown): object is Int16Array; - /** - * Returns `true` if the value is a built-in [`Int32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array) instance. - * - * ```js - * util.types.isInt32Array(new ArrayBuffer()); // Returns false - * util.types.isInt32Array(new Int32Array()); // Returns true - * util.types.isInt32Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isInt32Array(object: unknown): object is Int32Array; - /** - * Returns `true` if the value is a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance. - * - * ```js - * util.types.isMap(new Map()); // Returns true - * ``` - * @since v10.0.0 - */ - function isMap( - object: T | {}, - ): object is T extends ReadonlyMap ? (unknown extends T ? never : ReadonlyMap) - : Map; - /** - * Returns `true` if the value is an iterator returned for a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance. - * - * ```js - * const map = new Map(); - * util.types.isMapIterator(map.keys()); // Returns true - * util.types.isMapIterator(map.values()); // Returns true - * util.types.isMapIterator(map.entries()); // Returns true - * util.types.isMapIterator(map[Symbol.iterator]()); // Returns true - * ``` - * @since v10.0.0 - */ - function isMapIterator(object: unknown): boolean; - /** - * Returns `true` if the value is an instance of a [Module Namespace Object](https://tc39.github.io/ecma262/#sec-module-namespace-exotic-objects). - * - * ```js - * import * as ns from './a.js'; - * - * util.types.isModuleNamespaceObject(ns); // Returns true - * ``` - * @since v10.0.0 - */ - function isModuleNamespaceObject(value: unknown): boolean; - /** - * Returns `true` if the value was returned by the constructor of a [built-in `Error` type](https://tc39.es/ecma262/#sec-error-objects). - * - * ```js - * console.log(util.types.isNativeError(new Error())); // true - * console.log(util.types.isNativeError(new TypeError())); // true - * console.log(util.types.isNativeError(new RangeError())); // true - * ``` - * - * Subclasses of the native error types are also native errors: - * - * ```js - * class MyError extends Error {} - * console.log(util.types.isNativeError(new MyError())); // true - * ``` - * - * A value being `instanceof` a native error class is not equivalent to `isNativeError()` returning `true` for that value. `isNativeError()` returns `true` for errors - * which come from a different [realm](https://tc39.es/ecma262/#realm) while `instanceof Error` returns `false` for these errors: - * - * ```js - * import vm from 'node:vm'; - * const context = vm.createContext({}); - * const myError = vm.runInContext('new Error()', context); - * console.log(util.types.isNativeError(myError)); // true - * console.log(myError instanceof Error); // false - * ``` - * - * Conversely, `isNativeError()` returns `false` for all objects which were not - * returned by the constructor of a native error. That includes values - * which are `instanceof` native errors: - * - * ```js - * const myError = { __proto__: Error.prototype }; - * console.log(util.types.isNativeError(myError)); // false - * console.log(myError instanceof Error); // true - * ``` - * @since v10.0.0 - */ - function isNativeError(object: unknown): object is Error; - /** - * Returns `true` if the value is a number object, e.g. created - * by `new Number()`. - * - * ```js - * util.types.isNumberObject(0); // Returns false - * util.types.isNumberObject(new Number(0)); // Returns true - * ``` - * @since v10.0.0 - */ - function isNumberObject(object: unknown): object is Number; - /** - * Returns `true` if the value is a built-in [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). - * - * ```js - * util.types.isPromise(Promise.resolve(42)); // Returns true - * ``` - * @since v10.0.0 - */ - function isPromise(object: unknown): object is Promise; - /** - * Returns `true` if the value is a [`Proxy`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) instance. - * - * ```js - * const target = {}; - * const proxy = new Proxy(target, {}); - * util.types.isProxy(target); // Returns false - * util.types.isProxy(proxy); // Returns true - * ``` - * @since v10.0.0 - */ - function isProxy(object: unknown): boolean; - /** - * Returns `true` if the value is a regular expression object. - * - * ```js - * util.types.isRegExp(/abc/); // Returns true - * util.types.isRegExp(new RegExp('abc')); // Returns true - * ``` - * @since v10.0.0 - */ - function isRegExp(object: unknown): object is RegExp; - /** - * Returns `true` if the value is a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance. - * - * ```js - * util.types.isSet(new Set()); // Returns true - * ``` - * @since v10.0.0 - */ - function isSet( - object: T | {}, - ): object is T extends ReadonlySet ? (unknown extends T ? never : ReadonlySet) : Set; - /** - * Returns `true` if the value is an iterator returned for a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance. - * - * ```js - * const set = new Set(); - * util.types.isSetIterator(set.keys()); // Returns true - * util.types.isSetIterator(set.values()); // Returns true - * util.types.isSetIterator(set.entries()); // Returns true - * util.types.isSetIterator(set[Symbol.iterator]()); // Returns true - * ``` - * @since v10.0.0 - */ - function isSetIterator(object: unknown): boolean; - /** - * Returns `true` if the value is a built-in [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance. - * This does _not_ include [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instances. Usually, it is - * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that. - * - * ```js - * util.types.isSharedArrayBuffer(new ArrayBuffer()); // Returns false - * util.types.isSharedArrayBuffer(new SharedArrayBuffer()); // Returns true - * ``` - * @since v10.0.0 - */ - function isSharedArrayBuffer(object: unknown): object is SharedArrayBuffer; - /** - * Returns `true` if the value is a string object, e.g. created - * by `new String()`. - * - * ```js - * util.types.isStringObject('foo'); // Returns false - * util.types.isStringObject(new String('foo')); // Returns true - * ``` - * @since v10.0.0 - */ - function isStringObject(object: unknown): object is String; - /** - * Returns `true` if the value is a symbol object, created - * by calling `Object()` on a `Symbol` primitive. - * - * ```js - * const symbol = Symbol('foo'); - * util.types.isSymbolObject(symbol); // Returns false - * util.types.isSymbolObject(Object(symbol)); // Returns true - * ``` - * @since v10.0.0 - */ - function isSymbolObject(object: unknown): object is Symbol; - /** - * Returns `true` if the value is a built-in [`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) instance. - * - * ```js - * util.types.isTypedArray(new ArrayBuffer()); // Returns false - * util.types.isTypedArray(new Uint8Array()); // Returns true - * util.types.isTypedArray(new Float64Array()); // Returns true - * ``` - * - * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). - * @since v10.0.0 - */ - function isTypedArray(object: unknown): object is NodeJS.TypedArray; - /** - * Returns `true` if the value is a built-in [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) instance. - * - * ```js - * util.types.isUint8Array(new ArrayBuffer()); // Returns false - * util.types.isUint8Array(new Uint8Array()); // Returns true - * util.types.isUint8Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint8Array(object: unknown): object is Uint8Array; - /** - * Returns `true` if the value is a built-in [`Uint8ClampedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray) instance. - * - * ```js - * util.types.isUint8ClampedArray(new ArrayBuffer()); // Returns false - * util.types.isUint8ClampedArray(new Uint8ClampedArray()); // Returns true - * util.types.isUint8ClampedArray(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint8ClampedArray(object: unknown): object is Uint8ClampedArray; - /** - * Returns `true` if the value is a built-in [`Uint16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array) instance. - * - * ```js - * util.types.isUint16Array(new ArrayBuffer()); // Returns false - * util.types.isUint16Array(new Uint16Array()); // Returns true - * util.types.isUint16Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint16Array(object: unknown): object is Uint16Array; - /** - * Returns `true` if the value is a built-in [`Uint32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array) instance. - * - * ```js - * util.types.isUint32Array(new ArrayBuffer()); // Returns false - * util.types.isUint32Array(new Uint32Array()); // Returns true - * util.types.isUint32Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint32Array(object: unknown): object is Uint32Array; - /** - * Returns `true` if the value is a built-in [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) instance. - * - * ```js - * util.types.isWeakMap(new WeakMap()); // Returns true - * ``` - * @since v10.0.0 - */ - function isWeakMap(object: unknown): object is WeakMap; - /** - * Returns `true` if the value is a built-in [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) instance. - * - * ```js - * util.types.isWeakSet(new WeakSet()); // Returns true - * ``` - * @since v10.0.0 - */ - function isWeakSet(object: unknown): object is WeakSet; - /** - * Returns `true` if `value` is a `KeyObject`, `false` otherwise. - * @since v16.2.0 - */ - function isKeyObject(object: unknown): object is KeyObject; - /** - * Returns `true` if `value` is a `CryptoKey`, `false` otherwise. - * @since v16.2.0 - */ - function isCryptoKey(object: unknown): object is webcrypto.CryptoKey; -} -declare module "node:util" { - export * from "util"; -} -declare module "node:util/types" { - export * from "util/types"; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/v8.d.ts b/tools/mnemonic-test/node_modules/@types/node/v8.d.ts deleted file mode 100644 index 040bcfaf..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/v8.d.ts +++ /dev/null @@ -1,808 +0,0 @@ -/** - * The `node:v8` module exposes APIs that are specific to the version of [V8](https://developers.google.com/v8/) built into the Node.js binary. It can be accessed using: - * - * ```js - * import v8 from 'node:v8'; - * ``` - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/v8.js) - */ -declare module "v8" { - import { Readable } from "node:stream"; - interface HeapSpaceInfo { - space_name: string; - space_size: number; - space_used_size: number; - space_available_size: number; - physical_space_size: number; - } - // ** Signifies if the --zap_code_space option is enabled or not. 1 == enabled, 0 == disabled. */ - type DoesZapCodeSpaceFlag = 0 | 1; - interface HeapInfo { - total_heap_size: number; - total_heap_size_executable: number; - total_physical_size: number; - total_available_size: number; - used_heap_size: number; - heap_size_limit: number; - malloced_memory: number; - peak_malloced_memory: number; - does_zap_garbage: DoesZapCodeSpaceFlag; - number_of_native_contexts: number; - number_of_detached_contexts: number; - total_global_handles_size: number; - used_global_handles_size: number; - external_memory: number; - } - interface HeapCodeStatistics { - code_and_metadata_size: number; - bytecode_and_metadata_size: number; - external_script_source_size: number; - } - interface HeapSnapshotOptions { - /** - * If true, expose internals in the heap snapshot. - * @default false - */ - exposeInternals?: boolean; - /** - * If true, expose numeric values in artificial fields. - * @default false - */ - exposeNumericValues?: boolean; - } - /** - * Returns an integer representing a version tag derived from the V8 version, - * command-line flags, and detected CPU features. This is useful for determining - * whether a `vm.Script` `cachedData` buffer is compatible with this instance - * of V8. - * - * ```js - * console.log(v8.cachedDataVersionTag()); // 3947234607 - * // The value returned by v8.cachedDataVersionTag() is derived from the V8 - * // version, command-line flags, and detected CPU features. Test that the value - * // does indeed update when flags are toggled. - * v8.setFlagsFromString('--allow_natives_syntax'); - * console.log(v8.cachedDataVersionTag()); // 183726201 - * ``` - * @since v8.0.0 - */ - function cachedDataVersionTag(): number; - /** - * Returns an object with the following properties: - * - * `does_zap_garbage` is a 0/1 boolean, which signifies whether the `--zap_code_space` option is enabled or not. This makes V8 overwrite heap - * garbage with a bit pattern. The RSS footprint (resident set size) gets bigger - * because it continuously touches all heap pages and that makes them less likely - * to get swapped out by the operating system. - * - * `number_of_native_contexts` The value of native\_context is the number of the - * top-level contexts currently active. Increase of this number over time indicates - * a memory leak. - * - * `number_of_detached_contexts` The value of detached\_context is the number - * of contexts that were detached and not yet garbage collected. This number - * being non-zero indicates a potential memory leak. - * - * `total_global_handles_size` The value of total\_global\_handles\_size is the - * total memory size of V8 global handles. - * - * `used_global_handles_size` The value of used\_global\_handles\_size is the - * used memory size of V8 global handles. - * - * `external_memory` The value of external\_memory is the memory size of array - * buffers and external strings. - * - * ```js - * { - * total_heap_size: 7326976, - * total_heap_size_executable: 4194304, - * total_physical_size: 7326976, - * total_available_size: 1152656, - * used_heap_size: 3476208, - * heap_size_limit: 1535115264, - * malloced_memory: 16384, - * peak_malloced_memory: 1127496, - * does_zap_garbage: 0, - * number_of_native_contexts: 1, - * number_of_detached_contexts: 0, - * total_global_handles_size: 8192, - * used_global_handles_size: 3296, - * external_memory: 318824 - * } - * ``` - * @since v1.0.0 - */ - function getHeapStatistics(): HeapInfo; - /** - * Returns statistics about the V8 heap spaces, i.e. the segments which make up - * the V8 heap. Neither the ordering of heap spaces, nor the availability of a - * heap space can be guaranteed as the statistics are provided via the - * V8 [`GetHeapSpaceStatistics`](https://v8docs.nodesource.com/node-13.2/d5/dda/classv8_1_1_isolate.html#ac673576f24fdc7a33378f8f57e1d13a4) function and may change from one V8 version to the - * next. - * - * The value returned is an array of objects containing the following properties: - * - * ```json - * [ - * { - * "space_name": "new_space", - * "space_size": 2063872, - * "space_used_size": 951112, - * "space_available_size": 80824, - * "physical_space_size": 2063872 - * }, - * { - * "space_name": "old_space", - * "space_size": 3090560, - * "space_used_size": 2493792, - * "space_available_size": 0, - * "physical_space_size": 3090560 - * }, - * { - * "space_name": "code_space", - * "space_size": 1260160, - * "space_used_size": 644256, - * "space_available_size": 960, - * "physical_space_size": 1260160 - * }, - * { - * "space_name": "map_space", - * "space_size": 1094160, - * "space_used_size": 201608, - * "space_available_size": 0, - * "physical_space_size": 1094160 - * }, - * { - * "space_name": "large_object_space", - * "space_size": 0, - * "space_used_size": 0, - * "space_available_size": 1490980608, - * "physical_space_size": 0 - * } - * ] - * ``` - * @since v6.0.0 - */ - function getHeapSpaceStatistics(): HeapSpaceInfo[]; - /** - * The `v8.setFlagsFromString()` method can be used to programmatically set - * V8 command-line flags. This method should be used with care. Changing settings - * after the VM has started may result in unpredictable behavior, including - * crashes and data loss; or it may simply do nothing. - * - * The V8 options available for a version of Node.js may be determined by running `node --v8-options`. - * - * Usage: - * - * ```js - * // Print GC events to stdout for one minute. - * import v8 from 'node:v8'; - * v8.setFlagsFromString('--trace_gc'); - * setTimeout(() => { v8.setFlagsFromString('--notrace_gc'); }, 60e3); - * ``` - * @since v1.0.0 - */ - function setFlagsFromString(flags: string): void; - /** - * This is similar to the [`queryObjects()` console API](https://developer.chrome.com/docs/devtools/console/utilities#queryObjects-function) - * provided by the Chromium DevTools console. It can be used to search for objects that have the matching constructor on its prototype chain - * in the heap after a full garbage collection, which can be useful for memory leak regression tests. To avoid surprising results, users should - * avoid using this API on constructors whose implementation they don't control, or on constructors that can be invoked by other parties in the - * application. - * - * To avoid accidental leaks, this API does not return raw references to the objects found. By default, it returns the count of the objects - * found. If `options.format` is `'summary'`, it returns an array containing brief string representations for each object. The visibility provided - * in this API is similar to what the heap snapshot provides, while users can save the cost of serialization and parsing and directly filter the - * target objects during the search. - * - * Only objects created in the current execution context are included in the results. - * - * ```js - * import { queryObjects } from 'node:v8'; - * class A { foo = 'bar'; } - * console.log(queryObjects(A)); // 0 - * const a = new A(); - * console.log(queryObjects(A)); // 1 - * // [ "A { foo: 'bar' }" ] - * console.log(queryObjects(A, { format: 'summary' })); - * - * class B extends A { bar = 'qux'; } - * const b = new B(); - * console.log(queryObjects(B)); // 1 - * // [ "B { foo: 'bar', bar: 'qux' }" ] - * console.log(queryObjects(B, { format: 'summary' })); - * - * // Note that, when there are child classes inheriting from a constructor, - * // the constructor also shows up in the prototype chain of the child - * // classes's prototoype, so the child classes's prototoype would also be - * // included in the result. - * console.log(queryObjects(A)); // 3 - * // [ "B { foo: 'bar', bar: 'qux' }", 'A {}', "A { foo: 'bar' }" ] - * console.log(queryObjects(A, { format: 'summary' })); - * ``` - * @param ctor The constructor that can be used to search on the prototype chain in order to filter target objects in the heap. - * @since v20.13.0 - * @experimental - */ - function queryObjects(ctor: Function): number | string[]; - function queryObjects(ctor: Function, options: { format: "count" }): number; - function queryObjects(ctor: Function, options: { format: "summary" }): string[]; - /** - * Generates a snapshot of the current V8 heap and returns a Readable - * Stream that may be used to read the JSON serialized representation. - * This JSON stream format is intended to be used with tools such as - * Chrome DevTools. The JSON schema is undocumented and specific to the - * V8 engine. Therefore, the schema may change from one version of V8 to the next. - * - * Creating a heap snapshot requires memory about twice the size of the heap at - * the time the snapshot is created. This results in the risk of OOM killers - * terminating the process. - * - * Generating a snapshot is a synchronous operation which blocks the event loop - * for a duration depending on the heap size. - * - * ```js - * // Print heap snapshot to the console - * import v8 from 'node:v8'; - * const stream = v8.getHeapSnapshot(); - * stream.pipe(process.stdout); - * ``` - * @since v11.13.0 - * @return A Readable containing the V8 heap snapshot. - */ - function getHeapSnapshot(options?: HeapSnapshotOptions): Readable; - /** - * Generates a snapshot of the current V8 heap and writes it to a JSON - * file. This file is intended to be used with tools such as Chrome - * DevTools. The JSON schema is undocumented and specific to the V8 - * engine, and may change from one version of V8 to the next. - * - * A heap snapshot is specific to a single V8 isolate. When using `worker threads`, a heap snapshot generated from the main thread will - * not contain any information about the workers, and vice versa. - * - * Creating a heap snapshot requires memory about twice the size of the heap at - * the time the snapshot is created. This results in the risk of OOM killers - * terminating the process. - * - * Generating a snapshot is a synchronous operation which blocks the event loop - * for a duration depending on the heap size. - * - * ```js - * import { writeHeapSnapshot } from 'node:v8'; - * import { - * Worker, - * isMainThread, - * parentPort, - * } from 'node:worker_threads'; - * - * if (isMainThread) { - * const worker = new Worker(__filename); - * - * worker.once('message', (filename) => { - * console.log(`worker heapdump: ${filename}`); - * // Now get a heapdump for the main thread. - * console.log(`main thread heapdump: ${writeHeapSnapshot()}`); - * }); - * - * // Tell the worker to create a heapdump. - * worker.postMessage('heapdump'); - * } else { - * parentPort.once('message', (message) => { - * if (message === 'heapdump') { - * // Generate a heapdump for the worker - * // and return the filename to the parent. - * parentPort.postMessage(writeHeapSnapshot()); - * } - * }); - * } - * ``` - * @since v11.13.0 - * @param filename The file path where the V8 heap snapshot is to be saved. If not specified, a file name with the pattern `'Heap-${yyyymmdd}-${hhmmss}-${pid}-${thread_id}.heapsnapshot'` will be - * generated, where `{pid}` will be the PID of the Node.js process, `{thread_id}` will be `0` when `writeHeapSnapshot()` is called from the main Node.js thread or the id of a - * worker thread. - * @return The filename where the snapshot was saved. - */ - function writeHeapSnapshot(filename?: string, options?: HeapSnapshotOptions): string; - /** - * Get statistics about code and its metadata in the heap, see - * V8 [`GetHeapCodeAndMetadataStatistics`](https://v8docs.nodesource.com/node-13.2/d5/dda/classv8_1_1_isolate.html#a6079122af17612ef54ef3348ce170866) API. Returns an object with the - * following properties: - * - * ```js - * { - * code_and_metadata_size: 212208, - * bytecode_and_metadata_size: 161368, - * external_script_source_size: 1410794, - * cpu_profiler_metadata_size: 0, - * } - * ``` - * @since v12.8.0 - */ - function getHeapCodeStatistics(): HeapCodeStatistics; - /** - * @since v8.0.0 - */ - class Serializer { - /** - * Writes out a header, which includes the serialization format version. - */ - writeHeader(): void; - /** - * Serializes a JavaScript value and adds the serialized representation to the - * internal buffer. - * - * This throws an error if `value` cannot be serialized. - */ - writeValue(val: any): boolean; - /** - * Returns the stored internal buffer. This serializer should not be used once - * the buffer is released. Calling this method results in undefined behavior - * if a previous write has failed. - */ - releaseBuffer(): Buffer; - /** - * Marks an `ArrayBuffer` as having its contents transferred out of band. - * Pass the corresponding `ArrayBuffer` in the deserializing context to `deserializer.transferArrayBuffer()`. - * @param id A 32-bit unsigned integer. - * @param arrayBuffer An `ArrayBuffer` instance. - */ - transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void; - /** - * Write a raw 32-bit unsigned integer. - * For use inside of a custom `serializer._writeHostObject()`. - */ - writeUint32(value: number): void; - /** - * Write a raw 64-bit unsigned integer, split into high and low 32-bit parts. - * For use inside of a custom `serializer._writeHostObject()`. - */ - writeUint64(hi: number, lo: number): void; - /** - * Write a JS `number` value. - * For use inside of a custom `serializer._writeHostObject()`. - */ - writeDouble(value: number): void; - /** - * Write raw bytes into the serializer's internal buffer. The deserializer - * will require a way to compute the length of the buffer. - * For use inside of a custom `serializer._writeHostObject()`. - */ - writeRawBytes(buffer: NodeJS.TypedArray): void; - } - /** - * A subclass of `Serializer` that serializes `TypedArray`(in particular `Buffer`) and `DataView` objects as host objects, and only - * stores the part of their underlying `ArrayBuffer`s that they are referring to. - * @since v8.0.0 - */ - class DefaultSerializer extends Serializer {} - /** - * @since v8.0.0 - */ - class Deserializer { - constructor(data: NodeJS.TypedArray); - /** - * Reads and validates a header (including the format version). - * May, for example, reject an invalid or unsupported wire format. In that case, - * an `Error` is thrown. - */ - readHeader(): boolean; - /** - * Deserializes a JavaScript value from the buffer and returns it. - */ - readValue(): any; - /** - * Marks an `ArrayBuffer` as having its contents transferred out of band. - * Pass the corresponding `ArrayBuffer` in the serializing context to `serializer.transferArrayBuffer()` (or return the `id` from `serializer._getSharedArrayBufferId()` in the case of - * `SharedArrayBuffer`s). - * @param id A 32-bit unsigned integer. - * @param arrayBuffer An `ArrayBuffer` instance. - */ - transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void; - /** - * Reads the underlying wire format version. Likely mostly to be useful to - * legacy code reading old wire format versions. May not be called before `.readHeader()`. - */ - getWireFormatVersion(): number; - /** - * Read a raw 32-bit unsigned integer and return it. - * For use inside of a custom `deserializer._readHostObject()`. - */ - readUint32(): number; - /** - * Read a raw 64-bit unsigned integer and return it as an array `[hi, lo]` with two 32-bit unsigned integer entries. - * For use inside of a custom `deserializer._readHostObject()`. - */ - readUint64(): [number, number]; - /** - * Read a JS `number` value. - * For use inside of a custom `deserializer._readHostObject()`. - */ - readDouble(): number; - /** - * Read raw bytes from the deserializer's internal buffer. The `length` parameter - * must correspond to the length of the buffer that was passed to `serializer.writeRawBytes()`. - * For use inside of a custom `deserializer._readHostObject()`. - */ - readRawBytes(length: number): Buffer; - } - /** - * A subclass of `Deserializer` corresponding to the format written by `DefaultSerializer`. - * @since v8.0.0 - */ - class DefaultDeserializer extends Deserializer {} - /** - * Uses a `DefaultSerializer` to serialize `value` into a buffer. - * - * `ERR_BUFFER_TOO_LARGE` will be thrown when trying to - * serialize a huge object which requires buffer - * larger than `buffer.constants.MAX_LENGTH`. - * @since v8.0.0 - */ - function serialize(value: any): Buffer; - /** - * Uses a `DefaultDeserializer` with default options to read a JS value - * from a buffer. - * @since v8.0.0 - * @param buffer A buffer returned by {@link serialize}. - */ - function deserialize(buffer: NodeJS.TypedArray): any; - /** - * The `v8.takeCoverage()` method allows the user to write the coverage started by `NODE_V8_COVERAGE` to disk on demand. This method can be invoked multiple - * times during the lifetime of the process. Each time the execution counter will - * be reset and a new coverage report will be written to the directory specified - * by `NODE_V8_COVERAGE`. - * - * When the process is about to exit, one last coverage will still be written to - * disk unless {@link stopCoverage} is invoked before the process exits. - * @since v15.1.0, v14.18.0, v12.22.0 - */ - function takeCoverage(): void; - /** - * The `v8.stopCoverage()` method allows the user to stop the coverage collection - * started by `NODE_V8_COVERAGE`, so that V8 can release the execution count - * records and optimize code. This can be used in conjunction with {@link takeCoverage} if the user wants to collect the coverage on demand. - * @since v15.1.0, v14.18.0, v12.22.0 - */ - function stopCoverage(): void; - /** - * The API is a no-op if `--heapsnapshot-near-heap-limit` is already set from the command line or the API is called more than once. - * `limit` must be a positive integer. See [`--heapsnapshot-near-heap-limit`](https://nodejs.org/docs/latest-v22.x/api/cli.html#--heapsnapshot-near-heap-limitmax_count) for more information. - * @experimental - * @since v18.10.0, v16.18.0 - */ - function setHeapSnapshotNearHeapLimit(limit: number): void; - /** - * This API collects GC data in current thread. - * @since v19.6.0, v18.15.0 - */ - class GCProfiler { - /** - * Start collecting GC data. - * @since v19.6.0, v18.15.0 - */ - start(): void; - /** - * Stop collecting GC data and return an object. The content of object - * is as follows. - * - * ```json - * { - * "version": 1, - * "startTime": 1674059033862, - * "statistics": [ - * { - * "gcType": "Scavenge", - * "beforeGC": { - * "heapStatistics": { - * "totalHeapSize": 5005312, - * "totalHeapSizeExecutable": 524288, - * "totalPhysicalSize": 5226496, - * "totalAvailableSize": 4341325216, - * "totalGlobalHandlesSize": 8192, - * "usedGlobalHandlesSize": 2112, - * "usedHeapSize": 4883840, - * "heapSizeLimit": 4345298944, - * "mallocedMemory": 254128, - * "externalMemory": 225138, - * "peakMallocedMemory": 181760 - * }, - * "heapSpaceStatistics": [ - * { - * "spaceName": "read_only_space", - * "spaceSize": 0, - * "spaceUsedSize": 0, - * "spaceAvailableSize": 0, - * "physicalSpaceSize": 0 - * } - * ] - * }, - * "cost": 1574.14, - * "afterGC": { - * "heapStatistics": { - * "totalHeapSize": 6053888, - * "totalHeapSizeExecutable": 524288, - * "totalPhysicalSize": 5500928, - * "totalAvailableSize": 4341101384, - * "totalGlobalHandlesSize": 8192, - * "usedGlobalHandlesSize": 2112, - * "usedHeapSize": 4059096, - * "heapSizeLimit": 4345298944, - * "mallocedMemory": 254128, - * "externalMemory": 225138, - * "peakMallocedMemory": 181760 - * }, - * "heapSpaceStatistics": [ - * { - * "spaceName": "read_only_space", - * "spaceSize": 0, - * "spaceUsedSize": 0, - * "spaceAvailableSize": 0, - * "physicalSpaceSize": 0 - * } - * ] - * } - * } - * ], - * "endTime": 1674059036865 - * } - * ``` - * - * Here's an example. - * - * ```js - * import { GCProfiler } from 'node:v8'; - * const profiler = new GCProfiler(); - * profiler.start(); - * setTimeout(() => { - * console.log(profiler.stop()); - * }, 1000); - * ``` - * @since v19.6.0, v18.15.0 - */ - stop(): GCProfilerResult; - } - interface GCProfilerResult { - version: number; - startTime: number; - endTime: number; - statistics: Array<{ - gcType: string; - cost: number; - beforeGC: { - heapStatistics: HeapStatistics; - heapSpaceStatistics: HeapSpaceStatistics[]; - }; - afterGC: { - heapStatistics: HeapStatistics; - heapSpaceStatistics: HeapSpaceStatistics[]; - }; - }>; - } - interface HeapStatistics { - totalHeapSize: number; - totalHeapSizeExecutable: number; - totalPhysicalSize: number; - totalAvailableSize: number; - totalGlobalHandlesSize: number; - usedGlobalHandlesSize: number; - usedHeapSize: number; - heapSizeLimit: number; - mallocedMemory: number; - externalMemory: number; - peakMallocedMemory: number; - } - interface HeapSpaceStatistics { - spaceName: string; - spaceSize: number; - spaceUsedSize: number; - spaceAvailableSize: number; - physicalSpaceSize: number; - } - /** - * Called when a promise is constructed. This does not mean that corresponding before/after events will occur, only that the possibility exists. This will - * happen if a promise is created without ever getting a continuation. - * @since v17.1.0, v16.14.0 - * @param promise The promise being created. - * @param parent The promise continued from, if applicable. - */ - interface Init { - (promise: Promise, parent: Promise): void; - } - /** - * Called before a promise continuation executes. This can be in the form of `then()`, `catch()`, or `finally()` handlers or an await resuming. - * - * The before callback will be called 0 to N times. The before callback will typically be called 0 times if no continuation was ever made for the promise. - * The before callback may be called many times in the case where many continuations have been made from the same promise. - * @since v17.1.0, v16.14.0 - */ - interface Before { - (promise: Promise): void; - } - /** - * Called immediately after a promise continuation executes. This may be after a `then()`, `catch()`, or `finally()` handler or before an await after another await. - * @since v17.1.0, v16.14.0 - */ - interface After { - (promise: Promise): void; - } - /** - * Called when the promise receives a resolution or rejection value. This may occur synchronously in the case of {@link Promise.resolve()} or - * {@link Promise.reject()}. - * @since v17.1.0, v16.14.0 - */ - interface Settled { - (promise: Promise): void; - } - /** - * Key events in the lifetime of a promise have been categorized into four areas: creation of a promise, before/after a continuation handler is called or - * around an await, and when the promise resolves or rejects. - * - * Because promises are asynchronous resources whose lifecycle is tracked via the promise hooks mechanism, the `init()`, `before()`, `after()`, and - * `settled()` callbacks must not be async functions as they create more promises which would produce an infinite loop. - * @since v17.1.0, v16.14.0 - */ - interface HookCallbacks { - init?: Init; - before?: Before; - after?: After; - settled?: Settled; - } - interface PromiseHooks { - /** - * The `init` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop. - * @since v17.1.0, v16.14.0 - * @param init The {@link Init | `init` callback} to call when a promise is created. - * @return Call to stop the hook. - */ - onInit: (init: Init) => Function; - /** - * The `settled` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop. - * @since v17.1.0, v16.14.0 - * @param settled The {@link Settled | `settled` callback} to call when a promise is created. - * @return Call to stop the hook. - */ - onSettled: (settled: Settled) => Function; - /** - * The `before` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop. - * @since v17.1.0, v16.14.0 - * @param before The {@link Before | `before` callback} to call before a promise continuation executes. - * @return Call to stop the hook. - */ - onBefore: (before: Before) => Function; - /** - * The `after` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop. - * @since v17.1.0, v16.14.0 - * @param after The {@link After | `after` callback} to call after a promise continuation executes. - * @return Call to stop the hook. - */ - onAfter: (after: After) => Function; - /** - * Registers functions to be called for different lifetime events of each promise. - * The callbacks `init()`/`before()`/`after()`/`settled()` are called for the respective events during a promise's lifetime. - * All callbacks are optional. For example, if only promise creation needs to be tracked, then only the init callback needs to be passed. - * The hook callbacks must be plain functions. Providing async functions will throw as it would produce an infinite microtask loop. - * @since v17.1.0, v16.14.0 - * @param callbacks The {@link HookCallbacks | Hook Callbacks} to register - * @return Used for disabling hooks - */ - createHook: (callbacks: HookCallbacks) => Function; - } - /** - * The `promiseHooks` interface can be used to track promise lifecycle events. - * @since v17.1.0, v16.14.0 - */ - const promiseHooks: PromiseHooks; - type StartupSnapshotCallbackFn = (args: any) => any; - interface StartupSnapshot { - /** - * Add a callback that will be called when the Node.js instance is about to get serialized into a snapshot and exit. - * This can be used to release resources that should not or cannot be serialized or to convert user data into a form more suitable for serialization. - * @since v18.6.0, v16.17.0 - */ - addSerializeCallback(callback: StartupSnapshotCallbackFn, data?: any): void; - /** - * Add a callback that will be called when the Node.js instance is deserialized from a snapshot. - * The `callback` and the `data` (if provided) will be serialized into the snapshot, they can be used to re-initialize the state of the application or - * to re-acquire resources that the application needs when the application is restarted from the snapshot. - * @since v18.6.0, v16.17.0 - */ - addDeserializeCallback(callback: StartupSnapshotCallbackFn, data?: any): void; - /** - * This sets the entry point of the Node.js application when it is deserialized from a snapshot. This can be called only once in the snapshot building script. - * If called, the deserialized application no longer needs an additional entry point script to start up and will simply invoke the callback along with the deserialized - * data (if provided), otherwise an entry point script still needs to be provided to the deserialized application. - * @since v18.6.0, v16.17.0 - */ - setDeserializeMainFunction(callback: StartupSnapshotCallbackFn, data?: any): void; - /** - * Returns true if the Node.js instance is run to build a snapshot. - * @since v18.6.0, v16.17.0 - */ - isBuildingSnapshot(): boolean; - } - /** - * The `v8.startupSnapshot` interface can be used to add serialization and deserialization hooks for custom startup snapshots. - * - * ```bash - * $ node --snapshot-blob snapshot.blob --build-snapshot entry.js - * # This launches a process with the snapshot - * $ node --snapshot-blob snapshot.blob - * ``` - * - * In the example above, `entry.js` can use methods from the `v8.startupSnapshot` interface to specify how to save information for custom objects - * in the snapshot during serialization and how the information can be used to synchronize these objects during deserialization of the snapshot. - * For example, if the `entry.js` contains the following script: - * - * ```js - * 'use strict'; - * - * import fs from 'node:fs'; - * import zlib from 'node:zlib'; - * import path from 'node:path'; - * import assert from 'node:assert'; - * - * import v8 from 'node:v8'; - * - * class BookShelf { - * storage = new Map(); - * - * // Reading a series of files from directory and store them into storage. - * constructor(directory, books) { - * for (const book of books) { - * this.storage.set(book, fs.readFileSync(path.join(directory, book))); - * } - * } - * - * static compressAll(shelf) { - * for (const [ book, content ] of shelf.storage) { - * shelf.storage.set(book, zlib.gzipSync(content)); - * } - * } - * - * static decompressAll(shelf) { - * for (const [ book, content ] of shelf.storage) { - * shelf.storage.set(book, zlib.gunzipSync(content)); - * } - * } - * } - * - * // __dirname here is where the snapshot script is placed - * // during snapshot building time. - * const shelf = new BookShelf(__dirname, [ - * 'book1.en_US.txt', - * 'book1.es_ES.txt', - * 'book2.zh_CN.txt', - * ]); - * - * assert(v8.startupSnapshot.isBuildingSnapshot()); - * // On snapshot serialization, compress the books to reduce size. - * v8.startupSnapshot.addSerializeCallback(BookShelf.compressAll, shelf); - * // On snapshot deserialization, decompress the books. - * v8.startupSnapshot.addDeserializeCallback(BookShelf.decompressAll, shelf); - * v8.startupSnapshot.setDeserializeMainFunction((shelf) => { - * // process.env and process.argv are refreshed during snapshot - * // deserialization. - * const lang = process.env.BOOK_LANG || 'en_US'; - * const book = process.argv[1]; - * const name = `${book}.${lang}.txt`; - * console.log(shelf.storage.get(name)); - * }, shelf); - * ``` - * - * The resulted binary will get print the data deserialized from the snapshot during start up, using the refreshed `process.env` and `process.argv` of the launched process: - * - * ```bash - * $ BOOK_LANG=es_ES node --snapshot-blob snapshot.blob book1 - * # Prints content of book1.es_ES.txt deserialized from the snapshot. - * ``` - * - * Currently the application deserialized from a user-land snapshot cannot be snapshotted again, so these APIs are only available to applications that are not deserialized from a user-land snapshot. - * - * @experimental - * @since v18.6.0, v16.17.0 - */ - const startupSnapshot: StartupSnapshot; -} -declare module "node:v8" { - export * from "v8"; -} diff --git a/tools/mnemonic-test/node_modules/@types/node/vm.d.ts b/tools/mnemonic-test/node_modules/@types/node/vm.d.ts deleted file mode 100644 index 9d9ff1ac..00000000 --- a/tools/mnemonic-test/node_modules/@types/node/vm.d.ts +++ /dev/null @@ -1,922 +0,0 @@ -/** - * The `node:vm` module enables compiling and running code within V8 Virtual - * Machine contexts. - * - * **The `node:vm` module is not a security** - * **mechanism. Do not use it to run untrusted code.** - * - * JavaScript code can be compiled and run immediately or - * compiled, saved, and run later. - * - * A common use case is to run the code in a different V8 Context. This means - * invoked code has a different global object than the invoking code. - * - * One can provide the context by `contextifying` an - * object. The invoked code treats any property in the context like a - * global variable. Any changes to global variables caused by the invoked - * code are reflected in the context object. - * - * ```js - * import vm from 'node:vm'; - * - * const x = 1; - * - * const context = { x: 2 }; - * vm.createContext(context); // Contextify the object. - * - * const code = 'x += 40; var y = 17;'; - * // `x` and `y` are global variables in the context. - * // Initially, x has the value 2 because that is the value of context.x. - * vm.runInContext(code, context); - * - * console.log(context.x); // 42 - * console.log(context.y); // 17 - * - * console.log(x); // 1; y is not defined. - * ``` - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/vm.js) - */ -declare module "vm" { - import { ImportAttributes } from "node:module"; - interface Context extends NodeJS.Dict {} - interface BaseOptions { - /** - * Specifies the filename used in stack traces produced by this script. - * @default '' - */ - filename?: string | undefined; - /** - * Specifies the line number offset that is displayed in stack traces produced by this script. - * @default 0 - */ - lineOffset?: number | undefined; - /** - * Specifies the column number offset that is displayed in stack traces produced by this script. - * @default 0 - */ - columnOffset?: number | undefined; - } - interface ScriptOptions extends BaseOptions { - /** - * V8's code cache data for the supplied source. - */ - cachedData?: Buffer | NodeJS.ArrayBufferView | undefined; - /** @deprecated in favor of `script.createCachedData()` */ - produceCachedData?: boolean | undefined; - /** - * Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is - * part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see - * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v22.x/api/vm.html#support-of-dynamic-import-in-compilation-apis). - */ - importModuleDynamically?: - | ((specifier: string, script: Script, importAttributes: ImportAttributes) => Module) - | typeof constants.USE_MAIN_CONTEXT_DEFAULT_LOADER - | undefined; - } - interface RunningScriptOptions extends BaseOptions { - /** - * When `true`, if an `Error` occurs while compiling the `code`, the line of code causing the error is attached to the stack trace. - * @default true - */ - displayErrors?: boolean | undefined; - /** - * Specifies the number of milliseconds to execute code before terminating execution. - * If execution is terminated, an `Error` will be thrown. This value must be a strictly positive integer. - */ - timeout?: number | undefined; - /** - * If `true`, the execution will be terminated when `SIGINT` (Ctrl+C) is received. - * Existing handlers for the event that have been attached via `process.on('SIGINT')` will be disabled during script execution, but will continue to work after that. - * If execution is terminated, an `Error` will be thrown. - * @default false - */ - breakOnSigint?: boolean | undefined; - } - interface RunningScriptInNewContextOptions extends RunningScriptOptions { - /** - * Human-readable name of the newly created context. - */ - contextName?: CreateContextOptions["name"]; - /** - * Origin corresponding to the newly created context for display purposes. The origin should be formatted like a URL, - * but with only the scheme, host, and port (if necessary), like the value of the `url.origin` property of a `URL` object. - * Most notably, this string should omit the trailing slash, as that denotes a path. - */ - contextOrigin?: CreateContextOptions["origin"]; - contextCodeGeneration?: CreateContextOptions["codeGeneration"]; - /** - * If set to `afterEvaluate`, microtasks will be run immediately after the script has run. - */ - microtaskMode?: CreateContextOptions["microtaskMode"]; - } - interface RunningCodeOptions extends RunningScriptOptions { - cachedData?: ScriptOptions["cachedData"]; - importModuleDynamically?: ScriptOptions["importModuleDynamically"]; - } - interface RunningCodeInNewContextOptions extends RunningScriptInNewContextOptions { - cachedData?: ScriptOptions["cachedData"]; - importModuleDynamically?: ScriptOptions["importModuleDynamically"]; - } - interface CompileFunctionOptions extends BaseOptions { - /** - * Provides an optional data with V8's code cache data for the supplied source. - */ - cachedData?: Buffer | undefined; - /** - * Specifies whether to produce new cache data. - * @default false - */ - produceCachedData?: boolean | undefined; - /** - * The sandbox/context in which the said function should be compiled in. - */ - parsingContext?: Context | undefined; - /** - * An array containing a collection of context extensions (objects wrapping the current scope) to be applied while compiling - */ - contextExtensions?: Object[] | undefined; - } - interface CreateContextOptions { - /** - * Human-readable name of the newly created context. - * @default 'VM Context i' Where i is an ascending numerical index of the created context. - */ - name?: string | undefined; - /** - * Corresponds to the newly created context for display purposes. - * The origin should be formatted like a `URL`, but with only the scheme, host, and port (if necessary), - * like the value of the `url.origin` property of a URL object. - * Most notably, this string should omit the trailing slash, as that denotes a path. - * @default '' - */ - origin?: string | undefined; - codeGeneration?: - | { - /** - * If set to false any calls to eval or function constructors (Function, GeneratorFunction, etc) - * will throw an EvalError. - * @default true - */ - strings?: boolean | undefined; - /** - * If set to false any attempt to compile a WebAssembly module will throw a WebAssembly.CompileError. - * @default true - */ - wasm?: boolean | undefined; - } - | undefined; - /** - * If set to `afterEvaluate`, microtasks will be run immediately after the script has run. - */ - microtaskMode?: "afterEvaluate" | undefined; - } - type MeasureMemoryMode = "summary" | "detailed"; - interface MeasureMemoryOptions { - /** - * @default 'summary' - */ - mode?: MeasureMemoryMode | undefined; - /** - * @default 'default' - */ - execution?: "default" | "eager" | undefined; - } - interface MemoryMeasurement { - total: { - jsMemoryEstimate: number; - jsMemoryRange: [number, number]; - }; - } - /** - * Instances of the `vm.Script` class contain precompiled scripts that can be - * executed in specific contexts. - * @since v0.3.1 - */ - class Script { - constructor(code: string, options?: ScriptOptions | string); - /** - * Runs the compiled code contained by the `vm.Script` object within the given `contextifiedObject` and returns the result. Running code does not have access - * to local scope. - * - * The following example compiles code that increments a global variable, sets - * the value of another global variable, then execute the code multiple times. - * The globals are contained in the `context` object. - * - * ```js - * import vm from 'node:vm'; - * - * const context = { - * animal: 'cat', - * count: 2, - * }; - * - * const script = new vm.Script('count += 1; name = "kitty";'); - * - * vm.createContext(context); - * for (let i = 0; i < 10; ++i) { - * script.runInContext(context); - * } - * - * console.log(context); - * // Prints: { animal: 'cat', count: 12, name: 'kitty' } - * ``` - * - * Using the `timeout` or `breakOnSigint` options will result in new event loops - * and corresponding threads being started, which have a non-zero performance - * overhead. - * @since v0.3.1 - * @param contextifiedObject A `contextified` object as returned by the `vm.createContext()` method. - * @return the result of the very last statement executed in the script. - */ - runInContext(contextifiedObject: Context, options?: RunningScriptOptions): any; - /** - * First contextifies the given `contextObject`, runs the compiled code contained - * by the `vm.Script` object within the created context, and returns the result. - * Running code does not have access to local scope. - * - * The following example compiles code that sets a global variable, then executes - * the code multiple times in different contexts. The globals are set on and - * contained within each individual `context`. - * - * ```js - * import vm from 'node:vm'; - * - * const script = new vm.Script('globalVar = "set"'); - * - * const contexts = [{}, {}, {}]; - * contexts.forEach((context) => { - * script.runInNewContext(context); - * }); - * - * console.log(contexts); - * // Prints: [{ globalVar: 'set' }, { globalVar: 'set' }, { globalVar: 'set' }] - * ``` - * @since v0.3.1 - * @param contextObject An object that will be `contextified`. If `undefined`, a new object will be created. - * @return the result of the very last statement executed in the script. - */ - runInNewContext(contextObject?: Context, options?: RunningScriptInNewContextOptions): any; - /** - * Runs the compiled code contained by the `vm.Script` within the context of the - * current `global` object. Running code does not have access to local scope, but _does_ have access to the current `global` object. - * - * The following example compiles code that increments a `global` variable then - * executes that code multiple times: - * - * ```js - * import vm from 'node:vm'; - * - * global.globalVar = 0; - * - * const script = new vm.Script('globalVar += 1', { filename: 'myfile.vm' }); - * - * for (let i = 0; i < 1000; ++i) { - * script.runInThisContext(); - * } - * - * console.log(globalVar); - * - * // 1000 - * ``` - * @since v0.3.1 - * @return the result of the very last statement executed in the script. - */ - runInThisContext(options?: RunningScriptOptions): any; - /** - * Creates a code cache that can be used with the `Script` constructor's `cachedData` option. Returns a `Buffer`. This method may be called at any - * time and any number of times. - * - * The code cache of the `Script` doesn't contain any JavaScript observable - * states. The code cache is safe to be saved along side the script source and - * used to construct new `Script` instances multiple times. - * - * Functions in the `Script` source can be marked as lazily compiled and they are - * not compiled at construction of the `Script`. These functions are going to be - * compiled when they are invoked the first time. The code cache serializes the - * metadata that V8 currently knows about the `Script` that it can use to speed up - * future compilations. - * - * ```js - * const script = new vm.Script(` - * function add(a, b) { - * return a + b; - * } - * - * const x = add(1, 2); - * `); - * - * const cacheWithoutAdd = script.createCachedData(); - * // In `cacheWithoutAdd` the function `add()` is marked for full compilation - * // upon invocation. - * - * script.runInThisContext(); - * - * const cacheWithAdd = script.createCachedData(); - * // `cacheWithAdd` contains fully compiled function `add()`. - * ``` - * @since v10.6.0 - */ - createCachedData(): Buffer; - /** @deprecated in favor of `script.createCachedData()` */ - cachedDataProduced?: boolean | undefined; - /** - * When `cachedData` is supplied to create the `vm.Script`, this value will be set - * to either `true` or `false` depending on acceptance of the data by V8. - * Otherwise the value is `undefined`. - * @since v5.7.0 - */ - cachedDataRejected?: boolean | undefined; - cachedData?: Buffer | undefined; - /** - * When the script is compiled from a source that contains a source map magic - * comment, this property will be set to the URL of the source map. - * - * ```js - * import vm from 'node:vm'; - * - * const script = new vm.Script(` - * function myFunc() {} - * //# sourceMappingURL=sourcemap.json - * `); - * - * console.log(script.sourceMapURL); - * // Prints: sourcemap.json - * ``` - * @since v19.1.0, v18.13.0 - */ - sourceMapURL?: string | undefined; - } - /** - * If given a `contextObject`, the `vm.createContext()` method will - * [prepare that object](https://nodejs.org/docs/latest-v22.x/api/vm.html#what-does-it-mean-to-contextify-an-object) - * and return a reference to it so that it can be used in `{@link runInContext}` or - * [`script.runInContext()`](https://nodejs.org/docs/latest-v22.x/api/vm.html#scriptrunincontextcontextifiedobject-options). Inside such - * scripts, the `contextObject` will be the global object, retaining all of its - * existing properties but also having the built-in objects and functions any - * standard [global object](https://es5.github.io/#x15.1) has. Outside of scripts run by the vm module, global - * variables will remain unchanged. - * - * ```js - * import vm from 'node:vm'; - * - * global.globalVar = 3; - * - * const context = { globalVar: 1 }; - * vm.createContext(context); - * - * vm.runInContext('globalVar *= 2;', context); - * - * console.log(context); - * // Prints: { globalVar: 2 } - * - * console.log(global.globalVar); - * // Prints: 3 - * ``` - * - * If `contextObject` is omitted (or passed explicitly as `undefined`), a new, - * empty `contextified` object will be returned. - * - * The `vm.createContext()` method is primarily useful for creating a single - * context that can be used to run multiple scripts. For instance, if emulating a - * web browser, the method can be used to create a single context representing a - * window's global object, then run all ` -``` - -Keys ----- - -All keys must be 128 bits (16 bytes), 192 bits (24 bytes) or 256 bits (32 bytes) long. - -The library work with `Array`, `Uint8Array` and `Buffer` objects as well as any *array-like* object (i.e. must have a `length` property, and have a valid byte value for each entry). - -```javascript -// 128-bit, 192-bit and 256-bit keys -var key_128 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; -var key_192 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23]; -var key_256 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31]; - -// or, you may use Uint8Array: -var key_128_array = new Uint8Array(key_128); -var key_192_array = new Uint8Array(key_192); -var key_256_array = new Uint8Array(key_256); - -// or, you may use Buffer in node.js: -var key_128_buffer = Buffer.from(key_128); -var key_192_buffer = Buffer.from(key_192); -var key_256_buffer = Buffer.from(key_256); -``` - - -To generate keys from simple-to-remember passwords, consider using a password-based key-derivation function such as [scrypt](https://www.npmjs.com/package/scrypt-js) or [bcrypt](https://www.npmjs.com/search?q=bcrypt). - - -Common Modes of Operation -------------------------- - -There are several modes of operations, each with various pros and cons. In general though, the **CBC** and **CTR** modes are recommended. The **ECB is NOT recommended.**, and is included primarily for completeness. - -### CTR - Counter (recommended) - -```javascript -// An example 128-bit key (16 bytes * 8 bits/byte = 128 bits) -var key = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 ]; - -// Convert text to bytes -var text = 'Text may be any length you wish, no padding is required.'; -var textBytes = aesjs.utils.utf8.toBytes(text); - -// The counter is optional, and if omitted will begin at 1 -var aesCtr = new aesjs.ModeOfOperation.ctr(key, new aesjs.Counter(5)); -var encryptedBytes = aesCtr.encrypt(textBytes); - -// To print or store the binary data, you may convert it to hex -var encryptedHex = aesjs.utils.hex.fromBytes(encryptedBytes); -console.log(encryptedHex); -// "a338eda3874ed884b6199150d36f49988c90f5c47fe7792b0cf8c7f77eeffd87 -// ea145b73e82aefcf2076f881c88879e4e25b1d7b24ba2788" - -// When ready to decrypt the hex string, convert it back to bytes -var encryptedBytes = aesjs.utils.hex.toBytes(encryptedHex); - -// The counter mode of operation maintains internal state, so to -// decrypt a new instance must be instantiated. -var aesCtr = new aesjs.ModeOfOperation.ctr(key, new aesjs.Counter(5)); -var decryptedBytes = aesCtr.decrypt(encryptedBytes); - -// Convert our bytes back into text -var decryptedText = aesjs.utils.utf8.fromBytes(decryptedBytes); -console.log(decryptedText); -// "Text may be any length you wish, no padding is required." -``` - - -### CBC - Cipher-Block Chaining (recommended) - -```javascript -// An example 128-bit key -var key = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 ]; - -// The initialization vector (must be 16 bytes) -var iv = [ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,35, 36 ]; - -// Convert text to bytes (text must be a multiple of 16 bytes) -var text = 'TextMustBe16Byte'; -var textBytes = aesjs.utils.utf8.toBytes(text); - -var aesCbc = new aesjs.ModeOfOperation.cbc(key, iv); -var encryptedBytes = aesCbc.encrypt(textBytes); - -// To print or store the binary data, you may convert it to hex -var encryptedHex = aesjs.utils.hex.fromBytes(encryptedBytes); -console.log(encryptedHex); -// "104fb073f9a131f2cab49184bb864ca2" - -// When ready to decrypt the hex string, convert it back to bytes -var encryptedBytes = aesjs.utils.hex.toBytes(encryptedHex); - -// The cipher-block chaining mode of operation maintains internal -// state, so to decrypt a new instance must be instantiated. -var aesCbc = new aesjs.ModeOfOperation.cbc(key, iv); -var decryptedBytes = aesCbc.decrypt(encryptedBytes); - -// Convert our bytes back into text -var decryptedText = aesjs.utils.utf8.fromBytes(decryptedBytes); -console.log(decryptedText); -// "TextMustBe16Byte" -``` - - -### CFB - Cipher Feedback - -```javascript -// An example 128-bit key -var key = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 ]; - -// The initialization vector (must be 16 bytes) -var iv = [ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,35, 36 ]; - -// Convert text to bytes (must be a multiple of the segment size you choose below) -var text = 'TextMustBeAMultipleOfSegmentSize'; -var textBytes = aesjs.utils.utf8.toBytes(text); - -// The segment size is optional, and defaults to 1 -var segmentSize = 8; -var aesCfb = new aesjs.ModeOfOperation.cfb(key, iv, segmentSize); -var encryptedBytes = aesCfb.encrypt(textBytes); - -// To print or store the binary data, you may convert it to hex -var encryptedHex = aesjs.utils.hex.fromBytes(encryptedBytes); -console.log(encryptedHex); -// "55e3af2638c560b4fdb9d26a630733ea60197ec23deb85b1f60f71f10409ce27" - -// When ready to decrypt the hex string, convert it back to bytes -var encryptedBytes = aesjs.utils.hex.toBytes(encryptedHex); - -// The cipher feedback mode of operation maintains internal state, -// so to decrypt a new instance must be instantiated. -var aesCfb = new aesjs.ModeOfOperation.cfb(key, iv, 8); -var decryptedBytes = aesCfb.decrypt(encryptedBytes); - -// Convert our bytes back into text -var decryptedText = aesjs.utils.utf8.fromBytes(decryptedBytes); -console.log(decryptedText); -// "TextMustBeAMultipleOfSegmentSize" -``` - - -### OFB - Output Feedback - -```javascript -// An example 128-bit key -var key = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 ]; - -// The initialization vector (must be 16 bytes) -var iv = [ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,35, 36 ]; - -// Convert text to bytes -var text = 'Text may be any length you wish, no padding is required.'; -var textBytes = aesjs.utils.utf8.toBytes(text); - -var aesOfb = new aesjs.ModeOfOperation.ofb(key, iv); -var encryptedBytes = aesOfb.encrypt(textBytes); - -// To print or store the binary data, you may convert it to hex -var encryptedHex = aesjs.utils.hex.fromBytes(encryptedBytes); -console.log(encryptedHex); -// "55e3af2655dd72b9f32456042f39bae9accff6259159e608be55a1aa313c598d -// b4b18406d89c83841c9d1af13b56de8eda8fcfe9ec8e75e8" - -// When ready to decrypt the hex string, convert it back to bytes -var encryptedBytes = aesjs.utils.hex.toBytes(encryptedHex); - -// The output feedback mode of operation maintains internal state, -// so to decrypt a new instance must be instantiated. -var aesOfb = new aesjs.ModeOfOperation.ofb(key, iv); -var decryptedBytes = aesOfb.decrypt(encryptedBytes); - -// Convert our bytes back into text -var decryptedText = aesjs.utils.utf8.fromBytes(decryptedBytes); -console.log(decryptedText); -// "Text may be any length you wish, no padding is required." -``` - - -### ECB - Electronic Codebook (NOT recommended) - -This mode is **not** recommended. Since, for a given key, the same plaintext block in produces the same ciphertext block out, this mode of operation can leak data, such as patterns. For more details and examples, see the Wikipedia article, [Electronic Codebook](http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Electronic_Codebook_.28ECB.29). - -```javascript -// An example 128-bit key -var key = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 ]; - -// Convert text to bytes -var text = 'TextMustBe16Byte'; -var textBytes = aesjs.utils.utf8.toBytes(text); - -var aesEcb = new aesjs.ModeOfOperation.ecb(key); -var encryptedBytes = aesEcb.encrypt(textBytes); - -// To print or store the binary data, you may convert it to hex -var encryptedHex = aesjs.utils.hex.fromBytes(encryptedBytes); -console.log(encryptedHex); -// "a7d93b35368519fac347498dec18b458" - -// When ready to decrypt the hex string, convert it back to bytes -var encryptedBytes = aesjs.utils.hex.toBytes(encryptedHex); - -// Since electronic codebook does not store state, we can -// reuse the same instance. -//var aesEcb = new aesjs.ModeOfOperation.ecb(key); -var decryptedBytes = aesEcb.decrypt(encryptedBytes); - -// Convert our bytes back into text -var decryptedText = aesjs.utils.utf8.fromBytes(decryptedBytes); -console.log(decryptedText); -// "TextMustBe16Byte" -``` - - - -Block Cipher ------------- - -You should usually use one of the above common modes of operation. Using the block cipher algorithm directly is also possible using **ECB** as that mode of operation is merely a thin wrapper. - -But this might be useful to experiment with custom modes of operation or play with block cipher algorithms. - -```javascript - -// the AES block cipher algorithm works on 16 byte bloca ks, no more, no less -var text = "ABlockIs16Bytes!"; -var textAsBytes = aesjs.utils.utf8.toBytes(text) -console.log(textAsBytes); -// [65, 66, 108, 111, 99, 107, 73, 115, 49, 54, 66, 121, 116, 101, 115, 33] - -// create an instance of the block cipher algorithm -var key = [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5, 8, 9, 7, 9, 3]; -var aes = new aesjs.AES(key); - -// encrypt... -var encryptedBytes = aes.encrypt(textAsBytes); -console.log(encryptedBytes); -// [136, 15, 199, 174, 118, 133, 233, 177, 143, 47, 42, 211, 96, 55, 107, 109] - -// To print or store the binary data, you may convert it to hex -var encryptedHex = aesjs.utils.hex.fromBytes(encryptedBytes); -console.log(encryptedHex); -// "880fc7ae7685e9b18f2f2ad360376b6d" - -// When ready to decrypt the hex string, convert it back to bytes -var encryptedBytes = aesjs.utils.hex.toBytes(encryptedHex); - -// decrypt... -var decryptedBytes = aes.decrypt(encryptedBytes); -console.log(decryptedBytes); -// [65, 66, 108, 111, 99, 107, 73, 115, 49, 54, 66, 121, 116, 101, 115, 33] - - -// decode the bytes back into our original text -var decryptedText = aesjs.utils.utf8.fromBytes(decryptedBytes); -console.log(decryptedText); -// "ABlockIs16Bytes!" -``` - - -Notes -===== - -What is a Key -------------- - -This seems to be a point of confusion for many people new to using encryption. You can think of the key as the *"password"*. However, these algorithms require the *"password"* to be a specific length. - -With AES, there are three possible key lengths, 128-bit (16 bytes), 192-bit (24 bytes) or 256-bit (32 bytes). When you create an AES object, the key size is automatically detected, so it is important to pass in a key of the correct length. - -Often, you wish to provide a password of arbitrary length, for example, something easy to remember or write down. In these cases, you must come up with a way to transform the password into a key of a specific length. A **Password-Based Key Derivation Function** (PBKDF) is an algorithm designed for this exact purpose. - -Here is an example, using the popular (possibly obsolete?) pbkdf2: - -```javascript -var pbkdf2 = require('pbkdf2'); - -var key_128 = pbkdf2.pbkdf2Sync('password', 'salt', 1, 128 / 8, 'sha512'); -var key_192 = pbkdf2.pbkdf2Sync('password', 'salt', 1, 192 / 8, 'sha512'); -var key_256 = pbkdf2.pbkdf2Sync('password', 'salt', 1, 256 / 8, 'sha512'); -``` - -Another possibility, is to use a hashing function, such as SHA256 to hash the password, but this method is vulnerable to [Rainbow Attacks](http://en.wikipedia.org/wiki/Rainbow_table), unless you use a [salt](http://en.wikipedia.org/wiki/Salt_(cryptography)). - -Performance ------------ - -Todo... - -Tests ------ - -A test suite has been generated (`test/test-vectors.json`) from a known correct implementation, [pycrypto](https://www.dlitz.net/software/pycrypto/). To generate new test vectors, run `python generate-tests.py`. - -To run the node.js test suite: - -``` -npm test -``` - -To run the web browser tests, open the `test/test.html` file in your browser. - -FAQ ---- - -#### How do I get a question I have added? - -E-mail me at aes-js@ricmoo.com with any questions, suggestions, comments, et cetera. - - -Donations ---------- - -Obviously, it's all licensed under the MIT license, so use it as you wish; but if you'd like to buy me a coffee, I won't complain. =) - -- Bitcoin - `1K1Ax9t6uJmjE4X5xcoVuyVTsiLrYRqe2P` -- Ethereum - `0x70bDC274028F3f391E398dF8e3977De64FEcBf04` diff --git a/tools/mnemonic-test/node_modules/aes-js/aes-js-4.0.0-beta.4.tgz b/tools/mnemonic-test/node_modules/aes-js/aes-js-4.0.0-beta.4.tgz deleted file mode 100644 index b5f5104b..00000000 Binary files a/tools/mnemonic-test/node_modules/aes-js/aes-js-4.0.0-beta.4.tgz and /dev/null differ diff --git a/tools/mnemonic-test/node_modules/aes-js/bower.json b/tools/mnemonic-test/node_modules/aes-js/bower.json deleted file mode 100644 index 63b313d3..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/bower.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "aes-js", - "description": "A pure JavaScript implementation of the AES block cipher and all common modes of operation.", - "main": "index.js", - "authors": [ - "Richard Moore " - ], - "license": "MIT", - "keywords": [ - "aes", - "aes-ctr", - "aes-ofb", - "aes-ecb", - "aes-cbc", - "aes-cfb", - "encrypt", - "decrypt", - "block", - "cipher" - ], - "homepage": "https://github.com/ricmoo/aes-js", - "moduleType": [ - "globals" - ], - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ] -} diff --git a/tools/mnemonic-test/node_modules/aes-js/index.js b/tools/mnemonic-test/node_modules/aes-js/index.js deleted file mode 100644 index 61fcc000..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/index.js +++ /dev/null @@ -1,803 +0,0 @@ -/*! MIT License. Copyright 2015-2018 Richard Moore . See LICENSE.txt. */ -(function(root) { - "use strict"; - - function checkInt(value) { - return (parseInt(value) === value); - } - - function checkInts(arrayish) { - if (!checkInt(arrayish.length)) { return false; } - - for (var i = 0; i < arrayish.length; i++) { - if (!checkInt(arrayish[i]) || arrayish[i] < 0 || arrayish[i] > 255) { - return false; - } - } - - return true; - } - - function coerceArray(arg, copy) { - - // ArrayBuffer view - if (arg.buffer && arg.name === 'Uint8Array') { - - if (copy) { - if (arg.slice) { - arg = arg.slice(); - } else { - arg = Array.prototype.slice.call(arg); - } - } - - return arg; - } - - // It's an array; check it is a valid representation of a byte - if (Array.isArray(arg)) { - if (!checkInts(arg)) { - throw new Error('Array contains invalid value: ' + arg); - } - - return new Uint8Array(arg); - } - - // Something else, but behaves like an array (maybe a Buffer? Arguments?) - if (checkInt(arg.length) && checkInts(arg)) { - return new Uint8Array(arg); - } - - throw new Error('unsupported array-like object'); - } - - function createArray(length) { - return new Uint8Array(length); - } - - function copyArray(sourceArray, targetArray, targetStart, sourceStart, sourceEnd) { - if (sourceStart != null || sourceEnd != null) { - if (sourceArray.slice) { - sourceArray = sourceArray.slice(sourceStart, sourceEnd); - } else { - sourceArray = Array.prototype.slice.call(sourceArray, sourceStart, sourceEnd); - } - } - targetArray.set(sourceArray, targetStart); - } - - - - var convertUtf8 = (function() { - function toBytes(text) { - var result = [], i = 0; - text = encodeURI(text); - while (i < text.length) { - var c = text.charCodeAt(i++); - - // if it is a % sign, encode the following 2 bytes as a hex value - if (c === 37) { - result.push(parseInt(text.substr(i, 2), 16)) - i += 2; - - // otherwise, just the actual byte - } else { - result.push(c) - } - } - - return coerceArray(result); - } - - function fromBytes(bytes) { - var result = [], i = 0; - - while (i < bytes.length) { - var c = bytes[i]; - - if (c < 128) { - result.push(String.fromCharCode(c)); - i++; - } else if (c > 191 && c < 224) { - result.push(String.fromCharCode(((c & 0x1f) << 6) | (bytes[i + 1] & 0x3f))); - i += 2; - } else { - result.push(String.fromCharCode(((c & 0x0f) << 12) | ((bytes[i + 1] & 0x3f) << 6) | (bytes[i + 2] & 0x3f))); - i += 3; - } - } - - return result.join(''); - } - - return { - toBytes: toBytes, - fromBytes: fromBytes, - } - })(); - - var convertHex = (function() { - function toBytes(text) { - var result = []; - for (var i = 0; i < text.length; i += 2) { - result.push(parseInt(text.substr(i, 2), 16)); - } - - return result; - } - - // http://ixti.net/development/javascript/2011/11/11/base64-encodedecode-of-utf8-in-browser-with-js.html - var Hex = '0123456789abcdef'; - - function fromBytes(bytes) { - var result = []; - for (var i = 0; i < bytes.length; i++) { - var v = bytes[i]; - result.push(Hex[(v & 0xf0) >> 4] + Hex[v & 0x0f]); - } - return result.join(''); - } - - return { - toBytes: toBytes, - fromBytes: fromBytes, - } - })(); - - - // Number of rounds by keysize - var numberOfRounds = {16: 10, 24: 12, 32: 14} - - // Round constant words - var rcon = [0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91]; - - // S-box and Inverse S-box (S is for Substitution) - var S = [0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec, 0x5f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ba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d]; - - // Transformations for encryption - var T1 = [0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d, 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554, 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d, 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a, 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87, 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b, 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea, 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b, 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a, 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f, 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108, 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f, 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e, 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5, 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d, 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f, 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e, 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb, 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce, 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497, 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c, 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed, 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b, 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a, 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16, 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594, 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81, 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3, 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a, 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504, 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163, 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d, 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f, 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739, 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47, 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395, 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f, 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883, 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c, 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76, 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e, 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4, 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6, 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b, 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7, 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0, 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25, 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818, 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72, 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651, 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21, 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85, 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa, 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12, 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0, 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9, 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133, 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7, 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920, 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a, 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17, 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8, 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11, 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a]; - var T2 = [0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b, 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5, 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b, 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676, 0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d, 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0, 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf, 0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0, 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626, 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc, 0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1, 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515, 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3, 0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a, 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2, 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575, 0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a, 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0, 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3, 0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484, 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded, 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b, 0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939, 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf, 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb, 0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585, 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f, 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8, 0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f, 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5, 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121, 0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2, 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec, 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717, 0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d, 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373, 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc, 0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888, 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414, 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb, 0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a, 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c, 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262, 0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979, 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d, 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9, 0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea, 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808, 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e, 0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6, 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f, 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a, 0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666, 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e, 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9, 0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e, 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111, 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494, 0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9, 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf, 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d, 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868, 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f, 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616]; - var T3 = [0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b, 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5, 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b, 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76, 0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d, 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0, 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af, 0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0, 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26, 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc, 0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1, 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15, 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3, 0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a, 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2, 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75, 0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a, 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0, 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3, 0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384, 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed, 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b, 0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239, 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf, 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb, 0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185, 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f, 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8, 0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f, 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5, 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221, 0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2, 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec, 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17, 0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d, 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673, 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc, 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88, 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814, 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb, 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a, 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c, 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462, 0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279, 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d, 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9, 0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea, 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008, 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e, 0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6, 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f, 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a, 0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66, 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e, 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9, 0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e, 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211, 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394, 0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9, 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df, 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d, 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068, 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f, 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16]; - var T4 = [0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6, 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491, 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56, 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec, 0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa, 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb, 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45, 0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b, 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c, 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83, 0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9, 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a, 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d, 0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f, 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf, 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea, 0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34, 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b, 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d, 0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713, 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1, 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6, 0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72, 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85, 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed, 0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411, 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe, 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b, 0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05, 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1, 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342, 0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf, 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3, 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e, 0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a, 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6, 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3, 0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b, 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28, 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad, 0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14, 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8, 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4, 0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2, 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da, 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049, 0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf, 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810, 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c, 0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197, 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e, 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f, 0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc, 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c, 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069, 0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927, 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322, 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733, 0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9, 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5, 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a, 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0, 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e, 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c]; - - // Transformations for decryption - var T5 = [0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96, 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393, 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25, 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f, 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1, 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6, 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da, 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844, 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd, 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4, 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45, 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94, 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7, 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a, 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5, 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c, 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1, 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a, 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75, 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051, 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46, 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff, 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77, 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb, 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000, 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e, 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927, 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a, 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e, 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16, 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d, 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8, 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd, 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34, 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163, 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120, 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d, 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0, 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422, 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef, 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36, 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4, 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662, 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5, 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3, 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b, 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8, 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6, 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6, 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0, 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815, 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f, 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df, 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f, 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e, 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713, 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89, 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c, 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf, 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86, 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f, 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541, 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190, 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742]; - var T6 = [0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e, 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303, 0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c, 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3, 0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0, 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9, 0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259, 0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8, 0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971, 0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a, 0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f, 0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b, 0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8, 0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab, 0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708, 0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682, 0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2, 0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe, 0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb, 0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10, 0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd, 0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015, 0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e, 0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee, 0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000, 0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72, 0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39, 0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e, 0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91, 0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a, 0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17, 0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9, 0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60, 0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e, 0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1, 0xcad731dc, 0x10426385, 0x40139722, 0x2084c611, 0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1, 0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3, 0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964, 0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390, 0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b, 0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf, 0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46, 0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af, 0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512, 0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb, 0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a, 0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8, 0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c, 0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266, 0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8, 0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6, 0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604, 0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551, 0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41, 0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647, 0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c, 0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1, 0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737, 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db, 0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340, 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95, 0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1, 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857]; - var T7 = [0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27, 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3, 0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502, 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562, 0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe, 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3, 0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552, 0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9, 0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9, 0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce, 0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253, 0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908, 0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b, 0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655, 0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337, 0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16, 0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69, 0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6, 0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6, 0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e, 0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6, 0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050, 0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9, 0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8, 0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000, 0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a, 0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d, 0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436, 0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b, 0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12, 0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b, 0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e, 0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f, 0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb, 0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4, 0xdccad731, 0x85104263, 0x22401397, 0x112084c6, 0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729, 0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1, 0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9, 0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233, 0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4, 0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad, 0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e, 0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3, 0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25, 0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b, 0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f, 0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15, 0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0, 0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2, 0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7, 0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791, 0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496, 0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665, 0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b, 0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6, 0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13, 0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47, 0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7, 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844, 0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3, 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d, 0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456, 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8]; - var T8 = [0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a, 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b, 0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5, 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5, 0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d, 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b, 0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95, 0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e, 0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27, 0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d, 0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562, 0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9, 0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752, 0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66, 0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3, 0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced, 0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e, 0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4, 0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4, 0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd, 0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d, 0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60, 0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767, 0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79, 0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000, 0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c, 0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736, 0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24, 0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b, 0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c, 0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12, 0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814, 0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3, 0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b, 0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8, 0x31dccad7, 0x63851042, 0x97224013, 0xc6112084, 0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7, 0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077, 0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247, 0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22, 0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698, 0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f, 0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254, 0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582, 0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf, 0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb, 0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883, 0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef, 0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629, 0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035, 0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533, 0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17, 0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4, 0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46, 0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb, 0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d, 0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb, 0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a, 0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73, 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678, 0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2, 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff, 0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064, 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0]; - - // Transformations for decryption key expansion - var U1 = [0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3]; - var U2 = [0x00000000, 0x0b0e090d, 0x161c121a, 0x1d121b17, 0x2c382434, 0x27362d39, 0x3a24362e, 0x312a3f23, 0x58704868, 0x537e4165, 0x4e6c5a72, 0x4562537f, 0x74486c5c, 0x7f466551, 0x62547e46, 0x695a774b, 0xb0e090d0, 0xbbee99dd, 0xa6fc82ca, 0xadf28bc7, 0x9cd8b4e4, 0x97d6bde9, 0x8ac4a6fe, 0x81caaff3, 0xe890d8b8, 0xe39ed1b5, 0xfe8ccaa2, 0xf582c3af, 0xc4a8fc8c, 0xcfa6f581, 0xd2b4ee96, 0xd9bae79b, 0x7bdb3bbb, 0x70d532b6, 0x6dc729a1, 0x66c920ac, 0x57e31f8f, 0x5ced1682, 0x41ff0d95, 0x4af10498, 0x23ab73d3, 0x28a57ade, 0x35b761c9, 0x3eb968c4, 0x0f9357e7, 0x049d5eea, 0x198f45fd, 0x12814cf0, 0xcb3bab6b, 0xc035a266, 0xdd27b971, 0xd629b07c, 0xe7038f5f, 0xec0d8652, 0xf11f9d45, 0xfa119448, 0x934be303, 0x9845ea0e, 0x8557f119, 0x8e59f814, 0xbf73c737, 0xb47dce3a, 0xa96fd52d, 0xa261dc20, 0xf6ad766d, 0xfda37f60, 0xe0b16477, 0xebbf6d7a, 0xda955259, 0xd19b5b54, 0xcc894043, 0xc787494e, 0xaedd3e05, 0xa5d33708, 0xb8c12c1f, 0xb3cf2512, 0x82e51a31, 0x89eb133c, 0x94f9082b, 0x9ff70126, 0x464de6bd, 0x4d43efb0, 0x5051f4a7, 0x5b5ffdaa, 0x6a75c289, 0x617bcb84, 0x7c69d093, 0x7767d99e, 0x1e3daed5, 0x1533a7d8, 0x0821bccf, 0x032fb5c2, 0x32058ae1, 0x390b83ec, 0x241998fb, 0x2f1791f6, 0x8d764dd6, 0x867844db, 0x9b6a5fcc, 0x906456c1, 0xa14e69e2, 0xaa4060ef, 0xb7527bf8, 0xbc5c72f5, 0xd50605be, 0xde080cb3, 0xc31a17a4, 0xc8141ea9, 0xf93e218a, 0xf2302887, 0xef223390, 0xe42c3a9d, 0x3d96dd06, 0x3698d40b, 0x2b8acf1c, 0x2084c611, 0x11aef932, 0x1aa0f03f, 0x07b2eb28, 0x0cbce225, 0x65e6956e, 0x6ee89c63, 0x73fa8774, 0x78f48e79, 0x49deb15a, 0x42d0b857, 0x5fc2a340, 0x54ccaa4d, 0xf741ecda, 0xfc4fe5d7, 0xe15dfec0, 0xea53f7cd, 0xdb79c8ee, 0xd077c1e3, 0xcd65daf4, 0xc66bd3f9, 0xaf31a4b2, 0xa43fadbf, 0xb92db6a8, 0xb223bfa5, 0x83098086, 0x8807898b, 0x9515929c, 0x9e1b9b91, 0x47a17c0a, 0x4caf7507, 0x51bd6e10, 0x5ab3671d, 0x6b99583e, 0x60975133, 0x7d854a24, 0x768b4329, 0x1fd13462, 0x14df3d6f, 0x09cd2678, 0x02c32f75, 0x33e91056, 0x38e7195b, 0x25f5024c, 0x2efb0b41, 0x8c9ad761, 0x8794de6c, 0x9a86c57b, 0x9188cc76, 0xa0a2f355, 0xabacfa58, 0xb6bee14f, 0xbdb0e842, 0xd4ea9f09, 0xdfe49604, 0xc2f68d13, 0xc9f8841e, 0xf8d2bb3d, 0xf3dcb230, 0xeecea927, 0xe5c0a02a, 0x3c7a47b1, 0x37744ebc, 0x2a6655ab, 0x21685ca6, 0x10426385, 0x1b4c6a88, 0x065e719f, 0x0d507892, 0x640a0fd9, 0x6f0406d4, 0x72161dc3, 0x791814ce, 0x48322bed, 0x433c22e0, 0x5e2e39f7, 0x552030fa, 0x01ec9ab7, 0x0ae293ba, 0x17f088ad, 0x1cfe81a0, 0x2dd4be83, 0x26dab78e, 0x3bc8ac99, 0x30c6a594, 0x599cd2df, 0x5292dbd2, 0x4f80c0c5, 0x448ec9c8, 0x75a4f6eb, 0x7eaaffe6, 0x63b8e4f1, 0x68b6edfc, 0xb10c0a67, 0xba02036a, 0xa710187d, 0xac1e1170, 0x9d342e53, 0x963a275e, 0x8b283c49, 0x80263544, 0xe97c420f, 0xe2724b02, 0xff605015, 0xf46e5918, 0xc544663b, 0xce4a6f36, 0xd3587421, 0xd8567d2c, 0x7a37a10c, 0x7139a801, 0x6c2bb316, 0x6725ba1b, 0x560f8538, 0x5d018c35, 0x40139722, 0x4b1d9e2f, 0x2247e964, 0x2949e069, 0x345bfb7e, 0x3f55f273, 0x0e7fcd50, 0x0571c45d, 0x1863df4a, 0x136dd647, 0xcad731dc, 0xc1d938d1, 0xdccb23c6, 0xd7c52acb, 0xe6ef15e8, 0xede11ce5, 0xf0f307f2, 0xfbfd0eff, 0x92a779b4, 0x99a970b9, 0x84bb6bae, 0x8fb562a3, 0xbe9f5d80, 0xb591548d, 0xa8834f9a, 0xa38d4697]; - var U3 = [0x00000000, 0x0d0b0e09, 0x1a161c12, 0x171d121b, 0x342c3824, 0x3927362d, 0x2e3a2436, 0x23312a3f, 0x68587048, 0x65537e41, 0x724e6c5a, 0x7f456253, 0x5c74486c, 0x517f4665, 0x4662547e, 0x4b695a77, 0xd0b0e090, 0xddbbee99, 0xcaa6fc82, 0xc7adf28b, 0xe49cd8b4, 0xe997d6bd, 0xfe8ac4a6, 0xf381caaf, 0xb8e890d8, 0xb5e39ed1, 0xa2fe8cca, 0xaff582c3, 0x8cc4a8fc, 0x81cfa6f5, 0x96d2b4ee, 0x9bd9bae7, 0xbb7bdb3b, 0xb670d532, 0xa16dc729, 0xac66c920, 0x8f57e31f, 0x825ced16, 0x9541ff0d, 0x984af104, 0xd323ab73, 0xde28a57a, 0xc935b761, 0xc43eb968, 0xe70f9357, 0xea049d5e, 0xfd198f45, 0xf012814c, 0x6bcb3bab, 0x66c035a2, 0x71dd27b9, 0x7cd629b0, 0x5fe7038f, 0x52ec0d86, 0x45f11f9d, 0x48fa1194, 0x03934be3, 0x0e9845ea, 0x198557f1, 0x148e59f8, 0x37bf73c7, 0x3ab47dce, 0x2da96fd5, 0x20a261dc, 0x6df6ad76, 0x60fda37f, 0x77e0b164, 0x7aebbf6d, 0x59da9552, 0x54d19b5b, 0x43cc8940, 0x4ec78749, 0x05aedd3e, 0x08a5d337, 0x1fb8c12c, 0x12b3cf25, 0x3182e51a, 0x3c89eb13, 0x2b94f908, 0x269ff701, 0xbd464de6, 0xb04d43ef, 0xa75051f4, 0xaa5b5ffd, 0x896a75c2, 0x84617bcb, 0x937c69d0, 0x9e7767d9, 0xd51e3dae, 0xd81533a7, 0xcf0821bc, 0xc2032fb5, 0xe132058a, 0xec390b83, 0xfb241998, 0xf62f1791, 0xd68d764d, 0xdb867844, 0xcc9b6a5f, 0xc1906456, 0xe2a14e69, 0xefaa4060, 0xf8b7527b, 0xf5bc5c72, 0xbed50605, 0xb3de080c, 0xa4c31a17, 0xa9c8141e, 0x8af93e21, 0x87f23028, 0x90ef2233, 0x9de42c3a, 0x063d96dd, 0x0b3698d4, 0x1c2b8acf, 0x112084c6, 0x3211aef9, 0x3f1aa0f0, 0x2807b2eb, 0x250cbce2, 0x6e65e695, 0x636ee89c, 0x7473fa87, 0x7978f48e, 0x5a49deb1, 0x5742d0b8, 0x405fc2a3, 0x4d54ccaa, 0xdaf741ec, 0xd7fc4fe5, 0xc0e15dfe, 0xcdea53f7, 0xeedb79c8, 0xe3d077c1, 0xf4cd65da, 0xf9c66bd3, 0xb2af31a4, 0xbfa43fad, 0xa8b92db6, 0xa5b223bf, 0x86830980, 0x8b880789, 0x9c951592, 0x919e1b9b, 0x0a47a17c, 0x074caf75, 0x1051bd6e, 0x1d5ab367, 0x3e6b9958, 0x33609751, 0x247d854a, 0x29768b43, 0x621fd134, 0x6f14df3d, 0x7809cd26, 0x7502c32f, 0x5633e910, 0x5b38e719, 0x4c25f502, 0x412efb0b, 0x618c9ad7, 0x6c8794de, 0x7b9a86c5, 0x769188cc, 0x55a0a2f3, 0x58abacfa, 0x4fb6bee1, 0x42bdb0e8, 0x09d4ea9f, 0x04dfe496, 0x13c2f68d, 0x1ec9f884, 0x3df8d2bb, 0x30f3dcb2, 0x27eecea9, 0x2ae5c0a0, 0xb13c7a47, 0xbc37744e, 0xab2a6655, 0xa621685c, 0x85104263, 0x881b4c6a, 0x9f065e71, 0x920d5078, 0xd9640a0f, 0xd46f0406, 0xc372161d, 0xce791814, 0xed48322b, 0xe0433c22, 0xf75e2e39, 0xfa552030, 0xb701ec9a, 0xba0ae293, 0xad17f088, 0xa01cfe81, 0x832dd4be, 0x8e26dab7, 0x993bc8ac, 0x9430c6a5, 0xdf599cd2, 0xd25292db, 0xc54f80c0, 0xc8448ec9, 0xeb75a4f6, 0xe67eaaff, 0xf163b8e4, 0xfc68b6ed, 0x67b10c0a, 0x6aba0203, 0x7da71018, 0x70ac1e11, 0x539d342e, 0x5e963a27, 0x498b283c, 0x44802635, 0x0fe97c42, 0x02e2724b, 0x15ff6050, 0x18f46e59, 0x3bc54466, 0x36ce4a6f, 0x21d35874, 0x2cd8567d, 0x0c7a37a1, 0x017139a8, 0x166c2bb3, 0x1b6725ba, 0x38560f85, 0x355d018c, 0x22401397, 0x2f4b1d9e, 0x642247e9, 0x692949e0, 0x7e345bfb, 0x733f55f2, 0x500e7fcd, 0x5d0571c4, 0x4a1863df, 0x47136dd6, 0xdccad731, 0xd1c1d938, 0xc6dccb23, 0xcbd7c52a, 0xe8e6ef15, 0xe5ede11c, 0xf2f0f307, 0xfffbfd0e, 0xb492a779, 0xb999a970, 0xae84bb6b, 0xa38fb562, 0x80be9f5d, 0x8db59154, 0x9aa8834f, 0x97a38d46]; - var U4 = [0x00000000, 0x090d0b0e, 0x121a161c, 0x1b171d12, 0x24342c38, 0x2d392736, 0x362e3a24, 0x3f23312a, 0x48685870, 0x4165537e, 0x5a724e6c, 0x537f4562, 0x6c5c7448, 0x65517f46, 0x7e466254, 0x774b695a, 0x90d0b0e0, 0x99ddbbee, 0x82caa6fc, 0x8bc7adf2, 0xb4e49cd8, 0xbde997d6, 0xa6fe8ac4, 0xaff381ca, 0xd8b8e890, 0xd1b5e39e, 0xcaa2fe8c, 0xc3aff582, 0xfc8cc4a8, 0xf581cfa6, 0xee96d2b4, 0xe79bd9ba, 0x3bbb7bdb, 0x32b670d5, 0x29a16dc7, 0x20ac66c9, 0x1f8f57e3, 0x16825ced, 0x0d9541ff, 0x04984af1, 0x73d323ab, 0x7ade28a5, 0x61c935b7, 0x68c43eb9, 0x57e70f93, 0x5eea049d, 0x45fd198f, 0x4cf01281, 0xab6bcb3b, 0xa266c035, 0xb971dd27, 0xb07cd629, 0x8f5fe703, 0x8652ec0d, 0x9d45f11f, 0x9448fa11, 0xe303934b, 0xea0e9845, 0xf1198557, 0xf8148e59, 0xc737bf73, 0xce3ab47d, 0xd52da96f, 0xdc20a261, 0x766df6ad, 0x7f60fda3, 0x6477e0b1, 0x6d7aebbf, 0x5259da95, 0x5b54d19b, 0x4043cc89, 0x494ec787, 0x3e05aedd, 0x3708a5d3, 0x2c1fb8c1, 0x2512b3cf, 0x1a3182e5, 0x133c89eb, 0x082b94f9, 0x01269ff7, 0xe6bd464d, 0xefb04d43, 0xf4a75051, 0xfdaa5b5f, 0xc2896a75, 0xcb84617b, 0xd0937c69, 0xd99e7767, 0xaed51e3d, 0xa7d81533, 0xbccf0821, 0xb5c2032f, 0x8ae13205, 0x83ec390b, 0x98fb2419, 0x91f62f17, 0x4dd68d76, 0x44db8678, 0x5fcc9b6a, 0x56c19064, 0x69e2a14e, 0x60efaa40, 0x7bf8b752, 0x72f5bc5c, 0x05bed506, 0x0cb3de08, 0x17a4c31a, 0x1ea9c814, 0x218af93e, 0x2887f230, 0x3390ef22, 0x3a9de42c, 0xdd063d96, 0xd40b3698, 0xcf1c2b8a, 0xc6112084, 0xf93211ae, 0xf03f1aa0, 0xeb2807b2, 0xe2250cbc, 0x956e65e6, 0x9c636ee8, 0x877473fa, 0x8e7978f4, 0xb15a49de, 0xb85742d0, 0xa3405fc2, 0xaa4d54cc, 0xecdaf741, 0xe5d7fc4f, 0xfec0e15d, 0xf7cdea53, 0xc8eedb79, 0xc1e3d077, 0xdaf4cd65, 0xd3f9c66b, 0xa4b2af31, 0xadbfa43f, 0xb6a8b92d, 0xbfa5b223, 0x80868309, 0x898b8807, 0x929c9515, 0x9b919e1b, 0x7c0a47a1, 0x75074caf, 0x6e1051bd, 0x671d5ab3, 0x583e6b99, 0x51336097, 0x4a247d85, 0x4329768b, 0x34621fd1, 0x3d6f14df, 0x267809cd, 0x2f7502c3, 0x105633e9, 0x195b38e7, 0x024c25f5, 0x0b412efb, 0xd7618c9a, 0xde6c8794, 0xc57b9a86, 0xcc769188, 0xf355a0a2, 0xfa58abac, 0xe14fb6be, 0xe842bdb0, 0x9f09d4ea, 0x9604dfe4, 0x8d13c2f6, 0x841ec9f8, 0xbb3df8d2, 0xb230f3dc, 0xa927eece, 0xa02ae5c0, 0x47b13c7a, 0x4ebc3774, 0x55ab2a66, 0x5ca62168, 0x63851042, 0x6a881b4c, 0x719f065e, 0x78920d50, 0x0fd9640a, 0x06d46f04, 0x1dc37216, 0x14ce7918, 0x2bed4832, 0x22e0433c, 0x39f75e2e, 0x30fa5520, 0x9ab701ec, 0x93ba0ae2, 0x88ad17f0, 0x81a01cfe, 0xbe832dd4, 0xb78e26da, 0xac993bc8, 0xa59430c6, 0xd2df599c, 0xdbd25292, 0xc0c54f80, 0xc9c8448e, 0xf6eb75a4, 0xffe67eaa, 0xe4f163b8, 0xedfc68b6, 0x0a67b10c, 0x036aba02, 0x187da710, 0x1170ac1e, 0x2e539d34, 0x275e963a, 0x3c498b28, 0x35448026, 0x420fe97c, 0x4b02e272, 0x5015ff60, 0x5918f46e, 0x663bc544, 0x6f36ce4a, 0x7421d358, 0x7d2cd856, 0xa10c7a37, 0xa8017139, 0xb3166c2b, 0xba1b6725, 0x8538560f, 0x8c355d01, 0x97224013, 0x9e2f4b1d, 0xe9642247, 0xe0692949, 0xfb7e345b, 0xf2733f55, 0xcd500e7f, 0xc45d0571, 0xdf4a1863, 0xd647136d, 0x31dccad7, 0x38d1c1d9, 0x23c6dccb, 0x2acbd7c5, 0x15e8e6ef, 0x1ce5ede1, 0x07f2f0f3, 0x0efffbfd, 0x79b492a7, 0x70b999a9, 0x6bae84bb, 0x62a38fb5, 0x5d80be9f, 0x548db591, 0x4f9aa883, 0x4697a38d]; - - function convertToInt32(bytes) { - var result = []; - for (var i = 0; i < bytes.length; i += 4) { - result.push( - (bytes[i ] << 24) | - (bytes[i + 1] << 16) | - (bytes[i + 2] << 8) | - bytes[i + 3] - ); - } - return result; - } - - var AES = function(key) { - if (!(this instanceof AES)) { - throw Error('AES must be instanitated with `new`'); - } - - Object.defineProperty(this, 'key', { - value: coerceArray(key, true) - }); - - this._prepare(); - } - - - AES.prototype._prepare = function() { - - var rounds = numberOfRounds[this.key.length]; - if (rounds == null) { - throw new Error('invalid key size (must be 16, 24 or 32 bytes)'); - } - - // encryption round keys - this._Ke = []; - - // decryption round keys - this._Kd = []; - - for (var i = 0; i <= rounds; i++) { - this._Ke.push([0, 0, 0, 0]); - this._Kd.push([0, 0, 0, 0]); - } - - var roundKeyCount = (rounds + 1) * 4; - var KC = this.key.length / 4; - - // convert the key into ints - var tk = convertToInt32(this.key); - - // copy values into round key arrays - var index; - for (var i = 0; i < KC; i++) { - index = i >> 2; - this._Ke[index][i % 4] = tk[i]; - this._Kd[rounds - index][i % 4] = tk[i]; - } - - // key expansion (fips-197 section 5.2) - var rconpointer = 0; - var t = KC, tt; - while (t < roundKeyCount) { - tt = tk[KC - 1]; - tk[0] ^= ((S[(tt >> 16) & 0xFF] << 24) ^ - (S[(tt >> 8) & 0xFF] << 16) ^ - (S[ tt & 0xFF] << 8) ^ - S[(tt >> 24) & 0xFF] ^ - (rcon[rconpointer] << 24)); - rconpointer += 1; - - // key expansion (for non-256 bit) - if (KC != 8) { - for (var i = 1; i < KC; i++) { - tk[i] ^= tk[i - 1]; - } - - // key expansion for 256-bit keys is "slightly different" (fips-197) - } else { - for (var i = 1; i < (KC / 2); i++) { - tk[i] ^= tk[i - 1]; - } - tt = tk[(KC / 2) - 1]; - - tk[KC / 2] ^= (S[ tt & 0xFF] ^ - (S[(tt >> 8) & 0xFF] << 8) ^ - (S[(tt >> 16) & 0xFF] << 16) ^ - (S[(tt >> 24) & 0xFF] << 24)); - - for (var i = (KC / 2) + 1; i < KC; i++) { - tk[i] ^= tk[i - 1]; - } - } - - // copy values into round key arrays - var i = 0, r, c; - while (i < KC && t < roundKeyCount) { - r = t >> 2; - c = t % 4; - this._Ke[r][c] = tk[i]; - this._Kd[rounds - r][c] = tk[i++]; - t++; - } - } - - // inverse-cipher-ify the decryption round key (fips-197 section 5.3) - for (var r = 1; r < rounds; r++) { - for (var c = 0; c < 4; c++) { - tt = this._Kd[r][c]; - this._Kd[r][c] = (U1[(tt >> 24) & 0xFF] ^ - U2[(tt >> 16) & 0xFF] ^ - U3[(tt >> 8) & 0xFF] ^ - U4[ tt & 0xFF]); - } - } - } - - AES.prototype.encrypt = function(plaintext) { - if (plaintext.length != 16) { - throw new Error('invalid plaintext size (must be 16 bytes)'); - } - - var rounds = this._Ke.length - 1; - var a = [0, 0, 0, 0]; - - // convert plaintext to (ints ^ key) - var t = convertToInt32(plaintext); - for (var i = 0; i < 4; i++) { - t[i] ^= this._Ke[0][i]; - } - - // apply round transforms - for (var r = 1; r < rounds; r++) { - for (var i = 0; i < 4; i++) { - a[i] = (T1[(t[ i ] >> 24) & 0xff] ^ - T2[(t[(i + 1) % 4] >> 16) & 0xff] ^ - T3[(t[(i + 2) % 4] >> 8) & 0xff] ^ - T4[ t[(i + 3) % 4] & 0xff] ^ - this._Ke[r][i]); - } - t = a.slice(); - } - - // the last round is special - var result = createArray(16), tt; - for (var i = 0; i < 4; i++) { - tt = this._Ke[rounds][i]; - result[4 * i ] = (S[(t[ i ] >> 24) & 0xff] ^ (tt >> 24)) & 0xff; - result[4 * i + 1] = (S[(t[(i + 1) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff; - result[4 * i + 2] = (S[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff; - result[4 * i + 3] = (S[ t[(i + 3) % 4] & 0xff] ^ tt ) & 0xff; - } - - return result; - } - - AES.prototype.decrypt = function(ciphertext) { - if (ciphertext.length != 16) { - throw new Error('invalid ciphertext size (must be 16 bytes)'); - } - - var rounds = this._Kd.length - 1; - var a = [0, 0, 0, 0]; - - // convert plaintext to (ints ^ key) - var t = convertToInt32(ciphertext); - for (var i = 0; i < 4; i++) { - t[i] ^= this._Kd[0][i]; - } - - // apply round transforms - for (var r = 1; r < rounds; r++) { - for (var i = 0; i < 4; i++) { - a[i] = (T5[(t[ i ] >> 24) & 0xff] ^ - T6[(t[(i + 3) % 4] >> 16) & 0xff] ^ - T7[(t[(i + 2) % 4] >> 8) & 0xff] ^ - T8[ t[(i + 1) % 4] & 0xff] ^ - this._Kd[r][i]); - } - t = a.slice(); - } - - // the last round is special - var result = createArray(16), tt; - for (var i = 0; i < 4; i++) { - tt = this._Kd[rounds][i]; - result[4 * i ] = (Si[(t[ i ] >> 24) & 0xff] ^ (tt >> 24)) & 0xff; - result[4 * i + 1] = (Si[(t[(i + 3) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff; - result[4 * i + 2] = (Si[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff; - result[4 * i + 3] = (Si[ t[(i + 1) % 4] & 0xff] ^ tt ) & 0xff; - } - - return result; - } - - - /** - * Mode Of Operation - Electonic Codebook (ECB) - */ - var ModeOfOperationECB = function(key) { - if (!(this instanceof ModeOfOperationECB)) { - throw Error('AES must be instanitated with `new`'); - } - - this.description = "Electronic Code Block"; - this.name = "ecb"; - - this._aes = new AES(key); - } - - ModeOfOperationECB.prototype.encrypt = function(plaintext) { - plaintext = coerceArray(plaintext); - - if ((plaintext.length % 16) !== 0) { - throw new Error('invalid plaintext size (must be multiple of 16 bytes)'); - } - - var ciphertext = createArray(plaintext.length); - var block = createArray(16); - - for (var i = 0; i < plaintext.length; i += 16) { - copyArray(plaintext, block, 0, i, i + 16); - block = this._aes.encrypt(block); - copyArray(block, ciphertext, i); - } - - return ciphertext; - } - - ModeOfOperationECB.prototype.decrypt = function(ciphertext) { - ciphertext = coerceArray(ciphertext); - - if ((ciphertext.length % 16) !== 0) { - throw new Error('invalid ciphertext size (must be multiple of 16 bytes)'); - } - - var plaintext = createArray(ciphertext.length); - var block = createArray(16); - - for (var i = 0; i < ciphertext.length; i += 16) { - copyArray(ciphertext, block, 0, i, i + 16); - block = this._aes.decrypt(block); - copyArray(block, plaintext, i); - } - - return plaintext; - } - - - /** - * Mode Of Operation - Cipher Block Chaining (CBC) - */ - var ModeOfOperationCBC = function(key, iv) { - if (!(this instanceof ModeOfOperationCBC)) { - throw Error('AES must be instanitated with `new`'); - } - - this.description = "Cipher Block Chaining"; - this.name = "cbc"; - - if (!iv) { - iv = createArray(16); - - } else if (iv.length != 16) { - throw new Error('invalid initialation vector size (must be 16 bytes)'); - } - - this._lastCipherblock = coerceArray(iv, true); - - this._aes = new AES(key); - } - - ModeOfOperationCBC.prototype.encrypt = function(plaintext) { - plaintext = coerceArray(plaintext); - - if ((plaintext.length % 16) !== 0) { - throw new Error('invalid plaintext size (must be multiple of 16 bytes)'); - } - - var ciphertext = createArray(plaintext.length); - var block = createArray(16); - - for (var i = 0; i < plaintext.length; i += 16) { - copyArray(plaintext, block, 0, i, i + 16); - - for (var j = 0; j < 16; j++) { - block[j] ^= this._lastCipherblock[j]; - } - - this._lastCipherblock = this._aes.encrypt(block); - copyArray(this._lastCipherblock, ciphertext, i); - } - - return ciphertext; - } - - ModeOfOperationCBC.prototype.decrypt = function(ciphertext) { - ciphertext = coerceArray(ciphertext); - - if ((ciphertext.length % 16) !== 0) { - throw new Error('invalid ciphertext size (must be multiple of 16 bytes)'); - } - - var plaintext = createArray(ciphertext.length); - var block = createArray(16); - - for (var i = 0; i < ciphertext.length; i += 16) { - copyArray(ciphertext, block, 0, i, i + 16); - block = this._aes.decrypt(block); - - for (var j = 0; j < 16; j++) { - plaintext[i + j] = block[j] ^ this._lastCipherblock[j]; - } - - copyArray(ciphertext, this._lastCipherblock, 0, i, i + 16); - } - - return plaintext; - } - - - /** - * Mode Of Operation - Cipher Feedback (CFB) - */ - var ModeOfOperationCFB = function(key, iv, segmentSize) { - if (!(this instanceof ModeOfOperationCFB)) { - throw Error('AES must be instanitated with `new`'); - } - - this.description = "Cipher Feedback"; - this.name = "cfb"; - - if (!iv) { - iv = createArray(16); - - } else if (iv.length != 16) { - throw new Error('invalid initialation vector size (must be 16 size)'); - } - - if (!segmentSize) { segmentSize = 1; } - - this.segmentSize = segmentSize; - - this._shiftRegister = coerceArray(iv, true); - - this._aes = new AES(key); - } - - ModeOfOperationCFB.prototype.encrypt = function(plaintext) { - if ((plaintext.length % this.segmentSize) != 0) { - throw new Error('invalid plaintext size (must be segmentSize bytes)'); - } - - var encrypted = coerceArray(plaintext, true); - - var xorSegment; - for (var i = 0; i < encrypted.length; i += this.segmentSize) { - xorSegment = this._aes.encrypt(this._shiftRegister); - for (var j = 0; j < this.segmentSize; j++) { - encrypted[i + j] ^= xorSegment[j]; - } - - // Shift the register - copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize); - copyArray(encrypted, this._shiftRegister, 16 - this.segmentSize, i, i + this.segmentSize); - } - - return encrypted; - } - - ModeOfOperationCFB.prototype.decrypt = function(ciphertext) { - if ((ciphertext.length % this.segmentSize) != 0) { - throw new Error('invalid ciphertext size (must be segmentSize bytes)'); - } - - var plaintext = coerceArray(ciphertext, true); - - var xorSegment; - for (var i = 0; i < plaintext.length; i += this.segmentSize) { - xorSegment = this._aes.encrypt(this._shiftRegister); - - for (var j = 0; j < this.segmentSize; j++) { - plaintext[i + j] ^= xorSegment[j]; - } - - // Shift the register - copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize); - copyArray(ciphertext, this._shiftRegister, 16 - this.segmentSize, i, i + this.segmentSize); - } - - return plaintext; - } - - /** - * Mode Of Operation - Output Feedback (OFB) - */ - var ModeOfOperationOFB = function(key, iv) { - if (!(this instanceof ModeOfOperationOFB)) { - throw Error('AES must be instanitated with `new`'); - } - - this.description = "Output Feedback"; - this.name = "ofb"; - - if (!iv) { - iv = createArray(16); - - } else if (iv.length != 16) { - throw new Error('invalid initialation vector size (must be 16 bytes)'); - } - - this._lastPrecipher = coerceArray(iv, true); - this._lastPrecipherIndex = 16; - - this._aes = new AES(key); - } - - ModeOfOperationOFB.prototype.encrypt = function(plaintext) { - var encrypted = coerceArray(plaintext, true); - - for (var i = 0; i < encrypted.length; i++) { - if (this._lastPrecipherIndex === 16) { - this._lastPrecipher = this._aes.encrypt(this._lastPrecipher); - this._lastPrecipherIndex = 0; - } - encrypted[i] ^= this._lastPrecipher[this._lastPrecipherIndex++]; - } - - return encrypted; - } - - // Decryption is symetric - ModeOfOperationOFB.prototype.decrypt = ModeOfOperationOFB.prototype.encrypt; - - - /** - * Counter object for CTR common mode of operation - */ - var Counter = function(initialValue) { - if (!(this instanceof Counter)) { - throw Error('Counter must be instanitated with `new`'); - } - - // We allow 0, but anything false-ish uses the default 1 - if (initialValue !== 0 && !initialValue) { initialValue = 1; } - - if (typeof(initialValue) === 'number') { - this._counter = createArray(16); - this.setValue(initialValue); - - } else { - this.setBytes(initialValue); - } - } - - Counter.prototype.setValue = function(value) { - if (typeof(value) !== 'number' || parseInt(value) != value) { - throw new Error('invalid counter value (must be an integer)'); - } - - // We cannot safely handle numbers beyond the safe range for integers - if (value > Number.MAX_SAFE_INTEGER) { - throw new Error('integer value out of safe range'); - } - - for (var index = 15; index >= 0; --index) { - this._counter[index] = value % 256; - value = parseInt(value / 256); - } - } - - Counter.prototype.setBytes = function(bytes) { - bytes = coerceArray(bytes, true); - - if (bytes.length != 16) { - throw new Error('invalid counter bytes size (must be 16 bytes)'); - } - - this._counter = bytes; - }; - - Counter.prototype.increment = function() { - for (var i = 15; i >= 0; i--) { - if (this._counter[i] === 255) { - this._counter[i] = 0; - } else { - this._counter[i]++; - break; - } - } - } - - - /** - * Mode Of Operation - Counter (CTR) - */ - var ModeOfOperationCTR = function(key, counter) { - if (!(this instanceof ModeOfOperationCTR)) { - throw Error('AES must be instanitated with `new`'); - } - - this.description = "Counter"; - this.name = "ctr"; - - if (!(counter instanceof Counter)) { - counter = new Counter(counter) - } - - this._counter = counter; - - this._remainingCounter = null; - this._remainingCounterIndex = 16; - - this._aes = new AES(key); - } - - ModeOfOperationCTR.prototype.encrypt = function(plaintext) { - var encrypted = coerceArray(plaintext, true); - - for (var i = 0; i < encrypted.length; i++) { - if (this._remainingCounterIndex === 16) { - this._remainingCounter = this._aes.encrypt(this._counter._counter); - this._remainingCounterIndex = 0; - this._counter.increment(); - } - encrypted[i] ^= this._remainingCounter[this._remainingCounterIndex++]; - } - - return encrypted; - } - - // Decryption is symetric - ModeOfOperationCTR.prototype.decrypt = ModeOfOperationCTR.prototype.encrypt; - - - /////////////////////// - // Padding - - // See:https://tools.ietf.org/html/rfc2315 - function pkcs7pad(data) { - data = coerceArray(data, true); - var padder = 16 - (data.length % 16); - var result = createArray(data.length + padder); - copyArray(data, result); - for (var i = data.length; i < result.length; i++) { - result[i] = padder; - } - return result; - } - - function pkcs7strip(data) { - data = coerceArray(data, true); - if (data.length < 16) { throw new Error('PKCS#7 invalid length'); } - - var padder = data[data.length - 1]; - if (padder > 16) { throw new Error('PKCS#7 padding byte out of range'); } - - var length = data.length - padder; - for (var i = 0; i < padder; i++) { - if (data[length + i] !== padder) { - throw new Error('PKCS#7 invalid padding byte'); - } - } - - var result = createArray(length); - copyArray(data, result, 0, 0, length); - return result; - } - - /////////////////////// - // Exporting - - - // The block cipher - var aesjs = { - AES: AES, - Counter: Counter, - - ModeOfOperation: { - ecb: ModeOfOperationECB, - cbc: ModeOfOperationCBC, - cfb: ModeOfOperationCFB, - ofb: ModeOfOperationOFB, - ctr: ModeOfOperationCTR - }, - - utils: { - hex: convertHex, - utf8: convertUtf8 - }, - - padding: { - pkcs7: { - pad: pkcs7pad, - strip: pkcs7strip - } - }, - - _arrayTest: { - coerceArray: coerceArray, - createArray: createArray, - copyArray: copyArray, - } - }; - - - // node.js - if (typeof exports !== 'undefined') { - module.exports = aesjs - - // RequireJS/AMD - // http://www.requirejs.org/docs/api.html - // https://github.com/amdjs/amdjs-api/wiki/AMD - } else if (typeof(define) === 'function' && define.amd) { - define([], function() { return aesjs; }); - - // Web Browsers - } else { - - // If there was an existing library at "aesjs" make sure it's still available - if (root.aesjs) { - aesjs._aesjs = root.aesjs; - } - - root.aesjs = aesjs; - } - - -})(this); diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/README.md b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/README.md deleted file mode 100644 index b2a9245b..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/README.md +++ /dev/null @@ -1,6 +0,0 @@ -Gerneated Code (CommonJS) -========================= - -Do not modify code in this folder. - -See `/src.ts/` and `/tsconfig.commonjs.json`. diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/aes.d.ts b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/aes.d.ts deleted file mode 100644 index 2a26aff5..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/aes.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/*! MIT License. Copyright 2015-2022 Richard Moore . See LICENSE.txt. */ -export declare class AES { - #private; - get key(): Uint8Array; - constructor(key: Uint8Array); - encrypt(plaintext: Uint8Array): Uint8Array; - decrypt(ciphertext: Uint8Array): Uint8Array; -} -//# sourceMappingURL=aes.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/aes.d.ts.map b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/aes.d.ts.map deleted file mode 100644 index a3c66c79..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/aes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"aes.d.ts","sourceRoot":"","sources":["../src.ts/aes.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAsCvF,qBAAa,GAAG;;IAKd,IAAI,GAAG,IAAI,UAAU,CAA8B;gBAEvC,GAAG,EAAE,UAAU;IA+F3B,OAAO,CAAC,SAAS,EAAE,UAAU,GAAG,UAAU;IAwC1C,OAAO,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU;CAuC5C"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/aes.js b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/aes.js deleted file mode 100644 index fd2ea515..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/aes.js +++ /dev/null @@ -1,202 +0,0 @@ -"use strict"; -/*! MIT License. Copyright 2015-2022 Richard Moore . See LICENSE.txt. */ -var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -}; -var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; -}; -var _AES_key, _AES_Kd, _AES_Ke; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.AES = void 0; -// Number of rounds by keysize -const numberOfRounds = { 16: 10, 24: 12, 32: 14 }; -// Round constant words -const rcon = [0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91]; -// S-box and Inverse S-box (S is for Substitution) -const S = [0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c,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ec, 0x5f, 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d]; -// Transformations for encryption -const T1 = [0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d, 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554, 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d, 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a, 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87, 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b, 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea, 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b, 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a, 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f, 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108, 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f, 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e, 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5, 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d, 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f, 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e, 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb, 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce, 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497, 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c, 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed, 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b, 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a, 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16, 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594, 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81, 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3, 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a, 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504, 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163, 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d, 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f, 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739, 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47, 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395, 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f, 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883, 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c, 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76, 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e, 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4, 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6, 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b, 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7, 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0, 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25, 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818, 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72, 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651, 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21, 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85, 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa, 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12, 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0, 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9, 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133, 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7, 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920, 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a, 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17, 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8, 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11, 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a]; -const T2 = [0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b, 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5, 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b, 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676, 0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d, 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0, 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf, 0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0, 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626, 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc, 0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1, 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515, 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3, 0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a, 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2, 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575, 0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a, 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0, 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3, 0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484, 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded, 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b, 0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939, 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf, 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb, 0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585, 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f, 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8, 0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f, 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5, 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121, 0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2, 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec, 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717, 0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d, 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373, 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc, 0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888, 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414, 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb, 0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a, 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c, 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262, 0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979, 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d, 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9, 0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea, 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808, 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e, 0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6, 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f, 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a, 0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666, 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e, 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9, 0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e, 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111, 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494, 0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9, 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf, 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d, 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868, 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f, 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616]; -const T3 = [0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b, 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5, 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b, 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76, 0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d, 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0, 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af, 0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0, 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26, 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc, 0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1, 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15, 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3, 0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a, 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2, 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75, 0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a, 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0, 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3, 0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384, 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed, 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b, 0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239, 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf, 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb, 0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185, 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f, 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8, 0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f, 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5, 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221, 0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2, 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec, 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17, 0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d, 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673, 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc, 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88, 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814, 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb, 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a, 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c, 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462, 0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279, 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d, 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9, 0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea, 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008, 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e, 0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6, 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f, 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a, 0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66, 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e, 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9, 0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e, 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211, 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394, 0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9, 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df, 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d, 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068, 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f, 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16]; -const T4 = [0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6, 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491, 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56, 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec, 0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa, 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb, 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45, 0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b, 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c, 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83, 0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9, 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a, 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d, 0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f, 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf, 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea, 0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34, 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b, 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d, 0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713, 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1, 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6, 0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72, 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85, 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed, 0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411, 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe, 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b, 0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05, 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1, 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342, 0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf, 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3, 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e, 0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a, 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6, 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3, 0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b, 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28, 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad, 0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14, 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8, 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4, 0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2, 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da, 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049, 0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf, 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810, 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c, 0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197, 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e, 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f, 0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc, 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c, 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069, 0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927, 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322, 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733, 0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9, 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5, 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a, 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0, 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e, 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c]; -// Transformations for decryption -const T5 = [0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96, 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393, 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25, 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f, 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1, 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6, 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da, 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844, 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd, 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4, 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45, 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94, 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7, 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a, 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5, 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c, 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1, 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a, 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75, 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051, 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46, 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff, 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77, 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb, 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000, 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e, 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927, 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a, 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e, 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16, 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d, 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8, 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd, 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34, 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163, 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120, 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d, 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0, 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422, 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef, 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36, 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4, 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662, 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5, 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3, 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b, 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8, 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6, 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6, 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0, 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815, 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f, 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df, 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f, 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e, 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713, 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89, 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c, 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf, 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86, 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f, 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541, 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190, 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742]; -const T6 = [0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e, 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303, 0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c, 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3, 0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0, 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9, 0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259, 0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8, 0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971, 0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a, 0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f, 0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b, 0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8, 0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab, 0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708, 0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682, 0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2, 0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe, 0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb, 0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10, 0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd, 0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015, 0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e, 0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee, 0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000, 0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72, 0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39, 0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e, 0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91, 0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a, 0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17, 0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9, 0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60, 0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e, 0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1, 0xcad731dc, 0x10426385, 0x40139722, 0x2084c611, 0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1, 0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3, 0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964, 0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390, 0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b, 0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf, 0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46, 0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af, 0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512, 0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb, 0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a, 0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8, 0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c, 0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266, 0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8, 0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6, 0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604, 0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551, 0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41, 0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647, 0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c, 0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1, 0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737, 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db, 0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340, 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95, 0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1, 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857]; -const T7 = [0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27, 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3, 0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502, 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562, 0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe, 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3, 0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552, 0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9, 0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9, 0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce, 0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253, 0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908, 0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b, 0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655, 0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337, 0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16, 0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69, 0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6, 0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6, 0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e, 0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6, 0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050, 0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9, 0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8, 0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000, 0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a, 0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d, 0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436, 0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b, 0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12, 0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b, 0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e, 0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f, 0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb, 0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4, 0xdccad731, 0x85104263, 0x22401397, 0x112084c6, 0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729, 0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1, 0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9, 0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233, 0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4, 0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad, 0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e, 0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3, 0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25, 0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b, 0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f, 0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15, 0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0, 0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2, 0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7, 0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791, 0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496, 0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665, 0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b, 0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6, 0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13, 0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47, 0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7, 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844, 0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3, 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d, 0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456, 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8]; -const T8 = [0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a, 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b, 0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5, 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5, 0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d, 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b, 0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95, 0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e, 0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27, 0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d, 0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562, 0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9, 0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752, 0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66, 0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3, 0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced, 0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e, 0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4, 0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4, 0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd, 0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d, 0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60, 0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767, 0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79, 0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000, 0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c, 0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736, 0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24, 0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b, 0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c, 0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12, 0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814, 0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3, 0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b, 0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8, 0x31dccad7, 0x63851042, 0x97224013, 0xc6112084, 0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7, 0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077, 0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247, 0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22, 0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698, 0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f, 0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254, 0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582, 0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf, 0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb, 0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883, 0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef, 0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629, 0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035, 0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533, 0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17, 0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4, 0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46, 0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb, 0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d, 0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb, 0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a, 0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73, 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678, 0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2, 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff, 0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064, 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0]; -// Transformations for decryption key expansion -const U1 = [0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3]; -const U2 = [0x00000000, 0x0b0e090d, 0x161c121a, 0x1d121b17, 0x2c382434, 0x27362d39, 0x3a24362e, 0x312a3f23, 0x58704868, 0x537e4165, 0x4e6c5a72, 0x4562537f, 0x74486c5c, 0x7f466551, 0x62547e46, 0x695a774b, 0xb0e090d0, 0xbbee99dd, 0xa6fc82ca, 0xadf28bc7, 0x9cd8b4e4, 0x97d6bde9, 0x8ac4a6fe, 0x81caaff3, 0xe890d8b8, 0xe39ed1b5, 0xfe8ccaa2, 0xf582c3af, 0xc4a8fc8c, 0xcfa6f581, 0xd2b4ee96, 0xd9bae79b, 0x7bdb3bbb, 0x70d532b6, 0x6dc729a1, 0x66c920ac, 0x57e31f8f, 0x5ced1682, 0x41ff0d95, 0x4af10498, 0x23ab73d3, 0x28a57ade, 0x35b761c9, 0x3eb968c4, 0x0f9357e7, 0x049d5eea, 0x198f45fd, 0x12814cf0, 0xcb3bab6b, 0xc035a266, 0xdd27b971, 0xd629b07c, 0xe7038f5f, 0xec0d8652, 0xf11f9d45, 0xfa119448, 0x934be303, 0x9845ea0e, 0x8557f119, 0x8e59f814, 0xbf73c737, 0xb47dce3a, 0xa96fd52d, 0xa261dc20, 0xf6ad766d, 0xfda37f60, 0xe0b16477, 0xebbf6d7a, 0xda955259, 0xd19b5b54, 0xcc894043, 0xc787494e, 0xaedd3e05, 0xa5d33708, 0xb8c12c1f, 0xb3cf2512, 0x82e51a31, 0x89eb133c, 0x94f9082b, 0x9ff70126, 0x464de6bd, 0x4d43efb0, 0x5051f4a7, 0x5b5ffdaa, 0x6a75c289, 0x617bcb84, 0x7c69d093, 0x7767d99e, 0x1e3daed5, 0x1533a7d8, 0x0821bccf, 0x032fb5c2, 0x32058ae1, 0x390b83ec, 0x241998fb, 0x2f1791f6, 0x8d764dd6, 0x867844db, 0x9b6a5fcc, 0x906456c1, 0xa14e69e2, 0xaa4060ef, 0xb7527bf8, 0xbc5c72f5, 0xd50605be, 0xde080cb3, 0xc31a17a4, 0xc8141ea9, 0xf93e218a, 0xf2302887, 0xef223390, 0xe42c3a9d, 0x3d96dd06, 0x3698d40b, 0x2b8acf1c, 0x2084c611, 0x11aef932, 0x1aa0f03f, 0x07b2eb28, 0x0cbce225, 0x65e6956e, 0x6ee89c63, 0x73fa8774, 0x78f48e79, 0x49deb15a, 0x42d0b857, 0x5fc2a340, 0x54ccaa4d, 0xf741ecda, 0xfc4fe5d7, 0xe15dfec0, 0xea53f7cd, 0xdb79c8ee, 0xd077c1e3, 0xcd65daf4, 0xc66bd3f9, 0xaf31a4b2, 0xa43fadbf, 0xb92db6a8, 0xb223bfa5, 0x83098086, 0x8807898b, 0x9515929c, 0x9e1b9b91, 0x47a17c0a, 0x4caf7507, 0x51bd6e10, 0x5ab3671d, 0x6b99583e, 0x60975133, 0x7d854a24, 0x768b4329, 0x1fd13462, 0x14df3d6f, 0x09cd2678, 0x02c32f75, 0x33e91056, 0x38e7195b, 0x25f5024c, 0x2efb0b41, 0x8c9ad761, 0x8794de6c, 0x9a86c57b, 0x9188cc76, 0xa0a2f355, 0xabacfa58, 0xb6bee14f, 0xbdb0e842, 0xd4ea9f09, 0xdfe49604, 0xc2f68d13, 0xc9f8841e, 0xf8d2bb3d, 0xf3dcb230, 0xeecea927, 0xe5c0a02a, 0x3c7a47b1, 0x37744ebc, 0x2a6655ab, 0x21685ca6, 0x10426385, 0x1b4c6a88, 0x065e719f, 0x0d507892, 0x640a0fd9, 0x6f0406d4, 0x72161dc3, 0x791814ce, 0x48322bed, 0x433c22e0, 0x5e2e39f7, 0x552030fa, 0x01ec9ab7, 0x0ae293ba, 0x17f088ad, 0x1cfe81a0, 0x2dd4be83, 0x26dab78e, 0x3bc8ac99, 0x30c6a594, 0x599cd2df, 0x5292dbd2, 0x4f80c0c5, 0x448ec9c8, 0x75a4f6eb, 0x7eaaffe6, 0x63b8e4f1, 0x68b6edfc, 0xb10c0a67, 0xba02036a, 0xa710187d, 0xac1e1170, 0x9d342e53, 0x963a275e, 0x8b283c49, 0x80263544, 0xe97c420f, 0xe2724b02, 0xff605015, 0xf46e5918, 0xc544663b, 0xce4a6f36, 0xd3587421, 0xd8567d2c, 0x7a37a10c, 0x7139a801, 0x6c2bb316, 0x6725ba1b, 0x560f8538, 0x5d018c35, 0x40139722, 0x4b1d9e2f, 0x2247e964, 0x2949e069, 0x345bfb7e, 0x3f55f273, 0x0e7fcd50, 0x0571c45d, 0x1863df4a, 0x136dd647, 0xcad731dc, 0xc1d938d1, 0xdccb23c6, 0xd7c52acb, 0xe6ef15e8, 0xede11ce5, 0xf0f307f2, 0xfbfd0eff, 0x92a779b4, 0x99a970b9, 0x84bb6bae, 0x8fb562a3, 0xbe9f5d80, 0xb591548d, 0xa8834f9a, 0xa38d4697]; -const U3 = [0x00000000, 0x0d0b0e09, 0x1a161c12, 0x171d121b, 0x342c3824, 0x3927362d, 0x2e3a2436, 0x23312a3f, 0x68587048, 0x65537e41, 0x724e6c5a, 0x7f456253, 0x5c74486c, 0x517f4665, 0x4662547e, 0x4b695a77, 0xd0b0e090, 0xddbbee99, 0xcaa6fc82, 0xc7adf28b, 0xe49cd8b4, 0xe997d6bd, 0xfe8ac4a6, 0xf381caaf, 0xb8e890d8, 0xb5e39ed1, 0xa2fe8cca, 0xaff582c3, 0x8cc4a8fc, 0x81cfa6f5, 0x96d2b4ee, 0x9bd9bae7, 0xbb7bdb3b, 0xb670d532, 0xa16dc729, 0xac66c920, 0x8f57e31f, 0x825ced16, 0x9541ff0d, 0x984af104, 0xd323ab73, 0xde28a57a, 0xc935b761, 0xc43eb968, 0xe70f9357, 0xea049d5e, 0xfd198f45, 0xf012814c, 0x6bcb3bab, 0x66c035a2, 0x71dd27b9, 0x7cd629b0, 0x5fe7038f, 0x52ec0d86, 0x45f11f9d, 0x48fa1194, 0x03934be3, 0x0e9845ea, 0x198557f1, 0x148e59f8, 0x37bf73c7, 0x3ab47dce, 0x2da96fd5, 0x20a261dc, 0x6df6ad76, 0x60fda37f, 0x77e0b164, 0x7aebbf6d, 0x59da9552, 0x54d19b5b, 0x43cc8940, 0x4ec78749, 0x05aedd3e, 0x08a5d337, 0x1fb8c12c, 0x12b3cf25, 0x3182e51a, 0x3c89eb13, 0x2b94f908, 0x269ff701, 0xbd464de6, 0xb04d43ef, 0xa75051f4, 0xaa5b5ffd, 0x896a75c2, 0x84617bcb, 0x937c69d0, 0x9e7767d9, 0xd51e3dae, 0xd81533a7, 0xcf0821bc, 0xc2032fb5, 0xe132058a, 0xec390b83, 0xfb241998, 0xf62f1791, 0xd68d764d, 0xdb867844, 0xcc9b6a5f, 0xc1906456, 0xe2a14e69, 0xefaa4060, 0xf8b7527b, 0xf5bc5c72, 0xbed50605, 0xb3de080c, 0xa4c31a17, 0xa9c8141e, 0x8af93e21, 0x87f23028, 0x90ef2233, 0x9de42c3a, 0x063d96dd, 0x0b3698d4, 0x1c2b8acf, 0x112084c6, 0x3211aef9, 0x3f1aa0f0, 0x2807b2eb, 0x250cbce2, 0x6e65e695, 0x636ee89c, 0x7473fa87, 0x7978f48e, 0x5a49deb1, 0x5742d0b8, 0x405fc2a3, 0x4d54ccaa, 0xdaf741ec, 0xd7fc4fe5, 0xc0e15dfe, 0xcdea53f7, 0xeedb79c8, 0xe3d077c1, 0xf4cd65da, 0xf9c66bd3, 0xb2af31a4, 0xbfa43fad, 0xa8b92db6, 0xa5b223bf, 0x86830980, 0x8b880789, 0x9c951592, 0x919e1b9b, 0x0a47a17c, 0x074caf75, 0x1051bd6e, 0x1d5ab367, 0x3e6b9958, 0x33609751, 0x247d854a, 0x29768b43, 0x621fd134, 0x6f14df3d, 0x7809cd26, 0x7502c32f, 0x5633e910, 0x5b38e719, 0x4c25f502, 0x412efb0b, 0x618c9ad7, 0x6c8794de, 0x7b9a86c5, 0x769188cc, 0x55a0a2f3, 0x58abacfa, 0x4fb6bee1, 0x42bdb0e8, 0x09d4ea9f, 0x04dfe496, 0x13c2f68d, 0x1ec9f884, 0x3df8d2bb, 0x30f3dcb2, 0x27eecea9, 0x2ae5c0a0, 0xb13c7a47, 0xbc37744e, 0xab2a6655, 0xa621685c, 0x85104263, 0x881b4c6a, 0x9f065e71, 0x920d5078, 0xd9640a0f, 0xd46f0406, 0xc372161d, 0xce791814, 0xed48322b, 0xe0433c22, 0xf75e2e39, 0xfa552030, 0xb701ec9a, 0xba0ae293, 0xad17f088, 0xa01cfe81, 0x832dd4be, 0x8e26dab7, 0x993bc8ac, 0x9430c6a5, 0xdf599cd2, 0xd25292db, 0xc54f80c0, 0xc8448ec9, 0xeb75a4f6, 0xe67eaaff, 0xf163b8e4, 0xfc68b6ed, 0x67b10c0a, 0x6aba0203, 0x7da71018, 0x70ac1e11, 0x539d342e, 0x5e963a27, 0x498b283c, 0x44802635, 0x0fe97c42, 0x02e2724b, 0x15ff6050, 0x18f46e59, 0x3bc54466, 0x36ce4a6f, 0x21d35874, 0x2cd8567d, 0x0c7a37a1, 0x017139a8, 0x166c2bb3, 0x1b6725ba, 0x38560f85, 0x355d018c, 0x22401397, 0x2f4b1d9e, 0x642247e9, 0x692949e0, 0x7e345bfb, 0x733f55f2, 0x500e7fcd, 0x5d0571c4, 0x4a1863df, 0x47136dd6, 0xdccad731, 0xd1c1d938, 0xc6dccb23, 0xcbd7c52a, 0xe8e6ef15, 0xe5ede11c, 0xf2f0f307, 0xfffbfd0e, 0xb492a779, 0xb999a970, 0xae84bb6b, 0xa38fb562, 0x80be9f5d, 0x8db59154, 0x9aa8834f, 0x97a38d46]; -const U4 = [0x00000000, 0x090d0b0e, 0x121a161c, 0x1b171d12, 0x24342c38, 0x2d392736, 0x362e3a24, 0x3f23312a, 0x48685870, 0x4165537e, 0x5a724e6c, 0x537f4562, 0x6c5c7448, 0x65517f46, 0x7e466254, 0x774b695a, 0x90d0b0e0, 0x99ddbbee, 0x82caa6fc, 0x8bc7adf2, 0xb4e49cd8, 0xbde997d6, 0xa6fe8ac4, 0xaff381ca, 0xd8b8e890, 0xd1b5e39e, 0xcaa2fe8c, 0xc3aff582, 0xfc8cc4a8, 0xf581cfa6, 0xee96d2b4, 0xe79bd9ba, 0x3bbb7bdb, 0x32b670d5, 0x29a16dc7, 0x20ac66c9, 0x1f8f57e3, 0x16825ced, 0x0d9541ff, 0x04984af1, 0x73d323ab, 0x7ade28a5, 0x61c935b7, 0x68c43eb9, 0x57e70f93, 0x5eea049d, 0x45fd198f, 0x4cf01281, 0xab6bcb3b, 0xa266c035, 0xb971dd27, 0xb07cd629, 0x8f5fe703, 0x8652ec0d, 0x9d45f11f, 0x9448fa11, 0xe303934b, 0xea0e9845, 0xf1198557, 0xf8148e59, 0xc737bf73, 0xce3ab47d, 0xd52da96f, 0xdc20a261, 0x766df6ad, 0x7f60fda3, 0x6477e0b1, 0x6d7aebbf, 0x5259da95, 0x5b54d19b, 0x4043cc89, 0x494ec787, 0x3e05aedd, 0x3708a5d3, 0x2c1fb8c1, 0x2512b3cf, 0x1a3182e5, 0x133c89eb, 0x082b94f9, 0x01269ff7, 0xe6bd464d, 0xefb04d43, 0xf4a75051, 0xfdaa5b5f, 0xc2896a75, 0xcb84617b, 0xd0937c69, 0xd99e7767, 0xaed51e3d, 0xa7d81533, 0xbccf0821, 0xb5c2032f, 0x8ae13205, 0x83ec390b, 0x98fb2419, 0x91f62f17, 0x4dd68d76, 0x44db8678, 0x5fcc9b6a, 0x56c19064, 0x69e2a14e, 0x60efaa40, 0x7bf8b752, 0x72f5bc5c, 0x05bed506, 0x0cb3de08, 0x17a4c31a, 0x1ea9c814, 0x218af93e, 0x2887f230, 0x3390ef22, 0x3a9de42c, 0xdd063d96, 0xd40b3698, 0xcf1c2b8a, 0xc6112084, 0xf93211ae, 0xf03f1aa0, 0xeb2807b2, 0xe2250cbc, 0x956e65e6, 0x9c636ee8, 0x877473fa, 0x8e7978f4, 0xb15a49de, 0xb85742d0, 0xa3405fc2, 0xaa4d54cc, 0xecdaf741, 0xe5d7fc4f, 0xfec0e15d, 0xf7cdea53, 0xc8eedb79, 0xc1e3d077, 0xdaf4cd65, 0xd3f9c66b, 0xa4b2af31, 0xadbfa43f, 0xb6a8b92d, 0xbfa5b223, 0x80868309, 0x898b8807, 0x929c9515, 0x9b919e1b, 0x7c0a47a1, 0x75074caf, 0x6e1051bd, 0x671d5ab3, 0x583e6b99, 0x51336097, 0x4a247d85, 0x4329768b, 0x34621fd1, 0x3d6f14df, 0x267809cd, 0x2f7502c3, 0x105633e9, 0x195b38e7, 0x024c25f5, 0x0b412efb, 0xd7618c9a, 0xde6c8794, 0xc57b9a86, 0xcc769188, 0xf355a0a2, 0xfa58abac, 0xe14fb6be, 0xe842bdb0, 0x9f09d4ea, 0x9604dfe4, 0x8d13c2f6, 0x841ec9f8, 0xbb3df8d2, 0xb230f3dc, 0xa927eece, 0xa02ae5c0, 0x47b13c7a, 0x4ebc3774, 0x55ab2a66, 0x5ca62168, 0x63851042, 0x6a881b4c, 0x719f065e, 0x78920d50, 0x0fd9640a, 0x06d46f04, 0x1dc37216, 0x14ce7918, 0x2bed4832, 0x22e0433c, 0x39f75e2e, 0x30fa5520, 0x9ab701ec, 0x93ba0ae2, 0x88ad17f0, 0x81a01cfe, 0xbe832dd4, 0xb78e26da, 0xac993bc8, 0xa59430c6, 0xd2df599c, 0xdbd25292, 0xc0c54f80, 0xc9c8448e, 0xf6eb75a4, 0xffe67eaa, 0xe4f163b8, 0xedfc68b6, 0x0a67b10c, 0x036aba02, 0x187da710, 0x1170ac1e, 0x2e539d34, 0x275e963a, 0x3c498b28, 0x35448026, 0x420fe97c, 0x4b02e272, 0x5015ff60, 0x5918f46e, 0x663bc544, 0x6f36ce4a, 0x7421d358, 0x7d2cd856, 0xa10c7a37, 0xa8017139, 0xb3166c2b, 0xba1b6725, 0x8538560f, 0x8c355d01, 0x97224013, 0x9e2f4b1d, 0xe9642247, 0xe0692949, 0xfb7e345b, 0xf2733f55, 0xcd500e7f, 0xc45d0571, 0xdf4a1863, 0xd647136d, 0x31dccad7, 0x38d1c1d9, 0x23c6dccb, 0x2acbd7c5, 0x15e8e6ef, 0x1ce5ede1, 0x07f2f0f3, 0x0efffbfd, 0x79b492a7, 0x70b999a9, 0x6bae84bb, 0x62a38fb5, 0x5d80be9f, 0x548db591, 0x4f9aa883, 0x4697a38d]; -function convertToInt32(bytes) { - const result = []; - for (let i = 0; i < bytes.length; i += 4) { - result.push((bytes[i] << 24) | (bytes[i + 1] << 16) | (bytes[i + 2] << 8) | bytes[i + 3]); - } - return result; -} -class AES { - get key() { return __classPrivateFieldGet(this, _AES_key, "f").slice(); } - constructor(key) { - _AES_key.set(this, void 0); - _AES_Kd.set(this, void 0); - _AES_Ke.set(this, void 0); - if (!(this instanceof AES)) { - throw Error('AES must be instanitated with `new`'); - } - __classPrivateFieldSet(this, _AES_key, new Uint8Array(key), "f"); - const rounds = numberOfRounds[this.key.length]; - if (rounds == null) { - throw new TypeError('invalid key size (must be 16, 24 or 32 bytes)'); - } - // encryption round keys - __classPrivateFieldSet(this, _AES_Ke, [], "f"); - // decryption round keys - __classPrivateFieldSet(this, _AES_Kd, [], "f"); - for (let i = 0; i <= rounds; i++) { - __classPrivateFieldGet(this, _AES_Ke, "f").push([0, 0, 0, 0]); - __classPrivateFieldGet(this, _AES_Kd, "f").push([0, 0, 0, 0]); - } - const roundKeyCount = (rounds + 1) * 4; - const KC = this.key.length / 4; - // convert the key into ints - const tk = convertToInt32(this.key); - // copy values into round key arrays - let index; - for (let i = 0; i < KC; i++) { - index = i >> 2; - __classPrivateFieldGet(this, _AES_Ke, "f")[index][i % 4] = tk[i]; - __classPrivateFieldGet(this, _AES_Kd, "f")[rounds - index][i % 4] = tk[i]; - } - // key expansion (fips-197 section 5.2) - let rconpointer = 0; - let t = KC, tt; - while (t < roundKeyCount) { - tt = tk[KC - 1]; - tk[0] ^= ((S[(tt >> 16) & 0xFF] << 24) ^ - (S[(tt >> 8) & 0xFF] << 16) ^ - (S[tt & 0xFF] << 8) ^ - S[(tt >> 24) & 0xFF] ^ - (rcon[rconpointer] << 24)); - rconpointer += 1; - // key expansion (for non-256 bit) - if (KC != 8) { - for (let i = 1; i < KC; i++) { - tk[i] ^= tk[i - 1]; - } - // key expansion for 256-bit keys is "slightly different" (fips-197) - } - else { - for (let i = 1; i < (KC / 2); i++) { - tk[i] ^= tk[i - 1]; - } - tt = tk[(KC / 2) - 1]; - tk[KC / 2] ^= (S[tt & 0xFF] ^ - (S[(tt >> 8) & 0xFF] << 8) ^ - (S[(tt >> 16) & 0xFF] << 16) ^ - (S[(tt >> 24) & 0xFF] << 24)); - for (let i = (KC / 2) + 1; i < KC; i++) { - tk[i] ^= tk[i - 1]; - } - } - // copy values into round key arrays - let i = 0, r, c; - while (i < KC && t < roundKeyCount) { - r = t >> 2; - c = t % 4; - __classPrivateFieldGet(this, _AES_Ke, "f")[r][c] = tk[i]; - __classPrivateFieldGet(this, _AES_Kd, "f")[rounds - r][c] = tk[i++]; - t++; - } - } - // inverse-cipher-ify the decryption round key (fips-197 section 5.3) - for (let r = 1; r < rounds; r++) { - for (let c = 0; c < 4; c++) { - tt = __classPrivateFieldGet(this, _AES_Kd, "f")[r][c]; - __classPrivateFieldGet(this, _AES_Kd, "f")[r][c] = (U1[(tt >> 24) & 0xFF] ^ - U2[(tt >> 16) & 0xFF] ^ - U3[(tt >> 8) & 0xFF] ^ - U4[tt & 0xFF]); - } - } - } - encrypt(plaintext) { - if (plaintext.length != 16) { - throw new TypeError('invalid plaintext size (must be 16 bytes)'); - } - const rounds = __classPrivateFieldGet(this, _AES_Ke, "f").length - 1; - const a = [0, 0, 0, 0]; - // convert plaintext to (ints ^ key) - let t = convertToInt32(plaintext); - for (let i = 0; i < 4; i++) { - t[i] ^= __classPrivateFieldGet(this, _AES_Ke, "f")[0][i]; - } - // apply round transforms - for (let r = 1; r < rounds; r++) { - for (let i = 0; i < 4; i++) { - a[i] = (T1[(t[i] >> 24) & 0xff] ^ - T2[(t[(i + 1) % 4] >> 16) & 0xff] ^ - T3[(t[(i + 2) % 4] >> 8) & 0xff] ^ - T4[t[(i + 3) % 4] & 0xff] ^ - __classPrivateFieldGet(this, _AES_Ke, "f")[r][i]); - } - t = a.slice(); - } - // the last round is special - const result = new Uint8Array(16); - let tt = 0; - for (let i = 0; i < 4; i++) { - tt = __classPrivateFieldGet(this, _AES_Ke, "f")[rounds][i]; - result[4 * i] = (S[(t[i] >> 24) & 0xff] ^ (tt >> 24)) & 0xff; - result[4 * i + 1] = (S[(t[(i + 1) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff; - result[4 * i + 2] = (S[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff; - result[4 * i + 3] = (S[t[(i + 3) % 4] & 0xff] ^ tt) & 0xff; - } - return result; - } - decrypt(ciphertext) { - if (ciphertext.length != 16) { - throw new TypeError('invalid ciphertext size (must be 16 bytes)'); - } - const rounds = __classPrivateFieldGet(this, _AES_Kd, "f").length - 1; - const a = [0, 0, 0, 0]; - // convert plaintext to (ints ^ key) - let t = convertToInt32(ciphertext); - for (let i = 0; i < 4; i++) { - t[i] ^= __classPrivateFieldGet(this, _AES_Kd, "f")[0][i]; - } - // apply round transforms - for (let r = 1; r < rounds; r++) { - for (let i = 0; i < 4; i++) { - a[i] = (T5[(t[i] >> 24) & 0xff] ^ - T6[(t[(i + 3) % 4] >> 16) & 0xff] ^ - T7[(t[(i + 2) % 4] >> 8) & 0xff] ^ - T8[t[(i + 1) % 4] & 0xff] ^ - __classPrivateFieldGet(this, _AES_Kd, "f")[r][i]); - } - t = a.slice(); - } - // the last round is special - const result = new Uint8Array(16); - let tt = 0; - for (let i = 0; i < 4; i++) { - tt = __classPrivateFieldGet(this, _AES_Kd, "f")[rounds][i]; - result[4 * i] = (Si[(t[i] >> 24) & 0xff] ^ (tt >> 24)) & 0xff; - result[4 * i + 1] = (Si[(t[(i + 3) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff; - result[4 * i + 2] = (Si[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff; - result[4 * i + 3] = (Si[t[(i + 1) % 4] & 0xff] ^ tt) & 0xff; - } - return result; - } -} -exports.AES = AES; -_AES_key = new WeakMap(), _AES_Kd = new WeakMap(), _AES_Ke = new WeakMap(); -//# sourceMappingURL=aes.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/aes.js.map b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/aes.js.map deleted file mode 100644 index 765908a2..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/aes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"aes.js","sourceRoot":"","sources":["../src.ts/aes.ts"],"names":[],"mappings":";AAAA,uFAAuF;;;;;;;;;;;;;;;AAEvF,8BAA8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/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/index.d.ts b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/index.d.ts deleted file mode 100644 index 95618a7a..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export { AES } from "./aes.js"; -export { ModeOfOperation } from "./mode.js"; -export { CBC } from "./mode-cbc.js"; -export { CFB } from "./mode-cfb.js"; -export { CTR } from "./mode-ctr.js"; -export { ECB } from "./mode-ecb.js"; -export { OFB } from "./mode-ofb.js"; -export { pkcs7Pad, pkcs7Strip } from "./padding.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/index.d.ts.map b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/index.d.ts.map deleted file mode 100644 index 376752cb..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src.ts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEpC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/index.js b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/index.js deleted file mode 100644 index fc5e4319..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/index.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.pkcs7Strip = exports.pkcs7Pad = exports.OFB = exports.ECB = exports.CTR = exports.CFB = exports.CBC = exports.ModeOfOperation = exports.AES = void 0; -var aes_js_1 = require("./aes.js"); -Object.defineProperty(exports, "AES", { enumerable: true, get: function () { return aes_js_1.AES; } }); -var mode_js_1 = require("./mode.js"); -Object.defineProperty(exports, "ModeOfOperation", { enumerable: true, get: function () { return mode_js_1.ModeOfOperation; } }); -var mode_cbc_js_1 = require("./mode-cbc.js"); -Object.defineProperty(exports, "CBC", { enumerable: true, get: function () { return mode_cbc_js_1.CBC; } }); -var mode_cfb_js_1 = require("./mode-cfb.js"); -Object.defineProperty(exports, "CFB", { enumerable: true, get: function () { return mode_cfb_js_1.CFB; } }); -var mode_ctr_js_1 = require("./mode-ctr.js"); -Object.defineProperty(exports, "CTR", { enumerable: true, get: function () { return mode_ctr_js_1.CTR; } }); -var mode_ecb_js_1 = require("./mode-ecb.js"); -Object.defineProperty(exports, "ECB", { enumerable: true, get: function () { return mode_ecb_js_1.ECB; } }); -var mode_ofb_js_1 = require("./mode-ofb.js"); -Object.defineProperty(exports, "OFB", { enumerable: true, get: function () { return mode_ofb_js_1.OFB; } }); -var padding_js_1 = require("./padding.js"); -Object.defineProperty(exports, "pkcs7Pad", { enumerable: true, get: function () { return padding_js_1.pkcs7Pad; } }); -Object.defineProperty(exports, "pkcs7Strip", { enumerable: true, get: function () { return padding_js_1.pkcs7Strip; } }); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/index.js.map b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/index.js.map deleted file mode 100644 index c363b794..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src.ts/index.ts"],"names":[],"mappings":";;;AAAA,mCAA+B;AAAtB,6FAAA,GAAG,OAAA;AAEZ,qCAA4C;AAAnC,0GAAA,eAAe,OAAA;AAExB,6CAAoC;AAA3B,kGAAA,GAAG,OAAA;AACZ,6CAAoC;AAA3B,kGAAA,GAAG,OAAA;AACZ,6CAAoC;AAA3B,kGAAA,GAAG,OAAA;AACZ,6CAAoC;AAA3B,kGAAA,GAAG,OAAA;AACZ,6CAAoC;AAA3B,kGAAA,GAAG,OAAA;AAEZ,2CAAoD;AAA3C,sGAAA,QAAQ,OAAA;AAAE,wGAAA,UAAU,OAAA"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-cbc.d.ts b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-cbc.d.ts deleted file mode 100644 index 0ec7fae5..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-cbc.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ModeOfOperation } from "./mode.js"; -export declare class CBC extends ModeOfOperation { - #private; - constructor(key: Uint8Array, iv?: Uint8Array); - get iv(): Uint8Array; - encrypt(plaintext: Uint8Array): Uint8Array; - decrypt(ciphertext: Uint8Array): Uint8Array; -} -//# sourceMappingURL=mode-cbc.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-cbc.d.ts.map b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-cbc.d.ts.map deleted file mode 100644 index 60cb871d..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-cbc.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mode-cbc.d.ts","sourceRoot":"","sources":["../src.ts/mode-cbc.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,qBAAa,GAAI,SAAQ,eAAe;;gBAI1B,GAAG,EAAE,UAAU,EAAE,EAAE,CAAC,EAAE,UAAU;IAe5C,IAAI,EAAE,IAAI,UAAU,CAAqC;IAEzD,OAAO,CAAC,SAAS,EAAE,UAAU,GAAG,UAAU;IAkB1C,OAAO,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU;CAiB5C"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-cbc.js b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-cbc.js deleted file mode 100644 index e9873c84..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-cbc.js +++ /dev/null @@ -1,66 +0,0 @@ -"use strict"; -// Cipher Block Chaining -var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; -}; -var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -}; -var _CBC_iv, _CBC_lastBlock; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.CBC = void 0; -const mode_js_1 = require("./mode.js"); -class CBC extends mode_js_1.ModeOfOperation { - constructor(key, iv) { - super("ECC", key, CBC); - _CBC_iv.set(this, void 0); - _CBC_lastBlock.set(this, void 0); - if (iv) { - if (iv.length % 16) { - throw new TypeError("invalid iv size (must be 16 bytes)"); - } - __classPrivateFieldSet(this, _CBC_iv, new Uint8Array(iv), "f"); - } - else { - __classPrivateFieldSet(this, _CBC_iv, new Uint8Array(16), "f"); - } - __classPrivateFieldSet(this, _CBC_lastBlock, this.iv, "f"); - } - get iv() { return new Uint8Array(__classPrivateFieldGet(this, _CBC_iv, "f")); } - encrypt(plaintext) { - if (plaintext.length % 16) { - throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)"); - } - const ciphertext = new Uint8Array(plaintext.length); - for (let i = 0; i < plaintext.length; i += 16) { - for (let j = 0; j < 16; j++) { - __classPrivateFieldGet(this, _CBC_lastBlock, "f")[j] ^= plaintext[i + j]; - } - __classPrivateFieldSet(this, _CBC_lastBlock, this.aes.encrypt(__classPrivateFieldGet(this, _CBC_lastBlock, "f")), "f"); - ciphertext.set(__classPrivateFieldGet(this, _CBC_lastBlock, "f"), i); - } - return ciphertext; - } - decrypt(ciphertext) { - if (ciphertext.length % 16) { - throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)"); - } - const plaintext = new Uint8Array(ciphertext.length); - for (let i = 0; i < ciphertext.length; i += 16) { - const block = this.aes.decrypt(ciphertext.subarray(i, i + 16)); - for (let j = 0; j < 16; j++) { - plaintext[i + j] = block[j] ^ __classPrivateFieldGet(this, _CBC_lastBlock, "f")[j]; - __classPrivateFieldGet(this, _CBC_lastBlock, "f")[j] = ciphertext[i + j]; - } - } - return plaintext; - } -} -exports.CBC = CBC; -_CBC_iv = new WeakMap(), _CBC_lastBlock = new WeakMap(); -//# sourceMappingURL=mode-cbc.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-cbc.js.map b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-cbc.js.map deleted file mode 100644 index 76e188ee..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-cbc.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mode-cbc.js","sourceRoot":"","sources":["../src.ts/mode-cbc.ts"],"names":[],"mappings":";AAAA,wBAAwB;;;;;;;;;;;;;;;AAExB,uCAA4C;AAE5C,MAAa,GAAI,SA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,CAAC,CAAC;SACpC;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,OAAO,CAAC,UAAsB;QAC5B,IAAI,UAAU,CAAC,MAAM,GAAG,EAAE,EAAE;YACxB,MAAM,IAAI,SAAS,CAAC,wDAAwD,CAAC,CAAC;SACjF;QAED,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACpD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;YAC5C,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;YAE/D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE;gBAC3B,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,uBAAA,IAAI,sBAAW,CAAC,CAAC,CAAC,CAAC;gBACjD,uBAAA,IAAI,sBAAW,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;aACxC;SACJ;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AAxDD,kBAwDC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-cfb.d.ts b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-cfb.d.ts deleted file mode 100644 index 86d0ea3e..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-cfb.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { ModeOfOperation } from "./mode.js"; -export declare class CFB extends ModeOfOperation { - #private; - readonly segmentSize: number; - constructor(key: Uint8Array, iv?: Uint8Array, segmentSize?: number); - get iv(): Uint8Array; - encrypt(plaintext: Uint8Array): Uint8Array; - decrypt(ciphertext: Uint8Array): Uint8Array; -} -//# sourceMappingURL=mode-cfb.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-cfb.d.ts.map b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-cfb.d.ts.map deleted file mode 100644 index 7e08a59f..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-cfb.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mode-cfb.d.ts","sourceRoot":"","sources":["../src.ts/mode-cfb.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,qBAAa,GAAI,SAAQ,eAAe;;IAItC,QAAQ,CAAC,WAAW,EAAG,MAAM,CAAC;gBAElB,GAAG,EAAE,UAAU,EAAE,EAAE,CAAC,EAAE,UAAU,EAAE,WAAW,GAAE,MAAU;IAwBrE,IAAI,EAAE,IAAI,UAAU,CAAqC;IAUzD,OAAO,CAAC,SAAS,EAAE,UAAU,GAAG,UAAU;IAqB1C,OAAO,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU;CAoB5C"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-cfb.js b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-cfb.js deleted file mode 100644 index 8dd6b43a..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-cfb.js +++ /dev/null @@ -1,81 +0,0 @@ -"use strict"; -// Cipher Feedback -var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; -}; -var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -}; -var _CFB_instances, _CFB_iv, _CFB_shiftRegister, _CFB_shift; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.CFB = void 0; -const mode_js_1 = require("./mode.js"); -class CFB extends mode_js_1.ModeOfOperation { - constructor(key, iv, segmentSize = 8) { - super("CFB", key, CFB); - _CFB_instances.add(this); - _CFB_iv.set(this, void 0); - _CFB_shiftRegister.set(this, void 0); - // This library currently only handles byte-aligned segmentSize - if (!Number.isInteger(segmentSize) || (segmentSize % 8)) { - throw new TypeError("invalid segmentSize"); - } - Object.defineProperties(this, { - segmentSize: { enumerable: true, value: segmentSize } - }); - if (iv) { - if (iv.length % 16) { - throw new TypeError("invalid iv size (must be 16 bytes)"); - } - __classPrivateFieldSet(this, _CFB_iv, new Uint8Array(iv), "f"); - } - else { - __classPrivateFieldSet(this, _CFB_iv, new Uint8Array(16), "f"); - } - __classPrivateFieldSet(this, _CFB_shiftRegister, this.iv, "f"); - } - get iv() { return new Uint8Array(__classPrivateFieldGet(this, _CFB_iv, "f")); } - encrypt(plaintext) { - if (8 * plaintext.length % this.segmentSize) { - throw new TypeError("invalid plaintext size (must be multiple of segmentSize bytes)"); - } - const segmentSize = this.segmentSize / 8; - const ciphertext = new Uint8Array(plaintext); - for (let i = 0; i < ciphertext.length; i += segmentSize) { - const xorSegment = this.aes.encrypt(__classPrivateFieldGet(this, _CFB_shiftRegister, "f")); - for (let j = 0; j < segmentSize; j++) { - ciphertext[i + j] ^= xorSegment[j]; - } - __classPrivateFieldGet(this, _CFB_instances, "m", _CFB_shift).call(this, ciphertext.subarray(i)); - } - return ciphertext; - } - decrypt(ciphertext) { - if (8 * ciphertext.length % this.segmentSize) { - throw new TypeError("invalid ciphertext size (must be multiple of segmentSize bytes)"); - } - const segmentSize = this.segmentSize / 8; - const plaintext = new Uint8Array(ciphertext); - for (let i = 0; i < plaintext.length; i += segmentSize) { - const xorSegment = this.aes.encrypt(__classPrivateFieldGet(this, _CFB_shiftRegister, "f")); - for (let j = 0; j < segmentSize; j++) { - plaintext[i + j] ^= xorSegment[j]; - } - __classPrivateFieldGet(this, _CFB_instances, "m", _CFB_shift).call(this, ciphertext.subarray(i)); - } - return plaintext; - } -} -exports.CFB = CFB; -_CFB_iv = new WeakMap(), _CFB_shiftRegister = new WeakMap(), _CFB_instances = new WeakSet(), _CFB_shift = function _CFB_shift(data) { - const segmentSize = this.segmentSize / 8; - // Shift the register - __classPrivateFieldGet(this, _CFB_shiftRegister, "f").set(__classPrivateFieldGet(this, _CFB_shiftRegister, "f").subarray(segmentSize)); - __classPrivateFieldGet(this, _CFB_shiftRegister, "f").set(data.subarray(0, segmentSize), 16 - segmentSize); -}; -//# sourceMappingURL=mode-cfb.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-cfb.js.map b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-cfb.js.map deleted file mode 100644 index af431d90..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-cfb.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mode-cfb.js","sourceRoot":"","sources":["../src.ts/mode-cfb.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;;;;;;;;;;;;;AAElB,uCAA4C;AAE5C,MAAa,GAAI,SAAQ,yBAAe;IAMtC,YAAY,GAAe,EAAE,EAAe,EAAE,cAAsB,CAAC;QACnE,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;;QANzB,0BAAgB;QAChB,qCAA2B;QAOzB,+DAA+D;QAC/D,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,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C;IACnE,uBAAA,IAAI,0BAAe,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,WAAW,CAAC,EAAE,EAAE,GAAG,WAAW,CAAC,CAAC;AAC3E,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ctr.d.ts b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ctr.d.ts deleted file mode 100644 index fda6de3c..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ctr.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { ModeOfOperation } from "./mode.js"; -export declare class CTR extends ModeOfOperation { - #private; - constructor(key: Uint8Array, initialValue?: number | Uint8Array); - get counter(): Uint8Array; - setCounterValue(value: number): void; - setCounterBytes(value: Uint8Array): void; - increment(): void; - encrypt(plaintext: Uint8Array): Uint8Array; - decrypt(ciphertext: Uint8Array): Uint8Array; -} -//# sourceMappingURL=mode-ctr.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ctr.d.ts.map b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ctr.d.ts.map deleted file mode 100644 index 604f481f..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ctr.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mode-ctr.d.ts","sourceRoot":"","sources":["../src.ts/mode-ctr.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,qBAAa,GAAI,SAAQ,eAAe;;gBAS1B,GAAG,EAAE,UAAU,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,UAAU;IAkB/D,IAAI,OAAO,IAAI,UAAU,CAA0C;IAEnE,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAWpC,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAQxC,SAAS;IAWT,OAAO,CAAC,SAAS,EAAE,UAAU,GAAG,UAAU;IAe1C,OAAO,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU;CAG5C"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ctr.js b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ctr.js deleted file mode 100644 index a1f9bbf6..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ctr.js +++ /dev/null @@ -1,86 +0,0 @@ -"use strict"; -// Counter Mode -var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; -}; -var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -}; -var _CTR_remaining, _CTR_remainingIndex, _CTR_counter; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.CTR = void 0; -const mode_js_1 = require("./mode.js"); -class CTR extends mode_js_1.ModeOfOperation { - constructor(key, initialValue) { - super("CTR", key, CTR); - // Remaining bytes for the one-time pad - _CTR_remaining.set(this, void 0); - _CTR_remainingIndex.set(this, void 0); - // The current counter - _CTR_counter.set(this, void 0); - __classPrivateFieldSet(this, _CTR_counter, new Uint8Array(16), "f"); - __classPrivateFieldGet(this, _CTR_counter, "f").fill(0); - __classPrivateFieldSet(this, _CTR_remaining, __classPrivateFieldGet(this, _CTR_counter, "f"), "f"); // This will be discarded immediately - __classPrivateFieldSet(this, _CTR_remainingIndex, 16, "f"); - if (initialValue == null) { - initialValue = 1; - } - if (typeof (initialValue) === "number") { - this.setCounterValue(initialValue); - } - else { - this.setCounterBytes(initialValue); - } - } - get counter() { return new Uint8Array(__classPrivateFieldGet(this, _CTR_counter, "f")); } - setCounterValue(value) { - if (!Number.isInteger(value) || value < 0 || value > Number.MAX_SAFE_INTEGER) { - throw new TypeError("invalid counter initial integer value"); - } - for (let index = 15; index >= 0; --index) { - __classPrivateFieldGet(this, _CTR_counter, "f")[index] = value % 256; - value = Math.floor(value / 256); - } - } - setCounterBytes(value) { - if (value.length !== 16) { - throw new TypeError("invalid counter initial Uint8Array value length"); - } - __classPrivateFieldGet(this, _CTR_counter, "f").set(value); - } - increment() { - for (let i = 15; i >= 0; i--) { - if (__classPrivateFieldGet(this, _CTR_counter, "f")[i] === 255) { - __classPrivateFieldGet(this, _CTR_counter, "f")[i] = 0; - } - else { - __classPrivateFieldGet(this, _CTR_counter, "f")[i]++; - break; - } - } - } - encrypt(plaintext) { - var _a, _b; - const crypttext = new Uint8Array(plaintext); - for (let i = 0; i < crypttext.length; i++) { - if (__classPrivateFieldGet(this, _CTR_remainingIndex, "f") === 16) { - __classPrivateFieldSet(this, _CTR_remaining, this.aes.encrypt(__classPrivateFieldGet(this, _CTR_counter, "f")), "f"); - __classPrivateFieldSet(this, _CTR_remainingIndex, 0, "f"); - this.increment(); - } - crypttext[i] ^= __classPrivateFieldGet(this, _CTR_remaining, "f")[__classPrivateFieldSet(this, _CTR_remainingIndex, (_b = __classPrivateFieldGet(this, _CTR_remainingIndex, "f"), _a = _b++, _b), "f"), _a]; - } - return crypttext; - } - decrypt(ciphertext) { - return this.encrypt(ciphertext); - } -} -exports.CTR = CTR; -_CTR_remaining = new WeakMap(), _CTR_remainingIndex = new WeakMap(), _CTR_counter = new WeakMap(); -//# sourceMappingURL=mode-ctr.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ctr.js.map b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ctr.js.map deleted file mode 100644 index 63f370ee..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ctr.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mode-ctr.js","sourceRoot":"","sources":["../src.ts/mode-ctr.ts"],"names":[],"mappings":";AAAA,eAAe;;;;;;;;;;;;;;;AAEf,uCAA4C;AAE5C,MAAa,GAAI,SAAQ,yBAAe;IAStC,YAAY,GAAe,EAAE,YAAkC;QAC7D,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QARzB,uCAAuC;QACvC,iCAAuB;QACvB,sCAAwB;QAExB,sBAAsB;QACtB,+BAAqB;QAKnB,uBAAA,IAAI,gBAAY,IAAI,UAAU,CAAC,EAAE,CAAC,MAAA,CAAA;QAClC,uBAAA,IAAI,oBAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAEtB,uBAAA,IAAI,kBAAc,uBAAA,IAAI,oBAAS,MAAA,CAAC,CAAE,qCAAqC;QACvE,uBAAA,IAAI,uBAAmB,EAAE,MAAA,CAAC;QAE1B,IAAI,YAAY,IAAI,IAAI,EAAE;YAAE,YAAY,GAAG,CAAC,CAAC;SAAE;QAE/C,IAAI,OAAM,CAAC,YAAY,CAAC,KAAK,QAAQ,EAAE;YACrC,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;SACpC;aAAM;YACL,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;SACpC;IACH,CAAC;IAED,IAAI,OAAO,KAAiB,OAAO,IAAI,UAAU,CAAC,uBAAA,IAAI,oBAAS,CAAC,CAAC,CAAC,CAAC;IAEnE,eAAe,CAAC,KAAa;QAC3B,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,GAAG,MAAM,CAAC,gBAAgB,EA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gBACzB,IAAI,CAAC,SAAS,EAAE,CAAC;aAClB;YACD,SAAS,CAAC,CAAC,CAAC,IAAI,uBAAA,IAAI,sBAAW,CAAC,kDAAA,CAAA,2DAAoB,EAApB,KAAA,IAAsB,IAAA,CAAA,MAAA,IAAA,CAAC,CAAC;SACzD;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,CAAC,UAAsB;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAClC,CAAC;CACF;AA7ED,kBA6EC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ecb.d.ts b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ecb.d.ts deleted file mode 100644 index 0ca6eee3..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ecb.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ModeOfOperation } from "./mode.js"; -export declare class ECB extends ModeOfOperation { - constructor(key: Uint8Array); - encrypt(plaintext: Uint8Array): Uint8Array; - decrypt(crypttext: Uint8Array): Uint8Array; -} -//# sourceMappingURL=mode-ecb.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ecb.d.ts.map b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ecb.d.ts.map deleted file mode 100644 index 7229be70..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ecb.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mode-ecb.d.ts","sourceRoot":"","sources":["../src.ts/mode-ecb.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,qBAAa,GAAI,SAAQ,eAAe;gBAE1B,GAAG,EAAE,UAAU;IAI3B,OAAO,CAAC,SAAS,EAAE,UAAU,GAAG,UAAU;IAa1C,OAAO,CAAC,SAAS,EAAE,UAAU,GAAG,UAAU;CAY3C"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ecb.js b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ecb.js deleted file mode 100644 index e450c9bb..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ecb.js +++ /dev/null @@ -1,32 +0,0 @@ -"use strict"; -// Electronic Code Book -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ECB = void 0; -const mode_js_1 = require("./mode.js"); -class ECB extends mode_js_1.ModeOfOperation { - constructor(key) { - super("ECB", key, ECB); - } - encrypt(plaintext) { - if (plaintext.length % 16) { - throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)"); - } - const crypttext = new Uint8Array(plaintext.length); - for (let i = 0; i < plaintext.length; i += 16) { - crypttext.set(this.aes.encrypt(plaintext.subarray(i, i + 16)), i); - } - return crypttext; - } - decrypt(crypttext) { - if (crypttext.length % 16) { - throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)"); - } - const plaintext = new Uint8Array(crypttext.length); - for (let i = 0; i < crypttext.length; i += 16) { - plaintext.set(this.aes.decrypt(crypttext.subarray(i, i + 16)), i); - } - return plaintext; - } -} -exports.ECB = ECB; -//# sourceMappingURL=mode-ecb.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ecb.js.map b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ecb.js.map deleted file mode 100644 index 1c7a03b4..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ecb.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mode-ecb.js","sourceRoot":"","sources":["../src.ts/mode-ecb.ts"],"names":[],"mappings":";AAAA,uBAAuB;;;AAEvB,uCAA4C;AAE5C,MAAa,GAAI,SAAQ,yBAAe;IAEtC,YAAY,GAAe;QACzB,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IACzB,CAAC;IAED,OAAO,CAAC,SAAqB;QAC3B,IAAI,SAAS,CAAC,MAAM,GAAG,EAAE,EAAE;YACvB,MAAM,IAAI,SAAS,CAAC,uDAAuD,CAAC,CAAC;SAChF;QAED,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACnD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;YAC3C,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SACrE;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,CAAC,SAAqB;QAC3B,IAAI,SAAS,CAAC,MAAM,GAAG,EAAE,EAAE;YACvB,MAAM,IAAI,SAAS,CAAC,wDAAwD,CAAC,CAAC;SACjF;QAED,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACnD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;YAC3C,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SACrE;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AA/BD,kBA+BC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ofb.d.ts b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ofb.d.ts deleted file mode 100644 index a62d0b41..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ofb.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ModeOfOperation } from "./mode.js"; -export declare class OFB extends ModeOfOperation { - #private; - constructor(key: Uint8Array, iv?: Uint8Array); - get iv(): Uint8Array; - encrypt(plaintext: Uint8Array): Uint8Array; - decrypt(ciphertext: Uint8Array): Uint8Array; -} -//# sourceMappingURL=mode-ofb.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ofb.d.ts.map b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ofb.d.ts.map deleted file mode 100644 index ac15036a..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ofb.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mode-ofb.d.ts","sourceRoot":"","sources":["../src.ts/mode-ofb.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,qBAAa,GAAI,SAAQ,eAAe;;gBAK1B,GAAG,EAAE,UAAU,EAAE,EAAE,CAAC,EAAE,UAAU;IAgB5C,IAAI,EAAE,IAAI,UAAU,CAAqC;IAEzD,OAAO,CAAC,SAAS,EAAE,UAAU,GAAG,UAAU;IAiB1C,OAAO,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU;CAM5C"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ofb.js b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ofb.js deleted file mode 100644 index 787d7c01..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ofb.js +++ /dev/null @@ -1,61 +0,0 @@ -"use strict"; -// Output Feedback -var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; -}; -var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -}; -var _OFB_iv, _OFB_lastPrecipher, _OFB_lastPrecipherIndex; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.OFB = void 0; -const mode_js_1 = require("./mode.js"); -class OFB extends mode_js_1.ModeOfOperation { - constructor(key, iv) { - super("OFB", key, OFB); - _OFB_iv.set(this, void 0); - _OFB_lastPrecipher.set(this, void 0); - _OFB_lastPrecipherIndex.set(this, void 0); - if (iv) { - if (iv.length % 16) { - throw new TypeError("invalid iv size (must be 16 bytes)"); - } - __classPrivateFieldSet(this, _OFB_iv, new Uint8Array(iv), "f"); - } - else { - __classPrivateFieldSet(this, _OFB_iv, new Uint8Array(16), "f"); - } - __classPrivateFieldSet(this, _OFB_lastPrecipher, this.iv, "f"); - __classPrivateFieldSet(this, _OFB_lastPrecipherIndex, 16, "f"); - } - get iv() { return new Uint8Array(__classPrivateFieldGet(this, _OFB_iv, "f")); } - encrypt(plaintext) { - var _a, _b; - if (plaintext.length % 16) { - throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)"); - } - const ciphertext = new Uint8Array(plaintext); - for (let i = 0; i < ciphertext.length; i++) { - if (__classPrivateFieldGet(this, _OFB_lastPrecipherIndex, "f") === 16) { - __classPrivateFieldSet(this, _OFB_lastPrecipher, this.aes.encrypt(__classPrivateFieldGet(this, _OFB_lastPrecipher, "f")), "f"); - __classPrivateFieldSet(this, _OFB_lastPrecipherIndex, 0, "f"); - } - ciphertext[i] ^= __classPrivateFieldGet(this, _OFB_lastPrecipher, "f")[__classPrivateFieldSet(this, _OFB_lastPrecipherIndex, (_b = __classPrivateFieldGet(this, _OFB_lastPrecipherIndex, "f"), _a = _b++, _b), "f"), _a]; - } - return ciphertext; - } - decrypt(ciphertext) { - if (ciphertext.length % 16) { - throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)"); - } - return this.encrypt(ciphertext); - } -} -exports.OFB = OFB; -_OFB_iv = new WeakMap(), _OFB_lastPrecipher = new WeakMap(), _OFB_lastPrecipherIndex = new WeakMap(); -//# sourceMappingURL=mode-ofb.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ofb.js.map b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ofb.js.map deleted file mode 100644 index fbe932a5..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode-ofb.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mode-ofb.js","sourceRoot":"","sources":["../src.ts/mode-ofb.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;;;;;;;;;;;;;AAElB,uCAA4C;AAE5C,MAAa,GAAI,SAAQ,yBAAe;IAKtC,YAAY,GAAe,EAAE,EAAe;QAC1C,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QALzB,0BAAgB;QAChB,qCAA2B;QAC3B,0CAA4B;QAK1B,IAAI,EAAE,EAAE;YACN,IAAI,EAAE,CAAC,MAAM,GAAG,EAAE,EAAE;gBAClB,MAAM,IAAI,SAAS,CAAC,oCAAoC,CAAC,CAAC;aAC3D;YACD,uBAAA,IAAI,WAAO,IAAI,UAAU,CAAC,EAAE,CAAC,MAAA,CAAC;SAC/B;aAAM;YACL,uBAAA,IAAI,WAAO,IAAI,UAAU,CAAC,EAAE,CAAC,MAAA,CAAC;SAC/B;QAED,uBAAA,IAAI,sBAAkB,IAAI,CAAC,EAAE,MAAA,CAAC;QAC9B,uBAAA,IAAI,2BAAuB,EAAE,MAAA,CAAC;IAChC,CAAC;IAED,IAAI,EAAE,KAAiB,OAAO,IAAI,UAAU,CAAC,uBAAA,IAAI,eAAI,CAAC,CAAC,CAAC,CAAC;IAEzD,OAAO,CAAC,SAAqB;;QAC3B,IAAI,SAAS,CAAC,MAAM,GAAG,EAAE,EAAE;YACzB,MAAM,IAAI,SAAS,CAAC,uDAAuD,CAAC,CAAC;SAC9E;QAED,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,SAAS,CAAC,CAAC;QAC7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC1C,IAAI,uBAAA,IAAI,+BAAoB,KAAK,EAAE,EAAE;gBACjC,uBAAA,IAAI,sBAAkB,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,uBAAA,IAAI,0BAAe,CAAC,MAAA,CAAC;gBAC5D,uBAAA,IAAI,2BAAuB,CAAC,MAAA,CAAC;aAChC;YACD,UAAU,CAAC,CAAC,CAAC,IAAI,uBAAA,IAAI,0BAAe,CAAC,sDAAA,CAAA,+DAAwB,EAAxB,KAAA,IAA0B,IAAA,CAAA,MAAA,IAAA,CAAC,CAAC;SAClE;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,OAAO,CAAC,UAAsB;QAC5B,IAAI,UAAU,CAAC,MAAM,GAAG,EAAE,EAAE;YACxB,MAAM,IAAI,SAAS,CAAC,wDAAwD,CAAC,CAAC;SACjF;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAClC,CAAC;CACF;AA9CD,kBA8CC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode.d.ts b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode.d.ts deleted file mode 100644 index 825bba7c..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AES } from "./aes.js"; -export declare abstract class ModeOfOperation { - readonly aes: AES; - readonly name: string; - constructor(name: string, key: Uint8Array, cls?: any); - abstract encrypt(plaintext: Uint8Array): Uint8Array; - abstract decrypt(ciphertext: Uint8Array): Uint8Array; -} -//# sourceMappingURL=mode.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode.d.ts.map b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode.d.ts.map deleted file mode 100644 index d3a09ec6..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mode.d.ts","sourceRoot":"","sources":["../src.ts/mode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,8BAAsB,eAAe;IACnC,QAAQ,CAAC,GAAG,EAAG,GAAG,CAAC;IACnB,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;gBAEX,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,CAAC,EAAE,GAAG;IAWpD,QAAQ,CAAC,OAAO,CAAC,SAAS,EAAE,UAAU,GAAG,UAAU;IACnD,QAAQ,CAAC,OAAO,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU;CACrD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode.js b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode.js deleted file mode 100644 index be251617..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ModeOfOperation = void 0; -const aes_js_1 = require("./aes.js"); -class ModeOfOperation { - constructor(name, key, cls) { - if (cls && !(this instanceof cls)) { - throw new Error(`${name} must be instantiated with "new"`); - } - Object.defineProperties(this, { - aes: { enumerable: true, value: new aes_js_1.AES(key) }, - name: { enumerable: true, value: name } - }); - } -} -exports.ModeOfOperation = ModeOfOperation; -//# sourceMappingURL=mode.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode.js.map b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode.js.map deleted file mode 100644 index 3076b72b..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/mode.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mode.js","sourceRoot":"","sources":["../src.ts/mode.ts"],"names":[],"mappings":";;;AACA,qCAA+B;AAE/B,MAAsB,eAAe;IAInC,YAAY,IAAY,EAAE,GAAe,EAAE,GAAS;QAClD,IAAI,GAAG,IAAI,CAAC,CAAC,IAAI,YAAY,GAAG,CAAC,EAAE;YACjC,MAAM,IAAI,KAAK,CAAC,GAAI,IAAK,kCAAkC,CAAC,CAAC;SAC9D;QAED,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE;YAC5B,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,YAAG,CAAC,GAAG,CAAC,EAAE;YAC9C,IAAI,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE;SACxC,CAAC,CAAC;IACL,CAAC;CAIF;AAjBD,0CAiBC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/package.json b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/package.json deleted file mode 100644 index 5bbefffb..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "commonjs" -} diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/padding.d.ts b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/padding.d.ts deleted file mode 100644 index aaff7105..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/padding.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare function pkcs7Pad(data: Uint8Array): Uint8Array; -export declare function pkcs7Strip(data: Uint8Array): Uint8Array; -//# sourceMappingURL=padding.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/padding.d.ts.map b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/padding.d.ts.map deleted file mode 100644 index 1d958fb6..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/padding.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"padding.d.ts","sourceRoot":"","sources":["../src.ts/padding.ts"],"names":[],"mappings":"AACA,wBAAgB,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,CAWrD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,CAcvD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/padding.js b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/padding.js deleted file mode 100644 index 7a237ebd..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/padding.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.pkcs7Strip = exports.pkcs7Pad = void 0; -function pkcs7Pad(data) { - const padder = 16 - (data.length % 16); - const result = new Uint8Array(data.length + padder); - result.set(data); - for (let i = data.length; i < result.length; i++) { - result[i] = padder; - } - return result; -} -exports.pkcs7Pad = pkcs7Pad; -function pkcs7Strip(data) { - if (data.length < 16) { - throw new TypeError('PKCS#7 invalid length'); - } - const padder = data[data.length - 1]; - if (padder > 16) { - throw new TypeError('PKCS#7 padding byte out of range'); - } - const length = data.length - padder; - for (let i = 0; i < padder; i++) { - if (data[length + i] !== padder) { - throw new TypeError('PKCS#7 invalid padding byte'); - } - } - return new Uint8Array(data.subarray(0, length)); -} -exports.pkcs7Strip = pkcs7Strip; -//# sourceMappingURL=padding.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/padding.js.map b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/padding.js.map deleted file mode 100644 index 036db5da..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/padding.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"padding.js","sourceRoot":"","sources":["../src.ts/padding.ts"],"names":[],"mappings":";;;AACA,SAAgB,QAAQ,CAAC,IAAgB;IACrC,MAAM,MAAM,GAAG,EAAE,GAAG,CAAC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAEvC,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACpD,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAEjB,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAC9C,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;KACtB;IAED,OAAO,MAAM,CAAC;AAClB,CAAC;AAXD,4BAWC;AAED,SAAgB,UAAU,CAAC,IAAgB;IACvC,IAAI,IAAI,CAAC,MAAM,GAAG,EAAE,EAAE;QAAE,MAAM,IAAI,SAAS,CAAC,uBAAuB,CAAC,CAAC;KAAE;IAEvE,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACrC,IAAI,MAAM,GAAG,EAAE,EAAE;QAAE,MAAM,IAAI,SAAS,CAAC,kCAAkC,CAAC,CAAC;KAAE;IAE7E,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;QAC7B,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,MAAM,EAAE;YAC7B,MAAM,IAAI,SAAS,CAAC,6BAA6B,CAAC,CAAC;SACtD;KACJ;IAED,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;AACpD,CAAC;AAdD,gCAcC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/tests.d.ts b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/tests.d.ts deleted file mode 100644 index 90993be8..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/tests.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=tests.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/tests.d.ts.map b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/tests.d.ts.map deleted file mode 100644 index 0305ca88..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/tests.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tests.d.ts","sourceRoot":"","sources":["../src.ts/tests.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/tests.js b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/tests.js deleted file mode 100644 index b80a1123..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/tests.js +++ /dev/null @@ -1,109 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const assert_1 = __importDefault(require("assert")); -const fs_1 = __importDefault(require("fs")); -const path_1 = require("path"); -const aes = __importStar(require("./index.js")); -const root = (function () { - let root = process.cwd(); - while (true) { - if (fs_1.default.existsSync((0, path_1.join)(root, "package.json"))) { - return root; - } - const parent = (0, path_1.join)(root, ".."); - if (parent === root) { - break; - } - root = parent; - } - throw new Error("could not find root"); -})(); -describe("Tests Encrypting and Decrypting", function () { - const json = fs_1.default.readFileSync((0, path_1.resolve)(root, "./test/test-vectors.json")).toString(); - const tests = JSON.parse(json); - function getCrypter(key, test) { - switch (test.modeOfOperation) { - case "ctr": - return new aes.CTR(key, 0); - case "cbc": - return new aes.CBC(key, Buffer.from(test.iv)); - case "cfb": - return new aes.CFB(key, Buffer.from(test.iv), test.segmentSize * 8); - case "ecb": - return new aes.ECB(key); - case "ofb": - return new aes.OFB(key, Buffer.from(test.iv)); - } - return null; - } - tests.forEach((test, index) => { - it(`tests encrypting: ${test.modeOfOperation}.${index}`, function () { - const encrypter = getCrypter(Buffer.from(test.key), test); - if (!encrypter) { - this.skip(); - } - for (let i = 0; i < test.plaintext.length; i++) { - const plaintext = Buffer.from(test.plaintext[i]); - const ciphertext = Buffer.from(test.encrypted[i]); - const result = Buffer.from(encrypter.encrypt(plaintext)); - assert_1.default.ok(ciphertext.equals(result), "encrypting failed"); - } - }); - it(`tests decrypting: ${test.modeOfOperation}.${index}`, function () { - const decrypter = getCrypter(Buffer.from(test.key), test); - if (!decrypter) { - this.skip(); - } - for (let i = 0; i < test.plaintext.length; i++) { - const plaintext = Buffer.from(test.plaintext[i]); - const ciphertext = Buffer.from(test.encrypted[i]); - const result = Buffer.from(decrypter.decrypt(ciphertext)); - assert_1.default.ok(plaintext.equals(result), "decrypting failed"); - } - }); - }); -}); -describe("Tests Padding", function () { - for (let size = 0; size < 100; size++) { - it(`tests padding: length=${size}`, function () { - // Create a random piece of data - const data = new Uint8Array(size); - data.fill(42); - // Pad it - const padded = aes.pkcs7Pad(data); - assert_1.default.ok((padded.length % 16) === 0, "Failed to pad to block size"); - assert_1.default.ok(data.length <= padded.length && padded.length <= data.length + 16, "Padding went awry"); - assert_1.default.ok(padded[padded.length - 1] >= 1 && padded[padded.length - 1] <= 16, "Failed to pad to block size"); - // Trim it - const trimmed = aes.pkcs7Strip(padded); - assert_1.default.ok(Buffer.from(data).equals(trimmed), "Failed to trim to original data"); - }); - } -}); -//# sourceMappingURL=tests.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/tests.js.map b/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/tests.js.map deleted file mode 100644 index 359da966..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.commonjs/tests.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tests.js","sourceRoot":"","sources":["../src.ts/tests.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAA2B;AAC3B,4CAAoB;AACpB,+BAAqC;AAErC,gDAAkC;AAclC,MAAM,IAAI,GAAG,CAAC;IACZ,IAAI,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAEzB,OAAO,IAAI,EAAE;QACX,IAAI,YAAE,CAAC,UAAU,CAAC,IAAA,WAAI,EAAC,IAAI,EAAE,cAAc,CAAC,CAAC,EAAE;YAAE,OAAO,IAAI,CAAC;SAAE;QAC/D,MAAM,MAAM,GAAG,IAAA,WAAI,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAChC,IAAI,MAAM,K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E,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,iCAAiC,CAAC,CAAC;QAClF,CAAC,CAAC,CAAC;KACJ;AACH,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/README.md b/tools/mnemonic-test/node_modules/aes-js/lib.esm/README.md deleted file mode 100644 index f2188af7..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/README.md +++ /dev/null @@ -1,6 +0,0 @@ -Gerneated Code (ESM) -==================== - -Do not modify code in this folder. - -See `/src.ts/` and `/tsconfig.esm.json`. diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/aes.d.ts b/tools/mnemonic-test/node_modules/aes-js/lib.esm/aes.d.ts deleted file mode 100644 index 2a26aff5..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/aes.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/*! MIT License. Copyright 2015-2022 Richard Moore . See LICENSE.txt. */ -export declare class AES { - #private; - get key(): Uint8Array; - constructor(key: Uint8Array); - encrypt(plaintext: Uint8Array): Uint8Array; - decrypt(ciphertext: Uint8Array): Uint8Array; -} -//# sourceMappingURL=aes.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/aes.d.ts.map b/tools/mnemonic-test/node_modules/aes-js/lib.esm/aes.d.ts.map deleted file mode 100644 index a3c66c79..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/aes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"aes.d.ts","sourceRoot":"","sources":["../src.ts/aes.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAsCvF,qBAAa,GAAG;;IAKd,IAAI,GAAG,IAAI,UAAU,CAA8B;gBAEvC,GAAG,EAAE,UAAU;IA+F3B,OAAO,CAAC,SAAS,EAAE,UAAU,GAAG,UAAU;IAwC1C,OAAO,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU;CAuC5C"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/aes.js b/tools/mnemonic-test/node_modules/aes-js/lib.esm/aes.js deleted file mode 100644 index 2945db24..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/aes.js +++ /dev/null @@ -1,198 +0,0 @@ -/*! MIT License. Copyright 2015-2022 Richard Moore . See LICENSE.txt. */ -var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -}; -var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; -}; -var _AES_key, _AES_Kd, _AES_Ke; -// Number of rounds by keysize -const numberOfRounds = { 16: 10, 24: 12, 32: 14 }; -// Round constant words -const rcon = [0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91]; -// S-box and Inverse S-box (S is for Substitution) -const S = [0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0x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f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d]; -// Transformations for encryption -const T1 = [0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d, 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554, 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d, 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a, 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87, 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b, 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea, 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b, 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a, 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f, 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108, 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f, 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e, 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5, 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d, 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f, 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e, 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb, 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce, 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497, 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c, 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed, 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b, 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a, 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16, 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594, 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81, 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3, 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a, 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504, 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163, 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d, 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f, 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739, 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47, 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395, 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f, 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883, 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c, 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76, 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e, 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4, 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6, 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b, 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7, 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0, 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25, 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818, 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72, 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651, 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21, 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85, 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa, 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12, 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0, 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9, 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133, 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7, 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920, 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a, 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17, 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8, 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11, 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a]; -const T2 = [0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b, 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5, 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b, 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676, 0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d, 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0, 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf, 0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0, 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626, 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc, 0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1, 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515, 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3, 0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a, 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2, 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575, 0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a, 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0, 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3, 0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484, 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded, 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b, 0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939, 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf, 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb, 0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585, 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f, 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8, 0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f, 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5, 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121, 0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2, 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec, 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717, 0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d, 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373, 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc, 0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888, 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414, 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb, 0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a, 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c, 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262, 0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979, 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d, 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9, 0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea, 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808, 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e, 0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6, 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f, 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a, 0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666, 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e, 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9, 0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e, 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111, 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494, 0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9, 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf, 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d, 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868, 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f, 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616]; -const T3 = [0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b, 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5, 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b, 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76, 0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d, 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0, 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af, 0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0, 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26, 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc, 0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1, 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15, 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3, 0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a, 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2, 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75, 0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a, 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0, 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3, 0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384, 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed, 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b, 0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239, 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf, 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb, 0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185, 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f, 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8, 0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f, 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5, 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221, 0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2, 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec, 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17, 0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d, 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673, 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc, 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88, 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814, 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb, 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a, 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c, 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462, 0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279, 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d, 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9, 0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea, 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008, 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e, 0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6, 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f, 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a, 0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66, 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e, 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9, 0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e, 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211, 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394, 0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9, 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df, 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d, 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068, 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f, 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16]; -const T4 = [0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6, 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491, 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56, 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec, 0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa, 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb, 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45, 0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b, 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c, 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83, 0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9, 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a, 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d, 0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f, 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf, 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea, 0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34, 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b, 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d, 0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713, 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1, 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6, 0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72, 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85, 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed, 0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411, 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe, 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b, 0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05, 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1, 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342, 0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf, 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3, 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e, 0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a, 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6, 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3, 0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b, 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28, 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad, 0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14, 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8, 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4, 0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2, 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da, 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049, 0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf, 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810, 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c, 0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197, 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e, 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f, 0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc, 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c, 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069, 0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927, 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322, 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733, 0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9, 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5, 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a, 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0, 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e, 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c]; -// Transformations for decryption -const T5 = [0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96, 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393, 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25, 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f, 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1, 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6, 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da, 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844, 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd, 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4, 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45, 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94, 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7, 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a, 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5, 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c, 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1, 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a, 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75, 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051, 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46, 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff, 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77, 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb, 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000, 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e, 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927, 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a, 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e, 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16, 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d, 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8, 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd, 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34, 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163, 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120, 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d, 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0, 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422, 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef, 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36, 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4, 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662, 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5, 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3, 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b, 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8, 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6, 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6, 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0, 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815, 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f, 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df, 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f, 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e, 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713, 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89, 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c, 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf, 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86, 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f, 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541, 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190, 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742]; -const T6 = [0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e, 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303, 0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c, 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3, 0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0, 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9, 0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259, 0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8, 0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971, 0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a, 0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f, 0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b, 0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8, 0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab, 0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708, 0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682, 0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2, 0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe, 0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb, 0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10, 0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd, 0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015, 0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e, 0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee, 0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000, 0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72, 0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39, 0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e, 0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91, 0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a, 0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17, 0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9, 0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60, 0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e, 0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1, 0xcad731dc, 0x10426385, 0x40139722, 0x2084c611, 0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1, 0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3, 0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964, 0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390, 0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b, 0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf, 0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46, 0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af, 0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512, 0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb, 0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a, 0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8, 0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c, 0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266, 0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8, 0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6, 0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604, 0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551, 0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41, 0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647, 0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c, 0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1, 0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737, 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db, 0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340, 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95, 0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1, 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857]; -const T7 = [0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27, 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3, 0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502, 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562, 0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe, 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3, 0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552, 0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9, 0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9, 0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce, 0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253, 0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908, 0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b, 0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655, 0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337, 0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16, 0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69, 0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6, 0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6, 0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e, 0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6, 0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050, 0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9, 0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8, 0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000, 0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a, 0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d, 0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436, 0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b, 0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12, 0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b, 0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e, 0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f, 0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb, 0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4, 0xdccad731, 0x85104263, 0x22401397, 0x112084c6, 0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729, 0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1, 0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9, 0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233, 0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4, 0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad, 0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e, 0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3, 0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25, 0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b, 0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f, 0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15, 0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0, 0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2, 0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7, 0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791, 0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496, 0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665, 0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b, 0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6, 0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13, 0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47, 0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7, 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844, 0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3, 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d, 0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456, 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8]; -const T8 = [0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a, 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b, 0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5, 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5, 0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d, 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b, 0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95, 0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e, 0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27, 0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d, 0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562, 0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9, 0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752, 0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66, 0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3, 0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced, 0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e, 0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4, 0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4, 0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd, 0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d, 0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60, 0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767, 0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79, 0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000, 0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c, 0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736, 0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24, 0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b, 0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c, 0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12, 0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814, 0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3, 0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b, 0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8, 0x31dccad7, 0x63851042, 0x97224013, 0xc6112084, 0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7, 0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077, 0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247, 0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22, 0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698, 0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f, 0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254, 0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582, 0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf, 0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb, 0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883, 0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef, 0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629, 0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035, 0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533, 0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17, 0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4, 0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46, 0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb, 0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d, 0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb, 0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a, 0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73, 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678, 0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2, 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff, 0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064, 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0]; -// Transformations for decryption key expansion -const U1 = [0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3]; -const U2 = [0x00000000, 0x0b0e090d, 0x161c121a, 0x1d121b17, 0x2c382434, 0x27362d39, 0x3a24362e, 0x312a3f23, 0x58704868, 0x537e4165, 0x4e6c5a72, 0x4562537f, 0x74486c5c, 0x7f466551, 0x62547e46, 0x695a774b, 0xb0e090d0, 0xbbee99dd, 0xa6fc82ca, 0xadf28bc7, 0x9cd8b4e4, 0x97d6bde9, 0x8ac4a6fe, 0x81caaff3, 0xe890d8b8, 0xe39ed1b5, 0xfe8ccaa2, 0xf582c3af, 0xc4a8fc8c, 0xcfa6f581, 0xd2b4ee96, 0xd9bae79b, 0x7bdb3bbb, 0x70d532b6, 0x6dc729a1, 0x66c920ac, 0x57e31f8f, 0x5ced1682, 0x41ff0d95, 0x4af10498, 0x23ab73d3, 0x28a57ade, 0x35b761c9, 0x3eb968c4, 0x0f9357e7, 0x049d5eea, 0x198f45fd, 0x12814cf0, 0xcb3bab6b, 0xc035a266, 0xdd27b971, 0xd629b07c, 0xe7038f5f, 0xec0d8652, 0xf11f9d45, 0xfa119448, 0x934be303, 0x9845ea0e, 0x8557f119, 0x8e59f814, 0xbf73c737, 0xb47dce3a, 0xa96fd52d, 0xa261dc20, 0xf6ad766d, 0xfda37f60, 0xe0b16477, 0xebbf6d7a, 0xda955259, 0xd19b5b54, 0xcc894043, 0xc787494e, 0xaedd3e05, 0xa5d33708, 0xb8c12c1f, 0xb3cf2512, 0x82e51a31, 0x89eb133c, 0x94f9082b, 0x9ff70126, 0x464de6bd, 0x4d43efb0, 0x5051f4a7, 0x5b5ffdaa, 0x6a75c289, 0x617bcb84, 0x7c69d093, 0x7767d99e, 0x1e3daed5, 0x1533a7d8, 0x0821bccf, 0x032fb5c2, 0x32058ae1, 0x390b83ec, 0x241998fb, 0x2f1791f6, 0x8d764dd6, 0x867844db, 0x9b6a5fcc, 0x906456c1, 0xa14e69e2, 0xaa4060ef, 0xb7527bf8, 0xbc5c72f5, 0xd50605be, 0xde080cb3, 0xc31a17a4, 0xc8141ea9, 0xf93e218a, 0xf2302887, 0xef223390, 0xe42c3a9d, 0x3d96dd06, 0x3698d40b, 0x2b8acf1c, 0x2084c611, 0x11aef932, 0x1aa0f03f, 0x07b2eb28, 0x0cbce225, 0x65e6956e, 0x6ee89c63, 0x73fa8774, 0x78f48e79, 0x49deb15a, 0x42d0b857, 0x5fc2a340, 0x54ccaa4d, 0xf741ecda, 0xfc4fe5d7, 0xe15dfec0, 0xea53f7cd, 0xdb79c8ee, 0xd077c1e3, 0xcd65daf4, 0xc66bd3f9, 0xaf31a4b2, 0xa43fadbf, 0xb92db6a8, 0xb223bfa5, 0x83098086, 0x8807898b, 0x9515929c, 0x9e1b9b91, 0x47a17c0a, 0x4caf7507, 0x51bd6e10, 0x5ab3671d, 0x6b99583e, 0x60975133, 0x7d854a24, 0x768b4329, 0x1fd13462, 0x14df3d6f, 0x09cd2678, 0x02c32f75, 0x33e91056, 0x38e7195b, 0x25f5024c, 0x2efb0b41, 0x8c9ad761, 0x8794de6c, 0x9a86c57b, 0x9188cc76, 0xa0a2f355, 0xabacfa58, 0xb6bee14f, 0xbdb0e842, 0xd4ea9f09, 0xdfe49604, 0xc2f68d13, 0xc9f8841e, 0xf8d2bb3d, 0xf3dcb230, 0xeecea927, 0xe5c0a02a, 0x3c7a47b1, 0x37744ebc, 0x2a6655ab, 0x21685ca6, 0x10426385, 0x1b4c6a88, 0x065e719f, 0x0d507892, 0x640a0fd9, 0x6f0406d4, 0x72161dc3, 0x791814ce, 0x48322bed, 0x433c22e0, 0x5e2e39f7, 0x552030fa, 0x01ec9ab7, 0x0ae293ba, 0x17f088ad, 0x1cfe81a0, 0x2dd4be83, 0x26dab78e, 0x3bc8ac99, 0x30c6a594, 0x599cd2df, 0x5292dbd2, 0x4f80c0c5, 0x448ec9c8, 0x75a4f6eb, 0x7eaaffe6, 0x63b8e4f1, 0x68b6edfc, 0xb10c0a67, 0xba02036a, 0xa710187d, 0xac1e1170, 0x9d342e53, 0x963a275e, 0x8b283c49, 0x80263544, 0xe97c420f, 0xe2724b02, 0xff605015, 0xf46e5918, 0xc544663b, 0xce4a6f36, 0xd3587421, 0xd8567d2c, 0x7a37a10c, 0x7139a801, 0x6c2bb316, 0x6725ba1b, 0x560f8538, 0x5d018c35, 0x40139722, 0x4b1d9e2f, 0x2247e964, 0x2949e069, 0x345bfb7e, 0x3f55f273, 0x0e7fcd50, 0x0571c45d, 0x1863df4a, 0x136dd647, 0xcad731dc, 0xc1d938d1, 0xdccb23c6, 0xd7c52acb, 0xe6ef15e8, 0xede11ce5, 0xf0f307f2, 0xfbfd0eff, 0x92a779b4, 0x99a970b9, 0x84bb6bae, 0x8fb562a3, 0xbe9f5d80, 0xb591548d, 0xa8834f9a, 0xa38d4697]; -const U3 = [0x00000000, 0x0d0b0e09, 0x1a161c12, 0x171d121b, 0x342c3824, 0x3927362d, 0x2e3a2436, 0x23312a3f, 0x68587048, 0x65537e41, 0x724e6c5a, 0x7f456253, 0x5c74486c, 0x517f4665, 0x4662547e, 0x4b695a77, 0xd0b0e090, 0xddbbee99, 0xcaa6fc82, 0xc7adf28b, 0xe49cd8b4, 0xe997d6bd, 0xfe8ac4a6, 0xf381caaf, 0xb8e890d8, 0xb5e39ed1, 0xa2fe8cca, 0xaff582c3, 0x8cc4a8fc, 0x81cfa6f5, 0x96d2b4ee, 0x9bd9bae7, 0xbb7bdb3b, 0xb670d532, 0xa16dc729, 0xac66c920, 0x8f57e31f, 0x825ced16, 0x9541ff0d, 0x984af104, 0xd323ab73, 0xde28a57a, 0xc935b761, 0xc43eb968, 0xe70f9357, 0xea049d5e, 0xfd198f45, 0xf012814c, 0x6bcb3bab, 0x66c035a2, 0x71dd27b9, 0x7cd629b0, 0x5fe7038f, 0x52ec0d86, 0x45f11f9d, 0x48fa1194, 0x03934be3, 0x0e9845ea, 0x198557f1, 0x148e59f8, 0x37bf73c7, 0x3ab47dce, 0x2da96fd5, 0x20a261dc, 0x6df6ad76, 0x60fda37f, 0x77e0b164, 0x7aebbf6d, 0x59da9552, 0x54d19b5b, 0x43cc8940, 0x4ec78749, 0x05aedd3e, 0x08a5d337, 0x1fb8c12c, 0x12b3cf25, 0x3182e51a, 0x3c89eb13, 0x2b94f908, 0x269ff701, 0xbd464de6, 0xb04d43ef, 0xa75051f4, 0xaa5b5ffd, 0x896a75c2, 0x84617bcb, 0x937c69d0, 0x9e7767d9, 0xd51e3dae, 0xd81533a7, 0xcf0821bc, 0xc2032fb5, 0xe132058a, 0xec390b83, 0xfb241998, 0xf62f1791, 0xd68d764d, 0xdb867844, 0xcc9b6a5f, 0xc1906456, 0xe2a14e69, 0xefaa4060, 0xf8b7527b, 0xf5bc5c72, 0xbed50605, 0xb3de080c, 0xa4c31a17, 0xa9c8141e, 0x8af93e21, 0x87f23028, 0x90ef2233, 0x9de42c3a, 0x063d96dd, 0x0b3698d4, 0x1c2b8acf, 0x112084c6, 0x3211aef9, 0x3f1aa0f0, 0x2807b2eb, 0x250cbce2, 0x6e65e695, 0x636ee89c, 0x7473fa87, 0x7978f48e, 0x5a49deb1, 0x5742d0b8, 0x405fc2a3, 0x4d54ccaa, 0xdaf741ec, 0xd7fc4fe5, 0xc0e15dfe, 0xcdea53f7, 0xeedb79c8, 0xe3d077c1, 0xf4cd65da, 0xf9c66bd3, 0xb2af31a4, 0xbfa43fad, 0xa8b92db6, 0xa5b223bf, 0x86830980, 0x8b880789, 0x9c951592, 0x919e1b9b, 0x0a47a17c, 0x074caf75, 0x1051bd6e, 0x1d5ab367, 0x3e6b9958, 0x33609751, 0x247d854a, 0x29768b43, 0x621fd134, 0x6f14df3d, 0x7809cd26, 0x7502c32f, 0x5633e910, 0x5b38e719, 0x4c25f502, 0x412efb0b, 0x618c9ad7, 0x6c8794de, 0x7b9a86c5, 0x769188cc, 0x55a0a2f3, 0x58abacfa, 0x4fb6bee1, 0x42bdb0e8, 0x09d4ea9f, 0x04dfe496, 0x13c2f68d, 0x1ec9f884, 0x3df8d2bb, 0x30f3dcb2, 0x27eecea9, 0x2ae5c0a0, 0xb13c7a47, 0xbc37744e, 0xab2a6655, 0xa621685c, 0x85104263, 0x881b4c6a, 0x9f065e71, 0x920d5078, 0xd9640a0f, 0xd46f0406, 0xc372161d, 0xce791814, 0xed48322b, 0xe0433c22, 0xf75e2e39, 0xfa552030, 0xb701ec9a, 0xba0ae293, 0xad17f088, 0xa01cfe81, 0x832dd4be, 0x8e26dab7, 0x993bc8ac, 0x9430c6a5, 0xdf599cd2, 0xd25292db, 0xc54f80c0, 0xc8448ec9, 0xeb75a4f6, 0xe67eaaff, 0xf163b8e4, 0xfc68b6ed, 0x67b10c0a, 0x6aba0203, 0x7da71018, 0x70ac1e11, 0x539d342e, 0x5e963a27, 0x498b283c, 0x44802635, 0x0fe97c42, 0x02e2724b, 0x15ff6050, 0x18f46e59, 0x3bc54466, 0x36ce4a6f, 0x21d35874, 0x2cd8567d, 0x0c7a37a1, 0x017139a8, 0x166c2bb3, 0x1b6725ba, 0x38560f85, 0x355d018c, 0x22401397, 0x2f4b1d9e, 0x642247e9, 0x692949e0, 0x7e345bfb, 0x733f55f2, 0x500e7fcd, 0x5d0571c4, 0x4a1863df, 0x47136dd6, 0xdccad731, 0xd1c1d938, 0xc6dccb23, 0xcbd7c52a, 0xe8e6ef15, 0xe5ede11c, 0xf2f0f307, 0xfffbfd0e, 0xb492a779, 0xb999a970, 0xae84bb6b, 0xa38fb562, 0x80be9f5d, 0x8db59154, 0x9aa8834f, 0x97a38d46]; -const U4 = [0x00000000, 0x090d0b0e, 0x121a161c, 0x1b171d12, 0x24342c38, 0x2d392736, 0x362e3a24, 0x3f23312a, 0x48685870, 0x4165537e, 0x5a724e6c, 0x537f4562, 0x6c5c7448, 0x65517f46, 0x7e466254, 0x774b695a, 0x90d0b0e0, 0x99ddbbee, 0x82caa6fc, 0x8bc7adf2, 0xb4e49cd8, 0xbde997d6, 0xa6fe8ac4, 0xaff381ca, 0xd8b8e890, 0xd1b5e39e, 0xcaa2fe8c, 0xc3aff582, 0xfc8cc4a8, 0xf581cfa6, 0xee96d2b4, 0xe79bd9ba, 0x3bbb7bdb, 0x32b670d5, 0x29a16dc7, 0x20ac66c9, 0x1f8f57e3, 0x16825ced, 0x0d9541ff, 0x04984af1, 0x73d323ab, 0x7ade28a5, 0x61c935b7, 0x68c43eb9, 0x57e70f93, 0x5eea049d, 0x45fd198f, 0x4cf01281, 0xab6bcb3b, 0xa266c035, 0xb971dd27, 0xb07cd629, 0x8f5fe703, 0x8652ec0d, 0x9d45f11f, 0x9448fa11, 0xe303934b, 0xea0e9845, 0xf1198557, 0xf8148e59, 0xc737bf73, 0xce3ab47d, 0xd52da96f, 0xdc20a261, 0x766df6ad, 0x7f60fda3, 0x6477e0b1, 0x6d7aebbf, 0x5259da95, 0x5b54d19b, 0x4043cc89, 0x494ec787, 0x3e05aedd, 0x3708a5d3, 0x2c1fb8c1, 0x2512b3cf, 0x1a3182e5, 0x133c89eb, 0x082b94f9, 0x01269ff7, 0xe6bd464d, 0xefb04d43, 0xf4a75051, 0xfdaa5b5f, 0xc2896a75, 0xcb84617b, 0xd0937c69, 0xd99e7767, 0xaed51e3d, 0xa7d81533, 0xbccf0821, 0xb5c2032f, 0x8ae13205, 0x83ec390b, 0x98fb2419, 0x91f62f17, 0x4dd68d76, 0x44db8678, 0x5fcc9b6a, 0x56c19064, 0x69e2a14e, 0x60efaa40, 0x7bf8b752, 0x72f5bc5c, 0x05bed506, 0x0cb3de08, 0x17a4c31a, 0x1ea9c814, 0x218af93e, 0x2887f230, 0x3390ef22, 0x3a9de42c, 0xdd063d96, 0xd40b3698, 0xcf1c2b8a, 0xc6112084, 0xf93211ae, 0xf03f1aa0, 0xeb2807b2, 0xe2250cbc, 0x956e65e6, 0x9c636ee8, 0x877473fa, 0x8e7978f4, 0xb15a49de, 0xb85742d0, 0xa3405fc2, 0xaa4d54cc, 0xecdaf741, 0xe5d7fc4f, 0xfec0e15d, 0xf7cdea53, 0xc8eedb79, 0xc1e3d077, 0xdaf4cd65, 0xd3f9c66b, 0xa4b2af31, 0xadbfa43f, 0xb6a8b92d, 0xbfa5b223, 0x80868309, 0x898b8807, 0x929c9515, 0x9b919e1b, 0x7c0a47a1, 0x75074caf, 0x6e1051bd, 0x671d5ab3, 0x583e6b99, 0x51336097, 0x4a247d85, 0x4329768b, 0x34621fd1, 0x3d6f14df, 0x267809cd, 0x2f7502c3, 0x105633e9, 0x195b38e7, 0x024c25f5, 0x0b412efb, 0xd7618c9a, 0xde6c8794, 0xc57b9a86, 0xcc769188, 0xf355a0a2, 0xfa58abac, 0xe14fb6be, 0xe842bdb0, 0x9f09d4ea, 0x9604dfe4, 0x8d13c2f6, 0x841ec9f8, 0xbb3df8d2, 0xb230f3dc, 0xa927eece, 0xa02ae5c0, 0x47b13c7a, 0x4ebc3774, 0x55ab2a66, 0x5ca62168, 0x63851042, 0x6a881b4c, 0x719f065e, 0x78920d50, 0x0fd9640a, 0x06d46f04, 0x1dc37216, 0x14ce7918, 0x2bed4832, 0x22e0433c, 0x39f75e2e, 0x30fa5520, 0x9ab701ec, 0x93ba0ae2, 0x88ad17f0, 0x81a01cfe, 0xbe832dd4, 0xb78e26da, 0xac993bc8, 0xa59430c6, 0xd2df599c, 0xdbd25292, 0xc0c54f80, 0xc9c8448e, 0xf6eb75a4, 0xffe67eaa, 0xe4f163b8, 0xedfc68b6, 0x0a67b10c, 0x036aba02, 0x187da710, 0x1170ac1e, 0x2e539d34, 0x275e963a, 0x3c498b28, 0x35448026, 0x420fe97c, 0x4b02e272, 0x5015ff60, 0x5918f46e, 0x663bc544, 0x6f36ce4a, 0x7421d358, 0x7d2cd856, 0xa10c7a37, 0xa8017139, 0xb3166c2b, 0xba1b6725, 0x8538560f, 0x8c355d01, 0x97224013, 0x9e2f4b1d, 0xe9642247, 0xe0692949, 0xfb7e345b, 0xf2733f55, 0xcd500e7f, 0xc45d0571, 0xdf4a1863, 0xd647136d, 0x31dccad7, 0x38d1c1d9, 0x23c6dccb, 0x2acbd7c5, 0x15e8e6ef, 0x1ce5ede1, 0x07f2f0f3, 0x0efffbfd, 0x79b492a7, 0x70b999a9, 0x6bae84bb, 0x62a38fb5, 0x5d80be9f, 0x548db591, 0x4f9aa883, 0x4697a38d]; -function convertToInt32(bytes) { - const result = []; - for (let i = 0; i < bytes.length; i += 4) { - result.push((bytes[i] << 24) | (bytes[i + 1] << 16) | (bytes[i + 2] << 8) | bytes[i + 3]); - } - return result; -} -export class AES { - get key() { return __classPrivateFieldGet(this, _AES_key, "f").slice(); } - constructor(key) { - _AES_key.set(this, void 0); - _AES_Kd.set(this, void 0); - _AES_Ke.set(this, void 0); - if (!(this instanceof AES)) { - throw Error('AES must be instanitated with `new`'); - } - __classPrivateFieldSet(this, _AES_key, new Uint8Array(key), "f"); - const rounds = numberOfRounds[this.key.length]; - if (rounds == null) { - throw new TypeError('invalid key size (must be 16, 24 or 32 bytes)'); - } - // encryption round keys - __classPrivateFieldSet(this, _AES_Ke, [], "f"); - // decryption round keys - __classPrivateFieldSet(this, _AES_Kd, [], "f"); - for (let i = 0; i <= rounds; i++) { - __classPrivateFieldGet(this, _AES_Ke, "f").push([0, 0, 0, 0]); - __classPrivateFieldGet(this, _AES_Kd, "f").push([0, 0, 0, 0]); - } - const roundKeyCount = (rounds + 1) * 4; - const KC = this.key.length / 4; - // convert the key into ints - const tk = convertToInt32(this.key); - // copy values into round key arrays - let index; - for (let i = 0; i < KC; i++) { - index = i >> 2; - __classPrivateFieldGet(this, _AES_Ke, "f")[index][i % 4] = tk[i]; - __classPrivateFieldGet(this, _AES_Kd, "f")[rounds - index][i % 4] = tk[i]; - } - // key expansion (fips-197 section 5.2) - let rconpointer = 0; - let t = KC, tt; - while (t < roundKeyCount) { - tt = tk[KC - 1]; - tk[0] ^= ((S[(tt >> 16) & 0xFF] << 24) ^ - (S[(tt >> 8) & 0xFF] << 16) ^ - (S[tt & 0xFF] << 8) ^ - S[(tt >> 24) & 0xFF] ^ - (rcon[rconpointer] << 24)); - rconpointer += 1; - // key expansion (for non-256 bit) - if (KC != 8) { - for (let i = 1; i < KC; i++) { - tk[i] ^= tk[i - 1]; - } - // key expansion for 256-bit keys is "slightly different" (fips-197) - } - else { - for (let i = 1; i < (KC / 2); i++) { - tk[i] ^= tk[i - 1]; - } - tt = tk[(KC / 2) - 1]; - tk[KC / 2] ^= (S[tt & 0xFF] ^ - (S[(tt >> 8) & 0xFF] << 8) ^ - (S[(tt >> 16) & 0xFF] << 16) ^ - (S[(tt >> 24) & 0xFF] << 24)); - for (let i = (KC / 2) + 1; i < KC; i++) { - tk[i] ^= tk[i - 1]; - } - } - // copy values into round key arrays - let i = 0, r, c; - while (i < KC && t < roundKeyCount) { - r = t >> 2; - c = t % 4; - __classPrivateFieldGet(this, _AES_Ke, "f")[r][c] = tk[i]; - __classPrivateFieldGet(this, _AES_Kd, "f")[rounds - r][c] = tk[i++]; - t++; - } - } - // inverse-cipher-ify the decryption round key (fips-197 section 5.3) - for (let r = 1; r < rounds; r++) { - for (let c = 0; c < 4; c++) { - tt = __classPrivateFieldGet(this, _AES_Kd, "f")[r][c]; - __classPrivateFieldGet(this, _AES_Kd, "f")[r][c] = (U1[(tt >> 24) & 0xFF] ^ - U2[(tt >> 16) & 0xFF] ^ - U3[(tt >> 8) & 0xFF] ^ - U4[tt & 0xFF]); - } - } - } - encrypt(plaintext) { - if (plaintext.length != 16) { - throw new TypeError('invalid plaintext size (must be 16 bytes)'); - } - const rounds = __classPrivateFieldGet(this, _AES_Ke, "f").length - 1; - const a = [0, 0, 0, 0]; - // convert plaintext to (ints ^ key) - let t = convertToInt32(plaintext); - for (let i = 0; i < 4; i++) { - t[i] ^= __classPrivateFieldGet(this, _AES_Ke, "f")[0][i]; - } - // apply round transforms - for (let r = 1; r < rounds; r++) { - for (let i = 0; i < 4; i++) { - a[i] = (T1[(t[i] >> 24) & 0xff] ^ - T2[(t[(i + 1) % 4] >> 16) & 0xff] ^ - T3[(t[(i + 2) % 4] >> 8) & 0xff] ^ - T4[t[(i + 3) % 4] & 0xff] ^ - __classPrivateFieldGet(this, _AES_Ke, "f")[r][i]); - } - t = a.slice(); - } - // the last round is special - const result = new Uint8Array(16); - let tt = 0; - for (let i = 0; i < 4; i++) { - tt = __classPrivateFieldGet(this, _AES_Ke, "f")[rounds][i]; - result[4 * i] = (S[(t[i] >> 24) & 0xff] ^ (tt >> 24)) & 0xff; - result[4 * i + 1] = (S[(t[(i + 1) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff; - result[4 * i + 2] = (S[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff; - result[4 * i + 3] = (S[t[(i + 3) % 4] & 0xff] ^ tt) & 0xff; - } - return result; - } - decrypt(ciphertext) { - if (ciphertext.length != 16) { - throw new TypeError('invalid ciphertext size (must be 16 bytes)'); - } - const rounds = __classPrivateFieldGet(this, _AES_Kd, "f").length - 1; - const a = [0, 0, 0, 0]; - // convert plaintext to (ints ^ key) - let t = convertToInt32(ciphertext); - for (let i = 0; i < 4; i++) { - t[i] ^= __classPrivateFieldGet(this, _AES_Kd, "f")[0][i]; - } - // apply round transforms - for (let r = 1; r < rounds; r++) { - for (let i = 0; i < 4; i++) { - a[i] = (T5[(t[i] >> 24) & 0xff] ^ - T6[(t[(i + 3) % 4] >> 16) & 0xff] ^ - T7[(t[(i + 2) % 4] >> 8) & 0xff] ^ - T8[t[(i + 1) % 4] & 0xff] ^ - __classPrivateFieldGet(this, _AES_Kd, "f")[r][i]); - } - t = a.slice(); - } - // the last round is special - const result = new Uint8Array(16); - let tt = 0; - for (let i = 0; i < 4; i++) { - tt = __classPrivateFieldGet(this, _AES_Kd, "f")[rounds][i]; - result[4 * i] = (Si[(t[i] >> 24) & 0xff] ^ (tt >> 24)) & 0xff; - result[4 * i + 1] = (Si[(t[(i + 3) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff; - result[4 * i + 2] = (Si[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff; - result[4 * i + 3] = (Si[t[(i + 1) % 4] & 0xff] ^ tt) & 0xff; - } - return result; - } -} -_AES_key = new WeakMap(), _AES_Kd = new WeakMap(), _AES_Ke = new WeakMap(); -//# sourceMappingURL=aes.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/aes.js.map b/tools/mnemonic-test/node_modules/aes-js/lib.esm/aes.js.map deleted file mode 100644 index 78e92a61..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/aes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"aes.js","sourceRoot":"","sources":["../src.ts/aes.ts"],"names":[],"mappings":"AAAA,uFAAuF;;;;;;;;;;;;;AAEvF,8BAA8B;AAC9B,MAAM,cAAc,GAA2B,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;AAE1E,uBAAuB;AACvB,MAAM,IAAI,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAElM,kDAAkD;AAClD,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,E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,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAK,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,IAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;YAC5E,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAU,IAAI,CAAC,GAAI,EAAE,CAAQ,GAAG,IAAI,CAAC;SAC7E;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/index.d.ts b/tools/mnemonic-test/node_modules/aes-js/lib.esm/index.d.ts deleted file mode 100644 index 95618a7a..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export { AES } from "./aes.js"; -export { ModeOfOperation } from "./mode.js"; -export { CBC } from "./mode-cbc.js"; -export { CFB } from "./mode-cfb.js"; -export { CTR } from "./mode-ctr.js"; -export { ECB } from "./mode-ecb.js"; -export { OFB } from "./mode-ofb.js"; -export { pkcs7Pad, pkcs7Strip } from "./padding.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/index.d.ts.map b/tools/mnemonic-test/node_modules/aes-js/lib.esm/index.d.ts.map deleted file mode 100644 index 376752cb..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src.ts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEpC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/index.js b/tools/mnemonic-test/node_modules/aes-js/lib.esm/index.js deleted file mode 100644 index ab88d0ed..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/index.js +++ /dev/null @@ -1,9 +0,0 @@ -export { AES } from "./aes.js"; -export { ModeOfOperation } from "./mode.js"; -export { CBC } from "./mode-cbc.js"; -export { CFB } from "./mode-cfb.js"; -export { CTR } from "./mode-ctr.js"; -export { ECB } from "./mode-ecb.js"; -export { OFB } from "./mode-ofb.js"; -export { pkcs7Pad, pkcs7Strip } from "./padding.js"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/index.js.map b/tools/mnemonic-test/node_modules/aes-js/lib.esm/index.js.map deleted file mode 100644 index f85262de..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src.ts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEpC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-cbc.d.ts b/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-cbc.d.ts deleted file mode 100644 index 0ec7fae5..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-cbc.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ModeOfOperation } from "./mode.js"; -export declare class CBC extends ModeOfOperation { - #private; - constructor(key: Uint8Array, iv?: Uint8Array); - get iv(): Uint8Array; - encrypt(plaintext: Uint8Array): Uint8Array; - decrypt(ciphertext: Uint8Array): Uint8Array; -} -//# sourceMappingURL=mode-cbc.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-cbc.d.ts.map b/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-cbc.d.ts.map deleted file mode 100644 index 60cb871d..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-cbc.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mode-cbc.d.ts","sourceRoot":"","sources":["../src.ts/mode-cbc.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,qBAAa,GAAI,SAAQ,eAAe;;gBAI1B,GAAG,EAAE,UAAU,EAAE,EAAE,CAAC,EAAE,UAAU;IAe5C,IAAI,EAAE,IAAI,UAAU,CAAqC;IAEzD,OAAO,CAAC,SAAS,EAAE,UAAU,GAAG,UAAU;IAkB1C,OAAO,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU;CAiB5C"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-cbc.js b/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-cbc.js deleted file mode 100644 index 44a00e45..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-cbc.js +++ /dev/null @@ -1,62 +0,0 @@ -// Cipher Block Chaining -var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; -}; -var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -}; -var _CBC_iv, _CBC_lastBlock; -import { ModeOfOperation } from "./mode.js"; -export class CBC extends ModeOfOperation { - constructor(key, iv) { - super("ECC", key, CBC); - _CBC_iv.set(this, void 0); - _CBC_lastBlock.set(this, void 0); - if (iv) { - if (iv.length % 16) { - throw new TypeError("invalid iv size (must be 16 bytes)"); - } - __classPrivateFieldSet(this, _CBC_iv, new Uint8Array(iv), "f"); - } - else { - __classPrivateFieldSet(this, _CBC_iv, new Uint8Array(16), "f"); - } - __classPrivateFieldSet(this, _CBC_lastBlock, this.iv, "f"); - } - get iv() { return new Uint8Array(__classPrivateFieldGet(this, _CBC_iv, "f")); } - encrypt(plaintext) { - if (plaintext.length % 16) { - throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)"); - } - const ciphertext = new Uint8Array(plaintext.length); - for (let i = 0; i < plaintext.length; i += 16) { - for (let j = 0; j < 16; j++) { - __classPrivateFieldGet(this, _CBC_lastBlock, "f")[j] ^= plaintext[i + j]; - } - __classPrivateFieldSet(this, _CBC_lastBlock, this.aes.encrypt(__classPrivateFieldGet(this, _CBC_lastBlock, "f")), "f"); - ciphertext.set(__classPrivateFieldGet(this, _CBC_lastBlock, "f"), i); - } - return ciphertext; - } - decrypt(ciphertext) { - if (ciphertext.length % 16) { - throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)"); - } - const plaintext = new Uint8Array(ciphertext.length); - for (let i = 0; i < ciphertext.length; i += 16) { - const block = this.aes.decrypt(ciphertext.subarray(i, i + 16)); - for (let j = 0; j < 16; j++) { - plaintext[i + j] = block[j] ^ __classPrivateFieldGet(this, _CBC_lastBlock, "f")[j]; - __classPrivateFieldGet(this, _CBC_lastBlock, "f")[j] = ciphertext[i + j]; - } - } - return plaintext; - } -} -_CBC_iv = new WeakMap(), _CBC_lastBlock = new WeakMap(); -//# sourceMappingURL=mode-cbc.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-cbc.js.map b/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-cbc.js.map deleted file mode 100644 index 187365ef..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-cbc.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mode-cbc.js","sourceRoot":"","sources":["../src.ts/mode-cbc.ts"],"names":[],"mappings":"AAAA,wBAAwB;;;;;;;;;;;;;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,MAAM,OAAO,GAAI,SAAQ,eAAe;IAItC,YAAY,GAAe,EAAE,EAAe;QAC1C,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAJzB,0BAAgB;QAChB,iCAAuB;QAKrB,IAAI,EAAE,EAAE;YACN,IAAI,EAAE,CAAC,MAAM,GAAG,EAAE,EAAE;gBAClB,MAAM,IAAI,SAAS,CAAC,oCAAoC,CAAC,CAAC;aAC3D;YACD,uBAAA,IAAI,WAAO,IAAI,UAAU,CAAC,E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,UAAU,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;YAC5C,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;YAE/D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE;gBAC3B,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,uBAAA,IAAI,sBAAW,CAAC,CAAC,CAAC,CAAC;gBACjD,uBAAA,IAAI,sBAAW,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;aACxC;SACJ;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-cfb.d.ts b/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-cfb.d.ts deleted file mode 100644 index 86d0ea3e..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-cfb.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { ModeOfOperation } from "./mode.js"; -export declare class CFB extends ModeOfOperation { - #private; - readonly segmentSize: number; - constructor(key: Uint8Array, iv?: Uint8Array, segmentSize?: number); - get iv(): Uint8Array; - encrypt(plaintext: Uint8Array): Uint8Array; - decrypt(ciphertext: Uint8Array): Uint8Array; -} -//# sourceMappingURL=mode-cfb.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-cfb.d.ts.map b/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-cfb.d.ts.map deleted file mode 100644 index 7e08a59f..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-cfb.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mode-cfb.d.ts","sourceRoot":"","sources":["../src.ts/mode-cfb.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,qBAAa,GAAI,SAAQ,eAAe;;IAItC,QAAQ,CAAC,WAAW,EAAG,MAAM,CAAC;gBAElB,GAAG,EAAE,UAAU,EAAE,EAAE,CAAC,EAAE,UAAU,EAAE,WAAW,GAAE,MAAU;IAwBrE,IAAI,EAAE,IAAI,UAAU,CAAqC;IAUzD,OAAO,CAAC,SAAS,EAAE,UAAU,GAAG,UAAU;IAqB1C,OAAO,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU;CAoB5C"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-cfb.js b/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-cfb.js deleted file mode 100644 index 0c0ddabb..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-cfb.js +++ /dev/null @@ -1,77 +0,0 @@ -// Cipher Feedback -var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; -}; -var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -}; -var _CFB_instances, _CFB_iv, _CFB_shiftRegister, _CFB_shift; -import { ModeOfOperation } from "./mode.js"; -export class CFB extends ModeOfOperation { - constructor(key, iv, segmentSize = 8) { - super("CFB", key, CFB); - _CFB_instances.add(this); - _CFB_iv.set(this, void 0); - _CFB_shiftRegister.set(this, void 0); - // This library currently only handles byte-aligned segmentSize - if (!Number.isInteger(segmentSize) || (segmentSize % 8)) { - throw new TypeError("invalid segmentSize"); - } - Object.defineProperties(this, { - segmentSize: { enumerable: true, value: segmentSize } - }); - if (iv) { - if (iv.length % 16) { - throw new TypeError("invalid iv size (must be 16 bytes)"); - } - __classPrivateFieldSet(this, _CFB_iv, new Uint8Array(iv), "f"); - } - else { - __classPrivateFieldSet(this, _CFB_iv, new Uint8Array(16), "f"); - } - __classPrivateFieldSet(this, _CFB_shiftRegister, this.iv, "f"); - } - get iv() { return new Uint8Array(__classPrivateFieldGet(this, _CFB_iv, "f")); } - encrypt(plaintext) { - if (8 * plaintext.length % this.segmentSize) { - throw new TypeError("invalid plaintext size (must be multiple of segmentSize bytes)"); - } - const segmentSize = this.segmentSize / 8; - const ciphertext = new Uint8Array(plaintext); - for (let i = 0; i < ciphertext.length; i += segmentSize) { - const xorSegment = this.aes.encrypt(__classPrivateFieldGet(this, _CFB_shiftRegister, "f")); - for (let j = 0; j < segmentSize; j++) { - ciphertext[i + j] ^= xorSegment[j]; - } - __classPrivateFieldGet(this, _CFB_instances, "m", _CFB_shift).call(this, ciphertext.subarray(i)); - } - return ciphertext; - } - decrypt(ciphertext) { - if (8 * ciphertext.length % this.segmentSize) { - throw new TypeError("invalid ciphertext size (must be multiple of segmentSize bytes)"); - } - const segmentSize = this.segmentSize / 8; - const plaintext = new Uint8Array(ciphertext); - for (let i = 0; i < plaintext.length; i += segmentSize) { - const xorSegment = this.aes.encrypt(__classPrivateFieldGet(this, _CFB_shiftRegister, "f")); - for (let j = 0; j < segmentSize; j++) { - plaintext[i + j] ^= xorSegment[j]; - } - __classPrivateFieldGet(this, _CFB_instances, "m", _CFB_shift).call(this, ciphertext.subarray(i)); - } - return plaintext; - } -} -_CFB_iv = new WeakMap(), _CFB_shiftRegister = new WeakMap(), _CFB_instances = new WeakSet(), _CFB_shift = function _CFB_shift(data) { - const segmentSize = this.segmentSize / 8; - // Shift the register - __classPrivateFieldGet(this, _CFB_shiftRegister, "f").set(__classPrivateFieldGet(this, _CFB_shiftRegister, "f").subarray(segmentSize)); - __classPrivateFieldGet(this, _CFB_shiftRegister, "f").set(data.subarray(0, segmentSize), 16 - segmentSize); -}; -//# sourceMappingURL=mode-cfb.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-cfb.js.map b/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-cfb.js.map deleted file mode 100644 index 8b110230..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-cfb.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mode-cfb.js","sourceRoot":"","sources":["../src.ts/mode-cfb.ts"],"names":[],"mappings":"AAAA,kBAAkB;;;;;;;;;;;;;AAElB,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,MAAM,OAAO,GAAI,SAAQ,eAAe;IAMtC,YAAY,GAAe,EAAE,EAAe,EAAE,cAAsB,CAAC;QACnE,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;;QANzB,0BAAgB;QAChB,qCAA2B;QAOzB,+DAA+D;QAC/D,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE;YACvD,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAC;SAC5C;QAED,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE;YAC5B,WAAW,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE;SACtD,CAAC,CAAC;QAEH,IAAI,EAAE,EAAE;YACN,IAAI,EAAE,CAAC,MAAM,GAAG,EAAE,EAAE;gBAClB,MAAM,IAAI,SAAS,CAAC,oCAAoC,CAAC,CAAC;aAC3D;YACD,uBAAA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C1F;QAED,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;QAEzC,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,UAAU,CAAC,CAAC;QAE7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,IAAI,WAAW,EAAE;YACtD,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,uBAAA,IAAI,0BAAe,CAAC,CAAC;YACzD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,EAAE,CAAC,EAAE,EAAE;gBACpC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC;aACnC;YAED,uBAAA,IAAI,kCAAO,MAAX,IAAI,EAAQ,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;SACrC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;8HAjDQ,IAAgB;IACrB,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;IAEzC,qBAAqB;IACrB,uBAAA,IAAI,0BAAe,CAAC,GAAG,CAAC,uBAAA,IAAI,0BAAe,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC;IACnE,uBAAA,IAAI,0BAAe,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,WAAW,CAAC,EAAE,EAAE,GAAG,WAAW,CAAC,CAAC;AAC3E,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ctr.d.ts b/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ctr.d.ts deleted file mode 100644 index fda6de3c..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ctr.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { ModeOfOperation } from "./mode.js"; -export declare class CTR extends ModeOfOperation { - #private; - constructor(key: Uint8Array, initialValue?: number | Uint8Array); - get counter(): Uint8Array; - setCounterValue(value: number): void; - setCounterBytes(value: Uint8Array): void; - increment(): void; - encrypt(plaintext: Uint8Array): Uint8Array; - decrypt(ciphertext: Uint8Array): Uint8Array; -} -//# sourceMappingURL=mode-ctr.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ctr.d.ts.map b/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ctr.d.ts.map deleted file mode 100644 index 604f481f..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ctr.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mode-ctr.d.ts","sourceRoot":"","sources":["../src.ts/mode-ctr.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,qBAAa,GAAI,SAAQ,eAAe;;gBAS1B,GAAG,EAAE,UAAU,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,UAAU;IAkB/D,IAAI,OAAO,IAAI,UAAU,CAA0C;IAEnE,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAWpC,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAQxC,SAAS;IAWT,OAAO,CAAC,SAAS,EAAE,UAAU,GAAG,UAAU;IAe1C,OAAO,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU;CAG5C"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ctr.js b/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ctr.js deleted file mode 100644 index bd21988d..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ctr.js +++ /dev/null @@ -1,82 +0,0 @@ -// Counter Mode -var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; -}; -var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -}; -var _CTR_remaining, _CTR_remainingIndex, _CTR_counter; -import { ModeOfOperation } from "./mode.js"; -export class CTR extends ModeOfOperation { - constructor(key, initialValue) { - super("CTR", key, CTR); - // Remaining bytes for the one-time pad - _CTR_remaining.set(this, void 0); - _CTR_remainingIndex.set(this, void 0); - // The current counter - _CTR_counter.set(this, void 0); - __classPrivateFieldSet(this, _CTR_counter, new Uint8Array(16), "f"); - __classPrivateFieldGet(this, _CTR_counter, "f").fill(0); - __classPrivateFieldSet(this, _CTR_remaining, __classPrivateFieldGet(this, _CTR_counter, "f"), "f"); // This will be discarded immediately - __classPrivateFieldSet(this, _CTR_remainingIndex, 16, "f"); - if (initialValue == null) { - initialValue = 1; - } - if (typeof (initialValue) === "number") { - this.setCounterValue(initialValue); - } - else { - this.setCounterBytes(initialValue); - } - } - get counter() { return new Uint8Array(__classPrivateFieldGet(this, _CTR_counter, "f")); } - setCounterValue(value) { - if (!Number.isInteger(value) || value < 0 || value > Number.MAX_SAFE_INTEGER) { - throw new TypeError("invalid counter initial integer value"); - } - for (let index = 15; index >= 0; --index) { - __classPrivateFieldGet(this, _CTR_counter, "f")[index] = value % 256; - value = Math.floor(value / 256); - } - } - setCounterBytes(value) { - if (value.length !== 16) { - throw new TypeError("invalid counter initial Uint8Array value length"); - } - __classPrivateFieldGet(this, _CTR_counter, "f").set(value); - } - increment() { - for (let i = 15; i >= 0; i--) { - if (__classPrivateFieldGet(this, _CTR_counter, "f")[i] === 255) { - __classPrivateFieldGet(this, _CTR_counter, "f")[i] = 0; - } - else { - __classPrivateFieldGet(this, _CTR_counter, "f")[i]++; - break; - } - } - } - encrypt(plaintext) { - var _a, _b; - const crypttext = new Uint8Array(plaintext); - for (let i = 0; i < crypttext.length; i++) { - if (__classPrivateFieldGet(this, _CTR_remainingIndex, "f") === 16) { - __classPrivateFieldSet(this, _CTR_remaining, this.aes.encrypt(__classPrivateFieldGet(this, _CTR_counter, "f")), "f"); - __classPrivateFieldSet(this, _CTR_remainingIndex, 0, "f"); - this.increment(); - } - crypttext[i] ^= __classPrivateFieldGet(this, _CTR_remaining, "f")[__classPrivateFieldSet(this, _CTR_remainingIndex, (_b = __classPrivateFieldGet(this, _CTR_remainingIndex, "f"), _a = _b++, _b), "f"), _a]; - } - return crypttext; - } - decrypt(ciphertext) { - return this.encrypt(ciphertext); - } -} -_CTR_remaining = new WeakMap(), _CTR_remainingIndex = new WeakMap(), _CTR_counter = new WeakMap(); -//# sourceMappingURL=mode-ctr.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ctr.js.map b/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ctr.js.map deleted file mode 100644 index a68834a7..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ctr.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mode-ctr.js","sourceRoot":"","sources":["../src.ts/mode-ctr.ts"],"names":[],"mappings":"AAAA,eAAe;;;;;;;;;;;;;AAEf,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,MAAM,OAAO,GAAI,SAAQ,eAAe;IAStC,YAAY,GAAe,EAAE,YAAkC;QAC7D,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QARzB,uCAAuC;QACvC,iCAAuB;QACvB,sCAAwB;QAExB,sBAAsB;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AG,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED,SAAS;QACP,KAAK,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;YAC5B,IAAI,uBAAA,IAAI,oBAAS,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;gBAC5B,uBAAA,IAAI,oBAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;aACtB;iBAAM;gBACL,uBAAA,IAAI,oBAAS,CAAC,CAAC,CAAC,EAAE,CAAC;gBACnB,MAAM;aACP;SACF;IACH,CAAC;IAED,OAAO,CAAC,SAAqB;;QAC3B,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,SAAS,CAAC,CAAC;QAE5C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACzC,IAAI,uBAAA,IAAI,2BAAgB,KAAK,EAAE,EAAE;gBAC/B,uBAAA,IAAI,kBAAc,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,uBAAA,IAAI,oBAAS,CAAC,MAAA,CAAC;gBAClD,uBAAA,IAAI,uBAAmB,CAAC,MAAA,CAAC;gBACzB,IAAI,CAAC,SAAS,EAAE,CAAC;aAClB;YACD,SAAS,CAAC,CAAC,CAAC,IAAI,uBAAA,IAAI,sBAAW,CAAC,kDAAA,CAAA,2DAAoB,EAApB,KAAA,IAAsB,IAAA,CAAA,MAAA,IAAA,CAAC,CAAC;SACzD;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,CAAC,UAAsB;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAClC,CAAC;CACF"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ecb.d.ts b/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ecb.d.ts deleted file mode 100644 index 0ca6eee3..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ecb.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ModeOfOperation } from "./mode.js"; -export declare class ECB extends ModeOfOperation { - constructor(key: Uint8Array); - encrypt(plaintext: Uint8Array): Uint8Array; - decrypt(crypttext: Uint8Array): Uint8Array; -} -//# sourceMappingURL=mode-ecb.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ecb.d.ts.map b/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ecb.d.ts.map deleted file mode 100644 index 7229be70..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ecb.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mode-ecb.d.ts","sourceRoot":"","sources":["../src.ts/mode-ecb.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,qBAAa,GAAI,SAAQ,eAAe;gBAE1B,GAAG,EAAE,UAAU;IAI3B,OAAO,CAAC,SAAS,EAAE,UAAU,GAAG,UAAU;IAa1C,OAAO,CAAC,SAAS,EAAE,UAAU,GAAG,UAAU;CAY3C"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ecb.js b/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ecb.js deleted file mode 100644 index 04dec16c..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ecb.js +++ /dev/null @@ -1,28 +0,0 @@ -// Electronic Code Book -import { ModeOfOperation } from "./mode.js"; -export class ECB extends ModeOfOperation { - constructor(key) { - super("ECB", key, ECB); - } - encrypt(plaintext) { - if (plaintext.length % 16) { - throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)"); - } - const crypttext = new Uint8Array(plaintext.length); - for (let i = 0; i < plaintext.length; i += 16) { - crypttext.set(this.aes.encrypt(plaintext.subarray(i, i + 16)), i); - } - return crypttext; - } - decrypt(crypttext) { - if (crypttext.length % 16) { - throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)"); - } - const plaintext = new Uint8Array(crypttext.length); - for (let i = 0; i < crypttext.length; i += 16) { - plaintext.set(this.aes.decrypt(crypttext.subarray(i, i + 16)), i); - } - return plaintext; - } -} -//# sourceMappingURL=mode-ecb.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ecb.js.map b/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ecb.js.map deleted file mode 100644 index eab89b7c..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ecb.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mode-ecb.js","sourceRoot":"","sources":["../src.ts/mode-ecb.ts"],"names":[],"mappings":"AAAA,uBAAuB;AAEvB,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,MAAM,OAAO,GAAI,SAAQ,eAAe;IAEtC,YAAY,GAAe;QACzB,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IACzB,CAAC;IAED,OAAO,CAAC,SAAqB;QAC3B,IAAI,SAAS,CAAC,MAAM,GAAG,EAAE,EAAE;YACvB,MAAM,IAAI,SAAS,CAAC,uDAAuD,CAAC,CAAC;SAChF;QAED,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACnD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;YAC3C,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SACrE;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,CAAC,SAAqB;QAC3B,IAAI,SAAS,CAAC,MAAM,GAAG,EAAE,EAAE;YACvB,MAAM,IAAI,SAAS,CAAC,wDAAwD,CAAC,CAAC;SACjF;QAED,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACnD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;YAC3C,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SACrE;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ofb.d.ts b/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ofb.d.ts deleted file mode 100644 index a62d0b41..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ofb.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ModeOfOperation } from "./mode.js"; -export declare class OFB extends ModeOfOperation { - #private; - constructor(key: Uint8Array, iv?: Uint8Array); - get iv(): Uint8Array; - encrypt(plaintext: Uint8Array): Uint8Array; - decrypt(ciphertext: Uint8Array): Uint8Array; -} -//# sourceMappingURL=mode-ofb.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ofb.d.ts.map b/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ofb.d.ts.map deleted file mode 100644 index ac15036a..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ofb.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mode-ofb.d.ts","sourceRoot":"","sources":["../src.ts/mode-ofb.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,qBAAa,GAAI,SAAQ,eAAe;;gBAK1B,GAAG,EAAE,UAAU,EAAE,EAAE,CAAC,EAAE,UAAU;IAgB5C,IAAI,EAAE,IAAI,UAAU,CAAqC;IAEzD,OAAO,CAAC,SAAS,EAAE,UAAU,GAAG,UAAU;IAiB1C,OAAO,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU;CAM5C"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ofb.js b/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ofb.js deleted file mode 100644 index 340c9adb..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ofb.js +++ /dev/null @@ -1,57 +0,0 @@ -// Output Feedback -var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; -}; -var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -}; -var _OFB_iv, _OFB_lastPrecipher, _OFB_lastPrecipherIndex; -import { ModeOfOperation } from "./mode.js"; -export class OFB extends ModeOfOperation { - constructor(key, iv) { - super("OFB", key, OFB); - _OFB_iv.set(this, void 0); - _OFB_lastPrecipher.set(this, void 0); - _OFB_lastPrecipherIndex.set(this, void 0); - if (iv) { - if (iv.length % 16) { - throw new TypeError("invalid iv size (must be 16 bytes)"); - } - __classPrivateFieldSet(this, _OFB_iv, new Uint8Array(iv), "f"); - } - else { - __classPrivateFieldSet(this, _OFB_iv, new Uint8Array(16), "f"); - } - __classPrivateFieldSet(this, _OFB_lastPrecipher, this.iv, "f"); - __classPrivateFieldSet(this, _OFB_lastPrecipherIndex, 16, "f"); - } - get iv() { return new Uint8Array(__classPrivateFieldGet(this, _OFB_iv, "f")); } - encrypt(plaintext) { - var _a, _b; - if (plaintext.length % 16) { - throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)"); - } - const ciphertext = new Uint8Array(plaintext); - for (let i = 0; i < ciphertext.length; i++) { - if (__classPrivateFieldGet(this, _OFB_lastPrecipherIndex, "f") === 16) { - __classPrivateFieldSet(this, _OFB_lastPrecipher, this.aes.encrypt(__classPrivateFieldGet(this, _OFB_lastPrecipher, "f")), "f"); - __classPrivateFieldSet(this, _OFB_lastPrecipherIndex, 0, "f"); - } - ciphertext[i] ^= __classPrivateFieldGet(this, _OFB_lastPrecipher, "f")[__classPrivateFieldSet(this, _OFB_lastPrecipherIndex, (_b = __classPrivateFieldGet(this, _OFB_lastPrecipherIndex, "f"), _a = _b++, _b), "f"), _a]; - } - return ciphertext; - } - decrypt(ciphertext) { - if (ciphertext.length % 16) { - throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)"); - } - return this.encrypt(ciphertext); - } -} -_OFB_iv = new WeakMap(), _OFB_lastPrecipher = new WeakMap(), _OFB_lastPrecipherIndex = new WeakMap(); -//# sourceMappingURL=mode-ofb.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ofb.js.map b/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ofb.js.map deleted file mode 100644 index 77c032cd..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode-ofb.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mode-ofb.js","sourceRoot":"","sources":["../src.ts/mode-ofb.ts"],"names":[],"mappings":"AAAA,kBAAkB;;;;;;;;;;;;;AAElB,OAAO,EAAE,eAAe,EAAE,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I,0BAAe,CAAC,sDAAA,CAAA,+DAAwB,EAAxB,KAAA,IAA0B,IAAA,CAAA,MAAA,IAAA,CAAC,CAAC;SAClE;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,OAAO,CAAC,UAAsB;QAC5B,IAAI,UAAU,CAAC,MAAM,GAAG,EAAE,EAAE;YACxB,MAAM,IAAI,SAAS,CAAC,wDAAwD,CAAC,CAAC;SACjF;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAClC,CAAC;CACF"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode.d.ts b/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode.d.ts deleted file mode 100644 index 825bba7c..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AES } from "./aes.js"; -export declare abstract class ModeOfOperation { - readonly aes: AES; - readonly name: string; - constructor(name: string, key: Uint8Array, cls?: any); - abstract encrypt(plaintext: Uint8Array): Uint8Array; - abstract decrypt(ciphertext: Uint8Array): Uint8Array; -} -//# sourceMappingURL=mode.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode.d.ts.map b/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode.d.ts.map deleted file mode 100644 index d3a09ec6..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mode.d.ts","sourceRoot":"","sources":["../src.ts/mode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,8BAAsB,eAAe;IACnC,QAAQ,CAAC,GAAG,EAAG,GAAG,CAAC;IACnB,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;gBAEX,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,CAAC,EAAE,GAAG;IAWpD,QAAQ,CAAC,OAAO,CAAC,SAAS,EAAE,UAAU,GAAG,UAAU;IACnD,QAAQ,CAAC,OAAO,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU;CACrD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode.js b/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode.js deleted file mode 100644 index 6a63c78c..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode.js +++ /dev/null @@ -1,13 +0,0 @@ -import { AES } from "./aes.js"; -export class ModeOfOperation { - constructor(name, key, cls) { - if (cls && !(this instanceof cls)) { - throw new Error(`${name} must be instantiated with "new"`); - } - Object.defineProperties(this, { - aes: { enumerable: true, value: new AES(key) }, - name: { enumerable: true, value: name } - }); - } -} -//# sourceMappingURL=mode.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode.js.map b/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode.js.map deleted file mode 100644 index e993a9cd..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/mode.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mode.js","sourceRoot":"","sources":["../src.ts/mode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,MAAM,OAAgB,eAAe;IAInC,YAAY,IAAY,EAAE,GAAe,EAAE,GAAS;QAClD,IAAI,GAAG,IAAI,CAAC,CAAC,IAAI,YAAY,GAAG,CAAC,EAAE;YACjC,MAAM,IAAI,KAAK,CAAC,GAAI,IAAK,kCAAkC,CAAC,CAAC;SAC9D;QAED,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE;YAC5B,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,GAAG,CAAC,GAAG,CAAC,EAAE;YAC9C,IAAI,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE;SACxC,CAAC,CAAC;IACL,CAAC;CAIF"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/package.json b/tools/mnemonic-test/node_modules/aes-js/lib.esm/package.json deleted file mode 100644 index 3dbc1ca5..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "module" -} diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/padding.d.ts b/tools/mnemonic-test/node_modules/aes-js/lib.esm/padding.d.ts deleted file mode 100644 index aaff7105..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/padding.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare function pkcs7Pad(data: Uint8Array): Uint8Array; -export declare function pkcs7Strip(data: Uint8Array): Uint8Array; -//# sourceMappingURL=padding.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/padding.d.ts.map b/tools/mnemonic-test/node_modules/aes-js/lib.esm/padding.d.ts.map deleted file mode 100644 index 1d958fb6..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/padding.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"padding.d.ts","sourceRoot":"","sources":["../src.ts/padding.ts"],"names":[],"mappings":"AACA,wBAAgB,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,CAWrD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,CAcvD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/padding.js b/tools/mnemonic-test/node_modules/aes-js/lib.esm/padding.js deleted file mode 100644 index 667599d3..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/padding.js +++ /dev/null @@ -1,26 +0,0 @@ -export function pkcs7Pad(data) { - const padder = 16 - (data.length % 16); - const result = new Uint8Array(data.length + padder); - result.set(data); - for (let i = data.length; i < result.length; i++) { - result[i] = padder; - } - return result; -} -export function pkcs7Strip(data) { - if (data.length < 16) { - throw new TypeError('PKCS#7 invalid length'); - } - const padder = data[data.length - 1]; - if (padder > 16) { - throw new TypeError('PKCS#7 padding byte out of range'); - } - const length = data.length - padder; - for (let i = 0; i < padder; i++) { - if (data[length + i] !== padder) { - throw new TypeError('PKCS#7 invalid padding byte'); - } - } - return new Uint8Array(data.subarray(0, length)); -} -//# sourceMappingURL=padding.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/padding.js.map b/tools/mnemonic-test/node_modules/aes-js/lib.esm/padding.js.map deleted file mode 100644 index 1db1e3a0..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/padding.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"padding.js","sourceRoot":"","sources":["../src.ts/padding.ts"],"names":[],"mappings":"AACA,MAAM,UAAU,QAAQ,CAAC,IAAgB;IACrC,MAAM,MAAM,GAAG,EAAE,GAAG,CAAC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAEvC,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACpD,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAEjB,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAC9C,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;KACtB;IAED,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,IAAgB;IACvC,IAAI,IAAI,CAAC,MAAM,GAAG,EAAE,EAAE;QAAE,MAAM,IAAI,SAAS,CAAC,uBAAuB,CAAC,CAAC;KAAE;IAEvE,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACrC,IAAI,MAAM,GAAG,EAAE,EAAE;QAAE,MAAM,IAAI,SAAS,CAAC,kCAAkC,CAAC,CAAC;KAAE;IAE7E,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;QAC7B,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,MAAM,EAAE;YAC7B,MAAM,IAAI,SAAS,CAAC,6BAA6B,CAAC,CAAC;SACtD;KACJ;IAED,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;AACpD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/tests.d.ts b/tools/mnemonic-test/node_modules/aes-js/lib.esm/tests.d.ts deleted file mode 100644 index 90993be8..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/tests.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=tests.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/tests.d.ts.map b/tools/mnemonic-test/node_modules/aes-js/lib.esm/tests.d.ts.map deleted file mode 100644 index 0305ca88..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/tests.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tests.d.ts","sourceRoot":"","sources":["../src.ts/tests.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/tests.js b/tools/mnemonic-test/node_modules/aes-js/lib.esm/tests.js deleted file mode 100644 index 25cfb9f1..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/tests.js +++ /dev/null @@ -1,81 +0,0 @@ -import assert from "assert"; -import fs from "fs"; -import { join, resolve } from "path"; -import * as aes from "./index.js"; -const root = (function () { - let root = process.cwd(); - while (true) { - if (fs.existsSync(join(root, "package.json"))) { - return root; - } - const parent = join(root, ".."); - if (parent === root) { - break; - } - root = parent; - } - throw new Error("could not find root"); -})(); -describe("Tests Encrypting and Decrypting", function () { - const json = fs.readFileSync(resolve(root, "./test/test-vectors.json")).toString(); - const tests = JSON.parse(json); - function getCrypter(key, test) { - switch (test.modeOfOperation) { - case "ctr": - return new aes.CTR(key, 0); - case "cbc": - return new aes.CBC(key, Buffer.from(test.iv)); - case "cfb": - return new aes.CFB(key, Buffer.from(test.iv), test.segmentSize * 8); - case "ecb": - return new aes.ECB(key); - case "ofb": - return new aes.OFB(key, Buffer.from(test.iv)); - } - return null; - } - tests.forEach((test, index) => { - it(`tests encrypting: ${test.modeOfOperation}.${index}`, function () { - const encrypter = getCrypter(Buffer.from(test.key), test); - if (!encrypter) { - this.skip(); - } - for (let i = 0; i < test.plaintext.length; i++) { - const plaintext = Buffer.from(test.plaintext[i]); - const ciphertext = Buffer.from(test.encrypted[i]); - const result = Buffer.from(encrypter.encrypt(plaintext)); - assert.ok(ciphertext.equals(result), "encrypting failed"); - } - }); - it(`tests decrypting: ${test.modeOfOperation}.${index}`, function () { - const decrypter = getCrypter(Buffer.from(test.key), test); - if (!decrypter) { - this.skip(); - } - for (let i = 0; i < test.plaintext.length; i++) { - const plaintext = Buffer.from(test.plaintext[i]); - const ciphertext = Buffer.from(test.encrypted[i]); - const result = Buffer.from(decrypter.decrypt(ciphertext)); - assert.ok(plaintext.equals(result), "decrypting failed"); - } - }); - }); -}); -describe("Tests Padding", function () { - for (let size = 0; size < 100; size++) { - it(`tests padding: length=${size}`, function () { - // Create a random piece of data - const data = new Uint8Array(size); - data.fill(42); - // Pad it - const padded = aes.pkcs7Pad(data); - assert.ok((padded.length % 16) === 0, "Failed to pad to block size"); - assert.ok(data.length <= padded.length && padded.length <= data.length + 16, "Padding went awry"); - assert.ok(padded[padded.length - 1] >= 1 && padded[padded.length - 1] <= 16, "Failed to pad to block size"); - // Trim it - const trimmed = aes.pkcs7Strip(padded); - assert.ok(Buffer.from(data).equals(trimmed), "Failed to trim to original data"); - }); - } -}); -//# sourceMappingURL=tests.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/lib.esm/tests.js.map b/tools/mnemonic-test/node_modules/aes-js/lib.esm/tests.js.map deleted file mode 100644 index 7b6ec261..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/lib.esm/tests.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tests.js","sourceRoot":"","sources":["../src.ts/tests.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAC3B,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAErC,OAAO,KAAK,GAAG,MAAM,YAAY,CAAC;AAclC,MAAM,IAAI,GAAG,CAAC;IACZ,IAAI,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAEzB,OAAO,IAAI,EAAE;QACX,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC,EAAE;YAAE,OAAO,IAAI,CAAC;SAAE;QAC/D,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAChC,IAAI,MAAM,KAAK,IAAI,EAAE;YAAE,MAAM;SAAE;QAC/B,IAAI,GAAG,MAAM,CAAC;KACf;IAED,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;AACzC,CAAC,CAAC,EAAE,CAAC;AAEL,QAAQ,CAAC,iCAAiC,EAAE;IAC1C,MAAM,IAAI,GAAG,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,0BAA0B,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAA;IAClF,MAAM,KAAK,GAAoB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAEhD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,IAAI,GAAG,GAAG,EAAE,IAAI,EAAE,EAAE;QACrC,EAAE,CAAC,yBAA0B,IAAK,EAAE,EAAE;YAEpC,gCAAgC;YAChC,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;YAClC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAEd,SAAS;YACT,MAAM,MAAM,GAAG,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAClC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,EAAE,CAAC,KAAK,CAAC,EAAE,6BAA6B,CAAC,CAAC;YACrE,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,GAAG,EAAE,EAAE,mBAAmB,CAAC,CAAC;YAClG,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,6BAA6B,CAAC,CAAC;YAE5G,UAAU;YACV,MAAM,OAAO,GAAG,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YACvC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,iCAAiC,CAAC,CAAC;QAClF,CAAC,CAAC,CAAC;KACJ;AACH,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/aes-js/misc/basedirs/lib.commonjs/README.md b/tools/mnemonic-test/node_modules/aes-js/misc/basedirs/lib.commonjs/README.md deleted file mode 100644 index b2a9245b..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/misc/basedirs/lib.commonjs/README.md +++ /dev/null @@ -1,6 +0,0 @@ -Gerneated Code (CommonJS) -========================= - -Do not modify code in this folder. - -See `/src.ts/` and `/tsconfig.commonjs.json`. diff --git a/tools/mnemonic-test/node_modules/aes-js/misc/basedirs/lib.commonjs/package.json b/tools/mnemonic-test/node_modules/aes-js/misc/basedirs/lib.commonjs/package.json deleted file mode 100644 index 5bbefffb..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/misc/basedirs/lib.commonjs/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "commonjs" -} diff --git a/tools/mnemonic-test/node_modules/aes-js/misc/basedirs/lib.esm/README.md b/tools/mnemonic-test/node_modules/aes-js/misc/basedirs/lib.esm/README.md deleted file mode 100644 index f2188af7..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/misc/basedirs/lib.esm/README.md +++ /dev/null @@ -1,6 +0,0 @@ -Gerneated Code (ESM) -==================== - -Do not modify code in this folder. - -See `/src.ts/` and `/tsconfig.esm.json`. diff --git a/tools/mnemonic-test/node_modules/aes-js/misc/basedirs/lib.esm/package.json b/tools/mnemonic-test/node_modules/aes-js/misc/basedirs/lib.esm/package.json deleted file mode 100644 index 3dbc1ca5..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/misc/basedirs/lib.esm/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "module" -} diff --git a/tools/mnemonic-test/node_modules/aes-js/package-commonjs.json b/tools/mnemonic-test/node_modules/aes-js/package-commonjs.json deleted file mode 100644 index 5bbefffb..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/package-commonjs.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "commonjs" -} diff --git a/tools/mnemonic-test/node_modules/aes-js/package.json b/tools/mnemonic-test/node_modules/aes-js/package.json deleted file mode 100644 index 85796c5a..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "aes-js", - "version": "4.0.0-beta.5", - "description": "A pure JavaScript implementation of the AES block cipher and all common modes of operation.", - "devDependencies": { - "@types/mocha": "^9.1.0", - "@types/node": "^16.7.10", - "mocha": "^9.2.2", - "typescript": "^4.7.4" - }, - "exports": { - ".": { - "import": "./lib.esm/index.js", - "default": "./lib.commonjs/index.js" - } - }, - "scripts": { - "auto-build": "npm run build -- -w", - "build": "tsc --build ./tsconfig.esm.json", - "build-all": "npm run build && npm run build-commonjs", - "build-clean": "npm run clean && npm run build-all", - "build-commonjs": "tsc --build ./tsconfig.commonjs.json && cp ./package-commonjs.json ./lib.commonjs/package.json", - "clean": "rm -rf lib.commonjs lib.esm && cp -r misc/basedirs/* .", - "test-commonjs": "mocha ./lib.commonjs/tests.js", - "test-esm": "mocha ./lib.esm/tests.js", - "test": "npm run test-commonjs && npm run test-esm" - }, - "main": "./lib.commonjs/index.js", - "module": "./lib.esm/index.js", - "publishConfig": { - "tag": "beta" - }, - "sideEffects": false, - "keywords": [ - "aes", - "aes-ctr", - "aes-ofb", - "aes-ecb", - "aes-cbc", - "aes-cfb", - "encrypt", - "decrypt", - "block", - "cipher" - ], - "repository": { - "type": "git", - "url": "git://github.com/ricmoo/aes-js.git" - }, - "bugs": { - "url": "http://github.com/ricmoo/aes-js/issues", - "email": "github@ricmoo.com" - }, - "author": "Richard Moore ", - "license": "MIT" -} diff --git a/tools/mnemonic-test/node_modules/aes-js/src.ts/aes.ts b/tools/mnemonic-test/node_modules/aes-js/src.ts/aes.ts deleted file mode 100644 index 69b0d05d..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/src.ts/aes.ts +++ /dev/null @@ -1,220 +0,0 @@ -/*! MIT License. Copyright 2015-2022 Richard Moore . See LICENSE.txt. */ - -// Number of rounds by keysize -const numberOfRounds: Record = { 16: 10, 24: 12, 32: 14 }; - -// Round constant words -const rcon = [0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91]; - -// S-box and Inverse S-box (S is for Substitution) -const S = [0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb, 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 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c, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06, 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d]; - -// Transformations for encryption -const T1 = [0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d, 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554, 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d, 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a, 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87, 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b, 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea, 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b, 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a, 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f, 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108, 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f, 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e, 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5, 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d, 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f, 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e, 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb, 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce, 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497, 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c, 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed, 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b, 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a, 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16, 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594, 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81, 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3, 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a, 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504, 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163, 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d, 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f, 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739, 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47, 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395, 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f, 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883, 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c, 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76, 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e, 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4, 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6, 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b, 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7, 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0, 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25, 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818, 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72, 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651, 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21, 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85, 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa, 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12, 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0, 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9, 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133, 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7, 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920, 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a, 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17, 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8, 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11, 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a]; -const T2 = [0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b, 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5, 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b, 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676, 0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d, 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0, 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf, 0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0, 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626, 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc, 0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1, 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515, 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3, 0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a, 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2, 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575, 0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a, 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0, 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3, 0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484, 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded, 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b, 0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939, 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf, 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb, 0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585, 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f, 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8, 0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f, 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5, 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121, 0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2, 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec, 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717, 0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d, 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373, 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc, 0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888, 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414, 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb, 0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a, 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c, 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262, 0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979, 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d, 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9, 0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea, 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808, 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e, 0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6, 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f, 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a, 0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666, 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e, 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9, 0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e, 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111, 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494, 0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9, 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf, 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d, 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868, 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f, 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616]; -const T3 = [0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b, 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5, 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b, 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76, 0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d, 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0, 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af, 0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0, 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26, 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc, 0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1, 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15, 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3, 0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a, 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2, 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75, 0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a, 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0, 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3, 0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384, 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed, 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b, 0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239, 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf, 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb, 0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185, 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f, 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8, 0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f, 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5, 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221, 0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2, 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec, 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17, 0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d, 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673, 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc, 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88, 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814, 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb, 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a, 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c, 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462, 0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279, 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d, 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9, 0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea, 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008, 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e, 0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6, 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f, 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a, 0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66, 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e, 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9, 0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e, 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211, 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394, 0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9, 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df, 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d, 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068, 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f, 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16]; -const T4 = [0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6, 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491, 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56, 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec, 0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa, 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb, 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45, 0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b, 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c, 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83, 0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9, 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a, 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d, 0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f, 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf, 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea, 0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34, 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b, 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d, 0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713, 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1, 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6, 0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72, 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85, 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed, 0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411, 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe, 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b, 0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05, 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1, 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342, 0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf, 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3, 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e, 0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a, 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6, 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3, 0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b, 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28, 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad, 0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14, 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8, 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4, 0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2, 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da, 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049, 0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf, 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810, 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c, 0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197, 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e, 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f, 0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc, 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c, 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069, 0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927, 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322, 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733, 0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9, 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5, 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a, 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0, 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e, 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c]; - -// Transformations for decryption -const T5 = [0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96, 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393, 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25, 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f, 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1, 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6, 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da, 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844, 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd, 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4, 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45, 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94, 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7, 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a, 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5, 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c, 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1, 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a, 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75, 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051, 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46, 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff, 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77, 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb, 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000, 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e, 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927, 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a, 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e, 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16, 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d, 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8, 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd, 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34, 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163, 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120, 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d, 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0, 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422, 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef, 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36, 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4, 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662, 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5, 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3, 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b, 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8, 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6, 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6, 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0, 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815, 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f, 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df, 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f, 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e, 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713, 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89, 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c, 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf, 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86, 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f, 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541, 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190, 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742]; -const T6 = [0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e, 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303, 0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c, 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3, 0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0, 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9, 0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259, 0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8, 0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971, 0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a, 0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f, 0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b, 0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8, 0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab, 0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708, 0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682, 0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2, 0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe, 0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb, 0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10, 0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd, 0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015, 0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e, 0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee, 0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000, 0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72, 0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39, 0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e, 0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91, 0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a, 0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17, 0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9, 0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60, 0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e, 0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1, 0xcad731dc, 0x10426385, 0x40139722, 0x2084c611, 0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1, 0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3, 0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964, 0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390, 0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b, 0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf, 0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46, 0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af, 0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512, 0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb, 0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a, 0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8, 0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c, 0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266, 0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8, 0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6, 0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604, 0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551, 0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41, 0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647, 0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c, 0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1, 0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737, 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db, 0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340, 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95, 0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1, 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857]; -const T7 = [0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27, 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3, 0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502, 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562, 0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe, 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3, 0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552, 0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9, 0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9, 0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce, 0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253, 0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908, 0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b, 0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655, 0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337, 0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16, 0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69, 0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6, 0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6, 0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e, 0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6, 0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050, 0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9, 0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8, 0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000, 0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a, 0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d, 0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436, 0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b, 0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12, 0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b, 0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e, 0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f, 0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb, 0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4, 0xdccad731, 0x85104263, 0x22401397, 0x112084c6, 0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729, 0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1, 0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9, 0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233, 0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4, 0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad, 0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e, 0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3, 0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25, 0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b, 0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f, 0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15, 0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0, 0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2, 0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7, 0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791, 0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496, 0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665, 0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b, 0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6, 0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13, 0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47, 0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7, 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844, 0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3, 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d, 0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456, 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8]; -const T8 = [0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a, 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b, 0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5, 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5, 0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d, 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b, 0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95, 0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e, 0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27, 0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d, 0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562, 0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9, 0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752, 0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66, 0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3, 0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced, 0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e, 0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4, 0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4, 0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd, 0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d, 0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60, 0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767, 0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79, 0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000, 0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c, 0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736, 0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24, 0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b, 0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c, 0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12, 0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814, 0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3, 0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b, 0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8, 0x31dccad7, 0x63851042, 0x97224013, 0xc6112084, 0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7, 0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077, 0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247, 0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22, 0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698, 0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f, 0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254, 0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582, 0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf, 0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb, 0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883, 0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef, 0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629, 0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035, 0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533, 0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17, 0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4, 0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46, 0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb, 0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d, 0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb, 0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a, 0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73, 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678, 0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2, 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff, 0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064, 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0]; - -// Transformations for decryption key expansion -const U1 = [0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3]; -const U2 = [0x00000000, 0x0b0e090d, 0x161c121a, 0x1d121b17, 0x2c382434, 0x27362d39, 0x3a24362e, 0x312a3f23, 0x58704868, 0x537e4165, 0x4e6c5a72, 0x4562537f, 0x74486c5c, 0x7f466551, 0x62547e46, 0x695a774b, 0xb0e090d0, 0xbbee99dd, 0xa6fc82ca, 0xadf28bc7, 0x9cd8b4e4, 0x97d6bde9, 0x8ac4a6fe, 0x81caaff3, 0xe890d8b8, 0xe39ed1b5, 0xfe8ccaa2, 0xf582c3af, 0xc4a8fc8c, 0xcfa6f581, 0xd2b4ee96, 0xd9bae79b, 0x7bdb3bbb, 0x70d532b6, 0x6dc729a1, 0x66c920ac, 0x57e31f8f, 0x5ced1682, 0x41ff0d95, 0x4af10498, 0x23ab73d3, 0x28a57ade, 0x35b761c9, 0x3eb968c4, 0x0f9357e7, 0x049d5eea, 0x198f45fd, 0x12814cf0, 0xcb3bab6b, 0xc035a266, 0xdd27b971, 0xd629b07c, 0xe7038f5f, 0xec0d8652, 0xf11f9d45, 0xfa119448, 0x934be303, 0x9845ea0e, 0x8557f119, 0x8e59f814, 0xbf73c737, 0xb47dce3a, 0xa96fd52d, 0xa261dc20, 0xf6ad766d, 0xfda37f60, 0xe0b16477, 0xebbf6d7a, 0xda955259, 0xd19b5b54, 0xcc894043, 0xc787494e, 0xaedd3e05, 0xa5d33708, 0xb8c12c1f, 0xb3cf2512, 0x82e51a31, 0x89eb133c, 0x94f9082b, 0x9ff70126, 0x464de6bd, 0x4d43efb0, 0x5051f4a7, 0x5b5ffdaa, 0x6a75c289, 0x617bcb84, 0x7c69d093, 0x7767d99e, 0x1e3daed5, 0x1533a7d8, 0x0821bccf, 0x032fb5c2, 0x32058ae1, 0x390b83ec, 0x241998fb, 0x2f1791f6, 0x8d764dd6, 0x867844db, 0x9b6a5fcc, 0x906456c1, 0xa14e69e2, 0xaa4060ef, 0xb7527bf8, 0xbc5c72f5, 0xd50605be, 0xde080cb3, 0xc31a17a4, 0xc8141ea9, 0xf93e218a, 0xf2302887, 0xef223390, 0xe42c3a9d, 0x3d96dd06, 0x3698d40b, 0x2b8acf1c, 0x2084c611, 0x11aef932, 0x1aa0f03f, 0x07b2eb28, 0x0cbce225, 0x65e6956e, 0x6ee89c63, 0x73fa8774, 0x78f48e79, 0x49deb15a, 0x42d0b857, 0x5fc2a340, 0x54ccaa4d, 0xf741ecda, 0xfc4fe5d7, 0xe15dfec0, 0xea53f7cd, 0xdb79c8ee, 0xd077c1e3, 0xcd65daf4, 0xc66bd3f9, 0xaf31a4b2, 0xa43fadbf, 0xb92db6a8, 0xb223bfa5, 0x83098086, 0x8807898b, 0x9515929c, 0x9e1b9b91, 0x47a17c0a, 0x4caf7507, 0x51bd6e10, 0x5ab3671d, 0x6b99583e, 0x60975133, 0x7d854a24, 0x768b4329, 0x1fd13462, 0x14df3d6f, 0x09cd2678, 0x02c32f75, 0x33e91056, 0x38e7195b, 0x25f5024c, 0x2efb0b41, 0x8c9ad761, 0x8794de6c, 0x9a86c57b, 0x9188cc76, 0xa0a2f355, 0xabacfa58, 0xb6bee14f, 0xbdb0e842, 0xd4ea9f09, 0xdfe49604, 0xc2f68d13, 0xc9f8841e, 0xf8d2bb3d, 0xf3dcb230, 0xeecea927, 0xe5c0a02a, 0x3c7a47b1, 0x37744ebc, 0x2a6655ab, 0x21685ca6, 0x10426385, 0x1b4c6a88, 0x065e719f, 0x0d507892, 0x640a0fd9, 0x6f0406d4, 0x72161dc3, 0x791814ce, 0x48322bed, 0x433c22e0, 0x5e2e39f7, 0x552030fa, 0x01ec9ab7, 0x0ae293ba, 0x17f088ad, 0x1cfe81a0, 0x2dd4be83, 0x26dab78e, 0x3bc8ac99, 0x30c6a594, 0x599cd2df, 0x5292dbd2, 0x4f80c0c5, 0x448ec9c8, 0x75a4f6eb, 0x7eaaffe6, 0x63b8e4f1, 0x68b6edfc, 0xb10c0a67, 0xba02036a, 0xa710187d, 0xac1e1170, 0x9d342e53, 0x963a275e, 0x8b283c49, 0x80263544, 0xe97c420f, 0xe2724b02, 0xff605015, 0xf46e5918, 0xc544663b, 0xce4a6f36, 0xd3587421, 0xd8567d2c, 0x7a37a10c, 0x7139a801, 0x6c2bb316, 0x6725ba1b, 0x560f8538, 0x5d018c35, 0x40139722, 0x4b1d9e2f, 0x2247e964, 0x2949e069, 0x345bfb7e, 0x3f55f273, 0x0e7fcd50, 0x0571c45d, 0x1863df4a, 0x136dd647, 0xcad731dc, 0xc1d938d1, 0xdccb23c6, 0xd7c52acb, 0xe6ef15e8, 0xede11ce5, 0xf0f307f2, 0xfbfd0eff, 0x92a779b4, 0x99a970b9, 0x84bb6bae, 0x8fb562a3, 0xbe9f5d80, 0xb591548d, 0xa8834f9a, 0xa38d4697]; -const U3 = [0x00000000, 0x0d0b0e09, 0x1a161c12, 0x171d121b, 0x342c3824, 0x3927362d, 0x2e3a2436, 0x23312a3f, 0x68587048, 0x65537e41, 0x724e6c5a, 0x7f456253, 0x5c74486c, 0x517f4665, 0x4662547e, 0x4b695a77, 0xd0b0e090, 0xddbbee99, 0xcaa6fc82, 0xc7adf28b, 0xe49cd8b4, 0xe997d6bd, 0xfe8ac4a6, 0xf381caaf, 0xb8e890d8, 0xb5e39ed1, 0xa2fe8cca, 0xaff582c3, 0x8cc4a8fc, 0x81cfa6f5, 0x96d2b4ee, 0x9bd9bae7, 0xbb7bdb3b, 0xb670d532, 0xa16dc729, 0xac66c920, 0x8f57e31f, 0x825ced16, 0x9541ff0d, 0x984af104, 0xd323ab73, 0xde28a57a, 0xc935b761, 0xc43eb968, 0xe70f9357, 0xea049d5e, 0xfd198f45, 0xf012814c, 0x6bcb3bab, 0x66c035a2, 0x71dd27b9, 0x7cd629b0, 0x5fe7038f, 0x52ec0d86, 0x45f11f9d, 0x48fa1194, 0x03934be3, 0x0e9845ea, 0x198557f1, 0x148e59f8, 0x37bf73c7, 0x3ab47dce, 0x2da96fd5, 0x20a261dc, 0x6df6ad76, 0x60fda37f, 0x77e0b164, 0x7aebbf6d, 0x59da9552, 0x54d19b5b, 0x43cc8940, 0x4ec78749, 0x05aedd3e, 0x08a5d337, 0x1fb8c12c, 0x12b3cf25, 0x3182e51a, 0x3c89eb13, 0x2b94f908, 0x269ff701, 0xbd464de6, 0xb04d43ef, 0xa75051f4, 0xaa5b5ffd, 0x896a75c2, 0x84617bcb, 0x937c69d0, 0x9e7767d9, 0xd51e3dae, 0xd81533a7, 0xcf0821bc, 0xc2032fb5, 0xe132058a, 0xec390b83, 0xfb241998, 0xf62f1791, 0xd68d764d, 0xdb867844, 0xcc9b6a5f, 0xc1906456, 0xe2a14e69, 0xefaa4060, 0xf8b7527b, 0xf5bc5c72, 0xbed50605, 0xb3de080c, 0xa4c31a17, 0xa9c8141e, 0x8af93e21, 0x87f23028, 0x90ef2233, 0x9de42c3a, 0x063d96dd, 0x0b3698d4, 0x1c2b8acf, 0x112084c6, 0x3211aef9, 0x3f1aa0f0, 0x2807b2eb, 0x250cbce2, 0x6e65e695, 0x636ee89c, 0x7473fa87, 0x7978f48e, 0x5a49deb1, 0x5742d0b8, 0x405fc2a3, 0x4d54ccaa, 0xdaf741ec, 0xd7fc4fe5, 0xc0e15dfe, 0xcdea53f7, 0xeedb79c8, 0xe3d077c1, 0xf4cd65da, 0xf9c66bd3, 0xb2af31a4, 0xbfa43fad, 0xa8b92db6, 0xa5b223bf, 0x86830980, 0x8b880789, 0x9c951592, 0x919e1b9b, 0x0a47a17c, 0x074caf75, 0x1051bd6e, 0x1d5ab367, 0x3e6b9958, 0x33609751, 0x247d854a, 0x29768b43, 0x621fd134, 0x6f14df3d, 0x7809cd26, 0x7502c32f, 0x5633e910, 0x5b38e719, 0x4c25f502, 0x412efb0b, 0x618c9ad7, 0x6c8794de, 0x7b9a86c5, 0x769188cc, 0x55a0a2f3, 0x58abacfa, 0x4fb6bee1, 0x42bdb0e8, 0x09d4ea9f, 0x04dfe496, 0x13c2f68d, 0x1ec9f884, 0x3df8d2bb, 0x30f3dcb2, 0x27eecea9, 0x2ae5c0a0, 0xb13c7a47, 0xbc37744e, 0xab2a6655, 0xa621685c, 0x85104263, 0x881b4c6a, 0x9f065e71, 0x920d5078, 0xd9640a0f, 0xd46f0406, 0xc372161d, 0xce791814, 0xed48322b, 0xe0433c22, 0xf75e2e39, 0xfa552030, 0xb701ec9a, 0xba0ae293, 0xad17f088, 0xa01cfe81, 0x832dd4be, 0x8e26dab7, 0x993bc8ac, 0x9430c6a5, 0xdf599cd2, 0xd25292db, 0xc54f80c0, 0xc8448ec9, 0xeb75a4f6, 0xe67eaaff, 0xf163b8e4, 0xfc68b6ed, 0x67b10c0a, 0x6aba0203, 0x7da71018, 0x70ac1e11, 0x539d342e, 0x5e963a27, 0x498b283c, 0x44802635, 0x0fe97c42, 0x02e2724b, 0x15ff6050, 0x18f46e59, 0x3bc54466, 0x36ce4a6f, 0x21d35874, 0x2cd8567d, 0x0c7a37a1, 0x017139a8, 0x166c2bb3, 0x1b6725ba, 0x38560f85, 0x355d018c, 0x22401397, 0x2f4b1d9e, 0x642247e9, 0x692949e0, 0x7e345bfb, 0x733f55f2, 0x500e7fcd, 0x5d0571c4, 0x4a1863df, 0x47136dd6, 0xdccad731, 0xd1c1d938, 0xc6dccb23, 0xcbd7c52a, 0xe8e6ef15, 0xe5ede11c, 0xf2f0f307, 0xfffbfd0e, 0xb492a779, 0xb999a970, 0xae84bb6b, 0xa38fb562, 0x80be9f5d, 0x8db59154, 0x9aa8834f, 0x97a38d46]; -const U4 = [0x00000000, 0x090d0b0e, 0x121a161c, 0x1b171d12, 0x24342c38, 0x2d392736, 0x362e3a24, 0x3f23312a, 0x48685870, 0x4165537e, 0x5a724e6c, 0x537f4562, 0x6c5c7448, 0x65517f46, 0x7e466254, 0x774b695a, 0x90d0b0e0, 0x99ddbbee, 0x82caa6fc, 0x8bc7adf2, 0xb4e49cd8, 0xbde997d6, 0xa6fe8ac4, 0xaff381ca, 0xd8b8e890, 0xd1b5e39e, 0xcaa2fe8c, 0xc3aff582, 0xfc8cc4a8, 0xf581cfa6, 0xee96d2b4, 0xe79bd9ba, 0x3bbb7bdb, 0x32b670d5, 0x29a16dc7, 0x20ac66c9, 0x1f8f57e3, 0x16825ced, 0x0d9541ff, 0x04984af1, 0x73d323ab, 0x7ade28a5, 0x61c935b7, 0x68c43eb9, 0x57e70f93, 0x5eea049d, 0x45fd198f, 0x4cf01281, 0xab6bcb3b, 0xa266c035, 0xb971dd27, 0xb07cd629, 0x8f5fe703, 0x8652ec0d, 0x9d45f11f, 0x9448fa11, 0xe303934b, 0xea0e9845, 0xf1198557, 0xf8148e59, 0xc737bf73, 0xce3ab47d, 0xd52da96f, 0xdc20a261, 0x766df6ad, 0x7f60fda3, 0x6477e0b1, 0x6d7aebbf, 0x5259da95, 0x5b54d19b, 0x4043cc89, 0x494ec787, 0x3e05aedd, 0x3708a5d3, 0x2c1fb8c1, 0x2512b3cf, 0x1a3182e5, 0x133c89eb, 0x082b94f9, 0x01269ff7, 0xe6bd464d, 0xefb04d43, 0xf4a75051, 0xfdaa5b5f, 0xc2896a75, 0xcb84617b, 0xd0937c69, 0xd99e7767, 0xaed51e3d, 0xa7d81533, 0xbccf0821, 0xb5c2032f, 0x8ae13205, 0x83ec390b, 0x98fb2419, 0x91f62f17, 0x4dd68d76, 0x44db8678, 0x5fcc9b6a, 0x56c19064, 0x69e2a14e, 0x60efaa40, 0x7bf8b752, 0x72f5bc5c, 0x05bed506, 0x0cb3de08, 0x17a4c31a, 0x1ea9c814, 0x218af93e, 0x2887f230, 0x3390ef22, 0x3a9de42c, 0xdd063d96, 0xd40b3698, 0xcf1c2b8a, 0xc6112084, 0xf93211ae, 0xf03f1aa0, 0xeb2807b2, 0xe2250cbc, 0x956e65e6, 0x9c636ee8, 0x877473fa, 0x8e7978f4, 0xb15a49de, 0xb85742d0, 0xa3405fc2, 0xaa4d54cc, 0xecdaf741, 0xe5d7fc4f, 0xfec0e15d, 0xf7cdea53, 0xc8eedb79, 0xc1e3d077, 0xdaf4cd65, 0xd3f9c66b, 0xa4b2af31, 0xadbfa43f, 0xb6a8b92d, 0xbfa5b223, 0x80868309, 0x898b8807, 0x929c9515, 0x9b919e1b, 0x7c0a47a1, 0x75074caf, 0x6e1051bd, 0x671d5ab3, 0x583e6b99, 0x51336097, 0x4a247d85, 0x4329768b, 0x34621fd1, 0x3d6f14df, 0x267809cd, 0x2f7502c3, 0x105633e9, 0x195b38e7, 0x024c25f5, 0x0b412efb, 0xd7618c9a, 0xde6c8794, 0xc57b9a86, 0xcc769188, 0xf355a0a2, 0xfa58abac, 0xe14fb6be, 0xe842bdb0, 0x9f09d4ea, 0x9604dfe4, 0x8d13c2f6, 0x841ec9f8, 0xbb3df8d2, 0xb230f3dc, 0xa927eece, 0xa02ae5c0, 0x47b13c7a, 0x4ebc3774, 0x55ab2a66, 0x5ca62168, 0x63851042, 0x6a881b4c, 0x719f065e, 0x78920d50, 0x0fd9640a, 0x06d46f04, 0x1dc37216, 0x14ce7918, 0x2bed4832, 0x22e0433c, 0x39f75e2e, 0x30fa5520, 0x9ab701ec, 0x93ba0ae2, 0x88ad17f0, 0x81a01cfe, 0xbe832dd4, 0xb78e26da, 0xac993bc8, 0xa59430c6, 0xd2df599c, 0xdbd25292, 0xc0c54f80, 0xc9c8448e, 0xf6eb75a4, 0xffe67eaa, 0xe4f163b8, 0xedfc68b6, 0x0a67b10c, 0x036aba02, 0x187da710, 0x1170ac1e, 0x2e539d34, 0x275e963a, 0x3c498b28, 0x35448026, 0x420fe97c, 0x4b02e272, 0x5015ff60, 0x5918f46e, 0x663bc544, 0x6f36ce4a, 0x7421d358, 0x7d2cd856, 0xa10c7a37, 0xa8017139, 0xb3166c2b, 0xba1b6725, 0x8538560f, 0x8c355d01, 0x97224013, 0x9e2f4b1d, 0xe9642247, 0xe0692949, 0xfb7e345b, 0xf2733f55, 0xcd500e7f, 0xc45d0571, 0xdf4a1863, 0xd647136d, 0x31dccad7, 0x38d1c1d9, 0x23c6dccb, 0x2acbd7c5, 0x15e8e6ef, 0x1ce5ede1, 0x07f2f0f3, 0x0efffbfd, 0x79b492a7, 0x70b999a9, 0x6bae84bb, 0x62a38fb5, 0x5d80be9f, 0x548db591, 0x4f9aa883, 0x4697a38d]; - -function convertToInt32(bytes: Uint8Array): Array { - const result = [ ]; - for (let i = 0; i < bytes.length; i += 4) { - result.push((bytes[i] << 24) | (bytes[i + 1] << 16) | (bytes[i + 2] << 8) | bytes[i + 3]); - } - return result; -} - -export class AES { - readonly #key: Uint8Array; - readonly #Kd: Array>; - readonly #Ke: Array>; - - get key(): Uint8Array { return this.#key.slice(); } - - constructor(key: Uint8Array) { - if (!(this instanceof AES)) { - throw Error('AES must be instanitated with `new`'); - } - - this.#key = new Uint8Array(key); - - const rounds = numberOfRounds[this.key.length]; - if (rounds == null) { - throw new TypeError('invalid key size (must be 16, 24 or 32 bytes)'); - } - - // encryption round keys - this.#Ke = []; - - // decryption round keys - this.#Kd = []; - - for (let i = 0; i <= rounds; i++) { - this.#Ke.push([0, 0, 0, 0]); - this.#Kd.push([0, 0, 0, 0]); - } - - const roundKeyCount = (rounds + 1) * 4; - const KC = this.key.length / 4; - - // convert the key into ints - const tk = convertToInt32(this.key); - - // copy values into round key arrays - let index; - for (let i = 0; i < KC; i++) { - index = i >> 2; - this.#Ke[index][i % 4] = tk[i]; - this.#Kd[rounds - index][i % 4] = tk[i]; - } - - // key expansion (fips-197 section 5.2) - let rconpointer = 0; - let t = KC, tt; - while (t < roundKeyCount) { - tt = tk[KC - 1]; - tk[0] ^= ((S[(tt >> 16) & 0xFF] << 24) ^ - (S[(tt >> 8) & 0xFF] << 16) ^ - (S[ tt & 0xFF] << 8) ^ - S[(tt >> 24) & 0xFF] ^ - (rcon[rconpointer] << 24)); - rconpointer += 1; - - // key expansion (for non-256 bit) - if (KC != 8) { - for (let i = 1; i < KC; i++) { - tk[i] ^= tk[i - 1]; - } - - // key expansion for 256-bit keys is "slightly different" (fips-197) - } else { - for (let i = 1; i < (KC / 2); i++) { - tk[i] ^= tk[i - 1]; - } - tt = tk[(KC / 2) - 1]; - - tk[KC / 2] ^= (S[ tt & 0xFF] ^ - (S[(tt >> 8) & 0xFF] << 8) ^ - (S[(tt >> 16) & 0xFF] << 16) ^ - (S[(tt >> 24) & 0xFF] << 24)); - - for (let i = (KC / 2) + 1; i < KC; i++) { - tk[i] ^= tk[i - 1]; - } - } - - // copy values into round key arrays - let i = 0, r, c; - while (i < KC && t < roundKeyCount) { - r = t >> 2; - c = t % 4; - this.#Ke[r][c] = tk[i]; - this.#Kd[rounds - r][c] = tk[i++]; - t++; - } - } - - // inverse-cipher-ify the decryption round key (fips-197 section 5.3) - for (let r = 1; r < rounds; r++) { - for (let c = 0; c < 4; c++) { - tt = this.#Kd[r][c]; - this.#Kd[r][c] = (U1[(tt >> 24) & 0xFF] ^ - U2[(tt >> 16) & 0xFF] ^ - U3[(tt >> 8) & 0xFF] ^ - U4[ tt & 0xFF]); - } - } - } - - encrypt(plaintext: Uint8Array): Uint8Array { - if (plaintext.length != 16) { - throw new TypeError('invalid plaintext size (must be 16 bytes)'); - } - - const rounds = this.#Ke.length - 1; - const a = [0, 0, 0, 0]; - - // convert plaintext to (ints ^ key) - let t = convertToInt32(plaintext); - for (let i = 0; i < 4; i++) { - t[i] ^= this.#Ke[0][i]; - } - - // apply round transforms - for (let r = 1; r < rounds; r++) { - for (let i = 0; i < 4; i++) { - a[i] = (T1[(t[ i ] >> 24) & 0xff] ^ - T2[(t[(i + 1) % 4] >> 16) & 0xff] ^ - T3[(t[(i + 2) % 4] >> 8) & 0xff] ^ - T4[ t[(i + 3) % 4] & 0xff] ^ - this.#Ke[r][i]); - } - t = a.slice(); - } - - // the last round is special - const result = new Uint8Array(16); - let tt = 0; - for (let i = 0; i < 4; i++) { - tt = this.#Ke[rounds][i]; - result[4 * i ] = (S[(t[ i ] >> 24) & 0xff] ^ (tt >> 24)) & 0xff; - result[4 * i + 1] = (S[(t[(i + 1) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff; - result[4 * i + 2] = (S[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff; - result[4 * i + 3] = (S[ t[(i + 3) % 4] & 0xff] ^ tt ) & 0xff; - } - - return result; - } - - decrypt(ciphertext: Uint8Array): Uint8Array { - if (ciphertext.length != 16) { - throw new TypeError('invalid ciphertext size (must be 16 bytes)'); - } - - const rounds = this.#Kd.length - 1; - const a = [0, 0, 0, 0]; - - // convert plaintext to (ints ^ key) - let t = convertToInt32(ciphertext); - for (let i = 0; i < 4; i++) { - t[i] ^= this.#Kd[0][i]; - } - - // apply round transforms - for (let r = 1; r < rounds; r++) { - for (let i = 0; i < 4; i++) { - a[i] = (T5[(t[ i ] >> 24) & 0xff] ^ - T6[(t[(i + 3) % 4] >> 16) & 0xff] ^ - T7[(t[(i + 2) % 4] >> 8) & 0xff] ^ - T8[ t[(i + 1) % 4] & 0xff] ^ - this.#Kd[r][i]); - } - t = a.slice(); - } - - // the last round is special - const result = new Uint8Array(16); - let tt = 0; - for (let i = 0; i < 4; i++) { - tt = this.#Kd[rounds][i]; - result[4 * i ] = (Si[(t[ i ] >> 24) & 0xff] ^ (tt >> 24)) & 0xff; - result[4 * i + 1] = (Si[(t[(i + 3) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff; - result[4 * i + 2] = (Si[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff; - result[4 * i + 3] = (Si[ t[(i + 1) % 4] & 0xff] ^ tt ) & 0xff; - } - - return result; - } -} diff --git a/tools/mnemonic-test/node_modules/aes-js/src.ts/index.ts b/tools/mnemonic-test/node_modules/aes-js/src.ts/index.ts deleted file mode 100644 index 4f9edd46..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/src.ts/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -export { AES } from "./aes.js"; - -export { ModeOfOperation } from "./mode.js"; - -export { CBC } from "./mode-cbc.js"; -export { CFB } from "./mode-cfb.js"; -export { CTR } from "./mode-ctr.js"; -export { ECB } from "./mode-ecb.js"; -export { OFB } from "./mode-ofb.js"; - -export { pkcs7Pad, pkcs7Strip } from "./padding.js"; diff --git a/tools/mnemonic-test/node_modules/aes-js/src.ts/mode-cbc.ts b/tools/mnemonic-test/node_modules/aes-js/src.ts/mode-cbc.ts deleted file mode 100644 index 3e18c035..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/src.ts/mode-cbc.ts +++ /dev/null @@ -1,61 +0,0 @@ -// Cipher Block Chaining - -import { ModeOfOperation } from "./mode.js"; - -export class CBC extends ModeOfOperation { - #iv: Uint8Array; - #lastBlock: Uint8Array; - - constructor(key: Uint8Array, iv?: Uint8Array) { - super("ECC", key, CBC); - - if (iv) { - if (iv.length % 16) { - throw new TypeError("invalid iv size (must be 16 bytes)"); - } - this.#iv = new Uint8Array(iv); - } else { - this.#iv = new Uint8Array(16); - } - - this.#lastBlock = this.iv; - } - - get iv(): Uint8Array { return new Uint8Array(this.#iv); } - - encrypt(plaintext: Uint8Array): Uint8Array { - if (plaintext.length % 16) { - throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)"); - } - - const ciphertext = new Uint8Array(plaintext.length); - for (let i = 0; i < plaintext.length; i += 16) { - for (let j = 0; j < 16; j++) { - this.#lastBlock[j] ^= plaintext[i + j]; - } - - this.#lastBlock = this.aes.encrypt(this.#lastBlock); - ciphertext.set(this.#lastBlock, i); - } - - return ciphertext; - } - - decrypt(ciphertext: Uint8Array): Uint8Array { - if (ciphertext.length % 16) { - throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)"); - } - - const plaintext = new Uint8Array(ciphertext.length); - for (let i = 0; i < ciphertext.length; i += 16) { - const block = this.aes.decrypt(ciphertext.subarray(i, i + 16)); - - for (let j = 0; j < 16; j++) { - plaintext[i + j] = block[j] ^ this.#lastBlock[j]; - this.#lastBlock[j] = ciphertext[i + j]; - } - } - - return plaintext; - } -} diff --git a/tools/mnemonic-test/node_modules/aes-js/src.ts/mode-cfb.ts b/tools/mnemonic-test/node_modules/aes-js/src.ts/mode-cfb.ts deleted file mode 100644 index ab407ca9..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/src.ts/mode-cfb.ts +++ /dev/null @@ -1,86 +0,0 @@ -// Cipher Feedback - -import { ModeOfOperation } from "./mode.js"; - -export class CFB extends ModeOfOperation { - #iv: Uint8Array; - #shiftRegister: Uint8Array; - - readonly segmentSize!: number; - - constructor(key: Uint8Array, iv?: Uint8Array, segmentSize: number = 8) { - super("CFB", key, CFB); - - // This library currently only handles byte-aligned segmentSize - if (!Number.isInteger(segmentSize) || (segmentSize % 8)) { - throw new TypeError("invalid segmentSize"); - } - - Object.defineProperties(this, { - segmentSize: { enumerable: true, value: segmentSize } - }); - - if (iv) { - if (iv.length % 16) { - throw new TypeError("invalid iv size (must be 16 bytes)"); - } - this.#iv = new Uint8Array(iv); - } else { - this.#iv = new Uint8Array(16); - } - - this.#shiftRegister = this.iv; - } - - get iv(): Uint8Array { return new Uint8Array(this.#iv); } - - #shift(data: Uint8Array): void { - const segmentSize = this.segmentSize / 8; - - // Shift the register - this.#shiftRegister.set(this.#shiftRegister.subarray(segmentSize)); - this.#shiftRegister.set(data.subarray(0, segmentSize), 16 - segmentSize); - } - - encrypt(plaintext: Uint8Array): Uint8Array { - if (8 * plaintext.length % this.segmentSize) { - throw new TypeError("invalid plaintext size (must be multiple of segmentSize bytes)"); - } - - const segmentSize = this.segmentSize / 8; - - const ciphertext = new Uint8Array(plaintext); - - for (let i = 0; i < ciphertext.length; i += segmentSize) { - const xorSegment = this.aes.encrypt(this.#shiftRegister); - for (let j = 0; j < segmentSize; j++) { - ciphertext[i + j] ^= xorSegment[j]; - } - - this.#shift(ciphertext.subarray(i)); - } - - return ciphertext; - } - - decrypt(ciphertext: Uint8Array): Uint8Array { - if (8 * ciphertext.length % this.segmentSize) { - throw new TypeError("invalid ciphertext size (must be multiple of segmentSize bytes)"); - } - - const segmentSize = this.segmentSize / 8; - - const plaintext = new Uint8Array(ciphertext); - - for (let i = 0; i < plaintext.length; i += segmentSize) { - const xorSegment = this.aes.encrypt(this.#shiftRegister); - for (let j = 0; j < segmentSize; j++) { - plaintext[i + j] ^= xorSegment[j]; - } - - this.#shift(ciphertext.subarray(i)); - } - - return plaintext; - } -} diff --git a/tools/mnemonic-test/node_modules/aes-js/src.ts/mode-ctr.ts b/tools/mnemonic-test/node_modules/aes-js/src.ts/mode-ctr.ts deleted file mode 100644 index d23d8bb5..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/src.ts/mode-ctr.ts +++ /dev/null @@ -1,82 +0,0 @@ -// Counter Mode - -import { ModeOfOperation } from "./mode.js"; - -export class CTR extends ModeOfOperation { - - // Remaining bytes for the one-time pad - #remaining: Uint8Array; - #remainingIndex: number; - - // The current counter - #counter: Uint8Array; - - constructor(key: Uint8Array, initialValue?: number | Uint8Array) { - super("CTR", key, CTR); - - this.#counter = new Uint8Array(16) - this.#counter.fill(0); - - this.#remaining = this.#counter; // This will be discarded immediately - this.#remainingIndex = 16; - - if (initialValue == null) { initialValue = 1; } - - if (typeof(initialValue) === "number") { - this.setCounterValue(initialValue); - } else { - this.setCounterBytes(initialValue); - } - } - - get counter(): Uint8Array { return new Uint8Array(this.#counter); } - - setCounterValue(value: number): void { - if (!Number.isInteger(value) || value < 0 || value > Number.MAX_SAFE_INTEGER) { - throw new TypeError("invalid counter initial integer value"); - } - - for (let index = 15; index >= 0; --index) { - this.#counter[index] = value % 256; - value = Math.floor(value / 256); - } - } - - setCounterBytes(value: Uint8Array): void { - if (value.length !== 16) { - throw new TypeError("invalid counter initial Uint8Array value length"); - } - - this.#counter.set(value); - } - - increment() { - for (let i = 15; i >= 0; i--) { - if (this.#counter[i] === 255) { - this.#counter[i] = 0; - } else { - this.#counter[i]++; - break; - } - } - } - - encrypt(plaintext: Uint8Array): Uint8Array { - const crypttext = new Uint8Array(plaintext); - - for (let i = 0; i < crypttext.length; i++) { - if (this.#remainingIndex === 16) { - this.#remaining = this.aes.encrypt(this.#counter); - this.#remainingIndex = 0; - this.increment(); - } - crypttext[i] ^= this.#remaining[this.#remainingIndex++]; - } - - return crypttext; - } - - decrypt(ciphertext: Uint8Array): Uint8Array { - return this.encrypt(ciphertext); - } -} diff --git a/tools/mnemonic-test/node_modules/aes-js/src.ts/mode-ecb.ts b/tools/mnemonic-test/node_modules/aes-js/src.ts/mode-ecb.ts deleted file mode 100644 index 370674de..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/src.ts/mode-ecb.ts +++ /dev/null @@ -1,36 +0,0 @@ -// Electronic Code Book - -import { ModeOfOperation } from "./mode.js"; - -export class ECB extends ModeOfOperation { - - constructor(key: Uint8Array) { - super("ECB", key, ECB); - } - - encrypt(plaintext: Uint8Array): Uint8Array { - if (plaintext.length % 16) { - throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)"); - } - - const crypttext = new Uint8Array(plaintext.length); - for (let i = 0; i < plaintext.length; i += 16) { - crypttext.set(this.aes.encrypt(plaintext.subarray(i, i + 16)), i); - } - - return crypttext; - } - - decrypt(crypttext: Uint8Array): Uint8Array { - if (crypttext.length % 16) { - throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)"); - } - - const plaintext = new Uint8Array(crypttext.length); - for (let i = 0; i < crypttext.length; i += 16) { - plaintext.set(this.aes.decrypt(crypttext.subarray(i, i + 16)), i); - } - - return plaintext; - } -} diff --git a/tools/mnemonic-test/node_modules/aes-js/src.ts/mode-ofb.ts b/tools/mnemonic-test/node_modules/aes-js/src.ts/mode-ofb.ts deleted file mode 100644 index a95f1e2f..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/src.ts/mode-ofb.ts +++ /dev/null @@ -1,51 +0,0 @@ -// Output Feedback - -import { ModeOfOperation } from "./mode.js"; - -export class OFB extends ModeOfOperation { - #iv: Uint8Array; - #lastPrecipher: Uint8Array; - #lastPrecipherIndex: number; - - constructor(key: Uint8Array, iv?: Uint8Array) { - super("OFB", key, OFB); - - if (iv) { - if (iv.length % 16) { - throw new TypeError("invalid iv size (must be 16 bytes)"); - } - this.#iv = new Uint8Array(iv); - } else { - this.#iv = new Uint8Array(16); - } - - this.#lastPrecipher = this.iv; - this.#lastPrecipherIndex = 16; - } - - get iv(): Uint8Array { return new Uint8Array(this.#iv); } - - encrypt(plaintext: Uint8Array): Uint8Array { - if (plaintext.length % 16) { - throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)"); - } - - const ciphertext = new Uint8Array(plaintext); - for (let i = 0; i < ciphertext.length; i++) { - if (this.#lastPrecipherIndex === 16) { - this.#lastPrecipher = this.aes.encrypt(this.#lastPrecipher); - this.#lastPrecipherIndex = 0; - } - ciphertext[i] ^= this.#lastPrecipher[this.#lastPrecipherIndex++]; - } - - return ciphertext; - } - - decrypt(ciphertext: Uint8Array): Uint8Array { - if (ciphertext.length % 16) { - throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)"); - } - return this.encrypt(ciphertext); - } -} diff --git a/tools/mnemonic-test/node_modules/aes-js/src.ts/mode.ts b/tools/mnemonic-test/node_modules/aes-js/src.ts/mode.ts deleted file mode 100644 index a53ef326..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/src.ts/mode.ts +++ /dev/null @@ -1,21 +0,0 @@ - -import { AES } from "./aes.js"; - -export abstract class ModeOfOperation { - readonly aes!: AES; - readonly name!: string; - - constructor(name: string, key: Uint8Array, cls?: any) { - if (cls && !(this instanceof cls)) { - throw new Error(`${ name } must be instantiated with "new"`); - } - - Object.defineProperties(this, { - aes: { enumerable: true, value: new AES(key) }, - name: { enumerable: true, value: name } - }); - } - - abstract encrypt(plaintext: Uint8Array): Uint8Array; - abstract decrypt(ciphertext: Uint8Array): Uint8Array; -} diff --git a/tools/mnemonic-test/node_modules/aes-js/src.ts/padding.ts b/tools/mnemonic-test/node_modules/aes-js/src.ts/padding.ts deleted file mode 100644 index 8c0ceec4..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/src.ts/padding.ts +++ /dev/null @@ -1,29 +0,0 @@ - -export function pkcs7Pad(data: Uint8Array): Uint8Array { - const padder = 16 - (data.length % 16); - - const result = new Uint8Array(data.length + padder); - result.set(data); - - for (let i = data.length; i < result.length; i++) { - result[i] = padder; - } - - return result; -} - -export function pkcs7Strip(data: Uint8Array): Uint8Array { - if (data.length < 16) { throw new TypeError('PKCS#7 invalid length'); } - - const padder = data[data.length - 1]; - if (padder > 16) { throw new TypeError('PKCS#7 padding byte out of range'); } - - const length = data.length - padder; - for (let i = 0; i < padder; i++) { - if (data[length + i] !== padder) { - throw new TypeError('PKCS#7 invalid padding byte'); - } - } - - return new Uint8Array(data.subarray(0, length)); -} diff --git a/tools/mnemonic-test/node_modules/aes-js/src.ts/tests.ts b/tools/mnemonic-test/node_modules/aes-js/src.ts/tests.ts deleted file mode 100644 index ae5c8ea9..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/src.ts/tests.ts +++ /dev/null @@ -1,102 +0,0 @@ -import assert from "assert" -import fs from "fs"; -import { join, resolve } from "path"; - -import * as aes from "./index.js"; - -interface TestCase { - modeOfOperation: string; - - iv: Array; - key: Array; - - plaintext: Array>; - encrypted: Array>; - - segmentSize: number; -} - -const root = (function() { - let root = process.cwd(); - - while (true) { - if (fs.existsSync(join(root, "package.json"))) { return root; } - const parent = join(root, ".."); - if (parent === root) { break; } - root = parent; - } - - throw new Error("could not find root"); -})(); - -describe("Tests Encrypting and Decrypting", function() { - const json = fs.readFileSync(resolve(root, "./test/test-vectors.json")).toString() - const tests: Array = JSON.parse(json); - - function getCrypter(key: Uint8Array, test: TestCase): null | aes.ModeOfOperation { - switch (test.modeOfOperation) { - case "ctr": - return new aes.CTR(key, 0); - case "cbc": - return new aes.CBC(key, Buffer.from(test.iv)); - case "cfb": - return new aes.CFB(key, Buffer.from(test.iv), test.segmentSize * 8); - case "ecb": - return new aes.ECB(key); - case "ofb": - return new aes.OFB(key, Buffer.from(test.iv)); - } - - return null; - } - - tests.forEach((test, index) => { - - it(`tests encrypting: ${ test. modeOfOperation}.${ index }`, function() { - const encrypter = getCrypter(Buffer.from(test.key), test); - if (!encrypter) { this.skip(); } - - for (let i = 0; i < test.plaintext.length; i++) { - const plaintext = Buffer.from(test.plaintext[i]); - const ciphertext = Buffer.from(test.encrypted[i]); - - const result = Buffer.from(encrypter.encrypt(plaintext)); - assert.ok(ciphertext.equals(result), "encrypting failed"); - } - }); - - it(`tests decrypting: ${ test. modeOfOperation}.${ index }`, function() { - const decrypter = getCrypter(Buffer.from(test.key), test); - if (!decrypter) { this.skip(); } - - for (let i = 0; i < test.plaintext.length; i++) { - const plaintext = Buffer.from(test.plaintext[i]); - const ciphertext = Buffer.from(test.encrypted[i]); - - const result = Buffer.from(decrypter.decrypt(ciphertext)); - assert.ok(plaintext.equals(result), "decrypting failed"); - } - }); - }); -}); - -describe("Tests Padding", function() { - for (let size = 0; size < 100; size++) { - it(`tests padding: length=${ size }`, function() { - - // Create a random piece of data - const data = new Uint8Array(size); - data.fill(42); - - // Pad it - const padded = aes.pkcs7Pad(data); - assert.ok((padded.length % 16) === 0, "Failed to pad to block size"); - assert.ok(data.length <= padded.length && padded.length <= data.length + 16, "Padding went awry"); - assert.ok(padded[padded.length - 1] >= 1 && padded[padded.length - 1] <= 16, "Failed to pad to block size"); - - // Trim it - const trimmed = aes.pkcs7Strip(padded); - assert.ok(Buffer.from(data).equals(trimmed), "Failed to trim to original data"); - }); - } -}); diff --git a/tools/mnemonic-test/node_modules/aes-js/tsconfig.base.json b/tools/mnemonic-test/node_modules/aes-js/tsconfig.base.json deleted file mode 100644 index ed057625..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/tsconfig.base.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "compilerOptions": { - "declaration": true, - "declarationMap": true, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "lib": [ - "es2015", - "es5", - "dom" - ], - "module": "es6", - "moduleResolution": "node16", - "noEmitOnError": true, - "noFallthroughCasesInSwitch": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noUnusedLocals": true, - "preserveSymlinks": true, - "preserveWatchOutput": true, - "pretty": false, - "rootDir": "./src.ts", - "sourceMap": true, - "strict": true, - "target": "es2016" - }, - "include": [ - "./src.ts/*.ts" - ], - "exclude": [ ] -} diff --git a/tools/mnemonic-test/node_modules/aes-js/tsconfig.commonjs.json b/tools/mnemonic-test/node_modules/aes-js/tsconfig.commonjs.json deleted file mode 100644 index 05103d1a..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/tsconfig.commonjs.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "module": "commonjs", - "outDir": "./lib.commonjs" - } -} diff --git a/tools/mnemonic-test/node_modules/aes-js/tsconfig.esm.json b/tools/mnemonic-test/node_modules/aes-js/tsconfig.esm.json deleted file mode 100644 index aa45c3b5..00000000 --- a/tools/mnemonic-test/node_modules/aes-js/tsconfig.esm.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "module": "es2020", - "outDir": "./lib.esm" - } -} diff --git a/tools/mnemonic-test/node_modules/base64-js/LICENSE b/tools/mnemonic-test/node_modules/base64-js/LICENSE deleted file mode 100644 index 6d52b8ac..00000000 --- a/tools/mnemonic-test/node_modules/base64-js/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Jameson Little - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/mnemonic-test/node_modules/base64-js/README.md b/tools/mnemonic-test/node_modules/base64-js/README.md deleted file mode 100644 index b42a48f4..00000000 --- a/tools/mnemonic-test/node_modules/base64-js/README.md +++ /dev/null @@ -1,34 +0,0 @@ -base64-js -========= - -`base64-js` does basic base64 encoding/decoding in pure JS. - -[![build status](https://secure.travis-ci.org/beatgammit/base64-js.png)](http://travis-ci.org/beatgammit/base64-js) - -Many browsers already have base64 encoding/decoding functionality, but it is for text data, not all-purpose binary data. - -Sometimes encoding/decoding binary data in the browser is useful, and that is what this module does. - -## install - -With [npm](https://npmjs.org) do: - -`npm install base64-js` and `var base64js = require('base64-js')` - -For use in web browsers do: - -`` - -[Get supported base64-js with the Tidelift Subscription](https://tidelift.com/subscription/pkg/npm-base64-js?utm_source=npm-base64-js&utm_medium=referral&utm_campaign=readme) - -## methods - -`base64js` has three exposed functions, `byteLength`, `toByteArray` and `fromByteArray`, which both take a single argument. - -* `byteLength` - Takes a base64 string and returns length of byte array -* `toByteArray` - Takes a base64 string and returns a byte array -* `fromByteArray` - Takes a byte array and returns a base64 string - -## license - -MIT diff --git a/tools/mnemonic-test/node_modules/base64-js/base64js.min.js b/tools/mnemonic-test/node_modules/base64-js/base64js.min.js deleted file mode 100644 index 908ac83f..00000000 --- a/tools/mnemonic-test/node_modules/base64-js/base64js.min.js +++ /dev/null @@ -1 +0,0 @@ -(function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?this:self:global:window,b.base64js=a()}})(function(){return function(){function b(d,e,g){function a(j,i){if(!e[j]){if(!d[j]){var f="function"==typeof require&&require;if(!i&&f)return f(j,!0);if(h)return h(j,!0);var c=new Error("Cannot find module '"+j+"'");throw c.code="MODULE_NOT_FOUND",c}var k=e[j]={exports:{}};d[j][0].call(k.exports,function(b){var c=d[j][1][b];return a(c||b)},k,k.exports,b,d,e,g)}return e[j].exports}for(var h="function"==typeof require&&require,c=0;c>16,j[k++]=255&b>>8,j[k++]=255&b;return 2===h&&(b=l[a.charCodeAt(c)]<<2|l[a.charCodeAt(c+1)]>>4,j[k++]=255&b),1===h&&(b=l[a.charCodeAt(c)]<<10|l[a.charCodeAt(c+1)]<<4|l[a.charCodeAt(c+2)]>>2,j[k++]=255&b>>8,j[k++]=255&b),j}function g(a){return k[63&a>>18]+k[63&a>>12]+k[63&a>>6]+k[63&a]}function h(a,b,c){for(var d,e=[],f=b;fj?j:g+f));return 1===d?(b=a[c-1],e.push(k[b>>2]+k[63&b<<4]+"==")):2===d&&(b=(a[c-2]<<8)+a[c-1],e.push(k[b>>10]+k[63&b>>4]+k[63&b<<2]+"=")),e.join("")}c.byteLength=function(a){var b=d(a),c=b[0],e=b[1];return 3*(c+e)/4-e},c.toByteArray=f,c.fromByteArray=j;for(var k=[],l=[],m="undefined"==typeof Uint8Array?Array:Uint8Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,p=n.length;o 0) { - throw new Error('Invalid string. Length must be a multiple of 4') - } - - // Trim off extra bytes after placeholder bytes are found - // See: https://github.com/beatgammit/base64-js/issues/42 - var validLen = b64.indexOf('=') - if (validLen === -1) validLen = len - - var placeHoldersLen = validLen === len - ? 0 - : 4 - (validLen % 4) - - return [validLen, placeHoldersLen] -} - -// base64 is 4/3 + up to two characters of the original data -function byteLength (b64) { - var lens = getLens(b64) - var validLen = lens[0] - var placeHoldersLen = lens[1] - return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen -} - -function _byteLength (b64, validLen, placeHoldersLen) { - return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen -} - -function toByteArray (b64) { - var tmp - var lens = getLens(b64) - var validLen = lens[0] - var placeHoldersLen = lens[1] - - var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)) - - var curByte = 0 - - // if there are placeholders, only get up to the last complete 4 chars - var len = placeHoldersLen > 0 - ? validLen - 4 - : validLen - - var i - for (i = 0; i < len; i += 4) { - tmp = - (revLookup[b64.charCodeAt(i)] << 18) | - (revLookup[b64.charCodeAt(i + 1)] << 12) | - (revLookup[b64.charCodeAt(i + 2)] << 6) | - revLookup[b64.charCodeAt(i + 3)] - arr[curByte++] = (tmp >> 16) & 0xFF - arr[curByte++] = (tmp >> 8) & 0xFF - arr[curByte++] = tmp & 0xFF - } - - if (placeHoldersLen === 2) { - tmp = - (revLookup[b64.charCodeAt(i)] << 2) | - (revLookup[b64.charCodeAt(i + 1)] >> 4) - arr[curByte++] = tmp & 0xFF - } - - if (placeHoldersLen === 1) { - tmp = - (revLookup[b64.charCodeAt(i)] << 10) | - (revLookup[b64.charCodeAt(i + 1)] << 4) | - (revLookup[b64.charCodeAt(i + 2)] >> 2) - arr[curByte++] = (tmp >> 8) & 0xFF - arr[curByte++] = tmp & 0xFF - } - - return arr -} - -function tripletToBase64 (num) { - return lookup[num >> 18 & 0x3F] + - lookup[num >> 12 & 0x3F] + - lookup[num >> 6 & 0x3F] + - lookup[num & 0x3F] -} - -function encodeChunk (uint8, start, end) { - var tmp - var output = [] - for (var i = start; i < end; i += 3) { - tmp = - ((uint8[i] << 16) & 0xFF0000) + - ((uint8[i + 1] << 8) & 0xFF00) + - (uint8[i + 2] & 0xFF) - output.push(tripletToBase64(tmp)) - } - return output.join('') -} - -function fromByteArray (uint8) { - var tmp - var len = uint8.length - var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes - var parts = [] - var maxChunkLength = 16383 // must be multiple of 3 - - // go through the array every three bytes, we'll deal with trailing stuff later - for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { - parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))) - } - - // pad the end with zeros, but make sure to not forget the extra bytes - if (extraBytes === 1) { - tmp = uint8[len - 1] - parts.push( - lookup[tmp >> 2] + - lookup[(tmp << 4) & 0x3F] + - '==' - ) - } else if (extraBytes === 2) { - tmp = (uint8[len - 2] << 8) + uint8[len - 1] - parts.push( - lookup[tmp >> 10] + - lookup[(tmp >> 4) & 0x3F] + - lookup[(tmp << 2) & 0x3F] + - '=' - ) - } - - return parts.join('') -} diff --git a/tools/mnemonic-test/node_modules/base64-js/package.json b/tools/mnemonic-test/node_modules/base64-js/package.json deleted file mode 100644 index c3972e39..00000000 --- a/tools/mnemonic-test/node_modules/base64-js/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "base64-js", - "description": "Base64 encoding/decoding in pure JS", - "version": "1.5.1", - "author": "T. Jameson Little ", - "typings": "index.d.ts", - "bugs": { - "url": "https://github.com/beatgammit/base64-js/issues" - }, - "devDependencies": { - "babel-minify": "^0.5.1", - "benchmark": "^2.1.4", - "browserify": "^16.3.0", - "standard": "*", - "tape": "4.x" - }, - "homepage": "https://github.com/beatgammit/base64-js", - "keywords": [ - "base64" - ], - "license": "MIT", - "main": "index.js", - "repository": { - "type": "git", - "url": "git://github.com/beatgammit/base64-js.git" - }, - "scripts": { - "build": "browserify -s base64js -r ./ | minify > base64js.min.js", - "lint": "standard", - "test": "npm run lint && npm run unit", - "unit": "tape test/*.js" - }, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] -} diff --git a/tools/mnemonic-test/node_modules/bip39/LICENSE b/tools/mnemonic-test/node_modules/bip39/LICENSE deleted file mode 100644 index 5e22cbea..00000000 --- a/tools/mnemonic-test/node_modules/bip39/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright (c) 2014, Wei Lu and Daniel Cousens - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/tools/mnemonic-test/node_modules/bip39/README.md b/tools/mnemonic-test/node_modules/bip39/README.md deleted file mode 100644 index aacfcd07..00000000 --- a/tools/mnemonic-test/node_modules/bip39/README.md +++ /dev/null @@ -1,142 +0,0 @@ -# BIP39 - -[![Build Status](https://travis-ci.org/bitcoinjs/bip39.png?branch=master)](https://travis-ci.org/bitcoinjs/bip39) -[![NPM](https://img.shields.io/npm/v/bip39.svg)](https://www.npmjs.org/package/bip39) - -[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) - - -JavaScript implementation of [Bitcoin BIP39](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki): Mnemonic code for generating deterministic keys - -## Reminder for developers - -***Please remember to allow recovery from mnemonic phrases that have invalid checksums (or that you don't have the wordlist)*** - -When a checksum is invalid, warn the user that the phrase is not something generated by your app, and ask if they would like to use it anyway. This way, your app only needs to hold the wordlists for your supported languages, but you can recover phrases made by other apps in other languages. - -However, there should be other checks in place, such as checking to make sure the user is inputting 12 words or more separated by a space. ie. `phrase.trim().split(/\s+/g).length >= 12` - -## Removing wordlists from webpack/browserify - - Browserify/Webpack bundles can get very large if you include all the wordlists, so you can now exclude wordlists to make your bundle lighter. - - For example, if we want to exclude all wordlists besides chinese_simplified, you could build using the browserify command below. - - ```bash -$ browserify -r bip39 -s bip39 \ - --exclude=./wordlists/english.json \ - --exclude=./wordlists/japanese.json \ - --exclude=./wordlists/spanish.json \ - --exclude=./wordlists/italian.json \ - --exclude=./wordlists/french.json \ - --exclude=./wordlists/korean.json \ - --exclude=./wordlists/czech.json \ - --exclude=./wordlists/portuguese.json \ - --exclude=./wordlists/chinese_traditional.json \ - > bip39.browser.js -``` - - This will create a bundle that only contains the chinese_simplified wordlist, and it will be the default wordlist for all calls without explicit wordlists. - - You can also do this in Webpack 5 using the `IgnorePlugin`. Here is an example of excluding all non-English wordlists - - ```javascript - ... - plugins: [ - new webpack.IgnorePlugin({ - checkResource(resource) { - return /.*\/wordlists\/(?!english).*\.json/.test(resource) - } - }), - ], - ... - ``` - - This is how it will look in the browser console. - - ```javascript -> bip39.entropyToMnemonic('00000000000000000000000000000000') -"的 的 的 的 的 的 的 的 的 的 的 在" -> bip39.wordlists.chinese_simplified -Array(2048) [ "的", "一", "是", "在", "不", "了", "有", "和", "人", "这", … ] -> bip39.wordlists.english -undefined -> bip39.wordlists.japanese -undefined -> bip39.wordlists.spanish -undefined -> bip39.wordlists.italian -undefined -> bip39.wordlists.french -undefined -> bip39.wordlists.korean -undefined -> bip39.wordlists.czech -undefined -> bip39.wordlists.portuguese -undefined -> bip39.wordlists.chinese_traditional -undefined -``` - - For a list of supported wordlists check the wordlists folder. The name of the json file (minus the extension) is the name of the key to access the wordlist. - - You can also change the default wordlist at runtime if you dislike the wordlist you were given as default. - - ```javascript -> bip39.entropyToMnemonic('00000000000000000000000000000fff') -"あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あまい ろんり" -> bip39.setDefaultWordlist('italian') -undefined -> bip39.entropyToMnemonic('00000000000000000000000000000fff') -"abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco aforisma zibetto" -``` - -## Installation -``` bash -npm install bip39 -``` - -## Examples -``` js -// Generate a random mnemonic (uses crypto.randomBytes under the hood), defaults to 128-bits of entropy -const mnemonic = bip39.generateMnemonic() -// => 'seed sock milk update focus rotate barely fade car face mechanic mercy' - -bip39.mnemonicToSeedSync('basket actual').toString('hex') -// => '5cf2d4a8b0355e90295bdfc565a022a409af063d5365bb57bf74d9528f494bfa4400f53d8349b80fdae44082d7f9541e1dba2b003bcfec9d0d53781ca676651f' - -bip39.mnemonicToSeedSync('basket actual') -// => - -// mnemonicToSeed has an synchronous version -// mnemonicToSeedSync is less performance oriented -bip39.mnemonicToSeed('basket actual').then(console.log) -// => - -bip39.mnemonicToSeed('basket actual').then(bytes => bytes.toString('hex')).then(console.log) -// => '5cf2d4a8b0355e90295bdfc565a022a409af063d5365bb57bf74d9528f494bfa4400f53d8349b80fdae44082d7f9541e1dba2b003bcfec9d0d53781ca676651f' - -bip39.mnemonicToSeedSync('basket actual', 'a password') -// => - -bip39.validateMnemonic(mnemonic) -// => true - -bip39.validateMnemonic('basket actual') -// => false -``` - - -``` js -const bip39 = require('bip39') - -// defaults to BIP39 English word list -// uses HEX strings for entropy -const mnemonic = bip39.entropyToMnemonic('00000000000000000000000000000000') -// => abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about - -// reversible -bip39.mnemonicToEntropy(mnemonic) -// => '00000000000000000000000000000000' -``` diff --git a/tools/mnemonic-test/node_modules/bip39/package.json b/tools/mnemonic-test/node_modules/bip39/package.json deleted file mode 100644 index 7e314021..00000000 --- a/tools/mnemonic-test/node_modules/bip39/package.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "bip39", - "version": "3.1.0", - "description": "Bitcoin BIP39: Mnemonic code for generating deterministic keys", - "main": "src/index.js", - "types": "./types/index.d.ts", - "scripts": { - "build": "npm run clean && tsc -p tsconfig.json", - "clean": "rm -rf src", - "coverage": "nyc --branches 85 --functions 100 --check-coverage npm run unit", - "format": "npm run prettier -- --write", - "format:ci": "npm run prettier -- --check", - "gitdiff:ci": "npm run build && git diff --exit-code", - "lint": "tslint -p tsconfig.json -c tslint.json", - "prettier": "prettier 'ts_src/**/*.ts' --ignore-path ./.prettierignore", - "test": "npm run build && npm run format:ci && npm run lint && npm run unit", - "unit": "tape test/*.js", - "update": "node -e \"require('./util/wordlists').update()\"" - }, - "author": "Wei Lu", - "contributors": [ - { - "name": "Daniel Cousens", - "email": "email@dcousens.com", - "url": "http://dcousens.com" - } - ], - "repository": { - "type": "git", - "url": "https://github.com/bitcoinjs/bip39.git" - }, - "license": "ISC", - "files": [ - "src", - "types" - ], - "dependencies": { - "@noble/hashes": "^1.2.0" - }, - "devDependencies": { - "@types/node": "11.11.6", - "node-fetch": "2.6.9", - "nyc": "^15.0.0", - "prettier": "1.16.4", - "proxyquire": "^1.7.10", - "tape": "^4.13.2", - "tslint": "^6.1.0", - "typescript": "3.3.4000" - } -} diff --git a/tools/mnemonic-test/node_modules/bip39/src/_wordlists.js b/tools/mnemonic-test/node_modules/bip39/src/_wordlists.js deleted file mode 100644 index 4cf7f470..00000000 --- a/tools/mnemonic-test/node_modules/bip39/src/_wordlists.js +++ /dev/null @@ -1,61 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -// browserify by default only pulls in files that are hard coded in requires -// In order of last to first in this file, the default wordlist will be chosen -// based on what is present. (Bundles may remove wordlists they don't need) -const wordlists = {}; -exports.wordlists = wordlists; -let _default; -exports._default = _default; -try { - exports._default = _default = require('./wordlists/czech.json'); - wordlists.czech = _default; -} -catch (err) { } -try { - exports._default = _default = require('./wordlists/chinese_simplified.json'); - wordlists.chinese_simplified = _default; -} -catch (err) { } -try { - exports._default = _default = require('./wordlists/chinese_traditional.json'); - wordlists.chinese_traditional = _default; -} -catch (err) { } -try { - exports._default = _default = require('./wordlists/korean.json'); - wordlists.korean = _default; -} -catch (err) { } -try { - exports._default = _default = require('./wordlists/french.json'); - wordlists.french = _default; -} -catch (err) { } -try { - exports._default = _default = require('./wordlists/italian.json'); - wordlists.italian = _default; -} -catch (err) { } -try { - exports._default = _default = require('./wordlists/spanish.json'); - wordlists.spanish = _default; -} -catch (err) { } -try { - exports._default = _default = require('./wordlists/japanese.json'); - wordlists.japanese = _default; - wordlists.JA = _default; -} -catch (err) { } -try { - exports._default = _default = require('./wordlists/portuguese.json'); - wordlists.portuguese = _default; -} -catch (err) { } -try { - exports._default = _default = require('./wordlists/english.json'); - wordlists.english = _default; - wordlists.EN = _default; -} -catch (err) { } diff --git a/tools/mnemonic-test/node_modules/bip39/src/index.js b/tools/mnemonic-test/node_modules/bip39/src/index.js deleted file mode 100644 index b83863f4..00000000 --- a/tools/mnemonic-test/node_modules/bip39/src/index.js +++ /dev/null @@ -1,172 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const sha256_1 = require("@noble/hashes/sha256"); -const sha512_1 = require("@noble/hashes/sha512"); -const pbkdf2_1 = require("@noble/hashes/pbkdf2"); -const utils_1 = require("@noble/hashes/utils"); -const _wordlists_1 = require("./_wordlists"); -let DEFAULT_WORDLIST = _wordlists_1._default; -const INVALID_MNEMONIC = 'Invalid mnemonic'; -const INVALID_ENTROPY = 'Invalid entropy'; -const INVALID_CHECKSUM = 'Invalid mnemonic checksum'; -const WORDLIST_REQUIRED = 'A wordlist is required but a default could not be found.\n' + - 'Please pass a 2048 word array explicitly.'; -function normalize(str) { - return (str || '').normalize('NFKD'); -} -function lpad(str, padString, length) { - while (str.length < length) { - str = padString + str; - } - return str; -} -function binaryToByte(bin) { - return parseInt(bin, 2); -} -function bytesToBinary(bytes) { - return bytes.map((x) => lpad(x.toString(2), '0', 8)).join(''); -} -function deriveChecksumBits(entropyBuffer) { - const ENT = entropyBuffer.length * 8; - const CS = ENT / 32; - const hash = sha256_1.sha256(Uint8Array.from(entropyBuffer)); - return bytesToBinary(Array.from(hash)).slice(0, CS); -} -function salt(password) { - return 'mnemonic' + (password || ''); -} -function mnemonicToSeedSync(mnemonic, password) { - const mnemonicBuffer = Uint8Array.from(Buffer.from(normalize(mnemonic), 'utf8')); - const saltBuffer = Uint8Array.from(Buffer.from(salt(normalize(password)), 'utf8')); - const res = pbkdf2_1.pbkdf2(sha512_1.sha512, mnemonicBuffer, saltBuffer, { - c: 2048, - dkLen: 64, - }); - return Buffer.from(res); -} -exports.mnemonicToSeedSync = mnemonicToSeedSync; -function mnemonicToSeed(mnemonic, password) { - const mnemonicBuffer = Uint8Array.from(Buffer.from(normalize(mnemonic), 'utf8')); - const saltBuffer = Uint8Array.from(Buffer.from(salt(normalize(password)), 'utf8')); - return pbkdf2_1.pbkdf2Async(sha512_1.sha512, mnemonicBuffer, saltBuffer, { - c: 2048, - dkLen: 64, - }).then((res) => Buffer.from(res)); -} -exports.mnemonicToSeed = mnemonicToSeed; -function mnemonicToEntropy(mnemonic, wordlist) { - wordlist = wordlist || DEFAULT_WORDLIST; - if (!wordlist) { - throw new Error(WORDLIST_REQUIRED); - } - const words = normalize(mnemonic).split(' '); - if (words.length % 3 !== 0) { - throw new Error(INVALID_MNEMONIC); - } - // convert word indices to 11 bit binary strings - const bits = words - .map((word) => { - const index = wordlist.indexOf(word); - if (index === -1) { - throw new Error(INVALID_MNEMONIC); - } - return lpad(index.toString(2), '0', 11); - }) - .join(''); - // split the binary string into ENT/CS - const dividerIndex = Math.floor(bits.length / 33) * 32; - const entropyBits = bits.slice(0, dividerIndex); - const checksumBits = bits.slice(dividerIndex); - // calculate the checksum and compare - const entropyBytes = entropyBits.match(/(.{1,8})/g).map(binaryToByte); - if (entropyBytes.length < 16) { - throw new Error(INVALID_ENTROPY); - } - if (entropyBytes.length > 32) { - throw new Error(INVALID_ENTROPY); - } - if (entropyBytes.length % 4 !== 0) { - throw new Error(INVALID_ENTROPY); - } - const entropy = Buffer.from(entropyBytes); - const newChecksum = deriveChecksumBits(entropy); - if (newChecksum !== checksumBits) { - throw new Error(INVALID_CHECKSUM); - } - return entropy.toString('hex'); -} -exports.mnemonicToEntropy = mnemonicToEntropy; -function entropyToMnemonic(entropy, wordlist) { - if (!Buffer.isBuffer(entropy)) { - entropy = Buffer.from(entropy, 'hex'); - } - wordlist = wordlist || DEFAULT_WORDLIST; - if (!wordlist) { - throw new Error(WORDLIST_REQUIRED); - } - // 128 <= ENT <= 256 - if (entropy.length < 16) { - throw new TypeError(INVALID_ENTROPY); - } - if (entropy.length > 32) { - throw new TypeError(INVALID_ENTROPY); - } - if (entropy.length % 4 !== 0) { - throw new TypeError(INVALID_ENTROPY); - } - const entropyBits = bytesToBinary(Array.from(entropy)); - const checksumBits = deriveChecksumBits(entropy); - const bits = entropyBits + checksumBits; - const chunks = bits.match(/(.{1,11})/g); - const words = chunks.map((binary) => { - const index = binaryToByte(binary); - return wordlist[index]; - }); - return wordlist[0] === '\u3042\u3044\u3053\u304f\u3057\u3093' // Japanese wordlist - ? words.join('\u3000') - : words.join(' '); -} -exports.entropyToMnemonic = entropyToMnemonic; -function generateMnemonic(strength, rng, wordlist) { - strength = strength || 128; - if (strength % 32 !== 0) { - throw new TypeError(INVALID_ENTROPY); - } - rng = rng || ((size) => Buffer.from(utils_1.randomBytes(size))); - return entropyToMnemonic(rng(strength / 8), wordlist); -} -exports.generateMnemonic = generateMnemonic; -function validateMnemonic(mnemonic, wordlist) { - try { - mnemonicToEntropy(mnemonic, wordlist); - } - catch (e) { - return false; - } - return true; -} -exports.validateMnemonic = validateMnemonic; -function setDefaultWordlist(language) { - const result = _wordlists_1.wordlists[language]; - if (result) { - DEFAULT_WORDLIST = result; - } - else { - throw new Error('Could not find wordlist for language "' + language + '"'); - } -} -exports.setDefaultWordlist = setDefaultWordlist; -function getDefaultWordlist() { - if (!DEFAULT_WORDLIST) { - throw new Error('No Default Wordlist set'); - } - return Object.keys(_wordlists_1.wordlists).filter((lang) => { - if (lang === 'JA' || lang === 'EN') { - return false; - } - return _wordlists_1.wordlists[lang].every((word, index) => word === DEFAULT_WORDLIST[index]); - })[0]; -} -exports.getDefaultWordlist = getDefaultWordlist; -var _wordlists_2 = require("./_wordlists"); -exports.wordlists = _wordlists_2.wordlists; diff --git a/tools/mnemonic-test/node_modules/bip39/src/wordlists/chinese_simplified.json b/tools/mnemonic-test/node_modules/bip39/src/wordlists/chinese_simplified.json deleted file mode 100644 index 6ed0512d..00000000 --- a/tools/mnemonic-test/node_modules/bip39/src/wordlists/chinese_simplified.json +++ /dev/null @@ -1,2050 +0,0 @@ -[ - "的", - "一", - "是", - "在", - "不", - "了", - "有", - "和", - "人", - "这", - "中", - "大", - "为", - "上", - "个", - "国", - "我", - "以", - "要", - "他", - "时", - "来", - "用", - "们", - "生", - "到", - "作", - "地", - "于", - "出", - "就", - "分", - "对", - "成", - "会", - "可", - "主", - "发", - "年", - "动", - "同", - "工", - "也", - "能", - "下", - "过", - "子", - "说", - "产", - "种", - "面", - "而", - "方", - "后", - "多", - "定", - "行", - "学", - "法", - "所", - "民", - "得", - "经", - "十", - "三", - "之", - "进", - "着", - "等", - "部", - "度", - "家", - "电", - "力", - "里", - "如", - "水", - "化", - "高", - "自", - "二", - "理", - "起", - "小", - "物", - "现", - "实", - "加", - "量", - "都", - "两", - "体", - "制", - "机", - "当", - "使", - "点", - "从", - "业", - "本", - "去", - "把", - "性", - "好", - "应", - "开", - "它", - "合", - "还", - "因", - "由", - "其", - "些", - "然", - "前", - "外", - "天", - "政", - "四", - "日", - "那", - "社", - "义", - "事", - "平", - "形", - "相", - "全", - "表", - "间", - "样", - "与", - "关", - "各", - "重", - "新", - "线", - "内", - "数", - "正", - "心", - "反", - "你", - "明", - "看", - "原", - "又", - "么", - "利", - "比", - "或", - "但", - "质", - "气", - "第", - "向", - "道", - "命", - "此", - "变", - "条", - "只", - "没", - "结", - "解", - "问", - "意", - "建", - "月", - "公", - "无", - "系", - "军", - "很", - "情", - "者", - "最", - "立", - "代", - "想", - "已", - "通", - "并", - "提", - "直", - "题", - "党", - "程", - "展", - "五", - "果", - "料", - "象", - "员", - "革", - "位", - "入", - "常", - "文", - "总", - "次", - "品", - "式", - "活", - "设", - "及", - "管", - "特", - "件", - "长", - "求", - "老", - "头", - "基", - "资", - "边", - "流", - "路", - "级", - "少", - "图", - "山", - "统", - "接", - "知", - "较", - "将", - "组", - "见", - "计", - "别", - "她", - "手", - "角", - "期", - "根", - "论", - "运", - "农", - "指", - "几", - "九", - "区", - "强", - "放", - "决", - "西", - "被", - "干", - "做", - "必", - "战", - "先", - "回", - "则", - "任", - "取", - "据", - "处", - "队", - "南", - "给", - "色", - "光", - "门", - "即", - "保", - "治", - "北", - "造", - "百", - "规", - "热", - "领", - "七", - "海", - "口", - "东", - "导", - "器", - "压", - "志", - "世", - "金", - "增", - "争", - "济", - "阶", - "油", - "思", - "术", - "极", - "交", - "受", - "联", - "什", - "认", - "六", - "共", - "权", - "收", - "证", - "改", - "清", - "美", - "再", - "采", - "转", - "更", - "单", - "风", - "切", - "打", - "白", - "教", - "速", - "花", - "带", - "安", - "场", - "身", - "车", - "例", - "真", - "务", - "具", - "万", - "每", - "目", - "至", - "达", - "走", - "积", - "示", - "议", - "声", - "报", - "斗", - "完", - "类", - "八", - "离", - "华", - "名", - "确", - "才", - "科", - "张", - "信", - "马", - "节", - "话", - "米", - "整", - "空", - "元", - "况", - "今", - "集", - "温", - "传", - "土", - "许", - "步", - "群", - "广", - "石", - "记", - "需", - "段", - "研", - "界", - "拉", - "林", - "律", - "叫", - "且", - "究", - "观", - "越", - "织", - "装", - "影", - "算", - "低", - "持", - "音", - "众", - "书", - "布", - "复", - "容", - "儿", - "须", - "际", - "商", - "非", - "验", - "连", - "断", - "深", - "难", - "近", - "矿", - "千", - "周", - "委", - "素", - "技", - "备", - "半", - "办", - "青", - "省", - "列", - "习", - "响", - "约", - "支", - "般", - "史", - "感", - "劳", - "便", - "团", - "往", - "酸", - "历", - "市", - "克", - "何", - "除", - "消", - "构", - "府", - "称", - "太", - "准", - "精", - "值", - "号", - "率", - "族", - "维", - "划", - "选", - "标", - "写", - "存", - "候", - "毛", - "亲", - "快", - "效", - "斯", - "院", - "查", - "江", - "型", - "眼", - "王", - "按", - "格", - "养", - "易", - "置", - "派", - "层", - "片", - "始", - "却", - "专", - "状", - "育", - "厂", - "京", - "识", - "适", - "属", - "圆", - "包", - "火", - "住", - "调", - "满", - "县", - "局", - "照", - "参", - "红", - "细", - "引", - "听", - "该", - "铁", - "价", - "严", - "首", - "底", - "液", - "官", - "德", - "随", - "病", - "苏", - "失", - "尔", - "死", - "讲", - "配", - "女", - "黄", - "推", - "显", - "谈", - "罪", - "神", - "艺", - "呢", - "席", - "含", - "企", - "望", - "密", - "批", - "营", - "项", - "防", - "举", - "球", - "英", - "氧", - "势", - "告", - "李", - "台", - "落", - "木", - "帮", - "轮", - "破", - "亚", - "师", - "围", - "注", - "远", - "字", - "材", - "排", - "供", - "河", - "态", - "封", - "另", - "施", - "减", - "树", - "溶", - "怎", - "止", - "案", - "言", - "士", - "均", - "武", - "固", - "叶", - "鱼", - "波", - "视", - "仅", - "费", - "紧", - "爱", - "左", - "章", - "早", - "朝", - "害", - "续", - "轻", - "服", - "试", - "食", - "充", - "兵", - "源", - "判", - "护", - "司", - "足", - "某", - "练", - "差", - "致", - "板", - "田", - "降", - "黑", - "犯", - "负", - "击", - "范", - "继", - "兴", - "似", - "余", - "坚", - "曲", - "输", - "修", - "故", - "城", - "夫", - "够", - "送", - "笔", - "船", - "占", - "右", - "财", - "吃", - "富", - "春", - "职", - "觉", - "汉", - "画", - "功", - "巴", - "跟", - "虽", - "杂", - "飞", - "检", - "吸", - "助", - "升", - "阳", - "互", - "初", - "创", - "抗", - "考", - "投", - "坏", - "策", - "古", - "径", - "换", - "未", - "跑", - "留", - "钢", - "曾", - "端", - "责", - "站", - "简", - "述", - "钱", - "副", - "尽", - "帝", - "射", - "草", - "冲", - "承", - "独", - "令", - "限", - "阿", - "宣", - "环", - "双", - "请", - "超", - "微", - "让", - "控", - "州", - "良", - "轴", - "找", - "否", - "纪", - "益", - "依", - "优", - "顶", - "础", - "载", - "倒", - "房", - "突", - "坐", - "粉", - "敌", - "略", - "客", - "袁", - "冷", - "胜", - "绝", - "析", - "块", - "剂", - "测", - "丝", - "协", - "诉", - "念", - "陈", - "仍", - "罗", - "盐", - "友", - "洋", - "错", - "苦", - "夜", - "刑", - "移", - "频", - "逐", - "靠", - "混", - "母", - "短", - "皮", - "终", - "聚", - "汽", - "村", - "云", - "哪", - "既", - "距", - "卫", - "停", - "烈", - "央", - "察", - "烧", - "迅", - "境", - "若", - "印", - "洲", - "刻", - "括", - "激", - "孔", - "搞", - "甚", - "室", - "待", - "核", - "校", - "散", - "侵", - "吧", - "甲", - "游", - "久", - "菜", - "味", - "旧", - "模", - "湖", - "货", - "损", - "预", - "阻", - "毫", - "普", - "稳", - "乙", - "妈", - "植", - "息", - "扩", - "银", - "语", - "挥", - "酒", - "守", - "拿", - "序", - "纸", - "医", - "缺", - "雨", - "吗", - "针", - "刘", - "啊", - "急", - "唱", - "误", - "训", - "愿", - "审", - "附", - "获", - "茶", - "鲜", - "粮", - "斤", - "孩", - "脱", - "硫", - "肥", - "善", - "龙", - "演", - "父", - "渐", - "血", - "欢", - "械", - "掌", - "歌", - "沙", - "刚", - "攻", - "谓", - "盾", - "讨", - "晚", - "粒", - "乱", - "燃", - "矛", - "乎", - "杀", - "药", - "宁", - "鲁", - "贵", - "钟", - "煤", - "读", - "班", - "伯", - "香", - "介", - "迫", - "句", - "丰", - "培", - "握", - "兰", - "担", - "弦", - "蛋", - "沉", - "假", - "穿", - "执", - "答", - "乐", - "谁", - "顺", - "烟", - "缩", - "征", - "脸", - "喜", - "松", - "脚", - "困", - "异", - "免", - "背", - "星", - "福", - "买", - "染", - "井", - "概", - "慢", - "怕", - "磁", - "倍", - "祖", - "皇", - "促", - "静", - "补", - "评", - "翻", - "肉", - "践", - "尼", - "衣", - "宽", - "扬", - "棉", - "希", - "伤", - "操", - "垂", - "秋", - "宜", - "氢", - "套", - "督", - "振", - "架", - "亮", - "末", - "宪", - "庆", - "编", - "牛", - "触", - "映", - "雷", - "销", - "诗", - "座", - "居", - "抓", - "裂", - "胞", - "呼", - "娘", - "景", - "威", - "绿", - "晶", - "厚", - "盟", - "衡", - "鸡", - "孙", - "延", - "危", - "胶", - "屋", - "乡", - "临", - "陆", - "顾", - "掉", - "呀", - "灯", - "岁", - "措", - "束", - "耐", - "剧", - "玉", - "赵", - "跳", - "哥", - "季", - "课", - "凯", - "胡", - "额", - "款", - "绍", - "卷", - "齐", - "伟", - "蒸", - "殖", - "永", - "宗", - "苗", - "川", - "炉", - "岩", - "弱", - "零", - "杨", - "奏", - "沿", - "露", - "杆", - "探", - "滑", - "镇", - "饭", - "浓", - "航", - "怀", - "赶", - "库", - "夺", - "伊", - "灵", - "税", - "途", - "灭", - "赛", - "归", - "召", - "鼓", - "播", - "盘", - "裁", - "险", - "康", - "唯", - "录", - "菌", - "纯", - "借", - "糖", - "盖", - "横", - "符", - "私", - "努", - "堂", - "域", - "枪", - "润", - "幅", - "哈", - "竟", - "熟", - "虫", - "泽", - "脑", - "壤", - "碳", - "欧", - "遍", - "侧", - "寨", - "敢", - "彻", - "虑", - "斜", - "薄", - "庭", - "纳", - "弹", - "饲", - "伸", - "折", - "麦", - "湿", - "暗", - "荷", - "瓦", - "塞", - "床", - "筑", - "恶", - "户", - "访", - "塔", - "奇", - "透", - "梁", - "刀", - "旋", - "迹", - "卡", - "氯", - "遇", - "份", - "毒", - "泥", - "退", - "洗", - "摆", - "灰", - "彩", - "卖", - "耗", - "夏", - "择", - "忙", - "铜", - "献", - "硬", - "予", - "繁", - "圈", - "雪", - "函", - "亦", - "抽", - "篇", - "阵", - "阴", - "丁", - "尺", - "追", - "堆", - "雄", - "迎", - "泛", - "爸", - "楼", - "避", - "谋", - "吨", - "野", - "猪", - "旗", - "累", - "偏", - "典", - "馆", - "索", - "秦", - "脂", - "潮", - "爷", - "豆", - "忽", - "托", - "惊", - "塑", - "遗", - "愈", - "朱", - "替", - "纤", - "粗", - "倾", - "尚", - "痛", - "楚", - "谢", - "奋", - "购", - "磨", - "君", - "池", - "旁", - "碎", - "骨", - "监", - "捕", - "弟", - "暴", - "割", - "贯", - "殊", - "释", - "词", - "亡", - "壁", - "顿", - "宝", - "午", - "尘", - "闻", - "揭", - "炮", - "残", - "冬", - "桥", - "妇", - "警", - "综", - "招", - "吴", - "付", - "浮", - "遭", - "徐", - "您", - "摇", - "谷", - "赞", - "箱", - "隔", - "订", - "男", - "吹", - "园", - "纷", - "唐", - "败", - "宋", - "玻", - "巨", - "耕", - "坦", - "荣", - "闭", - "湾", - "键", - "凡", - "驻", - "锅", - "救", - "恩", - "剥", - "凝", - "碱", - "齿", - "截", - "炼", - "麻", - "纺", - "禁", - "废", - "盛", - "版", - "缓", - "净", - "睛", - "昌", - "婚", - "涉", - "筒", - "嘴", - "插", - "岸", - "朗", - "庄", - "街", - "藏", - "姑", - "贸", - "腐", - "奴", - "啦", - "惯", - "乘", - "伙", - "恢", - "匀", - "纱", - "扎", - "辩", - "耳", - "彪", - "臣", - "亿", - "璃", - "抵", - "脉", - "秀", - "萨", - "俄", - "网", - "舞", - "店", - "喷", - "纵", - "寸", - "汗", - "挂", - "洪", - "贺", - "闪", - "柬", - "爆", - "烯", - "津", - "稻", - "墙", - "软", - "勇", - "像", - "滚", - "厘", - "蒙", - "芳", - "肯", - "坡", - "柱", - "荡", - "腿", - "仪", - "旅", - "尾", - "轧", - "冰", - "贡", - "登", - "黎", - "削", - "钻", - "勒", - "逃", - "障", - "氨", - "郭", - "峰", - "币", - "港", - "伏", - "轨", - "亩", - "毕", - "擦", - "莫", - "刺", - "浪", - "秘", - "援", - "株", - "健", - "售", - "股", - "岛", - "甘", - "泡", - "睡", - "童", - "铸", - "汤", - "阀", - "休", - "汇", - "舍", - "牧", - "绕", - "炸", - "哲", - "磷", - "绩", - "朋", - "淡", - "尖", - "启", - "陷", - "柴", - "呈", - "徒", - "颜", - "泪", - "稍", - "忘", - "泵", - "蓝", - "拖", - "洞", - "授", - "镜", - "辛", - "壮", - "锋", - "贫", - "虚", - "弯", - "摩", - "泰", - "幼", - "廷", - "尊", - "窗", - "纲", - "弄", - "隶", - "疑", - "氏", - "宫", - "姐", - "震", - "瑞", - "怪", - "尤", - "琴", - "循", - "描", - "膜", - "违", - "夹", - "腰", - "缘", - "珠", - "穷", - "森", - "枝", - "竹", - "沟", - "催", - "绳", - "忆", - "邦", - "剩", - "幸", - "浆", - "栏", - "拥", - "牙", - "贮", - "礼", - "滤", - "钠", - "纹", - "罢", - "拍", - "咱", - "喊", - "袖", - "埃", - "勤", - "罚", - "焦", - "潜", - "伍", - "墨", - "欲", - "缝", - "姓", - "刊", - "饱", - "仿", - "奖", - "铝", - "鬼", - "丽", - "跨", - "默", - "挖", - "链", - "扫", - "喝", - "袋", - "炭", - "污", - "幕", - "诸", - "弧", - "励", - "梅", - "奶", - "洁", - "灾", - "舟", - "鉴", - "苯", - "讼", - "抱", - "毁", - "懂", - "寒", - "智", - "埔", - "寄", - "届", - "跃", - "渡", - "挑", - "丹", - "艰", - "贝", - "碰", - "拔", - "爹", - "戴", - "码", - "梦", - "芽", - "熔", - "赤", - "渔", - "哭", - "敬", - "颗", - "奔", - "铅", - "仲", - "虎", - "稀", - "妹", - "乏", - "珍", - "申", - "桌", - "遵", - "允", - "隆", - "螺", - "仓", - "魏", - "锐", - "晓", - "氮", - "兼", - "隐", - "碍", - "赫", - "拨", - "忠", - "肃", - "缸", - "牵", - "抢", - "博", - "巧", - "壳", - "兄", - "杜", - "讯", - "诚", - "碧", - "祥", - "柯", - "页", - "巡", - "矩", - "悲", - "灌", - "龄", - "伦", - "票", - "寻", - "桂", - "铺", - "圣", - "恐", - "恰", - "郑", - "趣", - "抬", - "荒", - "腾", - "贴", - "柔", - "滴", - "猛", - "阔", - "辆", - "妻", - "填", - "撤", - "储", - "签", - "闹", - "扰", - "紫", - "砂", - "递", - "戏", - "吊", - "陶", - "伐", - "喂", - "疗", - "瓶", - "婆", - "抚", - "臂", - "摸", - "忍", - "虾", - "蜡", - "邻", - "胸", - "巩", - "挤", - "偶", - "弃", - "槽", - "劲", - "乳", - "邓", - "吉", - "仁", - "烂", - "砖", - "租", - "乌", - "舰", - "伴", - "瓜", - "浅", - "丙", - "暂", - "燥", - "橡", - "柳", - "迷", - "暖", - "牌", - "秧", - "胆", - "详", - "簧", - "踏", - "瓷", - "谱", - "呆", - "宾", - "糊", - "洛", - "辉", - "愤", - "竞", - "隙", - "怒", - "粘", - "乃", - "绪", - "肩", - "籍", - "敏", - "涂", - "熙", - "皆", - "侦", - "悬", - "掘", - "享", - "纠", - "醒", - "狂", - "锁", - "淀", - "恨", - "牲", - "霸", - "爬", - "赏", - "逆", - "玩", - "陵", - "祝", - "秒", - "浙", - "貌", - "役", - "彼", - "悉", - "鸭", - "趋", - "凤", - "晨", - "畜", - "辈", - "秩", - "卵", - "署", - "梯", - "炎", - "滩", - "棋", - "驱", - "筛", - "峡", - "冒", - "啥", - "寿", - "译", - "浸", - "泉", - "帽", - "迟", - "硅", - "疆", - "贷", - "漏", - "稿", - "冠", - "嫩", - "胁", - "芯", - "牢", - "叛", - "蚀", - "奥", - "鸣", - "岭", - "羊", - "凭", - "串", - "塘", - "绘", - "酵", - "融", - "盆", - "锡", - "庙", - "筹", - "冻", - "辅", - "摄", - "袭", - "筋", - "拒", - "僚", - "旱", - "钾", - "鸟", - "漆", - "沈", - "眉", - "疏", - "添", - "棒", - "穗", - "硝", - "韩", - "逼", - "扭", - "侨", - "凉", - "挺", - "碗", - "栽", - "炒", - "杯", - "患", - "馏", - "劝", - "豪", - "辽", - "勃", - "鸿", - "旦", - "吏", - "拜", - "狗", - "埋", - "辊", - "掩", - "饮", - "搬", - "骂", - "辞", - "勾", - "扣", - "估", - "蒋", - "绒", - "雾", - "丈", - "朵", - "姆", - "拟", - "宇", - "辑", - "陕", - "雕", - "偿", - "蓄", - "崇", - "剪", - "倡", - "厅", - "咬", - "驶", - "薯", - "刷", - "斥", - "番", - "赋", - "奉", - "佛", - "浇", - "漫", - "曼", - "扇", - "钙", - "桃", - "扶", - "仔", - "返", - "俗", - "亏", - "腔", - "鞋", - "棱", - "覆", - "框", - "悄", - "叔", - "撞", - "骗", - "勘", - "旺", - "沸", - "孤", - "吐", - "孟", - "渠", - "屈", - "疾", - "妙", - "惜", - "仰", - "狠", - "胀", - "谐", - "抛", - "霉", - "桑", - "岗", - "嘛", - "衰", - "盗", - "渗", - "脏", - "赖", - "涌", - "甜", - "曹", - "阅", - "肌", - "哩", - "厉", - "烃", - "纬", - "毅", - "昨", - "伪", - "症", - "煮", - "叹", - "钉", - "搭", - "茎", - "笼", - "酷", - "偷", - "弓", - "锥", - "恒", - "杰", - "坑", - "鼻", - "翼", - "纶", - "叙", - "狱", - "逮", - "罐", - "络", - "棚", - "抑", - "膨", - "蔬", - "寺", - "骤", - "穆", - "冶", - "枯", - "册", - "尸", - "凸", - "绅", - "坯", - "牺", - "焰", - "轰", - "欣", - "晋", - "瘦", - "御", - "锭", - "锦", - "丧", - "旬", - "锻", - "垄", - "搜", - "扑", - "邀", - "亭", - "酯", - "迈", - "舒", - "脆", - "酶", - "闲", - "忧", - "酚", - "顽", - "羽", - "涨", - "卸", - "仗", - "陪", - "辟", - "惩", - "杭", - "姚", - "肚", - "捉", - "飘", - "漂", - "昆", - "欺", - "吾", - "郎", - "烷", - "汁", - "呵", - "饰", - "萧", - "雅", - "邮", - "迁", - "燕", - "撒", - "姻", - "赴", - "宴", - "烦", - "债", - "帐", - "斑", - "铃", - "旨", - "醇", - "董", - "饼", - "雏", - "姿", - "拌", - "傅", - "腹", - "妥", - "揉", - "贤", - "拆", - "歪", - "葡", - "胺", - "丢", - "浩", - "徽", - "昂", - "垫", - "挡", - "览", - "贪", - "慰", - "缴", - "汪", - "慌", - "冯", - "诺", - "姜", - "谊", - "凶", - "劣", - "诬", - "耀", - "昏", - "躺", - "盈", - "骑", - "乔", - "溪", - "丛", - "卢", - "抹", - "闷", - "咨", - "刮", - "驾", - "缆", - "悟", - "摘", - "铒", - "掷", - "颇", - "幻", - "柄", - "惠", - "惨", - "佳", - "仇", - "腊", - "窝", - "涤", - "剑", - "瞧", - "堡", - "泼", - "葱", - "罩", - "霍", - "捞", - "胎", - "苍", - "滨", - "俩", - "捅", - "湘", - "砍", - "霞", - "邵", - "萄", - "疯", - "淮", - "遂", - "熊", - "粪", - "烘", - "宿", - "档", - "戈", - "驳", - "嫂", - "裕", - "徙", - "箭", - "捐", - "肠", - "撑", - "晒", - "辨", - "殿", - "莲", - "摊", - "搅", - "酱", - "屏", - "疫", - "哀", - "蔡", - "堵", - "沫", - "皱", - "畅", - "叠", - "阁", - "莱", - "敲", - "辖", - "钩", - "痕", - "坝", - "巷", - "饿", - "祸", - "丘", - "玄", - "溜", - "曰", - "逻", - "彭", - "尝", - "卿", - "妨", - "艇", - "吞", - "韦", - "怨", - "矮", - "歇" -] diff --git a/tools/mnemonic-test/node_modules/bip39/src/wordlists/chinese_traditional.json b/tools/mnemonic-test/node_modules/bip39/src/wordlists/chinese_traditional.json deleted file mode 100644 index 4ec296c0..00000000 --- a/tools/mnemonic-test/node_modules/bip39/src/wordlists/chinese_traditional.json +++ /dev/null @@ -1,2050 +0,0 @@ -[ - "的", - "一", - "是", - "在", - "不", - "了", - "有", - "和", - "人", - "這", - "中", - "大", - "為", - "上", - "個", - "國", - "我", - "以", - "要", - "他", - "時", - "來", - "用", - "們", - "生", - "到", - "作", - "地", - "於", - "出", - "就", - "分", - "對", - "成", - "會", - "可", - "主", - "發", - "年", - "動", - "同", - "工", - "也", - "能", - "下", - "過", - "子", - "說", - "產", - "種", - "面", - "而", - "方", - "後", - "多", - "定", - "行", - "學", - "法", - "所", - "民", - "得", - "經", - "十", - "三", - "之", - "進", - "著", - "等", - "部", - "度", - "家", - "電", - "力", - "裡", - "如", - "水", - "化", - "高", - "自", - "二", - "理", - "起", - "小", - "物", - "現", - "實", - "加", - "量", - "都", - "兩", - "體", - "制", - "機", - "當", - "使", - "點", - "從", - "業", - "本", - "去", - "把", - "性", - "好", - "應", - "開", - "它", - "合", - "還", - "因", - "由", - "其", - "些", - "然", - "前", - "外", - "天", - "政", - "四", - "日", - "那", - "社", - "義", - "事", - "平", - "形", - "相", - "全", - "表", - "間", - "樣", - "與", - "關", - "各", - "重", - "新", - "線", - "內", - "數", - "正", - "心", - "反", - "你", - "明", - "看", - "原", - "又", - "麼", - "利", - "比", - "或", - "但", - "質", - "氣", - "第", - "向", - "道", - "命", - "此", - "變", - "條", - "只", - "沒", - "結", - "解", - "問", - "意", - "建", - "月", - "公", - "無", - "系", - "軍", - "很", - "情", - "者", - "最", - "立", - "代", - "想", - "已", - "通", - "並", - "提", - "直", - "題", - "黨", - "程", - "展", - "五", - "果", - "料", - "象", - "員", - "革", - "位", - "入", - "常", - "文", - "總", - "次", - "品", - "式", - "活", - "設", - "及", - "管", - "特", - "件", - "長", - "求", - "老", - "頭", - "基", - "資", - "邊", - "流", - "路", - "級", - "少", - "圖", - "山", - "統", - "接", - "知", - "較", - "將", - "組", - "見", - "計", - "別", - "她", - "手", - "角", - "期", - "根", - "論", - "運", - "農", - "指", - "幾", - "九", - "區", - "強", - "放", - "決", - "西", - "被", - "幹", - "做", - "必", - "戰", - "先", - "回", - "則", - "任", - "取", - "據", - "處", - "隊", - "南", - "給", - "色", - "光", - "門", - "即", - "保", - "治", - "北", - "造", - "百", - "規", - "熱", - "領", - "七", - "海", - "口", - "東", - "導", - "器", - "壓", - "志", - "世", - "金", - "增", - "爭", - "濟", - "階", - "油", - "思", - "術", - "極", - "交", - "受", - "聯", - "什", - "認", - "六", - "共", - "權", - "收", - "證", - "改", - "清", - "美", - "再", - "採", - "轉", - "更", - "單", - "風", - "切", - "打", - "白", - "教", - "速", - "花", - "帶", - "安", - "場", - "身", - "車", - "例", - "真", - "務", - "具", - "萬", - "每", - "目", - "至", - "達", - "走", - "積", - "示", - "議", - "聲", - "報", - "鬥", - "完", - "類", - "八", - "離", - "華", - "名", - "確", - "才", - "科", - "張", - "信", - "馬", - "節", - "話", - "米", - "整", - "空", - "元", - "況", - "今", - "集", - "溫", - "傳", - "土", - "許", - "步", - "群", - "廣", - "石", - "記", - "需", - "段", - "研", - "界", - "拉", - "林", - "律", - "叫", - "且", - "究", - "觀", - "越", - "織", - "裝", - "影", - "算", - "低", - "持", - "音", - "眾", - "書", - "布", - "复", - "容", - "兒", - "須", - "際", - "商", - "非", - "驗", - "連", - "斷", - "深", - "難", - "近", - "礦", - "千", - "週", - "委", - "素", - "技", - "備", - "半", - "辦", - "青", - "省", - "列", - "習", - "響", - "約", - "支", - "般", - "史", - "感", - "勞", - "便", - "團", - "往", - "酸", - "歷", - "市", - "克", - "何", - "除", - "消", - "構", - "府", - "稱", - "太", - "準", - "精", - "值", - "號", - "率", - "族", - "維", - "劃", - "選", - "標", - "寫", - "存", - "候", - "毛", - "親", - "快", - "效", - "斯", - "院", - "查", - "江", - "型", - "眼", - "王", - "按", - "格", - "養", - "易", - "置", - "派", - "層", - "片", - "始", - "卻", - "專", - "狀", - "育", - "廠", - "京", - "識", - "適", - "屬", - "圓", - "包", - "火", - "住", - "調", - "滿", - "縣", - "局", - "照", - "參", - "紅", - "細", - "引", - "聽", - "該", - "鐵", - "價", - "嚴", - "首", - "底", - "液", - "官", - "德", - "隨", - "病", - "蘇", - "失", - "爾", - "死", - "講", - "配", - "女", - "黃", - "推", - "顯", - "談", - "罪", - "神", - "藝", - "呢", - "席", - "含", - "企", - "望", - "密", - "批", - "營", - "項", - "防", - "舉", - "球", - "英", - "氧", - "勢", - "告", - "李", - "台", - "落", - "木", - "幫", - "輪", - "破", - "亞", - "師", - "圍", - "注", - "遠", - "字", - "材", - "排", - "供", - "河", - "態", - "封", - "另", - "施", - "減", - "樹", - "溶", - "怎", - "止", - "案", - "言", - "士", - "均", - "武", - "固", - "葉", - "魚", - "波", - "視", - "僅", - "費", - "緊", - "愛", - "左", - "章", - "早", - "朝", - "害", - "續", - "輕", - "服", - "試", - "食", - "充", - "兵", - "源", - "判", - "護", - "司", - "足", - "某", - "練", - "差", - "致", - "板", - "田", - "降", - "黑", - "犯", - "負", - "擊", - "范", - "繼", - "興", - "似", - "餘", - "堅", - "曲", - "輸", - "修", - "故", - "城", - "夫", - "夠", - "送", - "筆", - "船", - "佔", - "右", - "財", - "吃", - "富", - "春", - "職", - "覺", - "漢", - "畫", - "功", - "巴", - "跟", - "雖", - "雜", - "飛", - "檢", - "吸", - "助", - "昇", - "陽", - "互", - "初", - "創", - "抗", - "考", - "投", - "壞", - "策", - "古", - "徑", - "換", - "未", - "跑", - "留", - "鋼", - "曾", - "端", - "責", - "站", - "簡", - "述", - "錢", - "副", - "盡", - "帝", - "射", - "草", - "衝", - "承", - "獨", - "令", - "限", - "阿", - "宣", - "環", - "雙", - "請", - "超", - "微", - "讓", - "控", - "州", - "良", - "軸", - "找", - "否", - "紀", - "益", - "依", - "優", - "頂", - "礎", - "載", - "倒", - "房", - "突", - "坐", - "粉", - "敵", - "略", - "客", - "袁", - "冷", - "勝", - "絕", - "析", - "塊", - "劑", - "測", - "絲", - "協", - "訴", - "念", - "陳", - "仍", - "羅", - "鹽", - "友", - "洋", - "錯", - "苦", - "夜", - "刑", - "移", - "頻", - "逐", - "靠", - "混", - "母", - "短", - "皮", - "終", - "聚", - "汽", - "村", - "雲", - "哪", - "既", - "距", - "衛", - "停", - "烈", - "央", - "察", - "燒", - "迅", - "境", - "若", - "印", - "洲", - "刻", - "括", - "激", - "孔", - "搞", - "甚", - "室", - "待", - "核", - "校", - "散", - "侵", - "吧", - "甲", - "遊", - "久", - "菜", - "味", - "舊", - "模", - "湖", - "貨", - "損", - "預", - "阻", - "毫", - "普", - "穩", - "乙", - "媽", - "植", - "息", - "擴", - "銀", - "語", - "揮", - "酒", - "守", - "拿", - "序", - "紙", - "醫", - "缺", - "雨", - "嗎", - "針", - "劉", - "啊", - "急", - "唱", - "誤", - "訓", - "願", - "審", - "附", - "獲", - "茶", - "鮮", - "糧", - "斤", - "孩", - "脫", - "硫", - "肥", - "善", - "龍", - "演", - "父", - "漸", - "血", - "歡", - "械", - "掌", - "歌", - "沙", - "剛", - "攻", - "謂", - "盾", - "討", - "晚", - "粒", - "亂", - "燃", - "矛", - "乎", - "殺", - "藥", - "寧", - "魯", - "貴", - "鐘", - "煤", - "讀", - "班", - "伯", - "香", - "介", - "迫", - "句", - "豐", - "培", - "握", - "蘭", - "擔", - "弦", - "蛋", - "沉", - "假", - "穿", - "執", - "答", - "樂", - "誰", - "順", - "煙", - "縮", - "徵", - "臉", - "喜", - "松", - "腳", - "困", - "異", - "免", - "背", - "星", - "福", - "買", - "染", - "井", - "概", - "慢", - "怕", - "磁", - "倍", - "祖", - "皇", - "促", - "靜", - "補", - "評", - "翻", - "肉", - "踐", - "尼", - "衣", - "寬", - "揚", - "棉", - "希", - "傷", - "操", - "垂", - "秋", - "宜", - "氫", - "套", - "督", - "振", - "架", - "亮", - "末", - "憲", - "慶", - "編", - "牛", - "觸", - "映", - "雷", - "銷", - "詩", - "座", - "居", - "抓", - "裂", - "胞", - "呼", - "娘", - "景", - "威", - "綠", - "晶", - "厚", - "盟", - "衡", - "雞", - "孫", - "延", - "危", - "膠", - "屋", - "鄉", - "臨", - "陸", - "顧", - "掉", - "呀", - "燈", - "歲", - "措", - "束", - "耐", - "劇", - "玉", - "趙", - "跳", - "哥", - "季", - "課", - "凱", - "胡", - "額", - "款", - "紹", - "卷", - "齊", - "偉", - "蒸", - "殖", - "永", - "宗", - "苗", - "川", - "爐", - "岩", - "弱", - "零", - "楊", - "奏", - "沿", - "露", - "桿", - "探", - "滑", - "鎮", - "飯", - "濃", - "航", - "懷", - "趕", - "庫", - "奪", - "伊", - "靈", - "稅", - "途", - "滅", - "賽", - "歸", - "召", - "鼓", - "播", - "盤", - "裁", - "險", - "康", - "唯", - "錄", - "菌", - "純", - "借", - "糖", - "蓋", - "橫", - "符", - "私", - "努", - "堂", - "域", - "槍", - "潤", - "幅", - "哈", - "竟", - "熟", - "蟲", - "澤", - "腦", - "壤", - "碳", - "歐", - "遍", - "側", - "寨", - "敢", - "徹", - "慮", - "斜", - "薄", - "庭", - "納", - "彈", - "飼", - "伸", - "折", - "麥", - "濕", - "暗", - "荷", - "瓦", - "塞", - "床", - "築", - "惡", - "戶", - "訪", - "塔", - "奇", - "透", - "梁", - "刀", - "旋", - "跡", - "卡", - "氯", - "遇", - "份", - "毒", - "泥", - "退", - "洗", - "擺", - "灰", - "彩", - "賣", - "耗", - "夏", - "擇", - "忙", - "銅", - "獻", - "硬", - "予", - "繁", - "圈", - "雪", - "函", - "亦", - "抽", - "篇", - "陣", - "陰", - "丁", - "尺", - "追", - "堆", - "雄", - "迎", - "泛", - "爸", - "樓", - "避", - "謀", - "噸", - "野", - "豬", - "旗", - "累", - "偏", - "典", - "館", - "索", - "秦", - "脂", - "潮", - "爺", - "豆", - "忽", - "托", - "驚", - "塑", - "遺", - "愈", - "朱", - "替", - "纖", - "粗", - "傾", - "尚", - "痛", - "楚", - "謝", - "奮", - "購", - "磨", - "君", - "池", - "旁", - "碎", - "骨", - "監", - "捕", - "弟", - "暴", - "割", - "貫", - "殊", - "釋", - "詞", - "亡", - "壁", - "頓", - "寶", - "午", - "塵", - "聞", - "揭", - "炮", - "殘", - "冬", - "橋", - "婦", - "警", - "綜", - "招", - "吳", - "付", - "浮", - "遭", - "徐", - "您", - "搖", - "谷", - "贊", - "箱", - "隔", - "訂", - "男", - "吹", - "園", - "紛", - "唐", - "敗", - "宋", - "玻", - "巨", - "耕", - "坦", - "榮", - "閉", - "灣", - "鍵", - "凡", - "駐", - "鍋", - "救", - "恩", - "剝", - "凝", - "鹼", - "齒", - "截", - "煉", - "麻", - "紡", - "禁", - "廢", - "盛", - "版", - "緩", - "淨", - "睛", - "昌", - "婚", - "涉", - "筒", - "嘴", - "插", - "岸", - "朗", - "莊", - "街", - "藏", - "姑", - "貿", - "腐", - "奴", - "啦", - "慣", - "乘", - "夥", - "恢", - "勻", - "紗", - "扎", - "辯", - "耳", - "彪", - "臣", - "億", - "璃", - "抵", - "脈", - "秀", - "薩", - "俄", - "網", - "舞", - "店", - "噴", - "縱", - "寸", - "汗", - "掛", - "洪", - "賀", - "閃", - "柬", - "爆", - "烯", - "津", - "稻", - "牆", - "軟", - "勇", - "像", - "滾", - "厘", - "蒙", - "芳", - "肯", - "坡", - "柱", - "盪", - "腿", - "儀", - "旅", - "尾", - "軋", - "冰", - "貢", - "登", - "黎", - "削", - "鑽", - "勒", - "逃", - "障", - "氨", - "郭", - "峰", - "幣", - "港", - "伏", - "軌", - "畝", - "畢", - "擦", - "莫", - "刺", - "浪", - "秘", - "援", - "株", - "健", - "售", - "股", - "島", - "甘", - "泡", - "睡", - "童", - "鑄", - "湯", - "閥", - "休", - "匯", - "舍", - "牧", - "繞", - "炸", - "哲", - "磷", - "績", - "朋", - "淡", - "尖", - "啟", - "陷", - "柴", - "呈", - "徒", - "顏", - "淚", - "稍", - "忘", - "泵", - "藍", - "拖", - "洞", - "授", - "鏡", - "辛", - "壯", - "鋒", - "貧", - "虛", - "彎", - "摩", - "泰", - "幼", - "廷", - "尊", - "窗", - "綱", - "弄", - "隸", - "疑", - "氏", - "宮", - "姐", - "震", - "瑞", - "怪", - "尤", - "琴", - "循", - "描", - "膜", - "違", - "夾", - "腰", - "緣", - "珠", - "窮", - "森", - "枝", - "竹", - "溝", - "催", - "繩", - "憶", - "邦", - "剩", - "幸", - "漿", - "欄", - "擁", - "牙", - "貯", - "禮", - "濾", - "鈉", - "紋", - "罷", - "拍", - "咱", - "喊", - "袖", - "埃", - "勤", - "罰", - "焦", - "潛", - "伍", - "墨", - "欲", - "縫", - "姓", - "刊", - "飽", - "仿", - "獎", - "鋁", - "鬼", - "麗", - "跨", - "默", - "挖", - "鏈", - "掃", - "喝", - "袋", - "炭", - "污", - "幕", - "諸", - "弧", - "勵", - "梅", - "奶", - "潔", - "災", - "舟", - "鑑", - "苯", - "訟", - "抱", - "毀", - "懂", - "寒", - "智", - "埔", - "寄", - "屆", - "躍", - "渡", - "挑", - "丹", - "艱", - "貝", - "碰", - "拔", - "爹", - "戴", - "碼", - "夢", - "芽", - "熔", - "赤", - "漁", - "哭", - "敬", - "顆", - "奔", - "鉛", - "仲", - "虎", - "稀", - "妹", - "乏", - "珍", - "申", - "桌", - "遵", - "允", - "隆", - "螺", - "倉", - "魏", - "銳", - "曉", - "氮", - "兼", - "隱", - "礙", - "赫", - "撥", - "忠", - "肅", - "缸", - "牽", - "搶", - "博", - "巧", - "殼", - "兄", - "杜", - "訊", - "誠", - "碧", - "祥", - "柯", - "頁", - "巡", - "矩", - "悲", - "灌", - "齡", - "倫", - "票", - "尋", - "桂", - "鋪", - "聖", - "恐", - "恰", - "鄭", - "趣", - "抬", - "荒", - "騰", - "貼", - "柔", - "滴", - "猛", - "闊", - "輛", - "妻", - "填", - "撤", - "儲", - "簽", - "鬧", - "擾", - "紫", - "砂", - "遞", - "戲", - "吊", - "陶", - "伐", - "餵", - "療", - "瓶", - "婆", - "撫", - "臂", - "摸", - "忍", - "蝦", - "蠟", - "鄰", - "胸", - "鞏", - "擠", - "偶", - "棄", - "槽", - "勁", - "乳", - "鄧", - "吉", - "仁", - "爛", - "磚", - "租", - "烏", - "艦", - "伴", - "瓜", - "淺", - "丙", - "暫", - "燥", - "橡", - "柳", - "迷", - "暖", - "牌", - "秧", - "膽", - "詳", - "簧", - "踏", - "瓷", - "譜", - "呆", - "賓", - "糊", - "洛", - "輝", - "憤", - "競", - "隙", - "怒", - "粘", - "乃", - "緒", - "肩", - "籍", - "敏", - "塗", - "熙", - "皆", - "偵", - "懸", - "掘", - "享", - "糾", - "醒", - "狂", - "鎖", - "淀", - "恨", - "牲", - "霸", - "爬", - "賞", - "逆", - "玩", - "陵", - "祝", - "秒", - "浙", - "貌", - "役", - "彼", - "悉", - "鴨", - "趨", - "鳳", - "晨", - "畜", - "輩", - "秩", - "卵", - "署", - "梯", - "炎", - "灘", - "棋", - "驅", - "篩", - "峽", - "冒", - "啥", - "壽", - "譯", - "浸", - "泉", - "帽", - "遲", - "矽", - "疆", - "貸", - "漏", - "稿", - "冠", - "嫩", - "脅", - "芯", - "牢", - "叛", - "蝕", - "奧", - "鳴", - "嶺", - "羊", - "憑", - "串", - "塘", - "繪", - "酵", - "融", - "盆", - "錫", - "廟", - "籌", - "凍", - "輔", - "攝", - "襲", - "筋", - "拒", - "僚", - "旱", - "鉀", - "鳥", - "漆", - "沈", - "眉", - "疏", - "添", - "棒", - "穗", - "硝", - "韓", - "逼", - "扭", - "僑", - "涼", - "挺", - "碗", - "栽", - "炒", - "杯", - "患", - "餾", - "勸", - "豪", - "遼", - "勃", - "鴻", - "旦", - "吏", - "拜", - "狗", - "埋", - "輥", - "掩", - "飲", - "搬", - "罵", - "辭", - "勾", - "扣", - "估", - "蔣", - "絨", - "霧", - "丈", - "朵", - "姆", - "擬", - "宇", - "輯", - "陝", - "雕", - "償", - "蓄", - "崇", - "剪", - "倡", - "廳", - "咬", - "駛", - "薯", - "刷", - "斥", - "番", - "賦", - "奉", - "佛", - "澆", - "漫", - "曼", - "扇", - "鈣", - "桃", - "扶", - "仔", - "返", - "俗", - "虧", - "腔", - "鞋", - "棱", - "覆", - "框", - "悄", - "叔", - "撞", - "騙", - "勘", - "旺", - "沸", - "孤", - "吐", - "孟", - "渠", - "屈", - "疾", - "妙", - "惜", - "仰", - "狠", - "脹", - "諧", - "拋", - "黴", - "桑", - "崗", - "嘛", - "衰", - "盜", - "滲", - "臟", - "賴", - "湧", - "甜", - "曹", - "閱", - "肌", - "哩", - "厲", - "烴", - "緯", - "毅", - "昨", - "偽", - "症", - "煮", - "嘆", - "釘", - "搭", - "莖", - "籠", - "酷", - "偷", - "弓", - "錐", - "恆", - "傑", - "坑", - "鼻", - "翼", - "綸", - "敘", - "獄", - "逮", - "罐", - "絡", - "棚", - "抑", - "膨", - "蔬", - "寺", - "驟", - "穆", - "冶", - "枯", - "冊", - "屍", - "凸", - "紳", - "坯", - "犧", - "焰", - "轟", - "欣", - "晉", - "瘦", - "禦", - "錠", - "錦", - "喪", - "旬", - "鍛", - "壟", - "搜", - "撲", - "邀", - "亭", - "酯", - "邁", - "舒", - "脆", - "酶", - "閒", - "憂", - "酚", - "頑", - "羽", - "漲", - "卸", - "仗", - "陪", - "闢", - "懲", - "杭", - "姚", - "肚", - "捉", - "飄", - "漂", - "昆", - "欺", - "吾", - "郎", - "烷", - "汁", - "呵", - "飾", - "蕭", - "雅", - "郵", - "遷", - "燕", - "撒", - "姻", - "赴", - "宴", - "煩", - "債", - "帳", - "斑", - "鈴", - "旨", - "醇", - "董", - "餅", - "雛", - "姿", - "拌", - "傅", - "腹", - "妥", - "揉", - "賢", - "拆", - "歪", - "葡", - "胺", - "丟", - "浩", - "徽", - "昂", - "墊", - "擋", - "覽", - "貪", - "慰", - "繳", - "汪", - "慌", - "馮", - "諾", - "姜", - "誼", - "兇", - "劣", - "誣", - "耀", - "昏", - "躺", - "盈", - "騎", - "喬", - "溪", - "叢", - "盧", - "抹", - "悶", - "諮", - "刮", - "駕", - "纜", - "悟", - "摘", - "鉺", - "擲", - "頗", - "幻", - "柄", - "惠", - "慘", - "佳", - "仇", - "臘", - "窩", - "滌", - "劍", - "瞧", - "堡", - "潑", - "蔥", - "罩", - "霍", - "撈", - "胎", - "蒼", - "濱", - "倆", - "捅", - "湘", - "砍", - "霞", - "邵", - "萄", - "瘋", - "淮", - "遂", - "熊", - "糞", - "烘", - "宿", - "檔", - "戈", - "駁", - "嫂", - "裕", - "徙", - "箭", - "捐", - "腸", - "撐", - "曬", - "辨", - "殿", - "蓮", - "攤", - "攪", - "醬", - "屏", - "疫", - "哀", - "蔡", - "堵", - "沫", - "皺", - "暢", - "疊", - "閣", - "萊", - "敲", - "轄", - "鉤", - "痕", - "壩", - "巷", - "餓", - "禍", - "丘", - "玄", - "溜", - "曰", - "邏", - "彭", - "嘗", - "卿", - "妨", - "艇", - "吞", - "韋", - "怨", - "矮", - "歇" -] diff --git a/tools/mnemonic-test/node_modules/bip39/src/wordlists/czech.json b/tools/mnemonic-test/node_modules/bip39/src/wordlists/czech.json deleted file mode 100644 index 7001272a..00000000 --- a/tools/mnemonic-test/node_modules/bip39/src/wordlists/czech.json +++ /dev/null @@ -1,2050 +0,0 @@ -[ - "abdikace", - "abeceda", - "adresa", - "agrese", - "akce", - "aktovka", - "alej", - "alkohol", - "amputace", - "ananas", - "andulka", - "anekdota", - "anketa", - "antika", - "anulovat", - "archa", - "arogance", - "asfalt", - "asistent", - "aspirace", - "astma", - "astronom", - "atlas", - "atletika", - "atol", - "autobus", - "azyl", - "babka", - "bachor", - "bacil", - "baculka", - "badatel", - "bageta", - "bagr", - "bahno", - "bakterie", - "balada", - "baletka", - "balkon", - "balonek", - "balvan", - "balza", - "bambus", - "bankomat", - "barbar", - "baret", - "barman", - "baroko", - "barva", - "baterka", - "batoh", - "bavlna", - "bazalka", - "bazilika", - "bazuka", - "bedna", - "beran", - "beseda", - "bestie", - "beton", - "bezinka", - "bezmoc", - "beztak", - "bicykl", - "bidlo", - "biftek", - "bikiny", - "bilance", - "biograf", - "biolog", - "bitva", - "bizon", - "blahobyt", - "blatouch", - "blecha", - "bledule", - "blesk", - "blikat", - "blizna", - "blokovat", - "bloudit", - "blud", - "bobek", - "bobr", - "bodlina", - "bodnout", - "bohatost", - "bojkot", - "bojovat", - "bokorys", - "bolest", - "borec", - "borovice", - "bota", - "boubel", - "bouchat", - "bouda", - "boule", - "bourat", - "boxer", - "bradavka", - "brambora", - "branka", - "bratr", - "brepta", - "briketa", - "brko", - "brloh", - "bronz", - "broskev", - "brunetka", - "brusinka", - "brzda", - "brzy", - "bublina", - "bubnovat", - "buchta", - "buditel", - "budka", - "budova", - "bufet", - "bujarost", - "bukvice", - "buldok", - "bulva", - "bunda", - "bunkr", - "burza", - "butik", - "buvol", - "buzola", - "bydlet", - "bylina", - "bytovka", - "bzukot", - "capart", - "carevna", - "cedr", - "cedule", - "cejch", - "cejn", - "cela", - "celer", - "celkem", - "celnice", - "cenina", - "cennost", - "cenovka", - "centrum", - "cenzor", - "cestopis", - "cetka", - "chalupa", - "chapadlo", - "charita", - "chata", - "chechtat", - "chemie", - "chichot", - "chirurg", - "chlad", - "chleba", - "chlubit", - "chmel", - "chmura", - "chobot", - "chochol", - "chodba", - "cholera", - "chomout", - "chopit", - "choroba", - "chov", - "chrapot", - "chrlit", - "chrt", - "chrup", - "chtivost", - "chudina", - "chutnat", - "chvat", - "chvilka", - "chvost", - "chyba", - "chystat", - "chytit", - "cibule", - "cigareta", - "cihelna", - "cihla", - "cinkot", - "cirkus", - "cisterna", - "citace", - "citrus", - "cizinec", - "cizost", - "clona", - "cokoliv", - "couvat", - "ctitel", - "ctnost", - "cudnost", - "cuketa", - "cukr", - "cupot", - "cvaknout", - "cval", - "cvik", - "cvrkot", - "cyklista", - "daleko", - "dareba", - "datel", - "datum", - "dcera", - "debata", - "dechovka", - "decibel", - "deficit", - "deflace", - "dekl", - "dekret", - "demokrat", - "deprese", - "derby", - "deska", - "detektiv", - "dikobraz", - "diktovat", - "dioda", - "diplom", - "disk", - "displej", - "divadlo", - "divoch", - "dlaha", - "dlouho", - "dluhopis", - "dnes", - "dobro", - "dobytek", - "docent", - "dochutit", - "dodnes", - "dohled", - "dohoda", - "dohra", - "dojem", - "dojnice", - "doklad", - "dokola", - "doktor", - "dokument", - "dolar", - "doleva", - "dolina", - "doma", - "dominant", - "domluvit", - "domov", - "donutit", - "dopad", - "dopis", - "doplnit", - "doposud", - "doprovod", - "dopustit", - "dorazit", - "dorost", - "dort", - "dosah", - "doslov", - "dostatek", - "dosud", - "dosyta", - "dotaz", - "dotek", - "dotknout", - "doufat", - "doutnat", - "dovozce", - "dozadu", - "doznat", - "dozorce", - "drahota", - "drak", - "dramatik", - "dravec", - "draze", - "drdol", - "drobnost", - "drogerie", - "drozd", - "drsnost", - "drtit", - "drzost", - "duben", - "duchovno", - "dudek", - "duha", - "duhovka", - "dusit", - "dusno", - "dutost", - "dvojice", - "dvorec", - "dynamit", - "ekolog", - "ekonomie", - "elektron", - "elipsa", - "email", - "emise", - "emoce", - "empatie", - "epizoda", - "epocha", - "epopej", - "epos", - "esej", - "esence", - "eskorta", - "eskymo", - "etiketa", - "euforie", - "evoluce", - "exekuce", - "exkurze", - "expedice", - "exploze", - "export", - "extrakt", - "facka", - "fajfka", - "fakulta", - "fanatik", - "fantazie", - "farmacie", - "favorit", - "fazole", - "federace", - "fejeton", - "fenka", - "fialka", - "figurant", - "filozof", - "filtr", - "finance", - "finta", - "fixace", - "fjord", - "flanel", - "flirt", - "flotila", - "fond", - "fosfor", - "fotbal", - "fotka", - "foton", - "frakce", - "freska", - "fronta", - "fukar", - "funkce", - "fyzika", - "galeje", - "garant", - "genetika", - "geolog", - "gilotina", - "glazura", - "glejt", - "golem", - "golfista", - "gotika", - "graf", - "gramofon", - "granule", - "grep", - "gril", - "grog", - "groteska", - "guma", - "hadice", - "hadr", - "hala", - "halenka", - "hanba", - "hanopis", - "harfa", - "harpuna", - "havran", - "hebkost", - "hejkal", - "hejno", - "hejtman", - "hektar", - "helma", - "hematom", - "herec", - "herna", - "heslo", - "hezky", - "historik", - "hladovka", - "hlasivky", - "hlava", - "hledat", - "hlen", - "hlodavec", - "hloh", - "hloupost", - "hltat", - "hlubina", - "hluchota", - "hmat", - "hmota", - "hmyz", - "hnis", - "hnojivo", - "hnout", - "hoblina", - "hoboj", - "hoch", - "hodiny", - "hodlat", - "hodnota", - "hodovat", - "hojnost", - "hokej", - "holinka", - "holka", - "holub", - "homole", - "honitba", - "honorace", - "horal", - "horda", - "horizont", - "horko", - "horlivec", - "hormon", - "hornina", - "horoskop", - "horstvo", - "hospoda", - "hostina", - "hotovost", - "houba", - "houf", - "houpat", - "houska", - "hovor", - "hradba", - "hranice", - "hravost", - "hrazda", - "hrbolek", - "hrdina", - "hrdlo", - "hrdost", - "hrnek", - "hrobka", - "hromada", - "hrot", - "hrouda", - "hrozen", - "hrstka", - "hrubost", - "hryzat", - "hubenost", - "hubnout", - "hudba", - "hukot", - "humr", - "husita", - "hustota", - "hvozd", - "hybnost", - "hydrant", - "hygiena", - "hymna", - "hysterik", - "idylka", - "ihned", - "ikona", - "iluze", - "imunita", - "infekce", - "inflace", - "inkaso", - "inovace", - "inspekce", - "internet", - "invalida", - "investor", - "inzerce", - "ironie", - "jablko", - "jachta", - "jahoda", - "jakmile", - "jakost", - "jalovec", - "jantar", - "jarmark", - "jaro", - "jasan", - "jasno", - "jatka", - "javor", - "jazyk", - "jedinec", - "jedle", - "jednatel", - "jehlan", - "jekot", - "jelen", - "jelito", - "jemnost", - "jenom", - "jepice", - "jeseter", - "jevit", - "jezdec", - "jezero", - "jinak", - "jindy", - "jinoch", - "jiskra", - "jistota", - "jitrnice", - "jizva", - "jmenovat", - "jogurt", - "jurta", - "kabaret", - "kabel", - "kabinet", - "kachna", - "kadet", - "kadidlo", - "kahan", - "kajak", - "kajuta", - "kakao", - "kaktus", - "kalamita", - "kalhoty", - "kalibr", - "kalnost", - "kamera", - "kamkoliv", - "kamna", - "kanibal", - "kanoe", - "kantor", - "kapalina", - "kapela", - "kapitola", - "kapka", - "kaple", - "kapota", - "kapr", - "kapusta", - "kapybara", - "karamel", - "karotka", - "karton", - "kasa", - "katalog", - "katedra", - "kauce", - "kauza", - "kavalec", - "kazajka", - "kazeta", - "kazivost", - "kdekoliv", - "kdesi", - "kedluben", - "kemp", - "keramika", - "kino", - "klacek", - "kladivo", - "klam", - "klapot", - "klasika", - "klaun", - "klec", - "klenba", - "klepat", - "klesnout", - "klid", - "klima", - "klisna", - "klobouk", - "klokan", - "klopa", - "kloub", - "klubovna", - "klusat", - "kluzkost", - "kmen", - "kmitat", - "kmotr", - "kniha", - "knot", - "koalice", - "koberec", - "kobka", - "kobliha", - "kobyla", - "kocour", - "kohout", - "kojenec", - "kokos", - "koktejl", - "kolaps", - "koleda", - "kolize", - "kolo", - "komando", - "kometa", - "komik", - "komnata", - "komora", - "kompas", - "komunita", - "konat", - "koncept", - "kondice", - "konec", - "konfese", - "kongres", - "konina", - "konkurs", - "kontakt", - "konzerva", - "kopanec", - "kopie", - "kopnout", - "koprovka", - "korbel", - "korektor", - "kormidlo", - "koroptev", - "korpus", - "koruna", - "koryto", - "korzet", - "kosatec", - "kostka", - "kotel", - "kotleta", - "kotoul", - "koukat", - "koupelna", - "kousek", - "kouzlo", - "kovboj", - "koza", - "kozoroh", - "krabice", - "krach", - "krajina", - "kralovat", - "krasopis", - "kravata", - "kredit", - "krejcar", - "kresba", - "kreveta", - "kriket", - "kritik", - "krize", - "krkavec", - "krmelec", - "krmivo", - "krocan", - "krok", - "kronika", - "kropit", - "kroupa", - "krovka", - "krtek", - "kruhadlo", - "krupice", - "krutost", - "krvinka", - "krychle", - "krypta", - "krystal", - "kryt", - "kudlanka", - "kufr", - "kujnost", - "kukla", - "kulajda", - "kulich", - "kulka", - "kulomet", - "kultura", - "kuna", - "kupodivu", - "kurt", - "kurzor", - "kutil", - "kvalita", - "kvasinka", - "kvestor", - "kynolog", - "kyselina", - "kytara", - "kytice", - "kytka", - "kytovec", - "kyvadlo", - "labrador", - "lachtan", - "ladnost", - "laik", - "lakomec", - "lamela", - "lampa", - "lanovka", - "lasice", - "laso", - "lastura", - "latinka", - "lavina", - "lebka", - "leckdy", - "leden", - "lednice", - "ledovka", - "ledvina", - "legenda", - "legie", - "legrace", - "lehce", - "lehkost", - "lehnout", - "lektvar", - "lenochod", - "lentilka", - "lepenka", - "lepidlo", - "letadlo", - "letec", - "letmo", - "letokruh", - "levhart", - "levitace", - "levobok", - "libra", - "lichotka", - "lidojed", - "lidskost", - "lihovina", - "lijavec", - "lilek", - "limetka", - "linie", - "linka", - "linoleum", - "listopad", - "litina", - "litovat", - "lobista", - "lodivod", - "logika", - "logoped", - "lokalita", - "loket", - "lomcovat", - "lopata", - "lopuch", - "lord", - "losos", - "lotr", - "loudal", - "louh", - "louka", - "louskat", - "lovec", - "lstivost", - "lucerna", - "lucifer", - "lump", - "lusk", - "lustrace", - "lvice", - "lyra", - "lyrika", - "lysina", - "madam", - "madlo", - "magistr", - "mahagon", - "majetek", - "majitel", - "majorita", - "makak", - "makovice", - "makrela", - "malba", - "malina", - "malovat", - "malvice", - "maminka", - "mandle", - "manko", - "marnost", - "masakr", - "maskot", - "masopust", - "matice", - "matrika", - "maturita", - "mazanec", - "mazivo", - "mazlit", - "mazurka", - "mdloba", - "mechanik", - "meditace", - "medovina", - "melasa", - "meloun", - "mentolka", - "metla", - "metoda", - "metr", - "mezera", - "migrace", - "mihnout", - "mihule", - "mikina", - "mikrofon", - "milenec", - "milimetr", - "milost", - "mimika", - "mincovna", - "minibar", - "minomet", - "minulost", - "miska", - "mistr", - "mixovat", - "mladost", - "mlha", - "mlhovina", - "mlok", - "mlsat", - "mluvit", - "mnich", - "mnohem", - "mobil", - "mocnost", - "modelka", - "modlitba", - "mohyla", - "mokro", - "molekula", - "momentka", - "monarcha", - "monokl", - "monstrum", - "montovat", - "monzun", - "mosaz", - "moskyt", - "most", - "motivace", - "motorka", - "motyka", - "moucha", - "moudrost", - "mozaika", - "mozek", - "mozol", - "mramor", - "mravenec", - "mrkev", - "mrtvola", - "mrzet", - "mrzutost", - "mstitel", - "mudrc", - "muflon", - "mulat", - "mumie", - "munice", - "muset", - "mutace", - "muzeum", - "muzikant", - "myslivec", - "mzda", - "nabourat", - "nachytat", - "nadace", - "nadbytek", - "nadhoz", - "nadobro", - "nadpis", - "nahlas", - "nahnat", - "nahodile", - "nahradit", - "naivita", - "najednou", - "najisto", - "najmout", - "naklonit", - "nakonec", - "nakrmit", - "nalevo", - "namazat", - "namluvit", - "nanometr", - "naoko", - "naopak", - "naostro", - "napadat", - "napevno", - "naplnit", - "napnout", - "naposled", - "naprosto", - "narodit", - "naruby", - "narychlo", - "nasadit", - "nasekat", - "naslepo", - "nastat", - "natolik", - "navenek", - "navrch", - "navzdory", - "nazvat", - "nebe", - "nechat", - "necky", - "nedaleko", - "nedbat", - "neduh", - "negace", - "nehet", - "nehoda", - "nejen", - "nejprve", - "neklid", - "nelibost", - "nemilost", - "nemoc", - "neochota", - "neonka", - "nepokoj", - "nerost", - "nerv", - "nesmysl", - "nesoulad", - "netvor", - "neuron", - "nevina", - "nezvykle", - "nicota", - "nijak", - "nikam", - "nikdy", - "nikl", - "nikterak", - "nitro", - "nocleh", - "nohavice", - "nominace", - "nora", - "norek", - "nositel", - "nosnost", - "nouze", - "noviny", - "novota", - "nozdra", - "nuda", - "nudle", - "nuget", - "nutit", - "nutnost", - "nutrie", - "nymfa", - "obal", - "obarvit", - "obava", - "obdiv", - "obec", - "obehnat", - "obejmout", - "obezita", - "obhajoba", - "obilnice", - "objasnit", - "objekt", - "obklopit", - "oblast", - "oblek", - "obliba", - "obloha", - "obluda", - "obnos", - "obohatit", - "obojek", - "obout", - "obrazec", - "obrna", - "obruba", - "obrys", - "obsah", - "obsluha", - "obstarat", - "obuv", - "obvaz", - "obvinit", - "obvod", - "obvykle", - "obyvatel", - "obzor", - "ocas", - "ocel", - "ocenit", - "ochladit", - "ochota", - "ochrana", - "ocitnout", - "odboj", - "odbyt", - "odchod", - "odcizit", - "odebrat", - "odeslat", - "odevzdat", - "odezva", - "odhadce", - "odhodit", - "odjet", - "odjinud", - "odkaz", - "odkoupit", - "odliv", - "odluka", - "odmlka", - "odolnost", - "odpad", - "odpis", - "odplout", - "odpor", - "odpustit", - "odpykat", - "odrazka", - "odsoudit", - "odstup", - "odsun", - "odtok", - "odtud", - "odvaha", - "odveta", - "odvolat", - "odvracet", - "odznak", - "ofina", - "ofsajd", - "ohlas", - "ohnisko", - "ohrada", - "ohrozit", - "ohryzek", - "okap", - "okenice", - "oklika", - "okno", - "okouzlit", - "okovy", - "okrasa", - "okres", - "okrsek", - "okruh", - "okupant", - "okurka", - "okusit", - "olejnina", - "olizovat", - "omak", - "omeleta", - "omezit", - "omladina", - "omlouvat", - "omluva", - "omyl", - "onehdy", - "opakovat", - "opasek", - "operace", - "opice", - "opilost", - "opisovat", - "opora", - "opozice", - "opravdu", - "oproti", - "orbital", - "orchestr", - "orgie", - "orlice", - "orloj", - "ortel", - "osada", - "oschnout", - "osika", - "osivo", - "oslava", - "oslepit", - "oslnit", - "oslovit", - "osnova", - "osoba", - "osolit", - "ospalec", - "osten", - "ostraha", - "ostuda", - "ostych", - "osvojit", - "oteplit", - "otisk", - "otop", - "otrhat", - "otrlost", - "otrok", - "otruby", - "otvor", - "ovanout", - "ovar", - "oves", - "ovlivnit", - "ovoce", - "oxid", - "ozdoba", - "pachatel", - "pacient", - "padouch", - "pahorek", - "pakt", - "palanda", - "palec", - "palivo", - "paluba", - "pamflet", - "pamlsek", - "panenka", - "panika", - "panna", - "panovat", - "panstvo", - "pantofle", - "paprika", - "parketa", - "parodie", - "parta", - "paruka", - "paryba", - "paseka", - "pasivita", - "pastelka", - "patent", - "patrona", - "pavouk", - "pazneht", - "pazourek", - "pecka", - "pedagog", - "pejsek", - "peklo", - "peloton", - "penalta", - "pendrek", - "penze", - "periskop", - "pero", - "pestrost", - "petarda", - "petice", - "petrolej", - "pevnina", - "pexeso", - "pianista", - "piha", - "pijavice", - "pikle", - "piknik", - "pilina", - "pilnost", - "pilulka", - "pinzeta", - "pipeta", - "pisatel", - "pistole", - "pitevna", - "pivnice", - "pivovar", - "placenta", - "plakat", - "plamen", - "planeta", - "plastika", - "platit", - "plavidlo", - "plaz", - "plech", - "plemeno", - "plenta", - "ples", - "pletivo", - "plevel", - "plivat", - "plnit", - "plno", - "plocha", - "plodina", - "plomba", - "plout", - "pluk", - "plyn", - "pobavit", - "pobyt", - "pochod", - "pocit", - "poctivec", - "podat", - "podcenit", - "podepsat", - "podhled", - "podivit", - "podklad", - "podmanit", - "podnik", - "podoba", - "podpora", - "podraz", - "podstata", - "podvod", - "podzim", - "poezie", - "pohanka", - "pohnutka", - "pohovor", - "pohroma", - "pohyb", - "pointa", - "pojistka", - "pojmout", - "pokazit", - "pokles", - "pokoj", - "pokrok", - "pokuta", - "pokyn", - "poledne", - "polibek", - "polknout", - "poloha", - "polynom", - "pomalu", - "pominout", - "pomlka", - "pomoc", - "pomsta", - "pomyslet", - "ponechat", - "ponorka", - "ponurost", - "popadat", - "popel", - "popisek", - "poplach", - "poprosit", - "popsat", - "popud", - "poradce", - "porce", - "porod", - "porucha", - "poryv", - "posadit", - "posed", - "posila", - "poskok", - "poslanec", - "posoudit", - "pospolu", - "postava", - "posudek", - "posyp", - "potah", - "potkan", - "potlesk", - "potomek", - "potrava", - "potupa", - "potvora", - "poukaz", - "pouto", - "pouzdro", - "povaha", - "povidla", - "povlak", - "povoz", - "povrch", - "povstat", - "povyk", - "povzdech", - "pozdrav", - "pozemek", - "poznatek", - "pozor", - "pozvat", - "pracovat", - "prahory", - "praktika", - "prales", - "praotec", - "praporek", - "prase", - "pravda", - "princip", - "prkno", - "probudit", - "procento", - "prodej", - "profese", - "prohra", - "projekt", - "prolomit", - "promile", - "pronikat", - "propad", - "prorok", - "prosba", - "proton", - "proutek", - "provaz", - "prskavka", - "prsten", - "prudkost", - "prut", - "prvek", - "prvohory", - "psanec", - "psovod", - "pstruh", - "ptactvo", - "puberta", - "puch", - "pudl", - "pukavec", - "puklina", - "pukrle", - "pult", - "pumpa", - "punc", - "pupen", - "pusa", - "pusinka", - "pustina", - "putovat", - "putyka", - "pyramida", - "pysk", - "pytel", - "racek", - "rachot", - "radiace", - "radnice", - "radon", - "raft", - "ragby", - "raketa", - "rakovina", - "rameno", - "rampouch", - "rande", - "rarach", - "rarita", - "rasovna", - "rastr", - "ratolest", - "razance", - "razidlo", - "reagovat", - "reakce", - "recept", - "redaktor", - "referent", - "reflex", - "rejnok", - "reklama", - "rekord", - "rekrut", - "rektor", - "reputace", - "revize", - "revma", - "revolver", - "rezerva", - "riskovat", - "riziko", - "robotika", - "rodokmen", - "rohovka", - "rokle", - "rokoko", - "romaneto", - "ropovod", - "ropucha", - "rorejs", - "rosol", - "rostlina", - "rotmistr", - "rotoped", - "rotunda", - "roubenka", - "roucho", - "roup", - "roura", - "rovina", - "rovnice", - "rozbor", - "rozchod", - "rozdat", - "rozeznat", - "rozhodce", - "rozinka", - "rozjezd", - "rozkaz", - "rozloha", - "rozmar", - "rozpad", - "rozruch", - "rozsah", - "roztok", - "rozum", - "rozvod", - "rubrika", - "ruchadlo", - "rukavice", - "rukopis", - "ryba", - "rybolov", - "rychlost", - "rydlo", - "rypadlo", - "rytina", - "ryzost", - "sadista", - "sahat", - "sako", - "samec", - "samizdat", - "samota", - "sanitka", - "sardinka", - "sasanka", - "satelit", - "sazba", - "sazenice", - "sbor", - "schovat", - "sebranka", - "secese", - "sedadlo", - "sediment", - "sedlo", - "sehnat", - "sejmout", - "sekera", - "sekta", - "sekunda", - "sekvoje", - "semeno", - "seno", - "servis", - "sesadit", - "seshora", - "seskok", - "seslat", - "sestra", - "sesuv", - "sesypat", - "setba", - "setina", - "setkat", - "setnout", - "setrvat", - "sever", - "seznam", - "shoda", - "shrnout", - "sifon", - "silnice", - "sirka", - "sirotek", - "sirup", - "situace", - "skafandr", - "skalisko", - "skanzen", - "skaut", - "skeptik", - "skica", - "skladba", - "sklenice", - "sklo", - "skluz", - "skoba", - "skokan", - "skoro", - "skripta", - "skrz", - "skupina", - "skvost", - "skvrna", - "slabika", - "sladidlo", - "slanina", - "slast", - "slavnost", - "sledovat", - "slepec", - "sleva", - "slezina", - "slib", - "slina", - "sliznice", - "slon", - "sloupek", - "slovo", - "sluch", - "sluha", - "slunce", - "slupka", - "slza", - "smaragd", - "smetana", - "smilstvo", - "smlouva", - "smog", - "smrad", - "smrk", - "smrtka", - "smutek", - "smysl", - "snad", - "snaha", - "snob", - "sobota", - "socha", - "sodovka", - "sokol", - "sopka", - "sotva", - "souboj", - "soucit", - "soudce", - "souhlas", - "soulad", - "soumrak", - "souprava", - "soused", - "soutok", - "souviset", - "spalovna", - "spasitel", - "spis", - "splav", - "spodek", - "spojenec", - "spolu", - "sponzor", - "spornost", - "spousta", - "sprcha", - "spustit", - "sranda", - "sraz", - "srdce", - "srna", - "srnec", - "srovnat", - "srpen", - "srst", - "srub", - "stanice", - "starosta", - "statika", - "stavba", - "stehno", - "stezka", - "stodola", - "stolek", - "stopa", - "storno", - "stoupat", - "strach", - "stres", - "strhnout", - "strom", - "struna", - "studna", - "stupnice", - "stvol", - "styk", - "subjekt", - "subtropy", - "suchar", - "sudost", - "sukno", - "sundat", - "sunout", - "surikata", - "surovina", - "svah", - "svalstvo", - "svetr", - "svatba", - "svazek", - "svisle", - "svitek", - "svoboda", - "svodidlo", - "svorka", - "svrab", - "sykavka", - "sykot", - "synek", - "synovec", - "sypat", - "sypkost", - "syrovost", - "sysel", - "sytost", - "tabletka", - "tabule", - "tahoun", - "tajemno", - "tajfun", - "tajga", - "tajit", - "tajnost", - "taktika", - "tamhle", - "tampon", - "tancovat", - "tanec", - "tanker", - "tapeta", - "tavenina", - "tazatel", - "technika", - "tehdy", - "tekutina", - "telefon", - "temnota", - "tendence", - "tenista", - "tenor", - "teplota", - "tepna", - "teprve", - "terapie", - "termoska", - "textil", - "ticho", - "tiskopis", - "titulek", - "tkadlec", - "tkanina", - "tlapka", - "tleskat", - "tlukot", - "tlupa", - "tmel", - "toaleta", - "topinka", - "topol", - "torzo", - "touha", - "toulec", - "tradice", - "traktor", - "tramp", - "trasa", - "traverza", - "trefit", - "trest", - "trezor", - "trhavina", - "trhlina", - "trochu", - "trojice", - "troska", - "trouba", - "trpce", - "trpitel", - "trpkost", - "trubec", - "truchlit", - "truhlice", - "trus", - "trvat", - "tudy", - "tuhnout", - "tuhost", - "tundra", - "turista", - "turnaj", - "tuzemsko", - "tvaroh", - "tvorba", - "tvrdost", - "tvrz", - "tygr", - "tykev", - "ubohost", - "uboze", - "ubrat", - "ubrousek", - "ubrus", - "ubytovna", - "ucho", - "uctivost", - "udivit", - "uhradit", - "ujednat", - "ujistit", - "ujmout", - "ukazatel", - "uklidnit", - "uklonit", - "ukotvit", - "ukrojit", - "ulice", - "ulita", - "ulovit", - "umyvadlo", - "unavit", - "uniforma", - "uniknout", - "upadnout", - "uplatnit", - "uplynout", - "upoutat", - "upravit", - "uran", - "urazit", - "usednout", - "usilovat", - "usmrtit", - "usnadnit", - "usnout", - "usoudit", - "ustlat", - "ustrnout", - "utahovat", - "utkat", - "utlumit", - "utonout", - "utopenec", - "utrousit", - "uvalit", - "uvolnit", - "uvozovka", - "uzdravit", - "uzel", - "uzenina", - "uzlina", - "uznat", - "vagon", - "valcha", - "valoun", - "vana", - "vandal", - "vanilka", - "varan", - "varhany", - "varovat", - "vcelku", - "vchod", - "vdova", - "vedro", - "vegetace", - "vejce", - "velbloud", - "veletrh", - "velitel", - "velmoc", - "velryba", - "venkov", - "veranda", - "verze", - "veselka", - "veskrze", - "vesnice", - "vespodu", - "vesta", - "veterina", - "veverka", - "vibrace", - "vichr", - "videohra", - "vidina", - "vidle", - "vila", - "vinice", - "viset", - "vitalita", - "vize", - "vizitka", - "vjezd", - "vklad", - "vkus", - "vlajka", - "vlak", - "vlasec", - "vlevo", - "vlhkost", - "vliv", - "vlnovka", - "vloupat", - "vnucovat", - "vnuk", - "voda", - "vodivost", - "vodoznak", - "vodstvo", - "vojensky", - "vojna", - "vojsko", - "volant", - "volba", - "volit", - "volno", - "voskovka", - "vozidlo", - "vozovna", - "vpravo", - "vrabec", - "vracet", - "vrah", - "vrata", - "vrba", - "vrcholek", - "vrhat", - "vrstva", - "vrtule", - "vsadit", - "vstoupit", - "vstup", - "vtip", - "vybavit", - "vybrat", - "vychovat", - "vydat", - "vydra", - "vyfotit", - "vyhledat", - "vyhnout", - "vyhodit", - "vyhradit", - "vyhubit", - "vyjasnit", - "vyjet", - "vyjmout", - "vyklopit", - "vykonat", - "vylekat", - "vymazat", - "vymezit", - "vymizet", - "vymyslet", - "vynechat", - "vynikat", - "vynutit", - "vypadat", - "vyplatit", - "vypravit", - "vypustit", - "vyrazit", - "vyrovnat", - "vyrvat", - "vyslovit", - "vysoko", - "vystavit", - "vysunout", - "vysypat", - "vytasit", - "vytesat", - "vytratit", - "vyvinout", - "vyvolat", - "vyvrhel", - "vyzdobit", - "vyznat", - "vzadu", - "vzbudit", - "vzchopit", - "vzdor", - "vzduch", - "vzdychat", - "vzestup", - "vzhledem", - "vzkaz", - "vzlykat", - "vznik", - "vzorek", - "vzpoura", - "vztah", - "vztek", - "xylofon", - "zabrat", - "zabydlet", - "zachovat", - "zadarmo", - "zadusit", - "zafoukat", - "zahltit", - "zahodit", - "zahrada", - "zahynout", - "zajatec", - "zajet", - "zajistit", - "zaklepat", - "zakoupit", - "zalepit", - "zamezit", - "zamotat", - "zamyslet", - "zanechat", - "zanikat", - "zaplatit", - "zapojit", - "zapsat", - "zarazit", - "zastavit", - "zasunout", - "zatajit", - "zatemnit", - "zatknout", - "zaujmout", - "zavalit", - "zavelet", - "zavinit", - "zavolat", - "zavrtat", - "zazvonit", - "zbavit", - "zbrusu", - "zbudovat", - "zbytek", - "zdaleka", - "zdarma", - "zdatnost", - "zdivo", - "zdobit", - "zdroj", - "zdvih", - "zdymadlo", - "zelenina", - "zeman", - "zemina", - "zeptat", - "zezadu", - "zezdola", - "zhatit", - "zhltnout", - "zhluboka", - "zhotovit", - "zhruba", - "zima", - "zimnice", - "zjemnit", - "zklamat", - "zkoumat", - "zkratka", - "zkumavka", - "zlato", - "zlehka", - "zloba", - "zlom", - "zlost", - "zlozvyk", - "zmapovat", - "zmar", - "zmatek", - "zmije", - "zmizet", - "zmocnit", - "zmodrat", - "zmrzlina", - "zmutovat", - "znak", - "znalost", - "znamenat", - "znovu", - "zobrazit", - "zotavit", - "zoubek", - "zoufale", - "zplodit", - "zpomalit", - "zprava", - "zprostit", - "zprudka", - "zprvu", - "zrada", - "zranit", - "zrcadlo", - "zrnitost", - "zrno", - "zrovna", - "zrychlit", - "zrzavost", - "zticha", - "ztratit", - "zubovina", - "zubr", - "zvednout", - "zvenku", - "zvesela", - "zvon", - "zvrat", - "zvukovod", - "zvyk" -] diff --git a/tools/mnemonic-test/node_modules/bip39/src/wordlists/english.json b/tools/mnemonic-test/node_modules/bip39/src/wordlists/english.json deleted file mode 100644 index cbc9d9b7..00000000 --- a/tools/mnemonic-test/node_modules/bip39/src/wordlists/english.json +++ /dev/null @@ -1,2050 +0,0 @@ -[ - "abandon", - "ability", - "able", - "about", - "above", - "absent", - "absorb", - "abstract", - "absurd", - "abuse", - "access", - "accident", - "account", - "accuse", - "achieve", - "acid", - "acoustic", - "acquire", - "across", - "act", - "action", - "actor", - "actress", - "actual", - "adapt", - "add", - "addict", - "address", - "adjust", - "admit", - "adult", - "advance", - "advice", - "aerobic", - "affair", - "afford", - "afraid", - "again", - "age", - "agent", - "agree", - "ahead", - "aim", - "air", - "airport", - "aisle", - "alarm", - "album", - "alcohol", - "alert", - "alien", - "all", - "alley", - "allow", - "almost", - "alone", - "alpha", - "already", - "also", - "alter", - "always", - "amateur", - "amazing", - "among", - "amount", - "amused", - "analyst", - "anchor", - "ancient", - "anger", - "angle", - "angry", - "animal", - "ankle", - "announce", - "annual", - "another", - "answer", - "antenna", - "antique", - "anxiety", - "any", - "apart", - "apology", - "appear", - "apple", - "approve", - "april", - "arch", - "arctic", - "area", - "arena", - "argue", - "arm", - "armed", - "armor", - "army", - "around", - "arrange", - "arrest", - "arrive", - "arrow", - "art", - "artefact", - "artist", - "artwork", - "ask", - "aspect", - "assault", - "asset", - "assist", - "assume", - "asthma", - "athlete", - "atom", - "attack", - "attend", - "attitude", - "attract", - "auction", - "audit", - "august", - "aunt", - "author", - "auto", - "autumn", - "average", - "avocado", - "avoid", - "awake", - "aware", - "away", - "awesome", - "awful", - "awkward", - "axis", - "baby", - "bachelor", - "bacon", - "badge", - "bag", - "balance", - "balcony", - "ball", - "bamboo", - "banana", - "banner", - "bar", - "barely", - "bargain", - "barrel", - "base", - "basic", - "basket", - "battle", - "beach", - "bean", - "beauty", - "because", - "become", - "beef", - "before", - "begin", - "behave", - "behind", - "believe", - "below", - "belt", - "bench", - "benefit", - "best", - "betray", - "better", - "between", - "beyond", - "bicycle", - "bid", - "bike", - "bind", - "biology", - "bird", - "birth", - "bitter", - "black", - "blade", - "blame", - "blanket", - "blast", - "bleak", - "bless", - "blind", - "blood", - "blossom", - "blouse", - "blue", - "blur", - "blush", - "board", - "boat", - "body", - "boil", - "bomb", - "bone", - "bonus", - "book", - "boost", - "border", - "boring", - "borrow", - "boss", - "bottom", - "bounce", - "box", - "boy", - "bracket", - "brain", - "brand", - "brass", - "brave", - "bread", - "breeze", - "brick", - "bridge", - "brief", - "bright", - "bring", - "brisk", - "broccoli", - "broken", - "bronze", - "broom", - "brother", - "brown", - "brush", - "bubble", - "buddy", - "budget", - "buffalo", - "build", - "bulb", - "bulk", - "bullet", - "bundle", - "bunker", - "burden", - "burger", - "burst", - "bus", - "business", - "busy", - "butter", - "buyer", - "buzz", - "cabbage", - "cabin", - "cable", - "cactus", - "cage", - "cake", - "call", - "calm", - "camera", - "camp", - "can", - "canal", - "cancel", - "candy", - "cannon", - "canoe", - "canvas", - "canyon", - "capable", - "capital", - "captain", - "car", - "carbon", - "card", - "cargo", - "carpet", - "carry", - "cart", - "case", - "cash", - "casino", - "castle", - "casual", - "cat", - "catalog", - "catch", - "category", - "cattle", - "caught", - "cause", - "caution", - "cave", - "ceiling", - "celery", - "cement", - "census", - "century", - "cereal", - "certain", - "chair", - "chalk", - "champion", - "change", - "chaos", - "chapter", - "charge", - "chase", - "chat", - "cheap", - "check", - "cheese", - "chef", - "cherry", - "chest", - "chicken", - "chief", - "child", - "chimney", - "choice", - "choose", - "chronic", - "chuckle", - "chunk", - "churn", - "cigar", - "cinnamon", - "circle", - "citizen", - "city", - "civil", - "claim", - "clap", - "clarify", - "claw", - "clay", - "clean", - "clerk", - "clever", - "click", - "client", - "cliff", - "climb", - "clinic", - "clip", - "clock", - "clog", - "close", - "cloth", - "cloud", - "clown", - "club", - "clump", - "cluster", - "clutch", - "coach", - "coast", - "coconut", - "code", - "coffee", - "coil", - "coin", - "collect", - "color", - "column", - "combine", - "come", - "comfort", - "comic", - "common", - "company", - "concert", - "conduct", - "confirm", - "congress", - "connect", - "consider", - "control", - "convince", - "cook", - "cool", - "copper", - "copy", - "coral", - "core", - "corn", - "correct", - "cost", - "cotton", - "couch", - "country", - "couple", - "course", - "cousin", - "cover", - "coyote", - "crack", - "cradle", - "craft", - "cram", - "crane", - "crash", - "crater", - "crawl", - "crazy", - "cream", - "credit", - "creek", - "crew", - "cricket", - "crime", - "crisp", - "critic", - "crop", - "cross", - "crouch", - "crowd", - "crucial", - "cruel", - "cruise", - "crumble", - "crunch", - "crush", - "cry", - "crystal", - "cube", - "culture", - "cup", - "cupboard", - "curious", - "current", - "curtain", - "curve", - "cushion", - "custom", - "cute", - "cycle", - "dad", - "damage", - "damp", - "dance", - "danger", - "daring", - "dash", - "daughter", - "dawn", - "day", - "deal", - "debate", - "debris", - "decade", - "december", - "decide", - "decline", - "decorate", - "decrease", - "deer", - "defense", - "define", - "defy", - "degree", - "delay", - "deliver", - "demand", - "demise", - "denial", - "dentist", - "deny", - "depart", - "depend", - "deposit", - "depth", - "deputy", - "derive", - "describe", - "desert", - "design", - "desk", - "despair", - "destroy", - "detail", - "detect", - "develop", - "device", - "devote", - "diagram", - "dial", - "diamond", - "diary", - "dice", - "diesel", - "diet", - "differ", - "digital", - "dignity", - "dilemma", - "dinner", - "dinosaur", - "direct", - "dirt", - "disagree", - "discover", - "disease", - "dish", - "dismiss", - "disorder", - "display", - "distance", - "divert", - "divide", - "divorce", - "dizzy", - "doctor", - "document", - "dog", - "doll", - "dolphin", - "domain", - "donate", - "donkey", - "donor", - "door", - "dose", - "double", - "dove", - "draft", - "dragon", - "drama", - "drastic", - "draw", - "dream", - "dress", - "drift", - "drill", - "drink", - "drip", - "drive", - "drop", - "drum", - "dry", - "duck", - "dumb", - "dune", - "during", - "dust", - "dutch", - "duty", - "dwarf", - "dynamic", - "eager", - "eagle", - "early", - "earn", - "earth", - "easily", - "east", - "easy", - "echo", - "ecology", - "economy", - "edge", - "edit", - "educate", - "effort", - "egg", - "eight", - "either", - "elbow", - "elder", - "electric", - "elegant", - "element", - "elephant", - "elevator", - "elite", - "else", - "embark", - "embody", - "embrace", - "emerge", - "emotion", - "employ", - "empower", - "empty", - "enable", - "enact", - "end", - "endless", - "endorse", - "enemy", - "energy", - "enforce", - "engage", - "engine", - "enhance", - "enjoy", - "enlist", - "enough", - "enrich", - "enroll", - "ensure", - "enter", - "entire", - "entry", - "envelope", - "episode", - "equal", - "equip", - "era", - "erase", - "erode", - "erosion", - "error", - "erupt", - "escape", - "essay", - "essence", - "estate", - "eternal", - "ethics", - "evidence", - "evil", - "evoke", - "evolve", - "exact", - "example", - "excess", - "exchange", - "excite", - "exclude", - "excuse", - "execute", - "exercise", - "exhaust", - "exhibit", - "exile", - "exist", - "exit", - "exotic", - "expand", - "expect", - "expire", - "explain", - "expose", - "express", - "extend", - "extra", - "eye", - "eyebrow", - "fabric", - "face", - "faculty", - "fade", - "faint", - "faith", - "fall", - "false", - "fame", - "family", - "famous", - "fan", - "fancy", - "fantasy", - "farm", - "fashion", - "fat", - "fatal", - "father", - "fatigue", - "fault", - "favorite", - "feature", - "february", - "federal", - "fee", - "feed", - "feel", - "female", - "fence", - "festival", - "fetch", - "fever", - "few", - "fiber", - "fiction", - "field", - "figure", - "file", - "film", - "filter", - "final", - "find", - "fine", - "finger", - "finish", - "fire", - "firm", - "first", - "fiscal", - "fish", - "fit", - "fitness", - "fix", - "flag", - "flame", - "flash", - "flat", - "flavor", - "flee", - "flight", - "flip", - "float", - "flock", - "floor", - "flower", - "fluid", - "flush", - "fly", - "foam", - "focus", - "fog", - "foil", - "fold", - "follow", - "food", - "foot", - "force", - "forest", - "forget", - "fork", - "fortune", - "forum", - "forward", - "fossil", - "foster", - "found", - "fox", - "fragile", - "frame", - "frequent", - "fresh", - "friend", - "fringe", - "frog", - "front", - "frost", - "frown", - "frozen", - "fruit", - "fuel", - "fun", - "funny", - "furnace", - "fury", - "future", - "gadget", - "gain", - "galaxy", - "gallery", - "game", - "gap", - "garage", - "garbage", - "garden", - "garlic", - "garment", - "gas", - "gasp", - "gate", - "gather", - "gauge", - "gaze", - "general", - "genius", - "genre", - "gentle", - "genuine", - "gesture", - "ghost", - "giant", - "gift", - "giggle", - "ginger", - "giraffe", - "girl", - "give", - "glad", - "glance", - "glare", - "glass", - "glide", - "glimpse", - "globe", - "gloom", - "glory", - "glove", - "glow", - "glue", - "goat", - "goddess", - "gold", - "good", - "goose", - "gorilla", - "gospel", - "gossip", - "govern", - "gown", - "grab", - "grace", - "grain", - "grant", - "grape", - "grass", - "gravity", - "great", - "green", - "grid", - "grief", - "grit", - "grocery", - "group", - "grow", - "grunt", - "guard", - "guess", - "guide", - "guilt", - "guitar", - "gun", - "gym", - "habit", - "hair", - "half", - "hammer", - "hamster", - "hand", - "happy", - "harbor", - "hard", - "harsh", - "harvest", - "hat", - "have", - "hawk", - "hazard", - "head", - "health", - "heart", - "heavy", - "hedgehog", - "height", - "hello", - "helmet", - "help", - "hen", - "hero", - "hidden", - "high", - "hill", - "hint", - "hip", - "hire", - "history", - "hobby", - "hockey", - "hold", - "hole", - "holiday", - "hollow", - "home", - "honey", - "hood", - "hope", - "horn", - "horror", - "horse", - "hospital", - "host", - "hotel", - "hour", - "hover", - "hub", - "huge", - "human", - "humble", - "humor", - "hundred", - "hungry", - "hunt", - "hurdle", - "hurry", - "hurt", - "husband", - "hybrid", - "ice", - "icon", - "idea", - "identify", - "idle", - "ignore", - "ill", - "illegal", - "illness", - "image", - "imitate", - "immense", - "immune", - "impact", - "impose", - "improve", - "impulse", - "inch", - "include", - "income", - "increase", - "index", - "indicate", - "indoor", - "industry", - "infant", - "inflict", - "inform", - "inhale", - "inherit", - "initial", - "inject", - "injury", - "inmate", - "inner", - "innocent", - "input", - "inquiry", - "insane", - "insect", - "inside", - "inspire", - "install", - "intact", - "interest", - "into", - "invest", - "invite", - "involve", - "iron", - "island", - "isolate", - "issue", - "item", - "ivory", - "jacket", - "jaguar", - "jar", - "jazz", - "jealous", - "jeans", - "jelly", - "jewel", - "job", - "join", - "joke", - "journey", - "joy", - "judge", - "juice", - "jump", - "jungle", - "junior", - "junk", - "just", - "kangaroo", - "keen", - "keep", - "ketchup", - "key", - "kick", - "kid", - "kidney", - "kind", - "kingdom", - "kiss", - "kit", - "kitchen", - "kite", - "kitten", - "kiwi", - "knee", - "knife", - "knock", - "know", - "lab", - "label", - "labor", - "ladder", - "lady", - "lake", - "lamp", - "language", - "laptop", - "large", - "later", - "latin", - "laugh", - "laundry", - "lava", - "law", - "lawn", - "lawsuit", - "layer", - "lazy", - "leader", - "leaf", - "learn", - "leave", - "lecture", - "left", - "leg", - "legal", - "legend", - "leisure", - "lemon", - "lend", - "length", - "lens", - "leopard", - "lesson", - "letter", - "level", - "liar", - "liberty", - "library", - "license", - "life", - "lift", - "light", - "like", - "limb", - "limit", - "link", - "lion", - "liquid", - "list", - "little", - "live", - "lizard", - "load", - "loan", - "lobster", - "local", - "lock", - "logic", - "lonely", - "long", - "loop", - "lottery", - "loud", - "lounge", - "love", - "loyal", - "lucky", - "luggage", - "lumber", - "lunar", - "lunch", - "luxury", - "lyrics", - "machine", - "mad", - "magic", - "magnet", - "maid", - "mail", - "main", - "major", - "make", - "mammal", - "man", - "manage", - "mandate", - "mango", - "mansion", - "manual", - "maple", - "marble", - "march", - "margin", - "marine", - "market", - "marriage", - "mask", - "mass", - "master", - "match", - "material", - "math", - "matrix", - "matter", - "maximum", - "maze", - "meadow", - "mean", - "measure", - "meat", - "mechanic", - "medal", - "media", - "melody", - "melt", - "member", - "memory", - "mention", - "menu", - "mercy", - "merge", - "merit", - "merry", - "mesh", - "message", - "metal", - "method", - "middle", - "midnight", - "milk", - "million", - "mimic", - "mind", - "minimum", - "minor", - "minute", - "miracle", - "mirror", - "misery", - "miss", - "mistake", - "mix", - "mixed", - "mixture", - "mobile", - "model", - "modify", - "mom", - "moment", - "monitor", - "monkey", - "monster", - "month", - "moon", - "moral", - "more", - "morning", - "mosquito", - "mother", - "motion", - "motor", - "mountain", - "mouse", - "move", - "movie", - "much", - "muffin", - "mule", - "multiply", - "muscle", - "museum", - "mushroom", - "music", - "must", - "mutual", - "myself", - "mystery", - "myth", - "naive", - "name", - "napkin", - "narrow", - "nasty", - "nation", - "nature", - "near", - "neck", - "need", - "negative", - "neglect", - "neither", - "nephew", - "nerve", - "nest", - "net", - "network", - "neutral", - "never", - "news", - "next", - "nice", - "night", - "noble", - "noise", - "nominee", - "noodle", - "normal", - "north", - "nose", - "notable", - "note", - "nothing", - "notice", - "novel", - "now", - "nuclear", - "number", - "nurse", - "nut", - "oak", - "obey", - "object", - "oblige", - "obscure", - "observe", - "obtain", - "obvious", - "occur", - "ocean", - "october", - "odor", - "off", - "offer", - "office", - "often", - "oil", - "okay", - "old", - "olive", - "olympic", - "omit", - "once", - "one", - "onion", - "online", - "only", - "open", - "opera", - "opinion", - "oppose", - "option", - "orange", - "orbit", - "orchard", - "order", - "ordinary", - "organ", - "orient", - "original", - "orphan", - "ostrich", - "other", - "outdoor", - "outer", - "output", - "outside", - "oval", - "oven", - "over", - "own", - "owner", - "oxygen", - "oyster", - "ozone", - "pact", - "paddle", - "page", - "pair", - "palace", - "palm", - "panda", - "panel", - "panic", - "panther", - "paper", - "parade", - "parent", - "park", - "parrot", - "party", - "pass", - "patch", - "path", - "patient", - "patrol", - "pattern", - "pause", - "pave", - "payment", - "peace", - "peanut", - "pear", - "peasant", - "pelican", - "pen", - "penalty", - "pencil", - "people", - "pepper", - "perfect", - "permit", - "person", - "pet", - "phone", - "photo", - "phrase", - "physical", - "piano", - "picnic", - "picture", - "piece", - "pig", - "pigeon", - "pill", - "pilot", - "pink", - "pioneer", - "pipe", - "pistol", - "pitch", - "pizza", - "place", - "planet", - "plastic", - "plate", - "play", - "please", - "pledge", - "pluck", - "plug", - "plunge", - "poem", - "poet", - "point", - "polar", - "pole", - "police", - "pond", - "pony", - "pool", - "popular", - "portion", - "position", - "possible", - "post", - "potato", - "pottery", - "poverty", - "powder", - "power", - "practice", - "praise", - "predict", - "prefer", - "prepare", - "present", - "pretty", - "prevent", - "price", - "pride", - "primary", - "print", - "priority", - "prison", - "private", - "prize", - "problem", - "process", - "produce", - "profit", - "program", - "project", - "promote", - "proof", - "property", - "prosper", - "protect", - "proud", - "provide", - "public", - "pudding", - "pull", - "pulp", - "pulse", - "pumpkin", - "punch", - "pupil", - "puppy", - "purchase", - "purity", - "purpose", - "purse", - "push", - "put", - "puzzle", - "pyramid", - "quality", - "quantum", - "quarter", - "question", - "quick", - "quit", - "quiz", - "quote", - "rabbit", - "raccoon", - "race", - "rack", - "radar", - "radio", - "rail", - "rain", - "raise", - "rally", - "ramp", - "ranch", - "random", - "range", - "rapid", - "rare", - "rate", - "rather", - "raven", - "raw", - "razor", - "ready", - "real", - "reason", - "rebel", - "rebuild", - "recall", - "receive", - "recipe", - "record", - "recycle", - "reduce", - "reflect", - "reform", - "refuse", - "region", - "regret", - "regular", - "reject", - "relax", - "release", - "relief", - "rely", - "remain", - "remember", - "remind", - "remove", - "render", - "renew", - "rent", - "reopen", - "repair", - "repeat", - "replace", - "report", - "require", - "rescue", - "resemble", - "resist", - "resource", - "response", - "result", - "retire", - "retreat", - "return", - "reunion", - "reveal", - "review", - "reward", - "rhythm", - "rib", - "ribbon", - "rice", - "rich", - "ride", - "ridge", - "rifle", - "right", - "rigid", - "ring", - "riot", - "ripple", - "risk", - "ritual", - "rival", - "river", - "road", - "roast", - "robot", - "robust", - "rocket", - "romance", - "roof", - "rookie", - "room", - "rose", - "rotate", - "rough", - "round", - "route", - "royal", - "rubber", - "rude", - "rug", - "rule", - "run", - "runway", - "rural", - "sad", - "saddle", - "sadness", - "safe", - "sail", - "salad", - "salmon", - "salon", - "salt", - "salute", - "same", - "sample", - "sand", - "satisfy", - "satoshi", - "sauce", - "sausage", - "save", - "say", - "scale", - "scan", - "scare", - "scatter", - "scene", - "scheme", - "school", - "science", - "scissors", - "scorpion", - "scout", - "scrap", - "screen", - "script", - "scrub", - "sea", - "search", - "season", - "seat", - "second", - "secret", - "section", - "security", - "seed", - "seek", - "segment", - "select", - "sell", - "seminar", - "senior", - "sense", - "sentence", - "series", - "service", - "session", - "settle", - "setup", - "seven", - "shadow", - "shaft", - "shallow", - "share", - "shed", - "shell", - "sheriff", - "shield", - "shift", - "shine", - "ship", - "shiver", - "shock", - "shoe", - "shoot", - "shop", - "short", - "shoulder", - "shove", - "shrimp", - "shrug", - "shuffle", - "shy", - "sibling", - "sick", - "side", - "siege", - "sight", - "sign", - "silent", - "silk", - "silly", - "silver", - "similar", - "simple", - "since", - "sing", - "siren", - "sister", - "situate", - "six", - "size", - "skate", - "sketch", - "ski", - "skill", - "skin", - "skirt", - "skull", - "slab", - "slam", - "sleep", - "slender", - "slice", - "slide", - "slight", - "slim", - "slogan", - "slot", - "slow", - "slush", - "small", - "smart", - "smile", - "smoke", - "smooth", - "snack", - "snake", - "snap", - "sniff", - "snow", - "soap", - "soccer", - "social", - "sock", - "soda", - "soft", - "solar", - "soldier", - "solid", - "solution", - "solve", - "someone", - "song", - "soon", - "sorry", - "sort", - "soul", - "sound", - "soup", - "source", - "south", - "space", - "spare", - "spatial", - "spawn", - "speak", - "special", - "speed", - "spell", - "spend", - "sphere", - "spice", - "spider", - "spike", - "spin", - "spirit", - "split", - "spoil", - "sponsor", - "spoon", - "sport", - "spot", - "spray", - "spread", - "spring", - "spy", - "square", - "squeeze", - "squirrel", - "stable", - "stadium", - "staff", - "stage", - "stairs", - "stamp", - "stand", - "start", - "state", - "stay", - "steak", - "steel", - "stem", - "step", - "stereo", - "stick", - "still", - "sting", - "stock", - "stomach", - "stone", - "stool", - "story", - "stove", - "strategy", - "street", - "strike", - "strong", - "struggle", - "student", - "stuff", - "stumble", - "style", - "subject", - "submit", - "subway", - "success", - "such", - "sudden", - "suffer", - "sugar", - "suggest", - "suit", - "summer", - "sun", - "sunny", - "sunset", - "super", - "supply", - "supreme", - "sure", - "surface", - "surge", - "surprise", - "surround", - "survey", - "suspect", - "sustain", - "swallow", - "swamp", - "swap", - "swarm", - "swear", - "sweet", - "swift", - "swim", - "swing", - "switch", - "sword", - "symbol", - "symptom", - "syrup", - "system", - "table", - "tackle", - "tag", - "tail", - "talent", - "talk", - "tank", - "tape", - "target", - "task", - "taste", - "tattoo", - "taxi", - "teach", - "team", - "tell", - "ten", - "tenant", - "tennis", - "tent", - "term", - "test", - "text", - "thank", - "that", - "theme", - "then", - "theory", - "there", - "they", - "thing", - "this", - "thought", - "three", - "thrive", - "throw", - "thumb", - "thunder", - "ticket", - "tide", - "tiger", - "tilt", - "timber", - "time", - "tiny", - "tip", - "tired", - "tissue", - "title", - "toast", - "tobacco", - "today", - "toddler", - "toe", - "together", - "toilet", - "token", - "tomato", - "tomorrow", - "tone", - "tongue", - "tonight", - "tool", - "tooth", - "top", - "topic", - "topple", - "torch", - "tornado", - "tortoise", - "toss", - "total", - "tourist", - "toward", - "tower", - "town", - "toy", - "track", - "trade", - "traffic", - "tragic", - "train", - "transfer", - "trap", - "trash", - "travel", - "tray", - "treat", - "tree", - "trend", - "trial", - "tribe", - "trick", - "trigger", - "trim", - "trip", - "trophy", - "trouble", - "truck", - "true", - "truly", - "trumpet", - "trust", - "truth", - "try", - "tube", - "tuition", - "tumble", - "tuna", - "tunnel", - "turkey", - "turn", - "turtle", - "twelve", - "twenty", - "twice", - "twin", - "twist", - "two", - "type", - "typical", - "ugly", - "umbrella", - "unable", - "unaware", - "uncle", - "uncover", - "under", - "undo", - "unfair", - "unfold", - "unhappy", - "uniform", - "unique", - "unit", - "universe", - "unknown", - "unlock", - "until", - "unusual", - "unveil", - "update", - "upgrade", - "uphold", - "upon", - "upper", - "upset", - "urban", - "urge", - "usage", - "use", - "used", - "useful", - "useless", - "usual", - "utility", - "vacant", - "vacuum", - "vague", - "valid", - "valley", - "valve", - "van", - "vanish", - "vapor", - "various", - "vast", - "vault", - "vehicle", - "velvet", - "vendor", - "venture", - "venue", - "verb", - "verify", - "version", - "very", - "vessel", - "veteran", - "viable", - "vibrant", - "vicious", - "victory", - "video", - "view", - "village", - "vintage", - "violin", - "virtual", - "virus", - "visa", - "visit", - "visual", - "vital", - "vivid", - "vocal", - "voice", - "void", - "volcano", - "volume", - "vote", - "voyage", - "wage", - "wagon", - "wait", - "walk", - "wall", - "walnut", - "want", - "warfare", - "warm", - "warrior", - "wash", - "wasp", - "waste", - "water", - "wave", - "way", - "wealth", - "weapon", - "wear", - "weasel", - "weather", - "web", - "wedding", - "weekend", - "weird", - "welcome", - "west", - "wet", - "whale", - "what", - "wheat", - "wheel", - "when", - "where", - "whip", - "whisper", - "wide", - "width", - "wife", - "wild", - "will", - "win", - "window", - "wine", - "wing", - "wink", - "winner", - "winter", - "wire", - "wisdom", - "wise", - "wish", - "witness", - "wolf", - "woman", - "wonder", - "wood", - "wool", - "word", - "work", - "world", - "worry", - "worth", - "wrap", - "wreck", - "wrestle", - "wrist", - "write", - "wrong", - "yard", - "year", - "yellow", - "you", - "young", - "youth", - "zebra", - "zero", - "zone", - "zoo" -] diff --git a/tools/mnemonic-test/node_modules/bip39/src/wordlists/french.json b/tools/mnemonic-test/node_modules/bip39/src/wordlists/french.json deleted file mode 100644 index edbcdef7..00000000 --- a/tools/mnemonic-test/node_modules/bip39/src/wordlists/french.json +++ /dev/null @@ -1,2050 +0,0 @@ -[ - "abaisser", - "abandon", - "abdiquer", - "abeille", - "abolir", - "aborder", - "aboutir", - "aboyer", - "abrasif", - "abreuver", - "abriter", - "abroger", - "abrupt", - "absence", - "absolu", - "absurde", - "abusif", - "abyssal", - "académie", - "acajou", - "acarien", - "accabler", - "accepter", - "acclamer", - "accolade", - "accroche", - "accuser", - "acerbe", - "achat", - "acheter", - "aciduler", - "acier", - "acompte", - "acquérir", - "acronyme", - "acteur", - "actif", - "actuel", - "adepte", - "adéquat", - "adhésif", - "adjectif", - "adjuger", - "admettre", - "admirer", - "adopter", - "adorer", - "adoucir", - "adresse", - "adroit", - "adulte", - "adverbe", - "aérer", - "aéronef", - "affaire", - "affecter", - "affiche", - "affreux", - "affubler", - "agacer", - "agencer", - "agile", - "agiter", - "agrafer", - "agréable", - "agrume", - "aider", - "aiguille", - "ailier", - "aimable", - "aisance", - "ajouter", - "ajuster", - "alarmer", - "alchimie", - "alerte", - "algèbre", - "algue", - "aliéner", - "aliment", - "alléger", - "alliage", - "allouer", - "allumer", - "alourdir", - "alpaga", - "altesse", - "alvéole", - "amateur", - "ambigu", - "ambre", - "aménager", - "amertume", - "amidon", - "amiral", - "amorcer", - "amour", - "amovible", - "amphibie", - "ampleur", - "amusant", - "analyse", - "anaphore", - "anarchie", - "anatomie", - "ancien", - "anéantir", - "angle", - "angoisse", - "anguleux", - "animal", - "annexer", - "annonce", - "annuel", - "anodin", - "anomalie", - "anonyme", - "anormal", - "antenne", - "antidote", - "anxieux", - "apaiser", - "apéritif", - "aplanir", - "apologie", - "appareil", - "appeler", - "apporter", - "appuyer", - "aquarium", - "aqueduc", - "arbitre", - "arbuste", - "ardeur", - "ardoise", - "argent", - "arlequin", - "armature", - "armement", - "armoire", - "armure", - "arpenter", - "arracher", - "arriver", - "arroser", - "arsenic", - "artériel", - "article", - "aspect", - "asphalte", - "aspirer", - "assaut", - "asservir", - "assiette", - "associer", - "assurer", - "asticot", - "astre", - "astuce", - "atelier", - "atome", - "atrium", - "atroce", - "attaque", - "attentif", - "attirer", - "attraper", - "aubaine", - "auberge", - "audace", - "audible", - "augurer", - "aurore", - "automne", - "autruche", - "avaler", - "avancer", - "avarice", - "avenir", - "averse", - "aveugle", - "aviateur", - "avide", - "avion", - "aviser", - "avoine", - "avouer", - "avril", - "axial", - "axiome", - "badge", - "bafouer", - "bagage", - "baguette", - "baignade", - "balancer", - "balcon", - "baleine", - "balisage", - "bambin", - "bancaire", - "bandage", - "banlieue", - "bannière", - "banquier", - "barbier", - "baril", - "baron", - "barque", - "barrage", - "bassin", - "bastion", - "bataille", - "bateau", - "batterie", - "baudrier", - "bavarder", - "belette", - "bélier", - "belote", - "bénéfice", - "berceau", - "berger", - "berline", - "bermuda", - "besace", - "besogne", - "bétail", - "beurre", - "biberon", - "bicycle", - "bidule", - "bijou", - "bilan", - "bilingue", - "billard", - "binaire", - "biologie", - "biopsie", - "biotype", - "biscuit", - "bison", - "bistouri", - "bitume", - "bizarre", - "blafard", - "blague", - "blanchir", - "blessant", - "blinder", - "blond", - "bloquer", - "blouson", - "bobard", - "bobine", - "boire", - "boiser", - "bolide", - "bonbon", - "bondir", - "bonheur", - "bonifier", - "bonus", - "bordure", - "borne", - "botte", - "boucle", - "boueux", - "bougie", - "boulon", - "bouquin", - "bourse", - "boussole", - "boutique", - "boxeur", - "branche", - "brasier", - "brave", - "brebis", - "brèche", - "breuvage", - "bricoler", - "brigade", - "brillant", - "brioche", - "brique", - "brochure", - "broder", - "bronzer", - "brousse", - "broyeur", - "brume", - "brusque", - "brutal", - "bruyant", - "buffle", - "buisson", - "bulletin", - "bureau", - "burin", - "bustier", - "butiner", - "butoir", - "buvable", - "buvette", - "cabanon", - "cabine", - "cachette", - "cadeau", - "cadre", - "caféine", - "caillou", - "caisson", - "calculer", - "calepin", - "calibre", - "calmer", - "calomnie", - "calvaire", - "camarade", - "caméra", - "camion", - "campagne", - "canal", - "caneton", - "canon", - "cantine", - "canular", - "capable", - "caporal", - "caprice", - "capsule", - "capter", - "capuche", - "carabine", - "carbone", - "caresser", - "caribou", - "carnage", - "carotte", - "carreau", - "carton", - "cascade", - "casier", - "casque", - "cassure", - "causer", - "caution", - "cavalier", - "caverne", - "caviar", - "cédille", - "ceinture", - "céleste", - "cellule", - "cendrier", - "censurer", - "central", - "cercle", - "cérébral", - "cerise", - "cerner", - "cerveau", - "cesser", - "chagrin", - "chaise", - "chaleur", - "chambre", - "chance", - "chapitre", - "charbon", - "chasseur", - "chaton", - "chausson", - "chavirer", - "chemise", - "chenille", - "chéquier", - "chercher", - "cheval", - "chien", - "chiffre", - "chignon", - "chimère", - "chiot", - "chlorure", - "chocolat", - "choisir", - "chose", - "chouette", - "chrome", - "chute", - "cigare", - "cigogne", - "cimenter", - "cinéma", - "cintrer", - "circuler", - "cirer", - "cirque", - "citerne", - "citoyen", - "citron", - "civil", - "clairon", - "clameur", - "claquer", - "classe", - "clavier", - "client", - "cligner", - "climat", - "clivage", - "cloche", - "clonage", - "cloporte", - "cobalt", - "cobra", - "cocasse", - "cocotier", - "coder", - "codifier", - "coffre", - "cogner", - "cohésion", - "coiffer", - "coincer", - "colère", - "colibri", - "colline", - "colmater", - "colonel", - "combat", - "comédie", - "commande", - "compact", - "concert", - "conduire", - "confier", - "congeler", - "connoter", - "consonne", - "contact", - "convexe", - "copain", - "copie", - "corail", - "corbeau", - "cordage", - "corniche", - "corpus", - "correct", - "cortège", - "cosmique", - "costume", - "coton", - "coude", - "coupure", - "courage", - "couteau", - "couvrir", - "coyote", - "crabe", - "crainte", - "cravate", - "crayon", - "créature", - "créditer", - "crémeux", - "creuser", - "crevette", - "cribler", - "crier", - "cristal", - "critère", - "croire", - "croquer", - "crotale", - "crucial", - "cruel", - "crypter", - "cubique", - "cueillir", - "cuillère", - "cuisine", - "cuivre", - "culminer", - "cultiver", - "cumuler", - "cupide", - "curatif", - "curseur", - "cyanure", - "cycle", - "cylindre", - "cynique", - "daigner", - "damier", - "danger", - "danseur", - "dauphin", - "débattre", - "débiter", - "déborder", - "débrider", - "débutant", - "décaler", - "décembre", - "déchirer", - "décider", - "déclarer", - "décorer", - "décrire", - "décupler", - "dédale", - "déductif", - "déesse", - "défensif", - "défiler", - "défrayer", - "dégager", - "dégivrer", - "déglutir", - "dégrafer", - "déjeuner", - "délice", - "déloger", - "demander", - "demeurer", - "démolir", - "dénicher", - "dénouer", - "dentelle", - "dénuder", - "départ", - "dépenser", - "déphaser", - "déplacer", - "déposer", - "déranger", - "dérober", - "désastre", - "descente", - "désert", - "désigner", - "désobéir", - "dessiner", - "destrier", - "détacher", - "détester", - "détourer", - "détresse", - "devancer", - "devenir", - "deviner", - "devoir", - "diable", - "dialogue", - "diamant", - "dicter", - "différer", - "digérer", - "digital", - "digne", - "diluer", - "dimanche", - "diminuer", - "dioxyde", - "directif", - "diriger", - "discuter", - "disposer", - "dissiper", - "distance", - "divertir", - "diviser", - "docile", - "docteur", - "dogme", - "doigt", - "domaine", - "domicile", - "dompter", - "donateur", - "donjon", - "donner", - "dopamine", - "dortoir", - "dorure", - "dosage", - "doseur", - "dossier", - "dotation", - "douanier", - "double", - "douceur", - "douter", - "doyen", - "dragon", - "draper", - "dresser", - "dribbler", - "droiture", - "duperie", - "duplexe", - "durable", - "durcir", - "dynastie", - "éblouir", - "écarter", - "écharpe", - "échelle", - "éclairer", - "éclipse", - "éclore", - "écluse", - "école", - "économie", - "écorce", - "écouter", - "écraser", - "écrémer", - "écrivain", - "écrou", - "écume", - "écureuil", - "édifier", - "éduquer", - "effacer", - "effectif", - "effigie", - "effort", - "effrayer", - "effusion", - "égaliser", - "égarer", - "éjecter", - "élaborer", - "élargir", - "électron", - "élégant", - "éléphant", - "élève", - "éligible", - "élitisme", - "éloge", - "élucider", - "éluder", - "emballer", - "embellir", - "embryon", - "émeraude", - "émission", - "emmener", - "émotion", - "émouvoir", - "empereur", - "employer", - "emporter", - "emprise", - "émulsion", - "encadrer", - "enchère", - "enclave", - "encoche", - "endiguer", - "endosser", - "endroit", - "enduire", - "énergie", - "enfance", - "enfermer", - "enfouir", - "engager", - "engin", - "englober", - "énigme", - "enjamber", - "enjeu", - "enlever", - "ennemi", - "ennuyeux", - "enrichir", - "enrobage", - "enseigne", - "entasser", - "entendre", - "entier", - "entourer", - "entraver", - "énumérer", - "envahir", - "enviable", - "envoyer", - "enzyme", - "éolien", - "épaissir", - "épargne", - "épatant", - "épaule", - "épicerie", - "épidémie", - "épier", - "épilogue", - "épine", - "épisode", - "épitaphe", - "époque", - "épreuve", - "éprouver", - "épuisant", - "équerre", - "équipe", - "ériger", - "érosion", - "erreur", - "éruption", - "escalier", - "espadon", - "espèce", - "espiègle", - "espoir", - "esprit", - "esquiver", - "essayer", - "essence", - "essieu", - "essorer", - "estime", - "estomac", - "estrade", - "étagère", - "étaler", - "étanche", - "étatique", - "éteindre", - "étendoir", - "éternel", - "éthanol", - "éthique", - "ethnie", - "étirer", - "étoffer", - "étoile", - "étonnant", - "étourdir", - "étrange", - "étroit", - "étude", - "euphorie", - "évaluer", - "évasion", - "éventail", - "évidence", - "éviter", - "évolutif", - "évoquer", - "exact", - "exagérer", - "exaucer", - "exceller", - "excitant", - "exclusif", - "excuse", - "exécuter", - "exemple", - "exercer", - "exhaler", - "exhorter", - "exigence", - "exiler", - "exister", - "exotique", - "expédier", - "explorer", - "exposer", - "exprimer", - "exquis", - "extensif", - "extraire", - "exulter", - "fable", - "fabuleux", - "facette", - "facile", - "facture", - "faiblir", - "falaise", - "fameux", - "famille", - "farceur", - "farfelu", - "farine", - "farouche", - "fasciner", - "fatal", - "fatigue", - "faucon", - "fautif", - "faveur", - "favori", - "fébrile", - "féconder", - "fédérer", - "félin", - "femme", - "fémur", - "fendoir", - "féodal", - "fermer", - "féroce", - "ferveur", - "festival", - "feuille", - "feutre", - "février", - "fiasco", - "ficeler", - "fictif", - "fidèle", - "figure", - "filature", - "filetage", - "filière", - "filleul", - "filmer", - "filou", - "filtrer", - "financer", - "finir", - "fiole", - "firme", - "fissure", - "fixer", - "flairer", - "flamme", - "flasque", - "flatteur", - "fléau", - "flèche", - "fleur", - "flexion", - "flocon", - "flore", - "fluctuer", - "fluide", - "fluvial", - "folie", - "fonderie", - "fongible", - "fontaine", - "forcer", - "forgeron", - "formuler", - "fortune", - "fossile", - "foudre", - "fougère", - "fouiller", - "foulure", - "fourmi", - "fragile", - "fraise", - "franchir", - "frapper", - "frayeur", - "frégate", - "freiner", - "frelon", - "frémir", - "frénésie", - "frère", - "friable", - "friction", - "frisson", - "frivole", - "froid", - "fromage", - "frontal", - "frotter", - "fruit", - "fugitif", - "fuite", - "fureur", - "furieux", - "furtif", - "fusion", - "futur", - "gagner", - "galaxie", - "galerie", - "gambader", - "garantir", - "gardien", - "garnir", - "garrigue", - "gazelle", - "gazon", - "géant", - "gélatine", - "gélule", - "gendarme", - "général", - "génie", - "genou", - "gentil", - "géologie", - "géomètre", - "géranium", - "germe", - "gestuel", - "geyser", - "gibier", - "gicler", - "girafe", - "givre", - "glace", - "glaive", - "glisser", - "globe", - "gloire", - "glorieux", - "golfeur", - "gomme", - "gonfler", - "gorge", - "gorille", - "goudron", - "gouffre", - "goulot", - "goupille", - "gourmand", - "goutte", - "graduel", - "graffiti", - "graine", - "grand", - "grappin", - "gratuit", - "gravir", - "grenat", - "griffure", - "griller", - "grimper", - "grogner", - "gronder", - "grotte", - "groupe", - "gruger", - "grutier", - "gruyère", - "guépard", - "guerrier", - "guide", - "guimauve", - "guitare", - "gustatif", - "gymnaste", - "gyrostat", - "habitude", - "hachoir", - "halte", - "hameau", - "hangar", - "hanneton", - "haricot", - "harmonie", - "harpon", - "hasard", - "hélium", - "hématome", - "herbe", - "hérisson", - "hermine", - "héron", - "hésiter", - "heureux", - "hiberner", - "hibou", - "hilarant", - "histoire", - "hiver", - "homard", - "hommage", - "homogène", - "honneur", - "honorer", - "honteux", - "horde", - "horizon", - "horloge", - "hormone", - "horrible", - "houleux", - "housse", - "hublot", - "huileux", - "humain", - "humble", - "humide", - "humour", - "hurler", - "hydromel", - "hygiène", - "hymne", - "hypnose", - "idylle", - "ignorer", - "iguane", - "illicite", - "illusion", - "image", - "imbiber", - "imiter", - "immense", - "immobile", - "immuable", - "impact", - "impérial", - "implorer", - "imposer", - "imprimer", - "imputer", - "incarner", - "incendie", - "incident", - "incliner", - "incolore", - "indexer", - "indice", - "inductif", - "inédit", - "ineptie", - "inexact", - "infini", - "infliger", - "informer", - "infusion", - "ingérer", - "inhaler", - "inhiber", - "injecter", - "injure", - "innocent", - "inoculer", - "inonder", - "inscrire", - "insecte", - "insigne", - "insolite", - "inspirer", - "instinct", - "insulter", - "intact", - "intense", - "intime", - "intrigue", - "intuitif", - "inutile", - "invasion", - "inventer", - "inviter", - "invoquer", - "ironique", - "irradier", - "irréel", - "irriter", - "isoler", - "ivoire", - "ivresse", - "jaguar", - "jaillir", - "jambe", - "janvier", - "jardin", - "jauger", - "jaune", - "javelot", - "jetable", - "jeton", - "jeudi", - "jeunesse", - "joindre", - "joncher", - "jongler", - "joueur", - "jouissif", - "journal", - "jovial", - "joyau", - "joyeux", - "jubiler", - "jugement", - "junior", - "jupon", - "juriste", - "justice", - "juteux", - "juvénile", - "kayak", - "kimono", - "kiosque", - "label", - "labial", - "labourer", - "lacérer", - "lactose", - "lagune", - "laine", - "laisser", - "laitier", - "lambeau", - "lamelle", - "lampe", - "lanceur", - "langage", - "lanterne", - "lapin", - "largeur", - "larme", - "laurier", - "lavabo", - "lavoir", - "lecture", - "légal", - "léger", - "légume", - "lessive", - "lettre", - "levier", - "lexique", - "lézard", - "liasse", - "libérer", - "libre", - "licence", - "licorne", - "liège", - "lièvre", - "ligature", - "ligoter", - "ligue", - "limer", - "limite", - "limonade", - "limpide", - "linéaire", - "lingot", - "lionceau", - "liquide", - "lisière", - "lister", - "lithium", - "litige", - "littoral", - "livreur", - "logique", - "lointain", - "loisir", - "lombric", - "loterie", - "louer", - "lourd", - "loutre", - "louve", - "loyal", - "lubie", - "lucide", - "lucratif", - "lueur", - "lugubre", - "luisant", - "lumière", - "lunaire", - "lundi", - "luron", - "lutter", - "luxueux", - "machine", - "magasin", - "magenta", - "magique", - "maigre", - "maillon", - "maintien", - "mairie", - "maison", - "majorer", - "malaxer", - "maléfice", - "malheur", - "malice", - "mallette", - "mammouth", - "mandater", - "maniable", - "manquant", - "manteau", - "manuel", - "marathon", - "marbre", - "marchand", - "mardi", - "maritime", - "marqueur", - "marron", - "marteler", - "mascotte", - "massif", - "matériel", - "matière", - "matraque", - "maudire", - "maussade", - "mauve", - "maximal", - "méchant", - "méconnu", - "médaille", - "médecin", - "méditer", - "méduse", - "meilleur", - "mélange", - "mélodie", - "membre", - "mémoire", - "menacer", - "mener", - "menhir", - "mensonge", - "mentor", - "mercredi", - "mérite", - "merle", - "messager", - "mesure", - "métal", - "météore", - "méthode", - "métier", - "meuble", - "miauler", - "microbe", - "miette", - "mignon", - "migrer", - "milieu", - "million", - "mimique", - "mince", - "minéral", - "minimal", - "minorer", - "minute", - "miracle", - "miroiter", - "missile", - "mixte", - "mobile", - "moderne", - "moelleux", - "mondial", - "moniteur", - "monnaie", - "monotone", - "monstre", - "montagne", - "monument", - "moqueur", - "morceau", - "morsure", - "mortier", - "moteur", - "motif", - "mouche", - "moufle", - "moulin", - "mousson", - "mouton", - "mouvant", - "multiple", - "munition", - "muraille", - "murène", - "murmure", - "muscle", - "muséum", - "musicien", - "mutation", - "muter", - "mutuel", - "myriade", - "myrtille", - "mystère", - "mythique", - "nageur", - "nappe", - "narquois", - "narrer", - "natation", - "nation", - "nature", - "naufrage", - "nautique", - "navire", - "nébuleux", - "nectar", - "néfaste", - "négation", - "négliger", - "négocier", - "neige", - "nerveux", - "nettoyer", - "neurone", - "neutron", - "neveu", - "niche", - "nickel", - "nitrate", - "niveau", - "noble", - "nocif", - "nocturne", - "noirceur", - "noisette", - "nomade", - "nombreux", - "nommer", - "normatif", - "notable", - "notifier", - "notoire", - "nourrir", - "nouveau", - "novateur", - "novembre", - "novice", - "nuage", - "nuancer", - "nuire", - "nuisible", - "numéro", - "nuptial", - "nuque", - "nutritif", - "obéir", - "objectif", - "obliger", - "obscur", - "observer", - "obstacle", - "obtenir", - "obturer", - "occasion", - "occuper", - "océan", - "octobre", - "octroyer", - "octupler", - "oculaire", - "odeur", - "odorant", - "offenser", - "officier", - "offrir", - "ogive", - "oiseau", - "oisillon", - "olfactif", - "olivier", - "ombrage", - "omettre", - "onctueux", - "onduler", - "onéreux", - "onirique", - "opale", - "opaque", - "opérer", - "opinion", - "opportun", - "opprimer", - "opter", - "optique", - "orageux", - "orange", - "orbite", - "ordonner", - "oreille", - "organe", - "orgueil", - "orifice", - "ornement", - "orque", - "ortie", - "osciller", - "osmose", - "ossature", - "otarie", - "ouragan", - "ourson", - "outil", - "outrager", - "ouvrage", - "ovation", - "oxyde", - "oxygène", - "ozone", - "paisible", - "palace", - "palmarès", - "palourde", - "palper", - "panache", - "panda", - "pangolin", - "paniquer", - "panneau", - "panorama", - "pantalon", - "papaye", - "papier", - "papoter", - "papyrus", - "paradoxe", - "parcelle", - "paresse", - "parfumer", - "parler", - "parole", - "parrain", - "parsemer", - "partager", - "parure", - "parvenir", - "passion", - "pastèque", - "paternel", - "patience", - "patron", - "pavillon", - "pavoiser", - "payer", - "paysage", - "peigne", - "peintre", - "pelage", - "pélican", - "pelle", - "pelouse", - "peluche", - "pendule", - "pénétrer", - "pénible", - "pensif", - "pénurie", - "pépite", - "péplum", - "perdrix", - "perforer", - "période", - "permuter", - "perplexe", - "persil", - "perte", - "peser", - "pétale", - "petit", - "pétrir", - "peuple", - "pharaon", - "phobie", - "phoque", - "photon", - "phrase", - "physique", - "piano", - "pictural", - "pièce", - "pierre", - "pieuvre", - "pilote", - "pinceau", - "pipette", - "piquer", - "pirogue", - "piscine", - "piston", - "pivoter", - "pixel", - "pizza", - "placard", - "plafond", - "plaisir", - "planer", - "plaque", - "plastron", - "plateau", - "pleurer", - "plexus", - "pliage", - "plomb", - "plonger", - "pluie", - "plumage", - "pochette", - "poésie", - "poète", - "pointe", - "poirier", - "poisson", - "poivre", - "polaire", - "policier", - "pollen", - "polygone", - "pommade", - "pompier", - "ponctuel", - "pondérer", - "poney", - "portique", - "position", - "posséder", - "posture", - "potager", - "poteau", - "potion", - "pouce", - "poulain", - "poumon", - "pourpre", - "poussin", - "pouvoir", - "prairie", - "pratique", - "précieux", - "prédire", - "préfixe", - "prélude", - "prénom", - "présence", - "prétexte", - "prévoir", - "primitif", - "prince", - "prison", - "priver", - "problème", - "procéder", - "prodige", - "profond", - "progrès", - "proie", - "projeter", - "prologue", - "promener", - "propre", - "prospère", - "protéger", - "prouesse", - "proverbe", - "prudence", - "pruneau", - "psychose", - "public", - "puceron", - "puiser", - "pulpe", - "pulsar", - "punaise", - "punitif", - "pupitre", - "purifier", - "puzzle", - "pyramide", - "quasar", - "querelle", - "question", - "quiétude", - "quitter", - "quotient", - "racine", - "raconter", - "radieux", - "ragondin", - "raideur", - "raisin", - "ralentir", - "rallonge", - "ramasser", - "rapide", - "rasage", - "ratisser", - "ravager", - "ravin", - "rayonner", - "réactif", - "réagir", - "réaliser", - "réanimer", - "recevoir", - "réciter", - "réclamer", - "récolter", - "recruter", - "reculer", - "recycler", - "rédiger", - "redouter", - "refaire", - "réflexe", - "réformer", - "refrain", - "refuge", - "régalien", - "région", - "réglage", - "régulier", - "réitérer", - "rejeter", - "rejouer", - "relatif", - "relever", - "relief", - "remarque", - "remède", - "remise", - "remonter", - "remplir", - "remuer", - "renard", - "renfort", - "renifler", - "renoncer", - "rentrer", - "renvoi", - "replier", - "reporter", - "reprise", - "reptile", - "requin", - "réserve", - "résineux", - "résoudre", - "respect", - "rester", - "résultat", - "rétablir", - "retenir", - "réticule", - "retomber", - "retracer", - "réunion", - "réussir", - "revanche", - "revivre", - "révolte", - "révulsif", - "richesse", - "rideau", - "rieur", - "rigide", - "rigoler", - "rincer", - "riposter", - "risible", - "risque", - "rituel", - "rival", - "rivière", - "rocheux", - "romance", - "rompre", - "ronce", - "rondin", - "roseau", - "rosier", - "rotatif", - "rotor", - "rotule", - "rouge", - "rouille", - "rouleau", - "routine", - "royaume", - "ruban", - "rubis", - "ruche", - "ruelle", - "rugueux", - "ruiner", - "ruisseau", - "ruser", - "rustique", - "rythme", - "sabler", - "saboter", - "sabre", - "sacoche", - "safari", - "sagesse", - "saisir", - "salade", - "salive", - "salon", - "saluer", - "samedi", - "sanction", - "sanglier", - "sarcasme", - "sardine", - "saturer", - "saugrenu", - "saumon", - "sauter", - "sauvage", - "savant", - "savonner", - "scalpel", - "scandale", - "scélérat", - "scénario", - "sceptre", - "schéma", - "science", - "scinder", - "score", - "scrutin", - "sculpter", - "séance", - "sécable", - "sécher", - "secouer", - "sécréter", - "sédatif", - "séduire", - "seigneur", - "séjour", - "sélectif", - "semaine", - "sembler", - "semence", - "séminal", - "sénateur", - "sensible", - "sentence", - "séparer", - "séquence", - "serein", - "sergent", - "sérieux", - "serrure", - "sérum", - "service", - "sésame", - "sévir", - "sevrage", - "sextuple", - "sidéral", - "siècle", - "siéger", - "siffler", - "sigle", - "signal", - "silence", - "silicium", - "simple", - "sincère", - "sinistre", - "siphon", - "sirop", - "sismique", - "situer", - "skier", - "social", - "socle", - "sodium", - "soigneux", - "soldat", - "soleil", - "solitude", - "soluble", - "sombre", - "sommeil", - "somnoler", - "sonde", - "songeur", - "sonnette", - "sonore", - "sorcier", - "sortir", - "sosie", - "sottise", - "soucieux", - "soudure", - "souffle", - "soulever", - "soupape", - "source", - "soutirer", - "souvenir", - "spacieux", - "spatial", - "spécial", - "sphère", - "spiral", - "stable", - "station", - "sternum", - "stimulus", - "stipuler", - "strict", - "studieux", - "stupeur", - "styliste", - "sublime", - "substrat", - "subtil", - "subvenir", - "succès", - "sucre", - "suffixe", - "suggérer", - "suiveur", - "sulfate", - "superbe", - "supplier", - "surface", - "suricate", - "surmener", - "surprise", - "sursaut", - "survie", - "suspect", - "syllabe", - "symbole", - "symétrie", - "synapse", - "syntaxe", - "système", - "tabac", - "tablier", - "tactile", - "tailler", - "talent", - "talisman", - "talonner", - "tambour", - "tamiser", - "tangible", - "tapis", - "taquiner", - "tarder", - "tarif", - "tartine", - "tasse", - "tatami", - "tatouage", - "taupe", - "taureau", - "taxer", - "témoin", - "temporel", - "tenaille", - "tendre", - "teneur", - "tenir", - "tension", - "terminer", - "terne", - "terrible", - "tétine", - "texte", - "thème", - "théorie", - "thérapie", - "thorax", - "tibia", - "tiède", - "timide", - "tirelire", - "tiroir", - "tissu", - "titane", - "titre", - "tituber", - "toboggan", - "tolérant", - "tomate", - "tonique", - "tonneau", - "toponyme", - "torche", - "tordre", - "tornade", - "torpille", - "torrent", - "torse", - "tortue", - "totem", - "toucher", - "tournage", - "tousser", - "toxine", - "traction", - "trafic", - "tragique", - "trahir", - "train", - "trancher", - "travail", - "trèfle", - "tremper", - "trésor", - "treuil", - "triage", - "tribunal", - "tricoter", - "trilogie", - "triomphe", - "tripler", - "triturer", - "trivial", - "trombone", - "tronc", - "tropical", - "troupeau", - "tuile", - "tulipe", - "tumulte", - "tunnel", - "turbine", - "tuteur", - "tutoyer", - "tuyau", - "tympan", - "typhon", - "typique", - "tyran", - "ubuesque", - "ultime", - "ultrason", - "unanime", - "unifier", - "union", - "unique", - "unitaire", - "univers", - "uranium", - "urbain", - "urticant", - "usage", - "usine", - "usuel", - "usure", - "utile", - "utopie", - "vacarme", - "vaccin", - "vagabond", - "vague", - "vaillant", - "vaincre", - "vaisseau", - "valable", - "valise", - "vallon", - "valve", - "vampire", - "vanille", - "vapeur", - "varier", - "vaseux", - "vassal", - "vaste", - "vecteur", - "vedette", - "végétal", - "véhicule", - "veinard", - "véloce", - "vendredi", - "vénérer", - "venger", - "venimeux", - "ventouse", - "verdure", - "vérin", - "vernir", - "verrou", - "verser", - "vertu", - "veston", - "vétéran", - "vétuste", - "vexant", - "vexer", - "viaduc", - "viande", - "victoire", - "vidange", - "vidéo", - "vignette", - "vigueur", - "vilain", - "village", - "vinaigre", - "violon", - "vipère", - "virement", - "virtuose", - "virus", - "visage", - "viseur", - "vision", - "visqueux", - "visuel", - "vital", - "vitesse", - "viticole", - "vitrine", - "vivace", - "vivipare", - "vocation", - "voguer", - "voile", - "voisin", - "voiture", - "volaille", - "volcan", - "voltiger", - "volume", - "vorace", - "vortex", - "voter", - "vouloir", - "voyage", - "voyelle", - "wagon", - "xénon", - "yacht", - "zèbre", - "zénith", - "zeste", - "zoologie" -] diff --git a/tools/mnemonic-test/node_modules/bip39/src/wordlists/italian.json b/tools/mnemonic-test/node_modules/bip39/src/wordlists/italian.json deleted file mode 100644 index 4dfae417..00000000 --- a/tools/mnemonic-test/node_modules/bip39/src/wordlists/italian.json +++ /dev/null @@ -1,2050 +0,0 @@ -[ - "abaco", - "abbaglio", - "abbinato", - "abete", - "abisso", - "abolire", - "abrasivo", - "abrogato", - "accadere", - "accenno", - "accusato", - "acetone", - "achille", - "acido", - "acqua", - "acre", - "acrilico", - "acrobata", - "acuto", - "adagio", - "addebito", - "addome", - "adeguato", - "aderire", - "adipe", - "adottare", - "adulare", - "affabile", - "affetto", - "affisso", - "affranto", - "aforisma", - "afoso", - "africano", - "agave", - "agente", - "agevole", - "aggancio", - "agire", - "agitare", - "agonismo", - "agricolo", - "agrumeto", - "aguzzo", - "alabarda", - "alato", - "albatro", - "alberato", - "albo", - "albume", - "alce", - "alcolico", - "alettone", - "alfa", - "algebra", - "aliante", - "alibi", - "alimento", - "allagato", - "allegro", - "allievo", - "allodola", - "allusivo", - "almeno", - "alogeno", - "alpaca", - "alpestre", - "altalena", - "alterno", - "alticcio", - "altrove", - "alunno", - "alveolo", - "alzare", - "amalgama", - "amanita", - "amarena", - "ambito", - "ambrato", - "ameba", - "america", - "ametista", - "amico", - "ammasso", - "ammenda", - "ammirare", - "ammonito", - "amore", - "ampio", - "ampliare", - "amuleto", - "anacardo", - "anagrafe", - "analista", - "anarchia", - "anatra", - "anca", - "ancella", - "ancora", - "andare", - "andrea", - "anello", - "angelo", - "angolare", - "angusto", - "anima", - "annegare", - "annidato", - "anno", - "annuncio", - "anonimo", - "anticipo", - "anzi", - "apatico", - "apertura", - "apode", - "apparire", - "appetito", - "appoggio", - "approdo", - "appunto", - "aprile", - "arabica", - "arachide", - "aragosta", - "araldica", - "arancio", - "aratura", - "arazzo", - "arbitro", - "archivio", - "ardito", - "arenile", - "argento", - "argine", - "arguto", - "aria", - "armonia", - "arnese", - "arredato", - "arringa", - "arrosto", - "arsenico", - "arso", - "artefice", - "arzillo", - "asciutto", - "ascolto", - "asepsi", - "asettico", - "asfalto", - "asino", - "asola", - "aspirato", - "aspro", - "assaggio", - "asse", - "assoluto", - "assurdo", - "asta", - "astenuto", - "astice", - "astratto", - "atavico", - "ateismo", - "atomico", - "atono", - "attesa", - "attivare", - "attorno", - "attrito", - "attuale", - "ausilio", - "austria", - "autista", - "autonomo", - "autunno", - "avanzato", - "avere", - "avvenire", - "avviso", - "avvolgere", - "azione", - "azoto", - "azzimo", - "azzurro", - "babele", - "baccano", - "bacino", - "baco", - "badessa", - "badilata", - "bagnato", - "baita", - "balcone", - "baldo", - "balena", - "ballata", - "balzano", - "bambino", - "bandire", - "baraonda", - "barbaro", - "barca", - "baritono", - "barlume", - "barocco", - "basilico", - "basso", - "batosta", - "battuto", - "baule", - "bava", - "bavosa", - "becco", - "beffa", - "belgio", - "belva", - "benda", - "benevole", - "benigno", - "benzina", - "bere", - "berlina", - "beta", - "bibita", - "bici", - "bidone", - "bifido", - "biga", - "bilancia", - "bimbo", - "binocolo", - "biologo", - "bipede", - "bipolare", - "birbante", - "birra", - "biscotto", - "bisesto", - "bisnonno", - "bisonte", - "bisturi", - "bizzarro", - "blando", - "blatta", - "bollito", - "bonifico", - "bordo", - "bosco", - "botanico", - "bottino", - "bozzolo", - "braccio", - "bradipo", - "brama", - "branca", - "bravura", - "bretella", - "brevetto", - "brezza", - "briglia", - "brillante", - "brindare", - "broccolo", - "brodo", - "bronzina", - "brullo", - "bruno", - "bubbone", - "buca", - "budino", - "buffone", - "buio", - "bulbo", - "buono", - "burlone", - "burrasca", - "bussola", - "busta", - "cadetto", - "caduco", - "calamaro", - "calcolo", - "calesse", - "calibro", - "calmo", - "caloria", - "cambusa", - "camerata", - "camicia", - "cammino", - "camola", - "campale", - "canapa", - "candela", - "cane", - "canino", - "canotto", - "cantina", - "capace", - "capello", - "capitolo", - "capogiro", - "cappero", - "capra", - "capsula", - "carapace", - "carcassa", - "cardo", - "carisma", - "carovana", - "carretto", - "cartolina", - "casaccio", - "cascata", - "caserma", - "caso", - "cassone", - "castello", - "casuale", - "catasta", - "catena", - "catrame", - "cauto", - "cavillo", - "cedibile", - "cedrata", - "cefalo", - "celebre", - "cellulare", - "cena", - "cenone", - "centesimo", - "ceramica", - "cercare", - "certo", - "cerume", - "cervello", - "cesoia", - "cespo", - "ceto", - "chela", - "chiaro", - "chicca", - "chiedere", - "chimera", - "china", - "chirurgo", - "chitarra", - "ciao", - "ciclismo", - "cifrare", - "cigno", - "cilindro", - "ciottolo", - "circa", - "cirrosi", - "citrico", - "cittadino", - "ciuffo", - "civetta", - "civile", - "classico", - "clinica", - "cloro", - "cocco", - "codardo", - "codice", - "coerente", - "cognome", - "collare", - "colmato", - "colore", - "colposo", - "coltivato", - "colza", - "coma", - "cometa", - "commando", - "comodo", - "computer", - "comune", - "conciso", - "condurre", - "conferma", - "congelare", - "coniuge", - "connesso", - "conoscere", - "consumo", - "continuo", - "convegno", - "coperto", - "copione", - "coppia", - "copricapo", - "corazza", - "cordata", - "coricato", - "cornice", - "corolla", - "corpo", - "corredo", - "corsia", - "cortese", - "cosmico", - "costante", - "cottura", - "covato", - "cratere", - "cravatta", - "creato", - "credere", - "cremoso", - "crescita", - "creta", - "criceto", - "crinale", - "crisi", - "critico", - "croce", - "cronaca", - "crostata", - "cruciale", - "crusca", - "cucire", - "cuculo", - "cugino", - "cullato", - "cupola", - "curatore", - "cursore", - "curvo", - "cuscino", - "custode", - "dado", - "daino", - "dalmata", - "damerino", - "daniela", - "dannoso", - "danzare", - "datato", - "davanti", - "davvero", - "debutto", - "decennio", - "deciso", - "declino", - "decollo", - "decreto", - "dedicato", - "definito", - "deforme", - "degno", - "delegare", - "delfino", - "delirio", - "delta", - "demenza", - "denotato", - "dentro", - "deposito", - "derapata", - "derivare", - "deroga", - "descritto", - "deserto", - "desiderio", - "desumere", - "detersivo", - "devoto", - "diametro", - "dicembre", - "diedro", - "difeso", - "diffuso", - "digerire", - "digitale", - "diluvio", - "dinamico", - "dinnanzi", - "dipinto", - "diploma", - "dipolo", - "diradare", - "dire", - "dirotto", - "dirupo", - "disagio", - "discreto", - "disfare", - "disgelo", - "disposto", - "distanza", - "disumano", - "dito", - "divano", - "divelto", - "dividere", - "divorato", - "doblone", - "docente", - "doganale", - "dogma", - "dolce", - "domato", - "domenica", - "dominare", - "dondolo", - "dono", - "dormire", - "dote", - "dottore", - "dovuto", - "dozzina", - "drago", - "druido", - "dubbio", - "dubitare", - "ducale", - "duna", - "duomo", - "duplice", - "duraturo", - "ebano", - "eccesso", - "ecco", - "eclissi", - "economia", - "edera", - "edicola", - "edile", - "editoria", - "educare", - "egemonia", - "egli", - "egoismo", - "egregio", - "elaborato", - "elargire", - "elegante", - "elencato", - "eletto", - "elevare", - "elfico", - "elica", - "elmo", - "elsa", - "eluso", - "emanato", - "emblema", - "emesso", - "emiro", - "emotivo", - "emozione", - "empirico", - "emulo", - "endemico", - "enduro", - "energia", - "enfasi", - "enoteca", - "entrare", - "enzima", - "epatite", - "epilogo", - "episodio", - "epocale", - "eppure", - "equatore", - "erario", - "erba", - "erboso", - "erede", - "eremita", - "erigere", - "ermetico", - "eroe", - "erosivo", - "errante", - "esagono", - "esame", - "esanime", - "esaudire", - "esca", - "esempio", - "esercito", - "esibito", - "esigente", - "esistere", - "esito", - "esofago", - "esortato", - "esoso", - "espanso", - "espresso", - "essenza", - "esso", - "esteso", - "estimare", - "estonia", - "estroso", - "esultare", - "etilico", - "etnico", - "etrusco", - "etto", - "euclideo", - "europa", - "evaso", - "evidenza", - "evitato", - "evoluto", - "evviva", - "fabbrica", - "faccenda", - "fachiro", - "falco", - "famiglia", - "fanale", - "fanfara", - "fango", - "fantasma", - "fare", - "farfalla", - "farinoso", - "farmaco", - "fascia", - "fastoso", - "fasullo", - "faticare", - "fato", - "favoloso", - "febbre", - "fecola", - "fede", - "fegato", - "felpa", - "feltro", - "femmina", - "fendere", - "fenomeno", - "fermento", - "ferro", - "fertile", - "fessura", - "festivo", - "fetta", - "feudo", - "fiaba", - "fiducia", - "fifa", - "figurato", - "filo", - "finanza", - "finestra", - "finire", - "fiore", - "fiscale", - "fisico", - "fiume", - "flacone", - "flamenco", - "flebo", - "flemma", - "florido", - "fluente", - "fluoro", - "fobico", - "focaccia", - "focoso", - "foderato", - "foglio", - "folata", - "folclore", - "folgore", - "fondente", - "fonetico", - "fonia", - "fontana", - "forbito", - "forchetta", - "foresta", - "formica", - "fornaio", - "foro", - "fortezza", - "forzare", - "fosfato", - "fosso", - "fracasso", - "frana", - "frassino", - "fratello", - "freccetta", - "frenata", - "fresco", - "frigo", - "frollino", - "fronde", - "frugale", - "frutta", - "fucilata", - "fucsia", - "fuggente", - "fulmine", - "fulvo", - "fumante", - "fumetto", - "fumoso", - "fune", - "funzione", - "fuoco", - "furbo", - "furgone", - "furore", - "fuso", - "futile", - "gabbiano", - "gaffe", - "galateo", - "gallina", - "galoppo", - "gambero", - "gamma", - "garanzia", - "garbo", - "garofano", - "garzone", - "gasdotto", - "gasolio", - "gastrico", - "gatto", - "gaudio", - "gazebo", - "gazzella", - "geco", - "gelatina", - "gelso", - "gemello", - "gemmato", - "gene", - "genitore", - "gennaio", - "genotipo", - "gergo", - "ghepardo", - "ghiaccio", - "ghisa", - "giallo", - "gilda", - "ginepro", - "giocare", - "gioiello", - "giorno", - "giove", - "girato", - "girone", - "gittata", - "giudizio", - "giurato", - "giusto", - "globulo", - "glutine", - "gnomo", - "gobba", - "golf", - "gomito", - "gommone", - "gonfio", - "gonna", - "governo", - "gracile", - "grado", - "grafico", - "grammo", - "grande", - "grattare", - "gravoso", - "grazia", - "greca", - "gregge", - "grifone", - "grigio", - "grinza", - "grotta", - "gruppo", - "guadagno", - "guaio", - "guanto", - "guardare", - "gufo", - "guidare", - "ibernato", - "icona", - "identico", - "idillio", - "idolo", - "idra", - "idrico", - "idrogeno", - "igiene", - "ignaro", - "ignorato", - "ilare", - "illeso", - "illogico", - "illudere", - "imballo", - "imbevuto", - "imbocco", - "imbuto", - "immane", - "immerso", - "immolato", - "impacco", - "impeto", - "impiego", - "importo", - "impronta", - "inalare", - "inarcare", - "inattivo", - "incanto", - "incendio", - "inchino", - "incisivo", - "incluso", - "incontro", - "incrocio", - "incubo", - "indagine", - "india", - "indole", - "inedito", - "infatti", - "infilare", - "inflitto", - "ingaggio", - "ingegno", - "inglese", - "ingordo", - "ingrosso", - "innesco", - "inodore", - "inoltrare", - "inondato", - "insano", - "insetto", - "insieme", - "insonnia", - "insulina", - "intasato", - "intero", - "intonaco", - "intuito", - "inumidire", - "invalido", - "invece", - "invito", - "iperbole", - "ipnotico", - "ipotesi", - "ippica", - "iride", - "irlanda", - "ironico", - "irrigato", - "irrorare", - "isolato", - "isotopo", - "isterico", - "istituto", - "istrice", - "italia", - "iterare", - "labbro", - "labirinto", - "lacca", - "lacerato", - "lacrima", - "lacuna", - "laddove", - "lago", - "lampo", - "lancetta", - "lanterna", - "lardoso", - "larga", - "laringe", - "lastra", - "latenza", - "latino", - "lattuga", - "lavagna", - "lavoro", - "legale", - "leggero", - "lembo", - "lentezza", - "lenza", - "leone", - "lepre", - "lesivo", - "lessato", - "lesto", - "letterale", - "leva", - "levigato", - "libero", - "lido", - "lievito", - "lilla", - "limatura", - "limitare", - "limpido", - "lineare", - "lingua", - "liquido", - "lira", - "lirica", - "lisca", - "lite", - "litigio", - "livrea", - "locanda", - "lode", - "logica", - "lombare", - "londra", - "longevo", - "loquace", - "lorenzo", - "loto", - "lotteria", - "luce", - "lucidato", - "lumaca", - "luminoso", - "lungo", - "lupo", - "luppolo", - "lusinga", - "lusso", - "lutto", - "macabro", - "macchina", - "macero", - "macinato", - "madama", - "magico", - "maglia", - "magnete", - "magro", - "maiolica", - "malafede", - "malgrado", - "malinteso", - "malsano", - "malto", - "malumore", - "mana", - "mancia", - "mandorla", - "mangiare", - "manifesto", - "mannaro", - "manovra", - "mansarda", - "mantide", - "manubrio", - "mappa", - "maratona", - "marcire", - "maretta", - "marmo", - "marsupio", - "maschera", - "massaia", - "mastino", - "materasso", - "matricola", - "mattone", - "maturo", - "mazurca", - "meandro", - "meccanico", - "mecenate", - "medesimo", - "meditare", - "mega", - "melassa", - "melis", - "melodia", - "meninge", - "meno", - "mensola", - "mercurio", - "merenda", - "merlo", - "meschino", - "mese", - "messere", - "mestolo", - "metallo", - "metodo", - "mettere", - "miagolare", - "mica", - "micelio", - "michele", - "microbo", - "midollo", - "miele", - "migliore", - "milano", - "milite", - "mimosa", - "minerale", - "mini", - "minore", - "mirino", - "mirtillo", - "miscela", - "missiva", - "misto", - "misurare", - "mitezza", - "mitigare", - "mitra", - "mittente", - "mnemonico", - "modello", - "modifica", - "modulo", - "mogano", - "mogio", - "mole", - "molosso", - "monastero", - "monco", - "mondina", - "monetario", - "monile", - "monotono", - "monsone", - "montato", - "monviso", - "mora", - "mordere", - "morsicato", - "mostro", - "motivato", - "motosega", - "motto", - "movenza", - "movimento", - "mozzo", - "mucca", - "mucosa", - "muffa", - "mughetto", - "mugnaio", - "mulatto", - "mulinello", - "multiplo", - "mummia", - "munto", - "muovere", - "murale", - "musa", - "muscolo", - "musica", - "mutevole", - "muto", - "nababbo", - "nafta", - "nanometro", - "narciso", - "narice", - "narrato", - "nascere", - "nastrare", - "naturale", - "nautica", - "naviglio", - "nebulosa", - "necrosi", - "negativo", - "negozio", - "nemmeno", - "neofita", - "neretto", - "nervo", - "nessuno", - "nettuno", - "neutrale", - "neve", - "nevrotico", - "nicchia", - "ninfa", - "nitido", - "nobile", - "nocivo", - "nodo", - "nome", - "nomina", - "nordico", - "normale", - "norvegese", - "nostrano", - "notare", - "notizia", - "notturno", - "novella", - "nucleo", - "nulla", - "numero", - "nuovo", - "nutrire", - "nuvola", - "nuziale", - "oasi", - "obbedire", - "obbligo", - "obelisco", - "oblio", - "obolo", - "obsoleto", - "occasione", - "occhio", - "occidente", - "occorrere", - "occultare", - "ocra", - "oculato", - "odierno", - "odorare", - "offerta", - "offrire", - "offuscato", - "oggetto", - "oggi", - "ognuno", - "olandese", - "olfatto", - "oliato", - "oliva", - "ologramma", - "oltre", - "omaggio", - "ombelico", - "ombra", - "omega", - "omissione", - "ondoso", - "onere", - "onice", - "onnivoro", - "onorevole", - "onta", - "operato", - "opinione", - "opposto", - "oracolo", - "orafo", - "ordine", - "orecchino", - "orefice", - "orfano", - "organico", - "origine", - "orizzonte", - "orma", - "ormeggio", - "ornativo", - "orologio", - "orrendo", - "orribile", - "ortensia", - "ortica", - "orzata", - "orzo", - "osare", - "oscurare", - "osmosi", - "ospedale", - "ospite", - "ossa", - "ossidare", - "ostacolo", - "oste", - "otite", - "otre", - "ottagono", - "ottimo", - "ottobre", - "ovale", - "ovest", - "ovino", - "oviparo", - "ovocito", - "ovunque", - "ovviare", - "ozio", - "pacchetto", - "pace", - "pacifico", - "padella", - "padrone", - "paese", - "paga", - "pagina", - "palazzina", - "palesare", - "pallido", - "palo", - "palude", - "pandoro", - "pannello", - "paolo", - "paonazzo", - "paprica", - "parabola", - "parcella", - "parere", - "pargolo", - "pari", - "parlato", - "parola", - "partire", - "parvenza", - "parziale", - "passivo", - "pasticca", - "patacca", - "patologia", - "pattume", - "pavone", - "peccato", - "pedalare", - "pedonale", - "peggio", - "peloso", - "penare", - "pendice", - "penisola", - "pennuto", - "penombra", - "pensare", - "pentola", - "pepe", - "pepita", - "perbene", - "percorso", - "perdonato", - "perforare", - "pergamena", - "periodo", - "permesso", - "perno", - "perplesso", - "persuaso", - "pertugio", - "pervaso", - "pesatore", - "pesista", - "peso", - "pestifero", - "petalo", - "pettine", - "petulante", - "pezzo", - "piacere", - "pianta", - "piattino", - "piccino", - "picozza", - "piega", - "pietra", - "piffero", - "pigiama", - "pigolio", - "pigro", - "pila", - "pilifero", - "pillola", - "pilota", - "pimpante", - "pineta", - "pinna", - "pinolo", - "pioggia", - "piombo", - "piramide", - "piretico", - "pirite", - "pirolisi", - "pitone", - "pizzico", - "placebo", - "planare", - "plasma", - "platano", - "plenario", - "pochezza", - "poderoso", - "podismo", - "poesia", - "poggiare", - "polenta", - "poligono", - "pollice", - "polmonite", - "polpetta", - "polso", - "poltrona", - "polvere", - "pomice", - "pomodoro", - "ponte", - "popoloso", - "porfido", - "poroso", - "porpora", - "porre", - "portata", - "posa", - "positivo", - "possesso", - "postulato", - "potassio", - "potere", - "pranzo", - "prassi", - "pratica", - "precluso", - "predica", - "prefisso", - "pregiato", - "prelievo", - "premere", - "prenotare", - "preparato", - "presenza", - "pretesto", - "prevalso", - "prima", - "principe", - "privato", - "problema", - "procura", - "produrre", - "profumo", - "progetto", - "prolunga", - "promessa", - "pronome", - "proposta", - "proroga", - "proteso", - "prova", - "prudente", - "prugna", - "prurito", - "psiche", - "pubblico", - "pudica", - "pugilato", - "pugno", - "pulce", - "pulito", - "pulsante", - "puntare", - "pupazzo", - "pupilla", - "puro", - "quadro", - "qualcosa", - "quasi", - "querela", - "quota", - "raccolto", - "raddoppio", - "radicale", - "radunato", - "raffica", - "ragazzo", - "ragione", - "ragno", - "ramarro", - "ramingo", - "ramo", - "randagio", - "rantolare", - "rapato", - "rapina", - "rappreso", - "rasatura", - "raschiato", - "rasente", - "rassegna", - "rastrello", - "rata", - "ravveduto", - "reale", - "recepire", - "recinto", - "recluta", - "recondito", - "recupero", - "reddito", - "redimere", - "regalato", - "registro", - "regola", - "regresso", - "relazione", - "remare", - "remoto", - "renna", - "replica", - "reprimere", - "reputare", - "resa", - "residente", - "responso", - "restauro", - "rete", - "retina", - "retorica", - "rettifica", - "revocato", - "riassunto", - "ribadire", - "ribelle", - "ribrezzo", - "ricarica", - "ricco", - "ricevere", - "riciclato", - "ricordo", - "ricreduto", - "ridicolo", - "ridurre", - "rifasare", - "riflesso", - "riforma", - "rifugio", - "rigare", - "rigettato", - "righello", - "rilassato", - "rilevato", - "rimanere", - "rimbalzo", - "rimedio", - "rimorchio", - "rinascita", - "rincaro", - "rinforzo", - "rinnovo", - "rinomato", - "rinsavito", - "rintocco", - "rinuncia", - "rinvenire", - "riparato", - "ripetuto", - "ripieno", - "riportare", - "ripresa", - "ripulire", - "risata", - "rischio", - "riserva", - "risibile", - "riso", - "rispetto", - "ristoro", - "risultato", - "risvolto", - "ritardo", - "ritegno", - "ritmico", - "ritrovo", - "riunione", - "riva", - "riverso", - "rivincita", - "rivolto", - "rizoma", - "roba", - "robotico", - "robusto", - "roccia", - "roco", - "rodaggio", - "rodere", - "roditore", - "rogito", - "rollio", - "romantico", - "rompere", - "ronzio", - "rosolare", - "rospo", - "rotante", - "rotondo", - "rotula", - "rovescio", - "rubizzo", - "rubrica", - "ruga", - "rullino", - "rumine", - "rumoroso", - "ruolo", - "rupe", - "russare", - "rustico", - "sabato", - "sabbiare", - "sabotato", - "sagoma", - "salasso", - "saldatura", - "salgemma", - "salivare", - "salmone", - "salone", - "saltare", - "saluto", - "salvo", - "sapere", - "sapido", - "saporito", - "saraceno", - "sarcasmo", - "sarto", - "sassoso", - "satellite", - "satira", - "satollo", - "saturno", - "savana", - "savio", - "saziato", - "sbadiglio", - "sbalzo", - "sbancato", - "sbarra", - "sbattere", - "sbavare", - "sbendare", - "sbirciare", - "sbloccato", - "sbocciato", - "sbrinare", - "sbruffone", - "sbuffare", - "scabroso", - "scadenza", - "scala", - "scambiare", - "scandalo", - "scapola", - "scarso", - "scatenare", - "scavato", - "scelto", - "scenico", - "scettro", - "scheda", - "schiena", - "sciarpa", - "scienza", - "scindere", - "scippo", - "sciroppo", - "scivolo", - "sclerare", - "scodella", - "scolpito", - "scomparto", - "sconforto", - "scoprire", - "scorta", - "scossone", - "scozzese", - "scriba", - "scrollare", - "scrutinio", - "scuderia", - "scultore", - "scuola", - "scuro", - "scusare", - "sdebitare", - "sdoganare", - "seccatura", - "secondo", - "sedano", - "seggiola", - "segnalato", - "segregato", - "seguito", - "selciato", - "selettivo", - "sella", - "selvaggio", - "semaforo", - "sembrare", - "seme", - "seminato", - "sempre", - "senso", - "sentire", - "sepolto", - "sequenza", - "serata", - "serbato", - "sereno", - "serio", - "serpente", - "serraglio", - "servire", - "sestina", - "setola", - "settimana", - "sfacelo", - "sfaldare", - "sfamato", - "sfarzoso", - "sfaticato", - "sfera", - "sfida", - "sfilato", - "sfinge", - "sfocato", - "sfoderare", - "sfogo", - "sfoltire", - "sforzato", - "sfratto", - "sfruttato", - "sfuggito", - "sfumare", - "sfuso", - "sgabello", - "sgarbato", - "sgonfiare", - "sgorbio", - "sgrassato", - "sguardo", - "sibilo", - "siccome", - "sierra", - "sigla", - "signore", - "silenzio", - "sillaba", - "simbolo", - "simpatico", - "simulato", - "sinfonia", - "singolo", - "sinistro", - "sino", - "sintesi", - "sinusoide", - "sipario", - "sisma", - "sistole", - "situato", - "slitta", - "slogatura", - "sloveno", - "smarrito", - "smemorato", - "smentito", - "smeraldo", - "smilzo", - "smontare", - "smottato", - "smussato", - "snellire", - "snervato", - "snodo", - "sobbalzo", - "sobrio", - "soccorso", - "sociale", - "sodale", - "soffitto", - "sogno", - "soldato", - "solenne", - "solido", - "sollazzo", - "solo", - "solubile", - "solvente", - "somatico", - "somma", - "sonda", - "sonetto", - "sonnifero", - "sopire", - "soppeso", - "sopra", - "sorgere", - "sorpasso", - "sorriso", - "sorso", - "sorteggio", - "sorvolato", - "sospiro", - "sosta", - "sottile", - "spada", - "spalla", - "spargere", - "spatola", - "spavento", - "spazzola", - "specie", - "spedire", - "spegnere", - "spelatura", - "speranza", - "spessore", - "spettrale", - "spezzato", - "spia", - "spigoloso", - "spillato", - "spinoso", - "spirale", - "splendido", - "sportivo", - "sposo", - "spranga", - "sprecare", - "spronato", - "spruzzo", - "spuntino", - "squillo", - "sradicare", - "srotolato", - "stabile", - "stacco", - "staffa", - "stagnare", - "stampato", - "stantio", - "starnuto", - "stasera", - "statuto", - "stelo", - "steppa", - "sterzo", - "stiletto", - "stima", - "stirpe", - "stivale", - "stizzoso", - "stonato", - "storico", - "strappo", - "stregato", - "stridulo", - "strozzare", - "strutto", - "stuccare", - "stufo", - "stupendo", - "subentro", - "succoso", - "sudore", - "suggerito", - "sugo", - "sultano", - "suonare", - "superbo", - "supporto", - "surgelato", - "surrogato", - "sussurro", - "sutura", - "svagare", - "svedese", - "sveglio", - "svelare", - "svenuto", - "svezia", - "sviluppo", - "svista", - "svizzera", - "svolta", - "svuotare", - "tabacco", - "tabulato", - "tacciare", - "taciturno", - "tale", - "talismano", - "tampone", - "tannino", - "tara", - "tardivo", - "targato", - "tariffa", - "tarpare", - "tartaruga", - "tasto", - "tattico", - "taverna", - "tavolata", - "tazza", - "teca", - "tecnico", - "telefono", - "temerario", - "tempo", - "temuto", - "tendone", - "tenero", - "tensione", - "tentacolo", - "teorema", - "terme", - "terrazzo", - "terzetto", - "tesi", - "tesserato", - "testato", - "tetro", - "tettoia", - "tifare", - "tigella", - "timbro", - "tinto", - "tipico", - "tipografo", - "tiraggio", - "tiro", - "titanio", - "titolo", - "titubante", - "tizio", - "tizzone", - "toccare", - "tollerare", - "tolto", - "tombola", - "tomo", - "tonfo", - "tonsilla", - "topazio", - "topologia", - "toppa", - "torba", - "tornare", - "torrone", - "tortora", - "toscano", - "tossire", - "tostatura", - "totano", - "trabocco", - "trachea", - "trafila", - "tragedia", - "tralcio", - "tramonto", - "transito", - "trapano", - "trarre", - "trasloco", - "trattato", - "trave", - "treccia", - "tremolio", - "trespolo", - "tributo", - "tricheco", - "trifoglio", - "trillo", - "trincea", - "trio", - "tristezza", - "triturato", - "trivella", - "tromba", - "trono", - "troppo", - "trottola", - "trovare", - "truccato", - "tubatura", - "tuffato", - "tulipano", - "tumulto", - "tunisia", - "turbare", - "turchino", - "tuta", - "tutela", - "ubicato", - "uccello", - "uccisore", - "udire", - "uditivo", - "uffa", - "ufficio", - "uguale", - "ulisse", - "ultimato", - "umano", - "umile", - "umorismo", - "uncinetto", - "ungere", - "ungherese", - "unicorno", - "unificato", - "unisono", - "unitario", - "unte", - "uovo", - "upupa", - "uragano", - "urgenza", - "urlo", - "usanza", - "usato", - "uscito", - "usignolo", - "usuraio", - "utensile", - "utilizzo", - "utopia", - "vacante", - "vaccinato", - "vagabondo", - "vagliato", - "valanga", - "valgo", - "valico", - "valletta", - "valoroso", - "valutare", - "valvola", - "vampata", - "vangare", - "vanitoso", - "vano", - "vantaggio", - "vanvera", - "vapore", - "varano", - "varcato", - "variante", - "vasca", - "vedetta", - "vedova", - "veduto", - "vegetale", - "veicolo", - "velcro", - "velina", - "velluto", - "veloce", - "venato", - "vendemmia", - "vento", - "verace", - "verbale", - "vergogna", - "verifica", - "vero", - "verruca", - "verticale", - "vescica", - "vessillo", - "vestale", - "veterano", - "vetrina", - "vetusto", - "viandante", - "vibrante", - "vicenda", - "vichingo", - "vicinanza", - "vidimare", - "vigilia", - "vigneto", - "vigore", - "vile", - "villano", - "vimini", - "vincitore", - "viola", - "vipera", - "virgola", - "virologo", - "virulento", - "viscoso", - "visione", - "vispo", - "vissuto", - "visura", - "vita", - "vitello", - "vittima", - "vivanda", - "vivido", - "viziare", - "voce", - "voga", - "volatile", - "volere", - "volpe", - "voragine", - "vulcano", - "zampogna", - "zanna", - "zappato", - "zattera", - "zavorra", - "zefiro", - "zelante", - "zelo", - "zenzero", - "zerbino", - "zibetto", - "zinco", - "zircone", - "zitto", - "zolla", - "zotico", - "zucchero", - "zufolo", - "zulu", - "zuppa" -] diff --git a/tools/mnemonic-test/node_modules/bip39/src/wordlists/japanese.json b/tools/mnemonic-test/node_modules/bip39/src/wordlists/japanese.json deleted file mode 100644 index 59659fbc..00000000 --- a/tools/mnemonic-test/node_modules/bip39/src/wordlists/japanese.json +++ /dev/null @@ -1,2050 +0,0 @@ -[ - "あいこくしん", - "あいさつ", - "あいだ", - "あおぞら", - "あかちゃん", - "あきる", - "あけがた", - "あける", - "あこがれる", - "あさい", - "あさひ", - "あしあと", - "あじわう", - "あずかる", - "あずき", - "あそぶ", - "あたえる", - "あたためる", - "あたりまえ", - "あたる", - "あつい", - "あつかう", - "あっしゅく", - "あつまり", - "あつめる", - "あてな", - "あてはまる", - "あひる", - "あぶら", - "あぶる", - "あふれる", - "あまい", - "あまど", - "あまやかす", - "あまり", - "あみもの", - "あめりか", - "あやまる", - "あゆむ", - "あらいぐま", - "あらし", - "あらすじ", - "あらためる", - "あらゆる", - "あらわす", - "ありがとう", - "あわせる", - "あわてる", - "あんい", - "あんがい", - "あんこ", - "あんぜん", - "あんてい", - "あんない", - "あんまり", - "いいだす", - "いおん", - "いがい", - "いがく", - "いきおい", - "いきなり", - "いきもの", - "いきる", - "いくじ", - "いくぶん", - "いけばな", - "いけん", - "いこう", - "いこく", - "いこつ", - "いさましい", - "いさん", - "いしき", - "いじゅう", - "いじょう", - "いじわる", - "いずみ", - "いずれ", - "いせい", - "いせえび", - "いせかい", - "いせき", - "いぜん", - "いそうろう", - "いそがしい", - "いだい", - "いだく", - "いたずら", - "いたみ", - "いたりあ", - "いちおう", - "いちじ", - "いちど", - "いちば", - "いちぶ", - "いちりゅう", - "いつか", - "いっしゅん", - "いっせい", - "いっそう", - "いったん", - "いっち", - "いってい", - "いっぽう", - "いてざ", - "いてん", - "いどう", - "いとこ", - "いない", - "いなか", - "いねむり", - "いのち", - "いのる", - "いはつ", - "いばる", - "いはん", - "いびき", - "いひん", - "いふく", - "いへん", - "いほう", - "いみん", - "いもうと", - "いもたれ", - "いもり", - "いやがる", - "いやす", - "いよかん", - "いよく", - "いらい", - "いらすと", - "いりぐち", - "いりょう", - "いれい", - "いれもの", - "いれる", - "いろえんぴつ", - "いわい", - "いわう", - "いわかん", - "いわば", - "いわゆる", - "いんげんまめ", - "いんさつ", - "いんしょう", - "いんよう", - "うえき", - "うえる", - "うおざ", - "うがい", - "うかぶ", - "うかべる", - "うきわ", - "うくらいな", - "うくれれ", - "うけたまわる", - "うけつけ", - "うけとる", - "うけもつ", - "うける", - "うごかす", - "うごく", - "うこん", - "うさぎ", - "うしなう", - "うしろがみ", - "うすい", - "うすぎ", - "うすぐらい", - "うすめる", - "うせつ", - "うちあわせ", - "うちがわ", - "うちき", - "うちゅう", - "うっかり", - "うつくしい", - "うったえる", - "うつる", - "うどん", - "うなぎ", - "うなじ", - "うなずく", - "うなる", - "うねる", - "うのう", - "うぶげ", - "うぶごえ", - "うまれる", - "うめる", - "うもう", - "うやまう", - "うよく", - "うらがえす", - "うらぐち", - "うらない", - "うりあげ", - "うりきれ", - "うるさい", - "うれしい", - "うれゆき", - "うれる", - "うろこ", - "うわき", - "うわさ", - "うんこう", - "うんちん", - "うんてん", - "うんどう", - "えいえん", - "えいが", - "えいきょう", - "えいご", - "えいせい", - "えいぶん", - "えいよう", - "えいわ", - "えおり", - "えがお", - "えがく", - "えきたい", - "えくせる", - "えしゃく", - "えすて", - "えつらん", - "えのぐ", - "えほうまき", - "えほん", - "えまき", - "えもじ", - "えもの", - "えらい", - "えらぶ", - "えりあ", - "えんえん", - "えんかい", - "えんぎ", - "えんげき", - "えんしゅう", - "えんぜつ", - "えんそく", - "えんちょう", - "えんとつ", - "おいかける", - "おいこす", - "おいしい", - "おいつく", - "おうえん", - "おうさま", - "おうじ", - "おうせつ", - "おうたい", - "おうふく", - "おうべい", - "おうよう", - "おえる", - "おおい", - "おおう", - "おおどおり", - "おおや", - "おおよそ", - "おかえり", - "おかず", - "おがむ", - "おかわり", - "おぎなう", - "おきる", - "おくさま", - "おくじょう", - "おくりがな", - "おくる", - "おくれる", - "おこす", - "おこなう", - "おこる", - "おさえる", - "おさない", - "おさめる", - "おしいれ", - "おしえる", - "おじぎ", - "おじさん", - "おしゃれ", - "おそらく", - "おそわる", - "おたがい", - "おたく", - "おだやか", - "おちつく", - "おっと", - "おつり", - "おでかけ", - "おとしもの", - "おとなしい", - "おどり", - "おどろかす", - "おばさん", - "おまいり", - "おめでとう", - "おもいで", - "おもう", - "おもたい", - "おもちゃ", - "おやつ", - "おやゆび", - "およぼす", - "おらんだ", - "おろす", - "おんがく", - "おんけい", - "おんしゃ", - "おんせん", - "おんだん", - "おんちゅう", - "おんどけい", - "かあつ", - "かいが", - "がいき", - "がいけん", - "がいこう", - "かいさつ", - "かいしゃ", - "かいすいよく", - "かいぜん", - "かいぞうど", - "かいつう", - "かいてん", - "かいとう", - "かいふく", - "がいへき", - "かいほう", - "かいよう", - "がいらい", - "かいわ", - "かえる", - "かおり", - "かかえる", - "かがく", - "かがし", - "かがみ", - "かくご", - "かくとく", - "かざる", - "がぞう", - "かたい", - "かたち", - "がちょう", - "がっきゅう", - "がっこう", - "がっさん", - "がっしょう", - "かなざわし", - "かのう", - "がはく", - "かぶか", - "かほう", - "かほご", - "かまう", - "かまぼこ", - "かめれおん", - "かゆい", - "かようび", - "からい", - "かるい", - "かろう", - "かわく", - "かわら", - "がんか", - "かんけい", - "かんこう", - "かんしゃ", - "かんそう", - "かんたん", - "かんち", - "がんばる", - "きあい", - "きあつ", - "きいろ", - "ぎいん", - "きうい", - "きうん", - "きえる", - "きおう", - "きおく", - "きおち", - "きおん", - "きかい", - "きかく", - "きかんしゃ", - "ききて", - "きくばり", - "きくらげ", - "きけんせい", - "きこう", - "きこえる", - "きこく", - "きさい", - "きさく", - "きさま", - "きさらぎ", - "ぎじかがく", - "ぎしき", - "ぎじたいけん", - "ぎじにってい", - "ぎじゅつしゃ", - "きすう", - "きせい", - "きせき", - "きせつ", - "きそう", - "きぞく", - "きぞん", - "きたえる", - "きちょう", - "きつえん", - "ぎっちり", - "きつつき", - "きつね", - "きてい", - "きどう", - "きどく", - "きない", - "きなが", - "きなこ", - "きぬごし", - "きねん", - "きのう", - "きのした", - "きはく", - "きびしい", - "きひん", - "きふく", - "きぶん", - "きぼう", - "きほん", - "きまる", - "きみつ", - "きむずかしい", - "きめる", - "きもだめし", - "きもち", - "きもの", - "きゃく", - "きやく", - "ぎゅうにく", - "きよう", - "きょうりゅう", - "きらい", - "きらく", - "きりん", - "きれい", - "きれつ", - "きろく", - "ぎろん", - "きわめる", - "ぎんいろ", - "きんかくじ", - "きんじょ", - "きんようび", - "ぐあい", - "くいず", - "くうかん", - "くうき", - "くうぐん", - "くうこう", - "ぐうせい", - "くうそう", - "ぐうたら", - "くうふく", - "くうぼ", - "くかん", - "くきょう", - "くげん", - "ぐこう", - "くさい", - "くさき", - "くさばな", - "くさる", - "くしゃみ", - "くしょう", - "くすのき", - "くすりゆび", - "くせげ", - "くせん", - "ぐたいてき", - "くださる", - "くたびれる", - "くちこみ", - "くちさき", - "くつした", - "ぐっすり", - "くつろぐ", - "くとうてん", - "くどく", - "くなん", - "くねくね", - "くのう", - "くふう", - "くみあわせ", - "くみたてる", - "くめる", - "くやくしょ", - "くらす", - "くらべる", - "くるま", - "くれる", - "くろう", - "くわしい", - "ぐんかん", - "ぐんしょく", - "ぐんたい", - "ぐんて", - "けあな", - "けいかく", - "けいけん", - "けいこ", - "けいさつ", - "げいじゅつ", - "けいたい", - "げいのうじん", - "けいれき", - "けいろ", - "けおとす", - "けおりもの", - "げきか", - "げきげん", - "げきだん", - "げきちん", - "げきとつ", - "げきは", - "げきやく", - "げこう", - "げこくじょう", - "げざい", - "けさき", - "げざん", - "けしき", - "けしごむ", - "けしょう", - "げすと", - "けたば", - "けちゃっぷ", - "けちらす", - "けつあつ", - "けつい", - "けつえき", - "けっこん", - "けつじょ", - "けっせき", - "けってい", - "けつまつ", - "げつようび", - "げつれい", - "けつろん", - "げどく", - "けとばす", - "けとる", - "けなげ", - "けなす", - "けなみ", - "けぬき", - "げねつ", - "けねん", - "けはい", - "げひん", - "けぶかい", - "げぼく", - "けまり", - "けみかる", - "けむし", - "けむり", - "けもの", - "けらい", - "けろけろ", - "けわしい", - "けんい", - "けんえつ", - "けんお", - "けんか", - "げんき", - "けんげん", - "けんこう", - "けんさく", - "けんしゅう", - "けんすう", - "げんそう", - "けんちく", - "けんてい", - "けんとう", - "けんない", - "けんにん", - "げんぶつ", - "けんま", - "けんみん", - "けんめい", - "けんらん", - "けんり", - "こあくま", - "こいぬ", - "こいびと", - "ごうい", - "こうえん", - "こうおん", - "こうかん", - "ごうきゅう", - "ごうけい", - "こうこう", - "こうさい", - "こうじ", - "こうすい", - "ごうせい", - "こうそく", - "こうたい", - "こうちゃ", - "こうつう", - "こうてい", - "こうどう", - "こうない", - "こうはい", - "ごうほう", - "ごうまん", - "こうもく", - "こうりつ", - "こえる", - "こおり", - "ごかい", - "ごがつ", - "ごかん", - "こくご", - "こくさい", - "こくとう", - "こくない", - "こくはく", - "こぐま", - "こけい", - "こける", - "ここのか", - "こころ", - "こさめ", - "こしつ", - "こすう", - "こせい", - "こせき", - "こぜん", - "こそだて", - "こたい", - "こたえる", - "こたつ", - "こちょう", - "こっか", - "こつこつ", - "こつばん", - "こつぶ", - "こてい", - "こてん", - "ことがら", - "ことし", - "ことば", - "ことり", - "こなごな", - "こねこね", - "このまま", - "このみ", - "このよ", - "ごはん", - "こひつじ", - "こふう", - "こふん", - "こぼれる", - "ごまあぶら", - "こまかい", - "ごますり", - "こまつな", - "こまる", - "こむぎこ", - "こもじ", - "こもち", - "こもの", - "こもん", - "こやく", - "こやま", - "こゆう", - "こゆび", - "こよい", - "こよう", - "こりる", - "これくしょん", - "ころっけ", - "こわもて", - "こわれる", - "こんいん", - "こんかい", - "こんき", - "こんしゅう", - "こんすい", - "こんだて", - "こんとん", - "こんなん", - "こんびに", - "こんぽん", - "こんまけ", - "こんや", - "こんれい", - "こんわく", - "ざいえき", - "さいかい", - "さいきん", - "ざいげん", - "ざいこ", - "さいしょ", - "さいせい", - "ざいたく", - "ざいちゅう", - "さいてき", - "ざいりょう", - "さうな", - "さかいし", - "さがす", - "さかな", - "さかみち", - "さがる", - "さぎょう", - "さくし", - "さくひん", - "さくら", - "さこく", - "さこつ", - "さずかる", - "ざせき", - "さたん", - "さつえい", - "ざつおん", - "ざっか", - "ざつがく", - "さっきょく", - "ざっし", - "さつじん", - "ざっそう", - "さつたば", - "さつまいも", - "さてい", - "さといも", - "さとう", - "さとおや", - "さとし", - "さとる", - "さのう", - "さばく", - "さびしい", - "さべつ", - "さほう", - "さほど", - "さます", - "さみしい", - "さみだれ", - "さむけ", - "さめる", - "さやえんどう", - "さゆう", - "さよう", - "さよく", - "さらだ", - "ざるそば", - "さわやか", - "さわる", - "さんいん", - "さんか", - "さんきゃく", - "さんこう", - "さんさい", - "ざんしょ", - "さんすう", - "さんせい", - "さんそ", - "さんち", - "さんま", - "さんみ", - "さんらん", - "しあい", - "しあげ", - "しあさって", - "しあわせ", - "しいく", - "しいん", - "しうち", - "しえい", - "しおけ", - "しかい", - "しかく", - "じかん", - "しごと", - "しすう", - "じだい", - "したうけ", - "したぎ", - "したて", - "したみ", - "しちょう", - "しちりん", - "しっかり", - "しつじ", - "しつもん", - "してい", - "してき", - "してつ", - "じてん", - "じどう", - "しなぎれ", - "しなもの", - "しなん", - "しねま", - "しねん", - "しのぐ", - "しのぶ", - "しはい", - "しばかり", - "しはつ", - "しはらい", - "しはん", - "しひょう", - "しふく", - "じぶん", - "しへい", - "しほう", - "しほん", - "しまう", - "しまる", - "しみん", - "しむける", - "じむしょ", - "しめい", - "しめる", - "しもん", - "しゃいん", - "しゃうん", - "しゃおん", - "じゃがいも", - "しやくしょ", - "しゃくほう", - "しゃけん", - "しゃこ", - "しゃざい", - "しゃしん", - "しゃせん", - "しゃそう", - "しゃたい", - "しゃちょう", - "しゃっきん", - "じゃま", - "しゃりん", - "しゃれい", - "じゆう", - "じゅうしょ", - "しゅくはく", - "じゅしん", - "しゅっせき", - "しゅみ", - "しゅらば", - "じゅんばん", - "しょうかい", - "しょくたく", - "しょっけん", - "しょどう", - "しょもつ", - "しらせる", - "しらべる", - "しんか", - "しんこう", - "じんじゃ", - "しんせいじ", - "しんちく", - "しんりん", - "すあげ", - "すあし", - "すあな", - "ずあん", - "すいえい", - "すいか", - "すいとう", - "ずいぶん", - "すいようび", - "すうがく", - "すうじつ", - "すうせん", - "すおどり", - "すきま", - "すくう", - "すくない", - "すける", - "すごい", - "すこし", - "ずさん", - "すずしい", - "すすむ", - "すすめる", - "すっかり", - "ずっしり", - "ずっと", - "すてき", - "すてる", - "すねる", - "すのこ", - "すはだ", - "すばらしい", - "ずひょう", - "ずぶぬれ", - "すぶり", - "すふれ", - "すべて", - "すべる", - "ずほう", - "すぼん", - "すまい", - "すめし", - "すもう", - "すやき", - "すらすら", - "するめ", - "すれちがう", - "すろっと", - "すわる", - "すんぜん", - "すんぽう", - "せあぶら", - "せいかつ", - "せいげん", - "せいじ", - "せいよう", - "せおう", - "せかいかん", - "せきにん", - "せきむ", - "せきゆ", - "せきらんうん", - "せけん", - "せこう", - "せすじ", - "せたい", - "せたけ", - "せっかく", - "せっきゃく", - "ぜっく", - "せっけん", - "せっこつ", - "せっさたくま", - "せつぞく", - "せつだん", - "せつでん", - "せっぱん", - "せつび", - "せつぶん", - "せつめい", - "せつりつ", - "せなか", - "せのび", - "せはば", - "せびろ", - "せぼね", - "せまい", - "せまる", - "せめる", - "せもたれ", - "せりふ", - "ぜんあく", - "せんい", - "せんえい", - "せんか", - "せんきょ", - "せんく", - "せんげん", - "ぜんご", - "せんさい", - "せんしゅ", - "せんすい", - "せんせい", - "せんぞ", - "せんたく", - "せんちょう", - "せんてい", - "せんとう", - "せんぬき", - "せんねん", - "せんぱい", - "ぜんぶ", - "ぜんぽう", - "せんむ", - "せんめんじょ", - "せんもん", - "せんやく", - "せんゆう", - "せんよう", - "ぜんら", - "ぜんりゃく", - "せんれい", - "せんろ", - "そあく", - "そいとげる", - "そいね", - "そうがんきょう", - "そうき", - "そうご", - "そうしん", - "そうだん", - "そうなん", - "そうび", - "そうめん", - "そうり", - "そえもの", - "そえん", - "そがい", - "そげき", - "そこう", - "そこそこ", - "そざい", - "そしな", - "そせい", - "そせん", - "そそぐ", - "そだてる", - "そつう", - "そつえん", - "そっかん", - "そつぎょう", - "そっけつ", - "そっこう", - "そっせん", - "そっと", - "そとがわ", - "そとづら", - "そなえる", - "そなた", - "そふぼ", - "そぼく", - "そぼろ", - "そまつ", - "そまる", - "そむく", - "そむりえ", - "そめる", - "そもそも", - "そよかぜ", - "そらまめ", - "そろう", - "そんかい", - "そんけい", - "そんざい", - "そんしつ", - "そんぞく", - "そんちょう", - "ぞんび", - "ぞんぶん", - "そんみん", - "たあい", - "たいいん", - "たいうん", - "たいえき", - "たいおう", - "だいがく", - "たいき", - "たいぐう", - "たいけん", - "たいこ", - "たいざい", - "だいじょうぶ", - "だいすき", - "たいせつ", - "たいそう", - "だいたい", - "たいちょう", - "たいてい", - "だいどころ", - "たいない", - "たいねつ", - "たいのう", - "たいはん", - "だいひょう", - "たいふう", - "たいへん", - "たいほ", - "たいまつばな", - "たいみんぐ", - "たいむ", - "たいめん", - "たいやき", - "たいよう", - "たいら", - "たいりょく", - "たいる", - "たいわん", - "たうえ", - "たえる", - "たおす", - "たおる", - "たおれる", - "たかい", - "たかね", - "たきび", - "たくさん", - "たこく", - "たこやき", - "たさい", - "たしざん", - "だじゃれ", - "たすける", - "たずさわる", - "たそがれ", - "たたかう", - "たたく", - "ただしい", - "たたみ", - "たちばな", - "だっかい", - "だっきゃく", - "だっこ", - "だっしゅつ", - "だったい", - "たてる", - "たとえる", - "たなばた", - "たにん", - "たぬき", - "たのしみ", - "たはつ", - "たぶん", - "たべる", - "たぼう", - "たまご", - "たまる", - "だむる", - "ためいき", - "ためす", - "ためる", - "たもつ", - "たやすい", - "たよる", - "たらす", - "たりきほんがん", - "たりょう", - "たりる", - "たると", - "たれる", - "たれんと", - "たろっと", - "たわむれる", - "だんあつ", - "たんい", - "たんおん", - "たんか", - "たんき", - "たんけん", - "たんご", - "たんさん", - "たんじょうび", - "だんせい", - "たんそく", - "たんたい", - "だんち", - "たんてい", - "たんとう", - "だんな", - "たんにん", - "だんねつ", - "たんのう", - "たんぴん", - "だんぼう", - "たんまつ", - "たんめい", - "だんれつ", - "だんろ", - "だんわ", - "ちあい", - "ちあん", - "ちいき", - "ちいさい", - "ちえん", - "ちかい", - "ちから", - "ちきゅう", - "ちきん", - "ちけいず", - "ちけん", - "ちこく", - "ちさい", - "ちしき", - "ちしりょう", - "ちせい", - "ちそう", - "ちたい", - "ちたん", - "ちちおや", - "ちつじょ", - "ちてき", - "ちてん", - "ちぬき", - "ちぬり", - "ちのう", - "ちひょう", - "ちへいせん", - "ちほう", - "ちまた", - "ちみつ", - "ちみどろ", - "ちめいど", - "ちゃんこなべ", - "ちゅうい", - "ちゆりょく", - "ちょうし", - "ちょさくけん", - "ちらし", - "ちらみ", - "ちりがみ", - "ちりょう", - "ちるど", - "ちわわ", - "ちんたい", - "ちんもく", - "ついか", - "ついたち", - "つうか", - "つうじょう", - "つうはん", - "つうわ", - "つかう", - "つかれる", - "つくね", - "つくる", - "つけね", - "つける", - "つごう", - "つたえる", - "つづく", - "つつじ", - "つつむ", - "つとめる", - "つながる", - "つなみ", - "つねづね", - "つのる", - "つぶす", - "つまらない", - "つまる", - "つみき", - "つめたい", - "つもり", - "つもる", - "つよい", - "つるぼ", - "つるみく", - "つわもの", - "つわり", - "てあし", - "てあて", - "てあみ", - "ていおん", - "ていか", - "ていき", - "ていけい", - "ていこく", - "ていさつ", - "ていし", - "ていせい", - "ていたい", - "ていど", - "ていねい", - "ていひょう", - "ていへん", - "ていぼう", - "てうち", - "ておくれ", - "てきとう", - "てくび", - "でこぼこ", - "てさぎょう", - "てさげ", - "てすり", - "てそう", - "てちがい", - "てちょう", - "てつがく", - "てつづき", - "でっぱ", - "てつぼう", - "てつや", - "でぬかえ", - "てぬき", - "てぬぐい", - "てのひら", - "てはい", - "てぶくろ", - "てふだ", - "てほどき", - "てほん", - "てまえ", - "てまきずし", - "てみじか", - "てみやげ", - "てらす", - "てれび", - "てわけ", - "てわたし", - "でんあつ", - "てんいん", - "てんかい", - "てんき", - "てんぐ", - "てんけん", - "てんごく", - "てんさい", - "てんし", - "てんすう", - "でんち", - "てんてき", - "てんとう", - "てんない", - "てんぷら", - "てんぼうだい", - "てんめつ", - "てんらんかい", - "でんりょく", - "でんわ", - "どあい", - "といれ", - "どうかん", - "とうきゅう", - "どうぐ", - "とうし", - "とうむぎ", - "とおい", - "とおか", - "とおく", - "とおす", - "とおる", - "とかい", - "とかす", - "ときおり", - "ときどき", - "とくい", - "とくしゅう", - "とくてん", - "とくに", - "とくべつ", - "とけい", - "とける", - "とこや", - "とさか", - "としょかん", - "とそう", - "とたん", - "とちゅう", - "とっきゅう", - "とっくん", - "とつぜん", - "とつにゅう", - "とどける", - "ととのえる", - "とない", - "となえる", - "となり", - "とのさま", - "とばす", - "どぶがわ", - "とほう", - "とまる", - "とめる", - "ともだち", - "ともる", - "どようび", - "とらえる", - "とんかつ", - "どんぶり", - "ないかく", - "ないこう", - "ないしょ", - "ないす", - "ないせん", - "ないそう", - "なおす", - "ながい", - "なくす", - "なげる", - "なこうど", - "なさけ", - "なたでここ", - "なっとう", - "なつやすみ", - "ななおし", - "なにごと", - "なにもの", - "なにわ", - "なのか", - "なふだ", - "なまいき", - "なまえ", - "なまみ", - "なみだ", - "なめらか", - "なめる", - "なやむ", - "ならう", - "ならび", - "ならぶ", - "なれる", - "なわとび", - "なわばり", - "にあう", - "にいがた", - "にうけ", - "におい", - "にかい", - "にがて", - "にきび", - "にくしみ", - "にくまん", - "にげる", - "にさんかたんそ", - "にしき", - "にせもの", - "にちじょう", - "にちようび", - "にっか", - "にっき", - "にっけい", - "にっこう", - "にっさん", - "にっしょく", - "にっすう", - "にっせき", - "にってい", - "になう", - "にほん", - "にまめ", - "にもつ", - "にやり", - "にゅういん", - "にりんしゃ", - "にわとり", - "にんい", - "にんか", - "にんき", - "にんげん", - "にんしき", - "にんずう", - "にんそう", - "にんたい", - "にんち", - "にんてい", - "にんにく", - "にんぷ", - "にんまり", - "にんむ", - "にんめい", - "にんよう", - "ぬいくぎ", - "ぬかす", - "ぬぐいとる", - "ぬぐう", - "ぬくもり", - "ぬすむ", - "ぬまえび", - "ぬめり", - "ぬらす", - "ぬんちゃく", - "ねあげ", - "ねいき", - "ねいる", - "ねいろ", - "ねぐせ", - "ねくたい", - "ねくら", - "ねこぜ", - "ねこむ", - "ねさげ", - "ねすごす", - "ねそべる", - "ねだん", - "ねつい", - "ねっしん", - "ねつぞう", - "ねったいぎょ", - "ねぶそく", - "ねふだ", - "ねぼう", - "ねほりはほり", - "ねまき", - "ねまわし", - "ねみみ", - "ねむい", - "ねむたい", - "ねもと", - "ねらう", - "ねわざ", - "ねんいり", - "ねんおし", - "ねんかん", - "ねんきん", - "ねんぐ", - "ねんざ", - "ねんし", - "ねんちゃく", - "ねんど", - "ねんぴ", - "ねんぶつ", - "ねんまつ", - "ねんりょう", - "ねんれい", - "のいず", - "のおづま", - "のがす", - "のきなみ", - "のこぎり", - "のこす", - "のこる", - "のせる", - "のぞく", - "のぞむ", - "のたまう", - "のちほど", - "のっく", - "のばす", - "のはら", - "のべる", - "のぼる", - "のみもの", - "のやま", - "のらいぬ", - "のらねこ", - "のりもの", - "のりゆき", - "のれん", - "のんき", - "ばあい", - "はあく", - "ばあさん", - "ばいか", - "ばいく", - "はいけん", - "はいご", - "はいしん", - "はいすい", - "はいせん", - "はいそう", - "はいち", - "ばいばい", - "はいれつ", - "はえる", - "はおる", - "はかい", - "ばかり", - "はかる", - "はくしゅ", - "はけん", - "はこぶ", - "はさみ", - "はさん", - "はしご", - "ばしょ", - "はしる", - "はせる", - "ぱそこん", - "はそん", - "はたん", - "はちみつ", - "はつおん", - "はっかく", - "はづき", - "はっきり", - "はっくつ", - "はっけん", - "はっこう", - "はっさん", - "はっしん", - "はったつ", - "はっちゅう", - "はってん", - "はっぴょう", - "はっぽう", - "はなす", - "はなび", - "はにかむ", - "はぶらし", - "はみがき", - "はむかう", - "はめつ", - "はやい", - "はやし", - "はらう", - "はろうぃん", - "はわい", - "はんい", - "はんえい", - "はんおん", - "はんかく", - "はんきょう", - "ばんぐみ", - "はんこ", - "はんしゃ", - "はんすう", - "はんだん", - "ぱんち", - "ぱんつ", - "はんてい", - "はんとし", - "はんのう", - "はんぱ", - "はんぶん", - "はんぺん", - "はんぼうき", - "はんめい", - "はんらん", - "はんろん", - "ひいき", - "ひうん", - "ひえる", - "ひかく", - "ひかり", - "ひかる", - "ひかん", - "ひくい", - "ひけつ", - "ひこうき", - "ひこく", - "ひさい", - "ひさしぶり", - "ひさん", - "びじゅつかん", - "ひしょ", - "ひそか", - "ひそむ", - "ひたむき", - "ひだり", - "ひたる", - "ひつぎ", - "ひっこし", - "ひっし", - "ひつじゅひん", - "ひっす", - "ひつぜん", - "ぴったり", - "ぴっちり", - "ひつよう", - "ひてい", - "ひとごみ", - "ひなまつり", - "ひなん", - "ひねる", - "ひはん", - "ひびく", - "ひひょう", - "ひほう", - "ひまわり", - "ひまん", - "ひみつ", - "ひめい", - "ひめじし", - "ひやけ", - "ひやす", - "ひよう", - "びょうき", - "ひらがな", - "ひらく", - "ひりつ", - "ひりょう", - "ひるま", - "ひるやすみ", - "ひれい", - "ひろい", - "ひろう", - "ひろき", - "ひろゆき", - "ひんかく", - "ひんけつ", - "ひんこん", - "ひんしゅ", - "ひんそう", - "ぴんち", - "ひんぱん", - "びんぼう", - "ふあん", - "ふいうち", - "ふうけい", - "ふうせん", - "ぷうたろう", - "ふうとう", - "ふうふ", - "ふえる", - "ふおん", - "ふかい", - "ふきん", - "ふくざつ", - "ふくぶくろ", - "ふこう", - "ふさい", - "ふしぎ", - "ふじみ", - "ふすま", - "ふせい", - "ふせぐ", - "ふそく", - "ぶたにく", - "ふたん", - "ふちょう", - "ふつう", - "ふつか", - "ふっかつ", - "ふっき", - "ふっこく", - "ぶどう", - "ふとる", - "ふとん", - "ふのう", - "ふはい", - "ふひょう", - "ふへん", - "ふまん", - "ふみん", - "ふめつ", - "ふめん", - "ふよう", - "ふりこ", - "ふりる", - "ふるい", - "ふんいき", - "ぶんがく", - "ぶんぐ", - "ふんしつ", - "ぶんせき", - "ふんそう", - "ぶんぽう", - "へいあん", - "へいおん", - "へいがい", - "へいき", - "へいげん", - "へいこう", - "へいさ", - "へいしゃ", - "へいせつ", - "へいそ", - "へいたく", - "へいてん", - "へいねつ", - "へいわ", - "へきが", - "へこむ", - "べにいろ", - "べにしょうが", - "へらす", - "へんかん", - "べんきょう", - "べんごし", - "へんさい", - "へんたい", - "べんり", - "ほあん", - "ほいく", - "ぼうぎょ", - "ほうこく", - "ほうそう", - "ほうほう", - "ほうもん", - "ほうりつ", - "ほえる", - "ほおん", - "ほかん", - "ほきょう", - "ぼきん", - "ほくろ", - "ほけつ", - "ほけん", - "ほこう", - "ほこる", - "ほしい", - "ほしつ", - "ほしゅ", - "ほしょう", - "ほせい", - "ほそい", - "ほそく", - "ほたて", - "ほたる", - "ぽちぶくろ", - "ほっきょく", - "ほっさ", - "ほったん", - "ほとんど", - "ほめる", - "ほんい", - "ほんき", - "ほんけ", - "ほんしつ", - "ほんやく", - "まいにち", - "まかい", - "まかせる", - "まがる", - "まける", - "まこと", - "まさつ", - "まじめ", - "ますく", - "まぜる", - "まつり", - "まとめ", - "まなぶ", - "まぬけ", - "まねく", - "まほう", - "まもる", - "まゆげ", - "まよう", - "まろやか", - "まわす", - "まわり", - "まわる", - "まんが", - "まんきつ", - "まんぞく", - "まんなか", - "みいら", - "みうち", - "みえる", - "みがく", - "みかた", - "みかん", - "みけん", - "みこん", - "みじかい", - "みすい", - "みすえる", - "みせる", - "みっか", - "みつかる", - "みつける", - "みてい", - "みとめる", - "みなと", - "みなみかさい", - "みねらる", - "みのう", - "みのがす", - "みほん", - "みもと", - "みやげ", - "みらい", - "みりょく", - "みわく", - "みんか", - "みんぞく", - "むいか", - "むえき", - "むえん", - "むかい", - "むかう", - "むかえ", - "むかし", - "むぎちゃ", - "むける", - "むげん", - "むさぼる", - "むしあつい", - "むしば", - "むじゅん", - "むしろ", - "むすう", - "むすこ", - "むすぶ", - "むすめ", - "むせる", - "むせん", - "むちゅう", - "むなしい", - "むのう", - "むやみ", - "むよう", - "むらさき", - "むりょう", - "むろん", - "めいあん", - "めいうん", - "めいえん", - "めいかく", - "めいきょく", - "めいさい", - "めいし", - "めいそう", - "めいぶつ", - "めいれい", - "めいわく", - "めぐまれる", - "めざす", - "めした", - "めずらしい", - "めだつ", - "めまい", - "めやす", - "めんきょ", - "めんせき", - "めんどう", - "もうしあげる", - "もうどうけん", - "もえる", - "もくし", - "もくてき", - "もくようび", - "もちろん", - "もどる", - "もらう", - "もんく", - "もんだい", - "やおや", - "やける", - "やさい", - "やさしい", - "やすい", - "やすたろう", - "やすみ", - "やせる", - "やそう", - "やたい", - "やちん", - "やっと", - "やっぱり", - "やぶる", - "やめる", - "ややこしい", - "やよい", - "やわらかい", - "ゆうき", - "ゆうびんきょく", - "ゆうべ", - "ゆうめい", - "ゆけつ", - "ゆしゅつ", - "ゆせん", - "ゆそう", - "ゆたか", - "ゆちゃく", - "ゆでる", - "ゆにゅう", - "ゆびわ", - "ゆらい", - "ゆれる", - "ようい", - "ようか", - "ようきゅう", - "ようじ", - "ようす", - "ようちえん", - "よかぜ", - "よかん", - "よきん", - "よくせい", - "よくぼう", - "よけい", - "よごれる", - "よさん", - "よしゅう", - "よそう", - "よそく", - "よっか", - "よてい", - "よどがわく", - "よねつ", - "よやく", - "よゆう", - "よろこぶ", - "よろしい", - "らいう", - "らくがき", - "らくご", - "らくさつ", - "らくだ", - "らしんばん", - "らせん", - "らぞく", - "らたい", - "らっか", - "られつ", - "りえき", - "りかい", - "りきさく", - "りきせつ", - "りくぐん", - "りくつ", - "りけん", - "りこう", - "りせい", - "りそう", - "りそく", - "りてん", - "りねん", - "りゆう", - "りゅうがく", - "りよう", - "りょうり", - "りょかん", - "りょくちゃ", - "りょこう", - "りりく", - "りれき", - "りろん", - "りんご", - "るいけい", - "るいさい", - "るいじ", - "るいせき", - "るすばん", - "るりがわら", - "れいかん", - "れいぎ", - "れいせい", - "れいぞうこ", - "れいとう", - "れいぼう", - "れきし", - "れきだい", - "れんあい", - "れんけい", - "れんこん", - "れんさい", - "れんしゅう", - "れんぞく", - "れんらく", - "ろうか", - "ろうご", - "ろうじん", - "ろうそく", - "ろくが", - "ろこつ", - "ろじうら", - "ろしゅつ", - "ろせん", - "ろてん", - "ろめん", - "ろれつ", - "ろんぎ", - "ろんぱ", - "ろんぶん", - "ろんり", - "わかす", - "わかめ", - "わかやま", - "わかれる", - "わしつ", - "わじまし", - "わすれもの", - "わらう", - "われる" -] diff --git a/tools/mnemonic-test/node_modules/bip39/src/wordlists/korean.json b/tools/mnemonic-test/node_modules/bip39/src/wordlists/korean.json deleted file mode 100644 index 67d9ac0a..00000000 --- a/tools/mnemonic-test/node_modules/bip39/src/wordlists/korean.json +++ /dev/null @@ -1,2050 +0,0 @@ -[ - "가격", - "가끔", - "가난", - "가능", - "가득", - "가르침", - "가뭄", - "가방", - "가상", - "가슴", - "가운데", - "가을", - "가이드", - "가입", - "가장", - "가정", - "가족", - "가죽", - "각오", - "각자", - "간격", - "간부", - "간섭", - "간장", - "간접", - "간판", - "갈등", - "갈비", - "갈색", - "갈증", - "감각", - "감기", - "감소", - "감수성", - "감자", - "감정", - "갑자기", - "강남", - "강당", - "강도", - "강력히", - "강변", - "강북", - "강사", - "강수량", - "강아지", - "강원도", - "강의", - "강제", - "강조", - "같이", - "개구리", - "개나리", - "개방", - "개별", - "개선", - "개성", - "개인", - "객관적", - "거실", - "거액", - "거울", - "거짓", - "거품", - "걱정", - "건강", - "건물", - "건설", - "건조", - "건축", - "걸음", - "검사", - "검토", - "게시판", - "게임", - "겨울", - "견해", - "결과", - "결국", - "결론", - "결석", - "결승", - "결심", - "결정", - "결혼", - "경계", - "경고", - "경기", - "경력", - "경복궁", - "경비", - "경상도", - "경영", - "경우", - "경쟁", - "경제", - "경주", - "경찰", - "경치", - "경향", - "경험", - "계곡", - "계단", - "계란", - "계산", - "계속", - "계약", - "계절", - "계층", - "계획", - "고객", - "고구려", - "고궁", - "고급", - "고등학생", - "고무신", - "고민", - "고양이", - "고장", - "고전", - "고집", - "고춧가루", - "고통", - "고향", - "곡식", - "골목", - "골짜기", - "골프", - "공간", - "공개", - "공격", - "공군", - "공급", - "공기", - "공동", - "공무원", - "공부", - "공사", - "공식", - "공업", - "공연", - "공원", - "공장", - "공짜", - "공책", - "공통", - "공포", - "공항", - "공휴일", - "과목", - "과일", - "과장", - "과정", - "과학", - "관객", - "관계", - "관광", - "관념", - "관람", - "관련", - "관리", - "관습", - "관심", - "관점", - "관찰", - "광경", - "광고", - "광장", - "광주", - "괴로움", - "굉장히", - "교과서", - "교문", - "교복", - "교실", - "교양", - "교육", - "교장", - "교직", - "교통", - "교환", - "교훈", - "구경", - "구름", - "구멍", - "구별", - "구분", - "구석", - "구성", - "구속", - "구역", - "구입", - "구청", - "구체적", - "국가", - "국기", - "국내", - "국립", - "국물", - "국민", - "국수", - "국어", - "국왕", - "국적", - "국제", - "국회", - "군대", - "군사", - "군인", - "궁극적", - "권리", - "권위", - "권투", - "귀국", - "귀신", - "규정", - "규칙", - "균형", - "그날", - "그냥", - "그늘", - "그러나", - "그룹", - "그릇", - "그림", - "그제서야", - "그토록", - "극복", - "극히", - "근거", - "근교", - "근래", - "근로", - "근무", - "근본", - "근원", - "근육", - "근처", - "글씨", - "글자", - "금강산", - "금고", - "금년", - "금메달", - "금액", - "금연", - "금요일", - "금지", - "긍정적", - "기간", - "기관", - "기념", - "기능", - "기독교", - "기둥", - "기록", - "기름", - "기법", - "기본", - "기분", - "기쁨", - "기숙사", - "기술", - "기억", - "기업", - "기온", - "기운", - "기원", - "기적", - "기준", - "기침", - "기혼", - "기획", - "긴급", - "긴장", - "길이", - "김밥", - "김치", - "김포공항", - "깍두기", - "깜빡", - "깨달음", - "깨소금", - "껍질", - "꼭대기", - "꽃잎", - "나들이", - "나란히", - "나머지", - "나물", - "나침반", - "나흘", - "낙엽", - "난방", - "날개", - "날씨", - "날짜", - "남녀", - "남대문", - "남매", - "남산", - "남자", - "남편", - "남학생", - "낭비", - "낱말", - "내년", - "내용", - "내일", - "냄비", - "냄새", - "냇물", - "냉동", - "냉면", - "냉방", - "냉장고", - "넥타이", - "넷째", - "노동", - "노란색", - "노력", - "노인", - "녹음", - "녹차", - "녹화", - "논리", - "논문", - "논쟁", - "놀이", - "농구", - "농담", - "농민", - "농부", - "농업", - "농장", - "농촌", - "높이", - "눈동자", - "눈물", - "눈썹", - "뉴욕", - "느낌", - "늑대", - "능동적", - "능력", - "다방", - "다양성", - "다음", - "다이어트", - "다행", - "단계", - "단골", - "단독", - "단맛", - "단순", - "단어", - "단위", - "단점", - "단체", - "단추", - "단편", - "단풍", - "달걀", - "달러", - "달력", - "달리", - "닭고기", - "담당", - "담배", - "담요", - "담임", - "답변", - "답장", - "당근", - "당분간", - "당연히", - "당장", - "대규모", - "대낮", - "대단히", - "대답", - "대도시", - "대략", - "대량", - "대륙", - "대문", - "대부분", - "대신", - "대응", - "대장", - "대전", - "대접", - "대중", - "대책", - "대출", - "대충", - "대통령", - "대학", - "대한민국", - "대합실", - "대형", - "덩어리", - "데이트", - "도대체", - "도덕", - "도둑", - "도망", - "도서관", - "도심", - "도움", - "도입", - "도자기", - "도저히", - "도전", - "도중", - "도착", - "독감", - "독립", - "독서", - "독일", - "독창적", - "동화책", - "뒷모습", - "뒷산", - "딸아이", - "마누라", - "마늘", - "마당", - "마라톤", - "마련", - "마무리", - "마사지", - "마약", - "마요네즈", - "마을", - "마음", - "마이크", - "마중", - "마지막", - "마찬가지", - "마찰", - "마흔", - "막걸리", - "막내", - "막상", - "만남", - "만두", - "만세", - "만약", - "만일", - "만점", - "만족", - "만화", - "많이", - "말기", - "말씀", - "말투", - "맘대로", - "망원경", - "매년", - "매달", - "매력", - "매번", - "매스컴", - "매일", - "매장", - "맥주", - "먹이", - "먼저", - "먼지", - "멀리", - "메일", - "며느리", - "며칠", - "면담", - "멸치", - "명단", - "명령", - "명예", - "명의", - "명절", - "명칭", - "명함", - "모금", - "모니터", - "모델", - "모든", - "모범", - "모습", - "모양", - "모임", - "모조리", - "모집", - "모퉁이", - "목걸이", - "목록", - "목사", - "목소리", - "목숨", - "목적", - "목표", - "몰래", - "몸매", - "몸무게", - "몸살", - "몸속", - "몸짓", - "몸통", - "몹시", - "무관심", - "무궁화", - "무더위", - "무덤", - "무릎", - "무슨", - "무엇", - "무역", - "무용", - "무조건", - "무지개", - "무척", - "문구", - "문득", - "문법", - "문서", - "문제", - "문학", - "문화", - "물가", - "물건", - "물결", - "물고기", - "물론", - "물리학", - "물음", - "물질", - "물체", - "미국", - "미디어", - "미사일", - "미술", - "미역", - "미용실", - "미움", - "미인", - "미팅", - "미혼", - "민간", - "민족", - "민주", - "믿음", - "밀가루", - "밀리미터", - "밑바닥", - "바가지", - "바구니", - "바나나", - "바늘", - "바닥", - "바닷가", - "바람", - "바이러스", - "바탕", - "박물관", - "박사", - "박수", - "반대", - "반드시", - "반말", - "반발", - "반성", - "반응", - "반장", - "반죽", - "반지", - "반찬", - "받침", - "발가락", - "발걸음", - "발견", - "발달", - "발레", - "발목", - "발바닥", - "발생", - "발음", - "발자국", - "발전", - "발톱", - "발표", - "밤하늘", - "밥그릇", - "밥맛", - "밥상", - "밥솥", - "방금", - "방면", - "방문", - "방바닥", - "방법", - "방송", - "방식", - "방안", - "방울", - "방지", - "방학", - "방해", - "방향", - "배경", - "배꼽", - "배달", - "배드민턴", - "백두산", - "백색", - "백성", - "백인", - "백제", - "백화점", - "버릇", - "버섯", - "버튼", - "번개", - "번역", - "번지", - "번호", - "벌금", - "벌레", - "벌써", - "범위", - "범인", - "범죄", - "법률", - "법원", - "법적", - "법칙", - "베이징", - "벨트", - "변경", - "변동", - "변명", - "변신", - "변호사", - "변화", - "별도", - "별명", - "별일", - "병실", - "병아리", - "병원", - "보관", - "보너스", - "보라색", - "보람", - "보름", - "보상", - "보안", - "보자기", - "보장", - "보전", - "보존", - "보통", - "보편적", - "보험", - "복도", - "복사", - "복숭아", - "복습", - "볶음", - "본격적", - "본래", - "본부", - "본사", - "본성", - "본인", - "본질", - "볼펜", - "봉사", - "봉지", - "봉투", - "부근", - "부끄러움", - "부담", - "부동산", - "부문", - "부분", - "부산", - "부상", - "부엌", - "부인", - "부작용", - "부장", - "부정", - "부족", - "부지런히", - "부친", - "부탁", - "부품", - "부회장", - "북부", - "북한", - "분노", - "분량", - "분리", - "분명", - "분석", - "분야", - "분위기", - "분필", - "분홍색", - "불고기", - "불과", - "불교", - "불꽃", - "불만", - "불법", - "불빛", - "불안", - "불이익", - "불행", - "브랜드", - "비극", - "비난", - "비닐", - "비둘기", - "비디오", - "비로소", - "비만", - "비명", - "비밀", - "비바람", - "비빔밥", - "비상", - "비용", - "비율", - "비중", - "비타민", - "비판", - "빌딩", - "빗물", - "빗방울", - "빗줄기", - "빛깔", - "빨간색", - "빨래", - "빨리", - "사건", - "사계절", - "사나이", - "사냥", - "사람", - "사랑", - "사립", - "사모님", - "사물", - "사방", - "사상", - "사생활", - "사설", - "사슴", - "사실", - "사업", - "사용", - "사월", - "사장", - "사전", - "사진", - "사촌", - "사춘기", - "사탕", - "사투리", - "사흘", - "산길", - "산부인과", - "산업", - "산책", - "살림", - "살인", - "살짝", - "삼계탕", - "삼국", - "삼십", - "삼월", - "삼촌", - "상관", - "상금", - "상대", - "상류", - "상반기", - "상상", - "상식", - "상업", - "상인", - "상자", - "상점", - "상처", - "상추", - "상태", - "상표", - "상품", - "상황", - "새벽", - "색깔", - "색연필", - "생각", - "생명", - "생물", - "생방송", - "생산", - "생선", - "생신", - "생일", - "생활", - "서랍", - "서른", - "서명", - "서민", - "서비스", - "서양", - "서울", - "서적", - "서점", - "서쪽", - "서클", - "석사", - "석유", - "선거", - "선물", - "선배", - "선생", - "선수", - "선원", - "선장", - "선전", - "선택", - "선풍기", - "설거지", - "설날", - "설렁탕", - "설명", - "설문", - "설사", - "설악산", - "설치", - "설탕", - "섭씨", - "성공", - "성당", - "성명", - "성별", - "성인", - "성장", - "성적", - "성질", - "성함", - "세금", - "세미나", - "세상", - "세월", - "세종대왕", - "세탁", - "센터", - "센티미터", - "셋째", - "소규모", - "소극적", - "소금", - "소나기", - "소년", - "소득", - "소망", - "소문", - "소설", - "소속", - "소아과", - "소용", - "소원", - "소음", - "소중히", - "소지품", - "소질", - "소풍", - "소형", - "속담", - "속도", - "속옷", - "손가락", - "손길", - "손녀", - "손님", - "손등", - "손목", - "손뼉", - "손실", - "손질", - "손톱", - "손해", - "솔직히", - "솜씨", - "송아지", - "송이", - "송편", - "쇠고기", - "쇼핑", - "수건", - "수년", - "수단", - "수돗물", - "수동적", - "수면", - "수명", - "수박", - "수상", - "수석", - "수술", - "수시로", - "수업", - "수염", - "수영", - "수입", - "수준", - "수집", - "수출", - "수컷", - "수필", - "수학", - "수험생", - "수화기", - "숙녀", - "숙소", - "숙제", - "순간", - "순서", - "순수", - "순식간", - "순위", - "숟가락", - "술병", - "술집", - "숫자", - "스님", - "스물", - "스스로", - "스승", - "스웨터", - "스위치", - "스케이트", - "스튜디오", - "스트레스", - "스포츠", - "슬쩍", - "슬픔", - "습관", - "습기", - "승객", - "승리", - "승부", - "승용차", - "승진", - "시각", - "시간", - "시골", - "시금치", - "시나리오", - "시댁", - "시리즈", - "시멘트", - "시민", - "시부모", - "시선", - "시설", - "시스템", - "시아버지", - "시어머니", - "시월", - "시인", - "시일", - "시작", - "시장", - "시절", - "시점", - "시중", - "시즌", - "시집", - "시청", - "시합", - "시험", - "식구", - "식기", - "식당", - "식량", - "식료품", - "식물", - "식빵", - "식사", - "식생활", - "식초", - "식탁", - "식품", - "신고", - "신규", - "신념", - "신문", - "신발", - "신비", - "신사", - "신세", - "신용", - "신제품", - "신청", - "신체", - "신화", - "실감", - "실내", - "실력", - "실례", - "실망", - "실수", - "실습", - "실시", - "실장", - "실정", - "실질적", - "실천", - "실체", - "실컷", - "실태", - "실패", - "실험", - "실현", - "심리", - "심부름", - "심사", - "심장", - "심정", - "심판", - "쌍둥이", - "씨름", - "씨앗", - "아가씨", - "아나운서", - "아드님", - "아들", - "아쉬움", - "아스팔트", - "아시아", - "아울러", - "아저씨", - "아줌마", - "아직", - "아침", - "아파트", - "아프리카", - "아픔", - "아홉", - "아흔", - "악기", - "악몽", - "악수", - "안개", - "안경", - "안과", - "안내", - "안녕", - "안동", - "안방", - "안부", - "안주", - "알루미늄", - "알코올", - "암시", - "암컷", - "압력", - "앞날", - "앞문", - "애인", - "애정", - "액수", - "앨범", - "야간", - "야단", - "야옹", - "약간", - "약국", - "약속", - "약수", - "약점", - "약품", - "약혼녀", - "양념", - "양력", - "양말", - "양배추", - "양주", - "양파", - "어둠", - "어려움", - "어른", - "어젯밤", - "어쨌든", - "어쩌다가", - "어쩐지", - "언니", - "언덕", - "언론", - "언어", - "얼굴", - "얼른", - "얼음", - "얼핏", - "엄마", - "업무", - "업종", - "업체", - "엉덩이", - "엉망", - "엉터리", - "엊그제", - "에너지", - "에어컨", - "엔진", - "여건", - "여고생", - "여관", - "여군", - "여권", - "여대생", - "여덟", - "여동생", - "여든", - "여론", - "여름", - "여섯", - "여성", - "여왕", - "여인", - "여전히", - "여직원", - "여학생", - "여행", - "역사", - "역시", - "역할", - "연결", - "연구", - "연극", - "연기", - "연락", - "연설", - "연세", - "연속", - "연습", - "연애", - "연예인", - "연인", - "연장", - "연주", - "연출", - "연필", - "연합", - "연휴", - "열기", - "열매", - "열쇠", - "열심히", - "열정", - "열차", - "열흘", - "염려", - "엽서", - "영국", - "영남", - "영상", - "영양", - "영역", - "영웅", - "영원히", - "영하", - "영향", - "영혼", - "영화", - "옆구리", - "옆방", - "옆집", - "예감", - "예금", - "예방", - "예산", - "예상", - "예선", - "예술", - "예습", - "예식장", - "예약", - "예전", - "예절", - "예정", - "예컨대", - "옛날", - "오늘", - "오락", - "오랫동안", - "오렌지", - "오로지", - "오른발", - "오븐", - "오십", - "오염", - "오월", - "오전", - "오직", - "오징어", - "오페라", - "오피스텔", - "오히려", - "옥상", - "옥수수", - "온갖", - "온라인", - "온몸", - "온종일", - "온통", - "올가을", - "올림픽", - "올해", - "옷차림", - "와이셔츠", - "와인", - "완성", - "완전", - "왕비", - "왕자", - "왜냐하면", - "왠지", - "외갓집", - "외국", - "외로움", - "외삼촌", - "외출", - "외침", - "외할머니", - "왼발", - "왼손", - "왼쪽", - "요금", - "요일", - "요즘", - "요청", - "용기", - "용서", - "용어", - "우산", - "우선", - "우승", - "우연히", - "우정", - "우체국", - "우편", - "운동", - "운명", - "운반", - "운전", - "운행", - "울산", - "울음", - "움직임", - "웃어른", - "웃음", - "워낙", - "원고", - "원래", - "원서", - "원숭이", - "원인", - "원장", - "원피스", - "월급", - "월드컵", - "월세", - "월요일", - "웨이터", - "위반", - "위법", - "위성", - "위원", - "위험", - "위협", - "윗사람", - "유난히", - "유럽", - "유명", - "유물", - "유산", - "유적", - "유치원", - "유학", - "유행", - "유형", - "육군", - "육상", - "육십", - "육체", - "은행", - "음력", - "음료", - "음반", - "음성", - "음식", - "음악", - "음주", - "의견", - "의논", - "의문", - "의복", - "의식", - "의심", - "의외로", - "의욕", - "의원", - "의학", - "이것", - "이곳", - "이념", - "이놈", - "이달", - "이대로", - "이동", - "이렇게", - "이력서", - "이론적", - "이름", - "이민", - "이발소", - "이별", - "이불", - "이빨", - "이상", - "이성", - "이슬", - "이야기", - "이용", - "이웃", - "이월", - "이윽고", - "이익", - "이전", - "이중", - "이튿날", - "이틀", - "이혼", - "인간", - "인격", - "인공", - "인구", - "인근", - "인기", - "인도", - "인류", - "인물", - "인생", - "인쇄", - "인연", - "인원", - "인재", - "인종", - "인천", - "인체", - "인터넷", - "인하", - "인형", - "일곱", - "일기", - "일단", - "일대", - "일등", - "일반", - "일본", - "일부", - "일상", - "일생", - "일손", - "일요일", - "일월", - "일정", - "일종", - "일주일", - "일찍", - "일체", - "일치", - "일행", - "일회용", - "임금", - "임무", - "입대", - "입력", - "입맛", - "입사", - "입술", - "입시", - "입원", - "입장", - "입학", - "자가용", - "자격", - "자극", - "자동", - "자랑", - "자부심", - "자식", - "자신", - "자연", - "자원", - "자율", - "자전거", - "자정", - "자존심", - "자판", - "작가", - "작년", - "작성", - "작업", - "작용", - "작은딸", - "작품", - "잔디", - "잔뜩", - "잔치", - "잘못", - "잠깐", - "잠수함", - "잠시", - "잠옷", - "잠자리", - "잡지", - "장관", - "장군", - "장기간", - "장래", - "장례", - "장르", - "장마", - "장면", - "장모", - "장미", - "장비", - "장사", - "장소", - "장식", - "장애인", - "장인", - "장점", - "장차", - "장학금", - "재능", - "재빨리", - "재산", - "재생", - "재작년", - "재정", - "재채기", - "재판", - "재학", - "재활용", - "저것", - "저고리", - "저곳", - "저녁", - "저런", - "저렇게", - "저번", - "저울", - "저절로", - "저축", - "적극", - "적당히", - "적성", - "적용", - "적응", - "전개", - "전공", - "전기", - "전달", - "전라도", - "전망", - "전문", - "전반", - "전부", - "전세", - "전시", - "전용", - "전자", - "전쟁", - "전주", - "전철", - "전체", - "전통", - "전혀", - "전후", - "절대", - "절망", - "절반", - "절약", - "절차", - "점검", - "점수", - "점심", - "점원", - "점점", - "점차", - "접근", - "접시", - "접촉", - "젓가락", - "정거장", - "정도", - "정류장", - "정리", - "정말", - "정면", - "정문", - "정반대", - "정보", - "정부", - "정비", - "정상", - "정성", - "정오", - "정원", - "정장", - "정지", - "정치", - "정확히", - "제공", - "제과점", - "제대로", - "제목", - "제발", - "제법", - "제삿날", - "제안", - "제일", - "제작", - "제주도", - "제출", - "제품", - "제한", - "조각", - "조건", - "조금", - "조깅", - "조명", - "조미료", - "조상", - "조선", - "조용히", - "조절", - "조정", - "조직", - "존댓말", - "존재", - "졸업", - "졸음", - "종교", - "종로", - "종류", - "종소리", - "종업원", - "종종", - "종합", - "좌석", - "죄인", - "주관적", - "주름", - "주말", - "주머니", - "주먹", - "주문", - "주민", - "주방", - "주변", - "주식", - "주인", - "주일", - "주장", - "주전자", - "주택", - "준비", - "줄거리", - "줄기", - "줄무늬", - "중간", - "중계방송", - "중국", - "중년", - "중단", - "중독", - "중반", - "중부", - "중세", - "중소기업", - "중순", - "중앙", - "중요", - "중학교", - "즉석", - "즉시", - "즐거움", - "증가", - "증거", - "증권", - "증상", - "증세", - "지각", - "지갑", - "지경", - "지극히", - "지금", - "지급", - "지능", - "지름길", - "지리산", - "지방", - "지붕", - "지식", - "지역", - "지우개", - "지원", - "지적", - "지점", - "지진", - "지출", - "직선", - "직업", - "직원", - "직장", - "진급", - "진동", - "진로", - "진료", - "진리", - "진짜", - "진찰", - "진출", - "진통", - "진행", - "질문", - "질병", - "질서", - "짐작", - "집단", - "집안", - "집중", - "짜증", - "찌꺼기", - "차남", - "차라리", - "차량", - "차림", - "차별", - "차선", - "차츰", - "착각", - "찬물", - "찬성", - "참가", - "참기름", - "참새", - "참석", - "참여", - "참외", - "참조", - "찻잔", - "창가", - "창고", - "창구", - "창문", - "창밖", - "창작", - "창조", - "채널", - "채점", - "책가방", - "책방", - "책상", - "책임", - "챔피언", - "처벌", - "처음", - "천국", - "천둥", - "천장", - "천재", - "천천히", - "철도", - "철저히", - "철학", - "첫날", - "첫째", - "청년", - "청바지", - "청소", - "청춘", - "체계", - "체력", - "체온", - "체육", - "체중", - "체험", - "초등학생", - "초반", - "초밥", - "초상화", - "초순", - "초여름", - "초원", - "초저녁", - "초점", - "초청", - "초콜릿", - "촛불", - "총각", - "총리", - "총장", - "촬영", - "최근", - "최상", - "최선", - "최신", - "최악", - "최종", - "추석", - "추억", - "추진", - "추천", - "추측", - "축구", - "축소", - "축제", - "축하", - "출근", - "출발", - "출산", - "출신", - "출연", - "출입", - "출장", - "출판", - "충격", - "충고", - "충돌", - "충분히", - "충청도", - "취업", - "취직", - "취향", - "치약", - "친구", - "친척", - "칠십", - "칠월", - "칠판", - "침대", - "침묵", - "침실", - "칫솔", - "칭찬", - "카메라", - "카운터", - "칼국수", - "캐릭터", - "캠퍼스", - "캠페인", - "커튼", - "컨디션", - "컬러", - "컴퓨터", - "코끼리", - "코미디", - "콘서트", - "콜라", - "콤플렉스", - "콩나물", - "쾌감", - "쿠데타", - "크림", - "큰길", - "큰딸", - "큰소리", - "큰아들", - "큰어머니", - "큰일", - "큰절", - "클래식", - "클럽", - "킬로", - "타입", - "타자기", - "탁구", - "탁자", - "탄생", - "태권도", - "태양", - "태풍", - "택시", - "탤런트", - "터널", - "터미널", - "테니스", - "테스트", - "테이블", - "텔레비전", - "토론", - "토마토", - "토요일", - "통계", - "통과", - "통로", - "통신", - "통역", - "통일", - "통장", - "통제", - "통증", - "통합", - "통화", - "퇴근", - "퇴원", - "퇴직금", - "튀김", - "트럭", - "특급", - "특별", - "특성", - "특수", - "특징", - "특히", - "튼튼히", - "티셔츠", - "파란색", - "파일", - "파출소", - "판결", - "판단", - "판매", - "판사", - "팔십", - "팔월", - "팝송", - "패션", - "팩스", - "팩시밀리", - "팬티", - "퍼센트", - "페인트", - "편견", - "편의", - "편지", - "편히", - "평가", - "평균", - "평생", - "평소", - "평양", - "평일", - "평화", - "포스터", - "포인트", - "포장", - "포함", - "표면", - "표정", - "표준", - "표현", - "품목", - "품질", - "풍경", - "풍속", - "풍습", - "프랑스", - "프린터", - "플라스틱", - "피곤", - "피망", - "피아노", - "필름", - "필수", - "필요", - "필자", - "필통", - "핑계", - "하느님", - "하늘", - "하드웨어", - "하룻밤", - "하반기", - "하숙집", - "하순", - "하여튼", - "하지만", - "하천", - "하품", - "하필", - "학과", - "학교", - "학급", - "학기", - "학년", - "학력", - "학번", - "학부모", - "학비", - "학생", - "학술", - "학습", - "학용품", - "학원", - "학위", - "학자", - "학점", - "한계", - "한글", - "한꺼번에", - "한낮", - "한눈", - "한동안", - "한때", - "한라산", - "한마디", - "한문", - "한번", - "한복", - "한식", - "한여름", - "한쪽", - "할머니", - "할아버지", - "할인", - "함께", - "함부로", - "합격", - "합리적", - "항공", - "항구", - "항상", - "항의", - "해결", - "해군", - "해답", - "해당", - "해물", - "해석", - "해설", - "해수욕장", - "해안", - "핵심", - "핸드백", - "햄버거", - "햇볕", - "햇살", - "행동", - "행복", - "행사", - "행운", - "행위", - "향기", - "향상", - "향수", - "허락", - "허용", - "헬기", - "현관", - "현금", - "현대", - "현상", - "현실", - "현장", - "현재", - "현지", - "혈액", - "협력", - "형부", - "형사", - "형수", - "형식", - "형제", - "형태", - "형편", - "혜택", - "호기심", - "호남", - "호랑이", - "호박", - "호텔", - "호흡", - "혹시", - "홀로", - "홈페이지", - "홍보", - "홍수", - "홍차", - "화면", - "화분", - "화살", - "화요일", - "화장", - "화학", - "확보", - "확인", - "확장", - "확정", - "환갑", - "환경", - "환영", - "환율", - "환자", - "활기", - "활동", - "활발히", - "활용", - "활짝", - "회견", - "회관", - "회복", - "회색", - "회원", - "회장", - "회전", - "횟수", - "횡단보도", - "효율적", - "후반", - "후춧가루", - "훈련", - "훨씬", - "휴식", - "휴일", - "흉내", - "흐름", - "흑백", - "흑인", - "흔적", - "흔히", - "흥미", - "흥분", - "희곡", - "희망", - "희생", - "흰색", - "힘껏" -] diff --git a/tools/mnemonic-test/node_modules/bip39/src/wordlists/portuguese.json b/tools/mnemonic-test/node_modules/bip39/src/wordlists/portuguese.json deleted file mode 100644 index 7c0ef3e0..00000000 --- a/tools/mnemonic-test/node_modules/bip39/src/wordlists/portuguese.json +++ /dev/null @@ -1,2050 +0,0 @@ -[ - "abacate", - "abaixo", - "abalar", - "abater", - "abduzir", - "abelha", - "aberto", - "abismo", - "abotoar", - "abranger", - "abreviar", - "abrigar", - "abrupto", - "absinto", - "absoluto", - "absurdo", - "abutre", - "acabado", - "acalmar", - "acampar", - "acanhar", - "acaso", - "aceitar", - "acelerar", - "acenar", - "acervo", - "acessar", - "acetona", - "achatar", - "acidez", - "acima", - "acionado", - "acirrar", - "aclamar", - "aclive", - "acolhida", - "acomodar", - "acoplar", - "acordar", - "acumular", - "acusador", - "adaptar", - "adega", - "adentro", - "adepto", - "adequar", - "aderente", - "adesivo", - "adeus", - "adiante", - "aditivo", - "adjetivo", - "adjunto", - "admirar", - "adorar", - "adquirir", - "adubo", - "adverso", - "advogado", - "aeronave", - "afastar", - "aferir", - "afetivo", - "afinador", - "afivelar", - "aflito", - "afluente", - "afrontar", - "agachar", - "agarrar", - "agasalho", - "agenciar", - "agilizar", - "agiota", - "agitado", - "agora", - "agradar", - "agreste", - "agrupar", - "aguardar", - "agulha", - "ajoelhar", - "ajudar", - "ajustar", - "alameda", - "alarme", - "alastrar", - "alavanca", - "albergue", - "albino", - "alcatra", - "aldeia", - "alecrim", - "alegria", - "alertar", - "alface", - "alfinete", - "algum", - "alheio", - "aliar", - "alicate", - "alienar", - "alinhar", - "aliviar", - "almofada", - "alocar", - "alpiste", - "alterar", - "altitude", - "alucinar", - "alugar", - "aluno", - "alusivo", - "alvo", - "amaciar", - "amador", - "amarelo", - "amassar", - "ambas", - "ambiente", - "ameixa", - "amenizar", - "amido", - "amistoso", - "amizade", - "amolador", - "amontoar", - "amoroso", - "amostra", - "amparar", - "ampliar", - "ampola", - "anagrama", - "analisar", - "anarquia", - "anatomia", - "andaime", - "anel", - "anexo", - "angular", - "animar", - "anjo", - "anomalia", - "anotado", - "ansioso", - "anterior", - "anuidade", - "anunciar", - "anzol", - "apagador", - "apalpar", - "apanhado", - "apego", - "apelido", - "apertada", - "apesar", - "apetite", - "apito", - "aplauso", - "aplicada", - "apoio", - "apontar", - "aposta", - "aprendiz", - "aprovar", - "aquecer", - "arame", - "aranha", - "arara", - "arcada", - "ardente", - "areia", - "arejar", - "arenito", - "aresta", - "argiloso", - "argola", - "arma", - "arquivo", - "arraial", - "arrebate", - "arriscar", - "arroba", - "arrumar", - "arsenal", - "arterial", - "artigo", - "arvoredo", - "asfaltar", - "asilado", - "aspirar", - "assador", - "assinar", - "assoalho", - "assunto", - "astral", - "atacado", - "atadura", - "atalho", - "atarefar", - "atear", - "atender", - "aterro", - "ateu", - "atingir", - "atirador", - "ativo", - "atoleiro", - "atracar", - "atrevido", - "atriz", - "atual", - "atum", - "auditor", - "aumentar", - "aura", - "aurora", - "autismo", - "autoria", - "autuar", - "avaliar", - "avante", - "avaria", - "avental", - "avesso", - "aviador", - "avisar", - "avulso", - "axila", - "azarar", - "azedo", - "azeite", - "azulejo", - "babar", - "babosa", - "bacalhau", - "bacharel", - "bacia", - "bagagem", - "baiano", - "bailar", - "baioneta", - "bairro", - "baixista", - "bajular", - "baleia", - "baliza", - "balsa", - "banal", - "bandeira", - "banho", - "banir", - "banquete", - "barato", - "barbado", - "baronesa", - "barraca", - "barulho", - "baseado", - "bastante", - "batata", - "batedor", - "batida", - "batom", - "batucar", - "baunilha", - "beber", - "beijo", - "beirada", - "beisebol", - "beldade", - "beleza", - "belga", - "beliscar", - "bendito", - "bengala", - "benzer", - "berimbau", - "berlinda", - "berro", - "besouro", - "bexiga", - "bezerro", - "bico", - "bicudo", - "bienal", - "bifocal", - "bifurcar", - "bigorna", - "bilhete", - "bimestre", - "bimotor", - "biologia", - "biombo", - "biosfera", - "bipolar", - "birrento", - "biscoito", - "bisneto", - "bispo", - "bissexto", - "bitola", - "bizarro", - "blindado", - "bloco", - "bloquear", - "boato", - "bobagem", - "bocado", - "bocejo", - "bochecha", - "boicotar", - "bolada", - "boletim", - "bolha", - "bolo", - "bombeiro", - "bonde", - "boneco", - "bonita", - "borbulha", - "borda", - "boreal", - "borracha", - "bovino", - "boxeador", - "branco", - "brasa", - "braveza", - "breu", - "briga", - "brilho", - "brincar", - "broa", - "brochura", - "bronzear", - "broto", - "bruxo", - "bucha", - "budismo", - "bufar", - "bule", - "buraco", - "busca", - "busto", - "buzina", - "cabana", - "cabelo", - "cabide", - "cabo", - "cabrito", - "cacau", - "cacetada", - "cachorro", - "cacique", - "cadastro", - "cadeado", - "cafezal", - "caiaque", - "caipira", - "caixote", - "cajado", - "caju", - "calafrio", - "calcular", - "caldeira", - "calibrar", - "calmante", - "calota", - "camada", - "cambista", - "camisa", - "camomila", - "campanha", - "camuflar", - "canavial", - "cancelar", - "caneta", - "canguru", - "canhoto", - "canivete", - "canoa", - "cansado", - "cantar", - "canudo", - "capacho", - "capela", - "capinar", - "capotar", - "capricho", - "captador", - "capuz", - "caracol", - "carbono", - "cardeal", - "careca", - "carimbar", - "carneiro", - "carpete", - "carreira", - "cartaz", - "carvalho", - "casaco", - "casca", - "casebre", - "castelo", - "casulo", - "catarata", - "cativar", - "caule", - "causador", - "cautelar", - "cavalo", - "caverna", - "cebola", - "cedilha", - "cegonha", - "celebrar", - "celular", - "cenoura", - "censo", - "centeio", - "cercar", - "cerrado", - "certeiro", - "cerveja", - "cetim", - "cevada", - "chacota", - "chaleira", - "chamado", - "chapada", - "charme", - "chatice", - "chave", - "chefe", - "chegada", - "cheiro", - "cheque", - "chicote", - "chifre", - "chinelo", - "chocalho", - "chover", - "chumbo", - "chutar", - "chuva", - "cicatriz", - "ciclone", - "cidade", - "cidreira", - "ciente", - "cigana", - "cimento", - "cinto", - "cinza", - "ciranda", - "circuito", - "cirurgia", - "citar", - "clareza", - "clero", - "clicar", - "clone", - "clube", - "coado", - "coagir", - "cobaia", - "cobertor", - "cobrar", - "cocada", - "coelho", - "coentro", - "coeso", - "cogumelo", - "coibir", - "coifa", - "coiote", - "colar", - "coleira", - "colher", - "colidir", - "colmeia", - "colono", - "coluna", - "comando", - "combinar", - "comentar", - "comitiva", - "comover", - "complexo", - "comum", - "concha", - "condor", - "conectar", - "confuso", - "congelar", - "conhecer", - "conjugar", - "consumir", - "contrato", - "convite", - "cooperar", - "copeiro", - "copiador", - "copo", - "coquetel", - "coragem", - "cordial", - "corneta", - "coronha", - "corporal", - "correio", - "cortejo", - "coruja", - "corvo", - "cosseno", - "costela", - "cotonete", - "couro", - "couve", - "covil", - "cozinha", - "cratera", - "cravo", - "creche", - "credor", - "creme", - "crer", - "crespo", - "criada", - "criminal", - "crioulo", - "crise", - "criticar", - "crosta", - "crua", - "cruzeiro", - "cubano", - "cueca", - "cuidado", - "cujo", - "culatra", - "culminar", - "culpar", - "cultura", - "cumprir", - "cunhado", - "cupido", - "curativo", - "curral", - "cursar", - "curto", - "cuspir", - "custear", - "cutelo", - "damasco", - "datar", - "debater", - "debitar", - "deboche", - "debulhar", - "decalque", - "decimal", - "declive", - "decote", - "decretar", - "dedal", - "dedicado", - "deduzir", - "defesa", - "defumar", - "degelo", - "degrau", - "degustar", - "deitado", - "deixar", - "delator", - "delegado", - "delinear", - "delonga", - "demanda", - "demitir", - "demolido", - "dentista", - "depenado", - "depilar", - "depois", - "depressa", - "depurar", - "deriva", - "derramar", - "desafio", - "desbotar", - "descanso", - "desenho", - "desfiado", - "desgaste", - "desigual", - "deslize", - "desmamar", - "desova", - "despesa", - "destaque", - "desviar", - "detalhar", - "detentor", - "detonar", - "detrito", - "deusa", - "dever", - "devido", - "devotado", - "dezena", - "diagrama", - "dialeto", - "didata", - "difuso", - "digitar", - "dilatado", - "diluente", - "diminuir", - "dinastia", - "dinheiro", - "diocese", - "direto", - "discreta", - "disfarce", - "disparo", - "disquete", - "dissipar", - "distante", - "ditador", - "diurno", - "diverso", - "divisor", - "divulgar", - "dizer", - "dobrador", - "dolorido", - "domador", - "dominado", - "donativo", - "donzela", - "dormente", - "dorsal", - "dosagem", - "dourado", - "doutor", - "drenagem", - "drible", - "drogaria", - "duelar", - "duende", - "dueto", - "duplo", - "duquesa", - "durante", - "duvidoso", - "eclodir", - "ecoar", - "ecologia", - "edificar", - "edital", - "educado", - "efeito", - "efetivar", - "ejetar", - "elaborar", - "eleger", - "eleitor", - "elenco", - "elevador", - "eliminar", - "elogiar", - "embargo", - "embolado", - "embrulho", - "embutido", - "emenda", - "emergir", - "emissor", - "empatia", - "empenho", - "empinado", - "empolgar", - "emprego", - "empurrar", - "emulador", - "encaixe", - "encenado", - "enchente", - "encontro", - "endeusar", - "endossar", - "enfaixar", - "enfeite", - "enfim", - "engajado", - "engenho", - "englobar", - "engomado", - "engraxar", - "enguia", - "enjoar", - "enlatar", - "enquanto", - "enraizar", - "enrolado", - "enrugar", - "ensaio", - "enseada", - "ensino", - "ensopado", - "entanto", - "enteado", - "entidade", - "entortar", - "entrada", - "entulho", - "envergar", - "enviado", - "envolver", - "enxame", - "enxerto", - "enxofre", - "enxuto", - "epiderme", - "equipar", - "ereto", - "erguido", - "errata", - "erva", - "ervilha", - "esbanjar", - "esbelto", - "escama", - "escola", - "escrita", - "escuta", - "esfinge", - "esfolar", - "esfregar", - "esfumado", - "esgrima", - "esmalte", - "espanto", - "espelho", - "espiga", - "esponja", - "espreita", - "espumar", - "esquerda", - "estaca", - "esteira", - "esticar", - "estofado", - "estrela", - "estudo", - "esvaziar", - "etanol", - "etiqueta", - "euforia", - "europeu", - "evacuar", - "evaporar", - "evasivo", - "eventual", - "evidente", - "evoluir", - "exagero", - "exalar", - "examinar", - "exato", - "exausto", - "excesso", - "excitar", - "exclamar", - "executar", - "exemplo", - "exibir", - "exigente", - "exonerar", - "expandir", - "expelir", - "expirar", - "explanar", - "exposto", - "expresso", - "expulsar", - "externo", - "extinto", - "extrato", - "fabricar", - "fabuloso", - "faceta", - "facial", - "fada", - "fadiga", - "faixa", - "falar", - "falta", - "familiar", - "fandango", - "fanfarra", - "fantoche", - "fardado", - "farelo", - "farinha", - "farofa", - "farpa", - "fartura", - "fatia", - "fator", - "favorita", - "faxina", - "fazenda", - "fechado", - "feijoada", - "feirante", - "felino", - "feminino", - "fenda", - "feno", - "fera", - "feriado", - "ferrugem", - "ferver", - "festejar", - "fetal", - "feudal", - "fiapo", - "fibrose", - "ficar", - "ficheiro", - "figurado", - "fileira", - "filho", - "filme", - "filtrar", - "firmeza", - "fisgada", - "fissura", - "fita", - "fivela", - "fixador", - "fixo", - "flacidez", - "flamingo", - "flanela", - "flechada", - "flora", - "flutuar", - "fluxo", - "focal", - "focinho", - "fofocar", - "fogo", - "foguete", - "foice", - "folgado", - "folheto", - "forjar", - "formiga", - "forno", - "forte", - "fosco", - "fossa", - "fragata", - "fralda", - "frango", - "frasco", - "fraterno", - "freira", - "frente", - "fretar", - "frieza", - "friso", - "fritura", - "fronha", - "frustrar", - "fruteira", - "fugir", - "fulano", - "fuligem", - "fundar", - "fungo", - "funil", - "furador", - "furioso", - "futebol", - "gabarito", - "gabinete", - "gado", - "gaiato", - "gaiola", - "gaivota", - "galega", - "galho", - "galinha", - "galocha", - "ganhar", - "garagem", - "garfo", - "gargalo", - "garimpo", - "garoupa", - "garrafa", - "gasoduto", - "gasto", - "gata", - "gatilho", - "gaveta", - "gazela", - "gelado", - "geleia", - "gelo", - "gemada", - "gemer", - "gemido", - "generoso", - "gengiva", - "genial", - "genoma", - "genro", - "geologia", - "gerador", - "germinar", - "gesso", - "gestor", - "ginasta", - "gincana", - "gingado", - "girafa", - "girino", - "glacial", - "glicose", - "global", - "glorioso", - "goela", - "goiaba", - "golfe", - "golpear", - "gordura", - "gorjeta", - "gorro", - "gostoso", - "goteira", - "governar", - "gracejo", - "gradual", - "grafite", - "gralha", - "grampo", - "granada", - "gratuito", - "graveto", - "graxa", - "grego", - "grelhar", - "greve", - "grilo", - "grisalho", - "gritaria", - "grosso", - "grotesco", - "grudado", - "grunhido", - "gruta", - "guache", - "guarani", - "guaxinim", - "guerrear", - "guiar", - "guincho", - "guisado", - "gula", - "guloso", - "guru", - "habitar", - "harmonia", - "haste", - "haver", - "hectare", - "herdar", - "heresia", - "hesitar", - "hiato", - "hibernar", - "hidratar", - "hiena", - "hino", - "hipismo", - "hipnose", - "hipoteca", - "hoje", - "holofote", - "homem", - "honesto", - "honrado", - "hormonal", - "hospedar", - "humorado", - "iate", - "ideia", - "idoso", - "ignorado", - "igreja", - "iguana", - "ileso", - "ilha", - "iludido", - "iluminar", - "ilustrar", - "imagem", - "imediato", - "imenso", - "imersivo", - "iminente", - "imitador", - "imortal", - "impacto", - "impedir", - "implante", - "impor", - "imprensa", - "impune", - "imunizar", - "inalador", - "inapto", - "inativo", - "incenso", - "inchar", - "incidir", - "incluir", - "incolor", - "indeciso", - "indireto", - "indutor", - "ineficaz", - "inerente", - "infantil", - "infestar", - "infinito", - "inflamar", - "informal", - "infrator", - "ingerir", - "inibido", - "inicial", - "inimigo", - "injetar", - "inocente", - "inodoro", - "inovador", - "inox", - "inquieto", - "inscrito", - "inseto", - "insistir", - "inspetor", - "instalar", - "insulto", - "intacto", - "integral", - "intimar", - "intocado", - "intriga", - "invasor", - "inverno", - "invicto", - "invocar", - "iogurte", - "iraniano", - "ironizar", - "irreal", - "irritado", - "isca", - "isento", - "isolado", - "isqueiro", - "italiano", - "janeiro", - "jangada", - "janta", - "jararaca", - "jardim", - "jarro", - "jasmim", - "jato", - "javali", - "jazida", - "jejum", - "joaninha", - "joelhada", - "jogador", - "joia", - "jornal", - "jorrar", - "jovem", - "juba", - "judeu", - "judoca", - "juiz", - "julgador", - "julho", - "jurado", - "jurista", - "juro", - "justa", - "labareda", - "laboral", - "lacre", - "lactante", - "ladrilho", - "lagarta", - "lagoa", - "laje", - "lamber", - "lamentar", - "laminar", - "lampejo", - "lanche", - "lapidar", - "lapso", - "laranja", - "lareira", - "largura", - "lasanha", - "lastro", - "lateral", - "latido", - "lavanda", - "lavoura", - "lavrador", - "laxante", - "lazer", - "lealdade", - "lebre", - "legado", - "legendar", - "legista", - "leigo", - "leiloar", - "leitura", - "lembrete", - "leme", - "lenhador", - "lentilha", - "leoa", - "lesma", - "leste", - "letivo", - "letreiro", - "levar", - "leveza", - "levitar", - "liberal", - "libido", - "liderar", - "ligar", - "ligeiro", - "limitar", - "limoeiro", - "limpador", - "linda", - "linear", - "linhagem", - "liquidez", - "listagem", - "lisura", - "litoral", - "livro", - "lixa", - "lixeira", - "locador", - "locutor", - "lojista", - "lombo", - "lona", - "longe", - "lontra", - "lorde", - "lotado", - "loteria", - "loucura", - "lousa", - "louvar", - "luar", - "lucidez", - "lucro", - "luneta", - "lustre", - "lutador", - "luva", - "macaco", - "macete", - "machado", - "macio", - "madeira", - "madrinha", - "magnata", - "magreza", - "maior", - "mais", - "malandro", - "malha", - "malote", - "maluco", - "mamilo", - "mamoeiro", - "mamute", - "manada", - "mancha", - "mandato", - "manequim", - "manhoso", - "manivela", - "manobrar", - "mansa", - "manter", - "manusear", - "mapeado", - "maquinar", - "marcador", - "maresia", - "marfim", - "margem", - "marinho", - "marmita", - "maroto", - "marquise", - "marreco", - "martelo", - "marujo", - "mascote", - "masmorra", - "massagem", - "mastigar", - "matagal", - "materno", - "matinal", - "matutar", - "maxilar", - "medalha", - "medida", - "medusa", - "megafone", - "meiga", - "melancia", - "melhor", - "membro", - "memorial", - "menino", - "menos", - "mensagem", - "mental", - "merecer", - "mergulho", - "mesada", - "mesclar", - "mesmo", - "mesquita", - "mestre", - "metade", - "meteoro", - "metragem", - "mexer", - "mexicano", - "micro", - "migalha", - "migrar", - "milagre", - "milenar", - "milhar", - "mimado", - "minerar", - "minhoca", - "ministro", - "minoria", - "miolo", - "mirante", - "mirtilo", - "misturar", - "mocidade", - "moderno", - "modular", - "moeda", - "moer", - "moinho", - "moita", - "moldura", - "moleza", - "molho", - "molinete", - "molusco", - "montanha", - "moqueca", - "morango", - "morcego", - "mordomo", - "morena", - "mosaico", - "mosquete", - "mostarda", - "motel", - "motim", - "moto", - "motriz", - "muda", - "muito", - "mulata", - "mulher", - "multar", - "mundial", - "munido", - "muralha", - "murcho", - "muscular", - "museu", - "musical", - "nacional", - "nadador", - "naja", - "namoro", - "narina", - "narrado", - "nascer", - "nativa", - "natureza", - "navalha", - "navegar", - "navio", - "neblina", - "nebuloso", - "negativa", - "negociar", - "negrito", - "nervoso", - "neta", - "neural", - "nevasca", - "nevoeiro", - "ninar", - "ninho", - "nitidez", - "nivelar", - "nobreza", - "noite", - "noiva", - "nomear", - "nominal", - "nordeste", - "nortear", - "notar", - "noticiar", - "noturno", - "novelo", - "novilho", - "novo", - "nublado", - "nudez", - "numeral", - "nupcial", - "nutrir", - "nuvem", - "obcecado", - "obedecer", - "objetivo", - "obrigado", - "obscuro", - "obstetra", - "obter", - "obturar", - "ocidente", - "ocioso", - "ocorrer", - "oculista", - "ocupado", - "ofegante", - "ofensiva", - "oferenda", - "oficina", - "ofuscado", - "ogiva", - "olaria", - "oleoso", - "olhar", - "oliveira", - "ombro", - "omelete", - "omisso", - "omitir", - "ondulado", - "oneroso", - "ontem", - "opcional", - "operador", - "oponente", - "oportuno", - "oposto", - "orar", - "orbitar", - "ordem", - "ordinal", - "orfanato", - "orgasmo", - "orgulho", - "oriental", - "origem", - "oriundo", - "orla", - "ortodoxo", - "orvalho", - "oscilar", - "ossada", - "osso", - "ostentar", - "otimismo", - "ousadia", - "outono", - "outubro", - "ouvido", - "ovelha", - "ovular", - "oxidar", - "oxigenar", - "pacato", - "paciente", - "pacote", - "pactuar", - "padaria", - "padrinho", - "pagar", - "pagode", - "painel", - "pairar", - "paisagem", - "palavra", - "palestra", - "palheta", - "palito", - "palmada", - "palpitar", - "pancada", - "panela", - "panfleto", - "panqueca", - "pantanal", - "papagaio", - "papelada", - "papiro", - "parafina", - "parcial", - "pardal", - "parede", - "partida", - "pasmo", - "passado", - "pastel", - "patamar", - "patente", - "patinar", - "patrono", - "paulada", - "pausar", - "peculiar", - "pedalar", - "pedestre", - "pediatra", - "pedra", - "pegada", - "peitoral", - "peixe", - "pele", - "pelicano", - "penca", - "pendurar", - "peneira", - "penhasco", - "pensador", - "pente", - "perceber", - "perfeito", - "pergunta", - "perito", - "permitir", - "perna", - "perplexo", - "persiana", - "pertence", - "peruca", - "pescado", - "pesquisa", - "pessoa", - "petiscar", - "piada", - "picado", - "piedade", - "pigmento", - "pilastra", - "pilhado", - "pilotar", - "pimenta", - "pincel", - "pinguim", - "pinha", - "pinote", - "pintar", - "pioneiro", - "pipoca", - "piquete", - "piranha", - "pires", - "pirueta", - "piscar", - "pistola", - "pitanga", - "pivete", - "planta", - "plaqueta", - "platina", - "plebeu", - "plumagem", - "pluvial", - "pneu", - "poda", - "poeira", - "poetisa", - "polegada", - "policiar", - "poluente", - "polvilho", - "pomar", - "pomba", - "ponderar", - "pontaria", - "populoso", - "porta", - "possuir", - "postal", - "pote", - "poupar", - "pouso", - "povoar", - "praia", - "prancha", - "prato", - "praxe", - "prece", - "predador", - "prefeito", - "premiar", - "prensar", - "preparar", - "presilha", - "pretexto", - "prevenir", - "prezar", - "primata", - "princesa", - "prisma", - "privado", - "processo", - "produto", - "profeta", - "proibido", - "projeto", - "prometer", - "propagar", - "prosa", - "protetor", - "provador", - "publicar", - "pudim", - "pular", - "pulmonar", - "pulseira", - "punhal", - "punir", - "pupilo", - "pureza", - "puxador", - "quadra", - "quantia", - "quarto", - "quase", - "quebrar", - "queda", - "queijo", - "quente", - "querido", - "quimono", - "quina", - "quiosque", - "rabanada", - "rabisco", - "rachar", - "racionar", - "radial", - "raiar", - "rainha", - "raio", - "raiva", - "rajada", - "ralado", - "ramal", - "ranger", - "ranhura", - "rapadura", - "rapel", - "rapidez", - "raposa", - "raquete", - "raridade", - "rasante", - "rascunho", - "rasgar", - "raspador", - "rasteira", - "rasurar", - "ratazana", - "ratoeira", - "realeza", - "reanimar", - "reaver", - "rebaixar", - "rebelde", - "rebolar", - "recado", - "recente", - "recheio", - "recibo", - "recordar", - "recrutar", - "recuar", - "rede", - "redimir", - "redonda", - "reduzida", - "reenvio", - "refinar", - "refletir", - "refogar", - "refresco", - "refugiar", - "regalia", - "regime", - "regra", - "reinado", - "reitor", - "rejeitar", - "relativo", - "remador", - "remendo", - "remorso", - "renovado", - "reparo", - "repelir", - "repleto", - "repolho", - "represa", - "repudiar", - "requerer", - "resenha", - "resfriar", - "resgatar", - "residir", - "resolver", - "respeito", - "ressaca", - "restante", - "resumir", - "retalho", - "reter", - "retirar", - "retomada", - "retratar", - "revelar", - "revisor", - "revolta", - "riacho", - "rica", - "rigidez", - "rigoroso", - "rimar", - "ringue", - "risada", - "risco", - "risonho", - "robalo", - "rochedo", - "rodada", - "rodeio", - "rodovia", - "roedor", - "roleta", - "romano", - "roncar", - "rosado", - "roseira", - "rosto", - "rota", - "roteiro", - "rotina", - "rotular", - "rouco", - "roupa", - "roxo", - "rubro", - "rugido", - "rugoso", - "ruivo", - "rumo", - "rupestre", - "russo", - "sabor", - "saciar", - "sacola", - "sacudir", - "sadio", - "safira", - "saga", - "sagrada", - "saibro", - "salada", - "saleiro", - "salgado", - "saliva", - "salpicar", - "salsicha", - "saltar", - "salvador", - "sambar", - "samurai", - "sanar", - "sanfona", - "sangue", - "sanidade", - "sapato", - "sarda", - "sargento", - "sarjeta", - "saturar", - "saudade", - "saxofone", - "sazonal", - "secar", - "secular", - "seda", - "sedento", - "sediado", - "sedoso", - "sedutor", - "segmento", - "segredo", - "segundo", - "seiva", - "seleto", - "selvagem", - "semanal", - "semente", - "senador", - "senhor", - "sensual", - "sentado", - "separado", - "sereia", - "seringa", - "serra", - "servo", - "setembro", - "setor", - "sigilo", - "silhueta", - "silicone", - "simetria", - "simpatia", - "simular", - "sinal", - "sincero", - "singular", - "sinopse", - "sintonia", - "sirene", - "siri", - "situado", - "soberano", - "sobra", - "socorro", - "sogro", - "soja", - "solda", - "soletrar", - "solteiro", - "sombrio", - "sonata", - "sondar", - "sonegar", - "sonhador", - "sono", - "soprano", - "soquete", - "sorrir", - "sorteio", - "sossego", - "sotaque", - "soterrar", - "sovado", - "sozinho", - "suavizar", - "subida", - "submerso", - "subsolo", - "subtrair", - "sucata", - "sucesso", - "suco", - "sudeste", - "sufixo", - "sugador", - "sugerir", - "sujeito", - "sulfato", - "sumir", - "suor", - "superior", - "suplicar", - "suposto", - "suprimir", - "surdina", - "surfista", - "surpresa", - "surreal", - "surtir", - "suspiro", - "sustento", - "tabela", - "tablete", - "tabuada", - "tacho", - "tagarela", - "talher", - "talo", - "talvez", - "tamanho", - "tamborim", - "tampa", - "tangente", - "tanto", - "tapar", - "tapioca", - "tardio", - "tarefa", - "tarja", - "tarraxa", - "tatuagem", - "taurino", - "taxativo", - "taxista", - "teatral", - "tecer", - "tecido", - "teclado", - "tedioso", - "teia", - "teimar", - "telefone", - "telhado", - "tempero", - "tenente", - "tensor", - "tentar", - "termal", - "terno", - "terreno", - "tese", - "tesoura", - "testado", - "teto", - "textura", - "texugo", - "tiara", - "tigela", - "tijolo", - "timbrar", - "timidez", - "tingido", - "tinteiro", - "tiragem", - "titular", - "toalha", - "tocha", - "tolerar", - "tolice", - "tomada", - "tomilho", - "tonel", - "tontura", - "topete", - "tora", - "torcido", - "torneio", - "torque", - "torrada", - "torto", - "tostar", - "touca", - "toupeira", - "toxina", - "trabalho", - "tracejar", - "tradutor", - "trafegar", - "trajeto", - "trama", - "trancar", - "trapo", - "traseiro", - "tratador", - "travar", - "treino", - "tremer", - "trepidar", - "trevo", - "triagem", - "tribo", - "triciclo", - "tridente", - "trilogia", - "trindade", - "triplo", - "triturar", - "triunfal", - "trocar", - "trombeta", - "trova", - "trunfo", - "truque", - "tubular", - "tucano", - "tudo", - "tulipa", - "tupi", - "turbo", - "turma", - "turquesa", - "tutelar", - "tutorial", - "uivar", - "umbigo", - "unha", - "unidade", - "uniforme", - "urologia", - "urso", - "urtiga", - "urubu", - "usado", - "usina", - "usufruir", - "vacina", - "vadiar", - "vagaroso", - "vaidoso", - "vala", - "valente", - "validade", - "valores", - "vantagem", - "vaqueiro", - "varanda", - "vareta", - "varrer", - "vascular", - "vasilha", - "vassoura", - "vazar", - "vazio", - "veado", - "vedar", - "vegetar", - "veicular", - "veleiro", - "velhice", - "veludo", - "vencedor", - "vendaval", - "venerar", - "ventre", - "verbal", - "verdade", - "vereador", - "vergonha", - "vermelho", - "verniz", - "versar", - "vertente", - "vespa", - "vestido", - "vetorial", - "viaduto", - "viagem", - "viajar", - "viatura", - "vibrador", - "videira", - "vidraria", - "viela", - "viga", - "vigente", - "vigiar", - "vigorar", - "vilarejo", - "vinco", - "vinheta", - "vinil", - "violeta", - "virada", - "virtude", - "visitar", - "visto", - "vitral", - "viveiro", - "vizinho", - "voador", - "voar", - "vogal", - "volante", - "voleibol", - "voltagem", - "volumoso", - "vontade", - "vulto", - "vuvuzela", - "xadrez", - "xarope", - "xeque", - "xeretar", - "xerife", - "xingar", - "zangado", - "zarpar", - "zebu", - "zelador", - "zombar", - "zoologia", - "zumbido" -] diff --git a/tools/mnemonic-test/node_modules/bip39/src/wordlists/spanish.json b/tools/mnemonic-test/node_modules/bip39/src/wordlists/spanish.json deleted file mode 100644 index 41c0d4ff..00000000 --- a/tools/mnemonic-test/node_modules/bip39/src/wordlists/spanish.json +++ /dev/null @@ -1,2050 +0,0 @@ -[ - "ábaco", - "abdomen", - "abeja", - "abierto", - "abogado", - "abono", - "aborto", - "abrazo", - "abrir", - "abuelo", - "abuso", - "acabar", - "academia", - "acceso", - "acción", - "aceite", - "acelga", - "acento", - "aceptar", - "ácido", - "aclarar", - "acné", - "acoger", - "acoso", - "activo", - "acto", - "actriz", - "actuar", - "acudir", - "acuerdo", - "acusar", - "adicto", - "admitir", - "adoptar", - "adorno", - "aduana", - "adulto", - "aéreo", - "afectar", - "afición", - "afinar", - "afirmar", - "ágil", - "agitar", - "agonía", - "agosto", - "agotar", - "agregar", - "agrio", - "agua", - "agudo", - "águila", - "aguja", - "ahogo", - "ahorro", - "aire", - "aislar", - "ajedrez", - "ajeno", - "ajuste", - "alacrán", - "alambre", - "alarma", - "alba", - "álbum", - "alcalde", - "aldea", - "alegre", - "alejar", - "alerta", - "aleta", - "alfiler", - "alga", - "algodón", - "aliado", - "aliento", - "alivio", - "alma", - "almeja", - "almíbar", - "altar", - "alteza", - "altivo", - "alto", - "altura", - "alumno", - "alzar", - "amable", - "amante", - "amapola", - "amargo", - "amasar", - "ámbar", - "ámbito", - "ameno", - "amigo", - "amistad", - "amor", - "amparo", - "amplio", - "ancho", - "anciano", - "ancla", - "andar", - "andén", - "anemia", - "ángulo", - "anillo", - "ánimo", - "anís", - "anotar", - "antena", - "antiguo", - "antojo", - "anual", - "anular", - "anuncio", - "añadir", - "añejo", - "año", - "apagar", - "aparato", - "apetito", - "apio", - "aplicar", - "apodo", - "aporte", - "apoyo", - "aprender", - "aprobar", - "apuesta", - "apuro", - "arado", - "araña", - "arar", - "árbitro", - "árbol", - "arbusto", - "archivo", - "arco", - "arder", - "ardilla", - "arduo", - "área", - "árido", - "aries", - "armonía", - "arnés", - "aroma", - "arpa", - "arpón", - "arreglo", - "arroz", - "arruga", - "arte", - "artista", - "asa", - "asado", - "asalto", - "ascenso", - "asegurar", - "aseo", - "asesor", - "asiento", - "asilo", - "asistir", - "asno", - "asombro", - "áspero", - "astilla", - "astro", - "astuto", - "asumir", - "asunto", - "atajo", - "ataque", - "atar", - "atento", - "ateo", - "ático", - "atleta", - "átomo", - "atraer", - "atroz", - "atún", - "audaz", - "audio", - "auge", - "aula", - "aumento", - "ausente", - "autor", - "aval", - "avance", - "avaro", - "ave", - "avellana", - "avena", - "avestruz", - "avión", - "aviso", - "ayer", - "ayuda", - "ayuno", - "azafrán", - "azar", - "azote", - "azúcar", - "azufre", - "azul", - "baba", - "babor", - "bache", - "bahía", - "baile", - "bajar", - "balanza", - "balcón", - "balde", - "bambú", - "banco", - "banda", - "baño", - "barba", - "barco", - "barniz", - "barro", - "báscula", - "bastón", - "basura", - "batalla", - "batería", - "batir", - "batuta", - "baúl", - "bazar", - "bebé", - "bebida", - "bello", - "besar", - "beso", - "bestia", - "bicho", - "bien", - "bingo", - "blanco", - "bloque", - "blusa", - "boa", - "bobina", - "bobo", - "boca", - "bocina", - "boda", - "bodega", - "boina", - "bola", - "bolero", - "bolsa", - "bomba", - "bondad", - "bonito", - "bono", - "bonsái", - "borde", - "borrar", - "bosque", - "bote", - "botín", - "bóveda", - "bozal", - "bravo", - "brazo", - "brecha", - "breve", - "brillo", - "brinco", - "brisa", - "broca", - "broma", - "bronce", - "brote", - "bruja", - "brusco", - "bruto", - "buceo", - "bucle", - "bueno", - "buey", - "bufanda", - "bufón", - "búho", - "buitre", - "bulto", - "burbuja", - "burla", - "burro", - "buscar", - "butaca", - "buzón", - "caballo", - "cabeza", - "cabina", - "cabra", - "cacao", - "cadáver", - "cadena", - "caer", - "café", - "caída", - "caimán", - "caja", - "cajón", - "cal", - "calamar", - "calcio", - "caldo", - "calidad", - "calle", - "calma", - "calor", - "calvo", - "cama", - "cambio", - "camello", - "camino", - "campo", - "cáncer", - "candil", - "canela", - "canguro", - "canica", - "canto", - "caña", - "cañón", - "caoba", - "caos", - "capaz", - "capitán", - "capote", - "captar", - "capucha", - "cara", - "carbón", - "cárcel", - "careta", - "carga", - "cariño", - "carne", - "carpeta", - "carro", - "carta", - "casa", - "casco", - "casero", - "caspa", - "castor", - "catorce", - "catre", - "caudal", - "causa", - "cazo", - "cebolla", - "ceder", - "cedro", - "celda", - "célebre", - "celoso", - "célula", - "cemento", - "ceniza", - "centro", - "cerca", - "cerdo", - "cereza", - "cero", - "cerrar", - "certeza", - "césped", - "cetro", - "chacal", - "chaleco", - "champú", - "chancla", - "chapa", - "charla", - "chico", - "chiste", - "chivo", - "choque", - "choza", - "chuleta", - "chupar", - "ciclón", - "ciego", - "cielo", - "cien", - "cierto", - "cifra", - "cigarro", - "cima", - "cinco", - "cine", - "cinta", - "ciprés", - "circo", - "ciruela", - "cisne", - "cita", - "ciudad", - "clamor", - "clan", - "claro", - "clase", - "clave", - "cliente", - "clima", - "clínica", - "cobre", - "cocción", - "cochino", - "cocina", - "coco", - "código", - "codo", - "cofre", - "coger", - "cohete", - "cojín", - "cojo", - "cola", - "colcha", - "colegio", - "colgar", - "colina", - "collar", - "colmo", - "columna", - "combate", - "comer", - "comida", - "cómodo", - "compra", - "conde", - "conejo", - "conga", - "conocer", - "consejo", - "contar", - "copa", - "copia", - "corazón", - "corbata", - "corcho", - "cordón", - "corona", - "correr", - "coser", - "cosmos", - "costa", - "cráneo", - "cráter", - "crear", - "crecer", - "creído", - "crema", - "cría", - "crimen", - "cripta", - "crisis", - "cromo", - "crónica", - "croqueta", - "crudo", - "cruz", - "cuadro", - "cuarto", - "cuatro", - "cubo", - "cubrir", - "cuchara", - "cuello", - "cuento", - "cuerda", - "cuesta", - "cueva", - "cuidar", - "culebra", - "culpa", - "culto", - "cumbre", - "cumplir", - "cuna", - "cuneta", - "cuota", - "cupón", - "cúpula", - "curar", - "curioso", - "curso", - "curva", - "cutis", - "dama", - "danza", - "dar", - "dardo", - "dátil", - "deber", - "débil", - "década", - "decir", - "dedo", - "defensa", - "definir", - "dejar", - "delfín", - "delgado", - "delito", - "demora", - "denso", - "dental", - "deporte", - "derecho", - "derrota", - "desayuno", - "deseo", - "desfile", - "desnudo", - "destino", - "desvío", - "detalle", - "detener", - "deuda", - "día", - "diablo", - "diadema", - "diamante", - "diana", - "diario", - "dibujo", - "dictar", - "diente", - "dieta", - "diez", - "difícil", - "digno", - "dilema", - "diluir", - "dinero", - "directo", - "dirigir", - "disco", - "diseño", - "disfraz", - "diva", - "divino", - "doble", - "doce", - "dolor", - "domingo", - "don", - "donar", - "dorado", - "dormir", - "dorso", - "dos", - "dosis", - "dragón", - "droga", - "ducha", - "duda", - "duelo", - "dueño", - "dulce", - "dúo", - "duque", - "durar", - "dureza", - "duro", - "ébano", - "ebrio", - "echar", - "eco", - "ecuador", - "edad", - "edición", - "edificio", - "editor", - "educar", - "efecto", - "eficaz", - "eje", - "ejemplo", - "elefante", - "elegir", - "elemento", - "elevar", - "elipse", - "élite", - "elixir", - "elogio", - "eludir", - "embudo", - "emitir", - "emoción", - "empate", - "empeño", - "empleo", - "empresa", - "enano", - "encargo", - "enchufe", - "encía", - "enemigo", - "enero", - "enfado", - "enfermo", - "engaño", - "enigma", - "enlace", - "enorme", - "enredo", - "ensayo", - "enseñar", - "entero", - "entrar", - "envase", - "envío", - "época", - "equipo", - "erizo", - "escala", - "escena", - "escolar", - "escribir", - "escudo", - "esencia", - "esfera", - "esfuerzo", - "espada", - "espejo", - "espía", - "esposa", - "espuma", - "esquí", - "estar", - "este", - "estilo", - "estufa", - "etapa", - "eterno", - "ética", - "etnia", - "evadir", - "evaluar", - "evento", - "evitar", - "exacto", - "examen", - "exceso", - "excusa", - "exento", - "exigir", - "exilio", - "existir", - "éxito", - "experto", - "explicar", - "exponer", - "extremo", - "fábrica", - "fábula", - "fachada", - "fácil", - "factor", - "faena", - "faja", - "falda", - "fallo", - "falso", - "faltar", - "fama", - "familia", - "famoso", - "faraón", - "farmacia", - "farol", - "farsa", - "fase", - "fatiga", - "fauna", - "favor", - "fax", - "febrero", - "fecha", - "feliz", - "feo", - "feria", - "feroz", - "fértil", - "fervor", - "festín", - "fiable", - "fianza", - "fiar", - "fibra", - "ficción", - "ficha", - "fideo", - "fiebre", - "fiel", - "fiera", - "fiesta", - "figura", - "fijar", - "fijo", - "fila", - "filete", - "filial", - "filtro", - "fin", - "finca", - "fingir", - "finito", - "firma", - "flaco", - "flauta", - "flecha", - "flor", - "flota", - "fluir", - "flujo", - "flúor", - "fobia", - "foca", - "fogata", - "fogón", - "folio", - "folleto", - "fondo", - "forma", - "forro", - "fortuna", - "forzar", - "fosa", - "foto", - "fracaso", - "frágil", - "franja", - "frase", - "fraude", - "freír", - "freno", - "fresa", - "frío", - "frito", - "fruta", - "fuego", - "fuente", - "fuerza", - "fuga", - "fumar", - "función", - "funda", - "furgón", - "furia", - "fusil", - "fútbol", - "futuro", - "gacela", - "gafas", - "gaita", - "gajo", - "gala", - "galería", - "gallo", - "gamba", - "ganar", - "gancho", - "ganga", - "ganso", - "garaje", - "garza", - "gasolina", - "gastar", - "gato", - "gavilán", - "gemelo", - "gemir", - "gen", - "género", - "genio", - "gente", - "geranio", - "gerente", - "germen", - "gesto", - "gigante", - "gimnasio", - "girar", - "giro", - "glaciar", - "globo", - "gloria", - "gol", - "golfo", - "goloso", - "golpe", - "goma", - "gordo", - "gorila", - "gorra", - "gota", - "goteo", - "gozar", - "grada", - "gráfico", - "grano", - "grasa", - "gratis", - "grave", - "grieta", - "grillo", - "gripe", - "gris", - "grito", - "grosor", - "grúa", - "grueso", - "grumo", - "grupo", - "guante", - "guapo", - "guardia", - "guerra", - "guía", - "guiño", - "guion", - "guiso", - "guitarra", - "gusano", - "gustar", - "haber", - "hábil", - "hablar", - "hacer", - "hacha", - "hada", - "hallar", - "hamaca", - "harina", - "haz", - "hazaña", - "hebilla", - "hebra", - "hecho", - "helado", - "helio", - "hembra", - "herir", - "hermano", - "héroe", - "hervir", - "hielo", - "hierro", - "hígado", - "higiene", - "hijo", - "himno", - "historia", - "hocico", - "hogar", - "hoguera", - "hoja", - "hombre", - "hongo", - "honor", - "honra", - "hora", - "hormiga", - "horno", - "hostil", - "hoyo", - "hueco", - "huelga", - "huerta", - "hueso", - "huevo", - "huida", - "huir", - "humano", - "húmedo", - "humilde", - "humo", - "hundir", - "huracán", - "hurto", - "icono", - "ideal", - "idioma", - "ídolo", - "iglesia", - "iglú", - "igual", - "ilegal", - "ilusión", - "imagen", - "imán", - "imitar", - "impar", - "imperio", - "imponer", - "impulso", - "incapaz", - "índice", - "inerte", - "infiel", - "informe", - "ingenio", - "inicio", - "inmenso", - "inmune", - "innato", - "insecto", - "instante", - "interés", - "íntimo", - "intuir", - "inútil", - "invierno", - "ira", - "iris", - "ironía", - "isla", - "islote", - "jabalí", - "jabón", - "jamón", - "jarabe", - "jardín", - "jarra", - "jaula", - "jazmín", - "jefe", - "jeringa", - "jinete", - "jornada", - "joroba", - "joven", - "joya", - "juerga", - "jueves", - "juez", - "jugador", - "jugo", - "juguete", - "juicio", - "junco", - "jungla", - "junio", - "juntar", - "júpiter", - "jurar", - "justo", - "juvenil", - "juzgar", - "kilo", - "koala", - "labio", - "lacio", - "lacra", - "lado", - "ladrón", - "lagarto", - "lágrima", - "laguna", - "laico", - "lamer", - "lámina", - "lámpara", - "lana", - "lancha", - "langosta", - "lanza", - "lápiz", - "largo", - "larva", - "lástima", - "lata", - "látex", - "latir", - "laurel", - "lavar", - "lazo", - "leal", - "lección", - "leche", - "lector", - "leer", - "legión", - "legumbre", - "lejano", - "lengua", - "lento", - "leña", - "león", - "leopardo", - "lesión", - "letal", - "letra", - "leve", - "leyenda", - "libertad", - "libro", - "licor", - "líder", - "lidiar", - "lienzo", - "liga", - "ligero", - "lima", - "límite", - "limón", - "limpio", - "lince", - "lindo", - "línea", - "lingote", - "lino", - "linterna", - "líquido", - "liso", - "lista", - "litera", - "litio", - "litro", - "llaga", - "llama", - "llanto", - "llave", - "llegar", - "llenar", - "llevar", - "llorar", - "llover", - "lluvia", - "lobo", - "loción", - "loco", - "locura", - "lógica", - "logro", - "lombriz", - "lomo", - "lonja", - "lote", - "lucha", - "lucir", - "lugar", - "lujo", - "luna", - "lunes", - "lupa", - "lustro", - "luto", - "luz", - "maceta", - "macho", - "madera", - "madre", - "maduro", - "maestro", - "mafia", - "magia", - "mago", - "maíz", - "maldad", - "maleta", - "malla", - "malo", - "mamá", - "mambo", - "mamut", - "manco", - "mando", - "manejar", - "manga", - "maniquí", - "manjar", - "mano", - "manso", - "manta", - "mañana", - "mapa", - "máquina", - "mar", - "marco", - "marea", - "marfil", - "margen", - "marido", - "mármol", - "marrón", - "martes", - "marzo", - "masa", - "máscara", - "masivo", - "matar", - "materia", - "matiz", - "matriz", - "máximo", - "mayor", - "mazorca", - "mecha", - "medalla", - "medio", - "médula", - "mejilla", - "mejor", - "melena", - "melón", - "memoria", - "menor", - "mensaje", - "mente", - "menú", - "mercado", - "merengue", - "mérito", - "mes", - "mesón", - "meta", - "meter", - "método", - "metro", - "mezcla", - "miedo", - "miel", - "miembro", - "miga", - "mil", - "milagro", - "militar", - "millón", - "mimo", - "mina", - "minero", - "mínimo", - "minuto", - "miope", - "mirar", - "misa", - "miseria", - "misil", - "mismo", - "mitad", - "mito", - "mochila", - "moción", - "moda", - "modelo", - "moho", - "mojar", - "molde", - "moler", - "molino", - "momento", - "momia", - "monarca", - "moneda", - "monja", - "monto", - "moño", - "morada", - "morder", - "moreno", - "morir", - "morro", - "morsa", - "mortal", - "mosca", - "mostrar", - "motivo", - "mover", - "móvil", - "mozo", - "mucho", - "mudar", - "mueble", - "muela", - "muerte", - "muestra", - "mugre", - "mujer", - "mula", - "muleta", - "multa", - "mundo", - "muñeca", - "mural", - "muro", - "músculo", - "museo", - "musgo", - "música", - "muslo", - "nácar", - "nación", - "nadar", - "naipe", - "naranja", - "nariz", - "narrar", - "nasal", - "natal", - "nativo", - "natural", - "náusea", - "naval", - "nave", - "navidad", - "necio", - "néctar", - "negar", - "negocio", - "negro", - "neón", - "nervio", - "neto", - "neutro", - "nevar", - "nevera", - "nicho", - "nido", - "niebla", - "nieto", - "niñez", - "niño", - "nítido", - "nivel", - "nobleza", - "noche", - "nómina", - "noria", - "norma", - "norte", - "nota", - "noticia", - "novato", - "novela", - "novio", - "nube", - "nuca", - "núcleo", - "nudillo", - "nudo", - "nuera", - "nueve", - "nuez", - "nulo", - "número", - "nutria", - "oasis", - "obeso", - "obispo", - "objeto", - "obra", - "obrero", - "observar", - "obtener", - "obvio", - "oca", - "ocaso", - "océano", - "ochenta", - "ocho", - "ocio", - "ocre", - "octavo", - "octubre", - "oculto", - "ocupar", - "ocurrir", - "odiar", - "odio", - "odisea", - "oeste", - "ofensa", - "oferta", - "oficio", - "ofrecer", - "ogro", - "oído", - "oír", - "ojo", - "ola", - "oleada", - "olfato", - "olivo", - "olla", - "olmo", - "olor", - "olvido", - "ombligo", - "onda", - "onza", - "opaco", - "opción", - "ópera", - "opinar", - "oponer", - "optar", - "óptica", - "opuesto", - "oración", - "orador", - "oral", - "órbita", - "orca", - "orden", - "oreja", - "órgano", - "orgía", - "orgullo", - "oriente", - "origen", - "orilla", - "oro", - "orquesta", - "oruga", - "osadía", - "oscuro", - "osezno", - "oso", - "ostra", - "otoño", - "otro", - "oveja", - "óvulo", - "óxido", - "oxígeno", - "oyente", - "ozono", - "pacto", - "padre", - "paella", - "página", - "pago", - "país", - "pájaro", - "palabra", - "palco", - "paleta", - "pálido", - "palma", - "paloma", - "palpar", - "pan", - "panal", - "pánico", - "pantera", - "pañuelo", - "papá", - "papel", - "papilla", - "paquete", - "parar", - "parcela", - "pared", - "parir", - "paro", - "párpado", - "parque", - "párrafo", - "parte", - "pasar", - "paseo", - "pasión", - "paso", - "pasta", - "pata", - "patio", - "patria", - "pausa", - "pauta", - "pavo", - "payaso", - "peatón", - "pecado", - "pecera", - "pecho", - "pedal", - "pedir", - "pegar", - "peine", - "pelar", - "peldaño", - "pelea", - "peligro", - "pellejo", - "pelo", - "peluca", - "pena", - "pensar", - "peñón", - "peón", - "peor", - "pepino", - "pequeño", - "pera", - "percha", - "perder", - "pereza", - "perfil", - "perico", - "perla", - "permiso", - "perro", - "persona", - "pesa", - "pesca", - "pésimo", - "pestaña", - "pétalo", - "petróleo", - "pez", - "pezuña", - "picar", - "pichón", - "pie", - "piedra", - "pierna", - "pieza", - "pijama", - "pilar", - "piloto", - "pimienta", - "pino", - "pintor", - "pinza", - "piña", - "piojo", - "pipa", - "pirata", - "pisar", - "piscina", - "piso", - "pista", - "pitón", - "pizca", - "placa", - "plan", - "plata", - "playa", - "plaza", - "pleito", - "pleno", - "plomo", - "pluma", - "plural", - "pobre", - "poco", - "poder", - "podio", - "poema", - "poesía", - "poeta", - "polen", - "policía", - "pollo", - "polvo", - "pomada", - "pomelo", - "pomo", - "pompa", - "poner", - "porción", - "portal", - "posada", - "poseer", - "posible", - "poste", - "potencia", - "potro", - "pozo", - "prado", - "precoz", - "pregunta", - "premio", - "prensa", - "preso", - "previo", - "primo", - "príncipe", - "prisión", - "privar", - "proa", - "probar", - "proceso", - "producto", - "proeza", - "profesor", - "programa", - "prole", - "promesa", - "pronto", - "propio", - "próximo", - "prueba", - "público", - "puchero", - "pudor", - "pueblo", - "puerta", - "puesto", - "pulga", - "pulir", - "pulmón", - "pulpo", - "pulso", - "puma", - "punto", - "puñal", - "puño", - "pupa", - "pupila", - "puré", - "quedar", - "queja", - "quemar", - "querer", - "queso", - "quieto", - "química", - "quince", - "quitar", - "rábano", - "rabia", - "rabo", - "ración", - "radical", - "raíz", - "rama", - "rampa", - "rancho", - "rango", - "rapaz", - "rápido", - "rapto", - "rasgo", - "raspa", - "rato", - "rayo", - "raza", - "razón", - "reacción", - "realidad", - "rebaño", - "rebote", - "recaer", - "receta", - "rechazo", - "recoger", - "recreo", - "recto", - "recurso", - "red", - "redondo", - "reducir", - "reflejo", - "reforma", - "refrán", - "refugio", - "regalo", - "regir", - "regla", - "regreso", - "rehén", - "reino", - "reír", - "reja", - "relato", - "relevo", - "relieve", - "relleno", - "reloj", - "remar", - "remedio", - "remo", - "rencor", - "rendir", - "renta", - "reparto", - "repetir", - "reposo", - "reptil", - "res", - "rescate", - "resina", - "respeto", - "resto", - "resumen", - "retiro", - "retorno", - "retrato", - "reunir", - "revés", - "revista", - "rey", - "rezar", - "rico", - "riego", - "rienda", - "riesgo", - "rifa", - "rígido", - "rigor", - "rincón", - "riñón", - "río", - "riqueza", - "risa", - "ritmo", - "rito", - "rizo", - "roble", - "roce", - "rociar", - "rodar", - "rodeo", - "rodilla", - "roer", - "rojizo", - "rojo", - "romero", - "romper", - "ron", - "ronco", - "ronda", - "ropa", - "ropero", - "rosa", - "rosca", - "rostro", - "rotar", - "rubí", - "rubor", - "rudo", - "rueda", - "rugir", - "ruido", - "ruina", - "ruleta", - "rulo", - "rumbo", - "rumor", - "ruptura", - "ruta", - "rutina", - "sábado", - "saber", - "sabio", - "sable", - "sacar", - "sagaz", - "sagrado", - "sala", - "saldo", - "salero", - "salir", - "salmón", - "salón", - "salsa", - "salto", - "salud", - "salvar", - "samba", - "sanción", - "sandía", - "sanear", - "sangre", - "sanidad", - "sano", - "santo", - "sapo", - "saque", - "sardina", - "sartén", - "sastre", - "satán", - "sauna", - "saxofón", - "sección", - "seco", - "secreto", - "secta", - "sed", - "seguir", - "seis", - "sello", - "selva", - "semana", - "semilla", - "senda", - "sensor", - "señal", - "señor", - "separar", - "sepia", - "sequía", - "ser", - "serie", - "sermón", - "servir", - "sesenta", - "sesión", - "seta", - "setenta", - "severo", - "sexo", - "sexto", - "sidra", - "siesta", - "siete", - "siglo", - "signo", - "sílaba", - "silbar", - "silencio", - "silla", - "símbolo", - "simio", - "sirena", - "sistema", - "sitio", - "situar", - "sobre", - "socio", - "sodio", - "sol", - "solapa", - "soldado", - "soledad", - "sólido", - "soltar", - "solución", - "sombra", - "sondeo", - "sonido", - "sonoro", - "sonrisa", - "sopa", - "soplar", - "soporte", - "sordo", - "sorpresa", - "sorteo", - "sostén", - "sótano", - "suave", - "subir", - "suceso", - "sudor", - "suegra", - "suelo", - "sueño", - "suerte", - "sufrir", - "sujeto", - "sultán", - "sumar", - "superar", - "suplir", - "suponer", - "supremo", - "sur", - "surco", - "sureño", - "surgir", - "susto", - "sutil", - "tabaco", - "tabique", - "tabla", - "tabú", - "taco", - "tacto", - "tajo", - "talar", - "talco", - "talento", - "talla", - "talón", - "tamaño", - "tambor", - "tango", - "tanque", - "tapa", - "tapete", - "tapia", - "tapón", - "taquilla", - "tarde", - "tarea", - "tarifa", - "tarjeta", - "tarot", - "tarro", - "tarta", - "tatuaje", - "tauro", - "taza", - "tazón", - "teatro", - "techo", - "tecla", - "técnica", - "tejado", - "tejer", - "tejido", - "tela", - "teléfono", - "tema", - "temor", - "templo", - "tenaz", - "tender", - "tener", - "tenis", - "tenso", - "teoría", - "terapia", - "terco", - "término", - "ternura", - "terror", - "tesis", - "tesoro", - "testigo", - "tetera", - "texto", - "tez", - "tibio", - "tiburón", - "tiempo", - "tienda", - "tierra", - "tieso", - "tigre", - "tijera", - "tilde", - "timbre", - "tímido", - "timo", - "tinta", - "tío", - "típico", - "tipo", - "tira", - "tirón", - "titán", - "títere", - "título", - "tiza", - "toalla", - "tobillo", - "tocar", - "tocino", - "todo", - "toga", - "toldo", - "tomar", - "tono", - "tonto", - "topar", - "tope", - "toque", - "tórax", - "torero", - "tormenta", - "torneo", - "toro", - "torpedo", - "torre", - "torso", - "tortuga", - "tos", - "tosco", - "toser", - "tóxico", - "trabajo", - "tractor", - "traer", - "tráfico", - "trago", - "traje", - "tramo", - "trance", - "trato", - "trauma", - "trazar", - "trébol", - "tregua", - "treinta", - "tren", - "trepar", - "tres", - "tribu", - "trigo", - "tripa", - "triste", - "triunfo", - "trofeo", - "trompa", - "tronco", - "tropa", - "trote", - "trozo", - "truco", - "trueno", - "trufa", - "tubería", - "tubo", - "tuerto", - "tumba", - "tumor", - "túnel", - "túnica", - "turbina", - "turismo", - "turno", - "tutor", - "ubicar", - "úlcera", - "umbral", - "unidad", - "unir", - "universo", - "uno", - "untar", - "uña", - "urbano", - "urbe", - "urgente", - "urna", - "usar", - "usuario", - "útil", - "utopía", - "uva", - "vaca", - "vacío", - "vacuna", - "vagar", - "vago", - "vaina", - "vajilla", - "vale", - "válido", - "valle", - "valor", - "válvula", - "vampiro", - "vara", - "variar", - "varón", - "vaso", - "vecino", - "vector", - "vehículo", - "veinte", - "vejez", - "vela", - "velero", - "veloz", - "vena", - "vencer", - "venda", - "veneno", - "vengar", - "venir", - "venta", - "venus", - "ver", - "verano", - "verbo", - "verde", - "vereda", - "verja", - "verso", - "verter", - "vía", - "viaje", - "vibrar", - "vicio", - "víctima", - "vida", - "vídeo", - "vidrio", - "viejo", - "viernes", - "vigor", - "vil", - "villa", - "vinagre", - "vino", - "viñedo", - "violín", - "viral", - "virgo", - "virtud", - "visor", - "víspera", - "vista", - "vitamina", - "viudo", - "vivaz", - "vivero", - "vivir", - "vivo", - "volcán", - "volumen", - "volver", - "voraz", - "votar", - "voto", - "voz", - "vuelo", - "vulgar", - "yacer", - "yate", - "yegua", - "yema", - "yerno", - "yeso", - "yodo", - "yoga", - "yogur", - "zafiro", - "zanja", - "zapato", - "zarza", - "zona", - "zorro", - "zumo", - "zurdo" -] diff --git a/tools/mnemonic-test/node_modules/bip39/types/_wordlists.d.ts b/tools/mnemonic-test/node_modules/bip39/types/_wordlists.d.ts deleted file mode 100644 index 24269f95..00000000 --- a/tools/mnemonic-test/node_modules/bip39/types/_wordlists.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -declare const wordlists: { - [index: string]: string[]; -}; -declare let _default: string[] | undefined; -export { wordlists, _default }; diff --git a/tools/mnemonic-test/node_modules/bip39/types/index.d.ts b/tools/mnemonic-test/node_modules/bip39/types/index.d.ts deleted file mode 100644 index 5c34d76e..00000000 --- a/tools/mnemonic-test/node_modules/bip39/types/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/// -export declare function mnemonicToSeedSync(mnemonic: string, password?: string): Buffer; -export declare function mnemonicToSeed(mnemonic: string, password?: string): Promise; -export declare function mnemonicToEntropy(mnemonic: string, wordlist?: string[]): string; -export declare function entropyToMnemonic(entropy: Buffer | string, wordlist?: string[]): string; -export declare function generateMnemonic(strength?: number, rng?: (size: number) => Buffer, wordlist?: string[]): string; -export declare function validateMnemonic(mnemonic: string, wordlist?: string[]): boolean; -export declare function setDefaultWordlist(language: string): void; -export declare function getDefaultWordlist(): string; -export { wordlists } from './_wordlists'; diff --git a/tools/mnemonic-test/node_modules/bip39/types/wordlists.d.ts b/tools/mnemonic-test/node_modules/bip39/types/wordlists.d.ts deleted file mode 100644 index 24269f95..00000000 --- a/tools/mnemonic-test/node_modules/bip39/types/wordlists.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -declare const wordlists: { - [index: string]: string[]; -}; -declare let _default: string[] | undefined; -export { wordlists, _default }; diff --git a/tools/mnemonic-test/node_modules/ethers/CHANGELOG.md b/tools/mnemonic-test/node_modules/ethers/CHANGELOG.md deleted file mode 100644 index 0a9c17ad..00000000 --- a/tools/mnemonic-test/node_modules/ethers/CHANGELOG.md +++ /dev/null @@ -1,478 +0,0 @@ -Change Log -========== - -This change log is maintained by `src.ts/_admin/update-changelog.ts` but may also be manually updated. - -ethers/v6.16.0 (2025-12-02 19:47) ---------------------------------- - - - Added utility method to split EIP-7594 BLOb proofs into its cells ([88dfe96](https://github.com/ethers-io/ethers.js/commit/88dfe96cf56ad41d0a18b1ef8cac4209aa80905e)). - - Update Alchemy URL endpoint for mainnet ([#5052](https://github.com/ethers-io/ethers.js/issues/5052); [719b01d](https://github.com/ethers-io/ethers.js/commit/719b01d72dad7525d3837a561fa1c803a773b44e)). - - Fail on unsupported Etherscan networks immediately to better support the default provider ([94b333b](https://github.com/ethers-io/ethers.js/commit/94b333b982a5c4ecb74d10c2bdf0ff23584c37fa)). - - Added Filecoin network and Ankr endpoints ([#5038](https://github.com/ethers-io/ethers.js/issues/5038); [986e827](https://github.com/ethers-io/ethers.js/commit/986e8272270fa7394a0acd0c15b3bf407dbc1fc4)). - - Moved to better API for EIP-7594 PeerDAS ([#5062](https://github.com/ethers-io/ethers.js/issues/5062); [452b422](https://github.com/ethers-io/ethers.js/commit/452b4227a4587a514ff83dc8a591eb02a0ba2d56)). - - Added initial EIP-7594 PeerDAS support ([#5054](https://github.com/ethers-io/ethers.js/issues/5054), [#5062](https://github.com/ethers-io/ethers.js/issues/5062); [6d64889](https://github.com/ethers-io/ethers.js/commit/6d64889388824823369cd95193fbc857bc0ee15c)). - - Support RegExp engines with string length limitations ([#4967](https://github.com/ethers-io/ethers.js/issues/4967); [f0dfbe1](https://github.com/ethers-io/ethers.js/commit/f0dfbe1c35128d581d95cbf81637c438d7bee00a)). - - Added Transaction and Signature support for non-canonical S values ([#4223](https://github.com/ethers-io/ethers.js/issues/4223), [#5013](https://github.com/ethers-io/ethers.js/issues/5013); [855d727](https://github.com/ethers-io/ethers.js/commit/855d72728aaa1cc0ec427f56ab7929daead0b253)). - - Allow zero-width big-endian data for toBeHex and allow widths fo toBeArray ([#5025](https://github.com/ethers-io/ethers.js/issues/5025); [540f30c](https://github.com/ethers-io/ethers.js/commit/540f30cbec0e745df1a38d51286f2c6326829581)). - -ethers/v6.15.0 (2025-07-01 11:24) ---------------------------------- - - - Allow non-canonical S values in Signatures moving errors to access-time ([#5013](https://github.com/ethers-io/ethers.js/issues/5013); [9944ec9](https://github.com/ethers-io/ethers.js/commit/9944ec94b154b4f8fdfeefb81a1e47b28fd907bc)). - -ethers/v6.14.4 (2025-06-12 23:16) ---------------------------------- - - - Fixed serialization of EIP-7702 transactions with leading 0-bytes ([#4916](https://github.com/ethers-io/ethers.js/issues/4916); [389dc03](https://github.com/ethers-io/ethers.js/commit/389dc0381222206011037792fd575c36da25abbf)). - -ethers/v6.14.3 (2025-05-26 18:55) ---------------------------------- - - - Fixed non-normalized yParity on EIP-7702 JSON-RPC responses ([#4985](https://github.com/ethers-io/ethers.js/issues/4985); [a8803ca](https://github.com/ethers-io/ethers.js/commit/a8803ca4dce20d2dededed8da65e80f2a8770fb1)). - -ethers/v6.14.2 (2025-05-26 18:03) ---------------------------------- - - - Fixed call stack overflow in makeError stringify for recursive structures ([#4977](https://github.com/ethers-io/ethers.js/issues/4977), [#4978](https://github.com/ethers-io/ethers.js/issues/4978); [52a0522](https://github.com/ethers-io/ethers.js/commit/52a052210919a35b0b0b38e357b3003ac8259fce)). - - Explicitly throw error on gunzip failure to prevent uncaught exception ([#4873](https://github.com/ethers-io/ethers.js/issues/4873), [#4874](https://github.com/ethers-io/ethers.js/issues/4874); [fe98f98](https://github.com/ethers-io/ethers.js/commit/fe98f985e38e7540108b20d7966cca3f85d620f3)). - - Skip additional receipt fetch for single confirmation requests ([#4972](https://github.com/ethers-io/ethers.js/issues/4972); [243cb02](https://github.com/ethers-io/ethers.js/commit/243cb02c52e33c8e09b637ae775e520c1cd672d3)). - - Update EtherscanProvider to use their v2 API ([#4975](https://github.com/ethers-io/ethers.js/issues/4975); [5e09aa1](https://github.com/ethers-io/ethers.js/commit/5e09aa1fe4e216a89875bab768bec484aeaf553d)). - -ethers/v6.14.1 (2025-05-15 14:17) ---------------------------------- - - - Fix JSON-RPC authorizationList signature entries encoded as DATA instead of QUANTITY values ([#4916](https://github.com/ethers-io/ethers.js/issues/4916); [135db72](https://github.com/ethers-io/ethers.js/commit/135db722756b81f44f55441e1e2d24ef4f85f216)). - -ethers/v6.14.0 (2025-05-06 22:02) ---------------------------------- - - - Remove BlockscoutProvider temporarily until custom error issues are fixed ([805a8b3](https://github.com/ethers-io/ethers.js/commit/805a8b3aba26998a1e25055e9d3dd41c01ebbba0)). - - EIP-7702 support ([#4916](https://github.com/ethers-io/ethers.js/issues/4916); [db490e1](https://github.com/ethers-io/ethers.js/commit/db490e1afaaa139be9cb38e6b50a1bc4ef28e075), [e7c1bdf](https://github.com/ethers-io/ethers.js/commit/e7c1bdf6f0a5d6f976dddd6375e76445ac6851fc)). - - Added support for to override fetch init options in the Browser ([#3895](https://github.com/ethers-io/ethers.js/issues/3895); [844ae68](https://github.com/ethers-io/ethers.js/commit/844ae68a96deabc4d5f053dad5f1112b06f08d9a)). - - Added EIP-6963 discovery to BrowserProvider ([f5469dd](https://github.com/ethers-io/ethers.js/commit/f5469dd0e0719389d51e0106ee36d07a7ebef875)). - - Accept modern KZG library API while exposing legacy API ([#4841](https://github.com/ethers-io/ethers.js/issues/4841); [e5036e7](https://github.com/ethers-io/ethers.js/commit/e5036e778624fea957dd847f7be1a9f148b8997e)). - - Added CommunityResourcable to exports ([#4776](https://github.com/ethers-io/ethers.js/issues/4776); [bca8d1b](https://github.com/ethers-io/ethers.js/commit/bca8d1b549569e6f7793f07fcc46dfd731e37d2b)). - -ethers/v6.13.7 (2025-04-25 21:50) ---------------------------------- - - - Fix FallbackProvider coalescing call exceptions when backends return slightly different error message ([268a0ac](https://github.com/ethers-io/ethers.js/commit/268a0ac5af6a2a59c240195d75ed19047731c6c0)). - - Fixed Infura BSC network URLs ([#4951](https://github.com/ethers-io/ethers.js/issues/4951); [d01b4cb](https://github.com/ethers-io/ethers.js/commit/d01b4cb84b2f00dd04dc5317600a52f1fcf9b316)). - -ethers/v6.13.6 (2025-03-21 18:21) ---------------------------------- - - - Implicitly use EIP-7702 if authorizationList is given and non-empty ([#4961](https://github.com/ethers-io/ethers.js/issues/4961); [e7c1bdf](https://github.com/ethers-io/ethers.js/commit/e7c1bdf6f0a5d6f976dddd6375e76445ac6851fc)). - - Initial EIP-7702 support ([#4916](https://github.com/ethers-io/ethers.js/issues/4916); [db490e1](https://github.com/ethers-io/ethers.js/commit/db490e1afaaa139be9cb38e6b50a1bc4ef28e075)). - - Added support for to override fetch init options in the Browser ([#3895](https://github.com/ethers-io/ethers.js/issues/3895); [844ae68](https://github.com/ethers-io/ethers.js/commit/844ae68a96deabc4d5f053dad5f1112b06f08d9a)). - - Added EIP-6963 discovery to BrowserProvider ([f5469dd](https://github.com/ethers-io/ethers.js/commit/f5469dd0e0719389d51e0106ee36d07a7ebef875)). - - Merge: e5036e77 158f5d02 Merge branch 'main' into wip-v6.14 ([e7165a6](https://github.com/ethers-io/ethers.js/commit/e7165a6151e1fddcc9b8f4f30dfc13ee0a7d6f87)). - - tests: squelch the noisy runtime console API event in browser tests ([79428fd](https://github.com/ethers-io/ethers.js/commit/79428fd44950ca21e9cc1b6f850122461217b0b3)). - - tests: added faucet key environment for browser CI tests ([27d42af](https://github.com/ethers-io/ethers.js/commit/27d42af134bec099164e7afd03420c3dad53e3a9)). - - tests: better runtime exception output for browser tests ([0beed25](https://github.com/ethers-io/ethers.js/commit/0beed258242cff7029ef1806ad0ff4955cb135c1)). - - tests: added more debug endpoints to browser tests ([33bbf66](https://github.com/ethers-io/ethers.js/commit/33bbf662213b5d4a00901e490fd432dbeeb1a26b)). - - tests: added JSON-RPC tests to web browser CI ([1c0c23c](https://github.com/ethers-io/ethers.js/commit/1c0c23c084e389390ce00e5a421267a4f8bdef0d)). - - tests: added browser tests for sending ([afd613a](https://github.com/ethers-io/ethers.js/commit/afd613a2a0c9fb548805ed36e23ad9a5d4bcc239)). - - tests: debugging browser tests failing to launch ([d1baa74](https://github.com/ethers-io/ethers.js/commit/d1baa741f6b272ba692e0e78787cacb1bd42a8b4)). - - tests: fix assert call for browser assert ([1806bbd](https://github.com/ethers-io/ethers.js/commit/1806bbde27523933fb140ad985426f94e0286faf)). - - tests: include more node tests in the browser tests ([92fd5d1](https://github.com/ethers-io/ethers.js/commit/92fd5d1f47c640caa7100bcccf0b133e866989e6)). - - tests: move more tests to dev network ([996f30c](https://github.com/ethers-io/ethers.js/commit/996f30c674002cea316fa7aa3929f43409f934bc)). - - tests: debugging CI browser failure ([ce7212d](https://github.com/ethers-io/ethers.js/commit/ce7212d03d6867081603794f0480f31d053823c4)). - - tests: debugging CI browser failure ([f1821a6](https://github.com/ethers-io/ethers.js/commit/f1821a696763938ca9d44815bdcd5cc043eb3900)). - - tests: debugging CI browser failure ([cc9119c](https://github.com/ethers-io/ethers.js/commit/cc9119cecb6b970544861642861807c520eb763b)). - - tests: debugging CI browser failure ([3ac33f9](https://github.com/ethers-io/ethers.js/commit/3ac33f9a40e40dabf9c19b8cc7114ce9897a3646)). - - tests: debugging CI browser failure ([25b11ee](https://github.com/ethers-io/ethers.js/commit/25b11ee0eaa57293fe981b9b6b19bdae7d4db169)). - - tests: debug CI failing ([3bcbcae](https://github.com/ethers-io/ethers.js/commit/3bcbcaeb025c530717b15c5ba099d320fdd9f934)). - - tests: added circular support to browser-safe inspect ([3854b39](https://github.com/ethers-io/ethers.js/commit/3854b39763a2a57f363bf9bf925adcc27002bde1)). - - tests: added browser-safe inspect for tests ([e299a31](https://github.com/ethers-io/ethers.js/commit/e299a31ecb9017baf07c58bb927c2e718ebeb447)). - - tests: fix for browser CI tests ([74a68bc](https://github.com/ethers-io/ethers.js/commit/74a68bcc4976e48a00f57f5279664551b47b6840)). - - tests: adding debug info to local JsonPrcProvider ([c508538](https://github.com/ethers-io/ethers.js/commit/c5085385563c57c7958be1ab413079dc8409c8c4)). - - tests: temporarily remove QuickNode ([499ed8c](https://github.com/ethers-io/ethers.js/commit/499ed8c4bb91b918148c348b805ce753584065b6)). - - Accept modern KZG library API while exposing legacy API ([#4841](https://github.com/ethers-io/ethers.js/issues/4841); [e5036e7](https://github.com/ethers-io/ethers.js/commit/e5036e778624fea957dd847f7be1a9f148b8997e)). - - Added CommunityResourcable to exports ([#4776](https://github.com/ethers-io/ethers.js/issues/4776); [bca8d1b](https://github.com/ethers-io/ethers.js/commit/bca8d1b549569e6f7793f07fcc46dfd731e37d2b)). - -ethers/v6.13.5 (2025-01-04 15:26) ---------------------------------- - - - Use local dev net for testing Typed API to prevent tests getting throttled ([7654ee3](https://github.com/ethers-io/ethers.js/commit/7654ee3c6487171a4e13207accfc90f93a22b0fc)). - - Fixed bad logic for searching prefetched transactions by hash ([#4868](https://github.com/ethers-io/ethers.js/issues/4868); [ef3c9bc](https://github.com/ethers-io/ethers.js/commit/ef3c9bc3afb9e36a073bbd3572e9021a852bd2c4)). - - Add newline delimiter to IPC providers for broader support ([#4847](https://github.com/ethers-io/ethers.js/issues/4847); [474a8de](https://github.com/ethers-io/ethers.js/commit/474a8ded2b94a563067d3b4dd5f60ec0725b9a27)). - -ethers/v6.13.4 (2024-10-10 18:01) ---------------------------------- - - - Updated dependencies ([1d717ef](https://github.com/ethers-io/ethers.js/commit/1d717ef940b77d4ca9b350aa3aa159a40a547ac0)). - - Fixed bug in JSON-RPC error checking ([#4827](https://github.com/ethers-io/ethers.js/issues/4827), [#4837](https://github.com/ethers-io/ethers.js/issues/4837), [#4851](https://github.com/ethers-io/ethers.js/issues/4851); [be3e6b1](https://github.com/ethers-io/ethers.js/commit/be3e6b14433bc88ad8c0c98a4f3a2a627cea6b99)). - -ethers/v6.13.3 (2024-09-30 22:08) ---------------------------------- - - - Allow CCIP-read to continue during low-level fetch failures ([#4842](https://github.com/ethers-io/ethers.js/issues/4842); [1c31f95](https://github.com/ethers-io/ethers.js/commit/1c31f95f7a1e4993ca0f1706002a975a0060dd88)). - -ethers/v6.13.2 (2024-07-25 17:54) ---------------------------------- - - - Prevent mutating transactions when signing ([#4789](https://github.com/ethers-io/ethers.js/issues/4789); [1a51af8](https://github.com/ethers-io/ethers.js/commit/1a51af85397283601db77ca61d5596b145e7f2cb)). - -ethers/v6.13.1 (2024-06-18 02:09) ---------------------------------- - - - Update ws package to address possible DoS vulnerability ([a4b1d1f](https://github.com/ethers-io/ethers.js/commit/a4b1d1f43fca14f2e826e3c60e0d45f5b6ef3ec4)). - -ethers/v6.13.0 (2024-06-04 01:01) ---------------------------------- - - - Added Options for BrowserProvider ([#4707](https://github.com/ethers-io/ethers.js/issues/4707); [33bb0bf](https://github.com/ethers-io/ethers.js/commit/33bb0bf30e1e6a699c24415a1edf0fa4ed28b6aa)). - - Fix Result deep toObject when a parent is an Array ([#4681](https://github.com/ethers-io/ethers.js/issues/4681); [d8cb849](https://github.com/ethers-io/ethers.js/commit/d8cb84957078985f5449fa26c6fd8087dbd17aec)). - - Added consistent timeout and cancel behaviour to FetchRequest ([#4122](https://github.com/ethers-io/ethers.js/issues/4122); [a12a739](https://github.com/ethers-io/ethers.js/commit/a12a7391fba39b5c114fa658590fae305dcedd17)). - -ethers/v6.12.2 (2024-05-30 17:24) ---------------------------------- - - - Copy EIP-4844 properties during estimateGas and call ([#4728](https://github.com/ethers-io/ethers.js/issues/4728); [cebe5ee](https://github.com/ethers-io/ethers.js/commit/cebe5eed91de0db5931b7847e76ee27cb2ce9219)). - - Use non-capturing regex for data to prevent memory exhaustion for long strings ([#4741](https://github.com/ethers-io/ethers.js/issues/4741); [5463aa0](https://github.com/ethers-io/ethers.js/commit/5463aa03eacde45322a1e05693ce90e4d7abcaa7)). - - Added Base endpointsto EtherscanProvider ([#4729](https://github.com/ethers-io/ethers.js/issues/4729); [7e1dc95](https://github.com/ethers-io/ethers.js/commit/7e1dc95ea2564c1eb0a9452b9a16002f3696765c)). - -ethers/v6.12.1 (2024-04-30 22:46) ---------------------------------- - - - Prevent bad Interface clone when using two different versions of v6 ([#4689](https://github.com/ethers-io/ethers.js/issues/4689); [4d2d90f](https://github.com/ethers-io/ethers.js/commit/4d2d90f5cea2eb2f9559e490a34aa1567c8c4c14)). - - Fixed typo in error message for invalid quorum weight ([#4149](https://github.com/ethers-io/ethers.js/issues/4149); [45b9b9c](https://github.com/ethers-io/ethers.js/commit/45b9b9c9322bf20feaf892d948bcfb8db8932877)). - - Added matic-amoy to EtherescanProvider ([#4711](https://github.com/ethers-io/ethers.js/issues/4711); [5c8d17a](https://github.com/ethers-io/ethers.js/commit/5c8d17a61825fe002bd45ee5b2239bfd8c8ae189)). - - Fix JsonRpcProvider ignoring pollingInterval in options ([#4644](https://github.com/ethers-io/ethers.js/issues/4644); [7b7be0d](https://github.com/ethers-io/ethers.js/commit/7b7be0d1ef637f073b28bce54f4ecdfb8c88d09c)). - -ethers/v6.12.0 (2024-04-17 01:09) ---------------------------------- - - - Added Linea Sepolia network and Infura endpoint ([#4655](https://github.com/ethers-io/ethers.js/issues/4655); [b4aaab8](https://github.com/ethers-io/ethers.js/commit/b4aaab8d39fe47f8a1a296fa442f0856f84faf03)). - - Do not send unsubscribe messages to destroyed Providers ([#4678](https://github.com/ethers-io/ethers.js/issues/4678); [c45935e](https://github.com/ethers-io/ethers.js/commit/c45935e29ca0dd1ecdf1277fa1107246041be580)). - - Get definitive network from InfuraProvider when using InfuraWebSocketProvider ([38e32d8](https://github.com/ethers-io/ethers.js/commit/38e32d82145eb289e5179f9b6b11f4a9225a7022)). - - Better error messages for transaction field mismatch ([#4659](https://github.com/ethers-io/ethers.js/issues/4659); [9230aa0](https://github.com/ethers-io/ethers.js/commit/9230aa0b9a88b5241915a8d6afa8a522d35abd5d)). - - Added prevRandao to block ([#3372](https://github.com/ethers-io/ethers.js/issues/3372); [ec6a754](https://github.com/ethers-io/ethers.js/commit/ec6a754f0c8647dae59c73b2589225cb200d83dd)). - - Added Polygon Amoy testnet ([#4645](https://github.com/ethers-io/ethers.js/issues/4645); [1717abb](https://github.com/ethers-io/ethers.js/commit/1717abbf29a14a6f6b106e479fe9a5b1f8768dc4)). - - Added Chainstack provider ([#2741](https://github.com/ethers-io/ethers.js/issues/2741); [014004d](https://github.com/ethers-io/ethers.js/commit/014004d9402d7fd8c15553792cfb7a8a84ed327a)). - - Added deep conversion to Result for toObject and toArray ([#4681](https://github.com/ethers-io/ethers.js/issues/4681); [03bfe2a](https://github.com/ethers-io/ethers.js/commit/03bfe2a4f7b29b15cd90127974b7fc1d8b03edf9)). - - Added EIP-4844 broadcast support ([92bad88](https://github.com/ethers-io/ethers.js/commit/92bad88261a5d8a538535a7d5528162fe5010527)). - - Fix ignored throttle parameters ([#4663](https://github.com/ethers-io/ethers.js/issues/4663); [12772e9](https://github.com/ethers-io/ethers.js/commit/12772e9498b70f8538838f30e16f3792ea90e173)). - -ethers/v6.11.1 (2024-02-14 13:13) ---------------------------------- - - - Throw an error when attempting to derive from a master path from a non-master node ([#4551](https://github.com/ethers-io/ethers.js/issues/4551); [556fdd9](https://github.com/ethers-io/ethers.js/commit/556fdd91d9b6bf7db4041bb099e66b2080e1a985)). - - Allow ENS wildcards with labels up to 255 bytes wide; discussed with ENS and deemed safe ([#4543](https://github.com/ethers-io/ethers.js/issues/4543); [7f14bde](https://github.com/ethers-io/ethers.js/commit/7f14bdebf1aef6760462a1c2437c31f002b984fe)). - - Enforce string is passed to toUtf8Bytes ([#4583](https://github.com/ethers-io/ethers.js/issues/4583); [f45bb87](https://github.com/ethers-io/ethers.js/commit/f45bb87aefaf2c6c3a4991f6e30a81c227ae83c0)). - - Fix transaction.index not being populated on some backends ([#4591](https://github.com/ethers-io/ethers.js/issues/4591); [7f0e140](https://github.com/ethers-io/ethers.js/commit/7f0e140d5e3925a42e8bb2ac9eb1ba3fbd939864)). - -ethers/v6.11.0 (2024-02-08 20:26) ---------------------------------- - - - Allow transaction encoding for inferred type transactions ([f02211d](https://github.com/ethers-io/ethers.js/commit/f02211d055567b51373b5faa2c3dc6efe0523618)). - - Added EIP-4788, receipts root and state root fields to Block ([#4570](https://github.com/ethers-io/ethers.js/issues/4570); [c5f126f](https://github.com/ethers-io/ethers.js/commit/c5f126faf7d826b6a99df0ee578ff3d0ef409381)). - - Added EIP-4844 fields to Provider classes and formatter ([#4570](https://github.com/ethers-io/ethers.js/issues/4570); [7b4f2c1](https://github.com/ethers-io/ethers.js/commit/7b4f2c1a74db411829b5e8ef758bfa2ee21e5890)). - - Assert BrowserProvider receives an EIP-1193 provider to fail early when passing undefined ethereum object ([b69f43b](https://github.com/ethers-io/ethers.js/commit/b69f43bc6f35da881ca7a0c8ccc5fda92edd076d)). - - Add timeout to ContractTransactionResponse wait ([#4497](https://github.com/ethers-io/ethers.js/issues/4497); [095de51](https://github.com/ethers-io/ethers.js/commit/095de51e605a9b88576e5e34fd55a6e32befa4eb)). - - Allow override keyword in human-readable ABI and improve error messages ([#4514](https://github.com/ethers-io/ethers.js/issues/4514), [#4548](https://github.com/ethers-io/ethers.js/issues/4548); [be5ec2d](https://github.com/ethers-io/ethers.js/commit/be5ec2d327a503b2e5fc0f37c47eee9e828f8e23)). - - Expand Contract sub-class to accept BaseContract super-class constructor arguments ([#4538](https://github.com/ethers-io/ethers.js/issues/4538); [98496bc](https://github.com/ethers-io/ethers.js/commit/98496bc48ec23ce0d9c21d3c6c87e5b1b796a610)). - - Allow network for default provider to be null to select mainnet ([#4501](https://github.com/ethers-io/ethers.js/issues/4501); [b6bf7ab](https://github.com/ethers-io/ethers.js/commit/b6bf7aba62fb38839cd01858432b801cc5c28a11)). - - Allow long dnsEncode names with optional length parameter ([#4543](https://github.com/ethers-io/ethers.js/issues/4543); [a136348](https://github.com/ethers-io/ethers.js/commit/a1363483a56b0dee342595c8f44ed8fcce7ecca9)). - - Fix parseLog signature when receiving read-only array for topics ([#4029](https://github.com/ethers-io/ethers.js/issues/4029), [#4459](https://github.com/ethers-io/ethers.js/issues/4459); [20cd8a2](https://github.com/ethers-io/ethers.js/commit/20cd8a23eaf8e8a14e2b51f7f64da4cb3e32fccb)). - - Use Secure endpoints for BNB on Etherscan ([#4525](https://github.com/ethers-io/ethers.js/issues/4525); [1f6e188](https://github.com/ethers-io/ethers.js/commit/1f6e1882515195bd67f0bce9fe347ec05107324b)). - - Added holesky network and related end-points for supporting providers ([c6e6c43](https://github.com/ethers-io/ethers.js/commit/c6e6c432574a0b7e55c300ab3e470aafdace28b3)). - - Added EIP-4844 BLOb transactions ([#4554](https://github.com/ethers-io/ethers.js/issues/4554); [9c1e82e](https://github.com/ethers-io/ethers.js/commit/9c1e82e1230526ebcd62902890c4f24b1f7f7d79)). - - Normalize EIP-712 types before computing the payload ([#4541](https://github.com/ethers-io/ethers.js/issues/4541); [56c1361](https://github.com/ethers-io/ethers.js/commit/56c1361ee83db8b68859caf0850c95ff70e7e306)). - - Updated thrid-part provider URLs for QuickNode ([2b4891d](https://github.com/ethers-io/ethers.js/commit/2b4891d86e72e849079cb1dc98b18e158b0c0620)). - - Fixed normalization and abstracted EIP-712 Array parsing ([#4541](https://github.com/ethers-io/ethers.js/issues/4541); [8f99601](https://github.com/ethers-io/ethers.js/commit/8f99601df1f26a8ba4d6d9dea5e033e7f688107e)). - - Updated third-party provider network URLs ([#4542](https://github.com/ethers-io/ethers.js/issues/4542); [84ca14f](https://github.com/ethers-io/ethers.js/commit/84ca14f1ffc5afbdd7f4c26a9b734ec5951eee3c)). - - Added additional sepolia testnets ([4efef76](https://github.com/ethers-io/ethers.js/commit/4efef76e8cab0acaf1b2ba231a0148f9381bb1ee)). - - Fix EIP-712 type aliases for uint and int ([#4541](https://github.com/ethers-io/ethers.js/issues/4541); [43fb9c2](https://github.com/ethers-io/ethers.js/commit/43fb9c233696aeaa80b1c2b0e5fafce90e0ad508)). - - Fixed typo in Error string ([#4539](https://github.com/ethers-io/ethers.js/issues/4539); [7882905](https://github.com/ethers-io/ethers.js/commit/78829050853093bc5291ae78fc5a904044759aa0)). - - Better debugging output on fetch errors ([bee07a0](https://github.com/ethers-io/ethers.js/commit/bee07a0750b448a9d13c2d57014bcf27f43e2ed7)). - -ethers/v6.10.0 (2024-01-12 19:46) ---------------------------------- - - - Limit decoded result imflation ratio from ABI-encoded data ([#4537](https://github.com/ethers-io/ethers.js/issues/4537); [1b4debd](https://github.com/ethers-io/ethers.js/commit/1b4debd4a9e61d171bfc60590116facb8bdbd2da)). - -ethers/v6.9.2 (2024-01-02 19:12) --------------------------------- - - - Fix Base58 padding for string representation of binary data ([#4527](https://github.com/ethers-io/ethers.js/issues/4527); [ccac24a](https://github.com/ethers-io/ethers.js/commit/ccac24a5b0a4d07a4b639c1c4d0a44703e32d418)). - -ethers/v6.9.1 (2023-12-19 04:53) --------------------------------- - - - Fix uncatchable issue when sending transactions over JSON-RPC and provide some retry-recovery for missing v ([#4513](https://github.com/ethers-io/ethers.js/issues/4513); [1802215](https://github.com/ethers-io/ethers.js/commit/180221574c5d2af9ad85404af4fab8752d3d5029)). - -ethers/v6.9.0 (2023-11-27 06:15) --------------------------------- - - - Use provider-specified suggested priority fee when available, otherwise fallback onto existing logic of 1 gwei ([#4463](https://github.com/ethers-io/ethers.js/issues/4463); [f8f11c7](https://github.com/ethers-io/ethers.js/commit/f8f11c754aa2c9b541db73d3bde66a8ffa5146f0)). - - Add auto-detected static network support to providers and allow customizing socket provider options ([#4199](https://github.com/ethers-io/ethers.js/issues/4199), [#4418](https://github.com/ethers-io/ethers.js/issues/4418), [#4441](https://github.com/ethers-io/ethers.js/issues/4441); [4681b83](https://github.com/ethers-io/ethers.js/commit/4681b83d516ab2eb41ddb68b5021c97e14c6f2cf)). - - Added Base network to AlchemyProvider ([#4384](https://github.com/ethers-io/ethers.js/issues/4384); [9e74d14](https://github.com/ethers-io/ethers.js/commit/9e74d14432e6efebdff21b9a7d2e6143af55e143)). - - Fixed ParamType formatting causing bad tuple full and minimal ABI output ([#4329](https://github.com/ethers-io/ethers.js/issues/4329), [#4479](https://github.com/ethers-io/ethers.js/issues/4479); [2b67488](https://github.com/ethers-io/ethers.js/commit/2b6748815169abf2c99a647131875c13b8b6a787)). - - Adjust for provider config weight when kicking off a request in FallbackProvider ([#4298](https://github.com/ethers-io/ethers.js/issues/4298); [da34e35](https://github.com/ethers-io/ethers.js/commit/da34e3569e95357d9469209d926cb645f0750bfa)). - - More robust FallbackProvider broadcast ([#4186](https://github.com/ethers-io/ethers.js/issues/4186), [#4297](https://github.com/ethers-io/ethers.js/issues/4297), [#4442](https://github.com/ethers-io/ethers.js/issues/4442); [e2485b8](https://github.com/ethers-io/ethers.js/commit/e2485b8ef927d18c7a15d2d29b3b0feffec9991a)). - - Added safe and finalized provider events ([#3921](https://github.com/ethers-io/ethers.js/issues/3921); [a92766e](https://github.com/ethers-io/ethers.js/commit/a92766e56ad04185625037d84fc28adaac7fae8c)). - -ethers/v6.8.1 (2023-11-01 16:08) --------------------------------- - - - Fixed typo in error description when converting values to arrays ([#4427](https://github.com/ethers-io/ethers.js/issues/4427), [#4446](https://github.com/ethers-io/ethers.js/issues/4446); [8fed2f8](https://github.com/ethers-io/ethers.js/commit/8fed2f84768ace4bf3e5742c931a74841da7c637)). - - Fix invalid token nonpayable being included in formatted constructor ([#4412](https://github.com/ethers-io/ethers.js/issues/4412); [2e0bd90](https://github.com/ethers-io/ethers.js/commit/2e0bd90744b8e76fcf03f75a66cb0061d50f7bd9)). - - Add ENS support for Sepolia ([#4422](https://github.com/ethers-io/ethers.js/issues/4422); [1da50ae](https://github.com/ethers-io/ethers.js/commit/1da50ae286da01e58a70bb8df8aa5cc5d260e33e)). - -ethers/v6.8.0 (2023-10-10 22:42) --------------------------------- - - - Replicated former ENS normalize behaviour for empty strings and update namehash testcases ([125ff11](https://github.com/ethers-io/ethers.js/commit/125ff1189b9cefb8abfd7da9c104c75e382a50cc)). - - Initial shortMessage support for errors ([#4241](https://github.com/ethers-io/ethers.js/issues/4241); [d6a8c14](https://github.com/ethers-io/ethers.js/commit/d6a8c14d907cf8b90347444c0186b83a5db2e293)). - - Fixed resolving ENS addresses used as from parameters ([#3961](https://github.com/ethers-io/ethers.js/issues/3961); [2616f4c](https://github.com/ethers-io/ethers.js/commit/2616f4c30c82bd45449b73fa37ef269d60a07d80)). - - Merge: 9a4b7534 0c9c23b0 Merge branch 'v5.8-progress' ([cd5f0fe](https://github.com/ethers-io/ethers.js/commit/cd5f0fe03f2137fbc47e295f8db38a5151111e72)). - - Allow more loose input format for RLP encoder ([#4402](https://github.com/ethers-io/ethers.js/issues/4402); [9a4b753](https://github.com/ethers-io/ethers.js/commit/9a4b7534458fc79a0654b0eb57fc956bffa02a2f)). - - Update to latest noble crypto libraries ([#3975](https://github.com/ethers-io/ethers.js/issues/3975); [b27faa0](https://github.com/ethers-io/ethers.js/commit/b27faa02ac8f90e2e54b188e8139c59d98c469e3)). - - More robust configuration options for FetchRequest getUrl functions ([#4353](https://github.com/ethers-io/ethers.js/issues/4353); [9541f2f](https://github.com/ethers-io/ethers.js/commit/9541f2f70cd7f5c6f3caf93f5a3d5e34eae5281a)). - - Ignore blockTag when calling Etherscan if it is the default block tag ([dcea9b3](https://github.com/ethers-io/ethers.js/commit/dcea9b353619d85878ad2ba340ae17e5c285d558)). - -ethers/v6.7.1 (2023-08-15 03:08) --------------------------------- - - - Prevent destroyed providers from emitting network detection errors ([7d41730](https://github.com/ethers-io/ethers.js/commit/7d4173049edc3b4ff2de1971c3ecca3b08588651)). - - Fix VSCode reported lint issues ([#4153](https://github.com/ethers-io/ethers.js/issues/4153), [#4156](https://github.com/ethers-io/ethers.js/issues/4156), [#4158](https://github.com/ethers-io/ethers.js/issues/4158), [#4159](https://github.com/ethers-io/ethers.js/issues/4159); [4eb84da](https://github.com/ethers-io/ethers.js/commit/4eb84da865a82a27c5113c38102b6b710096958e), [203dfc3](https://github.com/ethers-io/ethers.js/commit/203dfc33b9c8e72c9cdfe0a349ac763ef17a4484)). - - Add gasPrice to Polygon feeData for type 0 and type 1 legacy transactions ([#4315](https://github.com/ethers-io/ethers.js/issues/4315); [0df3ab9](https://github.com/ethers-io/ethers.js/commit/0df3ab93137039de1e1986bbfe9a5b32ceffa8a4)). - -ethers/v6.7.0 (2023-08-02 23:52) --------------------------------- - - - Fixed receipt wait not throwing on reverted transactions ([25fef4f](https://github.com/ethers-io/ethers.js/commit/25fef4f8d756f5bbf5a2a05e38233248a8eb43ac)). - - Added custom priority fee to Optimism chain (via telegram) ([ff80b04](https://github.com/ethers-io/ethers.js/commit/ff80b04f31da21496e72d3687cecd1c01efaecc5)). - - Add context to Logs that fail decoding due to ABI issues to help debugging ([f3c46f2](https://github.com/ethers-io/ethers.js/commit/f3c46f22994d194ff78b3b176407b2ecb7af1c77)). - - Added new exports for FallbackProviderOptions and FetchUrlFeeDataNetworkPlugin ([#2828](https://github.com/ethers-io/ethers.js/issues/2828), [#4160](https://github.com/ethers-io/ethers.js/issues/4160); [b1dbbb0](https://github.com/ethers-io/ethers.js/commit/b1dbbb0de3f10a3d9e12d6a84ad5c52bea25c7f6)). - - Allow overriding pollingInterval in JsonRpcProvider constructor (via discord) ([f42f258](https://github.com/ethers-io/ethers.js/commit/f42f258beb305a06e563ad16522f095a72da32eb)). - - Fixed FallbackProvider priority sorting ([#4150](https://github.com/ethers-io/ethers.js/issues/4150); [78538eb](https://github.com/ethers-io/ethers.js/commit/78538eb100addd135d29e60c9fa4fed3946278fa)). - - Added linea network to InfuraProvider and Network ([#4184](https://github.com/ethers-io/ethers.js/issues/4184), [#4190](https://github.com/ethers-io/ethers.js/issues/4190); [d3e5e2c](https://github.com/ethers-io/ethers.js/commit/d3e5e2c45b28c377f306091acfc024e30c49ef20)). - - Added whitelist support to getDefaultProvider ([82bb936](https://github.com/ethers-io/ethers.js/commit/82bb936542e29c6441ac8dc2d3ebbdd4edb708ee)). - - Add Polygon RPC endpoints to the default provider ([#3689](https://github.com/ethers-io/ethers.js/issues/3689); [23704a9](https://github.com/ethers-io/ethers.js/commit/23704a9c44d5857817e138fb19d44ce2103ca005)). - - Added customizable quorum to FallbackProvider ([#4160](https://github.com/ethers-io/ethers.js/issues/4160); [8f0a509](https://github.com/ethers-io/ethers.js/commit/8f0a50921a12a866addcf5b0fabc576bfc287689)). - - Added basic Gas Station support via a NetworkPlugin ([#2828](https://github.com/ethers-io/ethers.js/issues/2828); [229145d](https://github.com/ethers-io/ethers.js/commit/229145ddf566a962517588eaeed155734c7d4598)). - - Add BNB URLs to EtherscanProvider networks ([ec39abe](https://github.com/ethers-io/ethers.js/commit/ec39abe067259fad4ea8607a6c5aece61890eb41)). - - Added tests for JSON format ([#4248](https://github.com/ethers-io/ethers.js/issues/4248); [ba36079](https://github.com/ethers-io/ethers.js/commit/ba36079a285706694532ce726568c4c447acad47)). - - Use empty string for unnamed parameters in JSON output instead of undefined ([#4248](https://github.com/ethers-io/ethers.js/issues/4248); [8c2652c](https://github.com/ethers-io/ethers.js/commit/8c2652c8cb4d054207d89688d30930869d9d3f8b)). - - Return undefined for Contract properties that do not exist instead of throwing an error ([#4266](https://github.com/ethers-io/ethers.js/issues/4266); [5bf7b34](https://github.com/ethers-io/ethers.js/commit/5bf7b3494ed62952fc387b4368a0bdc86dfe163e)). - -ethers/v6.6.7 (2023-07-28 14:50) --------------------------------- - - - Prevent malformed logs from preventing other logs being decoded ([#4275](https://github.com/ethers-io/ethers.js/issues/4275); [0dca645](https://github.com/ethers-io/ethers.js/commit/0dca645632d73488bf6ad460e0d779361a537bbe)). - - Allow visibility on human-readable constructors ([#4278](https://github.com/ethers-io/ethers.js/issues/4278); [3a52201](https://github.com/ethers-io/ethers.js/commit/3a52201fe2ba68a00105cca2c0901da5ffa18d6b)). - -ethers/v6.6.6 (2023-07-28 01:14) --------------------------------- - - - Better error message when passing invalid overrides object into a contract deployment ([#4182](https://github.com/ethers-io/ethers.js/issues/4182); [aa2ea3d](https://github.com/ethers-io/ethers.js/commit/aa2ea3d5296956fd0d40b83888e1ca053bb250ee)). - -ethers/v6.6.5 (2023-07-24 00:04) --------------------------------- - - - Reflect symbols in the Contract Proxy to target ([#4084](https://github.com/ethers-io/ethers.js/issues/4048); [ac2f5e5](https://github.com/ethers-io/ethers.js/commit/ac2f5e563b8ec0e91a931470eb6ea58b0c01fb3d)). - - Allow arrays of address for indexed filter topics ([#4259](https://github.com/ethers-io/ethers.js/issues/4259); [93af87c](https://github.com/ethers-io/ethers.js/commit/93af87c447eeb77090e29bd940612603b3f74026)). - - Fixed filter encoding for bytesX ([#4244](https://github.com/ethers-io/ethers.js/issues/4244); [fa3a883](https://github.com/ethers-io/ethers.js/commit/fa3a883ff7c88611ce766f58bdd4b8ac90814470)). - - Fix JSON formatting for tuple arrays ([#4237](https://github.com/ethers-io/ethers.js/issues/4237); [a8bc49b](https://github.com/ethers-io/ethers.js/commit/a8bc49bdcf07a51b35f38cf209db27e116cc1a59)). - - Better error messages when parsing fragment strings ([#4246](https://github.com/ethers-io/ethers.js/issues/4246); [e36b6c3](https://github.com/ethers-io/ethers.js/commit/e36b6c35b7bc777c9adbe0055b32b31a13185240)). - - Include the missing fragment key and args when no matching Contract method or event is present ([#3809](https://github.com/ethers-io/ethers.js/issues/3809); [450a176](https://github.com/ethers-io/ethers.js/commit/450a176ee25f88a2ddb9ff23b153ef70bf1dc546)). - - Prevent a single malformed event from preventing other Contract logs; reported on Discord ([b1375f4](https://github.com/ethers-io/ethers.js/commit/b1375f4e4463b856855ebc684b45945455ac082e)). - -ethers/v6.6.4 (2023-07-16 00:35) --------------------------------- - - - More robust support for Signatures with less standard parameter values ([#3835](https://github.com/ethers-io/ethers.js/issues/3835), [#4228](https://github.com/ethers-io/ethers.js/issues/4228); [a7e4048](https://github.com/ethers-io/ethers.js/commit/a7e4048fe3b75a743cec8c8ef2a5fad4bdc8b14c)). - - Fixed CCIP-read in the EnsResolver ([#4221](https://github.com/ethers-io/ethers.js/issues/4221); [57f1e1c](https://github.com/ethers-io/ethers.js/commit/57f1e1c47148921148e35c10c83539531942923e)). - - Skip checking confirmation count if confirms is 0 ([#4229](https://github.com/ethers-io/ethers.js/issues/4229), [#4242](https://github.com/ethers-io/ethers.js/issues/4242); [492919d](https://github.com/ethers-io/ethers.js/commit/492919d14f646c630f29e1596e5564df1e51f309)). - - Fixed waiting for confirmations in deployment transactions ([#4212](https://github.com/ethers-io/ethers.js/issues/4212), [#4230](https://github.com/ethers-io/ethers.js/issues/4230); [43c253a](https://github.com/ethers-io/ethers.js/commit/43c253a402f52a08353c424f6c4e236836cfaf36)). - -ethers/v6.6.3 (2023-07-11 20:55) --------------------------------- - - - Throw more descriptive error for unconfigured ENS name contract targets ([#4213](https://github.com/ethers-io/ethers.js/issues/4213); [80f62ef](https://github.com/ethers-io/ethers.js/commit/80f62efc41c3a29e690af40a1976928b7f886a0e)). - - Fixed contract once not running stop callback ([7d061b7](https://github.com/ethers-io/ethers.js/commit/7d061b786f72cbfc461bf80d139d10aeff533a6e)). - -ethers/v6.6.2 (2023-06-27 23:30) --------------------------------- - - - Wider error detection for call exceptions on certain backends ([#4154](https://github.com/ethers-io/ethers.js/issues/4154), [#4155](https://github.com/ethers-io/ethers.js/issues/4155); [9197f9f](https://github.com/ethers-io/ethers.js/commit/9197f9f938b5f3b5f97c043f2dab06854656c932)). - - Added wider error deetection for JSON-RPC unsupported operation ([#4162](https://github.com/ethers-io/ethers.js/issues/4162); [1dc8986](https://github.com/ethers-io/ethers.js/commit/1dc8986a33be9dce536b24189326cbfaabf1342e)). - - Fixed formatUnits and parseUnits for values over 128 bits ([#4037](https://github.com/ethers-io/ethers.js/issues/4037), [#4133](https://github.com/ethers-io/ethers.js/issues/4133); [3d141b4](https://github.com/ethers-io/ethers.js/commit/3d141b44b528f52b3c9205125b64ce342f91643c)). - -ethers/v6.6.1 (2023-06-23 00:35) --------------------------------- - - - Fixed CCIP read in contract calls ([#4043](https://github.com/ethers-io/ethers.js/issues/4043); [d51e3fb](https://github.com/ethers-io/ethers.js/commit/d51e3fbff43c31d88353ac71151626312d22c0b9), [857aa8c](https://github.com/ethers-io/ethers.js/commit/857aa8ccc30f25eda8e83dcac3e0ad2c1a5ce2b3)). - -ethers/v6.6.0 (2023-06-13 21:42) --------------------------------- - - - Add exports for AbstractProviderOptions and for MulticoinProviderPlugin ([203a759](https://github.com/ethers-io/ethers.js/commit/203a759efc65bf6901d3e574a601525ea3936238)). - - Add option to adjust perform cache timeout in AbstractProvider ([de0f518](https://github.com/ethers-io/ethers.js/commit/de0f5189f695c181a5fa09100af96a691a338e2b)). - - Add full support for MultiCoin plugins and automatic detection for EVM-compatible coin types ([#3888](https://github.com/ethers-io/ethers.js/issues/3888), [#4081](https://github.com/ethers-io/ethers.js/issues/4081); [84375be](https://github.com/ethers-io/ethers.js/commit/84375be92d32a2939cf4a2f713e4c554b5b54a32)). - - Allow Interface instances where InterfaceAbi are allowed ([#4142](https://github.com/ethers-io/ethers.js/issues/4142); [2318005](https://github.com/ethers-io/ethers.js/commit/2318005dfd996c8a7c51603d0264ceabe9bb6141)). - - Allow Numeric type for decimals in FixedNumber ([#4141](https://github.com/ethers-io/ethers.js/issues/4141); [9055ef6](https://github.com/ethers-io/ethers.js/commit/9055ef6c69291f1a44ea23a2e7b5aaf3140a5577)). - -ethers/v6.5.1 (2023-06-07 20:19) --------------------------------- - - - Fix lost promise fulfillment when a batch has an error response ([#4126](https://github.com/ethers-io/ethers.js/issues/4126); [8dd21f0](https://github.com/ethers-io/ethers.js/commit/8dd21f03334ffd3cdb7ac532376d51fd4130c7ab)). - -ethers/v6.5.0 (2023-06-06 22:41) --------------------------------- - - - Fix CJS browser bundling ([#4033](https://github.com/ethers-io/ethers.js/issues/4033); [38ee319](https://github.com/ethers-io/ethers.js/commit/38ee3195b0192d8180899fd61308e03fa3a0eb32)). - - Fixed type guard for non-Typed instances ([#4087](https://github.com/ethers-io/ethers.js/issues/4087); [20c3d1b](https://github.com/ethers-io/ethers.js/commit/20c3d1b109743e33ab60a75d69bf7ede73b15ce2)). - - Add confirmations to TransactionResponse ([#4094](https://github.com/ethers-io/ethers.js/issues/4094); [bb8685b](https://github.com/ethers-io/ethers.js/commit/bb8685b112ce1c689c740d4dbcb358c16fb9b22d)). - - Fix stray promises when a node returns invalid results ([#4118](https://github.com/ethers-io/ethers.js/issues/4118); [3c1bad2](https://github.com/ethers-io/ethers.js/commit/3c1bad2fb7ad4a6ff90ff11f3e382fd18e41c800)). - - Added support to detect and stop providers spinning on initial network detection ([#4015](https://github.com/ethers-io/ethers.js/issues/4015); [f37a52d](https://github.com/ethers-io/ethers.js/commit/f37a52da28ac130b7f4de52901618320994ea87a)). - -ethers/v6.4.2 (2023-06-05 22:41) --------------------------------- - - - Bump ens-normalize version ([#4071](https://github.com/ethers-io/ethers.js/issues/4071), [#4077](https://github.com/ethers-io/ethers.js/issues/4077), [#4080](https://github.com/ethers-io/ethers.js/issues/4080), [#4102](https://github.com/ethers-io/ethers.js/issues/4102); [c135784](https://github.com/ethers-io/ethers.js/commit/c1357847dcdec93d72f28d890f9271d0289ccefd)). - - Fix for networks with polling with non-consistent block and filter events ([#4119](https://github.com/ethers-io/ethers.js/issues/4119); [9b0e992](https://github.com/ethers-io/ethers.js/commit/9b0e9920c09577296ec0e2abb3acc3f3299d96c7)). - -ethers/v6.4.1 (2023-06-01 17:52) --------------------------------- - - - Fixed AbstractProvider lookupAddress bug ([#4086](https://github.com/ethers-io/ethers.js/issues/4086); [15ed2f5](https://github.com/ethers-io/ethers.js/commit/15ed2f5b32084527961332481c9442a313036a01)). - - Fix FixedNumber comparison bug ([#4112](https://github.com/ethers-io/ethers.js/issues/4112); [d8e9586](https://github.com/ethers-io/ethers.js/commit/d8e9586044e888e424b5ead0f6e01f88140dba8a)). - -ethers/v6.4.0 (2023-05-18 17:28) --------------------------------- - - - Coerce value into BigInt when checking for value ([83d7f43](https://github.com/ethers-io/ethers.js/commit/83d7f43b9ca4b9868a3952510e56b41ea8610baa)). - - Better errors when junk passed as Contract target ([#3947](https://github.com/ethers-io/ethers.js/issues/3947), [#4053](https://github.com/ethers-io/ethers.js/issues/4053); [219b16d](https://github.com/ethers-io/ethers.js/commit/219b16dc284b0c6a532c8c49e824d8234f94222b)). - - More robust message checking in socket providers ([#4051](https://github.com/ethers-io/ethers.js/issues/4051); [f58990b](https://github.com/ethers-io/ethers.js/commit/f58990b80cfd83579014339315e58663c0aa6ae3)). - - More robust defaultProvider start-up when a backend fails on bootstrap ([#3979](https://github.com/ethers-io/ethers.js/issues/3979); [984f6fa](https://github.com/ethers-io/ethers.js/commit/984f6fa155fca08ebec2353c75ee0a0b974e8568)). - - Fix Result.map when Array contains zero elements ([#4036](https://github.com/ethers-io/ethers.js/issues/4036), [#4048](https://github.com/ethers-io/ethers.js/issues/4048); [2e5935b](https://github.com/ethers-io/ethers.js/commit/2e5935b91cff462165a054b33c8b8413f51e3f39)). - - Fixed error handling for contracts with receive and non-payable fallback ([6db7458](https://github.com/ethers-io/ethers.js/commit/6db7458cf0a09e8e8a2abb712239972ab81dc9df)). - - Remove superfluous logging in defaultProvider ([f87f6ef](https://github.com/ethers-io/ethers.js/commit/f87f6ef9a01ca399664f9fe106b0a677dba0c8e8)). - - Removed superfluous logging ([1bc8b55](https://github.com/ethers-io/ethers.js/commit/1bc8b55d502a95c4ae58352bdcfce9e5f9ea72d3)). - - Fix receipt gas price when effectiveGasPrice is 0 on testnets ([#4014](https://github.com/ethers-io/ethers.js/issues/4014); [2b0fe61](https://github.com/ethers-io/ethers.js/commit/2b0fe611335432aee334d777a64d8c7827881618)). - - Added error event to provider ([#3970](https://github.com/ethers-io/ethers.js/issues/3970), [#3982](https://github.com/ethers-io/ethers.js/issues/3982); [af0291c](https://github.com/ethers-io/ethers.js/commit/af0291c01639674658f5049343da88a84da763a1)). - - Removed superfluous parameters for internal transaction functions ([e848978](https://github.com/ethers-io/ethers.js/commit/e8489787585c2e69a23f6cdec6901f22b096aebe)). - - More aggressive tree-shaking ([076edad](https://github.com/ethers-io/ethers.js/commit/076edad81ef62474f48f2b4c8af0edc6e4fd64f2)). - - More flexible static network checking ([#3834](https://github.com/ethers-io/ethers.js/issues/3834); [7c0465c](https://github.com/ethers-io/ethers.js/commit/7c0465c5fb834eba18d4e5535072685bdc1029f0)). - - Support transitive dependants that use non-node16 moduleResolution ([#3920](https://github.com/ethers-io/ethers.js/issues/3920); [df685b1](https://github.com/ethers-io/ethers.js/commit/df685b1bd9ad346ee7863beb6c3ca3f4e94932a2)). - - Populate any missing log.removed with false ([#3959](https://github.com/ethers-io/ethers.js/issues/3959); [4e478e6](https://github.com/ethers-io/ethers.js/commit/4e478e625d5648f2172631eef5fda5776ee776b0)). - -ethers/v6.3.0 (2023-04-06 04:35) --------------------------------- - - - Added support for legacy ABI JSON fragments ([#3932](https://github.com/ethers-io/ethers.js/issues/3932); [8c5973e](https://github.com/ethers-io/ethers.js/commit/8c5973e3a9b8d4d4ed80bdf209d8a0b6cc6b8d6d)). - - Add _in_ operator support for contract and contract.filters ([#3901](https://github.com/ethers-io/ethers.js/issues/3901); [c58ab3a](https://github.com/ethers-io/ethers.js/commit/c58ab3a97687e15a3ffe30b038089c5f4b570bb9)). - - Fixed TypedData unsigned value range ([#3873](https://github.com/ethers-io/ethers.js/issues/3873); [a851b24](https://github.com/ethers-io/ethers.js/commit/a851b24d0af009ecf277766d2a5f81f9b3e7f9f8)). - - Added missing export for getIndexedAccountPath ([#3875](https://github.com/ethers-io/ethers.js/issues/3875); [356ff2b](https://github.com/ethers-io/ethers.js/commit/356ff2becb4f4d3622b281d3825770af5caf71ca)). - - Fixed TypedData payloads for JSON-restricted chainId field ([#3836](https://github.com/ethers-io/ethers.js/issues/3836); [50b74b8](https://github.com/ethers-io/ethers.js/commit/50b74b8806ef2064f2764b09f89c7ac75fda3a3c)). - -ethers/v6.2.3 (2023-03-27 21:22) --------------------------------- - - - Fixed events when emitted in WebSocketProvider ([#3767](https://github.com/ethers-io/ethers.js/issues/3767), [#3922](https://github.com/ethers-io/ethers.js/issues/3922); [ffaafc0](https://github.com/ethers-io/ethers.js/commit/ffaafc0ce1cf40d1d76d8d814c9c445057bf6989)). - -ethers/v6.2.2 (2023-03-24 00:49) --------------------------------- - - - Fixed FetchRequest when using credentials ([#3897](https://github.com/ethers-io/ethers.js/issues/3897); [88e8124](https://github.com/ethers-io/ethers.js/commit/88e8124c37d377628f9b8abdf140fc07ad06259f)). - -ethers/v6.2.1 (2023-03-23 17:33) --------------------------------- - - - Stall block polling bootstrap when the network is down ([#3924](https://github.com/ethers-io/ethers.js/issues/3924); [603d474](https://github.com/ethers-io/ethers.js/commit/603d47496e2b667c15b72f315261d6e299381848)). - -ethers/v6.2.0 (2023-03-20 15:53) --------------------------------- - - - Added extra details in the error info field for RPC errors ([30ffa78](https://github.com/ethers-io/ethers.js/commit/30ffa78d1441fa033677fa09237fc135a314f373)). - - Remove Ankr as a default for now as the provided API key is failing ([6e01e54](https://github.com/ethers-io/ethers.js/commit/6e01e5448f4a3e2d30288d4c8447db295c3a2e7a)). - - Fixed deferred filters after unsafe-eval changes ([#3749](https://github.com/ethers-io/ethers.js/issues/3749), [#3763](https://github.com/ethers-io/ethers.js/issues/3763); [2e3802a](https://github.com/ethers-io/ethers.js/commit/2e3802a83b8ad2f5a6269d79fbd1c83c9f2d1047)). - - Remove use of Function sub-class to address unsafe-eval issues ([#3749](https://github.com/ethers-io/ethers.js/issues/3749), [#3763](https://github.com/ethers-io/ethers.js/issues/3763); [7d3af51](https://github.com/ethers-io/ethers.js/commit/7d3af512c75b4c24027ec2daef1e9f4c1064194a)). - - Added verifyTypedData utility (reported on Farcaster) ([f06a445](https://github.com/ethers-io/ethers.js/commit/f06a445247f3b294f9fc805cc8fe0752accb8edc)). - - Removed stray logging in IpcProvider ([#3908](https://github.com/ethers-io/ethers.js/issues/3908), [#3909](https://github.com/ethers-io/ethers.js/issues/3909); [e11d4c1](https://github.com/ethers-io/ethers.js/commit/e11d4c1c20cc5b6fd5803cf9636c4f5bc082dab7)). - - Fixed legacy serialization for implicit chainId transactions ([#3898](https://github.com/ethers-io/ethers.js/issues/3898), [#3899](https://github.com/ethers-io/ethers.js/issues/3899); [fcf6c8f](https://github.com/ethers-io/ethers.js/commit/fcf6c8fcee95ec412aaafba8ec84d5049b077a4e)). - - Fix Webpack issue (reported on discord) ([3ad4273](https://github.com/ethers-io/ethers.js/commit/3ad4273b8b714bff344ccbfb1eb71ed8a8b7cfa4)). - - Fix some bundlers which cannot handle recursive pkg.exports ([#3848](https://github.com/ethers-io/ethers.js/issues/3848); [6315e78](https://github.com/ethers-io/ethers.js/commit/6315e78ea32147653b72ca06f6800f3e2df6ffbf)). - - Fixed typo in signature.s error ([#3891](https://github.com/ethers-io/ethers.js/issues/3891); [47ef3eb](https://github.com/ethers-io/ethers.js/commit/47ef3ebde37bfa0c015c258c3d8a6800d751e147)). - - Fixed stray unreachable code ([#3890](https://github.com/ethers-io/ethers.js/issues/3890); [c220fe2](https://github.com/ethers-io/ethers.js/commit/c220fe2ea747ccc80cd3c4020e0278e3daf3c4fc)). - - Move all wrapping to proper _wrap functions ([#3818](https://github.com/ethers-io/ethers.js/issues/3818); [02a0aad](https://github.com/ethers-io/ethers.js/commit/02a0aad61212c35e8d2723a8ae589989b97dae3e)). - -ethers/v6.1.0 (2023-03-07 02:10) --------------------------------- - - - Fixed ethers imported in web workers ([#3856](https://github.com/ethers-io/ethers.js/issues/3856); [5f2678f](https://github.com/ethers-io/ethers.js/commit/5f2678fb059d643638b9cc1dc59cbfc61ce7a7b8)). - - Added Sepolia support ([#3863](https://github.com/ethers-io/ethers.js/issues/3863); [abeaa74](https://github.com/ethers-io/ethers.js/commit/abeaa74da04fbe25e837a2ffa7d1e9c1257a5da5)). - - Added missing exports ([#3734](https://github.com/ethers-io/ethers.js/issues/3734); [06aa303](https://github.com/ethers-io/ethers.js/commit/06aa30363f88144db672376d39012d7fe3f86c33)). - - Allow null values for TypedData domain ([#3623](https://github.com/ethers-io/ethers.js/issues/3623); [a32af3a](https://github.com/ethers-io/ethers.js/commit/a32af3adc104c4b07a45097a4a3725a4ce9e0be6)). - - Added listAccounts to JsonRpcProvider ([#3778](https://github.com/ethers-io/ethers.js/issues/3778); [287d94f](https://github.com/ethers-io/ethers.js/commit/287d94fc454d03f1b3086ea98745131cdf40129a)). - - Allow BigInt for blockTag ([#3780](https://github.com/ethers-io/ethers.js/issues/3780); [fe1f04c](https://github.com/ethers-io/ethers.js/commit/fe1f04c6e5fb4254a100f492d7dcbdc3cf19a446)). - - Fixed typo in error messages ([#3822](https://github.com/ethers-io/ethers.js/issues/3822), [#3824](https://github.com/ethers-io/ethers.js/issues/3824); [f1a810d](https://github.com/ethers-io/ethers.js/commit/f1a810dcb56df54b1e1567f2a59c73500619472f)). - - Re-adding definition files to require exports ([#3703](https://github.com/ethers-io/ethers.js/issues/3703); [76fab92](https://github.com/ethers-io/ethers.js/commit/76fab923da33e71e6bb751bb0b5e3ba3faa27ab2)). - -ethers/v6.0.8 (2023-02-23 06:30) --------------------------------- - - - Fix matic-mumbai network and include aliases to legacy names ([#3811](https://github.com/ethers-io/ethers.js/issues/3811); [20bbd12](https://github.com/ethers-io/ethers.js/commit/20bbd1281911d31b360f6f5032251c9257943541)). - - Fixed getSigner bug ([#3821](https://github.com/ethers-io/ethers.js/issues/3821); [388edf6](https://github.com/ethers-io/ethers.js/commit/388edf6abc168f89f1ca609e9e5b025dc9205add)). - -ethers/v6.0.7 (2023-02-23 01:41) --------------------------------- - - - Fixed getContentHash ([#3819](https://github.com/ethers-io/ethers.js/issues/3819); [b993f7c](https://github.com/ethers-io/ethers.js/commit/b993f7c3b6c0e135c460c8b8dc5943215628231a)). - -ethers/v6.0.6 (2023-02-22 21:53) --------------------------------- - - - Added chain parameters for Arbitrum and Optimism ([#3811](https://github.com/ethers-io/ethers.js/issues/3811); [77a7323](https://github.com/ethers-io/ethers.js/commit/77a7323119923e596f4def4f1bc90beae5447320)). - - Fix NonceManager race condition ([#3812](https://github.com/ethers-io/ethers.js/issues/3812), [#3813](https://github.com/ethers-io/ethers.js/issues/3813); [5a3c10a](https://github.com/ethers-io/ethers.js/commit/5a3c10a29c047609a50828adb620d88aa8cf0014)). - - Add UMD output to dist builds ([#3814](https://github.com/ethers-io/ethers.js/issues/3814); [f9eed4c](https://github.com/ethers-io/ethers.js/commit/f9eed4cdb190b06dd4ddaa2382c1de42e8e98de6)). - -ethers/v6.0.5 (2023-02-18 22:36) --------------------------------- - - - Fixed Result to behave correctly like an array using slice and toArray ([#3787](https://github.com/ethers-io/ethers.js/issues/3787); [399356b](https://github.com/ethers-io/ethers.js/commit/399356b91227db04e496628af60c4b8e38207760)). - - Replaced substring from 0 index with startsWith ([#3691](https://github.com/ethers-io/ethers.js/issues/3691); [4512e97](https://github.com/ethers-io/ethers.js/commit/4512e97f9b55607ce388aa6eb63a37fc196a5d9d)). - - Fixed inverted assert in duplicate name detection for ABI encoding ([#3792](https://github.com/ethers-io/ethers.js/issues/3792); [762c2f3](https://github.com/ethers-io/ethers.js/commit/762c2f34eac848c5464389f11d1697dcd8ebcbb5)). - - Fixed missing property during transaction copy ([#3793](https://github.com/ethers-io/ethers.js/issues/3793); [48bbef7](https://github.com/ethers-io/ethers.js/commit/48bbef7ade69bcfe86542f752f15049cc62f4141)). - - Add support for Wallet private keys without 0x prefix ([#3768](https://github.com/ethers-io/ethers.js/issues/3768); [4665fb4](https://github.com/ethers-io/ethers.js/commit/4665fb4c6886c8b344dee316ba9f4fde57ce7557)). - - Fixed quicknode property for defaultProvider ([#3741](https://github.com/ethers-io/ethers.js/issues/3741); [a8afb72](https://github.com/ethers-io/ethers.js/commit/a8afb72fbbceb6a5024c1edb85badb72099787ea)). - - Fixed exports field order ([#3703](https://github.com/ethers-io/ethers.js/issues/3703), [#3755](https://github.com/ethers-io/ethers.js/issues/3755); [085a905](https://github.com/ethers-io/ethers.js/commit/085a9054f349afb816ca1a123737293ec9bd2532)). - -ethers/v6.0.4 (2023-02-16 08:55) --------------------------------- - - - Fixed custom error decoding ([#3785](https://github.com/ethers-io/ethers.js/issues/3785); [4d9b29d](https://github.com/ethers-io/ethers.js/commit/4d9b29de751e2387c143e474bb96d271da892ea6)). - - Removed stray debug logging ([e1e0929](https://github.com/ethers-io/ethers.js/commit/e1e09293483a9d07fd8e8f96552aa958b5ec45ed)). - - Fixed lookupAddress when bad resolver is present ([#3782](https://github.com/ethers-io/ethers.js/issues/3782); [92def9c](https://github.com/ethers-io/ethers.js/commit/92def9c1489bb35ad13fe58a1cd107ee3a05a112)). - - Fixed FallbackProvider median calculation ([#3746](https://github.com/ethers-io/ethers.js/issues/3746); [83957dc](https://github.com/ethers-io/ethers.js/commit/83957dc283043b9af8f6e89920faac3e09ca69fc)). - - Move the xnf normalize variant to pkg.browser instead of import ([#3724](https://github.com/ethers-io/ethers.js/issues/3724); [179e6ca](https://github.com/ethers-io/ethers.js/commit/179e6ca520392177c7dea5e477b29930952ed637)). - -ethers/v6.0.3 (2023-02-12 22:45) --------------------------------- - - - Allow null type in transaction receipt for legacy type 0 networks ([#3459](https://github.com/ethers-io/ethers.js/issues/3459); [6372a46](https://github.com/ethers-io/ethers.js/commit/6372a46b1b273db3e4c1189daebb4b888bd588bc)). - - Fixed events when slicing immutable Result ([#3765](https://github.com/ethers-io/ethers.js/issues/3765); [2ba4a17](https://github.com/ethers-io/ethers.js/commit/2ba4a172555b7e17ac01fedfc944549defab61bc)). - - More robust support on networks which throw when filters are not supported ([#3767](https://github.com/ethers-io/ethers.js/issues/3767); [37bf4fb](https://github.com/ethers-io/ethers.js/commit/37bf4fb55563d7ff66edee15c7515c8a0d6a2266)). - - Fixed ignored polling override for JsonRpcApiProvider ([400d576](https://github.com/ethers-io/ethers.js/commit/400d57621b3e9a33679a528b5072449699f0a068)). - -ethers/v6.0.2 (2023-02-04 08:50) --------------------------------- - - - Fixed crossed assert in Fetch ([#3733](https://github.com/ethers-io/ethers.js/issues/3733); [6c338c1](https://github.com/ethers-io/ethers.js/commit/6c338c1c5b4013db9754c9d1a33dcbf54330e5c7)). - -ethers/v6.0.1 (2023-02-04 04:06) --------------------------------- - - - Fix Subscriber model when removed within emit callback ([d0ed918](https://github.com/ethers-io/ethers.js/commit/d0ed91840c9f51c7ce9061ebb1d36727dbdd51a4)). - - Fixed human-readable parser when identifier begins with valid type prefix ([#3728](https://github.com/ethers-io/ethers.js/issues/3728); [522fd16](https://github.com/ethers-io/ethers.js/commit/522fd16f68aabc53e4dc8745d4128e0d61260ed5)). - - Update to latest secp256k1 library ([#3719](https://github.com/ethers-io/ethers.js/issues/3719); [803e8f9](https://github.com/ethers-io/ethers.js/commit/803e8f9821950b83efa876d64b1cfb35f6bccc38)). - -ethers/v6.0.0 (2023-02-02 22:48) --------------------------------- - - - Initial release ([90afd9b](https://github.com/ethers-io/ethers.js/commit/90afd9bd81ed1408421a0247fa0845a74c9eb319)). diff --git a/tools/mnemonic-test/node_modules/ethers/FUNDING.json b/tools/mnemonic-test/node_modules/ethers/FUNDING.json deleted file mode 100644 index 37ab3768..00000000 --- a/tools/mnemonic-test/node_modules/ethers/FUNDING.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "drips": { - "ethereum": { - "ownedBy": "0x89EdE5cBE53473A64d6C8DF14176a0d658dAAeDC" - } - }, - "opRetro": { - "projectId": "0xa3d07f453f70d844196d89d79848aa2e70a0bd8b38bf0f493cba1547bb3bca5e" - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/LICENSE.md b/tools/mnemonic-test/node_modules/ethers/LICENSE.md deleted file mode 100644 index 12fe15fb..00000000 --- a/tools/mnemonic-test/node_modules/ethers/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2016-2025 Richard Moore - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/tools/mnemonic-test/node_modules/ethers/README.md b/tools/mnemonic-test/node_modules/ethers/README.md deleted file mode 100644 index 5af85102..00000000 --- a/tools/mnemonic-test/node_modules/ethers/README.md +++ /dev/null @@ -1,140 +0,0 @@ -The Ethers Project -================== - -[![npm (tag)](https://img.shields.io/npm/v/ethers)](https://www.npmjs.com/package/ethers) -[![CI Tests](https://github.com/ethers-io/ethers.js/actions/workflows/test-ci.yml/badge.svg?branch=main)](https://github.com/ethers-io/ethers.js/actions/workflows/test-ci.yml) -![npm bundle size (version)](https://img.shields.io/bundlephobia/minzip/ethers) -![npm (downloads)](https://img.shields.io/npm/dm/ethers) -[![GitPOAP Badge](https://public-api.gitpoap.io/v1/repo/ethers-io/ethers.js/badge)](https://www.gitpoap.io/gh/ethers-io/ethers.js) -[![Twitter Follow](https://img.shields.io/twitter/follow/ricmoo?style=social)](https://twitter.com/ricmoo) - ------ - -A complete, compact and simple library for Ethereum and ilk, written -in [TypeScript](https://www.typescriptlang.org). - -**Features** - -- Keep your private keys in your client, **safe** and sound -- Import and export **JSON wallets** (Geth, Parity and crowdsale) -- Import and export BIP 39 **mnemonic phrases** (12 word backup phrases) and **HD Wallets** (English as well as Czech, French, Italian, Japanese, Korean, Simplified Chinese, Spanish, Traditional Chinese) -- Meta-classes create JavaScript objects from any contract ABI, including **ABIv2** and **Human-Readable ABI** -- Connect to Ethereum nodes over [JSON-RPC](https://ethereum.org/en/developers/docs/apis/json-rpc/), [INFURA](https://infura.io), [Etherscan](https://etherscan.io), [Alchemy](https://alchemyapi.io), [Ankr](https://ankr.com) or [MetaMask](https://metamask.io) -- **ENS names** are first-class citizens; they can be used anywhere an Ethereum addresses can be used -- **Small** (~144kb compressed; 460kb uncompressed) -- **Tree-shaking** focused; include only what you need during bundling -- **Complete** functionality for all your Ethereum desires -- Extensive [documentation](https://docs.ethers.org/v6/) -- Large collection of **test cases** which are maintained and added to -- Fully written in **TypeScript**, with strict types for security and safety -- **MIT License** (including ALL dependencies); completely open source to do with as you please - - -Keep Updated ------------- - -For advisories and important notices, follow [@ethersproject](https://twitter.com/ethersproject) -on Twitter (low-traffic, non-marketing, important information only) as well as watch this GitHub project. - -For more general news, discussions, and feedback, follow or DM me, -[@ricmoo](https://twitter.com/ricmoo) on Twitter or on the -[Ethers Discord](https://discord.gg/qYtSscGYYc). - - -For the latest changes, see the -[CHANGELOG](https://github.com/ethers-io/ethers.js/blob/main/CHANGELOG.md). - - -**Summaries** - -- [August 2023](https://blog.ricmoo.com/highlights-ethers-js-august-2023-fb68354c576c) -- [September 2022](https://blog.ricmoo.com/highlights-ethers-js-september-2022-d7bda0fc37ed) -- [June 2022](https://blog.ricmoo.com/highlights-ethers-js-june-2022-f5328932e35d) -- [March 2022](https://blog.ricmoo.com/highlights-ethers-js-march-2022-f511fe1e88a1) -- [December 2021](https://blog.ricmoo.com/highlights-ethers-js-december-2021-dc1adb779d1a) -- [September 2021](https://blog.ricmoo.com/highlights-ethers-js-september-2021-1bf7cb47d348) -- [May 2021](https://blog.ricmoo.com/highlights-ethers-js-may-2021-2826e858277d) -- [March 2021](https://blog.ricmoo.com/highlights-ethers-js-march-2021-173d3a545b8d) -- [December 2020](https://blog.ricmoo.com/highlights-ethers-js-december-2020-2e2db8bc800a) - - - -Installing ----------- - -**NodeJS** - -``` -/home/ricmoo/some_project> npm install ethers -``` - -**Browser (ESM)** - -The bundled library is available in the `./dist/` folder in this repo. - -``` - -``` - - -Documentation -------------- - -Browse the [documentation](https://docs.ethers.org) online: - -- [Getting Started](https://docs.ethers.org/v6/getting-started/) -- [Full API Documentation](https://docs.ethers.org/v6/api/) -- [Various Ethereum Articles](https://blog.ricmoo.com/) - - - -Providers ---------- - -Ethers works closely with an ever-growing list of third-party providers -to ensure getting started is quick and easy, by providing default keys -to each service. - -These built-in keys mean you can use `ethers.getDefaultProvider()` and -start developing right away. - -However, the API keys provided to ethers are also shared and are -intentionally throttled to encourage developers to eventually get -their own keys, which unlock many other features, such as faster -responses, more capacity, analytics and other features like archival -data. - -When you are ready to sign up and start using for your own keys, please -check out the [Provider API Keys](https://docs.ethers.org/v5/api-keys/) in -the documentation. - -A special thanks to these services for providing community resources: - -- [Ankr](https://www.ankr.com/) -- [QuickNode](https://www.quicknode.com/) -- [Etherscan](https://etherscan.io/) -- [INFURA](https://infura.io/) -- [Alchemy](https://dashboard.alchemyapi.io/signup?referral=55a35117-028e-4b7c-9e47-e275ad0acc6d) - - -Extension Packages ------------------- - -The `ethers` package only includes the most common and most core -functionality to interact with Ethereum. There are many other -packages designed to further enhance the functionality and experience. - -- [MulticallProvider](https://github.com/ethers-io/ext-provider-multicall) - A Provider which bundles multiple call requests into a single `call` to reduce latency and backend request capacity -- [MulticoinPlugin](https://github.com/ethers-io/ext-provider-plugin-multicoin) - A Provider plugin to expand the support of ENS coin types -- [GanaceProvider](https://github.com/ethers-io/ext-provider-ganache) - A Provider for in-memory node instances, for fast debugging, testing and simulating blockchain operations -- [Optimism Utilities](https://github.com/ethers-io/ext-utils-optimism) - A collection of Optimism utilities -- [LedgerSigner](https://github.com/ethers-io/ext-signer-ledger) - A Signer to interact directly with Ledger Hardware Wallets - - -License -------- - -MIT License (including **all** dependencies). - diff --git a/tools/mnemonic-test/node_modules/ethers/SECURITY.md b/tools/mnemonic-test/node_modules/ethers/SECURITY.md deleted file mode 100644 index 7048829d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/SECURITY.md +++ /dev/null @@ -1,34 +0,0 @@ -# Security Policy - -## Supported Versions - -Maintaining multiple versions of the library is quite time consuming, so -the majority of the effort is focused on the latest major release. - -If you do require a version outside of this chart updated with patch fix, -please [contact me](mailto:github@ricmoo.com). - -| Version | Supported | Initial Release | -| ------- | ------------------------------------------ | ----------------- | -| 6.0.x | :white_check_mark: | 2023-02-02 | -| 5.0.x | :white_check_mark: (security updates) | 2020-06-12 | -| 4.0.x | :x: | 2018-10-01 | -| 3.0.x | :x: | 2018-03-05 | -| 2.2.x | :x: | 2018-01-11 | -| 2.1.x | :x: | 2017-05-22 | -| 2.0.x | :x: | 2017-04-05 | -| 1.0.x | :x: | 2016-08-23 | -| 0.0.x | :x: | 2016-07-14 | - - -## Reporting a Vulnerability - -If you identify a security vulnerability with this library (or any dependency), -please do not hesitate to contact [github@ricmoo.com](mailto:github@ricmoo.com) -immediately. - -I try to respond within the same day and will address any concern as quickly -as possible (including code fixes and publishing to NPM). - -Any vulnerability will also be published to this file, along with credits, -pertinent information and links to fixes. diff --git a/tools/mnemonic-test/node_modules/ethers/dist/README.md b/tools/mnemonic-test/node_modules/ethers/dist/README.md deleted file mode 100644 index 78b13a88..00000000 --- a/tools/mnemonic-test/node_modules/ethers/dist/README.md +++ /dev/null @@ -1,22 +0,0 @@ -Distribution Folder -=================== - -The contents of this folder are for using `import` in ESM -browser-base projects. - -The `ethers.js` (and `ethers.min.js`) files only include the -English wordlist to conserve space. - -For additional Wordlist support, the `wordlist-extra.js` (and -`wordlist-extra.min.js`) should be imported too. - - -Notes ------ - -The contents are generated via the `npm build dist` target using -`rollup` and the `/rollup.config.js` configuration. - -Do not modify the files in this folder. They are deleted on `build-clean`. - -To modify this `README.md`, see the `/output/post-build/dist`. diff --git a/tools/mnemonic-test/node_modules/ethers/dist/ethers.js b/tools/mnemonic-test/node_modules/ethers/dist/ethers.js deleted file mode 100644 index 876dea77..00000000 --- a/tools/mnemonic-test/node_modules/ethers/dist/ethers.js +++ /dev/null @@ -1,26488 +0,0 @@ -const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !== 'undefined' ? window: typeof global !== 'undefined' ? global: typeof self !== 'undefined' ? self: {}); -/* Do NOT modify this file; see /src.ts/_admin/update-version.ts */ -/** - * The current version of Ethers. - */ -const version = "6.16.0"; - -/** - * Property helper functions. - * - * @_subsection api/utils:Properties [about-properties] - */ -function checkType(value, type, name) { - const types = type.split("|").map(t => t.trim()); - for (let i = 0; i < types.length; i++) { - switch (type) { - case "any": - return; - case "bigint": - case "boolean": - case "number": - case "string": - if (typeof (value) === type) { - return; - } - } - } - const error = new Error(`invalid value for type ${type}`); - error.code = "INVALID_ARGUMENT"; - error.argument = `value.${name}`; - error.value = value; - throw error; -} -/** - * Resolves to a new object that is a copy of %%value%%, but with all - * values resolved. - */ -async function resolveProperties(value) { - const keys = Object.keys(value); - const results = await Promise.all(keys.map((k) => Promise.resolve(value[k]))); - return results.reduce((accum, v, index) => { - accum[keys[index]] = v; - return accum; - }, {}); -} -/** - * Assigns the %%values%% to %%target%% as read-only values. - * - * It %%types%% is specified, the values are checked. - */ -function defineProperties(target, values, types) { - for (let key in values) { - let value = values[key]; - const type = (types ? types[key] : null); - if (type) { - checkType(value, type, key); - } - Object.defineProperty(target, key, { enumerable: true, value, writable: false }); - } -} - -/** - * All errors in ethers include properties to ensure they are both - * human-readable (i.e. ``.message``) and machine-readable (i.e. ``.code``). - * - * The [[isError]] function can be used to check the error ``code`` and - * provide a type guard for the properties present on that error interface. - * - * @_section: api/utils/errors:Errors [about-errors] - */ -function stringify$1(value, seen) { - if (value == null) { - return "null"; - } - if (seen == null) { - seen = new Set(); - } - if (typeof (value) === "object") { - if (seen.has(value)) { - return "[Circular]"; - } - seen.add(value); - } - if (Array.isArray(value)) { - return "[ " + (value.map((v) => stringify$1(v, seen))).join(", ") + " ]"; - } - if (value instanceof Uint8Array) { - const HEX = "0123456789abcdef"; - let result = "0x"; - for (let i = 0; i < value.length; i++) { - result += HEX[value[i] >> 4]; - result += HEX[value[i] & 0xf]; - } - return result; - } - if (typeof (value) === "object" && typeof (value.toJSON) === "function") { - return stringify$1(value.toJSON(), seen); - } - switch (typeof (value)) { - case "boolean": - case "number": - case "symbol": - return value.toString(); - case "bigint": - return BigInt(value).toString(); - case "string": - return JSON.stringify(value); - case "object": { - const keys = Object.keys(value); - keys.sort(); - return "{ " + keys.map((k) => `${stringify$1(k, seen)}: ${stringify$1(value[k], seen)}`).join(", ") + " }"; - } - } - return `[ COULD NOT SERIALIZE ]`; -} -/** - * Returns true if the %%error%% matches an error thrown by ethers - * that matches the error %%code%%. - * - * In TypeScript environments, this can be used to check that %%error%% - * matches an EthersError type, which means the expected properties will - * be set. - * - * @See [ErrorCodes](api:ErrorCode) - * @example - * try { - * // code.... - * } catch (e) { - * if (isError(e, "CALL_EXCEPTION")) { - * // The Type Guard has validated this object - * console.log(e.data); - * } - * } - */ -function isError(error, code) { - return (error && error.code === code); -} -/** - * Returns true if %%error%% is a [[CallExceptionError]. - */ -function isCallException(error) { - return isError(error, "CALL_EXCEPTION"); -} -/** - * Returns a new Error configured to the format ethers emits errors, with - * the %%message%%, [[api:ErrorCode]] %%code%% and additional properties - * for the corresponding EthersError. - * - * Each error in ethers includes the version of ethers, a - * machine-readable [[ErrorCode]], and depending on %%code%%, additional - * required properties. The error message will also include the %%message%%, - * ethers version, %%code%% and all additional properties, serialized. - */ -function makeError(message, code, info) { - let shortMessage = message; - { - const details = []; - if (info) { - if ("message" in info || "code" in info || "name" in info) { - throw new Error(`value will overwrite populated values: ${stringify$1(info)}`); - } - for (const key in info) { - if (key === "shortMessage") { - continue; - } - const value = (info[key]); - // try { - details.push(key + "=" + stringify$1(value)); - // } catch (error: any) { - // console.log("MMM", error.message); - // details.push(key + "=[could not serialize object]"); - // } - } - } - details.push(`code=${code}`); - details.push(`version=${version}`); - if (details.length) { - message += " (" + details.join(", ") + ")"; - } - } - let error; - switch (code) { - case "INVALID_ARGUMENT": - error = new TypeError(message); - break; - case "NUMERIC_FAULT": - case "BUFFER_OVERRUN": - error = new RangeError(message); - break; - default: - error = new Error(message); - } - defineProperties(error, { code }); - if (info) { - Object.assign(error, info); - } - if (error.shortMessage == null) { - defineProperties(error, { shortMessage }); - } - return error; -} -/** - * Throws an EthersError with %%message%%, %%code%% and additional error - * %%info%% when %%check%% is falsish.. - * - * @see [[api:makeError]] - */ -function assert(check, message, code, info) { - if (!check) { - throw makeError(message, code, info); - } -} -/** - * A simple helper to simply ensuring provided arguments match expected - * constraints, throwing if not. - * - * In TypeScript environments, the %%check%% has been asserted true, so - * any further code does not need additional compile-time checks. - */ -function assertArgument(check, message, name, value) { - assert(check, message, "INVALID_ARGUMENT", { argument: name, value: value }); -} -function assertArgumentCount(count, expectedCount, message) { - if (message == null) { - message = ""; - } - if (message) { - message = ": " + message; - } - assert(count >= expectedCount, "missing argument" + message, "MISSING_ARGUMENT", { - count: count, - expectedCount: expectedCount - }); - assert(count <= expectedCount, "too many arguments" + message, "UNEXPECTED_ARGUMENT", { - count: count, - expectedCount: expectedCount - }); -} -const _normalizeForms = ["NFD", "NFC", "NFKD", "NFKC"].reduce((accum, form) => { - try { - // General test for normalize - /* c8 ignore start */ - if ("test".normalize(form) !== "test") { - throw new Error("bad"); - } - ; - /* c8 ignore stop */ - if (form === "NFD") { - const check = String.fromCharCode(0xe9).normalize("NFD"); - const expected = String.fromCharCode(0x65, 0x0301); - /* c8 ignore start */ - if (check !== expected) { - throw new Error("broken"); - } - /* c8 ignore stop */ - } - accum.push(form); - } - catch (error) { } - return accum; -}, []); -/** - * Throws if the normalization %%form%% is not supported. - */ -function assertNormalize(form) { - assert(_normalizeForms.indexOf(form) >= 0, "platform missing String.prototype.normalize", "UNSUPPORTED_OPERATION", { - operation: "String.prototype.normalize", info: { form } - }); -} -/** - * Many classes use file-scoped values to guard the constructor, - * making it effectively private. This facilitates that pattern - * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%, - * throwing if not, indicating the %%className%% if provided. - */ -function assertPrivate(givenGuard, guard, className) { - if (className == null) { - className = ""; - } - if (givenGuard !== guard) { - let method = className, operation = "new"; - if (className) { - method += "."; - operation += " " + className; - } - assert(false, `private constructor; use ${method}from* methods`, "UNSUPPORTED_OPERATION", { - operation - }); - } -} - -/** - * Some data helpers. - * - * - * @_subsection api/utils:Data Helpers [about-data] - */ -function _getBytes(value, name, copy) { - if (value instanceof Uint8Array) { - if (copy) { - return new Uint8Array(value); - } - return value; - } - if (typeof (value) === "string" && (value.length % 2) === 0 && - value.match(/^0x[0-9a-f]*$/i)) { - const result = new Uint8Array((value.length - 2) / 2); - let offset = 2; - for (let i = 0; i < result.length; i++) { - result[i] = parseInt(value.substring(offset, offset + 2), 16); - offset += 2; - } - return result; - } - assertArgument(false, "invalid BytesLike value", name || "value", value); -} -/** - * Get a typed Uint8Array for %%value%%. If already a Uint8Array - * the original %%value%% is returned; if a copy is required use - * [[getBytesCopy]]. - * - * @see: getBytesCopy - */ -function getBytes(value, name) { - return _getBytes(value, name, false); -} -/** - * Get a typed Uint8Array for %%value%%, creating a copy if necessary - * to prevent any modifications of the returned value from being - * reflected elsewhere. - * - * @see: getBytes - */ -function getBytesCopy(value, name) { - return _getBytes(value, name, true); -} -/** - * Returns true if %%value%% is a valid [[HexString]]. - * - * If %%length%% is ``true`` or a //number//, it also checks that - * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//) - * bytes of data (e.g. ``0x1234`` is 2 bytes). - */ -function isHexString(value, length) { - if (typeof (value) !== "string" || !value.match(/^0x[0-9A-Fa-f]*$/)) { - return false; - } - if (typeof (length) === "number" && value.length !== 2 + 2 * length) { - return false; - } - if (length === true && (value.length % 2) !== 0) { - return false; - } - return true; -} -/** - * Returns true if %%value%% is a valid representation of arbitrary - * data (i.e. a valid [[DataHexString]] or a Uint8Array). - */ -function isBytesLike(value) { - return (isHexString(value, true) || (value instanceof Uint8Array)); -} -const HexCharacters = "0123456789abcdef"; -/** - * Returns a [[DataHexString]] representation of %%data%%. - */ -function hexlify(data) { - const bytes = getBytes(data); - let result = "0x"; - for (let i = 0; i < bytes.length; i++) { - const v = bytes[i]; - result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f]; - } - return result; -} -/** - * Returns a [[DataHexString]] by concatenating all values - * within %%data%%. - */ -function concat(datas) { - return "0x" + datas.map((d) => hexlify(d).substring(2)).join(""); -} -/** - * Returns the length of %%data%%, in bytes. - */ -function dataLength(data) { - if (isHexString(data, true)) { - return (data.length - 2) / 2; - } - return getBytes(data).length; -} -/** - * Returns a [[DataHexString]] by slicing %%data%% from the %%start%% - * offset to the %%end%% offset. - * - * By default %%start%% is 0 and %%end%% is the length of %%data%%. - */ -function dataSlice(data, start, end) { - const bytes = getBytes(data); - if (end != null && end > bytes.length) { - assert(false, "cannot slice beyond data bounds", "BUFFER_OVERRUN", { - buffer: bytes, length: bytes.length, offset: end - }); - } - return hexlify(bytes.slice((start == null) ? 0 : start, (end == null) ? bytes.length : end)); -} -/** - * Return the [[DataHexString]] result by stripping all **leading** - ** zero bytes from %%data%%. - */ -function stripZerosLeft(data) { - let bytes = hexlify(data).substring(2); - while (bytes.startsWith("00")) { - bytes = bytes.substring(2); - } - return "0x" + bytes; -} -function zeroPad(data, length, left) { - const bytes = getBytes(data); - assert(length >= bytes.length, "padding exceeds data length", "BUFFER_OVERRUN", { - buffer: new Uint8Array(bytes), - length: length, - offset: length + 1 - }); - const result = new Uint8Array(length); - result.fill(0); - if (left) { - result.set(bytes, length - bytes.length); - } - else { - result.set(bytes, 0); - } - return hexlify(result); -} -/** - * Return the [[DataHexString]] of %%data%% padded on the **left** - * to %%length%% bytes. - * - * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is - * thrown. - * - * This pads data the same as **values** are in Solidity - * (e.g. ``uint128``). - */ -function zeroPadValue(data, length) { - return zeroPad(data, length, true); -} -/** - * Return the [[DataHexString]] of %%data%% padded on the **right** - * to %%length%% bytes. - * - * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is - * thrown. - * - * This pads data the same as **bytes** are in Solidity - * (e.g. ``bytes16``). - */ -function zeroPadBytes(data, length) { - return zeroPad(data, length, false); -} - -/** - * Some mathematic operations. - * - * @_subsection: api/utils:Math Helpers [about-maths] - */ -const BN_0$a = BigInt(0); -const BN_1$5 = BigInt(1); -//const BN_Max256 = (BN_1 << BigInt(256)) - BN_1; -// IEEE 754 support 53-bits of mantissa -const maxValue = 0x1fffffffffffff; -/** - * Convert %%value%% from a twos-compliment representation of %%width%% - * bits to its value. - * - * If the highest bit is ``1``, the result will be negative. - */ -function fromTwos(_value, _width) { - const value = getUint(_value, "value"); - const width = BigInt(getNumber(_width, "width")); - assert((value >> width) === BN_0$a, "overflow", "NUMERIC_FAULT", { - operation: "fromTwos", fault: "overflow", value: _value - }); - // Top bit set; treat as a negative value - if (value >> (width - BN_1$5)) { - const mask = (BN_1$5 << width) - BN_1$5; - return -(((~value) & mask) + BN_1$5); - } - return value; -} -/** - * Convert %%value%% to a twos-compliment representation of - * %%width%% bits. - * - * The result will always be positive. - */ -function toTwos(_value, _width) { - let value = getBigInt(_value, "value"); - const width = BigInt(getNumber(_width, "width")); - const limit = (BN_1$5 << (width - BN_1$5)); - if (value < BN_0$a) { - value = -value; - assert(value <= limit, "too low", "NUMERIC_FAULT", { - operation: "toTwos", fault: "overflow", value: _value - }); - const mask = (BN_1$5 << width) - BN_1$5; - return ((~value) & mask) + BN_1$5; - } - else { - assert(value < limit, "too high", "NUMERIC_FAULT", { - operation: "toTwos", fault: "overflow", value: _value - }); - } - return value; -} -/** - * Mask %%value%% with a bitmask of %%bits%% ones. - */ -function mask(_value, _bits) { - const value = getUint(_value, "value"); - const bits = BigInt(getNumber(_bits, "bits")); - return value & ((BN_1$5 << bits) - BN_1$5); -} -/** - * Gets a BigInt from %%value%%. If it is an invalid value for - * a BigInt, then an ArgumentError will be thrown for %%name%%. - */ -function getBigInt(value, name) { - switch (typeof (value)) { - case "bigint": return value; - case "number": - assertArgument(Number.isInteger(value), "underflow", name || "value", value); - assertArgument(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); - return BigInt(value); - case "string": - try { - if (value === "") { - throw new Error("empty string"); - } - if (value[0] === "-" && value[1] !== "-") { - return -BigInt(value.substring(1)); - } - return BigInt(value); - } - catch (e) { - assertArgument(false, `invalid BigNumberish string: ${e.message}`, name || "value", value); - } - } - assertArgument(false, "invalid BigNumberish value", name || "value", value); -} -/** - * Returns %%value%% as a bigint, validating it is valid as a bigint - * value and that it is positive. - */ -function getUint(value, name) { - const result = getBigInt(value, name); - assert(result >= BN_0$a, "unsigned value cannot be negative", "NUMERIC_FAULT", { - fault: "overflow", operation: "getUint", value - }); - return result; -} -const Nibbles$1 = "0123456789abcdef"; -/* - * Converts %%value%% to a BigInt. If %%value%% is a Uint8Array, it - * is treated as Big Endian data. - */ -function toBigInt(value) { - if (value instanceof Uint8Array) { - let result = "0x0"; - for (const v of value) { - result += Nibbles$1[v >> 4]; - result += Nibbles$1[v & 0x0f]; - } - return BigInt(result); - } - return getBigInt(value); -} -/** - * Gets a //number// from %%value%%. If it is an invalid value for - * a //number//, then an ArgumentError will be thrown for %%name%%. - */ -function getNumber(value, name) { - switch (typeof (value)) { - case "bigint": - assertArgument(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); - return Number(value); - case "number": - assertArgument(Number.isInteger(value), "underflow", name || "value", value); - assertArgument(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); - return value; - case "string": - try { - if (value === "") { - throw new Error("empty string"); - } - return getNumber(BigInt(value), name); - } - catch (e) { - assertArgument(false, `invalid numeric string: ${e.message}`, name || "value", value); - } - } - assertArgument(false, "invalid numeric value", name || "value", value); -} -/** - * Converts %%value%% to a number. If %%value%% is a Uint8Array, it - * is treated as Big Endian data. Throws if the value is not safe. - */ -function toNumber(value) { - return getNumber(toBigInt(value)); -} -/** - * Converts %%value%% to a Big Endian hexstring, optionally padded to - * %%width%% bytes. - */ -function toBeHex(_value, _width) { - const value = getUint(_value, "value"); - let result = value.toString(16); - if (_width == null) { - // Ensure the value is of even length - if (result.length % 2) { - result = "0" + result; - } - } - else { - const width = getNumber(_width, "width"); - // Special case when both value and width are 0 (see: #5025) - if (width === 0 && value === BN_0$a) { - return "0x"; - } - assert(width * 2 >= result.length, `value exceeds width (${width} bytes)`, "NUMERIC_FAULT", { - operation: "toBeHex", - fault: "overflow", - value: _value - }); - // Pad the value to the required width - while (result.length < (width * 2)) { - result = "0" + result; - } - } - return "0x" + result; -} -/** - * Converts %%value%% to a Big Endian Uint8Array. - */ -function toBeArray(_value, _width) { - const value = getUint(_value, "value"); - if (value === BN_0$a) { - const width = (_width != null) ? getNumber(_width, "width") : 0; - return new Uint8Array(width); - } - let hex = value.toString(16); - if (hex.length % 2) { - hex = "0" + hex; - } - if (_width != null) { - const width = getNumber(_width, "width"); - while (hex.length < (width * 2)) { - hex = "00" + hex; - } - assert((width * 2) === hex.length, `value exceeds width (${width} bytes)`, "NUMERIC_FAULT", { - operation: "toBeArray", - fault: "overflow", - value: _value - }); - } - const result = new Uint8Array(hex.length / 2); - for (let i = 0; i < result.length; i++) { - const offset = i * 2; - result[i] = parseInt(hex.substring(offset, offset + 2), 16); - } - return result; -} -/** - * Returns a [[HexString]] for %%value%% safe to use as a //Quantity//. - * - * A //Quantity// does not have and leading 0 values unless the value is - * the literal value `0x0`. This is most commonly used for JSSON-RPC - * numeric values. - */ -function toQuantity(value) { - let result = hexlify(isBytesLike(value) ? value : toBeArray(value)).substring(2); - while (result.startsWith("0")) { - result = result.substring(1); - } - if (result === "") { - result = "0"; - } - return "0x" + result; -} - -/** - * The [Base58 Encoding](link-base58) scheme allows a **numeric** value - * to be encoded as a compact string using a radix of 58 using only - * alpha-numeric characters. Confusingly similar characters are omitted - * (i.e. ``"l0O"``). - * - * Note that Base58 encodes a **numeric** value, not arbitrary bytes, - * since any zero-bytes on the left would get removed. To mitigate this - * issue most schemes that use Base58 choose specific high-order values - * to ensure non-zero prefixes. - * - * @_subsection: api/utils:Base58 Encoding [about-base58] - */ -const Alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; -let Lookup = null; -function getAlpha(letter) { - if (Lookup == null) { - Lookup = {}; - for (let i = 0; i < Alphabet.length; i++) { - Lookup[Alphabet[i]] = BigInt(i); - } - } - const result = Lookup[letter]; - assertArgument(result != null, `invalid base58 value`, "letter", letter); - return result; -} -const BN_0$9 = BigInt(0); -const BN_58 = BigInt(58); -/** - * Encode %%value%% as a Base58-encoded string. - */ -function encodeBase58(_value) { - const bytes = getBytes(_value); - let value = toBigInt(bytes); - let result = ""; - while (value) { - result = Alphabet[Number(value % BN_58)] + result; - value /= BN_58; - } - // Account for leading padding zeros - for (let i = 0; i < bytes.length; i++) { - if (bytes[i]) { - break; - } - result = Alphabet[0] + result; - } - return result; -} -/** - * Decode the Base58-encoded %%value%%. - */ -function decodeBase58(value) { - let result = BN_0$9; - for (let i = 0; i < value.length; i++) { - result *= BN_58; - result += getAlpha(value[i]); - } - return result; -} - -// utils/base64-browser -function decodeBase64(textData) { - textData = atob(textData); - const data = new Uint8Array(textData.length); - for (let i = 0; i < textData.length; i++) { - data[i] = textData.charCodeAt(i); - } - return getBytes(data); -} -function encodeBase64(_data) { - const data = getBytes(_data); - let textData = ""; - for (let i = 0; i < data.length; i++) { - textData += String.fromCharCode(data[i]); - } - return btoa(textData); -} - -/** - * Events allow for applications to use the observer pattern, which - * allows subscribing and publishing events, outside the normal - * execution paths. - * - * @_section api/utils/events:Events [about-events] - */ -/** - * When an [[EventEmitterable]] triggers a [[Listener]], the - * callback always ahas one additional argument passed, which is - * an **EventPayload**. - */ -class EventPayload { - /** - * The event filter. - */ - filter; - /** - * The **EventEmitterable**. - */ - emitter; - #listener; - /** - * Create a new **EventPayload** for %%emitter%% with - * the %%listener%% and for %%filter%%. - */ - constructor(emitter, listener, filter) { - this.#listener = listener; - defineProperties(this, { emitter, filter }); - } - /** - * Unregister the triggered listener for future events. - */ - async removeListener() { - if (this.#listener == null) { - return; - } - await this.emitter.off(this.filter, this.#listener); - } -} - -/** - * Using strings in Ethereum (or any security-basd system) requires - * additional care. These utilities attempt to mitigate some of the - * safety issues as well as provide the ability to recover and analyse - * strings. - * - * @_subsection api/utils:Strings and UTF-8 [about-strings] - */ -function errorFunc(reason, offset, bytes, output, badCodepoint) { - assertArgument(false, `invalid codepoint at offset ${offset}; ${reason}`, "bytes", bytes); -} -function ignoreFunc(reason, offset, bytes, output, badCodepoint) { - // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes - if (reason === "BAD_PREFIX" || reason === "UNEXPECTED_CONTINUE") { - let i = 0; - for (let o = offset + 1; o < bytes.length; o++) { - if (bytes[o] >> 6 !== 0x02) { - break; - } - i++; - } - return i; - } - // This byte runs us past the end of the string, so just jump to the end - // (but the first byte was read already read and therefore skipped) - if (reason === "OVERRUN") { - return bytes.length - offset - 1; - } - // Nothing to skip - return 0; -} -function replaceFunc(reason, offset, bytes, output, badCodepoint) { - // Overlong representations are otherwise "valid" code points; just non-deistingtished - if (reason === "OVERLONG") { - assertArgument(typeof (badCodepoint) === "number", "invalid bad code point for replacement", "badCodepoint", badCodepoint); - output.push(badCodepoint); - return 0; - } - // Put the replacement character into the output - output.push(0xfffd); - // Otherwise, process as if ignoring errors - return ignoreFunc(reason, offset, bytes); -} -/** - * A handful of popular, built-in UTF-8 error handling strategies. - * - * **``"error"``** - throws on ANY illegal UTF-8 sequence or - * non-canonical (overlong) codepoints (this is the default) - * - * **``"ignore"``** - silently drops any illegal UTF-8 sequence - * and accepts non-canonical (overlong) codepoints - * - * **``"replace"``** - replace any illegal UTF-8 sequence with the - * UTF-8 replacement character (i.e. ``"\\ufffd"``) and accepts - * non-canonical (overlong) codepoints - * - * @returns: Record<"error" | "ignore" | "replace", Utf8ErrorFunc> - */ -const Utf8ErrorFuncs = Object.freeze({ - error: errorFunc, - ignore: ignoreFunc, - replace: replaceFunc -}); -// http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499 -function getUtf8CodePoints(_bytes, onError) { - if (onError == null) { - onError = Utf8ErrorFuncs.error; - } - const bytes = getBytes(_bytes, "bytes"); - const result = []; - let i = 0; - // Invalid bytes are ignored - while (i < bytes.length) { - const c = bytes[i++]; - // 0xxx xxxx - if (c >> 7 === 0) { - result.push(c); - continue; - } - // Multibyte; how many bytes left for this character? - let extraLength = null; - let overlongMask = null; - // 110x xxxx 10xx xxxx - if ((c & 0xe0) === 0xc0) { - extraLength = 1; - overlongMask = 0x7f; - // 1110 xxxx 10xx xxxx 10xx xxxx - } - else if ((c & 0xf0) === 0xe0) { - extraLength = 2; - overlongMask = 0x7ff; - // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx - } - else if ((c & 0xf8) === 0xf0) { - extraLength = 3; - overlongMask = 0xffff; - } - else { - if ((c & 0xc0) === 0x80) { - i += onError("UNEXPECTED_CONTINUE", i - 1, bytes, result); - } - else { - i += onError("BAD_PREFIX", i - 1, bytes, result); - } - continue; - } - // Do we have enough bytes in our data? - if (i - 1 + extraLength >= bytes.length) { - i += onError("OVERRUN", i - 1, bytes, result); - continue; - } - // Remove the length prefix from the char - let res = c & ((1 << (8 - extraLength - 1)) - 1); - for (let j = 0; j < extraLength; j++) { - let nextChar = bytes[i]; - // Invalid continuation byte - if ((nextChar & 0xc0) != 0x80) { - i += onError("MISSING_CONTINUE", i, bytes, result); - res = null; - break; - } - res = (res << 6) | (nextChar & 0x3f); - i++; - } - // See above loop for invalid continuation byte - if (res === null) { - continue; - } - // Maximum code point - if (res > 0x10ffff) { - i += onError("OUT_OF_RANGE", i - 1 - extraLength, bytes, result, res); - continue; - } - // Reserved for UTF-16 surrogate halves - if (res >= 0xd800 && res <= 0xdfff) { - i += onError("UTF16_SURROGATE", i - 1 - extraLength, bytes, result, res); - continue; - } - // Check for overlong sequences (more bytes than needed) - if (res <= overlongMask) { - i += onError("OVERLONG", i - 1 - extraLength, bytes, result, res); - continue; - } - result.push(res); - } - return result; -} -// http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array -/** - * Returns the UTF-8 byte representation of %%str%%. - * - * If %%form%% is specified, the string is normalized. - */ -function toUtf8Bytes(str, form) { - assertArgument(typeof (str) === "string", "invalid string value", "str", str); - if (form != null) { - assertNormalize(form); - str = str.normalize(form); - } - let result = []; - for (let i = 0; i < str.length; i++) { - const c = str.charCodeAt(i); - if (c < 0x80) { - result.push(c); - } - else if (c < 0x800) { - result.push((c >> 6) | 0xc0); - result.push((c & 0x3f) | 0x80); - } - else if ((c & 0xfc00) == 0xd800) { - i++; - const c2 = str.charCodeAt(i); - assertArgument(i < str.length && ((c2 & 0xfc00) === 0xdc00), "invalid surrogate pair", "str", str); - // Surrogate Pair - const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff); - result.push((pair >> 18) | 0xf0); - result.push(((pair >> 12) & 0x3f) | 0x80); - result.push(((pair >> 6) & 0x3f) | 0x80); - result.push((pair & 0x3f) | 0x80); - } - else { - result.push((c >> 12) | 0xe0); - result.push(((c >> 6) & 0x3f) | 0x80); - result.push((c & 0x3f) | 0x80); - } - } - return new Uint8Array(result); -} -//export -function _toUtf8String(codePoints) { - return codePoints.map((codePoint) => { - if (codePoint <= 0xffff) { - return String.fromCharCode(codePoint); - } - codePoint -= 0x10000; - return String.fromCharCode((((codePoint >> 10) & 0x3ff) + 0xd800), ((codePoint & 0x3ff) + 0xdc00)); - }).join(""); -} -/** - * Returns the string represented by the UTF-8 data %%bytes%%. - * - * When %%onError%% function is specified, it is called on UTF-8 - * errors allowing recovery using the [[Utf8ErrorFunc]] API. - * (default: [error](Utf8ErrorFuncs)) - */ -function toUtf8String(bytes, onError) { - return _toUtf8String(getUtf8CodePoints(bytes, onError)); -} -/** - * Returns the UTF-8 code-points for %%str%%. - * - * If %%form%% is specified, the string is normalized. - */ -function toUtf8CodePoints(str, form) { - return getUtf8CodePoints(toUtf8Bytes(str, form)); -} - -function createGetUrl(options) { - async function getUrl(req, _signal) { - assert(_signal == null || !_signal.cancelled, "request cancelled before sending", "CANCELLED"); - const protocol = req.url.split(":")[0].toLowerCase(); - assert(protocol === "http" || protocol === "https", `unsupported protocol ${protocol}`, "UNSUPPORTED_OPERATION", { - info: { protocol }, - operation: "request" - }); - assert(protocol === "https" || !req.credentials || req.allowInsecureAuthentication, "insecure authorized connections unsupported", "UNSUPPORTED_OPERATION", { - operation: "request" - }); - let error = null; - const controller = new AbortController(); - const timer = setTimeout(() => { - error = makeError("request timeout", "TIMEOUT"); - controller.abort(); - }, req.timeout); - if (_signal) { - _signal.addListener(() => { - error = makeError("request cancelled", "CANCELLED"); - controller.abort(); - }); - } - const init = Object.assign({}, options, { - method: req.method, - headers: new Headers(Array.from(req)), - body: req.body || undefined, - signal: controller.signal - }); - let resp; - try { - resp = await fetch(req.url, init); - } - catch (_error) { - clearTimeout(timer); - if (error) { - throw error; - } - throw _error; - } - clearTimeout(timer); - const headers = {}; - resp.headers.forEach((value, key) => { - headers[key.toLowerCase()] = value; - }); - const respBody = await resp.arrayBuffer(); - const body = (respBody == null) ? null : new Uint8Array(respBody); - return { - statusCode: resp.status, - statusMessage: resp.statusText, - headers, body - }; - } - return getUrl; -} - -/** - * Fetching content from the web is environment-specific, so Ethers - * provides an abstraction that each environment can implement to provide - * this service. - * - * On [Node.js](link-node), the ``http`` and ``https`` libs are used to - * create a request object, register event listeners and process data - * and populate the [[FetchResponse]]. - * - * In a browser, the [DOM fetch](link-js-fetch) is used, and the resulting - * ``Promise`` is waited on to retrieve the payload. - * - * The [[FetchRequest]] is responsible for handling many common situations, - * such as redirects, server throttling, authentication, etc. - * - * It also handles common gateways, such as IPFS and data URIs. - * - * @_section api/utils/fetching:Fetching Web Content [about-fetch] - */ -const MAX_ATTEMPTS = 12; -const SLOT_INTERVAL = 250; -// The global FetchGetUrlFunc implementation. -let defaultGetUrlFunc = createGetUrl(); -const reData = new RegExp("^data:([^;:]*)?(;base64)?,(.*)$", "i"); -const reIpfs = new RegExp("^ipfs:/\/(ipfs/)?(.*)$", "i"); -// If locked, new Gateways cannot be added -let locked$5 = false; -// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs -async function dataGatewayFunc(url, signal) { - try { - const match = url.match(reData); - if (!match) { - throw new Error("invalid data"); - } - return new FetchResponse(200, "OK", { - "content-type": (match[1] || "text/plain"), - }, (match[2] ? decodeBase64(match[3]) : unpercent(match[3]))); - } - catch (error) { - return new FetchResponse(599, "BAD REQUEST (invalid data: URI)", {}, null, new FetchRequest(url)); - } -} -/** - * Returns a [[FetchGatewayFunc]] for fetching content from a standard - * IPFS gateway hosted at %%baseUrl%%. - */ -function getIpfsGatewayFunc(baseUrl) { - async function gatewayIpfs(url, signal) { - try { - const match = url.match(reIpfs); - if (!match) { - throw new Error("invalid link"); - } - return new FetchRequest(`${baseUrl}${match[2]}`); - } - catch (error) { - return new FetchResponse(599, "BAD REQUEST (invalid IPFS URI)", {}, null, new FetchRequest(url)); - } - } - return gatewayIpfs; -} -const Gateways = { - "data": dataGatewayFunc, - "ipfs": getIpfsGatewayFunc("https:/\/gateway.ipfs.io/ipfs/") -}; -const fetchSignals = new WeakMap(); -/** - * @_ignore - */ -class FetchCancelSignal { - #listeners; - #cancelled; - constructor(request) { - this.#listeners = []; - this.#cancelled = false; - fetchSignals.set(request, () => { - if (this.#cancelled) { - return; - } - this.#cancelled = true; - for (const listener of this.#listeners) { - setTimeout(() => { listener(); }, 0); - } - this.#listeners = []; - }); - } - addListener(listener) { - assert(!this.#cancelled, "singal already cancelled", "UNSUPPORTED_OPERATION", { - operation: "fetchCancelSignal.addCancelListener" - }); - this.#listeners.push(listener); - } - get cancelled() { return this.#cancelled; } - checkSignal() { - assert(!this.cancelled, "cancelled", "CANCELLED", {}); - } -} -// Check the signal, throwing if it is cancelled -function checkSignal(signal) { - if (signal == null) { - throw new Error("missing signal; should not happen"); - } - signal.checkSignal(); - return signal; -} -/** - * Represents a request for a resource using a URI. - * - * By default, the supported schemes are ``HTTP``, ``HTTPS``, ``data:``, - * and ``IPFS:``. - * - * Additional schemes can be added globally using [[registerGateway]]. - * - * @example: - * req = new FetchRequest("https://www.ricmoo.com") - * resp = await req.send() - * resp.body.length - * //_result: - */ -class FetchRequest { - #allowInsecure; - #gzip; - #headers; - #method; - #timeout; - #url; - #body; - #bodyType; - #creds; - // Hooks - #preflight; - #process; - #retry; - #signal; - #throttle; - #getUrlFunc; - /** - * The fetch URL to request. - */ - get url() { return this.#url; } - set url(url) { - this.#url = String(url); - } - /** - * The fetch body, if any, to send as the request body. //(default: null)// - * - * When setting a body, the intrinsic ``Content-Type`` is automatically - * set and will be used if **not overridden** by setting a custom - * header. - * - * If %%body%% is null, the body is cleared (along with the - * intrinsic ``Content-Type``). - * - * If %%body%% is a string, the intrinsic ``Content-Type`` is set to - * ``text/plain``. - * - * If %%body%% is a Uint8Array, the intrinsic ``Content-Type`` is set to - * ``application/octet-stream``. - * - * If %%body%% is any other object, the intrinsic ``Content-Type`` is - * set to ``application/json``. - */ - get body() { - if (this.#body == null) { - return null; - } - return new Uint8Array(this.#body); - } - set body(body) { - if (body == null) { - this.#body = undefined; - this.#bodyType = undefined; - } - else if (typeof (body) === "string") { - this.#body = toUtf8Bytes(body); - this.#bodyType = "text/plain"; - } - else if (body instanceof Uint8Array) { - this.#body = body; - this.#bodyType = "application/octet-stream"; - } - else if (typeof (body) === "object") { - this.#body = toUtf8Bytes(JSON.stringify(body)); - this.#bodyType = "application/json"; - } - else { - throw new Error("invalid body"); - } - } - /** - * Returns true if the request has a body. - */ - hasBody() { - return (this.#body != null); - } - /** - * The HTTP method to use when requesting the URI. If no method - * has been explicitly set, then ``GET`` is used if the body is - * null and ``POST`` otherwise. - */ - get method() { - if (this.#method) { - return this.#method; - } - if (this.hasBody()) { - return "POST"; - } - return "GET"; - } - set method(method) { - if (method == null) { - method = ""; - } - this.#method = String(method).toUpperCase(); - } - /** - * The headers that will be used when requesting the URI. All - * keys are lower-case. - * - * This object is a copy, so any changes will **NOT** be reflected - * in the ``FetchRequest``. - * - * To set a header entry, use the ``setHeader`` method. - */ - get headers() { - const headers = Object.assign({}, this.#headers); - if (this.#creds) { - headers["authorization"] = `Basic ${encodeBase64(toUtf8Bytes(this.#creds))}`; - } - if (this.allowGzip) { - headers["accept-encoding"] = "gzip"; - } - if (headers["content-type"] == null && this.#bodyType) { - headers["content-type"] = this.#bodyType; - } - if (this.body) { - headers["content-length"] = String(this.body.length); - } - return headers; - } - /** - * Get the header for %%key%%, ignoring case. - */ - getHeader(key) { - return this.headers[key.toLowerCase()]; - } - /** - * Set the header for %%key%% to %%value%%. All values are coerced - * to a string. - */ - setHeader(key, value) { - this.#headers[String(key).toLowerCase()] = String(value); - } - /** - * Clear all headers, resetting all intrinsic headers. - */ - clearHeaders() { - this.#headers = {}; - } - [Symbol.iterator]() { - const headers = this.headers; - const keys = Object.keys(headers); - let index = 0; - return { - next: () => { - if (index < keys.length) { - const key = keys[index++]; - return { - value: [key, headers[key]], done: false - }; - } - return { value: undefined, done: true }; - } - }; - } - /** - * The value that will be sent for the ``Authorization`` header. - * - * To set the credentials, use the ``setCredentials`` method. - */ - get credentials() { - return this.#creds || null; - } - /** - * Sets an ``Authorization`` for %%username%% with %%password%%. - */ - setCredentials(username, password) { - assertArgument(!username.match(/:/), "invalid basic authentication username", "username", "[REDACTED]"); - this.#creds = `${username}:${password}`; - } - /** - * Enable and request gzip-encoded responses. The response will - * automatically be decompressed. //(default: true)// - */ - get allowGzip() { - return this.#gzip; - } - set allowGzip(value) { - this.#gzip = !!value; - } - /** - * Allow ``Authentication`` credentials to be sent over insecure - * channels. //(default: false)// - */ - get allowInsecureAuthentication() { - return !!this.#allowInsecure; - } - set allowInsecureAuthentication(value) { - this.#allowInsecure = !!value; - } - /** - * The timeout (in milliseconds) to wait for a complete response. - * //(default: 5 minutes)// - */ - get timeout() { return this.#timeout; } - set timeout(timeout) { - assertArgument(timeout >= 0, "timeout must be non-zero", "timeout", timeout); - this.#timeout = timeout; - } - /** - * This function is called prior to each request, for example - * during a redirection or retry in case of server throttling. - * - * This offers an opportunity to populate headers or update - * content before sending a request. - */ - get preflightFunc() { - return this.#preflight || null; - } - set preflightFunc(preflight) { - this.#preflight = preflight; - } - /** - * This function is called after each response, offering an - * opportunity to provide client-level throttling or updating - * response data. - * - * Any error thrown in this causes the ``send()`` to throw. - * - * To schedule a retry attempt (assuming the maximum retry limit - * has not been reached), use [[response.throwThrottleError]]. - */ - get processFunc() { - return this.#process || null; - } - set processFunc(process) { - this.#process = process; - } - /** - * This function is called on each retry attempt. - */ - get retryFunc() { - return this.#retry || null; - } - set retryFunc(retry) { - this.#retry = retry; - } - /** - * This function is called to fetch content from HTTP and - * HTTPS URLs and is platform specific (e.g. nodejs vs - * browsers). - * - * This is by default the currently registered global getUrl - * function, which can be changed using [[registerGetUrl]]. - * If this has been set, setting is to ``null`` will cause - * this FetchRequest (and any future clones) to revert back to - * using the currently registered global getUrl function. - * - * Setting this is generally not necessary, but may be useful - * for developers that wish to intercept requests or to - * configurege a proxy or other agent. - */ - get getUrlFunc() { - return this.#getUrlFunc || defaultGetUrlFunc; - } - set getUrlFunc(value) { - this.#getUrlFunc = value; - } - /** - * Create a new FetchRequest instance with default values. - * - * Once created, each property may be set before issuing a - * ``.send()`` to make the request. - */ - constructor(url) { - this.#url = String(url); - this.#allowInsecure = false; - this.#gzip = true; - this.#headers = {}; - this.#method = ""; - this.#timeout = 300000; - this.#throttle = { - slotInterval: SLOT_INTERVAL, - maxAttempts: MAX_ATTEMPTS - }; - this.#getUrlFunc = null; - } - toString() { - return ``; - } - /** - * Update the throttle parameters used to determine maximum - * attempts and exponential-backoff properties. - */ - setThrottleParams(params) { - if (params.slotInterval != null) { - this.#throttle.slotInterval = params.slotInterval; - } - if (params.maxAttempts != null) { - this.#throttle.maxAttempts = params.maxAttempts; - } - } - async #send(attempt, expires, delay, _request, _response) { - if (attempt >= this.#throttle.maxAttempts) { - return _response.makeServerError("exceeded maximum retry limit"); - } - assert(getTime$2() <= expires, "timeout", "TIMEOUT", { - operation: "request.send", reason: "timeout", request: _request - }); - if (delay > 0) { - await wait(delay); - } - let req = this.clone(); - const scheme = (req.url.split(":")[0] || "").toLowerCase(); - // Process any Gateways - if (scheme in Gateways) { - const result = await Gateways[scheme](req.url, checkSignal(_request.#signal)); - if (result instanceof FetchResponse) { - let response = result; - if (this.processFunc) { - checkSignal(_request.#signal); - try { - response = await this.processFunc(req, response); - } - catch (error) { - // Something went wrong during processing; throw a 5xx server error - if (error.throttle == null || typeof (error.stall) !== "number") { - response.makeServerError("error in post-processing function", error).assertOk(); - } - // Ignore throttling - } - } - return response; - } - req = result; - } - // We have a preflight function; update the request - if (this.preflightFunc) { - req = await this.preflightFunc(req); - } - const resp = await this.getUrlFunc(req, checkSignal(_request.#signal)); - let response = new FetchResponse(resp.statusCode, resp.statusMessage, resp.headers, resp.body, _request); - if (response.statusCode === 301 || response.statusCode === 302) { - // Redirect - try { - const location = response.headers.location || ""; - return req.redirect(location).#send(attempt + 1, expires, 0, _request, response); - } - catch (error) { } - // Things won't get any better on another attempt; abort - return response; - } - else if (response.statusCode === 429) { - // Throttle - if (this.retryFunc == null || (await this.retryFunc(req, response, attempt))) { - const retryAfter = response.headers["retry-after"]; - let delay = this.#throttle.slotInterval * Math.trunc(Math.random() * Math.pow(2, attempt)); - if (typeof (retryAfter) === "string" && retryAfter.match(/^[1-9][0-9]*$/)) { - delay = parseInt(retryAfter); - } - return req.clone().#send(attempt + 1, expires, delay, _request, response); - } - } - if (this.processFunc) { - checkSignal(_request.#signal); - try { - response = await this.processFunc(req, response); - } - catch (error) { - // Something went wrong during processing; throw a 5xx server error - if (error.throttle == null || typeof (error.stall) !== "number") { - response.makeServerError("error in post-processing function", error).assertOk(); - } - // Throttle - let delay = this.#throttle.slotInterval * Math.trunc(Math.random() * Math.pow(2, attempt)); - if (error.stall >= 0) { - delay = error.stall; - } - return req.clone().#send(attempt + 1, expires, delay, _request, response); - } - } - return response; - } - /** - * Resolves to the response by sending the request. - */ - send() { - assert(this.#signal == null, "request already sent", "UNSUPPORTED_OPERATION", { operation: "fetchRequest.send" }); - this.#signal = new FetchCancelSignal(this); - return this.#send(0, getTime$2() + this.timeout, 0, this, new FetchResponse(0, "", {}, null, this)); - } - /** - * Cancels the inflight response, causing a ``CANCELLED`` - * error to be rejected from the [[send]]. - */ - cancel() { - assert(this.#signal != null, "request has not been sent", "UNSUPPORTED_OPERATION", { operation: "fetchRequest.cancel" }); - const signal = fetchSignals.get(this); - if (!signal) { - throw new Error("missing signal; should not happen"); - } - signal(); - } - /** - * Returns a new [[FetchRequest]] that represents the redirection - * to %%location%%. - */ - redirect(location) { - // Redirection; for now we only support absolute locations - const current = this.url.split(":")[0].toLowerCase(); - const target = location.split(":")[0].toLowerCase(); - // Don't allow redirecting: - // - non-GET requests - // - downgrading the security (e.g. https => http) - // - to non-HTTP (or non-HTTPS) protocols [this could be relaxed?] - assert(this.method === "GET" && (current !== "https" || target !== "http") && location.match(/^https?:/), `unsupported redirect`, "UNSUPPORTED_OPERATION", { - operation: `redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(location)})` - }); - // Create a copy of this request, with a new URL - const req = new FetchRequest(location); - req.method = "GET"; - req.allowGzip = this.allowGzip; - req.timeout = this.timeout; - req.#headers = Object.assign({}, this.#headers); - if (this.#body) { - req.#body = new Uint8Array(this.#body); - } - req.#bodyType = this.#bodyType; - // Do not forward credentials unless on the same domain; only absolute - //req.allowInsecure = false; - // paths are currently supported; may want a way to specify to forward? - //setStore(req.#props, "creds", getStore(this.#pros, "creds")); - return req; - } - /** - * Create a new copy of this request. - */ - clone() { - const clone = new FetchRequest(this.url); - // Preserve "default method" (i.e. null) - clone.#method = this.#method; - // Preserve "default body" with type, copying the Uint8Array is present - if (this.#body) { - clone.#body = this.#body; - } - clone.#bodyType = this.#bodyType; - // Preserve "default headers" - clone.#headers = Object.assign({}, this.#headers); - // Credentials is readonly, so we copy internally - clone.#creds = this.#creds; - if (this.allowGzip) { - clone.allowGzip = true; - } - clone.timeout = this.timeout; - if (this.allowInsecureAuthentication) { - clone.allowInsecureAuthentication = true; - } - clone.#preflight = this.#preflight; - clone.#process = this.#process; - clone.#retry = this.#retry; - clone.#throttle = Object.assign({}, this.#throttle); - clone.#getUrlFunc = this.#getUrlFunc; - return clone; - } - /** - * Locks all static configuration for gateways and FetchGetUrlFunc - * registration. - */ - static lockConfig() { - locked$5 = true; - } - /** - * Get the current Gateway function for %%scheme%%. - */ - static getGateway(scheme) { - return Gateways[scheme.toLowerCase()] || null; - } - /** - * Use the %%func%% when fetching URIs using %%scheme%%. - * - * This method affects all requests globally. - * - * If [[lockConfig]] has been called, no change is made and this - * throws. - */ - static registerGateway(scheme, func) { - scheme = scheme.toLowerCase(); - if (scheme === "http" || scheme === "https") { - throw new Error(`cannot intercept ${scheme}; use registerGetUrl`); - } - if (locked$5) { - throw new Error("gateways locked"); - } - Gateways[scheme] = func; - } - /** - * Use %%getUrl%% when fetching URIs over HTTP and HTTPS requests. - * - * This method affects all requests globally. - * - * If [[lockConfig]] has been called, no change is made and this - * throws. - */ - static registerGetUrl(getUrl) { - if (locked$5) { - throw new Error("gateways locked"); - } - defaultGetUrlFunc = getUrl; - } - /** - * Creates a getUrl function that fetches content from HTTP and - * HTTPS URLs. - * - * The available %%options%% are dependent on the platform - * implementation of the default getUrl function. - * - * This is not generally something that is needed, but is useful - * when trying to customize simple behaviour when fetching HTTP - * content. - */ - static createGetUrlFunc(options) { - return createGetUrl(options); - } - /** - * Creates a function that can "fetch" data URIs. - * - * Note that this is automatically done internally to support - * data URIs, so it is not necessary to register it. - * - * This is not generally something that is needed, but may - * be useful in a wrapper to perfom custom data URI functionality. - */ - static createDataGateway() { - return dataGatewayFunc; - } - /** - * Creates a function that will fetch IPFS (unvalidated) from - * a custom gateway baseUrl. - * - * The default IPFS gateway used internally is - * ``"https:/\/gateway.ipfs.io/ipfs/"``. - */ - static createIpfsGatewayFunc(baseUrl) { - return getIpfsGatewayFunc(baseUrl); - } -} -/** - * The response for a FetchRequest. - */ -class FetchResponse { - #statusCode; - #statusMessage; - #headers; - #body; - #request; - #error; - toString() { - return ``; - } - /** - * The response status code. - */ - get statusCode() { return this.#statusCode; } - /** - * The response status message. - */ - get statusMessage() { return this.#statusMessage; } - /** - * The response headers. All keys are lower-case. - */ - get headers() { return Object.assign({}, this.#headers); } - /** - * The response body, or ``null`` if there was no body. - */ - get body() { - return (this.#body == null) ? null : new Uint8Array(this.#body); - } - /** - * The response body as a UTF-8 encoded string, or the empty - * string (i.e. ``""``) if there was no body. - * - * An error is thrown if the body is invalid UTF-8 data. - */ - get bodyText() { - try { - return (this.#body == null) ? "" : toUtf8String(this.#body); - } - catch (error) { - assert(false, "response body is not valid UTF-8 data", "UNSUPPORTED_OPERATION", { - operation: "bodyText", info: { response: this } - }); - } - } - /** - * The response body, decoded as JSON. - * - * An error is thrown if the body is invalid JSON-encoded data - * or if there was no body. - */ - get bodyJson() { - try { - return JSON.parse(this.bodyText); - } - catch (error) { - assert(false, "response body is not valid JSON", "UNSUPPORTED_OPERATION", { - operation: "bodyJson", info: { response: this } - }); - } - } - [Symbol.iterator]() { - const headers = this.headers; - const keys = Object.keys(headers); - let index = 0; - return { - next: () => { - if (index < keys.length) { - const key = keys[index++]; - return { - value: [key, headers[key]], done: false - }; - } - return { value: undefined, done: true }; - } - }; - } - constructor(statusCode, statusMessage, headers, body, request) { - this.#statusCode = statusCode; - this.#statusMessage = statusMessage; - this.#headers = Object.keys(headers).reduce((accum, k) => { - accum[k.toLowerCase()] = String(headers[k]); - return accum; - }, {}); - this.#body = ((body == null) ? null : new Uint8Array(body)); - this.#request = (request || null); - this.#error = { message: "" }; - } - /** - * Return a Response with matching headers and body, but with - * an error status code (i.e. 599) and %%message%% with an - * optional %%error%%. - */ - makeServerError(message, error) { - let statusMessage; - if (!message) { - message = `${this.statusCode} ${this.statusMessage}`; - statusMessage = `CLIENT ESCALATED SERVER ERROR (${message})`; - } - else { - statusMessage = `CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${message})`; - } - const response = new FetchResponse(599, statusMessage, this.headers, this.body, this.#request || undefined); - response.#error = { message, error }; - return response; - } - /** - * If called within a [request.processFunc](FetchRequest-processFunc) - * call, causes the request to retry as if throttled for %%stall%% - * milliseconds. - */ - throwThrottleError(message, stall) { - if (stall == null) { - stall = -1; - } - else { - assertArgument(Number.isInteger(stall) && stall >= 0, "invalid stall timeout", "stall", stall); - } - const error = new Error(message || "throttling requests"); - defineProperties(error, { stall, throttle: true }); - throw error; - } - /** - * Get the header value for %%key%%, ignoring case. - */ - getHeader(key) { - return this.headers[key.toLowerCase()]; - } - /** - * Returns true if the response has a body. - */ - hasBody() { - return (this.#body != null); - } - /** - * The request made for this response. - */ - get request() { return this.#request; } - /** - * Returns true if this response was a success statusCode. - */ - ok() { - return (this.#error.message === "" && this.statusCode >= 200 && this.statusCode < 300); - } - /** - * Throws a ``SERVER_ERROR`` if this response is not ok. - */ - assertOk() { - if (this.ok()) { - return; - } - let { message, error } = this.#error; - if (message === "") { - message = `server response ${this.statusCode} ${this.statusMessage}`; - } - let requestUrl = null; - if (this.request) { - requestUrl = this.request.url; - } - let responseBody = null; - try { - if (this.#body) { - responseBody = toUtf8String(this.#body); - } - } - catch (e) { } - assert(false, message, "SERVER_ERROR", { - request: (this.request || "unknown request"), response: this, error, - info: { - requestUrl, responseBody, - responseStatus: `${this.statusCode} ${this.statusMessage}` - } - }); - } -} -function getTime$2() { return (new Date()).getTime(); } -function unpercent(value) { - return toUtf8Bytes(value.replace(/%([0-9a-f][0-9a-f])/gi, (all, code) => { - return String.fromCharCode(parseInt(code, 16)); - })); -} -function wait(delay) { - return new Promise((resolve) => setTimeout(resolve, delay)); -} - -/** - * The **FixedNumber** class permits using values with decimal places, - * using fixed-pont math. - * - * Fixed-point math is still based on integers under-the-hood, but uses an - * internal offset to store fractional components below, and each operation - * corrects for this after each operation. - * - * @_section: api/utils/fixed-point-math:Fixed-Point Maths [about-fixed-point-math] - */ -const BN_N1 = BigInt(-1); -const BN_0$8 = BigInt(0); -const BN_1$4 = BigInt(1); -const BN_5 = BigInt(5); -const _guard$5 = {}; -// Constant to pull zeros from for multipliers -let Zeros$1 = "0000"; -while (Zeros$1.length < 80) { - Zeros$1 += Zeros$1; -} -// Returns a string "1" followed by decimal "0"s -function getTens(decimals) { - let result = Zeros$1; - while (result.length < decimals) { - result += result; - } - return BigInt("1" + result.substring(0, decimals)); -} -function checkValue(val, format, safeOp) { - const width = BigInt(format.width); - if (format.signed) { - const limit = (BN_1$4 << (width - BN_1$4)); - assert(safeOp == null || (val >= -limit && val < limit), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - if (val > BN_0$8) { - val = fromTwos(mask(val, width), width); - } - else { - val = -fromTwos(mask(-val, width), width); - } - } - else { - const limit = (BN_1$4 << width); - assert(safeOp == null || (val >= 0 && val < limit), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - val = (((val % limit) + limit) % limit) & (limit - BN_1$4); - } - return val; -} -function getFormat(value) { - if (typeof (value) === "number") { - value = `fixed128x${value}`; - } - let signed = true; - let width = 128; - let decimals = 18; - if (typeof (value) === "string") { - // Parse the format string - if (value === "fixed") ; - else if (value === "ufixed") { - signed = false; - } - else { - const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/); - assertArgument(match, "invalid fixed format", "format", value); - signed = (match[1] !== "u"); - width = parseInt(match[2]); - decimals = parseInt(match[3]); - } - } - else if (value) { - // Extract the values from the object - const v = value; - const check = (key, type, defaultValue) => { - if (v[key] == null) { - return defaultValue; - } - assertArgument(typeof (v[key]) === type, "invalid fixed format (" + key + " not " + type + ")", "format." + key, v[key]); - return v[key]; - }; - signed = check("signed", "boolean", signed); - width = check("width", "number", width); - decimals = check("decimals", "number", decimals); - } - assertArgument((width % 8) === 0, "invalid FixedNumber width (not byte aligned)", "format.width", width); - assertArgument(decimals <= 80, "invalid FixedNumber decimals (too large)", "format.decimals", decimals); - const name = (signed ? "" : "u") + "fixed" + String(width) + "x" + String(decimals); - return { signed, width, decimals, name }; -} -function toString(val, decimals) { - let negative = ""; - if (val < BN_0$8) { - negative = "-"; - val *= BN_N1; - } - let str = val.toString(); - // No decimal point for whole values - if (decimals === 0) { - return (negative + str); - } - // Pad out to the whole component (including a whole digit) - while (str.length <= decimals) { - str = Zeros$1 + str; - } - // Insert the decimal point - const index = str.length - decimals; - str = str.substring(0, index) + "." + str.substring(index); - // Trim the whole component (leaving at least one 0) - while (str[0] === "0" && str[1] !== ".") { - str = str.substring(1); - } - // Trim the decimal component (leaving at least one 0) - while (str[str.length - 1] === "0" && str[str.length - 2] !== ".") { - str = str.substring(0, str.length - 1); - } - return (negative + str); -} -/** - * A FixedNumber represents a value over its [[FixedFormat]] - * arithmetic field. - * - * A FixedNumber can be used to perform math, losslessly, on - * values which have decmial places. - * - * A FixedNumber has a fixed bit-width to store values in, and stores all - * values internally by multiplying the value by 10 raised to the power of - * %%decimals%%. - * - * If operations are performed that cause a value to grow too high (close to - * positive infinity) or too low (close to negative infinity), the value - * is said to //overflow//. - * - * For example, an 8-bit signed value, with 0 decimals may only be within - * the range ``-128`` to ``127``; so ``-128 - 1`` will overflow and become - * ``127``. Likewise, ``127 + 1`` will overflow and become ``-127``. - * - * Many operation have a normal and //unsafe// variant. The normal variant - * will throw a [[NumericFaultError]] on any overflow, while the //unsafe// - * variant will silently allow overflow, corrupting its value value. - * - * If operations are performed that cause a value to become too small - * (close to zero), the value loses precison and is said to //underflow//. - * - * For example, a value with 1 decimal place may store a number as small - * as ``0.1``, but the value of ``0.1 / 2`` is ``0.05``, which cannot fit - * into 1 decimal place, so underflow occurs which means precision is lost - * and the value becomes ``0``. - * - * Some operations have a normal and //signalling// variant. The normal - * variant will silently ignore underflow, while the //signalling// variant - * will thow a [[NumericFaultError]] on underflow. - */ -class FixedNumber { - /** - * The specific fixed-point arithmetic field for this value. - */ - format; - #format; - // The actual value (accounting for decimals) - #val; - // A base-10 value to multiple values by to maintain the magnitude - #tens; - /** - * This is a property so console.log shows a human-meaningful value. - * - * @private - */ - _value; - // Use this when changing this file to get some typing info, - // but then switch to any to mask the internal type - //constructor(guard: any, value: bigint, format: _FixedFormat) { - /** - * @private - */ - constructor(guard, value, format) { - assertPrivate(guard, _guard$5, "FixedNumber"); - this.#val = value; - this.#format = format; - const _value = toString(value, format.decimals); - defineProperties(this, { format: format.name, _value }); - this.#tens = getTens(format.decimals); - } - /** - * If true, negative values are permitted, otherwise only - * positive values and zero are allowed. - */ - get signed() { return this.#format.signed; } - /** - * The number of bits available to store the value. - */ - get width() { return this.#format.width; } - /** - * The number of decimal places in the fixed-point arithment field. - */ - get decimals() { return this.#format.decimals; } - /** - * The value as an integer, based on the smallest unit the - * [[decimals]] allow. - */ - get value() { return this.#val; } - #checkFormat(other) { - assertArgument(this.format === other.format, "incompatible format; use fixedNumber.toFormat", "other", other); - } - #checkValue(val, safeOp) { - /* - const width = BigInt(this.width); - if (this.signed) { - const limit = (BN_1 << (width - BN_1)); - assert(safeOp == null || (val >= -limit && val < limit), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - - if (val > BN_0) { - val = fromTwos(mask(val, width), width); - } else { - val = -fromTwos(mask(-val, width), width); - } - - } else { - const masked = mask(val, width); - assert(safeOp == null || (val >= 0 && val === masked), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - val = masked; - } - */ - val = checkValue(val, this.#format, safeOp); - return new FixedNumber(_guard$5, val, this.#format); - } - #add(o, safeOp) { - this.#checkFormat(o); - return this.#checkValue(this.#val + o.#val, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% added - * to %%other%%, ignoring overflow. - */ - addUnsafe(other) { return this.#add(other); } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% added - * to %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - add(other) { return this.#add(other, "add"); } - #sub(o, safeOp) { - this.#checkFormat(o); - return this.#checkValue(this.#val - o.#val, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%other%% subtracted - * from %%this%%, ignoring overflow. - */ - subUnsafe(other) { return this.#sub(other); } - /** - * Returns a new [[FixedNumber]] with the result of %%other%% subtracted - * from %%this%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - sub(other) { return this.#sub(other, "sub"); } - #mul(o, safeOp) { - this.#checkFormat(o); - return this.#checkValue((this.#val * o.#val) / this.#tens, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%, ignoring overflow and underflow (precision loss). - */ - mulUnsafe(other) { return this.#mul(other); } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - mul(other) { return this.#mul(other, "mul"); } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs or if underflow (precision loss) occurs. - */ - mulSignal(other) { - this.#checkFormat(other); - const value = this.#val * other.#val; - assert((value % this.#tens) === BN_0$8, "precision lost during signalling mul", "NUMERIC_FAULT", { - operation: "mulSignal", fault: "underflow", value: this - }); - return this.#checkValue(value / this.#tens, "mulSignal"); - } - #div(o, safeOp) { - assert(o.#val !== BN_0$8, "division by zero", "NUMERIC_FAULT", { - operation: "div", fault: "divide-by-zero", value: this - }); - this.#checkFormat(o); - return this.#checkValue((this.#val * this.#tens) / o.#val, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%, ignoring underflow (precision loss). A - * [[NumericFaultError]] is thrown if overflow occurs. - */ - divUnsafe(other) { return this.#div(other); } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%, ignoring underflow (precision loss). A - * [[NumericFaultError]] is thrown if overflow occurs. - */ - div(other) { return this.#div(other, "div"); } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%. A [[NumericFaultError]] is thrown if underflow - * (precision loss) occurs. - */ - divSignal(other) { - assert(other.#val !== BN_0$8, "division by zero", "NUMERIC_FAULT", { - operation: "div", fault: "divide-by-zero", value: this - }); - this.#checkFormat(other); - const value = (this.#val * this.#tens); - assert((value % other.#val) === BN_0$8, "precision lost during signalling div", "NUMERIC_FAULT", { - operation: "divSignal", fault: "underflow", value: this - }); - return this.#checkValue(value / other.#val, "divSignal"); - } - /** - * Returns a comparison result between %%this%% and %%other%%. - * - * This is suitable for use in sorting, where ``-1`` implies %%this%% - * is smaller, ``1`` implies %%this%% is larger and ``0`` implies - * both are equal. - */ - cmp(other) { - let a = this.value, b = other.value; - // Coerce a and b to the same magnitude - const delta = this.decimals - other.decimals; - if (delta > 0) { - b *= getTens(delta); - } - else if (delta < 0) { - a *= getTens(-delta); - } - // Comnpare - if (a < b) { - return -1; - } - if (a > b) { - return 1; - } - return 0; - } - /** - * Returns true if %%other%% is equal to %%this%%. - */ - eq(other) { return this.cmp(other) === 0; } - /** - * Returns true if %%other%% is less than to %%this%%. - */ - lt(other) { return this.cmp(other) < 0; } - /** - * Returns true if %%other%% is less than or equal to %%this%%. - */ - lte(other) { return this.cmp(other) <= 0; } - /** - * Returns true if %%other%% is greater than to %%this%%. - */ - gt(other) { return this.cmp(other) > 0; } - /** - * Returns true if %%other%% is greater than or equal to %%this%%. - */ - gte(other) { return this.cmp(other) >= 0; } - /** - * Returns a new [[FixedNumber]] which is the largest **integer** - * that is less than or equal to %%this%%. - * - * The decimal component of the result will always be ``0``. - */ - floor() { - let val = this.#val; - if (this.#val < BN_0$8) { - val -= this.#tens - BN_1$4; - } - val = (this.#val / this.#tens) * this.#tens; - return this.#checkValue(val, "floor"); - } - /** - * Returns a new [[FixedNumber]] which is the smallest **integer** - * that is greater than or equal to %%this%%. - * - * The decimal component of the result will always be ``0``. - */ - ceiling() { - let val = this.#val; - if (this.#val > BN_0$8) { - val += this.#tens - BN_1$4; - } - val = (this.#val / this.#tens) * this.#tens; - return this.#checkValue(val, "ceiling"); - } - /** - * Returns a new [[FixedNumber]] with the decimal component - * rounded up on ties at %%decimals%% places. - */ - round(decimals) { - if (decimals == null) { - decimals = 0; - } - // Not enough precision to not already be rounded - if (decimals >= this.decimals) { - return this; - } - const delta = this.decimals - decimals; - const bump = BN_5 * getTens(delta - 1); - let value = this.value + bump; - const tens = getTens(delta); - value = (value / tens) * tens; - checkValue(value, this.#format, "round"); - return new FixedNumber(_guard$5, value, this.#format); - } - /** - * Returns true if %%this%% is equal to ``0``. - */ - isZero() { return (this.#val === BN_0$8); } - /** - * Returns true if %%this%% is less than ``0``. - */ - isNegative() { return (this.#val < BN_0$8); } - /** - * Returns the string representation of %%this%%. - */ - toString() { return this._value; } - /** - * Returns a float approximation. - * - * Due to IEEE 754 precission (or lack thereof), this function - * can only return an approximation and most values will contain - * rounding errors. - */ - toUnsafeFloat() { return parseFloat(this.toString()); } - /** - * Return a new [[FixedNumber]] with the same value but has had - * its field set to %%format%%. - * - * This will throw if the value cannot fit into %%format%%. - */ - toFormat(format) { - return FixedNumber.fromString(this.toString(), format); - } - /** - * Creates a new [[FixedNumber]] for %%value%% divided by - * %%decimal%% places with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% (once adjusted - * for %%decimals%%) cannot fit in %%format%%, either due to overflow - * or underflow (precision loss). - */ - static fromValue(_value, _decimals, _format) { - const decimals = (_decimals == null) ? 0 : getNumber(_decimals); - const format = getFormat(_format); - let value = getBigInt(_value, "value"); - const delta = decimals - format.decimals; - if (delta > 0) { - const tens = getTens(delta); - assert((value % tens) === BN_0$8, "value loses precision for format", "NUMERIC_FAULT", { - operation: "fromValue", fault: "underflow", value: _value - }); - value /= tens; - } - else if (delta < 0) { - value *= getTens(-delta); - } - checkValue(value, format, "fromValue"); - return new FixedNumber(_guard$5, value, format); - } - /** - * Creates a new [[FixedNumber]] for %%value%% with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% cannot fit - * in %%format%%, either due to overflow or underflow (precision loss). - */ - static fromString(_value, _format) { - const match = _value.match(/^(-?)([0-9]*)\.?([0-9]*)$/); - assertArgument(match && (match[2].length + match[3].length) > 0, "invalid FixedNumber string value", "value", _value); - const format = getFormat(_format); - let whole = (match[2] || "0"), decimal = (match[3] || ""); - // Pad out the decimals - while (decimal.length < format.decimals) { - decimal += Zeros$1; - } - // Check precision is safe - assert(decimal.substring(format.decimals).match(/^0*$/), "too many decimals for format", "NUMERIC_FAULT", { - operation: "fromString", fault: "underflow", value: _value - }); - // Remove extra padding - decimal = decimal.substring(0, format.decimals); - const value = BigInt(match[1] + whole + decimal); - checkValue(value, format, "fromString"); - return new FixedNumber(_guard$5, value, format); - } - /** - * Creates a new [[FixedNumber]] with the big-endian representation - * %%value%% with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% cannot fit - * in %%format%% due to overflow. - */ - static fromBytes(_value, _format) { - let value = toBigInt(getBytes(_value, "value")); - const format = getFormat(_format); - if (format.signed) { - value = fromTwos(value, format.width); - } - checkValue(value, format, "fromBytes"); - return new FixedNumber(_guard$5, value, format); - } -} -//const f1 = FixedNumber.fromString("12.56", "fixed16x2"); -//const f2 = FixedNumber.fromString("0.3", "fixed16x2"); -//console.log(f1.divSignal(f2)); -//const BUMP = FixedNumber.from("0.5"); - -//See: https://github.com/ethereum/wiki/wiki/RLP -function hexlifyByte(value) { - let result = value.toString(16); - while (result.length < 2) { - result = "0" + result; - } - return "0x" + result; -} -function unarrayifyInteger(data, offset, length) { - let result = 0; - for (let i = 0; i < length; i++) { - result = (result * 256) + data[offset + i]; - } - return result; -} -function _decodeChildren(data, offset, childOffset, length) { - const result = []; - while (childOffset < offset + 1 + length) { - const decoded = _decode(data, childOffset); - result.push(decoded.result); - childOffset += decoded.consumed; - assert(childOffset <= offset + 1 + length, "child data too short", "BUFFER_OVERRUN", { - buffer: data, length, offset - }); - } - return { consumed: (1 + length), result: result }; -} -// returns { consumed: number, result: Object } -function _decode(data, offset) { - assert(data.length !== 0, "data too short", "BUFFER_OVERRUN", { - buffer: data, length: 0, offset: 1 - }); - const checkOffset = (offset) => { - assert(offset <= data.length, "data short segment too short", "BUFFER_OVERRUN", { - buffer: data, length: data.length, offset - }); - }; - // Array with extra length prefix - if (data[offset] >= 0xf8) { - const lengthLength = data[offset] - 0xf7; - checkOffset(offset + 1 + lengthLength); - const length = unarrayifyInteger(data, offset + 1, lengthLength); - checkOffset(offset + 1 + lengthLength + length); - return _decodeChildren(data, offset, offset + 1 + lengthLength, lengthLength + length); - } - else if (data[offset] >= 0xc0) { - const length = data[offset] - 0xc0; - checkOffset(offset + 1 + length); - return _decodeChildren(data, offset, offset + 1, length); - } - else if (data[offset] >= 0xb8) { - const lengthLength = data[offset] - 0xb7; - checkOffset(offset + 1 + lengthLength); - const length = unarrayifyInteger(data, offset + 1, lengthLength); - checkOffset(offset + 1 + lengthLength + length); - const result = hexlify(data.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length)); - return { consumed: (1 + lengthLength + length), result: result }; - } - else if (data[offset] >= 0x80) { - const length = data[offset] - 0x80; - checkOffset(offset + 1 + length); - const result = hexlify(data.slice(offset + 1, offset + 1 + length)); - return { consumed: (1 + length), result: result }; - } - return { consumed: 1, result: hexlifyByte(data[offset]) }; -} -/** - * Decodes %%data%% into the structured data it represents. - */ -function decodeRlp(_data) { - const data = getBytes(_data, "data"); - const decoded = _decode(data, 0); - assertArgument(decoded.consumed === data.length, "unexpected junk after rlp payload", "data", _data); - return decoded.result; -} - -//See: https://github.com/ethereum/wiki/wiki/RLP -function arrayifyInteger(value) { - const result = []; - while (value) { - result.unshift(value & 0xff); - value >>= 8; - } - return result; -} -function _encode(object) { - if (Array.isArray(object)) { - let payload = []; - object.forEach(function (child) { - payload = payload.concat(_encode(child)); - }); - if (payload.length <= 55) { - payload.unshift(0xc0 + payload.length); - return payload; - } - const length = arrayifyInteger(payload.length); - length.unshift(0xf7 + length.length); - return length.concat(payload); - } - const data = Array.prototype.slice.call(getBytes(object, "object")); - if (data.length === 1 && data[0] <= 0x7f) { - return data; - } - else if (data.length <= 55) { - data.unshift(0x80 + data.length); - return data; - } - const length = arrayifyInteger(data.length); - length.unshift(0xb7 + length.length); - return length.concat(data); -} -const nibbles = "0123456789abcdef"; -/** - * Encodes %%object%% as an RLP-encoded [[DataHexString]]. - */ -function encodeRlp(object) { - let result = "0x"; - for (const v of _encode(object)) { - result += nibbles[v >> 4]; - result += nibbles[v & 0xf]; - } - return result; -} - -/** - * Most interactions with Ethereum requires integer values, which use - * the smallest magnitude unit. - * - * For example, imagine dealing with dollars and cents. Since dollars - * are divisible, non-integer values are possible, such as ``$10.77``. - * By using the smallest indivisible unit (i.e. cents), the value can - * be kept as the integer ``1077``. - * - * When receiving decimal input from the user (as a decimal string), - * the value should be converted to an integer and when showing a user - * a value, the integer value should be converted to a decimal string. - * - * This creates a clear distinction, between values to be used by code - * (integers) and values used for display logic to users (decimals). - * - * The native unit in Ethereum, //ether// is divisible to 18 decimal places, - * where each individual unit is called a //wei//. - * - * @_subsection api/utils:Unit Conversion [about-units] - */ -const names = [ - "wei", - "kwei", - "mwei", - "gwei", - "szabo", - "finney", - "ether", -]; -/** - * Converts %%value%% into a //decimal string//, assuming %%unit%% decimal - * places. The %%unit%% may be the number of decimal places or the name of - * a unit (e.g. ``"gwei"`` for 9 decimal places). - * - */ -function formatUnits(value, unit) { - let decimals = 18; - if (typeof (unit) === "string") { - const index = names.indexOf(unit); - assertArgument(index >= 0, "invalid unit", "unit", unit); - decimals = 3 * index; - } - else if (unit != null) { - decimals = getNumber(unit, "unit"); - } - return FixedNumber.fromValue(value, decimals, { decimals, width: 512 }).toString(); -} -/** - * Converts the //decimal string// %%value%% to a BigInt, assuming - * %%unit%% decimal places. The %%unit%% may the number of decimal places - * or the name of a unit (e.g. ``"gwei"`` for 9 decimal places). - */ -function parseUnits$1(value, unit) { - assertArgument(typeof (value) === "string", "value must be a string", "value", value); - let decimals = 18; - if (typeof (unit) === "string") { - const index = names.indexOf(unit); - assertArgument(index >= 0, "invalid unit", "unit", unit); - decimals = 3 * index; - } - else if (unit != null) { - decimals = getNumber(unit, "unit"); - } - return FixedNumber.fromString(value, { decimals, width: 512 }).value; -} -/** - * Converts %%value%% into a //decimal string// using 18 decimal places. - */ -function formatEther(wei) { - return formatUnits(wei, 18); -} -/** - * Converts the //decimal string// %%ether%% to a BigInt, using 18 - * decimal places. - */ -function parseEther(ether) { - return parseUnits$1(ether, 18); -} - -/** - * Explain UUID and link to RFC here. - * - * @_subsection: api/utils:UUID [about-uuid] - */ -/** - * Returns the version 4 [[link-uuid]] for the %%randomBytes%%. - * - * @see: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4) - */ -function uuidV4(randomBytes) { - const bytes = getBytes(randomBytes, "randomBytes"); - // Section: 4.1.3: - // - time_hi_and_version[12:16] = 0b0100 - bytes[6] = (bytes[6] & 0x0f) | 0x40; - // Section 4.4 - // - clock_seq_hi_and_reserved[6] = 0b0 - // - clock_seq_hi_and_reserved[7] = 0b1 - bytes[8] = (bytes[8] & 0x3f) | 0x80; - const value = hexlify(bytes); - return [ - value.substring(2, 10), - value.substring(10, 14), - value.substring(14, 18), - value.substring(18, 22), - value.substring(22, 34), - ].join("-"); -} - -/** - * @_ignore: - */ -const WordSize = 32; -const Padding = new Uint8Array(WordSize); -// Properties used to immediate pass through to the underlying object -// - `then` is used to detect if an object is a Promise for await -const passProperties$1 = ["then"]; -const _guard$4 = {}; -const resultNames = new WeakMap(); -function getNames(result) { - return resultNames.get(result); -} -function setNames(result, names) { - resultNames.set(result, names); -} -function throwError(name, error) { - const wrapped = new Error(`deferred error during ABI decoding triggered accessing ${name}`); - wrapped.error = error; - throw wrapped; -} -function toObject(names, items, deep) { - if (names.indexOf(null) >= 0) { - return items.map((item, index) => { - if (item instanceof Result) { - return toObject(getNames(item), item, deep); - } - return item; - }); - } - return names.reduce((accum, name, index) => { - let item = items.getValue(name); - if (!(name in accum)) { - if (deep && item instanceof Result) { - item = toObject(getNames(item), item, deep); - } - accum[name] = item; - } - return accum; - }, {}); -} -/** - * A [[Result]] is a sub-class of Array, which allows accessing any - * of its values either positionally by its index or, if keys are - * provided by its name. - * - * @_docloc: api/abi - */ -class Result extends Array { - // No longer used; but cannot be removed as it will remove the - // #private field from the .d.ts which may break backwards - // compatibility - #names; - /** - * @private - */ - constructor(...args) { - // To properly sub-class Array so the other built-in - // functions work, the constructor has to behave fairly - // well. So, in the event we are created via fromItems() - // we build the read-only Result object we want, but on - // any other input, we use the default constructor - // constructor(guard: any, items: Array, keys?: Array); - const guard = args[0]; - let items = args[1]; - let names = (args[2] || []).slice(); - let wrap = true; - if (guard !== _guard$4) { - items = args; - names = []; - wrap = false; - } - // Can't just pass in ...items since an array of length 1 - // is a special case in the super. - super(items.length); - items.forEach((item, index) => { this[index] = item; }); - // Find all unique keys - const nameCounts = names.reduce((accum, name) => { - if (typeof (name) === "string") { - accum.set(name, (accum.get(name) || 0) + 1); - } - return accum; - }, (new Map())); - // Remove any key thats not unique - setNames(this, Object.freeze(items.map((item, index) => { - const name = names[index]; - if (name != null && nameCounts.get(name) === 1) { - return name; - } - return null; - }))); - // Dummy operations to prevent TypeScript from complaining - this.#names = []; - if (this.#names == null) { - void (this.#names); - } - if (!wrap) { - return; - } - // A wrapped Result is immutable - Object.freeze(this); - // Proxy indices and names so we can trap deferred errors - const proxy = new Proxy(this, { - get: (target, prop, receiver) => { - if (typeof (prop) === "string") { - // Index accessor - if (prop.match(/^[0-9]+$/)) { - const index = getNumber(prop, "%index"); - if (index < 0 || index >= this.length) { - throw new RangeError("out of result range"); - } - const item = target[index]; - if (item instanceof Error) { - throwError(`index ${index}`, item); - } - return item; - } - // Pass important checks (like `then` for Promise) through - if (passProperties$1.indexOf(prop) >= 0) { - return Reflect.get(target, prop, receiver); - } - const value = target[prop]; - if (value instanceof Function) { - // Make sure functions work with private variables - // See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy#no_private_property_forwarding - return function (...args) { - return value.apply((this === receiver) ? target : this, args); - }; - } - else if (!(prop in target)) { - // Possible name accessor - return target.getValue.apply((this === receiver) ? target : this, [prop]); - } - } - return Reflect.get(target, prop, receiver); - } - }); - setNames(proxy, getNames(this)); - return proxy; - } - /** - * Returns the Result as a normal Array. If %%deep%%, any children - * which are Result objects are also converted to a normal Array. - * - * This will throw if there are any outstanding deferred - * errors. - */ - toArray(deep) { - const result = []; - this.forEach((item, index) => { - if (item instanceof Error) { - throwError(`index ${index}`, item); - } - if (deep && item instanceof Result) { - item = item.toArray(deep); - } - result.push(item); - }); - return result; - } - /** - * Returns the Result as an Object with each name-value pair. If - * %%deep%%, any children which are Result objects are also - * converted to an Object. - * - * This will throw if any value is unnamed, or if there are - * any outstanding deferred errors. - */ - toObject(deep) { - const names = getNames(this); - return names.reduce((accum, name, index) => { - assert(name != null, `value at index ${index} unnamed`, "UNSUPPORTED_OPERATION", { - operation: "toObject()" - }); - return toObject(names, this, deep); - }, {}); - } - /** - * @_ignore - */ - slice(start, end) { - if (start == null) { - start = 0; - } - if (start < 0) { - start += this.length; - if (start < 0) { - start = 0; - } - } - if (end == null) { - end = this.length; - } - if (end < 0) { - end += this.length; - if (end < 0) { - end = 0; - } - } - if (end > this.length) { - end = this.length; - } - const _names = getNames(this); - const result = [], names = []; - for (let i = start; i < end; i++) { - result.push(this[i]); - names.push(_names[i]); - } - return new Result(_guard$4, result, names); - } - /** - * @_ignore - */ - filter(callback, thisArg) { - const _names = getNames(this); - const result = [], names = []; - for (let i = 0; i < this.length; i++) { - const item = this[i]; - if (item instanceof Error) { - throwError(`index ${i}`, item); - } - if (callback.call(thisArg, item, i, this)) { - result.push(item); - names.push(_names[i]); - } - } - return new Result(_guard$4, result, names); - } - /** - * @_ignore - */ - map(callback, thisArg) { - const result = []; - for (let i = 0; i < this.length; i++) { - const item = this[i]; - if (item instanceof Error) { - throwError(`index ${i}`, item); - } - result.push(callback.call(thisArg, item, i, this)); - } - return result; - } - /** - * Returns the value for %%name%%. - * - * Since it is possible to have a key whose name conflicts with - * a method on a [[Result]] or its superclass Array, or any - * JavaScript keyword, this ensures all named values are still - * accessible by name. - */ - getValue(name) { - const index = getNames(this).indexOf(name); - if (index === -1) { - return undefined; - } - const value = this[index]; - if (value instanceof Error) { - throwError(`property ${JSON.stringify(name)}`, value.error); - } - return value; - } - /** - * Creates a new [[Result]] for %%items%% with each entry - * also accessible by its corresponding name in %%keys%%. - */ - static fromItems(items, keys) { - return new Result(_guard$4, items, keys); - } -} -/** - * Returns all errors found in a [[Result]]. - * - * Since certain errors encountered when creating a [[Result]] do - * not impact the ability to continue parsing data, they are - * deferred until they are actually accessed. Hence a faulty string - * in an Event that is never used does not impact the program flow. - * - * However, sometimes it may be useful to access, identify or - * validate correctness of a [[Result]]. - * - * @_docloc api/abi - */ -function checkResultErrors(result) { - // Find the first error (if any) - const errors = []; - const checkErrors = function (path, object) { - if (!Array.isArray(object)) { - return; - } - for (let key in object) { - const childPath = path.slice(); - childPath.push(key); - try { - checkErrors(childPath, object[key]); - } - catch (error) { - errors.push({ path: childPath, error: error }); - } - } - }; - checkErrors([], result); - return errors; -} -function getValue$1(value) { - let bytes = toBeArray(value); - assert(bytes.length <= WordSize, "value out-of-bounds", "BUFFER_OVERRUN", { buffer: bytes, length: WordSize, offset: bytes.length }); - if (bytes.length !== WordSize) { - bytes = getBytesCopy(concat([Padding.slice(bytes.length % WordSize), bytes])); - } - return bytes; -} -/** - * @_ignore - */ -class Coder { - // The coder name: - // - address, uint256, tuple, array, etc. - name; - // The fully expanded type, including composite types: - // - address, uint256, tuple(address,bytes), uint256[3][4][], etc. - type; - // The localName bound in the signature, in this example it is "baz": - // - tuple(address foo, uint bar) baz - localName; - // Whether this type is dynamic: - // - Dynamic: bytes, string, address[], tuple(boolean[]), etc. - // - Not Dynamic: address, uint256, boolean[3], tuple(address, uint8) - dynamic; - constructor(name, type, localName, dynamic) { - defineProperties(this, { name, type, localName, dynamic }, { - name: "string", type: "string", localName: "string", dynamic: "boolean" - }); - } - _throwError(message, value) { - assertArgument(false, message, this.localName, value); - } -} -/** - * @_ignore - */ -class Writer { - // An array of WordSize lengthed objects to concatenation - #data; - #dataLength; - constructor() { - this.#data = []; - this.#dataLength = 0; - } - get data() { - return concat(this.#data); - } - get length() { return this.#dataLength; } - #writeData(data) { - this.#data.push(data); - this.#dataLength += data.length; - return data.length; - } - appendWriter(writer) { - return this.#writeData(getBytesCopy(writer.data)); - } - // Arrayish item; pad on the right to *nearest* WordSize - writeBytes(value) { - let bytes = getBytesCopy(value); - const paddingOffset = bytes.length % WordSize; - if (paddingOffset) { - bytes = getBytesCopy(concat([bytes, Padding.slice(paddingOffset)])); - } - return this.#writeData(bytes); - } - // Numeric item; pad on the left *to* WordSize - writeValue(value) { - return this.#writeData(getValue$1(value)); - } - // Inserts a numeric place-holder, returning a callback that can - // be used to asjust the value later - writeUpdatableValue() { - const offset = this.#data.length; - this.#data.push(Padding); - this.#dataLength += WordSize; - return (value) => { - this.#data[offset] = getValue$1(value); - }; - } -} -/** - * @_ignore - */ -class Reader { - // Allows incomplete unpadded data to be read; otherwise an error - // is raised if attempting to overrun the buffer. This is required - // to deal with an old Solidity bug, in which event data for - // external (not public thoguh) was tightly packed. - allowLoose; - #data; - #offset; - #bytesRead; - #parent; - #maxInflation; - constructor(data, allowLoose, maxInflation) { - defineProperties(this, { allowLoose: !!allowLoose }); - this.#data = getBytesCopy(data); - this.#bytesRead = 0; - this.#parent = null; - this.#maxInflation = (maxInflation != null) ? maxInflation : 1024; - this.#offset = 0; - } - get data() { return hexlify(this.#data); } - get dataLength() { return this.#data.length; } - get consumed() { return this.#offset; } - get bytes() { return new Uint8Array(this.#data); } - #incrementBytesRead(count) { - if (this.#parent) { - return this.#parent.#incrementBytesRead(count); - } - this.#bytesRead += count; - // Check for excessive inflation (see: #4537) - assert(this.#maxInflation < 1 || this.#bytesRead <= this.#maxInflation * this.dataLength, `compressed ABI data exceeds inflation ratio of ${this.#maxInflation} ( see: https:/\/github.com/ethers-io/ethers.js/issues/4537 )`, "BUFFER_OVERRUN", { - buffer: getBytesCopy(this.#data), offset: this.#offset, - length: count, info: { - bytesRead: this.#bytesRead, - dataLength: this.dataLength - } - }); - } - #peekBytes(offset, length, loose) { - let alignedLength = Math.ceil(length / WordSize) * WordSize; - if (this.#offset + alignedLength > this.#data.length) { - if (this.allowLoose && loose && this.#offset + length <= this.#data.length) { - alignedLength = length; - } - else { - assert(false, "data out-of-bounds", "BUFFER_OVERRUN", { - buffer: getBytesCopy(this.#data), - length: this.#data.length, - offset: this.#offset + alignedLength - }); - } - } - return this.#data.slice(this.#offset, this.#offset + alignedLength); - } - // Create a sub-reader with the same underlying data, but offset - subReader(offset) { - const reader = new Reader(this.#data.slice(this.#offset + offset), this.allowLoose, this.#maxInflation); - reader.#parent = this; - return reader; - } - // Read bytes - readBytes(length, loose) { - let bytes = this.#peekBytes(0, length, !!loose); - this.#incrementBytesRead(length); - this.#offset += bytes.length; - // @TODO: Make sure the length..end bytes are all 0? - return bytes.slice(0, length); - } - // Read a numeric values - readValue() { - return toBigInt(this.readBytes(WordSize)); - } - readIndex() { - return toNumber(this.readBytes(WordSize)); - } -} - -function number(n) { - if (!Number.isSafeInteger(n) || n < 0) - throw new Error(`Wrong positive integer: ${n}`); -} -function bytes(b, ...lengths) { - if (!(b instanceof Uint8Array)) - throw new Error('Expected Uint8Array'); - if (lengths.length > 0 && !lengths.includes(b.length)) - throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`); -} -function hash(hash) { - if (typeof hash !== 'function' || typeof hash.create !== 'function') - throw new Error('Hash should be wrapped by utils.wrapConstructor'); - number(hash.outputLen); - number(hash.blockLen); -} -function exists(instance, checkFinished = true) { - if (instance.destroyed) - throw new Error('Hash instance has been destroyed'); - if (checkFinished && instance.finished) - throw new Error('Hash#digest() has already been called'); -} -function output(out, instance) { - bytes(out); - const min = instance.outputLen; - if (out.length < min) { - throw new Error(`digestInto() expects output buffer of length at least ${min}`); - } -} - -const crypto$1 = typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined; - -/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+. -// node.js versions earlier than v19 don't declare it in global scope. -// For node.js, package.json#exports field mapping rewrites import -// from `crypto` to `cryptoNode`, which imports native module. -// Makes the utils un-importable in browsers without a bundler. -// Once node.js 18 is deprecated, we can just drop the import. -const u8a$1 = (a) => a instanceof Uint8Array; -const u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); -// Cast array to view -const createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength); -// The rotate right (circular right shift) operation for uint32 -const rotr = (word, shift) => (word << (32 - shift)) | (word >>> shift); -// big-endian hardware is rare. Just in case someone still decides to run hashes: -// early-throw an error because we don't support BE yet. -const isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44; -if (!isLE) - throw new Error('Non little-endian hardware is not supported'); -// There is no setImmediate in browser and setTimeout is slow. -// call of async fn will return Promise, which will be fullfiled only on -// next scheduler queue processing step and this is exactly what we need. -const nextTick = async () => { }; -// Returns control to thread each 'tick' ms to avoid blocking -async function asyncLoop(iters, tick, cb) { - let ts = Date.now(); - for (let i = 0; i < iters; i++) { - cb(i); - // Date.now() is not monotonic, so in case if clock goes backwards we return return control too - const diff = Date.now() - ts; - if (diff >= 0 && diff < tick) - continue; - await nextTick(); - ts += diff; - } -} -/** - * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99]) - */ -function utf8ToBytes$1(str) { - if (typeof str !== 'string') - throw new Error(`utf8ToBytes expected string, got ${typeof str}`); - return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809 -} -/** - * Normalizes (non-hex) string or Uint8Array to Uint8Array. - * Warning: when Uint8Array is passed, it would NOT get copied. - * Keep in mind for future mutable operations. - */ -function toBytes(data) { - if (typeof data === 'string') - data = utf8ToBytes$1(data); - if (!u8a$1(data)) - throw new Error(`expected Uint8Array, got ${typeof data}`); - return data; -} -/** - * Copies several Uint8Arrays into one. - */ -function concatBytes$1(...arrays) { - const r = new Uint8Array(arrays.reduce((sum, a) => sum + a.length, 0)); - let pad = 0; // walk through each item, ensure they have proper type - arrays.forEach((a) => { - if (!u8a$1(a)) - throw new Error('Uint8Array expected'); - r.set(a, pad); - pad += a.length; - }); - return r; -} -// For runtime check if class implements interface -class Hash { - // Safe version that clones internal state - clone() { - return this._cloneInto(); - } -} -const toStr = {}.toString; -function checkOpts(defaults, opts) { - if (opts !== undefined && toStr.call(opts) !== '[object Object]') - throw new Error('Options should be object or undefined'); - const merged = Object.assign(defaults, opts); - return merged; -} -function wrapConstructor(hashCons) { - const hashC = (msg) => hashCons().update(toBytes(msg)).digest(); - const tmp = hashCons(); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = () => hashCons(); - return hashC; -} -/** - * Secure PRNG. Uses `crypto.getRandomValues`, which defers to OS. - */ -function randomBytes$2(bytesLength = 32) { - if (crypto$1 && typeof crypto$1.getRandomValues === 'function') { - return crypto$1.getRandomValues(new Uint8Array(bytesLength)); - } - throw new Error('crypto.getRandomValues must be defined'); -} - -// HMAC (RFC 2104) -class HMAC extends Hash { - constructor(hash$1, _key) { - super(); - this.finished = false; - this.destroyed = false; - hash(hash$1); - const key = toBytes(_key); - this.iHash = hash$1.create(); - if (typeof this.iHash.update !== 'function') - throw new Error('Expected instance of class which extends utils.Hash'); - this.blockLen = this.iHash.blockLen; - this.outputLen = this.iHash.outputLen; - const blockLen = this.blockLen; - const pad = new Uint8Array(blockLen); - // blockLen can be bigger than outputLen - pad.set(key.length > blockLen ? hash$1.create().update(key).digest() : key); - for (let i = 0; i < pad.length; i++) - pad[i] ^= 0x36; - this.iHash.update(pad); - // By doing update (processing of first block) of outer hash here we can re-use it between multiple calls via clone - this.oHash = hash$1.create(); - // Undo internal XOR && apply outer XOR - for (let i = 0; i < pad.length; i++) - pad[i] ^= 0x36 ^ 0x5c; - this.oHash.update(pad); - pad.fill(0); - } - update(buf) { - exists(this); - this.iHash.update(buf); - return this; - } - digestInto(out) { - exists(this); - bytes(out, this.outputLen); - this.finished = true; - this.iHash.digestInto(out); - this.oHash.update(out); - this.oHash.digestInto(out); - this.destroy(); - } - digest() { - const out = new Uint8Array(this.oHash.outputLen); - this.digestInto(out); - return out; - } - _cloneInto(to) { - // Create new instance without calling constructor since key already in state and we don't know it. - to || (to = Object.create(Object.getPrototypeOf(this), {})); - const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this; - to = to; - to.finished = finished; - to.destroyed = destroyed; - to.blockLen = blockLen; - to.outputLen = outputLen; - to.oHash = oHash._cloneInto(to.oHash); - to.iHash = iHash._cloneInto(to.iHash); - return to; - } - destroy() { - this.destroyed = true; - this.oHash.destroy(); - this.iHash.destroy(); - } -} -/** - * HMAC: RFC2104 message authentication code. - * @param hash - function that would be used e.g. sha256 - * @param key - message key - * @param message - message data - */ -const hmac = (hash, key, message) => new HMAC(hash, key).update(message).digest(); -hmac.create = (hash, key) => new HMAC(hash, key); - -// Common prologue and epilogue for sync/async functions -function pbkdf2Init(hash$1, _password, _salt, _opts) { - hash(hash$1); - const opts = checkOpts({ dkLen: 32, asyncTick: 10 }, _opts); - const { c, dkLen, asyncTick } = opts; - number(c); - number(dkLen); - number(asyncTick); - if (c < 1) - throw new Error('PBKDF2: iterations (c) should be >= 1'); - const password = toBytes(_password); - const salt = toBytes(_salt); - // DK = PBKDF2(PRF, Password, Salt, c, dkLen); - const DK = new Uint8Array(dkLen); - // U1 = PRF(Password, Salt + INT_32_BE(i)) - const PRF = hmac.create(hash$1, password); - const PRFSalt = PRF._cloneInto().update(salt); - return { c, dkLen, asyncTick, DK, PRF, PRFSalt }; -} -function pbkdf2Output(PRF, PRFSalt, DK, prfW, u) { - PRF.destroy(); - PRFSalt.destroy(); - if (prfW) - prfW.destroy(); - u.fill(0); - return DK; -} -/** - * PBKDF2-HMAC: RFC 2898 key derivation function - * @param hash - hash function that would be used e.g. sha256 - * @param password - password from which a derived key is generated - * @param salt - cryptographic salt - * @param opts - {c, dkLen} where c is work factor and dkLen is output message size - */ -function pbkdf2$1(hash, password, salt, opts) { - const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts); - let prfW; // Working copy - const arr = new Uint8Array(4); - const view = createView(arr); - const u = new Uint8Array(PRF.outputLen); - // DK = T1 + T2 + ⋯ + Tdklen/hlen - for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { - // Ti = F(Password, Salt, c, i) - const Ti = DK.subarray(pos, pos + PRF.outputLen); - view.setInt32(0, ti, false); - // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc - // U1 = PRF(Password, Salt + INT_32_BE(i)) - (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); - Ti.set(u.subarray(0, Ti.length)); - for (let ui = 1; ui < c; ui++) { - // Uc = PRF(Password, Uc−1) - PRF._cloneInto(prfW).update(u).digestInto(u); - for (let i = 0; i < Ti.length; i++) - Ti[i] ^= u[i]; - } - } - return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); -} - -// Polyfill for Safari 14 -function setBigUint64(view, byteOffset, value, isLE) { - if (typeof view.setBigUint64 === 'function') - return view.setBigUint64(byteOffset, value, isLE); - const _32n = BigInt(32); - const _u32_max = BigInt(0xffffffff); - const wh = Number((value >> _32n) & _u32_max); - const wl = Number(value & _u32_max); - const h = isLE ? 4 : 0; - const l = isLE ? 0 : 4; - view.setUint32(byteOffset + h, wh, isLE); - view.setUint32(byteOffset + l, wl, isLE); -} -// Base SHA2 class (RFC 6234) -class SHA2 extends Hash { - constructor(blockLen, outputLen, padOffset, isLE) { - super(); - this.blockLen = blockLen; - this.outputLen = outputLen; - this.padOffset = padOffset; - this.isLE = isLE; - this.finished = false; - this.length = 0; - this.pos = 0; - this.destroyed = false; - this.buffer = new Uint8Array(blockLen); - this.view = createView(this.buffer); - } - update(data) { - exists(this); - const { view, buffer, blockLen } = this; - data = toBytes(data); - const len = data.length; - for (let pos = 0; pos < len;) { - const take = Math.min(blockLen - this.pos, len - pos); - // Fast path: we have at least one block in input, cast it to view and process - if (take === blockLen) { - const dataView = createView(data); - for (; blockLen <= len - pos; pos += blockLen) - this.process(dataView, pos); - continue; - } - buffer.set(data.subarray(pos, pos + take), this.pos); - this.pos += take; - pos += take; - if (this.pos === blockLen) { - this.process(view, 0); - this.pos = 0; - } - } - this.length += data.length; - this.roundClean(); - return this; - } - digestInto(out) { - exists(this); - output(out, this); - this.finished = true; - // Padding - // We can avoid allocation of buffer for padding completely if it - // was previously not allocated here. But it won't change performance. - const { buffer, view, blockLen, isLE } = this; - let { pos } = this; - // append the bit '1' to the message - buffer[pos++] = 0b10000000; - this.buffer.subarray(pos).fill(0); - // we have less than padOffset left in buffer, so we cannot put length in current block, need process it and pad again - if (this.padOffset > blockLen - pos) { - this.process(view, 0); - pos = 0; - } - // Pad until full block byte with zeros - for (let i = pos; i < blockLen; i++) - buffer[i] = 0; - // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that - // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen. - // So we just write lowest 64 bits of that value. - setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE); - this.process(view, 0); - const oview = createView(out); - const len = this.outputLen; - // NOTE: we do division by 4 later, which should be fused in single op with modulo by JIT - if (len % 4) - throw new Error('_sha2: outputLen should be aligned to 32bit'); - const outLen = len / 4; - const state = this.get(); - if (outLen > state.length) - throw new Error('_sha2: outputLen bigger than state'); - for (let i = 0; i < outLen; i++) - oview.setUint32(4 * i, state[i], isLE); - } - digest() { - const { buffer, outputLen } = this; - this.digestInto(buffer); - const res = buffer.slice(0, outputLen); - this.destroy(); - return res; - } - _cloneInto(to) { - to || (to = new this.constructor()); - to.set(...this.get()); - const { blockLen, buffer, length, finished, destroyed, pos } = this; - to.length = length; - to.pos = pos; - to.finished = finished; - to.destroyed = destroyed; - if (length % blockLen) - to.buffer.set(buffer); - return to; - } -} - -// SHA2-256 need to try 2^128 hashes to execute birthday attack. -// BTC network is doing 2^67 hashes/sec as per early 2023. -// Choice: a ? b : c -const Chi = (a, b, c) => (a & b) ^ (~a & c); -// Majority function, true if any two inpust is true -const Maj = (a, b, c) => (a & b) ^ (a & c) ^ (b & c); -// Round constants: -// first 32 bits of the fractional parts of the cube roots of the first 64 primes 2..311) -// prettier-ignore -const SHA256_K = /* @__PURE__ */ new Uint32Array([ - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 -]); -// Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19): -// prettier-ignore -const IV = /* @__PURE__ */ new Uint32Array([ - 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 -]); -// Temporary buffer, not used to store anything between runs -// Named this way because it matches specification. -const SHA256_W = /* @__PURE__ */ new Uint32Array(64); -class SHA256 extends SHA2 { - constructor() { - super(64, 32, 8, false); - // We cannot use array here since array allows indexing by variable - // which means optimizer/compiler cannot use registers. - this.A = IV[0] | 0; - this.B = IV[1] | 0; - this.C = IV[2] | 0; - this.D = IV[3] | 0; - this.E = IV[4] | 0; - this.F = IV[5] | 0; - this.G = IV[6] | 0; - this.H = IV[7] | 0; - } - get() { - const { A, B, C, D, E, F, G, H } = this; - return [A, B, C, D, E, F, G, H]; - } - // prettier-ignore - set(A, B, C, D, E, F, G, H) { - this.A = A | 0; - this.B = B | 0; - this.C = C | 0; - this.D = D | 0; - this.E = E | 0; - this.F = F | 0; - this.G = G | 0; - this.H = H | 0; - } - process(view, offset) { - // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array - for (let i = 0; i < 16; i++, offset += 4) - SHA256_W[i] = view.getUint32(offset, false); - for (let i = 16; i < 64; i++) { - const W15 = SHA256_W[i - 15]; - const W2 = SHA256_W[i - 2]; - const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3); - const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10); - SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0; - } - // Compression function main loop, 64 rounds - let { A, B, C, D, E, F, G, H } = this; - for (let i = 0; i < 64; i++) { - const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25); - const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; - const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22); - const T2 = (sigma0 + Maj(A, B, C)) | 0; - H = G; - G = F; - F = E; - E = (D + T1) | 0; - D = C; - C = B; - B = A; - A = (T1 + T2) | 0; - } - // Add the compressed chunk to the current hash value - A = (A + this.A) | 0; - B = (B + this.B) | 0; - C = (C + this.C) | 0; - D = (D + this.D) | 0; - E = (E + this.E) | 0; - F = (F + this.F) | 0; - G = (G + this.G) | 0; - H = (H + this.H) | 0; - this.set(A, B, C, D, E, F, G, H); - } - roundClean() { - SHA256_W.fill(0); - } - destroy() { - this.set(0, 0, 0, 0, 0, 0, 0, 0); - this.buffer.fill(0); - } -} -/** - * SHA2-256 hash function - * @param message - data that would be hashed - */ -const sha256$1 = /* @__PURE__ */ wrapConstructor(() => new SHA256()); - -const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1); -const _32n = /* @__PURE__ */ BigInt(32); -// We are not using BigUint64Array, because they are extremely slow as per 2022 -function fromBig(n, le = false) { - if (le) - return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) }; - return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 }; -} -function split$1(lst, le = false) { - let Ah = new Uint32Array(lst.length); - let Al = new Uint32Array(lst.length); - for (let i = 0; i < lst.length; i++) { - const { h, l } = fromBig(lst[i], le); - [Ah[i], Al[i]] = [h, l]; - } - return [Ah, Al]; -} -const toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0); -// for Shift in [0, 32) -const shrSH = (h, _l, s) => h >>> s; -const shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); -// Right rotate for Shift in [1, 32) -const rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s)); -const rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); -// Right rotate for Shift in (32, 64), NOTE: 32 is special case. -const rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32)); -const rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s)); -// Right rotate for shift===32 (just swaps l&h) -const rotr32H = (_h, l) => l; -const rotr32L = (h, _l) => h; -// Left rotate for Shift in [1, 32) -const rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s)); -const rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s)); -// Left rotate for Shift in (32, 64), NOTE: 32 is special case. -const rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s)); -const rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s)); -// JS uses 32-bit signed integers for bitwise operations which means we cannot -// simple take carry out of low bit sum by shift, we need to use division. -function add(Ah, Al, Bh, Bl) { - const l = (Al >>> 0) + (Bl >>> 0); - return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 }; -} -// Addition with more than 2 elements -const add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); -const add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0; -const add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); -const add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0; -const add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); -const add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0; -// prettier-ignore -const u64 = { - fromBig, split: split$1, toBig, - shrSH, shrSL, - rotrSH, rotrSL, rotrBH, rotrBL, - rotr32H, rotr32L, - rotlSH, rotlSL, rotlBH, rotlBL, - add, add3L, add3H, add4L, add4H, add5H, add5L, -}; - -// Round contants (first 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409): -// prettier-ignore -const [SHA512_Kh, SHA512_Kl] = /* @__PURE__ */ (() => u64.split([ - '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc', - '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118', - '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2', - '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694', - '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65', - '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5', - '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4', - '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70', - '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df', - '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b', - '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30', - '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8', - '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8', - '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3', - '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec', - '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b', - '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178', - '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b', - '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c', - '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817' -].map(n => BigInt(n))))(); -// Temporary buffer, not used to store anything between runs -const SHA512_W_H = /* @__PURE__ */ new Uint32Array(80); -const SHA512_W_L = /* @__PURE__ */ new Uint32Array(80); -class SHA512 extends SHA2 { - constructor() { - super(128, 64, 16, false); - // We cannot use array here since array allows indexing by variable which means optimizer/compiler cannot use registers. - // Also looks cleaner and easier to verify with spec. - // Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19): - // h -- high 32 bits, l -- low 32 bits - this.Ah = 0x6a09e667 | 0; - this.Al = 0xf3bcc908 | 0; - this.Bh = 0xbb67ae85 | 0; - this.Bl = 0x84caa73b | 0; - this.Ch = 0x3c6ef372 | 0; - this.Cl = 0xfe94f82b | 0; - this.Dh = 0xa54ff53a | 0; - this.Dl = 0x5f1d36f1 | 0; - this.Eh = 0x510e527f | 0; - this.El = 0xade682d1 | 0; - this.Fh = 0x9b05688c | 0; - this.Fl = 0x2b3e6c1f | 0; - this.Gh = 0x1f83d9ab | 0; - this.Gl = 0xfb41bd6b | 0; - this.Hh = 0x5be0cd19 | 0; - this.Hl = 0x137e2179 | 0; - } - // prettier-ignore - get() { - const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; - return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl]; - } - // prettier-ignore - set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) { - this.Ah = Ah | 0; - this.Al = Al | 0; - this.Bh = Bh | 0; - this.Bl = Bl | 0; - this.Ch = Ch | 0; - this.Cl = Cl | 0; - this.Dh = Dh | 0; - this.Dl = Dl | 0; - this.Eh = Eh | 0; - this.El = El | 0; - this.Fh = Fh | 0; - this.Fl = Fl | 0; - this.Gh = Gh | 0; - this.Gl = Gl | 0; - this.Hh = Hh | 0; - this.Hl = Hl | 0; - } - process(view, offset) { - // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array - for (let i = 0; i < 16; i++, offset += 4) { - SHA512_W_H[i] = view.getUint32(offset); - SHA512_W_L[i] = view.getUint32((offset += 4)); - } - for (let i = 16; i < 80; i++) { - // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7) - const W15h = SHA512_W_H[i - 15] | 0; - const W15l = SHA512_W_L[i - 15] | 0; - const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7); - const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7); - // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6) - const W2h = SHA512_W_H[i - 2] | 0; - const W2l = SHA512_W_L[i - 2] | 0; - const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6); - const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6); - // SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16]; - const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]); - const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]); - SHA512_W_H[i] = SUMh | 0; - SHA512_W_L[i] = SUMl | 0; - } - let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; - // Compression function main loop, 80 rounds - for (let i = 0; i < 80; i++) { - // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41) - const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41); - const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41); - //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; - const CHIh = (Eh & Fh) ^ (~Eh & Gh); - const CHIl = (El & Fl) ^ (~El & Gl); - // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i] - // prettier-ignore - const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]); - const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]); - const T1l = T1ll | 0; - // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39) - const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39); - const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39); - const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch); - const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl); - Hh = Gh | 0; - Hl = Gl | 0; - Gh = Fh | 0; - Gl = Fl | 0; - Fh = Eh | 0; - Fl = El | 0; - ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0)); - Dh = Ch | 0; - Dl = Cl | 0; - Ch = Bh | 0; - Cl = Bl | 0; - Bh = Ah | 0; - Bl = Al | 0; - const All = u64.add3L(T1l, sigma0l, MAJl); - Ah = u64.add3H(All, T1h, sigma0h, MAJh); - Al = All | 0; - } - // Add the compressed chunk to the current hash value - ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0)); - ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0)); - ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0)); - ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0)); - ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0)); - ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0)); - ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0)); - ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0)); - this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl); - } - roundClean() { - SHA512_W_H.fill(0); - SHA512_W_L.fill(0); - } - destroy() { - this.buffer.fill(0); - this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - } -} -const sha512$1 = /* @__PURE__ */ wrapConstructor(() => new SHA512()); - -/* Browser Crypto Shims */ -function getGlobal$1() { - if (typeof self !== 'undefined') { - return self; - } - if (typeof window !== 'undefined') { - return window; - } - if (typeof global !== 'undefined') { - return global; - } - throw new Error('unable to locate global object'); -} -const anyGlobal = getGlobal$1(); -const crypto = anyGlobal.crypto || anyGlobal.msCrypto; -function createHash(algo) { - switch (algo) { - case "sha256": return sha256$1.create(); - case "sha512": return sha512$1.create(); - } - assertArgument(false, "invalid hashing algorithm name", "algorithm", algo); -} -function createHmac(_algo, key) { - const algo = ({ sha256: sha256$1, sha512: sha512$1 }[_algo]); - assertArgument(algo != null, "invalid hmac algorithm", "algorithm", _algo); - return hmac.create(algo, key); -} -function pbkdf2Sync(password, salt, iterations, keylen, _algo) { - const algo = ({ sha256: sha256$1, sha512: sha512$1 }[_algo]); - assertArgument(algo != null, "invalid pbkdf2 algorithm", "algorithm", _algo); - return pbkdf2$1(algo, password, salt, { c: iterations, dkLen: keylen }); -} -function randomBytes$1(length) { - assert(crypto != null, "platform does not support secure random numbers", "UNSUPPORTED_OPERATION", { - operation: "randomBytes" - }); - assertArgument(Number.isInteger(length) && length > 0 && length <= 1024, "invalid length", "length", length); - const result = new Uint8Array(length); - crypto.getRandomValues(result); - return result; -} - -/** - * An **HMAC** enables verification that a given key was used - * to authenticate a payload. - * - * See: [[link-wiki-hmac]] - * - * @_subsection: api/crypto:HMAC [about-hmac] - */ -let locked$4 = false; -const _computeHmac = function (algorithm, key, data) { - return createHmac(algorithm, key).update(data).digest(); -}; -let __computeHmac = _computeHmac; -/** - * Return the HMAC for %%data%% using the %%key%% key with the underlying - * %%algo%% used for compression. - * - * @example: - * key = id("some-secret") - * - * // Compute the HMAC - * computeHmac("sha256", key, "0x1337") - * //_result: - * - * // To compute the HMAC of UTF-8 data, the data must be - * // converted to UTF-8 bytes - * computeHmac("sha256", key, toUtf8Bytes("Hello World")) - * //_result: - * - */ -function computeHmac(algorithm, _key, _data) { - const key = getBytes(_key, "key"); - const data = getBytes(_data, "data"); - return hexlify(__computeHmac(algorithm, key, data)); -} -computeHmac._ = _computeHmac; -computeHmac.lock = function () { locked$4 = true; }; -computeHmac.register = function (func) { - if (locked$4) { - throw new Error("computeHmac is locked"); - } - __computeHmac = func; -}; -Object.freeze(computeHmac); - -// SHA3 (keccak) is based on a new design: basically, the internal state is bigger than output size. -// It's called a sponge function. -// Various per round constants calculations -const [SHA3_PI, SHA3_ROTL, _SHA3_IOTA] = [[], [], []]; -const _0n$4 = /* @__PURE__ */ BigInt(0); -const _1n$5 = /* @__PURE__ */ BigInt(1); -const _2n$3 = /* @__PURE__ */ BigInt(2); -const _7n = /* @__PURE__ */ BigInt(7); -const _256n = /* @__PURE__ */ BigInt(256); -const _0x71n = /* @__PURE__ */ BigInt(0x71); -for (let round = 0, R = _1n$5, x = 1, y = 0; round < 24; round++) { - // Pi - [x, y] = [y, (2 * x + 3 * y) % 5]; - SHA3_PI.push(2 * (5 * y + x)); - // Rotational - SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64); - // Iota - let t = _0n$4; - for (let j = 0; j < 7; j++) { - R = ((R << _1n$5) ^ ((R >> _7n) * _0x71n)) % _256n; - if (R & _2n$3) - t ^= _1n$5 << ((_1n$5 << /* @__PURE__ */ BigInt(j)) - _1n$5); - } - _SHA3_IOTA.push(t); -} -const [SHA3_IOTA_H, SHA3_IOTA_L] = /* @__PURE__ */ split$1(_SHA3_IOTA, true); -// Left rotation (without 0, 32, 64) -const rotlH = (h, l, s) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s)); -const rotlL = (h, l, s) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s)); -// Same as keccakf1600, but allows to skip some rounds -function keccakP(s, rounds = 24) { - const B = new Uint32Array(5 * 2); - // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js) - for (let round = 24 - rounds; round < 24; round++) { - // Theta θ - for (let x = 0; x < 10; x++) - B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40]; - for (let x = 0; x < 10; x += 2) { - const idx1 = (x + 8) % 10; - const idx0 = (x + 2) % 10; - const B0 = B[idx0]; - const B1 = B[idx0 + 1]; - const Th = rotlH(B0, B1, 1) ^ B[idx1]; - const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1]; - for (let y = 0; y < 50; y += 10) { - s[x + y] ^= Th; - s[x + y + 1] ^= Tl; - } - } - // Rho (ρ) and Pi (π) - let curH = s[2]; - let curL = s[3]; - for (let t = 0; t < 24; t++) { - const shift = SHA3_ROTL[t]; - const Th = rotlH(curH, curL, shift); - const Tl = rotlL(curH, curL, shift); - const PI = SHA3_PI[t]; - curH = s[PI]; - curL = s[PI + 1]; - s[PI] = Th; - s[PI + 1] = Tl; - } - // Chi (χ) - for (let y = 0; y < 50; y += 10) { - for (let x = 0; x < 10; x++) - B[x] = s[y + x]; - for (let x = 0; x < 10; x++) - s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10]; - } - // Iota (ι) - s[0] ^= SHA3_IOTA_H[round]; - s[1] ^= SHA3_IOTA_L[round]; - } - B.fill(0); -} -class Keccak extends Hash { - // NOTE: we accept arguments in bytes instead of bits here. - constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) { - super(); - this.blockLen = blockLen; - this.suffix = suffix; - this.outputLen = outputLen; - this.enableXOF = enableXOF; - this.rounds = rounds; - this.pos = 0; - this.posOut = 0; - this.finished = false; - this.destroyed = false; - // Can be passed from user as dkLen - number(outputLen); - // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes - if (0 >= this.blockLen || this.blockLen >= 200) - throw new Error('Sha3 supports only keccak-f1600 function'); - this.state = new Uint8Array(200); - this.state32 = u32(this.state); - } - keccak() { - keccakP(this.state32, this.rounds); - this.posOut = 0; - this.pos = 0; - } - update(data) { - exists(this); - const { blockLen, state } = this; - data = toBytes(data); - const len = data.length; - for (let pos = 0; pos < len;) { - const take = Math.min(blockLen - this.pos, len - pos); - for (let i = 0; i < take; i++) - state[this.pos++] ^= data[pos++]; - if (this.pos === blockLen) - this.keccak(); - } - return this; - } - finish() { - if (this.finished) - return; - this.finished = true; - const { state, suffix, pos, blockLen } = this; - // Do the padding - state[pos] ^= suffix; - if ((suffix & 0x80) !== 0 && pos === blockLen - 1) - this.keccak(); - state[blockLen - 1] ^= 0x80; - this.keccak(); - } - writeInto(out) { - exists(this, false); - bytes(out); - this.finish(); - const bufferOut = this.state; - const { blockLen } = this; - for (let pos = 0, len = out.length; pos < len;) { - if (this.posOut >= blockLen) - this.keccak(); - const take = Math.min(blockLen - this.posOut, len - pos); - out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); - this.posOut += take; - pos += take; - } - return out; - } - xofInto(out) { - // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF - if (!this.enableXOF) - throw new Error('XOF is not possible for this instance'); - return this.writeInto(out); - } - xof(bytes) { - number(bytes); - return this.xofInto(new Uint8Array(bytes)); - } - digestInto(out) { - output(out, this); - if (this.finished) - throw new Error('digest() was already called'); - this.writeInto(out); - this.destroy(); - return out; - } - digest() { - return this.digestInto(new Uint8Array(this.outputLen)); - } - destroy() { - this.destroyed = true; - this.state.fill(0); - } - _cloneInto(to) { - const { blockLen, suffix, outputLen, rounds, enableXOF } = this; - to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds)); - to.state32.set(this.state32); - to.pos = this.pos; - to.posOut = this.posOut; - to.finished = this.finished; - to.rounds = rounds; - // Suffix can change in cSHAKE - to.suffix = suffix; - to.outputLen = outputLen; - to.enableXOF = enableXOF; - to.destroyed = this.destroyed; - return to; - } -} -const gen = (suffix, blockLen, outputLen) => wrapConstructor(() => new Keccak(blockLen, suffix, outputLen)); -/** - * keccak-256 hash function. Different from SHA3-256. - * @param message - that would be hashed - */ -const keccak_256 = /* @__PURE__ */ gen(0x01, 136, 256 / 8); - -/** - * Cryptographic hashing functions - * - * @_subsection: api/crypto:Hash Functions [about-crypto-hashing] - */ -let locked$3 = false; -const _keccak256 = function (data) { - return keccak_256(data); -}; -let __keccak256 = _keccak256; -/** - * Compute the cryptographic KECCAK256 hash of %%data%%. - * - * The %%data%% **must** be a data representation, to compute the - * hash of UTF-8 data use the [[id]] function. - * - * @returns DataHexstring - * @example: - * keccak256("0x") - * //_result: - * - * keccak256("0x1337") - * //_result: - * - * keccak256(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - * // Strings are assumed to be DataHexString, otherwise it will - * // throw. To hash UTF-8 data, see the note above. - * keccak256("Hello World") - * //_error: - */ -function keccak256(_data) { - const data = getBytes(_data, "data"); - return hexlify(__keccak256(data)); -} -keccak256._ = _keccak256; -keccak256.lock = function () { locked$3 = true; }; -keccak256.register = function (func) { - if (locked$3) { - throw new TypeError("keccak256 is locked"); - } - __keccak256 = func; -}; -Object.freeze(keccak256); - -// https://homes.esat.kuleuven.be/~bosselae/ripemd160.html -// https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf -const Rho = /* @__PURE__ */ new Uint8Array([7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8]); -const Id = /* @__PURE__ */ Uint8Array.from({ length: 16 }, (_, i) => i); -const Pi = /* @__PURE__ */ Id.map((i) => (9 * i + 5) % 16); -let idxL = [Id]; -let idxR = [Pi]; -for (let i = 0; i < 4; i++) - for (let j of [idxL, idxR]) - j.push(j[i].map((k) => Rho[k])); -const shifts = /* @__PURE__ */ [ - [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8], - [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7], - [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9], - [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6], - [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5], -].map((i) => new Uint8Array(i)); -const shiftsL = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts[i][j])); -const shiftsR = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts[i][j])); -const Kl = /* @__PURE__ */ new Uint32Array([ - 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e, -]); -const Kr = /* @__PURE__ */ new Uint32Array([ - 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000, -]); -// The rotate left (circular left shift) operation for uint32 -const rotl$1 = (word, shift) => (word << shift) | (word >>> (32 - shift)); -// It's called f() in spec. -function f(group, x, y, z) { - if (group === 0) - return x ^ y ^ z; - else if (group === 1) - return (x & y) | (~x & z); - else if (group === 2) - return (x | ~y) ^ z; - else if (group === 3) - return (x & z) | (y & ~z); - else - return x ^ (y | ~z); -} -// Temporary buffer, not used to store anything between runs -const BUF = /* @__PURE__ */ new Uint32Array(16); -class RIPEMD160 extends SHA2 { - constructor() { - super(64, 20, 8, true); - this.h0 = 0x67452301 | 0; - this.h1 = 0xefcdab89 | 0; - this.h2 = 0x98badcfe | 0; - this.h3 = 0x10325476 | 0; - this.h4 = 0xc3d2e1f0 | 0; - } - get() { - const { h0, h1, h2, h3, h4 } = this; - return [h0, h1, h2, h3, h4]; - } - set(h0, h1, h2, h3, h4) { - this.h0 = h0 | 0; - this.h1 = h1 | 0; - this.h2 = h2 | 0; - this.h3 = h3 | 0; - this.h4 = h4 | 0; - } - process(view, offset) { - for (let i = 0; i < 16; i++, offset += 4) - BUF[i] = view.getUint32(offset, true); - // prettier-ignore - let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el; - // Instead of iterating 0 to 80, we split it into 5 groups - // And use the groups in constants, functions, etc. Much simpler - for (let group = 0; group < 5; group++) { - const rGroup = 4 - group; - const hbl = Kl[group], hbr = Kr[group]; // prettier-ignore - const rl = idxL[group], rr = idxR[group]; // prettier-ignore - const sl = shiftsL[group], sr = shiftsR[group]; // prettier-ignore - for (let i = 0; i < 16; i++) { - const tl = (rotl$1(al + f(group, bl, cl, dl) + BUF[rl[i]] + hbl, sl[i]) + el) | 0; - al = el, el = dl, dl = rotl$1(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore - } - // 2 loops are 10% faster - for (let i = 0; i < 16; i++) { - const tr = (rotl$1(ar + f(rGroup, br, cr, dr) + BUF[rr[i]] + hbr, sr[i]) + er) | 0; - ar = er, er = dr, dr = rotl$1(cr, 10) | 0, cr = br, br = tr; // prettier-ignore - } - } - // Add the compressed chunk to the current hash value - this.set((this.h1 + cl + dr) | 0, (this.h2 + dl + er) | 0, (this.h3 + el + ar) | 0, (this.h4 + al + br) | 0, (this.h0 + bl + cr) | 0); - } - roundClean() { - BUF.fill(0); - } - destroy() { - this.destroyed = true; - this.buffer.fill(0); - this.set(0, 0, 0, 0, 0); - } -} -/** - * RIPEMD-160 - a hash function from 1990s. - * @param message - msg that would be hashed - */ -const ripemd160$1 = /* @__PURE__ */ wrapConstructor(() => new RIPEMD160()); - -let locked$2 = false; -const _ripemd160 = function (data) { - return ripemd160$1(data); -}; -let __ripemd160 = _ripemd160; -/** - * Compute the cryptographic RIPEMD-160 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * ripemd160("0x") - * //_result: - * - * ripemd160("0x1337") - * //_result: - * - * ripemd160(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - */ -function ripemd160(_data) { - const data = getBytes(_data, "data"); - return hexlify(__ripemd160(data)); -} -ripemd160._ = _ripemd160; -ripemd160.lock = function () { locked$2 = true; }; -ripemd160.register = function (func) { - if (locked$2) { - throw new TypeError("ripemd160 is locked"); - } - __ripemd160 = func; -}; -Object.freeze(ripemd160); - -/** - * A **Password-Based Key-Derivation Function** is designed to create - * a sequence of bytes suitible as a **key** from a human-rememberable - * password. - * - * @_subsection: api/crypto:Passwords [about-pbkdf] - */ -let locked$1 = false; -const _pbkdf2 = function (password, salt, iterations, keylen, algo) { - return pbkdf2Sync(password, salt, iterations, keylen, algo); -}; -let __pbkdf2 = _pbkdf2; -/** - * Return the [[link-pbkdf2]] for %%keylen%% bytes for %%password%% using - * the %%salt%% and using %%iterations%% of %%algo%%. - * - * This PBKDF is outdated and should not be used in new projects, but is - * required to decrypt older files. - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the PBKDF2 - * pbkdf2(passwordBytes, salt, 1024, 16, "sha256") - * //_result: - */ -function pbkdf2(_password, _salt, iterations, keylen, algo) { - const password = getBytes(_password, "password"); - const salt = getBytes(_salt, "salt"); - return hexlify(__pbkdf2(password, salt, iterations, keylen, algo)); -} -pbkdf2._ = _pbkdf2; -pbkdf2.lock = function () { locked$1 = true; }; -pbkdf2.register = function (func) { - if (locked$1) { - throw new Error("pbkdf2 is locked"); - } - __pbkdf2 = func; -}; -Object.freeze(pbkdf2); - -/** - * A **Cryptographically Secure Random Value** is one that has been - * generated with additional care take to prevent side-channels - * from allowing others to detect it and prevent others from through - * coincidence generate the same values. - * - * @_subsection: api/crypto:Random Values [about-crypto-random] - */ -let locked = false; -const _randomBytes = function (length) { - return new Uint8Array(randomBytes$1(length)); -}; -let __randomBytes = _randomBytes; -/** - * Return %%length%% bytes of cryptographically secure random data. - * - * @example: - * randomBytes(8) - * //_result: - */ -function randomBytes(length) { - return __randomBytes(length); -} -randomBytes._ = _randomBytes; -randomBytes.lock = function () { locked = true; }; -randomBytes.register = function (func) { - if (locked) { - throw new Error("randomBytes is locked"); - } - __randomBytes = func; -}; -Object.freeze(randomBytes); - -// RFC 7914 Scrypt KDF -// Left rotate for uint32 -const rotl = (a, b) => (a << b) | (a >>> (32 - b)); -// The main Scrypt loop: uses Salsa extensively. -// Six versions of the function were tried, this is the fastest one. -// prettier-ignore -function XorAndSalsa(prev, pi, input, ii, out, oi) { - // Based on https://cr.yp.to/salsa20.html - // Xor blocks - let y00 = prev[pi++] ^ input[ii++], y01 = prev[pi++] ^ input[ii++]; - let y02 = prev[pi++] ^ input[ii++], y03 = prev[pi++] ^ input[ii++]; - let y04 = prev[pi++] ^ input[ii++], y05 = prev[pi++] ^ input[ii++]; - let y06 = prev[pi++] ^ input[ii++], y07 = prev[pi++] ^ input[ii++]; - let y08 = prev[pi++] ^ input[ii++], y09 = prev[pi++] ^ input[ii++]; - let y10 = prev[pi++] ^ input[ii++], y11 = prev[pi++] ^ input[ii++]; - let y12 = prev[pi++] ^ input[ii++], y13 = prev[pi++] ^ input[ii++]; - let y14 = prev[pi++] ^ input[ii++], y15 = prev[pi++] ^ input[ii++]; - // Save state to temporary variables (salsa) - let x00 = y00, x01 = y01, x02 = y02, x03 = y03, x04 = y04, x05 = y05, x06 = y06, x07 = y07, x08 = y08, x09 = y09, x10 = y10, x11 = y11, x12 = y12, x13 = y13, x14 = y14, x15 = y15; - // Main loop (salsa) - for (let i = 0; i < 8; i += 2) { - x04 ^= rotl(x00 + x12 | 0, 7); - x08 ^= rotl(x04 + x00 | 0, 9); - x12 ^= rotl(x08 + x04 | 0, 13); - x00 ^= rotl(x12 + x08 | 0, 18); - x09 ^= rotl(x05 + x01 | 0, 7); - x13 ^= rotl(x09 + x05 | 0, 9); - x01 ^= rotl(x13 + x09 | 0, 13); - x05 ^= rotl(x01 + x13 | 0, 18); - x14 ^= rotl(x10 + x06 | 0, 7); - x02 ^= rotl(x14 + x10 | 0, 9); - x06 ^= rotl(x02 + x14 | 0, 13); - x10 ^= rotl(x06 + x02 | 0, 18); - x03 ^= rotl(x15 + x11 | 0, 7); - x07 ^= rotl(x03 + x15 | 0, 9); - x11 ^= rotl(x07 + x03 | 0, 13); - x15 ^= rotl(x11 + x07 | 0, 18); - x01 ^= rotl(x00 + x03 | 0, 7); - x02 ^= rotl(x01 + x00 | 0, 9); - x03 ^= rotl(x02 + x01 | 0, 13); - x00 ^= rotl(x03 + x02 | 0, 18); - x06 ^= rotl(x05 + x04 | 0, 7); - x07 ^= rotl(x06 + x05 | 0, 9); - x04 ^= rotl(x07 + x06 | 0, 13); - x05 ^= rotl(x04 + x07 | 0, 18); - x11 ^= rotl(x10 + x09 | 0, 7); - x08 ^= rotl(x11 + x10 | 0, 9); - x09 ^= rotl(x08 + x11 | 0, 13); - x10 ^= rotl(x09 + x08 | 0, 18); - x12 ^= rotl(x15 + x14 | 0, 7); - x13 ^= rotl(x12 + x15 | 0, 9); - x14 ^= rotl(x13 + x12 | 0, 13); - x15 ^= rotl(x14 + x13 | 0, 18); - } - // Write output (salsa) - out[oi++] = (y00 + x00) | 0; - out[oi++] = (y01 + x01) | 0; - out[oi++] = (y02 + x02) | 0; - out[oi++] = (y03 + x03) | 0; - out[oi++] = (y04 + x04) | 0; - out[oi++] = (y05 + x05) | 0; - out[oi++] = (y06 + x06) | 0; - out[oi++] = (y07 + x07) | 0; - out[oi++] = (y08 + x08) | 0; - out[oi++] = (y09 + x09) | 0; - out[oi++] = (y10 + x10) | 0; - out[oi++] = (y11 + x11) | 0; - out[oi++] = (y12 + x12) | 0; - out[oi++] = (y13 + x13) | 0; - out[oi++] = (y14 + x14) | 0; - out[oi++] = (y15 + x15) | 0; -} -function BlockMix(input, ii, out, oi, r) { - // The block B is r 128-byte chunks (which is equivalent of 2r 64-byte chunks) - let head = oi + 0; - let tail = oi + 16 * r; - for (let i = 0; i < 16; i++) - out[tail + i] = input[ii + (2 * r - 1) * 16 + i]; // X ← B[2r−1] - for (let i = 0; i < r; i++, head += 16, ii += 16) { - // We write odd & even Yi at same time. Even: 0bXXXXX0 Odd: 0bXXXXX1 - XorAndSalsa(out, tail, input, ii, out, head); // head[i] = Salsa(blockIn[2*i] ^ tail[i-1]) - if (i > 0) - tail += 16; // First iteration overwrites tmp value in tail - XorAndSalsa(out, head, input, (ii += 16), out, tail); // tail[i] = Salsa(blockIn[2*i+1] ^ head[i]) - } -} -// Common prologue and epilogue for sync/async functions -function scryptInit(password, salt, _opts) { - // Maxmem - 1GB+1KB by default - const opts = checkOpts({ - dkLen: 32, - asyncTick: 10, - maxmem: 1024 ** 3 + 1024, - }, _opts); - const { N, r, p, dkLen, asyncTick, maxmem, onProgress } = opts; - number(N); - number(r); - number(p); - number(dkLen); - number(asyncTick); - number(maxmem); - if (onProgress !== undefined && typeof onProgress !== 'function') - throw new Error('progressCb should be function'); - const blockSize = 128 * r; - const blockSize32 = blockSize / 4; - if (N <= 1 || (N & (N - 1)) !== 0 || N >= 2 ** (blockSize / 8) || N > 2 ** 32) { - // NOTE: we limit N to be less than 2**32 because of 32 bit variant of Integrify function - // There is no JS engines that allows alocate more than 4GB per single Uint8Array for now, but can change in future. - throw new Error('Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32'); - } - if (p < 0 || p > ((2 ** 32 - 1) * 32) / blockSize) { - throw new Error('Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)'); - } - if (dkLen < 0 || dkLen > (2 ** 32 - 1) * 32) { - throw new Error('Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32'); - } - const memUsed = blockSize * (N + p); - if (memUsed > maxmem) { - throw new Error(`Scrypt: parameters too large, ${memUsed} (128 * r * (N + p)) > ${maxmem} (maxmem)`); - } - // [B0...Bp−1] ← PBKDF2HMAC-SHA256(Passphrase, Salt, 1, blockSize*ParallelizationFactor) - // Since it has only one iteration there is no reason to use async variant - const B = pbkdf2$1(sha256$1, password, salt, { c: 1, dkLen: blockSize * p }); - const B32 = u32(B); - // Re-used between parallel iterations. Array(iterations) of B - const V = u32(new Uint8Array(blockSize * N)); - const tmp = u32(new Uint8Array(blockSize)); - let blockMixCb = () => { }; - if (onProgress) { - const totalBlockMix = 2 * N * p; - // Invoke callback if progress changes from 10.01 to 10.02 - // Allows to draw smooth progress bar on up to 8K screen - const callbackPer = Math.max(Math.floor(totalBlockMix / 10000), 1); - let blockMixCnt = 0; - blockMixCb = () => { - blockMixCnt++; - if (onProgress && (!(blockMixCnt % callbackPer) || blockMixCnt === totalBlockMix)) - onProgress(blockMixCnt / totalBlockMix); - }; - } - return { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick }; -} -function scryptOutput(password, dkLen, B, V, tmp) { - const res = pbkdf2$1(sha256$1, password, B, { c: 1, dkLen }); - B.fill(0); - V.fill(0); - tmp.fill(0); - return res; -} -/** - * Scrypt KDF from RFC 7914. - * @param password - pass - * @param salt - salt - * @param opts - parameters - * - `N` is cpu/mem work factor (power of 2 e.g. 2**18) - * - `r` is block size (8 is common), fine-tunes sequential memory read size and performance - * - `p` is parallelization factor (1 is common) - * - `dkLen` is output key length in bytes e.g. 32. - * - `asyncTick` - (default: 10) max time in ms for which async function can block execution - * - `maxmem` - (default: `1024 ** 3 + 1024` aka 1GB+1KB). A limit that the app could use for scrypt - * - `onProgress` - callback function that would be executed for progress report - * @returns Derived key - */ -function scrypt$1(password, salt, opts) { - const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb } = scryptInit(password, salt, opts); - for (let pi = 0; pi < p; pi++) { - const Pi = blockSize32 * pi; - for (let i = 0; i < blockSize32; i++) - V[i] = B32[Pi + i]; // V[0] = B[i] - for (let i = 0, pos = 0; i < N - 1; i++) { - BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]); - blockMixCb(); - } - BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element - blockMixCb(); - for (let i = 0; i < N; i++) { - // First u32 of the last 64-byte block (u32 is LE) - const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations - for (let k = 0; k < blockSize32; k++) - tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j] - BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) - blockMixCb(); - } - } - return scryptOutput(password, dkLen, B, V, tmp); -} -/** - * Scrypt KDF from RFC 7914. - */ -async function scryptAsync(password, salt, opts) { - const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick } = scryptInit(password, salt, opts); - for (let pi = 0; pi < p; pi++) { - const Pi = blockSize32 * pi; - for (let i = 0; i < blockSize32; i++) - V[i] = B32[Pi + i]; // V[0] = B[i] - let pos = 0; - await asyncLoop(N - 1, asyncTick, () => { - BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]); - blockMixCb(); - }); - BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element - blockMixCb(); - await asyncLoop(N, asyncTick, () => { - // First u32 of the last 64-byte block (u32 is LE) - const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations - for (let k = 0; k < blockSize32; k++) - tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j] - BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) - blockMixCb(); - }); - } - return scryptOutput(password, dkLen, B, V, tmp); -} - -let lockedSync = false, lockedAsync = false; -const _scryptAsync = async function (passwd, salt, N, r, p, dkLen, onProgress) { - return await scryptAsync(passwd, salt, { N, r, p, dkLen, onProgress }); -}; -const _scryptSync = function (passwd, salt, N, r, p, dkLen) { - return scrypt$1(passwd, salt, { N, r, p, dkLen }); -}; -let __scryptAsync = _scryptAsync; -let __scryptSync = _scryptSync; -/** - * The [[link-wiki-scrypt]] uses a memory and cpu hard method of - * derivation to increase the resource cost to brute-force a password - * for a given key. - * - * This means this algorithm is intentionally slow, and can be tuned to - * become slower. As computation and memory speed improve over time, - * increasing the difficulty maintains the cost of an attacker. - * - * For example, if a target time of 5 seconds is used, a legitimate user - * which knows their password requires only 5 seconds to unlock their - * account. A 6 character password has 68 billion possibilities, which - * would require an attacker to invest over 10,000 years of CPU time. This - * is of course a crude example (as password generally aren't random), - * but demonstrates to value of imposing large costs to decryption. - * - * For this reason, if building a UI which involved decrypting or - * encrypting datsa using scrypt, it is recommended to use a - * [[ProgressCallback]] (as event short periods can seem lik an eternity - * if the UI freezes). Including the phrase //"decrypting"// in the UI - * can also help, assuring the user their waiting is for a good reason. - * - * @_docloc: api/crypto:Passwords - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the scrypt - * scrypt(passwordBytes, salt, 1024, 8, 1, 16) - * //_result: - */ -async function scrypt(_passwd, _salt, N, r, p, dkLen, progress) { - const passwd = getBytes(_passwd, "passwd"); - const salt = getBytes(_salt, "salt"); - return hexlify(await __scryptAsync(passwd, salt, N, r, p, dkLen, progress)); -} -scrypt._ = _scryptAsync; -scrypt.lock = function () { lockedAsync = true; }; -scrypt.register = function (func) { - if (lockedAsync) { - throw new Error("scrypt is locked"); - } - __scryptAsync = func; -}; -Object.freeze(scrypt); -/** - * Provides a synchronous variant of [[scrypt]]. - * - * This will completely lock up and freeze the UI in a browser and will - * prevent any event loop from progressing. For this reason, it is - * preferred to use the [async variant](scrypt). - * - * @_docloc: api/crypto:Passwords - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the scrypt - * scryptSync(passwordBytes, salt, 1024, 8, 1, 16) - * //_result: - */ -function scryptSync(_passwd, _salt, N, r, p, dkLen) { - const passwd = getBytes(_passwd, "passwd"); - const salt = getBytes(_salt, "salt"); - return hexlify(__scryptSync(passwd, salt, N, r, p, dkLen)); -} -scryptSync._ = _scryptSync; -scryptSync.lock = function () { lockedSync = true; }; -scryptSync.register = function (func) { - if (lockedSync) { - throw new Error("scryptSync is locked"); - } - __scryptSync = func; -}; -Object.freeze(scryptSync); - -const _sha256 = function (data) { - return createHash("sha256").update(data).digest(); -}; -const _sha512 = function (data) { - return createHash("sha512").update(data).digest(); -}; -let __sha256 = _sha256; -let __sha512 = _sha512; -let locked256 = false, locked512 = false; -/** - * Compute the cryptographic SHA2-256 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * sha256("0x") - * //_result: - * - * sha256("0x1337") - * //_result: - * - * sha256(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - */ -function sha256(_data) { - const data = getBytes(_data, "data"); - return hexlify(__sha256(data)); -} -sha256._ = _sha256; -sha256.lock = function () { locked256 = true; }; -sha256.register = function (func) { - if (locked256) { - throw new Error("sha256 is locked"); - } - __sha256 = func; -}; -Object.freeze(sha256); -/** - * Compute the cryptographic SHA2-512 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * sha512("0x") - * //_result: - * - * sha512("0x1337") - * //_result: - * - * sha512(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - */ -function sha512(_data) { - const data = getBytes(_data, "data"); - return hexlify(__sha512(data)); -} -sha512._ = _sha512; -sha512.lock = function () { locked512 = true; }; -sha512.register = function (func) { - if (locked512) { - throw new Error("sha512 is locked"); - } - __sha512 = func; -}; -Object.freeze(sha256); - -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -// 100 lines of code in the file are duplicated from noble-hashes (utils). -// This is OK: `abstract` directory does not use noble-hashes. -// User may opt-in into using different hashing library. This way, noble-hashes -// won't be included into their bundle. -const _0n$3 = BigInt(0); -const _1n$4 = BigInt(1); -const _2n$2 = BigInt(2); -const u8a = (a) => a instanceof Uint8Array; -const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0')); -/** - * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123' - */ -function bytesToHex(bytes) { - if (!u8a(bytes)) - throw new Error('Uint8Array expected'); - // pre-caching improves the speed 6x - let hex = ''; - for (let i = 0; i < bytes.length; i++) { - hex += hexes[bytes[i]]; - } - return hex; -} -function numberToHexUnpadded(num) { - const hex = num.toString(16); - return hex.length & 1 ? `0${hex}` : hex; -} -function hexToNumber(hex) { - if (typeof hex !== 'string') - throw new Error('hex string expected, got ' + typeof hex); - // Big Endian - return BigInt(hex === '' ? '0' : `0x${hex}`); -} -/** - * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23]) - */ -function hexToBytes(hex) { - if (typeof hex !== 'string') - throw new Error('hex string expected, got ' + typeof hex); - const len = hex.length; - if (len % 2) - throw new Error('padded hex string expected, got unpadded hex of length ' + len); - const array = new Uint8Array(len / 2); - for (let i = 0; i < array.length; i++) { - const j = i * 2; - const hexByte = hex.slice(j, j + 2); - const byte = Number.parseInt(hexByte, 16); - if (Number.isNaN(byte) || byte < 0) - throw new Error('Invalid byte sequence'); - array[i] = byte; - } - return array; -} -// BE: Big Endian, LE: Little Endian -function bytesToNumberBE(bytes) { - return hexToNumber(bytesToHex(bytes)); -} -function bytesToNumberLE(bytes) { - if (!u8a(bytes)) - throw new Error('Uint8Array expected'); - return hexToNumber(bytesToHex(Uint8Array.from(bytes).reverse())); -} -function numberToBytesBE(n, len) { - return hexToBytes(n.toString(16).padStart(len * 2, '0')); -} -function numberToBytesLE(n, len) { - return numberToBytesBE(n, len).reverse(); -} -// Unpadded, rarely used -function numberToVarBytesBE(n) { - return hexToBytes(numberToHexUnpadded(n)); -} -/** - * Takes hex string or Uint8Array, converts to Uint8Array. - * Validates output length. - * Will throw error for other types. - * @param title descriptive title for an error e.g. 'private key' - * @param hex hex string or Uint8Array - * @param expectedLength optional, will compare to result array's length - * @returns - */ -function ensureBytes(title, hex, expectedLength) { - let res; - if (typeof hex === 'string') { - try { - res = hexToBytes(hex); - } - catch (e) { - throw new Error(`${title} must be valid hex string, got "${hex}". Cause: ${e}`); - } - } - else if (u8a(hex)) { - // Uint8Array.from() instead of hash.slice() because node.js Buffer - // is instance of Uint8Array, and its slice() creates **mutable** copy - res = Uint8Array.from(hex); - } - else { - throw new Error(`${title} must be hex string or Uint8Array`); - } - const len = res.length; - if (typeof expectedLength === 'number' && len !== expectedLength) - throw new Error(`${title} expected ${expectedLength} bytes, got ${len}`); - return res; -} -/** - * Copies several Uint8Arrays into one. - */ -function concatBytes(...arrays) { - const r = new Uint8Array(arrays.reduce((sum, a) => sum + a.length, 0)); - let pad = 0; // walk through each item, ensure they have proper type - arrays.forEach((a) => { - if (!u8a(a)) - throw new Error('Uint8Array expected'); - r.set(a, pad); - pad += a.length; - }); - return r; -} -function equalBytes(b1, b2) { - // We don't care about timing attacks here - if (b1.length !== b2.length) - return false; - for (let i = 0; i < b1.length; i++) - if (b1[i] !== b2[i]) - return false; - return true; -} -/** - * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99]) - */ -function utf8ToBytes(str) { - if (typeof str !== 'string') - throw new Error(`utf8ToBytes expected string, got ${typeof str}`); - return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809 -} -// Bit operations -/** - * Calculates amount of bits in a bigint. - * Same as `n.toString(2).length` - */ -function bitLen(n) { - let len; - for (len = 0; n > _0n$3; n >>= _1n$4, len += 1) - ; - return len; -} -/** - * Gets single bit at position. - * NOTE: first bit position is 0 (same as arrays) - * Same as `!!+Array.from(n.toString(2)).reverse()[pos]` - */ -function bitGet(n, pos) { - return (n >> BigInt(pos)) & _1n$4; -} -/** - * Sets single bit at position. - */ -const bitSet = (n, pos, value) => { - return n | ((value ? _1n$4 : _0n$3) << BigInt(pos)); -}; -/** - * Calculate mask for N bits. Not using ** operator with bigints because of old engines. - * Same as BigInt(`0b${Array(i).fill('1').join('')}`) - */ -const bitMask = (n) => (_2n$2 << BigInt(n - 1)) - _1n$4; -// DRBG -const u8n = (data) => new Uint8Array(data); // creates Uint8Array -const u8fr = (arr) => Uint8Array.from(arr); // another shortcut -/** - * Minimal HMAC-DRBG from NIST 800-90 for RFC6979 sigs. - * @returns function that will call DRBG until 2nd arg returns something meaningful - * @example - * const drbg = createHmacDRBG(32, 32, hmac); - * drbg(seed, bytesToKey); // bytesToKey must return Key or undefined - */ -function createHmacDrbg(hashLen, qByteLen, hmacFn) { - if (typeof hashLen !== 'number' || hashLen < 2) - throw new Error('hashLen must be a number'); - if (typeof qByteLen !== 'number' || qByteLen < 2) - throw new Error('qByteLen must be a number'); - if (typeof hmacFn !== 'function') - throw new Error('hmacFn must be a function'); - // Step B, Step C: set hashLen to 8*ceil(hlen/8) - let v = u8n(hashLen); // Minimal non-full-spec HMAC-DRBG from NIST 800-90 for RFC6979 sigs. - let k = u8n(hashLen); // Steps B and C of RFC6979 3.2: set hashLen, in our case always same - let i = 0; // Iterations counter, will throw when over 1000 - const reset = () => { - v.fill(1); - k.fill(0); - i = 0; - }; - const h = (...b) => hmacFn(k, v, ...b); // hmac(k)(v, ...values) - const reseed = (seed = u8n()) => { - // HMAC-DRBG reseed() function. Steps D-G - k = h(u8fr([0x00]), seed); // k = hmac(k || v || 0x00 || seed) - v = h(); // v = hmac(k || v) - if (seed.length === 0) - return; - k = h(u8fr([0x01]), seed); // k = hmac(k || v || 0x01 || seed) - v = h(); // v = hmac(k || v) - }; - const gen = () => { - // HMAC-DRBG generate() function - if (i++ >= 1000) - throw new Error('drbg: tried 1000 values'); - let len = 0; - const out = []; - while (len < qByteLen) { - v = h(); - const sl = v.slice(); - out.push(sl); - len += v.length; - } - return concatBytes(...out); - }; - const genUntil = (seed, pred) => { - reset(); - reseed(seed); // Steps D-G - let res = undefined; // Step H: grind until k is in [1..n-1] - while (!(res = pred(gen()))) - reseed(); - reset(); - return res; - }; - return genUntil; -} -// Validating curves and fields -const validatorFns = { - bigint: (val) => typeof val === 'bigint', - function: (val) => typeof val === 'function', - boolean: (val) => typeof val === 'boolean', - string: (val) => typeof val === 'string', - stringOrUint8Array: (val) => typeof val === 'string' || val instanceof Uint8Array, - isSafeInteger: (val) => Number.isSafeInteger(val), - array: (val) => Array.isArray(val), - field: (val, object) => object.Fp.isValid(val), - hash: (val) => typeof val === 'function' && Number.isSafeInteger(val.outputLen), -}; -// type Record = { [P in K]: T; } -function validateObject(object, validators, optValidators = {}) { - const checkField = (fieldName, type, isOptional) => { - const checkVal = validatorFns[type]; - if (typeof checkVal !== 'function') - throw new Error(`Invalid validator "${type}", expected function`); - const val = object[fieldName]; - if (isOptional && val === undefined) - return; - if (!checkVal(val, object)) { - throw new Error(`Invalid param ${String(fieldName)}=${val} (${typeof val}), expected ${type}`); - } - }; - for (const [fieldName, type] of Object.entries(validators)) - checkField(fieldName, type, false); - for (const [fieldName, type] of Object.entries(optValidators)) - checkField(fieldName, type, true); - return object; -} -// validate type tests -// const o: { a: number; b: number; c: number } = { a: 1, b: 5, c: 6 }; -// const z0 = validateObject(o, { a: 'isSafeInteger' }, { c: 'bigint' }); // Ok! -// // Should fail type-check -// const z1 = validateObject(o, { a: 'tmp' }, { c: 'zz' }); -// const z2 = validateObject(o, { a: 'isSafeInteger' }, { c: 'zz' }); -// const z3 = validateObject(o, { test: 'boolean', z: 'bug' }); -// const z4 = validateObject(o, { a: 'boolean', z: 'bug' }); - -var ut = /*#__PURE__*/Object.freeze({ - __proto__: null, - bitGet: bitGet, - bitLen: bitLen, - bitMask: bitMask, - bitSet: bitSet, - bytesToHex: bytesToHex, - bytesToNumberBE: bytesToNumberBE, - bytesToNumberLE: bytesToNumberLE, - concatBytes: concatBytes, - createHmacDrbg: createHmacDrbg, - ensureBytes: ensureBytes, - equalBytes: equalBytes, - hexToBytes: hexToBytes, - hexToNumber: hexToNumber, - numberToBytesBE: numberToBytesBE, - numberToBytesLE: numberToBytesLE, - numberToHexUnpadded: numberToHexUnpadded, - numberToVarBytesBE: numberToVarBytesBE, - utf8ToBytes: utf8ToBytes, - validateObject: validateObject -}); - -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -// Utilities for modular arithmetics and finite fields -// prettier-ignore -const _0n$2 = BigInt(0), _1n$3 = BigInt(1), _2n$1 = BigInt(2), _3n$1 = BigInt(3); -// prettier-ignore -const _4n = BigInt(4), _5n = BigInt(5), _8n = BigInt(8); -// prettier-ignore -BigInt(9); BigInt(16); -// Calculates a modulo b -function mod(a, b) { - const result = a % b; - return result >= _0n$2 ? result : b + result; -} -/** - * Efficiently raise num to power and do modular division. - * Unsafe in some contexts: uses ladder, so can expose bigint bits. - * @example - * pow(2n, 6n, 11n) // 64n % 11n == 9n - */ -// TODO: use field version && remove -function pow(num, power, modulo) { - if (modulo <= _0n$2 || power < _0n$2) - throw new Error('Expected power/modulo > 0'); - if (modulo === _1n$3) - return _0n$2; - let res = _1n$3; - while (power > _0n$2) { - if (power & _1n$3) - res = (res * num) % modulo; - num = (num * num) % modulo; - power >>= _1n$3; - } - return res; -} -// Does x ^ (2 ^ power) mod p. pow2(30, 4) == 30 ^ (2 ^ 4) -function pow2(x, power, modulo) { - let res = x; - while (power-- > _0n$2) { - res *= res; - res %= modulo; - } - return res; -} -// Inverses number over modulo -function invert(number, modulo) { - if (number === _0n$2 || modulo <= _0n$2) { - throw new Error(`invert: expected positive integers, got n=${number} mod=${modulo}`); - } - // Euclidean GCD https://brilliant.org/wiki/extended-euclidean-algorithm/ - // Fermat's little theorem "CT-like" version inv(n) = n^(m-2) mod m is 30x slower. - let a = mod(number, modulo); - let b = modulo; - // prettier-ignore - let x = _0n$2, u = _1n$3; - while (a !== _0n$2) { - // JIT applies optimization if those two lines follow each other - const q = b / a; - const r = b % a; - const m = x - u * q; - // prettier-ignore - b = a, a = r, x = u, u = m; - } - const gcd = b; - if (gcd !== _1n$3) - throw new Error('invert: does not exist'); - return mod(x, modulo); -} -/** - * Tonelli-Shanks square root search algorithm. - * 1. https://eprint.iacr.org/2012/685.pdf (page 12) - * 2. Square Roots from 1; 24, 51, 10 to Dan Shanks - * Will start an infinite loop if field order P is not prime. - * @param P field order - * @returns function that takes field Fp (created from P) and number n - */ -function tonelliShanks(P) { - // Legendre constant: used to calculate Legendre symbol (a | p), - // which denotes the value of a^((p-1)/2) (mod p). - // (a | p) ≡ 1 if a is a square (mod p) - // (a | p) ≡ -1 if a is not a square (mod p) - // (a | p) ≡ 0 if a ≡ 0 (mod p) - const legendreC = (P - _1n$3) / _2n$1; - let Q, S, Z; - // Step 1: By factoring out powers of 2 from p - 1, - // find q and s such that p - 1 = q*(2^s) with q odd - for (Q = P - _1n$3, S = 0; Q % _2n$1 === _0n$2; Q /= _2n$1, S++) - ; - // Step 2: Select a non-square z such that (z | p) ≡ -1 and set c ≡ zq - for (Z = _2n$1; Z < P && pow(Z, legendreC, P) !== P - _1n$3; Z++) - ; - // Fast-path - if (S === 1) { - const p1div4 = (P + _1n$3) / _4n; - return function tonelliFast(Fp, n) { - const root = Fp.pow(n, p1div4); - if (!Fp.eql(Fp.sqr(root), n)) - throw new Error('Cannot find square root'); - return root; - }; - } - // Slow-path - const Q1div2 = (Q + _1n$3) / _2n$1; - return function tonelliSlow(Fp, n) { - // Step 0: Check that n is indeed a square: (n | p) should not be ≡ -1 - if (Fp.pow(n, legendreC) === Fp.neg(Fp.ONE)) - throw new Error('Cannot find square root'); - let r = S; - // TODO: will fail at Fp2/etc - let g = Fp.pow(Fp.mul(Fp.ONE, Z), Q); // will update both x and b - let x = Fp.pow(n, Q1div2); // first guess at the square root - let b = Fp.pow(n, Q); // first guess at the fudge factor - while (!Fp.eql(b, Fp.ONE)) { - if (Fp.eql(b, Fp.ZERO)) - return Fp.ZERO; // https://en.wikipedia.org/wiki/Tonelli%E2%80%93Shanks_algorithm (4. If t = 0, return r = 0) - // Find m such b^(2^m)==1 - let m = 1; - for (let t2 = Fp.sqr(b); m < r; m++) { - if (Fp.eql(t2, Fp.ONE)) - break; - t2 = Fp.sqr(t2); // t2 *= t2 - } - // NOTE: r-m-1 can be bigger than 32, need to convert to bigint before shift, otherwise there will be overflow - const ge = Fp.pow(g, _1n$3 << BigInt(r - m - 1)); // ge = 2^(r-m-1) - g = Fp.sqr(ge); // g = ge * ge - x = Fp.mul(x, ge); // x *= ge - b = Fp.mul(b, g); // b *= g - r = m; - } - return x; - }; -} -function FpSqrt(P) { - // NOTE: different algorithms can give different roots, it is up to user to decide which one they want. - // For example there is FpSqrtOdd/FpSqrtEven to choice root based on oddness (used for hash-to-curve). - // P ≡ 3 (mod 4) - // √n = n^((P+1)/4) - if (P % _4n === _3n$1) { - // Not all roots possible! - // const ORDER = - // 0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaabn; - // const NUM = 72057594037927816n; - const p1div4 = (P + _1n$3) / _4n; - return function sqrt3mod4(Fp, n) { - const root = Fp.pow(n, p1div4); - // Throw if root**2 != n - if (!Fp.eql(Fp.sqr(root), n)) - throw new Error('Cannot find square root'); - return root; - }; - } - // Atkin algorithm for q ≡ 5 (mod 8), https://eprint.iacr.org/2012/685.pdf (page 10) - if (P % _8n === _5n) { - const c1 = (P - _5n) / _8n; - return function sqrt5mod8(Fp, n) { - const n2 = Fp.mul(n, _2n$1); - const v = Fp.pow(n2, c1); - const nv = Fp.mul(n, v); - const i = Fp.mul(Fp.mul(nv, _2n$1), v); - const root = Fp.mul(nv, Fp.sub(i, Fp.ONE)); - if (!Fp.eql(Fp.sqr(root), n)) - throw new Error('Cannot find square root'); - return root; - }; - } - // Other cases: Tonelli-Shanks algorithm - return tonelliShanks(P); -} -// prettier-ignore -const FIELD_FIELDS = [ - 'create', 'isValid', 'is0', 'neg', 'inv', 'sqrt', 'sqr', - 'eql', 'add', 'sub', 'mul', 'pow', 'div', - 'addN', 'subN', 'mulN', 'sqrN' -]; -function validateField(field) { - const initial = { - ORDER: 'bigint', - MASK: 'bigint', - BYTES: 'isSafeInteger', - BITS: 'isSafeInteger', - }; - const opts = FIELD_FIELDS.reduce((map, val) => { - map[val] = 'function'; - return map; - }, initial); - return validateObject(field, opts); -} -// Generic field functions -/** - * Same as `pow` but for Fp: non-constant-time. - * Unsafe in some contexts: uses ladder, so can expose bigint bits. - */ -function FpPow(f, num, power) { - // Should have same speed as pow for bigints - // TODO: benchmark! - if (power < _0n$2) - throw new Error('Expected power > 0'); - if (power === _0n$2) - return f.ONE; - if (power === _1n$3) - return num; - let p = f.ONE; - let d = num; - while (power > _0n$2) { - if (power & _1n$3) - p = f.mul(p, d); - d = f.sqr(d); - power >>= _1n$3; - } - return p; -} -/** - * Efficiently invert an array of Field elements. - * `inv(0)` will return `undefined` here: make sure to throw an error. - */ -function FpInvertBatch(f, nums) { - const tmp = new Array(nums.length); - // Walk from first to last, multiply them by each other MOD p - const lastMultiplied = nums.reduce((acc, num, i) => { - if (f.is0(num)) - return acc; - tmp[i] = acc; - return f.mul(acc, num); - }, f.ONE); - // Invert last element - const inverted = f.inv(lastMultiplied); - // Walk from last to first, multiply them by inverted each other MOD p - nums.reduceRight((acc, num, i) => { - if (f.is0(num)) - return acc; - tmp[i] = f.mul(acc, tmp[i]); - return f.mul(acc, num); - }, inverted); - return tmp; -} -// CURVE.n lengths -function nLength(n, nBitLength) { - // Bit size, byte size of CURVE.n - const _nBitLength = nBitLength !== undefined ? nBitLength : n.toString(2).length; - const nByteLength = Math.ceil(_nBitLength / 8); - return { nBitLength: _nBitLength, nByteLength }; -} -/** - * Initializes a finite field over prime. **Non-primes are not supported.** - * Do not init in loop: slow. Very fragile: always run a benchmark on a change. - * Major performance optimizations: - * * a) denormalized operations like mulN instead of mul - * * b) same object shape: never add or remove keys - * * c) Object.freeze - * @param ORDER prime positive bigint - * @param bitLen how many bits the field consumes - * @param isLE (def: false) if encoding / decoding should be in little-endian - * @param redef optional faster redefinitions of sqrt and other methods - */ -function Field(ORDER, bitLen, isLE = false, redef = {}) { - if (ORDER <= _0n$2) - throw new Error(`Expected Field ORDER > 0, got ${ORDER}`); - const { nBitLength: BITS, nByteLength: BYTES } = nLength(ORDER, bitLen); - if (BYTES > 2048) - throw new Error('Field lengths over 2048 bytes are not supported'); - const sqrtP = FpSqrt(ORDER); - const f = Object.freeze({ - ORDER, - BITS, - BYTES, - MASK: bitMask(BITS), - ZERO: _0n$2, - ONE: _1n$3, - create: (num) => mod(num, ORDER), - isValid: (num) => { - if (typeof num !== 'bigint') - throw new Error(`Invalid field element: expected bigint, got ${typeof num}`); - return _0n$2 <= num && num < ORDER; // 0 is valid element, but it's not invertible - }, - is0: (num) => num === _0n$2, - isOdd: (num) => (num & _1n$3) === _1n$3, - neg: (num) => mod(-num, ORDER), - eql: (lhs, rhs) => lhs === rhs, - sqr: (num) => mod(num * num, ORDER), - add: (lhs, rhs) => mod(lhs + rhs, ORDER), - sub: (lhs, rhs) => mod(lhs - rhs, ORDER), - mul: (lhs, rhs) => mod(lhs * rhs, ORDER), - pow: (num, power) => FpPow(f, num, power), - div: (lhs, rhs) => mod(lhs * invert(rhs, ORDER), ORDER), - // Same as above, but doesn't normalize - sqrN: (num) => num * num, - addN: (lhs, rhs) => lhs + rhs, - subN: (lhs, rhs) => lhs - rhs, - mulN: (lhs, rhs) => lhs * rhs, - inv: (num) => invert(num, ORDER), - sqrt: redef.sqrt || ((n) => sqrtP(f, n)), - invertBatch: (lst) => FpInvertBatch(f, lst), - // TODO: do we really need constant cmov? - // We don't have const-time bigints anyway, so probably will be not very useful - cmov: (a, b, c) => (c ? b : a), - toBytes: (num) => (isLE ? numberToBytesLE(num, BYTES) : numberToBytesBE(num, BYTES)), - fromBytes: (bytes) => { - if (bytes.length !== BYTES) - throw new Error(`Fp.fromBytes: expected ${BYTES}, got ${bytes.length}`); - return isLE ? bytesToNumberLE(bytes) : bytesToNumberBE(bytes); - }, - }); - return Object.freeze(f); -} -/** - * Returns total number of bytes consumed by the field element. - * For example, 32 bytes for usual 256-bit weierstrass curve. - * @param fieldOrder number of field elements, usually CURVE.n - * @returns byte length of field - */ -function getFieldBytesLength(fieldOrder) { - if (typeof fieldOrder !== 'bigint') - throw new Error('field order must be bigint'); - const bitLength = fieldOrder.toString(2).length; - return Math.ceil(bitLength / 8); -} -/** - * Returns minimal amount of bytes that can be safely reduced - * by field order. - * Should be 2^-128 for 128-bit curve such as P256. - * @param fieldOrder number of field elements, usually CURVE.n - * @returns byte length of target hash - */ -function getMinHashLength(fieldOrder) { - const length = getFieldBytesLength(fieldOrder); - return length + Math.ceil(length / 2); -} -/** - * "Constant-time" private key generation utility. - * Can take (n + n/2) or more bytes of uniform input e.g. from CSPRNG or KDF - * and convert them into private scalar, with the modulo bias being negligible. - * Needs at least 48 bytes of input for 32-byte private key. - * https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/ - * FIPS 186-5, A.2 https://csrc.nist.gov/publications/detail/fips/186/5/final - * RFC 9380, https://www.rfc-editor.org/rfc/rfc9380#section-5 - * @param hash hash output from SHA3 or a similar function - * @param groupOrder size of subgroup - (e.g. secp256k1.CURVE.n) - * @param isLE interpret hash bytes as LE num - * @returns valid private scalar - */ -function mapHashToField(key, fieldOrder, isLE = false) { - const len = key.length; - const fieldLen = getFieldBytesLength(fieldOrder); - const minLen = getMinHashLength(fieldOrder); - // No small numbers: need to understand bias story. No huge numbers: easier to detect JS timings. - if (len < 16 || len < minLen || len > 1024) - throw new Error(`expected ${minLen}-1024 bytes of input, got ${len}`); - const num = isLE ? bytesToNumberBE(key) : bytesToNumberLE(key); - // `mod(x, 11)` can sometimes produce 0. `mod(x, 10) + 1` is the same, but no 0 - const reduced = mod(num, fieldOrder - _1n$3) + _1n$3; - return isLE ? numberToBytesLE(reduced, fieldLen) : numberToBytesBE(reduced, fieldLen); -} - -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -// Abelian group utilities -const _0n$1 = BigInt(0); -const _1n$2 = BigInt(1); -// Elliptic curve multiplication of Point by scalar. Fragile. -// Scalars should always be less than curve order: this should be checked inside of a curve itself. -// Creates precomputation tables for fast multiplication: -// - private scalar is split by fixed size windows of W bits -// - every window point is collected from window's table & added to accumulator -// - since windows are different, same point inside tables won't be accessed more than once per calc -// - each multiplication is 'Math.ceil(CURVE_ORDER / 𝑊) + 1' point additions (fixed for any scalar) -// - +1 window is neccessary for wNAF -// - wNAF reduces table size: 2x less memory + 2x faster generation, but 10% slower multiplication -// TODO: Research returning 2d JS array of windows, instead of a single window. This would allow -// windows to be in different memory locations -function wNAF(c, bits) { - const constTimeNegate = (condition, item) => { - const neg = item.negate(); - return condition ? neg : item; - }; - const opts = (W) => { - const windows = Math.ceil(bits / W) + 1; // +1, because - const windowSize = 2 ** (W - 1); // -1 because we skip zero - return { windows, windowSize }; - }; - return { - constTimeNegate, - // non-const time multiplication ladder - unsafeLadder(elm, n) { - let p = c.ZERO; - let d = elm; - while (n > _0n$1) { - if (n & _1n$2) - p = p.add(d); - d = d.double(); - n >>= _1n$2; - } - return p; - }, - /** - * Creates a wNAF precomputation window. Used for caching. - * Default window size is set by `utils.precompute()` and is equal to 8. - * Number of precomputed points depends on the curve size: - * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where: - * - 𝑊 is the window size - * - 𝑛 is the bitlength of the curve order. - * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224. - * @returns precomputed point tables flattened to a single array - */ - precomputeWindow(elm, W) { - const { windows, windowSize } = opts(W); - const points = []; - let p = elm; - let base = p; - for (let window = 0; window < windows; window++) { - base = p; - points.push(base); - // =1, because we skip zero - for (let i = 1; i < windowSize; i++) { - base = base.add(p); - points.push(base); - } - p = base.double(); - } - return points; - }, - /** - * Implements ec multiplication using precomputed tables and w-ary non-adjacent form. - * @param W window size - * @param precomputes precomputed tables - * @param n scalar (we don't check here, but should be less than curve order) - * @returns real and fake (for const-time) points - */ - wNAF(W, precomputes, n) { - // TODO: maybe check that scalar is less than group order? wNAF behavious is undefined otherwise - // But need to carefully remove other checks before wNAF. ORDER == bits here - const { windows, windowSize } = opts(W); - let p = c.ZERO; - let f = c.BASE; - const mask = BigInt(2 ** W - 1); // Create mask with W ones: 0b1111 for W=4 etc. - const maxNumber = 2 ** W; - const shiftBy = BigInt(W); - for (let window = 0; window < windows; window++) { - const offset = window * windowSize; - // Extract W bits. - let wbits = Number(n & mask); - // Shift number by W bits. - n >>= shiftBy; - // If the bits are bigger than max size, we'll split those. - // +224 => 256 - 32 - if (wbits > windowSize) { - wbits -= maxNumber; - n += _1n$2; - } - // This code was first written with assumption that 'f' and 'p' will never be infinity point: - // since each addition is multiplied by 2 ** W, it cannot cancel each other. However, - // there is negate now: it is possible that negated element from low value - // would be the same as high element, which will create carry into next window. - // It's not obvious how this can fail, but still worth investigating later. - // Check if we're onto Zero point. - // Add random point inside current window to f. - const offset1 = offset; - const offset2 = offset + Math.abs(wbits) - 1; // -1 because we skip zero - const cond1 = window % 2 !== 0; - const cond2 = wbits < 0; - if (wbits === 0) { - // The most important part for const-time getPublicKey - f = f.add(constTimeNegate(cond1, precomputes[offset1])); - } - else { - p = p.add(constTimeNegate(cond2, precomputes[offset2])); - } - } - // JIT-compiler should not eliminate f here, since it will later be used in normalizeZ() - // Even if the variable is still unused, there are some checks which will - // throw an exception, so compiler needs to prove they won't happen, which is hard. - // At this point there is a way to F be infinity-point even if p is not, - // which makes it less const-time: around 1 bigint multiply. - return { p, f }; - }, - wNAFCached(P, precomputesMap, n, transform) { - // @ts-ignore - const W = P._WINDOW_SIZE || 1; - // Calculate precomputes on a first run, reuse them after - let comp = precomputesMap.get(P); - if (!comp) { - comp = this.precomputeWindow(P, W); - if (W !== 1) { - precomputesMap.set(P, transform(comp)); - } - } - return this.wNAF(W, comp, n); - }, - }; -} -function validateBasic(curve) { - validateField(curve.Fp); - validateObject(curve, { - n: 'bigint', - h: 'bigint', - Gx: 'field', - Gy: 'field', - }, { - nBitLength: 'isSafeInteger', - nByteLength: 'isSafeInteger', - }); - // Set defaults - return Object.freeze({ - ...nLength(curve.n, curve.nBitLength), - ...curve, - ...{ p: curve.Fp.ORDER }, - }); -} - -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -// Short Weierstrass curve. The formula is: y² = x³ + ax + b -function validatePointOpts(curve) { - const opts = validateBasic(curve); - validateObject(opts, { - a: 'field', - b: 'field', - }, { - allowedPrivateKeyLengths: 'array', - wrapPrivateKey: 'boolean', - isTorsionFree: 'function', - clearCofactor: 'function', - allowInfinityPoint: 'boolean', - fromBytes: 'function', - toBytes: 'function', - }); - const { endo, Fp, a } = opts; - if (endo) { - if (!Fp.eql(a, Fp.ZERO)) { - throw new Error('Endomorphism can only be defined for Koblitz curves that have a=0'); - } - if (typeof endo !== 'object' || - typeof endo.beta !== 'bigint' || - typeof endo.splitScalar !== 'function') { - throw new Error('Expected endomorphism with beta: bigint and splitScalar: function'); - } - } - return Object.freeze({ ...opts }); -} -// ASN.1 DER encoding utilities -const { bytesToNumberBE: b2n, hexToBytes: h2b } = ut; -const DER = { - // asn.1 DER encoding utils - Err: class DERErr extends Error { - constructor(m = '') { - super(m); - } - }, - _parseInt(data) { - const { Err: E } = DER; - if (data.length < 2 || data[0] !== 0x02) - throw new E('Invalid signature integer tag'); - const len = data[1]; - const res = data.subarray(2, len + 2); - if (!len || res.length !== len) - throw new E('Invalid signature integer: wrong length'); - // https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag, - // since we always use positive integers here. It must always be empty: - // - add zero byte if exists - // - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding) - if (res[0] & 0b10000000) - throw new E('Invalid signature integer: negative'); - if (res[0] === 0x00 && !(res[1] & 0b10000000)) - throw new E('Invalid signature integer: unnecessary leading zero'); - return { d: b2n(res), l: data.subarray(len + 2) }; // d is data, l is left - }, - toSig(hex) { - // parse DER signature - const { Err: E } = DER; - const data = typeof hex === 'string' ? h2b(hex) : hex; - if (!(data instanceof Uint8Array)) - throw new Error('ui8a expected'); - let l = data.length; - if (l < 2 || data[0] != 0x30) - throw new E('Invalid signature tag'); - if (data[1] !== l - 2) - throw new E('Invalid signature: incorrect length'); - const { d: r, l: sBytes } = DER._parseInt(data.subarray(2)); - const { d: s, l: rBytesLeft } = DER._parseInt(sBytes); - if (rBytesLeft.length) - throw new E('Invalid signature: left bytes after parsing'); - return { r, s }; - }, - hexFromSig(sig) { - // Add leading zero if first byte has negative bit enabled. More details in '_parseInt' - const slice = (s) => (Number.parseInt(s[0], 16) & 0b1000 ? '00' + s : s); - const h = (num) => { - const hex = num.toString(16); - return hex.length & 1 ? `0${hex}` : hex; - }; - const s = slice(h(sig.s)); - const r = slice(h(sig.r)); - const shl = s.length / 2; - const rhl = r.length / 2; - const sl = h(shl); - const rl = h(rhl); - return `30${h(rhl + shl + 4)}02${rl}${r}02${sl}${s}`; - }, -}; -// Be friendly to bad ECMAScript parsers by not using bigint literals -// prettier-ignore -const _0n = BigInt(0), _1n$1 = BigInt(1); BigInt(2); const _3n = BigInt(3); BigInt(4); -function weierstrassPoints(opts) { - const CURVE = validatePointOpts(opts); - const { Fp } = CURVE; // All curves has same field / group length as for now, but they can differ - const toBytes = CURVE.toBytes || - ((_c, point, _isCompressed) => { - const a = point.toAffine(); - return concatBytes(Uint8Array.from([0x04]), Fp.toBytes(a.x), Fp.toBytes(a.y)); - }); - const fromBytes = CURVE.fromBytes || - ((bytes) => { - // const head = bytes[0]; - const tail = bytes.subarray(1); - // if (head !== 0x04) throw new Error('Only non-compressed encoding is supported'); - const x = Fp.fromBytes(tail.subarray(0, Fp.BYTES)); - const y = Fp.fromBytes(tail.subarray(Fp.BYTES, 2 * Fp.BYTES)); - return { x, y }; - }); - /** - * y² = x³ + ax + b: Short weierstrass curve formula - * @returns y² - */ - function weierstrassEquation(x) { - const { a, b } = CURVE; - const x2 = Fp.sqr(x); // x * x - const x3 = Fp.mul(x2, x); // x2 * x - return Fp.add(Fp.add(x3, Fp.mul(x, a)), b); // x3 + a * x + b - } - // Validate whether the passed curve params are valid. - // We check if curve equation works for generator point. - // `assertValidity()` won't work: `isTorsionFree()` is not available at this point in bls12-381. - // ProjectivePoint class has not been initialized yet. - if (!Fp.eql(Fp.sqr(CURVE.Gy), weierstrassEquation(CURVE.Gx))) - throw new Error('bad generator point: equation left != right'); - // Valid group elements reside in range 1..n-1 - function isWithinCurveOrder(num) { - return typeof num === 'bigint' && _0n < num && num < CURVE.n; - } - function assertGE(num) { - if (!isWithinCurveOrder(num)) - throw new Error('Expected valid bigint: 0 < bigint < curve.n'); - } - // Validates if priv key is valid and converts it to bigint. - // Supports options allowedPrivateKeyLengths and wrapPrivateKey. - function normPrivateKeyToScalar(key) { - const { allowedPrivateKeyLengths: lengths, nByteLength, wrapPrivateKey, n } = CURVE; - if (lengths && typeof key !== 'bigint') { - if (key instanceof Uint8Array) - key = bytesToHex(key); - // Normalize to hex string, pad. E.g. P521 would norm 130-132 char hex to 132-char bytes - if (typeof key !== 'string' || !lengths.includes(key.length)) - throw new Error('Invalid key'); - key = key.padStart(nByteLength * 2, '0'); - } - let num; - try { - num = - typeof key === 'bigint' - ? key - : bytesToNumberBE(ensureBytes('private key', key, nByteLength)); - } - catch (error) { - throw new Error(`private key must be ${nByteLength} bytes, hex or bigint, not ${typeof key}`); - } - if (wrapPrivateKey) - num = mod(num, n); // disabled by default, enabled for BLS - assertGE(num); // num in range [1..N-1] - return num; - } - const pointPrecomputes = new Map(); - function assertPrjPoint(other) { - if (!(other instanceof Point)) - throw new Error('ProjectivePoint expected'); - } - /** - * Projective Point works in 3d / projective (homogeneous) coordinates: (x, y, z) ∋ (x=x/z, y=y/z) - * Default Point works in 2d / affine coordinates: (x, y) - * We're doing calculations in projective, because its operations don't require costly inversion. - */ - class Point { - constructor(px, py, pz) { - this.px = px; - this.py = py; - this.pz = pz; - if (px == null || !Fp.isValid(px)) - throw new Error('x required'); - if (py == null || !Fp.isValid(py)) - throw new Error('y required'); - if (pz == null || !Fp.isValid(pz)) - throw new Error('z required'); - } - // Does not validate if the point is on-curve. - // Use fromHex instead, or call assertValidity() later. - static fromAffine(p) { - const { x, y } = p || {}; - if (!p || !Fp.isValid(x) || !Fp.isValid(y)) - throw new Error('invalid affine point'); - if (p instanceof Point) - throw new Error('projective point not allowed'); - const is0 = (i) => Fp.eql(i, Fp.ZERO); - // fromAffine(x:0, y:0) would produce (x:0, y:0, z:1), but we need (x:0, y:1, z:0) - if (is0(x) && is0(y)) - return Point.ZERO; - return new Point(x, y, Fp.ONE); - } - get x() { - return this.toAffine().x; - } - get y() { - return this.toAffine().y; - } - /** - * Takes a bunch of Projective Points but executes only one - * inversion on all of them. Inversion is very slow operation, - * so this improves performance massively. - * Optimization: converts a list of projective points to a list of identical points with Z=1. - */ - static normalizeZ(points) { - const toInv = Fp.invertBatch(points.map((p) => p.pz)); - return points.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine); - } - /** - * Converts hash string or Uint8Array to Point. - * @param hex short/long ECDSA hex - */ - static fromHex(hex) { - const P = Point.fromAffine(fromBytes(ensureBytes('pointHex', hex))); - P.assertValidity(); - return P; - } - // Multiplies generator point by privateKey. - static fromPrivateKey(privateKey) { - return Point.BASE.multiply(normPrivateKeyToScalar(privateKey)); - } - // "Private method", don't use it directly - _setWindowSize(windowSize) { - this._WINDOW_SIZE = windowSize; - pointPrecomputes.delete(this); - } - // A point on curve is valid if it conforms to equation. - assertValidity() { - if (this.is0()) { - // (0, 1, 0) aka ZERO is invalid in most contexts. - // In BLS, ZERO can be serialized, so we allow it. - // (0, 0, 0) is wrong representation of ZERO and is always invalid. - if (CURVE.allowInfinityPoint && !Fp.is0(this.py)) - return; - throw new Error('bad point: ZERO'); - } - // Some 3rd-party test vectors require different wording between here & `fromCompressedHex` - const { x, y } = this.toAffine(); - // Check if x, y are valid field elements - if (!Fp.isValid(x) || !Fp.isValid(y)) - throw new Error('bad point: x or y not FE'); - const left = Fp.sqr(y); // y² - const right = weierstrassEquation(x); // x³ + ax + b - if (!Fp.eql(left, right)) - throw new Error('bad point: equation left != right'); - if (!this.isTorsionFree()) - throw new Error('bad point: not in prime-order subgroup'); - } - hasEvenY() { - const { y } = this.toAffine(); - if (Fp.isOdd) - return !Fp.isOdd(y); - throw new Error("Field doesn't support isOdd"); - } - /** - * Compare one point to another. - */ - equals(other) { - assertPrjPoint(other); - const { px: X1, py: Y1, pz: Z1 } = this; - const { px: X2, py: Y2, pz: Z2 } = other; - const U1 = Fp.eql(Fp.mul(X1, Z2), Fp.mul(X2, Z1)); - const U2 = Fp.eql(Fp.mul(Y1, Z2), Fp.mul(Y2, Z1)); - return U1 && U2; - } - /** - * Flips point to one corresponding to (x, -y) in Affine coordinates. - */ - negate() { - return new Point(this.px, Fp.neg(this.py), this.pz); - } - // Renes-Costello-Batina exception-free doubling formula. - // There is 30% faster Jacobian formula, but it is not complete. - // https://eprint.iacr.org/2015/1060, algorithm 3 - // Cost: 8M + 3S + 3*a + 2*b3 + 15add. - double() { - const { a, b } = CURVE; - const b3 = Fp.mul(b, _3n); - const { px: X1, py: Y1, pz: Z1 } = this; - let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore - let t0 = Fp.mul(X1, X1); // step 1 - let t1 = Fp.mul(Y1, Y1); - let t2 = Fp.mul(Z1, Z1); - let t3 = Fp.mul(X1, Y1); - t3 = Fp.add(t3, t3); // step 5 - Z3 = Fp.mul(X1, Z1); - Z3 = Fp.add(Z3, Z3); - X3 = Fp.mul(a, Z3); - Y3 = Fp.mul(b3, t2); - Y3 = Fp.add(X3, Y3); // step 10 - X3 = Fp.sub(t1, Y3); - Y3 = Fp.add(t1, Y3); - Y3 = Fp.mul(X3, Y3); - X3 = Fp.mul(t3, X3); - Z3 = Fp.mul(b3, Z3); // step 15 - t2 = Fp.mul(a, t2); - t3 = Fp.sub(t0, t2); - t3 = Fp.mul(a, t3); - t3 = Fp.add(t3, Z3); - Z3 = Fp.add(t0, t0); // step 20 - t0 = Fp.add(Z3, t0); - t0 = Fp.add(t0, t2); - t0 = Fp.mul(t0, t3); - Y3 = Fp.add(Y3, t0); - t2 = Fp.mul(Y1, Z1); // step 25 - t2 = Fp.add(t2, t2); - t0 = Fp.mul(t2, t3); - X3 = Fp.sub(X3, t0); - Z3 = Fp.mul(t2, t1); - Z3 = Fp.add(Z3, Z3); // step 30 - Z3 = Fp.add(Z3, Z3); - return new Point(X3, Y3, Z3); - } - // Renes-Costello-Batina exception-free addition formula. - // There is 30% faster Jacobian formula, but it is not complete. - // https://eprint.iacr.org/2015/1060, algorithm 1 - // Cost: 12M + 0S + 3*a + 3*b3 + 23add. - add(other) { - assertPrjPoint(other); - const { px: X1, py: Y1, pz: Z1 } = this; - const { px: X2, py: Y2, pz: Z2 } = other; - let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore - const a = CURVE.a; - const b3 = Fp.mul(CURVE.b, _3n); - let t0 = Fp.mul(X1, X2); // step 1 - let t1 = Fp.mul(Y1, Y2); - let t2 = Fp.mul(Z1, Z2); - let t3 = Fp.add(X1, Y1); - let t4 = Fp.add(X2, Y2); // step 5 - t3 = Fp.mul(t3, t4); - t4 = Fp.add(t0, t1); - t3 = Fp.sub(t3, t4); - t4 = Fp.add(X1, Z1); - let t5 = Fp.add(X2, Z2); // step 10 - t4 = Fp.mul(t4, t5); - t5 = Fp.add(t0, t2); - t4 = Fp.sub(t4, t5); - t5 = Fp.add(Y1, Z1); - X3 = Fp.add(Y2, Z2); // step 15 - t5 = Fp.mul(t5, X3); - X3 = Fp.add(t1, t2); - t5 = Fp.sub(t5, X3); - Z3 = Fp.mul(a, t4); - X3 = Fp.mul(b3, t2); // step 20 - Z3 = Fp.add(X3, Z3); - X3 = Fp.sub(t1, Z3); - Z3 = Fp.add(t1, Z3); - Y3 = Fp.mul(X3, Z3); - t1 = Fp.add(t0, t0); // step 25 - t1 = Fp.add(t1, t0); - t2 = Fp.mul(a, t2); - t4 = Fp.mul(b3, t4); - t1 = Fp.add(t1, t2); - t2 = Fp.sub(t0, t2); // step 30 - t2 = Fp.mul(a, t2); - t4 = Fp.add(t4, t2); - t0 = Fp.mul(t1, t4); - Y3 = Fp.add(Y3, t0); - t0 = Fp.mul(t5, t4); // step 35 - X3 = Fp.mul(t3, X3); - X3 = Fp.sub(X3, t0); - t0 = Fp.mul(t3, t1); - Z3 = Fp.mul(t5, Z3); - Z3 = Fp.add(Z3, t0); // step 40 - return new Point(X3, Y3, Z3); - } - subtract(other) { - return this.add(other.negate()); - } - is0() { - return this.equals(Point.ZERO); - } - wNAF(n) { - return wnaf.wNAFCached(this, pointPrecomputes, n, (comp) => { - const toInv = Fp.invertBatch(comp.map((p) => p.pz)); - return comp.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine); - }); - } - /** - * Non-constant-time multiplication. Uses double-and-add algorithm. - * It's faster, but should only be used when you don't care about - * an exposed private key e.g. sig verification, which works over *public* keys. - */ - multiplyUnsafe(n) { - const I = Point.ZERO; - if (n === _0n) - return I; - assertGE(n); // Will throw on 0 - if (n === _1n$1) - return this; - const { endo } = CURVE; - if (!endo) - return wnaf.unsafeLadder(this, n); - // Apply endomorphism - let { k1neg, k1, k2neg, k2 } = endo.splitScalar(n); - let k1p = I; - let k2p = I; - let d = this; - while (k1 > _0n || k2 > _0n) { - if (k1 & _1n$1) - k1p = k1p.add(d); - if (k2 & _1n$1) - k2p = k2p.add(d); - d = d.double(); - k1 >>= _1n$1; - k2 >>= _1n$1; - } - if (k1neg) - k1p = k1p.negate(); - if (k2neg) - k2p = k2p.negate(); - k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz); - return k1p.add(k2p); - } - /** - * Constant time multiplication. - * Uses wNAF method. Windowed method may be 10% faster, - * but takes 2x longer to generate and consumes 2x memory. - * Uses precomputes when available. - * Uses endomorphism for Koblitz curves. - * @param scalar by which the point would be multiplied - * @returns New point - */ - multiply(scalar) { - assertGE(scalar); - let n = scalar; - let point, fake; // Fake point is used to const-time mult - const { endo } = CURVE; - if (endo) { - const { k1neg, k1, k2neg, k2 } = endo.splitScalar(n); - let { p: k1p, f: f1p } = this.wNAF(k1); - let { p: k2p, f: f2p } = this.wNAF(k2); - k1p = wnaf.constTimeNegate(k1neg, k1p); - k2p = wnaf.constTimeNegate(k2neg, k2p); - k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz); - point = k1p.add(k2p); - fake = f1p.add(f2p); - } - else { - const { p, f } = this.wNAF(n); - point = p; - fake = f; - } - // Normalize `z` for both points, but return only real one - return Point.normalizeZ([point, fake])[0]; - } - /** - * Efficiently calculate `aP + bQ`. Unsafe, can expose private key, if used incorrectly. - * Not using Strauss-Shamir trick: precomputation tables are faster. - * The trick could be useful if both P and Q are not G (not in our case). - * @returns non-zero affine point - */ - multiplyAndAddUnsafe(Q, a, b) { - const G = Point.BASE; // No Strauss-Shamir trick: we have 10% faster G precomputes - const mul = (P, a // Select faster multiply() method - ) => (a === _0n || a === _1n$1 || !P.equals(G) ? P.multiplyUnsafe(a) : P.multiply(a)); - const sum = mul(this, a).add(mul(Q, b)); - return sum.is0() ? undefined : sum; - } - // Converts Projective point to affine (x, y) coordinates. - // Can accept precomputed Z^-1 - for example, from invertBatch. - // (x, y, z) ∋ (x=x/z, y=y/z) - toAffine(iz) { - const { px: x, py: y, pz: z } = this; - const is0 = this.is0(); - // If invZ was 0, we return zero point. However we still want to execute - // all operations, so we replace invZ with a random number, 1. - if (iz == null) - iz = is0 ? Fp.ONE : Fp.inv(z); - const ax = Fp.mul(x, iz); - const ay = Fp.mul(y, iz); - const zz = Fp.mul(z, iz); - if (is0) - return { x: Fp.ZERO, y: Fp.ZERO }; - if (!Fp.eql(zz, Fp.ONE)) - throw new Error('invZ was invalid'); - return { x: ax, y: ay }; - } - isTorsionFree() { - const { h: cofactor, isTorsionFree } = CURVE; - if (cofactor === _1n$1) - return true; // No subgroups, always torsion-free - if (isTorsionFree) - return isTorsionFree(Point, this); - throw new Error('isTorsionFree() has not been declared for the elliptic curve'); - } - clearCofactor() { - const { h: cofactor, clearCofactor } = CURVE; - if (cofactor === _1n$1) - return this; // Fast-path - if (clearCofactor) - return clearCofactor(Point, this); - return this.multiplyUnsafe(CURVE.h); - } - toRawBytes(isCompressed = true) { - this.assertValidity(); - return toBytes(Point, this, isCompressed); - } - toHex(isCompressed = true) { - return bytesToHex(this.toRawBytes(isCompressed)); - } - } - Point.BASE = new Point(CURVE.Gx, CURVE.Gy, Fp.ONE); - Point.ZERO = new Point(Fp.ZERO, Fp.ONE, Fp.ZERO); - const _bits = CURVE.nBitLength; - const wnaf = wNAF(Point, CURVE.endo ? Math.ceil(_bits / 2) : _bits); - // Validate if generator point is on curve - return { - CURVE, - ProjectivePoint: Point, - normPrivateKeyToScalar, - weierstrassEquation, - isWithinCurveOrder, - }; -} -function validateOpts(curve) { - const opts = validateBasic(curve); - validateObject(opts, { - hash: 'hash', - hmac: 'function', - randomBytes: 'function', - }, { - bits2int: 'function', - bits2int_modN: 'function', - lowS: 'boolean', - }); - return Object.freeze({ lowS: true, ...opts }); -} -function weierstrass(curveDef) { - const CURVE = validateOpts(curveDef); - const { Fp, n: CURVE_ORDER } = CURVE; - const compressedLen = Fp.BYTES + 1; // e.g. 33 for 32 - const uncompressedLen = 2 * Fp.BYTES + 1; // e.g. 65 for 32 - function isValidFieldElement(num) { - return _0n < num && num < Fp.ORDER; // 0 is banned since it's not invertible FE - } - function modN(a) { - return mod(a, CURVE_ORDER); - } - function invN(a) { - return invert(a, CURVE_ORDER); - } - const { ProjectivePoint: Point, normPrivateKeyToScalar, weierstrassEquation, isWithinCurveOrder, } = weierstrassPoints({ - ...CURVE, - toBytes(_c, point, isCompressed) { - const a = point.toAffine(); - const x = Fp.toBytes(a.x); - const cat = concatBytes; - if (isCompressed) { - return cat(Uint8Array.from([point.hasEvenY() ? 0x02 : 0x03]), x); - } - else { - return cat(Uint8Array.from([0x04]), x, Fp.toBytes(a.y)); - } - }, - fromBytes(bytes) { - const len = bytes.length; - const head = bytes[0]; - const tail = bytes.subarray(1); - // this.assertValidity() is done inside of fromHex - if (len === compressedLen && (head === 0x02 || head === 0x03)) { - const x = bytesToNumberBE(tail); - if (!isValidFieldElement(x)) - throw new Error('Point is not on curve'); - const y2 = weierstrassEquation(x); // y² = x³ + ax + b - let y = Fp.sqrt(y2); // y = y² ^ (p+1)/4 - const isYOdd = (y & _1n$1) === _1n$1; - // ECDSA - const isHeadOdd = (head & 1) === 1; - if (isHeadOdd !== isYOdd) - y = Fp.neg(y); - return { x, y }; - } - else if (len === uncompressedLen && head === 0x04) { - const x = Fp.fromBytes(tail.subarray(0, Fp.BYTES)); - const y = Fp.fromBytes(tail.subarray(Fp.BYTES, 2 * Fp.BYTES)); - return { x, y }; - } - else { - throw new Error(`Point of length ${len} was invalid. Expected ${compressedLen} compressed bytes or ${uncompressedLen} uncompressed bytes`); - } - }, - }); - const numToNByteStr = (num) => bytesToHex(numberToBytesBE(num, CURVE.nByteLength)); - function isBiggerThanHalfOrder(number) { - const HALF = CURVE_ORDER >> _1n$1; - return number > HALF; - } - function normalizeS(s) { - return isBiggerThanHalfOrder(s) ? modN(-s) : s; - } - // slice bytes num - const slcNum = (b, from, to) => bytesToNumberBE(b.slice(from, to)); - /** - * ECDSA signature with its (r, s) properties. Supports DER & compact representations. - */ - class Signature { - constructor(r, s, recovery) { - this.r = r; - this.s = s; - this.recovery = recovery; - this.assertValidity(); - } - // pair (bytes of r, bytes of s) - static fromCompact(hex) { - const l = CURVE.nByteLength; - hex = ensureBytes('compactSignature', hex, l * 2); - return new Signature(slcNum(hex, 0, l), slcNum(hex, l, 2 * l)); - } - // DER encoded ECDSA signature - // https://bitcoin.stackexchange.com/questions/57644/what-are-the-parts-of-a-bitcoin-transaction-input-script - static fromDER(hex) { - const { r, s } = DER.toSig(ensureBytes('DER', hex)); - return new Signature(r, s); - } - assertValidity() { - // can use assertGE here - if (!isWithinCurveOrder(this.r)) - throw new Error('r must be 0 < r < CURVE.n'); - if (!isWithinCurveOrder(this.s)) - throw new Error('s must be 0 < s < CURVE.n'); - } - addRecoveryBit(recovery) { - return new Signature(this.r, this.s, recovery); - } - recoverPublicKey(msgHash) { - const { r, s, recovery: rec } = this; - const h = bits2int_modN(ensureBytes('msgHash', msgHash)); // Truncate hash - if (rec == null || ![0, 1, 2, 3].includes(rec)) - throw new Error('recovery id invalid'); - const radj = rec === 2 || rec === 3 ? r + CURVE.n : r; - if (radj >= Fp.ORDER) - throw new Error('recovery id 2 or 3 invalid'); - const prefix = (rec & 1) === 0 ? '02' : '03'; - const R = Point.fromHex(prefix + numToNByteStr(radj)); - const ir = invN(radj); // r^-1 - const u1 = modN(-h * ir); // -hr^-1 - const u2 = modN(s * ir); // sr^-1 - const Q = Point.BASE.multiplyAndAddUnsafe(R, u1, u2); // (sr^-1)R-(hr^-1)G = -(hr^-1)G + (sr^-1) - if (!Q) - throw new Error('point at infinify'); // unsafe is fine: no priv data leaked - Q.assertValidity(); - return Q; - } - // Signatures should be low-s, to prevent malleability. - hasHighS() { - return isBiggerThanHalfOrder(this.s); - } - normalizeS() { - return this.hasHighS() ? new Signature(this.r, modN(-this.s), this.recovery) : this; - } - // DER-encoded - toDERRawBytes() { - return hexToBytes(this.toDERHex()); - } - toDERHex() { - return DER.hexFromSig({ r: this.r, s: this.s }); - } - // padded bytes of r, then padded bytes of s - toCompactRawBytes() { - return hexToBytes(this.toCompactHex()); - } - toCompactHex() { - return numToNByteStr(this.r) + numToNByteStr(this.s); - } - } - const utils = { - isValidPrivateKey(privateKey) { - try { - normPrivateKeyToScalar(privateKey); - return true; - } - catch (error) { - return false; - } - }, - normPrivateKeyToScalar: normPrivateKeyToScalar, - /** - * Produces cryptographically secure private key from random of size - * (groupLen + ceil(groupLen / 2)) with modulo bias being negligible. - */ - randomPrivateKey: () => { - const length = getMinHashLength(CURVE.n); - return mapHashToField(CURVE.randomBytes(length), CURVE.n); - }, - /** - * Creates precompute table for an arbitrary EC point. Makes point "cached". - * Allows to massively speed-up `point.multiply(scalar)`. - * @returns cached point - * @example - * const fast = utils.precompute(8, ProjectivePoint.fromHex(someonesPubKey)); - * fast.multiply(privKey); // much faster ECDH now - */ - precompute(windowSize = 8, point = Point.BASE) { - point._setWindowSize(windowSize); - point.multiply(BigInt(3)); // 3 is arbitrary, just need any number here - return point; - }, - }; - /** - * Computes public key for a private key. Checks for validity of the private key. - * @param privateKey private key - * @param isCompressed whether to return compact (default), or full key - * @returns Public key, full when isCompressed=false; short when isCompressed=true - */ - function getPublicKey(privateKey, isCompressed = true) { - return Point.fromPrivateKey(privateKey).toRawBytes(isCompressed); - } - /** - * Quick and dirty check for item being public key. Does not validate hex, or being on-curve. - */ - function isProbPub(item) { - const arr = item instanceof Uint8Array; - const str = typeof item === 'string'; - const len = (arr || str) && item.length; - if (arr) - return len === compressedLen || len === uncompressedLen; - if (str) - return len === 2 * compressedLen || len === 2 * uncompressedLen; - if (item instanceof Point) - return true; - return false; - } - /** - * ECDH (Elliptic Curve Diffie Hellman). - * Computes shared public key from private key and public key. - * Checks: 1) private key validity 2) shared key is on-curve. - * Does NOT hash the result. - * @param privateA private key - * @param publicB different public key - * @param isCompressed whether to return compact (default), or full key - * @returns shared public key - */ - function getSharedSecret(privateA, publicB, isCompressed = true) { - if (isProbPub(privateA)) - throw new Error('first arg must be private key'); - if (!isProbPub(publicB)) - throw new Error('second arg must be public key'); - const b = Point.fromHex(publicB); // check for being on-curve - return b.multiply(normPrivateKeyToScalar(privateA)).toRawBytes(isCompressed); - } - // RFC6979: ensure ECDSA msg is X bytes and < N. RFC suggests optional truncating via bits2octets. - // FIPS 186-4 4.6 suggests the leftmost min(nBitLen, outLen) bits, which matches bits2int. - // bits2int can produce res>N, we can do mod(res, N) since the bitLen is the same. - // int2octets can't be used; pads small msgs with 0: unacceptatble for trunc as per RFC vectors - const bits2int = CURVE.bits2int || - function (bytes) { - // For curves with nBitLength % 8 !== 0: bits2octets(bits2octets(m)) !== bits2octets(m) - // for some cases, since bytes.length * 8 is not actual bitLength. - const num = bytesToNumberBE(bytes); // check for == u8 done here - const delta = bytes.length * 8 - CURVE.nBitLength; // truncate to nBitLength leftmost bits - return delta > 0 ? num >> BigInt(delta) : num; - }; - const bits2int_modN = CURVE.bits2int_modN || - function (bytes) { - return modN(bits2int(bytes)); // can't use bytesToNumberBE here - }; - // NOTE: pads output with zero as per spec - const ORDER_MASK = bitMask(CURVE.nBitLength); - /** - * Converts to bytes. Checks if num in `[0..ORDER_MASK-1]` e.g.: `[0..2^256-1]`. - */ - function int2octets(num) { - if (typeof num !== 'bigint') - throw new Error('bigint expected'); - if (!(_0n <= num && num < ORDER_MASK)) - throw new Error(`bigint expected < 2^${CURVE.nBitLength}`); - // works with order, can have different size than numToField! - return numberToBytesBE(num, CURVE.nByteLength); - } - // Steps A, D of RFC6979 3.2 - // Creates RFC6979 seed; converts msg/privKey to numbers. - // Used only in sign, not in verify. - // NOTE: we cannot assume here that msgHash has same amount of bytes as curve order, this will be wrong at least for P521. - // Also it can be bigger for P224 + SHA256 - function prepSig(msgHash, privateKey, opts = defaultSigOpts) { - if (['recovered', 'canonical'].some((k) => k in opts)) - throw new Error('sign() legacy options not supported'); - const { hash, randomBytes } = CURVE; - let { lowS, prehash, extraEntropy: ent } = opts; // generates low-s sigs by default - if (lowS == null) - lowS = true; // RFC6979 3.2: we skip step A, because we already provide hash - msgHash = ensureBytes('msgHash', msgHash); - if (prehash) - msgHash = ensureBytes('prehashed msgHash', hash(msgHash)); - // We can't later call bits2octets, since nested bits2int is broken for curves - // with nBitLength % 8 !== 0. Because of that, we unwrap it here as int2octets call. - // const bits2octets = (bits) => int2octets(bits2int_modN(bits)) - const h1int = bits2int_modN(msgHash); - const d = normPrivateKeyToScalar(privateKey); // validate private key, convert to bigint - const seedArgs = [int2octets(d), int2octets(h1int)]; - // extraEntropy. RFC6979 3.6: additional k' (optional). - if (ent != null) { - // K = HMAC_K(V || 0x00 || int2octets(x) || bits2octets(h1) || k') - const e = ent === true ? randomBytes(Fp.BYTES) : ent; // generate random bytes OR pass as-is - seedArgs.push(ensureBytes('extraEntropy', e)); // check for being bytes - } - const seed = concatBytes(...seedArgs); // Step D of RFC6979 3.2 - const m = h1int; // NOTE: no need to call bits2int second time here, it is inside truncateHash! - // Converts signature params into point w r/s, checks result for validity. - function k2sig(kBytes) { - // RFC 6979 Section 3.2, step 3: k = bits2int(T) - const k = bits2int(kBytes); // Cannot use fields methods, since it is group element - if (!isWithinCurveOrder(k)) - return; // Important: all mod() calls here must be done over N - const ik = invN(k); // k^-1 mod n - const q = Point.BASE.multiply(k).toAffine(); // q = Gk - const r = modN(q.x); // r = q.x mod n - if (r === _0n) - return; - // Can use scalar blinding b^-1(bm + bdr) where b ∈ [1,q−1] according to - // https://tches.iacr.org/index.php/TCHES/article/view/7337/6509. We've decided against it: - // a) dependency on CSPRNG b) 15% slowdown c) doesn't really help since bigints are not CT - const s = modN(ik * modN(m + r * d)); // Not using blinding here - if (s === _0n) - return; - let recovery = (q.x === r ? 0 : 2) | Number(q.y & _1n$1); // recovery bit (2 or 3, when q.x > n) - let normS = s; - if (lowS && isBiggerThanHalfOrder(s)) { - normS = normalizeS(s); // if lowS was passed, ensure s is always - recovery ^= 1; // // in the bottom half of N - } - return new Signature(r, normS, recovery); // use normS, not s - } - return { seed, k2sig }; - } - const defaultSigOpts = { lowS: CURVE.lowS, prehash: false }; - const defaultVerOpts = { lowS: CURVE.lowS, prehash: false }; - /** - * Signs message hash with a private key. - * ``` - * sign(m, d, k) where - * (x, y) = G × k - * r = x mod n - * s = (m + dr)/k mod n - * ``` - * @param msgHash NOT message. msg needs to be hashed to `msgHash`, or use `prehash`. - * @param privKey private key - * @param opts lowS for non-malleable sigs. extraEntropy for mixing randomness into k. prehash will hash first arg. - * @returns signature with recovery param - */ - function sign(msgHash, privKey, opts = defaultSigOpts) { - const { seed, k2sig } = prepSig(msgHash, privKey, opts); // Steps A, D of RFC6979 3.2. - const C = CURVE; - const drbg = createHmacDrbg(C.hash.outputLen, C.nByteLength, C.hmac); - return drbg(seed, k2sig); // Steps B, C, D, E, F, G - } - // Enable precomputes. Slows down first publicKey computation by 20ms. - Point.BASE._setWindowSize(8); - // utils.precompute(8, ProjectivePoint.BASE) - /** - * Verifies a signature against message hash and public key. - * Rejects lowS signatures by default: to override, - * specify option `{lowS: false}`. Implements section 4.1.4 from https://www.secg.org/sec1-v2.pdf: - * - * ``` - * verify(r, s, h, P) where - * U1 = hs^-1 mod n - * U2 = rs^-1 mod n - * R = U1⋅G - U2⋅P - * mod(R.x, n) == r - * ``` - */ - function verify(signature, msgHash, publicKey, opts = defaultVerOpts) { - const sg = signature; - msgHash = ensureBytes('msgHash', msgHash); - publicKey = ensureBytes('publicKey', publicKey); - if ('strict' in opts) - throw new Error('options.strict was renamed to lowS'); - const { lowS, prehash } = opts; - let _sig = undefined; - let P; - try { - if (typeof sg === 'string' || sg instanceof Uint8Array) { - // Signature can be represented in 2 ways: compact (2*nByteLength) & DER (variable-length). - // Since DER can also be 2*nByteLength bytes, we check for it first. - try { - _sig = Signature.fromDER(sg); - } - catch (derError) { - if (!(derError instanceof DER.Err)) - throw derError; - _sig = Signature.fromCompact(sg); - } - } - else if (typeof sg === 'object' && typeof sg.r === 'bigint' && typeof sg.s === 'bigint') { - const { r, s } = sg; - _sig = new Signature(r, s); - } - else { - throw new Error('PARSE'); - } - P = Point.fromHex(publicKey); - } - catch (error) { - if (error.message === 'PARSE') - throw new Error(`signature must be Signature instance, Uint8Array or hex string`); - return false; - } - if (lowS && _sig.hasHighS()) - return false; - if (prehash) - msgHash = CURVE.hash(msgHash); - const { r, s } = _sig; - const h = bits2int_modN(msgHash); // Cannot use fields methods, since it is group element - const is = invN(s); // s^-1 - const u1 = modN(h * is); // u1 = hs^-1 mod n - const u2 = modN(r * is); // u2 = rs^-1 mod n - const R = Point.BASE.multiplyAndAddUnsafe(P, u1, u2)?.toAffine(); // R = u1⋅G + u2⋅P - if (!R) - return false; - const v = modN(R.x); - return v === r; - } - return { - CURVE, - getPublicKey, - getSharedSecret, - sign, - verify, - ProjectivePoint: Point, - Signature, - utils, - }; -} - -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -// connects noble-curves to noble-hashes -function getHash(hash) { - return { - hash, - hmac: (key, ...msgs) => hmac(hash, key, concatBytes$1(...msgs)), - randomBytes: randomBytes$2, - }; -} -function createCurve(curveDef, defHash) { - const create = (hash) => weierstrass({ ...curveDef, ...getHash(hash) }); - return Object.freeze({ ...create(defHash), create }); -} - -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const secp256k1P = BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f'); -const secp256k1N = BigInt('0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141'); -const _1n = BigInt(1); -const _2n = BigInt(2); -const divNearest = (a, b) => (a + b / _2n) / b; -/** - * √n = n^((p+1)/4) for fields p = 3 mod 4. We unwrap the loop and multiply bit-by-bit. - * (P+1n/4n).toString(2) would produce bits [223x 1, 0, 22x 1, 4x 0, 11, 00] - */ -function sqrtMod(y) { - const P = secp256k1P; - // prettier-ignore - const _3n = BigInt(3), _6n = BigInt(6), _11n = BigInt(11), _22n = BigInt(22); - // prettier-ignore - const _23n = BigInt(23), _44n = BigInt(44), _88n = BigInt(88); - const b2 = (y * y * y) % P; // x^3, 11 - const b3 = (b2 * b2 * y) % P; // x^7 - const b6 = (pow2(b3, _3n, P) * b3) % P; - const b9 = (pow2(b6, _3n, P) * b3) % P; - const b11 = (pow2(b9, _2n, P) * b2) % P; - const b22 = (pow2(b11, _11n, P) * b11) % P; - const b44 = (pow2(b22, _22n, P) * b22) % P; - const b88 = (pow2(b44, _44n, P) * b44) % P; - const b176 = (pow2(b88, _88n, P) * b88) % P; - const b220 = (pow2(b176, _44n, P) * b44) % P; - const b223 = (pow2(b220, _3n, P) * b3) % P; - const t1 = (pow2(b223, _23n, P) * b22) % P; - const t2 = (pow2(t1, _6n, P) * b2) % P; - const root = pow2(t2, _2n, P); - if (!Fp.eql(Fp.sqr(root), y)) - throw new Error('Cannot find square root'); - return root; -} -const Fp = Field(secp256k1P, undefined, undefined, { sqrt: sqrtMod }); -const secp256k1 = createCurve({ - a: BigInt(0), - b: BigInt(7), - Fp, - n: secp256k1N, - // Base point (x, y) aka generator point - Gx: BigInt('55066263022277343669578718895168534326250603453777594175500187360389116729240'), - Gy: BigInt('32670510020758816978083085130507043184471273380659243275938904335757337482424'), - h: BigInt(1), - lowS: true, - /** - * secp256k1 belongs to Koblitz curves: it has efficiently computable endomorphism. - * Endomorphism uses 2x less RAM, speeds up precomputation by 2x and ECDH / key recovery by 20%. - * For precomputed wNAF it trades off 1/2 init time & 1/3 ram for 20% perf hit. - * Explanation: https://gist.github.com/paulmillr/eb670806793e84df628a7c434a873066 - */ - endo: { - beta: BigInt('0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee'), - splitScalar: (k) => { - const n = secp256k1N; - const a1 = BigInt('0x3086d221a7d46bcde86c90e49284eb15'); - const b1 = -_1n * BigInt('0xe4437ed6010e88286f547fa90abfe4c3'); - const a2 = BigInt('0x114ca50f7a8e2f3f657c1108d9d44cfd8'); - const b2 = a1; - const POW_2_128 = BigInt('0x100000000000000000000000000000000'); // (2n**128n).toString(16) - const c1 = divNearest(b2 * k, n); - const c2 = divNearest(-b1 * k, n); - let k1 = mod(k - c1 * a1 - c2 * a2, n); - let k2 = mod(-c1 * b1 - c2 * b2, n); - const k1neg = k1 > POW_2_128; - const k2neg = k2 > POW_2_128; - if (k1neg) - k1 = n - k1; - if (k2neg) - k2 = n - k2; - if (k1 > POW_2_128 || k2 > POW_2_128) { - throw new Error('splitScalar: Endomorphism failed, k=' + k); - } - return { k1neg, k1, k2neg, k2 }; - }, - }, -}, sha256$1); -// Schnorr signatures are superior to ECDSA from above. Below is Schnorr-specific BIP0340 code. -// https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki -BigInt(0); -secp256k1.ProjectivePoint; - -/** - * A constant for the zero address. - * - * (**i.e.** ``"0x0000000000000000000000000000000000000000"``) - */ -const ZeroAddress = "0x0000000000000000000000000000000000000000"; - -/** - * A constant for the zero hash. - * - * (**i.e.** ``"0x0000000000000000000000000000000000000000000000000000000000000000"``) - */ -const ZeroHash = "0x0000000000000000000000000000000000000000000000000000000000000000"; - -/** - * A constant for the order N for the secp256k1 curve. - * - * (**i.e.** ``0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n``) - */ -const N$1 = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); -/** - * A constant for the number of wei in a single ether. - * - * (**i.e.** ``1000000000000000000n``) - */ -const WeiPerEther = BigInt("1000000000000000000"); -/** - * A constant for the maximum value for a ``uint256``. - * - * (**i.e.** ``0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) - */ -const MaxUint256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); -/** - * A constant for the minimum value for an ``int256``. - * - * (**i.e.** ``-8000000000000000000000000000000000000000000000000000000000000000n``) - */ -const MinInt256 = BigInt("0x8000000000000000000000000000000000000000000000000000000000000000") * BigInt(-1); -/** - * A constant for the maximum value for an ``int256``. - * - * (**i.e.** ``0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) - */ -const MaxInt256 = BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); - -// NFKC (composed) // (decomposed) -/** - * A constant for the ether symbol (normalized using NFKC). - * - * (**i.e.** ``"\\u039e"``) - */ -const EtherSymbol = "\u039e"; // "\uD835\uDF63"; -/** - * A constant for the [[link-eip-191]] personal message prefix. - * - * (**i.e.** ``"\\x19Ethereum Signed Message:\\n"``) - */ -const MessagePrefix = "\x19Ethereum Signed Message:\n"; - -// Constants -const BN_0$7 = BigInt(0); -const BN_1$3 = BigInt(1); -const BN_2$3 = BigInt(2); -const BN_27$1 = BigInt(27); -const BN_28$1 = BigInt(28); -const BN_35$1 = BigInt(35); -const BN_N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); -const BN_N_2 = BN_N / BN_2$3; // Must be integer (floor) division; do NOT shifts -const inspect$1 = Symbol.for("nodejs.util.inspect.custom"); -const _guard$3 = {}; -function toUint256(value) { - return zeroPadValue(toBeArray(value), 32); -} -/** - * A Signature @TODO - * - * - * @_docloc: api/crypto:Signing - */ -class Signature { - #r; - #s; - #v; - #networkV; - /** - * The ``r`` value for a signature. - * - * This represents the ``x`` coordinate of a "reference" or - * challenge point, from which the ``y`` can be computed. - */ - get r() { return this.#r; } - set r(value) { - assertArgument(dataLength(value) === 32, "invalid r", "value", value); - this.#r = hexlify(value); - } - /** - * The ``s`` value for a signature. - */ - get s() { - assertArgument(parseInt(this.#s.substring(0, 3)) < 8, "non-canonical s; use ._s", "s", this.#s); - return this.#s; - } - set s(_value) { - assertArgument(dataLength(_value) === 32, "invalid s", "value", _value); - this.#s = hexlify(_value); - } - /** - * Return the s value, unchecked for EIP-2 compliance. - * - * This should generally not be used and is for situations where - * a non-canonical S value might be relevant, such as Frontier blocks - * that were mined prior to EIP-2 or invalid Authorization List - * signatures. - */ - get _s() { return this.#s; } - /** - * Returns true if the Signature is valid for [[link-eip-2]] signatures. - */ - isValid() { - const s = BigInt(this.#s); - return (s <= BN_N_2); - } - /** - * The ``v`` value for a signature. - * - * Since a given ``x`` value for ``r`` has two possible values for - * its correspondin ``y``, the ``v`` indicates which of the two ``y`` - * values to use. - * - * It is normalized to the values ``27`` or ``28`` for legacy - * purposes. - */ - get v() { return this.#v; } - set v(value) { - const v = getNumber(value, "value"); - assertArgument(v === 27 || v === 28, "invalid v", "v", value); - this.#v = v; - } - /** - * The EIP-155 ``v`` for legacy transactions. For non-legacy - * transactions, this value is ``null``. - */ - get networkV() { return this.#networkV; } - /** - * The chain ID for EIP-155 legacy transactions. For non-legacy - * transactions, this value is ``null``. - */ - get legacyChainId() { - const v = this.networkV; - if (v == null) { - return null; - } - return Signature.getChainId(v); - } - /** - * The ``yParity`` for the signature. - * - * See ``v`` for more details on how this value is used. - */ - get yParity() { - return (this.v === 27) ? 0 : 1; - } - /** - * The [[link-eip-2098]] compact representation of the ``yParity`` - * and ``s`` compacted into a single ``bytes32``. - */ - get yParityAndS() { - // The EIP-2098 compact representation - const yParityAndS = getBytes(this.s); - if (this.yParity) { - yParityAndS[0] |= 0x80; - } - return hexlify(yParityAndS); - } - /** - * The [[link-eip-2098]] compact representation. - */ - get compactSerialized() { - return concat([this.r, this.yParityAndS]); - } - /** - * The serialized representation. - */ - get serialized() { - return concat([this.r, this.s, (this.yParity ? "0x1c" : "0x1b")]); - } - /** - * @private - */ - constructor(guard, r, s, v) { - assertPrivate(guard, _guard$3, "Signature"); - this.#r = r; - this.#s = s; - this.#v = v; - this.#networkV = null; - } - /** - * Returns the canonical signature. - * - * This is only necessary when dealing with legacy transaction which - * did not enforce canonical S values (i.e. [[link-eip-2]]. Most - * developers should never require this. - */ - getCanonical() { - if (this.isValid()) { - return this; - } - // Compute the canonical signature; s' = N - s, v = !v - const s = BN_N - BigInt(this._s); - const v = (55 - this.v); - const result = new Signature(_guard$3, this.r, toUint256(s), v); - // Populate the networkV if necessary - if (this.networkV) { - result.#networkV = this.networkV; - } - return result; - } - /** - * Returns a new identical [[Signature]]. - */ - clone() { - const clone = new Signature(_guard$3, this.r, this._s, this.v); - if (this.networkV) { - clone.#networkV = this.networkV; - } - return clone; - } - /** - * Returns a representation that is compatible with ``JSON.stringify``. - */ - toJSON() { - const networkV = this.networkV; - return { - _type: "signature", - networkV: ((networkV != null) ? networkV.toString() : null), - r: this.r, s: this._s, v: this.v, - }; - } - [inspect$1]() { - return this.toString(); - } - toString() { - if (this.isValid()) { - return `Signature { r: ${this.r}, s: ${this._s}, v: ${this.v} }`; - } - return `Signature { r: ${this.r}, s: ${this._s}, v: ${this.v}, valid: false }`; - } - /** - * Compute the chain ID from the ``v`` in a legacy EIP-155 transactions. - * - * @example: - * Signature.getChainId(45) - * //_result: - * - * Signature.getChainId(46) - * //_result: - */ - static getChainId(v) { - const bv = getBigInt(v, "v"); - // The v is not an EIP-155 v, so it is the unspecified chain ID - if ((bv == BN_27$1) || (bv == BN_28$1)) { - return BN_0$7; - } - // Bad value for an EIP-155 v - assertArgument(bv >= BN_35$1, "invalid EIP-155 v", "v", v); - return (bv - BN_35$1) / BN_2$3; - } - /** - * Compute the ``v`` for a chain ID for a legacy EIP-155 transactions. - * - * Legacy transactions which use [[link-eip-155]] hijack the ``v`` - * property to include the chain ID. - * - * @example: - * Signature.getChainIdV(5, 27) - * //_result: - * - * Signature.getChainIdV(5, 28) - * //_result: - * - */ - static getChainIdV(chainId, v) { - return (getBigInt(chainId) * BN_2$3) + BigInt(35 + v - 27); - } - /** - * Compute the normalized legacy transaction ``v`` from a ``yParirty``, - * a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction. - * - * @example: - * // The values 0 and 1 imply v is actually yParity - * Signature.getNormalizedV(0) - * //_result: - * - * // Legacy non-EIP-1559 transaction (i.e. 27 or 28) - * Signature.getNormalizedV(27) - * //_result: - * - * // Legacy EIP-155 transaction (i.e. >= 35) - * Signature.getNormalizedV(46) - * //_result: - * - * // Invalid values throw - * Signature.getNormalizedV(5) - * //_error: - */ - static getNormalizedV(v) { - const bv = getBigInt(v); - if (bv === BN_0$7 || bv === BN_27$1) { - return 27; - } - if (bv === BN_1$3 || bv === BN_28$1) { - return 28; - } - assertArgument(bv >= BN_35$1, "invalid v", "v", v); - // Otherwise, EIP-155 v means odd is 27 and even is 28 - return (bv & BN_1$3) ? 27 : 28; - } - /** - * Creates a new [[Signature]]. - * - * If no %%sig%% is provided, a new [[Signature]] is created - * with default values. - * - * If %%sig%% is a string, it is parsed. - */ - static from(sig) { - function assertError(check, message) { - assertArgument(check, message, "signature", sig); - } - if (sig == null) { - return new Signature(_guard$3, ZeroHash, ZeroHash, 27); - } - if (typeof (sig) === "string") { - const bytes = getBytes(sig, "signature"); - if (bytes.length === 64) { - const r = hexlify(bytes.slice(0, 32)); - const s = bytes.slice(32, 64); - const v = (s[0] & 0x80) ? 28 : 27; - s[0] &= 0x7f; - return new Signature(_guard$3, r, hexlify(s), v); - } - if (bytes.length === 65) { - const r = hexlify(bytes.slice(0, 32)); - const s = hexlify(bytes.slice(32, 64)); - const v = Signature.getNormalizedV(bytes[64]); - return new Signature(_guard$3, r, s, v); - } - assertError(false, "invalid raw signature length"); - } - if (sig instanceof Signature) { - return sig.clone(); - } - // Get r - const _r = sig.r; - assertError(_r != null, "missing r"); - const r = toUint256(_r); - // Get s; by any means necessary (we check consistency below) - const s = (function (s, yParityAndS) { - if (s != null) { - return toUint256(s); - } - if (yParityAndS != null) { - assertError(isHexString(yParityAndS, 32), "invalid yParityAndS"); - const bytes = getBytes(yParityAndS); - bytes[0] &= 0x7f; - return hexlify(bytes); - } - assertError(false, "missing s"); - })(sig.s, sig.yParityAndS); - // Get v; by any means necessary (we check consistency below) - const { networkV, v } = (function (_v, yParityAndS, yParity) { - if (_v != null) { - const v = getBigInt(_v); - return { - networkV: ((v >= BN_35$1) ? v : undefined), - v: Signature.getNormalizedV(v) - }; - } - if (yParityAndS != null) { - assertError(isHexString(yParityAndS, 32), "invalid yParityAndS"); - return { v: ((getBytes(yParityAndS)[0] & 0x80) ? 28 : 27) }; - } - if (yParity != null) { - switch (getNumber(yParity, "sig.yParity")) { - case 0: return { v: 27 }; - case 1: return { v: 28 }; - } - assertError(false, "invalid yParity"); - } - assertError(false, "missing v"); - })(sig.v, sig.yParityAndS, sig.yParity); - const result = new Signature(_guard$3, r, s, v); - if (networkV) { - result.#networkV = networkV; - } - // If multiple of v, yParity, yParityAndS we given, check they match - assertError(sig.yParity == null || getNumber(sig.yParity, "sig.yParity") === result.yParity, "yParity mismatch"); - assertError(sig.yParityAndS == null || sig.yParityAndS === result.yParityAndS, "yParityAndS mismatch"); - return result; - } -} - -/** - * Add details about signing here. - * - * @_subsection: api/crypto:Signing [about-signing] - */ -/** - * A **SigningKey** provides high-level access to the elliptic curve - * cryptography (ECC) operations and key management. - */ -class SigningKey { - #privateKey; - /** - * Creates a new **SigningKey** for %%privateKey%%. - */ - constructor(privateKey) { - assertArgument(dataLength(privateKey) === 32, "invalid private key", "privateKey", "[REDACTED]"); - this.#privateKey = hexlify(privateKey); - } - /** - * The private key. - */ - get privateKey() { return this.#privateKey; } - /** - * The uncompressed public key. - * - * This will always begin with the prefix ``0x04`` and be 132 - * characters long (the ``0x`` prefix and 130 hexadecimal nibbles). - */ - get publicKey() { return SigningKey.computePublicKey(this.#privateKey); } - /** - * The compressed public key. - * - * This will always begin with either the prefix ``0x02`` or ``0x03`` - * and be 68 characters long (the ``0x`` prefix and 33 hexadecimal - * nibbles) - */ - get compressedPublicKey() { return SigningKey.computePublicKey(this.#privateKey, true); } - /** - * Return the signature of the signed %%digest%%. - */ - sign(digest) { - assertArgument(dataLength(digest) === 32, "invalid digest length", "digest", digest); - const sig = secp256k1.sign(getBytesCopy(digest), getBytesCopy(this.#privateKey), { - lowS: true - }); - return Signature.from({ - r: toBeHex(sig.r, 32), - s: toBeHex(sig.s, 32), - v: (sig.recovery ? 0x1c : 0x1b) - }); - } - /** - * Returns the [[link-wiki-ecdh]] shared secret between this - * private key and the %%other%% key. - * - * The %%other%% key may be any type of key, a raw public key, - * a compressed/uncompressed pubic key or aprivate key. - * - * Best practice is usually to use a cryptographic hash on the - * returned value before using it as a symetric secret. - * - * @example: - * sign1 = new SigningKey(id("some-secret-1")) - * sign2 = new SigningKey(id("some-secret-2")) - * - * // Notice that privA.computeSharedSecret(pubB)... - * sign1.computeSharedSecret(sign2.publicKey) - * //_result: - * - * // ...is equal to privB.computeSharedSecret(pubA). - * sign2.computeSharedSecret(sign1.publicKey) - * //_result: - */ - computeSharedSecret(other) { - const pubKey = SigningKey.computePublicKey(other); - return hexlify(secp256k1.getSharedSecret(getBytesCopy(this.#privateKey), getBytes(pubKey), false)); - } - /** - * Compute the public key for %%key%%, optionally %%compressed%%. - * - * The %%key%% may be any type of key, a raw public key, a - * compressed/uncompressed public key or private key. - * - * @example: - * sign = new SigningKey(id("some-secret")); - * - * // Compute the uncompressed public key for a private key - * SigningKey.computePublicKey(sign.privateKey) - * //_result: - * - * // Compute the compressed public key for a private key - * SigningKey.computePublicKey(sign.privateKey, true) - * //_result: - * - * // Compute the uncompressed public key - * SigningKey.computePublicKey(sign.publicKey, false); - * //_result: - * - * // Compute the Compressed a public key - * SigningKey.computePublicKey(sign.publicKey, true); - * //_result: - */ - static computePublicKey(key, compressed) { - let bytes = getBytes(key, "key"); - // private key - if (bytes.length === 32) { - const pubKey = secp256k1.getPublicKey(bytes, !!compressed); - return hexlify(pubKey); - } - // raw public key; use uncompressed key with 0x04 prefix - if (bytes.length === 64) { - const pub = new Uint8Array(65); - pub[0] = 0x04; - pub.set(bytes, 1); - bytes = pub; - } - const point = secp256k1.ProjectivePoint.fromHex(bytes); - return hexlify(point.toRawBytes(compressed)); - } - /** - * Returns the public key for the private key which produced the - * %%signature%% for the given %%digest%%. - * - * @example: - * key = new SigningKey(id("some-secret")) - * digest = id("hello world") - * sig = key.sign(digest) - * - * // Notice the signer public key... - * key.publicKey - * //_result: - * - * // ...is equal to the recovered public key - * SigningKey.recoverPublicKey(digest, sig) - * //_result: - * - */ - static recoverPublicKey(digest, signature) { - assertArgument(dataLength(digest) === 32, "invalid digest length", "digest", digest); - const sig = Signature.from(signature); - let secpSig = secp256k1.Signature.fromCompact(getBytesCopy(concat([sig.r, sig.s]))); - secpSig = secpSig.addRecoveryBit(sig.yParity); - const pubKey = secpSig.recoverPublicKey(getBytesCopy(digest)); - assertArgument(pubKey != null, "invalid signature for digest", "signature", signature); - return "0x" + pubKey.toHex(false); - } - /** - * Returns the point resulting from adding the ellipic curve points - * %%p0%% and %%p1%%. - * - * This is not a common function most developers should require, but - * can be useful for certain privacy-specific techniques. - * - * For example, it is used by [[HDNodeWallet]] to compute child - * addresses from parent public keys and chain codes. - */ - static addPoints(p0, p1, compressed) { - const pub0 = secp256k1.ProjectivePoint.fromHex(SigningKey.computePublicKey(p0).substring(2)); - const pub1 = secp256k1.ProjectivePoint.fromHex(SigningKey.computePublicKey(p1).substring(2)); - return "0x" + pub0.add(pub1).toHex(!!compressed); - } -} - -/** - * A fundamental building block of Ethereum is the underlying - * cryptographic primitives. - * - * @_section: api/crypto:Cryptographic Functions [about-crypto] - */ -/** - * Once called, prevents any future change to the underlying cryptographic - * primitives using the ``.register`` feature for hooks. - */ -function lock() { - computeHmac.lock(); - keccak256.lock(); - pbkdf2.lock(); - randomBytes.lock(); - ripemd160.lock(); - scrypt.lock(); - scryptSync.lock(); - sha256.lock(); - sha512.lock(); - randomBytes.lock(); -} - -const BN_0$6 = BigInt(0); -const BN_36 = BigInt(36); -function getChecksumAddress(address) { - // if (!isHexString(address, 20)) { - // logger.throwArgumentError("invalid address", "address", address); - // } - address = address.toLowerCase(); - const chars = address.substring(2).split(""); - const expanded = new Uint8Array(40); - for (let i = 0; i < 40; i++) { - expanded[i] = chars[i].charCodeAt(0); - } - const hashed = getBytes(keccak256(expanded)); - for (let i = 0; i < 40; i += 2) { - if ((hashed[i >> 1] >> 4) >= 8) { - chars[i] = chars[i].toUpperCase(); - } - if ((hashed[i >> 1] & 0x0f) >= 8) { - chars[i + 1] = chars[i + 1].toUpperCase(); - } - } - return "0x" + chars.join(""); -} -// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number -// Create lookup table -const ibanLookup = {}; -for (let i = 0; i < 10; i++) { - ibanLookup[String(i)] = String(i); -} -for (let i = 0; i < 26; i++) { - ibanLookup[String.fromCharCode(65 + i)] = String(10 + i); -} -// How many decimal digits can we process? (for 64-bit float, this is 15) -// i.e. Math.floor(Math.log10(Number.MAX_SAFE_INTEGER)); -const safeDigits = 15; -function ibanChecksum(address) { - address = address.toUpperCase(); - address = address.substring(4) + address.substring(0, 2) + "00"; - let expanded = address.split("").map((c) => { return ibanLookup[c]; }).join(""); - // Javascript can handle integers safely up to 15 (decimal) digits - while (expanded.length >= safeDigits) { - let block = expanded.substring(0, safeDigits); - expanded = parseInt(block, 10) % 97 + expanded.substring(block.length); - } - let checksum = String(98 - (parseInt(expanded, 10) % 97)); - while (checksum.length < 2) { - checksum = "0" + checksum; - } - return checksum; -} -const Base36 = (function () { - const result = {}; - for (let i = 0; i < 36; i++) { - const key = "0123456789abcdefghijklmnopqrstuvwxyz"[i]; - result[key] = BigInt(i); - } - return result; -})(); -function fromBase36(value) { - value = value.toLowerCase(); - let result = BN_0$6; - for (let i = 0; i < value.length; i++) { - result = result * BN_36 + Base36[value[i]]; - } - return result; -} -/** - * Returns a normalized and checksumed address for %%address%%. - * This accepts non-checksum addresses, checksum addresses and - * [[getIcapAddress]] formats. - * - * The checksum in Ethereum uses the capitalization (upper-case - * vs lower-case) of the characters within an address to encode - * its checksum, which offers, on average, a checksum of 15-bits. - * - * If %%address%% contains both upper-case and lower-case, it is - * assumed to already be a checksum address and its checksum is - * validated, and if the address fails its expected checksum an - * error is thrown. - * - * If you wish the checksum of %%address%% to be ignore, it should - * be converted to lower-case (i.e. ``.toLowercase()``) before - * being passed in. This should be a very rare situation though, - * that you wish to bypass the safegaurds in place to protect - * against an address that has been incorrectly copied from another - * source. - * - * @example: - * // Adds the checksum (via upper-casing specific letters) - * getAddress("0x8ba1f109551bd432803012645ac136ddd64dba72") - * //_result: - * - * // Converts ICAP address and adds checksum - * getAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36"); - * //_result: - * - * // Throws an error if an address contains mixed case, - * // but the checksum fails - * getAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72") - * //_error: - */ -function getAddress(address) { - assertArgument(typeof (address) === "string", "invalid address", "address", address); - if (address.match(/^(0x)?[0-9a-fA-F]{40}$/)) { - // Missing the 0x prefix - if (!address.startsWith("0x")) { - address = "0x" + address; - } - const result = getChecksumAddress(address); - // It is a checksummed address with a bad checksum - assertArgument(!address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) || result === address, "bad address checksum", "address", address); - return result; - } - // Maybe ICAP? (we only support direct mode) - if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) { - // It is an ICAP address with a bad checksum - assertArgument(address.substring(2, 4) === ibanChecksum(address), "bad icap checksum", "address", address); - let result = fromBase36(address.substring(4)).toString(16); - while (result.length < 40) { - result = "0" + result; - } - return getChecksumAddress("0x" + result); - } - assertArgument(false, "invalid address", "address", address); -} -/** - * The [ICAP Address format](link-icap) format is an early checksum - * format which attempts to be compatible with the banking - * industry [IBAN format](link-wiki-iban) for bank accounts. - * - * It is no longer common or a recommended format. - * - * @example: - * getIcapAddress("0x8ba1f109551bd432803012645ac136ddd64dba72"); - * //_result: - * - * getIcapAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36"); - * //_result: - * - * // Throws an error if the ICAP checksum is wrong - * getIcapAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK37"); - * //_error: - */ -function getIcapAddress(address) { - //let base36 = _base16To36(getAddress(address).substring(2)).toUpperCase(); - let base36 = BigInt(getAddress(address)).toString(36).toUpperCase(); - while (base36.length < 30) { - base36 = "0" + base36; - } - return "XE" + ibanChecksum("XE00" + base36) + base36; -} - -// http://ethereum.stackexchange.com/questions/760/how-is-the-address-of-an-ethereum-contract-computed -/** - * Returns the address that would result from a ``CREATE`` for %%tx%%. - * - * This can be used to compute the address a contract will be - * deployed to by an EOA when sending a deployment transaction (i.e. - * when the ``to`` address is ``null``). - * - * This can also be used to compute the address a contract will be - * deployed to by a contract, by using the contract's address as the - * ``to`` and the contract's nonce. - * - * @example - * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72"; - * nonce = 5; - * - * getCreateAddress({ from, nonce }); - * //_result: - */ -function getCreateAddress(tx) { - const from = getAddress(tx.from); - const nonce = getBigInt(tx.nonce, "tx.nonce"); - let nonceHex = nonce.toString(16); - if (nonceHex === "0") { - nonceHex = "0x"; - } - else if (nonceHex.length % 2) { - nonceHex = "0x0" + nonceHex; - } - else { - nonceHex = "0x" + nonceHex; - } - return getAddress(dataSlice(keccak256(encodeRlp([from, nonceHex])), 12)); -} -/** - * Returns the address that would result from a ``CREATE2`` operation - * with the given %%from%%, %%salt%% and %%initCodeHash%%. - * - * To compute the %%initCodeHash%% from a contract's init code, use - * the [[keccak256]] function. - * - * For a quick overview and example of ``CREATE2``, see [[link-ricmoo-wisps]]. - * - * @example - * // The address of the contract - * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72" - * - * // The salt - * salt = id("HelloWorld") - * - * // The hash of the initCode - * initCode = "0x6394198df16000526103ff60206004601c335afa6040516060f3"; - * initCodeHash = keccak256(initCode) - * - * getCreate2Address(from, salt, initCodeHash) - * //_result: - */ -function getCreate2Address(_from, _salt, _initCodeHash) { - const from = getAddress(_from); - const salt = getBytes(_salt, "salt"); - const initCodeHash = getBytes(_initCodeHash, "initCodeHash"); - assertArgument(salt.length === 32, "salt must be 32 bytes", "salt", _salt); - assertArgument(initCodeHash.length === 32, "initCodeHash must be 32 bytes", "initCodeHash", _initCodeHash); - return getAddress(dataSlice(keccak256(concat(["0xff", from, salt, initCodeHash])), 12)); -} - -/** - * Returns true if %%value%% is an object which implements the - * [[Addressable]] interface. - * - * @example: - * // Wallets and AbstractSigner sub-classes - * isAddressable(Wallet.createRandom()) - * //_result: - * - * // Contracts - * contract = new Contract("dai.tokens.ethers.eth", [ ], provider) - * isAddressable(contract) - * //_result: - */ -function isAddressable(value) { - return (value && typeof (value.getAddress) === "function"); -} -/** - * Returns true if %%value%% is a valid address. - * - * @example: - * // Valid address - * isAddress("0x8ba1f109551bD432803012645Ac136ddd64DBA72") - * //_result: - * - * // Valid ICAP address - * isAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36") - * //_result: - * - * // Invalid checksum - * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBa72") - * //_result: - * - * // Invalid ICAP checksum - * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72") - * //_result: - * - * // Not an address (an ENS name requires a provided and an - * // asynchronous API to access) - * isAddress("ricmoo.eth") - * //_result: - */ -function isAddress(value) { - try { - getAddress(value); - return true; - } - catch (error) { } - return false; -} -async function checkAddress(target, promise) { - const result = await promise; - if (result == null || result === "0x0000000000000000000000000000000000000000") { - assert(typeof (target) !== "string", "unconfigured name", "UNCONFIGURED_NAME", { value: target }); - assertArgument(false, "invalid AddressLike value; did not resolve to a value address", "target", target); - } - return getAddress(result); -} -/** - * Resolves to an address for the %%target%%, which may be any - * supported address type, an [[Addressable]] or a Promise which - * resolves to an address. - * - * If an ENS name is provided, but that name has not been correctly - * configured a [[UnconfiguredNameError]] is thrown. - * - * @example: - * addr = "0x6B175474E89094C44Da98b954EedeAC495271d0F" - * - * // Addresses are return synchronously - * resolveAddress(addr, provider) - * //_result: - * - * // Address promises are resolved asynchronously - * resolveAddress(Promise.resolve(addr)) - * //_result: - * - * // ENS names are resolved asynchronously - * resolveAddress("dai.tokens.ethers.eth", provider) - * //_result: - * - * // Addressable objects are resolved asynchronously - * contract = new Contract(addr, [ ]) - * resolveAddress(contract, provider) - * //_result: - * - * // Unconfigured ENS names reject - * resolveAddress("nothing-here.ricmoo.eth", provider) - * //_error: - * - * // ENS names require a NameResolver object passed in - * // (notice the provider was omitted) - * resolveAddress("nothing-here.ricmoo.eth") - * //_error: - */ -function resolveAddress(target, resolver) { - if (typeof (target) === "string") { - if (target.match(/^0x[0-9a-f]{40}$/i)) { - return getAddress(target); - } - assert(resolver != null, "ENS resolution requires a provider", "UNSUPPORTED_OPERATION", { operation: "resolveName" }); - return checkAddress(target, resolver.resolveName(target)); - } - else if (isAddressable(target)) { - return checkAddress(target, target.getAddress()); - } - else if (target && typeof (target.then) === "function") { - return checkAddress(target, target); - } - assertArgument(false, "unsupported addressable value", "target", target); -} - -/** - * A Typed object allows a value to have its type explicitly - * specified. - * - * For example, in Solidity, the value ``45`` could represent a - * ``uint8`` or a ``uint256``. The value ``0x1234`` could represent - * a ``bytes2`` or ``bytes``. - * - * Since JavaScript has no meaningful way to explicitly inform any - * APIs which what the type is, this allows transparent interoperation - * with Soldity. - * - * @_subsection: api/abi:Typed Values - */ -const _gaurd = {}; -function n(value, width) { - let signed = false; - if (width < 0) { - signed = true; - width *= -1; - } - // @TODO: Check range is valid for value - return new Typed(_gaurd, `${signed ? "" : "u"}int${width}`, value, { signed, width }); -} -function b(value, size) { - // @TODO: Check range is valid for value - return new Typed(_gaurd, `bytes${(size) ? size : ""}`, value, { size }); -} -const _typedSymbol = Symbol.for("_ethers_typed"); -/** - * The **Typed** class to wrap values providing explicit type information. - */ -class Typed { - /** - * The type, as a Solidity-compatible type. - */ - type; - /** - * The actual value. - */ - value; - #options; - /** - * @_ignore: - */ - _typedSymbol; - /** - * @_ignore: - */ - constructor(gaurd, type, value, options) { - if (options == null) { - options = null; - } - assertPrivate(_gaurd, gaurd, "Typed"); - defineProperties(this, { _typedSymbol, type, value }); - this.#options = options; - // Check the value is valid - this.format(); - } - /** - * Format the type as a Human-Readable type. - */ - format() { - if (this.type === "array") { - throw new Error(""); - } - else if (this.type === "dynamicArray") { - throw new Error(""); - } - else if (this.type === "tuple") { - return `tuple(${this.value.map((v) => v.format()).join(",")})`; - } - return this.type; - } - /** - * The default value returned by this type. - */ - defaultValue() { - return 0; - } - /** - * The minimum value for numeric types. - */ - minValue() { - return 0; - } - /** - * The maximum value for numeric types. - */ - maxValue() { - return 0; - } - /** - * Returns ``true`` and provides a type guard is this is a [[TypedBigInt]]. - */ - isBigInt() { - return !!(this.type.match(/^u?int[0-9]+$/)); - } - /** - * Returns ``true`` and provides a type guard is this is a [[TypedData]]. - */ - isData() { - return this.type.startsWith("bytes"); - } - /** - * Returns ``true`` and provides a type guard is this is a [[TypedString]]. - */ - isString() { - return (this.type === "string"); - } - /** - * Returns the tuple name, if this is a tuple. Throws otherwise. - */ - get tupleName() { - if (this.type !== "tuple") { - throw TypeError("not a tuple"); - } - return this.#options; - } - // Returns the length of this type as an array - // - `null` indicates the length is unforced, it could be dynamic - // - `-1` indicates the length is dynamic - // - any other value indicates it is a static array and is its length - /** - * Returns the length of the array type or ``-1`` if it is dynamic. - * - * Throws if the type is not an array. - */ - get arrayLength() { - if (this.type !== "array") { - throw TypeError("not an array"); - } - if (this.#options === true) { - return -1; - } - if (this.#options === false) { - return (this.value).length; - } - return null; - } - /** - * Returns a new **Typed** of %%type%% with the %%value%%. - */ - static from(type, value) { - return new Typed(_gaurd, type, value); - } - /** - * Return a new ``uint8`` type for %%v%%. - */ - static uint8(v) { return n(v, 8); } - /** - * Return a new ``uint16`` type for %%v%%. - */ - static uint16(v) { return n(v, 16); } - /** - * Return a new ``uint24`` type for %%v%%. - */ - static uint24(v) { return n(v, 24); } - /** - * Return a new ``uint32`` type for %%v%%. - */ - static uint32(v) { return n(v, 32); } - /** - * Return a new ``uint40`` type for %%v%%. - */ - static uint40(v) { return n(v, 40); } - /** - * Return a new ``uint48`` type for %%v%%. - */ - static uint48(v) { return n(v, 48); } - /** - * Return a new ``uint56`` type for %%v%%. - */ - static uint56(v) { return n(v, 56); } - /** - * Return a new ``uint64`` type for %%v%%. - */ - static uint64(v) { return n(v, 64); } - /** - * Return a new ``uint72`` type for %%v%%. - */ - static uint72(v) { return n(v, 72); } - /** - * Return a new ``uint80`` type for %%v%%. - */ - static uint80(v) { return n(v, 80); } - /** - * Return a new ``uint88`` type for %%v%%. - */ - static uint88(v) { return n(v, 88); } - /** - * Return a new ``uint96`` type for %%v%%. - */ - static uint96(v) { return n(v, 96); } - /** - * Return a new ``uint104`` type for %%v%%. - */ - static uint104(v) { return n(v, 104); } - /** - * Return a new ``uint112`` type for %%v%%. - */ - static uint112(v) { return n(v, 112); } - /** - * Return a new ``uint120`` type for %%v%%. - */ - static uint120(v) { return n(v, 120); } - /** - * Return a new ``uint128`` type for %%v%%. - */ - static uint128(v) { return n(v, 128); } - /** - * Return a new ``uint136`` type for %%v%%. - */ - static uint136(v) { return n(v, 136); } - /** - * Return a new ``uint144`` type for %%v%%. - */ - static uint144(v) { return n(v, 144); } - /** - * Return a new ``uint152`` type for %%v%%. - */ - static uint152(v) { return n(v, 152); } - /** - * Return a new ``uint160`` type for %%v%%. - */ - static uint160(v) { return n(v, 160); } - /** - * Return a new ``uint168`` type for %%v%%. - */ - static uint168(v) { return n(v, 168); } - /** - * Return a new ``uint176`` type for %%v%%. - */ - static uint176(v) { return n(v, 176); } - /** - * Return a new ``uint184`` type for %%v%%. - */ - static uint184(v) { return n(v, 184); } - /** - * Return a new ``uint192`` type for %%v%%. - */ - static uint192(v) { return n(v, 192); } - /** - * Return a new ``uint200`` type for %%v%%. - */ - static uint200(v) { return n(v, 200); } - /** - * Return a new ``uint208`` type for %%v%%. - */ - static uint208(v) { return n(v, 208); } - /** - * Return a new ``uint216`` type for %%v%%. - */ - static uint216(v) { return n(v, 216); } - /** - * Return a new ``uint224`` type for %%v%%. - */ - static uint224(v) { return n(v, 224); } - /** - * Return a new ``uint232`` type for %%v%%. - */ - static uint232(v) { return n(v, 232); } - /** - * Return a new ``uint240`` type for %%v%%. - */ - static uint240(v) { return n(v, 240); } - /** - * Return a new ``uint248`` type for %%v%%. - */ - static uint248(v) { return n(v, 248); } - /** - * Return a new ``uint256`` type for %%v%%. - */ - static uint256(v) { return n(v, 256); } - /** - * Return a new ``uint256`` type for %%v%%. - */ - static uint(v) { return n(v, 256); } - /** - * Return a new ``int8`` type for %%v%%. - */ - static int8(v) { return n(v, -8); } - /** - * Return a new ``int16`` type for %%v%%. - */ - static int16(v) { return n(v, -16); } - /** - * Return a new ``int24`` type for %%v%%. - */ - static int24(v) { return n(v, -24); } - /** - * Return a new ``int32`` type for %%v%%. - */ - static int32(v) { return n(v, -32); } - /** - * Return a new ``int40`` type for %%v%%. - */ - static int40(v) { return n(v, -40); } - /** - * Return a new ``int48`` type for %%v%%. - */ - static int48(v) { return n(v, -48); } - /** - * Return a new ``int56`` type for %%v%%. - */ - static int56(v) { return n(v, -56); } - /** - * Return a new ``int64`` type for %%v%%. - */ - static int64(v) { return n(v, -64); } - /** - * Return a new ``int72`` type for %%v%%. - */ - static int72(v) { return n(v, -72); } - /** - * Return a new ``int80`` type for %%v%%. - */ - static int80(v) { return n(v, -80); } - /** - * Return a new ``int88`` type for %%v%%. - */ - static int88(v) { return n(v, -88); } - /** - * Return a new ``int96`` type for %%v%%. - */ - static int96(v) { return n(v, -96); } - /** - * Return a new ``int104`` type for %%v%%. - */ - static int104(v) { return n(v, -104); } - /** - * Return a new ``int112`` type for %%v%%. - */ - static int112(v) { return n(v, -112); } - /** - * Return a new ``int120`` type for %%v%%. - */ - static int120(v) { return n(v, -120); } - /** - * Return a new ``int128`` type for %%v%%. - */ - static int128(v) { return n(v, -128); } - /** - * Return a new ``int136`` type for %%v%%. - */ - static int136(v) { return n(v, -136); } - /** - * Return a new ``int144`` type for %%v%%. - */ - static int144(v) { return n(v, -144); } - /** - * Return a new ``int52`` type for %%v%%. - */ - static int152(v) { return n(v, -152); } - /** - * Return a new ``int160`` type for %%v%%. - */ - static int160(v) { return n(v, -160); } - /** - * Return a new ``int168`` type for %%v%%. - */ - static int168(v) { return n(v, -168); } - /** - * Return a new ``int176`` type for %%v%%. - */ - static int176(v) { return n(v, -176); } - /** - * Return a new ``int184`` type for %%v%%. - */ - static int184(v) { return n(v, -184); } - /** - * Return a new ``int92`` type for %%v%%. - */ - static int192(v) { return n(v, -192); } - /** - * Return a new ``int200`` type for %%v%%. - */ - static int200(v) { return n(v, -200); } - /** - * Return a new ``int208`` type for %%v%%. - */ - static int208(v) { return n(v, -208); } - /** - * Return a new ``int216`` type for %%v%%. - */ - static int216(v) { return n(v, -216); } - /** - * Return a new ``int224`` type for %%v%%. - */ - static int224(v) { return n(v, -224); } - /** - * Return a new ``int232`` type for %%v%%. - */ - static int232(v) { return n(v, -232); } - /** - * Return a new ``int240`` type for %%v%%. - */ - static int240(v) { return n(v, -240); } - /** - * Return a new ``int248`` type for %%v%%. - */ - static int248(v) { return n(v, -248); } - /** - * Return a new ``int256`` type for %%v%%. - */ - static int256(v) { return n(v, -256); } - /** - * Return a new ``int256`` type for %%v%%. - */ - static int(v) { return n(v, -256); } - /** - * Return a new ``bytes1`` type for %%v%%. - */ - static bytes1(v) { return b(v, 1); } - /** - * Return a new ``bytes2`` type for %%v%%. - */ - static bytes2(v) { return b(v, 2); } - /** - * Return a new ``bytes3`` type for %%v%%. - */ - static bytes3(v) { return b(v, 3); } - /** - * Return a new ``bytes4`` type for %%v%%. - */ - static bytes4(v) { return b(v, 4); } - /** - * Return a new ``bytes5`` type for %%v%%. - */ - static bytes5(v) { return b(v, 5); } - /** - * Return a new ``bytes6`` type for %%v%%. - */ - static bytes6(v) { return b(v, 6); } - /** - * Return a new ``bytes7`` type for %%v%%. - */ - static bytes7(v) { return b(v, 7); } - /** - * Return a new ``bytes8`` type for %%v%%. - */ - static bytes8(v) { return b(v, 8); } - /** - * Return a new ``bytes9`` type for %%v%%. - */ - static bytes9(v) { return b(v, 9); } - /** - * Return a new ``bytes10`` type for %%v%%. - */ - static bytes10(v) { return b(v, 10); } - /** - * Return a new ``bytes11`` type for %%v%%. - */ - static bytes11(v) { return b(v, 11); } - /** - * Return a new ``bytes12`` type for %%v%%. - */ - static bytes12(v) { return b(v, 12); } - /** - * Return a new ``bytes13`` type for %%v%%. - */ - static bytes13(v) { return b(v, 13); } - /** - * Return a new ``bytes14`` type for %%v%%. - */ - static bytes14(v) { return b(v, 14); } - /** - * Return a new ``bytes15`` type for %%v%%. - */ - static bytes15(v) { return b(v, 15); } - /** - * Return a new ``bytes16`` type for %%v%%. - */ - static bytes16(v) { return b(v, 16); } - /** - * Return a new ``bytes17`` type for %%v%%. - */ - static bytes17(v) { return b(v, 17); } - /** - * Return a new ``bytes18`` type for %%v%%. - */ - static bytes18(v) { return b(v, 18); } - /** - * Return a new ``bytes19`` type for %%v%%. - */ - static bytes19(v) { return b(v, 19); } - /** - * Return a new ``bytes20`` type for %%v%%. - */ - static bytes20(v) { return b(v, 20); } - /** - * Return a new ``bytes21`` type for %%v%%. - */ - static bytes21(v) { return b(v, 21); } - /** - * Return a new ``bytes22`` type for %%v%%. - */ - static bytes22(v) { return b(v, 22); } - /** - * Return a new ``bytes23`` type for %%v%%. - */ - static bytes23(v) { return b(v, 23); } - /** - * Return a new ``bytes24`` type for %%v%%. - */ - static bytes24(v) { return b(v, 24); } - /** - * Return a new ``bytes25`` type for %%v%%. - */ - static bytes25(v) { return b(v, 25); } - /** - * Return a new ``bytes26`` type for %%v%%. - */ - static bytes26(v) { return b(v, 26); } - /** - * Return a new ``bytes27`` type for %%v%%. - */ - static bytes27(v) { return b(v, 27); } - /** - * Return a new ``bytes28`` type for %%v%%. - */ - static bytes28(v) { return b(v, 28); } - /** - * Return a new ``bytes29`` type for %%v%%. - */ - static bytes29(v) { return b(v, 29); } - /** - * Return a new ``bytes30`` type for %%v%%. - */ - static bytes30(v) { return b(v, 30); } - /** - * Return a new ``bytes31`` type for %%v%%. - */ - static bytes31(v) { return b(v, 31); } - /** - * Return a new ``bytes32`` type for %%v%%. - */ - static bytes32(v) { return b(v, 32); } - /** - * Return a new ``address`` type for %%v%%. - */ - static address(v) { return new Typed(_gaurd, "address", v); } - /** - * Return a new ``bool`` type for %%v%%. - */ - static bool(v) { return new Typed(_gaurd, "bool", !!v); } - /** - * Return a new ``bytes`` type for %%v%%. - */ - static bytes(v) { return new Typed(_gaurd, "bytes", v); } - /** - * Return a new ``string`` type for %%v%%. - */ - static string(v) { return new Typed(_gaurd, "string", v); } - /** - * Return a new ``array`` type for %%v%%, allowing %%dynamic%% length. - */ - static array(v, dynamic) { - throw new Error("not implemented yet"); - } - /** - * Return a new ``tuple`` type for %%v%%, with the optional %%name%%. - */ - static tuple(v, name) { - throw new Error("not implemented yet"); - } - /** - * Return a new ``uint8`` type for %%v%%. - */ - static overrides(v) { - return new Typed(_gaurd, "overrides", Object.assign({}, v)); - } - /** - * Returns true only if %%value%% is a [[Typed]] instance. - */ - static isTyped(value) { - return (value - && typeof (value) === "object" - && "_typedSymbol" in value - && value._typedSymbol === _typedSymbol); - } - /** - * If the value is a [[Typed]] instance, validates the underlying value - * and returns it, otherwise returns value directly. - * - * This is useful for functions that with to accept either a [[Typed]] - * object or values. - */ - static dereference(value, type) { - if (Typed.isTyped(value)) { - if (value.type !== type) { - throw new Error(`invalid type: expecetd ${type}, got ${value.type}`); - } - return value.value; - } - return value; - } -} - -/** - * @_ignore - */ -class AddressCoder extends Coder { - constructor(localName) { - super("address", "address", localName, false); - } - defaultValue() { - return "0x0000000000000000000000000000000000000000"; - } - encode(writer, _value) { - let value = Typed.dereference(_value, "string"); - try { - value = getAddress(value); - } - catch (error) { - return this._throwError(error.message, _value); - } - return writer.writeValue(value); - } - decode(reader) { - return getAddress(toBeHex(reader.readValue(), 20)); - } -} - -/** - * Clones the functionality of an existing Coder, but without a localName - * - * @_ignore - */ -class AnonymousCoder extends Coder { - coder; - constructor(coder) { - super(coder.name, coder.type, "_", coder.dynamic); - this.coder = coder; - } - defaultValue() { - return this.coder.defaultValue(); - } - encode(writer, value) { - return this.coder.encode(writer, value); - } - decode(reader) { - return this.coder.decode(reader); - } -} - -/** - * @_ignore - */ -function pack(writer, coders, values) { - let arrayValues = []; - if (Array.isArray(values)) { - arrayValues = values; - } - else if (values && typeof (values) === "object") { - let unique = {}; - arrayValues = coders.map((coder) => { - const name = coder.localName; - assert(name, "cannot encode object for signature with missing names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values }); - assert(!unique[name], "cannot encode object for signature with duplicate names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values }); - unique[name] = true; - return values[name]; - }); - } - else { - assertArgument(false, "invalid tuple value", "tuple", values); - } - assertArgument(coders.length === arrayValues.length, "types/value length mismatch", "tuple", values); - let staticWriter = new Writer(); - let dynamicWriter = new Writer(); - let updateFuncs = []; - coders.forEach((coder, index) => { - let value = arrayValues[index]; - if (coder.dynamic) { - // Get current dynamic offset (for the future pointer) - let dynamicOffset = dynamicWriter.length; - // Encode the dynamic value into the dynamicWriter - coder.encode(dynamicWriter, value); - // Prepare to populate the correct offset once we are done - let updateFunc = staticWriter.writeUpdatableValue(); - updateFuncs.push((baseOffset) => { - updateFunc(baseOffset + dynamicOffset); - }); - } - else { - coder.encode(staticWriter, value); - } - }); - // Backfill all the dynamic offsets, now that we know the static length - updateFuncs.forEach((func) => { func(staticWriter.length); }); - let length = writer.appendWriter(staticWriter); - length += writer.appendWriter(dynamicWriter); - return length; -} -/** - * @_ignore - */ -function unpack(reader, coders) { - let values = []; - let keys = []; - // A reader anchored to this base - let baseReader = reader.subReader(0); - coders.forEach((coder) => { - let value = null; - if (coder.dynamic) { - let offset = reader.readIndex(); - let offsetReader = baseReader.subReader(offset); - try { - value = coder.decode(offsetReader); - } - catch (error) { - // Cannot recover from this - if (isError(error, "BUFFER_OVERRUN")) { - throw error; - } - value = error; - value.baseType = coder.name; - value.name = coder.localName; - value.type = coder.type; - } - } - else { - try { - value = coder.decode(reader); - } - catch (error) { - // Cannot recover from this - if (isError(error, "BUFFER_OVERRUN")) { - throw error; - } - value = error; - value.baseType = coder.name; - value.name = coder.localName; - value.type = coder.type; - } - } - if (value == undefined) { - throw new Error("investigate"); - } - values.push(value); - keys.push(coder.localName || null); - }); - return Result.fromItems(values, keys); -} -/** - * @_ignore - */ -class ArrayCoder extends Coder { - coder; - length; - constructor(coder, length, localName) { - const type = (coder.type + "[" + (length >= 0 ? length : "") + "]"); - const dynamic = (length === -1 || coder.dynamic); - super("array", type, localName, dynamic); - defineProperties(this, { coder, length }); - } - defaultValue() { - // Verifies the child coder is valid (even if the array is dynamic or 0-length) - const defaultChild = this.coder.defaultValue(); - const result = []; - for (let i = 0; i < this.length; i++) { - result.push(defaultChild); - } - return result; - } - encode(writer, _value) { - const value = Typed.dereference(_value, "array"); - if (!Array.isArray(value)) { - this._throwError("expected array value", value); - } - let count = this.length; - if (count === -1) { - count = value.length; - writer.writeValue(value.length); - } - assertArgumentCount(value.length, count, "coder array" + (this.localName ? (" " + this.localName) : "")); - let coders = []; - for (let i = 0; i < value.length; i++) { - coders.push(this.coder); - } - return pack(writer, coders, value); - } - decode(reader) { - let count = this.length; - if (count === -1) { - count = reader.readIndex(); - // Check that there is *roughly* enough data to ensure - // stray random data is not being read as a length. Each - // slot requires at least 32 bytes for their value (or 32 - // bytes as a link to the data). This could use a much - // tighter bound, but we are erroring on the side of safety. - assert(count * WordSize <= reader.dataLength, "insufficient data length", "BUFFER_OVERRUN", { buffer: reader.bytes, offset: count * WordSize, length: reader.dataLength }); - } - let coders = []; - for (let i = 0; i < count; i++) { - coders.push(new AnonymousCoder(this.coder)); - } - return unpack(reader, coders); - } -} - -/** - * @_ignore - */ -class BooleanCoder extends Coder { - constructor(localName) { - super("bool", "bool", localName, false); - } - defaultValue() { - return false; - } - encode(writer, _value) { - const value = Typed.dereference(_value, "bool"); - return writer.writeValue(value ? 1 : 0); - } - decode(reader) { - return !!reader.readValue(); - } -} - -/** - * @_ignore - */ -class DynamicBytesCoder extends Coder { - constructor(type, localName) { - super(type, type, localName, true); - } - defaultValue() { - return "0x"; - } - encode(writer, value) { - value = getBytesCopy(value); - let length = writer.writeValue(value.length); - length += writer.writeBytes(value); - return length; - } - decode(reader) { - return reader.readBytes(reader.readIndex(), true); - } -} -/** - * @_ignore - */ -class BytesCoder extends DynamicBytesCoder { - constructor(localName) { - super("bytes", localName); - } - decode(reader) { - return hexlify(super.decode(reader)); - } -} - -/** - * @_ignore - */ -class FixedBytesCoder extends Coder { - size; - constructor(size, localName) { - let name = "bytes" + String(size); - super(name, name, localName, false); - defineProperties(this, { size }, { size: "number" }); - } - defaultValue() { - return ("0x0000000000000000000000000000000000000000000000000000000000000000").substring(0, 2 + this.size * 2); - } - encode(writer, _value) { - let data = getBytesCopy(Typed.dereference(_value, this.type)); - if (data.length !== this.size) { - this._throwError("incorrect data length", _value); - } - return writer.writeBytes(data); - } - decode(reader) { - return hexlify(reader.readBytes(this.size)); - } -} - -const Empty = new Uint8Array([]); -/** - * @_ignore - */ -class NullCoder extends Coder { - constructor(localName) { - super("null", "", localName, false); - } - defaultValue() { - return null; - } - encode(writer, value) { - if (value != null) { - this._throwError("not null", value); - } - return writer.writeBytes(Empty); - } - decode(reader) { - reader.readBytes(0); - return null; - } -} - -const BN_0$5 = BigInt(0); -const BN_1$2 = BigInt(1); -const BN_MAX_UINT256$1 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); -/** - * @_ignore - */ -class NumberCoder extends Coder { - size; - signed; - constructor(size, signed, localName) { - const name = ((signed ? "int" : "uint") + (size * 8)); - super(name, name, localName, false); - defineProperties(this, { size, signed }, { size: "number", signed: "boolean" }); - } - defaultValue() { - return 0; - } - encode(writer, _value) { - let value = getBigInt(Typed.dereference(_value, this.type)); - // Check bounds are safe for encoding - let maxUintValue = mask(BN_MAX_UINT256$1, WordSize * 8); - if (this.signed) { - let bounds = mask(maxUintValue, (this.size * 8) - 1); - if (value > bounds || value < -(bounds + BN_1$2)) { - this._throwError("value out-of-bounds", _value); - } - value = toTwos(value, 8 * WordSize); - } - else if (value < BN_0$5 || value > mask(maxUintValue, this.size * 8)) { - this._throwError("value out-of-bounds", _value); - } - return writer.writeValue(value); - } - decode(reader) { - let value = mask(reader.readValue(), this.size * 8); - if (this.signed) { - value = fromTwos(value, this.size * 8); - } - return value; - } -} - -/** - * @_ignore - */ -class StringCoder extends DynamicBytesCoder { - constructor(localName) { - super("string", localName); - } - defaultValue() { - return ""; - } - encode(writer, _value) { - return super.encode(writer, toUtf8Bytes(Typed.dereference(_value, "string"))); - } - decode(reader) { - return toUtf8String(super.decode(reader)); - } -} - -/** - * @_ignore - */ -class TupleCoder extends Coder { - coders; - constructor(coders, localName) { - let dynamic = false; - const types = []; - coders.forEach((coder) => { - if (coder.dynamic) { - dynamic = true; - } - types.push(coder.type); - }); - const type = ("tuple(" + types.join(",") + ")"); - super("tuple", type, localName, dynamic); - defineProperties(this, { coders: Object.freeze(coders.slice()) }); - } - defaultValue() { - const values = []; - this.coders.forEach((coder) => { - values.push(coder.defaultValue()); - }); - // We only output named properties for uniquely named coders - const uniqueNames = this.coders.reduce((accum, coder) => { - const name = coder.localName; - if (name) { - if (!accum[name]) { - accum[name] = 0; - } - accum[name]++; - } - return accum; - }, {}); - // Add named values - this.coders.forEach((coder, index) => { - let name = coder.localName; - if (!name || uniqueNames[name] !== 1) { - return; - } - if (name === "length") { - name = "_length"; - } - if (values[name] != null) { - return; - } - values[name] = values[index]; - }); - return Object.freeze(values); - } - encode(writer, _value) { - const value = Typed.dereference(_value, "tuple"); - return pack(writer, this.coders, value); - } - decode(reader) { - return unpack(reader, this.coders); - } -} - -function accessSetify(addr, storageKeys) { - return { - address: getAddress(addr), - storageKeys: storageKeys.map((storageKey, index) => { - assertArgument(isHexString(storageKey, 32), "invalid slot", `storageKeys[${index}]`, storageKey); - return storageKey.toLowerCase(); - }) - }; -} -/** - * Returns a [[AccessList]] from any ethers-supported access-list structure. - */ -function accessListify(value) { - if (Array.isArray(value)) { - return value.map((set, index) => { - if (Array.isArray(set)) { - assertArgument(set.length === 2, "invalid slot set", `value[${index}]`, set); - return accessSetify(set[0], set[1]); - } - assertArgument(set != null && typeof (set) === "object", "invalid address-slot set", "value", value); - return accessSetify(set.address, set.storageKeys); - }); - } - assertArgument(value != null && typeof (value) === "object", "invalid access list", "value", value); - const result = Object.keys(value).map((addr) => { - const storageKeys = value[addr].reduce((accum, storageKey) => { - accum[storageKey] = true; - return accum; - }, {}); - return accessSetify(addr, Object.keys(storageKeys).sort()); - }); - result.sort((a, b) => (a.address.localeCompare(b.address))); - return result; -} - -function authorizationify(auth) { - return { - address: getAddress(auth.address), - nonce: getBigInt((auth.nonce != null) ? auth.nonce : 0), - chainId: getBigInt((auth.chainId != null) ? auth.chainId : 0), - signature: Signature.from(auth.signature) - }; -} - -/** - * Returns the address for the %%key%%. - * - * The key may be any standard form of public key or a private key. - */ -function computeAddress(key) { - let pubkey; - if (typeof (key) === "string") { - pubkey = SigningKey.computePublicKey(key, false); - } - else { - pubkey = key.publicKey; - } - return getAddress(keccak256("0x" + pubkey.substring(4)).substring(26)); -} -/** - * Returns the recovered address for the private key that was - * used to sign %%digest%% that resulted in %%signature%%. - */ -function recoverAddress(digest, signature) { - return computeAddress(SigningKey.recoverPublicKey(digest, signature)); -} - -const BN_0$4 = BigInt(0); -const BN_2$2 = BigInt(2); -const BN_27 = BigInt(27); -const BN_28 = BigInt(28); -const BN_35 = BigInt(35); -const BN_MAX_UINT = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); -const inspect = Symbol.for("nodejs.util.inspect.custom"); -const BLOB_SIZE = 4096 * 32; -const CELL_COUNT = 128; -function getKzgLibrary(kzg) { - const blobToKzgCommitment = (blob) => { - if ("computeBlobProof" in kzg) { - // micro-ecc-signer; check for computeBlobProof since this API - // expects a string while the kzg-wasm below expects a Unit8Array - if ("blobToKzgCommitment" in kzg && typeof (kzg.blobToKzgCommitment) === "function") { - return getBytes(kzg.blobToKzgCommitment(hexlify(blob))); - } - } - else if ("blobToKzgCommitment" in kzg && typeof (kzg.blobToKzgCommitment) === "function") { - // kzg-wasm <0.5.0; blobToKzgCommitment(Uint8Array) => Uint8Array - return getBytes(kzg.blobToKzgCommitment(blob)); - } - // kzg-wasm >= 0.5.0; blobToKZGCommitment(string) => string - if ("blobToKZGCommitment" in kzg && typeof (kzg.blobToKZGCommitment) === "function") { - return getBytes(kzg.blobToKZGCommitment(hexlify(blob))); - } - assertArgument(false, "unsupported KZG library", "kzg", kzg); - }; - const computeBlobKzgProof = (blob, commitment) => { - // micro-ecc-signer - if ("computeBlobProof" in kzg && typeof (kzg.computeBlobProof) === "function") { - return getBytes(kzg.computeBlobProof(hexlify(blob), hexlify(commitment))); - } - // kzg-wasm <0.5.0; computeBlobKzgProof(Uint8Array, Uint8Array) => Uint8Array - if ("computeBlobKzgProof" in kzg && typeof (kzg.computeBlobKzgProof) === "function") { - return kzg.computeBlobKzgProof(blob, commitment); - } - // kzg-wasm >= 0.5.0; computeBlobKZGProof(string, string) => string - if ("computeBlobKZGProof" in kzg && typeof (kzg.computeBlobKZGProof) === "function") { - return getBytes(kzg.computeBlobKZGProof(hexlify(blob), hexlify(commitment))); - } - assertArgument(false, "unsupported KZG library", "kzg", kzg); - }; - return { blobToKzgCommitment, computeBlobKzgProof }; -} -function getVersionedHash(version, hash) { - let versioned = version.toString(16); - while (versioned.length < 2) { - versioned = "0" + versioned; - } - versioned += sha256(hash).substring(4); - return "0x" + versioned; -} -function handleAddress(value) { - if (value === "0x") { - return null; - } - return getAddress(value); -} -function handleAccessList(value, param) { - try { - return accessListify(value); - } - catch (error) { - assertArgument(false, error.message, param, value); - } -} -function handleAuthorizationList(value, param) { - try { - if (!Array.isArray(value)) { - throw new Error("authorizationList: invalid array"); - } - const result = []; - for (let i = 0; i < value.length; i++) { - const auth = value[i]; - if (!Array.isArray(auth)) { - throw new Error(`authorization[${i}]: invalid array`); - } - if (auth.length !== 6) { - throw new Error(`authorization[${i}]: wrong length`); - } - if (!auth[1]) { - throw new Error(`authorization[${i}]: null address`); - } - result.push({ - address: handleAddress(auth[1]), - nonce: handleUint(auth[2], "nonce"), - chainId: handleUint(auth[0], "chainId"), - signature: Signature.from({ - yParity: handleNumber(auth[3], "yParity"), - r: zeroPadValue(auth[4], 32), - s: zeroPadValue(auth[5], 32) - }) - }); - } - return result; - } - catch (error) { - assertArgument(false, error.message, param, value); - } -} -function handleNumber(_value, param) { - if (_value === "0x") { - return 0; - } - return getNumber(_value, param); -} -function handleUint(_value, param) { - if (_value === "0x") { - return BN_0$4; - } - const value = getBigInt(_value, param); - assertArgument(value <= BN_MAX_UINT, "value exceeds uint size", param, value); - return value; -} -function formatNumber(_value, name) { - const value = getBigInt(_value, "value"); - const result = toBeArray(value); - assertArgument(result.length <= 32, `value too large`, `tx.${name}`, value); - return result; -} -function formatAccessList(value) { - return accessListify(value).map((set) => [set.address, set.storageKeys]); -} -function formatAuthorizationList(value) { - return value.map((a) => { - return [ - formatNumber(a.chainId, "chainId"), - a.address, - formatNumber(a.nonce, "nonce"), - formatNumber(a.signature.yParity, "yParity"), - toBeArray(a.signature.r), - toBeArray(a.signature._s) - ]; - }); -} -function formatHashes(value, param) { - assertArgument(Array.isArray(value), `invalid ${param}`, "value", value); - for (let i = 0; i < value.length; i++) { - assertArgument(isHexString(value[i], 32), "invalid ${ param } hash", `value[${i}]`, value[i]); - } - return value; -} -function _parseLegacy(data) { - const fields = decodeRlp(data); - assertArgument(Array.isArray(fields) && (fields.length === 9 || fields.length === 6), "invalid field count for legacy transaction", "data", data); - const tx = { - type: 0, - nonce: handleNumber(fields[0], "nonce"), - gasPrice: handleUint(fields[1], "gasPrice"), - gasLimit: handleUint(fields[2], "gasLimit"), - to: handleAddress(fields[3]), - value: handleUint(fields[4], "value"), - data: hexlify(fields[5]), - chainId: BN_0$4 - }; - // Legacy unsigned transaction - if (fields.length === 6) { - return tx; - } - const v = handleUint(fields[6], "v"); - const r = handleUint(fields[7], "r"); - const s = handleUint(fields[8], "s"); - if (r === BN_0$4 && s === BN_0$4) { - // EIP-155 unsigned transaction - tx.chainId = v; - } - else { - // Compute the EIP-155 chain ID (or 0 for legacy) - let chainId = (v - BN_35) / BN_2$2; - if (chainId < BN_0$4) { - chainId = BN_0$4; - } - tx.chainId = chainId; - // Signed Legacy Transaction - assertArgument(chainId !== BN_0$4 || (v === BN_27 || v === BN_28), "non-canonical legacy v", "v", fields[6]); - tx.signature = Signature.from({ - r: zeroPadValue(fields[7], 32), - s: zeroPadValue(fields[8], 32), - v - }); - //tx.hash = keccak256(data); - } - return tx; -} -function _serializeLegacy(tx, sig) { - const fields = [ - formatNumber(tx.nonce, "nonce"), - formatNumber(tx.gasPrice || 0, "gasPrice"), - formatNumber(tx.gasLimit, "gasLimit"), - (tx.to || "0x"), - formatNumber(tx.value, "value"), - tx.data, - ]; - let chainId = BN_0$4; - if (tx.chainId != BN_0$4) { - // A chainId was provided; if non-zero we'll use EIP-155 - chainId = getBigInt(tx.chainId, "tx.chainId"); - // We have a chainId in the tx and an EIP-155 v in the signature, - // make sure they agree with each other - assertArgument(!sig || sig.networkV == null || sig.legacyChainId === chainId, "tx.chainId/sig.v mismatch", "sig", sig); - } - else if (tx.signature) { - // No explicit chainId, but EIP-155 have a derived implicit chainId - const legacy = tx.signature.legacyChainId; - if (legacy != null) { - chainId = legacy; - } - } - // Requesting an unsigned transaction - if (!sig) { - // We have an EIP-155 transaction (chainId was specified and non-zero) - if (chainId !== BN_0$4) { - fields.push(toBeArray(chainId)); - fields.push("0x"); - fields.push("0x"); - } - return encodeRlp(fields); - } - // @TODO: We should probably check that tx.signature, chainId, and sig - // match but that logic could break existing code, so schedule - // this for the next major bump. - // Compute the EIP-155 v - let v = BigInt(27 + sig.yParity); - if (chainId !== BN_0$4) { - v = Signature.getChainIdV(chainId, sig.v); - } - else if (BigInt(sig.v) !== v) { - assertArgument(false, "tx.chainId/sig.v mismatch", "sig", sig); - } - // Add the signature - fields.push(toBeArray(v)); - fields.push(toBeArray(sig.r)); - fields.push(toBeArray(sig._s)); - return encodeRlp(fields); -} -function _parseEipSignature(tx, fields) { - let yParity; - try { - yParity = handleNumber(fields[0], "yParity"); - if (yParity !== 0 && yParity !== 1) { - throw new Error("bad yParity"); - } - } - catch (error) { - assertArgument(false, "invalid yParity", "yParity", fields[0]); - } - const r = zeroPadValue(fields[1], 32); - const s = zeroPadValue(fields[2], 32); - const signature = Signature.from({ r, s, yParity }); - tx.signature = signature; -} -function _parseEip1559(data) { - const fields = decodeRlp(getBytes(data).slice(1)); - assertArgument(Array.isArray(fields) && (fields.length === 9 || fields.length === 12), "invalid field count for transaction type: 2", "data", hexlify(data)); - const tx = { - type: 2, - chainId: handleUint(fields[0], "chainId"), - nonce: handleNumber(fields[1], "nonce"), - maxPriorityFeePerGas: handleUint(fields[2], "maxPriorityFeePerGas"), - maxFeePerGas: handleUint(fields[3], "maxFeePerGas"), - gasPrice: null, - gasLimit: handleUint(fields[4], "gasLimit"), - to: handleAddress(fields[5]), - value: handleUint(fields[6], "value"), - data: hexlify(fields[7]), - accessList: handleAccessList(fields[8], "accessList"), - }; - // Unsigned EIP-1559 Transaction - if (fields.length === 9) { - return tx; - } - //tx.hash = keccak256(data); - _parseEipSignature(tx, fields.slice(9)); - return tx; -} -function _serializeEip1559(tx, sig) { - const fields = [ - formatNumber(tx.chainId, "chainId"), - formatNumber(tx.nonce, "nonce"), - formatNumber(tx.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"), - formatNumber(tx.maxFeePerGas || 0, "maxFeePerGas"), - formatNumber(tx.gasLimit, "gasLimit"), - (tx.to || "0x"), - formatNumber(tx.value, "value"), - tx.data, - formatAccessList(tx.accessList || []) - ]; - if (sig) { - fields.push(formatNumber(sig.yParity, "yParity")); - fields.push(toBeArray(sig.r)); - fields.push(toBeArray(sig.s)); - } - return concat(["0x02", encodeRlp(fields)]); -} -function _parseEip2930(data) { - const fields = decodeRlp(getBytes(data).slice(1)); - assertArgument(Array.isArray(fields) && (fields.length === 8 || fields.length === 11), "invalid field count for transaction type: 1", "data", hexlify(data)); - const tx = { - type: 1, - chainId: handleUint(fields[0], "chainId"), - nonce: handleNumber(fields[1], "nonce"), - gasPrice: handleUint(fields[2], "gasPrice"), - gasLimit: handleUint(fields[3], "gasLimit"), - to: handleAddress(fields[4]), - value: handleUint(fields[5], "value"), - data: hexlify(fields[6]), - accessList: handleAccessList(fields[7], "accessList") - }; - // Unsigned EIP-2930 Transaction - if (fields.length === 8) { - return tx; - } - //tx.hash = keccak256(data); - _parseEipSignature(tx, fields.slice(8)); - return tx; -} -function _serializeEip2930(tx, sig) { - const fields = [ - formatNumber(tx.chainId, "chainId"), - formatNumber(tx.nonce, "nonce"), - formatNumber(tx.gasPrice || 0, "gasPrice"), - formatNumber(tx.gasLimit, "gasLimit"), - (tx.to || "0x"), - formatNumber(tx.value, "value"), - tx.data, - formatAccessList(tx.accessList || []) - ]; - if (sig) { - fields.push(formatNumber(sig.yParity, "recoveryParam")); - fields.push(toBeArray(sig.r)); - fields.push(toBeArray(sig.s)); - } - return concat(["0x01", encodeRlp(fields)]); -} -function _parseEip4844(data) { - let fields = decodeRlp(getBytes(data).slice(1)); - let typeName = "3"; - let blobWrapperVersion = null; - let blobs = null; - // Parse the network format - if (fields.length === 4 && Array.isArray(fields[0])) { - // EIP-4844 format with sidecar - typeName = "3 (network format)"; - const fBlobs = fields[1], fCommits = fields[2], fProofs = fields[3]; - assertArgument(Array.isArray(fBlobs), "invalid network format: blobs not an array", "fields[1]", fBlobs); - assertArgument(Array.isArray(fCommits), "invalid network format: commitments not an array", "fields[2]", fCommits); - assertArgument(Array.isArray(fProofs), "invalid network format: proofs not an array", "fields[3]", fProofs); - assertArgument(fBlobs.length === fCommits.length, "invalid network format: blobs/commitments length mismatch", "fields", fields); - assertArgument(fBlobs.length === fProofs.length, "invalid network format: blobs/proofs length mismatch", "fields", fields); - blobs = []; - for (let i = 0; i < fields[1].length; i++) { - blobs.push({ - data: fBlobs[i], - commitment: fCommits[i], - proof: fProofs[i], - }); - } - fields = fields[0]; - } - else if (fields.length === 5 && Array.isArray(fields[0])) { - // EIP-7594 format with sidecar - typeName = "3 (EIP-7594 network format)"; - blobWrapperVersion = getNumber(fields[1]); - const fBlobs = fields[2], fCommits = fields[3], fProofs = fields[4]; - assertArgument(blobWrapperVersion === 1, `unsupported EIP-7594 network format version: ${blobWrapperVersion}`, "fields[1]", blobWrapperVersion); - assertArgument(Array.isArray(fBlobs), "invalid EIP-7594 network format: blobs not an array", "fields[2]", fBlobs); - assertArgument(Array.isArray(fCommits), "invalid EIP-7594 network format: commitments not an array", "fields[3]", fCommits); - assertArgument(Array.isArray(fProofs), "invalid EIP-7594 network format: proofs not an array", "fields[4]", fProofs); - assertArgument(fBlobs.length === fCommits.length, "invalid network format: blobs/commitments length mismatch", "fields", fields); - assertArgument(fBlobs.length * CELL_COUNT === fProofs.length, "invalid network format: blobs/proofs length mismatch", "fields", fields); - blobs = []; - for (let i = 0; i < fBlobs.length; i++) { - const proof = []; - for (let j = 0; j < CELL_COUNT; j++) { - proof.push(fProofs[(i * CELL_COUNT) + j]); - } - blobs.push({ - data: fBlobs[i], - commitment: fCommits[i], - proof: concat(proof) - }); - } - fields = fields[0]; - } - assertArgument(Array.isArray(fields) && (fields.length === 11 || fields.length === 14), `invalid field count for transaction type: ${typeName}`, "data", hexlify(data)); - const tx = { - type: 3, - chainId: handleUint(fields[0], "chainId"), - nonce: handleNumber(fields[1], "nonce"), - maxPriorityFeePerGas: handleUint(fields[2], "maxPriorityFeePerGas"), - maxFeePerGas: handleUint(fields[3], "maxFeePerGas"), - gasPrice: null, - gasLimit: handleUint(fields[4], "gasLimit"), - to: handleAddress(fields[5]), - value: handleUint(fields[6], "value"), - data: hexlify(fields[7]), - accessList: handleAccessList(fields[8], "accessList"), - maxFeePerBlobGas: handleUint(fields[9], "maxFeePerBlobGas"), - blobVersionedHashes: fields[10], - blobWrapperVersion - }; - if (blobs) { - tx.blobs = blobs; - } - assertArgument(tx.to != null, `invalid address for transaction type: ${typeName}`, "data", data); - assertArgument(Array.isArray(tx.blobVersionedHashes), "invalid blobVersionedHashes: must be an array", "data", data); - for (let i = 0; i < tx.blobVersionedHashes.length; i++) { - assertArgument(isHexString(tx.blobVersionedHashes[i], 32), `invalid blobVersionedHash at index ${i}: must be length 32`, "data", data); - } - // Unsigned EIP-4844 Transaction - if (fields.length === 11) { - return tx; - } - // @TODO: Do we need to do this? This is only called internally - // and used to verify hashes; it might save time to not do this - //tx.hash = keccak256(concat([ "0x03", encodeRlp(fields) ])); - _parseEipSignature(tx, fields.slice(11)); - return tx; -} -function _serializeEip4844(tx, sig, blobs) { - const fields = [ - formatNumber(tx.chainId, "chainId"), - formatNumber(tx.nonce, "nonce"), - formatNumber(tx.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"), - formatNumber(tx.maxFeePerGas || 0, "maxFeePerGas"), - formatNumber(tx.gasLimit, "gasLimit"), - (tx.to || ZeroAddress), - formatNumber(tx.value, "value"), - tx.data, - formatAccessList(tx.accessList || []), - formatNumber(tx.maxFeePerBlobGas || 0, "maxFeePerBlobGas"), - formatHashes(tx.blobVersionedHashes || [], "blobVersionedHashes") - ]; - if (sig) { - fields.push(formatNumber(sig.yParity, "yParity")); - fields.push(toBeArray(sig.r)); - fields.push(toBeArray(sig.s)); - // We have blobs; return the network wrapped format - if (blobs) { - // Use EIP-7594 - if (tx.blobWrapperVersion != null) { - const wrapperVersion = toBeArray(tx.blobWrapperVersion); - const cellProofs = []; - for (const { proof } of blobs) { - const p = getBytes(proof); - const cellSize = p.length / CELL_COUNT; - for (let i = 0; i < p.length; i += cellSize) { - cellProofs.push(p.subarray(i, i + cellSize)); - } - } - return concat([ - "0x03", - encodeRlp([ - fields, - wrapperVersion, - blobs.map((b) => b.data), - blobs.map((b) => b.commitment), - cellProofs - ]) - ]); - } - // Fall back onto classic EIP-4844 behavior - return concat([ - "0x03", - encodeRlp([ - fields, - blobs.map((b) => b.data), - blobs.map((b) => b.commitment), - blobs.map((b) => b.proof), - ]) - ]); - } - } - return concat(["0x03", encodeRlp(fields)]); -} -function _parseEip7702(data) { - const fields = decodeRlp(getBytes(data).slice(1)); - assertArgument(Array.isArray(fields) && (fields.length === 10 || fields.length === 13), "invalid field count for transaction type: 4", "data", hexlify(data)); - const tx = { - type: 4, - chainId: handleUint(fields[0], "chainId"), - nonce: handleNumber(fields[1], "nonce"), - maxPriorityFeePerGas: handleUint(fields[2], "maxPriorityFeePerGas"), - maxFeePerGas: handleUint(fields[3], "maxFeePerGas"), - gasPrice: null, - gasLimit: handleUint(fields[4], "gasLimit"), - to: handleAddress(fields[5]), - value: handleUint(fields[6], "value"), - data: hexlify(fields[7]), - accessList: handleAccessList(fields[8], "accessList"), - authorizationList: handleAuthorizationList(fields[9], "authorizationList"), - }; - // Unsigned EIP-7702 Transaction - if (fields.length === 10) { - return tx; - } - _parseEipSignature(tx, fields.slice(10)); - return tx; -} -function _serializeEip7702(tx, sig) { - const fields = [ - formatNumber(tx.chainId, "chainId"), - formatNumber(tx.nonce, "nonce"), - formatNumber(tx.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"), - formatNumber(tx.maxFeePerGas || 0, "maxFeePerGas"), - formatNumber(tx.gasLimit, "gasLimit"), - (tx.to || "0x"), - formatNumber(tx.value, "value"), - tx.data, - formatAccessList(tx.accessList || []), - formatAuthorizationList(tx.authorizationList || []) - ]; - if (sig) { - fields.push(formatNumber(sig.yParity, "yParity")); - fields.push(toBeArray(sig.r)); - fields.push(toBeArray(sig.s)); - } - return concat(["0x04", encodeRlp(fields)]); -} -/** - * A **Transaction** describes an operation to be executed on - * Ethereum by an Externally Owned Account (EOA). It includes - * who (the [[to]] address), what (the [[data]]) and how much (the - * [[value]] in ether) the operation should entail. - * - * @example: - * tx = new Transaction() - * //_result: - * - * tx.data = "0x1234"; - * //_result: - */ -class Transaction { - #type; - #to; - #data; - #nonce; - #gasLimit; - #gasPrice; - #maxPriorityFeePerGas; - #maxFeePerGas; - #value; - #chainId; - #sig; - #accessList; - #maxFeePerBlobGas; - #blobVersionedHashes; - #kzg; - #blobs; - #auths; - #blobWrapperVersion; - /** - * The transaction type. - * - * If null, the type will be automatically inferred based on - * explicit properties. - */ - get type() { return this.#type; } - set type(value) { - switch (value) { - case null: - this.#type = null; - break; - case 0: - case "legacy": - this.#type = 0; - break; - case 1: - case "berlin": - case "eip-2930": - this.#type = 1; - break; - case 2: - case "london": - case "eip-1559": - this.#type = 2; - break; - case 3: - case "cancun": - case "eip-4844": - this.#type = 3; - break; - case 4: - case "pectra": - case "eip-7702": - this.#type = 4; - break; - default: - assertArgument(false, "unsupported transaction type", "type", value); - } - } - /** - * The name of the transaction type. - */ - get typeName() { - switch (this.type) { - case 0: return "legacy"; - case 1: return "eip-2930"; - case 2: return "eip-1559"; - case 3: return "eip-4844"; - case 4: return "eip-7702"; - } - return null; - } - /** - * The ``to`` address for the transaction or ``null`` if the - * transaction is an ``init`` transaction. - */ - get to() { - const value = this.#to; - if (value == null && this.type === 3) { - return ZeroAddress; - } - return value; - } - set to(value) { - this.#to = (value == null) ? null : getAddress(value); - } - /** - * The transaction nonce. - */ - get nonce() { return this.#nonce; } - set nonce(value) { this.#nonce = getNumber(value, "value"); } - /** - * The gas limit. - */ - get gasLimit() { return this.#gasLimit; } - set gasLimit(value) { this.#gasLimit = getBigInt(value); } - /** - * The gas price. - * - * On legacy networks this defines the fee that will be paid. On - * EIP-1559 networks, this should be ``null``. - */ - get gasPrice() { - const value = this.#gasPrice; - if (value == null && (this.type === 0 || this.type === 1)) { - return BN_0$4; - } - return value; - } - set gasPrice(value) { - this.#gasPrice = (value == null) ? null : getBigInt(value, "gasPrice"); - } - /** - * The maximum priority fee per unit of gas to pay. On legacy - * networks this should be ``null``. - */ - get maxPriorityFeePerGas() { - const value = this.#maxPriorityFeePerGas; - if (value == null) { - if (this.type === 2 || this.type === 3) { - return BN_0$4; - } - return null; - } - return value; - } - set maxPriorityFeePerGas(value) { - this.#maxPriorityFeePerGas = (value == null) ? null : getBigInt(value, "maxPriorityFeePerGas"); - } - /** - * The maximum total fee per unit of gas to pay. On legacy - * networks this should be ``null``. - */ - get maxFeePerGas() { - const value = this.#maxFeePerGas; - if (value == null) { - if (this.type === 2 || this.type === 3) { - return BN_0$4; - } - return null; - } - return value; - } - set maxFeePerGas(value) { - this.#maxFeePerGas = (value == null) ? null : getBigInt(value, "maxFeePerGas"); - } - /** - * The transaction data. For ``init`` transactions this is the - * deployment code. - */ - get data() { return this.#data; } - set data(value) { this.#data = hexlify(value); } - /** - * The amount of ether (in wei) to send in this transactions. - */ - get value() { return this.#value; } - set value(value) { - this.#value = getBigInt(value, "value"); - } - /** - * The chain ID this transaction is valid on. - */ - get chainId() { return this.#chainId; } - set chainId(value) { this.#chainId = getBigInt(value); } - /** - * If signed, the signature for this transaction. - */ - get signature() { return this.#sig || null; } - set signature(value) { - this.#sig = (value == null) ? null : Signature.from(value); - } - isValid() { - const sig = this.signature; - if (sig && !sig.isValid()) { - return false; - } - const auths = this.authorizationList; - if (auths) { - for (const auth of auths) { - if (!auth.signature.isValid()) { - return false; - } - } - } - return true; - } - /** - * The access list. - * - * An access list permits discounted (but pre-paid) access to - * bytecode and state variable access within contract execution. - */ - get accessList() { - const value = this.#accessList || null; - if (value == null) { - if (this.type === 1 || this.type === 2 || this.type === 3) { - // @TODO: in v7, this should assign the value or become - // a live object itself, otherwise mutation is inconsistent - return []; - } - return null; - } - return value; - } - set accessList(value) { - this.#accessList = (value == null) ? null : accessListify(value); - } - get authorizationList() { - const value = this.#auths || null; - if (value == null) { - if (this.type === 4) { - // @TODO: in v7, this should become a live object itself, - // otherwise mutation is inconsistent - return []; - } - } - return value; - } - set authorizationList(auths) { - this.#auths = (auths == null) ? null : auths.map((a) => authorizationify(a)); - } - /** - * The max fee per blob gas for Cancun transactions. - */ - get maxFeePerBlobGas() { - const value = this.#maxFeePerBlobGas; - if (value == null && this.type === 3) { - return BN_0$4; - } - return value; - } - set maxFeePerBlobGas(value) { - this.#maxFeePerBlobGas = (value == null) ? null : getBigInt(value, "maxFeePerBlobGas"); - } - /** - * The BLOb versioned hashes for Cancun transactions. - */ - get blobVersionedHashes() { - // @TODO: Mutation is inconsistent; if unset, the returned value - // cannot mutate the object, if set it can - let value = this.#blobVersionedHashes; - if (value == null && this.type === 3) { - return []; - } - return value; - } - set blobVersionedHashes(value) { - if (value != null) { - assertArgument(Array.isArray(value), "blobVersionedHashes must be an Array", "value", value); - value = value.slice(); - for (let i = 0; i < value.length; i++) { - assertArgument(isHexString(value[i], 32), "invalid blobVersionedHash", `value[${i}]`, value[i]); - } - } - this.#blobVersionedHashes = value; - } - /** - * The BLObs for the Transaction, if any. - * - * If ``blobs`` is non-``null``, then the [[seriailized]] - * will return the network formatted sidecar, otherwise it - * will return the standard [[link-eip-2718]] payload. The - * [[unsignedSerialized]] is unaffected regardless. - * - * When setting ``blobs``, either fully valid [[Blob]] objects - * may be specified (i.e. correctly padded, with correct - * committments and proofs) or a raw [[BytesLike]] may - * be provided. - * - * If raw [[BytesLike]] are provided, the [[kzg]] property **must** - * be already set. The blob will be correctly padded and the - * [[KzgLibrary]] will be used to compute the committment and - * proof for the blob. - * - * A BLOb is a sequence of field elements, each of which must - * be within the BLS field modulo, so some additional processing - * may be required to encode arbitrary data to ensure each 32 byte - * field is within the valid range. - * - * Setting this automatically populates [[blobVersionedHashes]], - * overwriting any existing values. Setting this to ``null`` - * does **not** remove the [[blobVersionedHashes]], leaving them - * present. - */ - get blobs() { - if (this.#blobs == null) { - return null; - } - return this.#blobs.map((b) => Object.assign({}, b)); - } - set blobs(_blobs) { - if (_blobs == null) { - this.#blobs = null; - return; - } - const blobs = []; - const versionedHashes = []; - for (let i = 0; i < _blobs.length; i++) { - const blob = _blobs[i]; - if (isBytesLike(blob)) { - assert(this.#kzg, "adding a raw blob requires a KZG library", "UNSUPPORTED_OPERATION", { - operation: "set blobs()" - }); - let data = getBytes(blob); - assertArgument(data.length <= BLOB_SIZE, "blob is too large", `blobs[${i}]`, blob); - // Pad blob if necessary - if (data.length !== BLOB_SIZE) { - const padded = new Uint8Array(BLOB_SIZE); - padded.set(data); - data = padded; - } - const commit = this.#kzg.blobToKzgCommitment(data); - const proof = hexlify(this.#kzg.computeBlobKzgProof(data, commit)); - blobs.push({ - data: hexlify(data), - commitment: hexlify(commit), - proof - }); - versionedHashes.push(getVersionedHash(1, commit)); - } - else { - const data = hexlify(blob.data); - const commitment = hexlify(blob.commitment); - const proof = hexlify(blob.proof); - blobs.push({ data, commitment, proof }); - versionedHashes.push(getVersionedHash(1, commitment)); - } - } - this.#blobs = blobs; - this.#blobVersionedHashes = versionedHashes; - } - get kzg() { return this.#kzg; } - set kzg(kzg) { - if (kzg == null) { - this.#kzg = null; - } - else { - this.#kzg = getKzgLibrary(kzg); - } - } - get blobWrapperVersion() { - return this.#blobWrapperVersion; - } - set blobWrapperVersion(value) { - this.#blobWrapperVersion = value; - } - /** - * Creates a new Transaction with default values. - */ - constructor() { - this.#type = null; - this.#to = null; - this.#nonce = 0; - this.#gasLimit = BN_0$4; - this.#gasPrice = null; - this.#maxPriorityFeePerGas = null; - this.#maxFeePerGas = null; - this.#data = "0x"; - this.#value = BN_0$4; - this.#chainId = BN_0$4; - this.#sig = null; - this.#accessList = null; - this.#maxFeePerBlobGas = null; - this.#blobVersionedHashes = null; - this.#kzg = null; - this.#blobs = null; - this.#auths = null; - this.#blobWrapperVersion = null; - } - /** - * The transaction hash, if signed. Otherwise, ``null``. - */ - get hash() { - if (this.signature == null) { - return null; - } - return keccak256(this.#getSerialized(true, false)); - } - /** - * The pre-image hash of this transaction. - * - * This is the digest that a [[Signer]] must sign to authorize - * this transaction. - */ - get unsignedHash() { - return keccak256(this.unsignedSerialized); - } - /** - * The sending address, if signed. Otherwise, ``null``. - */ - get from() { - if (this.signature == null) { - return null; - } - return recoverAddress(this.unsignedHash, this.signature.getCanonical()); - } - /** - * The public key of the sender, if signed. Otherwise, ``null``. - */ - get fromPublicKey() { - if (this.signature == null) { - return null; - } - return SigningKey.recoverPublicKey(this.unsignedHash, this.signature.getCanonical()); - } - /** - * Returns true if signed. - * - * This provides a Type Guard that properties requiring a signed - * transaction are non-null. - */ - isSigned() { - return this.signature != null; - } - #getSerialized(signed, sidecar) { - assert(!signed || this.signature != null, "cannot serialize unsigned transaction; maybe you meant .unsignedSerialized", "UNSUPPORTED_OPERATION", { operation: ".serialized" }); - const sig = signed ? this.signature : null; - switch (this.inferType()) { - case 0: - return _serializeLegacy(this, sig); - case 1: - return _serializeEip2930(this, sig); - case 2: - return _serializeEip1559(this, sig); - case 3: - return _serializeEip4844(this, sig, sidecar ? this.blobs : null); - case 4: - return _serializeEip7702(this, sig); - } - assert(false, "unsupported transaction type", "UNSUPPORTED_OPERATION", { operation: ".serialized" }); - } - /** - * The serialized transaction. - * - * This throws if the transaction is unsigned. For the pre-image, - * use [[unsignedSerialized]]. - */ - get serialized() { - return this.#getSerialized(true, true); - } - /** - * The transaction pre-image. - * - * The hash of this is the digest which needs to be signed to - * authorize this transaction. - */ - get unsignedSerialized() { - return this.#getSerialized(false, false); - } - /** - * Return the most "likely" type; currently the highest - * supported transaction type. - */ - inferType() { - const types = this.inferTypes(); - // Prefer London (EIP-1559) over Cancun (BLOb) - if (types.indexOf(2) >= 0) { - return 2; - } - // Return the highest inferred type - return (types.pop()); - } - /** - * Validates the explicit properties and returns a list of compatible - * transaction types. - */ - inferTypes() { - // Checks that there are no conflicting properties set - const hasGasPrice = this.gasPrice != null; - const hasFee = (this.maxFeePerGas != null || this.maxPriorityFeePerGas != null); - const hasAccessList = (this.accessList != null); - const hasBlob = (this.#maxFeePerBlobGas != null || this.#blobVersionedHashes); - //if (hasGasPrice && hasFee) { - // throw new Error("transaction cannot have gasPrice and maxFeePerGas"); - //} - if (this.maxFeePerGas != null && this.maxPriorityFeePerGas != null) { - assert(this.maxFeePerGas >= this.maxPriorityFeePerGas, "priorityFee cannot be more than maxFee", "BAD_DATA", { value: this }); - } - //if (this.type === 2 && hasGasPrice) { - // throw new Error("eip-1559 transaction cannot have gasPrice"); - //} - assert(!hasFee || (this.type !== 0 && this.type !== 1), "transaction type cannot have maxFeePerGas or maxPriorityFeePerGas", "BAD_DATA", { value: this }); - assert(this.type !== 0 || !hasAccessList, "legacy transaction cannot have accessList", "BAD_DATA", { value: this }); - const types = []; - // Explicit type - if (this.type != null) { - types.push(this.type); - } - else { - if (this.authorizationList && this.authorizationList.length) { - types.push(4); - } - else if (hasFee) { - types.push(2); - } - else if (hasGasPrice) { - types.push(1); - if (!hasAccessList) { - types.push(0); - } - } - else if (hasAccessList) { - types.push(1); - types.push(2); - } - else if (hasBlob && this.to) { - types.push(3); - } - else { - types.push(0); - types.push(1); - types.push(2); - types.push(3); - } - } - types.sort(); - return types; - } - /** - * Returns true if this transaction is a legacy transaction (i.e. - * ``type === 0``). - * - * This provides a Type Guard that the related properties are - * non-null. - */ - isLegacy() { - return (this.type === 0); - } - /** - * Returns true if this transaction is berlin hardform transaction (i.e. - * ``type === 1``). - * - * This provides a Type Guard that the related properties are - * non-null. - */ - isBerlin() { - return (this.type === 1); - } - /** - * Returns true if this transaction is london hardform transaction (i.e. - * ``type === 2``). - * - * This provides a Type Guard that the related properties are - * non-null. - */ - isLondon() { - return (this.type === 2); - } - /** - * Returns true if this transaction is an [[link-eip-4844]] BLOB - * transaction. - * - * This provides a Type Guard that the related properties are - * non-null. - */ - isCancun() { - return (this.type === 3); - } - /** - * Create a copy of this transaciton. - */ - clone() { - return Transaction.from(this); - } - /** - * Return a JSON-friendly object. - */ - toJSON() { - const s = (v) => { - if (v == null) { - return null; - } - return v.toString(); - }; - return { - type: this.type, - to: this.to, - // from: this.from, - data: this.data, - nonce: this.nonce, - gasLimit: s(this.gasLimit), - gasPrice: s(this.gasPrice), - maxPriorityFeePerGas: s(this.maxPriorityFeePerGas), - maxFeePerGas: s(this.maxFeePerGas), - value: s(this.value), - chainId: s(this.chainId), - sig: this.signature ? this.signature.toJSON() : null, - accessList: this.accessList - }; - } - [inspect]() { - return this.toString(); - } - toString() { - const output = []; - const add = (key) => { - let value = this[key]; - if (typeof (value) === "string") { - value = JSON.stringify(value); - } - output.push(`${key}: ${value}`); - }; - if (this.type) { - add("type"); - } - add("to"); - add("data"); - add("nonce"); - add("gasLimit"); - add("value"); - if (this.chainId != null) { - add("chainId"); - } - if (this.signature) { - add("from"); - output.push(`signature: ${this.signature.toString()}`); - } - // @TODO: accessList - // @TODO: blobs (might make output huge; maybe just include a flag?) - const auths = this.authorizationList; - if (auths) { - const outputAuths = []; - for (const auth of auths) { - const o = []; - o.push(`address: ${JSON.stringify(auth.address)}`); - if (auth.nonce != null) { - o.push(`nonce: ${auth.nonce}`); - } - if (auth.chainId != null) { - o.push(`chainId: ${auth.chainId}`); - } - if (auth.signature) { - o.push(`signature: ${auth.signature.toString()}`); - } - outputAuths.push(`Authorization { ${o.join(", ")} }`); - } - output.push(`authorizations: [ ${outputAuths.join(", ")} ]`); - } - return `Transaction { ${output.join(", ")} }`; - } - /** - * Create a **Transaction** from a serialized transaction or a - * Transaction-like object. - */ - static from(tx) { - if (tx == null) { - return new Transaction(); - } - if (typeof (tx) === "string") { - const payload = getBytes(tx); - if (payload[0] >= 0x7f) { // @TODO: > vs >= ?? - return Transaction.from(_parseLegacy(payload)); - } - switch (payload[0]) { - case 1: return Transaction.from(_parseEip2930(payload)); - case 2: return Transaction.from(_parseEip1559(payload)); - case 3: return Transaction.from(_parseEip4844(payload)); - case 4: return Transaction.from(_parseEip7702(payload)); - } - assert(false, "unsupported transaction type", "UNSUPPORTED_OPERATION", { operation: "from" }); - } - const result = new Transaction(); - if (tx.type != null) { - result.type = tx.type; - } - if (tx.to != null) { - result.to = tx.to; - } - if (tx.nonce != null) { - result.nonce = tx.nonce; - } - if (tx.gasLimit != null) { - result.gasLimit = tx.gasLimit; - } - if (tx.gasPrice != null) { - result.gasPrice = tx.gasPrice; - } - if (tx.maxPriorityFeePerGas != null) { - result.maxPriorityFeePerGas = tx.maxPriorityFeePerGas; - } - if (tx.maxFeePerGas != null) { - result.maxFeePerGas = tx.maxFeePerGas; - } - if (tx.maxFeePerBlobGas != null) { - result.maxFeePerBlobGas = tx.maxFeePerBlobGas; - } - if (tx.data != null) { - result.data = tx.data; - } - if (tx.value != null) { - result.value = tx.value; - } - if (tx.chainId != null) { - result.chainId = tx.chainId; - } - if (tx.signature != null) { - result.signature = Signature.from(tx.signature); - } - if (tx.accessList != null) { - result.accessList = tx.accessList; - } - if (tx.authorizationList != null) { - result.authorizationList = tx.authorizationList; - } - // This will get overwritten by blobs, if present - if (tx.blobVersionedHashes != null) { - result.blobVersionedHashes = tx.blobVersionedHashes; - } - // Make sure we assign the kzg before assigning blobs, which - // require the library in the event raw blob data is provided. - if (tx.kzg != null) { - result.kzg = tx.kzg; - } - if (tx.blobWrapperVersion != null) { - result.blobWrapperVersion = tx.blobWrapperVersion; - } - if (tx.blobs != null) { - result.blobs = tx.blobs; - } - if (tx.hash != null) { - assertArgument(result.isSigned(), "unsigned transaction cannot define '.hash'", "tx", tx); - assertArgument(result.hash === tx.hash, "hash mismatch", "tx", tx); - } - if (tx.from != null) { - assertArgument(result.isSigned(), "unsigned transaction cannot define '.from'", "tx", tx); - assertArgument(result.from.toLowerCase() === (tx.from || "").toLowerCase(), "from mismatch", "tx", tx); - } - return result; - } -} - -/** - * Computes the [[link-eip-7702]] authorization digest to sign. - */ -function hashAuthorization(auth) { - assertArgument(typeof (auth.address) === "string", "invalid address for hashAuthorization", "auth.address", auth); - return keccak256(concat([ - "0x05", encodeRlp([ - (auth.chainId != null) ? toBeArray(auth.chainId) : "0x", - getAddress(auth.address), - (auth.nonce != null) ? toBeArray(auth.nonce) : "0x", - ]) - ])); -} -/** - * Return the address of the private key that produced - * the signature %%sig%% during signing for %%message%%. - */ -function verifyAuthorization(auth, sig) { - return recoverAddress(hashAuthorization(auth), sig); -} - -/** - * A simple hashing function which operates on UTF-8 strings to - * compute an 32-byte identifier. - * - * This simply computes the [UTF-8 bytes](toUtf8Bytes) and computes - * the [[keccak256]]. - * - * @example: - * id("hello world") - * //_result: - */ -function id(value) { - return keccak256(toUtf8Bytes(value)); -} - -// created 2023-09-25T01:01:55.148Z -// compressed base64-encoded blob for include-ens data -// source: https://github.com/adraffy/ens-normalize.js/blob/main/src/make.js -// see: https://github.com/adraffy/ens-normalize.js#security -// SHA-256: 0565ed049b9cf1614bb9e11ba7d8ac6a6fb96c893253d890f7e2b2884b9ded32 -var COMPRESSED$1 = 'AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhAB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oCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI'; -const FENCED = new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]); -const NSM_MAX = 4; - -function decode_arithmetic(bytes) { - let pos = 0; - function u16() { return (bytes[pos++] << 8) | bytes[pos++]; } - - // decode the frequency table - let symbol_count = u16(); - let total = 1; - let acc = [0, 1]; // first symbol has frequency 1 - for (let i = 1; i < symbol_count; i++) { - acc.push(total += u16()); - } - - // skip the sized-payload that the last 3 symbols index into - let skip = u16(); - let pos_payload = pos; - pos += skip; - - let read_width = 0; - let read_buffer = 0; - function read_bit() { - if (read_width == 0) { - // this will read beyond end of buffer - // but (undefined|0) => zero pad - read_buffer = (read_buffer << 8) | bytes[pos++]; - read_width = 8; - } - return (read_buffer >> --read_width) & 1; - } - - const N = 31; - const FULL = 2**N; - const HALF = FULL >>> 1; - const QRTR = HALF >> 1; - const MASK = FULL - 1; - - // fill register - let register = 0; - for (let i = 0; i < N; i++) register = (register << 1) | read_bit(); - - let symbols = []; - let low = 0; - let range = FULL; // treat like a float - while (true) { - let value = Math.floor((((register - low + 1) * total) - 1) / range); - let start = 0; - let end = symbol_count; - while (end - start > 1) { // binary search - let mid = (start + end) >>> 1; - if (value < acc[mid]) { - end = mid; - } else { - start = mid; - } - } - if (start == 0) break; // first symbol is end mark - symbols.push(start); - let a = low + Math.floor(range * acc[start] / total); - let b = low + Math.floor(range * acc[start+1] / total) - 1; - while (((a ^ b) & HALF) == 0) { - register = (register << 1) & MASK | read_bit(); - a = (a << 1) & MASK; - b = (b << 1) & MASK | 1; - } - while (a & ~b & QRTR) { - register = (register & HALF) | ((register << 1) & (MASK >>> 1)) | read_bit(); - a = (a << 1) ^ HALF; - b = ((b ^ HALF) << 1) | HALF | 1; - } - low = a; - range = 1 + b - a; - } - let offset = symbol_count - 4; - return symbols.map(x => { // index into payload - switch (x - offset) { - case 3: return offset + 0x10100 + ((bytes[pos_payload++] << 16) | (bytes[pos_payload++] << 8) | bytes[pos_payload++]); - case 2: return offset + 0x100 + ((bytes[pos_payload++] << 8) | bytes[pos_payload++]); - case 1: return offset + bytes[pos_payload++]; - default: return x - 1; - } - }); -} - -// returns an iterator which returns the next symbol -function read_payload(v) { - let pos = 0; - return () => v[pos++]; -} -function read_compressed_payload(s) { - return read_payload(decode_arithmetic(unsafe_atob(s))); -} - -// unsafe in the sense: -// expected well-formed Base64 w/o padding -// 20220922: added for https://github.com/adraffy/ens-normalize.js/issues/4 -function unsafe_atob(s) { - let lookup = []; - [...'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'].forEach((c, i) => lookup[c.charCodeAt(0)] = i); - let n = s.length; - let ret = new Uint8Array((6 * n) >> 3); - for (let i = 0, pos = 0, width = 0, carry = 0; i < n; i++) { - carry = (carry << 6) | lookup[s.charCodeAt(i)]; - width += 6; - if (width >= 8) { - ret[pos++] = (carry >> (width -= 8)); - } - } - return ret; -} - -// eg. [0,1,2,3...] => [0,-1,1,-2,...] -function signed(i) { - return (i & 1) ? (~i >> 1) : (i >> 1); -} - -function read_deltas(n, next) { - let v = Array(n); - for (let i = 0, x = 0; i < n; i++) v[i] = x += signed(next()); - return v; -} - -// [123][5] => [0 3] [1 1] [0 0] -function read_sorted(next, prev = 0) { - let ret = []; - while (true) { - let x = next(); - let n = next(); - if (!n) break; - prev += x; - for (let i = 0; i < n; i++) { - ret.push(prev + i); - } - prev += n + 1; - } - return ret; -} - -function read_sorted_arrays(next) { - return read_array_while(() => { - let v = read_sorted(next); - if (v.length) return v; - }); -} - -// returns map of x => ys -function read_mapped(next) { - let ret = []; - while (true) { - let w = next(); - if (w == 0) break; - ret.push(read_linear_table(w, next)); - } - while (true) { - let w = next() - 1; - if (w < 0) break; - ret.push(read_replacement_table(w, next)); - } - return ret.flat(); -} - -// read until next is falsy -// return array of read values -function read_array_while(next) { - let v = []; - while (true) { - let x = next(v.length); - if (!x) break; - v.push(x); - } - return v; -} - -// read w columns of length n -// return as n rows of length w -function read_transposed(n, w, next) { - let m = Array(n).fill().map(() => []); - for (let i = 0; i < w; i++) { - read_deltas(n, next).forEach((x, j) => m[j].push(x)); - } - return m; -} - -// returns [[x, ys], [x+dx, ys+dy], [x+2*dx, ys+2*dy], ...] -// where dx/dy = steps, n = run size, w = length of y -function read_linear_table(w, next) { - let dx = 1 + next(); - let dy = next(); - let vN = read_array_while(next); - let m = read_transposed(vN.length, 1+w, next); - return m.flatMap((v, i) => { - let [x, ...ys] = v; - return Array(vN[i]).fill().map((_, j) => { - let j_dy = j * dy; - return [x + j * dx, ys.map(y => y + j_dy)]; - }); - }); -} - -// return [[x, ys...], ...] -// where w = length of y -function read_replacement_table(w, next) { - let n = 1 + next(); - let m = read_transposed(n, 1+w, next); - return m.map(v => [v[0], v.slice(1)]); -} - - -function read_trie(next) { - let ret = []; - let sorted = read_sorted(next); - expand(decode([]), []); - return ret; // not sorted - function decode(Q) { // characters that lead into this node - let S = next(); // state: valid, save, check - let B = read_array_while(() => { // buckets leading to new nodes - let cps = read_sorted(next).map(i => sorted[i]); - if (cps.length) return decode(cps); - }); - return {S, B, Q}; - } - function expand({S, B}, cps, saved) { - if (S & 4 && saved === cps[cps.length-1]) return; - if (S & 2) saved = cps[cps.length-1]; - if (S & 1) ret.push(cps); - for (let br of B) { - for (let cp of br.Q) { - expand(br, [...cps, cp], saved); - } - } - } -} - -function hex_cp(cp) { - return cp.toString(16).toUpperCase().padStart(2, '0'); -} - -function quote_cp(cp) { - return `{${hex_cp(cp)}}`; // raffy convention: like "\u{X}" w/o the "\u" -} - -/* -export function explode_cp(s) { - return [...s].map(c => c.codePointAt(0)); -} -*/ -function explode_cp(s) { // this is about 2x faster - let cps = []; - for (let pos = 0, len = s.length; pos < len; ) { - let cp = s.codePointAt(pos); - pos += cp < 0x10000 ? 1 : 2; - cps.push(cp); - } - return cps; -} - -function str_from_cps(cps) { - const chunk = 4096; - let len = cps.length; - if (len < chunk) return String.fromCodePoint(...cps); - let buf = []; - for (let i = 0; i < len; ) { - buf.push(String.fromCodePoint(...cps.slice(i, i += chunk))); - } - return buf.join(''); -} - -function compare_arrays(a, b) { - let n = a.length; - let c = n - b.length; - for (let i = 0; c == 0 && i < n; i++) c = a[i] - b[i]; - return c; -} - -// created 2023-09-25T01:01:55.148Z -// compressed base64-encoded blob for include-nf data -// source: https://github.com/adraffy/ens-normalize.js/blob/main/src/make.js -// see: https://github.com/adraffy/ens-normalize.js#security -// SHA-256: a974b6f8541fc29d919bc85118af0a44015851fab5343f8679cb31be2bdb209e -var COMPRESSED = 'AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26PTQyy8FfEQ8AY8IPAGcEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiACnwRZEkkVsS7tANAsBG0RuAQLEPABv9HICTUBXigPZwRBApMDOwAamhtaABqEAY8KvKx3LQ4ArAB8UhwEBAVSagD8AEFZADkBIadVj2UMUgx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VimcNWEqdXjSoxSgmF0UPlDoUlNrPcM7ftmA8Y9gKiqKEHuWN+AZRIwtVSxye2Kf8rM3lhJ5XcBXU9n4v0Oy1RU2M+4qM8AQPVwse8ErNSob5oFPWxuqZnVzo1qB/IBxkM3EVUKFUUlO3e51259GgNcJbCmlvrdjtoTW7rChm1wyCKzpCTwozUUEOIcWLneRLgMXh+SjGSFkAllzbGS5HK7LlfCMRNRDSvbQPjcXaenNYxCvu2Qyznz6StuxVj66SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g'; - -// https://unicode.org/reports/tr15/ -// for reference implementation -// see: /derive/nf.js - - -// algorithmic hangul -// https://www.unicode.org/versions/Unicode15.0.0/ch03.pdf (page 144) -const S0 = 0xAC00; -const L0 = 0x1100; -const V0 = 0x1161; -const T0 = 0x11A7; -const L_COUNT = 19; -const V_COUNT = 21; -const T_COUNT = 28; -const N_COUNT = V_COUNT * T_COUNT; -const S_COUNT = L_COUNT * N_COUNT; -const S1 = S0 + S_COUNT; -const L1 = L0 + L_COUNT; -const V1 = V0 + V_COUNT; -const T1$1 = T0 + T_COUNT; - -function unpack_cc(packed) { - return (packed >> 24) & 0xFF; -} -function unpack_cp(packed) { - return packed & 0xFFFFFF; -} - -let SHIFTED_RANK, EXCLUSIONS, DECOMP, RECOMP; - -function init$1() { - //console.time('nf'); - let r = read_compressed_payload(COMPRESSED); - SHIFTED_RANK = new Map(read_sorted_arrays(r).flatMap((v, i) => v.map(x => [x, (i+1) << 24]))); // pre-shifted - EXCLUSIONS = new Set(read_sorted(r)); - DECOMP = new Map(); - RECOMP = new Map(); - for (let [cp, cps] of read_mapped(r)) { - if (!EXCLUSIONS.has(cp) && cps.length == 2) { - let [a, b] = cps; - let bucket = RECOMP.get(a); - if (!bucket) { - bucket = new Map(); - RECOMP.set(a, bucket); - } - bucket.set(b, cp); - } - DECOMP.set(cp, cps.reverse()); // stored reversed - } - //console.timeEnd('nf'); - // 20230905: 11ms -} - -function is_hangul(cp) { - return cp >= S0 && cp < S1; -} - -function compose_pair(a, b) { - if (a >= L0 && a < L1 && b >= V0 && b < V1) { - return S0 + (a - L0) * N_COUNT + (b - V0) * T_COUNT; - } else if (is_hangul(a) && b > T0 && b < T1$1 && (a - S0) % T_COUNT == 0) { - return a + (b - T0); - } else { - let recomp = RECOMP.get(a); - if (recomp) { - recomp = recomp.get(b); - if (recomp) { - return recomp; - } - } - return -1; - } -} - -function decomposed(cps) { - if (!SHIFTED_RANK) init$1(); - let ret = []; - let buf = []; - let check_order = false; - function add(cp) { - let cc = SHIFTED_RANK.get(cp); - if (cc) { - check_order = true; - cp |= cc; - } - ret.push(cp); - } - for (let cp of cps) { - while (true) { - if (cp < 0x80) { - ret.push(cp); - } else if (is_hangul(cp)) { - let s_index = cp - S0; - let l_index = s_index / N_COUNT | 0; - let v_index = (s_index % N_COUNT) / T_COUNT | 0; - let t_index = s_index % T_COUNT; - add(L0 + l_index); - add(V0 + v_index); - if (t_index > 0) add(T0 + t_index); - } else { - let mapped = DECOMP.get(cp); - if (mapped) { - buf.push(...mapped); - } else { - add(cp); - } - } - if (!buf.length) break; - cp = buf.pop(); - } - } - if (check_order && ret.length > 1) { - let prev_cc = unpack_cc(ret[0]); - for (let i = 1; i < ret.length; i++) { - let cc = unpack_cc(ret[i]); - if (cc == 0 || prev_cc <= cc) { - prev_cc = cc; - continue; - } - let j = i-1; - while (true) { - let tmp = ret[j+1]; - ret[j+1] = ret[j]; - ret[j] = tmp; - if (!j) break; - prev_cc = unpack_cc(ret[--j]); - if (prev_cc <= cc) break; - } - prev_cc = unpack_cc(ret[i]); - } - } - return ret; -} - -function composed_from_decomposed(v) { - let ret = []; - let stack = []; - let prev_cp = -1; - let prev_cc = 0; - for (let packed of v) { - let cc = unpack_cc(packed); - let cp = unpack_cp(packed); - if (prev_cp == -1) { - if (cc == 0) { - prev_cp = cp; - } else { - ret.push(cp); - } - } else if (prev_cc > 0 && prev_cc >= cc) { - if (cc == 0) { - ret.push(prev_cp, ...stack); - stack.length = 0; - prev_cp = cp; - } else { - stack.push(cp); - } - prev_cc = cc; - } else { - let composed = compose_pair(prev_cp, cp); - if (composed >= 0) { - prev_cp = composed; - } else if (prev_cc == 0 && cc == 0) { - ret.push(prev_cp); - prev_cp = cp; - } else { - stack.push(cp); - prev_cc = cc; - } - } - } - if (prev_cp >= 0) { - ret.push(prev_cp, ...stack); - } - return ret; -} - -// note: cps can be iterable -function nfd(cps) { - return decomposed(cps).map(unpack_cp); -} -function nfc(cps) { - return composed_from_decomposed(decomposed(cps)); -} - -const HYPHEN = 0x2D; -const STOP_CH = '.'; -const FE0F = 0xFE0F; -const UNIQUE_PH = 1; - -// 20230913: replace [...v] with Array_from(v) to avoid large spreads -const Array_from = x => Array.from(x); // Array.from.bind(Array); - -function group_has_cp(g, cp) { - // 20230913: keep primary and secondary distinct instead of creating valid union - return g.P.has(cp) || g.Q.has(cp); -} - -class Emoji extends Array { - get is_emoji() { return true; } // free tagging system -} - -let MAPPED, IGNORED, CM, NSM, ESCAPE, GROUPS, WHOLE_VALID, WHOLE_MAP, VALID, EMOJI_LIST, EMOJI_ROOT; - -function init() { - if (MAPPED) return; - - let r = read_compressed_payload(COMPRESSED$1); - const read_sorted_array = () => read_sorted(r); - const read_sorted_set = () => new Set(read_sorted_array()); - const set_add_many = (set, v) => v.forEach(x => set.add(x)); - - MAPPED = new Map(read_mapped(r)); - IGNORED = read_sorted_set(); // ignored characters are not valid, so just read raw codepoints - - /* - // direct include from payload is smaller than the decompression code - const FENCED = new Map(read_array_while(() => { - let cp = r(); - if (cp) return [cp, read_str(r())]; - })); - */ - // 20230217: we still need all CM for proper error formatting - // but norm only needs NSM subset that are potentially-valid - CM = read_sorted_array(); - NSM = new Set(read_sorted_array().map(i => CM[i])); - CM = new Set(CM); - - ESCAPE = read_sorted_set(); // characters that should not be printed - read_sorted_set(); // only needed to illustrate ens_tokenize() transformations - - let chunks = read_sorted_arrays(r); - let unrestricted = r(); - //const read_chunked = () => new Set(read_sorted_array().flatMap(i => chunks[i]).concat(read_sorted_array())); - const read_chunked = () => { - // 20230921: build set in parts, 2x faster - let set = new Set(); - read_sorted_array().forEach(i => set_add_many(set, chunks[i])); - set_add_many(set, read_sorted_array()); - return set; - }; - GROUPS = read_array_while(i => { - // minifier property mangling seems unsafe - // so these are manually renamed to single chars - let N = read_array_while(r).map(x => x+0x60); - if (N.length) { - let R = i >= unrestricted; // unrestricted then restricted - N[0] -= 32; // capitalize - N = str_from_cps(N); - if (R) N=`Restricted[${N}]`; - let P = read_chunked(); // primary - let Q = read_chunked(); // secondary - let M = !r(); // not-whitelisted, check for NSM - // *** this code currently isn't needed *** - /* - let V = [...P, ...Q].sort((a, b) => a-b); // derive: sorted valid - let M = r()-1; // number of combining mark - if (M < 0) { // whitelisted - M = new Map(read_array_while(() => { - let i = r(); - if (i) return [V[i-1], read_array_while(() => { - let v = read_array_while(r); - if (v.length) return v.map(x => x-1); - })]; - })); - }*/ - return {N, P, Q, M, R}; - } - }); - - // decode compressed wholes - WHOLE_VALID = read_sorted_set(); - WHOLE_MAP = new Map(); - let wholes = read_sorted_array().concat(Array_from(WHOLE_VALID)).sort((a, b) => a-b); // must be sorted - wholes.forEach((cp, i) => { - let d = r(); - let w = wholes[i] = d ? wholes[i-d] : {V: [], M: new Map()}; - w.V.push(cp); // add to member set - if (!WHOLE_VALID.has(cp)) { - WHOLE_MAP.set(cp, w); // register with whole map - } - }); - - // compute confusable-extent complements - // usage: WHOLE_MAP.get(cp).M.get(cp) = complement set - for (let {V, M} of new Set(WHOLE_MAP.values())) { - // connect all groups that have each whole character - let recs = []; - for (let cp of V) { - let gs = GROUPS.filter(g => group_has_cp(g, cp)); - let rec = recs.find(({G}) => gs.some(g => G.has(g))); - if (!rec) { - rec = {G: new Set(), V: []}; - recs.push(rec); - } - rec.V.push(cp); - set_add_many(rec.G, gs); - } - // per character cache groups which are not a member of the extent - let union = recs.flatMap(x => Array_from(x.G)); // all of the groups used by this whole - for (let {G, V} of recs) { - let complement = new Set(union.filter(g => !G.has(g))); // groups not covered by the extent - for (let cp of V) { - M.set(cp, complement); // this is the same reference - } - } - } - - // compute valid set - // 20230924: VALID was union but can be re-used - VALID = new Set(); // exists in 1+ groups - let multi = new Set(); // exists in 2+ groups - const add_to_union = cp => VALID.has(cp) ? multi.add(cp) : VALID.add(cp); - for (let g of GROUPS) { - for (let cp of g.P) add_to_union(cp); - for (let cp of g.Q) add_to_union(cp); - } - // dual purpose WHOLE_MAP: return placeholder if unique non-confusable - for (let cp of VALID) { - if (!WHOLE_MAP.has(cp) && !multi.has(cp)) { - WHOLE_MAP.set(cp, UNIQUE_PH); - } - } - // add all decomposed parts - // see derive: "Valid is Closed (via Brute-force)" - set_add_many(VALID, nfd(VALID)); - - // decode emoji - // 20230719: emoji are now fully-expanded to avoid quirk logic - EMOJI_LIST = read_trie(r).map(v => Emoji.from(v)).sort(compare_arrays); - EMOJI_ROOT = new Map(); // this has approx 7K nodes (2+ per emoji) - for (let cps of EMOJI_LIST) { - // 20230719: change to *slightly* stricter algorithm which disallows - // insertion of misplaced FE0F in emoji sequences (matching ENSIP-15) - // example: beautified [A B] (eg. flag emoji) - // before: allow: [A FE0F B], error: [A FE0F FE0F B] - // after: error: both - // note: this code now matches ENSNormalize.{cs,java} logic - let prev = [EMOJI_ROOT]; - for (let cp of cps) { - let next = prev.map(node => { - let child = node.get(cp); - if (!child) { - // should this be object? - // (most have 1-2 items, few have many) - // 20230719: no, v8 default map is 4? - child = new Map(); - node.set(cp, child); - } - return child; - }); - if (cp === FE0F) { - prev.push(...next); // less than 20 elements - } else { - prev = next; - } - } - for (let x of prev) { - x.V = cps; - } - } -} - -// if escaped: {HEX} -// else: "x" {HEX} -function quoted_cp(cp) { - return (should_escape(cp) ? '' : `${bidi_qq(safe_str_from_cps([cp]))} `) + quote_cp(cp); -} - -// 20230211: some messages can be mixed-directional and result in spillover -// use 200E after a quoted string to force the remainder of a string from -// acquring the direction of the quote -// https://www.w3.org/International/questions/qa-bidi-unicode-controls#exceptions -function bidi_qq(s) { - return `"${s}"\u200E`; // strong LTR -} - -function check_label_extension(cps) { - if (cps.length >= 4 && cps[2] == HYPHEN && cps[3] == HYPHEN) { - throw new Error(`invalid label extension: "${str_from_cps(cps.slice(0, 4))}"`); // this can only be ascii so cant be bidi - } -} -function check_leading_underscore(cps) { - const UNDERSCORE = 0x5F; - for (let i = cps.lastIndexOf(UNDERSCORE); i > 0; ) { - if (cps[--i] !== UNDERSCORE) { - throw new Error('underscore allowed only at start'); - } - } -} -// check that a fenced cp is not leading, trailing, or touching another fenced cp -function check_fenced(cps) { - let cp = cps[0]; - let prev = FENCED.get(cp); - if (prev) throw error_placement(`leading ${prev}`); - let n = cps.length; - let last = -1; // prevents trailing from throwing - for (let i = 1; i < n; i++) { - cp = cps[i]; - let match = FENCED.get(cp); - if (match) { - // since cps[0] isn't fenced, cps[1] cannot throw - if (last == i) throw error_placement(`${prev} + ${match}`); - last = i + 1; - prev = match; - } - } - if (last == n) throw error_placement(`trailing ${prev}`); -} - -// create a safe to print string -// invisibles are escaped -// leading cm uses placeholder -// if cps exceed max, middle truncate with ellipsis -// quoter(cp) => string, eg. 3000 => "{3000}" -// note: in html, you'd call this function then replace [<>&] with entities -function safe_str_from_cps(cps, max = Infinity, quoter = quote_cp) { - //if (Number.isInteger(cps)) cps = [cps]; - //if (!Array.isArray(cps)) throw new TypeError(`expected codepoints`); - let buf = []; - if (is_combining_mark(cps[0])) buf.push('◌'); - if (cps.length > max) { - max >>= 1; - cps = [...cps.slice(0, max), 0x2026, ...cps.slice(-max)]; - } - let prev = 0; - let n = cps.length; - for (let i = 0; i < n; i++) { - let cp = cps[i]; - if (should_escape(cp)) { - buf.push(str_from_cps(cps.slice(prev, i))); - buf.push(quoter(cp)); - prev = i + 1; - } - } - buf.push(str_from_cps(cps.slice(prev, n))); - return buf.join(''); -} - -// note: set(s) cannot be exposed because they can be modified -// note: Object.freeze() doesn't work -function is_combining_mark(cp) { - init(); - return CM.has(cp); -} -function should_escape(cp) { - init(); - return ESCAPE.has(cp); -} - -function ens_normalize(name) { - return flatten(split(name, nfc, filter_fe0f)); -} - -function split(name, nf, ef) { - if (!name) return []; // 20230719: empty name allowance - init(); - let offset = 0; - // https://unicode.org/reports/tr46/#Validity_Criteria - // 4.) "The label must not contain a U+002E ( . ) FULL STOP." - return name.split(STOP_CH).map(label => { - let input = explode_cp(label); - let info = { - input, - offset, // codepoint, not substring! - }; - offset += input.length + 1; // + stop - try { - // 1.) "The label must be in Unicode Normalization Form NFC" - let tokens = info.tokens = tokens_from_str(input, nf, ef); - let token_count = tokens.length; - let type; - if (!token_count) { // the label was effectively empty (could of had ignored characters) - //norm = []; - //type = 'None'; // use this instead of next match, "ASCII" - // 20230120: change to strict - // https://discuss.ens.domains/t/ens-name-normalization-2nd/14564/59 - throw new Error(`empty label`); - } - let norm = info.output = tokens.flat(); - check_leading_underscore(norm); - let emoji = info.emoji = token_count > 1 || tokens[0].is_emoji; // same as: tokens.some(x => x.is_emoji); - if (!emoji && norm.every(cp => cp < 0x80)) { // special case for ascii - // 20230123: matches matches WHATWG, see note 3.3 - check_label_extension(norm); // only needed for ascii - // cant have fenced - // cant have cm - // cant have wholes - // see derive: "Fastpath ASCII" - type = 'ASCII'; - } else { - let chars = tokens.flatMap(x => x.is_emoji ? [] : x); // all of the nfc tokens concat together - if (!chars.length) { // theres no text, just emoji - type = 'Emoji'; - } else { - // 5.) "The label must not begin with a combining mark, that is: General_Category=Mark." - if (CM.has(norm[0])) throw error_placement('leading combining mark'); - for (let i = 1; i < token_count; i++) { // we've already checked the first token - let cps = tokens[i]; - if (!cps.is_emoji && CM.has(cps[0])) { // every text token has emoji neighbors, eg. EtEEEtEt... - // bidi_qq() not needed since emoji is LTR and cps is a CM - throw error_placement(`emoji + combining mark: "${str_from_cps(tokens[i-1])} + ${safe_str_from_cps([cps[0]])}"`); - } - } - check_fenced(norm); - let unique = Array_from(new Set(chars)); - let [g] = determine_group(unique); // take the first match - // see derive: "Matching Groups have Same CM Style" - // alternative: could form a hybrid type: Latin/Japanese/... - check_group(g, chars); // need text in order - check_whole(g, unique); // only need unique text (order would be required for multiple-char confusables) - type = g.N; - // 20230121: consider exposing restricted flag - // it's simpler to just check for 'Restricted' - // or even better: type.endsWith(']') - //if (g.R) info.restricted = true; - } - } - info.type = type; - } catch (err) { - info.error = err; // use full error object - } - return info; - }); -} - -function check_whole(group, unique) { - let maker; - let shared = []; - for (let cp of unique) { - let whole = WHOLE_MAP.get(cp); - if (whole === UNIQUE_PH) return; // unique, non-confusable - if (whole) { - let set = whole.M.get(cp); // groups which have a character that look-like this character - maker = maker ? maker.filter(g => set.has(g)) : Array_from(set); - if (!maker.length) return; // confusable intersection is empty - } else { - shared.push(cp); - } - } - if (maker) { - // we have 1+ confusable - // check if any of the remaining groups - // contain the shared characters too - for (let g of maker) { - if (shared.every(cp => group_has_cp(g, cp))) { - throw new Error(`whole-script confusable: ${group.N}/${g.N}`); - } - } - } -} - -// assumption: unique.size > 0 -// returns list of matching groups -function determine_group(unique) { - let groups = GROUPS; - for (let cp of unique) { - // note: we need to dodge CM that are whitelisted - // but that code isn't currently necessary - let gs = groups.filter(g => group_has_cp(g, cp)); - if (!gs.length) { - if (!GROUPS.some(g => group_has_cp(g, cp))) { - // the character was composed of valid parts - // but it's NFC form is invalid - // 20230716: change to more exact statement, see: ENSNormalize.{cs,java} - // note: this doesn't have to be a composition - // 20230720: change to full check - throw error_disallowed(cp); // this should be rare - } else { - // there is no group that contains all these characters - // throw using the highest priority group that matched - // https://www.unicode.org/reports/tr39/#mixed_script_confusables - throw error_group_member(groups[0], cp); - } - } - groups = gs; - if (gs.length == 1) break; // there is only one group left - } - // there are at least 1 group(s) with all of these characters - return groups; -} - -// throw on first error -function flatten(split) { - return split.map(({input, error, output}) => { - if (error) { - // don't print label again if just a single label - let msg = error.message; - // bidi_qq() only necessary if msg is digits - throw new Error(split.length == 1 ? msg : `Invalid label ${bidi_qq(safe_str_from_cps(input, 63))}: ${msg}`); - } - return str_from_cps(output); - }).join(STOP_CH); -} - -function error_disallowed(cp) { - // TODO: add cp to error? - return new Error(`disallowed character: ${quoted_cp(cp)}`); -} -function error_group_member(g, cp) { - let quoted = quoted_cp(cp); - let gg = GROUPS.find(g => g.P.has(cp)); // only check primary - if (gg) { - quoted = `${gg.N} ${quoted}`; - } - return new Error(`illegal mixture: ${g.N} + ${quoted}`); -} -function error_placement(where) { - return new Error(`illegal placement: ${where}`); -} - -// assumption: cps.length > 0 -// assumption: cps[0] isn't a CM -// assumption: the previous character isn't an emoji -function check_group(g, cps) { - for (let cp of cps) { - if (!group_has_cp(g, cp)) { - // for whitelisted scripts, this will throw illegal mixture on invalid cm, eg. "e{300}{300}" - // at the moment, it's unnecessary to introduce an extra error type - // until there exists a whitelisted multi-character - // eg. if (M < 0 && is_combining_mark(cp)) { ... } - // there are 3 cases: - // 1. illegal cm for wrong group => mixture error - // 2. illegal cm for same group => cm error - // requires set of whitelist cm per group: - // eg. new Set([...g.P, ...g.Q].flatMap(nfc).filter(cp => CM.has(cp))) - // 3. wrong group => mixture error - throw error_group_member(g, cp); - } - } - //if (M >= 0) { // we have a known fixed cm count - if (g.M) { // we need to check for NSM - let decomposed = nfd(cps); - for (let i = 1, e = decomposed.length; i < e; i++) { // see: assumption - // 20230210: bugfix: using cps instead of decomposed h/t Carbon225 - /* - if (CM.has(decomposed[i])) { - let j = i + 1; - while (j < e && CM.has(decomposed[j])) j++; - if (j - i > M) { - throw new Error(`too many combining marks: ${g.N} ${bidi_qq(str_from_cps(decomposed.slice(i-1, j)))} (${j-i}/${M})`); - } - i = j; - } - */ - // 20230217: switch to NSM counting - // https://www.unicode.org/reports/tr39/#Optional_Detection - if (NSM.has(decomposed[i])) { - let j = i + 1; - for (let cp; j < e && NSM.has(cp = decomposed[j]); j++) { - // a. Forbid sequences of the same nonspacing mark. - for (let k = i; k < j; k++) { // O(n^2) but n < 100 - if (decomposed[k] == cp) { - throw new Error(`duplicate non-spacing marks: ${quoted_cp(cp)}`); - } - } - } - // parse to end so we have full nsm count - // b. Forbid sequences of more than 4 nonspacing marks (gc=Mn or gc=Me). - if (j - i > NSM_MAX) { - // note: this slice starts with a base char or spacing-mark cm - throw new Error(`excessive non-spacing marks: ${bidi_qq(safe_str_from_cps(decomposed.slice(i-1, j)))} (${j-i}/${NSM_MAX})`); - } - i = j; - } - } - } - // *** this code currently isn't needed *** - /* - let cm_whitelist = M instanceof Map; - for (let i = 0, e = cps.length; i < e; ) { - let cp = cps[i++]; - let seqs = cm_whitelist && M.get(cp); - if (seqs) { - // list of codepoints that can follow - // if this exists, this will always be 1+ - let j = i; - while (j < e && CM.has(cps[j])) j++; - let cms = cps.slice(i, j); - let match = seqs.find(seq => !compare_arrays(seq, cms)); - if (!match) throw new Error(`disallowed combining mark sequence: "${safe_str_from_cps([cp, ...cms])}"`); - i = j; - } else if (!V.has(cp)) { - // https://www.unicode.org/reports/tr39/#mixed_script_confusables - let quoted = quoted_cp(cp); - for (let cp of cps) { - let u = UNIQUE.get(cp); - if (u && u !== g) { - // if both scripts are restricted this error is confusing - // because we don't differentiate RestrictedA from RestrictedB - if (!u.R) quoted = `${quoted} is ${u.N}`; - break; - } - } - throw new Error(`disallowed ${g.N} character: ${quoted}`); - //throw new Error(`disallowed character: ${quoted} (expected ${g.N})`); - //throw new Error(`${g.N} does not allow: ${quoted}`); - } - } - if (!cm_whitelist) { - let decomposed = nfd(cps); - for (let i = 1, e = decomposed.length; i < e; i++) { // we know it can't be cm leading - if (CM.has(decomposed[i])) { - let j = i + 1; - while (j < e && CM.has(decomposed[j])) j++; - if (j - i > M) { - throw new Error(`too many combining marks: "${str_from_cps(decomposed.slice(i-1, j))}" (${j-i}/${M})`); - } - i = j; - } - } - } - */ -} - -// given a list of codepoints -// returns a list of lists, where emoji are a fully-qualified (as Array subclass) -// eg. explode_cp("abc💩d") => [[61, 62, 63], Emoji[1F4A9, FE0F], [64]] -// 20230818: rename for 'process' name collision h/t Javarome -// https://github.com/adraffy/ens-normalize.js/issues/23 -function tokens_from_str(input, nf, ef) { - let ret = []; - let chars = []; - input = input.slice().reverse(); // flip so we can pop - while (input.length) { - let emoji = consume_emoji_reversed(input); - if (emoji) { - if (chars.length) { - ret.push(nf(chars)); - chars = []; - } - ret.push(ef(emoji)); - } else { - let cp = input.pop(); - if (VALID.has(cp)) { - chars.push(cp); - } else { - let cps = MAPPED.get(cp); - if (cps) { - chars.push(...cps); // less than 10 elements - } else if (!IGNORED.has(cp)) { - // 20230912: unicode 15.1 changed the order of processing such that - // disallowed parts are only rejected after NFC - // https://unicode.org/reports/tr46/#Validity_Criteria - // this doesn't impact normalization as of today - // technically, this error can be removed as the group logic will apply similar logic - // however the error type might be less clear - throw error_disallowed(cp); - } - } - } - } - if (chars.length) { - ret.push(nf(chars)); - } - return ret; -} - -function filter_fe0f(cps) { - return cps.filter(cp => cp != FE0F); -} - -// given array of codepoints -// returns the longest valid emoji sequence (or undefined if no match) -// *MUTATES* the supplied array -// disallows interleaved ignored characters -// fills (optional) eaten array with matched codepoints -function consume_emoji_reversed(cps, eaten) { - let node = EMOJI_ROOT; - let emoji; - let pos = cps.length; - while (pos) { - node = node.get(cps[--pos]); - if (!node) break; - let {V} = node; - if (V) { // this is a valid emoji (so far) - emoji = V; - cps.length = pos; // truncate - } - } - return emoji; -} - -const Zeros = new Uint8Array(32); -Zeros.fill(0); -function checkComponent(comp) { - assertArgument(comp.length !== 0, "invalid ENS name; empty component", "comp", comp); - return comp; -} -function ensNameSplit(name) { - const bytes = toUtf8Bytes(ensNormalize(name)); - const comps = []; - if (name.length === 0) { - return comps; - } - let last = 0; - for (let i = 0; i < bytes.length; i++) { - const d = bytes[i]; - // A separator (i.e. "."); copy this component - if (d === 0x2e) { - comps.push(checkComponent(bytes.slice(last, i))); - last = i + 1; - } - } - // There was a stray separator at the end of the name - assertArgument(last < bytes.length, "invalid ENS name; empty component", "name", name); - comps.push(checkComponent(bytes.slice(last))); - return comps; -} -/** - * Returns the ENS %%name%% normalized. - */ -function ensNormalize(name) { - try { - if (name.length === 0) { - throw new Error("empty label"); - } - return ens_normalize(name); - } - catch (error) { - assertArgument(false, `invalid ENS name (${error.message})`, "name", name); - } -} -/** - * Returns ``true`` if %%name%% is a valid ENS name. - */ -function isValidName(name) { - try { - return (ensNameSplit(name).length !== 0); - } - catch (error) { } - return false; -} -/** - * Returns the [[link-namehash]] for %%name%%. - */ -function namehash(name) { - assertArgument(typeof (name) === "string", "invalid ENS name; not a string", "name", name); - assertArgument(name.length, `invalid ENS name (empty label)`, "name", name); - let result = Zeros; - const comps = ensNameSplit(name); - while (comps.length) { - result = keccak256(concat([result, keccak256((comps.pop()))])); - } - return hexlify(result); -} -/** - * Returns the DNS encoded %%name%%. - * - * This is used for various parts of ENS name resolution, such - * as the wildcard resolution. - */ -function dnsEncode(name, _maxLength) { - const length = (_maxLength != null) ? _maxLength : 63; - assertArgument(length <= 255, "DNS encoded label cannot exceed 255", "length", length); - return hexlify(concat(ensNameSplit(name).map((comp) => { - assertArgument(comp.length <= length, `label ${JSON.stringify(name)} exceeds ${length} bytes`, "name", name); - const bytes = new Uint8Array(comp.length + 1); - bytes.set(comp, 1); - bytes[0] = bytes.length - 1; - return bytes; - }))) + "00"; -} - -/** - * Computes the [[link-eip-191]] personal-sign message digest to sign. - * - * This prefixes the message with [[MessagePrefix]] and the decimal length - * of %%message%% and computes the [[keccak256]] digest. - * - * If %%message%% is a string, it is converted to its UTF-8 bytes - * first. To compute the digest of a [[DataHexString]], it must be converted - * to [bytes](getBytes). - * - * @example: - * hashMessage("Hello World") - * //_result: - * - * // Hashes the SIX (6) string characters, i.e. - * // [ "0", "x", "4", "2", "4", "3" ] - * hashMessage("0x4243") - * //_result: - * - * // Hashes the TWO (2) bytes [ 0x42, 0x43 ]... - * hashMessage(getBytes("0x4243")) - * //_result: - * - * // ...which is equal to using data - * hashMessage(new Uint8Array([ 0x42, 0x43 ])) - * //_result: - * - */ -function hashMessage(message) { - if (typeof (message) === "string") { - message = toUtf8Bytes(message); - } - return keccak256(concat([ - toUtf8Bytes(MessagePrefix), - toUtf8Bytes(String(message.length)), - message - ])); -} -/** - * Return the address of the private key that produced - * the signature %%sig%% during signing for %%message%%. - */ -function verifyMessage(message, sig) { - const digest = hashMessage(message); - return recoverAddress(digest, sig); -} - -const regexBytes = new RegExp("^bytes([0-9]+)$"); -const regexNumber = new RegExp("^(u?int)([0-9]*)$"); -const regexArray = new RegExp("^(.*)\\[([0-9]*)\\]$"); -function _pack(type, value, isArray) { - switch (type) { - case "address": - if (isArray) { - return getBytes(zeroPadValue(value, 32)); - } - return getBytes(getAddress(value)); - case "string": - return toUtf8Bytes(value); - case "bytes": - return getBytes(value); - case "bool": - value = (!!value ? "0x01" : "0x00"); - if (isArray) { - return getBytes(zeroPadValue(value, 32)); - } - return getBytes(value); - } - let match = type.match(regexNumber); - if (match) { - let signed = (match[1] === "int"); - let size = parseInt(match[2] || "256"); - assertArgument((!match[2] || match[2] === String(size)) && (size % 8 === 0) && size !== 0 && size <= 256, "invalid number type", "type", type); - if (isArray) { - size = 256; - } - if (signed) { - value = toTwos(value, size); - } - return getBytes(zeroPadValue(toBeArray(value), size / 8)); - } - match = type.match(regexBytes); - if (match) { - const size = parseInt(match[1]); - assertArgument(String(size) === match[1] && size !== 0 && size <= 32, "invalid bytes type", "type", type); - assertArgument(dataLength(value) === size, `invalid value for ${type}`, "value", value); - if (isArray) { - return getBytes(zeroPadBytes(value, 32)); - } - return value; - } - match = type.match(regexArray); - if (match && Array.isArray(value)) { - const baseType = match[1]; - const count = parseInt(match[2] || String(value.length)); - assertArgument(count === value.length, `invalid array length for ${type}`, "value", value); - const result = []; - value.forEach(function (value) { - result.push(_pack(baseType, value, true)); - }); - return getBytes(concat(result)); - } - assertArgument(false, "invalid type", "type", type); -} -// @TODO: Array Enum -/** - * Computes the [[link-solc-packed]] representation of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPacked([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ -function solidityPacked(types, values) { - assertArgument(types.length === values.length, "wrong number of values; expected ${ types.length }", "values", values); - const tight = []; - types.forEach(function (type, index) { - tight.push(_pack(type, values[index])); - }); - return hexlify(concat(tight)); -} -/** - * Computes the [[link-solc-packed]] [[keccak256]] hash of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPackedKeccak256([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ -function solidityPackedKeccak256(types, values) { - return keccak256(solidityPacked(types, values)); -} -/** - * Computes the [[link-solc-packed]] [[sha256]] hash of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPackedSha256([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ -function solidityPackedSha256(types, values) { - return sha256(solidityPacked(types, values)); -} - -//import { TypedDataDomain, TypedDataField } from "@ethersproject/providerabstract-signer"; -const padding = new Uint8Array(32); -padding.fill(0); -const BN__1 = BigInt(-1); -const BN_0$3 = BigInt(0); -const BN_1$1 = BigInt(1); -const BN_MAX_UINT256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); -function hexPadRight(value) { - const bytes = getBytes(value); - const padOffset = bytes.length % 32; - if (padOffset) { - return concat([bytes, padding.slice(padOffset)]); - } - return hexlify(bytes); -} -const hexTrue = toBeHex(BN_1$1, 32); -const hexFalse = toBeHex(BN_0$3, 32); -const domainFieldTypes = { - name: "string", - version: "string", - chainId: "uint256", - verifyingContract: "address", - salt: "bytes32" -}; -const domainFieldNames = [ - "name", "version", "chainId", "verifyingContract", "salt" -]; -function checkString(key) { - return function (value) { - assertArgument(typeof (value) === "string", `invalid domain value for ${JSON.stringify(key)}`, `domain.${key}`, value); - return value; - }; -} -const domainChecks = { - name: checkString("name"), - version: checkString("version"), - chainId: function (_value) { - const value = getBigInt(_value, "domain.chainId"); - assertArgument(value >= 0, "invalid chain ID", "domain.chainId", _value); - if (Number.isSafeInteger(value)) { - return Number(value); - } - return toQuantity(value); - }, - verifyingContract: function (value) { - try { - return getAddress(value).toLowerCase(); - } - catch (error) { } - assertArgument(false, `invalid domain value "verifyingContract"`, "domain.verifyingContract", value); - }, - salt: function (value) { - const bytes = getBytes(value, "domain.salt"); - assertArgument(bytes.length === 32, `invalid domain value "salt"`, "domain.salt", value); - return hexlify(bytes); - } -}; -function getBaseEncoder(type) { - // intXX and uintXX - { - const match = type.match(/^(u?)int(\d+)$/); - if (match) { - const signed = (match[1] === ""); - const width = parseInt(match[2]); - assertArgument(width % 8 === 0 && width !== 0 && width <= 256 && match[2] === String(width), "invalid numeric width", "type", type); - const boundsUpper = mask(BN_MAX_UINT256, signed ? (width - 1) : width); - const boundsLower = signed ? ((boundsUpper + BN_1$1) * BN__1) : BN_0$3; - return function (_value) { - const value = getBigInt(_value, "value"); - assertArgument(value >= boundsLower && value <= boundsUpper, `value out-of-bounds for ${type}`, "value", value); - return toBeHex(signed ? toTwos(value, 256) : value, 32); - }; - } - } - // bytesXX - { - const match = type.match(/^bytes(\d+)$/); - if (match) { - const width = parseInt(match[1]); - assertArgument(width !== 0 && width <= 32 && match[1] === String(width), "invalid bytes width", "type", type); - return function (value) { - const bytes = getBytes(value); - assertArgument(bytes.length === width, `invalid length for ${type}`, "value", value); - return hexPadRight(value); - }; - } - } - switch (type) { - case "address": return function (value) { - return zeroPadValue(getAddress(value), 32); - }; - case "bool": return function (value) { - return ((!value) ? hexFalse : hexTrue); - }; - case "bytes": return function (value) { - return keccak256(value); - }; - case "string": return function (value) { - return id(value); - }; - } - return null; -} -function encodeType(name, fields) { - return `${name}(${fields.map(({ name, type }) => (type + " " + name)).join(",")})`; -} -// foo[][3] => { base: "foo", index: "[][3]", array: { -// base: "foo", prefix: "foo[]", count: 3 } } -function splitArray(type) { - const match = type.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/); - if (match) { - return { - base: match[1], - index: (match[2] + match[4]), - array: { - base: match[1], - prefix: (match[1] + match[2]), - count: (match[5] ? parseInt(match[5]) : -1), - } - }; - } - return { base: type }; -} -/** - * A **TypedDataEncode** prepares and encodes [[link-eip-712]] payloads - * for signed typed data. - * - * This is useful for those that wish to compute various components of a - * typed data hash, primary types, or sub-components, but generally the - * higher level [[Signer-signTypedData]] is more useful. - */ -class TypedDataEncoder { - /** - * The primary type for the structured [[types]]. - * - * This is derived automatically from the [[types]], since no - * recursion is possible, once the DAG for the types is consturcted - * internally, the primary type must be the only remaining type with - * no parent nodes. - */ - primaryType; - #types; - /** - * The types. - */ - get types() { - return JSON.parse(this.#types); - } - #fullTypes; - #encoderCache; - /** - * Create a new **TypedDataEncoder** for %%types%%. - * - * This performs all necessary checking that types are valid and - * do not violate the [[link-eip-712]] structural constraints as - * well as computes the [[primaryType]]. - */ - constructor(_types) { - this.#fullTypes = new Map(); - this.#encoderCache = new Map(); - // Link struct types to their direct child structs - const links = new Map(); - // Link structs to structs which contain them as a child - const parents = new Map(); - // Link all subtypes within a given struct - const subtypes = new Map(); - const types = {}; - Object.keys(_types).forEach((type) => { - types[type] = _types[type].map(({ name, type }) => { - // Normalize the base type (unless name conflict) - let { base, index } = splitArray(type); - if (base === "int" && !_types["int"]) { - base = "int256"; - } - if (base === "uint" && !_types["uint"]) { - base = "uint256"; - } - return { name, type: (base + (index || "")) }; - }); - links.set(type, new Set()); - parents.set(type, []); - subtypes.set(type, new Set()); - }); - this.#types = JSON.stringify(types); - for (const name in types) { - const uniqueNames = new Set(); - for (const field of types[name]) { - // Check each field has a unique name - assertArgument(!uniqueNames.has(field.name), `duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`, "types", _types); - uniqueNames.add(field.name); - // Get the base type (drop any array specifiers) - const baseType = splitArray(field.type).base; - assertArgument(baseType !== name, `circular type reference to ${JSON.stringify(baseType)}`, "types", _types); - // Is this a base encoding type? - const encoder = getBaseEncoder(baseType); - if (encoder) { - continue; - } - assertArgument(parents.has(baseType), `unknown type ${JSON.stringify(baseType)}`, "types", _types); - // Add linkage - parents.get(baseType).push(name); - links.get(name).add(baseType); - } - } - // Deduce the primary type - const primaryTypes = Array.from(parents.keys()).filter((n) => (parents.get(n).length === 0)); - assertArgument(primaryTypes.length !== 0, "missing primary type", "types", _types); - assertArgument(primaryTypes.length === 1, `ambiguous primary types or unused types: ${primaryTypes.map((t) => (JSON.stringify(t))).join(", ")}`, "types", _types); - defineProperties(this, { primaryType: primaryTypes[0] }); - // Check for circular type references - function checkCircular(type, found) { - assertArgument(!found.has(type), `circular type reference to ${JSON.stringify(type)}`, "types", _types); - found.add(type); - for (const child of links.get(type)) { - if (!parents.has(child)) { - continue; - } - // Recursively check children - checkCircular(child, found); - // Mark all ancestors as having this decendant - for (const subtype of found) { - subtypes.get(subtype).add(child); - } - } - found.delete(type); - } - checkCircular(this.primaryType, new Set()); - // Compute each fully describe type - for (const [name, set] of subtypes) { - const st = Array.from(set); - st.sort(); - this.#fullTypes.set(name, encodeType(name, types[name]) + st.map((t) => encodeType(t, types[t])).join("")); - } - } - /** - * Returnthe encoder for the specific %%type%%. - */ - getEncoder(type) { - let encoder = this.#encoderCache.get(type); - if (!encoder) { - encoder = this.#getEncoder(type); - this.#encoderCache.set(type, encoder); - } - return encoder; - } - #getEncoder(type) { - // Basic encoder type (address, bool, uint256, etc) - { - const encoder = getBaseEncoder(type); - if (encoder) { - return encoder; - } - } - // Array - const array = splitArray(type).array; - if (array) { - const subtype = array.prefix; - const subEncoder = this.getEncoder(subtype); - return (value) => { - assertArgument(array.count === -1 || array.count === value.length, `array length mismatch; expected length ${array.count}`, "value", value); - let result = value.map(subEncoder); - if (this.#fullTypes.has(subtype)) { - result = result.map(keccak256); - } - return keccak256(concat(result)); - }; - } - // Struct - const fields = this.types[type]; - if (fields) { - const encodedType = id(this.#fullTypes.get(type)); - return (value) => { - const values = fields.map(({ name, type }) => { - const result = this.getEncoder(type)(value[name]); - if (this.#fullTypes.has(type)) { - return keccak256(result); - } - return result; - }); - values.unshift(encodedType); - return concat(values); - }; - } - assertArgument(false, `unknown type: ${type}`, "type", type); - } - /** - * Return the full type for %%name%%. - */ - encodeType(name) { - const result = this.#fullTypes.get(name); - assertArgument(result, `unknown type: ${JSON.stringify(name)}`, "name", name); - return result; - } - /** - * Return the encoded %%value%% for the %%type%%. - */ - encodeData(type, value) { - return this.getEncoder(type)(value); - } - /** - * Returns the hash of %%value%% for the type of %%name%%. - */ - hashStruct(name, value) { - return keccak256(this.encodeData(name, value)); - } - /** - * Return the fulled encoded %%value%% for the [[types]]. - */ - encode(value) { - return this.encodeData(this.primaryType, value); - } - /** - * Return the hash of the fully encoded %%value%% for the [[types]]. - */ - hash(value) { - return this.hashStruct(this.primaryType, value); - } - /** - * @_ignore: - */ - _visit(type, value, callback) { - // Basic encoder type (address, bool, uint256, etc) - { - const encoder = getBaseEncoder(type); - if (encoder) { - return callback(type, value); - } - } - // Array - const array = splitArray(type).array; - if (array) { - assertArgument(array.count === -1 || array.count === value.length, `array length mismatch; expected length ${array.count}`, "value", value); - return value.map((v) => this._visit(array.prefix, v, callback)); - } - // Struct - const fields = this.types[type]; - if (fields) { - return fields.reduce((accum, { name, type }) => { - accum[name] = this._visit(type, value[name], callback); - return accum; - }, {}); - } - assertArgument(false, `unknown type: ${type}`, "type", type); - } - /** - * Call %%calback%% for each value in %%value%%, passing the type and - * component within %%value%%. - * - * This is useful for replacing addresses or other transformation that - * may be desired on each component, based on its type. - */ - visit(value, callback) { - return this._visit(this.primaryType, value, callback); - } - /** - * Create a new **TypedDataEncoder** for %%types%%. - */ - static from(types) { - return new TypedDataEncoder(types); - } - /** - * Return the primary type for %%types%%. - */ - static getPrimaryType(types) { - return TypedDataEncoder.from(types).primaryType; - } - /** - * Return the hashed struct for %%value%% using %%types%% and %%name%%. - */ - static hashStruct(name, types, value) { - return TypedDataEncoder.from(types).hashStruct(name, value); - } - /** - * Return the domain hash for %%domain%%. - */ - static hashDomain(domain) { - const domainFields = []; - for (const name in domain) { - if (domain[name] == null) { - continue; - } - const type = domainFieldTypes[name]; - assertArgument(type, `invalid typed-data domain key: ${JSON.stringify(name)}`, "domain", domain); - domainFields.push({ name, type }); - } - domainFields.sort((a, b) => { - return domainFieldNames.indexOf(a.name) - domainFieldNames.indexOf(b.name); - }); - return TypedDataEncoder.hashStruct("EIP712Domain", { EIP712Domain: domainFields }, domain); - } - /** - * Return the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%. - */ - static encode(domain, types, value) { - return concat([ - "0x1901", - TypedDataEncoder.hashDomain(domain), - TypedDataEncoder.from(types).hash(value) - ]); - } - /** - * Return the hash of the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%. - */ - static hash(domain, types, value) { - return keccak256(TypedDataEncoder.encode(domain, types, value)); - } - // Replaces all address types with ENS names with their looked up address - /** - * Resolves to the value from resolving all addresses in %%value%% for - * %%types%% and the %%domain%%. - */ - static async resolveNames(domain, types, value, resolveName) { - // Make a copy to isolate it from the object passed in - domain = Object.assign({}, domain); - // Allow passing null to ignore value - for (const key in domain) { - if (domain[key] == null) { - delete domain[key]; - } - } - // Look up all ENS names - const ensCache = {}; - // Do we need to look up the domain's verifyingContract? - if (domain.verifyingContract && !isHexString(domain.verifyingContract, 20)) { - ensCache[domain.verifyingContract] = "0x"; - } - // We are going to use the encoder to visit all the base values - const encoder = TypedDataEncoder.from(types); - // Get a list of all the addresses - encoder.visit(value, (type, value) => { - if (type === "address" && !isHexString(value, 20)) { - ensCache[value] = "0x"; - } - return value; - }); - // Lookup each name - for (const name in ensCache) { - ensCache[name] = await resolveName(name); - } - // Replace the domain verifyingContract if needed - if (domain.verifyingContract && ensCache[domain.verifyingContract]) { - domain.verifyingContract = ensCache[domain.verifyingContract]; - } - // Replace all ENS names with their address - value = encoder.visit(value, (type, value) => { - if (type === "address" && ensCache[value]) { - return ensCache[value]; - } - return value; - }); - return { domain, value }; - } - /** - * Returns the JSON-encoded payload expected by nodes which implement - * the JSON-RPC [[link-eip-712]] method. - */ - static getPayload(domain, types, value) { - // Validate the domain fields - TypedDataEncoder.hashDomain(domain); - // Derive the EIP712Domain Struct reference type - const domainValues = {}; - const domainTypes = []; - domainFieldNames.forEach((name) => { - const value = domain[name]; - if (value == null) { - return; - } - domainValues[name] = domainChecks[name](value); - domainTypes.push({ name, type: domainFieldTypes[name] }); - }); - const encoder = TypedDataEncoder.from(types); - // Get the normalized types - types = encoder.types; - const typesWithDomain = Object.assign({}, types); - assertArgument(typesWithDomain.EIP712Domain == null, "types must not contain EIP712Domain type", "types.EIP712Domain", types); - typesWithDomain.EIP712Domain = domainTypes; - // Validate the data structures and types - encoder.encode(value); - return { - types: typesWithDomain, - domain: domainValues, - primaryType: encoder.primaryType, - message: encoder.visit(value, (type, value) => { - // bytes - if (type.match(/^bytes(\d*)/)) { - return hexlify(getBytes(value)); - } - // uint or int - if (type.match(/^u?int/)) { - return getBigInt(value).toString(); - } - switch (type) { - case "address": - return value.toLowerCase(); - case "bool": - return !!value; - case "string": - assertArgument(typeof (value) === "string", "invalid string", "value", value); - return value; - } - assertArgument(false, "unsupported type", "type", type); - }) - }; - } -} -/** - * Compute the address used to sign the typed data for the %%signature%%. - */ -function verifyTypedData(domain, types, value, signature) { - return recoverAddress(TypedDataEncoder.hash(domain, types, value), signature); -} - -/** - * A fragment is a single item from an ABI, which may represent any of: - * - * - [Functions](FunctionFragment) - * - [Events](EventFragment) - * - [Constructors](ConstructorFragment) - * - Custom [Errors](ErrorFragment) - * - [Fallback or Receive](FallbackFragment) functions - * - * @_subsection api/abi/abi-coder:Fragments [about-fragments] - */ -// [ "a", "b" ] => { "a": 1, "b": 1 } -function setify(items) { - const result = new Set(); - items.forEach((k) => result.add(k)); - return Object.freeze(result); -} -const _kwVisibDeploy = "external public payable override"; -const KwVisibDeploy = setify(_kwVisibDeploy.split(" ")); -// Visibility Keywords -const _kwVisib = "constant external internal payable private public pure view override"; -const KwVisib = setify(_kwVisib.split(" ")); -const _kwTypes = "constructor error event fallback function receive struct"; -const KwTypes = setify(_kwTypes.split(" ")); -const _kwModifiers = "calldata memory storage payable indexed"; -const KwModifiers = setify(_kwModifiers.split(" ")); -const _kwOther = "tuple returns"; -// All Keywords -const _keywords = [_kwTypes, _kwModifiers, _kwOther, _kwVisib].join(" "); -const Keywords = setify(_keywords.split(" ")); -// Single character tokens -const SimpleTokens = { - "(": "OPEN_PAREN", ")": "CLOSE_PAREN", - "[": "OPEN_BRACKET", "]": "CLOSE_BRACKET", - ",": "COMMA", "@": "AT" -}; -// Parser regexes to consume the next token -const regexWhitespacePrefix = new RegExp("^(\\s*)"); -const regexNumberPrefix = new RegExp("^([0-9]+)"); -const regexIdPrefix = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"); -// Parser regexs to check validity -const regexId = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"); -const regexType = new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$"); -class TokenString { - #offset; - #tokens; - get offset() { return this.#offset; } - get length() { return this.#tokens.length - this.#offset; } - constructor(tokens) { - this.#offset = 0; - this.#tokens = tokens.slice(); - } - clone() { return new TokenString(this.#tokens); } - reset() { this.#offset = 0; } - #subTokenString(from = 0, to = 0) { - return new TokenString(this.#tokens.slice(from, to).map((t) => { - return Object.freeze(Object.assign({}, t, { - match: (t.match - from), - linkBack: (t.linkBack - from), - linkNext: (t.linkNext - from), - })); - })); - } - // Pops and returns the value of the next token, if it is a keyword in allowed; throws if out of tokens - popKeyword(allowed) { - const top = this.peek(); - if (top.type !== "KEYWORD" || !allowed.has(top.text)) { - throw new Error(`expected keyword ${top.text}`); - } - return this.pop().text; - } - // Pops and returns the value of the next token if it is `type`; throws if out of tokens - popType(type) { - if (this.peek().type !== type) { - const top = this.peek(); - throw new Error(`expected ${type}; got ${top.type} ${JSON.stringify(top.text)}`); - } - return this.pop().text; - } - // Pops and returns a "(" TOKENS ")" - popParen() { - const top = this.peek(); - if (top.type !== "OPEN_PAREN") { - throw new Error("bad start"); - } - const result = this.#subTokenString(this.#offset + 1, top.match + 1); - this.#offset = top.match + 1; - return result; - } - // Pops and returns the items within "(" ITEM1 "," ITEM2 "," ... ")" - popParams() { - const top = this.peek(); - if (top.type !== "OPEN_PAREN") { - throw new Error("bad start"); - } - const result = []; - while (this.#offset < top.match - 1) { - const link = this.peek().linkNext; - result.push(this.#subTokenString(this.#offset + 1, link)); - this.#offset = link; - } - this.#offset = top.match + 1; - return result; - } - // Returns the top Token, throwing if out of tokens - peek() { - if (this.#offset >= this.#tokens.length) { - throw new Error("out-of-bounds"); - } - return this.#tokens[this.#offset]; - } - // Returns the next value, if it is a keyword in `allowed` - peekKeyword(allowed) { - const top = this.peekType("KEYWORD"); - return (top != null && allowed.has(top)) ? top : null; - } - // Returns the value of the next token if it is `type` - peekType(type) { - if (this.length === 0) { - return null; - } - const top = this.peek(); - return (top.type === type) ? top.text : null; - } - // Returns the next token; throws if out of tokens - pop() { - const result = this.peek(); - this.#offset++; - return result; - } - toString() { - const tokens = []; - for (let i = this.#offset; i < this.#tokens.length; i++) { - const token = this.#tokens[i]; - tokens.push(`${token.type}:${token.text}`); - } - return ``; - } -} -function lex(text) { - const tokens = []; - const throwError = (message) => { - const token = (offset < text.length) ? JSON.stringify(text[offset]) : "$EOI"; - throw new Error(`invalid token ${token} at ${offset}: ${message}`); - }; - let brackets = []; - let commas = []; - let offset = 0; - while (offset < text.length) { - // Strip off any leading whitespace - let cur = text.substring(offset); - let match = cur.match(regexWhitespacePrefix); - if (match) { - offset += match[1].length; - cur = text.substring(offset); - } - const token = { depth: brackets.length, linkBack: -1, linkNext: -1, match: -1, type: "", text: "", offset, value: -1 }; - tokens.push(token); - let type = (SimpleTokens[cur[0]] || ""); - if (type) { - token.type = type; - token.text = cur[0]; - offset++; - if (type === "OPEN_PAREN") { - brackets.push(tokens.length - 1); - commas.push(tokens.length - 1); - } - else if (type == "CLOSE_PAREN") { - if (brackets.length === 0) { - throwError("no matching open bracket"); - } - token.match = brackets.pop(); - (tokens[token.match]).match = tokens.length - 1; - token.depth--; - token.linkBack = commas.pop(); - (tokens[token.linkBack]).linkNext = tokens.length - 1; - } - else if (type === "COMMA") { - token.linkBack = commas.pop(); - (tokens[token.linkBack]).linkNext = tokens.length - 1; - commas.push(tokens.length - 1); - } - else if (type === "OPEN_BRACKET") { - token.type = "BRACKET"; - } - else if (type === "CLOSE_BRACKET") { - // Remove the CLOSE_BRACKET - let suffix = tokens.pop().text; - if (tokens.length > 0 && tokens[tokens.length - 1].type === "NUMBER") { - const value = tokens.pop().text; - suffix = value + suffix; - (tokens[tokens.length - 1]).value = getNumber(value); - } - if (tokens.length === 0 || tokens[tokens.length - 1].type !== "BRACKET") { - throw new Error("missing opening bracket"); - } - (tokens[tokens.length - 1]).text += suffix; - } - continue; - } - match = cur.match(regexIdPrefix); - if (match) { - token.text = match[1]; - offset += token.text.length; - if (Keywords.has(token.text)) { - token.type = "KEYWORD"; - continue; - } - if (token.text.match(regexType)) { - token.type = "TYPE"; - continue; - } - token.type = "ID"; - continue; - } - match = cur.match(regexNumberPrefix); - if (match) { - token.text = match[1]; - token.type = "NUMBER"; - offset += token.text.length; - continue; - } - throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset}`); - } - return new TokenString(tokens.map((t) => Object.freeze(t))); -} -// Check only one of `allowed` is in `set` -function allowSingle(set, allowed) { - let included = []; - for (const key in allowed.keys()) { - if (set.has(key)) { - included.push(key); - } - } - if (included.length > 1) { - throw new Error(`conflicting types: ${included.join(", ")}`); - } -} -// Functions to process a Solidity Signature TokenString from left-to-right for... -// ...the name with an optional type, returning the name -function consumeName(type, tokens) { - if (tokens.peekKeyword(KwTypes)) { - const keyword = tokens.pop().text; - if (keyword !== type) { - throw new Error(`expected ${type}, got ${keyword}`); - } - } - return tokens.popType("ID"); -} -// ...all keywords matching allowed, returning the keywords -function consumeKeywords(tokens, allowed) { - const keywords = new Set(); - while (true) { - const keyword = tokens.peekType("KEYWORD"); - if (keyword == null || (allowed && !allowed.has(keyword))) { - break; - } - tokens.pop(); - if (keywords.has(keyword)) { - throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`); - } - keywords.add(keyword); - } - return Object.freeze(keywords); -} -// ...all visibility keywords, returning the coalesced mutability -function consumeMutability(tokens) { - let modifiers = consumeKeywords(tokens, KwVisib); - // Detect conflicting modifiers - allowSingle(modifiers, setify("constant payable nonpayable".split(" "))); - allowSingle(modifiers, setify("pure view payable nonpayable".split(" "))); - // Process mutability states - if (modifiers.has("view")) { - return "view"; - } - if (modifiers.has("pure")) { - return "pure"; - } - if (modifiers.has("payable")) { - return "payable"; - } - if (modifiers.has("nonpayable")) { - return "nonpayable"; - } - // Process legacy `constant` last - if (modifiers.has("constant")) { - return "view"; - } - return "nonpayable"; -} -// ...a parameter list, returning the ParamType list -function consumeParams(tokens, allowIndexed) { - return tokens.popParams().map((t) => ParamType.from(t, allowIndexed)); -} -// ...a gas limit, returning a BigNumber or null if none -function consumeGas(tokens) { - if (tokens.peekType("AT")) { - tokens.pop(); - if (tokens.peekType("NUMBER")) { - return getBigInt(tokens.pop().text); - } - throw new Error("invalid gas"); - } - return null; -} -function consumeEoi(tokens) { - if (tokens.length) { - throw new Error(`unexpected tokens at offset ${tokens.offset}: ${tokens.toString()}`); - } -} -const regexArrayType = new RegExp(/^(.*)\[([0-9]*)\]$/); -function verifyBasicType(type) { - const match = type.match(regexType); - assertArgument(match, "invalid type", "type", type); - if (type === "uint") { - return "uint256"; - } - if (type === "int") { - return "int256"; - } - if (match[2]) { - // bytesXX - const length = parseInt(match[2]); - assertArgument(length !== 0 && length <= 32, "invalid bytes length", "type", type); - } - else if (match[3]) { - // intXX or uintXX - const size = parseInt(match[3]); - assertArgument(size !== 0 && size <= 256 && (size % 8) === 0, "invalid numeric width", "type", type); - } - return type; -} -// Make the Fragment constructors effectively private -const _guard$2 = {}; -const internal$1 = Symbol.for("_ethers_internal"); -const ParamTypeInternal = "_ParamTypeInternal"; -const ErrorFragmentInternal = "_ErrorInternal"; -const EventFragmentInternal = "_EventInternal"; -const ConstructorFragmentInternal = "_ConstructorInternal"; -const FallbackFragmentInternal = "_FallbackInternal"; -const FunctionFragmentInternal = "_FunctionInternal"; -const StructFragmentInternal = "_StructInternal"; -/** - * Each input and output of a [[Fragment]] is an Array of **ParamType**. - */ -class ParamType { - /** - * The local name of the parameter (or ``""`` if unbound) - */ - name; - /** - * The fully qualified type (e.g. ``"address"``, ``"tuple(address)"``, - * ``"uint256[3][]"``) - */ - type; - /** - * The base type (e.g. ``"address"``, ``"tuple"``, ``"array"``) - */ - baseType; - /** - * True if the parameters is indexed. - * - * For non-indexable types this is ``null``. - */ - indexed; - /** - * The components for the tuple. - * - * For non-tuple types this is ``null``. - */ - components; - /** - * The array length, or ``-1`` for dynamic-lengthed arrays. - * - * For non-array types this is ``null``. - */ - arrayLength; - /** - * The type of each child in the array. - * - * For non-array types this is ``null``. - */ - arrayChildren; - /** - * @private - */ - constructor(guard, name, type, baseType, indexed, components, arrayLength, arrayChildren) { - assertPrivate(guard, _guard$2, "ParamType"); - Object.defineProperty(this, internal$1, { value: ParamTypeInternal }); - if (components) { - components = Object.freeze(components.slice()); - } - if (baseType === "array") { - if (arrayLength == null || arrayChildren == null) { - throw new Error(""); - } - } - else if (arrayLength != null || arrayChildren != null) { - throw new Error(""); - } - if (baseType === "tuple") { - if (components == null) { - throw new Error(""); - } - } - else if (components != null) { - throw new Error(""); - } - defineProperties(this, { - name, type, baseType, indexed, components, arrayLength, arrayChildren - }); - } - /** - * Return a string representation of this type. - * - * For example, - * - * ``sighash" => "(uint256,address)"`` - * - * ``"minimal" => "tuple(uint256,address) indexed"`` - * - * ``"full" => "tuple(uint256 foo, address bar) indexed baz"`` - */ - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - const name = this.name || ""; - if (this.isArray()) { - const result = JSON.parse(this.arrayChildren.format("json")); - result.name = name; - result.type += `[${(this.arrayLength < 0 ? "" : String(this.arrayLength))}]`; - return JSON.stringify(result); - } - const result = { - type: ((this.baseType === "tuple") ? "tuple" : this.type), - name - }; - if (typeof (this.indexed) === "boolean") { - result.indexed = this.indexed; - } - if (this.isTuple()) { - result.components = this.components.map((c) => JSON.parse(c.format(format))); - } - return JSON.stringify(result); - } - let result = ""; - // Array - if (this.isArray()) { - result += this.arrayChildren.format(format); - result += `[${(this.arrayLength < 0 ? "" : String(this.arrayLength))}]`; - } - else { - if (this.isTuple()) { - result += "(" + this.components.map((comp) => comp.format(format)).join((format === "full") ? ", " : ",") + ")"; - } - else { - result += this.type; - } - } - if (format !== "sighash") { - if (this.indexed === true) { - result += " indexed"; - } - if (format === "full" && this.name) { - result += " " + this.name; - } - } - return result; - } - /** - * Returns true if %%this%% is an Array type. - * - * This provides a type gaurd ensuring that [[arrayChildren]] - * and [[arrayLength]] are non-null. - */ - isArray() { - return (this.baseType === "array"); - } - /** - * Returns true if %%this%% is a Tuple type. - * - * This provides a type gaurd ensuring that [[components]] - * is non-null. - */ - isTuple() { - return (this.baseType === "tuple"); - } - /** - * Returns true if %%this%% is an Indexable type. - * - * This provides a type gaurd ensuring that [[indexed]] - * is non-null. - */ - isIndexable() { - return (this.indexed != null); - } - /** - * Walks the **ParamType** with %%value%%, calling %%process%% - * on each type, destructing the %%value%% recursively. - */ - walk(value, process) { - if (this.isArray()) { - if (!Array.isArray(value)) { - throw new Error("invalid array value"); - } - if (this.arrayLength !== -1 && value.length !== this.arrayLength) { - throw new Error("array is wrong length"); - } - const _this = this; - return value.map((v) => (_this.arrayChildren.walk(v, process))); - } - if (this.isTuple()) { - if (!Array.isArray(value)) { - throw new Error("invalid tuple value"); - } - if (value.length !== this.components.length) { - throw new Error("array is wrong length"); - } - const _this = this; - return value.map((v, i) => (_this.components[i].walk(v, process))); - } - return process(this.type, value); - } - #walkAsync(promises, value, process, setValue) { - if (this.isArray()) { - if (!Array.isArray(value)) { - throw new Error("invalid array value"); - } - if (this.arrayLength !== -1 && value.length !== this.arrayLength) { - throw new Error("array is wrong length"); - } - const childType = this.arrayChildren; - const result = value.slice(); - result.forEach((value, index) => { - childType.#walkAsync(promises, value, process, (value) => { - result[index] = value; - }); - }); - setValue(result); - return; - } - if (this.isTuple()) { - const components = this.components; - // Convert the object into an array - let result; - if (Array.isArray(value)) { - result = value.slice(); - } - else { - if (value == null || typeof (value) !== "object") { - throw new Error("invalid tuple value"); - } - result = components.map((param) => { - if (!param.name) { - throw new Error("cannot use object value with unnamed components"); - } - if (!(param.name in value)) { - throw new Error(`missing value for component ${param.name}`); - } - return value[param.name]; - }); - } - if (result.length !== this.components.length) { - throw new Error("array is wrong length"); - } - result.forEach((value, index) => { - components[index].#walkAsync(promises, value, process, (value) => { - result[index] = value; - }); - }); - setValue(result); - return; - } - const result = process(this.type, value); - if (result.then) { - promises.push((async function () { setValue(await result); })()); - } - else { - setValue(result); - } - } - /** - * Walks the **ParamType** with %%value%%, asynchronously calling - * %%process%% on each type, destructing the %%value%% recursively. - * - * This can be used to resolve ENS names by walking and resolving each - * ``"address"`` type. - */ - async walkAsync(value, process) { - const promises = []; - const result = [value]; - this.#walkAsync(promises, value, process, (value) => { - result[0] = value; - }); - if (promises.length) { - await Promise.all(promises); - } - return result[0]; - } - /** - * Creates a new **ParamType** for %%obj%%. - * - * If %%allowIndexed%% then the ``indexed`` keyword is permitted, - * otherwise the ``indexed`` keyword will throw an error. - */ - static from(obj, allowIndexed) { - if (ParamType.isParamType(obj)) { - return obj; - } - if (typeof (obj) === "string") { - try { - return ParamType.from(lex(obj), allowIndexed); - } - catch (error) { - assertArgument(false, "invalid param type", "obj", obj); - } - } - else if (obj instanceof TokenString) { - let type = "", baseType = ""; - let comps = null; - if (consumeKeywords(obj, setify(["tuple"])).has("tuple") || obj.peekType("OPEN_PAREN")) { - // Tuple - baseType = "tuple"; - comps = obj.popParams().map((t) => ParamType.from(t)); - type = `tuple(${comps.map((c) => c.format()).join(",")})`; - } - else { - // Normal - type = verifyBasicType(obj.popType("TYPE")); - baseType = type; - } - // Check for Array - let arrayChildren = null; - let arrayLength = null; - while (obj.length && obj.peekType("BRACKET")) { - const bracket = obj.pop(); //arrays[i]; - arrayChildren = new ParamType(_guard$2, "", type, baseType, null, comps, arrayLength, arrayChildren); - arrayLength = bracket.value; - type += bracket.text; - baseType = "array"; - comps = null; - } - let indexed = null; - const keywords = consumeKeywords(obj, KwModifiers); - if (keywords.has("indexed")) { - if (!allowIndexed) { - throw new Error(""); - } - indexed = true; - } - const name = (obj.peekType("ID") ? obj.pop().text : ""); - if (obj.length) { - throw new Error("leftover tokens"); - } - return new ParamType(_guard$2, name, type, baseType, indexed, comps, arrayLength, arrayChildren); - } - const name = obj.name; - assertArgument(!name || (typeof (name) === "string" && name.match(regexId)), "invalid name", "obj.name", name); - let indexed = obj.indexed; - if (indexed != null) { - assertArgument(allowIndexed, "parameter cannot be indexed", "obj.indexed", obj.indexed); - indexed = !!indexed; - } - let type = obj.type; - let arrayMatch = type.match(regexArrayType); - if (arrayMatch) { - const arrayLength = parseInt(arrayMatch[2] || "-1"); - const arrayChildren = ParamType.from({ - type: arrayMatch[1], - components: obj.components - }); - return new ParamType(_guard$2, name || "", type, "array", indexed, null, arrayLength, arrayChildren); - } - if (type === "tuple" || type.startsWith("tuple(" /* fix: ) */) || type.startsWith("(" /* fix: ) */)) { - const comps = (obj.components != null) ? obj.components.map((c) => ParamType.from(c)) : null; - const tuple = new ParamType(_guard$2, name || "", type, "tuple", indexed, comps, null, null); - // @TODO: use lexer to validate and normalize type - return tuple; - } - type = verifyBasicType(obj.type); - return new ParamType(_guard$2, name || "", type, type, indexed, null, null, null); - } - /** - * Returns true if %%value%% is a **ParamType**. - */ - static isParamType(value) { - return (value && value[internal$1] === ParamTypeInternal); - } -} -/** - * An abstract class to represent An individual fragment from a parse ABI. - */ -class Fragment { - /** - * The type of the fragment. - */ - type; - /** - * The inputs for the fragment. - */ - inputs; - /** - * @private - */ - constructor(guard, type, inputs) { - assertPrivate(guard, _guard$2, "Fragment"); - inputs = Object.freeze(inputs.slice()); - defineProperties(this, { type, inputs }); - } - /** - * Creates a new **Fragment** for %%obj%%, wich can be any supported - * ABI frgament type. - */ - static from(obj) { - if (typeof (obj) === "string") { - // Try parsing JSON... - try { - Fragment.from(JSON.parse(obj)); - } - catch (e) { } - // ...otherwise, use the human-readable lexer - return Fragment.from(lex(obj)); - } - if (obj instanceof TokenString) { - // Human-readable ABI (already lexed) - const type = obj.peekKeyword(KwTypes); - switch (type) { - case "constructor": return ConstructorFragment.from(obj); - case "error": return ErrorFragment.from(obj); - case "event": return EventFragment.from(obj); - case "fallback": - case "receive": - return FallbackFragment.from(obj); - case "function": return FunctionFragment.from(obj); - case "struct": return StructFragment.from(obj); - } - } - else if (typeof (obj) === "object") { - // JSON ABI - switch (obj.type) { - case "constructor": return ConstructorFragment.from(obj); - case "error": return ErrorFragment.from(obj); - case "event": return EventFragment.from(obj); - case "fallback": - case "receive": - return FallbackFragment.from(obj); - case "function": return FunctionFragment.from(obj); - case "struct": return StructFragment.from(obj); - } - assert(false, `unsupported type: ${obj.type}`, "UNSUPPORTED_OPERATION", { - operation: "Fragment.from" - }); - } - assertArgument(false, "unsupported frgament object", "obj", obj); - } - /** - * Returns true if %%value%% is a [[ConstructorFragment]]. - */ - static isConstructor(value) { - return ConstructorFragment.isFragment(value); - } - /** - * Returns true if %%value%% is an [[ErrorFragment]]. - */ - static isError(value) { - return ErrorFragment.isFragment(value); - } - /** - * Returns true if %%value%% is an [[EventFragment]]. - */ - static isEvent(value) { - return EventFragment.isFragment(value); - } - /** - * Returns true if %%value%% is a [[FunctionFragment]]. - */ - static isFunction(value) { - return FunctionFragment.isFragment(value); - } - /** - * Returns true if %%value%% is a [[StructFragment]]. - */ - static isStruct(value) { - return StructFragment.isFragment(value); - } -} -/** - * An abstract class to represent An individual fragment - * which has a name from a parse ABI. - */ -class NamedFragment extends Fragment { - /** - * The name of the fragment. - */ - name; - /** - * @private - */ - constructor(guard, type, name, inputs) { - super(guard, type, inputs); - assertArgument(typeof (name) === "string" && name.match(regexId), "invalid identifier", "name", name); - inputs = Object.freeze(inputs.slice()); - defineProperties(this, { name }); - } -} -function joinParams(format, params) { - return "(" + params.map((p) => p.format(format)).join((format === "full") ? ", " : ",") + ")"; -} -/** - * A Fragment which represents a //Custom Error//. - */ -class ErrorFragment extends NamedFragment { - /** - * @private - */ - constructor(guard, name, inputs) { - super(guard, "error", name, inputs); - Object.defineProperty(this, internal$1, { value: ErrorFragmentInternal }); - } - /** - * The Custom Error selector. - */ - get selector() { - return id(this.format("sighash")).substring(0, 10); - } - /** - * Returns a string representation of this fragment as %%format%%. - */ - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - return JSON.stringify({ - type: "error", - name: this.name, - inputs: this.inputs.map((input) => JSON.parse(input.format(format))), - }); - } - const result = []; - if (format !== "sighash") { - result.push("error"); - } - result.push(this.name + joinParams(format, this.inputs)); - return result.join(" "); - } - /** - * Returns a new **ErrorFragment** for %%obj%%. - */ - static from(obj) { - if (ErrorFragment.isFragment(obj)) { - return obj; - } - if (typeof (obj) === "string") { - return ErrorFragment.from(lex(obj)); - } - else if (obj instanceof TokenString) { - const name = consumeName("error", obj); - const inputs = consumeParams(obj); - consumeEoi(obj); - return new ErrorFragment(_guard$2, name, inputs); - } - return new ErrorFragment(_guard$2, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []); - } - /** - * Returns ``true`` and provides a type guard if %%value%% is an - * **ErrorFragment**. - */ - static isFragment(value) { - return (value && value[internal$1] === ErrorFragmentInternal); - } -} -/** - * A Fragment which represents an Event. - */ -class EventFragment extends NamedFragment { - /** - * Whether this event is anonymous. - */ - anonymous; - /** - * @private - */ - constructor(guard, name, inputs, anonymous) { - super(guard, "event", name, inputs); - Object.defineProperty(this, internal$1, { value: EventFragmentInternal }); - defineProperties(this, { anonymous }); - } - /** - * The Event topic hash. - */ - get topicHash() { - return id(this.format("sighash")); - } - /** - * Returns a string representation of this event as %%format%%. - */ - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - return JSON.stringify({ - type: "event", - anonymous: this.anonymous, - name: this.name, - inputs: this.inputs.map((i) => JSON.parse(i.format(format))) - }); - } - const result = []; - if (format !== "sighash") { - result.push("event"); - } - result.push(this.name + joinParams(format, this.inputs)); - if (format !== "sighash" && this.anonymous) { - result.push("anonymous"); - } - return result.join(" "); - } - /** - * Return the topic hash for an event with %%name%% and %%params%%. - */ - static getTopicHash(name, params) { - params = (params || []).map((p) => ParamType.from(p)); - const fragment = new EventFragment(_guard$2, name, params, false); - return fragment.topicHash; - } - /** - * Returns a new **EventFragment** for %%obj%%. - */ - static from(obj) { - if (EventFragment.isFragment(obj)) { - return obj; - } - if (typeof (obj) === "string") { - try { - return EventFragment.from(lex(obj)); - } - catch (error) { - assertArgument(false, "invalid event fragment", "obj", obj); - } - } - else if (obj instanceof TokenString) { - const name = consumeName("event", obj); - const inputs = consumeParams(obj, true); - const anonymous = !!consumeKeywords(obj, setify(["anonymous"])).has("anonymous"); - consumeEoi(obj); - return new EventFragment(_guard$2, name, inputs, anonymous); - } - return new EventFragment(_guard$2, obj.name, obj.inputs ? obj.inputs.map((p) => ParamType.from(p, true)) : [], !!obj.anonymous); - } - /** - * Returns ``true`` and provides a type guard if %%value%% is an - * **EventFragment**. - */ - static isFragment(value) { - return (value && value[internal$1] === EventFragmentInternal); - } -} -/** - * A Fragment which represents a constructor. - */ -class ConstructorFragment extends Fragment { - /** - * Whether the constructor can receive an endowment. - */ - payable; - /** - * The recommended gas limit for deployment or ``null``. - */ - gas; - /** - * @private - */ - constructor(guard, type, inputs, payable, gas) { - super(guard, type, inputs); - Object.defineProperty(this, internal$1, { value: ConstructorFragmentInternal }); - defineProperties(this, { payable, gas }); - } - /** - * Returns a string representation of this constructor as %%format%%. - */ - format(format) { - assert(format != null && format !== "sighash", "cannot format a constructor for sighash", "UNSUPPORTED_OPERATION", { operation: "format(sighash)" }); - if (format === "json") { - return JSON.stringify({ - type: "constructor", - stateMutability: (this.payable ? "payable" : "undefined"), - payable: this.payable, - gas: ((this.gas != null) ? this.gas : undefined), - inputs: this.inputs.map((i) => JSON.parse(i.format(format))) - }); - } - const result = [`constructor${joinParams(format, this.inputs)}`]; - if (this.payable) { - result.push("payable"); - } - if (this.gas != null) { - result.push(`@${this.gas.toString()}`); - } - return result.join(" "); - } - /** - * Returns a new **ConstructorFragment** for %%obj%%. - */ - static from(obj) { - if (ConstructorFragment.isFragment(obj)) { - return obj; - } - if (typeof (obj) === "string") { - try { - return ConstructorFragment.from(lex(obj)); - } - catch (error) { - assertArgument(false, "invalid constuctor fragment", "obj", obj); - } - } - else if (obj instanceof TokenString) { - consumeKeywords(obj, setify(["constructor"])); - const inputs = consumeParams(obj); - const payable = !!consumeKeywords(obj, KwVisibDeploy).has("payable"); - const gas = consumeGas(obj); - consumeEoi(obj); - return new ConstructorFragment(_guard$2, "constructor", inputs, payable, gas); - } - return new ConstructorFragment(_guard$2, "constructor", obj.inputs ? obj.inputs.map(ParamType.from) : [], !!obj.payable, (obj.gas != null) ? obj.gas : null); - } - /** - * Returns ``true`` and provides a type guard if %%value%% is a - * **ConstructorFragment**. - */ - static isFragment(value) { - return (value && value[internal$1] === ConstructorFragmentInternal); - } -} -/** - * A Fragment which represents a method. - */ -class FallbackFragment extends Fragment { - /** - * If the function can be sent value during invocation. - */ - payable; - constructor(guard, inputs, payable) { - super(guard, "fallback", inputs); - Object.defineProperty(this, internal$1, { value: FallbackFragmentInternal }); - defineProperties(this, { payable }); - } - /** - * Returns a string representation of this fallback as %%format%%. - */ - format(format) { - const type = ((this.inputs.length === 0) ? "receive" : "fallback"); - if (format === "json") { - const stateMutability = (this.payable ? "payable" : "nonpayable"); - return JSON.stringify({ type, stateMutability }); - } - return `${type}()${this.payable ? " payable" : ""}`; - } - /** - * Returns a new **FallbackFragment** for %%obj%%. - */ - static from(obj) { - if (FallbackFragment.isFragment(obj)) { - return obj; - } - if (typeof (obj) === "string") { - try { - return FallbackFragment.from(lex(obj)); - } - catch (error) { - assertArgument(false, "invalid fallback fragment", "obj", obj); - } - } - else if (obj instanceof TokenString) { - const errorObj = obj.toString(); - const topIsValid = obj.peekKeyword(setify(["fallback", "receive"])); - assertArgument(topIsValid, "type must be fallback or receive", "obj", errorObj); - const type = obj.popKeyword(setify(["fallback", "receive"])); - // receive() - if (type === "receive") { - const inputs = consumeParams(obj); - assertArgument(inputs.length === 0, `receive cannot have arguments`, "obj.inputs", inputs); - consumeKeywords(obj, setify(["payable"])); - consumeEoi(obj); - return new FallbackFragment(_guard$2, [], true); - } - // fallback() [payable] - // fallback(bytes) [payable] returns (bytes) - let inputs = consumeParams(obj); - if (inputs.length) { - assertArgument(inputs.length === 1 && inputs[0].type === "bytes", "invalid fallback inputs", "obj.inputs", inputs.map((i) => i.format("minimal")).join(", ")); - } - else { - inputs = [ParamType.from("bytes")]; - } - const mutability = consumeMutability(obj); - assertArgument(mutability === "nonpayable" || mutability === "payable", "fallback cannot be constants", "obj.stateMutability", mutability); - if (consumeKeywords(obj, setify(["returns"])).has("returns")) { - const outputs = consumeParams(obj); - assertArgument(outputs.length === 1 && outputs[0].type === "bytes", "invalid fallback outputs", "obj.outputs", outputs.map((i) => i.format("minimal")).join(", ")); - } - consumeEoi(obj); - return new FallbackFragment(_guard$2, inputs, mutability === "payable"); - } - if (obj.type === "receive") { - return new FallbackFragment(_guard$2, [], true); - } - if (obj.type === "fallback") { - const inputs = [ParamType.from("bytes")]; - const payable = (obj.stateMutability === "payable"); - return new FallbackFragment(_guard$2, inputs, payable); - } - assertArgument(false, "invalid fallback description", "obj", obj); - } - /** - * Returns ``true`` and provides a type guard if %%value%% is a - * **FallbackFragment**. - */ - static isFragment(value) { - return (value && value[internal$1] === FallbackFragmentInternal); - } -} -/** - * A Fragment which represents a method. - */ -class FunctionFragment extends NamedFragment { - /** - * If the function is constant (e.g. ``pure`` or ``view`` functions). - */ - constant; - /** - * The returned types for the result of calling this function. - */ - outputs; - /** - * The state mutability (e.g. ``payable``, ``nonpayable``, ``view`` - * or ``pure``) - */ - stateMutability; - /** - * If the function can be sent value during invocation. - */ - payable; - /** - * The recommended gas limit to send when calling this function. - */ - gas; - /** - * @private - */ - constructor(guard, name, stateMutability, inputs, outputs, gas) { - super(guard, "function", name, inputs); - Object.defineProperty(this, internal$1, { value: FunctionFragmentInternal }); - outputs = Object.freeze(outputs.slice()); - const constant = (stateMutability === "view" || stateMutability === "pure"); - const payable = (stateMutability === "payable"); - defineProperties(this, { constant, gas, outputs, payable, stateMutability }); - } - /** - * The Function selector. - */ - get selector() { - return id(this.format("sighash")).substring(0, 10); - } - /** - * Returns a string representation of this function as %%format%%. - */ - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - return JSON.stringify({ - type: "function", - name: this.name, - constant: this.constant, - stateMutability: ((this.stateMutability !== "nonpayable") ? this.stateMutability : undefined), - payable: this.payable, - gas: ((this.gas != null) ? this.gas : undefined), - inputs: this.inputs.map((i) => JSON.parse(i.format(format))), - outputs: this.outputs.map((o) => JSON.parse(o.format(format))), - }); - } - const result = []; - if (format !== "sighash") { - result.push("function"); - } - result.push(this.name + joinParams(format, this.inputs)); - if (format !== "sighash") { - if (this.stateMutability !== "nonpayable") { - result.push(this.stateMutability); - } - if (this.outputs && this.outputs.length) { - result.push("returns"); - result.push(joinParams(format, this.outputs)); - } - if (this.gas != null) { - result.push(`@${this.gas.toString()}`); - } - } - return result.join(" "); - } - /** - * Return the selector for a function with %%name%% and %%params%%. - */ - static getSelector(name, params) { - params = (params || []).map((p) => ParamType.from(p)); - const fragment = new FunctionFragment(_guard$2, name, "view", params, [], null); - return fragment.selector; - } - /** - * Returns a new **FunctionFragment** for %%obj%%. - */ - static from(obj) { - if (FunctionFragment.isFragment(obj)) { - return obj; - } - if (typeof (obj) === "string") { - try { - return FunctionFragment.from(lex(obj)); - } - catch (error) { - assertArgument(false, "invalid function fragment", "obj", obj); - } - } - else if (obj instanceof TokenString) { - const name = consumeName("function", obj); - const inputs = consumeParams(obj); - const mutability = consumeMutability(obj); - let outputs = []; - if (consumeKeywords(obj, setify(["returns"])).has("returns")) { - outputs = consumeParams(obj); - } - const gas = consumeGas(obj); - consumeEoi(obj); - return new FunctionFragment(_guard$2, name, mutability, inputs, outputs, gas); - } - let stateMutability = obj.stateMutability; - // Use legacy Solidity ABI logic if stateMutability is missing - if (stateMutability == null) { - stateMutability = "payable"; - if (typeof (obj.constant) === "boolean") { - stateMutability = "view"; - if (!obj.constant) { - stateMutability = "payable"; - if (typeof (obj.payable) === "boolean" && !obj.payable) { - stateMutability = "nonpayable"; - } - } - } - else if (typeof (obj.payable) === "boolean" && !obj.payable) { - stateMutability = "nonpayable"; - } - } - // @TODO: verifyState for stateMutability (e.g. throw if - // payable: false but stateMutability is "nonpayable") - return new FunctionFragment(_guard$2, obj.name, stateMutability, obj.inputs ? obj.inputs.map(ParamType.from) : [], obj.outputs ? obj.outputs.map(ParamType.from) : [], (obj.gas != null) ? obj.gas : null); - } - /** - * Returns ``true`` and provides a type guard if %%value%% is a - * **FunctionFragment**. - */ - static isFragment(value) { - return (value && value[internal$1] === FunctionFragmentInternal); - } -} -/** - * A Fragment which represents a structure. - */ -class StructFragment extends NamedFragment { - /** - * @private - */ - constructor(guard, name, inputs) { - super(guard, "struct", name, inputs); - Object.defineProperty(this, internal$1, { value: StructFragmentInternal }); - } - /** - * Returns a string representation of this struct as %%format%%. - */ - format() { - throw new Error("@TODO"); - } - /** - * Returns a new **StructFragment** for %%obj%%. - */ - static from(obj) { - if (typeof (obj) === "string") { - try { - return StructFragment.from(lex(obj)); - } - catch (error) { - assertArgument(false, "invalid struct fragment", "obj", obj); - } - } - else if (obj instanceof TokenString) { - const name = consumeName("struct", obj); - const inputs = consumeParams(obj); - consumeEoi(obj); - return new StructFragment(_guard$2, name, inputs); - } - return new StructFragment(_guard$2, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []); - } - // @TODO: fix this return type - /** - * Returns ``true`` and provides a type guard if %%value%% is a - * **StructFragment**. - */ - static isFragment(value) { - return (value && value[internal$1] === StructFragmentInternal); - } -} - -/** - * When sending values to or receiving values from a [[Contract]], the - * data is generally encoded using the [ABI standard](link-solc-abi). - * - * The AbiCoder provides a utility to encode values to ABI data and - * decode values from ABI data. - * - * Most of the time, developers should favour the [[Contract]] class, - * which further abstracts a lot of the finer details of ABI data. - * - * @_section api/abi/abi-coder:ABI Encoding - */ -// See: https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI -// https://docs.soliditylang.org/en/v0.8.17/control-structures.html -const PanicReasons$1 = new Map(); -PanicReasons$1.set(0x00, "GENERIC_PANIC"); -PanicReasons$1.set(0x01, "ASSERT_FALSE"); -PanicReasons$1.set(0x11, "OVERFLOW"); -PanicReasons$1.set(0x12, "DIVIDE_BY_ZERO"); -PanicReasons$1.set(0x21, "ENUM_RANGE_ERROR"); -PanicReasons$1.set(0x22, "BAD_STORAGE_DATA"); -PanicReasons$1.set(0x31, "STACK_UNDERFLOW"); -PanicReasons$1.set(0x32, "ARRAY_RANGE_ERROR"); -PanicReasons$1.set(0x41, "OUT_OF_MEMORY"); -PanicReasons$1.set(0x51, "UNINITIALIZED_FUNCTION_CALL"); -const paramTypeBytes = new RegExp(/^bytes([0-9]*)$/); -const paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/); -let defaultCoder = null; -let defaultMaxInflation = 1024; -function getBuiltinCallException(action, tx, data, abiCoder) { - let message = "missing revert data"; - let reason = null; - const invocation = null; - let revert = null; - if (data) { - message = "execution reverted"; - const bytes = getBytes(data); - data = hexlify(data); - if (bytes.length === 0) { - message += " (no data present; likely require(false) occurred"; - reason = "require(false)"; - } - else if (bytes.length % 32 !== 4) { - message += " (could not decode reason; invalid data length)"; - } - else if (hexlify(bytes.slice(0, 4)) === "0x08c379a0") { - // Error(string) - try { - reason = abiCoder.decode(["string"], bytes.slice(4))[0]; - revert = { - signature: "Error(string)", - name: "Error", - args: [reason] - }; - message += `: ${JSON.stringify(reason)}`; - } - catch (error) { - message += " (could not decode reason; invalid string data)"; - } - } - else if (hexlify(bytes.slice(0, 4)) === "0x4e487b71") { - // Panic(uint256) - try { - const code = Number(abiCoder.decode(["uint256"], bytes.slice(4))[0]); - revert = { - signature: "Panic(uint256)", - name: "Panic", - args: [code] - }; - reason = `Panic due to ${PanicReasons$1.get(code) || "UNKNOWN"}(${code})`; - message += `: ${reason}`; - } - catch (error) { - message += " (could not decode panic code)"; - } - } - else { - message += " (unknown custom error)"; - } - } - const transaction = { - to: (tx.to ? getAddress(tx.to) : null), - data: (tx.data || "0x") - }; - if (tx.from) { - transaction.from = getAddress(tx.from); - } - return makeError(message, "CALL_EXCEPTION", { - action, data, reason, transaction, invocation, revert - }); -} -/** - * The **AbiCoder** is a low-level class responsible for encoding JavaScript - * values into binary data and decoding binary data into JavaScript values. - */ -class AbiCoder { - #getCoder(param) { - if (param.isArray()) { - return new ArrayCoder(this.#getCoder(param.arrayChildren), param.arrayLength, param.name); - } - if (param.isTuple()) { - return new TupleCoder(param.components.map((c) => this.#getCoder(c)), param.name); - } - switch (param.baseType) { - case "address": - return new AddressCoder(param.name); - case "bool": - return new BooleanCoder(param.name); - case "string": - return new StringCoder(param.name); - case "bytes": - return new BytesCoder(param.name); - case "": - return new NullCoder(param.name); - } - // u?int[0-9]* - let match = param.type.match(paramTypeNumber); - if (match) { - let size = parseInt(match[2] || "256"); - assertArgument(size !== 0 && size <= 256 && (size % 8) === 0, "invalid " + match[1] + " bit length", "param", param); - return new NumberCoder(size / 8, (match[1] === "int"), param.name); - } - // bytes[0-9]+ - match = param.type.match(paramTypeBytes); - if (match) { - let size = parseInt(match[1]); - assertArgument(size !== 0 && size <= 32, "invalid bytes length", "param", param); - return new FixedBytesCoder(size, param.name); - } - assertArgument(false, "invalid type", "type", param.type); - } - /** - * Get the default values for the given %%types%%. - * - * For example, a ``uint`` is by default ``0`` and ``bool`` - * is by default ``false``. - */ - getDefaultValue(types) { - const coders = types.map((type) => this.#getCoder(ParamType.from(type))); - const coder = new TupleCoder(coders, "_"); - return coder.defaultValue(); - } - /** - * Encode the %%values%% as the %%types%% into ABI data. - * - * @returns DataHexstring - */ - encode(types, values) { - assertArgumentCount(values.length, types.length, "types/values length mismatch"); - const coders = types.map((type) => this.#getCoder(ParamType.from(type))); - const coder = (new TupleCoder(coders, "_")); - const writer = new Writer(); - coder.encode(writer, values); - return writer.data; - } - /** - * Decode the ABI %%data%% as the %%types%% into values. - * - * If %%loose%% decoding is enabled, then strict padding is - * not enforced. Some older versions of Solidity incorrectly - * padded event data emitted from ``external`` functions. - */ - decode(types, data, loose) { - const coders = types.map((type) => this.#getCoder(ParamType.from(type))); - const coder = new TupleCoder(coders, "_"); - return coder.decode(new Reader(data, loose, defaultMaxInflation)); - } - static _setDefaultMaxInflation(value) { - assertArgument(typeof (value) === "number" && Number.isInteger(value), "invalid defaultMaxInflation factor", "value", value); - defaultMaxInflation = value; - } - /** - * Returns the shared singleton instance of a default [[AbiCoder]]. - * - * On the first call, the instance is created internally. - */ - static defaultAbiCoder() { - if (defaultCoder == null) { - defaultCoder = new AbiCoder(); - } - return defaultCoder; - } - /** - * Returns an ethers-compatible [[CallExceptionError]] Error for the given - * result %%data%% for the [[CallExceptionAction]] %%action%% against - * the Transaction %%tx%%. - */ - static getBuiltinCallException(action, tx, data) { - return getBuiltinCallException(action, tx, data, AbiCoder.defaultAbiCoder()); - } -} - -/** - * About bytes32 strings... - * - * @_docloc: api/utils:Bytes32 Strings - */ -/** - * Encodes %%text%% as a Bytes32 string. - */ -function encodeBytes32String(text) { - // Get the bytes - const bytes = toUtf8Bytes(text); - // Check we have room for null-termination - if (bytes.length > 31) { - throw new Error("bytes32 string must be less than 32 bytes"); - } - // Zero-pad (implicitly null-terminates) - return zeroPadBytes(bytes, 32); -} -/** - * Encodes the Bytes32-encoded %%bytes%% into a string. - */ -function decodeBytes32String(_bytes) { - const data = getBytes(_bytes, "bytes"); - // Must be 32 bytes with a null-termination - if (data.length !== 32) { - throw new Error("invalid bytes32 - not 32 bytes long"); - } - if (data[31] !== 0) { - throw new Error("invalid bytes32 string - no null terminator"); - } - // Find the null termination - let length = 31; - while (data[length - 1] === 0) { - length--; - } - // Determine the string value - return toUtf8String(data.slice(0, length)); -} - -/** - * The Interface class is a low-level class that accepts an - * ABI and provides all the necessary functionality to encode - * and decode paramaters to and results from methods, events - * and errors. - * - * It also provides several convenience methods to automatically - * search and find matching transactions and events to parse them. - * - * @_subsection api/abi:Interfaces [interfaces] - */ -/** - * When using the [[Interface-parseLog]] to automatically match a Log to its event - * for parsing, a **LogDescription** is returned. - */ -class LogDescription { - /** - * The matching fragment for the ``topic0``. - */ - fragment; - /** - * The name of the Event. - */ - name; - /** - * The full Event signature. - */ - signature; - /** - * The topic hash for the Event. - */ - topic; - /** - * The arguments passed into the Event with ``emit``. - */ - args; - /** - * @_ignore: - */ - constructor(fragment, topic, args) { - const name = fragment.name, signature = fragment.format(); - defineProperties(this, { - fragment, name, signature, topic, args - }); - } -} -/** - * When using the [[Interface-parseTransaction]] to automatically match - * a transaction data to its function for parsing, - * a **TransactionDescription** is returned. - */ -class TransactionDescription { - /** - * The matching fragment from the transaction ``data``. - */ - fragment; - /** - * The name of the Function from the transaction ``data``. - */ - name; - /** - * The arguments passed to the Function from the transaction ``data``. - */ - args; - /** - * The full Function signature from the transaction ``data``. - */ - signature; - /** - * The selector for the Function from the transaction ``data``. - */ - selector; - /** - * The ``value`` (in wei) from the transaction. - */ - value; - /** - * @_ignore: - */ - constructor(fragment, selector, args, value) { - const name = fragment.name, signature = fragment.format(); - defineProperties(this, { - fragment, name, args, signature, selector, value - }); - } -} -/** - * When using the [[Interface-parseError]] to automatically match an - * error for a call result for parsing, an **ErrorDescription** is returned. - */ -class ErrorDescription { - /** - * The matching fragment. - */ - fragment; - /** - * The name of the Error. - */ - name; - /** - * The arguments passed to the Error with ``revert``. - */ - args; - /** - * The full Error signature. - */ - signature; - /** - * The selector for the Error. - */ - selector; - /** - * @_ignore: - */ - constructor(fragment, selector, args) { - const name = fragment.name, signature = fragment.format(); - defineProperties(this, { - fragment, name, args, signature, selector - }); - } -} -/** - * An **Indexed** is used as a value when a value that does not - * fit within a topic (i.e. not a fixed-length, 32-byte type). It - * is the ``keccak256`` of the value, and used for types such as - * arrays, tuples, bytes and strings. - */ -class Indexed { - /** - * The ``keccak256`` of the value logged. - */ - hash; - /** - * @_ignore: - */ - _isIndexed; - /** - * Returns ``true`` if %%value%% is an **Indexed**. - * - * This provides a Type Guard for property access. - */ - static isIndexed(value) { - return !!(value && value._isIndexed); - } - /** - * @_ignore: - */ - constructor(hash) { - defineProperties(this, { hash, _isIndexed: true }); - } -} -// https://docs.soliditylang.org/en/v0.8.13/control-structures.html?highlight=panic#panic-via-assert-and-error-via-require -const PanicReasons = { - "0": "generic panic", - "1": "assert(false)", - "17": "arithmetic overflow", - "18": "division or modulo by zero", - "33": "enum overflow", - "34": "invalid encoded storage byte array accessed", - "49": "out-of-bounds array access; popping on an empty array", - "50": "out-of-bounds access of an array or bytesN", - "65": "out of memory", - "81": "uninitialized function", -}; -const BuiltinErrors = { - "0x08c379a0": { - signature: "Error(string)", - name: "Error", - inputs: ["string"], - reason: (message) => { - return `reverted with reason string ${JSON.stringify(message)}`; - } - }, - "0x4e487b71": { - signature: "Panic(uint256)", - name: "Panic", - inputs: ["uint256"], - reason: (code) => { - let reason = "unknown panic code"; - if (code >= 0 && code <= 0xff && PanicReasons[code.toString()]) { - reason = PanicReasons[code.toString()]; - } - return `reverted with panic code 0x${code.toString(16)} (${reason})`; - } - } -}; -/** - * An Interface abstracts many of the low-level details for - * encoding and decoding the data on the blockchain. - * - * An ABI provides information on how to encode data to send to - * a Contract, how to decode the results and events and how to - * interpret revert errors. - * - * The ABI can be specified by [any supported format](InterfaceAbi). - */ -class Interface { - /** - * All the Contract ABI members (i.e. methods, events, errors, etc). - */ - fragments; - /** - * The Contract constructor. - */ - deploy; - /** - * The Fallback method, if any. - */ - fallback; - /** - * If receiving ether is supported. - */ - receive; - #errors; - #events; - #functions; - // #structs: Map; - #abiCoder; - /** - * Create a new Interface for the %%fragments%%. - */ - constructor(fragments) { - let abi = []; - if (typeof (fragments) === "string") { - abi = JSON.parse(fragments); - } - else { - abi = fragments; - } - this.#functions = new Map(); - this.#errors = new Map(); - this.#events = new Map(); - // this.#structs = new Map(); - const frags = []; - for (const a of abi) { - try { - frags.push(Fragment.from(a)); - } - catch (error) { - console.log(`[Warning] Invalid Fragment ${JSON.stringify(a)}:`, error.message); - } - } - defineProperties(this, { - fragments: Object.freeze(frags) - }); - let fallback = null; - let receive = false; - this.#abiCoder = this.getAbiCoder(); - // Add all fragments by their signature - this.fragments.forEach((fragment, index) => { - let bucket; - switch (fragment.type) { - case "constructor": - if (this.deploy) { - console.log("duplicate definition - constructor"); - return; - } - //checkNames(fragment, "input", fragment.inputs); - defineProperties(this, { deploy: fragment }); - return; - case "fallback": - if (fragment.inputs.length === 0) { - receive = true; - } - else { - assertArgument(!fallback || fragment.payable !== fallback.payable, "conflicting fallback fragments", `fragments[${index}]`, fragment); - fallback = fragment; - receive = fallback.payable; - } - return; - case "function": - //checkNames(fragment, "input", fragment.inputs); - //checkNames(fragment, "output", (fragment).outputs); - bucket = this.#functions; - break; - case "event": - //checkNames(fragment, "input", fragment.inputs); - bucket = this.#events; - break; - case "error": - bucket = this.#errors; - break; - default: - return; - } - // Two identical entries; ignore it - const signature = fragment.format(); - if (bucket.has(signature)) { - return; - } - bucket.set(signature, fragment); - }); - // If we do not have a constructor add a default - if (!this.deploy) { - defineProperties(this, { - deploy: ConstructorFragment.from("constructor()") - }); - } - defineProperties(this, { fallback, receive }); - } - /** - * Returns the entire Human-Readable ABI, as an array of - * signatures, optionally as %%minimal%% strings, which - * removes parameter names and unneceesary spaces. - */ - format(minimal) { - const format = (minimal ? "minimal" : "full"); - const abi = this.fragments.map((f) => f.format(format)); - return abi; - } - /** - * Return the JSON-encoded ABI. This is the format Solidiy - * returns. - */ - formatJson() { - const abi = this.fragments.map((f) => f.format("json")); - // We need to re-bundle the JSON fragments a bit - return JSON.stringify(abi.map((j) => JSON.parse(j))); - } - /** - * The ABI coder that will be used to encode and decode binary - * data. - */ - getAbiCoder() { - return AbiCoder.defaultAbiCoder(); - } - // Find a function definition by any means necessary (unless it is ambiguous) - #getFunction(key, values, forceUnique) { - // Selector - if (isHexString(key)) { - const selector = key.toLowerCase(); - for (const fragment of this.#functions.values()) { - if (selector === fragment.selector) { - return fragment; - } - } - return null; - } - // It is a bare name, look up the function (will return null if ambiguous) - if (key.indexOf("(") === -1) { - const matching = []; - for (const [name, fragment] of this.#functions) { - if (name.split("(" /* fix:) */)[0] === key) { - matching.push(fragment); - } - } - if (values) { - const lastValue = (values.length > 0) ? values[values.length - 1] : null; - let valueLength = values.length; - let allowOptions = true; - if (Typed.isTyped(lastValue) && lastValue.type === "overrides") { - allowOptions = false; - valueLength--; - } - // Remove all matches that don't have a compatible length. The args - // may contain an overrides, so the match may have n or n - 1 parameters - for (let i = matching.length - 1; i >= 0; i--) { - const inputs = matching[i].inputs.length; - if (inputs !== valueLength && (!allowOptions || inputs !== valueLength - 1)) { - matching.splice(i, 1); - } - } - // Remove all matches that don't match the Typed signature - for (let i = matching.length - 1; i >= 0; i--) { - const inputs = matching[i].inputs; - for (let j = 0; j < values.length; j++) { - // Not a typed value - if (!Typed.isTyped(values[j])) { - continue; - } - // We are past the inputs - if (j >= inputs.length) { - if (values[j].type === "overrides") { - continue; - } - matching.splice(i, 1); - break; - } - // Make sure the value type matches the input type - if (values[j].type !== inputs[j].baseType) { - matching.splice(i, 1); - break; - } - } - } - } - // We found a single matching signature with an overrides, but the - // last value is something that cannot possibly be an options - if (matching.length === 1 && values && values.length !== matching[0].inputs.length) { - const lastArg = values[values.length - 1]; - if (lastArg == null || Array.isArray(lastArg) || typeof (lastArg) !== "object") { - matching.splice(0, 1); - } - } - if (matching.length === 0) { - return null; - } - if (matching.length > 1 && forceUnique) { - const matchStr = matching.map((m) => JSON.stringify(m.format())).join(", "); - assertArgument(false, `ambiguous function description (i.e. matches ${matchStr})`, "key", key); - } - return matching[0]; - } - // Normalize the signature and lookup the function - const result = this.#functions.get(FunctionFragment.from(key).format()); - if (result) { - return result; - } - return null; - } - /** - * Get the function name for %%key%%, which may be a function selector, - * function name or function signature that belongs to the ABI. - */ - getFunctionName(key) { - const fragment = this.#getFunction(key, null, false); - assertArgument(fragment, "no matching function", "key", key); - return fragment.name; - } - /** - * Returns true if %%key%% (a function selector, function name or - * function signature) is present in the ABI. - * - * In the case of a function name, the name may be ambiguous, so - * accessing the [[FunctionFragment]] may require refinement. - */ - hasFunction(key) { - return !!this.#getFunction(key, null, false); - } - /** - * Get the [[FunctionFragment]] for %%key%%, which may be a function - * selector, function name or function signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple functions match by name. - * - * If the %%key%% and %%values%% do not refine to a single function in - * the ABI, this will throw. - */ - getFunction(key, values) { - return this.#getFunction(key, values || null, true); - } - /** - * Iterate over all functions, calling %%callback%%, sorted by their name. - */ - forEachFunction(callback) { - const names = Array.from(this.#functions.keys()); - names.sort((a, b) => a.localeCompare(b)); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - callback((this.#functions.get(name)), i); - } - } - // Find an event definition by any means necessary (unless it is ambiguous) - #getEvent(key, values, forceUnique) { - // EventTopic - if (isHexString(key)) { - const eventTopic = key.toLowerCase(); - for (const fragment of this.#events.values()) { - if (eventTopic === fragment.topicHash) { - return fragment; - } - } - return null; - } - // It is a bare name, look up the function (will return null if ambiguous) - if (key.indexOf("(") === -1) { - const matching = []; - for (const [name, fragment] of this.#events) { - if (name.split("(" /* fix:) */)[0] === key) { - matching.push(fragment); - } - } - if (values) { - // Remove all matches that don't have a compatible length. - for (let i = matching.length - 1; i >= 0; i--) { - if (matching[i].inputs.length < values.length) { - matching.splice(i, 1); - } - } - // Remove all matches that don't match the Typed signature - for (let i = matching.length - 1; i >= 0; i--) { - const inputs = matching[i].inputs; - for (let j = 0; j < values.length; j++) { - // Not a typed value - if (!Typed.isTyped(values[j])) { - continue; - } - // Make sure the value type matches the input type - if (values[j].type !== inputs[j].baseType) { - matching.splice(i, 1); - break; - } - } - } - } - if (matching.length === 0) { - return null; - } - if (matching.length > 1 && forceUnique) { - const matchStr = matching.map((m) => JSON.stringify(m.format())).join(", "); - assertArgument(false, `ambiguous event description (i.e. matches ${matchStr})`, "key", key); - } - return matching[0]; - } - // Normalize the signature and lookup the function - const result = this.#events.get(EventFragment.from(key).format()); - if (result) { - return result; - } - return null; - } - /** - * Get the event name for %%key%%, which may be a topic hash, - * event name or event signature that belongs to the ABI. - */ - getEventName(key) { - const fragment = this.#getEvent(key, null, false); - assertArgument(fragment, "no matching event", "key", key); - return fragment.name; - } - /** - * Returns true if %%key%% (an event topic hash, event name or - * event signature) is present in the ABI. - * - * In the case of an event name, the name may be ambiguous, so - * accessing the [[EventFragment]] may require refinement. - */ - hasEvent(key) { - return !!this.#getEvent(key, null, false); - } - /** - * Get the [[EventFragment]] for %%key%%, which may be a topic hash, - * event name or event signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple events match by name. - * - * If the %%key%% and %%values%% do not refine to a single event in - * the ABI, this will throw. - */ - getEvent(key, values) { - return this.#getEvent(key, values || null, true); - } - /** - * Iterate over all events, calling %%callback%%, sorted by their name. - */ - forEachEvent(callback) { - const names = Array.from(this.#events.keys()); - names.sort((a, b) => a.localeCompare(b)); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - callback((this.#events.get(name)), i); - } - } - /** - * Get the [[ErrorFragment]] for %%key%%, which may be an error - * selector, error name or error signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple errors match by name. - * - * If the %%key%% and %%values%% do not refine to a single error in - * the ABI, this will throw. - */ - getError(key, values) { - if (isHexString(key)) { - const selector = key.toLowerCase(); - if (BuiltinErrors[selector]) { - return ErrorFragment.from(BuiltinErrors[selector].signature); - } - for (const fragment of this.#errors.values()) { - if (selector === fragment.selector) { - return fragment; - } - } - return null; - } - // It is a bare name, look up the function (will return null if ambiguous) - if (key.indexOf("(") === -1) { - const matching = []; - for (const [name, fragment] of this.#errors) { - if (name.split("(" /* fix:) */)[0] === key) { - matching.push(fragment); - } - } - if (matching.length === 0) { - if (key === "Error") { - return ErrorFragment.from("error Error(string)"); - } - if (key === "Panic") { - return ErrorFragment.from("error Panic(uint256)"); - } - return null; - } - else if (matching.length > 1) { - const matchStr = matching.map((m) => JSON.stringify(m.format())).join(", "); - assertArgument(false, `ambiguous error description (i.e. ${matchStr})`, "name", key); - } - return matching[0]; - } - // Normalize the signature and lookup the function - key = ErrorFragment.from(key).format(); - if (key === "Error(string)") { - return ErrorFragment.from("error Error(string)"); - } - if (key === "Panic(uint256)") { - return ErrorFragment.from("error Panic(uint256)"); - } - const result = this.#errors.get(key); - if (result) { - return result; - } - return null; - } - /** - * Iterate over all errors, calling %%callback%%, sorted by their name. - */ - forEachError(callback) { - const names = Array.from(this.#errors.keys()); - names.sort((a, b) => a.localeCompare(b)); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - callback((this.#errors.get(name)), i); - } - } - // Get the 4-byte selector used by Solidity to identify a function - /* -getSelector(fragment: ErrorFragment | FunctionFragment): string { - if (typeof(fragment) === "string") { - const matches: Array = [ ]; - - try { matches.push(this.getFunction(fragment)); } catch (error) { } - try { matches.push(this.getError(fragment)); } catch (_) { } - - if (matches.length === 0) { - logger.throwArgumentError("unknown fragment", "key", fragment); - } else if (matches.length > 1) { - logger.throwArgumentError("ambiguous fragment matches function and error", "key", fragment); - } - - fragment = matches[0]; - } - - return dataSlice(id(fragment.format()), 0, 4); -} - */ - // Get the 32-byte topic hash used by Solidity to identify an event - /* - getEventTopic(fragment: EventFragment): string { - //if (typeof(fragment) === "string") { fragment = this.getEvent(eventFragment); } - return id(fragment.format()); - } - */ - _decodeParams(params, data) { - return this.#abiCoder.decode(params, data); - } - _encodeParams(params, values) { - return this.#abiCoder.encode(params, values); - } - /** - * Encodes a ``tx.data`` object for deploying the Contract with - * the %%values%% as the constructor arguments. - */ - encodeDeploy(values) { - return this._encodeParams(this.deploy.inputs, values || []); - } - /** - * Decodes the result %%data%% (e.g. from an ``eth_call``) for the - * specified error (see [[getError]] for valid values for - * %%key%%). - * - * Most developers should prefer the [[parseCallResult]] method instead, - * which will automatically detect a ``CALL_EXCEPTION`` and throw the - * corresponding error. - */ - decodeErrorResult(fragment, data) { - if (typeof (fragment) === "string") { - const f = this.getError(fragment); - assertArgument(f, "unknown error", "fragment", fragment); - fragment = f; - } - assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match error ${fragment.name}.`, "data", data); - return this._decodeParams(fragment.inputs, dataSlice(data, 4)); - } - /** - * Encodes the transaction revert data for a call result that - * reverted from the the Contract with the sepcified %%error%% - * (see [[getError]] for valid values for %%fragment%%) with the %%values%%. - * - * This is generally not used by most developers, unless trying to mock - * a result from a Contract. - */ - encodeErrorResult(fragment, values) { - if (typeof (fragment) === "string") { - const f = this.getError(fragment); - assertArgument(f, "unknown error", "fragment", fragment); - fragment = f; - } - return concat([ - fragment.selector, - this._encodeParams(fragment.inputs, values || []) - ]); - } - /** - * Decodes the %%data%% from a transaction ``tx.data`` for - * the function specified (see [[getFunction]] for valid values - * for %%fragment%%). - * - * Most developers should prefer the [[parseTransaction]] method - * instead, which will automatically detect the fragment. - */ - decodeFunctionData(fragment, data) { - if (typeof (fragment) === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match function ${fragment.name}.`, "data", data); - return this._decodeParams(fragment.inputs, dataSlice(data, 4)); - } - /** - * Encodes the ``tx.data`` for a transaction that calls the function - * specified (see [[getFunction]] for valid values for %%fragment%%) with - * the %%values%%. - */ - encodeFunctionData(fragment, values) { - if (typeof (fragment) === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - return concat([ - fragment.selector, - this._encodeParams(fragment.inputs, values || []) - ]); - } - /** - * Decodes the result %%data%% (e.g. from an ``eth_call``) for the - * specified function (see [[getFunction]] for valid values for - * %%key%%). - * - * Most developers should prefer the [[parseCallResult]] method instead, - * which will automatically detect a ``CALL_EXCEPTION`` and throw the - * corresponding error. - */ - decodeFunctionResult(fragment, data) { - if (typeof (fragment) === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - let message = "invalid length for result data"; - const bytes = getBytesCopy(data); - if ((bytes.length % 32) === 0) { - try { - return this.#abiCoder.decode(fragment.outputs, bytes); - } - catch (error) { - message = "could not decode result data"; - } - } - // Call returned data with no error, but the data is junk - assert(false, message, "BAD_DATA", { - value: hexlify(bytes), - info: { method: fragment.name, signature: fragment.format() } - }); - } - makeError(_data, tx) { - const data = getBytes(_data, "data"); - const error = AbiCoder.getBuiltinCallException("call", tx, data); - // Not a built-in error; try finding a custom error - const customPrefix = "execution reverted (unknown custom error)"; - if (error.message.startsWith(customPrefix)) { - const selector = hexlify(data.slice(0, 4)); - const ef = this.getError(selector); - if (ef) { - try { - const args = this.#abiCoder.decode(ef.inputs, data.slice(4)); - error.revert = { - name: ef.name, signature: ef.format(), args - }; - error.reason = error.revert.signature; - error.message = `execution reverted: ${error.reason}`; - } - catch (e) { - error.message = `execution reverted (coult not decode custom error)`; - } - } - } - // Add the invocation, if available - const parsed = this.parseTransaction(tx); - if (parsed) { - error.invocation = { - method: parsed.name, - signature: parsed.signature, - args: parsed.args - }; - } - return error; - } - /** - * Encodes the result data (e.g. from an ``eth_call``) for the - * specified function (see [[getFunction]] for valid values - * for %%fragment%%) with %%values%%. - * - * This is generally not used by most developers, unless trying to mock - * a result from a Contract. - */ - encodeFunctionResult(fragment, values) { - if (typeof (fragment) === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - return hexlify(this.#abiCoder.encode(fragment.outputs, values || [])); - } - /* - spelunk(inputs: Array, values: ReadonlyArray, processfunc: (type: string, value: any) => Promise): Promise> { - const promises: Array> = [ ]; - const process = function(type: ParamType, value: any): any { - if (type.baseType === "array") { - return descend(type.child - } - if (type. === "address") { - } - }; - - const descend = function (inputs: Array, values: ReadonlyArray) { - if (inputs.length !== values.length) { throw new Error("length mismatch"); } - - }; - - const result: Array = [ ]; - values.forEach((value, index) => { - if (value == null) { - topics.push(null); - } else if (param.baseType === "array" || param.baseType === "tuple") { - logger.throwArgumentError("filtering with tuples or arrays not supported", ("contract." + param.name), value); - } else if (Array.isArray(value)) { - topics.push(value.map((value) => encodeTopic(param, value))); - } else { - topics.push(encodeTopic(param, value)); - } - }); - } - */ - // Create the filter for the event with search criteria (e.g. for eth_filterLog) - encodeFilterTopics(fragment, values) { - if (typeof (fragment) === "string") { - const f = this.getEvent(fragment); - assertArgument(f, "unknown event", "eventFragment", fragment); - fragment = f; - } - assert(values.length <= fragment.inputs.length, `too many arguments for ${fragment.format()}`, "UNEXPECTED_ARGUMENT", { count: values.length, expectedCount: fragment.inputs.length }); - const topics = []; - if (!fragment.anonymous) { - topics.push(fragment.topicHash); - } - // @TODO: Use the coders for this; to properly support tuples, etc. - const encodeTopic = (param, value) => { - if (param.type === "string") { - return id(value); - } - else if (param.type === "bytes") { - return keccak256(hexlify(value)); - } - if (param.type === "bool" && typeof (value) === "boolean") { - value = (value ? "0x01" : "0x00"); - } - else if (param.type.match(/^u?int/)) { - value = toBeHex(value); // @TODO: Should this toTwos?? - } - else if (param.type.match(/^bytes/)) { - value = zeroPadBytes(value, 32); - } - else if (param.type === "address") { - // Check addresses are valid - this.#abiCoder.encode(["address"], [value]); - } - return zeroPadValue(hexlify(value), 32); - }; - values.forEach((value, index) => { - const param = fragment.inputs[index]; - if (!param.indexed) { - assertArgument(value == null, "cannot filter non-indexed parameters; must be null", ("contract." + param.name), value); - return; - } - if (value == null) { - topics.push(null); - } - else if (param.baseType === "array" || param.baseType === "tuple") { - assertArgument(false, "filtering with tuples or arrays not supported", ("contract." + param.name), value); - } - else if (Array.isArray(value)) { - topics.push(value.map((value) => encodeTopic(param, value))); - } - else { - topics.push(encodeTopic(param, value)); - } - }); - // Trim off trailing nulls - while (topics.length && topics[topics.length - 1] === null) { - topics.pop(); - } - return topics; - } - encodeEventLog(fragment, values) { - if (typeof (fragment) === "string") { - const f = this.getEvent(fragment); - assertArgument(f, "unknown event", "eventFragment", fragment); - fragment = f; - } - const topics = []; - const dataTypes = []; - const dataValues = []; - if (!fragment.anonymous) { - topics.push(fragment.topicHash); - } - assertArgument(values.length === fragment.inputs.length, "event arguments/values mismatch", "values", values); - fragment.inputs.forEach((param, index) => { - const value = values[index]; - if (param.indexed) { - if (param.type === "string") { - topics.push(id(value)); - } - else if (param.type === "bytes") { - topics.push(keccak256(value)); - } - else if (param.baseType === "tuple" || param.baseType === "array") { - // @TODO - throw new Error("not implemented"); - } - else { - topics.push(this.#abiCoder.encode([param.type], [value])); - } - } - else { - dataTypes.push(param); - dataValues.push(value); - } - }); - return { - data: this.#abiCoder.encode(dataTypes, dataValues), - topics: topics - }; - } - // Decode a filter for the event and the search criteria - decodeEventLog(fragment, data, topics) { - if (typeof (fragment) === "string") { - const f = this.getEvent(fragment); - assertArgument(f, "unknown event", "eventFragment", fragment); - fragment = f; - } - if (topics != null && !fragment.anonymous) { - const eventTopic = fragment.topicHash; - assertArgument(isHexString(topics[0], 32) && topics[0].toLowerCase() === eventTopic, "fragment/topic mismatch", "topics[0]", topics[0]); - topics = topics.slice(1); - } - const indexed = []; - const nonIndexed = []; - const dynamic = []; - fragment.inputs.forEach((param, index) => { - if (param.indexed) { - if (param.type === "string" || param.type === "bytes" || param.baseType === "tuple" || param.baseType === "array") { - indexed.push(ParamType.from({ type: "bytes32", name: param.name })); - dynamic.push(true); - } - else { - indexed.push(param); - dynamic.push(false); - } - } - else { - nonIndexed.push(param); - dynamic.push(false); - } - }); - const resultIndexed = (topics != null) ? this.#abiCoder.decode(indexed, concat(topics)) : null; - const resultNonIndexed = this.#abiCoder.decode(nonIndexed, data, true); - //const result: (Array & { [ key: string ]: any }) = [ ]; - const values = []; - const keys = []; - let nonIndexedIndex = 0, indexedIndex = 0; - fragment.inputs.forEach((param, index) => { - let value = null; - if (param.indexed) { - if (resultIndexed == null) { - value = new Indexed(null); - } - else if (dynamic[index]) { - value = new Indexed(resultIndexed[indexedIndex++]); - } - else { - try { - value = resultIndexed[indexedIndex++]; - } - catch (error) { - value = error; - } - } - } - else { - try { - value = resultNonIndexed[nonIndexedIndex++]; - } - catch (error) { - value = error; - } - } - values.push(value); - keys.push(param.name || null); - }); - return Result.fromItems(values, keys); - } - /** - * Parses a transaction, finding the matching function and extracts - * the parameter values along with other useful function details. - * - * If the matching function cannot be found, return null. - */ - parseTransaction(tx) { - const data = getBytes(tx.data, "tx.data"); - const value = getBigInt((tx.value != null) ? tx.value : 0, "tx.value"); - const fragment = this.getFunction(hexlify(data.slice(0, 4))); - if (!fragment) { - return null; - } - const args = this.#abiCoder.decode(fragment.inputs, data.slice(4)); - return new TransactionDescription(fragment, fragment.selector, args, value); - } - parseCallResult(data) { - throw new Error("@TODO"); - } - /** - * Parses a receipt log, finding the matching event and extracts - * the parameter values along with other useful event details. - * - * If the matching event cannot be found, returns null. - */ - parseLog(log) { - const fragment = this.getEvent(log.topics[0]); - if (!fragment || fragment.anonymous) { - return null; - } - // @TODO: If anonymous, and the only method, and the input count matches, should we parse? - // Probably not, because just because it is the only event in the ABI does - // not mean we have the full ABI; maybe just a fragment? - return new LogDescription(fragment, fragment.topicHash, this.decodeEventLog(fragment, log.data, log.topics)); - } - /** - * Parses a revert data, finding the matching error and extracts - * the parameter values along with other useful error details. - * - * If the matching error cannot be found, returns null. - */ - parseError(data) { - const hexData = hexlify(data); - const fragment = this.getError(dataSlice(hexData, 0, 4)); - if (!fragment) { - return null; - } - const args = this.#abiCoder.decode(fragment.inputs, dataSlice(hexData, 4)); - return new ErrorDescription(fragment, fragment.selector, args); - } - /** - * Creates a new [[Interface]] from the ABI %%value%%. - * - * The %%value%% may be provided as an existing [[Interface]] object, - * a JSON-encoded ABI or any Human-Readable ABI format. - */ - static from(value) { - // Already an Interface, which is immutable - if (value instanceof Interface) { - return value; - } - // JSON - if (typeof (value) === "string") { - return new Interface(JSON.parse(value)); - } - // An Interface; possibly from another v6 instance - if (typeof (value.formatJson) === "function") { - return new Interface(value.formatJson()); - } - // A legacy Interface; from an older version - if (typeof (value.format) === "function") { - return new Interface(value.format("json")); - } - // Array of fragments - return new Interface(value); - } -} - -//import { resolveAddress } from "@ethersproject/address"; -const BN_0$2 = BigInt(0); -// ----------------------- -function getValue(value) { - if (value == null) { - return null; - } - return value; -} -function toJson(value) { - if (value == null) { - return null; - } - return value.toString(); -} -// @TODO? implements Required -/** - * A **FeeData** wraps all the fee-related values associated with - * the network. - */ -class FeeData { - /** - * The gas price for legacy networks. - */ - gasPrice; - /** - * The maximum fee to pay per gas. - * - * The base fee per gas is defined by the network and based on - * congestion, increasing the cost during times of heavy load - * and lowering when less busy. - * - * The actual fee per gas will be the base fee for the block - * and the priority fee, up to the max fee per gas. - * - * This will be ``null`` on legacy networks (i.e. [pre-EIP-1559](link-eip-1559)) - */ - maxFeePerGas; - /** - * The additional amout to pay per gas to encourage a validator - * to include the transaction. - * - * The purpose of this is to compensate the validator for the - * adjusted risk for including a given transaction. - * - * This will be ``null`` on legacy networks (i.e. [pre-EIP-1559](link-eip-1559)) - */ - maxPriorityFeePerGas; - /** - * Creates a new FeeData for %%gasPrice%%, %%maxFeePerGas%% and - * %%maxPriorityFeePerGas%%. - */ - constructor(gasPrice, maxFeePerGas, maxPriorityFeePerGas) { - defineProperties(this, { - gasPrice: getValue(gasPrice), - maxFeePerGas: getValue(maxFeePerGas), - maxPriorityFeePerGas: getValue(maxPriorityFeePerGas) - }); - } - /** - * Returns a JSON-friendly value. - */ - toJSON() { - const { gasPrice, maxFeePerGas, maxPriorityFeePerGas } = this; - return { - _type: "FeeData", - gasPrice: toJson(gasPrice), - maxFeePerGas: toJson(maxFeePerGas), - maxPriorityFeePerGas: toJson(maxPriorityFeePerGas), - }; - } -} -/** - * Returns a copy of %%req%% with all properties coerced to their strict - * types. - */ -function copyRequest(req) { - const result = {}; - // These could be addresses, ENS names or Addressables - if (req.to) { - result.to = req.to; - } - if (req.from) { - result.from = req.from; - } - if (req.data) { - result.data = hexlify(req.data); - } - const bigIntKeys = "chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/); - for (const key of bigIntKeys) { - if (!(key in req) || req[key] == null) { - continue; - } - result[key] = getBigInt(req[key], `request.${key}`); - } - const numberKeys = "type,nonce".split(/,/); - for (const key of numberKeys) { - if (!(key in req) || req[key] == null) { - continue; - } - result[key] = getNumber(req[key], `request.${key}`); - } - if (req.accessList) { - result.accessList = accessListify(req.accessList); - } - if (req.authorizationList) { - result.authorizationList = req.authorizationList.slice(); - } - if ("blockTag" in req) { - result.blockTag = req.blockTag; - } - if ("enableCcipRead" in req) { - result.enableCcipRead = !!req.enableCcipRead; - } - if ("customData" in req) { - result.customData = req.customData; - } - if ("blobVersionedHashes" in req && req.blobVersionedHashes) { - result.blobVersionedHashes = req.blobVersionedHashes.slice(); - } - if ("kzg" in req) { - result.kzg = req.kzg; - } - if ("blobWrapperVersion" in req) { - result.blobWrapperVersion = req.blobWrapperVersion; - } - if ("blobs" in req && req.blobs) { - result.blobs = req.blobs.map((b) => { - if (isBytesLike(b)) { - return hexlify(b); - } - return Object.assign({}, b); - }); - } - return result; -} -/** - * A **Block** represents the data associated with a full block on - * Ethereum. - */ -class Block { - /** - * The provider connected to the block used to fetch additional details - * if necessary. - */ - provider; - /** - * The block number, sometimes called the block height. This is a - * sequential number that is one higher than the parent block. - */ - number; - /** - * The block hash. - * - * This hash includes all properties, so can be safely used to identify - * an exact set of block properties. - */ - hash; - /** - * The timestamp for this block, which is the number of seconds since - * epoch that this block was included. - */ - timestamp; - /** - * The block hash of the parent block. - */ - parentHash; - /** - * The hash tree root of the parent beacon block for the given - * execution block. See [[link-eip-4788]]. - */ - parentBeaconBlockRoot; - /** - * The nonce. - * - * On legacy networks, this is the random number inserted which - * permitted the difficulty target to be reached. - */ - nonce; - /** - * The difficulty target. - * - * On legacy networks, this is the proof-of-work target required - * for a block to meet the protocol rules to be included. - * - * On modern networks, this is a random number arrived at using - * randao. @TODO: Find links? - */ - difficulty; - /** - * The total gas limit for this block. - */ - gasLimit; - /** - * The total gas used in this block. - */ - gasUsed; - /** - * The root hash for the global state after applying changes - * in this block. - */ - stateRoot; - /** - * The hash of the transaction receipts trie. - */ - receiptsRoot; - /** - * The total amount of blob gas consumed by the transactions - * within the block. See [[link-eip-4844]]. - */ - blobGasUsed; - /** - * The running total of blob gas consumed in excess of the - * target, prior to the block. See [[link-eip-4844]]. - */ - excessBlobGas; - /** - * The miner coinbase address, wihch receives any subsidies for - * including this block. - */ - miner; - /** - * The latest RANDAO mix of the post beacon state of - * the previous block. - */ - prevRandao; - /** - * Any extra data the validator wished to include. - */ - extraData; - /** - * The base fee per gas that all transactions in this block were - * charged. - * - * This adjusts after each block, depending on how congested the network - * is. - */ - baseFeePerGas; - #transactions; - /** - * Create a new **Block** object. - * - * This should generally not be necessary as the unless implementing a - * low-level library. - */ - constructor(block, provider) { - this.#transactions = block.transactions.map((tx) => { - if (typeof (tx) !== "string") { - return new TransactionResponse(tx, provider); - } - return tx; - }); - defineProperties(this, { - provider, - hash: getValue(block.hash), - number: block.number, - timestamp: block.timestamp, - parentHash: block.parentHash, - parentBeaconBlockRoot: block.parentBeaconBlockRoot, - nonce: block.nonce, - difficulty: block.difficulty, - gasLimit: block.gasLimit, - gasUsed: block.gasUsed, - blobGasUsed: block.blobGasUsed, - excessBlobGas: block.excessBlobGas, - miner: block.miner, - prevRandao: getValue(block.prevRandao), - extraData: block.extraData, - baseFeePerGas: getValue(block.baseFeePerGas), - stateRoot: block.stateRoot, - receiptsRoot: block.receiptsRoot, - }); - } - /** - * Returns the list of transaction hashes, in the order - * they were executed within the block. - */ - get transactions() { - return this.#transactions.map((tx) => { - if (typeof (tx) === "string") { - return tx; - } - return tx.hash; - }); - } - /** - * Returns the complete transactions, in the order they - * were executed within the block. - * - * This is only available for blocks which prefetched - * transactions, by passing ``true`` to %%prefetchTxs%% - * into [[Provider-getBlock]]. - */ - get prefetchedTransactions() { - const txs = this.#transactions.slice(); - // Doesn't matter... - if (txs.length === 0) { - return []; - } - // Make sure we prefetched the transactions - assert(typeof (txs[0]) === "object", "transactions were not prefetched with block request", "UNSUPPORTED_OPERATION", { - operation: "transactionResponses()" - }); - return txs; - } - /** - * Returns a JSON-friendly value. - */ - toJSON() { - const { baseFeePerGas, difficulty, extraData, gasLimit, gasUsed, hash, miner, prevRandao, nonce, number, parentHash, parentBeaconBlockRoot, stateRoot, receiptsRoot, timestamp, transactions } = this; - return { - _type: "Block", - baseFeePerGas: toJson(baseFeePerGas), - difficulty: toJson(difficulty), - extraData, - gasLimit: toJson(gasLimit), - gasUsed: toJson(gasUsed), - blobGasUsed: toJson(this.blobGasUsed), - excessBlobGas: toJson(this.excessBlobGas), - hash, miner, prevRandao, nonce, number, parentHash, timestamp, - parentBeaconBlockRoot, stateRoot, receiptsRoot, - transactions, - }; - } - [Symbol.iterator]() { - let index = 0; - const txs = this.transactions; - return { - next: () => { - if (index < this.length) { - return { - value: txs[index++], done: false - }; - } - return { value: undefined, done: true }; - } - }; - } - /** - * The number of transactions in this block. - */ - get length() { return this.#transactions.length; } - /** - * The [[link-js-date]] this block was included at. - */ - get date() { - if (this.timestamp == null) { - return null; - } - return new Date(this.timestamp * 1000); - } - /** - * Get the transaction at %%indexe%% within this block. - */ - async getTransaction(indexOrHash) { - // Find the internal value by its index or hash - let tx = undefined; - if (typeof (indexOrHash) === "number") { - tx = this.#transactions[indexOrHash]; - } - else { - const hash = indexOrHash.toLowerCase(); - for (const v of this.#transactions) { - if (typeof (v) === "string") { - if (v !== hash) { - continue; - } - tx = v; - break; - } - else { - if (v.hash !== hash) { - continue; - } - tx = v; - break; - } - } - } - if (tx == null) { - throw new Error("no such tx"); - } - if (typeof (tx) === "string") { - return (await this.provider.getTransaction(tx)); - } - else { - return tx; - } - } - /** - * If a **Block** was fetched with a request to include the transactions - * this will allow synchronous access to those transactions. - * - * If the transactions were not prefetched, this will throw. - */ - getPrefetchedTransaction(indexOrHash) { - const txs = this.prefetchedTransactions; - if (typeof (indexOrHash) === "number") { - return txs[indexOrHash]; - } - indexOrHash = indexOrHash.toLowerCase(); - for (const tx of txs) { - if (tx.hash === indexOrHash) { - return tx; - } - } - assertArgument(false, "no matching transaction", "indexOrHash", indexOrHash); - } - /** - * Returns true if this block been mined. This provides a type guard - * for all properties on a [[MinedBlock]]. - */ - isMined() { return !!this.hash; } - /** - * Returns true if this block is an [[link-eip-2930]] block. - */ - isLondon() { - return !!this.baseFeePerGas; - } - /** - * @_ignore: - */ - orphanedEvent() { - if (!this.isMined()) { - throw new Error(""); - } - return createOrphanedBlockFilter(this); - } -} -////////////////////// -// Log -/** - * A **Log** in Ethereum represents an event that has been included in a - * transaction using the ``LOG*`` opcodes, which are most commonly used by - * Solidity's emit for announcing events. - */ -class Log { - /** - * The provider connected to the log used to fetch additional details - * if necessary. - */ - provider; - /** - * The transaction hash of the transaction this log occurred in. Use the - * [[Log-getTransaction]] to get the [[TransactionResponse]]. - */ - transactionHash; - /** - * The block hash of the block this log occurred in. Use the - * [[Log-getBlock]] to get the [[Block]]. - */ - blockHash; - /** - * The block number of the block this log occurred in. It is preferred - * to use the [[Block-hash]] when fetching the related [[Block]], - * since in the case of an orphaned block, the block at that height may - * have changed. - */ - blockNumber; - /** - * If the **Log** represents a block that was removed due to an orphaned - * block, this will be true. - * - * This can only happen within an orphan event listener. - */ - removed; - /** - * The address of the contract that emitted this log. - */ - address; - /** - * The data included in this log when it was emitted. - */ - data; - /** - * The indexed topics included in this log when it was emitted. - * - * All topics are included in the bloom filters, so they can be - * efficiently filtered using the [[Provider-getLogs]] method. - */ - topics; - /** - * The index within the block this log occurred at. This is generally - * not useful to developers, but can be used with the various roots - * to proof inclusion within a block. - */ - index; - /** - * The index within the transaction of this log. - */ - transactionIndex; - /** - * @_ignore: - */ - constructor(log, provider) { - this.provider = provider; - const topics = Object.freeze(log.topics.slice()); - defineProperties(this, { - transactionHash: log.transactionHash, - blockHash: log.blockHash, - blockNumber: log.blockNumber, - removed: log.removed, - address: log.address, - data: log.data, - topics, - index: log.index, - transactionIndex: log.transactionIndex, - }); - } - /** - * Returns a JSON-compatible object. - */ - toJSON() { - const { address, blockHash, blockNumber, data, index, removed, topics, transactionHash, transactionIndex } = this; - return { - _type: "log", - address, blockHash, blockNumber, data, index, - removed, topics, transactionHash, transactionIndex - }; - } - /** - * Returns the block that this log occurred in. - */ - async getBlock() { - const block = await this.provider.getBlock(this.blockHash); - assert(!!block, "failed to find transaction", "UNKNOWN_ERROR", {}); - return block; - } - /** - * Returns the transaction that this log occurred in. - */ - async getTransaction() { - const tx = await this.provider.getTransaction(this.transactionHash); - assert(!!tx, "failed to find transaction", "UNKNOWN_ERROR", {}); - return tx; - } - /** - * Returns the transaction receipt fot the transaction that this - * log occurred in. - */ - async getTransactionReceipt() { - const receipt = await this.provider.getTransactionReceipt(this.transactionHash); - assert(!!receipt, "failed to find transaction receipt", "UNKNOWN_ERROR", {}); - return receipt; - } - /** - * @_ignore: - */ - removedEvent() { - return createRemovedLogFilter(this); - } -} -////////////////////// -// Transaction Receipt -/* -export interface LegacyTransactionReceipt { - byzantium: false; - status: null; - root: string; -} - -export interface ByzantiumTransactionReceipt { - byzantium: true; - status: number; - root: null; -} -*/ -/** - * A **TransactionReceipt** includes additional information about a - * transaction that is only available after it has been mined. - */ -class TransactionReceipt { - /** - * The provider connected to the log used to fetch additional details - * if necessary. - */ - provider; - /** - * The address the transaction was sent to. - */ - to; - /** - * The sender of the transaction. - */ - from; - /** - * The address of the contract if the transaction was directly - * responsible for deploying one. - * - * This is non-null **only** if the ``to`` is empty and the ``data`` - * was successfully executed as initcode. - */ - contractAddress; - /** - * The transaction hash. - */ - hash; - /** - * The index of this transaction within the block transactions. - */ - index; - /** - * The block hash of the [[Block]] this transaction was included in. - */ - blockHash; - /** - * The block number of the [[Block]] this transaction was included in. - */ - blockNumber; - /** - * The bloom filter bytes that represent all logs that occurred within - * this transaction. This is generally not useful for most developers, - * but can be used to validate the included logs. - */ - logsBloom; - /** - * The actual amount of gas used by this transaction. - * - * When creating a transaction, the amount of gas that will be used can - * only be approximated, but the sender must pay the gas fee for the - * entire gas limit. After the transaction, the difference is refunded. - */ - gasUsed; - /** - * The gas used for BLObs. See [[link-eip-4844]]. - */ - blobGasUsed; - /** - * The amount of gas used by all transactions within the block for this - * and all transactions with a lower ``index``. - * - * This is generally not useful for developers but can be used to - * validate certain aspects of execution. - */ - cumulativeGasUsed; - /** - * The actual gas price used during execution. - * - * Due to the complexity of [[link-eip-1559]] this value can only - * be caluclated after the transaction has been mined, snce the base - * fee is protocol-enforced. - */ - gasPrice; - /** - * The price paid per BLOB in gas. See [[link-eip-4844]]. - */ - blobGasPrice; - /** - * The [[link-eip-2718]] transaction type. - */ - type; - //readonly byzantium!: boolean; - /** - * The status of this transaction, indicating success (i.e. ``1``) or - * a revert (i.e. ``0``). - * - * This is available in post-byzantium blocks, but some backends may - * backfill this value. - */ - status; - /** - * The root hash of this transaction. - * - * This is no present and was only included in pre-byzantium blocks, but - * could be used to validate certain parts of the receipt. - */ - root; - #logs; - /** - * @_ignore: - */ - constructor(tx, provider) { - this.#logs = Object.freeze(tx.logs.map((log) => { - return new Log(log, provider); - })); - let gasPrice = BN_0$2; - if (tx.effectiveGasPrice != null) { - gasPrice = tx.effectiveGasPrice; - } - else if (tx.gasPrice != null) { - gasPrice = tx.gasPrice; - } - defineProperties(this, { - provider, - to: tx.to, - from: tx.from, - contractAddress: tx.contractAddress, - hash: tx.hash, - index: tx.index, - blockHash: tx.blockHash, - blockNumber: tx.blockNumber, - logsBloom: tx.logsBloom, - gasUsed: tx.gasUsed, - cumulativeGasUsed: tx.cumulativeGasUsed, - blobGasUsed: tx.blobGasUsed, - gasPrice, - blobGasPrice: tx.blobGasPrice, - type: tx.type, - //byzantium: tx.byzantium, - status: tx.status, - root: tx.root - }); - } - /** - * The logs for this transaction. - */ - get logs() { return this.#logs; } - /** - * Returns a JSON-compatible representation. - */ - toJSON() { - const { to, from, contractAddress, hash, index, blockHash, blockNumber, logsBloom, logs, //byzantium, - status, root } = this; - return { - _type: "TransactionReceipt", - blockHash, blockNumber, - //byzantium, - contractAddress, - cumulativeGasUsed: toJson(this.cumulativeGasUsed), - from, - gasPrice: toJson(this.gasPrice), - blobGasUsed: toJson(this.blobGasUsed), - blobGasPrice: toJson(this.blobGasPrice), - gasUsed: toJson(this.gasUsed), - hash, index, logs, logsBloom, root, status, to - }; - } - /** - * @_ignore: - */ - get length() { return this.logs.length; } - [Symbol.iterator]() { - let index = 0; - return { - next: () => { - if (index < this.length) { - return { value: this.logs[index++], done: false }; - } - return { value: undefined, done: true }; - } - }; - } - /** - * The total fee for this transaction, in wei. - */ - get fee() { - return this.gasUsed * this.gasPrice; - } - /** - * Resolves to the block this transaction occurred in. - */ - async getBlock() { - const block = await this.provider.getBlock(this.blockHash); - if (block == null) { - throw new Error("TODO"); - } - return block; - } - /** - * Resolves to the transaction this transaction occurred in. - */ - async getTransaction() { - const tx = await this.provider.getTransaction(this.hash); - if (tx == null) { - throw new Error("TODO"); - } - return tx; - } - /** - * Resolves to the return value of the execution of this transaction. - * - * Support for this feature is limited, as it requires an archive node - * with the ``debug_`` or ``trace_`` API enabled. - */ - async getResult() { - return (await this.provider.getTransactionResult(this.hash)); - } - /** - * Resolves to the number of confirmations this transaction has. - */ - async confirmations() { - return (await this.provider.getBlockNumber()) - this.blockNumber + 1; - } - /** - * @_ignore: - */ - removedEvent() { - return createRemovedTransactionFilter(this); - } - /** - * @_ignore: - */ - reorderedEvent(other) { - assert(!other || other.isMined(), "unmined 'other' transction cannot be orphaned", "UNSUPPORTED_OPERATION", { operation: "reorderedEvent(other)" }); - return createReorderedTransactionFilter(this, other); - } -} -/** - * A **TransactionResponse** includes all properties about a transaction - * that was sent to the network, which may or may not be included in a - * block. - * - * The [[TransactionResponse-isMined]] can be used to check if the - * transaction has been mined as well as type guard that the otherwise - * possibly ``null`` properties are defined. - */ -class TransactionResponse { - /** - * The provider this is connected to, which will influence how its - * methods will resolve its async inspection methods. - */ - provider; - /** - * The block number of the block that this transaction was included in. - * - * This is ``null`` for pending transactions. - */ - blockNumber; - /** - * The blockHash of the block that this transaction was included in. - * - * This is ``null`` for pending transactions. - */ - blockHash; - /** - * The index within the block that this transaction resides at. - */ - index; - /** - * The transaction hash. - */ - hash; - /** - * The [[link-eip-2718]] transaction envelope type. This is - * ``0`` for legacy transactions types. - */ - type; - /** - * The receiver of this transaction. - * - * If ``null``, then the transaction is an initcode transaction. - * This means the result of executing the [[data]] will be deployed - * as a new contract on chain (assuming it does not revert) and the - * address may be computed using [[getCreateAddress]]. - */ - to; - /** - * The sender of this transaction. It is implicitly computed - * from the transaction pre-image hash (as the digest) and the - * [[signature]] using ecrecover. - */ - from; - /** - * The nonce, which is used to prevent replay attacks and offer - * a method to ensure transactions from a given sender are explicitly - * ordered. - * - * When sending a transaction, this must be equal to the number of - * transactions ever sent by [[from]]. - */ - nonce; - /** - * The maximum units of gas this transaction can consume. If execution - * exceeds this, the entries transaction is reverted and the sender - * is charged for the full amount, despite not state changes being made. - */ - gasLimit; - /** - * The gas price can have various values, depending on the network. - * - * In modern networks, for transactions that are included this is - * the //effective gas price// (the fee per gas that was actually - * charged), while for transactions that have not been included yet - * is the [[maxFeePerGas]]. - * - * For legacy transactions, or transactions on legacy networks, this - * is the fee that will be charged per unit of gas the transaction - * consumes. - */ - gasPrice; - /** - * The maximum priority fee (per unit of gas) to allow a - * validator to charge the sender. This is inclusive of the - * [[maxFeeFeePerGas]]. - */ - maxPriorityFeePerGas; - /** - * The maximum fee (per unit of gas) to allow this transaction - * to charge the sender. - */ - maxFeePerGas; - /** - * The [[link-eip-4844]] max fee per BLOb gas. - */ - maxFeePerBlobGas; - /** - * The data. - */ - data; - /** - * The value, in wei. Use [[formatEther]] to format this value - * as ether. - */ - value; - /** - * The chain ID. - */ - chainId; - /** - * The signature. - */ - signature; - /** - * The [[link-eip-2930]] access list for transaction types that - * support it, otherwise ``null``. - */ - accessList; - /** - * The [[link-eip-4844]] BLOb versioned hashes. - */ - blobVersionedHashes; - /** - * The [[link-eip-7702]] authorizations (if any). - */ - authorizationList; - #startBlock; - /** - * @_ignore: - */ - constructor(tx, provider) { - this.provider = provider; - this.blockNumber = (tx.blockNumber != null) ? tx.blockNumber : null; - this.blockHash = (tx.blockHash != null) ? tx.blockHash : null; - this.hash = tx.hash; - this.index = tx.index; - this.type = tx.type; - this.from = tx.from; - this.to = tx.to || null; - this.gasLimit = tx.gasLimit; - this.nonce = tx.nonce; - this.data = tx.data; - this.value = tx.value; - this.gasPrice = tx.gasPrice; - this.maxPriorityFeePerGas = (tx.maxPriorityFeePerGas != null) ? tx.maxPriorityFeePerGas : null; - this.maxFeePerGas = (tx.maxFeePerGas != null) ? tx.maxFeePerGas : null; - this.maxFeePerBlobGas = (tx.maxFeePerBlobGas != null) ? tx.maxFeePerBlobGas : null; - this.chainId = tx.chainId; - this.signature = tx.signature; - this.accessList = (tx.accessList != null) ? tx.accessList : null; - this.blobVersionedHashes = (tx.blobVersionedHashes != null) ? tx.blobVersionedHashes : null; - this.authorizationList = (tx.authorizationList != null) ? tx.authorizationList : null; - this.#startBlock = -1; - } - /** - * Returns a JSON-compatible representation of this transaction. - */ - toJSON() { - const { blockNumber, blockHash, index, hash, type, to, from, nonce, data, signature, accessList, blobVersionedHashes } = this; - return { - _type: "TransactionResponse", - accessList, blockNumber, blockHash, - blobVersionedHashes, - chainId: toJson(this.chainId), - data, from, - gasLimit: toJson(this.gasLimit), - gasPrice: toJson(this.gasPrice), - hash, - maxFeePerGas: toJson(this.maxFeePerGas), - maxPriorityFeePerGas: toJson(this.maxPriorityFeePerGas), - maxFeePerBlobGas: toJson(this.maxFeePerBlobGas), - nonce, signature, to, index, type, - value: toJson(this.value), - }; - } - /** - * Resolves to the Block that this transaction was included in. - * - * This will return null if the transaction has not been included yet. - */ - async getBlock() { - let blockNumber = this.blockNumber; - if (blockNumber == null) { - const tx = await this.getTransaction(); - if (tx) { - blockNumber = tx.blockNumber; - } - } - if (blockNumber == null) { - return null; - } - const block = this.provider.getBlock(blockNumber); - if (block == null) { - throw new Error("TODO"); - } - return block; - } - /** - * Resolves to this transaction being re-requested from the - * provider. This can be used if you have an unmined transaction - * and wish to get an up-to-date populated instance. - */ - async getTransaction() { - return this.provider.getTransaction(this.hash); - } - /** - * Resolve to the number of confirmations this transaction has. - */ - async confirmations() { - if (this.blockNumber == null) { - const { tx, blockNumber } = await resolveProperties({ - tx: this.getTransaction(), - blockNumber: this.provider.getBlockNumber() - }); - // Not mined yet... - if (tx == null || tx.blockNumber == null) { - return 0; - } - return blockNumber - tx.blockNumber + 1; - } - const blockNumber = await this.provider.getBlockNumber(); - return blockNumber - this.blockNumber + 1; - } - /** - * Resolves once this transaction has been mined and has - * %%confirms%% blocks including it (default: ``1``) with an - * optional %%timeout%%. - * - * This can resolve to ``null`` only if %%confirms%% is ``0`` - * and the transaction has not been mined, otherwise this will - * wait until enough confirmations have completed. - */ - async wait(_confirms, _timeout) { - const confirms = (_confirms == null) ? 1 : _confirms; - const timeout = (_timeout == null) ? 0 : _timeout; - let startBlock = this.#startBlock; - let nextScan = -1; - let stopScanning = (startBlock === -1) ? true : false; - const checkReplacement = async () => { - // Get the current transaction count for this sender - if (stopScanning) { - return null; - } - const { blockNumber, nonce } = await resolveProperties({ - blockNumber: this.provider.getBlockNumber(), - nonce: this.provider.getTransactionCount(this.from) - }); - // No transaction or our nonce has not been mined yet; but we - // can start scanning later when we do start - if (nonce < this.nonce) { - startBlock = blockNumber; - return; - } - // We were mined; no replacement - if (stopScanning) { - return null; - } - const mined = await this.getTransaction(); - if (mined && mined.blockNumber != null) { - return; - } - // We were replaced; start scanning for that transaction - // Starting to scan; look back a few extra blocks for safety - if (nextScan === -1) { - nextScan = startBlock - 3; - if (nextScan < this.#startBlock) { - nextScan = this.#startBlock; - } - } - while (nextScan <= blockNumber) { - // Get the next block to scan - if (stopScanning) { - return null; - } - const block = await this.provider.getBlock(nextScan, true); - // This should not happen; but we'll try again shortly - if (block == null) { - return; - } - // We were mined; no replacement - for (const hash of block) { - if (hash === this.hash) { - return; - } - } - // Search for the transaction that replaced us - for (let i = 0; i < block.length; i++) { - const tx = await block.getTransaction(i); - if (tx.from === this.from && tx.nonce === this.nonce) { - // Get the receipt - if (stopScanning) { - return null; - } - const receipt = await this.provider.getTransactionReceipt(tx.hash); - // This should not happen; but we'll try again shortly - if (receipt == null) { - return; - } - // We will retry this on the next block (this case could be optimized) - if ((blockNumber - receipt.blockNumber + 1) < confirms) { - return; - } - // The reason we were replaced - let reason = "replaced"; - if (tx.data === this.data && tx.to === this.to && tx.value === this.value) { - reason = "repriced"; - } - else if (tx.data === "0x" && tx.from === tx.to && tx.value === BN_0$2) { - reason = "cancelled"; - } - assert(false, "transaction was replaced", "TRANSACTION_REPLACED", { - cancelled: (reason === "replaced" || reason === "cancelled"), - reason, - replacement: tx.replaceableTransaction(startBlock), - hash: tx.hash, - receipt - }); - } - } - nextScan++; - } - return; - }; - const checkReceipt = (receipt) => { - if (receipt == null || receipt.status !== 0) { - return receipt; - } - assert(false, "transaction execution reverted", "CALL_EXCEPTION", { - action: "sendTransaction", - data: null, reason: null, invocation: null, revert: null, - transaction: { - to: receipt.to, - from: receipt.from, - data: "" // @TODO: in v7, split out sendTransaction properties - }, receipt - }); - }; - const receipt = await this.provider.getTransactionReceipt(this.hash); - if (confirms === 0) { - return checkReceipt(receipt); - } - if (receipt) { - if (confirms === 1 || (await receipt.confirmations()) >= confirms) { - return checkReceipt(receipt); - } - } - else { - // Check for a replacement; throws if a replacement was found - await checkReplacement(); - // Allow null only when the confirms is 0 - if (confirms === 0) { - return null; - } - } - const waiter = new Promise((resolve, reject) => { - // List of things to cancel when we have a result (one way or the other) - const cancellers = []; - const cancel = () => { cancellers.forEach((c) => c()); }; - // On cancel, stop scanning for replacements - cancellers.push(() => { stopScanning = true; }); - // Set up any timeout requested - if (timeout > 0) { - const timer = setTimeout(() => { - cancel(); - reject(makeError("wait for transaction timeout", "TIMEOUT")); - }, timeout); - cancellers.push(() => { clearTimeout(timer); }); - } - const txListener = async (receipt) => { - // Done; return it! - if ((await receipt.confirmations()) >= confirms) { - cancel(); - try { - resolve(checkReceipt(receipt)); - } - catch (error) { - reject(error); - } - } - }; - cancellers.push(() => { this.provider.off(this.hash, txListener); }); - this.provider.on(this.hash, txListener); - // We support replacement detection; start checking - if (startBlock >= 0) { - const replaceListener = async () => { - try { - // Check for a replacement; this throws only if one is found - await checkReplacement(); - } - catch (error) { - // We were replaced (with enough confirms); re-throw the error - if (isError(error, "TRANSACTION_REPLACED")) { - cancel(); - reject(error); - return; - } - } - // Rescheudle a check on the next block - if (!stopScanning) { - this.provider.once("block", replaceListener); - } - }; - cancellers.push(() => { this.provider.off("block", replaceListener); }); - this.provider.once("block", replaceListener); - } - }); - return await waiter; - } - /** - * Returns ``true`` if this transaction has been included. - * - * This is effective only as of the time the TransactionResponse - * was instantiated. To get up-to-date information, use - * [[getTransaction]]. - * - * This provides a Type Guard that this transaction will have - * non-null property values for properties that are null for - * unmined transactions. - */ - isMined() { - return (this.blockHash != null); - } - /** - * Returns true if the transaction is a legacy (i.e. ``type == 0``) - * transaction. - * - * This provides a Type Guard that this transaction will have - * the ``null``-ness for hardfork-specific properties set correctly. - */ - isLegacy() { - return (this.type === 0); - } - /** - * Returns true if the transaction is a Berlin (i.e. ``type == 1``) - * transaction. See [[link-eip-2070]]. - * - * This provides a Type Guard that this transaction will have - * the ``null``-ness for hardfork-specific properties set correctly. - */ - isBerlin() { - return (this.type === 1); - } - /** - * Returns true if the transaction is a London (i.e. ``type == 2``) - * transaction. See [[link-eip-1559]]. - * - * This provides a Type Guard that this transaction will have - * the ``null``-ness for hardfork-specific properties set correctly. - */ - isLondon() { - return (this.type === 2); - } - /** - * Returns true if hte transaction is a Cancun (i.e. ``type == 3``) - * transaction. See [[link-eip-4844]]. - */ - isCancun() { - return (this.type === 3); - } - /** - * Returns a filter which can be used to listen for orphan events - * that evict this transaction. - */ - removedEvent() { - assert(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); - return createRemovedTransactionFilter(this); - } - /** - * Returns a filter which can be used to listen for orphan events - * that re-order this event against %%other%%. - */ - reorderedEvent(other) { - assert(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); - assert(!other || other.isMined(), "unmined 'other' transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); - return createReorderedTransactionFilter(this, other); - } - /** - * Returns a new TransactionResponse instance which has the ability to - * detect (and throw an error) if the transaction is replaced, which - * will begin scanning at %%startBlock%%. - * - * This should generally not be used by developers and is intended - * primarily for internal use. Setting an incorrect %%startBlock%% can - * have devastating performance consequences if used incorrectly. - */ - replaceableTransaction(startBlock) { - assertArgument(Number.isInteger(startBlock) && startBlock >= 0, "invalid startBlock", "startBlock", startBlock); - const tx = new TransactionResponse(this, this.provider); - tx.#startBlock = startBlock; - return tx; - } -} -function createOrphanedBlockFilter(block) { - return { orphan: "drop-block", hash: block.hash, number: block.number }; -} -function createReorderedTransactionFilter(tx, other) { - return { orphan: "reorder-transaction", tx, other }; -} -function createRemovedTransactionFilter(tx) { - return { orphan: "drop-transaction", tx }; -} -function createRemovedLogFilter(log) { - return { orphan: "drop-log", log: { - transactionHash: log.transactionHash, - blockHash: log.blockHash, - blockNumber: log.blockNumber, - address: log.address, - data: log.data, - topics: Object.freeze(log.topics.slice()), - index: log.index - } }; -} - -// import from provider.ts instead of index.ts to prevent circular dep -// from EtherscanProvider -/** - * An **EventLog** contains additional properties parsed from the [[Log]]. - */ -class EventLog extends Log { - /** - * The Contract Interface. - */ - interface; - /** - * The matching event. - */ - fragment; - /** - * The parsed arguments passed to the event by ``emit``. - */ - args; - /** - * @_ignore: - */ - constructor(log, iface, fragment) { - super(log, log.provider); - const args = iface.decodeEventLog(fragment, log.data, log.topics); - defineProperties(this, { args, fragment, interface: iface }); - } - /** - * The name of the event. - */ - get eventName() { return this.fragment.name; } - /** - * The signature of the event. - */ - get eventSignature() { return this.fragment.format(); } -} -/** - * An **EventLog** contains additional properties parsed from the [[Log]]. - */ -class UndecodedEventLog extends Log { - /** - * The error encounted when trying to decode the log. - */ - error; - /** - * @_ignore: - */ - constructor(log, error) { - super(log, log.provider); - defineProperties(this, { error }); - } -} -/** - * A **ContractTransactionReceipt** includes the parsed logs from a - * [[TransactionReceipt]]. - */ -class ContractTransactionReceipt extends TransactionReceipt { - #iface; - /** - * @_ignore: - */ - constructor(iface, provider, tx) { - super(tx, provider); - this.#iface = iface; - } - /** - * The parsed logs for any [[Log]] which has a matching event in the - * Contract ABI. - */ - get logs() { - return super.logs.map((log) => { - const fragment = log.topics.length ? this.#iface.getEvent(log.topics[0]) : null; - if (fragment) { - try { - return new EventLog(log, this.#iface, fragment); - } - catch (error) { - return new UndecodedEventLog(log, error); - } - } - return log; - }); - } -} -/** - * A **ContractTransactionResponse** will return a - * [[ContractTransactionReceipt]] when waited on. - */ -class ContractTransactionResponse extends TransactionResponse { - #iface; - /** - * @_ignore: - */ - constructor(iface, provider, tx) { - super(tx, provider); - this.#iface = iface; - } - /** - * Resolves once this transaction has been mined and has - * %%confirms%% blocks including it (default: ``1``) with an - * optional %%timeout%%. - * - * This can resolve to ``null`` only if %%confirms%% is ``0`` - * and the transaction has not been mined, otherwise this will - * wait until enough confirmations have completed. - */ - async wait(confirms, timeout) { - const receipt = await super.wait(confirms, timeout); - if (receipt == null) { - return null; - } - return new ContractTransactionReceipt(this.#iface, this.provider, receipt); - } -} -/** - * A **ContractUnknownEventPayload** is included as the last parameter to - * Contract Events when the event does not match any events in the ABI. - */ -class ContractUnknownEventPayload extends EventPayload { - /** - * The log with no matching events. - */ - log; - /** - * @_event: - */ - constructor(contract, listener, filter, log) { - super(contract, listener, filter); - defineProperties(this, { log }); - } - /** - * Resolves to the block the event occured in. - */ - async getBlock() { - return await this.log.getBlock(); - } - /** - * Resolves to the transaction the event occured in. - */ - async getTransaction() { - return await this.log.getTransaction(); - } - /** - * Resolves to the transaction receipt the event occured in. - */ - async getTransactionReceipt() { - return await this.log.getTransactionReceipt(); - } -} -/** - * A **ContractEventPayload** is included as the last parameter to - * Contract Events when the event is known. - */ -class ContractEventPayload extends ContractUnknownEventPayload { - /** - * @_ignore: - */ - constructor(contract, listener, filter, fragment, _log) { - super(contract, listener, filter, new EventLog(_log, contract.interface, fragment)); - const args = contract.interface.decodeEventLog(fragment, this.log.data, this.log.topics); - defineProperties(this, { args, fragment }); - } - /** - * The event name. - */ - get eventName() { - return this.fragment.name; - } - /** - * The event signature. - */ - get eventSignature() { - return this.fragment.format(); - } -} - -const BN_0$1 = BigInt(0); -function canCall(value) { - return (value && typeof (value.call) === "function"); -} -function canEstimate(value) { - return (value && typeof (value.estimateGas) === "function"); -} -function canResolve(value) { - return (value && typeof (value.resolveName) === "function"); -} -function canSend(value) { - return (value && typeof (value.sendTransaction) === "function"); -} -function getResolver(value) { - if (value != null) { - if (canResolve(value)) { - return value; - } - if (value.provider) { - return value.provider; - } - } - return undefined; -} -class PreparedTopicFilter { - #filter; - fragment; - constructor(contract, fragment, args) { - defineProperties(this, { fragment }); - if (fragment.inputs.length < args.length) { - throw new Error("too many arguments"); - } - // Recursively descend into args and resolve any addresses - const runner = getRunner(contract.runner, "resolveName"); - const resolver = canResolve(runner) ? runner : null; - this.#filter = (async function () { - const resolvedArgs = await Promise.all(fragment.inputs.map((param, index) => { - const arg = args[index]; - if (arg == null) { - return null; - } - return param.walkAsync(args[index], (type, value) => { - if (type === "address") { - if (Array.isArray(value)) { - return Promise.all(value.map((v) => resolveAddress(v, resolver))); - } - return resolveAddress(value, resolver); - } - return value; - }); - })); - return contract.interface.encodeFilterTopics(fragment, resolvedArgs); - })(); - } - getTopicFilter() { - return this.#filter; - } -} -// A = Arguments passed in as a tuple -// R = The result type of the call (i.e. if only one return type, -// the qualified type, otherwise Result) -// D = The type the default call will return (i.e. R for view/pure, -// TransactionResponse otherwise) -//export interface ContractMethod = Array, R = any, D extends R | ContractTransactionResponse = ContractTransactionResponse> { -function getRunner(value, feature) { - if (value == null) { - return null; - } - if (typeof (value[feature]) === "function") { - return value; - } - if (value.provider && typeof (value.provider[feature]) === "function") { - return value.provider; - } - return null; -} -function getProvider(value) { - if (value == null) { - return null; - } - return value.provider || null; -} -/** - * @_ignore: - */ -async function copyOverrides(arg, allowed) { - // Make sure the overrides passed in are a valid overrides object - const _overrides = Typed.dereference(arg, "overrides"); - assertArgument(typeof (_overrides) === "object", "invalid overrides parameter", "overrides", arg); - // Create a shallow copy (we'll deep-ify anything needed during normalizing) - const overrides = copyRequest(_overrides); - assertArgument(overrides.to == null || (allowed || []).indexOf("to") >= 0, "cannot override to", "overrides.to", overrides.to); - assertArgument(overrides.data == null || (allowed || []).indexOf("data") >= 0, "cannot override data", "overrides.data", overrides.data); - // Resolve any from - if (overrides.from) { - overrides.from = overrides.from; - } - return overrides; -} -/** - * @_ignore: - */ -async function resolveArgs(_runner, inputs, args) { - // Recursively descend into args and resolve any addresses - const runner = getRunner(_runner, "resolveName"); - const resolver = canResolve(runner) ? runner : null; - return await Promise.all(inputs.map((param, index) => { - return param.walkAsync(args[index], (type, value) => { - value = Typed.dereference(value, type); - if (type === "address") { - return resolveAddress(value, resolver); - } - return value; - }); - })); -} -function buildWrappedFallback(contract) { - const populateTransaction = async function (overrides) { - // If an overrides was passed in, copy it and normalize the values - const tx = (await copyOverrides(overrides, ["data"])); - tx.to = await contract.getAddress(); - if (tx.from) { - tx.from = await resolveAddress(tx.from, getResolver(contract.runner)); - } - const iface = contract.interface; - const noValue = (getBigInt((tx.value || BN_0$1), "overrides.value") === BN_0$1); - const noData = ((tx.data || "0x") === "0x"); - if (iface.fallback && !iface.fallback.payable && iface.receive && !noData && !noValue) { - assertArgument(false, "cannot send data to receive or send value to non-payable fallback", "overrides", overrides); - } - assertArgument(iface.fallback || noData, "cannot send data to receive-only contract", "overrides.data", tx.data); - // Only allow payable contracts to set non-zero value - const payable = iface.receive || (iface.fallback && iface.fallback.payable); - assertArgument(payable || noValue, "cannot send value to non-payable fallback", "overrides.value", tx.value); - // Only allow fallback contracts to set non-empty data - assertArgument(iface.fallback || noData, "cannot send data to receive-only contract", "overrides.data", tx.data); - return tx; - }; - const staticCall = async function (overrides) { - const runner = getRunner(contract.runner, "call"); - assert(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" }); - const tx = await populateTransaction(overrides); - try { - return await runner.call(tx); - } - catch (error) { - if (isCallException(error) && error.data) { - throw contract.interface.makeError(error.data, tx); - } - throw error; - } - }; - const send = async function (overrides) { - const runner = contract.runner; - assert(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" }); - const tx = await runner.sendTransaction(await populateTransaction(overrides)); - const provider = getProvider(contract.runner); - // @TODO: the provider can be null; make a custom dummy provider that will throw a - // meaningful error - return new ContractTransactionResponse(contract.interface, provider, tx); - }; - const estimateGas = async function (overrides) { - const runner = getRunner(contract.runner, "estimateGas"); - assert(canEstimate(runner), "contract runner does not support gas estimation", "UNSUPPORTED_OPERATION", { operation: "estimateGas" }); - return await runner.estimateGas(await populateTransaction(overrides)); - }; - const method = async (overrides) => { - return await send(overrides); - }; - defineProperties(method, { - _contract: contract, - estimateGas, - populateTransaction, - send, staticCall - }); - return method; -} -function buildWrappedMethod(contract, key) { - const getFragment = function (...args) { - const fragment = contract.interface.getFunction(key, args); - assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", { - operation: "fragment", - info: { key, args } - }); - return fragment; - }; - const populateTransaction = async function (...args) { - const fragment = getFragment(...args); - // If an overrides was passed in, copy it and normalize the values - let overrides = {}; - if (fragment.inputs.length + 1 === args.length) { - overrides = await copyOverrides(args.pop()); - if (overrides.from) { - overrides.from = await resolveAddress(overrides.from, getResolver(contract.runner)); - } - } - if (fragment.inputs.length !== args.length) { - throw new Error("internal error: fragment inputs doesn't match arguments; should not happen"); - } - const resolvedArgs = await resolveArgs(contract.runner, fragment.inputs, args); - return Object.assign({}, overrides, await resolveProperties({ - to: contract.getAddress(), - data: contract.interface.encodeFunctionData(fragment, resolvedArgs) - })); - }; - const staticCall = async function (...args) { - const result = await staticCallResult(...args); - if (result.length === 1) { - return result[0]; - } - return result; - }; - const send = async function (...args) { - const runner = contract.runner; - assert(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" }); - const tx = await runner.sendTransaction(await populateTransaction(...args)); - const provider = getProvider(contract.runner); - // @TODO: the provider can be null; make a custom dummy provider that will throw a - // meaningful error - return new ContractTransactionResponse(contract.interface, provider, tx); - }; - const estimateGas = async function (...args) { - const runner = getRunner(contract.runner, "estimateGas"); - assert(canEstimate(runner), "contract runner does not support gas estimation", "UNSUPPORTED_OPERATION", { operation: "estimateGas" }); - return await runner.estimateGas(await populateTransaction(...args)); - }; - const staticCallResult = async function (...args) { - const runner = getRunner(contract.runner, "call"); - assert(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" }); - const tx = await populateTransaction(...args); - let result = "0x"; - try { - result = await runner.call(tx); - } - catch (error) { - if (isCallException(error) && error.data) { - throw contract.interface.makeError(error.data, tx); - } - throw error; - } - const fragment = getFragment(...args); - return contract.interface.decodeFunctionResult(fragment, result); - }; - const method = async (...args) => { - const fragment = getFragment(...args); - if (fragment.constant) { - return await staticCall(...args); - } - return await send(...args); - }; - defineProperties(method, { - name: contract.interface.getFunctionName(key), - _contract: contract, _key: key, - getFragment, - estimateGas, - populateTransaction, - send, staticCall, staticCallResult, - }); - // Only works on non-ambiguous keys (refined fragment is always non-ambiguous) - Object.defineProperty(method, "fragment", { - configurable: false, - enumerable: true, - get: () => { - const fragment = contract.interface.getFunction(key); - assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", { - operation: "fragment", - info: { key } - }); - return fragment; - } - }); - return method; -} -function buildWrappedEvent(contract, key) { - const getFragment = function (...args) { - const fragment = contract.interface.getEvent(key, args); - assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", { - operation: "fragment", - info: { key, args } - }); - return fragment; - }; - const method = function (...args) { - return new PreparedTopicFilter(contract, getFragment(...args), args); - }; - defineProperties(method, { - name: contract.interface.getEventName(key), - _contract: contract, _key: key, - getFragment - }); - // Only works on non-ambiguous keys (refined fragment is always non-ambiguous) - Object.defineProperty(method, "fragment", { - configurable: false, - enumerable: true, - get: () => { - const fragment = contract.interface.getEvent(key); - assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", { - operation: "fragment", - info: { key } - }); - return fragment; - } - }); - return method; -} -// The combination of TypeScrype, Private Fields and Proxies makes -// the world go boom; so we hide variables with some trickery keeping -// a symbol attached to each BaseContract which its sub-class (even -// via a Proxy) can reach and use to look up its internal values. -const internal = Symbol.for("_ethersInternal_contract"); -const internalValues = new WeakMap(); -function setInternal(contract, values) { - internalValues.set(contract[internal], values); -} -function getInternal(contract) { - return internalValues.get(contract[internal]); -} -function isDeferred(value) { - return (value && typeof (value) === "object" && ("getTopicFilter" in value) && - (typeof (value.getTopicFilter) === "function") && value.fragment); -} -async function getSubInfo(contract, event) { - let topics; - let fragment = null; - // Convert named events to topicHash and get the fragment for - // events which need deconstructing. - if (Array.isArray(event)) { - const topicHashify = function (name) { - if (isHexString(name, 32)) { - return name; - } - const fragment = contract.interface.getEvent(name); - assertArgument(fragment, "unknown fragment", "name", name); - return fragment.topicHash; - }; - // Array of Topics and Names; e.g. `[ "0x1234...89ab", "Transfer(address)" ]` - topics = event.map((e) => { - if (e == null) { - return null; - } - if (Array.isArray(e)) { - return e.map(topicHashify); - } - return topicHashify(e); - }); - } - else if (event === "*") { - topics = [null]; - } - else if (typeof (event) === "string") { - if (isHexString(event, 32)) { - // Topic Hash - topics = [event]; - } - else { - // Name or Signature; e.g. `"Transfer", `"Transfer(address)"` - fragment = contract.interface.getEvent(event); - assertArgument(fragment, "unknown fragment", "event", event); - topics = [fragment.topicHash]; - } - } - else if (isDeferred(event)) { - // Deferred Topic Filter; e.g. `contract.filter.Transfer(from)` - topics = await event.getTopicFilter(); - } - else if ("fragment" in event) { - // ContractEvent; e.g. `contract.filter.Transfer` - fragment = event.fragment; - topics = [fragment.topicHash]; - } - else { - assertArgument(false, "unknown event name", "event", event); - } - // Normalize topics and sort TopicSets - topics = topics.map((t) => { - if (t == null) { - return null; - } - if (Array.isArray(t)) { - const items = Array.from(new Set(t.map((t) => t.toLowerCase())).values()); - if (items.length === 1) { - return items[0]; - } - items.sort(); - return items; - } - return t.toLowerCase(); - }); - const tag = topics.map((t) => { - if (t == null) { - return "null"; - } - if (Array.isArray(t)) { - return t.join("|"); - } - return t; - }).join("&"); - return { fragment, tag, topics }; -} -async function hasSub(contract, event) { - const { subs } = getInternal(contract); - return subs.get((await getSubInfo(contract, event)).tag) || null; -} -async function getSub(contract, operation, event) { - // Make sure our runner can actually subscribe to events - const provider = getProvider(contract.runner); - assert(provider, "contract runner does not support subscribing", "UNSUPPORTED_OPERATION", { operation }); - const { fragment, tag, topics } = await getSubInfo(contract, event); - const { addr, subs } = getInternal(contract); - let sub = subs.get(tag); - if (!sub) { - const address = (addr ? addr : contract); - const filter = { address, topics }; - const listener = (log) => { - let foundFragment = fragment; - if (foundFragment == null) { - try { - foundFragment = contract.interface.getEvent(log.topics[0]); - } - catch (error) { } - } - // If fragment is null, we do not deconstruct the args to emit - if (foundFragment) { - const _foundFragment = foundFragment; - const args = fragment ? contract.interface.decodeEventLog(fragment, log.data, log.topics) : []; - emit(contract, event, args, (listener) => { - return new ContractEventPayload(contract, listener, event, _foundFragment, log); - }); - } - else { - emit(contract, event, [], (listener) => { - return new ContractUnknownEventPayload(contract, listener, event, log); - }); - } - }; - let starting = []; - const start = () => { - if (starting.length) { - return; - } - starting.push(provider.on(filter, listener)); - }; - const stop = async () => { - if (starting.length == 0) { - return; - } - let started = starting; - starting = []; - await Promise.all(started); - provider.off(filter, listener); - }; - sub = { tag, listeners: [], start, stop }; - subs.set(tag, sub); - } - return sub; -} -// We use this to ensure one emit resolves before firing the next to -// ensure correct ordering (note this cannot throw and just adds the -// notice to the event queu using setTimeout). -let lastEmit = Promise.resolve(); -async function _emit(contract, event, args, payloadFunc) { - await lastEmit; - const sub = await hasSub(contract, event); - if (!sub) { - return false; - } - const count = sub.listeners.length; - sub.listeners = sub.listeners.filter(({ listener, once }) => { - const passArgs = Array.from(args); - if (payloadFunc) { - passArgs.push(payloadFunc(once ? null : listener)); - } - try { - listener.call(contract, ...passArgs); - } - catch (error) { } - return !once; - }); - if (sub.listeners.length === 0) { - sub.stop(); - getInternal(contract).subs.delete(sub.tag); - } - return (count > 0); -} -async function emit(contract, event, args, payloadFunc) { - try { - await lastEmit; - } - catch (error) { } - const resultPromise = _emit(contract, event, args, payloadFunc); - lastEmit = resultPromise; - return await resultPromise; -} -const passProperties = ["then"]; -class BaseContract { - /** - * The target to connect to. - * - * This can be an address, ENS name or any [[Addressable]], such as - * another contract. To get the resolved address, use the ``getAddress`` - * method. - */ - target; - /** - * The contract Interface. - */ - interface; - /** - * The connected runner. This is generally a [[Provider]] or a - * [[Signer]], which dictates what operations are supported. - * - * For example, a **Contract** connected to a [[Provider]] may - * only execute read-only operations. - */ - runner; - /** - * All the Events available on this contract. - */ - filters; - /** - * @_ignore: - */ - [internal]; - /** - * The fallback or receive function if any. - */ - fallback; - /** - * Creates a new contract connected to %%target%% with the %%abi%% and - * optionally connected to a %%runner%% to perform operations on behalf - * of. - */ - constructor(target, abi, runner, _deployTx) { - assertArgument(typeof (target) === "string" || isAddressable(target), "invalid value for Contract target", "target", target); - if (runner == null) { - runner = null; - } - const iface = Interface.from(abi); - defineProperties(this, { target, runner, interface: iface }); - Object.defineProperty(this, internal, { value: {} }); - let addrPromise; - let addr = null; - let deployTx = null; - if (_deployTx) { - const provider = getProvider(runner); - // @TODO: the provider can be null; make a custom dummy provider that will throw a - // meaningful error - deployTx = new ContractTransactionResponse(this.interface, provider, _deployTx); - } - let subs = new Map(); - // Resolve the target as the address - if (typeof (target) === "string") { - if (isHexString(target)) { - addr = target; - addrPromise = Promise.resolve(target); - } - else { - const resolver = getRunner(runner, "resolveName"); - if (!canResolve(resolver)) { - throw makeError("contract runner does not support name resolution", "UNSUPPORTED_OPERATION", { - operation: "resolveName" - }); - } - addrPromise = resolver.resolveName(target).then((addr) => { - if (addr == null) { - throw makeError("an ENS name used for a contract target must be correctly configured", "UNCONFIGURED_NAME", { - value: target - }); - } - getInternal(this).addr = addr; - return addr; - }); - } - } - else { - addrPromise = target.getAddress().then((addr) => { - if (addr == null) { - throw new Error("TODO"); - } - getInternal(this).addr = addr; - return addr; - }); - } - // Set our private values - setInternal(this, { addrPromise, addr, deployTx, subs }); - // Add the event filters - const filters = new Proxy({}, { - get: (target, prop, receiver) => { - // Pass important checks (like `then` for Promise) through - if (typeof (prop) === "symbol" || passProperties.indexOf(prop) >= 0) { - return Reflect.get(target, prop, receiver); - } - try { - return this.getEvent(prop); - } - catch (error) { - if (!isError(error, "INVALID_ARGUMENT") || error.argument !== "key") { - throw error; - } - } - return undefined; - }, - has: (target, prop) => { - // Pass important checks (like `then` for Promise) through - if (passProperties.indexOf(prop) >= 0) { - return Reflect.has(target, prop); - } - return Reflect.has(target, prop) || this.interface.hasEvent(String(prop)); - } - }); - defineProperties(this, { filters }); - defineProperties(this, { - fallback: ((iface.receive || iface.fallback) ? (buildWrappedFallback(this)) : null) - }); - // Return a Proxy that will respond to functions - return new Proxy(this, { - get: (target, prop, receiver) => { - if (typeof (prop) === "symbol" || prop in target || passProperties.indexOf(prop) >= 0) { - return Reflect.get(target, prop, receiver); - } - // Undefined properties should return undefined - try { - return target.getFunction(prop); - } - catch (error) { - if (!isError(error, "INVALID_ARGUMENT") || error.argument !== "key") { - throw error; - } - } - return undefined; - }, - has: (target, prop) => { - if (typeof (prop) === "symbol" || prop in target || passProperties.indexOf(prop) >= 0) { - return Reflect.has(target, prop); - } - return target.interface.hasFunction(prop); - } - }); - } - /** - * Return a new Contract instance with the same target and ABI, but - * a different %%runner%%. - */ - connect(runner) { - return new BaseContract(this.target, this.interface, runner); - } - /** - * Return a new Contract instance with the same ABI and runner, but - * a different %%target%%. - */ - attach(target) { - return new BaseContract(target, this.interface, this.runner); - } - /** - * Return the resolved address of this Contract. - */ - async getAddress() { return await getInternal(this).addrPromise; } - /** - * Return the deployed bytecode or null if no bytecode is found. - */ - async getDeployedCode() { - const provider = getProvider(this.runner); - assert(provider, "runner does not support .provider", "UNSUPPORTED_OPERATION", { operation: "getDeployedCode" }); - const code = await provider.getCode(await this.getAddress()); - if (code === "0x") { - return null; - } - return code; - } - /** - * Resolve to this Contract once the bytecode has been deployed, or - * resolve immediately if already deployed. - */ - async waitForDeployment() { - // We have the deployment transaction; just use that (throws if deployment fails) - const deployTx = this.deploymentTransaction(); - if (deployTx) { - await deployTx.wait(); - return this; - } - // Check for code - const code = await this.getDeployedCode(); - if (code != null) { - return this; - } - // Make sure we can subscribe to a provider event - const provider = getProvider(this.runner); - assert(provider != null, "contract runner does not support .provider", "UNSUPPORTED_OPERATION", { operation: "waitForDeployment" }); - return new Promise((resolve, reject) => { - const checkCode = async () => { - try { - const code = await this.getDeployedCode(); - if (code != null) { - return resolve(this); - } - provider.once("block", checkCode); - } - catch (error) { - reject(error); - } - }; - checkCode(); - }); - } - /** - * Return the transaction used to deploy this contract. - * - * This is only available if this instance was returned from a - * [[ContractFactory]]. - */ - deploymentTransaction() { - return getInternal(this).deployTx; - } - /** - * Return the function for a given name. This is useful when a contract - * method name conflicts with a JavaScript name such as ``prototype`` or - * when using a Contract programmatically. - */ - getFunction(key) { - if (typeof (key) !== "string") { - key = key.format(); - } - const func = buildWrappedMethod(this, key); - return func; - } - /** - * Return the event for a given name. This is useful when a contract - * event name conflicts with a JavaScript name such as ``prototype`` or - * when using a Contract programmatically. - */ - getEvent(key) { - if (typeof (key) !== "string") { - key = key.format(); - } - return buildWrappedEvent(this, key); - } - /** - * @_ignore: - */ - async queryTransaction(hash) { - throw new Error("@TODO"); - } - /* - // @TODO: this is a non-backwards compatible change, but will be added - // in v7 and in a potential SmartContract class in an upcoming - // v6 release - async getTransactionReceipt(hash: string): Promise { - const provider = getProvider(this.runner); - assert(provider, "contract runner does not have a provider", - "UNSUPPORTED_OPERATION", { operation: "queryTransaction" }); - - const receipt = await provider.getTransactionReceipt(hash); - if (receipt == null) { return null; } - - return new ContractTransactionReceipt(this.interface, provider, receipt); - } - */ - /** - * Provide historic access to event data for %%event%% in the range - * %%fromBlock%% (default: ``0``) to %%toBlock%% (default: ``"latest"``) - * inclusive. - */ - async queryFilter(event, fromBlock, toBlock) { - if (fromBlock == null) { - fromBlock = 0; - } - if (toBlock == null) { - toBlock = "latest"; - } - const { addr, addrPromise } = getInternal(this); - const address = (addr ? addr : (await addrPromise)); - const { fragment, topics } = await getSubInfo(this, event); - const filter = { address, topics, fromBlock, toBlock }; - const provider = getProvider(this.runner); - assert(provider, "contract runner does not have a provider", "UNSUPPORTED_OPERATION", { operation: "queryFilter" }); - return (await provider.getLogs(filter)).map((log) => { - let foundFragment = fragment; - if (foundFragment == null) { - try { - foundFragment = this.interface.getEvent(log.topics[0]); - } - catch (error) { } - } - if (foundFragment) { - try { - return new EventLog(log, this.interface, foundFragment); - } - catch (error) { - return new UndecodedEventLog(log, error); - } - } - return new Log(log, provider); - }); - } - /** - * Add an event %%listener%% for the %%event%%. - */ - async on(event, listener) { - const sub = await getSub(this, "on", event); - sub.listeners.push({ listener, once: false }); - sub.start(); - return this; - } - /** - * Add an event %%listener%% for the %%event%%, but remove the listener - * after it is fired once. - */ - async once(event, listener) { - const sub = await getSub(this, "once", event); - sub.listeners.push({ listener, once: true }); - sub.start(); - return this; - } - /** - * Emit an %%event%% calling all listeners with %%args%%. - * - * Resolves to ``true`` if any listeners were called. - */ - async emit(event, ...args) { - return await emit(this, event, args, null); - } - /** - * Resolves to the number of listeners of %%event%% or the total number - * of listeners if unspecified. - */ - async listenerCount(event) { - if (event) { - const sub = await hasSub(this, event); - if (!sub) { - return 0; - } - return sub.listeners.length; - } - const { subs } = getInternal(this); - let total = 0; - for (const { listeners } of subs.values()) { - total += listeners.length; - } - return total; - } - /** - * Resolves to the listeners subscribed to %%event%% or all listeners - * if unspecified. - */ - async listeners(event) { - if (event) { - const sub = await hasSub(this, event); - if (!sub) { - return []; - } - return sub.listeners.map(({ listener }) => listener); - } - const { subs } = getInternal(this); - let result = []; - for (const { listeners } of subs.values()) { - result = result.concat(listeners.map(({ listener }) => listener)); - } - return result; - } - /** - * Remove the %%listener%% from the listeners for %%event%% or remove - * all listeners if unspecified. - */ - async off(event, listener) { - const sub = await hasSub(this, event); - if (!sub) { - return this; - } - if (listener) { - const index = sub.listeners.map(({ listener }) => listener).indexOf(listener); - if (index >= 0) { - sub.listeners.splice(index, 1); - } - } - if (listener == null || sub.listeners.length === 0) { - sub.stop(); - getInternal(this).subs.delete(sub.tag); - } - return this; - } - /** - * Remove all the listeners for %%event%% or remove all listeners if - * unspecified. - */ - async removeAllListeners(event) { - if (event) { - const sub = await hasSub(this, event); - if (!sub) { - return this; - } - sub.stop(); - getInternal(this).subs.delete(sub.tag); - } - else { - const { subs } = getInternal(this); - for (const { tag, stop } of subs.values()) { - stop(); - subs.delete(tag); - } - } - return this; - } - /** - * Alias for [on]. - */ - async addListener(event, listener) { - return await this.on(event, listener); - } - /** - * Alias for [off]. - */ - async removeListener(event, listener) { - return await this.off(event, listener); - } - /** - * Create a new Class for the %%abi%%. - */ - static buildClass(abi) { - class CustomContract extends BaseContract { - constructor(address, runner = null) { - super(address, abi, runner); - } - } - return CustomContract; - } - ; - /** - * Create a new BaseContract with a specified Interface. - */ - static from(target, abi, runner) { - if (runner == null) { - runner = null; - } - const contract = new this(target, abi, runner); - return contract; - } -} -function _ContractBase() { - return BaseContract; -} -/** - * A [[BaseContract]] with no type guards on its methods or events. - */ -class Contract extends _ContractBase() { -} - -// A = Arguments to the constructor -// I = Interface of deployed contracts -/** - * A **ContractFactory** is used to deploy a Contract to the blockchain. - */ -class ContractFactory { - /** - * The Contract Interface. - */ - interface; - /** - * The Contract deployment bytecode. Often called the initcode. - */ - bytecode; - /** - * The ContractRunner to deploy the Contract as. - */ - runner; - /** - * Create a new **ContractFactory** with %%abi%% and %%bytecode%%, - * optionally connected to %%runner%%. - * - * The %%bytecode%% may be the ``bytecode`` property within the - * standard Solidity JSON output. - */ - constructor(abi, bytecode, runner) { - const iface = Interface.from(abi); - // Dereference Solidity bytecode objects and allow a missing `0x`-prefix - if (bytecode instanceof Uint8Array) { - bytecode = hexlify(getBytes(bytecode)); - } - else { - if (typeof (bytecode) === "object") { - bytecode = bytecode.object; - } - if (!bytecode.startsWith("0x")) { - bytecode = "0x" + bytecode; - } - bytecode = hexlify(getBytes(bytecode)); - } - defineProperties(this, { - bytecode, interface: iface, runner: (runner || null) - }); - } - attach(target) { - return new BaseContract(target, this.interface, this.runner); - } - /** - * Resolves to the transaction to deploy the contract, passing %%args%% - * into the constructor. - */ - async getDeployTransaction(...args) { - let overrides = {}; - const fragment = this.interface.deploy; - if (fragment.inputs.length + 1 === args.length) { - overrides = await copyOverrides(args.pop()); - } - if (fragment.inputs.length !== args.length) { - throw new Error("incorrect number of arguments to constructor"); - } - const resolvedArgs = await resolveArgs(this.runner, fragment.inputs, args); - const data = concat([this.bytecode, this.interface.encodeDeploy(resolvedArgs)]); - return Object.assign({}, overrides, { data }); - } - /** - * Resolves to the Contract deployed by passing %%args%% into the - * constructor. - * - * This will resolve to the Contract before it has been deployed to the - * network, so the [[BaseContract-waitForDeployment]] should be used before - * sending any transactions to it. - */ - async deploy(...args) { - const tx = await this.getDeployTransaction(...args); - assert(this.runner && typeof (this.runner.sendTransaction) === "function", "factory runner does not support sending transactions", "UNSUPPORTED_OPERATION", { - operation: "sendTransaction" - }); - const sentTx = await this.runner.sendTransaction(tx); - const address = getCreateAddress(sentTx); - return new BaseContract(address, this.interface, this.runner, sentTx); - } - /** - * Return a new **ContractFactory** with the same ABI and bytecode, - * but connected to %%runner%%. - */ - connect(runner) { - return new ContractFactory(this.interface, this.bytecode, runner); - } - /** - * Create a new **ContractFactory** from the standard Solidity JSON output. - */ - static fromSolidity(output, runner) { - assertArgument(output != null, "bad compiler output", "output", output); - if (typeof (output) === "string") { - output = JSON.parse(output); - } - const abi = output.abi; - let bytecode = ""; - if (output.bytecode) { - bytecode = output.bytecode; - } - else if (output.evm && output.evm.bytecode) { - bytecode = output.evm.bytecode; - } - return new this(abi, bytecode, runner); - } -} - -/** - * ENS is a service which allows easy-to-remember names to map to - * network addresses. - * - * @_section: api/providers/ens-resolver:ENS Resolver [about-ens-rsolver] - */ -// @TODO: This should use the fetch-data:ipfs gateway -// Trim off the ipfs:// prefix and return the default gateway URL -function getIpfsLink(link) { - if (link.match(/^ipfs:\/\/ipfs\//i)) { - link = link.substring(12); - } - else if (link.match(/^ipfs:\/\//i)) { - link = link.substring(7); - } - else { - assertArgument(false, "unsupported IPFS format", "link", link); - } - return `https:/\/gateway.ipfs.io/ipfs/${link}`; -} -/** - * A provider plugin super-class for processing multicoin address types. - */ -class MulticoinProviderPlugin { - /** - * The name. - */ - name; - /** - * Creates a new **MulticoinProviderPluing** for %%name%%. - */ - constructor(name) { - defineProperties(this, { name }); - } - connect(proivder) { - return this; - } - /** - * Returns ``true`` if %%coinType%% is supported by this plugin. - */ - supportsCoinType(coinType) { - return false; - } - /** - * Resolves to the encoded %%address%% for %%coinType%%. - */ - async encodeAddress(coinType, address) { - throw new Error("unsupported coin"); - } - /** - * Resolves to the decoded %%data%% for %%coinType%%. - */ - async decodeAddress(coinType, data) { - throw new Error("unsupported coin"); - } -} -const matcherIpfs = new RegExp("^(ipfs):/\/(.*)$", "i"); -const matchers = [ - new RegExp("^(https):/\/(.*)$", "i"), - new RegExp("^(data):(.*)$", "i"), - matcherIpfs, - new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$", "i"), -]; -/** - * A connected object to a resolved ENS name resolver, which can be - * used to query additional details. - */ -class EnsResolver { - /** - * The connected provider. - */ - provider; - /** - * The address of the resolver. - */ - address; - /** - * The name this resolver was resolved against. - */ - name; - // For EIP-2544 names, the ancestor that provided the resolver - #supports2544; - #resolver; - constructor(provider, address, name) { - defineProperties(this, { provider, address, name }); - this.#supports2544 = null; - this.#resolver = new Contract(address, [ - "function supportsInterface(bytes4) view returns (bool)", - "function resolve(bytes, bytes) view returns (bytes)", - "function addr(bytes32) view returns (address)", - "function addr(bytes32, uint) view returns (bytes)", - "function text(bytes32, string) view returns (string)", - "function contenthash(bytes32) view returns (bytes)", - ], provider); - } - /** - * Resolves to true if the resolver supports wildcard resolution. - */ - async supportsWildcard() { - if (this.#supports2544 == null) { - this.#supports2544 = (async () => { - try { - return await this.#resolver.supportsInterface("0x9061b923"); - } - catch (error) { - // Wildcard resolvers must understand supportsInterface - // and return true. - if (isError(error, "CALL_EXCEPTION")) { - return false; - } - // Let future attempts try again... - this.#supports2544 = null; - throw error; - } - })(); - } - return await this.#supports2544; - } - async #fetch(funcName, params) { - params = (params || []).slice(); - const iface = this.#resolver.interface; - // The first parameters is always the nodehash - params.unshift(namehash(this.name)); - let fragment = null; - if (await this.supportsWildcard()) { - fragment = iface.getFunction(funcName); - assert(fragment, "missing fragment", "UNKNOWN_ERROR", { - info: { funcName } - }); - params = [ - dnsEncode(this.name, 255), - iface.encodeFunctionData(fragment, params) - ]; - funcName = "resolve(bytes,bytes)"; - } - params.push({ - enableCcipRead: true - }); - try { - const result = await this.#resolver[funcName](...params); - if (fragment) { - return iface.decodeFunctionResult(fragment, result)[0]; - } - return result; - } - catch (error) { - if (!isError(error, "CALL_EXCEPTION")) { - throw error; - } - } - return null; - } - /** - * Resolves to the address for %%coinType%% or null if the - * provided %%coinType%% has not been configured. - */ - async getAddress(coinType) { - if (coinType == null) { - coinType = 60; - } - if (coinType === 60) { - try { - const result = await this.#fetch("addr(bytes32)"); - // No address - if (result == null || result === ZeroAddress) { - return null; - } - return result; - } - catch (error) { - if (isError(error, "CALL_EXCEPTION")) { - return null; - } - throw error; - } - } - // Try decoding its EVM canonical chain as an EVM chain address first - if (coinType >= 0 && coinType < 0x80000000) { - let ethCoinType = coinType + 0x80000000; - const data = await this.#fetch("addr(bytes32,uint)", [ethCoinType]); - if (isHexString(data, 20)) { - return getAddress(data); - } - } - let coinPlugin = null; - for (const plugin of this.provider.plugins) { - if (!(plugin instanceof MulticoinProviderPlugin)) { - continue; - } - if (plugin.supportsCoinType(coinType)) { - coinPlugin = plugin; - break; - } - } - if (coinPlugin == null) { - return null; - } - // keccak256("addr(bytes32,uint256") - const data = await this.#fetch("addr(bytes32,uint)", [coinType]); - // No address - if (data == null || data === "0x") { - return null; - } - // Compute the address - const address = await coinPlugin.decodeAddress(coinType, data); - if (address != null) { - return address; - } - assert(false, `invalid coin data`, "UNSUPPORTED_OPERATION", { - operation: `getAddress(${coinType})`, - info: { coinType, data } - }); - } - /** - * Resolves to the EIP-634 text record for %%key%%, or ``null`` - * if unconfigured. - */ - async getText(key) { - const data = await this.#fetch("text(bytes32,string)", [key]); - if (data == null || data === "0x") { - return null; - } - return data; - } - /** - * Rsolves to the content-hash or ``null`` if unconfigured. - */ - async getContentHash() { - // keccak256("contenthash()") - const data = await this.#fetch("contenthash(bytes32)"); - // No contenthash - if (data == null || data === "0x") { - return null; - } - // IPFS (CID: 1, Type: 70=DAG-PB, 72=libp2p-key) - const ipfs = data.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/); - if (ipfs) { - const scheme = (ipfs[1] === "e3010170") ? "ipfs" : "ipns"; - const length = parseInt(ipfs[4], 16); - if (ipfs[5].length === length * 2) { - return `${scheme}:/\/${encodeBase58("0x" + ipfs[2])}`; - } - } - // Swarm (CID: 1, Type: swarm-manifest; hash/length hard-coded to keccak256/32) - const swarm = data.match(/^0xe40101fa011b20([0-9a-f]*)$/); - if (swarm && swarm[1].length === 64) { - return `bzz:/\/${swarm[1]}`; - } - assert(false, `invalid or unsupported content hash data`, "UNSUPPORTED_OPERATION", { - operation: "getContentHash()", - info: { data } - }); - } - /** - * Resolves to the avatar url or ``null`` if the avatar is either - * unconfigured or incorrectly configured (e.g. references an NFT - * not owned by the address). - * - * If diagnosing issues with configurations, the [[_getAvatar]] - * method may be useful. - */ - async getAvatar() { - const avatar = await this._getAvatar(); - return avatar.url; - } - /** - * When resolving an avatar, there are many steps involved, such - * fetching metadata and possibly validating ownership of an - * NFT. - * - * This method can be used to examine each step and the value it - * was working from. - */ - async _getAvatar() { - const linkage = [{ type: "name", value: this.name }]; - try { - // test data for ricmoo.eth - //const avatar = "eip155:1/erc721:0x265385c7f4132228A0d54EB1A9e7460b91c0cC68/29233"; - const avatar = await this.getText("avatar"); - if (avatar == null) { - linkage.push({ type: "!avatar", value: "" }); - return { url: null, linkage }; - } - linkage.push({ type: "avatar", value: avatar }); - for (let i = 0; i < matchers.length; i++) { - const match = avatar.match(matchers[i]); - if (match == null) { - continue; - } - const scheme = match[1].toLowerCase(); - switch (scheme) { - case "https": - case "data": - linkage.push({ type: "url", value: avatar }); - return { linkage, url: avatar }; - case "ipfs": { - const url = getIpfsLink(avatar); - linkage.push({ type: "ipfs", value: avatar }); - linkage.push({ type: "url", value: url }); - return { linkage, url }; - } - case "erc721": - case "erc1155": { - // Depending on the ERC type, use tokenURI(uint256) or url(uint256) - const selector = (scheme === "erc721") ? "tokenURI(uint256)" : "uri(uint256)"; - linkage.push({ type: scheme, value: avatar }); - // The owner of this name - const owner = await this.getAddress(); - if (owner == null) { - linkage.push({ type: "!owner", value: "" }); - return { url: null, linkage }; - } - const comps = (match[2] || "").split("/"); - if (comps.length !== 2) { - linkage.push({ type: `!${scheme}caip`, value: (match[2] || "") }); - return { url: null, linkage }; - } - const tokenId = comps[1]; - const contract = new Contract(comps[0], [ - // ERC-721 - "function tokenURI(uint) view returns (string)", - "function ownerOf(uint) view returns (address)", - // ERC-1155 - "function uri(uint) view returns (string)", - "function balanceOf(address, uint256) view returns (uint)" - ], this.provider); - // Check that this account owns the token - if (scheme === "erc721") { - const tokenOwner = await contract.ownerOf(tokenId); - if (owner !== tokenOwner) { - linkage.push({ type: "!owner", value: tokenOwner }); - return { url: null, linkage }; - } - linkage.push({ type: "owner", value: tokenOwner }); - } - else if (scheme === "erc1155") { - const balance = await contract.balanceOf(owner, tokenId); - if (!balance) { - linkage.push({ type: "!balance", value: "0" }); - return { url: null, linkage }; - } - linkage.push({ type: "balance", value: balance.toString() }); - } - // Call the token contract for the metadata URL - let metadataUrl = await contract[selector](tokenId); - if (metadataUrl == null || metadataUrl === "0x") { - linkage.push({ type: "!metadata-url", value: "" }); - return { url: null, linkage }; - } - linkage.push({ type: "metadata-url-base", value: metadataUrl }); - // ERC-1155 allows a generic {id} in the URL - if (scheme === "erc1155") { - metadataUrl = metadataUrl.replace("{id}", toBeHex(tokenId, 32).substring(2)); - linkage.push({ type: "metadata-url-expanded", value: metadataUrl }); - } - // Transform IPFS metadata links - if (metadataUrl.match(/^ipfs:/i)) { - metadataUrl = getIpfsLink(metadataUrl); - } - linkage.push({ type: "metadata-url", value: metadataUrl }); - // Get the token metadata - let metadata = {}; - const response = await (new FetchRequest(metadataUrl)).send(); - response.assertOk(); - try { - metadata = response.bodyJson; - } - catch (error) { - try { - linkage.push({ type: "!metadata", value: response.bodyText }); - } - catch (error) { - const bytes = response.body; - if (bytes) { - linkage.push({ type: "!metadata", value: hexlify(bytes) }); - } - return { url: null, linkage }; - } - return { url: null, linkage }; - } - if (!metadata) { - linkage.push({ type: "!metadata", value: "" }); - return { url: null, linkage }; - } - linkage.push({ type: "metadata", value: JSON.stringify(metadata) }); - // Pull the image URL out - let imageUrl = metadata.image; - if (typeof (imageUrl) !== "string") { - linkage.push({ type: "!imageUrl", value: "" }); - return { url: null, linkage }; - } - if (imageUrl.match(/^(https:\/\/|data:)/i)) { - // Allow - } - else { - // Transform IPFS link to gateway - const ipfs = imageUrl.match(matcherIpfs); - if (ipfs == null) { - linkage.push({ type: "!imageUrl-ipfs", value: imageUrl }); - return { url: null, linkage }; - } - linkage.push({ type: "imageUrl-ipfs", value: imageUrl }); - imageUrl = getIpfsLink(imageUrl); - } - linkage.push({ type: "url", value: imageUrl }); - return { linkage, url: imageUrl }; - } - } - } - } - catch (error) { } - return { linkage, url: null }; - } - static async getEnsAddress(provider) { - const network = await provider.getNetwork(); - const ensPlugin = network.getPlugin("org.ethers.plugins.network.Ens"); - // No ENS... - assert(ensPlugin, "network does not support ENS", "UNSUPPORTED_OPERATION", { - operation: "getEnsAddress", info: { network } - }); - return ensPlugin.address; - } - static async #getResolver(provider, name) { - const ensAddr = await EnsResolver.getEnsAddress(provider); - try { - const contract = new Contract(ensAddr, [ - "function resolver(bytes32) view returns (address)" - ], provider); - const addr = await contract.resolver(namehash(name), { - enableCcipRead: true - }); - if (addr === ZeroAddress) { - return null; - } - return addr; - } - catch (error) { - // ENS registry cannot throw errors on resolver(bytes32), - // so probably a link error - throw error; - } - return null; - } - /** - * Resolve to the ENS resolver for %%name%% using %%provider%% or - * ``null`` if unconfigured. - */ - static async fromName(provider, name) { - let currentName = name; - while (true) { - if (currentName === "" || currentName === ".") { - return null; - } - // Optimization since the eth node cannot change and does - // not have a wildcard resolver - if (name !== "eth" && currentName === "eth") { - return null; - } - // Check the current node for a resolver - const addr = await EnsResolver.#getResolver(provider, currentName); - // Found a resolver! - if (addr != null) { - const resolver = new EnsResolver(provider, addr, name); - // Legacy resolver found, using EIP-2544 so it isn't safe to use - if (currentName !== name && !(await resolver.supportsWildcard())) { - return null; - } - return resolver; - } - // Get the parent node - currentName = currentName.split(".").slice(1).join("."); - } - } -} - -/** - * @_ignore - */ -const BN_0 = BigInt(0); -function allowNull(format, nullValue) { - return (function (value) { - if (value == null) { - return nullValue; - } - return format(value); - }); -} -function arrayOf(format, allowNull) { - return ((array) => { - if (allowNull && array == null) { - return null; - } - if (!Array.isArray(array)) { - throw new Error("not an array"); - } - return array.map((i) => format(i)); - }); -} -// Requires an object which matches a fleet of other formatters -// Any FormatFunc may return `undefined` to have the value omitted -// from the result object. Calls preserve `this`. -function object(format, altNames) { - return ((value) => { - const result = {}; - for (const key in format) { - let srcKey = key; - if (altNames && key in altNames && !(srcKey in value)) { - for (const altKey of altNames[key]) { - if (altKey in value) { - srcKey = altKey; - break; - } - } - } - try { - const nv = format[key](value[srcKey]); - if (nv !== undefined) { - result[key] = nv; - } - } - catch (error) { - const message = (error instanceof Error) ? error.message : "not-an-error"; - assert(false, `invalid value for value.${key} (${message})`, "BAD_DATA", { value }); - } - } - return result; - }); -} -function formatBoolean(value) { - switch (value) { - case true: - case "true": - return true; - case false: - case "false": - return false; - } - assertArgument(false, `invalid boolean; ${JSON.stringify(value)}`, "value", value); -} -function formatData(value) { - assertArgument(isHexString(value, true), "invalid data", "value", value); - return value; -} -function formatHash(value) { - assertArgument(isHexString(value, 32), "invalid hash", "value", value); - return value; -} -const _formatLog = object({ - address: getAddress, - blockHash: formatHash, - blockNumber: getNumber, - data: formatData, - index: getNumber, - removed: allowNull(formatBoolean, false), - topics: arrayOf(formatHash), - transactionHash: formatHash, - transactionIndex: getNumber, -}, { - index: ["logIndex"] -}); -function formatLog(value) { - return _formatLog(value); -} -const _formatBlock = object({ - hash: allowNull(formatHash), - parentHash: formatHash, - parentBeaconBlockRoot: allowNull(formatHash, null), - number: getNumber, - timestamp: getNumber, - nonce: allowNull(formatData), - difficulty: getBigInt, - gasLimit: getBigInt, - gasUsed: getBigInt, - stateRoot: allowNull(formatHash, null), - receiptsRoot: allowNull(formatHash, null), - blobGasUsed: allowNull(getBigInt, null), - excessBlobGas: allowNull(getBigInt, null), - miner: allowNull(getAddress), - prevRandao: allowNull(formatHash, null), - extraData: formatData, - baseFeePerGas: allowNull(getBigInt) -}, { - prevRandao: ["mixHash"] -}); -function formatBlock(value) { - const result = _formatBlock(value); - result.transactions = value.transactions.map((tx) => { - if (typeof (tx) === "string") { - return tx; - } - return formatTransactionResponse(tx); - }); - return result; -} -const _formatReceiptLog = object({ - transactionIndex: getNumber, - blockNumber: getNumber, - transactionHash: formatHash, - address: getAddress, - topics: arrayOf(formatHash), - data: formatData, - index: getNumber, - blockHash: formatHash, -}, { - index: ["logIndex"] -}); -function formatReceiptLog(value) { - return _formatReceiptLog(value); -} -const _formatTransactionReceipt = object({ - to: allowNull(getAddress, null), - from: allowNull(getAddress, null), - contractAddress: allowNull(getAddress, null), - // should be allowNull(hash), but broken-EIP-658 support is handled in receipt - index: getNumber, - root: allowNull(hexlify), - gasUsed: getBigInt, - blobGasUsed: allowNull(getBigInt, null), - logsBloom: allowNull(formatData), - blockHash: formatHash, - hash: formatHash, - logs: arrayOf(formatReceiptLog), - blockNumber: getNumber, - //confirmations: allowNull(getNumber, null), - cumulativeGasUsed: getBigInt, - effectiveGasPrice: allowNull(getBigInt), - blobGasPrice: allowNull(getBigInt, null), - status: allowNull(getNumber), - type: allowNull(getNumber, 0) -}, { - effectiveGasPrice: ["gasPrice"], - hash: ["transactionHash"], - index: ["transactionIndex"], -}); -function formatTransactionReceipt(value) { - return _formatTransactionReceipt(value); -} -function formatTransactionResponse(value) { - // Some clients (TestRPC) do strange things like return 0x0 for the - // 0 address; correct this to be a real address - if (value.to && getBigInt(value.to) === BN_0) { - value.to = "0x0000000000000000000000000000000000000000"; - } - const result = object({ - hash: formatHash, - // Some nodes do not return this, usually test nodes (like Ganache) - index: allowNull(getNumber, undefined), - type: (value) => { - if (value === "0x" || value == null) { - return 0; - } - return getNumber(value); - }, - accessList: allowNull(accessListify, null), - blobVersionedHashes: allowNull(arrayOf(formatHash, true), null), - authorizationList: allowNull(arrayOf((v) => { - let sig; - if (v.signature) { - sig = v.signature; - } - else { - let yParity = v.yParity; - if (yParity === "0x1b") { - yParity = 0; - } - else if (yParity === "0x1c") { - yParity = 1; - } - sig = Object.assign({}, v, { yParity }); - } - return { - address: getAddress(v.address), - chainId: getBigInt(v.chainId), - nonce: getBigInt(v.nonce), - signature: Signature.from(sig) - }; - }, false), null), - blockHash: allowNull(formatHash, null), - blockNumber: allowNull(getNumber, null), - transactionIndex: allowNull(getNumber, null), - from: getAddress, - // either (gasPrice) or (maxPriorityFeePerGas + maxFeePerGas) must be set - gasPrice: allowNull(getBigInt), - maxPriorityFeePerGas: allowNull(getBigInt), - maxFeePerGas: allowNull(getBigInt), - maxFeePerBlobGas: allowNull(getBigInt, null), - gasLimit: getBigInt, - to: allowNull(getAddress, null), - value: getBigInt, - nonce: getNumber, - data: formatData, - creates: allowNull(getAddress, null), - chainId: allowNull(getBigInt, null) - }, { - data: ["input"], - gasLimit: ["gas"], - index: ["transactionIndex"] - })(value); - // If to and creates are empty, populate the creates from the value - if (result.to == null && result.creates == null) { - result.creates = getCreateAddress(result); - } - // @TODO: Check fee data - // Add an access list to supported transaction types - if ((value.type === 1 || value.type === 2) && value.accessList == null) { - result.accessList = []; - } - // Compute the signature - if (value.signature) { - result.signature = Signature.from(value.signature); - } - else { - result.signature = Signature.from(value); - } - // Some backends omit ChainId on legacy transactions, but we can compute it - if (result.chainId == null) { - const chainId = result.signature.legacyChainId; - if (chainId != null) { - result.chainId = chainId; - } - } - // @TODO: check chainID - /* - if (value.chainId != null) { - let chainId = value.chainId; - - if (isHexString(chainId)) { - chainId = BigNumber.from(chainId).toNumber(); - } - - result.chainId = chainId; - - } else { - let chainId = value.networkId; - - // geth-etc returns chainId - if (chainId == null && result.v == null) { - chainId = value.chainId; - } - - if (isHexString(chainId)) { - chainId = BigNumber.from(chainId).toNumber(); - } - - if (typeof(chainId) !== "number" && result.v != null) { - chainId = (result.v - 35) / 2; - if (chainId < 0) { chainId = 0; } - chainId = parseInt(chainId); - } - - if (typeof(chainId) !== "number") { chainId = 0; } - - result.chainId = chainId; - } - */ - // 0x0000... should actually be null - if (result.blockHash && getBigInt(result.blockHash) === BN_0) { - result.blockHash = null; - } - return result; -} - -const EnsAddress = "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"; -/** - * A **NetworkPlugin** provides additional functionality on a [[Network]]. - */ -class NetworkPlugin { - /** - * The name of the plugin. - * - * It is recommended to use reverse-domain-notation, which permits - * unique names with a known authority as well as hierarchal entries. - */ - name; - /** - * Creates a new **NetworkPlugin**. - */ - constructor(name) { - defineProperties(this, { name }); - } - /** - * Creates a copy of this plugin. - */ - clone() { - return new NetworkPlugin(this.name); - } -} -/** - * A **GasCostPlugin** allows a network to provide alternative values when - * computing the intrinsic gas required for a transaction. - */ -class GasCostPlugin extends NetworkPlugin { - /** - * The block number to treat these values as valid from. - * - * This allows a hardfork to have updated values included as well as - * mulutiple hardforks to be supported. - */ - effectiveBlock; - /** - * The transactions base fee. - */ - txBase; - /** - * The fee for creating a new account. - */ - txCreate; - /** - * The fee per zero-byte in the data. - */ - txDataZero; - /** - * The fee per non-zero-byte in the data. - */ - txDataNonzero; - /** - * The fee per storage key in the [[link-eip-2930]] access list. - */ - txAccessListStorageKey; - /** - * The fee per address in the [[link-eip-2930]] access list. - */ - txAccessListAddress; - /** - * Creates a new GasCostPlugin from %%effectiveBlock%% until the - * latest block or another GasCostPlugin supercedes that block number, - * with the associated %%costs%%. - */ - constructor(effectiveBlock, costs) { - if (effectiveBlock == null) { - effectiveBlock = 0; - } - super(`org.ethers.network.plugins.GasCost#${(effectiveBlock || 0)}`); - const props = { effectiveBlock }; - function set(name, nullish) { - let value = (costs || {})[name]; - if (value == null) { - value = nullish; - } - assertArgument(typeof (value) === "number", `invalud value for ${name}`, "costs", costs); - props[name] = value; - } - set("txBase", 21000); - set("txCreate", 32000); - set("txDataZero", 4); - set("txDataNonzero", 16); - set("txAccessListStorageKey", 1900); - set("txAccessListAddress", 2400); - defineProperties(this, props); - } - clone() { - return new GasCostPlugin(this.effectiveBlock, this); - } -} -/** - * An **EnsPlugin** allows a [[Network]] to specify the ENS Registry - * Contract address and the target network to use when using that - * contract. - * - * Various testnets have their own instance of the contract to use, but - * in general, the mainnet instance supports multi-chain addresses and - * should be used. - */ -class EnsPlugin extends NetworkPlugin { - /** - * The ENS Registrty Contract address. - */ - address; - /** - * The chain ID that the ENS contract lives on. - */ - targetNetwork; - /** - * Creates a new **EnsPlugin** connected to %%address%% on the - * %%targetNetwork%%. The default ENS address and mainnet is used - * if unspecified. - */ - constructor(address, targetNetwork) { - super("org.ethers.plugins.network.Ens"); - defineProperties(this, { - address: (address || EnsAddress), - targetNetwork: ((targetNetwork == null) ? 1 : targetNetwork) - }); - } - clone() { - return new EnsPlugin(this.address, this.targetNetwork); - } -} -/** - * A **FeeDataNetworkPlugin** allows a network to provide and alternate - * means to specify its fee data. - * - * For example, a network which does not support [[link-eip-1559]] may - * choose to use a Gas Station site to approximate the gas price. - */ -class FeeDataNetworkPlugin extends NetworkPlugin { - #feeDataFunc; - /** - * The fee data function provided to the constructor. - */ - get feeDataFunc() { - return this.#feeDataFunc; - } - /** - * Creates a new **FeeDataNetworkPlugin**. - */ - constructor(feeDataFunc) { - super("org.ethers.plugins.network.FeeData"); - this.#feeDataFunc = feeDataFunc; - } - /** - * Resolves to the fee data. - */ - async getFeeData(provider) { - return await this.#feeDataFunc(provider); - } - clone() { - return new FeeDataNetworkPlugin(this.#feeDataFunc); - } -} -class FetchUrlFeeDataNetworkPlugin extends NetworkPlugin { - #url; - #processFunc; - /** - * The URL to initialize the FetchRequest with in %%processFunc%%. - */ - get url() { return this.#url; } - /** - * The callback to use when computing the FeeData. - */ - get processFunc() { return this.#processFunc; } - /** - * Creates a new **FetchUrlFeeDataNetworkPlugin** which will - * be used when computing the fee data for the network. - */ - constructor(url, processFunc) { - super("org.ethers.plugins.network.FetchUrlFeeDataPlugin"); - this.#url = url; - this.#processFunc = processFunc; - } - // We are immutable, so we can serve as our own clone - clone() { return this; } -} -/* -export class CustomBlockNetworkPlugin extends NetworkPlugin { - readonly #blockFunc: (provider: Provider, block: BlockParams) => Block; - readonly #blockWithTxsFunc: (provider: Provider, block: BlockParams) => Block; - - constructor(blockFunc: (provider: Provider, block: BlockParams) => Block, blockWithTxsFunc: (provider: Provider, block: BlockParams) => Block) { - super("org.ethers.network-plugins.custom-block"); - this.#blockFunc = blockFunc; - this.#blockWithTxsFunc = blockWithTxsFunc; - } - - async getBlock(provider: Provider, block: BlockParams): Promise> { - return await this.#blockFunc(provider, block); - } - - async getBlockions(provider: Provider, block: BlockParams): Promise> { - return await this.#blockWithTxsFunc(provider, block); - } - - clone(): CustomBlockNetworkPlugin { - return new CustomBlockNetworkPlugin(this.#blockFunc, this.#blockWithTxsFunc); - } -} -*/ - -/** - * A **Network** encapsulates the various properties required to - * interact with a specific chain. - * - * @_subsection: api/providers:Networks [networks] - */ -/* * * * -// Networks which operation against an L2 can use this plugin to -// specify how to access L1, for the purpose of resolving ENS, -// for example. -export class LayerOneConnectionPlugin extends NetworkPlugin { - readonly provider!: Provider; -// @TODO: Rename to ChainAccess and allow for connecting to any chain - constructor(provider: Provider) { - super("org.ethers.plugins.layer-one-connection"); - defineProperties(this, { provider }); - } - - clone(): LayerOneConnectionPlugin { - return new LayerOneConnectionPlugin(this.provider); - } -} -*/ -const Networks = new Map(); -/** - * A **Network** provides access to a chain's properties and allows - * for plug-ins to extend functionality. - */ -class Network { - #name; - #chainId; - #plugins; - /** - * Creates a new **Network** for %%name%% and %%chainId%%. - */ - constructor(name, chainId) { - this.#name = name; - this.#chainId = getBigInt(chainId); - this.#plugins = new Map(); - } - /** - * Returns a JSON-compatible representation of a Network. - */ - toJSON() { - return { name: this.name, chainId: String(this.chainId) }; - } - /** - * The network common name. - * - * This is the canonical name, as networks migh have multiple - * names. - */ - get name() { return this.#name; } - set name(value) { this.#name = value; } - /** - * The network chain ID. - */ - get chainId() { return this.#chainId; } - set chainId(value) { this.#chainId = getBigInt(value, "chainId"); } - /** - * Returns true if %%other%% matches this network. Any chain ID - * must match, and if no chain ID is present, the name must match. - * - * This method does not currently check for additional properties, - * such as ENS address or plug-in compatibility. - */ - matches(other) { - if (other == null) { - return false; - } - if (typeof (other) === "string") { - try { - return (this.chainId === getBigInt(other)); - } - catch (error) { } - return (this.name === other); - } - if (typeof (other) === "number" || typeof (other) === "bigint") { - try { - return (this.chainId === getBigInt(other)); - } - catch (error) { } - return false; - } - if (typeof (other) === "object") { - if (other.chainId != null) { - try { - return (this.chainId === getBigInt(other.chainId)); - } - catch (error) { } - return false; - } - if (other.name != null) { - return (this.name === other.name); - } - return false; - } - return false; - } - /** - * Returns the list of plugins currently attached to this Network. - */ - get plugins() { - return Array.from(this.#plugins.values()); - } - /** - * Attach a new %%plugin%% to this Network. The network name - * must be unique, excluding any fragment. - */ - attachPlugin(plugin) { - if (this.#plugins.get(plugin.name)) { - throw new Error(`cannot replace existing plugin: ${plugin.name} `); - } - this.#plugins.set(plugin.name, plugin.clone()); - return this; - } - /** - * Return the plugin, if any, matching %%name%% exactly. Plugins - * with fragments will not be returned unless %%name%% includes - * a fragment. - */ - getPlugin(name) { - return (this.#plugins.get(name)) || null; - } - /** - * Gets a list of all plugins that match %%name%%, with otr without - * a fragment. - */ - getPlugins(basename) { - return (this.plugins.filter((p) => (p.name.split("#")[0] === basename))); - } - /** - * Create a copy of this Network. - */ - clone() { - const clone = new Network(this.name, this.chainId); - this.plugins.forEach((plugin) => { - clone.attachPlugin(plugin.clone()); - }); - return clone; - } - /** - * Compute the intrinsic gas required for a transaction. - * - * A GasCostPlugin can be attached to override the default - * values. - */ - computeIntrinsicGas(tx) { - const costs = this.getPlugin("org.ethers.plugins.network.GasCost") || (new GasCostPlugin()); - let gas = costs.txBase; - if (tx.to == null) { - gas += costs.txCreate; - } - if (tx.data) { - for (let i = 2; i < tx.data.length; i += 2) { - if (tx.data.substring(i, i + 2) === "00") { - gas += costs.txDataZero; - } - else { - gas += costs.txDataNonzero; - } - } - } - if (tx.accessList) { - const accessList = accessListify(tx.accessList); - for (const addr in accessList) { - gas += costs.txAccessListAddress + costs.txAccessListStorageKey * accessList[addr].storageKeys.length; - } - } - return gas; - } - /** - * Returns a new Network for the %%network%% name or chainId. - */ - static from(network) { - injectCommonNetworks(); - // Default network - if (network == null) { - return Network.from("mainnet"); - } - // Canonical name or chain ID - if (typeof (network) === "number") { - network = BigInt(network); - } - if (typeof (network) === "string" || typeof (network) === "bigint") { - const networkFunc = Networks.get(network); - if (networkFunc) { - return networkFunc(); - } - if (typeof (network) === "bigint") { - return new Network("unknown", network); - } - assertArgument(false, "unknown network", "network", network); - } - // Clonable with network-like abilities - if (typeof (network.clone) === "function") { - const clone = network.clone(); - //if (typeof(network.name) !== "string" || typeof(network.chainId) !== "number") { - //} - return clone; - } - // Networkish - if (typeof (network) === "object") { - assertArgument(typeof (network.name) === "string" && typeof (network.chainId) === "number", "invalid network object name or chainId", "network", network); - const custom = new Network((network.name), (network.chainId)); - if (network.ensAddress || network.ensNetwork != null) { - custom.attachPlugin(new EnsPlugin(network.ensAddress, network.ensNetwork)); - } - //if ((network).layerOneConnection) { - // custom.attachPlugin(new LayerOneConnectionPlugin((network).layerOneConnection)); - //} - return custom; - } - assertArgument(false, "invalid network", "network", network); - } - /** - * Register %%nameOrChainId%% with a function which returns - * an instance of a Network representing that chain. - */ - static register(nameOrChainId, networkFunc) { - if (typeof (nameOrChainId) === "number") { - nameOrChainId = BigInt(nameOrChainId); - } - const existing = Networks.get(nameOrChainId); - if (existing) { - assertArgument(false, `conflicting network for ${JSON.stringify(existing.name)}`, "nameOrChainId", nameOrChainId); - } - Networks.set(nameOrChainId, networkFunc); - } -} -// We don't want to bring in formatUnits because it is backed by -// FixedNumber and we want to keep Networks tiny. The values -// included by the Gas Stations are also IEEE 754 with lots of -// rounding issues and exceed the strict checks formatUnits has. -function parseUnits(_value, decimals) { - const value = String(_value); - if (!value.match(/^[0-9.]+$/)) { - throw new Error(`invalid gwei value: ${_value}`); - } - // Break into [ whole, fraction ] - const comps = value.split("."); - if (comps.length === 1) { - comps.push(""); - } - // More than 1 decimal point or too many fractional positions - if (comps.length !== 2) { - throw new Error(`invalid gwei value: ${_value}`); - } - // Pad the fraction to 9 decimalplaces - while (comps[1].length < decimals) { - comps[1] += "0"; - } - // Too many decimals and some non-zero ending, take the ceiling - if (comps[1].length > 9) { - let frac = BigInt(comps[1].substring(0, 9)); - if (!comps[1].substring(9).match(/^0+$/)) { - frac++; - } - comps[1] = frac.toString(); - } - return BigInt(comps[0] + comps[1]); -} -// Used by Polygon to use a gas station for fee data -function getGasStationPlugin(url) { - return new FetchUrlFeeDataNetworkPlugin(url, async (fetchFeeData, provider, request) => { - // Prevent Cloudflare from blocking our request in node.js - request.setHeader("User-Agent", "ethers"); - let response; - try { - const [_response, _feeData] = await Promise.all([ - request.send(), fetchFeeData() - ]); - response = _response; - const payload = response.bodyJson.standard; - const feeData = { - gasPrice: _feeData.gasPrice, - maxFeePerGas: parseUnits(payload.maxFee, 9), - maxPriorityFeePerGas: parseUnits(payload.maxPriorityFee, 9), - }; - return feeData; - } - catch (error) { - assert(false, `error encountered with polygon gas station (${JSON.stringify(request.url)})`, "SERVER_ERROR", { request, response, error }); - } - }); -} -// See: https://chainlist.org -let injected = false; -function injectCommonNetworks() { - if (injected) { - return; - } - injected = true; - /// Register popular Ethereum networks - function registerEth(name, chainId, options) { - const func = function () { - const network = new Network(name, chainId); - // We use 0 to disable ENS - if (options.ensNetwork != null) { - network.attachPlugin(new EnsPlugin(null, options.ensNetwork)); - } - network.attachPlugin(new GasCostPlugin()); - (options.plugins || []).forEach((plugin) => { - network.attachPlugin(plugin); - }); - return network; - }; - // Register the network by name and chain ID - Network.register(name, func); - Network.register(chainId, func); - if (options.altNames) { - options.altNames.forEach((name) => { - Network.register(name, func); - }); - } - } - registerEth("mainnet", 1, { ensNetwork: 1, altNames: ["homestead"] }); - registerEth("ropsten", 3, { ensNetwork: 3 }); - registerEth("rinkeby", 4, { ensNetwork: 4 }); - registerEth("goerli", 5, { ensNetwork: 5 }); - registerEth("kovan", 42, { ensNetwork: 42 }); - registerEth("sepolia", 11155111, { ensNetwork: 11155111 }); - registerEth("holesky", 17000, { ensNetwork: 17000 }); - registerEth("classic", 61, {}); - registerEth("classicKotti", 6, {}); - registerEth("arbitrum", 42161, { - ensNetwork: 1, - }); - registerEth("arbitrum-goerli", 421613, {}); - registerEth("arbitrum-sepolia", 421614, {}); - registerEth("base", 8453, { ensNetwork: 1 }); - registerEth("base-goerli", 84531, {}); - registerEth("base-sepolia", 84532, {}); - registerEth("bnb", 56, { ensNetwork: 1 }); - registerEth("bnbt", 97, {}); - registerEth("filecoin", 314, {}); - registerEth("filecoin-calibration", 314159, {}); - registerEth("linea", 59144, { ensNetwork: 1 }); - registerEth("linea-goerli", 59140, {}); - registerEth("linea-sepolia", 59141, {}); - registerEth("matic", 137, { - ensNetwork: 1, - plugins: [ - getGasStationPlugin("https:/\/gasstation.polygon.technology/v2") - ] - }); - registerEth("matic-amoy", 80002, {}); - registerEth("matic-mumbai", 80001, { - altNames: ["maticMumbai", "maticmum"], - plugins: [ - getGasStationPlugin("https:/\/gasstation-testnet.polygon.technology/v2") - ] - }); - registerEth("optimism", 10, { - ensNetwork: 1, - plugins: [] - }); - registerEth("optimism-goerli", 420, {}); - registerEth("optimism-sepolia", 11155420, {}); - registerEth("xdai", 100, { ensNetwork: 1 }); -} - -function copy$2(obj) { - return JSON.parse(JSON.stringify(obj)); -} -// @TODO: refactor this -/** - * A **PollingBlockSubscriber** polls at a regular interval for a change - * in the block number. - * - * @_docloc: api/providers/abstract-provider - */ -class PollingBlockSubscriber { - #provider; - #poller; - #interval; - // The most recent block we have scanned for events. The value -2 - // indicates we still need to fetch an initial block number - #blockNumber; - /** - * Create a new **PollingBlockSubscriber** attached to %%provider%%. - */ - constructor(provider) { - this.#provider = provider; - this.#poller = null; - this.#interval = 4000; - this.#blockNumber = -2; - } - /** - * The polling interval. - */ - get pollingInterval() { return this.#interval; } - set pollingInterval(value) { this.#interval = value; } - async #poll() { - try { - const blockNumber = await this.#provider.getBlockNumber(); - // Bootstrap poll to setup our initial block number - if (this.#blockNumber === -2) { - this.#blockNumber = blockNumber; - return; - } - // @TODO: Put a cap on the maximum number of events per loop? - if (blockNumber !== this.#blockNumber) { - for (let b = this.#blockNumber + 1; b <= blockNumber; b++) { - // We have been stopped - if (this.#poller == null) { - return; - } - await this.#provider.emit("block", b); - } - this.#blockNumber = blockNumber; - } - } - catch (error) { - // @TODO: Minor bump, add an "error" event to let subscribers - // know things went awry. - //console.log(error); - } - // We have been stopped - if (this.#poller == null) { - return; - } - this.#poller = this.#provider._setTimeout(this.#poll.bind(this), this.#interval); - } - start() { - if (this.#poller) { - return; - } - this.#poller = this.#provider._setTimeout(this.#poll.bind(this), this.#interval); - this.#poll(); - } - stop() { - if (!this.#poller) { - return; - } - this.#provider._clearTimeout(this.#poller); - this.#poller = null; - } - pause(dropWhilePaused) { - this.stop(); - if (dropWhilePaused) { - this.#blockNumber = -2; - } - } - resume() { - this.start(); - } -} -/** - * An **OnBlockSubscriber** can be sub-classed, with a [[_poll]] - * implmentation which will be called on every new block. - * - * @_docloc: api/providers/abstract-provider - */ -class OnBlockSubscriber { - #provider; - #poll; - #running; - /** - * Create a new **OnBlockSubscriber** attached to %%provider%%. - */ - constructor(provider) { - this.#provider = provider; - this.#running = false; - this.#poll = (blockNumber) => { - this._poll(blockNumber, this.#provider); - }; - } - /** - * Called on every new block. - */ - async _poll(blockNumber, provider) { - throw new Error("sub-classes must override this"); - } - start() { - if (this.#running) { - return; - } - this.#running = true; - this.#poll(-2); - this.#provider.on("block", this.#poll); - } - stop() { - if (!this.#running) { - return; - } - this.#running = false; - this.#provider.off("block", this.#poll); - } - pause(dropWhilePaused) { this.stop(); } - resume() { this.start(); } -} -class PollingBlockTagSubscriber extends OnBlockSubscriber { - #tag; - #lastBlock; - constructor(provider, tag) { - super(provider); - this.#tag = tag; - this.#lastBlock = -2; - } - pause(dropWhilePaused) { - if (dropWhilePaused) { - this.#lastBlock = -2; - } - super.pause(dropWhilePaused); - } - async _poll(blockNumber, provider) { - const block = await provider.getBlock(this.#tag); - if (block == null) { - return; - } - if (this.#lastBlock === -2) { - this.#lastBlock = block.number; - } - else if (block.number > this.#lastBlock) { - provider.emit(this.#tag, block.number); - this.#lastBlock = block.number; - } - } -} -/** - * @_ignore: - * - * @_docloc: api/providers/abstract-provider - */ -class PollingOrphanSubscriber extends OnBlockSubscriber { - #filter; - constructor(provider, filter) { - super(provider); - this.#filter = copy$2(filter); - } - async _poll(blockNumber, provider) { - throw new Error("@TODO"); - } -} -/** - * A **PollingTransactionSubscriber** will poll for a given transaction - * hash for its receipt. - * - * @_docloc: api/providers/abstract-provider - */ -class PollingTransactionSubscriber extends OnBlockSubscriber { - #hash; - /** - * Create a new **PollingTransactionSubscriber** attached to - * %%provider%%, listening for %%hash%%. - */ - constructor(provider, hash) { - super(provider); - this.#hash = hash; - } - async _poll(blockNumber, provider) { - const tx = await provider.getTransactionReceipt(this.#hash); - if (tx) { - provider.emit(this.#hash, tx); - } - } -} -/** - * A **PollingEventSubscriber** will poll for a given filter for its logs. - * - * @_docloc: api/providers/abstract-provider - */ -class PollingEventSubscriber { - #provider; - #filter; - #poller; - #running; - // The most recent block we have scanned for events. The value -2 - // indicates we still need to fetch an initial block number - #blockNumber; - /** - * Create a new **PollingTransactionSubscriber** attached to - * %%provider%%, listening for %%filter%%. - */ - constructor(provider, filter) { - this.#provider = provider; - this.#filter = copy$2(filter); - this.#poller = this.#poll.bind(this); - this.#running = false; - this.#blockNumber = -2; - } - async #poll(blockNumber) { - // The initial block hasn't been determined yet - if (this.#blockNumber === -2) { - return; - } - const filter = copy$2(this.#filter); - filter.fromBlock = this.#blockNumber + 1; - filter.toBlock = blockNumber; - const logs = await this.#provider.getLogs(filter); - // No logs could just mean the node has not indexed them yet, - // so we keep a sliding window of 60 blocks to keep scanning - if (logs.length === 0) { - if (this.#blockNumber < blockNumber - 60) { - this.#blockNumber = blockNumber - 60; - } - return; - } - for (const log of logs) { - this.#provider.emit(this.#filter, log); - // Only advance the block number when logs were found to - // account for networks (like BNB and Polygon) which may - // sacrifice event consistency for block event speed - this.#blockNumber = log.blockNumber; - } - } - start() { - if (this.#running) { - return; - } - this.#running = true; - if (this.#blockNumber === -2) { - this.#provider.getBlockNumber().then((blockNumber) => { - this.#blockNumber = blockNumber; - }); - } - this.#provider.on("block", this.#poller); - } - stop() { - if (!this.#running) { - return; - } - this.#running = false; - this.#provider.off("block", this.#poller); - } - pause(dropWhilePaused) { - this.stop(); - if (dropWhilePaused) { - this.#blockNumber = -2; - } - } - resume() { - this.start(); - } -} - -/** - * The available providers should suffice for most developers purposes, - * but the [[AbstractProvider]] class has many features which enable - * sub-classing it for specific purposes. - * - * @_section: api/providers/abstract-provider: Subclassing Provider [abstract-provider] - */ -// @TODO -// Event coalescence -// When we register an event with an async value (e.g. address is a Signer -// or ENS name), we need to add it immeidately for the Event API, but also -// need time to resolve the address. Upon resolving the address, we need to -// migrate the listener to the static event. We also need to maintain a map -// of Signer/ENS name to address so we can sync respond to listenerCount. -// Constants -const BN_2$1 = BigInt(2); -const MAX_CCIP_REDIRECTS = 10; -function isPromise$1(value) { - return (value && typeof (value.then) === "function"); -} -function getTag(prefix, value) { - return prefix + ":" + JSON.stringify(value, (k, v) => { - if (v == null) { - return "null"; - } - if (typeof (v) === "bigint") { - return `bigint:${v.toString()}`; - } - if (typeof (v) === "string") { - return v.toLowerCase(); - } - // Sort object keys - if (typeof (v) === "object" && !Array.isArray(v)) { - const keys = Object.keys(v); - keys.sort(); - return keys.reduce((accum, key) => { - accum[key] = v[key]; - return accum; - }, {}); - } - return v; - }); -} -/** - * An **UnmanagedSubscriber** is useful for events which do not require - * any additional management, such as ``"debug"`` which only requires - * emit in synchronous event loop triggered calls. - */ -class UnmanagedSubscriber { - /** - * The name fof the event. - */ - name; - /** - * Create a new UnmanagedSubscriber with %%name%%. - */ - constructor(name) { defineProperties(this, { name }); } - start() { } - stop() { } - pause(dropWhilePaused) { } - resume() { } -} -function copy$1(value) { - return JSON.parse(JSON.stringify(value)); -} -function concisify(items) { - items = Array.from((new Set(items)).values()); - items.sort(); - return items; -} -async function getSubscription(_event, provider) { - if (_event == null) { - throw new Error("invalid event"); - } - // Normalize topic array info an EventFilter - if (Array.isArray(_event)) { - _event = { topics: _event }; - } - if (typeof (_event) === "string") { - switch (_event) { - case "block": - case "debug": - case "error": - case "finalized": - case "network": - case "pending": - case "safe": { - return { type: _event, tag: _event }; - } - } - } - if (isHexString(_event, 32)) { - const hash = _event.toLowerCase(); - return { type: "transaction", tag: getTag("tx", { hash }), hash }; - } - if (_event.orphan) { - const event = _event; - // @TODO: Should lowercase and whatnot things here instead of copy... - return { type: "orphan", tag: getTag("orphan", event), filter: copy$1(event) }; - } - if ((_event.address || _event.topics)) { - const event = _event; - const filter = { - topics: ((event.topics || []).map((t) => { - if (t == null) { - return null; - } - if (Array.isArray(t)) { - return concisify(t.map((t) => t.toLowerCase())); - } - return t.toLowerCase(); - })) - }; - if (event.address) { - const addresses = []; - const promises = []; - const addAddress = (addr) => { - if (isHexString(addr)) { - addresses.push(addr); - } - else { - promises.push((async () => { - addresses.push(await resolveAddress(addr, provider)); - })()); - } - }; - if (Array.isArray(event.address)) { - event.address.forEach(addAddress); - } - else { - addAddress(event.address); - } - if (promises.length) { - await Promise.all(promises); - } - filter.address = concisify(addresses.map((a) => a.toLowerCase())); - } - return { filter, tag: getTag("event", filter), type: "event" }; - } - assertArgument(false, "unknown ProviderEvent", "event", _event); -} -function getTime$1() { return (new Date()).getTime(); } -const defaultOptions$1 = { - cacheTimeout: 250, - pollingInterval: 4000 -}; -/** - * An **AbstractProvider** provides a base class for other sub-classes to - * implement the [[Provider]] API by normalizing input arguments and - * formatting output results as well as tracking events for consistent - * behaviour on an eventually-consistent network. - */ -class AbstractProvider { - #subs; - #plugins; - // null=unpaused, true=paused+dropWhilePaused, false=paused - #pausedState; - #destroyed; - #networkPromise; - #anyNetwork; - #performCache; - // The most recent block number if running an event or -1 if no "block" event - #lastBlockNumber; - #nextTimer; - #timers; - #disableCcipRead; - #options; - /** - * Create a new **AbstractProvider** connected to %%network%%, or - * use the various network detection capabilities to discover the - * [[Network]] if necessary. - */ - constructor(_network, options) { - this.#options = Object.assign({}, defaultOptions$1, options || {}); - if (_network === "any") { - this.#anyNetwork = true; - this.#networkPromise = null; - } - else if (_network) { - const network = Network.from(_network); - this.#anyNetwork = false; - this.#networkPromise = Promise.resolve(network); - setTimeout(() => { this.emit("network", network, null); }, 0); - } - else { - this.#anyNetwork = false; - this.#networkPromise = null; - } - this.#lastBlockNumber = -1; - this.#performCache = new Map(); - this.#subs = new Map(); - this.#plugins = new Map(); - this.#pausedState = null; - this.#destroyed = false; - this.#nextTimer = 1; - this.#timers = new Map(); - this.#disableCcipRead = false; - } - get pollingInterval() { return this.#options.pollingInterval; } - /** - * Returns ``this``, to allow an **AbstractProvider** to implement - * the [[ContractRunner]] interface. - */ - get provider() { return this; } - /** - * Returns all the registered plug-ins. - */ - get plugins() { - return Array.from(this.#plugins.values()); - } - /** - * Attach a new plug-in. - */ - attachPlugin(plugin) { - if (this.#plugins.get(plugin.name)) { - throw new Error(`cannot replace existing plugin: ${plugin.name} `); - } - this.#plugins.set(plugin.name, plugin.connect(this)); - return this; - } - /** - * Get a plugin by name. - */ - getPlugin(name) { - return (this.#plugins.get(name)) || null; - } - /** - * Prevent any CCIP-read operation, regardless of whether requested - * in a [[call]] using ``enableCcipRead``. - */ - get disableCcipRead() { return this.#disableCcipRead; } - set disableCcipRead(value) { this.#disableCcipRead = !!value; } - // Shares multiple identical requests made during the same 250ms - async #perform(req) { - const timeout = this.#options.cacheTimeout; - // Caching disabled - if (timeout < 0) { - return await this._perform(req); - } - // Create a tag - const tag = getTag(req.method, req); - let perform = this.#performCache.get(tag); - if (!perform) { - perform = this._perform(req); - this.#performCache.set(tag, perform); - setTimeout(() => { - if (this.#performCache.get(tag) === perform) { - this.#performCache.delete(tag); - } - }, timeout); - } - return await perform; - } - /** - * Resolves to the data for executing the CCIP-read operations. - */ - async ccipReadFetch(tx, calldata, urls) { - if (this.disableCcipRead || urls.length === 0 || tx.to == null) { - return null; - } - const sender = tx.to.toLowerCase(); - const data = calldata.toLowerCase(); - const errorMessages = []; - for (let i = 0; i < urls.length; i++) { - const url = urls[i]; - // URL expansion - const href = url.replace("{sender}", sender).replace("{data}", data); - // If no {data} is present, use POST; otherwise GET - //const json: string | null = (url.indexOf("{data}") >= 0) ? null: JSON.stringify({ data, sender }); - //const result = await fetchJson({ url: href, errorPassThrough: true }, json, (value, response) => { - // value.status = response.statusCode; - // return value; - //}); - const request = new FetchRequest(href); - if (url.indexOf("{data}") === -1) { - request.body = { data, sender }; - } - this.emit("debug", { action: "sendCcipReadFetchRequest", request, index: i, urls }); - let errorMessage = "unknown error"; - // Fetch the resource... - let resp; - try { - resp = await request.send(); - } - catch (error) { - // ...low-level fetch error (missing host, bad SSL, etc.), - // so try next URL - errorMessages.push(error.message); - this.emit("debug", { action: "receiveCcipReadFetchError", request, result: { error } }); - continue; - } - try { - const result = resp.bodyJson; - if (result.data) { - this.emit("debug", { action: "receiveCcipReadFetchResult", request, result }); - return result.data; - } - if (result.message) { - errorMessage = result.message; - } - this.emit("debug", { action: "receiveCcipReadFetchError", request, result }); - } - catch (error) { } - // 4xx indicates the result is not present; stop - assert(resp.statusCode < 400 || resp.statusCode >= 500, `response not found during CCIP fetch: ${errorMessage}`, "OFFCHAIN_FAULT", { reason: "404_MISSING_RESOURCE", transaction: tx, info: { url, errorMessage } }); - // 5xx indicates server issue; try the next url - errorMessages.push(errorMessage); - } - assert(false, `error encountered during CCIP fetch: ${errorMessages.map((m) => JSON.stringify(m)).join(", ")}`, "OFFCHAIN_FAULT", { - reason: "500_SERVER_ERROR", - transaction: tx, info: { urls, errorMessages } - }); - } - /** - * Provides the opportunity for a sub-class to wrap a block before - * returning it, to add additional properties or an alternate - * sub-class of [[Block]]. - */ - _wrapBlock(value, network) { - return new Block(formatBlock(value), this); - } - /** - * Provides the opportunity for a sub-class to wrap a log before - * returning it, to add additional properties or an alternate - * sub-class of [[Log]]. - */ - _wrapLog(value, network) { - return new Log(formatLog(value), this); - } - /** - * Provides the opportunity for a sub-class to wrap a transaction - * receipt before returning it, to add additional properties or an - * alternate sub-class of [[TransactionReceipt]]. - */ - _wrapTransactionReceipt(value, network) { - return new TransactionReceipt(formatTransactionReceipt(value), this); - } - /** - * Provides the opportunity for a sub-class to wrap a transaction - * response before returning it, to add additional properties or an - * alternate sub-class of [[TransactionResponse]]. - */ - _wrapTransactionResponse(tx, network) { - return new TransactionResponse(formatTransactionResponse(tx), this); - } - /** - * Resolves to the Network, forcing a network detection using whatever - * technique the sub-class requires. - * - * Sub-classes **must** override this. - */ - _detectNetwork() { - assert(false, "sub-classes must implement this", "UNSUPPORTED_OPERATION", { - operation: "_detectNetwork" - }); - } - /** - * Sub-classes should use this to perform all built-in operations. All - * methods sanitizes and normalizes the values passed into this. - * - * Sub-classes **must** override this. - */ - async _perform(req) { - assert(false, `unsupported method: ${req.method}`, "UNSUPPORTED_OPERATION", { - operation: req.method, - info: req - }); - } - // State - async getBlockNumber() { - const blockNumber = getNumber(await this.#perform({ method: "getBlockNumber" }), "%response"); - if (this.#lastBlockNumber >= 0) { - this.#lastBlockNumber = blockNumber; - } - return blockNumber; - } - /** - * Returns or resolves to the address for %%address%%, resolving ENS - * names and [[Addressable]] objects and returning if already an - * address. - */ - _getAddress(address) { - return resolveAddress(address, this); - } - /** - * Returns or resolves to a valid block tag for %%blockTag%%, resolving - * negative values and returning if already a valid block tag. - */ - _getBlockTag(blockTag) { - if (blockTag == null) { - return "latest"; - } - switch (blockTag) { - case "earliest": - return "0x0"; - case "finalized": - case "latest": - case "pending": - case "safe": - return blockTag; - } - if (isHexString(blockTag)) { - if (isHexString(blockTag, 32)) { - return blockTag; - } - return toQuantity(blockTag); - } - if (typeof (blockTag) === "bigint") { - blockTag = getNumber(blockTag, "blockTag"); - } - if (typeof (blockTag) === "number") { - if (blockTag >= 0) { - return toQuantity(blockTag); - } - if (this.#lastBlockNumber >= 0) { - return toQuantity(this.#lastBlockNumber + blockTag); - } - return this.getBlockNumber().then((b) => toQuantity(b + blockTag)); - } - assertArgument(false, "invalid blockTag", "blockTag", blockTag); - } - /** - * Returns or resolves to a filter for %%filter%%, resolving any ENS - * names or [[Addressable]] object and returning if already a valid - * filter. - */ - _getFilter(filter) { - // Create a canonical representation of the topics - const topics = (filter.topics || []).map((t) => { - if (t == null) { - return null; - } - if (Array.isArray(t)) { - return concisify(t.map((t) => t.toLowerCase())); - } - return t.toLowerCase(); - }); - const blockHash = ("blockHash" in filter) ? filter.blockHash : undefined; - const resolve = (_address, fromBlock, toBlock) => { - let address = undefined; - switch (_address.length) { - case 0: break; - case 1: - address = _address[0]; - break; - default: - _address.sort(); - address = _address; - } - if (blockHash) { - if (fromBlock != null || toBlock != null) { - throw new Error("invalid filter"); - } - } - const filter = {}; - if (address) { - filter.address = address; - } - if (topics.length) { - filter.topics = topics; - } - if (fromBlock) { - filter.fromBlock = fromBlock; - } - if (toBlock) { - filter.toBlock = toBlock; - } - if (blockHash) { - filter.blockHash = blockHash; - } - return filter; - }; - // Addresses could be async (ENS names or Addressables) - let address = []; - if (filter.address) { - if (Array.isArray(filter.address)) { - for (const addr of filter.address) { - address.push(this._getAddress(addr)); - } - } - else { - address.push(this._getAddress(filter.address)); - } - } - let fromBlock = undefined; - if ("fromBlock" in filter) { - fromBlock = this._getBlockTag(filter.fromBlock); - } - let toBlock = undefined; - if ("toBlock" in filter) { - toBlock = this._getBlockTag(filter.toBlock); - } - if (address.filter((a) => (typeof (a) !== "string")).length || - (fromBlock != null && typeof (fromBlock) !== "string") || - (toBlock != null && typeof (toBlock) !== "string")) { - return Promise.all([Promise.all(address), fromBlock, toBlock]).then((result) => { - return resolve(result[0], result[1], result[2]); - }); - } - return resolve(address, fromBlock, toBlock); - } - /** - * Returns or resolves to a transaction for %%request%%, resolving - * any ENS names or [[Addressable]] and returning if already a valid - * transaction. - */ - _getTransactionRequest(_request) { - const request = copyRequest(_request); - const promises = []; - ["to", "from"].forEach((key) => { - if (request[key] == null) { - return; - } - const addr = resolveAddress(request[key], this); - if (isPromise$1(addr)) { - promises.push((async function () { request[key] = await addr; })()); - } - else { - request[key] = addr; - } - }); - if (request.blockTag != null) { - const blockTag = this._getBlockTag(request.blockTag); - if (isPromise$1(blockTag)) { - promises.push((async function () { request.blockTag = await blockTag; })()); - } - else { - request.blockTag = blockTag; - } - } - if (promises.length) { - return (async function () { - await Promise.all(promises); - return request; - })(); - } - return request; - } - async getNetwork() { - // No explicit network was set and this is our first time - if (this.#networkPromise == null) { - // Detect the current network (shared with all calls) - const detectNetwork = (async () => { - try { - const network = await this._detectNetwork(); - this.emit("network", network, null); - return network; - } - catch (error) { - if (this.#networkPromise === detectNetwork) { - this.#networkPromise = null; - } - throw error; - } - })(); - this.#networkPromise = detectNetwork; - return (await detectNetwork).clone(); - } - const networkPromise = this.#networkPromise; - const [expected, actual] = await Promise.all([ - networkPromise, - this._detectNetwork() // The actual connected network - ]); - if (expected.chainId !== actual.chainId) { - if (this.#anyNetwork) { - // The "any" network can change, so notify listeners - this.emit("network", actual, expected); - // Update the network if something else hasn't already changed it - if (this.#networkPromise === networkPromise) { - this.#networkPromise = Promise.resolve(actual); - } - } - else { - // Otherwise, we do not allow changes to the underlying network - assert(false, `network changed: ${expected.chainId} => ${actual.chainId} `, "NETWORK_ERROR", { - event: "changed" - }); - } - } - return expected.clone(); - } - async getFeeData() { - const network = await this.getNetwork(); - const getFeeDataFunc = async () => { - const { _block, gasPrice, priorityFee } = await resolveProperties({ - _block: this.#getBlock("latest", false), - gasPrice: ((async () => { - try { - const value = await this.#perform({ method: "getGasPrice" }); - return getBigInt(value, "%response"); - } - catch (error) { } - return null; - })()), - priorityFee: ((async () => { - try { - const value = await this.#perform({ method: "getPriorityFee" }); - return getBigInt(value, "%response"); - } - catch (error) { } - return null; - })()) - }); - let maxFeePerGas = null; - let maxPriorityFeePerGas = null; - // These are the recommended EIP-1559 heuristics for fee data - const block = this._wrapBlock(_block, network); - if (block && block.baseFeePerGas) { - maxPriorityFeePerGas = (priorityFee != null) ? priorityFee : BigInt("1000000000"); - maxFeePerGas = (block.baseFeePerGas * BN_2$1) + maxPriorityFeePerGas; - } - return new FeeData(gasPrice, maxFeePerGas, maxPriorityFeePerGas); - }; - // Check for a FeeDataNetWorkPlugin - const plugin = network.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin"); - if (plugin) { - const req = new FetchRequest(plugin.url); - const feeData = await plugin.processFunc(getFeeDataFunc, this, req); - return new FeeData(feeData.gasPrice, feeData.maxFeePerGas, feeData.maxPriorityFeePerGas); - } - return await getFeeDataFunc(); - } - async estimateGas(_tx) { - let tx = this._getTransactionRequest(_tx); - if (isPromise$1(tx)) { - tx = await tx; - } - return getBigInt(await this.#perform({ - method: "estimateGas", transaction: tx - }), "%response"); - } - async #call(tx, blockTag, attempt) { - assert(attempt < MAX_CCIP_REDIRECTS, "CCIP read exceeded maximum redirections", "OFFCHAIN_FAULT", { - reason: "TOO_MANY_REDIRECTS", - transaction: Object.assign({}, tx, { blockTag, enableCcipRead: true }) - }); - // This came in as a PerformActionTransaction, so to/from are safe; we can cast - const transaction = copyRequest(tx); - try { - return hexlify(await this._perform({ method: "call", transaction, blockTag })); - } - catch (error) { - // CCIP Read OffchainLookup - if (!this.disableCcipRead && isCallException(error) && error.data && attempt >= 0 && blockTag === "latest" && transaction.to != null && dataSlice(error.data, 0, 4) === "0x556f1830") { - const data = error.data; - const txSender = await resolveAddress(transaction.to, this); - // Parse the CCIP Read Arguments - let ccipArgs; - try { - ccipArgs = parseOffchainLookup(dataSlice(error.data, 4)); - } - catch (error) { - assert(false, error.message, "OFFCHAIN_FAULT", { - reason: "BAD_DATA", transaction, info: { data } - }); - } - // Check the sender of the OffchainLookup matches the transaction - assert(ccipArgs.sender.toLowerCase() === txSender.toLowerCase(), "CCIP Read sender mismatch", "CALL_EXCEPTION", { - action: "call", - data, - reason: "OffchainLookup", - transaction: transaction, - invocation: null, - revert: { - signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)", - name: "OffchainLookup", - args: ccipArgs.errorArgs - } - }); - const ccipResult = await this.ccipReadFetch(transaction, ccipArgs.calldata, ccipArgs.urls); - assert(ccipResult != null, "CCIP Read failed to fetch data", "OFFCHAIN_FAULT", { - reason: "FETCH_FAILED", transaction, info: { data: error.data, errorArgs: ccipArgs.errorArgs } - }); - const tx = { - to: txSender, - data: concat([ccipArgs.selector, encodeBytes([ccipResult, ccipArgs.extraData])]) - }; - this.emit("debug", { action: "sendCcipReadCall", transaction: tx }); - try { - const result = await this.#call(tx, blockTag, attempt + 1); - this.emit("debug", { action: "receiveCcipReadCallResult", transaction: Object.assign({}, tx), result }); - return result; - } - catch (error) { - this.emit("debug", { action: "receiveCcipReadCallError", transaction: Object.assign({}, tx), error }); - throw error; - } - } - throw error; - } - } - async #checkNetwork(promise) { - const { value } = await resolveProperties({ - network: this.getNetwork(), - value: promise - }); - return value; - } - async call(_tx) { - const { tx, blockTag } = await resolveProperties({ - tx: this._getTransactionRequest(_tx), - blockTag: this._getBlockTag(_tx.blockTag) - }); - return await this.#checkNetwork(this.#call(tx, blockTag, _tx.enableCcipRead ? 0 : -1)); - } - // Account - async #getAccountValue(request, _address, _blockTag) { - let address = this._getAddress(_address); - let blockTag = this._getBlockTag(_blockTag); - if (typeof (address) !== "string" || typeof (blockTag) !== "string") { - [address, blockTag] = await Promise.all([address, blockTag]); - } - return await this.#checkNetwork(this.#perform(Object.assign(request, { address, blockTag }))); - } - async getBalance(address, blockTag) { - return getBigInt(await this.#getAccountValue({ method: "getBalance" }, address, blockTag), "%response"); - } - async getTransactionCount(address, blockTag) { - return getNumber(await this.#getAccountValue({ method: "getTransactionCount" }, address, blockTag), "%response"); - } - async getCode(address, blockTag) { - return hexlify(await this.#getAccountValue({ method: "getCode" }, address, blockTag)); - } - async getStorage(address, _position, blockTag) { - const position = getBigInt(_position, "position"); - return hexlify(await this.#getAccountValue({ method: "getStorage", position }, address, blockTag)); - } - // Write - async broadcastTransaction(signedTx) { - const { blockNumber, hash, network } = await resolveProperties({ - blockNumber: this.getBlockNumber(), - hash: this._perform({ - method: "broadcastTransaction", - signedTransaction: signedTx - }), - network: this.getNetwork() - }); - const tx = Transaction.from(signedTx); - if (tx.hash !== hash) { - throw new Error("@TODO: the returned hash did not match"); - } - return this._wrapTransactionResponse(tx, network).replaceableTransaction(blockNumber); - } - async #getBlock(block, includeTransactions) { - // @TODO: Add CustomBlockPlugin check - if (isHexString(block, 32)) { - return await this.#perform({ - method: "getBlock", blockHash: block, includeTransactions - }); - } - let blockTag = this._getBlockTag(block); - if (typeof (blockTag) !== "string") { - blockTag = await blockTag; - } - return await this.#perform({ - method: "getBlock", blockTag, includeTransactions - }); - } - // Queries - async getBlock(block, prefetchTxs) { - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#getBlock(block, !!prefetchTxs) - }); - if (params == null) { - return null; - } - return this._wrapBlock(params, network); - } - async getTransaction(hash) { - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#perform({ method: "getTransaction", hash }) - }); - if (params == null) { - return null; - } - return this._wrapTransactionResponse(params, network); - } - async getTransactionReceipt(hash) { - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#perform({ method: "getTransactionReceipt", hash }) - }); - if (params == null) { - return null; - } - // Some backends did not backfill the effectiveGasPrice into old transactions - // in the receipt, so we look it up manually and inject it. - if (params.gasPrice == null && params.effectiveGasPrice == null) { - const tx = await this.#perform({ method: "getTransaction", hash }); - if (tx == null) { - throw new Error("report this; could not find tx or effectiveGasPrice"); - } - params.effectiveGasPrice = tx.gasPrice; - } - return this._wrapTransactionReceipt(params, network); - } - async getTransactionResult(hash) { - const { result } = await resolveProperties({ - network: this.getNetwork(), - result: this.#perform({ method: "getTransactionResult", hash }) - }); - if (result == null) { - return null; - } - return hexlify(result); - } - // Bloom-filter Queries - async getLogs(_filter) { - let filter = this._getFilter(_filter); - if (isPromise$1(filter)) { - filter = await filter; - } - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#perform({ method: "getLogs", filter }) - }); - return params.map((p) => this._wrapLog(p, network)); - } - // ENS - _getProvider(chainId) { - assert(false, "provider cannot connect to target network", "UNSUPPORTED_OPERATION", { - operation: "_getProvider()" - }); - } - async getResolver(name) { - return await EnsResolver.fromName(this, name); - } - async getAvatar(name) { - const resolver = await this.getResolver(name); - if (resolver) { - return await resolver.getAvatar(); - } - return null; - } - async resolveName(name) { - const resolver = await this.getResolver(name); - if (resolver) { - return await resolver.getAddress(); - } - return null; - } - async lookupAddress(address) { - address = getAddress(address); - const node = namehash(address.substring(2).toLowerCase() + ".addr.reverse"); - try { - const ensAddr = await EnsResolver.getEnsAddress(this); - const ensContract = new Contract(ensAddr, [ - "function resolver(bytes32) view returns (address)" - ], this); - const resolver = await ensContract.resolver(node); - if (resolver == null || resolver === ZeroAddress) { - return null; - } - const resolverContract = new Contract(resolver, [ - "function name(bytes32) view returns (string)" - ], this); - const name = await resolverContract.name(node); - // Failed forward resolution - const check = await this.resolveName(name); - if (check !== address) { - return null; - } - return name; - } - catch (error) { - // No data was returned from the resolver - if (isError(error, "BAD_DATA") && error.value === "0x") { - return null; - } - // Something reerted - if (isError(error, "CALL_EXCEPTION")) { - return null; - } - throw error; - } - return null; - } - async waitForTransaction(hash, _confirms, timeout) { - const confirms = (_confirms != null) ? _confirms : 1; - if (confirms === 0) { - return this.getTransactionReceipt(hash); - } - return new Promise(async (resolve, reject) => { - let timer = null; - const listener = (async (blockNumber) => { - try { - const receipt = await this.getTransactionReceipt(hash); - if (receipt != null) { - if (blockNumber - receipt.blockNumber + 1 >= confirms) { - resolve(receipt); - //this.off("block", listener); - if (timer) { - clearTimeout(timer); - timer = null; - } - return; - } - } - } - catch (error) { - console.log("EEE", error); - } - this.once("block", listener); - }); - if (timeout != null) { - timer = setTimeout(() => { - if (timer == null) { - return; - } - timer = null; - this.off("block", listener); - reject(makeError("timeout", "TIMEOUT", { reason: "timeout" })); - }, timeout); - } - listener(await this.getBlockNumber()); - }); - } - async waitForBlock(blockTag) { - assert(false, "not implemented yet", "NOT_IMPLEMENTED", { - operation: "waitForBlock" - }); - } - /** - * Clear a timer created using the [[_setTimeout]] method. - */ - _clearTimeout(timerId) { - const timer = this.#timers.get(timerId); - if (!timer) { - return; - } - if (timer.timer) { - clearTimeout(timer.timer); - } - this.#timers.delete(timerId); - } - /** - * Create a timer that will execute %%func%% after at least %%timeout%% - * (in ms). If %%timeout%% is unspecified, then %%func%% will execute - * in the next event loop. - * - * [Pausing](AbstractProvider-paused) the provider will pause any - * associated timers. - */ - _setTimeout(_func, timeout) { - if (timeout == null) { - timeout = 0; - } - const timerId = this.#nextTimer++; - const func = () => { - this.#timers.delete(timerId); - _func(); - }; - if (this.paused) { - this.#timers.set(timerId, { timer: null, func, time: timeout }); - } - else { - const timer = setTimeout(func, timeout); - this.#timers.set(timerId, { timer, func, time: getTime$1() }); - } - return timerId; - } - /** - * Perform %%func%% on each subscriber. - */ - _forEachSubscriber(func) { - for (const sub of this.#subs.values()) { - func(sub.subscriber); - } - } - /** - * Sub-classes may override this to customize subscription - * implementations. - */ - _getSubscriber(sub) { - switch (sub.type) { - case "debug": - case "error": - case "network": - return new UnmanagedSubscriber(sub.type); - case "block": { - const subscriber = new PollingBlockSubscriber(this); - subscriber.pollingInterval = this.pollingInterval; - return subscriber; - } - case "safe": - case "finalized": - return new PollingBlockTagSubscriber(this, sub.type); - case "event": - return new PollingEventSubscriber(this, sub.filter); - case "transaction": - return new PollingTransactionSubscriber(this, sub.hash); - case "orphan": - return new PollingOrphanSubscriber(this, sub.filter); - } - throw new Error(`unsupported event: ${sub.type}`); - } - /** - * If a [[Subscriber]] fails and needs to replace itself, this - * method may be used. - * - * For example, this is used for providers when using the - * ``eth_getFilterChanges`` method, which can return null if state - * filters are not supported by the backend, allowing the Subscriber - * to swap in a [[PollingEventSubscriber]]. - */ - _recoverSubscriber(oldSub, newSub) { - for (const sub of this.#subs.values()) { - if (sub.subscriber === oldSub) { - if (sub.started) { - sub.subscriber.stop(); - } - sub.subscriber = newSub; - if (sub.started) { - newSub.start(); - } - if (this.#pausedState != null) { - newSub.pause(this.#pausedState); - } - break; - } - } - } - async #hasSub(event, emitArgs) { - let sub = await getSubscription(event, this); - // This is a log that is removing an existing log; we actually want - // to emit an orphan event for the removed log - if (sub.type === "event" && emitArgs && emitArgs.length > 0 && emitArgs[0].removed === true) { - sub = await getSubscription({ orphan: "drop-log", log: emitArgs[0] }, this); - } - return this.#subs.get(sub.tag) || null; - } - async #getSub(event) { - const subscription = await getSubscription(event, this); - // Prevent tampering with our tag in any subclass' _getSubscriber - const tag = subscription.tag; - let sub = this.#subs.get(tag); - if (!sub) { - const subscriber = this._getSubscriber(subscription); - const addressableMap = new WeakMap(); - const nameMap = new Map(); - sub = { subscriber, tag, addressableMap, nameMap, started: false, listeners: [] }; - this.#subs.set(tag, sub); - } - return sub; - } - async on(event, listener) { - const sub = await this.#getSub(event); - sub.listeners.push({ listener, once: false }); - if (!sub.started) { - sub.subscriber.start(); - sub.started = true; - if (this.#pausedState != null) { - sub.subscriber.pause(this.#pausedState); - } - } - return this; - } - async once(event, listener) { - const sub = await this.#getSub(event); - sub.listeners.push({ listener, once: true }); - if (!sub.started) { - sub.subscriber.start(); - sub.started = true; - if (this.#pausedState != null) { - sub.subscriber.pause(this.#pausedState); - } - } - return this; - } - async emit(event, ...args) { - const sub = await this.#hasSub(event, args); - // If there is not subscription or if a recent emit removed - // the last of them (which also deleted the sub) do nothing - if (!sub || sub.listeners.length === 0) { - return false; - } - const count = sub.listeners.length; - sub.listeners = sub.listeners.filter(({ listener, once }) => { - const payload = new EventPayload(this, (once ? null : listener), event); - try { - listener.call(this, ...args, payload); - } - catch (error) { } - return !once; - }); - if (sub.listeners.length === 0) { - if (sub.started) { - sub.subscriber.stop(); - } - this.#subs.delete(sub.tag); - } - return (count > 0); - } - async listenerCount(event) { - if (event) { - const sub = await this.#hasSub(event); - if (!sub) { - return 0; - } - return sub.listeners.length; - } - let total = 0; - for (const { listeners } of this.#subs.values()) { - total += listeners.length; - } - return total; - } - async listeners(event) { - if (event) { - const sub = await this.#hasSub(event); - if (!sub) { - return []; - } - return sub.listeners.map(({ listener }) => listener); - } - let result = []; - for (const { listeners } of this.#subs.values()) { - result = result.concat(listeners.map(({ listener }) => listener)); - } - return result; - } - async off(event, listener) { - const sub = await this.#hasSub(event); - if (!sub) { - return this; - } - if (listener) { - const index = sub.listeners.map(({ listener }) => listener).indexOf(listener); - if (index >= 0) { - sub.listeners.splice(index, 1); - } - } - if (!listener || sub.listeners.length === 0) { - if (sub.started) { - sub.subscriber.stop(); - } - this.#subs.delete(sub.tag); - } - return this; - } - async removeAllListeners(event) { - if (event) { - const { tag, started, subscriber } = await this.#getSub(event); - if (started) { - subscriber.stop(); - } - this.#subs.delete(tag); - } - else { - for (const [tag, { started, subscriber }] of this.#subs) { - if (started) { - subscriber.stop(); - } - this.#subs.delete(tag); - } - } - return this; - } - // Alias for "on" - async addListener(event, listener) { - return await this.on(event, listener); - } - // Alias for "off" - async removeListener(event, listener) { - return this.off(event, listener); - } - /** - * If this provider has been destroyed using the [[destroy]] method. - * - * Once destroyed, all resources are reclaimed, internal event loops - * and timers are cleaned up and no further requests may be sent to - * the provider. - */ - get destroyed() { - return this.#destroyed; - } - /** - * Sub-classes may use this to shutdown any sockets or release their - * resources and reject any pending requests. - * - * Sub-classes **must** call ``super.destroy()``. - */ - destroy() { - // Stop all listeners - this.removeAllListeners(); - // Shut down all tiemrs - for (const timerId of this.#timers.keys()) { - this._clearTimeout(timerId); - } - this.#destroyed = true; - } - /** - * Whether the provider is currently paused. - * - * A paused provider will not emit any events, and generally should - * not make any requests to the network, but that is up to sub-classes - * to manage. - * - * Setting ``paused = true`` is identical to calling ``.pause(false)``, - * which will buffer any events that occur while paused until the - * provider is unpaused. - */ - get paused() { return (this.#pausedState != null); } - set paused(pause) { - if (!!pause === this.paused) { - return; - } - if (this.paused) { - this.resume(); - } - else { - this.pause(false); - } - } - /** - * Pause the provider. If %%dropWhilePaused%%, any events that occur - * while paused are dropped, otherwise all events will be emitted once - * the provider is unpaused. - */ - pause(dropWhilePaused) { - this.#lastBlockNumber = -1; - if (this.#pausedState != null) { - if (this.#pausedState == !!dropWhilePaused) { - return; - } - assert(false, "cannot change pause type; resume first", "UNSUPPORTED_OPERATION", { - operation: "pause" - }); - } - this._forEachSubscriber((s) => s.pause(dropWhilePaused)); - this.#pausedState = !!dropWhilePaused; - for (const timer of this.#timers.values()) { - // Clear the timer - if (timer.timer) { - clearTimeout(timer.timer); - } - // Remaining time needed for when we become unpaused - timer.time = getTime$1() - timer.time; - } - } - /** - * Resume the provider. - */ - resume() { - if (this.#pausedState == null) { - return; - } - this._forEachSubscriber((s) => s.resume()); - this.#pausedState = null; - for (const timer of this.#timers.values()) { - // Remaining time when we were paused - let timeout = timer.time; - if (timeout < 0) { - timeout = 0; - } - // Start time (in cause paused, so we con compute remaininf time) - timer.time = getTime$1(); - // Start the timer - setTimeout(timer.func, timeout); - } - } -} -function _parseString(result, start) { - try { - const bytes = _parseBytes(result, start); - if (bytes) { - return toUtf8String(bytes); - } - } - catch (error) { } - return null; -} -function _parseBytes(result, start) { - if (result === "0x") { - return null; - } - try { - const offset = getNumber(dataSlice(result, start, start + 32)); - const length = getNumber(dataSlice(result, offset, offset + 32)); - return dataSlice(result, offset + 32, offset + 32 + length); - } - catch (error) { } - return null; -} -function numPad(value) { - const result = toBeArray(value); - if (result.length > 32) { - throw new Error("internal; should not happen"); - } - const padded = new Uint8Array(32); - padded.set(result, 32 - result.length); - return padded; -} -function bytesPad(value) { - if ((value.length % 32) === 0) { - return value; - } - const result = new Uint8Array(Math.ceil(value.length / 32) * 32); - result.set(value); - return result; -} -const empty = new Uint8Array([]); -// ABI Encodes a series of (bytes, bytes, ...) -function encodeBytes(datas) { - const result = []; - let byteCount = 0; - // Add place-holders for pointers as we add items - for (let i = 0; i < datas.length; i++) { - result.push(empty); - byteCount += 32; - } - for (let i = 0; i < datas.length; i++) { - const data = getBytes(datas[i]); - // Update the bytes offset - result[i] = numPad(byteCount); - // The length and padded value of data - result.push(numPad(data.length)); - result.push(bytesPad(data)); - byteCount += 32 + Math.ceil(data.length / 32) * 32; - } - return concat(result); -} -const zeros = "0x0000000000000000000000000000000000000000000000000000000000000000"; -function parseOffchainLookup(data) { - const result = { - sender: "", urls: [], calldata: "", selector: "", extraData: "", errorArgs: [] - }; - assert(dataLength(data) >= 5 * 32, "insufficient OffchainLookup data", "OFFCHAIN_FAULT", { - reason: "insufficient OffchainLookup data" - }); - const sender = dataSlice(data, 0, 32); - assert(dataSlice(sender, 0, 12) === dataSlice(zeros, 0, 12), "corrupt OffchainLookup sender", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup sender" - }); - result.sender = dataSlice(sender, 12); - // Read the URLs from the response - try { - const urls = []; - const urlsOffset = getNumber(dataSlice(data, 32, 64)); - const urlsLength = getNumber(dataSlice(data, urlsOffset, urlsOffset + 32)); - const urlsData = dataSlice(data, urlsOffset + 32); - for (let u = 0; u < urlsLength; u++) { - const url = _parseString(urlsData, u * 32); - if (url == null) { - throw new Error("abort"); - } - urls.push(url); - } - result.urls = urls; - } - catch (error) { - assert(false, "corrupt OffchainLookup urls", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup urls" - }); - } - // Get the CCIP calldata to forward - try { - const calldata = _parseBytes(data, 64); - if (calldata == null) { - throw new Error("abort"); - } - result.calldata = calldata; - } - catch (error) { - assert(false, "corrupt OffchainLookup calldata", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup calldata" - }); - } - // Get the callbackSelector (bytes4) - assert(dataSlice(data, 100, 128) === dataSlice(zeros, 0, 28), "corrupt OffchainLookup callbaackSelector", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup callbaackSelector" - }); - result.selector = dataSlice(data, 96, 100); - // Get the extra data to send back to the contract as context - try { - const extraData = _parseBytes(data, 128); - if (extraData == null) { - throw new Error("abort"); - } - result.extraData = extraData; - } - catch (error) { - assert(false, "corrupt OffchainLookup extraData", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup extraData" - }); - } - result.errorArgs = "sender,urls,calldata,selector,extraData".split(/,/).map((k) => result[k]); - return result; -} - -/** - * Generally the [[Wallet]] and [[JsonRpcSigner]] and their sub-classes - * are sufficient for most developers, but this is provided to - * fascilitate more complex Signers. - * - * @_section: api/providers/abstract-signer: Subclassing Signer [abstract-signer] - */ -function checkProvider(signer, operation) { - if (signer.provider) { - return signer.provider; - } - assert(false, "missing provider", "UNSUPPORTED_OPERATION", { operation }); -} -async function populate(signer, tx) { - let pop = copyRequest(tx); - if (pop.to != null) { - pop.to = resolveAddress(pop.to, signer); - } - if (pop.from != null) { - const from = pop.from; - pop.from = Promise.all([ - signer.getAddress(), - resolveAddress(from, signer) - ]).then(([address, from]) => { - assertArgument(address.toLowerCase() === from.toLowerCase(), "transaction from mismatch", "tx.from", from); - return address; - }); - } - else { - pop.from = signer.getAddress(); - } - return await resolveProperties(pop); -} -/** - * An **AbstractSigner** includes most of teh functionality required - * to get a [[Signer]] working as expected, but requires a few - * Signer-specific methods be overridden. - * - */ -class AbstractSigner { - /** - * The provider this signer is connected to. - */ - provider; - /** - * Creates a new Signer connected to %%provider%%. - */ - constructor(provider) { - defineProperties(this, { provider: (provider || null) }); - } - async getNonce(blockTag) { - return checkProvider(this, "getTransactionCount").getTransactionCount(await this.getAddress(), blockTag); - } - async populateCall(tx) { - const pop = await populate(this, tx); - return pop; - } - async populateTransaction(tx) { - const provider = checkProvider(this, "populateTransaction"); - const pop = await populate(this, tx); - if (pop.nonce == null) { - pop.nonce = await this.getNonce("pending"); - } - if (pop.gasLimit == null) { - pop.gasLimit = await this.estimateGas(pop); - } - // Populate the chain ID - const network = await (this.provider).getNetwork(); - if (pop.chainId != null) { - const chainId = getBigInt(pop.chainId); - assertArgument(chainId === network.chainId, "transaction chainId mismatch", "tx.chainId", tx.chainId); - } - else { - pop.chainId = network.chainId; - } - // Do not allow mixing pre-eip-1559 and eip-1559 properties - const hasEip1559 = (pop.maxFeePerGas != null || pop.maxPriorityFeePerGas != null); - if (pop.gasPrice != null && (pop.type === 2 || hasEip1559)) { - assertArgument(false, "eip-1559 transaction do not support gasPrice", "tx", tx); - } - else if ((pop.type === 0 || pop.type === 1) && hasEip1559) { - assertArgument(false, "pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas", "tx", tx); - } - if ((pop.type === 2 || pop.type == null) && (pop.maxFeePerGas != null && pop.maxPriorityFeePerGas != null)) { - // Fully-formed EIP-1559 transaction (skip getFeeData) - pop.type = 2; - } - else if (pop.type === 0 || pop.type === 1) { - // Explicit Legacy or EIP-2930 transaction - // We need to get fee data to determine things - const feeData = await provider.getFeeData(); - assert(feeData.gasPrice != null, "network does not support gasPrice", "UNSUPPORTED_OPERATION", { - operation: "getGasPrice" - }); - // Populate missing gasPrice - if (pop.gasPrice == null) { - pop.gasPrice = feeData.gasPrice; - } - } - else { - // We need to get fee data to determine things - const feeData = await provider.getFeeData(); - if (pop.type == null) { - // We need to auto-detect the intended type of this transaction... - if (feeData.maxFeePerGas != null && feeData.maxPriorityFeePerGas != null) { - // The network supports EIP-1559! - // Upgrade transaction from null to eip-1559 - if (pop.authorizationList && pop.authorizationList.length) { - pop.type = 4; - } - else { - pop.type = 2; - } - if (pop.gasPrice != null) { - // Using legacy gasPrice property on an eip-1559 network, - // so use gasPrice as both fee properties - const gasPrice = pop.gasPrice; - delete pop.gasPrice; - pop.maxFeePerGas = gasPrice; - pop.maxPriorityFeePerGas = gasPrice; - } - else { - // Populate missing fee data - if (pop.maxFeePerGas == null) { - pop.maxFeePerGas = feeData.maxFeePerGas; - } - if (pop.maxPriorityFeePerGas == null) { - pop.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas; - } - } - } - else if (feeData.gasPrice != null) { - // Network doesn't support EIP-1559... - // ...but they are trying to use EIP-1559 properties - assert(!hasEip1559, "network does not support EIP-1559", "UNSUPPORTED_OPERATION", { - operation: "populateTransaction" - }); - // Populate missing fee data - if (pop.gasPrice == null) { - pop.gasPrice = feeData.gasPrice; - } - // Explicitly set untyped transaction to legacy - // @TODO: Maybe this shold allow type 1? - pop.type = 0; - } - else { - // getFeeData has failed us. - assert(false, "failed to get consistent fee data", "UNSUPPORTED_OPERATION", { - operation: "signer.getFeeData" - }); - } - } - else if (pop.type === 2 || pop.type === 3 || pop.type === 4) { - // Explicitly using EIP-1559 or EIP-4844 - // Populate missing fee data - if (pop.maxFeePerGas == null) { - pop.maxFeePerGas = feeData.maxFeePerGas; - } - if (pop.maxPriorityFeePerGas == null) { - pop.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas; - } - } - } - //@TOOD: Don't await all over the place; save them up for - // the end for better batching - return await resolveProperties(pop); - } - async populateAuthorization(_auth) { - const auth = Object.assign({}, _auth); - // Add a chain ID if not explicitly set to 0 - if (auth.chainId == null) { - auth.chainId = (await checkProvider(this, "getNetwork").getNetwork()).chainId; - } - // @TODO: Take chain ID into account when populating noce? - if (auth.nonce == null) { - auth.nonce = await this.getNonce(); - } - return auth; - } - async estimateGas(tx) { - return checkProvider(this, "estimateGas").estimateGas(await this.populateCall(tx)); - } - async call(tx) { - return checkProvider(this, "call").call(await this.populateCall(tx)); - } - async resolveName(name) { - const provider = checkProvider(this, "resolveName"); - return await provider.resolveName(name); - } - async sendTransaction(tx) { - const provider = checkProvider(this, "sendTransaction"); - const pop = await this.populateTransaction(tx); - delete pop.from; - const txObj = Transaction.from(pop); - return await provider.broadcastTransaction(await this.signTransaction(txObj)); - } - // @TODO: in v7 move this to be abstract - authorize(authorization) { - assert(false, "authorization not implemented for this signer", "UNSUPPORTED_OPERATION", { operation: "authorize" }); - } -} -/** - * A **VoidSigner** is a class designed to allow an address to be used - * in any API which accepts a Signer, but for which there are no - * credentials available to perform any actual signing. - * - * This for example allow impersonating an account for the purpose of - * static calls or estimating gas, but does not allow sending transactions. - */ -class VoidSigner extends AbstractSigner { - /** - * The signer address. - */ - address; - /** - * Creates a new **VoidSigner** with %%address%% attached to - * %%provider%%. - */ - constructor(address, provider) { - super(provider); - defineProperties(this, { address }); - } - async getAddress() { return this.address; } - connect(provider) { - return new VoidSigner(this.address, provider); - } - #throwUnsupported(suffix, operation) { - assert(false, `VoidSigner cannot sign ${suffix}`, "UNSUPPORTED_OPERATION", { operation }); - } - async signTransaction(tx) { - this.#throwUnsupported("transactions", "signTransaction"); - } - async signMessage(message) { - this.#throwUnsupported("messages", "signMessage"); - } - async signTypedData(domain, types, value) { - this.#throwUnsupported("typed-data", "signTypedData"); - } -} - -/** - * There are many awesome community services that provide Ethereum - * nodes both for developers just starting out and for large-scale - * communities. - * - * @_section: api/providers/thirdparty: Community Providers [thirdparty] - */ -// Show the throttle message only once per service -const shown = new Set(); -/** - * Displays a warning in the console when the community resource is - * being used too heavily by the app, recommending the developer - * acquire their own credentials instead of using the community - * credentials. - * - * The notification will only occur once per service. - */ -function showThrottleMessage(service) { - if (shown.has(service)) { - return; - } - shown.add(service); - console.log("========= NOTICE ========="); - console.log(`Request-Rate Exceeded for ${service} (this message will not be repeated)`); - console.log(""); - console.log("The default API keys for each service are provided as a highly-throttled,"); - console.log("community resource for low-traffic projects and early prototyping."); - console.log(""); - console.log("While your application will continue to function, we highly recommended"); - console.log("signing up for your own API keys to improve performance, increase your"); - console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."); - console.log(""); - console.log("For more details: https:/\/docs.ethers.org/api-keys/"); - console.log("=========================="); -} - -function copy(obj) { - return JSON.parse(JSON.stringify(obj)); -} -/** - * Some backends support subscribing to events using a Filter ID. - * - * When subscribing with this technique, the node issues a unique - * //Filter ID//. At this point the node dedicates resources to - * the filter, so that periodic calls to follow up on the //Filter ID// - * will receive any events since the last call. - * - * @_docloc: api/providers/abstract-provider - */ -class FilterIdSubscriber { - #provider; - #filterIdPromise; - #poller; - #running; - #network; - #hault; - /** - * Creates a new **FilterIdSubscriber** which will used [[_subscribe]] - * and [[_emitResults]] to setup the subscription and provide the event - * to the %%provider%%. - */ - constructor(provider) { - this.#provider = provider; - this.#filterIdPromise = null; - this.#poller = this.#poll.bind(this); - this.#running = false; - this.#network = null; - this.#hault = false; - } - /** - * Sub-classes **must** override this to begin the subscription. - */ - _subscribe(provider) { - throw new Error("subclasses must override this"); - } - /** - * Sub-classes **must** override this handle the events. - */ - _emitResults(provider, result) { - throw new Error("subclasses must override this"); - } - /** - * Sub-classes **must** override this handle recovery on errors. - */ - _recover(provider) { - throw new Error("subclasses must override this"); - } - async #poll(blockNumber) { - try { - // Subscribe if necessary - if (this.#filterIdPromise == null) { - this.#filterIdPromise = this._subscribe(this.#provider); - } - // Get the Filter ID - let filterId = null; - try { - filterId = await this.#filterIdPromise; - } - catch (error) { - if (!isError(error, "UNSUPPORTED_OPERATION") || error.operation !== "eth_newFilter") { - throw error; - } - } - // The backend does not support Filter ID; downgrade to - // polling - if (filterId == null) { - this.#filterIdPromise = null; - this.#provider._recoverSubscriber(this, this._recover(this.#provider)); - return; - } - const network = await this.#provider.getNetwork(); - if (!this.#network) { - this.#network = network; - } - if (this.#network.chainId !== network.chainId) { - throw new Error("chaid changed"); - } - if (this.#hault) { - return; - } - const result = await this.#provider.send("eth_getFilterChanges", [filterId]); - await this._emitResults(this.#provider, result); - } - catch (error) { - console.log("@TODO", error); - } - this.#provider.once("block", this.#poller); - } - #teardown() { - const filterIdPromise = this.#filterIdPromise; - if (filterIdPromise) { - this.#filterIdPromise = null; - filterIdPromise.then((filterId) => { - if (this.#provider.destroyed) { - return; - } - this.#provider.send("eth_uninstallFilter", [filterId]); - }); - } - } - start() { - if (this.#running) { - return; - } - this.#running = true; - this.#poll(-2); - } - stop() { - if (!this.#running) { - return; - } - this.#running = false; - this.#hault = true; - this.#teardown(); - this.#provider.off("block", this.#poller); - } - pause(dropWhilePaused) { - if (dropWhilePaused) { - this.#teardown(); - } - this.#provider.off("block", this.#poller); - } - resume() { this.start(); } -} -/** - * A **FilterIdSubscriber** for receiving contract events. - * - * @_docloc: api/providers/abstract-provider - */ -class FilterIdEventSubscriber extends FilterIdSubscriber { - #event; - /** - * Creates a new **FilterIdEventSubscriber** attached to %%provider%% - * listening for %%filter%%. - */ - constructor(provider, filter) { - super(provider); - this.#event = copy(filter); - } - _recover(provider) { - return new PollingEventSubscriber(provider, this.#event); - } - async _subscribe(provider) { - const filterId = await provider.send("eth_newFilter", [this.#event]); - return filterId; - } - async _emitResults(provider, results) { - for (const result of results) { - provider.emit(this.#event, provider._wrapLog(result, provider._network)); - } - } -} -/** - * A **FilterIdSubscriber** for receiving pending transactions events. - * - * @_docloc: api/providers/abstract-provider - */ -class FilterIdPendingSubscriber extends FilterIdSubscriber { - async _subscribe(provider) { - return await provider.send("eth_newPendingTransactionFilter", []); - } - async _emitResults(provider, results) { - for (const result of results) { - provider.emit("pending", result); - } - } -} - -/** - * One of the most common ways to interact with the blockchain is - * by a node running a JSON-RPC interface which can be connected to, - * based on the transport, using: - * - * - HTTP or HTTPS - [[JsonRpcProvider]] - * - WebSocket - [[WebSocketProvider]] - * - IPC - [[IpcSocketProvider]] - * - * @_section: api/providers/jsonrpc:JSON-RPC Provider [about-jsonrpcProvider] - */ -// @TODO: -// - Add the batching API -// https://playground.open-rpc.org/?schemaUrl=https://raw.githubusercontent.com/ethereum/eth1.0-apis/assembled-spec/openrpc.json&uiSchema%5BappBar%5D%5Bui:splitView%5D=true&uiSchema%5BappBar%5D%5Bui:input%5D=false&uiSchema%5BappBar%5D%5Bui:examplesDropdown%5D=false -const Primitive = "bigint,boolean,function,number,string,symbol".split(/,/g); -//const Methods = "getAddress,then".split(/,/g); -function deepCopy(value) { - if (value == null || Primitive.indexOf(typeof (value)) >= 0) { - return value; - } - // Keep any Addressable - if (typeof (value.getAddress) === "function") { - return value; - } - if (Array.isArray(value)) { - return (value.map(deepCopy)); - } - if (typeof (value) === "object") { - return Object.keys(value).reduce((accum, key) => { - accum[key] = value[key]; - return accum; - }, {}); - } - throw new Error(`should not happen: ${value} (${typeof (value)})`); -} -function stall$3(duration) { - return new Promise((resolve) => { setTimeout(resolve, duration); }); -} -function getLowerCase(value) { - if (value) { - return value.toLowerCase(); - } - return value; -} -function isPollable(value) { - return (value && typeof (value.pollingInterval) === "number"); -} -const defaultOptions = { - polling: false, - staticNetwork: null, - batchStallTime: 10, - batchMaxSize: (1 << 20), - batchMaxCount: 100, - cacheTimeout: 250, - pollingInterval: 4000 -}; -// @TODO: Unchecked Signers -class JsonRpcSigner extends AbstractSigner { - address; - constructor(provider, address) { - super(provider); - address = getAddress(address); - defineProperties(this, { address }); - } - connect(provider) { - assert(false, "cannot reconnect JsonRpcSigner", "UNSUPPORTED_OPERATION", { - operation: "signer.connect" - }); - } - async getAddress() { - return this.address; - } - // JSON-RPC will automatially fill in nonce, etc. so we just check from - async populateTransaction(tx) { - return await this.populateCall(tx); - } - // Returns just the hash of the transaction after sent, which is what - // the bare JSON-RPC API does; - async sendUncheckedTransaction(_tx) { - const tx = deepCopy(_tx); - const promises = []; - // Make sure the from matches the sender - if (tx.from) { - const _from = tx.from; - promises.push((async () => { - const from = await resolveAddress(_from, this.provider); - assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(), "from address mismatch", "transaction", _tx); - tx.from = from; - })()); - } - else { - tx.from = this.address; - } - // The JSON-RPC for eth_sendTransaction uses 90000 gas; if the user - // wishes to use this, it is easy to specify explicitly, otherwise - // we look it up for them. - if (tx.gasLimit == null) { - promises.push((async () => { - tx.gasLimit = await this.provider.estimateGas({ ...tx, from: this.address }); - })()); - } - // The address may be an ENS name or Addressable - if (tx.to != null) { - const _to = tx.to; - promises.push((async () => { - tx.to = await resolveAddress(_to, this.provider); - })()); - } - // Wait until all of our properties are filled in - if (promises.length) { - await Promise.all(promises); - } - const hexTx = this.provider.getRpcTransaction(tx); - return this.provider.send("eth_sendTransaction", [hexTx]); - } - async sendTransaction(tx) { - // This cannot be mined any earlier than any recent block - const blockNumber = await this.provider.getBlockNumber(); - // Send the transaction - const hash = await this.sendUncheckedTransaction(tx); - // Unfortunately, JSON-RPC only provides and opaque transaction hash - // for a response, and we need the actual transaction, so we poll - // for it; it should show up very quickly - return await (new Promise((resolve, reject) => { - const timeouts = [1000, 100]; - let invalids = 0; - const checkTx = async () => { - try { - // Try getting the transaction - const tx = await this.provider.getTransaction(hash); - if (tx != null) { - resolve(tx.replaceableTransaction(blockNumber)); - return; - } - } - catch (error) { - // If we were cancelled: stop polling. - // If the data is bad: the node returns bad transactions - // If the network changed: calling again will also fail - // If unsupported: likely destroyed - if (isError(error, "CANCELLED") || isError(error, "BAD_DATA") || - isError(error, "NETWORK_ERROR") || isError(error, "UNSUPPORTED_OPERATION")) { - if (error.info == null) { - error.info = {}; - } - error.info.sendTransactionHash = hash; - reject(error); - return; - } - // Stop-gap for misbehaving backends; see #4513 - if (isError(error, "INVALID_ARGUMENT")) { - invalids++; - if (error.info == null) { - error.info = {}; - } - error.info.sendTransactionHash = hash; - if (invalids > 10) { - reject(error); - return; - } - } - // Notify anyone that cares; but we will try again, since - // it is likely an intermittent service error - this.provider.emit("error", makeError("failed to fetch transation after sending (will try again)", "UNKNOWN_ERROR", { error })); - } - // Wait another 4 seconds - this.provider._setTimeout(() => { checkTx(); }, timeouts.pop() || 4000); - }; - checkTx(); - })); - } - async signTransaction(_tx) { - const tx = deepCopy(_tx); - // Make sure the from matches the sender - if (tx.from) { - const from = await resolveAddress(tx.from, this.provider); - assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(), "from address mismatch", "transaction", _tx); - tx.from = from; - } - else { - tx.from = this.address; - } - const hexTx = this.provider.getRpcTransaction(tx); - return await this.provider.send("eth_signTransaction", [hexTx]); - } - async signMessage(_message) { - const message = ((typeof (_message) === "string") ? toUtf8Bytes(_message) : _message); - return await this.provider.send("personal_sign", [ - hexlify(message), this.address.toLowerCase() - ]); - } - async signTypedData(domain, types, _value) { - const value = deepCopy(_value); - // Populate any ENS names (in-place) - const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (value) => { - const address = await resolveAddress(value); - assertArgument(address != null, "TypedData does not support null address", "value", value); - return address; - }); - return await this.provider.send("eth_signTypedData_v4", [ - this.address.toLowerCase(), - JSON.stringify(TypedDataEncoder.getPayload(populated.domain, types, populated.value)) - ]); - } - async unlock(password) { - return this.provider.send("personal_unlockAccount", [ - this.address.toLowerCase(), password, null - ]); - } - // https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign - async _legacySignMessage(_message) { - const message = ((typeof (_message) === "string") ? toUtf8Bytes(_message) : _message); - return await this.provider.send("eth_sign", [ - this.address.toLowerCase(), hexlify(message) - ]); - } -} -/** - * The JsonRpcApiProvider is an abstract class and **MUST** be - * sub-classed. - * - * It provides the base for all JSON-RPC-based Provider interaction. - * - * Sub-classing Notes: - * - a sub-class MUST override _send - * - a sub-class MUST call the `_start()` method once connected - */ -class JsonRpcApiProvider extends AbstractProvider { - #options; - // The next ID to use for the JSON-RPC ID field - #nextId; - // Payloads are queued and triggered in batches using the drainTimer - #payloads; - #drainTimer; - #notReady; - #network; - #pendingDetectNetwork; - #scheduleDrain() { - if (this.#drainTimer) { - return; - } - // If we aren't using batching, no harm in sending it immediately - const stallTime = (this._getOption("batchMaxCount") === 1) ? 0 : this._getOption("batchStallTime"); - this.#drainTimer = setTimeout(() => { - this.#drainTimer = null; - const payloads = this.#payloads; - this.#payloads = []; - while (payloads.length) { - // Create payload batches that satisfy our batch constraints - const batch = [(payloads.shift())]; - while (payloads.length) { - if (batch.length === this.#options.batchMaxCount) { - break; - } - batch.push((payloads.shift())); - const bytes = JSON.stringify(batch.map((p) => p.payload)); - if (bytes.length > this.#options.batchMaxSize) { - payloads.unshift((batch.pop())); - break; - } - } - // Process the result to each payload - (async () => { - const payload = ((batch.length === 1) ? batch[0].payload : batch.map((p) => p.payload)); - this.emit("debug", { action: "sendRpcPayload", payload }); - try { - const result = await this._send(payload); - this.emit("debug", { action: "receiveRpcResult", result }); - // Process results in batch order - for (const { resolve, reject, payload } of batch) { - if (this.destroyed) { - reject(makeError("provider destroyed; cancelled request", "UNSUPPORTED_OPERATION", { operation: payload.method })); - continue; - } - // Find the matching result - const resp = result.filter((r) => (r.id === payload.id))[0]; - // No result; the node failed us in unexpected ways - if (resp == null) { - const error = makeError("missing response for request", "BAD_DATA", { - value: result, info: { payload } - }); - this.emit("error", error); - reject(error); - continue; - } - // The response is an error - if ("error" in resp) { - reject(this.getRpcError(payload, resp)); - continue; - } - // All good; send the result - resolve(resp.result); - } - } - catch (error) { - this.emit("debug", { action: "receiveRpcError", error }); - for (const { reject } of batch) { - // @TODO: augment the error with the payload - reject(error); - } - } - })(); - } - }, stallTime); - } - constructor(network, options) { - super(network, options); - this.#nextId = 1; - this.#options = Object.assign({}, defaultOptions, options || {}); - this.#payloads = []; - this.#drainTimer = null; - this.#network = null; - this.#pendingDetectNetwork = null; - { - let resolve = null; - const promise = new Promise((_resolve) => { - resolve = _resolve; - }); - this.#notReady = { promise, resolve }; - } - const staticNetwork = this._getOption("staticNetwork"); - if (typeof (staticNetwork) === "boolean") { - assertArgument(!staticNetwork || network !== "any", "staticNetwork cannot be used on special network 'any'", "options", options); - if (staticNetwork && network != null) { - this.#network = Network.from(network); - } - } - else if (staticNetwork) { - // Make sure any static network is compatbile with the provided netwrok - assertArgument(network == null || staticNetwork.matches(network), "staticNetwork MUST match network object", "options", options); - this.#network = staticNetwork; - } - } - /** - * Returns the value associated with the option %%key%%. - * - * Sub-classes can use this to inquire about configuration options. - */ - _getOption(key) { - return this.#options[key]; - } - /** - * Gets the [[Network]] this provider has committed to. On each call, the network - * is detected, and if it has changed, the call will reject. - */ - get _network() { - assert(this.#network, "network is not available yet", "NETWORK_ERROR"); - return this.#network; - } - /** - * Resolves to the non-normalized value by performing %%req%%. - * - * Sub-classes may override this to modify behavior of actions, - * and should generally call ``super._perform`` as a fallback. - */ - async _perform(req) { - // Legacy networks do not like the type field being passed along (which - // is fair), so we delete type if it is 0 and a non-EIP-1559 network - if (req.method === "call" || req.method === "estimateGas") { - let tx = req.transaction; - if (tx && tx.type != null && getBigInt(tx.type)) { - // If there are no EIP-1559 or newer properties, it might be pre-EIP-1559 - if (tx.maxFeePerGas == null && tx.maxPriorityFeePerGas == null) { - const feeData = await this.getFeeData(); - if (feeData.maxFeePerGas == null && feeData.maxPriorityFeePerGas == null) { - // Network doesn't know about EIP-1559 (and hence type) - req = Object.assign({}, req, { - transaction: Object.assign({}, tx, { type: undefined }) - }); - } - } - } - } - const request = this.getRpcRequest(req); - if (request != null) { - return await this.send(request.method, request.args); - } - return super._perform(req); - } - /** - * Sub-classes may override this; it detects the *actual* network that - * we are **currently** connected to. - * - * Keep in mind that [[send]] may only be used once [[ready]], otherwise the - * _send primitive must be used instead. - */ - async _detectNetwork() { - const network = this._getOption("staticNetwork"); - if (network) { - if (network === true) { - if (this.#network) { - return this.#network; - } - } - else { - return network; - } - } - if (this.#pendingDetectNetwork) { - return await this.#pendingDetectNetwork; - } - // If we are ready, use ``send``, which enabled requests to be batched - if (this.ready) { - this.#pendingDetectNetwork = (async () => { - try { - const result = Network.from(getBigInt(await this.send("eth_chainId", []))); - this.#pendingDetectNetwork = null; - return result; - } - catch (error) { - this.#pendingDetectNetwork = null; - throw error; - } - })(); - return await this.#pendingDetectNetwork; - } - // We are not ready yet; use the primitive _send - this.#pendingDetectNetwork = (async () => { - const payload = { - id: this.#nextId++, method: "eth_chainId", params: [], jsonrpc: "2.0" - }; - this.emit("debug", { action: "sendRpcPayload", payload }); - let result; - try { - result = (await this._send(payload))[0]; - this.#pendingDetectNetwork = null; - } - catch (error) { - this.#pendingDetectNetwork = null; - this.emit("debug", { action: "receiveRpcError", error }); - throw error; - } - this.emit("debug", { action: "receiveRpcResult", result }); - if ("result" in result) { - return Network.from(getBigInt(result.result)); - } - throw this.getRpcError(payload, result); - })(); - return await this.#pendingDetectNetwork; - } - /** - * Sub-classes **MUST** call this. Until [[_start]] has been called, no calls - * will be passed to [[_send]] from [[send]]. If it is overridden, then - * ``super._start()`` **MUST** be called. - * - * Calling it multiple times is safe and has no effect. - */ - _start() { - if (this.#notReady == null || this.#notReady.resolve == null) { - return; - } - this.#notReady.resolve(); - this.#notReady = null; - (async () => { - // Bootstrap the network - while (this.#network == null && !this.destroyed) { - try { - this.#network = await this._detectNetwork(); - } - catch (error) { - if (this.destroyed) { - break; - } - console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"); - this.emit("error", makeError("failed to bootstrap network detection", "NETWORK_ERROR", { event: "initial-network-discovery", info: { error } })); - await stall$3(1000); - } - } - // Start dispatching requests - this.#scheduleDrain(); - })(); - } - /** - * Resolves once the [[_start]] has been called. This can be used in - * sub-classes to defer sending data until the connection has been - * established. - */ - async _waitUntilReady() { - if (this.#notReady == null) { - return; - } - return await this.#notReady.promise; - } - /** - * Return a Subscriber that will manage the %%sub%%. - * - * Sub-classes may override this to modify the behavior of - * subscription management. - */ - _getSubscriber(sub) { - // Pending Filters aren't availble via polling - if (sub.type === "pending") { - return new FilterIdPendingSubscriber(this); - } - if (sub.type === "event") { - if (this._getOption("polling")) { - return new PollingEventSubscriber(this, sub.filter); - } - return new FilterIdEventSubscriber(this, sub.filter); - } - // Orphaned Logs are handled automatically, by the filter, since - // logs with removed are emitted by it - if (sub.type === "orphan" && sub.filter.orphan === "drop-log") { - return new UnmanagedSubscriber("orphan"); - } - return super._getSubscriber(sub); - } - /** - * Returns true only if the [[_start]] has been called. - */ - get ready() { return this.#notReady == null; } - /** - * Returns %%tx%% as a normalized JSON-RPC transaction request, - * which has all values hexlified and any numeric values converted - * to Quantity values. - */ - getRpcTransaction(tx) { - const result = {}; - // JSON-RPC now requires numeric values to be "quantity" values - ["chainId", "gasLimit", "gasPrice", "type", "maxFeePerGas", "maxPriorityFeePerGas", "nonce", "value"].forEach((key) => { - if (tx[key] == null) { - return; - } - let dstKey = key; - if (key === "gasLimit") { - dstKey = "gas"; - } - result[dstKey] = toQuantity(getBigInt(tx[key], `tx.${key}`)); - }); - // Make sure addresses and data are lowercase - ["from", "to", "data"].forEach((key) => { - if (tx[key] == null) { - return; - } - result[key] = hexlify(tx[key]); - }); - // Normalize the access list object - if (tx.accessList) { - result["accessList"] = accessListify(tx.accessList); - } - if (tx.blobVersionedHashes) { - // @TODO: Remove this case once EIP-4844 added to prepared tx - result["blobVersionedHashes"] = tx.blobVersionedHashes.map(h => h.toLowerCase()); - } - if (tx.authorizationList) { - result["authorizationList"] = tx.authorizationList.map((_a) => { - const a = authorizationify(_a); - return { - address: a.address, - nonce: toQuantity(a.nonce), - chainId: toQuantity(a.chainId), - yParity: toQuantity(a.signature.yParity), - r: toQuantity(a.signature.r), - s: toQuantity(a.signature.s), - }; - }); - } - // @TODO: blobs should probably also be copied over, optionally - // accounting for the kzg property to backfill blobVersionedHashes - // using the commitment. Or should that be left as an exercise to - // the caller? - return result; - } - /** - * Returns the request method and arguments required to perform - * %%req%%. - */ - getRpcRequest(req) { - switch (req.method) { - case "chainId": - return { method: "eth_chainId", args: [] }; - case "getBlockNumber": - return { method: "eth_blockNumber", args: [] }; - case "getGasPrice": - return { method: "eth_gasPrice", args: [] }; - case "getPriorityFee": - return { method: "eth_maxPriorityFeePerGas", args: [] }; - case "getBalance": - return { - method: "eth_getBalance", - args: [getLowerCase(req.address), req.blockTag] - }; - case "getTransactionCount": - return { - method: "eth_getTransactionCount", - args: [getLowerCase(req.address), req.blockTag] - }; - case "getCode": - return { - method: "eth_getCode", - args: [getLowerCase(req.address), req.blockTag] - }; - case "getStorage": - return { - method: "eth_getStorageAt", - args: [ - getLowerCase(req.address), - ("0x" + req.position.toString(16)), - req.blockTag - ] - }; - case "broadcastTransaction": - return { - method: "eth_sendRawTransaction", - args: [req.signedTransaction] - }; - case "getBlock": - if ("blockTag" in req) { - return { - method: "eth_getBlockByNumber", - args: [req.blockTag, !!req.includeTransactions] - }; - } - else if ("blockHash" in req) { - return { - method: "eth_getBlockByHash", - args: [req.blockHash, !!req.includeTransactions] - }; - } - break; - case "getTransaction": - return { - method: "eth_getTransactionByHash", - args: [req.hash] - }; - case "getTransactionReceipt": - return { - method: "eth_getTransactionReceipt", - args: [req.hash] - }; - case "call": - return { - method: "eth_call", - args: [this.getRpcTransaction(req.transaction), req.blockTag] - }; - case "estimateGas": { - return { - method: "eth_estimateGas", - args: [this.getRpcTransaction(req.transaction)] - }; - } - case "getLogs": - if (req.filter && req.filter.address != null) { - if (Array.isArray(req.filter.address)) { - req.filter.address = req.filter.address.map(getLowerCase); - } - else { - req.filter.address = getLowerCase(req.filter.address); - } - } - return { method: "eth_getLogs", args: [req.filter] }; - } - return null; - } - /** - * Returns an ethers-style Error for the given JSON-RPC error - * %%payload%%, coalescing the various strings and error shapes - * that different nodes return, coercing them into a machine-readable - * standardized error. - */ - getRpcError(payload, _error) { - const { method } = payload; - const { error } = _error; - if (method === "eth_estimateGas" && error.message) { - const msg = error.message; - if (!msg.match(/revert/i) && msg.match(/insufficient funds/i)) { - return makeError("insufficient funds", "INSUFFICIENT_FUNDS", { - transaction: (payload.params[0]), - info: { payload, error } - }); - } - else if (msg.match(/nonce/i) && msg.match(/too low/i)) { - return makeError("nonce has already been used", "NONCE_EXPIRED", { - transaction: (payload.params[0]), - info: { payload, error } - }); - } - } - if (method === "eth_call" || method === "eth_estimateGas") { - const result = spelunkData(error); - const e = AbiCoder.getBuiltinCallException((method === "eth_call") ? "call" : "estimateGas", (payload.params[0]), (result ? result.data : null)); - e.info = { error, payload }; - return e; - } - // Only estimateGas and call can return arbitrary contract-defined text, so now we - // we can process text safely. - const message = JSON.stringify(spelunkMessage(error)); - if (typeof (error.message) === "string" && error.message.match(/user denied|ethers-user-denied/i)) { - const actionMap = { - eth_sign: "signMessage", - personal_sign: "signMessage", - eth_signTypedData_v4: "signTypedData", - eth_signTransaction: "signTransaction", - eth_sendTransaction: "sendTransaction", - eth_requestAccounts: "requestAccess", - wallet_requestAccounts: "requestAccess", - }; - return makeError(`user rejected action`, "ACTION_REJECTED", { - action: (actionMap[method] || "unknown"), - reason: "rejected", - info: { payload, error } - }); - } - if (method === "eth_sendRawTransaction" || method === "eth_sendTransaction") { - const transaction = (payload.params[0]); - if (message.match(/insufficient funds|base fee exceeds gas limit/i)) { - return makeError("insufficient funds for intrinsic transaction cost", "INSUFFICIENT_FUNDS", { - transaction, info: { error } - }); - } - if (message.match(/nonce/i) && message.match(/too low/i)) { - return makeError("nonce has already been used", "NONCE_EXPIRED", { transaction, info: { error } }); - } - // "replacement transaction underpriced" - if (message.match(/replacement transaction/i) && message.match(/underpriced/i)) { - return makeError("replacement fee too low", "REPLACEMENT_UNDERPRICED", { transaction, info: { error } }); - } - if (message.match(/only replay-protected/i)) { - return makeError("legacy pre-eip-155 transactions not supported", "UNSUPPORTED_OPERATION", { - operation: method, info: { transaction, info: { error } } - }); - } - } - let unsupported = !!message.match(/the method .* does not exist/i); - if (!unsupported) { - if (error && error.details && error.details.startsWith("Unauthorized method:")) { - unsupported = true; - } - } - if (unsupported) { - return makeError("unsupported operation", "UNSUPPORTED_OPERATION", { - operation: payload.method, info: { error, payload } - }); - } - return makeError("could not coalesce error", "UNKNOWN_ERROR", { error, payload }); - } - /** - * Requests the %%method%% with %%params%% via the JSON-RPC protocol - * over the underlying channel. This can be used to call methods - * on the backend that do not have a high-level API within the Provider - * API. - * - * This method queues requests according to the batch constraints - * in the options, assigns the request a unique ID. - * - * **Do NOT override** this method in sub-classes; instead - * override [[_send]] or force the options values in the - * call to the constructor to modify this method's behavior. - */ - send(method, params) { - // @TODO: cache chainId?? purge on switch_networks - // We have been destroyed; no operations are supported anymore - if (this.destroyed) { - return Promise.reject(makeError("provider destroyed; cancelled request", "UNSUPPORTED_OPERATION", { operation: method })); - } - const id = this.#nextId++; - const promise = new Promise((resolve, reject) => { - this.#payloads.push({ - resolve, reject, - payload: { method, params, id, jsonrpc: "2.0" } - }); - }); - // If there is not a pending drainTimer, set one - this.#scheduleDrain(); - return promise; - } - /** - * Resolves to the [[Signer]] account for %%address%% managed by - * the client. - * - * If the %%address%% is a number, it is used as an index in the - * the accounts from [[listAccounts]]. - * - * This can only be used on clients which manage accounts (such as - * Geth with imported account or MetaMask). - * - * Throws if the account doesn't exist. - */ - async getSigner(address) { - if (address == null) { - address = 0; - } - const accountsPromise = this.send("eth_accounts", []); - // Account index - if (typeof (address) === "number") { - const accounts = (await accountsPromise); - if (address >= accounts.length) { - throw new Error("no such account"); - } - return new JsonRpcSigner(this, accounts[address]); - } - const { accounts } = await resolveProperties({ - network: this.getNetwork(), - accounts: accountsPromise - }); - // Account address - address = getAddress(address); - for (const account of accounts) { - if (getAddress(account) === address) { - return new JsonRpcSigner(this, address); - } - } - throw new Error("invalid account"); - } - async listAccounts() { - const accounts = await this.send("eth_accounts", []); - return accounts.map((a) => new JsonRpcSigner(this, a)); - } - destroy() { - // Stop processing requests - if (this.#drainTimer) { - clearTimeout(this.#drainTimer); - this.#drainTimer = null; - } - // Cancel all pending requests - for (const { payload, reject } of this.#payloads) { - reject(makeError("provider destroyed; cancelled request", "UNSUPPORTED_OPERATION", { operation: payload.method })); - } - this.#payloads = []; - // Parent clean-up - super.destroy(); - } -} -// @TODO: remove this in v7, it is not exported because this functionality -// is exposed in the JsonRpcApiProvider by setting polling to true. It should -// be safe to remove regardless, because it isn't reachable, but just in case. -/** - * @_ignore: - */ -class JsonRpcApiPollingProvider extends JsonRpcApiProvider { - #pollingInterval; - constructor(network, options) { - super(network, options); - let pollingInterval = this._getOption("pollingInterval"); - if (pollingInterval == null) { - pollingInterval = defaultOptions.pollingInterval; - } - this.#pollingInterval = pollingInterval; - } - _getSubscriber(sub) { - const subscriber = super._getSubscriber(sub); - if (isPollable(subscriber)) { - subscriber.pollingInterval = this.#pollingInterval; - } - return subscriber; - } - /** - * The polling interval (default: 4000 ms) - */ - get pollingInterval() { return this.#pollingInterval; } - set pollingInterval(value) { - if (!Number.isInteger(value) || value < 0) { - throw new Error("invalid interval"); - } - this.#pollingInterval = value; - this._forEachSubscriber((sub) => { - if (isPollable(sub)) { - sub.pollingInterval = this.#pollingInterval; - } - }); - } -} -/** - * The JsonRpcProvider is one of the most common Providers, - * which performs all operations over HTTP (or HTTPS) requests. - * - * Events are processed by polling the backend for the current block - * number; when it advances, all block-base events are then checked - * for updates. - */ -class JsonRpcProvider extends JsonRpcApiPollingProvider { - #connect; - constructor(url, network, options) { - if (url == null) { - url = "http:/\/localhost:8545"; - } - super(network, options); - if (typeof (url) === "string") { - this.#connect = new FetchRequest(url); - } - else { - this.#connect = url.clone(); - } - } - _getConnection() { - return this.#connect.clone(); - } - async send(method, params) { - // All requests are over HTTP, so we can just start handling requests - // We do this here rather than the constructor so that we don't send any - // requests to the network (i.e. eth_chainId) until we absolutely have to. - await this._start(); - return await super.send(method, params); - } - async _send(payload) { - // Configure a POST connection for the requested method - const request = this._getConnection(); - request.body = JSON.stringify(payload); - request.setHeader("content-type", "application/json"); - const response = await request.send(); - response.assertOk(); - let resp = response.bodyJson; - if (!Array.isArray(resp)) { - resp = [resp]; - } - return resp; - } -} -function spelunkData(value) { - if (value == null) { - return null; - } - // These *are* the droids we're looking for. - if (typeof (value.message) === "string" && value.message.match(/revert/i) && isHexString(value.data)) { - return { message: value.message, data: value.data }; - } - // Spelunk further... - if (typeof (value) === "object") { - for (const key in value) { - const result = spelunkData(value[key]); - if (result) { - return result; - } - } - return null; - } - // Might be a JSON string we can further descend... - if (typeof (value) === "string") { - try { - return spelunkData(JSON.parse(value)); - } - catch (error) { } - } - return null; -} -function _spelunkMessage(value, result) { - if (value == null) { - return; - } - // These *are* the droids we're looking for. - if (typeof (value.message) === "string") { - result.push(value.message); - } - // Spelunk further... - if (typeof (value) === "object") { - for (const key in value) { - _spelunkMessage(value[key], result); - } - } - // Might be a JSON string we can further descend... - if (typeof (value) === "string") { - try { - return _spelunkMessage(JSON.parse(value), result); - } - catch (error) { } - } -} -function spelunkMessage(value) { - const result = []; - _spelunkMessage(value, result); - return result; -} - -/** - * [[link-ankr]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Arbitrum (``arbitrum``) - * - Base (``base``) - * - Base Goerlia Testnet (``base-goerli``) - * - Base Sepolia Testnet (``base-sepolia``) - * - BNB (``bnb``) - * - BNB Testnet (``bnbt``) - * - Filecoin (``filecoin``) - * - Filecoin Calibration Testnet (``filecoin-calibration``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Optimism Sepolia Testnet (``optimism-sepolia``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:Ankr [providers-ankr] - */ -const defaultApiKey$1 = "9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972"; -function getHost$5(name) { - switch (name) { - case "mainnet": - return "rpc.ankr.com/eth"; - case "goerli": - return "rpc.ankr.com/eth_goerli"; - case "sepolia": - return "rpc.ankr.com/eth_sepolia"; - case "arbitrum": - return "rpc.ankr.com/arbitrum"; - case "base": - return "rpc.ankr.com/base"; - case "base-goerli": - return "rpc.ankr.com/base_goerli"; - case "base-sepolia": - return "rpc.ankr.com/base_sepolia"; - case "bnb": - return "rpc.ankr.com/bsc"; - case "bnbt": - return "rpc.ankr.com/bsc_testnet_chapel"; - case "filecoin": - return "rpc.ankr.com/filecoin"; - case "filecoin-calibration": - return "rpc.ankr.com/filecoin_testnet"; - case "matic": - return "rpc.ankr.com/polygon"; - case "matic-mumbai": - return "rpc.ankr.com/polygon_mumbai"; - case "optimism": - return "rpc.ankr.com/optimism"; - case "optimism-goerli": - return "rpc.ankr.com/optimism_testnet"; - case "optimism-sepolia": - return "rpc.ankr.com/optimism_sepolia"; - } - assertArgument(false, "unsupported network", "network", name); -} -/** - * The **AnkrProvider** connects to the [[link-ankr]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-ankr-signup). - */ -class AnkrProvider extends JsonRpcProvider { - /** - * The API key for the Ankr connection. - */ - apiKey; - /** - * Create a new **AnkrProvider**. - * - * By default connecting to ``mainnet`` with a highly throttled - * API key. - */ - constructor(_network, apiKey) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (apiKey == null) { - apiKey = defaultApiKey$1; - } - // Ankr does not support filterId, so we force polling - const options = { polling: true, staticNetwork: network }; - const request = AnkrProvider.getRequest(network, apiKey); - super(request, network, options); - defineProperties(this, { apiKey }); - } - _getProvider(chainId) { - try { - return new AnkrProvider(chainId, this.apiKey); - } - catch (error) { } - return super._getProvider(chainId); - } - /** - * Returns a prepared request for connecting to %%network%% with - * %%apiKey%%. - */ - static getRequest(network, apiKey) { - if (apiKey == null) { - apiKey = defaultApiKey$1; - } - const request = new FetchRequest(`https:/\/${getHost$5(network.name)}/${apiKey}`); - request.allowGzip = true; - if (apiKey === defaultApiKey$1) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("AnkrProvider"); - return true; - }; - } - return request; - } - getRpcError(payload, error) { - if (payload.method === "eth_sendRawTransaction") { - if (error && error.error && error.error.message === "INTERNAL_ERROR: could not replace existing tx") { - error.error.message = "replacement transaction underpriced"; - } - } - return super.getRpcError(payload, error); - } - isCommunityResource() { - return (this.apiKey === defaultApiKey$1); - } -} - -/** - * [[link-alchemy]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Arbitrum Sepolia Testnet (``arbitrum-sepolia``) - * - Base (``base``) - * - Base Goerlia Testnet (``base-goerli``) - * - Base Sepolia Testnet (``base-sepolia``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Optimism Sepolia Testnet (``optimism-sepolia``) - * - Polygon (``matic``) - * - Polygon Amoy Testnet (``matic-amoy``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:Alchemy [providers-alchemy] - */ -const defaultApiKey = "_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC"; -function getHost$4(name) { - switch (name) { - case "mainnet": - return "eth-mainnet.g.alchemy.com"; - case "goerli": - return "eth-goerli.g.alchemy.com"; - case "sepolia": - return "eth-sepolia.g.alchemy.com"; - case "arbitrum": - return "arb-mainnet.g.alchemy.com"; - case "arbitrum-goerli": - return "arb-goerli.g.alchemy.com"; - case "arbitrum-sepolia": - return "arb-sepolia.g.alchemy.com"; - case "base": - return "base-mainnet.g.alchemy.com"; - case "base-goerli": - return "base-goerli.g.alchemy.com"; - case "base-sepolia": - return "base-sepolia.g.alchemy.com"; - case "matic": - return "polygon-mainnet.g.alchemy.com"; - case "matic-amoy": - return "polygon-amoy.g.alchemy.com"; - case "matic-mumbai": - return "polygon-mumbai.g.alchemy.com"; - case "optimism": - return "opt-mainnet.g.alchemy.com"; - case "optimism-goerli": - return "opt-goerli.g.alchemy.com"; - case "optimism-sepolia": - return "opt-sepolia.g.alchemy.com"; - } - assertArgument(false, "unsupported network", "network", name); -} -/** - * The **AlchemyProvider** connects to the [[link-alchemy]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-alchemy-signup). - * - * @_docloc: api/providers/thirdparty - */ -class AlchemyProvider extends JsonRpcProvider { - apiKey; - constructor(_network, apiKey) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (apiKey == null) { - apiKey = defaultApiKey; - } - const request = AlchemyProvider.getRequest(network, apiKey); - super(request, network, { staticNetwork: network }); - defineProperties(this, { apiKey }); - } - _getProvider(chainId) { - try { - return new AlchemyProvider(chainId, this.apiKey); - } - catch (error) { } - return super._getProvider(chainId); - } - async _perform(req) { - // https://docs.alchemy.com/reference/trace-transaction - if (req.method === "getTransactionResult") { - const { trace, tx } = await resolveProperties({ - trace: this.send("trace_transaction", [req.hash]), - tx: this.getTransaction(req.hash) - }); - if (trace == null || tx == null) { - return null; - } - let data; - let error = false; - try { - data = trace[0].result.output; - error = (trace[0].error === "Reverted"); - } - catch (error) { } - if (data) { - assert(!error, "an error occurred during transaction executions", "CALL_EXCEPTION", { - action: "getTransactionResult", - data, - reason: null, - transaction: tx, - invocation: null, - revert: null // @TODO - }); - return data; - } - assert(false, "could not parse trace result", "BAD_DATA", { value: trace }); - } - return await super._perform(req); - } - isCommunityResource() { - return (this.apiKey === defaultApiKey); - } - static getRequest(network, apiKey) { - if (apiKey == null) { - apiKey = defaultApiKey; - } - const request = new FetchRequest(`https:/\/${getHost$4(network.name)}/v2/${apiKey}`); - request.allowGzip = true; - if (apiKey === defaultApiKey) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("alchemy"); - return true; - }; - } - return request; - } -} - -/** - * [[link-chainstack]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Arbitrum (``arbitrum``) - * - BNB Smart Chain Mainnet (``bnb``) - * - Polygon (``matic``) - * - * @_subsection: api/providers/thirdparty:Chainstack [providers-chainstack] - */ -function getApiKey(name) { - switch (name) { - case "mainnet": return "39f1d67cedf8b7831010a665328c9197"; - case "arbitrum": return "0550c209db33c3abf4cc927e1e18cea1"; - case "bnb": return "98b5a77e531614387366f6fc5da097f8"; - case "matic": return "cd9d4d70377471aa7c142ec4a4205249"; - } - assertArgument(false, "unsupported network", "network", name); -} -function getHost$3(name) { - switch (name) { - case "mainnet": - return "ethereum-mainnet.core.chainstack.com"; - case "arbitrum": - return "arbitrum-mainnet.core.chainstack.com"; - case "bnb": - return "bsc-mainnet.core.chainstack.com"; - case "matic": - return "polygon-mainnet.core.chainstack.com"; - } - assertArgument(false, "unsupported network", "network", name); -} -/** - * The **ChainstackProvider** connects to the [[link-chainstack]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-chainstack). - */ -class ChainstackProvider extends JsonRpcProvider { - /** - * The API key for the Chainstack connection. - */ - apiKey; - /** - * Creates a new **ChainstackProvider**. - */ - constructor(_network, apiKey) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (apiKey == null) { - apiKey = getApiKey(network.name); - } - const request = ChainstackProvider.getRequest(network, apiKey); - super(request, network, { staticNetwork: network }); - defineProperties(this, { apiKey }); - } - _getProvider(chainId) { - try { - return new ChainstackProvider(chainId, this.apiKey); - } - catch (error) { } - return super._getProvider(chainId); - } - isCommunityResource() { - return (this.apiKey === getApiKey(this._network.name)); - } - /** - * Returns a prepared request for connecting to %%network%% - * with %%apiKey%% and %%projectSecret%%. - */ - static getRequest(network, apiKey) { - if (apiKey == null) { - apiKey = getApiKey(network.name); - } - const request = new FetchRequest(`https:/\/${getHost$3(network.name)}/${apiKey}`); - request.allowGzip = true; - if (apiKey === getApiKey(network.name)) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("ChainstackProvider"); - return true; - }; - } - return request; - } -} - -/** - * About Cloudflare - * - * @_subsection: api/providers/thirdparty:Cloudflare [providers-cloudflare] - */ -/** - * About Cloudflare... - */ -class CloudflareProvider extends JsonRpcProvider { - constructor(_network) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - assertArgument(network.name === "mainnet", "unsupported network", "network", _network); - super("https:/\/cloudflare-eth.com/", network, { staticNetwork: network }); - } -} - -/** - * [[link-etherscan]] provides a third-party service for connecting to - * various blockchains over a combination of JSON-RPC and custom API - * endpoints. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Holesky Testnet (``holesky``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Base (``base``) - * - Base Sepolia Testnet (``base-sepolia``) - * - BNB Smart Chain Mainnet (``bnb``) - * - BNB Smart Chain Testnet (``bnbt``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - Polygon Amoy Testnet (``matic-amoy``) - * - * @_subsection api/providers/thirdparty:Etherscan [providers-etherscan] - */ -// See: https://docs.etherscan.io/supported-chains -const Supported = ("1 11155111 17000 560048 2741 11124 33111 33139 42170 " + - "42161 421614 43114 43113 8453 84532 80069 80094 199 1029 81457 " + - "168587773 56 97 42220 11142220 252 2523 100 999 737373 747474 " + - "59144 59141 5000 5003 43521 143 10143 1287 1284 1285 10 " + - "11155420 204 5611 80002 137 534352 534351 1329 1328 146 14601 " + - "988 2201 1923 1924 167013 167000 130 1301 480 4801 51 50 324 300").split(/ /g); -const THROTTLE = 2000; -function isPromise(value) { - return (value && typeof (value.then) === "function"); -} -const EtherscanPluginId = "org.ethers.plugins.provider.Etherscan"; -/** - * A Network can include an **EtherscanPlugin** to provide - * a custom base URL. - * - * @_docloc: api/providers/thirdparty:Etherscan - */ -class EtherscanPlugin extends NetworkPlugin { - /** - * The Etherscan API base URL. - */ - baseUrl; - /** - * Creates a new **EtherscanProvider** which will use - * %%baseUrl%%. - */ - constructor(baseUrl) { - super(EtherscanPluginId); - defineProperties(this, { baseUrl }); - } - clone() { - return new EtherscanPlugin(this.baseUrl); - } -} -const skipKeys = ["enableCcipRead"]; -let nextId = 1; -/** - * The **EtherscanBaseProvider** is the super-class of - * [[EtherscanProvider]], which should generally be used instead. - * - * Since the **EtherscanProvider** includes additional code for - * [[Contract]] access, in //rare cases// that contracts are not - * used, this class can reduce code size. - * - * @_docloc: api/providers/thirdparty:Etherscan - */ -class EtherscanProvider extends AbstractProvider { - /** - * The connected network. - */ - network; - /** - * The API key or null if using the community provided bandwidth. - */ - apiKey; - #plugin; - /** - * Creates a new **EtherscanBaseProvider**. - */ - constructor(_network, _apiKey) { - const apiKey = (_apiKey != null) ? _apiKey : null; - super(); - const network = Network.from(_network); - assertArgument(Supported.indexOf(`${network.chainId}`) >= 0, "unsupported network", "network", network); - this.#plugin = network.getPlugin(EtherscanPluginId); - defineProperties(this, { apiKey, network }); - } - /** - * Returns the base URL. - * - * If an [[EtherscanPlugin]] is configured on the - * [[EtherscanBaseProvider_network]], returns the plugin's - * baseUrl. - * - * Deprecated; for Etherscan v2 the base is no longer a simply - * host, but instead a URL including a chainId parameter. Changing - * this to return a URL prefix could break some libraries, so it - * is left intact but will be removed in the future as it is unused. - */ - getBaseUrl() { - if (this.#plugin) { - return this.#plugin.baseUrl; - } - switch (this.network.name) { - case "mainnet": - return "https:/\/api.etherscan.io"; - case "goerli": - return "https:/\/api-goerli.etherscan.io"; - case "sepolia": - return "https:/\/api-sepolia.etherscan.io"; - case "holesky": - return "https:/\/api-holesky.etherscan.io"; - case "arbitrum": - return "https:/\/api.arbiscan.io"; - case "arbitrum-goerli": - return "https:/\/api-goerli.arbiscan.io"; - case "base": - return "https:/\/api.basescan.org"; - case "base-sepolia": - return "https:/\/api-sepolia.basescan.org"; - case "bnb": - return "https:/\/api.bscscan.com"; - case "bnbt": - return "https:/\/api-testnet.bscscan.com"; - case "matic": - return "https:/\/api.polygonscan.com"; - case "matic-amoy": - return "https:/\/api-amoy.polygonscan.com"; - case "matic-mumbai": - return "https:/\/api-testnet.polygonscan.com"; - case "optimism": - return "https:/\/api-optimistic.etherscan.io"; - case "optimism-goerli": - return "https:/\/api-goerli-optimistic.etherscan.io"; - } - assertArgument(false, "unsupported network", "network", this.network); - } - /** - * Returns the URL for the %%module%% and %%params%%. - */ - getUrl(module, params) { - let query = Object.keys(params).reduce((accum, key) => { - const value = params[key]; - if (value != null) { - accum += `&${key}=${value}`; - } - return accum; - }, ""); - if (this.apiKey) { - query += `&apikey=${this.apiKey}`; - } - return `https:/\/api.etherscan.io/v2/api?chainid=${this.network.chainId}&module=${module}${query}`; - } - /** - * Returns the URL for using POST requests. - */ - getPostUrl() { - return `https:/\/api.etherscan.io/v2/api?chainid=${this.network.chainId}`; - } - /** - * Returns the parameters for using POST requests. - */ - getPostData(module, params) { - params.module = module; - params.apikey = this.apiKey; - params.chainid = this.network.chainId; - return params; - } - async detectNetwork() { - return this.network; - } - /** - * Resolves to the result of calling %%module%% with %%params%%. - * - * If %%post%%, the request is made as a POST request. - */ - async fetch(module, params, post) { - const id = nextId++; - const url = (post ? this.getPostUrl() : this.getUrl(module, params)); - const payload = (post ? this.getPostData(module, params) : null); - this.emit("debug", { action: "sendRequest", id, url, payload: payload }); - const request = new FetchRequest(url); - request.setThrottleParams({ slotInterval: 1000 }); - request.retryFunc = (req, resp, attempt) => { - if (this.isCommunityResource()) { - showThrottleMessage("Etherscan"); - } - return Promise.resolve(true); - }; - request.processFunc = async (request, response) => { - const result = response.hasBody() ? JSON.parse(toUtf8String(response.body)) : {}; - const throttle = ((typeof (result.result) === "string") ? result.result : "").toLowerCase().indexOf("rate limit") >= 0; - if (module === "proxy") { - // This JSON response indicates we are being throttled - if (result && result.status == 0 && result.message == "NOTOK" && throttle) { - this.emit("debug", { action: "receiveError", id, reason: "proxy-NOTOK", error: result }); - response.throwThrottleError(result.result, THROTTLE); - } - } - else { - if (throttle) { - this.emit("debug", { action: "receiveError", id, reason: "null result", error: result.result }); - response.throwThrottleError(result.result, THROTTLE); - } - } - return response; - }; - if (payload) { - request.setHeader("content-type", "application/x-www-form-urlencoded; charset=UTF-8"); - request.body = Object.keys(payload).map((k) => `${k}=${payload[k]}`).join("&"); - } - const response = await request.send(); - try { - response.assertOk(); - } - catch (error) { - this.emit("debug", { action: "receiveError", id, error, reason: "assertOk" }); - assert(false, "response error", "SERVER_ERROR", { request, response }); - } - if (!response.hasBody()) { - this.emit("debug", { action: "receiveError", id, error: "missing body", reason: "null body" }); - assert(false, "missing response", "SERVER_ERROR", { request, response }); - } - const result = JSON.parse(toUtf8String(response.body)); - if (module === "proxy") { - if (result.jsonrpc != "2.0") { - this.emit("debug", { action: "receiveError", id, result, reason: "invalid JSON-RPC" }); - assert(false, "invalid JSON-RPC response (missing jsonrpc='2.0')", "SERVER_ERROR", { request, response, info: { result } }); - } - if (result.error) { - this.emit("debug", { action: "receiveError", id, result, reason: "JSON-RPC error" }); - assert(false, "error response", "SERVER_ERROR", { request, response, info: { result } }); - } - this.emit("debug", { action: "receiveRequest", id, result }); - return result.result; - } - else { - // getLogs, getHistory have weird success responses - if (result.status == 0 && (result.message === "No records found" || result.message === "No transactions found")) { - this.emit("debug", { action: "receiveRequest", id, result }); - return result.result; - } - if (result.status != 1 || (typeof (result.message) === "string" && !result.message.match(/^OK/))) { - this.emit("debug", { action: "receiveError", id, result }); - assert(false, "error response", "SERVER_ERROR", { request, response, info: { result } }); - } - this.emit("debug", { action: "receiveRequest", id, result }); - return result.result; - } - } - /** - * Returns %%transaction%% normalized for the Etherscan API. - */ - _getTransactionPostData(transaction) { - const result = {}; - for (let key in transaction) { - if (skipKeys.indexOf(key) >= 0) { - continue; - } - if (transaction[key] == null) { - continue; - } - let value = transaction[key]; - if (key === "type" && value === 0) { - continue; - } - if (key === "blockTag" && value === "latest") { - continue; - } - // Quantity-types require no leading zero, unless 0 - if ({ type: true, gasLimit: true, gasPrice: true, maxFeePerGs: true, maxPriorityFeePerGas: true, nonce: true, value: true }[key]) { - value = toQuantity(value); - } - else if (key === "accessList") { - value = "[" + accessListify(value).map((set) => { - return `{address:"${set.address}",storageKeys:["${set.storageKeys.join('","')}"]}`; - }).join(",") + "]"; - } - else if (key === "blobVersionedHashes") { - if (value.length === 0) { - continue; - } - // @TODO: update this once the API supports blobs - assert(false, "Etherscan API does not support blobVersionedHashes", "UNSUPPORTED_OPERATION", { - operation: "_getTransactionPostData", - info: { transaction } - }); - } - else { - value = hexlify(value); - } - result[key] = value; - } - return result; - } - /** - * Throws the normalized Etherscan error. - */ - _checkError(req, error, transaction) { - // Pull any message out if, possible - let message = ""; - if (isError(error, "SERVER_ERROR")) { - // Check for an error emitted by a proxy call - try { - message = error.info.result.error.message; - } - catch (e) { } - if (!message) { - try { - message = error.info.message; - } - catch (e) { } - } - } - if (req.method === "estimateGas") { - if (!message.match(/revert/i) && message.match(/insufficient funds/i)) { - assert(false, "insufficient funds", "INSUFFICIENT_FUNDS", { - transaction: req.transaction - }); - } - } - if (req.method === "call" || req.method === "estimateGas") { - if (message.match(/execution reverted/i)) { - let data = ""; - try { - data = error.info.result.error.data; - } - catch (error) { } - const e = AbiCoder.getBuiltinCallException(req.method, req.transaction, data); - e.info = { request: req, error }; - throw e; - } - } - if (message) { - if (req.method === "broadcastTransaction") { - const transaction = Transaction.from(req.signedTransaction); - if (message.match(/replacement/i) && message.match(/underpriced/i)) { - assert(false, "replacement fee too low", "REPLACEMENT_UNDERPRICED", { - transaction - }); - } - if (message.match(/insufficient funds/)) { - assert(false, "insufficient funds for intrinsic transaction cost", "INSUFFICIENT_FUNDS", { - transaction - }); - } - if (message.match(/same hash was already imported|transaction nonce is too low|nonce too low/)) { - assert(false, "nonce has already been used", "NONCE_EXPIRED", { - transaction - }); - } - } - } - // Something we could not process - throw error; - } - async _detectNetwork() { - return this.network; - } - async _perform(req) { - switch (req.method) { - case "chainId": - return this.network.chainId; - case "getBlockNumber": - return this.fetch("proxy", { action: "eth_blockNumber" }); - case "getGasPrice": - return this.fetch("proxy", { action: "eth_gasPrice" }); - case "getPriorityFee": - // This is temporary until Etherscan completes support - if (this.network.name === "mainnet") { - return "1000000000"; - } - else if (this.network.name === "optimism") { - return "1000000"; - } - else { - throw new Error("fallback onto the AbstractProvider default"); - } - /* Working with Etherscan to get this added: - try { - const test = await this.fetch("proxy", { - action: "eth_maxPriorityFeePerGas" - }); - console.log(test); - return test; - } catch (e) { - console.log("DEBUG", e); - throw e; - } - */ - /* This might be safe; but due to rounding neither myself - or Etherscan are necessarily comfortable with this. :) - try { - const result = await this.fetch("gastracker", { action: "gasoracle" }); - console.log(result); - const gasPrice = parseUnits(result.SafeGasPrice, "gwei"); - const baseFee = parseUnits(result.suggestBaseFee, "gwei"); - const priorityFee = gasPrice - baseFee; - if (priorityFee < 0) { throw new Error("negative priority fee; defer to abstract provider default"); } - return priorityFee; - } catch (error) { - console.log("DEBUG", error); - throw error; - } - */ - case "getBalance": - // Returns base-10 result - return this.fetch("account", { - action: "balance", - address: req.address, - tag: req.blockTag - }); - case "getTransactionCount": - return this.fetch("proxy", { - action: "eth_getTransactionCount", - address: req.address, - tag: req.blockTag - }); - case "getCode": - return this.fetch("proxy", { - action: "eth_getCode", - address: req.address, - tag: req.blockTag - }); - case "getStorage": - return this.fetch("proxy", { - action: "eth_getStorageAt", - address: req.address, - position: req.position, - tag: req.blockTag - }); - case "broadcastTransaction": - return this.fetch("proxy", { - action: "eth_sendRawTransaction", - hex: req.signedTransaction - }, true).catch((error) => { - return this._checkError(req, error, req.signedTransaction); - }); - case "getBlock": - if ("blockTag" in req) { - return this.fetch("proxy", { - action: "eth_getBlockByNumber", - tag: req.blockTag, - boolean: (req.includeTransactions ? "true" : "false") - }); - } - assert(false, "getBlock by blockHash not supported by Etherscan", "UNSUPPORTED_OPERATION", { - operation: "getBlock(blockHash)" - }); - case "getTransaction": - return this.fetch("proxy", { - action: "eth_getTransactionByHash", - txhash: req.hash - }); - case "getTransactionReceipt": - return this.fetch("proxy", { - action: "eth_getTransactionReceipt", - txhash: req.hash - }); - case "call": { - if (req.blockTag !== "latest") { - throw new Error("EtherscanProvider does not support blockTag for call"); - } - const postData = this._getTransactionPostData(req.transaction); - postData.module = "proxy"; - postData.action = "eth_call"; - try { - return await this.fetch("proxy", postData, true); - } - catch (error) { - return this._checkError(req, error, req.transaction); - } - } - case "estimateGas": { - const postData = this._getTransactionPostData(req.transaction); - postData.module = "proxy"; - postData.action = "eth_estimateGas"; - try { - return await this.fetch("proxy", postData, true); - } - catch (error) { - return this._checkError(req, error, req.transaction); - } - } - } - return super._perform(req); - } - async getNetwork() { - return this.network; - } - /** - * Resolves to the current price of ether. - * - * This returns ``0`` on any network other than ``mainnet``. - */ - async getEtherPrice() { - if (this.network.name !== "mainnet") { - return 0.0; - } - return parseFloat((await this.fetch("stats", { action: "ethprice" })).ethusd); - } - /** - * Resolves to a [Contract]] for %%address%%, using the - * Etherscan API to retreive the Contract ABI. - */ - async getContract(_address) { - let address = this._getAddress(_address); - if (isPromise(address)) { - address = await address; - } - try { - const resp = await this.fetch("contract", { - action: "getabi", address - }); - const abi = JSON.parse(resp); - return new Contract(address, abi, this); - } - catch (error) { - return null; - } - } - isCommunityResource() { - return (this.apiKey == null); - } -} - -function getGlobal() { - if (typeof self !== 'undefined') { - return self; - } - if (typeof window !== 'undefined') { - return window; - } - if (typeof global !== 'undefined') { - return global; - } - throw new Error('unable to locate global object'); -} -const _WebSocket = getGlobal().WebSocket; - -/** - * Generic long-lived socket provider. - * - * Sub-classing notes - * - a sub-class MUST call the `_start()` method once connected - * - a sub-class MUST override the `_write(string)` method - * - a sub-class MUST call `_processMessage(string)` for each message - * - * @_subsection: api/providers/abstract-provider:Socket Providers [about-socketProvider] - */ -/** - * A **SocketSubscriber** uses a socket transport to handle events and - * should use [[_emit]] to manage the events. - */ -class SocketSubscriber { - #provider; - #filter; - /** - * The filter. - */ - get filter() { return JSON.parse(this.#filter); } - #filterId; - #paused; - #emitPromise; - /** - * Creates a new **SocketSubscriber** attached to %%provider%% listening - * to %%filter%%. - */ - constructor(provider, filter) { - this.#provider = provider; - this.#filter = JSON.stringify(filter); - this.#filterId = null; - this.#paused = null; - this.#emitPromise = null; - } - start() { - this.#filterId = this.#provider.send("eth_subscribe", this.filter).then((filterId) => { - this.#provider._register(filterId, this); - return filterId; - }); - } - stop() { - (this.#filterId).then((filterId) => { - if (this.#provider.destroyed) { - return; - } - this.#provider.send("eth_unsubscribe", [filterId]); - }); - this.#filterId = null; - } - // @TODO: pause should trap the current blockNumber, unsub, and on resume use getLogs - // and resume - pause(dropWhilePaused) { - assert(dropWhilePaused, "preserve logs while paused not supported by SocketSubscriber yet", "UNSUPPORTED_OPERATION", { operation: "pause(false)" }); - this.#paused = !!dropWhilePaused; - } - resume() { - this.#paused = null; - } - /** - * @_ignore: - */ - _handleMessage(message) { - if (this.#filterId == null) { - return; - } - if (this.#paused === null) { - let emitPromise = this.#emitPromise; - if (emitPromise == null) { - emitPromise = this._emit(this.#provider, message); - } - else { - emitPromise = emitPromise.then(async () => { - await this._emit(this.#provider, message); - }); - } - this.#emitPromise = emitPromise.then(() => { - if (this.#emitPromise === emitPromise) { - this.#emitPromise = null; - } - }); - } - } - /** - * Sub-classes **must** override this to emit the events on the - * provider. - */ - async _emit(provider, message) { - throw new Error("sub-classes must implemente this; _emit"); - } -} -/** - * A **SocketBlockSubscriber** listens for ``newHeads`` events and emits - * ``"block"`` events. - */ -class SocketBlockSubscriber extends SocketSubscriber { - /** - * @_ignore: - */ - constructor(provider) { - super(provider, ["newHeads"]); - } - async _emit(provider, message) { - provider.emit("block", parseInt(message.number)); - } -} -/** - * A **SocketPendingSubscriber** listens for pending transacitons and emits - * ``"pending"`` events. - */ -class SocketPendingSubscriber extends SocketSubscriber { - /** - * @_ignore: - */ - constructor(provider) { - super(provider, ["newPendingTransactions"]); - } - async _emit(provider, message) { - provider.emit("pending", message); - } -} -/** - * A **SocketEventSubscriber** listens for event logs. - */ -class SocketEventSubscriber extends SocketSubscriber { - #logFilter; - /** - * The filter. - */ - get logFilter() { return JSON.parse(this.#logFilter); } - /** - * @_ignore: - */ - constructor(provider, filter) { - super(provider, ["logs", filter]); - this.#logFilter = JSON.stringify(filter); - } - async _emit(provider, message) { - provider.emit(this.logFilter, provider._wrapLog(message, provider._network)); - } -} -/** - * A **SocketProvider** is backed by a long-lived connection over a - * socket, which can subscribe and receive real-time messages over - * its communication channel. - */ -class SocketProvider extends JsonRpcApiProvider { - #callbacks; - // Maps each filterId to its subscriber - #subs; - // If any events come in before a subscriber has finished - // registering, queue them - #pending; - /** - * Creates a new **SocketProvider** connected to %%network%%. - * - * If unspecified, the network will be discovered. - */ - constructor(network, _options) { - // Copy the options - const options = Object.assign({}, (_options != null) ? _options : {}); - // Support for batches is generally not supported for - // connection-base providers; if this changes in the future - // the _send should be updated to reflect this - assertArgument(options.batchMaxCount == null || options.batchMaxCount === 1, "sockets-based providers do not support batches", "options.batchMaxCount", _options); - options.batchMaxCount = 1; - // Socket-based Providers (generally) cannot change their network, - // since they have a long-lived connection; but let people override - // this if they have just cause. - if (options.staticNetwork == null) { - options.staticNetwork = true; - } - super(network, options); - this.#callbacks = new Map(); - this.#subs = new Map(); - this.#pending = new Map(); - } - // This value is only valid after _start has been called - /* - get _network(): Network { - if (this.#network == null) { - throw new Error("this shouldn't happen"); - } - return this.#network.clone(); - } - */ - _getSubscriber(sub) { - switch (sub.type) { - case "close": - return new UnmanagedSubscriber("close"); - case "block": - return new SocketBlockSubscriber(this); - case "pending": - return new SocketPendingSubscriber(this); - case "event": - return new SocketEventSubscriber(this, sub.filter); - case "orphan": - // Handled auto-matically within AbstractProvider - // when the log.removed = true - if (sub.filter.orphan === "drop-log") { - return new UnmanagedSubscriber("drop-log"); - } - } - return super._getSubscriber(sub); - } - /** - * Register a new subscriber. This is used internalled by Subscribers - * and generally is unecessary unless extending capabilities. - */ - _register(filterId, subscriber) { - this.#subs.set(filterId, subscriber); - const pending = this.#pending.get(filterId); - if (pending) { - for (const message of pending) { - subscriber._handleMessage(message); - } - this.#pending.delete(filterId); - } - } - async _send(payload) { - // WebSocket provider doesn't accept batches - assertArgument(!Array.isArray(payload), "WebSocket does not support batch send", "payload", payload); - // @TODO: stringify payloads here and store to prevent mutations - // Prepare a promise to respond to - const promise = new Promise((resolve, reject) => { - this.#callbacks.set(payload.id, { payload, resolve, reject }); - }); - // Wait until the socket is connected before writing to it - await this._waitUntilReady(); - // Write the request to the socket - await this._write(JSON.stringify(payload)); - return [await promise]; - } - // Sub-classes must call this once they are connected - /* - async _start(): Promise { - if (this.#ready) { return; } - - for (const { payload } of this.#callbacks.values()) { - await this._write(JSON.stringify(payload)); - } - - this.#ready = (async function() { - await super._start(); - })(); - } - */ - /** - * Sub-classes **must** call this with messages received over their - * transport to be processed and dispatched. - */ - async _processMessage(message) { - const result = (JSON.parse(message)); - if (result && typeof (result) === "object" && "id" in result) { - const callback = this.#callbacks.get(result.id); - if (callback == null) { - this.emit("error", makeError("received result for unknown id", "UNKNOWN_ERROR", { - reasonCode: "UNKNOWN_ID", - result - })); - return; - } - this.#callbacks.delete(result.id); - callback.resolve(result); - } - else if (result && result.method === "eth_subscription") { - const filterId = result.params.subscription; - const subscriber = this.#subs.get(filterId); - if (subscriber) { - subscriber._handleMessage(result.params.result); - } - else { - let pending = this.#pending.get(filterId); - if (pending == null) { - pending = []; - this.#pending.set(filterId, pending); - } - pending.push(result.params.result); - } - } - else { - this.emit("error", makeError("received unexpected message", "UNKNOWN_ERROR", { - reasonCode: "UNEXPECTED_MESSAGE", - result - })); - return; - } - } - /** - * Sub-classes **must** override this to send %%message%% over their - * transport. - */ - async _write(message) { - throw new Error("sub-classes must override this"); - } -} - -/** - * A JSON-RPC provider which is backed by a WebSocket. - * - * WebSockets are often preferred because they retain a live connection - * to a server, which permits more instant access to events. - * - * However, this incurs higher server infrasturture costs, so additional - * resources may be required to host your own WebSocket nodes and many - * third-party services charge additional fees for WebSocket endpoints. - */ -class WebSocketProvider extends SocketProvider { - #connect; - #websocket; - get websocket() { - if (this.#websocket == null) { - throw new Error("websocket closed"); - } - return this.#websocket; - } - constructor(url, network, options) { - super(network, options); - if (typeof (url) === "string") { - this.#connect = () => { return new _WebSocket(url); }; - this.#websocket = this.#connect(); - } - else if (typeof (url) === "function") { - this.#connect = url; - this.#websocket = url(); - } - else { - this.#connect = null; - this.#websocket = url; - } - this.websocket.onopen = async () => { - try { - await this._start(); - this.resume(); - } - catch (error) { - console.log("failed to start WebsocketProvider", error); - // @TODO: now what? Attempt reconnect? - } - }; - this.websocket.onmessage = (message) => { - this._processMessage(message.data); - }; - /* - this.websocket.onclose = (event) => { - // @TODO: What event.code should we reconnect on? - const reconnect = false; - if (reconnect) { - this.pause(true); - if (this.#connect) { - this.#websocket = this.#connect(); - this.#websocket.onopen = ... - // @TODO: this requires the super class to rebroadcast; move it there - } - this._reconnect(); - } - }; - */ - } - async _write(message) { - this.websocket.send(message); - } - async destroy() { - if (this.#websocket != null) { - this.#websocket.close(); - this.#websocket = null; - } - super.destroy(); - } -} - -/** - * [[link-infura]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Arbitrum Sepolia Testnet (``arbitrum-sepolia``) - * - Base (``base``) - * - Base Goerlia Testnet (``base-goerli``) - * - Base Sepolia Testnet (``base-sepolia``) - * - BNB Smart Chain Mainnet (``bnb``) - * - BNB Smart Chain Testnet (``bnbt``) - * - Linea (``linea``) - * - Linea Goerli Testnet (``linea-goerli``) - * - Linea Sepolia Testnet (``linea-sepolia``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Optimism Sepolia Testnet (``optimism-sepolia``) - * - Polygon (``matic``) - * - Polygon Amoy Testnet (``matic-amoy``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:INFURA [providers-infura] - */ -const defaultProjectId = "84842078b09946638c03157f83405213"; -function getHost$2(name) { - switch (name) { - case "mainnet": - return "mainnet.infura.io"; - case "goerli": - return "goerli.infura.io"; - case "sepolia": - return "sepolia.infura.io"; - case "arbitrum": - return "arbitrum-mainnet.infura.io"; - case "arbitrum-goerli": - return "arbitrum-goerli.infura.io"; - case "arbitrum-sepolia": - return "arbitrum-sepolia.infura.io"; - case "base": - return "base-mainnet.infura.io"; - case "base-goerlia": // @TODO: Remove this typo in the future! - case "base-goerli": - return "base-goerli.infura.io"; - case "base-sepolia": - return "base-sepolia.infura.io"; - case "bnb": - return "bsc-mainnet.infura.io"; - case "bnbt": - return "bsc-testnet.infura.io"; - case "linea": - return "linea-mainnet.infura.io"; - case "linea-goerli": - return "linea-goerli.infura.io"; - case "linea-sepolia": - return "linea-sepolia.infura.io"; - case "matic": - return "polygon-mainnet.infura.io"; - case "matic-amoy": - return "polygon-amoy.infura.io"; - case "matic-mumbai": - return "polygon-mumbai.infura.io"; - case "optimism": - return "optimism-mainnet.infura.io"; - case "optimism-goerli": - return "optimism-goerli.infura.io"; - case "optimism-sepolia": - return "optimism-sepolia.infura.io"; - } - assertArgument(false, "unsupported network", "network", name); -} -/** - * The **InfuraWebSocketProvider** connects to the [[link-infura]] - * WebSocket end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-infura-signup). - */ -class InfuraWebSocketProvider extends WebSocketProvider { - /** - * The Project ID for the INFURA connection. - */ - projectId; - /** - * The Project Secret. - * - * If null, no authenticated requests are made. This should not - * be used outside of private contexts. - */ - projectSecret; - /** - * Creates a new **InfuraWebSocketProvider**. - */ - constructor(network, projectId) { - const provider = new InfuraProvider(network, projectId); - const req = provider._getConnection(); - assert(!req.credentials, "INFURA WebSocket project secrets unsupported", "UNSUPPORTED_OPERATION", { operation: "InfuraProvider.getWebSocketProvider()" }); - const url = req.url.replace(/^http/i, "ws").replace("/v3/", "/ws/v3/"); - super(url, provider._network); - defineProperties(this, { - projectId: provider.projectId, - projectSecret: provider.projectSecret - }); - } - isCommunityResource() { - return (this.projectId === defaultProjectId); - } -} -/** - * The **InfuraProvider** connects to the [[link-infura]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-infura-signup). - */ -class InfuraProvider extends JsonRpcProvider { - /** - * The Project ID for the INFURA connection. - */ - projectId; - /** - * The Project Secret. - * - * If null, no authenticated requests are made. This should not - * be used outside of private contexts. - */ - projectSecret; - /** - * Creates a new **InfuraProvider**. - */ - constructor(_network, projectId, projectSecret) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (projectId == null) { - projectId = defaultProjectId; - } - if (projectSecret == null) { - projectSecret = null; - } - const request = InfuraProvider.getRequest(network, projectId, projectSecret); - super(request, network, { staticNetwork: network }); - defineProperties(this, { projectId, projectSecret }); - } - _getProvider(chainId) { - try { - return new InfuraProvider(chainId, this.projectId, this.projectSecret); - } - catch (error) { } - return super._getProvider(chainId); - } - isCommunityResource() { - return (this.projectId === defaultProjectId); - } - /** - * Creates a new **InfuraWebSocketProvider**. - */ - static getWebSocketProvider(network, projectId) { - return new InfuraWebSocketProvider(network, projectId); - } - /** - * Returns a prepared request for connecting to %%network%% - * with %%projectId%% and %%projectSecret%%. - */ - static getRequest(network, projectId, projectSecret) { - if (projectId == null) { - projectId = defaultProjectId; - } - if (projectSecret == null) { - projectSecret = null; - } - const request = new FetchRequest(`https:/\/${getHost$2(network.name)}/v3/${projectId}`); - request.allowGzip = true; - if (projectSecret) { - request.setCredentials("", projectSecret); - } - if (projectId === defaultProjectId) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("InfuraProvider"); - return true; - }; - } - return request; - } -} - -/** - * [[link-quicknode]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Holesky Testnet (``holesky``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Arbitrum Sepolia Testnet (``arbitrum-sepolia``) - * - Base Mainnet (``base``); - * - Base Goerli Testnet (``base-goerli``); - * - Base Sepolia Testnet (``base-sepolia``); - * - BNB Smart Chain Mainnet (``bnb``) - * - BNB Smart Chain Testnet (``bnbt``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Optimism Sepolia Testnet (``optimism-sepolia``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:QuickNode [providers-quicknode] - */ -const defaultToken = "919b412a057b5e9c9b6dce193c5a60242d6efadb"; -function getHost$1(name) { - switch (name) { - case "mainnet": - return "ethers.quiknode.pro"; - case "goerli": - return "ethers.ethereum-goerli.quiknode.pro"; - case "sepolia": - return "ethers.ethereum-sepolia.quiknode.pro"; - case "holesky": - return "ethers.ethereum-holesky.quiknode.pro"; - case "arbitrum": - return "ethers.arbitrum-mainnet.quiknode.pro"; - case "arbitrum-goerli": - return "ethers.arbitrum-goerli.quiknode.pro"; - case "arbitrum-sepolia": - return "ethers.arbitrum-sepolia.quiknode.pro"; - case "base": - return "ethers.base-mainnet.quiknode.pro"; - case "base-goerli": - return "ethers.base-goerli.quiknode.pro"; - case "base-spolia": - return "ethers.base-sepolia.quiknode.pro"; - case "bnb": - return "ethers.bsc.quiknode.pro"; - case "bnbt": - return "ethers.bsc-testnet.quiknode.pro"; - case "matic": - return "ethers.matic.quiknode.pro"; - case "matic-mumbai": - return "ethers.matic-testnet.quiknode.pro"; - case "optimism": - return "ethers.optimism.quiknode.pro"; - case "optimism-goerli": - return "ethers.optimism-goerli.quiknode.pro"; - case "optimism-sepolia": - return "ethers.optimism-sepolia.quiknode.pro"; - case "xdai": - return "ethers.xdai.quiknode.pro"; - } - assertArgument(false, "unsupported network", "network", name); -} -/* -@TODO: - These networks are not currently present in the Network - default included networks. Research them and ensure they - are EVM compatible and work with ethers - - http://ethers.matic-amoy.quiknode.pro - - http://ethers.avalanche-mainnet.quiknode.pro - http://ethers.avalanche-testnet.quiknode.pro - http://ethers.blast-sepolia.quiknode.pro - http://ethers.celo-mainnet.quiknode.pro - http://ethers.fantom.quiknode.pro - http://ethers.imx-demo.quiknode.pro - http://ethers.imx-mainnet.quiknode.pro - http://ethers.imx-testnet.quiknode.pro - http://ethers.near-mainnet.quiknode.pro - http://ethers.near-testnet.quiknode.pro - http://ethers.nova-mainnet.quiknode.pro - http://ethers.scroll-mainnet.quiknode.pro - http://ethers.scroll-testnet.quiknode.pro - http://ethers.tron-mainnet.quiknode.pro - http://ethers.zkevm-mainnet.quiknode.pro - http://ethers.zkevm-testnet.quiknode.pro - http://ethers.zksync-mainnet.quiknode.pro - http://ethers.zksync-testnet.quiknode.pro -*/ -/** - * The **QuickNodeProvider** connects to the [[link-quicknode]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API token is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-quicknode). - */ -class QuickNodeProvider extends JsonRpcProvider { - /** - * The API token. - */ - token; - /** - * Creates a new **QuickNodeProvider**. - */ - constructor(_network, token) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (token == null) { - token = defaultToken; - } - const request = QuickNodeProvider.getRequest(network, token); - super(request, network, { staticNetwork: network }); - defineProperties(this, { token }); - } - _getProvider(chainId) { - try { - return new QuickNodeProvider(chainId, this.token); - } - catch (error) { } - return super._getProvider(chainId); - } - isCommunityResource() { - return (this.token === defaultToken); - } - /** - * Returns a new request prepared for %%network%% and the - * %%token%%. - */ - static getRequest(network, token) { - if (token == null) { - token = defaultToken; - } - const request = new FetchRequest(`https:/\/${getHost$1(network.name)}/${token}`); - request.allowGzip = true; - //if (projectSecret) { request.setCredentials("", projectSecret); } - if (token === defaultToken) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("QuickNodeProvider"); - return true; - }; - } - return request; - } -} - -/** - * A **FallbackProvider** provides resilience, security and performance - * in a way that is customizable and configurable. - * - * @_section: api/providers/fallback-provider:Fallback Provider [about-fallback-provider] - */ -const BN_1 = BigInt("1"); -const BN_2 = BigInt("2"); -function shuffle(array) { - for (let i = array.length - 1; i > 0; i--) { - const j = Math.floor(Math.random() * (i + 1)); - const tmp = array[i]; - array[i] = array[j]; - array[j] = tmp; - } -} -function stall$2(duration) { - return new Promise((resolve) => { setTimeout(resolve, duration); }); -} -function getTime() { return (new Date()).getTime(); } -function stringify(value) { - return JSON.stringify(value, (key, value) => { - if (typeof (value) === "bigint") { - return { type: "bigint", value: value.toString() }; - } - return value; - }); -} -const defaultConfig = { stallTimeout: 400, priority: 1, weight: 1 }; -const defaultState = { - blockNumber: -2, requests: 0, lateResponses: 0, errorResponses: 0, - outOfSync: -1, unsupportedEvents: 0, rollingDuration: 0, score: 0, - _network: null, _updateNumber: null, _totalTime: 0, - _lastFatalError: null, _lastFatalErrorTimestamp: 0 -}; -async function waitForSync(config, blockNumber) { - while (config.blockNumber < 0 || config.blockNumber < blockNumber) { - if (!config._updateNumber) { - config._updateNumber = (async () => { - try { - const blockNumber = await config.provider.getBlockNumber(); - if (blockNumber > config.blockNumber) { - config.blockNumber = blockNumber; - } - } - catch (error) { - config.blockNumber = -2; - config._lastFatalError = error; - config._lastFatalErrorTimestamp = getTime(); - } - config._updateNumber = null; - })(); - } - await config._updateNumber; - config.outOfSync++; - if (config._lastFatalError) { - break; - } - } -} -function _normalize(value) { - if (value == null) { - return "null"; - } - if (Array.isArray(value)) { - return "[" + (value.map(_normalize)).join(",") + "]"; - } - if (typeof (value) === "object" && typeof (value.toJSON) === "function") { - return _normalize(value.toJSON()); - } - switch (typeof (value)) { - case "boolean": - case "symbol": - return value.toString(); - case "bigint": - case "number": - return BigInt(value).toString(); - case "string": - return JSON.stringify(value); - case "object": { - const keys = Object.keys(value); - keys.sort(); - return "{" + keys.map((k) => `${JSON.stringify(k)}:${_normalize(value[k])}`).join(",") + "}"; - } - } - console.log("Could not serialize", value); - throw new Error("Hmm..."); -} -function normalizeResult(method, value) { - if ("error" in value) { - const error = value.error; - let tag; - if (isError(error, "CALL_EXCEPTION")) { - tag = _normalize(Object.assign({}, error, { - shortMessage: undefined, reason: undefined, info: undefined - })); - } - else { - tag = _normalize(error); - } - return { tag, value: error }; - } - const result = value.result; - return { tag: _normalize(result), value: result }; -} -// This strategy picks the highest weight result, as long as the weight is -// equal to or greater than quorum -function checkQuorum(quorum, results) { - const tally = new Map(); - for (const { value, tag, weight } of results) { - const t = tally.get(tag) || { value, weight: 0 }; - t.weight += weight; - tally.set(tag, t); - } - let best = null; - for (const r of tally.values()) { - if (r.weight >= quorum && (!best || r.weight > best.weight)) { - best = r; - } - } - if (best) { - return best.value; - } - return undefined; -} -function getMedian(quorum, results) { - let resultWeight = 0; - const errorMap = new Map(); - let bestError = null; - const values = []; - for (const { value, tag, weight } of results) { - if (value instanceof Error) { - const e = errorMap.get(tag) || { value, weight: 0 }; - e.weight += weight; - errorMap.set(tag, e); - if (bestError == null || e.weight > bestError.weight) { - bestError = e; - } - } - else { - values.push(BigInt(value)); - resultWeight += weight; - } - } - if (resultWeight < quorum) { - // We have quorum for an error - if (bestError && bestError.weight >= quorum) { - return bestError.value; - } - // We do not have quorum for a result - return undefined; - } - // Get the sorted values - values.sort((a, b) => ((a < b) ? -1 : (b > a) ? 1 : 0)); - const mid = Math.floor(values.length / 2); - // Odd-length; take the middle value - if (values.length % 2) { - return values[mid]; - } - // Even length; take the ceiling of the mean of the center two values - return (values[mid - 1] + values[mid] + BN_1) / BN_2; -} -function getAnyResult(quorum, results) { - // If any value or error meets quorum, that is our preferred result - const result = checkQuorum(quorum, results); - if (result !== undefined) { - return result; - } - // Otherwise, do we have any result? - for (const r of results) { - if (r.value) { - return r.value; - } - } - // Nope! - return undefined; -} -function getFuzzyMode(quorum, results) { - if (quorum === 1) { - return getNumber(getMedian(quorum, results), "%internal"); - } - const tally = new Map(); - const add = (result, weight) => { - const t = tally.get(result) || { result, weight: 0 }; - t.weight += weight; - tally.set(result, t); - }; - for (const { weight, value } of results) { - const r = getNumber(value); - add(r - 1, weight); - add(r, weight); - add(r + 1, weight); - } - let bestWeight = 0; - let bestResult = undefined; - for (const { weight, result } of tally.values()) { - // Use this result, if this result meets quorum and has either: - // - a better weight - // - or equal weight, but the result is larger - if (weight >= quorum && (weight > bestWeight || (bestResult != null && weight === bestWeight && result > bestResult))) { - bestWeight = weight; - bestResult = result; - } - } - return bestResult; -} -/** - * A **FallbackProvider** manages several [[Providers]] providing - * resilience by switching between slow or misbehaving nodes, security - * by requiring multiple backends to aggree and performance by allowing - * faster backends to respond earlier. - * - */ -class FallbackProvider extends AbstractProvider { - /** - * The number of backends that must agree on a value before it is - * accpeted. - */ - quorum; - /** - * @_ignore: - */ - eventQuorum; - /** - * @_ignore: - */ - eventWorkers; - #configs; - #height; - #initialSyncPromise; - /** - * Creates a new **FallbackProvider** with %%providers%% connected to - * %%network%%. - * - * If a [[Provider]] is included in %%providers%%, defaults are used - * for the configuration. - */ - constructor(providers, network, options) { - super(network, options); - this.#configs = providers.map((p) => { - if (p instanceof AbstractProvider) { - return Object.assign({ provider: p }, defaultConfig, defaultState); - } - else { - return Object.assign({}, defaultConfig, p, defaultState); - } - }); - this.#height = -2; - this.#initialSyncPromise = null; - if (options && options.quorum != null) { - this.quorum = options.quorum; - } - else { - this.quorum = Math.ceil(this.#configs.reduce((accum, config) => { - accum += config.weight; - return accum; - }, 0) / 2); - } - this.eventQuorum = 1; - this.eventWorkers = 1; - assertArgument(this.quorum <= this.#configs.reduce((a, c) => (a + c.weight), 0), "quorum exceed provider weight", "quorum", this.quorum); - } - get providerConfigs() { - return this.#configs.map((c) => { - const result = Object.assign({}, c); - for (const key in result) { - if (key[0] === "_") { - delete result[key]; - } - } - return result; - }); - } - async _detectNetwork() { - return Network.from(getBigInt(await this._perform({ method: "chainId" }))); - } - // @TODO: Add support to select providers to be the event subscriber - //_getSubscriber(sub: Subscription): Subscriber { - // throw new Error("@TODO"); - //} - /** - * Transforms a %%req%% into the correct method call on %%provider%%. - */ - async _translatePerform(provider, req) { - switch (req.method) { - case "broadcastTransaction": - return await provider.broadcastTransaction(req.signedTransaction); - case "call": - return await provider.call(Object.assign({}, req.transaction, { blockTag: req.blockTag })); - case "chainId": - return (await provider.getNetwork()).chainId; - case "estimateGas": - return await provider.estimateGas(req.transaction); - case "getBalance": - return await provider.getBalance(req.address, req.blockTag); - case "getBlock": { - const block = ("blockHash" in req) ? req.blockHash : req.blockTag; - return await provider.getBlock(block, req.includeTransactions); - } - case "getBlockNumber": - return await provider.getBlockNumber(); - case "getCode": - return await provider.getCode(req.address, req.blockTag); - case "getGasPrice": - return (await provider.getFeeData()).gasPrice; - case "getPriorityFee": - return (await provider.getFeeData()).maxPriorityFeePerGas; - case "getLogs": - return await provider.getLogs(req.filter); - case "getStorage": - return await provider.getStorage(req.address, req.position, req.blockTag); - case "getTransaction": - return await provider.getTransaction(req.hash); - case "getTransactionCount": - return await provider.getTransactionCount(req.address, req.blockTag); - case "getTransactionReceipt": - return await provider.getTransactionReceipt(req.hash); - case "getTransactionResult": - return await provider.getTransactionResult(req.hash); - } - } - // Grab the next (random) config that is not already part of - // the running set - #getNextConfig(running) { - // @TODO: Maybe do a check here to favour (heavily) providers that - // do not require waitForSync and disfavour providers that - // seem down-ish or are behaving slowly - const configs = Array.from(running).map((r) => r.config); - // Shuffle the states, sorted by priority - const allConfigs = this.#configs.slice(); - shuffle(allConfigs); - allConfigs.sort((a, b) => (a.priority - b.priority)); - for (const config of allConfigs) { - if (config._lastFatalError) { - continue; - } - if (configs.indexOf(config) === -1) { - return config; - } - } - return null; - } - // Adds a new runner (if available) to running. - #addRunner(running, req) { - const config = this.#getNextConfig(running); - // No runners available - if (config == null) { - return null; - } - // Create a new runner - const runner = { - config, result: null, didBump: false, - perform: null, staller: null - }; - const now = getTime(); - // Start performing this operation - runner.perform = (async () => { - try { - config.requests++; - const result = await this._translatePerform(config.provider, req); - runner.result = { result }; - } - catch (error) { - config.errorResponses++; - runner.result = { error }; - } - const dt = (getTime() - now); - config._totalTime += dt; - config.rollingDuration = 0.95 * config.rollingDuration + 0.05 * dt; - runner.perform = null; - })(); - // Start a staller; when this times out, it's time to force - // kicking off another runner because we are taking too long - runner.staller = (async () => { - await stall$2(config.stallTimeout); - runner.staller = null; - })(); - running.add(runner); - return runner; - } - // Initializes the blockNumber and network for each runner and - // blocks until initialized - async #initialSync() { - let initialSync = this.#initialSyncPromise; - if (!initialSync) { - const promises = []; - this.#configs.forEach((config) => { - promises.push((async () => { - await waitForSync(config, 0); - if (!config._lastFatalError) { - config._network = await config.provider.getNetwork(); - } - })()); - }); - this.#initialSyncPromise = initialSync = (async () => { - // Wait for all providers to have a block number and network - await Promise.all(promises); - // Check all the networks match - let chainId = null; - for (const config of this.#configs) { - if (config._lastFatalError) { - continue; - } - const network = (config._network); - if (chainId == null) { - chainId = network.chainId; - } - else if (network.chainId !== chainId) { - assert(false, "cannot mix providers on different networks", "UNSUPPORTED_OPERATION", { - operation: "new FallbackProvider" - }); - } - } - })(); - } - await initialSync; - } - async #checkQuorum(running, req) { - // Get all the result objects - const results = []; - for (const runner of running) { - if (runner.result != null) { - const { tag, value } = normalizeResult(req.method, runner.result); - results.push({ tag, value, weight: runner.config.weight }); - } - } - // Are there enough results to event meet quorum? - if (results.reduce((a, r) => (a + r.weight), 0) < this.quorum) { - return undefined; - } - switch (req.method) { - case "getBlockNumber": { - // We need to get the bootstrap block height - if (this.#height === -2) { - this.#height = Math.ceil(getNumber(getMedian(this.quorum, this.#configs.filter((c) => (!c._lastFatalError)).map((c) => ({ - value: c.blockNumber, - tag: getNumber(c.blockNumber).toString(), - weight: c.weight - }))))); - } - // Find the mode across all the providers, allowing for - // a little drift between block heights - const mode = getFuzzyMode(this.quorum, results); - if (mode === undefined) { - return undefined; - } - if (mode > this.#height) { - this.#height = mode; - } - return this.#height; - } - case "getGasPrice": - case "getPriorityFee": - case "estimateGas": - return getMedian(this.quorum, results); - case "getBlock": - // Pending blocks are in the mempool and already - // quite untrustworthy; just grab anything - if ("blockTag" in req && req.blockTag === "pending") { - return getAnyResult(this.quorum, results); - } - return checkQuorum(this.quorum, results); - case "call": - case "chainId": - case "getBalance": - case "getTransactionCount": - case "getCode": - case "getStorage": - case "getTransaction": - case "getTransactionReceipt": - case "getLogs": - return checkQuorum(this.quorum, results); - case "broadcastTransaction": - return getAnyResult(this.quorum, results); - } - assert(false, "unsupported method", "UNSUPPORTED_OPERATION", { - operation: `_perform(${stringify(req.method)})` - }); - } - async #waitForQuorum(running, req) { - if (running.size === 0) { - throw new Error("no runners?!"); - } - // Any promises that are interesting to watch for; an expired stall - // or a successful perform - const interesting = []; - let newRunners = 0; - for (const runner of running) { - // No responses, yet; keep an eye on it - if (runner.perform) { - interesting.push(runner.perform); - } - // Still stalling... - if (runner.staller) { - interesting.push(runner.staller); - continue; - } - // This runner has already triggered another runner - if (runner.didBump) { - continue; - } - // Got a response (result or error) or stalled; kick off another runner - runner.didBump = true; - newRunners++; - } - // Check if we have reached quorum on a result (or error) - const value = await this.#checkQuorum(running, req); - if (value !== undefined) { - if (value instanceof Error) { - throw value; - } - return value; - } - // Add any new runners, because a staller timed out or a result - // or error response came in. - for (let i = 0; i < newRunners; i++) { - this.#addRunner(running, req); - } - // All providers have returned, and we have no result - assert(interesting.length > 0, "quorum not met", "SERVER_ERROR", { - request: "%sub-requests", - info: { request: req, results: Array.from(running).map((r) => stringify(r.result)) } - }); - // Wait for someone to either complete its perform or stall out - await Promise.race(interesting); - // This is recursive, but at worst case the depth is 2x the - // number of providers (each has a perform and a staller) - return await this.#waitForQuorum(running, req); - } - async _perform(req) { - // Broadcasting a transaction is rare (ish) and already incurs - // a cost on the user, so spamming is safe-ish. Just send it to - // every backend. - if (req.method === "broadcastTransaction") { - // Once any broadcast provides a positive result, use it. No - // need to wait for anyone else - const results = this.#configs.map((c) => null); - const broadcasts = this.#configs.map(async ({ provider, weight }, index) => { - try { - const result = await provider._perform(req); - results[index] = Object.assign(normalizeResult(req.method, { result }), { weight }); - } - catch (error) { - results[index] = Object.assign(normalizeResult(req.method, { error }), { weight }); - } - }); - // As each promise finishes... - while (true) { - // Check for a valid broadcast result - const done = results.filter((r) => (r != null)); - for (const { value } of done) { - if (!(value instanceof Error)) { - return value; - } - } - // Check for a legit broadcast error (one which we cannot - // recover from; some nodes may return the following red - // herring events: - // - alredy seend (UNKNOWN_ERROR) - // - NONCE_EXPIRED - // - REPLACEMENT_UNDERPRICED - const result = checkQuorum(this.quorum, results.filter((r) => (r != null))); - if (isError(result, "INSUFFICIENT_FUNDS")) { - throw result; - } - // Kick off the next provider (if any) - const waiting = broadcasts.filter((b, i) => (results[i] == null)); - if (waiting.length === 0) { - break; - } - await Promise.race(waiting); - } - // Use standard quorum results; any result was returned above, - // so this will find any error that met quorum if any - const result = getAnyResult(this.quorum, results); - assert(result !== undefined, "problem multi-broadcasting", "SERVER_ERROR", { - request: "%sub-requests", - info: { request: req, results: results.map(stringify) } - }); - if (result instanceof Error) { - throw result; - } - return result; - } - await this.#initialSync(); - // Bootstrap enough runners to meet quorum - const running = new Set(); - let inflightQuorum = 0; - while (true) { - const runner = this.#addRunner(running, req); - if (runner == null) { - break; - } - inflightQuorum += runner.config.weight; - if (inflightQuorum >= this.quorum) { - break; - } - } - const result = await this.#waitForQuorum(running, req); - // Track requests sent to a provider that are still - // outstanding after quorum has been otherwise found - for (const runner of running) { - if (runner.perform && runner.result == null) { - runner.config.lateResponses++; - } - } - return result; - } - async destroy() { - for (const { provider } of this.#configs) { - provider.destroy(); - } - super.destroy(); - } -} - -function isWebSocketLike(value) { - return (value && typeof (value.send) === "function" && - typeof (value.close) === "function"); -} -const Testnets = "goerli kovan sepolia classicKotti optimism-goerli arbitrum-goerli matic-mumbai bnbt".split(" "); -/** - * Returns a default provider for %%network%%. - * - * If %%network%% is a [[WebSocketLike]] or string that begins with - * ``"ws:"`` or ``"wss:"``, a [[WebSocketProvider]] is returned backed - * by that WebSocket or URL. - * - * If %%network%% is a string that begins with ``"HTTP:"`` or ``"HTTPS:"``, - * a [[JsonRpcProvider]] is returned connected to that URL. - * - * Otherwise, a default provider is created backed by well-known public - * Web3 backends (such as [[link-infura]]) using community-provided API - * keys. - * - * The %%options%% allows specifying custom API keys per backend (setting - * an API key to ``"-"`` will omit that provider) and ``options.exclusive`` - * can be set to either a backend name or and array of backend names, which - * will whitelist **only** those backends. - * - * Current backend strings supported are: - * - ``"alchemy"`` - * - ``"ankr"`` - * - ``"cloudflare"`` - * - ``"chainstack"`` - * - ``"etherscan"`` - * - ``"infura"`` - * - ``"publicPolygon"`` - * - ``"quicknode"`` - * - * @example: - * // Connect to a local Geth node - * provider = getDefaultProvider("http://localhost:8545/"); - * - * // Connect to Ethereum mainnet with any current and future - * // third-party services available - * provider = getDefaultProvider("mainnet"); - * - * // Connect to Polygon, but only allow Etherscan and - * // INFURA and use "MY_API_KEY" in calls to Etherscan. - * provider = getDefaultProvider("matic", { - * etherscan: "MY_API_KEY", - * exclusive: [ "etherscan", "infura" ] - * }); - */ -function getDefaultProvider(network, options) { - if (options == null) { - options = {}; - } - const allowService = (name) => { - if (options[name] === "-") { - return false; - } - if (typeof (options.exclusive) === "string") { - return (name === options.exclusive); - } - if (Array.isArray(options.exclusive)) { - return (options.exclusive.indexOf(name) !== -1); - } - return true; - }; - if (typeof (network) === "string" && network.match(/^https?:/)) { - return new JsonRpcProvider(network); - } - if (typeof (network) === "string" && network.match(/^wss?:/) || isWebSocketLike(network)) { - return new WebSocketProvider(network); - } - // Get the network and name, if possible - let staticNetwork = null; - try { - staticNetwork = Network.from(network); - } - catch (error) { } - const providers = []; - if (allowService("publicPolygon") && staticNetwork) { - if (staticNetwork.name === "matic") { - providers.push(new JsonRpcProvider("https:/\/polygon-rpc.com/", staticNetwork, { staticNetwork })); - } - else if (staticNetwork.name === "matic-amoy") { - providers.push(new JsonRpcProvider("https:/\/rpc-amoy.polygon.technology/", staticNetwork, { staticNetwork })); - } - } - if (allowService("alchemy")) { - try { - providers.push(new AlchemyProvider(network, options.alchemy)); - } - catch (error) { } - } - if (allowService("ankr") && options.ankr != null) { - try { - providers.push(new AnkrProvider(network, options.ankr)); - } - catch (error) { } - } - /* Temporarily remove until custom error issue is fixed - if (allowService("blockscout")) { - try { - providers.push(new BlockscoutProvider(network, options.blockscout)); - } catch (error) { } - } - */ - if (allowService("chainstack")) { - try { - providers.push(new ChainstackProvider(network, options.chainstack)); - } - catch (error) { } - } - if (allowService("cloudflare")) { - try { - providers.push(new CloudflareProvider(network)); - } - catch (error) { } - } - if (allowService("etherscan")) { - try { - providers.push(new EtherscanProvider(network, options.etherscan)); - } - catch (error) { } - } - if (allowService("infura")) { - try { - let projectId = options.infura; - let projectSecret = undefined; - if (typeof (projectId) === "object") { - projectSecret = projectId.projectSecret; - projectId = projectId.projectId; - } - providers.push(new InfuraProvider(network, projectId, projectSecret)); - } - catch (error) { } - } - /* - if (options.pocket !== "-") { - try { - let appId = options.pocket; - let secretKey: undefined | string = undefined; - let loadBalancer: undefined | boolean = undefined; - if (typeof(appId) === "object") { - loadBalancer = !!appId.loadBalancer; - secretKey = appId.secretKey; - appId = appId.appId; - } - providers.push(new PocketProvider(network, appId, secretKey, loadBalancer)); - } catch (error) { console.log(error); } - } - */ - if (allowService("quicknode")) { - try { - let token = options.quicknode; - providers.push(new QuickNodeProvider(network, token)); - } - catch (error) { } - } - assert(providers.length, "unsupported default network", "UNSUPPORTED_OPERATION", { - operation: "getDefaultProvider" - }); - // No need for a FallbackProvider - if (providers.length === 1) { - return providers[0]; - } - // We use the floor because public third-party providers can be unreliable, - // so a low number of providers with a large quorum will fail too often - let quorum = Math.floor(providers.length / 2); - if (quorum > 2) { - quorum = 2; - } - // Testnets don't need as strong a security gaurantee and speed is - // more useful during testing - if (staticNetwork && Testnets.indexOf(staticNetwork.name) !== -1) { - quorum = 1; - } - // Provided override qorum takes priority - if (options && options.quorum) { - quorum = options.quorum; - } - return new FallbackProvider(providers, undefined, { quorum }); -} - -/** - * A **NonceManager** wraps another [[Signer]] and automatically manages - * the nonce, ensuring serialized and sequential nonces are used during - * transaction. - */ -class NonceManager extends AbstractSigner { - /** - * The Signer being managed. - */ - signer; - #noncePromise; - #delta; - /** - * Creates a new **NonceManager** to manage %%signer%%. - */ - constructor(signer) { - super(signer.provider); - defineProperties(this, { signer }); - this.#noncePromise = null; - this.#delta = 0; - } - async getAddress() { - return this.signer.getAddress(); - } - connect(provider) { - return new NonceManager(this.signer.connect(provider)); - } - async getNonce(blockTag) { - if (blockTag === "pending") { - if (this.#noncePromise == null) { - this.#noncePromise = super.getNonce("pending"); - } - const delta = this.#delta; - return (await this.#noncePromise) + delta; - } - return super.getNonce(blockTag); - } - /** - * Manually increment the nonce. This may be useful when managng - * offline transactions. - */ - increment() { - this.#delta++; - } - /** - * Resets the nonce, causing the **NonceManager** to reload the current - * nonce from the blockchain on the next transaction. - */ - reset() { - this.#delta = 0; - this.#noncePromise = null; - } - async sendTransaction(tx) { - const noncePromise = this.getNonce("pending"); - this.increment(); - tx = await this.signer.populateTransaction(tx); - tx.nonce = await noncePromise; - // @TODO: Maybe handle interesting/recoverable errors? - // Like don't increment if the tx was certainly not sent - return await this.signer.sendTransaction(tx); - } - signTransaction(tx) { - return this.signer.signTransaction(tx); - } - signMessage(message) { - return this.signer.signMessage(message); - } - signTypedData(domain, types, value) { - return this.signer.signTypedData(domain, types, value); - } -} - -/** - * A **BrowserProvider** is intended to wrap an injected provider which - * adheres to the [[link-eip-1193]] standard, which most (if not all) - * currently do. - */ -class BrowserProvider extends JsonRpcApiPollingProvider { - #request; - #providerInfo; - /** - * Connect to the %%ethereum%% provider, optionally forcing the - * %%network%%. - */ - constructor(ethereum, network, _options) { - // Copy the options - const options = Object.assign({}, ((_options != null) ? _options : {}), { batchMaxCount: 1 }); - assertArgument(ethereum && ethereum.request, "invalid EIP-1193 provider", "ethereum", ethereum); - super(network, options); - this.#providerInfo = null; - if (_options && _options.providerInfo) { - this.#providerInfo = _options.providerInfo; - } - this.#request = async (method, params) => { - const payload = { method, params }; - this.emit("debug", { action: "sendEip1193Request", payload }); - try { - const result = await ethereum.request(payload); - this.emit("debug", { action: "receiveEip1193Result", result }); - return result; - } - catch (e) { - const error = new Error(e.message); - error.code = e.code; - error.data = e.data; - error.payload = payload; - this.emit("debug", { action: "receiveEip1193Error", error }); - throw error; - } - }; - } - get providerInfo() { - return this.#providerInfo; - } - async send(method, params) { - await this._start(); - return await super.send(method, params); - } - async _send(payload) { - assertArgument(!Array.isArray(payload), "EIP-1193 does not support batch request", "payload", payload); - try { - const result = await this.#request(payload.method, payload.params || []); - return [{ id: payload.id, result }]; - } - catch (e) { - return [{ - id: payload.id, - error: { code: e.code, data: e.data, message: e.message } - }]; - } - } - getRpcError(payload, error) { - error = JSON.parse(JSON.stringify(error)); - // EIP-1193 gives us some machine-readable error codes, so rewrite - // them into Ethers standard errors. - switch (error.error.code || -1) { - case 4001: - error.error.message = `ethers-user-denied: ${error.error.message}`; - break; - case 4200: - error.error.message = `ethers-unsupported: ${error.error.message}`; - break; - } - return super.getRpcError(payload, error); - } - /** - * Resolves to ``true`` if the provider manages the %%address%%. - */ - async hasSigner(address) { - if (address == null) { - address = 0; - } - const accounts = await this.send("eth_accounts", []); - if (typeof (address) === "number") { - return (accounts.length > address); - } - address = address.toLowerCase(); - return accounts.filter((a) => (a.toLowerCase() === address)).length !== 0; - } - async getSigner(address) { - if (address == null) { - address = 0; - } - if (!(await this.hasSigner(address))) { - try { - await this.#request("eth_requestAccounts", []); - } - catch (error) { - const payload = error.payload; - throw this.getRpcError(payload, { id: payload.id, error }); - } - } - return await super.getSigner(address); - } - /** - * Discover and connect to a Provider in the Browser using the - * [[link-eip-6963]] discovery mechanism. If no providers are - * present, ``null`` is resolved. - */ - static async discover(options) { - if (options == null) { - options = {}; - } - if (options.provider) { - return new BrowserProvider(options.provider); - } - const context = options.window ? options.window : - (typeof (window) !== "undefined") ? window : null; - if (context == null) { - return null; - } - const anyProvider = options.anyProvider; - if (anyProvider && context.ethereum) { - return new BrowserProvider(context.ethereum); - } - if (!("addEventListener" in context && "dispatchEvent" in context - && "removeEventListener" in context)) { - return null; - } - const timeout = options.timeout ? options.timeout : 300; - if (timeout === 0) { - return null; - } - return await (new Promise((resolve, reject) => { - let found = []; - const addProvider = (event) => { - found.push(event.detail); - if (anyProvider) { - finalize(); - } - }; - const finalize = () => { - clearTimeout(timer); - if (found.length) { - // If filtering is provided: - if (options && options.filter) { - // Call filter, with a copies of found provider infos - const filtered = options.filter(found.map(i => Object.assign({}, (i.info)))); - if (filtered == null) { - // No provider selected - resolve(null); - } - else if (filtered instanceof BrowserProvider) { - // Custom provider created - resolve(filtered); - } - else { - // Find the matching provider - let match = null; - if (filtered.uuid) { - const matches = found.filter(f => (filtered.uuid === f.info.uuid)); - // @TODO: What should happen if multiple values - // for the same UUID? - match = matches[0]; - } - if (match) { - const { provider, info } = match; - resolve(new BrowserProvider(provider, undefined, { - providerInfo: info - })); - } - else { - reject(makeError("filter returned unknown info", "UNSUPPORTED_OPERATION", { - value: filtered - })); - } - } - } - else { - // Pick the first found provider - const { provider, info } = found[0]; - resolve(new BrowserProvider(provider, undefined, { - providerInfo: info - })); - } - } - else { - // Nothing found - resolve(null); - } - context.removeEventListener("eip6963:announceProvider", addProvider); - }; - const timer = setTimeout(() => { finalize(); }, timeout); - context.addEventListener("eip6963:announceProvider", addProvider); - context.dispatchEvent(new Event("eip6963:requestProvider")); - })); - } -} - -/** - * [[link-blockscout]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Sepolia Testnet (``sepolia``) - * - Holesky Testnet (``holesky``) - * - Ethereum Classic (``classic``) - * - Arbitrum (``arbitrum``) - * - Base (``base``) - * - Base Sepolia Testnet (``base-sepolia``) - * - Gnosis (``xdai``) - * - Optimism (``optimism``) - * - Optimism Sepolia Testnet (``optimism-sepolia``) - * - Polygon (``matic``) - * - * @_subsection: api/providers/thirdparty:Blockscout [providers-blockscout] - */ -function getUrl(name) { - switch (name) { - case "mainnet": - return "https:/\/eth.blockscout.com/api/eth-rpc"; - case "sepolia": - return "https:/\/eth-sepolia.blockscout.com/api/eth-rpc"; - case "holesky": - return "https:/\/eth-holesky.blockscout.com/api/eth-rpc"; - case "classic": - return "https:/\/etc.blockscout.com/api/eth-rpc"; - case "arbitrum": - return "https:/\/arbitrum.blockscout.com/api/eth-rpc"; - case "base": - return "https:/\/base.blockscout.com/api/eth-rpc"; - case "base-sepolia": - return "https:/\/base-sepolia.blockscout.com/api/eth-rpc"; - case "matic": - return "https:/\/polygon.blockscout.com/api/eth-rpc"; - case "optimism": - return "https:/\/optimism.blockscout.com/api/eth-rpc"; - case "optimism-sepolia": - return "https:/\/optimism-sepolia.blockscout.com/api/eth-rpc"; - case "xdai": - return "https:/\/gnosis.blockscout.com/api/eth-rpc"; - } - assertArgument(false, "unsupported network", "network", name); -} -/** - * The **BlockscoutProvider** connects to the [[link-blockscout]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-blockscout). - */ -class BlockscoutProvider extends JsonRpcProvider { - /** - * The API key. - */ - apiKey; - /** - * Creates a new **BlockscoutProvider**. - */ - constructor(_network, apiKey) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (apiKey == null) { - apiKey = null; - } - const request = BlockscoutProvider.getRequest(network); - super(request, network, { staticNetwork: network }); - defineProperties(this, { apiKey }); - } - _getProvider(chainId) { - try { - return new BlockscoutProvider(chainId, this.apiKey); - } - catch (error) { } - return super._getProvider(chainId); - } - isCommunityResource() { - return (this.apiKey === null); - } - getRpcRequest(req) { - // Blockscout enforces the TAG argument for estimateGas - const resp = super.getRpcRequest(req); - if (resp && resp.method === "eth_estimateGas" && resp.args.length == 1) { - resp.args = resp.args.slice(); - resp.args.push("latest"); - } - return resp; - } - getRpcError(payload, _error) { - const error = _error ? _error.error : null; - // Blockscout currently drops the VM result and replaces it with a - // human-readable string, so we need to make it machine-readable. - if (error && error.code === -32015 && !isHexString(error.data || "", true)) { - const panicCodes = { - "assert(false)": "01", - "arithmetic underflow or overflow": "11", - "division or modulo by zero": "12", - "out-of-bounds array access; popping on an empty array": "31", - "out-of-bounds access of an array or bytesN": "32" - }; - let panicCode = ""; - if (error.message === "VM execution error.") { - // eth_call passes this message - panicCode = panicCodes[error.data] || ""; - } - else if (panicCodes[error.message || ""]) { - panicCode = panicCodes[error.message || ""]; - } - if (panicCode) { - error.message += ` (reverted: ${error.data})`; - error.data = "0x4e487b7100000000000000000000000000000000000000000000000000000000000000" + panicCode; - } - } - else if (error && error.code === -32000) { - if (error.message === "wrong transaction nonce") { - error.message += " (nonce too low)"; - } - } - return super.getRpcError(payload, _error); - } - /** - * Returns a prepared request for connecting to %%network%% - * with %%apiKey%%. - */ - static getRequest(network) { - const request = new FetchRequest(getUrl(network.name)); - request.allowGzip = true; - return request; - } -} - -/** - * [[link-pocket]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Polygon (``matic``) - * - Arbitrum (``arbitrum``) - * - * @_subsection: api/providers/thirdparty:Pocket [providers-pocket] - */ -const defaultApplicationId = "62e1ad51b37b8e00394bda3b"; -function getHost(name) { - switch (name) { - case "mainnet": - return "eth-mainnet.gateway.pokt.network"; - case "goerli": - return "eth-goerli.gateway.pokt.network"; - case "matic": - return "poly-mainnet.gateway.pokt.network"; - case "matic-mumbai": - return "polygon-mumbai-rpc.gateway.pokt.network"; - } - assertArgument(false, "unsupported network", "network", name); -} -/** - * The **PocketProvider** connects to the [[link-pocket]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-pocket-signup). - */ -class PocketProvider extends JsonRpcProvider { - /** - * The Application ID for the Pocket connection. - */ - applicationId; - /** - * The Application Secret for making authenticated requests - * to the Pocket connection. - */ - applicationSecret; - /** - * Create a new **PocketProvider**. - * - * By default connecting to ``mainnet`` with a highly throttled - * API key. - */ - constructor(_network, applicationId, applicationSecret) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (applicationId == null) { - applicationId = defaultApplicationId; - } - if (applicationSecret == null) { - applicationSecret = null; - } - const options = { staticNetwork: network }; - const request = PocketProvider.getRequest(network, applicationId, applicationSecret); - super(request, network, options); - defineProperties(this, { applicationId, applicationSecret }); - } - _getProvider(chainId) { - try { - return new PocketProvider(chainId, this.applicationId, this.applicationSecret); - } - catch (error) { } - return super._getProvider(chainId); - } - /** - * Returns a prepared request for connecting to %%network%% with - * %%applicationId%%. - */ - static getRequest(network, applicationId, applicationSecret) { - if (applicationId == null) { - applicationId = defaultApplicationId; - } - const request = new FetchRequest(`https:/\/${getHost(network.name)}/v1/lb/${applicationId}`); - request.allowGzip = true; - if (applicationSecret) { - request.setCredentials("", applicationSecret); - } - if (applicationId === defaultApplicationId) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("PocketProvider"); - return true; - }; - } - return request; - } - isCommunityResource() { - return (this.applicationId === defaultApplicationId); - } -} - -const IpcSocketProvider = undefined; - -/** - * The **BaseWallet** is a stream-lined implementation of a - * [[Signer]] that operates with a private key. - * - * It is preferred to use the [[Wallet]] class, as it offers - * additional functionality and simplifies loading a variety - * of JSON formats, Mnemonic Phrases, etc. - * - * This class may be of use for those attempting to implement - * a minimal Signer. - */ -class BaseWallet extends AbstractSigner { - /** - * The wallet address. - */ - address; - #signingKey; - /** - * Creates a new BaseWallet for %%privateKey%%, optionally - * connected to %%provider%%. - * - * If %%provider%% is not specified, only offline methods can - * be used. - */ - constructor(privateKey, provider) { - super(provider); - assertArgument(privateKey && typeof (privateKey.sign) === "function", "invalid private key", "privateKey", "[ REDACTED ]"); - this.#signingKey = privateKey; - const address = computeAddress(this.signingKey.publicKey); - defineProperties(this, { address }); - } - // Store private values behind getters to reduce visibility - // in console.log - /** - * The [[SigningKey]] used for signing payloads. - */ - get signingKey() { return this.#signingKey; } - /** - * The private key for this wallet. - */ - get privateKey() { return this.signingKey.privateKey; } - async getAddress() { return this.address; } - connect(provider) { - return new BaseWallet(this.#signingKey, provider); - } - async signTransaction(tx) { - tx = copyRequest(tx); - // Replace any Addressable or ENS name with an address - const { to, from } = await resolveProperties({ - to: (tx.to ? resolveAddress(tx.to, this) : undefined), - from: (tx.from ? resolveAddress(tx.from, this) : undefined) - }); - if (to != null) { - tx.to = to; - } - if (from != null) { - tx.from = from; - } - if (tx.from != null) { - assertArgument(getAddress((tx.from)) === this.address, "transaction from address mismatch", "tx.from", tx.from); - delete tx.from; - } - // Build the transaction - const btx = Transaction.from(tx); - btx.signature = this.signingKey.sign(btx.unsignedHash); - return btx.serialized; - } - async signMessage(message) { - return this.signMessageSync(message); - } - // @TODO: Add a secialized signTx and signTyped sync that enforces - // all parameters are known? - /** - * Returns the signature for %%message%% signed with this wallet. - */ - signMessageSync(message) { - return this.signingKey.sign(hashMessage(message)).serialized; - } - /** - * Returns the Authorization for %%auth%%. - */ - authorizeSync(auth) { - assertArgument(typeof (auth.address) === "string", "invalid address for authorizeSync", "auth.address", auth); - const signature = this.signingKey.sign(hashAuthorization(auth)); - return Object.assign({}, { - address: getAddress(auth.address), - nonce: getBigInt(auth.nonce || 0), - chainId: getBigInt(auth.chainId || 0), - }, { signature }); - } - /** - * Resolves to the Authorization for %%auth%%. - */ - async authorize(auth) { - auth = Object.assign({}, auth, { - address: await resolveAddress(auth.address, this) - }); - return this.authorizeSync(await this.populateAuthorization(auth)); - } - async signTypedData(domain, types, value) { - // Populate any ENS names - const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (name) => { - // @TODO: this should use resolveName; addresses don't - // need a provider - assert(this.provider != null, "cannot resolve ENS names without a provider", "UNSUPPORTED_OPERATION", { - operation: "resolveName", - info: { name } - }); - const address = await this.provider.resolveName(name); - assert(address != null, "unconfigured ENS name", "UNCONFIGURED_NAME", { - value: name - }); - return address; - }); - return this.signingKey.sign(TypedDataEncoder.hash(populated.domain, types, populated.value)).serialized; - } -} - -const subsChrs = " !#$%&'()*+,-./<=>?@[]^_`{|}~"; -const Word = /^[a-z]*$/i; -function unfold(words, sep) { - let initial = 97; - return words.reduce((accum, word) => { - if (word === sep) { - initial++; - } - else if (word.match(Word)) { - accum.push(String.fromCharCode(initial) + word); - } - else { - initial = 97; - accum.push(word); - } - return accum; - }, []); -} -/** - * @_ignore - */ -function decode(data, subs) { - // Replace all the substitutions with their expanded form - for (let i = subsChrs.length - 1; i >= 0; i--) { - data = data.split(subsChrs[i]).join(subs.substring(2 * i, 2 * i + 2)); - } - // Get all tle clumps; each suffix, first-increment and second-increment - const clumps = []; - const leftover = data.replace(/(:|([0-9])|([A-Z][a-z]*))/g, (all, item, semi, word) => { - if (semi) { - for (let i = parseInt(semi); i >= 0; i--) { - clumps.push(";"); - } - } - else { - clumps.push(item.toLowerCase()); - } - return ""; - }); - /* c8 ignore start */ - if (leftover) { - throw new Error(`leftovers: ${JSON.stringify(leftover)}`); - } - /* c8 ignore stop */ - return unfold(unfold(clumps, ";"), ":"); -} -/** - * @_ignore - */ -function decodeOwl(data) { - assertArgument(data[0] === "0", "unsupported auwl data", "data", data); - return decode(data.substring(1 + 2 * subsChrs.length), data.substring(1, 1 + 2 * subsChrs.length)); -} - -/** - * A Wordlist represents a collection of language-specific - * words used to encode and devoce [[link-bip-39]] encoded data - * by mapping words to 11-bit values and vice versa. - */ -class Wordlist { - locale; - /** - * Creates a new Wordlist instance. - * - * Sub-classes MUST call this if they provide their own constructor, - * passing in the locale string of the language. - * - * Generally there is no need to create instances of a Wordlist, - * since each language-specific Wordlist creates an instance and - * there is no state kept internally, so they are safe to share. - */ - constructor(locale) { - defineProperties(this, { locale }); - } - /** - * Sub-classes may override this to provide a language-specific - * method for spliting %%phrase%% into individual words. - * - * By default, %%phrase%% is split using any sequences of - * white-space as defined by regular expressions (i.e. ``/\s+/``). - */ - split(phrase) { - return phrase.toLowerCase().split(/\s+/g); - } - /** - * Sub-classes may override this to provider a language-specific - * method for joining %%words%% into a phrase. - * - * By default, %%words%% are joined by a single space. - */ - join(words) { - return words.join(" "); - } -} - -// Use the encode-latin.js script to create the necessary -// data files to be consumed by this class -/** - * An OWL format Wordlist is an encoding method that exploits - * the general locality of alphabetically sorted words to - * achieve a simple but effective means of compression. - * - * This class is generally not useful to most developers as - * it is used mainly internally to keep Wordlists for languages - * based on ASCII-7 small. - * - * If necessary, there are tools within the ``generation/`` folder - * to create the necessary data. - */ -class WordlistOwl extends Wordlist { - #data; - #checksum; - /** - * Creates a new Wordlist for %%locale%% using the OWL %%data%% - * and validated against the %%checksum%%. - */ - constructor(locale, data, checksum) { - super(locale); - this.#data = data; - this.#checksum = checksum; - this.#words = null; - } - /** - * The OWL-encoded data. - */ - get _data() { return this.#data; } - /** - * Decode all the words for the wordlist. - */ - _decodeWords() { - return decodeOwl(this.#data); - } - #words; - #loadWords() { - if (this.#words == null) { - const words = this._decodeWords(); - // Verify the computed list matches the official list - const checksum = id(words.join("\n") + "\n"); - /* c8 ignore start */ - if (checksum !== this.#checksum) { - throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`); - } - /* c8 ignore stop */ - this.#words = words; - } - return this.#words; - } - getWord(index) { - const words = this.#loadWords(); - assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); - return words[index]; - } - getWordIndex(word) { - return this.#loadWords().indexOf(word); - } -} - -const words = "0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN_{Ad!AftAm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SkSs/ T^T i$ThTrixTt XimumZe3AdowAnAsu*AtCh<-D$DiaLodyLtMb M%yNt]NuRcyR+R.RryShSsa+T$Thod3Dd!DnightLk~]M-NdNimumN%Nu>Rac!Rr%S ySs/akeXXedXtu*5Bi!DelDifyMM|N.%NkeyN, N`OnR$ReRn(gSqu.oTh T]T%Unta(U'VeVie5ChFf(LeLtiplySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurEAyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOgAyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NNGradeHoldOnP Set1BOng::Rd3Ar~ow9UUngU`:3BraRo9NeO"; -const checksum = "0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"; -let wordlist = null; -/** - * The [[link-bip39-en]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -class LangEn extends WordlistOwl { - /** - * Creates a new instance of the English language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langEn]] should suffice. - * - * @_ignore: - */ - constructor() { super("en", words, checksum); } - /** - * Returns a singleton instance of a ``LangEn``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist == null) { - wordlist = new LangEn(); - } - return wordlist; - } -} - -// Returns a byte with the MSB bits set -function getUpperMask(bits) { - return ((1 << bits) - 1) << (8 - bits) & 0xff; -} -// Returns a byte with the LSB bits set -function getLowerMask(bits) { - return ((1 << bits) - 1) & 0xff; -} -function mnemonicToEntropy(mnemonic, wordlist) { - assertNormalize("NFKD"); - if (wordlist == null) { - wordlist = LangEn.wordlist(); - } - const words = wordlist.split(mnemonic); - assertArgument((words.length % 3) === 0 && words.length >= 12 && words.length <= 24, "invalid mnemonic length", "mnemonic", "[ REDACTED ]"); - const entropy = new Uint8Array(Math.ceil(11 * words.length / 8)); - let offset = 0; - for (let i = 0; i < words.length; i++) { - let index = wordlist.getWordIndex(words[i].normalize("NFKD")); - assertArgument(index >= 0, `invalid mnemonic word at index ${i}`, "mnemonic", "[ REDACTED ]"); - for (let bit = 0; bit < 11; bit++) { - if (index & (1 << (10 - bit))) { - entropy[offset >> 3] |= (1 << (7 - (offset % 8))); - } - offset++; - } - } - const entropyBits = 32 * words.length / 3; - const checksumBits = words.length / 3; - const checksumMask = getUpperMask(checksumBits); - const checksum = getBytes(sha256(entropy.slice(0, entropyBits / 8)))[0] & checksumMask; - assertArgument(checksum === (entropy[entropy.length - 1] & checksumMask), "invalid mnemonic checksum", "mnemonic", "[ REDACTED ]"); - return hexlify(entropy.slice(0, entropyBits / 8)); -} -function entropyToMnemonic(entropy, wordlist) { - assertArgument((entropy.length % 4) === 0 && entropy.length >= 16 && entropy.length <= 32, "invalid entropy size", "entropy", "[ REDACTED ]"); - if (wordlist == null) { - wordlist = LangEn.wordlist(); - } - const indices = [0]; - let remainingBits = 11; - for (let i = 0; i < entropy.length; i++) { - // Consume the whole byte (with still more to go) - if (remainingBits > 8) { - indices[indices.length - 1] <<= 8; - indices[indices.length - 1] |= entropy[i]; - remainingBits -= 8; - // This byte will complete an 11-bit index - } - else { - indices[indices.length - 1] <<= remainingBits; - indices[indices.length - 1] |= entropy[i] >> (8 - remainingBits); - // Start the next word - indices.push(entropy[i] & getLowerMask(8 - remainingBits)); - remainingBits += 3; - } - } - // Compute the checksum bits - const checksumBits = entropy.length / 4; - const checksum = parseInt(sha256(entropy).substring(2, 4), 16) & getUpperMask(checksumBits); - // Shift the checksum into the word indices - indices[indices.length - 1] <<= checksumBits; - indices[indices.length - 1] |= (checksum >> (8 - checksumBits)); - return wordlist.join(indices.map((index) => wordlist.getWord(index))); -} -const _guard$1 = {}; -/** - * A **Mnemonic** wraps all properties required to compute [[link-bip-39]] - * seeds and convert between phrases and entropy. - */ -class Mnemonic { - /** - * The mnemonic phrase of 12, 15, 18, 21 or 24 words. - * - * Use the [[wordlist]] ``split`` method to get the individual words. - */ - phrase; - /** - * The password used for this mnemonic. If no password is used this - * is the empty string (i.e. ``""``) as per the specification. - */ - password; - /** - * The wordlist for this mnemonic. - */ - wordlist; - /** - * The underlying entropy which the mnemonic encodes. - */ - entropy; - /** - * @private - */ - constructor(guard, entropy, phrase, password, wordlist) { - if (password == null) { - password = ""; - } - if (wordlist == null) { - wordlist = LangEn.wordlist(); - } - assertPrivate(guard, _guard$1, "Mnemonic"); - defineProperties(this, { phrase, password, wordlist, entropy }); - } - /** - * Returns the seed for the mnemonic. - */ - computeSeed() { - const salt = toUtf8Bytes("mnemonic" + this.password, "NFKD"); - return pbkdf2(toUtf8Bytes(this.phrase, "NFKD"), salt, 2048, 64, "sha512"); - } - /** - * Creates a new Mnemonic for the %%phrase%%. - * - * The default %%password%% is the empty string and the default - * wordlist is the [English wordlists](LangEn). - */ - static fromPhrase(phrase, password, wordlist) { - // Normalize the case and space; throws if invalid - const entropy = mnemonicToEntropy(phrase, wordlist); - phrase = entropyToMnemonic(getBytes(entropy), wordlist); - return new Mnemonic(_guard$1, entropy, phrase, password, wordlist); - } - /** - * Create a new **Mnemonic** from the %%entropy%%. - * - * The default %%password%% is the empty string and the default - * wordlist is the [English wordlists](LangEn). - */ - static fromEntropy(_entropy, password, wordlist) { - const entropy = getBytes(_entropy, "entropy"); - const phrase = entropyToMnemonic(entropy, wordlist); - return new Mnemonic(_guard$1, hexlify(entropy), phrase, password, wordlist); - } - /** - * Returns the phrase for %%mnemonic%%. - */ - static entropyToPhrase(_entropy, wordlist) { - const entropy = getBytes(_entropy, "entropy"); - return entropyToMnemonic(entropy, wordlist); - } - /** - * Returns the entropy for %%phrase%%. - */ - static phraseToEntropy(phrase, wordlist) { - return mnemonicToEntropy(phrase, wordlist); - } - /** - * Returns true if %%phrase%% is a valid [[link-bip-39]] phrase. - * - * This checks all the provided words belong to the %%wordlist%%, - * that the length is valid and the checksum is correct. - */ - static isValidMnemonic(phrase, wordlist) { - try { - mnemonicToEntropy(phrase, wordlist); - return true; - } - catch (error) { } - return false; - } -} - -/*! MIT License. Copyright 2015-2022 Richard Moore . See LICENSE.txt. */ -var __classPrivateFieldGet$2 = (__$G && __$G.__classPrivateFieldGet) || function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -}; -var __classPrivateFieldSet$2 = (__$G && __$G.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; -}; -var _AES_key, _AES_Kd, _AES_Ke; -// Number of rounds by keysize -const numberOfRounds = { 16: 10, 24: 12, 32: 14 }; -// Round constant words -const rcon = [0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91]; -// S-box and Inverse S-box (S is for Substitution) -const S = [0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0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 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d]; -// Transformations for encryption -const T1 = [0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d, 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554, 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d, 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a, 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87, 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b, 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea, 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b, 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a, 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f, 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108, 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f, 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e, 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5, 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d, 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f, 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e, 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb, 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce, 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497, 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c, 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed, 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b, 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a, 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16, 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594, 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81, 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3, 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a, 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504, 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163, 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d, 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f, 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739, 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47, 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395, 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f, 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883, 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c, 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76, 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e, 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4, 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6, 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b, 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7, 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0, 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25, 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818, 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72, 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651, 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21, 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85, 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa, 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12, 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0, 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9, 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133, 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7, 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920, 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a, 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17, 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8, 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11, 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a]; -const T2 = [0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b, 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5, 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b, 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676, 0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d, 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0, 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf, 0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0, 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626, 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc, 0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1, 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515, 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3, 0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a, 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2, 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575, 0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a, 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0, 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3, 0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484, 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded, 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b, 0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939, 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf, 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb, 0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585, 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f, 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8, 0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f, 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5, 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121, 0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2, 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec, 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717, 0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d, 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373, 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc, 0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888, 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414, 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb, 0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a, 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c, 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262, 0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979, 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d, 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9, 0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea, 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808, 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e, 0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6, 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f, 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a, 0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666, 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e, 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9, 0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e, 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111, 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494, 0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9, 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf, 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d, 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868, 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f, 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616]; -const T3 = [0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b, 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5, 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b, 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76, 0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d, 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0, 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af, 0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0, 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26, 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc, 0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1, 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15, 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3, 0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a, 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2, 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75, 0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a, 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0, 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3, 0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384, 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed, 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b, 0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239, 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf, 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb, 0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185, 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f, 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8, 0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f, 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5, 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221, 0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2, 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec, 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17, 0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d, 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673, 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc, 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88, 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814, 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb, 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a, 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c, 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462, 0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279, 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d, 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9, 0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea, 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008, 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e, 0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6, 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f, 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a, 0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66, 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e, 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9, 0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e, 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211, 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394, 0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9, 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df, 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d, 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068, 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f, 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16]; -const T4 = [0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6, 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491, 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56, 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec, 0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa, 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb, 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45, 0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b, 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c, 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83, 0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9, 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a, 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d, 0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f, 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf, 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea, 0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34, 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b, 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d, 0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713, 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1, 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6, 0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72, 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85, 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed, 0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411, 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe, 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b, 0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05, 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1, 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342, 0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf, 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3, 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e, 0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a, 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6, 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3, 0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b, 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28, 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad, 0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14, 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8, 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4, 0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2, 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da, 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049, 0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf, 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810, 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c, 0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197, 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e, 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f, 0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc, 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c, 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069, 0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927, 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322, 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733, 0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9, 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5, 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a, 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0, 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e, 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c]; -// Transformations for decryption -const T5 = [0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96, 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393, 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25, 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f, 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1, 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6, 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da, 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844, 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd, 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4, 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45, 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94, 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7, 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a, 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5, 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c, 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1, 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a, 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75, 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051, 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46, 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff, 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77, 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb, 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000, 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e, 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927, 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a, 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e, 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16, 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d, 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8, 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd, 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34, 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163, 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120, 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d, 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0, 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422, 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef, 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36, 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4, 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662, 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5, 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3, 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b, 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8, 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6, 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6, 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0, 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815, 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f, 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df, 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f, 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e, 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713, 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89, 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c, 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf, 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86, 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f, 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541, 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190, 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742]; -const T6 = [0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e, 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303, 0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c, 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3, 0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0, 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9, 0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259, 0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8, 0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971, 0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a, 0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f, 0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b, 0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8, 0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab, 0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708, 0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682, 0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2, 0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe, 0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb, 0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10, 0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd, 0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015, 0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e, 0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee, 0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000, 0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72, 0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39, 0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e, 0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91, 0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a, 0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17, 0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9, 0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60, 0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e, 0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1, 0xcad731dc, 0x10426385, 0x40139722, 0x2084c611, 0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1, 0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3, 0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964, 0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390, 0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b, 0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf, 0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46, 0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af, 0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512, 0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb, 0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a, 0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8, 0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c, 0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266, 0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8, 0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6, 0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604, 0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551, 0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41, 0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647, 0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c, 0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1, 0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737, 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db, 0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340, 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95, 0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1, 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857]; -const T7 = [0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27, 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3, 0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502, 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562, 0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe, 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3, 0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552, 0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9, 0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9, 0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce, 0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253, 0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908, 0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b, 0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655, 0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337, 0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16, 0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69, 0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6, 0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6, 0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e, 0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6, 0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050, 0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9, 0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8, 0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000, 0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a, 0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d, 0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436, 0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b, 0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12, 0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b, 0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e, 0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f, 0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb, 0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4, 0xdccad731, 0x85104263, 0x22401397, 0x112084c6, 0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729, 0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1, 0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9, 0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233, 0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4, 0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad, 0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e, 0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3, 0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25, 0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b, 0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f, 0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15, 0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0, 0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2, 0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7, 0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791, 0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496, 0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665, 0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b, 0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6, 0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13, 0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47, 0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7, 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844, 0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3, 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d, 0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456, 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8]; -const T8 = [0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a, 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b, 0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5, 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5, 0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d, 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b, 0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95, 0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e, 0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27, 0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d, 0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562, 0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9, 0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752, 0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66, 0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3, 0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced, 0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e, 0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4, 0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4, 0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd, 0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d, 0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60, 0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767, 0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79, 0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000, 0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c, 0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736, 0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24, 0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b, 0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c, 0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12, 0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814, 0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3, 0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b, 0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8, 0x31dccad7, 0x63851042, 0x97224013, 0xc6112084, 0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7, 0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077, 0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247, 0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22, 0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698, 0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f, 0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254, 0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582, 0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf, 0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb, 0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883, 0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef, 0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629, 0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035, 0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533, 0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17, 0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4, 0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46, 0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb, 0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d, 0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb, 0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a, 0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73, 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678, 0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2, 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff, 0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064, 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0]; -// Transformations for decryption key expansion -const U1 = [0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3]; -const U2 = [0x00000000, 0x0b0e090d, 0x161c121a, 0x1d121b17, 0x2c382434, 0x27362d39, 0x3a24362e, 0x312a3f23, 0x58704868, 0x537e4165, 0x4e6c5a72, 0x4562537f, 0x74486c5c, 0x7f466551, 0x62547e46, 0x695a774b, 0xb0e090d0, 0xbbee99dd, 0xa6fc82ca, 0xadf28bc7, 0x9cd8b4e4, 0x97d6bde9, 0x8ac4a6fe, 0x81caaff3, 0xe890d8b8, 0xe39ed1b5, 0xfe8ccaa2, 0xf582c3af, 0xc4a8fc8c, 0xcfa6f581, 0xd2b4ee96, 0xd9bae79b, 0x7bdb3bbb, 0x70d532b6, 0x6dc729a1, 0x66c920ac, 0x57e31f8f, 0x5ced1682, 0x41ff0d95, 0x4af10498, 0x23ab73d3, 0x28a57ade, 0x35b761c9, 0x3eb968c4, 0x0f9357e7, 0x049d5eea, 0x198f45fd, 0x12814cf0, 0xcb3bab6b, 0xc035a266, 0xdd27b971, 0xd629b07c, 0xe7038f5f, 0xec0d8652, 0xf11f9d45, 0xfa119448, 0x934be303, 0x9845ea0e, 0x8557f119, 0x8e59f814, 0xbf73c737, 0xb47dce3a, 0xa96fd52d, 0xa261dc20, 0xf6ad766d, 0xfda37f60, 0xe0b16477, 0xebbf6d7a, 0xda955259, 0xd19b5b54, 0xcc894043, 0xc787494e, 0xaedd3e05, 0xa5d33708, 0xb8c12c1f, 0xb3cf2512, 0x82e51a31, 0x89eb133c, 0x94f9082b, 0x9ff70126, 0x464de6bd, 0x4d43efb0, 0x5051f4a7, 0x5b5ffdaa, 0x6a75c289, 0x617bcb84, 0x7c69d093, 0x7767d99e, 0x1e3daed5, 0x1533a7d8, 0x0821bccf, 0x032fb5c2, 0x32058ae1, 0x390b83ec, 0x241998fb, 0x2f1791f6, 0x8d764dd6, 0x867844db, 0x9b6a5fcc, 0x906456c1, 0xa14e69e2, 0xaa4060ef, 0xb7527bf8, 0xbc5c72f5, 0xd50605be, 0xde080cb3, 0xc31a17a4, 0xc8141ea9, 0xf93e218a, 0xf2302887, 0xef223390, 0xe42c3a9d, 0x3d96dd06, 0x3698d40b, 0x2b8acf1c, 0x2084c611, 0x11aef932, 0x1aa0f03f, 0x07b2eb28, 0x0cbce225, 0x65e6956e, 0x6ee89c63, 0x73fa8774, 0x78f48e79, 0x49deb15a, 0x42d0b857, 0x5fc2a340, 0x54ccaa4d, 0xf741ecda, 0xfc4fe5d7, 0xe15dfec0, 0xea53f7cd, 0xdb79c8ee, 0xd077c1e3, 0xcd65daf4, 0xc66bd3f9, 0xaf31a4b2, 0xa43fadbf, 0xb92db6a8, 0xb223bfa5, 0x83098086, 0x8807898b, 0x9515929c, 0x9e1b9b91, 0x47a17c0a, 0x4caf7507, 0x51bd6e10, 0x5ab3671d, 0x6b99583e, 0x60975133, 0x7d854a24, 0x768b4329, 0x1fd13462, 0x14df3d6f, 0x09cd2678, 0x02c32f75, 0x33e91056, 0x38e7195b, 0x25f5024c, 0x2efb0b41, 0x8c9ad761, 0x8794de6c, 0x9a86c57b, 0x9188cc76, 0xa0a2f355, 0xabacfa58, 0xb6bee14f, 0xbdb0e842, 0xd4ea9f09, 0xdfe49604, 0xc2f68d13, 0xc9f8841e, 0xf8d2bb3d, 0xf3dcb230, 0xeecea927, 0xe5c0a02a, 0x3c7a47b1, 0x37744ebc, 0x2a6655ab, 0x21685ca6, 0x10426385, 0x1b4c6a88, 0x065e719f, 0x0d507892, 0x640a0fd9, 0x6f0406d4, 0x72161dc3, 0x791814ce, 0x48322bed, 0x433c22e0, 0x5e2e39f7, 0x552030fa, 0x01ec9ab7, 0x0ae293ba, 0x17f088ad, 0x1cfe81a0, 0x2dd4be83, 0x26dab78e, 0x3bc8ac99, 0x30c6a594, 0x599cd2df, 0x5292dbd2, 0x4f80c0c5, 0x448ec9c8, 0x75a4f6eb, 0x7eaaffe6, 0x63b8e4f1, 0x68b6edfc, 0xb10c0a67, 0xba02036a, 0xa710187d, 0xac1e1170, 0x9d342e53, 0x963a275e, 0x8b283c49, 0x80263544, 0xe97c420f, 0xe2724b02, 0xff605015, 0xf46e5918, 0xc544663b, 0xce4a6f36, 0xd3587421, 0xd8567d2c, 0x7a37a10c, 0x7139a801, 0x6c2bb316, 0x6725ba1b, 0x560f8538, 0x5d018c35, 0x40139722, 0x4b1d9e2f, 0x2247e964, 0x2949e069, 0x345bfb7e, 0x3f55f273, 0x0e7fcd50, 0x0571c45d, 0x1863df4a, 0x136dd647, 0xcad731dc, 0xc1d938d1, 0xdccb23c6, 0xd7c52acb, 0xe6ef15e8, 0xede11ce5, 0xf0f307f2, 0xfbfd0eff, 0x92a779b4, 0x99a970b9, 0x84bb6bae, 0x8fb562a3, 0xbe9f5d80, 0xb591548d, 0xa8834f9a, 0xa38d4697]; -const U3 = [0x00000000, 0x0d0b0e09, 0x1a161c12, 0x171d121b, 0x342c3824, 0x3927362d, 0x2e3a2436, 0x23312a3f, 0x68587048, 0x65537e41, 0x724e6c5a, 0x7f456253, 0x5c74486c, 0x517f4665, 0x4662547e, 0x4b695a77, 0xd0b0e090, 0xddbbee99, 0xcaa6fc82, 0xc7adf28b, 0xe49cd8b4, 0xe997d6bd, 0xfe8ac4a6, 0xf381caaf, 0xb8e890d8, 0xb5e39ed1, 0xa2fe8cca, 0xaff582c3, 0x8cc4a8fc, 0x81cfa6f5, 0x96d2b4ee, 0x9bd9bae7, 0xbb7bdb3b, 0xb670d532, 0xa16dc729, 0xac66c920, 0x8f57e31f, 0x825ced16, 0x9541ff0d, 0x984af104, 0xd323ab73, 0xde28a57a, 0xc935b761, 0xc43eb968, 0xe70f9357, 0xea049d5e, 0xfd198f45, 0xf012814c, 0x6bcb3bab, 0x66c035a2, 0x71dd27b9, 0x7cd629b0, 0x5fe7038f, 0x52ec0d86, 0x45f11f9d, 0x48fa1194, 0x03934be3, 0x0e9845ea, 0x198557f1, 0x148e59f8, 0x37bf73c7, 0x3ab47dce, 0x2da96fd5, 0x20a261dc, 0x6df6ad76, 0x60fda37f, 0x77e0b164, 0x7aebbf6d, 0x59da9552, 0x54d19b5b, 0x43cc8940, 0x4ec78749, 0x05aedd3e, 0x08a5d337, 0x1fb8c12c, 0x12b3cf25, 0x3182e51a, 0x3c89eb13, 0x2b94f908, 0x269ff701, 0xbd464de6, 0xb04d43ef, 0xa75051f4, 0xaa5b5ffd, 0x896a75c2, 0x84617bcb, 0x937c69d0, 0x9e7767d9, 0xd51e3dae, 0xd81533a7, 0xcf0821bc, 0xc2032fb5, 0xe132058a, 0xec390b83, 0xfb241998, 0xf62f1791, 0xd68d764d, 0xdb867844, 0xcc9b6a5f, 0xc1906456, 0xe2a14e69, 0xefaa4060, 0xf8b7527b, 0xf5bc5c72, 0xbed50605, 0xb3de080c, 0xa4c31a17, 0xa9c8141e, 0x8af93e21, 0x87f23028, 0x90ef2233, 0x9de42c3a, 0x063d96dd, 0x0b3698d4, 0x1c2b8acf, 0x112084c6, 0x3211aef9, 0x3f1aa0f0, 0x2807b2eb, 0x250cbce2, 0x6e65e695, 0x636ee89c, 0x7473fa87, 0x7978f48e, 0x5a49deb1, 0x5742d0b8, 0x405fc2a3, 0x4d54ccaa, 0xdaf741ec, 0xd7fc4fe5, 0xc0e15dfe, 0xcdea53f7, 0xeedb79c8, 0xe3d077c1, 0xf4cd65da, 0xf9c66bd3, 0xb2af31a4, 0xbfa43fad, 0xa8b92db6, 0xa5b223bf, 0x86830980, 0x8b880789, 0x9c951592, 0x919e1b9b, 0x0a47a17c, 0x074caf75, 0x1051bd6e, 0x1d5ab367, 0x3e6b9958, 0x33609751, 0x247d854a, 0x29768b43, 0x621fd134, 0x6f14df3d, 0x7809cd26, 0x7502c32f, 0x5633e910, 0x5b38e719, 0x4c25f502, 0x412efb0b, 0x618c9ad7, 0x6c8794de, 0x7b9a86c5, 0x769188cc, 0x55a0a2f3, 0x58abacfa, 0x4fb6bee1, 0x42bdb0e8, 0x09d4ea9f, 0x04dfe496, 0x13c2f68d, 0x1ec9f884, 0x3df8d2bb, 0x30f3dcb2, 0x27eecea9, 0x2ae5c0a0, 0xb13c7a47, 0xbc37744e, 0xab2a6655, 0xa621685c, 0x85104263, 0x881b4c6a, 0x9f065e71, 0x920d5078, 0xd9640a0f, 0xd46f0406, 0xc372161d, 0xce791814, 0xed48322b, 0xe0433c22, 0xf75e2e39, 0xfa552030, 0xb701ec9a, 0xba0ae293, 0xad17f088, 0xa01cfe81, 0x832dd4be, 0x8e26dab7, 0x993bc8ac, 0x9430c6a5, 0xdf599cd2, 0xd25292db, 0xc54f80c0, 0xc8448ec9, 0xeb75a4f6, 0xe67eaaff, 0xf163b8e4, 0xfc68b6ed, 0x67b10c0a, 0x6aba0203, 0x7da71018, 0x70ac1e11, 0x539d342e, 0x5e963a27, 0x498b283c, 0x44802635, 0x0fe97c42, 0x02e2724b, 0x15ff6050, 0x18f46e59, 0x3bc54466, 0x36ce4a6f, 0x21d35874, 0x2cd8567d, 0x0c7a37a1, 0x017139a8, 0x166c2bb3, 0x1b6725ba, 0x38560f85, 0x355d018c, 0x22401397, 0x2f4b1d9e, 0x642247e9, 0x692949e0, 0x7e345bfb, 0x733f55f2, 0x500e7fcd, 0x5d0571c4, 0x4a1863df, 0x47136dd6, 0xdccad731, 0xd1c1d938, 0xc6dccb23, 0xcbd7c52a, 0xe8e6ef15, 0xe5ede11c, 0xf2f0f307, 0xfffbfd0e, 0xb492a779, 0xb999a970, 0xae84bb6b, 0xa38fb562, 0x80be9f5d, 0x8db59154, 0x9aa8834f, 0x97a38d46]; -const U4 = [0x00000000, 0x090d0b0e, 0x121a161c, 0x1b171d12, 0x24342c38, 0x2d392736, 0x362e3a24, 0x3f23312a, 0x48685870, 0x4165537e, 0x5a724e6c, 0x537f4562, 0x6c5c7448, 0x65517f46, 0x7e466254, 0x774b695a, 0x90d0b0e0, 0x99ddbbee, 0x82caa6fc, 0x8bc7adf2, 0xb4e49cd8, 0xbde997d6, 0xa6fe8ac4, 0xaff381ca, 0xd8b8e890, 0xd1b5e39e, 0xcaa2fe8c, 0xc3aff582, 0xfc8cc4a8, 0xf581cfa6, 0xee96d2b4, 0xe79bd9ba, 0x3bbb7bdb, 0x32b670d5, 0x29a16dc7, 0x20ac66c9, 0x1f8f57e3, 0x16825ced, 0x0d9541ff, 0x04984af1, 0x73d323ab, 0x7ade28a5, 0x61c935b7, 0x68c43eb9, 0x57e70f93, 0x5eea049d, 0x45fd198f, 0x4cf01281, 0xab6bcb3b, 0xa266c035, 0xb971dd27, 0xb07cd629, 0x8f5fe703, 0x8652ec0d, 0x9d45f11f, 0x9448fa11, 0xe303934b, 0xea0e9845, 0xf1198557, 0xf8148e59, 0xc737bf73, 0xce3ab47d, 0xd52da96f, 0xdc20a261, 0x766df6ad, 0x7f60fda3, 0x6477e0b1, 0x6d7aebbf, 0x5259da95, 0x5b54d19b, 0x4043cc89, 0x494ec787, 0x3e05aedd, 0x3708a5d3, 0x2c1fb8c1, 0x2512b3cf, 0x1a3182e5, 0x133c89eb, 0x082b94f9, 0x01269ff7, 0xe6bd464d, 0xefb04d43, 0xf4a75051, 0xfdaa5b5f, 0xc2896a75, 0xcb84617b, 0xd0937c69, 0xd99e7767, 0xaed51e3d, 0xa7d81533, 0xbccf0821, 0xb5c2032f, 0x8ae13205, 0x83ec390b, 0x98fb2419, 0x91f62f17, 0x4dd68d76, 0x44db8678, 0x5fcc9b6a, 0x56c19064, 0x69e2a14e, 0x60efaa40, 0x7bf8b752, 0x72f5bc5c, 0x05bed506, 0x0cb3de08, 0x17a4c31a, 0x1ea9c814, 0x218af93e, 0x2887f230, 0x3390ef22, 0x3a9de42c, 0xdd063d96, 0xd40b3698, 0xcf1c2b8a, 0xc6112084, 0xf93211ae, 0xf03f1aa0, 0xeb2807b2, 0xe2250cbc, 0x956e65e6, 0x9c636ee8, 0x877473fa, 0x8e7978f4, 0xb15a49de, 0xb85742d0, 0xa3405fc2, 0xaa4d54cc, 0xecdaf741, 0xe5d7fc4f, 0xfec0e15d, 0xf7cdea53, 0xc8eedb79, 0xc1e3d077, 0xdaf4cd65, 0xd3f9c66b, 0xa4b2af31, 0xadbfa43f, 0xb6a8b92d, 0xbfa5b223, 0x80868309, 0x898b8807, 0x929c9515, 0x9b919e1b, 0x7c0a47a1, 0x75074caf, 0x6e1051bd, 0x671d5ab3, 0x583e6b99, 0x51336097, 0x4a247d85, 0x4329768b, 0x34621fd1, 0x3d6f14df, 0x267809cd, 0x2f7502c3, 0x105633e9, 0x195b38e7, 0x024c25f5, 0x0b412efb, 0xd7618c9a, 0xde6c8794, 0xc57b9a86, 0xcc769188, 0xf355a0a2, 0xfa58abac, 0xe14fb6be, 0xe842bdb0, 0x9f09d4ea, 0x9604dfe4, 0x8d13c2f6, 0x841ec9f8, 0xbb3df8d2, 0xb230f3dc, 0xa927eece, 0xa02ae5c0, 0x47b13c7a, 0x4ebc3774, 0x55ab2a66, 0x5ca62168, 0x63851042, 0x6a881b4c, 0x719f065e, 0x78920d50, 0x0fd9640a, 0x06d46f04, 0x1dc37216, 0x14ce7918, 0x2bed4832, 0x22e0433c, 0x39f75e2e, 0x30fa5520, 0x9ab701ec, 0x93ba0ae2, 0x88ad17f0, 0x81a01cfe, 0xbe832dd4, 0xb78e26da, 0xac993bc8, 0xa59430c6, 0xd2df599c, 0xdbd25292, 0xc0c54f80, 0xc9c8448e, 0xf6eb75a4, 0xffe67eaa, 0xe4f163b8, 0xedfc68b6, 0x0a67b10c, 0x036aba02, 0x187da710, 0x1170ac1e, 0x2e539d34, 0x275e963a, 0x3c498b28, 0x35448026, 0x420fe97c, 0x4b02e272, 0x5015ff60, 0x5918f46e, 0x663bc544, 0x6f36ce4a, 0x7421d358, 0x7d2cd856, 0xa10c7a37, 0xa8017139, 0xb3166c2b, 0xba1b6725, 0x8538560f, 0x8c355d01, 0x97224013, 0x9e2f4b1d, 0xe9642247, 0xe0692949, 0xfb7e345b, 0xf2733f55, 0xcd500e7f, 0xc45d0571, 0xdf4a1863, 0xd647136d, 0x31dccad7, 0x38d1c1d9, 0x23c6dccb, 0x2acbd7c5, 0x15e8e6ef, 0x1ce5ede1, 0x07f2f0f3, 0x0efffbfd, 0x79b492a7, 0x70b999a9, 0x6bae84bb, 0x62a38fb5, 0x5d80be9f, 0x548db591, 0x4f9aa883, 0x4697a38d]; -function convertToInt32(bytes) { - const result = []; - for (let i = 0; i < bytes.length; i += 4) { - result.push((bytes[i] << 24) | (bytes[i + 1] << 16) | (bytes[i + 2] << 8) | bytes[i + 3]); - } - return result; -} -class AES { - get key() { return __classPrivateFieldGet$2(this, _AES_key, "f").slice(); } - constructor(key) { - _AES_key.set(this, void 0); - _AES_Kd.set(this, void 0); - _AES_Ke.set(this, void 0); - if (!(this instanceof AES)) { - throw Error('AES must be instanitated with `new`'); - } - __classPrivateFieldSet$2(this, _AES_key, new Uint8Array(key), "f"); - const rounds = numberOfRounds[this.key.length]; - if (rounds == null) { - throw new TypeError('invalid key size (must be 16, 24 or 32 bytes)'); - } - // encryption round keys - __classPrivateFieldSet$2(this, _AES_Ke, [], "f"); - // decryption round keys - __classPrivateFieldSet$2(this, _AES_Kd, [], "f"); - for (let i = 0; i <= rounds; i++) { - __classPrivateFieldGet$2(this, _AES_Ke, "f").push([0, 0, 0, 0]); - __classPrivateFieldGet$2(this, _AES_Kd, "f").push([0, 0, 0, 0]); - } - const roundKeyCount = (rounds + 1) * 4; - const KC = this.key.length / 4; - // convert the key into ints - const tk = convertToInt32(this.key); - // copy values into round key arrays - let index; - for (let i = 0; i < KC; i++) { - index = i >> 2; - __classPrivateFieldGet$2(this, _AES_Ke, "f")[index][i % 4] = tk[i]; - __classPrivateFieldGet$2(this, _AES_Kd, "f")[rounds - index][i % 4] = tk[i]; - } - // key expansion (fips-197 section 5.2) - let rconpointer = 0; - let t = KC, tt; - while (t < roundKeyCount) { - tt = tk[KC - 1]; - tk[0] ^= ((S[(tt >> 16) & 0xFF] << 24) ^ - (S[(tt >> 8) & 0xFF] << 16) ^ - (S[tt & 0xFF] << 8) ^ - S[(tt >> 24) & 0xFF] ^ - (rcon[rconpointer] << 24)); - rconpointer += 1; - // key expansion (for non-256 bit) - if (KC != 8) { - for (let i = 1; i < KC; i++) { - tk[i] ^= tk[i - 1]; - } - // key expansion for 256-bit keys is "slightly different" (fips-197) - } - else { - for (let i = 1; i < (KC / 2); i++) { - tk[i] ^= tk[i - 1]; - } - tt = tk[(KC / 2) - 1]; - tk[KC / 2] ^= (S[tt & 0xFF] ^ - (S[(tt >> 8) & 0xFF] << 8) ^ - (S[(tt >> 16) & 0xFF] << 16) ^ - (S[(tt >> 24) & 0xFF] << 24)); - for (let i = (KC / 2) + 1; i < KC; i++) { - tk[i] ^= tk[i - 1]; - } - } - // copy values into round key arrays - let i = 0, r, c; - while (i < KC && t < roundKeyCount) { - r = t >> 2; - c = t % 4; - __classPrivateFieldGet$2(this, _AES_Ke, "f")[r][c] = tk[i]; - __classPrivateFieldGet$2(this, _AES_Kd, "f")[rounds - r][c] = tk[i++]; - t++; - } - } - // inverse-cipher-ify the decryption round key (fips-197 section 5.3) - for (let r = 1; r < rounds; r++) { - for (let c = 0; c < 4; c++) { - tt = __classPrivateFieldGet$2(this, _AES_Kd, "f")[r][c]; - __classPrivateFieldGet$2(this, _AES_Kd, "f")[r][c] = (U1[(tt >> 24) & 0xFF] ^ - U2[(tt >> 16) & 0xFF] ^ - U3[(tt >> 8) & 0xFF] ^ - U4[tt & 0xFF]); - } - } - } - encrypt(plaintext) { - if (plaintext.length != 16) { - throw new TypeError('invalid plaintext size (must be 16 bytes)'); - } - const rounds = __classPrivateFieldGet$2(this, _AES_Ke, "f").length - 1; - const a = [0, 0, 0, 0]; - // convert plaintext to (ints ^ key) - let t = convertToInt32(plaintext); - for (let i = 0; i < 4; i++) { - t[i] ^= __classPrivateFieldGet$2(this, _AES_Ke, "f")[0][i]; - } - // apply round transforms - for (let r = 1; r < rounds; r++) { - for (let i = 0; i < 4; i++) { - a[i] = (T1[(t[i] >> 24) & 0xff] ^ - T2[(t[(i + 1) % 4] >> 16) & 0xff] ^ - T3[(t[(i + 2) % 4] >> 8) & 0xff] ^ - T4[t[(i + 3) % 4] & 0xff] ^ - __classPrivateFieldGet$2(this, _AES_Ke, "f")[r][i]); - } - t = a.slice(); - } - // the last round is special - const result = new Uint8Array(16); - let tt = 0; - for (let i = 0; i < 4; i++) { - tt = __classPrivateFieldGet$2(this, _AES_Ke, "f")[rounds][i]; - result[4 * i] = (S[(t[i] >> 24) & 0xff] ^ (tt >> 24)) & 0xff; - result[4 * i + 1] = (S[(t[(i + 1) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff; - result[4 * i + 2] = (S[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff; - result[4 * i + 3] = (S[t[(i + 3) % 4] & 0xff] ^ tt) & 0xff; - } - return result; - } - decrypt(ciphertext) { - if (ciphertext.length != 16) { - throw new TypeError('invalid ciphertext size (must be 16 bytes)'); - } - const rounds = __classPrivateFieldGet$2(this, _AES_Kd, "f").length - 1; - const a = [0, 0, 0, 0]; - // convert plaintext to (ints ^ key) - let t = convertToInt32(ciphertext); - for (let i = 0; i < 4; i++) { - t[i] ^= __classPrivateFieldGet$2(this, _AES_Kd, "f")[0][i]; - } - // apply round transforms - for (let r = 1; r < rounds; r++) { - for (let i = 0; i < 4; i++) { - a[i] = (T5[(t[i] >> 24) & 0xff] ^ - T6[(t[(i + 3) % 4] >> 16) & 0xff] ^ - T7[(t[(i + 2) % 4] >> 8) & 0xff] ^ - T8[t[(i + 1) % 4] & 0xff] ^ - __classPrivateFieldGet$2(this, _AES_Kd, "f")[r][i]); - } - t = a.slice(); - } - // the last round is special - const result = new Uint8Array(16); - let tt = 0; - for (let i = 0; i < 4; i++) { - tt = __classPrivateFieldGet$2(this, _AES_Kd, "f")[rounds][i]; - result[4 * i] = (Si[(t[i] >> 24) & 0xff] ^ (tt >> 24)) & 0xff; - result[4 * i + 1] = (Si[(t[(i + 3) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff; - result[4 * i + 2] = (Si[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff; - result[4 * i + 3] = (Si[t[(i + 1) % 4] & 0xff] ^ tt) & 0xff; - } - return result; - } -} -_AES_key = new WeakMap(), _AES_Kd = new WeakMap(), _AES_Ke = new WeakMap(); - -class ModeOfOperation { - constructor(name, key, cls) { - if (cls && !(this instanceof cls)) { - throw new Error(`${name} must be instantiated with "new"`); - } - Object.defineProperties(this, { - aes: { enumerable: true, value: new AES(key) }, - name: { enumerable: true, value: name } - }); - } -} - -// Cipher Block Chaining -var __classPrivateFieldSet$1 = (__$G && __$G.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; -}; -var __classPrivateFieldGet$1 = (__$G && __$G.__classPrivateFieldGet) || function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -}; -var _CBC_iv, _CBC_lastBlock; -class CBC extends ModeOfOperation { - constructor(key, iv) { - super("ECC", key, CBC); - _CBC_iv.set(this, void 0); - _CBC_lastBlock.set(this, void 0); - if (iv) { - if (iv.length % 16) { - throw new TypeError("invalid iv size (must be 16 bytes)"); - } - __classPrivateFieldSet$1(this, _CBC_iv, new Uint8Array(iv), "f"); - } - else { - __classPrivateFieldSet$1(this, _CBC_iv, new Uint8Array(16), "f"); - } - __classPrivateFieldSet$1(this, _CBC_lastBlock, this.iv, "f"); - } - get iv() { return new Uint8Array(__classPrivateFieldGet$1(this, _CBC_iv, "f")); } - encrypt(plaintext) { - if (plaintext.length % 16) { - throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)"); - } - const ciphertext = new Uint8Array(plaintext.length); - for (let i = 0; i < plaintext.length; i += 16) { - for (let j = 0; j < 16; j++) { - __classPrivateFieldGet$1(this, _CBC_lastBlock, "f")[j] ^= plaintext[i + j]; - } - __classPrivateFieldSet$1(this, _CBC_lastBlock, this.aes.encrypt(__classPrivateFieldGet$1(this, _CBC_lastBlock, "f")), "f"); - ciphertext.set(__classPrivateFieldGet$1(this, _CBC_lastBlock, "f"), i); - } - return ciphertext; - } - decrypt(ciphertext) { - if (ciphertext.length % 16) { - throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)"); - } - const plaintext = new Uint8Array(ciphertext.length); - for (let i = 0; i < ciphertext.length; i += 16) { - const block = this.aes.decrypt(ciphertext.subarray(i, i + 16)); - for (let j = 0; j < 16; j++) { - plaintext[i + j] = block[j] ^ __classPrivateFieldGet$1(this, _CBC_lastBlock, "f")[j]; - __classPrivateFieldGet$1(this, _CBC_lastBlock, "f")[j] = ciphertext[i + j]; - } - } - return plaintext; - } -} -_CBC_iv = new WeakMap(), _CBC_lastBlock = new WeakMap(); - -// Counter Mode -var __classPrivateFieldSet = (__$G && __$G.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; -}; -var __classPrivateFieldGet = (__$G && __$G.__classPrivateFieldGet) || function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -}; -var _CTR_remaining, _CTR_remainingIndex, _CTR_counter; -class CTR extends ModeOfOperation { - constructor(key, initialValue) { - super("CTR", key, CTR); - // Remaining bytes for the one-time pad - _CTR_remaining.set(this, void 0); - _CTR_remainingIndex.set(this, void 0); - // The current counter - _CTR_counter.set(this, void 0); - __classPrivateFieldSet(this, _CTR_counter, new Uint8Array(16), "f"); - __classPrivateFieldGet(this, _CTR_counter, "f").fill(0); - __classPrivateFieldSet(this, _CTR_remaining, __classPrivateFieldGet(this, _CTR_counter, "f"), "f"); // This will be discarded immediately - __classPrivateFieldSet(this, _CTR_remainingIndex, 16, "f"); - if (initialValue == null) { - initialValue = 1; - } - if (typeof (initialValue) === "number") { - this.setCounterValue(initialValue); - } - else { - this.setCounterBytes(initialValue); - } - } - get counter() { return new Uint8Array(__classPrivateFieldGet(this, _CTR_counter, "f")); } - setCounterValue(value) { - if (!Number.isInteger(value) || value < 0 || value > Number.MAX_SAFE_INTEGER) { - throw new TypeError("invalid counter initial integer value"); - } - for (let index = 15; index >= 0; --index) { - __classPrivateFieldGet(this, _CTR_counter, "f")[index] = value % 256; - value = Math.floor(value / 256); - } - } - setCounterBytes(value) { - if (value.length !== 16) { - throw new TypeError("invalid counter initial Uint8Array value length"); - } - __classPrivateFieldGet(this, _CTR_counter, "f").set(value); - } - increment() { - for (let i = 15; i >= 0; i--) { - if (__classPrivateFieldGet(this, _CTR_counter, "f")[i] === 255) { - __classPrivateFieldGet(this, _CTR_counter, "f")[i] = 0; - } - else { - __classPrivateFieldGet(this, _CTR_counter, "f")[i]++; - break; - } - } - } - encrypt(plaintext) { - var _a, _b; - const crypttext = new Uint8Array(plaintext); - for (let i = 0; i < crypttext.length; i++) { - if (__classPrivateFieldGet(this, _CTR_remainingIndex, "f") === 16) { - __classPrivateFieldSet(this, _CTR_remaining, this.aes.encrypt(__classPrivateFieldGet(this, _CTR_counter, "f")), "f"); - __classPrivateFieldSet(this, _CTR_remainingIndex, 0, "f"); - this.increment(); - } - crypttext[i] ^= __classPrivateFieldGet(this, _CTR_remaining, "f")[__classPrivateFieldSet(this, _CTR_remainingIndex, (_b = __classPrivateFieldGet(this, _CTR_remainingIndex, "f"), _a = _b++, _b), "f"), _a]; - } - return crypttext; - } - decrypt(ciphertext) { - return this.encrypt(ciphertext); - } -} -_CTR_remaining = new WeakMap(), _CTR_remainingIndex = new WeakMap(), _CTR_counter = new WeakMap(); - -function pkcs7Strip(data) { - if (data.length < 16) { - throw new TypeError('PKCS#7 invalid length'); - } - const padder = data[data.length - 1]; - if (padder > 16) { - throw new TypeError('PKCS#7 padding byte out of range'); - } - const length = data.length - padder; - for (let i = 0; i < padder; i++) { - if (data[length + i] !== padder) { - throw new TypeError('PKCS#7 invalid padding byte'); - } - } - return new Uint8Array(data.subarray(0, length)); -} - -/** - * @_ignore - */ -function looseArrayify(hexString) { - if (typeof (hexString) === "string" && !hexString.startsWith("0x")) { - hexString = "0x" + hexString; - } - return getBytesCopy(hexString); -} -function zpad$1(value, length) { - value = String(value); - while (value.length < length) { - value = '0' + value; - } - return value; -} -function getPassword(password) { - if (typeof (password) === 'string') { - return toUtf8Bytes(password, "NFKC"); - } - return getBytesCopy(password); -} -function spelunk(object, _path) { - const match = _path.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i); - assertArgument(match != null, "invalid path", "path", _path); - const path = match[1]; - const type = match[3]; - const reqd = (match[4] === "!"); - let cur = object; - for (const comp of path.toLowerCase().split('.')) { - // Search for a child object with a case-insensitive matching key - if (Array.isArray(cur)) { - if (!comp.match(/^[0-9]+$/)) { - break; - } - cur = cur[parseInt(comp)]; - } - else if (typeof (cur) === "object") { - let found = null; - for (const key in cur) { - if (key.toLowerCase() === comp) { - found = cur[key]; - break; - } - } - cur = found; - } - else { - cur = null; - } - if (cur == null) { - break; - } - } - assertArgument(!reqd || cur != null, "missing required value", "path", path); - if (type && cur != null) { - if (type === "int") { - if (typeof (cur) === "string" && cur.match(/^-?[0-9]+$/)) { - return parseInt(cur); - } - else if (Number.isSafeInteger(cur)) { - return cur; - } - } - if (type === "number") { - if (typeof (cur) === "string" && cur.match(/^-?[0-9.]*$/)) { - return parseFloat(cur); - } - } - if (type === "data") { - if (typeof (cur) === "string") { - return looseArrayify(cur); - } - } - if (type === "array" && Array.isArray(cur)) { - return cur; - } - if (type === typeof (cur)) { - return cur; - } - assertArgument(false, `wrong type found for ${type} `, "path", path); - } - return cur; -} -/* -export function follow(object: any, path: string): null | string { - let currentChild = object; - - for (const comp of path.toLowerCase().split('/')) { - - // Search for a child object with a case-insensitive matching key - let matchingChild = null; - for (const key in currentChild) { - if (key.toLowerCase() === comp) { - matchingChild = currentChild[key]; - break; - } - } - - if (matchingChild === null) { return null; } - - currentChild = matchingChild; - } - - return currentChild; -} - -// "path/to/something:type!" -export function followRequired(data: any, path: string): string { - const value = follow(data, path); - if (value != null) { return value; } - return logger.throwArgumentError("invalid value", `data:${ path }`, - JSON.stringify(data)); -} -*/ -// See: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4) -/* -export function uuidV4(randomBytes: BytesLike): string { - const bytes = getBytes(randomBytes, "randomBytes"); - - // Section: 4.1.3: - // - time_hi_and_version[12:16] = 0b0100 - bytes[6] = (bytes[6] & 0x0f) | 0x40; - - // Section 4.4 - // - clock_seq_hi_and_reserved[6] = 0b0 - // - clock_seq_hi_and_reserved[7] = 0b1 - bytes[8] = (bytes[8] & 0x3f) | 0x80; - - const value = hexlify(bytes); - - return [ - value.substring(2, 10), - value.substring(10, 14), - value.substring(14, 18), - value.substring(18, 22), - value.substring(22, 34), - ].join("-"); -} -*/ - -/** - * The JSON Wallet formats allow a simple way to store the private - * keys needed in Ethereum along with related information and allows - * for extensible forms of encryption. - * - * These utilities facilitate decrypting and encrypting the most common - * JSON Wallet formats. - * - * @_subsection: api/wallet:JSON Wallets [json-wallets] - */ -const defaultPath$1 = "m/44'/60'/0'/0/0"; -/** - * Returns true if %%json%% is a valid JSON Keystore Wallet. - */ -function isKeystoreJson(json) { - try { - const data = JSON.parse(json); - const version = ((data.version != null) ? parseInt(data.version) : 0); - if (version === 3) { - return true; - } - } - catch (error) { } - return false; -} -function decrypt(data, key, ciphertext) { - const cipher = spelunk(data, "crypto.cipher:string"); - if (cipher === "aes-128-ctr") { - const iv = spelunk(data, "crypto.cipherparams.iv:data!"); - const aesCtr = new CTR(key, iv); - return hexlify(aesCtr.decrypt(ciphertext)); - } - assert(false, "unsupported cipher", "UNSUPPORTED_OPERATION", { - operation: "decrypt" - }); -} -function getAccount(data, _key) { - const key = getBytes(_key); - const ciphertext = spelunk(data, "crypto.ciphertext:data!"); - const computedMAC = hexlify(keccak256(concat([key.slice(16, 32), ciphertext]))).substring(2); - assertArgument(computedMAC === spelunk(data, "crypto.mac:string!").toLowerCase(), "incorrect password", "password", "[ REDACTED ]"); - const privateKey = decrypt(data, key.slice(0, 16), ciphertext); - const address = computeAddress(privateKey); - if (data.address) { - let check = data.address.toLowerCase(); - if (!check.startsWith("0x")) { - check = "0x" + check; - } - assertArgument(getAddress(check) === address, "keystore address/privateKey mismatch", "address", data.address); - } - const account = { address, privateKey }; - // Version 0.1 x-ethers metadata must contain an encrypted mnemonic phrase - const version = spelunk(data, "x-ethers.version:string"); - if (version === "0.1") { - const mnemonicKey = key.slice(32, 64); - const mnemonicCiphertext = spelunk(data, "x-ethers.mnemonicCiphertext:data!"); - const mnemonicIv = spelunk(data, "x-ethers.mnemonicCounter:data!"); - const mnemonicAesCtr = new CTR(mnemonicKey, mnemonicIv); - account.mnemonic = { - path: (spelunk(data, "x-ethers.path:string") || defaultPath$1), - locale: (spelunk(data, "x-ethers.locale:string") || "en"), - entropy: hexlify(getBytes(mnemonicAesCtr.decrypt(mnemonicCiphertext))) - }; - } - return account; -} -function getDecryptKdfParams(data) { - const kdf = spelunk(data, "crypto.kdf:string"); - if (kdf && typeof (kdf) === "string") { - if (kdf.toLowerCase() === "scrypt") { - const salt = spelunk(data, "crypto.kdfparams.salt:data!"); - const N = spelunk(data, "crypto.kdfparams.n:int!"); - const r = spelunk(data, "crypto.kdfparams.r:int!"); - const p = spelunk(data, "crypto.kdfparams.p:int!"); - // Make sure N is a power of 2 - assertArgument(N > 0 && (N & (N - 1)) === 0, "invalid kdf.N", "kdf.N", N); - assertArgument(r > 0 && p > 0, "invalid kdf", "kdf", kdf); - const dkLen = spelunk(data, "crypto.kdfparams.dklen:int!"); - assertArgument(dkLen === 32, "invalid kdf.dklen", "kdf.dflen", dkLen); - return { name: "scrypt", salt, N, r, p, dkLen: 64 }; - } - else if (kdf.toLowerCase() === "pbkdf2") { - const salt = spelunk(data, "crypto.kdfparams.salt:data!"); - const prf = spelunk(data, "crypto.kdfparams.prf:string!"); - const algorithm = prf.split("-").pop(); - assertArgument(algorithm === "sha256" || algorithm === "sha512", "invalid kdf.pdf", "kdf.pdf", prf); - const count = spelunk(data, "crypto.kdfparams.c:int!"); - const dkLen = spelunk(data, "crypto.kdfparams.dklen:int!"); - assertArgument(dkLen === 32, "invalid kdf.dklen", "kdf.dklen", dkLen); - return { name: "pbkdf2", salt, count, dkLen, algorithm }; - } - } - assertArgument(false, "unsupported key-derivation function", "kdf", kdf); -} -/** - * Returns the account details for the JSON Keystore Wallet %%json%% - * using %%password%%. - * - * It is preferred to use the [async version](decryptKeystoreJson) - * instead, which allows a [[ProgressCallback]] to keep the user informed - * as to the decryption status. - * - * This method will block the event loop (freezing all UI) until decryption - * is complete, which can take quite some time, depending on the wallet - * paramters and platform. - */ -function decryptKeystoreJsonSync(json, _password) { - const data = JSON.parse(json); - const password = getPassword(_password); - const params = getDecryptKdfParams(data); - if (params.name === "pbkdf2") { - const { salt, count, dkLen, algorithm } = params; - const key = pbkdf2(password, salt, count, dkLen, algorithm); - return getAccount(data, key); - } - assert(params.name === "scrypt", "cannot be reached", "UNKNOWN_ERROR", { params }); - const { salt, N, r, p, dkLen } = params; - const key = scryptSync(password, salt, N, r, p, dkLen); - return getAccount(data, key); -} -function stall$1(duration) { - return new Promise((resolve) => { setTimeout(() => { resolve(); }, duration); }); -} -/** - * Resolves to the decrypted JSON Keystore Wallet %%json%% using the - * %%password%%. - * - * If provided, %%progress%% will be called periodically during the - * decrpytion to provide feedback, and if the function returns - * ``false`` will halt decryption. - * - * The %%progressCallback%% will **always** receive ``0`` before - * decryption begins and ``1`` when complete. - */ -async function decryptKeystoreJson(json, _password, progress) { - const data = JSON.parse(json); - const password = getPassword(_password); - const params = getDecryptKdfParams(data); - if (params.name === "pbkdf2") { - if (progress) { - progress(0); - await stall$1(0); - } - const { salt, count, dkLen, algorithm } = params; - const key = pbkdf2(password, salt, count, dkLen, algorithm); - if (progress) { - progress(1); - await stall$1(0); - } - return getAccount(data, key); - } - assert(params.name === "scrypt", "cannot be reached", "UNKNOWN_ERROR", { params }); - const { salt, N, r, p, dkLen } = params; - const key = await scrypt(password, salt, N, r, p, dkLen, progress); - return getAccount(data, key); -} -function getEncryptKdfParams(options) { - // Check/generate the salt - const salt = (options.salt != null) ? getBytes(options.salt, "options.salt") : randomBytes(32); - // Override the scrypt password-based key derivation function parameters - let N = (1 << 17), r = 8, p = 1; - if (options.scrypt) { - if (options.scrypt.N) { - N = options.scrypt.N; - } - if (options.scrypt.r) { - r = options.scrypt.r; - } - if (options.scrypt.p) { - p = options.scrypt.p; - } - } - assertArgument(typeof (N) === "number" && N > 0 && Number.isSafeInteger(N) && (BigInt(N) & BigInt(N - 1)) === BigInt(0), "invalid scrypt N parameter", "options.N", N); - assertArgument(typeof (r) === "number" && r > 0 && Number.isSafeInteger(r), "invalid scrypt r parameter", "options.r", r); - assertArgument(typeof (p) === "number" && p > 0 && Number.isSafeInteger(p), "invalid scrypt p parameter", "options.p", p); - return { name: "scrypt", dkLen: 32, salt, N, r, p }; -} -function _encryptKeystore(key, kdf, account, options) { - const privateKey = getBytes(account.privateKey, "privateKey"); - // Override initialization vector - const iv = (options.iv != null) ? getBytes(options.iv, "options.iv") : randomBytes(16); - assertArgument(iv.length === 16, "invalid options.iv length", "options.iv", options.iv); - // Override the uuid - const uuidRandom = (options.uuid != null) ? getBytes(options.uuid, "options.uuid") : randomBytes(16); - assertArgument(uuidRandom.length === 16, "invalid options.uuid length", "options.uuid", options.iv); - // This will be used to encrypt the wallet (as per Web3 secret storage) - // - 32 bytes As normal for the Web3 secret storage (derivedKey, macPrefix) - // - 32 bytes AES key to encrypt mnemonic with (required here to be Ethers Wallet) - const derivedKey = key.slice(0, 16); - const macPrefix = key.slice(16, 32); - // Encrypt the private key - const aesCtr = new CTR(derivedKey, iv); - const ciphertext = getBytes(aesCtr.encrypt(privateKey)); - // Compute the message authentication code, used to check the password - const mac = keccak256(concat([macPrefix, ciphertext])); - // See: https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition - const data = { - address: account.address.substring(2).toLowerCase(), - id: uuidV4(uuidRandom), - version: 3, - Crypto: { - cipher: "aes-128-ctr", - cipherparams: { - iv: hexlify(iv).substring(2), - }, - ciphertext: hexlify(ciphertext).substring(2), - kdf: "scrypt", - kdfparams: { - salt: hexlify(kdf.salt).substring(2), - n: kdf.N, - dklen: 32, - p: kdf.p, - r: kdf.r - }, - mac: mac.substring(2) - } - }; - // If we have a mnemonic, encrypt it into the JSON wallet - if (account.mnemonic) { - const client = (options.client != null) ? options.client : `ethers/${version}`; - const path = account.mnemonic.path || defaultPath$1; - const locale = account.mnemonic.locale || "en"; - const mnemonicKey = key.slice(32, 64); - const entropy = getBytes(account.mnemonic.entropy, "account.mnemonic.entropy"); - const mnemonicIv = randomBytes(16); - const mnemonicAesCtr = new CTR(mnemonicKey, mnemonicIv); - const mnemonicCiphertext = getBytes(mnemonicAesCtr.encrypt(entropy)); - const now = new Date(); - const timestamp = (now.getUTCFullYear() + "-" + - zpad$1(now.getUTCMonth() + 1, 2) + "-" + - zpad$1(now.getUTCDate(), 2) + "T" + - zpad$1(now.getUTCHours(), 2) + "-" + - zpad$1(now.getUTCMinutes(), 2) + "-" + - zpad$1(now.getUTCSeconds(), 2) + ".0Z"); - const gethFilename = ("UTC--" + timestamp + "--" + data.address); - data["x-ethers"] = { - client, gethFilename, path, locale, - mnemonicCounter: hexlify(mnemonicIv).substring(2), - mnemonicCiphertext: hexlify(mnemonicCiphertext).substring(2), - version: "0.1" - }; - } - return JSON.stringify(data); -} -/** - * Return the JSON Keystore Wallet for %%account%% encrypted with - * %%password%%. - * - * The %%options%% can be used to tune the password-based key - * derivation function parameters, explicitly set the random values - * used. Any provided [[ProgressCallback]] is ignord. - */ -function encryptKeystoreJsonSync(account, password, options) { - if (options == null) { - options = {}; - } - const passwordBytes = getPassword(password); - const kdf = getEncryptKdfParams(options); - const key = scryptSync(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64); - return _encryptKeystore(getBytes(key), kdf, account, options); -} -/** - * Resolved to the JSON Keystore Wallet for %%account%% encrypted - * with %%password%%. - * - * The %%options%% can be used to tune the password-based key - * derivation function parameters, explicitly set the random values - * used and provide a [[ProgressCallback]] to receive periodic updates - * on the completion status.. - */ -async function encryptKeystoreJson(account, password, options) { - if (options == null) { - options = {}; - } - const passwordBytes = getPassword(password); - const kdf = getEncryptKdfParams(options); - const key = await scrypt(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64, options.progressCallback); - return _encryptKeystore(getBytes(key), kdf, account, options); -} - -/** - * Explain HD Wallets.. - * - * @_subsection: api/wallet:HD Wallets [hd-wallets] - */ -/** - * The default derivation path for Ethereum HD Nodes. (i.e. ``"m/44'/60'/0'/0/0"``) - */ -const defaultPath = "m/44'/60'/0'/0/0"; -// "Bitcoin seed" -const MasterSecret = new Uint8Array([66, 105, 116, 99, 111, 105, 110, 32, 115, 101, 101, 100]); -const HardenedBit = 0x80000000; -const N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); -const Nibbles = "0123456789abcdef"; -function zpad(value, length) { - let result = ""; - while (value) { - result = Nibbles[value % 16] + result; - value = Math.trunc(value / 16); - } - while (result.length < length * 2) { - result = "0" + result; - } - return "0x" + result; -} -function encodeBase58Check(_value) { - const value = getBytes(_value); - const check = dataSlice(sha256(sha256(value)), 0, 4); - const bytes = concat([value, check]); - return encodeBase58(bytes); -} -const _guard = {}; -function ser_I(index, chainCode, publicKey, privateKey) { - const data = new Uint8Array(37); - if (index & HardenedBit) { - assert(privateKey != null, "cannot derive child of neutered node", "UNSUPPORTED_OPERATION", { - operation: "deriveChild" - }); - // Data = 0x00 || ser_256(k_par) - data.set(getBytes(privateKey), 1); - } - else { - // Data = ser_p(point(k_par)) - data.set(getBytes(publicKey)); - } - // Data += ser_32(i) - for (let i = 24; i >= 0; i -= 8) { - data[33 + (i >> 3)] = ((index >> (24 - i)) & 0xff); - } - const I = getBytes(computeHmac("sha512", chainCode, data)); - return { IL: I.slice(0, 32), IR: I.slice(32) }; -} -function derivePath(node, path) { - const components = path.split("/"); - assertArgument(components.length > 0, "invalid path", "path", path); - if (components[0] === "m") { - assertArgument(node.depth === 0, `cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${node.depth}`, "path", path); - components.shift(); - } - let result = node; - for (let i = 0; i < components.length; i++) { - const component = components[i]; - if (component.match(/^[0-9]+'$/)) { - const index = parseInt(component.substring(0, component.length - 1)); - assertArgument(index < HardenedBit, "invalid path index", `path[${i}]`, component); - result = result.deriveChild(HardenedBit + index); - } - else if (component.match(/^[0-9]+$/)) { - const index = parseInt(component); - assertArgument(index < HardenedBit, "invalid path index", `path[${i}]`, component); - result = result.deriveChild(index); - } - else { - assertArgument(false, "invalid path component", `path[${i}]`, component); - } - } - return result; -} -/** - * An **HDNodeWallet** is a [[Signer]] backed by the private key derived - * from an HD Node using the [[link-bip-32]] stantard. - * - * An HD Node forms a hierarchal structure with each HD Node having a - * private key and the ability to derive child HD Nodes, defined by - * a path indicating the index of each child. - */ -class HDNodeWallet extends BaseWallet { - /** - * The compressed public key. - */ - publicKey; - /** - * The fingerprint. - * - * A fingerprint allows quick qay to detect parent and child nodes, - * but developers should be prepared to deal with collisions as it - * is only 4 bytes. - */ - fingerprint; - /** - * The parent fingerprint. - */ - parentFingerprint; - /** - * The mnemonic used to create this HD Node, if available. - * - * Sources such as extended keys do not encode the mnemonic, in - * which case this will be ``null``. - */ - mnemonic; - /** - * The chaincode, which is effectively a public key used - * to derive children. - */ - chainCode; - /** - * The derivation path of this wallet. - * - * Since extended keys do not provide full path details, this - * may be ``null``, if instantiated from a source that does not - * encode it. - */ - path; - /** - * The child index of this wallet. Values over ``2 *\* 31`` indicate - * the node is hardened. - */ - index; - /** - * The depth of this wallet, which is the number of components - * in its path. - */ - depth; - /** - * @private - */ - constructor(guard, signingKey, parentFingerprint, chainCode, path, index, depth, mnemonic, provider) { - super(signingKey, provider); - assertPrivate(guard, _guard, "HDNodeWallet"); - defineProperties(this, { publicKey: signingKey.compressedPublicKey }); - const fingerprint = dataSlice(ripemd160(sha256(this.publicKey)), 0, 4); - defineProperties(this, { - parentFingerprint, fingerprint, - chainCode, path, index, depth - }); - defineProperties(this, { mnemonic }); - } - connect(provider) { - return new HDNodeWallet(_guard, this.signingKey, this.parentFingerprint, this.chainCode, this.path, this.index, this.depth, this.mnemonic, provider); - } - #account() { - const account = { address: this.address, privateKey: this.privateKey }; - const m = this.mnemonic; - if (this.path && m && m.wordlist.locale === "en" && m.password === "") { - account.mnemonic = { - path: this.path, - locale: "en", - entropy: m.entropy - }; - } - return account; - } - /** - * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with - * %%password%%. - * - * If %%progressCallback%% is specified, it will receive periodic - * updates as the encryption process progreses. - */ - async encrypt(password, progressCallback) { - return await encryptKeystoreJson(this.#account(), password, { progressCallback }); - } - /** - * Returns a [JSON Keystore Wallet](json-wallets) encryped with - * %%password%%. - * - * It is preferred to use the [async version](encrypt) instead, - * which allows a [[ProgressCallback]] to keep the user informed. - * - * This method will block the event loop (freezing all UI) until - * it is complete, which may be a non-trivial duration. - */ - encryptSync(password) { - return encryptKeystoreJsonSync(this.#account(), password); - } - /** - * The extended key. - * - * This key will begin with the prefix ``xpriv`` and can be used to - * reconstruct this HD Node to derive its children. - */ - get extendedKey() { - // We only support the mainnet values for now, but if anyone needs - // testnet values, let me know. I believe current sentiment is that - // we should always use mainnet, and use BIP-44 to derive the network - // - Mainnet: public=0x0488B21E, private=0x0488ADE4 - // - Testnet: public=0x043587CF, private=0x04358394 - assert(this.depth < 256, "Depth too deep", "UNSUPPORTED_OPERATION", { operation: "extendedKey" }); - return encodeBase58Check(concat([ - "0x0488ADE4", zpad(this.depth, 1), this.parentFingerprint, - zpad(this.index, 4), this.chainCode, - concat(["0x00", this.privateKey]) - ])); - } - /** - * Returns true if this wallet has a path, providing a Type Guard - * that the path is non-null. - */ - hasPath() { return (this.path != null); } - /** - * Returns a neutered HD Node, which removes the private details - * of an HD Node. - * - * A neutered node has no private key, but can be used to derive - * child addresses and other public data about the HD Node. - */ - neuter() { - return new HDNodeVoidWallet(_guard, this.address, this.publicKey, this.parentFingerprint, this.chainCode, this.path, this.index, this.depth, this.provider); - } - /** - * Return the child for %%index%%. - */ - deriveChild(_index) { - const index = getNumber(_index, "index"); - assertArgument(index <= 0xffffffff, "invalid index", "index", index); - // Base path - let path = this.path; - if (path) { - path += "/" + (index & ~HardenedBit); - if (index & HardenedBit) { - path += "'"; - } - } - const { IR, IL } = ser_I(index, this.chainCode, this.publicKey, this.privateKey); - const ki = new SigningKey(toBeHex((toBigInt(IL) + BigInt(this.privateKey)) % N, 32)); - return new HDNodeWallet(_guard, ki, this.fingerprint, hexlify(IR), path, index, this.depth + 1, this.mnemonic, this.provider); - } - /** - * Return the HDNode for %%path%% from this node. - */ - derivePath(path) { - return derivePath(this, path); - } - static #fromSeed(_seed, mnemonic) { - assertArgument(isBytesLike(_seed), "invalid seed", "seed", "[REDACTED]"); - const seed = getBytes(_seed, "seed"); - assertArgument(seed.length >= 16 && seed.length <= 64, "invalid seed", "seed", "[REDACTED]"); - const I = getBytes(computeHmac("sha512", MasterSecret, seed)); - const signingKey = new SigningKey(hexlify(I.slice(0, 32))); - return new HDNodeWallet(_guard, signingKey, "0x00000000", hexlify(I.slice(32)), "m", 0, 0, mnemonic, null); - } - /** - * Creates a new HD Node from %%extendedKey%%. - * - * If the %%extendedKey%% will either have a prefix or ``xpub`` or - * ``xpriv``, returning a neutered HD Node ([[HDNodeVoidWallet]]) - * or full HD Node ([[HDNodeWallet) respectively. - */ - static fromExtendedKey(extendedKey) { - const bytes = toBeArray(decodeBase58(extendedKey)); // @TODO: redact - assertArgument(bytes.length === 82 || encodeBase58Check(bytes.slice(0, 78)) === extendedKey, "invalid extended key", "extendedKey", "[ REDACTED ]"); - const depth = bytes[4]; - const parentFingerprint = hexlify(bytes.slice(5, 9)); - const index = parseInt(hexlify(bytes.slice(9, 13)).substring(2), 16); - const chainCode = hexlify(bytes.slice(13, 45)); - const key = bytes.slice(45, 78); - switch (hexlify(bytes.slice(0, 4))) { - // Public Key - case "0x0488b21e": - case "0x043587cf": { - const publicKey = hexlify(key); - return new HDNodeVoidWallet(_guard, computeAddress(publicKey), publicKey, parentFingerprint, chainCode, null, index, depth, null); - } - // Private Key - case "0x0488ade4": - case "0x04358394 ": - if (key[0] !== 0) { - break; - } - return new HDNodeWallet(_guard, new SigningKey(key.slice(1)), parentFingerprint, chainCode, null, index, depth, null, null); - } - assertArgument(false, "invalid extended key prefix", "extendedKey", "[ REDACTED ]"); - } - /** - * Creates a new random HDNode. - */ - static createRandom(password, path, wordlist) { - if (password == null) { - password = ""; - } - if (path == null) { - path = defaultPath; - } - if (wordlist == null) { - wordlist = LangEn.wordlist(); - } - const mnemonic = Mnemonic.fromEntropy(randomBytes(16), password, wordlist); - return HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path); - } - /** - * Create an HD Node from %%mnemonic%%. - */ - static fromMnemonic(mnemonic, path) { - if (!path) { - path = defaultPath; - } - return HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path); - } - /** - * Creates an HD Node from a mnemonic %%phrase%%. - */ - static fromPhrase(phrase, password, path, wordlist) { - if (password == null) { - password = ""; - } - if (path == null) { - path = defaultPath; - } - if (wordlist == null) { - wordlist = LangEn.wordlist(); - } - const mnemonic = Mnemonic.fromPhrase(phrase, password, wordlist); - return HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path); - } - /** - * Creates an HD Node from a %%seed%%. - */ - static fromSeed(seed) { - return HDNodeWallet.#fromSeed(seed, null); - } -} -/** - * A **HDNodeVoidWallet** cannot sign, but provides access to - * the children nodes of a [[link-bip-32]] HD wallet addresses. - * - * The can be created by using an extended ``xpub`` key to - * [[HDNodeWallet_fromExtendedKey]] or by - * [nuetering](HDNodeWallet-neuter) a [[HDNodeWallet]]. - */ -class HDNodeVoidWallet extends VoidSigner { - /** - * The compressed public key. - */ - publicKey; - /** - * The fingerprint. - * - * A fingerprint allows quick qay to detect parent and child nodes, - * but developers should be prepared to deal with collisions as it - * is only 4 bytes. - */ - fingerprint; - /** - * The parent node fingerprint. - */ - parentFingerprint; - /** - * The chaincode, which is effectively a public key used - * to derive children. - */ - chainCode; - /** - * The derivation path of this wallet. - * - * Since extended keys do not provider full path details, this - * may be ``null``, if instantiated from a source that does not - * enocde it. - */ - path; - /** - * The child index of this wallet. Values over ``2 *\* 31`` indicate - * the node is hardened. - */ - index; - /** - * The depth of this wallet, which is the number of components - * in its path. - */ - depth; - /** - * @private - */ - constructor(guard, address, publicKey, parentFingerprint, chainCode, path, index, depth, provider) { - super(address, provider); - assertPrivate(guard, _guard, "HDNodeVoidWallet"); - defineProperties(this, { publicKey }); - const fingerprint = dataSlice(ripemd160(sha256(publicKey)), 0, 4); - defineProperties(this, { - publicKey, fingerprint, parentFingerprint, chainCode, path, index, depth - }); - } - connect(provider) { - return new HDNodeVoidWallet(_guard, this.address, this.publicKey, this.parentFingerprint, this.chainCode, this.path, this.index, this.depth, provider); - } - /** - * The extended key. - * - * This key will begin with the prefix ``xpub`` and can be used to - * reconstruct this neutered key to derive its children addresses. - */ - get extendedKey() { - // We only support the mainnet values for now, but if anyone needs - // testnet values, let me know. I believe current sentiment is that - // we should always use mainnet, and use BIP-44 to derive the network - // - Mainnet: public=0x0488B21E, private=0x0488ADE4 - // - Testnet: public=0x043587CF, private=0x04358394 - assert(this.depth < 256, "Depth too deep", "UNSUPPORTED_OPERATION", { operation: "extendedKey" }); - return encodeBase58Check(concat([ - "0x0488B21E", - zpad(this.depth, 1), - this.parentFingerprint, - zpad(this.index, 4), - this.chainCode, - this.publicKey, - ])); - } - /** - * Returns true if this wallet has a path, providing a Type Guard - * that the path is non-null. - */ - hasPath() { return (this.path != null); } - /** - * Return the child for %%index%%. - */ - deriveChild(_index) { - const index = getNumber(_index, "index"); - assertArgument(index <= 0xffffffff, "invalid index", "index", index); - // Base path - let path = this.path; - if (path) { - path += "/" + (index & ~HardenedBit); - if (index & HardenedBit) { - path += "'"; - } - } - const { IR, IL } = ser_I(index, this.chainCode, this.publicKey, null); - const Ki = SigningKey.addPoints(IL, this.publicKey, true); - const address = computeAddress(Ki); - return new HDNodeVoidWallet(_guard, address, Ki, this.fingerprint, hexlify(IR), path, index, this.depth + 1, this.provider); - } - /** - * Return the signer for %%path%% from this node. - */ - derivePath(path) { - return derivePath(this, path); - } -} -/* -export class HDNodeWalletManager { - #root: HDNodeWallet; - - constructor(phrase: string, password?: null | string, path?: null | string, locale?: null | Wordlist) { - if (password == null) { password = ""; } - if (path == null) { path = "m/44'/60'/0'/0"; } - if (locale == null) { locale = LangEn.wordlist(); } - this.#root = HDNodeWallet.fromPhrase(phrase, password, path, locale); - } - - getSigner(index?: number): HDNodeWallet { - return this.#root.deriveChild((index == null) ? 0: index); - } -} -*/ -/** - * Returns the [[link-bip-32]] path for the account at %%index%%. - * - * This is the pattern used by wallets like Ledger. - * - * There is also an [alternate pattern](getIndexedAccountPath) used by - * some software. - */ -function getAccountPath(_index) { - const index = getNumber(_index, "index"); - assertArgument(index >= 0 && index < HardenedBit, "invalid account index", "index", index); - return `m/44'/60'/${index}'/0/0`; -} -/** - * Returns the path using an alternative pattern for deriving accounts, - * at %%index%%. - * - * This derivation path uses the //index// component rather than the - * //account// component to derive sequential accounts. - * - * This is the pattern used by wallets like MetaMask. - */ -function getIndexedAccountPath(_index) { - const index = getNumber(_index, "index"); - assertArgument(index >= 0 && index < HardenedBit, "invalid account index", "index", index); - return `m/44'/60'/0'/0/${index}`; -} - -/** - * @_subsection: api/wallet:JSON Wallets [json-wallets] - */ -/** - * Returns true if %%json%% is a valid JSON Crowdsale wallet. - */ -function isCrowdsaleJson(json) { - try { - const data = JSON.parse(json); - if (data.encseed) { - return true; - } - } - catch (error) { } - return false; -} -// See: https://github.com/ethereum/pyethsaletool -/** - * Before Ethereum launched, it was necessary to create a wallet - * format for backers to use, which would be used to receive ether - * as a reward for contributing to the project. - * - * The [[link-crowdsale]] format is now obsolete, but it is still - * useful to support and the additional code is fairly trivial as - * all the primitives required are used through core portions of - * the library. - */ -function decryptCrowdsaleJson(json, _password) { - const data = JSON.parse(json); - const password = getPassword(_password); - // Ethereum Address - const address = getAddress(spelunk(data, "ethaddr:string!")); - // Encrypted Seed - const encseed = looseArrayify(spelunk(data, "encseed:string!")); - assertArgument(encseed && (encseed.length % 16) === 0, "invalid encseed", "json", json); - const key = getBytes(pbkdf2(password, password, 2000, 32, "sha256")).slice(0, 16); - const iv = encseed.slice(0, 16); - const encryptedSeed = encseed.slice(16); - // Decrypt the seed - const aesCbc = new CBC(key, iv); - const seed = pkcs7Strip(getBytes(aesCbc.decrypt(encryptedSeed))); - // This wallet format is weird... Convert the binary encoded hex to a string. - let seedHex = ""; - for (let i = 0; i < seed.length; i++) { - seedHex += String.fromCharCode(seed[i]); - } - return { address, privateKey: id(seedHex) }; -} - -function stall(duration) { - return new Promise((resolve) => { setTimeout(() => { resolve(); }, duration); }); -} -/** - * A **Wallet** manages a single private key which is used to sign - * transactions, messages and other common payloads. - * - * This class is generally the main entry point for developers - * that wish to use a private key directly, as it can create - * instances from a large variety of common sources, including - * raw private key, [[link-bip-39]] mnemonics and encrypte JSON - * wallets. - */ -class Wallet extends BaseWallet { - /** - * Create a new wallet for the private %%key%%, optionally connected - * to %%provider%%. - */ - constructor(key, provider) { - if (typeof (key) === "string" && !key.startsWith("0x")) { - key = "0x" + key; - } - let signingKey = (typeof (key) === "string") ? new SigningKey(key) : key; - super(signingKey, provider); - } - connect(provider) { - return new Wallet(this.signingKey, provider); - } - /** - * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with - * %%password%%. - * - * If %%progressCallback%% is specified, it will receive periodic - * updates as the encryption process progreses. - */ - async encrypt(password, progressCallback) { - const account = { address: this.address, privateKey: this.privateKey }; - return await encryptKeystoreJson(account, password, { progressCallback }); - } - /** - * Returns a [JSON Keystore Wallet](json-wallets) encryped with - * %%password%%. - * - * It is preferred to use the [async version](encrypt) instead, - * which allows a [[ProgressCallback]] to keep the user informed. - * - * This method will block the event loop (freezing all UI) until - * it is complete, which may be a non-trivial duration. - */ - encryptSync(password) { - const account = { address: this.address, privateKey: this.privateKey }; - return encryptKeystoreJsonSync(account, password); - } - static #fromAccount(account) { - assertArgument(account, "invalid JSON wallet", "json", "[ REDACTED ]"); - if ("mnemonic" in account && account.mnemonic && account.mnemonic.locale === "en") { - const mnemonic = Mnemonic.fromEntropy(account.mnemonic.entropy); - const wallet = HDNodeWallet.fromMnemonic(mnemonic, account.mnemonic.path); - if (wallet.address === account.address && wallet.privateKey === account.privateKey) { - return wallet; - } - console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key"); - } - const wallet = new Wallet(account.privateKey); - assertArgument(wallet.address === account.address, "address/privateKey mismatch", "json", "[ REDACTED ]"); - return wallet; - } - /** - * Creates (asynchronously) a **Wallet** by decrypting the %%json%% - * with %%password%%. - * - * If %%progress%% is provided, it is called periodically during - * decryption so that any UI can be updated. - */ - static async fromEncryptedJson(json, password, progress) { - let account = null; - if (isKeystoreJson(json)) { - account = await decryptKeystoreJson(json, password, progress); - } - else if (isCrowdsaleJson(json)) { - if (progress) { - progress(0); - await stall(0); - } - account = decryptCrowdsaleJson(json, password); - if (progress) { - progress(1); - await stall(0); - } - } - return Wallet.#fromAccount(account); - } - /** - * Creates a **Wallet** by decrypting the %%json%% with %%password%%. - * - * The [[fromEncryptedJson]] method is preferred, as this method - * will lock up and freeze the UI during decryption, which may take - * some time. - */ - static fromEncryptedJsonSync(json, password) { - let account = null; - if (isKeystoreJson(json)) { - account = decryptKeystoreJsonSync(json, password); - } - else if (isCrowdsaleJson(json)) { - account = decryptCrowdsaleJson(json, password); - } - else { - assertArgument(false, "invalid JSON wallet", "json", "[ REDACTED ]"); - } - return Wallet.#fromAccount(account); - } - /** - * Creates a new random [[HDNodeWallet]] using the available - * [cryptographic random source](randomBytes). - * - * If there is no crytographic random source, this will throw. - */ - static createRandom(provider) { - const wallet = HDNodeWallet.createRandom(); - if (provider) { - return wallet.connect(provider); - } - return wallet; - } - /** - * Creates a [[HDNodeWallet]] for %%phrase%%. - */ - static fromPhrase(phrase, provider) { - const wallet = HDNodeWallet.fromPhrase(phrase); - if (provider) { - return wallet.connect(provider); - } - return wallet; - } -} - -const Base64 = ")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_"; -/** - * @_ignore - */ -function decodeBits(width, data) { - const maxValue = (1 << width) - 1; - const result = []; - let accum = 0, bits = 0, flood = 0; - for (let i = 0; i < data.length; i++) { - // Accumulate 6 bits of data - accum = ((accum << 6) | Base64.indexOf(data[i])); - bits += 6; - // While we have enough for a word... - while (bits >= width) { - // ...read the word - const value = (accum >> (bits - width)); - accum &= (1 << (bits - width)) - 1; - bits -= width; - // A value of 0 indicates we exceeded maxValue, it - // floods over into the next value - if (value === 0) { - flood += maxValue; - } - else { - result.push(value + flood); - flood = 0; - } - } - } - return result; -} - -/** - * @_ignore - */ -function decodeOwlA(data, accents) { - let words = decodeOwl(data).join(","); - // Inject the accents - accents.split(/,/g).forEach((accent) => { - const match = accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/); - assertArgument(match !== null, "internal error parsing accents", "accents", accents); - let posOffset = 0; - const positions = decodeBits(parseInt(match[3]), match[4]); - const charCode = parseInt(match[2]); - const regex = new RegExp(`([${match[1]}])`, "g"); - words = words.replace(regex, (all, letter) => { - const rem = --positions[posOffset]; - if (rem === 0) { - letter = String.fromCharCode(letter.charCodeAt(0), charCode); - posOffset++; - } - return letter; - }); - }); - return words.split(","); -} - -/** - * An OWL-A format Wordlist extends the OWL format to add an - * overlay onto an OWL format Wordlist to support diacritic - * marks. - * - * This class is generally not useful to most developers as - * it is used mainly internally to keep Wordlists for languages - * based on latin-1 small. - * - * If necessary, there are tools within the ``generation/`` folder - * to create the necessary data. - */ -class WordlistOwlA extends WordlistOwl { - #accent; - /** - * Creates a new Wordlist for %%locale%% using the OWLA %%data%% - * and %%accent%% data and validated against the %%checksum%%. - */ - constructor(locale, data, accent, checksum) { - super(locale, data, checksum); - this.#accent = accent; - } - /** - * The OWLA-encoded accent data. - */ - get _accent() { return this.#accent; } - /** - * Decode all the words for the wordlist. - */ - _decodeWords() { - return decodeOwlA(this._data, this._accent); - } -} - -const wordlists = { - en: LangEn.wordlist(), -}; - -///////////////////////////// -// -// dummy change; to pick-up ws security issue changes - -var ethers = /*#__PURE__*/Object.freeze({ - __proto__: null, - AbiCoder: AbiCoder, - AbstractProvider: AbstractProvider, - AbstractSigner: AbstractSigner, - AlchemyProvider: AlchemyProvider, - AnkrProvider: AnkrProvider, - BaseContract: BaseContract, - BaseWallet: BaseWallet, - Block: Block, - BlockscoutProvider: BlockscoutProvider, - BrowserProvider: BrowserProvider, - ChainstackProvider: ChainstackProvider, - CloudflareProvider: CloudflareProvider, - ConstructorFragment: ConstructorFragment, - Contract: Contract, - ContractEventPayload: ContractEventPayload, - ContractFactory: ContractFactory, - ContractTransactionReceipt: ContractTransactionReceipt, - ContractTransactionResponse: ContractTransactionResponse, - ContractUnknownEventPayload: ContractUnknownEventPayload, - EnsPlugin: EnsPlugin, - EnsResolver: EnsResolver, - ErrorDescription: ErrorDescription, - ErrorFragment: ErrorFragment, - EtherSymbol: EtherSymbol, - EtherscanPlugin: EtherscanPlugin, - EtherscanProvider: EtherscanProvider, - EventFragment: EventFragment, - EventLog: EventLog, - EventPayload: EventPayload, - FallbackFragment: FallbackFragment, - FallbackProvider: FallbackProvider, - FeeData: FeeData, - FeeDataNetworkPlugin: FeeDataNetworkPlugin, - FetchCancelSignal: FetchCancelSignal, - FetchRequest: FetchRequest, - FetchResponse: FetchResponse, - FetchUrlFeeDataNetworkPlugin: FetchUrlFeeDataNetworkPlugin, - FixedNumber: FixedNumber, - Fragment: Fragment, - FunctionFragment: FunctionFragment, - GasCostPlugin: GasCostPlugin, - HDNodeVoidWallet: HDNodeVoidWallet, - HDNodeWallet: HDNodeWallet, - Indexed: Indexed, - InfuraProvider: InfuraProvider, - InfuraWebSocketProvider: InfuraWebSocketProvider, - Interface: Interface, - IpcSocketProvider: IpcSocketProvider, - JsonRpcApiProvider: JsonRpcApiProvider, - JsonRpcProvider: JsonRpcProvider, - JsonRpcSigner: JsonRpcSigner, - LangEn: LangEn, - Log: Log, - LogDescription: LogDescription, - MaxInt256: MaxInt256, - MaxUint256: MaxUint256, - MessagePrefix: MessagePrefix, - MinInt256: MinInt256, - Mnemonic: Mnemonic, - MulticoinProviderPlugin: MulticoinProviderPlugin, - N: N$1, - NamedFragment: NamedFragment, - Network: Network, - NetworkPlugin: NetworkPlugin, - NonceManager: NonceManager, - ParamType: ParamType, - PocketProvider: PocketProvider, - QuickNodeProvider: QuickNodeProvider, - Result: Result, - Signature: Signature, - SigningKey: SigningKey, - SocketBlockSubscriber: SocketBlockSubscriber, - SocketEventSubscriber: SocketEventSubscriber, - SocketPendingSubscriber: SocketPendingSubscriber, - SocketProvider: SocketProvider, - SocketSubscriber: SocketSubscriber, - StructFragment: StructFragment, - Transaction: Transaction, - TransactionDescription: TransactionDescription, - TransactionReceipt: TransactionReceipt, - TransactionResponse: TransactionResponse, - Typed: Typed, - TypedDataEncoder: TypedDataEncoder, - UndecodedEventLog: UndecodedEventLog, - UnmanagedSubscriber: UnmanagedSubscriber, - Utf8ErrorFuncs: Utf8ErrorFuncs, - VoidSigner: VoidSigner, - Wallet: Wallet, - WebSocketProvider: WebSocketProvider, - WeiPerEther: WeiPerEther, - Wordlist: Wordlist, - WordlistOwl: WordlistOwl, - WordlistOwlA: WordlistOwlA, - ZeroAddress: ZeroAddress, - ZeroHash: ZeroHash, - accessListify: accessListify, - assert: assert, - assertArgument: assertArgument, - assertArgumentCount: assertArgumentCount, - assertNormalize: assertNormalize, - assertPrivate: assertPrivate, - authorizationify: authorizationify, - checkResultErrors: checkResultErrors, - computeAddress: computeAddress, - computeHmac: computeHmac, - concat: concat, - copyRequest: copyRequest, - dataLength: dataLength, - dataSlice: dataSlice, - decodeBase58: decodeBase58, - decodeBase64: decodeBase64, - decodeBytes32String: decodeBytes32String, - decodeRlp: decodeRlp, - decryptCrowdsaleJson: decryptCrowdsaleJson, - decryptKeystoreJson: decryptKeystoreJson, - decryptKeystoreJsonSync: decryptKeystoreJsonSync, - defaultPath: defaultPath, - defineProperties: defineProperties, - dnsEncode: dnsEncode, - encodeBase58: encodeBase58, - encodeBase64: encodeBase64, - encodeBytes32String: encodeBytes32String, - encodeRlp: encodeRlp, - encryptKeystoreJson: encryptKeystoreJson, - encryptKeystoreJsonSync: encryptKeystoreJsonSync, - ensNormalize: ensNormalize, - formatEther: formatEther, - formatUnits: formatUnits, - fromTwos: fromTwos, - getAccountPath: getAccountPath, - getAddress: getAddress, - getBigInt: getBigInt, - getBytes: getBytes, - getBytesCopy: getBytesCopy, - getCreate2Address: getCreate2Address, - getCreateAddress: getCreateAddress, - getDefaultProvider: getDefaultProvider, - getIcapAddress: getIcapAddress, - getIndexedAccountPath: getIndexedAccountPath, - getNumber: getNumber, - getUint: getUint, - hashAuthorization: hashAuthorization, - hashMessage: hashMessage, - hexlify: hexlify, - id: id, - isAddress: isAddress, - isAddressable: isAddressable, - isBytesLike: isBytesLike, - isCallException: isCallException, - isCrowdsaleJson: isCrowdsaleJson, - isError: isError, - isHexString: isHexString, - isKeystoreJson: isKeystoreJson, - isValidName: isValidName, - keccak256: keccak256, - lock: lock, - makeError: makeError, - mask: mask, - namehash: namehash, - parseEther: parseEther, - parseUnits: parseUnits$1, - pbkdf2: pbkdf2, - randomBytes: randomBytes, - recoverAddress: recoverAddress, - resolveAddress: resolveAddress, - resolveProperties: resolveProperties, - ripemd160: ripemd160, - scrypt: scrypt, - scryptSync: scryptSync, - sha256: sha256, - sha512: sha512, - showThrottleMessage: showThrottleMessage, - solidityPacked: solidityPacked, - solidityPackedKeccak256: solidityPackedKeccak256, - solidityPackedSha256: solidityPackedSha256, - stripZerosLeft: stripZerosLeft, - toBeArray: toBeArray, - toBeHex: toBeHex, - toBigInt: toBigInt, - toNumber: toNumber, - toQuantity: toQuantity, - toTwos: toTwos, - toUtf8Bytes: toUtf8Bytes, - toUtf8CodePoints: toUtf8CodePoints, - toUtf8String: toUtf8String, - uuidV4: uuidV4, - verifyAuthorization: verifyAuthorization, - verifyMessage: verifyMessage, - verifyTypedData: verifyTypedData, - version: version, - wordlists: wordlists, - zeroPadBytes: zeroPadBytes, - zeroPadValue: zeroPadValue -}); - -export { AbiCoder, AbstractProvider, AbstractSigner, AlchemyProvider, AnkrProvider, BaseContract, BaseWallet, Block, BlockscoutProvider, BrowserProvider, ChainstackProvider, CloudflareProvider, ConstructorFragment, Contract, ContractEventPayload, ContractFactory, ContractTransactionReceipt, ContractTransactionResponse, ContractUnknownEventPayload, EnsPlugin, EnsResolver, ErrorDescription, ErrorFragment, EtherSymbol, EtherscanPlugin, EtherscanProvider, EventFragment, EventLog, EventPayload, FallbackFragment, FallbackProvider, FeeData, FeeDataNetworkPlugin, FetchCancelSignal, FetchRequest, FetchResponse, FetchUrlFeeDataNetworkPlugin, FixedNumber, Fragment, FunctionFragment, GasCostPlugin, HDNodeVoidWallet, HDNodeWallet, Indexed, InfuraProvider, InfuraWebSocketProvider, Interface, IpcSocketProvider, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, LangEn, Log, LogDescription, MaxInt256, MaxUint256, MessagePrefix, MinInt256, Mnemonic, MulticoinProviderPlugin, N$1 as N, NamedFragment, Network, NetworkPlugin, NonceManager, ParamType, PocketProvider, QuickNodeProvider, Result, Signature, SigningKey, SocketBlockSubscriber, SocketEventSubscriber, SocketPendingSubscriber, SocketProvider, SocketSubscriber, StructFragment, Transaction, TransactionDescription, TransactionReceipt, TransactionResponse, Typed, TypedDataEncoder, UndecodedEventLog, UnmanagedSubscriber, Utf8ErrorFuncs, VoidSigner, Wallet, WebSocketProvider, WeiPerEther, Wordlist, WordlistOwl, WordlistOwlA, ZeroAddress, ZeroHash, accessListify, assert, assertArgument, assertArgumentCount, assertNormalize, assertPrivate, authorizationify, checkResultErrors, computeAddress, computeHmac, concat, copyRequest, dataLength, dataSlice, decodeBase58, decodeBase64, decodeBytes32String, decodeRlp, decryptCrowdsaleJson, decryptKeystoreJson, decryptKeystoreJsonSync, defaultPath, defineProperties, dnsEncode, encodeBase58, encodeBase64, encodeBytes32String, encodeRlp, encryptKeystoreJson, encryptKeystoreJsonSync, ensNormalize, ethers, formatEther, formatUnits, fromTwos, getAccountPath, getAddress, getBigInt, getBytes, getBytesCopy, getCreate2Address, getCreateAddress, getDefaultProvider, getIcapAddress, getIndexedAccountPath, getNumber, getUint, hashAuthorization, hashMessage, hexlify, id, isAddress, isAddressable, isBytesLike, isCallException, isCrowdsaleJson, isError, isHexString, isKeystoreJson, isValidName, keccak256, lock, makeError, mask, namehash, parseEther, parseUnits$1 as parseUnits, pbkdf2, randomBytes, recoverAddress, resolveAddress, resolveProperties, ripemd160, scrypt, scryptSync, sha256, sha512, showThrottleMessage, solidityPacked, solidityPackedKeccak256, solidityPackedSha256, stripZerosLeft, toBeArray, toBeHex, toBigInt, toNumber, toQuantity, toTwos, toUtf8Bytes, toUtf8CodePoints, toUtf8String, uuidV4, verifyAuthorization, verifyMessage, verifyTypedData, version, wordlists, zeroPadBytes, zeroPadValue }; -//# sourceMappingURL=ethers.js.map diff --git a/tools/mnemonic-test/node_modules/ethers/dist/ethers.js.map b/tools/mnemonic-test/node_modules/ethers/dist/ethers.js.map deleted file mode 100644 index e323080e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/dist/ethers.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ethers.js","sources":["../lib.esm/_version.js","../lib.esm/utils/properties.js","../lib.esm/utils/errors.js","../lib.esm/utils/data.js","../lib.esm/utils/maths.js","../lib.esm/utils/base58.js","../lib.esm/utils/base64-browser.js","../lib.esm/utils/events.js","../lib.esm/utils/utf8.js","../lib.esm/utils/geturl-browser.js","../lib.esm/utils/fetch.js","../lib.esm/utils/fixednumber.js","../lib.esm/utils/rlp-decode.js","../lib.esm/utils/rlp-encode.js","../lib.esm/utils/units.js","../lib.esm/utils/uuid.js","../lib.esm/abi/coders/abstract-coder.js","../node_modules/@noble/hashes/esm/_assert.js","../node_modules/@noble/hashes/esm/crypto.js","../node_modules/@noble/hashes/esm/utils.js","../node_modules/@noble/hashes/esm/hmac.js","../node_modules/@noble/hashes/esm/pbkdf2.js","../node_modules/@noble/hashes/esm/_sha2.js","../node_modules/@noble/hashes/esm/sha256.js","../node_modules/@noble/hashes/esm/_u64.js","../node_modules/@noble/hashes/esm/sha512.js","../lib.esm/crypto/crypto-browser.js","../lib.esm/crypto/hmac.js","../node_modules/@noble/hashes/esm/sha3.js","../lib.esm/crypto/keccak.js","../node_modules/@noble/hashes/esm/ripemd160.js","../lib.esm/crypto/ripemd160.js","../lib.esm/crypto/pbkdf2.js","../lib.esm/crypto/random.js","../node_modules/@noble/hashes/esm/scrypt.js","../lib.esm/crypto/scrypt.js","../lib.esm/crypto/sha2.js","../node_modules/@noble/curves/esm/abstract/utils.js","../node_modules/@noble/curves/esm/abstract/modular.js","../node_modules/@noble/curves/esm/abstract/curve.js","../node_modules/@noble/curves/esm/abstract/weierstrass.js","../node_modules/@noble/curves/esm/_shortw_utils.js","../node_modules/@noble/curves/esm/secp256k1.js","../lib.esm/constants/addresses.js","../lib.esm/constants/hashes.js","../lib.esm/constants/numbers.js","../lib.esm/constants/strings.js","../lib.esm/crypto/signature.js","../lib.esm/crypto/signing-key.js","../lib.esm/crypto/index.js","../lib.esm/address/address.js","../lib.esm/address/contract-address.js","../lib.esm/address/checks.js","../lib.esm/abi/typed.js","../lib.esm/abi/coders/address.js","../lib.esm/abi/coders/anonymous.js","../lib.esm/abi/coders/array.js","../lib.esm/abi/coders/boolean.js","../lib.esm/abi/coders/bytes.js","../lib.esm/abi/coders/fixed-bytes.js","../lib.esm/abi/coders/null.js","../lib.esm/abi/coders/number.js","../lib.esm/abi/coders/string.js","../lib.esm/abi/coders/tuple.js","../lib.esm/transaction/accesslist.js","../lib.esm/transaction/authorization.js","../lib.esm/transaction/address.js","../lib.esm/transaction/transaction.js","../lib.esm/hash/authorization.js","../lib.esm/hash/id.js","../node_modules/@adraffy/ens-normalize/dist/index.mjs","../lib.esm/hash/namehash.js","../lib.esm/hash/message.js","../lib.esm/hash/solidity.js","../lib.esm/hash/typed-data.js","../lib.esm/abi/fragments.js","../lib.esm/abi/abi-coder.js","../lib.esm/abi/bytes32.js","../lib.esm/abi/interface.js","../lib.esm/providers/provider.js","../lib.esm/contract/wrappers.js","../lib.esm/contract/contract.js","../lib.esm/contract/factory.js","../lib.esm/providers/ens-resolver.js","../lib.esm/providers/format.js","../lib.esm/providers/plugins-network.js","../lib.esm/providers/network.js","../lib.esm/providers/subscriber-polling.js","../lib.esm/providers/abstract-provider.js","../lib.esm/providers/abstract-signer.js","../lib.esm/providers/community.js","../lib.esm/providers/subscriber-filterid.js","../lib.esm/providers/provider-jsonrpc.js","../lib.esm/providers/provider-ankr.js","../lib.esm/providers/provider-alchemy.js","../lib.esm/providers/provider-chainstack.js","../lib.esm/providers/provider-cloudflare.js","../lib.esm/providers/provider-etherscan.js","../lib.esm/providers/ws-browser.js","../lib.esm/providers/provider-socket.js","../lib.esm/providers/provider-websocket.js","../lib.esm/providers/provider-infura.js","../lib.esm/providers/provider-quicknode.js","../lib.esm/providers/provider-fallback.js","../lib.esm/providers/default-provider.js","../lib.esm/providers/signer-noncemanager.js","../lib.esm/providers/provider-browser.js","../lib.esm/providers/provider-blockscout.js","../lib.esm/providers/provider-pocket.js","../lib.esm/providers/provider-ipcsocket-browser.js","../lib.esm/wallet/base-wallet.js","../lib.esm/wordlists/decode-owl.js","../lib.esm/wordlists/wordlist.js","../lib.esm/wordlists/wordlist-owl.js","../lib.esm/wordlists/lang-en.js","../lib.esm/wallet/mnemonic.js","../node_modules/aes-js/lib.esm/aes.js","../node_modules/aes-js/lib.esm/mode.js","../node_modules/aes-js/lib.esm/mode-cbc.js","../node_modules/aes-js/lib.esm/mode-ctr.js","../node_modules/aes-js/lib.esm/padding.js","../lib.esm/wallet/utils.js","../lib.esm/wallet/json-keystore.js","../lib.esm/wallet/hdwallet.js","../lib.esm/wallet/json-crowdsale.js","../lib.esm/wallet/wallet.js","../lib.esm/wordlists/bit-reader.js","../lib.esm/wordlists/decode-owla.js","../lib.esm/wordlists/wordlist-owla.js","../lib.esm/wordlists/wordlists-browser.js","../lib.esm/ethers.js"],"sourcesContent":["/* Do NOT modify this file; see /src.ts/_admin/update-version.ts */\n/**\n * The current version of Ethers.\n */\nexport const version = \"6.16.0\";\n//# sourceMappingURL=_version.js.map","/**\n * Property helper functions.\n *\n * @_subsection api/utils:Properties [about-properties]\n */\nfunction checkType(value, type, name) {\n const types = type.split(\"|\").map(t => t.trim());\n for (let i = 0; i < types.length; i++) {\n switch (type) {\n case \"any\":\n return;\n case \"bigint\":\n case \"boolean\":\n case \"number\":\n case \"string\":\n if (typeof (value) === type) {\n return;\n }\n }\n }\n const error = new Error(`invalid value for type ${type}`);\n error.code = \"INVALID_ARGUMENT\";\n error.argument = `value.${name}`;\n error.value = value;\n throw error;\n}\n/**\n * Resolves to a new object that is a copy of %%value%%, but with all\n * values resolved.\n */\nexport async function resolveProperties(value) {\n const keys = Object.keys(value);\n const results = await Promise.all(keys.map((k) => Promise.resolve(value[k])));\n return results.reduce((accum, v, index) => {\n accum[keys[index]] = v;\n return accum;\n }, {});\n}\n/**\n * Assigns the %%values%% to %%target%% as read-only values.\n *\n * It %%types%% is specified, the values are checked.\n */\nexport function defineProperties(target, values, types) {\n for (let key in values) {\n let value = values[key];\n const type = (types ? types[key] : null);\n if (type) {\n checkType(value, type, key);\n }\n Object.defineProperty(target, key, { enumerable: true, value, writable: false });\n }\n}\n//# sourceMappingURL=properties.js.map","/**\n * All errors in ethers include properties to ensure they are both\n * human-readable (i.e. ``.message``) and machine-readable (i.e. ``.code``).\n *\n * The [[isError]] function can be used to check the error ``code`` and\n * provide a type guard for the properties present on that error interface.\n *\n * @_section: api/utils/errors:Errors [about-errors]\n */\nimport { version } from \"../_version.js\";\nimport { defineProperties } from \"./properties.js\";\nfunction stringify(value, seen) {\n if (value == null) {\n return \"null\";\n }\n if (seen == null) {\n seen = new Set();\n }\n if (typeof (value) === \"object\") {\n if (seen.has(value)) {\n return \"[Circular]\";\n }\n seen.add(value);\n }\n if (Array.isArray(value)) {\n return \"[ \" + (value.map((v) => stringify(v, seen))).join(\", \") + \" ]\";\n }\n if (value instanceof Uint8Array) {\n const HEX = \"0123456789abcdef\";\n let result = \"0x\";\n for (let i = 0; i < value.length; i++) {\n result += HEX[value[i] >> 4];\n result += HEX[value[i] & 0xf];\n }\n return result;\n }\n if (typeof (value) === \"object\" && typeof (value.toJSON) === \"function\") {\n return stringify(value.toJSON(), seen);\n }\n switch (typeof (value)) {\n case \"boolean\":\n case \"number\":\n case \"symbol\":\n return value.toString();\n case \"bigint\":\n return BigInt(value).toString();\n case \"string\":\n return JSON.stringify(value);\n case \"object\": {\n const keys = Object.keys(value);\n keys.sort();\n return \"{ \" + keys.map((k) => `${stringify(k, seen)}: ${stringify(value[k], seen)}`).join(\", \") + \" }\";\n }\n }\n return `[ COULD NOT SERIALIZE ]`;\n}\n/**\n * Returns true if the %%error%% matches an error thrown by ethers\n * that matches the error %%code%%.\n *\n * In TypeScript environments, this can be used to check that %%error%%\n * matches an EthersError type, which means the expected properties will\n * be set.\n *\n * @See [ErrorCodes](api:ErrorCode)\n * @example\n * try {\n * // code....\n * } catch (e) {\n * if (isError(e, \"CALL_EXCEPTION\")) {\n * // The Type Guard has validated this object\n * console.log(e.data);\n * }\n * }\n */\nexport function isError(error, code) {\n return (error && error.code === code);\n}\n/**\n * Returns true if %%error%% is a [[CallExceptionError].\n */\nexport function isCallException(error) {\n return isError(error, \"CALL_EXCEPTION\");\n}\n/**\n * Returns a new Error configured to the format ethers emits errors, with\n * the %%message%%, [[api:ErrorCode]] %%code%% and additional properties\n * for the corresponding EthersError.\n *\n * Each error in ethers includes the version of ethers, a\n * machine-readable [[ErrorCode]], and depending on %%code%%, additional\n * required properties. The error message will also include the %%message%%,\n * ethers version, %%code%% and all additional properties, serialized.\n */\nexport function makeError(message, code, info) {\n let shortMessage = message;\n {\n const details = [];\n if (info) {\n if (\"message\" in info || \"code\" in info || \"name\" in info) {\n throw new Error(`value will overwrite populated values: ${stringify(info)}`);\n }\n for (const key in info) {\n if (key === \"shortMessage\") {\n continue;\n }\n const value = (info[key]);\n // try {\n details.push(key + \"=\" + stringify(value));\n // } catch (error: any) {\n // console.log(\"MMM\", error.message);\n // details.push(key + \"=[could not serialize object]\");\n // }\n }\n }\n details.push(`code=${code}`);\n details.push(`version=${version}`);\n if (details.length) {\n message += \" (\" + details.join(\", \") + \")\";\n }\n }\n let error;\n switch (code) {\n case \"INVALID_ARGUMENT\":\n error = new TypeError(message);\n break;\n case \"NUMERIC_FAULT\":\n case \"BUFFER_OVERRUN\":\n error = new RangeError(message);\n break;\n default:\n error = new Error(message);\n }\n defineProperties(error, { code });\n if (info) {\n Object.assign(error, info);\n }\n if (error.shortMessage == null) {\n defineProperties(error, { shortMessage });\n }\n return error;\n}\n/**\n * Throws an EthersError with %%message%%, %%code%% and additional error\n * %%info%% when %%check%% is falsish..\n *\n * @see [[api:makeError]]\n */\nexport function assert(check, message, code, info) {\n if (!check) {\n throw makeError(message, code, info);\n }\n}\n/**\n * A simple helper to simply ensuring provided arguments match expected\n * constraints, throwing if not.\n *\n * In TypeScript environments, the %%check%% has been asserted true, so\n * any further code does not need additional compile-time checks.\n */\nexport function assertArgument(check, message, name, value) {\n assert(check, message, \"INVALID_ARGUMENT\", { argument: name, value: value });\n}\nexport function assertArgumentCount(count, expectedCount, message) {\n if (message == null) {\n message = \"\";\n }\n if (message) {\n message = \": \" + message;\n }\n assert(count >= expectedCount, \"missing argument\" + message, \"MISSING_ARGUMENT\", {\n count: count,\n expectedCount: expectedCount\n });\n assert(count <= expectedCount, \"too many arguments\" + message, \"UNEXPECTED_ARGUMENT\", {\n count: count,\n expectedCount: expectedCount\n });\n}\nconst _normalizeForms = [\"NFD\", \"NFC\", \"NFKD\", \"NFKC\"].reduce((accum, form) => {\n try {\n // General test for normalize\n /* c8 ignore start */\n if (\"test\".normalize(form) !== \"test\") {\n throw new Error(\"bad\");\n }\n ;\n /* c8 ignore stop */\n if (form === \"NFD\") {\n const check = String.fromCharCode(0xe9).normalize(\"NFD\");\n const expected = String.fromCharCode(0x65, 0x0301);\n /* c8 ignore start */\n if (check !== expected) {\n throw new Error(\"broken\");\n }\n /* c8 ignore stop */\n }\n accum.push(form);\n }\n catch (error) { }\n return accum;\n}, []);\n/**\n * Throws if the normalization %%form%% is not supported.\n */\nexport function assertNormalize(form) {\n assert(_normalizeForms.indexOf(form) >= 0, \"platform missing String.prototype.normalize\", \"UNSUPPORTED_OPERATION\", {\n operation: \"String.prototype.normalize\", info: { form }\n });\n}\n/**\n * Many classes use file-scoped values to guard the constructor,\n * making it effectively private. This facilitates that pattern\n * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%,\n * throwing if not, indicating the %%className%% if provided.\n */\nexport function assertPrivate(givenGuard, guard, className) {\n if (className == null) {\n className = \"\";\n }\n if (givenGuard !== guard) {\n let method = className, operation = \"new\";\n if (className) {\n method += \".\";\n operation += \" \" + className;\n }\n assert(false, `private constructor; use ${method}from* methods`, \"UNSUPPORTED_OPERATION\", {\n operation\n });\n }\n}\n//# sourceMappingURL=errors.js.map","/**\n * Some data helpers.\n *\n *\n * @_subsection api/utils:Data Helpers [about-data]\n */\nimport { assert, assertArgument } from \"./errors.js\";\nfunction _getBytes(value, name, copy) {\n if (value instanceof Uint8Array) {\n if (copy) {\n return new Uint8Array(value);\n }\n return value;\n }\n if (typeof (value) === \"string\" && (value.length % 2) === 0 &&\n value.match(/^0x[0-9a-f]*$/i)) {\n const result = new Uint8Array((value.length - 2) / 2);\n let offset = 2;\n for (let i = 0; i < result.length; i++) {\n result[i] = parseInt(value.substring(offset, offset + 2), 16);\n offset += 2;\n }\n return result;\n }\n assertArgument(false, \"invalid BytesLike value\", name || \"value\", value);\n}\n/**\n * Get a typed Uint8Array for %%value%%. If already a Uint8Array\n * the original %%value%% is returned; if a copy is required use\n * [[getBytesCopy]].\n *\n * @see: getBytesCopy\n */\nexport function getBytes(value, name) {\n return _getBytes(value, name, false);\n}\n/**\n * Get a typed Uint8Array for %%value%%, creating a copy if necessary\n * to prevent any modifications of the returned value from being\n * reflected elsewhere.\n *\n * @see: getBytes\n */\nexport function getBytesCopy(value, name) {\n return _getBytes(value, name, true);\n}\n/**\n * Returns true if %%value%% is a valid [[HexString]].\n *\n * If %%length%% is ``true`` or a //number//, it also checks that\n * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//)\n * bytes of data (e.g. ``0x1234`` is 2 bytes).\n */\nexport function isHexString(value, length) {\n if (typeof (value) !== \"string\" || !value.match(/^0x[0-9A-Fa-f]*$/)) {\n return false;\n }\n if (typeof (length) === \"number\" && value.length !== 2 + 2 * length) {\n return false;\n }\n if (length === true && (value.length % 2) !== 0) {\n return false;\n }\n return true;\n}\n/**\n * Returns true if %%value%% is a valid representation of arbitrary\n * data (i.e. a valid [[DataHexString]] or a Uint8Array).\n */\nexport function isBytesLike(value) {\n return (isHexString(value, true) || (value instanceof Uint8Array));\n}\nconst HexCharacters = \"0123456789abcdef\";\n/**\n * Returns a [[DataHexString]] representation of %%data%%.\n */\nexport function hexlify(data) {\n const bytes = getBytes(data);\n let result = \"0x\";\n for (let i = 0; i < bytes.length; i++) {\n const v = bytes[i];\n result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f];\n }\n return result;\n}\n/**\n * Returns a [[DataHexString]] by concatenating all values\n * within %%data%%.\n */\nexport function concat(datas) {\n return \"0x\" + datas.map((d) => hexlify(d).substring(2)).join(\"\");\n}\n/**\n * Returns the length of %%data%%, in bytes.\n */\nexport function dataLength(data) {\n if (isHexString(data, true)) {\n return (data.length - 2) / 2;\n }\n return getBytes(data).length;\n}\n/**\n * Returns a [[DataHexString]] by slicing %%data%% from the %%start%%\n * offset to the %%end%% offset.\n *\n * By default %%start%% is 0 and %%end%% is the length of %%data%%.\n */\nexport function dataSlice(data, start, end) {\n const bytes = getBytes(data);\n if (end != null && end > bytes.length) {\n assert(false, \"cannot slice beyond data bounds\", \"BUFFER_OVERRUN\", {\n buffer: bytes, length: bytes.length, offset: end\n });\n }\n return hexlify(bytes.slice((start == null) ? 0 : start, (end == null) ? bytes.length : end));\n}\n/**\n * Return the [[DataHexString]] result by stripping all **leading**\n ** zero bytes from %%data%%.\n */\nexport function stripZerosLeft(data) {\n let bytes = hexlify(data).substring(2);\n while (bytes.startsWith(\"00\")) {\n bytes = bytes.substring(2);\n }\n return \"0x\" + bytes;\n}\nfunction zeroPad(data, length, left) {\n const bytes = getBytes(data);\n assert(length >= bytes.length, \"padding exceeds data length\", \"BUFFER_OVERRUN\", {\n buffer: new Uint8Array(bytes),\n length: length,\n offset: length + 1\n });\n const result = new Uint8Array(length);\n result.fill(0);\n if (left) {\n result.set(bytes, length - bytes.length);\n }\n else {\n result.set(bytes, 0);\n }\n return hexlify(result);\n}\n/**\n * Return the [[DataHexString]] of %%data%% padded on the **left**\n * to %%length%% bytes.\n *\n * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is\n * thrown.\n *\n * This pads data the same as **values** are in Solidity\n * (e.g. ``uint128``).\n */\nexport function zeroPadValue(data, length) {\n return zeroPad(data, length, true);\n}\n/**\n * Return the [[DataHexString]] of %%data%% padded on the **right**\n * to %%length%% bytes.\n *\n * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is\n * thrown.\n *\n * This pads data the same as **bytes** are in Solidity\n * (e.g. ``bytes16``).\n */\nexport function zeroPadBytes(data, length) {\n return zeroPad(data, length, false);\n}\n//# sourceMappingURL=data.js.map","/**\n * Some mathematic operations.\n *\n * @_subsection: api/utils:Math Helpers [about-maths]\n */\nimport { hexlify, isBytesLike } from \"./data.js\";\nimport { assert, assertArgument } from \"./errors.js\";\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\n//const BN_Max256 = (BN_1 << BigInt(256)) - BN_1;\n// IEEE 754 support 53-bits of mantissa\nconst maxValue = 0x1fffffffffffff;\n/**\n * Convert %%value%% from a twos-compliment representation of %%width%%\n * bits to its value.\n *\n * If the highest bit is ``1``, the result will be negative.\n */\nexport function fromTwos(_value, _width) {\n const value = getUint(_value, \"value\");\n const width = BigInt(getNumber(_width, \"width\"));\n assert((value >> width) === BN_0, \"overflow\", \"NUMERIC_FAULT\", {\n operation: \"fromTwos\", fault: \"overflow\", value: _value\n });\n // Top bit set; treat as a negative value\n if (value >> (width - BN_1)) {\n const mask = (BN_1 << width) - BN_1;\n return -(((~value) & mask) + BN_1);\n }\n return value;\n}\n/**\n * Convert %%value%% to a twos-compliment representation of\n * %%width%% bits.\n *\n * The result will always be positive.\n */\nexport function toTwos(_value, _width) {\n let value = getBigInt(_value, \"value\");\n const width = BigInt(getNumber(_width, \"width\"));\n const limit = (BN_1 << (width - BN_1));\n if (value < BN_0) {\n value = -value;\n assert(value <= limit, \"too low\", \"NUMERIC_FAULT\", {\n operation: \"toTwos\", fault: \"overflow\", value: _value\n });\n const mask = (BN_1 << width) - BN_1;\n return ((~value) & mask) + BN_1;\n }\n else {\n assert(value < limit, \"too high\", \"NUMERIC_FAULT\", {\n operation: \"toTwos\", fault: \"overflow\", value: _value\n });\n }\n return value;\n}\n/**\n * Mask %%value%% with a bitmask of %%bits%% ones.\n */\nexport function mask(_value, _bits) {\n const value = getUint(_value, \"value\");\n const bits = BigInt(getNumber(_bits, \"bits\"));\n return value & ((BN_1 << bits) - BN_1);\n}\n/**\n * Gets a BigInt from %%value%%. If it is an invalid value for\n * a BigInt, then an ArgumentError will be thrown for %%name%%.\n */\nexport function getBigInt(value, name) {\n switch (typeof (value)) {\n case \"bigint\": return value;\n case \"number\":\n assertArgument(Number.isInteger(value), \"underflow\", name || \"value\", value);\n assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n return BigInt(value);\n case \"string\":\n try {\n if (value === \"\") {\n throw new Error(\"empty string\");\n }\n if (value[0] === \"-\" && value[1] !== \"-\") {\n return -BigInt(value.substring(1));\n }\n return BigInt(value);\n }\n catch (e) {\n assertArgument(false, `invalid BigNumberish string: ${e.message}`, name || \"value\", value);\n }\n }\n assertArgument(false, \"invalid BigNumberish value\", name || \"value\", value);\n}\n/**\n * Returns %%value%% as a bigint, validating it is valid as a bigint\n * value and that it is positive.\n */\nexport function getUint(value, name) {\n const result = getBigInt(value, name);\n assert(result >= BN_0, \"unsigned value cannot be negative\", \"NUMERIC_FAULT\", {\n fault: \"overflow\", operation: \"getUint\", value\n });\n return result;\n}\nconst Nibbles = \"0123456789abcdef\";\n/*\n * Converts %%value%% to a BigInt. If %%value%% is a Uint8Array, it\n * is treated as Big Endian data.\n */\nexport function toBigInt(value) {\n if (value instanceof Uint8Array) {\n let result = \"0x0\";\n for (const v of value) {\n result += Nibbles[v >> 4];\n result += Nibbles[v & 0x0f];\n }\n return BigInt(result);\n }\n return getBigInt(value);\n}\n/**\n * Gets a //number// from %%value%%. If it is an invalid value for\n * a //number//, then an ArgumentError will be thrown for %%name%%.\n */\nexport function getNumber(value, name) {\n switch (typeof (value)) {\n case \"bigint\":\n assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n return Number(value);\n case \"number\":\n assertArgument(Number.isInteger(value), \"underflow\", name || \"value\", value);\n assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n return value;\n case \"string\":\n try {\n if (value === \"\") {\n throw new Error(\"empty string\");\n }\n return getNumber(BigInt(value), name);\n }\n catch (e) {\n assertArgument(false, `invalid numeric string: ${e.message}`, name || \"value\", value);\n }\n }\n assertArgument(false, \"invalid numeric value\", name || \"value\", value);\n}\n/**\n * Converts %%value%% to a number. If %%value%% is a Uint8Array, it\n * is treated as Big Endian data. Throws if the value is not safe.\n */\nexport function toNumber(value) {\n return getNumber(toBigInt(value));\n}\n/**\n * Converts %%value%% to a Big Endian hexstring, optionally padded to\n * %%width%% bytes.\n */\nexport function toBeHex(_value, _width) {\n const value = getUint(_value, \"value\");\n let result = value.toString(16);\n if (_width == null) {\n // Ensure the value is of even length\n if (result.length % 2) {\n result = \"0\" + result;\n }\n }\n else {\n const width = getNumber(_width, \"width\");\n // Special case when both value and width are 0 (see: #5025)\n if (width === 0 && value === BN_0) {\n return \"0x\";\n }\n assert(width * 2 >= result.length, `value exceeds width (${width} bytes)`, \"NUMERIC_FAULT\", {\n operation: \"toBeHex\",\n fault: \"overflow\",\n value: _value\n });\n // Pad the value to the required width\n while (result.length < (width * 2)) {\n result = \"0\" + result;\n }\n }\n return \"0x\" + result;\n}\n/**\n * Converts %%value%% to a Big Endian Uint8Array.\n */\nexport function toBeArray(_value, _width) {\n const value = getUint(_value, \"value\");\n if (value === BN_0) {\n const width = (_width != null) ? getNumber(_width, \"width\") : 0;\n return new Uint8Array(width);\n }\n let hex = value.toString(16);\n if (hex.length % 2) {\n hex = \"0\" + hex;\n }\n if (_width != null) {\n const width = getNumber(_width, \"width\");\n while (hex.length < (width * 2)) {\n hex = \"00\" + hex;\n }\n assert((width * 2) === hex.length, `value exceeds width (${width} bytes)`, \"NUMERIC_FAULT\", {\n operation: \"toBeArray\",\n fault: \"overflow\",\n value: _value\n });\n }\n const result = new Uint8Array(hex.length / 2);\n for (let i = 0; i < result.length; i++) {\n const offset = i * 2;\n result[i] = parseInt(hex.substring(offset, offset + 2), 16);\n }\n return result;\n}\n/**\n * Returns a [[HexString]] for %%value%% safe to use as a //Quantity//.\n *\n * A //Quantity// does not have and leading 0 values unless the value is\n * the literal value `0x0`. This is most commonly used for JSSON-RPC\n * numeric values.\n */\nexport function toQuantity(value) {\n let result = hexlify(isBytesLike(value) ? value : toBeArray(value)).substring(2);\n while (result.startsWith(\"0\")) {\n result = result.substring(1);\n }\n if (result === \"\") {\n result = \"0\";\n }\n return \"0x\" + result;\n}\n//# sourceMappingURL=maths.js.map","/**\n * The [Base58 Encoding](link-base58) scheme allows a **numeric** value\n * to be encoded as a compact string using a radix of 58 using only\n * alpha-numeric characters. Confusingly similar characters are omitted\n * (i.e. ``\"l0O\"``).\n *\n * Note that Base58 encodes a **numeric** value, not arbitrary bytes,\n * since any zero-bytes on the left would get removed. To mitigate this\n * issue most schemes that use Base58 choose specific high-order values\n * to ensure non-zero prefixes.\n *\n * @_subsection: api/utils:Base58 Encoding [about-base58]\n */\nimport { getBytes } from \"./data.js\";\nimport { assertArgument } from \"./errors.js\";\nimport { toBigInt } from \"./maths.js\";\nconst Alphabet = \"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz\";\nlet Lookup = null;\nfunction getAlpha(letter) {\n if (Lookup == null) {\n Lookup = {};\n for (let i = 0; i < Alphabet.length; i++) {\n Lookup[Alphabet[i]] = BigInt(i);\n }\n }\n const result = Lookup[letter];\n assertArgument(result != null, `invalid base58 value`, \"letter\", letter);\n return result;\n}\nconst BN_0 = BigInt(0);\nconst BN_58 = BigInt(58);\n/**\n * Encode %%value%% as a Base58-encoded string.\n */\nexport function encodeBase58(_value) {\n const bytes = getBytes(_value);\n let value = toBigInt(bytes);\n let result = \"\";\n while (value) {\n result = Alphabet[Number(value % BN_58)] + result;\n value /= BN_58;\n }\n // Account for leading padding zeros\n for (let i = 0; i < bytes.length; i++) {\n if (bytes[i]) {\n break;\n }\n result = Alphabet[0] + result;\n }\n return result;\n}\n/**\n * Decode the Base58-encoded %%value%%.\n */\nexport function decodeBase58(value) {\n let result = BN_0;\n for (let i = 0; i < value.length; i++) {\n result *= BN_58;\n result += getAlpha(value[i]);\n }\n return result;\n}\n//# sourceMappingURL=base58.js.map","// utils/base64-browser\nimport { getBytes } from \"./data.js\";\nexport function decodeBase64(textData) {\n textData = atob(textData);\n const data = new Uint8Array(textData.length);\n for (let i = 0; i < textData.length; i++) {\n data[i] = textData.charCodeAt(i);\n }\n return getBytes(data);\n}\nexport function encodeBase64(_data) {\n const data = getBytes(_data);\n let textData = \"\";\n for (let i = 0; i < data.length; i++) {\n textData += String.fromCharCode(data[i]);\n }\n return btoa(textData);\n}\n//# sourceMappingURL=base64-browser.js.map","/**\n * Events allow for applications to use the observer pattern, which\n * allows subscribing and publishing events, outside the normal\n * execution paths.\n *\n * @_section api/utils/events:Events [about-events]\n */\nimport { defineProperties } from \"./properties.js\";\n/**\n * When an [[EventEmitterable]] triggers a [[Listener]], the\n * callback always ahas one additional argument passed, which is\n * an **EventPayload**.\n */\nexport class EventPayload {\n /**\n * The event filter.\n */\n filter;\n /**\n * The **EventEmitterable**.\n */\n emitter;\n #listener;\n /**\n * Create a new **EventPayload** for %%emitter%% with\n * the %%listener%% and for %%filter%%.\n */\n constructor(emitter, listener, filter) {\n this.#listener = listener;\n defineProperties(this, { emitter, filter });\n }\n /**\n * Unregister the triggered listener for future events.\n */\n async removeListener() {\n if (this.#listener == null) {\n return;\n }\n await this.emitter.off(this.filter, this.#listener);\n }\n}\n//# sourceMappingURL=events.js.map","/**\n * Using strings in Ethereum (or any security-basd system) requires\n * additional care. These utilities attempt to mitigate some of the\n * safety issues as well as provide the ability to recover and analyse\n * strings.\n *\n * @_subsection api/utils:Strings and UTF-8 [about-strings]\n */\nimport { getBytes } from \"./data.js\";\nimport { assertArgument, assertNormalize } from \"./errors.js\";\nfunction errorFunc(reason, offset, bytes, output, badCodepoint) {\n assertArgument(false, `invalid codepoint at offset ${offset}; ${reason}`, \"bytes\", bytes);\n}\nfunction ignoreFunc(reason, offset, bytes, output, badCodepoint) {\n // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes\n if (reason === \"BAD_PREFIX\" || reason === \"UNEXPECTED_CONTINUE\") {\n let i = 0;\n for (let o = offset + 1; o < bytes.length; o++) {\n if (bytes[o] >> 6 !== 0x02) {\n break;\n }\n i++;\n }\n return i;\n }\n // This byte runs us past the end of the string, so just jump to the end\n // (but the first byte was read already read and therefore skipped)\n if (reason === \"OVERRUN\") {\n return bytes.length - offset - 1;\n }\n // Nothing to skip\n return 0;\n}\nfunction replaceFunc(reason, offset, bytes, output, badCodepoint) {\n // Overlong representations are otherwise \"valid\" code points; just non-deistingtished\n if (reason === \"OVERLONG\") {\n assertArgument(typeof (badCodepoint) === \"number\", \"invalid bad code point for replacement\", \"badCodepoint\", badCodepoint);\n output.push(badCodepoint);\n return 0;\n }\n // Put the replacement character into the output\n output.push(0xfffd);\n // Otherwise, process as if ignoring errors\n return ignoreFunc(reason, offset, bytes, output, badCodepoint);\n}\n/**\n * A handful of popular, built-in UTF-8 error handling strategies.\n *\n * **``\"error\"``** - throws on ANY illegal UTF-8 sequence or\n * non-canonical (overlong) codepoints (this is the default)\n *\n * **``\"ignore\"``** - silently drops any illegal UTF-8 sequence\n * and accepts non-canonical (overlong) codepoints\n *\n * **``\"replace\"``** - replace any illegal UTF-8 sequence with the\n * UTF-8 replacement character (i.e. ``\"\\\\ufffd\"``) and accepts\n * non-canonical (overlong) codepoints\n *\n * @returns: Record<\"error\" | \"ignore\" | \"replace\", Utf8ErrorFunc>\n */\nexport const Utf8ErrorFuncs = Object.freeze({\n error: errorFunc,\n ignore: ignoreFunc,\n replace: replaceFunc\n});\n// http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499\nfunction getUtf8CodePoints(_bytes, onError) {\n if (onError == null) {\n onError = Utf8ErrorFuncs.error;\n }\n const bytes = getBytes(_bytes, \"bytes\");\n const result = [];\n let i = 0;\n // Invalid bytes are ignored\n while (i < bytes.length) {\n const c = bytes[i++];\n // 0xxx xxxx\n if (c >> 7 === 0) {\n result.push(c);\n continue;\n }\n // Multibyte; how many bytes left for this character?\n let extraLength = null;\n let overlongMask = null;\n // 110x xxxx 10xx xxxx\n if ((c & 0xe0) === 0xc0) {\n extraLength = 1;\n overlongMask = 0x7f;\n // 1110 xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf0) === 0xe0) {\n extraLength = 2;\n overlongMask = 0x7ff;\n // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf8) === 0xf0) {\n extraLength = 3;\n overlongMask = 0xffff;\n }\n else {\n if ((c & 0xc0) === 0x80) {\n i += onError(\"UNEXPECTED_CONTINUE\", i - 1, bytes, result);\n }\n else {\n i += onError(\"BAD_PREFIX\", i - 1, bytes, result);\n }\n continue;\n }\n // Do we have enough bytes in our data?\n if (i - 1 + extraLength >= bytes.length) {\n i += onError(\"OVERRUN\", i - 1, bytes, result);\n continue;\n }\n // Remove the length prefix from the char\n let res = c & ((1 << (8 - extraLength - 1)) - 1);\n for (let j = 0; j < extraLength; j++) {\n let nextChar = bytes[i];\n // Invalid continuation byte\n if ((nextChar & 0xc0) != 0x80) {\n i += onError(\"MISSING_CONTINUE\", i, bytes, result);\n res = null;\n break;\n }\n ;\n res = (res << 6) | (nextChar & 0x3f);\n i++;\n }\n // See above loop for invalid continuation byte\n if (res === null) {\n continue;\n }\n // Maximum code point\n if (res > 0x10ffff) {\n i += onError(\"OUT_OF_RANGE\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Reserved for UTF-16 surrogate halves\n if (res >= 0xd800 && res <= 0xdfff) {\n i += onError(\"UTF16_SURROGATE\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Check for overlong sequences (more bytes than needed)\n if (res <= overlongMask) {\n i += onError(\"OVERLONG\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n result.push(res);\n }\n return result;\n}\n// http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array\n/**\n * Returns the UTF-8 byte representation of %%str%%.\n *\n * If %%form%% is specified, the string is normalized.\n */\nexport function toUtf8Bytes(str, form) {\n assertArgument(typeof (str) === \"string\", \"invalid string value\", \"str\", str);\n if (form != null) {\n assertNormalize(form);\n str = str.normalize(form);\n }\n let result = [];\n for (let i = 0; i < str.length; i++) {\n const c = str.charCodeAt(i);\n if (c < 0x80) {\n result.push(c);\n }\n else if (c < 0x800) {\n result.push((c >> 6) | 0xc0);\n result.push((c & 0x3f) | 0x80);\n }\n else if ((c & 0xfc00) == 0xd800) {\n i++;\n const c2 = str.charCodeAt(i);\n assertArgument(i < str.length && ((c2 & 0xfc00) === 0xdc00), \"invalid surrogate pair\", \"str\", str);\n // Surrogate Pair\n const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff);\n result.push((pair >> 18) | 0xf0);\n result.push(((pair >> 12) & 0x3f) | 0x80);\n result.push(((pair >> 6) & 0x3f) | 0x80);\n result.push((pair & 0x3f) | 0x80);\n }\n else {\n result.push((c >> 12) | 0xe0);\n result.push(((c >> 6) & 0x3f) | 0x80);\n result.push((c & 0x3f) | 0x80);\n }\n }\n return new Uint8Array(result);\n}\n;\n//export \nfunction _toUtf8String(codePoints) {\n return codePoints.map((codePoint) => {\n if (codePoint <= 0xffff) {\n return String.fromCharCode(codePoint);\n }\n codePoint -= 0x10000;\n return String.fromCharCode((((codePoint >> 10) & 0x3ff) + 0xd800), ((codePoint & 0x3ff) + 0xdc00));\n }).join(\"\");\n}\n/**\n * Returns the string represented by the UTF-8 data %%bytes%%.\n *\n * When %%onError%% function is specified, it is called on UTF-8\n * errors allowing recovery using the [[Utf8ErrorFunc]] API.\n * (default: [error](Utf8ErrorFuncs))\n */\nexport function toUtf8String(bytes, onError) {\n return _toUtf8String(getUtf8CodePoints(bytes, onError));\n}\n/**\n * Returns the UTF-8 code-points for %%str%%.\n *\n * If %%form%% is specified, the string is normalized.\n */\nexport function toUtf8CodePoints(str, form) {\n return getUtf8CodePoints(toUtf8Bytes(str, form));\n}\n//# sourceMappingURL=utf8.js.map","import { assert, makeError } from \"./errors.js\";\nexport function createGetUrl(options) {\n async function getUrl(req, _signal) {\n assert(_signal == null || !_signal.cancelled, \"request cancelled before sending\", \"CANCELLED\");\n const protocol = req.url.split(\":\")[0].toLowerCase();\n assert(protocol === \"http\" || protocol === \"https\", `unsupported protocol ${protocol}`, \"UNSUPPORTED_OPERATION\", {\n info: { protocol },\n operation: \"request\"\n });\n assert(protocol === \"https\" || !req.credentials || req.allowInsecureAuthentication, \"insecure authorized connections unsupported\", \"UNSUPPORTED_OPERATION\", {\n operation: \"request\"\n });\n let error = null;\n const controller = new AbortController();\n const timer = setTimeout(() => {\n error = makeError(\"request timeout\", \"TIMEOUT\");\n controller.abort();\n }, req.timeout);\n if (_signal) {\n _signal.addListener(() => {\n error = makeError(\"request cancelled\", \"CANCELLED\");\n controller.abort();\n });\n }\n const init = Object.assign({}, options, {\n method: req.method,\n headers: new Headers(Array.from(req)),\n body: req.body || undefined,\n signal: controller.signal\n });\n let resp;\n try {\n resp = await fetch(req.url, init);\n }\n catch (_error) {\n clearTimeout(timer);\n if (error) {\n throw error;\n }\n throw _error;\n }\n clearTimeout(timer);\n const headers = {};\n resp.headers.forEach((value, key) => {\n headers[key.toLowerCase()] = value;\n });\n const respBody = await resp.arrayBuffer();\n const body = (respBody == null) ? null : new Uint8Array(respBody);\n return {\n statusCode: resp.status,\n statusMessage: resp.statusText,\n headers, body\n };\n }\n return getUrl;\n}\n// @TODO: remove in v7; provided for backwards compat\nconst defaultGetUrl = createGetUrl({});\nexport async function getUrl(req, _signal) {\n return defaultGetUrl(req, _signal);\n}\n//# sourceMappingURL=geturl-browser.js.map","/**\n * Fetching content from the web is environment-specific, so Ethers\n * provides an abstraction that each environment can implement to provide\n * this service.\n *\n * On [Node.js](link-node), the ``http`` and ``https`` libs are used to\n * create a request object, register event listeners and process data\n * and populate the [[FetchResponse]].\n *\n * In a browser, the [DOM fetch](link-js-fetch) is used, and the resulting\n * ``Promise`` is waited on to retrieve the payload.\n *\n * The [[FetchRequest]] is responsible for handling many common situations,\n * such as redirects, server throttling, authentication, etc.\n *\n * It also handles common gateways, such as IPFS and data URIs.\n *\n * @_section api/utils/fetching:Fetching Web Content [about-fetch]\n */\nimport { decodeBase64, encodeBase64 } from \"./base64.js\";\nimport { hexlify } from \"./data.js\";\nimport { assert, assertArgument } from \"./errors.js\";\nimport { defineProperties } from \"./properties.js\";\nimport { toUtf8Bytes, toUtf8String } from \"./utf8.js\";\nimport { createGetUrl } from \"./geturl.js\";\nconst MAX_ATTEMPTS = 12;\nconst SLOT_INTERVAL = 250;\n// The global FetchGetUrlFunc implementation.\nlet defaultGetUrlFunc = createGetUrl();\nconst reData = new RegExp(\"^data:([^;:]*)?(;base64)?,(.*)$\", \"i\");\nconst reIpfs = new RegExp(\"^ipfs:/\\/(ipfs/)?(.*)$\", \"i\");\n// If locked, new Gateways cannot be added\nlet locked = false;\n// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs\nasync function dataGatewayFunc(url, signal) {\n try {\n const match = url.match(reData);\n if (!match) {\n throw new Error(\"invalid data\");\n }\n return new FetchResponse(200, \"OK\", {\n \"content-type\": (match[1] || \"text/plain\"),\n }, (match[2] ? decodeBase64(match[3]) : unpercent(match[3])));\n }\n catch (error) {\n return new FetchResponse(599, \"BAD REQUEST (invalid data: URI)\", {}, null, new FetchRequest(url));\n }\n}\n/**\n * Returns a [[FetchGatewayFunc]] for fetching content from a standard\n * IPFS gateway hosted at %%baseUrl%%.\n */\nfunction getIpfsGatewayFunc(baseUrl) {\n async function gatewayIpfs(url, signal) {\n try {\n const match = url.match(reIpfs);\n if (!match) {\n throw new Error(\"invalid link\");\n }\n return new FetchRequest(`${baseUrl}${match[2]}`);\n }\n catch (error) {\n return new FetchResponse(599, \"BAD REQUEST (invalid IPFS URI)\", {}, null, new FetchRequest(url));\n }\n }\n return gatewayIpfs;\n}\nconst Gateways = {\n \"data\": dataGatewayFunc,\n \"ipfs\": getIpfsGatewayFunc(\"https:/\\/gateway.ipfs.io/ipfs/\")\n};\nconst fetchSignals = new WeakMap();\n/**\n * @_ignore\n */\nexport class FetchCancelSignal {\n #listeners;\n #cancelled;\n constructor(request) {\n this.#listeners = [];\n this.#cancelled = false;\n fetchSignals.set(request, () => {\n if (this.#cancelled) {\n return;\n }\n this.#cancelled = true;\n for (const listener of this.#listeners) {\n setTimeout(() => { listener(); }, 0);\n }\n this.#listeners = [];\n });\n }\n addListener(listener) {\n assert(!this.#cancelled, \"singal already cancelled\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fetchCancelSignal.addCancelListener\"\n });\n this.#listeners.push(listener);\n }\n get cancelled() { return this.#cancelled; }\n checkSignal() {\n assert(!this.cancelled, \"cancelled\", \"CANCELLED\", {});\n }\n}\n// Check the signal, throwing if it is cancelled\nfunction checkSignal(signal) {\n if (signal == null) {\n throw new Error(\"missing signal; should not happen\");\n }\n signal.checkSignal();\n return signal;\n}\n/**\n * Represents a request for a resource using a URI.\n *\n * By default, the supported schemes are ``HTTP``, ``HTTPS``, ``data:``,\n * and ``IPFS:``.\n *\n * Additional schemes can be added globally using [[registerGateway]].\n *\n * @example:\n * req = new FetchRequest(\"https://www.ricmoo.com\")\n * resp = await req.send()\n * resp.body.length\n * //_result:\n */\nexport class FetchRequest {\n #allowInsecure;\n #gzip;\n #headers;\n #method;\n #timeout;\n #url;\n #body;\n #bodyType;\n #creds;\n // Hooks\n #preflight;\n #process;\n #retry;\n #signal;\n #throttle;\n #getUrlFunc;\n /**\n * The fetch URL to request.\n */\n get url() { return this.#url; }\n set url(url) {\n this.#url = String(url);\n }\n /**\n * The fetch body, if any, to send as the request body. //(default: null)//\n *\n * When setting a body, the intrinsic ``Content-Type`` is automatically\n * set and will be used if **not overridden** by setting a custom\n * header.\n *\n * If %%body%% is null, the body is cleared (along with the\n * intrinsic ``Content-Type``).\n *\n * If %%body%% is a string, the intrinsic ``Content-Type`` is set to\n * ``text/plain``.\n *\n * If %%body%% is a Uint8Array, the intrinsic ``Content-Type`` is set to\n * ``application/octet-stream``.\n *\n * If %%body%% is any other object, the intrinsic ``Content-Type`` is\n * set to ``application/json``.\n */\n get body() {\n if (this.#body == null) {\n return null;\n }\n return new Uint8Array(this.#body);\n }\n set body(body) {\n if (body == null) {\n this.#body = undefined;\n this.#bodyType = undefined;\n }\n else if (typeof (body) === \"string\") {\n this.#body = toUtf8Bytes(body);\n this.#bodyType = \"text/plain\";\n }\n else if (body instanceof Uint8Array) {\n this.#body = body;\n this.#bodyType = \"application/octet-stream\";\n }\n else if (typeof (body) === \"object\") {\n this.#body = toUtf8Bytes(JSON.stringify(body));\n this.#bodyType = \"application/json\";\n }\n else {\n throw new Error(\"invalid body\");\n }\n }\n /**\n * Returns true if the request has a body.\n */\n hasBody() {\n return (this.#body != null);\n }\n /**\n * The HTTP method to use when requesting the URI. If no method\n * has been explicitly set, then ``GET`` is used if the body is\n * null and ``POST`` otherwise.\n */\n get method() {\n if (this.#method) {\n return this.#method;\n }\n if (this.hasBody()) {\n return \"POST\";\n }\n return \"GET\";\n }\n set method(method) {\n if (method == null) {\n method = \"\";\n }\n this.#method = String(method).toUpperCase();\n }\n /**\n * The headers that will be used when requesting the URI. All\n * keys are lower-case.\n *\n * This object is a copy, so any changes will **NOT** be reflected\n * in the ``FetchRequest``.\n *\n * To set a header entry, use the ``setHeader`` method.\n */\n get headers() {\n const headers = Object.assign({}, this.#headers);\n if (this.#creds) {\n headers[\"authorization\"] = `Basic ${encodeBase64(toUtf8Bytes(this.#creds))}`;\n }\n ;\n if (this.allowGzip) {\n headers[\"accept-encoding\"] = \"gzip\";\n }\n if (headers[\"content-type\"] == null && this.#bodyType) {\n headers[\"content-type\"] = this.#bodyType;\n }\n if (this.body) {\n headers[\"content-length\"] = String(this.body.length);\n }\n return headers;\n }\n /**\n * Get the header for %%key%%, ignoring case.\n */\n getHeader(key) {\n return this.headers[key.toLowerCase()];\n }\n /**\n * Set the header for %%key%% to %%value%%. All values are coerced\n * to a string.\n */\n setHeader(key, value) {\n this.#headers[String(key).toLowerCase()] = String(value);\n }\n /**\n * Clear all headers, resetting all intrinsic headers.\n */\n clearHeaders() {\n this.#headers = {};\n }\n [Symbol.iterator]() {\n const headers = this.headers;\n const keys = Object.keys(headers);\n let index = 0;\n return {\n next: () => {\n if (index < keys.length) {\n const key = keys[index++];\n return {\n value: [key, headers[key]], done: false\n };\n }\n return { value: undefined, done: true };\n }\n };\n }\n /**\n * The value that will be sent for the ``Authorization`` header.\n *\n * To set the credentials, use the ``setCredentials`` method.\n */\n get credentials() {\n return this.#creds || null;\n }\n /**\n * Sets an ``Authorization`` for %%username%% with %%password%%.\n */\n setCredentials(username, password) {\n assertArgument(!username.match(/:/), \"invalid basic authentication username\", \"username\", \"[REDACTED]\");\n this.#creds = `${username}:${password}`;\n }\n /**\n * Enable and request gzip-encoded responses. The response will\n * automatically be decompressed. //(default: true)//\n */\n get allowGzip() {\n return this.#gzip;\n }\n set allowGzip(value) {\n this.#gzip = !!value;\n }\n /**\n * Allow ``Authentication`` credentials to be sent over insecure\n * channels. //(default: false)//\n */\n get allowInsecureAuthentication() {\n return !!this.#allowInsecure;\n }\n set allowInsecureAuthentication(value) {\n this.#allowInsecure = !!value;\n }\n /**\n * The timeout (in milliseconds) to wait for a complete response.\n * //(default: 5 minutes)//\n */\n get timeout() { return this.#timeout; }\n set timeout(timeout) {\n assertArgument(timeout >= 0, \"timeout must be non-zero\", \"timeout\", timeout);\n this.#timeout = timeout;\n }\n /**\n * This function is called prior to each request, for example\n * during a redirection or retry in case of server throttling.\n *\n * This offers an opportunity to populate headers or update\n * content before sending a request.\n */\n get preflightFunc() {\n return this.#preflight || null;\n }\n set preflightFunc(preflight) {\n this.#preflight = preflight;\n }\n /**\n * This function is called after each response, offering an\n * opportunity to provide client-level throttling or updating\n * response data.\n *\n * Any error thrown in this causes the ``send()`` to throw.\n *\n * To schedule a retry attempt (assuming the maximum retry limit\n * has not been reached), use [[response.throwThrottleError]].\n */\n get processFunc() {\n return this.#process || null;\n }\n set processFunc(process) {\n this.#process = process;\n }\n /**\n * This function is called on each retry attempt.\n */\n get retryFunc() {\n return this.#retry || null;\n }\n set retryFunc(retry) {\n this.#retry = retry;\n }\n /**\n * This function is called to fetch content from HTTP and\n * HTTPS URLs and is platform specific (e.g. nodejs vs\n * browsers).\n *\n * This is by default the currently registered global getUrl\n * function, which can be changed using [[registerGetUrl]].\n * If this has been set, setting is to ``null`` will cause\n * this FetchRequest (and any future clones) to revert back to\n * using the currently registered global getUrl function.\n *\n * Setting this is generally not necessary, but may be useful\n * for developers that wish to intercept requests or to\n * configurege a proxy or other agent.\n */\n get getUrlFunc() {\n return this.#getUrlFunc || defaultGetUrlFunc;\n }\n set getUrlFunc(value) {\n this.#getUrlFunc = value;\n }\n /**\n * Create a new FetchRequest instance with default values.\n *\n * Once created, each property may be set before issuing a\n * ``.send()`` to make the request.\n */\n constructor(url) {\n this.#url = String(url);\n this.#allowInsecure = false;\n this.#gzip = true;\n this.#headers = {};\n this.#method = \"\";\n this.#timeout = 300000;\n this.#throttle = {\n slotInterval: SLOT_INTERVAL,\n maxAttempts: MAX_ATTEMPTS\n };\n this.#getUrlFunc = null;\n }\n toString() {\n return ``;\n }\n /**\n * Update the throttle parameters used to determine maximum\n * attempts and exponential-backoff properties.\n */\n setThrottleParams(params) {\n if (params.slotInterval != null) {\n this.#throttle.slotInterval = params.slotInterval;\n }\n if (params.maxAttempts != null) {\n this.#throttle.maxAttempts = params.maxAttempts;\n }\n }\n async #send(attempt, expires, delay, _request, _response) {\n if (attempt >= this.#throttle.maxAttempts) {\n return _response.makeServerError(\"exceeded maximum retry limit\");\n }\n assert(getTime() <= expires, \"timeout\", \"TIMEOUT\", {\n operation: \"request.send\", reason: \"timeout\", request: _request\n });\n if (delay > 0) {\n await wait(delay);\n }\n let req = this.clone();\n const scheme = (req.url.split(\":\")[0] || \"\").toLowerCase();\n // Process any Gateways\n if (scheme in Gateways) {\n const result = await Gateways[scheme](req.url, checkSignal(_request.#signal));\n if (result instanceof FetchResponse) {\n let response = result;\n if (this.processFunc) {\n checkSignal(_request.#signal);\n try {\n response = await this.processFunc(req, response);\n }\n catch (error) {\n // Something went wrong during processing; throw a 5xx server error\n if (error.throttle == null || typeof (error.stall) !== \"number\") {\n response.makeServerError(\"error in post-processing function\", error).assertOk();\n }\n // Ignore throttling\n }\n }\n return response;\n }\n req = result;\n }\n // We have a preflight function; update the request\n if (this.preflightFunc) {\n req = await this.preflightFunc(req);\n }\n const resp = await this.getUrlFunc(req, checkSignal(_request.#signal));\n let response = new FetchResponse(resp.statusCode, resp.statusMessage, resp.headers, resp.body, _request);\n if (response.statusCode === 301 || response.statusCode === 302) {\n // Redirect\n try {\n const location = response.headers.location || \"\";\n return req.redirect(location).#send(attempt + 1, expires, 0, _request, response);\n }\n catch (error) { }\n // Things won't get any better on another attempt; abort\n return response;\n }\n else if (response.statusCode === 429) {\n // Throttle\n if (this.retryFunc == null || (await this.retryFunc(req, response, attempt))) {\n const retryAfter = response.headers[\"retry-after\"];\n let delay = this.#throttle.slotInterval * Math.trunc(Math.random() * Math.pow(2, attempt));\n if (typeof (retryAfter) === \"string\" && retryAfter.match(/^[1-9][0-9]*$/)) {\n delay = parseInt(retryAfter);\n }\n return req.clone().#send(attempt + 1, expires, delay, _request, response);\n }\n }\n if (this.processFunc) {\n checkSignal(_request.#signal);\n try {\n response = await this.processFunc(req, response);\n }\n catch (error) {\n // Something went wrong during processing; throw a 5xx server error\n if (error.throttle == null || typeof (error.stall) !== \"number\") {\n response.makeServerError(\"error in post-processing function\", error).assertOk();\n }\n // Throttle\n let delay = this.#throttle.slotInterval * Math.trunc(Math.random() * Math.pow(2, attempt));\n ;\n if (error.stall >= 0) {\n delay = error.stall;\n }\n return req.clone().#send(attempt + 1, expires, delay, _request, response);\n }\n }\n return response;\n }\n /**\n * Resolves to the response by sending the request.\n */\n send() {\n assert(this.#signal == null, \"request already sent\", \"UNSUPPORTED_OPERATION\", { operation: \"fetchRequest.send\" });\n this.#signal = new FetchCancelSignal(this);\n return this.#send(0, getTime() + this.timeout, 0, this, new FetchResponse(0, \"\", {}, null, this));\n }\n /**\n * Cancels the inflight response, causing a ``CANCELLED``\n * error to be rejected from the [[send]].\n */\n cancel() {\n assert(this.#signal != null, \"request has not been sent\", \"UNSUPPORTED_OPERATION\", { operation: \"fetchRequest.cancel\" });\n const signal = fetchSignals.get(this);\n if (!signal) {\n throw new Error(\"missing signal; should not happen\");\n }\n signal();\n }\n /**\n * Returns a new [[FetchRequest]] that represents the redirection\n * to %%location%%.\n */\n redirect(location) {\n // Redirection; for now we only support absolute locations\n const current = this.url.split(\":\")[0].toLowerCase();\n const target = location.split(\":\")[0].toLowerCase();\n // Don't allow redirecting:\n // - non-GET requests\n // - downgrading the security (e.g. https => http)\n // - to non-HTTP (or non-HTTPS) protocols [this could be relaxed?]\n assert(this.method === \"GET\" && (current !== \"https\" || target !== \"http\") && location.match(/^https?:/), `unsupported redirect`, \"UNSUPPORTED_OPERATION\", {\n operation: `redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(location)})`\n });\n // Create a copy of this request, with a new URL\n const req = new FetchRequest(location);\n req.method = \"GET\";\n req.allowGzip = this.allowGzip;\n req.timeout = this.timeout;\n req.#headers = Object.assign({}, this.#headers);\n if (this.#body) {\n req.#body = new Uint8Array(this.#body);\n }\n req.#bodyType = this.#bodyType;\n // Do not forward credentials unless on the same domain; only absolute\n //req.allowInsecure = false;\n // paths are currently supported; may want a way to specify to forward?\n //setStore(req.#props, \"creds\", getStore(this.#pros, \"creds\"));\n return req;\n }\n /**\n * Create a new copy of this request.\n */\n clone() {\n const clone = new FetchRequest(this.url);\n // Preserve \"default method\" (i.e. null)\n clone.#method = this.#method;\n // Preserve \"default body\" with type, copying the Uint8Array is present\n if (this.#body) {\n clone.#body = this.#body;\n }\n clone.#bodyType = this.#bodyType;\n // Preserve \"default headers\"\n clone.#headers = Object.assign({}, this.#headers);\n // Credentials is readonly, so we copy internally\n clone.#creds = this.#creds;\n if (this.allowGzip) {\n clone.allowGzip = true;\n }\n clone.timeout = this.timeout;\n if (this.allowInsecureAuthentication) {\n clone.allowInsecureAuthentication = true;\n }\n clone.#preflight = this.#preflight;\n clone.#process = this.#process;\n clone.#retry = this.#retry;\n clone.#throttle = Object.assign({}, this.#throttle);\n clone.#getUrlFunc = this.#getUrlFunc;\n return clone;\n }\n /**\n * Locks all static configuration for gateways and FetchGetUrlFunc\n * registration.\n */\n static lockConfig() {\n locked = true;\n }\n /**\n * Get the current Gateway function for %%scheme%%.\n */\n static getGateway(scheme) {\n return Gateways[scheme.toLowerCase()] || null;\n }\n /**\n * Use the %%func%% when fetching URIs using %%scheme%%.\n *\n * This method affects all requests globally.\n *\n * If [[lockConfig]] has been called, no change is made and this\n * throws.\n */\n static registerGateway(scheme, func) {\n scheme = scheme.toLowerCase();\n if (scheme === \"http\" || scheme === \"https\") {\n throw new Error(`cannot intercept ${scheme}; use registerGetUrl`);\n }\n if (locked) {\n throw new Error(\"gateways locked\");\n }\n Gateways[scheme] = func;\n }\n /**\n * Use %%getUrl%% when fetching URIs over HTTP and HTTPS requests.\n *\n * This method affects all requests globally.\n *\n * If [[lockConfig]] has been called, no change is made and this\n * throws.\n */\n static registerGetUrl(getUrl) {\n if (locked) {\n throw new Error(\"gateways locked\");\n }\n defaultGetUrlFunc = getUrl;\n }\n /**\n * Creates a getUrl function that fetches content from HTTP and\n * HTTPS URLs.\n *\n * The available %%options%% are dependent on the platform\n * implementation of the default getUrl function.\n *\n * This is not generally something that is needed, but is useful\n * when trying to customize simple behaviour when fetching HTTP\n * content.\n */\n static createGetUrlFunc(options) {\n return createGetUrl(options);\n }\n /**\n * Creates a function that can \"fetch\" data URIs.\n *\n * Note that this is automatically done internally to support\n * data URIs, so it is not necessary to register it.\n *\n * This is not generally something that is needed, but may\n * be useful in a wrapper to perfom custom data URI functionality.\n */\n static createDataGateway() {\n return dataGatewayFunc;\n }\n /**\n * Creates a function that will fetch IPFS (unvalidated) from\n * a custom gateway baseUrl.\n *\n * The default IPFS gateway used internally is\n * ``\"https:/\\/gateway.ipfs.io/ipfs/\"``.\n */\n static createIpfsGatewayFunc(baseUrl) {\n return getIpfsGatewayFunc(baseUrl);\n }\n}\n;\n/**\n * The response for a FetchRequest.\n */\nexport class FetchResponse {\n #statusCode;\n #statusMessage;\n #headers;\n #body;\n #request;\n #error;\n toString() {\n return ``;\n }\n /**\n * The response status code.\n */\n get statusCode() { return this.#statusCode; }\n /**\n * The response status message.\n */\n get statusMessage() { return this.#statusMessage; }\n /**\n * The response headers. All keys are lower-case.\n */\n get headers() { return Object.assign({}, this.#headers); }\n /**\n * The response body, or ``null`` if there was no body.\n */\n get body() {\n return (this.#body == null) ? null : new Uint8Array(this.#body);\n }\n /**\n * The response body as a UTF-8 encoded string, or the empty\n * string (i.e. ``\"\"``) if there was no body.\n *\n * An error is thrown if the body is invalid UTF-8 data.\n */\n get bodyText() {\n try {\n return (this.#body == null) ? \"\" : toUtf8String(this.#body);\n }\n catch (error) {\n assert(false, \"response body is not valid UTF-8 data\", \"UNSUPPORTED_OPERATION\", {\n operation: \"bodyText\", info: { response: this }\n });\n }\n }\n /**\n * The response body, decoded as JSON.\n *\n * An error is thrown if the body is invalid JSON-encoded data\n * or if there was no body.\n */\n get bodyJson() {\n try {\n return JSON.parse(this.bodyText);\n }\n catch (error) {\n assert(false, \"response body is not valid JSON\", \"UNSUPPORTED_OPERATION\", {\n operation: \"bodyJson\", info: { response: this }\n });\n }\n }\n [Symbol.iterator]() {\n const headers = this.headers;\n const keys = Object.keys(headers);\n let index = 0;\n return {\n next: () => {\n if (index < keys.length) {\n const key = keys[index++];\n return {\n value: [key, headers[key]], done: false\n };\n }\n return { value: undefined, done: true };\n }\n };\n }\n constructor(statusCode, statusMessage, headers, body, request) {\n this.#statusCode = statusCode;\n this.#statusMessage = statusMessage;\n this.#headers = Object.keys(headers).reduce((accum, k) => {\n accum[k.toLowerCase()] = String(headers[k]);\n return accum;\n }, {});\n this.#body = ((body == null) ? null : new Uint8Array(body));\n this.#request = (request || null);\n this.#error = { message: \"\" };\n }\n /**\n * Return a Response with matching headers and body, but with\n * an error status code (i.e. 599) and %%message%% with an\n * optional %%error%%.\n */\n makeServerError(message, error) {\n let statusMessage;\n if (!message) {\n message = `${this.statusCode} ${this.statusMessage}`;\n statusMessage = `CLIENT ESCALATED SERVER ERROR (${message})`;\n }\n else {\n statusMessage = `CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${message})`;\n }\n const response = new FetchResponse(599, statusMessage, this.headers, this.body, this.#request || undefined);\n response.#error = { message, error };\n return response;\n }\n /**\n * If called within a [request.processFunc](FetchRequest-processFunc)\n * call, causes the request to retry as if throttled for %%stall%%\n * milliseconds.\n */\n throwThrottleError(message, stall) {\n if (stall == null) {\n stall = -1;\n }\n else {\n assertArgument(Number.isInteger(stall) && stall >= 0, \"invalid stall timeout\", \"stall\", stall);\n }\n const error = new Error(message || \"throttling requests\");\n defineProperties(error, { stall, throttle: true });\n throw error;\n }\n /**\n * Get the header value for %%key%%, ignoring case.\n */\n getHeader(key) {\n return this.headers[key.toLowerCase()];\n }\n /**\n * Returns true if the response has a body.\n */\n hasBody() {\n return (this.#body != null);\n }\n /**\n * The request made for this response.\n */\n get request() { return this.#request; }\n /**\n * Returns true if this response was a success statusCode.\n */\n ok() {\n return (this.#error.message === \"\" && this.statusCode >= 200 && this.statusCode < 300);\n }\n /**\n * Throws a ``SERVER_ERROR`` if this response is not ok.\n */\n assertOk() {\n if (this.ok()) {\n return;\n }\n let { message, error } = this.#error;\n if (message === \"\") {\n message = `server response ${this.statusCode} ${this.statusMessage}`;\n }\n let requestUrl = null;\n if (this.request) {\n requestUrl = this.request.url;\n }\n let responseBody = null;\n try {\n if (this.#body) {\n responseBody = toUtf8String(this.#body);\n }\n }\n catch (e) { }\n assert(false, message, \"SERVER_ERROR\", {\n request: (this.request || \"unknown request\"), response: this, error,\n info: {\n requestUrl, responseBody,\n responseStatus: `${this.statusCode} ${this.statusMessage}`\n }\n });\n }\n}\nfunction getTime() { return (new Date()).getTime(); }\nfunction unpercent(value) {\n return toUtf8Bytes(value.replace(/%([0-9a-f][0-9a-f])/gi, (all, code) => {\n return String.fromCharCode(parseInt(code, 16));\n }));\n}\nfunction wait(delay) {\n return new Promise((resolve) => setTimeout(resolve, delay));\n}\n//# sourceMappingURL=fetch.js.map","/**\n * The **FixedNumber** class permits using values with decimal places,\n * using fixed-pont math.\n *\n * Fixed-point math is still based on integers under-the-hood, but uses an\n * internal offset to store fractional components below, and each operation\n * corrects for this after each operation.\n *\n * @_section: api/utils/fixed-point-math:Fixed-Point Maths [about-fixed-point-math]\n */\nimport { getBytes } from \"./data.js\";\nimport { assert, assertArgument, assertPrivate } from \"./errors.js\";\nimport { getBigInt, getNumber, fromTwos, mask, toBigInt } from \"./maths.js\";\nimport { defineProperties } from \"./properties.js\";\nconst BN_N1 = BigInt(-1);\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_5 = BigInt(5);\nconst _guard = {};\n// Constant to pull zeros from for multipliers\nlet Zeros = \"0000\";\nwhile (Zeros.length < 80) {\n Zeros += Zeros;\n}\n// Returns a string \"1\" followed by decimal \"0\"s\nfunction getTens(decimals) {\n let result = Zeros;\n while (result.length < decimals) {\n result += result;\n }\n return BigInt(\"1\" + result.substring(0, decimals));\n}\nfunction checkValue(val, format, safeOp) {\n const width = BigInt(format.width);\n if (format.signed) {\n const limit = (BN_1 << (width - BN_1));\n assert(safeOp == null || (val >= -limit && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp, fault: \"overflow\", value: val\n });\n if (val > BN_0) {\n val = fromTwos(mask(val, width), width);\n }\n else {\n val = -fromTwos(mask(-val, width), width);\n }\n }\n else {\n const limit = (BN_1 << width);\n assert(safeOp == null || (val >= 0 && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp, fault: \"overflow\", value: val\n });\n val = (((val % limit) + limit) % limit) & (limit - BN_1);\n }\n return val;\n}\nfunction getFormat(value) {\n if (typeof (value) === \"number\") {\n value = `fixed128x${value}`;\n }\n let signed = true;\n let width = 128;\n let decimals = 18;\n if (typeof (value) === \"string\") {\n // Parse the format string\n if (value === \"fixed\") {\n // defaults...\n }\n else if (value === \"ufixed\") {\n signed = false;\n }\n else {\n const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);\n assertArgument(match, \"invalid fixed format\", \"format\", value);\n signed = (match[1] !== \"u\");\n width = parseInt(match[2]);\n decimals = parseInt(match[3]);\n }\n }\n else if (value) {\n // Extract the values from the object\n const v = value;\n const check = (key, type, defaultValue) => {\n if (v[key] == null) {\n return defaultValue;\n }\n assertArgument(typeof (v[key]) === type, \"invalid fixed format (\" + key + \" not \" + type + \")\", \"format.\" + key, v[key]);\n return v[key];\n };\n signed = check(\"signed\", \"boolean\", signed);\n width = check(\"width\", \"number\", width);\n decimals = check(\"decimals\", \"number\", decimals);\n }\n assertArgument((width % 8) === 0, \"invalid FixedNumber width (not byte aligned)\", \"format.width\", width);\n assertArgument(decimals <= 80, \"invalid FixedNumber decimals (too large)\", \"format.decimals\", decimals);\n const name = (signed ? \"\" : \"u\") + \"fixed\" + String(width) + \"x\" + String(decimals);\n return { signed, width, decimals, name };\n}\nfunction toString(val, decimals) {\n let negative = \"\";\n if (val < BN_0) {\n negative = \"-\";\n val *= BN_N1;\n }\n let str = val.toString();\n // No decimal point for whole values\n if (decimals === 0) {\n return (negative + str);\n }\n // Pad out to the whole component (including a whole digit)\n while (str.length <= decimals) {\n str = Zeros + str;\n }\n // Insert the decimal point\n const index = str.length - decimals;\n str = str.substring(0, index) + \".\" + str.substring(index);\n // Trim the whole component (leaving at least one 0)\n while (str[0] === \"0\" && str[1] !== \".\") {\n str = str.substring(1);\n }\n // Trim the decimal component (leaving at least one 0)\n while (str[str.length - 1] === \"0\" && str[str.length - 2] !== \".\") {\n str = str.substring(0, str.length - 1);\n }\n return (negative + str);\n}\n/**\n * A FixedNumber represents a value over its [[FixedFormat]]\n * arithmetic field.\n *\n * A FixedNumber can be used to perform math, losslessly, on\n * values which have decmial places.\n *\n * A FixedNumber has a fixed bit-width to store values in, and stores all\n * values internally by multiplying the value by 10 raised to the power of\n * %%decimals%%.\n *\n * If operations are performed that cause a value to grow too high (close to\n * positive infinity) or too low (close to negative infinity), the value\n * is said to //overflow//.\n *\n * For example, an 8-bit signed value, with 0 decimals may only be within\n * the range ``-128`` to ``127``; so ``-128 - 1`` will overflow and become\n * ``127``. Likewise, ``127 + 1`` will overflow and become ``-127``.\n *\n * Many operation have a normal and //unsafe// variant. The normal variant\n * will throw a [[NumericFaultError]] on any overflow, while the //unsafe//\n * variant will silently allow overflow, corrupting its value value.\n *\n * If operations are performed that cause a value to become too small\n * (close to zero), the value loses precison and is said to //underflow//.\n *\n * For example, a value with 1 decimal place may store a number as small\n * as ``0.1``, but the value of ``0.1 / 2`` is ``0.05``, which cannot fit\n * into 1 decimal place, so underflow occurs which means precision is lost\n * and the value becomes ``0``.\n *\n * Some operations have a normal and //signalling// variant. The normal\n * variant will silently ignore underflow, while the //signalling// variant\n * will thow a [[NumericFaultError]] on underflow.\n */\nexport class FixedNumber {\n /**\n * The specific fixed-point arithmetic field for this value.\n */\n format;\n #format;\n // The actual value (accounting for decimals)\n #val;\n // A base-10 value to multiple values by to maintain the magnitude\n #tens;\n /**\n * This is a property so console.log shows a human-meaningful value.\n *\n * @private\n */\n _value;\n // Use this when changing this file to get some typing info,\n // but then switch to any to mask the internal type\n //constructor(guard: any, value: bigint, format: _FixedFormat) {\n /**\n * @private\n */\n constructor(guard, value, format) {\n assertPrivate(guard, _guard, \"FixedNumber\");\n this.#val = value;\n this.#format = format;\n const _value = toString(value, format.decimals);\n defineProperties(this, { format: format.name, _value });\n this.#tens = getTens(format.decimals);\n }\n /**\n * If true, negative values are permitted, otherwise only\n * positive values and zero are allowed.\n */\n get signed() { return this.#format.signed; }\n /**\n * The number of bits available to store the value.\n */\n get width() { return this.#format.width; }\n /**\n * The number of decimal places in the fixed-point arithment field.\n */\n get decimals() { return this.#format.decimals; }\n /**\n * The value as an integer, based on the smallest unit the\n * [[decimals]] allow.\n */\n get value() { return this.#val; }\n #checkFormat(other) {\n assertArgument(this.format === other.format, \"incompatible format; use fixedNumber.toFormat\", \"other\", other);\n }\n #checkValue(val, safeOp) {\n /*\n const width = BigInt(this.width);\n if (this.signed) {\n const limit = (BN_1 << (width - BN_1));\n assert(safeOp == null || (val >= -limit && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp, fault: \"overflow\", value: val\n });\n \n if (val > BN_0) {\n val = fromTwos(mask(val, width), width);\n } else {\n val = -fromTwos(mask(-val, width), width);\n }\n \n } else {\n const masked = mask(val, width);\n assert(safeOp == null || (val >= 0 && val === masked), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp, fault: \"overflow\", value: val\n });\n val = masked;\n }\n */\n val = checkValue(val, this.#format, safeOp);\n return new FixedNumber(_guard, val, this.#format);\n }\n #add(o, safeOp) {\n this.#checkFormat(o);\n return this.#checkValue(this.#val + o.#val, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% added\n * to %%other%%, ignoring overflow.\n */\n addUnsafe(other) { return this.#add(other); }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% added\n * to %%other%%. A [[NumericFaultError]] is thrown if overflow\n * occurs.\n */\n add(other) { return this.#add(other, \"add\"); }\n #sub(o, safeOp) {\n this.#checkFormat(o);\n return this.#checkValue(this.#val - o.#val, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%other%% subtracted\n * from %%this%%, ignoring overflow.\n */\n subUnsafe(other) { return this.#sub(other); }\n /**\n * Returns a new [[FixedNumber]] with the result of %%other%% subtracted\n * from %%this%%. A [[NumericFaultError]] is thrown if overflow\n * occurs.\n */\n sub(other) { return this.#sub(other, \"sub\"); }\n #mul(o, safeOp) {\n this.#checkFormat(o);\n return this.#checkValue((this.#val * o.#val) / this.#tens, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n * by %%other%%, ignoring overflow and underflow (precision loss).\n */\n mulUnsafe(other) { return this.#mul(other); }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n * by %%other%%. A [[NumericFaultError]] is thrown if overflow\n * occurs.\n */\n mul(other) { return this.#mul(other, \"mul\"); }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n * by %%other%%. A [[NumericFaultError]] is thrown if overflow\n * occurs or if underflow (precision loss) occurs.\n */\n mulSignal(other) {\n this.#checkFormat(other);\n const value = this.#val * other.#val;\n assert((value % this.#tens) === BN_0, \"precision lost during signalling mul\", \"NUMERIC_FAULT\", {\n operation: \"mulSignal\", fault: \"underflow\", value: this\n });\n return this.#checkValue(value / this.#tens, \"mulSignal\");\n }\n #div(o, safeOp) {\n assert(o.#val !== BN_0, \"division by zero\", \"NUMERIC_FAULT\", {\n operation: \"div\", fault: \"divide-by-zero\", value: this\n });\n this.#checkFormat(o);\n return this.#checkValue((this.#val * this.#tens) / o.#val, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% divided\n * by %%other%%, ignoring underflow (precision loss). A\n * [[NumericFaultError]] is thrown if overflow occurs.\n */\n divUnsafe(other) { return this.#div(other); }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% divided\n * by %%other%%, ignoring underflow (precision loss). A\n * [[NumericFaultError]] is thrown if overflow occurs.\n */\n div(other) { return this.#div(other, \"div\"); }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% divided\n * by %%other%%. A [[NumericFaultError]] is thrown if underflow\n * (precision loss) occurs.\n */\n divSignal(other) {\n assert(other.#val !== BN_0, \"division by zero\", \"NUMERIC_FAULT\", {\n operation: \"div\", fault: \"divide-by-zero\", value: this\n });\n this.#checkFormat(other);\n const value = (this.#val * this.#tens);\n assert((value % other.#val) === BN_0, \"precision lost during signalling div\", \"NUMERIC_FAULT\", {\n operation: \"divSignal\", fault: \"underflow\", value: this\n });\n return this.#checkValue(value / other.#val, \"divSignal\");\n }\n /**\n * Returns a comparison result between %%this%% and %%other%%.\n *\n * This is suitable for use in sorting, where ``-1`` implies %%this%%\n * is smaller, ``1`` implies %%this%% is larger and ``0`` implies\n * both are equal.\n */\n cmp(other) {\n let a = this.value, b = other.value;\n // Coerce a and b to the same magnitude\n const delta = this.decimals - other.decimals;\n if (delta > 0) {\n b *= getTens(delta);\n }\n else if (delta < 0) {\n a *= getTens(-delta);\n }\n // Comnpare\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return 1;\n }\n return 0;\n }\n /**\n * Returns true if %%other%% is equal to %%this%%.\n */\n eq(other) { return this.cmp(other) === 0; }\n /**\n * Returns true if %%other%% is less than to %%this%%.\n */\n lt(other) { return this.cmp(other) < 0; }\n /**\n * Returns true if %%other%% is less than or equal to %%this%%.\n */\n lte(other) { return this.cmp(other) <= 0; }\n /**\n * Returns true if %%other%% is greater than to %%this%%.\n */\n gt(other) { return this.cmp(other) > 0; }\n /**\n * Returns true if %%other%% is greater than or equal to %%this%%.\n */\n gte(other) { return this.cmp(other) >= 0; }\n /**\n * Returns a new [[FixedNumber]] which is the largest **integer**\n * that is less than or equal to %%this%%.\n *\n * The decimal component of the result will always be ``0``.\n */\n floor() {\n let val = this.#val;\n if (this.#val < BN_0) {\n val -= this.#tens - BN_1;\n }\n val = (this.#val / this.#tens) * this.#tens;\n return this.#checkValue(val, \"floor\");\n }\n /**\n * Returns a new [[FixedNumber]] which is the smallest **integer**\n * that is greater than or equal to %%this%%.\n *\n * The decimal component of the result will always be ``0``.\n */\n ceiling() {\n let val = this.#val;\n if (this.#val > BN_0) {\n val += this.#tens - BN_1;\n }\n val = (this.#val / this.#tens) * this.#tens;\n return this.#checkValue(val, \"ceiling\");\n }\n /**\n * Returns a new [[FixedNumber]] with the decimal component\n * rounded up on ties at %%decimals%% places.\n */\n round(decimals) {\n if (decimals == null) {\n decimals = 0;\n }\n // Not enough precision to not already be rounded\n if (decimals >= this.decimals) {\n return this;\n }\n const delta = this.decimals - decimals;\n const bump = BN_5 * getTens(delta - 1);\n let value = this.value + bump;\n const tens = getTens(delta);\n value = (value / tens) * tens;\n checkValue(value, this.#format, \"round\");\n return new FixedNumber(_guard, value, this.#format);\n }\n /**\n * Returns true if %%this%% is equal to ``0``.\n */\n isZero() { return (this.#val === BN_0); }\n /**\n * Returns true if %%this%% is less than ``0``.\n */\n isNegative() { return (this.#val < BN_0); }\n /**\n * Returns the string representation of %%this%%.\n */\n toString() { return this._value; }\n /**\n * Returns a float approximation.\n *\n * Due to IEEE 754 precission (or lack thereof), this function\n * can only return an approximation and most values will contain\n * rounding errors.\n */\n toUnsafeFloat() { return parseFloat(this.toString()); }\n /**\n * Return a new [[FixedNumber]] with the same value but has had\n * its field set to %%format%%.\n *\n * This will throw if the value cannot fit into %%format%%.\n */\n toFormat(format) {\n return FixedNumber.fromString(this.toString(), format);\n }\n /**\n * Creates a new [[FixedNumber]] for %%value%% divided by\n * %%decimal%% places with %%format%%.\n *\n * This will throw a [[NumericFaultError]] if %%value%% (once adjusted\n * for %%decimals%%) cannot fit in %%format%%, either due to overflow\n * or underflow (precision loss).\n */\n static fromValue(_value, _decimals, _format) {\n const decimals = (_decimals == null) ? 0 : getNumber(_decimals);\n const format = getFormat(_format);\n let value = getBigInt(_value, \"value\");\n const delta = decimals - format.decimals;\n if (delta > 0) {\n const tens = getTens(delta);\n assert((value % tens) === BN_0, \"value loses precision for format\", \"NUMERIC_FAULT\", {\n operation: \"fromValue\", fault: \"underflow\", value: _value\n });\n value /= tens;\n }\n else if (delta < 0) {\n value *= getTens(-delta);\n }\n checkValue(value, format, \"fromValue\");\n return new FixedNumber(_guard, value, format);\n }\n /**\n * Creates a new [[FixedNumber]] for %%value%% with %%format%%.\n *\n * This will throw a [[NumericFaultError]] if %%value%% cannot fit\n * in %%format%%, either due to overflow or underflow (precision loss).\n */\n static fromString(_value, _format) {\n const match = _value.match(/^(-?)([0-9]*)\\.?([0-9]*)$/);\n assertArgument(match && (match[2].length + match[3].length) > 0, \"invalid FixedNumber string value\", \"value\", _value);\n const format = getFormat(_format);\n let whole = (match[2] || \"0\"), decimal = (match[3] || \"\");\n // Pad out the decimals\n while (decimal.length < format.decimals) {\n decimal += Zeros;\n }\n // Check precision is safe\n assert(decimal.substring(format.decimals).match(/^0*$/), \"too many decimals for format\", \"NUMERIC_FAULT\", {\n operation: \"fromString\", fault: \"underflow\", value: _value\n });\n // Remove extra padding\n decimal = decimal.substring(0, format.decimals);\n const value = BigInt(match[1] + whole + decimal);\n checkValue(value, format, \"fromString\");\n return new FixedNumber(_guard, value, format);\n }\n /**\n * Creates a new [[FixedNumber]] with the big-endian representation\n * %%value%% with %%format%%.\n *\n * This will throw a [[NumericFaultError]] if %%value%% cannot fit\n * in %%format%% due to overflow.\n */\n static fromBytes(_value, _format) {\n let value = toBigInt(getBytes(_value, \"value\"));\n const format = getFormat(_format);\n if (format.signed) {\n value = fromTwos(value, format.width);\n }\n checkValue(value, format, \"fromBytes\");\n return new FixedNumber(_guard, value, format);\n }\n}\n//const f1 = FixedNumber.fromString(\"12.56\", \"fixed16x2\");\n//const f2 = FixedNumber.fromString(\"0.3\", \"fixed16x2\");\n//console.log(f1.divSignal(f2));\n//const BUMP = FixedNumber.from(\"0.5\");\n//# sourceMappingURL=fixednumber.js.map","//See: https://github.com/ethereum/wiki/wiki/RLP\nimport { hexlify } from \"./data.js\";\nimport { assert, assertArgument } from \"./errors.js\";\nimport { getBytes } from \"./data.js\";\nfunction hexlifyByte(value) {\n let result = value.toString(16);\n while (result.length < 2) {\n result = \"0\" + result;\n }\n return \"0x\" + result;\n}\nfunction unarrayifyInteger(data, offset, length) {\n let result = 0;\n for (let i = 0; i < length; i++) {\n result = (result * 256) + data[offset + i];\n }\n return result;\n}\nfunction _decodeChildren(data, offset, childOffset, length) {\n const result = [];\n while (childOffset < offset + 1 + length) {\n const decoded = _decode(data, childOffset);\n result.push(decoded.result);\n childOffset += decoded.consumed;\n assert(childOffset <= offset + 1 + length, \"child data too short\", \"BUFFER_OVERRUN\", {\n buffer: data, length, offset\n });\n }\n return { consumed: (1 + length), result: result };\n}\n// returns { consumed: number, result: Object }\nfunction _decode(data, offset) {\n assert(data.length !== 0, \"data too short\", \"BUFFER_OVERRUN\", {\n buffer: data, length: 0, offset: 1\n });\n const checkOffset = (offset) => {\n assert(offset <= data.length, \"data short segment too short\", \"BUFFER_OVERRUN\", {\n buffer: data, length: data.length, offset\n });\n };\n // Array with extra length prefix\n if (data[offset] >= 0xf8) {\n const lengthLength = data[offset] - 0xf7;\n checkOffset(offset + 1 + lengthLength);\n const length = unarrayifyInteger(data, offset + 1, lengthLength);\n checkOffset(offset + 1 + lengthLength + length);\n return _decodeChildren(data, offset, offset + 1 + lengthLength, lengthLength + length);\n }\n else if (data[offset] >= 0xc0) {\n const length = data[offset] - 0xc0;\n checkOffset(offset + 1 + length);\n return _decodeChildren(data, offset, offset + 1, length);\n }\n else if (data[offset] >= 0xb8) {\n const lengthLength = data[offset] - 0xb7;\n checkOffset(offset + 1 + lengthLength);\n const length = unarrayifyInteger(data, offset + 1, lengthLength);\n checkOffset(offset + 1 + lengthLength + length);\n const result = hexlify(data.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length));\n return { consumed: (1 + lengthLength + length), result: result };\n }\n else if (data[offset] >= 0x80) {\n const length = data[offset] - 0x80;\n checkOffset(offset + 1 + length);\n const result = hexlify(data.slice(offset + 1, offset + 1 + length));\n return { consumed: (1 + length), result: result };\n }\n return { consumed: 1, result: hexlifyByte(data[offset]) };\n}\n/**\n * Decodes %%data%% into the structured data it represents.\n */\nexport function decodeRlp(_data) {\n const data = getBytes(_data, \"data\");\n const decoded = _decode(data, 0);\n assertArgument(decoded.consumed === data.length, \"unexpected junk after rlp payload\", \"data\", _data);\n return decoded.result;\n}\n//# sourceMappingURL=rlp-decode.js.map","//See: https://github.com/ethereum/wiki/wiki/RLP\nimport { getBytes } from \"./data.js\";\nfunction arrayifyInteger(value) {\n const result = [];\n while (value) {\n result.unshift(value & 0xff);\n value >>= 8;\n }\n return result;\n}\nfunction _encode(object) {\n if (Array.isArray(object)) {\n let payload = [];\n object.forEach(function (child) {\n payload = payload.concat(_encode(child));\n });\n if (payload.length <= 55) {\n payload.unshift(0xc0 + payload.length);\n return payload;\n }\n const length = arrayifyInteger(payload.length);\n length.unshift(0xf7 + length.length);\n return length.concat(payload);\n }\n const data = Array.prototype.slice.call(getBytes(object, \"object\"));\n if (data.length === 1 && data[0] <= 0x7f) {\n return data;\n }\n else if (data.length <= 55) {\n data.unshift(0x80 + data.length);\n return data;\n }\n const length = arrayifyInteger(data.length);\n length.unshift(0xb7 + length.length);\n return length.concat(data);\n}\nconst nibbles = \"0123456789abcdef\";\n/**\n * Encodes %%object%% as an RLP-encoded [[DataHexString]].\n */\nexport function encodeRlp(object) {\n let result = \"0x\";\n for (const v of _encode(object)) {\n result += nibbles[v >> 4];\n result += nibbles[v & 0xf];\n }\n return result;\n}\n//# sourceMappingURL=rlp-encode.js.map","/**\n * Most interactions with Ethereum requires integer values, which use\n * the smallest magnitude unit.\n *\n * For example, imagine dealing with dollars and cents. Since dollars\n * are divisible, non-integer values are possible, such as ``$10.77``.\n * By using the smallest indivisible unit (i.e. cents), the value can\n * be kept as the integer ``1077``.\n *\n * When receiving decimal input from the user (as a decimal string),\n * the value should be converted to an integer and when showing a user\n * a value, the integer value should be converted to a decimal string.\n *\n * This creates a clear distinction, between values to be used by code\n * (integers) and values used for display logic to users (decimals).\n *\n * The native unit in Ethereum, //ether// is divisible to 18 decimal places,\n * where each individual unit is called a //wei//.\n *\n * @_subsection api/utils:Unit Conversion [about-units]\n */\nimport { assertArgument } from \"./errors.js\";\nimport { FixedNumber } from \"./fixednumber.js\";\nimport { getNumber } from \"./maths.js\";\nconst names = [\n \"wei\",\n \"kwei\",\n \"mwei\",\n \"gwei\",\n \"szabo\",\n \"finney\",\n \"ether\",\n];\n/**\n * Converts %%value%% into a //decimal string//, assuming %%unit%% decimal\n * places. The %%unit%% may be the number of decimal places or the name of\n * a unit (e.g. ``\"gwei\"`` for 9 decimal places).\n *\n */\nexport function formatUnits(value, unit) {\n let decimals = 18;\n if (typeof (unit) === \"string\") {\n const index = names.indexOf(unit);\n assertArgument(index >= 0, \"invalid unit\", \"unit\", unit);\n decimals = 3 * index;\n }\n else if (unit != null) {\n decimals = getNumber(unit, \"unit\");\n }\n return FixedNumber.fromValue(value, decimals, { decimals, width: 512 }).toString();\n}\n/**\n * Converts the //decimal string// %%value%% to a BigInt, assuming\n * %%unit%% decimal places. The %%unit%% may the number of decimal places\n * or the name of a unit (e.g. ``\"gwei\"`` for 9 decimal places).\n */\nexport function parseUnits(value, unit) {\n assertArgument(typeof (value) === \"string\", \"value must be a string\", \"value\", value);\n let decimals = 18;\n if (typeof (unit) === \"string\") {\n const index = names.indexOf(unit);\n assertArgument(index >= 0, \"invalid unit\", \"unit\", unit);\n decimals = 3 * index;\n }\n else if (unit != null) {\n decimals = getNumber(unit, \"unit\");\n }\n return FixedNumber.fromString(value, { decimals, width: 512 }).value;\n}\n/**\n * Converts %%value%% into a //decimal string// using 18 decimal places.\n */\nexport function formatEther(wei) {\n return formatUnits(wei, 18);\n}\n/**\n * Converts the //decimal string// %%ether%% to a BigInt, using 18\n * decimal places.\n */\nexport function parseEther(ether) {\n return parseUnits(ether, 18);\n}\n//# sourceMappingURL=units.js.map","/**\n * Explain UUID and link to RFC here.\n *\n * @_subsection: api/utils:UUID [about-uuid]\n */\nimport { getBytes, hexlify } from \"./data.js\";\n/**\n * Returns the version 4 [[link-uuid]] for the %%randomBytes%%.\n *\n * @see: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4)\n */\nexport function uuidV4(randomBytes) {\n const bytes = getBytes(randomBytes, \"randomBytes\");\n // Section: 4.1.3:\n // - time_hi_and_version[12:16] = 0b0100\n bytes[6] = (bytes[6] & 0x0f) | 0x40;\n // Section 4.4\n // - clock_seq_hi_and_reserved[6] = 0b0\n // - clock_seq_hi_and_reserved[7] = 0b1\n bytes[8] = (bytes[8] & 0x3f) | 0x80;\n const value = hexlify(bytes);\n return [\n value.substring(2, 10),\n value.substring(10, 14),\n value.substring(14, 18),\n value.substring(18, 22),\n value.substring(22, 34),\n ].join(\"-\");\n}\n//# sourceMappingURL=uuid.js.map","import { defineProperties, concat, getBytesCopy, getNumber, hexlify, toBeArray, toBigInt, toNumber, assert, assertArgument\n/*, isError*/\n } from \"../../utils/index.js\";\n/**\n * @_ignore:\n */\nexport const WordSize = 32;\nconst Padding = new Uint8Array(WordSize);\n// Properties used to immediate pass through to the underlying object\n// - `then` is used to detect if an object is a Promise for await\nconst passProperties = [\"then\"];\nconst _guard = {};\nconst resultNames = new WeakMap();\nfunction getNames(result) {\n return resultNames.get(result);\n}\nfunction setNames(result, names) {\n resultNames.set(result, names);\n}\nfunction throwError(name, error) {\n const wrapped = new Error(`deferred error during ABI decoding triggered accessing ${name}`);\n wrapped.error = error;\n throw wrapped;\n}\nfunction toObject(names, items, deep) {\n if (names.indexOf(null) >= 0) {\n return items.map((item, index) => {\n if (item instanceof Result) {\n return toObject(getNames(item), item, deep);\n }\n return item;\n });\n }\n return names.reduce((accum, name, index) => {\n let item = items.getValue(name);\n if (!(name in accum)) {\n if (deep && item instanceof Result) {\n item = toObject(getNames(item), item, deep);\n }\n accum[name] = item;\n }\n return accum;\n }, {});\n}\n/**\n * A [[Result]] is a sub-class of Array, which allows accessing any\n * of its values either positionally by its index or, if keys are\n * provided by its name.\n *\n * @_docloc: api/abi\n */\nexport class Result extends Array {\n // No longer used; but cannot be removed as it will remove the\n // #private field from the .d.ts which may break backwards\n // compatibility\n #names;\n /**\n * @private\n */\n constructor(...args) {\n // To properly sub-class Array so the other built-in\n // functions work, the constructor has to behave fairly\n // well. So, in the event we are created via fromItems()\n // we build the read-only Result object we want, but on\n // any other input, we use the default constructor\n // constructor(guard: any, items: Array, keys?: Array);\n const guard = args[0];\n let items = args[1];\n let names = (args[2] || []).slice();\n let wrap = true;\n if (guard !== _guard) {\n items = args;\n names = [];\n wrap = false;\n }\n // Can't just pass in ...items since an array of length 1\n // is a special case in the super.\n super(items.length);\n items.forEach((item, index) => { this[index] = item; });\n // Find all unique keys\n const nameCounts = names.reduce((accum, name) => {\n if (typeof (name) === \"string\") {\n accum.set(name, (accum.get(name) || 0) + 1);\n }\n return accum;\n }, (new Map()));\n // Remove any key thats not unique\n setNames(this, Object.freeze(items.map((item, index) => {\n const name = names[index];\n if (name != null && nameCounts.get(name) === 1) {\n return name;\n }\n return null;\n })));\n // Dummy operations to prevent TypeScript from complaining\n this.#names = [];\n if (this.#names == null) {\n void (this.#names);\n }\n if (!wrap) {\n return;\n }\n // A wrapped Result is immutable\n Object.freeze(this);\n // Proxy indices and names so we can trap deferred errors\n const proxy = new Proxy(this, {\n get: (target, prop, receiver) => {\n if (typeof (prop) === \"string\") {\n // Index accessor\n if (prop.match(/^[0-9]+$/)) {\n const index = getNumber(prop, \"%index\");\n if (index < 0 || index >= this.length) {\n throw new RangeError(\"out of result range\");\n }\n const item = target[index];\n if (item instanceof Error) {\n throwError(`index ${index}`, item);\n }\n return item;\n }\n // Pass important checks (like `then` for Promise) through\n if (passProperties.indexOf(prop) >= 0) {\n return Reflect.get(target, prop, receiver);\n }\n const value = target[prop];\n if (value instanceof Function) {\n // Make sure functions work with private variables\n // See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy#no_private_property_forwarding\n return function (...args) {\n return value.apply((this === receiver) ? target : this, args);\n };\n }\n else if (!(prop in target)) {\n // Possible name accessor\n return target.getValue.apply((this === receiver) ? target : this, [prop]);\n }\n }\n return Reflect.get(target, prop, receiver);\n }\n });\n setNames(proxy, getNames(this));\n return proxy;\n }\n /**\n * Returns the Result as a normal Array. If %%deep%%, any children\n * which are Result objects are also converted to a normal Array.\n *\n * This will throw if there are any outstanding deferred\n * errors.\n */\n toArray(deep) {\n const result = [];\n this.forEach((item, index) => {\n if (item instanceof Error) {\n throwError(`index ${index}`, item);\n }\n if (deep && item instanceof Result) {\n item = item.toArray(deep);\n }\n result.push(item);\n });\n return result;\n }\n /**\n * Returns the Result as an Object with each name-value pair. If\n * %%deep%%, any children which are Result objects are also\n * converted to an Object.\n *\n * This will throw if any value is unnamed, or if there are\n * any outstanding deferred errors.\n */\n toObject(deep) {\n const names = getNames(this);\n return names.reduce((accum, name, index) => {\n assert(name != null, `value at index ${index} unnamed`, \"UNSUPPORTED_OPERATION\", {\n operation: \"toObject()\"\n });\n return toObject(names, this, deep);\n }, {});\n }\n /**\n * @_ignore\n */\n slice(start, end) {\n if (start == null) {\n start = 0;\n }\n if (start < 0) {\n start += this.length;\n if (start < 0) {\n start = 0;\n }\n }\n if (end == null) {\n end = this.length;\n }\n if (end < 0) {\n end += this.length;\n if (end < 0) {\n end = 0;\n }\n }\n if (end > this.length) {\n end = this.length;\n }\n const _names = getNames(this);\n const result = [], names = [];\n for (let i = start; i < end; i++) {\n result.push(this[i]);\n names.push(_names[i]);\n }\n return new Result(_guard, result, names);\n }\n /**\n * @_ignore\n */\n filter(callback, thisArg) {\n const _names = getNames(this);\n const result = [], names = [];\n for (let i = 0; i < this.length; i++) {\n const item = this[i];\n if (item instanceof Error) {\n throwError(`index ${i}`, item);\n }\n if (callback.call(thisArg, item, i, this)) {\n result.push(item);\n names.push(_names[i]);\n }\n }\n return new Result(_guard, result, names);\n }\n /**\n * @_ignore\n */\n map(callback, thisArg) {\n const result = [];\n for (let i = 0; i < this.length; i++) {\n const item = this[i];\n if (item instanceof Error) {\n throwError(`index ${i}`, item);\n }\n result.push(callback.call(thisArg, item, i, this));\n }\n return result;\n }\n /**\n * Returns the value for %%name%%.\n *\n * Since it is possible to have a key whose name conflicts with\n * a method on a [[Result]] or its superclass Array, or any\n * JavaScript keyword, this ensures all named values are still\n * accessible by name.\n */\n getValue(name) {\n const index = getNames(this).indexOf(name);\n if (index === -1) {\n return undefined;\n }\n const value = this[index];\n if (value instanceof Error) {\n throwError(`property ${JSON.stringify(name)}`, value.error);\n }\n return value;\n }\n /**\n * Creates a new [[Result]] for %%items%% with each entry\n * also accessible by its corresponding name in %%keys%%.\n */\n static fromItems(items, keys) {\n return new Result(_guard, items, keys);\n }\n}\n/**\n * Returns all errors found in a [[Result]].\n *\n * Since certain errors encountered when creating a [[Result]] do\n * not impact the ability to continue parsing data, they are\n * deferred until they are actually accessed. Hence a faulty string\n * in an Event that is never used does not impact the program flow.\n *\n * However, sometimes it may be useful to access, identify or\n * validate correctness of a [[Result]].\n *\n * @_docloc api/abi\n */\nexport function checkResultErrors(result) {\n // Find the first error (if any)\n const errors = [];\n const checkErrors = function (path, object) {\n if (!Array.isArray(object)) {\n return;\n }\n for (let key in object) {\n const childPath = path.slice();\n childPath.push(key);\n try {\n checkErrors(childPath, object[key]);\n }\n catch (error) {\n errors.push({ path: childPath, error: error });\n }\n }\n };\n checkErrors([], result);\n return errors;\n}\nfunction getValue(value) {\n let bytes = toBeArray(value);\n assert(bytes.length <= WordSize, \"value out-of-bounds\", \"BUFFER_OVERRUN\", { buffer: bytes, length: WordSize, offset: bytes.length });\n if (bytes.length !== WordSize) {\n bytes = getBytesCopy(concat([Padding.slice(bytes.length % WordSize), bytes]));\n }\n return bytes;\n}\n/**\n * @_ignore\n */\nexport class Coder {\n // The coder name:\n // - address, uint256, tuple, array, etc.\n name;\n // The fully expanded type, including composite types:\n // - address, uint256, tuple(address,bytes), uint256[3][4][], etc.\n type;\n // The localName bound in the signature, in this example it is \"baz\":\n // - tuple(address foo, uint bar) baz\n localName;\n // Whether this type is dynamic:\n // - Dynamic: bytes, string, address[], tuple(boolean[]), etc.\n // - Not Dynamic: address, uint256, boolean[3], tuple(address, uint8)\n dynamic;\n constructor(name, type, localName, dynamic) {\n defineProperties(this, { name, type, localName, dynamic }, {\n name: \"string\", type: \"string\", localName: \"string\", dynamic: \"boolean\"\n });\n }\n _throwError(message, value) {\n assertArgument(false, message, this.localName, value);\n }\n}\n/**\n * @_ignore\n */\nexport class Writer {\n // An array of WordSize lengthed objects to concatenation\n #data;\n #dataLength;\n constructor() {\n this.#data = [];\n this.#dataLength = 0;\n }\n get data() {\n return concat(this.#data);\n }\n get length() { return this.#dataLength; }\n #writeData(data) {\n this.#data.push(data);\n this.#dataLength += data.length;\n return data.length;\n }\n appendWriter(writer) {\n return this.#writeData(getBytesCopy(writer.data));\n }\n // Arrayish item; pad on the right to *nearest* WordSize\n writeBytes(value) {\n let bytes = getBytesCopy(value);\n const paddingOffset = bytes.length % WordSize;\n if (paddingOffset) {\n bytes = getBytesCopy(concat([bytes, Padding.slice(paddingOffset)]));\n }\n return this.#writeData(bytes);\n }\n // Numeric item; pad on the left *to* WordSize\n writeValue(value) {\n return this.#writeData(getValue(value));\n }\n // Inserts a numeric place-holder, returning a callback that can\n // be used to asjust the value later\n writeUpdatableValue() {\n const offset = this.#data.length;\n this.#data.push(Padding);\n this.#dataLength += WordSize;\n return (value) => {\n this.#data[offset] = getValue(value);\n };\n }\n}\n/**\n * @_ignore\n */\nexport class Reader {\n // Allows incomplete unpadded data to be read; otherwise an error\n // is raised if attempting to overrun the buffer. This is required\n // to deal with an old Solidity bug, in which event data for\n // external (not public thoguh) was tightly packed.\n allowLoose;\n #data;\n #offset;\n #bytesRead;\n #parent;\n #maxInflation;\n constructor(data, allowLoose, maxInflation) {\n defineProperties(this, { allowLoose: !!allowLoose });\n this.#data = getBytesCopy(data);\n this.#bytesRead = 0;\n this.#parent = null;\n this.#maxInflation = (maxInflation != null) ? maxInflation : 1024;\n this.#offset = 0;\n }\n get data() { return hexlify(this.#data); }\n get dataLength() { return this.#data.length; }\n get consumed() { return this.#offset; }\n get bytes() { return new Uint8Array(this.#data); }\n #incrementBytesRead(count) {\n if (this.#parent) {\n return this.#parent.#incrementBytesRead(count);\n }\n this.#bytesRead += count;\n // Check for excessive inflation (see: #4537)\n assert(this.#maxInflation < 1 || this.#bytesRead <= this.#maxInflation * this.dataLength, `compressed ABI data exceeds inflation ratio of ${this.#maxInflation} ( see: https:/\\/github.com/ethers-io/ethers.js/issues/4537 )`, \"BUFFER_OVERRUN\", {\n buffer: getBytesCopy(this.#data), offset: this.#offset,\n length: count, info: {\n bytesRead: this.#bytesRead,\n dataLength: this.dataLength\n }\n });\n }\n #peekBytes(offset, length, loose) {\n let alignedLength = Math.ceil(length / WordSize) * WordSize;\n if (this.#offset + alignedLength > this.#data.length) {\n if (this.allowLoose && loose && this.#offset + length <= this.#data.length) {\n alignedLength = length;\n }\n else {\n assert(false, \"data out-of-bounds\", \"BUFFER_OVERRUN\", {\n buffer: getBytesCopy(this.#data),\n length: this.#data.length,\n offset: this.#offset + alignedLength\n });\n }\n }\n return this.#data.slice(this.#offset, this.#offset + alignedLength);\n }\n // Create a sub-reader with the same underlying data, but offset\n subReader(offset) {\n const reader = new Reader(this.#data.slice(this.#offset + offset), this.allowLoose, this.#maxInflation);\n reader.#parent = this;\n return reader;\n }\n // Read bytes\n readBytes(length, loose) {\n let bytes = this.#peekBytes(0, length, !!loose);\n this.#incrementBytesRead(length);\n this.#offset += bytes.length;\n // @TODO: Make sure the length..end bytes are all 0?\n return bytes.slice(0, length);\n }\n // Read a numeric values\n readValue() {\n return toBigInt(this.readBytes(WordSize));\n }\n readIndex() {\n return toNumber(this.readBytes(WordSize));\n }\n}\n//# sourceMappingURL=abstract-coder.js.map","function number(n) {\n if (!Number.isSafeInteger(n) || n < 0)\n throw new Error(`Wrong positive integer: ${n}`);\n}\nfunction bool(b) {\n if (typeof b !== 'boolean')\n throw new Error(`Expected boolean, not ${b}`);\n}\nfunction bytes(b, ...lengths) {\n if (!(b instanceof Uint8Array))\n throw new Error('Expected Uint8Array');\n if (lengths.length > 0 && !lengths.includes(b.length))\n throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`);\n}\nfunction hash(hash) {\n if (typeof hash !== 'function' || typeof hash.create !== 'function')\n throw new Error('Hash should be wrapped by utils.wrapConstructor');\n number(hash.outputLen);\n number(hash.blockLen);\n}\nfunction exists(instance, checkFinished = true) {\n if (instance.destroyed)\n throw new Error('Hash instance has been destroyed');\n if (checkFinished && instance.finished)\n throw new Error('Hash#digest() has already been called');\n}\nfunction output(out, instance) {\n bytes(out);\n const min = instance.outputLen;\n if (out.length < min) {\n throw new Error(`digestInto() expects output buffer of length at least ${min}`);\n }\n}\nexport { number, bool, bytes, hash, exists, output };\nconst assert = { number, bool, bytes, hash, exists, output };\nexport default assert;\n//# sourceMappingURL=_assert.js.map","export const crypto = typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined;\n//# sourceMappingURL=crypto.js.map","/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+.\n// node.js versions earlier than v19 don't declare it in global scope.\n// For node.js, package.json#exports field mapping rewrites import\n// from `crypto` to `cryptoNode`, which imports native module.\n// Makes the utils un-importable in browsers without a bundler.\n// Once node.js 18 is deprecated, we can just drop the import.\nimport { crypto } from '@noble/hashes/crypto';\nconst u8a = (a) => a instanceof Uint8Array;\n// Cast array to different type\nexport const u8 = (arr) => new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\nexport const u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n// Cast array to view\nexport const createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n// The rotate right (circular right shift) operation for uint32\nexport const rotr = (word, shift) => (word << (32 - shift)) | (word >>> shift);\n// big-endian hardware is rare. Just in case someone still decides to run hashes:\n// early-throw an error because we don't support BE yet.\nexport const isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44;\nif (!isLE)\n throw new Error('Non little-endian hardware is not supported');\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));\n/**\n * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'\n */\nexport function bytesToHex(bytes) {\n if (!u8a(bytes))\n throw new Error('Uint8Array expected');\n // pre-caching improves the speed 6x\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += hexes[bytes[i]];\n }\n return hex;\n}\n/**\n * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n */\nexport function hexToBytes(hex) {\n if (typeof hex !== 'string')\n throw new Error('hex string expected, got ' + typeof hex);\n const len = hex.length;\n if (len % 2)\n throw new Error('padded hex string expected, got unpadded hex of length ' + len);\n const array = new Uint8Array(len / 2);\n for (let i = 0; i < array.length; i++) {\n const j = i * 2;\n const hexByte = hex.slice(j, j + 2);\n const byte = Number.parseInt(hexByte, 16);\n if (Number.isNaN(byte) || byte < 0)\n throw new Error('Invalid byte sequence');\n array[i] = byte;\n }\n return array;\n}\n// There is no setImmediate in browser and setTimeout is slow.\n// call of async fn will return Promise, which will be fullfiled only on\n// next scheduler queue processing step and this is exactly what we need.\nexport const nextTick = async () => { };\n// Returns control to thread each 'tick' ms to avoid blocking\nexport async function asyncLoop(iters, tick, cb) {\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick)\n continue;\n await nextTick();\n ts += diff;\n }\n}\n/**\n * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99])\n */\nexport function utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new Error(`utf8ToBytes expected string, got ${typeof str}`);\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\n/**\n * Normalizes (non-hex) string or Uint8Array to Uint8Array.\n * Warning: when Uint8Array is passed, it would NOT get copied.\n * Keep in mind for future mutable operations.\n */\nexport function toBytes(data) {\n if (typeof data === 'string')\n data = utf8ToBytes(data);\n if (!u8a(data))\n throw new Error(`expected Uint8Array, got ${typeof data}`);\n return data;\n}\n/**\n * Copies several Uint8Arrays into one.\n */\nexport function concatBytes(...arrays) {\n const r = new Uint8Array(arrays.reduce((sum, a) => sum + a.length, 0));\n let pad = 0; // walk through each item, ensure they have proper type\n arrays.forEach((a) => {\n if (!u8a(a))\n throw new Error('Uint8Array expected');\n r.set(a, pad);\n pad += a.length;\n });\n return r;\n}\n// For runtime check if class implements interface\nexport class Hash {\n // Safe version that clones internal state\n clone() {\n return this._cloneInto();\n }\n}\nconst toStr = {}.toString;\nexport function checkOpts(defaults, opts) {\n if (opts !== undefined && toStr.call(opts) !== '[object Object]')\n throw new Error('Options should be object or undefined');\n const merged = Object.assign(defaults, opts);\n return merged;\n}\nexport function wrapConstructor(hashCons) {\n const hashC = (msg) => hashCons().update(toBytes(msg)).digest();\n const tmp = hashCons();\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = () => hashCons();\n return hashC;\n}\nexport function wrapConstructorWithOpts(hashCons) {\n const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({});\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n return hashC;\n}\nexport function wrapXOFConstructorWithOpts(hashCons) {\n const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({});\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n return hashC;\n}\n/**\n * Secure PRNG. Uses `crypto.getRandomValues`, which defers to OS.\n */\nexport function randomBytes(bytesLength = 32) {\n if (crypto && typeof crypto.getRandomValues === 'function') {\n return crypto.getRandomValues(new Uint8Array(bytesLength));\n }\n throw new Error('crypto.getRandomValues must be defined');\n}\n//# sourceMappingURL=utils.js.map","import { hash as assertHash, bytes as assertBytes, exists as assertExists } from './_assert.js';\nimport { Hash, toBytes } from './utils.js';\n// HMAC (RFC 2104)\nexport class HMAC extends Hash {\n constructor(hash, _key) {\n super();\n this.finished = false;\n this.destroyed = false;\n assertHash(hash);\n const key = toBytes(_key);\n this.iHash = hash.create();\n if (typeof this.iHash.update !== 'function')\n throw new Error('Expected instance of class which extends utils.Hash');\n this.blockLen = this.iHash.blockLen;\n this.outputLen = this.iHash.outputLen;\n const blockLen = this.blockLen;\n const pad = new Uint8Array(blockLen);\n // blockLen can be bigger than outputLen\n pad.set(key.length > blockLen ? hash.create().update(key).digest() : key);\n for (let i = 0; i < pad.length; i++)\n pad[i] ^= 0x36;\n this.iHash.update(pad);\n // By doing update (processing of first block) of outer hash here we can re-use it between multiple calls via clone\n this.oHash = hash.create();\n // Undo internal XOR && apply outer XOR\n for (let i = 0; i < pad.length; i++)\n pad[i] ^= 0x36 ^ 0x5c;\n this.oHash.update(pad);\n pad.fill(0);\n }\n update(buf) {\n assertExists(this);\n this.iHash.update(buf);\n return this;\n }\n digestInto(out) {\n assertExists(this);\n assertBytes(out, this.outputLen);\n this.finished = true;\n this.iHash.digestInto(out);\n this.oHash.update(out);\n this.oHash.digestInto(out);\n this.destroy();\n }\n digest() {\n const out = new Uint8Array(this.oHash.outputLen);\n this.digestInto(out);\n return out;\n }\n _cloneInto(to) {\n // Create new instance without calling constructor since key already in state and we don't know it.\n to || (to = Object.create(Object.getPrototypeOf(this), {}));\n const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this;\n to = to;\n to.finished = finished;\n to.destroyed = destroyed;\n to.blockLen = blockLen;\n to.outputLen = outputLen;\n to.oHash = oHash._cloneInto(to.oHash);\n to.iHash = iHash._cloneInto(to.iHash);\n return to;\n }\n destroy() {\n this.destroyed = true;\n this.oHash.destroy();\n this.iHash.destroy();\n }\n}\n/**\n * HMAC: RFC2104 message authentication code.\n * @param hash - function that would be used e.g. sha256\n * @param key - message key\n * @param message - message data\n */\nexport const hmac = (hash, key, message) => new HMAC(hash, key).update(message).digest();\nhmac.create = (hash, key) => new HMAC(hash, key);\n//# sourceMappingURL=hmac.js.map","import { hash as assertHash, number as assertNumber } from './_assert.js';\nimport { hmac } from './hmac.js';\nimport { createView, toBytes, checkOpts, asyncLoop } from './utils.js';\n// Common prologue and epilogue for sync/async functions\nfunction pbkdf2Init(hash, _password, _salt, _opts) {\n assertHash(hash);\n const opts = checkOpts({ dkLen: 32, asyncTick: 10 }, _opts);\n const { c, dkLen, asyncTick } = opts;\n assertNumber(c);\n assertNumber(dkLen);\n assertNumber(asyncTick);\n if (c < 1)\n throw new Error('PBKDF2: iterations (c) should be >= 1');\n const password = toBytes(_password);\n const salt = toBytes(_salt);\n // DK = PBKDF2(PRF, Password, Salt, c, dkLen);\n const DK = new Uint8Array(dkLen);\n // U1 = PRF(Password, Salt + INT_32_BE(i))\n const PRF = hmac.create(hash, password);\n const PRFSalt = PRF._cloneInto().update(salt);\n return { c, dkLen, asyncTick, DK, PRF, PRFSalt };\n}\nfunction pbkdf2Output(PRF, PRFSalt, DK, prfW, u) {\n PRF.destroy();\n PRFSalt.destroy();\n if (prfW)\n prfW.destroy();\n u.fill(0);\n return DK;\n}\n/**\n * PBKDF2-HMAC: RFC 2898 key derivation function\n * @param hash - hash function that would be used e.g. sha256\n * @param password - password from which a derived key is generated\n * @param salt - cryptographic salt\n * @param opts - {c, dkLen} where c is work factor and dkLen is output message size\n */\nexport function pbkdf2(hash, password, salt, opts) {\n const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts);\n let prfW; // Working copy\n const arr = new Uint8Array(4);\n const view = createView(arr);\n const u = new Uint8Array(PRF.outputLen);\n // DK = T1 + T2 + ⋯ + Tdklen/hlen\n for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) {\n // Ti = F(Password, Salt, c, i)\n const Ti = DK.subarray(pos, pos + PRF.outputLen);\n view.setInt32(0, ti, false);\n // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc\n // U1 = PRF(Password, Salt + INT_32_BE(i))\n (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u);\n Ti.set(u.subarray(0, Ti.length));\n for (let ui = 1; ui < c; ui++) {\n // Uc = PRF(Password, Uc−1)\n PRF._cloneInto(prfW).update(u).digestInto(u);\n for (let i = 0; i < Ti.length; i++)\n Ti[i] ^= u[i];\n }\n }\n return pbkdf2Output(PRF, PRFSalt, DK, prfW, u);\n}\nexport async function pbkdf2Async(hash, password, salt, opts) {\n const { c, dkLen, asyncTick, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts);\n let prfW; // Working copy\n const arr = new Uint8Array(4);\n const view = createView(arr);\n const u = new Uint8Array(PRF.outputLen);\n // DK = T1 + T2 + ⋯ + Tdklen/hlen\n for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) {\n // Ti = F(Password, Salt, c, i)\n const Ti = DK.subarray(pos, pos + PRF.outputLen);\n view.setInt32(0, ti, false);\n // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc\n // U1 = PRF(Password, Salt + INT_32_BE(i))\n (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u);\n Ti.set(u.subarray(0, Ti.length));\n await asyncLoop(c - 1, asyncTick, () => {\n // Uc = PRF(Password, Uc−1)\n PRF._cloneInto(prfW).update(u).digestInto(u);\n for (let i = 0; i < Ti.length; i++)\n Ti[i] ^= u[i];\n });\n }\n return pbkdf2Output(PRF, PRFSalt, DK, prfW, u);\n}\n//# sourceMappingURL=pbkdf2.js.map","import { exists, output } from './_assert.js';\nimport { Hash, createView, toBytes } from './utils.js';\n// Polyfill for Safari 14\nfunction setBigUint64(view, byteOffset, value, isLE) {\n if (typeof view.setBigUint64 === 'function')\n return view.setBigUint64(byteOffset, value, isLE);\n const _32n = BigInt(32);\n const _u32_max = BigInt(0xffffffff);\n const wh = Number((value >> _32n) & _u32_max);\n const wl = Number(value & _u32_max);\n const h = isLE ? 4 : 0;\n const l = isLE ? 0 : 4;\n view.setUint32(byteOffset + h, wh, isLE);\n view.setUint32(byteOffset + l, wl, isLE);\n}\n// Base SHA2 class (RFC 6234)\nexport class SHA2 extends Hash {\n constructor(blockLen, outputLen, padOffset, isLE) {\n super();\n this.blockLen = blockLen;\n this.outputLen = outputLen;\n this.padOffset = padOffset;\n this.isLE = isLE;\n this.finished = false;\n this.length = 0;\n this.pos = 0;\n this.destroyed = false;\n this.buffer = new Uint8Array(blockLen);\n this.view = createView(this.buffer);\n }\n update(data) {\n exists(this);\n const { view, buffer, blockLen } = this;\n data = toBytes(data);\n const len = data.length;\n for (let pos = 0; pos < len;) {\n const take = Math.min(blockLen - this.pos, len - pos);\n // Fast path: we have at least one block in input, cast it to view and process\n if (take === blockLen) {\n const dataView = createView(data);\n for (; blockLen <= len - pos; pos += blockLen)\n this.process(dataView, pos);\n continue;\n }\n buffer.set(data.subarray(pos, pos + take), this.pos);\n this.pos += take;\n pos += take;\n if (this.pos === blockLen) {\n this.process(view, 0);\n this.pos = 0;\n }\n }\n this.length += data.length;\n this.roundClean();\n return this;\n }\n digestInto(out) {\n exists(this);\n output(out, this);\n this.finished = true;\n // Padding\n // We can avoid allocation of buffer for padding completely if it\n // was previously not allocated here. But it won't change performance.\n const { buffer, view, blockLen, isLE } = this;\n let { pos } = this;\n // append the bit '1' to the message\n buffer[pos++] = 0b10000000;\n this.buffer.subarray(pos).fill(0);\n // we have less than padOffset left in buffer, so we cannot put length in current block, need process it and pad again\n if (this.padOffset > blockLen - pos) {\n this.process(view, 0);\n pos = 0;\n }\n // Pad until full block byte with zeros\n for (let i = pos; i < blockLen; i++)\n buffer[i] = 0;\n // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that\n // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen.\n // So we just write lowest 64 bits of that value.\n setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE);\n this.process(view, 0);\n const oview = createView(out);\n const len = this.outputLen;\n // NOTE: we do division by 4 later, which should be fused in single op with modulo by JIT\n if (len % 4)\n throw new Error('_sha2: outputLen should be aligned to 32bit');\n const outLen = len / 4;\n const state = this.get();\n if (outLen > state.length)\n throw new Error('_sha2: outputLen bigger than state');\n for (let i = 0; i < outLen; i++)\n oview.setUint32(4 * i, state[i], isLE);\n }\n digest() {\n const { buffer, outputLen } = this;\n this.digestInto(buffer);\n const res = buffer.slice(0, outputLen);\n this.destroy();\n return res;\n }\n _cloneInto(to) {\n to || (to = new this.constructor());\n to.set(...this.get());\n const { blockLen, buffer, length, finished, destroyed, pos } = this;\n to.length = length;\n to.pos = pos;\n to.finished = finished;\n to.destroyed = destroyed;\n if (length % blockLen)\n to.buffer.set(buffer);\n return to;\n }\n}\n//# sourceMappingURL=_sha2.js.map","import { SHA2 } from './_sha2.js';\nimport { rotr, wrapConstructor } from './utils.js';\n// SHA2-256 need to try 2^128 hashes to execute birthday attack.\n// BTC network is doing 2^67 hashes/sec as per early 2023.\n// Choice: a ? b : c\nconst Chi = (a, b, c) => (a & b) ^ (~a & c);\n// Majority function, true if any two inpust is true\nconst Maj = (a, b, c) => (a & b) ^ (a & c) ^ (b & c);\n// Round constants:\n// first 32 bits of the fractional parts of the cube roots of the first 64 primes 2..311)\n// prettier-ignore\nconst SHA256_K = /* @__PURE__ */ new Uint32Array([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n]);\n// Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19):\n// prettier-ignore\nconst IV = /* @__PURE__ */ new Uint32Array([\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19\n]);\n// Temporary buffer, not used to store anything between runs\n// Named this way because it matches specification.\nconst SHA256_W = /* @__PURE__ */ new Uint32Array(64);\nclass SHA256 extends SHA2 {\n constructor() {\n super(64, 32, 8, false);\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n this.A = IV[0] | 0;\n this.B = IV[1] | 0;\n this.C = IV[2] | 0;\n this.D = IV[3] | 0;\n this.E = IV[4] | 0;\n this.F = IV[5] | 0;\n this.G = IV[6] | 0;\n this.H = IV[7] | 0;\n }\n get() {\n const { A, B, C, D, E, F, G, H } = this;\n return [A, B, C, D, E, F, G, H];\n }\n // prettier-ignore\n set(A, B, C, D, E, F, G, H) {\n this.A = A | 0;\n this.B = B | 0;\n this.C = C | 0;\n this.D = D | 0;\n this.E = E | 0;\n this.F = F | 0;\n this.G = G | 0;\n this.H = H | 0;\n }\n process(view, offset) {\n // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4)\n SHA256_W[i] = view.getUint32(offset, false);\n for (let i = 16; i < 64; i++) {\n const W15 = SHA256_W[i - 15];\n const W2 = SHA256_W[i - 2];\n const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3);\n const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10);\n SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0;\n }\n // Compression function main loop, 64 rounds\n let { A, B, C, D, E, F, G, H } = this;\n for (let i = 0; i < 64; i++) {\n const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);\n const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22);\n const T2 = (sigma0 + Maj(A, B, C)) | 0;\n H = G;\n G = F;\n F = E;\n E = (D + T1) | 0;\n D = C;\n C = B;\n B = A;\n A = (T1 + T2) | 0;\n }\n // Add the compressed chunk to the current hash value\n A = (A + this.A) | 0;\n B = (B + this.B) | 0;\n C = (C + this.C) | 0;\n D = (D + this.D) | 0;\n E = (E + this.E) | 0;\n F = (F + this.F) | 0;\n G = (G + this.G) | 0;\n H = (H + this.H) | 0;\n this.set(A, B, C, D, E, F, G, H);\n }\n roundClean() {\n SHA256_W.fill(0);\n }\n destroy() {\n this.set(0, 0, 0, 0, 0, 0, 0, 0);\n this.buffer.fill(0);\n }\n}\n// Constants from https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\nclass SHA224 extends SHA256 {\n constructor() {\n super();\n this.A = 0xc1059ed8 | 0;\n this.B = 0x367cd507 | 0;\n this.C = 0x3070dd17 | 0;\n this.D = 0xf70e5939 | 0;\n this.E = 0xffc00b31 | 0;\n this.F = 0x68581511 | 0;\n this.G = 0x64f98fa7 | 0;\n this.H = 0xbefa4fa4 | 0;\n this.outputLen = 28;\n }\n}\n/**\n * SHA2-256 hash function\n * @param message - data that would be hashed\n */\nexport const sha256 = /* @__PURE__ */ wrapConstructor(() => new SHA256());\nexport const sha224 = /* @__PURE__ */ wrapConstructor(() => new SHA224());\n//# sourceMappingURL=sha256.js.map","const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);\nconst _32n = /* @__PURE__ */ BigInt(32);\n// We are not using BigUint64Array, because they are extremely slow as per 2022\nfunction fromBig(n, le = false) {\n if (le)\n return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };\n return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };\n}\nfunction split(lst, le = false) {\n let Ah = new Uint32Array(lst.length);\n let Al = new Uint32Array(lst.length);\n for (let i = 0; i < lst.length; i++) {\n const { h, l } = fromBig(lst[i], le);\n [Ah[i], Al[i]] = [h, l];\n }\n return [Ah, Al];\n}\nconst toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);\n// for Shift in [0, 32)\nconst shrSH = (h, _l, s) => h >>> s;\nconst shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// Right rotate for Shift in [1, 32)\nconst rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s));\nconst rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// Right rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32));\nconst rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s));\n// Right rotate for shift===32 (just swaps l&h)\nconst rotr32H = (_h, l) => l;\nconst rotr32L = (h, _l) => h;\n// Left rotate for Shift in [1, 32)\nconst rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s));\nconst rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s));\n// Left rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s));\nconst rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s));\n// JS uses 32-bit signed integers for bitwise operations which means we cannot\n// simple take carry out of low bit sum by shift, we need to use division.\nfunction add(Ah, Al, Bh, Bl) {\n const l = (Al >>> 0) + (Bl >>> 0);\n return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };\n}\n// Addition with more than 2 elements\nconst add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);\nconst add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0;\nconst add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);\nconst add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0;\nconst add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);\nconst add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;\n// prettier-ignore\nexport { fromBig, split, toBig, shrSH, shrSL, rotrSH, rotrSL, rotrBH, rotrBL, rotr32H, rotr32L, rotlSH, rotlSL, rotlBH, rotlBL, add, add3L, add3H, add4L, add4H, add5H, add5L, };\n// prettier-ignore\nconst u64 = {\n fromBig, split, toBig,\n shrSH, shrSL,\n rotrSH, rotrSL, rotrBH, rotrBL,\n rotr32H, rotr32L,\n rotlSH, rotlSL, rotlBH, rotlBL,\n add, add3L, add3H, add4L, add4H, add5H, add5L,\n};\nexport default u64;\n//# sourceMappingURL=_u64.js.map","import { SHA2 } from './_sha2.js';\nimport u64 from './_u64.js';\nimport { wrapConstructor } from './utils.js';\n// Round contants (first 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409):\n// prettier-ignore\nconst [SHA512_Kh, SHA512_Kl] = /* @__PURE__ */ (() => u64.split([\n '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc',\n '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118',\n '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2',\n '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694',\n '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65',\n '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5',\n '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4',\n '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70',\n '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df',\n '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b',\n '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30',\n '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8',\n '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8',\n '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3',\n '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec',\n '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b',\n '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178',\n '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b',\n '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c',\n '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817'\n].map(n => BigInt(n))))();\n// Temporary buffer, not used to store anything between runs\nconst SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);\nconst SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);\nexport class SHA512 extends SHA2 {\n constructor() {\n super(128, 64, 16, false);\n // We cannot use array here since array allows indexing by variable which means optimizer/compiler cannot use registers.\n // Also looks cleaner and easier to verify with spec.\n // Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19):\n // h -- high 32 bits, l -- low 32 bits\n this.Ah = 0x6a09e667 | 0;\n this.Al = 0xf3bcc908 | 0;\n this.Bh = 0xbb67ae85 | 0;\n this.Bl = 0x84caa73b | 0;\n this.Ch = 0x3c6ef372 | 0;\n this.Cl = 0xfe94f82b | 0;\n this.Dh = 0xa54ff53a | 0;\n this.Dl = 0x5f1d36f1 | 0;\n this.Eh = 0x510e527f | 0;\n this.El = 0xade682d1 | 0;\n this.Fh = 0x9b05688c | 0;\n this.Fl = 0x2b3e6c1f | 0;\n this.Gh = 0x1f83d9ab | 0;\n this.Gl = 0xfb41bd6b | 0;\n this.Hh = 0x5be0cd19 | 0;\n this.Hl = 0x137e2179 | 0;\n }\n // prettier-ignore\n get() {\n const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl];\n }\n // prettier-ignore\n set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) {\n this.Ah = Ah | 0;\n this.Al = Al | 0;\n this.Bh = Bh | 0;\n this.Bl = Bl | 0;\n this.Ch = Ch | 0;\n this.Cl = Cl | 0;\n this.Dh = Dh | 0;\n this.Dl = Dl | 0;\n this.Eh = Eh | 0;\n this.El = El | 0;\n this.Fh = Fh | 0;\n this.Fl = Fl | 0;\n this.Gh = Gh | 0;\n this.Gl = Gl | 0;\n this.Hh = Hh | 0;\n this.Hl = Hl | 0;\n }\n process(view, offset) {\n // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4) {\n SHA512_W_H[i] = view.getUint32(offset);\n SHA512_W_L[i] = view.getUint32((offset += 4));\n }\n for (let i = 16; i < 80; i++) {\n // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7)\n const W15h = SHA512_W_H[i - 15] | 0;\n const W15l = SHA512_W_L[i - 15] | 0;\n const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7);\n const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7);\n // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6)\n const W2h = SHA512_W_H[i - 2] | 0;\n const W2l = SHA512_W_L[i - 2] | 0;\n const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6);\n const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6);\n // SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16];\n const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);\n const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);\n SHA512_W_H[i] = SUMh | 0;\n SHA512_W_L[i] = SUMl | 0;\n }\n let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n // Compression function main loop, 80 rounds\n for (let i = 0; i < 80; i++) {\n // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41)\n const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41);\n const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41);\n //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const CHIh = (Eh & Fh) ^ (~Eh & Gh);\n const CHIl = (El & Fl) ^ (~El & Gl);\n // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i]\n // prettier-ignore\n const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);\n const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);\n const T1l = T1ll | 0;\n // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39)\n const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39);\n const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39);\n const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch);\n const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl);\n Hh = Gh | 0;\n Hl = Gl | 0;\n Gh = Fh | 0;\n Gl = Fl | 0;\n Fh = Eh | 0;\n Fl = El | 0;\n ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));\n Dh = Ch | 0;\n Dl = Cl | 0;\n Ch = Bh | 0;\n Cl = Bl | 0;\n Bh = Ah | 0;\n Bl = Al | 0;\n const All = u64.add3L(T1l, sigma0l, MAJl);\n Ah = u64.add3H(All, T1h, sigma0h, MAJh);\n Al = All | 0;\n }\n // Add the compressed chunk to the current hash value\n ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));\n ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));\n ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));\n ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));\n ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));\n ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));\n ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));\n ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));\n this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);\n }\n roundClean() {\n SHA512_W_H.fill(0);\n SHA512_W_L.fill(0);\n }\n destroy() {\n this.buffer.fill(0);\n this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n }\n}\nclass SHA512_224 extends SHA512 {\n constructor() {\n super();\n // h -- high 32 bits, l -- low 32 bits\n this.Ah = 0x8c3d37c8 | 0;\n this.Al = 0x19544da2 | 0;\n this.Bh = 0x73e19966 | 0;\n this.Bl = 0x89dcd4d6 | 0;\n this.Ch = 0x1dfab7ae | 0;\n this.Cl = 0x32ff9c82 | 0;\n this.Dh = 0x679dd514 | 0;\n this.Dl = 0x582f9fcf | 0;\n this.Eh = 0x0f6d2b69 | 0;\n this.El = 0x7bd44da8 | 0;\n this.Fh = 0x77e36f73 | 0;\n this.Fl = 0x04c48942 | 0;\n this.Gh = 0x3f9d85a8 | 0;\n this.Gl = 0x6a1d36c8 | 0;\n this.Hh = 0x1112e6ad | 0;\n this.Hl = 0x91d692a1 | 0;\n this.outputLen = 28;\n }\n}\nclass SHA512_256 extends SHA512 {\n constructor() {\n super();\n // h -- high 32 bits, l -- low 32 bits\n this.Ah = 0x22312194 | 0;\n this.Al = 0xfc2bf72c | 0;\n this.Bh = 0x9f555fa3 | 0;\n this.Bl = 0xc84c64c2 | 0;\n this.Ch = 0x2393b86b | 0;\n this.Cl = 0x6f53b151 | 0;\n this.Dh = 0x96387719 | 0;\n this.Dl = 0x5940eabd | 0;\n this.Eh = 0x96283ee2 | 0;\n this.El = 0xa88effe3 | 0;\n this.Fh = 0xbe5e1e25 | 0;\n this.Fl = 0x53863992 | 0;\n this.Gh = 0x2b0199fc | 0;\n this.Gl = 0x2c85b8aa | 0;\n this.Hh = 0x0eb72ddc | 0;\n this.Hl = 0x81c52ca2 | 0;\n this.outputLen = 32;\n }\n}\nclass SHA384 extends SHA512 {\n constructor() {\n super();\n // h -- high 32 bits, l -- low 32 bits\n this.Ah = 0xcbbb9d5d | 0;\n this.Al = 0xc1059ed8 | 0;\n this.Bh = 0x629a292a | 0;\n this.Bl = 0x367cd507 | 0;\n this.Ch = 0x9159015a | 0;\n this.Cl = 0x3070dd17 | 0;\n this.Dh = 0x152fecd8 | 0;\n this.Dl = 0xf70e5939 | 0;\n this.Eh = 0x67332667 | 0;\n this.El = 0xffc00b31 | 0;\n this.Fh = 0x8eb44a87 | 0;\n this.Fl = 0x68581511 | 0;\n this.Gh = 0xdb0c2e0d | 0;\n this.Gl = 0x64f98fa7 | 0;\n this.Hh = 0x47b5481d | 0;\n this.Hl = 0xbefa4fa4 | 0;\n this.outputLen = 48;\n }\n}\nexport const sha512 = /* @__PURE__ */ wrapConstructor(() => new SHA512());\nexport const sha512_224 = /* @__PURE__ */ wrapConstructor(() => new SHA512_224());\nexport const sha512_256 = /* @__PURE__ */ wrapConstructor(() => new SHA512_256());\nexport const sha384 = /* @__PURE__ */ wrapConstructor(() => new SHA384());\n//# sourceMappingURL=sha512.js.map","/* Browser Crypto Shims */\nimport { hmac } from \"@noble/hashes/hmac\";\nimport { pbkdf2 } from \"@noble/hashes/pbkdf2\";\nimport { sha256 } from \"@noble/hashes/sha256\";\nimport { sha512 } from \"@noble/hashes/sha512\";\nimport { assert, assertArgument } from \"../utils/index.js\";\nfunction getGlobal() {\n if (typeof self !== 'undefined') {\n return self;\n }\n if (typeof window !== 'undefined') {\n return window;\n }\n if (typeof global !== 'undefined') {\n return global;\n }\n throw new Error('unable to locate global object');\n}\n;\nconst anyGlobal = getGlobal();\nconst crypto = anyGlobal.crypto || anyGlobal.msCrypto;\nexport function createHash(algo) {\n switch (algo) {\n case \"sha256\": return sha256.create();\n case \"sha512\": return sha512.create();\n }\n assertArgument(false, \"invalid hashing algorithm name\", \"algorithm\", algo);\n}\nexport function createHmac(_algo, key) {\n const algo = ({ sha256, sha512 }[_algo]);\n assertArgument(algo != null, \"invalid hmac algorithm\", \"algorithm\", _algo);\n return hmac.create(algo, key);\n}\nexport function pbkdf2Sync(password, salt, iterations, keylen, _algo) {\n const algo = ({ sha256, sha512 }[_algo]);\n assertArgument(algo != null, \"invalid pbkdf2 algorithm\", \"algorithm\", _algo);\n return pbkdf2(algo, password, salt, { c: iterations, dkLen: keylen });\n}\nexport function randomBytes(length) {\n assert(crypto != null, \"platform does not support secure random numbers\", \"UNSUPPORTED_OPERATION\", {\n operation: \"randomBytes\"\n });\n assertArgument(Number.isInteger(length) && length > 0 && length <= 1024, \"invalid length\", \"length\", length);\n const result = new Uint8Array(length);\n crypto.getRandomValues(result);\n return result;\n}\n//# sourceMappingURL=crypto-browser.js.map","/**\n * An **HMAC** enables verification that a given key was used\n * to authenticate a payload.\n *\n * See: [[link-wiki-hmac]]\n *\n * @_subsection: api/crypto:HMAC [about-hmac]\n */\nimport { createHmac } from \"./crypto.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _computeHmac = function (algorithm, key, data) {\n return createHmac(algorithm, key).update(data).digest();\n};\nlet __computeHmac = _computeHmac;\n/**\n * Return the HMAC for %%data%% using the %%key%% key with the underlying\n * %%algo%% used for compression.\n *\n * @example:\n * key = id(\"some-secret\")\n *\n * // Compute the HMAC\n * computeHmac(\"sha256\", key, \"0x1337\")\n * //_result:\n *\n * // To compute the HMAC of UTF-8 data, the data must be\n * // converted to UTF-8 bytes\n * computeHmac(\"sha256\", key, toUtf8Bytes(\"Hello World\"))\n * //_result:\n *\n */\nexport function computeHmac(algorithm, _key, _data) {\n const key = getBytes(_key, \"key\");\n const data = getBytes(_data, \"data\");\n return hexlify(__computeHmac(algorithm, key, data));\n}\ncomputeHmac._ = _computeHmac;\ncomputeHmac.lock = function () { locked = true; };\ncomputeHmac.register = function (func) {\n if (locked) {\n throw new Error(\"computeHmac is locked\");\n }\n __computeHmac = func;\n};\nObject.freeze(computeHmac);\n//# sourceMappingURL=hmac.js.map","import { bytes, exists, number, output } from './_assert.js';\nimport { rotlBH, rotlBL, rotlSH, rotlSL, split } from './_u64.js';\nimport { Hash, u32, toBytes, wrapConstructor, wrapXOFConstructorWithOpts, } from './utils.js';\n// SHA3 (keccak) is based on a new design: basically, the internal state is bigger than output size.\n// It's called a sponge function.\n// Various per round constants calculations\nconst [SHA3_PI, SHA3_ROTL, _SHA3_IOTA] = [[], [], []];\nconst _0n = /* @__PURE__ */ BigInt(0);\nconst _1n = /* @__PURE__ */ BigInt(1);\nconst _2n = /* @__PURE__ */ BigInt(2);\nconst _7n = /* @__PURE__ */ BigInt(7);\nconst _256n = /* @__PURE__ */ BigInt(256);\nconst _0x71n = /* @__PURE__ */ BigInt(0x71);\nfor (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {\n // Pi\n [x, y] = [y, (2 * x + 3 * y) % 5];\n SHA3_PI.push(2 * (5 * y + x));\n // Rotational\n SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64);\n // Iota\n let t = _0n;\n for (let j = 0; j < 7; j++) {\n R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n;\n if (R & _2n)\n t ^= _1n << ((_1n << /* @__PURE__ */ BigInt(j)) - _1n);\n }\n _SHA3_IOTA.push(t);\n}\nconst [SHA3_IOTA_H, SHA3_IOTA_L] = /* @__PURE__ */ split(_SHA3_IOTA, true);\n// Left rotation (without 0, 32, 64)\nconst rotlH = (h, l, s) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s));\nconst rotlL = (h, l, s) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s));\n// Same as keccakf1600, but allows to skip some rounds\nexport function keccakP(s, rounds = 24) {\n const B = new Uint32Array(5 * 2);\n // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js)\n for (let round = 24 - rounds; round < 24; round++) {\n // Theta θ\n for (let x = 0; x < 10; x++)\n B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];\n for (let x = 0; x < 10; x += 2) {\n const idx1 = (x + 8) % 10;\n const idx0 = (x + 2) % 10;\n const B0 = B[idx0];\n const B1 = B[idx0 + 1];\n const Th = rotlH(B0, B1, 1) ^ B[idx1];\n const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];\n for (let y = 0; y < 50; y += 10) {\n s[x + y] ^= Th;\n s[x + y + 1] ^= Tl;\n }\n }\n // Rho (ρ) and Pi (π)\n let curH = s[2];\n let curL = s[3];\n for (let t = 0; t < 24; t++) {\n const shift = SHA3_ROTL[t];\n const Th = rotlH(curH, curL, shift);\n const Tl = rotlL(curH, curL, shift);\n const PI = SHA3_PI[t];\n curH = s[PI];\n curL = s[PI + 1];\n s[PI] = Th;\n s[PI + 1] = Tl;\n }\n // Chi (χ)\n for (let y = 0; y < 50; y += 10) {\n for (let x = 0; x < 10; x++)\n B[x] = s[y + x];\n for (let x = 0; x < 10; x++)\n s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];\n }\n // Iota (ι)\n s[0] ^= SHA3_IOTA_H[round];\n s[1] ^= SHA3_IOTA_L[round];\n }\n B.fill(0);\n}\nexport class Keccak extends Hash {\n // NOTE: we accept arguments in bytes instead of bits here.\n constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {\n super();\n this.blockLen = blockLen;\n this.suffix = suffix;\n this.outputLen = outputLen;\n this.enableXOF = enableXOF;\n this.rounds = rounds;\n this.pos = 0;\n this.posOut = 0;\n this.finished = false;\n this.destroyed = false;\n // Can be passed from user as dkLen\n number(outputLen);\n // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes\n if (0 >= this.blockLen || this.blockLen >= 200)\n throw new Error('Sha3 supports only keccak-f1600 function');\n this.state = new Uint8Array(200);\n this.state32 = u32(this.state);\n }\n keccak() {\n keccakP(this.state32, this.rounds);\n this.posOut = 0;\n this.pos = 0;\n }\n update(data) {\n exists(this);\n const { blockLen, state } = this;\n data = toBytes(data);\n const len = data.length;\n for (let pos = 0; pos < len;) {\n const take = Math.min(blockLen - this.pos, len - pos);\n for (let i = 0; i < take; i++)\n state[this.pos++] ^= data[pos++];\n if (this.pos === blockLen)\n this.keccak();\n }\n return this;\n }\n finish() {\n if (this.finished)\n return;\n this.finished = true;\n const { state, suffix, pos, blockLen } = this;\n // Do the padding\n state[pos] ^= suffix;\n if ((suffix & 0x80) !== 0 && pos === blockLen - 1)\n this.keccak();\n state[blockLen - 1] ^= 0x80;\n this.keccak();\n }\n writeInto(out) {\n exists(this, false);\n bytes(out);\n this.finish();\n const bufferOut = this.state;\n const { blockLen } = this;\n for (let pos = 0, len = out.length; pos < len;) {\n if (this.posOut >= blockLen)\n this.keccak();\n const take = Math.min(blockLen - this.posOut, len - pos);\n out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);\n this.posOut += take;\n pos += take;\n }\n return out;\n }\n xofInto(out) {\n // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF\n if (!this.enableXOF)\n throw new Error('XOF is not possible for this instance');\n return this.writeInto(out);\n }\n xof(bytes) {\n number(bytes);\n return this.xofInto(new Uint8Array(bytes));\n }\n digestInto(out) {\n output(out, this);\n if (this.finished)\n throw new Error('digest() was already called');\n this.writeInto(out);\n this.destroy();\n return out;\n }\n digest() {\n return this.digestInto(new Uint8Array(this.outputLen));\n }\n destroy() {\n this.destroyed = true;\n this.state.fill(0);\n }\n _cloneInto(to) {\n const { blockLen, suffix, outputLen, rounds, enableXOF } = this;\n to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds));\n to.state32.set(this.state32);\n to.pos = this.pos;\n to.posOut = this.posOut;\n to.finished = this.finished;\n to.rounds = rounds;\n // Suffix can change in cSHAKE\n to.suffix = suffix;\n to.outputLen = outputLen;\n to.enableXOF = enableXOF;\n to.destroyed = this.destroyed;\n return to;\n }\n}\nconst gen = (suffix, blockLen, outputLen) => wrapConstructor(() => new Keccak(blockLen, suffix, outputLen));\nexport const sha3_224 = /* @__PURE__ */ gen(0x06, 144, 224 / 8);\n/**\n * SHA3-256 hash function\n * @param message - that would be hashed\n */\nexport const sha3_256 = /* @__PURE__ */ gen(0x06, 136, 256 / 8);\nexport const sha3_384 = /* @__PURE__ */ gen(0x06, 104, 384 / 8);\nexport const sha3_512 = /* @__PURE__ */ gen(0x06, 72, 512 / 8);\nexport const keccak_224 = /* @__PURE__ */ gen(0x01, 144, 224 / 8);\n/**\n * keccak-256 hash function. Different from SHA3-256.\n * @param message - that would be hashed\n */\nexport const keccak_256 = /* @__PURE__ */ gen(0x01, 136, 256 / 8);\nexport const keccak_384 = /* @__PURE__ */ gen(0x01, 104, 384 / 8);\nexport const keccak_512 = /* @__PURE__ */ gen(0x01, 72, 512 / 8);\nconst genShake = (suffix, blockLen, outputLen) => wrapXOFConstructorWithOpts((opts = {}) => new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true));\nexport const shake128 = /* @__PURE__ */ genShake(0x1f, 168, 128 / 8);\nexport const shake256 = /* @__PURE__ */ genShake(0x1f, 136, 256 / 8);\n//# sourceMappingURL=sha3.js.map","/**\n * Cryptographic hashing functions\n *\n * @_subsection: api/crypto:Hash Functions [about-crypto-hashing]\n */\nimport { keccak_256 } from \"@noble/hashes/sha3\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _keccak256 = function (data) {\n return keccak_256(data);\n};\nlet __keccak256 = _keccak256;\n/**\n * Compute the cryptographic KECCAK256 hash of %%data%%.\n *\n * The %%data%% **must** be a data representation, to compute the\n * hash of UTF-8 data use the [[id]] function.\n *\n * @returns DataHexstring\n * @example:\n * keccak256(\"0x\")\n * //_result:\n *\n * keccak256(\"0x1337\")\n * //_result:\n *\n * keccak256(new Uint8Array([ 0x13, 0x37 ]))\n * //_result:\n *\n * // Strings are assumed to be DataHexString, otherwise it will\n * // throw. To hash UTF-8 data, see the note above.\n * keccak256(\"Hello World\")\n * //_error:\n */\nexport function keccak256(_data) {\n const data = getBytes(_data, \"data\");\n return hexlify(__keccak256(data));\n}\nkeccak256._ = _keccak256;\nkeccak256.lock = function () { locked = true; };\nkeccak256.register = function (func) {\n if (locked) {\n throw new TypeError(\"keccak256 is locked\");\n }\n __keccak256 = func;\n};\nObject.freeze(keccak256);\n//# sourceMappingURL=keccak.js.map","import { SHA2 } from './_sha2.js';\nimport { wrapConstructor } from './utils.js';\n// https://homes.esat.kuleuven.be/~bosselae/ripemd160.html\n// https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf\nconst Rho = /* @__PURE__ */ new Uint8Array([7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8]);\nconst Id = /* @__PURE__ */ Uint8Array.from({ length: 16 }, (_, i) => i);\nconst Pi = /* @__PURE__ */ Id.map((i) => (9 * i + 5) % 16);\nlet idxL = [Id];\nlet idxR = [Pi];\nfor (let i = 0; i < 4; i++)\n for (let j of [idxL, idxR])\n j.push(j[i].map((k) => Rho[k]));\nconst shifts = /* @__PURE__ */ [\n [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8],\n [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7],\n [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9],\n [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6],\n [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5],\n].map((i) => new Uint8Array(i));\nconst shiftsL = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts[i][j]));\nconst shiftsR = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts[i][j]));\nconst Kl = /* @__PURE__ */ new Uint32Array([\n 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e,\n]);\nconst Kr = /* @__PURE__ */ new Uint32Array([\n 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000,\n]);\n// The rotate left (circular left shift) operation for uint32\nconst rotl = (word, shift) => (word << shift) | (word >>> (32 - shift));\n// It's called f() in spec.\nfunction f(group, x, y, z) {\n if (group === 0)\n return x ^ y ^ z;\n else if (group === 1)\n return (x & y) | (~x & z);\n else if (group === 2)\n return (x | ~y) ^ z;\n else if (group === 3)\n return (x & z) | (y & ~z);\n else\n return x ^ (y | ~z);\n}\n// Temporary buffer, not used to store anything between runs\nconst BUF = /* @__PURE__ */ new Uint32Array(16);\nexport class RIPEMD160 extends SHA2 {\n constructor() {\n super(64, 20, 8, true);\n this.h0 = 0x67452301 | 0;\n this.h1 = 0xefcdab89 | 0;\n this.h2 = 0x98badcfe | 0;\n this.h3 = 0x10325476 | 0;\n this.h4 = 0xc3d2e1f0 | 0;\n }\n get() {\n const { h0, h1, h2, h3, h4 } = this;\n return [h0, h1, h2, h3, h4];\n }\n set(h0, h1, h2, h3, h4) {\n this.h0 = h0 | 0;\n this.h1 = h1 | 0;\n this.h2 = h2 | 0;\n this.h3 = h3 | 0;\n this.h4 = h4 | 0;\n }\n process(view, offset) {\n for (let i = 0; i < 16; i++, offset += 4)\n BUF[i] = view.getUint32(offset, true);\n // prettier-ignore\n let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el;\n // Instead of iterating 0 to 80, we split it into 5 groups\n // And use the groups in constants, functions, etc. Much simpler\n for (let group = 0; group < 5; group++) {\n const rGroup = 4 - group;\n const hbl = Kl[group], hbr = Kr[group]; // prettier-ignore\n const rl = idxL[group], rr = idxR[group]; // prettier-ignore\n const sl = shiftsL[group], sr = shiftsR[group]; // prettier-ignore\n for (let i = 0; i < 16; i++) {\n const tl = (rotl(al + f(group, bl, cl, dl) + BUF[rl[i]] + hbl, sl[i]) + el) | 0;\n al = el, el = dl, dl = rotl(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore\n }\n // 2 loops are 10% faster\n for (let i = 0; i < 16; i++) {\n const tr = (rotl(ar + f(rGroup, br, cr, dr) + BUF[rr[i]] + hbr, sr[i]) + er) | 0;\n ar = er, er = dr, dr = rotl(cr, 10) | 0, cr = br, br = tr; // prettier-ignore\n }\n }\n // Add the compressed chunk to the current hash value\n this.set((this.h1 + cl + dr) | 0, (this.h2 + dl + er) | 0, (this.h3 + el + ar) | 0, (this.h4 + al + br) | 0, (this.h0 + bl + cr) | 0);\n }\n roundClean() {\n BUF.fill(0);\n }\n destroy() {\n this.destroyed = true;\n this.buffer.fill(0);\n this.set(0, 0, 0, 0, 0);\n }\n}\n/**\n * RIPEMD-160 - a hash function from 1990s.\n * @param message - msg that would be hashed\n */\nexport const ripemd160 = /* @__PURE__ */ wrapConstructor(() => new RIPEMD160());\n//# sourceMappingURL=ripemd160.js.map","import { ripemd160 as noble_ripemd160 } from \"@noble/hashes/ripemd160\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _ripemd160 = function (data) {\n return noble_ripemd160(data);\n};\nlet __ripemd160 = _ripemd160;\n/**\n * Compute the cryptographic RIPEMD-160 hash of %%data%%.\n *\n * @_docloc: api/crypto:Hash Functions\n * @returns DataHexstring\n *\n * @example:\n * ripemd160(\"0x\")\n * //_result:\n *\n * ripemd160(\"0x1337\")\n * //_result:\n *\n * ripemd160(new Uint8Array([ 0x13, 0x37 ]))\n * //_result:\n *\n */\nexport function ripemd160(_data) {\n const data = getBytes(_data, \"data\");\n return hexlify(__ripemd160(data));\n}\nripemd160._ = _ripemd160;\nripemd160.lock = function () { locked = true; };\nripemd160.register = function (func) {\n if (locked) {\n throw new TypeError(\"ripemd160 is locked\");\n }\n __ripemd160 = func;\n};\nObject.freeze(ripemd160);\n//# sourceMappingURL=ripemd160.js.map","/**\n * A **Password-Based Key-Derivation Function** is designed to create\n * a sequence of bytes suitible as a **key** from a human-rememberable\n * password.\n *\n * @_subsection: api/crypto:Passwords [about-pbkdf]\n */\nimport { pbkdf2Sync } from \"./crypto.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _pbkdf2 = function (password, salt, iterations, keylen, algo) {\n return pbkdf2Sync(password, salt, iterations, keylen, algo);\n};\nlet __pbkdf2 = _pbkdf2;\n/**\n * Return the [[link-pbkdf2]] for %%keylen%% bytes for %%password%% using\n * the %%salt%% and using %%iterations%% of %%algo%%.\n *\n * This PBKDF is outdated and should not be used in new projects, but is\n * required to decrypt older files.\n *\n * @example:\n * // The password must be converted to bytes, and it is generally\n * // best practices to ensure the string has been normalized. Many\n * // formats explicitly indicate the normalization form to use.\n * password = \"hello\"\n * passwordBytes = toUtf8Bytes(password, \"NFKC\")\n *\n * salt = id(\"some-salt\")\n *\n * // Compute the PBKDF2\n * pbkdf2(passwordBytes, salt, 1024, 16, \"sha256\")\n * //_result:\n */\nexport function pbkdf2(_password, _salt, iterations, keylen, algo) {\n const password = getBytes(_password, \"password\");\n const salt = getBytes(_salt, \"salt\");\n return hexlify(__pbkdf2(password, salt, iterations, keylen, algo));\n}\npbkdf2._ = _pbkdf2;\npbkdf2.lock = function () { locked = true; };\npbkdf2.register = function (func) {\n if (locked) {\n throw new Error(\"pbkdf2 is locked\");\n }\n __pbkdf2 = func;\n};\nObject.freeze(pbkdf2);\n//# sourceMappingURL=pbkdf2.js.map","/**\n * A **Cryptographically Secure Random Value** is one that has been\n * generated with additional care take to prevent side-channels\n * from allowing others to detect it and prevent others from through\n * coincidence generate the same values.\n *\n * @_subsection: api/crypto:Random Values [about-crypto-random]\n */\nimport { randomBytes as crypto_random } from \"./crypto.js\";\nlet locked = false;\nconst _randomBytes = function (length) {\n return new Uint8Array(crypto_random(length));\n};\nlet __randomBytes = _randomBytes;\n/**\n * Return %%length%% bytes of cryptographically secure random data.\n *\n * @example:\n * randomBytes(8)\n * //_result:\n */\nexport function randomBytes(length) {\n return __randomBytes(length);\n}\nrandomBytes._ = _randomBytes;\nrandomBytes.lock = function () { locked = true; };\nrandomBytes.register = function (func) {\n if (locked) {\n throw new Error(\"randomBytes is locked\");\n }\n __randomBytes = func;\n};\nObject.freeze(randomBytes);\n//# sourceMappingURL=random.js.map","import { number as assertNumber } from './_assert.js';\nimport { sha256 } from './sha256.js';\nimport { pbkdf2 } from './pbkdf2.js';\nimport { asyncLoop, checkOpts, u32 } from './utils.js';\n// RFC 7914 Scrypt KDF\n// Left rotate for uint32\nconst rotl = (a, b) => (a << b) | (a >>> (32 - b));\n// The main Scrypt loop: uses Salsa extensively.\n// Six versions of the function were tried, this is the fastest one.\n// prettier-ignore\nfunction XorAndSalsa(prev, pi, input, ii, out, oi) {\n // Based on https://cr.yp.to/salsa20.html\n // Xor blocks\n let y00 = prev[pi++] ^ input[ii++], y01 = prev[pi++] ^ input[ii++];\n let y02 = prev[pi++] ^ input[ii++], y03 = prev[pi++] ^ input[ii++];\n let y04 = prev[pi++] ^ input[ii++], y05 = prev[pi++] ^ input[ii++];\n let y06 = prev[pi++] ^ input[ii++], y07 = prev[pi++] ^ input[ii++];\n let y08 = prev[pi++] ^ input[ii++], y09 = prev[pi++] ^ input[ii++];\n let y10 = prev[pi++] ^ input[ii++], y11 = prev[pi++] ^ input[ii++];\n let y12 = prev[pi++] ^ input[ii++], y13 = prev[pi++] ^ input[ii++];\n let y14 = prev[pi++] ^ input[ii++], y15 = prev[pi++] ^ input[ii++];\n // Save state to temporary variables (salsa)\n let x00 = y00, x01 = y01, x02 = y02, x03 = y03, x04 = y04, x05 = y05, x06 = y06, x07 = y07, x08 = y08, x09 = y09, x10 = y10, x11 = y11, x12 = y12, x13 = y13, x14 = y14, x15 = y15;\n // Main loop (salsa)\n for (let i = 0; i < 8; i += 2) {\n x04 ^= rotl(x00 + x12 | 0, 7);\n x08 ^= rotl(x04 + x00 | 0, 9);\n x12 ^= rotl(x08 + x04 | 0, 13);\n x00 ^= rotl(x12 + x08 | 0, 18);\n x09 ^= rotl(x05 + x01 | 0, 7);\n x13 ^= rotl(x09 + x05 | 0, 9);\n x01 ^= rotl(x13 + x09 | 0, 13);\n x05 ^= rotl(x01 + x13 | 0, 18);\n x14 ^= rotl(x10 + x06 | 0, 7);\n x02 ^= rotl(x14 + x10 | 0, 9);\n x06 ^= rotl(x02 + x14 | 0, 13);\n x10 ^= rotl(x06 + x02 | 0, 18);\n x03 ^= rotl(x15 + x11 | 0, 7);\n x07 ^= rotl(x03 + x15 | 0, 9);\n x11 ^= rotl(x07 + x03 | 0, 13);\n x15 ^= rotl(x11 + x07 | 0, 18);\n x01 ^= rotl(x00 + x03 | 0, 7);\n x02 ^= rotl(x01 + x00 | 0, 9);\n x03 ^= rotl(x02 + x01 | 0, 13);\n x00 ^= rotl(x03 + x02 | 0, 18);\n x06 ^= rotl(x05 + x04 | 0, 7);\n x07 ^= rotl(x06 + x05 | 0, 9);\n x04 ^= rotl(x07 + x06 | 0, 13);\n x05 ^= rotl(x04 + x07 | 0, 18);\n x11 ^= rotl(x10 + x09 | 0, 7);\n x08 ^= rotl(x11 + x10 | 0, 9);\n x09 ^= rotl(x08 + x11 | 0, 13);\n x10 ^= rotl(x09 + x08 | 0, 18);\n x12 ^= rotl(x15 + x14 | 0, 7);\n x13 ^= rotl(x12 + x15 | 0, 9);\n x14 ^= rotl(x13 + x12 | 0, 13);\n x15 ^= rotl(x14 + x13 | 0, 18);\n }\n // Write output (salsa)\n out[oi++] = (y00 + x00) | 0;\n out[oi++] = (y01 + x01) | 0;\n out[oi++] = (y02 + x02) | 0;\n out[oi++] = (y03 + x03) | 0;\n out[oi++] = (y04 + x04) | 0;\n out[oi++] = (y05 + x05) | 0;\n out[oi++] = (y06 + x06) | 0;\n out[oi++] = (y07 + x07) | 0;\n out[oi++] = (y08 + x08) | 0;\n out[oi++] = (y09 + x09) | 0;\n out[oi++] = (y10 + x10) | 0;\n out[oi++] = (y11 + x11) | 0;\n out[oi++] = (y12 + x12) | 0;\n out[oi++] = (y13 + x13) | 0;\n out[oi++] = (y14 + x14) | 0;\n out[oi++] = (y15 + x15) | 0;\n}\nfunction BlockMix(input, ii, out, oi, r) {\n // The block B is r 128-byte chunks (which is equivalent of 2r 64-byte chunks)\n let head = oi + 0;\n let tail = oi + 16 * r;\n for (let i = 0; i < 16; i++)\n out[tail + i] = input[ii + (2 * r - 1) * 16 + i]; // X ← B[2r−1]\n for (let i = 0; i < r; i++, head += 16, ii += 16) {\n // We write odd & even Yi at same time. Even: 0bXXXXX0 Odd: 0bXXXXX1\n XorAndSalsa(out, tail, input, ii, out, head); // head[i] = Salsa(blockIn[2*i] ^ tail[i-1])\n if (i > 0)\n tail += 16; // First iteration overwrites tmp value in tail\n XorAndSalsa(out, head, input, (ii += 16), out, tail); // tail[i] = Salsa(blockIn[2*i+1] ^ head[i])\n }\n}\n// Common prologue and epilogue for sync/async functions\nfunction scryptInit(password, salt, _opts) {\n // Maxmem - 1GB+1KB by default\n const opts = checkOpts({\n dkLen: 32,\n asyncTick: 10,\n maxmem: 1024 ** 3 + 1024,\n }, _opts);\n const { N, r, p, dkLen, asyncTick, maxmem, onProgress } = opts;\n assertNumber(N);\n assertNumber(r);\n assertNumber(p);\n assertNumber(dkLen);\n assertNumber(asyncTick);\n assertNumber(maxmem);\n if (onProgress !== undefined && typeof onProgress !== 'function')\n throw new Error('progressCb should be function');\n const blockSize = 128 * r;\n const blockSize32 = blockSize / 4;\n if (N <= 1 || (N & (N - 1)) !== 0 || N >= 2 ** (blockSize / 8) || N > 2 ** 32) {\n // NOTE: we limit N to be less than 2**32 because of 32 bit variant of Integrify function\n // There is no JS engines that allows alocate more than 4GB per single Uint8Array for now, but can change in future.\n throw new Error('Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32');\n }\n if (p < 0 || p > ((2 ** 32 - 1) * 32) / blockSize) {\n throw new Error('Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)');\n }\n if (dkLen < 0 || dkLen > (2 ** 32 - 1) * 32) {\n throw new Error('Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32');\n }\n const memUsed = blockSize * (N + p);\n if (memUsed > maxmem) {\n throw new Error(`Scrypt: parameters too large, ${memUsed} (128 * r * (N + p)) > ${maxmem} (maxmem)`);\n }\n // [B0...Bp−1] ← PBKDF2HMAC-SHA256(Passphrase, Salt, 1, blockSize*ParallelizationFactor)\n // Since it has only one iteration there is no reason to use async variant\n const B = pbkdf2(sha256, password, salt, { c: 1, dkLen: blockSize * p });\n const B32 = u32(B);\n // Re-used between parallel iterations. Array(iterations) of B\n const V = u32(new Uint8Array(blockSize * N));\n const tmp = u32(new Uint8Array(blockSize));\n let blockMixCb = () => { };\n if (onProgress) {\n const totalBlockMix = 2 * N * p;\n // Invoke callback if progress changes from 10.01 to 10.02\n // Allows to draw smooth progress bar on up to 8K screen\n const callbackPer = Math.max(Math.floor(totalBlockMix / 10000), 1);\n let blockMixCnt = 0;\n blockMixCb = () => {\n blockMixCnt++;\n if (onProgress && (!(blockMixCnt % callbackPer) || blockMixCnt === totalBlockMix))\n onProgress(blockMixCnt / totalBlockMix);\n };\n }\n return { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick };\n}\nfunction scryptOutput(password, dkLen, B, V, tmp) {\n const res = pbkdf2(sha256, password, B, { c: 1, dkLen });\n B.fill(0);\n V.fill(0);\n tmp.fill(0);\n return res;\n}\n/**\n * Scrypt KDF from RFC 7914.\n * @param password - pass\n * @param salt - salt\n * @param opts - parameters\n * - `N` is cpu/mem work factor (power of 2 e.g. 2**18)\n * - `r` is block size (8 is common), fine-tunes sequential memory read size and performance\n * - `p` is parallelization factor (1 is common)\n * - `dkLen` is output key length in bytes e.g. 32.\n * - `asyncTick` - (default: 10) max time in ms for which async function can block execution\n * - `maxmem` - (default: `1024 ** 3 + 1024` aka 1GB+1KB). A limit that the app could use for scrypt\n * - `onProgress` - callback function that would be executed for progress report\n * @returns Derived key\n */\nexport function scrypt(password, salt, opts) {\n const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb } = scryptInit(password, salt, opts);\n for (let pi = 0; pi < p; pi++) {\n const Pi = blockSize32 * pi;\n for (let i = 0; i < blockSize32; i++)\n V[i] = B32[Pi + i]; // V[0] = B[i]\n for (let i = 0, pos = 0; i < N - 1; i++) {\n BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]);\n blockMixCb();\n }\n BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element\n blockMixCb();\n for (let i = 0; i < N; i++) {\n // First u32 of the last 64-byte block (u32 is LE)\n const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations\n for (let k = 0; k < blockSize32; k++)\n tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j]\n BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j])\n blockMixCb();\n }\n }\n return scryptOutput(password, dkLen, B, V, tmp);\n}\n/**\n * Scrypt KDF from RFC 7914.\n */\nexport async function scryptAsync(password, salt, opts) {\n const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick } = scryptInit(password, salt, opts);\n for (let pi = 0; pi < p; pi++) {\n const Pi = blockSize32 * pi;\n for (let i = 0; i < blockSize32; i++)\n V[i] = B32[Pi + i]; // V[0] = B[i]\n let pos = 0;\n await asyncLoop(N - 1, asyncTick, () => {\n BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]);\n blockMixCb();\n });\n BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element\n blockMixCb();\n await asyncLoop(N, asyncTick, () => {\n // First u32 of the last 64-byte block (u32 is LE)\n const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations\n for (let k = 0; k < blockSize32; k++)\n tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j]\n BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j])\n blockMixCb();\n });\n }\n return scryptOutput(password, dkLen, B, V, tmp);\n}\n//# sourceMappingURL=scrypt.js.map","import { scrypt as _nobleSync, scryptAsync as _nobleAsync } from \"@noble/hashes/scrypt\";\nimport { getBytes, hexlify as H } from \"../utils/index.js\";\nlet lockedSync = false, lockedAsync = false;\nconst _scryptAsync = async function (passwd, salt, N, r, p, dkLen, onProgress) {\n return await _nobleAsync(passwd, salt, { N, r, p, dkLen, onProgress });\n};\nconst _scryptSync = function (passwd, salt, N, r, p, dkLen) {\n return _nobleSync(passwd, salt, { N, r, p, dkLen });\n};\nlet __scryptAsync = _scryptAsync;\nlet __scryptSync = _scryptSync;\n/**\n * The [[link-wiki-scrypt]] uses a memory and cpu hard method of\n * derivation to increase the resource cost to brute-force a password\n * for a given key.\n *\n * This means this algorithm is intentionally slow, and can be tuned to\n * become slower. As computation and memory speed improve over time,\n * increasing the difficulty maintains the cost of an attacker.\n *\n * For example, if a target time of 5 seconds is used, a legitimate user\n * which knows their password requires only 5 seconds to unlock their\n * account. A 6 character password has 68 billion possibilities, which\n * would require an attacker to invest over 10,000 years of CPU time. This\n * is of course a crude example (as password generally aren't random),\n * but demonstrates to value of imposing large costs to decryption.\n *\n * For this reason, if building a UI which involved decrypting or\n * encrypting datsa using scrypt, it is recommended to use a\n * [[ProgressCallback]] (as event short periods can seem lik an eternity\n * if the UI freezes). Including the phrase //\"decrypting\"// in the UI\n * can also help, assuring the user their waiting is for a good reason.\n *\n * @_docloc: api/crypto:Passwords\n *\n * @example:\n * // The password must be converted to bytes, and it is generally\n * // best practices to ensure the string has been normalized. Many\n * // formats explicitly indicate the normalization form to use.\n * password = \"hello\"\n * passwordBytes = toUtf8Bytes(password, \"NFKC\")\n *\n * salt = id(\"some-salt\")\n *\n * // Compute the scrypt\n * scrypt(passwordBytes, salt, 1024, 8, 1, 16)\n * //_result:\n */\nexport async function scrypt(_passwd, _salt, N, r, p, dkLen, progress) {\n const passwd = getBytes(_passwd, \"passwd\");\n const salt = getBytes(_salt, \"salt\");\n return H(await __scryptAsync(passwd, salt, N, r, p, dkLen, progress));\n}\nscrypt._ = _scryptAsync;\nscrypt.lock = function () { lockedAsync = true; };\nscrypt.register = function (func) {\n if (lockedAsync) {\n throw new Error(\"scrypt is locked\");\n }\n __scryptAsync = func;\n};\nObject.freeze(scrypt);\n/**\n * Provides a synchronous variant of [[scrypt]].\n *\n * This will completely lock up and freeze the UI in a browser and will\n * prevent any event loop from progressing. For this reason, it is\n * preferred to use the [async variant](scrypt).\n *\n * @_docloc: api/crypto:Passwords\n *\n * @example:\n * // The password must be converted to bytes, and it is generally\n * // best practices to ensure the string has been normalized. Many\n * // formats explicitly indicate the normalization form to use.\n * password = \"hello\"\n * passwordBytes = toUtf8Bytes(password, \"NFKC\")\n *\n * salt = id(\"some-salt\")\n *\n * // Compute the scrypt\n * scryptSync(passwordBytes, salt, 1024, 8, 1, 16)\n * //_result:\n */\nexport function scryptSync(_passwd, _salt, N, r, p, dkLen) {\n const passwd = getBytes(_passwd, \"passwd\");\n const salt = getBytes(_salt, \"salt\");\n return H(__scryptSync(passwd, salt, N, r, p, dkLen));\n}\nscryptSync._ = _scryptSync;\nscryptSync.lock = function () { lockedSync = true; };\nscryptSync.register = function (func) {\n if (lockedSync) {\n throw new Error(\"scryptSync is locked\");\n }\n __scryptSync = func;\n};\nObject.freeze(scryptSync);\n//# sourceMappingURL=scrypt.js.map","import { createHash } from \"./crypto.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nconst _sha256 = function (data) {\n return createHash(\"sha256\").update(data).digest();\n};\nconst _sha512 = function (data) {\n return createHash(\"sha512\").update(data).digest();\n};\nlet __sha256 = _sha256;\nlet __sha512 = _sha512;\nlet locked256 = false, locked512 = false;\n/**\n * Compute the cryptographic SHA2-256 hash of %%data%%.\n *\n * @_docloc: api/crypto:Hash Functions\n * @returns DataHexstring\n *\n * @example:\n * sha256(\"0x\")\n * //_result:\n *\n * sha256(\"0x1337\")\n * //_result:\n *\n * sha256(new Uint8Array([ 0x13, 0x37 ]))\n * //_result:\n *\n */\nexport function sha256(_data) {\n const data = getBytes(_data, \"data\");\n return hexlify(__sha256(data));\n}\nsha256._ = _sha256;\nsha256.lock = function () { locked256 = true; };\nsha256.register = function (func) {\n if (locked256) {\n throw new Error(\"sha256 is locked\");\n }\n __sha256 = func;\n};\nObject.freeze(sha256);\n/**\n * Compute the cryptographic SHA2-512 hash of %%data%%.\n *\n * @_docloc: api/crypto:Hash Functions\n * @returns DataHexstring\n *\n * @example:\n * sha512(\"0x\")\n * //_result:\n *\n * sha512(\"0x1337\")\n * //_result:\n *\n * sha512(new Uint8Array([ 0x13, 0x37 ]))\n * //_result:\n */\nexport function sha512(_data) {\n const data = getBytes(_data, \"data\");\n return hexlify(__sha512(data));\n}\nsha512._ = _sha512;\nsha512.lock = function () { locked512 = true; };\nsha512.register = function (func) {\n if (locked512) {\n throw new Error(\"sha512 is locked\");\n }\n __sha512 = func;\n};\nObject.freeze(sha256);\n//# sourceMappingURL=sha2.js.map","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// 100 lines of code in the file are duplicated from noble-hashes (utils).\n// This is OK: `abstract` directory does not use noble-hashes.\n// User may opt-in into using different hashing library. This way, noble-hashes\n// won't be included into their bundle.\nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\nconst _2n = BigInt(2);\nconst u8a = (a) => a instanceof Uint8Array;\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));\n/**\n * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'\n */\nexport function bytesToHex(bytes) {\n if (!u8a(bytes))\n throw new Error('Uint8Array expected');\n // pre-caching improves the speed 6x\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += hexes[bytes[i]];\n }\n return hex;\n}\nexport function numberToHexUnpadded(num) {\n const hex = num.toString(16);\n return hex.length & 1 ? `0${hex}` : hex;\n}\nexport function hexToNumber(hex) {\n if (typeof hex !== 'string')\n throw new Error('hex string expected, got ' + typeof hex);\n // Big Endian\n return BigInt(hex === '' ? '0' : `0x${hex}`);\n}\n/**\n * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n */\nexport function hexToBytes(hex) {\n if (typeof hex !== 'string')\n throw new Error('hex string expected, got ' + typeof hex);\n const len = hex.length;\n if (len % 2)\n throw new Error('padded hex string expected, got unpadded hex of length ' + len);\n const array = new Uint8Array(len / 2);\n for (let i = 0; i < array.length; i++) {\n const j = i * 2;\n const hexByte = hex.slice(j, j + 2);\n const byte = Number.parseInt(hexByte, 16);\n if (Number.isNaN(byte) || byte < 0)\n throw new Error('Invalid byte sequence');\n array[i] = byte;\n }\n return array;\n}\n// BE: Big Endian, LE: Little Endian\nexport function bytesToNumberBE(bytes) {\n return hexToNumber(bytesToHex(bytes));\n}\nexport function bytesToNumberLE(bytes) {\n if (!u8a(bytes))\n throw new Error('Uint8Array expected');\n return hexToNumber(bytesToHex(Uint8Array.from(bytes).reverse()));\n}\nexport function numberToBytesBE(n, len) {\n return hexToBytes(n.toString(16).padStart(len * 2, '0'));\n}\nexport function numberToBytesLE(n, len) {\n return numberToBytesBE(n, len).reverse();\n}\n// Unpadded, rarely used\nexport function numberToVarBytesBE(n) {\n return hexToBytes(numberToHexUnpadded(n));\n}\n/**\n * Takes hex string or Uint8Array, converts to Uint8Array.\n * Validates output length.\n * Will throw error for other types.\n * @param title descriptive title for an error e.g. 'private key'\n * @param hex hex string or Uint8Array\n * @param expectedLength optional, will compare to result array's length\n * @returns\n */\nexport function ensureBytes(title, hex, expectedLength) {\n let res;\n if (typeof hex === 'string') {\n try {\n res = hexToBytes(hex);\n }\n catch (e) {\n throw new Error(`${title} must be valid hex string, got \"${hex}\". Cause: ${e}`);\n }\n }\n else if (u8a(hex)) {\n // Uint8Array.from() instead of hash.slice() because node.js Buffer\n // is instance of Uint8Array, and its slice() creates **mutable** copy\n res = Uint8Array.from(hex);\n }\n else {\n throw new Error(`${title} must be hex string or Uint8Array`);\n }\n const len = res.length;\n if (typeof expectedLength === 'number' && len !== expectedLength)\n throw new Error(`${title} expected ${expectedLength} bytes, got ${len}`);\n return res;\n}\n/**\n * Copies several Uint8Arrays into one.\n */\nexport function concatBytes(...arrays) {\n const r = new Uint8Array(arrays.reduce((sum, a) => sum + a.length, 0));\n let pad = 0; // walk through each item, ensure they have proper type\n arrays.forEach((a) => {\n if (!u8a(a))\n throw new Error('Uint8Array expected');\n r.set(a, pad);\n pad += a.length;\n });\n return r;\n}\nexport function equalBytes(b1, b2) {\n // We don't care about timing attacks here\n if (b1.length !== b2.length)\n return false;\n for (let i = 0; i < b1.length; i++)\n if (b1[i] !== b2[i])\n return false;\n return true;\n}\n/**\n * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99])\n */\nexport function utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new Error(`utf8ToBytes expected string, got ${typeof str}`);\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\n// Bit operations\n/**\n * Calculates amount of bits in a bigint.\n * Same as `n.toString(2).length`\n */\nexport function bitLen(n) {\n let len;\n for (len = 0; n > _0n; n >>= _1n, len += 1)\n ;\n return len;\n}\n/**\n * Gets single bit at position.\n * NOTE: first bit position is 0 (same as arrays)\n * Same as `!!+Array.from(n.toString(2)).reverse()[pos]`\n */\nexport function bitGet(n, pos) {\n return (n >> BigInt(pos)) & _1n;\n}\n/**\n * Sets single bit at position.\n */\nexport const bitSet = (n, pos, value) => {\n return n | ((value ? _1n : _0n) << BigInt(pos));\n};\n/**\n * Calculate mask for N bits. Not using ** operator with bigints because of old engines.\n * Same as BigInt(`0b${Array(i).fill('1').join('')}`)\n */\nexport const bitMask = (n) => (_2n << BigInt(n - 1)) - _1n;\n// DRBG\nconst u8n = (data) => new Uint8Array(data); // creates Uint8Array\nconst u8fr = (arr) => Uint8Array.from(arr); // another shortcut\n/**\n * Minimal HMAC-DRBG from NIST 800-90 for RFC6979 sigs.\n * @returns function that will call DRBG until 2nd arg returns something meaningful\n * @example\n * const drbg = createHmacDRBG(32, 32, hmac);\n * drbg(seed, bytesToKey); // bytesToKey must return Key or undefined\n */\nexport function createHmacDrbg(hashLen, qByteLen, hmacFn) {\n if (typeof hashLen !== 'number' || hashLen < 2)\n throw new Error('hashLen must be a number');\n if (typeof qByteLen !== 'number' || qByteLen < 2)\n throw new Error('qByteLen must be a number');\n if (typeof hmacFn !== 'function')\n throw new Error('hmacFn must be a function');\n // Step B, Step C: set hashLen to 8*ceil(hlen/8)\n let v = u8n(hashLen); // Minimal non-full-spec HMAC-DRBG from NIST 800-90 for RFC6979 sigs.\n let k = u8n(hashLen); // Steps B and C of RFC6979 3.2: set hashLen, in our case always same\n let i = 0; // Iterations counter, will throw when over 1000\n const reset = () => {\n v.fill(1);\n k.fill(0);\n i = 0;\n };\n const h = (...b) => hmacFn(k, v, ...b); // hmac(k)(v, ...values)\n const reseed = (seed = u8n()) => {\n // HMAC-DRBG reseed() function. Steps D-G\n k = h(u8fr([0x00]), seed); // k = hmac(k || v || 0x00 || seed)\n v = h(); // v = hmac(k || v)\n if (seed.length === 0)\n return;\n k = h(u8fr([0x01]), seed); // k = hmac(k || v || 0x01 || seed)\n v = h(); // v = hmac(k || v)\n };\n const gen = () => {\n // HMAC-DRBG generate() function\n if (i++ >= 1000)\n throw new Error('drbg: tried 1000 values');\n let len = 0;\n const out = [];\n while (len < qByteLen) {\n v = h();\n const sl = v.slice();\n out.push(sl);\n len += v.length;\n }\n return concatBytes(...out);\n };\n const genUntil = (seed, pred) => {\n reset();\n reseed(seed); // Steps D-G\n let res = undefined; // Step H: grind until k is in [1..n-1]\n while (!(res = pred(gen())))\n reseed();\n reset();\n return res;\n };\n return genUntil;\n}\n// Validating curves and fields\nconst validatorFns = {\n bigint: (val) => typeof val === 'bigint',\n function: (val) => typeof val === 'function',\n boolean: (val) => typeof val === 'boolean',\n string: (val) => typeof val === 'string',\n stringOrUint8Array: (val) => typeof val === 'string' || val instanceof Uint8Array,\n isSafeInteger: (val) => Number.isSafeInteger(val),\n array: (val) => Array.isArray(val),\n field: (val, object) => object.Fp.isValid(val),\n hash: (val) => typeof val === 'function' && Number.isSafeInteger(val.outputLen),\n};\n// type Record = { [P in K]: T; }\nexport function validateObject(object, validators, optValidators = {}) {\n const checkField = (fieldName, type, isOptional) => {\n const checkVal = validatorFns[type];\n if (typeof checkVal !== 'function')\n throw new Error(`Invalid validator \"${type}\", expected function`);\n const val = object[fieldName];\n if (isOptional && val === undefined)\n return;\n if (!checkVal(val, object)) {\n throw new Error(`Invalid param ${String(fieldName)}=${val} (${typeof val}), expected ${type}`);\n }\n };\n for (const [fieldName, type] of Object.entries(validators))\n checkField(fieldName, type, false);\n for (const [fieldName, type] of Object.entries(optValidators))\n checkField(fieldName, type, true);\n return object;\n}\n// validate type tests\n// const o: { a: number; b: number; c: number } = { a: 1, b: 5, c: 6 };\n// const z0 = validateObject(o, { a: 'isSafeInteger' }, { c: 'bigint' }); // Ok!\n// // Should fail type-check\n// const z1 = validateObject(o, { a: 'tmp' }, { c: 'zz' });\n// const z2 = validateObject(o, { a: 'isSafeInteger' }, { c: 'zz' });\n// const z3 = validateObject(o, { test: 'boolean', z: 'bug' });\n// const z4 = validateObject(o, { a: 'boolean', z: 'bug' });\n//# sourceMappingURL=utils.js.map","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// Utilities for modular arithmetics and finite fields\nimport { bitMask, numberToBytesBE, numberToBytesLE, bytesToNumberBE, bytesToNumberLE, ensureBytes, validateObject, } from './utils.js';\n// prettier-ignore\nconst _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3);\n// prettier-ignore\nconst _4n = BigInt(4), _5n = BigInt(5), _8n = BigInt(8);\n// prettier-ignore\nconst _9n = BigInt(9), _16n = BigInt(16);\n// Calculates a modulo b\nexport function mod(a, b) {\n const result = a % b;\n return result >= _0n ? result : b + result;\n}\n/**\n * Efficiently raise num to power and do modular division.\n * Unsafe in some contexts: uses ladder, so can expose bigint bits.\n * @example\n * pow(2n, 6n, 11n) // 64n % 11n == 9n\n */\n// TODO: use field version && remove\nexport function pow(num, power, modulo) {\n if (modulo <= _0n || power < _0n)\n throw new Error('Expected power/modulo > 0');\n if (modulo === _1n)\n return _0n;\n let res = _1n;\n while (power > _0n) {\n if (power & _1n)\n res = (res * num) % modulo;\n num = (num * num) % modulo;\n power >>= _1n;\n }\n return res;\n}\n// Does x ^ (2 ^ power) mod p. pow2(30, 4) == 30 ^ (2 ^ 4)\nexport function pow2(x, power, modulo) {\n let res = x;\n while (power-- > _0n) {\n res *= res;\n res %= modulo;\n }\n return res;\n}\n// Inverses number over modulo\nexport function invert(number, modulo) {\n if (number === _0n || modulo <= _0n) {\n throw new Error(`invert: expected positive integers, got n=${number} mod=${modulo}`);\n }\n // Euclidean GCD https://brilliant.org/wiki/extended-euclidean-algorithm/\n // Fermat's little theorem \"CT-like\" version inv(n) = n^(m-2) mod m is 30x slower.\n let a = mod(number, modulo);\n let b = modulo;\n // prettier-ignore\n let x = _0n, y = _1n, u = _1n, v = _0n;\n while (a !== _0n) {\n // JIT applies optimization if those two lines follow each other\n const q = b / a;\n const r = b % a;\n const m = x - u * q;\n const n = y - v * q;\n // prettier-ignore\n b = a, a = r, x = u, y = v, u = m, v = n;\n }\n const gcd = b;\n if (gcd !== _1n)\n throw new Error('invert: does not exist');\n return mod(x, modulo);\n}\n/**\n * Tonelli-Shanks square root search algorithm.\n * 1. https://eprint.iacr.org/2012/685.pdf (page 12)\n * 2. Square Roots from 1; 24, 51, 10 to Dan Shanks\n * Will start an infinite loop if field order P is not prime.\n * @param P field order\n * @returns function that takes field Fp (created from P) and number n\n */\nexport function tonelliShanks(P) {\n // Legendre constant: used to calculate Legendre symbol (a | p),\n // which denotes the value of a^((p-1)/2) (mod p).\n // (a | p) ≡ 1 if a is a square (mod p)\n // (a | p) ≡ -1 if a is not a square (mod p)\n // (a | p) ≡ 0 if a ≡ 0 (mod p)\n const legendreC = (P - _1n) / _2n;\n let Q, S, Z;\n // Step 1: By factoring out powers of 2 from p - 1,\n // find q and s such that p - 1 = q*(2^s) with q odd\n for (Q = P - _1n, S = 0; Q % _2n === _0n; Q /= _2n, S++)\n ;\n // Step 2: Select a non-square z such that (z | p) ≡ -1 and set c ≡ zq\n for (Z = _2n; Z < P && pow(Z, legendreC, P) !== P - _1n; Z++)\n ;\n // Fast-path\n if (S === 1) {\n const p1div4 = (P + _1n) / _4n;\n return function tonelliFast(Fp, n) {\n const root = Fp.pow(n, p1div4);\n if (!Fp.eql(Fp.sqr(root), n))\n throw new Error('Cannot find square root');\n return root;\n };\n }\n // Slow-path\n const Q1div2 = (Q + _1n) / _2n;\n return function tonelliSlow(Fp, n) {\n // Step 0: Check that n is indeed a square: (n | p) should not be ≡ -1\n if (Fp.pow(n, legendreC) === Fp.neg(Fp.ONE))\n throw new Error('Cannot find square root');\n let r = S;\n // TODO: will fail at Fp2/etc\n let g = Fp.pow(Fp.mul(Fp.ONE, Z), Q); // will update both x and b\n let x = Fp.pow(n, Q1div2); // first guess at the square root\n let b = Fp.pow(n, Q); // first guess at the fudge factor\n while (!Fp.eql(b, Fp.ONE)) {\n if (Fp.eql(b, Fp.ZERO))\n return Fp.ZERO; // https://en.wikipedia.org/wiki/Tonelli%E2%80%93Shanks_algorithm (4. If t = 0, return r = 0)\n // Find m such b^(2^m)==1\n let m = 1;\n for (let t2 = Fp.sqr(b); m < r; m++) {\n if (Fp.eql(t2, Fp.ONE))\n break;\n t2 = Fp.sqr(t2); // t2 *= t2\n }\n // NOTE: r-m-1 can be bigger than 32, need to convert to bigint before shift, otherwise there will be overflow\n const ge = Fp.pow(g, _1n << BigInt(r - m - 1)); // ge = 2^(r-m-1)\n g = Fp.sqr(ge); // g = ge * ge\n x = Fp.mul(x, ge); // x *= ge\n b = Fp.mul(b, g); // b *= g\n r = m;\n }\n return x;\n };\n}\nexport function FpSqrt(P) {\n // NOTE: different algorithms can give different roots, it is up to user to decide which one they want.\n // For example there is FpSqrtOdd/FpSqrtEven to choice root based on oddness (used for hash-to-curve).\n // P ≡ 3 (mod 4)\n // √n = n^((P+1)/4)\n if (P % _4n === _3n) {\n // Not all roots possible!\n // const ORDER =\n // 0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaabn;\n // const NUM = 72057594037927816n;\n const p1div4 = (P + _1n) / _4n;\n return function sqrt3mod4(Fp, n) {\n const root = Fp.pow(n, p1div4);\n // Throw if root**2 != n\n if (!Fp.eql(Fp.sqr(root), n))\n throw new Error('Cannot find square root');\n return root;\n };\n }\n // Atkin algorithm for q ≡ 5 (mod 8), https://eprint.iacr.org/2012/685.pdf (page 10)\n if (P % _8n === _5n) {\n const c1 = (P - _5n) / _8n;\n return function sqrt5mod8(Fp, n) {\n const n2 = Fp.mul(n, _2n);\n const v = Fp.pow(n2, c1);\n const nv = Fp.mul(n, v);\n const i = Fp.mul(Fp.mul(nv, _2n), v);\n const root = Fp.mul(nv, Fp.sub(i, Fp.ONE));\n if (!Fp.eql(Fp.sqr(root), n))\n throw new Error('Cannot find square root');\n return root;\n };\n }\n // P ≡ 9 (mod 16)\n if (P % _16n === _9n) {\n // NOTE: tonelli is too slow for bls-Fp2 calculations even on start\n // Means we cannot use sqrt for constants at all!\n //\n // const c1 = Fp.sqrt(Fp.negate(Fp.ONE)); // 1. c1 = sqrt(-1) in F, i.e., (c1^2) == -1 in F\n // const c2 = Fp.sqrt(c1); // 2. c2 = sqrt(c1) in F, i.e., (c2^2) == c1 in F\n // const c3 = Fp.sqrt(Fp.negate(c1)); // 3. c3 = sqrt(-c1) in F, i.e., (c3^2) == -c1 in F\n // const c4 = (P + _7n) / _16n; // 4. c4 = (q + 7) / 16 # Integer arithmetic\n // sqrt = (x) => {\n // let tv1 = Fp.pow(x, c4); // 1. tv1 = x^c4\n // let tv2 = Fp.mul(c1, tv1); // 2. tv2 = c1 * tv1\n // const tv3 = Fp.mul(c2, tv1); // 3. tv3 = c2 * tv1\n // let tv4 = Fp.mul(c3, tv1); // 4. tv4 = c3 * tv1\n // const e1 = Fp.equals(Fp.square(tv2), x); // 5. e1 = (tv2^2) == x\n // const e2 = Fp.equals(Fp.square(tv3), x); // 6. e2 = (tv3^2) == x\n // tv1 = Fp.cmov(tv1, tv2, e1); // 7. tv1 = CMOV(tv1, tv2, e1) # Select tv2 if (tv2^2) == x\n // tv2 = Fp.cmov(tv4, tv3, e2); // 8. tv2 = CMOV(tv4, tv3, e2) # Select tv3 if (tv3^2) == x\n // const e3 = Fp.equals(Fp.square(tv2), x); // 9. e3 = (tv2^2) == x\n // return Fp.cmov(tv1, tv2, e3); // 10. z = CMOV(tv1, tv2, e3) # Select the sqrt from tv1 and tv2\n // }\n }\n // Other cases: Tonelli-Shanks algorithm\n return tonelliShanks(P);\n}\n// Little-endian check for first LE bit (last BE bit);\nexport const isNegativeLE = (num, modulo) => (mod(num, modulo) & _1n) === _1n;\n// prettier-ignore\nconst FIELD_FIELDS = [\n 'create', 'isValid', 'is0', 'neg', 'inv', 'sqrt', 'sqr',\n 'eql', 'add', 'sub', 'mul', 'pow', 'div',\n 'addN', 'subN', 'mulN', 'sqrN'\n];\nexport function validateField(field) {\n const initial = {\n ORDER: 'bigint',\n MASK: 'bigint',\n BYTES: 'isSafeInteger',\n BITS: 'isSafeInteger',\n };\n const opts = FIELD_FIELDS.reduce((map, val) => {\n map[val] = 'function';\n return map;\n }, initial);\n return validateObject(field, opts);\n}\n// Generic field functions\n/**\n * Same as `pow` but for Fp: non-constant-time.\n * Unsafe in some contexts: uses ladder, so can expose bigint bits.\n */\nexport function FpPow(f, num, power) {\n // Should have same speed as pow for bigints\n // TODO: benchmark!\n if (power < _0n)\n throw new Error('Expected power > 0');\n if (power === _0n)\n return f.ONE;\n if (power === _1n)\n return num;\n let p = f.ONE;\n let d = num;\n while (power > _0n) {\n if (power & _1n)\n p = f.mul(p, d);\n d = f.sqr(d);\n power >>= _1n;\n }\n return p;\n}\n/**\n * Efficiently invert an array of Field elements.\n * `inv(0)` will return `undefined` here: make sure to throw an error.\n */\nexport function FpInvertBatch(f, nums) {\n const tmp = new Array(nums.length);\n // Walk from first to last, multiply them by each other MOD p\n const lastMultiplied = nums.reduce((acc, num, i) => {\n if (f.is0(num))\n return acc;\n tmp[i] = acc;\n return f.mul(acc, num);\n }, f.ONE);\n // Invert last element\n const inverted = f.inv(lastMultiplied);\n // Walk from last to first, multiply them by inverted each other MOD p\n nums.reduceRight((acc, num, i) => {\n if (f.is0(num))\n return acc;\n tmp[i] = f.mul(acc, tmp[i]);\n return f.mul(acc, num);\n }, inverted);\n return tmp;\n}\nexport function FpDiv(f, lhs, rhs) {\n return f.mul(lhs, typeof rhs === 'bigint' ? invert(rhs, f.ORDER) : f.inv(rhs));\n}\n// This function returns True whenever the value x is a square in the field F.\nexport function FpIsSquare(f) {\n const legendreConst = (f.ORDER - _1n) / _2n; // Integer arithmetic\n return (x) => {\n const p = f.pow(x, legendreConst);\n return f.eql(p, f.ZERO) || f.eql(p, f.ONE);\n };\n}\n// CURVE.n lengths\nexport function nLength(n, nBitLength) {\n // Bit size, byte size of CURVE.n\n const _nBitLength = nBitLength !== undefined ? nBitLength : n.toString(2).length;\n const nByteLength = Math.ceil(_nBitLength / 8);\n return { nBitLength: _nBitLength, nByteLength };\n}\n/**\n * Initializes a finite field over prime. **Non-primes are not supported.**\n * Do not init in loop: slow. Very fragile: always run a benchmark on a change.\n * Major performance optimizations:\n * * a) denormalized operations like mulN instead of mul\n * * b) same object shape: never add or remove keys\n * * c) Object.freeze\n * @param ORDER prime positive bigint\n * @param bitLen how many bits the field consumes\n * @param isLE (def: false) if encoding / decoding should be in little-endian\n * @param redef optional faster redefinitions of sqrt and other methods\n */\nexport function Field(ORDER, bitLen, isLE = false, redef = {}) {\n if (ORDER <= _0n)\n throw new Error(`Expected Field ORDER > 0, got ${ORDER}`);\n const { nBitLength: BITS, nByteLength: BYTES } = nLength(ORDER, bitLen);\n if (BYTES > 2048)\n throw new Error('Field lengths over 2048 bytes are not supported');\n const sqrtP = FpSqrt(ORDER);\n const f = Object.freeze({\n ORDER,\n BITS,\n BYTES,\n MASK: bitMask(BITS),\n ZERO: _0n,\n ONE: _1n,\n create: (num) => mod(num, ORDER),\n isValid: (num) => {\n if (typeof num !== 'bigint')\n throw new Error(`Invalid field element: expected bigint, got ${typeof num}`);\n return _0n <= num && num < ORDER; // 0 is valid element, but it's not invertible\n },\n is0: (num) => num === _0n,\n isOdd: (num) => (num & _1n) === _1n,\n neg: (num) => mod(-num, ORDER),\n eql: (lhs, rhs) => lhs === rhs,\n sqr: (num) => mod(num * num, ORDER),\n add: (lhs, rhs) => mod(lhs + rhs, ORDER),\n sub: (lhs, rhs) => mod(lhs - rhs, ORDER),\n mul: (lhs, rhs) => mod(lhs * rhs, ORDER),\n pow: (num, power) => FpPow(f, num, power),\n div: (lhs, rhs) => mod(lhs * invert(rhs, ORDER), ORDER),\n // Same as above, but doesn't normalize\n sqrN: (num) => num * num,\n addN: (lhs, rhs) => lhs + rhs,\n subN: (lhs, rhs) => lhs - rhs,\n mulN: (lhs, rhs) => lhs * rhs,\n inv: (num) => invert(num, ORDER),\n sqrt: redef.sqrt || ((n) => sqrtP(f, n)),\n invertBatch: (lst) => FpInvertBatch(f, lst),\n // TODO: do we really need constant cmov?\n // We don't have const-time bigints anyway, so probably will be not very useful\n cmov: (a, b, c) => (c ? b : a),\n toBytes: (num) => (isLE ? numberToBytesLE(num, BYTES) : numberToBytesBE(num, BYTES)),\n fromBytes: (bytes) => {\n if (bytes.length !== BYTES)\n throw new Error(`Fp.fromBytes: expected ${BYTES}, got ${bytes.length}`);\n return isLE ? bytesToNumberLE(bytes) : bytesToNumberBE(bytes);\n },\n });\n return Object.freeze(f);\n}\nexport function FpSqrtOdd(Fp, elm) {\n if (!Fp.isOdd)\n throw new Error(`Field doesn't have isOdd`);\n const root = Fp.sqrt(elm);\n return Fp.isOdd(root) ? root : Fp.neg(root);\n}\nexport function FpSqrtEven(Fp, elm) {\n if (!Fp.isOdd)\n throw new Error(`Field doesn't have isOdd`);\n const root = Fp.sqrt(elm);\n return Fp.isOdd(root) ? Fp.neg(root) : root;\n}\n/**\n * \"Constant-time\" private key generation utility.\n * Same as mapKeyToField, but accepts less bytes (40 instead of 48 for 32-byte field).\n * Which makes it slightly more biased, less secure.\n * @deprecated use mapKeyToField instead\n */\nexport function hashToPrivateScalar(hash, groupOrder, isLE = false) {\n hash = ensureBytes('privateHash', hash);\n const hashLen = hash.length;\n const minLen = nLength(groupOrder).nByteLength + 8;\n if (minLen < 24 || hashLen < minLen || hashLen > 1024)\n throw new Error(`hashToPrivateScalar: expected ${minLen}-1024 bytes of input, got ${hashLen}`);\n const num = isLE ? bytesToNumberLE(hash) : bytesToNumberBE(hash);\n return mod(num, groupOrder - _1n) + _1n;\n}\n/**\n * Returns total number of bytes consumed by the field element.\n * For example, 32 bytes for usual 256-bit weierstrass curve.\n * @param fieldOrder number of field elements, usually CURVE.n\n * @returns byte length of field\n */\nexport function getFieldBytesLength(fieldOrder) {\n if (typeof fieldOrder !== 'bigint')\n throw new Error('field order must be bigint');\n const bitLength = fieldOrder.toString(2).length;\n return Math.ceil(bitLength / 8);\n}\n/**\n * Returns minimal amount of bytes that can be safely reduced\n * by field order.\n * Should be 2^-128 for 128-bit curve such as P256.\n * @param fieldOrder number of field elements, usually CURVE.n\n * @returns byte length of target hash\n */\nexport function getMinHashLength(fieldOrder) {\n const length = getFieldBytesLength(fieldOrder);\n return length + Math.ceil(length / 2);\n}\n/**\n * \"Constant-time\" private key generation utility.\n * Can take (n + n/2) or more bytes of uniform input e.g. from CSPRNG or KDF\n * and convert them into private scalar, with the modulo bias being negligible.\n * Needs at least 48 bytes of input for 32-byte private key.\n * https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/\n * FIPS 186-5, A.2 https://csrc.nist.gov/publications/detail/fips/186/5/final\n * RFC 9380, https://www.rfc-editor.org/rfc/rfc9380#section-5\n * @param hash hash output from SHA3 or a similar function\n * @param groupOrder size of subgroup - (e.g. secp256k1.CURVE.n)\n * @param isLE interpret hash bytes as LE num\n * @returns valid private scalar\n */\nexport function mapHashToField(key, fieldOrder, isLE = false) {\n const len = key.length;\n const fieldLen = getFieldBytesLength(fieldOrder);\n const minLen = getMinHashLength(fieldOrder);\n // No small numbers: need to understand bias story. No huge numbers: easier to detect JS timings.\n if (len < 16 || len < minLen || len > 1024)\n throw new Error(`expected ${minLen}-1024 bytes of input, got ${len}`);\n const num = isLE ? bytesToNumberBE(key) : bytesToNumberLE(key);\n // `mod(x, 11)` can sometimes produce 0. `mod(x, 10) + 1` is the same, but no 0\n const reduced = mod(num, fieldOrder - _1n) + _1n;\n return isLE ? numberToBytesLE(reduced, fieldLen) : numberToBytesBE(reduced, fieldLen);\n}\n//# sourceMappingURL=modular.js.map","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// Abelian group utilities\nimport { validateField, nLength } from './modular.js';\nimport { validateObject } from './utils.js';\nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\n// Elliptic curve multiplication of Point by scalar. Fragile.\n// Scalars should always be less than curve order: this should be checked inside of a curve itself.\n// Creates precomputation tables for fast multiplication:\n// - private scalar is split by fixed size windows of W bits\n// - every window point is collected from window's table & added to accumulator\n// - since windows are different, same point inside tables won't be accessed more than once per calc\n// - each multiplication is 'Math.ceil(CURVE_ORDER / 𝑊) + 1' point additions (fixed for any scalar)\n// - +1 window is neccessary for wNAF\n// - wNAF reduces table size: 2x less memory + 2x faster generation, but 10% slower multiplication\n// TODO: Research returning 2d JS array of windows, instead of a single window. This would allow\n// windows to be in different memory locations\nexport function wNAF(c, bits) {\n const constTimeNegate = (condition, item) => {\n const neg = item.negate();\n return condition ? neg : item;\n };\n const opts = (W) => {\n const windows = Math.ceil(bits / W) + 1; // +1, because\n const windowSize = 2 ** (W - 1); // -1 because we skip zero\n return { windows, windowSize };\n };\n return {\n constTimeNegate,\n // non-const time multiplication ladder\n unsafeLadder(elm, n) {\n let p = c.ZERO;\n let d = elm;\n while (n > _0n) {\n if (n & _1n)\n p = p.add(d);\n d = d.double();\n n >>= _1n;\n }\n return p;\n },\n /**\n * Creates a wNAF precomputation window. Used for caching.\n * Default window size is set by `utils.precompute()` and is equal to 8.\n * Number of precomputed points depends on the curve size:\n * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where:\n * - 𝑊 is the window size\n * - 𝑛 is the bitlength of the curve order.\n * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224.\n * @returns precomputed point tables flattened to a single array\n */\n precomputeWindow(elm, W) {\n const { windows, windowSize } = opts(W);\n const points = [];\n let p = elm;\n let base = p;\n for (let window = 0; window < windows; window++) {\n base = p;\n points.push(base);\n // =1, because we skip zero\n for (let i = 1; i < windowSize; i++) {\n base = base.add(p);\n points.push(base);\n }\n p = base.double();\n }\n return points;\n },\n /**\n * Implements ec multiplication using precomputed tables and w-ary non-adjacent form.\n * @param W window size\n * @param precomputes precomputed tables\n * @param n scalar (we don't check here, but should be less than curve order)\n * @returns real and fake (for const-time) points\n */\n wNAF(W, precomputes, n) {\n // TODO: maybe check that scalar is less than group order? wNAF behavious is undefined otherwise\n // But need to carefully remove other checks before wNAF. ORDER == bits here\n const { windows, windowSize } = opts(W);\n let p = c.ZERO;\n let f = c.BASE;\n const mask = BigInt(2 ** W - 1); // Create mask with W ones: 0b1111 for W=4 etc.\n const maxNumber = 2 ** W;\n const shiftBy = BigInt(W);\n for (let window = 0; window < windows; window++) {\n const offset = window * windowSize;\n // Extract W bits.\n let wbits = Number(n & mask);\n // Shift number by W bits.\n n >>= shiftBy;\n // If the bits are bigger than max size, we'll split those.\n // +224 => 256 - 32\n if (wbits > windowSize) {\n wbits -= maxNumber;\n n += _1n;\n }\n // This code was first written with assumption that 'f' and 'p' will never be infinity point:\n // since each addition is multiplied by 2 ** W, it cannot cancel each other. However,\n // there is negate now: it is possible that negated element from low value\n // would be the same as high element, which will create carry into next window.\n // It's not obvious how this can fail, but still worth investigating later.\n // Check if we're onto Zero point.\n // Add random point inside current window to f.\n const offset1 = offset;\n const offset2 = offset + Math.abs(wbits) - 1; // -1 because we skip zero\n const cond1 = window % 2 !== 0;\n const cond2 = wbits < 0;\n if (wbits === 0) {\n // The most important part for const-time getPublicKey\n f = f.add(constTimeNegate(cond1, precomputes[offset1]));\n }\n else {\n p = p.add(constTimeNegate(cond2, precomputes[offset2]));\n }\n }\n // JIT-compiler should not eliminate f here, since it will later be used in normalizeZ()\n // Even if the variable is still unused, there are some checks which will\n // throw an exception, so compiler needs to prove they won't happen, which is hard.\n // At this point there is a way to F be infinity-point even if p is not,\n // which makes it less const-time: around 1 bigint multiply.\n return { p, f };\n },\n wNAFCached(P, precomputesMap, n, transform) {\n // @ts-ignore\n const W = P._WINDOW_SIZE || 1;\n // Calculate precomputes on a first run, reuse them after\n let comp = precomputesMap.get(P);\n if (!comp) {\n comp = this.precomputeWindow(P, W);\n if (W !== 1) {\n precomputesMap.set(P, transform(comp));\n }\n }\n return this.wNAF(W, comp, n);\n },\n };\n}\nexport function validateBasic(curve) {\n validateField(curve.Fp);\n validateObject(curve, {\n n: 'bigint',\n h: 'bigint',\n Gx: 'field',\n Gy: 'field',\n }, {\n nBitLength: 'isSafeInteger',\n nByteLength: 'isSafeInteger',\n });\n // Set defaults\n return Object.freeze({\n ...nLength(curve.n, curve.nBitLength),\n ...curve,\n ...{ p: curve.Fp.ORDER },\n });\n}\n//# sourceMappingURL=curve.js.map","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// Short Weierstrass curve. The formula is: y² = x³ + ax + b\nimport * as mod from './modular.js';\nimport * as ut from './utils.js';\nimport { ensureBytes } from './utils.js';\nimport { wNAF, validateBasic } from './curve.js';\nfunction validatePointOpts(curve) {\n const opts = validateBasic(curve);\n ut.validateObject(opts, {\n a: 'field',\n b: 'field',\n }, {\n allowedPrivateKeyLengths: 'array',\n wrapPrivateKey: 'boolean',\n isTorsionFree: 'function',\n clearCofactor: 'function',\n allowInfinityPoint: 'boolean',\n fromBytes: 'function',\n toBytes: 'function',\n });\n const { endo, Fp, a } = opts;\n if (endo) {\n if (!Fp.eql(a, Fp.ZERO)) {\n throw new Error('Endomorphism can only be defined for Koblitz curves that have a=0');\n }\n if (typeof endo !== 'object' ||\n typeof endo.beta !== 'bigint' ||\n typeof endo.splitScalar !== 'function') {\n throw new Error('Expected endomorphism with beta: bigint and splitScalar: function');\n }\n }\n return Object.freeze({ ...opts });\n}\n// ASN.1 DER encoding utilities\nconst { bytesToNumberBE: b2n, hexToBytes: h2b } = ut;\nexport const DER = {\n // asn.1 DER encoding utils\n Err: class DERErr extends Error {\n constructor(m = '') {\n super(m);\n }\n },\n _parseInt(data) {\n const { Err: E } = DER;\n if (data.length < 2 || data[0] !== 0x02)\n throw new E('Invalid signature integer tag');\n const len = data[1];\n const res = data.subarray(2, len + 2);\n if (!len || res.length !== len)\n throw new E('Invalid signature integer: wrong length');\n // https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag,\n // since we always use positive integers here. It must always be empty:\n // - add zero byte if exists\n // - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding)\n if (res[0] & 0b10000000)\n throw new E('Invalid signature integer: negative');\n if (res[0] === 0x00 && !(res[1] & 0b10000000))\n throw new E('Invalid signature integer: unnecessary leading zero');\n return { d: b2n(res), l: data.subarray(len + 2) }; // d is data, l is left\n },\n toSig(hex) {\n // parse DER signature\n const { Err: E } = DER;\n const data = typeof hex === 'string' ? h2b(hex) : hex;\n if (!(data instanceof Uint8Array))\n throw new Error('ui8a expected');\n let l = data.length;\n if (l < 2 || data[0] != 0x30)\n throw new E('Invalid signature tag');\n if (data[1] !== l - 2)\n throw new E('Invalid signature: incorrect length');\n const { d: r, l: sBytes } = DER._parseInt(data.subarray(2));\n const { d: s, l: rBytesLeft } = DER._parseInt(sBytes);\n if (rBytesLeft.length)\n throw new E('Invalid signature: left bytes after parsing');\n return { r, s };\n },\n hexFromSig(sig) {\n // Add leading zero if first byte has negative bit enabled. More details in '_parseInt'\n const slice = (s) => (Number.parseInt(s[0], 16) & 0b1000 ? '00' + s : s);\n const h = (num) => {\n const hex = num.toString(16);\n return hex.length & 1 ? `0${hex}` : hex;\n };\n const s = slice(h(sig.s));\n const r = slice(h(sig.r));\n const shl = s.length / 2;\n const rhl = r.length / 2;\n const sl = h(shl);\n const rl = h(rhl);\n return `30${h(rhl + shl + 4)}02${rl}${r}02${sl}${s}`;\n },\n};\n// Be friendly to bad ECMAScript parsers by not using bigint literals\n// prettier-ignore\nconst _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = BigInt(4);\nexport function weierstrassPoints(opts) {\n const CURVE = validatePointOpts(opts);\n const { Fp } = CURVE; // All curves has same field / group length as for now, but they can differ\n const toBytes = CURVE.toBytes ||\n ((_c, point, _isCompressed) => {\n const a = point.toAffine();\n return ut.concatBytes(Uint8Array.from([0x04]), Fp.toBytes(a.x), Fp.toBytes(a.y));\n });\n const fromBytes = CURVE.fromBytes ||\n ((bytes) => {\n // const head = bytes[0];\n const tail = bytes.subarray(1);\n // if (head !== 0x04) throw new Error('Only non-compressed encoding is supported');\n const x = Fp.fromBytes(tail.subarray(0, Fp.BYTES));\n const y = Fp.fromBytes(tail.subarray(Fp.BYTES, 2 * Fp.BYTES));\n return { x, y };\n });\n /**\n * y² = x³ + ax + b: Short weierstrass curve formula\n * @returns y²\n */\n function weierstrassEquation(x) {\n const { a, b } = CURVE;\n const x2 = Fp.sqr(x); // x * x\n const x3 = Fp.mul(x2, x); // x2 * x\n return Fp.add(Fp.add(x3, Fp.mul(x, a)), b); // x3 + a * x + b\n }\n // Validate whether the passed curve params are valid.\n // We check if curve equation works for generator point.\n // `assertValidity()` won't work: `isTorsionFree()` is not available at this point in bls12-381.\n // ProjectivePoint class has not been initialized yet.\n if (!Fp.eql(Fp.sqr(CURVE.Gy), weierstrassEquation(CURVE.Gx)))\n throw new Error('bad generator point: equation left != right');\n // Valid group elements reside in range 1..n-1\n function isWithinCurveOrder(num) {\n return typeof num === 'bigint' && _0n < num && num < CURVE.n;\n }\n function assertGE(num) {\n if (!isWithinCurveOrder(num))\n throw new Error('Expected valid bigint: 0 < bigint < curve.n');\n }\n // Validates if priv key is valid and converts it to bigint.\n // Supports options allowedPrivateKeyLengths and wrapPrivateKey.\n function normPrivateKeyToScalar(key) {\n const { allowedPrivateKeyLengths: lengths, nByteLength, wrapPrivateKey, n } = CURVE;\n if (lengths && typeof key !== 'bigint') {\n if (key instanceof Uint8Array)\n key = ut.bytesToHex(key);\n // Normalize to hex string, pad. E.g. P521 would norm 130-132 char hex to 132-char bytes\n if (typeof key !== 'string' || !lengths.includes(key.length))\n throw new Error('Invalid key');\n key = key.padStart(nByteLength * 2, '0');\n }\n let num;\n try {\n num =\n typeof key === 'bigint'\n ? key\n : ut.bytesToNumberBE(ensureBytes('private key', key, nByteLength));\n }\n catch (error) {\n throw new Error(`private key must be ${nByteLength} bytes, hex or bigint, not ${typeof key}`);\n }\n if (wrapPrivateKey)\n num = mod.mod(num, n); // disabled by default, enabled for BLS\n assertGE(num); // num in range [1..N-1]\n return num;\n }\n const pointPrecomputes = new Map();\n function assertPrjPoint(other) {\n if (!(other instanceof Point))\n throw new Error('ProjectivePoint expected');\n }\n /**\n * Projective Point works in 3d / projective (homogeneous) coordinates: (x, y, z) ∋ (x=x/z, y=y/z)\n * Default Point works in 2d / affine coordinates: (x, y)\n * We're doing calculations in projective, because its operations don't require costly inversion.\n */\n class Point {\n constructor(px, py, pz) {\n this.px = px;\n this.py = py;\n this.pz = pz;\n if (px == null || !Fp.isValid(px))\n throw new Error('x required');\n if (py == null || !Fp.isValid(py))\n throw new Error('y required');\n if (pz == null || !Fp.isValid(pz))\n throw new Error('z required');\n }\n // Does not validate if the point is on-curve.\n // Use fromHex instead, or call assertValidity() later.\n static fromAffine(p) {\n const { x, y } = p || {};\n if (!p || !Fp.isValid(x) || !Fp.isValid(y))\n throw new Error('invalid affine point');\n if (p instanceof Point)\n throw new Error('projective point not allowed');\n const is0 = (i) => Fp.eql(i, Fp.ZERO);\n // fromAffine(x:0, y:0) would produce (x:0, y:0, z:1), but we need (x:0, y:1, z:0)\n if (is0(x) && is0(y))\n return Point.ZERO;\n return new Point(x, y, Fp.ONE);\n }\n get x() {\n return this.toAffine().x;\n }\n get y() {\n return this.toAffine().y;\n }\n /**\n * Takes a bunch of Projective Points but executes only one\n * inversion on all of them. Inversion is very slow operation,\n * so this improves performance massively.\n * Optimization: converts a list of projective points to a list of identical points with Z=1.\n */\n static normalizeZ(points) {\n const toInv = Fp.invertBatch(points.map((p) => p.pz));\n return points.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine);\n }\n /**\n * Converts hash string or Uint8Array to Point.\n * @param hex short/long ECDSA hex\n */\n static fromHex(hex) {\n const P = Point.fromAffine(fromBytes(ensureBytes('pointHex', hex)));\n P.assertValidity();\n return P;\n }\n // Multiplies generator point by privateKey.\n static fromPrivateKey(privateKey) {\n return Point.BASE.multiply(normPrivateKeyToScalar(privateKey));\n }\n // \"Private method\", don't use it directly\n _setWindowSize(windowSize) {\n this._WINDOW_SIZE = windowSize;\n pointPrecomputes.delete(this);\n }\n // A point on curve is valid if it conforms to equation.\n assertValidity() {\n if (this.is0()) {\n // (0, 1, 0) aka ZERO is invalid in most contexts.\n // In BLS, ZERO can be serialized, so we allow it.\n // (0, 0, 0) is wrong representation of ZERO and is always invalid.\n if (CURVE.allowInfinityPoint && !Fp.is0(this.py))\n return;\n throw new Error('bad point: ZERO');\n }\n // Some 3rd-party test vectors require different wording between here & `fromCompressedHex`\n const { x, y } = this.toAffine();\n // Check if x, y are valid field elements\n if (!Fp.isValid(x) || !Fp.isValid(y))\n throw new Error('bad point: x or y not FE');\n const left = Fp.sqr(y); // y²\n const right = weierstrassEquation(x); // x³ + ax + b\n if (!Fp.eql(left, right))\n throw new Error('bad point: equation left != right');\n if (!this.isTorsionFree())\n throw new Error('bad point: not in prime-order subgroup');\n }\n hasEvenY() {\n const { y } = this.toAffine();\n if (Fp.isOdd)\n return !Fp.isOdd(y);\n throw new Error(\"Field doesn't support isOdd\");\n }\n /**\n * Compare one point to another.\n */\n equals(other) {\n assertPrjPoint(other);\n const { px: X1, py: Y1, pz: Z1 } = this;\n const { px: X2, py: Y2, pz: Z2 } = other;\n const U1 = Fp.eql(Fp.mul(X1, Z2), Fp.mul(X2, Z1));\n const U2 = Fp.eql(Fp.mul(Y1, Z2), Fp.mul(Y2, Z1));\n return U1 && U2;\n }\n /**\n * Flips point to one corresponding to (x, -y) in Affine coordinates.\n */\n negate() {\n return new Point(this.px, Fp.neg(this.py), this.pz);\n }\n // Renes-Costello-Batina exception-free doubling formula.\n // There is 30% faster Jacobian formula, but it is not complete.\n // https://eprint.iacr.org/2015/1060, algorithm 3\n // Cost: 8M + 3S + 3*a + 2*b3 + 15add.\n double() {\n const { a, b } = CURVE;\n const b3 = Fp.mul(b, _3n);\n const { px: X1, py: Y1, pz: Z1 } = this;\n let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore\n let t0 = Fp.mul(X1, X1); // step 1\n let t1 = Fp.mul(Y1, Y1);\n let t2 = Fp.mul(Z1, Z1);\n let t3 = Fp.mul(X1, Y1);\n t3 = Fp.add(t3, t3); // step 5\n Z3 = Fp.mul(X1, Z1);\n Z3 = Fp.add(Z3, Z3);\n X3 = Fp.mul(a, Z3);\n Y3 = Fp.mul(b3, t2);\n Y3 = Fp.add(X3, Y3); // step 10\n X3 = Fp.sub(t1, Y3);\n Y3 = Fp.add(t1, Y3);\n Y3 = Fp.mul(X3, Y3);\n X3 = Fp.mul(t3, X3);\n Z3 = Fp.mul(b3, Z3); // step 15\n t2 = Fp.mul(a, t2);\n t3 = Fp.sub(t0, t2);\n t3 = Fp.mul(a, t3);\n t3 = Fp.add(t3, Z3);\n Z3 = Fp.add(t0, t0); // step 20\n t0 = Fp.add(Z3, t0);\n t0 = Fp.add(t0, t2);\n t0 = Fp.mul(t0, t3);\n Y3 = Fp.add(Y3, t0);\n t2 = Fp.mul(Y1, Z1); // step 25\n t2 = Fp.add(t2, t2);\n t0 = Fp.mul(t2, t3);\n X3 = Fp.sub(X3, t0);\n Z3 = Fp.mul(t2, t1);\n Z3 = Fp.add(Z3, Z3); // step 30\n Z3 = Fp.add(Z3, Z3);\n return new Point(X3, Y3, Z3);\n }\n // Renes-Costello-Batina exception-free addition formula.\n // There is 30% faster Jacobian formula, but it is not complete.\n // https://eprint.iacr.org/2015/1060, algorithm 1\n // Cost: 12M + 0S + 3*a + 3*b3 + 23add.\n add(other) {\n assertPrjPoint(other);\n const { px: X1, py: Y1, pz: Z1 } = this;\n const { px: X2, py: Y2, pz: Z2 } = other;\n let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore\n const a = CURVE.a;\n const b3 = Fp.mul(CURVE.b, _3n);\n let t0 = Fp.mul(X1, X2); // step 1\n let t1 = Fp.mul(Y1, Y2);\n let t2 = Fp.mul(Z1, Z2);\n let t3 = Fp.add(X1, Y1);\n let t4 = Fp.add(X2, Y2); // step 5\n t3 = Fp.mul(t3, t4);\n t4 = Fp.add(t0, t1);\n t3 = Fp.sub(t3, t4);\n t4 = Fp.add(X1, Z1);\n let t5 = Fp.add(X2, Z2); // step 10\n t4 = Fp.mul(t4, t5);\n t5 = Fp.add(t0, t2);\n t4 = Fp.sub(t4, t5);\n t5 = Fp.add(Y1, Z1);\n X3 = Fp.add(Y2, Z2); // step 15\n t5 = Fp.mul(t5, X3);\n X3 = Fp.add(t1, t2);\n t5 = Fp.sub(t5, X3);\n Z3 = Fp.mul(a, t4);\n X3 = Fp.mul(b3, t2); // step 20\n Z3 = Fp.add(X3, Z3);\n X3 = Fp.sub(t1, Z3);\n Z3 = Fp.add(t1, Z3);\n Y3 = Fp.mul(X3, Z3);\n t1 = Fp.add(t0, t0); // step 25\n t1 = Fp.add(t1, t0);\n t2 = Fp.mul(a, t2);\n t4 = Fp.mul(b3, t4);\n t1 = Fp.add(t1, t2);\n t2 = Fp.sub(t0, t2); // step 30\n t2 = Fp.mul(a, t2);\n t4 = Fp.add(t4, t2);\n t0 = Fp.mul(t1, t4);\n Y3 = Fp.add(Y3, t0);\n t0 = Fp.mul(t5, t4); // step 35\n X3 = Fp.mul(t3, X3);\n X3 = Fp.sub(X3, t0);\n t0 = Fp.mul(t3, t1);\n Z3 = Fp.mul(t5, Z3);\n Z3 = Fp.add(Z3, t0); // step 40\n return new Point(X3, Y3, Z3);\n }\n subtract(other) {\n return this.add(other.negate());\n }\n is0() {\n return this.equals(Point.ZERO);\n }\n wNAF(n) {\n return wnaf.wNAFCached(this, pointPrecomputes, n, (comp) => {\n const toInv = Fp.invertBatch(comp.map((p) => p.pz));\n return comp.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine);\n });\n }\n /**\n * Non-constant-time multiplication. Uses double-and-add algorithm.\n * It's faster, but should only be used when you don't care about\n * an exposed private key e.g. sig verification, which works over *public* keys.\n */\n multiplyUnsafe(n) {\n const I = Point.ZERO;\n if (n === _0n)\n return I;\n assertGE(n); // Will throw on 0\n if (n === _1n)\n return this;\n const { endo } = CURVE;\n if (!endo)\n return wnaf.unsafeLadder(this, n);\n // Apply endomorphism\n let { k1neg, k1, k2neg, k2 } = endo.splitScalar(n);\n let k1p = I;\n let k2p = I;\n let d = this;\n while (k1 > _0n || k2 > _0n) {\n if (k1 & _1n)\n k1p = k1p.add(d);\n if (k2 & _1n)\n k2p = k2p.add(d);\n d = d.double();\n k1 >>= _1n;\n k2 >>= _1n;\n }\n if (k1neg)\n k1p = k1p.negate();\n if (k2neg)\n k2p = k2p.negate();\n k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz);\n return k1p.add(k2p);\n }\n /**\n * Constant time multiplication.\n * Uses wNAF method. Windowed method may be 10% faster,\n * but takes 2x longer to generate and consumes 2x memory.\n * Uses precomputes when available.\n * Uses endomorphism for Koblitz curves.\n * @param scalar by which the point would be multiplied\n * @returns New point\n */\n multiply(scalar) {\n assertGE(scalar);\n let n = scalar;\n let point, fake; // Fake point is used to const-time mult\n const { endo } = CURVE;\n if (endo) {\n const { k1neg, k1, k2neg, k2 } = endo.splitScalar(n);\n let { p: k1p, f: f1p } = this.wNAF(k1);\n let { p: k2p, f: f2p } = this.wNAF(k2);\n k1p = wnaf.constTimeNegate(k1neg, k1p);\n k2p = wnaf.constTimeNegate(k2neg, k2p);\n k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz);\n point = k1p.add(k2p);\n fake = f1p.add(f2p);\n }\n else {\n const { p, f } = this.wNAF(n);\n point = p;\n fake = f;\n }\n // Normalize `z` for both points, but return only real one\n return Point.normalizeZ([point, fake])[0];\n }\n /**\n * Efficiently calculate `aP + bQ`. Unsafe, can expose private key, if used incorrectly.\n * Not using Strauss-Shamir trick: precomputation tables are faster.\n * The trick could be useful if both P and Q are not G (not in our case).\n * @returns non-zero affine point\n */\n multiplyAndAddUnsafe(Q, a, b) {\n const G = Point.BASE; // No Strauss-Shamir trick: we have 10% faster G precomputes\n const mul = (P, a // Select faster multiply() method\n ) => (a === _0n || a === _1n || !P.equals(G) ? P.multiplyUnsafe(a) : P.multiply(a));\n const sum = mul(this, a).add(mul(Q, b));\n return sum.is0() ? undefined : sum;\n }\n // Converts Projective point to affine (x, y) coordinates.\n // Can accept precomputed Z^-1 - for example, from invertBatch.\n // (x, y, z) ∋ (x=x/z, y=y/z)\n toAffine(iz) {\n const { px: x, py: y, pz: z } = this;\n const is0 = this.is0();\n // If invZ was 0, we return zero point. However we still want to execute\n // all operations, so we replace invZ with a random number, 1.\n if (iz == null)\n iz = is0 ? Fp.ONE : Fp.inv(z);\n const ax = Fp.mul(x, iz);\n const ay = Fp.mul(y, iz);\n const zz = Fp.mul(z, iz);\n if (is0)\n return { x: Fp.ZERO, y: Fp.ZERO };\n if (!Fp.eql(zz, Fp.ONE))\n throw new Error('invZ was invalid');\n return { x: ax, y: ay };\n }\n isTorsionFree() {\n const { h: cofactor, isTorsionFree } = CURVE;\n if (cofactor === _1n)\n return true; // No subgroups, always torsion-free\n if (isTorsionFree)\n return isTorsionFree(Point, this);\n throw new Error('isTorsionFree() has not been declared for the elliptic curve');\n }\n clearCofactor() {\n const { h: cofactor, clearCofactor } = CURVE;\n if (cofactor === _1n)\n return this; // Fast-path\n if (clearCofactor)\n return clearCofactor(Point, this);\n return this.multiplyUnsafe(CURVE.h);\n }\n toRawBytes(isCompressed = true) {\n this.assertValidity();\n return toBytes(Point, this, isCompressed);\n }\n toHex(isCompressed = true) {\n return ut.bytesToHex(this.toRawBytes(isCompressed));\n }\n }\n Point.BASE = new Point(CURVE.Gx, CURVE.Gy, Fp.ONE);\n Point.ZERO = new Point(Fp.ZERO, Fp.ONE, Fp.ZERO);\n const _bits = CURVE.nBitLength;\n const wnaf = wNAF(Point, CURVE.endo ? Math.ceil(_bits / 2) : _bits);\n // Validate if generator point is on curve\n return {\n CURVE,\n ProjectivePoint: Point,\n normPrivateKeyToScalar,\n weierstrassEquation,\n isWithinCurveOrder,\n };\n}\nfunction validateOpts(curve) {\n const opts = validateBasic(curve);\n ut.validateObject(opts, {\n hash: 'hash',\n hmac: 'function',\n randomBytes: 'function',\n }, {\n bits2int: 'function',\n bits2int_modN: 'function',\n lowS: 'boolean',\n });\n return Object.freeze({ lowS: true, ...opts });\n}\nexport function weierstrass(curveDef) {\n const CURVE = validateOpts(curveDef);\n const { Fp, n: CURVE_ORDER } = CURVE;\n const compressedLen = Fp.BYTES + 1; // e.g. 33 for 32\n const uncompressedLen = 2 * Fp.BYTES + 1; // e.g. 65 for 32\n function isValidFieldElement(num) {\n return _0n < num && num < Fp.ORDER; // 0 is banned since it's not invertible FE\n }\n function modN(a) {\n return mod.mod(a, CURVE_ORDER);\n }\n function invN(a) {\n return mod.invert(a, CURVE_ORDER);\n }\n const { ProjectivePoint: Point, normPrivateKeyToScalar, weierstrassEquation, isWithinCurveOrder, } = weierstrassPoints({\n ...CURVE,\n toBytes(_c, point, isCompressed) {\n const a = point.toAffine();\n const x = Fp.toBytes(a.x);\n const cat = ut.concatBytes;\n if (isCompressed) {\n return cat(Uint8Array.from([point.hasEvenY() ? 0x02 : 0x03]), x);\n }\n else {\n return cat(Uint8Array.from([0x04]), x, Fp.toBytes(a.y));\n }\n },\n fromBytes(bytes) {\n const len = bytes.length;\n const head = bytes[0];\n const tail = bytes.subarray(1);\n // this.assertValidity() is done inside of fromHex\n if (len === compressedLen && (head === 0x02 || head === 0x03)) {\n const x = ut.bytesToNumberBE(tail);\n if (!isValidFieldElement(x))\n throw new Error('Point is not on curve');\n const y2 = weierstrassEquation(x); // y² = x³ + ax + b\n let y = Fp.sqrt(y2); // y = y² ^ (p+1)/4\n const isYOdd = (y & _1n) === _1n;\n // ECDSA\n const isHeadOdd = (head & 1) === 1;\n if (isHeadOdd !== isYOdd)\n y = Fp.neg(y);\n return { x, y };\n }\n else if (len === uncompressedLen && head === 0x04) {\n const x = Fp.fromBytes(tail.subarray(0, Fp.BYTES));\n const y = Fp.fromBytes(tail.subarray(Fp.BYTES, 2 * Fp.BYTES));\n return { x, y };\n }\n else {\n throw new Error(`Point of length ${len} was invalid. Expected ${compressedLen} compressed bytes or ${uncompressedLen} uncompressed bytes`);\n }\n },\n });\n const numToNByteStr = (num) => ut.bytesToHex(ut.numberToBytesBE(num, CURVE.nByteLength));\n function isBiggerThanHalfOrder(number) {\n const HALF = CURVE_ORDER >> _1n;\n return number > HALF;\n }\n function normalizeS(s) {\n return isBiggerThanHalfOrder(s) ? modN(-s) : s;\n }\n // slice bytes num\n const slcNum = (b, from, to) => ut.bytesToNumberBE(b.slice(from, to));\n /**\n * ECDSA signature with its (r, s) properties. Supports DER & compact representations.\n */\n class Signature {\n constructor(r, s, recovery) {\n this.r = r;\n this.s = s;\n this.recovery = recovery;\n this.assertValidity();\n }\n // pair (bytes of r, bytes of s)\n static fromCompact(hex) {\n const l = CURVE.nByteLength;\n hex = ensureBytes('compactSignature', hex, l * 2);\n return new Signature(slcNum(hex, 0, l), slcNum(hex, l, 2 * l));\n }\n // DER encoded ECDSA signature\n // https://bitcoin.stackexchange.com/questions/57644/what-are-the-parts-of-a-bitcoin-transaction-input-script\n static fromDER(hex) {\n const { r, s } = DER.toSig(ensureBytes('DER', hex));\n return new Signature(r, s);\n }\n assertValidity() {\n // can use assertGE here\n if (!isWithinCurveOrder(this.r))\n throw new Error('r must be 0 < r < CURVE.n');\n if (!isWithinCurveOrder(this.s))\n throw new Error('s must be 0 < s < CURVE.n');\n }\n addRecoveryBit(recovery) {\n return new Signature(this.r, this.s, recovery);\n }\n recoverPublicKey(msgHash) {\n const { r, s, recovery: rec } = this;\n const h = bits2int_modN(ensureBytes('msgHash', msgHash)); // Truncate hash\n if (rec == null || ![0, 1, 2, 3].includes(rec))\n throw new Error('recovery id invalid');\n const radj = rec === 2 || rec === 3 ? r + CURVE.n : r;\n if (radj >= Fp.ORDER)\n throw new Error('recovery id 2 or 3 invalid');\n const prefix = (rec & 1) === 0 ? '02' : '03';\n const R = Point.fromHex(prefix + numToNByteStr(radj));\n const ir = invN(radj); // r^-1\n const u1 = modN(-h * ir); // -hr^-1\n const u2 = modN(s * ir); // sr^-1\n const Q = Point.BASE.multiplyAndAddUnsafe(R, u1, u2); // (sr^-1)R-(hr^-1)G = -(hr^-1)G + (sr^-1)\n if (!Q)\n throw new Error('point at infinify'); // unsafe is fine: no priv data leaked\n Q.assertValidity();\n return Q;\n }\n // Signatures should be low-s, to prevent malleability.\n hasHighS() {\n return isBiggerThanHalfOrder(this.s);\n }\n normalizeS() {\n return this.hasHighS() ? new Signature(this.r, modN(-this.s), this.recovery) : this;\n }\n // DER-encoded\n toDERRawBytes() {\n return ut.hexToBytes(this.toDERHex());\n }\n toDERHex() {\n return DER.hexFromSig({ r: this.r, s: this.s });\n }\n // padded bytes of r, then padded bytes of s\n toCompactRawBytes() {\n return ut.hexToBytes(this.toCompactHex());\n }\n toCompactHex() {\n return numToNByteStr(this.r) + numToNByteStr(this.s);\n }\n }\n const utils = {\n isValidPrivateKey(privateKey) {\n try {\n normPrivateKeyToScalar(privateKey);\n return true;\n }\n catch (error) {\n return false;\n }\n },\n normPrivateKeyToScalar: normPrivateKeyToScalar,\n /**\n * Produces cryptographically secure private key from random of size\n * (groupLen + ceil(groupLen / 2)) with modulo bias being negligible.\n */\n randomPrivateKey: () => {\n const length = mod.getMinHashLength(CURVE.n);\n return mod.mapHashToField(CURVE.randomBytes(length), CURVE.n);\n },\n /**\n * Creates precompute table for an arbitrary EC point. Makes point \"cached\".\n * Allows to massively speed-up `point.multiply(scalar)`.\n * @returns cached point\n * @example\n * const fast = utils.precompute(8, ProjectivePoint.fromHex(someonesPubKey));\n * fast.multiply(privKey); // much faster ECDH now\n */\n precompute(windowSize = 8, point = Point.BASE) {\n point._setWindowSize(windowSize);\n point.multiply(BigInt(3)); // 3 is arbitrary, just need any number here\n return point;\n },\n };\n /**\n * Computes public key for a private key. Checks for validity of the private key.\n * @param privateKey private key\n * @param isCompressed whether to return compact (default), or full key\n * @returns Public key, full when isCompressed=false; short when isCompressed=true\n */\n function getPublicKey(privateKey, isCompressed = true) {\n return Point.fromPrivateKey(privateKey).toRawBytes(isCompressed);\n }\n /**\n * Quick and dirty check for item being public key. Does not validate hex, or being on-curve.\n */\n function isProbPub(item) {\n const arr = item instanceof Uint8Array;\n const str = typeof item === 'string';\n const len = (arr || str) && item.length;\n if (arr)\n return len === compressedLen || len === uncompressedLen;\n if (str)\n return len === 2 * compressedLen || len === 2 * uncompressedLen;\n if (item instanceof Point)\n return true;\n return false;\n }\n /**\n * ECDH (Elliptic Curve Diffie Hellman).\n * Computes shared public key from private key and public key.\n * Checks: 1) private key validity 2) shared key is on-curve.\n * Does NOT hash the result.\n * @param privateA private key\n * @param publicB different public key\n * @param isCompressed whether to return compact (default), or full key\n * @returns shared public key\n */\n function getSharedSecret(privateA, publicB, isCompressed = true) {\n if (isProbPub(privateA))\n throw new Error('first arg must be private key');\n if (!isProbPub(publicB))\n throw new Error('second arg must be public key');\n const b = Point.fromHex(publicB); // check for being on-curve\n return b.multiply(normPrivateKeyToScalar(privateA)).toRawBytes(isCompressed);\n }\n // RFC6979: ensure ECDSA msg is X bytes and < N. RFC suggests optional truncating via bits2octets.\n // FIPS 186-4 4.6 suggests the leftmost min(nBitLen, outLen) bits, which matches bits2int.\n // bits2int can produce res>N, we can do mod(res, N) since the bitLen is the same.\n // int2octets can't be used; pads small msgs with 0: unacceptatble for trunc as per RFC vectors\n const bits2int = CURVE.bits2int ||\n function (bytes) {\n // For curves with nBitLength % 8 !== 0: bits2octets(bits2octets(m)) !== bits2octets(m)\n // for some cases, since bytes.length * 8 is not actual bitLength.\n const num = ut.bytesToNumberBE(bytes); // check for == u8 done here\n const delta = bytes.length * 8 - CURVE.nBitLength; // truncate to nBitLength leftmost bits\n return delta > 0 ? num >> BigInt(delta) : num;\n };\n const bits2int_modN = CURVE.bits2int_modN ||\n function (bytes) {\n return modN(bits2int(bytes)); // can't use bytesToNumberBE here\n };\n // NOTE: pads output with zero as per spec\n const ORDER_MASK = ut.bitMask(CURVE.nBitLength);\n /**\n * Converts to bytes. Checks if num in `[0..ORDER_MASK-1]` e.g.: `[0..2^256-1]`.\n */\n function int2octets(num) {\n if (typeof num !== 'bigint')\n throw new Error('bigint expected');\n if (!(_0n <= num && num < ORDER_MASK))\n throw new Error(`bigint expected < 2^${CURVE.nBitLength}`);\n // works with order, can have different size than numToField!\n return ut.numberToBytesBE(num, CURVE.nByteLength);\n }\n // Steps A, D of RFC6979 3.2\n // Creates RFC6979 seed; converts msg/privKey to numbers.\n // Used only in sign, not in verify.\n // NOTE: we cannot assume here that msgHash has same amount of bytes as curve order, this will be wrong at least for P521.\n // Also it can be bigger for P224 + SHA256\n function prepSig(msgHash, privateKey, opts = defaultSigOpts) {\n if (['recovered', 'canonical'].some((k) => k in opts))\n throw new Error('sign() legacy options not supported');\n const { hash, randomBytes } = CURVE;\n let { lowS, prehash, extraEntropy: ent } = opts; // generates low-s sigs by default\n if (lowS == null)\n lowS = true; // RFC6979 3.2: we skip step A, because we already provide hash\n msgHash = ensureBytes('msgHash', msgHash);\n if (prehash)\n msgHash = ensureBytes('prehashed msgHash', hash(msgHash));\n // We can't later call bits2octets, since nested bits2int is broken for curves\n // with nBitLength % 8 !== 0. Because of that, we unwrap it here as int2octets call.\n // const bits2octets = (bits) => int2octets(bits2int_modN(bits))\n const h1int = bits2int_modN(msgHash);\n const d = normPrivateKeyToScalar(privateKey); // validate private key, convert to bigint\n const seedArgs = [int2octets(d), int2octets(h1int)];\n // extraEntropy. RFC6979 3.6: additional k' (optional).\n if (ent != null) {\n // K = HMAC_K(V || 0x00 || int2octets(x) || bits2octets(h1) || k')\n const e = ent === true ? randomBytes(Fp.BYTES) : ent; // generate random bytes OR pass as-is\n seedArgs.push(ensureBytes('extraEntropy', e)); // check for being bytes\n }\n const seed = ut.concatBytes(...seedArgs); // Step D of RFC6979 3.2\n const m = h1int; // NOTE: no need to call bits2int second time here, it is inside truncateHash!\n // Converts signature params into point w r/s, checks result for validity.\n function k2sig(kBytes) {\n // RFC 6979 Section 3.2, step 3: k = bits2int(T)\n const k = bits2int(kBytes); // Cannot use fields methods, since it is group element\n if (!isWithinCurveOrder(k))\n return; // Important: all mod() calls here must be done over N\n const ik = invN(k); // k^-1 mod n\n const q = Point.BASE.multiply(k).toAffine(); // q = Gk\n const r = modN(q.x); // r = q.x mod n\n if (r === _0n)\n return;\n // Can use scalar blinding b^-1(bm + bdr) where b ∈ [1,q−1] according to\n // https://tches.iacr.org/index.php/TCHES/article/view/7337/6509. We've decided against it:\n // a) dependency on CSPRNG b) 15% slowdown c) doesn't really help since bigints are not CT\n const s = modN(ik * modN(m + r * d)); // Not using blinding here\n if (s === _0n)\n return;\n let recovery = (q.x === r ? 0 : 2) | Number(q.y & _1n); // recovery bit (2 or 3, when q.x > n)\n let normS = s;\n if (lowS && isBiggerThanHalfOrder(s)) {\n normS = normalizeS(s); // if lowS was passed, ensure s is always\n recovery ^= 1; // // in the bottom half of N\n }\n return new Signature(r, normS, recovery); // use normS, not s\n }\n return { seed, k2sig };\n }\n const defaultSigOpts = { lowS: CURVE.lowS, prehash: false };\n const defaultVerOpts = { lowS: CURVE.lowS, prehash: false };\n /**\n * Signs message hash with a private key.\n * ```\n * sign(m, d, k) where\n * (x, y) = G × k\n * r = x mod n\n * s = (m + dr)/k mod n\n * ```\n * @param msgHash NOT message. msg needs to be hashed to `msgHash`, or use `prehash`.\n * @param privKey private key\n * @param opts lowS for non-malleable sigs. extraEntropy for mixing randomness into k. prehash will hash first arg.\n * @returns signature with recovery param\n */\n function sign(msgHash, privKey, opts = defaultSigOpts) {\n const { seed, k2sig } = prepSig(msgHash, privKey, opts); // Steps A, D of RFC6979 3.2.\n const C = CURVE;\n const drbg = ut.createHmacDrbg(C.hash.outputLen, C.nByteLength, C.hmac);\n return drbg(seed, k2sig); // Steps B, C, D, E, F, G\n }\n // Enable precomputes. Slows down first publicKey computation by 20ms.\n Point.BASE._setWindowSize(8);\n // utils.precompute(8, ProjectivePoint.BASE)\n /**\n * Verifies a signature against message hash and public key.\n * Rejects lowS signatures by default: to override,\n * specify option `{lowS: false}`. Implements section 4.1.4 from https://www.secg.org/sec1-v2.pdf:\n *\n * ```\n * verify(r, s, h, P) where\n * U1 = hs^-1 mod n\n * U2 = rs^-1 mod n\n * R = U1⋅G - U2⋅P\n * mod(R.x, n) == r\n * ```\n */\n function verify(signature, msgHash, publicKey, opts = defaultVerOpts) {\n const sg = signature;\n msgHash = ensureBytes('msgHash', msgHash);\n publicKey = ensureBytes('publicKey', publicKey);\n if ('strict' in opts)\n throw new Error('options.strict was renamed to lowS');\n const { lowS, prehash } = opts;\n let _sig = undefined;\n let P;\n try {\n if (typeof sg === 'string' || sg instanceof Uint8Array) {\n // Signature can be represented in 2 ways: compact (2*nByteLength) & DER (variable-length).\n // Since DER can also be 2*nByteLength bytes, we check for it first.\n try {\n _sig = Signature.fromDER(sg);\n }\n catch (derError) {\n if (!(derError instanceof DER.Err))\n throw derError;\n _sig = Signature.fromCompact(sg);\n }\n }\n else if (typeof sg === 'object' && typeof sg.r === 'bigint' && typeof sg.s === 'bigint') {\n const { r, s } = sg;\n _sig = new Signature(r, s);\n }\n else {\n throw new Error('PARSE');\n }\n P = Point.fromHex(publicKey);\n }\n catch (error) {\n if (error.message === 'PARSE')\n throw new Error(`signature must be Signature instance, Uint8Array or hex string`);\n return false;\n }\n if (lowS && _sig.hasHighS())\n return false;\n if (prehash)\n msgHash = CURVE.hash(msgHash);\n const { r, s } = _sig;\n const h = bits2int_modN(msgHash); // Cannot use fields methods, since it is group element\n const is = invN(s); // s^-1\n const u1 = modN(h * is); // u1 = hs^-1 mod n\n const u2 = modN(r * is); // u2 = rs^-1 mod n\n const R = Point.BASE.multiplyAndAddUnsafe(P, u1, u2)?.toAffine(); // R = u1⋅G + u2⋅P\n if (!R)\n return false;\n const v = modN(R.x);\n return v === r;\n }\n return {\n CURVE,\n getPublicKey,\n getSharedSecret,\n sign,\n verify,\n ProjectivePoint: Point,\n Signature,\n utils,\n };\n}\n/**\n * Implementation of the Shallue and van de Woestijne method for any weierstrass curve.\n * TODO: check if there is a way to merge this with uvRatio in Edwards; move to modular.\n * b = True and y = sqrt(u / v) if (u / v) is square in F, and\n * b = False and y = sqrt(Z * (u / v)) otherwise.\n * @param Fp\n * @param Z\n * @returns\n */\nexport function SWUFpSqrtRatio(Fp, Z) {\n // Generic implementation\n const q = Fp.ORDER;\n let l = _0n;\n for (let o = q - _1n; o % _2n === _0n; o /= _2n)\n l += _1n;\n const c1 = l; // 1. c1, the largest integer such that 2^c1 divides q - 1.\n // We need 2n ** c1 and 2n ** (c1-1). We can't use **; but we can use <<.\n // 2n ** c1 == 2n << (c1-1)\n const _2n_pow_c1_1 = _2n << (c1 - _1n - _1n);\n const _2n_pow_c1 = _2n_pow_c1_1 * _2n;\n const c2 = (q - _1n) / _2n_pow_c1; // 2. c2 = (q - 1) / (2^c1) # Integer arithmetic\n const c3 = (c2 - _1n) / _2n; // 3. c3 = (c2 - 1) / 2 # Integer arithmetic\n const c4 = _2n_pow_c1 - _1n; // 4. c4 = 2^c1 - 1 # Integer arithmetic\n const c5 = _2n_pow_c1_1; // 5. c5 = 2^(c1 - 1) # Integer arithmetic\n const c6 = Fp.pow(Z, c2); // 6. c6 = Z^c2\n const c7 = Fp.pow(Z, (c2 + _1n) / _2n); // 7. c7 = Z^((c2 + 1) / 2)\n let sqrtRatio = (u, v) => {\n let tv1 = c6; // 1. tv1 = c6\n let tv2 = Fp.pow(v, c4); // 2. tv2 = v^c4\n let tv3 = Fp.sqr(tv2); // 3. tv3 = tv2^2\n tv3 = Fp.mul(tv3, v); // 4. tv3 = tv3 * v\n let tv5 = Fp.mul(u, tv3); // 5. tv5 = u * tv3\n tv5 = Fp.pow(tv5, c3); // 6. tv5 = tv5^c3\n tv5 = Fp.mul(tv5, tv2); // 7. tv5 = tv5 * tv2\n tv2 = Fp.mul(tv5, v); // 8. tv2 = tv5 * v\n tv3 = Fp.mul(tv5, u); // 9. tv3 = tv5 * u\n let tv4 = Fp.mul(tv3, tv2); // 10. tv4 = tv3 * tv2\n tv5 = Fp.pow(tv4, c5); // 11. tv5 = tv4^c5\n let isQR = Fp.eql(tv5, Fp.ONE); // 12. isQR = tv5 == 1\n tv2 = Fp.mul(tv3, c7); // 13. tv2 = tv3 * c7\n tv5 = Fp.mul(tv4, tv1); // 14. tv5 = tv4 * tv1\n tv3 = Fp.cmov(tv2, tv3, isQR); // 15. tv3 = CMOV(tv2, tv3, isQR)\n tv4 = Fp.cmov(tv5, tv4, isQR); // 16. tv4 = CMOV(tv5, tv4, isQR)\n // 17. for i in (c1, c1 - 1, ..., 2):\n for (let i = c1; i > _1n; i--) {\n let tv5 = i - _2n; // 18. tv5 = i - 2\n tv5 = _2n << (tv5 - _1n); // 19. tv5 = 2^tv5\n let tvv5 = Fp.pow(tv4, tv5); // 20. tv5 = tv4^tv5\n const e1 = Fp.eql(tvv5, Fp.ONE); // 21. e1 = tv5 == 1\n tv2 = Fp.mul(tv3, tv1); // 22. tv2 = tv3 * tv1\n tv1 = Fp.mul(tv1, tv1); // 23. tv1 = tv1 * tv1\n tvv5 = Fp.mul(tv4, tv1); // 24. tv5 = tv4 * tv1\n tv3 = Fp.cmov(tv2, tv3, e1); // 25. tv3 = CMOV(tv2, tv3, e1)\n tv4 = Fp.cmov(tvv5, tv4, e1); // 26. tv4 = CMOV(tv5, tv4, e1)\n }\n return { isValid: isQR, value: tv3 };\n };\n if (Fp.ORDER % _4n === _3n) {\n // sqrt_ratio_3mod4(u, v)\n const c1 = (Fp.ORDER - _3n) / _4n; // 1. c1 = (q - 3) / 4 # Integer arithmetic\n const c2 = Fp.sqrt(Fp.neg(Z)); // 2. c2 = sqrt(-Z)\n sqrtRatio = (u, v) => {\n let tv1 = Fp.sqr(v); // 1. tv1 = v^2\n const tv2 = Fp.mul(u, v); // 2. tv2 = u * v\n tv1 = Fp.mul(tv1, tv2); // 3. tv1 = tv1 * tv2\n let y1 = Fp.pow(tv1, c1); // 4. y1 = tv1^c1\n y1 = Fp.mul(y1, tv2); // 5. y1 = y1 * tv2\n const y2 = Fp.mul(y1, c2); // 6. y2 = y1 * c2\n const tv3 = Fp.mul(Fp.sqr(y1), v); // 7. tv3 = y1^2; 8. tv3 = tv3 * v\n const isQR = Fp.eql(tv3, u); // 9. isQR = tv3 == u\n let y = Fp.cmov(y2, y1, isQR); // 10. y = CMOV(y2, y1, isQR)\n return { isValid: isQR, value: y }; // 11. return (isQR, y) isQR ? y : y*c2\n };\n }\n // No curves uses that\n // if (Fp.ORDER % _8n === _5n) // sqrt_ratio_5mod8\n return sqrtRatio;\n}\n/**\n * Simplified Shallue-van de Woestijne-Ulas Method\n * https://www.rfc-editor.org/rfc/rfc9380#section-6.6.2\n */\nexport function mapToCurveSimpleSWU(Fp, opts) {\n mod.validateField(Fp);\n if (!Fp.isValid(opts.A) || !Fp.isValid(opts.B) || !Fp.isValid(opts.Z))\n throw new Error('mapToCurveSimpleSWU: invalid opts');\n const sqrtRatio = SWUFpSqrtRatio(Fp, opts.Z);\n if (!Fp.isOdd)\n throw new Error('Fp.isOdd is not implemented!');\n // Input: u, an element of F.\n // Output: (x, y), a point on E.\n return (u) => {\n // prettier-ignore\n let tv1, tv2, tv3, tv4, tv5, tv6, x, y;\n tv1 = Fp.sqr(u); // 1. tv1 = u^2\n tv1 = Fp.mul(tv1, opts.Z); // 2. tv1 = Z * tv1\n tv2 = Fp.sqr(tv1); // 3. tv2 = tv1^2\n tv2 = Fp.add(tv2, tv1); // 4. tv2 = tv2 + tv1\n tv3 = Fp.add(tv2, Fp.ONE); // 5. tv3 = tv2 + 1\n tv3 = Fp.mul(tv3, opts.B); // 6. tv3 = B * tv3\n tv4 = Fp.cmov(opts.Z, Fp.neg(tv2), !Fp.eql(tv2, Fp.ZERO)); // 7. tv4 = CMOV(Z, -tv2, tv2 != 0)\n tv4 = Fp.mul(tv4, opts.A); // 8. tv4 = A * tv4\n tv2 = Fp.sqr(tv3); // 9. tv2 = tv3^2\n tv6 = Fp.sqr(tv4); // 10. tv6 = tv4^2\n tv5 = Fp.mul(tv6, opts.A); // 11. tv5 = A * tv6\n tv2 = Fp.add(tv2, tv5); // 12. tv2 = tv2 + tv5\n tv2 = Fp.mul(tv2, tv3); // 13. tv2 = tv2 * tv3\n tv6 = Fp.mul(tv6, tv4); // 14. tv6 = tv6 * tv4\n tv5 = Fp.mul(tv6, opts.B); // 15. tv5 = B * tv6\n tv2 = Fp.add(tv2, tv5); // 16. tv2 = tv2 + tv5\n x = Fp.mul(tv1, tv3); // 17. x = tv1 * tv3\n const { isValid, value } = sqrtRatio(tv2, tv6); // 18. (is_gx1_square, y1) = sqrt_ratio(tv2, tv6)\n y = Fp.mul(tv1, u); // 19. y = tv1 * u -> Z * u^3 * y1\n y = Fp.mul(y, value); // 20. y = y * y1\n x = Fp.cmov(x, tv3, isValid); // 21. x = CMOV(x, tv3, is_gx1_square)\n y = Fp.cmov(y, value, isValid); // 22. y = CMOV(y, y1, is_gx1_square)\n const e1 = Fp.isOdd(u) === Fp.isOdd(y); // 23. e1 = sgn0(u) == sgn0(y)\n y = Fp.cmov(Fp.neg(y), y, e1); // 24. y = CMOV(-y, y, e1)\n x = Fp.div(x, tv4); // 25. x = x / tv4\n return { x, y };\n };\n}\n//# sourceMappingURL=weierstrass.js.map","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nimport { hmac } from '@noble/hashes/hmac';\nimport { concatBytes, randomBytes } from '@noble/hashes/utils';\nimport { weierstrass } from './abstract/weierstrass.js';\n// connects noble-curves to noble-hashes\nexport function getHash(hash) {\n return {\n hash,\n hmac: (key, ...msgs) => hmac(hash, key, concatBytes(...msgs)),\n randomBytes,\n };\n}\nexport function createCurve(curveDef, defHash) {\n const create = (hash) => weierstrass({ ...curveDef, ...getHash(hash) });\n return Object.freeze({ ...create(defHash), create });\n}\n//# sourceMappingURL=_shortw_utils.js.map","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nimport { sha256 } from '@noble/hashes/sha256';\nimport { randomBytes } from '@noble/hashes/utils';\nimport { Field, mod, pow2 } from './abstract/modular.js';\nimport { mapToCurveSimpleSWU } from './abstract/weierstrass.js';\nimport { bytesToNumberBE, concatBytes, ensureBytes, numberToBytesBE } from './abstract/utils.js';\nimport { createHasher, isogenyMap } from './abstract/hash-to-curve.js';\nimport { createCurve } from './_shortw_utils.js';\nconst secp256k1P = BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f');\nconst secp256k1N = BigInt('0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141');\nconst _1n = BigInt(1);\nconst _2n = BigInt(2);\nconst divNearest = (a, b) => (a + b / _2n) / b;\n/**\n * √n = n^((p+1)/4) for fields p = 3 mod 4. We unwrap the loop and multiply bit-by-bit.\n * (P+1n/4n).toString(2) would produce bits [223x 1, 0, 22x 1, 4x 0, 11, 00]\n */\nfunction sqrtMod(y) {\n const P = secp256k1P;\n // prettier-ignore\n const _3n = BigInt(3), _6n = BigInt(6), _11n = BigInt(11), _22n = BigInt(22);\n // prettier-ignore\n const _23n = BigInt(23), _44n = BigInt(44), _88n = BigInt(88);\n const b2 = (y * y * y) % P; // x^3, 11\n const b3 = (b2 * b2 * y) % P; // x^7\n const b6 = (pow2(b3, _3n, P) * b3) % P;\n const b9 = (pow2(b6, _3n, P) * b3) % P;\n const b11 = (pow2(b9, _2n, P) * b2) % P;\n const b22 = (pow2(b11, _11n, P) * b11) % P;\n const b44 = (pow2(b22, _22n, P) * b22) % P;\n const b88 = (pow2(b44, _44n, P) * b44) % P;\n const b176 = (pow2(b88, _88n, P) * b88) % P;\n const b220 = (pow2(b176, _44n, P) * b44) % P;\n const b223 = (pow2(b220, _3n, P) * b3) % P;\n const t1 = (pow2(b223, _23n, P) * b22) % P;\n const t2 = (pow2(t1, _6n, P) * b2) % P;\n const root = pow2(t2, _2n, P);\n if (!Fp.eql(Fp.sqr(root), y))\n throw new Error('Cannot find square root');\n return root;\n}\nconst Fp = Field(secp256k1P, undefined, undefined, { sqrt: sqrtMod });\nexport const secp256k1 = createCurve({\n a: BigInt(0),\n b: BigInt(7),\n Fp,\n n: secp256k1N,\n // Base point (x, y) aka generator point\n Gx: BigInt('55066263022277343669578718895168534326250603453777594175500187360389116729240'),\n Gy: BigInt('32670510020758816978083085130507043184471273380659243275938904335757337482424'),\n h: BigInt(1),\n lowS: true,\n /**\n * secp256k1 belongs to Koblitz curves: it has efficiently computable endomorphism.\n * Endomorphism uses 2x less RAM, speeds up precomputation by 2x and ECDH / key recovery by 20%.\n * For precomputed wNAF it trades off 1/2 init time & 1/3 ram for 20% perf hit.\n * Explanation: https://gist.github.com/paulmillr/eb670806793e84df628a7c434a873066\n */\n endo: {\n beta: BigInt('0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee'),\n splitScalar: (k) => {\n const n = secp256k1N;\n const a1 = BigInt('0x3086d221a7d46bcde86c90e49284eb15');\n const b1 = -_1n * BigInt('0xe4437ed6010e88286f547fa90abfe4c3');\n const a2 = BigInt('0x114ca50f7a8e2f3f657c1108d9d44cfd8');\n const b2 = a1;\n const POW_2_128 = BigInt('0x100000000000000000000000000000000'); // (2n**128n).toString(16)\n const c1 = divNearest(b2 * k, n);\n const c2 = divNearest(-b1 * k, n);\n let k1 = mod(k - c1 * a1 - c2 * a2, n);\n let k2 = mod(-c1 * b1 - c2 * b2, n);\n const k1neg = k1 > POW_2_128;\n const k2neg = k2 > POW_2_128;\n if (k1neg)\n k1 = n - k1;\n if (k2neg)\n k2 = n - k2;\n if (k1 > POW_2_128 || k2 > POW_2_128) {\n throw new Error('splitScalar: Endomorphism failed, k=' + k);\n }\n return { k1neg, k1, k2neg, k2 };\n },\n },\n}, sha256);\n// Schnorr signatures are superior to ECDSA from above. Below is Schnorr-specific BIP0340 code.\n// https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki\nconst _0n = BigInt(0);\nconst fe = (x) => typeof x === 'bigint' && _0n < x && x < secp256k1P;\nconst ge = (x) => typeof x === 'bigint' && _0n < x && x < secp256k1N;\n/** An object mapping tags to their tagged hash prefix of [SHA256(tag) | SHA256(tag)] */\nconst TAGGED_HASH_PREFIXES = {};\nfunction taggedHash(tag, ...messages) {\n let tagP = TAGGED_HASH_PREFIXES[tag];\n if (tagP === undefined) {\n const tagH = sha256(Uint8Array.from(tag, (c) => c.charCodeAt(0)));\n tagP = concatBytes(tagH, tagH);\n TAGGED_HASH_PREFIXES[tag] = tagP;\n }\n return sha256(concatBytes(tagP, ...messages));\n}\n// ECDSA compact points are 33-byte. Schnorr is 32: we strip first byte 0x02 or 0x03\nconst pointToBytes = (point) => point.toRawBytes(true).slice(1);\nconst numTo32b = (n) => numberToBytesBE(n, 32);\nconst modP = (x) => mod(x, secp256k1P);\nconst modN = (x) => mod(x, secp256k1N);\nconst Point = secp256k1.ProjectivePoint;\nconst GmulAdd = (Q, a, b) => Point.BASE.multiplyAndAddUnsafe(Q, a, b);\n// Calculate point, scalar and bytes\nfunction schnorrGetExtPubKey(priv) {\n let d_ = secp256k1.utils.normPrivateKeyToScalar(priv); // same method executed in fromPrivateKey\n let p = Point.fromPrivateKey(d_); // P = d'⋅G; 0 < d' < n check is done inside\n const scalar = p.hasEvenY() ? d_ : modN(-d_);\n return { scalar: scalar, bytes: pointToBytes(p) };\n}\n/**\n * lift_x from BIP340. Convert 32-byte x coordinate to elliptic curve point.\n * @returns valid point checked for being on-curve\n */\nfunction lift_x(x) {\n if (!fe(x))\n throw new Error('bad x: need 0 < x < p'); // Fail if x ≥ p.\n const xx = modP(x * x);\n const c = modP(xx * x + BigInt(7)); // Let c = x³ + 7 mod p.\n let y = sqrtMod(c); // Let y = c^(p+1)/4 mod p.\n if (y % _2n !== _0n)\n y = modP(-y); // Return the unique point P such that x(P) = x and\n const p = new Point(x, y, _1n); // y(P) = y if y mod 2 = 0 or y(P) = p-y otherwise.\n p.assertValidity();\n return p;\n}\n/**\n * Create tagged hash, convert it to bigint, reduce modulo-n.\n */\nfunction challenge(...args) {\n return modN(bytesToNumberBE(taggedHash('BIP0340/challenge', ...args)));\n}\n/**\n * Schnorr public key is just `x` coordinate of Point as per BIP340.\n */\nfunction schnorrGetPublicKey(privateKey) {\n return schnorrGetExtPubKey(privateKey).bytes; // d'=int(sk). Fail if d'=0 or d'≥n. Ret bytes(d'⋅G)\n}\n/**\n * Creates Schnorr signature as per BIP340. Verifies itself before returning anything.\n * auxRand is optional and is not the sole source of k generation: bad CSPRNG won't be dangerous.\n */\nfunction schnorrSign(message, privateKey, auxRand = randomBytes(32)) {\n const m = ensureBytes('message', message);\n const { bytes: px, scalar: d } = schnorrGetExtPubKey(privateKey); // checks for isWithinCurveOrder\n const a = ensureBytes('auxRand', auxRand, 32); // Auxiliary random data a: a 32-byte array\n const t = numTo32b(d ^ bytesToNumberBE(taggedHash('BIP0340/aux', a))); // Let t be the byte-wise xor of bytes(d) and hash/aux(a)\n const rand = taggedHash('BIP0340/nonce', t, px, m); // Let rand = hash/nonce(t || bytes(P) || m)\n const k_ = modN(bytesToNumberBE(rand)); // Let k' = int(rand) mod n\n if (k_ === _0n)\n throw new Error('sign failed: k is zero'); // Fail if k' = 0.\n const { bytes: rx, scalar: k } = schnorrGetExtPubKey(k_); // Let R = k'⋅G.\n const e = challenge(rx, px, m); // Let e = int(hash/challenge(bytes(R) || bytes(P) || m)) mod n.\n const sig = new Uint8Array(64); // Let sig = bytes(R) || bytes((k + ed) mod n).\n sig.set(rx, 0);\n sig.set(numTo32b(modN(k + e * d)), 32);\n // If Verify(bytes(P), m, sig) (see below) returns failure, abort\n if (!schnorrVerify(sig, m, px))\n throw new Error('sign: Invalid signature produced');\n return sig;\n}\n/**\n * Verifies Schnorr signature.\n * Will swallow errors & return false except for initial type validation of arguments.\n */\nfunction schnorrVerify(signature, message, publicKey) {\n const sig = ensureBytes('signature', signature, 64);\n const m = ensureBytes('message', message);\n const pub = ensureBytes('publicKey', publicKey, 32);\n try {\n const P = lift_x(bytesToNumberBE(pub)); // P = lift_x(int(pk)); fail if that fails\n const r = bytesToNumberBE(sig.subarray(0, 32)); // Let r = int(sig[0:32]); fail if r ≥ p.\n if (!fe(r))\n return false;\n const s = bytesToNumberBE(sig.subarray(32, 64)); // Let s = int(sig[32:64]); fail if s ≥ n.\n if (!ge(s))\n return false;\n const e = challenge(numTo32b(r), pointToBytes(P), m); // int(challenge(bytes(r)||bytes(P)||m))%n\n const R = GmulAdd(P, s, modN(-e)); // R = s⋅G - e⋅P\n if (!R || !R.hasEvenY() || R.toAffine().x !== r)\n return false; // -eP == (n-e)P\n return true; // Fail if is_infinite(R) / not has_even_y(R) / x(R) ≠ r.\n }\n catch (error) {\n return false;\n }\n}\nexport const schnorr = /* @__PURE__ */ (() => ({\n getPublicKey: schnorrGetPublicKey,\n sign: schnorrSign,\n verify: schnorrVerify,\n utils: {\n randomPrivateKey: secp256k1.utils.randomPrivateKey,\n lift_x,\n pointToBytes,\n numberToBytesBE,\n bytesToNumberBE,\n taggedHash,\n mod,\n },\n}))();\nconst isoMap = /* @__PURE__ */ (() => isogenyMap(Fp, [\n // xNum\n [\n '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7',\n '0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581',\n '0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262',\n '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c',\n ],\n // xDen\n [\n '0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b',\n '0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14',\n '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1\n ],\n // yNum\n [\n '0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c',\n '0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3',\n '0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931',\n '0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84',\n ],\n // yDen\n [\n '0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b',\n '0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573',\n '0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f',\n '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1\n ],\n].map((i) => i.map((j) => BigInt(j)))))();\nconst mapSWU = /* @__PURE__ */ (() => mapToCurveSimpleSWU(Fp, {\n A: BigInt('0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533'),\n B: BigInt('1771'),\n Z: Fp.create(BigInt('-11')),\n}))();\nconst htf = /* @__PURE__ */ (() => createHasher(secp256k1.ProjectivePoint, (scalars) => {\n const { x, y } = mapSWU(Fp.create(scalars[0]));\n return isoMap(x, y);\n}, {\n DST: 'secp256k1_XMD:SHA-256_SSWU_RO_',\n encodeDST: 'secp256k1_XMD:SHA-256_SSWU_NU_',\n p: Fp.ORDER,\n m: 1,\n k: 128,\n expand: 'xmd',\n hash: sha256,\n}))();\nexport const hashToCurve = /* @__PURE__ */ (() => htf.hashToCurve)();\nexport const encodeToCurve = /* @__PURE__ */ (() => htf.encodeToCurve)();\n//# sourceMappingURL=secp256k1.js.map","/**\n * A constant for the zero address.\n *\n * (**i.e.** ``\"0x0000000000000000000000000000000000000000\"``)\n */\nexport const ZeroAddress = \"0x0000000000000000000000000000000000000000\";\n//# sourceMappingURL=addresses.js.map","/**\n * A constant for the zero hash.\n *\n * (**i.e.** ``\"0x0000000000000000000000000000000000000000000000000000000000000000\"``)\n */\nexport const ZeroHash = \"0x0000000000000000000000000000000000000000000000000000000000000000\";\n//# sourceMappingURL=hashes.js.map","/**\n * A constant for the order N for the secp256k1 curve.\n *\n * (**i.e.** ``0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n``)\n */\nexport const N = BigInt(\"0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141\");\n/**\n * A constant for the number of wei in a single ether.\n *\n * (**i.e.** ``1000000000000000000n``)\n */\nexport const WeiPerEther = BigInt(\"1000000000000000000\");\n/**\n * A constant for the maximum value for a ``uint256``.\n *\n * (**i.e.** ``0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``)\n */\nexport const MaxUint256 = BigInt(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\n/**\n * A constant for the minimum value for an ``int256``.\n *\n * (**i.e.** ``-8000000000000000000000000000000000000000000000000000000000000000n``)\n */\nexport const MinInt256 = BigInt(\"0x8000000000000000000000000000000000000000000000000000000000000000\") * BigInt(-1);\n/**\n * A constant for the maximum value for an ``int256``.\n *\n * (**i.e.** ``0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``)\n */\nexport const MaxInt256 = BigInt(\"0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\n//# sourceMappingURL=numbers.js.map","// NFKC (composed) // (decomposed)\n/**\n * A constant for the ether symbol (normalized using NFKC).\n *\n * (**i.e.** ``\"\\\\u039e\"``)\n */\nexport const EtherSymbol = \"\\u039e\"; // \"\\uD835\\uDF63\";\n/**\n * A constant for the [[link-eip-191]] personal message prefix.\n *\n * (**i.e.** ``\"\\\\x19Ethereum Signed Message:\\\\n\"``)\n */\nexport const MessagePrefix = \"\\x19Ethereum Signed Message:\\n\";\n//# sourceMappingURL=strings.js.map","import { ZeroHash } from \"../constants/index.js\";\nimport { concat, dataLength, getBigInt, getBytes, getNumber, hexlify, toBeArray, isHexString, zeroPadValue, assertArgument, assertPrivate } from \"../utils/index.js\";\n// Constants\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_2 = BigInt(2);\nconst BN_27 = BigInt(27);\nconst BN_28 = BigInt(28);\nconst BN_35 = BigInt(35);\nconst BN_N = BigInt(\"0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141\");\nconst BN_N_2 = BN_N / BN_2; // Must be integer (floor) division; do NOT shifts\nconst inspect = Symbol.for(\"nodejs.util.inspect.custom\");\nconst _guard = {};\nfunction toUint256(value) {\n return zeroPadValue(toBeArray(value), 32);\n}\n/**\n * A Signature @TODO\n *\n *\n * @_docloc: api/crypto:Signing\n */\nexport class Signature {\n #r;\n #s;\n #v;\n #networkV;\n /**\n * The ``r`` value for a signature.\n *\n * This represents the ``x`` coordinate of a \"reference\" or\n * challenge point, from which the ``y`` can be computed.\n */\n get r() { return this.#r; }\n set r(value) {\n assertArgument(dataLength(value) === 32, \"invalid r\", \"value\", value);\n this.#r = hexlify(value);\n }\n /**\n * The ``s`` value for a signature.\n */\n get s() {\n assertArgument(parseInt(this.#s.substring(0, 3)) < 8, \"non-canonical s; use ._s\", \"s\", this.#s);\n return this.#s;\n }\n set s(_value) {\n assertArgument(dataLength(_value) === 32, \"invalid s\", \"value\", _value);\n this.#s = hexlify(_value);\n }\n /**\n * Return the s value, unchecked for EIP-2 compliance.\n *\n * This should generally not be used and is for situations where\n * a non-canonical S value might be relevant, such as Frontier blocks\n * that were mined prior to EIP-2 or invalid Authorization List\n * signatures.\n */\n get _s() { return this.#s; }\n /**\n * Returns true if the Signature is valid for [[link-eip-2]] signatures.\n */\n isValid() {\n const s = BigInt(this.#s);\n return (s <= BN_N_2);\n }\n /**\n * The ``v`` value for a signature.\n *\n * Since a given ``x`` value for ``r`` has two possible values for\n * its correspondin ``y``, the ``v`` indicates which of the two ``y``\n * values to use.\n *\n * It is normalized to the values ``27`` or ``28`` for legacy\n * purposes.\n */\n get v() { return this.#v; }\n set v(value) {\n const v = getNumber(value, \"value\");\n assertArgument(v === 27 || v === 28, \"invalid v\", \"v\", value);\n this.#v = v;\n }\n /**\n * The EIP-155 ``v`` for legacy transactions. For non-legacy\n * transactions, this value is ``null``.\n */\n get networkV() { return this.#networkV; }\n /**\n * The chain ID for EIP-155 legacy transactions. For non-legacy\n * transactions, this value is ``null``.\n */\n get legacyChainId() {\n const v = this.networkV;\n if (v == null) {\n return null;\n }\n return Signature.getChainId(v);\n }\n /**\n * The ``yParity`` for the signature.\n *\n * See ``v`` for more details on how this value is used.\n */\n get yParity() {\n return (this.v === 27) ? 0 : 1;\n }\n /**\n * The [[link-eip-2098]] compact representation of the ``yParity``\n * and ``s`` compacted into a single ``bytes32``.\n */\n get yParityAndS() {\n // The EIP-2098 compact representation\n const yParityAndS = getBytes(this.s);\n if (this.yParity) {\n yParityAndS[0] |= 0x80;\n }\n return hexlify(yParityAndS);\n }\n /**\n * The [[link-eip-2098]] compact representation.\n */\n get compactSerialized() {\n return concat([this.r, this.yParityAndS]);\n }\n /**\n * The serialized representation.\n */\n get serialized() {\n return concat([this.r, this.s, (this.yParity ? \"0x1c\" : \"0x1b\")]);\n }\n /**\n * @private\n */\n constructor(guard, r, s, v) {\n assertPrivate(guard, _guard, \"Signature\");\n this.#r = r;\n this.#s = s;\n this.#v = v;\n this.#networkV = null;\n }\n /**\n * Returns the canonical signature.\n *\n * This is only necessary when dealing with legacy transaction which\n * did not enforce canonical S values (i.e. [[link-eip-2]]. Most\n * developers should never require this.\n */\n getCanonical() {\n if (this.isValid()) {\n return this;\n }\n // Compute the canonical signature; s' = N - s, v = !v\n const s = BN_N - BigInt(this._s);\n const v = (55 - this.v);\n const result = new Signature(_guard, this.r, toUint256(s), v);\n // Populate the networkV if necessary\n if (this.networkV) {\n result.#networkV = this.networkV;\n }\n return result;\n }\n /**\n * Returns a new identical [[Signature]].\n */\n clone() {\n const clone = new Signature(_guard, this.r, this._s, this.v);\n if (this.networkV) {\n clone.#networkV = this.networkV;\n }\n return clone;\n }\n /**\n * Returns a representation that is compatible with ``JSON.stringify``.\n */\n toJSON() {\n const networkV = this.networkV;\n return {\n _type: \"signature\",\n networkV: ((networkV != null) ? networkV.toString() : null),\n r: this.r, s: this._s, v: this.v,\n };\n }\n [inspect]() {\n return this.toString();\n }\n toString() {\n if (this.isValid()) {\n return `Signature { r: ${this.r}, s: ${this._s}, v: ${this.v} }`;\n }\n return `Signature { r: ${this.r}, s: ${this._s}, v: ${this.v}, valid: false }`;\n }\n /**\n * Compute the chain ID from the ``v`` in a legacy EIP-155 transactions.\n *\n * @example:\n * Signature.getChainId(45)\n * //_result:\n *\n * Signature.getChainId(46)\n * //_result:\n */\n static getChainId(v) {\n const bv = getBigInt(v, \"v\");\n // The v is not an EIP-155 v, so it is the unspecified chain ID\n if ((bv == BN_27) || (bv == BN_28)) {\n return BN_0;\n }\n // Bad value for an EIP-155 v\n assertArgument(bv >= BN_35, \"invalid EIP-155 v\", \"v\", v);\n return (bv - BN_35) / BN_2;\n }\n /**\n * Compute the ``v`` for a chain ID for a legacy EIP-155 transactions.\n *\n * Legacy transactions which use [[link-eip-155]] hijack the ``v``\n * property to include the chain ID.\n *\n * @example:\n * Signature.getChainIdV(5, 27)\n * //_result:\n *\n * Signature.getChainIdV(5, 28)\n * //_result:\n *\n */\n static getChainIdV(chainId, v) {\n return (getBigInt(chainId) * BN_2) + BigInt(35 + v - 27);\n }\n /**\n * Compute the normalized legacy transaction ``v`` from a ``yParirty``,\n * a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction.\n *\n * @example:\n * // The values 0 and 1 imply v is actually yParity\n * Signature.getNormalizedV(0)\n * //_result:\n *\n * // Legacy non-EIP-1559 transaction (i.e. 27 or 28)\n * Signature.getNormalizedV(27)\n * //_result:\n *\n * // Legacy EIP-155 transaction (i.e. >= 35)\n * Signature.getNormalizedV(46)\n * //_result:\n *\n * // Invalid values throw\n * Signature.getNormalizedV(5)\n * //_error:\n */\n static getNormalizedV(v) {\n const bv = getBigInt(v);\n if (bv === BN_0 || bv === BN_27) {\n return 27;\n }\n if (bv === BN_1 || bv === BN_28) {\n return 28;\n }\n assertArgument(bv >= BN_35, \"invalid v\", \"v\", v);\n // Otherwise, EIP-155 v means odd is 27 and even is 28\n return (bv & BN_1) ? 27 : 28;\n }\n /**\n * Creates a new [[Signature]].\n *\n * If no %%sig%% is provided, a new [[Signature]] is created\n * with default values.\n *\n * If %%sig%% is a string, it is parsed.\n */\n static from(sig) {\n function assertError(check, message) {\n assertArgument(check, message, \"signature\", sig);\n }\n ;\n if (sig == null) {\n return new Signature(_guard, ZeroHash, ZeroHash, 27);\n }\n if (typeof (sig) === \"string\") {\n const bytes = getBytes(sig, \"signature\");\n if (bytes.length === 64) {\n const r = hexlify(bytes.slice(0, 32));\n const s = bytes.slice(32, 64);\n const v = (s[0] & 0x80) ? 28 : 27;\n s[0] &= 0x7f;\n return new Signature(_guard, r, hexlify(s), v);\n }\n if (bytes.length === 65) {\n const r = hexlify(bytes.slice(0, 32));\n const s = hexlify(bytes.slice(32, 64));\n const v = Signature.getNormalizedV(bytes[64]);\n return new Signature(_guard, r, s, v);\n }\n assertError(false, \"invalid raw signature length\");\n }\n if (sig instanceof Signature) {\n return sig.clone();\n }\n // Get r\n const _r = sig.r;\n assertError(_r != null, \"missing r\");\n const r = toUint256(_r);\n // Get s; by any means necessary (we check consistency below)\n const s = (function (s, yParityAndS) {\n if (s != null) {\n return toUint256(s);\n }\n if (yParityAndS != null) {\n assertError(isHexString(yParityAndS, 32), \"invalid yParityAndS\");\n const bytes = getBytes(yParityAndS);\n bytes[0] &= 0x7f;\n return hexlify(bytes);\n }\n assertError(false, \"missing s\");\n })(sig.s, sig.yParityAndS);\n // Get v; by any means necessary (we check consistency below)\n const { networkV, v } = (function (_v, yParityAndS, yParity) {\n if (_v != null) {\n const v = getBigInt(_v);\n return {\n networkV: ((v >= BN_35) ? v : undefined),\n v: Signature.getNormalizedV(v)\n };\n }\n if (yParityAndS != null) {\n assertError(isHexString(yParityAndS, 32), \"invalid yParityAndS\");\n return { v: ((getBytes(yParityAndS)[0] & 0x80) ? 28 : 27) };\n }\n if (yParity != null) {\n switch (getNumber(yParity, \"sig.yParity\")) {\n case 0: return { v: 27 };\n case 1: return { v: 28 };\n }\n assertError(false, \"invalid yParity\");\n }\n assertError(false, \"missing v\");\n })(sig.v, sig.yParityAndS, sig.yParity);\n const result = new Signature(_guard, r, s, v);\n if (networkV) {\n result.#networkV = networkV;\n }\n // If multiple of v, yParity, yParityAndS we given, check they match\n assertError(sig.yParity == null || getNumber(sig.yParity, \"sig.yParity\") === result.yParity, \"yParity mismatch\");\n assertError(sig.yParityAndS == null || sig.yParityAndS === result.yParityAndS, \"yParityAndS mismatch\");\n return result;\n }\n}\n//# sourceMappingURL=signature.js.map","/**\n * Add details about signing here.\n *\n * @_subsection: api/crypto:Signing [about-signing]\n */\nimport { secp256k1 } from \"@noble/curves/secp256k1\";\nimport { concat, dataLength, getBytes, getBytesCopy, hexlify, toBeHex, assertArgument } from \"../utils/index.js\";\nimport { Signature } from \"./signature.js\";\n/**\n * A **SigningKey** provides high-level access to the elliptic curve\n * cryptography (ECC) operations and key management.\n */\nexport class SigningKey {\n #privateKey;\n /**\n * Creates a new **SigningKey** for %%privateKey%%.\n */\n constructor(privateKey) {\n assertArgument(dataLength(privateKey) === 32, \"invalid private key\", \"privateKey\", \"[REDACTED]\");\n this.#privateKey = hexlify(privateKey);\n }\n /**\n * The private key.\n */\n get privateKey() { return this.#privateKey; }\n /**\n * The uncompressed public key.\n *\n * This will always begin with the prefix ``0x04`` and be 132\n * characters long (the ``0x`` prefix and 130 hexadecimal nibbles).\n */\n get publicKey() { return SigningKey.computePublicKey(this.#privateKey); }\n /**\n * The compressed public key.\n *\n * This will always begin with either the prefix ``0x02`` or ``0x03``\n * and be 68 characters long (the ``0x`` prefix and 33 hexadecimal\n * nibbles)\n */\n get compressedPublicKey() { return SigningKey.computePublicKey(this.#privateKey, true); }\n /**\n * Return the signature of the signed %%digest%%.\n */\n sign(digest) {\n assertArgument(dataLength(digest) === 32, \"invalid digest length\", \"digest\", digest);\n const sig = secp256k1.sign(getBytesCopy(digest), getBytesCopy(this.#privateKey), {\n lowS: true\n });\n return Signature.from({\n r: toBeHex(sig.r, 32),\n s: toBeHex(sig.s, 32),\n v: (sig.recovery ? 0x1c : 0x1b)\n });\n }\n /**\n * Returns the [[link-wiki-ecdh]] shared secret between this\n * private key and the %%other%% key.\n *\n * The %%other%% key may be any type of key, a raw public key,\n * a compressed/uncompressed pubic key or aprivate key.\n *\n * Best practice is usually to use a cryptographic hash on the\n * returned value before using it as a symetric secret.\n *\n * @example:\n * sign1 = new SigningKey(id(\"some-secret-1\"))\n * sign2 = new SigningKey(id(\"some-secret-2\"))\n *\n * // Notice that privA.computeSharedSecret(pubB)...\n * sign1.computeSharedSecret(sign2.publicKey)\n * //_result:\n *\n * // ...is equal to privB.computeSharedSecret(pubA).\n * sign2.computeSharedSecret(sign1.publicKey)\n * //_result:\n */\n computeSharedSecret(other) {\n const pubKey = SigningKey.computePublicKey(other);\n return hexlify(secp256k1.getSharedSecret(getBytesCopy(this.#privateKey), getBytes(pubKey), false));\n }\n /**\n * Compute the public key for %%key%%, optionally %%compressed%%.\n *\n * The %%key%% may be any type of key, a raw public key, a\n * compressed/uncompressed public key or private key.\n *\n * @example:\n * sign = new SigningKey(id(\"some-secret\"));\n *\n * // Compute the uncompressed public key for a private key\n * SigningKey.computePublicKey(sign.privateKey)\n * //_result:\n *\n * // Compute the compressed public key for a private key\n * SigningKey.computePublicKey(sign.privateKey, true)\n * //_result:\n *\n * // Compute the uncompressed public key\n * SigningKey.computePublicKey(sign.publicKey, false);\n * //_result:\n *\n * // Compute the Compressed a public key\n * SigningKey.computePublicKey(sign.publicKey, true);\n * //_result:\n */\n static computePublicKey(key, compressed) {\n let bytes = getBytes(key, \"key\");\n // private key\n if (bytes.length === 32) {\n const pubKey = secp256k1.getPublicKey(bytes, !!compressed);\n return hexlify(pubKey);\n }\n // raw public key; use uncompressed key with 0x04 prefix\n if (bytes.length === 64) {\n const pub = new Uint8Array(65);\n pub[0] = 0x04;\n pub.set(bytes, 1);\n bytes = pub;\n }\n const point = secp256k1.ProjectivePoint.fromHex(bytes);\n return hexlify(point.toRawBytes(compressed));\n }\n /**\n * Returns the public key for the private key which produced the\n * %%signature%% for the given %%digest%%.\n *\n * @example:\n * key = new SigningKey(id(\"some-secret\"))\n * digest = id(\"hello world\")\n * sig = key.sign(digest)\n *\n * // Notice the signer public key...\n * key.publicKey\n * //_result:\n *\n * // ...is equal to the recovered public key\n * SigningKey.recoverPublicKey(digest, sig)\n * //_result:\n *\n */\n static recoverPublicKey(digest, signature) {\n assertArgument(dataLength(digest) === 32, \"invalid digest length\", \"digest\", digest);\n const sig = Signature.from(signature);\n let secpSig = secp256k1.Signature.fromCompact(getBytesCopy(concat([sig.r, sig.s])));\n secpSig = secpSig.addRecoveryBit(sig.yParity);\n const pubKey = secpSig.recoverPublicKey(getBytesCopy(digest));\n assertArgument(pubKey != null, \"invalid signature for digest\", \"signature\", signature);\n return \"0x\" + pubKey.toHex(false);\n }\n /**\n * Returns the point resulting from adding the ellipic curve points\n * %%p0%% and %%p1%%.\n *\n * This is not a common function most developers should require, but\n * can be useful for certain privacy-specific techniques.\n *\n * For example, it is used by [[HDNodeWallet]] to compute child\n * addresses from parent public keys and chain codes.\n */\n static addPoints(p0, p1, compressed) {\n const pub0 = secp256k1.ProjectivePoint.fromHex(SigningKey.computePublicKey(p0).substring(2));\n const pub1 = secp256k1.ProjectivePoint.fromHex(SigningKey.computePublicKey(p1).substring(2));\n return \"0x\" + pub0.add(pub1).toHex(!!compressed);\n }\n}\n//# sourceMappingURL=signing-key.js.map","/**\n * A fundamental building block of Ethereum is the underlying\n * cryptographic primitives.\n *\n * @_section: api/crypto:Cryptographic Functions [about-crypto]\n */\nnull;\n// We import all these so we can export lock()\nimport { computeHmac } from \"./hmac.js\";\nimport { keccak256 } from \"./keccak.js\";\nimport { ripemd160 } from \"./ripemd160.js\";\nimport { pbkdf2 } from \"./pbkdf2.js\";\nimport { randomBytes } from \"./random.js\";\nimport { scrypt, scryptSync } from \"./scrypt.js\";\nimport { sha256, sha512 } from \"./sha2.js\";\nexport { computeHmac, randomBytes, keccak256, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync };\nexport { SigningKey } from \"./signing-key.js\";\nexport { Signature } from \"./signature.js\";\n/**\n * Once called, prevents any future change to the underlying cryptographic\n * primitives using the ``.register`` feature for hooks.\n */\nfunction lock() {\n computeHmac.lock();\n keccak256.lock();\n pbkdf2.lock();\n randomBytes.lock();\n ripemd160.lock();\n scrypt.lock();\n scryptSync.lock();\n sha256.lock();\n sha512.lock();\n randomBytes.lock();\n}\nexport { lock };\n//# sourceMappingURL=index.js.map","import { keccak256 } from \"../crypto/index.js\";\nimport { getBytes, assertArgument } from \"../utils/index.js\";\nconst BN_0 = BigInt(0);\nconst BN_36 = BigInt(36);\nfunction getChecksumAddress(address) {\n // if (!isHexString(address, 20)) {\n // logger.throwArgumentError(\"invalid address\", \"address\", address);\n // }\n address = address.toLowerCase();\n const chars = address.substring(2).split(\"\");\n const expanded = new Uint8Array(40);\n for (let i = 0; i < 40; i++) {\n expanded[i] = chars[i].charCodeAt(0);\n }\n const hashed = getBytes(keccak256(expanded));\n for (let i = 0; i < 40; i += 2) {\n if ((hashed[i >> 1] >> 4) >= 8) {\n chars[i] = chars[i].toUpperCase();\n }\n if ((hashed[i >> 1] & 0x0f) >= 8) {\n chars[i + 1] = chars[i + 1].toUpperCase();\n }\n }\n return \"0x\" + chars.join(\"\");\n}\n// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number\n// Create lookup table\nconst ibanLookup = {};\nfor (let i = 0; i < 10; i++) {\n ibanLookup[String(i)] = String(i);\n}\nfor (let i = 0; i < 26; i++) {\n ibanLookup[String.fromCharCode(65 + i)] = String(10 + i);\n}\n// How many decimal digits can we process? (for 64-bit float, this is 15)\n// i.e. Math.floor(Math.log10(Number.MAX_SAFE_INTEGER));\nconst safeDigits = 15;\nfunction ibanChecksum(address) {\n address = address.toUpperCase();\n address = address.substring(4) + address.substring(0, 2) + \"00\";\n let expanded = address.split(\"\").map((c) => { return ibanLookup[c]; }).join(\"\");\n // Javascript can handle integers safely up to 15 (decimal) digits\n while (expanded.length >= safeDigits) {\n let block = expanded.substring(0, safeDigits);\n expanded = parseInt(block, 10) % 97 + expanded.substring(block.length);\n }\n let checksum = String(98 - (parseInt(expanded, 10) % 97));\n while (checksum.length < 2) {\n checksum = \"0\" + checksum;\n }\n return checksum;\n}\n;\nconst Base36 = (function () {\n ;\n const result = {};\n for (let i = 0; i < 36; i++) {\n const key = \"0123456789abcdefghijklmnopqrstuvwxyz\"[i];\n result[key] = BigInt(i);\n }\n return result;\n})();\nfunction fromBase36(value) {\n value = value.toLowerCase();\n let result = BN_0;\n for (let i = 0; i < value.length; i++) {\n result = result * BN_36 + Base36[value[i]];\n }\n return result;\n}\n/**\n * Returns a normalized and checksumed address for %%address%%.\n * This accepts non-checksum addresses, checksum addresses and\n * [[getIcapAddress]] formats.\n *\n * The checksum in Ethereum uses the capitalization (upper-case\n * vs lower-case) of the characters within an address to encode\n * its checksum, which offers, on average, a checksum of 15-bits.\n *\n * If %%address%% contains both upper-case and lower-case, it is\n * assumed to already be a checksum address and its checksum is\n * validated, and if the address fails its expected checksum an\n * error is thrown.\n *\n * If you wish the checksum of %%address%% to be ignore, it should\n * be converted to lower-case (i.e. ``.toLowercase()``) before\n * being passed in. This should be a very rare situation though,\n * that you wish to bypass the safegaurds in place to protect\n * against an address that has been incorrectly copied from another\n * source.\n *\n * @example:\n * // Adds the checksum (via upper-casing specific letters)\n * getAddress(\"0x8ba1f109551bd432803012645ac136ddd64dba72\")\n * //_result:\n *\n * // Converts ICAP address and adds checksum\n * getAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\");\n * //_result:\n *\n * // Throws an error if an address contains mixed case,\n * // but the checksum fails\n * getAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBA72\")\n * //_error:\n */\nexport function getAddress(address) {\n assertArgument(typeof (address) === \"string\", \"invalid address\", \"address\", address);\n if (address.match(/^(0x)?[0-9a-fA-F]{40}$/)) {\n // Missing the 0x prefix\n if (!address.startsWith(\"0x\")) {\n address = \"0x\" + address;\n }\n const result = getChecksumAddress(address);\n // It is a checksummed address with a bad checksum\n assertArgument(!address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) || result === address, \"bad address checksum\", \"address\", address);\n return result;\n }\n // Maybe ICAP? (we only support direct mode)\n if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {\n // It is an ICAP address with a bad checksum\n assertArgument(address.substring(2, 4) === ibanChecksum(address), \"bad icap checksum\", \"address\", address);\n let result = fromBase36(address.substring(4)).toString(16);\n while (result.length < 40) {\n result = \"0\" + result;\n }\n return getChecksumAddress(\"0x\" + result);\n }\n assertArgument(false, \"invalid address\", \"address\", address);\n}\n/**\n * The [ICAP Address format](link-icap) format is an early checksum\n * format which attempts to be compatible with the banking\n * industry [IBAN format](link-wiki-iban) for bank accounts.\n *\n * It is no longer common or a recommended format.\n *\n * @example:\n * getIcapAddress(\"0x8ba1f109551bd432803012645ac136ddd64dba72\");\n * //_result:\n *\n * getIcapAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\");\n * //_result:\n *\n * // Throws an error if the ICAP checksum is wrong\n * getIcapAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK37\");\n * //_error:\n */\nexport function getIcapAddress(address) {\n //let base36 = _base16To36(getAddress(address).substring(2)).toUpperCase();\n let base36 = BigInt(getAddress(address)).toString(36).toUpperCase();\n while (base36.length < 30) {\n base36 = \"0\" + base36;\n }\n return \"XE\" + ibanChecksum(\"XE00\" + base36) + base36;\n}\n//# sourceMappingURL=address.js.map","import { keccak256 } from \"../crypto/index.js\";\nimport { concat, dataSlice, getBigInt, getBytes, encodeRlp, assertArgument } from \"../utils/index.js\";\nimport { getAddress } from \"./address.js\";\n// http://ethereum.stackexchange.com/questions/760/how-is-the-address-of-an-ethereum-contract-computed\n/**\n * Returns the address that would result from a ``CREATE`` for %%tx%%.\n *\n * This can be used to compute the address a contract will be\n * deployed to by an EOA when sending a deployment transaction (i.e.\n * when the ``to`` address is ``null``).\n *\n * This can also be used to compute the address a contract will be\n * deployed to by a contract, by using the contract's address as the\n * ``to`` and the contract's nonce.\n *\n * @example\n * from = \"0x8ba1f109551bD432803012645Ac136ddd64DBA72\";\n * nonce = 5;\n *\n * getCreateAddress({ from, nonce });\n * //_result:\n */\nexport function getCreateAddress(tx) {\n const from = getAddress(tx.from);\n const nonce = getBigInt(tx.nonce, \"tx.nonce\");\n let nonceHex = nonce.toString(16);\n if (nonceHex === \"0\") {\n nonceHex = \"0x\";\n }\n else if (nonceHex.length % 2) {\n nonceHex = \"0x0\" + nonceHex;\n }\n else {\n nonceHex = \"0x\" + nonceHex;\n }\n return getAddress(dataSlice(keccak256(encodeRlp([from, nonceHex])), 12));\n}\n/**\n * Returns the address that would result from a ``CREATE2`` operation\n * with the given %%from%%, %%salt%% and %%initCodeHash%%.\n *\n * To compute the %%initCodeHash%% from a contract's init code, use\n * the [[keccak256]] function.\n *\n * For a quick overview and example of ``CREATE2``, see [[link-ricmoo-wisps]].\n *\n * @example\n * // The address of the contract\n * from = \"0x8ba1f109551bD432803012645Ac136ddd64DBA72\"\n *\n * // The salt\n * salt = id(\"HelloWorld\")\n *\n * // The hash of the initCode\n * initCode = \"0x6394198df16000526103ff60206004601c335afa6040516060f3\";\n * initCodeHash = keccak256(initCode)\n *\n * getCreate2Address(from, salt, initCodeHash)\n * //_result:\n */\nexport function getCreate2Address(_from, _salt, _initCodeHash) {\n const from = getAddress(_from);\n const salt = getBytes(_salt, \"salt\");\n const initCodeHash = getBytes(_initCodeHash, \"initCodeHash\");\n assertArgument(salt.length === 32, \"salt must be 32 bytes\", \"salt\", _salt);\n assertArgument(initCodeHash.length === 32, \"initCodeHash must be 32 bytes\", \"initCodeHash\", _initCodeHash);\n return getAddress(dataSlice(keccak256(concat([\"0xff\", from, salt, initCodeHash])), 12));\n}\n//# sourceMappingURL=contract-address.js.map","import { assert, assertArgument } from \"../utils/index.js\";\nimport { getAddress } from \"./address.js\";\n/**\n * Returns true if %%value%% is an object which implements the\n * [[Addressable]] interface.\n *\n * @example:\n * // Wallets and AbstractSigner sub-classes\n * isAddressable(Wallet.createRandom())\n * //_result:\n *\n * // Contracts\n * contract = new Contract(\"dai.tokens.ethers.eth\", [ ], provider)\n * isAddressable(contract)\n * //_result:\n */\nexport function isAddressable(value) {\n return (value && typeof (value.getAddress) === \"function\");\n}\n/**\n * Returns true if %%value%% is a valid address.\n *\n * @example:\n * // Valid address\n * isAddress(\"0x8ba1f109551bD432803012645Ac136ddd64DBA72\")\n * //_result:\n *\n * // Valid ICAP address\n * isAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\")\n * //_result:\n *\n * // Invalid checksum\n * isAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBa72\")\n * //_result:\n *\n * // Invalid ICAP checksum\n * isAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBA72\")\n * //_result:\n *\n * // Not an address (an ENS name requires a provided and an\n * // asynchronous API to access)\n * isAddress(\"ricmoo.eth\")\n * //_result:\n */\nexport function isAddress(value) {\n try {\n getAddress(value);\n return true;\n }\n catch (error) { }\n return false;\n}\nasync function checkAddress(target, promise) {\n const result = await promise;\n if (result == null || result === \"0x0000000000000000000000000000000000000000\") {\n assert(typeof (target) !== \"string\", \"unconfigured name\", \"UNCONFIGURED_NAME\", { value: target });\n assertArgument(false, \"invalid AddressLike value; did not resolve to a value address\", \"target\", target);\n }\n return getAddress(result);\n}\n/**\n * Resolves to an address for the %%target%%, which may be any\n * supported address type, an [[Addressable]] or a Promise which\n * resolves to an address.\n *\n * If an ENS name is provided, but that name has not been correctly\n * configured a [[UnconfiguredNameError]] is thrown.\n *\n * @example:\n * addr = \"0x6B175474E89094C44Da98b954EedeAC495271d0F\"\n *\n * // Addresses are return synchronously\n * resolveAddress(addr, provider)\n * //_result:\n *\n * // Address promises are resolved asynchronously\n * resolveAddress(Promise.resolve(addr))\n * //_result:\n *\n * // ENS names are resolved asynchronously\n * resolveAddress(\"dai.tokens.ethers.eth\", provider)\n * //_result:\n *\n * // Addressable objects are resolved asynchronously\n * contract = new Contract(addr, [ ])\n * resolveAddress(contract, provider)\n * //_result:\n *\n * // Unconfigured ENS names reject\n * resolveAddress(\"nothing-here.ricmoo.eth\", provider)\n * //_error:\n *\n * // ENS names require a NameResolver object passed in\n * // (notice the provider was omitted)\n * resolveAddress(\"nothing-here.ricmoo.eth\")\n * //_error:\n */\nexport function resolveAddress(target, resolver) {\n if (typeof (target) === \"string\") {\n if (target.match(/^0x[0-9a-f]{40}$/i)) {\n return getAddress(target);\n }\n assert(resolver != null, \"ENS resolution requires a provider\", \"UNSUPPORTED_OPERATION\", { operation: \"resolveName\" });\n return checkAddress(target, resolver.resolveName(target));\n }\n else if (isAddressable(target)) {\n return checkAddress(target, target.getAddress());\n }\n else if (target && typeof (target.then) === \"function\") {\n return checkAddress(target, target);\n }\n assertArgument(false, \"unsupported addressable value\", \"target\", target);\n}\n//# sourceMappingURL=checks.js.map","/**\n * A Typed object allows a value to have its type explicitly\n * specified.\n *\n * For example, in Solidity, the value ``45`` could represent a\n * ``uint8`` or a ``uint256``. The value ``0x1234`` could represent\n * a ``bytes2`` or ``bytes``.\n *\n * Since JavaScript has no meaningful way to explicitly inform any\n * APIs which what the type is, this allows transparent interoperation\n * with Soldity.\n *\n * @_subsection: api/abi:Typed Values\n */\nimport { assertPrivate, defineProperties } from \"../utils/index.js\";\nconst _gaurd = {};\nfunction n(value, width) {\n let signed = false;\n if (width < 0) {\n signed = true;\n width *= -1;\n }\n // @TODO: Check range is valid for value\n return new Typed(_gaurd, `${signed ? \"\" : \"u\"}int${width}`, value, { signed, width });\n}\nfunction b(value, size) {\n // @TODO: Check range is valid for value\n return new Typed(_gaurd, `bytes${(size) ? size : \"\"}`, value, { size });\n}\nconst _typedSymbol = Symbol.for(\"_ethers_typed\");\n/**\n * The **Typed** class to wrap values providing explicit type information.\n */\nexport class Typed {\n /**\n * The type, as a Solidity-compatible type.\n */\n type;\n /**\n * The actual value.\n */\n value;\n #options;\n /**\n * @_ignore:\n */\n _typedSymbol;\n /**\n * @_ignore:\n */\n constructor(gaurd, type, value, options) {\n if (options == null) {\n options = null;\n }\n assertPrivate(_gaurd, gaurd, \"Typed\");\n defineProperties(this, { _typedSymbol, type, value });\n this.#options = options;\n // Check the value is valid\n this.format();\n }\n /**\n * Format the type as a Human-Readable type.\n */\n format() {\n if (this.type === \"array\") {\n throw new Error(\"\");\n }\n else if (this.type === \"dynamicArray\") {\n throw new Error(\"\");\n }\n else if (this.type === \"tuple\") {\n return `tuple(${this.value.map((v) => v.format()).join(\",\")})`;\n }\n return this.type;\n }\n /**\n * The default value returned by this type.\n */\n defaultValue() {\n return 0;\n }\n /**\n * The minimum value for numeric types.\n */\n minValue() {\n return 0;\n }\n /**\n * The maximum value for numeric types.\n */\n maxValue() {\n return 0;\n }\n /**\n * Returns ``true`` and provides a type guard is this is a [[TypedBigInt]].\n */\n isBigInt() {\n return !!(this.type.match(/^u?int[0-9]+$/));\n }\n /**\n * Returns ``true`` and provides a type guard is this is a [[TypedData]].\n */\n isData() {\n return this.type.startsWith(\"bytes\");\n }\n /**\n * Returns ``true`` and provides a type guard is this is a [[TypedString]].\n */\n isString() {\n return (this.type === \"string\");\n }\n /**\n * Returns the tuple name, if this is a tuple. Throws otherwise.\n */\n get tupleName() {\n if (this.type !== \"tuple\") {\n throw TypeError(\"not a tuple\");\n }\n return this.#options;\n }\n // Returns the length of this type as an array\n // - `null` indicates the length is unforced, it could be dynamic\n // - `-1` indicates the length is dynamic\n // - any other value indicates it is a static array and is its length\n /**\n * Returns the length of the array type or ``-1`` if it is dynamic.\n *\n * Throws if the type is not an array.\n */\n get arrayLength() {\n if (this.type !== \"array\") {\n throw TypeError(\"not an array\");\n }\n if (this.#options === true) {\n return -1;\n }\n if (this.#options === false) {\n return (this.value).length;\n }\n return null;\n }\n /**\n * Returns a new **Typed** of %%type%% with the %%value%%.\n */\n static from(type, value) {\n return new Typed(_gaurd, type, value);\n }\n /**\n * Return a new ``uint8`` type for %%v%%.\n */\n static uint8(v) { return n(v, 8); }\n /**\n * Return a new ``uint16`` type for %%v%%.\n */\n static uint16(v) { return n(v, 16); }\n /**\n * Return a new ``uint24`` type for %%v%%.\n */\n static uint24(v) { return n(v, 24); }\n /**\n * Return a new ``uint32`` type for %%v%%.\n */\n static uint32(v) { return n(v, 32); }\n /**\n * Return a new ``uint40`` type for %%v%%.\n */\n static uint40(v) { return n(v, 40); }\n /**\n * Return a new ``uint48`` type for %%v%%.\n */\n static uint48(v) { return n(v, 48); }\n /**\n * Return a new ``uint56`` type for %%v%%.\n */\n static uint56(v) { return n(v, 56); }\n /**\n * Return a new ``uint64`` type for %%v%%.\n */\n static uint64(v) { return n(v, 64); }\n /**\n * Return a new ``uint72`` type for %%v%%.\n */\n static uint72(v) { return n(v, 72); }\n /**\n * Return a new ``uint80`` type for %%v%%.\n */\n static uint80(v) { return n(v, 80); }\n /**\n * Return a new ``uint88`` type for %%v%%.\n */\n static uint88(v) { return n(v, 88); }\n /**\n * Return a new ``uint96`` type for %%v%%.\n */\n static uint96(v) { return n(v, 96); }\n /**\n * Return a new ``uint104`` type for %%v%%.\n */\n static uint104(v) { return n(v, 104); }\n /**\n * Return a new ``uint112`` type for %%v%%.\n */\n static uint112(v) { return n(v, 112); }\n /**\n * Return a new ``uint120`` type for %%v%%.\n */\n static uint120(v) { return n(v, 120); }\n /**\n * Return a new ``uint128`` type for %%v%%.\n */\n static uint128(v) { return n(v, 128); }\n /**\n * Return a new ``uint136`` type for %%v%%.\n */\n static uint136(v) { return n(v, 136); }\n /**\n * Return a new ``uint144`` type for %%v%%.\n */\n static uint144(v) { return n(v, 144); }\n /**\n * Return a new ``uint152`` type for %%v%%.\n */\n static uint152(v) { return n(v, 152); }\n /**\n * Return a new ``uint160`` type for %%v%%.\n */\n static uint160(v) { return n(v, 160); }\n /**\n * Return a new ``uint168`` type for %%v%%.\n */\n static uint168(v) { return n(v, 168); }\n /**\n * Return a new ``uint176`` type for %%v%%.\n */\n static uint176(v) { return n(v, 176); }\n /**\n * Return a new ``uint184`` type for %%v%%.\n */\n static uint184(v) { return n(v, 184); }\n /**\n * Return a new ``uint192`` type for %%v%%.\n */\n static uint192(v) { return n(v, 192); }\n /**\n * Return a new ``uint200`` type for %%v%%.\n */\n static uint200(v) { return n(v, 200); }\n /**\n * Return a new ``uint208`` type for %%v%%.\n */\n static uint208(v) { return n(v, 208); }\n /**\n * Return a new ``uint216`` type for %%v%%.\n */\n static uint216(v) { return n(v, 216); }\n /**\n * Return a new ``uint224`` type for %%v%%.\n */\n static uint224(v) { return n(v, 224); }\n /**\n * Return a new ``uint232`` type for %%v%%.\n */\n static uint232(v) { return n(v, 232); }\n /**\n * Return a new ``uint240`` type for %%v%%.\n */\n static uint240(v) { return n(v, 240); }\n /**\n * Return a new ``uint248`` type for %%v%%.\n */\n static uint248(v) { return n(v, 248); }\n /**\n * Return a new ``uint256`` type for %%v%%.\n */\n static uint256(v) { return n(v, 256); }\n /**\n * Return a new ``uint256`` type for %%v%%.\n */\n static uint(v) { return n(v, 256); }\n /**\n * Return a new ``int8`` type for %%v%%.\n */\n static int8(v) { return n(v, -8); }\n /**\n * Return a new ``int16`` type for %%v%%.\n */\n static int16(v) { return n(v, -16); }\n /**\n * Return a new ``int24`` type for %%v%%.\n */\n static int24(v) { return n(v, -24); }\n /**\n * Return a new ``int32`` type for %%v%%.\n */\n static int32(v) { return n(v, -32); }\n /**\n * Return a new ``int40`` type for %%v%%.\n */\n static int40(v) { return n(v, -40); }\n /**\n * Return a new ``int48`` type for %%v%%.\n */\n static int48(v) { return n(v, -48); }\n /**\n * Return a new ``int56`` type for %%v%%.\n */\n static int56(v) { return n(v, -56); }\n /**\n * Return a new ``int64`` type for %%v%%.\n */\n static int64(v) { return n(v, -64); }\n /**\n * Return a new ``int72`` type for %%v%%.\n */\n static int72(v) { return n(v, -72); }\n /**\n * Return a new ``int80`` type for %%v%%.\n */\n static int80(v) { return n(v, -80); }\n /**\n * Return a new ``int88`` type for %%v%%.\n */\n static int88(v) { return n(v, -88); }\n /**\n * Return a new ``int96`` type for %%v%%.\n */\n static int96(v) { return n(v, -96); }\n /**\n * Return a new ``int104`` type for %%v%%.\n */\n static int104(v) { return n(v, -104); }\n /**\n * Return a new ``int112`` type for %%v%%.\n */\n static int112(v) { return n(v, -112); }\n /**\n * Return a new ``int120`` type for %%v%%.\n */\n static int120(v) { return n(v, -120); }\n /**\n * Return a new ``int128`` type for %%v%%.\n */\n static int128(v) { return n(v, -128); }\n /**\n * Return a new ``int136`` type for %%v%%.\n */\n static int136(v) { return n(v, -136); }\n /**\n * Return a new ``int144`` type for %%v%%.\n */\n static int144(v) { return n(v, -144); }\n /**\n * Return a new ``int52`` type for %%v%%.\n */\n static int152(v) { return n(v, -152); }\n /**\n * Return a new ``int160`` type for %%v%%.\n */\n static int160(v) { return n(v, -160); }\n /**\n * Return a new ``int168`` type for %%v%%.\n */\n static int168(v) { return n(v, -168); }\n /**\n * Return a new ``int176`` type for %%v%%.\n */\n static int176(v) { return n(v, -176); }\n /**\n * Return a new ``int184`` type for %%v%%.\n */\n static int184(v) { return n(v, -184); }\n /**\n * Return a new ``int92`` type for %%v%%.\n */\n static int192(v) { return n(v, -192); }\n /**\n * Return a new ``int200`` type for %%v%%.\n */\n static int200(v) { return n(v, -200); }\n /**\n * Return a new ``int208`` type for %%v%%.\n */\n static int208(v) { return n(v, -208); }\n /**\n * Return a new ``int216`` type for %%v%%.\n */\n static int216(v) { return n(v, -216); }\n /**\n * Return a new ``int224`` type for %%v%%.\n */\n static int224(v) { return n(v, -224); }\n /**\n * Return a new ``int232`` type for %%v%%.\n */\n static int232(v) { return n(v, -232); }\n /**\n * Return a new ``int240`` type for %%v%%.\n */\n static int240(v) { return n(v, -240); }\n /**\n * Return a new ``int248`` type for %%v%%.\n */\n static int248(v) { return n(v, -248); }\n /**\n * Return a new ``int256`` type for %%v%%.\n */\n static int256(v) { return n(v, -256); }\n /**\n * Return a new ``int256`` type for %%v%%.\n */\n static int(v) { return n(v, -256); }\n /**\n * Return a new ``bytes1`` type for %%v%%.\n */\n static bytes1(v) { return b(v, 1); }\n /**\n * Return a new ``bytes2`` type for %%v%%.\n */\n static bytes2(v) { return b(v, 2); }\n /**\n * Return a new ``bytes3`` type for %%v%%.\n */\n static bytes3(v) { return b(v, 3); }\n /**\n * Return a new ``bytes4`` type for %%v%%.\n */\n static bytes4(v) { return b(v, 4); }\n /**\n * Return a new ``bytes5`` type for %%v%%.\n */\n static bytes5(v) { return b(v, 5); }\n /**\n * Return a new ``bytes6`` type for %%v%%.\n */\n static bytes6(v) { return b(v, 6); }\n /**\n * Return a new ``bytes7`` type for %%v%%.\n */\n static bytes7(v) { return b(v, 7); }\n /**\n * Return a new ``bytes8`` type for %%v%%.\n */\n static bytes8(v) { return b(v, 8); }\n /**\n * Return a new ``bytes9`` type for %%v%%.\n */\n static bytes9(v) { return b(v, 9); }\n /**\n * Return a new ``bytes10`` type for %%v%%.\n */\n static bytes10(v) { return b(v, 10); }\n /**\n * Return a new ``bytes11`` type for %%v%%.\n */\n static bytes11(v) { return b(v, 11); }\n /**\n * Return a new ``bytes12`` type for %%v%%.\n */\n static bytes12(v) { return b(v, 12); }\n /**\n * Return a new ``bytes13`` type for %%v%%.\n */\n static bytes13(v) { return b(v, 13); }\n /**\n * Return a new ``bytes14`` type for %%v%%.\n */\n static bytes14(v) { return b(v, 14); }\n /**\n * Return a new ``bytes15`` type for %%v%%.\n */\n static bytes15(v) { return b(v, 15); }\n /**\n * Return a new ``bytes16`` type for %%v%%.\n */\n static bytes16(v) { return b(v, 16); }\n /**\n * Return a new ``bytes17`` type for %%v%%.\n */\n static bytes17(v) { return b(v, 17); }\n /**\n * Return a new ``bytes18`` type for %%v%%.\n */\n static bytes18(v) { return b(v, 18); }\n /**\n * Return a new ``bytes19`` type for %%v%%.\n */\n static bytes19(v) { return b(v, 19); }\n /**\n * Return a new ``bytes20`` type for %%v%%.\n */\n static bytes20(v) { return b(v, 20); }\n /**\n * Return a new ``bytes21`` type for %%v%%.\n */\n static bytes21(v) { return b(v, 21); }\n /**\n * Return a new ``bytes22`` type for %%v%%.\n */\n static bytes22(v) { return b(v, 22); }\n /**\n * Return a new ``bytes23`` type for %%v%%.\n */\n static bytes23(v) { return b(v, 23); }\n /**\n * Return a new ``bytes24`` type for %%v%%.\n */\n static bytes24(v) { return b(v, 24); }\n /**\n * Return a new ``bytes25`` type for %%v%%.\n */\n static bytes25(v) { return b(v, 25); }\n /**\n * Return a new ``bytes26`` type for %%v%%.\n */\n static bytes26(v) { return b(v, 26); }\n /**\n * Return a new ``bytes27`` type for %%v%%.\n */\n static bytes27(v) { return b(v, 27); }\n /**\n * Return a new ``bytes28`` type for %%v%%.\n */\n static bytes28(v) { return b(v, 28); }\n /**\n * Return a new ``bytes29`` type for %%v%%.\n */\n static bytes29(v) { return b(v, 29); }\n /**\n * Return a new ``bytes30`` type for %%v%%.\n */\n static bytes30(v) { return b(v, 30); }\n /**\n * Return a new ``bytes31`` type for %%v%%.\n */\n static bytes31(v) { return b(v, 31); }\n /**\n * Return a new ``bytes32`` type for %%v%%.\n */\n static bytes32(v) { return b(v, 32); }\n /**\n * Return a new ``address`` type for %%v%%.\n */\n static address(v) { return new Typed(_gaurd, \"address\", v); }\n /**\n * Return a new ``bool`` type for %%v%%.\n */\n static bool(v) { return new Typed(_gaurd, \"bool\", !!v); }\n /**\n * Return a new ``bytes`` type for %%v%%.\n */\n static bytes(v) { return new Typed(_gaurd, \"bytes\", v); }\n /**\n * Return a new ``string`` type for %%v%%.\n */\n static string(v) { return new Typed(_gaurd, \"string\", v); }\n /**\n * Return a new ``array`` type for %%v%%, allowing %%dynamic%% length.\n */\n static array(v, dynamic) {\n throw new Error(\"not implemented yet\");\n return new Typed(_gaurd, \"array\", v, dynamic);\n }\n /**\n * Return a new ``tuple`` type for %%v%%, with the optional %%name%%.\n */\n static tuple(v, name) {\n throw new Error(\"not implemented yet\");\n return new Typed(_gaurd, \"tuple\", v, name);\n }\n /**\n * Return a new ``uint8`` type for %%v%%.\n */\n static overrides(v) {\n return new Typed(_gaurd, \"overrides\", Object.assign({}, v));\n }\n /**\n * Returns true only if %%value%% is a [[Typed]] instance.\n */\n static isTyped(value) {\n return (value\n && typeof (value) === \"object\"\n && \"_typedSymbol\" in value\n && value._typedSymbol === _typedSymbol);\n }\n /**\n * If the value is a [[Typed]] instance, validates the underlying value\n * and returns it, otherwise returns value directly.\n *\n * This is useful for functions that with to accept either a [[Typed]]\n * object or values.\n */\n static dereference(value, type) {\n if (Typed.isTyped(value)) {\n if (value.type !== type) {\n throw new Error(`invalid type: expecetd ${type}, got ${value.type}`);\n }\n return value.value;\n }\n return value;\n }\n}\n//# sourceMappingURL=typed.js.map","import { getAddress } from \"../../address/index.js\";\nimport { toBeHex } from \"../../utils/maths.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class AddressCoder extends Coder {\n constructor(localName) {\n super(\"address\", \"address\", localName, false);\n }\n defaultValue() {\n return \"0x0000000000000000000000000000000000000000\";\n }\n encode(writer, _value) {\n let value = Typed.dereference(_value, \"string\");\n try {\n value = getAddress(value);\n }\n catch (error) {\n return this._throwError(error.message, _value);\n }\n return writer.writeValue(value);\n }\n decode(reader) {\n return getAddress(toBeHex(reader.readValue(), 20));\n }\n}\n//# sourceMappingURL=address.js.map","import { Coder } from \"./abstract-coder.js\";\n/**\n * Clones the functionality of an existing Coder, but without a localName\n *\n * @_ignore\n */\nexport class AnonymousCoder extends Coder {\n coder;\n constructor(coder) {\n super(coder.name, coder.type, \"_\", coder.dynamic);\n this.coder = coder;\n }\n defaultValue() {\n return this.coder.defaultValue();\n }\n encode(writer, value) {\n return this.coder.encode(writer, value);\n }\n decode(reader) {\n return this.coder.decode(reader);\n }\n}\n//# sourceMappingURL=anonymous.js.map","import { defineProperties, isError, assert, assertArgument, assertArgumentCount } from \"../../utils/index.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder, Result, WordSize, Writer } from \"./abstract-coder.js\";\nimport { AnonymousCoder } from \"./anonymous.js\";\n/**\n * @_ignore\n */\nexport function pack(writer, coders, values) {\n let arrayValues = [];\n if (Array.isArray(values)) {\n arrayValues = values;\n }\n else if (values && typeof (values) === \"object\") {\n let unique = {};\n arrayValues = coders.map((coder) => {\n const name = coder.localName;\n assert(name, \"cannot encode object for signature with missing names\", \"INVALID_ARGUMENT\", { argument: \"values\", info: { coder }, value: values });\n assert(!unique[name], \"cannot encode object for signature with duplicate names\", \"INVALID_ARGUMENT\", { argument: \"values\", info: { coder }, value: values });\n unique[name] = true;\n return values[name];\n });\n }\n else {\n assertArgument(false, \"invalid tuple value\", \"tuple\", values);\n }\n assertArgument(coders.length === arrayValues.length, \"types/value length mismatch\", \"tuple\", values);\n let staticWriter = new Writer();\n let dynamicWriter = new Writer();\n let updateFuncs = [];\n coders.forEach((coder, index) => {\n let value = arrayValues[index];\n if (coder.dynamic) {\n // Get current dynamic offset (for the future pointer)\n let dynamicOffset = dynamicWriter.length;\n // Encode the dynamic value into the dynamicWriter\n coder.encode(dynamicWriter, value);\n // Prepare to populate the correct offset once we are done\n let updateFunc = staticWriter.writeUpdatableValue();\n updateFuncs.push((baseOffset) => {\n updateFunc(baseOffset + dynamicOffset);\n });\n }\n else {\n coder.encode(staticWriter, value);\n }\n });\n // Backfill all the dynamic offsets, now that we know the static length\n updateFuncs.forEach((func) => { func(staticWriter.length); });\n let length = writer.appendWriter(staticWriter);\n length += writer.appendWriter(dynamicWriter);\n return length;\n}\n/**\n * @_ignore\n */\nexport function unpack(reader, coders) {\n let values = [];\n let keys = [];\n // A reader anchored to this base\n let baseReader = reader.subReader(0);\n coders.forEach((coder) => {\n let value = null;\n if (coder.dynamic) {\n let offset = reader.readIndex();\n let offsetReader = baseReader.subReader(offset);\n try {\n value = coder.decode(offsetReader);\n }\n catch (error) {\n // Cannot recover from this\n if (isError(error, \"BUFFER_OVERRUN\")) {\n throw error;\n }\n value = error;\n value.baseType = coder.name;\n value.name = coder.localName;\n value.type = coder.type;\n }\n }\n else {\n try {\n value = coder.decode(reader);\n }\n catch (error) {\n // Cannot recover from this\n if (isError(error, \"BUFFER_OVERRUN\")) {\n throw error;\n }\n value = error;\n value.baseType = coder.name;\n value.name = coder.localName;\n value.type = coder.type;\n }\n }\n if (value == undefined) {\n throw new Error(\"investigate\");\n }\n values.push(value);\n keys.push(coder.localName || null);\n });\n return Result.fromItems(values, keys);\n}\n/**\n * @_ignore\n */\nexport class ArrayCoder extends Coder {\n coder;\n length;\n constructor(coder, length, localName) {\n const type = (coder.type + \"[\" + (length >= 0 ? length : \"\") + \"]\");\n const dynamic = (length === -1 || coder.dynamic);\n super(\"array\", type, localName, dynamic);\n defineProperties(this, { coder, length });\n }\n defaultValue() {\n // Verifies the child coder is valid (even if the array is dynamic or 0-length)\n const defaultChild = this.coder.defaultValue();\n const result = [];\n for (let i = 0; i < this.length; i++) {\n result.push(defaultChild);\n }\n return result;\n }\n encode(writer, _value) {\n const value = Typed.dereference(_value, \"array\");\n if (!Array.isArray(value)) {\n this._throwError(\"expected array value\", value);\n }\n let count = this.length;\n if (count === -1) {\n count = value.length;\n writer.writeValue(value.length);\n }\n assertArgumentCount(value.length, count, \"coder array\" + (this.localName ? (\" \" + this.localName) : \"\"));\n let coders = [];\n for (let i = 0; i < value.length; i++) {\n coders.push(this.coder);\n }\n return pack(writer, coders, value);\n }\n decode(reader) {\n let count = this.length;\n if (count === -1) {\n count = reader.readIndex();\n // Check that there is *roughly* enough data to ensure\n // stray random data is not being read as a length. Each\n // slot requires at least 32 bytes for their value (or 32\n // bytes as a link to the data). This could use a much\n // tighter bound, but we are erroring on the side of safety.\n assert(count * WordSize <= reader.dataLength, \"insufficient data length\", \"BUFFER_OVERRUN\", { buffer: reader.bytes, offset: count * WordSize, length: reader.dataLength });\n }\n let coders = [];\n for (let i = 0; i < count; i++) {\n coders.push(new AnonymousCoder(this.coder));\n }\n return unpack(reader, coders);\n }\n}\n//# sourceMappingURL=array.js.map","import { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class BooleanCoder extends Coder {\n constructor(localName) {\n super(\"bool\", \"bool\", localName, false);\n }\n defaultValue() {\n return false;\n }\n encode(writer, _value) {\n const value = Typed.dereference(_value, \"bool\");\n return writer.writeValue(value ? 1 : 0);\n }\n decode(reader) {\n return !!reader.readValue();\n }\n}\n//# sourceMappingURL=boolean.js.map","import { getBytesCopy, hexlify } from \"../../utils/index.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class DynamicBytesCoder extends Coder {\n constructor(type, localName) {\n super(type, type, localName, true);\n }\n defaultValue() {\n return \"0x\";\n }\n encode(writer, value) {\n value = getBytesCopy(value);\n let length = writer.writeValue(value.length);\n length += writer.writeBytes(value);\n return length;\n }\n decode(reader) {\n return reader.readBytes(reader.readIndex(), true);\n }\n}\n/**\n * @_ignore\n */\nexport class BytesCoder extends DynamicBytesCoder {\n constructor(localName) {\n super(\"bytes\", localName);\n }\n decode(reader) {\n return hexlify(super.decode(reader));\n }\n}\n//# sourceMappingURL=bytes.js.map","import { defineProperties, getBytesCopy, hexlify } from \"../../utils/index.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class FixedBytesCoder extends Coder {\n size;\n constructor(size, localName) {\n let name = \"bytes\" + String(size);\n super(name, name, localName, false);\n defineProperties(this, { size }, { size: \"number\" });\n }\n defaultValue() {\n return (\"0x0000000000000000000000000000000000000000000000000000000000000000\").substring(0, 2 + this.size * 2);\n }\n encode(writer, _value) {\n let data = getBytesCopy(Typed.dereference(_value, this.type));\n if (data.length !== this.size) {\n this._throwError(\"incorrect data length\", _value);\n }\n return writer.writeBytes(data);\n }\n decode(reader) {\n return hexlify(reader.readBytes(this.size));\n }\n}\n//# sourceMappingURL=fixed-bytes.js.map","import { Coder } from \"./abstract-coder.js\";\nconst Empty = new Uint8Array([]);\n/**\n * @_ignore\n */\nexport class NullCoder extends Coder {\n constructor(localName) {\n super(\"null\", \"\", localName, false);\n }\n defaultValue() {\n return null;\n }\n encode(writer, value) {\n if (value != null) {\n this._throwError(\"not null\", value);\n }\n return writer.writeBytes(Empty);\n }\n decode(reader) {\n reader.readBytes(0);\n return null;\n }\n}\n//# sourceMappingURL=null.js.map","import { defineProperties, fromTwos, getBigInt, mask, toTwos } from \"../../utils/index.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder, WordSize } from \"./abstract-coder.js\";\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_MAX_UINT256 = BigInt(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\n/**\n * @_ignore\n */\nexport class NumberCoder extends Coder {\n size;\n signed;\n constructor(size, signed, localName) {\n const name = ((signed ? \"int\" : \"uint\") + (size * 8));\n super(name, name, localName, false);\n defineProperties(this, { size, signed }, { size: \"number\", signed: \"boolean\" });\n }\n defaultValue() {\n return 0;\n }\n encode(writer, _value) {\n let value = getBigInt(Typed.dereference(_value, this.type));\n // Check bounds are safe for encoding\n let maxUintValue = mask(BN_MAX_UINT256, WordSize * 8);\n if (this.signed) {\n let bounds = mask(maxUintValue, (this.size * 8) - 1);\n if (value > bounds || value < -(bounds + BN_1)) {\n this._throwError(\"value out-of-bounds\", _value);\n }\n value = toTwos(value, 8 * WordSize);\n }\n else if (value < BN_0 || value > mask(maxUintValue, this.size * 8)) {\n this._throwError(\"value out-of-bounds\", _value);\n }\n return writer.writeValue(value);\n }\n decode(reader) {\n let value = mask(reader.readValue(), this.size * 8);\n if (this.signed) {\n value = fromTwos(value, this.size * 8);\n }\n return value;\n }\n}\n//# sourceMappingURL=number.js.map","import { toUtf8Bytes, toUtf8String } from \"../../utils/utf8.js\";\nimport { Typed } from \"../typed.js\";\nimport { DynamicBytesCoder } from \"./bytes.js\";\n/**\n * @_ignore\n */\nexport class StringCoder extends DynamicBytesCoder {\n constructor(localName) {\n super(\"string\", localName);\n }\n defaultValue() {\n return \"\";\n }\n encode(writer, _value) {\n return super.encode(writer, toUtf8Bytes(Typed.dereference(_value, \"string\")));\n }\n decode(reader) {\n return toUtf8String(super.decode(reader));\n }\n}\n//# sourceMappingURL=string.js.map","import { defineProperties } from \"../../utils/properties.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\nimport { pack, unpack } from \"./array.js\";\n/**\n * @_ignore\n */\nexport class TupleCoder extends Coder {\n coders;\n constructor(coders, localName) {\n let dynamic = false;\n const types = [];\n coders.forEach((coder) => {\n if (coder.dynamic) {\n dynamic = true;\n }\n types.push(coder.type);\n });\n const type = (\"tuple(\" + types.join(\",\") + \")\");\n super(\"tuple\", type, localName, dynamic);\n defineProperties(this, { coders: Object.freeze(coders.slice()) });\n }\n defaultValue() {\n const values = [];\n this.coders.forEach((coder) => {\n values.push(coder.defaultValue());\n });\n // We only output named properties for uniquely named coders\n const uniqueNames = this.coders.reduce((accum, coder) => {\n const name = coder.localName;\n if (name) {\n if (!accum[name]) {\n accum[name] = 0;\n }\n accum[name]++;\n }\n return accum;\n }, {});\n // Add named values\n this.coders.forEach((coder, index) => {\n let name = coder.localName;\n if (!name || uniqueNames[name] !== 1) {\n return;\n }\n if (name === \"length\") {\n name = \"_length\";\n }\n if (values[name] != null) {\n return;\n }\n values[name] = values[index];\n });\n return Object.freeze(values);\n }\n encode(writer, _value) {\n const value = Typed.dereference(_value, \"tuple\");\n return pack(writer, this.coders, value);\n }\n decode(reader) {\n return unpack(reader, this.coders);\n }\n}\n//# sourceMappingURL=tuple.js.map","import { getAddress } from \"../address/index.js\";\nimport { assertArgument, isHexString } from \"../utils/index.js\";\nfunction accessSetify(addr, storageKeys) {\n return {\n address: getAddress(addr),\n storageKeys: storageKeys.map((storageKey, index) => {\n assertArgument(isHexString(storageKey, 32), \"invalid slot\", `storageKeys[${index}]`, storageKey);\n return storageKey.toLowerCase();\n })\n };\n}\n/**\n * Returns a [[AccessList]] from any ethers-supported access-list structure.\n */\nexport function accessListify(value) {\n if (Array.isArray(value)) {\n return value.map((set, index) => {\n if (Array.isArray(set)) {\n assertArgument(set.length === 2, \"invalid slot set\", `value[${index}]`, set);\n return accessSetify(set[0], set[1]);\n }\n assertArgument(set != null && typeof (set) === \"object\", \"invalid address-slot set\", \"value\", value);\n return accessSetify(set.address, set.storageKeys);\n });\n }\n assertArgument(value != null && typeof (value) === \"object\", \"invalid access list\", \"value\", value);\n const result = Object.keys(value).map((addr) => {\n const storageKeys = value[addr].reduce((accum, storageKey) => {\n accum[storageKey] = true;\n return accum;\n }, {});\n return accessSetify(addr, Object.keys(storageKeys).sort());\n });\n result.sort((a, b) => (a.address.localeCompare(b.address)));\n return result;\n}\n//# sourceMappingURL=accesslist.js.map","import { getAddress } from \"../address/index.js\";\nimport { Signature } from \"../crypto/index.js\";\nimport { getBigInt } from \"../utils/index.js\";\nexport function authorizationify(auth) {\n return {\n address: getAddress(auth.address),\n nonce: getBigInt((auth.nonce != null) ? auth.nonce : 0),\n chainId: getBigInt((auth.chainId != null) ? auth.chainId : 0),\n signature: Signature.from(auth.signature)\n };\n}\n//# sourceMappingURL=authorization.js.map","import { getAddress } from \"../address/index.js\";\nimport { keccak256, SigningKey } from \"../crypto/index.js\";\n/**\n * Returns the address for the %%key%%.\n *\n * The key may be any standard form of public key or a private key.\n */\nexport function computeAddress(key) {\n let pubkey;\n if (typeof (key) === \"string\") {\n pubkey = SigningKey.computePublicKey(key, false);\n }\n else {\n pubkey = key.publicKey;\n }\n return getAddress(keccak256(\"0x\" + pubkey.substring(4)).substring(26));\n}\n/**\n * Returns the recovered address for the private key that was\n * used to sign %%digest%% that resulted in %%signature%%.\n */\nexport function recoverAddress(digest, signature) {\n return computeAddress(SigningKey.recoverPublicKey(digest, signature));\n}\n//# sourceMappingURL=address.js.map","import { getAddress } from \"../address/index.js\";\nimport { ZeroAddress } from \"../constants/addresses.js\";\nimport { keccak256, sha256, Signature, SigningKey } from \"../crypto/index.js\";\nimport { concat, decodeRlp, encodeRlp, getBytes, getBigInt, getNumber, hexlify, assert, assertArgument, isBytesLike, isHexString, toBeArray, zeroPadValue } from \"../utils/index.js\";\nimport { accessListify } from \"./accesslist.js\";\nimport { authorizationify } from \"./authorization.js\";\nimport { recoverAddress } from \"./address.js\";\nconst BN_0 = BigInt(0);\nconst BN_2 = BigInt(2);\nconst BN_27 = BigInt(27);\nconst BN_28 = BigInt(28);\nconst BN_35 = BigInt(35);\nconst BN_MAX_UINT = BigInt(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\nconst inspect = Symbol.for(\"nodejs.util.inspect.custom\");\nconst BLOB_SIZE = 4096 * 32;\nconst CELL_COUNT = 128;\n/**\n * Returns a BLOb proof as its cells for [[link-eip-7594]] BLOb.\n *\n * The default %%cellCount%% is 128.\n */\nexport function splitBlobCells(_proof, cellCount) {\n if (cellCount == null) {\n cellCount = CELL_COUNT;\n }\n const cellProofs = [];\n const proof = getBytes(_proof);\n const cellSize = proof.length / cellCount;\n for (let i = 0; i < proof.length; i += cellSize) {\n cellProofs.push(hexlify(proof.subarray(i, i + cellSize)));\n }\n return cellProofs;\n}\nfunction getKzgLibrary(kzg) {\n const blobToKzgCommitment = (blob) => {\n if (\"computeBlobProof\" in kzg) {\n // micro-ecc-signer; check for computeBlobProof since this API\n // expects a string while the kzg-wasm below expects a Unit8Array\n if (\"blobToKzgCommitment\" in kzg && typeof (kzg.blobToKzgCommitment) === \"function\") {\n return getBytes(kzg.blobToKzgCommitment(hexlify(blob)));\n }\n }\n else if (\"blobToKzgCommitment\" in kzg && typeof (kzg.blobToKzgCommitment) === \"function\") {\n // kzg-wasm <0.5.0; blobToKzgCommitment(Uint8Array) => Uint8Array\n return getBytes(kzg.blobToKzgCommitment(blob));\n }\n // kzg-wasm >= 0.5.0; blobToKZGCommitment(string) => string\n if (\"blobToKZGCommitment\" in kzg && typeof (kzg.blobToKZGCommitment) === \"function\") {\n return getBytes(kzg.blobToKZGCommitment(hexlify(blob)));\n }\n assertArgument(false, \"unsupported KZG library\", \"kzg\", kzg);\n };\n const computeBlobKzgProof = (blob, commitment) => {\n // micro-ecc-signer\n if (\"computeBlobProof\" in kzg && typeof (kzg.computeBlobProof) === \"function\") {\n return getBytes(kzg.computeBlobProof(hexlify(blob), hexlify(commitment)));\n }\n // kzg-wasm <0.5.0; computeBlobKzgProof(Uint8Array, Uint8Array) => Uint8Array\n if (\"computeBlobKzgProof\" in kzg && typeof (kzg.computeBlobKzgProof) === \"function\") {\n return kzg.computeBlobKzgProof(blob, commitment);\n }\n // kzg-wasm >= 0.5.0; computeBlobKZGProof(string, string) => string\n if (\"computeBlobKZGProof\" in kzg && typeof (kzg.computeBlobKZGProof) === \"function\") {\n return getBytes(kzg.computeBlobKZGProof(hexlify(blob), hexlify(commitment)));\n }\n assertArgument(false, \"unsupported KZG library\", \"kzg\", kzg);\n };\n return { blobToKzgCommitment, computeBlobKzgProof };\n}\nfunction getVersionedHash(version, hash) {\n let versioned = version.toString(16);\n while (versioned.length < 2) {\n versioned = \"0\" + versioned;\n }\n versioned += sha256(hash).substring(4);\n return \"0x\" + versioned;\n}\nfunction handleAddress(value) {\n if (value === \"0x\") {\n return null;\n }\n return getAddress(value);\n}\nfunction handleAccessList(value, param) {\n try {\n return accessListify(value);\n }\n catch (error) {\n assertArgument(false, error.message, param, value);\n }\n}\nfunction handleAuthorizationList(value, param) {\n try {\n if (!Array.isArray(value)) {\n throw new Error(\"authorizationList: invalid array\");\n }\n const result = [];\n for (let i = 0; i < value.length; i++) {\n const auth = value[i];\n if (!Array.isArray(auth)) {\n throw new Error(`authorization[${i}]: invalid array`);\n }\n if (auth.length !== 6) {\n throw new Error(`authorization[${i}]: wrong length`);\n }\n if (!auth[1]) {\n throw new Error(`authorization[${i}]: null address`);\n }\n result.push({\n address: handleAddress(auth[1]),\n nonce: handleUint(auth[2], \"nonce\"),\n chainId: handleUint(auth[0], \"chainId\"),\n signature: Signature.from({\n yParity: handleNumber(auth[3], \"yParity\"),\n r: zeroPadValue(auth[4], 32),\n s: zeroPadValue(auth[5], 32)\n })\n });\n }\n return result;\n }\n catch (error) {\n assertArgument(false, error.message, param, value);\n }\n}\nfunction handleNumber(_value, param) {\n if (_value === \"0x\") {\n return 0;\n }\n return getNumber(_value, param);\n}\nfunction handleUint(_value, param) {\n if (_value === \"0x\") {\n return BN_0;\n }\n const value = getBigInt(_value, param);\n assertArgument(value <= BN_MAX_UINT, \"value exceeds uint size\", param, value);\n return value;\n}\nfunction formatNumber(_value, name) {\n const value = getBigInt(_value, \"value\");\n const result = toBeArray(value);\n assertArgument(result.length <= 32, `value too large`, `tx.${name}`, value);\n return result;\n}\nfunction formatAccessList(value) {\n return accessListify(value).map((set) => [set.address, set.storageKeys]);\n}\nfunction formatAuthorizationList(value) {\n return value.map((a) => {\n return [\n formatNumber(a.chainId, \"chainId\"),\n a.address,\n formatNumber(a.nonce, \"nonce\"),\n formatNumber(a.signature.yParity, \"yParity\"),\n toBeArray(a.signature.r),\n toBeArray(a.signature._s)\n ];\n });\n}\nfunction formatHashes(value, param) {\n assertArgument(Array.isArray(value), `invalid ${param}`, \"value\", value);\n for (let i = 0; i < value.length; i++) {\n assertArgument(isHexString(value[i], 32), \"invalid ${ param } hash\", `value[${i}]`, value[i]);\n }\n return value;\n}\nfunction _parseLegacy(data) {\n const fields = decodeRlp(data);\n assertArgument(Array.isArray(fields) && (fields.length === 9 || fields.length === 6), \"invalid field count for legacy transaction\", \"data\", data);\n const tx = {\n type: 0,\n nonce: handleNumber(fields[0], \"nonce\"),\n gasPrice: handleUint(fields[1], \"gasPrice\"),\n gasLimit: handleUint(fields[2], \"gasLimit\"),\n to: handleAddress(fields[3]),\n value: handleUint(fields[4], \"value\"),\n data: hexlify(fields[5]),\n chainId: BN_0\n };\n // Legacy unsigned transaction\n if (fields.length === 6) {\n return tx;\n }\n const v = handleUint(fields[6], \"v\");\n const r = handleUint(fields[7], \"r\");\n const s = handleUint(fields[8], \"s\");\n if (r === BN_0 && s === BN_0) {\n // EIP-155 unsigned transaction\n tx.chainId = v;\n }\n else {\n // Compute the EIP-155 chain ID (or 0 for legacy)\n let chainId = (v - BN_35) / BN_2;\n if (chainId < BN_0) {\n chainId = BN_0;\n }\n tx.chainId = chainId;\n // Signed Legacy Transaction\n assertArgument(chainId !== BN_0 || (v === BN_27 || v === BN_28), \"non-canonical legacy v\", \"v\", fields[6]);\n tx.signature = Signature.from({\n r: zeroPadValue(fields[7], 32),\n s: zeroPadValue(fields[8], 32),\n v\n });\n //tx.hash = keccak256(data);\n }\n return tx;\n}\nfunction _serializeLegacy(tx, sig) {\n const fields = [\n formatNumber(tx.nonce, \"nonce\"),\n formatNumber(tx.gasPrice || 0, \"gasPrice\"),\n formatNumber(tx.gasLimit, \"gasLimit\"),\n (tx.to || \"0x\"),\n formatNumber(tx.value, \"value\"),\n tx.data,\n ];\n let chainId = BN_0;\n if (tx.chainId != BN_0) {\n // A chainId was provided; if non-zero we'll use EIP-155\n chainId = getBigInt(tx.chainId, \"tx.chainId\");\n // We have a chainId in the tx and an EIP-155 v in the signature,\n // make sure they agree with each other\n assertArgument(!sig || sig.networkV == null || sig.legacyChainId === chainId, \"tx.chainId/sig.v mismatch\", \"sig\", sig);\n }\n else if (tx.signature) {\n // No explicit chainId, but EIP-155 have a derived implicit chainId\n const legacy = tx.signature.legacyChainId;\n if (legacy != null) {\n chainId = legacy;\n }\n }\n // Requesting an unsigned transaction\n if (!sig) {\n // We have an EIP-155 transaction (chainId was specified and non-zero)\n if (chainId !== BN_0) {\n fields.push(toBeArray(chainId));\n fields.push(\"0x\");\n fields.push(\"0x\");\n }\n return encodeRlp(fields);\n }\n // @TODO: We should probably check that tx.signature, chainId, and sig\n // match but that logic could break existing code, so schedule\n // this for the next major bump.\n // Compute the EIP-155 v\n let v = BigInt(27 + sig.yParity);\n if (chainId !== BN_0) {\n v = Signature.getChainIdV(chainId, sig.v);\n }\n else if (BigInt(sig.v) !== v) {\n assertArgument(false, \"tx.chainId/sig.v mismatch\", \"sig\", sig);\n }\n // Add the signature\n fields.push(toBeArray(v));\n fields.push(toBeArray(sig.r));\n fields.push(toBeArray(sig._s));\n return encodeRlp(fields);\n}\nfunction _parseEipSignature(tx, fields) {\n let yParity;\n try {\n yParity = handleNumber(fields[0], \"yParity\");\n if (yParity !== 0 && yParity !== 1) {\n throw new Error(\"bad yParity\");\n }\n }\n catch (error) {\n assertArgument(false, \"invalid yParity\", \"yParity\", fields[0]);\n }\n const r = zeroPadValue(fields[1], 32);\n const s = zeroPadValue(fields[2], 32);\n const signature = Signature.from({ r, s, yParity });\n tx.signature = signature;\n}\nfunction _parseEip1559(data) {\n const fields = decodeRlp(getBytes(data).slice(1));\n assertArgument(Array.isArray(fields) && (fields.length === 9 || fields.length === 12), \"invalid field count for transaction type: 2\", \"data\", hexlify(data));\n const tx = {\n type: 2,\n chainId: handleUint(fields[0], \"chainId\"),\n nonce: handleNumber(fields[1], \"nonce\"),\n maxPriorityFeePerGas: handleUint(fields[2], \"maxPriorityFeePerGas\"),\n maxFeePerGas: handleUint(fields[3], \"maxFeePerGas\"),\n gasPrice: null,\n gasLimit: handleUint(fields[4], \"gasLimit\"),\n to: handleAddress(fields[5]),\n value: handleUint(fields[6], \"value\"),\n data: hexlify(fields[7]),\n accessList: handleAccessList(fields[8], \"accessList\"),\n };\n // Unsigned EIP-1559 Transaction\n if (fields.length === 9) {\n return tx;\n }\n //tx.hash = keccak256(data);\n _parseEipSignature(tx, fields.slice(9));\n return tx;\n}\nfunction _serializeEip1559(tx, sig) {\n const fields = [\n formatNumber(tx.chainId, \"chainId\"),\n formatNumber(tx.nonce, \"nonce\"),\n formatNumber(tx.maxPriorityFeePerGas || 0, \"maxPriorityFeePerGas\"),\n formatNumber(tx.maxFeePerGas || 0, \"maxFeePerGas\"),\n formatNumber(tx.gasLimit, \"gasLimit\"),\n (tx.to || \"0x\"),\n formatNumber(tx.value, \"value\"),\n tx.data,\n formatAccessList(tx.accessList || [])\n ];\n if (sig) {\n fields.push(formatNumber(sig.yParity, \"yParity\"));\n fields.push(toBeArray(sig.r));\n fields.push(toBeArray(sig.s));\n }\n return concat([\"0x02\", encodeRlp(fields)]);\n}\nfunction _parseEip2930(data) {\n const fields = decodeRlp(getBytes(data).slice(1));\n assertArgument(Array.isArray(fields) && (fields.length === 8 || fields.length === 11), \"invalid field count for transaction type: 1\", \"data\", hexlify(data));\n const tx = {\n type: 1,\n chainId: handleUint(fields[0], \"chainId\"),\n nonce: handleNumber(fields[1], \"nonce\"),\n gasPrice: handleUint(fields[2], \"gasPrice\"),\n gasLimit: handleUint(fields[3], \"gasLimit\"),\n to: handleAddress(fields[4]),\n value: handleUint(fields[5], \"value\"),\n data: hexlify(fields[6]),\n accessList: handleAccessList(fields[7], \"accessList\")\n };\n // Unsigned EIP-2930 Transaction\n if (fields.length === 8) {\n return tx;\n }\n //tx.hash = keccak256(data);\n _parseEipSignature(tx, fields.slice(8));\n return tx;\n}\nfunction _serializeEip2930(tx, sig) {\n const fields = [\n formatNumber(tx.chainId, \"chainId\"),\n formatNumber(tx.nonce, \"nonce\"),\n formatNumber(tx.gasPrice || 0, \"gasPrice\"),\n formatNumber(tx.gasLimit, \"gasLimit\"),\n (tx.to || \"0x\"),\n formatNumber(tx.value, \"value\"),\n tx.data,\n formatAccessList(tx.accessList || [])\n ];\n if (sig) {\n fields.push(formatNumber(sig.yParity, \"recoveryParam\"));\n fields.push(toBeArray(sig.r));\n fields.push(toBeArray(sig.s));\n }\n return concat([\"0x01\", encodeRlp(fields)]);\n}\nfunction _parseEip4844(data) {\n let fields = decodeRlp(getBytes(data).slice(1));\n let typeName = \"3\";\n let blobWrapperVersion = null;\n let blobs = null;\n // Parse the network format\n if (fields.length === 4 && Array.isArray(fields[0])) {\n // EIP-4844 format with sidecar\n typeName = \"3 (network format)\";\n const fBlobs = fields[1], fCommits = fields[2], fProofs = fields[3];\n assertArgument(Array.isArray(fBlobs), \"invalid network format: blobs not an array\", \"fields[1]\", fBlobs);\n assertArgument(Array.isArray(fCommits), \"invalid network format: commitments not an array\", \"fields[2]\", fCommits);\n assertArgument(Array.isArray(fProofs), \"invalid network format: proofs not an array\", \"fields[3]\", fProofs);\n assertArgument(fBlobs.length === fCommits.length, \"invalid network format: blobs/commitments length mismatch\", \"fields\", fields);\n assertArgument(fBlobs.length === fProofs.length, \"invalid network format: blobs/proofs length mismatch\", \"fields\", fields);\n blobs = [];\n for (let i = 0; i < fields[1].length; i++) {\n blobs.push({\n data: fBlobs[i],\n commitment: fCommits[i],\n proof: fProofs[i],\n });\n }\n fields = fields[0];\n }\n else if (fields.length === 5 && Array.isArray(fields[0])) {\n // EIP-7594 format with sidecar\n typeName = \"3 (EIP-7594 network format)\";\n blobWrapperVersion = getNumber(fields[1]);\n const fBlobs = fields[2], fCommits = fields[3], fProofs = fields[4];\n assertArgument(blobWrapperVersion === 1, `unsupported EIP-7594 network format version: ${blobWrapperVersion}`, \"fields[1]\", blobWrapperVersion);\n assertArgument(Array.isArray(fBlobs), \"invalid EIP-7594 network format: blobs not an array\", \"fields[2]\", fBlobs);\n assertArgument(Array.isArray(fCommits), \"invalid EIP-7594 network format: commitments not an array\", \"fields[3]\", fCommits);\n assertArgument(Array.isArray(fProofs), \"invalid EIP-7594 network format: proofs not an array\", \"fields[4]\", fProofs);\n assertArgument(fBlobs.length === fCommits.length, \"invalid network format: blobs/commitments length mismatch\", \"fields\", fields);\n assertArgument(fBlobs.length * CELL_COUNT === fProofs.length, \"invalid network format: blobs/proofs length mismatch\", \"fields\", fields);\n blobs = [];\n for (let i = 0; i < fBlobs.length; i++) {\n const proof = [];\n for (let j = 0; j < CELL_COUNT; j++) {\n proof.push(fProofs[(i * CELL_COUNT) + j]);\n }\n blobs.push({\n data: fBlobs[i],\n commitment: fCommits[i],\n proof: concat(proof)\n });\n }\n fields = fields[0];\n }\n assertArgument(Array.isArray(fields) && (fields.length === 11 || fields.length === 14), `invalid field count for transaction type: ${typeName}`, \"data\", hexlify(data));\n const tx = {\n type: 3,\n chainId: handleUint(fields[0], \"chainId\"),\n nonce: handleNumber(fields[1], \"nonce\"),\n maxPriorityFeePerGas: handleUint(fields[2], \"maxPriorityFeePerGas\"),\n maxFeePerGas: handleUint(fields[3], \"maxFeePerGas\"),\n gasPrice: null,\n gasLimit: handleUint(fields[4], \"gasLimit\"),\n to: handleAddress(fields[5]),\n value: handleUint(fields[6], \"value\"),\n data: hexlify(fields[7]),\n accessList: handleAccessList(fields[8], \"accessList\"),\n maxFeePerBlobGas: handleUint(fields[9], \"maxFeePerBlobGas\"),\n blobVersionedHashes: fields[10],\n blobWrapperVersion\n };\n if (blobs) {\n tx.blobs = blobs;\n }\n assertArgument(tx.to != null, `invalid address for transaction type: ${typeName}`, \"data\", data);\n assertArgument(Array.isArray(tx.blobVersionedHashes), \"invalid blobVersionedHashes: must be an array\", \"data\", data);\n for (let i = 0; i < tx.blobVersionedHashes.length; i++) {\n assertArgument(isHexString(tx.blobVersionedHashes[i], 32), `invalid blobVersionedHash at index ${i}: must be length 32`, \"data\", data);\n }\n // Unsigned EIP-4844 Transaction\n if (fields.length === 11) {\n return tx;\n }\n // @TODO: Do we need to do this? This is only called internally\n // and used to verify hashes; it might save time to not do this\n //tx.hash = keccak256(concat([ \"0x03\", encodeRlp(fields) ]));\n _parseEipSignature(tx, fields.slice(11));\n return tx;\n}\nfunction _serializeEip4844(tx, sig, blobs) {\n const fields = [\n formatNumber(tx.chainId, \"chainId\"),\n formatNumber(tx.nonce, \"nonce\"),\n formatNumber(tx.maxPriorityFeePerGas || 0, \"maxPriorityFeePerGas\"),\n formatNumber(tx.maxFeePerGas || 0, \"maxFeePerGas\"),\n formatNumber(tx.gasLimit, \"gasLimit\"),\n (tx.to || ZeroAddress),\n formatNumber(tx.value, \"value\"),\n tx.data,\n formatAccessList(tx.accessList || []),\n formatNumber(tx.maxFeePerBlobGas || 0, \"maxFeePerBlobGas\"),\n formatHashes(tx.blobVersionedHashes || [], \"blobVersionedHashes\")\n ];\n if (sig) {\n fields.push(formatNumber(sig.yParity, \"yParity\"));\n fields.push(toBeArray(sig.r));\n fields.push(toBeArray(sig.s));\n // We have blobs; return the network wrapped format\n if (blobs) {\n // Use EIP-7594\n if (tx.blobWrapperVersion != null) {\n const wrapperVersion = toBeArray(tx.blobWrapperVersion);\n const cellProofs = [];\n for (const { proof } of blobs) {\n const p = getBytes(proof);\n const cellSize = p.length / CELL_COUNT;\n for (let i = 0; i < p.length; i += cellSize) {\n cellProofs.push(p.subarray(i, i + cellSize));\n }\n }\n return concat([\n \"0x03\",\n encodeRlp([\n fields,\n wrapperVersion,\n blobs.map((b) => b.data),\n blobs.map((b) => b.commitment),\n cellProofs\n ])\n ]);\n }\n // Fall back onto classic EIP-4844 behavior\n return concat([\n \"0x03\",\n encodeRlp([\n fields,\n blobs.map((b) => b.data),\n blobs.map((b) => b.commitment),\n blobs.map((b) => b.proof),\n ])\n ]);\n }\n }\n return concat([\"0x03\", encodeRlp(fields)]);\n}\nfunction _parseEip7702(data) {\n const fields = decodeRlp(getBytes(data).slice(1));\n assertArgument(Array.isArray(fields) && (fields.length === 10 || fields.length === 13), \"invalid field count for transaction type: 4\", \"data\", hexlify(data));\n const tx = {\n type: 4,\n chainId: handleUint(fields[0], \"chainId\"),\n nonce: handleNumber(fields[1], \"nonce\"),\n maxPriorityFeePerGas: handleUint(fields[2], \"maxPriorityFeePerGas\"),\n maxFeePerGas: handleUint(fields[3], \"maxFeePerGas\"),\n gasPrice: null,\n gasLimit: handleUint(fields[4], \"gasLimit\"),\n to: handleAddress(fields[5]),\n value: handleUint(fields[6], \"value\"),\n data: hexlify(fields[7]),\n accessList: handleAccessList(fields[8], \"accessList\"),\n authorizationList: handleAuthorizationList(fields[9], \"authorizationList\"),\n };\n // Unsigned EIP-7702 Transaction\n if (fields.length === 10) {\n return tx;\n }\n _parseEipSignature(tx, fields.slice(10));\n return tx;\n}\nfunction _serializeEip7702(tx, sig) {\n const fields = [\n formatNumber(tx.chainId, \"chainId\"),\n formatNumber(tx.nonce, \"nonce\"),\n formatNumber(tx.maxPriorityFeePerGas || 0, \"maxPriorityFeePerGas\"),\n formatNumber(tx.maxFeePerGas || 0, \"maxFeePerGas\"),\n formatNumber(tx.gasLimit, \"gasLimit\"),\n (tx.to || \"0x\"),\n formatNumber(tx.value, \"value\"),\n tx.data,\n formatAccessList(tx.accessList || []),\n formatAuthorizationList(tx.authorizationList || [])\n ];\n if (sig) {\n fields.push(formatNumber(sig.yParity, \"yParity\"));\n fields.push(toBeArray(sig.r));\n fields.push(toBeArray(sig.s));\n }\n return concat([\"0x04\", encodeRlp(fields)]);\n}\n/**\n * A **Transaction** describes an operation to be executed on\n * Ethereum by an Externally Owned Account (EOA). It includes\n * who (the [[to]] address), what (the [[data]]) and how much (the\n * [[value]] in ether) the operation should entail.\n *\n * @example:\n * tx = new Transaction()\n * //_result:\n *\n * tx.data = \"0x1234\";\n * //_result:\n */\nexport class Transaction {\n #type;\n #to;\n #data;\n #nonce;\n #gasLimit;\n #gasPrice;\n #maxPriorityFeePerGas;\n #maxFeePerGas;\n #value;\n #chainId;\n #sig;\n #accessList;\n #maxFeePerBlobGas;\n #blobVersionedHashes;\n #kzg;\n #blobs;\n #auths;\n #blobWrapperVersion;\n /**\n * The transaction type.\n *\n * If null, the type will be automatically inferred based on\n * explicit properties.\n */\n get type() { return this.#type; }\n set type(value) {\n switch (value) {\n case null:\n this.#type = null;\n break;\n case 0:\n case \"legacy\":\n this.#type = 0;\n break;\n case 1:\n case \"berlin\":\n case \"eip-2930\":\n this.#type = 1;\n break;\n case 2:\n case \"london\":\n case \"eip-1559\":\n this.#type = 2;\n break;\n case 3:\n case \"cancun\":\n case \"eip-4844\":\n this.#type = 3;\n break;\n case 4:\n case \"pectra\":\n case \"eip-7702\":\n this.#type = 4;\n break;\n default:\n assertArgument(false, \"unsupported transaction type\", \"type\", value);\n }\n }\n /**\n * The name of the transaction type.\n */\n get typeName() {\n switch (this.type) {\n case 0: return \"legacy\";\n case 1: return \"eip-2930\";\n case 2: return \"eip-1559\";\n case 3: return \"eip-4844\";\n case 4: return \"eip-7702\";\n }\n return null;\n }\n /**\n * The ``to`` address for the transaction or ``null`` if the\n * transaction is an ``init`` transaction.\n */\n get to() {\n const value = this.#to;\n if (value == null && this.type === 3) {\n return ZeroAddress;\n }\n return value;\n }\n set to(value) {\n this.#to = (value == null) ? null : getAddress(value);\n }\n /**\n * The transaction nonce.\n */\n get nonce() { return this.#nonce; }\n set nonce(value) { this.#nonce = getNumber(value, \"value\"); }\n /**\n * The gas limit.\n */\n get gasLimit() { return this.#gasLimit; }\n set gasLimit(value) { this.#gasLimit = getBigInt(value); }\n /**\n * The gas price.\n *\n * On legacy networks this defines the fee that will be paid. On\n * EIP-1559 networks, this should be ``null``.\n */\n get gasPrice() {\n const value = this.#gasPrice;\n if (value == null && (this.type === 0 || this.type === 1)) {\n return BN_0;\n }\n return value;\n }\n set gasPrice(value) {\n this.#gasPrice = (value == null) ? null : getBigInt(value, \"gasPrice\");\n }\n /**\n * The maximum priority fee per unit of gas to pay. On legacy\n * networks this should be ``null``.\n */\n get maxPriorityFeePerGas() {\n const value = this.#maxPriorityFeePerGas;\n if (value == null) {\n if (this.type === 2 || this.type === 3) {\n return BN_0;\n }\n return null;\n }\n return value;\n }\n set maxPriorityFeePerGas(value) {\n this.#maxPriorityFeePerGas = (value == null) ? null : getBigInt(value, \"maxPriorityFeePerGas\");\n }\n /**\n * The maximum total fee per unit of gas to pay. On legacy\n * networks this should be ``null``.\n */\n get maxFeePerGas() {\n const value = this.#maxFeePerGas;\n if (value == null) {\n if (this.type === 2 || this.type === 3) {\n return BN_0;\n }\n return null;\n }\n return value;\n }\n set maxFeePerGas(value) {\n this.#maxFeePerGas = (value == null) ? null : getBigInt(value, \"maxFeePerGas\");\n }\n /**\n * The transaction data. For ``init`` transactions this is the\n * deployment code.\n */\n get data() { return this.#data; }\n set data(value) { this.#data = hexlify(value); }\n /**\n * The amount of ether (in wei) to send in this transactions.\n */\n get value() { return this.#value; }\n set value(value) {\n this.#value = getBigInt(value, \"value\");\n }\n /**\n * The chain ID this transaction is valid on.\n */\n get chainId() { return this.#chainId; }\n set chainId(value) { this.#chainId = getBigInt(value); }\n /**\n * If signed, the signature for this transaction.\n */\n get signature() { return this.#sig || null; }\n set signature(value) {\n this.#sig = (value == null) ? null : Signature.from(value);\n }\n isValid() {\n const sig = this.signature;\n if (sig && !sig.isValid()) {\n return false;\n }\n const auths = this.authorizationList;\n if (auths) {\n for (const auth of auths) {\n if (!auth.signature.isValid()) {\n return false;\n }\n }\n }\n return true;\n }\n /**\n * The access list.\n *\n * An access list permits discounted (but pre-paid) access to\n * bytecode and state variable access within contract execution.\n */\n get accessList() {\n const value = this.#accessList || null;\n if (value == null) {\n if (this.type === 1 || this.type === 2 || this.type === 3) {\n // @TODO: in v7, this should assign the value or become\n // a live object itself, otherwise mutation is inconsistent\n return [];\n }\n return null;\n }\n return value;\n }\n set accessList(value) {\n this.#accessList = (value == null) ? null : accessListify(value);\n }\n get authorizationList() {\n const value = this.#auths || null;\n if (value == null) {\n if (this.type === 4) {\n // @TODO: in v7, this should become a live object itself,\n // otherwise mutation is inconsistent\n return [];\n }\n }\n return value;\n }\n set authorizationList(auths) {\n this.#auths = (auths == null) ? null : auths.map((a) => authorizationify(a));\n }\n /**\n * The max fee per blob gas for Cancun transactions.\n */\n get maxFeePerBlobGas() {\n const value = this.#maxFeePerBlobGas;\n if (value == null && this.type === 3) {\n return BN_0;\n }\n return value;\n }\n set maxFeePerBlobGas(value) {\n this.#maxFeePerBlobGas = (value == null) ? null : getBigInt(value, \"maxFeePerBlobGas\");\n }\n /**\n * The BLOb versioned hashes for Cancun transactions.\n */\n get blobVersionedHashes() {\n // @TODO: Mutation is inconsistent; if unset, the returned value\n // cannot mutate the object, if set it can\n let value = this.#blobVersionedHashes;\n if (value == null && this.type === 3) {\n return [];\n }\n return value;\n }\n set blobVersionedHashes(value) {\n if (value != null) {\n assertArgument(Array.isArray(value), \"blobVersionedHashes must be an Array\", \"value\", value);\n value = value.slice();\n for (let i = 0; i < value.length; i++) {\n assertArgument(isHexString(value[i], 32), \"invalid blobVersionedHash\", `value[${i}]`, value[i]);\n }\n }\n this.#blobVersionedHashes = value;\n }\n /**\n * The BLObs for the Transaction, if any.\n *\n * If ``blobs`` is non-``null``, then the [[seriailized]]\n * will return the network formatted sidecar, otherwise it\n * will return the standard [[link-eip-2718]] payload. The\n * [[unsignedSerialized]] is unaffected regardless.\n *\n * When setting ``blobs``, either fully valid [[Blob]] objects\n * may be specified (i.e. correctly padded, with correct\n * committments and proofs) or a raw [[BytesLike]] may\n * be provided.\n *\n * If raw [[BytesLike]] are provided, the [[kzg]] property **must**\n * be already set. The blob will be correctly padded and the\n * [[KzgLibrary]] will be used to compute the committment and\n * proof for the blob.\n *\n * A BLOb is a sequence of field elements, each of which must\n * be within the BLS field modulo, so some additional processing\n * may be required to encode arbitrary data to ensure each 32 byte\n * field is within the valid range.\n *\n * Setting this automatically populates [[blobVersionedHashes]],\n * overwriting any existing values. Setting this to ``null``\n * does **not** remove the [[blobVersionedHashes]], leaving them\n * present.\n */\n get blobs() {\n if (this.#blobs == null) {\n return null;\n }\n return this.#blobs.map((b) => Object.assign({}, b));\n }\n set blobs(_blobs) {\n if (_blobs == null) {\n this.#blobs = null;\n return;\n }\n const blobs = [];\n const versionedHashes = [];\n for (let i = 0; i < _blobs.length; i++) {\n const blob = _blobs[i];\n if (isBytesLike(blob)) {\n assert(this.#kzg, \"adding a raw blob requires a KZG library\", \"UNSUPPORTED_OPERATION\", {\n operation: \"set blobs()\"\n });\n let data = getBytes(blob);\n assertArgument(data.length <= BLOB_SIZE, \"blob is too large\", `blobs[${i}]`, blob);\n // Pad blob if necessary\n if (data.length !== BLOB_SIZE) {\n const padded = new Uint8Array(BLOB_SIZE);\n padded.set(data);\n data = padded;\n }\n const commit = this.#kzg.blobToKzgCommitment(data);\n const proof = hexlify(this.#kzg.computeBlobKzgProof(data, commit));\n blobs.push({\n data: hexlify(data),\n commitment: hexlify(commit),\n proof\n });\n versionedHashes.push(getVersionedHash(1, commit));\n }\n else {\n const data = hexlify(blob.data);\n const commitment = hexlify(blob.commitment);\n const proof = hexlify(blob.proof);\n blobs.push({ data, commitment, proof });\n versionedHashes.push(getVersionedHash(1, commitment));\n }\n }\n this.#blobs = blobs;\n this.#blobVersionedHashes = versionedHashes;\n }\n get kzg() { return this.#kzg; }\n set kzg(kzg) {\n if (kzg == null) {\n this.#kzg = null;\n }\n else {\n this.#kzg = getKzgLibrary(kzg);\n }\n }\n get blobWrapperVersion() {\n return this.#blobWrapperVersion;\n }\n set blobWrapperVersion(value) {\n this.#blobWrapperVersion = value;\n }\n /**\n * Creates a new Transaction with default values.\n */\n constructor() {\n this.#type = null;\n this.#to = null;\n this.#nonce = 0;\n this.#gasLimit = BN_0;\n this.#gasPrice = null;\n this.#maxPriorityFeePerGas = null;\n this.#maxFeePerGas = null;\n this.#data = \"0x\";\n this.#value = BN_0;\n this.#chainId = BN_0;\n this.#sig = null;\n this.#accessList = null;\n this.#maxFeePerBlobGas = null;\n this.#blobVersionedHashes = null;\n this.#kzg = null;\n this.#blobs = null;\n this.#auths = null;\n this.#blobWrapperVersion = null;\n }\n /**\n * The transaction hash, if signed. Otherwise, ``null``.\n */\n get hash() {\n if (this.signature == null) {\n return null;\n }\n return keccak256(this.#getSerialized(true, false));\n }\n /**\n * The pre-image hash of this transaction.\n *\n * This is the digest that a [[Signer]] must sign to authorize\n * this transaction.\n */\n get unsignedHash() {\n return keccak256(this.unsignedSerialized);\n }\n /**\n * The sending address, if signed. Otherwise, ``null``.\n */\n get from() {\n if (this.signature == null) {\n return null;\n }\n return recoverAddress(this.unsignedHash, this.signature.getCanonical());\n }\n /**\n * The public key of the sender, if signed. Otherwise, ``null``.\n */\n get fromPublicKey() {\n if (this.signature == null) {\n return null;\n }\n return SigningKey.recoverPublicKey(this.unsignedHash, this.signature.getCanonical());\n }\n /**\n * Returns true if signed.\n *\n * This provides a Type Guard that properties requiring a signed\n * transaction are non-null.\n */\n isSigned() {\n return this.signature != null;\n }\n #getSerialized(signed, sidecar) {\n assert(!signed || this.signature != null, \"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized\", \"UNSUPPORTED_OPERATION\", { operation: \".serialized\" });\n const sig = signed ? this.signature : null;\n switch (this.inferType()) {\n case 0:\n return _serializeLegacy(this, sig);\n case 1:\n return _serializeEip2930(this, sig);\n case 2:\n return _serializeEip1559(this, sig);\n case 3:\n return _serializeEip4844(this, sig, sidecar ? this.blobs : null);\n case 4:\n return _serializeEip7702(this, sig);\n }\n assert(false, \"unsupported transaction type\", \"UNSUPPORTED_OPERATION\", { operation: \".serialized\" });\n }\n /**\n * The serialized transaction.\n *\n * This throws if the transaction is unsigned. For the pre-image,\n * use [[unsignedSerialized]].\n */\n get serialized() {\n return this.#getSerialized(true, true);\n }\n /**\n * The transaction pre-image.\n *\n * The hash of this is the digest which needs to be signed to\n * authorize this transaction.\n */\n get unsignedSerialized() {\n return this.#getSerialized(false, false);\n }\n /**\n * Return the most \"likely\" type; currently the highest\n * supported transaction type.\n */\n inferType() {\n const types = this.inferTypes();\n // Prefer London (EIP-1559) over Cancun (BLOb)\n if (types.indexOf(2) >= 0) {\n return 2;\n }\n // Return the highest inferred type\n return (types.pop());\n }\n /**\n * Validates the explicit properties and returns a list of compatible\n * transaction types.\n */\n inferTypes() {\n // Checks that there are no conflicting properties set\n const hasGasPrice = this.gasPrice != null;\n const hasFee = (this.maxFeePerGas != null || this.maxPriorityFeePerGas != null);\n const hasAccessList = (this.accessList != null);\n const hasBlob = (this.#maxFeePerBlobGas != null || this.#blobVersionedHashes);\n //if (hasGasPrice && hasFee) {\n // throw new Error(\"transaction cannot have gasPrice and maxFeePerGas\");\n //}\n if (this.maxFeePerGas != null && this.maxPriorityFeePerGas != null) {\n assert(this.maxFeePerGas >= this.maxPriorityFeePerGas, \"priorityFee cannot be more than maxFee\", \"BAD_DATA\", { value: this });\n }\n //if (this.type === 2 && hasGasPrice) {\n // throw new Error(\"eip-1559 transaction cannot have gasPrice\");\n //}\n assert(!hasFee || (this.type !== 0 && this.type !== 1), \"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas\", \"BAD_DATA\", { value: this });\n assert(this.type !== 0 || !hasAccessList, \"legacy transaction cannot have accessList\", \"BAD_DATA\", { value: this });\n const types = [];\n // Explicit type\n if (this.type != null) {\n types.push(this.type);\n }\n else {\n if (this.authorizationList && this.authorizationList.length) {\n types.push(4);\n }\n else if (hasFee) {\n types.push(2);\n }\n else if (hasGasPrice) {\n types.push(1);\n if (!hasAccessList) {\n types.push(0);\n }\n }\n else if (hasAccessList) {\n types.push(1);\n types.push(2);\n }\n else if (hasBlob && this.to) {\n types.push(3);\n }\n else {\n types.push(0);\n types.push(1);\n types.push(2);\n types.push(3);\n }\n }\n types.sort();\n return types;\n }\n /**\n * Returns true if this transaction is a legacy transaction (i.e.\n * ``type === 0``).\n *\n * This provides a Type Guard that the related properties are\n * non-null.\n */\n isLegacy() {\n return (this.type === 0);\n }\n /**\n * Returns true if this transaction is berlin hardform transaction (i.e.\n * ``type === 1``).\n *\n * This provides a Type Guard that the related properties are\n * non-null.\n */\n isBerlin() {\n return (this.type === 1);\n }\n /**\n * Returns true if this transaction is london hardform transaction (i.e.\n * ``type === 2``).\n *\n * This provides a Type Guard that the related properties are\n * non-null.\n */\n isLondon() {\n return (this.type === 2);\n }\n /**\n * Returns true if this transaction is an [[link-eip-4844]] BLOB\n * transaction.\n *\n * This provides a Type Guard that the related properties are\n * non-null.\n */\n isCancun() {\n return (this.type === 3);\n }\n /**\n * Create a copy of this transaciton.\n */\n clone() {\n return Transaction.from(this);\n }\n /**\n * Return a JSON-friendly object.\n */\n toJSON() {\n const s = (v) => {\n if (v == null) {\n return null;\n }\n return v.toString();\n };\n return {\n type: this.type,\n to: this.to,\n // from: this.from,\n data: this.data,\n nonce: this.nonce,\n gasLimit: s(this.gasLimit),\n gasPrice: s(this.gasPrice),\n maxPriorityFeePerGas: s(this.maxPriorityFeePerGas),\n maxFeePerGas: s(this.maxFeePerGas),\n value: s(this.value),\n chainId: s(this.chainId),\n sig: this.signature ? this.signature.toJSON() : null,\n accessList: this.accessList\n };\n }\n [inspect]() {\n return this.toString();\n }\n toString() {\n const output = [];\n const add = (key) => {\n let value = this[key];\n if (typeof (value) === \"string\") {\n value = JSON.stringify(value);\n }\n output.push(`${key}: ${value}`);\n };\n if (this.type) {\n add(\"type\");\n }\n add(\"to\");\n add(\"data\");\n add(\"nonce\");\n add(\"gasLimit\");\n add(\"value\");\n if (this.chainId != null) {\n add(\"chainId\");\n }\n if (this.signature) {\n add(\"from\");\n output.push(`signature: ${this.signature.toString()}`);\n }\n // @TODO: accessList\n // @TODO: blobs (might make output huge; maybe just include a flag?)\n const auths = this.authorizationList;\n if (auths) {\n const outputAuths = [];\n for (const auth of auths) {\n const o = [];\n o.push(`address: ${JSON.stringify(auth.address)}`);\n if (auth.nonce != null) {\n o.push(`nonce: ${auth.nonce}`);\n }\n if (auth.chainId != null) {\n o.push(`chainId: ${auth.chainId}`);\n }\n if (auth.signature) {\n o.push(`signature: ${auth.signature.toString()}`);\n }\n outputAuths.push(`Authorization { ${o.join(\", \")} }`);\n }\n output.push(`authorizations: [ ${outputAuths.join(\", \")} ]`);\n }\n return `Transaction { ${output.join(\", \")} }`;\n }\n /**\n * Create a **Transaction** from a serialized transaction or a\n * Transaction-like object.\n */\n static from(tx) {\n if (tx == null) {\n return new Transaction();\n }\n if (typeof (tx) === \"string\") {\n const payload = getBytes(tx);\n if (payload[0] >= 0x7f) { // @TODO: > vs >= ??\n return Transaction.from(_parseLegacy(payload));\n }\n switch (payload[0]) {\n case 1: return Transaction.from(_parseEip2930(payload));\n case 2: return Transaction.from(_parseEip1559(payload));\n case 3: return Transaction.from(_parseEip4844(payload));\n case 4: return Transaction.from(_parseEip7702(payload));\n }\n assert(false, \"unsupported transaction type\", \"UNSUPPORTED_OPERATION\", { operation: \"from\" });\n }\n const result = new Transaction();\n if (tx.type != null) {\n result.type = tx.type;\n }\n if (tx.to != null) {\n result.to = tx.to;\n }\n if (tx.nonce != null) {\n result.nonce = tx.nonce;\n }\n if (tx.gasLimit != null) {\n result.gasLimit = tx.gasLimit;\n }\n if (tx.gasPrice != null) {\n result.gasPrice = tx.gasPrice;\n }\n if (tx.maxPriorityFeePerGas != null) {\n result.maxPriorityFeePerGas = tx.maxPriorityFeePerGas;\n }\n if (tx.maxFeePerGas != null) {\n result.maxFeePerGas = tx.maxFeePerGas;\n }\n if (tx.maxFeePerBlobGas != null) {\n result.maxFeePerBlobGas = tx.maxFeePerBlobGas;\n }\n if (tx.data != null) {\n result.data = tx.data;\n }\n if (tx.value != null) {\n result.value = tx.value;\n }\n if (tx.chainId != null) {\n result.chainId = tx.chainId;\n }\n if (tx.signature != null) {\n result.signature = Signature.from(tx.signature);\n }\n if (tx.accessList != null) {\n result.accessList = tx.accessList;\n }\n if (tx.authorizationList != null) {\n result.authorizationList = tx.authorizationList;\n }\n // This will get overwritten by blobs, if present\n if (tx.blobVersionedHashes != null) {\n result.blobVersionedHashes = tx.blobVersionedHashes;\n }\n // Make sure we assign the kzg before assigning blobs, which\n // require the library in the event raw blob data is provided.\n if (tx.kzg != null) {\n result.kzg = tx.kzg;\n }\n if (tx.blobWrapperVersion != null) {\n result.blobWrapperVersion = tx.blobWrapperVersion;\n }\n if (tx.blobs != null) {\n result.blobs = tx.blobs;\n }\n if (tx.hash != null) {\n assertArgument(result.isSigned(), \"unsigned transaction cannot define '.hash'\", \"tx\", tx);\n assertArgument(result.hash === tx.hash, \"hash mismatch\", \"tx\", tx);\n }\n if (tx.from != null) {\n assertArgument(result.isSigned(), \"unsigned transaction cannot define '.from'\", \"tx\", tx);\n assertArgument(result.from.toLowerCase() === (tx.from || \"\").toLowerCase(), \"from mismatch\", \"tx\", tx);\n }\n return result;\n }\n}\n//# sourceMappingURL=transaction.js.map","import { getAddress } from \"../address/index.js\";\nimport { keccak256 } from \"../crypto/index.js\";\nimport { recoverAddress } from \"../transaction/index.js\";\nimport { assertArgument, concat, encodeRlp, toBeArray } from \"../utils/index.js\";\n/**\n * Computes the [[link-eip-7702]] authorization digest to sign.\n */\nexport function hashAuthorization(auth) {\n assertArgument(typeof (auth.address) === \"string\", \"invalid address for hashAuthorization\", \"auth.address\", auth);\n return keccak256(concat([\n \"0x05\", encodeRlp([\n (auth.chainId != null) ? toBeArray(auth.chainId) : \"0x\",\n getAddress(auth.address),\n (auth.nonce != null) ? toBeArray(auth.nonce) : \"0x\",\n ])\n ]));\n}\n/**\n * Return the address of the private key that produced\n * the signature %%sig%% during signing for %%message%%.\n */\nexport function verifyAuthorization(auth, sig) {\n return recoverAddress(hashAuthorization(auth), sig);\n}\n//# sourceMappingURL=authorization.js.map","import { keccak256 } from \"../crypto/index.js\";\nimport { toUtf8Bytes } from \"../utils/index.js\";\n/**\n * A simple hashing function which operates on UTF-8 strings to\n * compute an 32-byte identifier.\n *\n * This simply computes the [UTF-8 bytes](toUtf8Bytes) and computes\n * the [[keccak256]].\n *\n * @example:\n * id(\"hello world\")\n * //_result:\n */\nexport function id(value) {\n return keccak256(toUtf8Bytes(value));\n}\n//# sourceMappingURL=id.js.map","// created 2023-09-25T01:01:55.148Z\n// compressed base64-encoded blob for include-ens data\n// source: https://github.com/adraffy/ens-normalize.js/blob/main/src/make.js\n// see: https://github.com/adraffy/ens-normalize.js#security\n// SHA-256: 0565ed049b9cf1614bb9e11ba7d8ac6a6fb96c893253d890f7e2b2884b9ded32\nvar COMPRESSED$1 = 'AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA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539,\"middle dot\"]]);\nconst NSM_MAX = 4;\n\nfunction decode_arithmetic(bytes) {\r\n\tlet pos = 0;\r\n\tfunction u16() { return (bytes[pos++] << 8) | bytes[pos++]; }\r\n\t\r\n\t// decode the frequency table\r\n\tlet symbol_count = u16();\r\n\tlet total = 1;\r\n\tlet acc = [0, 1]; // first symbol has frequency 1\r\n\tfor (let i = 1; i < symbol_count; i++) {\r\n\t\tacc.push(total += u16());\r\n\t}\r\n\r\n\t// skip the sized-payload that the last 3 symbols index into\r\n\tlet skip = u16();\r\n\tlet pos_payload = pos;\r\n\tpos += skip;\r\n\r\n\tlet read_width = 0;\r\n\tlet read_buffer = 0; \r\n\tfunction read_bit() {\r\n\t\tif (read_width == 0) {\r\n\t\t\t// this will read beyond end of buffer\r\n\t\t\t// but (undefined|0) => zero pad\r\n\t\t\tread_buffer = (read_buffer << 8) | bytes[pos++];\r\n\t\t\tread_width = 8;\r\n\t\t}\r\n\t\treturn (read_buffer >> --read_width) & 1;\r\n\t}\r\n\r\n\tconst N = 31;\r\n\tconst FULL = 2**N;\r\n\tconst HALF = FULL >>> 1;\r\n\tconst QRTR = HALF >> 1;\r\n\tconst MASK = FULL - 1;\r\n\r\n\t// fill register\r\n\tlet register = 0;\r\n\tfor (let i = 0; i < N; i++) register = (register << 1) | read_bit();\r\n\r\n\tlet symbols = [];\r\n\tlet low = 0;\r\n\tlet range = FULL; // treat like a float\r\n\twhile (true) {\r\n\t\tlet value = Math.floor((((register - low + 1) * total) - 1) / range);\r\n\t\tlet start = 0;\r\n\t\tlet end = symbol_count;\r\n\t\twhile (end - start > 1) { // binary search\r\n\t\t\tlet mid = (start + end) >>> 1;\r\n\t\t\tif (value < acc[mid]) {\r\n\t\t\t\tend = mid;\r\n\t\t\t} else {\r\n\t\t\t\tstart = mid;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (start == 0) break; // first symbol is end mark\r\n\t\tsymbols.push(start);\r\n\t\tlet a = low + Math.floor(range * acc[start] / total);\r\n\t\tlet b = low + Math.floor(range * acc[start+1] / total) - 1;\r\n\t\twhile (((a ^ b) & HALF) == 0) {\r\n\t\t\tregister = (register << 1) & MASK | read_bit();\r\n\t\t\ta = (a << 1) & MASK;\r\n\t\t\tb = (b << 1) & MASK | 1;\r\n\t\t}\r\n\t\twhile (a & ~b & QRTR) {\r\n\t\t\tregister = (register & HALF) | ((register << 1) & (MASK >>> 1)) | read_bit();\r\n\t\t\ta = (a << 1) ^ HALF;\r\n\t\t\tb = ((b ^ HALF) << 1) | HALF | 1;\r\n\t\t}\r\n\t\tlow = a;\r\n\t\trange = 1 + b - a;\r\n\t}\r\n\tlet offset = symbol_count - 4;\r\n\treturn symbols.map(x => { // index into payload\r\n\t\tswitch (x - offset) {\r\n\t\t\tcase 3: return offset + 0x10100 + ((bytes[pos_payload++] << 16) | (bytes[pos_payload++] << 8) | bytes[pos_payload++]);\r\n\t\t\tcase 2: return offset + 0x100 + ((bytes[pos_payload++] << 8) | bytes[pos_payload++]);\r\n\t\t\tcase 1: return offset + bytes[pos_payload++];\r\n\t\t\tdefault: return x - 1;\r\n\t\t}\r\n\t});\r\n}\t\r\n\r\n// returns an iterator which returns the next symbol\r\nfunction read_payload(v) {\r\n\tlet pos = 0;\r\n\treturn () => v[pos++];\r\n}\r\nfunction read_compressed_payload(s) {\r\n\treturn read_payload(decode_arithmetic(unsafe_atob(s)));\r\n}\r\n\r\n// unsafe in the sense:\r\n// expected well-formed Base64 w/o padding \r\n// 20220922: added for https://github.com/adraffy/ens-normalize.js/issues/4\r\nfunction unsafe_atob(s) {\r\n\tlet lookup = [];\r\n\t[...'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'].forEach((c, i) => lookup[c.charCodeAt(0)] = i);\r\n\tlet n = s.length;\r\n\tlet ret = new Uint8Array((6 * n) >> 3);\r\n\tfor (let i = 0, pos = 0, width = 0, carry = 0; i < n; i++) {\r\n\t\tcarry = (carry << 6) | lookup[s.charCodeAt(i)];\r\n\t\twidth += 6;\r\n\t\tif (width >= 8) {\r\n\t\t\tret[pos++] = (carry >> (width -= 8));\r\n\t\t}\r\n\t}\r\n\treturn ret;\r\n}\r\n\r\n// eg. [0,1,2,3...] => [0,-1,1,-2,...]\r\nfunction signed(i) { \r\n\treturn (i & 1) ? (~i >> 1) : (i >> 1);\r\n}\r\n\r\nfunction read_deltas(n, next) {\r\n\tlet v = Array(n);\r\n\tfor (let i = 0, x = 0; i < n; i++) v[i] = x += signed(next());\r\n\treturn v;\r\n}\r\n\r\n// [123][5] => [0 3] [1 1] [0 0]\r\nfunction read_sorted(next, prev = 0) {\r\n\tlet ret = [];\r\n\twhile (true) {\r\n\t\tlet x = next();\r\n\t\tlet n = next();\r\n\t\tif (!n) break;\r\n\t\tprev += x;\r\n\t\tfor (let i = 0; i < n; i++) {\r\n\t\t\tret.push(prev + i);\r\n\t\t}\r\n\t\tprev += n + 1;\r\n\t}\r\n\treturn ret;\r\n}\r\n\r\nfunction read_sorted_arrays(next) {\r\n\treturn read_array_while(() => { \r\n\t\tlet v = read_sorted(next);\r\n\t\tif (v.length) return v;\r\n\t});\r\n}\r\n\r\n// returns map of x => ys\r\nfunction read_mapped(next) {\r\n\tlet ret = [];\r\n\twhile (true) {\r\n\t\tlet w = next();\r\n\t\tif (w == 0) break;\r\n\t\tret.push(read_linear_table(w, next));\r\n\t}\r\n\twhile (true) {\r\n\t\tlet w = next() - 1;\r\n\t\tif (w < 0) break;\r\n\t\tret.push(read_replacement_table(w, next));\r\n\t}\r\n\treturn ret.flat();\r\n}\r\n\r\n// read until next is falsy\r\n// return array of read values\r\nfunction read_array_while(next) {\r\n\tlet v = [];\r\n\twhile (true) {\r\n\t\tlet x = next(v.length);\r\n\t\tif (!x) break;\r\n\t\tv.push(x);\r\n\t}\r\n\treturn v;\r\n}\r\n\r\n// read w columns of length n\r\n// return as n rows of length w\r\nfunction read_transposed(n, w, next) {\r\n\tlet m = Array(n).fill().map(() => []);\r\n\tfor (let i = 0; i < w; i++) {\r\n\t\tread_deltas(n, next).forEach((x, j) => m[j].push(x));\r\n\t}\r\n\treturn m;\r\n}\r\n \r\n// returns [[x, ys], [x+dx, ys+dy], [x+2*dx, ys+2*dy], ...]\r\n// where dx/dy = steps, n = run size, w = length of y\r\nfunction read_linear_table(w, next) {\r\n\tlet dx = 1 + next();\r\n\tlet dy = next();\r\n\tlet vN = read_array_while(next);\r\n\tlet m = read_transposed(vN.length, 1+w, next);\r\n\treturn m.flatMap((v, i) => {\r\n\t\tlet [x, ...ys] = v;\r\n\t\treturn Array(vN[i]).fill().map((_, j) => {\r\n\t\t\tlet j_dy = j * dy;\r\n\t\t\treturn [x + j * dx, ys.map(y => y + j_dy)];\r\n\t\t});\r\n\t});\r\n}\r\n\r\n// return [[x, ys...], ...]\r\n// where w = length of y\r\nfunction read_replacement_table(w, next) { \r\n\tlet n = 1 + next();\r\n\tlet m = read_transposed(n, 1+w, next);\r\n\treturn m.map(v => [v[0], v.slice(1)]);\r\n}\r\n\r\n\r\nfunction read_trie(next) {\r\n\tlet ret = [];\r\n\tlet sorted = read_sorted(next); \r\n\texpand(decode([]), []);\r\n\treturn ret; // not sorted\r\n\tfunction decode(Q) { // characters that lead into this node\r\n\t\tlet S = next(); // state: valid, save, check\r\n\t\tlet B = read_array_while(() => { // buckets leading to new nodes\r\n\t\t\tlet cps = read_sorted(next).map(i => sorted[i]);\r\n\t\t\tif (cps.length) return decode(cps);\r\n\t\t});\r\n\t\treturn {S, B, Q};\r\n\t}\r\n\tfunction expand({S, B}, cps, saved) {\r\n\t\tif (S & 4 && saved === cps[cps.length-1]) return;\r\n\t\tif (S & 2) saved = cps[cps.length-1];\r\n\t\tif (S & 1) ret.push(cps); \r\n\t\tfor (let br of B) {\r\n\t\t\tfor (let cp of br.Q) {\r\n\t\t\t\texpand(br, [...cps, cp], saved);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\n\nfunction hex_cp(cp) {\r\n\treturn cp.toString(16).toUpperCase().padStart(2, '0');\r\n}\r\n\r\nfunction quote_cp(cp) {\r\n\treturn `{${hex_cp(cp)}}`; // raffy convention: like \"\\u{X}\" w/o the \"\\u\"\r\n}\r\n\r\n/*\r\nexport function explode_cp(s) {\r\n\treturn [...s].map(c => c.codePointAt(0));\r\n}\r\n*/\r\nfunction explode_cp(s) { // this is about 2x faster\r\n\tlet cps = [];\r\n\tfor (let pos = 0, len = s.length; pos < len; ) {\r\n\t\tlet cp = s.codePointAt(pos);\r\n\t\tpos += cp < 0x10000 ? 1 : 2;\r\n\t\tcps.push(cp);\r\n\t}\r\n\treturn cps;\r\n}\r\n\r\nfunction str_from_cps(cps) {\r\n\tconst chunk = 4096;\r\n\tlet len = cps.length;\r\n\tif (len < chunk) return String.fromCodePoint(...cps);\r\n\tlet buf = [];\r\n\tfor (let i = 0; i < len; ) {\r\n\t\tbuf.push(String.fromCodePoint(...cps.slice(i, i += chunk)));\r\n\t}\r\n\treturn buf.join('');\r\n}\r\n\r\nfunction compare_arrays(a, b) {\r\n\tlet n = a.length;\r\n\tlet c = n - b.length;\r\n\tfor (let i = 0; c == 0 && i < n; i++) c = a[i] - b[i];\r\n\treturn c;\r\n}\n\n// created 2023-09-25T01:01:55.148Z\n// compressed base64-encoded blob for include-nf data\n// source: https://github.com/adraffy/ens-normalize.js/blob/main/src/make.js\n// see: https://github.com/adraffy/ens-normalize.js#security\n// SHA-256: a974b6f8541fc29d919bc85118af0a44015851fab5343f8679cb31be2bdb209e\nvar COMPRESSED = 'AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEE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lpFpt4SqZc5HGg1HCOrHvOdC8bP6FGDbE/VV0mX4IakzbdS/op+Kt3G24/8QbBV7y86sGSQ/vZzU8FXs7u6jIvwchsEP2BpIhW3G8uWNwa3HmjfH/ZjhhCWvluAcF+nMf14ClKg5hGgtPLJ98ueNAkc5Hs2WZlk2QHvfreCK1CCGO6nMZVSb99VM/ajr8WHTte9JSmkXq/i/U943HEbdzW6Re/S88dKgg8pGOLlAeNiqrcLkUR3/aClFpMXcOUP3rmETcWSfMXZE3TUOi8i+fqRnTYLflVx/Vb/6GJ7eIRZUA6k3RYR3iFSK9c4iDdNwJuZL2FKz/IK5VimcNWEqdXjSoxSgmF0UPlDoUlNrPcM7ftmA8Y9gKiqKEHuWN+AZRIwtVSxye2Kf8rM3lhJ5XcBXU9n4v0Oy1RU2M+4qM8AQPVwse8ErNSob5oFPWxuqZnVzo1qB/IBxkM3EVUKFUUlO3e51259GgNcJbCmlvrdjtoTW7rChm1wyCKzpCTwozUUEOIcWLneRLgMXh+SjGSFkAllzbGS5HK7LlfCMRNRDSvbQPjcXaenNYxCvu2Qyznz6StuxVj66SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g';\n\n// https://unicode.org/reports/tr15/\r\n// for reference implementation\r\n// see: /derive/nf.js\r\n\r\n\r\n// algorithmic hangul\r\n// https://www.unicode.org/versions/Unicode15.0.0/ch03.pdf (page 144)\r\nconst S0 = 0xAC00;\r\nconst L0 = 0x1100;\r\nconst V0 = 0x1161;\r\nconst T0 = 0x11A7;\r\nconst L_COUNT = 19;\r\nconst V_COUNT = 21;\r\nconst T_COUNT = 28;\r\nconst N_COUNT = V_COUNT * T_COUNT;\r\nconst S_COUNT = L_COUNT * N_COUNT;\r\nconst S1 = S0 + S_COUNT;\r\nconst L1 = L0 + L_COUNT;\r\nconst V1 = V0 + V_COUNT;\r\nconst T1 = T0 + T_COUNT;\r\n\r\nfunction unpack_cc(packed) {\r\n\treturn (packed >> 24) & 0xFF;\r\n}\r\nfunction unpack_cp(packed) {\r\n\treturn packed & 0xFFFFFF;\r\n}\r\n\r\nlet SHIFTED_RANK, EXCLUSIONS, DECOMP, RECOMP;\r\n\r\nfunction init$1() {\r\n\t//console.time('nf');\r\n\tlet r = read_compressed_payload(COMPRESSED);\r\n\tSHIFTED_RANK = new Map(read_sorted_arrays(r).flatMap((v, i) => v.map(x => [x, (i+1) << 24]))); // pre-shifted\r\n\tEXCLUSIONS = new Set(read_sorted(r));\r\n\tDECOMP = new Map();\r\n\tRECOMP = new Map();\r\n\tfor (let [cp, cps] of read_mapped(r)) {\r\n\t\tif (!EXCLUSIONS.has(cp) && cps.length == 2) {\r\n\t\t\tlet [a, b] = cps;\r\n\t\t\tlet bucket = RECOMP.get(a);\r\n\t\t\tif (!bucket) {\r\n\t\t\t\tbucket = new Map();\r\n\t\t\t\tRECOMP.set(a, bucket);\r\n\t\t\t}\r\n\t\t\tbucket.set(b, cp);\r\n\t\t}\r\n\t\tDECOMP.set(cp, cps.reverse()); // stored reversed\r\n\t}\r\n\t//console.timeEnd('nf');\r\n\t// 20230905: 11ms\r\n}\r\n\r\nfunction is_hangul(cp) {\r\n\treturn cp >= S0 && cp < S1;\r\n}\r\n\r\nfunction compose_pair(a, b) {\r\n\tif (a >= L0 && a < L1 && b >= V0 && b < V1) {\r\n\t\treturn S0 + (a - L0) * N_COUNT + (b - V0) * T_COUNT;\r\n\t} else if (is_hangul(a) && b > T0 && b < T1 && (a - S0) % T_COUNT == 0) {\r\n\t\treturn a + (b - T0);\r\n\t} else {\r\n\t\tlet recomp = RECOMP.get(a);\r\n\t\tif (recomp) {\r\n\t\t\trecomp = recomp.get(b);\r\n\t\t\tif (recomp) {\r\n\t\t\t\treturn recomp;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn -1;\r\n\t}\r\n}\r\n\r\nfunction decomposed(cps) {\r\n\tif (!SHIFTED_RANK) init$1();\r\n\tlet ret = [];\r\n\tlet buf = [];\r\n\tlet check_order = false;\r\n\tfunction add(cp) {\r\n\t\tlet cc = SHIFTED_RANK.get(cp);\r\n\t\tif (cc) {\r\n\t\t\tcheck_order = true;\r\n\t\t\tcp |= cc;\r\n\t\t}\r\n\t\tret.push(cp);\r\n\t}\r\n\tfor (let cp of cps) {\r\n\t\twhile (true) {\r\n\t\t\tif (cp < 0x80) {\r\n\t\t\t\tret.push(cp);\r\n\t\t\t} else if (is_hangul(cp)) {\r\n\t\t\t\tlet s_index = cp - S0;\r\n\t\t\t\tlet l_index = s_index / N_COUNT | 0;\r\n\t\t\t\tlet v_index = (s_index % N_COUNT) / T_COUNT | 0;\r\n\t\t\t\tlet t_index = s_index % T_COUNT;\r\n\t\t\t\tadd(L0 + l_index);\r\n\t\t\t\tadd(V0 + v_index);\r\n\t\t\t\tif (t_index > 0) add(T0 + t_index);\r\n\t\t\t} else {\r\n\t\t\t\tlet mapped = DECOMP.get(cp);\r\n\t\t\t\tif (mapped) {\r\n\t\t\t\t\tbuf.push(...mapped);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tadd(cp);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!buf.length) break;\r\n\t\t\tcp = buf.pop();\r\n\t\t}\r\n\t}\r\n\tif (check_order && ret.length > 1) {\r\n\t\tlet prev_cc = unpack_cc(ret[0]);\r\n\t\tfor (let i = 1; i < ret.length; i++) {\r\n\t\t\tlet cc = unpack_cc(ret[i]);\r\n\t\t\tif (cc == 0 || prev_cc <= cc) {\r\n\t\t\t\tprev_cc = cc;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tlet j = i-1;\r\n\t\t\twhile (true) {\r\n\t\t\t\tlet tmp = ret[j+1];\r\n\t\t\t\tret[j+1] = ret[j];\r\n\t\t\t\tret[j] = tmp;\r\n\t\t\t\tif (!j) break;\r\n\t\t\t\tprev_cc = unpack_cc(ret[--j]);\r\n\t\t\t\tif (prev_cc <= cc) break;\r\n\t\t\t}\r\n\t\t\tprev_cc = unpack_cc(ret[i]);\r\n\t\t}\r\n\t}\r\n\treturn ret;\r\n}\r\n\r\nfunction composed_from_decomposed(v) {\r\n\tlet ret = [];\r\n\tlet stack = [];\r\n\tlet prev_cp = -1;\r\n\tlet prev_cc = 0;\r\n\tfor (let packed of v) {\r\n\t\tlet cc = unpack_cc(packed);\r\n\t\tlet cp = unpack_cp(packed);\r\n\t\tif (prev_cp == -1) {\r\n\t\t\tif (cc == 0) {\r\n\t\t\t\tprev_cp = cp;\r\n\t\t\t} else {\r\n\t\t\t\tret.push(cp);\r\n\t\t\t}\r\n\t\t} else if (prev_cc > 0 && prev_cc >= cc) {\r\n\t\t\tif (cc == 0) {\r\n\t\t\t\tret.push(prev_cp, ...stack);\r\n\t\t\t\tstack.length = 0;\r\n\t\t\t\tprev_cp = cp;\r\n\t\t\t} else {\r\n\t\t\t\tstack.push(cp);\r\n\t\t\t}\r\n\t\t\tprev_cc = cc;\r\n\t\t} else {\r\n\t\t\tlet composed = compose_pair(prev_cp, cp);\r\n\t\t\tif (composed >= 0) {\r\n\t\t\t\tprev_cp = composed;\r\n\t\t\t} else if (prev_cc == 0 && cc == 0) {\r\n\t\t\t\tret.push(prev_cp);\r\n\t\t\t\tprev_cp = cp;\r\n\t\t\t} else {\r\n\t\t\t\tstack.push(cp);\r\n\t\t\t\tprev_cc = cc;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (prev_cp >= 0) {\r\n\t\tret.push(prev_cp, ...stack);\t\r\n\t}\r\n\treturn ret;\r\n}\r\n\r\n// note: cps can be iterable\r\nfunction nfd(cps) {\r\n\treturn decomposed(cps).map(unpack_cp);\r\n}\r\nfunction nfc(cps) {\r\n\treturn composed_from_decomposed(decomposed(cps));\r\n}\n\nconst HYPHEN = 0x2D;\r\nconst STOP = 0x2E;\r\nconst STOP_CH = '.';\r\nconst FE0F = 0xFE0F;\r\nconst UNIQUE_PH = 1;\r\n\r\n// 20230913: replace [...v] with Array_from(v) to avoid large spreads\r\nconst Array_from = x => Array.from(x); // Array.from.bind(Array);\r\n\r\nfunction group_has_cp(g, cp) {\r\n\t// 20230913: keep primary and secondary distinct instead of creating valid union\r\n\treturn g.P.has(cp) || g.Q.has(cp);\r\n}\r\n\r\nclass Emoji extends Array {\r\n\tget is_emoji() { return true; } // free tagging system\r\n}\r\n\r\nlet MAPPED, IGNORED, CM, NSM, ESCAPE, NFC_CHECK, GROUPS, WHOLE_VALID, WHOLE_MAP, VALID, EMOJI_LIST, EMOJI_ROOT;\r\n\r\nfunction init() {\r\n\tif (MAPPED) return;\r\n\t\r\n\tlet r = read_compressed_payload(COMPRESSED$1);\r\n\tconst read_sorted_array = () => read_sorted(r);\r\n\tconst read_sorted_set = () => new Set(read_sorted_array());\r\n\tconst set_add_many = (set, v) => v.forEach(x => set.add(x));\r\n\r\n\tMAPPED = new Map(read_mapped(r)); \r\n\tIGNORED = read_sorted_set(); // ignored characters are not valid, so just read raw codepoints\r\n\r\n\t/*\r\n\t// direct include from payload is smaller than the decompression code\r\n\tconst FENCED = new Map(read_array_while(() => {\r\n\t\tlet cp = r();\r\n\t\tif (cp) return [cp, read_str(r())];\r\n\t}));\r\n\t*/\r\n\t// 20230217: we still need all CM for proper error formatting\r\n\t// but norm only needs NSM subset that are potentially-valid\r\n\tCM = read_sorted_array();\r\n\tNSM = new Set(read_sorted_array().map(i => CM[i]));\r\n\tCM = new Set(CM);\r\n\t\r\n\tESCAPE = read_sorted_set(); // characters that should not be printed\r\n\tNFC_CHECK = read_sorted_set(); // only needed to illustrate ens_tokenize() transformations\r\n\r\n\tlet chunks = read_sorted_arrays(r);\r\n\tlet unrestricted = r();\r\n\t//const read_chunked = () => new Set(read_sorted_array().flatMap(i => chunks[i]).concat(read_sorted_array()));\r\n\tconst read_chunked = () => {\r\n\t\t// 20230921: build set in parts, 2x faster\r\n\t\tlet set = new Set();\r\n\t\tread_sorted_array().forEach(i => set_add_many(set, chunks[i]));\r\n\t\tset_add_many(set, read_sorted_array());\r\n\t\treturn set; \r\n\t};\r\n\tGROUPS = read_array_while(i => {\r\n\t\t// minifier property mangling seems unsafe\r\n\t\t// so these are manually renamed to single chars\r\n\t\tlet N = read_array_while(r).map(x => x+0x60);\r\n\t\tif (N.length) {\r\n\t\t\tlet R = i >= unrestricted; // unrestricted then restricted\r\n\t\t\tN[0] -= 32; // capitalize\r\n\t\t\tN = str_from_cps(N);\r\n\t\t\tif (R) N=`Restricted[${N}]`;\r\n\t\t\tlet P = read_chunked(); // primary\r\n\t\t\tlet Q = read_chunked(); // secondary\r\n\t\t\tlet M = !r(); // not-whitelisted, check for NSM\r\n\t\t\t// *** this code currently isn't needed ***\r\n\t\t\t/*\r\n\t\t\tlet V = [...P, ...Q].sort((a, b) => a-b); // derive: sorted valid\r\n\t\t\tlet M = r()-1; // number of combining mark\r\n\t\t\tif (M < 0) { // whitelisted\r\n\t\t\t\tM = new Map(read_array_while(() => {\r\n\t\t\t\t\tlet i = r();\r\n\t\t\t\t\tif (i) return [V[i-1], read_array_while(() => {\r\n\t\t\t\t\t\tlet v = read_array_while(r);\r\n\t\t\t\t\t\tif (v.length) return v.map(x => x-1);\r\n\t\t\t\t\t})];\r\n\t\t\t\t}));\r\n\t\t\t}*/\r\n\t\t\treturn {N, P, Q, M, R};\r\n\t\t}\r\n\t});\r\n\r\n\t// decode compressed wholes\r\n\tWHOLE_VALID = read_sorted_set();\r\n\tWHOLE_MAP = new Map();\r\n\tlet wholes = read_sorted_array().concat(Array_from(WHOLE_VALID)).sort((a, b) => a-b); // must be sorted\r\n\twholes.forEach((cp, i) => {\r\n\t\tlet d = r(); \r\n\t\tlet w = wholes[i] = d ? wholes[i-d] : {V: [], M: new Map()};\r\n\t\tw.V.push(cp); // add to member set\r\n\t\tif (!WHOLE_VALID.has(cp)) {\r\n\t\t\tWHOLE_MAP.set(cp, w); // register with whole map\r\n\t\t}\r\n\t});\r\n\r\n\t// compute confusable-extent complements\r\n\t// usage: WHOLE_MAP.get(cp).M.get(cp) = complement set\r\n\tfor (let {V, M} of new Set(WHOLE_MAP.values())) {\r\n\t\t// connect all groups that have each whole character\r\n\t\tlet recs = [];\r\n\t\tfor (let cp of V) {\r\n\t\t\tlet gs = GROUPS.filter(g => group_has_cp(g, cp));\r\n\t\t\tlet rec = recs.find(({G}) => gs.some(g => G.has(g)));\r\n\t\t\tif (!rec) {\r\n\t\t\t\trec = {G: new Set(), V: []};\r\n\t\t\t\trecs.push(rec);\r\n\t\t\t}\r\n\t\t\trec.V.push(cp);\r\n\t\t\tset_add_many(rec.G, gs);\r\n\t\t}\r\n\t\t// per character cache groups which are not a member of the extent\r\n\t\tlet union = recs.flatMap(x => Array_from(x.G)); // all of the groups used by this whole\r\n\t\tfor (let {G, V} of recs) {\r\n\t\t\tlet complement = new Set(union.filter(g => !G.has(g))); // groups not covered by the extent\r\n\t\t\tfor (let cp of V) {\r\n\t\t\t\tM.set(cp, complement); // this is the same reference\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// compute valid set\r\n\t// 20230924: VALID was union but can be re-used\r\n\tVALID = new Set(); // exists in 1+ groups\r\n\tlet multi = new Set(); // exists in 2+ groups\r\n\tconst add_to_union = cp => VALID.has(cp) ? multi.add(cp) : VALID.add(cp);\r\n\tfor (let g of GROUPS) {\r\n\t\tfor (let cp of g.P) add_to_union(cp);\r\n\t\tfor (let cp of g.Q) add_to_union(cp);\r\n\t}\r\n\t// dual purpose WHOLE_MAP: return placeholder if unique non-confusable\r\n\tfor (let cp of VALID) {\r\n\t\tif (!WHOLE_MAP.has(cp) && !multi.has(cp)) {\r\n\t\t\tWHOLE_MAP.set(cp, UNIQUE_PH);\r\n\t\t}\r\n\t}\r\n\t// add all decomposed parts\r\n\t// see derive: \"Valid is Closed (via Brute-force)\"\r\n\tset_add_many(VALID, nfd(VALID));\r\n\t\r\n\t// decode emoji\r\n\t// 20230719: emoji are now fully-expanded to avoid quirk logic \r\n\tEMOJI_LIST = read_trie(r).map(v => Emoji.from(v)).sort(compare_arrays);\r\n\tEMOJI_ROOT = new Map(); // this has approx 7K nodes (2+ per emoji)\r\n\tfor (let cps of EMOJI_LIST) {\r\n\t\t// 20230719: change to *slightly* stricter algorithm which disallows \r\n\t\t// insertion of misplaced FE0F in emoji sequences (matching ENSIP-15)\r\n\t\t// example: beautified [A B] (eg. flag emoji) \r\n\t\t// before: allow: [A FE0F B], error: [A FE0F FE0F B] \r\n\t\t// after: error: both\r\n\t\t// note: this code now matches ENSNormalize.{cs,java} logic\r\n\t\tlet prev = [EMOJI_ROOT];\r\n\t\tfor (let cp of cps) {\r\n\t\t\tlet next = prev.map(node => {\r\n\t\t\t\tlet child = node.get(cp);\r\n\t\t\t\tif (!child) {\r\n\t\t\t\t\t// should this be object? \r\n\t\t\t\t\t// (most have 1-2 items, few have many)\r\n\t\t\t\t\t// 20230719: no, v8 default map is 4?\r\n\t\t\t\t\tchild = new Map();\r\n\t\t\t\t\tnode.set(cp, child);\r\n\t\t\t\t}\r\n\t\t\t\treturn child;\r\n\t\t\t});\r\n\t\t\tif (cp === FE0F) {\r\n\t\t\t\tprev.push(...next); // less than 20 elements\r\n\t\t\t} else {\r\n\t\t\t\tprev = next;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (let x of prev) {\r\n\t\t\tx.V = cps;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n// if escaped: {HEX}\r\n// else: \"x\" {HEX}\r\nfunction quoted_cp(cp) {\r\n\treturn (should_escape(cp) ? '' : `${bidi_qq(safe_str_from_cps([cp]))} `) + quote_cp(cp);\r\n}\r\n\r\n// 20230211: some messages can be mixed-directional and result in spillover\r\n// use 200E after a quoted string to force the remainder of a string from \r\n// acquring the direction of the quote\r\n// https://www.w3.org/International/questions/qa-bidi-unicode-controls#exceptions\r\nfunction bidi_qq(s) {\r\n\treturn `\"${s}\"\\u200E`; // strong LTR\r\n}\r\n\r\nfunction check_label_extension(cps) {\r\n\tif (cps.length >= 4 && cps[2] == HYPHEN && cps[3] == HYPHEN) {\r\n\t\tthrow new Error(`invalid label extension: \"${str_from_cps(cps.slice(0, 4))}\"`); // this can only be ascii so cant be bidi\r\n\t}\r\n}\r\nfunction check_leading_underscore(cps) {\r\n\tconst UNDERSCORE = 0x5F;\r\n\tfor (let i = cps.lastIndexOf(UNDERSCORE); i > 0; ) {\r\n\t\tif (cps[--i] !== UNDERSCORE) {\r\n\t\t\tthrow new Error('underscore allowed only at start');\r\n\t\t}\r\n\t}\r\n}\r\n// check that a fenced cp is not leading, trailing, or touching another fenced cp\r\nfunction check_fenced(cps) {\r\n\tlet cp = cps[0];\r\n\tlet prev = FENCED.get(cp);\r\n\tif (prev) throw error_placement(`leading ${prev}`);\r\n\tlet n = cps.length;\r\n\tlet last = -1; // prevents trailing from throwing\r\n\tfor (let i = 1; i < n; i++) {\r\n\t\tcp = cps[i];\r\n\t\tlet match = FENCED.get(cp);\r\n\t\tif (match) {\r\n\t\t\t// since cps[0] isn't fenced, cps[1] cannot throw\r\n\t\t\tif (last == i) throw error_placement(`${prev} + ${match}`);\r\n\t\t\tlast = i + 1;\r\n\t\t\tprev = match;\r\n\t\t}\r\n\t}\r\n\tif (last == n) throw error_placement(`trailing ${prev}`);\r\n}\r\n\r\n// create a safe to print string \r\n// invisibles are escaped\r\n// leading cm uses placeholder\r\n// if cps exceed max, middle truncate with ellipsis\r\n// quoter(cp) => string, eg. 3000 => \"{3000}\"\r\n// note: in html, you'd call this function then replace [<>&] with entities\r\nfunction safe_str_from_cps(cps, max = Infinity, quoter = quote_cp) {\r\n\t//if (Number.isInteger(cps)) cps = [cps];\r\n\t//if (!Array.isArray(cps)) throw new TypeError(`expected codepoints`);\r\n\tlet buf = [];\r\n\tif (is_combining_mark(cps[0])) buf.push('◌');\r\n\tif (cps.length > max) {\r\n\t\tmax >>= 1;\r\n\t\tcps = [...cps.slice(0, max), 0x2026, ...cps.slice(-max)];\r\n\t}\r\n\tlet prev = 0;\r\n\tlet n = cps.length;\r\n\tfor (let i = 0; i < n; i++) {\r\n\t\tlet cp = cps[i];\r\n\t\tif (should_escape(cp)) {\r\n\t\t\tbuf.push(str_from_cps(cps.slice(prev, i)));\r\n\t\t\tbuf.push(quoter(cp));\r\n\t\t\tprev = i + 1;\r\n\t\t}\r\n\t}\r\n\tbuf.push(str_from_cps(cps.slice(prev, n)));\r\n\treturn buf.join('');\r\n}\r\n\r\n// note: set(s) cannot be exposed because they can be modified\r\n// note: Object.freeze() doesn't work\r\nfunction is_combining_mark(cp) {\r\n\tinit();\r\n\treturn CM.has(cp);\r\n}\r\nfunction should_escape(cp) {\r\n\tinit();\r\n\treturn ESCAPE.has(cp);\r\n}\r\n\r\n// return all supported emoji as fully-qualified emoji \r\n// ordered by length then lexicographic \r\nfunction ens_emoji() {\r\n\tinit();\r\n\treturn EMOJI_LIST.map(x => x.slice()); // emoji are exposed so copy\r\n}\r\n\r\nfunction ens_normalize_fragment(frag, decompose) {\r\n\tinit();\r\n\tlet nf = decompose ? nfd : nfc;\r\n\treturn frag.split(STOP_CH).map(label => str_from_cps(tokens_from_str(explode_cp(label), nf, filter_fe0f).flat())).join(STOP_CH);\r\n}\r\n\r\nfunction ens_normalize(name) {\r\n\treturn flatten(split(name, nfc, filter_fe0f));\r\n}\r\n\r\nfunction ens_beautify(name) {\r\n\tlet labels = split(name, nfc, x => x); // emoji not exposed\r\n\tfor (let {type, output, error} of labels) {\r\n\t\tif (error) break; // flatten will throw\r\n\r\n\t\t// replace leading/trailing hyphen\r\n\t\t// 20230121: consider beautifing all or leading/trailing hyphen to unicode variant\r\n\t\t// not exactly the same in every font, but very similar: \"-\" vs \"‐\"\r\n\t\t/*\r\n\t\tconst UNICODE_HYPHEN = 0x2010;\r\n\t\t// maybe this should replace all for visual consistancy?\r\n\t\t// `node tools/reg-count.js regex ^-\\{2,\\}` => 592\r\n\t\t//for (let i = 0; i < output.length; i++) if (output[i] == 0x2D) output[i] = 0x2010;\r\n\t\tif (output[0] == HYPHEN) output[0] = UNICODE_HYPHEN;\r\n\t\tlet end = output.length-1;\r\n\t\tif (output[end] == HYPHEN) output[end] = UNICODE_HYPHEN;\r\n\t\t*/\r\n\t\t// 20230123: WHATWG URL uses \"CheckHyphens\" false\r\n\t\t// https://url.spec.whatwg.org/#idna\r\n\r\n\t\t// update ethereum symbol\r\n\t\t// ξ => Ξ if not greek\r\n\t\tif (type !== 'Greek') array_replace(output, 0x3BE, 0x39E);\r\n\r\n\t\t// 20221213: fixes bidi subdomain issue, but breaks invariant (200E is disallowed)\r\n\t\t// could be fixed with special case for: 2D (.) + 200E (LTR)\r\n\t\t// https://discuss.ens.domains/t/bidi-label-ordering-spoof/15824\r\n\t\t//output.splice(0, 0, 0x200E);\r\n\t}\r\n\treturn flatten(labels);\r\n}\r\n\r\nfunction array_replace(v, a, b) {\r\n\tlet prev = 0;\r\n\twhile (true) {\r\n\t\tlet next = v.indexOf(a, prev);\r\n\t\tif (next < 0) break;\r\n\t\tv[next] = b; \r\n\t\tprev = next + 1;\r\n\t}\r\n}\r\n\r\nfunction ens_split(name, preserve_emoji) {\r\n\treturn split(name, nfc, preserve_emoji ? x => x.slice() : filter_fe0f); // emoji are exposed so copy\r\n}\r\n\r\nfunction split(name, nf, ef) {\r\n\tif (!name) return []; // 20230719: empty name allowance\r\n\tinit();\r\n\tlet offset = 0;\r\n\t// https://unicode.org/reports/tr46/#Validity_Criteria\r\n\t// 4.) \"The label must not contain a U+002E ( . ) FULL STOP.\"\r\n\treturn name.split(STOP_CH).map(label => {\r\n\t\tlet input = explode_cp(label);\r\n\t\tlet info = {\r\n\t\t\tinput,\r\n\t\t\toffset, // codepoint, not substring!\r\n\t\t};\r\n\t\toffset += input.length + 1; // + stop\r\n\t\ttry {\r\n\t\t\t// 1.) \"The label must be in Unicode Normalization Form NFC\"\r\n\t\t\tlet tokens = info.tokens = tokens_from_str(input, nf, ef);\r\n\t\t\tlet token_count = tokens.length;\r\n\t\t\tlet type;\r\n\t\t\tif (!token_count) { // the label was effectively empty (could of had ignored characters)\r\n\t\t\t\t//norm = [];\r\n\t\t\t\t//type = 'None'; // use this instead of next match, \"ASCII\"\r\n\t\t\t\t// 20230120: change to strict\r\n\t\t\t\t// https://discuss.ens.domains/t/ens-name-normalization-2nd/14564/59\r\n\t\t\t\tthrow new Error(`empty label`);\r\n\t\t\t} \r\n\t\t\tlet norm = info.output = tokens.flat();\r\n\t\t\tcheck_leading_underscore(norm);\r\n\t\t\tlet emoji = info.emoji = token_count > 1 || tokens[0].is_emoji; // same as: tokens.some(x => x.is_emoji);\r\n\t\t\tif (!emoji && norm.every(cp => cp < 0x80)) { // special case for ascii\r\n\t\t\t\t// 20230123: matches matches WHATWG, see note 3.3\r\n\t\t\t\tcheck_label_extension(norm); // only needed for ascii\r\n\t\t\t\t// cant have fenced\r\n\t\t\t\t// cant have cm\r\n\t\t\t\t// cant have wholes\r\n\t\t\t\t// see derive: \"Fastpath ASCII\"\r\n\t\t\t\ttype = 'ASCII';\r\n\t\t\t} else {\r\n\t\t\t\tlet chars = tokens.flatMap(x => x.is_emoji ? [] : x); // all of the nfc tokens concat together\r\n\t\t\t\tif (!chars.length) { // theres no text, just emoji\r\n\t\t\t\t\ttype = 'Emoji';\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// 5.) \"The label must not begin with a combining mark, that is: General_Category=Mark.\"\r\n\t\t\t\t\tif (CM.has(norm[0])) throw error_placement('leading combining mark');\r\n\t\t\t\t\tfor (let i = 1; i < token_count; i++) { // we've already checked the first token\r\n\t\t\t\t\t\tlet cps = tokens[i];\r\n\t\t\t\t\t\tif (!cps.is_emoji && CM.has(cps[0])) { // every text token has emoji neighbors, eg. EtEEEtEt...\r\n\t\t\t\t\t\t\t// bidi_qq() not needed since emoji is LTR and cps is a CM\r\n\t\t\t\t\t\t\tthrow error_placement(`emoji + combining mark: \"${str_from_cps(tokens[i-1])} + ${safe_str_from_cps([cps[0]])}\"`); \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcheck_fenced(norm);\r\n\t\t\t\t\tlet unique = Array_from(new Set(chars));\r\n\t\t\t\t\tlet [g] = determine_group(unique); // take the first match\r\n\t\t\t\t\t// see derive: \"Matching Groups have Same CM Style\"\r\n\t\t\t\t\t// alternative: could form a hybrid type: Latin/Japanese/...\t\r\n\t\t\t\t\tcheck_group(g, chars); // need text in order\r\n\t\t\t\t\tcheck_whole(g, unique); // only need unique text (order would be required for multiple-char confusables)\r\n\t\t\t\t\ttype = g.N;\r\n\t\t\t\t\t// 20230121: consider exposing restricted flag\r\n\t\t\t\t\t// it's simpler to just check for 'Restricted'\r\n\t\t\t\t\t// or even better: type.endsWith(']')\r\n\t\t\t\t\t//if (g.R) info.restricted = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tinfo.type = type;\r\n\t\t} catch (err) {\r\n\t\t\tinfo.error = err; // use full error object\r\n\t\t}\r\n\t\treturn info;\r\n\t});\r\n}\r\n\r\nfunction check_whole(group, unique) {\r\n\tlet maker;\r\n\tlet shared = [];\r\n\tfor (let cp of unique) {\r\n\t\tlet whole = WHOLE_MAP.get(cp);\r\n\t\tif (whole === UNIQUE_PH) return; // unique, non-confusable\r\n\t\tif (whole) {\r\n\t\t\tlet set = whole.M.get(cp); // groups which have a character that look-like this character\r\n\t\t\tmaker = maker ? maker.filter(g => set.has(g)) : Array_from(set);\r\n\t\t\tif (!maker.length) return; // confusable intersection is empty\r\n\t\t} else {\r\n\t\t\tshared.push(cp); \r\n\t\t}\r\n\t}\r\n\tif (maker) {\r\n\t\t// we have 1+ confusable\r\n\t\t// check if any of the remaining groups\r\n\t\t// contain the shared characters too\r\n\t\tfor (let g of maker) {\r\n\t\t\tif (shared.every(cp => group_has_cp(g, cp))) {\r\n\t\t\t\tthrow new Error(`whole-script confusable: ${group.N}/${g.N}`);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n// assumption: unique.size > 0\r\n// returns list of matching groups\r\nfunction determine_group(unique) {\r\n\tlet groups = GROUPS;\r\n\tfor (let cp of unique) {\r\n\t\t// note: we need to dodge CM that are whitelisted\r\n\t\t// but that code isn't currently necessary\r\n\t\tlet gs = groups.filter(g => group_has_cp(g, cp));\r\n\t\tif (!gs.length) {\r\n\t\t\tif (!GROUPS.some(g => group_has_cp(g, cp))) { \r\n\t\t\t\t// the character was composed of valid parts\r\n\t\t\t\t// but it's NFC form is invalid\r\n\t\t\t\t// 20230716: change to more exact statement, see: ENSNormalize.{cs,java}\r\n\t\t\t\t// note: this doesn't have to be a composition\r\n\t\t\t\t// 20230720: change to full check\r\n\t\t\t\tthrow error_disallowed(cp); // this should be rare\r\n\t\t\t} else {\r\n\t\t\t\t// there is no group that contains all these characters\r\n\t\t\t\t// throw using the highest priority group that matched\r\n\t\t\t\t// https://www.unicode.org/reports/tr39/#mixed_script_confusables\r\n\t\t\t\tthrow error_group_member(groups[0], cp);\r\n\t\t\t}\r\n\t\t}\r\n\t\tgroups = gs;\r\n\t\tif (gs.length == 1) break; // there is only one group left\r\n\t}\r\n\t// there are at least 1 group(s) with all of these characters\r\n\treturn groups;\r\n}\r\n\r\n// throw on first error\r\nfunction flatten(split) {\r\n\treturn split.map(({input, error, output}) => {\r\n\t\tif (error) {\r\n\t\t\t// don't print label again if just a single label\r\n\t\t\tlet msg = error.message;\r\n\t\t\t// bidi_qq() only necessary if msg is digits\r\n\t\t\tthrow new Error(split.length == 1 ? msg : `Invalid label ${bidi_qq(safe_str_from_cps(input, 63))}: ${msg}`); \r\n\t\t}\r\n\t\treturn str_from_cps(output);\r\n\t}).join(STOP_CH);\r\n}\r\n\r\nfunction error_disallowed(cp) {\r\n\t// TODO: add cp to error?\r\n\treturn new Error(`disallowed character: ${quoted_cp(cp)}`); \r\n}\r\nfunction error_group_member(g, cp) {\r\n\tlet quoted = quoted_cp(cp);\r\n\tlet gg = GROUPS.find(g => g.P.has(cp)); // only check primary\r\n\tif (gg) {\r\n\t\tquoted = `${gg.N} ${quoted}`;\r\n\t}\r\n\treturn new Error(`illegal mixture: ${g.N} + ${quoted}`);\r\n}\r\nfunction error_placement(where) {\r\n\treturn new Error(`illegal placement: ${where}`);\r\n}\r\n\r\n// assumption: cps.length > 0\r\n// assumption: cps[0] isn't a CM\r\n// assumption: the previous character isn't an emoji\r\nfunction check_group(g, cps) {\r\n\tfor (let cp of cps) {\r\n\t\tif (!group_has_cp(g, cp)) {\r\n\t\t\t// for whitelisted scripts, this will throw illegal mixture on invalid cm, eg. \"e{300}{300}\"\r\n\t\t\t// at the moment, it's unnecessary to introduce an extra error type\r\n\t\t\t// until there exists a whitelisted multi-character\r\n\t\t\t// eg. if (M < 0 && is_combining_mark(cp)) { ... }\r\n\t\t\t// there are 3 cases:\r\n\t\t\t// 1. illegal cm for wrong group => mixture error\r\n\t\t\t// 2. illegal cm for same group => cm error\r\n\t\t\t// requires set of whitelist cm per group: \r\n\t\t\t// eg. new Set([...g.P, ...g.Q].flatMap(nfc).filter(cp => CM.has(cp)))\r\n\t\t\t// 3. wrong group => mixture error\r\n\t\t\tthrow error_group_member(g, cp);\r\n\t\t}\r\n\t}\r\n\t//if (M >= 0) { // we have a known fixed cm count\r\n\tif (g.M) { // we need to check for NSM\r\n\t\tlet decomposed = nfd(cps);\r\n\t\tfor (let i = 1, e = decomposed.length; i < e; i++) { // see: assumption\r\n\t\t\t// 20230210: bugfix: using cps instead of decomposed h/t Carbon225\r\n\t\t\t/*\r\n\t\t\tif (CM.has(decomposed[i])) {\r\n\t\t\t\tlet j = i + 1;\r\n\t\t\t\twhile (j < e && CM.has(decomposed[j])) j++;\r\n\t\t\t\tif (j - i > M) {\r\n\t\t\t\t\tthrow new Error(`too many combining marks: ${g.N} ${bidi_qq(str_from_cps(decomposed.slice(i-1, j)))} (${j-i}/${M})`);\r\n\t\t\t\t}\r\n\t\t\t\ti = j;\r\n\t\t\t}\r\n\t\t\t*/\r\n\t\t\t// 20230217: switch to NSM counting\r\n\t\t\t// https://www.unicode.org/reports/tr39/#Optional_Detection\r\n\t\t\tif (NSM.has(decomposed[i])) {\r\n\t\t\t\tlet j = i + 1;\r\n\t\t\t\tfor (let cp; j < e && NSM.has(cp = decomposed[j]); j++) {\r\n\t\t\t\t\t// a. Forbid sequences of the same nonspacing mark.\r\n\t\t\t\t\tfor (let k = i; k < j; k++) { // O(n^2) but n < 100\r\n\t\t\t\t\t\tif (decomposed[k] == cp) {\r\n\t\t\t\t\t\t\tthrow new Error(`duplicate non-spacing marks: ${quoted_cp(cp)}`);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// parse to end so we have full nsm count\r\n\t\t\t\t// b. Forbid sequences of more than 4 nonspacing marks (gc=Mn or gc=Me).\r\n\t\t\t\tif (j - i > NSM_MAX) {\r\n\t\t\t\t\t// note: this slice starts with a base char or spacing-mark cm\r\n\t\t\t\t\tthrow new Error(`excessive non-spacing marks: ${bidi_qq(safe_str_from_cps(decomposed.slice(i-1, j)))} (${j-i}/${NSM_MAX})`);\r\n\t\t\t\t}\r\n\t\t\t\ti = j;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t// *** this code currently isn't needed ***\r\n\t/*\r\n\tlet cm_whitelist = M instanceof Map;\r\n\tfor (let i = 0, e = cps.length; i < e; ) {\r\n\t\tlet cp = cps[i++];\r\n\t\tlet seqs = cm_whitelist && M.get(cp);\r\n\t\tif (seqs) { \r\n\t\t\t// list of codepoints that can follow\r\n\t\t\t// if this exists, this will always be 1+\r\n\t\t\tlet j = i;\r\n\t\t\twhile (j < e && CM.has(cps[j])) j++;\r\n\t\t\tlet cms = cps.slice(i, j);\r\n\t\t\tlet match = seqs.find(seq => !compare_arrays(seq, cms));\r\n\t\t\tif (!match) throw new Error(`disallowed combining mark sequence: \"${safe_str_from_cps([cp, ...cms])}\"`);\r\n\t\t\ti = j;\r\n\t\t} else if (!V.has(cp)) {\r\n\t\t\t// https://www.unicode.org/reports/tr39/#mixed_script_confusables\r\n\t\t\tlet quoted = quoted_cp(cp);\r\n\t\t\tfor (let cp of cps) {\r\n\t\t\t\tlet u = UNIQUE.get(cp);\r\n\t\t\t\tif (u && u !== g) {\r\n\t\t\t\t\t// if both scripts are restricted this error is confusing\r\n\t\t\t\t\t// because we don't differentiate RestrictedA from RestrictedB \r\n\t\t\t\t\tif (!u.R) quoted = `${quoted} is ${u.N}`;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthrow new Error(`disallowed ${g.N} character: ${quoted}`);\r\n\t\t\t//throw new Error(`disallowed character: ${quoted} (expected ${g.N})`);\r\n\t\t\t//throw new Error(`${g.N} does not allow: ${quoted}`);\r\n\t\t}\r\n\t}\r\n\tif (!cm_whitelist) {\r\n\t\tlet decomposed = nfd(cps);\r\n\t\tfor (let i = 1, e = decomposed.length; i < e; i++) { // we know it can't be cm leading\r\n\t\t\tif (CM.has(decomposed[i])) {\r\n\t\t\t\tlet j = i + 1;\r\n\t\t\t\twhile (j < e && CM.has(decomposed[j])) j++;\r\n\t\t\t\tif (j - i > M) {\r\n\t\t\t\t\tthrow new Error(`too many combining marks: \"${str_from_cps(decomposed.slice(i-1, j))}\" (${j-i}/${M})`);\r\n\t\t\t\t}\r\n\t\t\t\ti = j;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t*/\r\n}\r\n\r\n// given a list of codepoints\r\n// returns a list of lists, where emoji are a fully-qualified (as Array subclass)\r\n// eg. explode_cp(\"abc💩d\") => [[61, 62, 63], Emoji[1F4A9, FE0F], [64]]\r\n// 20230818: rename for 'process' name collision h/t Javarome\r\n// https://github.com/adraffy/ens-normalize.js/issues/23\r\nfunction tokens_from_str(input, nf, ef) {\r\n\tlet ret = [];\r\n\tlet chars = [];\r\n\tinput = input.slice().reverse(); // flip so we can pop\r\n\twhile (input.length) {\r\n\t\tlet emoji = consume_emoji_reversed(input);\r\n\t\tif (emoji) {\r\n\t\t\tif (chars.length) {\r\n\t\t\t\tret.push(nf(chars));\r\n\t\t\t\tchars = [];\r\n\t\t\t}\r\n\t\t\tret.push(ef(emoji));\r\n\t\t} else {\r\n\t\t\tlet cp = input.pop();\r\n\t\t\tif (VALID.has(cp)) {\r\n\t\t\t\tchars.push(cp);\r\n\t\t\t} else {\r\n\t\t\t\tlet cps = MAPPED.get(cp);\r\n\t\t\t\tif (cps) {\r\n\t\t\t\t\tchars.push(...cps); // less than 10 elements\r\n\t\t\t\t} else if (!IGNORED.has(cp)) {\r\n\t\t\t\t\t// 20230912: unicode 15.1 changed the order of processing such that\r\n\t\t\t\t\t// disallowed parts are only rejected after NFC\r\n\t\t\t\t\t// https://unicode.org/reports/tr46/#Validity_Criteria\r\n\t\t\t\t\t// this doesn't impact normalization as of today\r\n\t\t\t\t\t// technically, this error can be removed as the group logic will apply similar logic\r\n\t\t\t\t\t// however the error type might be less clear\r\n\t\t\t\t\tthrow error_disallowed(cp);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (chars.length) {\r\n\t\tret.push(nf(chars));\r\n\t}\r\n\treturn ret;\r\n}\r\n\r\nfunction filter_fe0f(cps) {\r\n\treturn cps.filter(cp => cp != FE0F);\r\n}\r\n\r\n// given array of codepoints\r\n// returns the longest valid emoji sequence (or undefined if no match)\r\n// *MUTATES* the supplied array\r\n// disallows interleaved ignored characters\r\n// fills (optional) eaten array with matched codepoints\r\nfunction consume_emoji_reversed(cps, eaten) {\r\n\tlet node = EMOJI_ROOT;\r\n\tlet emoji;\r\n\tlet pos = cps.length;\r\n\twhile (pos) {\r\n\t\tnode = node.get(cps[--pos]);\r\n\t\tif (!node) break;\r\n\t\tlet {V} = node;\r\n\t\tif (V) { // this is a valid emoji (so far)\r\n\t\t\temoji = V;\r\n\t\t\tif (eaten) eaten.push(...cps.slice(pos).reverse()); // (optional) copy input, used for ens_tokenize()\r\n\t\t\tcps.length = pos; // truncate\r\n\t\t}\r\n\t}\r\n\treturn emoji;\r\n}\r\n\r\n// ************************************************************\r\n// tokenizer \r\n\r\nconst TY_VALID = 'valid';\r\nconst TY_MAPPED = 'mapped';\r\nconst TY_IGNORED = 'ignored';\r\nconst TY_DISALLOWED = 'disallowed';\r\nconst TY_EMOJI = 'emoji';\r\nconst TY_NFC = 'nfc';\r\nconst TY_STOP = 'stop';\r\n\r\nfunction ens_tokenize(name, {\r\n\tnf = true, // collapse unnormalized runs into a single token\r\n} = {}) {\r\n\tinit();\r\n\tlet input = explode_cp(name).reverse();\r\n\tlet eaten = [];\r\n\tlet tokens = [];\r\n\twhile (input.length) {\r\n\t\tlet emoji = consume_emoji_reversed(input, eaten);\r\n\t\tif (emoji) {\r\n\t\t\ttokens.push({\r\n\t\t\t\ttype: TY_EMOJI,\r\n\t\t\t\temoji: emoji.slice(), // copy emoji\r\n\t\t\t\tinput: eaten,\r\n\t\t\t\tcps: filter_fe0f(emoji)\r\n\t\t\t});\r\n\t\t\teaten = []; // reset buffer\r\n\t\t} else {\r\n\t\t\tlet cp = input.pop();\r\n\t\t\tif (cp == STOP) {\r\n\t\t\t\ttokens.push({type: TY_STOP, cp});\r\n\t\t\t} else if (VALID.has(cp)) {\r\n\t\t\t\ttokens.push({type: TY_VALID, cps: [cp]});\r\n\t\t\t} else if (IGNORED.has(cp)) {\r\n\t\t\t\ttokens.push({type: TY_IGNORED, cp});\r\n\t\t\t} else {\r\n\t\t\t\tlet cps = MAPPED.get(cp);\r\n\t\t\t\tif (cps) {\r\n\t\t\t\t\ttokens.push({type: TY_MAPPED, cp, cps: cps.slice()});\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttokens.push({type: TY_DISALLOWED, cp});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (nf) {\r\n\t\tfor (let i = 0, start = -1; i < tokens.length; i++) {\r\n\t\t\tlet token = tokens[i];\r\n\t\t\tif (is_valid_or_mapped(token.type)) {\r\n\t\t\t\tif (requires_check(token.cps)) { // normalization might be needed\r\n\t\t\t\t\tlet end = i + 1;\r\n\t\t\t\t\tfor (let pos = end; pos < tokens.length; pos++) { // find adjacent text\r\n\t\t\t\t\t\tlet {type, cps} = tokens[pos];\r\n\t\t\t\t\t\tif (is_valid_or_mapped(type)) {\r\n\t\t\t\t\t\t\tif (!requires_check(cps)) break;\r\n\t\t\t\t\t\t\tend = pos + 1;\r\n\t\t\t\t\t\t} else if (type !== TY_IGNORED) { // || type !== TY_DISALLOWED) { \r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (start < 0) start = i;\r\n\t\t\t\t\tlet slice = tokens.slice(start, end);\r\n\t\t\t\t\tlet cps0 = slice.flatMap(x => is_valid_or_mapped(x.type) ? x.cps : []); // strip junk tokens\r\n\t\t\t\t\tlet cps = nfc(cps0);\r\n\t\t\t\t\tif (compare_arrays(cps, cps0)) { // bundle into an nfc token\r\n\t\t\t\t\t\ttokens.splice(start, end - start, {\r\n\t\t\t\t\t\t\ttype: TY_NFC, \r\n\t\t\t\t\t\t\tinput: cps0, // there are 3 states: tokens0 ==(process)=> input ==(nfc)=> tokens/cps\r\n\t\t\t\t\t\t\tcps, \r\n\t\t\t\t\t\t\ttokens0: collapse_valid_tokens(slice),\r\n\t\t\t\t\t\t\ttokens: ens_tokenize(str_from_cps(cps), {nf: false})\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\ti = start;\r\n\t\t\t\t\t} else { \r\n\t\t\t\t\t\ti = end - 1; // skip to end of slice\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstart = -1; // reset\r\n\t\t\t\t} else {\r\n\t\t\t\t\tstart = i; // remember last\r\n\t\t\t\t}\r\n\t\t\t} else if (token.type !== TY_IGNORED) { // 20221024: is this correct?\r\n\t\t\t\tstart = -1; // reset\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn collapse_valid_tokens(tokens);\r\n}\r\n\r\nfunction is_valid_or_mapped(type) {\r\n\treturn type == TY_VALID || type == TY_MAPPED;\r\n}\r\n\r\nfunction requires_check(cps) {\r\n\treturn cps.some(cp => NFC_CHECK.has(cp));\r\n}\r\n\r\nfunction collapse_valid_tokens(tokens) {\r\n\tfor (let i = 0; i < tokens.length; i++) {\r\n\t\tif (tokens[i].type == TY_VALID) {\r\n\t\t\tlet j = i + 1;\r\n\t\t\twhile (j < tokens.length && tokens[j].type == TY_VALID) j++;\r\n\t\t\ttokens.splice(i, j - i, {type: TY_VALID, cps: tokens.slice(i, j).flatMap(x => x.cps)});\r\n\t\t}\r\n\t}\r\n\treturn tokens;\r\n}\n\nexport { ens_beautify, ens_emoji, ens_normalize, ens_normalize_fragment, ens_split, ens_tokenize, is_combining_mark, nfc, nfd, safe_str_from_cps, should_escape };\n","import { keccak256 } from \"../crypto/index.js\";\nimport { concat, hexlify, assertArgument, toUtf8Bytes } from \"../utils/index.js\";\nimport { ens_normalize } from \"@adraffy/ens-normalize\";\nconst Zeros = new Uint8Array(32);\nZeros.fill(0);\nfunction checkComponent(comp) {\n assertArgument(comp.length !== 0, \"invalid ENS name; empty component\", \"comp\", comp);\n return comp;\n}\nfunction ensNameSplit(name) {\n const bytes = toUtf8Bytes(ensNormalize(name));\n const comps = [];\n if (name.length === 0) {\n return comps;\n }\n let last = 0;\n for (let i = 0; i < bytes.length; i++) {\n const d = bytes[i];\n // A separator (i.e. \".\"); copy this component\n if (d === 0x2e) {\n comps.push(checkComponent(bytes.slice(last, i)));\n last = i + 1;\n }\n }\n // There was a stray separator at the end of the name\n assertArgument(last < bytes.length, \"invalid ENS name; empty component\", \"name\", name);\n comps.push(checkComponent(bytes.slice(last)));\n return comps;\n}\n/**\n * Returns the ENS %%name%% normalized.\n */\nexport function ensNormalize(name) {\n try {\n if (name.length === 0) {\n throw new Error(\"empty label\");\n }\n return ens_normalize(name);\n }\n catch (error) {\n assertArgument(false, `invalid ENS name (${error.message})`, \"name\", name);\n }\n}\n/**\n * Returns ``true`` if %%name%% is a valid ENS name.\n */\nexport function isValidName(name) {\n try {\n return (ensNameSplit(name).length !== 0);\n }\n catch (error) { }\n return false;\n}\n/**\n * Returns the [[link-namehash]] for %%name%%.\n */\nexport function namehash(name) {\n assertArgument(typeof (name) === \"string\", \"invalid ENS name; not a string\", \"name\", name);\n assertArgument(name.length, `invalid ENS name (empty label)`, \"name\", name);\n let result = Zeros;\n const comps = ensNameSplit(name);\n while (comps.length) {\n result = keccak256(concat([result, keccak256((comps.pop()))]));\n }\n return hexlify(result);\n}\n/**\n * Returns the DNS encoded %%name%%.\n *\n * This is used for various parts of ENS name resolution, such\n * as the wildcard resolution.\n */\nexport function dnsEncode(name, _maxLength) {\n const length = (_maxLength != null) ? _maxLength : 63;\n assertArgument(length <= 255, \"DNS encoded label cannot exceed 255\", \"length\", length);\n return hexlify(concat(ensNameSplit(name).map((comp) => {\n assertArgument(comp.length <= length, `label ${JSON.stringify(name)} exceeds ${length} bytes`, \"name\", name);\n const bytes = new Uint8Array(comp.length + 1);\n bytes.set(comp, 1);\n bytes[0] = bytes.length - 1;\n return bytes;\n }))) + \"00\";\n}\n//# sourceMappingURL=namehash.js.map","import { keccak256 } from \"../crypto/index.js\";\nimport { MessagePrefix } from \"../constants/index.js\";\nimport { recoverAddress } from \"../transaction/index.js\";\nimport { concat, toUtf8Bytes } from \"../utils/index.js\";\n/**\n * Computes the [[link-eip-191]] personal-sign message digest to sign.\n *\n * This prefixes the message with [[MessagePrefix]] and the decimal length\n * of %%message%% and computes the [[keccak256]] digest.\n *\n * If %%message%% is a string, it is converted to its UTF-8 bytes\n * first. To compute the digest of a [[DataHexString]], it must be converted\n * to [bytes](getBytes).\n *\n * @example:\n * hashMessage(\"Hello World\")\n * //_result:\n *\n * // Hashes the SIX (6) string characters, i.e.\n * // [ \"0\", \"x\", \"4\", \"2\", \"4\", \"3\" ]\n * hashMessage(\"0x4243\")\n * //_result:\n *\n * // Hashes the TWO (2) bytes [ 0x42, 0x43 ]...\n * hashMessage(getBytes(\"0x4243\"))\n * //_result:\n *\n * // ...which is equal to using data\n * hashMessage(new Uint8Array([ 0x42, 0x43 ]))\n * //_result:\n *\n */\nexport function hashMessage(message) {\n if (typeof (message) === \"string\") {\n message = toUtf8Bytes(message);\n }\n return keccak256(concat([\n toUtf8Bytes(MessagePrefix),\n toUtf8Bytes(String(message.length)),\n message\n ]));\n}\n/**\n * Return the address of the private key that produced\n * the signature %%sig%% during signing for %%message%%.\n */\nexport function verifyMessage(message, sig) {\n const digest = hashMessage(message);\n return recoverAddress(digest, sig);\n}\n//# sourceMappingURL=message.js.map","import { getAddress } from \"../address/index.js\";\nimport { keccak256 as _keccak256, sha256 as _sha256 } from \"../crypto/index.js\";\nimport { concat, dataLength, getBytes, hexlify, toBeArray, toTwos, toUtf8Bytes, zeroPadBytes, zeroPadValue, assertArgument } from \"../utils/index.js\";\nconst regexBytes = new RegExp(\"^bytes([0-9]+)$\");\nconst regexNumber = new RegExp(\"^(u?int)([0-9]*)$\");\nconst regexArray = new RegExp(\"^(.*)\\\\[([0-9]*)\\\\]$\");\nfunction _pack(type, value, isArray) {\n switch (type) {\n case \"address\":\n if (isArray) {\n return getBytes(zeroPadValue(value, 32));\n }\n return getBytes(getAddress(value));\n case \"string\":\n return toUtf8Bytes(value);\n case \"bytes\":\n return getBytes(value);\n case \"bool\":\n value = (!!value ? \"0x01\" : \"0x00\");\n if (isArray) {\n return getBytes(zeroPadValue(value, 32));\n }\n return getBytes(value);\n }\n let match = type.match(regexNumber);\n if (match) {\n let signed = (match[1] === \"int\");\n let size = parseInt(match[2] || \"256\");\n assertArgument((!match[2] || match[2] === String(size)) && (size % 8 === 0) && size !== 0 && size <= 256, \"invalid number type\", \"type\", type);\n if (isArray) {\n size = 256;\n }\n if (signed) {\n value = toTwos(value, size);\n }\n return getBytes(zeroPadValue(toBeArray(value), size / 8));\n }\n match = type.match(regexBytes);\n if (match) {\n const size = parseInt(match[1]);\n assertArgument(String(size) === match[1] && size !== 0 && size <= 32, \"invalid bytes type\", \"type\", type);\n assertArgument(dataLength(value) === size, `invalid value for ${type}`, \"value\", value);\n if (isArray) {\n return getBytes(zeroPadBytes(value, 32));\n }\n return value;\n }\n match = type.match(regexArray);\n if (match && Array.isArray(value)) {\n const baseType = match[1];\n const count = parseInt(match[2] || String(value.length));\n assertArgument(count === value.length, `invalid array length for ${type}`, \"value\", value);\n const result = [];\n value.forEach(function (value) {\n result.push(_pack(baseType, value, true));\n });\n return getBytes(concat(result));\n }\n assertArgument(false, \"invalid type\", \"type\", type);\n}\n// @TODO: Array Enum\n/**\n * Computes the [[link-solc-packed]] representation of %%values%%\n * respectively to their %%types%%.\n *\n * @example:\n * addr = \"0x8ba1f109551bd432803012645ac136ddd64dba72\"\n * solidityPacked([ \"address\", \"uint\" ], [ addr, 45 ]);\n * //_result:\n */\nexport function solidityPacked(types, values) {\n assertArgument(types.length === values.length, \"wrong number of values; expected ${ types.length }\", \"values\", values);\n const tight = [];\n types.forEach(function (type, index) {\n tight.push(_pack(type, values[index]));\n });\n return hexlify(concat(tight));\n}\n/**\n * Computes the [[link-solc-packed]] [[keccak256]] hash of %%values%%\n * respectively to their %%types%%.\n *\n * @example:\n * addr = \"0x8ba1f109551bd432803012645ac136ddd64dba72\"\n * solidityPackedKeccak256([ \"address\", \"uint\" ], [ addr, 45 ]);\n * //_result:\n */\nexport function solidityPackedKeccak256(types, values) {\n return _keccak256(solidityPacked(types, values));\n}\n/**\n * Computes the [[link-solc-packed]] [[sha256]] hash of %%values%%\n * respectively to their %%types%%.\n *\n * @example:\n * addr = \"0x8ba1f109551bd432803012645ac136ddd64dba72\"\n * solidityPackedSha256([ \"address\", \"uint\" ], [ addr, 45 ]);\n * //_result:\n */\nexport function solidityPackedSha256(types, values) {\n return _sha256(solidityPacked(types, values));\n}\n//# sourceMappingURL=solidity.js.map","//import { TypedDataDomain, TypedDataField } from \"@ethersproject/providerabstract-signer\";\nimport { getAddress } from \"../address/index.js\";\nimport { keccak256 } from \"../crypto/index.js\";\nimport { recoverAddress } from \"../transaction/index.js\";\nimport { concat, defineProperties, getBigInt, getBytes, hexlify, isHexString, mask, toBeHex, toQuantity, toTwos, zeroPadValue, assertArgument } from \"../utils/index.js\";\nimport { id } from \"./id.js\";\nconst padding = new Uint8Array(32);\npadding.fill(0);\nconst BN__1 = BigInt(-1);\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_MAX_UINT256 = BigInt(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\n;\n;\nfunction hexPadRight(value) {\n const bytes = getBytes(value);\n const padOffset = bytes.length % 32;\n if (padOffset) {\n return concat([bytes, padding.slice(padOffset)]);\n }\n return hexlify(bytes);\n}\nconst hexTrue = toBeHex(BN_1, 32);\nconst hexFalse = toBeHex(BN_0, 32);\nconst domainFieldTypes = {\n name: \"string\",\n version: \"string\",\n chainId: \"uint256\",\n verifyingContract: \"address\",\n salt: \"bytes32\"\n};\nconst domainFieldNames = [\n \"name\", \"version\", \"chainId\", \"verifyingContract\", \"salt\"\n];\nfunction checkString(key) {\n return function (value) {\n assertArgument(typeof (value) === \"string\", `invalid domain value for ${JSON.stringify(key)}`, `domain.${key}`, value);\n return value;\n };\n}\nconst domainChecks = {\n name: checkString(\"name\"),\n version: checkString(\"version\"),\n chainId: function (_value) {\n const value = getBigInt(_value, \"domain.chainId\");\n assertArgument(value >= 0, \"invalid chain ID\", \"domain.chainId\", _value);\n if (Number.isSafeInteger(value)) {\n return Number(value);\n }\n return toQuantity(value);\n },\n verifyingContract: function (value) {\n try {\n return getAddress(value).toLowerCase();\n }\n catch (error) { }\n assertArgument(false, `invalid domain value \"verifyingContract\"`, \"domain.verifyingContract\", value);\n },\n salt: function (value) {\n const bytes = getBytes(value, \"domain.salt\");\n assertArgument(bytes.length === 32, `invalid domain value \"salt\"`, \"domain.salt\", value);\n return hexlify(bytes);\n }\n};\nfunction getBaseEncoder(type) {\n // intXX and uintXX\n {\n const match = type.match(/^(u?)int(\\d+)$/);\n if (match) {\n const signed = (match[1] === \"\");\n const width = parseInt(match[2]);\n assertArgument(width % 8 === 0 && width !== 0 && width <= 256 && match[2] === String(width), \"invalid numeric width\", \"type\", type);\n const boundsUpper = mask(BN_MAX_UINT256, signed ? (width - 1) : width);\n const boundsLower = signed ? ((boundsUpper + BN_1) * BN__1) : BN_0;\n return function (_value) {\n const value = getBigInt(_value, \"value\");\n assertArgument(value >= boundsLower && value <= boundsUpper, `value out-of-bounds for ${type}`, \"value\", value);\n return toBeHex(signed ? toTwos(value, 256) : value, 32);\n };\n }\n }\n // bytesXX\n {\n const match = type.match(/^bytes(\\d+)$/);\n if (match) {\n const width = parseInt(match[1]);\n assertArgument(width !== 0 && width <= 32 && match[1] === String(width), \"invalid bytes width\", \"type\", type);\n return function (value) {\n const bytes = getBytes(value);\n assertArgument(bytes.length === width, `invalid length for ${type}`, \"value\", value);\n return hexPadRight(value);\n };\n }\n }\n switch (type) {\n case \"address\": return function (value) {\n return zeroPadValue(getAddress(value), 32);\n };\n case \"bool\": return function (value) {\n return ((!value) ? hexFalse : hexTrue);\n };\n case \"bytes\": return function (value) {\n return keccak256(value);\n };\n case \"string\": return function (value) {\n return id(value);\n };\n }\n return null;\n}\nfunction encodeType(name, fields) {\n return `${name}(${fields.map(({ name, type }) => (type + \" \" + name)).join(\",\")})`;\n}\n// foo[][3] => { base: \"foo\", index: \"[][3]\", array: {\n// base: \"foo\", prefix: \"foo[]\", count: 3 } }\nfunction splitArray(type) {\n const match = type.match(/^([^\\x5b]*)((\\x5b\\d*\\x5d)*)(\\x5b(\\d*)\\x5d)$/);\n if (match) {\n return {\n base: match[1],\n index: (match[2] + match[4]),\n array: {\n base: match[1],\n prefix: (match[1] + match[2]),\n count: (match[5] ? parseInt(match[5]) : -1),\n }\n };\n }\n return { base: type };\n}\n/**\n * A **TypedDataEncode** prepares and encodes [[link-eip-712]] payloads\n * for signed typed data.\n *\n * This is useful for those that wish to compute various components of a\n * typed data hash, primary types, or sub-components, but generally the\n * higher level [[Signer-signTypedData]] is more useful.\n */\nexport class TypedDataEncoder {\n /**\n * The primary type for the structured [[types]].\n *\n * This is derived automatically from the [[types]], since no\n * recursion is possible, once the DAG for the types is consturcted\n * internally, the primary type must be the only remaining type with\n * no parent nodes.\n */\n primaryType;\n #types;\n /**\n * The types.\n */\n get types() {\n return JSON.parse(this.#types);\n }\n #fullTypes;\n #encoderCache;\n /**\n * Create a new **TypedDataEncoder** for %%types%%.\n *\n * This performs all necessary checking that types are valid and\n * do not violate the [[link-eip-712]] structural constraints as\n * well as computes the [[primaryType]].\n */\n constructor(_types) {\n this.#fullTypes = new Map();\n this.#encoderCache = new Map();\n // Link struct types to their direct child structs\n const links = new Map();\n // Link structs to structs which contain them as a child\n const parents = new Map();\n // Link all subtypes within a given struct\n const subtypes = new Map();\n const types = {};\n Object.keys(_types).forEach((type) => {\n types[type] = _types[type].map(({ name, type }) => {\n // Normalize the base type (unless name conflict)\n let { base, index } = splitArray(type);\n if (base === \"int\" && !_types[\"int\"]) {\n base = \"int256\";\n }\n if (base === \"uint\" && !_types[\"uint\"]) {\n base = \"uint256\";\n }\n return { name, type: (base + (index || \"\")) };\n });\n links.set(type, new Set());\n parents.set(type, []);\n subtypes.set(type, new Set());\n });\n this.#types = JSON.stringify(types);\n for (const name in types) {\n const uniqueNames = new Set();\n for (const field of types[name]) {\n // Check each field has a unique name\n assertArgument(!uniqueNames.has(field.name), `duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`, \"types\", _types);\n uniqueNames.add(field.name);\n // Get the base type (drop any array specifiers)\n const baseType = splitArray(field.type).base;\n assertArgument(baseType !== name, `circular type reference to ${JSON.stringify(baseType)}`, \"types\", _types);\n // Is this a base encoding type?\n const encoder = getBaseEncoder(baseType);\n if (encoder) {\n continue;\n }\n assertArgument(parents.has(baseType), `unknown type ${JSON.stringify(baseType)}`, \"types\", _types);\n // Add linkage\n parents.get(baseType).push(name);\n links.get(name).add(baseType);\n }\n }\n // Deduce the primary type\n const primaryTypes = Array.from(parents.keys()).filter((n) => (parents.get(n).length === 0));\n assertArgument(primaryTypes.length !== 0, \"missing primary type\", \"types\", _types);\n assertArgument(primaryTypes.length === 1, `ambiguous primary types or unused types: ${primaryTypes.map((t) => (JSON.stringify(t))).join(\", \")}`, \"types\", _types);\n defineProperties(this, { primaryType: primaryTypes[0] });\n // Check for circular type references\n function checkCircular(type, found) {\n assertArgument(!found.has(type), `circular type reference to ${JSON.stringify(type)}`, \"types\", _types);\n found.add(type);\n for (const child of links.get(type)) {\n if (!parents.has(child)) {\n continue;\n }\n // Recursively check children\n checkCircular(child, found);\n // Mark all ancestors as having this decendant\n for (const subtype of found) {\n subtypes.get(subtype).add(child);\n }\n }\n found.delete(type);\n }\n checkCircular(this.primaryType, new Set());\n // Compute each fully describe type\n for (const [name, set] of subtypes) {\n const st = Array.from(set);\n st.sort();\n this.#fullTypes.set(name, encodeType(name, types[name]) + st.map((t) => encodeType(t, types[t])).join(\"\"));\n }\n }\n /**\n * Returnthe encoder for the specific %%type%%.\n */\n getEncoder(type) {\n let encoder = this.#encoderCache.get(type);\n if (!encoder) {\n encoder = this.#getEncoder(type);\n this.#encoderCache.set(type, encoder);\n }\n return encoder;\n }\n #getEncoder(type) {\n // Basic encoder type (address, bool, uint256, etc)\n {\n const encoder = getBaseEncoder(type);\n if (encoder) {\n return encoder;\n }\n }\n // Array\n const array = splitArray(type).array;\n if (array) {\n const subtype = array.prefix;\n const subEncoder = this.getEncoder(subtype);\n return (value) => {\n assertArgument(array.count === -1 || array.count === value.length, `array length mismatch; expected length ${array.count}`, \"value\", value);\n let result = value.map(subEncoder);\n if (this.#fullTypes.has(subtype)) {\n result = result.map(keccak256);\n }\n return keccak256(concat(result));\n };\n }\n // Struct\n const fields = this.types[type];\n if (fields) {\n const encodedType = id(this.#fullTypes.get(type));\n return (value) => {\n const values = fields.map(({ name, type }) => {\n const result = this.getEncoder(type)(value[name]);\n if (this.#fullTypes.has(type)) {\n return keccak256(result);\n }\n return result;\n });\n values.unshift(encodedType);\n return concat(values);\n };\n }\n assertArgument(false, `unknown type: ${type}`, \"type\", type);\n }\n /**\n * Return the full type for %%name%%.\n */\n encodeType(name) {\n const result = this.#fullTypes.get(name);\n assertArgument(result, `unknown type: ${JSON.stringify(name)}`, \"name\", name);\n return result;\n }\n /**\n * Return the encoded %%value%% for the %%type%%.\n */\n encodeData(type, value) {\n return this.getEncoder(type)(value);\n }\n /**\n * Returns the hash of %%value%% for the type of %%name%%.\n */\n hashStruct(name, value) {\n return keccak256(this.encodeData(name, value));\n }\n /**\n * Return the fulled encoded %%value%% for the [[types]].\n */\n encode(value) {\n return this.encodeData(this.primaryType, value);\n }\n /**\n * Return the hash of the fully encoded %%value%% for the [[types]].\n */\n hash(value) {\n return this.hashStruct(this.primaryType, value);\n }\n /**\n * @_ignore:\n */\n _visit(type, value, callback) {\n // Basic encoder type (address, bool, uint256, etc)\n {\n const encoder = getBaseEncoder(type);\n if (encoder) {\n return callback(type, value);\n }\n }\n // Array\n const array = splitArray(type).array;\n if (array) {\n assertArgument(array.count === -1 || array.count === value.length, `array length mismatch; expected length ${array.count}`, \"value\", value);\n return value.map((v) => this._visit(array.prefix, v, callback));\n }\n // Struct\n const fields = this.types[type];\n if (fields) {\n return fields.reduce((accum, { name, type }) => {\n accum[name] = this._visit(type, value[name], callback);\n return accum;\n }, {});\n }\n assertArgument(false, `unknown type: ${type}`, \"type\", type);\n }\n /**\n * Call %%calback%% for each value in %%value%%, passing the type and\n * component within %%value%%.\n *\n * This is useful for replacing addresses or other transformation that\n * may be desired on each component, based on its type.\n */\n visit(value, callback) {\n return this._visit(this.primaryType, value, callback);\n }\n /**\n * Create a new **TypedDataEncoder** for %%types%%.\n */\n static from(types) {\n return new TypedDataEncoder(types);\n }\n /**\n * Return the primary type for %%types%%.\n */\n static getPrimaryType(types) {\n return TypedDataEncoder.from(types).primaryType;\n }\n /**\n * Return the hashed struct for %%value%% using %%types%% and %%name%%.\n */\n static hashStruct(name, types, value) {\n return TypedDataEncoder.from(types).hashStruct(name, value);\n }\n /**\n * Return the domain hash for %%domain%%.\n */\n static hashDomain(domain) {\n const domainFields = [];\n for (const name in domain) {\n if (domain[name] == null) {\n continue;\n }\n const type = domainFieldTypes[name];\n assertArgument(type, `invalid typed-data domain key: ${JSON.stringify(name)}`, \"domain\", domain);\n domainFields.push({ name, type });\n }\n domainFields.sort((a, b) => {\n return domainFieldNames.indexOf(a.name) - domainFieldNames.indexOf(b.name);\n });\n return TypedDataEncoder.hashStruct(\"EIP712Domain\", { EIP712Domain: domainFields }, domain);\n }\n /**\n * Return the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%.\n */\n static encode(domain, types, value) {\n return concat([\n \"0x1901\",\n TypedDataEncoder.hashDomain(domain),\n TypedDataEncoder.from(types).hash(value)\n ]);\n }\n /**\n * Return the hash of the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%.\n */\n static hash(domain, types, value) {\n return keccak256(TypedDataEncoder.encode(domain, types, value));\n }\n // Replaces all address types with ENS names with their looked up address\n /**\n * Resolves to the value from resolving all addresses in %%value%% for\n * %%types%% and the %%domain%%.\n */\n static async resolveNames(domain, types, value, resolveName) {\n // Make a copy to isolate it from the object passed in\n domain = Object.assign({}, domain);\n // Allow passing null to ignore value\n for (const key in domain) {\n if (domain[key] == null) {\n delete domain[key];\n }\n }\n // Look up all ENS names\n const ensCache = {};\n // Do we need to look up the domain's verifyingContract?\n if (domain.verifyingContract && !isHexString(domain.verifyingContract, 20)) {\n ensCache[domain.verifyingContract] = \"0x\";\n }\n // We are going to use the encoder to visit all the base values\n const encoder = TypedDataEncoder.from(types);\n // Get a list of all the addresses\n encoder.visit(value, (type, value) => {\n if (type === \"address\" && !isHexString(value, 20)) {\n ensCache[value] = \"0x\";\n }\n return value;\n });\n // Lookup each name\n for (const name in ensCache) {\n ensCache[name] = await resolveName(name);\n }\n // Replace the domain verifyingContract if needed\n if (domain.verifyingContract && ensCache[domain.verifyingContract]) {\n domain.verifyingContract = ensCache[domain.verifyingContract];\n }\n // Replace all ENS names with their address\n value = encoder.visit(value, (type, value) => {\n if (type === \"address\" && ensCache[value]) {\n return ensCache[value];\n }\n return value;\n });\n return { domain, value };\n }\n /**\n * Returns the JSON-encoded payload expected by nodes which implement\n * the JSON-RPC [[link-eip-712]] method.\n */\n static getPayload(domain, types, value) {\n // Validate the domain fields\n TypedDataEncoder.hashDomain(domain);\n // Derive the EIP712Domain Struct reference type\n const domainValues = {};\n const domainTypes = [];\n domainFieldNames.forEach((name) => {\n const value = domain[name];\n if (value == null) {\n return;\n }\n domainValues[name] = domainChecks[name](value);\n domainTypes.push({ name, type: domainFieldTypes[name] });\n });\n const encoder = TypedDataEncoder.from(types);\n // Get the normalized types\n types = encoder.types;\n const typesWithDomain = Object.assign({}, types);\n assertArgument(typesWithDomain.EIP712Domain == null, \"types must not contain EIP712Domain type\", \"types.EIP712Domain\", types);\n typesWithDomain.EIP712Domain = domainTypes;\n // Validate the data structures and types\n encoder.encode(value);\n return {\n types: typesWithDomain,\n domain: domainValues,\n primaryType: encoder.primaryType,\n message: encoder.visit(value, (type, value) => {\n // bytes\n if (type.match(/^bytes(\\d*)/)) {\n return hexlify(getBytes(value));\n }\n // uint or int\n if (type.match(/^u?int/)) {\n return getBigInt(value).toString();\n }\n switch (type) {\n case \"address\":\n return value.toLowerCase();\n case \"bool\":\n return !!value;\n case \"string\":\n assertArgument(typeof (value) === \"string\", \"invalid string\", \"value\", value);\n return value;\n }\n assertArgument(false, \"unsupported type\", \"type\", type);\n })\n };\n }\n}\n/**\n * Compute the address used to sign the typed data for the %%signature%%.\n */\nexport function verifyTypedData(domain, types, value, signature) {\n return recoverAddress(TypedDataEncoder.hash(domain, types, value), signature);\n}\n//# sourceMappingURL=typed-data.js.map","/**\n * A fragment is a single item from an ABI, which may represent any of:\n *\n * - [Functions](FunctionFragment)\n * - [Events](EventFragment)\n * - [Constructors](ConstructorFragment)\n * - Custom [Errors](ErrorFragment)\n * - [Fallback or Receive](FallbackFragment) functions\n *\n * @_subsection api/abi/abi-coder:Fragments [about-fragments]\n */\nimport { defineProperties, getBigInt, getNumber, assert, assertPrivate, assertArgument } from \"../utils/index.js\";\nimport { id } from \"../hash/index.js\";\n;\n// [ \"a\", \"b\" ] => { \"a\": 1, \"b\": 1 }\nfunction setify(items) {\n const result = new Set();\n items.forEach((k) => result.add(k));\n return Object.freeze(result);\n}\nconst _kwVisibDeploy = \"external public payable override\";\nconst KwVisibDeploy = setify(_kwVisibDeploy.split(\" \"));\n// Visibility Keywords\nconst _kwVisib = \"constant external internal payable private public pure view override\";\nconst KwVisib = setify(_kwVisib.split(\" \"));\nconst _kwTypes = \"constructor error event fallback function receive struct\";\nconst KwTypes = setify(_kwTypes.split(\" \"));\nconst _kwModifiers = \"calldata memory storage payable indexed\";\nconst KwModifiers = setify(_kwModifiers.split(\" \"));\nconst _kwOther = \"tuple returns\";\n// All Keywords\nconst _keywords = [_kwTypes, _kwModifiers, _kwOther, _kwVisib].join(\" \");\nconst Keywords = setify(_keywords.split(\" \"));\n// Single character tokens\nconst SimpleTokens = {\n \"(\": \"OPEN_PAREN\", \")\": \"CLOSE_PAREN\",\n \"[\": \"OPEN_BRACKET\", \"]\": \"CLOSE_BRACKET\",\n \",\": \"COMMA\", \"@\": \"AT\"\n};\n// Parser regexes to consume the next token\nconst regexWhitespacePrefix = new RegExp(\"^(\\\\s*)\");\nconst regexNumberPrefix = new RegExp(\"^([0-9]+)\");\nconst regexIdPrefix = new RegExp(\"^([a-zA-Z$_][a-zA-Z0-9$_]*)\");\n// Parser regexs to check validity\nconst regexId = new RegExp(\"^([a-zA-Z$_][a-zA-Z0-9$_]*)$\");\nconst regexType = new RegExp(\"^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$\");\nclass TokenString {\n #offset;\n #tokens;\n get offset() { return this.#offset; }\n get length() { return this.#tokens.length - this.#offset; }\n constructor(tokens) {\n this.#offset = 0;\n this.#tokens = tokens.slice();\n }\n clone() { return new TokenString(this.#tokens); }\n reset() { this.#offset = 0; }\n #subTokenString(from = 0, to = 0) {\n return new TokenString(this.#tokens.slice(from, to).map((t) => {\n return Object.freeze(Object.assign({}, t, {\n match: (t.match - from),\n linkBack: (t.linkBack - from),\n linkNext: (t.linkNext - from),\n }));\n }));\n }\n // Pops and returns the value of the next token, if it is a keyword in allowed; throws if out of tokens\n popKeyword(allowed) {\n const top = this.peek();\n if (top.type !== \"KEYWORD\" || !allowed.has(top.text)) {\n throw new Error(`expected keyword ${top.text}`);\n }\n return this.pop().text;\n }\n // Pops and returns the value of the next token if it is `type`; throws if out of tokens\n popType(type) {\n if (this.peek().type !== type) {\n const top = this.peek();\n throw new Error(`expected ${type}; got ${top.type} ${JSON.stringify(top.text)}`);\n }\n return this.pop().text;\n }\n // Pops and returns a \"(\" TOKENS \")\"\n popParen() {\n const top = this.peek();\n if (top.type !== \"OPEN_PAREN\") {\n throw new Error(\"bad start\");\n }\n const result = this.#subTokenString(this.#offset + 1, top.match + 1);\n this.#offset = top.match + 1;\n return result;\n }\n // Pops and returns the items within \"(\" ITEM1 \",\" ITEM2 \",\" ... \")\"\n popParams() {\n const top = this.peek();\n if (top.type !== \"OPEN_PAREN\") {\n throw new Error(\"bad start\");\n }\n const result = [];\n while (this.#offset < top.match - 1) {\n const link = this.peek().linkNext;\n result.push(this.#subTokenString(this.#offset + 1, link));\n this.#offset = link;\n }\n this.#offset = top.match + 1;\n return result;\n }\n // Returns the top Token, throwing if out of tokens\n peek() {\n if (this.#offset >= this.#tokens.length) {\n throw new Error(\"out-of-bounds\");\n }\n return this.#tokens[this.#offset];\n }\n // Returns the next value, if it is a keyword in `allowed`\n peekKeyword(allowed) {\n const top = this.peekType(\"KEYWORD\");\n return (top != null && allowed.has(top)) ? top : null;\n }\n // Returns the value of the next token if it is `type`\n peekType(type) {\n if (this.length === 0) {\n return null;\n }\n const top = this.peek();\n return (top.type === type) ? top.text : null;\n }\n // Returns the next token; throws if out of tokens\n pop() {\n const result = this.peek();\n this.#offset++;\n return result;\n }\n toString() {\n const tokens = [];\n for (let i = this.#offset; i < this.#tokens.length; i++) {\n const token = this.#tokens[i];\n tokens.push(`${token.type}:${token.text}`);\n }\n return ``;\n }\n}\nfunction lex(text) {\n const tokens = [];\n const throwError = (message) => {\n const token = (offset < text.length) ? JSON.stringify(text[offset]) : \"$EOI\";\n throw new Error(`invalid token ${token} at ${offset}: ${message}`);\n };\n let brackets = [];\n let commas = [];\n let offset = 0;\n while (offset < text.length) {\n // Strip off any leading whitespace\n let cur = text.substring(offset);\n let match = cur.match(regexWhitespacePrefix);\n if (match) {\n offset += match[1].length;\n cur = text.substring(offset);\n }\n const token = { depth: brackets.length, linkBack: -1, linkNext: -1, match: -1, type: \"\", text: \"\", offset, value: -1 };\n tokens.push(token);\n let type = (SimpleTokens[cur[0]] || \"\");\n if (type) {\n token.type = type;\n token.text = cur[0];\n offset++;\n if (type === \"OPEN_PAREN\") {\n brackets.push(tokens.length - 1);\n commas.push(tokens.length - 1);\n }\n else if (type == \"CLOSE_PAREN\") {\n if (brackets.length === 0) {\n throwError(\"no matching open bracket\");\n }\n token.match = brackets.pop();\n (tokens[token.match]).match = tokens.length - 1;\n token.depth--;\n token.linkBack = commas.pop();\n (tokens[token.linkBack]).linkNext = tokens.length - 1;\n }\n else if (type === \"COMMA\") {\n token.linkBack = commas.pop();\n (tokens[token.linkBack]).linkNext = tokens.length - 1;\n commas.push(tokens.length - 1);\n }\n else if (type === \"OPEN_BRACKET\") {\n token.type = \"BRACKET\";\n }\n else if (type === \"CLOSE_BRACKET\") {\n // Remove the CLOSE_BRACKET\n let suffix = tokens.pop().text;\n if (tokens.length > 0 && tokens[tokens.length - 1].type === \"NUMBER\") {\n const value = tokens.pop().text;\n suffix = value + suffix;\n (tokens[tokens.length - 1]).value = getNumber(value);\n }\n if (tokens.length === 0 || tokens[tokens.length - 1].type !== \"BRACKET\") {\n throw new Error(\"missing opening bracket\");\n }\n (tokens[tokens.length - 1]).text += suffix;\n }\n continue;\n }\n match = cur.match(regexIdPrefix);\n if (match) {\n token.text = match[1];\n offset += token.text.length;\n if (Keywords.has(token.text)) {\n token.type = \"KEYWORD\";\n continue;\n }\n if (token.text.match(regexType)) {\n token.type = \"TYPE\";\n continue;\n }\n token.type = \"ID\";\n continue;\n }\n match = cur.match(regexNumberPrefix);\n if (match) {\n token.text = match[1];\n token.type = \"NUMBER\";\n offset += token.text.length;\n continue;\n }\n throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset}`);\n }\n return new TokenString(tokens.map((t) => Object.freeze(t)));\n}\n// Check only one of `allowed` is in `set`\nfunction allowSingle(set, allowed) {\n let included = [];\n for (const key in allowed.keys()) {\n if (set.has(key)) {\n included.push(key);\n }\n }\n if (included.length > 1) {\n throw new Error(`conflicting types: ${included.join(\", \")}`);\n }\n}\n// Functions to process a Solidity Signature TokenString from left-to-right for...\n// ...the name with an optional type, returning the name\nfunction consumeName(type, tokens) {\n if (tokens.peekKeyword(KwTypes)) {\n const keyword = tokens.pop().text;\n if (keyword !== type) {\n throw new Error(`expected ${type}, got ${keyword}`);\n }\n }\n return tokens.popType(\"ID\");\n}\n// ...all keywords matching allowed, returning the keywords\nfunction consumeKeywords(tokens, allowed) {\n const keywords = new Set();\n while (true) {\n const keyword = tokens.peekType(\"KEYWORD\");\n if (keyword == null || (allowed && !allowed.has(keyword))) {\n break;\n }\n tokens.pop();\n if (keywords.has(keyword)) {\n throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`);\n }\n keywords.add(keyword);\n }\n return Object.freeze(keywords);\n}\n// ...all visibility keywords, returning the coalesced mutability\nfunction consumeMutability(tokens) {\n let modifiers = consumeKeywords(tokens, KwVisib);\n // Detect conflicting modifiers\n allowSingle(modifiers, setify(\"constant payable nonpayable\".split(\" \")));\n allowSingle(modifiers, setify(\"pure view payable nonpayable\".split(\" \")));\n // Process mutability states\n if (modifiers.has(\"view\")) {\n return \"view\";\n }\n if (modifiers.has(\"pure\")) {\n return \"pure\";\n }\n if (modifiers.has(\"payable\")) {\n return \"payable\";\n }\n if (modifiers.has(\"nonpayable\")) {\n return \"nonpayable\";\n }\n // Process legacy `constant` last\n if (modifiers.has(\"constant\")) {\n return \"view\";\n }\n return \"nonpayable\";\n}\n// ...a parameter list, returning the ParamType list\nfunction consumeParams(tokens, allowIndexed) {\n return tokens.popParams().map((t) => ParamType.from(t, allowIndexed));\n}\n// ...a gas limit, returning a BigNumber or null if none\nfunction consumeGas(tokens) {\n if (tokens.peekType(\"AT\")) {\n tokens.pop();\n if (tokens.peekType(\"NUMBER\")) {\n return getBigInt(tokens.pop().text);\n }\n throw new Error(\"invalid gas\");\n }\n return null;\n}\nfunction consumeEoi(tokens) {\n if (tokens.length) {\n throw new Error(`unexpected tokens at offset ${tokens.offset}: ${tokens.toString()}`);\n }\n}\nconst regexArrayType = new RegExp(/^(.*)\\[([0-9]*)\\]$/);\nfunction verifyBasicType(type) {\n const match = type.match(regexType);\n assertArgument(match, \"invalid type\", \"type\", type);\n if (type === \"uint\") {\n return \"uint256\";\n }\n if (type === \"int\") {\n return \"int256\";\n }\n if (match[2]) {\n // bytesXX\n const length = parseInt(match[2]);\n assertArgument(length !== 0 && length <= 32, \"invalid bytes length\", \"type\", type);\n }\n else if (match[3]) {\n // intXX or uintXX\n const size = parseInt(match[3]);\n assertArgument(size !== 0 && size <= 256 && (size % 8) === 0, \"invalid numeric width\", \"type\", type);\n }\n return type;\n}\n// Make the Fragment constructors effectively private\nconst _guard = {};\nconst internal = Symbol.for(\"_ethers_internal\");\nconst ParamTypeInternal = \"_ParamTypeInternal\";\nconst ErrorFragmentInternal = \"_ErrorInternal\";\nconst EventFragmentInternal = \"_EventInternal\";\nconst ConstructorFragmentInternal = \"_ConstructorInternal\";\nconst FallbackFragmentInternal = \"_FallbackInternal\";\nconst FunctionFragmentInternal = \"_FunctionInternal\";\nconst StructFragmentInternal = \"_StructInternal\";\n/**\n * Each input and output of a [[Fragment]] is an Array of **ParamType**.\n */\nexport class ParamType {\n /**\n * The local name of the parameter (or ``\"\"`` if unbound)\n */\n name;\n /**\n * The fully qualified type (e.g. ``\"address\"``, ``\"tuple(address)\"``,\n * ``\"uint256[3][]\"``)\n */\n type;\n /**\n * The base type (e.g. ``\"address\"``, ``\"tuple\"``, ``\"array\"``)\n */\n baseType;\n /**\n * True if the parameters is indexed.\n *\n * For non-indexable types this is ``null``.\n */\n indexed;\n /**\n * The components for the tuple.\n *\n * For non-tuple types this is ``null``.\n */\n components;\n /**\n * The array length, or ``-1`` for dynamic-lengthed arrays.\n *\n * For non-array types this is ``null``.\n */\n arrayLength;\n /**\n * The type of each child in the array.\n *\n * For non-array types this is ``null``.\n */\n arrayChildren;\n /**\n * @private\n */\n constructor(guard, name, type, baseType, indexed, components, arrayLength, arrayChildren) {\n assertPrivate(guard, _guard, \"ParamType\");\n Object.defineProperty(this, internal, { value: ParamTypeInternal });\n if (components) {\n components = Object.freeze(components.slice());\n }\n if (baseType === \"array\") {\n if (arrayLength == null || arrayChildren == null) {\n throw new Error(\"\");\n }\n }\n else if (arrayLength != null || arrayChildren != null) {\n throw new Error(\"\");\n }\n if (baseType === \"tuple\") {\n if (components == null) {\n throw new Error(\"\");\n }\n }\n else if (components != null) {\n throw new Error(\"\");\n }\n defineProperties(this, {\n name, type, baseType, indexed, components, arrayLength, arrayChildren\n });\n }\n /**\n * Return a string representation of this type.\n *\n * For example,\n *\n * ``sighash\" => \"(uint256,address)\"``\n *\n * ``\"minimal\" => \"tuple(uint256,address) indexed\"``\n *\n * ``\"full\" => \"tuple(uint256 foo, address bar) indexed baz\"``\n */\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n const name = this.name || \"\";\n if (this.isArray()) {\n const result = JSON.parse(this.arrayChildren.format(\"json\"));\n result.name = name;\n result.type += `[${(this.arrayLength < 0 ? \"\" : String(this.arrayLength))}]`;\n return JSON.stringify(result);\n }\n const result = {\n type: ((this.baseType === \"tuple\") ? \"tuple\" : this.type),\n name\n };\n if (typeof (this.indexed) === \"boolean\") {\n result.indexed = this.indexed;\n }\n if (this.isTuple()) {\n result.components = this.components.map((c) => JSON.parse(c.format(format)));\n }\n return JSON.stringify(result);\n }\n let result = \"\";\n // Array\n if (this.isArray()) {\n result += this.arrayChildren.format(format);\n result += `[${(this.arrayLength < 0 ? \"\" : String(this.arrayLength))}]`;\n }\n else {\n if (this.isTuple()) {\n result += \"(\" + this.components.map((comp) => comp.format(format)).join((format === \"full\") ? \", \" : \",\") + \")\";\n }\n else {\n result += this.type;\n }\n }\n if (format !== \"sighash\") {\n if (this.indexed === true) {\n result += \" indexed\";\n }\n if (format === \"full\" && this.name) {\n result += \" \" + this.name;\n }\n }\n return result;\n }\n /**\n * Returns true if %%this%% is an Array type.\n *\n * This provides a type gaurd ensuring that [[arrayChildren]]\n * and [[arrayLength]] are non-null.\n */\n isArray() {\n return (this.baseType === \"array\");\n }\n /**\n * Returns true if %%this%% is a Tuple type.\n *\n * This provides a type gaurd ensuring that [[components]]\n * is non-null.\n */\n isTuple() {\n return (this.baseType === \"tuple\");\n }\n /**\n * Returns true if %%this%% is an Indexable type.\n *\n * This provides a type gaurd ensuring that [[indexed]]\n * is non-null.\n */\n isIndexable() {\n return (this.indexed != null);\n }\n /**\n * Walks the **ParamType** with %%value%%, calling %%process%%\n * on each type, destructing the %%value%% recursively.\n */\n walk(value, process) {\n if (this.isArray()) {\n if (!Array.isArray(value)) {\n throw new Error(\"invalid array value\");\n }\n if (this.arrayLength !== -1 && value.length !== this.arrayLength) {\n throw new Error(\"array is wrong length\");\n }\n const _this = this;\n return value.map((v) => (_this.arrayChildren.walk(v, process)));\n }\n if (this.isTuple()) {\n if (!Array.isArray(value)) {\n throw new Error(\"invalid tuple value\");\n }\n if (value.length !== this.components.length) {\n throw new Error(\"array is wrong length\");\n }\n const _this = this;\n return value.map((v, i) => (_this.components[i].walk(v, process)));\n }\n return process(this.type, value);\n }\n #walkAsync(promises, value, process, setValue) {\n if (this.isArray()) {\n if (!Array.isArray(value)) {\n throw new Error(\"invalid array value\");\n }\n if (this.arrayLength !== -1 && value.length !== this.arrayLength) {\n throw new Error(\"array is wrong length\");\n }\n const childType = this.arrayChildren;\n const result = value.slice();\n result.forEach((value, index) => {\n childType.#walkAsync(promises, value, process, (value) => {\n result[index] = value;\n });\n });\n setValue(result);\n return;\n }\n if (this.isTuple()) {\n const components = this.components;\n // Convert the object into an array\n let result;\n if (Array.isArray(value)) {\n result = value.slice();\n }\n else {\n if (value == null || typeof (value) !== \"object\") {\n throw new Error(\"invalid tuple value\");\n }\n result = components.map((param) => {\n if (!param.name) {\n throw new Error(\"cannot use object value with unnamed components\");\n }\n if (!(param.name in value)) {\n throw new Error(`missing value for component ${param.name}`);\n }\n return value[param.name];\n });\n }\n if (result.length !== this.components.length) {\n throw new Error(\"array is wrong length\");\n }\n result.forEach((value, index) => {\n components[index].#walkAsync(promises, value, process, (value) => {\n result[index] = value;\n });\n });\n setValue(result);\n return;\n }\n const result = process(this.type, value);\n if (result.then) {\n promises.push((async function () { setValue(await result); })());\n }\n else {\n setValue(result);\n }\n }\n /**\n * Walks the **ParamType** with %%value%%, asynchronously calling\n * %%process%% on each type, destructing the %%value%% recursively.\n *\n * This can be used to resolve ENS names by walking and resolving each\n * ``\"address\"`` type.\n */\n async walkAsync(value, process) {\n const promises = [];\n const result = [value];\n this.#walkAsync(promises, value, process, (value) => {\n result[0] = value;\n });\n if (promises.length) {\n await Promise.all(promises);\n }\n return result[0];\n }\n /**\n * Creates a new **ParamType** for %%obj%%.\n *\n * If %%allowIndexed%% then the ``indexed`` keyword is permitted,\n * otherwise the ``indexed`` keyword will throw an error.\n */\n static from(obj, allowIndexed) {\n if (ParamType.isParamType(obj)) {\n return obj;\n }\n if (typeof (obj) === \"string\") {\n try {\n return ParamType.from(lex(obj), allowIndexed);\n }\n catch (error) {\n assertArgument(false, \"invalid param type\", \"obj\", obj);\n }\n }\n else if (obj instanceof TokenString) {\n let type = \"\", baseType = \"\";\n let comps = null;\n if (consumeKeywords(obj, setify([\"tuple\"])).has(\"tuple\") || obj.peekType(\"OPEN_PAREN\")) {\n // Tuple\n baseType = \"tuple\";\n comps = obj.popParams().map((t) => ParamType.from(t));\n type = `tuple(${comps.map((c) => c.format()).join(\",\")})`;\n }\n else {\n // Normal\n type = verifyBasicType(obj.popType(\"TYPE\"));\n baseType = type;\n }\n // Check for Array\n let arrayChildren = null;\n let arrayLength = null;\n while (obj.length && obj.peekType(\"BRACKET\")) {\n const bracket = obj.pop(); //arrays[i];\n arrayChildren = new ParamType(_guard, \"\", type, baseType, null, comps, arrayLength, arrayChildren);\n arrayLength = bracket.value;\n type += bracket.text;\n baseType = \"array\";\n comps = null;\n }\n let indexed = null;\n const keywords = consumeKeywords(obj, KwModifiers);\n if (keywords.has(\"indexed\")) {\n if (!allowIndexed) {\n throw new Error(\"\");\n }\n indexed = true;\n }\n const name = (obj.peekType(\"ID\") ? obj.pop().text : \"\");\n if (obj.length) {\n throw new Error(\"leftover tokens\");\n }\n return new ParamType(_guard, name, type, baseType, indexed, comps, arrayLength, arrayChildren);\n }\n const name = obj.name;\n assertArgument(!name || (typeof (name) === \"string\" && name.match(regexId)), \"invalid name\", \"obj.name\", name);\n let indexed = obj.indexed;\n if (indexed != null) {\n assertArgument(allowIndexed, \"parameter cannot be indexed\", \"obj.indexed\", obj.indexed);\n indexed = !!indexed;\n }\n let type = obj.type;\n let arrayMatch = type.match(regexArrayType);\n if (arrayMatch) {\n const arrayLength = parseInt(arrayMatch[2] || \"-1\");\n const arrayChildren = ParamType.from({\n type: arrayMatch[1],\n components: obj.components\n });\n return new ParamType(_guard, name || \"\", type, \"array\", indexed, null, arrayLength, arrayChildren);\n }\n if (type === \"tuple\" || type.startsWith(\"tuple(\" /* fix: ) */) || type.startsWith(\"(\" /* fix: ) */)) {\n const comps = (obj.components != null) ? obj.components.map((c) => ParamType.from(c)) : null;\n const tuple = new ParamType(_guard, name || \"\", type, \"tuple\", indexed, comps, null, null);\n // @TODO: use lexer to validate and normalize type\n return tuple;\n }\n type = verifyBasicType(obj.type);\n return new ParamType(_guard, name || \"\", type, type, indexed, null, null, null);\n }\n /**\n * Returns true if %%value%% is a **ParamType**.\n */\n static isParamType(value) {\n return (value && value[internal] === ParamTypeInternal);\n }\n}\n/**\n * An abstract class to represent An individual fragment from a parse ABI.\n */\nexport class Fragment {\n /**\n * The type of the fragment.\n */\n type;\n /**\n * The inputs for the fragment.\n */\n inputs;\n /**\n * @private\n */\n constructor(guard, type, inputs) {\n assertPrivate(guard, _guard, \"Fragment\");\n inputs = Object.freeze(inputs.slice());\n defineProperties(this, { type, inputs });\n }\n /**\n * Creates a new **Fragment** for %%obj%%, wich can be any supported\n * ABI frgament type.\n */\n static from(obj) {\n if (typeof (obj) === \"string\") {\n // Try parsing JSON...\n try {\n Fragment.from(JSON.parse(obj));\n }\n catch (e) { }\n // ...otherwise, use the human-readable lexer\n return Fragment.from(lex(obj));\n }\n if (obj instanceof TokenString) {\n // Human-readable ABI (already lexed)\n const type = obj.peekKeyword(KwTypes);\n switch (type) {\n case \"constructor\": return ConstructorFragment.from(obj);\n case \"error\": return ErrorFragment.from(obj);\n case \"event\": return EventFragment.from(obj);\n case \"fallback\":\n case \"receive\":\n return FallbackFragment.from(obj);\n case \"function\": return FunctionFragment.from(obj);\n case \"struct\": return StructFragment.from(obj);\n }\n }\n else if (typeof (obj) === \"object\") {\n // JSON ABI\n switch (obj.type) {\n case \"constructor\": return ConstructorFragment.from(obj);\n case \"error\": return ErrorFragment.from(obj);\n case \"event\": return EventFragment.from(obj);\n case \"fallback\":\n case \"receive\":\n return FallbackFragment.from(obj);\n case \"function\": return FunctionFragment.from(obj);\n case \"struct\": return StructFragment.from(obj);\n }\n assert(false, `unsupported type: ${obj.type}`, \"UNSUPPORTED_OPERATION\", {\n operation: \"Fragment.from\"\n });\n }\n assertArgument(false, \"unsupported frgament object\", \"obj\", obj);\n }\n /**\n * Returns true if %%value%% is a [[ConstructorFragment]].\n */\n static isConstructor(value) {\n return ConstructorFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is an [[ErrorFragment]].\n */\n static isError(value) {\n return ErrorFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is an [[EventFragment]].\n */\n static isEvent(value) {\n return EventFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is a [[FunctionFragment]].\n */\n static isFunction(value) {\n return FunctionFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is a [[StructFragment]].\n */\n static isStruct(value) {\n return StructFragment.isFragment(value);\n }\n}\n/**\n * An abstract class to represent An individual fragment\n * which has a name from a parse ABI.\n */\nexport class NamedFragment extends Fragment {\n /**\n * The name of the fragment.\n */\n name;\n /**\n * @private\n */\n constructor(guard, type, name, inputs) {\n super(guard, type, inputs);\n assertArgument(typeof (name) === \"string\" && name.match(regexId), \"invalid identifier\", \"name\", name);\n inputs = Object.freeze(inputs.slice());\n defineProperties(this, { name });\n }\n}\nfunction joinParams(format, params) {\n return \"(\" + params.map((p) => p.format(format)).join((format === \"full\") ? \", \" : \",\") + \")\";\n}\n/**\n * A Fragment which represents a //Custom Error//.\n */\nexport class ErrorFragment extends NamedFragment {\n /**\n * @private\n */\n constructor(guard, name, inputs) {\n super(guard, \"error\", name, inputs);\n Object.defineProperty(this, internal, { value: ErrorFragmentInternal });\n }\n /**\n * The Custom Error selector.\n */\n get selector() {\n return id(this.format(\"sighash\")).substring(0, 10);\n }\n /**\n * Returns a string representation of this fragment as %%format%%.\n */\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n return JSON.stringify({\n type: \"error\",\n name: this.name,\n inputs: this.inputs.map((input) => JSON.parse(input.format(format))),\n });\n }\n const result = [];\n if (format !== \"sighash\") {\n result.push(\"error\");\n }\n result.push(this.name + joinParams(format, this.inputs));\n return result.join(\" \");\n }\n /**\n * Returns a new **ErrorFragment** for %%obj%%.\n */\n static from(obj) {\n if (ErrorFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof (obj) === \"string\") {\n return ErrorFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"error\", obj);\n const inputs = consumeParams(obj);\n consumeEoi(obj);\n return new ErrorFragment(_guard, name, inputs);\n }\n return new ErrorFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []);\n }\n /**\n * Returns ``true`` and provides a type guard if %%value%% is an\n * **ErrorFragment**.\n */\n static isFragment(value) {\n return (value && value[internal] === ErrorFragmentInternal);\n }\n}\n/**\n * A Fragment which represents an Event.\n */\nexport class EventFragment extends NamedFragment {\n /**\n * Whether this event is anonymous.\n */\n anonymous;\n /**\n * @private\n */\n constructor(guard, name, inputs, anonymous) {\n super(guard, \"event\", name, inputs);\n Object.defineProperty(this, internal, { value: EventFragmentInternal });\n defineProperties(this, { anonymous });\n }\n /**\n * The Event topic hash.\n */\n get topicHash() {\n return id(this.format(\"sighash\"));\n }\n /**\n * Returns a string representation of this event as %%format%%.\n */\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n return JSON.stringify({\n type: \"event\",\n anonymous: this.anonymous,\n name: this.name,\n inputs: this.inputs.map((i) => JSON.parse(i.format(format)))\n });\n }\n const result = [];\n if (format !== \"sighash\") {\n result.push(\"event\");\n }\n result.push(this.name + joinParams(format, this.inputs));\n if (format !== \"sighash\" && this.anonymous) {\n result.push(\"anonymous\");\n }\n return result.join(\" \");\n }\n /**\n * Return the topic hash for an event with %%name%% and %%params%%.\n */\n static getTopicHash(name, params) {\n params = (params || []).map((p) => ParamType.from(p));\n const fragment = new EventFragment(_guard, name, params, false);\n return fragment.topicHash;\n }\n /**\n * Returns a new **EventFragment** for %%obj%%.\n */\n static from(obj) {\n if (EventFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof (obj) === \"string\") {\n try {\n return EventFragment.from(lex(obj));\n }\n catch (error) {\n assertArgument(false, \"invalid event fragment\", \"obj\", obj);\n }\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"event\", obj);\n const inputs = consumeParams(obj, true);\n const anonymous = !!consumeKeywords(obj, setify([\"anonymous\"])).has(\"anonymous\");\n consumeEoi(obj);\n return new EventFragment(_guard, name, inputs, anonymous);\n }\n return new EventFragment(_guard, obj.name, obj.inputs ? obj.inputs.map((p) => ParamType.from(p, true)) : [], !!obj.anonymous);\n }\n /**\n * Returns ``true`` and provides a type guard if %%value%% is an\n * **EventFragment**.\n */\n static isFragment(value) {\n return (value && value[internal] === EventFragmentInternal);\n }\n}\n/**\n * A Fragment which represents a constructor.\n */\nexport class ConstructorFragment extends Fragment {\n /**\n * Whether the constructor can receive an endowment.\n */\n payable;\n /**\n * The recommended gas limit for deployment or ``null``.\n */\n gas;\n /**\n * @private\n */\n constructor(guard, type, inputs, payable, gas) {\n super(guard, type, inputs);\n Object.defineProperty(this, internal, { value: ConstructorFragmentInternal });\n defineProperties(this, { payable, gas });\n }\n /**\n * Returns a string representation of this constructor as %%format%%.\n */\n format(format) {\n assert(format != null && format !== \"sighash\", \"cannot format a constructor for sighash\", \"UNSUPPORTED_OPERATION\", { operation: \"format(sighash)\" });\n if (format === \"json\") {\n return JSON.stringify({\n type: \"constructor\",\n stateMutability: (this.payable ? \"payable\" : \"undefined\"),\n payable: this.payable,\n gas: ((this.gas != null) ? this.gas : undefined),\n inputs: this.inputs.map((i) => JSON.parse(i.format(format)))\n });\n }\n const result = [`constructor${joinParams(format, this.inputs)}`];\n if (this.payable) {\n result.push(\"payable\");\n }\n if (this.gas != null) {\n result.push(`@${this.gas.toString()}`);\n }\n return result.join(\" \");\n }\n /**\n * Returns a new **ConstructorFragment** for %%obj%%.\n */\n static from(obj) {\n if (ConstructorFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof (obj) === \"string\") {\n try {\n return ConstructorFragment.from(lex(obj));\n }\n catch (error) {\n assertArgument(false, \"invalid constuctor fragment\", \"obj\", obj);\n }\n }\n else if (obj instanceof TokenString) {\n consumeKeywords(obj, setify([\"constructor\"]));\n const inputs = consumeParams(obj);\n const payable = !!consumeKeywords(obj, KwVisibDeploy).has(\"payable\");\n const gas = consumeGas(obj);\n consumeEoi(obj);\n return new ConstructorFragment(_guard, \"constructor\", inputs, payable, gas);\n }\n return new ConstructorFragment(_guard, \"constructor\", obj.inputs ? obj.inputs.map(ParamType.from) : [], !!obj.payable, (obj.gas != null) ? obj.gas : null);\n }\n /**\n * Returns ``true`` and provides a type guard if %%value%% is a\n * **ConstructorFragment**.\n */\n static isFragment(value) {\n return (value && value[internal] === ConstructorFragmentInternal);\n }\n}\n/**\n * A Fragment which represents a method.\n */\nexport class FallbackFragment extends Fragment {\n /**\n * If the function can be sent value during invocation.\n */\n payable;\n constructor(guard, inputs, payable) {\n super(guard, \"fallback\", inputs);\n Object.defineProperty(this, internal, { value: FallbackFragmentInternal });\n defineProperties(this, { payable });\n }\n /**\n * Returns a string representation of this fallback as %%format%%.\n */\n format(format) {\n const type = ((this.inputs.length === 0) ? \"receive\" : \"fallback\");\n if (format === \"json\") {\n const stateMutability = (this.payable ? \"payable\" : \"nonpayable\");\n return JSON.stringify({ type, stateMutability });\n }\n return `${type}()${this.payable ? \" payable\" : \"\"}`;\n }\n /**\n * Returns a new **FallbackFragment** for %%obj%%.\n */\n static from(obj) {\n if (FallbackFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof (obj) === \"string\") {\n try {\n return FallbackFragment.from(lex(obj));\n }\n catch (error) {\n assertArgument(false, \"invalid fallback fragment\", \"obj\", obj);\n }\n }\n else if (obj instanceof TokenString) {\n const errorObj = obj.toString();\n const topIsValid = obj.peekKeyword(setify([\"fallback\", \"receive\"]));\n assertArgument(topIsValid, \"type must be fallback or receive\", \"obj\", errorObj);\n const type = obj.popKeyword(setify([\"fallback\", \"receive\"]));\n // receive()\n if (type === \"receive\") {\n const inputs = consumeParams(obj);\n assertArgument(inputs.length === 0, `receive cannot have arguments`, \"obj.inputs\", inputs);\n consumeKeywords(obj, setify([\"payable\"]));\n consumeEoi(obj);\n return new FallbackFragment(_guard, [], true);\n }\n // fallback() [payable]\n // fallback(bytes) [payable] returns (bytes)\n let inputs = consumeParams(obj);\n if (inputs.length) {\n assertArgument(inputs.length === 1 && inputs[0].type === \"bytes\", \"invalid fallback inputs\", \"obj.inputs\", inputs.map((i) => i.format(\"minimal\")).join(\", \"));\n }\n else {\n inputs = [ParamType.from(\"bytes\")];\n }\n const mutability = consumeMutability(obj);\n assertArgument(mutability === \"nonpayable\" || mutability === \"payable\", \"fallback cannot be constants\", \"obj.stateMutability\", mutability);\n if (consumeKeywords(obj, setify([\"returns\"])).has(\"returns\")) {\n const outputs = consumeParams(obj);\n assertArgument(outputs.length === 1 && outputs[0].type === \"bytes\", \"invalid fallback outputs\", \"obj.outputs\", outputs.map((i) => i.format(\"minimal\")).join(\", \"));\n }\n consumeEoi(obj);\n return new FallbackFragment(_guard, inputs, mutability === \"payable\");\n }\n if (obj.type === \"receive\") {\n return new FallbackFragment(_guard, [], true);\n }\n if (obj.type === \"fallback\") {\n const inputs = [ParamType.from(\"bytes\")];\n const payable = (obj.stateMutability === \"payable\");\n return new FallbackFragment(_guard, inputs, payable);\n }\n assertArgument(false, \"invalid fallback description\", \"obj\", obj);\n }\n /**\n * Returns ``true`` and provides a type guard if %%value%% is a\n * **FallbackFragment**.\n */\n static isFragment(value) {\n return (value && value[internal] === FallbackFragmentInternal);\n }\n}\n/**\n * A Fragment which represents a method.\n */\nexport class FunctionFragment extends NamedFragment {\n /**\n * If the function is constant (e.g. ``pure`` or ``view`` functions).\n */\n constant;\n /**\n * The returned types for the result of calling this function.\n */\n outputs;\n /**\n * The state mutability (e.g. ``payable``, ``nonpayable``, ``view``\n * or ``pure``)\n */\n stateMutability;\n /**\n * If the function can be sent value during invocation.\n */\n payable;\n /**\n * The recommended gas limit to send when calling this function.\n */\n gas;\n /**\n * @private\n */\n constructor(guard, name, stateMutability, inputs, outputs, gas) {\n super(guard, \"function\", name, inputs);\n Object.defineProperty(this, internal, { value: FunctionFragmentInternal });\n outputs = Object.freeze(outputs.slice());\n const constant = (stateMutability === \"view\" || stateMutability === \"pure\");\n const payable = (stateMutability === \"payable\");\n defineProperties(this, { constant, gas, outputs, payable, stateMutability });\n }\n /**\n * The Function selector.\n */\n get selector() {\n return id(this.format(\"sighash\")).substring(0, 10);\n }\n /**\n * Returns a string representation of this function as %%format%%.\n */\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n return JSON.stringify({\n type: \"function\",\n name: this.name,\n constant: this.constant,\n stateMutability: ((this.stateMutability !== \"nonpayable\") ? this.stateMutability : undefined),\n payable: this.payable,\n gas: ((this.gas != null) ? this.gas : undefined),\n inputs: this.inputs.map((i) => JSON.parse(i.format(format))),\n outputs: this.outputs.map((o) => JSON.parse(o.format(format))),\n });\n }\n const result = [];\n if (format !== \"sighash\") {\n result.push(\"function\");\n }\n result.push(this.name + joinParams(format, this.inputs));\n if (format !== \"sighash\") {\n if (this.stateMutability !== \"nonpayable\") {\n result.push(this.stateMutability);\n }\n if (this.outputs && this.outputs.length) {\n result.push(\"returns\");\n result.push(joinParams(format, this.outputs));\n }\n if (this.gas != null) {\n result.push(`@${this.gas.toString()}`);\n }\n }\n return result.join(\" \");\n }\n /**\n * Return the selector for a function with %%name%% and %%params%%.\n */\n static getSelector(name, params) {\n params = (params || []).map((p) => ParamType.from(p));\n const fragment = new FunctionFragment(_guard, name, \"view\", params, [], null);\n return fragment.selector;\n }\n /**\n * Returns a new **FunctionFragment** for %%obj%%.\n */\n static from(obj) {\n if (FunctionFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof (obj) === \"string\") {\n try {\n return FunctionFragment.from(lex(obj));\n }\n catch (error) {\n assertArgument(false, \"invalid function fragment\", \"obj\", obj);\n }\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"function\", obj);\n const inputs = consumeParams(obj);\n const mutability = consumeMutability(obj);\n let outputs = [];\n if (consumeKeywords(obj, setify([\"returns\"])).has(\"returns\")) {\n outputs = consumeParams(obj);\n }\n const gas = consumeGas(obj);\n consumeEoi(obj);\n return new FunctionFragment(_guard, name, mutability, inputs, outputs, gas);\n }\n let stateMutability = obj.stateMutability;\n // Use legacy Solidity ABI logic if stateMutability is missing\n if (stateMutability == null) {\n stateMutability = \"payable\";\n if (typeof (obj.constant) === \"boolean\") {\n stateMutability = \"view\";\n if (!obj.constant) {\n stateMutability = \"payable\";\n if (typeof (obj.payable) === \"boolean\" && !obj.payable) {\n stateMutability = \"nonpayable\";\n }\n }\n }\n else if (typeof (obj.payable) === \"boolean\" && !obj.payable) {\n stateMutability = \"nonpayable\";\n }\n }\n // @TODO: verifyState for stateMutability (e.g. throw if\n // payable: false but stateMutability is \"nonpayable\")\n return new FunctionFragment(_guard, obj.name, stateMutability, obj.inputs ? obj.inputs.map(ParamType.from) : [], obj.outputs ? obj.outputs.map(ParamType.from) : [], (obj.gas != null) ? obj.gas : null);\n }\n /**\n * Returns ``true`` and provides a type guard if %%value%% is a\n * **FunctionFragment**.\n */\n static isFragment(value) {\n return (value && value[internal] === FunctionFragmentInternal);\n }\n}\n/**\n * A Fragment which represents a structure.\n */\nexport class StructFragment extends NamedFragment {\n /**\n * @private\n */\n constructor(guard, name, inputs) {\n super(guard, \"struct\", name, inputs);\n Object.defineProperty(this, internal, { value: StructFragmentInternal });\n }\n /**\n * Returns a string representation of this struct as %%format%%.\n */\n format() {\n throw new Error(\"@TODO\");\n }\n /**\n * Returns a new **StructFragment** for %%obj%%.\n */\n static from(obj) {\n if (typeof (obj) === \"string\") {\n try {\n return StructFragment.from(lex(obj));\n }\n catch (error) {\n assertArgument(false, \"invalid struct fragment\", \"obj\", obj);\n }\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"struct\", obj);\n const inputs = consumeParams(obj);\n consumeEoi(obj);\n return new StructFragment(_guard, name, inputs);\n }\n return new StructFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []);\n }\n // @TODO: fix this return type\n /**\n * Returns ``true`` and provides a type guard if %%value%% is a\n * **StructFragment**.\n */\n static isFragment(value) {\n return (value && value[internal] === StructFragmentInternal);\n }\n}\n//# sourceMappingURL=fragments.js.map","/**\n * When sending values to or receiving values from a [[Contract]], the\n * data is generally encoded using the [ABI standard](link-solc-abi).\n *\n * The AbiCoder provides a utility to encode values to ABI data and\n * decode values from ABI data.\n *\n * Most of the time, developers should favour the [[Contract]] class,\n * which further abstracts a lot of the finer details of ABI data.\n *\n * @_section api/abi/abi-coder:ABI Encoding\n */\n// See: https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI\nimport { assertArgumentCount, assertArgument } from \"../utils/index.js\";\nimport { Reader, Writer } from \"./coders/abstract-coder.js\";\nimport { AddressCoder } from \"./coders/address.js\";\nimport { ArrayCoder } from \"./coders/array.js\";\nimport { BooleanCoder } from \"./coders/boolean.js\";\nimport { BytesCoder } from \"./coders/bytes.js\";\nimport { FixedBytesCoder } from \"./coders/fixed-bytes.js\";\nimport { NullCoder } from \"./coders/null.js\";\nimport { NumberCoder } from \"./coders/number.js\";\nimport { StringCoder } from \"./coders/string.js\";\nimport { TupleCoder } from \"./coders/tuple.js\";\nimport { ParamType } from \"./fragments.js\";\nimport { getAddress } from \"../address/index.js\";\nimport { getBytes, hexlify, makeError } from \"../utils/index.js\";\n// https://docs.soliditylang.org/en/v0.8.17/control-structures.html\nconst PanicReasons = new Map();\nPanicReasons.set(0x00, \"GENERIC_PANIC\");\nPanicReasons.set(0x01, \"ASSERT_FALSE\");\nPanicReasons.set(0x11, \"OVERFLOW\");\nPanicReasons.set(0x12, \"DIVIDE_BY_ZERO\");\nPanicReasons.set(0x21, \"ENUM_RANGE_ERROR\");\nPanicReasons.set(0x22, \"BAD_STORAGE_DATA\");\nPanicReasons.set(0x31, \"STACK_UNDERFLOW\");\nPanicReasons.set(0x32, \"ARRAY_RANGE_ERROR\");\nPanicReasons.set(0x41, \"OUT_OF_MEMORY\");\nPanicReasons.set(0x51, \"UNINITIALIZED_FUNCTION_CALL\");\nconst paramTypeBytes = new RegExp(/^bytes([0-9]*)$/);\nconst paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/);\nlet defaultCoder = null;\nlet defaultMaxInflation = 1024;\nfunction getBuiltinCallException(action, tx, data, abiCoder) {\n let message = \"missing revert data\";\n let reason = null;\n const invocation = null;\n let revert = null;\n if (data) {\n message = \"execution reverted\";\n const bytes = getBytes(data);\n data = hexlify(data);\n if (bytes.length === 0) {\n message += \" (no data present; likely require(false) occurred\";\n reason = \"require(false)\";\n }\n else if (bytes.length % 32 !== 4) {\n message += \" (could not decode reason; invalid data length)\";\n }\n else if (hexlify(bytes.slice(0, 4)) === \"0x08c379a0\") {\n // Error(string)\n try {\n reason = abiCoder.decode([\"string\"], bytes.slice(4))[0];\n revert = {\n signature: \"Error(string)\",\n name: \"Error\",\n args: [reason]\n };\n message += `: ${JSON.stringify(reason)}`;\n }\n catch (error) {\n message += \" (could not decode reason; invalid string data)\";\n }\n }\n else if (hexlify(bytes.slice(0, 4)) === \"0x4e487b71\") {\n // Panic(uint256)\n try {\n const code = Number(abiCoder.decode([\"uint256\"], bytes.slice(4))[0]);\n revert = {\n signature: \"Panic(uint256)\",\n name: \"Panic\",\n args: [code]\n };\n reason = `Panic due to ${PanicReasons.get(code) || \"UNKNOWN\"}(${code})`;\n message += `: ${reason}`;\n }\n catch (error) {\n message += \" (could not decode panic code)\";\n }\n }\n else {\n message += \" (unknown custom error)\";\n }\n }\n const transaction = {\n to: (tx.to ? getAddress(tx.to) : null),\n data: (tx.data || \"0x\")\n };\n if (tx.from) {\n transaction.from = getAddress(tx.from);\n }\n return makeError(message, \"CALL_EXCEPTION\", {\n action, data, reason, transaction, invocation, revert\n });\n}\n/**\n * The **AbiCoder** is a low-level class responsible for encoding JavaScript\n * values into binary data and decoding binary data into JavaScript values.\n */\nexport class AbiCoder {\n #getCoder(param) {\n if (param.isArray()) {\n return new ArrayCoder(this.#getCoder(param.arrayChildren), param.arrayLength, param.name);\n }\n if (param.isTuple()) {\n return new TupleCoder(param.components.map((c) => this.#getCoder(c)), param.name);\n }\n switch (param.baseType) {\n case \"address\":\n return new AddressCoder(param.name);\n case \"bool\":\n return new BooleanCoder(param.name);\n case \"string\":\n return new StringCoder(param.name);\n case \"bytes\":\n return new BytesCoder(param.name);\n case \"\":\n return new NullCoder(param.name);\n }\n // u?int[0-9]*\n let match = param.type.match(paramTypeNumber);\n if (match) {\n let size = parseInt(match[2] || \"256\");\n assertArgument(size !== 0 && size <= 256 && (size % 8) === 0, \"invalid \" + match[1] + \" bit length\", \"param\", param);\n return new NumberCoder(size / 8, (match[1] === \"int\"), param.name);\n }\n // bytes[0-9]+\n match = param.type.match(paramTypeBytes);\n if (match) {\n let size = parseInt(match[1]);\n assertArgument(size !== 0 && size <= 32, \"invalid bytes length\", \"param\", param);\n return new FixedBytesCoder(size, param.name);\n }\n assertArgument(false, \"invalid type\", \"type\", param.type);\n }\n /**\n * Get the default values for the given %%types%%.\n *\n * For example, a ``uint`` is by default ``0`` and ``bool``\n * is by default ``false``.\n */\n getDefaultValue(types) {\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n return coder.defaultValue();\n }\n /**\n * Encode the %%values%% as the %%types%% into ABI data.\n *\n * @returns DataHexstring\n */\n encode(types, values) {\n assertArgumentCount(values.length, types.length, \"types/values length mismatch\");\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = (new TupleCoder(coders, \"_\"));\n const writer = new Writer();\n coder.encode(writer, values);\n return writer.data;\n }\n /**\n * Decode the ABI %%data%% as the %%types%% into values.\n *\n * If %%loose%% decoding is enabled, then strict padding is\n * not enforced. Some older versions of Solidity incorrectly\n * padded event data emitted from ``external`` functions.\n */\n decode(types, data, loose) {\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n return coder.decode(new Reader(data, loose, defaultMaxInflation));\n }\n static _setDefaultMaxInflation(value) {\n assertArgument(typeof (value) === \"number\" && Number.isInteger(value), \"invalid defaultMaxInflation factor\", \"value\", value);\n defaultMaxInflation = value;\n }\n /**\n * Returns the shared singleton instance of a default [[AbiCoder]].\n *\n * On the first call, the instance is created internally.\n */\n static defaultAbiCoder() {\n if (defaultCoder == null) {\n defaultCoder = new AbiCoder();\n }\n return defaultCoder;\n }\n /**\n * Returns an ethers-compatible [[CallExceptionError]] Error for the given\n * result %%data%% for the [[CallExceptionAction]] %%action%% against\n * the Transaction %%tx%%.\n */\n static getBuiltinCallException(action, tx, data) {\n return getBuiltinCallException(action, tx, data, AbiCoder.defaultAbiCoder());\n }\n}\n//# sourceMappingURL=abi-coder.js.map","/**\n * About bytes32 strings...\n *\n * @_docloc: api/utils:Bytes32 Strings\n */\nimport { getBytes, toUtf8Bytes, toUtf8String, zeroPadBytes } from \"../utils/index.js\";\n/**\n * Encodes %%text%% as a Bytes32 string.\n */\nexport function encodeBytes32String(text) {\n // Get the bytes\n const bytes = toUtf8Bytes(text);\n // Check we have room for null-termination\n if (bytes.length > 31) {\n throw new Error(\"bytes32 string must be less than 32 bytes\");\n }\n // Zero-pad (implicitly null-terminates)\n return zeroPadBytes(bytes, 32);\n}\n/**\n * Encodes the Bytes32-encoded %%bytes%% into a string.\n */\nexport function decodeBytes32String(_bytes) {\n const data = getBytes(_bytes, \"bytes\");\n // Must be 32 bytes with a null-termination\n if (data.length !== 32) {\n throw new Error(\"invalid bytes32 - not 32 bytes long\");\n }\n if (data[31] !== 0) {\n throw new Error(\"invalid bytes32 string - no null terminator\");\n }\n // Find the null termination\n let length = 31;\n while (data[length - 1] === 0) {\n length--;\n }\n // Determine the string value\n return toUtf8String(data.slice(0, length));\n}\n//# sourceMappingURL=bytes32.js.map","/**\n * The Interface class is a low-level class that accepts an\n * ABI and provides all the necessary functionality to encode\n * and decode paramaters to and results from methods, events\n * and errors.\n *\n * It also provides several convenience methods to automatically\n * search and find matching transactions and events to parse them.\n *\n * @_subsection api/abi:Interfaces [interfaces]\n */\nimport { keccak256 } from \"../crypto/index.js\";\nimport { id } from \"../hash/index.js\";\nimport { concat, dataSlice, getBigInt, getBytes, getBytesCopy, hexlify, zeroPadBytes, zeroPadValue, isHexString, defineProperties, assertArgument, toBeHex, assert } from \"../utils/index.js\";\nimport { AbiCoder } from \"./abi-coder.js\";\nimport { checkResultErrors, Result } from \"./coders/abstract-coder.js\";\nimport { ConstructorFragment, ErrorFragment, EventFragment, Fragment, FunctionFragment, ParamType } from \"./fragments.js\";\nimport { Typed } from \"./typed.js\";\nexport { checkResultErrors, Result };\n/**\n * When using the [[Interface-parseLog]] to automatically match a Log to its event\n * for parsing, a **LogDescription** is returned.\n */\nexport class LogDescription {\n /**\n * The matching fragment for the ``topic0``.\n */\n fragment;\n /**\n * The name of the Event.\n */\n name;\n /**\n * The full Event signature.\n */\n signature;\n /**\n * The topic hash for the Event.\n */\n topic;\n /**\n * The arguments passed into the Event with ``emit``.\n */\n args;\n /**\n * @_ignore:\n */\n constructor(fragment, topic, args) {\n const name = fragment.name, signature = fragment.format();\n defineProperties(this, {\n fragment, name, signature, topic, args\n });\n }\n}\n/**\n * When using the [[Interface-parseTransaction]] to automatically match\n * a transaction data to its function for parsing,\n * a **TransactionDescription** is returned.\n */\nexport class TransactionDescription {\n /**\n * The matching fragment from the transaction ``data``.\n */\n fragment;\n /**\n * The name of the Function from the transaction ``data``.\n */\n name;\n /**\n * The arguments passed to the Function from the transaction ``data``.\n */\n args;\n /**\n * The full Function signature from the transaction ``data``.\n */\n signature;\n /**\n * The selector for the Function from the transaction ``data``.\n */\n selector;\n /**\n * The ``value`` (in wei) from the transaction.\n */\n value;\n /**\n * @_ignore:\n */\n constructor(fragment, selector, args, value) {\n const name = fragment.name, signature = fragment.format();\n defineProperties(this, {\n fragment, name, args, signature, selector, value\n });\n }\n}\n/**\n * When using the [[Interface-parseError]] to automatically match an\n * error for a call result for parsing, an **ErrorDescription** is returned.\n */\nexport class ErrorDescription {\n /**\n * The matching fragment.\n */\n fragment;\n /**\n * The name of the Error.\n */\n name;\n /**\n * The arguments passed to the Error with ``revert``.\n */\n args;\n /**\n * The full Error signature.\n */\n signature;\n /**\n * The selector for the Error.\n */\n selector;\n /**\n * @_ignore:\n */\n constructor(fragment, selector, args) {\n const name = fragment.name, signature = fragment.format();\n defineProperties(this, {\n fragment, name, args, signature, selector\n });\n }\n}\n/**\n * An **Indexed** is used as a value when a value that does not\n * fit within a topic (i.e. not a fixed-length, 32-byte type). It\n * is the ``keccak256`` of the value, and used for types such as\n * arrays, tuples, bytes and strings.\n */\nexport class Indexed {\n /**\n * The ``keccak256`` of the value logged.\n */\n hash;\n /**\n * @_ignore:\n */\n _isIndexed;\n /**\n * Returns ``true`` if %%value%% is an **Indexed**.\n *\n * This provides a Type Guard for property access.\n */\n static isIndexed(value) {\n return !!(value && value._isIndexed);\n }\n /**\n * @_ignore:\n */\n constructor(hash) {\n defineProperties(this, { hash, _isIndexed: true });\n }\n}\n// https://docs.soliditylang.org/en/v0.8.13/control-structures.html?highlight=panic#panic-via-assert-and-error-via-require\nconst PanicReasons = {\n \"0\": \"generic panic\",\n \"1\": \"assert(false)\",\n \"17\": \"arithmetic overflow\",\n \"18\": \"division or modulo by zero\",\n \"33\": \"enum overflow\",\n \"34\": \"invalid encoded storage byte array accessed\",\n \"49\": \"out-of-bounds array access; popping on an empty array\",\n \"50\": \"out-of-bounds access of an array or bytesN\",\n \"65\": \"out of memory\",\n \"81\": \"uninitialized function\",\n};\nconst BuiltinErrors = {\n \"0x08c379a0\": {\n signature: \"Error(string)\",\n name: \"Error\",\n inputs: [\"string\"],\n reason: (message) => {\n return `reverted with reason string ${JSON.stringify(message)}`;\n }\n },\n \"0x4e487b71\": {\n signature: \"Panic(uint256)\",\n name: \"Panic\",\n inputs: [\"uint256\"],\n reason: (code) => {\n let reason = \"unknown panic code\";\n if (code >= 0 && code <= 0xff && PanicReasons[code.toString()]) {\n reason = PanicReasons[code.toString()];\n }\n return `reverted with panic code 0x${code.toString(16)} (${reason})`;\n }\n }\n};\n/**\n * An Interface abstracts many of the low-level details for\n * encoding and decoding the data on the blockchain.\n *\n * An ABI provides information on how to encode data to send to\n * a Contract, how to decode the results and events and how to\n * interpret revert errors.\n *\n * The ABI can be specified by [any supported format](InterfaceAbi).\n */\nexport class Interface {\n /**\n * All the Contract ABI members (i.e. methods, events, errors, etc).\n */\n fragments;\n /**\n * The Contract constructor.\n */\n deploy;\n /**\n * The Fallback method, if any.\n */\n fallback;\n /**\n * If receiving ether is supported.\n */\n receive;\n #errors;\n #events;\n #functions;\n // #structs: Map;\n #abiCoder;\n /**\n * Create a new Interface for the %%fragments%%.\n */\n constructor(fragments) {\n let abi = [];\n if (typeof (fragments) === \"string\") {\n abi = JSON.parse(fragments);\n }\n else {\n abi = fragments;\n }\n this.#functions = new Map();\n this.#errors = new Map();\n this.#events = new Map();\n // this.#structs = new Map();\n const frags = [];\n for (const a of abi) {\n try {\n frags.push(Fragment.from(a));\n }\n catch (error) {\n console.log(`[Warning] Invalid Fragment ${JSON.stringify(a)}:`, error.message);\n }\n }\n defineProperties(this, {\n fragments: Object.freeze(frags)\n });\n let fallback = null;\n let receive = false;\n this.#abiCoder = this.getAbiCoder();\n // Add all fragments by their signature\n this.fragments.forEach((fragment, index) => {\n let bucket;\n switch (fragment.type) {\n case \"constructor\":\n if (this.deploy) {\n console.log(\"duplicate definition - constructor\");\n return;\n }\n //checkNames(fragment, \"input\", fragment.inputs);\n defineProperties(this, { deploy: fragment });\n return;\n case \"fallback\":\n if (fragment.inputs.length === 0) {\n receive = true;\n }\n else {\n assertArgument(!fallback || fragment.payable !== fallback.payable, \"conflicting fallback fragments\", `fragments[${index}]`, fragment);\n fallback = fragment;\n receive = fallback.payable;\n }\n return;\n case \"function\":\n //checkNames(fragment, \"input\", fragment.inputs);\n //checkNames(fragment, \"output\", (fragment).outputs);\n bucket = this.#functions;\n break;\n case \"event\":\n //checkNames(fragment, \"input\", fragment.inputs);\n bucket = this.#events;\n break;\n case \"error\":\n bucket = this.#errors;\n break;\n default:\n return;\n }\n // Two identical entries; ignore it\n const signature = fragment.format();\n if (bucket.has(signature)) {\n return;\n }\n bucket.set(signature, fragment);\n });\n // If we do not have a constructor add a default\n if (!this.deploy) {\n defineProperties(this, {\n deploy: ConstructorFragment.from(\"constructor()\")\n });\n }\n defineProperties(this, { fallback, receive });\n }\n /**\n * Returns the entire Human-Readable ABI, as an array of\n * signatures, optionally as %%minimal%% strings, which\n * removes parameter names and unneceesary spaces.\n */\n format(minimal) {\n const format = (minimal ? \"minimal\" : \"full\");\n const abi = this.fragments.map((f) => f.format(format));\n return abi;\n }\n /**\n * Return the JSON-encoded ABI. This is the format Solidiy\n * returns.\n */\n formatJson() {\n const abi = this.fragments.map((f) => f.format(\"json\"));\n // We need to re-bundle the JSON fragments a bit\n return JSON.stringify(abi.map((j) => JSON.parse(j)));\n }\n /**\n * The ABI coder that will be used to encode and decode binary\n * data.\n */\n getAbiCoder() {\n return AbiCoder.defaultAbiCoder();\n }\n // Find a function definition by any means necessary (unless it is ambiguous)\n #getFunction(key, values, forceUnique) {\n // Selector\n if (isHexString(key)) {\n const selector = key.toLowerCase();\n for (const fragment of this.#functions.values()) {\n if (selector === fragment.selector) {\n return fragment;\n }\n }\n return null;\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (key.indexOf(\"(\") === -1) {\n const matching = [];\n for (const [name, fragment] of this.#functions) {\n if (name.split(\"(\" /* fix:) */)[0] === key) {\n matching.push(fragment);\n }\n }\n if (values) {\n const lastValue = (values.length > 0) ? values[values.length - 1] : null;\n let valueLength = values.length;\n let allowOptions = true;\n if (Typed.isTyped(lastValue) && lastValue.type === \"overrides\") {\n allowOptions = false;\n valueLength--;\n }\n // Remove all matches that don't have a compatible length. The args\n // may contain an overrides, so the match may have n or n - 1 parameters\n for (let i = matching.length - 1; i >= 0; i--) {\n const inputs = matching[i].inputs.length;\n if (inputs !== valueLength && (!allowOptions || inputs !== valueLength - 1)) {\n matching.splice(i, 1);\n }\n }\n // Remove all matches that don't match the Typed signature\n for (let i = matching.length - 1; i >= 0; i--) {\n const inputs = matching[i].inputs;\n for (let j = 0; j < values.length; j++) {\n // Not a typed value\n if (!Typed.isTyped(values[j])) {\n continue;\n }\n // We are past the inputs\n if (j >= inputs.length) {\n if (values[j].type === \"overrides\") {\n continue;\n }\n matching.splice(i, 1);\n break;\n }\n // Make sure the value type matches the input type\n if (values[j].type !== inputs[j].baseType) {\n matching.splice(i, 1);\n break;\n }\n }\n }\n }\n // We found a single matching signature with an overrides, but the\n // last value is something that cannot possibly be an options\n if (matching.length === 1 && values && values.length !== matching[0].inputs.length) {\n const lastArg = values[values.length - 1];\n if (lastArg == null || Array.isArray(lastArg) || typeof (lastArg) !== \"object\") {\n matching.splice(0, 1);\n }\n }\n if (matching.length === 0) {\n return null;\n }\n if (matching.length > 1 && forceUnique) {\n const matchStr = matching.map((m) => JSON.stringify(m.format())).join(\", \");\n assertArgument(false, `ambiguous function description (i.e. matches ${matchStr})`, \"key\", key);\n }\n return matching[0];\n }\n // Normalize the signature and lookup the function\n const result = this.#functions.get(FunctionFragment.from(key).format());\n if (result) {\n return result;\n }\n return null;\n }\n /**\n * Get the function name for %%key%%, which may be a function selector,\n * function name or function signature that belongs to the ABI.\n */\n getFunctionName(key) {\n const fragment = this.#getFunction(key, null, false);\n assertArgument(fragment, \"no matching function\", \"key\", key);\n return fragment.name;\n }\n /**\n * Returns true if %%key%% (a function selector, function name or\n * function signature) is present in the ABI.\n *\n * In the case of a function name, the name may be ambiguous, so\n * accessing the [[FunctionFragment]] may require refinement.\n */\n hasFunction(key) {\n return !!this.#getFunction(key, null, false);\n }\n /**\n * Get the [[FunctionFragment]] for %%key%%, which may be a function\n * selector, function name or function signature that belongs to the ABI.\n *\n * If %%values%% is provided, it will use the Typed API to handle\n * ambiguous cases where multiple functions match by name.\n *\n * If the %%key%% and %%values%% do not refine to a single function in\n * the ABI, this will throw.\n */\n getFunction(key, values) {\n return this.#getFunction(key, values || null, true);\n }\n /**\n * Iterate over all functions, calling %%callback%%, sorted by their name.\n */\n forEachFunction(callback) {\n const names = Array.from(this.#functions.keys());\n names.sort((a, b) => a.localeCompare(b));\n for (let i = 0; i < names.length; i++) {\n const name = names[i];\n callback((this.#functions.get(name)), i);\n }\n }\n // Find an event definition by any means necessary (unless it is ambiguous)\n #getEvent(key, values, forceUnique) {\n // EventTopic\n if (isHexString(key)) {\n const eventTopic = key.toLowerCase();\n for (const fragment of this.#events.values()) {\n if (eventTopic === fragment.topicHash) {\n return fragment;\n }\n }\n return null;\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (key.indexOf(\"(\") === -1) {\n const matching = [];\n for (const [name, fragment] of this.#events) {\n if (name.split(\"(\" /* fix:) */)[0] === key) {\n matching.push(fragment);\n }\n }\n if (values) {\n // Remove all matches that don't have a compatible length.\n for (let i = matching.length - 1; i >= 0; i--) {\n if (matching[i].inputs.length < values.length) {\n matching.splice(i, 1);\n }\n }\n // Remove all matches that don't match the Typed signature\n for (let i = matching.length - 1; i >= 0; i--) {\n const inputs = matching[i].inputs;\n for (let j = 0; j < values.length; j++) {\n // Not a typed value\n if (!Typed.isTyped(values[j])) {\n continue;\n }\n // Make sure the value type matches the input type\n if (values[j].type !== inputs[j].baseType) {\n matching.splice(i, 1);\n break;\n }\n }\n }\n }\n if (matching.length === 0) {\n return null;\n }\n if (matching.length > 1 && forceUnique) {\n const matchStr = matching.map((m) => JSON.stringify(m.format())).join(\", \");\n assertArgument(false, `ambiguous event description (i.e. matches ${matchStr})`, \"key\", key);\n }\n return matching[0];\n }\n // Normalize the signature and lookup the function\n const result = this.#events.get(EventFragment.from(key).format());\n if (result) {\n return result;\n }\n return null;\n }\n /**\n * Get the event name for %%key%%, which may be a topic hash,\n * event name or event signature that belongs to the ABI.\n */\n getEventName(key) {\n const fragment = this.#getEvent(key, null, false);\n assertArgument(fragment, \"no matching event\", \"key\", key);\n return fragment.name;\n }\n /**\n * Returns true if %%key%% (an event topic hash, event name or\n * event signature) is present in the ABI.\n *\n * In the case of an event name, the name may be ambiguous, so\n * accessing the [[EventFragment]] may require refinement.\n */\n hasEvent(key) {\n return !!this.#getEvent(key, null, false);\n }\n /**\n * Get the [[EventFragment]] for %%key%%, which may be a topic hash,\n * event name or event signature that belongs to the ABI.\n *\n * If %%values%% is provided, it will use the Typed API to handle\n * ambiguous cases where multiple events match by name.\n *\n * If the %%key%% and %%values%% do not refine to a single event in\n * the ABI, this will throw.\n */\n getEvent(key, values) {\n return this.#getEvent(key, values || null, true);\n }\n /**\n * Iterate over all events, calling %%callback%%, sorted by their name.\n */\n forEachEvent(callback) {\n const names = Array.from(this.#events.keys());\n names.sort((a, b) => a.localeCompare(b));\n for (let i = 0; i < names.length; i++) {\n const name = names[i];\n callback((this.#events.get(name)), i);\n }\n }\n /**\n * Get the [[ErrorFragment]] for %%key%%, which may be an error\n * selector, error name or error signature that belongs to the ABI.\n *\n * If %%values%% is provided, it will use the Typed API to handle\n * ambiguous cases where multiple errors match by name.\n *\n * If the %%key%% and %%values%% do not refine to a single error in\n * the ABI, this will throw.\n */\n getError(key, values) {\n if (isHexString(key)) {\n const selector = key.toLowerCase();\n if (BuiltinErrors[selector]) {\n return ErrorFragment.from(BuiltinErrors[selector].signature);\n }\n for (const fragment of this.#errors.values()) {\n if (selector === fragment.selector) {\n return fragment;\n }\n }\n return null;\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (key.indexOf(\"(\") === -1) {\n const matching = [];\n for (const [name, fragment] of this.#errors) {\n if (name.split(\"(\" /* fix:) */)[0] === key) {\n matching.push(fragment);\n }\n }\n if (matching.length === 0) {\n if (key === \"Error\") {\n return ErrorFragment.from(\"error Error(string)\");\n }\n if (key === \"Panic\") {\n return ErrorFragment.from(\"error Panic(uint256)\");\n }\n return null;\n }\n else if (matching.length > 1) {\n const matchStr = matching.map((m) => JSON.stringify(m.format())).join(\", \");\n assertArgument(false, `ambiguous error description (i.e. ${matchStr})`, \"name\", key);\n }\n return matching[0];\n }\n // Normalize the signature and lookup the function\n key = ErrorFragment.from(key).format();\n if (key === \"Error(string)\") {\n return ErrorFragment.from(\"error Error(string)\");\n }\n if (key === \"Panic(uint256)\") {\n return ErrorFragment.from(\"error Panic(uint256)\");\n }\n const result = this.#errors.get(key);\n if (result) {\n return result;\n }\n return null;\n }\n /**\n * Iterate over all errors, calling %%callback%%, sorted by their name.\n */\n forEachError(callback) {\n const names = Array.from(this.#errors.keys());\n names.sort((a, b) => a.localeCompare(b));\n for (let i = 0; i < names.length; i++) {\n const name = names[i];\n callback((this.#errors.get(name)), i);\n }\n }\n // Get the 4-byte selector used by Solidity to identify a function\n /*\ngetSelector(fragment: ErrorFragment | FunctionFragment): string {\n if (typeof(fragment) === \"string\") {\n const matches: Array = [ ];\n\n try { matches.push(this.getFunction(fragment)); } catch (error) { }\n try { matches.push(this.getError(fragment)); } catch (_) { }\n\n if (matches.length === 0) {\n logger.throwArgumentError(\"unknown fragment\", \"key\", fragment);\n } else if (matches.length > 1) {\n logger.throwArgumentError(\"ambiguous fragment matches function and error\", \"key\", fragment);\n }\n\n fragment = matches[0];\n }\n\n return dataSlice(id(fragment.format()), 0, 4);\n}\n */\n // Get the 32-byte topic hash used by Solidity to identify an event\n /*\n getEventTopic(fragment: EventFragment): string {\n //if (typeof(fragment) === \"string\") { fragment = this.getEvent(eventFragment); }\n return id(fragment.format());\n }\n */\n _decodeParams(params, data) {\n return this.#abiCoder.decode(params, data);\n }\n _encodeParams(params, values) {\n return this.#abiCoder.encode(params, values);\n }\n /**\n * Encodes a ``tx.data`` object for deploying the Contract with\n * the %%values%% as the constructor arguments.\n */\n encodeDeploy(values) {\n return this._encodeParams(this.deploy.inputs, values || []);\n }\n /**\n * Decodes the result %%data%% (e.g. from an ``eth_call``) for the\n * specified error (see [[getError]] for valid values for\n * %%key%%).\n *\n * Most developers should prefer the [[parseCallResult]] method instead,\n * which will automatically detect a ``CALL_EXCEPTION`` and throw the\n * corresponding error.\n */\n decodeErrorResult(fragment, data) {\n if (typeof (fragment) === \"string\") {\n const f = this.getError(fragment);\n assertArgument(f, \"unknown error\", \"fragment\", fragment);\n fragment = f;\n }\n assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match error ${fragment.name}.`, \"data\", data);\n return this._decodeParams(fragment.inputs, dataSlice(data, 4));\n }\n /**\n * Encodes the transaction revert data for a call result that\n * reverted from the the Contract with the sepcified %%error%%\n * (see [[getError]] for valid values for %%fragment%%) with the %%values%%.\n *\n * This is generally not used by most developers, unless trying to mock\n * a result from a Contract.\n */\n encodeErrorResult(fragment, values) {\n if (typeof (fragment) === \"string\") {\n const f = this.getError(fragment);\n assertArgument(f, \"unknown error\", \"fragment\", fragment);\n fragment = f;\n }\n return concat([\n fragment.selector,\n this._encodeParams(fragment.inputs, values || [])\n ]);\n }\n /**\n * Decodes the %%data%% from a transaction ``tx.data`` for\n * the function specified (see [[getFunction]] for valid values\n * for %%fragment%%).\n *\n * Most developers should prefer the [[parseTransaction]] method\n * instead, which will automatically detect the fragment.\n */\n decodeFunctionData(fragment, data) {\n if (typeof (fragment) === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match function ${fragment.name}.`, \"data\", data);\n return this._decodeParams(fragment.inputs, dataSlice(data, 4));\n }\n /**\n * Encodes the ``tx.data`` for a transaction that calls the function\n * specified (see [[getFunction]] for valid values for %%fragment%%) with\n * the %%values%%.\n */\n encodeFunctionData(fragment, values) {\n if (typeof (fragment) === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n return concat([\n fragment.selector,\n this._encodeParams(fragment.inputs, values || [])\n ]);\n }\n /**\n * Decodes the result %%data%% (e.g. from an ``eth_call``) for the\n * specified function (see [[getFunction]] for valid values for\n * %%key%%).\n *\n * Most developers should prefer the [[parseCallResult]] method instead,\n * which will automatically detect a ``CALL_EXCEPTION`` and throw the\n * corresponding error.\n */\n decodeFunctionResult(fragment, data) {\n if (typeof (fragment) === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n let message = \"invalid length for result data\";\n const bytes = getBytesCopy(data);\n if ((bytes.length % 32) === 0) {\n try {\n return this.#abiCoder.decode(fragment.outputs, bytes);\n }\n catch (error) {\n message = \"could not decode result data\";\n }\n }\n // Call returned data with no error, but the data is junk\n assert(false, message, \"BAD_DATA\", {\n value: hexlify(bytes),\n info: { method: fragment.name, signature: fragment.format() }\n });\n }\n makeError(_data, tx) {\n const data = getBytes(_data, \"data\");\n const error = AbiCoder.getBuiltinCallException(\"call\", tx, data);\n // Not a built-in error; try finding a custom error\n const customPrefix = \"execution reverted (unknown custom error)\";\n if (error.message.startsWith(customPrefix)) {\n const selector = hexlify(data.slice(0, 4));\n const ef = this.getError(selector);\n if (ef) {\n try {\n const args = this.#abiCoder.decode(ef.inputs, data.slice(4));\n error.revert = {\n name: ef.name, signature: ef.format(), args\n };\n error.reason = error.revert.signature;\n error.message = `execution reverted: ${error.reason}`;\n }\n catch (e) {\n error.message = `execution reverted (coult not decode custom error)`;\n }\n }\n }\n // Add the invocation, if available\n const parsed = this.parseTransaction(tx);\n if (parsed) {\n error.invocation = {\n method: parsed.name,\n signature: parsed.signature,\n args: parsed.args\n };\n }\n return error;\n }\n /**\n * Encodes the result data (e.g. from an ``eth_call``) for the\n * specified function (see [[getFunction]] for valid values\n * for %%fragment%%) with %%values%%.\n *\n * This is generally not used by most developers, unless trying to mock\n * a result from a Contract.\n */\n encodeFunctionResult(fragment, values) {\n if (typeof (fragment) === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n return hexlify(this.#abiCoder.encode(fragment.outputs, values || []));\n }\n /*\n spelunk(inputs: Array, values: ReadonlyArray, processfunc: (type: string, value: any) => Promise): Promise> {\n const promises: Array> = [ ];\n const process = function(type: ParamType, value: any): any {\n if (type.baseType === \"array\") {\n return descend(type.child\n }\n if (type. === \"address\") {\n }\n };\n \n const descend = function (inputs: Array, values: ReadonlyArray) {\n if (inputs.length !== values.length) { throw new Error(\"length mismatch\"); }\n \n };\n \n const result: Array = [ ];\n values.forEach((value, index) => {\n if (value == null) {\n topics.push(null);\n } else if (param.baseType === \"array\" || param.baseType === \"tuple\") {\n logger.throwArgumentError(\"filtering with tuples or arrays not supported\", (\"contract.\" + param.name), value);\n } else if (Array.isArray(value)) {\n topics.push(value.map((value) => encodeTopic(param, value)));\n } else {\n topics.push(encodeTopic(param, value));\n }\n });\n }\n */\n // Create the filter for the event with search criteria (e.g. for eth_filterLog)\n encodeFilterTopics(fragment, values) {\n if (typeof (fragment) === \"string\") {\n const f = this.getEvent(fragment);\n assertArgument(f, \"unknown event\", \"eventFragment\", fragment);\n fragment = f;\n }\n assert(values.length <= fragment.inputs.length, `too many arguments for ${fragment.format()}`, \"UNEXPECTED_ARGUMENT\", { count: values.length, expectedCount: fragment.inputs.length });\n const topics = [];\n if (!fragment.anonymous) {\n topics.push(fragment.topicHash);\n }\n // @TODO: Use the coders for this; to properly support tuples, etc.\n const encodeTopic = (param, value) => {\n if (param.type === \"string\") {\n return id(value);\n }\n else if (param.type === \"bytes\") {\n return keccak256(hexlify(value));\n }\n if (param.type === \"bool\" && typeof (value) === \"boolean\") {\n value = (value ? \"0x01\" : \"0x00\");\n }\n else if (param.type.match(/^u?int/)) {\n value = toBeHex(value); // @TODO: Should this toTwos??\n }\n else if (param.type.match(/^bytes/)) {\n value = zeroPadBytes(value, 32);\n }\n else if (param.type === \"address\") {\n // Check addresses are valid\n this.#abiCoder.encode([\"address\"], [value]);\n }\n return zeroPadValue(hexlify(value), 32);\n };\n values.forEach((value, index) => {\n const param = fragment.inputs[index];\n if (!param.indexed) {\n assertArgument(value == null, \"cannot filter non-indexed parameters; must be null\", (\"contract.\" + param.name), value);\n return;\n }\n if (value == null) {\n topics.push(null);\n }\n else if (param.baseType === \"array\" || param.baseType === \"tuple\") {\n assertArgument(false, \"filtering with tuples or arrays not supported\", (\"contract.\" + param.name), value);\n }\n else if (Array.isArray(value)) {\n topics.push(value.map((value) => encodeTopic(param, value)));\n }\n else {\n topics.push(encodeTopic(param, value));\n }\n });\n // Trim off trailing nulls\n while (topics.length && topics[topics.length - 1] === null) {\n topics.pop();\n }\n return topics;\n }\n encodeEventLog(fragment, values) {\n if (typeof (fragment) === \"string\") {\n const f = this.getEvent(fragment);\n assertArgument(f, \"unknown event\", \"eventFragment\", fragment);\n fragment = f;\n }\n const topics = [];\n const dataTypes = [];\n const dataValues = [];\n if (!fragment.anonymous) {\n topics.push(fragment.topicHash);\n }\n assertArgument(values.length === fragment.inputs.length, \"event arguments/values mismatch\", \"values\", values);\n fragment.inputs.forEach((param, index) => {\n const value = values[index];\n if (param.indexed) {\n if (param.type === \"string\") {\n topics.push(id(value));\n }\n else if (param.type === \"bytes\") {\n topics.push(keccak256(value));\n }\n else if (param.baseType === \"tuple\" || param.baseType === \"array\") {\n // @TODO\n throw new Error(\"not implemented\");\n }\n else {\n topics.push(this.#abiCoder.encode([param.type], [value]));\n }\n }\n else {\n dataTypes.push(param);\n dataValues.push(value);\n }\n });\n return {\n data: this.#abiCoder.encode(dataTypes, dataValues),\n topics: topics\n };\n }\n // Decode a filter for the event and the search criteria\n decodeEventLog(fragment, data, topics) {\n if (typeof (fragment) === \"string\") {\n const f = this.getEvent(fragment);\n assertArgument(f, \"unknown event\", \"eventFragment\", fragment);\n fragment = f;\n }\n if (topics != null && !fragment.anonymous) {\n const eventTopic = fragment.topicHash;\n assertArgument(isHexString(topics[0], 32) && topics[0].toLowerCase() === eventTopic, \"fragment/topic mismatch\", \"topics[0]\", topics[0]);\n topics = topics.slice(1);\n }\n const indexed = [];\n const nonIndexed = [];\n const dynamic = [];\n fragment.inputs.forEach((param, index) => {\n if (param.indexed) {\n if (param.type === \"string\" || param.type === \"bytes\" || param.baseType === \"tuple\" || param.baseType === \"array\") {\n indexed.push(ParamType.from({ type: \"bytes32\", name: param.name }));\n dynamic.push(true);\n }\n else {\n indexed.push(param);\n dynamic.push(false);\n }\n }\n else {\n nonIndexed.push(param);\n dynamic.push(false);\n }\n });\n const resultIndexed = (topics != null) ? this.#abiCoder.decode(indexed, concat(topics)) : null;\n const resultNonIndexed = this.#abiCoder.decode(nonIndexed, data, true);\n //const result: (Array & { [ key: string ]: any }) = [ ];\n const values = [];\n const keys = [];\n let nonIndexedIndex = 0, indexedIndex = 0;\n fragment.inputs.forEach((param, index) => {\n let value = null;\n if (param.indexed) {\n if (resultIndexed == null) {\n value = new Indexed(null);\n }\n else if (dynamic[index]) {\n value = new Indexed(resultIndexed[indexedIndex++]);\n }\n else {\n try {\n value = resultIndexed[indexedIndex++];\n }\n catch (error) {\n value = error;\n }\n }\n }\n else {\n try {\n value = resultNonIndexed[nonIndexedIndex++];\n }\n catch (error) {\n value = error;\n }\n }\n values.push(value);\n keys.push(param.name || null);\n });\n return Result.fromItems(values, keys);\n }\n /**\n * Parses a transaction, finding the matching function and extracts\n * the parameter values along with other useful function details.\n *\n * If the matching function cannot be found, return null.\n */\n parseTransaction(tx) {\n const data = getBytes(tx.data, \"tx.data\");\n const value = getBigInt((tx.value != null) ? tx.value : 0, \"tx.value\");\n const fragment = this.getFunction(hexlify(data.slice(0, 4)));\n if (!fragment) {\n return null;\n }\n const args = this.#abiCoder.decode(fragment.inputs, data.slice(4));\n return new TransactionDescription(fragment, fragment.selector, args, value);\n }\n parseCallResult(data) {\n throw new Error(\"@TODO\");\n }\n /**\n * Parses a receipt log, finding the matching event and extracts\n * the parameter values along with other useful event details.\n *\n * If the matching event cannot be found, returns null.\n */\n parseLog(log) {\n const fragment = this.getEvent(log.topics[0]);\n if (!fragment || fragment.anonymous) {\n return null;\n }\n // @TODO: If anonymous, and the only method, and the input count matches, should we parse?\n // Probably not, because just because it is the only event in the ABI does\n // not mean we have the full ABI; maybe just a fragment?\n return new LogDescription(fragment, fragment.topicHash, this.decodeEventLog(fragment, log.data, log.topics));\n }\n /**\n * Parses a revert data, finding the matching error and extracts\n * the parameter values along with other useful error details.\n *\n * If the matching error cannot be found, returns null.\n */\n parseError(data) {\n const hexData = hexlify(data);\n const fragment = this.getError(dataSlice(hexData, 0, 4));\n if (!fragment) {\n return null;\n }\n const args = this.#abiCoder.decode(fragment.inputs, dataSlice(hexData, 4));\n return new ErrorDescription(fragment, fragment.selector, args);\n }\n /**\n * Creates a new [[Interface]] from the ABI %%value%%.\n *\n * The %%value%% may be provided as an existing [[Interface]] object,\n * a JSON-encoded ABI or any Human-Readable ABI format.\n */\n static from(value) {\n // Already an Interface, which is immutable\n if (value instanceof Interface) {\n return value;\n }\n // JSON\n if (typeof (value) === \"string\") {\n return new Interface(JSON.parse(value));\n }\n // An Interface; possibly from another v6 instance\n if (typeof (value.formatJson) === \"function\") {\n return new Interface(value.formatJson());\n }\n // A legacy Interface; from an older version\n if (typeof (value.format) === \"function\") {\n return new Interface(value.format(\"json\"));\n }\n // Array of fragments\n return new Interface(value);\n }\n}\n//# sourceMappingURL=interface.js.map","//import { resolveAddress } from \"@ethersproject/address\";\nimport { defineProperties, getBigInt, getNumber, hexlify, isBytesLike, resolveProperties, assert, assertArgument, isError, makeError } from \"../utils/index.js\";\nimport { accessListify } from \"../transaction/index.js\";\nconst BN_0 = BigInt(0);\n// -----------------------\nfunction getValue(value) {\n if (value == null) {\n return null;\n }\n return value;\n}\nfunction toJson(value) {\n if (value == null) {\n return null;\n }\n return value.toString();\n}\n// @TODO? implements Required\n/**\n * A **FeeData** wraps all the fee-related values associated with\n * the network.\n */\nexport class FeeData {\n /**\n * The gas price for legacy networks.\n */\n gasPrice;\n /**\n * The maximum fee to pay per gas.\n *\n * The base fee per gas is defined by the network and based on\n * congestion, increasing the cost during times of heavy load\n * and lowering when less busy.\n *\n * The actual fee per gas will be the base fee for the block\n * and the priority fee, up to the max fee per gas.\n *\n * This will be ``null`` on legacy networks (i.e. [pre-EIP-1559](link-eip-1559))\n */\n maxFeePerGas;\n /**\n * The additional amout to pay per gas to encourage a validator\n * to include the transaction.\n *\n * The purpose of this is to compensate the validator for the\n * adjusted risk for including a given transaction.\n *\n * This will be ``null`` on legacy networks (i.e. [pre-EIP-1559](link-eip-1559))\n */\n maxPriorityFeePerGas;\n /**\n * Creates a new FeeData for %%gasPrice%%, %%maxFeePerGas%% and\n * %%maxPriorityFeePerGas%%.\n */\n constructor(gasPrice, maxFeePerGas, maxPriorityFeePerGas) {\n defineProperties(this, {\n gasPrice: getValue(gasPrice),\n maxFeePerGas: getValue(maxFeePerGas),\n maxPriorityFeePerGas: getValue(maxPriorityFeePerGas)\n });\n }\n /**\n * Returns a JSON-friendly value.\n */\n toJSON() {\n const { gasPrice, maxFeePerGas, maxPriorityFeePerGas } = this;\n return {\n _type: \"FeeData\",\n gasPrice: toJson(gasPrice),\n maxFeePerGas: toJson(maxFeePerGas),\n maxPriorityFeePerGas: toJson(maxPriorityFeePerGas),\n };\n }\n}\n;\n/**\n * Returns a copy of %%req%% with all properties coerced to their strict\n * types.\n */\nexport function copyRequest(req) {\n const result = {};\n // These could be addresses, ENS names or Addressables\n if (req.to) {\n result.to = req.to;\n }\n if (req.from) {\n result.from = req.from;\n }\n if (req.data) {\n result.data = hexlify(req.data);\n }\n const bigIntKeys = \"chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value\".split(/,/);\n for (const key of bigIntKeys) {\n if (!(key in req) || req[key] == null) {\n continue;\n }\n result[key] = getBigInt(req[key], `request.${key}`);\n }\n const numberKeys = \"type,nonce\".split(/,/);\n for (const key of numberKeys) {\n if (!(key in req) || req[key] == null) {\n continue;\n }\n result[key] = getNumber(req[key], `request.${key}`);\n }\n if (req.accessList) {\n result.accessList = accessListify(req.accessList);\n }\n if (req.authorizationList) {\n result.authorizationList = req.authorizationList.slice();\n }\n if (\"blockTag\" in req) {\n result.blockTag = req.blockTag;\n }\n if (\"enableCcipRead\" in req) {\n result.enableCcipRead = !!req.enableCcipRead;\n }\n if (\"customData\" in req) {\n result.customData = req.customData;\n }\n if (\"blobVersionedHashes\" in req && req.blobVersionedHashes) {\n result.blobVersionedHashes = req.blobVersionedHashes.slice();\n }\n if (\"kzg\" in req) {\n result.kzg = req.kzg;\n }\n if (\"blobWrapperVersion\" in req) {\n result.blobWrapperVersion = req.blobWrapperVersion;\n }\n if (\"blobs\" in req && req.blobs) {\n result.blobs = req.blobs.map((b) => {\n if (isBytesLike(b)) {\n return hexlify(b);\n }\n return Object.assign({}, b);\n });\n }\n return result;\n}\n/**\n * A **Block** represents the data associated with a full block on\n * Ethereum.\n */\nexport class Block {\n /**\n * The provider connected to the block used to fetch additional details\n * if necessary.\n */\n provider;\n /**\n * The block number, sometimes called the block height. This is a\n * sequential number that is one higher than the parent block.\n */\n number;\n /**\n * The block hash.\n *\n * This hash includes all properties, so can be safely used to identify\n * an exact set of block properties.\n */\n hash;\n /**\n * The timestamp for this block, which is the number of seconds since\n * epoch that this block was included.\n */\n timestamp;\n /**\n * The block hash of the parent block.\n */\n parentHash;\n /**\n * The hash tree root of the parent beacon block for the given\n * execution block. See [[link-eip-4788]].\n */\n parentBeaconBlockRoot;\n /**\n * The nonce.\n *\n * On legacy networks, this is the random number inserted which\n * permitted the difficulty target to be reached.\n */\n nonce;\n /**\n * The difficulty target.\n *\n * On legacy networks, this is the proof-of-work target required\n * for a block to meet the protocol rules to be included.\n *\n * On modern networks, this is a random number arrived at using\n * randao. @TODO: Find links?\n */\n difficulty;\n /**\n * The total gas limit for this block.\n */\n gasLimit;\n /**\n * The total gas used in this block.\n */\n gasUsed;\n /**\n * The root hash for the global state after applying changes\n * in this block.\n */\n stateRoot;\n /**\n * The hash of the transaction receipts trie.\n */\n receiptsRoot;\n /**\n * The total amount of blob gas consumed by the transactions\n * within the block. See [[link-eip-4844]].\n */\n blobGasUsed;\n /**\n * The running total of blob gas consumed in excess of the\n * target, prior to the block. See [[link-eip-4844]].\n */\n excessBlobGas;\n /**\n * The miner coinbase address, wihch receives any subsidies for\n * including this block.\n */\n miner;\n /**\n * The latest RANDAO mix of the post beacon state of\n * the previous block.\n */\n prevRandao;\n /**\n * Any extra data the validator wished to include.\n */\n extraData;\n /**\n * The base fee per gas that all transactions in this block were\n * charged.\n *\n * This adjusts after each block, depending on how congested the network\n * is.\n */\n baseFeePerGas;\n #transactions;\n /**\n * Create a new **Block** object.\n *\n * This should generally not be necessary as the unless implementing a\n * low-level library.\n */\n constructor(block, provider) {\n this.#transactions = block.transactions.map((tx) => {\n if (typeof (tx) !== \"string\") {\n return new TransactionResponse(tx, provider);\n }\n return tx;\n });\n defineProperties(this, {\n provider,\n hash: getValue(block.hash),\n number: block.number,\n timestamp: block.timestamp,\n parentHash: block.parentHash,\n parentBeaconBlockRoot: block.parentBeaconBlockRoot,\n nonce: block.nonce,\n difficulty: block.difficulty,\n gasLimit: block.gasLimit,\n gasUsed: block.gasUsed,\n blobGasUsed: block.blobGasUsed,\n excessBlobGas: block.excessBlobGas,\n miner: block.miner,\n prevRandao: getValue(block.prevRandao),\n extraData: block.extraData,\n baseFeePerGas: getValue(block.baseFeePerGas),\n stateRoot: block.stateRoot,\n receiptsRoot: block.receiptsRoot,\n });\n }\n /**\n * Returns the list of transaction hashes, in the order\n * they were executed within the block.\n */\n get transactions() {\n return this.#transactions.map((tx) => {\n if (typeof (tx) === \"string\") {\n return tx;\n }\n return tx.hash;\n });\n }\n /**\n * Returns the complete transactions, in the order they\n * were executed within the block.\n *\n * This is only available for blocks which prefetched\n * transactions, by passing ``true`` to %%prefetchTxs%%\n * into [[Provider-getBlock]].\n */\n get prefetchedTransactions() {\n const txs = this.#transactions.slice();\n // Doesn't matter...\n if (txs.length === 0) {\n return [];\n }\n // Make sure we prefetched the transactions\n assert(typeof (txs[0]) === \"object\", \"transactions were not prefetched with block request\", \"UNSUPPORTED_OPERATION\", {\n operation: \"transactionResponses()\"\n });\n return txs;\n }\n /**\n * Returns a JSON-friendly value.\n */\n toJSON() {\n const { baseFeePerGas, difficulty, extraData, gasLimit, gasUsed, hash, miner, prevRandao, nonce, number, parentHash, parentBeaconBlockRoot, stateRoot, receiptsRoot, timestamp, transactions } = this;\n return {\n _type: \"Block\",\n baseFeePerGas: toJson(baseFeePerGas),\n difficulty: toJson(difficulty),\n extraData,\n gasLimit: toJson(gasLimit),\n gasUsed: toJson(gasUsed),\n blobGasUsed: toJson(this.blobGasUsed),\n excessBlobGas: toJson(this.excessBlobGas),\n hash, miner, prevRandao, nonce, number, parentHash, timestamp,\n parentBeaconBlockRoot, stateRoot, receiptsRoot,\n transactions,\n };\n }\n [Symbol.iterator]() {\n let index = 0;\n const txs = this.transactions;\n return {\n next: () => {\n if (index < this.length) {\n return {\n value: txs[index++], done: false\n };\n }\n return { value: undefined, done: true };\n }\n };\n }\n /**\n * The number of transactions in this block.\n */\n get length() { return this.#transactions.length; }\n /**\n * The [[link-js-date]] this block was included at.\n */\n get date() {\n if (this.timestamp == null) {\n return null;\n }\n return new Date(this.timestamp * 1000);\n }\n /**\n * Get the transaction at %%indexe%% within this block.\n */\n async getTransaction(indexOrHash) {\n // Find the internal value by its index or hash\n let tx = undefined;\n if (typeof (indexOrHash) === \"number\") {\n tx = this.#transactions[indexOrHash];\n }\n else {\n const hash = indexOrHash.toLowerCase();\n for (const v of this.#transactions) {\n if (typeof (v) === \"string\") {\n if (v !== hash) {\n continue;\n }\n tx = v;\n break;\n }\n else {\n if (v.hash !== hash) {\n continue;\n }\n tx = v;\n break;\n }\n }\n }\n if (tx == null) {\n throw new Error(\"no such tx\");\n }\n if (typeof (tx) === \"string\") {\n return (await this.provider.getTransaction(tx));\n }\n else {\n return tx;\n }\n }\n /**\n * If a **Block** was fetched with a request to include the transactions\n * this will allow synchronous access to those transactions.\n *\n * If the transactions were not prefetched, this will throw.\n */\n getPrefetchedTransaction(indexOrHash) {\n const txs = this.prefetchedTransactions;\n if (typeof (indexOrHash) === \"number\") {\n return txs[indexOrHash];\n }\n indexOrHash = indexOrHash.toLowerCase();\n for (const tx of txs) {\n if (tx.hash === indexOrHash) {\n return tx;\n }\n }\n assertArgument(false, \"no matching transaction\", \"indexOrHash\", indexOrHash);\n }\n /**\n * Returns true if this block been mined. This provides a type guard\n * for all properties on a [[MinedBlock]].\n */\n isMined() { return !!this.hash; }\n /**\n * Returns true if this block is an [[link-eip-2930]] block.\n */\n isLondon() {\n return !!this.baseFeePerGas;\n }\n /**\n * @_ignore:\n */\n orphanedEvent() {\n if (!this.isMined()) {\n throw new Error(\"\");\n }\n return createOrphanedBlockFilter(this);\n }\n}\n//////////////////////\n// Log\n/**\n * A **Log** in Ethereum represents an event that has been included in a\n * transaction using the ``LOG*`` opcodes, which are most commonly used by\n * Solidity's emit for announcing events.\n */\nexport class Log {\n /**\n * The provider connected to the log used to fetch additional details\n * if necessary.\n */\n provider;\n /**\n * The transaction hash of the transaction this log occurred in. Use the\n * [[Log-getTransaction]] to get the [[TransactionResponse]].\n */\n transactionHash;\n /**\n * The block hash of the block this log occurred in. Use the\n * [[Log-getBlock]] to get the [[Block]].\n */\n blockHash;\n /**\n * The block number of the block this log occurred in. It is preferred\n * to use the [[Block-hash]] when fetching the related [[Block]],\n * since in the case of an orphaned block, the block at that height may\n * have changed.\n */\n blockNumber;\n /**\n * If the **Log** represents a block that was removed due to an orphaned\n * block, this will be true.\n *\n * This can only happen within an orphan event listener.\n */\n removed;\n /**\n * The address of the contract that emitted this log.\n */\n address;\n /**\n * The data included in this log when it was emitted.\n */\n data;\n /**\n * The indexed topics included in this log when it was emitted.\n *\n * All topics are included in the bloom filters, so they can be\n * efficiently filtered using the [[Provider-getLogs]] method.\n */\n topics;\n /**\n * The index within the block this log occurred at. This is generally\n * not useful to developers, but can be used with the various roots\n * to proof inclusion within a block.\n */\n index;\n /**\n * The index within the transaction of this log.\n */\n transactionIndex;\n /**\n * @_ignore:\n */\n constructor(log, provider) {\n this.provider = provider;\n const topics = Object.freeze(log.topics.slice());\n defineProperties(this, {\n transactionHash: log.transactionHash,\n blockHash: log.blockHash,\n blockNumber: log.blockNumber,\n removed: log.removed,\n address: log.address,\n data: log.data,\n topics,\n index: log.index,\n transactionIndex: log.transactionIndex,\n });\n }\n /**\n * Returns a JSON-compatible object.\n */\n toJSON() {\n const { address, blockHash, blockNumber, data, index, removed, topics, transactionHash, transactionIndex } = this;\n return {\n _type: \"log\",\n address, blockHash, blockNumber, data, index,\n removed, topics, transactionHash, transactionIndex\n };\n }\n /**\n * Returns the block that this log occurred in.\n */\n async getBlock() {\n const block = await this.provider.getBlock(this.blockHash);\n assert(!!block, \"failed to find transaction\", \"UNKNOWN_ERROR\", {});\n return block;\n }\n /**\n * Returns the transaction that this log occurred in.\n */\n async getTransaction() {\n const tx = await this.provider.getTransaction(this.transactionHash);\n assert(!!tx, \"failed to find transaction\", \"UNKNOWN_ERROR\", {});\n return tx;\n }\n /**\n * Returns the transaction receipt fot the transaction that this\n * log occurred in.\n */\n async getTransactionReceipt() {\n const receipt = await this.provider.getTransactionReceipt(this.transactionHash);\n assert(!!receipt, \"failed to find transaction receipt\", \"UNKNOWN_ERROR\", {});\n return receipt;\n }\n /**\n * @_ignore:\n */\n removedEvent() {\n return createRemovedLogFilter(this);\n }\n}\n//////////////////////\n// Transaction Receipt\n/*\nexport interface LegacyTransactionReceipt {\n byzantium: false;\n status: null;\n root: string;\n}\n\nexport interface ByzantiumTransactionReceipt {\n byzantium: true;\n status: number;\n root: null;\n}\n*/\n/**\n * A **TransactionReceipt** includes additional information about a\n * transaction that is only available after it has been mined.\n */\nexport class TransactionReceipt {\n /**\n * The provider connected to the log used to fetch additional details\n * if necessary.\n */\n provider;\n /**\n * The address the transaction was sent to.\n */\n to;\n /**\n * The sender of the transaction.\n */\n from;\n /**\n * The address of the contract if the transaction was directly\n * responsible for deploying one.\n *\n * This is non-null **only** if the ``to`` is empty and the ``data``\n * was successfully executed as initcode.\n */\n contractAddress;\n /**\n * The transaction hash.\n */\n hash;\n /**\n * The index of this transaction within the block transactions.\n */\n index;\n /**\n * The block hash of the [[Block]] this transaction was included in.\n */\n blockHash;\n /**\n * The block number of the [[Block]] this transaction was included in.\n */\n blockNumber;\n /**\n * The bloom filter bytes that represent all logs that occurred within\n * this transaction. This is generally not useful for most developers,\n * but can be used to validate the included logs.\n */\n logsBloom;\n /**\n * The actual amount of gas used by this transaction.\n *\n * When creating a transaction, the amount of gas that will be used can\n * only be approximated, but the sender must pay the gas fee for the\n * entire gas limit. After the transaction, the difference is refunded.\n */\n gasUsed;\n /**\n * The gas used for BLObs. See [[link-eip-4844]].\n */\n blobGasUsed;\n /**\n * The amount of gas used by all transactions within the block for this\n * and all transactions with a lower ``index``.\n *\n * This is generally not useful for developers but can be used to\n * validate certain aspects of execution.\n */\n cumulativeGasUsed;\n /**\n * The actual gas price used during execution.\n *\n * Due to the complexity of [[link-eip-1559]] this value can only\n * be caluclated after the transaction has been mined, snce the base\n * fee is protocol-enforced.\n */\n gasPrice;\n /**\n * The price paid per BLOB in gas. See [[link-eip-4844]].\n */\n blobGasPrice;\n /**\n * The [[link-eip-2718]] transaction type.\n */\n type;\n //readonly byzantium!: boolean;\n /**\n * The status of this transaction, indicating success (i.e. ``1``) or\n * a revert (i.e. ``0``).\n *\n * This is available in post-byzantium blocks, but some backends may\n * backfill this value.\n */\n status;\n /**\n * The root hash of this transaction.\n *\n * This is no present and was only included in pre-byzantium blocks, but\n * could be used to validate certain parts of the receipt.\n */\n root;\n #logs;\n /**\n * @_ignore:\n */\n constructor(tx, provider) {\n this.#logs = Object.freeze(tx.logs.map((log) => {\n return new Log(log, provider);\n }));\n let gasPrice = BN_0;\n if (tx.effectiveGasPrice != null) {\n gasPrice = tx.effectiveGasPrice;\n }\n else if (tx.gasPrice != null) {\n gasPrice = tx.gasPrice;\n }\n defineProperties(this, {\n provider,\n to: tx.to,\n from: tx.from,\n contractAddress: tx.contractAddress,\n hash: tx.hash,\n index: tx.index,\n blockHash: tx.blockHash,\n blockNumber: tx.blockNumber,\n logsBloom: tx.logsBloom,\n gasUsed: tx.gasUsed,\n cumulativeGasUsed: tx.cumulativeGasUsed,\n blobGasUsed: tx.blobGasUsed,\n gasPrice,\n blobGasPrice: tx.blobGasPrice,\n type: tx.type,\n //byzantium: tx.byzantium,\n status: tx.status,\n root: tx.root\n });\n }\n /**\n * The logs for this transaction.\n */\n get logs() { return this.#logs; }\n /**\n * Returns a JSON-compatible representation.\n */\n toJSON() {\n const { to, from, contractAddress, hash, index, blockHash, blockNumber, logsBloom, logs, //byzantium, \n status, root } = this;\n return {\n _type: \"TransactionReceipt\",\n blockHash, blockNumber,\n //byzantium, \n contractAddress,\n cumulativeGasUsed: toJson(this.cumulativeGasUsed),\n from,\n gasPrice: toJson(this.gasPrice),\n blobGasUsed: toJson(this.blobGasUsed),\n blobGasPrice: toJson(this.blobGasPrice),\n gasUsed: toJson(this.gasUsed),\n hash, index, logs, logsBloom, root, status, to\n };\n }\n /**\n * @_ignore:\n */\n get length() { return this.logs.length; }\n [Symbol.iterator]() {\n let index = 0;\n return {\n next: () => {\n if (index < this.length) {\n return { value: this.logs[index++], done: false };\n }\n return { value: undefined, done: true };\n }\n };\n }\n /**\n * The total fee for this transaction, in wei.\n */\n get fee() {\n return this.gasUsed * this.gasPrice;\n }\n /**\n * Resolves to the block this transaction occurred in.\n */\n async getBlock() {\n const block = await this.provider.getBlock(this.blockHash);\n if (block == null) {\n throw new Error(\"TODO\");\n }\n return block;\n }\n /**\n * Resolves to the transaction this transaction occurred in.\n */\n async getTransaction() {\n const tx = await this.provider.getTransaction(this.hash);\n if (tx == null) {\n throw new Error(\"TODO\");\n }\n return tx;\n }\n /**\n * Resolves to the return value of the execution of this transaction.\n *\n * Support for this feature is limited, as it requires an archive node\n * with the ``debug_`` or ``trace_`` API enabled.\n */\n async getResult() {\n return (await this.provider.getTransactionResult(this.hash));\n }\n /**\n * Resolves to the number of confirmations this transaction has.\n */\n async confirmations() {\n return (await this.provider.getBlockNumber()) - this.blockNumber + 1;\n }\n /**\n * @_ignore:\n */\n removedEvent() {\n return createRemovedTransactionFilter(this);\n }\n /**\n * @_ignore:\n */\n reorderedEvent(other) {\n assert(!other || other.isMined(), \"unmined 'other' transction cannot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"reorderedEvent(other)\" });\n return createReorderedTransactionFilter(this, other);\n }\n}\n/**\n * A **TransactionResponse** includes all properties about a transaction\n * that was sent to the network, which may or may not be included in a\n * block.\n *\n * The [[TransactionResponse-isMined]] can be used to check if the\n * transaction has been mined as well as type guard that the otherwise\n * possibly ``null`` properties are defined.\n */\nexport class TransactionResponse {\n /**\n * The provider this is connected to, which will influence how its\n * methods will resolve its async inspection methods.\n */\n provider;\n /**\n * The block number of the block that this transaction was included in.\n *\n * This is ``null`` for pending transactions.\n */\n blockNumber;\n /**\n * The blockHash of the block that this transaction was included in.\n *\n * This is ``null`` for pending transactions.\n */\n blockHash;\n /**\n * The index within the block that this transaction resides at.\n */\n index;\n /**\n * The transaction hash.\n */\n hash;\n /**\n * The [[link-eip-2718]] transaction envelope type. This is\n * ``0`` for legacy transactions types.\n */\n type;\n /**\n * The receiver of this transaction.\n *\n * If ``null``, then the transaction is an initcode transaction.\n * This means the result of executing the [[data]] will be deployed\n * as a new contract on chain (assuming it does not revert) and the\n * address may be computed using [[getCreateAddress]].\n */\n to;\n /**\n * The sender of this transaction. It is implicitly computed\n * from the transaction pre-image hash (as the digest) and the\n * [[signature]] using ecrecover.\n */\n from;\n /**\n * The nonce, which is used to prevent replay attacks and offer\n * a method to ensure transactions from a given sender are explicitly\n * ordered.\n *\n * When sending a transaction, this must be equal to the number of\n * transactions ever sent by [[from]].\n */\n nonce;\n /**\n * The maximum units of gas this transaction can consume. If execution\n * exceeds this, the entries transaction is reverted and the sender\n * is charged for the full amount, despite not state changes being made.\n */\n gasLimit;\n /**\n * The gas price can have various values, depending on the network.\n *\n * In modern networks, for transactions that are included this is\n * the //effective gas price// (the fee per gas that was actually\n * charged), while for transactions that have not been included yet\n * is the [[maxFeePerGas]].\n *\n * For legacy transactions, or transactions on legacy networks, this\n * is the fee that will be charged per unit of gas the transaction\n * consumes.\n */\n gasPrice;\n /**\n * The maximum priority fee (per unit of gas) to allow a\n * validator to charge the sender. This is inclusive of the\n * [[maxFeeFeePerGas]].\n */\n maxPriorityFeePerGas;\n /**\n * The maximum fee (per unit of gas) to allow this transaction\n * to charge the sender.\n */\n maxFeePerGas;\n /**\n * The [[link-eip-4844]] max fee per BLOb gas.\n */\n maxFeePerBlobGas;\n /**\n * The data.\n */\n data;\n /**\n * The value, in wei. Use [[formatEther]] to format this value\n * as ether.\n */\n value;\n /**\n * The chain ID.\n */\n chainId;\n /**\n * The signature.\n */\n signature;\n /**\n * The [[link-eip-2930]] access list for transaction types that\n * support it, otherwise ``null``.\n */\n accessList;\n /**\n * The [[link-eip-4844]] BLOb versioned hashes.\n */\n blobVersionedHashes;\n /**\n * The [[link-eip-7702]] authorizations (if any).\n */\n authorizationList;\n #startBlock;\n /**\n * @_ignore:\n */\n constructor(tx, provider) {\n this.provider = provider;\n this.blockNumber = (tx.blockNumber != null) ? tx.blockNumber : null;\n this.blockHash = (tx.blockHash != null) ? tx.blockHash : null;\n this.hash = tx.hash;\n this.index = tx.index;\n this.type = tx.type;\n this.from = tx.from;\n this.to = tx.to || null;\n this.gasLimit = tx.gasLimit;\n this.nonce = tx.nonce;\n this.data = tx.data;\n this.value = tx.value;\n this.gasPrice = tx.gasPrice;\n this.maxPriorityFeePerGas = (tx.maxPriorityFeePerGas != null) ? tx.maxPriorityFeePerGas : null;\n this.maxFeePerGas = (tx.maxFeePerGas != null) ? tx.maxFeePerGas : null;\n this.maxFeePerBlobGas = (tx.maxFeePerBlobGas != null) ? tx.maxFeePerBlobGas : null;\n this.chainId = tx.chainId;\n this.signature = tx.signature;\n this.accessList = (tx.accessList != null) ? tx.accessList : null;\n this.blobVersionedHashes = (tx.blobVersionedHashes != null) ? tx.blobVersionedHashes : null;\n this.authorizationList = (tx.authorizationList != null) ? tx.authorizationList : null;\n this.#startBlock = -1;\n }\n /**\n * Returns a JSON-compatible representation of this transaction.\n */\n toJSON() {\n const { blockNumber, blockHash, index, hash, type, to, from, nonce, data, signature, accessList, blobVersionedHashes } = this;\n return {\n _type: \"TransactionResponse\",\n accessList, blockNumber, blockHash,\n blobVersionedHashes,\n chainId: toJson(this.chainId),\n data, from,\n gasLimit: toJson(this.gasLimit),\n gasPrice: toJson(this.gasPrice),\n hash,\n maxFeePerGas: toJson(this.maxFeePerGas),\n maxPriorityFeePerGas: toJson(this.maxPriorityFeePerGas),\n maxFeePerBlobGas: toJson(this.maxFeePerBlobGas),\n nonce, signature, to, index, type,\n value: toJson(this.value),\n };\n }\n /**\n * Resolves to the Block that this transaction was included in.\n *\n * This will return null if the transaction has not been included yet.\n */\n async getBlock() {\n let blockNumber = this.blockNumber;\n if (blockNumber == null) {\n const tx = await this.getTransaction();\n if (tx) {\n blockNumber = tx.blockNumber;\n }\n }\n if (blockNumber == null) {\n return null;\n }\n const block = this.provider.getBlock(blockNumber);\n if (block == null) {\n throw new Error(\"TODO\");\n }\n return block;\n }\n /**\n * Resolves to this transaction being re-requested from the\n * provider. This can be used if you have an unmined transaction\n * and wish to get an up-to-date populated instance.\n */\n async getTransaction() {\n return this.provider.getTransaction(this.hash);\n }\n /**\n * Resolve to the number of confirmations this transaction has.\n */\n async confirmations() {\n if (this.blockNumber == null) {\n const { tx, blockNumber } = await resolveProperties({\n tx: this.getTransaction(),\n blockNumber: this.provider.getBlockNumber()\n });\n // Not mined yet...\n if (tx == null || tx.blockNumber == null) {\n return 0;\n }\n return blockNumber - tx.blockNumber + 1;\n }\n const blockNumber = await this.provider.getBlockNumber();\n return blockNumber - this.blockNumber + 1;\n }\n /**\n * Resolves once this transaction has been mined and has\n * %%confirms%% blocks including it (default: ``1``) with an\n * optional %%timeout%%.\n *\n * This can resolve to ``null`` only if %%confirms%% is ``0``\n * and the transaction has not been mined, otherwise this will\n * wait until enough confirmations have completed.\n */\n async wait(_confirms, _timeout) {\n const confirms = (_confirms == null) ? 1 : _confirms;\n const timeout = (_timeout == null) ? 0 : _timeout;\n let startBlock = this.#startBlock;\n let nextScan = -1;\n let stopScanning = (startBlock === -1) ? true : false;\n const checkReplacement = async () => {\n // Get the current transaction count for this sender\n if (stopScanning) {\n return null;\n }\n const { blockNumber, nonce } = await resolveProperties({\n blockNumber: this.provider.getBlockNumber(),\n nonce: this.provider.getTransactionCount(this.from)\n });\n // No transaction or our nonce has not been mined yet; but we\n // can start scanning later when we do start\n if (nonce < this.nonce) {\n startBlock = blockNumber;\n return;\n }\n // We were mined; no replacement\n if (stopScanning) {\n return null;\n }\n const mined = await this.getTransaction();\n if (mined && mined.blockNumber != null) {\n return;\n }\n // We were replaced; start scanning for that transaction\n // Starting to scan; look back a few extra blocks for safety\n if (nextScan === -1) {\n nextScan = startBlock - 3;\n if (nextScan < this.#startBlock) {\n nextScan = this.#startBlock;\n }\n }\n while (nextScan <= blockNumber) {\n // Get the next block to scan\n if (stopScanning) {\n return null;\n }\n const block = await this.provider.getBlock(nextScan, true);\n // This should not happen; but we'll try again shortly\n if (block == null) {\n return;\n }\n // We were mined; no replacement\n for (const hash of block) {\n if (hash === this.hash) {\n return;\n }\n }\n // Search for the transaction that replaced us\n for (let i = 0; i < block.length; i++) {\n const tx = await block.getTransaction(i);\n if (tx.from === this.from && tx.nonce === this.nonce) {\n // Get the receipt\n if (stopScanning) {\n return null;\n }\n const receipt = await this.provider.getTransactionReceipt(tx.hash);\n // This should not happen; but we'll try again shortly\n if (receipt == null) {\n return;\n }\n // We will retry this on the next block (this case could be optimized)\n if ((blockNumber - receipt.blockNumber + 1) < confirms) {\n return;\n }\n // The reason we were replaced\n let reason = \"replaced\";\n if (tx.data === this.data && tx.to === this.to && tx.value === this.value) {\n reason = \"repriced\";\n }\n else if (tx.data === \"0x\" && tx.from === tx.to && tx.value === BN_0) {\n reason = \"cancelled\";\n }\n assert(false, \"transaction was replaced\", \"TRANSACTION_REPLACED\", {\n cancelled: (reason === \"replaced\" || reason === \"cancelled\"),\n reason,\n replacement: tx.replaceableTransaction(startBlock),\n hash: tx.hash,\n receipt\n });\n }\n }\n nextScan++;\n }\n return;\n };\n const checkReceipt = (receipt) => {\n if (receipt == null || receipt.status !== 0) {\n return receipt;\n }\n assert(false, \"transaction execution reverted\", \"CALL_EXCEPTION\", {\n action: \"sendTransaction\",\n data: null, reason: null, invocation: null, revert: null,\n transaction: {\n to: receipt.to,\n from: receipt.from,\n data: \"\" // @TODO: in v7, split out sendTransaction properties\n }, receipt\n });\n };\n const receipt = await this.provider.getTransactionReceipt(this.hash);\n if (confirms === 0) {\n return checkReceipt(receipt);\n }\n if (receipt) {\n if (confirms === 1 || (await receipt.confirmations()) >= confirms) {\n return checkReceipt(receipt);\n }\n }\n else {\n // Check for a replacement; throws if a replacement was found\n await checkReplacement();\n // Allow null only when the confirms is 0\n if (confirms === 0) {\n return null;\n }\n }\n const waiter = new Promise((resolve, reject) => {\n // List of things to cancel when we have a result (one way or the other)\n const cancellers = [];\n const cancel = () => { cancellers.forEach((c) => c()); };\n // On cancel, stop scanning for replacements\n cancellers.push(() => { stopScanning = true; });\n // Set up any timeout requested\n if (timeout > 0) {\n const timer = setTimeout(() => {\n cancel();\n reject(makeError(\"wait for transaction timeout\", \"TIMEOUT\"));\n }, timeout);\n cancellers.push(() => { clearTimeout(timer); });\n }\n const txListener = async (receipt) => {\n // Done; return it!\n if ((await receipt.confirmations()) >= confirms) {\n cancel();\n try {\n resolve(checkReceipt(receipt));\n }\n catch (error) {\n reject(error);\n }\n }\n };\n cancellers.push(() => { this.provider.off(this.hash, txListener); });\n this.provider.on(this.hash, txListener);\n // We support replacement detection; start checking\n if (startBlock >= 0) {\n const replaceListener = async () => {\n try {\n // Check for a replacement; this throws only if one is found\n await checkReplacement();\n }\n catch (error) {\n // We were replaced (with enough confirms); re-throw the error\n if (isError(error, \"TRANSACTION_REPLACED\")) {\n cancel();\n reject(error);\n return;\n }\n }\n // Rescheudle a check on the next block\n if (!stopScanning) {\n this.provider.once(\"block\", replaceListener);\n }\n };\n cancellers.push(() => { this.provider.off(\"block\", replaceListener); });\n this.provider.once(\"block\", replaceListener);\n }\n });\n return await waiter;\n }\n /**\n * Returns ``true`` if this transaction has been included.\n *\n * This is effective only as of the time the TransactionResponse\n * was instantiated. To get up-to-date information, use\n * [[getTransaction]].\n *\n * This provides a Type Guard that this transaction will have\n * non-null property values for properties that are null for\n * unmined transactions.\n */\n isMined() {\n return (this.blockHash != null);\n }\n /**\n * Returns true if the transaction is a legacy (i.e. ``type == 0``)\n * transaction.\n *\n * This provides a Type Guard that this transaction will have\n * the ``null``-ness for hardfork-specific properties set correctly.\n */\n isLegacy() {\n return (this.type === 0);\n }\n /**\n * Returns true if the transaction is a Berlin (i.e. ``type == 1``)\n * transaction. See [[link-eip-2070]].\n *\n * This provides a Type Guard that this transaction will have\n * the ``null``-ness for hardfork-specific properties set correctly.\n */\n isBerlin() {\n return (this.type === 1);\n }\n /**\n * Returns true if the transaction is a London (i.e. ``type == 2``)\n * transaction. See [[link-eip-1559]].\n *\n * This provides a Type Guard that this transaction will have\n * the ``null``-ness for hardfork-specific properties set correctly.\n */\n isLondon() {\n return (this.type === 2);\n }\n /**\n * Returns true if hte transaction is a Cancun (i.e. ``type == 3``)\n * transaction. See [[link-eip-4844]].\n */\n isCancun() {\n return (this.type === 3);\n }\n /**\n * Returns a filter which can be used to listen for orphan events\n * that evict this transaction.\n */\n removedEvent() {\n assert(this.isMined(), \"unmined transaction canot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"removeEvent()\" });\n return createRemovedTransactionFilter(this);\n }\n /**\n * Returns a filter which can be used to listen for orphan events\n * that re-order this event against %%other%%.\n */\n reorderedEvent(other) {\n assert(this.isMined(), \"unmined transaction canot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"removeEvent()\" });\n assert(!other || other.isMined(), \"unmined 'other' transaction canot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"removeEvent()\" });\n return createReorderedTransactionFilter(this, other);\n }\n /**\n * Returns a new TransactionResponse instance which has the ability to\n * detect (and throw an error) if the transaction is replaced, which\n * will begin scanning at %%startBlock%%.\n *\n * This should generally not be used by developers and is intended\n * primarily for internal use. Setting an incorrect %%startBlock%% can\n * have devastating performance consequences if used incorrectly.\n */\n replaceableTransaction(startBlock) {\n assertArgument(Number.isInteger(startBlock) && startBlock >= 0, \"invalid startBlock\", \"startBlock\", startBlock);\n const tx = new TransactionResponse(this, this.provider);\n tx.#startBlock = startBlock;\n return tx;\n }\n}\nfunction createOrphanedBlockFilter(block) {\n return { orphan: \"drop-block\", hash: block.hash, number: block.number };\n}\nfunction createReorderedTransactionFilter(tx, other) {\n return { orphan: \"reorder-transaction\", tx, other };\n}\nfunction createRemovedTransactionFilter(tx) {\n return { orphan: \"drop-transaction\", tx };\n}\nfunction createRemovedLogFilter(log) {\n return { orphan: \"drop-log\", log: {\n transactionHash: log.transactionHash,\n blockHash: log.blockHash,\n blockNumber: log.blockNumber,\n address: log.address,\n data: log.data,\n topics: Object.freeze(log.topics.slice()),\n index: log.index\n } };\n}\n//# sourceMappingURL=provider.js.map","// import from provider.ts instead of index.ts to prevent circular dep\n// from EtherscanProvider\nimport { Log, TransactionReceipt, TransactionResponse } from \"../providers/provider.js\";\nimport { defineProperties, EventPayload } from \"../utils/index.js\";\n/**\n * An **EventLog** contains additional properties parsed from the [[Log]].\n */\nexport class EventLog extends Log {\n /**\n * The Contract Interface.\n */\n interface;\n /**\n * The matching event.\n */\n fragment;\n /**\n * The parsed arguments passed to the event by ``emit``.\n */\n args;\n /**\n * @_ignore:\n */\n constructor(log, iface, fragment) {\n super(log, log.provider);\n const args = iface.decodeEventLog(fragment, log.data, log.topics);\n defineProperties(this, { args, fragment, interface: iface });\n }\n /**\n * The name of the event.\n */\n get eventName() { return this.fragment.name; }\n /**\n * The signature of the event.\n */\n get eventSignature() { return this.fragment.format(); }\n}\n/**\n * An **EventLog** contains additional properties parsed from the [[Log]].\n */\nexport class UndecodedEventLog extends Log {\n /**\n * The error encounted when trying to decode the log.\n */\n error;\n /**\n * @_ignore:\n */\n constructor(log, error) {\n super(log, log.provider);\n defineProperties(this, { error });\n }\n}\n/**\n * A **ContractTransactionReceipt** includes the parsed logs from a\n * [[TransactionReceipt]].\n */\nexport class ContractTransactionReceipt extends TransactionReceipt {\n #iface;\n /**\n * @_ignore:\n */\n constructor(iface, provider, tx) {\n super(tx, provider);\n this.#iface = iface;\n }\n /**\n * The parsed logs for any [[Log]] which has a matching event in the\n * Contract ABI.\n */\n get logs() {\n return super.logs.map((log) => {\n const fragment = log.topics.length ? this.#iface.getEvent(log.topics[0]) : null;\n if (fragment) {\n try {\n return new EventLog(log, this.#iface, fragment);\n }\n catch (error) {\n return new UndecodedEventLog(log, error);\n }\n }\n return log;\n });\n }\n}\n/**\n * A **ContractTransactionResponse** will return a\n * [[ContractTransactionReceipt]] when waited on.\n */\nexport class ContractTransactionResponse extends TransactionResponse {\n #iface;\n /**\n * @_ignore:\n */\n constructor(iface, provider, tx) {\n super(tx, provider);\n this.#iface = iface;\n }\n /**\n * Resolves once this transaction has been mined and has\n * %%confirms%% blocks including it (default: ``1``) with an\n * optional %%timeout%%.\n *\n * This can resolve to ``null`` only if %%confirms%% is ``0``\n * and the transaction has not been mined, otherwise this will\n * wait until enough confirmations have completed.\n */\n async wait(confirms, timeout) {\n const receipt = await super.wait(confirms, timeout);\n if (receipt == null) {\n return null;\n }\n return new ContractTransactionReceipt(this.#iface, this.provider, receipt);\n }\n}\n/**\n * A **ContractUnknownEventPayload** is included as the last parameter to\n * Contract Events when the event does not match any events in the ABI.\n */\nexport class ContractUnknownEventPayload extends EventPayload {\n /**\n * The log with no matching events.\n */\n log;\n /**\n * @_event:\n */\n constructor(contract, listener, filter, log) {\n super(contract, listener, filter);\n defineProperties(this, { log });\n }\n /**\n * Resolves to the block the event occured in.\n */\n async getBlock() {\n return await this.log.getBlock();\n }\n /**\n * Resolves to the transaction the event occured in.\n */\n async getTransaction() {\n return await this.log.getTransaction();\n }\n /**\n * Resolves to the transaction receipt the event occured in.\n */\n async getTransactionReceipt() {\n return await this.log.getTransactionReceipt();\n }\n}\n/**\n * A **ContractEventPayload** is included as the last parameter to\n * Contract Events when the event is known.\n */\nexport class ContractEventPayload extends ContractUnknownEventPayload {\n /**\n * @_ignore:\n */\n constructor(contract, listener, filter, fragment, _log) {\n super(contract, listener, filter, new EventLog(_log, contract.interface, fragment));\n const args = contract.interface.decodeEventLog(fragment, this.log.data, this.log.topics);\n defineProperties(this, { args, fragment });\n }\n /**\n * The event name.\n */\n get eventName() {\n return this.fragment.name;\n }\n /**\n * The event signature.\n */\n get eventSignature() {\n return this.fragment.format();\n }\n}\n//# sourceMappingURL=wrappers.js.map","import { Interface, Typed } from \"../abi/index.js\";\nimport { isAddressable, resolveAddress } from \"../address/index.js\";\n// import from provider.ts instead of index.ts to prevent circular dep\n// from EtherscanProvider\nimport { copyRequest, Log } from \"../providers/provider.js\";\nimport { defineProperties, getBigInt, isCallException, isHexString, resolveProperties, isError, makeError, assert, assertArgument } from \"../utils/index.js\";\nimport { ContractEventPayload, ContractUnknownEventPayload, ContractTransactionResponse, EventLog, UndecodedEventLog } from \"./wrappers.js\";\nconst BN_0 = BigInt(0);\nfunction canCall(value) {\n return (value && typeof (value.call) === \"function\");\n}\nfunction canEstimate(value) {\n return (value && typeof (value.estimateGas) === \"function\");\n}\nfunction canResolve(value) {\n return (value && typeof (value.resolveName) === \"function\");\n}\nfunction canSend(value) {\n return (value && typeof (value.sendTransaction) === \"function\");\n}\nfunction getResolver(value) {\n if (value != null) {\n if (canResolve(value)) {\n return value;\n }\n if (value.provider) {\n return value.provider;\n }\n }\n return undefined;\n}\nclass PreparedTopicFilter {\n #filter;\n fragment;\n constructor(contract, fragment, args) {\n defineProperties(this, { fragment });\n if (fragment.inputs.length < args.length) {\n throw new Error(\"too many arguments\");\n }\n // Recursively descend into args and resolve any addresses\n const runner = getRunner(contract.runner, \"resolveName\");\n const resolver = canResolve(runner) ? runner : null;\n this.#filter = (async function () {\n const resolvedArgs = await Promise.all(fragment.inputs.map((param, index) => {\n const arg = args[index];\n if (arg == null) {\n return null;\n }\n return param.walkAsync(args[index], (type, value) => {\n if (type === \"address\") {\n if (Array.isArray(value)) {\n return Promise.all(value.map((v) => resolveAddress(v, resolver)));\n }\n return resolveAddress(value, resolver);\n }\n return value;\n });\n }));\n return contract.interface.encodeFilterTopics(fragment, resolvedArgs);\n })();\n }\n getTopicFilter() {\n return this.#filter;\n }\n}\n// A = Arguments passed in as a tuple\n// R = The result type of the call (i.e. if only one return type,\n// the qualified type, otherwise Result)\n// D = The type the default call will return (i.e. R for view/pure,\n// TransactionResponse otherwise)\n//export interface ContractMethod = Array, R = any, D extends R | ContractTransactionResponse = ContractTransactionResponse> {\nfunction getRunner(value, feature) {\n if (value == null) {\n return null;\n }\n if (typeof (value[feature]) === \"function\") {\n return value;\n }\n if (value.provider && typeof (value.provider[feature]) === \"function\") {\n return value.provider;\n }\n return null;\n}\nfunction getProvider(value) {\n if (value == null) {\n return null;\n }\n return value.provider || null;\n}\n/**\n * @_ignore:\n */\nexport async function copyOverrides(arg, allowed) {\n // Make sure the overrides passed in are a valid overrides object\n const _overrides = Typed.dereference(arg, \"overrides\");\n assertArgument(typeof (_overrides) === \"object\", \"invalid overrides parameter\", \"overrides\", arg);\n // Create a shallow copy (we'll deep-ify anything needed during normalizing)\n const overrides = copyRequest(_overrides);\n assertArgument(overrides.to == null || (allowed || []).indexOf(\"to\") >= 0, \"cannot override to\", \"overrides.to\", overrides.to);\n assertArgument(overrides.data == null || (allowed || []).indexOf(\"data\") >= 0, \"cannot override data\", \"overrides.data\", overrides.data);\n // Resolve any from\n if (overrides.from) {\n overrides.from = overrides.from;\n }\n return overrides;\n}\n/**\n * @_ignore:\n */\nexport async function resolveArgs(_runner, inputs, args) {\n // Recursively descend into args and resolve any addresses\n const runner = getRunner(_runner, \"resolveName\");\n const resolver = canResolve(runner) ? runner : null;\n return await Promise.all(inputs.map((param, index) => {\n return param.walkAsync(args[index], (type, value) => {\n value = Typed.dereference(value, type);\n if (type === \"address\") {\n return resolveAddress(value, resolver);\n }\n return value;\n });\n }));\n}\nfunction buildWrappedFallback(contract) {\n const populateTransaction = async function (overrides) {\n // If an overrides was passed in, copy it and normalize the values\n const tx = (await copyOverrides(overrides, [\"data\"]));\n tx.to = await contract.getAddress();\n if (tx.from) {\n tx.from = await resolveAddress(tx.from, getResolver(contract.runner));\n }\n const iface = contract.interface;\n const noValue = (getBigInt((tx.value || BN_0), \"overrides.value\") === BN_0);\n const noData = ((tx.data || \"0x\") === \"0x\");\n if (iface.fallback && !iface.fallback.payable && iface.receive && !noData && !noValue) {\n assertArgument(false, \"cannot send data to receive or send value to non-payable fallback\", \"overrides\", overrides);\n }\n assertArgument(iface.fallback || noData, \"cannot send data to receive-only contract\", \"overrides.data\", tx.data);\n // Only allow payable contracts to set non-zero value\n const payable = iface.receive || (iface.fallback && iface.fallback.payable);\n assertArgument(payable || noValue, \"cannot send value to non-payable fallback\", \"overrides.value\", tx.value);\n // Only allow fallback contracts to set non-empty data\n assertArgument(iface.fallback || noData, \"cannot send data to receive-only contract\", \"overrides.data\", tx.data);\n return tx;\n };\n const staticCall = async function (overrides) {\n const runner = getRunner(contract.runner, \"call\");\n assert(canCall(runner), \"contract runner does not support calling\", \"UNSUPPORTED_OPERATION\", { operation: \"call\" });\n const tx = await populateTransaction(overrides);\n try {\n return await runner.call(tx);\n }\n catch (error) {\n if (isCallException(error) && error.data) {\n throw contract.interface.makeError(error.data, tx);\n }\n throw error;\n }\n };\n const send = async function (overrides) {\n const runner = contract.runner;\n assert(canSend(runner), \"contract runner does not support sending transactions\", \"UNSUPPORTED_OPERATION\", { operation: \"sendTransaction\" });\n const tx = await runner.sendTransaction(await populateTransaction(overrides));\n const provider = getProvider(contract.runner);\n // @TODO: the provider can be null; make a custom dummy provider that will throw a\n // meaningful error\n return new ContractTransactionResponse(contract.interface, provider, tx);\n };\n const estimateGas = async function (overrides) {\n const runner = getRunner(contract.runner, \"estimateGas\");\n assert(canEstimate(runner), \"contract runner does not support gas estimation\", \"UNSUPPORTED_OPERATION\", { operation: \"estimateGas\" });\n return await runner.estimateGas(await populateTransaction(overrides));\n };\n const method = async (overrides) => {\n return await send(overrides);\n };\n defineProperties(method, {\n _contract: contract,\n estimateGas,\n populateTransaction,\n send, staticCall\n });\n return method;\n}\nfunction buildWrappedMethod(contract, key) {\n const getFragment = function (...args) {\n const fragment = contract.interface.getFunction(key, args);\n assert(fragment, \"no matching fragment\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n info: { key, args }\n });\n return fragment;\n };\n const populateTransaction = async function (...args) {\n const fragment = getFragment(...args);\n // If an overrides was passed in, copy it and normalize the values\n let overrides = {};\n if (fragment.inputs.length + 1 === args.length) {\n overrides = await copyOverrides(args.pop());\n if (overrides.from) {\n overrides.from = await resolveAddress(overrides.from, getResolver(contract.runner));\n }\n }\n if (fragment.inputs.length !== args.length) {\n throw new Error(\"internal error: fragment inputs doesn't match arguments; should not happen\");\n }\n const resolvedArgs = await resolveArgs(contract.runner, fragment.inputs, args);\n return Object.assign({}, overrides, await resolveProperties({\n to: contract.getAddress(),\n data: contract.interface.encodeFunctionData(fragment, resolvedArgs)\n }));\n };\n const staticCall = async function (...args) {\n const result = await staticCallResult(...args);\n if (result.length === 1) {\n return result[0];\n }\n return result;\n };\n const send = async function (...args) {\n const runner = contract.runner;\n assert(canSend(runner), \"contract runner does not support sending transactions\", \"UNSUPPORTED_OPERATION\", { operation: \"sendTransaction\" });\n const tx = await runner.sendTransaction(await populateTransaction(...args));\n const provider = getProvider(contract.runner);\n // @TODO: the provider can be null; make a custom dummy provider that will throw a\n // meaningful error\n return new ContractTransactionResponse(contract.interface, provider, tx);\n };\n const estimateGas = async function (...args) {\n const runner = getRunner(contract.runner, \"estimateGas\");\n assert(canEstimate(runner), \"contract runner does not support gas estimation\", \"UNSUPPORTED_OPERATION\", { operation: \"estimateGas\" });\n return await runner.estimateGas(await populateTransaction(...args));\n };\n const staticCallResult = async function (...args) {\n const runner = getRunner(contract.runner, \"call\");\n assert(canCall(runner), \"contract runner does not support calling\", \"UNSUPPORTED_OPERATION\", { operation: \"call\" });\n const tx = await populateTransaction(...args);\n let result = \"0x\";\n try {\n result = await runner.call(tx);\n }\n catch (error) {\n if (isCallException(error) && error.data) {\n throw contract.interface.makeError(error.data, tx);\n }\n throw error;\n }\n const fragment = getFragment(...args);\n return contract.interface.decodeFunctionResult(fragment, result);\n };\n const method = async (...args) => {\n const fragment = getFragment(...args);\n if (fragment.constant) {\n return await staticCall(...args);\n }\n return await send(...args);\n };\n defineProperties(method, {\n name: contract.interface.getFunctionName(key),\n _contract: contract, _key: key,\n getFragment,\n estimateGas,\n populateTransaction,\n send, staticCall, staticCallResult,\n });\n // Only works on non-ambiguous keys (refined fragment is always non-ambiguous)\n Object.defineProperty(method, \"fragment\", {\n configurable: false,\n enumerable: true,\n get: () => {\n const fragment = contract.interface.getFunction(key);\n assert(fragment, \"no matching fragment\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n info: { key }\n });\n return fragment;\n }\n });\n return method;\n}\nfunction buildWrappedEvent(contract, key) {\n const getFragment = function (...args) {\n const fragment = contract.interface.getEvent(key, args);\n assert(fragment, \"no matching fragment\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n info: { key, args }\n });\n return fragment;\n };\n const method = function (...args) {\n return new PreparedTopicFilter(contract, getFragment(...args), args);\n };\n defineProperties(method, {\n name: contract.interface.getEventName(key),\n _contract: contract, _key: key,\n getFragment\n });\n // Only works on non-ambiguous keys (refined fragment is always non-ambiguous)\n Object.defineProperty(method, \"fragment\", {\n configurable: false,\n enumerable: true,\n get: () => {\n const fragment = contract.interface.getEvent(key);\n assert(fragment, \"no matching fragment\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n info: { key }\n });\n return fragment;\n }\n });\n return method;\n}\n// The combination of TypeScrype, Private Fields and Proxies makes\n// the world go boom; so we hide variables with some trickery keeping\n// a symbol attached to each BaseContract which its sub-class (even\n// via a Proxy) can reach and use to look up its internal values.\nconst internal = Symbol.for(\"_ethersInternal_contract\");\nconst internalValues = new WeakMap();\nfunction setInternal(contract, values) {\n internalValues.set(contract[internal], values);\n}\nfunction getInternal(contract) {\n return internalValues.get(contract[internal]);\n}\nfunction isDeferred(value) {\n return (value && typeof (value) === \"object\" && (\"getTopicFilter\" in value) &&\n (typeof (value.getTopicFilter) === \"function\") && value.fragment);\n}\nasync function getSubInfo(contract, event) {\n let topics;\n let fragment = null;\n // Convert named events to topicHash and get the fragment for\n // events which need deconstructing.\n if (Array.isArray(event)) {\n const topicHashify = function (name) {\n if (isHexString(name, 32)) {\n return name;\n }\n const fragment = contract.interface.getEvent(name);\n assertArgument(fragment, \"unknown fragment\", \"name\", name);\n return fragment.topicHash;\n };\n // Array of Topics and Names; e.g. `[ \"0x1234...89ab\", \"Transfer(address)\" ]`\n topics = event.map((e) => {\n if (e == null) {\n return null;\n }\n if (Array.isArray(e)) {\n return e.map(topicHashify);\n }\n return topicHashify(e);\n });\n }\n else if (event === \"*\") {\n topics = [null];\n }\n else if (typeof (event) === \"string\") {\n if (isHexString(event, 32)) {\n // Topic Hash\n topics = [event];\n }\n else {\n // Name or Signature; e.g. `\"Transfer\", `\"Transfer(address)\"`\n fragment = contract.interface.getEvent(event);\n assertArgument(fragment, \"unknown fragment\", \"event\", event);\n topics = [fragment.topicHash];\n }\n }\n else if (isDeferred(event)) {\n // Deferred Topic Filter; e.g. `contract.filter.Transfer(from)`\n topics = await event.getTopicFilter();\n }\n else if (\"fragment\" in event) {\n // ContractEvent; e.g. `contract.filter.Transfer`\n fragment = event.fragment;\n topics = [fragment.topicHash];\n }\n else {\n assertArgument(false, \"unknown event name\", \"event\", event);\n }\n // Normalize topics and sort TopicSets\n topics = topics.map((t) => {\n if (t == null) {\n return null;\n }\n if (Array.isArray(t)) {\n const items = Array.from(new Set(t.map((t) => t.toLowerCase())).values());\n if (items.length === 1) {\n return items[0];\n }\n items.sort();\n return items;\n }\n return t.toLowerCase();\n });\n const tag = topics.map((t) => {\n if (t == null) {\n return \"null\";\n }\n if (Array.isArray(t)) {\n return t.join(\"|\");\n }\n return t;\n }).join(\"&\");\n return { fragment, tag, topics };\n}\nasync function hasSub(contract, event) {\n const { subs } = getInternal(contract);\n return subs.get((await getSubInfo(contract, event)).tag) || null;\n}\nasync function getSub(contract, operation, event) {\n // Make sure our runner can actually subscribe to events\n const provider = getProvider(contract.runner);\n assert(provider, \"contract runner does not support subscribing\", \"UNSUPPORTED_OPERATION\", { operation });\n const { fragment, tag, topics } = await getSubInfo(contract, event);\n const { addr, subs } = getInternal(contract);\n let sub = subs.get(tag);\n if (!sub) {\n const address = (addr ? addr : contract);\n const filter = { address, topics };\n const listener = (log) => {\n let foundFragment = fragment;\n if (foundFragment == null) {\n try {\n foundFragment = contract.interface.getEvent(log.topics[0]);\n }\n catch (error) { }\n }\n // If fragment is null, we do not deconstruct the args to emit\n if (foundFragment) {\n const _foundFragment = foundFragment;\n const args = fragment ? contract.interface.decodeEventLog(fragment, log.data, log.topics) : [];\n emit(contract, event, args, (listener) => {\n return new ContractEventPayload(contract, listener, event, _foundFragment, log);\n });\n }\n else {\n emit(contract, event, [], (listener) => {\n return new ContractUnknownEventPayload(contract, listener, event, log);\n });\n }\n };\n let starting = [];\n const start = () => {\n if (starting.length) {\n return;\n }\n starting.push(provider.on(filter, listener));\n };\n const stop = async () => {\n if (starting.length == 0) {\n return;\n }\n let started = starting;\n starting = [];\n await Promise.all(started);\n provider.off(filter, listener);\n };\n sub = { tag, listeners: [], start, stop };\n subs.set(tag, sub);\n }\n return sub;\n}\n// We use this to ensure one emit resolves before firing the next to\n// ensure correct ordering (note this cannot throw and just adds the\n// notice to the event queu using setTimeout).\nlet lastEmit = Promise.resolve();\nasync function _emit(contract, event, args, payloadFunc) {\n await lastEmit;\n const sub = await hasSub(contract, event);\n if (!sub) {\n return false;\n }\n const count = sub.listeners.length;\n sub.listeners = sub.listeners.filter(({ listener, once }) => {\n const passArgs = Array.from(args);\n if (payloadFunc) {\n passArgs.push(payloadFunc(once ? null : listener));\n }\n try {\n listener.call(contract, ...passArgs);\n }\n catch (error) { }\n return !once;\n });\n if (sub.listeners.length === 0) {\n sub.stop();\n getInternal(contract).subs.delete(sub.tag);\n }\n return (count > 0);\n}\nasync function emit(contract, event, args, payloadFunc) {\n try {\n await lastEmit;\n }\n catch (error) { }\n const resultPromise = _emit(contract, event, args, payloadFunc);\n lastEmit = resultPromise;\n return await resultPromise;\n}\nconst passProperties = [\"then\"];\nexport class BaseContract {\n /**\n * The target to connect to.\n *\n * This can be an address, ENS name or any [[Addressable]], such as\n * another contract. To get the resolved address, use the ``getAddress``\n * method.\n */\n target;\n /**\n * The contract Interface.\n */\n interface;\n /**\n * The connected runner. This is generally a [[Provider]] or a\n * [[Signer]], which dictates what operations are supported.\n *\n * For example, a **Contract** connected to a [[Provider]] may\n * only execute read-only operations.\n */\n runner;\n /**\n * All the Events available on this contract.\n */\n filters;\n /**\n * @_ignore:\n */\n [internal];\n /**\n * The fallback or receive function if any.\n */\n fallback;\n /**\n * Creates a new contract connected to %%target%% with the %%abi%% and\n * optionally connected to a %%runner%% to perform operations on behalf\n * of.\n */\n constructor(target, abi, runner, _deployTx) {\n assertArgument(typeof (target) === \"string\" || isAddressable(target), \"invalid value for Contract target\", \"target\", target);\n if (runner == null) {\n runner = null;\n }\n const iface = Interface.from(abi);\n defineProperties(this, { target, runner, interface: iface });\n Object.defineProperty(this, internal, { value: {} });\n let addrPromise;\n let addr = null;\n let deployTx = null;\n if (_deployTx) {\n const provider = getProvider(runner);\n // @TODO: the provider can be null; make a custom dummy provider that will throw a\n // meaningful error\n deployTx = new ContractTransactionResponse(this.interface, provider, _deployTx);\n }\n let subs = new Map();\n // Resolve the target as the address\n if (typeof (target) === \"string\") {\n if (isHexString(target)) {\n addr = target;\n addrPromise = Promise.resolve(target);\n }\n else {\n const resolver = getRunner(runner, \"resolveName\");\n if (!canResolve(resolver)) {\n throw makeError(\"contract runner does not support name resolution\", \"UNSUPPORTED_OPERATION\", {\n operation: \"resolveName\"\n });\n }\n addrPromise = resolver.resolveName(target).then((addr) => {\n if (addr == null) {\n throw makeError(\"an ENS name used for a contract target must be correctly configured\", \"UNCONFIGURED_NAME\", {\n value: target\n });\n }\n getInternal(this).addr = addr;\n return addr;\n });\n }\n }\n else {\n addrPromise = target.getAddress().then((addr) => {\n if (addr == null) {\n throw new Error(\"TODO\");\n }\n getInternal(this).addr = addr;\n return addr;\n });\n }\n // Set our private values\n setInternal(this, { addrPromise, addr, deployTx, subs });\n // Add the event filters\n const filters = new Proxy({}, {\n get: (target, prop, receiver) => {\n // Pass important checks (like `then` for Promise) through\n if (typeof (prop) === \"symbol\" || passProperties.indexOf(prop) >= 0) {\n return Reflect.get(target, prop, receiver);\n }\n try {\n return this.getEvent(prop);\n }\n catch (error) {\n if (!isError(error, \"INVALID_ARGUMENT\") || error.argument !== \"key\") {\n throw error;\n }\n }\n return undefined;\n },\n has: (target, prop) => {\n // Pass important checks (like `then` for Promise) through\n if (passProperties.indexOf(prop) >= 0) {\n return Reflect.has(target, prop);\n }\n return Reflect.has(target, prop) || this.interface.hasEvent(String(prop));\n }\n });\n defineProperties(this, { filters });\n defineProperties(this, {\n fallback: ((iface.receive || iface.fallback) ? (buildWrappedFallback(this)) : null)\n });\n // Return a Proxy that will respond to functions\n return new Proxy(this, {\n get: (target, prop, receiver) => {\n if (typeof (prop) === \"symbol\" || prop in target || passProperties.indexOf(prop) >= 0) {\n return Reflect.get(target, prop, receiver);\n }\n // Undefined properties should return undefined\n try {\n return target.getFunction(prop);\n }\n catch (error) {\n if (!isError(error, \"INVALID_ARGUMENT\") || error.argument !== \"key\") {\n throw error;\n }\n }\n return undefined;\n },\n has: (target, prop) => {\n if (typeof (prop) === \"symbol\" || prop in target || passProperties.indexOf(prop) >= 0) {\n return Reflect.has(target, prop);\n }\n return target.interface.hasFunction(prop);\n }\n });\n }\n /**\n * Return a new Contract instance with the same target and ABI, but\n * a different %%runner%%.\n */\n connect(runner) {\n return new BaseContract(this.target, this.interface, runner);\n }\n /**\n * Return a new Contract instance with the same ABI and runner, but\n * a different %%target%%.\n */\n attach(target) {\n return new BaseContract(target, this.interface, this.runner);\n }\n /**\n * Return the resolved address of this Contract.\n */\n async getAddress() { return await getInternal(this).addrPromise; }\n /**\n * Return the deployed bytecode or null if no bytecode is found.\n */\n async getDeployedCode() {\n const provider = getProvider(this.runner);\n assert(provider, \"runner does not support .provider\", \"UNSUPPORTED_OPERATION\", { operation: \"getDeployedCode\" });\n const code = await provider.getCode(await this.getAddress());\n if (code === \"0x\") {\n return null;\n }\n return code;\n }\n /**\n * Resolve to this Contract once the bytecode has been deployed, or\n * resolve immediately if already deployed.\n */\n async waitForDeployment() {\n // We have the deployment transaction; just use that (throws if deployment fails)\n const deployTx = this.deploymentTransaction();\n if (deployTx) {\n await deployTx.wait();\n return this;\n }\n // Check for code\n const code = await this.getDeployedCode();\n if (code != null) {\n return this;\n }\n // Make sure we can subscribe to a provider event\n const provider = getProvider(this.runner);\n assert(provider != null, \"contract runner does not support .provider\", \"UNSUPPORTED_OPERATION\", { operation: \"waitForDeployment\" });\n return new Promise((resolve, reject) => {\n const checkCode = async () => {\n try {\n const code = await this.getDeployedCode();\n if (code != null) {\n return resolve(this);\n }\n provider.once(\"block\", checkCode);\n }\n catch (error) {\n reject(error);\n }\n };\n checkCode();\n });\n }\n /**\n * Return the transaction used to deploy this contract.\n *\n * This is only available if this instance was returned from a\n * [[ContractFactory]].\n */\n deploymentTransaction() {\n return getInternal(this).deployTx;\n }\n /**\n * Return the function for a given name. This is useful when a contract\n * method name conflicts with a JavaScript name such as ``prototype`` or\n * when using a Contract programmatically.\n */\n getFunction(key) {\n if (typeof (key) !== \"string\") {\n key = key.format();\n }\n const func = buildWrappedMethod(this, key);\n return func;\n }\n /**\n * Return the event for a given name. This is useful when a contract\n * event name conflicts with a JavaScript name such as ``prototype`` or\n * when using a Contract programmatically.\n */\n getEvent(key) {\n if (typeof (key) !== \"string\") {\n key = key.format();\n }\n return buildWrappedEvent(this, key);\n }\n /**\n * @_ignore:\n */\n async queryTransaction(hash) {\n throw new Error(\"@TODO\");\n }\n /*\n // @TODO: this is a non-backwards compatible change, but will be added\n // in v7 and in a potential SmartContract class in an upcoming\n // v6 release\n async getTransactionReceipt(hash: string): Promise {\n const provider = getProvider(this.runner);\n assert(provider, \"contract runner does not have a provider\",\n \"UNSUPPORTED_OPERATION\", { operation: \"queryTransaction\" });\n\n const receipt = await provider.getTransactionReceipt(hash);\n if (receipt == null) { return null; }\n\n return new ContractTransactionReceipt(this.interface, provider, receipt);\n }\n */\n /**\n * Provide historic access to event data for %%event%% in the range\n * %%fromBlock%% (default: ``0``) to %%toBlock%% (default: ``\"latest\"``)\n * inclusive.\n */\n async queryFilter(event, fromBlock, toBlock) {\n if (fromBlock == null) {\n fromBlock = 0;\n }\n if (toBlock == null) {\n toBlock = \"latest\";\n }\n const { addr, addrPromise } = getInternal(this);\n const address = (addr ? addr : (await addrPromise));\n const { fragment, topics } = await getSubInfo(this, event);\n const filter = { address, topics, fromBlock, toBlock };\n const provider = getProvider(this.runner);\n assert(provider, \"contract runner does not have a provider\", \"UNSUPPORTED_OPERATION\", { operation: \"queryFilter\" });\n return (await provider.getLogs(filter)).map((log) => {\n let foundFragment = fragment;\n if (foundFragment == null) {\n try {\n foundFragment = this.interface.getEvent(log.topics[0]);\n }\n catch (error) { }\n }\n if (foundFragment) {\n try {\n return new EventLog(log, this.interface, foundFragment);\n }\n catch (error) {\n return new UndecodedEventLog(log, error);\n }\n }\n return new Log(log, provider);\n });\n }\n /**\n * Add an event %%listener%% for the %%event%%.\n */\n async on(event, listener) {\n const sub = await getSub(this, \"on\", event);\n sub.listeners.push({ listener, once: false });\n sub.start();\n return this;\n }\n /**\n * Add an event %%listener%% for the %%event%%, but remove the listener\n * after it is fired once.\n */\n async once(event, listener) {\n const sub = await getSub(this, \"once\", event);\n sub.listeners.push({ listener, once: true });\n sub.start();\n return this;\n }\n /**\n * Emit an %%event%% calling all listeners with %%args%%.\n *\n * Resolves to ``true`` if any listeners were called.\n */\n async emit(event, ...args) {\n return await emit(this, event, args, null);\n }\n /**\n * Resolves to the number of listeners of %%event%% or the total number\n * of listeners if unspecified.\n */\n async listenerCount(event) {\n if (event) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return 0;\n }\n return sub.listeners.length;\n }\n const { subs } = getInternal(this);\n let total = 0;\n for (const { listeners } of subs.values()) {\n total += listeners.length;\n }\n return total;\n }\n /**\n * Resolves to the listeners subscribed to %%event%% or all listeners\n * if unspecified.\n */\n async listeners(event) {\n if (event) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return [];\n }\n return sub.listeners.map(({ listener }) => listener);\n }\n const { subs } = getInternal(this);\n let result = [];\n for (const { listeners } of subs.values()) {\n result = result.concat(listeners.map(({ listener }) => listener));\n }\n return result;\n }\n /**\n * Remove the %%listener%% from the listeners for %%event%% or remove\n * all listeners if unspecified.\n */\n async off(event, listener) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return this;\n }\n if (listener) {\n const index = sub.listeners.map(({ listener }) => listener).indexOf(listener);\n if (index >= 0) {\n sub.listeners.splice(index, 1);\n }\n }\n if (listener == null || sub.listeners.length === 0) {\n sub.stop();\n getInternal(this).subs.delete(sub.tag);\n }\n return this;\n }\n /**\n * Remove all the listeners for %%event%% or remove all listeners if\n * unspecified.\n */\n async removeAllListeners(event) {\n if (event) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return this;\n }\n sub.stop();\n getInternal(this).subs.delete(sub.tag);\n }\n else {\n const { subs } = getInternal(this);\n for (const { tag, stop } of subs.values()) {\n stop();\n subs.delete(tag);\n }\n }\n return this;\n }\n /**\n * Alias for [on].\n */\n async addListener(event, listener) {\n return await this.on(event, listener);\n }\n /**\n * Alias for [off].\n */\n async removeListener(event, listener) {\n return await this.off(event, listener);\n }\n /**\n * Create a new Class for the %%abi%%.\n */\n static buildClass(abi) {\n class CustomContract extends BaseContract {\n constructor(address, runner = null) {\n super(address, abi, runner);\n }\n }\n return CustomContract;\n }\n ;\n /**\n * Create a new BaseContract with a specified Interface.\n */\n static from(target, abi, runner) {\n if (runner == null) {\n runner = null;\n }\n const contract = new this(target, abi, runner);\n return contract;\n }\n}\nfunction _ContractBase() {\n return BaseContract;\n}\n/**\n * A [[BaseContract]] with no type guards on its methods or events.\n */\nexport class Contract extends _ContractBase() {\n}\n//# sourceMappingURL=contract.js.map","import { Interface } from \"../abi/index.js\";\nimport { getCreateAddress } from \"../address/index.js\";\nimport { concat, defineProperties, getBytes, hexlify, assert, assertArgument } from \"../utils/index.js\";\nimport { BaseContract, copyOverrides, resolveArgs } from \"./contract.js\";\n// A = Arguments to the constructor\n// I = Interface of deployed contracts\n/**\n * A **ContractFactory** is used to deploy a Contract to the blockchain.\n */\nexport class ContractFactory {\n /**\n * The Contract Interface.\n */\n interface;\n /**\n * The Contract deployment bytecode. Often called the initcode.\n */\n bytecode;\n /**\n * The ContractRunner to deploy the Contract as.\n */\n runner;\n /**\n * Create a new **ContractFactory** with %%abi%% and %%bytecode%%,\n * optionally connected to %%runner%%.\n *\n * The %%bytecode%% may be the ``bytecode`` property within the\n * standard Solidity JSON output.\n */\n constructor(abi, bytecode, runner) {\n const iface = Interface.from(abi);\n // Dereference Solidity bytecode objects and allow a missing `0x`-prefix\n if (bytecode instanceof Uint8Array) {\n bytecode = hexlify(getBytes(bytecode));\n }\n else {\n if (typeof (bytecode) === \"object\") {\n bytecode = bytecode.object;\n }\n if (!bytecode.startsWith(\"0x\")) {\n bytecode = \"0x\" + bytecode;\n }\n bytecode = hexlify(getBytes(bytecode));\n }\n defineProperties(this, {\n bytecode, interface: iface, runner: (runner || null)\n });\n }\n attach(target) {\n return new BaseContract(target, this.interface, this.runner);\n }\n /**\n * Resolves to the transaction to deploy the contract, passing %%args%%\n * into the constructor.\n */\n async getDeployTransaction(...args) {\n let overrides = {};\n const fragment = this.interface.deploy;\n if (fragment.inputs.length + 1 === args.length) {\n overrides = await copyOverrides(args.pop());\n }\n if (fragment.inputs.length !== args.length) {\n throw new Error(\"incorrect number of arguments to constructor\");\n }\n const resolvedArgs = await resolveArgs(this.runner, fragment.inputs, args);\n const data = concat([this.bytecode, this.interface.encodeDeploy(resolvedArgs)]);\n return Object.assign({}, overrides, { data });\n }\n /**\n * Resolves to the Contract deployed by passing %%args%% into the\n * constructor.\n *\n * This will resolve to the Contract before it has been deployed to the\n * network, so the [[BaseContract-waitForDeployment]] should be used before\n * sending any transactions to it.\n */\n async deploy(...args) {\n const tx = await this.getDeployTransaction(...args);\n assert(this.runner && typeof (this.runner.sendTransaction) === \"function\", \"factory runner does not support sending transactions\", \"UNSUPPORTED_OPERATION\", {\n operation: \"sendTransaction\"\n });\n const sentTx = await this.runner.sendTransaction(tx);\n const address = getCreateAddress(sentTx);\n return new BaseContract(address, this.interface, this.runner, sentTx);\n }\n /**\n * Return a new **ContractFactory** with the same ABI and bytecode,\n * but connected to %%runner%%.\n */\n connect(runner) {\n return new ContractFactory(this.interface, this.bytecode, runner);\n }\n /**\n * Create a new **ContractFactory** from the standard Solidity JSON output.\n */\n static fromSolidity(output, runner) {\n assertArgument(output != null, \"bad compiler output\", \"output\", output);\n if (typeof (output) === \"string\") {\n output = JSON.parse(output);\n }\n const abi = output.abi;\n let bytecode = \"\";\n if (output.bytecode) {\n bytecode = output.bytecode;\n }\n else if (output.evm && output.evm.bytecode) {\n bytecode = output.evm.bytecode;\n }\n return new this(abi, bytecode, runner);\n }\n}\n//# sourceMappingURL=factory.js.map","/**\n * ENS is a service which allows easy-to-remember names to map to\n * network addresses.\n *\n * @_section: api/providers/ens-resolver:ENS Resolver [about-ens-rsolver]\n */\nimport { getAddress } from \"../address/index.js\";\nimport { ZeroAddress } from \"../constants/index.js\";\nimport { Contract } from \"../contract/index.js\";\nimport { dnsEncode, namehash } from \"../hash/index.js\";\nimport { hexlify, isHexString, toBeHex, defineProperties, encodeBase58, assert, assertArgument, isError, FetchRequest } from \"../utils/index.js\";\n// @TODO: This should use the fetch-data:ipfs gateway\n// Trim off the ipfs:// prefix and return the default gateway URL\nfunction getIpfsLink(link) {\n if (link.match(/^ipfs:\\/\\/ipfs\\//i)) {\n link = link.substring(12);\n }\n else if (link.match(/^ipfs:\\/\\//i)) {\n link = link.substring(7);\n }\n else {\n assertArgument(false, \"unsupported IPFS format\", \"link\", link);\n }\n return `https:/\\/gateway.ipfs.io/ipfs/${link}`;\n}\n;\n;\n/**\n * A provider plugin super-class for processing multicoin address types.\n */\nexport class MulticoinProviderPlugin {\n /**\n * The name.\n */\n name;\n /**\n * Creates a new **MulticoinProviderPluing** for %%name%%.\n */\n constructor(name) {\n defineProperties(this, { name });\n }\n connect(proivder) {\n return this;\n }\n /**\n * Returns ``true`` if %%coinType%% is supported by this plugin.\n */\n supportsCoinType(coinType) {\n return false;\n }\n /**\n * Resolves to the encoded %%address%% for %%coinType%%.\n */\n async encodeAddress(coinType, address) {\n throw new Error(\"unsupported coin\");\n }\n /**\n * Resolves to the decoded %%data%% for %%coinType%%.\n */\n async decodeAddress(coinType, data) {\n throw new Error(\"unsupported coin\");\n }\n}\nconst BasicMulticoinPluginId = \"org.ethers.plugins.provider.BasicMulticoin\";\n/**\n * A **BasicMulticoinProviderPlugin** provides service for common\n * coin types, which do not require additional libraries to encode or\n * decode.\n */\nexport class BasicMulticoinProviderPlugin extends MulticoinProviderPlugin {\n /**\n * Creates a new **BasicMulticoinProviderPlugin**.\n */\n constructor() {\n super(BasicMulticoinPluginId);\n }\n}\nconst matcherIpfs = new RegExp(\"^(ipfs):/\\/(.*)$\", \"i\");\nconst matchers = [\n new RegExp(\"^(https):/\\/(.*)$\", \"i\"),\n new RegExp(\"^(data):(.*)$\", \"i\"),\n matcherIpfs,\n new RegExp(\"^eip155:[0-9]+/(erc[0-9]+):(.*)$\", \"i\"),\n];\n/**\n * A connected object to a resolved ENS name resolver, which can be\n * used to query additional details.\n */\nexport class EnsResolver {\n /**\n * The connected provider.\n */\n provider;\n /**\n * The address of the resolver.\n */\n address;\n /**\n * The name this resolver was resolved against.\n */\n name;\n // For EIP-2544 names, the ancestor that provided the resolver\n #supports2544;\n #resolver;\n constructor(provider, address, name) {\n defineProperties(this, { provider, address, name });\n this.#supports2544 = null;\n this.#resolver = new Contract(address, [\n \"function supportsInterface(bytes4) view returns (bool)\",\n \"function resolve(bytes, bytes) view returns (bytes)\",\n \"function addr(bytes32) view returns (address)\",\n \"function addr(bytes32, uint) view returns (bytes)\",\n \"function text(bytes32, string) view returns (string)\",\n \"function contenthash(bytes32) view returns (bytes)\",\n ], provider);\n }\n /**\n * Resolves to true if the resolver supports wildcard resolution.\n */\n async supportsWildcard() {\n if (this.#supports2544 == null) {\n this.#supports2544 = (async () => {\n try {\n return await this.#resolver.supportsInterface(\"0x9061b923\");\n }\n catch (error) {\n // Wildcard resolvers must understand supportsInterface\n // and return true.\n if (isError(error, \"CALL_EXCEPTION\")) {\n return false;\n }\n // Let future attempts try again...\n this.#supports2544 = null;\n throw error;\n }\n })();\n }\n return await this.#supports2544;\n }\n async #fetch(funcName, params) {\n params = (params || []).slice();\n const iface = this.#resolver.interface;\n // The first parameters is always the nodehash\n params.unshift(namehash(this.name));\n let fragment = null;\n if (await this.supportsWildcard()) {\n fragment = iface.getFunction(funcName);\n assert(fragment, \"missing fragment\", \"UNKNOWN_ERROR\", {\n info: { funcName }\n });\n params = [\n dnsEncode(this.name, 255),\n iface.encodeFunctionData(fragment, params)\n ];\n funcName = \"resolve(bytes,bytes)\";\n }\n params.push({\n enableCcipRead: true\n });\n try {\n const result = await this.#resolver[funcName](...params);\n if (fragment) {\n return iface.decodeFunctionResult(fragment, result)[0];\n }\n return result;\n }\n catch (error) {\n if (!isError(error, \"CALL_EXCEPTION\")) {\n throw error;\n }\n }\n return null;\n }\n /**\n * Resolves to the address for %%coinType%% or null if the\n * provided %%coinType%% has not been configured.\n */\n async getAddress(coinType) {\n if (coinType == null) {\n coinType = 60;\n }\n if (coinType === 60) {\n try {\n const result = await this.#fetch(\"addr(bytes32)\");\n // No address\n if (result == null || result === ZeroAddress) {\n return null;\n }\n return result;\n }\n catch (error) {\n if (isError(error, \"CALL_EXCEPTION\")) {\n return null;\n }\n throw error;\n }\n }\n // Try decoding its EVM canonical chain as an EVM chain address first\n if (coinType >= 0 && coinType < 0x80000000) {\n let ethCoinType = coinType + 0x80000000;\n const data = await this.#fetch(\"addr(bytes32,uint)\", [ethCoinType]);\n if (isHexString(data, 20)) {\n return getAddress(data);\n }\n }\n let coinPlugin = null;\n for (const plugin of this.provider.plugins) {\n if (!(plugin instanceof MulticoinProviderPlugin)) {\n continue;\n }\n if (plugin.supportsCoinType(coinType)) {\n coinPlugin = plugin;\n break;\n }\n }\n if (coinPlugin == null) {\n return null;\n }\n // keccak256(\"addr(bytes32,uint256\")\n const data = await this.#fetch(\"addr(bytes32,uint)\", [coinType]);\n // No address\n if (data == null || data === \"0x\") {\n return null;\n }\n // Compute the address\n const address = await coinPlugin.decodeAddress(coinType, data);\n if (address != null) {\n return address;\n }\n assert(false, `invalid coin data`, \"UNSUPPORTED_OPERATION\", {\n operation: `getAddress(${coinType})`,\n info: { coinType, data }\n });\n }\n /**\n * Resolves to the EIP-634 text record for %%key%%, or ``null``\n * if unconfigured.\n */\n async getText(key) {\n const data = await this.#fetch(\"text(bytes32,string)\", [key]);\n if (data == null || data === \"0x\") {\n return null;\n }\n return data;\n }\n /**\n * Rsolves to the content-hash or ``null`` if unconfigured.\n */\n async getContentHash() {\n // keccak256(\"contenthash()\")\n const data = await this.#fetch(\"contenthash(bytes32)\");\n // No contenthash\n if (data == null || data === \"0x\") {\n return null;\n }\n // IPFS (CID: 1, Type: 70=DAG-PB, 72=libp2p-key)\n const ipfs = data.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);\n if (ipfs) {\n const scheme = (ipfs[1] === \"e3010170\") ? \"ipfs\" : \"ipns\";\n const length = parseInt(ipfs[4], 16);\n if (ipfs[5].length === length * 2) {\n return `${scheme}:/\\/${encodeBase58(\"0x\" + ipfs[2])}`;\n }\n }\n // Swarm (CID: 1, Type: swarm-manifest; hash/length hard-coded to keccak256/32)\n const swarm = data.match(/^0xe40101fa011b20([0-9a-f]*)$/);\n if (swarm && swarm[1].length === 64) {\n return `bzz:/\\/${swarm[1]}`;\n }\n assert(false, `invalid or unsupported content hash data`, \"UNSUPPORTED_OPERATION\", {\n operation: \"getContentHash()\",\n info: { data }\n });\n }\n /**\n * Resolves to the avatar url or ``null`` if the avatar is either\n * unconfigured or incorrectly configured (e.g. references an NFT\n * not owned by the address).\n *\n * If diagnosing issues with configurations, the [[_getAvatar]]\n * method may be useful.\n */\n async getAvatar() {\n const avatar = await this._getAvatar();\n return avatar.url;\n }\n /**\n * When resolving an avatar, there are many steps involved, such\n * fetching metadata and possibly validating ownership of an\n * NFT.\n *\n * This method can be used to examine each step and the value it\n * was working from.\n */\n async _getAvatar() {\n const linkage = [{ type: \"name\", value: this.name }];\n try {\n // test data for ricmoo.eth\n //const avatar = \"eip155:1/erc721:0x265385c7f4132228A0d54EB1A9e7460b91c0cC68/29233\";\n const avatar = await this.getText(\"avatar\");\n if (avatar == null) {\n linkage.push({ type: \"!avatar\", value: \"\" });\n return { url: null, linkage };\n }\n linkage.push({ type: \"avatar\", value: avatar });\n for (let i = 0; i < matchers.length; i++) {\n const match = avatar.match(matchers[i]);\n if (match == null) {\n continue;\n }\n const scheme = match[1].toLowerCase();\n switch (scheme) {\n case \"https\":\n case \"data\":\n linkage.push({ type: \"url\", value: avatar });\n return { linkage, url: avatar };\n case \"ipfs\": {\n const url = getIpfsLink(avatar);\n linkage.push({ type: \"ipfs\", value: avatar });\n linkage.push({ type: \"url\", value: url });\n return { linkage, url };\n }\n case \"erc721\":\n case \"erc1155\": {\n // Depending on the ERC type, use tokenURI(uint256) or url(uint256)\n const selector = (scheme === \"erc721\") ? \"tokenURI(uint256)\" : \"uri(uint256)\";\n linkage.push({ type: scheme, value: avatar });\n // The owner of this name\n const owner = await this.getAddress();\n if (owner == null) {\n linkage.push({ type: \"!owner\", value: \"\" });\n return { url: null, linkage };\n }\n const comps = (match[2] || \"\").split(\"/\");\n if (comps.length !== 2) {\n linkage.push({ type: `!${scheme}caip`, value: (match[2] || \"\") });\n return { url: null, linkage };\n }\n const tokenId = comps[1];\n const contract = new Contract(comps[0], [\n // ERC-721\n \"function tokenURI(uint) view returns (string)\",\n \"function ownerOf(uint) view returns (address)\",\n // ERC-1155\n \"function uri(uint) view returns (string)\",\n \"function balanceOf(address, uint256) view returns (uint)\"\n ], this.provider);\n // Check that this account owns the token\n if (scheme === \"erc721\") {\n const tokenOwner = await contract.ownerOf(tokenId);\n if (owner !== tokenOwner) {\n linkage.push({ type: \"!owner\", value: tokenOwner });\n return { url: null, linkage };\n }\n linkage.push({ type: \"owner\", value: tokenOwner });\n }\n else if (scheme === \"erc1155\") {\n const balance = await contract.balanceOf(owner, tokenId);\n if (!balance) {\n linkage.push({ type: \"!balance\", value: \"0\" });\n return { url: null, linkage };\n }\n linkage.push({ type: \"balance\", value: balance.toString() });\n }\n // Call the token contract for the metadata URL\n let metadataUrl = await contract[selector](tokenId);\n if (metadataUrl == null || metadataUrl === \"0x\") {\n linkage.push({ type: \"!metadata-url\", value: \"\" });\n return { url: null, linkage };\n }\n linkage.push({ type: \"metadata-url-base\", value: metadataUrl });\n // ERC-1155 allows a generic {id} in the URL\n if (scheme === \"erc1155\") {\n metadataUrl = metadataUrl.replace(\"{id}\", toBeHex(tokenId, 32).substring(2));\n linkage.push({ type: \"metadata-url-expanded\", value: metadataUrl });\n }\n // Transform IPFS metadata links\n if (metadataUrl.match(/^ipfs:/i)) {\n metadataUrl = getIpfsLink(metadataUrl);\n }\n linkage.push({ type: \"metadata-url\", value: metadataUrl });\n // Get the token metadata\n let metadata = {};\n const response = await (new FetchRequest(metadataUrl)).send();\n response.assertOk();\n try {\n metadata = response.bodyJson;\n }\n catch (error) {\n try {\n linkage.push({ type: \"!metadata\", value: response.bodyText });\n }\n catch (error) {\n const bytes = response.body;\n if (bytes) {\n linkage.push({ type: \"!metadata\", value: hexlify(bytes) });\n }\n return { url: null, linkage };\n }\n return { url: null, linkage };\n }\n if (!metadata) {\n linkage.push({ type: \"!metadata\", value: \"\" });\n return { url: null, linkage };\n }\n linkage.push({ type: \"metadata\", value: JSON.stringify(metadata) });\n // Pull the image URL out\n let imageUrl = metadata.image;\n if (typeof (imageUrl) !== \"string\") {\n linkage.push({ type: \"!imageUrl\", value: \"\" });\n return { url: null, linkage };\n }\n if (imageUrl.match(/^(https:\\/\\/|data:)/i)) {\n // Allow\n }\n else {\n // Transform IPFS link to gateway\n const ipfs = imageUrl.match(matcherIpfs);\n if (ipfs == null) {\n linkage.push({ type: \"!imageUrl-ipfs\", value: imageUrl });\n return { url: null, linkage };\n }\n linkage.push({ type: \"imageUrl-ipfs\", value: imageUrl });\n imageUrl = getIpfsLink(imageUrl);\n }\n linkage.push({ type: \"url\", value: imageUrl });\n return { linkage, url: imageUrl };\n }\n }\n }\n }\n catch (error) { }\n return { linkage, url: null };\n }\n static async getEnsAddress(provider) {\n const network = await provider.getNetwork();\n const ensPlugin = network.getPlugin(\"org.ethers.plugins.network.Ens\");\n // No ENS...\n assert(ensPlugin, \"network does not support ENS\", \"UNSUPPORTED_OPERATION\", {\n operation: \"getEnsAddress\", info: { network }\n });\n return ensPlugin.address;\n }\n static async #getResolver(provider, name) {\n const ensAddr = await EnsResolver.getEnsAddress(provider);\n try {\n const contract = new Contract(ensAddr, [\n \"function resolver(bytes32) view returns (address)\"\n ], provider);\n const addr = await contract.resolver(namehash(name), {\n enableCcipRead: true\n });\n if (addr === ZeroAddress) {\n return null;\n }\n return addr;\n }\n catch (error) {\n // ENS registry cannot throw errors on resolver(bytes32),\n // so probably a link error\n throw error;\n }\n return null;\n }\n /**\n * Resolve to the ENS resolver for %%name%% using %%provider%% or\n * ``null`` if unconfigured.\n */\n static async fromName(provider, name) {\n let currentName = name;\n while (true) {\n if (currentName === \"\" || currentName === \".\") {\n return null;\n }\n // Optimization since the eth node cannot change and does\n // not have a wildcard resolver\n if (name !== \"eth\" && currentName === \"eth\") {\n return null;\n }\n // Check the current node for a resolver\n const addr = await EnsResolver.#getResolver(provider, currentName);\n // Found a resolver!\n if (addr != null) {\n const resolver = new EnsResolver(provider, addr, name);\n // Legacy resolver found, using EIP-2544 so it isn't safe to use\n if (currentName !== name && !(await resolver.supportsWildcard())) {\n return null;\n }\n return resolver;\n }\n // Get the parent node\n currentName = currentName.split(\".\").slice(1).join(\".\");\n }\n }\n}\n//# sourceMappingURL=ens-resolver.js.map","/**\n * @_ignore\n */\nimport { getAddress, getCreateAddress } from \"../address/index.js\";\nimport { Signature } from \"../crypto/index.js\";\nimport { accessListify } from \"../transaction/index.js\";\nimport { getBigInt, getNumber, hexlify, isHexString, zeroPadValue, assert, assertArgument } from \"../utils/index.js\";\nconst BN_0 = BigInt(0);\nexport function allowNull(format, nullValue) {\n return (function (value) {\n if (value == null) {\n return nullValue;\n }\n return format(value);\n });\n}\nexport function arrayOf(format, allowNull) {\n return ((array) => {\n if (allowNull && array == null) {\n return null;\n }\n if (!Array.isArray(array)) {\n throw new Error(\"not an array\");\n }\n return array.map((i) => format(i));\n });\n}\n// Requires an object which matches a fleet of other formatters\n// Any FormatFunc may return `undefined` to have the value omitted\n// from the result object. Calls preserve `this`.\nexport function object(format, altNames) {\n return ((value) => {\n const result = {};\n for (const key in format) {\n let srcKey = key;\n if (altNames && key in altNames && !(srcKey in value)) {\n for (const altKey of altNames[key]) {\n if (altKey in value) {\n srcKey = altKey;\n break;\n }\n }\n }\n try {\n const nv = format[key](value[srcKey]);\n if (nv !== undefined) {\n result[key] = nv;\n }\n }\n catch (error) {\n const message = (error instanceof Error) ? error.message : \"not-an-error\";\n assert(false, `invalid value for value.${key} (${message})`, \"BAD_DATA\", { value });\n }\n }\n return result;\n });\n}\nexport function formatBoolean(value) {\n switch (value) {\n case true:\n case \"true\":\n return true;\n case false:\n case \"false\":\n return false;\n }\n assertArgument(false, `invalid boolean; ${JSON.stringify(value)}`, \"value\", value);\n}\nexport function formatData(value) {\n assertArgument(isHexString(value, true), \"invalid data\", \"value\", value);\n return value;\n}\nexport function formatHash(value) {\n assertArgument(isHexString(value, 32), \"invalid hash\", \"value\", value);\n return value;\n}\nexport function formatUint256(value) {\n if (!isHexString(value)) {\n throw new Error(\"invalid uint256\");\n }\n return zeroPadValue(value, 32);\n}\nconst _formatLog = object({\n address: getAddress,\n blockHash: formatHash,\n blockNumber: getNumber,\n data: formatData,\n index: getNumber,\n removed: allowNull(formatBoolean, false),\n topics: arrayOf(formatHash),\n transactionHash: formatHash,\n transactionIndex: getNumber,\n}, {\n index: [\"logIndex\"]\n});\nexport function formatLog(value) {\n return _formatLog(value);\n}\nconst _formatBlock = object({\n hash: allowNull(formatHash),\n parentHash: formatHash,\n parentBeaconBlockRoot: allowNull(formatHash, null),\n number: getNumber,\n timestamp: getNumber,\n nonce: allowNull(formatData),\n difficulty: getBigInt,\n gasLimit: getBigInt,\n gasUsed: getBigInt,\n stateRoot: allowNull(formatHash, null),\n receiptsRoot: allowNull(formatHash, null),\n blobGasUsed: allowNull(getBigInt, null),\n excessBlobGas: allowNull(getBigInt, null),\n miner: allowNull(getAddress),\n prevRandao: allowNull(formatHash, null),\n extraData: formatData,\n baseFeePerGas: allowNull(getBigInt)\n}, {\n prevRandao: [\"mixHash\"]\n});\nexport function formatBlock(value) {\n const result = _formatBlock(value);\n result.transactions = value.transactions.map((tx) => {\n if (typeof (tx) === \"string\") {\n return tx;\n }\n return formatTransactionResponse(tx);\n });\n return result;\n}\nconst _formatReceiptLog = object({\n transactionIndex: getNumber,\n blockNumber: getNumber,\n transactionHash: formatHash,\n address: getAddress,\n topics: arrayOf(formatHash),\n data: formatData,\n index: getNumber,\n blockHash: formatHash,\n}, {\n index: [\"logIndex\"]\n});\nexport function formatReceiptLog(value) {\n return _formatReceiptLog(value);\n}\nconst _formatTransactionReceipt = object({\n to: allowNull(getAddress, null),\n from: allowNull(getAddress, null),\n contractAddress: allowNull(getAddress, null),\n // should be allowNull(hash), but broken-EIP-658 support is handled in receipt\n index: getNumber,\n root: allowNull(hexlify),\n gasUsed: getBigInt,\n blobGasUsed: allowNull(getBigInt, null),\n logsBloom: allowNull(formatData),\n blockHash: formatHash,\n hash: formatHash,\n logs: arrayOf(formatReceiptLog),\n blockNumber: getNumber,\n //confirmations: allowNull(getNumber, null),\n cumulativeGasUsed: getBigInt,\n effectiveGasPrice: allowNull(getBigInt),\n blobGasPrice: allowNull(getBigInt, null),\n status: allowNull(getNumber),\n type: allowNull(getNumber, 0)\n}, {\n effectiveGasPrice: [\"gasPrice\"],\n hash: [\"transactionHash\"],\n index: [\"transactionIndex\"],\n});\nexport function formatTransactionReceipt(value) {\n return _formatTransactionReceipt(value);\n}\nexport function formatTransactionResponse(value) {\n // Some clients (TestRPC) do strange things like return 0x0 for the\n // 0 address; correct this to be a real address\n if (value.to && getBigInt(value.to) === BN_0) {\n value.to = \"0x0000000000000000000000000000000000000000\";\n }\n const result = object({\n hash: formatHash,\n // Some nodes do not return this, usually test nodes (like Ganache)\n index: allowNull(getNumber, undefined),\n type: (value) => {\n if (value === \"0x\" || value == null) {\n return 0;\n }\n return getNumber(value);\n },\n accessList: allowNull(accessListify, null),\n blobVersionedHashes: allowNull(arrayOf(formatHash, true), null),\n authorizationList: allowNull(arrayOf((v) => {\n let sig;\n if (v.signature) {\n sig = v.signature;\n }\n else {\n let yParity = v.yParity;\n if (yParity === \"0x1b\") {\n yParity = 0;\n }\n else if (yParity === \"0x1c\") {\n yParity = 1;\n }\n sig = Object.assign({}, v, { yParity });\n }\n return {\n address: getAddress(v.address),\n chainId: getBigInt(v.chainId),\n nonce: getBigInt(v.nonce),\n signature: Signature.from(sig)\n };\n }, false), null),\n blockHash: allowNull(formatHash, null),\n blockNumber: allowNull(getNumber, null),\n transactionIndex: allowNull(getNumber, null),\n from: getAddress,\n // either (gasPrice) or (maxPriorityFeePerGas + maxFeePerGas) must be set\n gasPrice: allowNull(getBigInt),\n maxPriorityFeePerGas: allowNull(getBigInt),\n maxFeePerGas: allowNull(getBigInt),\n maxFeePerBlobGas: allowNull(getBigInt, null),\n gasLimit: getBigInt,\n to: allowNull(getAddress, null),\n value: getBigInt,\n nonce: getNumber,\n data: formatData,\n creates: allowNull(getAddress, null),\n chainId: allowNull(getBigInt, null)\n }, {\n data: [\"input\"],\n gasLimit: [\"gas\"],\n index: [\"transactionIndex\"]\n })(value);\n // If to and creates are empty, populate the creates from the value\n if (result.to == null && result.creates == null) {\n result.creates = getCreateAddress(result);\n }\n // @TODO: Check fee data\n // Add an access list to supported transaction types\n if ((value.type === 1 || value.type === 2) && value.accessList == null) {\n result.accessList = [];\n }\n // Compute the signature\n if (value.signature) {\n result.signature = Signature.from(value.signature);\n }\n else {\n result.signature = Signature.from(value);\n }\n // Some backends omit ChainId on legacy transactions, but we can compute it\n if (result.chainId == null) {\n const chainId = result.signature.legacyChainId;\n if (chainId != null) {\n result.chainId = chainId;\n }\n }\n // @TODO: check chainID\n /*\n if (value.chainId != null) {\n let chainId = value.chainId;\n\n if (isHexString(chainId)) {\n chainId = BigNumber.from(chainId).toNumber();\n }\n\n result.chainId = chainId;\n\n } else {\n let chainId = value.networkId;\n\n // geth-etc returns chainId\n if (chainId == null && result.v == null) {\n chainId = value.chainId;\n }\n\n if (isHexString(chainId)) {\n chainId = BigNumber.from(chainId).toNumber();\n }\n\n if (typeof(chainId) !== \"number\" && result.v != null) {\n chainId = (result.v - 35) / 2;\n if (chainId < 0) { chainId = 0; }\n chainId = parseInt(chainId);\n }\n\n if (typeof(chainId) !== \"number\") { chainId = 0; }\n\n result.chainId = chainId;\n }\n */\n // 0x0000... should actually be null\n if (result.blockHash && getBigInt(result.blockHash) === BN_0) {\n result.blockHash = null;\n }\n return result;\n}\n//# sourceMappingURL=format.js.map","import { defineProperties } from \"../utils/properties.js\";\nimport { assertArgument } from \"../utils/index.js\";\nconst EnsAddress = \"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e\";\n/**\n * A **NetworkPlugin** provides additional functionality on a [[Network]].\n */\nexport class NetworkPlugin {\n /**\n * The name of the plugin.\n *\n * It is recommended to use reverse-domain-notation, which permits\n * unique names with a known authority as well as hierarchal entries.\n */\n name;\n /**\n * Creates a new **NetworkPlugin**.\n */\n constructor(name) {\n defineProperties(this, { name });\n }\n /**\n * Creates a copy of this plugin.\n */\n clone() {\n return new NetworkPlugin(this.name);\n }\n}\n/**\n * A **GasCostPlugin** allows a network to provide alternative values when\n * computing the intrinsic gas required for a transaction.\n */\nexport class GasCostPlugin extends NetworkPlugin {\n /**\n * The block number to treat these values as valid from.\n *\n * This allows a hardfork to have updated values included as well as\n * mulutiple hardforks to be supported.\n */\n effectiveBlock;\n /**\n * The transactions base fee.\n */\n txBase;\n /**\n * The fee for creating a new account.\n */\n txCreate;\n /**\n * The fee per zero-byte in the data.\n */\n txDataZero;\n /**\n * The fee per non-zero-byte in the data.\n */\n txDataNonzero;\n /**\n * The fee per storage key in the [[link-eip-2930]] access list.\n */\n txAccessListStorageKey;\n /**\n * The fee per address in the [[link-eip-2930]] access list.\n */\n txAccessListAddress;\n /**\n * Creates a new GasCostPlugin from %%effectiveBlock%% until the\n * latest block or another GasCostPlugin supercedes that block number,\n * with the associated %%costs%%.\n */\n constructor(effectiveBlock, costs) {\n if (effectiveBlock == null) {\n effectiveBlock = 0;\n }\n super(`org.ethers.network.plugins.GasCost#${(effectiveBlock || 0)}`);\n const props = { effectiveBlock };\n function set(name, nullish) {\n let value = (costs || {})[name];\n if (value == null) {\n value = nullish;\n }\n assertArgument(typeof (value) === \"number\", `invalud value for ${name}`, \"costs\", costs);\n props[name] = value;\n }\n set(\"txBase\", 21000);\n set(\"txCreate\", 32000);\n set(\"txDataZero\", 4);\n set(\"txDataNonzero\", 16);\n set(\"txAccessListStorageKey\", 1900);\n set(\"txAccessListAddress\", 2400);\n defineProperties(this, props);\n }\n clone() {\n return new GasCostPlugin(this.effectiveBlock, this);\n }\n}\n/**\n * An **EnsPlugin** allows a [[Network]] to specify the ENS Registry\n * Contract address and the target network to use when using that\n * contract.\n *\n * Various testnets have their own instance of the contract to use, but\n * in general, the mainnet instance supports multi-chain addresses and\n * should be used.\n */\nexport class EnsPlugin extends NetworkPlugin {\n /**\n * The ENS Registrty Contract address.\n */\n address;\n /**\n * The chain ID that the ENS contract lives on.\n */\n targetNetwork;\n /**\n * Creates a new **EnsPlugin** connected to %%address%% on the\n * %%targetNetwork%%. The default ENS address and mainnet is used\n * if unspecified.\n */\n constructor(address, targetNetwork) {\n super(\"org.ethers.plugins.network.Ens\");\n defineProperties(this, {\n address: (address || EnsAddress),\n targetNetwork: ((targetNetwork == null) ? 1 : targetNetwork)\n });\n }\n clone() {\n return new EnsPlugin(this.address, this.targetNetwork);\n }\n}\n/**\n * A **FeeDataNetworkPlugin** allows a network to provide and alternate\n * means to specify its fee data.\n *\n * For example, a network which does not support [[link-eip-1559]] may\n * choose to use a Gas Station site to approximate the gas price.\n */\nexport class FeeDataNetworkPlugin extends NetworkPlugin {\n #feeDataFunc;\n /**\n * The fee data function provided to the constructor.\n */\n get feeDataFunc() {\n return this.#feeDataFunc;\n }\n /**\n * Creates a new **FeeDataNetworkPlugin**.\n */\n constructor(feeDataFunc) {\n super(\"org.ethers.plugins.network.FeeData\");\n this.#feeDataFunc = feeDataFunc;\n }\n /**\n * Resolves to the fee data.\n */\n async getFeeData(provider) {\n return await this.#feeDataFunc(provider);\n }\n clone() {\n return new FeeDataNetworkPlugin(this.#feeDataFunc);\n }\n}\nexport class FetchUrlFeeDataNetworkPlugin extends NetworkPlugin {\n #url;\n #processFunc;\n /**\n * The URL to initialize the FetchRequest with in %%processFunc%%.\n */\n get url() { return this.#url; }\n /**\n * The callback to use when computing the FeeData.\n */\n get processFunc() { return this.#processFunc; }\n /**\n * Creates a new **FetchUrlFeeDataNetworkPlugin** which will\n * be used when computing the fee data for the network.\n */\n constructor(url, processFunc) {\n super(\"org.ethers.plugins.network.FetchUrlFeeDataPlugin\");\n this.#url = url;\n this.#processFunc = processFunc;\n }\n // We are immutable, so we can serve as our own clone\n clone() { return this; }\n}\n/*\nexport class CustomBlockNetworkPlugin extends NetworkPlugin {\n readonly #blockFunc: (provider: Provider, block: BlockParams) => Block;\n readonly #blockWithTxsFunc: (provider: Provider, block: BlockParams) => Block;\n\n constructor(blockFunc: (provider: Provider, block: BlockParams) => Block, blockWithTxsFunc: (provider: Provider, block: BlockParams) => Block) {\n super(\"org.ethers.network-plugins.custom-block\");\n this.#blockFunc = blockFunc;\n this.#blockWithTxsFunc = blockWithTxsFunc;\n }\n\n async getBlock(provider: Provider, block: BlockParams): Promise> {\n return await this.#blockFunc(provider, block);\n }\n\n async getBlockions(provider: Provider, block: BlockParams): Promise> {\n return await this.#blockWithTxsFunc(provider, block);\n }\n\n clone(): CustomBlockNetworkPlugin {\n return new CustomBlockNetworkPlugin(this.#blockFunc, this.#blockWithTxsFunc);\n }\n}\n*/\n//# sourceMappingURL=plugins-network.js.map","/**\n * A **Network** encapsulates the various properties required to\n * interact with a specific chain.\n *\n * @_subsection: api/providers:Networks [networks]\n */\nimport { accessListify } from \"../transaction/index.js\";\nimport { getBigInt, assert, assertArgument } from \"../utils/index.js\";\nimport { EnsPlugin, FetchUrlFeeDataNetworkPlugin, GasCostPlugin } from \"./plugins-network.js\";\n/* * * *\n// Networks which operation against an L2 can use this plugin to\n// specify how to access L1, for the purpose of resolving ENS,\n// for example.\nexport class LayerOneConnectionPlugin extends NetworkPlugin {\n readonly provider!: Provider;\n// @TODO: Rename to ChainAccess and allow for connecting to any chain\n constructor(provider: Provider) {\n super(\"org.ethers.plugins.layer-one-connection\");\n defineProperties(this, { provider });\n }\n\n clone(): LayerOneConnectionPlugin {\n return new LayerOneConnectionPlugin(this.provider);\n }\n}\n*/\nconst Networks = new Map();\n/**\n * A **Network** provides access to a chain's properties and allows\n * for plug-ins to extend functionality.\n */\nexport class Network {\n #name;\n #chainId;\n #plugins;\n /**\n * Creates a new **Network** for %%name%% and %%chainId%%.\n */\n constructor(name, chainId) {\n this.#name = name;\n this.#chainId = getBigInt(chainId);\n this.#plugins = new Map();\n }\n /**\n * Returns a JSON-compatible representation of a Network.\n */\n toJSON() {\n return { name: this.name, chainId: String(this.chainId) };\n }\n /**\n * The network common name.\n *\n * This is the canonical name, as networks migh have multiple\n * names.\n */\n get name() { return this.#name; }\n set name(value) { this.#name = value; }\n /**\n * The network chain ID.\n */\n get chainId() { return this.#chainId; }\n set chainId(value) { this.#chainId = getBigInt(value, \"chainId\"); }\n /**\n * Returns true if %%other%% matches this network. Any chain ID\n * must match, and if no chain ID is present, the name must match.\n *\n * This method does not currently check for additional properties,\n * such as ENS address or plug-in compatibility.\n */\n matches(other) {\n if (other == null) {\n return false;\n }\n if (typeof (other) === \"string\") {\n try {\n return (this.chainId === getBigInt(other));\n }\n catch (error) { }\n return (this.name === other);\n }\n if (typeof (other) === \"number\" || typeof (other) === \"bigint\") {\n try {\n return (this.chainId === getBigInt(other));\n }\n catch (error) { }\n return false;\n }\n if (typeof (other) === \"object\") {\n if (other.chainId != null) {\n try {\n return (this.chainId === getBigInt(other.chainId));\n }\n catch (error) { }\n return false;\n }\n if (other.name != null) {\n return (this.name === other.name);\n }\n return false;\n }\n return false;\n }\n /**\n * Returns the list of plugins currently attached to this Network.\n */\n get plugins() {\n return Array.from(this.#plugins.values());\n }\n /**\n * Attach a new %%plugin%% to this Network. The network name\n * must be unique, excluding any fragment.\n */\n attachPlugin(plugin) {\n if (this.#plugins.get(plugin.name)) {\n throw new Error(`cannot replace existing plugin: ${plugin.name} `);\n }\n this.#plugins.set(plugin.name, plugin.clone());\n return this;\n }\n /**\n * Return the plugin, if any, matching %%name%% exactly. Plugins\n * with fragments will not be returned unless %%name%% includes\n * a fragment.\n */\n getPlugin(name) {\n return (this.#plugins.get(name)) || null;\n }\n /**\n * Gets a list of all plugins that match %%name%%, with otr without\n * a fragment.\n */\n getPlugins(basename) {\n return (this.plugins.filter((p) => (p.name.split(\"#\")[0] === basename)));\n }\n /**\n * Create a copy of this Network.\n */\n clone() {\n const clone = new Network(this.name, this.chainId);\n this.plugins.forEach((plugin) => {\n clone.attachPlugin(plugin.clone());\n });\n return clone;\n }\n /**\n * Compute the intrinsic gas required for a transaction.\n *\n * A GasCostPlugin can be attached to override the default\n * values.\n */\n computeIntrinsicGas(tx) {\n const costs = this.getPlugin(\"org.ethers.plugins.network.GasCost\") || (new GasCostPlugin());\n let gas = costs.txBase;\n if (tx.to == null) {\n gas += costs.txCreate;\n }\n if (tx.data) {\n for (let i = 2; i < tx.data.length; i += 2) {\n if (tx.data.substring(i, i + 2) === \"00\") {\n gas += costs.txDataZero;\n }\n else {\n gas += costs.txDataNonzero;\n }\n }\n }\n if (tx.accessList) {\n const accessList = accessListify(tx.accessList);\n for (const addr in accessList) {\n gas += costs.txAccessListAddress + costs.txAccessListStorageKey * accessList[addr].storageKeys.length;\n }\n }\n return gas;\n }\n /**\n * Returns a new Network for the %%network%% name or chainId.\n */\n static from(network) {\n injectCommonNetworks();\n // Default network\n if (network == null) {\n return Network.from(\"mainnet\");\n }\n // Canonical name or chain ID\n if (typeof (network) === \"number\") {\n network = BigInt(network);\n }\n if (typeof (network) === \"string\" || typeof (network) === \"bigint\") {\n const networkFunc = Networks.get(network);\n if (networkFunc) {\n return networkFunc();\n }\n if (typeof (network) === \"bigint\") {\n return new Network(\"unknown\", network);\n }\n assertArgument(false, \"unknown network\", \"network\", network);\n }\n // Clonable with network-like abilities\n if (typeof (network.clone) === \"function\") {\n const clone = network.clone();\n //if (typeof(network.name) !== \"string\" || typeof(network.chainId) !== \"number\") {\n //}\n return clone;\n }\n // Networkish\n if (typeof (network) === \"object\") {\n assertArgument(typeof (network.name) === \"string\" && typeof (network.chainId) === \"number\", \"invalid network object name or chainId\", \"network\", network);\n const custom = new Network((network.name), (network.chainId));\n if (network.ensAddress || network.ensNetwork != null) {\n custom.attachPlugin(new EnsPlugin(network.ensAddress, network.ensNetwork));\n }\n //if ((network).layerOneConnection) {\n // custom.attachPlugin(new LayerOneConnectionPlugin((network).layerOneConnection));\n //}\n return custom;\n }\n assertArgument(false, \"invalid network\", \"network\", network);\n }\n /**\n * Register %%nameOrChainId%% with a function which returns\n * an instance of a Network representing that chain.\n */\n static register(nameOrChainId, networkFunc) {\n if (typeof (nameOrChainId) === \"number\") {\n nameOrChainId = BigInt(nameOrChainId);\n }\n const existing = Networks.get(nameOrChainId);\n if (existing) {\n assertArgument(false, `conflicting network for ${JSON.stringify(existing.name)}`, \"nameOrChainId\", nameOrChainId);\n }\n Networks.set(nameOrChainId, networkFunc);\n }\n}\n// We don't want to bring in formatUnits because it is backed by\n// FixedNumber and we want to keep Networks tiny. The values\n// included by the Gas Stations are also IEEE 754 with lots of\n// rounding issues and exceed the strict checks formatUnits has.\nfunction parseUnits(_value, decimals) {\n const value = String(_value);\n if (!value.match(/^[0-9.]+$/)) {\n throw new Error(`invalid gwei value: ${_value}`);\n }\n // Break into [ whole, fraction ]\n const comps = value.split(\".\");\n if (comps.length === 1) {\n comps.push(\"\");\n }\n // More than 1 decimal point or too many fractional positions\n if (comps.length !== 2) {\n throw new Error(`invalid gwei value: ${_value}`);\n }\n // Pad the fraction to 9 decimalplaces\n while (comps[1].length < decimals) {\n comps[1] += \"0\";\n }\n // Too many decimals and some non-zero ending, take the ceiling\n if (comps[1].length > 9) {\n let frac = BigInt(comps[1].substring(0, 9));\n if (!comps[1].substring(9).match(/^0+$/)) {\n frac++;\n }\n comps[1] = frac.toString();\n }\n return BigInt(comps[0] + comps[1]);\n}\n// Used by Polygon to use a gas station for fee data\nfunction getGasStationPlugin(url) {\n return new FetchUrlFeeDataNetworkPlugin(url, async (fetchFeeData, provider, request) => {\n // Prevent Cloudflare from blocking our request in node.js\n request.setHeader(\"User-Agent\", \"ethers\");\n let response;\n try {\n const [_response, _feeData] = await Promise.all([\n request.send(), fetchFeeData()\n ]);\n response = _response;\n const payload = response.bodyJson.standard;\n const feeData = {\n gasPrice: _feeData.gasPrice,\n maxFeePerGas: parseUnits(payload.maxFee, 9),\n maxPriorityFeePerGas: parseUnits(payload.maxPriorityFee, 9),\n };\n return feeData;\n }\n catch (error) {\n assert(false, `error encountered with polygon gas station (${JSON.stringify(request.url)})`, \"SERVER_ERROR\", { request, response, error });\n }\n });\n}\n// See: https://chainlist.org\nlet injected = false;\nfunction injectCommonNetworks() {\n if (injected) {\n return;\n }\n injected = true;\n /// Register popular Ethereum networks\n function registerEth(name, chainId, options) {\n const func = function () {\n const network = new Network(name, chainId);\n // We use 0 to disable ENS\n if (options.ensNetwork != null) {\n network.attachPlugin(new EnsPlugin(null, options.ensNetwork));\n }\n network.attachPlugin(new GasCostPlugin());\n (options.plugins || []).forEach((plugin) => {\n network.attachPlugin(plugin);\n });\n return network;\n };\n // Register the network by name and chain ID\n Network.register(name, func);\n Network.register(chainId, func);\n if (options.altNames) {\n options.altNames.forEach((name) => {\n Network.register(name, func);\n });\n }\n }\n registerEth(\"mainnet\", 1, { ensNetwork: 1, altNames: [\"homestead\"] });\n registerEth(\"ropsten\", 3, { ensNetwork: 3 });\n registerEth(\"rinkeby\", 4, { ensNetwork: 4 });\n registerEth(\"goerli\", 5, { ensNetwork: 5 });\n registerEth(\"kovan\", 42, { ensNetwork: 42 });\n registerEth(\"sepolia\", 11155111, { ensNetwork: 11155111 });\n registerEth(\"holesky\", 17000, { ensNetwork: 17000 });\n registerEth(\"classic\", 61, {});\n registerEth(\"classicKotti\", 6, {});\n registerEth(\"arbitrum\", 42161, {\n ensNetwork: 1,\n });\n registerEth(\"arbitrum-goerli\", 421613, {});\n registerEth(\"arbitrum-sepolia\", 421614, {});\n registerEth(\"base\", 8453, { ensNetwork: 1 });\n registerEth(\"base-goerli\", 84531, {});\n registerEth(\"base-sepolia\", 84532, {});\n registerEth(\"bnb\", 56, { ensNetwork: 1 });\n registerEth(\"bnbt\", 97, {});\n registerEth(\"filecoin\", 314, {});\n registerEth(\"filecoin-calibration\", 314159, {});\n registerEth(\"linea\", 59144, { ensNetwork: 1 });\n registerEth(\"linea-goerli\", 59140, {});\n registerEth(\"linea-sepolia\", 59141, {});\n registerEth(\"matic\", 137, {\n ensNetwork: 1,\n plugins: [\n getGasStationPlugin(\"https:/\\/gasstation.polygon.technology/v2\")\n ]\n });\n registerEth(\"matic-amoy\", 80002, {});\n registerEth(\"matic-mumbai\", 80001, {\n altNames: [\"maticMumbai\", \"maticmum\"],\n plugins: [\n getGasStationPlugin(\"https:/\\/gasstation-testnet.polygon.technology/v2\")\n ]\n });\n registerEth(\"optimism\", 10, {\n ensNetwork: 1,\n plugins: []\n });\n registerEth(\"optimism-goerli\", 420, {});\n registerEth(\"optimism-sepolia\", 11155420, {});\n registerEth(\"xdai\", 100, { ensNetwork: 1 });\n}\n//# sourceMappingURL=network.js.map","import { assert, isHexString } from \"../utils/index.js\";\nfunction copy(obj) {\n return JSON.parse(JSON.stringify(obj));\n}\n/**\n * Return the polling subscriber for common events.\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport function getPollingSubscriber(provider, event) {\n if (event === \"block\") {\n return new PollingBlockSubscriber(provider);\n }\n if (isHexString(event, 32)) {\n return new PollingTransactionSubscriber(provider, event);\n }\n assert(false, \"unsupported polling event\", \"UNSUPPORTED_OPERATION\", {\n operation: \"getPollingSubscriber\", info: { event }\n });\n}\n// @TODO: refactor this\n/**\n * A **PollingBlockSubscriber** polls at a regular interval for a change\n * in the block number.\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class PollingBlockSubscriber {\n #provider;\n #poller;\n #interval;\n // The most recent block we have scanned for events. The value -2\n // indicates we still need to fetch an initial block number\n #blockNumber;\n /**\n * Create a new **PollingBlockSubscriber** attached to %%provider%%.\n */\n constructor(provider) {\n this.#provider = provider;\n this.#poller = null;\n this.#interval = 4000;\n this.#blockNumber = -2;\n }\n /**\n * The polling interval.\n */\n get pollingInterval() { return this.#interval; }\n set pollingInterval(value) { this.#interval = value; }\n async #poll() {\n try {\n const blockNumber = await this.#provider.getBlockNumber();\n // Bootstrap poll to setup our initial block number\n if (this.#blockNumber === -2) {\n this.#blockNumber = blockNumber;\n return;\n }\n // @TODO: Put a cap on the maximum number of events per loop?\n if (blockNumber !== this.#blockNumber) {\n for (let b = this.#blockNumber + 1; b <= blockNumber; b++) {\n // We have been stopped\n if (this.#poller == null) {\n return;\n }\n await this.#provider.emit(\"block\", b);\n }\n this.#blockNumber = blockNumber;\n }\n }\n catch (error) {\n // @TODO: Minor bump, add an \"error\" event to let subscribers\n // know things went awry.\n //console.log(error);\n }\n // We have been stopped\n if (this.#poller == null) {\n return;\n }\n this.#poller = this.#provider._setTimeout(this.#poll.bind(this), this.#interval);\n }\n start() {\n if (this.#poller) {\n return;\n }\n this.#poller = this.#provider._setTimeout(this.#poll.bind(this), this.#interval);\n this.#poll();\n }\n stop() {\n if (!this.#poller) {\n return;\n }\n this.#provider._clearTimeout(this.#poller);\n this.#poller = null;\n }\n pause(dropWhilePaused) {\n this.stop();\n if (dropWhilePaused) {\n this.#blockNumber = -2;\n }\n }\n resume() {\n this.start();\n }\n}\n/**\n * An **OnBlockSubscriber** can be sub-classed, with a [[_poll]]\n * implmentation which will be called on every new block.\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class OnBlockSubscriber {\n #provider;\n #poll;\n #running;\n /**\n * Create a new **OnBlockSubscriber** attached to %%provider%%.\n */\n constructor(provider) {\n this.#provider = provider;\n this.#running = false;\n this.#poll = (blockNumber) => {\n this._poll(blockNumber, this.#provider);\n };\n }\n /**\n * Called on every new block.\n */\n async _poll(blockNumber, provider) {\n throw new Error(\"sub-classes must override this\");\n }\n start() {\n if (this.#running) {\n return;\n }\n this.#running = true;\n this.#poll(-2);\n this.#provider.on(\"block\", this.#poll);\n }\n stop() {\n if (!this.#running) {\n return;\n }\n this.#running = false;\n this.#provider.off(\"block\", this.#poll);\n }\n pause(dropWhilePaused) { this.stop(); }\n resume() { this.start(); }\n}\nexport class PollingBlockTagSubscriber extends OnBlockSubscriber {\n #tag;\n #lastBlock;\n constructor(provider, tag) {\n super(provider);\n this.#tag = tag;\n this.#lastBlock = -2;\n }\n pause(dropWhilePaused) {\n if (dropWhilePaused) {\n this.#lastBlock = -2;\n }\n super.pause(dropWhilePaused);\n }\n async _poll(blockNumber, provider) {\n const block = await provider.getBlock(this.#tag);\n if (block == null) {\n return;\n }\n if (this.#lastBlock === -2) {\n this.#lastBlock = block.number;\n }\n else if (block.number > this.#lastBlock) {\n provider.emit(this.#tag, block.number);\n this.#lastBlock = block.number;\n }\n }\n}\n/**\n * @_ignore:\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class PollingOrphanSubscriber extends OnBlockSubscriber {\n #filter;\n constructor(provider, filter) {\n super(provider);\n this.#filter = copy(filter);\n }\n async _poll(blockNumber, provider) {\n throw new Error(\"@TODO\");\n console.log(this.#filter);\n }\n}\n/**\n * A **PollingTransactionSubscriber** will poll for a given transaction\n * hash for its receipt.\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class PollingTransactionSubscriber extends OnBlockSubscriber {\n #hash;\n /**\n * Create a new **PollingTransactionSubscriber** attached to\n * %%provider%%, listening for %%hash%%.\n */\n constructor(provider, hash) {\n super(provider);\n this.#hash = hash;\n }\n async _poll(blockNumber, provider) {\n const tx = await provider.getTransactionReceipt(this.#hash);\n if (tx) {\n provider.emit(this.#hash, tx);\n }\n }\n}\n/**\n * A **PollingEventSubscriber** will poll for a given filter for its logs.\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class PollingEventSubscriber {\n #provider;\n #filter;\n #poller;\n #running;\n // The most recent block we have scanned for events. The value -2\n // indicates we still need to fetch an initial block number\n #blockNumber;\n /**\n * Create a new **PollingTransactionSubscriber** attached to\n * %%provider%%, listening for %%filter%%.\n */\n constructor(provider, filter) {\n this.#provider = provider;\n this.#filter = copy(filter);\n this.#poller = this.#poll.bind(this);\n this.#running = false;\n this.#blockNumber = -2;\n }\n async #poll(blockNumber) {\n // The initial block hasn't been determined yet\n if (this.#blockNumber === -2) {\n return;\n }\n const filter = copy(this.#filter);\n filter.fromBlock = this.#blockNumber + 1;\n filter.toBlock = blockNumber;\n const logs = await this.#provider.getLogs(filter);\n // No logs could just mean the node has not indexed them yet,\n // so we keep a sliding window of 60 blocks to keep scanning\n if (logs.length === 0) {\n if (this.#blockNumber < blockNumber - 60) {\n this.#blockNumber = blockNumber - 60;\n }\n return;\n }\n for (const log of logs) {\n this.#provider.emit(this.#filter, log);\n // Only advance the block number when logs were found to\n // account for networks (like BNB and Polygon) which may\n // sacrifice event consistency for block event speed\n this.#blockNumber = log.blockNumber;\n }\n }\n start() {\n if (this.#running) {\n return;\n }\n this.#running = true;\n if (this.#blockNumber === -2) {\n this.#provider.getBlockNumber().then((blockNumber) => {\n this.#blockNumber = blockNumber;\n });\n }\n this.#provider.on(\"block\", this.#poller);\n }\n stop() {\n if (!this.#running) {\n return;\n }\n this.#running = false;\n this.#provider.off(\"block\", this.#poller);\n }\n pause(dropWhilePaused) {\n this.stop();\n if (dropWhilePaused) {\n this.#blockNumber = -2;\n }\n }\n resume() {\n this.start();\n }\n}\n//# sourceMappingURL=subscriber-polling.js.map","/**\n * The available providers should suffice for most developers purposes,\n * but the [[AbstractProvider]] class has many features which enable\n * sub-classing it for specific purposes.\n *\n * @_section: api/providers/abstract-provider: Subclassing Provider [abstract-provider]\n */\n// @TODO\n// Event coalescence\n// When we register an event with an async value (e.g. address is a Signer\n// or ENS name), we need to add it immeidately for the Event API, but also\n// need time to resolve the address. Upon resolving the address, we need to\n// migrate the listener to the static event. We also need to maintain a map\n// of Signer/ENS name to address so we can sync respond to listenerCount.\nimport { getAddress, resolveAddress } from \"../address/index.js\";\nimport { ZeroAddress } from \"../constants/index.js\";\nimport { Contract } from \"../contract/index.js\";\nimport { namehash } from \"../hash/index.js\";\nimport { Transaction } from \"../transaction/index.js\";\nimport { concat, dataLength, dataSlice, hexlify, isHexString, getBigInt, getBytes, getNumber, isCallException, isError, makeError, assert, assertArgument, FetchRequest, toBeArray, toQuantity, defineProperties, EventPayload, resolveProperties, toUtf8String } from \"../utils/index.js\";\nimport { EnsResolver } from \"./ens-resolver.js\";\nimport { formatBlock, formatLog, formatTransactionReceipt, formatTransactionResponse } from \"./format.js\";\nimport { Network } from \"./network.js\";\nimport { copyRequest, Block, FeeData, Log, TransactionReceipt, TransactionResponse } from \"./provider.js\";\nimport { PollingBlockSubscriber, PollingBlockTagSubscriber, PollingEventSubscriber, PollingOrphanSubscriber, PollingTransactionSubscriber } from \"./subscriber-polling.js\";\n// Constants\nconst BN_2 = BigInt(2);\nconst MAX_CCIP_REDIRECTS = 10;\nfunction isPromise(value) {\n return (value && typeof (value.then) === \"function\");\n}\nfunction getTag(prefix, value) {\n return prefix + \":\" + JSON.stringify(value, (k, v) => {\n if (v == null) {\n return \"null\";\n }\n if (typeof (v) === \"bigint\") {\n return `bigint:${v.toString()}`;\n }\n if (typeof (v) === \"string\") {\n return v.toLowerCase();\n }\n // Sort object keys\n if (typeof (v) === \"object\" && !Array.isArray(v)) {\n const keys = Object.keys(v);\n keys.sort();\n return keys.reduce((accum, key) => {\n accum[key] = v[key];\n return accum;\n }, {});\n }\n return v;\n });\n}\n/**\n * An **UnmanagedSubscriber** is useful for events which do not require\n * any additional management, such as ``\"debug\"`` which only requires\n * emit in synchronous event loop triggered calls.\n */\nexport class UnmanagedSubscriber {\n /**\n * The name fof the event.\n */\n name;\n /**\n * Create a new UnmanagedSubscriber with %%name%%.\n */\n constructor(name) { defineProperties(this, { name }); }\n start() { }\n stop() { }\n pause(dropWhilePaused) { }\n resume() { }\n}\nfunction copy(value) {\n return JSON.parse(JSON.stringify(value));\n}\nfunction concisify(items) {\n items = Array.from((new Set(items)).values());\n items.sort();\n return items;\n}\nasync function getSubscription(_event, provider) {\n if (_event == null) {\n throw new Error(\"invalid event\");\n }\n // Normalize topic array info an EventFilter\n if (Array.isArray(_event)) {\n _event = { topics: _event };\n }\n if (typeof (_event) === \"string\") {\n switch (_event) {\n case \"block\":\n case \"debug\":\n case \"error\":\n case \"finalized\":\n case \"network\":\n case \"pending\":\n case \"safe\": {\n return { type: _event, tag: _event };\n }\n }\n }\n if (isHexString(_event, 32)) {\n const hash = _event.toLowerCase();\n return { type: \"transaction\", tag: getTag(\"tx\", { hash }), hash };\n }\n if (_event.orphan) {\n const event = _event;\n // @TODO: Should lowercase and whatnot things here instead of copy...\n return { type: \"orphan\", tag: getTag(\"orphan\", event), filter: copy(event) };\n }\n if ((_event.address || _event.topics)) {\n const event = _event;\n const filter = {\n topics: ((event.topics || []).map((t) => {\n if (t == null) {\n return null;\n }\n if (Array.isArray(t)) {\n return concisify(t.map((t) => t.toLowerCase()));\n }\n return t.toLowerCase();\n }))\n };\n if (event.address) {\n const addresses = [];\n const promises = [];\n const addAddress = (addr) => {\n if (isHexString(addr)) {\n addresses.push(addr);\n }\n else {\n promises.push((async () => {\n addresses.push(await resolveAddress(addr, provider));\n })());\n }\n };\n if (Array.isArray(event.address)) {\n event.address.forEach(addAddress);\n }\n else {\n addAddress(event.address);\n }\n if (promises.length) {\n await Promise.all(promises);\n }\n filter.address = concisify(addresses.map((a) => a.toLowerCase()));\n }\n return { filter, tag: getTag(\"event\", filter), type: \"event\" };\n }\n assertArgument(false, \"unknown ProviderEvent\", \"event\", _event);\n}\nfunction getTime() { return (new Date()).getTime(); }\nconst defaultOptions = {\n cacheTimeout: 250,\n pollingInterval: 4000\n};\n/**\n * An **AbstractProvider** provides a base class for other sub-classes to\n * implement the [[Provider]] API by normalizing input arguments and\n * formatting output results as well as tracking events for consistent\n * behaviour on an eventually-consistent network.\n */\nexport class AbstractProvider {\n #subs;\n #plugins;\n // null=unpaused, true=paused+dropWhilePaused, false=paused\n #pausedState;\n #destroyed;\n #networkPromise;\n #anyNetwork;\n #performCache;\n // The most recent block number if running an event or -1 if no \"block\" event\n #lastBlockNumber;\n #nextTimer;\n #timers;\n #disableCcipRead;\n #options;\n /**\n * Create a new **AbstractProvider** connected to %%network%%, or\n * use the various network detection capabilities to discover the\n * [[Network]] if necessary.\n */\n constructor(_network, options) {\n this.#options = Object.assign({}, defaultOptions, options || {});\n if (_network === \"any\") {\n this.#anyNetwork = true;\n this.#networkPromise = null;\n }\n else if (_network) {\n const network = Network.from(_network);\n this.#anyNetwork = false;\n this.#networkPromise = Promise.resolve(network);\n setTimeout(() => { this.emit(\"network\", network, null); }, 0);\n }\n else {\n this.#anyNetwork = false;\n this.#networkPromise = null;\n }\n this.#lastBlockNumber = -1;\n this.#performCache = new Map();\n this.#subs = new Map();\n this.#plugins = new Map();\n this.#pausedState = null;\n this.#destroyed = false;\n this.#nextTimer = 1;\n this.#timers = new Map();\n this.#disableCcipRead = false;\n }\n get pollingInterval() { return this.#options.pollingInterval; }\n /**\n * Returns ``this``, to allow an **AbstractProvider** to implement\n * the [[ContractRunner]] interface.\n */\n get provider() { return this; }\n /**\n * Returns all the registered plug-ins.\n */\n get plugins() {\n return Array.from(this.#plugins.values());\n }\n /**\n * Attach a new plug-in.\n */\n attachPlugin(plugin) {\n if (this.#plugins.get(plugin.name)) {\n throw new Error(`cannot replace existing plugin: ${plugin.name} `);\n }\n this.#plugins.set(plugin.name, plugin.connect(this));\n return this;\n }\n /**\n * Get a plugin by name.\n */\n getPlugin(name) {\n return (this.#plugins.get(name)) || null;\n }\n /**\n * Prevent any CCIP-read operation, regardless of whether requested\n * in a [[call]] using ``enableCcipRead``.\n */\n get disableCcipRead() { return this.#disableCcipRead; }\n set disableCcipRead(value) { this.#disableCcipRead = !!value; }\n // Shares multiple identical requests made during the same 250ms\n async #perform(req) {\n const timeout = this.#options.cacheTimeout;\n // Caching disabled\n if (timeout < 0) {\n return await this._perform(req);\n }\n // Create a tag\n const tag = getTag(req.method, req);\n let perform = this.#performCache.get(tag);\n if (!perform) {\n perform = this._perform(req);\n this.#performCache.set(tag, perform);\n setTimeout(() => {\n if (this.#performCache.get(tag) === perform) {\n this.#performCache.delete(tag);\n }\n }, timeout);\n }\n return await perform;\n }\n /**\n * Resolves to the data for executing the CCIP-read operations.\n */\n async ccipReadFetch(tx, calldata, urls) {\n if (this.disableCcipRead || urls.length === 0 || tx.to == null) {\n return null;\n }\n const sender = tx.to.toLowerCase();\n const data = calldata.toLowerCase();\n const errorMessages = [];\n for (let i = 0; i < urls.length; i++) {\n const url = urls[i];\n // URL expansion\n const href = url.replace(\"{sender}\", sender).replace(\"{data}\", data);\n // If no {data} is present, use POST; otherwise GET\n //const json: string | null = (url.indexOf(\"{data}\") >= 0) ? null: JSON.stringify({ data, sender });\n //const result = await fetchJson({ url: href, errorPassThrough: true }, json, (value, response) => {\n // value.status = response.statusCode;\n // return value;\n //});\n const request = new FetchRequest(href);\n if (url.indexOf(\"{data}\") === -1) {\n request.body = { data, sender };\n }\n this.emit(\"debug\", { action: \"sendCcipReadFetchRequest\", request, index: i, urls });\n let errorMessage = \"unknown error\";\n // Fetch the resource...\n let resp;\n try {\n resp = await request.send();\n }\n catch (error) {\n // ...low-level fetch error (missing host, bad SSL, etc.),\n // so try next URL\n errorMessages.push(error.message);\n this.emit(\"debug\", { action: \"receiveCcipReadFetchError\", request, result: { error } });\n continue;\n }\n try {\n const result = resp.bodyJson;\n if (result.data) {\n this.emit(\"debug\", { action: \"receiveCcipReadFetchResult\", request, result });\n return result.data;\n }\n if (result.message) {\n errorMessage = result.message;\n }\n this.emit(\"debug\", { action: \"receiveCcipReadFetchError\", request, result });\n }\n catch (error) { }\n // 4xx indicates the result is not present; stop\n assert(resp.statusCode < 400 || resp.statusCode >= 500, `response not found during CCIP fetch: ${errorMessage}`, \"OFFCHAIN_FAULT\", { reason: \"404_MISSING_RESOURCE\", transaction: tx, info: { url, errorMessage } });\n // 5xx indicates server issue; try the next url\n errorMessages.push(errorMessage);\n }\n assert(false, `error encountered during CCIP fetch: ${errorMessages.map((m) => JSON.stringify(m)).join(\", \")}`, \"OFFCHAIN_FAULT\", {\n reason: \"500_SERVER_ERROR\",\n transaction: tx, info: { urls, errorMessages }\n });\n }\n /**\n * Provides the opportunity for a sub-class to wrap a block before\n * returning it, to add additional properties or an alternate\n * sub-class of [[Block]].\n */\n _wrapBlock(value, network) {\n return new Block(formatBlock(value), this);\n }\n /**\n * Provides the opportunity for a sub-class to wrap a log before\n * returning it, to add additional properties or an alternate\n * sub-class of [[Log]].\n */\n _wrapLog(value, network) {\n return new Log(formatLog(value), this);\n }\n /**\n * Provides the opportunity for a sub-class to wrap a transaction\n * receipt before returning it, to add additional properties or an\n * alternate sub-class of [[TransactionReceipt]].\n */\n _wrapTransactionReceipt(value, network) {\n return new TransactionReceipt(formatTransactionReceipt(value), this);\n }\n /**\n * Provides the opportunity for a sub-class to wrap a transaction\n * response before returning it, to add additional properties or an\n * alternate sub-class of [[TransactionResponse]].\n */\n _wrapTransactionResponse(tx, network) {\n return new TransactionResponse(formatTransactionResponse(tx), this);\n }\n /**\n * Resolves to the Network, forcing a network detection using whatever\n * technique the sub-class requires.\n *\n * Sub-classes **must** override this.\n */\n _detectNetwork() {\n assert(false, \"sub-classes must implement this\", \"UNSUPPORTED_OPERATION\", {\n operation: \"_detectNetwork\"\n });\n }\n /**\n * Sub-classes should use this to perform all built-in operations. All\n * methods sanitizes and normalizes the values passed into this.\n *\n * Sub-classes **must** override this.\n */\n async _perform(req) {\n assert(false, `unsupported method: ${req.method}`, \"UNSUPPORTED_OPERATION\", {\n operation: req.method,\n info: req\n });\n }\n // State\n async getBlockNumber() {\n const blockNumber = getNumber(await this.#perform({ method: \"getBlockNumber\" }), \"%response\");\n if (this.#lastBlockNumber >= 0) {\n this.#lastBlockNumber = blockNumber;\n }\n return blockNumber;\n }\n /**\n * Returns or resolves to the address for %%address%%, resolving ENS\n * names and [[Addressable]] objects and returning if already an\n * address.\n */\n _getAddress(address) {\n return resolveAddress(address, this);\n }\n /**\n * Returns or resolves to a valid block tag for %%blockTag%%, resolving\n * negative values and returning if already a valid block tag.\n */\n _getBlockTag(blockTag) {\n if (blockTag == null) {\n return \"latest\";\n }\n switch (blockTag) {\n case \"earliest\":\n return \"0x0\";\n case \"finalized\":\n case \"latest\":\n case \"pending\":\n case \"safe\":\n return blockTag;\n }\n if (isHexString(blockTag)) {\n if (isHexString(blockTag, 32)) {\n return blockTag;\n }\n return toQuantity(blockTag);\n }\n if (typeof (blockTag) === \"bigint\") {\n blockTag = getNumber(blockTag, \"blockTag\");\n }\n if (typeof (blockTag) === \"number\") {\n if (blockTag >= 0) {\n return toQuantity(blockTag);\n }\n if (this.#lastBlockNumber >= 0) {\n return toQuantity(this.#lastBlockNumber + blockTag);\n }\n return this.getBlockNumber().then((b) => toQuantity(b + blockTag));\n }\n assertArgument(false, \"invalid blockTag\", \"blockTag\", blockTag);\n }\n /**\n * Returns or resolves to a filter for %%filter%%, resolving any ENS\n * names or [[Addressable]] object and returning if already a valid\n * filter.\n */\n _getFilter(filter) {\n // Create a canonical representation of the topics\n const topics = (filter.topics || []).map((t) => {\n if (t == null) {\n return null;\n }\n if (Array.isArray(t)) {\n return concisify(t.map((t) => t.toLowerCase()));\n }\n return t.toLowerCase();\n });\n const blockHash = (\"blockHash\" in filter) ? filter.blockHash : undefined;\n const resolve = (_address, fromBlock, toBlock) => {\n let address = undefined;\n switch (_address.length) {\n case 0: break;\n case 1:\n address = _address[0];\n break;\n default:\n _address.sort();\n address = _address;\n }\n if (blockHash) {\n if (fromBlock != null || toBlock != null) {\n throw new Error(\"invalid filter\");\n }\n }\n const filter = {};\n if (address) {\n filter.address = address;\n }\n if (topics.length) {\n filter.topics = topics;\n }\n if (fromBlock) {\n filter.fromBlock = fromBlock;\n }\n if (toBlock) {\n filter.toBlock = toBlock;\n }\n if (blockHash) {\n filter.blockHash = blockHash;\n }\n return filter;\n };\n // Addresses could be async (ENS names or Addressables)\n let address = [];\n if (filter.address) {\n if (Array.isArray(filter.address)) {\n for (const addr of filter.address) {\n address.push(this._getAddress(addr));\n }\n }\n else {\n address.push(this._getAddress(filter.address));\n }\n }\n let fromBlock = undefined;\n if (\"fromBlock\" in filter) {\n fromBlock = this._getBlockTag(filter.fromBlock);\n }\n let toBlock = undefined;\n if (\"toBlock\" in filter) {\n toBlock = this._getBlockTag(filter.toBlock);\n }\n if (address.filter((a) => (typeof (a) !== \"string\")).length ||\n (fromBlock != null && typeof (fromBlock) !== \"string\") ||\n (toBlock != null && typeof (toBlock) !== \"string\")) {\n return Promise.all([Promise.all(address), fromBlock, toBlock]).then((result) => {\n return resolve(result[0], result[1], result[2]);\n });\n }\n return resolve(address, fromBlock, toBlock);\n }\n /**\n * Returns or resolves to a transaction for %%request%%, resolving\n * any ENS names or [[Addressable]] and returning if already a valid\n * transaction.\n */\n _getTransactionRequest(_request) {\n const request = copyRequest(_request);\n const promises = [];\n [\"to\", \"from\"].forEach((key) => {\n if (request[key] == null) {\n return;\n }\n const addr = resolveAddress(request[key], this);\n if (isPromise(addr)) {\n promises.push((async function () { request[key] = await addr; })());\n }\n else {\n request[key] = addr;\n }\n });\n if (request.blockTag != null) {\n const blockTag = this._getBlockTag(request.blockTag);\n if (isPromise(blockTag)) {\n promises.push((async function () { request.blockTag = await blockTag; })());\n }\n else {\n request.blockTag = blockTag;\n }\n }\n if (promises.length) {\n return (async function () {\n await Promise.all(promises);\n return request;\n })();\n }\n return request;\n }\n async getNetwork() {\n // No explicit network was set and this is our first time\n if (this.#networkPromise == null) {\n // Detect the current network (shared with all calls)\n const detectNetwork = (async () => {\n try {\n const network = await this._detectNetwork();\n this.emit(\"network\", network, null);\n return network;\n }\n catch (error) {\n if (this.#networkPromise === detectNetwork) {\n this.#networkPromise = null;\n }\n throw error;\n }\n })();\n this.#networkPromise = detectNetwork;\n return (await detectNetwork).clone();\n }\n const networkPromise = this.#networkPromise;\n const [expected, actual] = await Promise.all([\n networkPromise,\n this._detectNetwork() // The actual connected network\n ]);\n if (expected.chainId !== actual.chainId) {\n if (this.#anyNetwork) {\n // The \"any\" network can change, so notify listeners\n this.emit(\"network\", actual, expected);\n // Update the network if something else hasn't already changed it\n if (this.#networkPromise === networkPromise) {\n this.#networkPromise = Promise.resolve(actual);\n }\n }\n else {\n // Otherwise, we do not allow changes to the underlying network\n assert(false, `network changed: ${expected.chainId} => ${actual.chainId} `, \"NETWORK_ERROR\", {\n event: \"changed\"\n });\n }\n }\n return expected.clone();\n }\n async getFeeData() {\n const network = await this.getNetwork();\n const getFeeDataFunc = async () => {\n const { _block, gasPrice, priorityFee } = await resolveProperties({\n _block: this.#getBlock(\"latest\", false),\n gasPrice: ((async () => {\n try {\n const value = await this.#perform({ method: \"getGasPrice\" });\n return getBigInt(value, \"%response\");\n }\n catch (error) { }\n return null;\n })()),\n priorityFee: ((async () => {\n try {\n const value = await this.#perform({ method: \"getPriorityFee\" });\n return getBigInt(value, \"%response\");\n }\n catch (error) { }\n return null;\n })())\n });\n let maxFeePerGas = null;\n let maxPriorityFeePerGas = null;\n // These are the recommended EIP-1559 heuristics for fee data\n const block = this._wrapBlock(_block, network);\n if (block && block.baseFeePerGas) {\n maxPriorityFeePerGas = (priorityFee != null) ? priorityFee : BigInt(\"1000000000\");\n maxFeePerGas = (block.baseFeePerGas * BN_2) + maxPriorityFeePerGas;\n }\n return new FeeData(gasPrice, maxFeePerGas, maxPriorityFeePerGas);\n };\n // Check for a FeeDataNetWorkPlugin\n const plugin = network.getPlugin(\"org.ethers.plugins.network.FetchUrlFeeDataPlugin\");\n if (plugin) {\n const req = new FetchRequest(plugin.url);\n const feeData = await plugin.processFunc(getFeeDataFunc, this, req);\n return new FeeData(feeData.gasPrice, feeData.maxFeePerGas, feeData.maxPriorityFeePerGas);\n }\n return await getFeeDataFunc();\n }\n async estimateGas(_tx) {\n let tx = this._getTransactionRequest(_tx);\n if (isPromise(tx)) {\n tx = await tx;\n }\n return getBigInt(await this.#perform({\n method: \"estimateGas\", transaction: tx\n }), \"%response\");\n }\n async #call(tx, blockTag, attempt) {\n assert(attempt < MAX_CCIP_REDIRECTS, \"CCIP read exceeded maximum redirections\", \"OFFCHAIN_FAULT\", {\n reason: \"TOO_MANY_REDIRECTS\",\n transaction: Object.assign({}, tx, { blockTag, enableCcipRead: true })\n });\n // This came in as a PerformActionTransaction, so to/from are safe; we can cast\n const transaction = copyRequest(tx);\n try {\n return hexlify(await this._perform({ method: \"call\", transaction, blockTag }));\n }\n catch (error) {\n // CCIP Read OffchainLookup\n if (!this.disableCcipRead && isCallException(error) && error.data && attempt >= 0 && blockTag === \"latest\" && transaction.to != null && dataSlice(error.data, 0, 4) === \"0x556f1830\") {\n const data = error.data;\n const txSender = await resolveAddress(transaction.to, this);\n // Parse the CCIP Read Arguments\n let ccipArgs;\n try {\n ccipArgs = parseOffchainLookup(dataSlice(error.data, 4));\n }\n catch (error) {\n assert(false, error.message, \"OFFCHAIN_FAULT\", {\n reason: \"BAD_DATA\", transaction, info: { data }\n });\n }\n // Check the sender of the OffchainLookup matches the transaction\n assert(ccipArgs.sender.toLowerCase() === txSender.toLowerCase(), \"CCIP Read sender mismatch\", \"CALL_EXCEPTION\", {\n action: \"call\",\n data,\n reason: \"OffchainLookup\",\n transaction: transaction,\n invocation: null,\n revert: {\n signature: \"OffchainLookup(address,string[],bytes,bytes4,bytes)\",\n name: \"OffchainLookup\",\n args: ccipArgs.errorArgs\n }\n });\n const ccipResult = await this.ccipReadFetch(transaction, ccipArgs.calldata, ccipArgs.urls);\n assert(ccipResult != null, \"CCIP Read failed to fetch data\", \"OFFCHAIN_FAULT\", {\n reason: \"FETCH_FAILED\", transaction, info: { data: error.data, errorArgs: ccipArgs.errorArgs }\n });\n const tx = {\n to: txSender,\n data: concat([ccipArgs.selector, encodeBytes([ccipResult, ccipArgs.extraData])])\n };\n this.emit(\"debug\", { action: \"sendCcipReadCall\", transaction: tx });\n try {\n const result = await this.#call(tx, blockTag, attempt + 1);\n this.emit(\"debug\", { action: \"receiveCcipReadCallResult\", transaction: Object.assign({}, tx), result });\n return result;\n }\n catch (error) {\n this.emit(\"debug\", { action: \"receiveCcipReadCallError\", transaction: Object.assign({}, tx), error });\n throw error;\n }\n }\n throw error;\n }\n }\n async #checkNetwork(promise) {\n const { value } = await resolveProperties({\n network: this.getNetwork(),\n value: promise\n });\n return value;\n }\n async call(_tx) {\n const { tx, blockTag } = await resolveProperties({\n tx: this._getTransactionRequest(_tx),\n blockTag: this._getBlockTag(_tx.blockTag)\n });\n return await this.#checkNetwork(this.#call(tx, blockTag, _tx.enableCcipRead ? 0 : -1));\n }\n // Account\n async #getAccountValue(request, _address, _blockTag) {\n let address = this._getAddress(_address);\n let blockTag = this._getBlockTag(_blockTag);\n if (typeof (address) !== \"string\" || typeof (blockTag) !== \"string\") {\n [address, blockTag] = await Promise.all([address, blockTag]);\n }\n return await this.#checkNetwork(this.#perform(Object.assign(request, { address, blockTag })));\n }\n async getBalance(address, blockTag) {\n return getBigInt(await this.#getAccountValue({ method: \"getBalance\" }, address, blockTag), \"%response\");\n }\n async getTransactionCount(address, blockTag) {\n return getNumber(await this.#getAccountValue({ method: \"getTransactionCount\" }, address, blockTag), \"%response\");\n }\n async getCode(address, blockTag) {\n return hexlify(await this.#getAccountValue({ method: \"getCode\" }, address, blockTag));\n }\n async getStorage(address, _position, blockTag) {\n const position = getBigInt(_position, \"position\");\n return hexlify(await this.#getAccountValue({ method: \"getStorage\", position }, address, blockTag));\n }\n // Write\n async broadcastTransaction(signedTx) {\n const { blockNumber, hash, network } = await resolveProperties({\n blockNumber: this.getBlockNumber(),\n hash: this._perform({\n method: \"broadcastTransaction\",\n signedTransaction: signedTx\n }),\n network: this.getNetwork()\n });\n const tx = Transaction.from(signedTx);\n if (tx.hash !== hash) {\n throw new Error(\"@TODO: the returned hash did not match\");\n }\n return this._wrapTransactionResponse(tx, network).replaceableTransaction(blockNumber);\n }\n async #getBlock(block, includeTransactions) {\n // @TODO: Add CustomBlockPlugin check\n if (isHexString(block, 32)) {\n return await this.#perform({\n method: \"getBlock\", blockHash: block, includeTransactions\n });\n }\n let blockTag = this._getBlockTag(block);\n if (typeof (blockTag) !== \"string\") {\n blockTag = await blockTag;\n }\n return await this.#perform({\n method: \"getBlock\", blockTag, includeTransactions\n });\n }\n // Queries\n async getBlock(block, prefetchTxs) {\n const { network, params } = await resolveProperties({\n network: this.getNetwork(),\n params: this.#getBlock(block, !!prefetchTxs)\n });\n if (params == null) {\n return null;\n }\n return this._wrapBlock(params, network);\n }\n async getTransaction(hash) {\n const { network, params } = await resolveProperties({\n network: this.getNetwork(),\n params: this.#perform({ method: \"getTransaction\", hash })\n });\n if (params == null) {\n return null;\n }\n return this._wrapTransactionResponse(params, network);\n }\n async getTransactionReceipt(hash) {\n const { network, params } = await resolveProperties({\n network: this.getNetwork(),\n params: this.#perform({ method: \"getTransactionReceipt\", hash })\n });\n if (params == null) {\n return null;\n }\n // Some backends did not backfill the effectiveGasPrice into old transactions\n // in the receipt, so we look it up manually and inject it.\n if (params.gasPrice == null && params.effectiveGasPrice == null) {\n const tx = await this.#perform({ method: \"getTransaction\", hash });\n if (tx == null) {\n throw new Error(\"report this; could not find tx or effectiveGasPrice\");\n }\n params.effectiveGasPrice = tx.gasPrice;\n }\n return this._wrapTransactionReceipt(params, network);\n }\n async getTransactionResult(hash) {\n const { result } = await resolveProperties({\n network: this.getNetwork(),\n result: this.#perform({ method: \"getTransactionResult\", hash })\n });\n if (result == null) {\n return null;\n }\n return hexlify(result);\n }\n // Bloom-filter Queries\n async getLogs(_filter) {\n let filter = this._getFilter(_filter);\n if (isPromise(filter)) {\n filter = await filter;\n }\n const { network, params } = await resolveProperties({\n network: this.getNetwork(),\n params: this.#perform({ method: \"getLogs\", filter })\n });\n return params.map((p) => this._wrapLog(p, network));\n }\n // ENS\n _getProvider(chainId) {\n assert(false, \"provider cannot connect to target network\", \"UNSUPPORTED_OPERATION\", {\n operation: \"_getProvider()\"\n });\n }\n async getResolver(name) {\n return await EnsResolver.fromName(this, name);\n }\n async getAvatar(name) {\n const resolver = await this.getResolver(name);\n if (resolver) {\n return await resolver.getAvatar();\n }\n return null;\n }\n async resolveName(name) {\n const resolver = await this.getResolver(name);\n if (resolver) {\n return await resolver.getAddress();\n }\n return null;\n }\n async lookupAddress(address) {\n address = getAddress(address);\n const node = namehash(address.substring(2).toLowerCase() + \".addr.reverse\");\n try {\n const ensAddr = await EnsResolver.getEnsAddress(this);\n const ensContract = new Contract(ensAddr, [\n \"function resolver(bytes32) view returns (address)\"\n ], this);\n const resolver = await ensContract.resolver(node);\n if (resolver == null || resolver === ZeroAddress) {\n return null;\n }\n const resolverContract = new Contract(resolver, [\n \"function name(bytes32) view returns (string)\"\n ], this);\n const name = await resolverContract.name(node);\n // Failed forward resolution\n const check = await this.resolveName(name);\n if (check !== address) {\n return null;\n }\n return name;\n }\n catch (error) {\n // No data was returned from the resolver\n if (isError(error, \"BAD_DATA\") && error.value === \"0x\") {\n return null;\n }\n // Something reerted\n if (isError(error, \"CALL_EXCEPTION\")) {\n return null;\n }\n throw error;\n }\n return null;\n }\n async waitForTransaction(hash, _confirms, timeout) {\n const confirms = (_confirms != null) ? _confirms : 1;\n if (confirms === 0) {\n return this.getTransactionReceipt(hash);\n }\n return new Promise(async (resolve, reject) => {\n let timer = null;\n const listener = (async (blockNumber) => {\n try {\n const receipt = await this.getTransactionReceipt(hash);\n if (receipt != null) {\n if (blockNumber - receipt.blockNumber + 1 >= confirms) {\n resolve(receipt);\n //this.off(\"block\", listener);\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n return;\n }\n }\n }\n catch (error) {\n console.log(\"EEE\", error);\n }\n this.once(\"block\", listener);\n });\n if (timeout != null) {\n timer = setTimeout(() => {\n if (timer == null) {\n return;\n }\n timer = null;\n this.off(\"block\", listener);\n reject(makeError(\"timeout\", \"TIMEOUT\", { reason: \"timeout\" }));\n }, timeout);\n }\n listener(await this.getBlockNumber());\n });\n }\n async waitForBlock(blockTag) {\n assert(false, \"not implemented yet\", \"NOT_IMPLEMENTED\", {\n operation: \"waitForBlock\"\n });\n }\n /**\n * Clear a timer created using the [[_setTimeout]] method.\n */\n _clearTimeout(timerId) {\n const timer = this.#timers.get(timerId);\n if (!timer) {\n return;\n }\n if (timer.timer) {\n clearTimeout(timer.timer);\n }\n this.#timers.delete(timerId);\n }\n /**\n * Create a timer that will execute %%func%% after at least %%timeout%%\n * (in ms). If %%timeout%% is unspecified, then %%func%% will execute\n * in the next event loop.\n *\n * [Pausing](AbstractProvider-paused) the provider will pause any\n * associated timers.\n */\n _setTimeout(_func, timeout) {\n if (timeout == null) {\n timeout = 0;\n }\n const timerId = this.#nextTimer++;\n const func = () => {\n this.#timers.delete(timerId);\n _func();\n };\n if (this.paused) {\n this.#timers.set(timerId, { timer: null, func, time: timeout });\n }\n else {\n const timer = setTimeout(func, timeout);\n this.#timers.set(timerId, { timer, func, time: getTime() });\n }\n return timerId;\n }\n /**\n * Perform %%func%% on each subscriber.\n */\n _forEachSubscriber(func) {\n for (const sub of this.#subs.values()) {\n func(sub.subscriber);\n }\n }\n /**\n * Sub-classes may override this to customize subscription\n * implementations.\n */\n _getSubscriber(sub) {\n switch (sub.type) {\n case \"debug\":\n case \"error\":\n case \"network\":\n return new UnmanagedSubscriber(sub.type);\n case \"block\": {\n const subscriber = new PollingBlockSubscriber(this);\n subscriber.pollingInterval = this.pollingInterval;\n return subscriber;\n }\n case \"safe\":\n case \"finalized\":\n return new PollingBlockTagSubscriber(this, sub.type);\n case \"event\":\n return new PollingEventSubscriber(this, sub.filter);\n case \"transaction\":\n return new PollingTransactionSubscriber(this, sub.hash);\n case \"orphan\":\n return new PollingOrphanSubscriber(this, sub.filter);\n }\n throw new Error(`unsupported event: ${sub.type}`);\n }\n /**\n * If a [[Subscriber]] fails and needs to replace itself, this\n * method may be used.\n *\n * For example, this is used for providers when using the\n * ``eth_getFilterChanges`` method, which can return null if state\n * filters are not supported by the backend, allowing the Subscriber\n * to swap in a [[PollingEventSubscriber]].\n */\n _recoverSubscriber(oldSub, newSub) {\n for (const sub of this.#subs.values()) {\n if (sub.subscriber === oldSub) {\n if (sub.started) {\n sub.subscriber.stop();\n }\n sub.subscriber = newSub;\n if (sub.started) {\n newSub.start();\n }\n if (this.#pausedState != null) {\n newSub.pause(this.#pausedState);\n }\n break;\n }\n }\n }\n async #hasSub(event, emitArgs) {\n let sub = await getSubscription(event, this);\n // This is a log that is removing an existing log; we actually want\n // to emit an orphan event for the removed log\n if (sub.type === \"event\" && emitArgs && emitArgs.length > 0 && emitArgs[0].removed === true) {\n sub = await getSubscription({ orphan: \"drop-log\", log: emitArgs[0] }, this);\n }\n return this.#subs.get(sub.tag) || null;\n }\n async #getSub(event) {\n const subscription = await getSubscription(event, this);\n // Prevent tampering with our tag in any subclass' _getSubscriber\n const tag = subscription.tag;\n let sub = this.#subs.get(tag);\n if (!sub) {\n const subscriber = this._getSubscriber(subscription);\n const addressableMap = new WeakMap();\n const nameMap = new Map();\n sub = { subscriber, tag, addressableMap, nameMap, started: false, listeners: [] };\n this.#subs.set(tag, sub);\n }\n return sub;\n }\n async on(event, listener) {\n const sub = await this.#getSub(event);\n sub.listeners.push({ listener, once: false });\n if (!sub.started) {\n sub.subscriber.start();\n sub.started = true;\n if (this.#pausedState != null) {\n sub.subscriber.pause(this.#pausedState);\n }\n }\n return this;\n }\n async once(event, listener) {\n const sub = await this.#getSub(event);\n sub.listeners.push({ listener, once: true });\n if (!sub.started) {\n sub.subscriber.start();\n sub.started = true;\n if (this.#pausedState != null) {\n sub.subscriber.pause(this.#pausedState);\n }\n }\n return this;\n }\n async emit(event, ...args) {\n const sub = await this.#hasSub(event, args);\n // If there is not subscription or if a recent emit removed\n // the last of them (which also deleted the sub) do nothing\n if (!sub || sub.listeners.length === 0) {\n return false;\n }\n ;\n const count = sub.listeners.length;\n sub.listeners = sub.listeners.filter(({ listener, once }) => {\n const payload = new EventPayload(this, (once ? null : listener), event);\n try {\n listener.call(this, ...args, payload);\n }\n catch (error) { }\n return !once;\n });\n if (sub.listeners.length === 0) {\n if (sub.started) {\n sub.subscriber.stop();\n }\n this.#subs.delete(sub.tag);\n }\n return (count > 0);\n }\n async listenerCount(event) {\n if (event) {\n const sub = await this.#hasSub(event);\n if (!sub) {\n return 0;\n }\n return sub.listeners.length;\n }\n let total = 0;\n for (const { listeners } of this.#subs.values()) {\n total += listeners.length;\n }\n return total;\n }\n async listeners(event) {\n if (event) {\n const sub = await this.#hasSub(event);\n if (!sub) {\n return [];\n }\n return sub.listeners.map(({ listener }) => listener);\n }\n let result = [];\n for (const { listeners } of this.#subs.values()) {\n result = result.concat(listeners.map(({ listener }) => listener));\n }\n return result;\n }\n async off(event, listener) {\n const sub = await this.#hasSub(event);\n if (!sub) {\n return this;\n }\n if (listener) {\n const index = sub.listeners.map(({ listener }) => listener).indexOf(listener);\n if (index >= 0) {\n sub.listeners.splice(index, 1);\n }\n }\n if (!listener || sub.listeners.length === 0) {\n if (sub.started) {\n sub.subscriber.stop();\n }\n this.#subs.delete(sub.tag);\n }\n return this;\n }\n async removeAllListeners(event) {\n if (event) {\n const { tag, started, subscriber } = await this.#getSub(event);\n if (started) {\n subscriber.stop();\n }\n this.#subs.delete(tag);\n }\n else {\n for (const [tag, { started, subscriber }] of this.#subs) {\n if (started) {\n subscriber.stop();\n }\n this.#subs.delete(tag);\n }\n }\n return this;\n }\n // Alias for \"on\"\n async addListener(event, listener) {\n return await this.on(event, listener);\n }\n // Alias for \"off\"\n async removeListener(event, listener) {\n return this.off(event, listener);\n }\n /**\n * If this provider has been destroyed using the [[destroy]] method.\n *\n * Once destroyed, all resources are reclaimed, internal event loops\n * and timers are cleaned up and no further requests may be sent to\n * the provider.\n */\n get destroyed() {\n return this.#destroyed;\n }\n /**\n * Sub-classes may use this to shutdown any sockets or release their\n * resources and reject any pending requests.\n *\n * Sub-classes **must** call ``super.destroy()``.\n */\n destroy() {\n // Stop all listeners\n this.removeAllListeners();\n // Shut down all tiemrs\n for (const timerId of this.#timers.keys()) {\n this._clearTimeout(timerId);\n }\n this.#destroyed = true;\n }\n /**\n * Whether the provider is currently paused.\n *\n * A paused provider will not emit any events, and generally should\n * not make any requests to the network, but that is up to sub-classes\n * to manage.\n *\n * Setting ``paused = true`` is identical to calling ``.pause(false)``,\n * which will buffer any events that occur while paused until the\n * provider is unpaused.\n */\n get paused() { return (this.#pausedState != null); }\n set paused(pause) {\n if (!!pause === this.paused) {\n return;\n }\n if (this.paused) {\n this.resume();\n }\n else {\n this.pause(false);\n }\n }\n /**\n * Pause the provider. If %%dropWhilePaused%%, any events that occur\n * while paused are dropped, otherwise all events will be emitted once\n * the provider is unpaused.\n */\n pause(dropWhilePaused) {\n this.#lastBlockNumber = -1;\n if (this.#pausedState != null) {\n if (this.#pausedState == !!dropWhilePaused) {\n return;\n }\n assert(false, \"cannot change pause type; resume first\", \"UNSUPPORTED_OPERATION\", {\n operation: \"pause\"\n });\n }\n this._forEachSubscriber((s) => s.pause(dropWhilePaused));\n this.#pausedState = !!dropWhilePaused;\n for (const timer of this.#timers.values()) {\n // Clear the timer\n if (timer.timer) {\n clearTimeout(timer.timer);\n }\n // Remaining time needed for when we become unpaused\n timer.time = getTime() - timer.time;\n }\n }\n /**\n * Resume the provider.\n */\n resume() {\n if (this.#pausedState == null) {\n return;\n }\n this._forEachSubscriber((s) => s.resume());\n this.#pausedState = null;\n for (const timer of this.#timers.values()) {\n // Remaining time when we were paused\n let timeout = timer.time;\n if (timeout < 0) {\n timeout = 0;\n }\n // Start time (in cause paused, so we con compute remaininf time)\n timer.time = getTime();\n // Start the timer\n setTimeout(timer.func, timeout);\n }\n }\n}\nfunction _parseString(result, start) {\n try {\n const bytes = _parseBytes(result, start);\n if (bytes) {\n return toUtf8String(bytes);\n }\n }\n catch (error) { }\n return null;\n}\nfunction _parseBytes(result, start) {\n if (result === \"0x\") {\n return null;\n }\n try {\n const offset = getNumber(dataSlice(result, start, start + 32));\n const length = getNumber(dataSlice(result, offset, offset + 32));\n return dataSlice(result, offset + 32, offset + 32 + length);\n }\n catch (error) { }\n return null;\n}\nfunction numPad(value) {\n const result = toBeArray(value);\n if (result.length > 32) {\n throw new Error(\"internal; should not happen\");\n }\n const padded = new Uint8Array(32);\n padded.set(result, 32 - result.length);\n return padded;\n}\nfunction bytesPad(value) {\n if ((value.length % 32) === 0) {\n return value;\n }\n const result = new Uint8Array(Math.ceil(value.length / 32) * 32);\n result.set(value);\n return result;\n}\nconst empty = new Uint8Array([]);\n// ABI Encodes a series of (bytes, bytes, ...)\nfunction encodeBytes(datas) {\n const result = [];\n let byteCount = 0;\n // Add place-holders for pointers as we add items\n for (let i = 0; i < datas.length; i++) {\n result.push(empty);\n byteCount += 32;\n }\n for (let i = 0; i < datas.length; i++) {\n const data = getBytes(datas[i]);\n // Update the bytes offset\n result[i] = numPad(byteCount);\n // The length and padded value of data\n result.push(numPad(data.length));\n result.push(bytesPad(data));\n byteCount += 32 + Math.ceil(data.length / 32) * 32;\n }\n return concat(result);\n}\nconst zeros = \"0x0000000000000000000000000000000000000000000000000000000000000000\";\nfunction parseOffchainLookup(data) {\n const result = {\n sender: \"\", urls: [], calldata: \"\", selector: \"\", extraData: \"\", errorArgs: []\n };\n assert(dataLength(data) >= 5 * 32, \"insufficient OffchainLookup data\", \"OFFCHAIN_FAULT\", {\n reason: \"insufficient OffchainLookup data\"\n });\n const sender = dataSlice(data, 0, 32);\n assert(dataSlice(sender, 0, 12) === dataSlice(zeros, 0, 12), \"corrupt OffchainLookup sender\", \"OFFCHAIN_FAULT\", {\n reason: \"corrupt OffchainLookup sender\"\n });\n result.sender = dataSlice(sender, 12);\n // Read the URLs from the response\n try {\n const urls = [];\n const urlsOffset = getNumber(dataSlice(data, 32, 64));\n const urlsLength = getNumber(dataSlice(data, urlsOffset, urlsOffset + 32));\n const urlsData = dataSlice(data, urlsOffset + 32);\n for (let u = 0; u < urlsLength; u++) {\n const url = _parseString(urlsData, u * 32);\n if (url == null) {\n throw new Error(\"abort\");\n }\n urls.push(url);\n }\n result.urls = urls;\n }\n catch (error) {\n assert(false, \"corrupt OffchainLookup urls\", \"OFFCHAIN_FAULT\", {\n reason: \"corrupt OffchainLookup urls\"\n });\n }\n // Get the CCIP calldata to forward\n try {\n const calldata = _parseBytes(data, 64);\n if (calldata == null) {\n throw new Error(\"abort\");\n }\n result.calldata = calldata;\n }\n catch (error) {\n assert(false, \"corrupt OffchainLookup calldata\", \"OFFCHAIN_FAULT\", {\n reason: \"corrupt OffchainLookup calldata\"\n });\n }\n // Get the callbackSelector (bytes4)\n assert(dataSlice(data, 100, 128) === dataSlice(zeros, 0, 28), \"corrupt OffchainLookup callbaackSelector\", \"OFFCHAIN_FAULT\", {\n reason: \"corrupt OffchainLookup callbaackSelector\"\n });\n result.selector = dataSlice(data, 96, 100);\n // Get the extra data to send back to the contract as context\n try {\n const extraData = _parseBytes(data, 128);\n if (extraData == null) {\n throw new Error(\"abort\");\n }\n result.extraData = extraData;\n }\n catch (error) {\n assert(false, \"corrupt OffchainLookup extraData\", \"OFFCHAIN_FAULT\", {\n reason: \"corrupt OffchainLookup extraData\"\n });\n }\n result.errorArgs = \"sender,urls,calldata,selector,extraData\".split(/,/).map((k) => result[k]);\n return result;\n}\n//# sourceMappingURL=abstract-provider.js.map","/**\n * Generally the [[Wallet]] and [[JsonRpcSigner]] and their sub-classes\n * are sufficient for most developers, but this is provided to\n * fascilitate more complex Signers.\n *\n * @_section: api/providers/abstract-signer: Subclassing Signer [abstract-signer]\n */\nimport { resolveAddress } from \"../address/index.js\";\nimport { Transaction } from \"../transaction/index.js\";\nimport { defineProperties, getBigInt, resolveProperties, assert, assertArgument } from \"../utils/index.js\";\nimport { copyRequest } from \"./provider.js\";\nfunction checkProvider(signer, operation) {\n if (signer.provider) {\n return signer.provider;\n }\n assert(false, \"missing provider\", \"UNSUPPORTED_OPERATION\", { operation });\n}\nasync function populate(signer, tx) {\n let pop = copyRequest(tx);\n if (pop.to != null) {\n pop.to = resolveAddress(pop.to, signer);\n }\n if (pop.from != null) {\n const from = pop.from;\n pop.from = Promise.all([\n signer.getAddress(),\n resolveAddress(from, signer)\n ]).then(([address, from]) => {\n assertArgument(address.toLowerCase() === from.toLowerCase(), \"transaction from mismatch\", \"tx.from\", from);\n return address;\n });\n }\n else {\n pop.from = signer.getAddress();\n }\n return await resolveProperties(pop);\n}\n/**\n * An **AbstractSigner** includes most of teh functionality required\n * to get a [[Signer]] working as expected, but requires a few\n * Signer-specific methods be overridden.\n *\n */\nexport class AbstractSigner {\n /**\n * The provider this signer is connected to.\n */\n provider;\n /**\n * Creates a new Signer connected to %%provider%%.\n */\n constructor(provider) {\n defineProperties(this, { provider: (provider || null) });\n }\n async getNonce(blockTag) {\n return checkProvider(this, \"getTransactionCount\").getTransactionCount(await this.getAddress(), blockTag);\n }\n async populateCall(tx) {\n const pop = await populate(this, tx);\n return pop;\n }\n async populateTransaction(tx) {\n const provider = checkProvider(this, \"populateTransaction\");\n const pop = await populate(this, tx);\n if (pop.nonce == null) {\n pop.nonce = await this.getNonce(\"pending\");\n }\n if (pop.gasLimit == null) {\n pop.gasLimit = await this.estimateGas(pop);\n }\n // Populate the chain ID\n const network = await (this.provider).getNetwork();\n if (pop.chainId != null) {\n const chainId = getBigInt(pop.chainId);\n assertArgument(chainId === network.chainId, \"transaction chainId mismatch\", \"tx.chainId\", tx.chainId);\n }\n else {\n pop.chainId = network.chainId;\n }\n // Do not allow mixing pre-eip-1559 and eip-1559 properties\n const hasEip1559 = (pop.maxFeePerGas != null || pop.maxPriorityFeePerGas != null);\n if (pop.gasPrice != null && (pop.type === 2 || hasEip1559)) {\n assertArgument(false, \"eip-1559 transaction do not support gasPrice\", \"tx\", tx);\n }\n else if ((pop.type === 0 || pop.type === 1) && hasEip1559) {\n assertArgument(false, \"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas\", \"tx\", tx);\n }\n if ((pop.type === 2 || pop.type == null) && (pop.maxFeePerGas != null && pop.maxPriorityFeePerGas != null)) {\n // Fully-formed EIP-1559 transaction (skip getFeeData)\n pop.type = 2;\n }\n else if (pop.type === 0 || pop.type === 1) {\n // Explicit Legacy or EIP-2930 transaction\n // We need to get fee data to determine things\n const feeData = await provider.getFeeData();\n assert(feeData.gasPrice != null, \"network does not support gasPrice\", \"UNSUPPORTED_OPERATION\", {\n operation: \"getGasPrice\"\n });\n // Populate missing gasPrice\n if (pop.gasPrice == null) {\n pop.gasPrice = feeData.gasPrice;\n }\n }\n else {\n // We need to get fee data to determine things\n const feeData = await provider.getFeeData();\n if (pop.type == null) {\n // We need to auto-detect the intended type of this transaction...\n if (feeData.maxFeePerGas != null && feeData.maxPriorityFeePerGas != null) {\n // The network supports EIP-1559!\n // Upgrade transaction from null to eip-1559\n if (pop.authorizationList && pop.authorizationList.length) {\n pop.type = 4;\n }\n else {\n pop.type = 2;\n }\n if (pop.gasPrice != null) {\n // Using legacy gasPrice property on an eip-1559 network,\n // so use gasPrice as both fee properties\n const gasPrice = pop.gasPrice;\n delete pop.gasPrice;\n pop.maxFeePerGas = gasPrice;\n pop.maxPriorityFeePerGas = gasPrice;\n }\n else {\n // Populate missing fee data\n if (pop.maxFeePerGas == null) {\n pop.maxFeePerGas = feeData.maxFeePerGas;\n }\n if (pop.maxPriorityFeePerGas == null) {\n pop.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas;\n }\n }\n }\n else if (feeData.gasPrice != null) {\n // Network doesn't support EIP-1559...\n // ...but they are trying to use EIP-1559 properties\n assert(!hasEip1559, \"network does not support EIP-1559\", \"UNSUPPORTED_OPERATION\", {\n operation: \"populateTransaction\"\n });\n // Populate missing fee data\n if (pop.gasPrice == null) {\n pop.gasPrice = feeData.gasPrice;\n }\n // Explicitly set untyped transaction to legacy\n // @TODO: Maybe this shold allow type 1?\n pop.type = 0;\n }\n else {\n // getFeeData has failed us.\n assert(false, \"failed to get consistent fee data\", \"UNSUPPORTED_OPERATION\", {\n operation: \"signer.getFeeData\"\n });\n }\n }\n else if (pop.type === 2 || pop.type === 3 || pop.type === 4) {\n // Explicitly using EIP-1559 or EIP-4844\n // Populate missing fee data\n if (pop.maxFeePerGas == null) {\n pop.maxFeePerGas = feeData.maxFeePerGas;\n }\n if (pop.maxPriorityFeePerGas == null) {\n pop.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas;\n }\n }\n }\n //@TOOD: Don't await all over the place; save them up for\n // the end for better batching\n return await resolveProperties(pop);\n }\n async populateAuthorization(_auth) {\n const auth = Object.assign({}, _auth);\n // Add a chain ID if not explicitly set to 0\n if (auth.chainId == null) {\n auth.chainId = (await checkProvider(this, \"getNetwork\").getNetwork()).chainId;\n }\n // @TODO: Take chain ID into account when populating noce?\n if (auth.nonce == null) {\n auth.nonce = await this.getNonce();\n }\n return auth;\n }\n async estimateGas(tx) {\n return checkProvider(this, \"estimateGas\").estimateGas(await this.populateCall(tx));\n }\n async call(tx) {\n return checkProvider(this, \"call\").call(await this.populateCall(tx));\n }\n async resolveName(name) {\n const provider = checkProvider(this, \"resolveName\");\n return await provider.resolveName(name);\n }\n async sendTransaction(tx) {\n const provider = checkProvider(this, \"sendTransaction\");\n const pop = await this.populateTransaction(tx);\n delete pop.from;\n const txObj = Transaction.from(pop);\n return await provider.broadcastTransaction(await this.signTransaction(txObj));\n }\n // @TODO: in v7 move this to be abstract\n authorize(authorization) {\n assert(false, \"authorization not implemented for this signer\", \"UNSUPPORTED_OPERATION\", { operation: \"authorize\" });\n }\n}\n/**\n * A **VoidSigner** is a class designed to allow an address to be used\n * in any API which accepts a Signer, but for which there are no\n * credentials available to perform any actual signing.\n *\n * This for example allow impersonating an account for the purpose of\n * static calls or estimating gas, but does not allow sending transactions.\n */\nexport class VoidSigner extends AbstractSigner {\n /**\n * The signer address.\n */\n address;\n /**\n * Creates a new **VoidSigner** with %%address%% attached to\n * %%provider%%.\n */\n constructor(address, provider) {\n super(provider);\n defineProperties(this, { address });\n }\n async getAddress() { return this.address; }\n connect(provider) {\n return new VoidSigner(this.address, provider);\n }\n #throwUnsupported(suffix, operation) {\n assert(false, `VoidSigner cannot sign ${suffix}`, \"UNSUPPORTED_OPERATION\", { operation });\n }\n async signTransaction(tx) {\n this.#throwUnsupported(\"transactions\", \"signTransaction\");\n }\n async signMessage(message) {\n this.#throwUnsupported(\"messages\", \"signMessage\");\n }\n async signTypedData(domain, types, value) {\n this.#throwUnsupported(\"typed-data\", \"signTypedData\");\n }\n}\n//# sourceMappingURL=abstract-signer.js.map","/**\n * There are many awesome community services that provide Ethereum\n * nodes both for developers just starting out and for large-scale\n * communities.\n *\n * @_section: api/providers/thirdparty: Community Providers [thirdparty]\n */\n// Show the throttle message only once per service\nconst shown = new Set();\n/**\n * Displays a warning in the console when the community resource is\n * being used too heavily by the app, recommending the developer\n * acquire their own credentials instead of using the community\n * credentials.\n *\n * The notification will only occur once per service.\n */\nexport function showThrottleMessage(service) {\n if (shown.has(service)) {\n return;\n }\n shown.add(service);\n console.log(\"========= NOTICE =========\");\n console.log(`Request-Rate Exceeded for ${service} (this message will not be repeated)`);\n console.log(\"\");\n console.log(\"The default API keys for each service are provided as a highly-throttled,\");\n console.log(\"community resource for low-traffic projects and early prototyping.\");\n console.log(\"\");\n console.log(\"While your application will continue to function, we highly recommended\");\n console.log(\"signing up for your own API keys to improve performance, increase your\");\n console.log(\"request rate/limit and enable other perks, such as metrics and advanced APIs.\");\n console.log(\"\");\n console.log(\"For more details: https:/\\/docs.ethers.org/api-keys/\");\n console.log(\"==========================\");\n}\n//# sourceMappingURL=community.js.map","import { isError } from \"../utils/index.js\";\nimport { PollingEventSubscriber } from \"./subscriber-polling.js\";\nfunction copy(obj) {\n return JSON.parse(JSON.stringify(obj));\n}\n/**\n * Some backends support subscribing to events using a Filter ID.\n *\n * When subscribing with this technique, the node issues a unique\n * //Filter ID//. At this point the node dedicates resources to\n * the filter, so that periodic calls to follow up on the //Filter ID//\n * will receive any events since the last call.\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class FilterIdSubscriber {\n #provider;\n #filterIdPromise;\n #poller;\n #running;\n #network;\n #hault;\n /**\n * Creates a new **FilterIdSubscriber** which will used [[_subscribe]]\n * and [[_emitResults]] to setup the subscription and provide the event\n * to the %%provider%%.\n */\n constructor(provider) {\n this.#provider = provider;\n this.#filterIdPromise = null;\n this.#poller = this.#poll.bind(this);\n this.#running = false;\n this.#network = null;\n this.#hault = false;\n }\n /**\n * Sub-classes **must** override this to begin the subscription.\n */\n _subscribe(provider) {\n throw new Error(\"subclasses must override this\");\n }\n /**\n * Sub-classes **must** override this handle the events.\n */\n _emitResults(provider, result) {\n throw new Error(\"subclasses must override this\");\n }\n /**\n * Sub-classes **must** override this handle recovery on errors.\n */\n _recover(provider) {\n throw new Error(\"subclasses must override this\");\n }\n async #poll(blockNumber) {\n try {\n // Subscribe if necessary\n if (this.#filterIdPromise == null) {\n this.#filterIdPromise = this._subscribe(this.#provider);\n }\n // Get the Filter ID\n let filterId = null;\n try {\n filterId = await this.#filterIdPromise;\n }\n catch (error) {\n if (!isError(error, \"UNSUPPORTED_OPERATION\") || error.operation !== \"eth_newFilter\") {\n throw error;\n }\n }\n // The backend does not support Filter ID; downgrade to\n // polling\n if (filterId == null) {\n this.#filterIdPromise = null;\n this.#provider._recoverSubscriber(this, this._recover(this.#provider));\n return;\n }\n const network = await this.#provider.getNetwork();\n if (!this.#network) {\n this.#network = network;\n }\n if (this.#network.chainId !== network.chainId) {\n throw new Error(\"chaid changed\");\n }\n if (this.#hault) {\n return;\n }\n const result = await this.#provider.send(\"eth_getFilterChanges\", [filterId]);\n await this._emitResults(this.#provider, result);\n }\n catch (error) {\n console.log(\"@TODO\", error);\n }\n this.#provider.once(\"block\", this.#poller);\n }\n #teardown() {\n const filterIdPromise = this.#filterIdPromise;\n if (filterIdPromise) {\n this.#filterIdPromise = null;\n filterIdPromise.then((filterId) => {\n if (this.#provider.destroyed) {\n return;\n }\n this.#provider.send(\"eth_uninstallFilter\", [filterId]);\n });\n }\n }\n start() {\n if (this.#running) {\n return;\n }\n this.#running = true;\n this.#poll(-2);\n }\n stop() {\n if (!this.#running) {\n return;\n }\n this.#running = false;\n this.#hault = true;\n this.#teardown();\n this.#provider.off(\"block\", this.#poller);\n }\n pause(dropWhilePaused) {\n if (dropWhilePaused) {\n this.#teardown();\n }\n this.#provider.off(\"block\", this.#poller);\n }\n resume() { this.start(); }\n}\n/**\n * A **FilterIdSubscriber** for receiving contract events.\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class FilterIdEventSubscriber extends FilterIdSubscriber {\n #event;\n /**\n * Creates a new **FilterIdEventSubscriber** attached to %%provider%%\n * listening for %%filter%%.\n */\n constructor(provider, filter) {\n super(provider);\n this.#event = copy(filter);\n }\n _recover(provider) {\n return new PollingEventSubscriber(provider, this.#event);\n }\n async _subscribe(provider) {\n const filterId = await provider.send(\"eth_newFilter\", [this.#event]);\n return filterId;\n }\n async _emitResults(provider, results) {\n for (const result of results) {\n provider.emit(this.#event, provider._wrapLog(result, provider._network));\n }\n }\n}\n/**\n * A **FilterIdSubscriber** for receiving pending transactions events.\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class FilterIdPendingSubscriber extends FilterIdSubscriber {\n async _subscribe(provider) {\n return await provider.send(\"eth_newPendingTransactionFilter\", []);\n }\n async _emitResults(provider, results) {\n for (const result of results) {\n provider.emit(\"pending\", result);\n }\n }\n}\n//# sourceMappingURL=subscriber-filterid.js.map","/**\n * One of the most common ways to interact with the blockchain is\n * by a node running a JSON-RPC interface which can be connected to,\n * based on the transport, using:\n *\n * - HTTP or HTTPS - [[JsonRpcProvider]]\n * - WebSocket - [[WebSocketProvider]]\n * - IPC - [[IpcSocketProvider]]\n *\n * @_section: api/providers/jsonrpc:JSON-RPC Provider [about-jsonrpcProvider]\n */\n// @TODO:\n// - Add the batching API\n// https://playground.open-rpc.org/?schemaUrl=https://raw.githubusercontent.com/ethereum/eth1.0-apis/assembled-spec/openrpc.json&uiSchema%5BappBar%5D%5Bui:splitView%5D=true&uiSchema%5BappBar%5D%5Bui:input%5D=false&uiSchema%5BappBar%5D%5Bui:examplesDropdown%5D=false\nimport { AbiCoder } from \"../abi/index.js\";\nimport { getAddress, resolveAddress } from \"../address/index.js\";\nimport { TypedDataEncoder } from \"../hash/index.js\";\nimport { accessListify, authorizationify } from \"../transaction/index.js\";\nimport { defineProperties, getBigInt, hexlify, isHexString, toQuantity, toUtf8Bytes, isError, makeError, assert, assertArgument, FetchRequest, resolveProperties } from \"../utils/index.js\";\nimport { AbstractProvider, UnmanagedSubscriber } from \"./abstract-provider.js\";\nimport { AbstractSigner } from \"./abstract-signer.js\";\nimport { Network } from \"./network.js\";\nimport { FilterIdEventSubscriber, FilterIdPendingSubscriber } from \"./subscriber-filterid.js\";\nimport { PollingEventSubscriber } from \"./subscriber-polling.js\";\nconst Primitive = \"bigint,boolean,function,number,string,symbol\".split(/,/g);\n//const Methods = \"getAddress,then\".split(/,/g);\nfunction deepCopy(value) {\n if (value == null || Primitive.indexOf(typeof (value)) >= 0) {\n return value;\n }\n // Keep any Addressable\n if (typeof (value.getAddress) === \"function\") {\n return value;\n }\n if (Array.isArray(value)) {\n return (value.map(deepCopy));\n }\n if (typeof (value) === \"object\") {\n return Object.keys(value).reduce((accum, key) => {\n accum[key] = value[key];\n return accum;\n }, {});\n }\n throw new Error(`should not happen: ${value} (${typeof (value)})`);\n}\nfunction stall(duration) {\n return new Promise((resolve) => { setTimeout(resolve, duration); });\n}\nfunction getLowerCase(value) {\n if (value) {\n return value.toLowerCase();\n }\n return value;\n}\nfunction isPollable(value) {\n return (value && typeof (value.pollingInterval) === \"number\");\n}\nconst defaultOptions = {\n polling: false,\n staticNetwork: null,\n batchStallTime: 10,\n batchMaxSize: (1 << 20),\n batchMaxCount: 100,\n cacheTimeout: 250,\n pollingInterval: 4000\n};\n// @TODO: Unchecked Signers\nexport class JsonRpcSigner extends AbstractSigner {\n address;\n constructor(provider, address) {\n super(provider);\n address = getAddress(address);\n defineProperties(this, { address });\n }\n connect(provider) {\n assert(false, \"cannot reconnect JsonRpcSigner\", \"UNSUPPORTED_OPERATION\", {\n operation: \"signer.connect\"\n });\n }\n async getAddress() {\n return this.address;\n }\n // JSON-RPC will automatially fill in nonce, etc. so we just check from\n async populateTransaction(tx) {\n return await this.populateCall(tx);\n }\n // Returns just the hash of the transaction after sent, which is what\n // the bare JSON-RPC API does;\n async sendUncheckedTransaction(_tx) {\n const tx = deepCopy(_tx);\n const promises = [];\n // Make sure the from matches the sender\n if (tx.from) {\n const _from = tx.from;\n promises.push((async () => {\n const from = await resolveAddress(_from, this.provider);\n assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(), \"from address mismatch\", \"transaction\", _tx);\n tx.from = from;\n })());\n }\n else {\n tx.from = this.address;\n }\n // The JSON-RPC for eth_sendTransaction uses 90000 gas; if the user\n // wishes to use this, it is easy to specify explicitly, otherwise\n // we look it up for them.\n if (tx.gasLimit == null) {\n promises.push((async () => {\n tx.gasLimit = await this.provider.estimateGas({ ...tx, from: this.address });\n })());\n }\n // The address may be an ENS name or Addressable\n if (tx.to != null) {\n const _to = tx.to;\n promises.push((async () => {\n tx.to = await resolveAddress(_to, this.provider);\n })());\n }\n // Wait until all of our properties are filled in\n if (promises.length) {\n await Promise.all(promises);\n }\n const hexTx = this.provider.getRpcTransaction(tx);\n return this.provider.send(\"eth_sendTransaction\", [hexTx]);\n }\n async sendTransaction(tx) {\n // This cannot be mined any earlier than any recent block\n const blockNumber = await this.provider.getBlockNumber();\n // Send the transaction\n const hash = await this.sendUncheckedTransaction(tx);\n // Unfortunately, JSON-RPC only provides and opaque transaction hash\n // for a response, and we need the actual transaction, so we poll\n // for it; it should show up very quickly\n return await (new Promise((resolve, reject) => {\n const timeouts = [1000, 100];\n let invalids = 0;\n const checkTx = async () => {\n try {\n // Try getting the transaction\n const tx = await this.provider.getTransaction(hash);\n if (tx != null) {\n resolve(tx.replaceableTransaction(blockNumber));\n return;\n }\n }\n catch (error) {\n // If we were cancelled: stop polling.\n // If the data is bad: the node returns bad transactions\n // If the network changed: calling again will also fail\n // If unsupported: likely destroyed\n if (isError(error, \"CANCELLED\") || isError(error, \"BAD_DATA\") ||\n isError(error, \"NETWORK_ERROR\") || isError(error, \"UNSUPPORTED_OPERATION\")) {\n if (error.info == null) {\n error.info = {};\n }\n error.info.sendTransactionHash = hash;\n reject(error);\n return;\n }\n // Stop-gap for misbehaving backends; see #4513\n if (isError(error, \"INVALID_ARGUMENT\")) {\n invalids++;\n if (error.info == null) {\n error.info = {};\n }\n error.info.sendTransactionHash = hash;\n if (invalids > 10) {\n reject(error);\n return;\n }\n }\n // Notify anyone that cares; but we will try again, since\n // it is likely an intermittent service error\n this.provider.emit(\"error\", makeError(\"failed to fetch transation after sending (will try again)\", \"UNKNOWN_ERROR\", { error }));\n }\n // Wait another 4 seconds\n this.provider._setTimeout(() => { checkTx(); }, timeouts.pop() || 4000);\n };\n checkTx();\n }));\n }\n async signTransaction(_tx) {\n const tx = deepCopy(_tx);\n // Make sure the from matches the sender\n if (tx.from) {\n const from = await resolveAddress(tx.from, this.provider);\n assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(), \"from address mismatch\", \"transaction\", _tx);\n tx.from = from;\n }\n else {\n tx.from = this.address;\n }\n const hexTx = this.provider.getRpcTransaction(tx);\n return await this.provider.send(\"eth_signTransaction\", [hexTx]);\n }\n async signMessage(_message) {\n const message = ((typeof (_message) === \"string\") ? toUtf8Bytes(_message) : _message);\n return await this.provider.send(\"personal_sign\", [\n hexlify(message), this.address.toLowerCase()\n ]);\n }\n async signTypedData(domain, types, _value) {\n const value = deepCopy(_value);\n // Populate any ENS names (in-place)\n const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (value) => {\n const address = await resolveAddress(value);\n assertArgument(address != null, \"TypedData does not support null address\", \"value\", value);\n return address;\n });\n return await this.provider.send(\"eth_signTypedData_v4\", [\n this.address.toLowerCase(),\n JSON.stringify(TypedDataEncoder.getPayload(populated.domain, types, populated.value))\n ]);\n }\n async unlock(password) {\n return this.provider.send(\"personal_unlockAccount\", [\n this.address.toLowerCase(), password, null\n ]);\n }\n // https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign\n async _legacySignMessage(_message) {\n const message = ((typeof (_message) === \"string\") ? toUtf8Bytes(_message) : _message);\n return await this.provider.send(\"eth_sign\", [\n this.address.toLowerCase(), hexlify(message)\n ]);\n }\n}\n/**\n * The JsonRpcApiProvider is an abstract class and **MUST** be\n * sub-classed.\n *\n * It provides the base for all JSON-RPC-based Provider interaction.\n *\n * Sub-classing Notes:\n * - a sub-class MUST override _send\n * - a sub-class MUST call the `_start()` method once connected\n */\nexport class JsonRpcApiProvider extends AbstractProvider {\n #options;\n // The next ID to use for the JSON-RPC ID field\n #nextId;\n // Payloads are queued and triggered in batches using the drainTimer\n #payloads;\n #drainTimer;\n #notReady;\n #network;\n #pendingDetectNetwork;\n #scheduleDrain() {\n if (this.#drainTimer) {\n return;\n }\n // If we aren't using batching, no harm in sending it immediately\n const stallTime = (this._getOption(\"batchMaxCount\") === 1) ? 0 : this._getOption(\"batchStallTime\");\n this.#drainTimer = setTimeout(() => {\n this.#drainTimer = null;\n const payloads = this.#payloads;\n this.#payloads = [];\n while (payloads.length) {\n // Create payload batches that satisfy our batch constraints\n const batch = [(payloads.shift())];\n while (payloads.length) {\n if (batch.length === this.#options.batchMaxCount) {\n break;\n }\n batch.push((payloads.shift()));\n const bytes = JSON.stringify(batch.map((p) => p.payload));\n if (bytes.length > this.#options.batchMaxSize) {\n payloads.unshift((batch.pop()));\n break;\n }\n }\n // Process the result to each payload\n (async () => {\n const payload = ((batch.length === 1) ? batch[0].payload : batch.map((p) => p.payload));\n this.emit(\"debug\", { action: \"sendRpcPayload\", payload });\n try {\n const result = await this._send(payload);\n this.emit(\"debug\", { action: \"receiveRpcResult\", result });\n // Process results in batch order\n for (const { resolve, reject, payload } of batch) {\n if (this.destroyed) {\n reject(makeError(\"provider destroyed; cancelled request\", \"UNSUPPORTED_OPERATION\", { operation: payload.method }));\n continue;\n }\n // Find the matching result\n const resp = result.filter((r) => (r.id === payload.id))[0];\n // No result; the node failed us in unexpected ways\n if (resp == null) {\n const error = makeError(\"missing response for request\", \"BAD_DATA\", {\n value: result, info: { payload }\n });\n this.emit(\"error\", error);\n reject(error);\n continue;\n }\n // The response is an error\n if (\"error\" in resp) {\n reject(this.getRpcError(payload, resp));\n continue;\n }\n // All good; send the result\n resolve(resp.result);\n }\n }\n catch (error) {\n this.emit(\"debug\", { action: \"receiveRpcError\", error });\n for (const { reject } of batch) {\n // @TODO: augment the error with the payload\n reject(error);\n }\n }\n })();\n }\n }, stallTime);\n }\n constructor(network, options) {\n super(network, options);\n this.#nextId = 1;\n this.#options = Object.assign({}, defaultOptions, options || {});\n this.#payloads = [];\n this.#drainTimer = null;\n this.#network = null;\n this.#pendingDetectNetwork = null;\n {\n let resolve = null;\n const promise = new Promise((_resolve) => {\n resolve = _resolve;\n });\n this.#notReady = { promise, resolve };\n }\n const staticNetwork = this._getOption(\"staticNetwork\");\n if (typeof (staticNetwork) === \"boolean\") {\n assertArgument(!staticNetwork || network !== \"any\", \"staticNetwork cannot be used on special network 'any'\", \"options\", options);\n if (staticNetwork && network != null) {\n this.#network = Network.from(network);\n }\n }\n else if (staticNetwork) {\n // Make sure any static network is compatbile with the provided netwrok\n assertArgument(network == null || staticNetwork.matches(network), \"staticNetwork MUST match network object\", \"options\", options);\n this.#network = staticNetwork;\n }\n }\n /**\n * Returns the value associated with the option %%key%%.\n *\n * Sub-classes can use this to inquire about configuration options.\n */\n _getOption(key) {\n return this.#options[key];\n }\n /**\n * Gets the [[Network]] this provider has committed to. On each call, the network\n * is detected, and if it has changed, the call will reject.\n */\n get _network() {\n assert(this.#network, \"network is not available yet\", \"NETWORK_ERROR\");\n return this.#network;\n }\n /**\n * Resolves to the non-normalized value by performing %%req%%.\n *\n * Sub-classes may override this to modify behavior of actions,\n * and should generally call ``super._perform`` as a fallback.\n */\n async _perform(req) {\n // Legacy networks do not like the type field being passed along (which\n // is fair), so we delete type if it is 0 and a non-EIP-1559 network\n if (req.method === \"call\" || req.method === \"estimateGas\") {\n let tx = req.transaction;\n if (tx && tx.type != null && getBigInt(tx.type)) {\n // If there are no EIP-1559 or newer properties, it might be pre-EIP-1559\n if (tx.maxFeePerGas == null && tx.maxPriorityFeePerGas == null) {\n const feeData = await this.getFeeData();\n if (feeData.maxFeePerGas == null && feeData.maxPriorityFeePerGas == null) {\n // Network doesn't know about EIP-1559 (and hence type)\n req = Object.assign({}, req, {\n transaction: Object.assign({}, tx, { type: undefined })\n });\n }\n }\n }\n }\n const request = this.getRpcRequest(req);\n if (request != null) {\n return await this.send(request.method, request.args);\n }\n return super._perform(req);\n }\n /**\n * Sub-classes may override this; it detects the *actual* network that\n * we are **currently** connected to.\n *\n * Keep in mind that [[send]] may only be used once [[ready]], otherwise the\n * _send primitive must be used instead.\n */\n async _detectNetwork() {\n const network = this._getOption(\"staticNetwork\");\n if (network) {\n if (network === true) {\n if (this.#network) {\n return this.#network;\n }\n }\n else {\n return network;\n }\n }\n if (this.#pendingDetectNetwork) {\n return await this.#pendingDetectNetwork;\n }\n // If we are ready, use ``send``, which enabled requests to be batched\n if (this.ready) {\n this.#pendingDetectNetwork = (async () => {\n try {\n const result = Network.from(getBigInt(await this.send(\"eth_chainId\", [])));\n this.#pendingDetectNetwork = null;\n return result;\n }\n catch (error) {\n this.#pendingDetectNetwork = null;\n throw error;\n }\n })();\n return await this.#pendingDetectNetwork;\n }\n // We are not ready yet; use the primitive _send\n this.#pendingDetectNetwork = (async () => {\n const payload = {\n id: this.#nextId++, method: \"eth_chainId\", params: [], jsonrpc: \"2.0\"\n };\n this.emit(\"debug\", { action: \"sendRpcPayload\", payload });\n let result;\n try {\n result = (await this._send(payload))[0];\n this.#pendingDetectNetwork = null;\n }\n catch (error) {\n this.#pendingDetectNetwork = null;\n this.emit(\"debug\", { action: \"receiveRpcError\", error });\n throw error;\n }\n this.emit(\"debug\", { action: \"receiveRpcResult\", result });\n if (\"result\" in result) {\n return Network.from(getBigInt(result.result));\n }\n throw this.getRpcError(payload, result);\n })();\n return await this.#pendingDetectNetwork;\n }\n /**\n * Sub-classes **MUST** call this. Until [[_start]] has been called, no calls\n * will be passed to [[_send]] from [[send]]. If it is overridden, then\n * ``super._start()`` **MUST** be called.\n *\n * Calling it multiple times is safe and has no effect.\n */\n _start() {\n if (this.#notReady == null || this.#notReady.resolve == null) {\n return;\n }\n this.#notReady.resolve();\n this.#notReady = null;\n (async () => {\n // Bootstrap the network\n while (this.#network == null && !this.destroyed) {\n try {\n this.#network = await this._detectNetwork();\n }\n catch (error) {\n if (this.destroyed) {\n break;\n }\n console.log(\"JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)\");\n this.emit(\"error\", makeError(\"failed to bootstrap network detection\", \"NETWORK_ERROR\", { event: \"initial-network-discovery\", info: { error } }));\n await stall(1000);\n }\n }\n // Start dispatching requests\n this.#scheduleDrain();\n })();\n }\n /**\n * Resolves once the [[_start]] has been called. This can be used in\n * sub-classes to defer sending data until the connection has been\n * established.\n */\n async _waitUntilReady() {\n if (this.#notReady == null) {\n return;\n }\n return await this.#notReady.promise;\n }\n /**\n * Return a Subscriber that will manage the %%sub%%.\n *\n * Sub-classes may override this to modify the behavior of\n * subscription management.\n */\n _getSubscriber(sub) {\n // Pending Filters aren't availble via polling\n if (sub.type === \"pending\") {\n return new FilterIdPendingSubscriber(this);\n }\n if (sub.type === \"event\") {\n if (this._getOption(\"polling\")) {\n return new PollingEventSubscriber(this, sub.filter);\n }\n return new FilterIdEventSubscriber(this, sub.filter);\n }\n // Orphaned Logs are handled automatically, by the filter, since\n // logs with removed are emitted by it\n if (sub.type === \"orphan\" && sub.filter.orphan === \"drop-log\") {\n return new UnmanagedSubscriber(\"orphan\");\n }\n return super._getSubscriber(sub);\n }\n /**\n * Returns true only if the [[_start]] has been called.\n */\n get ready() { return this.#notReady == null; }\n /**\n * Returns %%tx%% as a normalized JSON-RPC transaction request,\n * which has all values hexlified and any numeric values converted\n * to Quantity values.\n */\n getRpcTransaction(tx) {\n const result = {};\n // JSON-RPC now requires numeric values to be \"quantity\" values\n [\"chainId\", \"gasLimit\", \"gasPrice\", \"type\", \"maxFeePerGas\", \"maxPriorityFeePerGas\", \"nonce\", \"value\"].forEach((key) => {\n if (tx[key] == null) {\n return;\n }\n let dstKey = key;\n if (key === \"gasLimit\") {\n dstKey = \"gas\";\n }\n result[dstKey] = toQuantity(getBigInt(tx[key], `tx.${key}`));\n });\n // Make sure addresses and data are lowercase\n [\"from\", \"to\", \"data\"].forEach((key) => {\n if (tx[key] == null) {\n return;\n }\n result[key] = hexlify(tx[key]);\n });\n // Normalize the access list object\n if (tx.accessList) {\n result[\"accessList\"] = accessListify(tx.accessList);\n }\n if (tx.blobVersionedHashes) {\n // @TODO: Remove this case once EIP-4844 added to prepared tx\n result[\"blobVersionedHashes\"] = tx.blobVersionedHashes.map(h => h.toLowerCase());\n }\n if (tx.authorizationList) {\n result[\"authorizationList\"] = tx.authorizationList.map((_a) => {\n const a = authorizationify(_a);\n return {\n address: a.address,\n nonce: toQuantity(a.nonce),\n chainId: toQuantity(a.chainId),\n yParity: toQuantity(a.signature.yParity),\n r: toQuantity(a.signature.r),\n s: toQuantity(a.signature.s),\n };\n });\n }\n // @TODO: blobs should probably also be copied over, optionally\n // accounting for the kzg property to backfill blobVersionedHashes\n // using the commitment. Or should that be left as an exercise to\n // the caller?\n return result;\n }\n /**\n * Returns the request method and arguments required to perform\n * %%req%%.\n */\n getRpcRequest(req) {\n switch (req.method) {\n case \"chainId\":\n return { method: \"eth_chainId\", args: [] };\n case \"getBlockNumber\":\n return { method: \"eth_blockNumber\", args: [] };\n case \"getGasPrice\":\n return { method: \"eth_gasPrice\", args: [] };\n case \"getPriorityFee\":\n return { method: \"eth_maxPriorityFeePerGas\", args: [] };\n case \"getBalance\":\n return {\n method: \"eth_getBalance\",\n args: [getLowerCase(req.address), req.blockTag]\n };\n case \"getTransactionCount\":\n return {\n method: \"eth_getTransactionCount\",\n args: [getLowerCase(req.address), req.blockTag]\n };\n case \"getCode\":\n return {\n method: \"eth_getCode\",\n args: [getLowerCase(req.address), req.blockTag]\n };\n case \"getStorage\":\n return {\n method: \"eth_getStorageAt\",\n args: [\n getLowerCase(req.address),\n (\"0x\" + req.position.toString(16)),\n req.blockTag\n ]\n };\n case \"broadcastTransaction\":\n return {\n method: \"eth_sendRawTransaction\",\n args: [req.signedTransaction]\n };\n case \"getBlock\":\n if (\"blockTag\" in req) {\n return {\n method: \"eth_getBlockByNumber\",\n args: [req.blockTag, !!req.includeTransactions]\n };\n }\n else if (\"blockHash\" in req) {\n return {\n method: \"eth_getBlockByHash\",\n args: [req.blockHash, !!req.includeTransactions]\n };\n }\n break;\n case \"getTransaction\":\n return {\n method: \"eth_getTransactionByHash\",\n args: [req.hash]\n };\n case \"getTransactionReceipt\":\n return {\n method: \"eth_getTransactionReceipt\",\n args: [req.hash]\n };\n case \"call\":\n return {\n method: \"eth_call\",\n args: [this.getRpcTransaction(req.transaction), req.blockTag]\n };\n case \"estimateGas\": {\n return {\n method: \"eth_estimateGas\",\n args: [this.getRpcTransaction(req.transaction)]\n };\n }\n case \"getLogs\":\n if (req.filter && req.filter.address != null) {\n if (Array.isArray(req.filter.address)) {\n req.filter.address = req.filter.address.map(getLowerCase);\n }\n else {\n req.filter.address = getLowerCase(req.filter.address);\n }\n }\n return { method: \"eth_getLogs\", args: [req.filter] };\n }\n return null;\n }\n /**\n * Returns an ethers-style Error for the given JSON-RPC error\n * %%payload%%, coalescing the various strings and error shapes\n * that different nodes return, coercing them into a machine-readable\n * standardized error.\n */\n getRpcError(payload, _error) {\n const { method } = payload;\n const { error } = _error;\n if (method === \"eth_estimateGas\" && error.message) {\n const msg = error.message;\n if (!msg.match(/revert/i) && msg.match(/insufficient funds/i)) {\n return makeError(\"insufficient funds\", \"INSUFFICIENT_FUNDS\", {\n transaction: (payload.params[0]),\n info: { payload, error }\n });\n }\n else if (msg.match(/nonce/i) && msg.match(/too low/i)) {\n return makeError(\"nonce has already been used\", \"NONCE_EXPIRED\", {\n transaction: (payload.params[0]),\n info: { payload, error }\n });\n }\n }\n if (method === \"eth_call\" || method === \"eth_estimateGas\") {\n const result = spelunkData(error);\n const e = AbiCoder.getBuiltinCallException((method === \"eth_call\") ? \"call\" : \"estimateGas\", (payload.params[0]), (result ? result.data : null));\n e.info = { error, payload };\n return e;\n }\n // Only estimateGas and call can return arbitrary contract-defined text, so now we\n // we can process text safely.\n const message = JSON.stringify(spelunkMessage(error));\n if (typeof (error.message) === \"string\" && error.message.match(/user denied|ethers-user-denied/i)) {\n const actionMap = {\n eth_sign: \"signMessage\",\n personal_sign: \"signMessage\",\n eth_signTypedData_v4: \"signTypedData\",\n eth_signTransaction: \"signTransaction\",\n eth_sendTransaction: \"sendTransaction\",\n eth_requestAccounts: \"requestAccess\",\n wallet_requestAccounts: \"requestAccess\",\n };\n return makeError(`user rejected action`, \"ACTION_REJECTED\", {\n action: (actionMap[method] || \"unknown\"),\n reason: \"rejected\",\n info: { payload, error }\n });\n }\n if (method === \"eth_sendRawTransaction\" || method === \"eth_sendTransaction\") {\n const transaction = (payload.params[0]);\n if (message.match(/insufficient funds|base fee exceeds gas limit/i)) {\n return makeError(\"insufficient funds for intrinsic transaction cost\", \"INSUFFICIENT_FUNDS\", {\n transaction, info: { error }\n });\n }\n if (message.match(/nonce/i) && message.match(/too low/i)) {\n return makeError(\"nonce has already been used\", \"NONCE_EXPIRED\", { transaction, info: { error } });\n }\n // \"replacement transaction underpriced\"\n if (message.match(/replacement transaction/i) && message.match(/underpriced/i)) {\n return makeError(\"replacement fee too low\", \"REPLACEMENT_UNDERPRICED\", { transaction, info: { error } });\n }\n if (message.match(/only replay-protected/i)) {\n return makeError(\"legacy pre-eip-155 transactions not supported\", \"UNSUPPORTED_OPERATION\", {\n operation: method, info: { transaction, info: { error } }\n });\n }\n }\n let unsupported = !!message.match(/the method .* does not exist/i);\n if (!unsupported) {\n if (error && error.details && error.details.startsWith(\"Unauthorized method:\")) {\n unsupported = true;\n }\n }\n if (unsupported) {\n return makeError(\"unsupported operation\", \"UNSUPPORTED_OPERATION\", {\n operation: payload.method, info: { error, payload }\n });\n }\n return makeError(\"could not coalesce error\", \"UNKNOWN_ERROR\", { error, payload });\n }\n /**\n * Requests the %%method%% with %%params%% via the JSON-RPC protocol\n * over the underlying channel. This can be used to call methods\n * on the backend that do not have a high-level API within the Provider\n * API.\n *\n * This method queues requests according to the batch constraints\n * in the options, assigns the request a unique ID.\n *\n * **Do NOT override** this method in sub-classes; instead\n * override [[_send]] or force the options values in the\n * call to the constructor to modify this method's behavior.\n */\n send(method, params) {\n // @TODO: cache chainId?? purge on switch_networks\n // We have been destroyed; no operations are supported anymore\n if (this.destroyed) {\n return Promise.reject(makeError(\"provider destroyed; cancelled request\", \"UNSUPPORTED_OPERATION\", { operation: method }));\n }\n const id = this.#nextId++;\n const promise = new Promise((resolve, reject) => {\n this.#payloads.push({\n resolve, reject,\n payload: { method, params, id, jsonrpc: \"2.0\" }\n });\n });\n // If there is not a pending drainTimer, set one\n this.#scheduleDrain();\n return promise;\n }\n /**\n * Resolves to the [[Signer]] account for %%address%% managed by\n * the client.\n *\n * If the %%address%% is a number, it is used as an index in the\n * the accounts from [[listAccounts]].\n *\n * This can only be used on clients which manage accounts (such as\n * Geth with imported account or MetaMask).\n *\n * Throws if the account doesn't exist.\n */\n async getSigner(address) {\n if (address == null) {\n address = 0;\n }\n const accountsPromise = this.send(\"eth_accounts\", []);\n // Account index\n if (typeof (address) === \"number\") {\n const accounts = (await accountsPromise);\n if (address >= accounts.length) {\n throw new Error(\"no such account\");\n }\n return new JsonRpcSigner(this, accounts[address]);\n }\n const { accounts } = await resolveProperties({\n network: this.getNetwork(),\n accounts: accountsPromise\n });\n // Account address\n address = getAddress(address);\n for (const account of accounts) {\n if (getAddress(account) === address) {\n return new JsonRpcSigner(this, address);\n }\n }\n throw new Error(\"invalid account\");\n }\n async listAccounts() {\n const accounts = await this.send(\"eth_accounts\", []);\n return accounts.map((a) => new JsonRpcSigner(this, a));\n }\n destroy() {\n // Stop processing requests\n if (this.#drainTimer) {\n clearTimeout(this.#drainTimer);\n this.#drainTimer = null;\n }\n // Cancel all pending requests\n for (const { payload, reject } of this.#payloads) {\n reject(makeError(\"provider destroyed; cancelled request\", \"UNSUPPORTED_OPERATION\", { operation: payload.method }));\n }\n this.#payloads = [];\n // Parent clean-up\n super.destroy();\n }\n}\n// @TODO: remove this in v7, it is not exported because this functionality\n// is exposed in the JsonRpcApiProvider by setting polling to true. It should\n// be safe to remove regardless, because it isn't reachable, but just in case.\n/**\n * @_ignore:\n */\nexport class JsonRpcApiPollingProvider extends JsonRpcApiProvider {\n #pollingInterval;\n constructor(network, options) {\n super(network, options);\n let pollingInterval = this._getOption(\"pollingInterval\");\n if (pollingInterval == null) {\n pollingInterval = defaultOptions.pollingInterval;\n }\n this.#pollingInterval = pollingInterval;\n }\n _getSubscriber(sub) {\n const subscriber = super._getSubscriber(sub);\n if (isPollable(subscriber)) {\n subscriber.pollingInterval = this.#pollingInterval;\n }\n return subscriber;\n }\n /**\n * The polling interval (default: 4000 ms)\n */\n get pollingInterval() { return this.#pollingInterval; }\n set pollingInterval(value) {\n if (!Number.isInteger(value) || value < 0) {\n throw new Error(\"invalid interval\");\n }\n this.#pollingInterval = value;\n this._forEachSubscriber((sub) => {\n if (isPollable(sub)) {\n sub.pollingInterval = this.#pollingInterval;\n }\n });\n }\n}\n/**\n * The JsonRpcProvider is one of the most common Providers,\n * which performs all operations over HTTP (or HTTPS) requests.\n *\n * Events are processed by polling the backend for the current block\n * number; when it advances, all block-base events are then checked\n * for updates.\n */\nexport class JsonRpcProvider extends JsonRpcApiPollingProvider {\n #connect;\n constructor(url, network, options) {\n if (url == null) {\n url = \"http:/\\/localhost:8545\";\n }\n super(network, options);\n if (typeof (url) === \"string\") {\n this.#connect = new FetchRequest(url);\n }\n else {\n this.#connect = url.clone();\n }\n }\n _getConnection() {\n return this.#connect.clone();\n }\n async send(method, params) {\n // All requests are over HTTP, so we can just start handling requests\n // We do this here rather than the constructor so that we don't send any\n // requests to the network (i.e. eth_chainId) until we absolutely have to.\n await this._start();\n return await super.send(method, params);\n }\n async _send(payload) {\n // Configure a POST connection for the requested method\n const request = this._getConnection();\n request.body = JSON.stringify(payload);\n request.setHeader(\"content-type\", \"application/json\");\n const response = await request.send();\n response.assertOk();\n let resp = response.bodyJson;\n if (!Array.isArray(resp)) {\n resp = [resp];\n }\n return resp;\n }\n}\nfunction spelunkData(value) {\n if (value == null) {\n return null;\n }\n // These *are* the droids we're looking for.\n if (typeof (value.message) === \"string\" && value.message.match(/revert/i) && isHexString(value.data)) {\n return { message: value.message, data: value.data };\n }\n // Spelunk further...\n if (typeof (value) === \"object\") {\n for (const key in value) {\n const result = spelunkData(value[key]);\n if (result) {\n return result;\n }\n }\n return null;\n }\n // Might be a JSON string we can further descend...\n if (typeof (value) === \"string\") {\n try {\n return spelunkData(JSON.parse(value));\n }\n catch (error) { }\n }\n return null;\n}\nfunction _spelunkMessage(value, result) {\n if (value == null) {\n return;\n }\n // These *are* the droids we're looking for.\n if (typeof (value.message) === \"string\") {\n result.push(value.message);\n }\n // Spelunk further...\n if (typeof (value) === \"object\") {\n for (const key in value) {\n _spelunkMessage(value[key], result);\n }\n }\n // Might be a JSON string we can further descend...\n if (typeof (value) === \"string\") {\n try {\n return _spelunkMessage(JSON.parse(value), result);\n }\n catch (error) { }\n }\n}\nfunction spelunkMessage(value) {\n const result = [];\n _spelunkMessage(value, result);\n return result;\n}\n//# sourceMappingURL=provider-jsonrpc.js.map","/**\n * [[link-ankr]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Ethereum Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Sepolia Testnet (``sepolia``)\n * - Arbitrum (``arbitrum``)\n * - Base (``base``)\n * - Base Goerlia Testnet (``base-goerli``)\n * - Base Sepolia Testnet (``base-sepolia``)\n * - BNB (``bnb``)\n * - BNB Testnet (``bnbt``)\n * - Filecoin (``filecoin``)\n * - Filecoin Calibration Testnet (``filecoin-calibration``)\n * - Optimism (``optimism``)\n * - Optimism Goerli Testnet (``optimism-goerli``)\n * - Optimism Sepolia Testnet (``optimism-sepolia``)\n * - Polygon (``matic``)\n * - Polygon Mumbai Testnet (``matic-mumbai``)\n *\n * @_subsection: api/providers/thirdparty:Ankr [providers-ankr]\n */\nimport { defineProperties, FetchRequest, assertArgument } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultApiKey = \"9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"rpc.ankr.com/eth\";\n case \"goerli\":\n return \"rpc.ankr.com/eth_goerli\";\n case \"sepolia\":\n return \"rpc.ankr.com/eth_sepolia\";\n case \"arbitrum\":\n return \"rpc.ankr.com/arbitrum\";\n case \"base\":\n return \"rpc.ankr.com/base\";\n case \"base-goerli\":\n return \"rpc.ankr.com/base_goerli\";\n case \"base-sepolia\":\n return \"rpc.ankr.com/base_sepolia\";\n case \"bnb\":\n return \"rpc.ankr.com/bsc\";\n case \"bnbt\":\n return \"rpc.ankr.com/bsc_testnet_chapel\";\n case \"filecoin\":\n return \"rpc.ankr.com/filecoin\";\n case \"filecoin-calibration\":\n return \"rpc.ankr.com/filecoin_testnet\";\n case \"matic\":\n return \"rpc.ankr.com/polygon\";\n case \"matic-mumbai\":\n return \"rpc.ankr.com/polygon_mumbai\";\n case \"optimism\":\n return \"rpc.ankr.com/optimism\";\n case \"optimism-goerli\":\n return \"rpc.ankr.com/optimism_testnet\";\n case \"optimism-sepolia\":\n return \"rpc.ankr.com/optimism_sepolia\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **AnkrProvider** connects to the [[link-ankr]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-ankr-signup).\n */\nexport class AnkrProvider extends JsonRpcProvider {\n /**\n * The API key for the Ankr connection.\n */\n apiKey;\n /**\n * Create a new **AnkrProvider**.\n *\n * By default connecting to ``mainnet`` with a highly throttled\n * API key.\n */\n constructor(_network, apiKey) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n // Ankr does not support filterId, so we force polling\n const options = { polling: true, staticNetwork: network };\n const request = AnkrProvider.getRequest(network, apiKey);\n super(request, network, options);\n defineProperties(this, { apiKey });\n }\n _getProvider(chainId) {\n try {\n return new AnkrProvider(chainId, this.apiKey);\n }\n catch (error) { }\n return super._getProvider(chainId);\n }\n /**\n * Returns a prepared request for connecting to %%network%% with\n * %%apiKey%%.\n */\n static getRequest(network, apiKey) {\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/${apiKey}`);\n request.allowGzip = true;\n if (apiKey === defaultApiKey) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"AnkrProvider\");\n return true;\n };\n }\n return request;\n }\n getRpcError(payload, error) {\n if (payload.method === \"eth_sendRawTransaction\") {\n if (error && error.error && error.error.message === \"INTERNAL_ERROR: could not replace existing tx\") {\n error.error.message = \"replacement transaction underpriced\";\n }\n }\n return super.getRpcError(payload, error);\n }\n isCommunityResource() {\n return (this.apiKey === defaultApiKey);\n }\n}\n//# sourceMappingURL=provider-ankr.js.map","/**\n * [[link-alchemy]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Ethereum Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Sepolia Testnet (``sepolia``)\n * - Arbitrum (``arbitrum``)\n * - Arbitrum Goerli Testnet (``arbitrum-goerli``)\n * - Arbitrum Sepolia Testnet (``arbitrum-sepolia``)\n * - Base (``base``)\n * - Base Goerlia Testnet (``base-goerli``)\n * - Base Sepolia Testnet (``base-sepolia``)\n * - Optimism (``optimism``)\n * - Optimism Goerli Testnet (``optimism-goerli``)\n * - Optimism Sepolia Testnet (``optimism-sepolia``)\n * - Polygon (``matic``)\n * - Polygon Amoy Testnet (``matic-amoy``)\n * - Polygon Mumbai Testnet (``matic-mumbai``)\n *\n * @_subsection: api/providers/thirdparty:Alchemy [providers-alchemy]\n */\nimport { defineProperties, resolveProperties, assert, assertArgument, FetchRequest } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultApiKey = \"_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"eth-mainnet.g.alchemy.com\";\n case \"goerli\":\n return \"eth-goerli.g.alchemy.com\";\n case \"sepolia\":\n return \"eth-sepolia.g.alchemy.com\";\n case \"arbitrum\":\n return \"arb-mainnet.g.alchemy.com\";\n case \"arbitrum-goerli\":\n return \"arb-goerli.g.alchemy.com\";\n case \"arbitrum-sepolia\":\n return \"arb-sepolia.g.alchemy.com\";\n case \"base\":\n return \"base-mainnet.g.alchemy.com\";\n case \"base-goerli\":\n return \"base-goerli.g.alchemy.com\";\n case \"base-sepolia\":\n return \"base-sepolia.g.alchemy.com\";\n case \"matic\":\n return \"polygon-mainnet.g.alchemy.com\";\n case \"matic-amoy\":\n return \"polygon-amoy.g.alchemy.com\";\n case \"matic-mumbai\":\n return \"polygon-mumbai.g.alchemy.com\";\n case \"optimism\":\n return \"opt-mainnet.g.alchemy.com\";\n case \"optimism-goerli\":\n return \"opt-goerli.g.alchemy.com\";\n case \"optimism-sepolia\":\n return \"opt-sepolia.g.alchemy.com\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **AlchemyProvider** connects to the [[link-alchemy]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-alchemy-signup).\n *\n * @_docloc: api/providers/thirdparty\n */\nexport class AlchemyProvider extends JsonRpcProvider {\n apiKey;\n constructor(_network, apiKey) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n const request = AlchemyProvider.getRequest(network, apiKey);\n super(request, network, { staticNetwork: network });\n defineProperties(this, { apiKey });\n }\n _getProvider(chainId) {\n try {\n return new AlchemyProvider(chainId, this.apiKey);\n }\n catch (error) { }\n return super._getProvider(chainId);\n }\n async _perform(req) {\n // https://docs.alchemy.com/reference/trace-transaction\n if (req.method === \"getTransactionResult\") {\n const { trace, tx } = await resolveProperties({\n trace: this.send(\"trace_transaction\", [req.hash]),\n tx: this.getTransaction(req.hash)\n });\n if (trace == null || tx == null) {\n return null;\n }\n let data;\n let error = false;\n try {\n data = trace[0].result.output;\n error = (trace[0].error === \"Reverted\");\n }\n catch (error) { }\n if (data) {\n assert(!error, \"an error occurred during transaction executions\", \"CALL_EXCEPTION\", {\n action: \"getTransactionResult\",\n data,\n reason: null,\n transaction: tx,\n invocation: null,\n revert: null // @TODO\n });\n return data;\n }\n assert(false, \"could not parse trace result\", \"BAD_DATA\", { value: trace });\n }\n return await super._perform(req);\n }\n isCommunityResource() {\n return (this.apiKey === defaultApiKey);\n }\n static getRequest(network, apiKey) {\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/v2/${apiKey}`);\n request.allowGzip = true;\n if (apiKey === defaultApiKey) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"alchemy\");\n return true;\n };\n }\n return request;\n }\n}\n//# sourceMappingURL=provider-alchemy.js.map","/**\n * [[link-chainstack]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Ethereum Mainnet (``mainnet``)\n * - Arbitrum (``arbitrum``)\n * - BNB Smart Chain Mainnet (``bnb``)\n * - Polygon (``matic``)\n *\n * @_subsection: api/providers/thirdparty:Chainstack [providers-chainstack]\n */\nimport { defineProperties, FetchRequest, assertArgument } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nfunction getApiKey(name) {\n switch (name) {\n case \"mainnet\": return \"39f1d67cedf8b7831010a665328c9197\";\n case \"arbitrum\": return \"0550c209db33c3abf4cc927e1e18cea1\";\n case \"bnb\": return \"98b5a77e531614387366f6fc5da097f8\";\n case \"matic\": return \"cd9d4d70377471aa7c142ec4a4205249\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"ethereum-mainnet.core.chainstack.com\";\n case \"arbitrum\":\n return \"arbitrum-mainnet.core.chainstack.com\";\n case \"bnb\":\n return \"bsc-mainnet.core.chainstack.com\";\n case \"matic\":\n return \"polygon-mainnet.core.chainstack.com\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **ChainstackProvider** connects to the [[link-chainstack]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-chainstack).\n */\nexport class ChainstackProvider extends JsonRpcProvider {\n /**\n * The API key for the Chainstack connection.\n */\n apiKey;\n /**\n * Creates a new **ChainstackProvider**.\n */\n constructor(_network, apiKey) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (apiKey == null) {\n apiKey = getApiKey(network.name);\n }\n const request = ChainstackProvider.getRequest(network, apiKey);\n super(request, network, { staticNetwork: network });\n defineProperties(this, { apiKey });\n }\n _getProvider(chainId) {\n try {\n return new ChainstackProvider(chainId, this.apiKey);\n }\n catch (error) { }\n return super._getProvider(chainId);\n }\n isCommunityResource() {\n return (this.apiKey === getApiKey(this._network.name));\n }\n /**\n * Returns a prepared request for connecting to %%network%%\n * with %%apiKey%% and %%projectSecret%%.\n */\n static getRequest(network, apiKey) {\n if (apiKey == null) {\n apiKey = getApiKey(network.name);\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/${apiKey}`);\n request.allowGzip = true;\n if (apiKey === getApiKey(network.name)) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"ChainstackProvider\");\n return true;\n };\n }\n return request;\n }\n}\n//# sourceMappingURL=provider-chainstack.js.map","/**\n * About Cloudflare\n *\n * @_subsection: api/providers/thirdparty:Cloudflare [providers-cloudflare]\n */\nimport { assertArgument } from \"../utils/index.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\n/**\n * About Cloudflare...\n */\nexport class CloudflareProvider extends JsonRpcProvider {\n constructor(_network) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n assertArgument(network.name === \"mainnet\", \"unsupported network\", \"network\", _network);\n super(\"https:/\\/cloudflare-eth.com/\", network, { staticNetwork: network });\n }\n}\n//# sourceMappingURL=provider-cloudflare.js.map","/**\n * [[link-etherscan]] provides a third-party service for connecting to\n * various blockchains over a combination of JSON-RPC and custom API\n * endpoints.\n *\n * **Supported Networks**\n *\n * - Ethereum Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Sepolia Testnet (``sepolia``)\n * - Holesky Testnet (``holesky``)\n * - Arbitrum (``arbitrum``)\n * - Arbitrum Goerli Testnet (``arbitrum-goerli``)\n * - Base (``base``)\n * - Base Sepolia Testnet (``base-sepolia``)\n * - BNB Smart Chain Mainnet (``bnb``)\n * - BNB Smart Chain Testnet (``bnbt``)\n * - Optimism (``optimism``)\n * - Optimism Goerli Testnet (``optimism-goerli``)\n * - Polygon (``matic``)\n * - Polygon Mumbai Testnet (``matic-mumbai``)\n * - Polygon Amoy Testnet (``matic-amoy``)\n *\n * @_subsection api/providers/thirdparty:Etherscan [providers-etherscan]\n */\nimport { AbiCoder } from \"../abi/index.js\";\nimport { Contract } from \"../contract/index.js\";\nimport { accessListify, Transaction } from \"../transaction/index.js\";\nimport { defineProperties, hexlify, toQuantity, FetchRequest, assert, assertArgument, isError, \n// parseUnits,\ntoUtf8String } from \"../utils/index.js\";\nimport { AbstractProvider } from \"./abstract-provider.js\";\nimport { Network } from \"./network.js\";\nimport { NetworkPlugin } from \"./plugins-network.js\";\nimport { showThrottleMessage } from \"./community.js\";\n// See: https://docs.etherscan.io/supported-chains\nconst Supported = (\"1 11155111 17000 560048 2741 11124 33111 33139 42170 \" +\n \"42161 421614 43114 43113 8453 84532 80069 80094 199 1029 81457 \" +\n \"168587773 56 97 42220 11142220 252 2523 100 999 737373 747474 \" +\n \"59144 59141 5000 5003 43521 143 10143 1287 1284 1285 10 \" +\n \"11155420 204 5611 80002 137 534352 534351 1329 1328 146 14601 \" +\n \"988 2201 1923 1924 167013 167000 130 1301 480 4801 51 50 324 300\").split(/ /g);\nconst THROTTLE = 2000;\nfunction isPromise(value) {\n return (value && typeof (value.then) === \"function\");\n}\nconst EtherscanPluginId = \"org.ethers.plugins.provider.Etherscan\";\n/**\n * A Network can include an **EtherscanPlugin** to provide\n * a custom base URL.\n *\n * @_docloc: api/providers/thirdparty:Etherscan\n */\nexport class EtherscanPlugin extends NetworkPlugin {\n /**\n * The Etherscan API base URL.\n */\n baseUrl;\n /**\n * Creates a new **EtherscanProvider** which will use\n * %%baseUrl%%.\n */\n constructor(baseUrl) {\n super(EtherscanPluginId);\n defineProperties(this, { baseUrl });\n }\n clone() {\n return new EtherscanPlugin(this.baseUrl);\n }\n}\nconst skipKeys = [\"enableCcipRead\"];\nlet nextId = 1;\n/**\n * The **EtherscanBaseProvider** is the super-class of\n * [[EtherscanProvider]], which should generally be used instead.\n *\n * Since the **EtherscanProvider** includes additional code for\n * [[Contract]] access, in //rare cases// that contracts are not\n * used, this class can reduce code size.\n *\n * @_docloc: api/providers/thirdparty:Etherscan\n */\nexport class EtherscanProvider extends AbstractProvider {\n /**\n * The connected network.\n */\n network;\n /**\n * The API key or null if using the community provided bandwidth.\n */\n apiKey;\n #plugin;\n /**\n * Creates a new **EtherscanBaseProvider**.\n */\n constructor(_network, _apiKey) {\n const apiKey = (_apiKey != null) ? _apiKey : null;\n super();\n const network = Network.from(_network);\n assertArgument(Supported.indexOf(`${network.chainId}`) >= 0, \"unsupported network\", \"network\", network);\n this.#plugin = network.getPlugin(EtherscanPluginId);\n defineProperties(this, { apiKey, network });\n }\n /**\n * Returns the base URL.\n *\n * If an [[EtherscanPlugin]] is configured on the\n * [[EtherscanBaseProvider_network]], returns the plugin's\n * baseUrl.\n *\n * Deprecated; for Etherscan v2 the base is no longer a simply\n * host, but instead a URL including a chainId parameter. Changing\n * this to return a URL prefix could break some libraries, so it\n * is left intact but will be removed in the future as it is unused.\n */\n getBaseUrl() {\n if (this.#plugin) {\n return this.#plugin.baseUrl;\n }\n switch (this.network.name) {\n case \"mainnet\":\n return \"https:/\\/api.etherscan.io\";\n case \"goerli\":\n return \"https:/\\/api-goerli.etherscan.io\";\n case \"sepolia\":\n return \"https:/\\/api-sepolia.etherscan.io\";\n case \"holesky\":\n return \"https:/\\/api-holesky.etherscan.io\";\n case \"arbitrum\":\n return \"https:/\\/api.arbiscan.io\";\n case \"arbitrum-goerli\":\n return \"https:/\\/api-goerli.arbiscan.io\";\n case \"base\":\n return \"https:/\\/api.basescan.org\";\n case \"base-sepolia\":\n return \"https:/\\/api-sepolia.basescan.org\";\n case \"bnb\":\n return \"https:/\\/api.bscscan.com\";\n case \"bnbt\":\n return \"https:/\\/api-testnet.bscscan.com\";\n case \"matic\":\n return \"https:/\\/api.polygonscan.com\";\n case \"matic-amoy\":\n return \"https:/\\/api-amoy.polygonscan.com\";\n case \"matic-mumbai\":\n return \"https:/\\/api-testnet.polygonscan.com\";\n case \"optimism\":\n return \"https:/\\/api-optimistic.etherscan.io\";\n case \"optimism-goerli\":\n return \"https:/\\/api-goerli-optimistic.etherscan.io\";\n default:\n }\n assertArgument(false, \"unsupported network\", \"network\", this.network);\n }\n /**\n * Returns the URL for the %%module%% and %%params%%.\n */\n getUrl(module, params) {\n let query = Object.keys(params).reduce((accum, key) => {\n const value = params[key];\n if (value != null) {\n accum += `&${key}=${value}`;\n }\n return accum;\n }, \"\");\n if (this.apiKey) {\n query += `&apikey=${this.apiKey}`;\n }\n return `https:/\\/api.etherscan.io/v2/api?chainid=${this.network.chainId}&module=${module}${query}`;\n }\n /**\n * Returns the URL for using POST requests.\n */\n getPostUrl() {\n return `https:/\\/api.etherscan.io/v2/api?chainid=${this.network.chainId}`;\n }\n /**\n * Returns the parameters for using POST requests.\n */\n getPostData(module, params) {\n params.module = module;\n params.apikey = this.apiKey;\n params.chainid = this.network.chainId;\n return params;\n }\n async detectNetwork() {\n return this.network;\n }\n /**\n * Resolves to the result of calling %%module%% with %%params%%.\n *\n * If %%post%%, the request is made as a POST request.\n */\n async fetch(module, params, post) {\n const id = nextId++;\n const url = (post ? this.getPostUrl() : this.getUrl(module, params));\n const payload = (post ? this.getPostData(module, params) : null);\n this.emit(\"debug\", { action: \"sendRequest\", id, url, payload: payload });\n const request = new FetchRequest(url);\n request.setThrottleParams({ slotInterval: 1000 });\n request.retryFunc = (req, resp, attempt) => {\n if (this.isCommunityResource()) {\n showThrottleMessage(\"Etherscan\");\n }\n return Promise.resolve(true);\n };\n request.processFunc = async (request, response) => {\n const result = response.hasBody() ? JSON.parse(toUtf8String(response.body)) : {};\n const throttle = ((typeof (result.result) === \"string\") ? result.result : \"\").toLowerCase().indexOf(\"rate limit\") >= 0;\n if (module === \"proxy\") {\n // This JSON response indicates we are being throttled\n if (result && result.status == 0 && result.message == \"NOTOK\" && throttle) {\n this.emit(\"debug\", { action: \"receiveError\", id, reason: \"proxy-NOTOK\", error: result });\n response.throwThrottleError(result.result, THROTTLE);\n }\n }\n else {\n if (throttle) {\n this.emit(\"debug\", { action: \"receiveError\", id, reason: \"null result\", error: result.result });\n response.throwThrottleError(result.result, THROTTLE);\n }\n }\n return response;\n };\n if (payload) {\n request.setHeader(\"content-type\", \"application/x-www-form-urlencoded; charset=UTF-8\");\n request.body = Object.keys(payload).map((k) => `${k}=${payload[k]}`).join(\"&\");\n }\n const response = await request.send();\n try {\n response.assertOk();\n }\n catch (error) {\n this.emit(\"debug\", { action: \"receiveError\", id, error, reason: \"assertOk\" });\n assert(false, \"response error\", \"SERVER_ERROR\", { request, response });\n }\n if (!response.hasBody()) {\n this.emit(\"debug\", { action: \"receiveError\", id, error: \"missing body\", reason: \"null body\" });\n assert(false, \"missing response\", \"SERVER_ERROR\", { request, response });\n }\n const result = JSON.parse(toUtf8String(response.body));\n if (module === \"proxy\") {\n if (result.jsonrpc != \"2.0\") {\n this.emit(\"debug\", { action: \"receiveError\", id, result, reason: \"invalid JSON-RPC\" });\n assert(false, \"invalid JSON-RPC response (missing jsonrpc='2.0')\", \"SERVER_ERROR\", { request, response, info: { result } });\n }\n if (result.error) {\n this.emit(\"debug\", { action: \"receiveError\", id, result, reason: \"JSON-RPC error\" });\n assert(false, \"error response\", \"SERVER_ERROR\", { request, response, info: { result } });\n }\n this.emit(\"debug\", { action: \"receiveRequest\", id, result });\n return result.result;\n }\n else {\n // getLogs, getHistory have weird success responses\n if (result.status == 0 && (result.message === \"No records found\" || result.message === \"No transactions found\")) {\n this.emit(\"debug\", { action: \"receiveRequest\", id, result });\n return result.result;\n }\n if (result.status != 1 || (typeof (result.message) === \"string\" && !result.message.match(/^OK/))) {\n this.emit(\"debug\", { action: \"receiveError\", id, result });\n assert(false, \"error response\", \"SERVER_ERROR\", { request, response, info: { result } });\n }\n this.emit(\"debug\", { action: \"receiveRequest\", id, result });\n return result.result;\n }\n }\n /**\n * Returns %%transaction%% normalized for the Etherscan API.\n */\n _getTransactionPostData(transaction) {\n const result = {};\n for (let key in transaction) {\n if (skipKeys.indexOf(key) >= 0) {\n continue;\n }\n if (transaction[key] == null) {\n continue;\n }\n let value = transaction[key];\n if (key === \"type\" && value === 0) {\n continue;\n }\n if (key === \"blockTag\" && value === \"latest\") {\n continue;\n }\n // Quantity-types require no leading zero, unless 0\n if ({ type: true, gasLimit: true, gasPrice: true, maxFeePerGs: true, maxPriorityFeePerGas: true, nonce: true, value: true }[key]) {\n value = toQuantity(value);\n }\n else if (key === \"accessList\") {\n value = \"[\" + accessListify(value).map((set) => {\n return `{address:\"${set.address}\",storageKeys:[\"${set.storageKeys.join('\",\"')}\"]}`;\n }).join(\",\") + \"]\";\n }\n else if (key === \"blobVersionedHashes\") {\n if (value.length === 0) {\n continue;\n }\n // @TODO: update this once the API supports blobs\n assert(false, \"Etherscan API does not support blobVersionedHashes\", \"UNSUPPORTED_OPERATION\", {\n operation: \"_getTransactionPostData\",\n info: { transaction }\n });\n }\n else {\n value = hexlify(value);\n }\n result[key] = value;\n }\n return result;\n }\n /**\n * Throws the normalized Etherscan error.\n */\n _checkError(req, error, transaction) {\n // Pull any message out if, possible\n let message = \"\";\n if (isError(error, \"SERVER_ERROR\")) {\n // Check for an error emitted by a proxy call\n try {\n message = error.info.result.error.message;\n }\n catch (e) { }\n if (!message) {\n try {\n message = error.info.message;\n }\n catch (e) { }\n }\n }\n if (req.method === \"estimateGas\") {\n if (!message.match(/revert/i) && message.match(/insufficient funds/i)) {\n assert(false, \"insufficient funds\", \"INSUFFICIENT_FUNDS\", {\n transaction: req.transaction\n });\n }\n }\n if (req.method === \"call\" || req.method === \"estimateGas\") {\n if (message.match(/execution reverted/i)) {\n let data = \"\";\n try {\n data = error.info.result.error.data;\n }\n catch (error) { }\n const e = AbiCoder.getBuiltinCallException(req.method, req.transaction, data);\n e.info = { request: req, error };\n throw e;\n }\n }\n if (message) {\n if (req.method === \"broadcastTransaction\") {\n const transaction = Transaction.from(req.signedTransaction);\n if (message.match(/replacement/i) && message.match(/underpriced/i)) {\n assert(false, \"replacement fee too low\", \"REPLACEMENT_UNDERPRICED\", {\n transaction\n });\n }\n if (message.match(/insufficient funds/)) {\n assert(false, \"insufficient funds for intrinsic transaction cost\", \"INSUFFICIENT_FUNDS\", {\n transaction\n });\n }\n if (message.match(/same hash was already imported|transaction nonce is too low|nonce too low/)) {\n assert(false, \"nonce has already been used\", \"NONCE_EXPIRED\", {\n transaction\n });\n }\n }\n }\n // Something we could not process\n throw error;\n }\n async _detectNetwork() {\n return this.network;\n }\n async _perform(req) {\n switch (req.method) {\n case \"chainId\":\n return this.network.chainId;\n case \"getBlockNumber\":\n return this.fetch(\"proxy\", { action: \"eth_blockNumber\" });\n case \"getGasPrice\":\n return this.fetch(\"proxy\", { action: \"eth_gasPrice\" });\n case \"getPriorityFee\":\n // This is temporary until Etherscan completes support\n if (this.network.name === \"mainnet\") {\n return \"1000000000\";\n }\n else if (this.network.name === \"optimism\") {\n return \"1000000\";\n }\n else {\n throw new Error(\"fallback onto the AbstractProvider default\");\n }\n /* Working with Etherscan to get this added:\n try {\n const test = await this.fetch(\"proxy\", {\n action: \"eth_maxPriorityFeePerGas\"\n });\n console.log(test);\n return test;\n } catch (e) {\n console.log(\"DEBUG\", e);\n throw e;\n }\n */\n /* This might be safe; but due to rounding neither myself\n or Etherscan are necessarily comfortable with this. :)\n try {\n const result = await this.fetch(\"gastracker\", { action: \"gasoracle\" });\n console.log(result);\n const gasPrice = parseUnits(result.SafeGasPrice, \"gwei\");\n const baseFee = parseUnits(result.suggestBaseFee, \"gwei\");\n const priorityFee = gasPrice - baseFee;\n if (priorityFee < 0) { throw new Error(\"negative priority fee; defer to abstract provider default\"); }\n return priorityFee;\n } catch (error) {\n console.log(\"DEBUG\", error);\n throw error;\n }\n */\n case \"getBalance\":\n // Returns base-10 result\n return this.fetch(\"account\", {\n action: \"balance\",\n address: req.address,\n tag: req.blockTag\n });\n case \"getTransactionCount\":\n return this.fetch(\"proxy\", {\n action: \"eth_getTransactionCount\",\n address: req.address,\n tag: req.blockTag\n });\n case \"getCode\":\n return this.fetch(\"proxy\", {\n action: \"eth_getCode\",\n address: req.address,\n tag: req.blockTag\n });\n case \"getStorage\":\n return this.fetch(\"proxy\", {\n action: \"eth_getStorageAt\",\n address: req.address,\n position: req.position,\n tag: req.blockTag\n });\n case \"broadcastTransaction\":\n return this.fetch(\"proxy\", {\n action: \"eth_sendRawTransaction\",\n hex: req.signedTransaction\n }, true).catch((error) => {\n return this._checkError(req, error, req.signedTransaction);\n });\n case \"getBlock\":\n if (\"blockTag\" in req) {\n return this.fetch(\"proxy\", {\n action: \"eth_getBlockByNumber\",\n tag: req.blockTag,\n boolean: (req.includeTransactions ? \"true\" : \"false\")\n });\n }\n assert(false, \"getBlock by blockHash not supported by Etherscan\", \"UNSUPPORTED_OPERATION\", {\n operation: \"getBlock(blockHash)\"\n });\n case \"getTransaction\":\n return this.fetch(\"proxy\", {\n action: \"eth_getTransactionByHash\",\n txhash: req.hash\n });\n case \"getTransactionReceipt\":\n return this.fetch(\"proxy\", {\n action: \"eth_getTransactionReceipt\",\n txhash: req.hash\n });\n case \"call\": {\n if (req.blockTag !== \"latest\") {\n throw new Error(\"EtherscanProvider does not support blockTag for call\");\n }\n const postData = this._getTransactionPostData(req.transaction);\n postData.module = \"proxy\";\n postData.action = \"eth_call\";\n try {\n return await this.fetch(\"proxy\", postData, true);\n }\n catch (error) {\n return this._checkError(req, error, req.transaction);\n }\n }\n case \"estimateGas\": {\n const postData = this._getTransactionPostData(req.transaction);\n postData.module = \"proxy\";\n postData.action = \"eth_estimateGas\";\n try {\n return await this.fetch(\"proxy\", postData, true);\n }\n catch (error) {\n return this._checkError(req, error, req.transaction);\n }\n }\n /*\n case \"getLogs\": {\n // Needs to complain if more than one address is passed in\n const args: Record = { action: \"getLogs\" }\n \n if (params.filter.fromBlock) {\n args.fromBlock = checkLogTag(params.filter.fromBlock);\n }\n \n if (params.filter.toBlock) {\n args.toBlock = checkLogTag(params.filter.toBlock);\n }\n \n if (params.filter.address) {\n args.address = params.filter.address;\n }\n \n // @TODO: We can handle slightly more complicated logs using the logs API\n if (params.filter.topics && params.filter.topics.length > 0) {\n if (params.filter.topics.length > 1) {\n logger.throwError(\"unsupported topic count\", Logger.Errors.UNSUPPORTED_OPERATION, { topics: params.filter.topics });\n }\n if (params.filter.topics.length === 1) {\n const topic0 = params.filter.topics[0];\n if (typeof(topic0) !== \"string\" || topic0.length !== 66) {\n logger.throwError(\"unsupported topic format\", Logger.Errors.UNSUPPORTED_OPERATION, { topic0: topic0 });\n }\n args.topic0 = topic0;\n }\n }\n \n const logs: Array = await this.fetch(\"logs\", args);\n \n // Cache txHash => blockHash\n let blocks: { [tag: string]: string } = {};\n \n // Add any missing blockHash to the logs\n for (let i = 0; i < logs.length; i++) {\n const log = logs[i];\n if (log.blockHash != null) { continue; }\n if (blocks[log.blockNumber] == null) {\n const block = await this.getBlock(log.blockNumber);\n if (block) {\n blocks[log.blockNumber] = block.hash;\n }\n }\n \n log.blockHash = blocks[log.blockNumber];\n }\n \n return logs;\n }\n */\n default:\n break;\n }\n return super._perform(req);\n }\n async getNetwork() {\n return this.network;\n }\n /**\n * Resolves to the current price of ether.\n *\n * This returns ``0`` on any network other than ``mainnet``.\n */\n async getEtherPrice() {\n if (this.network.name !== \"mainnet\") {\n return 0.0;\n }\n return parseFloat((await this.fetch(\"stats\", { action: \"ethprice\" })).ethusd);\n }\n /**\n * Resolves to a [Contract]] for %%address%%, using the\n * Etherscan API to retreive the Contract ABI.\n */\n async getContract(_address) {\n let address = this._getAddress(_address);\n if (isPromise(address)) {\n address = await address;\n }\n try {\n const resp = await this.fetch(\"contract\", {\n action: \"getabi\", address\n });\n const abi = JSON.parse(resp);\n return new Contract(address, abi, this);\n }\n catch (error) {\n return null;\n }\n }\n isCommunityResource() {\n return (this.apiKey == null);\n }\n}\n//# sourceMappingURL=provider-etherscan.js.map","function getGlobal() {\n if (typeof self !== 'undefined') {\n return self;\n }\n if (typeof window !== 'undefined') {\n return window;\n }\n if (typeof global !== 'undefined') {\n return global;\n }\n throw new Error('unable to locate global object');\n}\n;\nconst _WebSocket = getGlobal().WebSocket;\nexport { _WebSocket as WebSocket };\n//# sourceMappingURL=ws-browser.js.map","/**\n * Generic long-lived socket provider.\n *\n * Sub-classing notes\n * - a sub-class MUST call the `_start()` method once connected\n * - a sub-class MUST override the `_write(string)` method\n * - a sub-class MUST call `_processMessage(string)` for each message\n *\n * @_subsection: api/providers/abstract-provider:Socket Providers [about-socketProvider]\n */\nimport { UnmanagedSubscriber } from \"./abstract-provider.js\";\nimport { assert, assertArgument, makeError } from \"../utils/index.js\";\nimport { JsonRpcApiProvider } from \"./provider-jsonrpc.js\";\n/**\n * A **SocketSubscriber** uses a socket transport to handle events and\n * should use [[_emit]] to manage the events.\n */\nexport class SocketSubscriber {\n #provider;\n #filter;\n /**\n * The filter.\n */\n get filter() { return JSON.parse(this.#filter); }\n #filterId;\n #paused;\n #emitPromise;\n /**\n * Creates a new **SocketSubscriber** attached to %%provider%% listening\n * to %%filter%%.\n */\n constructor(provider, filter) {\n this.#provider = provider;\n this.#filter = JSON.stringify(filter);\n this.#filterId = null;\n this.#paused = null;\n this.#emitPromise = null;\n }\n start() {\n this.#filterId = this.#provider.send(\"eth_subscribe\", this.filter).then((filterId) => {\n ;\n this.#provider._register(filterId, this);\n return filterId;\n });\n }\n stop() {\n (this.#filterId).then((filterId) => {\n if (this.#provider.destroyed) {\n return;\n }\n this.#provider.send(\"eth_unsubscribe\", [filterId]);\n });\n this.#filterId = null;\n }\n // @TODO: pause should trap the current blockNumber, unsub, and on resume use getLogs\n // and resume\n pause(dropWhilePaused) {\n assert(dropWhilePaused, \"preserve logs while paused not supported by SocketSubscriber yet\", \"UNSUPPORTED_OPERATION\", { operation: \"pause(false)\" });\n this.#paused = !!dropWhilePaused;\n }\n resume() {\n this.#paused = null;\n }\n /**\n * @_ignore:\n */\n _handleMessage(message) {\n if (this.#filterId == null) {\n return;\n }\n if (this.#paused === null) {\n let emitPromise = this.#emitPromise;\n if (emitPromise == null) {\n emitPromise = this._emit(this.#provider, message);\n }\n else {\n emitPromise = emitPromise.then(async () => {\n await this._emit(this.#provider, message);\n });\n }\n this.#emitPromise = emitPromise.then(() => {\n if (this.#emitPromise === emitPromise) {\n this.#emitPromise = null;\n }\n });\n }\n }\n /**\n * Sub-classes **must** override this to emit the events on the\n * provider.\n */\n async _emit(provider, message) {\n throw new Error(\"sub-classes must implemente this; _emit\");\n }\n}\n/**\n * A **SocketBlockSubscriber** listens for ``newHeads`` events and emits\n * ``\"block\"`` events.\n */\nexport class SocketBlockSubscriber extends SocketSubscriber {\n /**\n * @_ignore:\n */\n constructor(provider) {\n super(provider, [\"newHeads\"]);\n }\n async _emit(provider, message) {\n provider.emit(\"block\", parseInt(message.number));\n }\n}\n/**\n * A **SocketPendingSubscriber** listens for pending transacitons and emits\n * ``\"pending\"`` events.\n */\nexport class SocketPendingSubscriber extends SocketSubscriber {\n /**\n * @_ignore:\n */\n constructor(provider) {\n super(provider, [\"newPendingTransactions\"]);\n }\n async _emit(provider, message) {\n provider.emit(\"pending\", message);\n }\n}\n/**\n * A **SocketEventSubscriber** listens for event logs.\n */\nexport class SocketEventSubscriber extends SocketSubscriber {\n #logFilter;\n /**\n * The filter.\n */\n get logFilter() { return JSON.parse(this.#logFilter); }\n /**\n * @_ignore:\n */\n constructor(provider, filter) {\n super(provider, [\"logs\", filter]);\n this.#logFilter = JSON.stringify(filter);\n }\n async _emit(provider, message) {\n provider.emit(this.logFilter, provider._wrapLog(message, provider._network));\n }\n}\n/**\n * A **SocketProvider** is backed by a long-lived connection over a\n * socket, which can subscribe and receive real-time messages over\n * its communication channel.\n */\nexport class SocketProvider extends JsonRpcApiProvider {\n #callbacks;\n // Maps each filterId to its subscriber\n #subs;\n // If any events come in before a subscriber has finished\n // registering, queue them\n #pending;\n /**\n * Creates a new **SocketProvider** connected to %%network%%.\n *\n * If unspecified, the network will be discovered.\n */\n constructor(network, _options) {\n // Copy the options\n const options = Object.assign({}, (_options != null) ? _options : {});\n // Support for batches is generally not supported for\n // connection-base providers; if this changes in the future\n // the _send should be updated to reflect this\n assertArgument(options.batchMaxCount == null || options.batchMaxCount === 1, \"sockets-based providers do not support batches\", \"options.batchMaxCount\", _options);\n options.batchMaxCount = 1;\n // Socket-based Providers (generally) cannot change their network,\n // since they have a long-lived connection; but let people override\n // this if they have just cause.\n if (options.staticNetwork == null) {\n options.staticNetwork = true;\n }\n super(network, options);\n this.#callbacks = new Map();\n this.#subs = new Map();\n this.#pending = new Map();\n }\n // This value is only valid after _start has been called\n /*\n get _network(): Network {\n if (this.#network == null) {\n throw new Error(\"this shouldn't happen\");\n }\n return this.#network.clone();\n }\n */\n _getSubscriber(sub) {\n switch (sub.type) {\n case \"close\":\n return new UnmanagedSubscriber(\"close\");\n case \"block\":\n return new SocketBlockSubscriber(this);\n case \"pending\":\n return new SocketPendingSubscriber(this);\n case \"event\":\n return new SocketEventSubscriber(this, sub.filter);\n case \"orphan\":\n // Handled auto-matically within AbstractProvider\n // when the log.removed = true\n if (sub.filter.orphan === \"drop-log\") {\n return new UnmanagedSubscriber(\"drop-log\");\n }\n }\n return super._getSubscriber(sub);\n }\n /**\n * Register a new subscriber. This is used internalled by Subscribers\n * and generally is unecessary unless extending capabilities.\n */\n _register(filterId, subscriber) {\n this.#subs.set(filterId, subscriber);\n const pending = this.#pending.get(filterId);\n if (pending) {\n for (const message of pending) {\n subscriber._handleMessage(message);\n }\n this.#pending.delete(filterId);\n }\n }\n async _send(payload) {\n // WebSocket provider doesn't accept batches\n assertArgument(!Array.isArray(payload), \"WebSocket does not support batch send\", \"payload\", payload);\n // @TODO: stringify payloads here and store to prevent mutations\n // Prepare a promise to respond to\n const promise = new Promise((resolve, reject) => {\n this.#callbacks.set(payload.id, { payload, resolve, reject });\n });\n // Wait until the socket is connected before writing to it\n await this._waitUntilReady();\n // Write the request to the socket\n await this._write(JSON.stringify(payload));\n return [await promise];\n }\n // Sub-classes must call this once they are connected\n /*\n async _start(): Promise {\n if (this.#ready) { return; }\n\n for (const { payload } of this.#callbacks.values()) {\n await this._write(JSON.stringify(payload));\n }\n\n this.#ready = (async function() {\n await super._start();\n })();\n }\n */\n /**\n * Sub-classes **must** call this with messages received over their\n * transport to be processed and dispatched.\n */\n async _processMessage(message) {\n const result = (JSON.parse(message));\n if (result && typeof (result) === \"object\" && \"id\" in result) {\n const callback = this.#callbacks.get(result.id);\n if (callback == null) {\n this.emit(\"error\", makeError(\"received result for unknown id\", \"UNKNOWN_ERROR\", {\n reasonCode: \"UNKNOWN_ID\",\n result\n }));\n return;\n }\n this.#callbacks.delete(result.id);\n callback.resolve(result);\n }\n else if (result && result.method === \"eth_subscription\") {\n const filterId = result.params.subscription;\n const subscriber = this.#subs.get(filterId);\n if (subscriber) {\n subscriber._handleMessage(result.params.result);\n }\n else {\n let pending = this.#pending.get(filterId);\n if (pending == null) {\n pending = [];\n this.#pending.set(filterId, pending);\n }\n pending.push(result.params.result);\n }\n }\n else {\n this.emit(\"error\", makeError(\"received unexpected message\", \"UNKNOWN_ERROR\", {\n reasonCode: \"UNEXPECTED_MESSAGE\",\n result\n }));\n return;\n }\n }\n /**\n * Sub-classes **must** override this to send %%message%% over their\n * transport.\n */\n async _write(message) {\n throw new Error(\"sub-classes must override this\");\n }\n}\n//# sourceMappingURL=provider-socket.js.map","import { WebSocket as _WebSocket } from \"./ws.js\"; /*-browser*/\nimport { SocketProvider } from \"./provider-socket.js\";\n/**\n * A JSON-RPC provider which is backed by a WebSocket.\n *\n * WebSockets are often preferred because they retain a live connection\n * to a server, which permits more instant access to events.\n *\n * However, this incurs higher server infrasturture costs, so additional\n * resources may be required to host your own WebSocket nodes and many\n * third-party services charge additional fees for WebSocket endpoints.\n */\nexport class WebSocketProvider extends SocketProvider {\n #connect;\n #websocket;\n get websocket() {\n if (this.#websocket == null) {\n throw new Error(\"websocket closed\");\n }\n return this.#websocket;\n }\n constructor(url, network, options) {\n super(network, options);\n if (typeof (url) === \"string\") {\n this.#connect = () => { return new _WebSocket(url); };\n this.#websocket = this.#connect();\n }\n else if (typeof (url) === \"function\") {\n this.#connect = url;\n this.#websocket = url();\n }\n else {\n this.#connect = null;\n this.#websocket = url;\n }\n this.websocket.onopen = async () => {\n try {\n await this._start();\n this.resume();\n }\n catch (error) {\n console.log(\"failed to start WebsocketProvider\", error);\n // @TODO: now what? Attempt reconnect?\n }\n };\n this.websocket.onmessage = (message) => {\n this._processMessage(message.data);\n };\n /*\n this.websocket.onclose = (event) => {\n // @TODO: What event.code should we reconnect on?\n const reconnect = false;\n if (reconnect) {\n this.pause(true);\n if (this.#connect) {\n this.#websocket = this.#connect();\n this.#websocket.onopen = ...\n // @TODO: this requires the super class to rebroadcast; move it there\n }\n this._reconnect();\n }\n };\n */\n }\n async _write(message) {\n this.websocket.send(message);\n }\n async destroy() {\n if (this.#websocket != null) {\n this.#websocket.close();\n this.#websocket = null;\n }\n super.destroy();\n }\n}\n//# sourceMappingURL=provider-websocket.js.map","/**\n * [[link-infura]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Ethereum Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Sepolia Testnet (``sepolia``)\n * - Arbitrum (``arbitrum``)\n * - Arbitrum Goerli Testnet (``arbitrum-goerli``)\n * - Arbitrum Sepolia Testnet (``arbitrum-sepolia``)\n * - Base (``base``)\n * - Base Goerlia Testnet (``base-goerli``)\n * - Base Sepolia Testnet (``base-sepolia``)\n * - BNB Smart Chain Mainnet (``bnb``)\n * - BNB Smart Chain Testnet (``bnbt``)\n * - Linea (``linea``)\n * - Linea Goerli Testnet (``linea-goerli``)\n * - Linea Sepolia Testnet (``linea-sepolia``)\n * - Optimism (``optimism``)\n * - Optimism Goerli Testnet (``optimism-goerli``)\n * - Optimism Sepolia Testnet (``optimism-sepolia``)\n * - Polygon (``matic``)\n * - Polygon Amoy Testnet (``matic-amoy``)\n * - Polygon Mumbai Testnet (``matic-mumbai``)\n *\n * @_subsection: api/providers/thirdparty:INFURA [providers-infura]\n */\nimport { defineProperties, FetchRequest, assert, assertArgument } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nimport { WebSocketProvider } from \"./provider-websocket.js\";\nconst defaultProjectId = \"84842078b09946638c03157f83405213\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"mainnet.infura.io\";\n case \"goerli\":\n return \"goerli.infura.io\";\n case \"sepolia\":\n return \"sepolia.infura.io\";\n case \"arbitrum\":\n return \"arbitrum-mainnet.infura.io\";\n case \"arbitrum-goerli\":\n return \"arbitrum-goerli.infura.io\";\n case \"arbitrum-sepolia\":\n return \"arbitrum-sepolia.infura.io\";\n case \"base\":\n return \"base-mainnet.infura.io\";\n case \"base-goerlia\": // @TODO: Remove this typo in the future!\n case \"base-goerli\":\n return \"base-goerli.infura.io\";\n case \"base-sepolia\":\n return \"base-sepolia.infura.io\";\n case \"bnb\":\n return \"bsc-mainnet.infura.io\";\n case \"bnbt\":\n return \"bsc-testnet.infura.io\";\n case \"linea\":\n return \"linea-mainnet.infura.io\";\n case \"linea-goerli\":\n return \"linea-goerli.infura.io\";\n case \"linea-sepolia\":\n return \"linea-sepolia.infura.io\";\n case \"matic\":\n return \"polygon-mainnet.infura.io\";\n case \"matic-amoy\":\n return \"polygon-amoy.infura.io\";\n case \"matic-mumbai\":\n return \"polygon-mumbai.infura.io\";\n case \"optimism\":\n return \"optimism-mainnet.infura.io\";\n case \"optimism-goerli\":\n return \"optimism-goerli.infura.io\";\n case \"optimism-sepolia\":\n return \"optimism-sepolia.infura.io\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **InfuraWebSocketProvider** connects to the [[link-infura]]\n * WebSocket end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-infura-signup).\n */\nexport class InfuraWebSocketProvider extends WebSocketProvider {\n /**\n * The Project ID for the INFURA connection.\n */\n projectId;\n /**\n * The Project Secret.\n *\n * If null, no authenticated requests are made. This should not\n * be used outside of private contexts.\n */\n projectSecret;\n /**\n * Creates a new **InfuraWebSocketProvider**.\n */\n constructor(network, projectId) {\n const provider = new InfuraProvider(network, projectId);\n const req = provider._getConnection();\n assert(!req.credentials, \"INFURA WebSocket project secrets unsupported\", \"UNSUPPORTED_OPERATION\", { operation: \"InfuraProvider.getWebSocketProvider()\" });\n const url = req.url.replace(/^http/i, \"ws\").replace(\"/v3/\", \"/ws/v3/\");\n super(url, provider._network);\n defineProperties(this, {\n projectId: provider.projectId,\n projectSecret: provider.projectSecret\n });\n }\n isCommunityResource() {\n return (this.projectId === defaultProjectId);\n }\n}\n/**\n * The **InfuraProvider** connects to the [[link-infura]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-infura-signup).\n */\nexport class InfuraProvider extends JsonRpcProvider {\n /**\n * The Project ID for the INFURA connection.\n */\n projectId;\n /**\n * The Project Secret.\n *\n * If null, no authenticated requests are made. This should not\n * be used outside of private contexts.\n */\n projectSecret;\n /**\n * Creates a new **InfuraProvider**.\n */\n constructor(_network, projectId, projectSecret) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (projectId == null) {\n projectId = defaultProjectId;\n }\n if (projectSecret == null) {\n projectSecret = null;\n }\n const request = InfuraProvider.getRequest(network, projectId, projectSecret);\n super(request, network, { staticNetwork: network });\n defineProperties(this, { projectId, projectSecret });\n }\n _getProvider(chainId) {\n try {\n return new InfuraProvider(chainId, this.projectId, this.projectSecret);\n }\n catch (error) { }\n return super._getProvider(chainId);\n }\n isCommunityResource() {\n return (this.projectId === defaultProjectId);\n }\n /**\n * Creates a new **InfuraWebSocketProvider**.\n */\n static getWebSocketProvider(network, projectId) {\n return new InfuraWebSocketProvider(network, projectId);\n }\n /**\n * Returns a prepared request for connecting to %%network%%\n * with %%projectId%% and %%projectSecret%%.\n */\n static getRequest(network, projectId, projectSecret) {\n if (projectId == null) {\n projectId = defaultProjectId;\n }\n if (projectSecret == null) {\n projectSecret = null;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/v3/${projectId}`);\n request.allowGzip = true;\n if (projectSecret) {\n request.setCredentials(\"\", projectSecret);\n }\n if (projectId === defaultProjectId) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"InfuraProvider\");\n return true;\n };\n }\n return request;\n }\n}\n//# sourceMappingURL=provider-infura.js.map","/**\n * [[link-quicknode]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Ethereum Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Sepolia Testnet (``sepolia``)\n * - Holesky Testnet (``holesky``)\n * - Arbitrum (``arbitrum``)\n * - Arbitrum Goerli Testnet (``arbitrum-goerli``)\n * - Arbitrum Sepolia Testnet (``arbitrum-sepolia``)\n * - Base Mainnet (``base``);\n * - Base Goerli Testnet (``base-goerli``);\n * - Base Sepolia Testnet (``base-sepolia``);\n * - BNB Smart Chain Mainnet (``bnb``)\n * - BNB Smart Chain Testnet (``bnbt``)\n * - Optimism (``optimism``)\n * - Optimism Goerli Testnet (``optimism-goerli``)\n * - Optimism Sepolia Testnet (``optimism-sepolia``)\n * - Polygon (``matic``)\n * - Polygon Mumbai Testnet (``matic-mumbai``)\n *\n * @_subsection: api/providers/thirdparty:QuickNode [providers-quicknode]\n */\nimport { defineProperties, FetchRequest, assertArgument } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultToken = \"919b412a057b5e9c9b6dce193c5a60242d6efadb\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"ethers.quiknode.pro\";\n case \"goerli\":\n return \"ethers.ethereum-goerli.quiknode.pro\";\n case \"sepolia\":\n return \"ethers.ethereum-sepolia.quiknode.pro\";\n case \"holesky\":\n return \"ethers.ethereum-holesky.quiknode.pro\";\n case \"arbitrum\":\n return \"ethers.arbitrum-mainnet.quiknode.pro\";\n case \"arbitrum-goerli\":\n return \"ethers.arbitrum-goerli.quiknode.pro\";\n case \"arbitrum-sepolia\":\n return \"ethers.arbitrum-sepolia.quiknode.pro\";\n case \"base\":\n return \"ethers.base-mainnet.quiknode.pro\";\n case \"base-goerli\":\n return \"ethers.base-goerli.quiknode.pro\";\n case \"base-spolia\":\n return \"ethers.base-sepolia.quiknode.pro\";\n case \"bnb\":\n return \"ethers.bsc.quiknode.pro\";\n case \"bnbt\":\n return \"ethers.bsc-testnet.quiknode.pro\";\n case \"matic\":\n return \"ethers.matic.quiknode.pro\";\n case \"matic-mumbai\":\n return \"ethers.matic-testnet.quiknode.pro\";\n case \"optimism\":\n return \"ethers.optimism.quiknode.pro\";\n case \"optimism-goerli\":\n return \"ethers.optimism-goerli.quiknode.pro\";\n case \"optimism-sepolia\":\n return \"ethers.optimism-sepolia.quiknode.pro\";\n case \"xdai\":\n return \"ethers.xdai.quiknode.pro\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/*\n@TODO:\n These networks are not currently present in the Network\n default included networks. Research them and ensure they\n are EVM compatible and work with ethers\n\n http://ethers.matic-amoy.quiknode.pro\n\n http://ethers.avalanche-mainnet.quiknode.pro\n http://ethers.avalanche-testnet.quiknode.pro\n http://ethers.blast-sepolia.quiknode.pro\n http://ethers.celo-mainnet.quiknode.pro\n http://ethers.fantom.quiknode.pro\n http://ethers.imx-demo.quiknode.pro\n http://ethers.imx-mainnet.quiknode.pro\n http://ethers.imx-testnet.quiknode.pro\n http://ethers.near-mainnet.quiknode.pro\n http://ethers.near-testnet.quiknode.pro\n http://ethers.nova-mainnet.quiknode.pro\n http://ethers.scroll-mainnet.quiknode.pro\n http://ethers.scroll-testnet.quiknode.pro\n http://ethers.tron-mainnet.quiknode.pro\n http://ethers.zkevm-mainnet.quiknode.pro\n http://ethers.zkevm-testnet.quiknode.pro\n http://ethers.zksync-mainnet.quiknode.pro\n http://ethers.zksync-testnet.quiknode.pro\n*/\n/**\n * The **QuickNodeProvider** connects to the [[link-quicknode]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API token is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-quicknode).\n */\nexport class QuickNodeProvider extends JsonRpcProvider {\n /**\n * The API token.\n */\n token;\n /**\n * Creates a new **QuickNodeProvider**.\n */\n constructor(_network, token) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (token == null) {\n token = defaultToken;\n }\n const request = QuickNodeProvider.getRequest(network, token);\n super(request, network, { staticNetwork: network });\n defineProperties(this, { token });\n }\n _getProvider(chainId) {\n try {\n return new QuickNodeProvider(chainId, this.token);\n }\n catch (error) { }\n return super._getProvider(chainId);\n }\n isCommunityResource() {\n return (this.token === defaultToken);\n }\n /**\n * Returns a new request prepared for %%network%% and the\n * %%token%%.\n */\n static getRequest(network, token) {\n if (token == null) {\n token = defaultToken;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/${token}`);\n request.allowGzip = true;\n //if (projectSecret) { request.setCredentials(\"\", projectSecret); }\n if (token === defaultToken) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"QuickNodeProvider\");\n return true;\n };\n }\n return request;\n }\n}\n//# sourceMappingURL=provider-quicknode.js.map","/**\n * A **FallbackProvider** provides resilience, security and performance\n * in a way that is customizable and configurable.\n *\n * @_section: api/providers/fallback-provider:Fallback Provider [about-fallback-provider]\n */\nimport { assert, assertArgument, getBigInt, getNumber, isError } from \"../utils/index.js\";\nimport { AbstractProvider } from \"./abstract-provider.js\";\nimport { Network } from \"./network.js\";\nconst BN_1 = BigInt(\"1\");\nconst BN_2 = BigInt(\"2\");\nfunction shuffle(array) {\n for (let i = array.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n const tmp = array[i];\n array[i] = array[j];\n array[j] = tmp;\n }\n}\nfunction stall(duration) {\n return new Promise((resolve) => { setTimeout(resolve, duration); });\n}\nfunction getTime() { return (new Date()).getTime(); }\nfunction stringify(value) {\n return JSON.stringify(value, (key, value) => {\n if (typeof (value) === \"bigint\") {\n return { type: \"bigint\", value: value.toString() };\n }\n return value;\n });\n}\n;\nconst defaultConfig = { stallTimeout: 400, priority: 1, weight: 1 };\nconst defaultState = {\n blockNumber: -2, requests: 0, lateResponses: 0, errorResponses: 0,\n outOfSync: -1, unsupportedEvents: 0, rollingDuration: 0, score: 0,\n _network: null, _updateNumber: null, _totalTime: 0,\n _lastFatalError: null, _lastFatalErrorTimestamp: 0\n};\nasync function waitForSync(config, blockNumber) {\n while (config.blockNumber < 0 || config.blockNumber < blockNumber) {\n if (!config._updateNumber) {\n config._updateNumber = (async () => {\n try {\n const blockNumber = await config.provider.getBlockNumber();\n if (blockNumber > config.blockNumber) {\n config.blockNumber = blockNumber;\n }\n }\n catch (error) {\n config.blockNumber = -2;\n config._lastFatalError = error;\n config._lastFatalErrorTimestamp = getTime();\n }\n config._updateNumber = null;\n })();\n }\n await config._updateNumber;\n config.outOfSync++;\n if (config._lastFatalError) {\n break;\n }\n }\n}\nfunction _normalize(value) {\n if (value == null) {\n return \"null\";\n }\n if (Array.isArray(value)) {\n return \"[\" + (value.map(_normalize)).join(\",\") + \"]\";\n }\n if (typeof (value) === \"object\" && typeof (value.toJSON) === \"function\") {\n return _normalize(value.toJSON());\n }\n switch (typeof (value)) {\n case \"boolean\":\n case \"symbol\":\n return value.toString();\n case \"bigint\":\n case \"number\":\n return BigInt(value).toString();\n case \"string\":\n return JSON.stringify(value);\n case \"object\": {\n const keys = Object.keys(value);\n keys.sort();\n return \"{\" + keys.map((k) => `${JSON.stringify(k)}:${_normalize(value[k])}`).join(\",\") + \"}\";\n }\n }\n console.log(\"Could not serialize\", value);\n throw new Error(\"Hmm...\");\n}\nfunction normalizeResult(method, value) {\n if (\"error\" in value) {\n const error = value.error;\n let tag;\n if (isError(error, \"CALL_EXCEPTION\")) {\n tag = _normalize(Object.assign({}, error, {\n shortMessage: undefined, reason: undefined, info: undefined\n }));\n }\n else {\n tag = _normalize(error);\n }\n return { tag, value: error };\n }\n const result = value.result;\n return { tag: _normalize(result), value: result };\n}\n// This strategy picks the highest weight result, as long as the weight is\n// equal to or greater than quorum\nfunction checkQuorum(quorum, results) {\n const tally = new Map();\n for (const { value, tag, weight } of results) {\n const t = tally.get(tag) || { value, weight: 0 };\n t.weight += weight;\n tally.set(tag, t);\n }\n let best = null;\n for (const r of tally.values()) {\n if (r.weight >= quorum && (!best || r.weight > best.weight)) {\n best = r;\n }\n }\n if (best) {\n return best.value;\n }\n return undefined;\n}\nfunction getMedian(quorum, results) {\n let resultWeight = 0;\n const errorMap = new Map();\n let bestError = null;\n const values = [];\n for (const { value, tag, weight } of results) {\n if (value instanceof Error) {\n const e = errorMap.get(tag) || { value, weight: 0 };\n e.weight += weight;\n errorMap.set(tag, e);\n if (bestError == null || e.weight > bestError.weight) {\n bestError = e;\n }\n }\n else {\n values.push(BigInt(value));\n resultWeight += weight;\n }\n }\n if (resultWeight < quorum) {\n // We have quorum for an error\n if (bestError && bestError.weight >= quorum) {\n return bestError.value;\n }\n // We do not have quorum for a result\n return undefined;\n }\n // Get the sorted values\n values.sort((a, b) => ((a < b) ? -1 : (b > a) ? 1 : 0));\n const mid = Math.floor(values.length / 2);\n // Odd-length; take the middle value\n if (values.length % 2) {\n return values[mid];\n }\n // Even length; take the ceiling of the mean of the center two values\n return (values[mid - 1] + values[mid] + BN_1) / BN_2;\n}\nfunction getAnyResult(quorum, results) {\n // If any value or error meets quorum, that is our preferred result\n const result = checkQuorum(quorum, results);\n if (result !== undefined) {\n return result;\n }\n // Otherwise, do we have any result?\n for (const r of results) {\n if (r.value) {\n return r.value;\n }\n }\n // Nope!\n return undefined;\n}\nfunction getFuzzyMode(quorum, results) {\n if (quorum === 1) {\n return getNumber(getMedian(quorum, results), \"%internal\");\n }\n const tally = new Map();\n const add = (result, weight) => {\n const t = tally.get(result) || { result, weight: 0 };\n t.weight += weight;\n tally.set(result, t);\n };\n for (const { weight, value } of results) {\n const r = getNumber(value);\n add(r - 1, weight);\n add(r, weight);\n add(r + 1, weight);\n }\n let bestWeight = 0;\n let bestResult = undefined;\n for (const { weight, result } of tally.values()) {\n // Use this result, if this result meets quorum and has either:\n // - a better weight\n // - or equal weight, but the result is larger\n if (weight >= quorum && (weight > bestWeight || (bestResult != null && weight === bestWeight && result > bestResult))) {\n bestWeight = weight;\n bestResult = result;\n }\n }\n return bestResult;\n}\n/**\n * A **FallbackProvider** manages several [[Providers]] providing\n * resilience by switching between slow or misbehaving nodes, security\n * by requiring multiple backends to aggree and performance by allowing\n * faster backends to respond earlier.\n *\n */\nexport class FallbackProvider extends AbstractProvider {\n /**\n * The number of backends that must agree on a value before it is\n * accpeted.\n */\n quorum;\n /**\n * @_ignore:\n */\n eventQuorum;\n /**\n * @_ignore:\n */\n eventWorkers;\n #configs;\n #height;\n #initialSyncPromise;\n /**\n * Creates a new **FallbackProvider** with %%providers%% connected to\n * %%network%%.\n *\n * If a [[Provider]] is included in %%providers%%, defaults are used\n * for the configuration.\n */\n constructor(providers, network, options) {\n super(network, options);\n this.#configs = providers.map((p) => {\n if (p instanceof AbstractProvider) {\n return Object.assign({ provider: p }, defaultConfig, defaultState);\n }\n else {\n return Object.assign({}, defaultConfig, p, defaultState);\n }\n });\n this.#height = -2;\n this.#initialSyncPromise = null;\n if (options && options.quorum != null) {\n this.quorum = options.quorum;\n }\n else {\n this.quorum = Math.ceil(this.#configs.reduce((accum, config) => {\n accum += config.weight;\n return accum;\n }, 0) / 2);\n }\n this.eventQuorum = 1;\n this.eventWorkers = 1;\n assertArgument(this.quorum <= this.#configs.reduce((a, c) => (a + c.weight), 0), \"quorum exceed provider weight\", \"quorum\", this.quorum);\n }\n get providerConfigs() {\n return this.#configs.map((c) => {\n const result = Object.assign({}, c);\n for (const key in result) {\n if (key[0] === \"_\") {\n delete result[key];\n }\n }\n return result;\n });\n }\n async _detectNetwork() {\n return Network.from(getBigInt(await this._perform({ method: \"chainId\" })));\n }\n // @TODO: Add support to select providers to be the event subscriber\n //_getSubscriber(sub: Subscription): Subscriber {\n // throw new Error(\"@TODO\");\n //}\n /**\n * Transforms a %%req%% into the correct method call on %%provider%%.\n */\n async _translatePerform(provider, req) {\n switch (req.method) {\n case \"broadcastTransaction\":\n return await provider.broadcastTransaction(req.signedTransaction);\n case \"call\":\n return await provider.call(Object.assign({}, req.transaction, { blockTag: req.blockTag }));\n case \"chainId\":\n return (await provider.getNetwork()).chainId;\n case \"estimateGas\":\n return await provider.estimateGas(req.transaction);\n case \"getBalance\":\n return await provider.getBalance(req.address, req.blockTag);\n case \"getBlock\": {\n const block = (\"blockHash\" in req) ? req.blockHash : req.blockTag;\n return await provider.getBlock(block, req.includeTransactions);\n }\n case \"getBlockNumber\":\n return await provider.getBlockNumber();\n case \"getCode\":\n return await provider.getCode(req.address, req.blockTag);\n case \"getGasPrice\":\n return (await provider.getFeeData()).gasPrice;\n case \"getPriorityFee\":\n return (await provider.getFeeData()).maxPriorityFeePerGas;\n case \"getLogs\":\n return await provider.getLogs(req.filter);\n case \"getStorage\":\n return await provider.getStorage(req.address, req.position, req.blockTag);\n case \"getTransaction\":\n return await provider.getTransaction(req.hash);\n case \"getTransactionCount\":\n return await provider.getTransactionCount(req.address, req.blockTag);\n case \"getTransactionReceipt\":\n return await provider.getTransactionReceipt(req.hash);\n case \"getTransactionResult\":\n return await provider.getTransactionResult(req.hash);\n }\n }\n // Grab the next (random) config that is not already part of\n // the running set\n #getNextConfig(running) {\n // @TODO: Maybe do a check here to favour (heavily) providers that\n // do not require waitForSync and disfavour providers that\n // seem down-ish or are behaving slowly\n const configs = Array.from(running).map((r) => r.config);\n // Shuffle the states, sorted by priority\n const allConfigs = this.#configs.slice();\n shuffle(allConfigs);\n allConfigs.sort((a, b) => (a.priority - b.priority));\n for (const config of allConfigs) {\n if (config._lastFatalError) {\n continue;\n }\n if (configs.indexOf(config) === -1) {\n return config;\n }\n }\n return null;\n }\n // Adds a new runner (if available) to running.\n #addRunner(running, req) {\n const config = this.#getNextConfig(running);\n // No runners available\n if (config == null) {\n return null;\n }\n // Create a new runner\n const runner = {\n config, result: null, didBump: false,\n perform: null, staller: null\n };\n const now = getTime();\n // Start performing this operation\n runner.perform = (async () => {\n try {\n config.requests++;\n const result = await this._translatePerform(config.provider, req);\n runner.result = { result };\n }\n catch (error) {\n config.errorResponses++;\n runner.result = { error };\n }\n const dt = (getTime() - now);\n config._totalTime += dt;\n config.rollingDuration = 0.95 * config.rollingDuration + 0.05 * dt;\n runner.perform = null;\n })();\n // Start a staller; when this times out, it's time to force\n // kicking off another runner because we are taking too long\n runner.staller = (async () => {\n await stall(config.stallTimeout);\n runner.staller = null;\n })();\n running.add(runner);\n return runner;\n }\n // Initializes the blockNumber and network for each runner and\n // blocks until initialized\n async #initialSync() {\n let initialSync = this.#initialSyncPromise;\n if (!initialSync) {\n const promises = [];\n this.#configs.forEach((config) => {\n promises.push((async () => {\n await waitForSync(config, 0);\n if (!config._lastFatalError) {\n config._network = await config.provider.getNetwork();\n }\n })());\n });\n this.#initialSyncPromise = initialSync = (async () => {\n // Wait for all providers to have a block number and network\n await Promise.all(promises);\n // Check all the networks match\n let chainId = null;\n for (const config of this.#configs) {\n if (config._lastFatalError) {\n continue;\n }\n const network = (config._network);\n if (chainId == null) {\n chainId = network.chainId;\n }\n else if (network.chainId !== chainId) {\n assert(false, \"cannot mix providers on different networks\", \"UNSUPPORTED_OPERATION\", {\n operation: \"new FallbackProvider\"\n });\n }\n }\n })();\n }\n await initialSync;\n }\n async #checkQuorum(running, req) {\n // Get all the result objects\n const results = [];\n for (const runner of running) {\n if (runner.result != null) {\n const { tag, value } = normalizeResult(req.method, runner.result);\n results.push({ tag, value, weight: runner.config.weight });\n }\n }\n // Are there enough results to event meet quorum?\n if (results.reduce((a, r) => (a + r.weight), 0) < this.quorum) {\n return undefined;\n }\n switch (req.method) {\n case \"getBlockNumber\": {\n // We need to get the bootstrap block height\n if (this.#height === -2) {\n this.#height = Math.ceil(getNumber(getMedian(this.quorum, this.#configs.filter((c) => (!c._lastFatalError)).map((c) => ({\n value: c.blockNumber,\n tag: getNumber(c.blockNumber).toString(),\n weight: c.weight\n })))));\n }\n // Find the mode across all the providers, allowing for\n // a little drift between block heights\n const mode = getFuzzyMode(this.quorum, results);\n if (mode === undefined) {\n return undefined;\n }\n if (mode > this.#height) {\n this.#height = mode;\n }\n return this.#height;\n }\n case \"getGasPrice\":\n case \"getPriorityFee\":\n case \"estimateGas\":\n return getMedian(this.quorum, results);\n case \"getBlock\":\n // Pending blocks are in the mempool and already\n // quite untrustworthy; just grab anything\n if (\"blockTag\" in req && req.blockTag === \"pending\") {\n return getAnyResult(this.quorum, results);\n }\n return checkQuorum(this.quorum, results);\n case \"call\":\n case \"chainId\":\n case \"getBalance\":\n case \"getTransactionCount\":\n case \"getCode\":\n case \"getStorage\":\n case \"getTransaction\":\n case \"getTransactionReceipt\":\n case \"getLogs\":\n return checkQuorum(this.quorum, results);\n case \"broadcastTransaction\":\n return getAnyResult(this.quorum, results);\n }\n assert(false, \"unsupported method\", \"UNSUPPORTED_OPERATION\", {\n operation: `_perform(${stringify(req.method)})`\n });\n }\n async #waitForQuorum(running, req) {\n if (running.size === 0) {\n throw new Error(\"no runners?!\");\n }\n // Any promises that are interesting to watch for; an expired stall\n // or a successful perform\n const interesting = [];\n let newRunners = 0;\n for (const runner of running) {\n // No responses, yet; keep an eye on it\n if (runner.perform) {\n interesting.push(runner.perform);\n }\n // Still stalling...\n if (runner.staller) {\n interesting.push(runner.staller);\n continue;\n }\n // This runner has already triggered another runner\n if (runner.didBump) {\n continue;\n }\n // Got a response (result or error) or stalled; kick off another runner\n runner.didBump = true;\n newRunners++;\n }\n // Check if we have reached quorum on a result (or error)\n const value = await this.#checkQuorum(running, req);\n if (value !== undefined) {\n if (value instanceof Error) {\n throw value;\n }\n return value;\n }\n // Add any new runners, because a staller timed out or a result\n // or error response came in.\n for (let i = 0; i < newRunners; i++) {\n this.#addRunner(running, req);\n }\n // All providers have returned, and we have no result\n assert(interesting.length > 0, \"quorum not met\", \"SERVER_ERROR\", {\n request: \"%sub-requests\",\n info: { request: req, results: Array.from(running).map((r) => stringify(r.result)) }\n });\n // Wait for someone to either complete its perform or stall out\n await Promise.race(interesting);\n // This is recursive, but at worst case the depth is 2x the\n // number of providers (each has a perform and a staller)\n return await this.#waitForQuorum(running, req);\n }\n async _perform(req) {\n // Broadcasting a transaction is rare (ish) and already incurs\n // a cost on the user, so spamming is safe-ish. Just send it to\n // every backend.\n if (req.method === \"broadcastTransaction\") {\n // Once any broadcast provides a positive result, use it. No\n // need to wait for anyone else\n const results = this.#configs.map((c) => null);\n const broadcasts = this.#configs.map(async ({ provider, weight }, index) => {\n try {\n const result = await provider._perform(req);\n results[index] = Object.assign(normalizeResult(req.method, { result }), { weight });\n }\n catch (error) {\n results[index] = Object.assign(normalizeResult(req.method, { error }), { weight });\n }\n });\n // As each promise finishes...\n while (true) {\n // Check for a valid broadcast result\n const done = results.filter((r) => (r != null));\n for (const { value } of done) {\n if (!(value instanceof Error)) {\n return value;\n }\n }\n // Check for a legit broadcast error (one which we cannot\n // recover from; some nodes may return the following red\n // herring events:\n // - alredy seend (UNKNOWN_ERROR)\n // - NONCE_EXPIRED\n // - REPLACEMENT_UNDERPRICED\n const result = checkQuorum(this.quorum, results.filter((r) => (r != null)));\n if (isError(result, \"INSUFFICIENT_FUNDS\")) {\n throw result;\n }\n // Kick off the next provider (if any)\n const waiting = broadcasts.filter((b, i) => (results[i] == null));\n if (waiting.length === 0) {\n break;\n }\n await Promise.race(waiting);\n }\n // Use standard quorum results; any result was returned above,\n // so this will find any error that met quorum if any\n const result = getAnyResult(this.quorum, results);\n assert(result !== undefined, \"problem multi-broadcasting\", \"SERVER_ERROR\", {\n request: \"%sub-requests\",\n info: { request: req, results: results.map(stringify) }\n });\n if (result instanceof Error) {\n throw result;\n }\n return result;\n }\n await this.#initialSync();\n // Bootstrap enough runners to meet quorum\n const running = new Set();\n let inflightQuorum = 0;\n while (true) {\n const runner = this.#addRunner(running, req);\n if (runner == null) {\n break;\n }\n inflightQuorum += runner.config.weight;\n if (inflightQuorum >= this.quorum) {\n break;\n }\n }\n const result = await this.#waitForQuorum(running, req);\n // Track requests sent to a provider that are still\n // outstanding after quorum has been otherwise found\n for (const runner of running) {\n if (runner.perform && runner.result == null) {\n runner.config.lateResponses++;\n }\n }\n return result;\n }\n async destroy() {\n for (const { provider } of this.#configs) {\n provider.destroy();\n }\n super.destroy();\n }\n}\n//# sourceMappingURL=provider-fallback.js.map","import { assert } from \"../utils/index.js\";\nimport { AnkrProvider } from \"./provider-ankr.js\";\nimport { AlchemyProvider } from \"./provider-alchemy.js\";\n//import { BlockscoutProvider } from \"./provider-blockscout.js\";\nimport { ChainstackProvider } from \"./provider-chainstack.js\";\nimport { CloudflareProvider } from \"./provider-cloudflare.js\";\nimport { EtherscanProvider } from \"./provider-etherscan.js\";\nimport { InfuraProvider } from \"./provider-infura.js\";\n//import { PocketProvider } from \"./provider-pocket.js\";\nimport { QuickNodeProvider } from \"./provider-quicknode.js\";\nimport { FallbackProvider } from \"./provider-fallback.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nimport { Network } from \"./network.js\";\nimport { WebSocketProvider } from \"./provider-websocket.js\";\nfunction isWebSocketLike(value) {\n return (value && typeof (value.send) === \"function\" &&\n typeof (value.close) === \"function\");\n}\nconst Testnets = \"goerli kovan sepolia classicKotti optimism-goerli arbitrum-goerli matic-mumbai bnbt\".split(\" \");\n/**\n * Returns a default provider for %%network%%.\n *\n * If %%network%% is a [[WebSocketLike]] or string that begins with\n * ``\"ws:\"`` or ``\"wss:\"``, a [[WebSocketProvider]] is returned backed\n * by that WebSocket or URL.\n *\n * If %%network%% is a string that begins with ``\"HTTP:\"`` or ``\"HTTPS:\"``,\n * a [[JsonRpcProvider]] is returned connected to that URL.\n *\n * Otherwise, a default provider is created backed by well-known public\n * Web3 backends (such as [[link-infura]]) using community-provided API\n * keys.\n *\n * The %%options%% allows specifying custom API keys per backend (setting\n * an API key to ``\"-\"`` will omit that provider) and ``options.exclusive``\n * can be set to either a backend name or and array of backend names, which\n * will whitelist **only** those backends.\n *\n * Current backend strings supported are:\n * - ``\"alchemy\"``\n * - ``\"ankr\"``\n * - ``\"cloudflare\"``\n * - ``\"chainstack\"``\n * - ``\"etherscan\"``\n * - ``\"infura\"``\n * - ``\"publicPolygon\"``\n * - ``\"quicknode\"``\n *\n * @example:\n * // Connect to a local Geth node\n * provider = getDefaultProvider(\"http://localhost:8545/\");\n *\n * // Connect to Ethereum mainnet with any current and future\n * // third-party services available\n * provider = getDefaultProvider(\"mainnet\");\n *\n * // Connect to Polygon, but only allow Etherscan and\n * // INFURA and use \"MY_API_KEY\" in calls to Etherscan.\n * provider = getDefaultProvider(\"matic\", {\n * etherscan: \"MY_API_KEY\",\n * exclusive: [ \"etherscan\", \"infura\" ]\n * });\n */\nexport function getDefaultProvider(network, options) {\n if (options == null) {\n options = {};\n }\n const allowService = (name) => {\n if (options[name] === \"-\") {\n return false;\n }\n if (typeof (options.exclusive) === \"string\") {\n return (name === options.exclusive);\n }\n if (Array.isArray(options.exclusive)) {\n return (options.exclusive.indexOf(name) !== -1);\n }\n return true;\n };\n if (typeof (network) === \"string\" && network.match(/^https?:/)) {\n return new JsonRpcProvider(network);\n }\n if (typeof (network) === \"string\" && network.match(/^wss?:/) || isWebSocketLike(network)) {\n return new WebSocketProvider(network);\n }\n // Get the network and name, if possible\n let staticNetwork = null;\n try {\n staticNetwork = Network.from(network);\n }\n catch (error) { }\n const providers = [];\n if (allowService(\"publicPolygon\") && staticNetwork) {\n if (staticNetwork.name === \"matic\") {\n providers.push(new JsonRpcProvider(\"https:/\\/polygon-rpc.com/\", staticNetwork, { staticNetwork }));\n }\n else if (staticNetwork.name === \"matic-amoy\") {\n providers.push(new JsonRpcProvider(\"https:/\\/rpc-amoy.polygon.technology/\", staticNetwork, { staticNetwork }));\n }\n }\n if (allowService(\"alchemy\")) {\n try {\n providers.push(new AlchemyProvider(network, options.alchemy));\n }\n catch (error) { }\n }\n if (allowService(\"ankr\") && options.ankr != null) {\n try {\n providers.push(new AnkrProvider(network, options.ankr));\n }\n catch (error) { }\n }\n /* Temporarily remove until custom error issue is fixed\n if (allowService(\"blockscout\")) {\n try {\n providers.push(new BlockscoutProvider(network, options.blockscout));\n } catch (error) { }\n }\n */\n if (allowService(\"chainstack\")) {\n try {\n providers.push(new ChainstackProvider(network, options.chainstack));\n }\n catch (error) { }\n }\n if (allowService(\"cloudflare\")) {\n try {\n providers.push(new CloudflareProvider(network));\n }\n catch (error) { }\n }\n if (allowService(\"etherscan\")) {\n try {\n providers.push(new EtherscanProvider(network, options.etherscan));\n }\n catch (error) { }\n }\n if (allowService(\"infura\")) {\n try {\n let projectId = options.infura;\n let projectSecret = undefined;\n if (typeof (projectId) === \"object\") {\n projectSecret = projectId.projectSecret;\n projectId = projectId.projectId;\n }\n providers.push(new InfuraProvider(network, projectId, projectSecret));\n }\n catch (error) { }\n }\n /*\n if (options.pocket !== \"-\") {\n try {\n let appId = options.pocket;\n let secretKey: undefined | string = undefined;\n let loadBalancer: undefined | boolean = undefined;\n if (typeof(appId) === \"object\") {\n loadBalancer = !!appId.loadBalancer;\n secretKey = appId.secretKey;\n appId = appId.appId;\n }\n providers.push(new PocketProvider(network, appId, secretKey, loadBalancer));\n } catch (error) { console.log(error); }\n }\n */\n if (allowService(\"quicknode\")) {\n try {\n let token = options.quicknode;\n providers.push(new QuickNodeProvider(network, token));\n }\n catch (error) { }\n }\n assert(providers.length, \"unsupported default network\", \"UNSUPPORTED_OPERATION\", {\n operation: \"getDefaultProvider\"\n });\n // No need for a FallbackProvider\n if (providers.length === 1) {\n return providers[0];\n }\n // We use the floor because public third-party providers can be unreliable,\n // so a low number of providers with a large quorum will fail too often\n let quorum = Math.floor(providers.length / 2);\n if (quorum > 2) {\n quorum = 2;\n }\n // Testnets don't need as strong a security gaurantee and speed is\n // more useful during testing\n if (staticNetwork && Testnets.indexOf(staticNetwork.name) !== -1) {\n quorum = 1;\n }\n // Provided override qorum takes priority\n if (options && options.quorum) {\n quorum = options.quorum;\n }\n return new FallbackProvider(providers, undefined, { quorum });\n}\n//# sourceMappingURL=default-provider.js.map","import { defineProperties } from \"../utils/index.js\";\nimport { AbstractSigner } from \"./abstract-signer.js\";\n/**\n * A **NonceManager** wraps another [[Signer]] and automatically manages\n * the nonce, ensuring serialized and sequential nonces are used during\n * transaction.\n */\nexport class NonceManager extends AbstractSigner {\n /**\n * The Signer being managed.\n */\n signer;\n #noncePromise;\n #delta;\n /**\n * Creates a new **NonceManager** to manage %%signer%%.\n */\n constructor(signer) {\n super(signer.provider);\n defineProperties(this, { signer });\n this.#noncePromise = null;\n this.#delta = 0;\n }\n async getAddress() {\n return this.signer.getAddress();\n }\n connect(provider) {\n return new NonceManager(this.signer.connect(provider));\n }\n async getNonce(blockTag) {\n if (blockTag === \"pending\") {\n if (this.#noncePromise == null) {\n this.#noncePromise = super.getNonce(\"pending\");\n }\n const delta = this.#delta;\n return (await this.#noncePromise) + delta;\n }\n return super.getNonce(blockTag);\n }\n /**\n * Manually increment the nonce. This may be useful when managng\n * offline transactions.\n */\n increment() {\n this.#delta++;\n }\n /**\n * Resets the nonce, causing the **NonceManager** to reload the current\n * nonce from the blockchain on the next transaction.\n */\n reset() {\n this.#delta = 0;\n this.#noncePromise = null;\n }\n async sendTransaction(tx) {\n const noncePromise = this.getNonce(\"pending\");\n this.increment();\n tx = await this.signer.populateTransaction(tx);\n tx.nonce = await noncePromise;\n // @TODO: Maybe handle interesting/recoverable errors?\n // Like don't increment if the tx was certainly not sent\n return await this.signer.sendTransaction(tx);\n }\n signTransaction(tx) {\n return this.signer.signTransaction(tx);\n }\n signMessage(message) {\n return this.signer.signMessage(message);\n }\n signTypedData(domain, types, value) {\n return this.signer.signTypedData(domain, types, value);\n }\n}\n//# sourceMappingURL=signer-noncemanager.js.map","import { assertArgument, makeError } from \"../utils/index.js\";\nimport { JsonRpcApiPollingProvider } from \"./provider-jsonrpc.js\";\n;\n/**\n * A **BrowserProvider** is intended to wrap an injected provider which\n * adheres to the [[link-eip-1193]] standard, which most (if not all)\n * currently do.\n */\nexport class BrowserProvider extends JsonRpcApiPollingProvider {\n #request;\n #providerInfo;\n /**\n * Connect to the %%ethereum%% provider, optionally forcing the\n * %%network%%.\n */\n constructor(ethereum, network, _options) {\n // Copy the options\n const options = Object.assign({}, ((_options != null) ? _options : {}), { batchMaxCount: 1 });\n assertArgument(ethereum && ethereum.request, \"invalid EIP-1193 provider\", \"ethereum\", ethereum);\n super(network, options);\n this.#providerInfo = null;\n if (_options && _options.providerInfo) {\n this.#providerInfo = _options.providerInfo;\n }\n this.#request = async (method, params) => {\n const payload = { method, params };\n this.emit(\"debug\", { action: \"sendEip1193Request\", payload });\n try {\n const result = await ethereum.request(payload);\n this.emit(\"debug\", { action: \"receiveEip1193Result\", result });\n return result;\n }\n catch (e) {\n const error = new Error(e.message);\n error.code = e.code;\n error.data = e.data;\n error.payload = payload;\n this.emit(\"debug\", { action: \"receiveEip1193Error\", error });\n throw error;\n }\n };\n }\n get providerInfo() {\n return this.#providerInfo;\n }\n async send(method, params) {\n await this._start();\n return await super.send(method, params);\n }\n async _send(payload) {\n assertArgument(!Array.isArray(payload), \"EIP-1193 does not support batch request\", \"payload\", payload);\n try {\n const result = await this.#request(payload.method, payload.params || []);\n return [{ id: payload.id, result }];\n }\n catch (e) {\n return [{\n id: payload.id,\n error: { code: e.code, data: e.data, message: e.message }\n }];\n }\n }\n getRpcError(payload, error) {\n error = JSON.parse(JSON.stringify(error));\n // EIP-1193 gives us some machine-readable error codes, so rewrite\n // them into Ethers standard errors.\n switch (error.error.code || -1) {\n case 4001:\n error.error.message = `ethers-user-denied: ${error.error.message}`;\n break;\n case 4200:\n error.error.message = `ethers-unsupported: ${error.error.message}`;\n break;\n }\n return super.getRpcError(payload, error);\n }\n /**\n * Resolves to ``true`` if the provider manages the %%address%%.\n */\n async hasSigner(address) {\n if (address == null) {\n address = 0;\n }\n const accounts = await this.send(\"eth_accounts\", []);\n if (typeof (address) === \"number\") {\n return (accounts.length > address);\n }\n address = address.toLowerCase();\n return accounts.filter((a) => (a.toLowerCase() === address)).length !== 0;\n }\n async getSigner(address) {\n if (address == null) {\n address = 0;\n }\n if (!(await this.hasSigner(address))) {\n try {\n await this.#request(\"eth_requestAccounts\", []);\n }\n catch (error) {\n const payload = error.payload;\n throw this.getRpcError(payload, { id: payload.id, error });\n }\n }\n return await super.getSigner(address);\n }\n /**\n * Discover and connect to a Provider in the Browser using the\n * [[link-eip-6963]] discovery mechanism. If no providers are\n * present, ``null`` is resolved.\n */\n static async discover(options) {\n if (options == null) {\n options = {};\n }\n if (options.provider) {\n return new BrowserProvider(options.provider);\n }\n const context = options.window ? options.window :\n (typeof (window) !== \"undefined\") ? window : null;\n if (context == null) {\n return null;\n }\n const anyProvider = options.anyProvider;\n if (anyProvider && context.ethereum) {\n return new BrowserProvider(context.ethereum);\n }\n if (!(\"addEventListener\" in context && \"dispatchEvent\" in context\n && \"removeEventListener\" in context)) {\n return null;\n }\n const timeout = options.timeout ? options.timeout : 300;\n if (timeout === 0) {\n return null;\n }\n return await (new Promise((resolve, reject) => {\n let found = [];\n const addProvider = (event) => {\n found.push(event.detail);\n if (anyProvider) {\n finalize();\n }\n };\n const finalize = () => {\n clearTimeout(timer);\n if (found.length) {\n // If filtering is provided:\n if (options && options.filter) {\n // Call filter, with a copies of found provider infos\n const filtered = options.filter(found.map(i => Object.assign({}, (i.info))));\n if (filtered == null) {\n // No provider selected\n resolve(null);\n }\n else if (filtered instanceof BrowserProvider) {\n // Custom provider created\n resolve(filtered);\n }\n else {\n // Find the matching provider\n let match = null;\n if (filtered.uuid) {\n const matches = found.filter(f => (filtered.uuid === f.info.uuid));\n // @TODO: What should happen if multiple values\n // for the same UUID?\n match = matches[0];\n }\n if (match) {\n const { provider, info } = match;\n resolve(new BrowserProvider(provider, undefined, {\n providerInfo: info\n }));\n }\n else {\n reject(makeError(\"filter returned unknown info\", \"UNSUPPORTED_OPERATION\", {\n value: filtered\n }));\n }\n }\n }\n else {\n // Pick the first found provider\n const { provider, info } = found[0];\n resolve(new BrowserProvider(provider, undefined, {\n providerInfo: info\n }));\n }\n }\n else {\n // Nothing found\n resolve(null);\n }\n context.removeEventListener(\"eip6963:announceProvider\", addProvider);\n };\n const timer = setTimeout(() => { finalize(); }, timeout);\n context.addEventListener(\"eip6963:announceProvider\", addProvider);\n context.dispatchEvent(new Event(\"eip6963:requestProvider\"));\n }));\n }\n}\n//# sourceMappingURL=provider-browser.js.map","/**\n * [[link-blockscout]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Ethereum Mainnet (``mainnet``)\n * - Sepolia Testnet (``sepolia``)\n * - Holesky Testnet (``holesky``)\n * - Ethereum Classic (``classic``)\n * - Arbitrum (``arbitrum``)\n * - Base (``base``)\n * - Base Sepolia Testnet (``base-sepolia``)\n * - Gnosis (``xdai``)\n * - Optimism (``optimism``)\n * - Optimism Sepolia Testnet (``optimism-sepolia``)\n * - Polygon (``matic``)\n *\n * @_subsection: api/providers/thirdparty:Blockscout [providers-blockscout]\n */\nimport { assertArgument, defineProperties, FetchRequest, isHexString } from \"../utils/index.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nfunction getUrl(name) {\n switch (name) {\n case \"mainnet\":\n return \"https:/\\/eth.blockscout.com/api/eth-rpc\";\n case \"sepolia\":\n return \"https:/\\/eth-sepolia.blockscout.com/api/eth-rpc\";\n case \"holesky\":\n return \"https:/\\/eth-holesky.blockscout.com/api/eth-rpc\";\n case \"classic\":\n return \"https:/\\/etc.blockscout.com/api/eth-rpc\";\n case \"arbitrum\":\n return \"https:/\\/arbitrum.blockscout.com/api/eth-rpc\";\n case \"base\":\n return \"https:/\\/base.blockscout.com/api/eth-rpc\";\n case \"base-sepolia\":\n return \"https:/\\/base-sepolia.blockscout.com/api/eth-rpc\";\n case \"matic\":\n return \"https:/\\/polygon.blockscout.com/api/eth-rpc\";\n case \"optimism\":\n return \"https:/\\/optimism.blockscout.com/api/eth-rpc\";\n case \"optimism-sepolia\":\n return \"https:/\\/optimism-sepolia.blockscout.com/api/eth-rpc\";\n case \"xdai\":\n return \"https:/\\/gnosis.blockscout.com/api/eth-rpc\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **BlockscoutProvider** connects to the [[link-blockscout]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-blockscout).\n */\nexport class BlockscoutProvider extends JsonRpcProvider {\n /**\n * The API key.\n */\n apiKey;\n /**\n * Creates a new **BlockscoutProvider**.\n */\n constructor(_network, apiKey) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (apiKey == null) {\n apiKey = null;\n }\n const request = BlockscoutProvider.getRequest(network);\n super(request, network, { staticNetwork: network });\n defineProperties(this, { apiKey });\n }\n _getProvider(chainId) {\n try {\n return new BlockscoutProvider(chainId, this.apiKey);\n }\n catch (error) { }\n return super._getProvider(chainId);\n }\n isCommunityResource() {\n return (this.apiKey === null);\n }\n getRpcRequest(req) {\n // Blockscout enforces the TAG argument for estimateGas\n const resp = super.getRpcRequest(req);\n if (resp && resp.method === \"eth_estimateGas\" && resp.args.length == 1) {\n resp.args = resp.args.slice();\n resp.args.push(\"latest\");\n }\n return resp;\n }\n getRpcError(payload, _error) {\n const error = _error ? _error.error : null;\n // Blockscout currently drops the VM result and replaces it with a\n // human-readable string, so we need to make it machine-readable.\n if (error && error.code === -32015 && !isHexString(error.data || \"\", true)) {\n const panicCodes = {\n \"assert(false)\": \"01\",\n \"arithmetic underflow or overflow\": \"11\",\n \"division or modulo by zero\": \"12\",\n \"out-of-bounds array access; popping on an empty array\": \"31\",\n \"out-of-bounds access of an array or bytesN\": \"32\"\n };\n let panicCode = \"\";\n if (error.message === \"VM execution error.\") {\n // eth_call passes this message\n panicCode = panicCodes[error.data] || \"\";\n }\n else if (panicCodes[error.message || \"\"]) {\n panicCode = panicCodes[error.message || \"\"];\n }\n if (panicCode) {\n error.message += ` (reverted: ${error.data})`;\n error.data = \"0x4e487b7100000000000000000000000000000000000000000000000000000000000000\" + panicCode;\n }\n }\n else if (error && error.code === -32000) {\n if (error.message === \"wrong transaction nonce\") {\n error.message += \" (nonce too low)\";\n }\n }\n return super.getRpcError(payload, _error);\n }\n /**\n * Returns a prepared request for connecting to %%network%%\n * with %%apiKey%%.\n */\n static getRequest(network) {\n const request = new FetchRequest(getUrl(network.name));\n request.allowGzip = true;\n return request;\n }\n}\n//# sourceMappingURL=provider-blockscout.js.map","/**\n * [[link-pocket]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Ethereum Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Polygon (``matic``)\n * - Arbitrum (``arbitrum``)\n *\n * @_subsection: api/providers/thirdparty:Pocket [providers-pocket]\n */\nimport { defineProperties, FetchRequest, assertArgument } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultApplicationId = \"62e1ad51b37b8e00394bda3b\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"eth-mainnet.gateway.pokt.network\";\n case \"goerli\":\n return \"eth-goerli.gateway.pokt.network\";\n case \"matic\":\n return \"poly-mainnet.gateway.pokt.network\";\n case \"matic-mumbai\":\n return \"polygon-mumbai-rpc.gateway.pokt.network\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **PocketProvider** connects to the [[link-pocket]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-pocket-signup).\n */\nexport class PocketProvider extends JsonRpcProvider {\n /**\n * The Application ID for the Pocket connection.\n */\n applicationId;\n /**\n * The Application Secret for making authenticated requests\n * to the Pocket connection.\n */\n applicationSecret;\n /**\n * Create a new **PocketProvider**.\n *\n * By default connecting to ``mainnet`` with a highly throttled\n * API key.\n */\n constructor(_network, applicationId, applicationSecret) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (applicationId == null) {\n applicationId = defaultApplicationId;\n }\n if (applicationSecret == null) {\n applicationSecret = null;\n }\n const options = { staticNetwork: network };\n const request = PocketProvider.getRequest(network, applicationId, applicationSecret);\n super(request, network, options);\n defineProperties(this, { applicationId, applicationSecret });\n }\n _getProvider(chainId) {\n try {\n return new PocketProvider(chainId, this.applicationId, this.applicationSecret);\n }\n catch (error) { }\n return super._getProvider(chainId);\n }\n /**\n * Returns a prepared request for connecting to %%network%% with\n * %%applicationId%%.\n */\n static getRequest(network, applicationId, applicationSecret) {\n if (applicationId == null) {\n applicationId = defaultApplicationId;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/v1/lb/${applicationId}`);\n request.allowGzip = true;\n if (applicationSecret) {\n request.setCredentials(\"\", applicationSecret);\n }\n if (applicationId === defaultApplicationId) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"PocketProvider\");\n return true;\n };\n }\n return request;\n }\n isCommunityResource() {\n return (this.applicationId === defaultApplicationId);\n }\n}\n//# sourceMappingURL=provider-pocket.js.map","const IpcSocketProvider = undefined;\nexport { IpcSocketProvider };\n//# sourceMappingURL=provider-ipcsocket-browser.js.map","import { getAddress, resolveAddress } from \"../address/index.js\";\nimport { hashAuthorization, hashMessage, TypedDataEncoder } from \"../hash/index.js\";\nimport { AbstractSigner, copyRequest } from \"../providers/index.js\";\nimport { computeAddress, Transaction } from \"../transaction/index.js\";\nimport { defineProperties, getBigInt, resolveProperties, assert, assertArgument } from \"../utils/index.js\";\n/**\n * The **BaseWallet** is a stream-lined implementation of a\n * [[Signer]] that operates with a private key.\n *\n * It is preferred to use the [[Wallet]] class, as it offers\n * additional functionality and simplifies loading a variety\n * of JSON formats, Mnemonic Phrases, etc.\n *\n * This class may be of use for those attempting to implement\n * a minimal Signer.\n */\nexport class BaseWallet extends AbstractSigner {\n /**\n * The wallet address.\n */\n address;\n #signingKey;\n /**\n * Creates a new BaseWallet for %%privateKey%%, optionally\n * connected to %%provider%%.\n *\n * If %%provider%% is not specified, only offline methods can\n * be used.\n */\n constructor(privateKey, provider) {\n super(provider);\n assertArgument(privateKey && typeof (privateKey.sign) === \"function\", \"invalid private key\", \"privateKey\", \"[ REDACTED ]\");\n this.#signingKey = privateKey;\n const address = computeAddress(this.signingKey.publicKey);\n defineProperties(this, { address });\n }\n // Store private values behind getters to reduce visibility\n // in console.log\n /**\n * The [[SigningKey]] used for signing payloads.\n */\n get signingKey() { return this.#signingKey; }\n /**\n * The private key for this wallet.\n */\n get privateKey() { return this.signingKey.privateKey; }\n async getAddress() { return this.address; }\n connect(provider) {\n return new BaseWallet(this.#signingKey, provider);\n }\n async signTransaction(tx) {\n tx = copyRequest(tx);\n // Replace any Addressable or ENS name with an address\n const { to, from } = await resolveProperties({\n to: (tx.to ? resolveAddress(tx.to, this) : undefined),\n from: (tx.from ? resolveAddress(tx.from, this) : undefined)\n });\n if (to != null) {\n tx.to = to;\n }\n if (from != null) {\n tx.from = from;\n }\n if (tx.from != null) {\n assertArgument(getAddress((tx.from)) === this.address, \"transaction from address mismatch\", \"tx.from\", tx.from);\n delete tx.from;\n }\n // Build the transaction\n const btx = Transaction.from(tx);\n btx.signature = this.signingKey.sign(btx.unsignedHash);\n return btx.serialized;\n }\n async signMessage(message) {\n return this.signMessageSync(message);\n }\n // @TODO: Add a secialized signTx and signTyped sync that enforces\n // all parameters are known?\n /**\n * Returns the signature for %%message%% signed with this wallet.\n */\n signMessageSync(message) {\n return this.signingKey.sign(hashMessage(message)).serialized;\n }\n /**\n * Returns the Authorization for %%auth%%.\n */\n authorizeSync(auth) {\n assertArgument(typeof (auth.address) === \"string\", \"invalid address for authorizeSync\", \"auth.address\", auth);\n const signature = this.signingKey.sign(hashAuthorization(auth));\n return Object.assign({}, {\n address: getAddress(auth.address),\n nonce: getBigInt(auth.nonce || 0),\n chainId: getBigInt(auth.chainId || 0),\n }, { signature });\n }\n /**\n * Resolves to the Authorization for %%auth%%.\n */\n async authorize(auth) {\n auth = Object.assign({}, auth, {\n address: await resolveAddress(auth.address, this)\n });\n return this.authorizeSync(await this.populateAuthorization(auth));\n }\n async signTypedData(domain, types, value) {\n // Populate any ENS names\n const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (name) => {\n // @TODO: this should use resolveName; addresses don't\n // need a provider\n assert(this.provider != null, \"cannot resolve ENS names without a provider\", \"UNSUPPORTED_OPERATION\", {\n operation: \"resolveName\",\n info: { name }\n });\n const address = await this.provider.resolveName(name);\n assert(address != null, \"unconfigured ENS name\", \"UNCONFIGURED_NAME\", {\n value: name\n });\n return address;\n });\n return this.signingKey.sign(TypedDataEncoder.hash(populated.domain, types, populated.value)).serialized;\n }\n}\n//# sourceMappingURL=base-wallet.js.map","import { assertArgument } from \"../utils/index.js\";\nconst subsChrs = \" !#$%&'()*+,-./<=>?@[]^_`{|}~\";\nconst Word = /^[a-z]*$/i;\nfunction unfold(words, sep) {\n let initial = 97;\n return words.reduce((accum, word) => {\n if (word === sep) {\n initial++;\n }\n else if (word.match(Word)) {\n accum.push(String.fromCharCode(initial) + word);\n }\n else {\n initial = 97;\n accum.push(word);\n }\n return accum;\n }, []);\n}\n/**\n * @_ignore\n */\nexport function decode(data, subs) {\n // Replace all the substitutions with their expanded form\n for (let i = subsChrs.length - 1; i >= 0; i--) {\n data = data.split(subsChrs[i]).join(subs.substring(2 * i, 2 * i + 2));\n }\n // Get all tle clumps; each suffix, first-increment and second-increment\n const clumps = [];\n const leftover = data.replace(/(:|([0-9])|([A-Z][a-z]*))/g, (all, item, semi, word) => {\n if (semi) {\n for (let i = parseInt(semi); i >= 0; i--) {\n clumps.push(\";\");\n }\n }\n else {\n clumps.push(item.toLowerCase());\n }\n return \"\";\n });\n /* c8 ignore start */\n if (leftover) {\n throw new Error(`leftovers: ${JSON.stringify(leftover)}`);\n }\n /* c8 ignore stop */\n return unfold(unfold(clumps, \";\"), \":\");\n}\n/**\n * @_ignore\n */\nexport function decodeOwl(data) {\n assertArgument(data[0] === \"0\", \"unsupported auwl data\", \"data\", data);\n return decode(data.substring(1 + 2 * subsChrs.length), data.substring(1, 1 + 2 * subsChrs.length));\n}\n//# sourceMappingURL=decode-owl.js.map","import { defineProperties } from \"../utils/index.js\";\n/**\n * A Wordlist represents a collection of language-specific\n * words used to encode and devoce [[link-bip-39]] encoded data\n * by mapping words to 11-bit values and vice versa.\n */\nexport class Wordlist {\n locale;\n /**\n * Creates a new Wordlist instance.\n *\n * Sub-classes MUST call this if they provide their own constructor,\n * passing in the locale string of the language.\n *\n * Generally there is no need to create instances of a Wordlist,\n * since each language-specific Wordlist creates an instance and\n * there is no state kept internally, so they are safe to share.\n */\n constructor(locale) {\n defineProperties(this, { locale });\n }\n /**\n * Sub-classes may override this to provide a language-specific\n * method for spliting %%phrase%% into individual words.\n *\n * By default, %%phrase%% is split using any sequences of\n * white-space as defined by regular expressions (i.e. ``/\\s+/``).\n */\n split(phrase) {\n return phrase.toLowerCase().split(/\\s+/g);\n }\n /**\n * Sub-classes may override this to provider a language-specific\n * method for joining %%words%% into a phrase.\n *\n * By default, %%words%% are joined by a single space.\n */\n join(words) {\n return words.join(\" \");\n }\n}\n//# sourceMappingURL=wordlist.js.map","// Use the encode-latin.js script to create the necessary\n// data files to be consumed by this class\nimport { id } from \"../hash/index.js\";\nimport { assertArgument } from \"../utils/index.js\";\nimport { decodeOwl } from \"./decode-owl.js\";\nimport { Wordlist } from \"./wordlist.js\";\n/**\n * An OWL format Wordlist is an encoding method that exploits\n * the general locality of alphabetically sorted words to\n * achieve a simple but effective means of compression.\n *\n * This class is generally not useful to most developers as\n * it is used mainly internally to keep Wordlists for languages\n * based on ASCII-7 small.\n *\n * If necessary, there are tools within the ``generation/`` folder\n * to create the necessary data.\n */\nexport class WordlistOwl extends Wordlist {\n #data;\n #checksum;\n /**\n * Creates a new Wordlist for %%locale%% using the OWL %%data%%\n * and validated against the %%checksum%%.\n */\n constructor(locale, data, checksum) {\n super(locale);\n this.#data = data;\n this.#checksum = checksum;\n this.#words = null;\n }\n /**\n * The OWL-encoded data.\n */\n get _data() { return this.#data; }\n /**\n * Decode all the words for the wordlist.\n */\n _decodeWords() {\n return decodeOwl(this.#data);\n }\n #words;\n #loadWords() {\n if (this.#words == null) {\n const words = this._decodeWords();\n // Verify the computed list matches the official list\n const checksum = id(words.join(\"\\n\") + \"\\n\");\n /* c8 ignore start */\n if (checksum !== this.#checksum) {\n throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);\n }\n /* c8 ignore stop */\n this.#words = words;\n }\n return this.#words;\n }\n getWord(index) {\n const words = this.#loadWords();\n assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n return words[index];\n }\n getWordIndex(word) {\n return this.#loadWords().indexOf(word);\n }\n}\n//# sourceMappingURL=wordlist-owl.js.map","import { WordlistOwl } from \"./wordlist-owl.js\";\nconst words = \"0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw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ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOgAyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NNGradeHoldOnP Set1BOng::Rd3Ar~ow9UUngU`:3BraRo9NeO\";\nconst checksum = \"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60\";\nlet wordlist = null;\n/**\n * The [[link-bip39-en]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangEn extends WordlistOwl {\n /**\n * Creates a new instance of the English language Wordlist.\n *\n * This should be unnecessary most of the time as the exported\n * [[langEn]] should suffice.\n *\n * @_ignore:\n */\n constructor() { super(\"en\", words, checksum); }\n /**\n * Returns a singleton instance of a ``LangEn``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangEn();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-en.js.map","import { pbkdf2, sha256 } from \"../crypto/index.js\";\nimport { defineProperties, getBytes, hexlify, assertNormalize, assertPrivate, assertArgument, toUtf8Bytes } from \"../utils/index.js\";\nimport { LangEn } from \"../wordlists/lang-en.js\";\n// Returns a byte with the MSB bits set\nfunction getUpperMask(bits) {\n return ((1 << bits) - 1) << (8 - bits) & 0xff;\n}\n// Returns a byte with the LSB bits set\nfunction getLowerMask(bits) {\n return ((1 << bits) - 1) & 0xff;\n}\nfunction mnemonicToEntropy(mnemonic, wordlist) {\n assertNormalize(\"NFKD\");\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n const words = wordlist.split(mnemonic);\n assertArgument((words.length % 3) === 0 && words.length >= 12 && words.length <= 24, \"invalid mnemonic length\", \"mnemonic\", \"[ REDACTED ]\");\n const entropy = new Uint8Array(Math.ceil(11 * words.length / 8));\n let offset = 0;\n for (let i = 0; i < words.length; i++) {\n let index = wordlist.getWordIndex(words[i].normalize(\"NFKD\"));\n assertArgument(index >= 0, `invalid mnemonic word at index ${i}`, \"mnemonic\", \"[ REDACTED ]\");\n for (let bit = 0; bit < 11; bit++) {\n if (index & (1 << (10 - bit))) {\n entropy[offset >> 3] |= (1 << (7 - (offset % 8)));\n }\n offset++;\n }\n }\n const entropyBits = 32 * words.length / 3;\n const checksumBits = words.length / 3;\n const checksumMask = getUpperMask(checksumBits);\n const checksum = getBytes(sha256(entropy.slice(0, entropyBits / 8)))[0] & checksumMask;\n assertArgument(checksum === (entropy[entropy.length - 1] & checksumMask), \"invalid mnemonic checksum\", \"mnemonic\", \"[ REDACTED ]\");\n return hexlify(entropy.slice(0, entropyBits / 8));\n}\nfunction entropyToMnemonic(entropy, wordlist) {\n assertArgument((entropy.length % 4) === 0 && entropy.length >= 16 && entropy.length <= 32, \"invalid entropy size\", \"entropy\", \"[ REDACTED ]\");\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n const indices = [0];\n let remainingBits = 11;\n for (let i = 0; i < entropy.length; i++) {\n // Consume the whole byte (with still more to go)\n if (remainingBits > 8) {\n indices[indices.length - 1] <<= 8;\n indices[indices.length - 1] |= entropy[i];\n remainingBits -= 8;\n // This byte will complete an 11-bit index\n }\n else {\n indices[indices.length - 1] <<= remainingBits;\n indices[indices.length - 1] |= entropy[i] >> (8 - remainingBits);\n // Start the next word\n indices.push(entropy[i] & getLowerMask(8 - remainingBits));\n remainingBits += 3;\n }\n }\n // Compute the checksum bits\n const checksumBits = entropy.length / 4;\n const checksum = parseInt(sha256(entropy).substring(2, 4), 16) & getUpperMask(checksumBits);\n // Shift the checksum into the word indices\n indices[indices.length - 1] <<= checksumBits;\n indices[indices.length - 1] |= (checksum >> (8 - checksumBits));\n return wordlist.join(indices.map((index) => wordlist.getWord(index)));\n}\nconst _guard = {};\n/**\n * A **Mnemonic** wraps all properties required to compute [[link-bip-39]]\n * seeds and convert between phrases and entropy.\n */\nexport class Mnemonic {\n /**\n * The mnemonic phrase of 12, 15, 18, 21 or 24 words.\n *\n * Use the [[wordlist]] ``split`` method to get the individual words.\n */\n phrase;\n /**\n * The password used for this mnemonic. If no password is used this\n * is the empty string (i.e. ``\"\"``) as per the specification.\n */\n password;\n /**\n * The wordlist for this mnemonic.\n */\n wordlist;\n /**\n * The underlying entropy which the mnemonic encodes.\n */\n entropy;\n /**\n * @private\n */\n constructor(guard, entropy, phrase, password, wordlist) {\n if (password == null) {\n password = \"\";\n }\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n assertPrivate(guard, _guard, \"Mnemonic\");\n defineProperties(this, { phrase, password, wordlist, entropy });\n }\n /**\n * Returns the seed for the mnemonic.\n */\n computeSeed() {\n const salt = toUtf8Bytes(\"mnemonic\" + this.password, \"NFKD\");\n return pbkdf2(toUtf8Bytes(this.phrase, \"NFKD\"), salt, 2048, 64, \"sha512\");\n }\n /**\n * Creates a new Mnemonic for the %%phrase%%.\n *\n * The default %%password%% is the empty string and the default\n * wordlist is the [English wordlists](LangEn).\n */\n static fromPhrase(phrase, password, wordlist) {\n // Normalize the case and space; throws if invalid\n const entropy = mnemonicToEntropy(phrase, wordlist);\n phrase = entropyToMnemonic(getBytes(entropy), wordlist);\n return new Mnemonic(_guard, entropy, phrase, password, wordlist);\n }\n /**\n * Create a new **Mnemonic** from the %%entropy%%.\n *\n * The default %%password%% is the empty string and the default\n * wordlist is the [English wordlists](LangEn).\n */\n static fromEntropy(_entropy, password, wordlist) {\n const entropy = getBytes(_entropy, \"entropy\");\n const phrase = entropyToMnemonic(entropy, wordlist);\n return new Mnemonic(_guard, hexlify(entropy), phrase, password, wordlist);\n }\n /**\n * Returns the phrase for %%mnemonic%%.\n */\n static entropyToPhrase(_entropy, wordlist) {\n const entropy = getBytes(_entropy, \"entropy\");\n return entropyToMnemonic(entropy, wordlist);\n }\n /**\n * Returns the entropy for %%phrase%%.\n */\n static phraseToEntropy(phrase, wordlist) {\n return mnemonicToEntropy(phrase, wordlist);\n }\n /**\n * Returns true if %%phrase%% is a valid [[link-bip-39]] phrase.\n *\n * This checks all the provided words belong to the %%wordlist%%,\n * that the length is valid and the checksum is correct.\n */\n static isValidMnemonic(phrase, wordlist) {\n try {\n mnemonicToEntropy(phrase, wordlist);\n return true;\n }\n catch (error) { }\n return false;\n }\n}\n//# sourceMappingURL=mnemonic.js.map","/*! MIT License. Copyright 2015-2022 Richard Moore . See LICENSE.txt. */\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar _AES_key, _AES_Kd, _AES_Ke;\n// Number of rounds by keysize\nconst numberOfRounds = { 16: 10, 24: 12, 32: 14 };\n// Round constant words\nconst rcon = [0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91];\n// S-box and Inverse S-box (S is for Substitution)\nconst S = [0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x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d, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06, 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d];\n// Transformations for encryption\nconst T1 = [0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d, 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554, 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d, 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a, 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87, 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b, 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea, 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b, 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a, 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f, 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108, 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f, 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e, 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5, 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d, 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f, 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e, 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb, 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce, 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497, 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c, 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed, 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b, 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a, 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16, 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594, 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81, 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3, 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a, 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504, 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163, 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d, 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f, 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739, 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47, 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395, 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f, 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883, 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c, 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76, 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e, 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4, 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6, 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b, 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7, 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0, 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25, 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818, 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72, 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651, 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21, 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85, 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa, 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12, 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0, 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9, 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133, 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7, 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920, 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a, 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17, 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8, 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11, 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a];\nconst T2 = [0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b, 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5, 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b, 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676, 0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d, 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0, 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf, 0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0, 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626, 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc, 0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1, 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515, 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3, 0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a, 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2, 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575, 0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a, 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0, 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3, 0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484, 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded, 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b, 0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939, 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf, 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb, 0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585, 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f, 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8, 0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f, 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5, 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121, 0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2, 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec, 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717, 0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d, 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373, 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc, 0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888, 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414, 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb, 0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a, 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c, 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262, 0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979, 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d, 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9, 0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea, 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808, 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e, 0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6, 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f, 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a, 0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666, 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e, 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9, 0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e, 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111, 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494, 0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9, 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf, 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d, 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868, 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f, 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616];\nconst T3 = [0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b, 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5, 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b, 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76, 0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d, 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0, 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af, 0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0, 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26, 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc, 0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1, 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15, 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3, 0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a, 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2, 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75, 0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a, 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0, 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3, 0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384, 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed, 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b, 0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239, 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf, 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb, 0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185, 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f, 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8, 0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f, 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5, 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221, 0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2, 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec, 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17, 0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d, 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673, 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc, 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88, 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814, 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb, 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a, 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c, 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462, 0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279, 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d, 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9, 0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea, 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008, 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e, 0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6, 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f, 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a, 0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66, 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e, 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9, 0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e, 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211, 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394, 0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9, 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df, 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d, 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068, 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f, 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16];\nconst T4 = [0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6, 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491, 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56, 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec, 0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa, 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb, 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45, 0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b, 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c, 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83, 0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9, 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a, 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d, 0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f, 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf, 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea, 0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34, 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b, 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d, 0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713, 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1, 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6, 0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72, 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85, 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed, 0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411, 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe, 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b, 0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05, 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1, 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342, 0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf, 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3, 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e, 0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a, 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6, 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3, 0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b, 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28, 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad, 0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14, 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8, 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4, 0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2, 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da, 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049, 0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf, 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810, 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c, 0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197, 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e, 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f, 0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc, 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c, 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069, 0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927, 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322, 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733, 0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9, 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5, 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a, 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0, 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e, 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c];\n// Transformations for decryption\nconst T5 = [0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96, 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393, 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25, 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f, 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1, 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6, 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da, 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844, 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd, 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4, 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45, 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94, 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7, 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a, 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5, 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c, 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1, 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a, 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75, 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051, 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46, 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff, 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77, 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb, 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000, 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e, 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927, 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a, 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e, 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16, 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d, 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8, 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd, 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34, 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163, 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120, 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d, 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0, 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422, 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef, 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36, 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4, 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662, 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5, 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3, 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b, 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8, 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6, 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6, 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0, 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815, 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f, 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df, 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f, 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e, 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713, 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89, 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c, 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf, 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86, 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f, 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541, 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190, 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742];\nconst T6 = [0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e, 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303, 0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c, 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3, 0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0, 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9, 0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259, 0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8, 0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971, 0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a, 0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f, 0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b, 0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8, 0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab, 0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708, 0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682, 0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2, 0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe, 0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb, 0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10, 0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd, 0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015, 0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e, 0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee, 0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000, 0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72, 0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39, 0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e, 0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91, 0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a, 0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17, 0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9, 0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60, 0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e, 0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1, 0xcad731dc, 0x10426385, 0x40139722, 0x2084c611, 0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1, 0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3, 0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964, 0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390, 0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b, 0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf, 0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46, 0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af, 0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512, 0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb, 0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a, 0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8, 0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c, 0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266, 0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8, 0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6, 0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604, 0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551, 0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41, 0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647, 0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c, 0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1, 0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737, 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db, 0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340, 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95, 0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1, 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857];\nconst T7 = [0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27, 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3, 0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502, 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562, 0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe, 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3, 0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552, 0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9, 0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9, 0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce, 0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253, 0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908, 0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b, 0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655, 0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337, 0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16, 0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69, 0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6, 0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6, 0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e, 0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6, 0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050, 0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9, 0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8, 0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000, 0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a, 0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d, 0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436, 0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b, 0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12, 0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b, 0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e, 0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f, 0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb, 0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4, 0xdccad731, 0x85104263, 0x22401397, 0x112084c6, 0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729, 0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1, 0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9, 0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233, 0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4, 0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad, 0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e, 0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3, 0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25, 0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b, 0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f, 0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15, 0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0, 0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2, 0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7, 0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791, 0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496, 0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665, 0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b, 0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6, 0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13, 0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47, 0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7, 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844, 0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3, 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d, 0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456, 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8];\nconst T8 = [0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a, 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b, 0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5, 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5, 0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d, 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b, 0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95, 0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e, 0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27, 0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d, 0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562, 0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9, 0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752, 0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66, 0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3, 0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced, 0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e, 0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4, 0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4, 0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd, 0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d, 0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60, 0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767, 0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79, 0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000, 0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c, 0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736, 0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24, 0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b, 0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c, 0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12, 0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814, 0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3, 0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b, 0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8, 0x31dccad7, 0x63851042, 0x97224013, 0xc6112084, 0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7, 0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077, 0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247, 0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22, 0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698, 0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f, 0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254, 0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582, 0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf, 0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb, 0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883, 0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef, 0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629, 0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035, 0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533, 0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17, 0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4, 0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46, 0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb, 0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d, 0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb, 0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a, 0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73, 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678, 0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2, 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff, 0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064, 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0];\n// Transformations for decryption key expansion\nconst U1 = [0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3];\nconst U2 = [0x00000000, 0x0b0e090d, 0x161c121a, 0x1d121b17, 0x2c382434, 0x27362d39, 0x3a24362e, 0x312a3f23, 0x58704868, 0x537e4165, 0x4e6c5a72, 0x4562537f, 0x74486c5c, 0x7f466551, 0x62547e46, 0x695a774b, 0xb0e090d0, 0xbbee99dd, 0xa6fc82ca, 0xadf28bc7, 0x9cd8b4e4, 0x97d6bde9, 0x8ac4a6fe, 0x81caaff3, 0xe890d8b8, 0xe39ed1b5, 0xfe8ccaa2, 0xf582c3af, 0xc4a8fc8c, 0xcfa6f581, 0xd2b4ee96, 0xd9bae79b, 0x7bdb3bbb, 0x70d532b6, 0x6dc729a1, 0x66c920ac, 0x57e31f8f, 0x5ced1682, 0x41ff0d95, 0x4af10498, 0x23ab73d3, 0x28a57ade, 0x35b761c9, 0x3eb968c4, 0x0f9357e7, 0x049d5eea, 0x198f45fd, 0x12814cf0, 0xcb3bab6b, 0xc035a266, 0xdd27b971, 0xd629b07c, 0xe7038f5f, 0xec0d8652, 0xf11f9d45, 0xfa119448, 0x934be303, 0x9845ea0e, 0x8557f119, 0x8e59f814, 0xbf73c737, 0xb47dce3a, 0xa96fd52d, 0xa261dc20, 0xf6ad766d, 0xfda37f60, 0xe0b16477, 0xebbf6d7a, 0xda955259, 0xd19b5b54, 0xcc894043, 0xc787494e, 0xaedd3e05, 0xa5d33708, 0xb8c12c1f, 0xb3cf2512, 0x82e51a31, 0x89eb133c, 0x94f9082b, 0x9ff70126, 0x464de6bd, 0x4d43efb0, 0x5051f4a7, 0x5b5ffdaa, 0x6a75c289, 0x617bcb84, 0x7c69d093, 0x7767d99e, 0x1e3daed5, 0x1533a7d8, 0x0821bccf, 0x032fb5c2, 0x32058ae1, 0x390b83ec, 0x241998fb, 0x2f1791f6, 0x8d764dd6, 0x867844db, 0x9b6a5fcc, 0x906456c1, 0xa14e69e2, 0xaa4060ef, 0xb7527bf8, 0xbc5c72f5, 0xd50605be, 0xde080cb3, 0xc31a17a4, 0xc8141ea9, 0xf93e218a, 0xf2302887, 0xef223390, 0xe42c3a9d, 0x3d96dd06, 0x3698d40b, 0x2b8acf1c, 0x2084c611, 0x11aef932, 0x1aa0f03f, 0x07b2eb28, 0x0cbce225, 0x65e6956e, 0x6ee89c63, 0x73fa8774, 0x78f48e79, 0x49deb15a, 0x42d0b857, 0x5fc2a340, 0x54ccaa4d, 0xf741ecda, 0xfc4fe5d7, 0xe15dfec0, 0xea53f7cd, 0xdb79c8ee, 0xd077c1e3, 0xcd65daf4, 0xc66bd3f9, 0xaf31a4b2, 0xa43fadbf, 0xb92db6a8, 0xb223bfa5, 0x83098086, 0x8807898b, 0x9515929c, 0x9e1b9b91, 0x47a17c0a, 0x4caf7507, 0x51bd6e10, 0x5ab3671d, 0x6b99583e, 0x60975133, 0x7d854a24, 0x768b4329, 0x1fd13462, 0x14df3d6f, 0x09cd2678, 0x02c32f75, 0x33e91056, 0x38e7195b, 0x25f5024c, 0x2efb0b41, 0x8c9ad761, 0x8794de6c, 0x9a86c57b, 0x9188cc76, 0xa0a2f355, 0xabacfa58, 0xb6bee14f, 0xbdb0e842, 0xd4ea9f09, 0xdfe49604, 0xc2f68d13, 0xc9f8841e, 0xf8d2bb3d, 0xf3dcb230, 0xeecea927, 0xe5c0a02a, 0x3c7a47b1, 0x37744ebc, 0x2a6655ab, 0x21685ca6, 0x10426385, 0x1b4c6a88, 0x065e719f, 0x0d507892, 0x640a0fd9, 0x6f0406d4, 0x72161dc3, 0x791814ce, 0x48322bed, 0x433c22e0, 0x5e2e39f7, 0x552030fa, 0x01ec9ab7, 0x0ae293ba, 0x17f088ad, 0x1cfe81a0, 0x2dd4be83, 0x26dab78e, 0x3bc8ac99, 0x30c6a594, 0x599cd2df, 0x5292dbd2, 0x4f80c0c5, 0x448ec9c8, 0x75a4f6eb, 0x7eaaffe6, 0x63b8e4f1, 0x68b6edfc, 0xb10c0a67, 0xba02036a, 0xa710187d, 0xac1e1170, 0x9d342e53, 0x963a275e, 0x8b283c49, 0x80263544, 0xe97c420f, 0xe2724b02, 0xff605015, 0xf46e5918, 0xc544663b, 0xce4a6f36, 0xd3587421, 0xd8567d2c, 0x7a37a10c, 0x7139a801, 0x6c2bb316, 0x6725ba1b, 0x560f8538, 0x5d018c35, 0x40139722, 0x4b1d9e2f, 0x2247e964, 0x2949e069, 0x345bfb7e, 0x3f55f273, 0x0e7fcd50, 0x0571c45d, 0x1863df4a, 0x136dd647, 0xcad731dc, 0xc1d938d1, 0xdccb23c6, 0xd7c52acb, 0xe6ef15e8, 0xede11ce5, 0xf0f307f2, 0xfbfd0eff, 0x92a779b4, 0x99a970b9, 0x84bb6bae, 0x8fb562a3, 0xbe9f5d80, 0xb591548d, 0xa8834f9a, 0xa38d4697];\nconst U3 = [0x00000000, 0x0d0b0e09, 0x1a161c12, 0x171d121b, 0x342c3824, 0x3927362d, 0x2e3a2436, 0x23312a3f, 0x68587048, 0x65537e41, 0x724e6c5a, 0x7f456253, 0x5c74486c, 0x517f4665, 0x4662547e, 0x4b695a77, 0xd0b0e090, 0xddbbee99, 0xcaa6fc82, 0xc7adf28b, 0xe49cd8b4, 0xe997d6bd, 0xfe8ac4a6, 0xf381caaf, 0xb8e890d8, 0xb5e39ed1, 0xa2fe8cca, 0xaff582c3, 0x8cc4a8fc, 0x81cfa6f5, 0x96d2b4ee, 0x9bd9bae7, 0xbb7bdb3b, 0xb670d532, 0xa16dc729, 0xac66c920, 0x8f57e31f, 0x825ced16, 0x9541ff0d, 0x984af104, 0xd323ab73, 0xde28a57a, 0xc935b761, 0xc43eb968, 0xe70f9357, 0xea049d5e, 0xfd198f45, 0xf012814c, 0x6bcb3bab, 0x66c035a2, 0x71dd27b9, 0x7cd629b0, 0x5fe7038f, 0x52ec0d86, 0x45f11f9d, 0x48fa1194, 0x03934be3, 0x0e9845ea, 0x198557f1, 0x148e59f8, 0x37bf73c7, 0x3ab47dce, 0x2da96fd5, 0x20a261dc, 0x6df6ad76, 0x60fda37f, 0x77e0b164, 0x7aebbf6d, 0x59da9552, 0x54d19b5b, 0x43cc8940, 0x4ec78749, 0x05aedd3e, 0x08a5d337, 0x1fb8c12c, 0x12b3cf25, 0x3182e51a, 0x3c89eb13, 0x2b94f908, 0x269ff701, 0xbd464de6, 0xb04d43ef, 0xa75051f4, 0xaa5b5ffd, 0x896a75c2, 0x84617bcb, 0x937c69d0, 0x9e7767d9, 0xd51e3dae, 0xd81533a7, 0xcf0821bc, 0xc2032fb5, 0xe132058a, 0xec390b83, 0xfb241998, 0xf62f1791, 0xd68d764d, 0xdb867844, 0xcc9b6a5f, 0xc1906456, 0xe2a14e69, 0xefaa4060, 0xf8b7527b, 0xf5bc5c72, 0xbed50605, 0xb3de080c, 0xa4c31a17, 0xa9c8141e, 0x8af93e21, 0x87f23028, 0x90ef2233, 0x9de42c3a, 0x063d96dd, 0x0b3698d4, 0x1c2b8acf, 0x112084c6, 0x3211aef9, 0x3f1aa0f0, 0x2807b2eb, 0x250cbce2, 0x6e65e695, 0x636ee89c, 0x7473fa87, 0x7978f48e, 0x5a49deb1, 0x5742d0b8, 0x405fc2a3, 0x4d54ccaa, 0xdaf741ec, 0xd7fc4fe5, 0xc0e15dfe, 0xcdea53f7, 0xeedb79c8, 0xe3d077c1, 0xf4cd65da, 0xf9c66bd3, 0xb2af31a4, 0xbfa43fad, 0xa8b92db6, 0xa5b223bf, 0x86830980, 0x8b880789, 0x9c951592, 0x919e1b9b, 0x0a47a17c, 0x074caf75, 0x1051bd6e, 0x1d5ab367, 0x3e6b9958, 0x33609751, 0x247d854a, 0x29768b43, 0x621fd134, 0x6f14df3d, 0x7809cd26, 0x7502c32f, 0x5633e910, 0x5b38e719, 0x4c25f502, 0x412efb0b, 0x618c9ad7, 0x6c8794de, 0x7b9a86c5, 0x769188cc, 0x55a0a2f3, 0x58abacfa, 0x4fb6bee1, 0x42bdb0e8, 0x09d4ea9f, 0x04dfe496, 0x13c2f68d, 0x1ec9f884, 0x3df8d2bb, 0x30f3dcb2, 0x27eecea9, 0x2ae5c0a0, 0xb13c7a47, 0xbc37744e, 0xab2a6655, 0xa621685c, 0x85104263, 0x881b4c6a, 0x9f065e71, 0x920d5078, 0xd9640a0f, 0xd46f0406, 0xc372161d, 0xce791814, 0xed48322b, 0xe0433c22, 0xf75e2e39, 0xfa552030, 0xb701ec9a, 0xba0ae293, 0xad17f088, 0xa01cfe81, 0x832dd4be, 0x8e26dab7, 0x993bc8ac, 0x9430c6a5, 0xdf599cd2, 0xd25292db, 0xc54f80c0, 0xc8448ec9, 0xeb75a4f6, 0xe67eaaff, 0xf163b8e4, 0xfc68b6ed, 0x67b10c0a, 0x6aba0203, 0x7da71018, 0x70ac1e11, 0x539d342e, 0x5e963a27, 0x498b283c, 0x44802635, 0x0fe97c42, 0x02e2724b, 0x15ff6050, 0x18f46e59, 0x3bc54466, 0x36ce4a6f, 0x21d35874, 0x2cd8567d, 0x0c7a37a1, 0x017139a8, 0x166c2bb3, 0x1b6725ba, 0x38560f85, 0x355d018c, 0x22401397, 0x2f4b1d9e, 0x642247e9, 0x692949e0, 0x7e345bfb, 0x733f55f2, 0x500e7fcd, 0x5d0571c4, 0x4a1863df, 0x47136dd6, 0xdccad731, 0xd1c1d938, 0xc6dccb23, 0xcbd7c52a, 0xe8e6ef15, 0xe5ede11c, 0xf2f0f307, 0xfffbfd0e, 0xb492a779, 0xb999a970, 0xae84bb6b, 0xa38fb562, 0x80be9f5d, 0x8db59154, 0x9aa8834f, 0x97a38d46];\nconst U4 = [0x00000000, 0x090d0b0e, 0x121a161c, 0x1b171d12, 0x24342c38, 0x2d392736, 0x362e3a24, 0x3f23312a, 0x48685870, 0x4165537e, 0x5a724e6c, 0x537f4562, 0x6c5c7448, 0x65517f46, 0x7e466254, 0x774b695a, 0x90d0b0e0, 0x99ddbbee, 0x82caa6fc, 0x8bc7adf2, 0xb4e49cd8, 0xbde997d6, 0xa6fe8ac4, 0xaff381ca, 0xd8b8e890, 0xd1b5e39e, 0xcaa2fe8c, 0xc3aff582, 0xfc8cc4a8, 0xf581cfa6, 0xee96d2b4, 0xe79bd9ba, 0x3bbb7bdb, 0x32b670d5, 0x29a16dc7, 0x20ac66c9, 0x1f8f57e3, 0x16825ced, 0x0d9541ff, 0x04984af1, 0x73d323ab, 0x7ade28a5, 0x61c935b7, 0x68c43eb9, 0x57e70f93, 0x5eea049d, 0x45fd198f, 0x4cf01281, 0xab6bcb3b, 0xa266c035, 0xb971dd27, 0xb07cd629, 0x8f5fe703, 0x8652ec0d, 0x9d45f11f, 0x9448fa11, 0xe303934b, 0xea0e9845, 0xf1198557, 0xf8148e59, 0xc737bf73, 0xce3ab47d, 0xd52da96f, 0xdc20a261, 0x766df6ad, 0x7f60fda3, 0x6477e0b1, 0x6d7aebbf, 0x5259da95, 0x5b54d19b, 0x4043cc89, 0x494ec787, 0x3e05aedd, 0x3708a5d3, 0x2c1fb8c1, 0x2512b3cf, 0x1a3182e5, 0x133c89eb, 0x082b94f9, 0x01269ff7, 0xe6bd464d, 0xefb04d43, 0xf4a75051, 0xfdaa5b5f, 0xc2896a75, 0xcb84617b, 0xd0937c69, 0xd99e7767, 0xaed51e3d, 0xa7d81533, 0xbccf0821, 0xb5c2032f, 0x8ae13205, 0x83ec390b, 0x98fb2419, 0x91f62f17, 0x4dd68d76, 0x44db8678, 0x5fcc9b6a, 0x56c19064, 0x69e2a14e, 0x60efaa40, 0x7bf8b752, 0x72f5bc5c, 0x05bed506, 0x0cb3de08, 0x17a4c31a, 0x1ea9c814, 0x218af93e, 0x2887f230, 0x3390ef22, 0x3a9de42c, 0xdd063d96, 0xd40b3698, 0xcf1c2b8a, 0xc6112084, 0xf93211ae, 0xf03f1aa0, 0xeb2807b2, 0xe2250cbc, 0x956e65e6, 0x9c636ee8, 0x877473fa, 0x8e7978f4, 0xb15a49de, 0xb85742d0, 0xa3405fc2, 0xaa4d54cc, 0xecdaf741, 0xe5d7fc4f, 0xfec0e15d, 0xf7cdea53, 0xc8eedb79, 0xc1e3d077, 0xdaf4cd65, 0xd3f9c66b, 0xa4b2af31, 0xadbfa43f, 0xb6a8b92d, 0xbfa5b223, 0x80868309, 0x898b8807, 0x929c9515, 0x9b919e1b, 0x7c0a47a1, 0x75074caf, 0x6e1051bd, 0x671d5ab3, 0x583e6b99, 0x51336097, 0x4a247d85, 0x4329768b, 0x34621fd1, 0x3d6f14df, 0x267809cd, 0x2f7502c3, 0x105633e9, 0x195b38e7, 0x024c25f5, 0x0b412efb, 0xd7618c9a, 0xde6c8794, 0xc57b9a86, 0xcc769188, 0xf355a0a2, 0xfa58abac, 0xe14fb6be, 0xe842bdb0, 0x9f09d4ea, 0x9604dfe4, 0x8d13c2f6, 0x841ec9f8, 0xbb3df8d2, 0xb230f3dc, 0xa927eece, 0xa02ae5c0, 0x47b13c7a, 0x4ebc3774, 0x55ab2a66, 0x5ca62168, 0x63851042, 0x6a881b4c, 0x719f065e, 0x78920d50, 0x0fd9640a, 0x06d46f04, 0x1dc37216, 0x14ce7918, 0x2bed4832, 0x22e0433c, 0x39f75e2e, 0x30fa5520, 0x9ab701ec, 0x93ba0ae2, 0x88ad17f0, 0x81a01cfe, 0xbe832dd4, 0xb78e26da, 0xac993bc8, 0xa59430c6, 0xd2df599c, 0xdbd25292, 0xc0c54f80, 0xc9c8448e, 0xf6eb75a4, 0xffe67eaa, 0xe4f163b8, 0xedfc68b6, 0x0a67b10c, 0x036aba02, 0x187da710, 0x1170ac1e, 0x2e539d34, 0x275e963a, 0x3c498b28, 0x35448026, 0x420fe97c, 0x4b02e272, 0x5015ff60, 0x5918f46e, 0x663bc544, 0x6f36ce4a, 0x7421d358, 0x7d2cd856, 0xa10c7a37, 0xa8017139, 0xb3166c2b, 0xba1b6725, 0x8538560f, 0x8c355d01, 0x97224013, 0x9e2f4b1d, 0xe9642247, 0xe0692949, 0xfb7e345b, 0xf2733f55, 0xcd500e7f, 0xc45d0571, 0xdf4a1863, 0xd647136d, 0x31dccad7, 0x38d1c1d9, 0x23c6dccb, 0x2acbd7c5, 0x15e8e6ef, 0x1ce5ede1, 0x07f2f0f3, 0x0efffbfd, 0x79b492a7, 0x70b999a9, 0x6bae84bb, 0x62a38fb5, 0x5d80be9f, 0x548db591, 0x4f9aa883, 0x4697a38d];\nfunction convertToInt32(bytes) {\n const result = [];\n for (let i = 0; i < bytes.length; i += 4) {\n result.push((bytes[i] << 24) | (bytes[i + 1] << 16) | (bytes[i + 2] << 8) | bytes[i + 3]);\n }\n return result;\n}\nexport class AES {\n get key() { return __classPrivateFieldGet(this, _AES_key, \"f\").slice(); }\n constructor(key) {\n _AES_key.set(this, void 0);\n _AES_Kd.set(this, void 0);\n _AES_Ke.set(this, void 0);\n if (!(this instanceof AES)) {\n throw Error('AES must be instanitated with `new`');\n }\n __classPrivateFieldSet(this, _AES_key, new Uint8Array(key), \"f\");\n const rounds = numberOfRounds[this.key.length];\n if (rounds == null) {\n throw new TypeError('invalid key size (must be 16, 24 or 32 bytes)');\n }\n // encryption round keys\n __classPrivateFieldSet(this, _AES_Ke, [], \"f\");\n // decryption round keys\n __classPrivateFieldSet(this, _AES_Kd, [], \"f\");\n for (let i = 0; i <= rounds; i++) {\n __classPrivateFieldGet(this, _AES_Ke, \"f\").push([0, 0, 0, 0]);\n __classPrivateFieldGet(this, _AES_Kd, \"f\").push([0, 0, 0, 0]);\n }\n const roundKeyCount = (rounds + 1) * 4;\n const KC = this.key.length / 4;\n // convert the key into ints\n const tk = convertToInt32(this.key);\n // copy values into round key arrays\n let index;\n for (let i = 0; i < KC; i++) {\n index = i >> 2;\n __classPrivateFieldGet(this, _AES_Ke, \"f\")[index][i % 4] = tk[i];\n __classPrivateFieldGet(this, _AES_Kd, \"f\")[rounds - index][i % 4] = tk[i];\n }\n // key expansion (fips-197 section 5.2)\n let rconpointer = 0;\n let t = KC, tt;\n while (t < roundKeyCount) {\n tt = tk[KC - 1];\n tk[0] ^= ((S[(tt >> 16) & 0xFF] << 24) ^\n (S[(tt >> 8) & 0xFF] << 16) ^\n (S[tt & 0xFF] << 8) ^\n S[(tt >> 24) & 0xFF] ^\n (rcon[rconpointer] << 24));\n rconpointer += 1;\n // key expansion (for non-256 bit)\n if (KC != 8) {\n for (let i = 1; i < KC; i++) {\n tk[i] ^= tk[i - 1];\n }\n // key expansion for 256-bit keys is \"slightly different\" (fips-197)\n }\n else {\n for (let i = 1; i < (KC / 2); i++) {\n tk[i] ^= tk[i - 1];\n }\n tt = tk[(KC / 2) - 1];\n tk[KC / 2] ^= (S[tt & 0xFF] ^\n (S[(tt >> 8) & 0xFF] << 8) ^\n (S[(tt >> 16) & 0xFF] << 16) ^\n (S[(tt >> 24) & 0xFF] << 24));\n for (let i = (KC / 2) + 1; i < KC; i++) {\n tk[i] ^= tk[i - 1];\n }\n }\n // copy values into round key arrays\n let i = 0, r, c;\n while (i < KC && t < roundKeyCount) {\n r = t >> 2;\n c = t % 4;\n __classPrivateFieldGet(this, _AES_Ke, \"f\")[r][c] = tk[i];\n __classPrivateFieldGet(this, _AES_Kd, \"f\")[rounds - r][c] = tk[i++];\n t++;\n }\n }\n // inverse-cipher-ify the decryption round key (fips-197 section 5.3)\n for (let r = 1; r < rounds; r++) {\n for (let c = 0; c < 4; c++) {\n tt = __classPrivateFieldGet(this, _AES_Kd, \"f\")[r][c];\n __classPrivateFieldGet(this, _AES_Kd, \"f\")[r][c] = (U1[(tt >> 24) & 0xFF] ^\n U2[(tt >> 16) & 0xFF] ^\n U3[(tt >> 8) & 0xFF] ^\n U4[tt & 0xFF]);\n }\n }\n }\n encrypt(plaintext) {\n if (plaintext.length != 16) {\n throw new TypeError('invalid plaintext size (must be 16 bytes)');\n }\n const rounds = __classPrivateFieldGet(this, _AES_Ke, \"f\").length - 1;\n const a = [0, 0, 0, 0];\n // convert plaintext to (ints ^ key)\n let t = convertToInt32(plaintext);\n for (let i = 0; i < 4; i++) {\n t[i] ^= __classPrivateFieldGet(this, _AES_Ke, \"f\")[0][i];\n }\n // apply round transforms\n for (let r = 1; r < rounds; r++) {\n for (let i = 0; i < 4; i++) {\n a[i] = (T1[(t[i] >> 24) & 0xff] ^\n T2[(t[(i + 1) % 4] >> 16) & 0xff] ^\n T3[(t[(i + 2) % 4] >> 8) & 0xff] ^\n T4[t[(i + 3) % 4] & 0xff] ^\n __classPrivateFieldGet(this, _AES_Ke, \"f\")[r][i]);\n }\n t = a.slice();\n }\n // the last round is special\n const result = new Uint8Array(16);\n let tt = 0;\n for (let i = 0; i < 4; i++) {\n tt = __classPrivateFieldGet(this, _AES_Ke, \"f\")[rounds][i];\n result[4 * i] = (S[(t[i] >> 24) & 0xff] ^ (tt >> 24)) & 0xff;\n result[4 * i + 1] = (S[(t[(i + 1) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff;\n result[4 * i + 2] = (S[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff;\n result[4 * i + 3] = (S[t[(i + 3) % 4] & 0xff] ^ tt) & 0xff;\n }\n return result;\n }\n decrypt(ciphertext) {\n if (ciphertext.length != 16) {\n throw new TypeError('invalid ciphertext size (must be 16 bytes)');\n }\n const rounds = __classPrivateFieldGet(this, _AES_Kd, \"f\").length - 1;\n const a = [0, 0, 0, 0];\n // convert plaintext to (ints ^ key)\n let t = convertToInt32(ciphertext);\n for (let i = 0; i < 4; i++) {\n t[i] ^= __classPrivateFieldGet(this, _AES_Kd, \"f\")[0][i];\n }\n // apply round transforms\n for (let r = 1; r < rounds; r++) {\n for (let i = 0; i < 4; i++) {\n a[i] = (T5[(t[i] >> 24) & 0xff] ^\n T6[(t[(i + 3) % 4] >> 16) & 0xff] ^\n T7[(t[(i + 2) % 4] >> 8) & 0xff] ^\n T8[t[(i + 1) % 4] & 0xff] ^\n __classPrivateFieldGet(this, _AES_Kd, \"f\")[r][i]);\n }\n t = a.slice();\n }\n // the last round is special\n const result = new Uint8Array(16);\n let tt = 0;\n for (let i = 0; i < 4; i++) {\n tt = __classPrivateFieldGet(this, _AES_Kd, \"f\")[rounds][i];\n result[4 * i] = (Si[(t[i] >> 24) & 0xff] ^ (tt >> 24)) & 0xff;\n result[4 * i + 1] = (Si[(t[(i + 3) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff;\n result[4 * i + 2] = (Si[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff;\n result[4 * i + 3] = (Si[t[(i + 1) % 4] & 0xff] ^ tt) & 0xff;\n }\n return result;\n }\n}\n_AES_key = new WeakMap(), _AES_Kd = new WeakMap(), _AES_Ke = new WeakMap();\n//# sourceMappingURL=aes.js.map","import { AES } from \"./aes.js\";\nexport class ModeOfOperation {\n constructor(name, key, cls) {\n if (cls && !(this instanceof cls)) {\n throw new Error(`${name} must be instantiated with \"new\"`);\n }\n Object.defineProperties(this, {\n aes: { enumerable: true, value: new AES(key) },\n name: { enumerable: true, value: name }\n });\n }\n}\n//# sourceMappingURL=mode.js.map","// Cipher Block Chaining\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _CBC_iv, _CBC_lastBlock;\nimport { ModeOfOperation } from \"./mode.js\";\nexport class CBC extends ModeOfOperation {\n constructor(key, iv) {\n super(\"ECC\", key, CBC);\n _CBC_iv.set(this, void 0);\n _CBC_lastBlock.set(this, void 0);\n if (iv) {\n if (iv.length % 16) {\n throw new TypeError(\"invalid iv size (must be 16 bytes)\");\n }\n __classPrivateFieldSet(this, _CBC_iv, new Uint8Array(iv), \"f\");\n }\n else {\n __classPrivateFieldSet(this, _CBC_iv, new Uint8Array(16), \"f\");\n }\n __classPrivateFieldSet(this, _CBC_lastBlock, this.iv, \"f\");\n }\n get iv() { return new Uint8Array(__classPrivateFieldGet(this, _CBC_iv, \"f\")); }\n encrypt(plaintext) {\n if (plaintext.length % 16) {\n throw new TypeError(\"invalid plaintext size (must be multiple of 16 bytes)\");\n }\n const ciphertext = new Uint8Array(plaintext.length);\n for (let i = 0; i < plaintext.length; i += 16) {\n for (let j = 0; j < 16; j++) {\n __classPrivateFieldGet(this, _CBC_lastBlock, \"f\")[j] ^= plaintext[i + j];\n }\n __classPrivateFieldSet(this, _CBC_lastBlock, this.aes.encrypt(__classPrivateFieldGet(this, _CBC_lastBlock, \"f\")), \"f\");\n ciphertext.set(__classPrivateFieldGet(this, _CBC_lastBlock, \"f\"), i);\n }\n return ciphertext;\n }\n decrypt(ciphertext) {\n if (ciphertext.length % 16) {\n throw new TypeError(\"invalid ciphertext size (must be multiple of 16 bytes)\");\n }\n const plaintext = new Uint8Array(ciphertext.length);\n for (let i = 0; i < ciphertext.length; i += 16) {\n const block = this.aes.decrypt(ciphertext.subarray(i, i + 16));\n for (let j = 0; j < 16; j++) {\n plaintext[i + j] = block[j] ^ __classPrivateFieldGet(this, _CBC_lastBlock, \"f\")[j];\n __classPrivateFieldGet(this, _CBC_lastBlock, \"f\")[j] = ciphertext[i + j];\n }\n }\n return plaintext;\n }\n}\n_CBC_iv = new WeakMap(), _CBC_lastBlock = new WeakMap();\n//# sourceMappingURL=mode-cbc.js.map","// Counter Mode\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _CTR_remaining, _CTR_remainingIndex, _CTR_counter;\nimport { ModeOfOperation } from \"./mode.js\";\nexport class CTR extends ModeOfOperation {\n constructor(key, initialValue) {\n super(\"CTR\", key, CTR);\n // Remaining bytes for the one-time pad\n _CTR_remaining.set(this, void 0);\n _CTR_remainingIndex.set(this, void 0);\n // The current counter\n _CTR_counter.set(this, void 0);\n __classPrivateFieldSet(this, _CTR_counter, new Uint8Array(16), \"f\");\n __classPrivateFieldGet(this, _CTR_counter, \"f\").fill(0);\n __classPrivateFieldSet(this, _CTR_remaining, __classPrivateFieldGet(this, _CTR_counter, \"f\"), \"f\"); // This will be discarded immediately\n __classPrivateFieldSet(this, _CTR_remainingIndex, 16, \"f\");\n if (initialValue == null) {\n initialValue = 1;\n }\n if (typeof (initialValue) === \"number\") {\n this.setCounterValue(initialValue);\n }\n else {\n this.setCounterBytes(initialValue);\n }\n }\n get counter() { return new Uint8Array(__classPrivateFieldGet(this, _CTR_counter, \"f\")); }\n setCounterValue(value) {\n if (!Number.isInteger(value) || value < 0 || value > Number.MAX_SAFE_INTEGER) {\n throw new TypeError(\"invalid counter initial integer value\");\n }\n for (let index = 15; index >= 0; --index) {\n __classPrivateFieldGet(this, _CTR_counter, \"f\")[index] = value % 256;\n value = Math.floor(value / 256);\n }\n }\n setCounterBytes(value) {\n if (value.length !== 16) {\n throw new TypeError(\"invalid counter initial Uint8Array value length\");\n }\n __classPrivateFieldGet(this, _CTR_counter, \"f\").set(value);\n }\n increment() {\n for (let i = 15; i >= 0; i--) {\n if (__classPrivateFieldGet(this, _CTR_counter, \"f\")[i] === 255) {\n __classPrivateFieldGet(this, _CTR_counter, \"f\")[i] = 0;\n }\n else {\n __classPrivateFieldGet(this, _CTR_counter, \"f\")[i]++;\n break;\n }\n }\n }\n encrypt(plaintext) {\n var _a, _b;\n const crypttext = new Uint8Array(plaintext);\n for (let i = 0; i < crypttext.length; i++) {\n if (__classPrivateFieldGet(this, _CTR_remainingIndex, \"f\") === 16) {\n __classPrivateFieldSet(this, _CTR_remaining, this.aes.encrypt(__classPrivateFieldGet(this, _CTR_counter, \"f\")), \"f\");\n __classPrivateFieldSet(this, _CTR_remainingIndex, 0, \"f\");\n this.increment();\n }\n crypttext[i] ^= __classPrivateFieldGet(this, _CTR_remaining, \"f\")[__classPrivateFieldSet(this, _CTR_remainingIndex, (_b = __classPrivateFieldGet(this, _CTR_remainingIndex, \"f\"), _a = _b++, _b), \"f\"), _a];\n }\n return crypttext;\n }\n decrypt(ciphertext) {\n return this.encrypt(ciphertext);\n }\n}\n_CTR_remaining = new WeakMap(), _CTR_remainingIndex = new WeakMap(), _CTR_counter = new WeakMap();\n//# sourceMappingURL=mode-ctr.js.map","export function pkcs7Pad(data) {\n const padder = 16 - (data.length % 16);\n const result = new Uint8Array(data.length + padder);\n result.set(data);\n for (let i = data.length; i < result.length; i++) {\n result[i] = padder;\n }\n return result;\n}\nexport function pkcs7Strip(data) {\n if (data.length < 16) {\n throw new TypeError('PKCS#7 invalid length');\n }\n const padder = data[data.length - 1];\n if (padder > 16) {\n throw new TypeError('PKCS#7 padding byte out of range');\n }\n const length = data.length - padder;\n for (let i = 0; i < padder; i++) {\n if (data[length + i] !== padder) {\n throw new TypeError('PKCS#7 invalid padding byte');\n }\n }\n return new Uint8Array(data.subarray(0, length));\n}\n//# sourceMappingURL=padding.js.map","/**\n * @_ignore\n */\nimport { getBytesCopy, assertArgument, toUtf8Bytes } from \"../utils/index.js\";\nexport function looseArrayify(hexString) {\n if (typeof (hexString) === \"string\" && !hexString.startsWith(\"0x\")) {\n hexString = \"0x\" + hexString;\n }\n return getBytesCopy(hexString);\n}\nexport function zpad(value, length) {\n value = String(value);\n while (value.length < length) {\n value = '0' + value;\n }\n return value;\n}\nexport function getPassword(password) {\n if (typeof (password) === 'string') {\n return toUtf8Bytes(password, \"NFKC\");\n }\n return getBytesCopy(password);\n}\nexport function spelunk(object, _path) {\n const match = _path.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);\n assertArgument(match != null, \"invalid path\", \"path\", _path);\n const path = match[1];\n const type = match[3];\n const reqd = (match[4] === \"!\");\n let cur = object;\n for (const comp of path.toLowerCase().split('.')) {\n // Search for a child object with a case-insensitive matching key\n if (Array.isArray(cur)) {\n if (!comp.match(/^[0-9]+$/)) {\n break;\n }\n cur = cur[parseInt(comp)];\n }\n else if (typeof (cur) === \"object\") {\n let found = null;\n for (const key in cur) {\n if (key.toLowerCase() === comp) {\n found = cur[key];\n break;\n }\n }\n cur = found;\n }\n else {\n cur = null;\n }\n if (cur == null) {\n break;\n }\n }\n assertArgument(!reqd || cur != null, \"missing required value\", \"path\", path);\n if (type && cur != null) {\n if (type === \"int\") {\n if (typeof (cur) === \"string\" && cur.match(/^-?[0-9]+$/)) {\n return parseInt(cur);\n }\n else if (Number.isSafeInteger(cur)) {\n return cur;\n }\n }\n if (type === \"number\") {\n if (typeof (cur) === \"string\" && cur.match(/^-?[0-9.]*$/)) {\n return parseFloat(cur);\n }\n }\n if (type === \"data\") {\n if (typeof (cur) === \"string\") {\n return looseArrayify(cur);\n }\n }\n if (type === \"array\" && Array.isArray(cur)) {\n return cur;\n }\n if (type === typeof (cur)) {\n return cur;\n }\n assertArgument(false, `wrong type found for ${type} `, \"path\", path);\n }\n return cur;\n}\n/*\nexport function follow(object: any, path: string): null | string {\n let currentChild = object;\n\n for (const comp of path.toLowerCase().split('/')) {\n\n // Search for a child object with a case-insensitive matching key\n let matchingChild = null;\n for (const key in currentChild) {\n if (key.toLowerCase() === comp) {\n matchingChild = currentChild[key];\n break;\n }\n }\n\n if (matchingChild === null) { return null; }\n\n currentChild = matchingChild;\n }\n\n return currentChild;\n}\n\n// \"path/to/something:type!\"\nexport function followRequired(data: any, path: string): string {\n const value = follow(data, path);\n if (value != null) { return value; }\n return logger.throwArgumentError(\"invalid value\", `data:${ path }`,\n JSON.stringify(data));\n}\n*/\n// See: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4)\n/*\nexport function uuidV4(randomBytes: BytesLike): string {\n const bytes = getBytes(randomBytes, \"randomBytes\");\n\n // Section: 4.1.3:\n // - time_hi_and_version[12:16] = 0b0100\n bytes[6] = (bytes[6] & 0x0f) | 0x40;\n\n // Section 4.4\n // - clock_seq_hi_and_reserved[6] = 0b0\n // - clock_seq_hi_and_reserved[7] = 0b1\n bytes[8] = (bytes[8] & 0x3f) | 0x80;\n\n const value = hexlify(bytes);\n\n return [\n value.substring(2, 10),\n value.substring(10, 14),\n value.substring(14, 18),\n value.substring(18, 22),\n value.substring(22, 34),\n ].join(\"-\");\n}\n*/\n//# sourceMappingURL=utils.js.map","/**\n * The JSON Wallet formats allow a simple way to store the private\n * keys needed in Ethereum along with related information and allows\n * for extensible forms of encryption.\n *\n * These utilities facilitate decrypting and encrypting the most common\n * JSON Wallet formats.\n *\n * @_subsection: api/wallet:JSON Wallets [json-wallets]\n */\nimport { CTR } from \"aes-js\";\nimport { getAddress } from \"../address/index.js\";\nimport { keccak256, pbkdf2, randomBytes, scrypt, scryptSync } from \"../crypto/index.js\";\nimport { computeAddress } from \"../transaction/index.js\";\nimport { concat, getBytes, hexlify, uuidV4, assert, assertArgument } from \"../utils/index.js\";\nimport { getPassword, spelunk, zpad } from \"./utils.js\";\nimport { version } from \"../_version.js\";\nconst defaultPath = \"m/44'/60'/0'/0/0\";\n/**\n * Returns true if %%json%% is a valid JSON Keystore Wallet.\n */\nexport function isKeystoreJson(json) {\n try {\n const data = JSON.parse(json);\n const version = ((data.version != null) ? parseInt(data.version) : 0);\n if (version === 3) {\n return true;\n }\n }\n catch (error) { }\n return false;\n}\nfunction decrypt(data, key, ciphertext) {\n const cipher = spelunk(data, \"crypto.cipher:string\");\n if (cipher === \"aes-128-ctr\") {\n const iv = spelunk(data, \"crypto.cipherparams.iv:data!\");\n const aesCtr = new CTR(key, iv);\n return hexlify(aesCtr.decrypt(ciphertext));\n }\n assert(false, \"unsupported cipher\", \"UNSUPPORTED_OPERATION\", {\n operation: \"decrypt\"\n });\n}\nfunction getAccount(data, _key) {\n const key = getBytes(_key);\n const ciphertext = spelunk(data, \"crypto.ciphertext:data!\");\n const computedMAC = hexlify(keccak256(concat([key.slice(16, 32), ciphertext]))).substring(2);\n assertArgument(computedMAC === spelunk(data, \"crypto.mac:string!\").toLowerCase(), \"incorrect password\", \"password\", \"[ REDACTED ]\");\n const privateKey = decrypt(data, key.slice(0, 16), ciphertext);\n const address = computeAddress(privateKey);\n if (data.address) {\n let check = data.address.toLowerCase();\n if (!check.startsWith(\"0x\")) {\n check = \"0x\" + check;\n }\n assertArgument(getAddress(check) === address, \"keystore address/privateKey mismatch\", \"address\", data.address);\n }\n const account = { address, privateKey };\n // Version 0.1 x-ethers metadata must contain an encrypted mnemonic phrase\n const version = spelunk(data, \"x-ethers.version:string\");\n if (version === \"0.1\") {\n const mnemonicKey = key.slice(32, 64);\n const mnemonicCiphertext = spelunk(data, \"x-ethers.mnemonicCiphertext:data!\");\n const mnemonicIv = spelunk(data, \"x-ethers.mnemonicCounter:data!\");\n const mnemonicAesCtr = new CTR(mnemonicKey, mnemonicIv);\n account.mnemonic = {\n path: (spelunk(data, \"x-ethers.path:string\") || defaultPath),\n locale: (spelunk(data, \"x-ethers.locale:string\") || \"en\"),\n entropy: hexlify(getBytes(mnemonicAesCtr.decrypt(mnemonicCiphertext)))\n };\n }\n return account;\n}\nfunction getDecryptKdfParams(data) {\n const kdf = spelunk(data, \"crypto.kdf:string\");\n if (kdf && typeof (kdf) === \"string\") {\n if (kdf.toLowerCase() === \"scrypt\") {\n const salt = spelunk(data, \"crypto.kdfparams.salt:data!\");\n const N = spelunk(data, \"crypto.kdfparams.n:int!\");\n const r = spelunk(data, \"crypto.kdfparams.r:int!\");\n const p = spelunk(data, \"crypto.kdfparams.p:int!\");\n // Make sure N is a power of 2\n assertArgument(N > 0 && (N & (N - 1)) === 0, \"invalid kdf.N\", \"kdf.N\", N);\n assertArgument(r > 0 && p > 0, \"invalid kdf\", \"kdf\", kdf);\n const dkLen = spelunk(data, \"crypto.kdfparams.dklen:int!\");\n assertArgument(dkLen === 32, \"invalid kdf.dklen\", \"kdf.dflen\", dkLen);\n return { name: \"scrypt\", salt, N, r, p, dkLen: 64 };\n }\n else if (kdf.toLowerCase() === \"pbkdf2\") {\n const salt = spelunk(data, \"crypto.kdfparams.salt:data!\");\n const prf = spelunk(data, \"crypto.kdfparams.prf:string!\");\n const algorithm = prf.split(\"-\").pop();\n assertArgument(algorithm === \"sha256\" || algorithm === \"sha512\", \"invalid kdf.pdf\", \"kdf.pdf\", prf);\n const count = spelunk(data, \"crypto.kdfparams.c:int!\");\n const dkLen = spelunk(data, \"crypto.kdfparams.dklen:int!\");\n assertArgument(dkLen === 32, \"invalid kdf.dklen\", \"kdf.dklen\", dkLen);\n return { name: \"pbkdf2\", salt, count, dkLen, algorithm };\n }\n }\n assertArgument(false, \"unsupported key-derivation function\", \"kdf\", kdf);\n}\n/**\n * Returns the account details for the JSON Keystore Wallet %%json%%\n * using %%password%%.\n *\n * It is preferred to use the [async version](decryptKeystoreJson)\n * instead, which allows a [[ProgressCallback]] to keep the user informed\n * as to the decryption status.\n *\n * This method will block the event loop (freezing all UI) until decryption\n * is complete, which can take quite some time, depending on the wallet\n * paramters and platform.\n */\nexport function decryptKeystoreJsonSync(json, _password) {\n const data = JSON.parse(json);\n const password = getPassword(_password);\n const params = getDecryptKdfParams(data);\n if (params.name === \"pbkdf2\") {\n const { salt, count, dkLen, algorithm } = params;\n const key = pbkdf2(password, salt, count, dkLen, algorithm);\n return getAccount(data, key);\n }\n assert(params.name === \"scrypt\", \"cannot be reached\", \"UNKNOWN_ERROR\", { params });\n const { salt, N, r, p, dkLen } = params;\n const key = scryptSync(password, salt, N, r, p, dkLen);\n return getAccount(data, key);\n}\nfunction stall(duration) {\n return new Promise((resolve) => { setTimeout(() => { resolve(); }, duration); });\n}\n/**\n * Resolves to the decrypted JSON Keystore Wallet %%json%% using the\n * %%password%%.\n *\n * If provided, %%progress%% will be called periodically during the\n * decrpytion to provide feedback, and if the function returns\n * ``false`` will halt decryption.\n *\n * The %%progressCallback%% will **always** receive ``0`` before\n * decryption begins and ``1`` when complete.\n */\nexport async function decryptKeystoreJson(json, _password, progress) {\n const data = JSON.parse(json);\n const password = getPassword(_password);\n const params = getDecryptKdfParams(data);\n if (params.name === \"pbkdf2\") {\n if (progress) {\n progress(0);\n await stall(0);\n }\n const { salt, count, dkLen, algorithm } = params;\n const key = pbkdf2(password, salt, count, dkLen, algorithm);\n if (progress) {\n progress(1);\n await stall(0);\n }\n return getAccount(data, key);\n }\n assert(params.name === \"scrypt\", \"cannot be reached\", \"UNKNOWN_ERROR\", { params });\n const { salt, N, r, p, dkLen } = params;\n const key = await scrypt(password, salt, N, r, p, dkLen, progress);\n return getAccount(data, key);\n}\nfunction getEncryptKdfParams(options) {\n // Check/generate the salt\n const salt = (options.salt != null) ? getBytes(options.salt, \"options.salt\") : randomBytes(32);\n // Override the scrypt password-based key derivation function parameters\n let N = (1 << 17), r = 8, p = 1;\n if (options.scrypt) {\n if (options.scrypt.N) {\n N = options.scrypt.N;\n }\n if (options.scrypt.r) {\n r = options.scrypt.r;\n }\n if (options.scrypt.p) {\n p = options.scrypt.p;\n }\n }\n assertArgument(typeof (N) === \"number\" && N > 0 && Number.isSafeInteger(N) && (BigInt(N) & BigInt(N - 1)) === BigInt(0), \"invalid scrypt N parameter\", \"options.N\", N);\n assertArgument(typeof (r) === \"number\" && r > 0 && Number.isSafeInteger(r), \"invalid scrypt r parameter\", \"options.r\", r);\n assertArgument(typeof (p) === \"number\" && p > 0 && Number.isSafeInteger(p), \"invalid scrypt p parameter\", \"options.p\", p);\n return { name: \"scrypt\", dkLen: 32, salt, N, r, p };\n}\nfunction _encryptKeystore(key, kdf, account, options) {\n const privateKey = getBytes(account.privateKey, \"privateKey\");\n // Override initialization vector\n const iv = (options.iv != null) ? getBytes(options.iv, \"options.iv\") : randomBytes(16);\n assertArgument(iv.length === 16, \"invalid options.iv length\", \"options.iv\", options.iv);\n // Override the uuid\n const uuidRandom = (options.uuid != null) ? getBytes(options.uuid, \"options.uuid\") : randomBytes(16);\n assertArgument(uuidRandom.length === 16, \"invalid options.uuid length\", \"options.uuid\", options.iv);\n // This will be used to encrypt the wallet (as per Web3 secret storage)\n // - 32 bytes As normal for the Web3 secret storage (derivedKey, macPrefix)\n // - 32 bytes AES key to encrypt mnemonic with (required here to be Ethers Wallet)\n const derivedKey = key.slice(0, 16);\n const macPrefix = key.slice(16, 32);\n // Encrypt the private key\n const aesCtr = new CTR(derivedKey, iv);\n const ciphertext = getBytes(aesCtr.encrypt(privateKey));\n // Compute the message authentication code, used to check the password\n const mac = keccak256(concat([macPrefix, ciphertext]));\n // See: https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition\n const data = {\n address: account.address.substring(2).toLowerCase(),\n id: uuidV4(uuidRandom),\n version: 3,\n Crypto: {\n cipher: \"aes-128-ctr\",\n cipherparams: {\n iv: hexlify(iv).substring(2),\n },\n ciphertext: hexlify(ciphertext).substring(2),\n kdf: \"scrypt\",\n kdfparams: {\n salt: hexlify(kdf.salt).substring(2),\n n: kdf.N,\n dklen: 32,\n p: kdf.p,\n r: kdf.r\n },\n mac: mac.substring(2)\n }\n };\n // If we have a mnemonic, encrypt it into the JSON wallet\n if (account.mnemonic) {\n const client = (options.client != null) ? options.client : `ethers/${version}`;\n const path = account.mnemonic.path || defaultPath;\n const locale = account.mnemonic.locale || \"en\";\n const mnemonicKey = key.slice(32, 64);\n const entropy = getBytes(account.mnemonic.entropy, \"account.mnemonic.entropy\");\n const mnemonicIv = randomBytes(16);\n const mnemonicAesCtr = new CTR(mnemonicKey, mnemonicIv);\n const mnemonicCiphertext = getBytes(mnemonicAesCtr.encrypt(entropy));\n const now = new Date();\n const timestamp = (now.getUTCFullYear() + \"-\" +\n zpad(now.getUTCMonth() + 1, 2) + \"-\" +\n zpad(now.getUTCDate(), 2) + \"T\" +\n zpad(now.getUTCHours(), 2) + \"-\" +\n zpad(now.getUTCMinutes(), 2) + \"-\" +\n zpad(now.getUTCSeconds(), 2) + \".0Z\");\n const gethFilename = (\"UTC--\" + timestamp + \"--\" + data.address);\n data[\"x-ethers\"] = {\n client, gethFilename, path, locale,\n mnemonicCounter: hexlify(mnemonicIv).substring(2),\n mnemonicCiphertext: hexlify(mnemonicCiphertext).substring(2),\n version: \"0.1\"\n };\n }\n return JSON.stringify(data);\n}\n/**\n * Return the JSON Keystore Wallet for %%account%% encrypted with\n * %%password%%.\n *\n * The %%options%% can be used to tune the password-based key\n * derivation function parameters, explicitly set the random values\n * used. Any provided [[ProgressCallback]] is ignord.\n */\nexport function encryptKeystoreJsonSync(account, password, options) {\n if (options == null) {\n options = {};\n }\n const passwordBytes = getPassword(password);\n const kdf = getEncryptKdfParams(options);\n const key = scryptSync(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64);\n return _encryptKeystore(getBytes(key), kdf, account, options);\n}\n/**\n * Resolved to the JSON Keystore Wallet for %%account%% encrypted\n * with %%password%%.\n *\n * The %%options%% can be used to tune the password-based key\n * derivation function parameters, explicitly set the random values\n * used and provide a [[ProgressCallback]] to receive periodic updates\n * on the completion status..\n */\nexport async function encryptKeystoreJson(account, password, options) {\n if (options == null) {\n options = {};\n }\n const passwordBytes = getPassword(password);\n const kdf = getEncryptKdfParams(options);\n const key = await scrypt(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64, options.progressCallback);\n return _encryptKeystore(getBytes(key), kdf, account, options);\n}\n//# sourceMappingURL=json-keystore.js.map","/**\n * Explain HD Wallets..\n *\n * @_subsection: api/wallet:HD Wallets [hd-wallets]\n */\nimport { computeHmac, randomBytes, ripemd160, SigningKey, sha256 } from \"../crypto/index.js\";\nimport { VoidSigner } from \"../providers/index.js\";\nimport { computeAddress } from \"../transaction/index.js\";\nimport { concat, dataSlice, decodeBase58, defineProperties, encodeBase58, getBytes, hexlify, isBytesLike, getNumber, toBeArray, toBigInt, toBeHex, assertPrivate, assert, assertArgument } from \"../utils/index.js\";\nimport { LangEn } from \"../wordlists/lang-en.js\";\nimport { BaseWallet } from \"./base-wallet.js\";\nimport { Mnemonic } from \"./mnemonic.js\";\nimport { encryptKeystoreJson, encryptKeystoreJsonSync, } from \"./json-keystore.js\";\n/**\n * The default derivation path for Ethereum HD Nodes. (i.e. ``\"m/44'/60'/0'/0/0\"``)\n */\nexport const defaultPath = \"m/44'/60'/0'/0/0\";\n// \"Bitcoin seed\"\nconst MasterSecret = new Uint8Array([66, 105, 116, 99, 111, 105, 110, 32, 115, 101, 101, 100]);\nconst HardenedBit = 0x80000000;\nconst N = BigInt(\"0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141\");\nconst Nibbles = \"0123456789abcdef\";\nfunction zpad(value, length) {\n let result = \"\";\n while (value) {\n result = Nibbles[value % 16] + result;\n value = Math.trunc(value / 16);\n }\n while (result.length < length * 2) {\n result = \"0\" + result;\n }\n return \"0x\" + result;\n}\nfunction encodeBase58Check(_value) {\n const value = getBytes(_value);\n const check = dataSlice(sha256(sha256(value)), 0, 4);\n const bytes = concat([value, check]);\n return encodeBase58(bytes);\n}\nconst _guard = {};\nfunction ser_I(index, chainCode, publicKey, privateKey) {\n const data = new Uint8Array(37);\n if (index & HardenedBit) {\n assert(privateKey != null, \"cannot derive child of neutered node\", \"UNSUPPORTED_OPERATION\", {\n operation: \"deriveChild\"\n });\n // Data = 0x00 || ser_256(k_par)\n data.set(getBytes(privateKey), 1);\n }\n else {\n // Data = ser_p(point(k_par))\n data.set(getBytes(publicKey));\n }\n // Data += ser_32(i)\n for (let i = 24; i >= 0; i -= 8) {\n data[33 + (i >> 3)] = ((index >> (24 - i)) & 0xff);\n }\n const I = getBytes(computeHmac(\"sha512\", chainCode, data));\n return { IL: I.slice(0, 32), IR: I.slice(32) };\n}\nfunction derivePath(node, path) {\n const components = path.split(\"/\");\n assertArgument(components.length > 0, \"invalid path\", \"path\", path);\n if (components[0] === \"m\") {\n assertArgument(node.depth === 0, `cannot derive root path (i.e. path starting with \"m/\") for a node at non-zero depth ${node.depth}`, \"path\", path);\n components.shift();\n }\n let result = node;\n for (let i = 0; i < components.length; i++) {\n const component = components[i];\n if (component.match(/^[0-9]+'$/)) {\n const index = parseInt(component.substring(0, component.length - 1));\n assertArgument(index < HardenedBit, \"invalid path index\", `path[${i}]`, component);\n result = result.deriveChild(HardenedBit + index);\n }\n else if (component.match(/^[0-9]+$/)) {\n const index = parseInt(component);\n assertArgument(index < HardenedBit, \"invalid path index\", `path[${i}]`, component);\n result = result.deriveChild(index);\n }\n else {\n assertArgument(false, \"invalid path component\", `path[${i}]`, component);\n }\n }\n return result;\n}\n/**\n * An **HDNodeWallet** is a [[Signer]] backed by the private key derived\n * from an HD Node using the [[link-bip-32]] stantard.\n *\n * An HD Node forms a hierarchal structure with each HD Node having a\n * private key and the ability to derive child HD Nodes, defined by\n * a path indicating the index of each child.\n */\nexport class HDNodeWallet extends BaseWallet {\n /**\n * The compressed public key.\n */\n publicKey;\n /**\n * The fingerprint.\n *\n * A fingerprint allows quick qay to detect parent and child nodes,\n * but developers should be prepared to deal with collisions as it\n * is only 4 bytes.\n */\n fingerprint;\n /**\n * The parent fingerprint.\n */\n parentFingerprint;\n /**\n * The mnemonic used to create this HD Node, if available.\n *\n * Sources such as extended keys do not encode the mnemonic, in\n * which case this will be ``null``.\n */\n mnemonic;\n /**\n * The chaincode, which is effectively a public key used\n * to derive children.\n */\n chainCode;\n /**\n * The derivation path of this wallet.\n *\n * Since extended keys do not provide full path details, this\n * may be ``null``, if instantiated from a source that does not\n * encode it.\n */\n path;\n /**\n * The child index of this wallet. Values over ``2 *\\* 31`` indicate\n * the node is hardened.\n */\n index;\n /**\n * The depth of this wallet, which is the number of components\n * in its path.\n */\n depth;\n /**\n * @private\n */\n constructor(guard, signingKey, parentFingerprint, chainCode, path, index, depth, mnemonic, provider) {\n super(signingKey, provider);\n assertPrivate(guard, _guard, \"HDNodeWallet\");\n defineProperties(this, { publicKey: signingKey.compressedPublicKey });\n const fingerprint = dataSlice(ripemd160(sha256(this.publicKey)), 0, 4);\n defineProperties(this, {\n parentFingerprint, fingerprint,\n chainCode, path, index, depth\n });\n defineProperties(this, { mnemonic });\n }\n connect(provider) {\n return new HDNodeWallet(_guard, this.signingKey, this.parentFingerprint, this.chainCode, this.path, this.index, this.depth, this.mnemonic, provider);\n }\n #account() {\n const account = { address: this.address, privateKey: this.privateKey };\n const m = this.mnemonic;\n if (this.path && m && m.wordlist.locale === \"en\" && m.password === \"\") {\n account.mnemonic = {\n path: this.path,\n locale: \"en\",\n entropy: m.entropy\n };\n }\n return account;\n }\n /**\n * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with\n * %%password%%.\n *\n * If %%progressCallback%% is specified, it will receive periodic\n * updates as the encryption process progreses.\n */\n async encrypt(password, progressCallback) {\n return await encryptKeystoreJson(this.#account(), password, { progressCallback });\n }\n /**\n * Returns a [JSON Keystore Wallet](json-wallets) encryped with\n * %%password%%.\n *\n * It is preferred to use the [async version](encrypt) instead,\n * which allows a [[ProgressCallback]] to keep the user informed.\n *\n * This method will block the event loop (freezing all UI) until\n * it is complete, which may be a non-trivial duration.\n */\n encryptSync(password) {\n return encryptKeystoreJsonSync(this.#account(), password);\n }\n /**\n * The extended key.\n *\n * This key will begin with the prefix ``xpriv`` and can be used to\n * reconstruct this HD Node to derive its children.\n */\n get extendedKey() {\n // We only support the mainnet values for now, but if anyone needs\n // testnet values, let me know. I believe current sentiment is that\n // we should always use mainnet, and use BIP-44 to derive the network\n // - Mainnet: public=0x0488B21E, private=0x0488ADE4\n // - Testnet: public=0x043587CF, private=0x04358394\n assert(this.depth < 256, \"Depth too deep\", \"UNSUPPORTED_OPERATION\", { operation: \"extendedKey\" });\n return encodeBase58Check(concat([\n \"0x0488ADE4\", zpad(this.depth, 1), this.parentFingerprint,\n zpad(this.index, 4), this.chainCode,\n concat([\"0x00\", this.privateKey])\n ]));\n }\n /**\n * Returns true if this wallet has a path, providing a Type Guard\n * that the path is non-null.\n */\n hasPath() { return (this.path != null); }\n /**\n * Returns a neutered HD Node, which removes the private details\n * of an HD Node.\n *\n * A neutered node has no private key, but can be used to derive\n * child addresses and other public data about the HD Node.\n */\n neuter() {\n return new HDNodeVoidWallet(_guard, this.address, this.publicKey, this.parentFingerprint, this.chainCode, this.path, this.index, this.depth, this.provider);\n }\n /**\n * Return the child for %%index%%.\n */\n deriveChild(_index) {\n const index = getNumber(_index, \"index\");\n assertArgument(index <= 0xffffffff, \"invalid index\", \"index\", index);\n // Base path\n let path = this.path;\n if (path) {\n path += \"/\" + (index & ~HardenedBit);\n if (index & HardenedBit) {\n path += \"'\";\n }\n }\n const { IR, IL } = ser_I(index, this.chainCode, this.publicKey, this.privateKey);\n const ki = new SigningKey(toBeHex((toBigInt(IL) + BigInt(this.privateKey)) % N, 32));\n return new HDNodeWallet(_guard, ki, this.fingerprint, hexlify(IR), path, index, this.depth + 1, this.mnemonic, this.provider);\n }\n /**\n * Return the HDNode for %%path%% from this node.\n */\n derivePath(path) {\n return derivePath(this, path);\n }\n static #fromSeed(_seed, mnemonic) {\n assertArgument(isBytesLike(_seed), \"invalid seed\", \"seed\", \"[REDACTED]\");\n const seed = getBytes(_seed, \"seed\");\n assertArgument(seed.length >= 16 && seed.length <= 64, \"invalid seed\", \"seed\", \"[REDACTED]\");\n const I = getBytes(computeHmac(\"sha512\", MasterSecret, seed));\n const signingKey = new SigningKey(hexlify(I.slice(0, 32)));\n return new HDNodeWallet(_guard, signingKey, \"0x00000000\", hexlify(I.slice(32)), \"m\", 0, 0, mnemonic, null);\n }\n /**\n * Creates a new HD Node from %%extendedKey%%.\n *\n * If the %%extendedKey%% will either have a prefix or ``xpub`` or\n * ``xpriv``, returning a neutered HD Node ([[HDNodeVoidWallet]])\n * or full HD Node ([[HDNodeWallet) respectively.\n */\n static fromExtendedKey(extendedKey) {\n const bytes = toBeArray(decodeBase58(extendedKey)); // @TODO: redact\n assertArgument(bytes.length === 82 || encodeBase58Check(bytes.slice(0, 78)) === extendedKey, \"invalid extended key\", \"extendedKey\", \"[ REDACTED ]\");\n const depth = bytes[4];\n const parentFingerprint = hexlify(bytes.slice(5, 9));\n const index = parseInt(hexlify(bytes.slice(9, 13)).substring(2), 16);\n const chainCode = hexlify(bytes.slice(13, 45));\n const key = bytes.slice(45, 78);\n switch (hexlify(bytes.slice(0, 4))) {\n // Public Key\n case \"0x0488b21e\":\n case \"0x043587cf\": {\n const publicKey = hexlify(key);\n return new HDNodeVoidWallet(_guard, computeAddress(publicKey), publicKey, parentFingerprint, chainCode, null, index, depth, null);\n }\n // Private Key\n case \"0x0488ade4\":\n case \"0x04358394 \":\n if (key[0] !== 0) {\n break;\n }\n return new HDNodeWallet(_guard, new SigningKey(key.slice(1)), parentFingerprint, chainCode, null, index, depth, null, null);\n }\n assertArgument(false, \"invalid extended key prefix\", \"extendedKey\", \"[ REDACTED ]\");\n }\n /**\n * Creates a new random HDNode.\n */\n static createRandom(password, path, wordlist) {\n if (password == null) {\n password = \"\";\n }\n if (path == null) {\n path = defaultPath;\n }\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n const mnemonic = Mnemonic.fromEntropy(randomBytes(16), password, wordlist);\n return HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path);\n }\n /**\n * Create an HD Node from %%mnemonic%%.\n */\n static fromMnemonic(mnemonic, path) {\n if (!path) {\n path = defaultPath;\n }\n return HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path);\n }\n /**\n * Creates an HD Node from a mnemonic %%phrase%%.\n */\n static fromPhrase(phrase, password, path, wordlist) {\n if (password == null) {\n password = \"\";\n }\n if (path == null) {\n path = defaultPath;\n }\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n const mnemonic = Mnemonic.fromPhrase(phrase, password, wordlist);\n return HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path);\n }\n /**\n * Creates an HD Node from a %%seed%%.\n */\n static fromSeed(seed) {\n return HDNodeWallet.#fromSeed(seed, null);\n }\n}\n/**\n * A **HDNodeVoidWallet** cannot sign, but provides access to\n * the children nodes of a [[link-bip-32]] HD wallet addresses.\n *\n * The can be created by using an extended ``xpub`` key to\n * [[HDNodeWallet_fromExtendedKey]] or by\n * [nuetering](HDNodeWallet-neuter) a [[HDNodeWallet]].\n */\nexport class HDNodeVoidWallet extends VoidSigner {\n /**\n * The compressed public key.\n */\n publicKey;\n /**\n * The fingerprint.\n *\n * A fingerprint allows quick qay to detect parent and child nodes,\n * but developers should be prepared to deal with collisions as it\n * is only 4 bytes.\n */\n fingerprint;\n /**\n * The parent node fingerprint.\n */\n parentFingerprint;\n /**\n * The chaincode, which is effectively a public key used\n * to derive children.\n */\n chainCode;\n /**\n * The derivation path of this wallet.\n *\n * Since extended keys do not provider full path details, this\n * may be ``null``, if instantiated from a source that does not\n * enocde it.\n */\n path;\n /**\n * The child index of this wallet. Values over ``2 *\\* 31`` indicate\n * the node is hardened.\n */\n index;\n /**\n * The depth of this wallet, which is the number of components\n * in its path.\n */\n depth;\n /**\n * @private\n */\n constructor(guard, address, publicKey, parentFingerprint, chainCode, path, index, depth, provider) {\n super(address, provider);\n assertPrivate(guard, _guard, \"HDNodeVoidWallet\");\n defineProperties(this, { publicKey });\n const fingerprint = dataSlice(ripemd160(sha256(publicKey)), 0, 4);\n defineProperties(this, {\n publicKey, fingerprint, parentFingerprint, chainCode, path, index, depth\n });\n }\n connect(provider) {\n return new HDNodeVoidWallet(_guard, this.address, this.publicKey, this.parentFingerprint, this.chainCode, this.path, this.index, this.depth, provider);\n }\n /**\n * The extended key.\n *\n * This key will begin with the prefix ``xpub`` and can be used to\n * reconstruct this neutered key to derive its children addresses.\n */\n get extendedKey() {\n // We only support the mainnet values for now, but if anyone needs\n // testnet values, let me know. I believe current sentiment is that\n // we should always use mainnet, and use BIP-44 to derive the network\n // - Mainnet: public=0x0488B21E, private=0x0488ADE4\n // - Testnet: public=0x043587CF, private=0x04358394\n assert(this.depth < 256, \"Depth too deep\", \"UNSUPPORTED_OPERATION\", { operation: \"extendedKey\" });\n return encodeBase58Check(concat([\n \"0x0488B21E\",\n zpad(this.depth, 1),\n this.parentFingerprint,\n zpad(this.index, 4),\n this.chainCode,\n this.publicKey,\n ]));\n }\n /**\n * Returns true if this wallet has a path, providing a Type Guard\n * that the path is non-null.\n */\n hasPath() { return (this.path != null); }\n /**\n * Return the child for %%index%%.\n */\n deriveChild(_index) {\n const index = getNumber(_index, \"index\");\n assertArgument(index <= 0xffffffff, \"invalid index\", \"index\", index);\n // Base path\n let path = this.path;\n if (path) {\n path += \"/\" + (index & ~HardenedBit);\n if (index & HardenedBit) {\n path += \"'\";\n }\n }\n const { IR, IL } = ser_I(index, this.chainCode, this.publicKey, null);\n const Ki = SigningKey.addPoints(IL, this.publicKey, true);\n const address = computeAddress(Ki);\n return new HDNodeVoidWallet(_guard, address, Ki, this.fingerprint, hexlify(IR), path, index, this.depth + 1, this.provider);\n }\n /**\n * Return the signer for %%path%% from this node.\n */\n derivePath(path) {\n return derivePath(this, path);\n }\n}\n/*\nexport class HDNodeWalletManager {\n #root: HDNodeWallet;\n\n constructor(phrase: string, password?: null | string, path?: null | string, locale?: null | Wordlist) {\n if (password == null) { password = \"\"; }\n if (path == null) { path = \"m/44'/60'/0'/0\"; }\n if (locale == null) { locale = LangEn.wordlist(); }\n this.#root = HDNodeWallet.fromPhrase(phrase, password, path, locale);\n }\n\n getSigner(index?: number): HDNodeWallet {\n return this.#root.deriveChild((index == null) ? 0: index);\n }\n}\n*/\n/**\n * Returns the [[link-bip-32]] path for the account at %%index%%.\n *\n * This is the pattern used by wallets like Ledger.\n *\n * There is also an [alternate pattern](getIndexedAccountPath) used by\n * some software.\n */\nexport function getAccountPath(_index) {\n const index = getNumber(_index, \"index\");\n assertArgument(index >= 0 && index < HardenedBit, \"invalid account index\", \"index\", index);\n return `m/44'/60'/${index}'/0/0`;\n}\n/**\n * Returns the path using an alternative pattern for deriving accounts,\n * at %%index%%.\n *\n * This derivation path uses the //index// component rather than the\n * //account// component to derive sequential accounts.\n *\n * This is the pattern used by wallets like MetaMask.\n */\nexport function getIndexedAccountPath(_index) {\n const index = getNumber(_index, \"index\");\n assertArgument(index >= 0 && index < HardenedBit, \"invalid account index\", \"index\", index);\n return `m/44'/60'/0'/0/${index}`;\n}\n//# sourceMappingURL=hdwallet.js.map","/**\n * @_subsection: api/wallet:JSON Wallets [json-wallets]\n */\nimport { CBC, pkcs7Strip } from \"aes-js\";\nimport { getAddress } from \"../address/index.js\";\nimport { pbkdf2 } from \"../crypto/index.js\";\nimport { id } from \"../hash/index.js\";\nimport { getBytes, assertArgument } from \"../utils/index.js\";\nimport { getPassword, looseArrayify, spelunk } from \"./utils.js\";\n/**\n * Returns true if %%json%% is a valid JSON Crowdsale wallet.\n */\nexport function isCrowdsaleJson(json) {\n try {\n const data = JSON.parse(json);\n if (data.encseed) {\n return true;\n }\n }\n catch (error) { }\n return false;\n}\n// See: https://github.com/ethereum/pyethsaletool\n/**\n * Before Ethereum launched, it was necessary to create a wallet\n * format for backers to use, which would be used to receive ether\n * as a reward for contributing to the project.\n *\n * The [[link-crowdsale]] format is now obsolete, but it is still\n * useful to support and the additional code is fairly trivial as\n * all the primitives required are used through core portions of\n * the library.\n */\nexport function decryptCrowdsaleJson(json, _password) {\n const data = JSON.parse(json);\n const password = getPassword(_password);\n // Ethereum Address\n const address = getAddress(spelunk(data, \"ethaddr:string!\"));\n // Encrypted Seed\n const encseed = looseArrayify(spelunk(data, \"encseed:string!\"));\n assertArgument(encseed && (encseed.length % 16) === 0, \"invalid encseed\", \"json\", json);\n const key = getBytes(pbkdf2(password, password, 2000, 32, \"sha256\")).slice(0, 16);\n const iv = encseed.slice(0, 16);\n const encryptedSeed = encseed.slice(16);\n // Decrypt the seed\n const aesCbc = new CBC(key, iv);\n const seed = pkcs7Strip(getBytes(aesCbc.decrypt(encryptedSeed)));\n // This wallet format is weird... Convert the binary encoded hex to a string.\n let seedHex = \"\";\n for (let i = 0; i < seed.length; i++) {\n seedHex += String.fromCharCode(seed[i]);\n }\n return { address, privateKey: id(seedHex) };\n}\n//# sourceMappingURL=json-crowdsale.js.map","import { SigningKey } from \"../crypto/index.js\";\nimport { assertArgument } from \"../utils/index.js\";\nimport { BaseWallet } from \"./base-wallet.js\";\nimport { HDNodeWallet } from \"./hdwallet.js\";\nimport { decryptCrowdsaleJson, isCrowdsaleJson } from \"./json-crowdsale.js\";\nimport { decryptKeystoreJson, decryptKeystoreJsonSync, encryptKeystoreJson, encryptKeystoreJsonSync, isKeystoreJson } from \"./json-keystore.js\";\nimport { Mnemonic } from \"./mnemonic.js\";\nfunction stall(duration) {\n return new Promise((resolve) => { setTimeout(() => { resolve(); }, duration); });\n}\n/**\n * A **Wallet** manages a single private key which is used to sign\n * transactions, messages and other common payloads.\n *\n * This class is generally the main entry point for developers\n * that wish to use a private key directly, as it can create\n * instances from a large variety of common sources, including\n * raw private key, [[link-bip-39]] mnemonics and encrypte JSON\n * wallets.\n */\nexport class Wallet extends BaseWallet {\n /**\n * Create a new wallet for the private %%key%%, optionally connected\n * to %%provider%%.\n */\n constructor(key, provider) {\n if (typeof (key) === \"string\" && !key.startsWith(\"0x\")) {\n key = \"0x\" + key;\n }\n let signingKey = (typeof (key) === \"string\") ? new SigningKey(key) : key;\n super(signingKey, provider);\n }\n connect(provider) {\n return new Wallet(this.signingKey, provider);\n }\n /**\n * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with\n * %%password%%.\n *\n * If %%progressCallback%% is specified, it will receive periodic\n * updates as the encryption process progreses.\n */\n async encrypt(password, progressCallback) {\n const account = { address: this.address, privateKey: this.privateKey };\n return await encryptKeystoreJson(account, password, { progressCallback });\n }\n /**\n * Returns a [JSON Keystore Wallet](json-wallets) encryped with\n * %%password%%.\n *\n * It is preferred to use the [async version](encrypt) instead,\n * which allows a [[ProgressCallback]] to keep the user informed.\n *\n * This method will block the event loop (freezing all UI) until\n * it is complete, which may be a non-trivial duration.\n */\n encryptSync(password) {\n const account = { address: this.address, privateKey: this.privateKey };\n return encryptKeystoreJsonSync(account, password);\n }\n static #fromAccount(account) {\n assertArgument(account, \"invalid JSON wallet\", \"json\", \"[ REDACTED ]\");\n if (\"mnemonic\" in account && account.mnemonic && account.mnemonic.locale === \"en\") {\n const mnemonic = Mnemonic.fromEntropy(account.mnemonic.entropy);\n const wallet = HDNodeWallet.fromMnemonic(mnemonic, account.mnemonic.path);\n if (wallet.address === account.address && wallet.privateKey === account.privateKey) {\n return wallet;\n }\n console.log(\"WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key\");\n }\n const wallet = new Wallet(account.privateKey);\n assertArgument(wallet.address === account.address, \"address/privateKey mismatch\", \"json\", \"[ REDACTED ]\");\n return wallet;\n }\n /**\n * Creates (asynchronously) a **Wallet** by decrypting the %%json%%\n * with %%password%%.\n *\n * If %%progress%% is provided, it is called periodically during\n * decryption so that any UI can be updated.\n */\n static async fromEncryptedJson(json, password, progress) {\n let account = null;\n if (isKeystoreJson(json)) {\n account = await decryptKeystoreJson(json, password, progress);\n }\n else if (isCrowdsaleJson(json)) {\n if (progress) {\n progress(0);\n await stall(0);\n }\n account = decryptCrowdsaleJson(json, password);\n if (progress) {\n progress(1);\n await stall(0);\n }\n }\n return Wallet.#fromAccount(account);\n }\n /**\n * Creates a **Wallet** by decrypting the %%json%% with %%password%%.\n *\n * The [[fromEncryptedJson]] method is preferred, as this method\n * will lock up and freeze the UI during decryption, which may take\n * some time.\n */\n static fromEncryptedJsonSync(json, password) {\n let account = null;\n if (isKeystoreJson(json)) {\n account = decryptKeystoreJsonSync(json, password);\n }\n else if (isCrowdsaleJson(json)) {\n account = decryptCrowdsaleJson(json, password);\n }\n else {\n assertArgument(false, \"invalid JSON wallet\", \"json\", \"[ REDACTED ]\");\n }\n return Wallet.#fromAccount(account);\n }\n /**\n * Creates a new random [[HDNodeWallet]] using the available\n * [cryptographic random source](randomBytes).\n *\n * If there is no crytographic random source, this will throw.\n */\n static createRandom(provider) {\n const wallet = HDNodeWallet.createRandom();\n if (provider) {\n return wallet.connect(provider);\n }\n return wallet;\n }\n /**\n * Creates a [[HDNodeWallet]] for %%phrase%%.\n */\n static fromPhrase(phrase, provider) {\n const wallet = HDNodeWallet.fromPhrase(phrase);\n if (provider) {\n return wallet.connect(provider);\n }\n return wallet;\n }\n}\n//# sourceMappingURL=wallet.js.map","const Base64 = \")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_\";\n/**\n * @_ignore\n */\nexport function decodeBits(width, data) {\n const maxValue = (1 << width) - 1;\n const result = [];\n let accum = 0, bits = 0, flood = 0;\n for (let i = 0; i < data.length; i++) {\n // Accumulate 6 bits of data\n accum = ((accum << 6) | Base64.indexOf(data[i]));\n bits += 6;\n // While we have enough for a word...\n while (bits >= width) {\n // ...read the word\n const value = (accum >> (bits - width));\n accum &= (1 << (bits - width)) - 1;\n bits -= width;\n // A value of 0 indicates we exceeded maxValue, it\n // floods over into the next value\n if (value === 0) {\n flood += maxValue;\n }\n else {\n result.push(value + flood);\n flood = 0;\n }\n }\n }\n return result;\n}\n//# sourceMappingURL=bit-reader.js.map","import { assertArgument } from \"../utils/index.js\";\nimport { decodeBits } from \"./bit-reader.js\";\nimport { decodeOwl } from \"./decode-owl.js\";\n/**\n * @_ignore\n */\nexport function decodeOwlA(data, accents) {\n let words = decodeOwl(data).join(\",\");\n // Inject the accents\n accents.split(/,/g).forEach((accent) => {\n const match = accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);\n assertArgument(match !== null, \"internal error parsing accents\", \"accents\", accents);\n let posOffset = 0;\n const positions = decodeBits(parseInt(match[3]), match[4]);\n const charCode = parseInt(match[2]);\n const regex = new RegExp(`([${match[1]}])`, \"g\");\n words = words.replace(regex, (all, letter) => {\n const rem = --positions[posOffset];\n if (rem === 0) {\n letter = String.fromCharCode(letter.charCodeAt(0), charCode);\n posOffset++;\n }\n return letter;\n });\n });\n return words.split(\",\");\n}\n//# sourceMappingURL=decode-owla.js.map","import { WordlistOwl } from \"./wordlist-owl.js\";\nimport { decodeOwlA } from \"./decode-owla.js\";\n/**\n * An OWL-A format Wordlist extends the OWL format to add an\n * overlay onto an OWL format Wordlist to support diacritic\n * marks.\n *\n * This class is generally not useful to most developers as\n * it is used mainly internally to keep Wordlists for languages\n * based on latin-1 small.\n *\n * If necessary, there are tools within the ``generation/`` folder\n * to create the necessary data.\n */\nexport class WordlistOwlA extends WordlistOwl {\n #accent;\n /**\n * Creates a new Wordlist for %%locale%% using the OWLA %%data%%\n * and %%accent%% data and validated against the %%checksum%%.\n */\n constructor(locale, data, accent, checksum) {\n super(locale, data, checksum);\n this.#accent = accent;\n }\n /**\n * The OWLA-encoded accent data.\n */\n get _accent() { return this.#accent; }\n /**\n * Decode all the words for the wordlist.\n */\n _decodeWords() {\n return decodeOwlA(this._data, this._accent);\n }\n}\n//# sourceMappingURL=wordlist-owla.js.map","import { LangEn } from \"./lang-en.js\";\nexport const wordlists = {\n en: LangEn.wordlist(),\n};\n//# sourceMappingURL=wordlists-browser.js.map","/////////////////////////////\n//\nexport { version } from \"./_version.js\";\nexport { decodeBytes32String, encodeBytes32String, AbiCoder, ConstructorFragment, ErrorFragment, EventFragment, Fragment, FallbackFragment, FunctionFragment, NamedFragment, ParamType, StructFragment, checkResultErrors, ErrorDescription, Indexed, Interface, LogDescription, Result, TransactionDescription, Typed, } from \"./abi/index.js\";\nexport { getAddress, getIcapAddress, getCreateAddress, getCreate2Address, isAddressable, isAddress, resolveAddress } from \"./address/index.js\";\nexport { ZeroAddress, WeiPerEther, MaxUint256, MinInt256, MaxInt256, N, ZeroHash, EtherSymbol, MessagePrefix } from \"./constants/index.js\";\nexport { BaseContract, Contract, ContractFactory, ContractEventPayload, ContractTransactionReceipt, ContractTransactionResponse, ContractUnknownEventPayload, EventLog, UndecodedEventLog } from \"./contract/index.js\";\nexport { computeHmac, randomBytes, keccak256, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync, lock, Signature, SigningKey } from \"./crypto/index.js\";\nexport { id, ensNormalize, isValidName, namehash, dnsEncode, hashAuthorization, verifyAuthorization, hashMessage, verifyMessage, solidityPacked, solidityPackedKeccak256, solidityPackedSha256, TypedDataEncoder, verifyTypedData } from \"./hash/index.js\";\nexport { getDefaultProvider, Block, FeeData, Log, TransactionReceipt, TransactionResponse, AbstractSigner, NonceManager, VoidSigner, AbstractProvider, FallbackProvider, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, BrowserProvider, AlchemyProvider, AnkrProvider, BlockscoutProvider, ChainstackProvider, CloudflareProvider, EtherscanProvider, InfuraProvider, InfuraWebSocketProvider, PocketProvider, QuickNodeProvider, IpcSocketProvider, SocketProvider, WebSocketProvider, EnsResolver, Network, EnsPlugin, EtherscanPlugin, FeeDataNetworkPlugin, FetchUrlFeeDataNetworkPlugin, GasCostPlugin, NetworkPlugin, MulticoinProviderPlugin, SocketBlockSubscriber, SocketEventSubscriber, SocketPendingSubscriber, SocketSubscriber, UnmanagedSubscriber, copyRequest, showThrottleMessage } from \"./providers/index.js\";\nexport { accessListify, authorizationify, computeAddress, recoverAddress, Transaction } from \"./transaction/index.js\";\nexport { decodeBase58, encodeBase58, decodeBase64, encodeBase64, concat, dataLength, dataSlice, getBytes, getBytesCopy, hexlify, isHexString, isBytesLike, stripZerosLeft, zeroPadBytes, zeroPadValue, defineProperties, resolveProperties, assert, assertArgument, assertArgumentCount, assertNormalize, assertPrivate, makeError, isCallException, isError, EventPayload, FetchRequest, FetchResponse, FetchCancelSignal, FixedNumber, getBigInt, getNumber, getUint, toBeArray, toBigInt, toBeHex, toNumber, toQuantity, fromTwos, toTwos, mask, formatEther, parseEther, formatUnits, parseUnits, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, decodeRlp, encodeRlp, uuidV4, } from \"./utils/index.js\";\nexport { Mnemonic, BaseWallet, HDNodeWallet, HDNodeVoidWallet, Wallet, defaultPath, getAccountPath, getIndexedAccountPath, isCrowdsaleJson, isKeystoreJson, decryptCrowdsaleJson, decryptKeystoreJsonSync, decryptKeystoreJson, encryptKeystoreJson, encryptKeystoreJsonSync, } from \"./wallet/index.js\";\nexport { Wordlist, LangEn, WordlistOwl, WordlistOwlA, wordlists } from \"./wordlists/index.js\";\n// dummy change; to pick-up ws security issue changes\n//# sourceMappingURL=ethers.js.map"],"names":["stringify","BN_0","BN_1","Nibbles","locked","getTime","_guard","Zeros","parseUnits","passProperties","getValue","crypto","u8a","utf8ToBytes","concatBytes","randomBytes","hash","assertHash","assertExists","assertBytes","assertNumber","pbkdf2","sha256","split","sha512","getGlobal","_0n","_1n","_2n","rotl","ripemd160","noble_ripemd160","crypto_random","scrypt","_nobleAsync","_nobleSync","H","_3n","ut.validateObject","ut.concatBytes","ut.bytesToHex","ut.bytesToNumberBE","mod.mod","mod.invert","ut.numberToBytesBE","ut.hexToBytes","mod.getMinHashLength","mod.mapHashToField","ut.bitMask","ut.createHmacDrbg","N","BN_2","BN_27","BN_28","BN_35","inspect","BN_MAX_UINT256","T1","_keccak256","_sha256","internal","PanicReasons","copy","isPromise","defaultOptions","stall","defaultApiKey","getHost","__classPrivateFieldGet","this","__classPrivateFieldSet","zpad","defaultPath"],"mappings":";AAAA;AACA;AACA;AACA;AACY,MAAC,OAAO,GAAG;;ACJvB;AACA;AACA;AACA;AACA;AACA,SAAS,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE;AACtC,IAAI,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AACrD,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC3C,QAAQ,QAAQ,IAAI;AACpB,YAAY,KAAK,KAAK;AACtB,gBAAgB,OAAO;AACvB,YAAY,KAAK,QAAQ,CAAC;AAC1B,YAAY,KAAK,SAAS,CAAC;AAC3B,YAAY,KAAK,QAAQ,CAAC;AAC1B,YAAY,KAAK,QAAQ;AACzB,gBAAgB,IAAI,QAAQ,KAAK,CAAC,KAAK,IAAI,EAAE;AAC7C,oBAAoB,OAAO;AAC3B,iBAAiB;AACjB,SAAS;AACT,KAAK;AACL,IAAI,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,CAAC,uBAAuB,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AAC9D,IAAI,KAAK,CAAC,IAAI,GAAG,kBAAkB,CAAC;AACpC,IAAI,KAAK,CAAC,QAAQ,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;AACrC,IAAI,KAAK,CAAC,KAAK,G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K;AACL;AACA;AACA;AACA,IAAI,YAAY,GAAG;AACnB,QAAQ,OAAO,sBAAsB,CAAC,IAAI,CAAC,CAAC;AAC5C,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,kBAAkB,CAAC;AAChC;AACA;AACA;AACA;AACA,IAAI,QAAQ,CAAC;AACb;AACA;AACA;AACA,IAAI,EAAE,CAAC;AACP;AACA;AACA;AACA,IAAI,IAAI,CAAC;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,eAAe,CAAC;AACpB;AACA;AACA;AACA,IAAI,IAAI,CAAC;AACT;AACA;AACA;AACA,IAAI,KAAK,CAAC;AACV;AACA;AACA;AACA,IAAI,SAAS,CAAC;AACd;AACA;AACA;AACA,IAAI,WAAW,CAAC;AAChB;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,CAAC;AACZ;AACA;AACA;AACA,IAAI,WAAW,CAAC;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,iBAAiB,CAAC;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,QAAQ,CAAC;AACb;AACA;AACA;AACA,IAAI,YAAY,CAAC;AACjB;AACA;AACA;AACA,IAAI,IAAI,CAAC;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,CAAC;AACX;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,CAAC;AACT,IAAI,KAAK,CAAC;AACV;AACA;AACA;AACA,IAAI,WAAW,CAAC,EAAE,EAAE,QAAQ,EAAE;AAC9B,QAAQ,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK;AACxD,YAAY,OAAO,IA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;AACL;AACA;AACA;AACA,IAAI,cAAc,CAAC,KAAK,EAAE;AAC1B,QAAQ,MAAM,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,OAAO,EAAE,EAAE,+CAA+C,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC,CAAC;AAC5J,QAAQ,OAAO,gCAAgC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAC7D,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,mBAAmB,CAAC;AACjC;AACA;AACA;AACA;AACA,IAAI,QAAQ,CAAC;AACb;AACA;AACA;AACA;AACA;AACA,IAAI,WAAW,CAAC;AAChB;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC;AACd;AACA;AACA;AACA,IAAI,KAAK,CAAC;AACV;AACA;AACA;AACA,IAAI,IAAI,CAAC;AACT;AACA;AACA;AACA;AACA,IAAI,IAAI,CAAC;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,EAAE,CAAC;AACP;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,CAAC;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,KAAK,CAAC;AACV;AACA;AACA;AACA;AACA;AACA,IAAI,QAAQ,CAAC;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,QAAQ,CAAC;AACb;AACA;AACA;AACA;AACA;AACA,IAAI,oBAAoB,CAAC;AACzB;AACA;AACA;AACA;AACA,IAAI,YAAY,CAAC;AACjB;AACA;AACA;AACA,IAAI,gBAAgB,CAAC;AACrB;AACA;AACA;AACA,IAAI,IAAI,CAAC;AACT;AACA;AACA;AACA;AACA,IAAI,KAAK,CAAC;AACV;AACA;AACA;AACA,IAAI,OAAO,CAAC;AACZ;AACA;AACA;AACA,IAAI,SAAS,CAAC;AACd;AACA;AACA;AACA;AACA,IAAI,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AACzB;;ACHA;AACA;AAaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[17,18,19,20,21,22,23,24,25,28,30,34,37,38,39,40,41,42,70,116,117,118,119,120]} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/dist/ethers.min.js b/tools/mnemonic-test/node_modules/ethers/dist/ethers.min.js deleted file mode 100644 index 14e54e9f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/dist/ethers.min.js +++ /dev/null @@ -1 +0,0 @@ -const __$G=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};const version="6.16.0";function checkType(value,type,name){const types=type.split("|").map(t=>t.trim());for(let i=0;iPromise.resolve(value[k])));return results.reduce((accum,v,index)=>{accum[keys[index]]=v;return accum},{})}function defineProperties(target,values,types){for(let key in values){let value=values[key];const type=types?types[key]:null;if(type){checkType(value,type,key)}Object.defineProperty(target,key,{enumerable:true,value:value,writable:false})}}function stringify$1(value,seen){if(value==null){return"null"}if(seen==null){seen=new Set}if(typeof value==="object"){if(seen.has(value)){return"[Circular]"}seen.add(value)}if(Array.isArray(value)){return"[ "+value.map(v=>stringify$1(v,seen)).join(", ")+" ]"}if(value instanceof Uint8Array){const HEX="0123456789abcdef";let result="0x";for(let i=0;i>4];result+=HEX[value[i]&15]}return result}if(typeof value==="object"&&typeof value.toJSON==="function"){return stringify$1(value.toJSON(),seen)}switch(typeof value){case"boolean":case"number":case"symbol":return value.toString();case"bigint":return BigInt(value).toString();case"string":return JSON.stringify(value);case"object":{const keys=Object.keys(value);keys.sort();return"{ "+keys.map(k=>`${stringify$1(k,seen)}: ${stringify$1(value[k],seen)}`).join(", ")+" }"}}return`[ COULD NOT SERIALIZE ]`}function isError(error,code){return error&&error.code===code}function isCallException(error){return isError(error,"CALL_EXCEPTION")}function makeError(message,code,info){let shortMessage=message;{const details=[];if(info){if("message"in info||"code"in info||"name"in info){throw new Error(`value will overwrite populated values: ${stringify$1(info)}`)}for(const key in info){if(key==="shortMessage"){continue}const value=info[key];details.push(key+"="+stringify$1(value))}}details.push(`code=${code}`);details.push(`version=${version}`);if(details.length){message+=" ("+details.join(", ")+")"}}let error;switch(code){case"INVALID_ARGUMENT":error=new TypeError(message);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":error=new RangeError(message);break;default:error=new Error(message)}defineProperties(error,{code:code});if(info){Object.assign(error,info)}if(error.shortMessage==null){defineProperties(error,{shortMessage:shortMessage})}return error}function assert(check,message,code,info){if(!check){throw makeError(message,code,info)}}function assertArgument(check,message,name,value){assert(check,message,"INVALID_ARGUMENT",{argument:name,value:value})}function assertArgumentCount(count,expectedCount,message){if(message==null){message=""}if(message){message=": "+message}assert(count>=expectedCount,"missing argument"+message,"MISSING_ARGUMENT",{count:count,expectedCount:expectedCount});assert(count<=expectedCount,"too many arguments"+message,"UNEXPECTED_ARGUMENT",{count:count,expectedCount:expectedCount})}const _normalizeForms=["NFD","NFC","NFKD","NFKC"].reduce((accum,form)=>{try{if("test".normalize(form)!=="test"){throw new Error("bad")}if(form==="NFD"){const check=String.fromCharCode(233).normalize("NFD");const expected=String.fromCharCode(101,769);if(check!==expected){throw new Error("broken")}}accum.push(form)}catch(error){}return accum},[]);function assertNormalize(form){assert(_normalizeForms.indexOf(form)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:form}})}function assertPrivate(givenGuard,guard,className){if(className==null){className=""}if(givenGuard!==guard){let method=className,operation="new";if(className){method+=".";operation+=" "+className}assert(false,`private constructor; use ${method}from* methods`,"UNSUPPORTED_OPERATION",{operation:operation})}}function _getBytes(value,name,copy){if(value instanceof Uint8Array){if(copy){return new Uint8Array(value)}return value}if(typeof value==="string"&&value.length%2===0&&value.match(/^0x[0-9a-f]*$/i)){const result=new Uint8Array((value.length-2)/2);let offset=2;for(let i=0;i>4]+HexCharacters[v&15]}return result}function concat(datas){return"0x"+datas.map(d=>hexlify(d).substring(2)).join("")}function dataLength(data){if(isHexString(data,true)){return(data.length-2)/2}return getBytes(data).length}function dataSlice(data,start,end){const bytes=getBytes(data);if(end!=null&&end>bytes.length){assert(false,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:bytes,length:bytes.length,offset:end})}return hexlify(bytes.slice(start==null?0:start,end==null?bytes.length:end))}function stripZerosLeft(data){let bytes=hexlify(data).substring(2);while(bytes.startsWith("00")){bytes=bytes.substring(2)}return"0x"+bytes}function zeroPad(data,length,left){const bytes=getBytes(data);assert(length>=bytes.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(bytes),length:length,offset:length+1});const result=new Uint8Array(length);result.fill(0);if(left){result.set(bytes,length-bytes.length)}else{result.set(bytes,0)}return hexlify(result)}function zeroPadValue(data,length){return zeroPad(data,length,true)}function zeroPadBytes(data,length){return zeroPad(data,length,false)}const BN_0$a=BigInt(0);const BN_1$5=BigInt(1);const maxValue=9007199254740991;function fromTwos(_value,_width){const value=getUint(_value,"value");const width=BigInt(getNumber(_width,"width"));assert(value>>width===BN_0$a,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:_value});if(value>>width-BN_1$5){const mask=(BN_1$5<=-maxValue&&value<=maxValue,"overflow",name||"value",value);return BigInt(value);case"string":try{if(value===""){throw new Error("empty string")}if(value[0]==="-"&&value[1]!=="-"){return-BigInt(value.substring(1))}return BigInt(value)}catch(e){assertArgument(false,`invalid BigNumberish string: ${e.message}`,name||"value",value)}}assertArgument(false,"invalid BigNumberish value",name||"value",value)}function getUint(value,name){const result=getBigInt(value,name);assert(result>=BN_0$a,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:value});return result}const Nibbles$1="0123456789abcdef";function toBigInt(value){if(value instanceof Uint8Array){let result="0x0";for(const v of value){result+=Nibbles$1[v>>4];result+=Nibbles$1[v&15]}return BigInt(result)}return getBigInt(value)}function getNumber(value,name){switch(typeof value){case"bigint":assertArgument(value>=-maxValue&&value<=maxValue,"overflow",name||"value",value);return Number(value);case"number":assertArgument(Number.isInteger(value),"underflow",name||"value",value);assertArgument(value>=-maxValue&&value<=maxValue,"overflow",name||"value",value);return value;case"string":try{if(value===""){throw new Error("empty string")}return getNumber(BigInt(value),name)}catch(e){assertArgument(false,`invalid numeric string: ${e.message}`,name||"value",value)}}assertArgument(false,"invalid numeric value",name||"value",value)}function toNumber(value){return getNumber(toBigInt(value))}function toBeHex(_value,_width){const value=getUint(_value,"value");let result=value.toString(16);if(_width==null){if(result.length%2){result="0"+result}}else{const width=getNumber(_width,"width");if(width===0&&value===BN_0$a){return"0x"}assert(width*2>=result.length,`value exceeds width (${width} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:_value});while(result.length>6!==2){break}i++}return i}if(reason==="OVERRUN"){return bytes.length-offset-1}return 0}function replaceFunc(reason,offset,bytes,output,badCodepoint){if(reason==="OVERLONG"){assertArgument(typeof badCodepoint==="number","invalid bad code point for replacement","badCodepoint",badCodepoint);output.push(badCodepoint);return 0}output.push(65533);return ignoreFunc(reason,offset,bytes)}const Utf8ErrorFuncs=Object.freeze({error:errorFunc,ignore:ignoreFunc,replace:replaceFunc});function getUtf8CodePoints(_bytes,onError){if(onError==null){onError=Utf8ErrorFuncs.error}const bytes=getBytes(_bytes,"bytes");const result=[];let i=0;while(i>7===0){result.push(c);continue}let extraLength=null;let overlongMask=null;if((c&224)===192){extraLength=1;overlongMask=127}else if((c&240)===224){extraLength=2;overlongMask=2047}else if((c&248)===240){extraLength=3;overlongMask=65535}else{if((c&192)===128){i+=onError("UNEXPECTED_CONTINUE",i-1,bytes,result)}else{i+=onError("BAD_PREFIX",i-1,bytes,result)}continue}if(i-1+extraLength>=bytes.length){i+=onError("OVERRUN",i-1,bytes,result);continue}let res=c&(1<<8-extraLength-1)-1;for(let j=0;j1114111){i+=onError("OUT_OF_RANGE",i-1-extraLength,bytes,result,res);continue}if(res>=55296&&res<=57343){i+=onError("UTF16_SURROGATE",i-1-extraLength,bytes,result,res);continue}if(res<=overlongMask){i+=onError("OVERLONG",i-1-extraLength,bytes,result,res);continue}result.push(res)}return result}function toUtf8Bytes(str,form){assertArgument(typeof str==="string","invalid string value","str",str);if(form!=null){assertNormalize(form);str=str.normalize(form)}let result=[];for(let i=0;i>6|192);result.push(c&63|128)}else if((c&64512)==55296){i++;const c2=str.charCodeAt(i);assertArgument(i>18|240);result.push(pair>>12&63|128);result.push(pair>>6&63|128);result.push(pair&63|128)}else{result.push(c>>12|224);result.push(c>>6&63|128);result.push(c&63|128)}}return new Uint8Array(result)}function _toUtf8String(codePoints){return codePoints.map(codePoint=>{if(codePoint<=65535){return String.fromCharCode(codePoint)}codePoint-=65536;return String.fromCharCode((codePoint>>10&1023)+55296,(codePoint&1023)+56320)}).join("")}function toUtf8String(bytes,onError){return _toUtf8String(getUtf8CodePoints(bytes,onError))}function toUtf8CodePoints(str,form){return getUtf8CodePoints(toUtf8Bytes(str,form))}function createGetUrl(options){async function getUrl(req,_signal){assert(_signal==null||!_signal.cancelled,"request cancelled before sending","CANCELLED");const protocol=req.url.split(":")[0].toLowerCase();assert(protocol==="http"||protocol==="https",`unsupported protocol ${protocol}`,"UNSUPPORTED_OPERATION",{info:{protocol:protocol},operation:"request"});assert(protocol==="https"||!req.credentials||req.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let error=null;const controller=new AbortController;const timer=setTimeout(()=>{error=makeError("request timeout","TIMEOUT");controller.abort()},req.timeout);if(_signal){_signal.addListener(()=>{error=makeError("request cancelled","CANCELLED");controller.abort()})}const init=Object.assign({},options,{method:req.method,headers:new Headers(Array.from(req)),body:req.body||undefined,signal:controller.signal});let resp;try{resp=await fetch(req.url,init)}catch(_error){clearTimeout(timer);if(error){throw error}throw _error}clearTimeout(timer);const headers={};resp.headers.forEach((value,key)=>{headers[key.toLowerCase()]=value});const respBody=await resp.arrayBuffer();const body=respBody==null?null:new Uint8Array(respBody);return{statusCode:resp.status,statusMessage:resp.statusText,headers:headers,body:body}}return getUrl}const MAX_ATTEMPTS=12;const SLOT_INTERVAL=250;let defaultGetUrlFunc=createGetUrl();const reData=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i");const reIpfs=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let locked$5=false;async function dataGatewayFunc(url,signal){try{const match=url.match(reData);if(!match){throw new Error("invalid data")}return new FetchResponse(200,"OK",{"content-type":match[1]||"text/plain"},match[2]?decodeBase64(match[3]):unpercent(match[3]))}catch(error){return new FetchResponse(599,"BAD REQUEST (invalid data: URI)",{},null,new FetchRequest(url))}}function getIpfsGatewayFunc(baseUrl){async function gatewayIpfs(url,signal){try{const match=url.match(reIpfs);if(!match){throw new Error("invalid link")}return new FetchRequest(`${baseUrl}${match[2]}`)}catch(error){return new FetchResponse(599,"BAD REQUEST (invalid IPFS URI)",{},null,new FetchRequest(url))}}return gatewayIpfs}const Gateways={data:dataGatewayFunc,ipfs:getIpfsGatewayFunc("https://gateway.ipfs.io/ipfs/")};const fetchSignals=new WeakMap;class FetchCancelSignal{#listeners;#cancelled;constructor(request){this.#listeners=[];this.#cancelled=false;fetchSignals.set(request,()=>{if(this.#cancelled){return}this.#cancelled=true;for(const listener of this.#listeners){setTimeout(()=>{listener()},0)}this.#listeners=[]})}addListener(listener){assert(!this.#cancelled,"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"});this.#listeners.push(listener)}get cancelled(){return this.#cancelled}checkSignal(){assert(!this.cancelled,"cancelled","CANCELLED",{})}}function checkSignal(signal){if(signal==null){throw new Error("missing signal; should not happen")}signal.checkSignal();return signal}class FetchRequest{#allowInsecure;#gzip;#headers;#method;#timeout;#url;#body;#bodyType;#creds;#preflight;#process;#retry;#signal;#throttle;#getUrlFunc;get url(){return this.#url}set url(url){this.#url=String(url)}get body(){if(this.#body==null){return null}return new Uint8Array(this.#body)}set body(body){if(body==null){this.#body=undefined;this.#bodyType=undefined}else if(typeof body==="string"){this.#body=toUtf8Bytes(body);this.#bodyType="text/plain"}else if(body instanceof Uint8Array){this.#body=body;this.#bodyType="application/octet-stream"}else if(typeof body==="object"){this.#body=toUtf8Bytes(JSON.stringify(body));this.#bodyType="application/json"}else{throw new Error("invalid body")}}hasBody(){return this.#body!=null}get method(){if(this.#method){return this.#method}if(this.hasBody()){return"POST"}return"GET"}set method(method){if(method==null){method=""}this.#method=String(method).toUpperCase()}get headers(){const headers=Object.assign({},this.#headers);if(this.#creds){headers["authorization"]=`Basic ${encodeBase64(toUtf8Bytes(this.#creds))}`}if(this.allowGzip){headers["accept-encoding"]="gzip"}if(headers["content-type"]==null&&this.#bodyType){headers["content-type"]=this.#bodyType}if(this.body){headers["content-length"]=String(this.body.length)}return headers}getHeader(key){return this.headers[key.toLowerCase()]}setHeader(key,value){this.#headers[String(key).toLowerCase()]=String(value)}clearHeaders(){this.#headers={}}[Symbol.iterator](){const headers=this.headers;const keys=Object.keys(headers);let index=0;return{next:()=>{if(index=0,"timeout must be non-zero","timeout",timeout);this.#timeout=timeout}get preflightFunc(){return this.#preflight||null}set preflightFunc(preflight){this.#preflight=preflight}get processFunc(){return this.#process||null}set processFunc(process){this.#process=process}get retryFunc(){return this.#retry||null}set retryFunc(retry){this.#retry=retry}get getUrlFunc(){return this.#getUrlFunc||defaultGetUrlFunc}set getUrlFunc(value){this.#getUrlFunc=value}constructor(url){this.#url=String(url);this.#allowInsecure=false;this.#gzip=true;this.#headers={};this.#method="";this.#timeout=3e5;this.#throttle={slotInterval:SLOT_INTERVAL,maxAttempts:MAX_ATTEMPTS};this.#getUrlFunc=null}toString(){return``}setThrottleParams(params){if(params.slotInterval!=null){this.#throttle.slotInterval=params.slotInterval}if(params.maxAttempts!=null){this.#throttle.maxAttempts=params.maxAttempts}}async#send(attempt,expires,delay,_request,_response){if(attempt>=this.#throttle.maxAttempts){return _response.makeServerError("exceeded maximum retry limit")}assert(getTime$2()<=expires,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:_request});if(delay>0){await wait(delay)}let req=this.clone();const scheme=(req.url.split(":")[0]||"").toLowerCase();if(scheme in Gateways){const result=await Gateways[scheme](req.url,checkSignal(_request.#signal));if(result instanceof FetchResponse){let response=result;if(this.processFunc){checkSignal(_request.#signal);try{response=await this.processFunc(req,response)}catch(error){if(error.throttle==null||typeof error.stall!=="number"){response.makeServerError("error in post-processing function",error).assertOk()}}}return response}req=result}if(this.preflightFunc){req=await this.preflightFunc(req)}const resp=await this.getUrlFunc(req,checkSignal(_request.#signal));let response=new FetchResponse(resp.statusCode,resp.statusMessage,resp.headers,resp.body,_request);if(response.statusCode===301||response.statusCode===302){try{const location=response.headers.location||"";return req.redirect(location).#send(attempt+1,expires,0,_request,response)}catch(error){}return response}else if(response.statusCode===429){if(this.retryFunc==null||await this.retryFunc(req,response,attempt)){const retryAfter=response.headers["retry-after"];let delay=this.#throttle.slotInterval*Math.trunc(Math.random()*Math.pow(2,attempt));if(typeof retryAfter==="string"&&retryAfter.match(/^[1-9][0-9]*$/)){delay=parseInt(retryAfter)}return req.clone().#send(attempt+1,expires,delay,_request,response)}}if(this.processFunc){checkSignal(_request.#signal);try{response=await this.processFunc(req,response)}catch(error){if(error.throttle==null||typeof error.stall!=="number"){response.makeServerError("error in post-processing function",error).assertOk()}let delay=this.#throttle.slotInterval*Math.trunc(Math.random()*Math.pow(2,attempt));if(error.stall>=0){delay=error.stall}return req.clone().#send(attempt+1,expires,delay,_request,response)}}return response}send(){assert(this.#signal==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"});this.#signal=new FetchCancelSignal(this);return this.#send(0,getTime$2()+this.timeout,0,this,new FetchResponse(0,"",{},null,this))}cancel(){assert(this.#signal!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const signal=fetchSignals.get(this);if(!signal){throw new Error("missing signal; should not happen")}signal()}redirect(location){const current=this.url.split(":")[0].toLowerCase();const target=location.split(":")[0].toLowerCase();assert(this.method==="GET"&&(current!=="https"||target!=="http")&&location.match(/^https?:/),`unsupported redirect`,"UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(location)})`});const req=new FetchRequest(location);req.method="GET";req.allowGzip=this.allowGzip;req.timeout=this.timeout;req.#headers=Object.assign({},this.#headers);if(this.#body){req.#body=new Uint8Array(this.#body)}req.#bodyType=this.#bodyType;return req}clone(){const clone=new FetchRequest(this.url);clone.#method=this.#method;if(this.#body){clone.#body=this.#body}clone.#bodyType=this.#bodyType;clone.#headers=Object.assign({},this.#headers);clone.#creds=this.#creds;if(this.allowGzip){clone.allowGzip=true}clone.timeout=this.timeout;if(this.allowInsecureAuthentication){clone.allowInsecureAuthentication=true}clone.#preflight=this.#preflight;clone.#process=this.#process;clone.#retry=this.#retry;clone.#throttle=Object.assign({},this.#throttle);clone.#getUrlFunc=this.#getUrlFunc;return clone}static lockConfig(){locked$5=true}static getGateway(scheme){return Gateways[scheme.toLowerCase()]||null}static registerGateway(scheme,func){scheme=scheme.toLowerCase();if(scheme==="http"||scheme==="https"){throw new Error(`cannot intercept ${scheme}; use registerGetUrl`)}if(locked$5){throw new Error("gateways locked")}Gateways[scheme]=func}static registerGetUrl(getUrl){if(locked$5){throw new Error("gateways locked")}defaultGetUrlFunc=getUrl}static createGetUrlFunc(options){return createGetUrl(options)}static createDataGateway(){return dataGatewayFunc}static createIpfsGatewayFunc(baseUrl){return getIpfsGatewayFunc(baseUrl)}}class FetchResponse{#statusCode;#statusMessage;#headers;#body;#request;#error;toString(){return``}get statusCode(){return this.#statusCode}get statusMessage(){return this.#statusMessage}get headers(){return Object.assign({},this.#headers)}get body(){return this.#body==null?null:new Uint8Array(this.#body)}get bodyText(){try{return this.#body==null?"":toUtf8String(this.#body)}catch(error){assert(false,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch(error){assert(false,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const headers=this.headers;const keys=Object.keys(headers);let index=0;return{next:()=>{if(index{accum[k.toLowerCase()]=String(headers[k]);return accum},{});this.#body=body==null?null:new Uint8Array(body);this.#request=request||null;this.#error={message:""}}makeServerError(message,error){let statusMessage;if(!message){message=`${this.statusCode} ${this.statusMessage}`;statusMessage=`CLIENT ESCALATED SERVER ERROR (${message})`}else{statusMessage=`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${message})`}const response=new FetchResponse(599,statusMessage,this.headers,this.body,this.#request||undefined);response.#error={message:message,error:error};return response}throwThrottleError(message,stall){if(stall==null){stall=-1}else{assertArgument(Number.isInteger(stall)&&stall>=0,"invalid stall timeout","stall",stall)}const error=new Error(message||"throttling requests");defineProperties(error,{stall:stall,throttle:true});throw error}getHeader(key){return this.headers[key.toLowerCase()]}hasBody(){return this.#body!=null}get request(){return this.#request}ok(){return this.#error.message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok()){return}let{message,error}=this.#error;if(message===""){message=`server response ${this.statusCode} ${this.statusMessage}`}let requestUrl=null;if(this.request){requestUrl=this.request.url}let responseBody=null;try{if(this.#body){responseBody=toUtf8String(this.#body)}}catch(e){}assert(false,message,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:error,info:{requestUrl:requestUrl,responseBody:responseBody,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}}function getTime$2(){return(new Date).getTime()}function unpercent(value){return toUtf8Bytes(value.replace(/%([0-9a-f][0-9a-f])/gi,(all,code)=>{return String.fromCharCode(parseInt(code,16))}))}function wait(delay){return new Promise(resolve=>setTimeout(resolve,delay))}const BN_N1=BigInt(-1);const BN_0$8=BigInt(0);const BN_1$4=BigInt(1);const BN_5=BigInt(5);const _guard$5={};let Zeros$1="0000";while(Zeros$1.length<80){Zeros$1+=Zeros$1}function getTens(decimals){let result=Zeros$1;while(result.length=-limit&&valBN_0$8){val=fromTwos(mask(val,width),width)}else{val=-fromTwos(mask(-val,width),width)}}else{const limit=BN_1$4<=0&&val{if(v[key]==null){return defaultValue}assertArgument(typeof v[key]===type,"invalid fixed format ("+key+" not "+type+")","format."+key,v[key]);return v[key]};signed=check("signed","boolean",signed);width=check("width","number",width);decimals=check("decimals","number",decimals)}assertArgument(width%8===0,"invalid FixedNumber width (not byte aligned)","format.width",width);assertArgument(decimals<=80,"invalid FixedNumber decimals (too large)","format.decimals",decimals);const name=(signed?"":"u")+"fixed"+String(width)+"x"+String(decimals);return{signed:signed,width:width,decimals:decimals,name:name}}function toString(val,decimals){let negative="";if(val0){b*=getTens(delta)}else if(delta<0){a*=getTens(-delta)}if(ab){return 1}return 0}eq(other){return this.cmp(other)===0}lt(other){return this.cmp(other)<0}lte(other){return this.cmp(other)<=0}gt(other){return this.cmp(other)>0}gte(other){return this.cmp(other)>=0}floor(){let val=this.#val;if(this.#valBN_0$8){val+=this.#tens-BN_1$4}val=this.#val/this.#tens*this.#tens;return this.#checkValue(val,"ceiling")}round(decimals){if(decimals==null){decimals=0}if(decimals>=this.decimals){return this}const delta=this.decimals-decimals;const bump=BN_5*getTens(delta-1);let value=this.value+bump;const tens=getTens(delta);value=value/tens*tens;checkValue(value,this.#format,"round");return new FixedNumber(_guard$5,value,this.#format)}isZero(){return this.#val===BN_0$8}isNegative(){return this.#val0){const tens=getTens(delta);assert(value%tens===BN_0$8,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:_value});value/=tens}else if(delta<0){value*=getTens(-delta)}checkValue(value,format,"fromValue");return new FixedNumber(_guard$5,value,format)}static fromString(_value,_format){const match=_value.match(/^(-?)([0-9]*)\.?([0-9]*)$/);assertArgument(match&&match[2].length+match[3].length>0,"invalid FixedNumber string value","value",_value);const format=getFormat(_format);let whole=match[2]||"0",decimal=match[3]||"";while(decimal.length{assert(offset<=data.length,"data short segment too short","BUFFER_OVERRUN",{buffer:data,length:data.length,offset:offset})};if(data[offset]>=248){const lengthLength=data[offset]-247;checkOffset(offset+1+lengthLength);const length=unarrayifyInteger(data,offset+1,lengthLength);checkOffset(offset+1+lengthLength+length);return _decodeChildren(data,offset,offset+1+lengthLength,lengthLength+length)}else if(data[offset]>=192){const length=data[offset]-192;checkOffset(offset+1+length);return _decodeChildren(data,offset,offset+1,length)}else if(data[offset]>=184){const lengthLength=data[offset]-183;checkOffset(offset+1+lengthLength);const length=unarrayifyInteger(data,offset+1,lengthLength);checkOffset(offset+1+lengthLength+length);const result=hexlify(data.slice(offset+1+lengthLength,offset+1+lengthLength+length));return{consumed:1+lengthLength+length,result:result}}else if(data[offset]>=128){const length=data[offset]-128;checkOffset(offset+1+length);const result=hexlify(data.slice(offset+1,offset+1+length));return{consumed:1+length,result:result}}return{consumed:1,result:hexlifyByte(data[offset])}}function decodeRlp(_data){const data=getBytes(_data,"data");const decoded=_decode(data,0);assertArgument(decoded.consumed===data.length,"unexpected junk after rlp payload","data",_data);return decoded.result}function arrayifyInteger(value){const result=[];while(value){result.unshift(value&255);value>>=8}return result}function _encode(object){if(Array.isArray(object)){let payload=[];object.forEach(function(child){payload=payload.concat(_encode(child))});if(payload.length<=55){payload.unshift(192+payload.length);return payload}const length=arrayifyInteger(payload.length);length.unshift(247+length.length);return length.concat(payload)}const data=Array.prototype.slice.call(getBytes(object,"object"));if(data.length===1&&data[0]<=127){return data}else if(data.length<=55){data.unshift(128+data.length);return data}const length=arrayifyInteger(data.length);length.unshift(183+length.length);return length.concat(data)}const nibbles="0123456789abcdef";function encodeRlp(object){let result="0x";for(const v of _encode(object)){result+=nibbles[v>>4];result+=nibbles[v&15]}return result}const names=["wei","kwei","mwei","gwei","szabo","finney","ether"];function formatUnits(value,unit){let decimals=18;if(typeof unit==="string"){const index=names.indexOf(unit);assertArgument(index>=0,"invalid unit","unit",unit);decimals=3*index}else if(unit!=null){decimals=getNumber(unit,"unit")}return FixedNumber.fromValue(value,decimals,{decimals:decimals,width:512}).toString()}function parseUnits$1(value,unit){assertArgument(typeof value==="string","value must be a string","value",value);let decimals=18;if(typeof unit==="string"){const index=names.indexOf(unit);assertArgument(index>=0,"invalid unit","unit",unit);decimals=3*index}else if(unit!=null){decimals=getNumber(unit,"unit")}return FixedNumber.fromString(value,{decimals:decimals,width:512}).value}function formatEther(wei){return formatUnits(wei,18)}function parseEther(ether){return parseUnits$1(ether,18)}function uuidV4(randomBytes){const bytes=getBytes(randomBytes,"randomBytes");bytes[6]=bytes[6]&15|64;bytes[8]=bytes[8]&63|128;const value=hexlify(bytes);return[value.substring(2,10),value.substring(10,14),value.substring(14,18),value.substring(18,22),value.substring(22,34)].join("-")}const WordSize=32;const Padding=new Uint8Array(WordSize);const passProperties$1=["then"];const _guard$4={};const resultNames=new WeakMap;function getNames(result){return resultNames.get(result)}function setNames(result,names){resultNames.set(result,names)}function throwError(name,error){const wrapped=new Error(`deferred error during ABI decoding triggered accessing ${name}`);wrapped.error=error;throw wrapped}function toObject(names,items,deep){if(names.indexOf(null)>=0){return items.map((item,index)=>{if(item instanceof Result){return toObject(getNames(item),item,deep)}return item})}return names.reduce((accum,name,index)=>{let item=items.getValue(name);if(!(name in accum)){if(deep&&item instanceof Result){item=toObject(getNames(item),item,deep)}accum[name]=item}return accum},{})}class Result extends Array{#names;constructor(...args){const guard=args[0];let items=args[1];let names=(args[2]||[]).slice();let wrap=true;if(guard!==_guard$4){items=args;names=[];wrap=false}super(items.length);items.forEach((item,index)=>{this[index]=item});const nameCounts=names.reduce((accum,name)=>{if(typeof name==="string"){accum.set(name,(accum.get(name)||0)+1)}return accum},new Map);setNames(this,Object.freeze(items.map((item,index)=>{const name=names[index];if(name!=null&&nameCounts.get(name)===1){return name}return null})));this.#names=[];if(this.#names==null){void this.#names}if(!wrap){return}Object.freeze(this);const proxy=new Proxy(this,{get:(target,prop,receiver)=>{if(typeof prop==="string"){if(prop.match(/^[0-9]+$/)){const index=getNumber(prop,"%index");if(index<0||index>=this.length){throw new RangeError("out of result range")}const item=target[index];if(item instanceof Error){throwError(`index ${index}`,item)}return item}if(passProperties$1.indexOf(prop)>=0){return Reflect.get(target,prop,receiver)}const value=target[prop];if(value instanceof Function){return function(...args){return value.apply(this===receiver?target:this,args)}}else if(!(prop in target)){return target.getValue.apply(this===receiver?target:this,[prop])}}return Reflect.get(target,prop,receiver)}});setNames(proxy,getNames(this));return proxy}toArray(deep){const result=[];this.forEach((item,index)=>{if(item instanceof Error){throwError(`index ${index}`,item)}if(deep&&item instanceof Result){item=item.toArray(deep)}result.push(item)});return result}toObject(deep){const names=getNames(this);return names.reduce((accum,name,index)=>{assert(name!=null,`value at index ${index} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"});return toObject(names,this,deep)},{})}slice(start,end){if(start==null){start=0}if(start<0){start+=this.length;if(start<0){start=0}}if(end==null){end=this.length}if(end<0){end+=this.length;if(end<0){end=0}}if(end>this.length){end=this.length}const _names=getNames(this);const result=[],names=[];for(let i=start;i{this.#data[offset]=getValue$1(value)}}}class Reader{allowLoose;#data;#offset;#bytesRead;#parent;#maxInflation;constructor(data,allowLoose,maxInflation){defineProperties(this,{allowLoose:!!allowLoose});this.#data=getBytesCopy(data);this.#bytesRead=0;this.#parent=null;this.#maxInflation=maxInflation!=null?maxInflation:1024;this.#offset=0}get data(){return hexlify(this.#data)}get dataLength(){return this.#data.length}get consumed(){return this.#offset}get bytes(){return new Uint8Array(this.#data)}#incrementBytesRead(count){if(this.#parent){return this.#parent.#incrementBytesRead(count)}this.#bytesRead+=count;assert(this.#maxInflation<1||this.#bytesRead<=this.#maxInflation*this.dataLength,`compressed ABI data exceeds inflation ratio of ${this.#maxInflation} ( see: https:/\/github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:getBytesCopy(this.#data),offset:this.#offset,length:count,info:{bytesRead:this.#bytesRead,dataLength:this.dataLength}})}#peekBytes(offset,length,loose){let alignedLength=Math.ceil(length/WordSize)*WordSize;if(this.#offset+alignedLength>this.#data.length){if(this.allowLoose&&loose&&this.#offset+length<=this.#data.length){alignedLength=length}else{assert(false,"data out-of-bounds","BUFFER_OVERRUN",{buffer:getBytesCopy(this.#data),length:this.#data.length,offset:this.#offset+alignedLength})}}return this.#data.slice(this.#offset,this.#offset+alignedLength)}subReader(offset){const reader=new Reader(this.#data.slice(this.#offset+offset),this.allowLoose,this.#maxInflation);reader.#parent=this;return reader}readBytes(length,loose){let bytes=this.#peekBytes(0,length,!!loose);this.#incrementBytesRead(length);this.#offset+=bytes.length;return bytes.slice(0,length)}readValue(){return toBigInt(this.readBytes(WordSize))}readIndex(){return toNumber(this.readBytes(WordSize))}}function number(n){if(!Number.isSafeInteger(n)||n<0)throw new Error(`Wrong positive integer: ${n}`)}function bytes(b,...lengths){if(!(b instanceof Uint8Array))throw new Error("Expected Uint8Array");if(lengths.length>0&&!lengths.includes(b.length))throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`)}function hash(hash){if(typeof hash!=="function"||typeof hash.create!=="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");number(hash.outputLen);number(hash.blockLen)}function exists(instance,checkFinished=true){if(instance.destroyed)throw new Error("Hash instance has been destroyed");if(checkFinished&&instance.finished)throw new Error("Hash#digest() has already been called")}function output(out,instance){bytes(out);const min=instance.outputLen;if(out.lengtha instanceof Uint8Array;const u32=arr=>new Uint32Array(arr.buffer,arr.byteOffset,Math.floor(arr.byteLength/4));const createView=arr=>new DataView(arr.buffer,arr.byteOffset,arr.byteLength);const rotr=(word,shift)=>word<<32-shift|word>>>shift;const isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!isLE)throw new Error("Non little-endian hardware is not supported");const nextTick=async()=>{};async function asyncLoop(iters,tick,cb){let ts=Date.now();for(let i=0;i=0&&diffsum+a.length,0));let pad=0;arrays.forEach(a=>{if(!u8a$1(a))throw new Error("Uint8Array expected");r.set(a,pad);pad+=a.length});return r}class Hash{clone(){return this._cloneInto()}}const toStr={}.toString;function checkOpts(defaults,opts){if(opts!==undefined&&toStr.call(opts)!=="[object Object]")throw new Error("Options should be object or undefined");const merged=Object.assign(defaults,opts);return merged}function wrapConstructor(hashCons){const hashC=msg=>hashCons().update(toBytes(msg)).digest();const tmp=hashCons();hashC.outputLen=tmp.outputLen;hashC.blockLen=tmp.blockLen;hashC.create=()=>hashCons();return hashC}function randomBytes$2(bytesLength=32){if(crypto$1&&typeof crypto$1.getRandomValues==="function"){return crypto$1.getRandomValues(new Uint8Array(bytesLength))}throw new Error("crypto.getRandomValues must be defined")}class HMAC extends Hash{constructor(hash$1,_key){super();this.finished=false;this.destroyed=false;hash(hash$1);const key=toBytes(_key);this.iHash=hash$1.create();if(typeof this.iHash.update!=="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen;this.outputLen=this.iHash.outputLen;const blockLen=this.blockLen;const pad=new Uint8Array(blockLen);pad.set(key.length>blockLen?hash$1.create().update(key).digest():key);for(let i=0;inew HMAC(hash,key).update(message).digest();hmac.create=(hash,key)=>new HMAC(hash,key);function pbkdf2Init(hash$1,_password,_salt,_opts){hash(hash$1);const opts=checkOpts({dkLen:32,asyncTick:10},_opts);const{c,dkLen,asyncTick}=opts;number(c);number(dkLen);number(asyncTick);if(c<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const password=toBytes(_password);const salt=toBytes(_salt);const DK=new Uint8Array(dkLen);const PRF=hmac.create(hash$1,password);const PRFSalt=PRF._cloneInto().update(salt);return{c:c,dkLen:dkLen,asyncTick:asyncTick,DK:DK,PRF:PRF,PRFSalt:PRFSalt}}function pbkdf2Output(PRF,PRFSalt,DK,prfW,u){PRF.destroy();PRFSalt.destroy();if(prfW)prfW.destroy();u.fill(0);return DK}function pbkdf2$1(hash,password,salt,opts){const{c,dkLen,DK,PRF,PRFSalt}=pbkdf2Init(hash,password,salt,opts);let prfW;const arr=new Uint8Array(4);const view=createView(arr);const u=new Uint8Array(PRF.outputLen);for(let ti=1,pos=0;pos>_32n&_u32_max);const wl=Number(value&_u32_max);const h=isLE?4:0;const l=isLE?0:4;view.setUint32(byteOffset+h,wh,isLE);view.setUint32(byteOffset+l,wl,isLE)}class SHA2 extends Hash{constructor(blockLen,outputLen,padOffset,isLE){super();this.blockLen=blockLen;this.outputLen=outputLen;this.padOffset=padOffset;this.isLE=isLE;this.finished=false;this.length=0;this.pos=0;this.destroyed=false;this.buffer=new Uint8Array(blockLen);this.view=createView(this.buffer)}update(data){exists(this);const{view,buffer,blockLen}=this;data=toBytes(data);const len=data.length;for(let pos=0;posblockLen-pos){this.process(view,0);pos=0}for(let i=pos;istate.length)throw new Error("_sha2: outputLen bigger than state");for(let i=0;ia&b^~a&c;const Maj=(a,b,c)=>a&b^a&c^b&c;const SHA256_K=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);const IV=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);const SHA256_W=new Uint32Array(64);class SHA256 extends SHA2{constructor(){super(64,32,8,false);this.A=IV[0]|0;this.B=IV[1]|0;this.C=IV[2]|0;this.D=IV[3]|0;this.E=IV[4]|0;this.F=IV[5]|0;this.G=IV[6]|0;this.H=IV[7]|0}get(){const{A,B,C,D,E,F,G,H}=this;return[A,B,C,D,E,F,G,H]}set(A,B,C,D,E,F,G,H){this.A=A|0;this.B=B|0;this.C=C|0;this.D=D|0;this.E=E|0;this.F=F|0;this.G=G|0;this.H=H|0}process(view,offset){for(let i=0;i<16;i++,offset+=4)SHA256_W[i]=view.getUint32(offset,false);for(let i=16;i<64;i++){const W15=SHA256_W[i-15];const W2=SHA256_W[i-2];const s0=rotr(W15,7)^rotr(W15,18)^W15>>>3;const s1=rotr(W2,17)^rotr(W2,19)^W2>>>10;SHA256_W[i]=s1+SHA256_W[i-7]+s0+SHA256_W[i-16]|0}let{A,B,C,D,E,F,G,H}=this;for(let i=0;i<64;i++){const sigma1=rotr(E,6)^rotr(E,11)^rotr(E,25);const T1=H+sigma1+Chi(E,F,G)+SHA256_K[i]+SHA256_W[i]|0;const sigma0=rotr(A,2)^rotr(A,13)^rotr(A,22);const T2=sigma0+Maj(A,B,C)|0;H=G;G=F;F=E;E=D+T1|0;D=C;C=B;B=A;A=T1+T2|0}A=A+this.A|0;B=B+this.B|0;C=C+this.C|0;D=D+this.D|0;E=E+this.E|0;F=F+this.F|0;G=G+this.G|0;H=H+this.H|0;this.set(A,B,C,D,E,F,G,H)}roundClean(){SHA256_W.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0);this.buffer.fill(0)}}const sha256$1=wrapConstructor(()=>new SHA256);const U32_MASK64=BigInt(2**32-1);const _32n=BigInt(32);function fromBig(n,le=false){if(le)return{h:Number(n&U32_MASK64),l:Number(n>>_32n&U32_MASK64)};return{h:Number(n>>_32n&U32_MASK64)|0,l:Number(n&U32_MASK64)|0}}function split$1(lst,le=false){let Ah=new Uint32Array(lst.length);let Al=new Uint32Array(lst.length);for(let i=0;iBigInt(h>>>0)<<_32n|BigInt(l>>>0);const shrSH=(h,_l,s)=>h>>>s;const shrSL=(h,l,s)=>h<<32-s|l>>>s;const rotrSH=(h,l,s)=>h>>>s|l<<32-s;const rotrSL=(h,l,s)=>h<<32-s|l>>>s;const rotrBH=(h,l,s)=>h<<64-s|l>>>s-32;const rotrBL=(h,l,s)=>h>>>s-32|l<<64-s;const rotr32H=(_h,l)=>l;const rotr32L=(h,_l)=>h;const rotlSH=(h,l,s)=>h<>>32-s;const rotlSL=(h,l,s)=>l<>>32-s;const rotlBH=(h,l,s)=>l<>>64-s;const rotlBL=(h,l,s)=>h<>>64-s;function add(Ah,Al,Bh,Bl){const l=(Al>>>0)+(Bl>>>0);return{h:Ah+Bh+(l/2**32|0)|0,l:l|0}}const add3L=(Al,Bl,Cl)=>(Al>>>0)+(Bl>>>0)+(Cl>>>0);const add3H=(low,Ah,Bh,Ch)=>Ah+Bh+Ch+(low/2**32|0)|0;const add4L=(Al,Bl,Cl,Dl)=>(Al>>>0)+(Bl>>>0)+(Cl>>>0)+(Dl>>>0);const add4H=(low,Ah,Bh,Ch,Dh)=>Ah+Bh+Ch+Dh+(low/2**32|0)|0;const add5L=(Al,Bl,Cl,Dl,El)=>(Al>>>0)+(Bl>>>0)+(Cl>>>0)+(Dl>>>0)+(El>>>0);const add5H=(low,Ah,Bh,Ch,Dh,Eh)=>Ah+Bh+Ch+Dh+Eh+(low/2**32|0)|0;const u64={fromBig:fromBig,split:split$1,toBig:toBig,shrSH:shrSH,shrSL:shrSL,rotrSH:rotrSH,rotrSL:rotrSL,rotrBH:rotrBH,rotrBL:rotrBL,rotr32H:rotr32H,rotr32L:rotr32L,rotlSH:rotlSH,rotlSL:rotlSL,rotlBH:rotlBH,rotlBL:rotlBL,add:add,add3L:add3L,add3H:add3H,add4L:add4L,add4H:add4H,add5H:add5H,add5L:add5L};const[SHA512_Kh,SHA512_Kl]=(()=>u64.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(n=>BigInt(n))))();const SHA512_W_H=new Uint32Array(80);const SHA512_W_L=new Uint32Array(80);class SHA512 extends SHA2{constructor(){super(128,64,16,false);this.Ah=1779033703|0;this.Al=4089235720|0;this.Bh=3144134277|0;this.Bl=2227873595|0;this.Ch=1013904242|0;this.Cl=4271175723|0;this.Dh=2773480762|0;this.Dl=1595750129|0;this.Eh=1359893119|0;this.El=2917565137|0;this.Fh=2600822924|0;this.Fl=725511199|0;this.Gh=528734635|0;this.Gl=4215389547|0;this.Hh=1541459225|0;this.Hl=327033209|0}get(){const{Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl}=this;return[Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl]}set(Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl){this.Ah=Ah|0;this.Al=Al|0;this.Bh=Bh|0;this.Bl=Bl|0;this.Ch=Ch|0;this.Cl=Cl|0;this.Dh=Dh|0;this.Dl=Dl|0;this.Eh=Eh|0;this.El=El|0;this.Fh=Fh|0;this.Fl=Fl|0;this.Gh=Gh|0;this.Gl=Gl|0;this.Hh=Hh|0;this.Hl=Hl|0}process(view,offset){for(let i=0;i<16;i++,offset+=4){SHA512_W_H[i]=view.getUint32(offset);SHA512_W_L[i]=view.getUint32(offset+=4)}for(let i=16;i<80;i++){const W15h=SHA512_W_H[i-15]|0;const W15l=SHA512_W_L[i-15]|0;const s0h=u64.rotrSH(W15h,W15l,1)^u64.rotrSH(W15h,W15l,8)^u64.shrSH(W15h,W15l,7);const s0l=u64.rotrSL(W15h,W15l,1)^u64.rotrSL(W15h,W15l,8)^u64.shrSL(W15h,W15l,7);const W2h=SHA512_W_H[i-2]|0;const W2l=SHA512_W_L[i-2]|0;const s1h=u64.rotrSH(W2h,W2l,19)^u64.rotrBH(W2h,W2l,61)^u64.shrSH(W2h,W2l,6);const s1l=u64.rotrSL(W2h,W2l,19)^u64.rotrBL(W2h,W2l,61)^u64.shrSL(W2h,W2l,6);const SUMl=u64.add4L(s0l,s1l,SHA512_W_L[i-7],SHA512_W_L[i-16]);const SUMh=u64.add4H(SUMl,s0h,s1h,SHA512_W_H[i-7],SHA512_W_H[i-16]);SHA512_W_H[i]=SUMh|0;SHA512_W_L[i]=SUMl|0}let{Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl}=this;for(let i=0;i<80;i++){const sigma1h=u64.rotrSH(Eh,El,14)^u64.rotrSH(Eh,El,18)^u64.rotrBH(Eh,El,41);const sigma1l=u64.rotrSL(Eh,El,14)^u64.rotrSL(Eh,El,18)^u64.rotrBL(Eh,El,41);const CHIh=Eh&Fh^~Eh&Gh;const CHIl=El&Fl^~El&Gl;const T1ll=u64.add5L(Hl,sigma1l,CHIl,SHA512_Kl[i],SHA512_W_L[i]);const T1h=u64.add5H(T1ll,Hh,sigma1h,CHIh,SHA512_Kh[i],SHA512_W_H[i]);const T1l=T1ll|0;const sigma0h=u64.rotrSH(Ah,Al,28)^u64.rotrBH(Ah,Al,34)^u64.rotrBH(Ah,Al,39);const sigma0l=u64.rotrSL(Ah,Al,28)^u64.rotrBL(Ah,Al,34)^u64.rotrBL(Ah,Al,39);const MAJh=Ah&Bh^Ah&Ch^Bh&Ch;const MAJl=Al&Bl^Al&Cl^Bl&Cl;Hh=Gh|0;Hl=Gl|0;Gh=Fh|0;Gl=Fl|0;Fh=Eh|0;Fl=El|0;({h:Eh,l:El}=u64.add(Dh|0,Dl|0,T1h|0,T1l|0));Dh=Ch|0;Dl=Cl|0;Ch=Bh|0;Cl=Bl|0;Bh=Ah|0;Bl=Al|0;const All=u64.add3L(T1l,sigma0l,MAJl);Ah=u64.add3H(All,T1h,sigma0h,MAJh);Al=All|0}({h:Ah,l:Al}=u64.add(this.Ah|0,this.Al|0,Ah|0,Al|0));({h:Bh,l:Bl}=u64.add(this.Bh|0,this.Bl|0,Bh|0,Bl|0));({h:Ch,l:Cl}=u64.add(this.Ch|0,this.Cl|0,Ch|0,Cl|0));({h:Dh,l:Dl}=u64.add(this.Dh|0,this.Dl|0,Dh|0,Dl|0));({h:Eh,l:El}=u64.add(this.Eh|0,this.El|0,Eh|0,El|0));({h:Fh,l:Fl}=u64.add(this.Fh|0,this.Fl|0,Fh|0,Fl|0));({h:Gh,l:Gl}=u64.add(this.Gh|0,this.Gl|0,Gh|0,Gl|0));({h:Hh,l:Hl}=u64.add(this.Hh|0,this.Hl|0,Hh|0,Hl|0));this.set(Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl)}roundClean(){SHA512_W_H.fill(0);SHA512_W_L.fill(0)}destroy(){this.buffer.fill(0);this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const sha512$1=wrapConstructor(()=>new SHA512);function getGlobal$1(){if(typeof self!=="undefined"){return self}if(typeof window!=="undefined"){return window}if(typeof global!=="undefined"){return global}throw new Error("unable to locate global object")}const anyGlobal=getGlobal$1();const crypto=anyGlobal.crypto||anyGlobal.msCrypto;function createHash(algo){switch(algo){case"sha256":return sha256$1.create();case"sha512":return sha512$1.create()}assertArgument(false,"invalid hashing algorithm name","algorithm",algo)}function createHmac(_algo,key){const algo={sha256:sha256$1,sha512:sha512$1}[_algo];assertArgument(algo!=null,"invalid hmac algorithm","algorithm",_algo);return hmac.create(algo,key)}function pbkdf2Sync(password,salt,iterations,keylen,_algo){const algo={sha256:sha256$1,sha512:sha512$1}[_algo];assertArgument(algo!=null,"invalid pbkdf2 algorithm","algorithm",_algo);return pbkdf2$1(algo,password,salt,{c:iterations,dkLen:keylen})}function randomBytes$1(length){assert(crypto!=null,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"});assertArgument(Number.isInteger(length)&&length>0&&length<=1024,"invalid length","length",length);const result=new Uint8Array(length);crypto.getRandomValues(result);return result}let locked$4=false;const _computeHmac=function(algorithm,key,data){return createHmac(algorithm,key).update(data).digest()};let __computeHmac=_computeHmac;function computeHmac(algorithm,_key,_data){const key=getBytes(_key,"key");const data=getBytes(_data,"data");return hexlify(__computeHmac(algorithm,key,data))}computeHmac._=_computeHmac;computeHmac.lock=function(){locked$4=true};computeHmac.register=function(func){if(locked$4){throw new Error("computeHmac is locked")}__computeHmac=func};Object.freeze(computeHmac);const[SHA3_PI,SHA3_ROTL,_SHA3_IOTA]=[[],[],[]];const _0n$4=BigInt(0);const _1n$5=BigInt(1);const _2n$3=BigInt(2);const _7n=BigInt(7);const _256n=BigInt(256);const _0x71n=BigInt(113);for(let round=0,R=_1n$5,x=1,y=0;round<24;round++){[x,y]=[y,(2*x+3*y)%5];SHA3_PI.push(2*(5*y+x));SHA3_ROTL.push((round+1)*(round+2)/2%64);let t=_0n$4;for(let j=0;j<7;j++){R=(R<<_1n$5^(R>>_7n)*_0x71n)%_256n;if(R&_2n$3)t^=_1n$5<<(_1n$5<s>32?rotlBH(h,l,s):rotlSH(h,l,s);const rotlL=(h,l,s)=>s>32?rotlBL(h,l,s):rotlSL(h,l,s);function keccakP(s,rounds=24){const B=new Uint32Array(5*2);for(let round=24-rounds;round<24;round++){for(let x=0;x<10;x++)B[x]=s[x]^s[x+10]^s[x+20]^s[x+30]^s[x+40];for(let x=0;x<10;x+=2){const idx1=(x+8)%10;const idx0=(x+2)%10;const B0=B[idx0];const B1=B[idx0+1];const Th=rotlH(B0,B1,1)^B[idx1];const Tl=rotlL(B0,B1,1)^B[idx1+1];for(let y=0;y<50;y+=10){s[x+y]^=Th;s[x+y+1]^=Tl}}let curH=s[2];let curL=s[3];for(let t=0;t<24;t++){const shift=SHA3_ROTL[t];const Th=rotlH(curH,curL,shift);const Tl=rotlL(curH,curL,shift);const PI=SHA3_PI[t];curH=s[PI];curL=s[PI+1];s[PI]=Th;s[PI+1]=Tl}for(let y=0;y<50;y+=10){for(let x=0;x<10;x++)B[x]=s[y+x];for(let x=0;x<10;x++)s[y+x]^=~B[(x+2)%10]&B[(x+4)%10]}s[0]^=SHA3_IOTA_H[round];s[1]^=SHA3_IOTA_L[round]}B.fill(0)}class Keccak extends Hash{constructor(blockLen,suffix,outputLen,enableXOF=false,rounds=24){super();this.blockLen=blockLen;this.suffix=suffix;this.outputLen=outputLen;this.enableXOF=enableXOF;this.rounds=rounds;this.pos=0;this.posOut=0;this.finished=false;this.destroyed=false;number(outputLen);if(0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200);this.state32=u32(this.state)}keccak(){keccakP(this.state32,this.rounds);this.posOut=0;this.pos=0}update(data){exists(this);const{blockLen,state}=this;data=toBytes(data);const len=data.length;for(let pos=0;pos=blockLen)this.keccak();const take=Math.min(blockLen-this.posOut,len-pos);out.set(bufferOut.subarray(this.posOut,this.posOut+take),pos);this.posOut+=take;pos+=take}return out}xofInto(out){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(out)}xof(bytes){number(bytes);return this.xofInto(new Uint8Array(bytes))}digestInto(out){output(out,this);if(this.finished)throw new Error("digest() was already called");this.writeInto(out);this.destroy();return out}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=true;this.state.fill(0)}_cloneInto(to){const{blockLen,suffix,outputLen,rounds,enableXOF}=this;to||(to=new Keccak(blockLen,suffix,outputLen,enableXOF,rounds));to.state32.set(this.state32);to.pos=this.pos;to.posOut=this.posOut;to.finished=this.finished;to.rounds=rounds;to.suffix=suffix;to.outputLen=outputLen;to.enableXOF=enableXOF;to.destroyed=this.destroyed;return to}}const gen=(suffix,blockLen,outputLen)=>wrapConstructor(()=>new Keccak(blockLen,suffix,outputLen));const keccak_256=gen(1,136,256/8);let locked$3=false;const _keccak256=function(data){return keccak_256(data)};let __keccak256=_keccak256;function keccak256(_data){const data=getBytes(_data,"data");return hexlify(__keccak256(data))}keccak256._=_keccak256;keccak256.lock=function(){locked$3=true};keccak256.register=function(func){if(locked$3){throw new TypeError("keccak256 is locked")}__keccak256=func};Object.freeze(keccak256);const Rho=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]);const Id=Uint8Array.from({length:16},(_,i)=>i);const Pi=Id.map(i=>(9*i+5)%16);let idxL=[Id];let idxR=[Pi];for(let i=0;i<4;i++)for(let j of[idxL,idxR])j.push(j[i].map(k=>Rho[k]));const shifts=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(i=>new Uint8Array(i));const shiftsL=idxL.map((idx,i)=>idx.map(j=>shifts[i][j]));const shiftsR=idxR.map((idx,i)=>idx.map(j=>shifts[i][j]));const Kl=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]);const Kr=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]);const rotl$1=(word,shift)=>word<>>32-shift;function f(group,x,y,z){if(group===0)return x^y^z;else if(group===1)return x&y|~x&z;else if(group===2)return(x|~y)^z;else if(group===3)return x&z|y&~z;else return x^(y|~z)}const BUF=new Uint32Array(16);class RIPEMD160 extends SHA2{constructor(){super(64,20,8,true);this.h0=1732584193|0;this.h1=4023233417|0;this.h2=2562383102|0;this.h3=271733878|0;this.h4=3285377520|0}get(){const{h0,h1,h2,h3,h4}=this;return[h0,h1,h2,h3,h4]}set(h0,h1,h2,h3,h4){this.h0=h0|0;this.h1=h1|0;this.h2=h2|0;this.h3=h3|0;this.h4=h4|0}process(view,offset){for(let i=0;i<16;i++,offset+=4)BUF[i]=view.getUint32(offset,true);let al=this.h0|0,ar=al,bl=this.h1|0,br=bl,cl=this.h2|0,cr=cl,dl=this.h3|0,dr=dl,el=this.h4|0,er=el;for(let group=0;group<5;group++){const rGroup=4-group;const hbl=Kl[group],hbr=Kr[group];const rl=idxL[group],rr=idxR[group];const sl=shiftsL[group],sr=shiftsR[group];for(let i=0;i<16;i++){const tl=rotl$1(al+f(group,bl,cl,dl)+BUF[rl[i]]+hbl,sl[i])+el|0;al=el,el=dl,dl=rotl$1(cl,10)|0,cl=bl,bl=tl}for(let i=0;i<16;i++){const tr=rotl$1(ar+f(rGroup,br,cr,dr)+BUF[rr[i]]+hbr,sr[i])+er|0;ar=er,er=dr,dr=rotl$1(cr,10)|0,cr=br,br=tr}}this.set(this.h1+cl+dr|0,this.h2+dl+er|0,this.h3+el+ar|0,this.h4+al+br|0,this.h0+bl+cr|0)}roundClean(){BUF.fill(0)}destroy(){this.destroyed=true;this.buffer.fill(0);this.set(0,0,0,0,0)}}const ripemd160$1=wrapConstructor(()=>new RIPEMD160);let locked$2=false;const _ripemd160=function(data){return ripemd160$1(data)};let __ripemd160=_ripemd160;function ripemd160(_data){const data=getBytes(_data,"data");return hexlify(__ripemd160(data))}ripemd160._=_ripemd160;ripemd160.lock=function(){locked$2=true};ripemd160.register=function(func){if(locked$2){throw new TypeError("ripemd160 is locked")}__ripemd160=func};Object.freeze(ripemd160);let locked$1=false;const _pbkdf2=function(password,salt,iterations,keylen,algo){return pbkdf2Sync(password,salt,iterations,keylen,algo)};let __pbkdf2=_pbkdf2;function pbkdf2(_password,_salt,iterations,keylen,algo){const password=getBytes(_password,"password");const salt=getBytes(_salt,"salt");return hexlify(__pbkdf2(password,salt,iterations,keylen,algo))}pbkdf2._=_pbkdf2;pbkdf2.lock=function(){locked$1=true};pbkdf2.register=function(func){if(locked$1){throw new Error("pbkdf2 is locked")}__pbkdf2=func};Object.freeze(pbkdf2);let locked=false;const _randomBytes=function(length){return new Uint8Array(randomBytes$1(length))};let __randomBytes=_randomBytes;function randomBytes(length){return __randomBytes(length)}randomBytes._=_randomBytes;randomBytes.lock=function(){locked=true};randomBytes.register=function(func){if(locked){throw new Error("randomBytes is locked")}__randomBytes=func};Object.freeze(randomBytes);const rotl=(a,b)=>a<>>32-b;function XorAndSalsa(prev,pi,input,ii,out,oi){let y00=prev[pi++]^input[ii++],y01=prev[pi++]^input[ii++];let y02=prev[pi++]^input[ii++],y03=prev[pi++]^input[ii++];let y04=prev[pi++]^input[ii++],y05=prev[pi++]^input[ii++];let y06=prev[pi++]^input[ii++],y07=prev[pi++]^input[ii++];let y08=prev[pi++]^input[ii++],y09=prev[pi++]^input[ii++];let y10=prev[pi++]^input[ii++],y11=prev[pi++]^input[ii++];let y12=prev[pi++]^input[ii++],y13=prev[pi++]^input[ii++];let y14=prev[pi++]^input[ii++],y15=prev[pi++]^input[ii++];let x00=y00,x01=y01,x02=y02,x03=y03,x04=y04,x05=y05,x06=y06,x07=y07,x08=y08,x09=y09,x10=y10,x11=y11,x12=y12,x13=y13,x14=y14,x15=y15;for(let i=0;i<8;i+=2){x04^=rotl(x00+x12|0,7);x08^=rotl(x04+x00|0,9);x12^=rotl(x08+x04|0,13);x00^=rotl(x12+x08|0,18);x09^=rotl(x05+x01|0,7);x13^=rotl(x09+x05|0,9);x01^=rotl(x13+x09|0,13);x05^=rotl(x01+x13|0,18);x14^=rotl(x10+x06|0,7);x02^=rotl(x14+x10|0,9);x06^=rotl(x02+x14|0,13);x10^=rotl(x06+x02|0,18);x03^=rotl(x15+x11|0,7);x07^=rotl(x03+x15|0,9);x11^=rotl(x07+x03|0,13);x15^=rotl(x11+x07|0,18);x01^=rotl(x00+x03|0,7);x02^=rotl(x01+x00|0,9);x03^=rotl(x02+x01|0,13);x00^=rotl(x03+x02|0,18);x06^=rotl(x05+x04|0,7);x07^=rotl(x06+x05|0,9);x04^=rotl(x07+x06|0,13);x05^=rotl(x04+x07|0,18);x11^=rotl(x10+x09|0,7);x08^=rotl(x11+x10|0,9);x09^=rotl(x08+x11|0,13);x10^=rotl(x09+x08|0,18);x12^=rotl(x15+x14|0,7);x13^=rotl(x12+x15|0,9);x14^=rotl(x13+x12|0,13);x15^=rotl(x14+x13|0,18)}out[oi++]=y00+x00|0;out[oi++]=y01+x01|0;out[oi++]=y02+x02|0;out[oi++]=y03+x03|0;out[oi++]=y04+x04|0;out[oi++]=y05+x05|0;out[oi++]=y06+x06|0;out[oi++]=y07+x07|0;out[oi++]=y08+x08|0;out[oi++]=y09+x09|0;out[oi++]=y10+x10|0;out[oi++]=y11+x11|0;out[oi++]=y12+x12|0;out[oi++]=y13+x13|0;out[oi++]=y14+x14|0;out[oi++]=y15+x15|0}function BlockMix(input,ii,out,oi,r){let head=oi+0;let tail=oi+16*r;for(let i=0;i<16;i++)out[tail+i]=input[ii+(2*r-1)*16+i];for(let i=0;i0)tail+=16;XorAndSalsa(out,head,input,ii+=16,out,tail)}}function scryptInit(password,salt,_opts){const opts=checkOpts({dkLen:32,asyncTick:10,maxmem:1024**3+1024},_opts);const{N,r,p,dkLen,asyncTick,maxmem,onProgress}=opts;number(N);number(r);number(p);number(dkLen);number(asyncTick);number(maxmem);if(onProgress!==undefined&&typeof onProgress!=="function")throw new Error("progressCb should be function");const blockSize=128*r;const blockSize32=blockSize/4;if(N<=1||(N&N-1)!==0||N>=2**(blockSize/8)||N>2**32){throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32")}if(p<0||p>(2**32-1)*32/blockSize){throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)")}if(dkLen<0||dkLen>(2**32-1)*32){throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32")}const memUsed=blockSize*(N+p);if(memUsed>maxmem){throw new Error(`Scrypt: parameters too large, ${memUsed} (128 * r * (N + p)) > ${maxmem} (maxmem)`)}const B=pbkdf2$1(sha256$1,password,salt,{c:1,dkLen:blockSize*p});const B32=u32(B);const V=u32(new Uint8Array(blockSize*N));const tmp=u32(new Uint8Array(blockSize));let blockMixCb=()=>{};if(onProgress){const totalBlockMix=2*N*p;const callbackPer=Math.max(Math.floor(totalBlockMix/1e4),1);let blockMixCnt=0;blockMixCb=()=>{blockMixCnt++;if(onProgress&&(!(blockMixCnt%callbackPer)||blockMixCnt===totalBlockMix))onProgress(blockMixCnt/totalBlockMix)}}return{N:N,r:r,p:p,dkLen:dkLen,blockSize32:blockSize32,V:V,B32:B32,B:B,tmp:tmp,blockMixCb:blockMixCb,asyncTick:asyncTick}}function scryptOutput(password,dkLen,B,V,tmp){const res=pbkdf2$1(sha256$1,password,B,{c:1,dkLen:dkLen});B.fill(0);V.fill(0);tmp.fill(0);return res}function scrypt$1(password,salt,opts){const{N,r,p,dkLen,blockSize32,V,B32,B,tmp,blockMixCb}=scryptInit(password,salt,opts);for(let pi=0;pi{BlockMix(V,pos,V,pos+=blockSize32,r);blockMixCb()});BlockMix(V,(N-1)*blockSize32,B32,Pi,r);blockMixCb();await asyncLoop(N,asyncTick,()=>{const j=B32[Pi+blockSize32-16]%N;for(let k=0;ka instanceof Uint8Array;const hexes=Array.from({length:256},(_,i)=>i.toString(16).padStart(2,"0"));function bytesToHex(bytes){if(!u8a(bytes))throw new Error("Uint8Array expected");let hex="";for(let i=0;isum+a.length,0));let pad=0;arrays.forEach(a=>{if(!u8a(a))throw new Error("Uint8Array expected");r.set(a,pad);pad+=a.length});return r}function equalBytes(b1,b2){if(b1.length!==b2.length)return false;for(let i=0;i_0n$3;n>>=_1n$4,len+=1);return len}function bitGet(n,pos){return n>>BigInt(pos)&_1n$4}const bitSet=(n,pos,value)=>{return n|(value?_1n$4:_0n$3)<(_2n$2<new Uint8Array(data);const u8fr=arr=>Uint8Array.from(arr);function createHmacDrbg(hashLen,qByteLen,hmacFn){if(typeof hashLen!=="number"||hashLen<2)throw new Error("hashLen must be a number");if(typeof qByteLen!=="number"||qByteLen<2)throw new Error("qByteLen must be a number");if(typeof hmacFn!=="function")throw new Error("hmacFn must be a function");let v=u8n(hashLen);let k=u8n(hashLen);let i=0;const reset=()=>{v.fill(1);k.fill(0);i=0};const h=(...b)=>hmacFn(k,v,...b);const reseed=(seed=u8n())=>{k=h(u8fr([0]),seed);v=h();if(seed.length===0)return;k=h(u8fr([1]),seed);v=h()};const gen=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let len=0;const out=[];while(len{reset();reseed(seed);let res=undefined;while(!(res=pred(gen())))reseed();reset();return res};return genUntil}const validatorFns={bigint:val=>typeof val==="bigint",function:val=>typeof val==="function",boolean:val=>typeof val==="boolean",string:val=>typeof val==="string",stringOrUint8Array:val=>typeof val==="string"||val instanceof Uint8Array,isSafeInteger:val=>Number.isSafeInteger(val),array:val=>Array.isArray(val),field:(val,object)=>object.Fp.isValid(val),hash:val=>typeof val==="function"&&Number.isSafeInteger(val.outputLen)};function validateObject(object,validators,optValidators={}){const checkField=(fieldName,type,isOptional)=>{const checkVal=validatorFns[type];if(typeof checkVal!=="function")throw new Error(`Invalid validator "${type}", expected function`);const val=object[fieldName];if(isOptional&&val===undefined)return;if(!checkVal(val,object)){throw new Error(`Invalid param ${String(fieldName)}=${val} (${typeof val}), expected ${type}`)}};for(const[fieldName,type]of Object.entries(validators))checkField(fieldName,type,false);for(const[fieldName,type]of Object.entries(optValidators))checkField(fieldName,type,true);return object}var ut=Object.freeze({__proto__:null,bitGet:bitGet,bitLen:bitLen,bitMask:bitMask,bitSet:bitSet,bytesToHex:bytesToHex,bytesToNumberBE:bytesToNumberBE,bytesToNumberLE:bytesToNumberLE,concatBytes:concatBytes,createHmacDrbg:createHmacDrbg,ensureBytes:ensureBytes,equalBytes:equalBytes,hexToBytes:hexToBytes,hexToNumber:hexToNumber,numberToBytesBE:numberToBytesBE,numberToBytesLE:numberToBytesLE,numberToHexUnpadded:numberToHexUnpadded,numberToVarBytesBE:numberToVarBytesBE,utf8ToBytes:utf8ToBytes,validateObject:validateObject});const _0n$2=BigInt(0),_1n$3=BigInt(1),_2n$1=BigInt(2),_3n$1=BigInt(3);const _4n=BigInt(4),_5n=BigInt(5),_8n=BigInt(8);BigInt(9);BigInt(16);function mod(a,b){const result=a%b;return result>=_0n$2?result:b+result}function pow(num,power,modulo){if(modulo<=_0n$2||power<_0n$2)throw new Error("Expected power/modulo > 0");if(modulo===_1n$3)return _0n$2;let res=_1n$3;while(power>_0n$2){if(power&_1n$3)res=res*num%modulo;num=num*num%modulo;power>>=_1n$3}return res}function pow2(x,power,modulo){let res=x;while(power-- >_0n$2){res*=res;res%=modulo}return res}function invert(number,modulo){if(number===_0n$2||modulo<=_0n$2){throw new Error(`invert: expected positive integers, got n=${number} mod=${modulo}`)}let a=mod(number,modulo);let b=modulo;let x=_0n$2,u=_1n$3;while(a!==_0n$2){const q=b/a;const r=b%a;const m=x-u*q;b=a,a=r,x=u,u=m}const gcd=b;if(gcd!==_1n$3)throw new Error("invert: does not exist");return mod(x,modulo)}function tonelliShanks(P){const legendreC=(P-_1n$3)/_2n$1;let Q,S,Z;for(Q=P-_1n$3,S=0;Q%_2n$1===_0n$2;Q/=_2n$1,S++);for(Z=_2n$1;Z{map[val]="function";return map},initial);return validateObject(field,opts)}function FpPow(f,num,power){if(power<_0n$2)throw new Error("Expected power > 0");if(power===_0n$2)return f.ONE;if(power===_1n$3)return num;let p=f.ONE;let d=num;while(power>_0n$2){if(power&_1n$3)p=f.mul(p,d);d=f.sqr(d);power>>=_1n$3}return p}function FpInvertBatch(f,nums){const tmp=new Array(nums.length);const lastMultiplied=nums.reduce((acc,num,i)=>{if(f.is0(num))return acc;tmp[i]=acc;return f.mul(acc,num)},f.ONE);const inverted=f.inv(lastMultiplied);nums.reduceRight((acc,num,i)=>{if(f.is0(num))return acc;tmp[i]=f.mul(acc,tmp[i]);return f.mul(acc,num)},inverted);return tmp}function nLength(n,nBitLength){const _nBitLength=nBitLength!==undefined?nBitLength:n.toString(2).length;const nByteLength=Math.ceil(_nBitLength/8);return{nBitLength:_nBitLength,nByteLength:nByteLength}}function Field(ORDER,bitLen,isLE=false,redef={}){if(ORDER<=_0n$2)throw new Error(`Expected Field ORDER > 0, got ${ORDER}`);const{nBitLength:BITS,nByteLength:BYTES}=nLength(ORDER,bitLen);if(BYTES>2048)throw new Error("Field lengths over 2048 bytes are not supported");const sqrtP=FpSqrt(ORDER);const f=Object.freeze({ORDER:ORDER,BITS:BITS,BYTES:BYTES,MASK:bitMask(BITS),ZERO:_0n$2,ONE:_1n$3,create:num=>mod(num,ORDER),isValid:num=>{if(typeof num!=="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof num}`);return _0n$2<=num&&numnum===_0n$2,isOdd:num=>(num&_1n$3)===_1n$3,neg:num=>mod(-num,ORDER),eql:(lhs,rhs)=>lhs===rhs,sqr:num=>mod(num*num,ORDER),add:(lhs,rhs)=>mod(lhs+rhs,ORDER),sub:(lhs,rhs)=>mod(lhs-rhs,ORDER),mul:(lhs,rhs)=>mod(lhs*rhs,ORDER),pow:(num,power)=>FpPow(f,num,power),div:(lhs,rhs)=>mod(lhs*invert(rhs,ORDER),ORDER),sqrN:num=>num*num,addN:(lhs,rhs)=>lhs+rhs,subN:(lhs,rhs)=>lhs-rhs,mulN:(lhs,rhs)=>lhs*rhs,inv:num=>invert(num,ORDER),sqrt:redef.sqrt||(n=>sqrtP(f,n)),invertBatch:lst=>FpInvertBatch(f,lst),cmov:(a,b,c)=>c?b:a,toBytes:num=>isLE?numberToBytesLE(num,BYTES):numberToBytesBE(num,BYTES),fromBytes:bytes=>{if(bytes.length!==BYTES)throw new Error(`Fp.fromBytes: expected ${BYTES}, got ${bytes.length}`);return isLE?bytesToNumberLE(bytes):bytesToNumberBE(bytes)}});return Object.freeze(f)}function getFieldBytesLength(fieldOrder){if(typeof fieldOrder!=="bigint")throw new Error("field order must be bigint");const bitLength=fieldOrder.toString(2).length;return Math.ceil(bitLength/8)}function getMinHashLength(fieldOrder){const length=getFieldBytesLength(fieldOrder);return length+Math.ceil(length/2)}function mapHashToField(key,fieldOrder,isLE=false){const len=key.length;const fieldLen=getFieldBytesLength(fieldOrder);const minLen=getMinHashLength(fieldOrder);if(len<16||len1024)throw new Error(`expected ${minLen}-1024 bytes of input, got ${len}`);const num=isLE?bytesToNumberBE(key):bytesToNumberLE(key);const reduced=mod(num,fieldOrder-_1n$3)+_1n$3;return isLE?numberToBytesLE(reduced,fieldLen):numberToBytesBE(reduced,fieldLen)}const _0n$1=BigInt(0);const _1n$2=BigInt(1);function wNAF(c,bits){const constTimeNegate=(condition,item)=>{const neg=item.negate();return condition?neg:item};const opts=W=>{const windows=Math.ceil(bits/W)+1;const windowSize=2**(W-1);return{windows:windows,windowSize:windowSize}};return{constTimeNegate:constTimeNegate,unsafeLadder(elm,n){let p=c.ZERO;let d=elm;while(n>_0n$1){if(n&_1n$2)p=p.add(d);d=d.double();n>>=_1n$2}return p},precomputeWindow(elm,W){const{windows,windowSize}=opts(W);const points=[];let p=elm;let base=p;for(let window=0;window>=shiftBy;if(wbits>windowSize){wbits-=maxNumber;n+=_1n$2}const offset1=offset;const offset2=offset+Math.abs(wbits)-1;const cond1=window%2!==0;const cond2=wbits<0;if(wbits===0){f=f.add(constTimeNegate(cond1,precomputes[offset1]))}else{p=p.add(constTimeNegate(cond2,precomputes[offset2]))}}return{p:p,f:f}},wNAFCached(P,precomputesMap,n,transform){const W=P._WINDOW_SIZE||1;let comp=precomputesMap.get(P);if(!comp){comp=this.precomputeWindow(P,W);if(W!==1){precomputesMap.set(P,transform(comp))}}return this.wNAF(W,comp,n)}}}function validateBasic(curve){validateField(curve.Fp);validateObject(curve,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"});return Object.freeze({...nLength(curve.n,curve.nBitLength),...curve,...{p:curve.Fp.ORDER}})}function validatePointOpts(curve){const opts=validateBasic(curve);validateObject(opts,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo,Fp,a}=opts;if(endo){if(!Fp.eql(a,Fp.ZERO)){throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0")}if(typeof endo!=="object"||typeof endo.beta!=="bigint"||typeof endo.splitScalar!=="function"){throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}}return Object.freeze({...opts})}const{bytesToNumberBE:b2n,hexToBytes:h2b}=ut;const DER={Err:class DERErr extends Error{constructor(m=""){super(m)}},_parseInt(data){const{Err:E}=DER;if(data.length<2||data[0]!==2)throw new E("Invalid signature integer tag");const len=data[1];const res=data.subarray(2,len+2);if(!len||res.length!==len)throw new E("Invalid signature integer: wrong length");if(res[0]&128)throw new E("Invalid signature integer: negative");if(res[0]===0&&!(res[1]&128))throw new E("Invalid signature integer: unnecessary leading zero");return{d:b2n(res),l:data.subarray(len+2)}},toSig(hex){const{Err:E}=DER;const data=typeof hex==="string"?h2b(hex):hex;if(!(data instanceof Uint8Array))throw new Error("ui8a expected");let l=data.length;if(l<2||data[0]!=48)throw new E("Invalid signature tag");if(data[1]!==l-2)throw new E("Invalid signature: incorrect length");const{d:r,l:sBytes}=DER._parseInt(data.subarray(2));const{d:s,l:rBytesLeft}=DER._parseInt(sBytes);if(rBytesLeft.length)throw new E("Invalid signature: left bytes after parsing");return{r:r,s:s}},hexFromSig(sig){const slice=s=>Number.parseInt(s[0],16)&8?"00"+s:s;const h=num=>{const hex=num.toString(16);return hex.length&1?`0${hex}`:hex};const s=slice(h(sig.s));const r=slice(h(sig.r));const shl=s.length/2;const rhl=r.length/2;const sl=h(shl);const rl=h(rhl);return`30${h(rhl+shl+4)}02${rl}${r}02${sl}${s}`}};const _0n=BigInt(0),_1n$1=BigInt(1);BigInt(2);const _3n=BigInt(3);BigInt(4);function weierstrassPoints(opts){const CURVE=validatePointOpts(opts);const{Fp}=CURVE;const toBytes=CURVE.toBytes||((_c,point,_isCompressed)=>{const a=point.toAffine();return concatBytes(Uint8Array.from([4]),Fp.toBytes(a.x),Fp.toBytes(a.y))});const fromBytes=CURVE.fromBytes||(bytes=>{const tail=bytes.subarray(1);const x=Fp.fromBytes(tail.subarray(0,Fp.BYTES));const y=Fp.fromBytes(tail.subarray(Fp.BYTES,2*Fp.BYTES));return{x:x,y:y}});function weierstrassEquation(x){const{a,b}=CURVE;const x2=Fp.sqr(x);const x3=Fp.mul(x2,x);return Fp.add(Fp.add(x3,Fp.mul(x,a)),b)}if(!Fp.eql(Fp.sqr(CURVE.Gy),weierstrassEquation(CURVE.Gx)))throw new Error("bad generator point: equation left != right");function isWithinCurveOrder(num){return typeof num==="bigint"&&_0nFp.eql(i,Fp.ZERO);if(is0(x)&&is0(y))return Point.ZERO;return new Point(x,y,Fp.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(points){const toInv=Fp.invertBatch(points.map(p=>p.pz));return points.map((p,i)=>p.toAffine(toInv[i])).map(Point.fromAffine)}static fromHex(hex){const P=Point.fromAffine(fromBytes(ensureBytes("pointHex",hex)));P.assertValidity();return P}static fromPrivateKey(privateKey){return Point.BASE.multiply(normPrivateKeyToScalar(privateKey))}_setWindowSize(windowSize){this._WINDOW_SIZE=windowSize;pointPrecomputes.delete(this)}assertValidity(){if(this.is0()){if(CURVE.allowInfinityPoint&&!Fp.is0(this.py))return;throw new Error("bad point: ZERO")}const{x,y}=this.toAffine();if(!Fp.isValid(x)||!Fp.isValid(y))throw new Error("bad point: x or y not FE");const left=Fp.sqr(y);const right=weierstrassEquation(x);if(!Fp.eql(left,right))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y}=this.toAffine();if(Fp.isOdd)return!Fp.isOdd(y);throw new Error("Field doesn't support isOdd")}equals(other){assertPrjPoint(other);const{px:X1,py:Y1,pz:Z1}=this;const{px:X2,py:Y2,pz:Z2}=other;const U1=Fp.eql(Fp.mul(X1,Z2),Fp.mul(X2,Z1));const U2=Fp.eql(Fp.mul(Y1,Z2),Fp.mul(Y2,Z1));return U1&&U2}negate(){return new Point(this.px,Fp.neg(this.py),this.pz)}double(){const{a,b}=CURVE;const b3=Fp.mul(b,_3n);const{px:X1,py:Y1,pz:Z1}=this;let X3=Fp.ZERO,Y3=Fp.ZERO,Z3=Fp.ZERO;let t0=Fp.mul(X1,X1);let t1=Fp.mul(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=Fp.mul(X3,Z3);t1=Fp.add(t0,t0);t1=Fp.add(t1,t0);t2=Fp.mul(a,t2);t4=Fp.mul(b3,t4);t1=Fp.add(t1,t2);t2=Fp.sub(t0,t2);t2=Fp.mul(a,t2);t4=Fp.add(t4,t2);t0=Fp.mul(t1,t4);Y3=Fp.add(Y3,t0);t0=Fp.mul(t5,t4);X3=Fp.mul(t3,X3);X3=Fp.sub(X3,t0);t0=Fp.mul(t3,t1);Z3=Fp.mul(t5,Z3);Z3=Fp.add(Z3,t0);return new Point(X3,Y3,Z3)}subtract(other){return this.add(other.negate())}is0(){return this.equals(Point.ZERO)}wNAF(n){return wnaf.wNAFCached(this,pointPrecomputes,n,comp=>{const toInv=Fp.invertBatch(comp.map(p=>p.pz));return comp.map((p,i)=>p.toAffine(toInv[i])).map(Point.fromAffine)})}multiplyUnsafe(n){const I=Point.ZERO;if(n===_0n)return I;assertGE(n);if(n===_1n$1)return this;const{endo}=CURVE;if(!endo)return wnaf.unsafeLadder(this,n);let{k1neg,k1,k2neg,k2}=endo.splitScalar(n);let k1p=I;let k2p=I;let d=this;while(k1>_0n||k2>_0n){if(k1&_1n$1)k1p=k1p.add(d);if(k2&_1n$1)k2p=k2p.add(d);d=d.double();k1>>=_1n$1;k2>>=_1n$1}if(k1neg)k1p=k1p.negate();if(k2neg)k2p=k2p.negate();k2p=new Point(Fp.mul(k2p.px,endo.beta),k2p.py,k2p.pz);return k1p.add(k2p)}multiply(scalar){assertGE(scalar);let n=scalar;let point,fake;const{endo}=CURVE;if(endo){const{k1neg,k1,k2neg,k2}=endo.splitScalar(n);let{p:k1p,f:f1p}=this.wNAF(k1);let{p:k2p,f:f2p}=this.wNAF(k2);k1p=wnaf.constTimeNegate(k1neg,k1p);k2p=wnaf.constTimeNegate(k2neg,k2p);k2p=new Point(Fp.mul(k2p.px,endo.beta),k2p.py,k2p.pz);point=k1p.add(k2p);fake=f1p.add(f2p)}else{const{p,f}=this.wNAF(n);point=p;fake=f}return Point.normalizeZ([point,fake])[0]}multiplyAndAddUnsafe(Q,a,b){const G=Point.BASE;const mul=(P,a)=>a===_0n||a===_1n$1||!P.equals(G)?P.multiplyUnsafe(a):P.multiply(a);const sum=mul(this,a).add(mul(Q,b));return sum.is0()?undefined:sum}toAffine(iz){const{px:x,py:y,pz:z}=this;const is0=this.is0();if(iz==null)iz=is0?Fp.ONE:Fp.inv(z);const ax=Fp.mul(x,iz);const ay=Fp.mul(y,iz);const zz=Fp.mul(z,iz);if(is0)return{x:Fp.ZERO,y:Fp.ZERO};if(!Fp.eql(zz,Fp.ONE))throw new Error("invZ was invalid");return{x:ax,y:ay}}isTorsionFree(){const{h:cofactor,isTorsionFree}=CURVE;if(cofactor===_1n$1)return true;if(isTorsionFree)return isTorsionFree(Point,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:cofactor,clearCofactor}=CURVE;if(cofactor===_1n$1)return this;if(clearCofactor)return clearCofactor(Point,this);return this.multiplyUnsafe(CURVE.h)}toRawBytes(isCompressed=true){this.assertValidity();return toBytes(Point,this,isCompressed)}toHex(isCompressed=true){return bytesToHex(this.toRawBytes(isCompressed))}}Point.BASE=new Point(CURVE.Gx,CURVE.Gy,Fp.ONE);Point.ZERO=new Point(Fp.ZERO,Fp.ONE,Fp.ZERO);const _bits=CURVE.nBitLength;const wnaf=wNAF(Point,CURVE.endo?Math.ceil(_bits/2):_bits);return{CURVE:CURVE,ProjectivePoint:Point,normPrivateKeyToScalar:normPrivateKeyToScalar,weierstrassEquation:weierstrassEquation,isWithinCurveOrder:isWithinCurveOrder}}function validateOpts(curve){const opts=validateBasic(curve);validateObject(opts,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"});return Object.freeze({lowS:true,...opts})}function weierstrass(curveDef){const CURVE=validateOpts(curveDef);const{Fp,n:CURVE_ORDER}=CURVE;const compressedLen=Fp.BYTES+1;const uncompressedLen=2*Fp.BYTES+1;function isValidFieldElement(num){return _0nbytesToHex(numberToBytesBE(num,CURVE.nByteLength));function isBiggerThanHalfOrder(number){const HALF=CURVE_ORDER>>_1n$1;return number>HALF}function normalizeS(s){return isBiggerThanHalfOrder(s)?modN(-s):s}const slcNum=(b,from,to)=>bytesToNumberBE(b.slice(from,to));class Signature{constructor(r,s,recovery){this.r=r;this.s=s;this.recovery=recovery;this.assertValidity()}static fromCompact(hex){const l=CURVE.nByteLength;hex=ensureBytes("compactSignature",hex,l*2);return new Signature(slcNum(hex,0,l),slcNum(hex,l,2*l))}static fromDER(hex){const{r,s}=DER.toSig(ensureBytes("DER",hex));return new Signature(r,s)}assertValidity(){if(!isWithinCurveOrder(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!isWithinCurveOrder(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(recovery){return new Signature(this.r,this.s,recovery)}recoverPublicKey(msgHash){const{r,s,recovery:rec}=this;const h=bits2int_modN(ensureBytes("msgHash",msgHash));if(rec==null||![0,1,2,3].includes(rec))throw new Error("recovery id invalid");const radj=rec===2||rec===3?r+CURVE.n:r;if(radj>=Fp.ORDER)throw new Error("recovery id 2 or 3 invalid");const prefix=(rec&1)===0?"02":"03";const R=Point.fromHex(prefix+numToNByteStr(radj));const ir=invN(radj);const u1=modN(-h*ir);const u2=modN(s*ir);const Q=Point.BASE.multiplyAndAddUnsafe(R,u1,u2);if(!Q)throw new Error("point at infinify");Q.assertValidity();return Q}hasHighS(){return isBiggerThanHalfOrder(this.s)}normalizeS(){return this.hasHighS()?new Signature(this.r,modN(-this.s),this.recovery):this}toDERRawBytes(){return hexToBytes(this.toDERHex())}toDERHex(){return DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return hexToBytes(this.toCompactHex())}toCompactHex(){return numToNByteStr(this.r)+numToNByteStr(this.s)}}const utils={isValidPrivateKey(privateKey){try{normPrivateKeyToScalar(privateKey);return true}catch(error){return false}},normPrivateKeyToScalar:normPrivateKeyToScalar,randomPrivateKey:()=>{const length=getMinHashLength(CURVE.n);return mapHashToField(CURVE.randomBytes(length),CURVE.n)},precompute(windowSize=8,point=Point.BASE){point._setWindowSize(windowSize);point.multiply(BigInt(3));return point}};function getPublicKey(privateKey,isCompressed=true){return Point.fromPrivateKey(privateKey).toRawBytes(isCompressed)}function isProbPub(item){const arr=item instanceof Uint8Array;const str=typeof item==="string";const len=(arr||str)&&item.length;if(arr)return len===compressedLen||len===uncompressedLen;if(str)return len===2*compressedLen||len===2*uncompressedLen;if(item instanceof Point)return true;return false}function getSharedSecret(privateA,publicB,isCompressed=true){if(isProbPub(privateA))throw new Error("first arg must be private key");if(!isProbPub(publicB))throw new Error("second arg must be public key");const b=Point.fromHex(publicB);return b.multiply(normPrivateKeyToScalar(privateA)).toRawBytes(isCompressed)}const bits2int=CURVE.bits2int||function(bytes){const num=bytesToNumberBE(bytes);const delta=bytes.length*8-CURVE.nBitLength;return delta>0?num>>BigInt(delta):num};const bits2int_modN=CURVE.bits2int_modN||function(bytes){return modN(bits2int(bytes))};const ORDER_MASK=bitMask(CURVE.nBitLength);function int2octets(num){if(typeof num!=="bigint")throw new Error("bigint expected");if(!(_0n<=num&&numk in opts))throw new Error("sign() legacy options not supported");const{hash,randomBytes}=CURVE;let{lowS,prehash,extraEntropy:ent}=opts;if(lowS==null)lowS=true;msgHash=ensureBytes("msgHash",msgHash);if(prehash)msgHash=ensureBytes("prehashed msgHash",hash(msgHash));const h1int=bits2int_modN(msgHash);const d=normPrivateKeyToScalar(privateKey);const seedArgs=[int2octets(d),int2octets(h1int)];if(ent!=null){const e=ent===true?randomBytes(Fp.BYTES):ent;seedArgs.push(ensureBytes("extraEntropy",e))}const seed=concatBytes(...seedArgs);const m=h1int;function k2sig(kBytes){const k=bits2int(kBytes);if(!isWithinCurveOrder(k))return;const ik=invN(k);const q=Point.BASE.multiply(k).toAffine();const r=modN(q.x);if(r===_0n)return;const s=modN(ik*modN(m+r*d));if(s===_0n)return;let recovery=(q.x===r?0:2)|Number(q.y&_1n$1);let normS=s;if(lowS&&isBiggerThanHalfOrder(s)){normS=normalizeS(s);recovery^=1}return new Signature(r,normS,recovery)}return{seed:seed,k2sig:k2sig}}const defaultSigOpts={lowS:CURVE.lowS,prehash:false};const defaultVerOpts={lowS:CURVE.lowS,prehash:false};function sign(msgHash,privKey,opts=defaultSigOpts){const{seed,k2sig}=prepSig(msgHash,privKey,opts);const C=CURVE;const drbg=createHmacDrbg(C.hash.outputLen,C.nByteLength,C.hmac);return drbg(seed,k2sig)}Point.BASE._setWindowSize(8);function verify(signature,msgHash,publicKey,opts=defaultVerOpts){const sg=signature;msgHash=ensureBytes("msgHash",msgHash);publicKey=ensureBytes("publicKey",publicKey);if("strict"in opts)throw new Error("options.strict was renamed to lowS");const{lowS,prehash}=opts;let _sig=undefined;let P;try{if(typeof sg==="string"||sg instanceof Uint8Array){try{_sig=Signature.fromDER(sg)}catch(derError){if(!(derError instanceof DER.Err))throw derError;_sig=Signature.fromCompact(sg)}}else if(typeof sg==="object"&&typeof sg.r==="bigint"&&typeof sg.s==="bigint"){const{r,s}=sg;_sig=new Signature(r,s)}else{throw new Error("PARSE")}P=Point.fromHex(publicKey)}catch(error){if(error.message==="PARSE")throw new Error(`signature must be Signature instance, Uint8Array or hex string`);return false}if(lowS&&_sig.hasHighS())return false;if(prehash)msgHash=CURVE.hash(msgHash);const{r,s}=_sig;const h=bits2int_modN(msgHash);const is=invN(s);const u1=modN(h*is);const u2=modN(r*is);const R=Point.BASE.multiplyAndAddUnsafe(P,u1,u2)?.toAffine();if(!R)return false;const v=modN(R.x);return v===r}return{CURVE:CURVE,getPublicKey:getPublicKey,getSharedSecret:getSharedSecret,sign:sign,verify:verify,ProjectivePoint:Point,Signature:Signature,utils:utils}}function getHash(hash){return{hash:hash,hmac:(key,...msgs)=>hmac(hash,key,concatBytes$1(...msgs)),randomBytes:randomBytes$2}}function createCurve(curveDef,defHash){const create=hash=>weierstrass({...curveDef,...getHash(hash)});return Object.freeze({...create(defHash),create:create})}const secp256k1P=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f");const secp256k1N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");const _1n=BigInt(1);const _2n=BigInt(2);const divNearest=(a,b)=>(a+b/_2n)/b;function sqrtMod(y){const P=secp256k1P;const _3n=BigInt(3),_6n=BigInt(6),_11n=BigInt(11),_22n=BigInt(22);const _23n=BigInt(23),_44n=BigInt(44),_88n=BigInt(88);const b2=y*y*y%P;const b3=b2*b2*y%P;const b6=pow2(b3,_3n,P)*b3%P;const b9=pow2(b6,_3n,P)*b3%P;const b11=pow2(b9,_2n,P)*b2%P;const b22=pow2(b11,_11n,P)*b11%P;const b44=pow2(b22,_22n,P)*b22%P;const b88=pow2(b44,_44n,P)*b44%P;const b176=pow2(b88,_88n,P)*b88%P;const b220=pow2(b176,_44n,P)*b44%P;const b223=pow2(b220,_3n,P)*b3%P;const t1=pow2(b223,_23n,P)*b22%P;const t2=pow2(t1,_6n,P)*b2%P;const root=pow2(t2,_2n,P);if(!Fp.eql(Fp.sqr(root),y))throw new Error("Cannot find square root");return root}const Fp=Field(secp256k1P,undefined,undefined,{sqrt:sqrtMod});const secp256k1=createCurve({a:BigInt(0),b:BigInt(7),Fp:Fp,n:secp256k1N,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:true,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:k=>{const n=secp256k1N;const a1=BigInt("0x3086d221a7d46bcde86c90e49284eb15");const b1=-_1n*BigInt("0xe4437ed6010e88286f547fa90abfe4c3");const a2=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8");const b2=a1;const POW_2_128=BigInt("0x100000000000000000000000000000000");const c1=divNearest(b2*k,n);const c2=divNearest(-b1*k,n);let k1=mod(k-c1*a1-c2*a2,n);let k2=mod(-c1*b1-c2*b2,n);const k1neg=k1>POW_2_128;const k2neg=k2>POW_2_128;if(k1neg)k1=n-k1;if(k2neg)k2=n-k2;if(k1>POW_2_128||k2>POW_2_128){throw new Error("splitScalar: Endomorphism failed, k="+k)}return{k1neg:k1neg,k1:k1,k2neg:k2neg,k2:k2}}}},sha256$1);BigInt(0);secp256k1.ProjectivePoint;const ZeroAddress="0x0000000000000000000000000000000000000000";const ZeroHash="0x0000000000000000000000000000000000000000000000000000000000000000";const N$1=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");const WeiPerEther=BigInt("1000000000000000000");const MaxUint256=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const MinInt256=BigInt("0x8000000000000000000000000000000000000000000000000000000000000000")*BigInt(-1);const MaxInt256=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const EtherSymbol="Ξ";const MessagePrefix="Ethereum Signed Message:\n";const BN_0$7=BigInt(0);const BN_1$3=BigInt(1);const BN_2$3=BigInt(2);const BN_27$1=BigInt(27);const BN_28$1=BigInt(28);const BN_35$1=BigInt(35);const BN_N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");const BN_N_2=BN_N/BN_2$3;const inspect$1=Symbol.for("nodejs.util.inspect.custom");const _guard$3={};function toUint256(value){return zeroPadValue(toBeArray(value),32)}class Signature{#r;#s;#v;#networkV;get r(){return this.#r}set r(value){assertArgument(dataLength(value)===32,"invalid r","value",value);this.#r=hexlify(value)}get s(){assertArgument(parseInt(this.#s.substring(0,3))<8,"non-canonical s; use ._s","s",this.#s);return this.#s}set s(_value){assertArgument(dataLength(_value)===32,"invalid s","value",_value);this.#s=hexlify(_value)}get _s(){return this.#s}isValid(){const s=BigInt(this.#s);return s<=BN_N_2}get v(){return this.#v}set v(value){const v=getNumber(value,"value");assertArgument(v===27||v===28,"invalid v","v",value);this.#v=v}get networkV(){return this.#networkV}get legacyChainId(){const v=this.networkV;if(v==null){return null}return Signature.getChainId(v)}get yParity(){return this.v===27?0:1}get yParityAndS(){const yParityAndS=getBytes(this.s);if(this.yParity){yParityAndS[0]|=128}return hexlify(yParityAndS)}get compactSerialized(){return concat([this.r,this.yParityAndS])}get serialized(){return concat([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(guard,r,s,v){assertPrivate(guard,_guard$3,"Signature");this.#r=r;this.#s=s;this.#v=v;this.#networkV=null}getCanonical(){if(this.isValid()){return this}const s=BN_N-BigInt(this._s);const v=55-this.v;const result=new Signature(_guard$3,this.r,toUint256(s),v);if(this.networkV){result.#networkV=this.networkV}return result}clone(){const clone=new Signature(_guard$3,this.r,this._s,this.v);if(this.networkV){clone.#networkV=this.networkV}return clone}toJSON(){const networkV=this.networkV;return{_type:"signature",networkV:networkV!=null?networkV.toString():null,r:this.r,s:this._s,v:this.v}}[inspect$1](){return this.toString()}toString(){if(this.isValid()){return`Signature { r: ${this.r}, s: ${this._s}, v: ${this.v} }`}return`Signature { r: ${this.r}, s: ${this._s}, v: ${this.v}, valid: false }`}static getChainId(v){const bv=getBigInt(v,"v");if(bv==BN_27$1||bv==BN_28$1){return BN_0$7}assertArgument(bv>=BN_35$1,"invalid EIP-155 v","v",v);return(bv-BN_35$1)/BN_2$3}static getChainIdV(chainId,v){return getBigInt(chainId)*BN_2$3+BigInt(35+v-27)}static getNormalizedV(v){const bv=getBigInt(v);if(bv===BN_0$7||bv===BN_27$1){return 27}if(bv===BN_1$3||bv===BN_28$1){return 28}assertArgument(bv>=BN_35$1,"invalid v","v",v);return bv&BN_1$3?27:28}static from(sig){function assertError(check,message){assertArgument(check,message,"signature",sig)}if(sig==null){return new Signature(_guard$3,ZeroHash,ZeroHash,27)}if(typeof sig==="string"){const bytes=getBytes(sig,"signature");if(bytes.length===64){const r=hexlify(bytes.slice(0,32));const s=bytes.slice(32,64);const v=s[0]&128?28:27;s[0]&=127;return new Signature(_guard$3,r,hexlify(s),v)}if(bytes.length===65){const r=hexlify(bytes.slice(0,32));const s=hexlify(bytes.slice(32,64));const v=Signature.getNormalizedV(bytes[64]);return new Signature(_guard$3,r,s,v)}assertError(false,"invalid raw signature length")}if(sig instanceof Signature){return sig.clone()}const _r=sig.r;assertError(_r!=null,"missing r");const r=toUint256(_r);const s=function(s,yParityAndS){if(s!=null){return toUint256(s)}if(yParityAndS!=null){assertError(isHexString(yParityAndS,32),"invalid yParityAndS");const bytes=getBytes(yParityAndS);bytes[0]&=127;return hexlify(bytes)}assertError(false,"missing s")}(sig.s,sig.yParityAndS);const{networkV,v}=function(_v,yParityAndS,yParity){if(_v!=null){const v=getBigInt(_v);return{networkV:v>=BN_35$1?v:undefined,v:Signature.getNormalizedV(v)}}if(yParityAndS!=null){assertError(isHexString(yParityAndS,32),"invalid yParityAndS");return{v:getBytes(yParityAndS)[0]&128?28:27}}if(yParity!=null){switch(getNumber(yParity,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}assertError(false,"invalid yParity")}assertError(false,"missing v")}(sig.v,sig.yParityAndS,sig.yParity);const result=new Signature(_guard$3,r,s,v);if(networkV){result.#networkV=networkV}assertError(sig.yParity==null||getNumber(sig.yParity,"sig.yParity")===result.yParity,"yParity mismatch");assertError(sig.yParityAndS==null||sig.yParityAndS===result.yParityAndS,"yParityAndS mismatch");return result}}class SigningKey{#privateKey;constructor(privateKey){assertArgument(dataLength(privateKey)===32,"invalid private key","privateKey","[REDACTED]");this.#privateKey=hexlify(privateKey)}get privateKey(){return this.#privateKey}get publicKey(){return SigningKey.computePublicKey(this.#privateKey)}get compressedPublicKey(){return SigningKey.computePublicKey(this.#privateKey,true)}sign(digest){assertArgument(dataLength(digest)===32,"invalid digest length","digest",digest);const sig=secp256k1.sign(getBytesCopy(digest),getBytesCopy(this.#privateKey),{lowS:true});return Signature.from({r:toBeHex(sig.r,32),s:toBeHex(sig.s,32),v:sig.recovery?28:27})}computeSharedSecret(other){const pubKey=SigningKey.computePublicKey(other);return hexlify(secp256k1.getSharedSecret(getBytesCopy(this.#privateKey),getBytes(pubKey),false))}static computePublicKey(key,compressed){let bytes=getBytes(key,"key");if(bytes.length===32){const pubKey=secp256k1.getPublicKey(bytes,!!compressed);return hexlify(pubKey)}if(bytes.length===64){const pub=new Uint8Array(65);pub[0]=4;pub.set(bytes,1);bytes=pub}const point=secp256k1.ProjectivePoint.fromHex(bytes);return hexlify(point.toRawBytes(compressed))}static recoverPublicKey(digest,signature){assertArgument(dataLength(digest)===32,"invalid digest length","digest",digest);const sig=Signature.from(signature);let secpSig=secp256k1.Signature.fromCompact(getBytesCopy(concat([sig.r,sig.s])));secpSig=secpSig.addRecoveryBit(sig.yParity);const pubKey=secpSig.recoverPublicKey(getBytesCopy(digest));assertArgument(pubKey!=null,"invalid signature for digest","signature",signature);return"0x"+pubKey.toHex(false)}static addPoints(p0,p1,compressed){const pub0=secp256k1.ProjectivePoint.fromHex(SigningKey.computePublicKey(p0).substring(2));const pub1=secp256k1.ProjectivePoint.fromHex(SigningKey.computePublicKey(p1).substring(2));return"0x"+pub0.add(pub1).toHex(!!compressed)}}function lock(){computeHmac.lock();keccak256.lock();pbkdf2.lock();randomBytes.lock();ripemd160.lock();scrypt.lock();scryptSync.lock();sha256.lock();sha512.lock();randomBytes.lock()}const BN_0$6=BigInt(0);const BN_36=BigInt(36);function getChecksumAddress(address){address=address.toLowerCase();const chars=address.substring(2).split("");const expanded=new Uint8Array(40);for(let i=0;i<40;i++){expanded[i]=chars[i].charCodeAt(0)}const hashed=getBytes(keccak256(expanded));for(let i=0;i<40;i+=2){if(hashed[i>>1]>>4>=8){chars[i]=chars[i].toUpperCase()}if((hashed[i>>1]&15)>=8){chars[i+1]=chars[i+1].toUpperCase()}}return"0x"+chars.join("")}const ibanLookup={};for(let i=0;i<10;i++){ibanLookup[String(i)]=String(i)}for(let i=0;i<26;i++){ibanLookup[String.fromCharCode(65+i)]=String(10+i)}const safeDigits=15;function ibanChecksum(address){address=address.toUpperCase();address=address.substring(4)+address.substring(0,2)+"00";let expanded=address.split("").map(c=>{return ibanLookup[c]}).join("");while(expanded.length>=safeDigits){let block=expanded.substring(0,safeDigits);expanded=parseInt(block,10)%97+expanded.substring(block.length)}let checksum=String(98-parseInt(expanded,10)%97);while(checksum.length<2){checksum="0"+checksum}return checksum}const Base36=function(){const result={};for(let i=0;i<36;i++){const key="0123456789abcdefghijklmnopqrstuvwxyz"[i];result[key]=BigInt(i)}return result}();function fromBase36(value){value=value.toLowerCase();let result=BN_0$6;for(let i=0;iv.format()).join(",")})`}return this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple"){throw TypeError("not a tuple")}return this.#options}get arrayLength(){if(this.type!=="array"){throw TypeError("not an array")}if(this.#options===true){return-1}if(this.#options===false){return this.value.length}return null}static from(type,value){return new Typed(_gaurd,type,value)}static uint8(v){return n(v,8)}static uint16(v){return n(v,16)}static uint24(v){return n(v,24)}static uint32(v){return n(v,32)}static uint40(v){return n(v,40)}static uint48(v){return n(v,48)}static uint56(v){return n(v,56)}static uint64(v){return n(v,64)}static uint72(v){return n(v,72)}static uint80(v){return n(v,80)}static uint88(v){return n(v,88)}static uint96(v){return n(v,96)}static uint104(v){return n(v,104)}static uint112(v){return n(v,112)}static uint120(v){return n(v,120)}static uint128(v){return n(v,128)}static uint136(v){return n(v,136)}static uint144(v){return n(v,144)}static uint152(v){return n(v,152)}static uint160(v){return n(v,160)}static uint168(v){return n(v,168)}static uint176(v){return n(v,176)}static uint184(v){return n(v,184)}static uint192(v){return n(v,192)}static uint200(v){return n(v,200)}static uint208(v){return n(v,208)}static uint216(v){return n(v,216)}static uint224(v){return n(v,224)}static uint232(v){return n(v,232)}static uint240(v){return n(v,240)}static uint248(v){return n(v,248)}static uint256(v){return n(v,256)}static uint(v){return n(v,256)}static int8(v){return n(v,-8)}static int16(v){return n(v,-16)}static int24(v){return n(v,-24)}static int32(v){return n(v,-32)}static int40(v){return n(v,-40)}static int48(v){return n(v,-48)}static int56(v){return n(v,-56)}static int64(v){return n(v,-64)}static int72(v){return n(v,-72)}static int80(v){return n(v,-80)}static int88(v){return n(v,-88)}static int96(v){return n(v,-96)}static int104(v){return n(v,-104)}static int112(v){return n(v,-112)}static int120(v){return n(v,-120)}static int128(v){return n(v,-128)}static int136(v){return n(v,-136)}static int144(v){return n(v,-144)}static int152(v){return n(v,-152)}static int160(v){return n(v,-160)}static int168(v){return n(v,-168)}static int176(v){return n(v,-176)}static int184(v){return n(v,-184)}static int192(v){return n(v,-192)}static int200(v){return n(v,-200)}static int208(v){return n(v,-208)}static int216(v){return n(v,-216)}static int224(v){return n(v,-224)}static int232(v){return n(v,-232)}static int240(v){return n(v,-240)}static int248(v){return n(v,-248)}static int256(v){return n(v,-256)}static int(v){return n(v,-256)}static bytes1(v){return b(v,1)}static bytes2(v){return b(v,2)}static bytes3(v){return b(v,3)}static bytes4(v){return b(v,4)}static bytes5(v){return b(v,5)}static bytes6(v){return b(v,6)}static bytes7(v){return b(v,7)}static bytes8(v){return b(v,8)}static bytes9(v){return b(v,9)}static bytes10(v){return b(v,10)}static bytes11(v){return b(v,11)}static bytes12(v){return b(v,12)}static bytes13(v){return b(v,13)}static bytes14(v){return b(v,14)}static bytes15(v){return b(v,15)}static bytes16(v){return b(v,16)}static bytes17(v){return b(v,17)}static bytes18(v){return b(v,18)}static bytes19(v){return b(v,19)}static bytes20(v){return b(v,20)}static bytes21(v){return b(v,21)}static bytes22(v){return b(v,22)}static bytes23(v){return b(v,23)}static bytes24(v){return b(v,24)}static bytes25(v){return b(v,25)}static bytes26(v){return b(v,26)}static bytes27(v){return b(v,27)}static bytes28(v){return b(v,28)}static bytes29(v){return b(v,29)}static bytes30(v){return b(v,30)}static bytes31(v){return b(v,31)}static bytes32(v){return b(v,32)}static address(v){return new Typed(_gaurd,"address",v)}static bool(v){return new Typed(_gaurd,"bool",!!v)}static bytes(v){return new Typed(_gaurd,"bytes",v)}static string(v){return new Typed(_gaurd,"string",v)}static array(v,dynamic){throw new Error("not implemented yet")}static tuple(v,name){throw new Error("not implemented yet")}static overrides(v){return new Typed(_gaurd,"overrides",Object.assign({},v))}static isTyped(value){return value&&typeof value==="object"&&"_typedSymbol"in value&&value._typedSymbol===_typedSymbol}static dereference(value,type){if(Typed.isTyped(value)){if(value.type!==type){throw new Error(`invalid type: expecetd ${type}, got ${value.type}`)}return value.value}return value}}class AddressCoder extends Coder{constructor(localName){super("address","address",localName,false)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(writer,_value){let value=Typed.dereference(_value,"string");try{value=getAddress(value)}catch(error){return this._throwError(error.message,_value)}return writer.writeValue(value)}decode(reader){return getAddress(toBeHex(reader.readValue(),20))}}class AnonymousCoder extends Coder{coder;constructor(coder){super(coder.name,coder.type,"_",coder.dynamic);this.coder=coder}defaultValue(){return this.coder.defaultValue()}encode(writer,value){return this.coder.encode(writer,value)}decode(reader){return this.coder.decode(reader)}}function pack(writer,coders,values){let arrayValues=[];if(Array.isArray(values)){arrayValues=values}else if(values&&typeof values==="object"){let unique={};arrayValues=coders.map(coder=>{const name=coder.localName;assert(name,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:coder},value:values});assert(!unique[name],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:coder},value:values});unique[name]=true;return values[name]})}else{assertArgument(false,"invalid tuple value","tuple",values)}assertArgument(coders.length===arrayValues.length,"types/value length mismatch","tuple",values);let staticWriter=new Writer;let dynamicWriter=new Writer;let updateFuncs=[];coders.forEach((coder,index)=>{let value=arrayValues[index];if(coder.dynamic){let dynamicOffset=dynamicWriter.length;coder.encode(dynamicWriter,value);let updateFunc=staticWriter.writeUpdatableValue();updateFuncs.push(baseOffset=>{updateFunc(baseOffset+dynamicOffset)})}else{coder.encode(staticWriter,value)}});updateFuncs.forEach(func=>{func(staticWriter.length)});let length=writer.appendWriter(staticWriter);length+=writer.appendWriter(dynamicWriter);return length}function unpack(reader,coders){let values=[];let keys=[];let baseReader=reader.subReader(0);coders.forEach(coder=>{let value=null;if(coder.dynamic){let offset=reader.readIndex();let offsetReader=baseReader.subReader(offset);try{value=coder.decode(offsetReader)}catch(error){if(isError(error,"BUFFER_OVERRUN")){throw error}value=error;value.baseType=coder.name;value.name=coder.localName;value.type=coder.type}}else{try{value=coder.decode(reader)}catch(error){if(isError(error,"BUFFER_OVERRUN")){throw error}value=error;value.baseType=coder.name;value.name=coder.localName;value.type=coder.type}}if(value==undefined){throw new Error("investigate")}values.push(value);keys.push(coder.localName||null)});return Result.fromItems(values,keys)}class ArrayCoder extends Coder{coder;length;constructor(coder,length,localName){const type=coder.type+"["+(length>=0?length:"")+"]";const dynamic=length===-1||coder.dynamic;super("array",type,localName,dynamic);defineProperties(this,{coder:coder,length:length})}defaultValue(){const defaultChild=this.coder.defaultValue();const result=[];for(let i=0;ibounds||value<-(bounds+BN_1$2)){this._throwError("value out-of-bounds",_value)}value=toTwos(value,8*WordSize)}else if(valuemask(maxUintValue,this.size*8)){this._throwError("value out-of-bounds",_value)}return writer.writeValue(value)}decode(reader){let value=mask(reader.readValue(),this.size*8);if(this.signed){value=fromTwos(value,this.size*8)}return value}}class StringCoder extends DynamicBytesCoder{constructor(localName){super("string",localName)}defaultValue(){return""}encode(writer,_value){return super.encode(writer,toUtf8Bytes(Typed.dereference(_value,"string")))}decode(reader){return toUtf8String(super.decode(reader))}}class TupleCoder extends Coder{coders;constructor(coders,localName){let dynamic=false;const types=[];coders.forEach(coder=>{if(coder.dynamic){dynamic=true}types.push(coder.type)});const type="tuple("+types.join(",")+")";super("tuple",type,localName,dynamic);defineProperties(this,{coders:Object.freeze(coders.slice())})}defaultValue(){const values=[];this.coders.forEach(coder=>{values.push(coder.defaultValue())});const uniqueNames=this.coders.reduce((accum,coder)=>{const name=coder.localName;if(name){if(!accum[name]){accum[name]=0}accum[name]++}return accum},{});this.coders.forEach((coder,index)=>{let name=coder.localName;if(!name||uniqueNames[name]!==1){return}if(name==="length"){name="_length"}if(values[name]!=null){return}values[name]=values[index]});return Object.freeze(values)}encode(writer,_value){const value=Typed.dereference(_value,"tuple");return pack(writer,this.coders,value)}decode(reader){return unpack(reader,this.coders)}}function accessSetify(addr,storageKeys){return{address:getAddress(addr),storageKeys:storageKeys.map((storageKey,index)=>{assertArgument(isHexString(storageKey,32),"invalid slot",`storageKeys[${index}]`,storageKey);return storageKey.toLowerCase()})}}function accessListify(value){if(Array.isArray(value)){return value.map((set,index)=>{if(Array.isArray(set)){assertArgument(set.length===2,"invalid slot set",`value[${index}]`,set);return accessSetify(set[0],set[1])}assertArgument(set!=null&&typeof set==="object","invalid address-slot set","value",value);return accessSetify(set.address,set.storageKeys)})}assertArgument(value!=null&&typeof value==="object","invalid access list","value",value);const result=Object.keys(value).map(addr=>{const storageKeys=value[addr].reduce((accum,storageKey)=>{accum[storageKey]=true;return accum},{});return accessSetify(addr,Object.keys(storageKeys).sort())});result.sort((a,b)=>a.address.localeCompare(b.address));return result}function authorizationify(auth){return{address:getAddress(auth.address),nonce:getBigInt(auth.nonce!=null?auth.nonce:0),chainId:getBigInt(auth.chainId!=null?auth.chainId:0),signature:Signature.from(auth.signature)}}function computeAddress(key){let pubkey;if(typeof key==="string"){pubkey=SigningKey.computePublicKey(key,false)}else{pubkey=key.publicKey}return getAddress(keccak256("0x"+pubkey.substring(4)).substring(26))}function recoverAddress(digest,signature){return computeAddress(SigningKey.recoverPublicKey(digest,signature))}const BN_0$4=BigInt(0);const BN_2$2=BigInt(2);const BN_27=BigInt(27);const BN_28=BigInt(28);const BN_35=BigInt(35);const BN_MAX_UINT=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const inspect=Symbol.for("nodejs.util.inspect.custom");const BLOB_SIZE=4096*32;const CELL_COUNT=128;function getKzgLibrary(kzg){const blobToKzgCommitment=blob=>{if("computeBlobProof"in kzg){if("blobToKzgCommitment"in kzg&&typeof kzg.blobToKzgCommitment==="function"){return getBytes(kzg.blobToKzgCommitment(hexlify(blob)))}}else if("blobToKzgCommitment"in kzg&&typeof kzg.blobToKzgCommitment==="function"){return getBytes(kzg.blobToKzgCommitment(blob))}if("blobToKZGCommitment"in kzg&&typeof kzg.blobToKZGCommitment==="function"){return getBytes(kzg.blobToKZGCommitment(hexlify(blob)))}assertArgument(false,"unsupported KZG library","kzg",kzg)};const computeBlobKzgProof=(blob,commitment)=>{if("computeBlobProof"in kzg&&typeof kzg.computeBlobProof==="function"){return getBytes(kzg.computeBlobProof(hexlify(blob),hexlify(commitment)))}if("computeBlobKzgProof"in kzg&&typeof kzg.computeBlobKzgProof==="function"){return kzg.computeBlobKzgProof(blob,commitment)}if("computeBlobKZGProof"in kzg&&typeof kzg.computeBlobKZGProof==="function"){return getBytes(kzg.computeBlobKZGProof(hexlify(blob),hexlify(commitment)))}assertArgument(false,"unsupported KZG library","kzg",kzg)};return{blobToKzgCommitment:blobToKzgCommitment,computeBlobKzgProof:computeBlobKzgProof}}function getVersionedHash(version,hash){let versioned=version.toString(16);while(versioned.length<2){versioned="0"+versioned}versioned+=sha256(hash).substring(4);return"0x"+versioned}function handleAddress(value){if(value==="0x"){return null}return getAddress(value)}function handleAccessList(value,param){try{return accessListify(value)}catch(error){assertArgument(false,error.message,param,value)}}function handleAuthorizationList(value,param){try{if(!Array.isArray(value)){throw new Error("authorizationList: invalid array")}const result=[];for(let i=0;i[set.address,set.storageKeys])}function formatAuthorizationList(value){return value.map(a=>{return[formatNumber(a.chainId,"chainId"),a.address,formatNumber(a.nonce,"nonce"),formatNumber(a.signature.yParity,"yParity"),toBeArray(a.signature.r),toBeArray(a.signature._s)]})}function formatHashes(value,param){assertArgument(Array.isArray(value),`invalid ${param}`,"value",value);for(let i=0;ib.data),blobs.map(b=>b.commitment),cellProofs])])}return concat(["0x03",encodeRlp([fields,blobs.map(b=>b.data),blobs.map(b=>b.commitment),blobs.map(b=>b.proof)])])}}return concat(["0x03",encodeRlp(fields)])}function _parseEip7702(data){const fields=decodeRlp(getBytes(data).slice(1));assertArgument(Array.isArray(fields)&&(fields.length===10||fields.length===13),"invalid field count for transaction type: 4","data",hexlify(data));const tx={type:4,chainId:handleUint(fields[0],"chainId"),nonce:handleNumber(fields[1],"nonce"),maxPriorityFeePerGas:handleUint(fields[2],"maxPriorityFeePerGas"),maxFeePerGas:handleUint(fields[3],"maxFeePerGas"),gasPrice:null,gasLimit:handleUint(fields[4],"gasLimit"),to:handleAddress(fields[5]),value:handleUint(fields[6],"value"),data:hexlify(fields[7]),accessList:handleAccessList(fields[8],"accessList"),authorizationList:handleAuthorizationList(fields[9],"authorizationList")};if(fields.length===10){return tx}_parseEipSignature(tx,fields.slice(10));return tx}function _serializeEip7702(tx,sig){const fields=[formatNumber(tx.chainId,"chainId"),formatNumber(tx.nonce,"nonce"),formatNumber(tx.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),formatNumber(tx.maxFeePerGas||0,"maxFeePerGas"),formatNumber(tx.gasLimit,"gasLimit"),tx.to||"0x",formatNumber(tx.value,"value"),tx.data,formatAccessList(tx.accessList||[]),formatAuthorizationList(tx.authorizationList||[])];if(sig){fields.push(formatNumber(sig.yParity,"yParity"));fields.push(toBeArray(sig.r));fields.push(toBeArray(sig.s))}return concat(["0x04",encodeRlp(fields)])}class Transaction{#type;#to;#data;#nonce;#gasLimit;#gasPrice;#maxPriorityFeePerGas;#maxFeePerGas;#value;#chainId;#sig;#accessList;#maxFeePerBlobGas;#blobVersionedHashes;#kzg;#blobs;#auths;#blobWrapperVersion;get type(){return this.#type}set type(value){switch(value){case null:this.#type=null;break;case 0:case"legacy":this.#type=0;break;case 1:case"berlin":case"eip-2930":this.#type=1;break;case 2:case"london":case"eip-1559":this.#type=2;break;case 3:case"cancun":case"eip-4844":this.#type=3;break;case 4:case"pectra":case"eip-7702":this.#type=4;break;default:assertArgument(false,"unsupported transaction type","type",value)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844";case 4:return"eip-7702"}return null}get to(){const value=this.#to;if(value==null&&this.type===3){return ZeroAddress}return value}set to(value){this.#to=value==null?null:getAddress(value)}get nonce(){return this.#nonce}set nonce(value){this.#nonce=getNumber(value,"value")}get gasLimit(){return this.#gasLimit}set gasLimit(value){this.#gasLimit=getBigInt(value)}get gasPrice(){const value=this.#gasPrice;if(value==null&&(this.type===0||this.type===1)){return BN_0$4}return value}set gasPrice(value){this.#gasPrice=value==null?null:getBigInt(value,"gasPrice")}get maxPriorityFeePerGas(){const value=this.#maxPriorityFeePerGas;if(value==null){if(this.type===2||this.type===3){return BN_0$4}return null}return value}set maxPriorityFeePerGas(value){this.#maxPriorityFeePerGas=value==null?null:getBigInt(value,"maxPriorityFeePerGas")}get maxFeePerGas(){const value=this.#maxFeePerGas;if(value==null){if(this.type===2||this.type===3){return BN_0$4}return null}return value}set maxFeePerGas(value){this.#maxFeePerGas=value==null?null:getBigInt(value,"maxFeePerGas")}get data(){return this.#data}set data(value){this.#data=hexlify(value)}get value(){return this.#value}set value(value){this.#value=getBigInt(value,"value")}get chainId(){return this.#chainId}set chainId(value){this.#chainId=getBigInt(value)}get signature(){return this.#sig||null}set signature(value){this.#sig=value==null?null:Signature.from(value)}isValid(){const sig=this.signature;if(sig&&!sig.isValid()){return false}const auths=this.authorizationList;if(auths){for(const auth of auths){if(!auth.signature.isValid()){return false}}}return true}get accessList(){const value=this.#accessList||null;if(value==null){if(this.type===1||this.type===2||this.type===3){return[]}return null}return value}set accessList(value){this.#accessList=value==null?null:accessListify(value)}get authorizationList(){const value=this.#auths||null;if(value==null){if(this.type===4){return[]}}return value}set authorizationList(auths){this.#auths=auths==null?null:auths.map(a=>authorizationify(a))}get maxFeePerBlobGas(){const value=this.#maxFeePerBlobGas;if(value==null&&this.type===3){return BN_0$4}return value}set maxFeePerBlobGas(value){this.#maxFeePerBlobGas=value==null?null:getBigInt(value,"maxFeePerBlobGas")}get blobVersionedHashes(){let value=this.#blobVersionedHashes;if(value==null&&this.type===3){return[]}return value}set blobVersionedHashes(value){if(value!=null){assertArgument(Array.isArray(value),"blobVersionedHashes must be an Array","value",value);value=value.slice();for(let i=0;iObject.assign({},b))}set blobs(_blobs){if(_blobs==null){this.#blobs=null;return}const blobs=[];const versionedHashes=[];for(let i=0;i<_blobs.length;i++){const blob=_blobs[i];if(isBytesLike(blob)){assert(this.#kzg,"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let data=getBytes(blob);assertArgument(data.length<=BLOB_SIZE,"blob is too large",`blobs[${i}]`,blob);if(data.length!==BLOB_SIZE){const padded=new Uint8Array(BLOB_SIZE);padded.set(data);data=padded}const commit=this.#kzg.blobToKzgCommitment(data);const proof=hexlify(this.#kzg.computeBlobKzgProof(data,commit));blobs.push({data:hexlify(data),commitment:hexlify(commit),proof:proof});versionedHashes.push(getVersionedHash(1,commit))}else{const data=hexlify(blob.data);const commitment=hexlify(blob.commitment);const proof=hexlify(blob.proof);blobs.push({data:data,commitment:commitment,proof:proof});versionedHashes.push(getVersionedHash(1,commitment))}}this.#blobs=blobs;this.#blobVersionedHashes=versionedHashes}get kzg(){return this.#kzg}set kzg(kzg){if(kzg==null){this.#kzg=null}else{this.#kzg=getKzgLibrary(kzg)}}get blobWrapperVersion(){return this.#blobWrapperVersion}set blobWrapperVersion(value){this.#blobWrapperVersion=value}constructor(){this.#type=null;this.#to=null;this.#nonce=0;this.#gasLimit=BN_0$4;this.#gasPrice=null;this.#maxPriorityFeePerGas=null;this.#maxFeePerGas=null;this.#data="0x";this.#value=BN_0$4;this.#chainId=BN_0$4;this.#sig=null;this.#accessList=null;this.#maxFeePerBlobGas=null;this.#blobVersionedHashes=null;this.#kzg=null;this.#blobs=null;this.#auths=null;this.#blobWrapperVersion=null}get hash(){if(this.signature==null){return null}return keccak256(this.#getSerialized(true,false))}get unsignedHash(){return keccak256(this.unsignedSerialized)}get from(){if(this.signature==null){return null}return recoverAddress(this.unsignedHash,this.signature.getCanonical())}get fromPublicKey(){if(this.signature==null){return null}return SigningKey.recoverPublicKey(this.unsignedHash,this.signature.getCanonical())}isSigned(){return this.signature!=null}#getSerialized(signed,sidecar){assert(!signed||this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});const sig=signed?this.signature:null;switch(this.inferType()){case 0:return _serializeLegacy(this,sig);case 1:return _serializeEip2930(this,sig);case 2:return _serializeEip1559(this,sig);case 3:return _serializeEip4844(this,sig,sidecar?this.blobs:null);case 4:return _serializeEip7702(this,sig)}assert(false,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}get serialized(){return this.#getSerialized(true,true)}get unsignedSerialized(){return this.#getSerialized(false,false)}inferType(){const types=this.inferTypes();if(types.indexOf(2)>=0){return 2}return types.pop()}inferTypes(){const hasGasPrice=this.gasPrice!=null;const hasFee=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null;const hasAccessList=this.accessList!=null;const hasBlob=this.#maxFeePerBlobGas!=null||this.#blobVersionedHashes;if(this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null){assert(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this})}assert(!hasFee||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this});assert(this.type!==0||!hasAccessList,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const types=[];if(this.type!=null){types.push(this.type)}else{if(this.authorizationList&&this.authorizationList.length){types.push(4)}else if(hasFee){types.push(2)}else if(hasGasPrice){types.push(1);if(!hasAccessList){types.push(0)}}else if(hasAccessList){types.push(1);types.push(2)}else if(hasBlob&&this.to){types.push(3)}else{types.push(0);types.push(1);types.push(2);types.push(3)}}types.sort();return types}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return Transaction.from(this)}toJSON(){const s=v=>{if(v==null){return null}return v.toString()};return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:s(this.gasLimit),gasPrice:s(this.gasPrice),maxPriorityFeePerGas:s(this.maxPriorityFeePerGas),maxFeePerGas:s(this.maxFeePerGas),value:s(this.value),chainId:s(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}[inspect](){return this.toString()}toString(){const output=[];const add=key=>{let value=this[key];if(typeof value==="string"){value=JSON.stringify(value)}output.push(`${key}: ${value}`)};if(this.type){add("type")}add("to");add("data");add("nonce");add("gasLimit");add("value");if(this.chainId!=null){add("chainId")}if(this.signature){add("from");output.push(`signature: ${this.signature.toString()}`)}const auths=this.authorizationList;if(auths){const outputAuths=[];for(const auth of auths){const o=[];o.push(`address: ${JSON.stringify(auth.address)}`);if(auth.nonce!=null){o.push(`nonce: ${auth.nonce}`)}if(auth.chainId!=null){o.push(`chainId: ${auth.chainId}`)}if(auth.signature){o.push(`signature: ${auth.signature.toString()}`)}outputAuths.push(`Authorization { ${o.join(", ")} }`)}output.push(`authorizations: [ ${outputAuths.join(", ")} ]`)}return`Transaction { ${output.join(", ")} }`}static from(tx){if(tx==null){return new Transaction}if(typeof tx==="string"){const payload=getBytes(tx);if(payload[0]>=127){return Transaction.from(_parseLegacy(payload))}switch(payload[0]){case 1:return Transaction.from(_parseEip2930(payload));case 2:return Transaction.from(_parseEip1559(payload));case 3:return Transaction.from(_parseEip4844(payload));case 4:return Transaction.from(_parseEip7702(payload))}assert(false,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const result=new Transaction;if(tx.type!=null){result.type=tx.type}if(tx.to!=null){result.to=tx.to}if(tx.nonce!=null){result.nonce=tx.nonce}if(tx.gasLimit!=null){result.gasLimit=tx.gasLimit}if(tx.gasPrice!=null){result.gasPrice=tx.gasPrice}if(tx.maxPriorityFeePerGas!=null){result.maxPriorityFeePerGas=tx.maxPriorityFeePerGas}if(tx.maxFeePerGas!=null){result.maxFeePerGas=tx.maxFeePerGas}if(tx.maxFeePerBlobGas!=null){result.maxFeePerBlobGas=tx.maxFeePerBlobGas}if(tx.data!=null){result.data=tx.data}if(tx.value!=null){result.value=tx.value}if(tx.chainId!=null){result.chainId=tx.chainId}if(tx.signature!=null){result.signature=Signature.from(tx.signature)}if(tx.accessList!=null){result.accessList=tx.accessList}if(tx.authorizationList!=null){result.authorizationList=tx.authorizationList}if(tx.blobVersionedHashes!=null){result.blobVersionedHashes=tx.blobVersionedHashes}if(tx.kzg!=null){result.kzg=tx.kzg}if(tx.blobWrapperVersion!=null){result.blobWrapperVersion=tx.blobWrapperVersion}if(tx.blobs!=null){result.blobs=tx.blobs}if(tx.hash!=null){assertArgument(result.isSigned(),"unsigned transaction cannot define '.hash'","tx",tx);assertArgument(result.hash===tx.hash,"hash mismatch","tx",tx)}if(tx.from!=null){assertArgument(result.isSigned(),"unsigned transaction cannot define '.from'","tx",tx);assertArgument(result.from.toLowerCase()===(tx.from||"").toLowerCase(),"from mismatch","tx",tx)}return result}}function hashAuthorization(auth){assertArgument(typeof auth.address==="string","invalid address for hashAuthorization","auth.address",auth);return keccak256(concat(["0x05",encodeRlp([auth.chainId!=null?toBeArray(auth.chainId):"0x",getAddress(auth.address),auth.nonce!=null?toBeArray(auth.nonce):"0x"])]))}function verifyAuthorization(auth,sig){return recoverAddress(hashAuthorization(auth),sig)}function id(value){return keccak256(toUtf8Bytes(value))}var COMPRESSED$1="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQ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"fraction slash"],[12539,"middle dot"]]);const NSM_MAX=4;function decode_arithmetic(bytes){let pos=0;function u16(){return bytes[pos++]<<8|bytes[pos++]}let symbol_count=u16();let total=1;let acc=[0,1];for(let i=1;i>--read_width&1}const N=31;const FULL=2**N;const HALF=FULL>>>1;const QRTR=HALF>>1;const MASK=FULL-1;let register=0;for(let i=0;i1){let mid=start+end>>>1;if(value>>1|read_bit();a=a<<1^HALF;b=(b^HALF)<<1|HALF|1}low=a;range=1+b-a}let offset=symbol_count-4;return symbols.map(x=>{switch(x-offset){case 3:return offset+65792+(bytes[pos_payload++]<<16|bytes[pos_payload++]<<8|bytes[pos_payload++]);case 2:return offset+256+(bytes[pos_payload++]<<8|bytes[pos_payload++]);case 1:return offset+bytes[pos_payload++];default:return x-1}})}function read_payload(v){let pos=0;return()=>v[pos++]}function read_compressed_payload(s){return read_payload(decode_arithmetic(unsafe_atob(s)))}function unsafe_atob(s){let lookup=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((c,i)=>lookup[c.charCodeAt(0)]=i);let n=s.length;let ret=new Uint8Array(6*n>>3);for(let i=0,pos=0,width=0,carry=0;i=8){ret[pos++]=carry>>(width-=8)}}return ret}function signed(i){return i&1?~i>>1:i>>1}function read_deltas(n,next){let v=Array(n);for(let i=0,x=0;i{let v=read_sorted(next);if(v.length)return v})}function read_mapped(next){let ret=[];while(true){let w=next();if(w==0)break;ret.push(read_linear_table(w,next))}while(true){let w=next()-1;if(w<0)break;ret.push(read_replacement_table(w,next))}return ret.flat()}function read_array_while(next){let v=[];while(true){let x=next(v.length);if(!x)break;v.push(x)}return v}function read_transposed(n,w,next){let m=Array(n).fill().map(()=>[]);for(let i=0;im[j].push(x))}return m}function read_linear_table(w,next){let dx=1+next();let dy=next();let vN=read_array_while(next);let m=read_transposed(vN.length,1+w,next);return m.flatMap((v,i)=>{let[x,...ys]=v;return Array(vN[i]).fill().map((_,j)=>{let j_dy=j*dy;return[x+j*dx,ys.map(y=>y+j_dy)]})})}function read_replacement_table(w,next){let n=1+next();let m=read_transposed(n,1+w,next);return m.map(v=>[v[0],v.slice(1)])}function read_trie(next){let ret=[];let sorted=read_sorted(next);expand(decode([]),[]);return ret;function decode(Q){let S=next();let B=read_array_while(()=>{let cps=read_sorted(next).map(i=>sorted[i]);if(cps.length)return decode(cps)});return{S:S,B:B,Q:Q}}function expand({S,B},cps,saved){if(S&4&&saved===cps[cps.length-1])return;if(S&2)saved=cps[cps.length-1];if(S&1)ret.push(cps);for(let br of B){for(let cp of br.Q){expand(br,[...cps,cp],saved)}}}}function hex_cp(cp){return cp.toString(16).toUpperCase().padStart(2,"0")}function quote_cp(cp){return`{${hex_cp(cp)}}`}function explode_cp(s){let cps=[];for(let pos=0,len=s.length;pos>24&255}function unpack_cp(packed){return packed&16777215}let SHIFTED_RANK,EXCLUSIONS,DECOMP,RECOMP;function init$1(){let r=read_compressed_payload(COMPRESSED);SHIFTED_RANK=new Map(read_sorted_arrays(r).flatMap((v,i)=>v.map(x=>[x,i+1<<24])));EXCLUSIONS=new Set(read_sorted(r));DECOMP=new Map;RECOMP=new Map;for(let[cp,cps]of read_mapped(r)){if(!EXCLUSIONS.has(cp)&&cps.length==2){let[a,b]=cps;let bucket=RECOMP.get(a);if(!bucket){bucket=new Map;RECOMP.set(a,bucket)}bucket.set(b,cp)}DECOMP.set(cp,cps.reverse())}}function is_hangul(cp){return cp>=S0&&cp=L0&&a=V0&&bT0&&b0)add(T0+t_index)}else{let mapped=DECOMP.get(cp);if(mapped){buf.push(...mapped)}else{add(cp)}}if(!buf.length)break;cp=buf.pop()}}if(check_order&&ret.length>1){let prev_cc=unpack_cc(ret[0]);for(let i=1;i0&&prev_cc>=cc){if(cc==0){ret.push(prev_cp,...stack);stack.length=0;prev_cp=cp}else{stack.push(cp)}prev_cc=cc}else{let composed=compose_pair(prev_cp,cp);if(composed>=0){prev_cp=composed}else if(prev_cc==0&&cc==0){ret.push(prev_cp);prev_cp=cp}else{stack.push(cp);prev_cc=cc}}}if(prev_cp>=0){ret.push(prev_cp,...stack)}return ret}function nfd(cps){return decomposed(cps).map(unpack_cp)}function nfc(cps){return composed_from_decomposed(decomposed(cps))}const HYPHEN=45;const STOP_CH=".";const FE0F=65039;const UNIQUE_PH=1;const Array_from=x=>Array.from(x);function group_has_cp(g,cp){return g.P.has(cp)||g.Q.has(cp)}class Emoji extends Array{get is_emoji(){return true}}let MAPPED,IGNORED,CM,NSM,ESCAPE,GROUPS,WHOLE_VALID,WHOLE_MAP,VALID,EMOJI_LIST,EMOJI_ROOT;function init(){if(MAPPED)return;let r=read_compressed_payload(COMPRESSED$1);const read_sorted_array=()=>read_sorted(r);const read_sorted_set=()=>new Set(read_sorted_array());const set_add_many=(set,v)=>v.forEach(x=>set.add(x));MAPPED=new Map(read_mapped(r));IGNORED=read_sorted_set();CM=read_sorted_array();NSM=new Set(read_sorted_array().map(i=>CM[i]));CM=new Set(CM);ESCAPE=read_sorted_set();read_sorted_set();let chunks=read_sorted_arrays(r);let unrestricted=r();const read_chunked=()=>{let set=new Set;read_sorted_array().forEach(i=>set_add_many(set,chunks[i]));set_add_many(set,read_sorted_array());return set};GROUPS=read_array_while(i=>{let N=read_array_while(r).map(x=>x+96);if(N.length){let R=i>=unrestricted;N[0]-=32;N=str_from_cps(N);if(R)N=`Restricted[${N}]`;let P=read_chunked();let Q=read_chunked();let M=!r();return{N:N,P:P,Q:Q,M:M,R:R}}});WHOLE_VALID=read_sorted_set();WHOLE_MAP=new Map;let wholes=read_sorted_array().concat(Array_from(WHOLE_VALID)).sort((a,b)=>a-b);wholes.forEach((cp,i)=>{let d=r();let w=wholes[i]=d?wholes[i-d]:{V:[],M:new Map};w.V.push(cp);if(!WHOLE_VALID.has(cp)){WHOLE_MAP.set(cp,w)}});for(let{V,M}of new Set(WHOLE_MAP.values())){let recs=[];for(let cp of V){let gs=GROUPS.filter(g=>group_has_cp(g,cp));let rec=recs.find(({G})=>gs.some(g=>G.has(g)));if(!rec){rec={G:new Set,V:[]};recs.push(rec)}rec.V.push(cp);set_add_many(rec.G,gs)}let union=recs.flatMap(x=>Array_from(x.G));for(let{G,V}of recs){let complement=new Set(union.filter(g=>!G.has(g)));for(let cp of V){M.set(cp,complement)}}}VALID=new Set;let multi=new Set;const add_to_union=cp=>VALID.has(cp)?multi.add(cp):VALID.add(cp);for(let g of GROUPS){for(let cp of g.P)add_to_union(cp);for(let cp of g.Q)add_to_union(cp)}for(let cp of VALID){if(!WHOLE_MAP.has(cp)&&!multi.has(cp)){WHOLE_MAP.set(cp,UNIQUE_PH)}}set_add_many(VALID,nfd(VALID));EMOJI_LIST=read_trie(r).map(v=>Emoji.from(v)).sort(compare_arrays);EMOJI_ROOT=new Map;for(let cps of EMOJI_LIST){let prev=[EMOJI_ROOT];for(let cp of cps){let next=prev.map(node=>{let child=node.get(cp);if(!child){child=new Map;node.set(cp,child)}return child});if(cp===FE0F){prev.push(...next)}else{prev=next}}for(let x of prev){x.V=cps}}}function quoted_cp(cp){return(should_escape(cp)?"":`${bidi_qq(safe_str_from_cps([cp]))} `)+quote_cp(cp)}function bidi_qq(s){return`"${s}"\u200E`}function check_label_extension(cps){if(cps.length>=4&&cps[2]==HYPHEN&&cps[3]==HYPHEN){throw new Error(`invalid label extension: "${str_from_cps(cps.slice(0,4))}"`)}}function check_leading_underscore(cps){const UNDERSCORE=95;for(let i=cps.lastIndexOf(UNDERSCORE);i>0;){if(cps[--i]!==UNDERSCORE){throw new Error("underscore allowed only at start")}}}function check_fenced(cps){let cp=cps[0];let prev=FENCED.get(cp);if(prev)throw error_placement(`leading ${prev}`);let n=cps.length;let last=-1;for(let i=1;imax){max>>=1;cps=[...cps.slice(0,max),8230,...cps.slice(-max)]}let prev=0;let n=cps.length;for(let i=0;i{let input=explode_cp(label);let info={input:input,offset:offset};offset+=input.length+1;try{let tokens=info.tokens=tokens_from_str(input,nf,ef);let token_count=tokens.length;let type;if(!token_count){throw new Error(`empty label`)}let norm=info.output=tokens.flat();check_leading_underscore(norm);let emoji=info.emoji=token_count>1||tokens[0].is_emoji;if(!emoji&&norm.every(cp=>cp<128)){check_label_extension(norm);type="ASCII"}else{let chars=tokens.flatMap(x=>x.is_emoji?[]:x);if(!chars.length){type="Emoji"}else{if(CM.has(norm[0]))throw error_placement("leading combining mark");for(let i=1;iset.has(g)):Array_from(set);if(!maker.length)return}else{shared.push(cp)}}if(maker){for(let g of maker){if(shared.every(cp=>group_has_cp(g,cp))){throw new Error(`whole-script confusable: ${group.N}/${g.N}`)}}}}function determine_group(unique){let groups=GROUPS;for(let cp of unique){let gs=groups.filter(g=>group_has_cp(g,cp));if(!gs.length){if(!GROUPS.some(g=>group_has_cp(g,cp))){throw error_disallowed(cp)}else{throw error_group_member(groups[0],cp)}}groups=gs;if(gs.length==1)break}return groups}function flatten(split){return split.map(({input,error,output})=>{if(error){let msg=error.message;throw new Error(split.length==1?msg:`Invalid label ${bidi_qq(safe_str_from_cps(input,63))}: ${msg}`)}return str_from_cps(output)}).join(STOP_CH)}function error_disallowed(cp){return new Error(`disallowed character: ${quoted_cp(cp)}`)}function error_group_member(g,cp){let quoted=quoted_cp(cp);let gg=GROUPS.find(g=>g.P.has(cp));if(gg){quoted=`${gg.N} ${quoted}`}return new Error(`illegal mixture: ${g.N} + ${quoted}`)}function error_placement(where){return new Error(`illegal placement: ${where}`)}function check_group(g,cps){for(let cp of cps){if(!group_has_cp(g,cp)){throw error_group_member(g,cp)}}if(g.M){let decomposed=nfd(cps);for(let i=1,e=decomposed.length;iNSM_MAX){throw new Error(`excessive non-spacing marks: ${bidi_qq(safe_str_from_cps(decomposed.slice(i-1,j)))} (${j-i}/${NSM_MAX})`)}i=j}}}}function tokens_from_str(input,nf,ef){let ret=[];let chars=[];input=input.slice().reverse();while(input.length){let emoji=consume_emoji_reversed(input);if(emoji){if(chars.length){ret.push(nf(chars));chars=[]}ret.push(ef(emoji))}else{let cp=input.pop();if(VALID.has(cp)){chars.push(cp)}else{let cps=MAPPED.get(cp);if(cps){chars.push(...cps)}else if(!IGNORED.has(cp)){throw error_disallowed(cp)}}}}if(chars.length){ret.push(nf(chars))}return ret}function filter_fe0f(cps){return cps.filter(cp=>cp!=FE0F)}function consume_emoji_reversed(cps,eaten){let node=EMOJI_ROOT;let emoji;let pos=cps.length;while(pos){node=node.get(cps[--pos]);if(!node)break;let{V}=node;if(V){emoji=V;cps.length=pos}}return emoji}const Zeros=new Uint8Array(32);Zeros.fill(0);function checkComponent(comp){assertArgument(comp.length!==0,"invalid ENS name; empty component","comp",comp);return comp}function ensNameSplit(name){const bytes=toUtf8Bytes(ensNormalize(name));const comps=[];if(name.length===0){return comps}let last=0;for(let i=0;i{assertArgument(comp.length<=length,`label ${JSON.stringify(name)} exceeds ${length} bytes`,"name",name);const bytes=new Uint8Array(comp.length+1);bytes.set(comp,1);bytes[0]=bytes.length-1;return bytes})))+"00"}function hashMessage(message){if(typeof message==="string"){message=toUtf8Bytes(message)}return keccak256(concat([toUtf8Bytes(MessagePrefix),toUtf8Bytes(String(message.length)),message]))}function verifyMessage(message,sig){const digest=hashMessage(message);return recoverAddress(digest,sig)}const regexBytes=new RegExp("^bytes([0-9]+)$");const regexNumber=new RegExp("^(u?int)([0-9]*)$");const regexArray=new RegExp("^(.*)\\[([0-9]*)\\]$");function _pack(type,value,isArray){switch(type){case"address":if(isArray){return getBytes(zeroPadValue(value,32))}return getBytes(getAddress(value));case"string":return toUtf8Bytes(value);case"bytes":return getBytes(value);case"bool":value=!!value?"0x01":"0x00";if(isArray){return getBytes(zeroPadValue(value,32))}return getBytes(value)}let match=type.match(regexNumber);if(match){let signed=match[1]==="int";let size=parseInt(match[2]||"256");assertArgument((!match[2]||match[2]===String(size))&&size%8===0&&size!==0&&size<=256,"invalid number type","type",type);if(isArray){size=256}if(signed){value=toTwos(value,size)}return getBytes(zeroPadValue(toBeArray(value),size/8))}match=type.match(regexBytes);if(match){const size=parseInt(match[1]);assertArgument(String(size)===match[1]&&size!==0&&size<=32,"invalid bytes type","type",type);assertArgument(dataLength(value)===size,`invalid value for ${type}`,"value",value);if(isArray){return getBytes(zeroPadBytes(value,32))}return value}match=type.match(regexArray);if(match&&Array.isArray(value)){const baseType=match[1];const count=parseInt(match[2]||String(value.length));assertArgument(count===value.length,`invalid array length for ${type}`,"value",value);const result=[];value.forEach(function(value){result.push(_pack(baseType,value,true))});return getBytes(concat(result))}assertArgument(false,"invalid type","type",type)}function solidityPacked(types,values){assertArgument(types.length===values.length,"wrong number of values; expected ${ types.length }","values",values);const tight=[];types.forEach(function(type,index){tight.push(_pack(type,values[index]))});return hexlify(concat(tight))}function solidityPackedKeccak256(types,values){return keccak256(solidityPacked(types,values))}function solidityPackedSha256(types,values){return sha256(solidityPacked(types,values))}const padding=new Uint8Array(32);padding.fill(0);const BN__1=BigInt(-1);const BN_0$3=BigInt(0);const BN_1$1=BigInt(1);const BN_MAX_UINT256=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function hexPadRight(value){const bytes=getBytes(value);const padOffset=bytes.length%32;if(padOffset){return concat([bytes,padding.slice(padOffset)])}return hexlify(bytes)}const hexTrue=toBeHex(BN_1$1,32);const hexFalse=toBeHex(BN_0$3,32);const domainFieldTypes={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"};const domainFieldNames=["name","version","chainId","verifyingContract","salt"];function checkString(key){return function(value){assertArgument(typeof value==="string",`invalid domain value for ${JSON.stringify(key)}`,`domain.${key}`,value);return value}}const domainChecks={name:checkString("name"),version:checkString("version"),chainId:function(_value){const value=getBigInt(_value,"domain.chainId");assertArgument(value>=0,"invalid chain ID","domain.chainId",_value);if(Number.isSafeInteger(value)){return Number(value)}return toQuantity(value)},verifyingContract:function(value){try{return getAddress(value).toLowerCase()}catch(error){}assertArgument(false,`invalid domain value "verifyingContract"`,"domain.verifyingContract",value)},salt:function(value){const bytes=getBytes(value,"domain.salt");assertArgument(bytes.length===32,`invalid domain value "salt"`,"domain.salt",value);return hexlify(bytes)}};function getBaseEncoder(type){{const match=type.match(/^(u?)int(\d+)$/);if(match){const signed=match[1]==="";const width=parseInt(match[2]);assertArgument(width%8===0&&width!==0&&width<=256&&match[2]===String(width),"invalid numeric width","type",type);const boundsUpper=mask(BN_MAX_UINT256,signed?width-1:width);const boundsLower=signed?(boundsUpper+BN_1$1)*BN__1:BN_0$3;return function(_value){const value=getBigInt(_value,"value");assertArgument(value>=boundsLower&&value<=boundsUpper,`value out-of-bounds for ${type}`,"value",value);return toBeHex(signed?toTwos(value,256):value,32)}}}{const match=type.match(/^bytes(\d+)$/);if(match){const width=parseInt(match[1]);assertArgument(width!==0&&width<=32&&match[1]===String(width),"invalid bytes width","type",type);return function(value){const bytes=getBytes(value);assertArgument(bytes.length===width,`invalid length for ${type}`,"value",value);return hexPadRight(value)}}}switch(type){case"address":return function(value){return zeroPadValue(getAddress(value),32)};case"bool":return function(value){return!value?hexFalse:hexTrue};case"bytes":return function(value){return keccak256(value)};case"string":return function(value){return id(value)}}return null}function encodeType(name,fields){return`${name}(${fields.map(({name,type})=>type+" "+name).join(",")})`}function splitArray(type){const match=type.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);if(match){return{base:match[1],index:match[2]+match[4],array:{base:match[1],prefix:match[1]+match[2],count:match[5]?parseInt(match[5]):-1}}}return{base:type}}class TypedDataEncoder{primaryType;#types;get types(){return JSON.parse(this.#types)}#fullTypes;#encoderCache;constructor(_types){this.#fullTypes=new Map;this.#encoderCache=new Map;const links=new Map;const parents=new Map;const subtypes=new Map;const types={};Object.keys(_types).forEach(type=>{types[type]=_types[type].map(({name,type})=>{let{base,index}=splitArray(type);if(base==="int"&&!_types["int"]){base="int256"}if(base==="uint"&&!_types["uint"]){base="uint256"}return{name:name,type:base+(index||"")}});links.set(type,new Set);parents.set(type,[]);subtypes.set(type,new Set)});this.#types=JSON.stringify(types);for(const name in types){const uniqueNames=new Set;for(const field of types[name]){assertArgument(!uniqueNames.has(field.name),`duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`,"types",_types);uniqueNames.add(field.name);const baseType=splitArray(field.type).base;assertArgument(baseType!==name,`circular type reference to ${JSON.stringify(baseType)}`,"types",_types);const encoder=getBaseEncoder(baseType);if(encoder){continue}assertArgument(parents.has(baseType),`unknown type ${JSON.stringify(baseType)}`,"types",_types);parents.get(baseType).push(name);links.get(name).add(baseType)}}const primaryTypes=Array.from(parents.keys()).filter(n=>parents.get(n).length===0);assertArgument(primaryTypes.length!==0,"missing primary type","types",_types);assertArgument(primaryTypes.length===1,`ambiguous primary types or unused types: ${primaryTypes.map(t=>JSON.stringify(t)).join(", ")}`,"types",_types);defineProperties(this,{primaryType:primaryTypes[0]});function checkCircular(type,found){assertArgument(!found.has(type),`circular type reference to ${JSON.stringify(type)}`,"types",_types);found.add(type);for(const child of links.get(type)){if(!parents.has(child)){continue}checkCircular(child,found);for(const subtype of found){subtypes.get(subtype).add(child)}}found.delete(type)}checkCircular(this.primaryType,new Set);for(const[name,set]of subtypes){const st=Array.from(set);st.sort();this.#fullTypes.set(name,encodeType(name,types[name])+st.map(t=>encodeType(t,types[t])).join(""))}}getEncoder(type){let encoder=this.#encoderCache.get(type);if(!encoder){encoder=this.#getEncoder(type);this.#encoderCache.set(type,encoder)}return encoder}#getEncoder(type){{const encoder=getBaseEncoder(type);if(encoder){return encoder}}const array=splitArray(type).array;if(array){const subtype=array.prefix;const subEncoder=this.getEncoder(subtype);return value=>{assertArgument(array.count===-1||array.count===value.length,`array length mismatch; expected length ${array.count}`,"value",value);let result=value.map(subEncoder);if(this.#fullTypes.has(subtype)){result=result.map(keccak256)}return keccak256(concat(result))}}const fields=this.types[type];if(fields){const encodedType=id(this.#fullTypes.get(type));return value=>{const values=fields.map(({name,type})=>{const result=this.getEncoder(type)(value[name]);if(this.#fullTypes.has(type)){return keccak256(result)}return result});values.unshift(encodedType);return concat(values)}}assertArgument(false,`unknown type: ${type}`,"type",type)}encodeType(name){const result=this.#fullTypes.get(name);assertArgument(result,`unknown type: ${JSON.stringify(name)}`,"name",name);return result}encodeData(type,value){return this.getEncoder(type)(value)}hashStruct(name,value){return keccak256(this.encodeData(name,value))}encode(value){return this.encodeData(this.primaryType,value)}hash(value){return this.hashStruct(this.primaryType,value)}_visit(type,value,callback){{const encoder=getBaseEncoder(type);if(encoder){return callback(type,value)}}const array=splitArray(type).array;if(array){assertArgument(array.count===-1||array.count===value.length,`array length mismatch; expected length ${array.count}`,"value",value);return value.map(v=>this._visit(array.prefix,v,callback))}const fields=this.types[type];if(fields){return fields.reduce((accum,{name,type})=>{accum[name]=this._visit(type,value[name],callback);return accum},{})}assertArgument(false,`unknown type: ${type}`,"type",type)}visit(value,callback){return this._visit(this.primaryType,value,callback)}static from(types){return new TypedDataEncoder(types)}static getPrimaryType(types){return TypedDataEncoder.from(types).primaryType}static hashStruct(name,types,value){return TypedDataEncoder.from(types).hashStruct(name,value)}static hashDomain(domain){const domainFields=[];for(const name in domain){if(domain[name]==null){continue}const type=domainFieldTypes[name];assertArgument(type,`invalid typed-data domain key: ${JSON.stringify(name)}`,"domain",domain);domainFields.push({name:name,type:type})}domainFields.sort((a,b)=>{return domainFieldNames.indexOf(a.name)-domainFieldNames.indexOf(b.name)});return TypedDataEncoder.hashStruct("EIP712Domain",{EIP712Domain:domainFields},domain)}static encode(domain,types,value){return concat(["0x1901",TypedDataEncoder.hashDomain(domain),TypedDataEncoder.from(types).hash(value)])}static hash(domain,types,value){return keccak256(TypedDataEncoder.encode(domain,types,value))}static async resolveNames(domain,types,value,resolveName){domain=Object.assign({},domain);for(const key in domain){if(domain[key]==null){delete domain[key]}}const ensCache={};if(domain.verifyingContract&&!isHexString(domain.verifyingContract,20)){ensCache[domain.verifyingContract]="0x"}const encoder=TypedDataEncoder.from(types);encoder.visit(value,(type,value)=>{if(type==="address"&&!isHexString(value,20)){ensCache[value]="0x"}return value});for(const name in ensCache){ensCache[name]=await resolveName(name)}if(domain.verifyingContract&&ensCache[domain.verifyingContract]){domain.verifyingContract=ensCache[domain.verifyingContract]}value=encoder.visit(value,(type,value)=>{if(type==="address"&&ensCache[value]){return ensCache[value]}return value});return{domain:domain,value:value}}static getPayload(domain,types,value){TypedDataEncoder.hashDomain(domain);const domainValues={};const domainTypes=[];domainFieldNames.forEach(name=>{const value=domain[name];if(value==null){return}domainValues[name]=domainChecks[name](value);domainTypes.push({name:name,type:domainFieldTypes[name]})});const encoder=TypedDataEncoder.from(types);types=encoder.types;const typesWithDomain=Object.assign({},types);assertArgument(typesWithDomain.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",types);typesWithDomain.EIP712Domain=domainTypes;encoder.encode(value);return{types:typesWithDomain,domain:domainValues,primaryType:encoder.primaryType,message:encoder.visit(value,(type,value)=>{if(type.match(/^bytes(\d*)/)){return hexlify(getBytes(value))}if(type.match(/^u?int/)){return getBigInt(value).toString()}switch(type){case"address":return value.toLowerCase();case"bool":return!!value;case"string":assertArgument(typeof value==="string","invalid string","value",value);return value}assertArgument(false,"unsupported type","type",type)})}}}function verifyTypedData(domain,types,value,signature){return recoverAddress(TypedDataEncoder.hash(domain,types,value),signature)}function setify(items){const result=new Set;items.forEach(k=>result.add(k));return Object.freeze(result)}const _kwVisibDeploy="external public payable override";const KwVisibDeploy=setify(_kwVisibDeploy.split(" "));const _kwVisib="constant external internal payable private public pure view override";const KwVisib=setify(_kwVisib.split(" "));const _kwTypes="constructor error event fallback function receive struct";const KwTypes=setify(_kwTypes.split(" "));const _kwModifiers="calldata memory storage payable indexed";const KwModifiers=setify(_kwModifiers.split(" "));const _kwOther="tuple returns";const _keywords=[_kwTypes,_kwModifiers,_kwOther,_kwVisib].join(" ");const Keywords=setify(_keywords.split(" "));const SimpleTokens={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"};const regexWhitespacePrefix=new RegExp("^(\\s*)");const regexNumberPrefix=new RegExp("^([0-9]+)");const regexIdPrefix=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)");const regexId=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$");const regexType=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");class TokenString{#offset;#tokens;get offset(){return this.#offset}get length(){return this.#tokens.length-this.#offset}constructor(tokens){this.#offset=0;this.#tokens=tokens.slice()}clone(){return new TokenString(this.#tokens)}reset(){this.#offset=0}#subTokenString(from=0,to=0){return new TokenString(this.#tokens.slice(from,to).map(t=>{return Object.freeze(Object.assign({},t,{match:t.match-from,linkBack:t.linkBack-from,linkNext:t.linkNext-from}))}))}popKeyword(allowed){const top=this.peek();if(top.type!=="KEYWORD"||!allowed.has(top.text)){throw new Error(`expected keyword ${top.text}`)}return this.pop().text}popType(type){if(this.peek().type!==type){const top=this.peek();throw new Error(`expected ${type}; got ${top.type} ${JSON.stringify(top.text)}`)}return this.pop().text}popParen(){const top=this.peek();if(top.type!=="OPEN_PAREN"){throw new Error("bad start")}const result=this.#subTokenString(this.#offset+1,top.match+1);this.#offset=top.match+1;return result}popParams(){const top=this.peek();if(top.type!=="OPEN_PAREN"){throw new Error("bad start")}const result=[];while(this.#offset=this.#tokens.length){throw new Error("out-of-bounds")}return this.#tokens[this.#offset]}peekKeyword(allowed){const top=this.peekType("KEYWORD");return top!=null&&allowed.has(top)?top:null}peekType(type){if(this.length===0){return null}const top=this.peek();return top.type===type?top.text:null}pop(){const result=this.peek();this.#offset++;return result}toString(){const tokens=[];for(let i=this.#offset;i`}}function lex(text){const tokens=[];const throwError=message=>{const token=offset0&&tokens[tokens.length-1].type==="NUMBER"){const value=tokens.pop().text;suffix=value+suffix;tokens[tokens.length-1].value=getNumber(value)}if(tokens.length===0||tokens[tokens.length-1].type!=="BRACKET"){throw new Error("missing opening bracket")}tokens[tokens.length-1].text+=suffix}continue}match=cur.match(regexIdPrefix);if(match){token.text=match[1];offset+=token.text.length;if(Keywords.has(token.text)){token.type="KEYWORD";continue}if(token.text.match(regexType)){token.type="TYPE";continue}token.type="ID";continue}match=cur.match(regexNumberPrefix);if(match){token.text=match[1];token.type="NUMBER";offset+=token.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset}`)}return new TokenString(tokens.map(t=>Object.freeze(t)))}function allowSingle(set,allowed){let included=[];for(const key in allowed.keys()){if(set.has(key)){included.push(key)}}if(included.length>1){throw new Error(`conflicting types: ${included.join(", ")}`)}}function consumeName(type,tokens){if(tokens.peekKeyword(KwTypes)){const keyword=tokens.pop().text;if(keyword!==type){throw new Error(`expected ${type}, got ${keyword}`)}}return tokens.popType("ID")}function consumeKeywords(tokens,allowed){const keywords=new Set;while(true){const keyword=tokens.peekType("KEYWORD");if(keyword==null||allowed&&!allowed.has(keyword)){break}tokens.pop();if(keywords.has(keyword)){throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`)}keywords.add(keyword)}return Object.freeze(keywords)}function consumeMutability(tokens){let modifiers=consumeKeywords(tokens,KwVisib);allowSingle(modifiers,setify("constant payable nonpayable".split(" ")));allowSingle(modifiers,setify("pure view payable nonpayable".split(" ")));if(modifiers.has("view")){return"view"}if(modifiers.has("pure")){return"pure"}if(modifiers.has("payable")){return"payable"}if(modifiers.has("nonpayable")){return"nonpayable"}if(modifiers.has("constant")){return"view"}return"nonpayable"}function consumeParams(tokens,allowIndexed){return tokens.popParams().map(t=>ParamType.from(t,allowIndexed))}function consumeGas(tokens){if(tokens.peekType("AT")){tokens.pop();if(tokens.peekType("NUMBER")){return getBigInt(tokens.pop().text)}throw new Error("invalid gas")}return null}function consumeEoi(tokens){if(tokens.length){throw new Error(`unexpected tokens at offset ${tokens.offset}: ${tokens.toString()}`)}}const regexArrayType=new RegExp(/^(.*)\[([0-9]*)\]$/);function verifyBasicType(type){const match=type.match(regexType);assertArgument(match,"invalid type","type",type);if(type==="uint"){return"uint256"}if(type==="int"){return"int256"}if(match[2]){const length=parseInt(match[2]);assertArgument(length!==0&&length<=32,"invalid bytes length","type",type)}else if(match[3]){const size=parseInt(match[3]);assertArgument(size!==0&&size<=256&&size%8===0,"invalid numeric width","type",type)}return type}const _guard$2={};const internal$1=Symbol.for("_ethers_internal");const ParamTypeInternal="_ParamTypeInternal";const ErrorFragmentInternal="_ErrorInternal";const EventFragmentInternal="_EventInternal";const ConstructorFragmentInternal="_ConstructorInternal";const FallbackFragmentInternal="_FallbackInternal";const FunctionFragmentInternal="_FunctionInternal";const StructFragmentInternal="_StructInternal";class ParamType{name;type;baseType;indexed;components;arrayLength;arrayChildren;constructor(guard,name,type,baseType,indexed,components,arrayLength,arrayChildren){assertPrivate(guard,_guard$2,"ParamType");Object.defineProperty(this,internal$1,{value:ParamTypeInternal});if(components){components=Object.freeze(components.slice())}if(baseType==="array"){if(arrayLength==null||arrayChildren==null){throw new Error("")}}else if(arrayLength!=null||arrayChildren!=null){throw new Error("")}if(baseType==="tuple"){if(components==null){throw new Error("")}}else if(components!=null){throw new Error("")}defineProperties(this,{name:name,type:type,baseType:baseType,indexed:indexed,components:components,arrayLength:arrayLength,arrayChildren:arrayChildren})}format(format){if(format==null){format="sighash"}if(format==="json"){const name=this.name||"";if(this.isArray()){const result=JSON.parse(this.arrayChildren.format("json"));result.name=name;result.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`;return JSON.stringify(result)}const result={type:this.baseType==="tuple"?"tuple":this.type,name:name};if(typeof this.indexed==="boolean"){result.indexed=this.indexed}if(this.isTuple()){result.components=this.components.map(c=>JSON.parse(c.format(format)))}return JSON.stringify(result)}let result="";if(this.isArray()){result+=this.arrayChildren.format(format);result+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`}else{if(this.isTuple()){result+="("+this.components.map(comp=>comp.format(format)).join(format==="full"?", ":",")+")"}else{result+=this.type}}if(format!=="sighash"){if(this.indexed===true){result+=" indexed"}if(format==="full"&&this.name){result+=" "+this.name}}return result}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(value,process){if(this.isArray()){if(!Array.isArray(value)){throw new Error("invalid array value")}if(this.arrayLength!==-1&&value.length!==this.arrayLength){throw new Error("array is wrong length")}const _this=this;return value.map(v=>_this.arrayChildren.walk(v,process))}if(this.isTuple()){if(!Array.isArray(value)){throw new Error("invalid tuple value")}if(value.length!==this.components.length){throw new Error("array is wrong length")}const _this=this;return value.map((v,i)=>_this.components[i].walk(v,process))}return process(this.type,value)}#walkAsync(promises,value,process,setValue){if(this.isArray()){if(!Array.isArray(value)){throw new Error("invalid array value")}if(this.arrayLength!==-1&&value.length!==this.arrayLength){throw new Error("array is wrong length")}const childType=this.arrayChildren;const result=value.slice();result.forEach((value,index)=>{childType.#walkAsync(promises,value,process,value=>{result[index]=value})});setValue(result);return}if(this.isTuple()){const components=this.components;let result;if(Array.isArray(value)){result=value.slice()}else{if(value==null||typeof value!=="object"){throw new Error("invalid tuple value")}result=components.map(param=>{if(!param.name){throw new Error("cannot use object value with unnamed components")}if(!(param.name in value)){throw new Error(`missing value for component ${param.name}`)}return value[param.name]})}if(result.length!==this.components.length){throw new Error("array is wrong length")}result.forEach((value,index)=>{components[index].#walkAsync(promises,value,process,value=>{result[index]=value})});setValue(result);return}const result=process(this.type,value);if(result.then){promises.push(async function(){setValue(await result)}())}else{setValue(result)}}async walkAsync(value,process){const promises=[];const result=[value];this.#walkAsync(promises,value,process,value=>{result[0]=value});if(promises.length){await Promise.all(promises)}return result[0]}static from(obj,allowIndexed){if(ParamType.isParamType(obj)){return obj}if(typeof obj==="string"){try{return ParamType.from(lex(obj),allowIndexed)}catch(error){assertArgument(false,"invalid param type","obj",obj)}}else if(obj instanceof TokenString){let type="",baseType="";let comps=null;if(consumeKeywords(obj,setify(["tuple"])).has("tuple")||obj.peekType("OPEN_PAREN")){baseType="tuple";comps=obj.popParams().map(t=>ParamType.from(t));type=`tuple(${comps.map(c=>c.format()).join(",")})`}else{type=verifyBasicType(obj.popType("TYPE"));baseType=type}let arrayChildren=null;let arrayLength=null;while(obj.length&&obj.peekType("BRACKET")){const bracket=obj.pop();arrayChildren=new ParamType(_guard$2,"",type,baseType,null,comps,arrayLength,arrayChildren);arrayLength=bracket.value;type+=bracket.text;baseType="array";comps=null}let indexed=null;const keywords=consumeKeywords(obj,KwModifiers);if(keywords.has("indexed")){if(!allowIndexed){throw new Error("")}indexed=true}const name=obj.peekType("ID")?obj.pop().text:"";if(obj.length){throw new Error("leftover tokens")}return new ParamType(_guard$2,name,type,baseType,indexed,comps,arrayLength,arrayChildren)}const name=obj.name;assertArgument(!name||typeof name==="string"&&name.match(regexId),"invalid name","obj.name",name);let indexed=obj.indexed;if(indexed!=null){assertArgument(allowIndexed,"parameter cannot be indexed","obj.indexed",obj.indexed);indexed=!!indexed}let type=obj.type;let arrayMatch=type.match(regexArrayType);if(arrayMatch){const arrayLength=parseInt(arrayMatch[2]||"-1");const arrayChildren=ParamType.from({type:arrayMatch[1],components:obj.components});return new ParamType(_guard$2,name||"",type,"array",indexed,null,arrayLength,arrayChildren)}if(type==="tuple"||type.startsWith("tuple(")||type.startsWith("(")){const comps=obj.components!=null?obj.components.map(c=>ParamType.from(c)):null;const tuple=new ParamType(_guard$2,name||"",type,"tuple",indexed,comps,null,null);return tuple}type=verifyBasicType(obj.type);return new ParamType(_guard$2,name||"",type,type,indexed,null,null,null)}static isParamType(value){return value&&value[internal$1]===ParamTypeInternal}}class Fragment{type;inputs;constructor(guard,type,inputs){assertPrivate(guard,_guard$2,"Fragment");inputs=Object.freeze(inputs.slice());defineProperties(this,{type:type,inputs:inputs})}static from(obj){if(typeof obj==="string"){try{Fragment.from(JSON.parse(obj))}catch(e){}return Fragment.from(lex(obj))}if(obj instanceof TokenString){const type=obj.peekKeyword(KwTypes);switch(type){case"constructor":return ConstructorFragment.from(obj);case"error":return ErrorFragment.from(obj);case"event":return EventFragment.from(obj);case"fallback":case"receive":return FallbackFragment.from(obj);case"function":return FunctionFragment.from(obj);case"struct":return StructFragment.from(obj)}}else if(typeof obj==="object"){switch(obj.type){case"constructor":return ConstructorFragment.from(obj);case"error":return ErrorFragment.from(obj);case"event":return EventFragment.from(obj);case"fallback":case"receive":return FallbackFragment.from(obj);case"function":return FunctionFragment.from(obj);case"struct":return StructFragment.from(obj)}assert(false,`unsupported type: ${obj.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}assertArgument(false,"unsupported frgament object","obj",obj)}static isConstructor(value){return ConstructorFragment.isFragment(value)}static isError(value){return ErrorFragment.isFragment(value)}static isEvent(value){return EventFragment.isFragment(value)}static isFunction(value){return FunctionFragment.isFragment(value)}static isStruct(value){return StructFragment.isFragment(value)}}class NamedFragment extends Fragment{name;constructor(guard,type,name,inputs){super(guard,type,inputs);assertArgument(typeof name==="string"&&name.match(regexId),"invalid identifier","name",name);inputs=Object.freeze(inputs.slice());defineProperties(this,{name:name})}}function joinParams(format,params){return"("+params.map(p=>p.format(format)).join(format==="full"?", ":",")+")"}class ErrorFragment extends NamedFragment{constructor(guard,name,inputs){super(guard,"error",name,inputs);Object.defineProperty(this,internal$1,{value:ErrorFragmentInternal})}get selector(){return id(this.format("sighash")).substring(0,10)}format(format){if(format==null){format="sighash"}if(format==="json"){return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(input=>JSON.parse(input.format(format)))})}const result=[];if(format!=="sighash"){result.push("error")}result.push(this.name+joinParams(format,this.inputs));return result.join(" ")}static from(obj){if(ErrorFragment.isFragment(obj)){return obj}if(typeof obj==="string"){return ErrorFragment.from(lex(obj))}else if(obj instanceof TokenString){const name=consumeName("error",obj);const inputs=consumeParams(obj);consumeEoi(obj);return new ErrorFragment(_guard$2,name,inputs)}return new ErrorFragment(_guard$2,obj.name,obj.inputs?obj.inputs.map(ParamType.from):[])}static isFragment(value){return value&&value[internal$1]===ErrorFragmentInternal}}class EventFragment extends NamedFragment{anonymous;constructor(guard,name,inputs,anonymous){super(guard,"event",name,inputs);Object.defineProperty(this,internal$1,{value:EventFragmentInternal});defineProperties(this,{anonymous:anonymous})}get topicHash(){return id(this.format("sighash"))}format(format){if(format==null){format="sighash"}if(format==="json"){return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(format)))})}const result=[];if(format!=="sighash"){result.push("event")}result.push(this.name+joinParams(format,this.inputs));if(format!=="sighash"&&this.anonymous){result.push("anonymous")}return result.join(" ")}static getTopicHash(name,params){params=(params||[]).map(p=>ParamType.from(p));const fragment=new EventFragment(_guard$2,name,params,false);return fragment.topicHash}static from(obj){if(EventFragment.isFragment(obj)){return obj}if(typeof obj==="string"){try{return EventFragment.from(lex(obj))}catch(error){assertArgument(false,"invalid event fragment","obj",obj)}}else if(obj instanceof TokenString){const name=consumeName("event",obj);const inputs=consumeParams(obj,true);const anonymous=!!consumeKeywords(obj,setify(["anonymous"])).has("anonymous");consumeEoi(obj);return new EventFragment(_guard$2,name,inputs,anonymous)}return new EventFragment(_guard$2,obj.name,obj.inputs?obj.inputs.map(p=>ParamType.from(p,true)):[],!!obj.anonymous)}static isFragment(value){return value&&value[internal$1]===EventFragmentInternal}}class ConstructorFragment extends Fragment{payable;gas;constructor(guard,type,inputs,payable,gas){super(guard,type,inputs);Object.defineProperty(this,internal$1,{value:ConstructorFragmentInternal});defineProperties(this,{payable:payable,gas:gas})}format(format){assert(format!=null&&format!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"});if(format==="json"){return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:undefined,inputs:this.inputs.map(i=>JSON.parse(i.format(format)))})}const result=[`constructor${joinParams(format,this.inputs)}`];if(this.payable){result.push("payable")}if(this.gas!=null){result.push(`@${this.gas.toString()}`)}return result.join(" ")}static from(obj){if(ConstructorFragment.isFragment(obj)){return obj}if(typeof obj==="string"){try{return ConstructorFragment.from(lex(obj))}catch(error){assertArgument(false,"invalid constuctor fragment","obj",obj)}}else if(obj instanceof TokenString){consumeKeywords(obj,setify(["constructor"]));const inputs=consumeParams(obj);const payable=!!consumeKeywords(obj,KwVisibDeploy).has("payable");const gas=consumeGas(obj);consumeEoi(obj);return new ConstructorFragment(_guard$2,"constructor",inputs,payable,gas)}return new ConstructorFragment(_guard$2,"constructor",obj.inputs?obj.inputs.map(ParamType.from):[],!!obj.payable,obj.gas!=null?obj.gas:null)}static isFragment(value){return value&&value[internal$1]===ConstructorFragmentInternal}}class FallbackFragment extends Fragment{payable;constructor(guard,inputs,payable){super(guard,"fallback",inputs);Object.defineProperty(this,internal$1,{value:FallbackFragmentInternal});defineProperties(this,{payable:payable})}format(format){const type=this.inputs.length===0?"receive":"fallback";if(format==="json"){const stateMutability=this.payable?"payable":"nonpayable";return JSON.stringify({type:type,stateMutability:stateMutability})}return`${type}()${this.payable?" payable":""}`}static from(obj){if(FallbackFragment.isFragment(obj)){return obj}if(typeof obj==="string"){try{return FallbackFragment.from(lex(obj))}catch(error){assertArgument(false,"invalid fallback fragment","obj",obj)}}else if(obj instanceof TokenString){const errorObj=obj.toString();const topIsValid=obj.peekKeyword(setify(["fallback","receive"]));assertArgument(topIsValid,"type must be fallback or receive","obj",errorObj);const type=obj.popKeyword(setify(["fallback","receive"]));if(type==="receive"){const inputs=consumeParams(obj);assertArgument(inputs.length===0,`receive cannot have arguments`,"obj.inputs",inputs);consumeKeywords(obj,setify(["payable"]));consumeEoi(obj);return new FallbackFragment(_guard$2,[],true)}let inputs=consumeParams(obj);if(inputs.length){assertArgument(inputs.length===1&&inputs[0].type==="bytes","invalid fallback inputs","obj.inputs",inputs.map(i=>i.format("minimal")).join(", "))}else{inputs=[ParamType.from("bytes")]}const mutability=consumeMutability(obj);assertArgument(mutability==="nonpayable"||mutability==="payable","fallback cannot be constants","obj.stateMutability",mutability);if(consumeKeywords(obj,setify(["returns"])).has("returns")){const outputs=consumeParams(obj);assertArgument(outputs.length===1&&outputs[0].type==="bytes","invalid fallback outputs","obj.outputs",outputs.map(i=>i.format("minimal")).join(", "))}consumeEoi(obj);return new FallbackFragment(_guard$2,inputs,mutability==="payable")}if(obj.type==="receive"){return new FallbackFragment(_guard$2,[],true)}if(obj.type==="fallback"){const inputs=[ParamType.from("bytes")];const payable=obj.stateMutability==="payable";return new FallbackFragment(_guard$2,inputs,payable)}assertArgument(false,"invalid fallback description","obj",obj)}static isFragment(value){return value&&value[internal$1]===FallbackFragmentInternal}}class FunctionFragment extends NamedFragment{constant;outputs;stateMutability;payable;gas;constructor(guard,name,stateMutability,inputs,outputs,gas){super(guard,"function",name,inputs);Object.defineProperty(this,internal$1,{value:FunctionFragmentInternal});outputs=Object.freeze(outputs.slice());const constant=stateMutability==="view"||stateMutability==="pure";const payable=stateMutability==="payable";defineProperties(this,{constant:constant,gas:gas,outputs:outputs,payable:payable,stateMutability:stateMutability})}get selector(){return id(this.format("sighash")).substring(0,10)}format(format){if(format==null){format="sighash"}if(format==="json"){return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:undefined,payable:this.payable,gas:this.gas!=null?this.gas:undefined,inputs:this.inputs.map(i=>JSON.parse(i.format(format))),outputs:this.outputs.map(o=>JSON.parse(o.format(format)))})}const result=[];if(format!=="sighash"){result.push("function")}result.push(this.name+joinParams(format,this.inputs));if(format!=="sighash"){if(this.stateMutability!=="nonpayable"){result.push(this.stateMutability)}if(this.outputs&&this.outputs.length){result.push("returns");result.push(joinParams(format,this.outputs))}if(this.gas!=null){result.push(`@${this.gas.toString()}`)}}return result.join(" ")}static getSelector(name,params){params=(params||[]).map(p=>ParamType.from(p));const fragment=new FunctionFragment(_guard$2,name,"view",params,[],null);return fragment.selector}static from(obj){if(FunctionFragment.isFragment(obj)){return obj}if(typeof obj==="string"){try{return FunctionFragment.from(lex(obj))}catch(error){assertArgument(false,"invalid function fragment","obj",obj)}}else if(obj instanceof TokenString){const name=consumeName("function",obj);const inputs=consumeParams(obj);const mutability=consumeMutability(obj);let outputs=[];if(consumeKeywords(obj,setify(["returns"])).has("returns")){outputs=consumeParams(obj)}const gas=consumeGas(obj);consumeEoi(obj);return new FunctionFragment(_guard$2,name,mutability,inputs,outputs,gas)}let stateMutability=obj.stateMutability;if(stateMutability==null){stateMutability="payable";if(typeof obj.constant==="boolean"){stateMutability="view";if(!obj.constant){stateMutability="payable";if(typeof obj.payable==="boolean"&&!obj.payable){stateMutability="nonpayable"}}}else if(typeof obj.payable==="boolean"&&!obj.payable){stateMutability="nonpayable"}}return new FunctionFragment(_guard$2,obj.name,stateMutability,obj.inputs?obj.inputs.map(ParamType.from):[],obj.outputs?obj.outputs.map(ParamType.from):[],obj.gas!=null?obj.gas:null)}static isFragment(value){return value&&value[internal$1]===FunctionFragmentInternal}}class StructFragment extends NamedFragment{constructor(guard,name,inputs){super(guard,"struct",name,inputs);Object.defineProperty(this,internal$1,{value:StructFragmentInternal})}format(){throw new Error("@TODO")}static from(obj){if(typeof obj==="string"){try{return StructFragment.from(lex(obj))}catch(error){assertArgument(false,"invalid struct fragment","obj",obj)}}else if(obj instanceof TokenString){const name=consumeName("struct",obj);const inputs=consumeParams(obj);consumeEoi(obj);return new StructFragment(_guard$2,name,inputs)}return new StructFragment(_guard$2,obj.name,obj.inputs?obj.inputs.map(ParamType.from):[])}static isFragment(value){return value&&value[internal$1]===StructFragmentInternal}}const PanicReasons$1=new Map;PanicReasons$1.set(0,"GENERIC_PANIC");PanicReasons$1.set(1,"ASSERT_FALSE");PanicReasons$1.set(17,"OVERFLOW");PanicReasons$1.set(18,"DIVIDE_BY_ZERO");PanicReasons$1.set(33,"ENUM_RANGE_ERROR");PanicReasons$1.set(34,"BAD_STORAGE_DATA");PanicReasons$1.set(49,"STACK_UNDERFLOW");PanicReasons$1.set(50,"ARRAY_RANGE_ERROR");PanicReasons$1.set(65,"OUT_OF_MEMORY");PanicReasons$1.set(81,"UNINITIALIZED_FUNCTION_CALL");const paramTypeBytes=new RegExp(/^bytes([0-9]*)$/);const paramTypeNumber=new RegExp(/^(u?int)([0-9]*)$/);let defaultCoder=null;let defaultMaxInflation=1024;function getBuiltinCallException(action,tx,data,abiCoder){let message="missing revert data";let reason=null;const invocation=null;let revert=null;if(data){message="execution reverted";const bytes=getBytes(data);data=hexlify(data);if(bytes.length===0){message+=" (no data present; likely require(false) occurred";reason="require(false)"}else if(bytes.length%32!==4){message+=" (could not decode reason; invalid data length)"}else if(hexlify(bytes.slice(0,4))==="0x08c379a0"){try{reason=abiCoder.decode(["string"],bytes.slice(4))[0];revert={signature:"Error(string)",name:"Error",args:[reason]};message+=`: ${JSON.stringify(reason)}`}catch(error){message+=" (could not decode reason; invalid string data)"}}else if(hexlify(bytes.slice(0,4))==="0x4e487b71"){try{const code=Number(abiCoder.decode(["uint256"],bytes.slice(4))[0]);revert={signature:"Panic(uint256)",name:"Panic",args:[code]};reason=`Panic due to ${PanicReasons$1.get(code)||"UNKNOWN"}(${code})`;message+=`: ${reason}`}catch(error){message+=" (could not decode panic code)"}}else{message+=" (unknown custom error)"}}const transaction={to:tx.to?getAddress(tx.to):null,data:tx.data||"0x"};if(tx.from){transaction.from=getAddress(tx.from)}return makeError(message,"CALL_EXCEPTION",{action:action,data:data,reason:reason,transaction:transaction,invocation:invocation,revert:revert})}class AbiCoder{#getCoder(param){if(param.isArray()){return new ArrayCoder(this.#getCoder(param.arrayChildren),param.arrayLength,param.name)}if(param.isTuple()){return new TupleCoder(param.components.map(c=>this.#getCoder(c)),param.name)}switch(param.baseType){case"address":return new AddressCoder(param.name);case"bool":return new BooleanCoder(param.name);case"string":return new StringCoder(param.name);case"bytes":return new BytesCoder(param.name);case"":return new NullCoder(param.name)}let match=param.type.match(paramTypeNumber);if(match){let size=parseInt(match[2]||"256");assertArgument(size!==0&&size<=256&&size%8===0,"invalid "+match[1]+" bit length","param",param);return new NumberCoder(size/8,match[1]==="int",param.name)}match=param.type.match(paramTypeBytes);if(match){let size=parseInt(match[1]);assertArgument(size!==0&&size<=32,"invalid bytes length","param",param);return new FixedBytesCoder(size,param.name)}assertArgument(false,"invalid type","type",param.type)}getDefaultValue(types){const coders=types.map(type=>this.#getCoder(ParamType.from(type)));const coder=new TupleCoder(coders,"_");return coder.defaultValue()}encode(types,values){assertArgumentCount(values.length,types.length,"types/values length mismatch");const coders=types.map(type=>this.#getCoder(ParamType.from(type)));const coder=new TupleCoder(coders,"_");const writer=new Writer;coder.encode(writer,values);return writer.data}decode(types,data,loose){const coders=types.map(type=>this.#getCoder(ParamType.from(type)));const coder=new TupleCoder(coders,"_");return coder.decode(new Reader(data,loose,defaultMaxInflation))}static _setDefaultMaxInflation(value){assertArgument(typeof value==="number"&&Number.isInteger(value),"invalid defaultMaxInflation factor","value",value);defaultMaxInflation=value}static defaultAbiCoder(){if(defaultCoder==null){defaultCoder=new AbiCoder}return defaultCoder}static getBuiltinCallException(action,tx,data){return getBuiltinCallException(action,tx,data,AbiCoder.defaultAbiCoder())}}function encodeBytes32String(text){const bytes=toUtf8Bytes(text);if(bytes.length>31){throw new Error("bytes32 string must be less than 32 bytes")}return zeroPadBytes(bytes,32)}function decodeBytes32String(_bytes){const data=getBytes(_bytes,"bytes");if(data.length!==32){throw new Error("invalid bytes32 - not 32 bytes long")}if(data[31]!==0){throw new Error("invalid bytes32 string - no null terminator")}let length=31;while(data[length-1]===0){length--}return toUtf8String(data.slice(0,length))}class LogDescription{fragment;name;signature;topic;args;constructor(fragment,topic,args){const name=fragment.name,signature=fragment.format();defineProperties(this,{fragment:fragment,name:name,signature:signature,topic:topic,args:args})}}class TransactionDescription{fragment;name;args;signature;selector;value;constructor(fragment,selector,args,value){const name=fragment.name,signature=fragment.format();defineProperties(this,{fragment:fragment,name:name,args:args,signature:signature,selector:selector,value:value})}}class ErrorDescription{fragment;name;args;signature;selector;constructor(fragment,selector,args){const name=fragment.name,signature=fragment.format();defineProperties(this,{fragment:fragment,name:name,args:args,signature:signature,selector:selector})}}class Indexed{hash;_isIndexed;static isIndexed(value){return!!(value&&value._isIndexed)}constructor(hash){defineProperties(this,{hash:hash,_isIndexed:true})}}const PanicReasons={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"};const BuiltinErrors={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:message=>{return`reverted with reason string ${JSON.stringify(message)}`}},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:code=>{let reason="unknown panic code";if(code>=0&&code<=255&&PanicReasons[code.toString()]){reason=PanicReasons[code.toString()]}return`reverted with panic code 0x${code.toString(16)} (${reason})`}}};class Interface{fragments;deploy;fallback;receive;#errors;#events;#functions;#abiCoder;constructor(fragments){let abi=[];if(typeof fragments==="string"){abi=JSON.parse(fragments)}else{abi=fragments}this.#functions=new Map;this.#errors=new Map;this.#events=new Map;const frags=[];for(const a of abi){try{frags.push(Fragment.from(a))}catch(error){console.log(`[Warning] Invalid Fragment ${JSON.stringify(a)}:`,error.message)}}defineProperties(this,{fragments:Object.freeze(frags)});let fallback=null;let receive=false;this.#abiCoder=this.getAbiCoder();this.fragments.forEach((fragment,index)=>{let bucket;switch(fragment.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}defineProperties(this,{deploy:fragment});return;case"fallback":if(fragment.inputs.length===0){receive=true}else{assertArgument(!fallback||fragment.payable!==fallback.payable,"conflicting fallback fragments",`fragments[${index}]`,fragment);fallback=fragment;receive=fallback.payable}return;case"function":bucket=this.#functions;break;case"event":bucket=this.#events;break;case"error":bucket=this.#errors;break;default:return}const signature=fragment.format();if(bucket.has(signature)){return}bucket.set(signature,fragment)});if(!this.deploy){defineProperties(this,{deploy:ConstructorFragment.from("constructor()")})}defineProperties(this,{fallback:fallback,receive:receive})}format(minimal){const format=minimal?"minimal":"full";const abi=this.fragments.map(f=>f.format(format));return abi}formatJson(){const abi=this.fragments.map(f=>f.format("json"));return JSON.stringify(abi.map(j=>JSON.parse(j)))}getAbiCoder(){return AbiCoder.defaultAbiCoder()}#getFunction(key,values,forceUnique){if(isHexString(key)){const selector=key.toLowerCase();for(const fragment of this.#functions.values()){if(selector===fragment.selector){return fragment}}return null}if(key.indexOf("(")===-1){const matching=[];for(const[name,fragment]of this.#functions){if(name.split("(")[0]===key){matching.push(fragment)}}if(values){const lastValue=values.length>0?values[values.length-1]:null;let valueLength=values.length;let allowOptions=true;if(Typed.isTyped(lastValue)&&lastValue.type==="overrides"){allowOptions=false;valueLength--}for(let i=matching.length-1;i>=0;i--){const inputs=matching[i].inputs.length;if(inputs!==valueLength&&(!allowOptions||inputs!==valueLength-1)){matching.splice(i,1)}}for(let i=matching.length-1;i>=0;i--){const inputs=matching[i].inputs;for(let j=0;j=inputs.length){if(values[j].type==="overrides"){continue}matching.splice(i,1);break}if(values[j].type!==inputs[j].baseType){matching.splice(i,1);break}}}}if(matching.length===1&&values&&values.length!==matching[0].inputs.length){const lastArg=values[values.length-1];if(lastArg==null||Array.isArray(lastArg)||typeof lastArg!=="object"){matching.splice(0,1)}}if(matching.length===0){return null}if(matching.length>1&&forceUnique){const matchStr=matching.map(m=>JSON.stringify(m.format())).join(", ");assertArgument(false,`ambiguous function description (i.e. matches ${matchStr})`,"key",key)}return matching[0]}const result=this.#functions.get(FunctionFragment.from(key).format());if(result){return result}return null}getFunctionName(key){const fragment=this.#getFunction(key,null,false);assertArgument(fragment,"no matching function","key",key);return fragment.name}hasFunction(key){return!!this.#getFunction(key,null,false)}getFunction(key,values){return this.#getFunction(key,values||null,true)}forEachFunction(callback){const names=Array.from(this.#functions.keys());names.sort((a,b)=>a.localeCompare(b));for(let i=0;i=0;i--){if(matching[i].inputs.length=0;i--){const inputs=matching[i].inputs;for(let j=0;j1&&forceUnique){const matchStr=matching.map(m=>JSON.stringify(m.format())).join(", ");assertArgument(false,`ambiguous event description (i.e. matches ${matchStr})`,"key",key)}return matching[0]}const result=this.#events.get(EventFragment.from(key).format());if(result){return result}return null}getEventName(key){const fragment=this.#getEvent(key,null,false);assertArgument(fragment,"no matching event","key",key);return fragment.name}hasEvent(key){return!!this.#getEvent(key,null,false)}getEvent(key,values){return this.#getEvent(key,values||null,true)}forEachEvent(callback){const names=Array.from(this.#events.keys());names.sort((a,b)=>a.localeCompare(b));for(let i=0;i1){const matchStr=matching.map(m=>JSON.stringify(m.format())).join(", ");assertArgument(false,`ambiguous error description (i.e. ${matchStr})`,"name",key)}return matching[0]}key=ErrorFragment.from(key).format();if(key==="Error(string)"){return ErrorFragment.from("error Error(string)")}if(key==="Panic(uint256)"){return ErrorFragment.from("error Panic(uint256)")}const result=this.#errors.get(key);if(result){return result}return null}forEachError(callback){const names=Array.from(this.#errors.keys());names.sort((a,b)=>a.localeCompare(b));for(let i=0;i{if(param.type==="string"){return id(value)}else if(param.type==="bytes"){return keccak256(hexlify(value))}if(param.type==="bool"&&typeof value==="boolean"){value=value?"0x01":"0x00"}else if(param.type.match(/^u?int/)){value=toBeHex(value)}else if(param.type.match(/^bytes/)){value=zeroPadBytes(value,32)}else if(param.type==="address"){this.#abiCoder.encode(["address"],[value])}return zeroPadValue(hexlify(value),32)};values.forEach((value,index)=>{const param=fragment.inputs[index];if(!param.indexed){assertArgument(value==null,"cannot filter non-indexed parameters; must be null","contract."+param.name,value);return}if(value==null){topics.push(null)}else if(param.baseType==="array"||param.baseType==="tuple"){assertArgument(false,"filtering with tuples or arrays not supported","contract."+param.name,value)}else if(Array.isArray(value)){topics.push(value.map(value=>encodeTopic(param,value)))}else{topics.push(encodeTopic(param,value))}});while(topics.length&&topics[topics.length-1]===null){topics.pop()}return topics}encodeEventLog(fragment,values){if(typeof fragment==="string"){const f=this.getEvent(fragment);assertArgument(f,"unknown event","eventFragment",fragment);fragment=f}const topics=[];const dataTypes=[];const dataValues=[];if(!fragment.anonymous){topics.push(fragment.topicHash)}assertArgument(values.length===fragment.inputs.length,"event arguments/values mismatch","values",values);fragment.inputs.forEach((param,index)=>{const value=values[index];if(param.indexed){if(param.type==="string"){topics.push(id(value))}else if(param.type==="bytes"){topics.push(keccak256(value))}else if(param.baseType==="tuple"||param.baseType==="array"){throw new Error("not implemented")}else{topics.push(this.#abiCoder.encode([param.type],[value]))}}else{dataTypes.push(param);dataValues.push(value)}});return{data:this.#abiCoder.encode(dataTypes,dataValues),topics:topics}}decodeEventLog(fragment,data,topics){if(typeof fragment==="string"){const f=this.getEvent(fragment);assertArgument(f,"unknown event","eventFragment",fragment);fragment=f}if(topics!=null&&!fragment.anonymous){const eventTopic=fragment.topicHash;assertArgument(isHexString(topics[0],32)&&topics[0].toLowerCase()===eventTopic,"fragment/topic mismatch","topics[0]",topics[0]);topics=topics.slice(1)}const indexed=[];const nonIndexed=[];const dynamic=[];fragment.inputs.forEach((param,index)=>{if(param.indexed){if(param.type==="string"||param.type==="bytes"||param.baseType==="tuple"||param.baseType==="array"){indexed.push(ParamType.from({type:"bytes32",name:param.name}));dynamic.push(true)}else{indexed.push(param);dynamic.push(false)}}else{nonIndexed.push(param);dynamic.push(false)}});const resultIndexed=topics!=null?this.#abiCoder.decode(indexed,concat(topics)):null;const resultNonIndexed=this.#abiCoder.decode(nonIndexed,data,true);const values=[];const keys=[];let nonIndexedIndex=0,indexedIndex=0;fragment.inputs.forEach((param,index)=>{let value=null;if(param.indexed){if(resultIndexed==null){value=new Indexed(null)}else if(dynamic[index]){value=new Indexed(resultIndexed[indexedIndex++])}else{try{value=resultIndexed[indexedIndex++]}catch(error){value=error}}}else{try{value=resultNonIndexed[nonIndexedIndex++]}catch(error){value=error}}values.push(value);keys.push(param.name||null)});return Result.fromItems(values,keys)}parseTransaction(tx){const data=getBytes(tx.data,"tx.data");const value=getBigInt(tx.value!=null?tx.value:0,"tx.value");const fragment=this.getFunction(hexlify(data.slice(0,4)));if(!fragment){return null}const args=this.#abiCoder.decode(fragment.inputs,data.slice(4));return new TransactionDescription(fragment,fragment.selector,args,value)}parseCallResult(data){throw new Error("@TODO")}parseLog(log){const fragment=this.getEvent(log.topics[0]);if(!fragment||fragment.anonymous){return null}return new LogDescription(fragment,fragment.topicHash,this.decodeEventLog(fragment,log.data,log.topics))}parseError(data){const hexData=hexlify(data);const fragment=this.getError(dataSlice(hexData,0,4));if(!fragment){return null}const args=this.#abiCoder.decode(fragment.inputs,dataSlice(hexData,4));return new ErrorDescription(fragment,fragment.selector,args)}static from(value){if(value instanceof Interface){return value}if(typeof value==="string"){return new Interface(JSON.parse(value))}if(typeof value.formatJson==="function"){return new Interface(value.formatJson())}if(typeof value.format==="function"){return new Interface(value.format("json"))}return new Interface(value)}}const BN_0$2=BigInt(0);function getValue(value){if(value==null){return null}return value}function toJson(value){if(value==null){return null}return value.toString()}class FeeData{gasPrice;maxFeePerGas;maxPriorityFeePerGas;constructor(gasPrice,maxFeePerGas,maxPriorityFeePerGas){defineProperties(this,{gasPrice:getValue(gasPrice),maxFeePerGas:getValue(maxFeePerGas),maxPriorityFeePerGas:getValue(maxPriorityFeePerGas)})}toJSON(){const{gasPrice,maxFeePerGas,maxPriorityFeePerGas}=this;return{_type:"FeeData",gasPrice:toJson(gasPrice),maxFeePerGas:toJson(maxFeePerGas),maxPriorityFeePerGas:toJson(maxPriorityFeePerGas)}}}function copyRequest(req){const result={};if(req.to){result.to=req.to}if(req.from){result.from=req.from}if(req.data){result.data=hexlify(req.data)}const bigIntKeys="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const key of bigIntKeys){if(!(key in req)||req[key]==null){continue}result[key]=getBigInt(req[key],`request.${key}`)}const numberKeys="type,nonce".split(/,/);for(const key of numberKeys){if(!(key in req)||req[key]==null){continue}result[key]=getNumber(req[key],`request.${key}`)}if(req.accessList){result.accessList=accessListify(req.accessList)}if(req.authorizationList){result.authorizationList=req.authorizationList.slice()}if("blockTag"in req){result.blockTag=req.blockTag}if("enableCcipRead"in req){result.enableCcipRead=!!req.enableCcipRead}if("customData"in req){result.customData=req.customData}if("blobVersionedHashes"in req&&req.blobVersionedHashes){result.blobVersionedHashes=req.blobVersionedHashes.slice()}if("kzg"in req){result.kzg=req.kzg}if("blobWrapperVersion"in req){result.blobWrapperVersion=req.blobWrapperVersion}if("blobs"in req&&req.blobs){result.blobs=req.blobs.map(b=>{if(isBytesLike(b)){return hexlify(b)}return Object.assign({},b)})}return result}class Block{provider;number;hash;timestamp;parentHash;parentBeaconBlockRoot;nonce;difficulty;gasLimit;gasUsed;stateRoot;receiptsRoot;blobGasUsed;excessBlobGas;miner;prevRandao;extraData;baseFeePerGas;#transactions;constructor(block,provider){this.#transactions=block.transactions.map(tx=>{if(typeof tx!=="string"){return new TransactionResponse(tx,provider)}return tx});defineProperties(this,{provider:provider,hash:getValue(block.hash),number:block.number,timestamp:block.timestamp,parentHash:block.parentHash,parentBeaconBlockRoot:block.parentBeaconBlockRoot,nonce:block.nonce,difficulty:block.difficulty,gasLimit:block.gasLimit,gasUsed:block.gasUsed,blobGasUsed:block.blobGasUsed,excessBlobGas:block.excessBlobGas,miner:block.miner,prevRandao:getValue(block.prevRandao),extraData:block.extraData,baseFeePerGas:getValue(block.baseFeePerGas),stateRoot:block.stateRoot,receiptsRoot:block.receiptsRoot})}get transactions(){return this.#transactions.map(tx=>{if(typeof tx==="string"){return tx}return tx.hash})}get prefetchedTransactions(){const txs=this.#transactions.slice();if(txs.length===0){return[]}assert(typeof txs[0]==="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"});return txs}toJSON(){const{baseFeePerGas,difficulty,extraData,gasLimit,gasUsed,hash,miner,prevRandao,nonce,number,parentHash,parentBeaconBlockRoot,stateRoot,receiptsRoot,timestamp,transactions}=this;return{_type:"Block",baseFeePerGas:toJson(baseFeePerGas),difficulty:toJson(difficulty),extraData:extraData,gasLimit:toJson(gasLimit),gasUsed:toJson(gasUsed),blobGasUsed:toJson(this.blobGasUsed),excessBlobGas:toJson(this.excessBlobGas),hash:hash,miner:miner,prevRandao:prevRandao,nonce:nonce,number:number,parentHash:parentHash,timestamp:timestamp,parentBeaconBlockRoot:parentBeaconBlockRoot,stateRoot:stateRoot,receiptsRoot:receiptsRoot,transactions:transactions}}[Symbol.iterator](){let index=0;const txs=this.transactions;return{next:()=>{if(index{return new Log(log,provider)}));let gasPrice=BN_0$2;if(tx.effectiveGasPrice!=null){gasPrice=tx.effectiveGasPrice}else if(tx.gasPrice!=null){gasPrice=tx.gasPrice}defineProperties(this,{provider:provider,to:tx.to,from:tx.from,contractAddress:tx.contractAddress,hash:tx.hash,index:tx.index,blockHash:tx.blockHash,blockNumber:tx.blockNumber,logsBloom:tx.logsBloom,gasUsed:tx.gasUsed,cumulativeGasUsed:tx.cumulativeGasUsed,blobGasUsed:tx.blobGasUsed,gasPrice:gasPrice,blobGasPrice:tx.blobGasPrice,type:tx.type,status:tx.status,root:tx.root})}get logs(){return this.#logs}toJSON(){const{to,from,contractAddress,hash,index,blockHash,blockNumber,logsBloom,logs,status,root}=this;return{_type:"TransactionReceipt",blockHash:blockHash,blockNumber:blockNumber,contractAddress:contractAddress,cumulativeGasUsed:toJson(this.cumulativeGasUsed),from:from,gasPrice:toJson(this.gasPrice),blobGasUsed:toJson(this.blobGasUsed),blobGasPrice:toJson(this.blobGasPrice),gasUsed:toJson(this.gasUsed),hash:hash,index:index,logs:logs,logsBloom:logsBloom,root:root,status:status,to:to}}get length(){return this.logs.length}[Symbol.iterator](){let index=0;return{next:()=>{if(index{if(stopScanning){return null}const{blockNumber,nonce}=await resolveProperties({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(nonce{if(receipt==null||receipt.status!==0){return receipt}assert(false,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:receipt.to,from:receipt.from,data:""},receipt:receipt})};const receipt=await this.provider.getTransactionReceipt(this.hash);if(confirms===0){return checkReceipt(receipt)}if(receipt){if(confirms===1||await receipt.confirmations()>=confirms){return checkReceipt(receipt)}}else{await checkReplacement();if(confirms===0){return null}}const waiter=new Promise((resolve,reject)=>{const cancellers=[];const cancel=()=>{cancellers.forEach(c=>c())};cancellers.push(()=>{stopScanning=true});if(timeout>0){const timer=setTimeout(()=>{cancel();reject(makeError("wait for transaction timeout","TIMEOUT"))},timeout);cancellers.push(()=>{clearTimeout(timer)})}const txListener=async receipt=>{if(await receipt.confirmations()>=confirms){cancel();try{resolve(checkReceipt(receipt))}catch(error){reject(error)}}};cancellers.push(()=>{this.provider.off(this.hash,txListener)});this.provider.on(this.hash,txListener);if(startBlock>=0){const replaceListener=async()=>{try{await checkReplacement()}catch(error){if(isError(error,"TRANSACTION_REPLACED")){cancel();reject(error);return}}if(!stopScanning){this.provider.once("block",replaceListener)}};cancellers.push(()=>{this.provider.off("block",replaceListener)});this.provider.once("block",replaceListener)}});return await waiter}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){assert(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"});return createRemovedTransactionFilter(this)}reorderedEvent(other){assert(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"});assert(!other||other.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"});return createReorderedTransactionFilter(this,other)}replaceableTransaction(startBlock){assertArgument(Number.isInteger(startBlock)&&startBlock>=0,"invalid startBlock","startBlock",startBlock);const tx=new TransactionResponse(this,this.provider);tx.#startBlock=startBlock;return tx}}function createOrphanedBlockFilter(block){return{orphan:"drop-block",hash:block.hash,number:block.number}}function createReorderedTransactionFilter(tx,other){return{orphan:"reorder-transaction",tx:tx,other:other}}function createRemovedTransactionFilter(tx){return{orphan:"drop-transaction",tx:tx}}function createRemovedLogFilter(log){return{orphan:"drop-log",log:{transactionHash:log.transactionHash,blockHash:log.blockHash,blockNumber:log.blockNumber,address:log.address,data:log.data,topics:Object.freeze(log.topics.slice()),index:log.index}}}class EventLog extends Log{interface;fragment;args;constructor(log,iface,fragment){super(log,log.provider);const args=iface.decodeEventLog(fragment,log.data,log.topics);defineProperties(this,{args:args,fragment:fragment,interface:iface})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class UndecodedEventLog extends Log{error;constructor(log,error){super(log,log.provider);defineProperties(this,{error:error})}}class ContractTransactionReceipt extends TransactionReceipt{#iface;constructor(iface,provider,tx){super(tx,provider);this.#iface=iface}get logs(){return super.logs.map(log=>{const fragment=log.topics.length?this.#iface.getEvent(log.topics[0]):null;if(fragment){try{return new EventLog(log,this.#iface,fragment)}catch(error){return new UndecodedEventLog(log,error)}}return log})}}class ContractTransactionResponse extends TransactionResponse{#iface;constructor(iface,provider,tx){super(tx,provider);this.#iface=iface}async wait(confirms,timeout){const receipt=await super.wait(confirms,timeout);if(receipt==null){return null}return new ContractTransactionReceipt(this.#iface,this.provider,receipt)}}class ContractUnknownEventPayload extends EventPayload{log;constructor(contract,listener,filter,log){super(contract,listener,filter);defineProperties(this,{log:log})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class ContractEventPayload extends ContractUnknownEventPayload{constructor(contract,listener,filter,fragment,_log){super(contract,listener,filter,new EventLog(_log,contract.interface,fragment));const args=contract.interface.decodeEventLog(fragment,this.log.data,this.log.topics);defineProperties(this,{args:args,fragment:fragment})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const BN_0$1=BigInt(0);function canCall(value){return value&&typeof value.call==="function"}function canEstimate(value){return value&&typeof value.estimateGas==="function"}function canResolve(value){return value&&typeof value.resolveName==="function"}function canSend(value){return value&&typeof value.sendTransaction==="function"}function getResolver(value){if(value!=null){if(canResolve(value)){return value}if(value.provider){return value.provider}}return undefined}class PreparedTopicFilter{#filter;fragment;constructor(contract,fragment,args){defineProperties(this,{fragment:fragment});if(fragment.inputs.length{const arg=args[index];if(arg==null){return null}return param.walkAsync(args[index],(type,value)=>{if(type==="address"){if(Array.isArray(value)){return Promise.all(value.map(v=>resolveAddress(v,resolver)))}return resolveAddress(value,resolver)}return value})}));return contract.interface.encodeFilterTopics(fragment,resolvedArgs)}()}getTopicFilter(){return this.#filter}}function getRunner(value,feature){if(value==null){return null}if(typeof value[feature]==="function"){return value}if(value.provider&&typeof value.provider[feature]==="function"){return value.provider}return null}function getProvider(value){if(value==null){return null}return value.provider||null}async function copyOverrides(arg,allowed){const _overrides=Typed.dereference(arg,"overrides");assertArgument(typeof _overrides==="object","invalid overrides parameter","overrides",arg);const overrides=copyRequest(_overrides);assertArgument(overrides.to==null||(allowed||[]).indexOf("to")>=0,"cannot override to","overrides.to",overrides.to);assertArgument(overrides.data==null||(allowed||[]).indexOf("data")>=0,"cannot override data","overrides.data",overrides.data);if(overrides.from){overrides.from=overrides.from}return overrides}async function resolveArgs(_runner,inputs,args){const runner=getRunner(_runner,"resolveName");const resolver=canResolve(runner)?runner:null;return await Promise.all(inputs.map((param,index)=>{return param.walkAsync(args[index],(type,value)=>{value=Typed.dereference(value,type);if(type==="address"){return resolveAddress(value,resolver)}return value})}))}function buildWrappedFallback(contract){const populateTransaction=async function(overrides){const tx=await copyOverrides(overrides,["data"]);tx.to=await contract.getAddress();if(tx.from){tx.from=await resolveAddress(tx.from,getResolver(contract.runner))}const iface=contract.interface;const noValue=getBigInt(tx.value||BN_0$1,"overrides.value")===BN_0$1;const noData=(tx.data||"0x")==="0x";if(iface.fallback&&!iface.fallback.payable&&iface.receive&&!noData&&!noValue){assertArgument(false,"cannot send data to receive or send value to non-payable fallback","overrides",overrides)}assertArgument(iface.fallback||noData,"cannot send data to receive-only contract","overrides.data",tx.data);const payable=iface.receive||iface.fallback&&iface.fallback.payable;assertArgument(payable||noValue,"cannot send value to non-payable fallback","overrides.value",tx.value);assertArgument(iface.fallback||noData,"cannot send data to receive-only contract","overrides.data",tx.data);return tx};const staticCall=async function(overrides){const runner=getRunner(contract.runner,"call");assert(canCall(runner),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const tx=await populateTransaction(overrides);try{return await runner.call(tx)}catch(error){if(isCallException(error)&&error.data){throw contract.interface.makeError(error.data,tx)}throw error}};const send=async function(overrides){const runner=contract.runner;assert(canSend(runner),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const tx=await runner.sendTransaction(await populateTransaction(overrides));const provider=getProvider(contract.runner);return new ContractTransactionResponse(contract.interface,provider,tx)};const estimateGas=async function(overrides){const runner=getRunner(contract.runner,"estimateGas");assert(canEstimate(runner),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"});return await runner.estimateGas(await populateTransaction(overrides))};const method=async overrides=>{return await send(overrides)};defineProperties(method,{_contract:contract,estimateGas:estimateGas,populateTransaction:populateTransaction,send:send,staticCall:staticCall});return method}function buildWrappedMethod(contract,key){const getFragment=function(...args){const fragment=contract.interface.getFunction(key,args);assert(fragment,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:key,args:args}});return fragment};const populateTransaction=async function(...args){const fragment=getFragment(...args);let overrides={};if(fragment.inputs.length+1===args.length){overrides=await copyOverrides(args.pop());if(overrides.from){overrides.from=await resolveAddress(overrides.from,getResolver(contract.runner))}}if(fragment.inputs.length!==args.length){throw new Error("internal error: fragment inputs doesn't match arguments; should not happen")}const resolvedArgs=await resolveArgs(contract.runner,fragment.inputs,args);return Object.assign({},overrides,await resolveProperties({to:contract.getAddress(),data:contract.interface.encodeFunctionData(fragment,resolvedArgs)}))};const staticCall=async function(...args){const result=await staticCallResult(...args);if(result.length===1){return result[0]}return result};const send=async function(...args){const runner=contract.runner;assert(canSend(runner),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const tx=await runner.sendTransaction(await populateTransaction(...args));const provider=getProvider(contract.runner);return new ContractTransactionResponse(contract.interface,provider,tx)};const estimateGas=async function(...args){const runner=getRunner(contract.runner,"estimateGas");assert(canEstimate(runner),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"});return await runner.estimateGas(await populateTransaction(...args))};const staticCallResult=async function(...args){const runner=getRunner(contract.runner,"call");assert(canCall(runner),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const tx=await populateTransaction(...args);let result="0x";try{result=await runner.call(tx)}catch(error){if(isCallException(error)&&error.data){throw contract.interface.makeError(error.data,tx)}throw error}const fragment=getFragment(...args);return contract.interface.decodeFunctionResult(fragment,result)};const method=async(...args)=>{const fragment=getFragment(...args);if(fragment.constant){return await staticCall(...args)}return await send(...args)};defineProperties(method,{name:contract.interface.getFunctionName(key),_contract:contract,_key:key,getFragment:getFragment,estimateGas:estimateGas,populateTransaction:populateTransaction,send:send,staticCall:staticCall,staticCallResult:staticCallResult});Object.defineProperty(method,"fragment",{configurable:false,enumerable:true,get:()=>{const fragment=contract.interface.getFunction(key);assert(fragment,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:key}});return fragment}});return method}function buildWrappedEvent(contract,key){const getFragment=function(...args){const fragment=contract.interface.getEvent(key,args);assert(fragment,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:key,args:args}});return fragment};const method=function(...args){return new PreparedTopicFilter(contract,getFragment(...args),args)};defineProperties(method,{name:contract.interface.getEventName(key),_contract:contract,_key:key,getFragment:getFragment});Object.defineProperty(method,"fragment",{configurable:false,enumerable:true,get:()=>{const fragment=contract.interface.getEvent(key);assert(fragment,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:key}});return fragment}});return method}const internal=Symbol.for("_ethersInternal_contract");const internalValues=new WeakMap;function setInternal(contract,values){internalValues.set(contract[internal],values)}function getInternal(contract){return internalValues.get(contract[internal])}function isDeferred(value){return value&&typeof value==="object"&&"getTopicFilter"in value&&typeof value.getTopicFilter==="function"&&value.fragment}async function getSubInfo(contract,event){let topics;let fragment=null;if(Array.isArray(event)){const topicHashify=function(name){if(isHexString(name,32)){return name}const fragment=contract.interface.getEvent(name);assertArgument(fragment,"unknown fragment","name",name);return fragment.topicHash};topics=event.map(e=>{if(e==null){return null}if(Array.isArray(e)){return e.map(topicHashify)}return topicHashify(e)})}else if(event==="*"){topics=[null]}else if(typeof event==="string"){if(isHexString(event,32)){topics=[event]}else{fragment=contract.interface.getEvent(event);assertArgument(fragment,"unknown fragment","event",event);topics=[fragment.topicHash]}}else if(isDeferred(event)){topics=await event.getTopicFilter()}else if("fragment"in event){fragment=event.fragment;topics=[fragment.topicHash]}else{assertArgument(false,"unknown event name","event",event)}topics=topics.map(t=>{if(t==null){return null}if(Array.isArray(t)){const items=Array.from(new Set(t.map(t=>t.toLowerCase())).values());if(items.length===1){return items[0]}items.sort();return items}return t.toLowerCase()});const tag=topics.map(t=>{if(t==null){return"null"}if(Array.isArray(t)){return t.join("|")}return t}).join("&");return{fragment:fragment,tag:tag,topics:topics}}async function hasSub(contract,event){const{subs}=getInternal(contract);return subs.get((await getSubInfo(contract,event)).tag)||null}async function getSub(contract,operation,event){const provider=getProvider(contract.runner);assert(provider,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:operation});const{fragment,tag,topics}=await getSubInfo(contract,event);const{addr,subs}=getInternal(contract);let sub=subs.get(tag);if(!sub){const address=addr?addr:contract;const filter={address:address,topics:topics};const listener=log=>{let foundFragment=fragment;if(foundFragment==null){try{foundFragment=contract.interface.getEvent(log.topics[0])}catch(error){}}if(foundFragment){const _foundFragment=foundFragment;const args=fragment?contract.interface.decodeEventLog(fragment,log.data,log.topics):[];emit(contract,event,args,listener=>{return new ContractEventPayload(contract,listener,event,_foundFragment,log)})}else{emit(contract,event,[],listener=>{return new ContractUnknownEventPayload(contract,listener,event,log)})}};let starting=[];const start=()=>{if(starting.length){return}starting.push(provider.on(filter,listener))};const stop=async()=>{if(starting.length==0){return}let started=starting;starting=[];await Promise.all(started);provider.off(filter,listener)};sub={tag:tag,listeners:[],start:start,stop:stop};subs.set(tag,sub)}return sub}let lastEmit=Promise.resolve();async function _emit(contract,event,args,payloadFunc){await lastEmit;const sub=await hasSub(contract,event);if(!sub){return false}const count=sub.listeners.length;sub.listeners=sub.listeners.filter(({listener,once})=>{const passArgs=Array.from(args);if(payloadFunc){passArgs.push(payloadFunc(once?null:listener))}try{listener.call(contract,...passArgs)}catch(error){}return!once});if(sub.listeners.length===0){sub.stop();getInternal(contract).subs.delete(sub.tag)}return count>0}async function emit(contract,event,args,payloadFunc){try{await lastEmit}catch(error){}const resultPromise=_emit(contract,event,args,payloadFunc);lastEmit=resultPromise;return await resultPromise}const passProperties=["then"];class BaseContract{target;interface;runner;filters;[internal];fallback;constructor(target,abi,runner,_deployTx){assertArgument(typeof target==="string"||isAddressable(target),"invalid value for Contract target","target",target);if(runner==null){runner=null}const iface=Interface.from(abi);defineProperties(this,{target:target,runner:runner,interface:iface});Object.defineProperty(this,internal,{value:{}});let addrPromise;let addr=null;let deployTx=null;if(_deployTx){const provider=getProvider(runner);deployTx=new ContractTransactionResponse(this.interface,provider,_deployTx)}let subs=new Map;if(typeof target==="string"){if(isHexString(target)){addr=target;addrPromise=Promise.resolve(target)}else{const resolver=getRunner(runner,"resolveName");if(!canResolve(resolver)){throw makeError("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"})}addrPromise=resolver.resolveName(target).then(addr=>{if(addr==null){throw makeError("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:target})}getInternal(this).addr=addr;return addr})}}else{addrPromise=target.getAddress().then(addr=>{if(addr==null){throw new Error("TODO")}getInternal(this).addr=addr;return addr})}setInternal(this,{addrPromise:addrPromise,addr:addr,deployTx:deployTx,subs:subs});const filters=new Proxy({},{get:(target,prop,receiver)=>{if(typeof prop==="symbol"||passProperties.indexOf(prop)>=0){return Reflect.get(target,prop,receiver)}try{return this.getEvent(prop)}catch(error){if(!isError(error,"INVALID_ARGUMENT")||error.argument!=="key"){throw error}}return undefined},has:(target,prop)=>{if(passProperties.indexOf(prop)>=0){return Reflect.has(target,prop)}return Reflect.has(target,prop)||this.interface.hasEvent(String(prop))}});defineProperties(this,{filters:filters});defineProperties(this,{fallback:iface.receive||iface.fallback?buildWrappedFallback(this):null});return new Proxy(this,{get:(target,prop,receiver)=>{if(typeof prop==="symbol"||prop in target||passProperties.indexOf(prop)>=0){return Reflect.get(target,prop,receiver)}try{return target.getFunction(prop)}catch(error){if(!isError(error,"INVALID_ARGUMENT")||error.argument!=="key"){throw error}}return undefined},has:(target,prop)=>{if(typeof prop==="symbol"||prop in target||passProperties.indexOf(prop)>=0){return Reflect.has(target,prop)}return target.interface.hasFunction(prop)}})}connect(runner){return new BaseContract(this.target,this.interface,runner)}attach(target){return new BaseContract(target,this.interface,this.runner)}async getAddress(){return await getInternal(this).addrPromise}async getDeployedCode(){const provider=getProvider(this.runner);assert(provider,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const code=await provider.getCode(await this.getAddress());if(code==="0x"){return null}return code}async waitForDeployment(){const deployTx=this.deploymentTransaction();if(deployTx){await deployTx.wait();return this}const code=await this.getDeployedCode();if(code!=null){return this}const provider=getProvider(this.runner);assert(provider!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"});return new Promise((resolve,reject)=>{const checkCode=async()=>{try{const code=await this.getDeployedCode();if(code!=null){return resolve(this)}provider.once("block",checkCode)}catch(error){reject(error)}};checkCode()})}deploymentTransaction(){return getInternal(this).deployTx}getFunction(key){if(typeof key!=="string"){key=key.format()}const func=buildWrappedMethod(this,key);return func}getEvent(key){if(typeof key!=="string"){key=key.format()}return buildWrappedEvent(this,key)}async queryTransaction(hash){throw new Error("@TODO")}async queryFilter(event,fromBlock,toBlock){if(fromBlock==null){fromBlock=0}if(toBlock==null){toBlock="latest"}const{addr,addrPromise}=getInternal(this);const address=addr?addr:await addrPromise;const{fragment,topics}=await getSubInfo(this,event);const filter={address:address,topics:topics,fromBlock:fromBlock,toBlock:toBlock};const provider=getProvider(this.runner);assert(provider,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"});return(await provider.getLogs(filter)).map(log=>{let foundFragment=fragment;if(foundFragment==null){try{foundFragment=this.interface.getEvent(log.topics[0])}catch(error){}}if(foundFragment){try{return new EventLog(log,this.interface,foundFragment)}catch(error){return new UndecodedEventLog(log,error)}}return new Log(log,provider)})}async on(event,listener){const sub=await getSub(this,"on",event);sub.listeners.push({listener:listener,once:false});sub.start();return this}async once(event,listener){const sub=await getSub(this,"once",event);sub.listeners.push({listener:listener,once:true});sub.start();return this}async emit(event,...args){return await emit(this,event,args,null)}async listenerCount(event){if(event){const sub=await hasSub(this,event);if(!sub){return 0}return sub.listeners.length}const{subs}=getInternal(this);let total=0;for(const{listeners}of subs.values()){total+=listeners.length}return total}async listeners(event){if(event){const sub=await hasSub(this,event);if(!sub){return[]}return sub.listeners.map(({listener})=>listener)}const{subs}=getInternal(this);let result=[];for(const{listeners}of subs.values()){result=result.concat(listeners.map(({listener})=>listener))}return result}async off(event,listener){const sub=await hasSub(this,event);if(!sub){return this}if(listener){const index=sub.listeners.map(({listener})=>listener).indexOf(listener);if(index>=0){sub.listeners.splice(index,1)}}if(listener==null||sub.listeners.length===0){sub.stop();getInternal(this).subs.delete(sub.tag)}return this}async removeAllListeners(event){if(event){const sub=await hasSub(this,event);if(!sub){return this}sub.stop();getInternal(this).subs.delete(sub.tag)}else{const{subs}=getInternal(this);for(const{tag,stop}of subs.values()){stop();subs.delete(tag)}}return this}async addListener(event,listener){return await this.on(event,listener)}async removeListener(event,listener){return await this.off(event,listener)}static buildClass(abi){class CustomContract extends BaseContract{constructor(address,runner=null){super(address,abi,runner)}}return CustomContract}static from(target,abi,runner){if(runner==null){runner=null}const contract=new this(target,abi,runner);return contract}}function _ContractBase(){return BaseContract}class Contract extends _ContractBase(){}class ContractFactory{interface;bytecode;runner;constructor(abi,bytecode,runner){const iface=Interface.from(abi);if(bytecode instanceof Uint8Array){bytecode=hexlify(getBytes(bytecode))}else{if(typeof bytecode==="object"){bytecode=bytecode.object}if(!bytecode.startsWith("0x")){bytecode="0x"+bytecode}bytecode=hexlify(getBytes(bytecode))}defineProperties(this,{bytecode:bytecode,interface:iface,runner:runner||null})}attach(target){return new BaseContract(target,this.interface,this.runner)}async getDeployTransaction(...args){let overrides={};const fragment=this.interface.deploy;if(fragment.inputs.length+1===args.length){overrides=await copyOverrides(args.pop())}if(fragment.inputs.length!==args.length){throw new Error("incorrect number of arguments to constructor")}const resolvedArgs=await resolveArgs(this.runner,fragment.inputs,args);const data=concat([this.bytecode,this.interface.encodeDeploy(resolvedArgs)]);return Object.assign({},overrides,{data:data})}async deploy(...args){const tx=await this.getDeployTransaction(...args);assert(this.runner&&typeof this.runner.sendTransaction==="function","factory runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const sentTx=await this.runner.sendTransaction(tx);const address=getCreateAddress(sentTx);return new BaseContract(address,this.interface,this.runner,sentTx)}connect(runner){return new ContractFactory(this.interface,this.bytecode,runner)}static fromSolidity(output,runner){assertArgument(output!=null,"bad compiler output","output",output);if(typeof output==="string"){output=JSON.parse(output)}const abi=output.abi;let bytecode="";if(output.bytecode){bytecode=output.bytecode}else if(output.evm&&output.evm.bytecode){bytecode=output.evm.bytecode}return new this(abi,bytecode,runner)}}function getIpfsLink(link){if(link.match(/^ipfs:\/\/ipfs\//i)){link=link.substring(12)}else if(link.match(/^ipfs:\/\//i)){link=link.substring(7)}else{assertArgument(false,"unsupported IPFS format","link",link)}return`https:/\/gateway.ipfs.io/ipfs/${link}`}class MulticoinProviderPlugin{name;constructor(name){defineProperties(this,{name:name})}connect(proivder){return this}supportsCoinType(coinType){return false}async encodeAddress(coinType,address){throw new Error("unsupported coin")}async decodeAddress(coinType,data){throw new Error("unsupported coin")}}const matcherIpfs=new RegExp("^(ipfs)://(.*)$","i");const matchers=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),matcherIpfs,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];class EnsResolver{provider;address;name;#supports2544;#resolver;constructor(provider,address,name){defineProperties(this,{provider:provider,address:address,name:name});this.#supports2544=null;this.#resolver=new Contract(address,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],provider)}async supportsWildcard(){if(this.#supports2544==null){this.#supports2544=(async()=>{try{return await this.#resolver.supportsInterface("0x9061b923")}catch(error){if(isError(error,"CALL_EXCEPTION")){return false}this.#supports2544=null;throw error}})()}return await this.#supports2544}async#fetch(funcName,params){params=(params||[]).slice();const iface=this.#resolver.interface;params.unshift(namehash(this.name));let fragment=null;if(await this.supportsWildcard()){fragment=iface.getFunction(funcName);assert(fragment,"missing fragment","UNKNOWN_ERROR",{info:{funcName:funcName}});params=[dnsEncode(this.name,255),iface.encodeFunctionData(fragment,params)];funcName="resolve(bytes,bytes)"}params.push({enableCcipRead:true});try{const result=await this.#resolver[funcName](...params);if(fragment){return iface.decodeFunctionResult(fragment,result)[0]}return result}catch(error){if(!isError(error,"CALL_EXCEPTION")){throw error}}return null}async getAddress(coinType){if(coinType==null){coinType=60}if(coinType===60){try{const result=await this.#fetch("addr(bytes32)");if(result==null||result===ZeroAddress){return null}return result}catch(error){if(isError(error,"CALL_EXCEPTION")){return null}throw error}}if(coinType>=0&&coinType<2147483648){let ethCoinType=coinType+2147483648;const data=await this.#fetch("addr(bytes32,uint)",[ethCoinType]);if(isHexString(data,20)){return getAddress(data)}}let coinPlugin=null;for(const plugin of this.provider.plugins){if(!(plugin instanceof MulticoinProviderPlugin)){continue}if(plugin.supportsCoinType(coinType)){coinPlugin=plugin;break}}if(coinPlugin==null){return null}const data=await this.#fetch("addr(bytes32,uint)",[coinType]);if(data==null||data==="0x"){return null}const address=await coinPlugin.decodeAddress(coinType,data);if(address!=null){return address}assert(false,`invalid coin data`,"UNSUPPORTED_OPERATION",{operation:`getAddress(${coinType})`,info:{coinType:coinType,data:data}})}async getText(key){const data=await this.#fetch("text(bytes32,string)",[key]);if(data==null||data==="0x"){return null}return data}async getContentHash(){const data=await this.#fetch("contenthash(bytes32)");if(data==null||data==="0x"){return null}const ipfs=data.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(ipfs){const scheme=ipfs[1]==="e3010170"?"ipfs":"ipns";const length=parseInt(ipfs[4],16);if(ipfs[5].length===length*2){return`${scheme}:/\/${encodeBase58("0x"+ipfs[2])}`}}const swarm=data.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(swarm&&swarm[1].length===64){return`bzz:/\/${swarm[1]}`}assert(false,`invalid or unsupported content hash data`,"UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:data}})}async getAvatar(){const avatar=await this._getAvatar();return avatar.url}async _getAvatar(){const linkage=[{type:"name",value:this.name}];try{const avatar=await this.getText("avatar");if(avatar==null){linkage.push({type:"!avatar",value:""});return{url:null,linkage:linkage}}linkage.push({type:"avatar",value:avatar});for(let i=0;i{if(allowNull&&array==null){return null}if(!Array.isArray(array)){throw new Error("not an array")}return array.map(i=>format(i))}}function object(format,altNames){return value=>{const result={};for(const key in format){let srcKey=key;if(altNames&&key in altNames&&!(srcKey in value)){for(const altKey of altNames[key]){if(altKey in value){srcKey=altKey;break}}}try{const nv=format[key](value[srcKey]);if(nv!==undefined){result[key]=nv}}catch(error){const message=error instanceof Error?error.message:"not-an-error";assert(false,`invalid value for value.${key} (${message})`,"BAD_DATA",{value:value})}}return result}}function formatBoolean(value){switch(value){case true:case"true":return true;case false:case"false":return false}assertArgument(false,`invalid boolean; ${JSON.stringify(value)}`,"value",value)}function formatData(value){assertArgument(isHexString(value,true),"invalid data","value",value);return value}function formatHash(value){assertArgument(isHexString(value,32),"invalid hash","value",value);return value}const _formatLog=object({address:getAddress,blockHash:formatHash,blockNumber:getNumber,data:formatData,index:getNumber,removed:allowNull(formatBoolean,false),topics:arrayOf(formatHash),transactionHash:formatHash,transactionIndex:getNumber},{index:["logIndex"]});function formatLog(value){return _formatLog(value)}const _formatBlock=object({hash:allowNull(formatHash),parentHash:formatHash,parentBeaconBlockRoot:allowNull(formatHash,null),number:getNumber,timestamp:getNumber,nonce:allowNull(formatData),difficulty:getBigInt,gasLimit:getBigInt,gasUsed:getBigInt,stateRoot:allowNull(formatHash,null),receiptsRoot:allowNull(formatHash,null),blobGasUsed:allowNull(getBigInt,null),excessBlobGas:allowNull(getBigInt,null),miner:allowNull(getAddress),prevRandao:allowNull(formatHash,null),extraData:formatData,baseFeePerGas:allowNull(getBigInt)},{prevRandao:["mixHash"]});function formatBlock(value){const result=_formatBlock(value);result.transactions=value.transactions.map(tx=>{if(typeof tx==="string"){return tx}return formatTransactionResponse(tx)});return result}const _formatReceiptLog=object({transactionIndex:getNumber,blockNumber:getNumber,transactionHash:formatHash,address:getAddress,topics:arrayOf(formatHash),data:formatData,index:getNumber,blockHash:formatHash},{index:["logIndex"]});function formatReceiptLog(value){return _formatReceiptLog(value)}const _formatTransactionReceipt=object({to:allowNull(getAddress,null),from:allowNull(getAddress,null),contractAddress:allowNull(getAddress,null),index:getNumber,root:allowNull(hexlify),gasUsed:getBigInt,blobGasUsed:allowNull(getBigInt,null),logsBloom:allowNull(formatData),blockHash:formatHash,hash:formatHash,logs:arrayOf(formatReceiptLog),blockNumber:getNumber,cumulativeGasUsed:getBigInt,effectiveGasPrice:allowNull(getBigInt),blobGasPrice:allowNull(getBigInt,null),status:allowNull(getNumber),type:allowNull(getNumber,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function formatTransactionReceipt(value){return _formatTransactionReceipt(value)}function formatTransactionResponse(value){if(value.to&&getBigInt(value.to)===BN_0){value.to="0x0000000000000000000000000000000000000000"}const result=object({hash:formatHash,index:allowNull(getNumber,undefined),type:value=>{if(value==="0x"||value==null){return 0}return getNumber(value)},accessList:allowNull(accessListify,null),blobVersionedHashes:allowNull(arrayOf(formatHash,true),null),authorizationList:allowNull(arrayOf(v=>{let sig;if(v.signature){sig=v.signature}else{let yParity=v.yParity;if(yParity==="0x1b"){yParity=0}else if(yParity==="0x1c"){yParity=1}sig=Object.assign({},v,{yParity:yParity})}return{address:getAddress(v.address),chainId:getBigInt(v.chainId),nonce:getBigInt(v.nonce),signature:Signature.from(sig)}},false),null),blockHash:allowNull(formatHash,null),blockNumber:allowNull(getNumber,null),transactionIndex:allowNull(getNumber,null),from:getAddress,gasPrice:allowNull(getBigInt),maxPriorityFeePerGas:allowNull(getBigInt),maxFeePerGas:allowNull(getBigInt),maxFeePerBlobGas:allowNull(getBigInt,null),gasLimit:getBigInt,to:allowNull(getAddress,null),value:getBigInt,nonce:getNumber,data:formatData,creates:allowNull(getAddress,null),chainId:allowNull(getBigInt,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(value);if(result.to==null&&result.creates==null){result.creates=getCreateAddress(result)}if((value.type===1||value.type===2)&&value.accessList==null){result.accessList=[]}if(value.signature){result.signature=Signature.from(value.signature)}else{result.signature=Signature.from(value)}if(result.chainId==null){const chainId=result.signature.legacyChainId;if(chainId!=null){result.chainId=chainId}}if(result.blockHash&&getBigInt(result.blockHash)===BN_0){result.blockHash=null}return result}const EnsAddress="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class NetworkPlugin{name;constructor(name){defineProperties(this,{name:name})}clone(){return new NetworkPlugin(this.name)}}class GasCostPlugin extends NetworkPlugin{effectiveBlock;txBase;txCreate;txDataZero;txDataNonzero;txAccessListStorageKey;txAccessListAddress;constructor(effectiveBlock,costs){if(effectiveBlock==null){effectiveBlock=0}super(`org.ethers.network.plugins.GasCost#${effectiveBlock||0}`);const props={effectiveBlock:effectiveBlock};function set(name,nullish){let value=(costs||{})[name];if(value==null){value=nullish}assertArgument(typeof value==="number",`invalud value for ${name}`,"costs",costs);props[name]=value}set("txBase",21e3);set("txCreate",32e3);set("txDataZero",4);set("txDataNonzero",16);set("txAccessListStorageKey",1900);set("txAccessListAddress",2400);defineProperties(this,props)}clone(){return new GasCostPlugin(this.effectiveBlock,this)}}class EnsPlugin extends NetworkPlugin{address;targetNetwork;constructor(address,targetNetwork){super("org.ethers.plugins.network.Ens");defineProperties(this,{address:address||EnsAddress,targetNetwork:targetNetwork==null?1:targetNetwork})}clone(){return new EnsPlugin(this.address,this.targetNetwork)}}class FeeDataNetworkPlugin extends NetworkPlugin{#feeDataFunc;get feeDataFunc(){return this.#feeDataFunc}constructor(feeDataFunc){super("org.ethers.plugins.network.FeeData");this.#feeDataFunc=feeDataFunc}async getFeeData(provider){return await this.#feeDataFunc(provider)}clone(){return new FeeDataNetworkPlugin(this.#feeDataFunc)}}class FetchUrlFeeDataNetworkPlugin extends NetworkPlugin{#url;#processFunc;get url(){return this.#url}get processFunc(){return this.#processFunc}constructor(url,processFunc){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");this.#url=url;this.#processFunc=processFunc}clone(){return this}}const Networks=new Map;class Network{#name;#chainId;#plugins;constructor(name,chainId){this.#name=name;this.#chainId=getBigInt(chainId);this.#plugins=new Map}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return this.#name}set name(value){this.#name=value}get chainId(){return this.#chainId}set chainId(value){this.#chainId=getBigInt(value,"chainId")}matches(other){if(other==null){return false}if(typeof other==="string"){try{return this.chainId===getBigInt(other)}catch(error){}return this.name===other}if(typeof other==="number"||typeof other==="bigint"){try{return this.chainId===getBigInt(other)}catch(error){}return false}if(typeof other==="object"){if(other.chainId!=null){try{return this.chainId===getBigInt(other.chainId)}catch(error){}return false}if(other.name!=null){return this.name===other.name}return false}return false}get plugins(){return Array.from(this.#plugins.values())}attachPlugin(plugin){if(this.#plugins.get(plugin.name)){throw new Error(`cannot replace existing plugin: ${plugin.name} `)}this.#plugins.set(plugin.name,plugin.clone());return this}getPlugin(name){return this.#plugins.get(name)||null}getPlugins(basename){return this.plugins.filter(p=>p.name.split("#")[0]===basename)}clone(){const clone=new Network(this.name,this.chainId);this.plugins.forEach(plugin=>{clone.attachPlugin(plugin.clone())});return clone}computeIntrinsicGas(tx){const costs=this.getPlugin("org.ethers.plugins.network.GasCost")||new GasCostPlugin;let gas=costs.txBase;if(tx.to==null){gas+=costs.txCreate}if(tx.data){for(let i=2;i9){let frac=BigInt(comps[1].substring(0,9));if(!comps[1].substring(9).match(/^0+$/)){frac++}comps[1]=frac.toString()}return BigInt(comps[0]+comps[1])}function getGasStationPlugin(url){return new FetchUrlFeeDataNetworkPlugin(url,async(fetchFeeData,provider,request)=>{request.setHeader("User-Agent","ethers");let response;try{const[_response,_feeData]=await Promise.all([request.send(),fetchFeeData()]);response=_response;const payload=response.bodyJson.standard;const feeData={gasPrice:_feeData.gasPrice,maxFeePerGas:parseUnits(payload.maxFee,9),maxPriorityFeePerGas:parseUnits(payload.maxPriorityFee,9)};return feeData}catch(error){assert(false,`error encountered with polygon gas station (${JSON.stringify(request.url)})`,"SERVER_ERROR",{request:request,response:response,error:error})}})}let injected=false;function injectCommonNetworks(){if(injected){return}injected=true;function registerEth(name,chainId,options){const func=function(){const network=new Network(name,chainId);if(options.ensNetwork!=null){network.attachPlugin(new EnsPlugin(null,options.ensNetwork))}network.attachPlugin(new GasCostPlugin);(options.plugins||[]).forEach(plugin=>{network.attachPlugin(plugin)});return network};Network.register(name,func);Network.register(chainId,func);if(options.altNames){options.altNames.forEach(name=>{Network.register(name,func)})}}registerEth("mainnet",1,{ensNetwork:1,altNames:["homestead"]});registerEth("ropsten",3,{ensNetwork:3});registerEth("rinkeby",4,{ensNetwork:4});registerEth("goerli",5,{ensNetwork:5});registerEth("kovan",42,{ensNetwork:42});registerEth("sepolia",11155111,{ensNetwork:11155111});registerEth("holesky",17e3,{ensNetwork:17e3});registerEth("classic",61,{});registerEth("classicKotti",6,{});registerEth("arbitrum",42161,{ensNetwork:1});registerEth("arbitrum-goerli",421613,{});registerEth("arbitrum-sepolia",421614,{});registerEth("base",8453,{ensNetwork:1});registerEth("base-goerli",84531,{});registerEth("base-sepolia",84532,{});registerEth("bnb",56,{ensNetwork:1});registerEth("bnbt",97,{});registerEth("filecoin",314,{});registerEth("filecoin-calibration",314159,{});registerEth("linea",59144,{ensNetwork:1});registerEth("linea-goerli",59140,{});registerEth("linea-sepolia",59141,{});registerEth("matic",137,{ensNetwork:1,plugins:[getGasStationPlugin("https://gasstation.polygon.technology/v2")]});registerEth("matic-amoy",80002,{});registerEth("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[getGasStationPlugin("https://gasstation-testnet.polygon.technology/v2")]});registerEth("optimism",10,{ensNetwork:1,plugins:[]});registerEth("optimism-goerli",420,{});registerEth("optimism-sepolia",11155420,{});registerEth("xdai",100,{ensNetwork:1})}function copy$2(obj){return JSON.parse(JSON.stringify(obj))}class PollingBlockSubscriber{#provider;#poller;#interval;#blockNumber;constructor(provider){this.#provider=provider;this.#poller=null;this.#interval=4e3;this.#blockNumber=-2}get pollingInterval(){return this.#interval}set pollingInterval(value){this.#interval=value}async#poll(){try{const blockNumber=await this.#provider.getBlockNumber();if(this.#blockNumber===-2){this.#blockNumber=blockNumber;return}if(blockNumber!==this.#blockNumber){for(let b=this.#blockNumber+1;b<=blockNumber;b++){if(this.#poller==null){return}await this.#provider.emit("block",b)}this.#blockNumber=blockNumber}}catch(error){}if(this.#poller==null){return}this.#poller=this.#provider._setTimeout(this.#poll.bind(this),this.#interval)}start(){if(this.#poller){return}this.#poller=this.#provider._setTimeout(this.#poll.bind(this),this.#interval);this.#poll()}stop(){if(!this.#poller){return}this.#provider._clearTimeout(this.#poller);this.#poller=null}pause(dropWhilePaused){this.stop();if(dropWhilePaused){this.#blockNumber=-2}}resume(){this.start()}}class OnBlockSubscriber{#provider;#poll;#running;constructor(provider){this.#provider=provider;this.#running=false;this.#poll=blockNumber=>{this._poll(blockNumber,this.#provider)}}async _poll(blockNumber,provider){throw new Error("sub-classes must override this")}start(){if(this.#running){return}this.#running=true;this.#poll(-2);this.#provider.on("block",this.#poll)}stop(){if(!this.#running){return}this.#running=false;this.#provider.off("block",this.#poll)}pause(dropWhilePaused){this.stop()}resume(){this.start()}}class PollingBlockTagSubscriber extends OnBlockSubscriber{#tag;#lastBlock;constructor(provider,tag){super(provider);this.#tag=tag;this.#lastBlock=-2}pause(dropWhilePaused){if(dropWhilePaused){this.#lastBlock=-2}super.pause(dropWhilePaused)}async _poll(blockNumber,provider){const block=await provider.getBlock(this.#tag);if(block==null){return}if(this.#lastBlock===-2){this.#lastBlock=block.number}else if(block.number>this.#lastBlock){provider.emit(this.#tag,block.number);this.#lastBlock=block.number}}}class PollingOrphanSubscriber extends OnBlockSubscriber{#filter;constructor(provider,filter){super(provider);this.#filter=copy$2(filter)}async _poll(blockNumber,provider){throw new Error("@TODO")}}class PollingTransactionSubscriber extends OnBlockSubscriber{#hash;constructor(provider,hash){super(provider);this.#hash=hash}async _poll(blockNumber,provider){const tx=await provider.getTransactionReceipt(this.#hash);if(tx){provider.emit(this.#hash,tx)}}}class PollingEventSubscriber{#provider;#filter;#poller;#running;#blockNumber;constructor(provider,filter){this.#provider=provider;this.#filter=copy$2(filter);this.#poller=this.#poll.bind(this);this.#running=false;this.#blockNumber=-2}async#poll(blockNumber){if(this.#blockNumber===-2){return}const filter=copy$2(this.#filter);filter.fromBlock=this.#blockNumber+1;filter.toBlock=blockNumber;const logs=await this.#provider.getLogs(filter);if(logs.length===0){if(this.#blockNumber{this.#blockNumber=blockNumber})}this.#provider.on("block",this.#poller)}stop(){if(!this.#running){return}this.#running=false;this.#provider.off("block",this.#poller)}pause(dropWhilePaused){this.stop();if(dropWhilePaused){this.#blockNumber=-2}}resume(){this.start()}}const BN_2$1=BigInt(2);const MAX_CCIP_REDIRECTS=10;function isPromise$1(value){return value&&typeof value.then==="function"}function getTag(prefix,value){return prefix+":"+JSON.stringify(value,(k,v)=>{if(v==null){return"null"}if(typeof v==="bigint"){return`bigint:${v.toString()}`}if(typeof v==="string"){return v.toLowerCase()}if(typeof v==="object"&&!Array.isArray(v)){const keys=Object.keys(v);keys.sort();return keys.reduce((accum,key)=>{accum[key]=v[key];return accum},{})}return v})}class UnmanagedSubscriber{name;constructor(name){defineProperties(this,{name:name})}start(){}stop(){}pause(dropWhilePaused){}resume(){}}function copy$1(value){return JSON.parse(JSON.stringify(value))}function concisify(items){items=Array.from(new Set(items).values());items.sort();return items}async function getSubscription(_event,provider){if(_event==null){throw new Error("invalid event")}if(Array.isArray(_event)){_event={topics:_event}}if(typeof _event==="string"){switch(_event){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":{return{type:_event,tag:_event}}}}if(isHexString(_event,32)){const hash=_event.toLowerCase();return{type:"transaction",tag:getTag("tx",{hash:hash}),hash:hash}}if(_event.orphan){const event=_event;return{type:"orphan",tag:getTag("orphan",event),filter:copy$1(event)}}if(_event.address||_event.topics){const event=_event;const filter={topics:(event.topics||[]).map(t=>{if(t==null){return null}if(Array.isArray(t)){return concisify(t.map(t=>t.toLowerCase()))}return t.toLowerCase()})};if(event.address){const addresses=[];const promises=[];const addAddress=addr=>{if(isHexString(addr)){addresses.push(addr)}else{promises.push((async()=>{addresses.push(await resolveAddress(addr,provider))})())}};if(Array.isArray(event.address)){event.address.forEach(addAddress)}else{addAddress(event.address)}if(promises.length){await Promise.all(promises)}filter.address=concisify(addresses.map(a=>a.toLowerCase()))}return{filter:filter,tag:getTag("event",filter),type:"event"}}assertArgument(false,"unknown ProviderEvent","event",_event)}function getTime$1(){return(new Date).getTime()}const defaultOptions$1={cacheTimeout:250,pollingInterval:4e3};class AbstractProvider{#subs;#plugins;#pausedState;#destroyed;#networkPromise;#anyNetwork;#performCache;#lastBlockNumber;#nextTimer;#timers;#disableCcipRead;#options;constructor(_network,options){this.#options=Object.assign({},defaultOptions$1,options||{});if(_network==="any"){this.#anyNetwork=true;this.#networkPromise=null}else if(_network){const network=Network.from(_network);this.#anyNetwork=false;this.#networkPromise=Promise.resolve(network);setTimeout(()=>{this.emit("network",network,null)},0)}else{this.#anyNetwork=false;this.#networkPromise=null}this.#lastBlockNumber=-1;this.#performCache=new Map;this.#subs=new Map;this.#plugins=new Map;this.#pausedState=null;this.#destroyed=false;this.#nextTimer=1;this.#timers=new Map;this.#disableCcipRead=false}get pollingInterval(){return this.#options.pollingInterval}get provider(){return this}get plugins(){return Array.from(this.#plugins.values())}attachPlugin(plugin){if(this.#plugins.get(plugin.name)){throw new Error(`cannot replace existing plugin: ${plugin.name} `)}this.#plugins.set(plugin.name,plugin.connect(this));return this}getPlugin(name){return this.#plugins.get(name)||null}get disableCcipRead(){return this.#disableCcipRead}set disableCcipRead(value){this.#disableCcipRead=!!value}async#perform(req){const timeout=this.#options.cacheTimeout;if(timeout<0){return await this._perform(req)}const tag=getTag(req.method,req);let perform=this.#performCache.get(tag);if(!perform){perform=this._perform(req);this.#performCache.set(tag,perform);setTimeout(()=>{if(this.#performCache.get(tag)===perform){this.#performCache.delete(tag)}},timeout)}return await perform}async ccipReadFetch(tx,calldata,urls){if(this.disableCcipRead||urls.length===0||tx.to==null){return null}const sender=tx.to.toLowerCase();const data=calldata.toLowerCase();const errorMessages=[];for(let i=0;i=500,`response not found during CCIP fetch: ${errorMessage}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:tx,info:{url:url,errorMessage:errorMessage}});errorMessages.push(errorMessage)}assert(false,`error encountered during CCIP fetch: ${errorMessages.map(m=>JSON.stringify(m)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:tx,info:{urls:urls,errorMessages:errorMessages}})}_wrapBlock(value,network){return new Block(formatBlock(value),this)}_wrapLog(value,network){return new Log(formatLog(value),this)}_wrapTransactionReceipt(value,network){return new TransactionReceipt(formatTransactionReceipt(value),this)}_wrapTransactionResponse(tx,network){return new TransactionResponse(formatTransactionResponse(tx),this)}_detectNetwork(){assert(false,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(req){assert(false,`unsupported method: ${req.method}`,"UNSUPPORTED_OPERATION",{operation:req.method,info:req})}async getBlockNumber(){const blockNumber=getNumber(await this.#perform({method:"getBlockNumber"}),"%response");if(this.#lastBlockNumber>=0){this.#lastBlockNumber=blockNumber}return blockNumber}_getAddress(address){return resolveAddress(address,this)}_getBlockTag(blockTag){if(blockTag==null){return"latest"}switch(blockTag){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return blockTag}if(isHexString(blockTag)){if(isHexString(blockTag,32)){return blockTag}return toQuantity(blockTag)}if(typeof blockTag==="bigint"){blockTag=getNumber(blockTag,"blockTag")}if(typeof blockTag==="number"){if(blockTag>=0){return toQuantity(blockTag)}if(this.#lastBlockNumber>=0){return toQuantity(this.#lastBlockNumber+blockTag)}return this.getBlockNumber().then(b=>toQuantity(b+blockTag))}assertArgument(false,"invalid blockTag","blockTag",blockTag)}_getFilter(filter){const topics=(filter.topics||[]).map(t=>{if(t==null){return null}if(Array.isArray(t)){return concisify(t.map(t=>t.toLowerCase()))}return t.toLowerCase()});const blockHash="blockHash"in filter?filter.blockHash:undefined;const resolve=(_address,fromBlock,toBlock)=>{let address=undefined;switch(_address.length){case 0:break;case 1:address=_address[0];break;default:_address.sort();address=_address}if(blockHash){if(fromBlock!=null||toBlock!=null){throw new Error("invalid filter")}}const filter={};if(address){filter.address=address}if(topics.length){filter.topics=topics}if(fromBlock){filter.fromBlock=fromBlock}if(toBlock){filter.toBlock=toBlock}if(blockHash){filter.blockHash=blockHash}return filter};let address=[];if(filter.address){if(Array.isArray(filter.address)){for(const addr of filter.address){address.push(this._getAddress(addr))}}else{address.push(this._getAddress(filter.address))}}let fromBlock=undefined;if("fromBlock"in filter){fromBlock=this._getBlockTag(filter.fromBlock)}let toBlock=undefined;if("toBlock"in filter){toBlock=this._getBlockTag(filter.toBlock)}if(address.filter(a=>typeof a!=="string").length||fromBlock!=null&&typeof fromBlock!=="string"||toBlock!=null&&typeof toBlock!=="string"){return Promise.all([Promise.all(address),fromBlock,toBlock]).then(result=>{return resolve(result[0],result[1],result[2])})}return resolve(address,fromBlock,toBlock)}_getTransactionRequest(_request){const request=copyRequest(_request);const promises=[];["to","from"].forEach(key=>{if(request[key]==null){return}const addr=resolveAddress(request[key],this);if(isPromise$1(addr)){promises.push(async function(){request[key]=await addr}())}else{request[key]=addr}});if(request.blockTag!=null){const blockTag=this._getBlockTag(request.blockTag);if(isPromise$1(blockTag)){promises.push(async function(){request.blockTag=await blockTag}())}else{request.blockTag=blockTag}}if(promises.length){return async function(){await Promise.all(promises);return request}()}return request}async getNetwork(){if(this.#networkPromise==null){const detectNetwork=(async()=>{try{const network=await this._detectNetwork();this.emit("network",network,null);return network}catch(error){if(this.#networkPromise===detectNetwork){this.#networkPromise=null}throw error}})();this.#networkPromise=detectNetwork;return(await detectNetwork).clone()}const networkPromise=this.#networkPromise;const[expected,actual]=await Promise.all([networkPromise,this._detectNetwork()]);if(expected.chainId!==actual.chainId){if(this.#anyNetwork){this.emit("network",actual,expected);if(this.#networkPromise===networkPromise){this.#networkPromise=Promise.resolve(actual)}}else{assert(false,`network changed: ${expected.chainId} => ${actual.chainId} `,"NETWORK_ERROR",{event:"changed"})}}return expected.clone()}async getFeeData(){const network=await this.getNetwork();const getFeeDataFunc=async()=>{const{_block,gasPrice,priorityFee}=await resolveProperties({_block:this.#getBlock("latest",false),gasPrice:(async()=>{try{const value=await this.#perform({method:"getGasPrice"});return getBigInt(value,"%response")}catch(error){}return null})(),priorityFee:(async()=>{try{const value=await this.#perform({method:"getPriorityFee"});return getBigInt(value,"%response")}catch(error){}return null})()});let maxFeePerGas=null;let maxPriorityFeePerGas=null;const block=this._wrapBlock(_block,network);if(block&&block.baseFeePerGas){maxPriorityFeePerGas=priorityFee!=null?priorityFee:BigInt("1000000000");maxFeePerGas=block.baseFeePerGas*BN_2$1+maxPriorityFeePerGas}return new FeeData(gasPrice,maxFeePerGas,maxPriorityFeePerGas)};const plugin=network.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(plugin){const req=new FetchRequest(plugin.url);const feeData=await plugin.processFunc(getFeeDataFunc,this,req);return new FeeData(feeData.gasPrice,feeData.maxFeePerGas,feeData.maxPriorityFeePerGas)}return await getFeeDataFunc()}async estimateGas(_tx){let tx=this._getTransactionRequest(_tx);if(isPromise$1(tx)){tx=await tx}return getBigInt(await this.#perform({method:"estimateGas",transaction:tx}),"%response")}async#call(tx,blockTag,attempt){assert(attempt=0&&blockTag==="latest"&&transaction.to!=null&&dataSlice(error.data,0,4)==="0x556f1830"){const data=error.data;const txSender=await resolveAddress(transaction.to,this);let ccipArgs;try{ccipArgs=parseOffchainLookup(dataSlice(error.data,4))}catch(error){assert(false,error.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:transaction,info:{data:data}})}assert(ccipArgs.sender.toLowerCase()===txSender.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:data,reason:"OffchainLookup",transaction:transaction,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:ccipArgs.errorArgs}});const ccipResult=await this.ccipReadFetch(transaction,ccipArgs.calldata,ccipArgs.urls);assert(ccipResult!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:transaction,info:{data:error.data,errorArgs:ccipArgs.errorArgs}});const tx={to:txSender,data:concat([ccipArgs.selector,encodeBytes([ccipResult,ccipArgs.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:tx});try{const result=await this.#call(tx,blockTag,attempt+1);this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},tx),result:result});return result}catch(error){this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},tx),error:error});throw error}}throw error}}async#checkNetwork(promise){const{value}=await resolveProperties({network:this.getNetwork(),value:promise});return value}async call(_tx){const{tx,blockTag}=await resolveProperties({tx:this._getTransactionRequest(_tx),blockTag:this._getBlockTag(_tx.blockTag)});return await this.#checkNetwork(this.#call(tx,blockTag,_tx.enableCcipRead?0:-1))}async#getAccountValue(request,_address,_blockTag){let address=this._getAddress(_address);let blockTag=this._getBlockTag(_blockTag);if(typeof address!=="string"||typeof blockTag!=="string"){[address,blockTag]=await Promise.all([address,blockTag])}return await this.#checkNetwork(this.#perform(Object.assign(request,{address:address,blockTag:blockTag})))}async getBalance(address,blockTag){return getBigInt(await this.#getAccountValue({method:"getBalance"},address,blockTag),"%response")}async getTransactionCount(address,blockTag){return getNumber(await this.#getAccountValue({method:"getTransactionCount"},address,blockTag),"%response")}async getCode(address,blockTag){return hexlify(await this.#getAccountValue({method:"getCode"},address,blockTag))}async getStorage(address,_position,blockTag){const position=getBigInt(_position,"position");return hexlify(await this.#getAccountValue({method:"getStorage",position:position},address,blockTag))}async broadcastTransaction(signedTx){const{blockNumber,hash,network}=await resolveProperties({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:signedTx}),network:this.getNetwork()});const tx=Transaction.from(signedTx);if(tx.hash!==hash){throw new Error("@TODO: the returned hash did not match")}return this._wrapTransactionResponse(tx,network).replaceableTransaction(blockNumber)}async#getBlock(block,includeTransactions){if(isHexString(block,32)){return await this.#perform({method:"getBlock",blockHash:block,includeTransactions:includeTransactions})}let blockTag=this._getBlockTag(block);if(typeof blockTag!=="string"){blockTag=await blockTag}return await this.#perform({method:"getBlock",blockTag:blockTag,includeTransactions:includeTransactions})}async getBlock(block,prefetchTxs){const{network,params}=await resolveProperties({network:this.getNetwork(),params:this.#getBlock(block,!!prefetchTxs)});if(params==null){return null}return this._wrapBlock(params,network)}async getTransaction(hash){const{network,params}=await resolveProperties({network:this.getNetwork(),params:this.#perform({method:"getTransaction",hash:hash})});if(params==null){return null}return this._wrapTransactionResponse(params,network)}async getTransactionReceipt(hash){const{network,params}=await resolveProperties({network:this.getNetwork(),params:this.#perform({method:"getTransactionReceipt",hash:hash})});if(params==null){return null}if(params.gasPrice==null&¶ms.effectiveGasPrice==null){const tx=await this.#perform({method:"getTransaction",hash:hash});if(tx==null){throw new Error("report this; could not find tx or effectiveGasPrice")}params.effectiveGasPrice=tx.gasPrice}return this._wrapTransactionReceipt(params,network)}async getTransactionResult(hash){const{result}=await resolveProperties({network:this.getNetwork(),result:this.#perform({method:"getTransactionResult",hash:hash})});if(result==null){return null}return hexlify(result)}async getLogs(_filter){let filter=this._getFilter(_filter);if(isPromise$1(filter)){filter=await filter}const{network,params}=await resolveProperties({network:this.getNetwork(),params:this.#perform({method:"getLogs",filter:filter})});return params.map(p=>this._wrapLog(p,network))}_getProvider(chainId){assert(false,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(name){return await EnsResolver.fromName(this,name)}async getAvatar(name){const resolver=await this.getResolver(name);if(resolver){return await resolver.getAvatar()}return null}async resolveName(name){const resolver=await this.getResolver(name);if(resolver){return await resolver.getAddress()}return null}async lookupAddress(address){address=getAddress(address);const node=namehash(address.substring(2).toLowerCase()+".addr.reverse");try{const ensAddr=await EnsResolver.getEnsAddress(this);const ensContract=new Contract(ensAddr,["function resolver(bytes32) view returns (address)"],this);const resolver=await ensContract.resolver(node);if(resolver==null||resolver===ZeroAddress){return null}const resolverContract=new Contract(resolver,["function name(bytes32) view returns (string)"],this);const name=await resolverContract.name(node);const check=await this.resolveName(name);if(check!==address){return null}return name}catch(error){if(isError(error,"BAD_DATA")&&error.value==="0x"){return null}if(isError(error,"CALL_EXCEPTION")){return null}throw error}return null}async waitForTransaction(hash,_confirms,timeout){const confirms=_confirms!=null?_confirms:1;if(confirms===0){return this.getTransactionReceipt(hash)}return new Promise(async(resolve,reject)=>{let timer=null;const listener=async blockNumber=>{try{const receipt=await this.getTransactionReceipt(hash);if(receipt!=null){if(blockNumber-receipt.blockNumber+1>=confirms){resolve(receipt);if(timer){clearTimeout(timer);timer=null}return}}}catch(error){console.log("EEE",error)}this.once("block",listener)};if(timeout!=null){timer=setTimeout(()=>{if(timer==null){return}timer=null;this.off("block",listener);reject(makeError("timeout","TIMEOUT",{reason:"timeout"}))},timeout)}listener(await this.getBlockNumber())})}async waitForBlock(blockTag){assert(false,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(timerId){const timer=this.#timers.get(timerId);if(!timer){return}if(timer.timer){clearTimeout(timer.timer)}this.#timers.delete(timerId)}_setTimeout(_func,timeout){if(timeout==null){timeout=0}const timerId=this.#nextTimer++;const func=()=>{this.#timers.delete(timerId);_func()};if(this.paused){this.#timers.set(timerId,{timer:null,func:func,time:timeout})}else{const timer=setTimeout(func,timeout);this.#timers.set(timerId,{timer:timer,func:func,time:getTime$1()})}return timerId}_forEachSubscriber(func){for(const sub of this.#subs.values()){func(sub.subscriber)}}_getSubscriber(sub){switch(sub.type){case"debug":case"error":case"network":return new UnmanagedSubscriber(sub.type);case"block":{const subscriber=new PollingBlockSubscriber(this);subscriber.pollingInterval=this.pollingInterval;return subscriber}case"safe":case"finalized":return new PollingBlockTagSubscriber(this,sub.type);case"event":return new PollingEventSubscriber(this,sub.filter);case"transaction":return new PollingTransactionSubscriber(this,sub.hash);case"orphan":return new PollingOrphanSubscriber(this,sub.filter)}throw new Error(`unsupported event: ${sub.type}`)}_recoverSubscriber(oldSub,newSub){for(const sub of this.#subs.values()){if(sub.subscriber===oldSub){if(sub.started){sub.subscriber.stop()}sub.subscriber=newSub;if(sub.started){newSub.start()}if(this.#pausedState!=null){newSub.pause(this.#pausedState)}break}}}async#hasSub(event,emitArgs){let sub=await getSubscription(event,this);if(sub.type==="event"&&emitArgs&&emitArgs.length>0&&emitArgs[0].removed===true){sub=await getSubscription({orphan:"drop-log",log:emitArgs[0]},this)}return this.#subs.get(sub.tag)||null}async#getSub(event){const subscription=await getSubscription(event,this);const tag=subscription.tag;let sub=this.#subs.get(tag);if(!sub){const subscriber=this._getSubscriber(subscription);const addressableMap=new WeakMap;const nameMap=new Map;sub={subscriber:subscriber,tag:tag,addressableMap:addressableMap,nameMap:nameMap,started:false,listeners:[]};this.#subs.set(tag,sub)}return sub}async on(event,listener){const sub=await this.#getSub(event);sub.listeners.push({listener:listener,once:false});if(!sub.started){sub.subscriber.start();sub.started=true;if(this.#pausedState!=null){sub.subscriber.pause(this.#pausedState)}}return this}async once(event,listener){const sub=await this.#getSub(event);sub.listeners.push({listener:listener,once:true});if(!sub.started){sub.subscriber.start();sub.started=true;if(this.#pausedState!=null){sub.subscriber.pause(this.#pausedState)}}return this}async emit(event,...args){const sub=await this.#hasSub(event,args);if(!sub||sub.listeners.length===0){return false}const count=sub.listeners.length;sub.listeners=sub.listeners.filter(({listener,once})=>{const payload=new EventPayload(this,once?null:listener,event);try{listener.call(this,...args,payload)}catch(error){}return!once});if(sub.listeners.length===0){if(sub.started){sub.subscriber.stop()}this.#subs.delete(sub.tag)}return count>0}async listenerCount(event){if(event){const sub=await this.#hasSub(event);if(!sub){return 0}return sub.listeners.length}let total=0;for(const{listeners}of this.#subs.values()){total+=listeners.length}return total}async listeners(event){if(event){const sub=await this.#hasSub(event);if(!sub){return[]}return sub.listeners.map(({listener})=>listener)}let result=[];for(const{listeners}of this.#subs.values()){result=result.concat(listeners.map(({listener})=>listener))}return result}async off(event,listener){const sub=await this.#hasSub(event);if(!sub){return this}if(listener){const index=sub.listeners.map(({listener})=>listener).indexOf(listener);if(index>=0){sub.listeners.splice(index,1)}}if(!listener||sub.listeners.length===0){if(sub.started){sub.subscriber.stop()}this.#subs.delete(sub.tag)}return this}async removeAllListeners(event){if(event){const{tag,started,subscriber}=await this.#getSub(event);if(started){subscriber.stop()}this.#subs.delete(tag)}else{for(const[tag,{started,subscriber}]of this.#subs){if(started){subscriber.stop()}this.#subs.delete(tag)}}return this}async addListener(event,listener){return await this.on(event,listener)}async removeListener(event,listener){return this.off(event,listener)}get destroyed(){return this.#destroyed}destroy(){this.removeAllListeners();for(const timerId of this.#timers.keys()){this._clearTimeout(timerId)}this.#destroyed=true}get paused(){return this.#pausedState!=null}set paused(pause){if(!!pause===this.paused){return}if(this.paused){this.resume()}else{this.pause(false)}}pause(dropWhilePaused){this.#lastBlockNumber=-1;if(this.#pausedState!=null){if(this.#pausedState==!!dropWhilePaused){return}assert(false,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(s=>s.pause(dropWhilePaused));this.#pausedState=!!dropWhilePaused;for(const timer of this.#timers.values()){if(timer.timer){clearTimeout(timer.timer)}timer.time=getTime$1()-timer.time}}resume(){if(this.#pausedState==null){return}this._forEachSubscriber(s=>s.resume());this.#pausedState=null;for(const timer of this.#timers.values()){let timeout=timer.time;if(timeout<0){timeout=0}timer.time=getTime$1();setTimeout(timer.func,timeout)}}}function _parseString(result,start){try{const bytes=_parseBytes(result,start);if(bytes){return toUtf8String(bytes)}}catch(error){}return null}function _parseBytes(result,start){if(result==="0x"){return null}try{const offset=getNumber(dataSlice(result,start,start+32));const length=getNumber(dataSlice(result,offset,offset+32));return dataSlice(result,offset+32,offset+32+length)}catch(error){}return null}function numPad(value){const result=toBeArray(value);if(result.length>32){throw new Error("internal; should not happen")}const padded=new Uint8Array(32);padded.set(result,32-result.length);return padded}function bytesPad(value){if(value.length%32===0){return value}const result=new Uint8Array(Math.ceil(value.length/32)*32);result.set(value);return result}const empty=new Uint8Array([]);function encodeBytes(datas){const result=[];let byteCount=0;for(let i=0;i=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const sender=dataSlice(data,0,32);assert(dataSlice(sender,0,12)===dataSlice(zeros,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"});result.sender=dataSlice(sender,12);try{const urls=[];const urlsOffset=getNumber(dataSlice(data,32,64));const urlsLength=getNumber(dataSlice(data,urlsOffset,urlsOffset+32));const urlsData=dataSlice(data,urlsOffset+32);for(let u=0;uresult[k]);return result}function checkProvider(signer,operation){if(signer.provider){return signer.provider}assert(false,"missing provider","UNSUPPORTED_OPERATION",{operation:operation})}async function populate(signer,tx){let pop=copyRequest(tx);if(pop.to!=null){pop.to=resolveAddress(pop.to,signer)}if(pop.from!=null){const from=pop.from;pop.from=Promise.all([signer.getAddress(),resolveAddress(from,signer)]).then(([address,from])=>{assertArgument(address.toLowerCase()===from.toLowerCase(),"transaction from mismatch","tx.from",from);return address})}else{pop.from=signer.getAddress()}return await resolveProperties(pop)}class AbstractSigner{provider;constructor(provider){defineProperties(this,{provider:provider||null})}async getNonce(blockTag){return checkProvider(this,"getTransactionCount").getTransactionCount(await this.getAddress(),blockTag)}async populateCall(tx){const pop=await populate(this,tx);return pop}async populateTransaction(tx){const provider=checkProvider(this,"populateTransaction");const pop=await populate(this,tx);if(pop.nonce==null){pop.nonce=await this.getNonce("pending")}if(pop.gasLimit==null){pop.gasLimit=await this.estimateGas(pop)}const network=await this.provider.getNetwork();if(pop.chainId!=null){const chainId=getBigInt(pop.chainId);assertArgument(chainId===network.chainId,"transaction chainId mismatch","tx.chainId",tx.chainId)}else{pop.chainId=network.chainId}const hasEip1559=pop.maxFeePerGas!=null||pop.maxPriorityFeePerGas!=null;if(pop.gasPrice!=null&&(pop.type===2||hasEip1559)){assertArgument(false,"eip-1559 transaction do not support gasPrice","tx",tx)}else if((pop.type===0||pop.type===1)&&hasEip1559){assertArgument(false,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",tx)}if((pop.type===2||pop.type==null)&&(pop.maxFeePerGas!=null&&pop.maxPriorityFeePerGas!=null)){pop.type=2}else if(pop.type===0||pop.type===1){const feeData=await provider.getFeeData();assert(feeData.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"});if(pop.gasPrice==null){pop.gasPrice=feeData.gasPrice}}else{const feeData=await provider.getFeeData();if(pop.type==null){if(feeData.maxFeePerGas!=null&&feeData.maxPriorityFeePerGas!=null){if(pop.authorizationList&&pop.authorizationList.length){pop.type=4}else{pop.type=2}if(pop.gasPrice!=null){const gasPrice=pop.gasPrice;delete pop.gasPrice;pop.maxFeePerGas=gasPrice;pop.maxPriorityFeePerGas=gasPrice}else{if(pop.maxFeePerGas==null){pop.maxFeePerGas=feeData.maxFeePerGas}if(pop.maxPriorityFeePerGas==null){pop.maxPriorityFeePerGas=feeData.maxPriorityFeePerGas}}}else if(feeData.gasPrice!=null){assert(!hasEip1559,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"});if(pop.gasPrice==null){pop.gasPrice=feeData.gasPrice}pop.type=0}else{assert(false,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"})}}else if(pop.type===2||pop.type===3||pop.type===4){if(pop.maxFeePerGas==null){pop.maxFeePerGas=feeData.maxFeePerGas}if(pop.maxPriorityFeePerGas==null){pop.maxPriorityFeePerGas=feeData.maxPriorityFeePerGas}}}return await resolveProperties(pop)}async populateAuthorization(_auth){const auth=Object.assign({},_auth);if(auth.chainId==null){auth.chainId=(await checkProvider(this,"getNetwork").getNetwork()).chainId}if(auth.nonce==null){auth.nonce=await this.getNonce()}return auth}async estimateGas(tx){return checkProvider(this,"estimateGas").estimateGas(await this.populateCall(tx))}async call(tx){return checkProvider(this,"call").call(await this.populateCall(tx))}async resolveName(name){const provider=checkProvider(this,"resolveName");return await provider.resolveName(name)}async sendTransaction(tx){const provider=checkProvider(this,"sendTransaction");const pop=await this.populateTransaction(tx);delete pop.from;const txObj=Transaction.from(pop);return await provider.broadcastTransaction(await this.signTransaction(txObj))}authorize(authorization){assert(false,"authorization not implemented for this signer","UNSUPPORTED_OPERATION",{operation:"authorize"})}}class VoidSigner extends AbstractSigner{address;constructor(address,provider){super(provider);defineProperties(this,{address:address})}async getAddress(){return this.address}connect(provider){return new VoidSigner(this.address,provider)}#throwUnsupported(suffix,operation){assert(false,`VoidSigner cannot sign ${suffix}`,"UNSUPPORTED_OPERATION",{operation:operation})}async signTransaction(tx){this.#throwUnsupported("transactions","signTransaction")}async signMessage(message){this.#throwUnsupported("messages","signMessage")}async signTypedData(domain,types,value){this.#throwUnsupported("typed-data","signTypedData")}}const shown=new Set;function showThrottleMessage(service){if(shown.has(service)){return}shown.add(service);console.log("========= NOTICE =========");console.log(`Request-Rate Exceeded for ${service} (this message will not be repeated)`);console.log("");console.log("The default API keys for each service are provided as a highly-throttled,");console.log("community resource for low-traffic projects and early prototyping.");console.log("");console.log("While your application will continue to function, we highly recommended");console.log("signing up for your own API keys to improve performance, increase your");console.log("request rate/limit and enable other perks, such as metrics and advanced APIs.");console.log("");console.log("For more details: https://docs.ethers.org/api-keys/");console.log("==========================")}function copy(obj){return JSON.parse(JSON.stringify(obj))}class FilterIdSubscriber{#provider;#filterIdPromise;#poller;#running;#network;#hault;constructor(provider){this.#provider=provider;this.#filterIdPromise=null;this.#poller=this.#poll.bind(this);this.#running=false;this.#network=null;this.#hault=false}_subscribe(provider){throw new Error("subclasses must override this")}_emitResults(provider,result){throw new Error("subclasses must override this")}_recover(provider){throw new Error("subclasses must override this")}async#poll(blockNumber){try{if(this.#filterIdPromise==null){this.#filterIdPromise=this._subscribe(this.#provider)}let filterId=null;try{filterId=await this.#filterIdPromise}catch(error){if(!isError(error,"UNSUPPORTED_OPERATION")||error.operation!=="eth_newFilter"){throw error}}if(filterId==null){this.#filterIdPromise=null;this.#provider._recoverSubscriber(this,this._recover(this.#provider));return}const network=await this.#provider.getNetwork();if(!this.#network){this.#network=network}if(this.#network.chainId!==network.chainId){throw new Error("chaid changed")}if(this.#hault){return}const result=await this.#provider.send("eth_getFilterChanges",[filterId]);await this._emitResults(this.#provider,result)}catch(error){console.log("@TODO",error)}this.#provider.once("block",this.#poller)}#teardown(){const filterIdPromise=this.#filterIdPromise;if(filterIdPromise){this.#filterIdPromise=null;filterIdPromise.then(filterId=>{if(this.#provider.destroyed){return}this.#provider.send("eth_uninstallFilter",[filterId])})}}start(){if(this.#running){return}this.#running=true;this.#poll(-2)}stop(){if(!this.#running){return}this.#running=false;this.#hault=true;this.#teardown();this.#provider.off("block",this.#poller)}pause(dropWhilePaused){if(dropWhilePaused){this.#teardown()}this.#provider.off("block",this.#poller)}resume(){this.start()}}class FilterIdEventSubscriber extends FilterIdSubscriber{#event;constructor(provider,filter){super(provider);this.#event=copy(filter)}_recover(provider){return new PollingEventSubscriber(provider,this.#event)}async _subscribe(provider){const filterId=await provider.send("eth_newFilter",[this.#event]);return filterId}async _emitResults(provider,results){for(const result of results){provider.emit(this.#event,provider._wrapLog(result,provider._network))}}}class FilterIdPendingSubscriber extends FilterIdSubscriber{async _subscribe(provider){return await provider.send("eth_newPendingTransactionFilter",[])}async _emitResults(provider,results){for(const result of results){provider.emit("pending",result)}}}const Primitive="bigint,boolean,function,number,string,symbol".split(/,/g);function deepCopy(value){if(value==null||Primitive.indexOf(typeof value)>=0){return value}if(typeof value.getAddress==="function"){return value}if(Array.isArray(value)){return value.map(deepCopy)}if(typeof value==="object"){return Object.keys(value).reduce((accum,key)=>{accum[key]=value[key];return accum},{})}throw new Error(`should not happen: ${value} (${typeof value})`)}function stall$3(duration){return new Promise(resolve=>{setTimeout(resolve,duration)})}function getLowerCase(value){if(value){return value.toLowerCase()}return value}function isPollable(value){return value&&typeof value.pollingInterval==="number"}const defaultOptions={polling:false,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class JsonRpcSigner extends AbstractSigner{address;constructor(provider,address){super(provider);address=getAddress(address);defineProperties(this,{address:address})}connect(provider){assert(false,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(tx){return await this.populateCall(tx)}async sendUncheckedTransaction(_tx){const tx=deepCopy(_tx);const promises=[];if(tx.from){const _from=tx.from;promises.push((async()=>{const from=await resolveAddress(_from,this.provider);assertArgument(from!=null&&from.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",_tx);tx.from=from})())}else{tx.from=this.address}if(tx.gasLimit==null){promises.push((async()=>{tx.gasLimit=await this.provider.estimateGas({...tx,from:this.address})})())}if(tx.to!=null){const _to=tx.to;promises.push((async()=>{tx.to=await resolveAddress(_to,this.provider)})())}if(promises.length){await Promise.all(promises)}const hexTx=this.provider.getRpcTransaction(tx);return this.provider.send("eth_sendTransaction",[hexTx])}async sendTransaction(tx){const blockNumber=await this.provider.getBlockNumber();const hash=await this.sendUncheckedTransaction(tx);return await new Promise((resolve,reject)=>{const timeouts=[1e3,100];let invalids=0;const checkTx=async()=>{try{const tx=await this.provider.getTransaction(hash);if(tx!=null){resolve(tx.replaceableTransaction(blockNumber));return}}catch(error){if(isError(error,"CANCELLED")||isError(error,"BAD_DATA")||isError(error,"NETWORK_ERROR")||isError(error,"UNSUPPORTED_OPERATION")){if(error.info==null){error.info={}}error.info.sendTransactionHash=hash;reject(error);return}if(isError(error,"INVALID_ARGUMENT")){invalids++;if(error.info==null){error.info={}}error.info.sendTransactionHash=hash;if(invalids>10){reject(error);return}}this.provider.emit("error",makeError("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:error}))}this.provider._setTimeout(()=>{checkTx()},timeouts.pop()||4e3)};checkTx()})}async signTransaction(_tx){const tx=deepCopy(_tx);if(tx.from){const from=await resolveAddress(tx.from,this.provider);assertArgument(from!=null&&from.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",_tx);tx.from=from}else{tx.from=this.address}const hexTx=this.provider.getRpcTransaction(tx);return await this.provider.send("eth_signTransaction",[hexTx])}async signMessage(_message){const message=typeof _message==="string"?toUtf8Bytes(_message):_message;return await this.provider.send("personal_sign",[hexlify(message),this.address.toLowerCase()])}async signTypedData(domain,types,_value){const value=deepCopy(_value);const populated=await TypedDataEncoder.resolveNames(domain,types,value,async value=>{const address=await resolveAddress(value);assertArgument(address!=null,"TypedData does not support null address","value",value);return address});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(TypedDataEncoder.getPayload(populated.domain,types,populated.value))])}async unlock(password){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),password,null])}async _legacySignMessage(_message){const message=typeof _message==="string"?toUtf8Bytes(_message):_message;return await this.provider.send("eth_sign",[this.address.toLowerCase(),hexlify(message)])}}class JsonRpcApiProvider extends AbstractProvider{#options;#nextId;#payloads;#drainTimer;#notReady;#network;#pendingDetectNetwork;#scheduleDrain(){if(this.#drainTimer){return}const stallTime=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");this.#drainTimer=setTimeout(()=>{this.#drainTimer=null;const payloads=this.#payloads;this.#payloads=[];while(payloads.length){const batch=[payloads.shift()];while(payloads.length){if(batch.length===this.#options.batchMaxCount){break}batch.push(payloads.shift());const bytes=JSON.stringify(batch.map(p=>p.payload));if(bytes.length>this.#options.batchMaxSize){payloads.unshift(batch.pop());break}}(async()=>{const payload=batch.length===1?batch[0].payload:batch.map(p=>p.payload);this.emit("debug",{action:"sendRpcPayload",payload:payload});try{const result=await this._send(payload);this.emit("debug",{action:"receiveRpcResult",result:result});for(const{resolve,reject,payload}of batch){if(this.destroyed){reject(makeError("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:payload.method}));continue}const resp=result.filter(r=>r.id===payload.id)[0];if(resp==null){const error=makeError("missing response for request","BAD_DATA",{value:result,info:{payload:payload}});this.emit("error",error);reject(error);continue}if("error"in resp){reject(this.getRpcError(payload,resp));continue}resolve(resp.result)}}catch(error){this.emit("debug",{action:"receiveRpcError",error:error});for(const{reject}of batch){reject(error)}}})()}},stallTime)}constructor(network,options){super(network,options);this.#nextId=1;this.#options=Object.assign({},defaultOptions,options||{});this.#payloads=[];this.#drainTimer=null;this.#network=null;this.#pendingDetectNetwork=null;{let resolve=null;const promise=new Promise(_resolve=>{resolve=_resolve});this.#notReady={promise:promise,resolve:resolve}}const staticNetwork=this._getOption("staticNetwork");if(typeof staticNetwork==="boolean"){assertArgument(!staticNetwork||network!=="any","staticNetwork cannot be used on special network 'any'","options",options);if(staticNetwork&&network!=null){this.#network=Network.from(network)}}else if(staticNetwork){assertArgument(network==null||staticNetwork.matches(network),"staticNetwork MUST match network object","options",options);this.#network=staticNetwork}}_getOption(key){return this.#options[key]}get _network(){assert(this.#network,"network is not available yet","NETWORK_ERROR");return this.#network}async _perform(req){if(req.method==="call"||req.method==="estimateGas"){let tx=req.transaction;if(tx&&tx.type!=null&&getBigInt(tx.type)){if(tx.maxFeePerGas==null&&tx.maxPriorityFeePerGas==null){const feeData=await this.getFeeData();if(feeData.maxFeePerGas==null&&feeData.maxPriorityFeePerGas==null){req=Object.assign({},req,{transaction:Object.assign({},tx,{type:undefined})})}}}}const request=this.getRpcRequest(req);if(request!=null){return await this.send(request.method,request.args)}return super._perform(req)}async _detectNetwork(){const network=this._getOption("staticNetwork");if(network){if(network===true){if(this.#network){return this.#network}}else{return network}}if(this.#pendingDetectNetwork){return await this.#pendingDetectNetwork}if(this.ready){this.#pendingDetectNetwork=(async()=>{try{const result=Network.from(getBigInt(await this.send("eth_chainId",[])));this.#pendingDetectNetwork=null;return result}catch(error){this.#pendingDetectNetwork=null;throw error}})();return await this.#pendingDetectNetwork}this.#pendingDetectNetwork=(async()=>{const payload={id:this.#nextId++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:payload});let result;try{result=(await this._send(payload))[0];this.#pendingDetectNetwork=null}catch(error){this.#pendingDetectNetwork=null;this.emit("debug",{action:"receiveRpcError",error:error});throw error}this.emit("debug",{action:"receiveRpcResult",result:result});if("result"in result){return Network.from(getBigInt(result.result))}throw this.getRpcError(payload,result)})();return await this.#pendingDetectNetwork}_start(){if(this.#notReady==null||this.#notReady.resolve==null){return}this.#notReady.resolve();this.#notReady=null;(async()=>{while(this.#network==null&&!this.destroyed){try{this.#network=await this._detectNetwork()}catch(error){if(this.destroyed){break}console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)");this.emit("error",makeError("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:error}}));await stall$3(1e3)}}this.#scheduleDrain()})()}async _waitUntilReady(){if(this.#notReady==null){return}return await this.#notReady.promise}_getSubscriber(sub){if(sub.type==="pending"){return new FilterIdPendingSubscriber(this)}if(sub.type==="event"){if(this._getOption("polling")){return new PollingEventSubscriber(this,sub.filter)}return new FilterIdEventSubscriber(this,sub.filter)}if(sub.type==="orphan"&&sub.filter.orphan==="drop-log"){return new UnmanagedSubscriber("orphan")}return super._getSubscriber(sub)}get ready(){return this.#notReady==null}getRpcTransaction(tx){const result={};["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(key=>{if(tx[key]==null){return}let dstKey=key;if(key==="gasLimit"){dstKey="gas"}result[dstKey]=toQuantity(getBigInt(tx[key],`tx.${key}`))});["from","to","data"].forEach(key=>{if(tx[key]==null){return}result[key]=hexlify(tx[key])});if(tx.accessList){result["accessList"]=accessListify(tx.accessList)}if(tx.blobVersionedHashes){result["blobVersionedHashes"]=tx.blobVersionedHashes.map(h=>h.toLowerCase())}if(tx.authorizationList){result["authorizationList"]=tx.authorizationList.map(_a=>{const a=authorizationify(_a);return{address:a.address,nonce:toQuantity(a.nonce),chainId:toQuantity(a.chainId),yParity:toQuantity(a.signature.yParity),r:toQuantity(a.signature.r),s:toQuantity(a.signature.s)}})}return result}getRpcRequest(req){switch(req.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[getLowerCase(req.address),req.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[getLowerCase(req.address),req.blockTag]};case"getCode":return{method:"eth_getCode",args:[getLowerCase(req.address),req.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[getLowerCase(req.address),"0x"+req.position.toString(16),req.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[req.signedTransaction]};case"getBlock":if("blockTag"in req){return{method:"eth_getBlockByNumber",args:[req.blockTag,!!req.includeTransactions]}}else if("blockHash"in req){return{method:"eth_getBlockByHash",args:[req.blockHash,!!req.includeTransactions]}}break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[req.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[req.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(req.transaction),req.blockTag]};case"estimateGas":{return{method:"eth_estimateGas",args:[this.getRpcTransaction(req.transaction)]}}case"getLogs":if(req.filter&&req.filter.address!=null){if(Array.isArray(req.filter.address)){req.filter.address=req.filter.address.map(getLowerCase)}else{req.filter.address=getLowerCase(req.filter.address)}}return{method:"eth_getLogs",args:[req.filter]}}return null}getRpcError(payload,_error){const{method}=payload;const{error}=_error;if(method==="eth_estimateGas"&&error.message){const msg=error.message;if(!msg.match(/revert/i)&&msg.match(/insufficient funds/i)){return makeError("insufficient funds","INSUFFICIENT_FUNDS",{transaction:payload.params[0],info:{payload:payload,error:error}})}else if(msg.match(/nonce/i)&&msg.match(/too low/i)){return makeError("nonce has already been used","NONCE_EXPIRED",{transaction:payload.params[0],info:{payload:payload,error:error}})}}if(method==="eth_call"||method==="eth_estimateGas"){const result=spelunkData(error);const e=AbiCoder.getBuiltinCallException(method==="eth_call"?"call":"estimateGas",payload.params[0],result?result.data:null);e.info={error:error,payload:payload};return e}const message=JSON.stringify(spelunkMessage(error));if(typeof error.message==="string"&&error.message.match(/user denied|ethers-user-denied/i)){const actionMap={eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"};return makeError(`user rejected action`,"ACTION_REJECTED",{action:actionMap[method]||"unknown",reason:"rejected",info:{payload:payload,error:error}})}if(method==="eth_sendRawTransaction"||method==="eth_sendTransaction"){const transaction=payload.params[0];if(message.match(/insufficient funds|base fee exceeds gas limit/i)){return makeError("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:transaction,info:{error:error}})}if(message.match(/nonce/i)&&message.match(/too low/i)){return makeError("nonce has already been used","NONCE_EXPIRED",{transaction:transaction,info:{error:error}})}if(message.match(/replacement transaction/i)&&message.match(/underpriced/i)){return makeError("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:transaction,info:{error:error}})}if(message.match(/only replay-protected/i)){return makeError("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:method,info:{transaction:transaction,info:{error:error}}})}}let unsupported=!!message.match(/the method .* does not exist/i);if(!unsupported){if(error&&error.details&&error.details.startsWith("Unauthorized method:")){unsupported=true}}if(unsupported){return makeError("unsupported operation","UNSUPPORTED_OPERATION",{operation:payload.method,info:{error:error,payload:payload}})}return makeError("could not coalesce error","UNKNOWN_ERROR",{error:error,payload:payload})}send(method,params){if(this.destroyed){return Promise.reject(makeError("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:method}))}const id=this.#nextId++;const promise=new Promise((resolve,reject)=>{this.#payloads.push({resolve:resolve,reject:reject,payload:{method:method,params:params,id:id,jsonrpc:"2.0"}})});this.#scheduleDrain();return promise}async getSigner(address){if(address==null){address=0}const accountsPromise=this.send("eth_accounts",[]);if(typeof address==="number"){const accounts=await accountsPromise;if(address>=accounts.length){throw new Error("no such account")}return new JsonRpcSigner(this,accounts[address])}const{accounts}=await resolveProperties({network:this.getNetwork(),accounts:accountsPromise});address=getAddress(address);for(const account of accounts){if(getAddress(account)===address){return new JsonRpcSigner(this,address)}}throw new Error("invalid account")}async listAccounts(){const accounts=await this.send("eth_accounts",[]);return accounts.map(a=>new JsonRpcSigner(this,a))}destroy(){if(this.#drainTimer){clearTimeout(this.#drainTimer);this.#drainTimer=null}for(const{payload,reject}of this.#payloads){reject(makeError("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:payload.method}))}this.#payloads=[];super.destroy()}}class JsonRpcApiPollingProvider extends JsonRpcApiProvider{#pollingInterval;constructor(network,options){super(network,options);let pollingInterval=this._getOption("pollingInterval");if(pollingInterval==null){pollingInterval=defaultOptions.pollingInterval}this.#pollingInterval=pollingInterval}_getSubscriber(sub){const subscriber=super._getSubscriber(sub);if(isPollable(subscriber)){subscriber.pollingInterval=this.#pollingInterval}return subscriber}get pollingInterval(){return this.#pollingInterval}set pollingInterval(value){if(!Number.isInteger(value)||value<0){throw new Error("invalid interval")}this.#pollingInterval=value;this._forEachSubscriber(sub=>{if(isPollable(sub)){sub.pollingInterval=this.#pollingInterval}})}}class JsonRpcProvider extends JsonRpcApiPollingProvider{#connect;constructor(url,network,options){if(url==null){url="http://localhost:8545"}super(network,options);if(typeof url==="string"){this.#connect=new FetchRequest(url)}else{this.#connect=url.clone()}}_getConnection(){return this.#connect.clone()}async send(method,params){await this._start();return await super.send(method,params)}async _send(payload){const request=this._getConnection();request.body=JSON.stringify(payload);request.setHeader("content-type","application/json");const response=await request.send();response.assertOk();let resp=response.bodyJson;if(!Array.isArray(resp)){resp=[resp]}return resp}}function spelunkData(value){if(value==null){return null}if(typeof value.message==="string"&&value.message.match(/revert/i)&&isHexString(value.data)){return{message:value.message,data:value.data}}if(typeof value==="object"){for(const key in value){const result=spelunkData(value[key]);if(result){return result}}return null}if(typeof value==="string"){try{return spelunkData(JSON.parse(value))}catch(error){}}return null}function _spelunkMessage(value,result){if(value==null){return}if(typeof value.message==="string"){result.push(value.message)}if(typeof value==="object"){for(const key in value){_spelunkMessage(value[key],result)}}if(typeof value==="string"){try{return _spelunkMessage(JSON.parse(value),result)}catch(error){}}}function spelunkMessage(value){const result=[];_spelunkMessage(value,result);return result}const defaultApiKey$1="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function getHost$5(name){switch(name){case"mainnet":return"rpc.ankr.com/eth";case"goerli":return"rpc.ankr.com/eth_goerli";case"sepolia":return"rpc.ankr.com/eth_sepolia";case"arbitrum":return"rpc.ankr.com/arbitrum";case"base":return"rpc.ankr.com/base";case"base-goerli":return"rpc.ankr.com/base_goerli";case"base-sepolia":return"rpc.ankr.com/base_sepolia";case"bnb":return"rpc.ankr.com/bsc";case"bnbt":return"rpc.ankr.com/bsc_testnet_chapel";case"filecoin":return"rpc.ankr.com/filecoin";case"filecoin-calibration":return"rpc.ankr.com/filecoin_testnet";case"matic":return"rpc.ankr.com/polygon";case"matic-mumbai":return"rpc.ankr.com/polygon_mumbai";case"optimism":return"rpc.ankr.com/optimism";case"optimism-goerli":return"rpc.ankr.com/optimism_testnet";case"optimism-sepolia":return"rpc.ankr.com/optimism_sepolia"}assertArgument(false,"unsupported network","network",name)}class AnkrProvider extends JsonRpcProvider{apiKey;constructor(_network,apiKey){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(apiKey==null){apiKey=defaultApiKey$1}const options={polling:true,staticNetwork:network};const request=AnkrProvider.getRequest(network,apiKey);super(request,network,options);defineProperties(this,{apiKey:apiKey})}_getProvider(chainId){try{return new AnkrProvider(chainId,this.apiKey)}catch(error){}return super._getProvider(chainId)}static getRequest(network,apiKey){if(apiKey==null){apiKey=defaultApiKey$1}const request=new FetchRequest(`https:/\/${getHost$5(network.name)}/${apiKey}`);request.allowGzip=true;if(apiKey===defaultApiKey$1){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("AnkrProvider");return true}}return request}getRpcError(payload,error){if(payload.method==="eth_sendRawTransaction"){if(error&&error.error&&error.error.message==="INTERNAL_ERROR: could not replace existing tx"){error.error.message="replacement transaction underpriced"}}return super.getRpcError(payload,error)}isCommunityResource(){return this.apiKey===defaultApiKey$1}}const defaultApiKey="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";function getHost$4(name){switch(name){case"mainnet":return"eth-mainnet.g.alchemy.com";case"goerli":return"eth-goerli.g.alchemy.com";case"sepolia":return"eth-sepolia.g.alchemy.com";case"arbitrum":return"arb-mainnet.g.alchemy.com";case"arbitrum-goerli":return"arb-goerli.g.alchemy.com";case"arbitrum-sepolia":return"arb-sepolia.g.alchemy.com";case"base":return"base-mainnet.g.alchemy.com";case"base-goerli":return"base-goerli.g.alchemy.com";case"base-sepolia":return"base-sepolia.g.alchemy.com";case"matic":return"polygon-mainnet.g.alchemy.com";case"matic-amoy":return"polygon-amoy.g.alchemy.com";case"matic-mumbai":return"polygon-mumbai.g.alchemy.com";case"optimism":return"opt-mainnet.g.alchemy.com";case"optimism-goerli":return"opt-goerli.g.alchemy.com";case"optimism-sepolia":return"opt-sepolia.g.alchemy.com"}assertArgument(false,"unsupported network","network",name)}class AlchemyProvider extends JsonRpcProvider{apiKey;constructor(_network,apiKey){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(apiKey==null){apiKey=defaultApiKey}const request=AlchemyProvider.getRequest(network,apiKey);super(request,network,{staticNetwork:network});defineProperties(this,{apiKey:apiKey})}_getProvider(chainId){try{return new AlchemyProvider(chainId,this.apiKey)}catch(error){}return super._getProvider(chainId)}async _perform(req){if(req.method==="getTransactionResult"){const{trace,tx}=await resolveProperties({trace:this.send("trace_transaction",[req.hash]),tx:this.getTransaction(req.hash)});if(trace==null||tx==null){return null}let data;let error=false;try{data=trace[0].result.output;error=trace[0].error==="Reverted"}catch(error){}if(data){assert(!error,"an error occurred during transaction executions","CALL_EXCEPTION",{action:"getTransactionResult",data:data,reason:null,transaction:tx,invocation:null,revert:null});return data}assert(false,"could not parse trace result","BAD_DATA",{value:trace})}return await super._perform(req)}isCommunityResource(){return this.apiKey===defaultApiKey}static getRequest(network,apiKey){if(apiKey==null){apiKey=defaultApiKey}const request=new FetchRequest(`https:/\/${getHost$4(network.name)}/v2/${apiKey}`);request.allowGzip=true;if(apiKey===defaultApiKey){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("alchemy");return true}}return request}}function getApiKey(name){switch(name){case"mainnet":return"39f1d67cedf8b7831010a665328c9197";case"arbitrum":return"0550c209db33c3abf4cc927e1e18cea1";case"bnb":return"98b5a77e531614387366f6fc5da097f8";case"matic":return"cd9d4d70377471aa7c142ec4a4205249"}assertArgument(false,"unsupported network","network",name)}function getHost$3(name){switch(name){case"mainnet":return"ethereum-mainnet.core.chainstack.com";case"arbitrum":return"arbitrum-mainnet.core.chainstack.com";case"bnb":return"bsc-mainnet.core.chainstack.com";case"matic":return"polygon-mainnet.core.chainstack.com"}assertArgument(false,"unsupported network","network",name)}class ChainstackProvider extends JsonRpcProvider{apiKey;constructor(_network,apiKey){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(apiKey==null){apiKey=getApiKey(network.name)}const request=ChainstackProvider.getRequest(network,apiKey);super(request,network,{staticNetwork:network});defineProperties(this,{apiKey:apiKey})}_getProvider(chainId){try{return new ChainstackProvider(chainId,this.apiKey)}catch(error){}return super._getProvider(chainId)}isCommunityResource(){return this.apiKey===getApiKey(this._network.name)}static getRequest(network,apiKey){if(apiKey==null){apiKey=getApiKey(network.name)}const request=new FetchRequest(`https:/\/${getHost$3(network.name)}/${apiKey}`);request.allowGzip=true;if(apiKey===getApiKey(network.name)){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("ChainstackProvider");return true}}return request}}class CloudflareProvider extends JsonRpcProvider{constructor(_network){if(_network==null){_network="mainnet"}const network=Network.from(_network);assertArgument(network.name==="mainnet","unsupported network","network",_network);super("https://cloudflare-eth.com/",network,{staticNetwork:network})}}const Supported=("1 11155111 17000 560048 2741 11124 33111 33139 42170 "+"42161 421614 43114 43113 8453 84532 80069 80094 199 1029 81457 "+"168587773 56 97 42220 11142220 252 2523 100 999 737373 747474 "+"59144 59141 5000 5003 43521 143 10143 1287 1284 1285 10 "+"11155420 204 5611 80002 137 534352 534351 1329 1328 146 14601 "+"988 2201 1923 1924 167013 167000 130 1301 480 4801 51 50 324 300").split(/ /g);const THROTTLE=2e3;function isPromise(value){return value&&typeof value.then==="function"}const EtherscanPluginId="org.ethers.plugins.provider.Etherscan";class EtherscanPlugin extends NetworkPlugin{baseUrl;constructor(baseUrl){super(EtherscanPluginId);defineProperties(this,{baseUrl:baseUrl})}clone(){return new EtherscanPlugin(this.baseUrl)}}const skipKeys=["enableCcipRead"];let nextId=1;class EtherscanProvider extends AbstractProvider{network;apiKey;#plugin;constructor(_network,_apiKey){const apiKey=_apiKey!=null?_apiKey:null;super();const network=Network.from(_network);assertArgument(Supported.indexOf(`${network.chainId}`)>=0,"unsupported network","network",network);this.#plugin=network.getPlugin(EtherscanPluginId);defineProperties(this,{apiKey:apiKey,network:network})}getBaseUrl(){if(this.#plugin){return this.#plugin.baseUrl}switch(this.network.name){case"mainnet":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"holesky":return"https://api-holesky.etherscan.io";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"base":return"https://api.basescan.org";case"base-sepolia":return"https://api-sepolia.basescan.org";case"bnb":return"https://api.bscscan.com";case"bnbt":return"https://api-testnet.bscscan.com";case"matic":return"https://api.polygonscan.com";case"matic-amoy":return"https://api-amoy.polygonscan.com";case"matic-mumbai":return"https://api-testnet.polygonscan.com";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}assertArgument(false,"unsupported network","network",this.network)}getUrl(module,params){let query=Object.keys(params).reduce((accum,key)=>{const value=params[key];if(value!=null){accum+=`&${key}=${value}`}return accum},"");if(this.apiKey){query+=`&apikey=${this.apiKey}`}return`https:/\/api.etherscan.io/v2/api?chainid=${this.network.chainId}&module=${module}${query}`}getPostUrl(){return`https:/\/api.etherscan.io/v2/api?chainid=${this.network.chainId}`}getPostData(module,params){params.module=module;params.apikey=this.apiKey;params.chainid=this.network.chainId;return params}async detectNetwork(){return this.network}async fetch(module,params,post){const id=nextId++;const url=post?this.getPostUrl():this.getUrl(module,params);const payload=post?this.getPostData(module,params):null;this.emit("debug",{action:"sendRequest",id:id,url:url,payload:payload});const request=new FetchRequest(url);request.setThrottleParams({slotInterval:1e3});request.retryFunc=(req,resp,attempt)=>{if(this.isCommunityResource()){showThrottleMessage("Etherscan")}return Promise.resolve(true)};request.processFunc=async(request,response)=>{const result=response.hasBody()?JSON.parse(toUtf8String(response.body)):{};const throttle=(typeof result.result==="string"?result.result:"").toLowerCase().indexOf("rate limit")>=0;if(module==="proxy"){if(result&&result.status==0&&result.message=="NOTOK"&&throttle){this.emit("debug",{action:"receiveError",id:id,reason:"proxy-NOTOK",error:result});response.throwThrottleError(result.result,THROTTLE)}}else{if(throttle){this.emit("debug",{action:"receiveError",id:id,reason:"null result",error:result.result});response.throwThrottleError(result.result,THROTTLE)}}return response};if(payload){request.setHeader("content-type","application/x-www-form-urlencoded; charset=UTF-8");request.body=Object.keys(payload).map(k=>`${k}=${payload[k]}`).join("&")}const response=await request.send();try{response.assertOk()}catch(error){this.emit("debug",{action:"receiveError",id:id,error:error,reason:"assertOk"});assert(false,"response error","SERVER_ERROR",{request:request,response:response})}if(!response.hasBody()){this.emit("debug",{action:"receiveError",id:id,error:"missing body",reason:"null body"});assert(false,"missing response","SERVER_ERROR",{request:request,response:response})}const result=JSON.parse(toUtf8String(response.body));if(module==="proxy"){if(result.jsonrpc!="2.0"){this.emit("debug",{action:"receiveError",id:id,result:result,reason:"invalid JSON-RPC"});assert(false,"invalid JSON-RPC response (missing jsonrpc='2.0')","SERVER_ERROR",{request:request,response:response,info:{result:result}})}if(result.error){this.emit("debug",{action:"receiveError",id:id,result:result,reason:"JSON-RPC error"});assert(false,"error response","SERVER_ERROR",{request:request,response:response,info:{result:result}})}this.emit("debug",{action:"receiveRequest",id:id,result:result});return result.result}else{if(result.status==0&&(result.message==="No records found"||result.message==="No transactions found")){this.emit("debug",{action:"receiveRequest",id:id,result:result});return result.result}if(result.status!=1||typeof result.message==="string"&&!result.message.match(/^OK/)){this.emit("debug",{action:"receiveError",id:id,result:result});assert(false,"error response","SERVER_ERROR",{request:request,response:response,info:{result:result}})}this.emit("debug",{action:"receiveRequest",id:id,result:result});return result.result}}_getTransactionPostData(transaction){const result={};for(let key in transaction){if(skipKeys.indexOf(key)>=0){continue}if(transaction[key]==null){continue}let value=transaction[key];if(key==="type"&&value===0){continue}if(key==="blockTag"&&value==="latest"){continue}if({type:true,gasLimit:true,gasPrice:true,maxFeePerGs:true,maxPriorityFeePerGas:true,nonce:true,value:true}[key]){value=toQuantity(value)}else if(key==="accessList"){value="["+accessListify(value).map(set=>{return`{address:"${set.address}",storageKeys:["${set.storageKeys.join('","')}"]}`}).join(",")+"]"}else if(key==="blobVersionedHashes"){if(value.length===0){continue}assert(false,"Etherscan API does not support blobVersionedHashes","UNSUPPORTED_OPERATION",{operation:"_getTransactionPostData",info:{transaction:transaction}})}else{value=hexlify(value)}result[key]=value}return result}_checkError(req,error,transaction){let message="";if(isError(error,"SERVER_ERROR")){try{message=error.info.result.error.message}catch(e){}if(!message){try{message=error.info.message}catch(e){}}}if(req.method==="estimateGas"){if(!message.match(/revert/i)&&message.match(/insufficient funds/i)){assert(false,"insufficient funds","INSUFFICIENT_FUNDS",{transaction:req.transaction})}}if(req.method==="call"||req.method==="estimateGas"){if(message.match(/execution reverted/i)){let data="";try{data=error.info.result.error.data}catch(error){}const e=AbiCoder.getBuiltinCallException(req.method,req.transaction,data);e.info={request:req,error:error};throw e}}if(message){if(req.method==="broadcastTransaction"){const transaction=Transaction.from(req.signedTransaction);if(message.match(/replacement/i)&&message.match(/underpriced/i)){assert(false,"replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:transaction})}if(message.match(/insufficient funds/)){assert(false,"insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:transaction})}if(message.match(/same hash was already imported|transaction nonce is too low|nonce too low/)){assert(false,"nonce has already been used","NONCE_EXPIRED",{transaction:transaction})}}}throw error}async _detectNetwork(){return this.network}async _perform(req){switch(req.method){case"chainId":return this.network.chainId;case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getPriorityFee":if(this.network.name==="mainnet"){return"1000000000"}else if(this.network.name==="optimism"){return"1000000"}else{throw new Error("fallback onto the AbstractProvider default")}case"getBalance":return this.fetch("account",{action:"balance",address:req.address,tag:req.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:req.address,tag:req.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:req.address,tag:req.blockTag});case"getStorage":return this.fetch("proxy",{action:"eth_getStorageAt",address:req.address,position:req.position,tag:req.blockTag});case"broadcastTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:req.signedTransaction},true).catch(error=>{return this._checkError(req,error,req.signedTransaction)});case"getBlock":if("blockTag"in req){return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:req.blockTag,boolean:req.includeTransactions?"true":"false"})}assert(false,"getBlock by blockHash not supported by Etherscan","UNSUPPORTED_OPERATION",{operation:"getBlock(blockHash)"});case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:req.hash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:req.hash});case"call":{if(req.blockTag!=="latest"){throw new Error("EtherscanProvider does not support blockTag for call")}const postData=this._getTransactionPostData(req.transaction);postData.module="proxy";postData.action="eth_call";try{return await this.fetch("proxy",postData,true)}catch(error){return this._checkError(req,error,req.transaction)}}case"estimateGas":{const postData=this._getTransactionPostData(req.transaction);postData.module="proxy";postData.action="eth_estimateGas";try{return await this.fetch("proxy",postData,true)}catch(error){return this._checkError(req,error,req.transaction)}}}return super._perform(req)}async getNetwork(){return this.network}async getEtherPrice(){if(this.network.name!=="mainnet"){return 0}return parseFloat((await this.fetch("stats",{action:"ethprice"})).ethusd)}async getContract(_address){let address=this._getAddress(_address);if(isPromise(address)){address=await address}try{const resp=await this.fetch("contract",{action:"getabi",address:address});const abi=JSON.parse(resp);return new Contract(address,abi,this)}catch(error){return null}}isCommunityResource(){return this.apiKey==null}}function getGlobal(){if(typeof self!=="undefined"){return self}if(typeof window!=="undefined"){return window}if(typeof global!=="undefined"){return global}throw new Error("unable to locate global object")}const _WebSocket=getGlobal().WebSocket;class SocketSubscriber{#provider;#filter;get filter(){return JSON.parse(this.#filter)}#filterId;#paused;#emitPromise;constructor(provider,filter){this.#provider=provider;this.#filter=JSON.stringify(filter);this.#filterId=null;this.#paused=null;this.#emitPromise=null}start(){this.#filterId=this.#provider.send("eth_subscribe",this.filter).then(filterId=>{this.#provider._register(filterId,this);return filterId})}stop(){this.#filterId.then(filterId=>{if(this.#provider.destroyed){return}this.#provider.send("eth_unsubscribe",[filterId])});this.#filterId=null}pause(dropWhilePaused){assert(dropWhilePaused,"preserve logs while paused not supported by SocketSubscriber yet","UNSUPPORTED_OPERATION",{operation:"pause(false)"});this.#paused=!!dropWhilePaused}resume(){this.#paused=null}_handleMessage(message){if(this.#filterId==null){return}if(this.#paused===null){let emitPromise=this.#emitPromise;if(emitPromise==null){emitPromise=this._emit(this.#provider,message)}else{emitPromise=emitPromise.then(async()=>{await this._emit(this.#provider,message)})}this.#emitPromise=emitPromise.then(()=>{if(this.#emitPromise===emitPromise){this.#emitPromise=null}})}}async _emit(provider,message){throw new Error("sub-classes must implemente this; _emit")}}class SocketBlockSubscriber extends SocketSubscriber{constructor(provider){super(provider,["newHeads"])}async _emit(provider,message){provider.emit("block",parseInt(message.number))}}class SocketPendingSubscriber extends SocketSubscriber{constructor(provider){super(provider,["newPendingTransactions"])}async _emit(provider,message){provider.emit("pending",message)}}class SocketEventSubscriber extends SocketSubscriber{#logFilter;get logFilter(){return JSON.parse(this.#logFilter)}constructor(provider,filter){super(provider,["logs",filter]);this.#logFilter=JSON.stringify(filter)}async _emit(provider,message){provider.emit(this.logFilter,provider._wrapLog(message,provider._network))}}class SocketProvider extends JsonRpcApiProvider{#callbacks;#subs;#pending;constructor(network,_options){const options=Object.assign({},_options!=null?_options:{});assertArgument(options.batchMaxCount==null||options.batchMaxCount===1,"sockets-based providers do not support batches","options.batchMaxCount",_options);options.batchMaxCount=1;if(options.staticNetwork==null){options.staticNetwork=true}super(network,options);this.#callbacks=new Map;this.#subs=new Map;this.#pending=new Map}_getSubscriber(sub){switch(sub.type){case"close":return new UnmanagedSubscriber("close");case"block":return new SocketBlockSubscriber(this);case"pending":return new SocketPendingSubscriber(this);case"event":return new SocketEventSubscriber(this,sub.filter);case"orphan":if(sub.filter.orphan==="drop-log"){return new UnmanagedSubscriber("drop-log")}}return super._getSubscriber(sub)}_register(filterId,subscriber){this.#subs.set(filterId,subscriber);const pending=this.#pending.get(filterId);if(pending){for(const message of pending){subscriber._handleMessage(message)}this.#pending.delete(filterId)}}async _send(payload){assertArgument(!Array.isArray(payload),"WebSocket does not support batch send","payload",payload);const promise=new Promise((resolve,reject)=>{this.#callbacks.set(payload.id,{payload:payload,resolve:resolve,reject:reject})});await this._waitUntilReady();await this._write(JSON.stringify(payload));return[await promise]}async _processMessage(message){const result=JSON.parse(message);if(result&&typeof result==="object"&&"id"in result){const callback=this.#callbacks.get(result.id);if(callback==null){this.emit("error",makeError("received result for unknown id","UNKNOWN_ERROR",{reasonCode:"UNKNOWN_ID",result:result}));return}this.#callbacks.delete(result.id);callback.resolve(result)}else if(result&&result.method==="eth_subscription"){const filterId=result.params.subscription;const subscriber=this.#subs.get(filterId);if(subscriber){subscriber._handleMessage(result.params.result)}else{let pending=this.#pending.get(filterId);if(pending==null){pending=[];this.#pending.set(filterId,pending)}pending.push(result.params.result)}}else{this.emit("error",makeError("received unexpected message","UNKNOWN_ERROR",{reasonCode:"UNEXPECTED_MESSAGE",result:result}));return}}async _write(message){throw new Error("sub-classes must override this")}}class WebSocketProvider extends SocketProvider{#connect;#websocket;get websocket(){if(this.#websocket==null){throw new Error("websocket closed")}return this.#websocket}constructor(url,network,options){super(network,options);if(typeof url==="string"){this.#connect=()=>{return new _WebSocket(url)};this.#websocket=this.#connect()}else if(typeof url==="function"){this.#connect=url;this.#websocket=url()}else{this.#connect=null;this.#websocket=url}this.websocket.onopen=async()=>{try{await this._start();this.resume()}catch(error){console.log("failed to start WebsocketProvider",error)}};this.websocket.onmessage=message=>{this._processMessage(message.data)}}async _write(message){this.websocket.send(message)}async destroy(){if(this.#websocket!=null){this.#websocket.close();this.#websocket=null}super.destroy()}}const defaultProjectId="84842078b09946638c03157f83405213";function getHost$2(name){switch(name){case"mainnet":return"mainnet.infura.io";case"goerli":return"goerli.infura.io";case"sepolia":return"sepolia.infura.io";case"arbitrum":return"arbitrum-mainnet.infura.io";case"arbitrum-goerli":return"arbitrum-goerli.infura.io";case"arbitrum-sepolia":return"arbitrum-sepolia.infura.io";case"base":return"base-mainnet.infura.io";case"base-goerlia":case"base-goerli":return"base-goerli.infura.io";case"base-sepolia":return"base-sepolia.infura.io";case"bnb":return"bsc-mainnet.infura.io";case"bnbt":return"bsc-testnet.infura.io";case"linea":return"linea-mainnet.infura.io";case"linea-goerli":return"linea-goerli.infura.io";case"linea-sepolia":return"linea-sepolia.infura.io";case"matic":return"polygon-mainnet.infura.io";case"matic-amoy":return"polygon-amoy.infura.io";case"matic-mumbai":return"polygon-mumbai.infura.io";case"optimism":return"optimism-mainnet.infura.io";case"optimism-goerli":return"optimism-goerli.infura.io";case"optimism-sepolia":return"optimism-sepolia.infura.io"}assertArgument(false,"unsupported network","network",name)}class InfuraWebSocketProvider extends WebSocketProvider{projectId;projectSecret;constructor(network,projectId){const provider=new InfuraProvider(network,projectId);const req=provider._getConnection();assert(!req.credentials,"INFURA WebSocket project secrets unsupported","UNSUPPORTED_OPERATION",{operation:"InfuraProvider.getWebSocketProvider()"});const url=req.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");super(url,provider._network);defineProperties(this,{projectId:provider.projectId,projectSecret:provider.projectSecret})}isCommunityResource(){return this.projectId===defaultProjectId}}class InfuraProvider extends JsonRpcProvider{projectId;projectSecret;constructor(_network,projectId,projectSecret){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(projectId==null){projectId=defaultProjectId}if(projectSecret==null){projectSecret=null}const request=InfuraProvider.getRequest(network,projectId,projectSecret);super(request,network,{staticNetwork:network});defineProperties(this,{projectId:projectId,projectSecret:projectSecret})}_getProvider(chainId){try{return new InfuraProvider(chainId,this.projectId,this.projectSecret)}catch(error){}return super._getProvider(chainId)}isCommunityResource(){return this.projectId===defaultProjectId}static getWebSocketProvider(network,projectId){return new InfuraWebSocketProvider(network,projectId)}static getRequest(network,projectId,projectSecret){if(projectId==null){projectId=defaultProjectId}if(projectSecret==null){projectSecret=null}const request=new FetchRequest(`https:/\/${getHost$2(network.name)}/v3/${projectId}`);request.allowGzip=true;if(projectSecret){request.setCredentials("",projectSecret)}if(projectId===defaultProjectId){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("InfuraProvider");return true}}return request}}const defaultToken="919b412a057b5e9c9b6dce193c5a60242d6efadb";function getHost$1(name){switch(name){case"mainnet":return"ethers.quiknode.pro";case"goerli":return"ethers.ethereum-goerli.quiknode.pro";case"sepolia":return"ethers.ethereum-sepolia.quiknode.pro";case"holesky":return"ethers.ethereum-holesky.quiknode.pro";case"arbitrum":return"ethers.arbitrum-mainnet.quiknode.pro";case"arbitrum-goerli":return"ethers.arbitrum-goerli.quiknode.pro";case"arbitrum-sepolia":return"ethers.arbitrum-sepolia.quiknode.pro";case"base":return"ethers.base-mainnet.quiknode.pro";case"base-goerli":return"ethers.base-goerli.quiknode.pro";case"base-spolia":return"ethers.base-sepolia.quiknode.pro";case"bnb":return"ethers.bsc.quiknode.pro";case"bnbt":return"ethers.bsc-testnet.quiknode.pro";case"matic":return"ethers.matic.quiknode.pro";case"matic-mumbai":return"ethers.matic-testnet.quiknode.pro";case"optimism":return"ethers.optimism.quiknode.pro";case"optimism-goerli":return"ethers.optimism-goerli.quiknode.pro";case"optimism-sepolia":return"ethers.optimism-sepolia.quiknode.pro";case"xdai":return"ethers.xdai.quiknode.pro"}assertArgument(false,"unsupported network","network",name)}class QuickNodeProvider extends JsonRpcProvider{token;constructor(_network,token){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(token==null){token=defaultToken}const request=QuickNodeProvider.getRequest(network,token);super(request,network,{staticNetwork:network});defineProperties(this,{token:token})}_getProvider(chainId){try{return new QuickNodeProvider(chainId,this.token)}catch(error){}return super._getProvider(chainId)}isCommunityResource(){return this.token===defaultToken}static getRequest(network,token){if(token==null){token=defaultToken}const request=new FetchRequest(`https:/\/${getHost$1(network.name)}/${token}`);request.allowGzip=true;if(token===defaultToken){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("QuickNodeProvider");return true}}return request}}const BN_1=BigInt("1");const BN_2=BigInt("2");function shuffle(array){for(let i=array.length-1;i>0;i--){const j=Math.floor(Math.random()*(i+1));const tmp=array[i];array[i]=array[j];array[j]=tmp}}function stall$2(duration){return new Promise(resolve=>{setTimeout(resolve,duration)})}function getTime(){return(new Date).getTime()}function stringify(value){return JSON.stringify(value,(key,value)=>{if(typeof value==="bigint"){return{type:"bigint",value:value.toString()}}return value})}const defaultConfig={stallTimeout:400,priority:1,weight:1};const defaultState={blockNumber:-2,requests:0,lateResponses:0,errorResponses:0,outOfSync:-1,unsupportedEvents:0,rollingDuration:0,score:0,_network:null,_updateNumber:null,_totalTime:0,_lastFatalError:null,_lastFatalErrorTimestamp:0};async function waitForSync(config,blockNumber){while(config.blockNumber<0||config.blockNumber{try{const blockNumber=await config.provider.getBlockNumber();if(blockNumber>config.blockNumber){config.blockNumber=blockNumber}}catch(error){config.blockNumber=-2;config._lastFatalError=error;config._lastFatalErrorTimestamp=getTime()}config._updateNumber=null})()}await config._updateNumber;config.outOfSync++;if(config._lastFatalError){break}}}function _normalize(value){if(value==null){return"null"}if(Array.isArray(value)){return"["+value.map(_normalize).join(",")+"]"}if(typeof value==="object"&&typeof value.toJSON==="function"){return _normalize(value.toJSON())}switch(typeof value){case"boolean":case"symbol":return value.toString();case"bigint":case"number":return BigInt(value).toString();case"string":return JSON.stringify(value);case"object":{const keys=Object.keys(value);keys.sort();return"{"+keys.map(k=>`${JSON.stringify(k)}:${_normalize(value[k])}`).join(",")+"}"}}console.log("Could not serialize",value);throw new Error("Hmm...")}function normalizeResult(method,value){if("error"in value){const error=value.error;let tag;if(isError(error,"CALL_EXCEPTION")){tag=_normalize(Object.assign({},error,{shortMessage:undefined,reason:undefined,info:undefined}))}else{tag=_normalize(error)}return{tag:tag,value:error}}const result=value.result;return{tag:_normalize(result),value:result}}function checkQuorum(quorum,results){const tally=new Map;for(const{value,tag,weight}of results){const t=tally.get(tag)||{value:value,weight:0};t.weight+=weight;tally.set(tag,t)}let best=null;for(const r of tally.values()){if(r.weight>=quorum&&(!best||r.weight>best.weight)){best=r}}if(best){return best.value}return undefined}function getMedian(quorum,results){let resultWeight=0;const errorMap=new Map;let bestError=null;const values=[];for(const{value,tag,weight}of results){if(value instanceof Error){const e=errorMap.get(tag)||{value:value,weight:0};e.weight+=weight;errorMap.set(tag,e);if(bestError==null||e.weight>bestError.weight){bestError=e}}else{values.push(BigInt(value));resultWeight+=weight}}if(resultWeight=quorum){return bestError.value}return undefined}values.sort((a,b)=>aa?1:0);const mid=Math.floor(values.length/2);if(values.length%2){return values[mid]}return(values[mid-1]+values[mid]+BN_1)/BN_2}function getAnyResult(quorum,results){const result=checkQuorum(quorum,results);if(result!==undefined){return result}for(const r of results){if(r.value){return r.value}}return undefined}function getFuzzyMode(quorum,results){if(quorum===1){return getNumber(getMedian(quorum,results),"%internal")}const tally=new Map;const add=(result,weight)=>{const t=tally.get(result)||{result:result,weight:0};t.weight+=weight;tally.set(result,t)};for(const{weight,value}of results){const r=getNumber(value);add(r-1,weight);add(r,weight);add(r+1,weight)}let bestWeight=0;let bestResult=undefined;for(const{weight,result}of tally.values()){if(weight>=quorum&&(weight>bestWeight||bestResult!=null&&weight===bestWeight&&result>bestResult)){bestWeight=weight;bestResult=result}}return bestResult}class FallbackProvider extends AbstractProvider{quorum;eventQuorum;eventWorkers;#configs;#height;#initialSyncPromise;constructor(providers,network,options){super(network,options);this.#configs=providers.map(p=>{if(p instanceof AbstractProvider){return Object.assign({provider:p},defaultConfig,defaultState)}else{return Object.assign({},defaultConfig,p,defaultState)}});this.#height=-2;this.#initialSyncPromise=null;if(options&&options.quorum!=null){this.quorum=options.quorum}else{this.quorum=Math.ceil(this.#configs.reduce((accum,config)=>{accum+=config.weight;return accum},0)/2)}this.eventQuorum=1;this.eventWorkers=1;assertArgument(this.quorum<=this.#configs.reduce((a,c)=>a+c.weight,0),"quorum exceed provider weight","quorum",this.quorum)}get providerConfigs(){return this.#configs.map(c=>{const result=Object.assign({},c);for(const key in result){if(key[0]==="_"){delete result[key]}}return result})}async _detectNetwork(){return Network.from(getBigInt(await this._perform({method:"chainId"})))}async _translatePerform(provider,req){switch(req.method){case"broadcastTransaction":return await provider.broadcastTransaction(req.signedTransaction);case"call":return await provider.call(Object.assign({},req.transaction,{blockTag:req.blockTag}));case"chainId":return(await provider.getNetwork()).chainId;case"estimateGas":return await provider.estimateGas(req.transaction);case"getBalance":return await provider.getBalance(req.address,req.blockTag);case"getBlock":{const block="blockHash"in req?req.blockHash:req.blockTag;return await provider.getBlock(block,req.includeTransactions)}case"getBlockNumber":return await provider.getBlockNumber();case"getCode":return await provider.getCode(req.address,req.blockTag);case"getGasPrice":return(await provider.getFeeData()).gasPrice;case"getPriorityFee":return(await provider.getFeeData()).maxPriorityFeePerGas;case"getLogs":return await provider.getLogs(req.filter);case"getStorage":return await provider.getStorage(req.address,req.position,req.blockTag);case"getTransaction":return await provider.getTransaction(req.hash);case"getTransactionCount":return await provider.getTransactionCount(req.address,req.blockTag);case"getTransactionReceipt":return await provider.getTransactionReceipt(req.hash);case"getTransactionResult":return await provider.getTransactionResult(req.hash)}}#getNextConfig(running){const configs=Array.from(running).map(r=>r.config);const allConfigs=this.#configs.slice();shuffle(allConfigs);allConfigs.sort((a,b)=>a.priority-b.priority);for(const config of allConfigs){if(config._lastFatalError){continue}if(configs.indexOf(config)===-1){return config}}return null}#addRunner(running,req){const config=this.#getNextConfig(running);if(config==null){return null}const runner={config:config,result:null,didBump:false,perform:null,staller:null};const now=getTime();runner.perform=(async()=>{try{config.requests++;const result=await this._translatePerform(config.provider,req);runner.result={result:result}}catch(error){config.errorResponses++;runner.result={error:error}}const dt=getTime()-now;config._totalTime+=dt;config.rollingDuration=.95*config.rollingDuration+.05*dt;runner.perform=null})();runner.staller=(async()=>{await stall$2(config.stallTimeout);runner.staller=null})();running.add(runner);return runner}async#initialSync(){let initialSync=this.#initialSyncPromise;if(!initialSync){const promises=[];this.#configs.forEach(config=>{promises.push((async()=>{await waitForSync(config,0);if(!config._lastFatalError){config._network=await config.provider.getNetwork()}})())});this.#initialSyncPromise=initialSync=(async()=>{await Promise.all(promises);let chainId=null;for(const config of this.#configs){if(config._lastFatalError){continue}const network=config._network;if(chainId==null){chainId=network.chainId}else if(network.chainId!==chainId){assert(false,"cannot mix providers on different networks","UNSUPPORTED_OPERATION",{operation:"new FallbackProvider"})}}})()}await initialSync}async#checkQuorum(running,req){const results=[];for(const runner of running){if(runner.result!=null){const{tag,value}=normalizeResult(req.method,runner.result);results.push({tag:tag,value:value,weight:runner.config.weight})}}if(results.reduce((a,r)=>a+r.weight,0)!c._lastFatalError).map(c=>({value:c.blockNumber,tag:getNumber(c.blockNumber).toString(),weight:c.weight})))))}const mode=getFuzzyMode(this.quorum,results);if(mode===undefined){return undefined}if(mode>this.#height){this.#height=mode}return this.#height}case"getGasPrice":case"getPriorityFee":case"estimateGas":return getMedian(this.quorum,results);case"getBlock":if("blockTag"in req&&req.blockTag==="pending"){return getAnyResult(this.quorum,results)}return checkQuorum(this.quorum,results);case"call":case"chainId":case"getBalance":case"getTransactionCount":case"getCode":case"getStorage":case"getTransaction":case"getTransactionReceipt":case"getLogs":return checkQuorum(this.quorum,results);case"broadcastTransaction":return getAnyResult(this.quorum,results)}assert(false,"unsupported method","UNSUPPORTED_OPERATION",{operation:`_perform(${stringify(req.method)})`})}async#waitForQuorum(running,req){if(running.size===0){throw new Error("no runners?!")}const interesting=[];let newRunners=0;for(const runner of running){if(runner.perform){interesting.push(runner.perform)}if(runner.staller){interesting.push(runner.staller);continue}if(runner.didBump){continue}runner.didBump=true;newRunners++}const value=await this.#checkQuorum(running,req);if(value!==undefined){if(value instanceof Error){throw value}return value}for(let i=0;i0,"quorum not met","SERVER_ERROR",{request:"%sub-requests",info:{request:req,results:Array.from(running).map(r=>stringify(r.result))}});await Promise.race(interesting);return await this.#waitForQuorum(running,req)}async _perform(req){if(req.method==="broadcastTransaction"){const results=this.#configs.map(c=>null);const broadcasts=this.#configs.map(async({provider,weight},index)=>{try{const result=await provider._perform(req);results[index]=Object.assign(normalizeResult(req.method,{result:result}),{weight:weight})}catch(error){results[index]=Object.assign(normalizeResult(req.method,{error:error}),{weight:weight})}});while(true){const done=results.filter(r=>r!=null);for(const{value}of done){if(!(value instanceof Error)){return value}}const result=checkQuorum(this.quorum,results.filter(r=>r!=null));if(isError(result,"INSUFFICIENT_FUNDS")){throw result}const waiting=broadcasts.filter((b,i)=>results[i]==null);if(waiting.length===0){break}await Promise.race(waiting)}const result=getAnyResult(this.quorum,results);assert(result!==undefined,"problem multi-broadcasting","SERVER_ERROR",{request:"%sub-requests",info:{request:req,results:results.map(stringify)}});if(result instanceof Error){throw result}return result}await this.#initialSync();const running=new Set;let inflightQuorum=0;while(true){const runner=this.#addRunner(running,req);if(runner==null){break}inflightQuorum+=runner.config.weight;if(inflightQuorum>=this.quorum){break}}const result=await this.#waitForQuorum(running,req);for(const runner of running){if(runner.perform&&runner.result==null){runner.config.lateResponses++}}return result}async destroy(){for(const{provider}of this.#configs){provider.destroy()}super.destroy()}}function isWebSocketLike(value){return value&&typeof value.send==="function"&&typeof value.close==="function"}const Testnets="goerli kovan sepolia classicKotti optimism-goerli arbitrum-goerli matic-mumbai bnbt".split(" ");function getDefaultProvider(network,options){if(options==null){options={}}const allowService=name=>{if(options[name]==="-"){return false}if(typeof options.exclusive==="string"){return name===options.exclusive}if(Array.isArray(options.exclusive)){return options.exclusive.indexOf(name)!==-1}return true};if(typeof network==="string"&&network.match(/^https?:/)){return new JsonRpcProvider(network)}if(typeof network==="string"&&network.match(/^wss?:/)||isWebSocketLike(network)){return new WebSocketProvider(network)}let staticNetwork=null;try{staticNetwork=Network.from(network)}catch(error){}const providers=[];if(allowService("publicPolygon")&&staticNetwork){if(staticNetwork.name==="matic"){providers.push(new JsonRpcProvider("https://polygon-rpc.com/",staticNetwork,{staticNetwork:staticNetwork}))}else if(staticNetwork.name==="matic-amoy"){providers.push(new JsonRpcProvider("https://rpc-amoy.polygon.technology/",staticNetwork,{staticNetwork:staticNetwork}))}}if(allowService("alchemy")){try{providers.push(new AlchemyProvider(network,options.alchemy))}catch(error){}}if(allowService("ankr")&&options.ankr!=null){try{providers.push(new AnkrProvider(network,options.ankr))}catch(error){}}if(allowService("chainstack")){try{providers.push(new ChainstackProvider(network,options.chainstack))}catch(error){}}if(allowService("cloudflare")){try{providers.push(new CloudflareProvider(network))}catch(error){}}if(allowService("etherscan")){try{providers.push(new EtherscanProvider(network,options.etherscan))}catch(error){}}if(allowService("infura")){try{let projectId=options.infura;let projectSecret=undefined;if(typeof projectId==="object"){projectSecret=projectId.projectSecret;projectId=projectId.projectId}providers.push(new InfuraProvider(network,projectId,projectSecret))}catch(error){}}if(allowService("quicknode")){try{let token=options.quicknode;providers.push(new QuickNodeProvider(network,token))}catch(error){}}assert(providers.length,"unsupported default network","UNSUPPORTED_OPERATION",{operation:"getDefaultProvider"});if(providers.length===1){return providers[0]}let quorum=Math.floor(providers.length/2);if(quorum>2){quorum=2}if(staticNetwork&&Testnets.indexOf(staticNetwork.name)!==-1){quorum=1}if(options&&options.quorum){quorum=options.quorum}return new FallbackProvider(providers,undefined,{quorum:quorum})}class NonceManager extends AbstractSigner{signer;#noncePromise;#delta;constructor(signer){super(signer.provider);defineProperties(this,{signer:signer});this.#noncePromise=null;this.#delta=0}async getAddress(){return this.signer.getAddress()}connect(provider){return new NonceManager(this.signer.connect(provider))}async getNonce(blockTag){if(blockTag==="pending"){if(this.#noncePromise==null){this.#noncePromise=super.getNonce("pending")}const delta=this.#delta;return await this.#noncePromise+delta}return super.getNonce(blockTag)}increment(){this.#delta++}reset(){this.#delta=0;this.#noncePromise=null}async sendTransaction(tx){const noncePromise=this.getNonce("pending");this.increment();tx=await this.signer.populateTransaction(tx);tx.nonce=await noncePromise;return await this.signer.sendTransaction(tx)}signTransaction(tx){return this.signer.signTransaction(tx)}signMessage(message){return this.signer.signMessage(message)}signTypedData(domain,types,value){return this.signer.signTypedData(domain,types,value)}}class BrowserProvider extends JsonRpcApiPollingProvider{#request;#providerInfo;constructor(ethereum,network,_options){const options=Object.assign({},_options!=null?_options:{},{batchMaxCount:1});assertArgument(ethereum&ðereum.request,"invalid EIP-1193 provider","ethereum",ethereum);super(network,options);this.#providerInfo=null;if(_options&&_options.providerInfo){this.#providerInfo=_options.providerInfo}this.#request=async(method,params)=>{const payload={method:method,params:params};this.emit("debug",{action:"sendEip1193Request",payload:payload});try{const result=await ethereum.request(payload);this.emit("debug",{action:"receiveEip1193Result",result:result});return result}catch(e){const error=new Error(e.message);error.code=e.code;error.data=e.data;error.payload=payload;this.emit("debug",{action:"receiveEip1193Error",error:error});throw error}}}get providerInfo(){return this.#providerInfo}async send(method,params){await this._start();return await super.send(method,params)}async _send(payload){assertArgument(!Array.isArray(payload),"EIP-1193 does not support batch request","payload",payload);try{const result=await this.#request(payload.method,payload.params||[]);return[{id:payload.id,result:result}]}catch(e){return[{id:payload.id,error:{code:e.code,data:e.data,message:e.message}}]}}getRpcError(payload,error){error=JSON.parse(JSON.stringify(error));switch(error.error.code||-1){case 4001:error.error.message=`ethers-user-denied: ${error.error.message}`;break;case 4200:error.error.message=`ethers-unsupported: ${error.error.message}`;break}return super.getRpcError(payload,error)}async hasSigner(address){if(address==null){address=0}const accounts=await this.send("eth_accounts",[]);if(typeof address==="number"){return accounts.length>address}address=address.toLowerCase();return accounts.filter(a=>a.toLowerCase()===address).length!==0}async getSigner(address){if(address==null){address=0}if(!await this.hasSigner(address)){try{await this.#request("eth_requestAccounts",[])}catch(error){const payload=error.payload;throw this.getRpcError(payload,{id:payload.id,error:error})}}return await super.getSigner(address)}static async discover(options){if(options==null){options={}}if(options.provider){return new BrowserProvider(options.provider)}const context=options.window?options.window:typeof window!=="undefined"?window:null;if(context==null){return null}const anyProvider=options.anyProvider;if(anyProvider&&context.ethereum){return new BrowserProvider(context.ethereum)}if(!("addEventListener"in context&&"dispatchEvent"in context&&"removeEventListener"in context)){return null}const timeout=options.timeout?options.timeout:300;if(timeout===0){return null}return await new Promise((resolve,reject)=>{let found=[];const addProvider=event=>{found.push(event.detail);if(anyProvider){finalize()}};const finalize=()=>{clearTimeout(timer);if(found.length){if(options&&options.filter){const filtered=options.filter(found.map(i=>Object.assign({},i.info)));if(filtered==null){resolve(null)}else if(filtered instanceof BrowserProvider){resolve(filtered)}else{let match=null;if(filtered.uuid){const matches=found.filter(f=>filtered.uuid===f.info.uuid);match=matches[0]}if(match){const{provider,info}=match;resolve(new BrowserProvider(provider,undefined,{providerInfo:info}))}else{reject(makeError("filter returned unknown info","UNSUPPORTED_OPERATION",{value:filtered}))}}}else{const{provider,info}=found[0];resolve(new BrowserProvider(provider,undefined,{providerInfo:info}))}}else{resolve(null)}context.removeEventListener("eip6963:announceProvider",addProvider)};const timer=setTimeout(()=>{finalize()},timeout);context.addEventListener("eip6963:announceProvider",addProvider);context.dispatchEvent(new Event("eip6963:requestProvider"))})}}function getUrl(name){switch(name){case"mainnet":return"https://eth.blockscout.com/api/eth-rpc";case"sepolia":return"https://eth-sepolia.blockscout.com/api/eth-rpc";case"holesky":return"https://eth-holesky.blockscout.com/api/eth-rpc";case"classic":return"https://etc.blockscout.com/api/eth-rpc";case"arbitrum":return"https://arbitrum.blockscout.com/api/eth-rpc";case"base":return"https://base.blockscout.com/api/eth-rpc";case"base-sepolia":return"https://base-sepolia.blockscout.com/api/eth-rpc";case"matic":return"https://polygon.blockscout.com/api/eth-rpc";case"optimism":return"https://optimism.blockscout.com/api/eth-rpc";case"optimism-sepolia":return"https://optimism-sepolia.blockscout.com/api/eth-rpc";case"xdai":return"https://gnosis.blockscout.com/api/eth-rpc"}assertArgument(false,"unsupported network","network",name)}class BlockscoutProvider extends JsonRpcProvider{apiKey;constructor(_network,apiKey){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(apiKey==null){apiKey=null}const request=BlockscoutProvider.getRequest(network);super(request,network,{staticNetwork:network});defineProperties(this,{apiKey:apiKey})}_getProvider(chainId){try{return new BlockscoutProvider(chainId,this.apiKey)}catch(error){}return super._getProvider(chainId)}isCommunityResource(){return this.apiKey===null}getRpcRequest(req){const resp=super.getRpcRequest(req);if(resp&&resp.method==="eth_estimateGas"&&resp.args.length==1){resp.args=resp.args.slice();resp.args.push("latest")}return resp}getRpcError(payload,_error){const error=_error?_error.error:null;if(error&&error.code===-32015&&!isHexString(error.data||"",true)){const panicCodes={"assert(false)":"01","arithmetic underflow or overflow":"11","division or modulo by zero":"12","out-of-bounds array access; popping on an empty array":"31","out-of-bounds access of an array or bytesN":"32"};let panicCode="";if(error.message==="VM execution error."){panicCode=panicCodes[error.data]||""}else if(panicCodes[error.message||""]){panicCode=panicCodes[error.message||""]}if(panicCode){error.message+=` (reverted: ${error.data})`;error.data="0x4e487b7100000000000000000000000000000000000000000000000000000000000000"+panicCode}}else if(error&&error.code===-32e3){if(error.message==="wrong transaction nonce"){error.message+=" (nonce too low)"}}return super.getRpcError(payload,_error)}static getRequest(network){const request=new FetchRequest(getUrl(network.name));request.allowGzip=true;return request}}const defaultApplicationId="62e1ad51b37b8e00394bda3b";function getHost(name){switch(name){case"mainnet":return"eth-mainnet.gateway.pokt.network";case"goerli":return"eth-goerli.gateway.pokt.network";case"matic":return"poly-mainnet.gateway.pokt.network";case"matic-mumbai":return"polygon-mumbai-rpc.gateway.pokt.network"}assertArgument(false,"unsupported network","network",name)}class PocketProvider extends JsonRpcProvider{applicationId;applicationSecret;constructor(_network,applicationId,applicationSecret){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(applicationId==null){applicationId=defaultApplicationId}if(applicationSecret==null){applicationSecret=null}const options={staticNetwork:network};const request=PocketProvider.getRequest(network,applicationId,applicationSecret);super(request,network,options);defineProperties(this,{applicationId:applicationId,applicationSecret:applicationSecret})}_getProvider(chainId){try{return new PocketProvider(chainId,this.applicationId,this.applicationSecret)}catch(error){}return super._getProvider(chainId)}static getRequest(network,applicationId,applicationSecret){if(applicationId==null){applicationId=defaultApplicationId}const request=new FetchRequest(`https:/\/${getHost(network.name)}/v1/lb/${applicationId}`);request.allowGzip=true;if(applicationSecret){request.setCredentials("",applicationSecret)}if(applicationId===defaultApplicationId){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("PocketProvider");return true}}return request}isCommunityResource(){return this.applicationId===defaultApplicationId}}const IpcSocketProvider=undefined;class BaseWallet extends AbstractSigner{address;#signingKey;constructor(privateKey,provider){super(provider);assertArgument(privateKey&&typeof privateKey.sign==="function","invalid private key","privateKey","[ REDACTED ]");this.#signingKey=privateKey;const address=computeAddress(this.signingKey.publicKey);defineProperties(this,{address:address})}get signingKey(){return this.#signingKey}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(provider){return new BaseWallet(this.#signingKey,provider)}async signTransaction(tx){tx=copyRequest(tx);const{to,from}=await resolveProperties({to:tx.to?resolveAddress(tx.to,this):undefined,from:tx.from?resolveAddress(tx.from,this):undefined});if(to!=null){tx.to=to}if(from!=null){tx.from=from}if(tx.from!=null){assertArgument(getAddress(tx.from)===this.address,"transaction from address mismatch","tx.from",tx.from);delete tx.from}const btx=Transaction.from(tx);btx.signature=this.signingKey.sign(btx.unsignedHash);return btx.serialized}async signMessage(message){return this.signMessageSync(message)}signMessageSync(message){return this.signingKey.sign(hashMessage(message)).serialized}authorizeSync(auth){assertArgument(typeof auth.address==="string","invalid address for authorizeSync","auth.address",auth);const signature=this.signingKey.sign(hashAuthorization(auth));return Object.assign({},{address:getAddress(auth.address),nonce:getBigInt(auth.nonce||0),chainId:getBigInt(auth.chainId||0)},{signature:signature})}async authorize(auth){auth=Object.assign({},auth,{address:await resolveAddress(auth.address,this)});return this.authorizeSync(await this.populateAuthorization(auth))}async signTypedData(domain,types,value){const populated=await TypedDataEncoder.resolveNames(domain,types,value,async name=>{assert(this.provider!=null,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:name}});const address=await this.provider.resolveName(name);assert(address!=null,"unconfigured ENS name","UNCONFIGURED_NAME",{value:name});return address});return this.signingKey.sign(TypedDataEncoder.hash(populated.domain,types,populated.value)).serialized}}const subsChrs=" !#$%&'()*+,-./<=>?@[]^_`{|}~";const Word=/^[a-z]*$/i;function unfold(words,sep){let initial=97;return words.reduce((accum,word)=>{if(word===sep){initial++}else if(word.match(Word)){accum.push(String.fromCharCode(initial)+word)}else{initial=97;accum.push(word)}return accum},[])}function decode(data,subs){for(let i=subsChrs.length-1;i>=0;i--){data=data.split(subsChrs[i]).join(subs.substring(2*i,2*i+2))}const clumps=[];const leftover=data.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(all,item,semi,word)=>{if(semi){for(let i=parseInt(semi);i>=0;i--){clumps.push(";")}}else{clumps.push(item.toLowerCase())}return""});if(leftover){throw new Error(`leftovers: ${JSON.stringify(leftover)}`)}return unfold(unfold(clumps,";"),":")}function decodeOwl(data){assertArgument(data[0]==="0","unsupported auwl data","data",data);return decode(data.substring(1+2*subsChrs.length),data.substring(1,1+2*subsChrs.length))}class Wordlist{locale;constructor(locale){defineProperties(this,{locale:locale})}split(phrase){return phrase.toLowerCase().split(/\s+/g)}join(words){return words.join(" ")}}class WordlistOwl extends Wordlist{#data;#checksum;constructor(locale,data,checksum){super(locale);this.#data=data;this.#checksum=checksum;this.#words=null}get _data(){return this.#data}_decodeWords(){return decodeOwl(this.#data)}#words;#loadWords(){if(this.#words==null){const words=this._decodeWords();const checksum=id(words.join("\n")+"\n");if(checksum!==this.#checksum){throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`)}this.#words=words}return this.#words}getWord(index){const words=this.#loadWords();assertArgument(index>=0&&index=12&&words.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const entropy=new Uint8Array(Math.ceil(11*words.length/8));let offset=0;for(let i=0;i=0,`invalid mnemonic word at index ${i}`,"mnemonic","[ REDACTED ]");for(let bit=0;bit<11;bit++){if(index&1<<10-bit){entropy[offset>>3]|=1<<7-offset%8}offset++}}const entropyBits=32*words.length/3;const checksumBits=words.length/3;const checksumMask=getUpperMask(checksumBits);const checksum=getBytes(sha256(entropy.slice(0,entropyBits/8)))[0]&checksumMask;assertArgument(checksum===(entropy[entropy.length-1]&checksumMask),"invalid mnemonic checksum","mnemonic","[ REDACTED ]");return hexlify(entropy.slice(0,entropyBits/8))}function entropyToMnemonic(entropy,wordlist){assertArgument(entropy.length%4===0&&entropy.length>=16&&entropy.length<=32,"invalid entropy size","entropy","[ REDACTED ]");if(wordlist==null){wordlist=LangEn.wordlist()}const indices=[0];let remainingBits=11;for(let i=0;i8){indices[indices.length-1]<<=8;indices[indices.length-1]|=entropy[i];remainingBits-=8}else{indices[indices.length-1]<<=remainingBits;indices[indices.length-1]|=entropy[i]>>8-remainingBits;indices.push(entropy[i]&getLowerMask(8-remainingBits));remainingBits+=3}}const checksumBits=entropy.length/4;const checksum=parseInt(sha256(entropy).substring(2,4),16)&getUpperMask(checksumBits);indices[indices.length-1]<<=checksumBits;indices[indices.length-1]|=checksum>>8-checksumBits;return wordlist.join(indices.map(index=>wordlist.getWord(index)))}const _guard$1={};class Mnemonic{phrase;password;wordlist;entropy;constructor(guard,entropy,phrase,password,wordlist){if(password==null){password=""}if(wordlist==null){wordlist=LangEn.wordlist()}assertPrivate(guard,_guard$1,"Mnemonic");defineProperties(this,{phrase:phrase,password:password,wordlist:wordlist,entropy:entropy})}computeSeed(){const salt=toUtf8Bytes("mnemonic"+this.password,"NFKD");return pbkdf2(toUtf8Bytes(this.phrase,"NFKD"),salt,2048,64,"sha512")}static fromPhrase(phrase,password,wordlist){const entropy=mnemonicToEntropy(phrase,wordlist);phrase=entropyToMnemonic(getBytes(entropy),wordlist);return new Mnemonic(_guard$1,entropy,phrase,password,wordlist)}static fromEntropy(_entropy,password,wordlist){const entropy=getBytes(_entropy,"entropy");const phrase=entropyToMnemonic(entropy,wordlist);return new Mnemonic(_guard$1,hexlify(entropy),phrase,password,wordlist)}static entropyToPhrase(_entropy,wordlist){const entropy=getBytes(_entropy,"entropy");return entropyToMnemonic(entropy,wordlist)}static phraseToEntropy(phrase,wordlist){return mnemonicToEntropy(phrase,wordlist)}static isValidMnemonic(phrase,wordlist){try{mnemonicToEntropy(phrase,wordlist);return true}catch(error){}return false}}var __classPrivateFieldGet$2=__$G&&__$G.__classPrivateFieldGet||function(receiver,state,kind,f){if(kind==="a"&&!f)throw new TypeError("Private accessor was defined without a getter");if(typeof state==="function"?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return kind==="m"?f:kind==="a"?f.call(receiver):f?f.value:state.get(receiver)};var __classPrivateFieldSet$2=__$G&&__$G.__classPrivateFieldSet||function(receiver,state,value,kind,f){if(kind==="m")throw new TypeError("Private method is not writable");if(kind==="a"&&!f)throw new TypeError("Private accessor was defined without a setter");if(typeof state==="function"?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return kind==="a"?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value};var _AES_key,_AES_Kd,_AES_Ke;const numberOfRounds={16:10,24:12,32:14};const rcon=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145];const S=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22];const Si=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125];const T1=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986];const T2=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766];const T3=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126];const T4=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436];const T5=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890];const T6=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935];const T7=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600];const T8=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480];const U1=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795];const U2=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855];const U3=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150];const U4=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function convertToInt32(bytes){const result=[];for(let i=0;i>2;__classPrivateFieldGet$2(this,_AES_Ke,"f")[index][i%4]=tk[i];__classPrivateFieldGet$2(this,_AES_Kd,"f")[rounds-index][i%4]=tk[i]}let rconpointer=0;let t=KC,tt;while(t>16&255]<<24^S[tt>>8&255]<<16^S[tt&255]<<8^S[tt>>24&255]^rcon[rconpointer]<<24;rconpointer+=1;if(KC!=8){for(let i=1;i>8&255]<<8^S[tt>>16&255]<<16^S[tt>>24&255]<<24;for(let i=KC/2+1;i>2;c=t%4;__classPrivateFieldGet$2(this,_AES_Ke,"f")[r][c]=tk[i];__classPrivateFieldGet$2(this,_AES_Kd,"f")[rounds-r][c]=tk[i++];t++}}for(let r=1;r>24&255]^U2[tt>>16&255]^U3[tt>>8&255]^U4[tt&255]}}}encrypt(plaintext){if(plaintext.length!=16){throw new TypeError("invalid plaintext size (must be 16 bytes)")}const rounds=__classPrivateFieldGet$2(this,_AES_Ke,"f").length-1;const a=[0,0,0,0];let t=convertToInt32(plaintext);for(let i=0;i<4;i++){t[i]^=__classPrivateFieldGet$2(this,_AES_Ke,"f")[0][i]}for(let r=1;r>24&255]^T2[t[(i+1)%4]>>16&255]^T3[t[(i+2)%4]>>8&255]^T4[t[(i+3)%4]&255]^__classPrivateFieldGet$2(this,_AES_Ke,"f")[r][i]}t=a.slice()}const result=new Uint8Array(16);let tt=0;for(let i=0;i<4;i++){tt=__classPrivateFieldGet$2(this,_AES_Ke,"f")[rounds][i];result[4*i]=(S[t[i]>>24&255]^tt>>24)&255;result[4*i+1]=(S[t[(i+1)%4]>>16&255]^tt>>16)&255;result[4*i+2]=(S[t[(i+2)%4]>>8&255]^tt>>8)&255;result[4*i+3]=(S[t[(i+3)%4]&255]^tt)&255}return result}decrypt(ciphertext){if(ciphertext.length!=16){throw new TypeError("invalid ciphertext size (must be 16 bytes)")}const rounds=__classPrivateFieldGet$2(this,_AES_Kd,"f").length-1;const a=[0,0,0,0];let t=convertToInt32(ciphertext);for(let i=0;i<4;i++){t[i]^=__classPrivateFieldGet$2(this,_AES_Kd,"f")[0][i]}for(let r=1;r>24&255]^T6[t[(i+3)%4]>>16&255]^T7[t[(i+2)%4]>>8&255]^T8[t[(i+1)%4]&255]^__classPrivateFieldGet$2(this,_AES_Kd,"f")[r][i]}t=a.slice()}const result=new Uint8Array(16);let tt=0;for(let i=0;i<4;i++){tt=__classPrivateFieldGet$2(this,_AES_Kd,"f")[rounds][i];result[4*i]=(Si[t[i]>>24&255]^tt>>24)&255;result[4*i+1]=(Si[t[(i+3)%4]>>16&255]^tt>>16)&255;result[4*i+2]=(Si[t[(i+2)%4]>>8&255]^tt>>8)&255;result[4*i+3]=(Si[t[(i+1)%4]&255]^tt)&255}return result}}_AES_key=new WeakMap,_AES_Kd=new WeakMap,_AES_Ke=new WeakMap;class ModeOfOperation{constructor(name,key,cls){if(cls&&!(this instanceof cls)){throw new Error(`${name} must be instantiated with "new"`)}Object.defineProperties(this,{aes:{enumerable:true,value:new AES(key)},name:{enumerable:true,value:name}})}}var __classPrivateFieldSet$1=__$G&&__$G.__classPrivateFieldSet||function(receiver,state,value,kind,f){if(kind==="m")throw new TypeError("Private method is not writable");if(kind==="a"&&!f)throw new TypeError("Private accessor was defined without a setter");if(typeof state==="function"?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return kind==="a"?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value};var __classPrivateFieldGet$1=__$G&&__$G.__classPrivateFieldGet||function(receiver,state,kind,f){if(kind==="a"&&!f)throw new TypeError("Private accessor was defined without a getter");if(typeof state==="function"?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return kind==="m"?f:kind==="a"?f.call(receiver):f?f.value:state.get(receiver)};var _CBC_iv,_CBC_lastBlock;class CBC extends ModeOfOperation{constructor(key,iv){super("ECC",key,CBC);_CBC_iv.set(this,void 0);_CBC_lastBlock.set(this,void 0);if(iv){if(iv.length%16){throw new TypeError("invalid iv size (must be 16 bytes)")}__classPrivateFieldSet$1(this,_CBC_iv,new Uint8Array(iv),"f")}else{__classPrivateFieldSet$1(this,_CBC_iv,new Uint8Array(16),"f")}__classPrivateFieldSet$1(this,_CBC_lastBlock,this.iv,"f")}get iv(){return new Uint8Array(__classPrivateFieldGet$1(this,_CBC_iv,"f"))}encrypt(plaintext){if(plaintext.length%16){throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)")}const ciphertext=new Uint8Array(plaintext.length);for(let i=0;iNumber.MAX_SAFE_INTEGER){throw new TypeError("invalid counter initial integer value")}for(let index=15;index>=0;--index){__classPrivateFieldGet(this,_CTR_counter,"f")[index]=value%256;value=Math.floor(value/256)}}setCounterBytes(value){if(value.length!==16){throw new TypeError("invalid counter initial Uint8Array value length")}__classPrivateFieldGet(this,_CTR_counter,"f").set(value)}increment(){for(let i=15;i>=0;i--){if(__classPrivateFieldGet(this,_CTR_counter,"f")[i]===255){__classPrivateFieldGet(this,_CTR_counter,"f")[i]=0}else{__classPrivateFieldGet(this,_CTR_counter,"f")[i]++;break}}}encrypt(plaintext){var _a,_b;const crypttext=new Uint8Array(plaintext);for(let i=0;i16){throw new TypeError("PKCS#7 padding byte out of range")}const length=data.length-padder;for(let i=0;i0&&(N&N-1)===0,"invalid kdf.N","kdf.N",N);assertArgument(r>0&&p>0,"invalid kdf","kdf",kdf);const dkLen=spelunk(data,"crypto.kdfparams.dklen:int!");assertArgument(dkLen===32,"invalid kdf.dklen","kdf.dflen",dkLen);return{name:"scrypt",salt:salt,N:N,r:r,p:p,dkLen:64}}else if(kdf.toLowerCase()==="pbkdf2"){const salt=spelunk(data,"crypto.kdfparams.salt:data!");const prf=spelunk(data,"crypto.kdfparams.prf:string!");const algorithm=prf.split("-").pop();assertArgument(algorithm==="sha256"||algorithm==="sha512","invalid kdf.pdf","kdf.pdf",prf);const count=spelunk(data,"crypto.kdfparams.c:int!");const dkLen=spelunk(data,"crypto.kdfparams.dklen:int!");assertArgument(dkLen===32,"invalid kdf.dklen","kdf.dklen",dkLen);return{name:"pbkdf2",salt:salt,count:count,dkLen:dkLen,algorithm:algorithm}}}assertArgument(false,"unsupported key-derivation function","kdf",kdf)}function decryptKeystoreJsonSync(json,_password){const data=JSON.parse(json);const password=getPassword(_password);const params=getDecryptKdfParams(data);if(params.name==="pbkdf2"){const{salt,count,dkLen,algorithm}=params;const key=pbkdf2(password,salt,count,dkLen,algorithm);return getAccount(data,key)}assert(params.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:params});const{salt,N,r,p,dkLen}=params;const key=scryptSync(password,salt,N,r,p,dkLen);return getAccount(data,key)}function stall$1(duration){return new Promise(resolve=>{setTimeout(()=>{resolve()},duration)})}async function decryptKeystoreJson(json,_password,progress){const data=JSON.parse(json);const password=getPassword(_password);const params=getDecryptKdfParams(data);if(params.name==="pbkdf2"){if(progress){progress(0);await stall$1(0)}const{salt,count,dkLen,algorithm}=params;const key=pbkdf2(password,salt,count,dkLen,algorithm);if(progress){progress(1);await stall$1(0)}return getAccount(data,key)}assert(params.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:params});const{salt,N,r,p,dkLen}=params;const key=await scrypt(password,salt,N,r,p,dkLen,progress);return getAccount(data,key)}function getEncryptKdfParams(options){const salt=options.salt!=null?getBytes(options.salt,"options.salt"):randomBytes(32);let N=1<<17,r=8,p=1;if(options.scrypt){if(options.scrypt.N){N=options.scrypt.N}if(options.scrypt.r){r=options.scrypt.r}if(options.scrypt.p){p=options.scrypt.p}}assertArgument(typeof N==="number"&&N>0&&Number.isSafeInteger(N)&&(BigInt(N)&BigInt(N-1))===BigInt(0),"invalid scrypt N parameter","options.N",N);assertArgument(typeof r==="number"&&r>0&&Number.isSafeInteger(r),"invalid scrypt r parameter","options.r",r);assertArgument(typeof p==="number"&&p>0&&Number.isSafeInteger(p),"invalid scrypt p parameter","options.p",p);return{name:"scrypt",dkLen:32,salt:salt,N:N,r:r,p:p}}function _encryptKeystore(key,kdf,account,options){const privateKey=getBytes(account.privateKey,"privateKey");const iv=options.iv!=null?getBytes(options.iv,"options.iv"):randomBytes(16);assertArgument(iv.length===16,"invalid options.iv length","options.iv",options.iv);const uuidRandom=options.uuid!=null?getBytes(options.uuid,"options.uuid"):randomBytes(16);assertArgument(uuidRandom.length===16,"invalid options.uuid length","options.uuid",options.iv);const derivedKey=key.slice(0,16);const macPrefix=key.slice(16,32);const aesCtr=new CTR(derivedKey,iv);const ciphertext=getBytes(aesCtr.encrypt(privateKey));const mac=keccak256(concat([macPrefix,ciphertext]));const data={address:account.address.substring(2).toLowerCase(),id:uuidV4(uuidRandom),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:hexlify(iv).substring(2)},ciphertext:hexlify(ciphertext).substring(2),kdf:"scrypt",kdfparams:{salt:hexlify(kdf.salt).substring(2),n:kdf.N,dklen:32,p:kdf.p,r:kdf.r},mac:mac.substring(2)}};if(account.mnemonic){const client=options.client!=null?options.client:`ethers/${version}`;const path=account.mnemonic.path||defaultPath$1;const locale=account.mnemonic.locale||"en";const mnemonicKey=key.slice(32,64);const entropy=getBytes(account.mnemonic.entropy,"account.mnemonic.entropy");const mnemonicIv=randomBytes(16);const mnemonicAesCtr=new CTR(mnemonicKey,mnemonicIv);const mnemonicCiphertext=getBytes(mnemonicAesCtr.encrypt(entropy));const now=new Date;const timestamp=now.getUTCFullYear()+"-"+zpad$1(now.getUTCMonth()+1,2)+"-"+zpad$1(now.getUTCDate(),2)+"T"+zpad$1(now.getUTCHours(),2)+"-"+zpad$1(now.getUTCMinutes(),2)+"-"+zpad$1(now.getUTCSeconds(),2)+".0Z";const gethFilename="UTC--"+timestamp+"--"+data.address;data["x-ethers"]={client:client,gethFilename:gethFilename,path:path,locale:locale,mnemonicCounter:hexlify(mnemonicIv).substring(2),mnemonicCiphertext:hexlify(mnemonicCiphertext).substring(2),version:"0.1"}}return JSON.stringify(data)}function encryptKeystoreJsonSync(account,password,options){if(options==null){options={}}const passwordBytes=getPassword(password);const kdf=getEncryptKdfParams(options);const key=scryptSync(passwordBytes,kdf.salt,kdf.N,kdf.r,kdf.p,64);return _encryptKeystore(getBytes(key),kdf,account,options)}async function encryptKeystoreJson(account,password,options){if(options==null){options={}}const passwordBytes=getPassword(password);const kdf=getEncryptKdfParams(options);const key=await scrypt(passwordBytes,kdf.salt,kdf.N,kdf.r,kdf.p,64,options.progressCallback);return _encryptKeystore(getBytes(key),kdf,account,options)}const defaultPath="m/44'/60'/0'/0/0";const MasterSecret=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]);const HardenedBit=2147483648;const N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");const Nibbles="0123456789abcdef";function zpad(value,length){let result="";while(value){result=Nibbles[value%16]+result;value=Math.trunc(value/16)}while(result.length=0;i-=8){data[33+(i>>3)]=index>>24-i&255}const I=getBytes(computeHmac("sha512",chainCode,data));return{IL:I.slice(0,32),IR:I.slice(32)}}function derivePath(node,path){const components=path.split("/");assertArgument(components.length>0,"invalid path","path",path);if(components[0]==="m"){assertArgument(node.depth===0,`cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${node.depth}`,"path",path);components.shift()}let result=node;for(let i=0;i=16&&seed.length<=64,"invalid seed","seed","[REDACTED]");const I=getBytes(computeHmac("sha512",MasterSecret,seed));const signingKey=new SigningKey(hexlify(I.slice(0,32)));return new HDNodeWallet(_guard,signingKey,"0x00000000",hexlify(I.slice(32)),"m",0,0,mnemonic,null)}static fromExtendedKey(extendedKey){const bytes=toBeArray(decodeBase58(extendedKey));assertArgument(bytes.length===82||encodeBase58Check(bytes.slice(0,78))===extendedKey,"invalid extended key","extendedKey","[ REDACTED ]");const depth=bytes[4];const parentFingerprint=hexlify(bytes.slice(5,9));const index=parseInt(hexlify(bytes.slice(9,13)).substring(2),16);const chainCode=hexlify(bytes.slice(13,45));const key=bytes.slice(45,78);switch(hexlify(bytes.slice(0,4))){case"0x0488b21e":case"0x043587cf":{const publicKey=hexlify(key);return new HDNodeVoidWallet(_guard,computeAddress(publicKey),publicKey,parentFingerprint,chainCode,null,index,depth,null)}case"0x0488ade4":case"0x04358394 ":if(key[0]!==0){break}return new HDNodeWallet(_guard,new SigningKey(key.slice(1)),parentFingerprint,chainCode,null,index,depth,null,null)}assertArgument(false,"invalid extended key prefix","extendedKey","[ REDACTED ]")}static createRandom(password,path,wordlist){if(password==null){password=""}if(path==null){path=defaultPath}if(wordlist==null){wordlist=LangEn.wordlist()}const mnemonic=Mnemonic.fromEntropy(randomBytes(16),password,wordlist);return HDNodeWallet.#fromSeed(mnemonic.computeSeed(),mnemonic).derivePath(path)}static fromMnemonic(mnemonic,path){if(!path){path=defaultPath}return HDNodeWallet.#fromSeed(mnemonic.computeSeed(),mnemonic).derivePath(path)}static fromPhrase(phrase,password,path,wordlist){if(password==null){password=""}if(path==null){path=defaultPath}if(wordlist==null){wordlist=LangEn.wordlist()}const mnemonic=Mnemonic.fromPhrase(phrase,password,wordlist);return HDNodeWallet.#fromSeed(mnemonic.computeSeed(),mnemonic).derivePath(path)}static fromSeed(seed){return HDNodeWallet.#fromSeed(seed,null)}}class HDNodeVoidWallet extends VoidSigner{publicKey;fingerprint;parentFingerprint;chainCode;path;index;depth;constructor(guard,address,publicKey,parentFingerprint,chainCode,path,index,depth,provider){super(address,provider);assertPrivate(guard,_guard,"HDNodeVoidWallet");defineProperties(this,{publicKey:publicKey});const fingerprint=dataSlice(ripemd160(sha256(publicKey)),0,4);defineProperties(this,{publicKey:publicKey,fingerprint:fingerprint,parentFingerprint:parentFingerprint,chainCode:chainCode,path:path,index:index,depth:depth})}connect(provider){return new HDNodeVoidWallet(_guard,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,provider)}get extendedKey(){assert(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"});return encodeBase58Check(concat(["0x0488B21E",zpad(this.depth,1),this.parentFingerprint,zpad(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return this.path!=null}deriveChild(_index){const index=getNumber(_index,"index");assertArgument(index<=4294967295,"invalid index","index",index);let path=this.path;if(path){path+="/"+(index&~HardenedBit);if(index&HardenedBit){path+="'"}}const{IR,IL}=ser_I(index,this.chainCode,this.publicKey,null);const Ki=SigningKey.addPoints(IL,this.publicKey,true);const address=computeAddress(Ki);return new HDNodeVoidWallet(_guard,address,Ki,this.fingerprint,hexlify(IR),path,index,this.depth+1,this.provider)}derivePath(path){return derivePath(this,path)}}function getAccountPath(_index){const index=getNumber(_index,"index");assertArgument(index>=0&&index=0&&index{setTimeout(()=>{resolve()},duration)})}class Wallet extends BaseWallet{constructor(key,provider){if(typeof key==="string"&&!key.startsWith("0x")){key="0x"+key}let signingKey=typeof key==="string"?new SigningKey(key):key;super(signingKey,provider)}connect(provider){return new Wallet(this.signingKey,provider)}async encrypt(password,progressCallback){const account={address:this.address,privateKey:this.privateKey};return await encryptKeystoreJson(account,password,{progressCallback:progressCallback})}encryptSync(password){const account={address:this.address,privateKey:this.privateKey};return encryptKeystoreJsonSync(account,password)}static#fromAccount(account){assertArgument(account,"invalid JSON wallet","json","[ REDACTED ]");if("mnemonic"in account&&account.mnemonic&&account.mnemonic.locale==="en"){const mnemonic=Mnemonic.fromEntropy(account.mnemonic.entropy);const wallet=HDNodeWallet.fromMnemonic(mnemonic,account.mnemonic.path);if(wallet.address===account.address&&wallet.privateKey===account.privateKey){return wallet}console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}const wallet=new Wallet(account.privateKey);assertArgument(wallet.address===account.address,"address/privateKey mismatch","json","[ REDACTED ]");return wallet}static async fromEncryptedJson(json,password,progress){let account=null;if(isKeystoreJson(json)){account=await decryptKeystoreJson(json,password,progress)}else if(isCrowdsaleJson(json)){if(progress){progress(0);await stall(0)}account=decryptCrowdsaleJson(json,password);if(progress){progress(1);await stall(0)}}return Wallet.#fromAccount(account)}static fromEncryptedJsonSync(json,password){let account=null;if(isKeystoreJson(json)){account=decryptKeystoreJsonSync(json,password)}else if(isCrowdsaleJson(json)){account=decryptCrowdsaleJson(json,password)}else{assertArgument(false,"invalid JSON wallet","json","[ REDACTED ]")}return Wallet.#fromAccount(account)}static createRandom(provider){const wallet=HDNodeWallet.createRandom();if(provider){return wallet.connect(provider)}return wallet}static fromPhrase(phrase,provider){const wallet=HDNodeWallet.fromPhrase(phrase);if(provider){return wallet.connect(provider)}return wallet}}const Base64=")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_";function decodeBits(width,data){const maxValue=(1<=width){const value=accum>>bits-width;accum&=(1<{const match=accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);assertArgument(match!==null,"internal error parsing accents","accents",accents);let posOffset=0;const positions=decodeBits(parseInt(match[3]),match[4]);const charCode=parseInt(match[2]);const regex=new RegExp(`([${match[1]}])`,"g");words=words.replace(regex,(all,letter)=>{const rem=--positions[posOffset];if(rem===0){letter=String.fromCharCode(letter.charCodeAt(0),charCode);posOffset++}return letter})});return words.split(",")}class WordlistOwlA extends WordlistOwl{#accent;constructor(locale,data,accent,checksum){super(locale,data,checksum);this.#accent=accent}get _accent(){return this.#accent}_decodeWords(){return decodeOwlA(this._data,this._accent)}}const wordlists={en:LangEn.wordlist()};var ethers=Object.freeze({__proto__:null,AbiCoder:AbiCoder,AbstractProvider:AbstractProvider,AbstractSigner:AbstractSigner,AlchemyProvider:AlchemyProvider,AnkrProvider:AnkrProvider,BaseContract:BaseContract,BaseWallet:BaseWallet,Block:Block,BlockscoutProvider:BlockscoutProvider,BrowserProvider:BrowserProvider,ChainstackProvider:ChainstackProvider,CloudflareProvider:CloudflareProvider,ConstructorFragment:ConstructorFragment,Contract:Contract,ContractEventPayload:ContractEventPayload,ContractFactory:ContractFactory,ContractTransactionReceipt:ContractTransactionReceipt,ContractTransactionResponse:ContractTransactionResponse,ContractUnknownEventPayload:ContractUnknownEventPayload,EnsPlugin:EnsPlugin,EnsResolver:EnsResolver,ErrorDescription:ErrorDescription,ErrorFragment:ErrorFragment,EtherSymbol:EtherSymbol,EtherscanPlugin:EtherscanPlugin,EtherscanProvider:EtherscanProvider,EventFragment:EventFragment,EventLog:EventLog,EventPayload:EventPayload,FallbackFragment:FallbackFragment,FallbackProvider:FallbackProvider,FeeData:FeeData,FeeDataNetworkPlugin:FeeDataNetworkPlugin,FetchCancelSignal:FetchCancelSignal,FetchRequest:FetchRequest,FetchResponse:FetchResponse,FetchUrlFeeDataNetworkPlugin:FetchUrlFeeDataNetworkPlugin,FixedNumber:FixedNumber,Fragment:Fragment,FunctionFragment:FunctionFragment,GasCostPlugin:GasCostPlugin,HDNodeVoidWallet:HDNodeVoidWallet,HDNodeWallet:HDNodeWallet,Indexed:Indexed,InfuraProvider:InfuraProvider,InfuraWebSocketProvider:InfuraWebSocketProvider,Interface:Interface,IpcSocketProvider:IpcSocketProvider,JsonRpcApiProvider:JsonRpcApiProvider,JsonRpcProvider:JsonRpcProvider,JsonRpcSigner:JsonRpcSigner,LangEn:LangEn,Log:Log,LogDescription:LogDescription,MaxInt256:MaxInt256,MaxUint256:MaxUint256,MessagePrefix:MessagePrefix,MinInt256:MinInt256,Mnemonic:Mnemonic,MulticoinProviderPlugin:MulticoinProviderPlugin,N:N$1,NamedFragment:NamedFragment,Network:Network,NetworkPlugin:NetworkPlugin,NonceManager:NonceManager,ParamType:ParamType,PocketProvider:PocketProvider,QuickNodeProvider:QuickNodeProvider,Result:Result,Signature:Signature,SigningKey:SigningKey,SocketBlockSubscriber:SocketBlockSubscriber,SocketEventSubscriber:SocketEventSubscriber,SocketPendingSubscriber:SocketPendingSubscriber,SocketProvider:SocketProvider,SocketSubscriber:SocketSubscriber,StructFragment:StructFragment,Transaction:Transaction,TransactionDescription:TransactionDescription,TransactionReceipt:TransactionReceipt,TransactionResponse:TransactionResponse,Typed:Typed,TypedDataEncoder:TypedDataEncoder,UndecodedEventLog:UndecodedEventLog,UnmanagedSubscriber:UnmanagedSubscriber,Utf8ErrorFuncs:Utf8ErrorFuncs,VoidSigner:VoidSigner,Wallet:Wallet,WebSocketProvider:WebSocketProvider,WeiPerEther:WeiPerEther,Wordlist:Wordlist,WordlistOwl:WordlistOwl,WordlistOwlA:WordlistOwlA,ZeroAddress:ZeroAddress,ZeroHash:ZeroHash,accessListify:accessListify,assert:assert,assertArgument:assertArgument,assertArgumentCount:assertArgumentCount,assertNormalize:assertNormalize,assertPrivate:assertPrivate,authorizationify:authorizationify,checkResultErrors:checkResultErrors,computeAddress:computeAddress,computeHmac:computeHmac,concat:concat,copyRequest:copyRequest,dataLength:dataLength,dataSlice:dataSlice,decodeBase58:decodeBase58,decodeBase64:decodeBase64,decodeBytes32String:decodeBytes32String,decodeRlp:decodeRlp,decryptCrowdsaleJson:decryptCrowdsaleJson,decryptKeystoreJson:decryptKeystoreJson,decryptKeystoreJsonSync:decryptKeystoreJsonSync,defaultPath:defaultPath,defineProperties:defineProperties,dnsEncode:dnsEncode,encodeBase58:encodeBase58,encodeBase64:encodeBase64,encodeBytes32String:encodeBytes32String,encodeRlp:encodeRlp,encryptKeystoreJson:encryptKeystoreJson,encryptKeystoreJsonSync:encryptKeystoreJsonSync,ensNormalize:ensNormalize,formatEther:formatEther,formatUnits:formatUnits,fromTwos:fromTwos,getAccountPath:getAccountPath,getAddress:getAddress,getBigInt:getBigInt,getBytes:getBytes,getBytesCopy:getBytesCopy,getCreate2Address:getCreate2Address,getCreateAddress:getCreateAddress,getDefaultProvider:getDefaultProvider,getIcapAddress:getIcapAddress,getIndexedAccountPath:getIndexedAccountPath,getNumber:getNumber,getUint:getUint,hashAuthorization:hashAuthorization,hashMessage:hashMessage,hexlify:hexlify,id:id,isAddress:isAddress,isAddressable:isAddressable,isBytesLike:isBytesLike,isCallException:isCallException,isCrowdsaleJson:isCrowdsaleJson,isError:isError,isHexString:isHexString,isKeystoreJson:isKeystoreJson,isValidName:isValidName,keccak256:keccak256,lock:lock,makeError:makeError,mask:mask,namehash:namehash,parseEther:parseEther,parseUnits:parseUnits$1,pbkdf2:pbkdf2,randomBytes:randomBytes,recoverAddress:recoverAddress,resolveAddress:resolveAddress,resolveProperties:resolveProperties,ripemd160:ripemd160,scrypt:scrypt,scryptSync:scryptSync,sha256:sha256,sha512:sha512,showThrottleMessage:showThrottleMessage,solidityPacked:solidityPacked,solidityPackedKeccak256:solidityPackedKeccak256,solidityPackedSha256:solidityPackedSha256,stripZerosLeft:stripZerosLeft,toBeArray:toBeArray,toBeHex:toBeHex,toBigInt:toBigInt,toNumber:toNumber,toQuantity:toQuantity,toTwos:toTwos,toUtf8Bytes:toUtf8Bytes,toUtf8CodePoints:toUtf8CodePoints,toUtf8String:toUtf8String,uuidV4:uuidV4,verifyAuthorization:verifyAuthorization,verifyMessage:verifyMessage,verifyTypedData:verifyTypedData,version:version,wordlists:wordlists,zeroPadBytes:zeroPadBytes,zeroPadValue:zeroPadValue});export{AbiCoder,AbstractProvider,AbstractSigner,AlchemyProvider,AnkrProvider,BaseContract,BaseWallet,Block,BlockscoutProvider,BrowserProvider,ChainstackProvider,CloudflareProvider,ConstructorFragment,Contract,ContractEventPayload,ContractFactory,ContractTransactionReceipt,ContractTransactionResponse,ContractUnknownEventPayload,EnsPlugin,EnsResolver,ErrorDescription,ErrorFragment,EtherSymbol,EtherscanPlugin,EtherscanProvider,EventFragment,EventLog,EventPayload,FallbackFragment,FallbackProvider,FeeData,FeeDataNetworkPlugin,FetchCancelSignal,FetchRequest,FetchResponse,FetchUrlFeeDataNetworkPlugin,FixedNumber,Fragment,FunctionFragment,GasCostPlugin,HDNodeVoidWallet,HDNodeWallet,Indexed,InfuraProvider,InfuraWebSocketProvider,Interface,IpcSocketProvider,JsonRpcApiProvider,JsonRpcProvider,JsonRpcSigner,LangEn,Log,LogDescription,MaxInt256,MaxUint256,MessagePrefix,MinInt256,Mnemonic,MulticoinProviderPlugin,N$1 as N,NamedFragment,Network,NetworkPlugin,NonceManager,ParamType,PocketProvider,QuickNodeProvider,Result,Signature,SigningKey,SocketBlockSubscriber,SocketEventSubscriber,SocketPendingSubscriber,SocketProvider,SocketSubscriber,StructFragment,Transaction,TransactionDescription,TransactionReceipt,TransactionResponse,Typed,TypedDataEncoder,UndecodedEventLog,UnmanagedSubscriber,Utf8ErrorFuncs,VoidSigner,Wallet,WebSocketProvider,WeiPerEther,Wordlist,WordlistOwl,WordlistOwlA,ZeroAddress,ZeroHash,accessListify,assert,assertArgument,assertArgumentCount,assertNormalize,assertPrivate,authorizationify,checkResultErrors,computeAddress,computeHmac,concat,copyRequest,dataLength,dataSlice,decodeBase58,decodeBase64,decodeBytes32String,decodeRlp,decryptCrowdsaleJson,decryptKeystoreJson,decryptKeystoreJsonSync,defaultPath,defineProperties,dnsEncode,encodeBase58,encodeBase64,encodeBytes32String,encodeRlp,encryptKeystoreJson,encryptKeystoreJsonSync,ensNormalize,ethers,formatEther,formatUnits,fromTwos,getAccountPath,getAddress,getBigInt,getBytes,getBytesCopy,getCreate2Address,getCreateAddress,getDefaultProvider,getIcapAddress,getIndexedAccountPath,getNumber,getUint,hashAuthorization,hashMessage,hexlify,id,isAddress,isAddressable,isBytesLike,isCallException,isCrowdsaleJson,isError,isHexString,isKeystoreJson,isValidName,keccak256,lock,makeError,mask,namehash,parseEther,parseUnits$1 as parseUnits,pbkdf2,randomBytes,recoverAddress,resolveAddress,resolveProperties,ripemd160,scrypt,scryptSync,sha256,sha512,showThrottleMessage,solidityPacked,solidityPackedKeccak256,solidityPackedSha256,stripZerosLeft,toBeArray,toBeHex,toBigInt,toNumber,toQuantity,toTwos,toUtf8Bytes,toUtf8CodePoints,toUtf8String,uuidV4,verifyAuthorization,verifyMessage,verifyTypedData,version,wordlists,zeroPadBytes,zeroPadValue}; \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/dist/ethers.umd.js b/tools/mnemonic-test/node_modules/ethers/dist/ethers.umd.js deleted file mode 100644 index e7826724..00000000 --- a/tools/mnemonic-test/node_modules/ethers/dist/ethers.umd.js +++ /dev/null @@ -1,26689 +0,0 @@ -const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !== 'undefined' ? window: typeof global !== 'undefined' ? global: typeof self !== 'undefined' ? self: {}); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ethers = {})); -})(this, (function (exports) { 'use strict'; - - /* Do NOT modify this file; see /src.ts/_admin/update-version.ts */ - /** - * The current version of Ethers. - */ - const version = "6.16.0"; - - /** - * Property helper functions. - * - * @_subsection api/utils:Properties [about-properties] - */ - function checkType(value, type, name) { - const types = type.split("|").map(t => t.trim()); - for (let i = 0; i < types.length; i++) { - switch (type) { - case "any": - return; - case "bigint": - case "boolean": - case "number": - case "string": - if (typeof (value) === type) { - return; - } - } - } - const error = new Error(`invalid value for type ${type}`); - error.code = "INVALID_ARGUMENT"; - error.argument = `value.${name}`; - error.value = value; - throw error; - } - /** - * Resolves to a new object that is a copy of %%value%%, but with all - * values resolved. - */ - async function resolveProperties(value) { - const keys = Object.keys(value); - const results = await Promise.all(keys.map((k) => Promise.resolve(value[k]))); - return results.reduce((accum, v, index) => { - accum[keys[index]] = v; - return accum; - }, {}); - } - /** - * Assigns the %%values%% to %%target%% as read-only values. - * - * It %%types%% is specified, the values are checked. - */ - function defineProperties(target, values, types) { - for (let key in values) { - let value = values[key]; - const type = (types ? types[key] : null); - if (type) { - checkType(value, type, key); - } - Object.defineProperty(target, key, { enumerable: true, value, writable: false }); - } - } - - /** - * All errors in ethers include properties to ensure they are both - * human-readable (i.e. ``.message``) and machine-readable (i.e. ``.code``). - * - * The [[isError]] function can be used to check the error ``code`` and - * provide a type guard for the properties present on that error interface. - * - * @_section: api/utils/errors:Errors [about-errors] - */ - function stringify$1(value, seen) { - if (value == null) { - return "null"; - } - if (seen == null) { - seen = new Set(); - } - if (typeof (value) === "object") { - if (seen.has(value)) { - return "[Circular]"; - } - seen.add(value); - } - if (Array.isArray(value)) { - return "[ " + (value.map((v) => stringify$1(v, seen))).join(", ") + " ]"; - } - if (value instanceof Uint8Array) { - const HEX = "0123456789abcdef"; - let result = "0x"; - for (let i = 0; i < value.length; i++) { - result += HEX[value[i] >> 4]; - result += HEX[value[i] & 0xf]; - } - return result; - } - if (typeof (value) === "object" && typeof (value.toJSON) === "function") { - return stringify$1(value.toJSON(), seen); - } - switch (typeof (value)) { - case "boolean": - case "number": - case "symbol": - return value.toString(); - case "bigint": - return BigInt(value).toString(); - case "string": - return JSON.stringify(value); - case "object": { - const keys = Object.keys(value); - keys.sort(); - return "{ " + keys.map((k) => `${stringify$1(k, seen)}: ${stringify$1(value[k], seen)}`).join(", ") + " }"; - } - } - return `[ COULD NOT SERIALIZE ]`; - } - /** - * Returns true if the %%error%% matches an error thrown by ethers - * that matches the error %%code%%. - * - * In TypeScript environments, this can be used to check that %%error%% - * matches an EthersError type, which means the expected properties will - * be set. - * - * @See [ErrorCodes](api:ErrorCode) - * @example - * try { - * // code.... - * } catch (e) { - * if (isError(e, "CALL_EXCEPTION")) { - * // The Type Guard has validated this object - * console.log(e.data); - * } - * } - */ - function isError(error, code) { - return (error && error.code === code); - } - /** - * Returns true if %%error%% is a [[CallExceptionError]. - */ - function isCallException(error) { - return isError(error, "CALL_EXCEPTION"); - } - /** - * Returns a new Error configured to the format ethers emits errors, with - * the %%message%%, [[api:ErrorCode]] %%code%% and additional properties - * for the corresponding EthersError. - * - * Each error in ethers includes the version of ethers, a - * machine-readable [[ErrorCode]], and depending on %%code%%, additional - * required properties. The error message will also include the %%message%%, - * ethers version, %%code%% and all additional properties, serialized. - */ - function makeError(message, code, info) { - let shortMessage = message; - { - const details = []; - if (info) { - if ("message" in info || "code" in info || "name" in info) { - throw new Error(`value will overwrite populated values: ${stringify$1(info)}`); - } - for (const key in info) { - if (key === "shortMessage") { - continue; - } - const value = (info[key]); - // try { - details.push(key + "=" + stringify$1(value)); - // } catch (error: any) { - // console.log("MMM", error.message); - // details.push(key + "=[could not serialize object]"); - // } - } - } - details.push(`code=${code}`); - details.push(`version=${version}`); - if (details.length) { - message += " (" + details.join(", ") + ")"; - } - } - let error; - switch (code) { - case "INVALID_ARGUMENT": - error = new TypeError(message); - break; - case "NUMERIC_FAULT": - case "BUFFER_OVERRUN": - error = new RangeError(message); - break; - default: - error = new Error(message); - } - defineProperties(error, { code }); - if (info) { - Object.assign(error, info); - } - if (error.shortMessage == null) { - defineProperties(error, { shortMessage }); - } - return error; - } - /** - * Throws an EthersError with %%message%%, %%code%% and additional error - * %%info%% when %%check%% is falsish.. - * - * @see [[api:makeError]] - */ - function assert(check, message, code, info) { - if (!check) { - throw makeError(message, code, info); - } - } - /** - * A simple helper to simply ensuring provided arguments match expected - * constraints, throwing if not. - * - * In TypeScript environments, the %%check%% has been asserted true, so - * any further code does not need additional compile-time checks. - */ - function assertArgument(check, message, name, value) { - assert(check, message, "INVALID_ARGUMENT", { argument: name, value: value }); - } - function assertArgumentCount(count, expectedCount, message) { - if (message == null) { - message = ""; - } - if (message) { - message = ": " + message; - } - assert(count >= expectedCount, "missing argument" + message, "MISSING_ARGUMENT", { - count: count, - expectedCount: expectedCount - }); - assert(count <= expectedCount, "too many arguments" + message, "UNEXPECTED_ARGUMENT", { - count: count, - expectedCount: expectedCount - }); - } - const _normalizeForms = ["NFD", "NFC", "NFKD", "NFKC"].reduce((accum, form) => { - try { - // General test for normalize - /* c8 ignore start */ - if ("test".normalize(form) !== "test") { - throw new Error("bad"); - } - ; - /* c8 ignore stop */ - if (form === "NFD") { - const check = String.fromCharCode(0xe9).normalize("NFD"); - const expected = String.fromCharCode(0x65, 0x0301); - /* c8 ignore start */ - if (check !== expected) { - throw new Error("broken"); - } - /* c8 ignore stop */ - } - accum.push(form); - } - catch (error) { } - return accum; - }, []); - /** - * Throws if the normalization %%form%% is not supported. - */ - function assertNormalize(form) { - assert(_normalizeForms.indexOf(form) >= 0, "platform missing String.prototype.normalize", "UNSUPPORTED_OPERATION", { - operation: "String.prototype.normalize", info: { form } - }); - } - /** - * Many classes use file-scoped values to guard the constructor, - * making it effectively private. This facilitates that pattern - * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%, - * throwing if not, indicating the %%className%% if provided. - */ - function assertPrivate(givenGuard, guard, className) { - if (className == null) { - className = ""; - } - if (givenGuard !== guard) { - let method = className, operation = "new"; - if (className) { - method += "."; - operation += " " + className; - } - assert(false, `private constructor; use ${method}from* methods`, "UNSUPPORTED_OPERATION", { - operation - }); - } - } - - /** - * Some data helpers. - * - * - * @_subsection api/utils:Data Helpers [about-data] - */ - function _getBytes(value, name, copy) { - if (value instanceof Uint8Array) { - if (copy) { - return new Uint8Array(value); - } - return value; - } - if (typeof (value) === "string" && (value.length % 2) === 0 && - value.match(/^0x[0-9a-f]*$/i)) { - const result = new Uint8Array((value.length - 2) / 2); - let offset = 2; - for (let i = 0; i < result.length; i++) { - result[i] = parseInt(value.substring(offset, offset + 2), 16); - offset += 2; - } - return result; - } - assertArgument(false, "invalid BytesLike value", name || "value", value); - } - /** - * Get a typed Uint8Array for %%value%%. If already a Uint8Array - * the original %%value%% is returned; if a copy is required use - * [[getBytesCopy]]. - * - * @see: getBytesCopy - */ - function getBytes(value, name) { - return _getBytes(value, name, false); - } - /** - * Get a typed Uint8Array for %%value%%, creating a copy if necessary - * to prevent any modifications of the returned value from being - * reflected elsewhere. - * - * @see: getBytes - */ - function getBytesCopy(value, name) { - return _getBytes(value, name, true); - } - /** - * Returns true if %%value%% is a valid [[HexString]]. - * - * If %%length%% is ``true`` or a //number//, it also checks that - * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//) - * bytes of data (e.g. ``0x1234`` is 2 bytes). - */ - function isHexString(value, length) { - if (typeof (value) !== "string" || !value.match(/^0x[0-9A-Fa-f]*$/)) { - return false; - } - if (typeof (length) === "number" && value.length !== 2 + 2 * length) { - return false; - } - if (length === true && (value.length % 2) !== 0) { - return false; - } - return true; - } - /** - * Returns true if %%value%% is a valid representation of arbitrary - * data (i.e. a valid [[DataHexString]] or a Uint8Array). - */ - function isBytesLike(value) { - return (isHexString(value, true) || (value instanceof Uint8Array)); - } - const HexCharacters = "0123456789abcdef"; - /** - * Returns a [[DataHexString]] representation of %%data%%. - */ - function hexlify(data) { - const bytes = getBytes(data); - let result = "0x"; - for (let i = 0; i < bytes.length; i++) { - const v = bytes[i]; - result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f]; - } - return result; - } - /** - * Returns a [[DataHexString]] by concatenating all values - * within %%data%%. - */ - function concat(datas) { - return "0x" + datas.map((d) => hexlify(d).substring(2)).join(""); - } - /** - * Returns the length of %%data%%, in bytes. - */ - function dataLength(data) { - if (isHexString(data, true)) { - return (data.length - 2) / 2; - } - return getBytes(data).length; - } - /** - * Returns a [[DataHexString]] by slicing %%data%% from the %%start%% - * offset to the %%end%% offset. - * - * By default %%start%% is 0 and %%end%% is the length of %%data%%. - */ - function dataSlice(data, start, end) { - const bytes = getBytes(data); - if (end != null && end > bytes.length) { - assert(false, "cannot slice beyond data bounds", "BUFFER_OVERRUN", { - buffer: bytes, length: bytes.length, offset: end - }); - } - return hexlify(bytes.slice((start == null) ? 0 : start, (end == null) ? bytes.length : end)); - } - /** - * Return the [[DataHexString]] result by stripping all **leading** - ** zero bytes from %%data%%. - */ - function stripZerosLeft(data) { - let bytes = hexlify(data).substring(2); - while (bytes.startsWith("00")) { - bytes = bytes.substring(2); - } - return "0x" + bytes; - } - function zeroPad(data, length, left) { - const bytes = getBytes(data); - assert(length >= bytes.length, "padding exceeds data length", "BUFFER_OVERRUN", { - buffer: new Uint8Array(bytes), - length: length, - offset: length + 1 - }); - const result = new Uint8Array(length); - result.fill(0); - if (left) { - result.set(bytes, length - bytes.length); - } - else { - result.set(bytes, 0); - } - return hexlify(result); - } - /** - * Return the [[DataHexString]] of %%data%% padded on the **left** - * to %%length%% bytes. - * - * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is - * thrown. - * - * This pads data the same as **values** are in Solidity - * (e.g. ``uint128``). - */ - function zeroPadValue(data, length) { - return zeroPad(data, length, true); - } - /** - * Return the [[DataHexString]] of %%data%% padded on the **right** - * to %%length%% bytes. - * - * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is - * thrown. - * - * This pads data the same as **bytes** are in Solidity - * (e.g. ``bytes16``). - */ - function zeroPadBytes(data, length) { - return zeroPad(data, length, false); - } - - /** - * Some mathematic operations. - * - * @_subsection: api/utils:Math Helpers [about-maths] - */ - const BN_0$a = BigInt(0); - const BN_1$5 = BigInt(1); - //const BN_Max256 = (BN_1 << BigInt(256)) - BN_1; - // IEEE 754 support 53-bits of mantissa - const maxValue = 0x1fffffffffffff; - /** - * Convert %%value%% from a twos-compliment representation of %%width%% - * bits to its value. - * - * If the highest bit is ``1``, the result will be negative. - */ - function fromTwos(_value, _width) { - const value = getUint(_value, "value"); - const width = BigInt(getNumber(_width, "width")); - assert((value >> width) === BN_0$a, "overflow", "NUMERIC_FAULT", { - operation: "fromTwos", fault: "overflow", value: _value - }); - // Top bit set; treat as a negative value - if (value >> (width - BN_1$5)) { - const mask = (BN_1$5 << width) - BN_1$5; - return -(((~value) & mask) + BN_1$5); - } - return value; - } - /** - * Convert %%value%% to a twos-compliment representation of - * %%width%% bits. - * - * The result will always be positive. - */ - function toTwos(_value, _width) { - let value = getBigInt(_value, "value"); - const width = BigInt(getNumber(_width, "width")); - const limit = (BN_1$5 << (width - BN_1$5)); - if (value < BN_0$a) { - value = -value; - assert(value <= limit, "too low", "NUMERIC_FAULT", { - operation: "toTwos", fault: "overflow", value: _value - }); - const mask = (BN_1$5 << width) - BN_1$5; - return ((~value) & mask) + BN_1$5; - } - else { - assert(value < limit, "too high", "NUMERIC_FAULT", { - operation: "toTwos", fault: "overflow", value: _value - }); - } - return value; - } - /** - * Mask %%value%% with a bitmask of %%bits%% ones. - */ - function mask(_value, _bits) { - const value = getUint(_value, "value"); - const bits = BigInt(getNumber(_bits, "bits")); - return value & ((BN_1$5 << bits) - BN_1$5); - } - /** - * Gets a BigInt from %%value%%. If it is an invalid value for - * a BigInt, then an ArgumentError will be thrown for %%name%%. - */ - function getBigInt(value, name) { - switch (typeof (value)) { - case "bigint": return value; - case "number": - assertArgument(Number.isInteger(value), "underflow", name || "value", value); - assertArgument(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); - return BigInt(value); - case "string": - try { - if (value === "") { - throw new Error("empty string"); - } - if (value[0] === "-" && value[1] !== "-") { - return -BigInt(value.substring(1)); - } - return BigInt(value); - } - catch (e) { - assertArgument(false, `invalid BigNumberish string: ${e.message}`, name || "value", value); - } - } - assertArgument(false, "invalid BigNumberish value", name || "value", value); - } - /** - * Returns %%value%% as a bigint, validating it is valid as a bigint - * value and that it is positive. - */ - function getUint(value, name) { - const result = getBigInt(value, name); - assert(result >= BN_0$a, "unsigned value cannot be negative", "NUMERIC_FAULT", { - fault: "overflow", operation: "getUint", value - }); - return result; - } - const Nibbles$1 = "0123456789abcdef"; - /* - * Converts %%value%% to a BigInt. If %%value%% is a Uint8Array, it - * is treated as Big Endian data. - */ - function toBigInt(value) { - if (value instanceof Uint8Array) { - let result = "0x0"; - for (const v of value) { - result += Nibbles$1[v >> 4]; - result += Nibbles$1[v & 0x0f]; - } - return BigInt(result); - } - return getBigInt(value); - } - /** - * Gets a //number// from %%value%%. If it is an invalid value for - * a //number//, then an ArgumentError will be thrown for %%name%%. - */ - function getNumber(value, name) { - switch (typeof (value)) { - case "bigint": - assertArgument(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); - return Number(value); - case "number": - assertArgument(Number.isInteger(value), "underflow", name || "value", value); - assertArgument(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); - return value; - case "string": - try { - if (value === "") { - throw new Error("empty string"); - } - return getNumber(BigInt(value), name); - } - catch (e) { - assertArgument(false, `invalid numeric string: ${e.message}`, name || "value", value); - } - } - assertArgument(false, "invalid numeric value", name || "value", value); - } - /** - * Converts %%value%% to a number. If %%value%% is a Uint8Array, it - * is treated as Big Endian data. Throws if the value is not safe. - */ - function toNumber(value) { - return getNumber(toBigInt(value)); - } - /** - * Converts %%value%% to a Big Endian hexstring, optionally padded to - * %%width%% bytes. - */ - function toBeHex(_value, _width) { - const value = getUint(_value, "value"); - let result = value.toString(16); - if (_width == null) { - // Ensure the value is of even length - if (result.length % 2) { - result = "0" + result; - } - } - else { - const width = getNumber(_width, "width"); - // Special case when both value and width are 0 (see: #5025) - if (width === 0 && value === BN_0$a) { - return "0x"; - } - assert(width * 2 >= result.length, `value exceeds width (${width} bytes)`, "NUMERIC_FAULT", { - operation: "toBeHex", - fault: "overflow", - value: _value - }); - // Pad the value to the required width - while (result.length < (width * 2)) { - result = "0" + result; - } - } - return "0x" + result; - } - /** - * Converts %%value%% to a Big Endian Uint8Array. - */ - function toBeArray(_value, _width) { - const value = getUint(_value, "value"); - if (value === BN_0$a) { - const width = (_width != null) ? getNumber(_width, "width") : 0; - return new Uint8Array(width); - } - let hex = value.toString(16); - if (hex.length % 2) { - hex = "0" + hex; - } - if (_width != null) { - const width = getNumber(_width, "width"); - while (hex.length < (width * 2)) { - hex = "00" + hex; - } - assert((width * 2) === hex.length, `value exceeds width (${width} bytes)`, "NUMERIC_FAULT", { - operation: "toBeArray", - fault: "overflow", - value: _value - }); - } - const result = new Uint8Array(hex.length / 2); - for (let i = 0; i < result.length; i++) { - const offset = i * 2; - result[i] = parseInt(hex.substring(offset, offset + 2), 16); - } - return result; - } - /** - * Returns a [[HexString]] for %%value%% safe to use as a //Quantity//. - * - * A //Quantity// does not have and leading 0 values unless the value is - * the literal value `0x0`. This is most commonly used for JSSON-RPC - * numeric values. - */ - function toQuantity(value) { - let result = hexlify(isBytesLike(value) ? value : toBeArray(value)).substring(2); - while (result.startsWith("0")) { - result = result.substring(1); - } - if (result === "") { - result = "0"; - } - return "0x" + result; - } - - /** - * The [Base58 Encoding](link-base58) scheme allows a **numeric** value - * to be encoded as a compact string using a radix of 58 using only - * alpha-numeric characters. Confusingly similar characters are omitted - * (i.e. ``"l0O"``). - * - * Note that Base58 encodes a **numeric** value, not arbitrary bytes, - * since any zero-bytes on the left would get removed. To mitigate this - * issue most schemes that use Base58 choose specific high-order values - * to ensure non-zero prefixes. - * - * @_subsection: api/utils:Base58 Encoding [about-base58] - */ - const Alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; - let Lookup = null; - function getAlpha(letter) { - if (Lookup == null) { - Lookup = {}; - for (let i = 0; i < Alphabet.length; i++) { - Lookup[Alphabet[i]] = BigInt(i); - } - } - const result = Lookup[letter]; - assertArgument(result != null, `invalid base58 value`, "letter", letter); - return result; - } - const BN_0$9 = BigInt(0); - const BN_58 = BigInt(58); - /** - * Encode %%value%% as a Base58-encoded string. - */ - function encodeBase58(_value) { - const bytes = getBytes(_value); - let value = toBigInt(bytes); - let result = ""; - while (value) { - result = Alphabet[Number(value % BN_58)] + result; - value /= BN_58; - } - // Account for leading padding zeros - for (let i = 0; i < bytes.length; i++) { - if (bytes[i]) { - break; - } - result = Alphabet[0] + result; - } - return result; - } - /** - * Decode the Base58-encoded %%value%%. - */ - function decodeBase58(value) { - let result = BN_0$9; - for (let i = 0; i < value.length; i++) { - result *= BN_58; - result += getAlpha(value[i]); - } - return result; - } - - // utils/base64-browser - function decodeBase64(textData) { - textData = atob(textData); - const data = new Uint8Array(textData.length); - for (let i = 0; i < textData.length; i++) { - data[i] = textData.charCodeAt(i); - } - return getBytes(data); - } - function encodeBase64(_data) { - const data = getBytes(_data); - let textData = ""; - for (let i = 0; i < data.length; i++) { - textData += String.fromCharCode(data[i]); - } - return btoa(textData); - } - - /** - * Events allow for applications to use the observer pattern, which - * allows subscribing and publishing events, outside the normal - * execution paths. - * - * @_section api/utils/events:Events [about-events] - */ - /** - * When an [[EventEmitterable]] triggers a [[Listener]], the - * callback always ahas one additional argument passed, which is - * an **EventPayload**. - */ - class EventPayload { - /** - * The event filter. - */ - filter; - /** - * The **EventEmitterable**. - */ - emitter; - #listener; - /** - * Create a new **EventPayload** for %%emitter%% with - * the %%listener%% and for %%filter%%. - */ - constructor(emitter, listener, filter) { - this.#listener = listener; - defineProperties(this, { emitter, filter }); - } - /** - * Unregister the triggered listener for future events. - */ - async removeListener() { - if (this.#listener == null) { - return; - } - await this.emitter.off(this.filter, this.#listener); - } - } - - /** - * Using strings in Ethereum (or any security-basd system) requires - * additional care. These utilities attempt to mitigate some of the - * safety issues as well as provide the ability to recover and analyse - * strings. - * - * @_subsection api/utils:Strings and UTF-8 [about-strings] - */ - function errorFunc(reason, offset, bytes, output, badCodepoint) { - assertArgument(false, `invalid codepoint at offset ${offset}; ${reason}`, "bytes", bytes); - } - function ignoreFunc(reason, offset, bytes, output, badCodepoint) { - // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes - if (reason === "BAD_PREFIX" || reason === "UNEXPECTED_CONTINUE") { - let i = 0; - for (let o = offset + 1; o < bytes.length; o++) { - if (bytes[o] >> 6 !== 0x02) { - break; - } - i++; - } - return i; - } - // This byte runs us past the end of the string, so just jump to the end - // (but the first byte was read already read and therefore skipped) - if (reason === "OVERRUN") { - return bytes.length - offset - 1; - } - // Nothing to skip - return 0; - } - function replaceFunc(reason, offset, bytes, output, badCodepoint) { - // Overlong representations are otherwise "valid" code points; just non-deistingtished - if (reason === "OVERLONG") { - assertArgument(typeof (badCodepoint) === "number", "invalid bad code point for replacement", "badCodepoint", badCodepoint); - output.push(badCodepoint); - return 0; - } - // Put the replacement character into the output - output.push(0xfffd); - // Otherwise, process as if ignoring errors - return ignoreFunc(reason, offset, bytes); - } - /** - * A handful of popular, built-in UTF-8 error handling strategies. - * - * **``"error"``** - throws on ANY illegal UTF-8 sequence or - * non-canonical (overlong) codepoints (this is the default) - * - * **``"ignore"``** - silently drops any illegal UTF-8 sequence - * and accepts non-canonical (overlong) codepoints - * - * **``"replace"``** - replace any illegal UTF-8 sequence with the - * UTF-8 replacement character (i.e. ``"\\ufffd"``) and accepts - * non-canonical (overlong) codepoints - * - * @returns: Record<"error" | "ignore" | "replace", Utf8ErrorFunc> - */ - const Utf8ErrorFuncs = Object.freeze({ - error: errorFunc, - ignore: ignoreFunc, - replace: replaceFunc - }); - // http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499 - function getUtf8CodePoints(_bytes, onError) { - if (onError == null) { - onError = Utf8ErrorFuncs.error; - } - const bytes = getBytes(_bytes, "bytes"); - const result = []; - let i = 0; - // Invalid bytes are ignored - while (i < bytes.length) { - const c = bytes[i++]; - // 0xxx xxxx - if (c >> 7 === 0) { - result.push(c); - continue; - } - // Multibyte; how many bytes left for this character? - let extraLength = null; - let overlongMask = null; - // 110x xxxx 10xx xxxx - if ((c & 0xe0) === 0xc0) { - extraLength = 1; - overlongMask = 0x7f; - // 1110 xxxx 10xx xxxx 10xx xxxx - } - else if ((c & 0xf0) === 0xe0) { - extraLength = 2; - overlongMask = 0x7ff; - // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx - } - else if ((c & 0xf8) === 0xf0) { - extraLength = 3; - overlongMask = 0xffff; - } - else { - if ((c & 0xc0) === 0x80) { - i += onError("UNEXPECTED_CONTINUE", i - 1, bytes, result); - } - else { - i += onError("BAD_PREFIX", i - 1, bytes, result); - } - continue; - } - // Do we have enough bytes in our data? - if (i - 1 + extraLength >= bytes.length) { - i += onError("OVERRUN", i - 1, bytes, result); - continue; - } - // Remove the length prefix from the char - let res = c & ((1 << (8 - extraLength - 1)) - 1); - for (let j = 0; j < extraLength; j++) { - let nextChar = bytes[i]; - // Invalid continuation byte - if ((nextChar & 0xc0) != 0x80) { - i += onError("MISSING_CONTINUE", i, bytes, result); - res = null; - break; - } - res = (res << 6) | (nextChar & 0x3f); - i++; - } - // See above loop for invalid continuation byte - if (res === null) { - continue; - } - // Maximum code point - if (res > 0x10ffff) { - i += onError("OUT_OF_RANGE", i - 1 - extraLength, bytes, result, res); - continue; - } - // Reserved for UTF-16 surrogate halves - if (res >= 0xd800 && res <= 0xdfff) { - i += onError("UTF16_SURROGATE", i - 1 - extraLength, bytes, result, res); - continue; - } - // Check for overlong sequences (more bytes than needed) - if (res <= overlongMask) { - i += onError("OVERLONG", i - 1 - extraLength, bytes, result, res); - continue; - } - result.push(res); - } - return result; - } - // http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array - /** - * Returns the UTF-8 byte representation of %%str%%. - * - * If %%form%% is specified, the string is normalized. - */ - function toUtf8Bytes(str, form) { - assertArgument(typeof (str) === "string", "invalid string value", "str", str); - if (form != null) { - assertNormalize(form); - str = str.normalize(form); - } - let result = []; - for (let i = 0; i < str.length; i++) { - const c = str.charCodeAt(i); - if (c < 0x80) { - result.push(c); - } - else if (c < 0x800) { - result.push((c >> 6) | 0xc0); - result.push((c & 0x3f) | 0x80); - } - else if ((c & 0xfc00) == 0xd800) { - i++; - const c2 = str.charCodeAt(i); - assertArgument(i < str.length && ((c2 & 0xfc00) === 0xdc00), "invalid surrogate pair", "str", str); - // Surrogate Pair - const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff); - result.push((pair >> 18) | 0xf0); - result.push(((pair >> 12) & 0x3f) | 0x80); - result.push(((pair >> 6) & 0x3f) | 0x80); - result.push((pair & 0x3f) | 0x80); - } - else { - result.push((c >> 12) | 0xe0); - result.push(((c >> 6) & 0x3f) | 0x80); - result.push((c & 0x3f) | 0x80); - } - } - return new Uint8Array(result); - } - //export - function _toUtf8String(codePoints) { - return codePoints.map((codePoint) => { - if (codePoint <= 0xffff) { - return String.fromCharCode(codePoint); - } - codePoint -= 0x10000; - return String.fromCharCode((((codePoint >> 10) & 0x3ff) + 0xd800), ((codePoint & 0x3ff) + 0xdc00)); - }).join(""); - } - /** - * Returns the string represented by the UTF-8 data %%bytes%%. - * - * When %%onError%% function is specified, it is called on UTF-8 - * errors allowing recovery using the [[Utf8ErrorFunc]] API. - * (default: [error](Utf8ErrorFuncs)) - */ - function toUtf8String(bytes, onError) { - return _toUtf8String(getUtf8CodePoints(bytes, onError)); - } - /** - * Returns the UTF-8 code-points for %%str%%. - * - * If %%form%% is specified, the string is normalized. - */ - function toUtf8CodePoints(str, form) { - return getUtf8CodePoints(toUtf8Bytes(str, form)); - } - - function createGetUrl(options) { - async function getUrl(req, _signal) { - assert(_signal == null || !_signal.cancelled, "request cancelled before sending", "CANCELLED"); - const protocol = req.url.split(":")[0].toLowerCase(); - assert(protocol === "http" || protocol === "https", `unsupported protocol ${protocol}`, "UNSUPPORTED_OPERATION", { - info: { protocol }, - operation: "request" - }); - assert(protocol === "https" || !req.credentials || req.allowInsecureAuthentication, "insecure authorized connections unsupported", "UNSUPPORTED_OPERATION", { - operation: "request" - }); - let error = null; - const controller = new AbortController(); - const timer = setTimeout(() => { - error = makeError("request timeout", "TIMEOUT"); - controller.abort(); - }, req.timeout); - if (_signal) { - _signal.addListener(() => { - error = makeError("request cancelled", "CANCELLED"); - controller.abort(); - }); - } - const init = Object.assign({}, options, { - method: req.method, - headers: new Headers(Array.from(req)), - body: req.body || undefined, - signal: controller.signal - }); - let resp; - try { - resp = await fetch(req.url, init); - } - catch (_error) { - clearTimeout(timer); - if (error) { - throw error; - } - throw _error; - } - clearTimeout(timer); - const headers = {}; - resp.headers.forEach((value, key) => { - headers[key.toLowerCase()] = value; - }); - const respBody = await resp.arrayBuffer(); - const body = (respBody == null) ? null : new Uint8Array(respBody); - return { - statusCode: resp.status, - statusMessage: resp.statusText, - headers, body - }; - } - return getUrl; - } - - /** - * Fetching content from the web is environment-specific, so Ethers - * provides an abstraction that each environment can implement to provide - * this service. - * - * On [Node.js](link-node), the ``http`` and ``https`` libs are used to - * create a request object, register event listeners and process data - * and populate the [[FetchResponse]]. - * - * In a browser, the [DOM fetch](link-js-fetch) is used, and the resulting - * ``Promise`` is waited on to retrieve the payload. - * - * The [[FetchRequest]] is responsible for handling many common situations, - * such as redirects, server throttling, authentication, etc. - * - * It also handles common gateways, such as IPFS and data URIs. - * - * @_section api/utils/fetching:Fetching Web Content [about-fetch] - */ - const MAX_ATTEMPTS = 12; - const SLOT_INTERVAL = 250; - // The global FetchGetUrlFunc implementation. - let defaultGetUrlFunc = createGetUrl(); - const reData = new RegExp("^data:([^;:]*)?(;base64)?,(.*)$", "i"); - const reIpfs = new RegExp("^ipfs:/\/(ipfs/)?(.*)$", "i"); - // If locked, new Gateways cannot be added - let locked$5 = false; - // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs - async function dataGatewayFunc(url, signal) { - try { - const match = url.match(reData); - if (!match) { - throw new Error("invalid data"); - } - return new FetchResponse(200, "OK", { - "content-type": (match[1] || "text/plain"), - }, (match[2] ? decodeBase64(match[3]) : unpercent(match[3]))); - } - catch (error) { - return new FetchResponse(599, "BAD REQUEST (invalid data: URI)", {}, null, new FetchRequest(url)); - } - } - /** - * Returns a [[FetchGatewayFunc]] for fetching content from a standard - * IPFS gateway hosted at %%baseUrl%%. - */ - function getIpfsGatewayFunc(baseUrl) { - async function gatewayIpfs(url, signal) { - try { - const match = url.match(reIpfs); - if (!match) { - throw new Error("invalid link"); - } - return new FetchRequest(`${baseUrl}${match[2]}`); - } - catch (error) { - return new FetchResponse(599, "BAD REQUEST (invalid IPFS URI)", {}, null, new FetchRequest(url)); - } - } - return gatewayIpfs; - } - const Gateways = { - "data": dataGatewayFunc, - "ipfs": getIpfsGatewayFunc("https:/\/gateway.ipfs.io/ipfs/") - }; - const fetchSignals = new WeakMap(); - /** - * @_ignore - */ - class FetchCancelSignal { - #listeners; - #cancelled; - constructor(request) { - this.#listeners = []; - this.#cancelled = false; - fetchSignals.set(request, () => { - if (this.#cancelled) { - return; - } - this.#cancelled = true; - for (const listener of this.#listeners) { - setTimeout(() => { listener(); }, 0); - } - this.#listeners = []; - }); - } - addListener(listener) { - assert(!this.#cancelled, "singal already cancelled", "UNSUPPORTED_OPERATION", { - operation: "fetchCancelSignal.addCancelListener" - }); - this.#listeners.push(listener); - } - get cancelled() { return this.#cancelled; } - checkSignal() { - assert(!this.cancelled, "cancelled", "CANCELLED", {}); - } - } - // Check the signal, throwing if it is cancelled - function checkSignal(signal) { - if (signal == null) { - throw new Error("missing signal; should not happen"); - } - signal.checkSignal(); - return signal; - } - /** - * Represents a request for a resource using a URI. - * - * By default, the supported schemes are ``HTTP``, ``HTTPS``, ``data:``, - * and ``IPFS:``. - * - * Additional schemes can be added globally using [[registerGateway]]. - * - * @example: - * req = new FetchRequest("https://www.ricmoo.com") - * resp = await req.send() - * resp.body.length - * //_result: - */ - class FetchRequest { - #allowInsecure; - #gzip; - #headers; - #method; - #timeout; - #url; - #body; - #bodyType; - #creds; - // Hooks - #preflight; - #process; - #retry; - #signal; - #throttle; - #getUrlFunc; - /** - * The fetch URL to request. - */ - get url() { return this.#url; } - set url(url) { - this.#url = String(url); - } - /** - * The fetch body, if any, to send as the request body. //(default: null)// - * - * When setting a body, the intrinsic ``Content-Type`` is automatically - * set and will be used if **not overridden** by setting a custom - * header. - * - * If %%body%% is null, the body is cleared (along with the - * intrinsic ``Content-Type``). - * - * If %%body%% is a string, the intrinsic ``Content-Type`` is set to - * ``text/plain``. - * - * If %%body%% is a Uint8Array, the intrinsic ``Content-Type`` is set to - * ``application/octet-stream``. - * - * If %%body%% is any other object, the intrinsic ``Content-Type`` is - * set to ``application/json``. - */ - get body() { - if (this.#body == null) { - return null; - } - return new Uint8Array(this.#body); - } - set body(body) { - if (body == null) { - this.#body = undefined; - this.#bodyType = undefined; - } - else if (typeof (body) === "string") { - this.#body = toUtf8Bytes(body); - this.#bodyType = "text/plain"; - } - else if (body instanceof Uint8Array) { - this.#body = body; - this.#bodyType = "application/octet-stream"; - } - else if (typeof (body) === "object") { - this.#body = toUtf8Bytes(JSON.stringify(body)); - this.#bodyType = "application/json"; - } - else { - throw new Error("invalid body"); - } - } - /** - * Returns true if the request has a body. - */ - hasBody() { - return (this.#body != null); - } - /** - * The HTTP method to use when requesting the URI. If no method - * has been explicitly set, then ``GET`` is used if the body is - * null and ``POST`` otherwise. - */ - get method() { - if (this.#method) { - return this.#method; - } - if (this.hasBody()) { - return "POST"; - } - return "GET"; - } - set method(method) { - if (method == null) { - method = ""; - } - this.#method = String(method).toUpperCase(); - } - /** - * The headers that will be used when requesting the URI. All - * keys are lower-case. - * - * This object is a copy, so any changes will **NOT** be reflected - * in the ``FetchRequest``. - * - * To set a header entry, use the ``setHeader`` method. - */ - get headers() { - const headers = Object.assign({}, this.#headers); - if (this.#creds) { - headers["authorization"] = `Basic ${encodeBase64(toUtf8Bytes(this.#creds))}`; - } - if (this.allowGzip) { - headers["accept-encoding"] = "gzip"; - } - if (headers["content-type"] == null && this.#bodyType) { - headers["content-type"] = this.#bodyType; - } - if (this.body) { - headers["content-length"] = String(this.body.length); - } - return headers; - } - /** - * Get the header for %%key%%, ignoring case. - */ - getHeader(key) { - return this.headers[key.toLowerCase()]; - } - /** - * Set the header for %%key%% to %%value%%. All values are coerced - * to a string. - */ - setHeader(key, value) { - this.#headers[String(key).toLowerCase()] = String(value); - } - /** - * Clear all headers, resetting all intrinsic headers. - */ - clearHeaders() { - this.#headers = {}; - } - [Symbol.iterator]() { - const headers = this.headers; - const keys = Object.keys(headers); - let index = 0; - return { - next: () => { - if (index < keys.length) { - const key = keys[index++]; - return { - value: [key, headers[key]], done: false - }; - } - return { value: undefined, done: true }; - } - }; - } - /** - * The value that will be sent for the ``Authorization`` header. - * - * To set the credentials, use the ``setCredentials`` method. - */ - get credentials() { - return this.#creds || null; - } - /** - * Sets an ``Authorization`` for %%username%% with %%password%%. - */ - setCredentials(username, password) { - assertArgument(!username.match(/:/), "invalid basic authentication username", "username", "[REDACTED]"); - this.#creds = `${username}:${password}`; - } - /** - * Enable and request gzip-encoded responses. The response will - * automatically be decompressed. //(default: true)// - */ - get allowGzip() { - return this.#gzip; - } - set allowGzip(value) { - this.#gzip = !!value; - } - /** - * Allow ``Authentication`` credentials to be sent over insecure - * channels. //(default: false)// - */ - get allowInsecureAuthentication() { - return !!this.#allowInsecure; - } - set allowInsecureAuthentication(value) { - this.#allowInsecure = !!value; - } - /** - * The timeout (in milliseconds) to wait for a complete response. - * //(default: 5 minutes)// - */ - get timeout() { return this.#timeout; } - set timeout(timeout) { - assertArgument(timeout >= 0, "timeout must be non-zero", "timeout", timeout); - this.#timeout = timeout; - } - /** - * This function is called prior to each request, for example - * during a redirection or retry in case of server throttling. - * - * This offers an opportunity to populate headers or update - * content before sending a request. - */ - get preflightFunc() { - return this.#preflight || null; - } - set preflightFunc(preflight) { - this.#preflight = preflight; - } - /** - * This function is called after each response, offering an - * opportunity to provide client-level throttling or updating - * response data. - * - * Any error thrown in this causes the ``send()`` to throw. - * - * To schedule a retry attempt (assuming the maximum retry limit - * has not been reached), use [[response.throwThrottleError]]. - */ - get processFunc() { - return this.#process || null; - } - set processFunc(process) { - this.#process = process; - } - /** - * This function is called on each retry attempt. - */ - get retryFunc() { - return this.#retry || null; - } - set retryFunc(retry) { - this.#retry = retry; - } - /** - * This function is called to fetch content from HTTP and - * HTTPS URLs and is platform specific (e.g. nodejs vs - * browsers). - * - * This is by default the currently registered global getUrl - * function, which can be changed using [[registerGetUrl]]. - * If this has been set, setting is to ``null`` will cause - * this FetchRequest (and any future clones) to revert back to - * using the currently registered global getUrl function. - * - * Setting this is generally not necessary, but may be useful - * for developers that wish to intercept requests or to - * configurege a proxy or other agent. - */ - get getUrlFunc() { - return this.#getUrlFunc || defaultGetUrlFunc; - } - set getUrlFunc(value) { - this.#getUrlFunc = value; - } - /** - * Create a new FetchRequest instance with default values. - * - * Once created, each property may be set before issuing a - * ``.send()`` to make the request. - */ - constructor(url) { - this.#url = String(url); - this.#allowInsecure = false; - this.#gzip = true; - this.#headers = {}; - this.#method = ""; - this.#timeout = 300000; - this.#throttle = { - slotInterval: SLOT_INTERVAL, - maxAttempts: MAX_ATTEMPTS - }; - this.#getUrlFunc = null; - } - toString() { - return ``; - } - /** - * Update the throttle parameters used to determine maximum - * attempts and exponential-backoff properties. - */ - setThrottleParams(params) { - if (params.slotInterval != null) { - this.#throttle.slotInterval = params.slotInterval; - } - if (params.maxAttempts != null) { - this.#throttle.maxAttempts = params.maxAttempts; - } - } - async #send(attempt, expires, delay, _request, _response) { - if (attempt >= this.#throttle.maxAttempts) { - return _response.makeServerError("exceeded maximum retry limit"); - } - assert(getTime$2() <= expires, "timeout", "TIMEOUT", { - operation: "request.send", reason: "timeout", request: _request - }); - if (delay > 0) { - await wait(delay); - } - let req = this.clone(); - const scheme = (req.url.split(":")[0] || "").toLowerCase(); - // Process any Gateways - if (scheme in Gateways) { - const result = await Gateways[scheme](req.url, checkSignal(_request.#signal)); - if (result instanceof FetchResponse) { - let response = result; - if (this.processFunc) { - checkSignal(_request.#signal); - try { - response = await this.processFunc(req, response); - } - catch (error) { - // Something went wrong during processing; throw a 5xx server error - if (error.throttle == null || typeof (error.stall) !== "number") { - response.makeServerError("error in post-processing function", error).assertOk(); - } - // Ignore throttling - } - } - return response; - } - req = result; - } - // We have a preflight function; update the request - if (this.preflightFunc) { - req = await this.preflightFunc(req); - } - const resp = await this.getUrlFunc(req, checkSignal(_request.#signal)); - let response = new FetchResponse(resp.statusCode, resp.statusMessage, resp.headers, resp.body, _request); - if (response.statusCode === 301 || response.statusCode === 302) { - // Redirect - try { - const location = response.headers.location || ""; - return req.redirect(location).#send(attempt + 1, expires, 0, _request, response); - } - catch (error) { } - // Things won't get any better on another attempt; abort - return response; - } - else if (response.statusCode === 429) { - // Throttle - if (this.retryFunc == null || (await this.retryFunc(req, response, attempt))) { - const retryAfter = response.headers["retry-after"]; - let delay = this.#throttle.slotInterval * Math.trunc(Math.random() * Math.pow(2, attempt)); - if (typeof (retryAfter) === "string" && retryAfter.match(/^[1-9][0-9]*$/)) { - delay = parseInt(retryAfter); - } - return req.clone().#send(attempt + 1, expires, delay, _request, response); - } - } - if (this.processFunc) { - checkSignal(_request.#signal); - try { - response = await this.processFunc(req, response); - } - catch (error) { - // Something went wrong during processing; throw a 5xx server error - if (error.throttle == null || typeof (error.stall) !== "number") { - response.makeServerError("error in post-processing function", error).assertOk(); - } - // Throttle - let delay = this.#throttle.slotInterval * Math.trunc(Math.random() * Math.pow(2, attempt)); - if (error.stall >= 0) { - delay = error.stall; - } - return req.clone().#send(attempt + 1, expires, delay, _request, response); - } - } - return response; - } - /** - * Resolves to the response by sending the request. - */ - send() { - assert(this.#signal == null, "request already sent", "UNSUPPORTED_OPERATION", { operation: "fetchRequest.send" }); - this.#signal = new FetchCancelSignal(this); - return this.#send(0, getTime$2() + this.timeout, 0, this, new FetchResponse(0, "", {}, null, this)); - } - /** - * Cancels the inflight response, causing a ``CANCELLED`` - * error to be rejected from the [[send]]. - */ - cancel() { - assert(this.#signal != null, "request has not been sent", "UNSUPPORTED_OPERATION", { operation: "fetchRequest.cancel" }); - const signal = fetchSignals.get(this); - if (!signal) { - throw new Error("missing signal; should not happen"); - } - signal(); - } - /** - * Returns a new [[FetchRequest]] that represents the redirection - * to %%location%%. - */ - redirect(location) { - // Redirection; for now we only support absolute locations - const current = this.url.split(":")[0].toLowerCase(); - const target = location.split(":")[0].toLowerCase(); - // Don't allow redirecting: - // - non-GET requests - // - downgrading the security (e.g. https => http) - // - to non-HTTP (or non-HTTPS) protocols [this could be relaxed?] - assert(this.method === "GET" && (current !== "https" || target !== "http") && location.match(/^https?:/), `unsupported redirect`, "UNSUPPORTED_OPERATION", { - operation: `redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(location)})` - }); - // Create a copy of this request, with a new URL - const req = new FetchRequest(location); - req.method = "GET"; - req.allowGzip = this.allowGzip; - req.timeout = this.timeout; - req.#headers = Object.assign({}, this.#headers); - if (this.#body) { - req.#body = new Uint8Array(this.#body); - } - req.#bodyType = this.#bodyType; - // Do not forward credentials unless on the same domain; only absolute - //req.allowInsecure = false; - // paths are currently supported; may want a way to specify to forward? - //setStore(req.#props, "creds", getStore(this.#pros, "creds")); - return req; - } - /** - * Create a new copy of this request. - */ - clone() { - const clone = new FetchRequest(this.url); - // Preserve "default method" (i.e. null) - clone.#method = this.#method; - // Preserve "default body" with type, copying the Uint8Array is present - if (this.#body) { - clone.#body = this.#body; - } - clone.#bodyType = this.#bodyType; - // Preserve "default headers" - clone.#headers = Object.assign({}, this.#headers); - // Credentials is readonly, so we copy internally - clone.#creds = this.#creds; - if (this.allowGzip) { - clone.allowGzip = true; - } - clone.timeout = this.timeout; - if (this.allowInsecureAuthentication) { - clone.allowInsecureAuthentication = true; - } - clone.#preflight = this.#preflight; - clone.#process = this.#process; - clone.#retry = this.#retry; - clone.#throttle = Object.assign({}, this.#throttle); - clone.#getUrlFunc = this.#getUrlFunc; - return clone; - } - /** - * Locks all static configuration for gateways and FetchGetUrlFunc - * registration. - */ - static lockConfig() { - locked$5 = true; - } - /** - * Get the current Gateway function for %%scheme%%. - */ - static getGateway(scheme) { - return Gateways[scheme.toLowerCase()] || null; - } - /** - * Use the %%func%% when fetching URIs using %%scheme%%. - * - * This method affects all requests globally. - * - * If [[lockConfig]] has been called, no change is made and this - * throws. - */ - static registerGateway(scheme, func) { - scheme = scheme.toLowerCase(); - if (scheme === "http" || scheme === "https") { - throw new Error(`cannot intercept ${scheme}; use registerGetUrl`); - } - if (locked$5) { - throw new Error("gateways locked"); - } - Gateways[scheme] = func; - } - /** - * Use %%getUrl%% when fetching URIs over HTTP and HTTPS requests. - * - * This method affects all requests globally. - * - * If [[lockConfig]] has been called, no change is made and this - * throws. - */ - static registerGetUrl(getUrl) { - if (locked$5) { - throw new Error("gateways locked"); - } - defaultGetUrlFunc = getUrl; - } - /** - * Creates a getUrl function that fetches content from HTTP and - * HTTPS URLs. - * - * The available %%options%% are dependent on the platform - * implementation of the default getUrl function. - * - * This is not generally something that is needed, but is useful - * when trying to customize simple behaviour when fetching HTTP - * content. - */ - static createGetUrlFunc(options) { - return createGetUrl(options); - } - /** - * Creates a function that can "fetch" data URIs. - * - * Note that this is automatically done internally to support - * data URIs, so it is not necessary to register it. - * - * This is not generally something that is needed, but may - * be useful in a wrapper to perfom custom data URI functionality. - */ - static createDataGateway() { - return dataGatewayFunc; - } - /** - * Creates a function that will fetch IPFS (unvalidated) from - * a custom gateway baseUrl. - * - * The default IPFS gateway used internally is - * ``"https:/\/gateway.ipfs.io/ipfs/"``. - */ - static createIpfsGatewayFunc(baseUrl) { - return getIpfsGatewayFunc(baseUrl); - } - } - /** - * The response for a FetchRequest. - */ - class FetchResponse { - #statusCode; - #statusMessage; - #headers; - #body; - #request; - #error; - toString() { - return ``; - } - /** - * The response status code. - */ - get statusCode() { return this.#statusCode; } - /** - * The response status message. - */ - get statusMessage() { return this.#statusMessage; } - /** - * The response headers. All keys are lower-case. - */ - get headers() { return Object.assign({}, this.#headers); } - /** - * The response body, or ``null`` if there was no body. - */ - get body() { - return (this.#body == null) ? null : new Uint8Array(this.#body); - } - /** - * The response body as a UTF-8 encoded string, or the empty - * string (i.e. ``""``) if there was no body. - * - * An error is thrown if the body is invalid UTF-8 data. - */ - get bodyText() { - try { - return (this.#body == null) ? "" : toUtf8String(this.#body); - } - catch (error) { - assert(false, "response body is not valid UTF-8 data", "UNSUPPORTED_OPERATION", { - operation: "bodyText", info: { response: this } - }); - } - } - /** - * The response body, decoded as JSON. - * - * An error is thrown if the body is invalid JSON-encoded data - * or if there was no body. - */ - get bodyJson() { - try { - return JSON.parse(this.bodyText); - } - catch (error) { - assert(false, "response body is not valid JSON", "UNSUPPORTED_OPERATION", { - operation: "bodyJson", info: { response: this } - }); - } - } - [Symbol.iterator]() { - const headers = this.headers; - const keys = Object.keys(headers); - let index = 0; - return { - next: () => { - if (index < keys.length) { - const key = keys[index++]; - return { - value: [key, headers[key]], done: false - }; - } - return { value: undefined, done: true }; - } - }; - } - constructor(statusCode, statusMessage, headers, body, request) { - this.#statusCode = statusCode; - this.#statusMessage = statusMessage; - this.#headers = Object.keys(headers).reduce((accum, k) => { - accum[k.toLowerCase()] = String(headers[k]); - return accum; - }, {}); - this.#body = ((body == null) ? null : new Uint8Array(body)); - this.#request = (request || null); - this.#error = { message: "" }; - } - /** - * Return a Response with matching headers and body, but with - * an error status code (i.e. 599) and %%message%% with an - * optional %%error%%. - */ - makeServerError(message, error) { - let statusMessage; - if (!message) { - message = `${this.statusCode} ${this.statusMessage}`; - statusMessage = `CLIENT ESCALATED SERVER ERROR (${message})`; - } - else { - statusMessage = `CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${message})`; - } - const response = new FetchResponse(599, statusMessage, this.headers, this.body, this.#request || undefined); - response.#error = { message, error }; - return response; - } - /** - * If called within a [request.processFunc](FetchRequest-processFunc) - * call, causes the request to retry as if throttled for %%stall%% - * milliseconds. - */ - throwThrottleError(message, stall) { - if (stall == null) { - stall = -1; - } - else { - assertArgument(Number.isInteger(stall) && stall >= 0, "invalid stall timeout", "stall", stall); - } - const error = new Error(message || "throttling requests"); - defineProperties(error, { stall, throttle: true }); - throw error; - } - /** - * Get the header value for %%key%%, ignoring case. - */ - getHeader(key) { - return this.headers[key.toLowerCase()]; - } - /** - * Returns true if the response has a body. - */ - hasBody() { - return (this.#body != null); - } - /** - * The request made for this response. - */ - get request() { return this.#request; } - /** - * Returns true if this response was a success statusCode. - */ - ok() { - return (this.#error.message === "" && this.statusCode >= 200 && this.statusCode < 300); - } - /** - * Throws a ``SERVER_ERROR`` if this response is not ok. - */ - assertOk() { - if (this.ok()) { - return; - } - let { message, error } = this.#error; - if (message === "") { - message = `server response ${this.statusCode} ${this.statusMessage}`; - } - let requestUrl = null; - if (this.request) { - requestUrl = this.request.url; - } - let responseBody = null; - try { - if (this.#body) { - responseBody = toUtf8String(this.#body); - } - } - catch (e) { } - assert(false, message, "SERVER_ERROR", { - request: (this.request || "unknown request"), response: this, error, - info: { - requestUrl, responseBody, - responseStatus: `${this.statusCode} ${this.statusMessage}` - } - }); - } - } - function getTime$2() { return (new Date()).getTime(); } - function unpercent(value) { - return toUtf8Bytes(value.replace(/%([0-9a-f][0-9a-f])/gi, (all, code) => { - return String.fromCharCode(parseInt(code, 16)); - })); - } - function wait(delay) { - return new Promise((resolve) => setTimeout(resolve, delay)); - } - - /** - * The **FixedNumber** class permits using values with decimal places, - * using fixed-pont math. - * - * Fixed-point math is still based on integers under-the-hood, but uses an - * internal offset to store fractional components below, and each operation - * corrects for this after each operation. - * - * @_section: api/utils/fixed-point-math:Fixed-Point Maths [about-fixed-point-math] - */ - const BN_N1 = BigInt(-1); - const BN_0$8 = BigInt(0); - const BN_1$4 = BigInt(1); - const BN_5 = BigInt(5); - const _guard$5 = {}; - // Constant to pull zeros from for multipliers - let Zeros$1 = "0000"; - while (Zeros$1.length < 80) { - Zeros$1 += Zeros$1; - } - // Returns a string "1" followed by decimal "0"s - function getTens(decimals) { - let result = Zeros$1; - while (result.length < decimals) { - result += result; - } - return BigInt("1" + result.substring(0, decimals)); - } - function checkValue(val, format, safeOp) { - const width = BigInt(format.width); - if (format.signed) { - const limit = (BN_1$4 << (width - BN_1$4)); - assert(safeOp == null || (val >= -limit && val < limit), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - if (val > BN_0$8) { - val = fromTwos(mask(val, width), width); - } - else { - val = -fromTwos(mask(-val, width), width); - } - } - else { - const limit = (BN_1$4 << width); - assert(safeOp == null || (val >= 0 && val < limit), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - val = (((val % limit) + limit) % limit) & (limit - BN_1$4); - } - return val; - } - function getFormat(value) { - if (typeof (value) === "number") { - value = `fixed128x${value}`; - } - let signed = true; - let width = 128; - let decimals = 18; - if (typeof (value) === "string") { - // Parse the format string - if (value === "fixed") ; - else if (value === "ufixed") { - signed = false; - } - else { - const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/); - assertArgument(match, "invalid fixed format", "format", value); - signed = (match[1] !== "u"); - width = parseInt(match[2]); - decimals = parseInt(match[3]); - } - } - else if (value) { - // Extract the values from the object - const v = value; - const check = (key, type, defaultValue) => { - if (v[key] == null) { - return defaultValue; - } - assertArgument(typeof (v[key]) === type, "invalid fixed format (" + key + " not " + type + ")", "format." + key, v[key]); - return v[key]; - }; - signed = check("signed", "boolean", signed); - width = check("width", "number", width); - decimals = check("decimals", "number", decimals); - } - assertArgument((width % 8) === 0, "invalid FixedNumber width (not byte aligned)", "format.width", width); - assertArgument(decimals <= 80, "invalid FixedNumber decimals (too large)", "format.decimals", decimals); - const name = (signed ? "" : "u") + "fixed" + String(width) + "x" + String(decimals); - return { signed, width, decimals, name }; - } - function toString(val, decimals) { - let negative = ""; - if (val < BN_0$8) { - negative = "-"; - val *= BN_N1; - } - let str = val.toString(); - // No decimal point for whole values - if (decimals === 0) { - return (negative + str); - } - // Pad out to the whole component (including a whole digit) - while (str.length <= decimals) { - str = Zeros$1 + str; - } - // Insert the decimal point - const index = str.length - decimals; - str = str.substring(0, index) + "." + str.substring(index); - // Trim the whole component (leaving at least one 0) - while (str[0] === "0" && str[1] !== ".") { - str = str.substring(1); - } - // Trim the decimal component (leaving at least one 0) - while (str[str.length - 1] === "0" && str[str.length - 2] !== ".") { - str = str.substring(0, str.length - 1); - } - return (negative + str); - } - /** - * A FixedNumber represents a value over its [[FixedFormat]] - * arithmetic field. - * - * A FixedNumber can be used to perform math, losslessly, on - * values which have decmial places. - * - * A FixedNumber has a fixed bit-width to store values in, and stores all - * values internally by multiplying the value by 10 raised to the power of - * %%decimals%%. - * - * If operations are performed that cause a value to grow too high (close to - * positive infinity) or too low (close to negative infinity), the value - * is said to //overflow//. - * - * For example, an 8-bit signed value, with 0 decimals may only be within - * the range ``-128`` to ``127``; so ``-128 - 1`` will overflow and become - * ``127``. Likewise, ``127 + 1`` will overflow and become ``-127``. - * - * Many operation have a normal and //unsafe// variant. The normal variant - * will throw a [[NumericFaultError]] on any overflow, while the //unsafe// - * variant will silently allow overflow, corrupting its value value. - * - * If operations are performed that cause a value to become too small - * (close to zero), the value loses precison and is said to //underflow//. - * - * For example, a value with 1 decimal place may store a number as small - * as ``0.1``, but the value of ``0.1 / 2`` is ``0.05``, which cannot fit - * into 1 decimal place, so underflow occurs which means precision is lost - * and the value becomes ``0``. - * - * Some operations have a normal and //signalling// variant. The normal - * variant will silently ignore underflow, while the //signalling// variant - * will thow a [[NumericFaultError]] on underflow. - */ - class FixedNumber { - /** - * The specific fixed-point arithmetic field for this value. - */ - format; - #format; - // The actual value (accounting for decimals) - #val; - // A base-10 value to multiple values by to maintain the magnitude - #tens; - /** - * This is a property so console.log shows a human-meaningful value. - * - * @private - */ - _value; - // Use this when changing this file to get some typing info, - // but then switch to any to mask the internal type - //constructor(guard: any, value: bigint, format: _FixedFormat) { - /** - * @private - */ - constructor(guard, value, format) { - assertPrivate(guard, _guard$5, "FixedNumber"); - this.#val = value; - this.#format = format; - const _value = toString(value, format.decimals); - defineProperties(this, { format: format.name, _value }); - this.#tens = getTens(format.decimals); - } - /** - * If true, negative values are permitted, otherwise only - * positive values and zero are allowed. - */ - get signed() { return this.#format.signed; } - /** - * The number of bits available to store the value. - */ - get width() { return this.#format.width; } - /** - * The number of decimal places in the fixed-point arithment field. - */ - get decimals() { return this.#format.decimals; } - /** - * The value as an integer, based on the smallest unit the - * [[decimals]] allow. - */ - get value() { return this.#val; } - #checkFormat(other) { - assertArgument(this.format === other.format, "incompatible format; use fixedNumber.toFormat", "other", other); - } - #checkValue(val, safeOp) { - /* - const width = BigInt(this.width); - if (this.signed) { - const limit = (BN_1 << (width - BN_1)); - assert(safeOp == null || (val >= -limit && val < limit), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - - if (val > BN_0) { - val = fromTwos(mask(val, width), width); - } else { - val = -fromTwos(mask(-val, width), width); - } - - } else { - const masked = mask(val, width); - assert(safeOp == null || (val >= 0 && val === masked), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - val = masked; - } - */ - val = checkValue(val, this.#format, safeOp); - return new FixedNumber(_guard$5, val, this.#format); - } - #add(o, safeOp) { - this.#checkFormat(o); - return this.#checkValue(this.#val + o.#val, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% added - * to %%other%%, ignoring overflow. - */ - addUnsafe(other) { return this.#add(other); } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% added - * to %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - add(other) { return this.#add(other, "add"); } - #sub(o, safeOp) { - this.#checkFormat(o); - return this.#checkValue(this.#val - o.#val, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%other%% subtracted - * from %%this%%, ignoring overflow. - */ - subUnsafe(other) { return this.#sub(other); } - /** - * Returns a new [[FixedNumber]] with the result of %%other%% subtracted - * from %%this%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - sub(other) { return this.#sub(other, "sub"); } - #mul(o, safeOp) { - this.#checkFormat(o); - return this.#checkValue((this.#val * o.#val) / this.#tens, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%, ignoring overflow and underflow (precision loss). - */ - mulUnsafe(other) { return this.#mul(other); } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - mul(other) { return this.#mul(other, "mul"); } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs or if underflow (precision loss) occurs. - */ - mulSignal(other) { - this.#checkFormat(other); - const value = this.#val * other.#val; - assert((value % this.#tens) === BN_0$8, "precision lost during signalling mul", "NUMERIC_FAULT", { - operation: "mulSignal", fault: "underflow", value: this - }); - return this.#checkValue(value / this.#tens, "mulSignal"); - } - #div(o, safeOp) { - assert(o.#val !== BN_0$8, "division by zero", "NUMERIC_FAULT", { - operation: "div", fault: "divide-by-zero", value: this - }); - this.#checkFormat(o); - return this.#checkValue((this.#val * this.#tens) / o.#val, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%, ignoring underflow (precision loss). A - * [[NumericFaultError]] is thrown if overflow occurs. - */ - divUnsafe(other) { return this.#div(other); } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%, ignoring underflow (precision loss). A - * [[NumericFaultError]] is thrown if overflow occurs. - */ - div(other) { return this.#div(other, "div"); } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%. A [[NumericFaultError]] is thrown if underflow - * (precision loss) occurs. - */ - divSignal(other) { - assert(other.#val !== BN_0$8, "division by zero", "NUMERIC_FAULT", { - operation: "div", fault: "divide-by-zero", value: this - }); - this.#checkFormat(other); - const value = (this.#val * this.#tens); - assert((value % other.#val) === BN_0$8, "precision lost during signalling div", "NUMERIC_FAULT", { - operation: "divSignal", fault: "underflow", value: this - }); - return this.#checkValue(value / other.#val, "divSignal"); - } - /** - * Returns a comparison result between %%this%% and %%other%%. - * - * This is suitable for use in sorting, where ``-1`` implies %%this%% - * is smaller, ``1`` implies %%this%% is larger and ``0`` implies - * both are equal. - */ - cmp(other) { - let a = this.value, b = other.value; - // Coerce a and b to the same magnitude - const delta = this.decimals - other.decimals; - if (delta > 0) { - b *= getTens(delta); - } - else if (delta < 0) { - a *= getTens(-delta); - } - // Comnpare - if (a < b) { - return -1; - } - if (a > b) { - return 1; - } - return 0; - } - /** - * Returns true if %%other%% is equal to %%this%%. - */ - eq(other) { return this.cmp(other) === 0; } - /** - * Returns true if %%other%% is less than to %%this%%. - */ - lt(other) { return this.cmp(other) < 0; } - /** - * Returns true if %%other%% is less than or equal to %%this%%. - */ - lte(other) { return this.cmp(other) <= 0; } - /** - * Returns true if %%other%% is greater than to %%this%%. - */ - gt(other) { return this.cmp(other) > 0; } - /** - * Returns true if %%other%% is greater than or equal to %%this%%. - */ - gte(other) { return this.cmp(other) >= 0; } - /** - * Returns a new [[FixedNumber]] which is the largest **integer** - * that is less than or equal to %%this%%. - * - * The decimal component of the result will always be ``0``. - */ - floor() { - let val = this.#val; - if (this.#val < BN_0$8) { - val -= this.#tens - BN_1$4; - } - val = (this.#val / this.#tens) * this.#tens; - return this.#checkValue(val, "floor"); - } - /** - * Returns a new [[FixedNumber]] which is the smallest **integer** - * that is greater than or equal to %%this%%. - * - * The decimal component of the result will always be ``0``. - */ - ceiling() { - let val = this.#val; - if (this.#val > BN_0$8) { - val += this.#tens - BN_1$4; - } - val = (this.#val / this.#tens) * this.#tens; - return this.#checkValue(val, "ceiling"); - } - /** - * Returns a new [[FixedNumber]] with the decimal component - * rounded up on ties at %%decimals%% places. - */ - round(decimals) { - if (decimals == null) { - decimals = 0; - } - // Not enough precision to not already be rounded - if (decimals >= this.decimals) { - return this; - } - const delta = this.decimals - decimals; - const bump = BN_5 * getTens(delta - 1); - let value = this.value + bump; - const tens = getTens(delta); - value = (value / tens) * tens; - checkValue(value, this.#format, "round"); - return new FixedNumber(_guard$5, value, this.#format); - } - /** - * Returns true if %%this%% is equal to ``0``. - */ - isZero() { return (this.#val === BN_0$8); } - /** - * Returns true if %%this%% is less than ``0``. - */ - isNegative() { return (this.#val < BN_0$8); } - /** - * Returns the string representation of %%this%%. - */ - toString() { return this._value; } - /** - * Returns a float approximation. - * - * Due to IEEE 754 precission (or lack thereof), this function - * can only return an approximation and most values will contain - * rounding errors. - */ - toUnsafeFloat() { return parseFloat(this.toString()); } - /** - * Return a new [[FixedNumber]] with the same value but has had - * its field set to %%format%%. - * - * This will throw if the value cannot fit into %%format%%. - */ - toFormat(format) { - return FixedNumber.fromString(this.toString(), format); - } - /** - * Creates a new [[FixedNumber]] for %%value%% divided by - * %%decimal%% places with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% (once adjusted - * for %%decimals%%) cannot fit in %%format%%, either due to overflow - * or underflow (precision loss). - */ - static fromValue(_value, _decimals, _format) { - const decimals = (_decimals == null) ? 0 : getNumber(_decimals); - const format = getFormat(_format); - let value = getBigInt(_value, "value"); - const delta = decimals - format.decimals; - if (delta > 0) { - const tens = getTens(delta); - assert((value % tens) === BN_0$8, "value loses precision for format", "NUMERIC_FAULT", { - operation: "fromValue", fault: "underflow", value: _value - }); - value /= tens; - } - else if (delta < 0) { - value *= getTens(-delta); - } - checkValue(value, format, "fromValue"); - return new FixedNumber(_guard$5, value, format); - } - /** - * Creates a new [[FixedNumber]] for %%value%% with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% cannot fit - * in %%format%%, either due to overflow or underflow (precision loss). - */ - static fromString(_value, _format) { - const match = _value.match(/^(-?)([0-9]*)\.?([0-9]*)$/); - assertArgument(match && (match[2].length + match[3].length) > 0, "invalid FixedNumber string value", "value", _value); - const format = getFormat(_format); - let whole = (match[2] || "0"), decimal = (match[3] || ""); - // Pad out the decimals - while (decimal.length < format.decimals) { - decimal += Zeros$1; - } - // Check precision is safe - assert(decimal.substring(format.decimals).match(/^0*$/), "too many decimals for format", "NUMERIC_FAULT", { - operation: "fromString", fault: "underflow", value: _value - }); - // Remove extra padding - decimal = decimal.substring(0, format.decimals); - const value = BigInt(match[1] + whole + decimal); - checkValue(value, format, "fromString"); - return new FixedNumber(_guard$5, value, format); - } - /** - * Creates a new [[FixedNumber]] with the big-endian representation - * %%value%% with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% cannot fit - * in %%format%% due to overflow. - */ - static fromBytes(_value, _format) { - let value = toBigInt(getBytes(_value, "value")); - const format = getFormat(_format); - if (format.signed) { - value = fromTwos(value, format.width); - } - checkValue(value, format, "fromBytes"); - return new FixedNumber(_guard$5, value, format); - } - } - //const f1 = FixedNumber.fromString("12.56", "fixed16x2"); - //const f2 = FixedNumber.fromString("0.3", "fixed16x2"); - //console.log(f1.divSignal(f2)); - //const BUMP = FixedNumber.from("0.5"); - - //See: https://github.com/ethereum/wiki/wiki/RLP - function hexlifyByte(value) { - let result = value.toString(16); - while (result.length < 2) { - result = "0" + result; - } - return "0x" + result; - } - function unarrayifyInteger(data, offset, length) { - let result = 0; - for (let i = 0; i < length; i++) { - result = (result * 256) + data[offset + i]; - } - return result; - } - function _decodeChildren(data, offset, childOffset, length) { - const result = []; - while (childOffset < offset + 1 + length) { - const decoded = _decode(data, childOffset); - result.push(decoded.result); - childOffset += decoded.consumed; - assert(childOffset <= offset + 1 + length, "child data too short", "BUFFER_OVERRUN", { - buffer: data, length, offset - }); - } - return { consumed: (1 + length), result: result }; - } - // returns { consumed: number, result: Object } - function _decode(data, offset) { - assert(data.length !== 0, "data too short", "BUFFER_OVERRUN", { - buffer: data, length: 0, offset: 1 - }); - const checkOffset = (offset) => { - assert(offset <= data.length, "data short segment too short", "BUFFER_OVERRUN", { - buffer: data, length: data.length, offset - }); - }; - // Array with extra length prefix - if (data[offset] >= 0xf8) { - const lengthLength = data[offset] - 0xf7; - checkOffset(offset + 1 + lengthLength); - const length = unarrayifyInteger(data, offset + 1, lengthLength); - checkOffset(offset + 1 + lengthLength + length); - return _decodeChildren(data, offset, offset + 1 + lengthLength, lengthLength + length); - } - else if (data[offset] >= 0xc0) { - const length = data[offset] - 0xc0; - checkOffset(offset + 1 + length); - return _decodeChildren(data, offset, offset + 1, length); - } - else if (data[offset] >= 0xb8) { - const lengthLength = data[offset] - 0xb7; - checkOffset(offset + 1 + lengthLength); - const length = unarrayifyInteger(data, offset + 1, lengthLength); - checkOffset(offset + 1 + lengthLength + length); - const result = hexlify(data.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length)); - return { consumed: (1 + lengthLength + length), result: result }; - } - else if (data[offset] >= 0x80) { - const length = data[offset] - 0x80; - checkOffset(offset + 1 + length); - const result = hexlify(data.slice(offset + 1, offset + 1 + length)); - return { consumed: (1 + length), result: result }; - } - return { consumed: 1, result: hexlifyByte(data[offset]) }; - } - /** - * Decodes %%data%% into the structured data it represents. - */ - function decodeRlp(_data) { - const data = getBytes(_data, "data"); - const decoded = _decode(data, 0); - assertArgument(decoded.consumed === data.length, "unexpected junk after rlp payload", "data", _data); - return decoded.result; - } - - //See: https://github.com/ethereum/wiki/wiki/RLP - function arrayifyInteger(value) { - const result = []; - while (value) { - result.unshift(value & 0xff); - value >>= 8; - } - return result; - } - function _encode(object) { - if (Array.isArray(object)) { - let payload = []; - object.forEach(function (child) { - payload = payload.concat(_encode(child)); - }); - if (payload.length <= 55) { - payload.unshift(0xc0 + payload.length); - return payload; - } - const length = arrayifyInteger(payload.length); - length.unshift(0xf7 + length.length); - return length.concat(payload); - } - const data = Array.prototype.slice.call(getBytes(object, "object")); - if (data.length === 1 && data[0] <= 0x7f) { - return data; - } - else if (data.length <= 55) { - data.unshift(0x80 + data.length); - return data; - } - const length = arrayifyInteger(data.length); - length.unshift(0xb7 + length.length); - return length.concat(data); - } - const nibbles = "0123456789abcdef"; - /** - * Encodes %%object%% as an RLP-encoded [[DataHexString]]. - */ - function encodeRlp(object) { - let result = "0x"; - for (const v of _encode(object)) { - result += nibbles[v >> 4]; - result += nibbles[v & 0xf]; - } - return result; - } - - /** - * Most interactions with Ethereum requires integer values, which use - * the smallest magnitude unit. - * - * For example, imagine dealing with dollars and cents. Since dollars - * are divisible, non-integer values are possible, such as ``$10.77``. - * By using the smallest indivisible unit (i.e. cents), the value can - * be kept as the integer ``1077``. - * - * When receiving decimal input from the user (as a decimal string), - * the value should be converted to an integer and when showing a user - * a value, the integer value should be converted to a decimal string. - * - * This creates a clear distinction, between values to be used by code - * (integers) and values used for display logic to users (decimals). - * - * The native unit in Ethereum, //ether// is divisible to 18 decimal places, - * where each individual unit is called a //wei//. - * - * @_subsection api/utils:Unit Conversion [about-units] - */ - const names = [ - "wei", - "kwei", - "mwei", - "gwei", - "szabo", - "finney", - "ether", - ]; - /** - * Converts %%value%% into a //decimal string//, assuming %%unit%% decimal - * places. The %%unit%% may be the number of decimal places or the name of - * a unit (e.g. ``"gwei"`` for 9 decimal places). - * - */ - function formatUnits(value, unit) { - let decimals = 18; - if (typeof (unit) === "string") { - const index = names.indexOf(unit); - assertArgument(index >= 0, "invalid unit", "unit", unit); - decimals = 3 * index; - } - else if (unit != null) { - decimals = getNumber(unit, "unit"); - } - return FixedNumber.fromValue(value, decimals, { decimals, width: 512 }).toString(); - } - /** - * Converts the //decimal string// %%value%% to a BigInt, assuming - * %%unit%% decimal places. The %%unit%% may the number of decimal places - * or the name of a unit (e.g. ``"gwei"`` for 9 decimal places). - */ - function parseUnits$1(value, unit) { - assertArgument(typeof (value) === "string", "value must be a string", "value", value); - let decimals = 18; - if (typeof (unit) === "string") { - const index = names.indexOf(unit); - assertArgument(index >= 0, "invalid unit", "unit", unit); - decimals = 3 * index; - } - else if (unit != null) { - decimals = getNumber(unit, "unit"); - } - return FixedNumber.fromString(value, { decimals, width: 512 }).value; - } - /** - * Converts %%value%% into a //decimal string// using 18 decimal places. - */ - function formatEther(wei) { - return formatUnits(wei, 18); - } - /** - * Converts the //decimal string// %%ether%% to a BigInt, using 18 - * decimal places. - */ - function parseEther(ether) { - return parseUnits$1(ether, 18); - } - - /** - * Explain UUID and link to RFC here. - * - * @_subsection: api/utils:UUID [about-uuid] - */ - /** - * Returns the version 4 [[link-uuid]] for the %%randomBytes%%. - * - * @see: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4) - */ - function uuidV4(randomBytes) { - const bytes = getBytes(randomBytes, "randomBytes"); - // Section: 4.1.3: - // - time_hi_and_version[12:16] = 0b0100 - bytes[6] = (bytes[6] & 0x0f) | 0x40; - // Section 4.4 - // - clock_seq_hi_and_reserved[6] = 0b0 - // - clock_seq_hi_and_reserved[7] = 0b1 - bytes[8] = (bytes[8] & 0x3f) | 0x80; - const value = hexlify(bytes); - return [ - value.substring(2, 10), - value.substring(10, 14), - value.substring(14, 18), - value.substring(18, 22), - value.substring(22, 34), - ].join("-"); - } - - /** - * @_ignore: - */ - const WordSize = 32; - const Padding = new Uint8Array(WordSize); - // Properties used to immediate pass through to the underlying object - // - `then` is used to detect if an object is a Promise for await - const passProperties$1 = ["then"]; - const _guard$4 = {}; - const resultNames = new WeakMap(); - function getNames(result) { - return resultNames.get(result); - } - function setNames(result, names) { - resultNames.set(result, names); - } - function throwError(name, error) { - const wrapped = new Error(`deferred error during ABI decoding triggered accessing ${name}`); - wrapped.error = error; - throw wrapped; - } - function toObject(names, items, deep) { - if (names.indexOf(null) >= 0) { - return items.map((item, index) => { - if (item instanceof Result) { - return toObject(getNames(item), item, deep); - } - return item; - }); - } - return names.reduce((accum, name, index) => { - let item = items.getValue(name); - if (!(name in accum)) { - if (deep && item instanceof Result) { - item = toObject(getNames(item), item, deep); - } - accum[name] = item; - } - return accum; - }, {}); - } - /** - * A [[Result]] is a sub-class of Array, which allows accessing any - * of its values either positionally by its index or, if keys are - * provided by its name. - * - * @_docloc: api/abi - */ - class Result extends Array { - // No longer used; but cannot be removed as it will remove the - // #private field from the .d.ts which may break backwards - // compatibility - #names; - /** - * @private - */ - constructor(...args) { - // To properly sub-class Array so the other built-in - // functions work, the constructor has to behave fairly - // well. So, in the event we are created via fromItems() - // we build the read-only Result object we want, but on - // any other input, we use the default constructor - // constructor(guard: any, items: Array, keys?: Array); - const guard = args[0]; - let items = args[1]; - let names = (args[2] || []).slice(); - let wrap = true; - if (guard !== _guard$4) { - items = args; - names = []; - wrap = false; - } - // Can't just pass in ...items since an array of length 1 - // is a special case in the super. - super(items.length); - items.forEach((item, index) => { this[index] = item; }); - // Find all unique keys - const nameCounts = names.reduce((accum, name) => { - if (typeof (name) === "string") { - accum.set(name, (accum.get(name) || 0) + 1); - } - return accum; - }, (new Map())); - // Remove any key thats not unique - setNames(this, Object.freeze(items.map((item, index) => { - const name = names[index]; - if (name != null && nameCounts.get(name) === 1) { - return name; - } - return null; - }))); - // Dummy operations to prevent TypeScript from complaining - this.#names = []; - if (this.#names == null) { - void (this.#names); - } - if (!wrap) { - return; - } - // A wrapped Result is immutable - Object.freeze(this); - // Proxy indices and names so we can trap deferred errors - const proxy = new Proxy(this, { - get: (target, prop, receiver) => { - if (typeof (prop) === "string") { - // Index accessor - if (prop.match(/^[0-9]+$/)) { - const index = getNumber(prop, "%index"); - if (index < 0 || index >= this.length) { - throw new RangeError("out of result range"); - } - const item = target[index]; - if (item instanceof Error) { - throwError(`index ${index}`, item); - } - return item; - } - // Pass important checks (like `then` for Promise) through - if (passProperties$1.indexOf(prop) >= 0) { - return Reflect.get(target, prop, receiver); - } - const value = target[prop]; - if (value instanceof Function) { - // Make sure functions work with private variables - // See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy#no_private_property_forwarding - return function (...args) { - return value.apply((this === receiver) ? target : this, args); - }; - } - else if (!(prop in target)) { - // Possible name accessor - return target.getValue.apply((this === receiver) ? target : this, [prop]); - } - } - return Reflect.get(target, prop, receiver); - } - }); - setNames(proxy, getNames(this)); - return proxy; - } - /** - * Returns the Result as a normal Array. If %%deep%%, any children - * which are Result objects are also converted to a normal Array. - * - * This will throw if there are any outstanding deferred - * errors. - */ - toArray(deep) { - const result = []; - this.forEach((item, index) => { - if (item instanceof Error) { - throwError(`index ${index}`, item); - } - if (deep && item instanceof Result) { - item = item.toArray(deep); - } - result.push(item); - }); - return result; - } - /** - * Returns the Result as an Object with each name-value pair. If - * %%deep%%, any children which are Result objects are also - * converted to an Object. - * - * This will throw if any value is unnamed, or if there are - * any outstanding deferred errors. - */ - toObject(deep) { - const names = getNames(this); - return names.reduce((accum, name, index) => { - assert(name != null, `value at index ${index} unnamed`, "UNSUPPORTED_OPERATION", { - operation: "toObject()" - }); - return toObject(names, this, deep); - }, {}); - } - /** - * @_ignore - */ - slice(start, end) { - if (start == null) { - start = 0; - } - if (start < 0) { - start += this.length; - if (start < 0) { - start = 0; - } - } - if (end == null) { - end = this.length; - } - if (end < 0) { - end += this.length; - if (end < 0) { - end = 0; - } - } - if (end > this.length) { - end = this.length; - } - const _names = getNames(this); - const result = [], names = []; - for (let i = start; i < end; i++) { - result.push(this[i]); - names.push(_names[i]); - } - return new Result(_guard$4, result, names); - } - /** - * @_ignore - */ - filter(callback, thisArg) { - const _names = getNames(this); - const result = [], names = []; - for (let i = 0; i < this.length; i++) { - const item = this[i]; - if (item instanceof Error) { - throwError(`index ${i}`, item); - } - if (callback.call(thisArg, item, i, this)) { - result.push(item); - names.push(_names[i]); - } - } - return new Result(_guard$4, result, names); - } - /** - * @_ignore - */ - map(callback, thisArg) { - const result = []; - for (let i = 0; i < this.length; i++) { - const item = this[i]; - if (item instanceof Error) { - throwError(`index ${i}`, item); - } - result.push(callback.call(thisArg, item, i, this)); - } - return result; - } - /** - * Returns the value for %%name%%. - * - * Since it is possible to have a key whose name conflicts with - * a method on a [[Result]] or its superclass Array, or any - * JavaScript keyword, this ensures all named values are still - * accessible by name. - */ - getValue(name) { - const index = getNames(this).indexOf(name); - if (index === -1) { - return undefined; - } - const value = this[index]; - if (value instanceof Error) { - throwError(`property ${JSON.stringify(name)}`, value.error); - } - return value; - } - /** - * Creates a new [[Result]] for %%items%% with each entry - * also accessible by its corresponding name in %%keys%%. - */ - static fromItems(items, keys) { - return new Result(_guard$4, items, keys); - } - } - /** - * Returns all errors found in a [[Result]]. - * - * Since certain errors encountered when creating a [[Result]] do - * not impact the ability to continue parsing data, they are - * deferred until they are actually accessed. Hence a faulty string - * in an Event that is never used does not impact the program flow. - * - * However, sometimes it may be useful to access, identify or - * validate correctness of a [[Result]]. - * - * @_docloc api/abi - */ - function checkResultErrors(result) { - // Find the first error (if any) - const errors = []; - const checkErrors = function (path, object) { - if (!Array.isArray(object)) { - return; - } - for (let key in object) { - const childPath = path.slice(); - childPath.push(key); - try { - checkErrors(childPath, object[key]); - } - catch (error) { - errors.push({ path: childPath, error: error }); - } - } - }; - checkErrors([], result); - return errors; - } - function getValue$1(value) { - let bytes = toBeArray(value); - assert(bytes.length <= WordSize, "value out-of-bounds", "BUFFER_OVERRUN", { buffer: bytes, length: WordSize, offset: bytes.length }); - if (bytes.length !== WordSize) { - bytes = getBytesCopy(concat([Padding.slice(bytes.length % WordSize), bytes])); - } - return bytes; - } - /** - * @_ignore - */ - class Coder { - // The coder name: - // - address, uint256, tuple, array, etc. - name; - // The fully expanded type, including composite types: - // - address, uint256, tuple(address,bytes), uint256[3][4][], etc. - type; - // The localName bound in the signature, in this example it is "baz": - // - tuple(address foo, uint bar) baz - localName; - // Whether this type is dynamic: - // - Dynamic: bytes, string, address[], tuple(boolean[]), etc. - // - Not Dynamic: address, uint256, boolean[3], tuple(address, uint8) - dynamic; - constructor(name, type, localName, dynamic) { - defineProperties(this, { name, type, localName, dynamic }, { - name: "string", type: "string", localName: "string", dynamic: "boolean" - }); - } - _throwError(message, value) { - assertArgument(false, message, this.localName, value); - } - } - /** - * @_ignore - */ - class Writer { - // An array of WordSize lengthed objects to concatenation - #data; - #dataLength; - constructor() { - this.#data = []; - this.#dataLength = 0; - } - get data() { - return concat(this.#data); - } - get length() { return this.#dataLength; } - #writeData(data) { - this.#data.push(data); - this.#dataLength += data.length; - return data.length; - } - appendWriter(writer) { - return this.#writeData(getBytesCopy(writer.data)); - } - // Arrayish item; pad on the right to *nearest* WordSize - writeBytes(value) { - let bytes = getBytesCopy(value); - const paddingOffset = bytes.length % WordSize; - if (paddingOffset) { - bytes = getBytesCopy(concat([bytes, Padding.slice(paddingOffset)])); - } - return this.#writeData(bytes); - } - // Numeric item; pad on the left *to* WordSize - writeValue(value) { - return this.#writeData(getValue$1(value)); - } - // Inserts a numeric place-holder, returning a callback that can - // be used to asjust the value later - writeUpdatableValue() { - const offset = this.#data.length; - this.#data.push(Padding); - this.#dataLength += WordSize; - return (value) => { - this.#data[offset] = getValue$1(value); - }; - } - } - /** - * @_ignore - */ - class Reader { - // Allows incomplete unpadded data to be read; otherwise an error - // is raised if attempting to overrun the buffer. This is required - // to deal with an old Solidity bug, in which event data for - // external (not public thoguh) was tightly packed. - allowLoose; - #data; - #offset; - #bytesRead; - #parent; - #maxInflation; - constructor(data, allowLoose, maxInflation) { - defineProperties(this, { allowLoose: !!allowLoose }); - this.#data = getBytesCopy(data); - this.#bytesRead = 0; - this.#parent = null; - this.#maxInflation = (maxInflation != null) ? maxInflation : 1024; - this.#offset = 0; - } - get data() { return hexlify(this.#data); } - get dataLength() { return this.#data.length; } - get consumed() { return this.#offset; } - get bytes() { return new Uint8Array(this.#data); } - #incrementBytesRead(count) { - if (this.#parent) { - return this.#parent.#incrementBytesRead(count); - } - this.#bytesRead += count; - // Check for excessive inflation (see: #4537) - assert(this.#maxInflation < 1 || this.#bytesRead <= this.#maxInflation * this.dataLength, `compressed ABI data exceeds inflation ratio of ${this.#maxInflation} ( see: https:/\/github.com/ethers-io/ethers.js/issues/4537 )`, "BUFFER_OVERRUN", { - buffer: getBytesCopy(this.#data), offset: this.#offset, - length: count, info: { - bytesRead: this.#bytesRead, - dataLength: this.dataLength - } - }); - } - #peekBytes(offset, length, loose) { - let alignedLength = Math.ceil(length / WordSize) * WordSize; - if (this.#offset + alignedLength > this.#data.length) { - if (this.allowLoose && loose && this.#offset + length <= this.#data.length) { - alignedLength = length; - } - else { - assert(false, "data out-of-bounds", "BUFFER_OVERRUN", { - buffer: getBytesCopy(this.#data), - length: this.#data.length, - offset: this.#offset + alignedLength - }); - } - } - return this.#data.slice(this.#offset, this.#offset + alignedLength); - } - // Create a sub-reader with the same underlying data, but offset - subReader(offset) { - const reader = new Reader(this.#data.slice(this.#offset + offset), this.allowLoose, this.#maxInflation); - reader.#parent = this; - return reader; - } - // Read bytes - readBytes(length, loose) { - let bytes = this.#peekBytes(0, length, !!loose); - this.#incrementBytesRead(length); - this.#offset += bytes.length; - // @TODO: Make sure the length..end bytes are all 0? - return bytes.slice(0, length); - } - // Read a numeric values - readValue() { - return toBigInt(this.readBytes(WordSize)); - } - readIndex() { - return toNumber(this.readBytes(WordSize)); - } - } - - function number(n) { - if (!Number.isSafeInteger(n) || n < 0) - throw new Error(`Wrong positive integer: ${n}`); - } - function bytes(b, ...lengths) { - if (!(b instanceof Uint8Array)) - throw new Error('Expected Uint8Array'); - if (lengths.length > 0 && !lengths.includes(b.length)) - throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`); - } - function hash(hash) { - if (typeof hash !== 'function' || typeof hash.create !== 'function') - throw new Error('Hash should be wrapped by utils.wrapConstructor'); - number(hash.outputLen); - number(hash.blockLen); - } - function exists(instance, checkFinished = true) { - if (instance.destroyed) - throw new Error('Hash instance has been destroyed'); - if (checkFinished && instance.finished) - throw new Error('Hash#digest() has already been called'); - } - function output(out, instance) { - bytes(out); - const min = instance.outputLen; - if (out.length < min) { - throw new Error(`digestInto() expects output buffer of length at least ${min}`); - } - } - - const crypto$1 = typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined; - - /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ - // We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+. - // node.js versions earlier than v19 don't declare it in global scope. - // For node.js, package.json#exports field mapping rewrites import - // from `crypto` to `cryptoNode`, which imports native module. - // Makes the utils un-importable in browsers without a bundler. - // Once node.js 18 is deprecated, we can just drop the import. - const u8a$1 = (a) => a instanceof Uint8Array; - const u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); - // Cast array to view - const createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength); - // The rotate right (circular right shift) operation for uint32 - const rotr = (word, shift) => (word << (32 - shift)) | (word >>> shift); - // big-endian hardware is rare. Just in case someone still decides to run hashes: - // early-throw an error because we don't support BE yet. - const isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44; - if (!isLE) - throw new Error('Non little-endian hardware is not supported'); - // There is no setImmediate in browser and setTimeout is slow. - // call of async fn will return Promise, which will be fullfiled only on - // next scheduler queue processing step and this is exactly what we need. - const nextTick = async () => { }; - // Returns control to thread each 'tick' ms to avoid blocking - async function asyncLoop(iters, tick, cb) { - let ts = Date.now(); - for (let i = 0; i < iters; i++) { - cb(i); - // Date.now() is not monotonic, so in case if clock goes backwards we return return control too - const diff = Date.now() - ts; - if (diff >= 0 && diff < tick) - continue; - await nextTick(); - ts += diff; - } - } - /** - * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99]) - */ - function utf8ToBytes$1(str) { - if (typeof str !== 'string') - throw new Error(`utf8ToBytes expected string, got ${typeof str}`); - return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809 - } - /** - * Normalizes (non-hex) string or Uint8Array to Uint8Array. - * Warning: when Uint8Array is passed, it would NOT get copied. - * Keep in mind for future mutable operations. - */ - function toBytes(data) { - if (typeof data === 'string') - data = utf8ToBytes$1(data); - if (!u8a$1(data)) - throw new Error(`expected Uint8Array, got ${typeof data}`); - return data; - } - /** - * Copies several Uint8Arrays into one. - */ - function concatBytes$1(...arrays) { - const r = new Uint8Array(arrays.reduce((sum, a) => sum + a.length, 0)); - let pad = 0; // walk through each item, ensure they have proper type - arrays.forEach((a) => { - if (!u8a$1(a)) - throw new Error('Uint8Array expected'); - r.set(a, pad); - pad += a.length; - }); - return r; - } - // For runtime check if class implements interface - class Hash { - // Safe version that clones internal state - clone() { - return this._cloneInto(); - } - } - const toStr = {}.toString; - function checkOpts(defaults, opts) { - if (opts !== undefined && toStr.call(opts) !== '[object Object]') - throw new Error('Options should be object or undefined'); - const merged = Object.assign(defaults, opts); - return merged; - } - function wrapConstructor(hashCons) { - const hashC = (msg) => hashCons().update(toBytes(msg)).digest(); - const tmp = hashCons(); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = () => hashCons(); - return hashC; - } - /** - * Secure PRNG. Uses `crypto.getRandomValues`, which defers to OS. - */ - function randomBytes$2(bytesLength = 32) { - if (crypto$1 && typeof crypto$1.getRandomValues === 'function') { - return crypto$1.getRandomValues(new Uint8Array(bytesLength)); - } - throw new Error('crypto.getRandomValues must be defined'); - } - - // HMAC (RFC 2104) - class HMAC extends Hash { - constructor(hash$1, _key) { - super(); - this.finished = false; - this.destroyed = false; - hash(hash$1); - const key = toBytes(_key); - this.iHash = hash$1.create(); - if (typeof this.iHash.update !== 'function') - throw new Error('Expected instance of class which extends utils.Hash'); - this.blockLen = this.iHash.blockLen; - this.outputLen = this.iHash.outputLen; - const blockLen = this.blockLen; - const pad = new Uint8Array(blockLen); - // blockLen can be bigger than outputLen - pad.set(key.length > blockLen ? hash$1.create().update(key).digest() : key); - for (let i = 0; i < pad.length; i++) - pad[i] ^= 0x36; - this.iHash.update(pad); - // By doing update (processing of first block) of outer hash here we can re-use it between multiple calls via clone - this.oHash = hash$1.create(); - // Undo internal XOR && apply outer XOR - for (let i = 0; i < pad.length; i++) - pad[i] ^= 0x36 ^ 0x5c; - this.oHash.update(pad); - pad.fill(0); - } - update(buf) { - exists(this); - this.iHash.update(buf); - return this; - } - digestInto(out) { - exists(this); - bytes(out, this.outputLen); - this.finished = true; - this.iHash.digestInto(out); - this.oHash.update(out); - this.oHash.digestInto(out); - this.destroy(); - } - digest() { - const out = new Uint8Array(this.oHash.outputLen); - this.digestInto(out); - return out; - } - _cloneInto(to) { - // Create new instance without calling constructor since key already in state and we don't know it. - to || (to = Object.create(Object.getPrototypeOf(this), {})); - const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this; - to = to; - to.finished = finished; - to.destroyed = destroyed; - to.blockLen = blockLen; - to.outputLen = outputLen; - to.oHash = oHash._cloneInto(to.oHash); - to.iHash = iHash._cloneInto(to.iHash); - return to; - } - destroy() { - this.destroyed = true; - this.oHash.destroy(); - this.iHash.destroy(); - } - } - /** - * HMAC: RFC2104 message authentication code. - * @param hash - function that would be used e.g. sha256 - * @param key - message key - * @param message - message data - */ - const hmac = (hash, key, message) => new HMAC(hash, key).update(message).digest(); - hmac.create = (hash, key) => new HMAC(hash, key); - - // Common prologue and epilogue for sync/async functions - function pbkdf2Init(hash$1, _password, _salt, _opts) { - hash(hash$1); - const opts = checkOpts({ dkLen: 32, asyncTick: 10 }, _opts); - const { c, dkLen, asyncTick } = opts; - number(c); - number(dkLen); - number(asyncTick); - if (c < 1) - throw new Error('PBKDF2: iterations (c) should be >= 1'); - const password = toBytes(_password); - const salt = toBytes(_salt); - // DK = PBKDF2(PRF, Password, Salt, c, dkLen); - const DK = new Uint8Array(dkLen); - // U1 = PRF(Password, Salt + INT_32_BE(i)) - const PRF = hmac.create(hash$1, password); - const PRFSalt = PRF._cloneInto().update(salt); - return { c, dkLen, asyncTick, DK, PRF, PRFSalt }; - } - function pbkdf2Output(PRF, PRFSalt, DK, prfW, u) { - PRF.destroy(); - PRFSalt.destroy(); - if (prfW) - prfW.destroy(); - u.fill(0); - return DK; - } - /** - * PBKDF2-HMAC: RFC 2898 key derivation function - * @param hash - hash function that would be used e.g. sha256 - * @param password - password from which a derived key is generated - * @param salt - cryptographic salt - * @param opts - {c, dkLen} where c is work factor and dkLen is output message size - */ - function pbkdf2$1(hash, password, salt, opts) { - const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts); - let prfW; // Working copy - const arr = new Uint8Array(4); - const view = createView(arr); - const u = new Uint8Array(PRF.outputLen); - // DK = T1 + T2 + ⋯ + Tdklen/hlen - for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { - // Ti = F(Password, Salt, c, i) - const Ti = DK.subarray(pos, pos + PRF.outputLen); - view.setInt32(0, ti, false); - // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc - // U1 = PRF(Password, Salt + INT_32_BE(i)) - (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); - Ti.set(u.subarray(0, Ti.length)); - for (let ui = 1; ui < c; ui++) { - // Uc = PRF(Password, Uc−1) - PRF._cloneInto(prfW).update(u).digestInto(u); - for (let i = 0; i < Ti.length; i++) - Ti[i] ^= u[i]; - } - } - return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); - } - - // Polyfill for Safari 14 - function setBigUint64(view, byteOffset, value, isLE) { - if (typeof view.setBigUint64 === 'function') - return view.setBigUint64(byteOffset, value, isLE); - const _32n = BigInt(32); - const _u32_max = BigInt(0xffffffff); - const wh = Number((value >> _32n) & _u32_max); - const wl = Number(value & _u32_max); - const h = isLE ? 4 : 0; - const l = isLE ? 0 : 4; - view.setUint32(byteOffset + h, wh, isLE); - view.setUint32(byteOffset + l, wl, isLE); - } - // Base SHA2 class (RFC 6234) - class SHA2 extends Hash { - constructor(blockLen, outputLen, padOffset, isLE) { - super(); - this.blockLen = blockLen; - this.outputLen = outputLen; - this.padOffset = padOffset; - this.isLE = isLE; - this.finished = false; - this.length = 0; - this.pos = 0; - this.destroyed = false; - this.buffer = new Uint8Array(blockLen); - this.view = createView(this.buffer); - } - update(data) { - exists(this); - const { view, buffer, blockLen } = this; - data = toBytes(data); - const len = data.length; - for (let pos = 0; pos < len;) { - const take = Math.min(blockLen - this.pos, len - pos); - // Fast path: we have at least one block in input, cast it to view and process - if (take === blockLen) { - const dataView = createView(data); - for (; blockLen <= len - pos; pos += blockLen) - this.process(dataView, pos); - continue; - } - buffer.set(data.subarray(pos, pos + take), this.pos); - this.pos += take; - pos += take; - if (this.pos === blockLen) { - this.process(view, 0); - this.pos = 0; - } - } - this.length += data.length; - this.roundClean(); - return this; - } - digestInto(out) { - exists(this); - output(out, this); - this.finished = true; - // Padding - // We can avoid allocation of buffer for padding completely if it - // was previously not allocated here. But it won't change performance. - const { buffer, view, blockLen, isLE } = this; - let { pos } = this; - // append the bit '1' to the message - buffer[pos++] = 0b10000000; - this.buffer.subarray(pos).fill(0); - // we have less than padOffset left in buffer, so we cannot put length in current block, need process it and pad again - if (this.padOffset > blockLen - pos) { - this.process(view, 0); - pos = 0; - } - // Pad until full block byte with zeros - for (let i = pos; i < blockLen; i++) - buffer[i] = 0; - // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that - // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen. - // So we just write lowest 64 bits of that value. - setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE); - this.process(view, 0); - const oview = createView(out); - const len = this.outputLen; - // NOTE: we do division by 4 later, which should be fused in single op with modulo by JIT - if (len % 4) - throw new Error('_sha2: outputLen should be aligned to 32bit'); - const outLen = len / 4; - const state = this.get(); - if (outLen > state.length) - throw new Error('_sha2: outputLen bigger than state'); - for (let i = 0; i < outLen; i++) - oview.setUint32(4 * i, state[i], isLE); - } - digest() { - const { buffer, outputLen } = this; - this.digestInto(buffer); - const res = buffer.slice(0, outputLen); - this.destroy(); - return res; - } - _cloneInto(to) { - to || (to = new this.constructor()); - to.set(...this.get()); - const { blockLen, buffer, length, finished, destroyed, pos } = this; - to.length = length; - to.pos = pos; - to.finished = finished; - to.destroyed = destroyed; - if (length % blockLen) - to.buffer.set(buffer); - return to; - } - } - - // SHA2-256 need to try 2^128 hashes to execute birthday attack. - // BTC network is doing 2^67 hashes/sec as per early 2023. - // Choice: a ? b : c - const Chi = (a, b, c) => (a & b) ^ (~a & c); - // Majority function, true if any two inpust is true - const Maj = (a, b, c) => (a & b) ^ (a & c) ^ (b & c); - // Round constants: - // first 32 bits of the fractional parts of the cube roots of the first 64 primes 2..311) - // prettier-ignore - const SHA256_K = /* @__PURE__ */ new Uint32Array([ - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 - ]); - // Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19): - // prettier-ignore - const IV = /* @__PURE__ */ new Uint32Array([ - 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 - ]); - // Temporary buffer, not used to store anything between runs - // Named this way because it matches specification. - const SHA256_W = /* @__PURE__ */ new Uint32Array(64); - class SHA256 extends SHA2 { - constructor() { - super(64, 32, 8, false); - // We cannot use array here since array allows indexing by variable - // which means optimizer/compiler cannot use registers. - this.A = IV[0] | 0; - this.B = IV[1] | 0; - this.C = IV[2] | 0; - this.D = IV[3] | 0; - this.E = IV[4] | 0; - this.F = IV[5] | 0; - this.G = IV[6] | 0; - this.H = IV[7] | 0; - } - get() { - const { A, B, C, D, E, F, G, H } = this; - return [A, B, C, D, E, F, G, H]; - } - // prettier-ignore - set(A, B, C, D, E, F, G, H) { - this.A = A | 0; - this.B = B | 0; - this.C = C | 0; - this.D = D | 0; - this.E = E | 0; - this.F = F | 0; - this.G = G | 0; - this.H = H | 0; - } - process(view, offset) { - // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array - for (let i = 0; i < 16; i++, offset += 4) - SHA256_W[i] = view.getUint32(offset, false); - for (let i = 16; i < 64; i++) { - const W15 = SHA256_W[i - 15]; - const W2 = SHA256_W[i - 2]; - const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3); - const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10); - SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0; - } - // Compression function main loop, 64 rounds - let { A, B, C, D, E, F, G, H } = this; - for (let i = 0; i < 64; i++) { - const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25); - const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; - const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22); - const T2 = (sigma0 + Maj(A, B, C)) | 0; - H = G; - G = F; - F = E; - E = (D + T1) | 0; - D = C; - C = B; - B = A; - A = (T1 + T2) | 0; - } - // Add the compressed chunk to the current hash value - A = (A + this.A) | 0; - B = (B + this.B) | 0; - C = (C + this.C) | 0; - D = (D + this.D) | 0; - E = (E + this.E) | 0; - F = (F + this.F) | 0; - G = (G + this.G) | 0; - H = (H + this.H) | 0; - this.set(A, B, C, D, E, F, G, H); - } - roundClean() { - SHA256_W.fill(0); - } - destroy() { - this.set(0, 0, 0, 0, 0, 0, 0, 0); - this.buffer.fill(0); - } - } - /** - * SHA2-256 hash function - * @param message - data that would be hashed - */ - const sha256$1 = /* @__PURE__ */ wrapConstructor(() => new SHA256()); - - const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1); - const _32n = /* @__PURE__ */ BigInt(32); - // We are not using BigUint64Array, because they are extremely slow as per 2022 - function fromBig(n, le = false) { - if (le) - return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) }; - return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 }; - } - function split$1(lst, le = false) { - let Ah = new Uint32Array(lst.length); - let Al = new Uint32Array(lst.length); - for (let i = 0; i < lst.length; i++) { - const { h, l } = fromBig(lst[i], le); - [Ah[i], Al[i]] = [h, l]; - } - return [Ah, Al]; - } - const toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0); - // for Shift in [0, 32) - const shrSH = (h, _l, s) => h >>> s; - const shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); - // Right rotate for Shift in [1, 32) - const rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s)); - const rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); - // Right rotate for Shift in (32, 64), NOTE: 32 is special case. - const rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32)); - const rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s)); - // Right rotate for shift===32 (just swaps l&h) - const rotr32H = (_h, l) => l; - const rotr32L = (h, _l) => h; - // Left rotate for Shift in [1, 32) - const rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s)); - const rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s)); - // Left rotate for Shift in (32, 64), NOTE: 32 is special case. - const rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s)); - const rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s)); - // JS uses 32-bit signed integers for bitwise operations which means we cannot - // simple take carry out of low bit sum by shift, we need to use division. - function add(Ah, Al, Bh, Bl) { - const l = (Al >>> 0) + (Bl >>> 0); - return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 }; - } - // Addition with more than 2 elements - const add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); - const add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0; - const add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); - const add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0; - const add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); - const add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0; - // prettier-ignore - const u64 = { - fromBig, split: split$1, toBig, - shrSH, shrSL, - rotrSH, rotrSL, rotrBH, rotrBL, - rotr32H, rotr32L, - rotlSH, rotlSL, rotlBH, rotlBL, - add, add3L, add3H, add4L, add4H, add5H, add5L, - }; - - // Round contants (first 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409): - // prettier-ignore - const [SHA512_Kh, SHA512_Kl] = /* @__PURE__ */ (() => u64.split([ - '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc', - '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118', - '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2', - '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694', - '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65', - '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5', - '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4', - '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70', - '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df', - '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b', - '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30', - '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8', - '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8', - '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3', - '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec', - '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b', - '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178', - '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b', - '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c', - '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817' - ].map(n => BigInt(n))))(); - // Temporary buffer, not used to store anything between runs - const SHA512_W_H = /* @__PURE__ */ new Uint32Array(80); - const SHA512_W_L = /* @__PURE__ */ new Uint32Array(80); - class SHA512 extends SHA2 { - constructor() { - super(128, 64, 16, false); - // We cannot use array here since array allows indexing by variable which means optimizer/compiler cannot use registers. - // Also looks cleaner and easier to verify with spec. - // Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19): - // h -- high 32 bits, l -- low 32 bits - this.Ah = 0x6a09e667 | 0; - this.Al = 0xf3bcc908 | 0; - this.Bh = 0xbb67ae85 | 0; - this.Bl = 0x84caa73b | 0; - this.Ch = 0x3c6ef372 | 0; - this.Cl = 0xfe94f82b | 0; - this.Dh = 0xa54ff53a | 0; - this.Dl = 0x5f1d36f1 | 0; - this.Eh = 0x510e527f | 0; - this.El = 0xade682d1 | 0; - this.Fh = 0x9b05688c | 0; - this.Fl = 0x2b3e6c1f | 0; - this.Gh = 0x1f83d9ab | 0; - this.Gl = 0xfb41bd6b | 0; - this.Hh = 0x5be0cd19 | 0; - this.Hl = 0x137e2179 | 0; - } - // prettier-ignore - get() { - const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; - return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl]; - } - // prettier-ignore - set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) { - this.Ah = Ah | 0; - this.Al = Al | 0; - this.Bh = Bh | 0; - this.Bl = Bl | 0; - this.Ch = Ch | 0; - this.Cl = Cl | 0; - this.Dh = Dh | 0; - this.Dl = Dl | 0; - this.Eh = Eh | 0; - this.El = El | 0; - this.Fh = Fh | 0; - this.Fl = Fl | 0; - this.Gh = Gh | 0; - this.Gl = Gl | 0; - this.Hh = Hh | 0; - this.Hl = Hl | 0; - } - process(view, offset) { - // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array - for (let i = 0; i < 16; i++, offset += 4) { - SHA512_W_H[i] = view.getUint32(offset); - SHA512_W_L[i] = view.getUint32((offset += 4)); - } - for (let i = 16; i < 80; i++) { - // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7) - const W15h = SHA512_W_H[i - 15] | 0; - const W15l = SHA512_W_L[i - 15] | 0; - const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7); - const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7); - // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6) - const W2h = SHA512_W_H[i - 2] | 0; - const W2l = SHA512_W_L[i - 2] | 0; - const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6); - const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6); - // SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16]; - const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]); - const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]); - SHA512_W_H[i] = SUMh | 0; - SHA512_W_L[i] = SUMl | 0; - } - let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; - // Compression function main loop, 80 rounds - for (let i = 0; i < 80; i++) { - // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41) - const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41); - const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41); - //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; - const CHIh = (Eh & Fh) ^ (~Eh & Gh); - const CHIl = (El & Fl) ^ (~El & Gl); - // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i] - // prettier-ignore - const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]); - const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]); - const T1l = T1ll | 0; - // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39) - const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39); - const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39); - const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch); - const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl); - Hh = Gh | 0; - Hl = Gl | 0; - Gh = Fh | 0; - Gl = Fl | 0; - Fh = Eh | 0; - Fl = El | 0; - ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0)); - Dh = Ch | 0; - Dl = Cl | 0; - Ch = Bh | 0; - Cl = Bl | 0; - Bh = Ah | 0; - Bl = Al | 0; - const All = u64.add3L(T1l, sigma0l, MAJl); - Ah = u64.add3H(All, T1h, sigma0h, MAJh); - Al = All | 0; - } - // Add the compressed chunk to the current hash value - ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0)); - ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0)); - ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0)); - ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0)); - ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0)); - ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0)); - ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0)); - ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0)); - this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl); - } - roundClean() { - SHA512_W_H.fill(0); - SHA512_W_L.fill(0); - } - destroy() { - this.buffer.fill(0); - this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - } - } - const sha512$1 = /* @__PURE__ */ wrapConstructor(() => new SHA512()); - - /* Browser Crypto Shims */ - function getGlobal$1() { - if (typeof self !== 'undefined') { - return self; - } - if (typeof window !== 'undefined') { - return window; - } - if (typeof global !== 'undefined') { - return global; - } - throw new Error('unable to locate global object'); - } - const anyGlobal = getGlobal$1(); - const crypto = anyGlobal.crypto || anyGlobal.msCrypto; - function createHash(algo) { - switch (algo) { - case "sha256": return sha256$1.create(); - case "sha512": return sha512$1.create(); - } - assertArgument(false, "invalid hashing algorithm name", "algorithm", algo); - } - function createHmac(_algo, key) { - const algo = ({ sha256: sha256$1, sha512: sha512$1 }[_algo]); - assertArgument(algo != null, "invalid hmac algorithm", "algorithm", _algo); - return hmac.create(algo, key); - } - function pbkdf2Sync(password, salt, iterations, keylen, _algo) { - const algo = ({ sha256: sha256$1, sha512: sha512$1 }[_algo]); - assertArgument(algo != null, "invalid pbkdf2 algorithm", "algorithm", _algo); - return pbkdf2$1(algo, password, salt, { c: iterations, dkLen: keylen }); - } - function randomBytes$1(length) { - assert(crypto != null, "platform does not support secure random numbers", "UNSUPPORTED_OPERATION", { - operation: "randomBytes" - }); - assertArgument(Number.isInteger(length) && length > 0 && length <= 1024, "invalid length", "length", length); - const result = new Uint8Array(length); - crypto.getRandomValues(result); - return result; - } - - /** - * An **HMAC** enables verification that a given key was used - * to authenticate a payload. - * - * See: [[link-wiki-hmac]] - * - * @_subsection: api/crypto:HMAC [about-hmac] - */ - let locked$4 = false; - const _computeHmac = function (algorithm, key, data) { - return createHmac(algorithm, key).update(data).digest(); - }; - let __computeHmac = _computeHmac; - /** - * Return the HMAC for %%data%% using the %%key%% key with the underlying - * %%algo%% used for compression. - * - * @example: - * key = id("some-secret") - * - * // Compute the HMAC - * computeHmac("sha256", key, "0x1337") - * //_result: - * - * // To compute the HMAC of UTF-8 data, the data must be - * // converted to UTF-8 bytes - * computeHmac("sha256", key, toUtf8Bytes("Hello World")) - * //_result: - * - */ - function computeHmac(algorithm, _key, _data) { - const key = getBytes(_key, "key"); - const data = getBytes(_data, "data"); - return hexlify(__computeHmac(algorithm, key, data)); - } - computeHmac._ = _computeHmac; - computeHmac.lock = function () { locked$4 = true; }; - computeHmac.register = function (func) { - if (locked$4) { - throw new Error("computeHmac is locked"); - } - __computeHmac = func; - }; - Object.freeze(computeHmac); - - // SHA3 (keccak) is based on a new design: basically, the internal state is bigger than output size. - // It's called a sponge function. - // Various per round constants calculations - const [SHA3_PI, SHA3_ROTL, _SHA3_IOTA] = [[], [], []]; - const _0n$4 = /* @__PURE__ */ BigInt(0); - const _1n$5 = /* @__PURE__ */ BigInt(1); - const _2n$3 = /* @__PURE__ */ BigInt(2); - const _7n = /* @__PURE__ */ BigInt(7); - const _256n = /* @__PURE__ */ BigInt(256); - const _0x71n = /* @__PURE__ */ BigInt(0x71); - for (let round = 0, R = _1n$5, x = 1, y = 0; round < 24; round++) { - // Pi - [x, y] = [y, (2 * x + 3 * y) % 5]; - SHA3_PI.push(2 * (5 * y + x)); - // Rotational - SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64); - // Iota - let t = _0n$4; - for (let j = 0; j < 7; j++) { - R = ((R << _1n$5) ^ ((R >> _7n) * _0x71n)) % _256n; - if (R & _2n$3) - t ^= _1n$5 << ((_1n$5 << /* @__PURE__ */ BigInt(j)) - _1n$5); - } - _SHA3_IOTA.push(t); - } - const [SHA3_IOTA_H, SHA3_IOTA_L] = /* @__PURE__ */ split$1(_SHA3_IOTA, true); - // Left rotation (without 0, 32, 64) - const rotlH = (h, l, s) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s)); - const rotlL = (h, l, s) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s)); - // Same as keccakf1600, but allows to skip some rounds - function keccakP(s, rounds = 24) { - const B = new Uint32Array(5 * 2); - // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js) - for (let round = 24 - rounds; round < 24; round++) { - // Theta θ - for (let x = 0; x < 10; x++) - B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40]; - for (let x = 0; x < 10; x += 2) { - const idx1 = (x + 8) % 10; - const idx0 = (x + 2) % 10; - const B0 = B[idx0]; - const B1 = B[idx0 + 1]; - const Th = rotlH(B0, B1, 1) ^ B[idx1]; - const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1]; - for (let y = 0; y < 50; y += 10) { - s[x + y] ^= Th; - s[x + y + 1] ^= Tl; - } - } - // Rho (ρ) and Pi (π) - let curH = s[2]; - let curL = s[3]; - for (let t = 0; t < 24; t++) { - const shift = SHA3_ROTL[t]; - const Th = rotlH(curH, curL, shift); - const Tl = rotlL(curH, curL, shift); - const PI = SHA3_PI[t]; - curH = s[PI]; - curL = s[PI + 1]; - s[PI] = Th; - s[PI + 1] = Tl; - } - // Chi (χ) - for (let y = 0; y < 50; y += 10) { - for (let x = 0; x < 10; x++) - B[x] = s[y + x]; - for (let x = 0; x < 10; x++) - s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10]; - } - // Iota (ι) - s[0] ^= SHA3_IOTA_H[round]; - s[1] ^= SHA3_IOTA_L[round]; - } - B.fill(0); - } - class Keccak extends Hash { - // NOTE: we accept arguments in bytes instead of bits here. - constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) { - super(); - this.blockLen = blockLen; - this.suffix = suffix; - this.outputLen = outputLen; - this.enableXOF = enableXOF; - this.rounds = rounds; - this.pos = 0; - this.posOut = 0; - this.finished = false; - this.destroyed = false; - // Can be passed from user as dkLen - number(outputLen); - // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes - if (0 >= this.blockLen || this.blockLen >= 200) - throw new Error('Sha3 supports only keccak-f1600 function'); - this.state = new Uint8Array(200); - this.state32 = u32(this.state); - } - keccak() { - keccakP(this.state32, this.rounds); - this.posOut = 0; - this.pos = 0; - } - update(data) { - exists(this); - const { blockLen, state } = this; - data = toBytes(data); - const len = data.length; - for (let pos = 0; pos < len;) { - const take = Math.min(blockLen - this.pos, len - pos); - for (let i = 0; i < take; i++) - state[this.pos++] ^= data[pos++]; - if (this.pos === blockLen) - this.keccak(); - } - return this; - } - finish() { - if (this.finished) - return; - this.finished = true; - const { state, suffix, pos, blockLen } = this; - // Do the padding - state[pos] ^= suffix; - if ((suffix & 0x80) !== 0 && pos === blockLen - 1) - this.keccak(); - state[blockLen - 1] ^= 0x80; - this.keccak(); - } - writeInto(out) { - exists(this, false); - bytes(out); - this.finish(); - const bufferOut = this.state; - const { blockLen } = this; - for (let pos = 0, len = out.length; pos < len;) { - if (this.posOut >= blockLen) - this.keccak(); - const take = Math.min(blockLen - this.posOut, len - pos); - out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); - this.posOut += take; - pos += take; - } - return out; - } - xofInto(out) { - // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF - if (!this.enableXOF) - throw new Error('XOF is not possible for this instance'); - return this.writeInto(out); - } - xof(bytes) { - number(bytes); - return this.xofInto(new Uint8Array(bytes)); - } - digestInto(out) { - output(out, this); - if (this.finished) - throw new Error('digest() was already called'); - this.writeInto(out); - this.destroy(); - return out; - } - digest() { - return this.digestInto(new Uint8Array(this.outputLen)); - } - destroy() { - this.destroyed = true; - this.state.fill(0); - } - _cloneInto(to) { - const { blockLen, suffix, outputLen, rounds, enableXOF } = this; - to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds)); - to.state32.set(this.state32); - to.pos = this.pos; - to.posOut = this.posOut; - to.finished = this.finished; - to.rounds = rounds; - // Suffix can change in cSHAKE - to.suffix = suffix; - to.outputLen = outputLen; - to.enableXOF = enableXOF; - to.destroyed = this.destroyed; - return to; - } - } - const gen = (suffix, blockLen, outputLen) => wrapConstructor(() => new Keccak(blockLen, suffix, outputLen)); - /** - * keccak-256 hash function. Different from SHA3-256. - * @param message - that would be hashed - */ - const keccak_256 = /* @__PURE__ */ gen(0x01, 136, 256 / 8); - - /** - * Cryptographic hashing functions - * - * @_subsection: api/crypto:Hash Functions [about-crypto-hashing] - */ - let locked$3 = false; - const _keccak256 = function (data) { - return keccak_256(data); - }; - let __keccak256 = _keccak256; - /** - * Compute the cryptographic KECCAK256 hash of %%data%%. - * - * The %%data%% **must** be a data representation, to compute the - * hash of UTF-8 data use the [[id]] function. - * - * @returns DataHexstring - * @example: - * keccak256("0x") - * //_result: - * - * keccak256("0x1337") - * //_result: - * - * keccak256(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - * // Strings are assumed to be DataHexString, otherwise it will - * // throw. To hash UTF-8 data, see the note above. - * keccak256("Hello World") - * //_error: - */ - function keccak256(_data) { - const data = getBytes(_data, "data"); - return hexlify(__keccak256(data)); - } - keccak256._ = _keccak256; - keccak256.lock = function () { locked$3 = true; }; - keccak256.register = function (func) { - if (locked$3) { - throw new TypeError("keccak256 is locked"); - } - __keccak256 = func; - }; - Object.freeze(keccak256); - - // https://homes.esat.kuleuven.be/~bosselae/ripemd160.html - // https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf - const Rho = /* @__PURE__ */ new Uint8Array([7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8]); - const Id = /* @__PURE__ */ Uint8Array.from({ length: 16 }, (_, i) => i); - const Pi = /* @__PURE__ */ Id.map((i) => (9 * i + 5) % 16); - let idxL = [Id]; - let idxR = [Pi]; - for (let i = 0; i < 4; i++) - for (let j of [idxL, idxR]) - j.push(j[i].map((k) => Rho[k])); - const shifts = /* @__PURE__ */ [ - [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8], - [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7], - [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9], - [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6], - [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5], - ].map((i) => new Uint8Array(i)); - const shiftsL = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts[i][j])); - const shiftsR = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts[i][j])); - const Kl = /* @__PURE__ */ new Uint32Array([ - 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e, - ]); - const Kr = /* @__PURE__ */ new Uint32Array([ - 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000, - ]); - // The rotate left (circular left shift) operation for uint32 - const rotl$1 = (word, shift) => (word << shift) | (word >>> (32 - shift)); - // It's called f() in spec. - function f(group, x, y, z) { - if (group === 0) - return x ^ y ^ z; - else if (group === 1) - return (x & y) | (~x & z); - else if (group === 2) - return (x | ~y) ^ z; - else if (group === 3) - return (x & z) | (y & ~z); - else - return x ^ (y | ~z); - } - // Temporary buffer, not used to store anything between runs - const BUF = /* @__PURE__ */ new Uint32Array(16); - class RIPEMD160 extends SHA2 { - constructor() { - super(64, 20, 8, true); - this.h0 = 0x67452301 | 0; - this.h1 = 0xefcdab89 | 0; - this.h2 = 0x98badcfe | 0; - this.h3 = 0x10325476 | 0; - this.h4 = 0xc3d2e1f0 | 0; - } - get() { - const { h0, h1, h2, h3, h4 } = this; - return [h0, h1, h2, h3, h4]; - } - set(h0, h1, h2, h3, h4) { - this.h0 = h0 | 0; - this.h1 = h1 | 0; - this.h2 = h2 | 0; - this.h3 = h3 | 0; - this.h4 = h4 | 0; - } - process(view, offset) { - for (let i = 0; i < 16; i++, offset += 4) - BUF[i] = view.getUint32(offset, true); - // prettier-ignore - let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el; - // Instead of iterating 0 to 80, we split it into 5 groups - // And use the groups in constants, functions, etc. Much simpler - for (let group = 0; group < 5; group++) { - const rGroup = 4 - group; - const hbl = Kl[group], hbr = Kr[group]; // prettier-ignore - const rl = idxL[group], rr = idxR[group]; // prettier-ignore - const sl = shiftsL[group], sr = shiftsR[group]; // prettier-ignore - for (let i = 0; i < 16; i++) { - const tl = (rotl$1(al + f(group, bl, cl, dl) + BUF[rl[i]] + hbl, sl[i]) + el) | 0; - al = el, el = dl, dl = rotl$1(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore - } - // 2 loops are 10% faster - for (let i = 0; i < 16; i++) { - const tr = (rotl$1(ar + f(rGroup, br, cr, dr) + BUF[rr[i]] + hbr, sr[i]) + er) | 0; - ar = er, er = dr, dr = rotl$1(cr, 10) | 0, cr = br, br = tr; // prettier-ignore - } - } - // Add the compressed chunk to the current hash value - this.set((this.h1 + cl + dr) | 0, (this.h2 + dl + er) | 0, (this.h3 + el + ar) | 0, (this.h4 + al + br) | 0, (this.h0 + bl + cr) | 0); - } - roundClean() { - BUF.fill(0); - } - destroy() { - this.destroyed = true; - this.buffer.fill(0); - this.set(0, 0, 0, 0, 0); - } - } - /** - * RIPEMD-160 - a hash function from 1990s. - * @param message - msg that would be hashed - */ - const ripemd160$1 = /* @__PURE__ */ wrapConstructor(() => new RIPEMD160()); - - let locked$2 = false; - const _ripemd160 = function (data) { - return ripemd160$1(data); - }; - let __ripemd160 = _ripemd160; - /** - * Compute the cryptographic RIPEMD-160 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * ripemd160("0x") - * //_result: - * - * ripemd160("0x1337") - * //_result: - * - * ripemd160(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - */ - function ripemd160(_data) { - const data = getBytes(_data, "data"); - return hexlify(__ripemd160(data)); - } - ripemd160._ = _ripemd160; - ripemd160.lock = function () { locked$2 = true; }; - ripemd160.register = function (func) { - if (locked$2) { - throw new TypeError("ripemd160 is locked"); - } - __ripemd160 = func; - }; - Object.freeze(ripemd160); - - /** - * A **Password-Based Key-Derivation Function** is designed to create - * a sequence of bytes suitible as a **key** from a human-rememberable - * password. - * - * @_subsection: api/crypto:Passwords [about-pbkdf] - */ - let locked$1 = false; - const _pbkdf2 = function (password, salt, iterations, keylen, algo) { - return pbkdf2Sync(password, salt, iterations, keylen, algo); - }; - let __pbkdf2 = _pbkdf2; - /** - * Return the [[link-pbkdf2]] for %%keylen%% bytes for %%password%% using - * the %%salt%% and using %%iterations%% of %%algo%%. - * - * This PBKDF is outdated and should not be used in new projects, but is - * required to decrypt older files. - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the PBKDF2 - * pbkdf2(passwordBytes, salt, 1024, 16, "sha256") - * //_result: - */ - function pbkdf2(_password, _salt, iterations, keylen, algo) { - const password = getBytes(_password, "password"); - const salt = getBytes(_salt, "salt"); - return hexlify(__pbkdf2(password, salt, iterations, keylen, algo)); - } - pbkdf2._ = _pbkdf2; - pbkdf2.lock = function () { locked$1 = true; }; - pbkdf2.register = function (func) { - if (locked$1) { - throw new Error("pbkdf2 is locked"); - } - __pbkdf2 = func; - }; - Object.freeze(pbkdf2); - - /** - * A **Cryptographically Secure Random Value** is one that has been - * generated with additional care take to prevent side-channels - * from allowing others to detect it and prevent others from through - * coincidence generate the same values. - * - * @_subsection: api/crypto:Random Values [about-crypto-random] - */ - let locked = false; - const _randomBytes = function (length) { - return new Uint8Array(randomBytes$1(length)); - }; - let __randomBytes = _randomBytes; - /** - * Return %%length%% bytes of cryptographically secure random data. - * - * @example: - * randomBytes(8) - * //_result: - */ - function randomBytes(length) { - return __randomBytes(length); - } - randomBytes._ = _randomBytes; - randomBytes.lock = function () { locked = true; }; - randomBytes.register = function (func) { - if (locked) { - throw new Error("randomBytes is locked"); - } - __randomBytes = func; - }; - Object.freeze(randomBytes); - - // RFC 7914 Scrypt KDF - // Left rotate for uint32 - const rotl = (a, b) => (a << b) | (a >>> (32 - b)); - // The main Scrypt loop: uses Salsa extensively. - // Six versions of the function were tried, this is the fastest one. - // prettier-ignore - function XorAndSalsa(prev, pi, input, ii, out, oi) { - // Based on https://cr.yp.to/salsa20.html - // Xor blocks - let y00 = prev[pi++] ^ input[ii++], y01 = prev[pi++] ^ input[ii++]; - let y02 = prev[pi++] ^ input[ii++], y03 = prev[pi++] ^ input[ii++]; - let y04 = prev[pi++] ^ input[ii++], y05 = prev[pi++] ^ input[ii++]; - let y06 = prev[pi++] ^ input[ii++], y07 = prev[pi++] ^ input[ii++]; - let y08 = prev[pi++] ^ input[ii++], y09 = prev[pi++] ^ input[ii++]; - let y10 = prev[pi++] ^ input[ii++], y11 = prev[pi++] ^ input[ii++]; - let y12 = prev[pi++] ^ input[ii++], y13 = prev[pi++] ^ input[ii++]; - let y14 = prev[pi++] ^ input[ii++], y15 = prev[pi++] ^ input[ii++]; - // Save state to temporary variables (salsa) - let x00 = y00, x01 = y01, x02 = y02, x03 = y03, x04 = y04, x05 = y05, x06 = y06, x07 = y07, x08 = y08, x09 = y09, x10 = y10, x11 = y11, x12 = y12, x13 = y13, x14 = y14, x15 = y15; - // Main loop (salsa) - for (let i = 0; i < 8; i += 2) { - x04 ^= rotl(x00 + x12 | 0, 7); - x08 ^= rotl(x04 + x00 | 0, 9); - x12 ^= rotl(x08 + x04 | 0, 13); - x00 ^= rotl(x12 + x08 | 0, 18); - x09 ^= rotl(x05 + x01 | 0, 7); - x13 ^= rotl(x09 + x05 | 0, 9); - x01 ^= rotl(x13 + x09 | 0, 13); - x05 ^= rotl(x01 + x13 | 0, 18); - x14 ^= rotl(x10 + x06 | 0, 7); - x02 ^= rotl(x14 + x10 | 0, 9); - x06 ^= rotl(x02 + x14 | 0, 13); - x10 ^= rotl(x06 + x02 | 0, 18); - x03 ^= rotl(x15 + x11 | 0, 7); - x07 ^= rotl(x03 + x15 | 0, 9); - x11 ^= rotl(x07 + x03 | 0, 13); - x15 ^= rotl(x11 + x07 | 0, 18); - x01 ^= rotl(x00 + x03 | 0, 7); - x02 ^= rotl(x01 + x00 | 0, 9); - x03 ^= rotl(x02 + x01 | 0, 13); - x00 ^= rotl(x03 + x02 | 0, 18); - x06 ^= rotl(x05 + x04 | 0, 7); - x07 ^= rotl(x06 + x05 | 0, 9); - x04 ^= rotl(x07 + x06 | 0, 13); - x05 ^= rotl(x04 + x07 | 0, 18); - x11 ^= rotl(x10 + x09 | 0, 7); - x08 ^= rotl(x11 + x10 | 0, 9); - x09 ^= rotl(x08 + x11 | 0, 13); - x10 ^= rotl(x09 + x08 | 0, 18); - x12 ^= rotl(x15 + x14 | 0, 7); - x13 ^= rotl(x12 + x15 | 0, 9); - x14 ^= rotl(x13 + x12 | 0, 13); - x15 ^= rotl(x14 + x13 | 0, 18); - } - // Write output (salsa) - out[oi++] = (y00 + x00) | 0; - out[oi++] = (y01 + x01) | 0; - out[oi++] = (y02 + x02) | 0; - out[oi++] = (y03 + x03) | 0; - out[oi++] = (y04 + x04) | 0; - out[oi++] = (y05 + x05) | 0; - out[oi++] = (y06 + x06) | 0; - out[oi++] = (y07 + x07) | 0; - out[oi++] = (y08 + x08) | 0; - out[oi++] = (y09 + x09) | 0; - out[oi++] = (y10 + x10) | 0; - out[oi++] = (y11 + x11) | 0; - out[oi++] = (y12 + x12) | 0; - out[oi++] = (y13 + x13) | 0; - out[oi++] = (y14 + x14) | 0; - out[oi++] = (y15 + x15) | 0; - } - function BlockMix(input, ii, out, oi, r) { - // The block B is r 128-byte chunks (which is equivalent of 2r 64-byte chunks) - let head = oi + 0; - let tail = oi + 16 * r; - for (let i = 0; i < 16; i++) - out[tail + i] = input[ii + (2 * r - 1) * 16 + i]; // X ← B[2r−1] - for (let i = 0; i < r; i++, head += 16, ii += 16) { - // We write odd & even Yi at same time. Even: 0bXXXXX0 Odd: 0bXXXXX1 - XorAndSalsa(out, tail, input, ii, out, head); // head[i] = Salsa(blockIn[2*i] ^ tail[i-1]) - if (i > 0) - tail += 16; // First iteration overwrites tmp value in tail - XorAndSalsa(out, head, input, (ii += 16), out, tail); // tail[i] = Salsa(blockIn[2*i+1] ^ head[i]) - } - } - // Common prologue and epilogue for sync/async functions - function scryptInit(password, salt, _opts) { - // Maxmem - 1GB+1KB by default - const opts = checkOpts({ - dkLen: 32, - asyncTick: 10, - maxmem: 1024 ** 3 + 1024, - }, _opts); - const { N, r, p, dkLen, asyncTick, maxmem, onProgress } = opts; - number(N); - number(r); - number(p); - number(dkLen); - number(asyncTick); - number(maxmem); - if (onProgress !== undefined && typeof onProgress !== 'function') - throw new Error('progressCb should be function'); - const blockSize = 128 * r; - const blockSize32 = blockSize / 4; - if (N <= 1 || (N & (N - 1)) !== 0 || N >= 2 ** (blockSize / 8) || N > 2 ** 32) { - // NOTE: we limit N to be less than 2**32 because of 32 bit variant of Integrify function - // There is no JS engines that allows alocate more than 4GB per single Uint8Array for now, but can change in future. - throw new Error('Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32'); - } - if (p < 0 || p > ((2 ** 32 - 1) * 32) / blockSize) { - throw new Error('Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)'); - } - if (dkLen < 0 || dkLen > (2 ** 32 - 1) * 32) { - throw new Error('Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32'); - } - const memUsed = blockSize * (N + p); - if (memUsed > maxmem) { - throw new Error(`Scrypt: parameters too large, ${memUsed} (128 * r * (N + p)) > ${maxmem} (maxmem)`); - } - // [B0...Bp−1] ← PBKDF2HMAC-SHA256(Passphrase, Salt, 1, blockSize*ParallelizationFactor) - // Since it has only one iteration there is no reason to use async variant - const B = pbkdf2$1(sha256$1, password, salt, { c: 1, dkLen: blockSize * p }); - const B32 = u32(B); - // Re-used between parallel iterations. Array(iterations) of B - const V = u32(new Uint8Array(blockSize * N)); - const tmp = u32(new Uint8Array(blockSize)); - let blockMixCb = () => { }; - if (onProgress) { - const totalBlockMix = 2 * N * p; - // Invoke callback if progress changes from 10.01 to 10.02 - // Allows to draw smooth progress bar on up to 8K screen - const callbackPer = Math.max(Math.floor(totalBlockMix / 10000), 1); - let blockMixCnt = 0; - blockMixCb = () => { - blockMixCnt++; - if (onProgress && (!(blockMixCnt % callbackPer) || blockMixCnt === totalBlockMix)) - onProgress(blockMixCnt / totalBlockMix); - }; - } - return { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick }; - } - function scryptOutput(password, dkLen, B, V, tmp) { - const res = pbkdf2$1(sha256$1, password, B, { c: 1, dkLen }); - B.fill(0); - V.fill(0); - tmp.fill(0); - return res; - } - /** - * Scrypt KDF from RFC 7914. - * @param password - pass - * @param salt - salt - * @param opts - parameters - * - `N` is cpu/mem work factor (power of 2 e.g. 2**18) - * - `r` is block size (8 is common), fine-tunes sequential memory read size and performance - * - `p` is parallelization factor (1 is common) - * - `dkLen` is output key length in bytes e.g. 32. - * - `asyncTick` - (default: 10) max time in ms for which async function can block execution - * - `maxmem` - (default: `1024 ** 3 + 1024` aka 1GB+1KB). A limit that the app could use for scrypt - * - `onProgress` - callback function that would be executed for progress report - * @returns Derived key - */ - function scrypt$1(password, salt, opts) { - const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb } = scryptInit(password, salt, opts); - for (let pi = 0; pi < p; pi++) { - const Pi = blockSize32 * pi; - for (let i = 0; i < blockSize32; i++) - V[i] = B32[Pi + i]; // V[0] = B[i] - for (let i = 0, pos = 0; i < N - 1; i++) { - BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]); - blockMixCb(); - } - BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element - blockMixCb(); - for (let i = 0; i < N; i++) { - // First u32 of the last 64-byte block (u32 is LE) - const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations - for (let k = 0; k < blockSize32; k++) - tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j] - BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) - blockMixCb(); - } - } - return scryptOutput(password, dkLen, B, V, tmp); - } - /** - * Scrypt KDF from RFC 7914. - */ - async function scryptAsync(password, salt, opts) { - const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick } = scryptInit(password, salt, opts); - for (let pi = 0; pi < p; pi++) { - const Pi = blockSize32 * pi; - for (let i = 0; i < blockSize32; i++) - V[i] = B32[Pi + i]; // V[0] = B[i] - let pos = 0; - await asyncLoop(N - 1, asyncTick, () => { - BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]); - blockMixCb(); - }); - BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element - blockMixCb(); - await asyncLoop(N, asyncTick, () => { - // First u32 of the last 64-byte block (u32 is LE) - const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations - for (let k = 0; k < blockSize32; k++) - tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j] - BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) - blockMixCb(); - }); - } - return scryptOutput(password, dkLen, B, V, tmp); - } - - let lockedSync = false, lockedAsync = false; - const _scryptAsync = async function (passwd, salt, N, r, p, dkLen, onProgress) { - return await scryptAsync(passwd, salt, { N, r, p, dkLen, onProgress }); - }; - const _scryptSync = function (passwd, salt, N, r, p, dkLen) { - return scrypt$1(passwd, salt, { N, r, p, dkLen }); - }; - let __scryptAsync = _scryptAsync; - let __scryptSync = _scryptSync; - /** - * The [[link-wiki-scrypt]] uses a memory and cpu hard method of - * derivation to increase the resource cost to brute-force a password - * for a given key. - * - * This means this algorithm is intentionally slow, and can be tuned to - * become slower. As computation and memory speed improve over time, - * increasing the difficulty maintains the cost of an attacker. - * - * For example, if a target time of 5 seconds is used, a legitimate user - * which knows their password requires only 5 seconds to unlock their - * account. A 6 character password has 68 billion possibilities, which - * would require an attacker to invest over 10,000 years of CPU time. This - * is of course a crude example (as password generally aren't random), - * but demonstrates to value of imposing large costs to decryption. - * - * For this reason, if building a UI which involved decrypting or - * encrypting datsa using scrypt, it is recommended to use a - * [[ProgressCallback]] (as event short periods can seem lik an eternity - * if the UI freezes). Including the phrase //"decrypting"// in the UI - * can also help, assuring the user their waiting is for a good reason. - * - * @_docloc: api/crypto:Passwords - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the scrypt - * scrypt(passwordBytes, salt, 1024, 8, 1, 16) - * //_result: - */ - async function scrypt(_passwd, _salt, N, r, p, dkLen, progress) { - const passwd = getBytes(_passwd, "passwd"); - const salt = getBytes(_salt, "salt"); - return hexlify(await __scryptAsync(passwd, salt, N, r, p, dkLen, progress)); - } - scrypt._ = _scryptAsync; - scrypt.lock = function () { lockedAsync = true; }; - scrypt.register = function (func) { - if (lockedAsync) { - throw new Error("scrypt is locked"); - } - __scryptAsync = func; - }; - Object.freeze(scrypt); - /** - * Provides a synchronous variant of [[scrypt]]. - * - * This will completely lock up and freeze the UI in a browser and will - * prevent any event loop from progressing. For this reason, it is - * preferred to use the [async variant](scrypt). - * - * @_docloc: api/crypto:Passwords - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the scrypt - * scryptSync(passwordBytes, salt, 1024, 8, 1, 16) - * //_result: - */ - function scryptSync(_passwd, _salt, N, r, p, dkLen) { - const passwd = getBytes(_passwd, "passwd"); - const salt = getBytes(_salt, "salt"); - return hexlify(__scryptSync(passwd, salt, N, r, p, dkLen)); - } - scryptSync._ = _scryptSync; - scryptSync.lock = function () { lockedSync = true; }; - scryptSync.register = function (func) { - if (lockedSync) { - throw new Error("scryptSync is locked"); - } - __scryptSync = func; - }; - Object.freeze(scryptSync); - - const _sha256 = function (data) { - return createHash("sha256").update(data).digest(); - }; - const _sha512 = function (data) { - return createHash("sha512").update(data).digest(); - }; - let __sha256 = _sha256; - let __sha512 = _sha512; - let locked256 = false, locked512 = false; - /** - * Compute the cryptographic SHA2-256 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * sha256("0x") - * //_result: - * - * sha256("0x1337") - * //_result: - * - * sha256(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - */ - function sha256(_data) { - const data = getBytes(_data, "data"); - return hexlify(__sha256(data)); - } - sha256._ = _sha256; - sha256.lock = function () { locked256 = true; }; - sha256.register = function (func) { - if (locked256) { - throw new Error("sha256 is locked"); - } - __sha256 = func; - }; - Object.freeze(sha256); - /** - * Compute the cryptographic SHA2-512 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * sha512("0x") - * //_result: - * - * sha512("0x1337") - * //_result: - * - * sha512(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - */ - function sha512(_data) { - const data = getBytes(_data, "data"); - return hexlify(__sha512(data)); - } - sha512._ = _sha512; - sha512.lock = function () { locked512 = true; }; - sha512.register = function (func) { - if (locked512) { - throw new Error("sha512 is locked"); - } - __sha512 = func; - }; - Object.freeze(sha256); - - /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ - // 100 lines of code in the file are duplicated from noble-hashes (utils). - // This is OK: `abstract` directory does not use noble-hashes. - // User may opt-in into using different hashing library. This way, noble-hashes - // won't be included into their bundle. - const _0n$3 = BigInt(0); - const _1n$4 = BigInt(1); - const _2n$2 = BigInt(2); - const u8a = (a) => a instanceof Uint8Array; - const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0')); - /** - * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123' - */ - function bytesToHex(bytes) { - if (!u8a(bytes)) - throw new Error('Uint8Array expected'); - // pre-caching improves the speed 6x - let hex = ''; - for (let i = 0; i < bytes.length; i++) { - hex += hexes[bytes[i]]; - } - return hex; - } - function numberToHexUnpadded(num) { - const hex = num.toString(16); - return hex.length & 1 ? `0${hex}` : hex; - } - function hexToNumber(hex) { - if (typeof hex !== 'string') - throw new Error('hex string expected, got ' + typeof hex); - // Big Endian - return BigInt(hex === '' ? '0' : `0x${hex}`); - } - /** - * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23]) - */ - function hexToBytes(hex) { - if (typeof hex !== 'string') - throw new Error('hex string expected, got ' + typeof hex); - const len = hex.length; - if (len % 2) - throw new Error('padded hex string expected, got unpadded hex of length ' + len); - const array = new Uint8Array(len / 2); - for (let i = 0; i < array.length; i++) { - const j = i * 2; - const hexByte = hex.slice(j, j + 2); - const byte = Number.parseInt(hexByte, 16); - if (Number.isNaN(byte) || byte < 0) - throw new Error('Invalid byte sequence'); - array[i] = byte; - } - return array; - } - // BE: Big Endian, LE: Little Endian - function bytesToNumberBE(bytes) { - return hexToNumber(bytesToHex(bytes)); - } - function bytesToNumberLE(bytes) { - if (!u8a(bytes)) - throw new Error('Uint8Array expected'); - return hexToNumber(bytesToHex(Uint8Array.from(bytes).reverse())); - } - function numberToBytesBE(n, len) { - return hexToBytes(n.toString(16).padStart(len * 2, '0')); - } - function numberToBytesLE(n, len) { - return numberToBytesBE(n, len).reverse(); - } - // Unpadded, rarely used - function numberToVarBytesBE(n) { - return hexToBytes(numberToHexUnpadded(n)); - } - /** - * Takes hex string or Uint8Array, converts to Uint8Array. - * Validates output length. - * Will throw error for other types. - * @param title descriptive title for an error e.g. 'private key' - * @param hex hex string or Uint8Array - * @param expectedLength optional, will compare to result array's length - * @returns - */ - function ensureBytes(title, hex, expectedLength) { - let res; - if (typeof hex === 'string') { - try { - res = hexToBytes(hex); - } - catch (e) { - throw new Error(`${title} must be valid hex string, got "${hex}". Cause: ${e}`); - } - } - else if (u8a(hex)) { - // Uint8Array.from() instead of hash.slice() because node.js Buffer - // is instance of Uint8Array, and its slice() creates **mutable** copy - res = Uint8Array.from(hex); - } - else { - throw new Error(`${title} must be hex string or Uint8Array`); - } - const len = res.length; - if (typeof expectedLength === 'number' && len !== expectedLength) - throw new Error(`${title} expected ${expectedLength} bytes, got ${len}`); - return res; - } - /** - * Copies several Uint8Arrays into one. - */ - function concatBytes(...arrays) { - const r = new Uint8Array(arrays.reduce((sum, a) => sum + a.length, 0)); - let pad = 0; // walk through each item, ensure they have proper type - arrays.forEach((a) => { - if (!u8a(a)) - throw new Error('Uint8Array expected'); - r.set(a, pad); - pad += a.length; - }); - return r; - } - function equalBytes(b1, b2) { - // We don't care about timing attacks here - if (b1.length !== b2.length) - return false; - for (let i = 0; i < b1.length; i++) - if (b1[i] !== b2[i]) - return false; - return true; - } - /** - * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99]) - */ - function utf8ToBytes(str) { - if (typeof str !== 'string') - throw new Error(`utf8ToBytes expected string, got ${typeof str}`); - return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809 - } - // Bit operations - /** - * Calculates amount of bits in a bigint. - * Same as `n.toString(2).length` - */ - function bitLen(n) { - let len; - for (len = 0; n > _0n$3; n >>= _1n$4, len += 1) - ; - return len; - } - /** - * Gets single bit at position. - * NOTE: first bit position is 0 (same as arrays) - * Same as `!!+Array.from(n.toString(2)).reverse()[pos]` - */ - function bitGet(n, pos) { - return (n >> BigInt(pos)) & _1n$4; - } - /** - * Sets single bit at position. - */ - const bitSet = (n, pos, value) => { - return n | ((value ? _1n$4 : _0n$3) << BigInt(pos)); - }; - /** - * Calculate mask for N bits. Not using ** operator with bigints because of old engines. - * Same as BigInt(`0b${Array(i).fill('1').join('')}`) - */ - const bitMask = (n) => (_2n$2 << BigInt(n - 1)) - _1n$4; - // DRBG - const u8n = (data) => new Uint8Array(data); // creates Uint8Array - const u8fr = (arr) => Uint8Array.from(arr); // another shortcut - /** - * Minimal HMAC-DRBG from NIST 800-90 for RFC6979 sigs. - * @returns function that will call DRBG until 2nd arg returns something meaningful - * @example - * const drbg = createHmacDRBG(32, 32, hmac); - * drbg(seed, bytesToKey); // bytesToKey must return Key or undefined - */ - function createHmacDrbg(hashLen, qByteLen, hmacFn) { - if (typeof hashLen !== 'number' || hashLen < 2) - throw new Error('hashLen must be a number'); - if (typeof qByteLen !== 'number' || qByteLen < 2) - throw new Error('qByteLen must be a number'); - if (typeof hmacFn !== 'function') - throw new Error('hmacFn must be a function'); - // Step B, Step C: set hashLen to 8*ceil(hlen/8) - let v = u8n(hashLen); // Minimal non-full-spec HMAC-DRBG from NIST 800-90 for RFC6979 sigs. - let k = u8n(hashLen); // Steps B and C of RFC6979 3.2: set hashLen, in our case always same - let i = 0; // Iterations counter, will throw when over 1000 - const reset = () => { - v.fill(1); - k.fill(0); - i = 0; - }; - const h = (...b) => hmacFn(k, v, ...b); // hmac(k)(v, ...values) - const reseed = (seed = u8n()) => { - // HMAC-DRBG reseed() function. Steps D-G - k = h(u8fr([0x00]), seed); // k = hmac(k || v || 0x00 || seed) - v = h(); // v = hmac(k || v) - if (seed.length === 0) - return; - k = h(u8fr([0x01]), seed); // k = hmac(k || v || 0x01 || seed) - v = h(); // v = hmac(k || v) - }; - const gen = () => { - // HMAC-DRBG generate() function - if (i++ >= 1000) - throw new Error('drbg: tried 1000 values'); - let len = 0; - const out = []; - while (len < qByteLen) { - v = h(); - const sl = v.slice(); - out.push(sl); - len += v.length; - } - return concatBytes(...out); - }; - const genUntil = (seed, pred) => { - reset(); - reseed(seed); // Steps D-G - let res = undefined; // Step H: grind until k is in [1..n-1] - while (!(res = pred(gen()))) - reseed(); - reset(); - return res; - }; - return genUntil; - } - // Validating curves and fields - const validatorFns = { - bigint: (val) => typeof val === 'bigint', - function: (val) => typeof val === 'function', - boolean: (val) => typeof val === 'boolean', - string: (val) => typeof val === 'string', - stringOrUint8Array: (val) => typeof val === 'string' || val instanceof Uint8Array, - isSafeInteger: (val) => Number.isSafeInteger(val), - array: (val) => Array.isArray(val), - field: (val, object) => object.Fp.isValid(val), - hash: (val) => typeof val === 'function' && Number.isSafeInteger(val.outputLen), - }; - // type Record = { [P in K]: T; } - function validateObject(object, validators, optValidators = {}) { - const checkField = (fieldName, type, isOptional) => { - const checkVal = validatorFns[type]; - if (typeof checkVal !== 'function') - throw new Error(`Invalid validator "${type}", expected function`); - const val = object[fieldName]; - if (isOptional && val === undefined) - return; - if (!checkVal(val, object)) { - throw new Error(`Invalid param ${String(fieldName)}=${val} (${typeof val}), expected ${type}`); - } - }; - for (const [fieldName, type] of Object.entries(validators)) - checkField(fieldName, type, false); - for (const [fieldName, type] of Object.entries(optValidators)) - checkField(fieldName, type, true); - return object; - } - // validate type tests - // const o: { a: number; b: number; c: number } = { a: 1, b: 5, c: 6 }; - // const z0 = validateObject(o, { a: 'isSafeInteger' }, { c: 'bigint' }); // Ok! - // // Should fail type-check - // const z1 = validateObject(o, { a: 'tmp' }, { c: 'zz' }); - // const z2 = validateObject(o, { a: 'isSafeInteger' }, { c: 'zz' }); - // const z3 = validateObject(o, { test: 'boolean', z: 'bug' }); - // const z4 = validateObject(o, { a: 'boolean', z: 'bug' }); - - var ut = /*#__PURE__*/Object.freeze({ - __proto__: null, - bitGet: bitGet, - bitLen: bitLen, - bitMask: bitMask, - bitSet: bitSet, - bytesToHex: bytesToHex, - bytesToNumberBE: bytesToNumberBE, - bytesToNumberLE: bytesToNumberLE, - concatBytes: concatBytes, - createHmacDrbg: createHmacDrbg, - ensureBytes: ensureBytes, - equalBytes: equalBytes, - hexToBytes: hexToBytes, - hexToNumber: hexToNumber, - numberToBytesBE: numberToBytesBE, - numberToBytesLE: numberToBytesLE, - numberToHexUnpadded: numberToHexUnpadded, - numberToVarBytesBE: numberToVarBytesBE, - utf8ToBytes: utf8ToBytes, - validateObject: validateObject - }); - - /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ - // Utilities for modular arithmetics and finite fields - // prettier-ignore - const _0n$2 = BigInt(0), _1n$3 = BigInt(1), _2n$1 = BigInt(2), _3n$1 = BigInt(3); - // prettier-ignore - const _4n = BigInt(4), _5n = BigInt(5), _8n = BigInt(8); - // prettier-ignore - BigInt(9); BigInt(16); - // Calculates a modulo b - function mod(a, b) { - const result = a % b; - return result >= _0n$2 ? result : b + result; - } - /** - * Efficiently raise num to power and do modular division. - * Unsafe in some contexts: uses ladder, so can expose bigint bits. - * @example - * pow(2n, 6n, 11n) // 64n % 11n == 9n - */ - // TODO: use field version && remove - function pow(num, power, modulo) { - if (modulo <= _0n$2 || power < _0n$2) - throw new Error('Expected power/modulo > 0'); - if (modulo === _1n$3) - return _0n$2; - let res = _1n$3; - while (power > _0n$2) { - if (power & _1n$3) - res = (res * num) % modulo; - num = (num * num) % modulo; - power >>= _1n$3; - } - return res; - } - // Does x ^ (2 ^ power) mod p. pow2(30, 4) == 30 ^ (2 ^ 4) - function pow2(x, power, modulo) { - let res = x; - while (power-- > _0n$2) { - res *= res; - res %= modulo; - } - return res; - } - // Inverses number over modulo - function invert(number, modulo) { - if (number === _0n$2 || modulo <= _0n$2) { - throw new Error(`invert: expected positive integers, got n=${number} mod=${modulo}`); - } - // Euclidean GCD https://brilliant.org/wiki/extended-euclidean-algorithm/ - // Fermat's little theorem "CT-like" version inv(n) = n^(m-2) mod m is 30x slower. - let a = mod(number, modulo); - let b = modulo; - // prettier-ignore - let x = _0n$2, u = _1n$3; - while (a !== _0n$2) { - // JIT applies optimization if those two lines follow each other - const q = b / a; - const r = b % a; - const m = x - u * q; - // prettier-ignore - b = a, a = r, x = u, u = m; - } - const gcd = b; - if (gcd !== _1n$3) - throw new Error('invert: does not exist'); - return mod(x, modulo); - } - /** - * Tonelli-Shanks square root search algorithm. - * 1. https://eprint.iacr.org/2012/685.pdf (page 12) - * 2. Square Roots from 1; 24, 51, 10 to Dan Shanks - * Will start an infinite loop if field order P is not prime. - * @param P field order - * @returns function that takes field Fp (created from P) and number n - */ - function tonelliShanks(P) { - // Legendre constant: used to calculate Legendre symbol (a | p), - // which denotes the value of a^((p-1)/2) (mod p). - // (a | p) ≡ 1 if a is a square (mod p) - // (a | p) ≡ -1 if a is not a square (mod p) - // (a | p) ≡ 0 if a ≡ 0 (mod p) - const legendreC = (P - _1n$3) / _2n$1; - let Q, S, Z; - // Step 1: By factoring out powers of 2 from p - 1, - // find q and s such that p - 1 = q*(2^s) with q odd - for (Q = P - _1n$3, S = 0; Q % _2n$1 === _0n$2; Q /= _2n$1, S++) - ; - // Step 2: Select a non-square z such that (z | p) ≡ -1 and set c ≡ zq - for (Z = _2n$1; Z < P && pow(Z, legendreC, P) !== P - _1n$3; Z++) - ; - // Fast-path - if (S === 1) { - const p1div4 = (P + _1n$3) / _4n; - return function tonelliFast(Fp, n) { - const root = Fp.pow(n, p1div4); - if (!Fp.eql(Fp.sqr(root), n)) - throw new Error('Cannot find square root'); - return root; - }; - } - // Slow-path - const Q1div2 = (Q + _1n$3) / _2n$1; - return function tonelliSlow(Fp, n) { - // Step 0: Check that n is indeed a square: (n | p) should not be ≡ -1 - if (Fp.pow(n, legendreC) === Fp.neg(Fp.ONE)) - throw new Error('Cannot find square root'); - let r = S; - // TODO: will fail at Fp2/etc - let g = Fp.pow(Fp.mul(Fp.ONE, Z), Q); // will update both x and b - let x = Fp.pow(n, Q1div2); // first guess at the square root - let b = Fp.pow(n, Q); // first guess at the fudge factor - while (!Fp.eql(b, Fp.ONE)) { - if (Fp.eql(b, Fp.ZERO)) - return Fp.ZERO; // https://en.wikipedia.org/wiki/Tonelli%E2%80%93Shanks_algorithm (4. If t = 0, return r = 0) - // Find m such b^(2^m)==1 - let m = 1; - for (let t2 = Fp.sqr(b); m < r; m++) { - if (Fp.eql(t2, Fp.ONE)) - break; - t2 = Fp.sqr(t2); // t2 *= t2 - } - // NOTE: r-m-1 can be bigger than 32, need to convert to bigint before shift, otherwise there will be overflow - const ge = Fp.pow(g, _1n$3 << BigInt(r - m - 1)); // ge = 2^(r-m-1) - g = Fp.sqr(ge); // g = ge * ge - x = Fp.mul(x, ge); // x *= ge - b = Fp.mul(b, g); // b *= g - r = m; - } - return x; - }; - } - function FpSqrt(P) { - // NOTE: different algorithms can give different roots, it is up to user to decide which one they want. - // For example there is FpSqrtOdd/FpSqrtEven to choice root based on oddness (used for hash-to-curve). - // P ≡ 3 (mod 4) - // √n = n^((P+1)/4) - if (P % _4n === _3n$1) { - // Not all roots possible! - // const ORDER = - // 0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaabn; - // const NUM = 72057594037927816n; - const p1div4 = (P + _1n$3) / _4n; - return function sqrt3mod4(Fp, n) { - const root = Fp.pow(n, p1div4); - // Throw if root**2 != n - if (!Fp.eql(Fp.sqr(root), n)) - throw new Error('Cannot find square root'); - return root; - }; - } - // Atkin algorithm for q ≡ 5 (mod 8), https://eprint.iacr.org/2012/685.pdf (page 10) - if (P % _8n === _5n) { - const c1 = (P - _5n) / _8n; - return function sqrt5mod8(Fp, n) { - const n2 = Fp.mul(n, _2n$1); - const v = Fp.pow(n2, c1); - const nv = Fp.mul(n, v); - const i = Fp.mul(Fp.mul(nv, _2n$1), v); - const root = Fp.mul(nv, Fp.sub(i, Fp.ONE)); - if (!Fp.eql(Fp.sqr(root), n)) - throw new Error('Cannot find square root'); - return root; - }; - } - // Other cases: Tonelli-Shanks algorithm - return tonelliShanks(P); - } - // prettier-ignore - const FIELD_FIELDS = [ - 'create', 'isValid', 'is0', 'neg', 'inv', 'sqrt', 'sqr', - 'eql', 'add', 'sub', 'mul', 'pow', 'div', - 'addN', 'subN', 'mulN', 'sqrN' - ]; - function validateField(field) { - const initial = { - ORDER: 'bigint', - MASK: 'bigint', - BYTES: 'isSafeInteger', - BITS: 'isSafeInteger', - }; - const opts = FIELD_FIELDS.reduce((map, val) => { - map[val] = 'function'; - return map; - }, initial); - return validateObject(field, opts); - } - // Generic field functions - /** - * Same as `pow` but for Fp: non-constant-time. - * Unsafe in some contexts: uses ladder, so can expose bigint bits. - */ - function FpPow(f, num, power) { - // Should have same speed as pow for bigints - // TODO: benchmark! - if (power < _0n$2) - throw new Error('Expected power > 0'); - if (power === _0n$2) - return f.ONE; - if (power === _1n$3) - return num; - let p = f.ONE; - let d = num; - while (power > _0n$2) { - if (power & _1n$3) - p = f.mul(p, d); - d = f.sqr(d); - power >>= _1n$3; - } - return p; - } - /** - * Efficiently invert an array of Field elements. - * `inv(0)` will return `undefined` here: make sure to throw an error. - */ - function FpInvertBatch(f, nums) { - const tmp = new Array(nums.length); - // Walk from first to last, multiply them by each other MOD p - const lastMultiplied = nums.reduce((acc, num, i) => { - if (f.is0(num)) - return acc; - tmp[i] = acc; - return f.mul(acc, num); - }, f.ONE); - // Invert last element - const inverted = f.inv(lastMultiplied); - // Walk from last to first, multiply them by inverted each other MOD p - nums.reduceRight((acc, num, i) => { - if (f.is0(num)) - return acc; - tmp[i] = f.mul(acc, tmp[i]); - return f.mul(acc, num); - }, inverted); - return tmp; - } - // CURVE.n lengths - function nLength(n, nBitLength) { - // Bit size, byte size of CURVE.n - const _nBitLength = nBitLength !== undefined ? nBitLength : n.toString(2).length; - const nByteLength = Math.ceil(_nBitLength / 8); - return { nBitLength: _nBitLength, nByteLength }; - } - /** - * Initializes a finite field over prime. **Non-primes are not supported.** - * Do not init in loop: slow. Very fragile: always run a benchmark on a change. - * Major performance optimizations: - * * a) denormalized operations like mulN instead of mul - * * b) same object shape: never add or remove keys - * * c) Object.freeze - * @param ORDER prime positive bigint - * @param bitLen how many bits the field consumes - * @param isLE (def: false) if encoding / decoding should be in little-endian - * @param redef optional faster redefinitions of sqrt and other methods - */ - function Field(ORDER, bitLen, isLE = false, redef = {}) { - if (ORDER <= _0n$2) - throw new Error(`Expected Field ORDER > 0, got ${ORDER}`); - const { nBitLength: BITS, nByteLength: BYTES } = nLength(ORDER, bitLen); - if (BYTES > 2048) - throw new Error('Field lengths over 2048 bytes are not supported'); - const sqrtP = FpSqrt(ORDER); - const f = Object.freeze({ - ORDER, - BITS, - BYTES, - MASK: bitMask(BITS), - ZERO: _0n$2, - ONE: _1n$3, - create: (num) => mod(num, ORDER), - isValid: (num) => { - if (typeof num !== 'bigint') - throw new Error(`Invalid field element: expected bigint, got ${typeof num}`); - return _0n$2 <= num && num < ORDER; // 0 is valid element, but it's not invertible - }, - is0: (num) => num === _0n$2, - isOdd: (num) => (num & _1n$3) === _1n$3, - neg: (num) => mod(-num, ORDER), - eql: (lhs, rhs) => lhs === rhs, - sqr: (num) => mod(num * num, ORDER), - add: (lhs, rhs) => mod(lhs + rhs, ORDER), - sub: (lhs, rhs) => mod(lhs - rhs, ORDER), - mul: (lhs, rhs) => mod(lhs * rhs, ORDER), - pow: (num, power) => FpPow(f, num, power), - div: (lhs, rhs) => mod(lhs * invert(rhs, ORDER), ORDER), - // Same as above, but doesn't normalize - sqrN: (num) => num * num, - addN: (lhs, rhs) => lhs + rhs, - subN: (lhs, rhs) => lhs - rhs, - mulN: (lhs, rhs) => lhs * rhs, - inv: (num) => invert(num, ORDER), - sqrt: redef.sqrt || ((n) => sqrtP(f, n)), - invertBatch: (lst) => FpInvertBatch(f, lst), - // TODO: do we really need constant cmov? - // We don't have const-time bigints anyway, so probably will be not very useful - cmov: (a, b, c) => (c ? b : a), - toBytes: (num) => (isLE ? numberToBytesLE(num, BYTES) : numberToBytesBE(num, BYTES)), - fromBytes: (bytes) => { - if (bytes.length !== BYTES) - throw new Error(`Fp.fromBytes: expected ${BYTES}, got ${bytes.length}`); - return isLE ? bytesToNumberLE(bytes) : bytesToNumberBE(bytes); - }, - }); - return Object.freeze(f); - } - /** - * Returns total number of bytes consumed by the field element. - * For example, 32 bytes for usual 256-bit weierstrass curve. - * @param fieldOrder number of field elements, usually CURVE.n - * @returns byte length of field - */ - function getFieldBytesLength(fieldOrder) { - if (typeof fieldOrder !== 'bigint') - throw new Error('field order must be bigint'); - const bitLength = fieldOrder.toString(2).length; - return Math.ceil(bitLength / 8); - } - /** - * Returns minimal amount of bytes that can be safely reduced - * by field order. - * Should be 2^-128 for 128-bit curve such as P256. - * @param fieldOrder number of field elements, usually CURVE.n - * @returns byte length of target hash - */ - function getMinHashLength(fieldOrder) { - const length = getFieldBytesLength(fieldOrder); - return length + Math.ceil(length / 2); - } - /** - * "Constant-time" private key generation utility. - * Can take (n + n/2) or more bytes of uniform input e.g. from CSPRNG or KDF - * and convert them into private scalar, with the modulo bias being negligible. - * Needs at least 48 bytes of input for 32-byte private key. - * https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/ - * FIPS 186-5, A.2 https://csrc.nist.gov/publications/detail/fips/186/5/final - * RFC 9380, https://www.rfc-editor.org/rfc/rfc9380#section-5 - * @param hash hash output from SHA3 or a similar function - * @param groupOrder size of subgroup - (e.g. secp256k1.CURVE.n) - * @param isLE interpret hash bytes as LE num - * @returns valid private scalar - */ - function mapHashToField(key, fieldOrder, isLE = false) { - const len = key.length; - const fieldLen = getFieldBytesLength(fieldOrder); - const minLen = getMinHashLength(fieldOrder); - // No small numbers: need to understand bias story. No huge numbers: easier to detect JS timings. - if (len < 16 || len < minLen || len > 1024) - throw new Error(`expected ${minLen}-1024 bytes of input, got ${len}`); - const num = isLE ? bytesToNumberBE(key) : bytesToNumberLE(key); - // `mod(x, 11)` can sometimes produce 0. `mod(x, 10) + 1` is the same, but no 0 - const reduced = mod(num, fieldOrder - _1n$3) + _1n$3; - return isLE ? numberToBytesLE(reduced, fieldLen) : numberToBytesBE(reduced, fieldLen); - } - - /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ - // Abelian group utilities - const _0n$1 = BigInt(0); - const _1n$2 = BigInt(1); - // Elliptic curve multiplication of Point by scalar. Fragile. - // Scalars should always be less than curve order: this should be checked inside of a curve itself. - // Creates precomputation tables for fast multiplication: - // - private scalar is split by fixed size windows of W bits - // - every window point is collected from window's table & added to accumulator - // - since windows are different, same point inside tables won't be accessed more than once per calc - // - each multiplication is 'Math.ceil(CURVE_ORDER / 𝑊) + 1' point additions (fixed for any scalar) - // - +1 window is neccessary for wNAF - // - wNAF reduces table size: 2x less memory + 2x faster generation, but 10% slower multiplication - // TODO: Research returning 2d JS array of windows, instead of a single window. This would allow - // windows to be in different memory locations - function wNAF(c, bits) { - const constTimeNegate = (condition, item) => { - const neg = item.negate(); - return condition ? neg : item; - }; - const opts = (W) => { - const windows = Math.ceil(bits / W) + 1; // +1, because - const windowSize = 2 ** (W - 1); // -1 because we skip zero - return { windows, windowSize }; - }; - return { - constTimeNegate, - // non-const time multiplication ladder - unsafeLadder(elm, n) { - let p = c.ZERO; - let d = elm; - while (n > _0n$1) { - if (n & _1n$2) - p = p.add(d); - d = d.double(); - n >>= _1n$2; - } - return p; - }, - /** - * Creates a wNAF precomputation window. Used for caching. - * Default window size is set by `utils.precompute()` and is equal to 8. - * Number of precomputed points depends on the curve size: - * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where: - * - 𝑊 is the window size - * - 𝑛 is the bitlength of the curve order. - * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224. - * @returns precomputed point tables flattened to a single array - */ - precomputeWindow(elm, W) { - const { windows, windowSize } = opts(W); - const points = []; - let p = elm; - let base = p; - for (let window = 0; window < windows; window++) { - base = p; - points.push(base); - // =1, because we skip zero - for (let i = 1; i < windowSize; i++) { - base = base.add(p); - points.push(base); - } - p = base.double(); - } - return points; - }, - /** - * Implements ec multiplication using precomputed tables and w-ary non-adjacent form. - * @param W window size - * @param precomputes precomputed tables - * @param n scalar (we don't check here, but should be less than curve order) - * @returns real and fake (for const-time) points - */ - wNAF(W, precomputes, n) { - // TODO: maybe check that scalar is less than group order? wNAF behavious is undefined otherwise - // But need to carefully remove other checks before wNAF. ORDER == bits here - const { windows, windowSize } = opts(W); - let p = c.ZERO; - let f = c.BASE; - const mask = BigInt(2 ** W - 1); // Create mask with W ones: 0b1111 for W=4 etc. - const maxNumber = 2 ** W; - const shiftBy = BigInt(W); - for (let window = 0; window < windows; window++) { - const offset = window * windowSize; - // Extract W bits. - let wbits = Number(n & mask); - // Shift number by W bits. - n >>= shiftBy; - // If the bits are bigger than max size, we'll split those. - // +224 => 256 - 32 - if (wbits > windowSize) { - wbits -= maxNumber; - n += _1n$2; - } - // This code was first written with assumption that 'f' and 'p' will never be infinity point: - // since each addition is multiplied by 2 ** W, it cannot cancel each other. However, - // there is negate now: it is possible that negated element from low value - // would be the same as high element, which will create carry into next window. - // It's not obvious how this can fail, but still worth investigating later. - // Check if we're onto Zero point. - // Add random point inside current window to f. - const offset1 = offset; - const offset2 = offset + Math.abs(wbits) - 1; // -1 because we skip zero - const cond1 = window % 2 !== 0; - const cond2 = wbits < 0; - if (wbits === 0) { - // The most important part for const-time getPublicKey - f = f.add(constTimeNegate(cond1, precomputes[offset1])); - } - else { - p = p.add(constTimeNegate(cond2, precomputes[offset2])); - } - } - // JIT-compiler should not eliminate f here, since it will later be used in normalizeZ() - // Even if the variable is still unused, there are some checks which will - // throw an exception, so compiler needs to prove they won't happen, which is hard. - // At this point there is a way to F be infinity-point even if p is not, - // which makes it less const-time: around 1 bigint multiply. - return { p, f }; - }, - wNAFCached(P, precomputesMap, n, transform) { - // @ts-ignore - const W = P._WINDOW_SIZE || 1; - // Calculate precomputes on a first run, reuse them after - let comp = precomputesMap.get(P); - if (!comp) { - comp = this.precomputeWindow(P, W); - if (W !== 1) { - precomputesMap.set(P, transform(comp)); - } - } - return this.wNAF(W, comp, n); - }, - }; - } - function validateBasic(curve) { - validateField(curve.Fp); - validateObject(curve, { - n: 'bigint', - h: 'bigint', - Gx: 'field', - Gy: 'field', - }, { - nBitLength: 'isSafeInteger', - nByteLength: 'isSafeInteger', - }); - // Set defaults - return Object.freeze({ - ...nLength(curve.n, curve.nBitLength), - ...curve, - ...{ p: curve.Fp.ORDER }, - }); - } - - /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ - // Short Weierstrass curve. The formula is: y² = x³ + ax + b - function validatePointOpts(curve) { - const opts = validateBasic(curve); - validateObject(opts, { - a: 'field', - b: 'field', - }, { - allowedPrivateKeyLengths: 'array', - wrapPrivateKey: 'boolean', - isTorsionFree: 'function', - clearCofactor: 'function', - allowInfinityPoint: 'boolean', - fromBytes: 'function', - toBytes: 'function', - }); - const { endo, Fp, a } = opts; - if (endo) { - if (!Fp.eql(a, Fp.ZERO)) { - throw new Error('Endomorphism can only be defined for Koblitz curves that have a=0'); - } - if (typeof endo !== 'object' || - typeof endo.beta !== 'bigint' || - typeof endo.splitScalar !== 'function') { - throw new Error('Expected endomorphism with beta: bigint and splitScalar: function'); - } - } - return Object.freeze({ ...opts }); - } - // ASN.1 DER encoding utilities - const { bytesToNumberBE: b2n, hexToBytes: h2b } = ut; - const DER = { - // asn.1 DER encoding utils - Err: class DERErr extends Error { - constructor(m = '') { - super(m); - } - }, - _parseInt(data) { - const { Err: E } = DER; - if (data.length < 2 || data[0] !== 0x02) - throw new E('Invalid signature integer tag'); - const len = data[1]; - const res = data.subarray(2, len + 2); - if (!len || res.length !== len) - throw new E('Invalid signature integer: wrong length'); - // https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag, - // since we always use positive integers here. It must always be empty: - // - add zero byte if exists - // - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding) - if (res[0] & 0b10000000) - throw new E('Invalid signature integer: negative'); - if (res[0] === 0x00 && !(res[1] & 0b10000000)) - throw new E('Invalid signature integer: unnecessary leading zero'); - return { d: b2n(res), l: data.subarray(len + 2) }; // d is data, l is left - }, - toSig(hex) { - // parse DER signature - const { Err: E } = DER; - const data = typeof hex === 'string' ? h2b(hex) : hex; - if (!(data instanceof Uint8Array)) - throw new Error('ui8a expected'); - let l = data.length; - if (l < 2 || data[0] != 0x30) - throw new E('Invalid signature tag'); - if (data[1] !== l - 2) - throw new E('Invalid signature: incorrect length'); - const { d: r, l: sBytes } = DER._parseInt(data.subarray(2)); - const { d: s, l: rBytesLeft } = DER._parseInt(sBytes); - if (rBytesLeft.length) - throw new E('Invalid signature: left bytes after parsing'); - return { r, s }; - }, - hexFromSig(sig) { - // Add leading zero if first byte has negative bit enabled. More details in '_parseInt' - const slice = (s) => (Number.parseInt(s[0], 16) & 0b1000 ? '00' + s : s); - const h = (num) => { - const hex = num.toString(16); - return hex.length & 1 ? `0${hex}` : hex; - }; - const s = slice(h(sig.s)); - const r = slice(h(sig.r)); - const shl = s.length / 2; - const rhl = r.length / 2; - const sl = h(shl); - const rl = h(rhl); - return `30${h(rhl + shl + 4)}02${rl}${r}02${sl}${s}`; - }, - }; - // Be friendly to bad ECMAScript parsers by not using bigint literals - // prettier-ignore - const _0n = BigInt(0), _1n$1 = BigInt(1); BigInt(2); const _3n = BigInt(3); BigInt(4); - function weierstrassPoints(opts) { - const CURVE = validatePointOpts(opts); - const { Fp } = CURVE; // All curves has same field / group length as for now, but they can differ - const toBytes = CURVE.toBytes || - ((_c, point, _isCompressed) => { - const a = point.toAffine(); - return concatBytes(Uint8Array.from([0x04]), Fp.toBytes(a.x), Fp.toBytes(a.y)); - }); - const fromBytes = CURVE.fromBytes || - ((bytes) => { - // const head = bytes[0]; - const tail = bytes.subarray(1); - // if (head !== 0x04) throw new Error('Only non-compressed encoding is supported'); - const x = Fp.fromBytes(tail.subarray(0, Fp.BYTES)); - const y = Fp.fromBytes(tail.subarray(Fp.BYTES, 2 * Fp.BYTES)); - return { x, y }; - }); - /** - * y² = x³ + ax + b: Short weierstrass curve formula - * @returns y² - */ - function weierstrassEquation(x) { - const { a, b } = CURVE; - const x2 = Fp.sqr(x); // x * x - const x3 = Fp.mul(x2, x); // x2 * x - return Fp.add(Fp.add(x3, Fp.mul(x, a)), b); // x3 + a * x + b - } - // Validate whether the passed curve params are valid. - // We check if curve equation works for generator point. - // `assertValidity()` won't work: `isTorsionFree()` is not available at this point in bls12-381. - // ProjectivePoint class has not been initialized yet. - if (!Fp.eql(Fp.sqr(CURVE.Gy), weierstrassEquation(CURVE.Gx))) - throw new Error('bad generator point: equation left != right'); - // Valid group elements reside in range 1..n-1 - function isWithinCurveOrder(num) { - return typeof num === 'bigint' && _0n < num && num < CURVE.n; - } - function assertGE(num) { - if (!isWithinCurveOrder(num)) - throw new Error('Expected valid bigint: 0 < bigint < curve.n'); - } - // Validates if priv key is valid and converts it to bigint. - // Supports options allowedPrivateKeyLengths and wrapPrivateKey. - function normPrivateKeyToScalar(key) { - const { allowedPrivateKeyLengths: lengths, nByteLength, wrapPrivateKey, n } = CURVE; - if (lengths && typeof key !== 'bigint') { - if (key instanceof Uint8Array) - key = bytesToHex(key); - // Normalize to hex string, pad. E.g. P521 would norm 130-132 char hex to 132-char bytes - if (typeof key !== 'string' || !lengths.includes(key.length)) - throw new Error('Invalid key'); - key = key.padStart(nByteLength * 2, '0'); - } - let num; - try { - num = - typeof key === 'bigint' - ? key - : bytesToNumberBE(ensureBytes('private key', key, nByteLength)); - } - catch (error) { - throw new Error(`private key must be ${nByteLength} bytes, hex or bigint, not ${typeof key}`); - } - if (wrapPrivateKey) - num = mod(num, n); // disabled by default, enabled for BLS - assertGE(num); // num in range [1..N-1] - return num; - } - const pointPrecomputes = new Map(); - function assertPrjPoint(other) { - if (!(other instanceof Point)) - throw new Error('ProjectivePoint expected'); - } - /** - * Projective Point works in 3d / projective (homogeneous) coordinates: (x, y, z) ∋ (x=x/z, y=y/z) - * Default Point works in 2d / affine coordinates: (x, y) - * We're doing calculations in projective, because its operations don't require costly inversion. - */ - class Point { - constructor(px, py, pz) { - this.px = px; - this.py = py; - this.pz = pz; - if (px == null || !Fp.isValid(px)) - throw new Error('x required'); - if (py == null || !Fp.isValid(py)) - throw new Error('y required'); - if (pz == null || !Fp.isValid(pz)) - throw new Error('z required'); - } - // Does not validate if the point is on-curve. - // Use fromHex instead, or call assertValidity() later. - static fromAffine(p) { - const { x, y } = p || {}; - if (!p || !Fp.isValid(x) || !Fp.isValid(y)) - throw new Error('invalid affine point'); - if (p instanceof Point) - throw new Error('projective point not allowed'); - const is0 = (i) => Fp.eql(i, Fp.ZERO); - // fromAffine(x:0, y:0) would produce (x:0, y:0, z:1), but we need (x:0, y:1, z:0) - if (is0(x) && is0(y)) - return Point.ZERO; - return new Point(x, y, Fp.ONE); - } - get x() { - return this.toAffine().x; - } - get y() { - return this.toAffine().y; - } - /** - * Takes a bunch of Projective Points but executes only one - * inversion on all of them. Inversion is very slow operation, - * so this improves performance massively. - * Optimization: converts a list of projective points to a list of identical points with Z=1. - */ - static normalizeZ(points) { - const toInv = Fp.invertBatch(points.map((p) => p.pz)); - return points.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine); - } - /** - * Converts hash string or Uint8Array to Point. - * @param hex short/long ECDSA hex - */ - static fromHex(hex) { - const P = Point.fromAffine(fromBytes(ensureBytes('pointHex', hex))); - P.assertValidity(); - return P; - } - // Multiplies generator point by privateKey. - static fromPrivateKey(privateKey) { - return Point.BASE.multiply(normPrivateKeyToScalar(privateKey)); - } - // "Private method", don't use it directly - _setWindowSize(windowSize) { - this._WINDOW_SIZE = windowSize; - pointPrecomputes.delete(this); - } - // A point on curve is valid if it conforms to equation. - assertValidity() { - if (this.is0()) { - // (0, 1, 0) aka ZERO is invalid in most contexts. - // In BLS, ZERO can be serialized, so we allow it. - // (0, 0, 0) is wrong representation of ZERO and is always invalid. - if (CURVE.allowInfinityPoint && !Fp.is0(this.py)) - return; - throw new Error('bad point: ZERO'); - } - // Some 3rd-party test vectors require different wording between here & `fromCompressedHex` - const { x, y } = this.toAffine(); - // Check if x, y are valid field elements - if (!Fp.isValid(x) || !Fp.isValid(y)) - throw new Error('bad point: x or y not FE'); - const left = Fp.sqr(y); // y² - const right = weierstrassEquation(x); // x³ + ax + b - if (!Fp.eql(left, right)) - throw new Error('bad point: equation left != right'); - if (!this.isTorsionFree()) - throw new Error('bad point: not in prime-order subgroup'); - } - hasEvenY() { - const { y } = this.toAffine(); - if (Fp.isOdd) - return !Fp.isOdd(y); - throw new Error("Field doesn't support isOdd"); - } - /** - * Compare one point to another. - */ - equals(other) { - assertPrjPoint(other); - const { px: X1, py: Y1, pz: Z1 } = this; - const { px: X2, py: Y2, pz: Z2 } = other; - const U1 = Fp.eql(Fp.mul(X1, Z2), Fp.mul(X2, Z1)); - const U2 = Fp.eql(Fp.mul(Y1, Z2), Fp.mul(Y2, Z1)); - return U1 && U2; - } - /** - * Flips point to one corresponding to (x, -y) in Affine coordinates. - */ - negate() { - return new Point(this.px, Fp.neg(this.py), this.pz); - } - // Renes-Costello-Batina exception-free doubling formula. - // There is 30% faster Jacobian formula, but it is not complete. - // https://eprint.iacr.org/2015/1060, algorithm 3 - // Cost: 8M + 3S + 3*a + 2*b3 + 15add. - double() { - const { a, b } = CURVE; - const b3 = Fp.mul(b, _3n); - const { px: X1, py: Y1, pz: Z1 } = this; - let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore - let t0 = Fp.mul(X1, X1); // step 1 - let t1 = Fp.mul(Y1, Y1); - let t2 = Fp.mul(Z1, Z1); - let t3 = Fp.mul(X1, Y1); - t3 = Fp.add(t3, t3); // step 5 - Z3 = Fp.mul(X1, Z1); - Z3 = Fp.add(Z3, Z3); - X3 = Fp.mul(a, Z3); - Y3 = Fp.mul(b3, t2); - Y3 = Fp.add(X3, Y3); // step 10 - X3 = Fp.sub(t1, Y3); - Y3 = Fp.add(t1, Y3); - Y3 = Fp.mul(X3, Y3); - X3 = Fp.mul(t3, X3); - Z3 = Fp.mul(b3, Z3); // step 15 - t2 = Fp.mul(a, t2); - t3 = Fp.sub(t0, t2); - t3 = Fp.mul(a, t3); - t3 = Fp.add(t3, Z3); - Z3 = Fp.add(t0, t0); // step 20 - t0 = Fp.add(Z3, t0); - t0 = Fp.add(t0, t2); - t0 = Fp.mul(t0, t3); - Y3 = Fp.add(Y3, t0); - t2 = Fp.mul(Y1, Z1); // step 25 - t2 = Fp.add(t2, t2); - t0 = Fp.mul(t2, t3); - X3 = Fp.sub(X3, t0); - Z3 = Fp.mul(t2, t1); - Z3 = Fp.add(Z3, Z3); // step 30 - Z3 = Fp.add(Z3, Z3); - return new Point(X3, Y3, Z3); - } - // Renes-Costello-Batina exception-free addition formula. - // There is 30% faster Jacobian formula, but it is not complete. - // https://eprint.iacr.org/2015/1060, algorithm 1 - // Cost: 12M + 0S + 3*a + 3*b3 + 23add. - add(other) { - assertPrjPoint(other); - const { px: X1, py: Y1, pz: Z1 } = this; - const { px: X2, py: Y2, pz: Z2 } = other; - let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore - const a = CURVE.a; - const b3 = Fp.mul(CURVE.b, _3n); - let t0 = Fp.mul(X1, X2); // step 1 - let t1 = Fp.mul(Y1, Y2); - let t2 = Fp.mul(Z1, Z2); - let t3 = Fp.add(X1, Y1); - let t4 = Fp.add(X2, Y2); // step 5 - t3 = Fp.mul(t3, t4); - t4 = Fp.add(t0, t1); - t3 = Fp.sub(t3, t4); - t4 = Fp.add(X1, Z1); - let t5 = Fp.add(X2, Z2); // step 10 - t4 = Fp.mul(t4, t5); - t5 = Fp.add(t0, t2); - t4 = Fp.sub(t4, t5); - t5 = Fp.add(Y1, Z1); - X3 = Fp.add(Y2, Z2); // step 15 - t5 = Fp.mul(t5, X3); - X3 = Fp.add(t1, t2); - t5 = Fp.sub(t5, X3); - Z3 = Fp.mul(a, t4); - X3 = Fp.mul(b3, t2); // step 20 - Z3 = Fp.add(X3, Z3); - X3 = Fp.sub(t1, Z3); - Z3 = Fp.add(t1, Z3); - Y3 = Fp.mul(X3, Z3); - t1 = Fp.add(t0, t0); // step 25 - t1 = Fp.add(t1, t0); - t2 = Fp.mul(a, t2); - t4 = Fp.mul(b3, t4); - t1 = Fp.add(t1, t2); - t2 = Fp.sub(t0, t2); // step 30 - t2 = Fp.mul(a, t2); - t4 = Fp.add(t4, t2); - t0 = Fp.mul(t1, t4); - Y3 = Fp.add(Y3, t0); - t0 = Fp.mul(t5, t4); // step 35 - X3 = Fp.mul(t3, X3); - X3 = Fp.sub(X3, t0); - t0 = Fp.mul(t3, t1); - Z3 = Fp.mul(t5, Z3); - Z3 = Fp.add(Z3, t0); // step 40 - return new Point(X3, Y3, Z3); - } - subtract(other) { - return this.add(other.negate()); - } - is0() { - return this.equals(Point.ZERO); - } - wNAF(n) { - return wnaf.wNAFCached(this, pointPrecomputes, n, (comp) => { - const toInv = Fp.invertBatch(comp.map((p) => p.pz)); - return comp.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine); - }); - } - /** - * Non-constant-time multiplication. Uses double-and-add algorithm. - * It's faster, but should only be used when you don't care about - * an exposed private key e.g. sig verification, which works over *public* keys. - */ - multiplyUnsafe(n) { - const I = Point.ZERO; - if (n === _0n) - return I; - assertGE(n); // Will throw on 0 - if (n === _1n$1) - return this; - const { endo } = CURVE; - if (!endo) - return wnaf.unsafeLadder(this, n); - // Apply endomorphism - let { k1neg, k1, k2neg, k2 } = endo.splitScalar(n); - let k1p = I; - let k2p = I; - let d = this; - while (k1 > _0n || k2 > _0n) { - if (k1 & _1n$1) - k1p = k1p.add(d); - if (k2 & _1n$1) - k2p = k2p.add(d); - d = d.double(); - k1 >>= _1n$1; - k2 >>= _1n$1; - } - if (k1neg) - k1p = k1p.negate(); - if (k2neg) - k2p = k2p.negate(); - k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz); - return k1p.add(k2p); - } - /** - * Constant time multiplication. - * Uses wNAF method. Windowed method may be 10% faster, - * but takes 2x longer to generate and consumes 2x memory. - * Uses precomputes when available. - * Uses endomorphism for Koblitz curves. - * @param scalar by which the point would be multiplied - * @returns New point - */ - multiply(scalar) { - assertGE(scalar); - let n = scalar; - let point, fake; // Fake point is used to const-time mult - const { endo } = CURVE; - if (endo) { - const { k1neg, k1, k2neg, k2 } = endo.splitScalar(n); - let { p: k1p, f: f1p } = this.wNAF(k1); - let { p: k2p, f: f2p } = this.wNAF(k2); - k1p = wnaf.constTimeNegate(k1neg, k1p); - k2p = wnaf.constTimeNegate(k2neg, k2p); - k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz); - point = k1p.add(k2p); - fake = f1p.add(f2p); - } - else { - const { p, f } = this.wNAF(n); - point = p; - fake = f; - } - // Normalize `z` for both points, but return only real one - return Point.normalizeZ([point, fake])[0]; - } - /** - * Efficiently calculate `aP + bQ`. Unsafe, can expose private key, if used incorrectly. - * Not using Strauss-Shamir trick: precomputation tables are faster. - * The trick could be useful if both P and Q are not G (not in our case). - * @returns non-zero affine point - */ - multiplyAndAddUnsafe(Q, a, b) { - const G = Point.BASE; // No Strauss-Shamir trick: we have 10% faster G precomputes - const mul = (P, a // Select faster multiply() method - ) => (a === _0n || a === _1n$1 || !P.equals(G) ? P.multiplyUnsafe(a) : P.multiply(a)); - const sum = mul(this, a).add(mul(Q, b)); - return sum.is0() ? undefined : sum; - } - // Converts Projective point to affine (x, y) coordinates. - // Can accept precomputed Z^-1 - for example, from invertBatch. - // (x, y, z) ∋ (x=x/z, y=y/z) - toAffine(iz) { - const { px: x, py: y, pz: z } = this; - const is0 = this.is0(); - // If invZ was 0, we return zero point. However we still want to execute - // all operations, so we replace invZ with a random number, 1. - if (iz == null) - iz = is0 ? Fp.ONE : Fp.inv(z); - const ax = Fp.mul(x, iz); - const ay = Fp.mul(y, iz); - const zz = Fp.mul(z, iz); - if (is0) - return { x: Fp.ZERO, y: Fp.ZERO }; - if (!Fp.eql(zz, Fp.ONE)) - throw new Error('invZ was invalid'); - return { x: ax, y: ay }; - } - isTorsionFree() { - const { h: cofactor, isTorsionFree } = CURVE; - if (cofactor === _1n$1) - return true; // No subgroups, always torsion-free - if (isTorsionFree) - return isTorsionFree(Point, this); - throw new Error('isTorsionFree() has not been declared for the elliptic curve'); - } - clearCofactor() { - const { h: cofactor, clearCofactor } = CURVE; - if (cofactor === _1n$1) - return this; // Fast-path - if (clearCofactor) - return clearCofactor(Point, this); - return this.multiplyUnsafe(CURVE.h); - } - toRawBytes(isCompressed = true) { - this.assertValidity(); - return toBytes(Point, this, isCompressed); - } - toHex(isCompressed = true) { - return bytesToHex(this.toRawBytes(isCompressed)); - } - } - Point.BASE = new Point(CURVE.Gx, CURVE.Gy, Fp.ONE); - Point.ZERO = new Point(Fp.ZERO, Fp.ONE, Fp.ZERO); - const _bits = CURVE.nBitLength; - const wnaf = wNAF(Point, CURVE.endo ? Math.ceil(_bits / 2) : _bits); - // Validate if generator point is on curve - return { - CURVE, - ProjectivePoint: Point, - normPrivateKeyToScalar, - weierstrassEquation, - isWithinCurveOrder, - }; - } - function validateOpts(curve) { - const opts = validateBasic(curve); - validateObject(opts, { - hash: 'hash', - hmac: 'function', - randomBytes: 'function', - }, { - bits2int: 'function', - bits2int_modN: 'function', - lowS: 'boolean', - }); - return Object.freeze({ lowS: true, ...opts }); - } - function weierstrass(curveDef) { - const CURVE = validateOpts(curveDef); - const { Fp, n: CURVE_ORDER } = CURVE; - const compressedLen = Fp.BYTES + 1; // e.g. 33 for 32 - const uncompressedLen = 2 * Fp.BYTES + 1; // e.g. 65 for 32 - function isValidFieldElement(num) { - return _0n < num && num < Fp.ORDER; // 0 is banned since it's not invertible FE - } - function modN(a) { - return mod(a, CURVE_ORDER); - } - function invN(a) { - return invert(a, CURVE_ORDER); - } - const { ProjectivePoint: Point, normPrivateKeyToScalar, weierstrassEquation, isWithinCurveOrder, } = weierstrassPoints({ - ...CURVE, - toBytes(_c, point, isCompressed) { - const a = point.toAffine(); - const x = Fp.toBytes(a.x); - const cat = concatBytes; - if (isCompressed) { - return cat(Uint8Array.from([point.hasEvenY() ? 0x02 : 0x03]), x); - } - else { - return cat(Uint8Array.from([0x04]), x, Fp.toBytes(a.y)); - } - }, - fromBytes(bytes) { - const len = bytes.length; - const head = bytes[0]; - const tail = bytes.subarray(1); - // this.assertValidity() is done inside of fromHex - if (len === compressedLen && (head === 0x02 || head === 0x03)) { - const x = bytesToNumberBE(tail); - if (!isValidFieldElement(x)) - throw new Error('Point is not on curve'); - const y2 = weierstrassEquation(x); // y² = x³ + ax + b - let y = Fp.sqrt(y2); // y = y² ^ (p+1)/4 - const isYOdd = (y & _1n$1) === _1n$1; - // ECDSA - const isHeadOdd = (head & 1) === 1; - if (isHeadOdd !== isYOdd) - y = Fp.neg(y); - return { x, y }; - } - else if (len === uncompressedLen && head === 0x04) { - const x = Fp.fromBytes(tail.subarray(0, Fp.BYTES)); - const y = Fp.fromBytes(tail.subarray(Fp.BYTES, 2 * Fp.BYTES)); - return { x, y }; - } - else { - throw new Error(`Point of length ${len} was invalid. Expected ${compressedLen} compressed bytes or ${uncompressedLen} uncompressed bytes`); - } - }, - }); - const numToNByteStr = (num) => bytesToHex(numberToBytesBE(num, CURVE.nByteLength)); - function isBiggerThanHalfOrder(number) { - const HALF = CURVE_ORDER >> _1n$1; - return number > HALF; - } - function normalizeS(s) { - return isBiggerThanHalfOrder(s) ? modN(-s) : s; - } - // slice bytes num - const slcNum = (b, from, to) => bytesToNumberBE(b.slice(from, to)); - /** - * ECDSA signature with its (r, s) properties. Supports DER & compact representations. - */ - class Signature { - constructor(r, s, recovery) { - this.r = r; - this.s = s; - this.recovery = recovery; - this.assertValidity(); - } - // pair (bytes of r, bytes of s) - static fromCompact(hex) { - const l = CURVE.nByteLength; - hex = ensureBytes('compactSignature', hex, l * 2); - return new Signature(slcNum(hex, 0, l), slcNum(hex, l, 2 * l)); - } - // DER encoded ECDSA signature - // https://bitcoin.stackexchange.com/questions/57644/what-are-the-parts-of-a-bitcoin-transaction-input-script - static fromDER(hex) { - const { r, s } = DER.toSig(ensureBytes('DER', hex)); - return new Signature(r, s); - } - assertValidity() { - // can use assertGE here - if (!isWithinCurveOrder(this.r)) - throw new Error('r must be 0 < r < CURVE.n'); - if (!isWithinCurveOrder(this.s)) - throw new Error('s must be 0 < s < CURVE.n'); - } - addRecoveryBit(recovery) { - return new Signature(this.r, this.s, recovery); - } - recoverPublicKey(msgHash) { - const { r, s, recovery: rec } = this; - const h = bits2int_modN(ensureBytes('msgHash', msgHash)); // Truncate hash - if (rec == null || ![0, 1, 2, 3].includes(rec)) - throw new Error('recovery id invalid'); - const radj = rec === 2 || rec === 3 ? r + CURVE.n : r; - if (radj >= Fp.ORDER) - throw new Error('recovery id 2 or 3 invalid'); - const prefix = (rec & 1) === 0 ? '02' : '03'; - const R = Point.fromHex(prefix + numToNByteStr(radj)); - const ir = invN(radj); // r^-1 - const u1 = modN(-h * ir); // -hr^-1 - const u2 = modN(s * ir); // sr^-1 - const Q = Point.BASE.multiplyAndAddUnsafe(R, u1, u2); // (sr^-1)R-(hr^-1)G = -(hr^-1)G + (sr^-1) - if (!Q) - throw new Error('point at infinify'); // unsafe is fine: no priv data leaked - Q.assertValidity(); - return Q; - } - // Signatures should be low-s, to prevent malleability. - hasHighS() { - return isBiggerThanHalfOrder(this.s); - } - normalizeS() { - return this.hasHighS() ? new Signature(this.r, modN(-this.s), this.recovery) : this; - } - // DER-encoded - toDERRawBytes() { - return hexToBytes(this.toDERHex()); - } - toDERHex() { - return DER.hexFromSig({ r: this.r, s: this.s }); - } - // padded bytes of r, then padded bytes of s - toCompactRawBytes() { - return hexToBytes(this.toCompactHex()); - } - toCompactHex() { - return numToNByteStr(this.r) + numToNByteStr(this.s); - } - } - const utils = { - isValidPrivateKey(privateKey) { - try { - normPrivateKeyToScalar(privateKey); - return true; - } - catch (error) { - return false; - } - }, - normPrivateKeyToScalar: normPrivateKeyToScalar, - /** - * Produces cryptographically secure private key from random of size - * (groupLen + ceil(groupLen / 2)) with modulo bias being negligible. - */ - randomPrivateKey: () => { - const length = getMinHashLength(CURVE.n); - return mapHashToField(CURVE.randomBytes(length), CURVE.n); - }, - /** - * Creates precompute table for an arbitrary EC point. Makes point "cached". - * Allows to massively speed-up `point.multiply(scalar)`. - * @returns cached point - * @example - * const fast = utils.precompute(8, ProjectivePoint.fromHex(someonesPubKey)); - * fast.multiply(privKey); // much faster ECDH now - */ - precompute(windowSize = 8, point = Point.BASE) { - point._setWindowSize(windowSize); - point.multiply(BigInt(3)); // 3 is arbitrary, just need any number here - return point; - }, - }; - /** - * Computes public key for a private key. Checks for validity of the private key. - * @param privateKey private key - * @param isCompressed whether to return compact (default), or full key - * @returns Public key, full when isCompressed=false; short when isCompressed=true - */ - function getPublicKey(privateKey, isCompressed = true) { - return Point.fromPrivateKey(privateKey).toRawBytes(isCompressed); - } - /** - * Quick and dirty check for item being public key. Does not validate hex, or being on-curve. - */ - function isProbPub(item) { - const arr = item instanceof Uint8Array; - const str = typeof item === 'string'; - const len = (arr || str) && item.length; - if (arr) - return len === compressedLen || len === uncompressedLen; - if (str) - return len === 2 * compressedLen || len === 2 * uncompressedLen; - if (item instanceof Point) - return true; - return false; - } - /** - * ECDH (Elliptic Curve Diffie Hellman). - * Computes shared public key from private key and public key. - * Checks: 1) private key validity 2) shared key is on-curve. - * Does NOT hash the result. - * @param privateA private key - * @param publicB different public key - * @param isCompressed whether to return compact (default), or full key - * @returns shared public key - */ - function getSharedSecret(privateA, publicB, isCompressed = true) { - if (isProbPub(privateA)) - throw new Error('first arg must be private key'); - if (!isProbPub(publicB)) - throw new Error('second arg must be public key'); - const b = Point.fromHex(publicB); // check for being on-curve - return b.multiply(normPrivateKeyToScalar(privateA)).toRawBytes(isCompressed); - } - // RFC6979: ensure ECDSA msg is X bytes and < N. RFC suggests optional truncating via bits2octets. - // FIPS 186-4 4.6 suggests the leftmost min(nBitLen, outLen) bits, which matches bits2int. - // bits2int can produce res>N, we can do mod(res, N) since the bitLen is the same. - // int2octets can't be used; pads small msgs with 0: unacceptatble for trunc as per RFC vectors - const bits2int = CURVE.bits2int || - function (bytes) { - // For curves with nBitLength % 8 !== 0: bits2octets(bits2octets(m)) !== bits2octets(m) - // for some cases, since bytes.length * 8 is not actual bitLength. - const num = bytesToNumberBE(bytes); // check for == u8 done here - const delta = bytes.length * 8 - CURVE.nBitLength; // truncate to nBitLength leftmost bits - return delta > 0 ? num >> BigInt(delta) : num; - }; - const bits2int_modN = CURVE.bits2int_modN || - function (bytes) { - return modN(bits2int(bytes)); // can't use bytesToNumberBE here - }; - // NOTE: pads output with zero as per spec - const ORDER_MASK = bitMask(CURVE.nBitLength); - /** - * Converts to bytes. Checks if num in `[0..ORDER_MASK-1]` e.g.: `[0..2^256-1]`. - */ - function int2octets(num) { - if (typeof num !== 'bigint') - throw new Error('bigint expected'); - if (!(_0n <= num && num < ORDER_MASK)) - throw new Error(`bigint expected < 2^${CURVE.nBitLength}`); - // works with order, can have different size than numToField! - return numberToBytesBE(num, CURVE.nByteLength); - } - // Steps A, D of RFC6979 3.2 - // Creates RFC6979 seed; converts msg/privKey to numbers. - // Used only in sign, not in verify. - // NOTE: we cannot assume here that msgHash has same amount of bytes as curve order, this will be wrong at least for P521. - // Also it can be bigger for P224 + SHA256 - function prepSig(msgHash, privateKey, opts = defaultSigOpts) { - if (['recovered', 'canonical'].some((k) => k in opts)) - throw new Error('sign() legacy options not supported'); - const { hash, randomBytes } = CURVE; - let { lowS, prehash, extraEntropy: ent } = opts; // generates low-s sigs by default - if (lowS == null) - lowS = true; // RFC6979 3.2: we skip step A, because we already provide hash - msgHash = ensureBytes('msgHash', msgHash); - if (prehash) - msgHash = ensureBytes('prehashed msgHash', hash(msgHash)); - // We can't later call bits2octets, since nested bits2int is broken for curves - // with nBitLength % 8 !== 0. Because of that, we unwrap it here as int2octets call. - // const bits2octets = (bits) => int2octets(bits2int_modN(bits)) - const h1int = bits2int_modN(msgHash); - const d = normPrivateKeyToScalar(privateKey); // validate private key, convert to bigint - const seedArgs = [int2octets(d), int2octets(h1int)]; - // extraEntropy. RFC6979 3.6: additional k' (optional). - if (ent != null) { - // K = HMAC_K(V || 0x00 || int2octets(x) || bits2octets(h1) || k') - const e = ent === true ? randomBytes(Fp.BYTES) : ent; // generate random bytes OR pass as-is - seedArgs.push(ensureBytes('extraEntropy', e)); // check for being bytes - } - const seed = concatBytes(...seedArgs); // Step D of RFC6979 3.2 - const m = h1int; // NOTE: no need to call bits2int second time here, it is inside truncateHash! - // Converts signature params into point w r/s, checks result for validity. - function k2sig(kBytes) { - // RFC 6979 Section 3.2, step 3: k = bits2int(T) - const k = bits2int(kBytes); // Cannot use fields methods, since it is group element - if (!isWithinCurveOrder(k)) - return; // Important: all mod() calls here must be done over N - const ik = invN(k); // k^-1 mod n - const q = Point.BASE.multiply(k).toAffine(); // q = Gk - const r = modN(q.x); // r = q.x mod n - if (r === _0n) - return; - // Can use scalar blinding b^-1(bm + bdr) where b ∈ [1,q−1] according to - // https://tches.iacr.org/index.php/TCHES/article/view/7337/6509. We've decided against it: - // a) dependency on CSPRNG b) 15% slowdown c) doesn't really help since bigints are not CT - const s = modN(ik * modN(m + r * d)); // Not using blinding here - if (s === _0n) - return; - let recovery = (q.x === r ? 0 : 2) | Number(q.y & _1n$1); // recovery bit (2 or 3, when q.x > n) - let normS = s; - if (lowS && isBiggerThanHalfOrder(s)) { - normS = normalizeS(s); // if lowS was passed, ensure s is always - recovery ^= 1; // // in the bottom half of N - } - return new Signature(r, normS, recovery); // use normS, not s - } - return { seed, k2sig }; - } - const defaultSigOpts = { lowS: CURVE.lowS, prehash: false }; - const defaultVerOpts = { lowS: CURVE.lowS, prehash: false }; - /** - * Signs message hash with a private key. - * ``` - * sign(m, d, k) where - * (x, y) = G × k - * r = x mod n - * s = (m + dr)/k mod n - * ``` - * @param msgHash NOT message. msg needs to be hashed to `msgHash`, or use `prehash`. - * @param privKey private key - * @param opts lowS for non-malleable sigs. extraEntropy for mixing randomness into k. prehash will hash first arg. - * @returns signature with recovery param - */ - function sign(msgHash, privKey, opts = defaultSigOpts) { - const { seed, k2sig } = prepSig(msgHash, privKey, opts); // Steps A, D of RFC6979 3.2. - const C = CURVE; - const drbg = createHmacDrbg(C.hash.outputLen, C.nByteLength, C.hmac); - return drbg(seed, k2sig); // Steps B, C, D, E, F, G - } - // Enable precomputes. Slows down first publicKey computation by 20ms. - Point.BASE._setWindowSize(8); - // utils.precompute(8, ProjectivePoint.BASE) - /** - * Verifies a signature against message hash and public key. - * Rejects lowS signatures by default: to override, - * specify option `{lowS: false}`. Implements section 4.1.4 from https://www.secg.org/sec1-v2.pdf: - * - * ``` - * verify(r, s, h, P) where - * U1 = hs^-1 mod n - * U2 = rs^-1 mod n - * R = U1⋅G - U2⋅P - * mod(R.x, n) == r - * ``` - */ - function verify(signature, msgHash, publicKey, opts = defaultVerOpts) { - const sg = signature; - msgHash = ensureBytes('msgHash', msgHash); - publicKey = ensureBytes('publicKey', publicKey); - if ('strict' in opts) - throw new Error('options.strict was renamed to lowS'); - const { lowS, prehash } = opts; - let _sig = undefined; - let P; - try { - if (typeof sg === 'string' || sg instanceof Uint8Array) { - // Signature can be represented in 2 ways: compact (2*nByteLength) & DER (variable-length). - // Since DER can also be 2*nByteLength bytes, we check for it first. - try { - _sig = Signature.fromDER(sg); - } - catch (derError) { - if (!(derError instanceof DER.Err)) - throw derError; - _sig = Signature.fromCompact(sg); - } - } - else if (typeof sg === 'object' && typeof sg.r === 'bigint' && typeof sg.s === 'bigint') { - const { r, s } = sg; - _sig = new Signature(r, s); - } - else { - throw new Error('PARSE'); - } - P = Point.fromHex(publicKey); - } - catch (error) { - if (error.message === 'PARSE') - throw new Error(`signature must be Signature instance, Uint8Array or hex string`); - return false; - } - if (lowS && _sig.hasHighS()) - return false; - if (prehash) - msgHash = CURVE.hash(msgHash); - const { r, s } = _sig; - const h = bits2int_modN(msgHash); // Cannot use fields methods, since it is group element - const is = invN(s); // s^-1 - const u1 = modN(h * is); // u1 = hs^-1 mod n - const u2 = modN(r * is); // u2 = rs^-1 mod n - const R = Point.BASE.multiplyAndAddUnsafe(P, u1, u2)?.toAffine(); // R = u1⋅G + u2⋅P - if (!R) - return false; - const v = modN(R.x); - return v === r; - } - return { - CURVE, - getPublicKey, - getSharedSecret, - sign, - verify, - ProjectivePoint: Point, - Signature, - utils, - }; - } - - /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ - // connects noble-curves to noble-hashes - function getHash(hash) { - return { - hash, - hmac: (key, ...msgs) => hmac(hash, key, concatBytes$1(...msgs)), - randomBytes: randomBytes$2, - }; - } - function createCurve(curveDef, defHash) { - const create = (hash) => weierstrass({ ...curveDef, ...getHash(hash) }); - return Object.freeze({ ...create(defHash), create }); - } - - /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ - const secp256k1P = BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f'); - const secp256k1N = BigInt('0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141'); - const _1n = BigInt(1); - const _2n = BigInt(2); - const divNearest = (a, b) => (a + b / _2n) / b; - /** - * √n = n^((p+1)/4) for fields p = 3 mod 4. We unwrap the loop and multiply bit-by-bit. - * (P+1n/4n).toString(2) would produce bits [223x 1, 0, 22x 1, 4x 0, 11, 00] - */ - function sqrtMod(y) { - const P = secp256k1P; - // prettier-ignore - const _3n = BigInt(3), _6n = BigInt(6), _11n = BigInt(11), _22n = BigInt(22); - // prettier-ignore - const _23n = BigInt(23), _44n = BigInt(44), _88n = BigInt(88); - const b2 = (y * y * y) % P; // x^3, 11 - const b3 = (b2 * b2 * y) % P; // x^7 - const b6 = (pow2(b3, _3n, P) * b3) % P; - const b9 = (pow2(b6, _3n, P) * b3) % P; - const b11 = (pow2(b9, _2n, P) * b2) % P; - const b22 = (pow2(b11, _11n, P) * b11) % P; - const b44 = (pow2(b22, _22n, P) * b22) % P; - const b88 = (pow2(b44, _44n, P) * b44) % P; - const b176 = (pow2(b88, _88n, P) * b88) % P; - const b220 = (pow2(b176, _44n, P) * b44) % P; - const b223 = (pow2(b220, _3n, P) * b3) % P; - const t1 = (pow2(b223, _23n, P) * b22) % P; - const t2 = (pow2(t1, _6n, P) * b2) % P; - const root = pow2(t2, _2n, P); - if (!Fp.eql(Fp.sqr(root), y)) - throw new Error('Cannot find square root'); - return root; - } - const Fp = Field(secp256k1P, undefined, undefined, { sqrt: sqrtMod }); - const secp256k1 = createCurve({ - a: BigInt(0), - b: BigInt(7), - Fp, - n: secp256k1N, - // Base point (x, y) aka generator point - Gx: BigInt('55066263022277343669578718895168534326250603453777594175500187360389116729240'), - Gy: BigInt('32670510020758816978083085130507043184471273380659243275938904335757337482424'), - h: BigInt(1), - lowS: true, - /** - * secp256k1 belongs to Koblitz curves: it has efficiently computable endomorphism. - * Endomorphism uses 2x less RAM, speeds up precomputation by 2x and ECDH / key recovery by 20%. - * For precomputed wNAF it trades off 1/2 init time & 1/3 ram for 20% perf hit. - * Explanation: https://gist.github.com/paulmillr/eb670806793e84df628a7c434a873066 - */ - endo: { - beta: BigInt('0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee'), - splitScalar: (k) => { - const n = secp256k1N; - const a1 = BigInt('0x3086d221a7d46bcde86c90e49284eb15'); - const b1 = -_1n * BigInt('0xe4437ed6010e88286f547fa90abfe4c3'); - const a2 = BigInt('0x114ca50f7a8e2f3f657c1108d9d44cfd8'); - const b2 = a1; - const POW_2_128 = BigInt('0x100000000000000000000000000000000'); // (2n**128n).toString(16) - const c1 = divNearest(b2 * k, n); - const c2 = divNearest(-b1 * k, n); - let k1 = mod(k - c1 * a1 - c2 * a2, n); - let k2 = mod(-c1 * b1 - c2 * b2, n); - const k1neg = k1 > POW_2_128; - const k2neg = k2 > POW_2_128; - if (k1neg) - k1 = n - k1; - if (k2neg) - k2 = n - k2; - if (k1 > POW_2_128 || k2 > POW_2_128) { - throw new Error('splitScalar: Endomorphism failed, k=' + k); - } - return { k1neg, k1, k2neg, k2 }; - }, - }, - }, sha256$1); - // Schnorr signatures are superior to ECDSA from above. Below is Schnorr-specific BIP0340 code. - // https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki - BigInt(0); - secp256k1.ProjectivePoint; - - /** - * A constant for the zero address. - * - * (**i.e.** ``"0x0000000000000000000000000000000000000000"``) - */ - const ZeroAddress = "0x0000000000000000000000000000000000000000"; - - /** - * A constant for the zero hash. - * - * (**i.e.** ``"0x0000000000000000000000000000000000000000000000000000000000000000"``) - */ - const ZeroHash = "0x0000000000000000000000000000000000000000000000000000000000000000"; - - /** - * A constant for the order N for the secp256k1 curve. - * - * (**i.e.** ``0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n``) - */ - const N$1 = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); - /** - * A constant for the number of wei in a single ether. - * - * (**i.e.** ``1000000000000000000n``) - */ - const WeiPerEther = BigInt("1000000000000000000"); - /** - * A constant for the maximum value for a ``uint256``. - * - * (**i.e.** ``0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) - */ - const MaxUint256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); - /** - * A constant for the minimum value for an ``int256``. - * - * (**i.e.** ``-8000000000000000000000000000000000000000000000000000000000000000n``) - */ - const MinInt256 = BigInt("0x8000000000000000000000000000000000000000000000000000000000000000") * BigInt(-1); - /** - * A constant for the maximum value for an ``int256``. - * - * (**i.e.** ``0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) - */ - const MaxInt256 = BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); - - // NFKC (composed) // (decomposed) - /** - * A constant for the ether symbol (normalized using NFKC). - * - * (**i.e.** ``"\\u039e"``) - */ - const EtherSymbol = "\u039e"; // "\uD835\uDF63"; - /** - * A constant for the [[link-eip-191]] personal message prefix. - * - * (**i.e.** ``"\\x19Ethereum Signed Message:\\n"``) - */ - const MessagePrefix = "\x19Ethereum Signed Message:\n"; - - // Constants - const BN_0$7 = BigInt(0); - const BN_1$3 = BigInt(1); - const BN_2$3 = BigInt(2); - const BN_27$1 = BigInt(27); - const BN_28$1 = BigInt(28); - const BN_35$1 = BigInt(35); - const BN_N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); - const BN_N_2 = BN_N / BN_2$3; // Must be integer (floor) division; do NOT shifts - const inspect$1 = Symbol.for("nodejs.util.inspect.custom"); - const _guard$3 = {}; - function toUint256(value) { - return zeroPadValue(toBeArray(value), 32); - } - /** - * A Signature @TODO - * - * - * @_docloc: api/crypto:Signing - */ - class Signature { - #r; - #s; - #v; - #networkV; - /** - * The ``r`` value for a signature. - * - * This represents the ``x`` coordinate of a "reference" or - * challenge point, from which the ``y`` can be computed. - */ - get r() { return this.#r; } - set r(value) { - assertArgument(dataLength(value) === 32, "invalid r", "value", value); - this.#r = hexlify(value); - } - /** - * The ``s`` value for a signature. - */ - get s() { - assertArgument(parseInt(this.#s.substring(0, 3)) < 8, "non-canonical s; use ._s", "s", this.#s); - return this.#s; - } - set s(_value) { - assertArgument(dataLength(_value) === 32, "invalid s", "value", _value); - this.#s = hexlify(_value); - } - /** - * Return the s value, unchecked for EIP-2 compliance. - * - * This should generally not be used and is for situations where - * a non-canonical S value might be relevant, such as Frontier blocks - * that were mined prior to EIP-2 or invalid Authorization List - * signatures. - */ - get _s() { return this.#s; } - /** - * Returns true if the Signature is valid for [[link-eip-2]] signatures. - */ - isValid() { - const s = BigInt(this.#s); - return (s <= BN_N_2); - } - /** - * The ``v`` value for a signature. - * - * Since a given ``x`` value for ``r`` has two possible values for - * its correspondin ``y``, the ``v`` indicates which of the two ``y`` - * values to use. - * - * It is normalized to the values ``27`` or ``28`` for legacy - * purposes. - */ - get v() { return this.#v; } - set v(value) { - const v = getNumber(value, "value"); - assertArgument(v === 27 || v === 28, "invalid v", "v", value); - this.#v = v; - } - /** - * The EIP-155 ``v`` for legacy transactions. For non-legacy - * transactions, this value is ``null``. - */ - get networkV() { return this.#networkV; } - /** - * The chain ID for EIP-155 legacy transactions. For non-legacy - * transactions, this value is ``null``. - */ - get legacyChainId() { - const v = this.networkV; - if (v == null) { - return null; - } - return Signature.getChainId(v); - } - /** - * The ``yParity`` for the signature. - * - * See ``v`` for more details on how this value is used. - */ - get yParity() { - return (this.v === 27) ? 0 : 1; - } - /** - * The [[link-eip-2098]] compact representation of the ``yParity`` - * and ``s`` compacted into a single ``bytes32``. - */ - get yParityAndS() { - // The EIP-2098 compact representation - const yParityAndS = getBytes(this.s); - if (this.yParity) { - yParityAndS[0] |= 0x80; - } - return hexlify(yParityAndS); - } - /** - * The [[link-eip-2098]] compact representation. - */ - get compactSerialized() { - return concat([this.r, this.yParityAndS]); - } - /** - * The serialized representation. - */ - get serialized() { - return concat([this.r, this.s, (this.yParity ? "0x1c" : "0x1b")]); - } - /** - * @private - */ - constructor(guard, r, s, v) { - assertPrivate(guard, _guard$3, "Signature"); - this.#r = r; - this.#s = s; - this.#v = v; - this.#networkV = null; - } - /** - * Returns the canonical signature. - * - * This is only necessary when dealing with legacy transaction which - * did not enforce canonical S values (i.e. [[link-eip-2]]. Most - * developers should never require this. - */ - getCanonical() { - if (this.isValid()) { - return this; - } - // Compute the canonical signature; s' = N - s, v = !v - const s = BN_N - BigInt(this._s); - const v = (55 - this.v); - const result = new Signature(_guard$3, this.r, toUint256(s), v); - // Populate the networkV if necessary - if (this.networkV) { - result.#networkV = this.networkV; - } - return result; - } - /** - * Returns a new identical [[Signature]]. - */ - clone() { - const clone = new Signature(_guard$3, this.r, this._s, this.v); - if (this.networkV) { - clone.#networkV = this.networkV; - } - return clone; - } - /** - * Returns a representation that is compatible with ``JSON.stringify``. - */ - toJSON() { - const networkV = this.networkV; - return { - _type: "signature", - networkV: ((networkV != null) ? networkV.toString() : null), - r: this.r, s: this._s, v: this.v, - }; - } - [inspect$1]() { - return this.toString(); - } - toString() { - if (this.isValid()) { - return `Signature { r: ${this.r}, s: ${this._s}, v: ${this.v} }`; - } - return `Signature { r: ${this.r}, s: ${this._s}, v: ${this.v}, valid: false }`; - } - /** - * Compute the chain ID from the ``v`` in a legacy EIP-155 transactions. - * - * @example: - * Signature.getChainId(45) - * //_result: - * - * Signature.getChainId(46) - * //_result: - */ - static getChainId(v) { - const bv = getBigInt(v, "v"); - // The v is not an EIP-155 v, so it is the unspecified chain ID - if ((bv == BN_27$1) || (bv == BN_28$1)) { - return BN_0$7; - } - // Bad value for an EIP-155 v - assertArgument(bv >= BN_35$1, "invalid EIP-155 v", "v", v); - return (bv - BN_35$1) / BN_2$3; - } - /** - * Compute the ``v`` for a chain ID for a legacy EIP-155 transactions. - * - * Legacy transactions which use [[link-eip-155]] hijack the ``v`` - * property to include the chain ID. - * - * @example: - * Signature.getChainIdV(5, 27) - * //_result: - * - * Signature.getChainIdV(5, 28) - * //_result: - * - */ - static getChainIdV(chainId, v) { - return (getBigInt(chainId) * BN_2$3) + BigInt(35 + v - 27); - } - /** - * Compute the normalized legacy transaction ``v`` from a ``yParirty``, - * a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction. - * - * @example: - * // The values 0 and 1 imply v is actually yParity - * Signature.getNormalizedV(0) - * //_result: - * - * // Legacy non-EIP-1559 transaction (i.e. 27 or 28) - * Signature.getNormalizedV(27) - * //_result: - * - * // Legacy EIP-155 transaction (i.e. >= 35) - * Signature.getNormalizedV(46) - * //_result: - * - * // Invalid values throw - * Signature.getNormalizedV(5) - * //_error: - */ - static getNormalizedV(v) { - const bv = getBigInt(v); - if (bv === BN_0$7 || bv === BN_27$1) { - return 27; - } - if (bv === BN_1$3 || bv === BN_28$1) { - return 28; - } - assertArgument(bv >= BN_35$1, "invalid v", "v", v); - // Otherwise, EIP-155 v means odd is 27 and even is 28 - return (bv & BN_1$3) ? 27 : 28; - } - /** - * Creates a new [[Signature]]. - * - * If no %%sig%% is provided, a new [[Signature]] is created - * with default values. - * - * If %%sig%% is a string, it is parsed. - */ - static from(sig) { - function assertError(check, message) { - assertArgument(check, message, "signature", sig); - } - if (sig == null) { - return new Signature(_guard$3, ZeroHash, ZeroHash, 27); - } - if (typeof (sig) === "string") { - const bytes = getBytes(sig, "signature"); - if (bytes.length === 64) { - const r = hexlify(bytes.slice(0, 32)); - const s = bytes.slice(32, 64); - const v = (s[0] & 0x80) ? 28 : 27; - s[0] &= 0x7f; - return new Signature(_guard$3, r, hexlify(s), v); - } - if (bytes.length === 65) { - const r = hexlify(bytes.slice(0, 32)); - const s = hexlify(bytes.slice(32, 64)); - const v = Signature.getNormalizedV(bytes[64]); - return new Signature(_guard$3, r, s, v); - } - assertError(false, "invalid raw signature length"); - } - if (sig instanceof Signature) { - return sig.clone(); - } - // Get r - const _r = sig.r; - assertError(_r != null, "missing r"); - const r = toUint256(_r); - // Get s; by any means necessary (we check consistency below) - const s = (function (s, yParityAndS) { - if (s != null) { - return toUint256(s); - } - if (yParityAndS != null) { - assertError(isHexString(yParityAndS, 32), "invalid yParityAndS"); - const bytes = getBytes(yParityAndS); - bytes[0] &= 0x7f; - return hexlify(bytes); - } - assertError(false, "missing s"); - })(sig.s, sig.yParityAndS); - // Get v; by any means necessary (we check consistency below) - const { networkV, v } = (function (_v, yParityAndS, yParity) { - if (_v != null) { - const v = getBigInt(_v); - return { - networkV: ((v >= BN_35$1) ? v : undefined), - v: Signature.getNormalizedV(v) - }; - } - if (yParityAndS != null) { - assertError(isHexString(yParityAndS, 32), "invalid yParityAndS"); - return { v: ((getBytes(yParityAndS)[0] & 0x80) ? 28 : 27) }; - } - if (yParity != null) { - switch (getNumber(yParity, "sig.yParity")) { - case 0: return { v: 27 }; - case 1: return { v: 28 }; - } - assertError(false, "invalid yParity"); - } - assertError(false, "missing v"); - })(sig.v, sig.yParityAndS, sig.yParity); - const result = new Signature(_guard$3, r, s, v); - if (networkV) { - result.#networkV = networkV; - } - // If multiple of v, yParity, yParityAndS we given, check they match - assertError(sig.yParity == null || getNumber(sig.yParity, "sig.yParity") === result.yParity, "yParity mismatch"); - assertError(sig.yParityAndS == null || sig.yParityAndS === result.yParityAndS, "yParityAndS mismatch"); - return result; - } - } - - /** - * Add details about signing here. - * - * @_subsection: api/crypto:Signing [about-signing] - */ - /** - * A **SigningKey** provides high-level access to the elliptic curve - * cryptography (ECC) operations and key management. - */ - class SigningKey { - #privateKey; - /** - * Creates a new **SigningKey** for %%privateKey%%. - */ - constructor(privateKey) { - assertArgument(dataLength(privateKey) === 32, "invalid private key", "privateKey", "[REDACTED]"); - this.#privateKey = hexlify(privateKey); - } - /** - * The private key. - */ - get privateKey() { return this.#privateKey; } - /** - * The uncompressed public key. - * - * This will always begin with the prefix ``0x04`` and be 132 - * characters long (the ``0x`` prefix and 130 hexadecimal nibbles). - */ - get publicKey() { return SigningKey.computePublicKey(this.#privateKey); } - /** - * The compressed public key. - * - * This will always begin with either the prefix ``0x02`` or ``0x03`` - * and be 68 characters long (the ``0x`` prefix and 33 hexadecimal - * nibbles) - */ - get compressedPublicKey() { return SigningKey.computePublicKey(this.#privateKey, true); } - /** - * Return the signature of the signed %%digest%%. - */ - sign(digest) { - assertArgument(dataLength(digest) === 32, "invalid digest length", "digest", digest); - const sig = secp256k1.sign(getBytesCopy(digest), getBytesCopy(this.#privateKey), { - lowS: true - }); - return Signature.from({ - r: toBeHex(sig.r, 32), - s: toBeHex(sig.s, 32), - v: (sig.recovery ? 0x1c : 0x1b) - }); - } - /** - * Returns the [[link-wiki-ecdh]] shared secret between this - * private key and the %%other%% key. - * - * The %%other%% key may be any type of key, a raw public key, - * a compressed/uncompressed pubic key or aprivate key. - * - * Best practice is usually to use a cryptographic hash on the - * returned value before using it as a symetric secret. - * - * @example: - * sign1 = new SigningKey(id("some-secret-1")) - * sign2 = new SigningKey(id("some-secret-2")) - * - * // Notice that privA.computeSharedSecret(pubB)... - * sign1.computeSharedSecret(sign2.publicKey) - * //_result: - * - * // ...is equal to privB.computeSharedSecret(pubA). - * sign2.computeSharedSecret(sign1.publicKey) - * //_result: - */ - computeSharedSecret(other) { - const pubKey = SigningKey.computePublicKey(other); - return hexlify(secp256k1.getSharedSecret(getBytesCopy(this.#privateKey), getBytes(pubKey), false)); - } - /** - * Compute the public key for %%key%%, optionally %%compressed%%. - * - * The %%key%% may be any type of key, a raw public key, a - * compressed/uncompressed public key or private key. - * - * @example: - * sign = new SigningKey(id("some-secret")); - * - * // Compute the uncompressed public key for a private key - * SigningKey.computePublicKey(sign.privateKey) - * //_result: - * - * // Compute the compressed public key for a private key - * SigningKey.computePublicKey(sign.privateKey, true) - * //_result: - * - * // Compute the uncompressed public key - * SigningKey.computePublicKey(sign.publicKey, false); - * //_result: - * - * // Compute the Compressed a public key - * SigningKey.computePublicKey(sign.publicKey, true); - * //_result: - */ - static computePublicKey(key, compressed) { - let bytes = getBytes(key, "key"); - // private key - if (bytes.length === 32) { - const pubKey = secp256k1.getPublicKey(bytes, !!compressed); - return hexlify(pubKey); - } - // raw public key; use uncompressed key with 0x04 prefix - if (bytes.length === 64) { - const pub = new Uint8Array(65); - pub[0] = 0x04; - pub.set(bytes, 1); - bytes = pub; - } - const point = secp256k1.ProjectivePoint.fromHex(bytes); - return hexlify(point.toRawBytes(compressed)); - } - /** - * Returns the public key for the private key which produced the - * %%signature%% for the given %%digest%%. - * - * @example: - * key = new SigningKey(id("some-secret")) - * digest = id("hello world") - * sig = key.sign(digest) - * - * // Notice the signer public key... - * key.publicKey - * //_result: - * - * // ...is equal to the recovered public key - * SigningKey.recoverPublicKey(digest, sig) - * //_result: - * - */ - static recoverPublicKey(digest, signature) { - assertArgument(dataLength(digest) === 32, "invalid digest length", "digest", digest); - const sig = Signature.from(signature); - let secpSig = secp256k1.Signature.fromCompact(getBytesCopy(concat([sig.r, sig.s]))); - secpSig = secpSig.addRecoveryBit(sig.yParity); - const pubKey = secpSig.recoverPublicKey(getBytesCopy(digest)); - assertArgument(pubKey != null, "invalid signature for digest", "signature", signature); - return "0x" + pubKey.toHex(false); - } - /** - * Returns the point resulting from adding the ellipic curve points - * %%p0%% and %%p1%%. - * - * This is not a common function most developers should require, but - * can be useful for certain privacy-specific techniques. - * - * For example, it is used by [[HDNodeWallet]] to compute child - * addresses from parent public keys and chain codes. - */ - static addPoints(p0, p1, compressed) { - const pub0 = secp256k1.ProjectivePoint.fromHex(SigningKey.computePublicKey(p0).substring(2)); - const pub1 = secp256k1.ProjectivePoint.fromHex(SigningKey.computePublicKey(p1).substring(2)); - return "0x" + pub0.add(pub1).toHex(!!compressed); - } - } - - /** - * A fundamental building block of Ethereum is the underlying - * cryptographic primitives. - * - * @_section: api/crypto:Cryptographic Functions [about-crypto] - */ - /** - * Once called, prevents any future change to the underlying cryptographic - * primitives using the ``.register`` feature for hooks. - */ - function lock() { - computeHmac.lock(); - keccak256.lock(); - pbkdf2.lock(); - randomBytes.lock(); - ripemd160.lock(); - scrypt.lock(); - scryptSync.lock(); - sha256.lock(); - sha512.lock(); - randomBytes.lock(); - } - - const BN_0$6 = BigInt(0); - const BN_36 = BigInt(36); - function getChecksumAddress(address) { - // if (!isHexString(address, 20)) { - // logger.throwArgumentError("invalid address", "address", address); - // } - address = address.toLowerCase(); - const chars = address.substring(2).split(""); - const expanded = new Uint8Array(40); - for (let i = 0; i < 40; i++) { - expanded[i] = chars[i].charCodeAt(0); - } - const hashed = getBytes(keccak256(expanded)); - for (let i = 0; i < 40; i += 2) { - if ((hashed[i >> 1] >> 4) >= 8) { - chars[i] = chars[i].toUpperCase(); - } - if ((hashed[i >> 1] & 0x0f) >= 8) { - chars[i + 1] = chars[i + 1].toUpperCase(); - } - } - return "0x" + chars.join(""); - } - // See: https://en.wikipedia.org/wiki/International_Bank_Account_Number - // Create lookup table - const ibanLookup = {}; - for (let i = 0; i < 10; i++) { - ibanLookup[String(i)] = String(i); - } - for (let i = 0; i < 26; i++) { - ibanLookup[String.fromCharCode(65 + i)] = String(10 + i); - } - // How many decimal digits can we process? (for 64-bit float, this is 15) - // i.e. Math.floor(Math.log10(Number.MAX_SAFE_INTEGER)); - const safeDigits = 15; - function ibanChecksum(address) { - address = address.toUpperCase(); - address = address.substring(4) + address.substring(0, 2) + "00"; - let expanded = address.split("").map((c) => { return ibanLookup[c]; }).join(""); - // Javascript can handle integers safely up to 15 (decimal) digits - while (expanded.length >= safeDigits) { - let block = expanded.substring(0, safeDigits); - expanded = parseInt(block, 10) % 97 + expanded.substring(block.length); - } - let checksum = String(98 - (parseInt(expanded, 10) % 97)); - while (checksum.length < 2) { - checksum = "0" + checksum; - } - return checksum; - } - const Base36 = (function () { - const result = {}; - for (let i = 0; i < 36; i++) { - const key = "0123456789abcdefghijklmnopqrstuvwxyz"[i]; - result[key] = BigInt(i); - } - return result; - })(); - function fromBase36(value) { - value = value.toLowerCase(); - let result = BN_0$6; - for (let i = 0; i < value.length; i++) { - result = result * BN_36 + Base36[value[i]]; - } - return result; - } - /** - * Returns a normalized and checksumed address for %%address%%. - * This accepts non-checksum addresses, checksum addresses and - * [[getIcapAddress]] formats. - * - * The checksum in Ethereum uses the capitalization (upper-case - * vs lower-case) of the characters within an address to encode - * its checksum, which offers, on average, a checksum of 15-bits. - * - * If %%address%% contains both upper-case and lower-case, it is - * assumed to already be a checksum address and its checksum is - * validated, and if the address fails its expected checksum an - * error is thrown. - * - * If you wish the checksum of %%address%% to be ignore, it should - * be converted to lower-case (i.e. ``.toLowercase()``) before - * being passed in. This should be a very rare situation though, - * that you wish to bypass the safegaurds in place to protect - * against an address that has been incorrectly copied from another - * source. - * - * @example: - * // Adds the checksum (via upper-casing specific letters) - * getAddress("0x8ba1f109551bd432803012645ac136ddd64dba72") - * //_result: - * - * // Converts ICAP address and adds checksum - * getAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36"); - * //_result: - * - * // Throws an error if an address contains mixed case, - * // but the checksum fails - * getAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72") - * //_error: - */ - function getAddress(address) { - assertArgument(typeof (address) === "string", "invalid address", "address", address); - if (address.match(/^(0x)?[0-9a-fA-F]{40}$/)) { - // Missing the 0x prefix - if (!address.startsWith("0x")) { - address = "0x" + address; - } - const result = getChecksumAddress(address); - // It is a checksummed address with a bad checksum - assertArgument(!address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) || result === address, "bad address checksum", "address", address); - return result; - } - // Maybe ICAP? (we only support direct mode) - if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) { - // It is an ICAP address with a bad checksum - assertArgument(address.substring(2, 4) === ibanChecksum(address), "bad icap checksum", "address", address); - let result = fromBase36(address.substring(4)).toString(16); - while (result.length < 40) { - result = "0" + result; - } - return getChecksumAddress("0x" + result); - } - assertArgument(false, "invalid address", "address", address); - } - /** - * The [ICAP Address format](link-icap) format is an early checksum - * format which attempts to be compatible with the banking - * industry [IBAN format](link-wiki-iban) for bank accounts. - * - * It is no longer common or a recommended format. - * - * @example: - * getIcapAddress("0x8ba1f109551bd432803012645ac136ddd64dba72"); - * //_result: - * - * getIcapAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36"); - * //_result: - * - * // Throws an error if the ICAP checksum is wrong - * getIcapAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK37"); - * //_error: - */ - function getIcapAddress(address) { - //let base36 = _base16To36(getAddress(address).substring(2)).toUpperCase(); - let base36 = BigInt(getAddress(address)).toString(36).toUpperCase(); - while (base36.length < 30) { - base36 = "0" + base36; - } - return "XE" + ibanChecksum("XE00" + base36) + base36; - } - - // http://ethereum.stackexchange.com/questions/760/how-is-the-address-of-an-ethereum-contract-computed - /** - * Returns the address that would result from a ``CREATE`` for %%tx%%. - * - * This can be used to compute the address a contract will be - * deployed to by an EOA when sending a deployment transaction (i.e. - * when the ``to`` address is ``null``). - * - * This can also be used to compute the address a contract will be - * deployed to by a contract, by using the contract's address as the - * ``to`` and the contract's nonce. - * - * @example - * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72"; - * nonce = 5; - * - * getCreateAddress({ from, nonce }); - * //_result: - */ - function getCreateAddress(tx) { - const from = getAddress(tx.from); - const nonce = getBigInt(tx.nonce, "tx.nonce"); - let nonceHex = nonce.toString(16); - if (nonceHex === "0") { - nonceHex = "0x"; - } - else if (nonceHex.length % 2) { - nonceHex = "0x0" + nonceHex; - } - else { - nonceHex = "0x" + nonceHex; - } - return getAddress(dataSlice(keccak256(encodeRlp([from, nonceHex])), 12)); - } - /** - * Returns the address that would result from a ``CREATE2`` operation - * with the given %%from%%, %%salt%% and %%initCodeHash%%. - * - * To compute the %%initCodeHash%% from a contract's init code, use - * the [[keccak256]] function. - * - * For a quick overview and example of ``CREATE2``, see [[link-ricmoo-wisps]]. - * - * @example - * // The address of the contract - * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72" - * - * // The salt - * salt = id("HelloWorld") - * - * // The hash of the initCode - * initCode = "0x6394198df16000526103ff60206004601c335afa6040516060f3"; - * initCodeHash = keccak256(initCode) - * - * getCreate2Address(from, salt, initCodeHash) - * //_result: - */ - function getCreate2Address(_from, _salt, _initCodeHash) { - const from = getAddress(_from); - const salt = getBytes(_salt, "salt"); - const initCodeHash = getBytes(_initCodeHash, "initCodeHash"); - assertArgument(salt.length === 32, "salt must be 32 bytes", "salt", _salt); - assertArgument(initCodeHash.length === 32, "initCodeHash must be 32 bytes", "initCodeHash", _initCodeHash); - return getAddress(dataSlice(keccak256(concat(["0xff", from, salt, initCodeHash])), 12)); - } - - /** - * Returns true if %%value%% is an object which implements the - * [[Addressable]] interface. - * - * @example: - * // Wallets and AbstractSigner sub-classes - * isAddressable(Wallet.createRandom()) - * //_result: - * - * // Contracts - * contract = new Contract("dai.tokens.ethers.eth", [ ], provider) - * isAddressable(contract) - * //_result: - */ - function isAddressable(value) { - return (value && typeof (value.getAddress) === "function"); - } - /** - * Returns true if %%value%% is a valid address. - * - * @example: - * // Valid address - * isAddress("0x8ba1f109551bD432803012645Ac136ddd64DBA72") - * //_result: - * - * // Valid ICAP address - * isAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36") - * //_result: - * - * // Invalid checksum - * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBa72") - * //_result: - * - * // Invalid ICAP checksum - * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72") - * //_result: - * - * // Not an address (an ENS name requires a provided and an - * // asynchronous API to access) - * isAddress("ricmoo.eth") - * //_result: - */ - function isAddress(value) { - try { - getAddress(value); - return true; - } - catch (error) { } - return false; - } - async function checkAddress(target, promise) { - const result = await promise; - if (result == null || result === "0x0000000000000000000000000000000000000000") { - assert(typeof (target) !== "string", "unconfigured name", "UNCONFIGURED_NAME", { value: target }); - assertArgument(false, "invalid AddressLike value; did not resolve to a value address", "target", target); - } - return getAddress(result); - } - /** - * Resolves to an address for the %%target%%, which may be any - * supported address type, an [[Addressable]] or a Promise which - * resolves to an address. - * - * If an ENS name is provided, but that name has not been correctly - * configured a [[UnconfiguredNameError]] is thrown. - * - * @example: - * addr = "0x6B175474E89094C44Da98b954EedeAC495271d0F" - * - * // Addresses are return synchronously - * resolveAddress(addr, provider) - * //_result: - * - * // Address promises are resolved asynchronously - * resolveAddress(Promise.resolve(addr)) - * //_result: - * - * // ENS names are resolved asynchronously - * resolveAddress("dai.tokens.ethers.eth", provider) - * //_result: - * - * // Addressable objects are resolved asynchronously - * contract = new Contract(addr, [ ]) - * resolveAddress(contract, provider) - * //_result: - * - * // Unconfigured ENS names reject - * resolveAddress("nothing-here.ricmoo.eth", provider) - * //_error: - * - * // ENS names require a NameResolver object passed in - * // (notice the provider was omitted) - * resolveAddress("nothing-here.ricmoo.eth") - * //_error: - */ - function resolveAddress(target, resolver) { - if (typeof (target) === "string") { - if (target.match(/^0x[0-9a-f]{40}$/i)) { - return getAddress(target); - } - assert(resolver != null, "ENS resolution requires a provider", "UNSUPPORTED_OPERATION", { operation: "resolveName" }); - return checkAddress(target, resolver.resolveName(target)); - } - else if (isAddressable(target)) { - return checkAddress(target, target.getAddress()); - } - else if (target && typeof (target.then) === "function") { - return checkAddress(target, target); - } - assertArgument(false, "unsupported addressable value", "target", target); - } - - /** - * A Typed object allows a value to have its type explicitly - * specified. - * - * For example, in Solidity, the value ``45`` could represent a - * ``uint8`` or a ``uint256``. The value ``0x1234`` could represent - * a ``bytes2`` or ``bytes``. - * - * Since JavaScript has no meaningful way to explicitly inform any - * APIs which what the type is, this allows transparent interoperation - * with Soldity. - * - * @_subsection: api/abi:Typed Values - */ - const _gaurd = {}; - function n(value, width) { - let signed = false; - if (width < 0) { - signed = true; - width *= -1; - } - // @TODO: Check range is valid for value - return new Typed(_gaurd, `${signed ? "" : "u"}int${width}`, value, { signed, width }); - } - function b(value, size) { - // @TODO: Check range is valid for value - return new Typed(_gaurd, `bytes${(size) ? size : ""}`, value, { size }); - } - const _typedSymbol = Symbol.for("_ethers_typed"); - /** - * The **Typed** class to wrap values providing explicit type information. - */ - class Typed { - /** - * The type, as a Solidity-compatible type. - */ - type; - /** - * The actual value. - */ - value; - #options; - /** - * @_ignore: - */ - _typedSymbol; - /** - * @_ignore: - */ - constructor(gaurd, type, value, options) { - if (options == null) { - options = null; - } - assertPrivate(_gaurd, gaurd, "Typed"); - defineProperties(this, { _typedSymbol, type, value }); - this.#options = options; - // Check the value is valid - this.format(); - } - /** - * Format the type as a Human-Readable type. - */ - format() { - if (this.type === "array") { - throw new Error(""); - } - else if (this.type === "dynamicArray") { - throw new Error(""); - } - else if (this.type === "tuple") { - return `tuple(${this.value.map((v) => v.format()).join(",")})`; - } - return this.type; - } - /** - * The default value returned by this type. - */ - defaultValue() { - return 0; - } - /** - * The minimum value for numeric types. - */ - minValue() { - return 0; - } - /** - * The maximum value for numeric types. - */ - maxValue() { - return 0; - } - /** - * Returns ``true`` and provides a type guard is this is a [[TypedBigInt]]. - */ - isBigInt() { - return !!(this.type.match(/^u?int[0-9]+$/)); - } - /** - * Returns ``true`` and provides a type guard is this is a [[TypedData]]. - */ - isData() { - return this.type.startsWith("bytes"); - } - /** - * Returns ``true`` and provides a type guard is this is a [[TypedString]]. - */ - isString() { - return (this.type === "string"); - } - /** - * Returns the tuple name, if this is a tuple. Throws otherwise. - */ - get tupleName() { - if (this.type !== "tuple") { - throw TypeError("not a tuple"); - } - return this.#options; - } - // Returns the length of this type as an array - // - `null` indicates the length is unforced, it could be dynamic - // - `-1` indicates the length is dynamic - // - any other value indicates it is a static array and is its length - /** - * Returns the length of the array type or ``-1`` if it is dynamic. - * - * Throws if the type is not an array. - */ - get arrayLength() { - if (this.type !== "array") { - throw TypeError("not an array"); - } - if (this.#options === true) { - return -1; - } - if (this.#options === false) { - return (this.value).length; - } - return null; - } - /** - * Returns a new **Typed** of %%type%% with the %%value%%. - */ - static from(type, value) { - return new Typed(_gaurd, type, value); - } - /** - * Return a new ``uint8`` type for %%v%%. - */ - static uint8(v) { return n(v, 8); } - /** - * Return a new ``uint16`` type for %%v%%. - */ - static uint16(v) { return n(v, 16); } - /** - * Return a new ``uint24`` type for %%v%%. - */ - static uint24(v) { return n(v, 24); } - /** - * Return a new ``uint32`` type for %%v%%. - */ - static uint32(v) { return n(v, 32); } - /** - * Return a new ``uint40`` type for %%v%%. - */ - static uint40(v) { return n(v, 40); } - /** - * Return a new ``uint48`` type for %%v%%. - */ - static uint48(v) { return n(v, 48); } - /** - * Return a new ``uint56`` type for %%v%%. - */ - static uint56(v) { return n(v, 56); } - /** - * Return a new ``uint64`` type for %%v%%. - */ - static uint64(v) { return n(v, 64); } - /** - * Return a new ``uint72`` type for %%v%%. - */ - static uint72(v) { return n(v, 72); } - /** - * Return a new ``uint80`` type for %%v%%. - */ - static uint80(v) { return n(v, 80); } - /** - * Return a new ``uint88`` type for %%v%%. - */ - static uint88(v) { return n(v, 88); } - /** - * Return a new ``uint96`` type for %%v%%. - */ - static uint96(v) { return n(v, 96); } - /** - * Return a new ``uint104`` type for %%v%%. - */ - static uint104(v) { return n(v, 104); } - /** - * Return a new ``uint112`` type for %%v%%. - */ - static uint112(v) { return n(v, 112); } - /** - * Return a new ``uint120`` type for %%v%%. - */ - static uint120(v) { return n(v, 120); } - /** - * Return a new ``uint128`` type for %%v%%. - */ - static uint128(v) { return n(v, 128); } - /** - * Return a new ``uint136`` type for %%v%%. - */ - static uint136(v) { return n(v, 136); } - /** - * Return a new ``uint144`` type for %%v%%. - */ - static uint144(v) { return n(v, 144); } - /** - * Return a new ``uint152`` type for %%v%%. - */ - static uint152(v) { return n(v, 152); } - /** - * Return a new ``uint160`` type for %%v%%. - */ - static uint160(v) { return n(v, 160); } - /** - * Return a new ``uint168`` type for %%v%%. - */ - static uint168(v) { return n(v, 168); } - /** - * Return a new ``uint176`` type for %%v%%. - */ - static uint176(v) { return n(v, 176); } - /** - * Return a new ``uint184`` type for %%v%%. - */ - static uint184(v) { return n(v, 184); } - /** - * Return a new ``uint192`` type for %%v%%. - */ - static uint192(v) { return n(v, 192); } - /** - * Return a new ``uint200`` type for %%v%%. - */ - static uint200(v) { return n(v, 200); } - /** - * Return a new ``uint208`` type for %%v%%. - */ - static uint208(v) { return n(v, 208); } - /** - * Return a new ``uint216`` type for %%v%%. - */ - static uint216(v) { return n(v, 216); } - /** - * Return a new ``uint224`` type for %%v%%. - */ - static uint224(v) { return n(v, 224); } - /** - * Return a new ``uint232`` type for %%v%%. - */ - static uint232(v) { return n(v, 232); } - /** - * Return a new ``uint240`` type for %%v%%. - */ - static uint240(v) { return n(v, 240); } - /** - * Return a new ``uint248`` type for %%v%%. - */ - static uint248(v) { return n(v, 248); } - /** - * Return a new ``uint256`` type for %%v%%. - */ - static uint256(v) { return n(v, 256); } - /** - * Return a new ``uint256`` type for %%v%%. - */ - static uint(v) { return n(v, 256); } - /** - * Return a new ``int8`` type for %%v%%. - */ - static int8(v) { return n(v, -8); } - /** - * Return a new ``int16`` type for %%v%%. - */ - static int16(v) { return n(v, -16); } - /** - * Return a new ``int24`` type for %%v%%. - */ - static int24(v) { return n(v, -24); } - /** - * Return a new ``int32`` type for %%v%%. - */ - static int32(v) { return n(v, -32); } - /** - * Return a new ``int40`` type for %%v%%. - */ - static int40(v) { return n(v, -40); } - /** - * Return a new ``int48`` type for %%v%%. - */ - static int48(v) { return n(v, -48); } - /** - * Return a new ``int56`` type for %%v%%. - */ - static int56(v) { return n(v, -56); } - /** - * Return a new ``int64`` type for %%v%%. - */ - static int64(v) { return n(v, -64); } - /** - * Return a new ``int72`` type for %%v%%. - */ - static int72(v) { return n(v, -72); } - /** - * Return a new ``int80`` type for %%v%%. - */ - static int80(v) { return n(v, -80); } - /** - * Return a new ``int88`` type for %%v%%. - */ - static int88(v) { return n(v, -88); } - /** - * Return a new ``int96`` type for %%v%%. - */ - static int96(v) { return n(v, -96); } - /** - * Return a new ``int104`` type for %%v%%. - */ - static int104(v) { return n(v, -104); } - /** - * Return a new ``int112`` type for %%v%%. - */ - static int112(v) { return n(v, -112); } - /** - * Return a new ``int120`` type for %%v%%. - */ - static int120(v) { return n(v, -120); } - /** - * Return a new ``int128`` type for %%v%%. - */ - static int128(v) { return n(v, -128); } - /** - * Return a new ``int136`` type for %%v%%. - */ - static int136(v) { return n(v, -136); } - /** - * Return a new ``int144`` type for %%v%%. - */ - static int144(v) { return n(v, -144); } - /** - * Return a new ``int52`` type for %%v%%. - */ - static int152(v) { return n(v, -152); } - /** - * Return a new ``int160`` type for %%v%%. - */ - static int160(v) { return n(v, -160); } - /** - * Return a new ``int168`` type for %%v%%. - */ - static int168(v) { return n(v, -168); } - /** - * Return a new ``int176`` type for %%v%%. - */ - static int176(v) { return n(v, -176); } - /** - * Return a new ``int184`` type for %%v%%. - */ - static int184(v) { return n(v, -184); } - /** - * Return a new ``int92`` type for %%v%%. - */ - static int192(v) { return n(v, -192); } - /** - * Return a new ``int200`` type for %%v%%. - */ - static int200(v) { return n(v, -200); } - /** - * Return a new ``int208`` type for %%v%%. - */ - static int208(v) { return n(v, -208); } - /** - * Return a new ``int216`` type for %%v%%. - */ - static int216(v) { return n(v, -216); } - /** - * Return a new ``int224`` type for %%v%%. - */ - static int224(v) { return n(v, -224); } - /** - * Return a new ``int232`` type for %%v%%. - */ - static int232(v) { return n(v, -232); } - /** - * Return a new ``int240`` type for %%v%%. - */ - static int240(v) { return n(v, -240); } - /** - * Return a new ``int248`` type for %%v%%. - */ - static int248(v) { return n(v, -248); } - /** - * Return a new ``int256`` type for %%v%%. - */ - static int256(v) { return n(v, -256); } - /** - * Return a new ``int256`` type for %%v%%. - */ - static int(v) { return n(v, -256); } - /** - * Return a new ``bytes1`` type for %%v%%. - */ - static bytes1(v) { return b(v, 1); } - /** - * Return a new ``bytes2`` type for %%v%%. - */ - static bytes2(v) { return b(v, 2); } - /** - * Return a new ``bytes3`` type for %%v%%. - */ - static bytes3(v) { return b(v, 3); } - /** - * Return a new ``bytes4`` type for %%v%%. - */ - static bytes4(v) { return b(v, 4); } - /** - * Return a new ``bytes5`` type for %%v%%. - */ - static bytes5(v) { return b(v, 5); } - /** - * Return a new ``bytes6`` type for %%v%%. - */ - static bytes6(v) { return b(v, 6); } - /** - * Return a new ``bytes7`` type for %%v%%. - */ - static bytes7(v) { return b(v, 7); } - /** - * Return a new ``bytes8`` type for %%v%%. - */ - static bytes8(v) { return b(v, 8); } - /** - * Return a new ``bytes9`` type for %%v%%. - */ - static bytes9(v) { return b(v, 9); } - /** - * Return a new ``bytes10`` type for %%v%%. - */ - static bytes10(v) { return b(v, 10); } - /** - * Return a new ``bytes11`` type for %%v%%. - */ - static bytes11(v) { return b(v, 11); } - /** - * Return a new ``bytes12`` type for %%v%%. - */ - static bytes12(v) { return b(v, 12); } - /** - * Return a new ``bytes13`` type for %%v%%. - */ - static bytes13(v) { return b(v, 13); } - /** - * Return a new ``bytes14`` type for %%v%%. - */ - static bytes14(v) { return b(v, 14); } - /** - * Return a new ``bytes15`` type for %%v%%. - */ - static bytes15(v) { return b(v, 15); } - /** - * Return a new ``bytes16`` type for %%v%%. - */ - static bytes16(v) { return b(v, 16); } - /** - * Return a new ``bytes17`` type for %%v%%. - */ - static bytes17(v) { return b(v, 17); } - /** - * Return a new ``bytes18`` type for %%v%%. - */ - static bytes18(v) { return b(v, 18); } - /** - * Return a new ``bytes19`` type for %%v%%. - */ - static bytes19(v) { return b(v, 19); } - /** - * Return a new ``bytes20`` type for %%v%%. - */ - static bytes20(v) { return b(v, 20); } - /** - * Return a new ``bytes21`` type for %%v%%. - */ - static bytes21(v) { return b(v, 21); } - /** - * Return a new ``bytes22`` type for %%v%%. - */ - static bytes22(v) { return b(v, 22); } - /** - * Return a new ``bytes23`` type for %%v%%. - */ - static bytes23(v) { return b(v, 23); } - /** - * Return a new ``bytes24`` type for %%v%%. - */ - static bytes24(v) { return b(v, 24); } - /** - * Return a new ``bytes25`` type for %%v%%. - */ - static bytes25(v) { return b(v, 25); } - /** - * Return a new ``bytes26`` type for %%v%%. - */ - static bytes26(v) { return b(v, 26); } - /** - * Return a new ``bytes27`` type for %%v%%. - */ - static bytes27(v) { return b(v, 27); } - /** - * Return a new ``bytes28`` type for %%v%%. - */ - static bytes28(v) { return b(v, 28); } - /** - * Return a new ``bytes29`` type for %%v%%. - */ - static bytes29(v) { return b(v, 29); } - /** - * Return a new ``bytes30`` type for %%v%%. - */ - static bytes30(v) { return b(v, 30); } - /** - * Return a new ``bytes31`` type for %%v%%. - */ - static bytes31(v) { return b(v, 31); } - /** - * Return a new ``bytes32`` type for %%v%%. - */ - static bytes32(v) { return b(v, 32); } - /** - * Return a new ``address`` type for %%v%%. - */ - static address(v) { return new Typed(_gaurd, "address", v); } - /** - * Return a new ``bool`` type for %%v%%. - */ - static bool(v) { return new Typed(_gaurd, "bool", !!v); } - /** - * Return a new ``bytes`` type for %%v%%. - */ - static bytes(v) { return new Typed(_gaurd, "bytes", v); } - /** - * Return a new ``string`` type for %%v%%. - */ - static string(v) { return new Typed(_gaurd, "string", v); } - /** - * Return a new ``array`` type for %%v%%, allowing %%dynamic%% length. - */ - static array(v, dynamic) { - throw new Error("not implemented yet"); - } - /** - * Return a new ``tuple`` type for %%v%%, with the optional %%name%%. - */ - static tuple(v, name) { - throw new Error("not implemented yet"); - } - /** - * Return a new ``uint8`` type for %%v%%. - */ - static overrides(v) { - return new Typed(_gaurd, "overrides", Object.assign({}, v)); - } - /** - * Returns true only if %%value%% is a [[Typed]] instance. - */ - static isTyped(value) { - return (value - && typeof (value) === "object" - && "_typedSymbol" in value - && value._typedSymbol === _typedSymbol); - } - /** - * If the value is a [[Typed]] instance, validates the underlying value - * and returns it, otherwise returns value directly. - * - * This is useful for functions that with to accept either a [[Typed]] - * object or values. - */ - static dereference(value, type) { - if (Typed.isTyped(value)) { - if (value.type !== type) { - throw new Error(`invalid type: expecetd ${type}, got ${value.type}`); - } - return value.value; - } - return value; - } - } - - /** - * @_ignore - */ - class AddressCoder extends Coder { - constructor(localName) { - super("address", "address", localName, false); - } - defaultValue() { - return "0x0000000000000000000000000000000000000000"; - } - encode(writer, _value) { - let value = Typed.dereference(_value, "string"); - try { - value = getAddress(value); - } - catch (error) { - return this._throwError(error.message, _value); - } - return writer.writeValue(value); - } - decode(reader) { - return getAddress(toBeHex(reader.readValue(), 20)); - } - } - - /** - * Clones the functionality of an existing Coder, but without a localName - * - * @_ignore - */ - class AnonymousCoder extends Coder { - coder; - constructor(coder) { - super(coder.name, coder.type, "_", coder.dynamic); - this.coder = coder; - } - defaultValue() { - return this.coder.defaultValue(); - } - encode(writer, value) { - return this.coder.encode(writer, value); - } - decode(reader) { - return this.coder.decode(reader); - } - } - - /** - * @_ignore - */ - function pack(writer, coders, values) { - let arrayValues = []; - if (Array.isArray(values)) { - arrayValues = values; - } - else if (values && typeof (values) === "object") { - let unique = {}; - arrayValues = coders.map((coder) => { - const name = coder.localName; - assert(name, "cannot encode object for signature with missing names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values }); - assert(!unique[name], "cannot encode object for signature with duplicate names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values }); - unique[name] = true; - return values[name]; - }); - } - else { - assertArgument(false, "invalid tuple value", "tuple", values); - } - assertArgument(coders.length === arrayValues.length, "types/value length mismatch", "tuple", values); - let staticWriter = new Writer(); - let dynamicWriter = new Writer(); - let updateFuncs = []; - coders.forEach((coder, index) => { - let value = arrayValues[index]; - if (coder.dynamic) { - // Get current dynamic offset (for the future pointer) - let dynamicOffset = dynamicWriter.length; - // Encode the dynamic value into the dynamicWriter - coder.encode(dynamicWriter, value); - // Prepare to populate the correct offset once we are done - let updateFunc = staticWriter.writeUpdatableValue(); - updateFuncs.push((baseOffset) => { - updateFunc(baseOffset + dynamicOffset); - }); - } - else { - coder.encode(staticWriter, value); - } - }); - // Backfill all the dynamic offsets, now that we know the static length - updateFuncs.forEach((func) => { func(staticWriter.length); }); - let length = writer.appendWriter(staticWriter); - length += writer.appendWriter(dynamicWriter); - return length; - } - /** - * @_ignore - */ - function unpack(reader, coders) { - let values = []; - let keys = []; - // A reader anchored to this base - let baseReader = reader.subReader(0); - coders.forEach((coder) => { - let value = null; - if (coder.dynamic) { - let offset = reader.readIndex(); - let offsetReader = baseReader.subReader(offset); - try { - value = coder.decode(offsetReader); - } - catch (error) { - // Cannot recover from this - if (isError(error, "BUFFER_OVERRUN")) { - throw error; - } - value = error; - value.baseType = coder.name; - value.name = coder.localName; - value.type = coder.type; - } - } - else { - try { - value = coder.decode(reader); - } - catch (error) { - // Cannot recover from this - if (isError(error, "BUFFER_OVERRUN")) { - throw error; - } - value = error; - value.baseType = coder.name; - value.name = coder.localName; - value.type = coder.type; - } - } - if (value == undefined) { - throw new Error("investigate"); - } - values.push(value); - keys.push(coder.localName || null); - }); - return Result.fromItems(values, keys); - } - /** - * @_ignore - */ - class ArrayCoder extends Coder { - coder; - length; - constructor(coder, length, localName) { - const type = (coder.type + "[" + (length >= 0 ? length : "") + "]"); - const dynamic = (length === -1 || coder.dynamic); - super("array", type, localName, dynamic); - defineProperties(this, { coder, length }); - } - defaultValue() { - // Verifies the child coder is valid (even if the array is dynamic or 0-length) - const defaultChild = this.coder.defaultValue(); - const result = []; - for (let i = 0; i < this.length; i++) { - result.push(defaultChild); - } - return result; - } - encode(writer, _value) { - const value = Typed.dereference(_value, "array"); - if (!Array.isArray(value)) { - this._throwError("expected array value", value); - } - let count = this.length; - if (count === -1) { - count = value.length; - writer.writeValue(value.length); - } - assertArgumentCount(value.length, count, "coder array" + (this.localName ? (" " + this.localName) : "")); - let coders = []; - for (let i = 0; i < value.length; i++) { - coders.push(this.coder); - } - return pack(writer, coders, value); - } - decode(reader) { - let count = this.length; - if (count === -1) { - count = reader.readIndex(); - // Check that there is *roughly* enough data to ensure - // stray random data is not being read as a length. Each - // slot requires at least 32 bytes for their value (or 32 - // bytes as a link to the data). This could use a much - // tighter bound, but we are erroring on the side of safety. - assert(count * WordSize <= reader.dataLength, "insufficient data length", "BUFFER_OVERRUN", { buffer: reader.bytes, offset: count * WordSize, length: reader.dataLength }); - } - let coders = []; - for (let i = 0; i < count; i++) { - coders.push(new AnonymousCoder(this.coder)); - } - return unpack(reader, coders); - } - } - - /** - * @_ignore - */ - class BooleanCoder extends Coder { - constructor(localName) { - super("bool", "bool", localName, false); - } - defaultValue() { - return false; - } - encode(writer, _value) { - const value = Typed.dereference(_value, "bool"); - return writer.writeValue(value ? 1 : 0); - } - decode(reader) { - return !!reader.readValue(); - } - } - - /** - * @_ignore - */ - class DynamicBytesCoder extends Coder { - constructor(type, localName) { - super(type, type, localName, true); - } - defaultValue() { - return "0x"; - } - encode(writer, value) { - value = getBytesCopy(value); - let length = writer.writeValue(value.length); - length += writer.writeBytes(value); - return length; - } - decode(reader) { - return reader.readBytes(reader.readIndex(), true); - } - } - /** - * @_ignore - */ - class BytesCoder extends DynamicBytesCoder { - constructor(localName) { - super("bytes", localName); - } - decode(reader) { - return hexlify(super.decode(reader)); - } - } - - /** - * @_ignore - */ - class FixedBytesCoder extends Coder { - size; - constructor(size, localName) { - let name = "bytes" + String(size); - super(name, name, localName, false); - defineProperties(this, { size }, { size: "number" }); - } - defaultValue() { - return ("0x0000000000000000000000000000000000000000000000000000000000000000").substring(0, 2 + this.size * 2); - } - encode(writer, _value) { - let data = getBytesCopy(Typed.dereference(_value, this.type)); - if (data.length !== this.size) { - this._throwError("incorrect data length", _value); - } - return writer.writeBytes(data); - } - decode(reader) { - return hexlify(reader.readBytes(this.size)); - } - } - - const Empty = new Uint8Array([]); - /** - * @_ignore - */ - class NullCoder extends Coder { - constructor(localName) { - super("null", "", localName, false); - } - defaultValue() { - return null; - } - encode(writer, value) { - if (value != null) { - this._throwError("not null", value); - } - return writer.writeBytes(Empty); - } - decode(reader) { - reader.readBytes(0); - return null; - } - } - - const BN_0$5 = BigInt(0); - const BN_1$2 = BigInt(1); - const BN_MAX_UINT256$1 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); - /** - * @_ignore - */ - class NumberCoder extends Coder { - size; - signed; - constructor(size, signed, localName) { - const name = ((signed ? "int" : "uint") + (size * 8)); - super(name, name, localName, false); - defineProperties(this, { size, signed }, { size: "number", signed: "boolean" }); - } - defaultValue() { - return 0; - } - encode(writer, _value) { - let value = getBigInt(Typed.dereference(_value, this.type)); - // Check bounds are safe for encoding - let maxUintValue = mask(BN_MAX_UINT256$1, WordSize * 8); - if (this.signed) { - let bounds = mask(maxUintValue, (this.size * 8) - 1); - if (value > bounds || value < -(bounds + BN_1$2)) { - this._throwError("value out-of-bounds", _value); - } - value = toTwos(value, 8 * WordSize); - } - else if (value < BN_0$5 || value > mask(maxUintValue, this.size * 8)) { - this._throwError("value out-of-bounds", _value); - } - return writer.writeValue(value); - } - decode(reader) { - let value = mask(reader.readValue(), this.size * 8); - if (this.signed) { - value = fromTwos(value, this.size * 8); - } - return value; - } - } - - /** - * @_ignore - */ - class StringCoder extends DynamicBytesCoder { - constructor(localName) { - super("string", localName); - } - defaultValue() { - return ""; - } - encode(writer, _value) { - return super.encode(writer, toUtf8Bytes(Typed.dereference(_value, "string"))); - } - decode(reader) { - return toUtf8String(super.decode(reader)); - } - } - - /** - * @_ignore - */ - class TupleCoder extends Coder { - coders; - constructor(coders, localName) { - let dynamic = false; - const types = []; - coders.forEach((coder) => { - if (coder.dynamic) { - dynamic = true; - } - types.push(coder.type); - }); - const type = ("tuple(" + types.join(",") + ")"); - super("tuple", type, localName, dynamic); - defineProperties(this, { coders: Object.freeze(coders.slice()) }); - } - defaultValue() { - const values = []; - this.coders.forEach((coder) => { - values.push(coder.defaultValue()); - }); - // We only output named properties for uniquely named coders - const uniqueNames = this.coders.reduce((accum, coder) => { - const name = coder.localName; - if (name) { - if (!accum[name]) { - accum[name] = 0; - } - accum[name]++; - } - return accum; - }, {}); - // Add named values - this.coders.forEach((coder, index) => { - let name = coder.localName; - if (!name || uniqueNames[name] !== 1) { - return; - } - if (name === "length") { - name = "_length"; - } - if (values[name] != null) { - return; - } - values[name] = values[index]; - }); - return Object.freeze(values); - } - encode(writer, _value) { - const value = Typed.dereference(_value, "tuple"); - return pack(writer, this.coders, value); - } - decode(reader) { - return unpack(reader, this.coders); - } - } - - function accessSetify(addr, storageKeys) { - return { - address: getAddress(addr), - storageKeys: storageKeys.map((storageKey, index) => { - assertArgument(isHexString(storageKey, 32), "invalid slot", `storageKeys[${index}]`, storageKey); - return storageKey.toLowerCase(); - }) - }; - } - /** - * Returns a [[AccessList]] from any ethers-supported access-list structure. - */ - function accessListify(value) { - if (Array.isArray(value)) { - return value.map((set, index) => { - if (Array.isArray(set)) { - assertArgument(set.length === 2, "invalid slot set", `value[${index}]`, set); - return accessSetify(set[0], set[1]); - } - assertArgument(set != null && typeof (set) === "object", "invalid address-slot set", "value", value); - return accessSetify(set.address, set.storageKeys); - }); - } - assertArgument(value != null && typeof (value) === "object", "invalid access list", "value", value); - const result = Object.keys(value).map((addr) => { - const storageKeys = value[addr].reduce((accum, storageKey) => { - accum[storageKey] = true; - return accum; - }, {}); - return accessSetify(addr, Object.keys(storageKeys).sort()); - }); - result.sort((a, b) => (a.address.localeCompare(b.address))); - return result; - } - - function authorizationify(auth) { - return { - address: getAddress(auth.address), - nonce: getBigInt((auth.nonce != null) ? auth.nonce : 0), - chainId: getBigInt((auth.chainId != null) ? auth.chainId : 0), - signature: Signature.from(auth.signature) - }; - } - - /** - * Returns the address for the %%key%%. - * - * The key may be any standard form of public key or a private key. - */ - function computeAddress(key) { - let pubkey; - if (typeof (key) === "string") { - pubkey = SigningKey.computePublicKey(key, false); - } - else { - pubkey = key.publicKey; - } - return getAddress(keccak256("0x" + pubkey.substring(4)).substring(26)); - } - /** - * Returns the recovered address for the private key that was - * used to sign %%digest%% that resulted in %%signature%%. - */ - function recoverAddress(digest, signature) { - return computeAddress(SigningKey.recoverPublicKey(digest, signature)); - } - - const BN_0$4 = BigInt(0); - const BN_2$2 = BigInt(2); - const BN_27 = BigInt(27); - const BN_28 = BigInt(28); - const BN_35 = BigInt(35); - const BN_MAX_UINT = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); - const inspect = Symbol.for("nodejs.util.inspect.custom"); - const BLOB_SIZE = 4096 * 32; - const CELL_COUNT = 128; - function getKzgLibrary(kzg) { - const blobToKzgCommitment = (blob) => { - if ("computeBlobProof" in kzg) { - // micro-ecc-signer; check for computeBlobProof since this API - // expects a string while the kzg-wasm below expects a Unit8Array - if ("blobToKzgCommitment" in kzg && typeof (kzg.blobToKzgCommitment) === "function") { - return getBytes(kzg.blobToKzgCommitment(hexlify(blob))); - } - } - else if ("blobToKzgCommitment" in kzg && typeof (kzg.blobToKzgCommitment) === "function") { - // kzg-wasm <0.5.0; blobToKzgCommitment(Uint8Array) => Uint8Array - return getBytes(kzg.blobToKzgCommitment(blob)); - } - // kzg-wasm >= 0.5.0; blobToKZGCommitment(string) => string - if ("blobToKZGCommitment" in kzg && typeof (kzg.blobToKZGCommitment) === "function") { - return getBytes(kzg.blobToKZGCommitment(hexlify(blob))); - } - assertArgument(false, "unsupported KZG library", "kzg", kzg); - }; - const computeBlobKzgProof = (blob, commitment) => { - // micro-ecc-signer - if ("computeBlobProof" in kzg && typeof (kzg.computeBlobProof) === "function") { - return getBytes(kzg.computeBlobProof(hexlify(blob), hexlify(commitment))); - } - // kzg-wasm <0.5.0; computeBlobKzgProof(Uint8Array, Uint8Array) => Uint8Array - if ("computeBlobKzgProof" in kzg && typeof (kzg.computeBlobKzgProof) === "function") { - return kzg.computeBlobKzgProof(blob, commitment); - } - // kzg-wasm >= 0.5.0; computeBlobKZGProof(string, string) => string - if ("computeBlobKZGProof" in kzg && typeof (kzg.computeBlobKZGProof) === "function") { - return getBytes(kzg.computeBlobKZGProof(hexlify(blob), hexlify(commitment))); - } - assertArgument(false, "unsupported KZG library", "kzg", kzg); - }; - return { blobToKzgCommitment, computeBlobKzgProof }; - } - function getVersionedHash(version, hash) { - let versioned = version.toString(16); - while (versioned.length < 2) { - versioned = "0" + versioned; - } - versioned += sha256(hash).substring(4); - return "0x" + versioned; - } - function handleAddress(value) { - if (value === "0x") { - return null; - } - return getAddress(value); - } - function handleAccessList(value, param) { - try { - return accessListify(value); - } - catch (error) { - assertArgument(false, error.message, param, value); - } - } - function handleAuthorizationList(value, param) { - try { - if (!Array.isArray(value)) { - throw new Error("authorizationList: invalid array"); - } - const result = []; - for (let i = 0; i < value.length; i++) { - const auth = value[i]; - if (!Array.isArray(auth)) { - throw new Error(`authorization[${i}]: invalid array`); - } - if (auth.length !== 6) { - throw new Error(`authorization[${i}]: wrong length`); - } - if (!auth[1]) { - throw new Error(`authorization[${i}]: null address`); - } - result.push({ - address: handleAddress(auth[1]), - nonce: handleUint(auth[2], "nonce"), - chainId: handleUint(auth[0], "chainId"), - signature: Signature.from({ - yParity: handleNumber(auth[3], "yParity"), - r: zeroPadValue(auth[4], 32), - s: zeroPadValue(auth[5], 32) - }) - }); - } - return result; - } - catch (error) { - assertArgument(false, error.message, param, value); - } - } - function handleNumber(_value, param) { - if (_value === "0x") { - return 0; - } - return getNumber(_value, param); - } - function handleUint(_value, param) { - if (_value === "0x") { - return BN_0$4; - } - const value = getBigInt(_value, param); - assertArgument(value <= BN_MAX_UINT, "value exceeds uint size", param, value); - return value; - } - function formatNumber(_value, name) { - const value = getBigInt(_value, "value"); - const result = toBeArray(value); - assertArgument(result.length <= 32, `value too large`, `tx.${name}`, value); - return result; - } - function formatAccessList(value) { - return accessListify(value).map((set) => [set.address, set.storageKeys]); - } - function formatAuthorizationList(value) { - return value.map((a) => { - return [ - formatNumber(a.chainId, "chainId"), - a.address, - formatNumber(a.nonce, "nonce"), - formatNumber(a.signature.yParity, "yParity"), - toBeArray(a.signature.r), - toBeArray(a.signature._s) - ]; - }); - } - function formatHashes(value, param) { - assertArgument(Array.isArray(value), `invalid ${param}`, "value", value); - for (let i = 0; i < value.length; i++) { - assertArgument(isHexString(value[i], 32), "invalid ${ param } hash", `value[${i}]`, value[i]); - } - return value; - } - function _parseLegacy(data) { - const fields = decodeRlp(data); - assertArgument(Array.isArray(fields) && (fields.length === 9 || fields.length === 6), "invalid field count for legacy transaction", "data", data); - const tx = { - type: 0, - nonce: handleNumber(fields[0], "nonce"), - gasPrice: handleUint(fields[1], "gasPrice"), - gasLimit: handleUint(fields[2], "gasLimit"), - to: handleAddress(fields[3]), - value: handleUint(fields[4], "value"), - data: hexlify(fields[5]), - chainId: BN_0$4 - }; - // Legacy unsigned transaction - if (fields.length === 6) { - return tx; - } - const v = handleUint(fields[6], "v"); - const r = handleUint(fields[7], "r"); - const s = handleUint(fields[8], "s"); - if (r === BN_0$4 && s === BN_0$4) { - // EIP-155 unsigned transaction - tx.chainId = v; - } - else { - // Compute the EIP-155 chain ID (or 0 for legacy) - let chainId = (v - BN_35) / BN_2$2; - if (chainId < BN_0$4) { - chainId = BN_0$4; - } - tx.chainId = chainId; - // Signed Legacy Transaction - assertArgument(chainId !== BN_0$4 || (v === BN_27 || v === BN_28), "non-canonical legacy v", "v", fields[6]); - tx.signature = Signature.from({ - r: zeroPadValue(fields[7], 32), - s: zeroPadValue(fields[8], 32), - v - }); - //tx.hash = keccak256(data); - } - return tx; - } - function _serializeLegacy(tx, sig) { - const fields = [ - formatNumber(tx.nonce, "nonce"), - formatNumber(tx.gasPrice || 0, "gasPrice"), - formatNumber(tx.gasLimit, "gasLimit"), - (tx.to || "0x"), - formatNumber(tx.value, "value"), - tx.data, - ]; - let chainId = BN_0$4; - if (tx.chainId != BN_0$4) { - // A chainId was provided; if non-zero we'll use EIP-155 - chainId = getBigInt(tx.chainId, "tx.chainId"); - // We have a chainId in the tx and an EIP-155 v in the signature, - // make sure they agree with each other - assertArgument(!sig || sig.networkV == null || sig.legacyChainId === chainId, "tx.chainId/sig.v mismatch", "sig", sig); - } - else if (tx.signature) { - // No explicit chainId, but EIP-155 have a derived implicit chainId - const legacy = tx.signature.legacyChainId; - if (legacy != null) { - chainId = legacy; - } - } - // Requesting an unsigned transaction - if (!sig) { - // We have an EIP-155 transaction (chainId was specified and non-zero) - if (chainId !== BN_0$4) { - fields.push(toBeArray(chainId)); - fields.push("0x"); - fields.push("0x"); - } - return encodeRlp(fields); - } - // @TODO: We should probably check that tx.signature, chainId, and sig - // match but that logic could break existing code, so schedule - // this for the next major bump. - // Compute the EIP-155 v - let v = BigInt(27 + sig.yParity); - if (chainId !== BN_0$4) { - v = Signature.getChainIdV(chainId, sig.v); - } - else if (BigInt(sig.v) !== v) { - assertArgument(false, "tx.chainId/sig.v mismatch", "sig", sig); - } - // Add the signature - fields.push(toBeArray(v)); - fields.push(toBeArray(sig.r)); - fields.push(toBeArray(sig._s)); - return encodeRlp(fields); - } - function _parseEipSignature(tx, fields) { - let yParity; - try { - yParity = handleNumber(fields[0], "yParity"); - if (yParity !== 0 && yParity !== 1) { - throw new Error("bad yParity"); - } - } - catch (error) { - assertArgument(false, "invalid yParity", "yParity", fields[0]); - } - const r = zeroPadValue(fields[1], 32); - const s = zeroPadValue(fields[2], 32); - const signature = Signature.from({ r, s, yParity }); - tx.signature = signature; - } - function _parseEip1559(data) { - const fields = decodeRlp(getBytes(data).slice(1)); - assertArgument(Array.isArray(fields) && (fields.length === 9 || fields.length === 12), "invalid field count for transaction type: 2", "data", hexlify(data)); - const tx = { - type: 2, - chainId: handleUint(fields[0], "chainId"), - nonce: handleNumber(fields[1], "nonce"), - maxPriorityFeePerGas: handleUint(fields[2], "maxPriorityFeePerGas"), - maxFeePerGas: handleUint(fields[3], "maxFeePerGas"), - gasPrice: null, - gasLimit: handleUint(fields[4], "gasLimit"), - to: handleAddress(fields[5]), - value: handleUint(fields[6], "value"), - data: hexlify(fields[7]), - accessList: handleAccessList(fields[8], "accessList"), - }; - // Unsigned EIP-1559 Transaction - if (fields.length === 9) { - return tx; - } - //tx.hash = keccak256(data); - _parseEipSignature(tx, fields.slice(9)); - return tx; - } - function _serializeEip1559(tx, sig) { - const fields = [ - formatNumber(tx.chainId, "chainId"), - formatNumber(tx.nonce, "nonce"), - formatNumber(tx.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"), - formatNumber(tx.maxFeePerGas || 0, "maxFeePerGas"), - formatNumber(tx.gasLimit, "gasLimit"), - (tx.to || "0x"), - formatNumber(tx.value, "value"), - tx.data, - formatAccessList(tx.accessList || []) - ]; - if (sig) { - fields.push(formatNumber(sig.yParity, "yParity")); - fields.push(toBeArray(sig.r)); - fields.push(toBeArray(sig.s)); - } - return concat(["0x02", encodeRlp(fields)]); - } - function _parseEip2930(data) { - const fields = decodeRlp(getBytes(data).slice(1)); - assertArgument(Array.isArray(fields) && (fields.length === 8 || fields.length === 11), "invalid field count for transaction type: 1", "data", hexlify(data)); - const tx = { - type: 1, - chainId: handleUint(fields[0], "chainId"), - nonce: handleNumber(fields[1], "nonce"), - gasPrice: handleUint(fields[2], "gasPrice"), - gasLimit: handleUint(fields[3], "gasLimit"), - to: handleAddress(fields[4]), - value: handleUint(fields[5], "value"), - data: hexlify(fields[6]), - accessList: handleAccessList(fields[7], "accessList") - }; - // Unsigned EIP-2930 Transaction - if (fields.length === 8) { - return tx; - } - //tx.hash = keccak256(data); - _parseEipSignature(tx, fields.slice(8)); - return tx; - } - function _serializeEip2930(tx, sig) { - const fields = [ - formatNumber(tx.chainId, "chainId"), - formatNumber(tx.nonce, "nonce"), - formatNumber(tx.gasPrice || 0, "gasPrice"), - formatNumber(tx.gasLimit, "gasLimit"), - (tx.to || "0x"), - formatNumber(tx.value, "value"), - tx.data, - formatAccessList(tx.accessList || []) - ]; - if (sig) { - fields.push(formatNumber(sig.yParity, "recoveryParam")); - fields.push(toBeArray(sig.r)); - fields.push(toBeArray(sig.s)); - } - return concat(["0x01", encodeRlp(fields)]); - } - function _parseEip4844(data) { - let fields = decodeRlp(getBytes(data).slice(1)); - let typeName = "3"; - let blobWrapperVersion = null; - let blobs = null; - // Parse the network format - if (fields.length === 4 && Array.isArray(fields[0])) { - // EIP-4844 format with sidecar - typeName = "3 (network format)"; - const fBlobs = fields[1], fCommits = fields[2], fProofs = fields[3]; - assertArgument(Array.isArray(fBlobs), "invalid network format: blobs not an array", "fields[1]", fBlobs); - assertArgument(Array.isArray(fCommits), "invalid network format: commitments not an array", "fields[2]", fCommits); - assertArgument(Array.isArray(fProofs), "invalid network format: proofs not an array", "fields[3]", fProofs); - assertArgument(fBlobs.length === fCommits.length, "invalid network format: blobs/commitments length mismatch", "fields", fields); - assertArgument(fBlobs.length === fProofs.length, "invalid network format: blobs/proofs length mismatch", "fields", fields); - blobs = []; - for (let i = 0; i < fields[1].length; i++) { - blobs.push({ - data: fBlobs[i], - commitment: fCommits[i], - proof: fProofs[i], - }); - } - fields = fields[0]; - } - else if (fields.length === 5 && Array.isArray(fields[0])) { - // EIP-7594 format with sidecar - typeName = "3 (EIP-7594 network format)"; - blobWrapperVersion = getNumber(fields[1]); - const fBlobs = fields[2], fCommits = fields[3], fProofs = fields[4]; - assertArgument(blobWrapperVersion === 1, `unsupported EIP-7594 network format version: ${blobWrapperVersion}`, "fields[1]", blobWrapperVersion); - assertArgument(Array.isArray(fBlobs), "invalid EIP-7594 network format: blobs not an array", "fields[2]", fBlobs); - assertArgument(Array.isArray(fCommits), "invalid EIP-7594 network format: commitments not an array", "fields[3]", fCommits); - assertArgument(Array.isArray(fProofs), "invalid EIP-7594 network format: proofs not an array", "fields[4]", fProofs); - assertArgument(fBlobs.length === fCommits.length, "invalid network format: blobs/commitments length mismatch", "fields", fields); - assertArgument(fBlobs.length * CELL_COUNT === fProofs.length, "invalid network format: blobs/proofs length mismatch", "fields", fields); - blobs = []; - for (let i = 0; i < fBlobs.length; i++) { - const proof = []; - for (let j = 0; j < CELL_COUNT; j++) { - proof.push(fProofs[(i * CELL_COUNT) + j]); - } - blobs.push({ - data: fBlobs[i], - commitment: fCommits[i], - proof: concat(proof) - }); - } - fields = fields[0]; - } - assertArgument(Array.isArray(fields) && (fields.length === 11 || fields.length === 14), `invalid field count for transaction type: ${typeName}`, "data", hexlify(data)); - const tx = { - type: 3, - chainId: handleUint(fields[0], "chainId"), - nonce: handleNumber(fields[1], "nonce"), - maxPriorityFeePerGas: handleUint(fields[2], "maxPriorityFeePerGas"), - maxFeePerGas: handleUint(fields[3], "maxFeePerGas"), - gasPrice: null, - gasLimit: handleUint(fields[4], "gasLimit"), - to: handleAddress(fields[5]), - value: handleUint(fields[6], "value"), - data: hexlify(fields[7]), - accessList: handleAccessList(fields[8], "accessList"), - maxFeePerBlobGas: handleUint(fields[9], "maxFeePerBlobGas"), - blobVersionedHashes: fields[10], - blobWrapperVersion - }; - if (blobs) { - tx.blobs = blobs; - } - assertArgument(tx.to != null, `invalid address for transaction type: ${typeName}`, "data", data); - assertArgument(Array.isArray(tx.blobVersionedHashes), "invalid blobVersionedHashes: must be an array", "data", data); - for (let i = 0; i < tx.blobVersionedHashes.length; i++) { - assertArgument(isHexString(tx.blobVersionedHashes[i], 32), `invalid blobVersionedHash at index ${i}: must be length 32`, "data", data); - } - // Unsigned EIP-4844 Transaction - if (fields.length === 11) { - return tx; - } - // @TODO: Do we need to do this? This is only called internally - // and used to verify hashes; it might save time to not do this - //tx.hash = keccak256(concat([ "0x03", encodeRlp(fields) ])); - _parseEipSignature(tx, fields.slice(11)); - return tx; - } - function _serializeEip4844(tx, sig, blobs) { - const fields = [ - formatNumber(tx.chainId, "chainId"), - formatNumber(tx.nonce, "nonce"), - formatNumber(tx.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"), - formatNumber(tx.maxFeePerGas || 0, "maxFeePerGas"), - formatNumber(tx.gasLimit, "gasLimit"), - (tx.to || ZeroAddress), - formatNumber(tx.value, "value"), - tx.data, - formatAccessList(tx.accessList || []), - formatNumber(tx.maxFeePerBlobGas || 0, "maxFeePerBlobGas"), - formatHashes(tx.blobVersionedHashes || [], "blobVersionedHashes") - ]; - if (sig) { - fields.push(formatNumber(sig.yParity, "yParity")); - fields.push(toBeArray(sig.r)); - fields.push(toBeArray(sig.s)); - // We have blobs; return the network wrapped format - if (blobs) { - // Use EIP-7594 - if (tx.blobWrapperVersion != null) { - const wrapperVersion = toBeArray(tx.blobWrapperVersion); - const cellProofs = []; - for (const { proof } of blobs) { - const p = getBytes(proof); - const cellSize = p.length / CELL_COUNT; - for (let i = 0; i < p.length; i += cellSize) { - cellProofs.push(p.subarray(i, i + cellSize)); - } - } - return concat([ - "0x03", - encodeRlp([ - fields, - wrapperVersion, - blobs.map((b) => b.data), - blobs.map((b) => b.commitment), - cellProofs - ]) - ]); - } - // Fall back onto classic EIP-4844 behavior - return concat([ - "0x03", - encodeRlp([ - fields, - blobs.map((b) => b.data), - blobs.map((b) => b.commitment), - blobs.map((b) => b.proof), - ]) - ]); - } - } - return concat(["0x03", encodeRlp(fields)]); - } - function _parseEip7702(data) { - const fields = decodeRlp(getBytes(data).slice(1)); - assertArgument(Array.isArray(fields) && (fields.length === 10 || fields.length === 13), "invalid field count for transaction type: 4", "data", hexlify(data)); - const tx = { - type: 4, - chainId: handleUint(fields[0], "chainId"), - nonce: handleNumber(fields[1], "nonce"), - maxPriorityFeePerGas: handleUint(fields[2], "maxPriorityFeePerGas"), - maxFeePerGas: handleUint(fields[3], "maxFeePerGas"), - gasPrice: null, - gasLimit: handleUint(fields[4], "gasLimit"), - to: handleAddress(fields[5]), - value: handleUint(fields[6], "value"), - data: hexlify(fields[7]), - accessList: handleAccessList(fields[8], "accessList"), - authorizationList: handleAuthorizationList(fields[9], "authorizationList"), - }; - // Unsigned EIP-7702 Transaction - if (fields.length === 10) { - return tx; - } - _parseEipSignature(tx, fields.slice(10)); - return tx; - } - function _serializeEip7702(tx, sig) { - const fields = [ - formatNumber(tx.chainId, "chainId"), - formatNumber(tx.nonce, "nonce"), - formatNumber(tx.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"), - formatNumber(tx.maxFeePerGas || 0, "maxFeePerGas"), - formatNumber(tx.gasLimit, "gasLimit"), - (tx.to || "0x"), - formatNumber(tx.value, "value"), - tx.data, - formatAccessList(tx.accessList || []), - formatAuthorizationList(tx.authorizationList || []) - ]; - if (sig) { - fields.push(formatNumber(sig.yParity, "yParity")); - fields.push(toBeArray(sig.r)); - fields.push(toBeArray(sig.s)); - } - return concat(["0x04", encodeRlp(fields)]); - } - /** - * A **Transaction** describes an operation to be executed on - * Ethereum by an Externally Owned Account (EOA). It includes - * who (the [[to]] address), what (the [[data]]) and how much (the - * [[value]] in ether) the operation should entail. - * - * @example: - * tx = new Transaction() - * //_result: - * - * tx.data = "0x1234"; - * //_result: - */ - class Transaction { - #type; - #to; - #data; - #nonce; - #gasLimit; - #gasPrice; - #maxPriorityFeePerGas; - #maxFeePerGas; - #value; - #chainId; - #sig; - #accessList; - #maxFeePerBlobGas; - #blobVersionedHashes; - #kzg; - #blobs; - #auths; - #blobWrapperVersion; - /** - * The transaction type. - * - * If null, the type will be automatically inferred based on - * explicit properties. - */ - get type() { return this.#type; } - set type(value) { - switch (value) { - case null: - this.#type = null; - break; - case 0: - case "legacy": - this.#type = 0; - break; - case 1: - case "berlin": - case "eip-2930": - this.#type = 1; - break; - case 2: - case "london": - case "eip-1559": - this.#type = 2; - break; - case 3: - case "cancun": - case "eip-4844": - this.#type = 3; - break; - case 4: - case "pectra": - case "eip-7702": - this.#type = 4; - break; - default: - assertArgument(false, "unsupported transaction type", "type", value); - } - } - /** - * The name of the transaction type. - */ - get typeName() { - switch (this.type) { - case 0: return "legacy"; - case 1: return "eip-2930"; - case 2: return "eip-1559"; - case 3: return "eip-4844"; - case 4: return "eip-7702"; - } - return null; - } - /** - * The ``to`` address for the transaction or ``null`` if the - * transaction is an ``init`` transaction. - */ - get to() { - const value = this.#to; - if (value == null && this.type === 3) { - return ZeroAddress; - } - return value; - } - set to(value) { - this.#to = (value == null) ? null : getAddress(value); - } - /** - * The transaction nonce. - */ - get nonce() { return this.#nonce; } - set nonce(value) { this.#nonce = getNumber(value, "value"); } - /** - * The gas limit. - */ - get gasLimit() { return this.#gasLimit; } - set gasLimit(value) { this.#gasLimit = getBigInt(value); } - /** - * The gas price. - * - * On legacy networks this defines the fee that will be paid. On - * EIP-1559 networks, this should be ``null``. - */ - get gasPrice() { - const value = this.#gasPrice; - if (value == null && (this.type === 0 || this.type === 1)) { - return BN_0$4; - } - return value; - } - set gasPrice(value) { - this.#gasPrice = (value == null) ? null : getBigInt(value, "gasPrice"); - } - /** - * The maximum priority fee per unit of gas to pay. On legacy - * networks this should be ``null``. - */ - get maxPriorityFeePerGas() { - const value = this.#maxPriorityFeePerGas; - if (value == null) { - if (this.type === 2 || this.type === 3) { - return BN_0$4; - } - return null; - } - return value; - } - set maxPriorityFeePerGas(value) { - this.#maxPriorityFeePerGas = (value == null) ? null : getBigInt(value, "maxPriorityFeePerGas"); - } - /** - * The maximum total fee per unit of gas to pay. On legacy - * networks this should be ``null``. - */ - get maxFeePerGas() { - const value = this.#maxFeePerGas; - if (value == null) { - if (this.type === 2 || this.type === 3) { - return BN_0$4; - } - return null; - } - return value; - } - set maxFeePerGas(value) { - this.#maxFeePerGas = (value == null) ? null : getBigInt(value, "maxFeePerGas"); - } - /** - * The transaction data. For ``init`` transactions this is the - * deployment code. - */ - get data() { return this.#data; } - set data(value) { this.#data = hexlify(value); } - /** - * The amount of ether (in wei) to send in this transactions. - */ - get value() { return this.#value; } - set value(value) { - this.#value = getBigInt(value, "value"); - } - /** - * The chain ID this transaction is valid on. - */ - get chainId() { return this.#chainId; } - set chainId(value) { this.#chainId = getBigInt(value); } - /** - * If signed, the signature for this transaction. - */ - get signature() { return this.#sig || null; } - set signature(value) { - this.#sig = (value == null) ? null : Signature.from(value); - } - isValid() { - const sig = this.signature; - if (sig && !sig.isValid()) { - return false; - } - const auths = this.authorizationList; - if (auths) { - for (const auth of auths) { - if (!auth.signature.isValid()) { - return false; - } - } - } - return true; - } - /** - * The access list. - * - * An access list permits discounted (but pre-paid) access to - * bytecode and state variable access within contract execution. - */ - get accessList() { - const value = this.#accessList || null; - if (value == null) { - if (this.type === 1 || this.type === 2 || this.type === 3) { - // @TODO: in v7, this should assign the value or become - // a live object itself, otherwise mutation is inconsistent - return []; - } - return null; - } - return value; - } - set accessList(value) { - this.#accessList = (value == null) ? null : accessListify(value); - } - get authorizationList() { - const value = this.#auths || null; - if (value == null) { - if (this.type === 4) { - // @TODO: in v7, this should become a live object itself, - // otherwise mutation is inconsistent - return []; - } - } - return value; - } - set authorizationList(auths) { - this.#auths = (auths == null) ? null : auths.map((a) => authorizationify(a)); - } - /** - * The max fee per blob gas for Cancun transactions. - */ - get maxFeePerBlobGas() { - const value = this.#maxFeePerBlobGas; - if (value == null && this.type === 3) { - return BN_0$4; - } - return value; - } - set maxFeePerBlobGas(value) { - this.#maxFeePerBlobGas = (value == null) ? null : getBigInt(value, "maxFeePerBlobGas"); - } - /** - * The BLOb versioned hashes for Cancun transactions. - */ - get blobVersionedHashes() { - // @TODO: Mutation is inconsistent; if unset, the returned value - // cannot mutate the object, if set it can - let value = this.#blobVersionedHashes; - if (value == null && this.type === 3) { - return []; - } - return value; - } - set blobVersionedHashes(value) { - if (value != null) { - assertArgument(Array.isArray(value), "blobVersionedHashes must be an Array", "value", value); - value = value.slice(); - for (let i = 0; i < value.length; i++) { - assertArgument(isHexString(value[i], 32), "invalid blobVersionedHash", `value[${i}]`, value[i]); - } - } - this.#blobVersionedHashes = value; - } - /** - * The BLObs for the Transaction, if any. - * - * If ``blobs`` is non-``null``, then the [[seriailized]] - * will return the network formatted sidecar, otherwise it - * will return the standard [[link-eip-2718]] payload. The - * [[unsignedSerialized]] is unaffected regardless. - * - * When setting ``blobs``, either fully valid [[Blob]] objects - * may be specified (i.e. correctly padded, with correct - * committments and proofs) or a raw [[BytesLike]] may - * be provided. - * - * If raw [[BytesLike]] are provided, the [[kzg]] property **must** - * be already set. The blob will be correctly padded and the - * [[KzgLibrary]] will be used to compute the committment and - * proof for the blob. - * - * A BLOb is a sequence of field elements, each of which must - * be within the BLS field modulo, so some additional processing - * may be required to encode arbitrary data to ensure each 32 byte - * field is within the valid range. - * - * Setting this automatically populates [[blobVersionedHashes]], - * overwriting any existing values. Setting this to ``null`` - * does **not** remove the [[blobVersionedHashes]], leaving them - * present. - */ - get blobs() { - if (this.#blobs == null) { - return null; - } - return this.#blobs.map((b) => Object.assign({}, b)); - } - set blobs(_blobs) { - if (_blobs == null) { - this.#blobs = null; - return; - } - const blobs = []; - const versionedHashes = []; - for (let i = 0; i < _blobs.length; i++) { - const blob = _blobs[i]; - if (isBytesLike(blob)) { - assert(this.#kzg, "adding a raw blob requires a KZG library", "UNSUPPORTED_OPERATION", { - operation: "set blobs()" - }); - let data = getBytes(blob); - assertArgument(data.length <= BLOB_SIZE, "blob is too large", `blobs[${i}]`, blob); - // Pad blob if necessary - if (data.length !== BLOB_SIZE) { - const padded = new Uint8Array(BLOB_SIZE); - padded.set(data); - data = padded; - } - const commit = this.#kzg.blobToKzgCommitment(data); - const proof = hexlify(this.#kzg.computeBlobKzgProof(data, commit)); - blobs.push({ - data: hexlify(data), - commitment: hexlify(commit), - proof - }); - versionedHashes.push(getVersionedHash(1, commit)); - } - else { - const data = hexlify(blob.data); - const commitment = hexlify(blob.commitment); - const proof = hexlify(blob.proof); - blobs.push({ data, commitment, proof }); - versionedHashes.push(getVersionedHash(1, commitment)); - } - } - this.#blobs = blobs; - this.#blobVersionedHashes = versionedHashes; - } - get kzg() { return this.#kzg; } - set kzg(kzg) { - if (kzg == null) { - this.#kzg = null; - } - else { - this.#kzg = getKzgLibrary(kzg); - } - } - get blobWrapperVersion() { - return this.#blobWrapperVersion; - } - set blobWrapperVersion(value) { - this.#blobWrapperVersion = value; - } - /** - * Creates a new Transaction with default values. - */ - constructor() { - this.#type = null; - this.#to = null; - this.#nonce = 0; - this.#gasLimit = BN_0$4; - this.#gasPrice = null; - this.#maxPriorityFeePerGas = null; - this.#maxFeePerGas = null; - this.#data = "0x"; - this.#value = BN_0$4; - this.#chainId = BN_0$4; - this.#sig = null; - this.#accessList = null; - this.#maxFeePerBlobGas = null; - this.#blobVersionedHashes = null; - this.#kzg = null; - this.#blobs = null; - this.#auths = null; - this.#blobWrapperVersion = null; - } - /** - * The transaction hash, if signed. Otherwise, ``null``. - */ - get hash() { - if (this.signature == null) { - return null; - } - return keccak256(this.#getSerialized(true, false)); - } - /** - * The pre-image hash of this transaction. - * - * This is the digest that a [[Signer]] must sign to authorize - * this transaction. - */ - get unsignedHash() { - return keccak256(this.unsignedSerialized); - } - /** - * The sending address, if signed. Otherwise, ``null``. - */ - get from() { - if (this.signature == null) { - return null; - } - return recoverAddress(this.unsignedHash, this.signature.getCanonical()); - } - /** - * The public key of the sender, if signed. Otherwise, ``null``. - */ - get fromPublicKey() { - if (this.signature == null) { - return null; - } - return SigningKey.recoverPublicKey(this.unsignedHash, this.signature.getCanonical()); - } - /** - * Returns true if signed. - * - * This provides a Type Guard that properties requiring a signed - * transaction are non-null. - */ - isSigned() { - return this.signature != null; - } - #getSerialized(signed, sidecar) { - assert(!signed || this.signature != null, "cannot serialize unsigned transaction; maybe you meant .unsignedSerialized", "UNSUPPORTED_OPERATION", { operation: ".serialized" }); - const sig = signed ? this.signature : null; - switch (this.inferType()) { - case 0: - return _serializeLegacy(this, sig); - case 1: - return _serializeEip2930(this, sig); - case 2: - return _serializeEip1559(this, sig); - case 3: - return _serializeEip4844(this, sig, sidecar ? this.blobs : null); - case 4: - return _serializeEip7702(this, sig); - } - assert(false, "unsupported transaction type", "UNSUPPORTED_OPERATION", { operation: ".serialized" }); - } - /** - * The serialized transaction. - * - * This throws if the transaction is unsigned. For the pre-image, - * use [[unsignedSerialized]]. - */ - get serialized() { - return this.#getSerialized(true, true); - } - /** - * The transaction pre-image. - * - * The hash of this is the digest which needs to be signed to - * authorize this transaction. - */ - get unsignedSerialized() { - return this.#getSerialized(false, false); - } - /** - * Return the most "likely" type; currently the highest - * supported transaction type. - */ - inferType() { - const types = this.inferTypes(); - // Prefer London (EIP-1559) over Cancun (BLOb) - if (types.indexOf(2) >= 0) { - return 2; - } - // Return the highest inferred type - return (types.pop()); - } - /** - * Validates the explicit properties and returns a list of compatible - * transaction types. - */ - inferTypes() { - // Checks that there are no conflicting properties set - const hasGasPrice = this.gasPrice != null; - const hasFee = (this.maxFeePerGas != null || this.maxPriorityFeePerGas != null); - const hasAccessList = (this.accessList != null); - const hasBlob = (this.#maxFeePerBlobGas != null || this.#blobVersionedHashes); - //if (hasGasPrice && hasFee) { - // throw new Error("transaction cannot have gasPrice and maxFeePerGas"); - //} - if (this.maxFeePerGas != null && this.maxPriorityFeePerGas != null) { - assert(this.maxFeePerGas >= this.maxPriorityFeePerGas, "priorityFee cannot be more than maxFee", "BAD_DATA", { value: this }); - } - //if (this.type === 2 && hasGasPrice) { - // throw new Error("eip-1559 transaction cannot have gasPrice"); - //} - assert(!hasFee || (this.type !== 0 && this.type !== 1), "transaction type cannot have maxFeePerGas or maxPriorityFeePerGas", "BAD_DATA", { value: this }); - assert(this.type !== 0 || !hasAccessList, "legacy transaction cannot have accessList", "BAD_DATA", { value: this }); - const types = []; - // Explicit type - if (this.type != null) { - types.push(this.type); - } - else { - if (this.authorizationList && this.authorizationList.length) { - types.push(4); - } - else if (hasFee) { - types.push(2); - } - else if (hasGasPrice) { - types.push(1); - if (!hasAccessList) { - types.push(0); - } - } - else if (hasAccessList) { - types.push(1); - types.push(2); - } - else if (hasBlob && this.to) { - types.push(3); - } - else { - types.push(0); - types.push(1); - types.push(2); - types.push(3); - } - } - types.sort(); - return types; - } - /** - * Returns true if this transaction is a legacy transaction (i.e. - * ``type === 0``). - * - * This provides a Type Guard that the related properties are - * non-null. - */ - isLegacy() { - return (this.type === 0); - } - /** - * Returns true if this transaction is berlin hardform transaction (i.e. - * ``type === 1``). - * - * This provides a Type Guard that the related properties are - * non-null. - */ - isBerlin() { - return (this.type === 1); - } - /** - * Returns true if this transaction is london hardform transaction (i.e. - * ``type === 2``). - * - * This provides a Type Guard that the related properties are - * non-null. - */ - isLondon() { - return (this.type === 2); - } - /** - * Returns true if this transaction is an [[link-eip-4844]] BLOB - * transaction. - * - * This provides a Type Guard that the related properties are - * non-null. - */ - isCancun() { - return (this.type === 3); - } - /** - * Create a copy of this transaciton. - */ - clone() { - return Transaction.from(this); - } - /** - * Return a JSON-friendly object. - */ - toJSON() { - const s = (v) => { - if (v == null) { - return null; - } - return v.toString(); - }; - return { - type: this.type, - to: this.to, - // from: this.from, - data: this.data, - nonce: this.nonce, - gasLimit: s(this.gasLimit), - gasPrice: s(this.gasPrice), - maxPriorityFeePerGas: s(this.maxPriorityFeePerGas), - maxFeePerGas: s(this.maxFeePerGas), - value: s(this.value), - chainId: s(this.chainId), - sig: this.signature ? this.signature.toJSON() : null, - accessList: this.accessList - }; - } - [inspect]() { - return this.toString(); - } - toString() { - const output = []; - const add = (key) => { - let value = this[key]; - if (typeof (value) === "string") { - value = JSON.stringify(value); - } - output.push(`${key}: ${value}`); - }; - if (this.type) { - add("type"); - } - add("to"); - add("data"); - add("nonce"); - add("gasLimit"); - add("value"); - if (this.chainId != null) { - add("chainId"); - } - if (this.signature) { - add("from"); - output.push(`signature: ${this.signature.toString()}`); - } - // @TODO: accessList - // @TODO: blobs (might make output huge; maybe just include a flag?) - const auths = this.authorizationList; - if (auths) { - const outputAuths = []; - for (const auth of auths) { - const o = []; - o.push(`address: ${JSON.stringify(auth.address)}`); - if (auth.nonce != null) { - o.push(`nonce: ${auth.nonce}`); - } - if (auth.chainId != null) { - o.push(`chainId: ${auth.chainId}`); - } - if (auth.signature) { - o.push(`signature: ${auth.signature.toString()}`); - } - outputAuths.push(`Authorization { ${o.join(", ")} }`); - } - output.push(`authorizations: [ ${outputAuths.join(", ")} ]`); - } - return `Transaction { ${output.join(", ")} }`; - } - /** - * Create a **Transaction** from a serialized transaction or a - * Transaction-like object. - */ - static from(tx) { - if (tx == null) { - return new Transaction(); - } - if (typeof (tx) === "string") { - const payload = getBytes(tx); - if (payload[0] >= 0x7f) { // @TODO: > vs >= ?? - return Transaction.from(_parseLegacy(payload)); - } - switch (payload[0]) { - case 1: return Transaction.from(_parseEip2930(payload)); - case 2: return Transaction.from(_parseEip1559(payload)); - case 3: return Transaction.from(_parseEip4844(payload)); - case 4: return Transaction.from(_parseEip7702(payload)); - } - assert(false, "unsupported transaction type", "UNSUPPORTED_OPERATION", { operation: "from" }); - } - const result = new Transaction(); - if (tx.type != null) { - result.type = tx.type; - } - if (tx.to != null) { - result.to = tx.to; - } - if (tx.nonce != null) { - result.nonce = tx.nonce; - } - if (tx.gasLimit != null) { - result.gasLimit = tx.gasLimit; - } - if (tx.gasPrice != null) { - result.gasPrice = tx.gasPrice; - } - if (tx.maxPriorityFeePerGas != null) { - result.maxPriorityFeePerGas = tx.maxPriorityFeePerGas; - } - if (tx.maxFeePerGas != null) { - result.maxFeePerGas = tx.maxFeePerGas; - } - if (tx.maxFeePerBlobGas != null) { - result.maxFeePerBlobGas = tx.maxFeePerBlobGas; - } - if (tx.data != null) { - result.data = tx.data; - } - if (tx.value != null) { - result.value = tx.value; - } - if (tx.chainId != null) { - result.chainId = tx.chainId; - } - if (tx.signature != null) { - result.signature = Signature.from(tx.signature); - } - if (tx.accessList != null) { - result.accessList = tx.accessList; - } - if (tx.authorizationList != null) { - result.authorizationList = tx.authorizationList; - } - // This will get overwritten by blobs, if present - if (tx.blobVersionedHashes != null) { - result.blobVersionedHashes = tx.blobVersionedHashes; - } - // Make sure we assign the kzg before assigning blobs, which - // require the library in the event raw blob data is provided. - if (tx.kzg != null) { - result.kzg = tx.kzg; - } - if (tx.blobWrapperVersion != null) { - result.blobWrapperVersion = tx.blobWrapperVersion; - } - if (tx.blobs != null) { - result.blobs = tx.blobs; - } - if (tx.hash != null) { - assertArgument(result.isSigned(), "unsigned transaction cannot define '.hash'", "tx", tx); - assertArgument(result.hash === tx.hash, "hash mismatch", "tx", tx); - } - if (tx.from != null) { - assertArgument(result.isSigned(), "unsigned transaction cannot define '.from'", "tx", tx); - assertArgument(result.from.toLowerCase() === (tx.from || "").toLowerCase(), "from mismatch", "tx", tx); - } - return result; - } - } - - /** - * Computes the [[link-eip-7702]] authorization digest to sign. - */ - function hashAuthorization(auth) { - assertArgument(typeof (auth.address) === "string", "invalid address for hashAuthorization", "auth.address", auth); - return keccak256(concat([ - "0x05", encodeRlp([ - (auth.chainId != null) ? toBeArray(auth.chainId) : "0x", - getAddress(auth.address), - (auth.nonce != null) ? toBeArray(auth.nonce) : "0x", - ]) - ])); - } - /** - * Return the address of the private key that produced - * the signature %%sig%% during signing for %%message%%. - */ - function verifyAuthorization(auth, sig) { - return recoverAddress(hashAuthorization(auth), sig); - } - - /** - * A simple hashing function which operates on UTF-8 strings to - * compute an 32-byte identifier. - * - * This simply computes the [UTF-8 bytes](toUtf8Bytes) and computes - * the [[keccak256]]. - * - * @example: - * id("hello world") - * //_result: - */ - function id(value) { - return keccak256(toUtf8Bytes(value)); - } - - // created 2023-09-25T01:01:55.148Z - // compressed base64-encoded blob for include-ens data - // source: https://github.com/adraffy/ens-normalize.js/blob/main/src/make.js - // see: https://github.com/adraffy/ens-normalize.js#security - // SHA-256: 0565ed049b9cf1614bb9e11ba7d8ac6a6fb96c893253d890f7e2b2884b9ded32 - var COMPRESSED$1 = 'AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNH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UpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI'; - const FENCED = new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]); - const NSM_MAX = 4; - - function decode_arithmetic(bytes) { - let pos = 0; - function u16() { return (bytes[pos++] << 8) | bytes[pos++]; } - - // decode the frequency table - let symbol_count = u16(); - let total = 1; - let acc = [0, 1]; // first symbol has frequency 1 - for (let i = 1; i < symbol_count; i++) { - acc.push(total += u16()); - } - - // skip the sized-payload that the last 3 symbols index into - let skip = u16(); - let pos_payload = pos; - pos += skip; - - let read_width = 0; - let read_buffer = 0; - function read_bit() { - if (read_width == 0) { - // this will read beyond end of buffer - // but (undefined|0) => zero pad - read_buffer = (read_buffer << 8) | bytes[pos++]; - read_width = 8; - } - return (read_buffer >> --read_width) & 1; - } - - const N = 31; - const FULL = 2**N; - const HALF = FULL >>> 1; - const QRTR = HALF >> 1; - const MASK = FULL - 1; - - // fill register - let register = 0; - for (let i = 0; i < N; i++) register = (register << 1) | read_bit(); - - let symbols = []; - let low = 0; - let range = FULL; // treat like a float - while (true) { - let value = Math.floor((((register - low + 1) * total) - 1) / range); - let start = 0; - let end = symbol_count; - while (end - start > 1) { // binary search - let mid = (start + end) >>> 1; - if (value < acc[mid]) { - end = mid; - } else { - start = mid; - } - } - if (start == 0) break; // first symbol is end mark - symbols.push(start); - let a = low + Math.floor(range * acc[start] / total); - let b = low + Math.floor(range * acc[start+1] / total) - 1; - while (((a ^ b) & HALF) == 0) { - register = (register << 1) & MASK | read_bit(); - a = (a << 1) & MASK; - b = (b << 1) & MASK | 1; - } - while (a & ~b & QRTR) { - register = (register & HALF) | ((register << 1) & (MASK >>> 1)) | read_bit(); - a = (a << 1) ^ HALF; - b = ((b ^ HALF) << 1) | HALF | 1; - } - low = a; - range = 1 + b - a; - } - let offset = symbol_count - 4; - return symbols.map(x => { // index into payload - switch (x - offset) { - case 3: return offset + 0x10100 + ((bytes[pos_payload++] << 16) | (bytes[pos_payload++] << 8) | bytes[pos_payload++]); - case 2: return offset + 0x100 + ((bytes[pos_payload++] << 8) | bytes[pos_payload++]); - case 1: return offset + bytes[pos_payload++]; - default: return x - 1; - } - }); - } - - // returns an iterator which returns the next symbol - function read_payload(v) { - let pos = 0; - return () => v[pos++]; - } - function read_compressed_payload(s) { - return read_payload(decode_arithmetic(unsafe_atob(s))); - } - - // unsafe in the sense: - // expected well-formed Base64 w/o padding - // 20220922: added for https://github.com/adraffy/ens-normalize.js/issues/4 - function unsafe_atob(s) { - let lookup = []; - [...'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'].forEach((c, i) => lookup[c.charCodeAt(0)] = i); - let n = s.length; - let ret = new Uint8Array((6 * n) >> 3); - for (let i = 0, pos = 0, width = 0, carry = 0; i < n; i++) { - carry = (carry << 6) | lookup[s.charCodeAt(i)]; - width += 6; - if (width >= 8) { - ret[pos++] = (carry >> (width -= 8)); - } - } - return ret; - } - - // eg. [0,1,2,3...] => [0,-1,1,-2,...] - function signed(i) { - return (i & 1) ? (~i >> 1) : (i >> 1); - } - - function read_deltas(n, next) { - let v = Array(n); - for (let i = 0, x = 0; i < n; i++) v[i] = x += signed(next()); - return v; - } - - // [123][5] => [0 3] [1 1] [0 0] - function read_sorted(next, prev = 0) { - let ret = []; - while (true) { - let x = next(); - let n = next(); - if (!n) break; - prev += x; - for (let i = 0; i < n; i++) { - ret.push(prev + i); - } - prev += n + 1; - } - return ret; - } - - function read_sorted_arrays(next) { - return read_array_while(() => { - let v = read_sorted(next); - if (v.length) return v; - }); - } - - // returns map of x => ys - function read_mapped(next) { - let ret = []; - while (true) { - let w = next(); - if (w == 0) break; - ret.push(read_linear_table(w, next)); - } - while (true) { - let w = next() - 1; - if (w < 0) break; - ret.push(read_replacement_table(w, next)); - } - return ret.flat(); - } - - // read until next is falsy - // return array of read values - function read_array_while(next) { - let v = []; - while (true) { - let x = next(v.length); - if (!x) break; - v.push(x); - } - return v; - } - - // read w columns of length n - // return as n rows of length w - function read_transposed(n, w, next) { - let m = Array(n).fill().map(() => []); - for (let i = 0; i < w; i++) { - read_deltas(n, next).forEach((x, j) => m[j].push(x)); - } - return m; - } - - // returns [[x, ys], [x+dx, ys+dy], [x+2*dx, ys+2*dy], ...] - // where dx/dy = steps, n = run size, w = length of y - function read_linear_table(w, next) { - let dx = 1 + next(); - let dy = next(); - let vN = read_array_while(next); - let m = read_transposed(vN.length, 1+w, next); - return m.flatMap((v, i) => { - let [x, ...ys] = v; - return Array(vN[i]).fill().map((_, j) => { - let j_dy = j * dy; - return [x + j * dx, ys.map(y => y + j_dy)]; - }); - }); - } - - // return [[x, ys...], ...] - // where w = length of y - function read_replacement_table(w, next) { - let n = 1 + next(); - let m = read_transposed(n, 1+w, next); - return m.map(v => [v[0], v.slice(1)]); - } - - - function read_trie(next) { - let ret = []; - let sorted = read_sorted(next); - expand(decode([]), []); - return ret; // not sorted - function decode(Q) { // characters that lead into this node - let S = next(); // state: valid, save, check - let B = read_array_while(() => { // buckets leading to new nodes - let cps = read_sorted(next).map(i => sorted[i]); - if (cps.length) return decode(cps); - }); - return {S, B, Q}; - } - function expand({S, B}, cps, saved) { - if (S & 4 && saved === cps[cps.length-1]) return; - if (S & 2) saved = cps[cps.length-1]; - if (S & 1) ret.push(cps); - for (let br of B) { - for (let cp of br.Q) { - expand(br, [...cps, cp], saved); - } - } - } - } - - function hex_cp(cp) { - return cp.toString(16).toUpperCase().padStart(2, '0'); - } - - function quote_cp(cp) { - return `{${hex_cp(cp)}}`; // raffy convention: like "\u{X}" w/o the "\u" - } - - /* - export function explode_cp(s) { - return [...s].map(c => c.codePointAt(0)); - } - */ - function explode_cp(s) { // this is about 2x faster - let cps = []; - for (let pos = 0, len = s.length; pos < len; ) { - let cp = s.codePointAt(pos); - pos += cp < 0x10000 ? 1 : 2; - cps.push(cp); - } - return cps; - } - - function str_from_cps(cps) { - const chunk = 4096; - let len = cps.length; - if (len < chunk) return String.fromCodePoint(...cps); - let buf = []; - for (let i = 0; i < len; ) { - buf.push(String.fromCodePoint(...cps.slice(i, i += chunk))); - } - return buf.join(''); - } - - function compare_arrays(a, b) { - let n = a.length; - let c = n - b.length; - for (let i = 0; c == 0 && i < n; i++) c = a[i] - b[i]; - return c; - } - - // created 2023-09-25T01:01:55.148Z - // compressed base64-encoded blob for include-nf data - // source: https://github.com/adraffy/ens-normalize.js/blob/main/src/make.js - // see: https://github.com/adraffy/ens-normalize.js#security - // SHA-256: a974b6f8541fc29d919bc85118af0a44015851fab5343f8679cb31be2bdb209e - var COMPRESSED = 'AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26PTQyy8FfEQ8AY8IPAGcEbwRwBHEEcg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bBV7y86sGSQ/vZzU8FXs7u6jIvwchsEP2BpIhW3G8uWNwa3HmjfH/ZjhhCWvluAcF+nMf14ClKg5hGgtPLJ98ueNAkc5Hs2WZlk2QHvfreCK1CCGO6nMZVSb99VM/ajr8WHTte9JSmkXq/i/U943HEbdzW6Re/S88dKgg8pGOLlAeNiqrcLkUR3/aClFpMXcOUP3rmETcWSfMXZE3TUOi8i+fqRnTYLflVx/Vb/6GJ7eIRZUA6k3RYR3iFSK9c4iDdNwJuZL2FKz/IK5VimcNWEqdXjSoxSgmF0UPlDoUlNrPcM7ftmA8Y9gKiqKEHuWN+AZRIwtVSxye2Kf8rM3lhJ5XcBXU9n4v0Oy1RU2M+4qM8AQPVwse8ErNSob5oFPWxuqZnVzo1qB/IBxkM3EVUKFUUlO3e51259GgNcJbCmlvrdjtoTW7rChm1wyCKzpCTwozUUEOIcWLneRLgMXh+SjGSFkAllzbGS5HK7LlfCMRNRDSvbQPjcXaenNYxCvu2Qyznz6StuxVj66SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g'; - - // https://unicode.org/reports/tr15/ - // for reference implementation - // see: /derive/nf.js - - - // algorithmic hangul - // https://www.unicode.org/versions/Unicode15.0.0/ch03.pdf (page 144) - const S0 = 0xAC00; - const L0 = 0x1100; - const V0 = 0x1161; - const T0 = 0x11A7; - const L_COUNT = 19; - const V_COUNT = 21; - const T_COUNT = 28; - const N_COUNT = V_COUNT * T_COUNT; - const S_COUNT = L_COUNT * N_COUNT; - const S1 = S0 + S_COUNT; - const L1 = L0 + L_COUNT; - const V1 = V0 + V_COUNT; - const T1$1 = T0 + T_COUNT; - - function unpack_cc(packed) { - return (packed >> 24) & 0xFF; - } - function unpack_cp(packed) { - return packed & 0xFFFFFF; - } - - let SHIFTED_RANK, EXCLUSIONS, DECOMP, RECOMP; - - function init$1() { - //console.time('nf'); - let r = read_compressed_payload(COMPRESSED); - SHIFTED_RANK = new Map(read_sorted_arrays(r).flatMap((v, i) => v.map(x => [x, (i+1) << 24]))); // pre-shifted - EXCLUSIONS = new Set(read_sorted(r)); - DECOMP = new Map(); - RECOMP = new Map(); - for (let [cp, cps] of read_mapped(r)) { - if (!EXCLUSIONS.has(cp) && cps.length == 2) { - let [a, b] = cps; - let bucket = RECOMP.get(a); - if (!bucket) { - bucket = new Map(); - RECOMP.set(a, bucket); - } - bucket.set(b, cp); - } - DECOMP.set(cp, cps.reverse()); // stored reversed - } - //console.timeEnd('nf'); - // 20230905: 11ms - } - - function is_hangul(cp) { - return cp >= S0 && cp < S1; - } - - function compose_pair(a, b) { - if (a >= L0 && a < L1 && b >= V0 && b < V1) { - return S0 + (a - L0) * N_COUNT + (b - V0) * T_COUNT; - } else if (is_hangul(a) && b > T0 && b < T1$1 && (a - S0) % T_COUNT == 0) { - return a + (b - T0); - } else { - let recomp = RECOMP.get(a); - if (recomp) { - recomp = recomp.get(b); - if (recomp) { - return recomp; - } - } - return -1; - } - } - - function decomposed(cps) { - if (!SHIFTED_RANK) init$1(); - let ret = []; - let buf = []; - let check_order = false; - function add(cp) { - let cc = SHIFTED_RANK.get(cp); - if (cc) { - check_order = true; - cp |= cc; - } - ret.push(cp); - } - for (let cp of cps) { - while (true) { - if (cp < 0x80) { - ret.push(cp); - } else if (is_hangul(cp)) { - let s_index = cp - S0; - let l_index = s_index / N_COUNT | 0; - let v_index = (s_index % N_COUNT) / T_COUNT | 0; - let t_index = s_index % T_COUNT; - add(L0 + l_index); - add(V0 + v_index); - if (t_index > 0) add(T0 + t_index); - } else { - let mapped = DECOMP.get(cp); - if (mapped) { - buf.push(...mapped); - } else { - add(cp); - } - } - if (!buf.length) break; - cp = buf.pop(); - } - } - if (check_order && ret.length > 1) { - let prev_cc = unpack_cc(ret[0]); - for (let i = 1; i < ret.length; i++) { - let cc = unpack_cc(ret[i]); - if (cc == 0 || prev_cc <= cc) { - prev_cc = cc; - continue; - } - let j = i-1; - while (true) { - let tmp = ret[j+1]; - ret[j+1] = ret[j]; - ret[j] = tmp; - if (!j) break; - prev_cc = unpack_cc(ret[--j]); - if (prev_cc <= cc) break; - } - prev_cc = unpack_cc(ret[i]); - } - } - return ret; - } - - function composed_from_decomposed(v) { - let ret = []; - let stack = []; - let prev_cp = -1; - let prev_cc = 0; - for (let packed of v) { - let cc = unpack_cc(packed); - let cp = unpack_cp(packed); - if (prev_cp == -1) { - if (cc == 0) { - prev_cp = cp; - } else { - ret.push(cp); - } - } else if (prev_cc > 0 && prev_cc >= cc) { - if (cc == 0) { - ret.push(prev_cp, ...stack); - stack.length = 0; - prev_cp = cp; - } else { - stack.push(cp); - } - prev_cc = cc; - } else { - let composed = compose_pair(prev_cp, cp); - if (composed >= 0) { - prev_cp = composed; - } else if (prev_cc == 0 && cc == 0) { - ret.push(prev_cp); - prev_cp = cp; - } else { - stack.push(cp); - prev_cc = cc; - } - } - } - if (prev_cp >= 0) { - ret.push(prev_cp, ...stack); - } - return ret; - } - - // note: cps can be iterable - function nfd(cps) { - return decomposed(cps).map(unpack_cp); - } - function nfc(cps) { - return composed_from_decomposed(decomposed(cps)); - } - - const HYPHEN = 0x2D; - const STOP_CH = '.'; - const FE0F = 0xFE0F; - const UNIQUE_PH = 1; - - // 20230913: replace [...v] with Array_from(v) to avoid large spreads - const Array_from = x => Array.from(x); // Array.from.bind(Array); - - function group_has_cp(g, cp) { - // 20230913: keep primary and secondary distinct instead of creating valid union - return g.P.has(cp) || g.Q.has(cp); - } - - class Emoji extends Array { - get is_emoji() { return true; } // free tagging system - } - - let MAPPED, IGNORED, CM, NSM, ESCAPE, GROUPS, WHOLE_VALID, WHOLE_MAP, VALID, EMOJI_LIST, EMOJI_ROOT; - - function init() { - if (MAPPED) return; - - let r = read_compressed_payload(COMPRESSED$1); - const read_sorted_array = () => read_sorted(r); - const read_sorted_set = () => new Set(read_sorted_array()); - const set_add_many = (set, v) => v.forEach(x => set.add(x)); - - MAPPED = new Map(read_mapped(r)); - IGNORED = read_sorted_set(); // ignored characters are not valid, so just read raw codepoints - - /* - // direct include from payload is smaller than the decompression code - const FENCED = new Map(read_array_while(() => { - let cp = r(); - if (cp) return [cp, read_str(r())]; - })); - */ - // 20230217: we still need all CM for proper error formatting - // but norm only needs NSM subset that are potentially-valid - CM = read_sorted_array(); - NSM = new Set(read_sorted_array().map(i => CM[i])); - CM = new Set(CM); - - ESCAPE = read_sorted_set(); // characters that should not be printed - read_sorted_set(); // only needed to illustrate ens_tokenize() transformations - - let chunks = read_sorted_arrays(r); - let unrestricted = r(); - //const read_chunked = () => new Set(read_sorted_array().flatMap(i => chunks[i]).concat(read_sorted_array())); - const read_chunked = () => { - // 20230921: build set in parts, 2x faster - let set = new Set(); - read_sorted_array().forEach(i => set_add_many(set, chunks[i])); - set_add_many(set, read_sorted_array()); - return set; - }; - GROUPS = read_array_while(i => { - // minifier property mangling seems unsafe - // so these are manually renamed to single chars - let N = read_array_while(r).map(x => x+0x60); - if (N.length) { - let R = i >= unrestricted; // unrestricted then restricted - N[0] -= 32; // capitalize - N = str_from_cps(N); - if (R) N=`Restricted[${N}]`; - let P = read_chunked(); // primary - let Q = read_chunked(); // secondary - let M = !r(); // not-whitelisted, check for NSM - // *** this code currently isn't needed *** - /* - let V = [...P, ...Q].sort((a, b) => a-b); // derive: sorted valid - let M = r()-1; // number of combining mark - if (M < 0) { // whitelisted - M = new Map(read_array_while(() => { - let i = r(); - if (i) return [V[i-1], read_array_while(() => { - let v = read_array_while(r); - if (v.length) return v.map(x => x-1); - })]; - })); - }*/ - return {N, P, Q, M, R}; - } - }); - - // decode compressed wholes - WHOLE_VALID = read_sorted_set(); - WHOLE_MAP = new Map(); - let wholes = read_sorted_array().concat(Array_from(WHOLE_VALID)).sort((a, b) => a-b); // must be sorted - wholes.forEach((cp, i) => { - let d = r(); - let w = wholes[i] = d ? wholes[i-d] : {V: [], M: new Map()}; - w.V.push(cp); // add to member set - if (!WHOLE_VALID.has(cp)) { - WHOLE_MAP.set(cp, w); // register with whole map - } - }); - - // compute confusable-extent complements - // usage: WHOLE_MAP.get(cp).M.get(cp) = complement set - for (let {V, M} of new Set(WHOLE_MAP.values())) { - // connect all groups that have each whole character - let recs = []; - for (let cp of V) { - let gs = GROUPS.filter(g => group_has_cp(g, cp)); - let rec = recs.find(({G}) => gs.some(g => G.has(g))); - if (!rec) { - rec = {G: new Set(), V: []}; - recs.push(rec); - } - rec.V.push(cp); - set_add_many(rec.G, gs); - } - // per character cache groups which are not a member of the extent - let union = recs.flatMap(x => Array_from(x.G)); // all of the groups used by this whole - for (let {G, V} of recs) { - let complement = new Set(union.filter(g => !G.has(g))); // groups not covered by the extent - for (let cp of V) { - M.set(cp, complement); // this is the same reference - } - } - } - - // compute valid set - // 20230924: VALID was union but can be re-used - VALID = new Set(); // exists in 1+ groups - let multi = new Set(); // exists in 2+ groups - const add_to_union = cp => VALID.has(cp) ? multi.add(cp) : VALID.add(cp); - for (let g of GROUPS) { - for (let cp of g.P) add_to_union(cp); - for (let cp of g.Q) add_to_union(cp); - } - // dual purpose WHOLE_MAP: return placeholder if unique non-confusable - for (let cp of VALID) { - if (!WHOLE_MAP.has(cp) && !multi.has(cp)) { - WHOLE_MAP.set(cp, UNIQUE_PH); - } - } - // add all decomposed parts - // see derive: "Valid is Closed (via Brute-force)" - set_add_many(VALID, nfd(VALID)); - - // decode emoji - // 20230719: emoji are now fully-expanded to avoid quirk logic - EMOJI_LIST = read_trie(r).map(v => Emoji.from(v)).sort(compare_arrays); - EMOJI_ROOT = new Map(); // this has approx 7K nodes (2+ per emoji) - for (let cps of EMOJI_LIST) { - // 20230719: change to *slightly* stricter algorithm which disallows - // insertion of misplaced FE0F in emoji sequences (matching ENSIP-15) - // example: beautified [A B] (eg. flag emoji) - // before: allow: [A FE0F B], error: [A FE0F FE0F B] - // after: error: both - // note: this code now matches ENSNormalize.{cs,java} logic - let prev = [EMOJI_ROOT]; - for (let cp of cps) { - let next = prev.map(node => { - let child = node.get(cp); - if (!child) { - // should this be object? - // (most have 1-2 items, few have many) - // 20230719: no, v8 default map is 4? - child = new Map(); - node.set(cp, child); - } - return child; - }); - if (cp === FE0F) { - prev.push(...next); // less than 20 elements - } else { - prev = next; - } - } - for (let x of prev) { - x.V = cps; - } - } - } - - // if escaped: {HEX} - // else: "x" {HEX} - function quoted_cp(cp) { - return (should_escape(cp) ? '' : `${bidi_qq(safe_str_from_cps([cp]))} `) + quote_cp(cp); - } - - // 20230211: some messages can be mixed-directional and result in spillover - // use 200E after a quoted string to force the remainder of a string from - // acquring the direction of the quote - // https://www.w3.org/International/questions/qa-bidi-unicode-controls#exceptions - function bidi_qq(s) { - return `"${s}"\u200E`; // strong LTR - } - - function check_label_extension(cps) { - if (cps.length >= 4 && cps[2] == HYPHEN && cps[3] == HYPHEN) { - throw new Error(`invalid label extension: "${str_from_cps(cps.slice(0, 4))}"`); // this can only be ascii so cant be bidi - } - } - function check_leading_underscore(cps) { - const UNDERSCORE = 0x5F; - for (let i = cps.lastIndexOf(UNDERSCORE); i > 0; ) { - if (cps[--i] !== UNDERSCORE) { - throw new Error('underscore allowed only at start'); - } - } - } - // check that a fenced cp is not leading, trailing, or touching another fenced cp - function check_fenced(cps) { - let cp = cps[0]; - let prev = FENCED.get(cp); - if (prev) throw error_placement(`leading ${prev}`); - let n = cps.length; - let last = -1; // prevents trailing from throwing - for (let i = 1; i < n; i++) { - cp = cps[i]; - let match = FENCED.get(cp); - if (match) { - // since cps[0] isn't fenced, cps[1] cannot throw - if (last == i) throw error_placement(`${prev} + ${match}`); - last = i + 1; - prev = match; - } - } - if (last == n) throw error_placement(`trailing ${prev}`); - } - - // create a safe to print string - // invisibles are escaped - // leading cm uses placeholder - // if cps exceed max, middle truncate with ellipsis - // quoter(cp) => string, eg. 3000 => "{3000}" - // note: in html, you'd call this function then replace [<>&] with entities - function safe_str_from_cps(cps, max = Infinity, quoter = quote_cp) { - //if (Number.isInteger(cps)) cps = [cps]; - //if (!Array.isArray(cps)) throw new TypeError(`expected codepoints`); - let buf = []; - if (is_combining_mark(cps[0])) buf.push('◌'); - if (cps.length > max) { - max >>= 1; - cps = [...cps.slice(0, max), 0x2026, ...cps.slice(-max)]; - } - let prev = 0; - let n = cps.length; - for (let i = 0; i < n; i++) { - let cp = cps[i]; - if (should_escape(cp)) { - buf.push(str_from_cps(cps.slice(prev, i))); - buf.push(quoter(cp)); - prev = i + 1; - } - } - buf.push(str_from_cps(cps.slice(prev, n))); - return buf.join(''); - } - - // note: set(s) cannot be exposed because they can be modified - // note: Object.freeze() doesn't work - function is_combining_mark(cp) { - init(); - return CM.has(cp); - } - function should_escape(cp) { - init(); - return ESCAPE.has(cp); - } - - function ens_normalize(name) { - return flatten(split(name, nfc, filter_fe0f)); - } - - function split(name, nf, ef) { - if (!name) return []; // 20230719: empty name allowance - init(); - let offset = 0; - // https://unicode.org/reports/tr46/#Validity_Criteria - // 4.) "The label must not contain a U+002E ( . ) FULL STOP." - return name.split(STOP_CH).map(label => { - let input = explode_cp(label); - let info = { - input, - offset, // codepoint, not substring! - }; - offset += input.length + 1; // + stop - try { - // 1.) "The label must be in Unicode Normalization Form NFC" - let tokens = info.tokens = tokens_from_str(input, nf, ef); - let token_count = tokens.length; - let type; - if (!token_count) { // the label was effectively empty (could of had ignored characters) - //norm = []; - //type = 'None'; // use this instead of next match, "ASCII" - // 20230120: change to strict - // https://discuss.ens.domains/t/ens-name-normalization-2nd/14564/59 - throw new Error(`empty label`); - } - let norm = info.output = tokens.flat(); - check_leading_underscore(norm); - let emoji = info.emoji = token_count > 1 || tokens[0].is_emoji; // same as: tokens.some(x => x.is_emoji); - if (!emoji && norm.every(cp => cp < 0x80)) { // special case for ascii - // 20230123: matches matches WHATWG, see note 3.3 - check_label_extension(norm); // only needed for ascii - // cant have fenced - // cant have cm - // cant have wholes - // see derive: "Fastpath ASCII" - type = 'ASCII'; - } else { - let chars = tokens.flatMap(x => x.is_emoji ? [] : x); // all of the nfc tokens concat together - if (!chars.length) { // theres no text, just emoji - type = 'Emoji'; - } else { - // 5.) "The label must not begin with a combining mark, that is: General_Category=Mark." - if (CM.has(norm[0])) throw error_placement('leading combining mark'); - for (let i = 1; i < token_count; i++) { // we've already checked the first token - let cps = tokens[i]; - if (!cps.is_emoji && CM.has(cps[0])) { // every text token has emoji neighbors, eg. EtEEEtEt... - // bidi_qq() not needed since emoji is LTR and cps is a CM - throw error_placement(`emoji + combining mark: "${str_from_cps(tokens[i-1])} + ${safe_str_from_cps([cps[0]])}"`); - } - } - check_fenced(norm); - let unique = Array_from(new Set(chars)); - let [g] = determine_group(unique); // take the first match - // see derive: "Matching Groups have Same CM Style" - // alternative: could form a hybrid type: Latin/Japanese/... - check_group(g, chars); // need text in order - check_whole(g, unique); // only need unique text (order would be required for multiple-char confusables) - type = g.N; - // 20230121: consider exposing restricted flag - // it's simpler to just check for 'Restricted' - // or even better: type.endsWith(']') - //if (g.R) info.restricted = true; - } - } - info.type = type; - } catch (err) { - info.error = err; // use full error object - } - return info; - }); - } - - function check_whole(group, unique) { - let maker; - let shared = []; - for (let cp of unique) { - let whole = WHOLE_MAP.get(cp); - if (whole === UNIQUE_PH) return; // unique, non-confusable - if (whole) { - let set = whole.M.get(cp); // groups which have a character that look-like this character - maker = maker ? maker.filter(g => set.has(g)) : Array_from(set); - if (!maker.length) return; // confusable intersection is empty - } else { - shared.push(cp); - } - } - if (maker) { - // we have 1+ confusable - // check if any of the remaining groups - // contain the shared characters too - for (let g of maker) { - if (shared.every(cp => group_has_cp(g, cp))) { - throw new Error(`whole-script confusable: ${group.N}/${g.N}`); - } - } - } - } - - // assumption: unique.size > 0 - // returns list of matching groups - function determine_group(unique) { - let groups = GROUPS; - for (let cp of unique) { - // note: we need to dodge CM that are whitelisted - // but that code isn't currently necessary - let gs = groups.filter(g => group_has_cp(g, cp)); - if (!gs.length) { - if (!GROUPS.some(g => group_has_cp(g, cp))) { - // the character was composed of valid parts - // but it's NFC form is invalid - // 20230716: change to more exact statement, see: ENSNormalize.{cs,java} - // note: this doesn't have to be a composition - // 20230720: change to full check - throw error_disallowed(cp); // this should be rare - } else { - // there is no group that contains all these characters - // throw using the highest priority group that matched - // https://www.unicode.org/reports/tr39/#mixed_script_confusables - throw error_group_member(groups[0], cp); - } - } - groups = gs; - if (gs.length == 1) break; // there is only one group left - } - // there are at least 1 group(s) with all of these characters - return groups; - } - - // throw on first error - function flatten(split) { - return split.map(({input, error, output}) => { - if (error) { - // don't print label again if just a single label - let msg = error.message; - // bidi_qq() only necessary if msg is digits - throw new Error(split.length == 1 ? msg : `Invalid label ${bidi_qq(safe_str_from_cps(input, 63))}: ${msg}`); - } - return str_from_cps(output); - }).join(STOP_CH); - } - - function error_disallowed(cp) { - // TODO: add cp to error? - return new Error(`disallowed character: ${quoted_cp(cp)}`); - } - function error_group_member(g, cp) { - let quoted = quoted_cp(cp); - let gg = GROUPS.find(g => g.P.has(cp)); // only check primary - if (gg) { - quoted = `${gg.N} ${quoted}`; - } - return new Error(`illegal mixture: ${g.N} + ${quoted}`); - } - function error_placement(where) { - return new Error(`illegal placement: ${where}`); - } - - // assumption: cps.length > 0 - // assumption: cps[0] isn't a CM - // assumption: the previous character isn't an emoji - function check_group(g, cps) { - for (let cp of cps) { - if (!group_has_cp(g, cp)) { - // for whitelisted scripts, this will throw illegal mixture on invalid cm, eg. "e{300}{300}" - // at the moment, it's unnecessary to introduce an extra error type - // until there exists a whitelisted multi-character - // eg. if (M < 0 && is_combining_mark(cp)) { ... } - // there are 3 cases: - // 1. illegal cm for wrong group => mixture error - // 2. illegal cm for same group => cm error - // requires set of whitelist cm per group: - // eg. new Set([...g.P, ...g.Q].flatMap(nfc).filter(cp => CM.has(cp))) - // 3. wrong group => mixture error - throw error_group_member(g, cp); - } - } - //if (M >= 0) { // we have a known fixed cm count - if (g.M) { // we need to check for NSM - let decomposed = nfd(cps); - for (let i = 1, e = decomposed.length; i < e; i++) { // see: assumption - // 20230210: bugfix: using cps instead of decomposed h/t Carbon225 - /* - if (CM.has(decomposed[i])) { - let j = i + 1; - while (j < e && CM.has(decomposed[j])) j++; - if (j - i > M) { - throw new Error(`too many combining marks: ${g.N} ${bidi_qq(str_from_cps(decomposed.slice(i-1, j)))} (${j-i}/${M})`); - } - i = j; - } - */ - // 20230217: switch to NSM counting - // https://www.unicode.org/reports/tr39/#Optional_Detection - if (NSM.has(decomposed[i])) { - let j = i + 1; - for (let cp; j < e && NSM.has(cp = decomposed[j]); j++) { - // a. Forbid sequences of the same nonspacing mark. - for (let k = i; k < j; k++) { // O(n^2) but n < 100 - if (decomposed[k] == cp) { - throw new Error(`duplicate non-spacing marks: ${quoted_cp(cp)}`); - } - } - } - // parse to end so we have full nsm count - // b. Forbid sequences of more than 4 nonspacing marks (gc=Mn or gc=Me). - if (j - i > NSM_MAX) { - // note: this slice starts with a base char or spacing-mark cm - throw new Error(`excessive non-spacing marks: ${bidi_qq(safe_str_from_cps(decomposed.slice(i-1, j)))} (${j-i}/${NSM_MAX})`); - } - i = j; - } - } - } - // *** this code currently isn't needed *** - /* - let cm_whitelist = M instanceof Map; - for (let i = 0, e = cps.length; i < e; ) { - let cp = cps[i++]; - let seqs = cm_whitelist && M.get(cp); - if (seqs) { - // list of codepoints that can follow - // if this exists, this will always be 1+ - let j = i; - while (j < e && CM.has(cps[j])) j++; - let cms = cps.slice(i, j); - let match = seqs.find(seq => !compare_arrays(seq, cms)); - if (!match) throw new Error(`disallowed combining mark sequence: "${safe_str_from_cps([cp, ...cms])}"`); - i = j; - } else if (!V.has(cp)) { - // https://www.unicode.org/reports/tr39/#mixed_script_confusables - let quoted = quoted_cp(cp); - for (let cp of cps) { - let u = UNIQUE.get(cp); - if (u && u !== g) { - // if both scripts are restricted this error is confusing - // because we don't differentiate RestrictedA from RestrictedB - if (!u.R) quoted = `${quoted} is ${u.N}`; - break; - } - } - throw new Error(`disallowed ${g.N} character: ${quoted}`); - //throw new Error(`disallowed character: ${quoted} (expected ${g.N})`); - //throw new Error(`${g.N} does not allow: ${quoted}`); - } - } - if (!cm_whitelist) { - let decomposed = nfd(cps); - for (let i = 1, e = decomposed.length; i < e; i++) { // we know it can't be cm leading - if (CM.has(decomposed[i])) { - let j = i + 1; - while (j < e && CM.has(decomposed[j])) j++; - if (j - i > M) { - throw new Error(`too many combining marks: "${str_from_cps(decomposed.slice(i-1, j))}" (${j-i}/${M})`); - } - i = j; - } - } - } - */ - } - - // given a list of codepoints - // returns a list of lists, where emoji are a fully-qualified (as Array subclass) - // eg. explode_cp("abc💩d") => [[61, 62, 63], Emoji[1F4A9, FE0F], [64]] - // 20230818: rename for 'process' name collision h/t Javarome - // https://github.com/adraffy/ens-normalize.js/issues/23 - function tokens_from_str(input, nf, ef) { - let ret = []; - let chars = []; - input = input.slice().reverse(); // flip so we can pop - while (input.length) { - let emoji = consume_emoji_reversed(input); - if (emoji) { - if (chars.length) { - ret.push(nf(chars)); - chars = []; - } - ret.push(ef(emoji)); - } else { - let cp = input.pop(); - if (VALID.has(cp)) { - chars.push(cp); - } else { - let cps = MAPPED.get(cp); - if (cps) { - chars.push(...cps); // less than 10 elements - } else if (!IGNORED.has(cp)) { - // 20230912: unicode 15.1 changed the order of processing such that - // disallowed parts are only rejected after NFC - // https://unicode.org/reports/tr46/#Validity_Criteria - // this doesn't impact normalization as of today - // technically, this error can be removed as the group logic will apply similar logic - // however the error type might be less clear - throw error_disallowed(cp); - } - } - } - } - if (chars.length) { - ret.push(nf(chars)); - } - return ret; - } - - function filter_fe0f(cps) { - return cps.filter(cp => cp != FE0F); - } - - // given array of codepoints - // returns the longest valid emoji sequence (or undefined if no match) - // *MUTATES* the supplied array - // disallows interleaved ignored characters - // fills (optional) eaten array with matched codepoints - function consume_emoji_reversed(cps, eaten) { - let node = EMOJI_ROOT; - let emoji; - let pos = cps.length; - while (pos) { - node = node.get(cps[--pos]); - if (!node) break; - let {V} = node; - if (V) { // this is a valid emoji (so far) - emoji = V; - cps.length = pos; // truncate - } - } - return emoji; - } - - const Zeros = new Uint8Array(32); - Zeros.fill(0); - function checkComponent(comp) { - assertArgument(comp.length !== 0, "invalid ENS name; empty component", "comp", comp); - return comp; - } - function ensNameSplit(name) { - const bytes = toUtf8Bytes(ensNormalize(name)); - const comps = []; - if (name.length === 0) { - return comps; - } - let last = 0; - for (let i = 0; i < bytes.length; i++) { - const d = bytes[i]; - // A separator (i.e. "."); copy this component - if (d === 0x2e) { - comps.push(checkComponent(bytes.slice(last, i))); - last = i + 1; - } - } - // There was a stray separator at the end of the name - assertArgument(last < bytes.length, "invalid ENS name; empty component", "name", name); - comps.push(checkComponent(bytes.slice(last))); - return comps; - } - /** - * Returns the ENS %%name%% normalized. - */ - function ensNormalize(name) { - try { - if (name.length === 0) { - throw new Error("empty label"); - } - return ens_normalize(name); - } - catch (error) { - assertArgument(false, `invalid ENS name (${error.message})`, "name", name); - } - } - /** - * Returns ``true`` if %%name%% is a valid ENS name. - */ - function isValidName(name) { - try { - return (ensNameSplit(name).length !== 0); - } - catch (error) { } - return false; - } - /** - * Returns the [[link-namehash]] for %%name%%. - */ - function namehash(name) { - assertArgument(typeof (name) === "string", "invalid ENS name; not a string", "name", name); - assertArgument(name.length, `invalid ENS name (empty label)`, "name", name); - let result = Zeros; - const comps = ensNameSplit(name); - while (comps.length) { - result = keccak256(concat([result, keccak256((comps.pop()))])); - } - return hexlify(result); - } - /** - * Returns the DNS encoded %%name%%. - * - * This is used for various parts of ENS name resolution, such - * as the wildcard resolution. - */ - function dnsEncode(name, _maxLength) { - const length = (_maxLength != null) ? _maxLength : 63; - assertArgument(length <= 255, "DNS encoded label cannot exceed 255", "length", length); - return hexlify(concat(ensNameSplit(name).map((comp) => { - assertArgument(comp.length <= length, `label ${JSON.stringify(name)} exceeds ${length} bytes`, "name", name); - const bytes = new Uint8Array(comp.length + 1); - bytes.set(comp, 1); - bytes[0] = bytes.length - 1; - return bytes; - }))) + "00"; - } - - /** - * Computes the [[link-eip-191]] personal-sign message digest to sign. - * - * This prefixes the message with [[MessagePrefix]] and the decimal length - * of %%message%% and computes the [[keccak256]] digest. - * - * If %%message%% is a string, it is converted to its UTF-8 bytes - * first. To compute the digest of a [[DataHexString]], it must be converted - * to [bytes](getBytes). - * - * @example: - * hashMessage("Hello World") - * //_result: - * - * // Hashes the SIX (6) string characters, i.e. - * // [ "0", "x", "4", "2", "4", "3" ] - * hashMessage("0x4243") - * //_result: - * - * // Hashes the TWO (2) bytes [ 0x42, 0x43 ]... - * hashMessage(getBytes("0x4243")) - * //_result: - * - * // ...which is equal to using data - * hashMessage(new Uint8Array([ 0x42, 0x43 ])) - * //_result: - * - */ - function hashMessage(message) { - if (typeof (message) === "string") { - message = toUtf8Bytes(message); - } - return keccak256(concat([ - toUtf8Bytes(MessagePrefix), - toUtf8Bytes(String(message.length)), - message - ])); - } - /** - * Return the address of the private key that produced - * the signature %%sig%% during signing for %%message%%. - */ - function verifyMessage(message, sig) { - const digest = hashMessage(message); - return recoverAddress(digest, sig); - } - - const regexBytes = new RegExp("^bytes([0-9]+)$"); - const regexNumber = new RegExp("^(u?int)([0-9]*)$"); - const regexArray = new RegExp("^(.*)\\[([0-9]*)\\]$"); - function _pack(type, value, isArray) { - switch (type) { - case "address": - if (isArray) { - return getBytes(zeroPadValue(value, 32)); - } - return getBytes(getAddress(value)); - case "string": - return toUtf8Bytes(value); - case "bytes": - return getBytes(value); - case "bool": - value = (!!value ? "0x01" : "0x00"); - if (isArray) { - return getBytes(zeroPadValue(value, 32)); - } - return getBytes(value); - } - let match = type.match(regexNumber); - if (match) { - let signed = (match[1] === "int"); - let size = parseInt(match[2] || "256"); - assertArgument((!match[2] || match[2] === String(size)) && (size % 8 === 0) && size !== 0 && size <= 256, "invalid number type", "type", type); - if (isArray) { - size = 256; - } - if (signed) { - value = toTwos(value, size); - } - return getBytes(zeroPadValue(toBeArray(value), size / 8)); - } - match = type.match(regexBytes); - if (match) { - const size = parseInt(match[1]); - assertArgument(String(size) === match[1] && size !== 0 && size <= 32, "invalid bytes type", "type", type); - assertArgument(dataLength(value) === size, `invalid value for ${type}`, "value", value); - if (isArray) { - return getBytes(zeroPadBytes(value, 32)); - } - return value; - } - match = type.match(regexArray); - if (match && Array.isArray(value)) { - const baseType = match[1]; - const count = parseInt(match[2] || String(value.length)); - assertArgument(count === value.length, `invalid array length for ${type}`, "value", value); - const result = []; - value.forEach(function (value) { - result.push(_pack(baseType, value, true)); - }); - return getBytes(concat(result)); - } - assertArgument(false, "invalid type", "type", type); - } - // @TODO: Array Enum - /** - * Computes the [[link-solc-packed]] representation of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPacked([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ - function solidityPacked(types, values) { - assertArgument(types.length === values.length, "wrong number of values; expected ${ types.length }", "values", values); - const tight = []; - types.forEach(function (type, index) { - tight.push(_pack(type, values[index])); - }); - return hexlify(concat(tight)); - } - /** - * Computes the [[link-solc-packed]] [[keccak256]] hash of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPackedKeccak256([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ - function solidityPackedKeccak256(types, values) { - return keccak256(solidityPacked(types, values)); - } - /** - * Computes the [[link-solc-packed]] [[sha256]] hash of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPackedSha256([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ - function solidityPackedSha256(types, values) { - return sha256(solidityPacked(types, values)); - } - - //import { TypedDataDomain, TypedDataField } from "@ethersproject/providerabstract-signer"; - const padding = new Uint8Array(32); - padding.fill(0); - const BN__1 = BigInt(-1); - const BN_0$3 = BigInt(0); - const BN_1$1 = BigInt(1); - const BN_MAX_UINT256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); - function hexPadRight(value) { - const bytes = getBytes(value); - const padOffset = bytes.length % 32; - if (padOffset) { - return concat([bytes, padding.slice(padOffset)]); - } - return hexlify(bytes); - } - const hexTrue = toBeHex(BN_1$1, 32); - const hexFalse = toBeHex(BN_0$3, 32); - const domainFieldTypes = { - name: "string", - version: "string", - chainId: "uint256", - verifyingContract: "address", - salt: "bytes32" - }; - const domainFieldNames = [ - "name", "version", "chainId", "verifyingContract", "salt" - ]; - function checkString(key) { - return function (value) { - assertArgument(typeof (value) === "string", `invalid domain value for ${JSON.stringify(key)}`, `domain.${key}`, value); - return value; - }; - } - const domainChecks = { - name: checkString("name"), - version: checkString("version"), - chainId: function (_value) { - const value = getBigInt(_value, "domain.chainId"); - assertArgument(value >= 0, "invalid chain ID", "domain.chainId", _value); - if (Number.isSafeInteger(value)) { - return Number(value); - } - return toQuantity(value); - }, - verifyingContract: function (value) { - try { - return getAddress(value).toLowerCase(); - } - catch (error) { } - assertArgument(false, `invalid domain value "verifyingContract"`, "domain.verifyingContract", value); - }, - salt: function (value) { - const bytes = getBytes(value, "domain.salt"); - assertArgument(bytes.length === 32, `invalid domain value "salt"`, "domain.salt", value); - return hexlify(bytes); - } - }; - function getBaseEncoder(type) { - // intXX and uintXX - { - const match = type.match(/^(u?)int(\d+)$/); - if (match) { - const signed = (match[1] === ""); - const width = parseInt(match[2]); - assertArgument(width % 8 === 0 && width !== 0 && width <= 256 && match[2] === String(width), "invalid numeric width", "type", type); - const boundsUpper = mask(BN_MAX_UINT256, signed ? (width - 1) : width); - const boundsLower = signed ? ((boundsUpper + BN_1$1) * BN__1) : BN_0$3; - return function (_value) { - const value = getBigInt(_value, "value"); - assertArgument(value >= boundsLower && value <= boundsUpper, `value out-of-bounds for ${type}`, "value", value); - return toBeHex(signed ? toTwos(value, 256) : value, 32); - }; - } - } - // bytesXX - { - const match = type.match(/^bytes(\d+)$/); - if (match) { - const width = parseInt(match[1]); - assertArgument(width !== 0 && width <= 32 && match[1] === String(width), "invalid bytes width", "type", type); - return function (value) { - const bytes = getBytes(value); - assertArgument(bytes.length === width, `invalid length for ${type}`, "value", value); - return hexPadRight(value); - }; - } - } - switch (type) { - case "address": return function (value) { - return zeroPadValue(getAddress(value), 32); - }; - case "bool": return function (value) { - return ((!value) ? hexFalse : hexTrue); - }; - case "bytes": return function (value) { - return keccak256(value); - }; - case "string": return function (value) { - return id(value); - }; - } - return null; - } - function encodeType(name, fields) { - return `${name}(${fields.map(({ name, type }) => (type + " " + name)).join(",")})`; - } - // foo[][3] => { base: "foo", index: "[][3]", array: { - // base: "foo", prefix: "foo[]", count: 3 } } - function splitArray(type) { - const match = type.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/); - if (match) { - return { - base: match[1], - index: (match[2] + match[4]), - array: { - base: match[1], - prefix: (match[1] + match[2]), - count: (match[5] ? parseInt(match[5]) : -1), - } - }; - } - return { base: type }; - } - /** - * A **TypedDataEncode** prepares and encodes [[link-eip-712]] payloads - * for signed typed data. - * - * This is useful for those that wish to compute various components of a - * typed data hash, primary types, or sub-components, but generally the - * higher level [[Signer-signTypedData]] is more useful. - */ - class TypedDataEncoder { - /** - * The primary type for the structured [[types]]. - * - * This is derived automatically from the [[types]], since no - * recursion is possible, once the DAG for the types is consturcted - * internally, the primary type must be the only remaining type with - * no parent nodes. - */ - primaryType; - #types; - /** - * The types. - */ - get types() { - return JSON.parse(this.#types); - } - #fullTypes; - #encoderCache; - /** - * Create a new **TypedDataEncoder** for %%types%%. - * - * This performs all necessary checking that types are valid and - * do not violate the [[link-eip-712]] structural constraints as - * well as computes the [[primaryType]]. - */ - constructor(_types) { - this.#fullTypes = new Map(); - this.#encoderCache = new Map(); - // Link struct types to their direct child structs - const links = new Map(); - // Link structs to structs which contain them as a child - const parents = new Map(); - // Link all subtypes within a given struct - const subtypes = new Map(); - const types = {}; - Object.keys(_types).forEach((type) => { - types[type] = _types[type].map(({ name, type }) => { - // Normalize the base type (unless name conflict) - let { base, index } = splitArray(type); - if (base === "int" && !_types["int"]) { - base = "int256"; - } - if (base === "uint" && !_types["uint"]) { - base = "uint256"; - } - return { name, type: (base + (index || "")) }; - }); - links.set(type, new Set()); - parents.set(type, []); - subtypes.set(type, new Set()); - }); - this.#types = JSON.stringify(types); - for (const name in types) { - const uniqueNames = new Set(); - for (const field of types[name]) { - // Check each field has a unique name - assertArgument(!uniqueNames.has(field.name), `duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`, "types", _types); - uniqueNames.add(field.name); - // Get the base type (drop any array specifiers) - const baseType = splitArray(field.type).base; - assertArgument(baseType !== name, `circular type reference to ${JSON.stringify(baseType)}`, "types", _types); - // Is this a base encoding type? - const encoder = getBaseEncoder(baseType); - if (encoder) { - continue; - } - assertArgument(parents.has(baseType), `unknown type ${JSON.stringify(baseType)}`, "types", _types); - // Add linkage - parents.get(baseType).push(name); - links.get(name).add(baseType); - } - } - // Deduce the primary type - const primaryTypes = Array.from(parents.keys()).filter((n) => (parents.get(n).length === 0)); - assertArgument(primaryTypes.length !== 0, "missing primary type", "types", _types); - assertArgument(primaryTypes.length === 1, `ambiguous primary types or unused types: ${primaryTypes.map((t) => (JSON.stringify(t))).join(", ")}`, "types", _types); - defineProperties(this, { primaryType: primaryTypes[0] }); - // Check for circular type references - function checkCircular(type, found) { - assertArgument(!found.has(type), `circular type reference to ${JSON.stringify(type)}`, "types", _types); - found.add(type); - for (const child of links.get(type)) { - if (!parents.has(child)) { - continue; - } - // Recursively check children - checkCircular(child, found); - // Mark all ancestors as having this decendant - for (const subtype of found) { - subtypes.get(subtype).add(child); - } - } - found.delete(type); - } - checkCircular(this.primaryType, new Set()); - // Compute each fully describe type - for (const [name, set] of subtypes) { - const st = Array.from(set); - st.sort(); - this.#fullTypes.set(name, encodeType(name, types[name]) + st.map((t) => encodeType(t, types[t])).join("")); - } - } - /** - * Returnthe encoder for the specific %%type%%. - */ - getEncoder(type) { - let encoder = this.#encoderCache.get(type); - if (!encoder) { - encoder = this.#getEncoder(type); - this.#encoderCache.set(type, encoder); - } - return encoder; - } - #getEncoder(type) { - // Basic encoder type (address, bool, uint256, etc) - { - const encoder = getBaseEncoder(type); - if (encoder) { - return encoder; - } - } - // Array - const array = splitArray(type).array; - if (array) { - const subtype = array.prefix; - const subEncoder = this.getEncoder(subtype); - return (value) => { - assertArgument(array.count === -1 || array.count === value.length, `array length mismatch; expected length ${array.count}`, "value", value); - let result = value.map(subEncoder); - if (this.#fullTypes.has(subtype)) { - result = result.map(keccak256); - } - return keccak256(concat(result)); - }; - } - // Struct - const fields = this.types[type]; - if (fields) { - const encodedType = id(this.#fullTypes.get(type)); - return (value) => { - const values = fields.map(({ name, type }) => { - const result = this.getEncoder(type)(value[name]); - if (this.#fullTypes.has(type)) { - return keccak256(result); - } - return result; - }); - values.unshift(encodedType); - return concat(values); - }; - } - assertArgument(false, `unknown type: ${type}`, "type", type); - } - /** - * Return the full type for %%name%%. - */ - encodeType(name) { - const result = this.#fullTypes.get(name); - assertArgument(result, `unknown type: ${JSON.stringify(name)}`, "name", name); - return result; - } - /** - * Return the encoded %%value%% for the %%type%%. - */ - encodeData(type, value) { - return this.getEncoder(type)(value); - } - /** - * Returns the hash of %%value%% for the type of %%name%%. - */ - hashStruct(name, value) { - return keccak256(this.encodeData(name, value)); - } - /** - * Return the fulled encoded %%value%% for the [[types]]. - */ - encode(value) { - return this.encodeData(this.primaryType, value); - } - /** - * Return the hash of the fully encoded %%value%% for the [[types]]. - */ - hash(value) { - return this.hashStruct(this.primaryType, value); - } - /** - * @_ignore: - */ - _visit(type, value, callback) { - // Basic encoder type (address, bool, uint256, etc) - { - const encoder = getBaseEncoder(type); - if (encoder) { - return callback(type, value); - } - } - // Array - const array = splitArray(type).array; - if (array) { - assertArgument(array.count === -1 || array.count === value.length, `array length mismatch; expected length ${array.count}`, "value", value); - return value.map((v) => this._visit(array.prefix, v, callback)); - } - // Struct - const fields = this.types[type]; - if (fields) { - return fields.reduce((accum, { name, type }) => { - accum[name] = this._visit(type, value[name], callback); - return accum; - }, {}); - } - assertArgument(false, `unknown type: ${type}`, "type", type); - } - /** - * Call %%calback%% for each value in %%value%%, passing the type and - * component within %%value%%. - * - * This is useful for replacing addresses or other transformation that - * may be desired on each component, based on its type. - */ - visit(value, callback) { - return this._visit(this.primaryType, value, callback); - } - /** - * Create a new **TypedDataEncoder** for %%types%%. - */ - static from(types) { - return new TypedDataEncoder(types); - } - /** - * Return the primary type for %%types%%. - */ - static getPrimaryType(types) { - return TypedDataEncoder.from(types).primaryType; - } - /** - * Return the hashed struct for %%value%% using %%types%% and %%name%%. - */ - static hashStruct(name, types, value) { - return TypedDataEncoder.from(types).hashStruct(name, value); - } - /** - * Return the domain hash for %%domain%%. - */ - static hashDomain(domain) { - const domainFields = []; - for (const name in domain) { - if (domain[name] == null) { - continue; - } - const type = domainFieldTypes[name]; - assertArgument(type, `invalid typed-data domain key: ${JSON.stringify(name)}`, "domain", domain); - domainFields.push({ name, type }); - } - domainFields.sort((a, b) => { - return domainFieldNames.indexOf(a.name) - domainFieldNames.indexOf(b.name); - }); - return TypedDataEncoder.hashStruct("EIP712Domain", { EIP712Domain: domainFields }, domain); - } - /** - * Return the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%. - */ - static encode(domain, types, value) { - return concat([ - "0x1901", - TypedDataEncoder.hashDomain(domain), - TypedDataEncoder.from(types).hash(value) - ]); - } - /** - * Return the hash of the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%. - */ - static hash(domain, types, value) { - return keccak256(TypedDataEncoder.encode(domain, types, value)); - } - // Replaces all address types with ENS names with their looked up address - /** - * Resolves to the value from resolving all addresses in %%value%% for - * %%types%% and the %%domain%%. - */ - static async resolveNames(domain, types, value, resolveName) { - // Make a copy to isolate it from the object passed in - domain = Object.assign({}, domain); - // Allow passing null to ignore value - for (const key in domain) { - if (domain[key] == null) { - delete domain[key]; - } - } - // Look up all ENS names - const ensCache = {}; - // Do we need to look up the domain's verifyingContract? - if (domain.verifyingContract && !isHexString(domain.verifyingContract, 20)) { - ensCache[domain.verifyingContract] = "0x"; - } - // We are going to use the encoder to visit all the base values - const encoder = TypedDataEncoder.from(types); - // Get a list of all the addresses - encoder.visit(value, (type, value) => { - if (type === "address" && !isHexString(value, 20)) { - ensCache[value] = "0x"; - } - return value; - }); - // Lookup each name - for (const name in ensCache) { - ensCache[name] = await resolveName(name); - } - // Replace the domain verifyingContract if needed - if (domain.verifyingContract && ensCache[domain.verifyingContract]) { - domain.verifyingContract = ensCache[domain.verifyingContract]; - } - // Replace all ENS names with their address - value = encoder.visit(value, (type, value) => { - if (type === "address" && ensCache[value]) { - return ensCache[value]; - } - return value; - }); - return { domain, value }; - } - /** - * Returns the JSON-encoded payload expected by nodes which implement - * the JSON-RPC [[link-eip-712]] method. - */ - static getPayload(domain, types, value) { - // Validate the domain fields - TypedDataEncoder.hashDomain(domain); - // Derive the EIP712Domain Struct reference type - const domainValues = {}; - const domainTypes = []; - domainFieldNames.forEach((name) => { - const value = domain[name]; - if (value == null) { - return; - } - domainValues[name] = domainChecks[name](value); - domainTypes.push({ name, type: domainFieldTypes[name] }); - }); - const encoder = TypedDataEncoder.from(types); - // Get the normalized types - types = encoder.types; - const typesWithDomain = Object.assign({}, types); - assertArgument(typesWithDomain.EIP712Domain == null, "types must not contain EIP712Domain type", "types.EIP712Domain", types); - typesWithDomain.EIP712Domain = domainTypes; - // Validate the data structures and types - encoder.encode(value); - return { - types: typesWithDomain, - domain: domainValues, - primaryType: encoder.primaryType, - message: encoder.visit(value, (type, value) => { - // bytes - if (type.match(/^bytes(\d*)/)) { - return hexlify(getBytes(value)); - } - // uint or int - if (type.match(/^u?int/)) { - return getBigInt(value).toString(); - } - switch (type) { - case "address": - return value.toLowerCase(); - case "bool": - return !!value; - case "string": - assertArgument(typeof (value) === "string", "invalid string", "value", value); - return value; - } - assertArgument(false, "unsupported type", "type", type); - }) - }; - } - } - /** - * Compute the address used to sign the typed data for the %%signature%%. - */ - function verifyTypedData(domain, types, value, signature) { - return recoverAddress(TypedDataEncoder.hash(domain, types, value), signature); - } - - /** - * A fragment is a single item from an ABI, which may represent any of: - * - * - [Functions](FunctionFragment) - * - [Events](EventFragment) - * - [Constructors](ConstructorFragment) - * - Custom [Errors](ErrorFragment) - * - [Fallback or Receive](FallbackFragment) functions - * - * @_subsection api/abi/abi-coder:Fragments [about-fragments] - */ - // [ "a", "b" ] => { "a": 1, "b": 1 } - function setify(items) { - const result = new Set(); - items.forEach((k) => result.add(k)); - return Object.freeze(result); - } - const _kwVisibDeploy = "external public payable override"; - const KwVisibDeploy = setify(_kwVisibDeploy.split(" ")); - // Visibility Keywords - const _kwVisib = "constant external internal payable private public pure view override"; - const KwVisib = setify(_kwVisib.split(" ")); - const _kwTypes = "constructor error event fallback function receive struct"; - const KwTypes = setify(_kwTypes.split(" ")); - const _kwModifiers = "calldata memory storage payable indexed"; - const KwModifiers = setify(_kwModifiers.split(" ")); - const _kwOther = "tuple returns"; - // All Keywords - const _keywords = [_kwTypes, _kwModifiers, _kwOther, _kwVisib].join(" "); - const Keywords = setify(_keywords.split(" ")); - // Single character tokens - const SimpleTokens = { - "(": "OPEN_PAREN", ")": "CLOSE_PAREN", - "[": "OPEN_BRACKET", "]": "CLOSE_BRACKET", - ",": "COMMA", "@": "AT" - }; - // Parser regexes to consume the next token - const regexWhitespacePrefix = new RegExp("^(\\s*)"); - const regexNumberPrefix = new RegExp("^([0-9]+)"); - const regexIdPrefix = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"); - // Parser regexs to check validity - const regexId = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"); - const regexType = new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$"); - class TokenString { - #offset; - #tokens; - get offset() { return this.#offset; } - get length() { return this.#tokens.length - this.#offset; } - constructor(tokens) { - this.#offset = 0; - this.#tokens = tokens.slice(); - } - clone() { return new TokenString(this.#tokens); } - reset() { this.#offset = 0; } - #subTokenString(from = 0, to = 0) { - return new TokenString(this.#tokens.slice(from, to).map((t) => { - return Object.freeze(Object.assign({}, t, { - match: (t.match - from), - linkBack: (t.linkBack - from), - linkNext: (t.linkNext - from), - })); - })); - } - // Pops and returns the value of the next token, if it is a keyword in allowed; throws if out of tokens - popKeyword(allowed) { - const top = this.peek(); - if (top.type !== "KEYWORD" || !allowed.has(top.text)) { - throw new Error(`expected keyword ${top.text}`); - } - return this.pop().text; - } - // Pops and returns the value of the next token if it is `type`; throws if out of tokens - popType(type) { - if (this.peek().type !== type) { - const top = this.peek(); - throw new Error(`expected ${type}; got ${top.type} ${JSON.stringify(top.text)}`); - } - return this.pop().text; - } - // Pops and returns a "(" TOKENS ")" - popParen() { - const top = this.peek(); - if (top.type !== "OPEN_PAREN") { - throw new Error("bad start"); - } - const result = this.#subTokenString(this.#offset + 1, top.match + 1); - this.#offset = top.match + 1; - return result; - } - // Pops and returns the items within "(" ITEM1 "," ITEM2 "," ... ")" - popParams() { - const top = this.peek(); - if (top.type !== "OPEN_PAREN") { - throw new Error("bad start"); - } - const result = []; - while (this.#offset < top.match - 1) { - const link = this.peek().linkNext; - result.push(this.#subTokenString(this.#offset + 1, link)); - this.#offset = link; - } - this.#offset = top.match + 1; - return result; - } - // Returns the top Token, throwing if out of tokens - peek() { - if (this.#offset >= this.#tokens.length) { - throw new Error("out-of-bounds"); - } - return this.#tokens[this.#offset]; - } - // Returns the next value, if it is a keyword in `allowed` - peekKeyword(allowed) { - const top = this.peekType("KEYWORD"); - return (top != null && allowed.has(top)) ? top : null; - } - // Returns the value of the next token if it is `type` - peekType(type) { - if (this.length === 0) { - return null; - } - const top = this.peek(); - return (top.type === type) ? top.text : null; - } - // Returns the next token; throws if out of tokens - pop() { - const result = this.peek(); - this.#offset++; - return result; - } - toString() { - const tokens = []; - for (let i = this.#offset; i < this.#tokens.length; i++) { - const token = this.#tokens[i]; - tokens.push(`${token.type}:${token.text}`); - } - return ``; - } - } - function lex(text) { - const tokens = []; - const throwError = (message) => { - const token = (offset < text.length) ? JSON.stringify(text[offset]) : "$EOI"; - throw new Error(`invalid token ${token} at ${offset}: ${message}`); - }; - let brackets = []; - let commas = []; - let offset = 0; - while (offset < text.length) { - // Strip off any leading whitespace - let cur = text.substring(offset); - let match = cur.match(regexWhitespacePrefix); - if (match) { - offset += match[1].length; - cur = text.substring(offset); - } - const token = { depth: brackets.length, linkBack: -1, linkNext: -1, match: -1, type: "", text: "", offset, value: -1 }; - tokens.push(token); - let type = (SimpleTokens[cur[0]] || ""); - if (type) { - token.type = type; - token.text = cur[0]; - offset++; - if (type === "OPEN_PAREN") { - brackets.push(tokens.length - 1); - commas.push(tokens.length - 1); - } - else if (type == "CLOSE_PAREN") { - if (brackets.length === 0) { - throwError("no matching open bracket"); - } - token.match = brackets.pop(); - (tokens[token.match]).match = tokens.length - 1; - token.depth--; - token.linkBack = commas.pop(); - (tokens[token.linkBack]).linkNext = tokens.length - 1; - } - else if (type === "COMMA") { - token.linkBack = commas.pop(); - (tokens[token.linkBack]).linkNext = tokens.length - 1; - commas.push(tokens.length - 1); - } - else if (type === "OPEN_BRACKET") { - token.type = "BRACKET"; - } - else if (type === "CLOSE_BRACKET") { - // Remove the CLOSE_BRACKET - let suffix = tokens.pop().text; - if (tokens.length > 0 && tokens[tokens.length - 1].type === "NUMBER") { - const value = tokens.pop().text; - suffix = value + suffix; - (tokens[tokens.length - 1]).value = getNumber(value); - } - if (tokens.length === 0 || tokens[tokens.length - 1].type !== "BRACKET") { - throw new Error("missing opening bracket"); - } - (tokens[tokens.length - 1]).text += suffix; - } - continue; - } - match = cur.match(regexIdPrefix); - if (match) { - token.text = match[1]; - offset += token.text.length; - if (Keywords.has(token.text)) { - token.type = "KEYWORD"; - continue; - } - if (token.text.match(regexType)) { - token.type = "TYPE"; - continue; - } - token.type = "ID"; - continue; - } - match = cur.match(regexNumberPrefix); - if (match) { - token.text = match[1]; - token.type = "NUMBER"; - offset += token.text.length; - continue; - } - throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset}`); - } - return new TokenString(tokens.map((t) => Object.freeze(t))); - } - // Check only one of `allowed` is in `set` - function allowSingle(set, allowed) { - let included = []; - for (const key in allowed.keys()) { - if (set.has(key)) { - included.push(key); - } - } - if (included.length > 1) { - throw new Error(`conflicting types: ${included.join(", ")}`); - } - } - // Functions to process a Solidity Signature TokenString from left-to-right for... - // ...the name with an optional type, returning the name - function consumeName(type, tokens) { - if (tokens.peekKeyword(KwTypes)) { - const keyword = tokens.pop().text; - if (keyword !== type) { - throw new Error(`expected ${type}, got ${keyword}`); - } - } - return tokens.popType("ID"); - } - // ...all keywords matching allowed, returning the keywords - function consumeKeywords(tokens, allowed) { - const keywords = new Set(); - while (true) { - const keyword = tokens.peekType("KEYWORD"); - if (keyword == null || (allowed && !allowed.has(keyword))) { - break; - } - tokens.pop(); - if (keywords.has(keyword)) { - throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`); - } - keywords.add(keyword); - } - return Object.freeze(keywords); - } - // ...all visibility keywords, returning the coalesced mutability - function consumeMutability(tokens) { - let modifiers = consumeKeywords(tokens, KwVisib); - // Detect conflicting modifiers - allowSingle(modifiers, setify("constant payable nonpayable".split(" "))); - allowSingle(modifiers, setify("pure view payable nonpayable".split(" "))); - // Process mutability states - if (modifiers.has("view")) { - return "view"; - } - if (modifiers.has("pure")) { - return "pure"; - } - if (modifiers.has("payable")) { - return "payable"; - } - if (modifiers.has("nonpayable")) { - return "nonpayable"; - } - // Process legacy `constant` last - if (modifiers.has("constant")) { - return "view"; - } - return "nonpayable"; - } - // ...a parameter list, returning the ParamType list - function consumeParams(tokens, allowIndexed) { - return tokens.popParams().map((t) => ParamType.from(t, allowIndexed)); - } - // ...a gas limit, returning a BigNumber or null if none - function consumeGas(tokens) { - if (tokens.peekType("AT")) { - tokens.pop(); - if (tokens.peekType("NUMBER")) { - return getBigInt(tokens.pop().text); - } - throw new Error("invalid gas"); - } - return null; - } - function consumeEoi(tokens) { - if (tokens.length) { - throw new Error(`unexpected tokens at offset ${tokens.offset}: ${tokens.toString()}`); - } - } - const regexArrayType = new RegExp(/^(.*)\[([0-9]*)\]$/); - function verifyBasicType(type) { - const match = type.match(regexType); - assertArgument(match, "invalid type", "type", type); - if (type === "uint") { - return "uint256"; - } - if (type === "int") { - return "int256"; - } - if (match[2]) { - // bytesXX - const length = parseInt(match[2]); - assertArgument(length !== 0 && length <= 32, "invalid bytes length", "type", type); - } - else if (match[3]) { - // intXX or uintXX - const size = parseInt(match[3]); - assertArgument(size !== 0 && size <= 256 && (size % 8) === 0, "invalid numeric width", "type", type); - } - return type; - } - // Make the Fragment constructors effectively private - const _guard$2 = {}; - const internal$1 = Symbol.for("_ethers_internal"); - const ParamTypeInternal = "_ParamTypeInternal"; - const ErrorFragmentInternal = "_ErrorInternal"; - const EventFragmentInternal = "_EventInternal"; - const ConstructorFragmentInternal = "_ConstructorInternal"; - const FallbackFragmentInternal = "_FallbackInternal"; - const FunctionFragmentInternal = "_FunctionInternal"; - const StructFragmentInternal = "_StructInternal"; - /** - * Each input and output of a [[Fragment]] is an Array of **ParamType**. - */ - class ParamType { - /** - * The local name of the parameter (or ``""`` if unbound) - */ - name; - /** - * The fully qualified type (e.g. ``"address"``, ``"tuple(address)"``, - * ``"uint256[3][]"``) - */ - type; - /** - * The base type (e.g. ``"address"``, ``"tuple"``, ``"array"``) - */ - baseType; - /** - * True if the parameters is indexed. - * - * For non-indexable types this is ``null``. - */ - indexed; - /** - * The components for the tuple. - * - * For non-tuple types this is ``null``. - */ - components; - /** - * The array length, or ``-1`` for dynamic-lengthed arrays. - * - * For non-array types this is ``null``. - */ - arrayLength; - /** - * The type of each child in the array. - * - * For non-array types this is ``null``. - */ - arrayChildren; - /** - * @private - */ - constructor(guard, name, type, baseType, indexed, components, arrayLength, arrayChildren) { - assertPrivate(guard, _guard$2, "ParamType"); - Object.defineProperty(this, internal$1, { value: ParamTypeInternal }); - if (components) { - components = Object.freeze(components.slice()); - } - if (baseType === "array") { - if (arrayLength == null || arrayChildren == null) { - throw new Error(""); - } - } - else if (arrayLength != null || arrayChildren != null) { - throw new Error(""); - } - if (baseType === "tuple") { - if (components == null) { - throw new Error(""); - } - } - else if (components != null) { - throw new Error(""); - } - defineProperties(this, { - name, type, baseType, indexed, components, arrayLength, arrayChildren - }); - } - /** - * Return a string representation of this type. - * - * For example, - * - * ``sighash" => "(uint256,address)"`` - * - * ``"minimal" => "tuple(uint256,address) indexed"`` - * - * ``"full" => "tuple(uint256 foo, address bar) indexed baz"`` - */ - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - const name = this.name || ""; - if (this.isArray()) { - const result = JSON.parse(this.arrayChildren.format("json")); - result.name = name; - result.type += `[${(this.arrayLength < 0 ? "" : String(this.arrayLength))}]`; - return JSON.stringify(result); - } - const result = { - type: ((this.baseType === "tuple") ? "tuple" : this.type), - name - }; - if (typeof (this.indexed) === "boolean") { - result.indexed = this.indexed; - } - if (this.isTuple()) { - result.components = this.components.map((c) => JSON.parse(c.format(format))); - } - return JSON.stringify(result); - } - let result = ""; - // Array - if (this.isArray()) { - result += this.arrayChildren.format(format); - result += `[${(this.arrayLength < 0 ? "" : String(this.arrayLength))}]`; - } - else { - if (this.isTuple()) { - result += "(" + this.components.map((comp) => comp.format(format)).join((format === "full") ? ", " : ",") + ")"; - } - else { - result += this.type; - } - } - if (format !== "sighash") { - if (this.indexed === true) { - result += " indexed"; - } - if (format === "full" && this.name) { - result += " " + this.name; - } - } - return result; - } - /** - * Returns true if %%this%% is an Array type. - * - * This provides a type gaurd ensuring that [[arrayChildren]] - * and [[arrayLength]] are non-null. - */ - isArray() { - return (this.baseType === "array"); - } - /** - * Returns true if %%this%% is a Tuple type. - * - * This provides a type gaurd ensuring that [[components]] - * is non-null. - */ - isTuple() { - return (this.baseType === "tuple"); - } - /** - * Returns true if %%this%% is an Indexable type. - * - * This provides a type gaurd ensuring that [[indexed]] - * is non-null. - */ - isIndexable() { - return (this.indexed != null); - } - /** - * Walks the **ParamType** with %%value%%, calling %%process%% - * on each type, destructing the %%value%% recursively. - */ - walk(value, process) { - if (this.isArray()) { - if (!Array.isArray(value)) { - throw new Error("invalid array value"); - } - if (this.arrayLength !== -1 && value.length !== this.arrayLength) { - throw new Error("array is wrong length"); - } - const _this = this; - return value.map((v) => (_this.arrayChildren.walk(v, process))); - } - if (this.isTuple()) { - if (!Array.isArray(value)) { - throw new Error("invalid tuple value"); - } - if (value.length !== this.components.length) { - throw new Error("array is wrong length"); - } - const _this = this; - return value.map((v, i) => (_this.components[i].walk(v, process))); - } - return process(this.type, value); - } - #walkAsync(promises, value, process, setValue) { - if (this.isArray()) { - if (!Array.isArray(value)) { - throw new Error("invalid array value"); - } - if (this.arrayLength !== -1 && value.length !== this.arrayLength) { - throw new Error("array is wrong length"); - } - const childType = this.arrayChildren; - const result = value.slice(); - result.forEach((value, index) => { - childType.#walkAsync(promises, value, process, (value) => { - result[index] = value; - }); - }); - setValue(result); - return; - } - if (this.isTuple()) { - const components = this.components; - // Convert the object into an array - let result; - if (Array.isArray(value)) { - result = value.slice(); - } - else { - if (value == null || typeof (value) !== "object") { - throw new Error("invalid tuple value"); - } - result = components.map((param) => { - if (!param.name) { - throw new Error("cannot use object value with unnamed components"); - } - if (!(param.name in value)) { - throw new Error(`missing value for component ${param.name}`); - } - return value[param.name]; - }); - } - if (result.length !== this.components.length) { - throw new Error("array is wrong length"); - } - result.forEach((value, index) => { - components[index].#walkAsync(promises, value, process, (value) => { - result[index] = value; - }); - }); - setValue(result); - return; - } - const result = process(this.type, value); - if (result.then) { - promises.push((async function () { setValue(await result); })()); - } - else { - setValue(result); - } - } - /** - * Walks the **ParamType** with %%value%%, asynchronously calling - * %%process%% on each type, destructing the %%value%% recursively. - * - * This can be used to resolve ENS names by walking and resolving each - * ``"address"`` type. - */ - async walkAsync(value, process) { - const promises = []; - const result = [value]; - this.#walkAsync(promises, value, process, (value) => { - result[0] = value; - }); - if (promises.length) { - await Promise.all(promises); - } - return result[0]; - } - /** - * Creates a new **ParamType** for %%obj%%. - * - * If %%allowIndexed%% then the ``indexed`` keyword is permitted, - * otherwise the ``indexed`` keyword will throw an error. - */ - static from(obj, allowIndexed) { - if (ParamType.isParamType(obj)) { - return obj; - } - if (typeof (obj) === "string") { - try { - return ParamType.from(lex(obj), allowIndexed); - } - catch (error) { - assertArgument(false, "invalid param type", "obj", obj); - } - } - else if (obj instanceof TokenString) { - let type = "", baseType = ""; - let comps = null; - if (consumeKeywords(obj, setify(["tuple"])).has("tuple") || obj.peekType("OPEN_PAREN")) { - // Tuple - baseType = "tuple"; - comps = obj.popParams().map((t) => ParamType.from(t)); - type = `tuple(${comps.map((c) => c.format()).join(",")})`; - } - else { - // Normal - type = verifyBasicType(obj.popType("TYPE")); - baseType = type; - } - // Check for Array - let arrayChildren = null; - let arrayLength = null; - while (obj.length && obj.peekType("BRACKET")) { - const bracket = obj.pop(); //arrays[i]; - arrayChildren = new ParamType(_guard$2, "", type, baseType, null, comps, arrayLength, arrayChildren); - arrayLength = bracket.value; - type += bracket.text; - baseType = "array"; - comps = null; - } - let indexed = null; - const keywords = consumeKeywords(obj, KwModifiers); - if (keywords.has("indexed")) { - if (!allowIndexed) { - throw new Error(""); - } - indexed = true; - } - const name = (obj.peekType("ID") ? obj.pop().text : ""); - if (obj.length) { - throw new Error("leftover tokens"); - } - return new ParamType(_guard$2, name, type, baseType, indexed, comps, arrayLength, arrayChildren); - } - const name = obj.name; - assertArgument(!name || (typeof (name) === "string" && name.match(regexId)), "invalid name", "obj.name", name); - let indexed = obj.indexed; - if (indexed != null) { - assertArgument(allowIndexed, "parameter cannot be indexed", "obj.indexed", obj.indexed); - indexed = !!indexed; - } - let type = obj.type; - let arrayMatch = type.match(regexArrayType); - if (arrayMatch) { - const arrayLength = parseInt(arrayMatch[2] || "-1"); - const arrayChildren = ParamType.from({ - type: arrayMatch[1], - components: obj.components - }); - return new ParamType(_guard$2, name || "", type, "array", indexed, null, arrayLength, arrayChildren); - } - if (type === "tuple" || type.startsWith("tuple(" /* fix: ) */) || type.startsWith("(" /* fix: ) */)) { - const comps = (obj.components != null) ? obj.components.map((c) => ParamType.from(c)) : null; - const tuple = new ParamType(_guard$2, name || "", type, "tuple", indexed, comps, null, null); - // @TODO: use lexer to validate and normalize type - return tuple; - } - type = verifyBasicType(obj.type); - return new ParamType(_guard$2, name || "", type, type, indexed, null, null, null); - } - /** - * Returns true if %%value%% is a **ParamType**. - */ - static isParamType(value) { - return (value && value[internal$1] === ParamTypeInternal); - } - } - /** - * An abstract class to represent An individual fragment from a parse ABI. - */ - class Fragment { - /** - * The type of the fragment. - */ - type; - /** - * The inputs for the fragment. - */ - inputs; - /** - * @private - */ - constructor(guard, type, inputs) { - assertPrivate(guard, _guard$2, "Fragment"); - inputs = Object.freeze(inputs.slice()); - defineProperties(this, { type, inputs }); - } - /** - * Creates a new **Fragment** for %%obj%%, wich can be any supported - * ABI frgament type. - */ - static from(obj) { - if (typeof (obj) === "string") { - // Try parsing JSON... - try { - Fragment.from(JSON.parse(obj)); - } - catch (e) { } - // ...otherwise, use the human-readable lexer - return Fragment.from(lex(obj)); - } - if (obj instanceof TokenString) { - // Human-readable ABI (already lexed) - const type = obj.peekKeyword(KwTypes); - switch (type) { - case "constructor": return ConstructorFragment.from(obj); - case "error": return ErrorFragment.from(obj); - case "event": return EventFragment.from(obj); - case "fallback": - case "receive": - return FallbackFragment.from(obj); - case "function": return FunctionFragment.from(obj); - case "struct": return StructFragment.from(obj); - } - } - else if (typeof (obj) === "object") { - // JSON ABI - switch (obj.type) { - case "constructor": return ConstructorFragment.from(obj); - case "error": return ErrorFragment.from(obj); - case "event": return EventFragment.from(obj); - case "fallback": - case "receive": - return FallbackFragment.from(obj); - case "function": return FunctionFragment.from(obj); - case "struct": return StructFragment.from(obj); - } - assert(false, `unsupported type: ${obj.type}`, "UNSUPPORTED_OPERATION", { - operation: "Fragment.from" - }); - } - assertArgument(false, "unsupported frgament object", "obj", obj); - } - /** - * Returns true if %%value%% is a [[ConstructorFragment]]. - */ - static isConstructor(value) { - return ConstructorFragment.isFragment(value); - } - /** - * Returns true if %%value%% is an [[ErrorFragment]]. - */ - static isError(value) { - return ErrorFragment.isFragment(value); - } - /** - * Returns true if %%value%% is an [[EventFragment]]. - */ - static isEvent(value) { - return EventFragment.isFragment(value); - } - /** - * Returns true if %%value%% is a [[FunctionFragment]]. - */ - static isFunction(value) { - return FunctionFragment.isFragment(value); - } - /** - * Returns true if %%value%% is a [[StructFragment]]. - */ - static isStruct(value) { - return StructFragment.isFragment(value); - } - } - /** - * An abstract class to represent An individual fragment - * which has a name from a parse ABI. - */ - class NamedFragment extends Fragment { - /** - * The name of the fragment. - */ - name; - /** - * @private - */ - constructor(guard, type, name, inputs) { - super(guard, type, inputs); - assertArgument(typeof (name) === "string" && name.match(regexId), "invalid identifier", "name", name); - inputs = Object.freeze(inputs.slice()); - defineProperties(this, { name }); - } - } - function joinParams(format, params) { - return "(" + params.map((p) => p.format(format)).join((format === "full") ? ", " : ",") + ")"; - } - /** - * A Fragment which represents a //Custom Error//. - */ - class ErrorFragment extends NamedFragment { - /** - * @private - */ - constructor(guard, name, inputs) { - super(guard, "error", name, inputs); - Object.defineProperty(this, internal$1, { value: ErrorFragmentInternal }); - } - /** - * The Custom Error selector. - */ - get selector() { - return id(this.format("sighash")).substring(0, 10); - } - /** - * Returns a string representation of this fragment as %%format%%. - */ - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - return JSON.stringify({ - type: "error", - name: this.name, - inputs: this.inputs.map((input) => JSON.parse(input.format(format))), - }); - } - const result = []; - if (format !== "sighash") { - result.push("error"); - } - result.push(this.name + joinParams(format, this.inputs)); - return result.join(" "); - } - /** - * Returns a new **ErrorFragment** for %%obj%%. - */ - static from(obj) { - if (ErrorFragment.isFragment(obj)) { - return obj; - } - if (typeof (obj) === "string") { - return ErrorFragment.from(lex(obj)); - } - else if (obj instanceof TokenString) { - const name = consumeName("error", obj); - const inputs = consumeParams(obj); - consumeEoi(obj); - return new ErrorFragment(_guard$2, name, inputs); - } - return new ErrorFragment(_guard$2, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []); - } - /** - * Returns ``true`` and provides a type guard if %%value%% is an - * **ErrorFragment**. - */ - static isFragment(value) { - return (value && value[internal$1] === ErrorFragmentInternal); - } - } - /** - * A Fragment which represents an Event. - */ - class EventFragment extends NamedFragment { - /** - * Whether this event is anonymous. - */ - anonymous; - /** - * @private - */ - constructor(guard, name, inputs, anonymous) { - super(guard, "event", name, inputs); - Object.defineProperty(this, internal$1, { value: EventFragmentInternal }); - defineProperties(this, { anonymous }); - } - /** - * The Event topic hash. - */ - get topicHash() { - return id(this.format("sighash")); - } - /** - * Returns a string representation of this event as %%format%%. - */ - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - return JSON.stringify({ - type: "event", - anonymous: this.anonymous, - name: this.name, - inputs: this.inputs.map((i) => JSON.parse(i.format(format))) - }); - } - const result = []; - if (format !== "sighash") { - result.push("event"); - } - result.push(this.name + joinParams(format, this.inputs)); - if (format !== "sighash" && this.anonymous) { - result.push("anonymous"); - } - return result.join(" "); - } - /** - * Return the topic hash for an event with %%name%% and %%params%%. - */ - static getTopicHash(name, params) { - params = (params || []).map((p) => ParamType.from(p)); - const fragment = new EventFragment(_guard$2, name, params, false); - return fragment.topicHash; - } - /** - * Returns a new **EventFragment** for %%obj%%. - */ - static from(obj) { - if (EventFragment.isFragment(obj)) { - return obj; - } - if (typeof (obj) === "string") { - try { - return EventFragment.from(lex(obj)); - } - catch (error) { - assertArgument(false, "invalid event fragment", "obj", obj); - } - } - else if (obj instanceof TokenString) { - const name = consumeName("event", obj); - const inputs = consumeParams(obj, true); - const anonymous = !!consumeKeywords(obj, setify(["anonymous"])).has("anonymous"); - consumeEoi(obj); - return new EventFragment(_guard$2, name, inputs, anonymous); - } - return new EventFragment(_guard$2, obj.name, obj.inputs ? obj.inputs.map((p) => ParamType.from(p, true)) : [], !!obj.anonymous); - } - /** - * Returns ``true`` and provides a type guard if %%value%% is an - * **EventFragment**. - */ - static isFragment(value) { - return (value && value[internal$1] === EventFragmentInternal); - } - } - /** - * A Fragment which represents a constructor. - */ - class ConstructorFragment extends Fragment { - /** - * Whether the constructor can receive an endowment. - */ - payable; - /** - * The recommended gas limit for deployment or ``null``. - */ - gas; - /** - * @private - */ - constructor(guard, type, inputs, payable, gas) { - super(guard, type, inputs); - Object.defineProperty(this, internal$1, { value: ConstructorFragmentInternal }); - defineProperties(this, { payable, gas }); - } - /** - * Returns a string representation of this constructor as %%format%%. - */ - format(format) { - assert(format != null && format !== "sighash", "cannot format a constructor for sighash", "UNSUPPORTED_OPERATION", { operation: "format(sighash)" }); - if (format === "json") { - return JSON.stringify({ - type: "constructor", - stateMutability: (this.payable ? "payable" : "undefined"), - payable: this.payable, - gas: ((this.gas != null) ? this.gas : undefined), - inputs: this.inputs.map((i) => JSON.parse(i.format(format))) - }); - } - const result = [`constructor${joinParams(format, this.inputs)}`]; - if (this.payable) { - result.push("payable"); - } - if (this.gas != null) { - result.push(`@${this.gas.toString()}`); - } - return result.join(" "); - } - /** - * Returns a new **ConstructorFragment** for %%obj%%. - */ - static from(obj) { - if (ConstructorFragment.isFragment(obj)) { - return obj; - } - if (typeof (obj) === "string") { - try { - return ConstructorFragment.from(lex(obj)); - } - catch (error) { - assertArgument(false, "invalid constuctor fragment", "obj", obj); - } - } - else if (obj instanceof TokenString) { - consumeKeywords(obj, setify(["constructor"])); - const inputs = consumeParams(obj); - const payable = !!consumeKeywords(obj, KwVisibDeploy).has("payable"); - const gas = consumeGas(obj); - consumeEoi(obj); - return new ConstructorFragment(_guard$2, "constructor", inputs, payable, gas); - } - return new ConstructorFragment(_guard$2, "constructor", obj.inputs ? obj.inputs.map(ParamType.from) : [], !!obj.payable, (obj.gas != null) ? obj.gas : null); - } - /** - * Returns ``true`` and provides a type guard if %%value%% is a - * **ConstructorFragment**. - */ - static isFragment(value) { - return (value && value[internal$1] === ConstructorFragmentInternal); - } - } - /** - * A Fragment which represents a method. - */ - class FallbackFragment extends Fragment { - /** - * If the function can be sent value during invocation. - */ - payable; - constructor(guard, inputs, payable) { - super(guard, "fallback", inputs); - Object.defineProperty(this, internal$1, { value: FallbackFragmentInternal }); - defineProperties(this, { payable }); - } - /** - * Returns a string representation of this fallback as %%format%%. - */ - format(format) { - const type = ((this.inputs.length === 0) ? "receive" : "fallback"); - if (format === "json") { - const stateMutability = (this.payable ? "payable" : "nonpayable"); - return JSON.stringify({ type, stateMutability }); - } - return `${type}()${this.payable ? " payable" : ""}`; - } - /** - * Returns a new **FallbackFragment** for %%obj%%. - */ - static from(obj) { - if (FallbackFragment.isFragment(obj)) { - return obj; - } - if (typeof (obj) === "string") { - try { - return FallbackFragment.from(lex(obj)); - } - catch (error) { - assertArgument(false, "invalid fallback fragment", "obj", obj); - } - } - else if (obj instanceof TokenString) { - const errorObj = obj.toString(); - const topIsValid = obj.peekKeyword(setify(["fallback", "receive"])); - assertArgument(topIsValid, "type must be fallback or receive", "obj", errorObj); - const type = obj.popKeyword(setify(["fallback", "receive"])); - // receive() - if (type === "receive") { - const inputs = consumeParams(obj); - assertArgument(inputs.length === 0, `receive cannot have arguments`, "obj.inputs", inputs); - consumeKeywords(obj, setify(["payable"])); - consumeEoi(obj); - return new FallbackFragment(_guard$2, [], true); - } - // fallback() [payable] - // fallback(bytes) [payable] returns (bytes) - let inputs = consumeParams(obj); - if (inputs.length) { - assertArgument(inputs.length === 1 && inputs[0].type === "bytes", "invalid fallback inputs", "obj.inputs", inputs.map((i) => i.format("minimal")).join(", ")); - } - else { - inputs = [ParamType.from("bytes")]; - } - const mutability = consumeMutability(obj); - assertArgument(mutability === "nonpayable" || mutability === "payable", "fallback cannot be constants", "obj.stateMutability", mutability); - if (consumeKeywords(obj, setify(["returns"])).has("returns")) { - const outputs = consumeParams(obj); - assertArgument(outputs.length === 1 && outputs[0].type === "bytes", "invalid fallback outputs", "obj.outputs", outputs.map((i) => i.format("minimal")).join(", ")); - } - consumeEoi(obj); - return new FallbackFragment(_guard$2, inputs, mutability === "payable"); - } - if (obj.type === "receive") { - return new FallbackFragment(_guard$2, [], true); - } - if (obj.type === "fallback") { - const inputs = [ParamType.from("bytes")]; - const payable = (obj.stateMutability === "payable"); - return new FallbackFragment(_guard$2, inputs, payable); - } - assertArgument(false, "invalid fallback description", "obj", obj); - } - /** - * Returns ``true`` and provides a type guard if %%value%% is a - * **FallbackFragment**. - */ - static isFragment(value) { - return (value && value[internal$1] === FallbackFragmentInternal); - } - } - /** - * A Fragment which represents a method. - */ - class FunctionFragment extends NamedFragment { - /** - * If the function is constant (e.g. ``pure`` or ``view`` functions). - */ - constant; - /** - * The returned types for the result of calling this function. - */ - outputs; - /** - * The state mutability (e.g. ``payable``, ``nonpayable``, ``view`` - * or ``pure``) - */ - stateMutability; - /** - * If the function can be sent value during invocation. - */ - payable; - /** - * The recommended gas limit to send when calling this function. - */ - gas; - /** - * @private - */ - constructor(guard, name, stateMutability, inputs, outputs, gas) { - super(guard, "function", name, inputs); - Object.defineProperty(this, internal$1, { value: FunctionFragmentInternal }); - outputs = Object.freeze(outputs.slice()); - const constant = (stateMutability === "view" || stateMutability === "pure"); - const payable = (stateMutability === "payable"); - defineProperties(this, { constant, gas, outputs, payable, stateMutability }); - } - /** - * The Function selector. - */ - get selector() { - return id(this.format("sighash")).substring(0, 10); - } - /** - * Returns a string representation of this function as %%format%%. - */ - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - return JSON.stringify({ - type: "function", - name: this.name, - constant: this.constant, - stateMutability: ((this.stateMutability !== "nonpayable") ? this.stateMutability : undefined), - payable: this.payable, - gas: ((this.gas != null) ? this.gas : undefined), - inputs: this.inputs.map((i) => JSON.parse(i.format(format))), - outputs: this.outputs.map((o) => JSON.parse(o.format(format))), - }); - } - const result = []; - if (format !== "sighash") { - result.push("function"); - } - result.push(this.name + joinParams(format, this.inputs)); - if (format !== "sighash") { - if (this.stateMutability !== "nonpayable") { - result.push(this.stateMutability); - } - if (this.outputs && this.outputs.length) { - result.push("returns"); - result.push(joinParams(format, this.outputs)); - } - if (this.gas != null) { - result.push(`@${this.gas.toString()}`); - } - } - return result.join(" "); - } - /** - * Return the selector for a function with %%name%% and %%params%%. - */ - static getSelector(name, params) { - params = (params || []).map((p) => ParamType.from(p)); - const fragment = new FunctionFragment(_guard$2, name, "view", params, [], null); - return fragment.selector; - } - /** - * Returns a new **FunctionFragment** for %%obj%%. - */ - static from(obj) { - if (FunctionFragment.isFragment(obj)) { - return obj; - } - if (typeof (obj) === "string") { - try { - return FunctionFragment.from(lex(obj)); - } - catch (error) { - assertArgument(false, "invalid function fragment", "obj", obj); - } - } - else if (obj instanceof TokenString) { - const name = consumeName("function", obj); - const inputs = consumeParams(obj); - const mutability = consumeMutability(obj); - let outputs = []; - if (consumeKeywords(obj, setify(["returns"])).has("returns")) { - outputs = consumeParams(obj); - } - const gas = consumeGas(obj); - consumeEoi(obj); - return new FunctionFragment(_guard$2, name, mutability, inputs, outputs, gas); - } - let stateMutability = obj.stateMutability; - // Use legacy Solidity ABI logic if stateMutability is missing - if (stateMutability == null) { - stateMutability = "payable"; - if (typeof (obj.constant) === "boolean") { - stateMutability = "view"; - if (!obj.constant) { - stateMutability = "payable"; - if (typeof (obj.payable) === "boolean" && !obj.payable) { - stateMutability = "nonpayable"; - } - } - } - else if (typeof (obj.payable) === "boolean" && !obj.payable) { - stateMutability = "nonpayable"; - } - } - // @TODO: verifyState for stateMutability (e.g. throw if - // payable: false but stateMutability is "nonpayable") - return new FunctionFragment(_guard$2, obj.name, stateMutability, obj.inputs ? obj.inputs.map(ParamType.from) : [], obj.outputs ? obj.outputs.map(ParamType.from) : [], (obj.gas != null) ? obj.gas : null); - } - /** - * Returns ``true`` and provides a type guard if %%value%% is a - * **FunctionFragment**. - */ - static isFragment(value) { - return (value && value[internal$1] === FunctionFragmentInternal); - } - } - /** - * A Fragment which represents a structure. - */ - class StructFragment extends NamedFragment { - /** - * @private - */ - constructor(guard, name, inputs) { - super(guard, "struct", name, inputs); - Object.defineProperty(this, internal$1, { value: StructFragmentInternal }); - } - /** - * Returns a string representation of this struct as %%format%%. - */ - format() { - throw new Error("@TODO"); - } - /** - * Returns a new **StructFragment** for %%obj%%. - */ - static from(obj) { - if (typeof (obj) === "string") { - try { - return StructFragment.from(lex(obj)); - } - catch (error) { - assertArgument(false, "invalid struct fragment", "obj", obj); - } - } - else if (obj instanceof TokenString) { - const name = consumeName("struct", obj); - const inputs = consumeParams(obj); - consumeEoi(obj); - return new StructFragment(_guard$2, name, inputs); - } - return new StructFragment(_guard$2, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []); - } - // @TODO: fix this return type - /** - * Returns ``true`` and provides a type guard if %%value%% is a - * **StructFragment**. - */ - static isFragment(value) { - return (value && value[internal$1] === StructFragmentInternal); - } - } - - /** - * When sending values to or receiving values from a [[Contract]], the - * data is generally encoded using the [ABI standard](link-solc-abi). - * - * The AbiCoder provides a utility to encode values to ABI data and - * decode values from ABI data. - * - * Most of the time, developers should favour the [[Contract]] class, - * which further abstracts a lot of the finer details of ABI data. - * - * @_section api/abi/abi-coder:ABI Encoding - */ - // See: https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI - // https://docs.soliditylang.org/en/v0.8.17/control-structures.html - const PanicReasons$1 = new Map(); - PanicReasons$1.set(0x00, "GENERIC_PANIC"); - PanicReasons$1.set(0x01, "ASSERT_FALSE"); - PanicReasons$1.set(0x11, "OVERFLOW"); - PanicReasons$1.set(0x12, "DIVIDE_BY_ZERO"); - PanicReasons$1.set(0x21, "ENUM_RANGE_ERROR"); - PanicReasons$1.set(0x22, "BAD_STORAGE_DATA"); - PanicReasons$1.set(0x31, "STACK_UNDERFLOW"); - PanicReasons$1.set(0x32, "ARRAY_RANGE_ERROR"); - PanicReasons$1.set(0x41, "OUT_OF_MEMORY"); - PanicReasons$1.set(0x51, "UNINITIALIZED_FUNCTION_CALL"); - const paramTypeBytes = new RegExp(/^bytes([0-9]*)$/); - const paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/); - let defaultCoder = null; - let defaultMaxInflation = 1024; - function getBuiltinCallException(action, tx, data, abiCoder) { - let message = "missing revert data"; - let reason = null; - const invocation = null; - let revert = null; - if (data) { - message = "execution reverted"; - const bytes = getBytes(data); - data = hexlify(data); - if (bytes.length === 0) { - message += " (no data present; likely require(false) occurred"; - reason = "require(false)"; - } - else if (bytes.length % 32 !== 4) { - message += " (could not decode reason; invalid data length)"; - } - else if (hexlify(bytes.slice(0, 4)) === "0x08c379a0") { - // Error(string) - try { - reason = abiCoder.decode(["string"], bytes.slice(4))[0]; - revert = { - signature: "Error(string)", - name: "Error", - args: [reason] - }; - message += `: ${JSON.stringify(reason)}`; - } - catch (error) { - message += " (could not decode reason; invalid string data)"; - } - } - else if (hexlify(bytes.slice(0, 4)) === "0x4e487b71") { - // Panic(uint256) - try { - const code = Number(abiCoder.decode(["uint256"], bytes.slice(4))[0]); - revert = { - signature: "Panic(uint256)", - name: "Panic", - args: [code] - }; - reason = `Panic due to ${PanicReasons$1.get(code) || "UNKNOWN"}(${code})`; - message += `: ${reason}`; - } - catch (error) { - message += " (could not decode panic code)"; - } - } - else { - message += " (unknown custom error)"; - } - } - const transaction = { - to: (tx.to ? getAddress(tx.to) : null), - data: (tx.data || "0x") - }; - if (tx.from) { - transaction.from = getAddress(tx.from); - } - return makeError(message, "CALL_EXCEPTION", { - action, data, reason, transaction, invocation, revert - }); - } - /** - * The **AbiCoder** is a low-level class responsible for encoding JavaScript - * values into binary data and decoding binary data into JavaScript values. - */ - class AbiCoder { - #getCoder(param) { - if (param.isArray()) { - return new ArrayCoder(this.#getCoder(param.arrayChildren), param.arrayLength, param.name); - } - if (param.isTuple()) { - return new TupleCoder(param.components.map((c) => this.#getCoder(c)), param.name); - } - switch (param.baseType) { - case "address": - return new AddressCoder(param.name); - case "bool": - return new BooleanCoder(param.name); - case "string": - return new StringCoder(param.name); - case "bytes": - return new BytesCoder(param.name); - case "": - return new NullCoder(param.name); - } - // u?int[0-9]* - let match = param.type.match(paramTypeNumber); - if (match) { - let size = parseInt(match[2] || "256"); - assertArgument(size !== 0 && size <= 256 && (size % 8) === 0, "invalid " + match[1] + " bit length", "param", param); - return new NumberCoder(size / 8, (match[1] === "int"), param.name); - } - // bytes[0-9]+ - match = param.type.match(paramTypeBytes); - if (match) { - let size = parseInt(match[1]); - assertArgument(size !== 0 && size <= 32, "invalid bytes length", "param", param); - return new FixedBytesCoder(size, param.name); - } - assertArgument(false, "invalid type", "type", param.type); - } - /** - * Get the default values for the given %%types%%. - * - * For example, a ``uint`` is by default ``0`` and ``bool`` - * is by default ``false``. - */ - getDefaultValue(types) { - const coders = types.map((type) => this.#getCoder(ParamType.from(type))); - const coder = new TupleCoder(coders, "_"); - return coder.defaultValue(); - } - /** - * Encode the %%values%% as the %%types%% into ABI data. - * - * @returns DataHexstring - */ - encode(types, values) { - assertArgumentCount(values.length, types.length, "types/values length mismatch"); - const coders = types.map((type) => this.#getCoder(ParamType.from(type))); - const coder = (new TupleCoder(coders, "_")); - const writer = new Writer(); - coder.encode(writer, values); - return writer.data; - } - /** - * Decode the ABI %%data%% as the %%types%% into values. - * - * If %%loose%% decoding is enabled, then strict padding is - * not enforced. Some older versions of Solidity incorrectly - * padded event data emitted from ``external`` functions. - */ - decode(types, data, loose) { - const coders = types.map((type) => this.#getCoder(ParamType.from(type))); - const coder = new TupleCoder(coders, "_"); - return coder.decode(new Reader(data, loose, defaultMaxInflation)); - } - static _setDefaultMaxInflation(value) { - assertArgument(typeof (value) === "number" && Number.isInteger(value), "invalid defaultMaxInflation factor", "value", value); - defaultMaxInflation = value; - } - /** - * Returns the shared singleton instance of a default [[AbiCoder]]. - * - * On the first call, the instance is created internally. - */ - static defaultAbiCoder() { - if (defaultCoder == null) { - defaultCoder = new AbiCoder(); - } - return defaultCoder; - } - /** - * Returns an ethers-compatible [[CallExceptionError]] Error for the given - * result %%data%% for the [[CallExceptionAction]] %%action%% against - * the Transaction %%tx%%. - */ - static getBuiltinCallException(action, tx, data) { - return getBuiltinCallException(action, tx, data, AbiCoder.defaultAbiCoder()); - } - } - - /** - * About bytes32 strings... - * - * @_docloc: api/utils:Bytes32 Strings - */ - /** - * Encodes %%text%% as a Bytes32 string. - */ - function encodeBytes32String(text) { - // Get the bytes - const bytes = toUtf8Bytes(text); - // Check we have room for null-termination - if (bytes.length > 31) { - throw new Error("bytes32 string must be less than 32 bytes"); - } - // Zero-pad (implicitly null-terminates) - return zeroPadBytes(bytes, 32); - } - /** - * Encodes the Bytes32-encoded %%bytes%% into a string. - */ - function decodeBytes32String(_bytes) { - const data = getBytes(_bytes, "bytes"); - // Must be 32 bytes with a null-termination - if (data.length !== 32) { - throw new Error("invalid bytes32 - not 32 bytes long"); - } - if (data[31] !== 0) { - throw new Error("invalid bytes32 string - no null terminator"); - } - // Find the null termination - let length = 31; - while (data[length - 1] === 0) { - length--; - } - // Determine the string value - return toUtf8String(data.slice(0, length)); - } - - /** - * The Interface class is a low-level class that accepts an - * ABI and provides all the necessary functionality to encode - * and decode paramaters to and results from methods, events - * and errors. - * - * It also provides several convenience methods to automatically - * search and find matching transactions and events to parse them. - * - * @_subsection api/abi:Interfaces [interfaces] - */ - /** - * When using the [[Interface-parseLog]] to automatically match a Log to its event - * for parsing, a **LogDescription** is returned. - */ - class LogDescription { - /** - * The matching fragment for the ``topic0``. - */ - fragment; - /** - * The name of the Event. - */ - name; - /** - * The full Event signature. - */ - signature; - /** - * The topic hash for the Event. - */ - topic; - /** - * The arguments passed into the Event with ``emit``. - */ - args; - /** - * @_ignore: - */ - constructor(fragment, topic, args) { - const name = fragment.name, signature = fragment.format(); - defineProperties(this, { - fragment, name, signature, topic, args - }); - } - } - /** - * When using the [[Interface-parseTransaction]] to automatically match - * a transaction data to its function for parsing, - * a **TransactionDescription** is returned. - */ - class TransactionDescription { - /** - * The matching fragment from the transaction ``data``. - */ - fragment; - /** - * The name of the Function from the transaction ``data``. - */ - name; - /** - * The arguments passed to the Function from the transaction ``data``. - */ - args; - /** - * The full Function signature from the transaction ``data``. - */ - signature; - /** - * The selector for the Function from the transaction ``data``. - */ - selector; - /** - * The ``value`` (in wei) from the transaction. - */ - value; - /** - * @_ignore: - */ - constructor(fragment, selector, args, value) { - const name = fragment.name, signature = fragment.format(); - defineProperties(this, { - fragment, name, args, signature, selector, value - }); - } - } - /** - * When using the [[Interface-parseError]] to automatically match an - * error for a call result for parsing, an **ErrorDescription** is returned. - */ - class ErrorDescription { - /** - * The matching fragment. - */ - fragment; - /** - * The name of the Error. - */ - name; - /** - * The arguments passed to the Error with ``revert``. - */ - args; - /** - * The full Error signature. - */ - signature; - /** - * The selector for the Error. - */ - selector; - /** - * @_ignore: - */ - constructor(fragment, selector, args) { - const name = fragment.name, signature = fragment.format(); - defineProperties(this, { - fragment, name, args, signature, selector - }); - } - } - /** - * An **Indexed** is used as a value when a value that does not - * fit within a topic (i.e. not a fixed-length, 32-byte type). It - * is the ``keccak256`` of the value, and used for types such as - * arrays, tuples, bytes and strings. - */ - class Indexed { - /** - * The ``keccak256`` of the value logged. - */ - hash; - /** - * @_ignore: - */ - _isIndexed; - /** - * Returns ``true`` if %%value%% is an **Indexed**. - * - * This provides a Type Guard for property access. - */ - static isIndexed(value) { - return !!(value && value._isIndexed); - } - /** - * @_ignore: - */ - constructor(hash) { - defineProperties(this, { hash, _isIndexed: true }); - } - } - // https://docs.soliditylang.org/en/v0.8.13/control-structures.html?highlight=panic#panic-via-assert-and-error-via-require - const PanicReasons = { - "0": "generic panic", - "1": "assert(false)", - "17": "arithmetic overflow", - "18": "division or modulo by zero", - "33": "enum overflow", - "34": "invalid encoded storage byte array accessed", - "49": "out-of-bounds array access; popping on an empty array", - "50": "out-of-bounds access of an array or bytesN", - "65": "out of memory", - "81": "uninitialized function", - }; - const BuiltinErrors = { - "0x08c379a0": { - signature: "Error(string)", - name: "Error", - inputs: ["string"], - reason: (message) => { - return `reverted with reason string ${JSON.stringify(message)}`; - } - }, - "0x4e487b71": { - signature: "Panic(uint256)", - name: "Panic", - inputs: ["uint256"], - reason: (code) => { - let reason = "unknown panic code"; - if (code >= 0 && code <= 0xff && PanicReasons[code.toString()]) { - reason = PanicReasons[code.toString()]; - } - return `reverted with panic code 0x${code.toString(16)} (${reason})`; - } - } - }; - /** - * An Interface abstracts many of the low-level details for - * encoding and decoding the data on the blockchain. - * - * An ABI provides information on how to encode data to send to - * a Contract, how to decode the results and events and how to - * interpret revert errors. - * - * The ABI can be specified by [any supported format](InterfaceAbi). - */ - class Interface { - /** - * All the Contract ABI members (i.e. methods, events, errors, etc). - */ - fragments; - /** - * The Contract constructor. - */ - deploy; - /** - * The Fallback method, if any. - */ - fallback; - /** - * If receiving ether is supported. - */ - receive; - #errors; - #events; - #functions; - // #structs: Map; - #abiCoder; - /** - * Create a new Interface for the %%fragments%%. - */ - constructor(fragments) { - let abi = []; - if (typeof (fragments) === "string") { - abi = JSON.parse(fragments); - } - else { - abi = fragments; - } - this.#functions = new Map(); - this.#errors = new Map(); - this.#events = new Map(); - // this.#structs = new Map(); - const frags = []; - for (const a of abi) { - try { - frags.push(Fragment.from(a)); - } - catch (error) { - console.log(`[Warning] Invalid Fragment ${JSON.stringify(a)}:`, error.message); - } - } - defineProperties(this, { - fragments: Object.freeze(frags) - }); - let fallback = null; - let receive = false; - this.#abiCoder = this.getAbiCoder(); - // Add all fragments by their signature - this.fragments.forEach((fragment, index) => { - let bucket; - switch (fragment.type) { - case "constructor": - if (this.deploy) { - console.log("duplicate definition - constructor"); - return; - } - //checkNames(fragment, "input", fragment.inputs); - defineProperties(this, { deploy: fragment }); - return; - case "fallback": - if (fragment.inputs.length === 0) { - receive = true; - } - else { - assertArgument(!fallback || fragment.payable !== fallback.payable, "conflicting fallback fragments", `fragments[${index}]`, fragment); - fallback = fragment; - receive = fallback.payable; - } - return; - case "function": - //checkNames(fragment, "input", fragment.inputs); - //checkNames(fragment, "output", (fragment).outputs); - bucket = this.#functions; - break; - case "event": - //checkNames(fragment, "input", fragment.inputs); - bucket = this.#events; - break; - case "error": - bucket = this.#errors; - break; - default: - return; - } - // Two identical entries; ignore it - const signature = fragment.format(); - if (bucket.has(signature)) { - return; - } - bucket.set(signature, fragment); - }); - // If we do not have a constructor add a default - if (!this.deploy) { - defineProperties(this, { - deploy: ConstructorFragment.from("constructor()") - }); - } - defineProperties(this, { fallback, receive }); - } - /** - * Returns the entire Human-Readable ABI, as an array of - * signatures, optionally as %%minimal%% strings, which - * removes parameter names and unneceesary spaces. - */ - format(minimal) { - const format = (minimal ? "minimal" : "full"); - const abi = this.fragments.map((f) => f.format(format)); - return abi; - } - /** - * Return the JSON-encoded ABI. This is the format Solidiy - * returns. - */ - formatJson() { - const abi = this.fragments.map((f) => f.format("json")); - // We need to re-bundle the JSON fragments a bit - return JSON.stringify(abi.map((j) => JSON.parse(j))); - } - /** - * The ABI coder that will be used to encode and decode binary - * data. - */ - getAbiCoder() { - return AbiCoder.defaultAbiCoder(); - } - // Find a function definition by any means necessary (unless it is ambiguous) - #getFunction(key, values, forceUnique) { - // Selector - if (isHexString(key)) { - const selector = key.toLowerCase(); - for (const fragment of this.#functions.values()) { - if (selector === fragment.selector) { - return fragment; - } - } - return null; - } - // It is a bare name, look up the function (will return null if ambiguous) - if (key.indexOf("(") === -1) { - const matching = []; - for (const [name, fragment] of this.#functions) { - if (name.split("(" /* fix:) */)[0] === key) { - matching.push(fragment); - } - } - if (values) { - const lastValue = (values.length > 0) ? values[values.length - 1] : null; - let valueLength = values.length; - let allowOptions = true; - if (Typed.isTyped(lastValue) && lastValue.type === "overrides") { - allowOptions = false; - valueLength--; - } - // Remove all matches that don't have a compatible length. The args - // may contain an overrides, so the match may have n or n - 1 parameters - for (let i = matching.length - 1; i >= 0; i--) { - const inputs = matching[i].inputs.length; - if (inputs !== valueLength && (!allowOptions || inputs !== valueLength - 1)) { - matching.splice(i, 1); - } - } - // Remove all matches that don't match the Typed signature - for (let i = matching.length - 1; i >= 0; i--) { - const inputs = matching[i].inputs; - for (let j = 0; j < values.length; j++) { - // Not a typed value - if (!Typed.isTyped(values[j])) { - continue; - } - // We are past the inputs - if (j >= inputs.length) { - if (values[j].type === "overrides") { - continue; - } - matching.splice(i, 1); - break; - } - // Make sure the value type matches the input type - if (values[j].type !== inputs[j].baseType) { - matching.splice(i, 1); - break; - } - } - } - } - // We found a single matching signature with an overrides, but the - // last value is something that cannot possibly be an options - if (matching.length === 1 && values && values.length !== matching[0].inputs.length) { - const lastArg = values[values.length - 1]; - if (lastArg == null || Array.isArray(lastArg) || typeof (lastArg) !== "object") { - matching.splice(0, 1); - } - } - if (matching.length === 0) { - return null; - } - if (matching.length > 1 && forceUnique) { - const matchStr = matching.map((m) => JSON.stringify(m.format())).join(", "); - assertArgument(false, `ambiguous function description (i.e. matches ${matchStr})`, "key", key); - } - return matching[0]; - } - // Normalize the signature and lookup the function - const result = this.#functions.get(FunctionFragment.from(key).format()); - if (result) { - return result; - } - return null; - } - /** - * Get the function name for %%key%%, which may be a function selector, - * function name or function signature that belongs to the ABI. - */ - getFunctionName(key) { - const fragment = this.#getFunction(key, null, false); - assertArgument(fragment, "no matching function", "key", key); - return fragment.name; - } - /** - * Returns true if %%key%% (a function selector, function name or - * function signature) is present in the ABI. - * - * In the case of a function name, the name may be ambiguous, so - * accessing the [[FunctionFragment]] may require refinement. - */ - hasFunction(key) { - return !!this.#getFunction(key, null, false); - } - /** - * Get the [[FunctionFragment]] for %%key%%, which may be a function - * selector, function name or function signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple functions match by name. - * - * If the %%key%% and %%values%% do not refine to a single function in - * the ABI, this will throw. - */ - getFunction(key, values) { - return this.#getFunction(key, values || null, true); - } - /** - * Iterate over all functions, calling %%callback%%, sorted by their name. - */ - forEachFunction(callback) { - const names = Array.from(this.#functions.keys()); - names.sort((a, b) => a.localeCompare(b)); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - callback((this.#functions.get(name)), i); - } - } - // Find an event definition by any means necessary (unless it is ambiguous) - #getEvent(key, values, forceUnique) { - // EventTopic - if (isHexString(key)) { - const eventTopic = key.toLowerCase(); - for (const fragment of this.#events.values()) { - if (eventTopic === fragment.topicHash) { - return fragment; - } - } - return null; - } - // It is a bare name, look up the function (will return null if ambiguous) - if (key.indexOf("(") === -1) { - const matching = []; - for (const [name, fragment] of this.#events) { - if (name.split("(" /* fix:) */)[0] === key) { - matching.push(fragment); - } - } - if (values) { - // Remove all matches that don't have a compatible length. - for (let i = matching.length - 1; i >= 0; i--) { - if (matching[i].inputs.length < values.length) { - matching.splice(i, 1); - } - } - // Remove all matches that don't match the Typed signature - for (let i = matching.length - 1; i >= 0; i--) { - const inputs = matching[i].inputs; - for (let j = 0; j < values.length; j++) { - // Not a typed value - if (!Typed.isTyped(values[j])) { - continue; - } - // Make sure the value type matches the input type - if (values[j].type !== inputs[j].baseType) { - matching.splice(i, 1); - break; - } - } - } - } - if (matching.length === 0) { - return null; - } - if (matching.length > 1 && forceUnique) { - const matchStr = matching.map((m) => JSON.stringify(m.format())).join(", "); - assertArgument(false, `ambiguous event description (i.e. matches ${matchStr})`, "key", key); - } - return matching[0]; - } - // Normalize the signature and lookup the function - const result = this.#events.get(EventFragment.from(key).format()); - if (result) { - return result; - } - return null; - } - /** - * Get the event name for %%key%%, which may be a topic hash, - * event name or event signature that belongs to the ABI. - */ - getEventName(key) { - const fragment = this.#getEvent(key, null, false); - assertArgument(fragment, "no matching event", "key", key); - return fragment.name; - } - /** - * Returns true if %%key%% (an event topic hash, event name or - * event signature) is present in the ABI. - * - * In the case of an event name, the name may be ambiguous, so - * accessing the [[EventFragment]] may require refinement. - */ - hasEvent(key) { - return !!this.#getEvent(key, null, false); - } - /** - * Get the [[EventFragment]] for %%key%%, which may be a topic hash, - * event name or event signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple events match by name. - * - * If the %%key%% and %%values%% do not refine to a single event in - * the ABI, this will throw. - */ - getEvent(key, values) { - return this.#getEvent(key, values || null, true); - } - /** - * Iterate over all events, calling %%callback%%, sorted by their name. - */ - forEachEvent(callback) { - const names = Array.from(this.#events.keys()); - names.sort((a, b) => a.localeCompare(b)); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - callback((this.#events.get(name)), i); - } - } - /** - * Get the [[ErrorFragment]] for %%key%%, which may be an error - * selector, error name or error signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple errors match by name. - * - * If the %%key%% and %%values%% do not refine to a single error in - * the ABI, this will throw. - */ - getError(key, values) { - if (isHexString(key)) { - const selector = key.toLowerCase(); - if (BuiltinErrors[selector]) { - return ErrorFragment.from(BuiltinErrors[selector].signature); - } - for (const fragment of this.#errors.values()) { - if (selector === fragment.selector) { - return fragment; - } - } - return null; - } - // It is a bare name, look up the function (will return null if ambiguous) - if (key.indexOf("(") === -1) { - const matching = []; - for (const [name, fragment] of this.#errors) { - if (name.split("(" /* fix:) */)[0] === key) { - matching.push(fragment); - } - } - if (matching.length === 0) { - if (key === "Error") { - return ErrorFragment.from("error Error(string)"); - } - if (key === "Panic") { - return ErrorFragment.from("error Panic(uint256)"); - } - return null; - } - else if (matching.length > 1) { - const matchStr = matching.map((m) => JSON.stringify(m.format())).join(", "); - assertArgument(false, `ambiguous error description (i.e. ${matchStr})`, "name", key); - } - return matching[0]; - } - // Normalize the signature and lookup the function - key = ErrorFragment.from(key).format(); - if (key === "Error(string)") { - return ErrorFragment.from("error Error(string)"); - } - if (key === "Panic(uint256)") { - return ErrorFragment.from("error Panic(uint256)"); - } - const result = this.#errors.get(key); - if (result) { - return result; - } - return null; - } - /** - * Iterate over all errors, calling %%callback%%, sorted by their name. - */ - forEachError(callback) { - const names = Array.from(this.#errors.keys()); - names.sort((a, b) => a.localeCompare(b)); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - callback((this.#errors.get(name)), i); - } - } - // Get the 4-byte selector used by Solidity to identify a function - /* - getSelector(fragment: ErrorFragment | FunctionFragment): string { - if (typeof(fragment) === "string") { - const matches: Array = [ ]; - - try { matches.push(this.getFunction(fragment)); } catch (error) { } - try { matches.push(this.getError(fragment)); } catch (_) { } - - if (matches.length === 0) { - logger.throwArgumentError("unknown fragment", "key", fragment); - } else if (matches.length > 1) { - logger.throwArgumentError("ambiguous fragment matches function and error", "key", fragment); - } - - fragment = matches[0]; - } - - return dataSlice(id(fragment.format()), 0, 4); - } - */ - // Get the 32-byte topic hash used by Solidity to identify an event - /* - getEventTopic(fragment: EventFragment): string { - //if (typeof(fragment) === "string") { fragment = this.getEvent(eventFragment); } - return id(fragment.format()); - } - */ - _decodeParams(params, data) { - return this.#abiCoder.decode(params, data); - } - _encodeParams(params, values) { - return this.#abiCoder.encode(params, values); - } - /** - * Encodes a ``tx.data`` object for deploying the Contract with - * the %%values%% as the constructor arguments. - */ - encodeDeploy(values) { - return this._encodeParams(this.deploy.inputs, values || []); - } - /** - * Decodes the result %%data%% (e.g. from an ``eth_call``) for the - * specified error (see [[getError]] for valid values for - * %%key%%). - * - * Most developers should prefer the [[parseCallResult]] method instead, - * which will automatically detect a ``CALL_EXCEPTION`` and throw the - * corresponding error. - */ - decodeErrorResult(fragment, data) { - if (typeof (fragment) === "string") { - const f = this.getError(fragment); - assertArgument(f, "unknown error", "fragment", fragment); - fragment = f; - } - assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match error ${fragment.name}.`, "data", data); - return this._decodeParams(fragment.inputs, dataSlice(data, 4)); - } - /** - * Encodes the transaction revert data for a call result that - * reverted from the the Contract with the sepcified %%error%% - * (see [[getError]] for valid values for %%fragment%%) with the %%values%%. - * - * This is generally not used by most developers, unless trying to mock - * a result from a Contract. - */ - encodeErrorResult(fragment, values) { - if (typeof (fragment) === "string") { - const f = this.getError(fragment); - assertArgument(f, "unknown error", "fragment", fragment); - fragment = f; - } - return concat([ - fragment.selector, - this._encodeParams(fragment.inputs, values || []) - ]); - } - /** - * Decodes the %%data%% from a transaction ``tx.data`` for - * the function specified (see [[getFunction]] for valid values - * for %%fragment%%). - * - * Most developers should prefer the [[parseTransaction]] method - * instead, which will automatically detect the fragment. - */ - decodeFunctionData(fragment, data) { - if (typeof (fragment) === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match function ${fragment.name}.`, "data", data); - return this._decodeParams(fragment.inputs, dataSlice(data, 4)); - } - /** - * Encodes the ``tx.data`` for a transaction that calls the function - * specified (see [[getFunction]] for valid values for %%fragment%%) with - * the %%values%%. - */ - encodeFunctionData(fragment, values) { - if (typeof (fragment) === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - return concat([ - fragment.selector, - this._encodeParams(fragment.inputs, values || []) - ]); - } - /** - * Decodes the result %%data%% (e.g. from an ``eth_call``) for the - * specified function (see [[getFunction]] for valid values for - * %%key%%). - * - * Most developers should prefer the [[parseCallResult]] method instead, - * which will automatically detect a ``CALL_EXCEPTION`` and throw the - * corresponding error. - */ - decodeFunctionResult(fragment, data) { - if (typeof (fragment) === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - let message = "invalid length for result data"; - const bytes = getBytesCopy(data); - if ((bytes.length % 32) === 0) { - try { - return this.#abiCoder.decode(fragment.outputs, bytes); - } - catch (error) { - message = "could not decode result data"; - } - } - // Call returned data with no error, but the data is junk - assert(false, message, "BAD_DATA", { - value: hexlify(bytes), - info: { method: fragment.name, signature: fragment.format() } - }); - } - makeError(_data, tx) { - const data = getBytes(_data, "data"); - const error = AbiCoder.getBuiltinCallException("call", tx, data); - // Not a built-in error; try finding a custom error - const customPrefix = "execution reverted (unknown custom error)"; - if (error.message.startsWith(customPrefix)) { - const selector = hexlify(data.slice(0, 4)); - const ef = this.getError(selector); - if (ef) { - try { - const args = this.#abiCoder.decode(ef.inputs, data.slice(4)); - error.revert = { - name: ef.name, signature: ef.format(), args - }; - error.reason = error.revert.signature; - error.message = `execution reverted: ${error.reason}`; - } - catch (e) { - error.message = `execution reverted (coult not decode custom error)`; - } - } - } - // Add the invocation, if available - const parsed = this.parseTransaction(tx); - if (parsed) { - error.invocation = { - method: parsed.name, - signature: parsed.signature, - args: parsed.args - }; - } - return error; - } - /** - * Encodes the result data (e.g. from an ``eth_call``) for the - * specified function (see [[getFunction]] for valid values - * for %%fragment%%) with %%values%%. - * - * This is generally not used by most developers, unless trying to mock - * a result from a Contract. - */ - encodeFunctionResult(fragment, values) { - if (typeof (fragment) === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - return hexlify(this.#abiCoder.encode(fragment.outputs, values || [])); - } - /* - spelunk(inputs: Array, values: ReadonlyArray, processfunc: (type: string, value: any) => Promise): Promise> { - const promises: Array> = [ ]; - const process = function(type: ParamType, value: any): any { - if (type.baseType === "array") { - return descend(type.child - } - if (type. === "address") { - } - }; - - const descend = function (inputs: Array, values: ReadonlyArray) { - if (inputs.length !== values.length) { throw new Error("length mismatch"); } - - }; - - const result: Array = [ ]; - values.forEach((value, index) => { - if (value == null) { - topics.push(null); - } else if (param.baseType === "array" || param.baseType === "tuple") { - logger.throwArgumentError("filtering with tuples or arrays not supported", ("contract." + param.name), value); - } else if (Array.isArray(value)) { - topics.push(value.map((value) => encodeTopic(param, value))); - } else { - topics.push(encodeTopic(param, value)); - } - }); - } - */ - // Create the filter for the event with search criteria (e.g. for eth_filterLog) - encodeFilterTopics(fragment, values) { - if (typeof (fragment) === "string") { - const f = this.getEvent(fragment); - assertArgument(f, "unknown event", "eventFragment", fragment); - fragment = f; - } - assert(values.length <= fragment.inputs.length, `too many arguments for ${fragment.format()}`, "UNEXPECTED_ARGUMENT", { count: values.length, expectedCount: fragment.inputs.length }); - const topics = []; - if (!fragment.anonymous) { - topics.push(fragment.topicHash); - } - // @TODO: Use the coders for this; to properly support tuples, etc. - const encodeTopic = (param, value) => { - if (param.type === "string") { - return id(value); - } - else if (param.type === "bytes") { - return keccak256(hexlify(value)); - } - if (param.type === "bool" && typeof (value) === "boolean") { - value = (value ? "0x01" : "0x00"); - } - else if (param.type.match(/^u?int/)) { - value = toBeHex(value); // @TODO: Should this toTwos?? - } - else if (param.type.match(/^bytes/)) { - value = zeroPadBytes(value, 32); - } - else if (param.type === "address") { - // Check addresses are valid - this.#abiCoder.encode(["address"], [value]); - } - return zeroPadValue(hexlify(value), 32); - }; - values.forEach((value, index) => { - const param = fragment.inputs[index]; - if (!param.indexed) { - assertArgument(value == null, "cannot filter non-indexed parameters; must be null", ("contract." + param.name), value); - return; - } - if (value == null) { - topics.push(null); - } - else if (param.baseType === "array" || param.baseType === "tuple") { - assertArgument(false, "filtering with tuples or arrays not supported", ("contract." + param.name), value); - } - else if (Array.isArray(value)) { - topics.push(value.map((value) => encodeTopic(param, value))); - } - else { - topics.push(encodeTopic(param, value)); - } - }); - // Trim off trailing nulls - while (topics.length && topics[topics.length - 1] === null) { - topics.pop(); - } - return topics; - } - encodeEventLog(fragment, values) { - if (typeof (fragment) === "string") { - const f = this.getEvent(fragment); - assertArgument(f, "unknown event", "eventFragment", fragment); - fragment = f; - } - const topics = []; - const dataTypes = []; - const dataValues = []; - if (!fragment.anonymous) { - topics.push(fragment.topicHash); - } - assertArgument(values.length === fragment.inputs.length, "event arguments/values mismatch", "values", values); - fragment.inputs.forEach((param, index) => { - const value = values[index]; - if (param.indexed) { - if (param.type === "string") { - topics.push(id(value)); - } - else if (param.type === "bytes") { - topics.push(keccak256(value)); - } - else if (param.baseType === "tuple" || param.baseType === "array") { - // @TODO - throw new Error("not implemented"); - } - else { - topics.push(this.#abiCoder.encode([param.type], [value])); - } - } - else { - dataTypes.push(param); - dataValues.push(value); - } - }); - return { - data: this.#abiCoder.encode(dataTypes, dataValues), - topics: topics - }; - } - // Decode a filter for the event and the search criteria - decodeEventLog(fragment, data, topics) { - if (typeof (fragment) === "string") { - const f = this.getEvent(fragment); - assertArgument(f, "unknown event", "eventFragment", fragment); - fragment = f; - } - if (topics != null && !fragment.anonymous) { - const eventTopic = fragment.topicHash; - assertArgument(isHexString(topics[0], 32) && topics[0].toLowerCase() === eventTopic, "fragment/topic mismatch", "topics[0]", topics[0]); - topics = topics.slice(1); - } - const indexed = []; - const nonIndexed = []; - const dynamic = []; - fragment.inputs.forEach((param, index) => { - if (param.indexed) { - if (param.type === "string" || param.type === "bytes" || param.baseType === "tuple" || param.baseType === "array") { - indexed.push(ParamType.from({ type: "bytes32", name: param.name })); - dynamic.push(true); - } - else { - indexed.push(param); - dynamic.push(false); - } - } - else { - nonIndexed.push(param); - dynamic.push(false); - } - }); - const resultIndexed = (topics != null) ? this.#abiCoder.decode(indexed, concat(topics)) : null; - const resultNonIndexed = this.#abiCoder.decode(nonIndexed, data, true); - //const result: (Array & { [ key: string ]: any }) = [ ]; - const values = []; - const keys = []; - let nonIndexedIndex = 0, indexedIndex = 0; - fragment.inputs.forEach((param, index) => { - let value = null; - if (param.indexed) { - if (resultIndexed == null) { - value = new Indexed(null); - } - else if (dynamic[index]) { - value = new Indexed(resultIndexed[indexedIndex++]); - } - else { - try { - value = resultIndexed[indexedIndex++]; - } - catch (error) { - value = error; - } - } - } - else { - try { - value = resultNonIndexed[nonIndexedIndex++]; - } - catch (error) { - value = error; - } - } - values.push(value); - keys.push(param.name || null); - }); - return Result.fromItems(values, keys); - } - /** - * Parses a transaction, finding the matching function and extracts - * the parameter values along with other useful function details. - * - * If the matching function cannot be found, return null. - */ - parseTransaction(tx) { - const data = getBytes(tx.data, "tx.data"); - const value = getBigInt((tx.value != null) ? tx.value : 0, "tx.value"); - const fragment = this.getFunction(hexlify(data.slice(0, 4))); - if (!fragment) { - return null; - } - const args = this.#abiCoder.decode(fragment.inputs, data.slice(4)); - return new TransactionDescription(fragment, fragment.selector, args, value); - } - parseCallResult(data) { - throw new Error("@TODO"); - } - /** - * Parses a receipt log, finding the matching event and extracts - * the parameter values along with other useful event details. - * - * If the matching event cannot be found, returns null. - */ - parseLog(log) { - const fragment = this.getEvent(log.topics[0]); - if (!fragment || fragment.anonymous) { - return null; - } - // @TODO: If anonymous, and the only method, and the input count matches, should we parse? - // Probably not, because just because it is the only event in the ABI does - // not mean we have the full ABI; maybe just a fragment? - return new LogDescription(fragment, fragment.topicHash, this.decodeEventLog(fragment, log.data, log.topics)); - } - /** - * Parses a revert data, finding the matching error and extracts - * the parameter values along with other useful error details. - * - * If the matching error cannot be found, returns null. - */ - parseError(data) { - const hexData = hexlify(data); - const fragment = this.getError(dataSlice(hexData, 0, 4)); - if (!fragment) { - return null; - } - const args = this.#abiCoder.decode(fragment.inputs, dataSlice(hexData, 4)); - return new ErrorDescription(fragment, fragment.selector, args); - } - /** - * Creates a new [[Interface]] from the ABI %%value%%. - * - * The %%value%% may be provided as an existing [[Interface]] object, - * a JSON-encoded ABI or any Human-Readable ABI format. - */ - static from(value) { - // Already an Interface, which is immutable - if (value instanceof Interface) { - return value; - } - // JSON - if (typeof (value) === "string") { - return new Interface(JSON.parse(value)); - } - // An Interface; possibly from another v6 instance - if (typeof (value.formatJson) === "function") { - return new Interface(value.formatJson()); - } - // A legacy Interface; from an older version - if (typeof (value.format) === "function") { - return new Interface(value.format("json")); - } - // Array of fragments - return new Interface(value); - } - } - - //import { resolveAddress } from "@ethersproject/address"; - const BN_0$2 = BigInt(0); - // ----------------------- - function getValue(value) { - if (value == null) { - return null; - } - return value; - } - function toJson(value) { - if (value == null) { - return null; - } - return value.toString(); - } - // @TODO? implements Required - /** - * A **FeeData** wraps all the fee-related values associated with - * the network. - */ - class FeeData { - /** - * The gas price for legacy networks. - */ - gasPrice; - /** - * The maximum fee to pay per gas. - * - * The base fee per gas is defined by the network and based on - * congestion, increasing the cost during times of heavy load - * and lowering when less busy. - * - * The actual fee per gas will be the base fee for the block - * and the priority fee, up to the max fee per gas. - * - * This will be ``null`` on legacy networks (i.e. [pre-EIP-1559](link-eip-1559)) - */ - maxFeePerGas; - /** - * The additional amout to pay per gas to encourage a validator - * to include the transaction. - * - * The purpose of this is to compensate the validator for the - * adjusted risk for including a given transaction. - * - * This will be ``null`` on legacy networks (i.e. [pre-EIP-1559](link-eip-1559)) - */ - maxPriorityFeePerGas; - /** - * Creates a new FeeData for %%gasPrice%%, %%maxFeePerGas%% and - * %%maxPriorityFeePerGas%%. - */ - constructor(gasPrice, maxFeePerGas, maxPriorityFeePerGas) { - defineProperties(this, { - gasPrice: getValue(gasPrice), - maxFeePerGas: getValue(maxFeePerGas), - maxPriorityFeePerGas: getValue(maxPriorityFeePerGas) - }); - } - /** - * Returns a JSON-friendly value. - */ - toJSON() { - const { gasPrice, maxFeePerGas, maxPriorityFeePerGas } = this; - return { - _type: "FeeData", - gasPrice: toJson(gasPrice), - maxFeePerGas: toJson(maxFeePerGas), - maxPriorityFeePerGas: toJson(maxPriorityFeePerGas), - }; - } - } - /** - * Returns a copy of %%req%% with all properties coerced to their strict - * types. - */ - function copyRequest(req) { - const result = {}; - // These could be addresses, ENS names or Addressables - if (req.to) { - result.to = req.to; - } - if (req.from) { - result.from = req.from; - } - if (req.data) { - result.data = hexlify(req.data); - } - const bigIntKeys = "chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/); - for (const key of bigIntKeys) { - if (!(key in req) || req[key] == null) { - continue; - } - result[key] = getBigInt(req[key], `request.${key}`); - } - const numberKeys = "type,nonce".split(/,/); - for (const key of numberKeys) { - if (!(key in req) || req[key] == null) { - continue; - } - result[key] = getNumber(req[key], `request.${key}`); - } - if (req.accessList) { - result.accessList = accessListify(req.accessList); - } - if (req.authorizationList) { - result.authorizationList = req.authorizationList.slice(); - } - if ("blockTag" in req) { - result.blockTag = req.blockTag; - } - if ("enableCcipRead" in req) { - result.enableCcipRead = !!req.enableCcipRead; - } - if ("customData" in req) { - result.customData = req.customData; - } - if ("blobVersionedHashes" in req && req.blobVersionedHashes) { - result.blobVersionedHashes = req.blobVersionedHashes.slice(); - } - if ("kzg" in req) { - result.kzg = req.kzg; - } - if ("blobWrapperVersion" in req) { - result.blobWrapperVersion = req.blobWrapperVersion; - } - if ("blobs" in req && req.blobs) { - result.blobs = req.blobs.map((b) => { - if (isBytesLike(b)) { - return hexlify(b); - } - return Object.assign({}, b); - }); - } - return result; - } - /** - * A **Block** represents the data associated with a full block on - * Ethereum. - */ - class Block { - /** - * The provider connected to the block used to fetch additional details - * if necessary. - */ - provider; - /** - * The block number, sometimes called the block height. This is a - * sequential number that is one higher than the parent block. - */ - number; - /** - * The block hash. - * - * This hash includes all properties, so can be safely used to identify - * an exact set of block properties. - */ - hash; - /** - * The timestamp for this block, which is the number of seconds since - * epoch that this block was included. - */ - timestamp; - /** - * The block hash of the parent block. - */ - parentHash; - /** - * The hash tree root of the parent beacon block for the given - * execution block. See [[link-eip-4788]]. - */ - parentBeaconBlockRoot; - /** - * The nonce. - * - * On legacy networks, this is the random number inserted which - * permitted the difficulty target to be reached. - */ - nonce; - /** - * The difficulty target. - * - * On legacy networks, this is the proof-of-work target required - * for a block to meet the protocol rules to be included. - * - * On modern networks, this is a random number arrived at using - * randao. @TODO: Find links? - */ - difficulty; - /** - * The total gas limit for this block. - */ - gasLimit; - /** - * The total gas used in this block. - */ - gasUsed; - /** - * The root hash for the global state after applying changes - * in this block. - */ - stateRoot; - /** - * The hash of the transaction receipts trie. - */ - receiptsRoot; - /** - * The total amount of blob gas consumed by the transactions - * within the block. See [[link-eip-4844]]. - */ - blobGasUsed; - /** - * The running total of blob gas consumed in excess of the - * target, prior to the block. See [[link-eip-4844]]. - */ - excessBlobGas; - /** - * The miner coinbase address, wihch receives any subsidies for - * including this block. - */ - miner; - /** - * The latest RANDAO mix of the post beacon state of - * the previous block. - */ - prevRandao; - /** - * Any extra data the validator wished to include. - */ - extraData; - /** - * The base fee per gas that all transactions in this block were - * charged. - * - * This adjusts after each block, depending on how congested the network - * is. - */ - baseFeePerGas; - #transactions; - /** - * Create a new **Block** object. - * - * This should generally not be necessary as the unless implementing a - * low-level library. - */ - constructor(block, provider) { - this.#transactions = block.transactions.map((tx) => { - if (typeof (tx) !== "string") { - return new TransactionResponse(tx, provider); - } - return tx; - }); - defineProperties(this, { - provider, - hash: getValue(block.hash), - number: block.number, - timestamp: block.timestamp, - parentHash: block.parentHash, - parentBeaconBlockRoot: block.parentBeaconBlockRoot, - nonce: block.nonce, - difficulty: block.difficulty, - gasLimit: block.gasLimit, - gasUsed: block.gasUsed, - blobGasUsed: block.blobGasUsed, - excessBlobGas: block.excessBlobGas, - miner: block.miner, - prevRandao: getValue(block.prevRandao), - extraData: block.extraData, - baseFeePerGas: getValue(block.baseFeePerGas), - stateRoot: block.stateRoot, - receiptsRoot: block.receiptsRoot, - }); - } - /** - * Returns the list of transaction hashes, in the order - * they were executed within the block. - */ - get transactions() { - return this.#transactions.map((tx) => { - if (typeof (tx) === "string") { - return tx; - } - return tx.hash; - }); - } - /** - * Returns the complete transactions, in the order they - * were executed within the block. - * - * This is only available for blocks which prefetched - * transactions, by passing ``true`` to %%prefetchTxs%% - * into [[Provider-getBlock]]. - */ - get prefetchedTransactions() { - const txs = this.#transactions.slice(); - // Doesn't matter... - if (txs.length === 0) { - return []; - } - // Make sure we prefetched the transactions - assert(typeof (txs[0]) === "object", "transactions were not prefetched with block request", "UNSUPPORTED_OPERATION", { - operation: "transactionResponses()" - }); - return txs; - } - /** - * Returns a JSON-friendly value. - */ - toJSON() { - const { baseFeePerGas, difficulty, extraData, gasLimit, gasUsed, hash, miner, prevRandao, nonce, number, parentHash, parentBeaconBlockRoot, stateRoot, receiptsRoot, timestamp, transactions } = this; - return { - _type: "Block", - baseFeePerGas: toJson(baseFeePerGas), - difficulty: toJson(difficulty), - extraData, - gasLimit: toJson(gasLimit), - gasUsed: toJson(gasUsed), - blobGasUsed: toJson(this.blobGasUsed), - excessBlobGas: toJson(this.excessBlobGas), - hash, miner, prevRandao, nonce, number, parentHash, timestamp, - parentBeaconBlockRoot, stateRoot, receiptsRoot, - transactions, - }; - } - [Symbol.iterator]() { - let index = 0; - const txs = this.transactions; - return { - next: () => { - if (index < this.length) { - return { - value: txs[index++], done: false - }; - } - return { value: undefined, done: true }; - } - }; - } - /** - * The number of transactions in this block. - */ - get length() { return this.#transactions.length; } - /** - * The [[link-js-date]] this block was included at. - */ - get date() { - if (this.timestamp == null) { - return null; - } - return new Date(this.timestamp * 1000); - } - /** - * Get the transaction at %%indexe%% within this block. - */ - async getTransaction(indexOrHash) { - // Find the internal value by its index or hash - let tx = undefined; - if (typeof (indexOrHash) === "number") { - tx = this.#transactions[indexOrHash]; - } - else { - const hash = indexOrHash.toLowerCase(); - for (const v of this.#transactions) { - if (typeof (v) === "string") { - if (v !== hash) { - continue; - } - tx = v; - break; - } - else { - if (v.hash !== hash) { - continue; - } - tx = v; - break; - } - } - } - if (tx == null) { - throw new Error("no such tx"); - } - if (typeof (tx) === "string") { - return (await this.provider.getTransaction(tx)); - } - else { - return tx; - } - } - /** - * If a **Block** was fetched with a request to include the transactions - * this will allow synchronous access to those transactions. - * - * If the transactions were not prefetched, this will throw. - */ - getPrefetchedTransaction(indexOrHash) { - const txs = this.prefetchedTransactions; - if (typeof (indexOrHash) === "number") { - return txs[indexOrHash]; - } - indexOrHash = indexOrHash.toLowerCase(); - for (const tx of txs) { - if (tx.hash === indexOrHash) { - return tx; - } - } - assertArgument(false, "no matching transaction", "indexOrHash", indexOrHash); - } - /** - * Returns true if this block been mined. This provides a type guard - * for all properties on a [[MinedBlock]]. - */ - isMined() { return !!this.hash; } - /** - * Returns true if this block is an [[link-eip-2930]] block. - */ - isLondon() { - return !!this.baseFeePerGas; - } - /** - * @_ignore: - */ - orphanedEvent() { - if (!this.isMined()) { - throw new Error(""); - } - return createOrphanedBlockFilter(this); - } - } - ////////////////////// - // Log - /** - * A **Log** in Ethereum represents an event that has been included in a - * transaction using the ``LOG*`` opcodes, which are most commonly used by - * Solidity's emit for announcing events. - */ - class Log { - /** - * The provider connected to the log used to fetch additional details - * if necessary. - */ - provider; - /** - * The transaction hash of the transaction this log occurred in. Use the - * [[Log-getTransaction]] to get the [[TransactionResponse]]. - */ - transactionHash; - /** - * The block hash of the block this log occurred in. Use the - * [[Log-getBlock]] to get the [[Block]]. - */ - blockHash; - /** - * The block number of the block this log occurred in. It is preferred - * to use the [[Block-hash]] when fetching the related [[Block]], - * since in the case of an orphaned block, the block at that height may - * have changed. - */ - blockNumber; - /** - * If the **Log** represents a block that was removed due to an orphaned - * block, this will be true. - * - * This can only happen within an orphan event listener. - */ - removed; - /** - * The address of the contract that emitted this log. - */ - address; - /** - * The data included in this log when it was emitted. - */ - data; - /** - * The indexed topics included in this log when it was emitted. - * - * All topics are included in the bloom filters, so they can be - * efficiently filtered using the [[Provider-getLogs]] method. - */ - topics; - /** - * The index within the block this log occurred at. This is generally - * not useful to developers, but can be used with the various roots - * to proof inclusion within a block. - */ - index; - /** - * The index within the transaction of this log. - */ - transactionIndex; - /** - * @_ignore: - */ - constructor(log, provider) { - this.provider = provider; - const topics = Object.freeze(log.topics.slice()); - defineProperties(this, { - transactionHash: log.transactionHash, - blockHash: log.blockHash, - blockNumber: log.blockNumber, - removed: log.removed, - address: log.address, - data: log.data, - topics, - index: log.index, - transactionIndex: log.transactionIndex, - }); - } - /** - * Returns a JSON-compatible object. - */ - toJSON() { - const { address, blockHash, blockNumber, data, index, removed, topics, transactionHash, transactionIndex } = this; - return { - _type: "log", - address, blockHash, blockNumber, data, index, - removed, topics, transactionHash, transactionIndex - }; - } - /** - * Returns the block that this log occurred in. - */ - async getBlock() { - const block = await this.provider.getBlock(this.blockHash); - assert(!!block, "failed to find transaction", "UNKNOWN_ERROR", {}); - return block; - } - /** - * Returns the transaction that this log occurred in. - */ - async getTransaction() { - const tx = await this.provider.getTransaction(this.transactionHash); - assert(!!tx, "failed to find transaction", "UNKNOWN_ERROR", {}); - return tx; - } - /** - * Returns the transaction receipt fot the transaction that this - * log occurred in. - */ - async getTransactionReceipt() { - const receipt = await this.provider.getTransactionReceipt(this.transactionHash); - assert(!!receipt, "failed to find transaction receipt", "UNKNOWN_ERROR", {}); - return receipt; - } - /** - * @_ignore: - */ - removedEvent() { - return createRemovedLogFilter(this); - } - } - ////////////////////// - // Transaction Receipt - /* - export interface LegacyTransactionReceipt { - byzantium: false; - status: null; - root: string; - } - - export interface ByzantiumTransactionReceipt { - byzantium: true; - status: number; - root: null; - } - */ - /** - * A **TransactionReceipt** includes additional information about a - * transaction that is only available after it has been mined. - */ - class TransactionReceipt { - /** - * The provider connected to the log used to fetch additional details - * if necessary. - */ - provider; - /** - * The address the transaction was sent to. - */ - to; - /** - * The sender of the transaction. - */ - from; - /** - * The address of the contract if the transaction was directly - * responsible for deploying one. - * - * This is non-null **only** if the ``to`` is empty and the ``data`` - * was successfully executed as initcode. - */ - contractAddress; - /** - * The transaction hash. - */ - hash; - /** - * The index of this transaction within the block transactions. - */ - index; - /** - * The block hash of the [[Block]] this transaction was included in. - */ - blockHash; - /** - * The block number of the [[Block]] this transaction was included in. - */ - blockNumber; - /** - * The bloom filter bytes that represent all logs that occurred within - * this transaction. This is generally not useful for most developers, - * but can be used to validate the included logs. - */ - logsBloom; - /** - * The actual amount of gas used by this transaction. - * - * When creating a transaction, the amount of gas that will be used can - * only be approximated, but the sender must pay the gas fee for the - * entire gas limit. After the transaction, the difference is refunded. - */ - gasUsed; - /** - * The gas used for BLObs. See [[link-eip-4844]]. - */ - blobGasUsed; - /** - * The amount of gas used by all transactions within the block for this - * and all transactions with a lower ``index``. - * - * This is generally not useful for developers but can be used to - * validate certain aspects of execution. - */ - cumulativeGasUsed; - /** - * The actual gas price used during execution. - * - * Due to the complexity of [[link-eip-1559]] this value can only - * be caluclated after the transaction has been mined, snce the base - * fee is protocol-enforced. - */ - gasPrice; - /** - * The price paid per BLOB in gas. See [[link-eip-4844]]. - */ - blobGasPrice; - /** - * The [[link-eip-2718]] transaction type. - */ - type; - //readonly byzantium!: boolean; - /** - * The status of this transaction, indicating success (i.e. ``1``) or - * a revert (i.e. ``0``). - * - * This is available in post-byzantium blocks, but some backends may - * backfill this value. - */ - status; - /** - * The root hash of this transaction. - * - * This is no present and was only included in pre-byzantium blocks, but - * could be used to validate certain parts of the receipt. - */ - root; - #logs; - /** - * @_ignore: - */ - constructor(tx, provider) { - this.#logs = Object.freeze(tx.logs.map((log) => { - return new Log(log, provider); - })); - let gasPrice = BN_0$2; - if (tx.effectiveGasPrice != null) { - gasPrice = tx.effectiveGasPrice; - } - else if (tx.gasPrice != null) { - gasPrice = tx.gasPrice; - } - defineProperties(this, { - provider, - to: tx.to, - from: tx.from, - contractAddress: tx.contractAddress, - hash: tx.hash, - index: tx.index, - blockHash: tx.blockHash, - blockNumber: tx.blockNumber, - logsBloom: tx.logsBloom, - gasUsed: tx.gasUsed, - cumulativeGasUsed: tx.cumulativeGasUsed, - blobGasUsed: tx.blobGasUsed, - gasPrice, - blobGasPrice: tx.blobGasPrice, - type: tx.type, - //byzantium: tx.byzantium, - status: tx.status, - root: tx.root - }); - } - /** - * The logs for this transaction. - */ - get logs() { return this.#logs; } - /** - * Returns a JSON-compatible representation. - */ - toJSON() { - const { to, from, contractAddress, hash, index, blockHash, blockNumber, logsBloom, logs, //byzantium, - status, root } = this; - return { - _type: "TransactionReceipt", - blockHash, blockNumber, - //byzantium, - contractAddress, - cumulativeGasUsed: toJson(this.cumulativeGasUsed), - from, - gasPrice: toJson(this.gasPrice), - blobGasUsed: toJson(this.blobGasUsed), - blobGasPrice: toJson(this.blobGasPrice), - gasUsed: toJson(this.gasUsed), - hash, index, logs, logsBloom, root, status, to - }; - } - /** - * @_ignore: - */ - get length() { return this.logs.length; } - [Symbol.iterator]() { - let index = 0; - return { - next: () => { - if (index < this.length) { - return { value: this.logs[index++], done: false }; - } - return { value: undefined, done: true }; - } - }; - } - /** - * The total fee for this transaction, in wei. - */ - get fee() { - return this.gasUsed * this.gasPrice; - } - /** - * Resolves to the block this transaction occurred in. - */ - async getBlock() { - const block = await this.provider.getBlock(this.blockHash); - if (block == null) { - throw new Error("TODO"); - } - return block; - } - /** - * Resolves to the transaction this transaction occurred in. - */ - async getTransaction() { - const tx = await this.provider.getTransaction(this.hash); - if (tx == null) { - throw new Error("TODO"); - } - return tx; - } - /** - * Resolves to the return value of the execution of this transaction. - * - * Support for this feature is limited, as it requires an archive node - * with the ``debug_`` or ``trace_`` API enabled. - */ - async getResult() { - return (await this.provider.getTransactionResult(this.hash)); - } - /** - * Resolves to the number of confirmations this transaction has. - */ - async confirmations() { - return (await this.provider.getBlockNumber()) - this.blockNumber + 1; - } - /** - * @_ignore: - */ - removedEvent() { - return createRemovedTransactionFilter(this); - } - /** - * @_ignore: - */ - reorderedEvent(other) { - assert(!other || other.isMined(), "unmined 'other' transction cannot be orphaned", "UNSUPPORTED_OPERATION", { operation: "reorderedEvent(other)" }); - return createReorderedTransactionFilter(this, other); - } - } - /** - * A **TransactionResponse** includes all properties about a transaction - * that was sent to the network, which may or may not be included in a - * block. - * - * The [[TransactionResponse-isMined]] can be used to check if the - * transaction has been mined as well as type guard that the otherwise - * possibly ``null`` properties are defined. - */ - class TransactionResponse { - /** - * The provider this is connected to, which will influence how its - * methods will resolve its async inspection methods. - */ - provider; - /** - * The block number of the block that this transaction was included in. - * - * This is ``null`` for pending transactions. - */ - blockNumber; - /** - * The blockHash of the block that this transaction was included in. - * - * This is ``null`` for pending transactions. - */ - blockHash; - /** - * The index within the block that this transaction resides at. - */ - index; - /** - * The transaction hash. - */ - hash; - /** - * The [[link-eip-2718]] transaction envelope type. This is - * ``0`` for legacy transactions types. - */ - type; - /** - * The receiver of this transaction. - * - * If ``null``, then the transaction is an initcode transaction. - * This means the result of executing the [[data]] will be deployed - * as a new contract on chain (assuming it does not revert) and the - * address may be computed using [[getCreateAddress]]. - */ - to; - /** - * The sender of this transaction. It is implicitly computed - * from the transaction pre-image hash (as the digest) and the - * [[signature]] using ecrecover. - */ - from; - /** - * The nonce, which is used to prevent replay attacks and offer - * a method to ensure transactions from a given sender are explicitly - * ordered. - * - * When sending a transaction, this must be equal to the number of - * transactions ever sent by [[from]]. - */ - nonce; - /** - * The maximum units of gas this transaction can consume. If execution - * exceeds this, the entries transaction is reverted and the sender - * is charged for the full amount, despite not state changes being made. - */ - gasLimit; - /** - * The gas price can have various values, depending on the network. - * - * In modern networks, for transactions that are included this is - * the //effective gas price// (the fee per gas that was actually - * charged), while for transactions that have not been included yet - * is the [[maxFeePerGas]]. - * - * For legacy transactions, or transactions on legacy networks, this - * is the fee that will be charged per unit of gas the transaction - * consumes. - */ - gasPrice; - /** - * The maximum priority fee (per unit of gas) to allow a - * validator to charge the sender. This is inclusive of the - * [[maxFeeFeePerGas]]. - */ - maxPriorityFeePerGas; - /** - * The maximum fee (per unit of gas) to allow this transaction - * to charge the sender. - */ - maxFeePerGas; - /** - * The [[link-eip-4844]] max fee per BLOb gas. - */ - maxFeePerBlobGas; - /** - * The data. - */ - data; - /** - * The value, in wei. Use [[formatEther]] to format this value - * as ether. - */ - value; - /** - * The chain ID. - */ - chainId; - /** - * The signature. - */ - signature; - /** - * The [[link-eip-2930]] access list for transaction types that - * support it, otherwise ``null``. - */ - accessList; - /** - * The [[link-eip-4844]] BLOb versioned hashes. - */ - blobVersionedHashes; - /** - * The [[link-eip-7702]] authorizations (if any). - */ - authorizationList; - #startBlock; - /** - * @_ignore: - */ - constructor(tx, provider) { - this.provider = provider; - this.blockNumber = (tx.blockNumber != null) ? tx.blockNumber : null; - this.blockHash = (tx.blockHash != null) ? tx.blockHash : null; - this.hash = tx.hash; - this.index = tx.index; - this.type = tx.type; - this.from = tx.from; - this.to = tx.to || null; - this.gasLimit = tx.gasLimit; - this.nonce = tx.nonce; - this.data = tx.data; - this.value = tx.value; - this.gasPrice = tx.gasPrice; - this.maxPriorityFeePerGas = (tx.maxPriorityFeePerGas != null) ? tx.maxPriorityFeePerGas : null; - this.maxFeePerGas = (tx.maxFeePerGas != null) ? tx.maxFeePerGas : null; - this.maxFeePerBlobGas = (tx.maxFeePerBlobGas != null) ? tx.maxFeePerBlobGas : null; - this.chainId = tx.chainId; - this.signature = tx.signature; - this.accessList = (tx.accessList != null) ? tx.accessList : null; - this.blobVersionedHashes = (tx.blobVersionedHashes != null) ? tx.blobVersionedHashes : null; - this.authorizationList = (tx.authorizationList != null) ? tx.authorizationList : null; - this.#startBlock = -1; - } - /** - * Returns a JSON-compatible representation of this transaction. - */ - toJSON() { - const { blockNumber, blockHash, index, hash, type, to, from, nonce, data, signature, accessList, blobVersionedHashes } = this; - return { - _type: "TransactionResponse", - accessList, blockNumber, blockHash, - blobVersionedHashes, - chainId: toJson(this.chainId), - data, from, - gasLimit: toJson(this.gasLimit), - gasPrice: toJson(this.gasPrice), - hash, - maxFeePerGas: toJson(this.maxFeePerGas), - maxPriorityFeePerGas: toJson(this.maxPriorityFeePerGas), - maxFeePerBlobGas: toJson(this.maxFeePerBlobGas), - nonce, signature, to, index, type, - value: toJson(this.value), - }; - } - /** - * Resolves to the Block that this transaction was included in. - * - * This will return null if the transaction has not been included yet. - */ - async getBlock() { - let blockNumber = this.blockNumber; - if (blockNumber == null) { - const tx = await this.getTransaction(); - if (tx) { - blockNumber = tx.blockNumber; - } - } - if (blockNumber == null) { - return null; - } - const block = this.provider.getBlock(blockNumber); - if (block == null) { - throw new Error("TODO"); - } - return block; - } - /** - * Resolves to this transaction being re-requested from the - * provider. This can be used if you have an unmined transaction - * and wish to get an up-to-date populated instance. - */ - async getTransaction() { - return this.provider.getTransaction(this.hash); - } - /** - * Resolve to the number of confirmations this transaction has. - */ - async confirmations() { - if (this.blockNumber == null) { - const { tx, blockNumber } = await resolveProperties({ - tx: this.getTransaction(), - blockNumber: this.provider.getBlockNumber() - }); - // Not mined yet... - if (tx == null || tx.blockNumber == null) { - return 0; - } - return blockNumber - tx.blockNumber + 1; - } - const blockNumber = await this.provider.getBlockNumber(); - return blockNumber - this.blockNumber + 1; - } - /** - * Resolves once this transaction has been mined and has - * %%confirms%% blocks including it (default: ``1``) with an - * optional %%timeout%%. - * - * This can resolve to ``null`` only if %%confirms%% is ``0`` - * and the transaction has not been mined, otherwise this will - * wait until enough confirmations have completed. - */ - async wait(_confirms, _timeout) { - const confirms = (_confirms == null) ? 1 : _confirms; - const timeout = (_timeout == null) ? 0 : _timeout; - let startBlock = this.#startBlock; - let nextScan = -1; - let stopScanning = (startBlock === -1) ? true : false; - const checkReplacement = async () => { - // Get the current transaction count for this sender - if (stopScanning) { - return null; - } - const { blockNumber, nonce } = await resolveProperties({ - blockNumber: this.provider.getBlockNumber(), - nonce: this.provider.getTransactionCount(this.from) - }); - // No transaction or our nonce has not been mined yet; but we - // can start scanning later when we do start - if (nonce < this.nonce) { - startBlock = blockNumber; - return; - } - // We were mined; no replacement - if (stopScanning) { - return null; - } - const mined = await this.getTransaction(); - if (mined && mined.blockNumber != null) { - return; - } - // We were replaced; start scanning for that transaction - // Starting to scan; look back a few extra blocks for safety - if (nextScan === -1) { - nextScan = startBlock - 3; - if (nextScan < this.#startBlock) { - nextScan = this.#startBlock; - } - } - while (nextScan <= blockNumber) { - // Get the next block to scan - if (stopScanning) { - return null; - } - const block = await this.provider.getBlock(nextScan, true); - // This should not happen; but we'll try again shortly - if (block == null) { - return; - } - // We were mined; no replacement - for (const hash of block) { - if (hash === this.hash) { - return; - } - } - // Search for the transaction that replaced us - for (let i = 0; i < block.length; i++) { - const tx = await block.getTransaction(i); - if (tx.from === this.from && tx.nonce === this.nonce) { - // Get the receipt - if (stopScanning) { - return null; - } - const receipt = await this.provider.getTransactionReceipt(tx.hash); - // This should not happen; but we'll try again shortly - if (receipt == null) { - return; - } - // We will retry this on the next block (this case could be optimized) - if ((blockNumber - receipt.blockNumber + 1) < confirms) { - return; - } - // The reason we were replaced - let reason = "replaced"; - if (tx.data === this.data && tx.to === this.to && tx.value === this.value) { - reason = "repriced"; - } - else if (tx.data === "0x" && tx.from === tx.to && tx.value === BN_0$2) { - reason = "cancelled"; - } - assert(false, "transaction was replaced", "TRANSACTION_REPLACED", { - cancelled: (reason === "replaced" || reason === "cancelled"), - reason, - replacement: tx.replaceableTransaction(startBlock), - hash: tx.hash, - receipt - }); - } - } - nextScan++; - } - return; - }; - const checkReceipt = (receipt) => { - if (receipt == null || receipt.status !== 0) { - return receipt; - } - assert(false, "transaction execution reverted", "CALL_EXCEPTION", { - action: "sendTransaction", - data: null, reason: null, invocation: null, revert: null, - transaction: { - to: receipt.to, - from: receipt.from, - data: "" // @TODO: in v7, split out sendTransaction properties - }, receipt - }); - }; - const receipt = await this.provider.getTransactionReceipt(this.hash); - if (confirms === 0) { - return checkReceipt(receipt); - } - if (receipt) { - if (confirms === 1 || (await receipt.confirmations()) >= confirms) { - return checkReceipt(receipt); - } - } - else { - // Check for a replacement; throws if a replacement was found - await checkReplacement(); - // Allow null only when the confirms is 0 - if (confirms === 0) { - return null; - } - } - const waiter = new Promise((resolve, reject) => { - // List of things to cancel when we have a result (one way or the other) - const cancellers = []; - const cancel = () => { cancellers.forEach((c) => c()); }; - // On cancel, stop scanning for replacements - cancellers.push(() => { stopScanning = true; }); - // Set up any timeout requested - if (timeout > 0) { - const timer = setTimeout(() => { - cancel(); - reject(makeError("wait for transaction timeout", "TIMEOUT")); - }, timeout); - cancellers.push(() => { clearTimeout(timer); }); - } - const txListener = async (receipt) => { - // Done; return it! - if ((await receipt.confirmations()) >= confirms) { - cancel(); - try { - resolve(checkReceipt(receipt)); - } - catch (error) { - reject(error); - } - } - }; - cancellers.push(() => { this.provider.off(this.hash, txListener); }); - this.provider.on(this.hash, txListener); - // We support replacement detection; start checking - if (startBlock >= 0) { - const replaceListener = async () => { - try { - // Check for a replacement; this throws only if one is found - await checkReplacement(); - } - catch (error) { - // We were replaced (with enough confirms); re-throw the error - if (isError(error, "TRANSACTION_REPLACED")) { - cancel(); - reject(error); - return; - } - } - // Rescheudle a check on the next block - if (!stopScanning) { - this.provider.once("block", replaceListener); - } - }; - cancellers.push(() => { this.provider.off("block", replaceListener); }); - this.provider.once("block", replaceListener); - } - }); - return await waiter; - } - /** - * Returns ``true`` if this transaction has been included. - * - * This is effective only as of the time the TransactionResponse - * was instantiated. To get up-to-date information, use - * [[getTransaction]]. - * - * This provides a Type Guard that this transaction will have - * non-null property values for properties that are null for - * unmined transactions. - */ - isMined() { - return (this.blockHash != null); - } - /** - * Returns true if the transaction is a legacy (i.e. ``type == 0``) - * transaction. - * - * This provides a Type Guard that this transaction will have - * the ``null``-ness for hardfork-specific properties set correctly. - */ - isLegacy() { - return (this.type === 0); - } - /** - * Returns true if the transaction is a Berlin (i.e. ``type == 1``) - * transaction. See [[link-eip-2070]]. - * - * This provides a Type Guard that this transaction will have - * the ``null``-ness for hardfork-specific properties set correctly. - */ - isBerlin() { - return (this.type === 1); - } - /** - * Returns true if the transaction is a London (i.e. ``type == 2``) - * transaction. See [[link-eip-1559]]. - * - * This provides a Type Guard that this transaction will have - * the ``null``-ness for hardfork-specific properties set correctly. - */ - isLondon() { - return (this.type === 2); - } - /** - * Returns true if hte transaction is a Cancun (i.e. ``type == 3``) - * transaction. See [[link-eip-4844]]. - */ - isCancun() { - return (this.type === 3); - } - /** - * Returns a filter which can be used to listen for orphan events - * that evict this transaction. - */ - removedEvent() { - assert(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); - return createRemovedTransactionFilter(this); - } - /** - * Returns a filter which can be used to listen for orphan events - * that re-order this event against %%other%%. - */ - reorderedEvent(other) { - assert(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); - assert(!other || other.isMined(), "unmined 'other' transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); - return createReorderedTransactionFilter(this, other); - } - /** - * Returns a new TransactionResponse instance which has the ability to - * detect (and throw an error) if the transaction is replaced, which - * will begin scanning at %%startBlock%%. - * - * This should generally not be used by developers and is intended - * primarily for internal use. Setting an incorrect %%startBlock%% can - * have devastating performance consequences if used incorrectly. - */ - replaceableTransaction(startBlock) { - assertArgument(Number.isInteger(startBlock) && startBlock >= 0, "invalid startBlock", "startBlock", startBlock); - const tx = new TransactionResponse(this, this.provider); - tx.#startBlock = startBlock; - return tx; - } - } - function createOrphanedBlockFilter(block) { - return { orphan: "drop-block", hash: block.hash, number: block.number }; - } - function createReorderedTransactionFilter(tx, other) { - return { orphan: "reorder-transaction", tx, other }; - } - function createRemovedTransactionFilter(tx) { - return { orphan: "drop-transaction", tx }; - } - function createRemovedLogFilter(log) { - return { orphan: "drop-log", log: { - transactionHash: log.transactionHash, - blockHash: log.blockHash, - blockNumber: log.blockNumber, - address: log.address, - data: log.data, - topics: Object.freeze(log.topics.slice()), - index: log.index - } }; - } - - // import from provider.ts instead of index.ts to prevent circular dep - // from EtherscanProvider - /** - * An **EventLog** contains additional properties parsed from the [[Log]]. - */ - class EventLog extends Log { - /** - * The Contract Interface. - */ - interface; - /** - * The matching event. - */ - fragment; - /** - * The parsed arguments passed to the event by ``emit``. - */ - args; - /** - * @_ignore: - */ - constructor(log, iface, fragment) { - super(log, log.provider); - const args = iface.decodeEventLog(fragment, log.data, log.topics); - defineProperties(this, { args, fragment, interface: iface }); - } - /** - * The name of the event. - */ - get eventName() { return this.fragment.name; } - /** - * The signature of the event. - */ - get eventSignature() { return this.fragment.format(); } - } - /** - * An **EventLog** contains additional properties parsed from the [[Log]]. - */ - class UndecodedEventLog extends Log { - /** - * The error encounted when trying to decode the log. - */ - error; - /** - * @_ignore: - */ - constructor(log, error) { - super(log, log.provider); - defineProperties(this, { error }); - } - } - /** - * A **ContractTransactionReceipt** includes the parsed logs from a - * [[TransactionReceipt]]. - */ - class ContractTransactionReceipt extends TransactionReceipt { - #iface; - /** - * @_ignore: - */ - constructor(iface, provider, tx) { - super(tx, provider); - this.#iface = iface; - } - /** - * The parsed logs for any [[Log]] which has a matching event in the - * Contract ABI. - */ - get logs() { - return super.logs.map((log) => { - const fragment = log.topics.length ? this.#iface.getEvent(log.topics[0]) : null; - if (fragment) { - try { - return new EventLog(log, this.#iface, fragment); - } - catch (error) { - return new UndecodedEventLog(log, error); - } - } - return log; - }); - } - } - /** - * A **ContractTransactionResponse** will return a - * [[ContractTransactionReceipt]] when waited on. - */ - class ContractTransactionResponse extends TransactionResponse { - #iface; - /** - * @_ignore: - */ - constructor(iface, provider, tx) { - super(tx, provider); - this.#iface = iface; - } - /** - * Resolves once this transaction has been mined and has - * %%confirms%% blocks including it (default: ``1``) with an - * optional %%timeout%%. - * - * This can resolve to ``null`` only if %%confirms%% is ``0`` - * and the transaction has not been mined, otherwise this will - * wait until enough confirmations have completed. - */ - async wait(confirms, timeout) { - const receipt = await super.wait(confirms, timeout); - if (receipt == null) { - return null; - } - return new ContractTransactionReceipt(this.#iface, this.provider, receipt); - } - } - /** - * A **ContractUnknownEventPayload** is included as the last parameter to - * Contract Events when the event does not match any events in the ABI. - */ - class ContractUnknownEventPayload extends EventPayload { - /** - * The log with no matching events. - */ - log; - /** - * @_event: - */ - constructor(contract, listener, filter, log) { - super(contract, listener, filter); - defineProperties(this, { log }); - } - /** - * Resolves to the block the event occured in. - */ - async getBlock() { - return await this.log.getBlock(); - } - /** - * Resolves to the transaction the event occured in. - */ - async getTransaction() { - return await this.log.getTransaction(); - } - /** - * Resolves to the transaction receipt the event occured in. - */ - async getTransactionReceipt() { - return await this.log.getTransactionReceipt(); - } - } - /** - * A **ContractEventPayload** is included as the last parameter to - * Contract Events when the event is known. - */ - class ContractEventPayload extends ContractUnknownEventPayload { - /** - * @_ignore: - */ - constructor(contract, listener, filter, fragment, _log) { - super(contract, listener, filter, new EventLog(_log, contract.interface, fragment)); - const args = contract.interface.decodeEventLog(fragment, this.log.data, this.log.topics); - defineProperties(this, { args, fragment }); - } - /** - * The event name. - */ - get eventName() { - return this.fragment.name; - } - /** - * The event signature. - */ - get eventSignature() { - return this.fragment.format(); - } - } - - const BN_0$1 = BigInt(0); - function canCall(value) { - return (value && typeof (value.call) === "function"); - } - function canEstimate(value) { - return (value && typeof (value.estimateGas) === "function"); - } - function canResolve(value) { - return (value && typeof (value.resolveName) === "function"); - } - function canSend(value) { - return (value && typeof (value.sendTransaction) === "function"); - } - function getResolver(value) { - if (value != null) { - if (canResolve(value)) { - return value; - } - if (value.provider) { - return value.provider; - } - } - return undefined; - } - class PreparedTopicFilter { - #filter; - fragment; - constructor(contract, fragment, args) { - defineProperties(this, { fragment }); - if (fragment.inputs.length < args.length) { - throw new Error("too many arguments"); - } - // Recursively descend into args and resolve any addresses - const runner = getRunner(contract.runner, "resolveName"); - const resolver = canResolve(runner) ? runner : null; - this.#filter = (async function () { - const resolvedArgs = await Promise.all(fragment.inputs.map((param, index) => { - const arg = args[index]; - if (arg == null) { - return null; - } - return param.walkAsync(args[index], (type, value) => { - if (type === "address") { - if (Array.isArray(value)) { - return Promise.all(value.map((v) => resolveAddress(v, resolver))); - } - return resolveAddress(value, resolver); - } - return value; - }); - })); - return contract.interface.encodeFilterTopics(fragment, resolvedArgs); - })(); - } - getTopicFilter() { - return this.#filter; - } - } - // A = Arguments passed in as a tuple - // R = The result type of the call (i.e. if only one return type, - // the qualified type, otherwise Result) - // D = The type the default call will return (i.e. R for view/pure, - // TransactionResponse otherwise) - //export interface ContractMethod = Array, R = any, D extends R | ContractTransactionResponse = ContractTransactionResponse> { - function getRunner(value, feature) { - if (value == null) { - return null; - } - if (typeof (value[feature]) === "function") { - return value; - } - if (value.provider && typeof (value.provider[feature]) === "function") { - return value.provider; - } - return null; - } - function getProvider(value) { - if (value == null) { - return null; - } - return value.provider || null; - } - /** - * @_ignore: - */ - async function copyOverrides(arg, allowed) { - // Make sure the overrides passed in are a valid overrides object - const _overrides = Typed.dereference(arg, "overrides"); - assertArgument(typeof (_overrides) === "object", "invalid overrides parameter", "overrides", arg); - // Create a shallow copy (we'll deep-ify anything needed during normalizing) - const overrides = copyRequest(_overrides); - assertArgument(overrides.to == null || (allowed || []).indexOf("to") >= 0, "cannot override to", "overrides.to", overrides.to); - assertArgument(overrides.data == null || (allowed || []).indexOf("data") >= 0, "cannot override data", "overrides.data", overrides.data); - // Resolve any from - if (overrides.from) { - overrides.from = overrides.from; - } - return overrides; - } - /** - * @_ignore: - */ - async function resolveArgs(_runner, inputs, args) { - // Recursively descend into args and resolve any addresses - const runner = getRunner(_runner, "resolveName"); - const resolver = canResolve(runner) ? runner : null; - return await Promise.all(inputs.map((param, index) => { - return param.walkAsync(args[index], (type, value) => { - value = Typed.dereference(value, type); - if (type === "address") { - return resolveAddress(value, resolver); - } - return value; - }); - })); - } - function buildWrappedFallback(contract) { - const populateTransaction = async function (overrides) { - // If an overrides was passed in, copy it and normalize the values - const tx = (await copyOverrides(overrides, ["data"])); - tx.to = await contract.getAddress(); - if (tx.from) { - tx.from = await resolveAddress(tx.from, getResolver(contract.runner)); - } - const iface = contract.interface; - const noValue = (getBigInt((tx.value || BN_0$1), "overrides.value") === BN_0$1); - const noData = ((tx.data || "0x") === "0x"); - if (iface.fallback && !iface.fallback.payable && iface.receive && !noData && !noValue) { - assertArgument(false, "cannot send data to receive or send value to non-payable fallback", "overrides", overrides); - } - assertArgument(iface.fallback || noData, "cannot send data to receive-only contract", "overrides.data", tx.data); - // Only allow payable contracts to set non-zero value - const payable = iface.receive || (iface.fallback && iface.fallback.payable); - assertArgument(payable || noValue, "cannot send value to non-payable fallback", "overrides.value", tx.value); - // Only allow fallback contracts to set non-empty data - assertArgument(iface.fallback || noData, "cannot send data to receive-only contract", "overrides.data", tx.data); - return tx; - }; - const staticCall = async function (overrides) { - const runner = getRunner(contract.runner, "call"); - assert(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" }); - const tx = await populateTransaction(overrides); - try { - return await runner.call(tx); - } - catch (error) { - if (isCallException(error) && error.data) { - throw contract.interface.makeError(error.data, tx); - } - throw error; - } - }; - const send = async function (overrides) { - const runner = contract.runner; - assert(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" }); - const tx = await runner.sendTransaction(await populateTransaction(overrides)); - const provider = getProvider(contract.runner); - // @TODO: the provider can be null; make a custom dummy provider that will throw a - // meaningful error - return new ContractTransactionResponse(contract.interface, provider, tx); - }; - const estimateGas = async function (overrides) { - const runner = getRunner(contract.runner, "estimateGas"); - assert(canEstimate(runner), "contract runner does not support gas estimation", "UNSUPPORTED_OPERATION", { operation: "estimateGas" }); - return await runner.estimateGas(await populateTransaction(overrides)); - }; - const method = async (overrides) => { - return await send(overrides); - }; - defineProperties(method, { - _contract: contract, - estimateGas, - populateTransaction, - send, staticCall - }); - return method; - } - function buildWrappedMethod(contract, key) { - const getFragment = function (...args) { - const fragment = contract.interface.getFunction(key, args); - assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", { - operation: "fragment", - info: { key, args } - }); - return fragment; - }; - const populateTransaction = async function (...args) { - const fragment = getFragment(...args); - // If an overrides was passed in, copy it and normalize the values - let overrides = {}; - if (fragment.inputs.length + 1 === args.length) { - overrides = await copyOverrides(args.pop()); - if (overrides.from) { - overrides.from = await resolveAddress(overrides.from, getResolver(contract.runner)); - } - } - if (fragment.inputs.length !== args.length) { - throw new Error("internal error: fragment inputs doesn't match arguments; should not happen"); - } - const resolvedArgs = await resolveArgs(contract.runner, fragment.inputs, args); - return Object.assign({}, overrides, await resolveProperties({ - to: contract.getAddress(), - data: contract.interface.encodeFunctionData(fragment, resolvedArgs) - })); - }; - const staticCall = async function (...args) { - const result = await staticCallResult(...args); - if (result.length === 1) { - return result[0]; - } - return result; - }; - const send = async function (...args) { - const runner = contract.runner; - assert(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" }); - const tx = await runner.sendTransaction(await populateTransaction(...args)); - const provider = getProvider(contract.runner); - // @TODO: the provider can be null; make a custom dummy provider that will throw a - // meaningful error - return new ContractTransactionResponse(contract.interface, provider, tx); - }; - const estimateGas = async function (...args) { - const runner = getRunner(contract.runner, "estimateGas"); - assert(canEstimate(runner), "contract runner does not support gas estimation", "UNSUPPORTED_OPERATION", { operation: "estimateGas" }); - return await runner.estimateGas(await populateTransaction(...args)); - }; - const staticCallResult = async function (...args) { - const runner = getRunner(contract.runner, "call"); - assert(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" }); - const tx = await populateTransaction(...args); - let result = "0x"; - try { - result = await runner.call(tx); - } - catch (error) { - if (isCallException(error) && error.data) { - throw contract.interface.makeError(error.data, tx); - } - throw error; - } - const fragment = getFragment(...args); - return contract.interface.decodeFunctionResult(fragment, result); - }; - const method = async (...args) => { - const fragment = getFragment(...args); - if (fragment.constant) { - return await staticCall(...args); - } - return await send(...args); - }; - defineProperties(method, { - name: contract.interface.getFunctionName(key), - _contract: contract, _key: key, - getFragment, - estimateGas, - populateTransaction, - send, staticCall, staticCallResult, - }); - // Only works on non-ambiguous keys (refined fragment is always non-ambiguous) - Object.defineProperty(method, "fragment", { - configurable: false, - enumerable: true, - get: () => { - const fragment = contract.interface.getFunction(key); - assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", { - operation: "fragment", - info: { key } - }); - return fragment; - } - }); - return method; - } - function buildWrappedEvent(contract, key) { - const getFragment = function (...args) { - const fragment = contract.interface.getEvent(key, args); - assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", { - operation: "fragment", - info: { key, args } - }); - return fragment; - }; - const method = function (...args) { - return new PreparedTopicFilter(contract, getFragment(...args), args); - }; - defineProperties(method, { - name: contract.interface.getEventName(key), - _contract: contract, _key: key, - getFragment - }); - // Only works on non-ambiguous keys (refined fragment is always non-ambiguous) - Object.defineProperty(method, "fragment", { - configurable: false, - enumerable: true, - get: () => { - const fragment = contract.interface.getEvent(key); - assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", { - operation: "fragment", - info: { key } - }); - return fragment; - } - }); - return method; - } - // The combination of TypeScrype, Private Fields and Proxies makes - // the world go boom; so we hide variables with some trickery keeping - // a symbol attached to each BaseContract which its sub-class (even - // via a Proxy) can reach and use to look up its internal values. - const internal = Symbol.for("_ethersInternal_contract"); - const internalValues = new WeakMap(); - function setInternal(contract, values) { - internalValues.set(contract[internal], values); - } - function getInternal(contract) { - return internalValues.get(contract[internal]); - } - function isDeferred(value) { - return (value && typeof (value) === "object" && ("getTopicFilter" in value) && - (typeof (value.getTopicFilter) === "function") && value.fragment); - } - async function getSubInfo(contract, event) { - let topics; - let fragment = null; - // Convert named events to topicHash and get the fragment for - // events which need deconstructing. - if (Array.isArray(event)) { - const topicHashify = function (name) { - if (isHexString(name, 32)) { - return name; - } - const fragment = contract.interface.getEvent(name); - assertArgument(fragment, "unknown fragment", "name", name); - return fragment.topicHash; - }; - // Array of Topics and Names; e.g. `[ "0x1234...89ab", "Transfer(address)" ]` - topics = event.map((e) => { - if (e == null) { - return null; - } - if (Array.isArray(e)) { - return e.map(topicHashify); - } - return topicHashify(e); - }); - } - else if (event === "*") { - topics = [null]; - } - else if (typeof (event) === "string") { - if (isHexString(event, 32)) { - // Topic Hash - topics = [event]; - } - else { - // Name or Signature; e.g. `"Transfer", `"Transfer(address)"` - fragment = contract.interface.getEvent(event); - assertArgument(fragment, "unknown fragment", "event", event); - topics = [fragment.topicHash]; - } - } - else if (isDeferred(event)) { - // Deferred Topic Filter; e.g. `contract.filter.Transfer(from)` - topics = await event.getTopicFilter(); - } - else if ("fragment" in event) { - // ContractEvent; e.g. `contract.filter.Transfer` - fragment = event.fragment; - topics = [fragment.topicHash]; - } - else { - assertArgument(false, "unknown event name", "event", event); - } - // Normalize topics and sort TopicSets - topics = topics.map((t) => { - if (t == null) { - return null; - } - if (Array.isArray(t)) { - const items = Array.from(new Set(t.map((t) => t.toLowerCase())).values()); - if (items.length === 1) { - return items[0]; - } - items.sort(); - return items; - } - return t.toLowerCase(); - }); - const tag = topics.map((t) => { - if (t == null) { - return "null"; - } - if (Array.isArray(t)) { - return t.join("|"); - } - return t; - }).join("&"); - return { fragment, tag, topics }; - } - async function hasSub(contract, event) { - const { subs } = getInternal(contract); - return subs.get((await getSubInfo(contract, event)).tag) || null; - } - async function getSub(contract, operation, event) { - // Make sure our runner can actually subscribe to events - const provider = getProvider(contract.runner); - assert(provider, "contract runner does not support subscribing", "UNSUPPORTED_OPERATION", { operation }); - const { fragment, tag, topics } = await getSubInfo(contract, event); - const { addr, subs } = getInternal(contract); - let sub = subs.get(tag); - if (!sub) { - const address = (addr ? addr : contract); - const filter = { address, topics }; - const listener = (log) => { - let foundFragment = fragment; - if (foundFragment == null) { - try { - foundFragment = contract.interface.getEvent(log.topics[0]); - } - catch (error) { } - } - // If fragment is null, we do not deconstruct the args to emit - if (foundFragment) { - const _foundFragment = foundFragment; - const args = fragment ? contract.interface.decodeEventLog(fragment, log.data, log.topics) : []; - emit(contract, event, args, (listener) => { - return new ContractEventPayload(contract, listener, event, _foundFragment, log); - }); - } - else { - emit(contract, event, [], (listener) => { - return new ContractUnknownEventPayload(contract, listener, event, log); - }); - } - }; - let starting = []; - const start = () => { - if (starting.length) { - return; - } - starting.push(provider.on(filter, listener)); - }; - const stop = async () => { - if (starting.length == 0) { - return; - } - let started = starting; - starting = []; - await Promise.all(started); - provider.off(filter, listener); - }; - sub = { tag, listeners: [], start, stop }; - subs.set(tag, sub); - } - return sub; - } - // We use this to ensure one emit resolves before firing the next to - // ensure correct ordering (note this cannot throw and just adds the - // notice to the event queu using setTimeout). - let lastEmit = Promise.resolve(); - async function _emit(contract, event, args, payloadFunc) { - await lastEmit; - const sub = await hasSub(contract, event); - if (!sub) { - return false; - } - const count = sub.listeners.length; - sub.listeners = sub.listeners.filter(({ listener, once }) => { - const passArgs = Array.from(args); - if (payloadFunc) { - passArgs.push(payloadFunc(once ? null : listener)); - } - try { - listener.call(contract, ...passArgs); - } - catch (error) { } - return !once; - }); - if (sub.listeners.length === 0) { - sub.stop(); - getInternal(contract).subs.delete(sub.tag); - } - return (count > 0); - } - async function emit(contract, event, args, payloadFunc) { - try { - await lastEmit; - } - catch (error) { } - const resultPromise = _emit(contract, event, args, payloadFunc); - lastEmit = resultPromise; - return await resultPromise; - } - const passProperties = ["then"]; - class BaseContract { - /** - * The target to connect to. - * - * This can be an address, ENS name or any [[Addressable]], such as - * another contract. To get the resolved address, use the ``getAddress`` - * method. - */ - target; - /** - * The contract Interface. - */ - interface; - /** - * The connected runner. This is generally a [[Provider]] or a - * [[Signer]], which dictates what operations are supported. - * - * For example, a **Contract** connected to a [[Provider]] may - * only execute read-only operations. - */ - runner; - /** - * All the Events available on this contract. - */ - filters; - /** - * @_ignore: - */ - [internal]; - /** - * The fallback or receive function if any. - */ - fallback; - /** - * Creates a new contract connected to %%target%% with the %%abi%% and - * optionally connected to a %%runner%% to perform operations on behalf - * of. - */ - constructor(target, abi, runner, _deployTx) { - assertArgument(typeof (target) === "string" || isAddressable(target), "invalid value for Contract target", "target", target); - if (runner == null) { - runner = null; - } - const iface = Interface.from(abi); - defineProperties(this, { target, runner, interface: iface }); - Object.defineProperty(this, internal, { value: {} }); - let addrPromise; - let addr = null; - let deployTx = null; - if (_deployTx) { - const provider = getProvider(runner); - // @TODO: the provider can be null; make a custom dummy provider that will throw a - // meaningful error - deployTx = new ContractTransactionResponse(this.interface, provider, _deployTx); - } - let subs = new Map(); - // Resolve the target as the address - if (typeof (target) === "string") { - if (isHexString(target)) { - addr = target; - addrPromise = Promise.resolve(target); - } - else { - const resolver = getRunner(runner, "resolveName"); - if (!canResolve(resolver)) { - throw makeError("contract runner does not support name resolution", "UNSUPPORTED_OPERATION", { - operation: "resolveName" - }); - } - addrPromise = resolver.resolveName(target).then((addr) => { - if (addr == null) { - throw makeError("an ENS name used for a contract target must be correctly configured", "UNCONFIGURED_NAME", { - value: target - }); - } - getInternal(this).addr = addr; - return addr; - }); - } - } - else { - addrPromise = target.getAddress().then((addr) => { - if (addr == null) { - throw new Error("TODO"); - } - getInternal(this).addr = addr; - return addr; - }); - } - // Set our private values - setInternal(this, { addrPromise, addr, deployTx, subs }); - // Add the event filters - const filters = new Proxy({}, { - get: (target, prop, receiver) => { - // Pass important checks (like `then` for Promise) through - if (typeof (prop) === "symbol" || passProperties.indexOf(prop) >= 0) { - return Reflect.get(target, prop, receiver); - } - try { - return this.getEvent(prop); - } - catch (error) { - if (!isError(error, "INVALID_ARGUMENT") || error.argument !== "key") { - throw error; - } - } - return undefined; - }, - has: (target, prop) => { - // Pass important checks (like `then` for Promise) through - if (passProperties.indexOf(prop) >= 0) { - return Reflect.has(target, prop); - } - return Reflect.has(target, prop) || this.interface.hasEvent(String(prop)); - } - }); - defineProperties(this, { filters }); - defineProperties(this, { - fallback: ((iface.receive || iface.fallback) ? (buildWrappedFallback(this)) : null) - }); - // Return a Proxy that will respond to functions - return new Proxy(this, { - get: (target, prop, receiver) => { - if (typeof (prop) === "symbol" || prop in target || passProperties.indexOf(prop) >= 0) { - return Reflect.get(target, prop, receiver); - } - // Undefined properties should return undefined - try { - return target.getFunction(prop); - } - catch (error) { - if (!isError(error, "INVALID_ARGUMENT") || error.argument !== "key") { - throw error; - } - } - return undefined; - }, - has: (target, prop) => { - if (typeof (prop) === "symbol" || prop in target || passProperties.indexOf(prop) >= 0) { - return Reflect.has(target, prop); - } - return target.interface.hasFunction(prop); - } - }); - } - /** - * Return a new Contract instance with the same target and ABI, but - * a different %%runner%%. - */ - connect(runner) { - return new BaseContract(this.target, this.interface, runner); - } - /** - * Return a new Contract instance with the same ABI and runner, but - * a different %%target%%. - */ - attach(target) { - return new BaseContract(target, this.interface, this.runner); - } - /** - * Return the resolved address of this Contract. - */ - async getAddress() { return await getInternal(this).addrPromise; } - /** - * Return the deployed bytecode or null if no bytecode is found. - */ - async getDeployedCode() { - const provider = getProvider(this.runner); - assert(provider, "runner does not support .provider", "UNSUPPORTED_OPERATION", { operation: "getDeployedCode" }); - const code = await provider.getCode(await this.getAddress()); - if (code === "0x") { - return null; - } - return code; - } - /** - * Resolve to this Contract once the bytecode has been deployed, or - * resolve immediately if already deployed. - */ - async waitForDeployment() { - // We have the deployment transaction; just use that (throws if deployment fails) - const deployTx = this.deploymentTransaction(); - if (deployTx) { - await deployTx.wait(); - return this; - } - // Check for code - const code = await this.getDeployedCode(); - if (code != null) { - return this; - } - // Make sure we can subscribe to a provider event - const provider = getProvider(this.runner); - assert(provider != null, "contract runner does not support .provider", "UNSUPPORTED_OPERATION", { operation: "waitForDeployment" }); - return new Promise((resolve, reject) => { - const checkCode = async () => { - try { - const code = await this.getDeployedCode(); - if (code != null) { - return resolve(this); - } - provider.once("block", checkCode); - } - catch (error) { - reject(error); - } - }; - checkCode(); - }); - } - /** - * Return the transaction used to deploy this contract. - * - * This is only available if this instance was returned from a - * [[ContractFactory]]. - */ - deploymentTransaction() { - return getInternal(this).deployTx; - } - /** - * Return the function for a given name. This is useful when a contract - * method name conflicts with a JavaScript name such as ``prototype`` or - * when using a Contract programmatically. - */ - getFunction(key) { - if (typeof (key) !== "string") { - key = key.format(); - } - const func = buildWrappedMethod(this, key); - return func; - } - /** - * Return the event for a given name. This is useful when a contract - * event name conflicts with a JavaScript name such as ``prototype`` or - * when using a Contract programmatically. - */ - getEvent(key) { - if (typeof (key) !== "string") { - key = key.format(); - } - return buildWrappedEvent(this, key); - } - /** - * @_ignore: - */ - async queryTransaction(hash) { - throw new Error("@TODO"); - } - /* - // @TODO: this is a non-backwards compatible change, but will be added - // in v7 and in a potential SmartContract class in an upcoming - // v6 release - async getTransactionReceipt(hash: string): Promise { - const provider = getProvider(this.runner); - assert(provider, "contract runner does not have a provider", - "UNSUPPORTED_OPERATION", { operation: "queryTransaction" }); - - const receipt = await provider.getTransactionReceipt(hash); - if (receipt == null) { return null; } - - return new ContractTransactionReceipt(this.interface, provider, receipt); - } - */ - /** - * Provide historic access to event data for %%event%% in the range - * %%fromBlock%% (default: ``0``) to %%toBlock%% (default: ``"latest"``) - * inclusive. - */ - async queryFilter(event, fromBlock, toBlock) { - if (fromBlock == null) { - fromBlock = 0; - } - if (toBlock == null) { - toBlock = "latest"; - } - const { addr, addrPromise } = getInternal(this); - const address = (addr ? addr : (await addrPromise)); - const { fragment, topics } = await getSubInfo(this, event); - const filter = { address, topics, fromBlock, toBlock }; - const provider = getProvider(this.runner); - assert(provider, "contract runner does not have a provider", "UNSUPPORTED_OPERATION", { operation: "queryFilter" }); - return (await provider.getLogs(filter)).map((log) => { - let foundFragment = fragment; - if (foundFragment == null) { - try { - foundFragment = this.interface.getEvent(log.topics[0]); - } - catch (error) { } - } - if (foundFragment) { - try { - return new EventLog(log, this.interface, foundFragment); - } - catch (error) { - return new UndecodedEventLog(log, error); - } - } - return new Log(log, provider); - }); - } - /** - * Add an event %%listener%% for the %%event%%. - */ - async on(event, listener) { - const sub = await getSub(this, "on", event); - sub.listeners.push({ listener, once: false }); - sub.start(); - return this; - } - /** - * Add an event %%listener%% for the %%event%%, but remove the listener - * after it is fired once. - */ - async once(event, listener) { - const sub = await getSub(this, "once", event); - sub.listeners.push({ listener, once: true }); - sub.start(); - return this; - } - /** - * Emit an %%event%% calling all listeners with %%args%%. - * - * Resolves to ``true`` if any listeners were called. - */ - async emit(event, ...args) { - return await emit(this, event, args, null); - } - /** - * Resolves to the number of listeners of %%event%% or the total number - * of listeners if unspecified. - */ - async listenerCount(event) { - if (event) { - const sub = await hasSub(this, event); - if (!sub) { - return 0; - } - return sub.listeners.length; - } - const { subs } = getInternal(this); - let total = 0; - for (const { listeners } of subs.values()) { - total += listeners.length; - } - return total; - } - /** - * Resolves to the listeners subscribed to %%event%% or all listeners - * if unspecified. - */ - async listeners(event) { - if (event) { - const sub = await hasSub(this, event); - if (!sub) { - return []; - } - return sub.listeners.map(({ listener }) => listener); - } - const { subs } = getInternal(this); - let result = []; - for (const { listeners } of subs.values()) { - result = result.concat(listeners.map(({ listener }) => listener)); - } - return result; - } - /** - * Remove the %%listener%% from the listeners for %%event%% or remove - * all listeners if unspecified. - */ - async off(event, listener) { - const sub = await hasSub(this, event); - if (!sub) { - return this; - } - if (listener) { - const index = sub.listeners.map(({ listener }) => listener).indexOf(listener); - if (index >= 0) { - sub.listeners.splice(index, 1); - } - } - if (listener == null || sub.listeners.length === 0) { - sub.stop(); - getInternal(this).subs.delete(sub.tag); - } - return this; - } - /** - * Remove all the listeners for %%event%% or remove all listeners if - * unspecified. - */ - async removeAllListeners(event) { - if (event) { - const sub = await hasSub(this, event); - if (!sub) { - return this; - } - sub.stop(); - getInternal(this).subs.delete(sub.tag); - } - else { - const { subs } = getInternal(this); - for (const { tag, stop } of subs.values()) { - stop(); - subs.delete(tag); - } - } - return this; - } - /** - * Alias for [on]. - */ - async addListener(event, listener) { - return await this.on(event, listener); - } - /** - * Alias for [off]. - */ - async removeListener(event, listener) { - return await this.off(event, listener); - } - /** - * Create a new Class for the %%abi%%. - */ - static buildClass(abi) { - class CustomContract extends BaseContract { - constructor(address, runner = null) { - super(address, abi, runner); - } - } - return CustomContract; - } - ; - /** - * Create a new BaseContract with a specified Interface. - */ - static from(target, abi, runner) { - if (runner == null) { - runner = null; - } - const contract = new this(target, abi, runner); - return contract; - } - } - function _ContractBase() { - return BaseContract; - } - /** - * A [[BaseContract]] with no type guards on its methods or events. - */ - class Contract extends _ContractBase() { - } - - // A = Arguments to the constructor - // I = Interface of deployed contracts - /** - * A **ContractFactory** is used to deploy a Contract to the blockchain. - */ - class ContractFactory { - /** - * The Contract Interface. - */ - interface; - /** - * The Contract deployment bytecode. Often called the initcode. - */ - bytecode; - /** - * The ContractRunner to deploy the Contract as. - */ - runner; - /** - * Create a new **ContractFactory** with %%abi%% and %%bytecode%%, - * optionally connected to %%runner%%. - * - * The %%bytecode%% may be the ``bytecode`` property within the - * standard Solidity JSON output. - */ - constructor(abi, bytecode, runner) { - const iface = Interface.from(abi); - // Dereference Solidity bytecode objects and allow a missing `0x`-prefix - if (bytecode instanceof Uint8Array) { - bytecode = hexlify(getBytes(bytecode)); - } - else { - if (typeof (bytecode) === "object") { - bytecode = bytecode.object; - } - if (!bytecode.startsWith("0x")) { - bytecode = "0x" + bytecode; - } - bytecode = hexlify(getBytes(bytecode)); - } - defineProperties(this, { - bytecode, interface: iface, runner: (runner || null) - }); - } - attach(target) { - return new BaseContract(target, this.interface, this.runner); - } - /** - * Resolves to the transaction to deploy the contract, passing %%args%% - * into the constructor. - */ - async getDeployTransaction(...args) { - let overrides = {}; - const fragment = this.interface.deploy; - if (fragment.inputs.length + 1 === args.length) { - overrides = await copyOverrides(args.pop()); - } - if (fragment.inputs.length !== args.length) { - throw new Error("incorrect number of arguments to constructor"); - } - const resolvedArgs = await resolveArgs(this.runner, fragment.inputs, args); - const data = concat([this.bytecode, this.interface.encodeDeploy(resolvedArgs)]); - return Object.assign({}, overrides, { data }); - } - /** - * Resolves to the Contract deployed by passing %%args%% into the - * constructor. - * - * This will resolve to the Contract before it has been deployed to the - * network, so the [[BaseContract-waitForDeployment]] should be used before - * sending any transactions to it. - */ - async deploy(...args) { - const tx = await this.getDeployTransaction(...args); - assert(this.runner && typeof (this.runner.sendTransaction) === "function", "factory runner does not support sending transactions", "UNSUPPORTED_OPERATION", { - operation: "sendTransaction" - }); - const sentTx = await this.runner.sendTransaction(tx); - const address = getCreateAddress(sentTx); - return new BaseContract(address, this.interface, this.runner, sentTx); - } - /** - * Return a new **ContractFactory** with the same ABI and bytecode, - * but connected to %%runner%%. - */ - connect(runner) { - return new ContractFactory(this.interface, this.bytecode, runner); - } - /** - * Create a new **ContractFactory** from the standard Solidity JSON output. - */ - static fromSolidity(output, runner) { - assertArgument(output != null, "bad compiler output", "output", output); - if (typeof (output) === "string") { - output = JSON.parse(output); - } - const abi = output.abi; - let bytecode = ""; - if (output.bytecode) { - bytecode = output.bytecode; - } - else if (output.evm && output.evm.bytecode) { - bytecode = output.evm.bytecode; - } - return new this(abi, bytecode, runner); - } - } - - /** - * ENS is a service which allows easy-to-remember names to map to - * network addresses. - * - * @_section: api/providers/ens-resolver:ENS Resolver [about-ens-rsolver] - */ - // @TODO: This should use the fetch-data:ipfs gateway - // Trim off the ipfs:// prefix and return the default gateway URL - function getIpfsLink(link) { - if (link.match(/^ipfs:\/\/ipfs\//i)) { - link = link.substring(12); - } - else if (link.match(/^ipfs:\/\//i)) { - link = link.substring(7); - } - else { - assertArgument(false, "unsupported IPFS format", "link", link); - } - return `https:/\/gateway.ipfs.io/ipfs/${link}`; - } - /** - * A provider plugin super-class for processing multicoin address types. - */ - class MulticoinProviderPlugin { - /** - * The name. - */ - name; - /** - * Creates a new **MulticoinProviderPluing** for %%name%%. - */ - constructor(name) { - defineProperties(this, { name }); - } - connect(proivder) { - return this; - } - /** - * Returns ``true`` if %%coinType%% is supported by this plugin. - */ - supportsCoinType(coinType) { - return false; - } - /** - * Resolves to the encoded %%address%% for %%coinType%%. - */ - async encodeAddress(coinType, address) { - throw new Error("unsupported coin"); - } - /** - * Resolves to the decoded %%data%% for %%coinType%%. - */ - async decodeAddress(coinType, data) { - throw new Error("unsupported coin"); - } - } - const matcherIpfs = new RegExp("^(ipfs):/\/(.*)$", "i"); - const matchers = [ - new RegExp("^(https):/\/(.*)$", "i"), - new RegExp("^(data):(.*)$", "i"), - matcherIpfs, - new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$", "i"), - ]; - /** - * A connected object to a resolved ENS name resolver, which can be - * used to query additional details. - */ - class EnsResolver { - /** - * The connected provider. - */ - provider; - /** - * The address of the resolver. - */ - address; - /** - * The name this resolver was resolved against. - */ - name; - // For EIP-2544 names, the ancestor that provided the resolver - #supports2544; - #resolver; - constructor(provider, address, name) { - defineProperties(this, { provider, address, name }); - this.#supports2544 = null; - this.#resolver = new Contract(address, [ - "function supportsInterface(bytes4) view returns (bool)", - "function resolve(bytes, bytes) view returns (bytes)", - "function addr(bytes32) view returns (address)", - "function addr(bytes32, uint) view returns (bytes)", - "function text(bytes32, string) view returns (string)", - "function contenthash(bytes32) view returns (bytes)", - ], provider); - } - /** - * Resolves to true if the resolver supports wildcard resolution. - */ - async supportsWildcard() { - if (this.#supports2544 == null) { - this.#supports2544 = (async () => { - try { - return await this.#resolver.supportsInterface("0x9061b923"); - } - catch (error) { - // Wildcard resolvers must understand supportsInterface - // and return true. - if (isError(error, "CALL_EXCEPTION")) { - return false; - } - // Let future attempts try again... - this.#supports2544 = null; - throw error; - } - })(); - } - return await this.#supports2544; - } - async #fetch(funcName, params) { - params = (params || []).slice(); - const iface = this.#resolver.interface; - // The first parameters is always the nodehash - params.unshift(namehash(this.name)); - let fragment = null; - if (await this.supportsWildcard()) { - fragment = iface.getFunction(funcName); - assert(fragment, "missing fragment", "UNKNOWN_ERROR", { - info: { funcName } - }); - params = [ - dnsEncode(this.name, 255), - iface.encodeFunctionData(fragment, params) - ]; - funcName = "resolve(bytes,bytes)"; - } - params.push({ - enableCcipRead: true - }); - try { - const result = await this.#resolver[funcName](...params); - if (fragment) { - return iface.decodeFunctionResult(fragment, result)[0]; - } - return result; - } - catch (error) { - if (!isError(error, "CALL_EXCEPTION")) { - throw error; - } - } - return null; - } - /** - * Resolves to the address for %%coinType%% or null if the - * provided %%coinType%% has not been configured. - */ - async getAddress(coinType) { - if (coinType == null) { - coinType = 60; - } - if (coinType === 60) { - try { - const result = await this.#fetch("addr(bytes32)"); - // No address - if (result == null || result === ZeroAddress) { - return null; - } - return result; - } - catch (error) { - if (isError(error, "CALL_EXCEPTION")) { - return null; - } - throw error; - } - } - // Try decoding its EVM canonical chain as an EVM chain address first - if (coinType >= 0 && coinType < 0x80000000) { - let ethCoinType = coinType + 0x80000000; - const data = await this.#fetch("addr(bytes32,uint)", [ethCoinType]); - if (isHexString(data, 20)) { - return getAddress(data); - } - } - let coinPlugin = null; - for (const plugin of this.provider.plugins) { - if (!(plugin instanceof MulticoinProviderPlugin)) { - continue; - } - if (plugin.supportsCoinType(coinType)) { - coinPlugin = plugin; - break; - } - } - if (coinPlugin == null) { - return null; - } - // keccak256("addr(bytes32,uint256") - const data = await this.#fetch("addr(bytes32,uint)", [coinType]); - // No address - if (data == null || data === "0x") { - return null; - } - // Compute the address - const address = await coinPlugin.decodeAddress(coinType, data); - if (address != null) { - return address; - } - assert(false, `invalid coin data`, "UNSUPPORTED_OPERATION", { - operation: `getAddress(${coinType})`, - info: { coinType, data } - }); - } - /** - * Resolves to the EIP-634 text record for %%key%%, or ``null`` - * if unconfigured. - */ - async getText(key) { - const data = await this.#fetch("text(bytes32,string)", [key]); - if (data == null || data === "0x") { - return null; - } - return data; - } - /** - * Rsolves to the content-hash or ``null`` if unconfigured. - */ - async getContentHash() { - // keccak256("contenthash()") - const data = await this.#fetch("contenthash(bytes32)"); - // No contenthash - if (data == null || data === "0x") { - return null; - } - // IPFS (CID: 1, Type: 70=DAG-PB, 72=libp2p-key) - const ipfs = data.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/); - if (ipfs) { - const scheme = (ipfs[1] === "e3010170") ? "ipfs" : "ipns"; - const length = parseInt(ipfs[4], 16); - if (ipfs[5].length === length * 2) { - return `${scheme}:/\/${encodeBase58("0x" + ipfs[2])}`; - } - } - // Swarm (CID: 1, Type: swarm-manifest; hash/length hard-coded to keccak256/32) - const swarm = data.match(/^0xe40101fa011b20([0-9a-f]*)$/); - if (swarm && swarm[1].length === 64) { - return `bzz:/\/${swarm[1]}`; - } - assert(false, `invalid or unsupported content hash data`, "UNSUPPORTED_OPERATION", { - operation: "getContentHash()", - info: { data } - }); - } - /** - * Resolves to the avatar url or ``null`` if the avatar is either - * unconfigured or incorrectly configured (e.g. references an NFT - * not owned by the address). - * - * If diagnosing issues with configurations, the [[_getAvatar]] - * method may be useful. - */ - async getAvatar() { - const avatar = await this._getAvatar(); - return avatar.url; - } - /** - * When resolving an avatar, there are many steps involved, such - * fetching metadata and possibly validating ownership of an - * NFT. - * - * This method can be used to examine each step and the value it - * was working from. - */ - async _getAvatar() { - const linkage = [{ type: "name", value: this.name }]; - try { - // test data for ricmoo.eth - //const avatar = "eip155:1/erc721:0x265385c7f4132228A0d54EB1A9e7460b91c0cC68/29233"; - const avatar = await this.getText("avatar"); - if (avatar == null) { - linkage.push({ type: "!avatar", value: "" }); - return { url: null, linkage }; - } - linkage.push({ type: "avatar", value: avatar }); - for (let i = 0; i < matchers.length; i++) { - const match = avatar.match(matchers[i]); - if (match == null) { - continue; - } - const scheme = match[1].toLowerCase(); - switch (scheme) { - case "https": - case "data": - linkage.push({ type: "url", value: avatar }); - return { linkage, url: avatar }; - case "ipfs": { - const url = getIpfsLink(avatar); - linkage.push({ type: "ipfs", value: avatar }); - linkage.push({ type: "url", value: url }); - return { linkage, url }; - } - case "erc721": - case "erc1155": { - // Depending on the ERC type, use tokenURI(uint256) or url(uint256) - const selector = (scheme === "erc721") ? "tokenURI(uint256)" : "uri(uint256)"; - linkage.push({ type: scheme, value: avatar }); - // The owner of this name - const owner = await this.getAddress(); - if (owner == null) { - linkage.push({ type: "!owner", value: "" }); - return { url: null, linkage }; - } - const comps = (match[2] || "").split("/"); - if (comps.length !== 2) { - linkage.push({ type: `!${scheme}caip`, value: (match[2] || "") }); - return { url: null, linkage }; - } - const tokenId = comps[1]; - const contract = new Contract(comps[0], [ - // ERC-721 - "function tokenURI(uint) view returns (string)", - "function ownerOf(uint) view returns (address)", - // ERC-1155 - "function uri(uint) view returns (string)", - "function balanceOf(address, uint256) view returns (uint)" - ], this.provider); - // Check that this account owns the token - if (scheme === "erc721") { - const tokenOwner = await contract.ownerOf(tokenId); - if (owner !== tokenOwner) { - linkage.push({ type: "!owner", value: tokenOwner }); - return { url: null, linkage }; - } - linkage.push({ type: "owner", value: tokenOwner }); - } - else if (scheme === "erc1155") { - const balance = await contract.balanceOf(owner, tokenId); - if (!balance) { - linkage.push({ type: "!balance", value: "0" }); - return { url: null, linkage }; - } - linkage.push({ type: "balance", value: balance.toString() }); - } - // Call the token contract for the metadata URL - let metadataUrl = await contract[selector](tokenId); - if (metadataUrl == null || metadataUrl === "0x") { - linkage.push({ type: "!metadata-url", value: "" }); - return { url: null, linkage }; - } - linkage.push({ type: "metadata-url-base", value: metadataUrl }); - // ERC-1155 allows a generic {id} in the URL - if (scheme === "erc1155") { - metadataUrl = metadataUrl.replace("{id}", toBeHex(tokenId, 32).substring(2)); - linkage.push({ type: "metadata-url-expanded", value: metadataUrl }); - } - // Transform IPFS metadata links - if (metadataUrl.match(/^ipfs:/i)) { - metadataUrl = getIpfsLink(metadataUrl); - } - linkage.push({ type: "metadata-url", value: metadataUrl }); - // Get the token metadata - let metadata = {}; - const response = await (new FetchRequest(metadataUrl)).send(); - response.assertOk(); - try { - metadata = response.bodyJson; - } - catch (error) { - try { - linkage.push({ type: "!metadata", value: response.bodyText }); - } - catch (error) { - const bytes = response.body; - if (bytes) { - linkage.push({ type: "!metadata", value: hexlify(bytes) }); - } - return { url: null, linkage }; - } - return { url: null, linkage }; - } - if (!metadata) { - linkage.push({ type: "!metadata", value: "" }); - return { url: null, linkage }; - } - linkage.push({ type: "metadata", value: JSON.stringify(metadata) }); - // Pull the image URL out - let imageUrl = metadata.image; - if (typeof (imageUrl) !== "string") { - linkage.push({ type: "!imageUrl", value: "" }); - return { url: null, linkage }; - } - if (imageUrl.match(/^(https:\/\/|data:)/i)) { - // Allow - } - else { - // Transform IPFS link to gateway - const ipfs = imageUrl.match(matcherIpfs); - if (ipfs == null) { - linkage.push({ type: "!imageUrl-ipfs", value: imageUrl }); - return { url: null, linkage }; - } - linkage.push({ type: "imageUrl-ipfs", value: imageUrl }); - imageUrl = getIpfsLink(imageUrl); - } - linkage.push({ type: "url", value: imageUrl }); - return { linkage, url: imageUrl }; - } - } - } - } - catch (error) { } - return { linkage, url: null }; - } - static async getEnsAddress(provider) { - const network = await provider.getNetwork(); - const ensPlugin = network.getPlugin("org.ethers.plugins.network.Ens"); - // No ENS... - assert(ensPlugin, "network does not support ENS", "UNSUPPORTED_OPERATION", { - operation: "getEnsAddress", info: { network } - }); - return ensPlugin.address; - } - static async #getResolver(provider, name) { - const ensAddr = await EnsResolver.getEnsAddress(provider); - try { - const contract = new Contract(ensAddr, [ - "function resolver(bytes32) view returns (address)" - ], provider); - const addr = await contract.resolver(namehash(name), { - enableCcipRead: true - }); - if (addr === ZeroAddress) { - return null; - } - return addr; - } - catch (error) { - // ENS registry cannot throw errors on resolver(bytes32), - // so probably a link error - throw error; - } - return null; - } - /** - * Resolve to the ENS resolver for %%name%% using %%provider%% or - * ``null`` if unconfigured. - */ - static async fromName(provider, name) { - let currentName = name; - while (true) { - if (currentName === "" || currentName === ".") { - return null; - } - // Optimization since the eth node cannot change and does - // not have a wildcard resolver - if (name !== "eth" && currentName === "eth") { - return null; - } - // Check the current node for a resolver - const addr = await EnsResolver.#getResolver(provider, currentName); - // Found a resolver! - if (addr != null) { - const resolver = new EnsResolver(provider, addr, name); - // Legacy resolver found, using EIP-2544 so it isn't safe to use - if (currentName !== name && !(await resolver.supportsWildcard())) { - return null; - } - return resolver; - } - // Get the parent node - currentName = currentName.split(".").slice(1).join("."); - } - } - } - - /** - * @_ignore - */ - const BN_0 = BigInt(0); - function allowNull(format, nullValue) { - return (function (value) { - if (value == null) { - return nullValue; - } - return format(value); - }); - } - function arrayOf(format, allowNull) { - return ((array) => { - if (allowNull && array == null) { - return null; - } - if (!Array.isArray(array)) { - throw new Error("not an array"); - } - return array.map((i) => format(i)); - }); - } - // Requires an object which matches a fleet of other formatters - // Any FormatFunc may return `undefined` to have the value omitted - // from the result object. Calls preserve `this`. - function object(format, altNames) { - return ((value) => { - const result = {}; - for (const key in format) { - let srcKey = key; - if (altNames && key in altNames && !(srcKey in value)) { - for (const altKey of altNames[key]) { - if (altKey in value) { - srcKey = altKey; - break; - } - } - } - try { - const nv = format[key](value[srcKey]); - if (nv !== undefined) { - result[key] = nv; - } - } - catch (error) { - const message = (error instanceof Error) ? error.message : "not-an-error"; - assert(false, `invalid value for value.${key} (${message})`, "BAD_DATA", { value }); - } - } - return result; - }); - } - function formatBoolean(value) { - switch (value) { - case true: - case "true": - return true; - case false: - case "false": - return false; - } - assertArgument(false, `invalid boolean; ${JSON.stringify(value)}`, "value", value); - } - function formatData(value) { - assertArgument(isHexString(value, true), "invalid data", "value", value); - return value; - } - function formatHash(value) { - assertArgument(isHexString(value, 32), "invalid hash", "value", value); - return value; - } - const _formatLog = object({ - address: getAddress, - blockHash: formatHash, - blockNumber: getNumber, - data: formatData, - index: getNumber, - removed: allowNull(formatBoolean, false), - topics: arrayOf(formatHash), - transactionHash: formatHash, - transactionIndex: getNumber, - }, { - index: ["logIndex"] - }); - function formatLog(value) { - return _formatLog(value); - } - const _formatBlock = object({ - hash: allowNull(formatHash), - parentHash: formatHash, - parentBeaconBlockRoot: allowNull(formatHash, null), - number: getNumber, - timestamp: getNumber, - nonce: allowNull(formatData), - difficulty: getBigInt, - gasLimit: getBigInt, - gasUsed: getBigInt, - stateRoot: allowNull(formatHash, null), - receiptsRoot: allowNull(formatHash, null), - blobGasUsed: allowNull(getBigInt, null), - excessBlobGas: allowNull(getBigInt, null), - miner: allowNull(getAddress), - prevRandao: allowNull(formatHash, null), - extraData: formatData, - baseFeePerGas: allowNull(getBigInt) - }, { - prevRandao: ["mixHash"] - }); - function formatBlock(value) { - const result = _formatBlock(value); - result.transactions = value.transactions.map((tx) => { - if (typeof (tx) === "string") { - return tx; - } - return formatTransactionResponse(tx); - }); - return result; - } - const _formatReceiptLog = object({ - transactionIndex: getNumber, - blockNumber: getNumber, - transactionHash: formatHash, - address: getAddress, - topics: arrayOf(formatHash), - data: formatData, - index: getNumber, - blockHash: formatHash, - }, { - index: ["logIndex"] - }); - function formatReceiptLog(value) { - return _formatReceiptLog(value); - } - const _formatTransactionReceipt = object({ - to: allowNull(getAddress, null), - from: allowNull(getAddress, null), - contractAddress: allowNull(getAddress, null), - // should be allowNull(hash), but broken-EIP-658 support is handled in receipt - index: getNumber, - root: allowNull(hexlify), - gasUsed: getBigInt, - blobGasUsed: allowNull(getBigInt, null), - logsBloom: allowNull(formatData), - blockHash: formatHash, - hash: formatHash, - logs: arrayOf(formatReceiptLog), - blockNumber: getNumber, - //confirmations: allowNull(getNumber, null), - cumulativeGasUsed: getBigInt, - effectiveGasPrice: allowNull(getBigInt), - blobGasPrice: allowNull(getBigInt, null), - status: allowNull(getNumber), - type: allowNull(getNumber, 0) - }, { - effectiveGasPrice: ["gasPrice"], - hash: ["transactionHash"], - index: ["transactionIndex"], - }); - function formatTransactionReceipt(value) { - return _formatTransactionReceipt(value); - } - function formatTransactionResponse(value) { - // Some clients (TestRPC) do strange things like return 0x0 for the - // 0 address; correct this to be a real address - if (value.to && getBigInt(value.to) === BN_0) { - value.to = "0x0000000000000000000000000000000000000000"; - } - const result = object({ - hash: formatHash, - // Some nodes do not return this, usually test nodes (like Ganache) - index: allowNull(getNumber, undefined), - type: (value) => { - if (value === "0x" || value == null) { - return 0; - } - return getNumber(value); - }, - accessList: allowNull(accessListify, null), - blobVersionedHashes: allowNull(arrayOf(formatHash, true), null), - authorizationList: allowNull(arrayOf((v) => { - let sig; - if (v.signature) { - sig = v.signature; - } - else { - let yParity = v.yParity; - if (yParity === "0x1b") { - yParity = 0; - } - else if (yParity === "0x1c") { - yParity = 1; - } - sig = Object.assign({}, v, { yParity }); - } - return { - address: getAddress(v.address), - chainId: getBigInt(v.chainId), - nonce: getBigInt(v.nonce), - signature: Signature.from(sig) - }; - }, false), null), - blockHash: allowNull(formatHash, null), - blockNumber: allowNull(getNumber, null), - transactionIndex: allowNull(getNumber, null), - from: getAddress, - // either (gasPrice) or (maxPriorityFeePerGas + maxFeePerGas) must be set - gasPrice: allowNull(getBigInt), - maxPriorityFeePerGas: allowNull(getBigInt), - maxFeePerGas: allowNull(getBigInt), - maxFeePerBlobGas: allowNull(getBigInt, null), - gasLimit: getBigInt, - to: allowNull(getAddress, null), - value: getBigInt, - nonce: getNumber, - data: formatData, - creates: allowNull(getAddress, null), - chainId: allowNull(getBigInt, null) - }, { - data: ["input"], - gasLimit: ["gas"], - index: ["transactionIndex"] - })(value); - // If to and creates are empty, populate the creates from the value - if (result.to == null && result.creates == null) { - result.creates = getCreateAddress(result); - } - // @TODO: Check fee data - // Add an access list to supported transaction types - if ((value.type === 1 || value.type === 2) && value.accessList == null) { - result.accessList = []; - } - // Compute the signature - if (value.signature) { - result.signature = Signature.from(value.signature); - } - else { - result.signature = Signature.from(value); - } - // Some backends omit ChainId on legacy transactions, but we can compute it - if (result.chainId == null) { - const chainId = result.signature.legacyChainId; - if (chainId != null) { - result.chainId = chainId; - } - } - // @TODO: check chainID - /* - if (value.chainId != null) { - let chainId = value.chainId; - - if (isHexString(chainId)) { - chainId = BigNumber.from(chainId).toNumber(); - } - - result.chainId = chainId; - - } else { - let chainId = value.networkId; - - // geth-etc returns chainId - if (chainId == null && result.v == null) { - chainId = value.chainId; - } - - if (isHexString(chainId)) { - chainId = BigNumber.from(chainId).toNumber(); - } - - if (typeof(chainId) !== "number" && result.v != null) { - chainId = (result.v - 35) / 2; - if (chainId < 0) { chainId = 0; } - chainId = parseInt(chainId); - } - - if (typeof(chainId) !== "number") { chainId = 0; } - - result.chainId = chainId; - } - */ - // 0x0000... should actually be null - if (result.blockHash && getBigInt(result.blockHash) === BN_0) { - result.blockHash = null; - } - return result; - } - - const EnsAddress = "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"; - /** - * A **NetworkPlugin** provides additional functionality on a [[Network]]. - */ - class NetworkPlugin { - /** - * The name of the plugin. - * - * It is recommended to use reverse-domain-notation, which permits - * unique names with a known authority as well as hierarchal entries. - */ - name; - /** - * Creates a new **NetworkPlugin**. - */ - constructor(name) { - defineProperties(this, { name }); - } - /** - * Creates a copy of this plugin. - */ - clone() { - return new NetworkPlugin(this.name); - } - } - /** - * A **GasCostPlugin** allows a network to provide alternative values when - * computing the intrinsic gas required for a transaction. - */ - class GasCostPlugin extends NetworkPlugin { - /** - * The block number to treat these values as valid from. - * - * This allows a hardfork to have updated values included as well as - * mulutiple hardforks to be supported. - */ - effectiveBlock; - /** - * The transactions base fee. - */ - txBase; - /** - * The fee for creating a new account. - */ - txCreate; - /** - * The fee per zero-byte in the data. - */ - txDataZero; - /** - * The fee per non-zero-byte in the data. - */ - txDataNonzero; - /** - * The fee per storage key in the [[link-eip-2930]] access list. - */ - txAccessListStorageKey; - /** - * The fee per address in the [[link-eip-2930]] access list. - */ - txAccessListAddress; - /** - * Creates a new GasCostPlugin from %%effectiveBlock%% until the - * latest block or another GasCostPlugin supercedes that block number, - * with the associated %%costs%%. - */ - constructor(effectiveBlock, costs) { - if (effectiveBlock == null) { - effectiveBlock = 0; - } - super(`org.ethers.network.plugins.GasCost#${(effectiveBlock || 0)}`); - const props = { effectiveBlock }; - function set(name, nullish) { - let value = (costs || {})[name]; - if (value == null) { - value = nullish; - } - assertArgument(typeof (value) === "number", `invalud value for ${name}`, "costs", costs); - props[name] = value; - } - set("txBase", 21000); - set("txCreate", 32000); - set("txDataZero", 4); - set("txDataNonzero", 16); - set("txAccessListStorageKey", 1900); - set("txAccessListAddress", 2400); - defineProperties(this, props); - } - clone() { - return new GasCostPlugin(this.effectiveBlock, this); - } - } - /** - * An **EnsPlugin** allows a [[Network]] to specify the ENS Registry - * Contract address and the target network to use when using that - * contract. - * - * Various testnets have their own instance of the contract to use, but - * in general, the mainnet instance supports multi-chain addresses and - * should be used. - */ - class EnsPlugin extends NetworkPlugin { - /** - * The ENS Registrty Contract address. - */ - address; - /** - * The chain ID that the ENS contract lives on. - */ - targetNetwork; - /** - * Creates a new **EnsPlugin** connected to %%address%% on the - * %%targetNetwork%%. The default ENS address and mainnet is used - * if unspecified. - */ - constructor(address, targetNetwork) { - super("org.ethers.plugins.network.Ens"); - defineProperties(this, { - address: (address || EnsAddress), - targetNetwork: ((targetNetwork == null) ? 1 : targetNetwork) - }); - } - clone() { - return new EnsPlugin(this.address, this.targetNetwork); - } - } - /** - * A **FeeDataNetworkPlugin** allows a network to provide and alternate - * means to specify its fee data. - * - * For example, a network which does not support [[link-eip-1559]] may - * choose to use a Gas Station site to approximate the gas price. - */ - class FeeDataNetworkPlugin extends NetworkPlugin { - #feeDataFunc; - /** - * The fee data function provided to the constructor. - */ - get feeDataFunc() { - return this.#feeDataFunc; - } - /** - * Creates a new **FeeDataNetworkPlugin**. - */ - constructor(feeDataFunc) { - super("org.ethers.plugins.network.FeeData"); - this.#feeDataFunc = feeDataFunc; - } - /** - * Resolves to the fee data. - */ - async getFeeData(provider) { - return await this.#feeDataFunc(provider); - } - clone() { - return new FeeDataNetworkPlugin(this.#feeDataFunc); - } - } - class FetchUrlFeeDataNetworkPlugin extends NetworkPlugin { - #url; - #processFunc; - /** - * The URL to initialize the FetchRequest with in %%processFunc%%. - */ - get url() { return this.#url; } - /** - * The callback to use when computing the FeeData. - */ - get processFunc() { return this.#processFunc; } - /** - * Creates a new **FetchUrlFeeDataNetworkPlugin** which will - * be used when computing the fee data for the network. - */ - constructor(url, processFunc) { - super("org.ethers.plugins.network.FetchUrlFeeDataPlugin"); - this.#url = url; - this.#processFunc = processFunc; - } - // We are immutable, so we can serve as our own clone - clone() { return this; } - } - /* - export class CustomBlockNetworkPlugin extends NetworkPlugin { - readonly #blockFunc: (provider: Provider, block: BlockParams) => Block; - readonly #blockWithTxsFunc: (provider: Provider, block: BlockParams) => Block; - - constructor(blockFunc: (provider: Provider, block: BlockParams) => Block, blockWithTxsFunc: (provider: Provider, block: BlockParams) => Block) { - super("org.ethers.network-plugins.custom-block"); - this.#blockFunc = blockFunc; - this.#blockWithTxsFunc = blockWithTxsFunc; - } - - async getBlock(provider: Provider, block: BlockParams): Promise> { - return await this.#blockFunc(provider, block); - } - - async getBlockions(provider: Provider, block: BlockParams): Promise> { - return await this.#blockWithTxsFunc(provider, block); - } - - clone(): CustomBlockNetworkPlugin { - return new CustomBlockNetworkPlugin(this.#blockFunc, this.#blockWithTxsFunc); - } - } - */ - - /** - * A **Network** encapsulates the various properties required to - * interact with a specific chain. - * - * @_subsection: api/providers:Networks [networks] - */ - /* * * * - // Networks which operation against an L2 can use this plugin to - // specify how to access L1, for the purpose of resolving ENS, - // for example. - export class LayerOneConnectionPlugin extends NetworkPlugin { - readonly provider!: Provider; - // @TODO: Rename to ChainAccess and allow for connecting to any chain - constructor(provider: Provider) { - super("org.ethers.plugins.layer-one-connection"); - defineProperties(this, { provider }); - } - - clone(): LayerOneConnectionPlugin { - return new LayerOneConnectionPlugin(this.provider); - } - } - */ - const Networks = new Map(); - /** - * A **Network** provides access to a chain's properties and allows - * for plug-ins to extend functionality. - */ - class Network { - #name; - #chainId; - #plugins; - /** - * Creates a new **Network** for %%name%% and %%chainId%%. - */ - constructor(name, chainId) { - this.#name = name; - this.#chainId = getBigInt(chainId); - this.#plugins = new Map(); - } - /** - * Returns a JSON-compatible representation of a Network. - */ - toJSON() { - return { name: this.name, chainId: String(this.chainId) }; - } - /** - * The network common name. - * - * This is the canonical name, as networks migh have multiple - * names. - */ - get name() { return this.#name; } - set name(value) { this.#name = value; } - /** - * The network chain ID. - */ - get chainId() { return this.#chainId; } - set chainId(value) { this.#chainId = getBigInt(value, "chainId"); } - /** - * Returns true if %%other%% matches this network. Any chain ID - * must match, and if no chain ID is present, the name must match. - * - * This method does not currently check for additional properties, - * such as ENS address or plug-in compatibility. - */ - matches(other) { - if (other == null) { - return false; - } - if (typeof (other) === "string") { - try { - return (this.chainId === getBigInt(other)); - } - catch (error) { } - return (this.name === other); - } - if (typeof (other) === "number" || typeof (other) === "bigint") { - try { - return (this.chainId === getBigInt(other)); - } - catch (error) { } - return false; - } - if (typeof (other) === "object") { - if (other.chainId != null) { - try { - return (this.chainId === getBigInt(other.chainId)); - } - catch (error) { } - return false; - } - if (other.name != null) { - return (this.name === other.name); - } - return false; - } - return false; - } - /** - * Returns the list of plugins currently attached to this Network. - */ - get plugins() { - return Array.from(this.#plugins.values()); - } - /** - * Attach a new %%plugin%% to this Network. The network name - * must be unique, excluding any fragment. - */ - attachPlugin(plugin) { - if (this.#plugins.get(plugin.name)) { - throw new Error(`cannot replace existing plugin: ${plugin.name} `); - } - this.#plugins.set(plugin.name, plugin.clone()); - return this; - } - /** - * Return the plugin, if any, matching %%name%% exactly. Plugins - * with fragments will not be returned unless %%name%% includes - * a fragment. - */ - getPlugin(name) { - return (this.#plugins.get(name)) || null; - } - /** - * Gets a list of all plugins that match %%name%%, with otr without - * a fragment. - */ - getPlugins(basename) { - return (this.plugins.filter((p) => (p.name.split("#")[0] === basename))); - } - /** - * Create a copy of this Network. - */ - clone() { - const clone = new Network(this.name, this.chainId); - this.plugins.forEach((plugin) => { - clone.attachPlugin(plugin.clone()); - }); - return clone; - } - /** - * Compute the intrinsic gas required for a transaction. - * - * A GasCostPlugin can be attached to override the default - * values. - */ - computeIntrinsicGas(tx) { - const costs = this.getPlugin("org.ethers.plugins.network.GasCost") || (new GasCostPlugin()); - let gas = costs.txBase; - if (tx.to == null) { - gas += costs.txCreate; - } - if (tx.data) { - for (let i = 2; i < tx.data.length; i += 2) { - if (tx.data.substring(i, i + 2) === "00") { - gas += costs.txDataZero; - } - else { - gas += costs.txDataNonzero; - } - } - } - if (tx.accessList) { - const accessList = accessListify(tx.accessList); - for (const addr in accessList) { - gas += costs.txAccessListAddress + costs.txAccessListStorageKey * accessList[addr].storageKeys.length; - } - } - return gas; - } - /** - * Returns a new Network for the %%network%% name or chainId. - */ - static from(network) { - injectCommonNetworks(); - // Default network - if (network == null) { - return Network.from("mainnet"); - } - // Canonical name or chain ID - if (typeof (network) === "number") { - network = BigInt(network); - } - if (typeof (network) === "string" || typeof (network) === "bigint") { - const networkFunc = Networks.get(network); - if (networkFunc) { - return networkFunc(); - } - if (typeof (network) === "bigint") { - return new Network("unknown", network); - } - assertArgument(false, "unknown network", "network", network); - } - // Clonable with network-like abilities - if (typeof (network.clone) === "function") { - const clone = network.clone(); - //if (typeof(network.name) !== "string" || typeof(network.chainId) !== "number") { - //} - return clone; - } - // Networkish - if (typeof (network) === "object") { - assertArgument(typeof (network.name) === "string" && typeof (network.chainId) === "number", "invalid network object name or chainId", "network", network); - const custom = new Network((network.name), (network.chainId)); - if (network.ensAddress || network.ensNetwork != null) { - custom.attachPlugin(new EnsPlugin(network.ensAddress, network.ensNetwork)); - } - //if ((network).layerOneConnection) { - // custom.attachPlugin(new LayerOneConnectionPlugin((network).layerOneConnection)); - //} - return custom; - } - assertArgument(false, "invalid network", "network", network); - } - /** - * Register %%nameOrChainId%% with a function which returns - * an instance of a Network representing that chain. - */ - static register(nameOrChainId, networkFunc) { - if (typeof (nameOrChainId) === "number") { - nameOrChainId = BigInt(nameOrChainId); - } - const existing = Networks.get(nameOrChainId); - if (existing) { - assertArgument(false, `conflicting network for ${JSON.stringify(existing.name)}`, "nameOrChainId", nameOrChainId); - } - Networks.set(nameOrChainId, networkFunc); - } - } - // We don't want to bring in formatUnits because it is backed by - // FixedNumber and we want to keep Networks tiny. The values - // included by the Gas Stations are also IEEE 754 with lots of - // rounding issues and exceed the strict checks formatUnits has. - function parseUnits(_value, decimals) { - const value = String(_value); - if (!value.match(/^[0-9.]+$/)) { - throw new Error(`invalid gwei value: ${_value}`); - } - // Break into [ whole, fraction ] - const comps = value.split("."); - if (comps.length === 1) { - comps.push(""); - } - // More than 1 decimal point or too many fractional positions - if (comps.length !== 2) { - throw new Error(`invalid gwei value: ${_value}`); - } - // Pad the fraction to 9 decimalplaces - while (comps[1].length < decimals) { - comps[1] += "0"; - } - // Too many decimals and some non-zero ending, take the ceiling - if (comps[1].length > 9) { - let frac = BigInt(comps[1].substring(0, 9)); - if (!comps[1].substring(9).match(/^0+$/)) { - frac++; - } - comps[1] = frac.toString(); - } - return BigInt(comps[0] + comps[1]); - } - // Used by Polygon to use a gas station for fee data - function getGasStationPlugin(url) { - return new FetchUrlFeeDataNetworkPlugin(url, async (fetchFeeData, provider, request) => { - // Prevent Cloudflare from blocking our request in node.js - request.setHeader("User-Agent", "ethers"); - let response; - try { - const [_response, _feeData] = await Promise.all([ - request.send(), fetchFeeData() - ]); - response = _response; - const payload = response.bodyJson.standard; - const feeData = { - gasPrice: _feeData.gasPrice, - maxFeePerGas: parseUnits(payload.maxFee, 9), - maxPriorityFeePerGas: parseUnits(payload.maxPriorityFee, 9), - }; - return feeData; - } - catch (error) { - assert(false, `error encountered with polygon gas station (${JSON.stringify(request.url)})`, "SERVER_ERROR", { request, response, error }); - } - }); - } - // See: https://chainlist.org - let injected = false; - function injectCommonNetworks() { - if (injected) { - return; - } - injected = true; - /// Register popular Ethereum networks - function registerEth(name, chainId, options) { - const func = function () { - const network = new Network(name, chainId); - // We use 0 to disable ENS - if (options.ensNetwork != null) { - network.attachPlugin(new EnsPlugin(null, options.ensNetwork)); - } - network.attachPlugin(new GasCostPlugin()); - (options.plugins || []).forEach((plugin) => { - network.attachPlugin(plugin); - }); - return network; - }; - // Register the network by name and chain ID - Network.register(name, func); - Network.register(chainId, func); - if (options.altNames) { - options.altNames.forEach((name) => { - Network.register(name, func); - }); - } - } - registerEth("mainnet", 1, { ensNetwork: 1, altNames: ["homestead"] }); - registerEth("ropsten", 3, { ensNetwork: 3 }); - registerEth("rinkeby", 4, { ensNetwork: 4 }); - registerEth("goerli", 5, { ensNetwork: 5 }); - registerEth("kovan", 42, { ensNetwork: 42 }); - registerEth("sepolia", 11155111, { ensNetwork: 11155111 }); - registerEth("holesky", 17000, { ensNetwork: 17000 }); - registerEth("classic", 61, {}); - registerEth("classicKotti", 6, {}); - registerEth("arbitrum", 42161, { - ensNetwork: 1, - }); - registerEth("arbitrum-goerli", 421613, {}); - registerEth("arbitrum-sepolia", 421614, {}); - registerEth("base", 8453, { ensNetwork: 1 }); - registerEth("base-goerli", 84531, {}); - registerEth("base-sepolia", 84532, {}); - registerEth("bnb", 56, { ensNetwork: 1 }); - registerEth("bnbt", 97, {}); - registerEth("filecoin", 314, {}); - registerEth("filecoin-calibration", 314159, {}); - registerEth("linea", 59144, { ensNetwork: 1 }); - registerEth("linea-goerli", 59140, {}); - registerEth("linea-sepolia", 59141, {}); - registerEth("matic", 137, { - ensNetwork: 1, - plugins: [ - getGasStationPlugin("https:/\/gasstation.polygon.technology/v2") - ] - }); - registerEth("matic-amoy", 80002, {}); - registerEth("matic-mumbai", 80001, { - altNames: ["maticMumbai", "maticmum"], - plugins: [ - getGasStationPlugin("https:/\/gasstation-testnet.polygon.technology/v2") - ] - }); - registerEth("optimism", 10, { - ensNetwork: 1, - plugins: [] - }); - registerEth("optimism-goerli", 420, {}); - registerEth("optimism-sepolia", 11155420, {}); - registerEth("xdai", 100, { ensNetwork: 1 }); - } - - function copy$2(obj) { - return JSON.parse(JSON.stringify(obj)); - } - // @TODO: refactor this - /** - * A **PollingBlockSubscriber** polls at a regular interval for a change - * in the block number. - * - * @_docloc: api/providers/abstract-provider - */ - class PollingBlockSubscriber { - #provider; - #poller; - #interval; - // The most recent block we have scanned for events. The value -2 - // indicates we still need to fetch an initial block number - #blockNumber; - /** - * Create a new **PollingBlockSubscriber** attached to %%provider%%. - */ - constructor(provider) { - this.#provider = provider; - this.#poller = null; - this.#interval = 4000; - this.#blockNumber = -2; - } - /** - * The polling interval. - */ - get pollingInterval() { return this.#interval; } - set pollingInterval(value) { this.#interval = value; } - async #poll() { - try { - const blockNumber = await this.#provider.getBlockNumber(); - // Bootstrap poll to setup our initial block number - if (this.#blockNumber === -2) { - this.#blockNumber = blockNumber; - return; - } - // @TODO: Put a cap on the maximum number of events per loop? - if (blockNumber !== this.#blockNumber) { - for (let b = this.#blockNumber + 1; b <= blockNumber; b++) { - // We have been stopped - if (this.#poller == null) { - return; - } - await this.#provider.emit("block", b); - } - this.#blockNumber = blockNumber; - } - } - catch (error) { - // @TODO: Minor bump, add an "error" event to let subscribers - // know things went awry. - //console.log(error); - } - // We have been stopped - if (this.#poller == null) { - return; - } - this.#poller = this.#provider._setTimeout(this.#poll.bind(this), this.#interval); - } - start() { - if (this.#poller) { - return; - } - this.#poller = this.#provider._setTimeout(this.#poll.bind(this), this.#interval); - this.#poll(); - } - stop() { - if (!this.#poller) { - return; - } - this.#provider._clearTimeout(this.#poller); - this.#poller = null; - } - pause(dropWhilePaused) { - this.stop(); - if (dropWhilePaused) { - this.#blockNumber = -2; - } - } - resume() { - this.start(); - } - } - /** - * An **OnBlockSubscriber** can be sub-classed, with a [[_poll]] - * implmentation which will be called on every new block. - * - * @_docloc: api/providers/abstract-provider - */ - class OnBlockSubscriber { - #provider; - #poll; - #running; - /** - * Create a new **OnBlockSubscriber** attached to %%provider%%. - */ - constructor(provider) { - this.#provider = provider; - this.#running = false; - this.#poll = (blockNumber) => { - this._poll(blockNumber, this.#provider); - }; - } - /** - * Called on every new block. - */ - async _poll(blockNumber, provider) { - throw new Error("sub-classes must override this"); - } - start() { - if (this.#running) { - return; - } - this.#running = true; - this.#poll(-2); - this.#provider.on("block", this.#poll); - } - stop() { - if (!this.#running) { - return; - } - this.#running = false; - this.#provider.off("block", this.#poll); - } - pause(dropWhilePaused) { this.stop(); } - resume() { this.start(); } - } - class PollingBlockTagSubscriber extends OnBlockSubscriber { - #tag; - #lastBlock; - constructor(provider, tag) { - super(provider); - this.#tag = tag; - this.#lastBlock = -2; - } - pause(dropWhilePaused) { - if (dropWhilePaused) { - this.#lastBlock = -2; - } - super.pause(dropWhilePaused); - } - async _poll(blockNumber, provider) { - const block = await provider.getBlock(this.#tag); - if (block == null) { - return; - } - if (this.#lastBlock === -2) { - this.#lastBlock = block.number; - } - else if (block.number > this.#lastBlock) { - provider.emit(this.#tag, block.number); - this.#lastBlock = block.number; - } - } - } - /** - * @_ignore: - * - * @_docloc: api/providers/abstract-provider - */ - class PollingOrphanSubscriber extends OnBlockSubscriber { - #filter; - constructor(provider, filter) { - super(provider); - this.#filter = copy$2(filter); - } - async _poll(blockNumber, provider) { - throw new Error("@TODO"); - } - } - /** - * A **PollingTransactionSubscriber** will poll for a given transaction - * hash for its receipt. - * - * @_docloc: api/providers/abstract-provider - */ - class PollingTransactionSubscriber extends OnBlockSubscriber { - #hash; - /** - * Create a new **PollingTransactionSubscriber** attached to - * %%provider%%, listening for %%hash%%. - */ - constructor(provider, hash) { - super(provider); - this.#hash = hash; - } - async _poll(blockNumber, provider) { - const tx = await provider.getTransactionReceipt(this.#hash); - if (tx) { - provider.emit(this.#hash, tx); - } - } - } - /** - * A **PollingEventSubscriber** will poll for a given filter for its logs. - * - * @_docloc: api/providers/abstract-provider - */ - class PollingEventSubscriber { - #provider; - #filter; - #poller; - #running; - // The most recent block we have scanned for events. The value -2 - // indicates we still need to fetch an initial block number - #blockNumber; - /** - * Create a new **PollingTransactionSubscriber** attached to - * %%provider%%, listening for %%filter%%. - */ - constructor(provider, filter) { - this.#provider = provider; - this.#filter = copy$2(filter); - this.#poller = this.#poll.bind(this); - this.#running = false; - this.#blockNumber = -2; - } - async #poll(blockNumber) { - // The initial block hasn't been determined yet - if (this.#blockNumber === -2) { - return; - } - const filter = copy$2(this.#filter); - filter.fromBlock = this.#blockNumber + 1; - filter.toBlock = blockNumber; - const logs = await this.#provider.getLogs(filter); - // No logs could just mean the node has not indexed them yet, - // so we keep a sliding window of 60 blocks to keep scanning - if (logs.length === 0) { - if (this.#blockNumber < blockNumber - 60) { - this.#blockNumber = blockNumber - 60; - } - return; - } - for (const log of logs) { - this.#provider.emit(this.#filter, log); - // Only advance the block number when logs were found to - // account for networks (like BNB and Polygon) which may - // sacrifice event consistency for block event speed - this.#blockNumber = log.blockNumber; - } - } - start() { - if (this.#running) { - return; - } - this.#running = true; - if (this.#blockNumber === -2) { - this.#provider.getBlockNumber().then((blockNumber) => { - this.#blockNumber = blockNumber; - }); - } - this.#provider.on("block", this.#poller); - } - stop() { - if (!this.#running) { - return; - } - this.#running = false; - this.#provider.off("block", this.#poller); - } - pause(dropWhilePaused) { - this.stop(); - if (dropWhilePaused) { - this.#blockNumber = -2; - } - } - resume() { - this.start(); - } - } - - /** - * The available providers should suffice for most developers purposes, - * but the [[AbstractProvider]] class has many features which enable - * sub-classing it for specific purposes. - * - * @_section: api/providers/abstract-provider: Subclassing Provider [abstract-provider] - */ - // @TODO - // Event coalescence - // When we register an event with an async value (e.g. address is a Signer - // or ENS name), we need to add it immeidately for the Event API, but also - // need time to resolve the address. Upon resolving the address, we need to - // migrate the listener to the static event. We also need to maintain a map - // of Signer/ENS name to address so we can sync respond to listenerCount. - // Constants - const BN_2$1 = BigInt(2); - const MAX_CCIP_REDIRECTS = 10; - function isPromise$1(value) { - return (value && typeof (value.then) === "function"); - } - function getTag(prefix, value) { - return prefix + ":" + JSON.stringify(value, (k, v) => { - if (v == null) { - return "null"; - } - if (typeof (v) === "bigint") { - return `bigint:${v.toString()}`; - } - if (typeof (v) === "string") { - return v.toLowerCase(); - } - // Sort object keys - if (typeof (v) === "object" && !Array.isArray(v)) { - const keys = Object.keys(v); - keys.sort(); - return keys.reduce((accum, key) => { - accum[key] = v[key]; - return accum; - }, {}); - } - return v; - }); - } - /** - * An **UnmanagedSubscriber** is useful for events which do not require - * any additional management, such as ``"debug"`` which only requires - * emit in synchronous event loop triggered calls. - */ - class UnmanagedSubscriber { - /** - * The name fof the event. - */ - name; - /** - * Create a new UnmanagedSubscriber with %%name%%. - */ - constructor(name) { defineProperties(this, { name }); } - start() { } - stop() { } - pause(dropWhilePaused) { } - resume() { } - } - function copy$1(value) { - return JSON.parse(JSON.stringify(value)); - } - function concisify(items) { - items = Array.from((new Set(items)).values()); - items.sort(); - return items; - } - async function getSubscription(_event, provider) { - if (_event == null) { - throw new Error("invalid event"); - } - // Normalize topic array info an EventFilter - if (Array.isArray(_event)) { - _event = { topics: _event }; - } - if (typeof (_event) === "string") { - switch (_event) { - case "block": - case "debug": - case "error": - case "finalized": - case "network": - case "pending": - case "safe": { - return { type: _event, tag: _event }; - } - } - } - if (isHexString(_event, 32)) { - const hash = _event.toLowerCase(); - return { type: "transaction", tag: getTag("tx", { hash }), hash }; - } - if (_event.orphan) { - const event = _event; - // @TODO: Should lowercase and whatnot things here instead of copy... - return { type: "orphan", tag: getTag("orphan", event), filter: copy$1(event) }; - } - if ((_event.address || _event.topics)) { - const event = _event; - const filter = { - topics: ((event.topics || []).map((t) => { - if (t == null) { - return null; - } - if (Array.isArray(t)) { - return concisify(t.map((t) => t.toLowerCase())); - } - return t.toLowerCase(); - })) - }; - if (event.address) { - const addresses = []; - const promises = []; - const addAddress = (addr) => { - if (isHexString(addr)) { - addresses.push(addr); - } - else { - promises.push((async () => { - addresses.push(await resolveAddress(addr, provider)); - })()); - } - }; - if (Array.isArray(event.address)) { - event.address.forEach(addAddress); - } - else { - addAddress(event.address); - } - if (promises.length) { - await Promise.all(promises); - } - filter.address = concisify(addresses.map((a) => a.toLowerCase())); - } - return { filter, tag: getTag("event", filter), type: "event" }; - } - assertArgument(false, "unknown ProviderEvent", "event", _event); - } - function getTime$1() { return (new Date()).getTime(); } - const defaultOptions$1 = { - cacheTimeout: 250, - pollingInterval: 4000 - }; - /** - * An **AbstractProvider** provides a base class for other sub-classes to - * implement the [[Provider]] API by normalizing input arguments and - * formatting output results as well as tracking events for consistent - * behaviour on an eventually-consistent network. - */ - class AbstractProvider { - #subs; - #plugins; - // null=unpaused, true=paused+dropWhilePaused, false=paused - #pausedState; - #destroyed; - #networkPromise; - #anyNetwork; - #performCache; - // The most recent block number if running an event or -1 if no "block" event - #lastBlockNumber; - #nextTimer; - #timers; - #disableCcipRead; - #options; - /** - * Create a new **AbstractProvider** connected to %%network%%, or - * use the various network detection capabilities to discover the - * [[Network]] if necessary. - */ - constructor(_network, options) { - this.#options = Object.assign({}, defaultOptions$1, options || {}); - if (_network === "any") { - this.#anyNetwork = true; - this.#networkPromise = null; - } - else if (_network) { - const network = Network.from(_network); - this.#anyNetwork = false; - this.#networkPromise = Promise.resolve(network); - setTimeout(() => { this.emit("network", network, null); }, 0); - } - else { - this.#anyNetwork = false; - this.#networkPromise = null; - } - this.#lastBlockNumber = -1; - this.#performCache = new Map(); - this.#subs = new Map(); - this.#plugins = new Map(); - this.#pausedState = null; - this.#destroyed = false; - this.#nextTimer = 1; - this.#timers = new Map(); - this.#disableCcipRead = false; - } - get pollingInterval() { return this.#options.pollingInterval; } - /** - * Returns ``this``, to allow an **AbstractProvider** to implement - * the [[ContractRunner]] interface. - */ - get provider() { return this; } - /** - * Returns all the registered plug-ins. - */ - get plugins() { - return Array.from(this.#plugins.values()); - } - /** - * Attach a new plug-in. - */ - attachPlugin(plugin) { - if (this.#plugins.get(plugin.name)) { - throw new Error(`cannot replace existing plugin: ${plugin.name} `); - } - this.#plugins.set(plugin.name, plugin.connect(this)); - return this; - } - /** - * Get a plugin by name. - */ - getPlugin(name) { - return (this.#plugins.get(name)) || null; - } - /** - * Prevent any CCIP-read operation, regardless of whether requested - * in a [[call]] using ``enableCcipRead``. - */ - get disableCcipRead() { return this.#disableCcipRead; } - set disableCcipRead(value) { this.#disableCcipRead = !!value; } - // Shares multiple identical requests made during the same 250ms - async #perform(req) { - const timeout = this.#options.cacheTimeout; - // Caching disabled - if (timeout < 0) { - return await this._perform(req); - } - // Create a tag - const tag = getTag(req.method, req); - let perform = this.#performCache.get(tag); - if (!perform) { - perform = this._perform(req); - this.#performCache.set(tag, perform); - setTimeout(() => { - if (this.#performCache.get(tag) === perform) { - this.#performCache.delete(tag); - } - }, timeout); - } - return await perform; - } - /** - * Resolves to the data for executing the CCIP-read operations. - */ - async ccipReadFetch(tx, calldata, urls) { - if (this.disableCcipRead || urls.length === 0 || tx.to == null) { - return null; - } - const sender = tx.to.toLowerCase(); - const data = calldata.toLowerCase(); - const errorMessages = []; - for (let i = 0; i < urls.length; i++) { - const url = urls[i]; - // URL expansion - const href = url.replace("{sender}", sender).replace("{data}", data); - // If no {data} is present, use POST; otherwise GET - //const json: string | null = (url.indexOf("{data}") >= 0) ? null: JSON.stringify({ data, sender }); - //const result = await fetchJson({ url: href, errorPassThrough: true }, json, (value, response) => { - // value.status = response.statusCode; - // return value; - //}); - const request = new FetchRequest(href); - if (url.indexOf("{data}") === -1) { - request.body = { data, sender }; - } - this.emit("debug", { action: "sendCcipReadFetchRequest", request, index: i, urls }); - let errorMessage = "unknown error"; - // Fetch the resource... - let resp; - try { - resp = await request.send(); - } - catch (error) { - // ...low-level fetch error (missing host, bad SSL, etc.), - // so try next URL - errorMessages.push(error.message); - this.emit("debug", { action: "receiveCcipReadFetchError", request, result: { error } }); - continue; - } - try { - const result = resp.bodyJson; - if (result.data) { - this.emit("debug", { action: "receiveCcipReadFetchResult", request, result }); - return result.data; - } - if (result.message) { - errorMessage = result.message; - } - this.emit("debug", { action: "receiveCcipReadFetchError", request, result }); - } - catch (error) { } - // 4xx indicates the result is not present; stop - assert(resp.statusCode < 400 || resp.statusCode >= 500, `response not found during CCIP fetch: ${errorMessage}`, "OFFCHAIN_FAULT", { reason: "404_MISSING_RESOURCE", transaction: tx, info: { url, errorMessage } }); - // 5xx indicates server issue; try the next url - errorMessages.push(errorMessage); - } - assert(false, `error encountered during CCIP fetch: ${errorMessages.map((m) => JSON.stringify(m)).join(", ")}`, "OFFCHAIN_FAULT", { - reason: "500_SERVER_ERROR", - transaction: tx, info: { urls, errorMessages } - }); - } - /** - * Provides the opportunity for a sub-class to wrap a block before - * returning it, to add additional properties or an alternate - * sub-class of [[Block]]. - */ - _wrapBlock(value, network) { - return new Block(formatBlock(value), this); - } - /** - * Provides the opportunity for a sub-class to wrap a log before - * returning it, to add additional properties or an alternate - * sub-class of [[Log]]. - */ - _wrapLog(value, network) { - return new Log(formatLog(value), this); - } - /** - * Provides the opportunity for a sub-class to wrap a transaction - * receipt before returning it, to add additional properties or an - * alternate sub-class of [[TransactionReceipt]]. - */ - _wrapTransactionReceipt(value, network) { - return new TransactionReceipt(formatTransactionReceipt(value), this); - } - /** - * Provides the opportunity for a sub-class to wrap a transaction - * response before returning it, to add additional properties or an - * alternate sub-class of [[TransactionResponse]]. - */ - _wrapTransactionResponse(tx, network) { - return new TransactionResponse(formatTransactionResponse(tx), this); - } - /** - * Resolves to the Network, forcing a network detection using whatever - * technique the sub-class requires. - * - * Sub-classes **must** override this. - */ - _detectNetwork() { - assert(false, "sub-classes must implement this", "UNSUPPORTED_OPERATION", { - operation: "_detectNetwork" - }); - } - /** - * Sub-classes should use this to perform all built-in operations. All - * methods sanitizes and normalizes the values passed into this. - * - * Sub-classes **must** override this. - */ - async _perform(req) { - assert(false, `unsupported method: ${req.method}`, "UNSUPPORTED_OPERATION", { - operation: req.method, - info: req - }); - } - // State - async getBlockNumber() { - const blockNumber = getNumber(await this.#perform({ method: "getBlockNumber" }), "%response"); - if (this.#lastBlockNumber >= 0) { - this.#lastBlockNumber = blockNumber; - } - return blockNumber; - } - /** - * Returns or resolves to the address for %%address%%, resolving ENS - * names and [[Addressable]] objects and returning if already an - * address. - */ - _getAddress(address) { - return resolveAddress(address, this); - } - /** - * Returns or resolves to a valid block tag for %%blockTag%%, resolving - * negative values and returning if already a valid block tag. - */ - _getBlockTag(blockTag) { - if (blockTag == null) { - return "latest"; - } - switch (blockTag) { - case "earliest": - return "0x0"; - case "finalized": - case "latest": - case "pending": - case "safe": - return blockTag; - } - if (isHexString(blockTag)) { - if (isHexString(blockTag, 32)) { - return blockTag; - } - return toQuantity(blockTag); - } - if (typeof (blockTag) === "bigint") { - blockTag = getNumber(blockTag, "blockTag"); - } - if (typeof (blockTag) === "number") { - if (blockTag >= 0) { - return toQuantity(blockTag); - } - if (this.#lastBlockNumber >= 0) { - return toQuantity(this.#lastBlockNumber + blockTag); - } - return this.getBlockNumber().then((b) => toQuantity(b + blockTag)); - } - assertArgument(false, "invalid blockTag", "blockTag", blockTag); - } - /** - * Returns or resolves to a filter for %%filter%%, resolving any ENS - * names or [[Addressable]] object and returning if already a valid - * filter. - */ - _getFilter(filter) { - // Create a canonical representation of the topics - const topics = (filter.topics || []).map((t) => { - if (t == null) { - return null; - } - if (Array.isArray(t)) { - return concisify(t.map((t) => t.toLowerCase())); - } - return t.toLowerCase(); - }); - const blockHash = ("blockHash" in filter) ? filter.blockHash : undefined; - const resolve = (_address, fromBlock, toBlock) => { - let address = undefined; - switch (_address.length) { - case 0: break; - case 1: - address = _address[0]; - break; - default: - _address.sort(); - address = _address; - } - if (blockHash) { - if (fromBlock != null || toBlock != null) { - throw new Error("invalid filter"); - } - } - const filter = {}; - if (address) { - filter.address = address; - } - if (topics.length) { - filter.topics = topics; - } - if (fromBlock) { - filter.fromBlock = fromBlock; - } - if (toBlock) { - filter.toBlock = toBlock; - } - if (blockHash) { - filter.blockHash = blockHash; - } - return filter; - }; - // Addresses could be async (ENS names or Addressables) - let address = []; - if (filter.address) { - if (Array.isArray(filter.address)) { - for (const addr of filter.address) { - address.push(this._getAddress(addr)); - } - } - else { - address.push(this._getAddress(filter.address)); - } - } - let fromBlock = undefined; - if ("fromBlock" in filter) { - fromBlock = this._getBlockTag(filter.fromBlock); - } - let toBlock = undefined; - if ("toBlock" in filter) { - toBlock = this._getBlockTag(filter.toBlock); - } - if (address.filter((a) => (typeof (a) !== "string")).length || - (fromBlock != null && typeof (fromBlock) !== "string") || - (toBlock != null && typeof (toBlock) !== "string")) { - return Promise.all([Promise.all(address), fromBlock, toBlock]).then((result) => { - return resolve(result[0], result[1], result[2]); - }); - } - return resolve(address, fromBlock, toBlock); - } - /** - * Returns or resolves to a transaction for %%request%%, resolving - * any ENS names or [[Addressable]] and returning if already a valid - * transaction. - */ - _getTransactionRequest(_request) { - const request = copyRequest(_request); - const promises = []; - ["to", "from"].forEach((key) => { - if (request[key] == null) { - return; - } - const addr = resolveAddress(request[key], this); - if (isPromise$1(addr)) { - promises.push((async function () { request[key] = await addr; })()); - } - else { - request[key] = addr; - } - }); - if (request.blockTag != null) { - const blockTag = this._getBlockTag(request.blockTag); - if (isPromise$1(blockTag)) { - promises.push((async function () { request.blockTag = await blockTag; })()); - } - else { - request.blockTag = blockTag; - } - } - if (promises.length) { - return (async function () { - await Promise.all(promises); - return request; - })(); - } - return request; - } - async getNetwork() { - // No explicit network was set and this is our first time - if (this.#networkPromise == null) { - // Detect the current network (shared with all calls) - const detectNetwork = (async () => { - try { - const network = await this._detectNetwork(); - this.emit("network", network, null); - return network; - } - catch (error) { - if (this.#networkPromise === detectNetwork) { - this.#networkPromise = null; - } - throw error; - } - })(); - this.#networkPromise = detectNetwork; - return (await detectNetwork).clone(); - } - const networkPromise = this.#networkPromise; - const [expected, actual] = await Promise.all([ - networkPromise, - this._detectNetwork() // The actual connected network - ]); - if (expected.chainId !== actual.chainId) { - if (this.#anyNetwork) { - // The "any" network can change, so notify listeners - this.emit("network", actual, expected); - // Update the network if something else hasn't already changed it - if (this.#networkPromise === networkPromise) { - this.#networkPromise = Promise.resolve(actual); - } - } - else { - // Otherwise, we do not allow changes to the underlying network - assert(false, `network changed: ${expected.chainId} => ${actual.chainId} `, "NETWORK_ERROR", { - event: "changed" - }); - } - } - return expected.clone(); - } - async getFeeData() { - const network = await this.getNetwork(); - const getFeeDataFunc = async () => { - const { _block, gasPrice, priorityFee } = await resolveProperties({ - _block: this.#getBlock("latest", false), - gasPrice: ((async () => { - try { - const value = await this.#perform({ method: "getGasPrice" }); - return getBigInt(value, "%response"); - } - catch (error) { } - return null; - })()), - priorityFee: ((async () => { - try { - const value = await this.#perform({ method: "getPriorityFee" }); - return getBigInt(value, "%response"); - } - catch (error) { } - return null; - })()) - }); - let maxFeePerGas = null; - let maxPriorityFeePerGas = null; - // These are the recommended EIP-1559 heuristics for fee data - const block = this._wrapBlock(_block, network); - if (block && block.baseFeePerGas) { - maxPriorityFeePerGas = (priorityFee != null) ? priorityFee : BigInt("1000000000"); - maxFeePerGas = (block.baseFeePerGas * BN_2$1) + maxPriorityFeePerGas; - } - return new FeeData(gasPrice, maxFeePerGas, maxPriorityFeePerGas); - }; - // Check for a FeeDataNetWorkPlugin - const plugin = network.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin"); - if (plugin) { - const req = new FetchRequest(plugin.url); - const feeData = await plugin.processFunc(getFeeDataFunc, this, req); - return new FeeData(feeData.gasPrice, feeData.maxFeePerGas, feeData.maxPriorityFeePerGas); - } - return await getFeeDataFunc(); - } - async estimateGas(_tx) { - let tx = this._getTransactionRequest(_tx); - if (isPromise$1(tx)) { - tx = await tx; - } - return getBigInt(await this.#perform({ - method: "estimateGas", transaction: tx - }), "%response"); - } - async #call(tx, blockTag, attempt) { - assert(attempt < MAX_CCIP_REDIRECTS, "CCIP read exceeded maximum redirections", "OFFCHAIN_FAULT", { - reason: "TOO_MANY_REDIRECTS", - transaction: Object.assign({}, tx, { blockTag, enableCcipRead: true }) - }); - // This came in as a PerformActionTransaction, so to/from are safe; we can cast - const transaction = copyRequest(tx); - try { - return hexlify(await this._perform({ method: "call", transaction, blockTag })); - } - catch (error) { - // CCIP Read OffchainLookup - if (!this.disableCcipRead && isCallException(error) && error.data && attempt >= 0 && blockTag === "latest" && transaction.to != null && dataSlice(error.data, 0, 4) === "0x556f1830") { - const data = error.data; - const txSender = await resolveAddress(transaction.to, this); - // Parse the CCIP Read Arguments - let ccipArgs; - try { - ccipArgs = parseOffchainLookup(dataSlice(error.data, 4)); - } - catch (error) { - assert(false, error.message, "OFFCHAIN_FAULT", { - reason: "BAD_DATA", transaction, info: { data } - }); - } - // Check the sender of the OffchainLookup matches the transaction - assert(ccipArgs.sender.toLowerCase() === txSender.toLowerCase(), "CCIP Read sender mismatch", "CALL_EXCEPTION", { - action: "call", - data, - reason: "OffchainLookup", - transaction: transaction, - invocation: null, - revert: { - signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)", - name: "OffchainLookup", - args: ccipArgs.errorArgs - } - }); - const ccipResult = await this.ccipReadFetch(transaction, ccipArgs.calldata, ccipArgs.urls); - assert(ccipResult != null, "CCIP Read failed to fetch data", "OFFCHAIN_FAULT", { - reason: "FETCH_FAILED", transaction, info: { data: error.data, errorArgs: ccipArgs.errorArgs } - }); - const tx = { - to: txSender, - data: concat([ccipArgs.selector, encodeBytes([ccipResult, ccipArgs.extraData])]) - }; - this.emit("debug", { action: "sendCcipReadCall", transaction: tx }); - try { - const result = await this.#call(tx, blockTag, attempt + 1); - this.emit("debug", { action: "receiveCcipReadCallResult", transaction: Object.assign({}, tx), result }); - return result; - } - catch (error) { - this.emit("debug", { action: "receiveCcipReadCallError", transaction: Object.assign({}, tx), error }); - throw error; - } - } - throw error; - } - } - async #checkNetwork(promise) { - const { value } = await resolveProperties({ - network: this.getNetwork(), - value: promise - }); - return value; - } - async call(_tx) { - const { tx, blockTag } = await resolveProperties({ - tx: this._getTransactionRequest(_tx), - blockTag: this._getBlockTag(_tx.blockTag) - }); - return await this.#checkNetwork(this.#call(tx, blockTag, _tx.enableCcipRead ? 0 : -1)); - } - // Account - async #getAccountValue(request, _address, _blockTag) { - let address = this._getAddress(_address); - let blockTag = this._getBlockTag(_blockTag); - if (typeof (address) !== "string" || typeof (blockTag) !== "string") { - [address, blockTag] = await Promise.all([address, blockTag]); - } - return await this.#checkNetwork(this.#perform(Object.assign(request, { address, blockTag }))); - } - async getBalance(address, blockTag) { - return getBigInt(await this.#getAccountValue({ method: "getBalance" }, address, blockTag), "%response"); - } - async getTransactionCount(address, blockTag) { - return getNumber(await this.#getAccountValue({ method: "getTransactionCount" }, address, blockTag), "%response"); - } - async getCode(address, blockTag) { - return hexlify(await this.#getAccountValue({ method: "getCode" }, address, blockTag)); - } - async getStorage(address, _position, blockTag) { - const position = getBigInt(_position, "position"); - return hexlify(await this.#getAccountValue({ method: "getStorage", position }, address, blockTag)); - } - // Write - async broadcastTransaction(signedTx) { - const { blockNumber, hash, network } = await resolveProperties({ - blockNumber: this.getBlockNumber(), - hash: this._perform({ - method: "broadcastTransaction", - signedTransaction: signedTx - }), - network: this.getNetwork() - }); - const tx = Transaction.from(signedTx); - if (tx.hash !== hash) { - throw new Error("@TODO: the returned hash did not match"); - } - return this._wrapTransactionResponse(tx, network).replaceableTransaction(blockNumber); - } - async #getBlock(block, includeTransactions) { - // @TODO: Add CustomBlockPlugin check - if (isHexString(block, 32)) { - return await this.#perform({ - method: "getBlock", blockHash: block, includeTransactions - }); - } - let blockTag = this._getBlockTag(block); - if (typeof (blockTag) !== "string") { - blockTag = await blockTag; - } - return await this.#perform({ - method: "getBlock", blockTag, includeTransactions - }); - } - // Queries - async getBlock(block, prefetchTxs) { - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#getBlock(block, !!prefetchTxs) - }); - if (params == null) { - return null; - } - return this._wrapBlock(params, network); - } - async getTransaction(hash) { - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#perform({ method: "getTransaction", hash }) - }); - if (params == null) { - return null; - } - return this._wrapTransactionResponse(params, network); - } - async getTransactionReceipt(hash) { - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#perform({ method: "getTransactionReceipt", hash }) - }); - if (params == null) { - return null; - } - // Some backends did not backfill the effectiveGasPrice into old transactions - // in the receipt, so we look it up manually and inject it. - if (params.gasPrice == null && params.effectiveGasPrice == null) { - const tx = await this.#perform({ method: "getTransaction", hash }); - if (tx == null) { - throw new Error("report this; could not find tx or effectiveGasPrice"); - } - params.effectiveGasPrice = tx.gasPrice; - } - return this._wrapTransactionReceipt(params, network); - } - async getTransactionResult(hash) { - const { result } = await resolveProperties({ - network: this.getNetwork(), - result: this.#perform({ method: "getTransactionResult", hash }) - }); - if (result == null) { - return null; - } - return hexlify(result); - } - // Bloom-filter Queries - async getLogs(_filter) { - let filter = this._getFilter(_filter); - if (isPromise$1(filter)) { - filter = await filter; - } - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#perform({ method: "getLogs", filter }) - }); - return params.map((p) => this._wrapLog(p, network)); - } - // ENS - _getProvider(chainId) { - assert(false, "provider cannot connect to target network", "UNSUPPORTED_OPERATION", { - operation: "_getProvider()" - }); - } - async getResolver(name) { - return await EnsResolver.fromName(this, name); - } - async getAvatar(name) { - const resolver = await this.getResolver(name); - if (resolver) { - return await resolver.getAvatar(); - } - return null; - } - async resolveName(name) { - const resolver = await this.getResolver(name); - if (resolver) { - return await resolver.getAddress(); - } - return null; - } - async lookupAddress(address) { - address = getAddress(address); - const node = namehash(address.substring(2).toLowerCase() + ".addr.reverse"); - try { - const ensAddr = await EnsResolver.getEnsAddress(this); - const ensContract = new Contract(ensAddr, [ - "function resolver(bytes32) view returns (address)" - ], this); - const resolver = await ensContract.resolver(node); - if (resolver == null || resolver === ZeroAddress) { - return null; - } - const resolverContract = new Contract(resolver, [ - "function name(bytes32) view returns (string)" - ], this); - const name = await resolverContract.name(node); - // Failed forward resolution - const check = await this.resolveName(name); - if (check !== address) { - return null; - } - return name; - } - catch (error) { - // No data was returned from the resolver - if (isError(error, "BAD_DATA") && error.value === "0x") { - return null; - } - // Something reerted - if (isError(error, "CALL_EXCEPTION")) { - return null; - } - throw error; - } - return null; - } - async waitForTransaction(hash, _confirms, timeout) { - const confirms = (_confirms != null) ? _confirms : 1; - if (confirms === 0) { - return this.getTransactionReceipt(hash); - } - return new Promise(async (resolve, reject) => { - let timer = null; - const listener = (async (blockNumber) => { - try { - const receipt = await this.getTransactionReceipt(hash); - if (receipt != null) { - if (blockNumber - receipt.blockNumber + 1 >= confirms) { - resolve(receipt); - //this.off("block", listener); - if (timer) { - clearTimeout(timer); - timer = null; - } - return; - } - } - } - catch (error) { - console.log("EEE", error); - } - this.once("block", listener); - }); - if (timeout != null) { - timer = setTimeout(() => { - if (timer == null) { - return; - } - timer = null; - this.off("block", listener); - reject(makeError("timeout", "TIMEOUT", { reason: "timeout" })); - }, timeout); - } - listener(await this.getBlockNumber()); - }); - } - async waitForBlock(blockTag) { - assert(false, "not implemented yet", "NOT_IMPLEMENTED", { - operation: "waitForBlock" - }); - } - /** - * Clear a timer created using the [[_setTimeout]] method. - */ - _clearTimeout(timerId) { - const timer = this.#timers.get(timerId); - if (!timer) { - return; - } - if (timer.timer) { - clearTimeout(timer.timer); - } - this.#timers.delete(timerId); - } - /** - * Create a timer that will execute %%func%% after at least %%timeout%% - * (in ms). If %%timeout%% is unspecified, then %%func%% will execute - * in the next event loop. - * - * [Pausing](AbstractProvider-paused) the provider will pause any - * associated timers. - */ - _setTimeout(_func, timeout) { - if (timeout == null) { - timeout = 0; - } - const timerId = this.#nextTimer++; - const func = () => { - this.#timers.delete(timerId); - _func(); - }; - if (this.paused) { - this.#timers.set(timerId, { timer: null, func, time: timeout }); - } - else { - const timer = setTimeout(func, timeout); - this.#timers.set(timerId, { timer, func, time: getTime$1() }); - } - return timerId; - } - /** - * Perform %%func%% on each subscriber. - */ - _forEachSubscriber(func) { - for (const sub of this.#subs.values()) { - func(sub.subscriber); - } - } - /** - * Sub-classes may override this to customize subscription - * implementations. - */ - _getSubscriber(sub) { - switch (sub.type) { - case "debug": - case "error": - case "network": - return new UnmanagedSubscriber(sub.type); - case "block": { - const subscriber = new PollingBlockSubscriber(this); - subscriber.pollingInterval = this.pollingInterval; - return subscriber; - } - case "safe": - case "finalized": - return new PollingBlockTagSubscriber(this, sub.type); - case "event": - return new PollingEventSubscriber(this, sub.filter); - case "transaction": - return new PollingTransactionSubscriber(this, sub.hash); - case "orphan": - return new PollingOrphanSubscriber(this, sub.filter); - } - throw new Error(`unsupported event: ${sub.type}`); - } - /** - * If a [[Subscriber]] fails and needs to replace itself, this - * method may be used. - * - * For example, this is used for providers when using the - * ``eth_getFilterChanges`` method, which can return null if state - * filters are not supported by the backend, allowing the Subscriber - * to swap in a [[PollingEventSubscriber]]. - */ - _recoverSubscriber(oldSub, newSub) { - for (const sub of this.#subs.values()) { - if (sub.subscriber === oldSub) { - if (sub.started) { - sub.subscriber.stop(); - } - sub.subscriber = newSub; - if (sub.started) { - newSub.start(); - } - if (this.#pausedState != null) { - newSub.pause(this.#pausedState); - } - break; - } - } - } - async #hasSub(event, emitArgs) { - let sub = await getSubscription(event, this); - // This is a log that is removing an existing log; we actually want - // to emit an orphan event for the removed log - if (sub.type === "event" && emitArgs && emitArgs.length > 0 && emitArgs[0].removed === true) { - sub = await getSubscription({ orphan: "drop-log", log: emitArgs[0] }, this); - } - return this.#subs.get(sub.tag) || null; - } - async #getSub(event) { - const subscription = await getSubscription(event, this); - // Prevent tampering with our tag in any subclass' _getSubscriber - const tag = subscription.tag; - let sub = this.#subs.get(tag); - if (!sub) { - const subscriber = this._getSubscriber(subscription); - const addressableMap = new WeakMap(); - const nameMap = new Map(); - sub = { subscriber, tag, addressableMap, nameMap, started: false, listeners: [] }; - this.#subs.set(tag, sub); - } - return sub; - } - async on(event, listener) { - const sub = await this.#getSub(event); - sub.listeners.push({ listener, once: false }); - if (!sub.started) { - sub.subscriber.start(); - sub.started = true; - if (this.#pausedState != null) { - sub.subscriber.pause(this.#pausedState); - } - } - return this; - } - async once(event, listener) { - const sub = await this.#getSub(event); - sub.listeners.push({ listener, once: true }); - if (!sub.started) { - sub.subscriber.start(); - sub.started = true; - if (this.#pausedState != null) { - sub.subscriber.pause(this.#pausedState); - } - } - return this; - } - async emit(event, ...args) { - const sub = await this.#hasSub(event, args); - // If there is not subscription or if a recent emit removed - // the last of them (which also deleted the sub) do nothing - if (!sub || sub.listeners.length === 0) { - return false; - } - const count = sub.listeners.length; - sub.listeners = sub.listeners.filter(({ listener, once }) => { - const payload = new EventPayload(this, (once ? null : listener), event); - try { - listener.call(this, ...args, payload); - } - catch (error) { } - return !once; - }); - if (sub.listeners.length === 0) { - if (sub.started) { - sub.subscriber.stop(); - } - this.#subs.delete(sub.tag); - } - return (count > 0); - } - async listenerCount(event) { - if (event) { - const sub = await this.#hasSub(event); - if (!sub) { - return 0; - } - return sub.listeners.length; - } - let total = 0; - for (const { listeners } of this.#subs.values()) { - total += listeners.length; - } - return total; - } - async listeners(event) { - if (event) { - const sub = await this.#hasSub(event); - if (!sub) { - return []; - } - return sub.listeners.map(({ listener }) => listener); - } - let result = []; - for (const { listeners } of this.#subs.values()) { - result = result.concat(listeners.map(({ listener }) => listener)); - } - return result; - } - async off(event, listener) { - const sub = await this.#hasSub(event); - if (!sub) { - return this; - } - if (listener) { - const index = sub.listeners.map(({ listener }) => listener).indexOf(listener); - if (index >= 0) { - sub.listeners.splice(index, 1); - } - } - if (!listener || sub.listeners.length === 0) { - if (sub.started) { - sub.subscriber.stop(); - } - this.#subs.delete(sub.tag); - } - return this; - } - async removeAllListeners(event) { - if (event) { - const { tag, started, subscriber } = await this.#getSub(event); - if (started) { - subscriber.stop(); - } - this.#subs.delete(tag); - } - else { - for (const [tag, { started, subscriber }] of this.#subs) { - if (started) { - subscriber.stop(); - } - this.#subs.delete(tag); - } - } - return this; - } - // Alias for "on" - async addListener(event, listener) { - return await this.on(event, listener); - } - // Alias for "off" - async removeListener(event, listener) { - return this.off(event, listener); - } - /** - * If this provider has been destroyed using the [[destroy]] method. - * - * Once destroyed, all resources are reclaimed, internal event loops - * and timers are cleaned up and no further requests may be sent to - * the provider. - */ - get destroyed() { - return this.#destroyed; - } - /** - * Sub-classes may use this to shutdown any sockets or release their - * resources and reject any pending requests. - * - * Sub-classes **must** call ``super.destroy()``. - */ - destroy() { - // Stop all listeners - this.removeAllListeners(); - // Shut down all tiemrs - for (const timerId of this.#timers.keys()) { - this._clearTimeout(timerId); - } - this.#destroyed = true; - } - /** - * Whether the provider is currently paused. - * - * A paused provider will not emit any events, and generally should - * not make any requests to the network, but that is up to sub-classes - * to manage. - * - * Setting ``paused = true`` is identical to calling ``.pause(false)``, - * which will buffer any events that occur while paused until the - * provider is unpaused. - */ - get paused() { return (this.#pausedState != null); } - set paused(pause) { - if (!!pause === this.paused) { - return; - } - if (this.paused) { - this.resume(); - } - else { - this.pause(false); - } - } - /** - * Pause the provider. If %%dropWhilePaused%%, any events that occur - * while paused are dropped, otherwise all events will be emitted once - * the provider is unpaused. - */ - pause(dropWhilePaused) { - this.#lastBlockNumber = -1; - if (this.#pausedState != null) { - if (this.#pausedState == !!dropWhilePaused) { - return; - } - assert(false, "cannot change pause type; resume first", "UNSUPPORTED_OPERATION", { - operation: "pause" - }); - } - this._forEachSubscriber((s) => s.pause(dropWhilePaused)); - this.#pausedState = !!dropWhilePaused; - for (const timer of this.#timers.values()) { - // Clear the timer - if (timer.timer) { - clearTimeout(timer.timer); - } - // Remaining time needed for when we become unpaused - timer.time = getTime$1() - timer.time; - } - } - /** - * Resume the provider. - */ - resume() { - if (this.#pausedState == null) { - return; - } - this._forEachSubscriber((s) => s.resume()); - this.#pausedState = null; - for (const timer of this.#timers.values()) { - // Remaining time when we were paused - let timeout = timer.time; - if (timeout < 0) { - timeout = 0; - } - // Start time (in cause paused, so we con compute remaininf time) - timer.time = getTime$1(); - // Start the timer - setTimeout(timer.func, timeout); - } - } - } - function _parseString(result, start) { - try { - const bytes = _parseBytes(result, start); - if (bytes) { - return toUtf8String(bytes); - } - } - catch (error) { } - return null; - } - function _parseBytes(result, start) { - if (result === "0x") { - return null; - } - try { - const offset = getNumber(dataSlice(result, start, start + 32)); - const length = getNumber(dataSlice(result, offset, offset + 32)); - return dataSlice(result, offset + 32, offset + 32 + length); - } - catch (error) { } - return null; - } - function numPad(value) { - const result = toBeArray(value); - if (result.length > 32) { - throw new Error("internal; should not happen"); - } - const padded = new Uint8Array(32); - padded.set(result, 32 - result.length); - return padded; - } - function bytesPad(value) { - if ((value.length % 32) === 0) { - return value; - } - const result = new Uint8Array(Math.ceil(value.length / 32) * 32); - result.set(value); - return result; - } - const empty = new Uint8Array([]); - // ABI Encodes a series of (bytes, bytes, ...) - function encodeBytes(datas) { - const result = []; - let byteCount = 0; - // Add place-holders for pointers as we add items - for (let i = 0; i < datas.length; i++) { - result.push(empty); - byteCount += 32; - } - for (let i = 0; i < datas.length; i++) { - const data = getBytes(datas[i]); - // Update the bytes offset - result[i] = numPad(byteCount); - // The length and padded value of data - result.push(numPad(data.length)); - result.push(bytesPad(data)); - byteCount += 32 + Math.ceil(data.length / 32) * 32; - } - return concat(result); - } - const zeros = "0x0000000000000000000000000000000000000000000000000000000000000000"; - function parseOffchainLookup(data) { - const result = { - sender: "", urls: [], calldata: "", selector: "", extraData: "", errorArgs: [] - }; - assert(dataLength(data) >= 5 * 32, "insufficient OffchainLookup data", "OFFCHAIN_FAULT", { - reason: "insufficient OffchainLookup data" - }); - const sender = dataSlice(data, 0, 32); - assert(dataSlice(sender, 0, 12) === dataSlice(zeros, 0, 12), "corrupt OffchainLookup sender", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup sender" - }); - result.sender = dataSlice(sender, 12); - // Read the URLs from the response - try { - const urls = []; - const urlsOffset = getNumber(dataSlice(data, 32, 64)); - const urlsLength = getNumber(dataSlice(data, urlsOffset, urlsOffset + 32)); - const urlsData = dataSlice(data, urlsOffset + 32); - for (let u = 0; u < urlsLength; u++) { - const url = _parseString(urlsData, u * 32); - if (url == null) { - throw new Error("abort"); - } - urls.push(url); - } - result.urls = urls; - } - catch (error) { - assert(false, "corrupt OffchainLookup urls", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup urls" - }); - } - // Get the CCIP calldata to forward - try { - const calldata = _parseBytes(data, 64); - if (calldata == null) { - throw new Error("abort"); - } - result.calldata = calldata; - } - catch (error) { - assert(false, "corrupt OffchainLookup calldata", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup calldata" - }); - } - // Get the callbackSelector (bytes4) - assert(dataSlice(data, 100, 128) === dataSlice(zeros, 0, 28), "corrupt OffchainLookup callbaackSelector", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup callbaackSelector" - }); - result.selector = dataSlice(data, 96, 100); - // Get the extra data to send back to the contract as context - try { - const extraData = _parseBytes(data, 128); - if (extraData == null) { - throw new Error("abort"); - } - result.extraData = extraData; - } - catch (error) { - assert(false, "corrupt OffchainLookup extraData", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup extraData" - }); - } - result.errorArgs = "sender,urls,calldata,selector,extraData".split(/,/).map((k) => result[k]); - return result; - } - - /** - * Generally the [[Wallet]] and [[JsonRpcSigner]] and their sub-classes - * are sufficient for most developers, but this is provided to - * fascilitate more complex Signers. - * - * @_section: api/providers/abstract-signer: Subclassing Signer [abstract-signer] - */ - function checkProvider(signer, operation) { - if (signer.provider) { - return signer.provider; - } - assert(false, "missing provider", "UNSUPPORTED_OPERATION", { operation }); - } - async function populate(signer, tx) { - let pop = copyRequest(tx); - if (pop.to != null) { - pop.to = resolveAddress(pop.to, signer); - } - if (pop.from != null) { - const from = pop.from; - pop.from = Promise.all([ - signer.getAddress(), - resolveAddress(from, signer) - ]).then(([address, from]) => { - assertArgument(address.toLowerCase() === from.toLowerCase(), "transaction from mismatch", "tx.from", from); - return address; - }); - } - else { - pop.from = signer.getAddress(); - } - return await resolveProperties(pop); - } - /** - * An **AbstractSigner** includes most of teh functionality required - * to get a [[Signer]] working as expected, but requires a few - * Signer-specific methods be overridden. - * - */ - class AbstractSigner { - /** - * The provider this signer is connected to. - */ - provider; - /** - * Creates a new Signer connected to %%provider%%. - */ - constructor(provider) { - defineProperties(this, { provider: (provider || null) }); - } - async getNonce(blockTag) { - return checkProvider(this, "getTransactionCount").getTransactionCount(await this.getAddress(), blockTag); - } - async populateCall(tx) { - const pop = await populate(this, tx); - return pop; - } - async populateTransaction(tx) { - const provider = checkProvider(this, "populateTransaction"); - const pop = await populate(this, tx); - if (pop.nonce == null) { - pop.nonce = await this.getNonce("pending"); - } - if (pop.gasLimit == null) { - pop.gasLimit = await this.estimateGas(pop); - } - // Populate the chain ID - const network = await (this.provider).getNetwork(); - if (pop.chainId != null) { - const chainId = getBigInt(pop.chainId); - assertArgument(chainId === network.chainId, "transaction chainId mismatch", "tx.chainId", tx.chainId); - } - else { - pop.chainId = network.chainId; - } - // Do not allow mixing pre-eip-1559 and eip-1559 properties - const hasEip1559 = (pop.maxFeePerGas != null || pop.maxPriorityFeePerGas != null); - if (pop.gasPrice != null && (pop.type === 2 || hasEip1559)) { - assertArgument(false, "eip-1559 transaction do not support gasPrice", "tx", tx); - } - else if ((pop.type === 0 || pop.type === 1) && hasEip1559) { - assertArgument(false, "pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas", "tx", tx); - } - if ((pop.type === 2 || pop.type == null) && (pop.maxFeePerGas != null && pop.maxPriorityFeePerGas != null)) { - // Fully-formed EIP-1559 transaction (skip getFeeData) - pop.type = 2; - } - else if (pop.type === 0 || pop.type === 1) { - // Explicit Legacy or EIP-2930 transaction - // We need to get fee data to determine things - const feeData = await provider.getFeeData(); - assert(feeData.gasPrice != null, "network does not support gasPrice", "UNSUPPORTED_OPERATION", { - operation: "getGasPrice" - }); - // Populate missing gasPrice - if (pop.gasPrice == null) { - pop.gasPrice = feeData.gasPrice; - } - } - else { - // We need to get fee data to determine things - const feeData = await provider.getFeeData(); - if (pop.type == null) { - // We need to auto-detect the intended type of this transaction... - if (feeData.maxFeePerGas != null && feeData.maxPriorityFeePerGas != null) { - // The network supports EIP-1559! - // Upgrade transaction from null to eip-1559 - if (pop.authorizationList && pop.authorizationList.length) { - pop.type = 4; - } - else { - pop.type = 2; - } - if (pop.gasPrice != null) { - // Using legacy gasPrice property on an eip-1559 network, - // so use gasPrice as both fee properties - const gasPrice = pop.gasPrice; - delete pop.gasPrice; - pop.maxFeePerGas = gasPrice; - pop.maxPriorityFeePerGas = gasPrice; - } - else { - // Populate missing fee data - if (pop.maxFeePerGas == null) { - pop.maxFeePerGas = feeData.maxFeePerGas; - } - if (pop.maxPriorityFeePerGas == null) { - pop.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas; - } - } - } - else if (feeData.gasPrice != null) { - // Network doesn't support EIP-1559... - // ...but they are trying to use EIP-1559 properties - assert(!hasEip1559, "network does not support EIP-1559", "UNSUPPORTED_OPERATION", { - operation: "populateTransaction" - }); - // Populate missing fee data - if (pop.gasPrice == null) { - pop.gasPrice = feeData.gasPrice; - } - // Explicitly set untyped transaction to legacy - // @TODO: Maybe this shold allow type 1? - pop.type = 0; - } - else { - // getFeeData has failed us. - assert(false, "failed to get consistent fee data", "UNSUPPORTED_OPERATION", { - operation: "signer.getFeeData" - }); - } - } - else if (pop.type === 2 || pop.type === 3 || pop.type === 4) { - // Explicitly using EIP-1559 or EIP-4844 - // Populate missing fee data - if (pop.maxFeePerGas == null) { - pop.maxFeePerGas = feeData.maxFeePerGas; - } - if (pop.maxPriorityFeePerGas == null) { - pop.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas; - } - } - } - //@TOOD: Don't await all over the place; save them up for - // the end for better batching - return await resolveProperties(pop); - } - async populateAuthorization(_auth) { - const auth = Object.assign({}, _auth); - // Add a chain ID if not explicitly set to 0 - if (auth.chainId == null) { - auth.chainId = (await checkProvider(this, "getNetwork").getNetwork()).chainId; - } - // @TODO: Take chain ID into account when populating noce? - if (auth.nonce == null) { - auth.nonce = await this.getNonce(); - } - return auth; - } - async estimateGas(tx) { - return checkProvider(this, "estimateGas").estimateGas(await this.populateCall(tx)); - } - async call(tx) { - return checkProvider(this, "call").call(await this.populateCall(tx)); - } - async resolveName(name) { - const provider = checkProvider(this, "resolveName"); - return await provider.resolveName(name); - } - async sendTransaction(tx) { - const provider = checkProvider(this, "sendTransaction"); - const pop = await this.populateTransaction(tx); - delete pop.from; - const txObj = Transaction.from(pop); - return await provider.broadcastTransaction(await this.signTransaction(txObj)); - } - // @TODO: in v7 move this to be abstract - authorize(authorization) { - assert(false, "authorization not implemented for this signer", "UNSUPPORTED_OPERATION", { operation: "authorize" }); - } - } - /** - * A **VoidSigner** is a class designed to allow an address to be used - * in any API which accepts a Signer, but for which there are no - * credentials available to perform any actual signing. - * - * This for example allow impersonating an account for the purpose of - * static calls or estimating gas, but does not allow sending transactions. - */ - class VoidSigner extends AbstractSigner { - /** - * The signer address. - */ - address; - /** - * Creates a new **VoidSigner** with %%address%% attached to - * %%provider%%. - */ - constructor(address, provider) { - super(provider); - defineProperties(this, { address }); - } - async getAddress() { return this.address; } - connect(provider) { - return new VoidSigner(this.address, provider); - } - #throwUnsupported(suffix, operation) { - assert(false, `VoidSigner cannot sign ${suffix}`, "UNSUPPORTED_OPERATION", { operation }); - } - async signTransaction(tx) { - this.#throwUnsupported("transactions", "signTransaction"); - } - async signMessage(message) { - this.#throwUnsupported("messages", "signMessage"); - } - async signTypedData(domain, types, value) { - this.#throwUnsupported("typed-data", "signTypedData"); - } - } - - /** - * There are many awesome community services that provide Ethereum - * nodes both for developers just starting out and for large-scale - * communities. - * - * @_section: api/providers/thirdparty: Community Providers [thirdparty] - */ - // Show the throttle message only once per service - const shown = new Set(); - /** - * Displays a warning in the console when the community resource is - * being used too heavily by the app, recommending the developer - * acquire their own credentials instead of using the community - * credentials. - * - * The notification will only occur once per service. - */ - function showThrottleMessage(service) { - if (shown.has(service)) { - return; - } - shown.add(service); - console.log("========= NOTICE ========="); - console.log(`Request-Rate Exceeded for ${service} (this message will not be repeated)`); - console.log(""); - console.log("The default API keys for each service are provided as a highly-throttled,"); - console.log("community resource for low-traffic projects and early prototyping."); - console.log(""); - console.log("While your application will continue to function, we highly recommended"); - console.log("signing up for your own API keys to improve performance, increase your"); - console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."); - console.log(""); - console.log("For more details: https:/\/docs.ethers.org/api-keys/"); - console.log("=========================="); - } - - function copy(obj) { - return JSON.parse(JSON.stringify(obj)); - } - /** - * Some backends support subscribing to events using a Filter ID. - * - * When subscribing with this technique, the node issues a unique - * //Filter ID//. At this point the node dedicates resources to - * the filter, so that periodic calls to follow up on the //Filter ID// - * will receive any events since the last call. - * - * @_docloc: api/providers/abstract-provider - */ - class FilterIdSubscriber { - #provider; - #filterIdPromise; - #poller; - #running; - #network; - #hault; - /** - * Creates a new **FilterIdSubscriber** which will used [[_subscribe]] - * and [[_emitResults]] to setup the subscription and provide the event - * to the %%provider%%. - */ - constructor(provider) { - this.#provider = provider; - this.#filterIdPromise = null; - this.#poller = this.#poll.bind(this); - this.#running = false; - this.#network = null; - this.#hault = false; - } - /** - * Sub-classes **must** override this to begin the subscription. - */ - _subscribe(provider) { - throw new Error("subclasses must override this"); - } - /** - * Sub-classes **must** override this handle the events. - */ - _emitResults(provider, result) { - throw new Error("subclasses must override this"); - } - /** - * Sub-classes **must** override this handle recovery on errors. - */ - _recover(provider) { - throw new Error("subclasses must override this"); - } - async #poll(blockNumber) { - try { - // Subscribe if necessary - if (this.#filterIdPromise == null) { - this.#filterIdPromise = this._subscribe(this.#provider); - } - // Get the Filter ID - let filterId = null; - try { - filterId = await this.#filterIdPromise; - } - catch (error) { - if (!isError(error, "UNSUPPORTED_OPERATION") || error.operation !== "eth_newFilter") { - throw error; - } - } - // The backend does not support Filter ID; downgrade to - // polling - if (filterId == null) { - this.#filterIdPromise = null; - this.#provider._recoverSubscriber(this, this._recover(this.#provider)); - return; - } - const network = await this.#provider.getNetwork(); - if (!this.#network) { - this.#network = network; - } - if (this.#network.chainId !== network.chainId) { - throw new Error("chaid changed"); - } - if (this.#hault) { - return; - } - const result = await this.#provider.send("eth_getFilterChanges", [filterId]); - await this._emitResults(this.#provider, result); - } - catch (error) { - console.log("@TODO", error); - } - this.#provider.once("block", this.#poller); - } - #teardown() { - const filterIdPromise = this.#filterIdPromise; - if (filterIdPromise) { - this.#filterIdPromise = null; - filterIdPromise.then((filterId) => { - if (this.#provider.destroyed) { - return; - } - this.#provider.send("eth_uninstallFilter", [filterId]); - }); - } - } - start() { - if (this.#running) { - return; - } - this.#running = true; - this.#poll(-2); - } - stop() { - if (!this.#running) { - return; - } - this.#running = false; - this.#hault = true; - this.#teardown(); - this.#provider.off("block", this.#poller); - } - pause(dropWhilePaused) { - if (dropWhilePaused) { - this.#teardown(); - } - this.#provider.off("block", this.#poller); - } - resume() { this.start(); } - } - /** - * A **FilterIdSubscriber** for receiving contract events. - * - * @_docloc: api/providers/abstract-provider - */ - class FilterIdEventSubscriber extends FilterIdSubscriber { - #event; - /** - * Creates a new **FilterIdEventSubscriber** attached to %%provider%% - * listening for %%filter%%. - */ - constructor(provider, filter) { - super(provider); - this.#event = copy(filter); - } - _recover(provider) { - return new PollingEventSubscriber(provider, this.#event); - } - async _subscribe(provider) { - const filterId = await provider.send("eth_newFilter", [this.#event]); - return filterId; - } - async _emitResults(provider, results) { - for (const result of results) { - provider.emit(this.#event, provider._wrapLog(result, provider._network)); - } - } - } - /** - * A **FilterIdSubscriber** for receiving pending transactions events. - * - * @_docloc: api/providers/abstract-provider - */ - class FilterIdPendingSubscriber extends FilterIdSubscriber { - async _subscribe(provider) { - return await provider.send("eth_newPendingTransactionFilter", []); - } - async _emitResults(provider, results) { - for (const result of results) { - provider.emit("pending", result); - } - } - } - - /** - * One of the most common ways to interact with the blockchain is - * by a node running a JSON-RPC interface which can be connected to, - * based on the transport, using: - * - * - HTTP or HTTPS - [[JsonRpcProvider]] - * - WebSocket - [[WebSocketProvider]] - * - IPC - [[IpcSocketProvider]] - * - * @_section: api/providers/jsonrpc:JSON-RPC Provider [about-jsonrpcProvider] - */ - // @TODO: - // - Add the batching API - // https://playground.open-rpc.org/?schemaUrl=https://raw.githubusercontent.com/ethereum/eth1.0-apis/assembled-spec/openrpc.json&uiSchema%5BappBar%5D%5Bui:splitView%5D=true&uiSchema%5BappBar%5D%5Bui:input%5D=false&uiSchema%5BappBar%5D%5Bui:examplesDropdown%5D=false - const Primitive = "bigint,boolean,function,number,string,symbol".split(/,/g); - //const Methods = "getAddress,then".split(/,/g); - function deepCopy(value) { - if (value == null || Primitive.indexOf(typeof (value)) >= 0) { - return value; - } - // Keep any Addressable - if (typeof (value.getAddress) === "function") { - return value; - } - if (Array.isArray(value)) { - return (value.map(deepCopy)); - } - if (typeof (value) === "object") { - return Object.keys(value).reduce((accum, key) => { - accum[key] = value[key]; - return accum; - }, {}); - } - throw new Error(`should not happen: ${value} (${typeof (value)})`); - } - function stall$3(duration) { - return new Promise((resolve) => { setTimeout(resolve, duration); }); - } - function getLowerCase(value) { - if (value) { - return value.toLowerCase(); - } - return value; - } - function isPollable(value) { - return (value && typeof (value.pollingInterval) === "number"); - } - const defaultOptions = { - polling: false, - staticNetwork: null, - batchStallTime: 10, - batchMaxSize: (1 << 20), - batchMaxCount: 100, - cacheTimeout: 250, - pollingInterval: 4000 - }; - // @TODO: Unchecked Signers - class JsonRpcSigner extends AbstractSigner { - address; - constructor(provider, address) { - super(provider); - address = getAddress(address); - defineProperties(this, { address }); - } - connect(provider) { - assert(false, "cannot reconnect JsonRpcSigner", "UNSUPPORTED_OPERATION", { - operation: "signer.connect" - }); - } - async getAddress() { - return this.address; - } - // JSON-RPC will automatially fill in nonce, etc. so we just check from - async populateTransaction(tx) { - return await this.populateCall(tx); - } - // Returns just the hash of the transaction after sent, which is what - // the bare JSON-RPC API does; - async sendUncheckedTransaction(_tx) { - const tx = deepCopy(_tx); - const promises = []; - // Make sure the from matches the sender - if (tx.from) { - const _from = tx.from; - promises.push((async () => { - const from = await resolveAddress(_from, this.provider); - assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(), "from address mismatch", "transaction", _tx); - tx.from = from; - })()); - } - else { - tx.from = this.address; - } - // The JSON-RPC for eth_sendTransaction uses 90000 gas; if the user - // wishes to use this, it is easy to specify explicitly, otherwise - // we look it up for them. - if (tx.gasLimit == null) { - promises.push((async () => { - tx.gasLimit = await this.provider.estimateGas({ ...tx, from: this.address }); - })()); - } - // The address may be an ENS name or Addressable - if (tx.to != null) { - const _to = tx.to; - promises.push((async () => { - tx.to = await resolveAddress(_to, this.provider); - })()); - } - // Wait until all of our properties are filled in - if (promises.length) { - await Promise.all(promises); - } - const hexTx = this.provider.getRpcTransaction(tx); - return this.provider.send("eth_sendTransaction", [hexTx]); - } - async sendTransaction(tx) { - // This cannot be mined any earlier than any recent block - const blockNumber = await this.provider.getBlockNumber(); - // Send the transaction - const hash = await this.sendUncheckedTransaction(tx); - // Unfortunately, JSON-RPC only provides and opaque transaction hash - // for a response, and we need the actual transaction, so we poll - // for it; it should show up very quickly - return await (new Promise((resolve, reject) => { - const timeouts = [1000, 100]; - let invalids = 0; - const checkTx = async () => { - try { - // Try getting the transaction - const tx = await this.provider.getTransaction(hash); - if (tx != null) { - resolve(tx.replaceableTransaction(blockNumber)); - return; - } - } - catch (error) { - // If we were cancelled: stop polling. - // If the data is bad: the node returns bad transactions - // If the network changed: calling again will also fail - // If unsupported: likely destroyed - if (isError(error, "CANCELLED") || isError(error, "BAD_DATA") || - isError(error, "NETWORK_ERROR") || isError(error, "UNSUPPORTED_OPERATION")) { - if (error.info == null) { - error.info = {}; - } - error.info.sendTransactionHash = hash; - reject(error); - return; - } - // Stop-gap for misbehaving backends; see #4513 - if (isError(error, "INVALID_ARGUMENT")) { - invalids++; - if (error.info == null) { - error.info = {}; - } - error.info.sendTransactionHash = hash; - if (invalids > 10) { - reject(error); - return; - } - } - // Notify anyone that cares; but we will try again, since - // it is likely an intermittent service error - this.provider.emit("error", makeError("failed to fetch transation after sending (will try again)", "UNKNOWN_ERROR", { error })); - } - // Wait another 4 seconds - this.provider._setTimeout(() => { checkTx(); }, timeouts.pop() || 4000); - }; - checkTx(); - })); - } - async signTransaction(_tx) { - const tx = deepCopy(_tx); - // Make sure the from matches the sender - if (tx.from) { - const from = await resolveAddress(tx.from, this.provider); - assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(), "from address mismatch", "transaction", _tx); - tx.from = from; - } - else { - tx.from = this.address; - } - const hexTx = this.provider.getRpcTransaction(tx); - return await this.provider.send("eth_signTransaction", [hexTx]); - } - async signMessage(_message) { - const message = ((typeof (_message) === "string") ? toUtf8Bytes(_message) : _message); - return await this.provider.send("personal_sign", [ - hexlify(message), this.address.toLowerCase() - ]); - } - async signTypedData(domain, types, _value) { - const value = deepCopy(_value); - // Populate any ENS names (in-place) - const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (value) => { - const address = await resolveAddress(value); - assertArgument(address != null, "TypedData does not support null address", "value", value); - return address; - }); - return await this.provider.send("eth_signTypedData_v4", [ - this.address.toLowerCase(), - JSON.stringify(TypedDataEncoder.getPayload(populated.domain, types, populated.value)) - ]); - } - async unlock(password) { - return this.provider.send("personal_unlockAccount", [ - this.address.toLowerCase(), password, null - ]); - } - // https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign - async _legacySignMessage(_message) { - const message = ((typeof (_message) === "string") ? toUtf8Bytes(_message) : _message); - return await this.provider.send("eth_sign", [ - this.address.toLowerCase(), hexlify(message) - ]); - } - } - /** - * The JsonRpcApiProvider is an abstract class and **MUST** be - * sub-classed. - * - * It provides the base for all JSON-RPC-based Provider interaction. - * - * Sub-classing Notes: - * - a sub-class MUST override _send - * - a sub-class MUST call the `_start()` method once connected - */ - class JsonRpcApiProvider extends AbstractProvider { - #options; - // The next ID to use for the JSON-RPC ID field - #nextId; - // Payloads are queued and triggered in batches using the drainTimer - #payloads; - #drainTimer; - #notReady; - #network; - #pendingDetectNetwork; - #scheduleDrain() { - if (this.#drainTimer) { - return; - } - // If we aren't using batching, no harm in sending it immediately - const stallTime = (this._getOption("batchMaxCount") === 1) ? 0 : this._getOption("batchStallTime"); - this.#drainTimer = setTimeout(() => { - this.#drainTimer = null; - const payloads = this.#payloads; - this.#payloads = []; - while (payloads.length) { - // Create payload batches that satisfy our batch constraints - const batch = [(payloads.shift())]; - while (payloads.length) { - if (batch.length === this.#options.batchMaxCount) { - break; - } - batch.push((payloads.shift())); - const bytes = JSON.stringify(batch.map((p) => p.payload)); - if (bytes.length > this.#options.batchMaxSize) { - payloads.unshift((batch.pop())); - break; - } - } - // Process the result to each payload - (async () => { - const payload = ((batch.length === 1) ? batch[0].payload : batch.map((p) => p.payload)); - this.emit("debug", { action: "sendRpcPayload", payload }); - try { - const result = await this._send(payload); - this.emit("debug", { action: "receiveRpcResult", result }); - // Process results in batch order - for (const { resolve, reject, payload } of batch) { - if (this.destroyed) { - reject(makeError("provider destroyed; cancelled request", "UNSUPPORTED_OPERATION", { operation: payload.method })); - continue; - } - // Find the matching result - const resp = result.filter((r) => (r.id === payload.id))[0]; - // No result; the node failed us in unexpected ways - if (resp == null) { - const error = makeError("missing response for request", "BAD_DATA", { - value: result, info: { payload } - }); - this.emit("error", error); - reject(error); - continue; - } - // The response is an error - if ("error" in resp) { - reject(this.getRpcError(payload, resp)); - continue; - } - // All good; send the result - resolve(resp.result); - } - } - catch (error) { - this.emit("debug", { action: "receiveRpcError", error }); - for (const { reject } of batch) { - // @TODO: augment the error with the payload - reject(error); - } - } - })(); - } - }, stallTime); - } - constructor(network, options) { - super(network, options); - this.#nextId = 1; - this.#options = Object.assign({}, defaultOptions, options || {}); - this.#payloads = []; - this.#drainTimer = null; - this.#network = null; - this.#pendingDetectNetwork = null; - { - let resolve = null; - const promise = new Promise((_resolve) => { - resolve = _resolve; - }); - this.#notReady = { promise, resolve }; - } - const staticNetwork = this._getOption("staticNetwork"); - if (typeof (staticNetwork) === "boolean") { - assertArgument(!staticNetwork || network !== "any", "staticNetwork cannot be used on special network 'any'", "options", options); - if (staticNetwork && network != null) { - this.#network = Network.from(network); - } - } - else if (staticNetwork) { - // Make sure any static network is compatbile with the provided netwrok - assertArgument(network == null || staticNetwork.matches(network), "staticNetwork MUST match network object", "options", options); - this.#network = staticNetwork; - } - } - /** - * Returns the value associated with the option %%key%%. - * - * Sub-classes can use this to inquire about configuration options. - */ - _getOption(key) { - return this.#options[key]; - } - /** - * Gets the [[Network]] this provider has committed to. On each call, the network - * is detected, and if it has changed, the call will reject. - */ - get _network() { - assert(this.#network, "network is not available yet", "NETWORK_ERROR"); - return this.#network; - } - /** - * Resolves to the non-normalized value by performing %%req%%. - * - * Sub-classes may override this to modify behavior of actions, - * and should generally call ``super._perform`` as a fallback. - */ - async _perform(req) { - // Legacy networks do not like the type field being passed along (which - // is fair), so we delete type if it is 0 and a non-EIP-1559 network - if (req.method === "call" || req.method === "estimateGas") { - let tx = req.transaction; - if (tx && tx.type != null && getBigInt(tx.type)) { - // If there are no EIP-1559 or newer properties, it might be pre-EIP-1559 - if (tx.maxFeePerGas == null && tx.maxPriorityFeePerGas == null) { - const feeData = await this.getFeeData(); - if (feeData.maxFeePerGas == null && feeData.maxPriorityFeePerGas == null) { - // Network doesn't know about EIP-1559 (and hence type) - req = Object.assign({}, req, { - transaction: Object.assign({}, tx, { type: undefined }) - }); - } - } - } - } - const request = this.getRpcRequest(req); - if (request != null) { - return await this.send(request.method, request.args); - } - return super._perform(req); - } - /** - * Sub-classes may override this; it detects the *actual* network that - * we are **currently** connected to. - * - * Keep in mind that [[send]] may only be used once [[ready]], otherwise the - * _send primitive must be used instead. - */ - async _detectNetwork() { - const network = this._getOption("staticNetwork"); - if (network) { - if (network === true) { - if (this.#network) { - return this.#network; - } - } - else { - return network; - } - } - if (this.#pendingDetectNetwork) { - return await this.#pendingDetectNetwork; - } - // If we are ready, use ``send``, which enabled requests to be batched - if (this.ready) { - this.#pendingDetectNetwork = (async () => { - try { - const result = Network.from(getBigInt(await this.send("eth_chainId", []))); - this.#pendingDetectNetwork = null; - return result; - } - catch (error) { - this.#pendingDetectNetwork = null; - throw error; - } - })(); - return await this.#pendingDetectNetwork; - } - // We are not ready yet; use the primitive _send - this.#pendingDetectNetwork = (async () => { - const payload = { - id: this.#nextId++, method: "eth_chainId", params: [], jsonrpc: "2.0" - }; - this.emit("debug", { action: "sendRpcPayload", payload }); - let result; - try { - result = (await this._send(payload))[0]; - this.#pendingDetectNetwork = null; - } - catch (error) { - this.#pendingDetectNetwork = null; - this.emit("debug", { action: "receiveRpcError", error }); - throw error; - } - this.emit("debug", { action: "receiveRpcResult", result }); - if ("result" in result) { - return Network.from(getBigInt(result.result)); - } - throw this.getRpcError(payload, result); - })(); - return await this.#pendingDetectNetwork; - } - /** - * Sub-classes **MUST** call this. Until [[_start]] has been called, no calls - * will be passed to [[_send]] from [[send]]. If it is overridden, then - * ``super._start()`` **MUST** be called. - * - * Calling it multiple times is safe and has no effect. - */ - _start() { - if (this.#notReady == null || this.#notReady.resolve == null) { - return; - } - this.#notReady.resolve(); - this.#notReady = null; - (async () => { - // Bootstrap the network - while (this.#network == null && !this.destroyed) { - try { - this.#network = await this._detectNetwork(); - } - catch (error) { - if (this.destroyed) { - break; - } - console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"); - this.emit("error", makeError("failed to bootstrap network detection", "NETWORK_ERROR", { event: "initial-network-discovery", info: { error } })); - await stall$3(1000); - } - } - // Start dispatching requests - this.#scheduleDrain(); - })(); - } - /** - * Resolves once the [[_start]] has been called. This can be used in - * sub-classes to defer sending data until the connection has been - * established. - */ - async _waitUntilReady() { - if (this.#notReady == null) { - return; - } - return await this.#notReady.promise; - } - /** - * Return a Subscriber that will manage the %%sub%%. - * - * Sub-classes may override this to modify the behavior of - * subscription management. - */ - _getSubscriber(sub) { - // Pending Filters aren't availble via polling - if (sub.type === "pending") { - return new FilterIdPendingSubscriber(this); - } - if (sub.type === "event") { - if (this._getOption("polling")) { - return new PollingEventSubscriber(this, sub.filter); - } - return new FilterIdEventSubscriber(this, sub.filter); - } - // Orphaned Logs are handled automatically, by the filter, since - // logs with removed are emitted by it - if (sub.type === "orphan" && sub.filter.orphan === "drop-log") { - return new UnmanagedSubscriber("orphan"); - } - return super._getSubscriber(sub); - } - /** - * Returns true only if the [[_start]] has been called. - */ - get ready() { return this.#notReady == null; } - /** - * Returns %%tx%% as a normalized JSON-RPC transaction request, - * which has all values hexlified and any numeric values converted - * to Quantity values. - */ - getRpcTransaction(tx) { - const result = {}; - // JSON-RPC now requires numeric values to be "quantity" values - ["chainId", "gasLimit", "gasPrice", "type", "maxFeePerGas", "maxPriorityFeePerGas", "nonce", "value"].forEach((key) => { - if (tx[key] == null) { - return; - } - let dstKey = key; - if (key === "gasLimit") { - dstKey = "gas"; - } - result[dstKey] = toQuantity(getBigInt(tx[key], `tx.${key}`)); - }); - // Make sure addresses and data are lowercase - ["from", "to", "data"].forEach((key) => { - if (tx[key] == null) { - return; - } - result[key] = hexlify(tx[key]); - }); - // Normalize the access list object - if (tx.accessList) { - result["accessList"] = accessListify(tx.accessList); - } - if (tx.blobVersionedHashes) { - // @TODO: Remove this case once EIP-4844 added to prepared tx - result["blobVersionedHashes"] = tx.blobVersionedHashes.map(h => h.toLowerCase()); - } - if (tx.authorizationList) { - result["authorizationList"] = tx.authorizationList.map((_a) => { - const a = authorizationify(_a); - return { - address: a.address, - nonce: toQuantity(a.nonce), - chainId: toQuantity(a.chainId), - yParity: toQuantity(a.signature.yParity), - r: toQuantity(a.signature.r), - s: toQuantity(a.signature.s), - }; - }); - } - // @TODO: blobs should probably also be copied over, optionally - // accounting for the kzg property to backfill blobVersionedHashes - // using the commitment. Or should that be left as an exercise to - // the caller? - return result; - } - /** - * Returns the request method and arguments required to perform - * %%req%%. - */ - getRpcRequest(req) { - switch (req.method) { - case "chainId": - return { method: "eth_chainId", args: [] }; - case "getBlockNumber": - return { method: "eth_blockNumber", args: [] }; - case "getGasPrice": - return { method: "eth_gasPrice", args: [] }; - case "getPriorityFee": - return { method: "eth_maxPriorityFeePerGas", args: [] }; - case "getBalance": - return { - method: "eth_getBalance", - args: [getLowerCase(req.address), req.blockTag] - }; - case "getTransactionCount": - return { - method: "eth_getTransactionCount", - args: [getLowerCase(req.address), req.blockTag] - }; - case "getCode": - return { - method: "eth_getCode", - args: [getLowerCase(req.address), req.blockTag] - }; - case "getStorage": - return { - method: "eth_getStorageAt", - args: [ - getLowerCase(req.address), - ("0x" + req.position.toString(16)), - req.blockTag - ] - }; - case "broadcastTransaction": - return { - method: "eth_sendRawTransaction", - args: [req.signedTransaction] - }; - case "getBlock": - if ("blockTag" in req) { - return { - method: "eth_getBlockByNumber", - args: [req.blockTag, !!req.includeTransactions] - }; - } - else if ("blockHash" in req) { - return { - method: "eth_getBlockByHash", - args: [req.blockHash, !!req.includeTransactions] - }; - } - break; - case "getTransaction": - return { - method: "eth_getTransactionByHash", - args: [req.hash] - }; - case "getTransactionReceipt": - return { - method: "eth_getTransactionReceipt", - args: [req.hash] - }; - case "call": - return { - method: "eth_call", - args: [this.getRpcTransaction(req.transaction), req.blockTag] - }; - case "estimateGas": { - return { - method: "eth_estimateGas", - args: [this.getRpcTransaction(req.transaction)] - }; - } - case "getLogs": - if (req.filter && req.filter.address != null) { - if (Array.isArray(req.filter.address)) { - req.filter.address = req.filter.address.map(getLowerCase); - } - else { - req.filter.address = getLowerCase(req.filter.address); - } - } - return { method: "eth_getLogs", args: [req.filter] }; - } - return null; - } - /** - * Returns an ethers-style Error for the given JSON-RPC error - * %%payload%%, coalescing the various strings and error shapes - * that different nodes return, coercing them into a machine-readable - * standardized error. - */ - getRpcError(payload, _error) { - const { method } = payload; - const { error } = _error; - if (method === "eth_estimateGas" && error.message) { - const msg = error.message; - if (!msg.match(/revert/i) && msg.match(/insufficient funds/i)) { - return makeError("insufficient funds", "INSUFFICIENT_FUNDS", { - transaction: (payload.params[0]), - info: { payload, error } - }); - } - else if (msg.match(/nonce/i) && msg.match(/too low/i)) { - return makeError("nonce has already been used", "NONCE_EXPIRED", { - transaction: (payload.params[0]), - info: { payload, error } - }); - } - } - if (method === "eth_call" || method === "eth_estimateGas") { - const result = spelunkData(error); - const e = AbiCoder.getBuiltinCallException((method === "eth_call") ? "call" : "estimateGas", (payload.params[0]), (result ? result.data : null)); - e.info = { error, payload }; - return e; - } - // Only estimateGas and call can return arbitrary contract-defined text, so now we - // we can process text safely. - const message = JSON.stringify(spelunkMessage(error)); - if (typeof (error.message) === "string" && error.message.match(/user denied|ethers-user-denied/i)) { - const actionMap = { - eth_sign: "signMessage", - personal_sign: "signMessage", - eth_signTypedData_v4: "signTypedData", - eth_signTransaction: "signTransaction", - eth_sendTransaction: "sendTransaction", - eth_requestAccounts: "requestAccess", - wallet_requestAccounts: "requestAccess", - }; - return makeError(`user rejected action`, "ACTION_REJECTED", { - action: (actionMap[method] || "unknown"), - reason: "rejected", - info: { payload, error } - }); - } - if (method === "eth_sendRawTransaction" || method === "eth_sendTransaction") { - const transaction = (payload.params[0]); - if (message.match(/insufficient funds|base fee exceeds gas limit/i)) { - return makeError("insufficient funds for intrinsic transaction cost", "INSUFFICIENT_FUNDS", { - transaction, info: { error } - }); - } - if (message.match(/nonce/i) && message.match(/too low/i)) { - return makeError("nonce has already been used", "NONCE_EXPIRED", { transaction, info: { error } }); - } - // "replacement transaction underpriced" - if (message.match(/replacement transaction/i) && message.match(/underpriced/i)) { - return makeError("replacement fee too low", "REPLACEMENT_UNDERPRICED", { transaction, info: { error } }); - } - if (message.match(/only replay-protected/i)) { - return makeError("legacy pre-eip-155 transactions not supported", "UNSUPPORTED_OPERATION", { - operation: method, info: { transaction, info: { error } } - }); - } - } - let unsupported = !!message.match(/the method .* does not exist/i); - if (!unsupported) { - if (error && error.details && error.details.startsWith("Unauthorized method:")) { - unsupported = true; - } - } - if (unsupported) { - return makeError("unsupported operation", "UNSUPPORTED_OPERATION", { - operation: payload.method, info: { error, payload } - }); - } - return makeError("could not coalesce error", "UNKNOWN_ERROR", { error, payload }); - } - /** - * Requests the %%method%% with %%params%% via the JSON-RPC protocol - * over the underlying channel. This can be used to call methods - * on the backend that do not have a high-level API within the Provider - * API. - * - * This method queues requests according to the batch constraints - * in the options, assigns the request a unique ID. - * - * **Do NOT override** this method in sub-classes; instead - * override [[_send]] or force the options values in the - * call to the constructor to modify this method's behavior. - */ - send(method, params) { - // @TODO: cache chainId?? purge on switch_networks - // We have been destroyed; no operations are supported anymore - if (this.destroyed) { - return Promise.reject(makeError("provider destroyed; cancelled request", "UNSUPPORTED_OPERATION", { operation: method })); - } - const id = this.#nextId++; - const promise = new Promise((resolve, reject) => { - this.#payloads.push({ - resolve, reject, - payload: { method, params, id, jsonrpc: "2.0" } - }); - }); - // If there is not a pending drainTimer, set one - this.#scheduleDrain(); - return promise; - } - /** - * Resolves to the [[Signer]] account for %%address%% managed by - * the client. - * - * If the %%address%% is a number, it is used as an index in the - * the accounts from [[listAccounts]]. - * - * This can only be used on clients which manage accounts (such as - * Geth with imported account or MetaMask). - * - * Throws if the account doesn't exist. - */ - async getSigner(address) { - if (address == null) { - address = 0; - } - const accountsPromise = this.send("eth_accounts", []); - // Account index - if (typeof (address) === "number") { - const accounts = (await accountsPromise); - if (address >= accounts.length) { - throw new Error("no such account"); - } - return new JsonRpcSigner(this, accounts[address]); - } - const { accounts } = await resolveProperties({ - network: this.getNetwork(), - accounts: accountsPromise - }); - // Account address - address = getAddress(address); - for (const account of accounts) { - if (getAddress(account) === address) { - return new JsonRpcSigner(this, address); - } - } - throw new Error("invalid account"); - } - async listAccounts() { - const accounts = await this.send("eth_accounts", []); - return accounts.map((a) => new JsonRpcSigner(this, a)); - } - destroy() { - // Stop processing requests - if (this.#drainTimer) { - clearTimeout(this.#drainTimer); - this.#drainTimer = null; - } - // Cancel all pending requests - for (const { payload, reject } of this.#payloads) { - reject(makeError("provider destroyed; cancelled request", "UNSUPPORTED_OPERATION", { operation: payload.method })); - } - this.#payloads = []; - // Parent clean-up - super.destroy(); - } - } - // @TODO: remove this in v7, it is not exported because this functionality - // is exposed in the JsonRpcApiProvider by setting polling to true. It should - // be safe to remove regardless, because it isn't reachable, but just in case. - /** - * @_ignore: - */ - class JsonRpcApiPollingProvider extends JsonRpcApiProvider { - #pollingInterval; - constructor(network, options) { - super(network, options); - let pollingInterval = this._getOption("pollingInterval"); - if (pollingInterval == null) { - pollingInterval = defaultOptions.pollingInterval; - } - this.#pollingInterval = pollingInterval; - } - _getSubscriber(sub) { - const subscriber = super._getSubscriber(sub); - if (isPollable(subscriber)) { - subscriber.pollingInterval = this.#pollingInterval; - } - return subscriber; - } - /** - * The polling interval (default: 4000 ms) - */ - get pollingInterval() { return this.#pollingInterval; } - set pollingInterval(value) { - if (!Number.isInteger(value) || value < 0) { - throw new Error("invalid interval"); - } - this.#pollingInterval = value; - this._forEachSubscriber((sub) => { - if (isPollable(sub)) { - sub.pollingInterval = this.#pollingInterval; - } - }); - } - } - /** - * The JsonRpcProvider is one of the most common Providers, - * which performs all operations over HTTP (or HTTPS) requests. - * - * Events are processed by polling the backend for the current block - * number; when it advances, all block-base events are then checked - * for updates. - */ - class JsonRpcProvider extends JsonRpcApiPollingProvider { - #connect; - constructor(url, network, options) { - if (url == null) { - url = "http:/\/localhost:8545"; - } - super(network, options); - if (typeof (url) === "string") { - this.#connect = new FetchRequest(url); - } - else { - this.#connect = url.clone(); - } - } - _getConnection() { - return this.#connect.clone(); - } - async send(method, params) { - // All requests are over HTTP, so we can just start handling requests - // We do this here rather than the constructor so that we don't send any - // requests to the network (i.e. eth_chainId) until we absolutely have to. - await this._start(); - return await super.send(method, params); - } - async _send(payload) { - // Configure a POST connection for the requested method - const request = this._getConnection(); - request.body = JSON.stringify(payload); - request.setHeader("content-type", "application/json"); - const response = await request.send(); - response.assertOk(); - let resp = response.bodyJson; - if (!Array.isArray(resp)) { - resp = [resp]; - } - return resp; - } - } - function spelunkData(value) { - if (value == null) { - return null; - } - // These *are* the droids we're looking for. - if (typeof (value.message) === "string" && value.message.match(/revert/i) && isHexString(value.data)) { - return { message: value.message, data: value.data }; - } - // Spelunk further... - if (typeof (value) === "object") { - for (const key in value) { - const result = spelunkData(value[key]); - if (result) { - return result; - } - } - return null; - } - // Might be a JSON string we can further descend... - if (typeof (value) === "string") { - try { - return spelunkData(JSON.parse(value)); - } - catch (error) { } - } - return null; - } - function _spelunkMessage(value, result) { - if (value == null) { - return; - } - // These *are* the droids we're looking for. - if (typeof (value.message) === "string") { - result.push(value.message); - } - // Spelunk further... - if (typeof (value) === "object") { - for (const key in value) { - _spelunkMessage(value[key], result); - } - } - // Might be a JSON string we can further descend... - if (typeof (value) === "string") { - try { - return _spelunkMessage(JSON.parse(value), result); - } - catch (error) { } - } - } - function spelunkMessage(value) { - const result = []; - _spelunkMessage(value, result); - return result; - } - - /** - * [[link-ankr]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Arbitrum (``arbitrum``) - * - Base (``base``) - * - Base Goerlia Testnet (``base-goerli``) - * - Base Sepolia Testnet (``base-sepolia``) - * - BNB (``bnb``) - * - BNB Testnet (``bnbt``) - * - Filecoin (``filecoin``) - * - Filecoin Calibration Testnet (``filecoin-calibration``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Optimism Sepolia Testnet (``optimism-sepolia``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:Ankr [providers-ankr] - */ - const defaultApiKey$1 = "9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972"; - function getHost$5(name) { - switch (name) { - case "mainnet": - return "rpc.ankr.com/eth"; - case "goerli": - return "rpc.ankr.com/eth_goerli"; - case "sepolia": - return "rpc.ankr.com/eth_sepolia"; - case "arbitrum": - return "rpc.ankr.com/arbitrum"; - case "base": - return "rpc.ankr.com/base"; - case "base-goerli": - return "rpc.ankr.com/base_goerli"; - case "base-sepolia": - return "rpc.ankr.com/base_sepolia"; - case "bnb": - return "rpc.ankr.com/bsc"; - case "bnbt": - return "rpc.ankr.com/bsc_testnet_chapel"; - case "filecoin": - return "rpc.ankr.com/filecoin"; - case "filecoin-calibration": - return "rpc.ankr.com/filecoin_testnet"; - case "matic": - return "rpc.ankr.com/polygon"; - case "matic-mumbai": - return "rpc.ankr.com/polygon_mumbai"; - case "optimism": - return "rpc.ankr.com/optimism"; - case "optimism-goerli": - return "rpc.ankr.com/optimism_testnet"; - case "optimism-sepolia": - return "rpc.ankr.com/optimism_sepolia"; - } - assertArgument(false, "unsupported network", "network", name); - } - /** - * The **AnkrProvider** connects to the [[link-ankr]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-ankr-signup). - */ - class AnkrProvider extends JsonRpcProvider { - /** - * The API key for the Ankr connection. - */ - apiKey; - /** - * Create a new **AnkrProvider**. - * - * By default connecting to ``mainnet`` with a highly throttled - * API key. - */ - constructor(_network, apiKey) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (apiKey == null) { - apiKey = defaultApiKey$1; - } - // Ankr does not support filterId, so we force polling - const options = { polling: true, staticNetwork: network }; - const request = AnkrProvider.getRequest(network, apiKey); - super(request, network, options); - defineProperties(this, { apiKey }); - } - _getProvider(chainId) { - try { - return new AnkrProvider(chainId, this.apiKey); - } - catch (error) { } - return super._getProvider(chainId); - } - /** - * Returns a prepared request for connecting to %%network%% with - * %%apiKey%%. - */ - static getRequest(network, apiKey) { - if (apiKey == null) { - apiKey = defaultApiKey$1; - } - const request = new FetchRequest(`https:/\/${getHost$5(network.name)}/${apiKey}`); - request.allowGzip = true; - if (apiKey === defaultApiKey$1) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("AnkrProvider"); - return true; - }; - } - return request; - } - getRpcError(payload, error) { - if (payload.method === "eth_sendRawTransaction") { - if (error && error.error && error.error.message === "INTERNAL_ERROR: could not replace existing tx") { - error.error.message = "replacement transaction underpriced"; - } - } - return super.getRpcError(payload, error); - } - isCommunityResource() { - return (this.apiKey === defaultApiKey$1); - } - } - - /** - * [[link-alchemy]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Arbitrum Sepolia Testnet (``arbitrum-sepolia``) - * - Base (``base``) - * - Base Goerlia Testnet (``base-goerli``) - * - Base Sepolia Testnet (``base-sepolia``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Optimism Sepolia Testnet (``optimism-sepolia``) - * - Polygon (``matic``) - * - Polygon Amoy Testnet (``matic-amoy``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:Alchemy [providers-alchemy] - */ - const defaultApiKey = "_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC"; - function getHost$4(name) { - switch (name) { - case "mainnet": - return "eth-mainnet.g.alchemy.com"; - case "goerli": - return "eth-goerli.g.alchemy.com"; - case "sepolia": - return "eth-sepolia.g.alchemy.com"; - case "arbitrum": - return "arb-mainnet.g.alchemy.com"; - case "arbitrum-goerli": - return "arb-goerli.g.alchemy.com"; - case "arbitrum-sepolia": - return "arb-sepolia.g.alchemy.com"; - case "base": - return "base-mainnet.g.alchemy.com"; - case "base-goerli": - return "base-goerli.g.alchemy.com"; - case "base-sepolia": - return "base-sepolia.g.alchemy.com"; - case "matic": - return "polygon-mainnet.g.alchemy.com"; - case "matic-amoy": - return "polygon-amoy.g.alchemy.com"; - case "matic-mumbai": - return "polygon-mumbai.g.alchemy.com"; - case "optimism": - return "opt-mainnet.g.alchemy.com"; - case "optimism-goerli": - return "opt-goerli.g.alchemy.com"; - case "optimism-sepolia": - return "opt-sepolia.g.alchemy.com"; - } - assertArgument(false, "unsupported network", "network", name); - } - /** - * The **AlchemyProvider** connects to the [[link-alchemy]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-alchemy-signup). - * - * @_docloc: api/providers/thirdparty - */ - class AlchemyProvider extends JsonRpcProvider { - apiKey; - constructor(_network, apiKey) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (apiKey == null) { - apiKey = defaultApiKey; - } - const request = AlchemyProvider.getRequest(network, apiKey); - super(request, network, { staticNetwork: network }); - defineProperties(this, { apiKey }); - } - _getProvider(chainId) { - try { - return new AlchemyProvider(chainId, this.apiKey); - } - catch (error) { } - return super._getProvider(chainId); - } - async _perform(req) { - // https://docs.alchemy.com/reference/trace-transaction - if (req.method === "getTransactionResult") { - const { trace, tx } = await resolveProperties({ - trace: this.send("trace_transaction", [req.hash]), - tx: this.getTransaction(req.hash) - }); - if (trace == null || tx == null) { - return null; - } - let data; - let error = false; - try { - data = trace[0].result.output; - error = (trace[0].error === "Reverted"); - } - catch (error) { } - if (data) { - assert(!error, "an error occurred during transaction executions", "CALL_EXCEPTION", { - action: "getTransactionResult", - data, - reason: null, - transaction: tx, - invocation: null, - revert: null // @TODO - }); - return data; - } - assert(false, "could not parse trace result", "BAD_DATA", { value: trace }); - } - return await super._perform(req); - } - isCommunityResource() { - return (this.apiKey === defaultApiKey); - } - static getRequest(network, apiKey) { - if (apiKey == null) { - apiKey = defaultApiKey; - } - const request = new FetchRequest(`https:/\/${getHost$4(network.name)}/v2/${apiKey}`); - request.allowGzip = true; - if (apiKey === defaultApiKey) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("alchemy"); - return true; - }; - } - return request; - } - } - - /** - * [[link-chainstack]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Arbitrum (``arbitrum``) - * - BNB Smart Chain Mainnet (``bnb``) - * - Polygon (``matic``) - * - * @_subsection: api/providers/thirdparty:Chainstack [providers-chainstack] - */ - function getApiKey(name) { - switch (name) { - case "mainnet": return "39f1d67cedf8b7831010a665328c9197"; - case "arbitrum": return "0550c209db33c3abf4cc927e1e18cea1"; - case "bnb": return "98b5a77e531614387366f6fc5da097f8"; - case "matic": return "cd9d4d70377471aa7c142ec4a4205249"; - } - assertArgument(false, "unsupported network", "network", name); - } - function getHost$3(name) { - switch (name) { - case "mainnet": - return "ethereum-mainnet.core.chainstack.com"; - case "arbitrum": - return "arbitrum-mainnet.core.chainstack.com"; - case "bnb": - return "bsc-mainnet.core.chainstack.com"; - case "matic": - return "polygon-mainnet.core.chainstack.com"; - } - assertArgument(false, "unsupported network", "network", name); - } - /** - * The **ChainstackProvider** connects to the [[link-chainstack]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-chainstack). - */ - class ChainstackProvider extends JsonRpcProvider { - /** - * The API key for the Chainstack connection. - */ - apiKey; - /** - * Creates a new **ChainstackProvider**. - */ - constructor(_network, apiKey) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (apiKey == null) { - apiKey = getApiKey(network.name); - } - const request = ChainstackProvider.getRequest(network, apiKey); - super(request, network, { staticNetwork: network }); - defineProperties(this, { apiKey }); - } - _getProvider(chainId) { - try { - return new ChainstackProvider(chainId, this.apiKey); - } - catch (error) { } - return super._getProvider(chainId); - } - isCommunityResource() { - return (this.apiKey === getApiKey(this._network.name)); - } - /** - * Returns a prepared request for connecting to %%network%% - * with %%apiKey%% and %%projectSecret%%. - */ - static getRequest(network, apiKey) { - if (apiKey == null) { - apiKey = getApiKey(network.name); - } - const request = new FetchRequest(`https:/\/${getHost$3(network.name)}/${apiKey}`); - request.allowGzip = true; - if (apiKey === getApiKey(network.name)) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("ChainstackProvider"); - return true; - }; - } - return request; - } - } - - /** - * About Cloudflare - * - * @_subsection: api/providers/thirdparty:Cloudflare [providers-cloudflare] - */ - /** - * About Cloudflare... - */ - class CloudflareProvider extends JsonRpcProvider { - constructor(_network) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - assertArgument(network.name === "mainnet", "unsupported network", "network", _network); - super("https:/\/cloudflare-eth.com/", network, { staticNetwork: network }); - } - } - - /** - * [[link-etherscan]] provides a third-party service for connecting to - * various blockchains over a combination of JSON-RPC and custom API - * endpoints. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Holesky Testnet (``holesky``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Base (``base``) - * - Base Sepolia Testnet (``base-sepolia``) - * - BNB Smart Chain Mainnet (``bnb``) - * - BNB Smart Chain Testnet (``bnbt``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - Polygon Amoy Testnet (``matic-amoy``) - * - * @_subsection api/providers/thirdparty:Etherscan [providers-etherscan] - */ - // See: https://docs.etherscan.io/supported-chains - const Supported = ("1 11155111 17000 560048 2741 11124 33111 33139 42170 " + - "42161 421614 43114 43113 8453 84532 80069 80094 199 1029 81457 " + - "168587773 56 97 42220 11142220 252 2523 100 999 737373 747474 " + - "59144 59141 5000 5003 43521 143 10143 1287 1284 1285 10 " + - "11155420 204 5611 80002 137 534352 534351 1329 1328 146 14601 " + - "988 2201 1923 1924 167013 167000 130 1301 480 4801 51 50 324 300").split(/ /g); - const THROTTLE = 2000; - function isPromise(value) { - return (value && typeof (value.then) === "function"); - } - const EtherscanPluginId = "org.ethers.plugins.provider.Etherscan"; - /** - * A Network can include an **EtherscanPlugin** to provide - * a custom base URL. - * - * @_docloc: api/providers/thirdparty:Etherscan - */ - class EtherscanPlugin extends NetworkPlugin { - /** - * The Etherscan API base URL. - */ - baseUrl; - /** - * Creates a new **EtherscanProvider** which will use - * %%baseUrl%%. - */ - constructor(baseUrl) { - super(EtherscanPluginId); - defineProperties(this, { baseUrl }); - } - clone() { - return new EtherscanPlugin(this.baseUrl); - } - } - const skipKeys = ["enableCcipRead"]; - let nextId = 1; - /** - * The **EtherscanBaseProvider** is the super-class of - * [[EtherscanProvider]], which should generally be used instead. - * - * Since the **EtherscanProvider** includes additional code for - * [[Contract]] access, in //rare cases// that contracts are not - * used, this class can reduce code size. - * - * @_docloc: api/providers/thirdparty:Etherscan - */ - class EtherscanProvider extends AbstractProvider { - /** - * The connected network. - */ - network; - /** - * The API key or null if using the community provided bandwidth. - */ - apiKey; - #plugin; - /** - * Creates a new **EtherscanBaseProvider**. - */ - constructor(_network, _apiKey) { - const apiKey = (_apiKey != null) ? _apiKey : null; - super(); - const network = Network.from(_network); - assertArgument(Supported.indexOf(`${network.chainId}`) >= 0, "unsupported network", "network", network); - this.#plugin = network.getPlugin(EtherscanPluginId); - defineProperties(this, { apiKey, network }); - } - /** - * Returns the base URL. - * - * If an [[EtherscanPlugin]] is configured on the - * [[EtherscanBaseProvider_network]], returns the plugin's - * baseUrl. - * - * Deprecated; for Etherscan v2 the base is no longer a simply - * host, but instead a URL including a chainId parameter. Changing - * this to return a URL prefix could break some libraries, so it - * is left intact but will be removed in the future as it is unused. - */ - getBaseUrl() { - if (this.#plugin) { - return this.#plugin.baseUrl; - } - switch (this.network.name) { - case "mainnet": - return "https:/\/api.etherscan.io"; - case "goerli": - return "https:/\/api-goerli.etherscan.io"; - case "sepolia": - return "https:/\/api-sepolia.etherscan.io"; - case "holesky": - return "https:/\/api-holesky.etherscan.io"; - case "arbitrum": - return "https:/\/api.arbiscan.io"; - case "arbitrum-goerli": - return "https:/\/api-goerli.arbiscan.io"; - case "base": - return "https:/\/api.basescan.org"; - case "base-sepolia": - return "https:/\/api-sepolia.basescan.org"; - case "bnb": - return "https:/\/api.bscscan.com"; - case "bnbt": - return "https:/\/api-testnet.bscscan.com"; - case "matic": - return "https:/\/api.polygonscan.com"; - case "matic-amoy": - return "https:/\/api-amoy.polygonscan.com"; - case "matic-mumbai": - return "https:/\/api-testnet.polygonscan.com"; - case "optimism": - return "https:/\/api-optimistic.etherscan.io"; - case "optimism-goerli": - return "https:/\/api-goerli-optimistic.etherscan.io"; - } - assertArgument(false, "unsupported network", "network", this.network); - } - /** - * Returns the URL for the %%module%% and %%params%%. - */ - getUrl(module, params) { - let query = Object.keys(params).reduce((accum, key) => { - const value = params[key]; - if (value != null) { - accum += `&${key}=${value}`; - } - return accum; - }, ""); - if (this.apiKey) { - query += `&apikey=${this.apiKey}`; - } - return `https:/\/api.etherscan.io/v2/api?chainid=${this.network.chainId}&module=${module}${query}`; - } - /** - * Returns the URL for using POST requests. - */ - getPostUrl() { - return `https:/\/api.etherscan.io/v2/api?chainid=${this.network.chainId}`; - } - /** - * Returns the parameters for using POST requests. - */ - getPostData(module, params) { - params.module = module; - params.apikey = this.apiKey; - params.chainid = this.network.chainId; - return params; - } - async detectNetwork() { - return this.network; - } - /** - * Resolves to the result of calling %%module%% with %%params%%. - * - * If %%post%%, the request is made as a POST request. - */ - async fetch(module, params, post) { - const id = nextId++; - const url = (post ? this.getPostUrl() : this.getUrl(module, params)); - const payload = (post ? this.getPostData(module, params) : null); - this.emit("debug", { action: "sendRequest", id, url, payload: payload }); - const request = new FetchRequest(url); - request.setThrottleParams({ slotInterval: 1000 }); - request.retryFunc = (req, resp, attempt) => { - if (this.isCommunityResource()) { - showThrottleMessage("Etherscan"); - } - return Promise.resolve(true); - }; - request.processFunc = async (request, response) => { - const result = response.hasBody() ? JSON.parse(toUtf8String(response.body)) : {}; - const throttle = ((typeof (result.result) === "string") ? result.result : "").toLowerCase().indexOf("rate limit") >= 0; - if (module === "proxy") { - // This JSON response indicates we are being throttled - if (result && result.status == 0 && result.message == "NOTOK" && throttle) { - this.emit("debug", { action: "receiveError", id, reason: "proxy-NOTOK", error: result }); - response.throwThrottleError(result.result, THROTTLE); - } - } - else { - if (throttle) { - this.emit("debug", { action: "receiveError", id, reason: "null result", error: result.result }); - response.throwThrottleError(result.result, THROTTLE); - } - } - return response; - }; - if (payload) { - request.setHeader("content-type", "application/x-www-form-urlencoded; charset=UTF-8"); - request.body = Object.keys(payload).map((k) => `${k}=${payload[k]}`).join("&"); - } - const response = await request.send(); - try { - response.assertOk(); - } - catch (error) { - this.emit("debug", { action: "receiveError", id, error, reason: "assertOk" }); - assert(false, "response error", "SERVER_ERROR", { request, response }); - } - if (!response.hasBody()) { - this.emit("debug", { action: "receiveError", id, error: "missing body", reason: "null body" }); - assert(false, "missing response", "SERVER_ERROR", { request, response }); - } - const result = JSON.parse(toUtf8String(response.body)); - if (module === "proxy") { - if (result.jsonrpc != "2.0") { - this.emit("debug", { action: "receiveError", id, result, reason: "invalid JSON-RPC" }); - assert(false, "invalid JSON-RPC response (missing jsonrpc='2.0')", "SERVER_ERROR", { request, response, info: { result } }); - } - if (result.error) { - this.emit("debug", { action: "receiveError", id, result, reason: "JSON-RPC error" }); - assert(false, "error response", "SERVER_ERROR", { request, response, info: { result } }); - } - this.emit("debug", { action: "receiveRequest", id, result }); - return result.result; - } - else { - // getLogs, getHistory have weird success responses - if (result.status == 0 && (result.message === "No records found" || result.message === "No transactions found")) { - this.emit("debug", { action: "receiveRequest", id, result }); - return result.result; - } - if (result.status != 1 || (typeof (result.message) === "string" && !result.message.match(/^OK/))) { - this.emit("debug", { action: "receiveError", id, result }); - assert(false, "error response", "SERVER_ERROR", { request, response, info: { result } }); - } - this.emit("debug", { action: "receiveRequest", id, result }); - return result.result; - } - } - /** - * Returns %%transaction%% normalized for the Etherscan API. - */ - _getTransactionPostData(transaction) { - const result = {}; - for (let key in transaction) { - if (skipKeys.indexOf(key) >= 0) { - continue; - } - if (transaction[key] == null) { - continue; - } - let value = transaction[key]; - if (key === "type" && value === 0) { - continue; - } - if (key === "blockTag" && value === "latest") { - continue; - } - // Quantity-types require no leading zero, unless 0 - if ({ type: true, gasLimit: true, gasPrice: true, maxFeePerGs: true, maxPriorityFeePerGas: true, nonce: true, value: true }[key]) { - value = toQuantity(value); - } - else if (key === "accessList") { - value = "[" + accessListify(value).map((set) => { - return `{address:"${set.address}",storageKeys:["${set.storageKeys.join('","')}"]}`; - }).join(",") + "]"; - } - else if (key === "blobVersionedHashes") { - if (value.length === 0) { - continue; - } - // @TODO: update this once the API supports blobs - assert(false, "Etherscan API does not support blobVersionedHashes", "UNSUPPORTED_OPERATION", { - operation: "_getTransactionPostData", - info: { transaction } - }); - } - else { - value = hexlify(value); - } - result[key] = value; - } - return result; - } - /** - * Throws the normalized Etherscan error. - */ - _checkError(req, error, transaction) { - // Pull any message out if, possible - let message = ""; - if (isError(error, "SERVER_ERROR")) { - // Check for an error emitted by a proxy call - try { - message = error.info.result.error.message; - } - catch (e) { } - if (!message) { - try { - message = error.info.message; - } - catch (e) { } - } - } - if (req.method === "estimateGas") { - if (!message.match(/revert/i) && message.match(/insufficient funds/i)) { - assert(false, "insufficient funds", "INSUFFICIENT_FUNDS", { - transaction: req.transaction - }); - } - } - if (req.method === "call" || req.method === "estimateGas") { - if (message.match(/execution reverted/i)) { - let data = ""; - try { - data = error.info.result.error.data; - } - catch (error) { } - const e = AbiCoder.getBuiltinCallException(req.method, req.transaction, data); - e.info = { request: req, error }; - throw e; - } - } - if (message) { - if (req.method === "broadcastTransaction") { - const transaction = Transaction.from(req.signedTransaction); - if (message.match(/replacement/i) && message.match(/underpriced/i)) { - assert(false, "replacement fee too low", "REPLACEMENT_UNDERPRICED", { - transaction - }); - } - if (message.match(/insufficient funds/)) { - assert(false, "insufficient funds for intrinsic transaction cost", "INSUFFICIENT_FUNDS", { - transaction - }); - } - if (message.match(/same hash was already imported|transaction nonce is too low|nonce too low/)) { - assert(false, "nonce has already been used", "NONCE_EXPIRED", { - transaction - }); - } - } - } - // Something we could not process - throw error; - } - async _detectNetwork() { - return this.network; - } - async _perform(req) { - switch (req.method) { - case "chainId": - return this.network.chainId; - case "getBlockNumber": - return this.fetch("proxy", { action: "eth_blockNumber" }); - case "getGasPrice": - return this.fetch("proxy", { action: "eth_gasPrice" }); - case "getPriorityFee": - // This is temporary until Etherscan completes support - if (this.network.name === "mainnet") { - return "1000000000"; - } - else if (this.network.name === "optimism") { - return "1000000"; - } - else { - throw new Error("fallback onto the AbstractProvider default"); - } - /* Working with Etherscan to get this added: - try { - const test = await this.fetch("proxy", { - action: "eth_maxPriorityFeePerGas" - }); - console.log(test); - return test; - } catch (e) { - console.log("DEBUG", e); - throw e; - } - */ - /* This might be safe; but due to rounding neither myself - or Etherscan are necessarily comfortable with this. :) - try { - const result = await this.fetch("gastracker", { action: "gasoracle" }); - console.log(result); - const gasPrice = parseUnits(result.SafeGasPrice, "gwei"); - const baseFee = parseUnits(result.suggestBaseFee, "gwei"); - const priorityFee = gasPrice - baseFee; - if (priorityFee < 0) { throw new Error("negative priority fee; defer to abstract provider default"); } - return priorityFee; - } catch (error) { - console.log("DEBUG", error); - throw error; - } - */ - case "getBalance": - // Returns base-10 result - return this.fetch("account", { - action: "balance", - address: req.address, - tag: req.blockTag - }); - case "getTransactionCount": - return this.fetch("proxy", { - action: "eth_getTransactionCount", - address: req.address, - tag: req.blockTag - }); - case "getCode": - return this.fetch("proxy", { - action: "eth_getCode", - address: req.address, - tag: req.blockTag - }); - case "getStorage": - return this.fetch("proxy", { - action: "eth_getStorageAt", - address: req.address, - position: req.position, - tag: req.blockTag - }); - case "broadcastTransaction": - return this.fetch("proxy", { - action: "eth_sendRawTransaction", - hex: req.signedTransaction - }, true).catch((error) => { - return this._checkError(req, error, req.signedTransaction); - }); - case "getBlock": - if ("blockTag" in req) { - return this.fetch("proxy", { - action: "eth_getBlockByNumber", - tag: req.blockTag, - boolean: (req.includeTransactions ? "true" : "false") - }); - } - assert(false, "getBlock by blockHash not supported by Etherscan", "UNSUPPORTED_OPERATION", { - operation: "getBlock(blockHash)" - }); - case "getTransaction": - return this.fetch("proxy", { - action: "eth_getTransactionByHash", - txhash: req.hash - }); - case "getTransactionReceipt": - return this.fetch("proxy", { - action: "eth_getTransactionReceipt", - txhash: req.hash - }); - case "call": { - if (req.blockTag !== "latest") { - throw new Error("EtherscanProvider does not support blockTag for call"); - } - const postData = this._getTransactionPostData(req.transaction); - postData.module = "proxy"; - postData.action = "eth_call"; - try { - return await this.fetch("proxy", postData, true); - } - catch (error) { - return this._checkError(req, error, req.transaction); - } - } - case "estimateGas": { - const postData = this._getTransactionPostData(req.transaction); - postData.module = "proxy"; - postData.action = "eth_estimateGas"; - try { - return await this.fetch("proxy", postData, true); - } - catch (error) { - return this._checkError(req, error, req.transaction); - } - } - } - return super._perform(req); - } - async getNetwork() { - return this.network; - } - /** - * Resolves to the current price of ether. - * - * This returns ``0`` on any network other than ``mainnet``. - */ - async getEtherPrice() { - if (this.network.name !== "mainnet") { - return 0.0; - } - return parseFloat((await this.fetch("stats", { action: "ethprice" })).ethusd); - } - /** - * Resolves to a [Contract]] for %%address%%, using the - * Etherscan API to retreive the Contract ABI. - */ - async getContract(_address) { - let address = this._getAddress(_address); - if (isPromise(address)) { - address = await address; - } - try { - const resp = await this.fetch("contract", { - action: "getabi", address - }); - const abi = JSON.parse(resp); - return new Contract(address, abi, this); - } - catch (error) { - return null; - } - } - isCommunityResource() { - return (this.apiKey == null); - } - } - - function getGlobal() { - if (typeof self !== 'undefined') { - return self; - } - if (typeof window !== 'undefined') { - return window; - } - if (typeof global !== 'undefined') { - return global; - } - throw new Error('unable to locate global object'); - } - const _WebSocket = getGlobal().WebSocket; - - /** - * Generic long-lived socket provider. - * - * Sub-classing notes - * - a sub-class MUST call the `_start()` method once connected - * - a sub-class MUST override the `_write(string)` method - * - a sub-class MUST call `_processMessage(string)` for each message - * - * @_subsection: api/providers/abstract-provider:Socket Providers [about-socketProvider] - */ - /** - * A **SocketSubscriber** uses a socket transport to handle events and - * should use [[_emit]] to manage the events. - */ - class SocketSubscriber { - #provider; - #filter; - /** - * The filter. - */ - get filter() { return JSON.parse(this.#filter); } - #filterId; - #paused; - #emitPromise; - /** - * Creates a new **SocketSubscriber** attached to %%provider%% listening - * to %%filter%%. - */ - constructor(provider, filter) { - this.#provider = provider; - this.#filter = JSON.stringify(filter); - this.#filterId = null; - this.#paused = null; - this.#emitPromise = null; - } - start() { - this.#filterId = this.#provider.send("eth_subscribe", this.filter).then((filterId) => { - this.#provider._register(filterId, this); - return filterId; - }); - } - stop() { - (this.#filterId).then((filterId) => { - if (this.#provider.destroyed) { - return; - } - this.#provider.send("eth_unsubscribe", [filterId]); - }); - this.#filterId = null; - } - // @TODO: pause should trap the current blockNumber, unsub, and on resume use getLogs - // and resume - pause(dropWhilePaused) { - assert(dropWhilePaused, "preserve logs while paused not supported by SocketSubscriber yet", "UNSUPPORTED_OPERATION", { operation: "pause(false)" }); - this.#paused = !!dropWhilePaused; - } - resume() { - this.#paused = null; - } - /** - * @_ignore: - */ - _handleMessage(message) { - if (this.#filterId == null) { - return; - } - if (this.#paused === null) { - let emitPromise = this.#emitPromise; - if (emitPromise == null) { - emitPromise = this._emit(this.#provider, message); - } - else { - emitPromise = emitPromise.then(async () => { - await this._emit(this.#provider, message); - }); - } - this.#emitPromise = emitPromise.then(() => { - if (this.#emitPromise === emitPromise) { - this.#emitPromise = null; - } - }); - } - } - /** - * Sub-classes **must** override this to emit the events on the - * provider. - */ - async _emit(provider, message) { - throw new Error("sub-classes must implemente this; _emit"); - } - } - /** - * A **SocketBlockSubscriber** listens for ``newHeads`` events and emits - * ``"block"`` events. - */ - class SocketBlockSubscriber extends SocketSubscriber { - /** - * @_ignore: - */ - constructor(provider) { - super(provider, ["newHeads"]); - } - async _emit(provider, message) { - provider.emit("block", parseInt(message.number)); - } - } - /** - * A **SocketPendingSubscriber** listens for pending transacitons and emits - * ``"pending"`` events. - */ - class SocketPendingSubscriber extends SocketSubscriber { - /** - * @_ignore: - */ - constructor(provider) { - super(provider, ["newPendingTransactions"]); - } - async _emit(provider, message) { - provider.emit("pending", message); - } - } - /** - * A **SocketEventSubscriber** listens for event logs. - */ - class SocketEventSubscriber extends SocketSubscriber { - #logFilter; - /** - * The filter. - */ - get logFilter() { return JSON.parse(this.#logFilter); } - /** - * @_ignore: - */ - constructor(provider, filter) { - super(provider, ["logs", filter]); - this.#logFilter = JSON.stringify(filter); - } - async _emit(provider, message) { - provider.emit(this.logFilter, provider._wrapLog(message, provider._network)); - } - } - /** - * A **SocketProvider** is backed by a long-lived connection over a - * socket, which can subscribe and receive real-time messages over - * its communication channel. - */ - class SocketProvider extends JsonRpcApiProvider { - #callbacks; - // Maps each filterId to its subscriber - #subs; - // If any events come in before a subscriber has finished - // registering, queue them - #pending; - /** - * Creates a new **SocketProvider** connected to %%network%%. - * - * If unspecified, the network will be discovered. - */ - constructor(network, _options) { - // Copy the options - const options = Object.assign({}, (_options != null) ? _options : {}); - // Support for batches is generally not supported for - // connection-base providers; if this changes in the future - // the _send should be updated to reflect this - assertArgument(options.batchMaxCount == null || options.batchMaxCount === 1, "sockets-based providers do not support batches", "options.batchMaxCount", _options); - options.batchMaxCount = 1; - // Socket-based Providers (generally) cannot change their network, - // since they have a long-lived connection; but let people override - // this if they have just cause. - if (options.staticNetwork == null) { - options.staticNetwork = true; - } - super(network, options); - this.#callbacks = new Map(); - this.#subs = new Map(); - this.#pending = new Map(); - } - // This value is only valid after _start has been called - /* - get _network(): Network { - if (this.#network == null) { - throw new Error("this shouldn't happen"); - } - return this.#network.clone(); - } - */ - _getSubscriber(sub) { - switch (sub.type) { - case "close": - return new UnmanagedSubscriber("close"); - case "block": - return new SocketBlockSubscriber(this); - case "pending": - return new SocketPendingSubscriber(this); - case "event": - return new SocketEventSubscriber(this, sub.filter); - case "orphan": - // Handled auto-matically within AbstractProvider - // when the log.removed = true - if (sub.filter.orphan === "drop-log") { - return new UnmanagedSubscriber("drop-log"); - } - } - return super._getSubscriber(sub); - } - /** - * Register a new subscriber. This is used internalled by Subscribers - * and generally is unecessary unless extending capabilities. - */ - _register(filterId, subscriber) { - this.#subs.set(filterId, subscriber); - const pending = this.#pending.get(filterId); - if (pending) { - for (const message of pending) { - subscriber._handleMessage(message); - } - this.#pending.delete(filterId); - } - } - async _send(payload) { - // WebSocket provider doesn't accept batches - assertArgument(!Array.isArray(payload), "WebSocket does not support batch send", "payload", payload); - // @TODO: stringify payloads here and store to prevent mutations - // Prepare a promise to respond to - const promise = new Promise((resolve, reject) => { - this.#callbacks.set(payload.id, { payload, resolve, reject }); - }); - // Wait until the socket is connected before writing to it - await this._waitUntilReady(); - // Write the request to the socket - await this._write(JSON.stringify(payload)); - return [await promise]; - } - // Sub-classes must call this once they are connected - /* - async _start(): Promise { - if (this.#ready) { return; } - - for (const { payload } of this.#callbacks.values()) { - await this._write(JSON.stringify(payload)); - } - - this.#ready = (async function() { - await super._start(); - })(); - } - */ - /** - * Sub-classes **must** call this with messages received over their - * transport to be processed and dispatched. - */ - async _processMessage(message) { - const result = (JSON.parse(message)); - if (result && typeof (result) === "object" && "id" in result) { - const callback = this.#callbacks.get(result.id); - if (callback == null) { - this.emit("error", makeError("received result for unknown id", "UNKNOWN_ERROR", { - reasonCode: "UNKNOWN_ID", - result - })); - return; - } - this.#callbacks.delete(result.id); - callback.resolve(result); - } - else if (result && result.method === "eth_subscription") { - const filterId = result.params.subscription; - const subscriber = this.#subs.get(filterId); - if (subscriber) { - subscriber._handleMessage(result.params.result); - } - else { - let pending = this.#pending.get(filterId); - if (pending == null) { - pending = []; - this.#pending.set(filterId, pending); - } - pending.push(result.params.result); - } - } - else { - this.emit("error", makeError("received unexpected message", "UNKNOWN_ERROR", { - reasonCode: "UNEXPECTED_MESSAGE", - result - })); - return; - } - } - /** - * Sub-classes **must** override this to send %%message%% over their - * transport. - */ - async _write(message) { - throw new Error("sub-classes must override this"); - } - } - - /** - * A JSON-RPC provider which is backed by a WebSocket. - * - * WebSockets are often preferred because they retain a live connection - * to a server, which permits more instant access to events. - * - * However, this incurs higher server infrasturture costs, so additional - * resources may be required to host your own WebSocket nodes and many - * third-party services charge additional fees for WebSocket endpoints. - */ - class WebSocketProvider extends SocketProvider { - #connect; - #websocket; - get websocket() { - if (this.#websocket == null) { - throw new Error("websocket closed"); - } - return this.#websocket; - } - constructor(url, network, options) { - super(network, options); - if (typeof (url) === "string") { - this.#connect = () => { return new _WebSocket(url); }; - this.#websocket = this.#connect(); - } - else if (typeof (url) === "function") { - this.#connect = url; - this.#websocket = url(); - } - else { - this.#connect = null; - this.#websocket = url; - } - this.websocket.onopen = async () => { - try { - await this._start(); - this.resume(); - } - catch (error) { - console.log("failed to start WebsocketProvider", error); - // @TODO: now what? Attempt reconnect? - } - }; - this.websocket.onmessage = (message) => { - this._processMessage(message.data); - }; - /* - this.websocket.onclose = (event) => { - // @TODO: What event.code should we reconnect on? - const reconnect = false; - if (reconnect) { - this.pause(true); - if (this.#connect) { - this.#websocket = this.#connect(); - this.#websocket.onopen = ... - // @TODO: this requires the super class to rebroadcast; move it there - } - this._reconnect(); - } - }; - */ - } - async _write(message) { - this.websocket.send(message); - } - async destroy() { - if (this.#websocket != null) { - this.#websocket.close(); - this.#websocket = null; - } - super.destroy(); - } - } - - /** - * [[link-infura]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Arbitrum Sepolia Testnet (``arbitrum-sepolia``) - * - Base (``base``) - * - Base Goerlia Testnet (``base-goerli``) - * - Base Sepolia Testnet (``base-sepolia``) - * - BNB Smart Chain Mainnet (``bnb``) - * - BNB Smart Chain Testnet (``bnbt``) - * - Linea (``linea``) - * - Linea Goerli Testnet (``linea-goerli``) - * - Linea Sepolia Testnet (``linea-sepolia``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Optimism Sepolia Testnet (``optimism-sepolia``) - * - Polygon (``matic``) - * - Polygon Amoy Testnet (``matic-amoy``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:INFURA [providers-infura] - */ - const defaultProjectId = "84842078b09946638c03157f83405213"; - function getHost$2(name) { - switch (name) { - case "mainnet": - return "mainnet.infura.io"; - case "goerli": - return "goerli.infura.io"; - case "sepolia": - return "sepolia.infura.io"; - case "arbitrum": - return "arbitrum-mainnet.infura.io"; - case "arbitrum-goerli": - return "arbitrum-goerli.infura.io"; - case "arbitrum-sepolia": - return "arbitrum-sepolia.infura.io"; - case "base": - return "base-mainnet.infura.io"; - case "base-goerlia": // @TODO: Remove this typo in the future! - case "base-goerli": - return "base-goerli.infura.io"; - case "base-sepolia": - return "base-sepolia.infura.io"; - case "bnb": - return "bsc-mainnet.infura.io"; - case "bnbt": - return "bsc-testnet.infura.io"; - case "linea": - return "linea-mainnet.infura.io"; - case "linea-goerli": - return "linea-goerli.infura.io"; - case "linea-sepolia": - return "linea-sepolia.infura.io"; - case "matic": - return "polygon-mainnet.infura.io"; - case "matic-amoy": - return "polygon-amoy.infura.io"; - case "matic-mumbai": - return "polygon-mumbai.infura.io"; - case "optimism": - return "optimism-mainnet.infura.io"; - case "optimism-goerli": - return "optimism-goerli.infura.io"; - case "optimism-sepolia": - return "optimism-sepolia.infura.io"; - } - assertArgument(false, "unsupported network", "network", name); - } - /** - * The **InfuraWebSocketProvider** connects to the [[link-infura]] - * WebSocket end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-infura-signup). - */ - class InfuraWebSocketProvider extends WebSocketProvider { - /** - * The Project ID for the INFURA connection. - */ - projectId; - /** - * The Project Secret. - * - * If null, no authenticated requests are made. This should not - * be used outside of private contexts. - */ - projectSecret; - /** - * Creates a new **InfuraWebSocketProvider**. - */ - constructor(network, projectId) { - const provider = new InfuraProvider(network, projectId); - const req = provider._getConnection(); - assert(!req.credentials, "INFURA WebSocket project secrets unsupported", "UNSUPPORTED_OPERATION", { operation: "InfuraProvider.getWebSocketProvider()" }); - const url = req.url.replace(/^http/i, "ws").replace("/v3/", "/ws/v3/"); - super(url, provider._network); - defineProperties(this, { - projectId: provider.projectId, - projectSecret: provider.projectSecret - }); - } - isCommunityResource() { - return (this.projectId === defaultProjectId); - } - } - /** - * The **InfuraProvider** connects to the [[link-infura]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-infura-signup). - */ - class InfuraProvider extends JsonRpcProvider { - /** - * The Project ID for the INFURA connection. - */ - projectId; - /** - * The Project Secret. - * - * If null, no authenticated requests are made. This should not - * be used outside of private contexts. - */ - projectSecret; - /** - * Creates a new **InfuraProvider**. - */ - constructor(_network, projectId, projectSecret) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (projectId == null) { - projectId = defaultProjectId; - } - if (projectSecret == null) { - projectSecret = null; - } - const request = InfuraProvider.getRequest(network, projectId, projectSecret); - super(request, network, { staticNetwork: network }); - defineProperties(this, { projectId, projectSecret }); - } - _getProvider(chainId) { - try { - return new InfuraProvider(chainId, this.projectId, this.projectSecret); - } - catch (error) { } - return super._getProvider(chainId); - } - isCommunityResource() { - return (this.projectId === defaultProjectId); - } - /** - * Creates a new **InfuraWebSocketProvider**. - */ - static getWebSocketProvider(network, projectId) { - return new InfuraWebSocketProvider(network, projectId); - } - /** - * Returns a prepared request for connecting to %%network%% - * with %%projectId%% and %%projectSecret%%. - */ - static getRequest(network, projectId, projectSecret) { - if (projectId == null) { - projectId = defaultProjectId; - } - if (projectSecret == null) { - projectSecret = null; - } - const request = new FetchRequest(`https:/\/${getHost$2(network.name)}/v3/${projectId}`); - request.allowGzip = true; - if (projectSecret) { - request.setCredentials("", projectSecret); - } - if (projectId === defaultProjectId) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("InfuraProvider"); - return true; - }; - } - return request; - } - } - - /** - * [[link-quicknode]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Holesky Testnet (``holesky``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Arbitrum Sepolia Testnet (``arbitrum-sepolia``) - * - Base Mainnet (``base``); - * - Base Goerli Testnet (``base-goerli``); - * - Base Sepolia Testnet (``base-sepolia``); - * - BNB Smart Chain Mainnet (``bnb``) - * - BNB Smart Chain Testnet (``bnbt``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Optimism Sepolia Testnet (``optimism-sepolia``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:QuickNode [providers-quicknode] - */ - const defaultToken = "919b412a057b5e9c9b6dce193c5a60242d6efadb"; - function getHost$1(name) { - switch (name) { - case "mainnet": - return "ethers.quiknode.pro"; - case "goerli": - return "ethers.ethereum-goerli.quiknode.pro"; - case "sepolia": - return "ethers.ethereum-sepolia.quiknode.pro"; - case "holesky": - return "ethers.ethereum-holesky.quiknode.pro"; - case "arbitrum": - return "ethers.arbitrum-mainnet.quiknode.pro"; - case "arbitrum-goerli": - return "ethers.arbitrum-goerli.quiknode.pro"; - case "arbitrum-sepolia": - return "ethers.arbitrum-sepolia.quiknode.pro"; - case "base": - return "ethers.base-mainnet.quiknode.pro"; - case "base-goerli": - return "ethers.base-goerli.quiknode.pro"; - case "base-spolia": - return "ethers.base-sepolia.quiknode.pro"; - case "bnb": - return "ethers.bsc.quiknode.pro"; - case "bnbt": - return "ethers.bsc-testnet.quiknode.pro"; - case "matic": - return "ethers.matic.quiknode.pro"; - case "matic-mumbai": - return "ethers.matic-testnet.quiknode.pro"; - case "optimism": - return "ethers.optimism.quiknode.pro"; - case "optimism-goerli": - return "ethers.optimism-goerli.quiknode.pro"; - case "optimism-sepolia": - return "ethers.optimism-sepolia.quiknode.pro"; - case "xdai": - return "ethers.xdai.quiknode.pro"; - } - assertArgument(false, "unsupported network", "network", name); - } - /* - @TODO: - These networks are not currently present in the Network - default included networks. Research them and ensure they - are EVM compatible and work with ethers - - http://ethers.matic-amoy.quiknode.pro - - http://ethers.avalanche-mainnet.quiknode.pro - http://ethers.avalanche-testnet.quiknode.pro - http://ethers.blast-sepolia.quiknode.pro - http://ethers.celo-mainnet.quiknode.pro - http://ethers.fantom.quiknode.pro - http://ethers.imx-demo.quiknode.pro - http://ethers.imx-mainnet.quiknode.pro - http://ethers.imx-testnet.quiknode.pro - http://ethers.near-mainnet.quiknode.pro - http://ethers.near-testnet.quiknode.pro - http://ethers.nova-mainnet.quiknode.pro - http://ethers.scroll-mainnet.quiknode.pro - http://ethers.scroll-testnet.quiknode.pro - http://ethers.tron-mainnet.quiknode.pro - http://ethers.zkevm-mainnet.quiknode.pro - http://ethers.zkevm-testnet.quiknode.pro - http://ethers.zksync-mainnet.quiknode.pro - http://ethers.zksync-testnet.quiknode.pro - */ - /** - * The **QuickNodeProvider** connects to the [[link-quicknode]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API token is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-quicknode). - */ - class QuickNodeProvider extends JsonRpcProvider { - /** - * The API token. - */ - token; - /** - * Creates a new **QuickNodeProvider**. - */ - constructor(_network, token) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (token == null) { - token = defaultToken; - } - const request = QuickNodeProvider.getRequest(network, token); - super(request, network, { staticNetwork: network }); - defineProperties(this, { token }); - } - _getProvider(chainId) { - try { - return new QuickNodeProvider(chainId, this.token); - } - catch (error) { } - return super._getProvider(chainId); - } - isCommunityResource() { - return (this.token === defaultToken); - } - /** - * Returns a new request prepared for %%network%% and the - * %%token%%. - */ - static getRequest(network, token) { - if (token == null) { - token = defaultToken; - } - const request = new FetchRequest(`https:/\/${getHost$1(network.name)}/${token}`); - request.allowGzip = true; - //if (projectSecret) { request.setCredentials("", projectSecret); } - if (token === defaultToken) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("QuickNodeProvider"); - return true; - }; - } - return request; - } - } - - /** - * A **FallbackProvider** provides resilience, security and performance - * in a way that is customizable and configurable. - * - * @_section: api/providers/fallback-provider:Fallback Provider [about-fallback-provider] - */ - const BN_1 = BigInt("1"); - const BN_2 = BigInt("2"); - function shuffle(array) { - for (let i = array.length - 1; i > 0; i--) { - const j = Math.floor(Math.random() * (i + 1)); - const tmp = array[i]; - array[i] = array[j]; - array[j] = tmp; - } - } - function stall$2(duration) { - return new Promise((resolve) => { setTimeout(resolve, duration); }); - } - function getTime() { return (new Date()).getTime(); } - function stringify(value) { - return JSON.stringify(value, (key, value) => { - if (typeof (value) === "bigint") { - return { type: "bigint", value: value.toString() }; - } - return value; - }); - } - const defaultConfig = { stallTimeout: 400, priority: 1, weight: 1 }; - const defaultState = { - blockNumber: -2, requests: 0, lateResponses: 0, errorResponses: 0, - outOfSync: -1, unsupportedEvents: 0, rollingDuration: 0, score: 0, - _network: null, _updateNumber: null, _totalTime: 0, - _lastFatalError: null, _lastFatalErrorTimestamp: 0 - }; - async function waitForSync(config, blockNumber) { - while (config.blockNumber < 0 || config.blockNumber < blockNumber) { - if (!config._updateNumber) { - config._updateNumber = (async () => { - try { - const blockNumber = await config.provider.getBlockNumber(); - if (blockNumber > config.blockNumber) { - config.blockNumber = blockNumber; - } - } - catch (error) { - config.blockNumber = -2; - config._lastFatalError = error; - config._lastFatalErrorTimestamp = getTime(); - } - config._updateNumber = null; - })(); - } - await config._updateNumber; - config.outOfSync++; - if (config._lastFatalError) { - break; - } - } - } - function _normalize(value) { - if (value == null) { - return "null"; - } - if (Array.isArray(value)) { - return "[" + (value.map(_normalize)).join(",") + "]"; - } - if (typeof (value) === "object" && typeof (value.toJSON) === "function") { - return _normalize(value.toJSON()); - } - switch (typeof (value)) { - case "boolean": - case "symbol": - return value.toString(); - case "bigint": - case "number": - return BigInt(value).toString(); - case "string": - return JSON.stringify(value); - case "object": { - const keys = Object.keys(value); - keys.sort(); - return "{" + keys.map((k) => `${JSON.stringify(k)}:${_normalize(value[k])}`).join(",") + "}"; - } - } - console.log("Could not serialize", value); - throw new Error("Hmm..."); - } - function normalizeResult(method, value) { - if ("error" in value) { - const error = value.error; - let tag; - if (isError(error, "CALL_EXCEPTION")) { - tag = _normalize(Object.assign({}, error, { - shortMessage: undefined, reason: undefined, info: undefined - })); - } - else { - tag = _normalize(error); - } - return { tag, value: error }; - } - const result = value.result; - return { tag: _normalize(result), value: result }; - } - // This strategy picks the highest weight result, as long as the weight is - // equal to or greater than quorum - function checkQuorum(quorum, results) { - const tally = new Map(); - for (const { value, tag, weight } of results) { - const t = tally.get(tag) || { value, weight: 0 }; - t.weight += weight; - tally.set(tag, t); - } - let best = null; - for (const r of tally.values()) { - if (r.weight >= quorum && (!best || r.weight > best.weight)) { - best = r; - } - } - if (best) { - return best.value; - } - return undefined; - } - function getMedian(quorum, results) { - let resultWeight = 0; - const errorMap = new Map(); - let bestError = null; - const values = []; - for (const { value, tag, weight } of results) { - if (value instanceof Error) { - const e = errorMap.get(tag) || { value, weight: 0 }; - e.weight += weight; - errorMap.set(tag, e); - if (bestError == null || e.weight > bestError.weight) { - bestError = e; - } - } - else { - values.push(BigInt(value)); - resultWeight += weight; - } - } - if (resultWeight < quorum) { - // We have quorum for an error - if (bestError && bestError.weight >= quorum) { - return bestError.value; - } - // We do not have quorum for a result - return undefined; - } - // Get the sorted values - values.sort((a, b) => ((a < b) ? -1 : (b > a) ? 1 : 0)); - const mid = Math.floor(values.length / 2); - // Odd-length; take the middle value - if (values.length % 2) { - return values[mid]; - } - // Even length; take the ceiling of the mean of the center two values - return (values[mid - 1] + values[mid] + BN_1) / BN_2; - } - function getAnyResult(quorum, results) { - // If any value or error meets quorum, that is our preferred result - const result = checkQuorum(quorum, results); - if (result !== undefined) { - return result; - } - // Otherwise, do we have any result? - for (const r of results) { - if (r.value) { - return r.value; - } - } - // Nope! - return undefined; - } - function getFuzzyMode(quorum, results) { - if (quorum === 1) { - return getNumber(getMedian(quorum, results), "%internal"); - } - const tally = new Map(); - const add = (result, weight) => { - const t = tally.get(result) || { result, weight: 0 }; - t.weight += weight; - tally.set(result, t); - }; - for (const { weight, value } of results) { - const r = getNumber(value); - add(r - 1, weight); - add(r, weight); - add(r + 1, weight); - } - let bestWeight = 0; - let bestResult = undefined; - for (const { weight, result } of tally.values()) { - // Use this result, if this result meets quorum and has either: - // - a better weight - // - or equal weight, but the result is larger - if (weight >= quorum && (weight > bestWeight || (bestResult != null && weight === bestWeight && result > bestResult))) { - bestWeight = weight; - bestResult = result; - } - } - return bestResult; - } - /** - * A **FallbackProvider** manages several [[Providers]] providing - * resilience by switching between slow or misbehaving nodes, security - * by requiring multiple backends to aggree and performance by allowing - * faster backends to respond earlier. - * - */ - class FallbackProvider extends AbstractProvider { - /** - * The number of backends that must agree on a value before it is - * accpeted. - */ - quorum; - /** - * @_ignore: - */ - eventQuorum; - /** - * @_ignore: - */ - eventWorkers; - #configs; - #height; - #initialSyncPromise; - /** - * Creates a new **FallbackProvider** with %%providers%% connected to - * %%network%%. - * - * If a [[Provider]] is included in %%providers%%, defaults are used - * for the configuration. - */ - constructor(providers, network, options) { - super(network, options); - this.#configs = providers.map((p) => { - if (p instanceof AbstractProvider) { - return Object.assign({ provider: p }, defaultConfig, defaultState); - } - else { - return Object.assign({}, defaultConfig, p, defaultState); - } - }); - this.#height = -2; - this.#initialSyncPromise = null; - if (options && options.quorum != null) { - this.quorum = options.quorum; - } - else { - this.quorum = Math.ceil(this.#configs.reduce((accum, config) => { - accum += config.weight; - return accum; - }, 0) / 2); - } - this.eventQuorum = 1; - this.eventWorkers = 1; - assertArgument(this.quorum <= this.#configs.reduce((a, c) => (a + c.weight), 0), "quorum exceed provider weight", "quorum", this.quorum); - } - get providerConfigs() { - return this.#configs.map((c) => { - const result = Object.assign({}, c); - for (const key in result) { - if (key[0] === "_") { - delete result[key]; - } - } - return result; - }); - } - async _detectNetwork() { - return Network.from(getBigInt(await this._perform({ method: "chainId" }))); - } - // @TODO: Add support to select providers to be the event subscriber - //_getSubscriber(sub: Subscription): Subscriber { - // throw new Error("@TODO"); - //} - /** - * Transforms a %%req%% into the correct method call on %%provider%%. - */ - async _translatePerform(provider, req) { - switch (req.method) { - case "broadcastTransaction": - return await provider.broadcastTransaction(req.signedTransaction); - case "call": - return await provider.call(Object.assign({}, req.transaction, { blockTag: req.blockTag })); - case "chainId": - return (await provider.getNetwork()).chainId; - case "estimateGas": - return await provider.estimateGas(req.transaction); - case "getBalance": - return await provider.getBalance(req.address, req.blockTag); - case "getBlock": { - const block = ("blockHash" in req) ? req.blockHash : req.blockTag; - return await provider.getBlock(block, req.includeTransactions); - } - case "getBlockNumber": - return await provider.getBlockNumber(); - case "getCode": - return await provider.getCode(req.address, req.blockTag); - case "getGasPrice": - return (await provider.getFeeData()).gasPrice; - case "getPriorityFee": - return (await provider.getFeeData()).maxPriorityFeePerGas; - case "getLogs": - return await provider.getLogs(req.filter); - case "getStorage": - return await provider.getStorage(req.address, req.position, req.blockTag); - case "getTransaction": - return await provider.getTransaction(req.hash); - case "getTransactionCount": - return await provider.getTransactionCount(req.address, req.blockTag); - case "getTransactionReceipt": - return await provider.getTransactionReceipt(req.hash); - case "getTransactionResult": - return await provider.getTransactionResult(req.hash); - } - } - // Grab the next (random) config that is not already part of - // the running set - #getNextConfig(running) { - // @TODO: Maybe do a check here to favour (heavily) providers that - // do not require waitForSync and disfavour providers that - // seem down-ish or are behaving slowly - const configs = Array.from(running).map((r) => r.config); - // Shuffle the states, sorted by priority - const allConfigs = this.#configs.slice(); - shuffle(allConfigs); - allConfigs.sort((a, b) => (a.priority - b.priority)); - for (const config of allConfigs) { - if (config._lastFatalError) { - continue; - } - if (configs.indexOf(config) === -1) { - return config; - } - } - return null; - } - // Adds a new runner (if available) to running. - #addRunner(running, req) { - const config = this.#getNextConfig(running); - // No runners available - if (config == null) { - return null; - } - // Create a new runner - const runner = { - config, result: null, didBump: false, - perform: null, staller: null - }; - const now = getTime(); - // Start performing this operation - runner.perform = (async () => { - try { - config.requests++; - const result = await this._translatePerform(config.provider, req); - runner.result = { result }; - } - catch (error) { - config.errorResponses++; - runner.result = { error }; - } - const dt = (getTime() - now); - config._totalTime += dt; - config.rollingDuration = 0.95 * config.rollingDuration + 0.05 * dt; - runner.perform = null; - })(); - // Start a staller; when this times out, it's time to force - // kicking off another runner because we are taking too long - runner.staller = (async () => { - await stall$2(config.stallTimeout); - runner.staller = null; - })(); - running.add(runner); - return runner; - } - // Initializes the blockNumber and network for each runner and - // blocks until initialized - async #initialSync() { - let initialSync = this.#initialSyncPromise; - if (!initialSync) { - const promises = []; - this.#configs.forEach((config) => { - promises.push((async () => { - await waitForSync(config, 0); - if (!config._lastFatalError) { - config._network = await config.provider.getNetwork(); - } - })()); - }); - this.#initialSyncPromise = initialSync = (async () => { - // Wait for all providers to have a block number and network - await Promise.all(promises); - // Check all the networks match - let chainId = null; - for (const config of this.#configs) { - if (config._lastFatalError) { - continue; - } - const network = (config._network); - if (chainId == null) { - chainId = network.chainId; - } - else if (network.chainId !== chainId) { - assert(false, "cannot mix providers on different networks", "UNSUPPORTED_OPERATION", { - operation: "new FallbackProvider" - }); - } - } - })(); - } - await initialSync; - } - async #checkQuorum(running, req) { - // Get all the result objects - const results = []; - for (const runner of running) { - if (runner.result != null) { - const { tag, value } = normalizeResult(req.method, runner.result); - results.push({ tag, value, weight: runner.config.weight }); - } - } - // Are there enough results to event meet quorum? - if (results.reduce((a, r) => (a + r.weight), 0) < this.quorum) { - return undefined; - } - switch (req.method) { - case "getBlockNumber": { - // We need to get the bootstrap block height - if (this.#height === -2) { - this.#height = Math.ceil(getNumber(getMedian(this.quorum, this.#configs.filter((c) => (!c._lastFatalError)).map((c) => ({ - value: c.blockNumber, - tag: getNumber(c.blockNumber).toString(), - weight: c.weight - }))))); - } - // Find the mode across all the providers, allowing for - // a little drift between block heights - const mode = getFuzzyMode(this.quorum, results); - if (mode === undefined) { - return undefined; - } - if (mode > this.#height) { - this.#height = mode; - } - return this.#height; - } - case "getGasPrice": - case "getPriorityFee": - case "estimateGas": - return getMedian(this.quorum, results); - case "getBlock": - // Pending blocks are in the mempool and already - // quite untrustworthy; just grab anything - if ("blockTag" in req && req.blockTag === "pending") { - return getAnyResult(this.quorum, results); - } - return checkQuorum(this.quorum, results); - case "call": - case "chainId": - case "getBalance": - case "getTransactionCount": - case "getCode": - case "getStorage": - case "getTransaction": - case "getTransactionReceipt": - case "getLogs": - return checkQuorum(this.quorum, results); - case "broadcastTransaction": - return getAnyResult(this.quorum, results); - } - assert(false, "unsupported method", "UNSUPPORTED_OPERATION", { - operation: `_perform(${stringify(req.method)})` - }); - } - async #waitForQuorum(running, req) { - if (running.size === 0) { - throw new Error("no runners?!"); - } - // Any promises that are interesting to watch for; an expired stall - // or a successful perform - const interesting = []; - let newRunners = 0; - for (const runner of running) { - // No responses, yet; keep an eye on it - if (runner.perform) { - interesting.push(runner.perform); - } - // Still stalling... - if (runner.staller) { - interesting.push(runner.staller); - continue; - } - // This runner has already triggered another runner - if (runner.didBump) { - continue; - } - // Got a response (result or error) or stalled; kick off another runner - runner.didBump = true; - newRunners++; - } - // Check if we have reached quorum on a result (or error) - const value = await this.#checkQuorum(running, req); - if (value !== undefined) { - if (value instanceof Error) { - throw value; - } - return value; - } - // Add any new runners, because a staller timed out or a result - // or error response came in. - for (let i = 0; i < newRunners; i++) { - this.#addRunner(running, req); - } - // All providers have returned, and we have no result - assert(interesting.length > 0, "quorum not met", "SERVER_ERROR", { - request: "%sub-requests", - info: { request: req, results: Array.from(running).map((r) => stringify(r.result)) } - }); - // Wait for someone to either complete its perform or stall out - await Promise.race(interesting); - // This is recursive, but at worst case the depth is 2x the - // number of providers (each has a perform and a staller) - return await this.#waitForQuorum(running, req); - } - async _perform(req) { - // Broadcasting a transaction is rare (ish) and already incurs - // a cost on the user, so spamming is safe-ish. Just send it to - // every backend. - if (req.method === "broadcastTransaction") { - // Once any broadcast provides a positive result, use it. No - // need to wait for anyone else - const results = this.#configs.map((c) => null); - const broadcasts = this.#configs.map(async ({ provider, weight }, index) => { - try { - const result = await provider._perform(req); - results[index] = Object.assign(normalizeResult(req.method, { result }), { weight }); - } - catch (error) { - results[index] = Object.assign(normalizeResult(req.method, { error }), { weight }); - } - }); - // As each promise finishes... - while (true) { - // Check for a valid broadcast result - const done = results.filter((r) => (r != null)); - for (const { value } of done) { - if (!(value instanceof Error)) { - return value; - } - } - // Check for a legit broadcast error (one which we cannot - // recover from; some nodes may return the following red - // herring events: - // - alredy seend (UNKNOWN_ERROR) - // - NONCE_EXPIRED - // - REPLACEMENT_UNDERPRICED - const result = checkQuorum(this.quorum, results.filter((r) => (r != null))); - if (isError(result, "INSUFFICIENT_FUNDS")) { - throw result; - } - // Kick off the next provider (if any) - const waiting = broadcasts.filter((b, i) => (results[i] == null)); - if (waiting.length === 0) { - break; - } - await Promise.race(waiting); - } - // Use standard quorum results; any result was returned above, - // so this will find any error that met quorum if any - const result = getAnyResult(this.quorum, results); - assert(result !== undefined, "problem multi-broadcasting", "SERVER_ERROR", { - request: "%sub-requests", - info: { request: req, results: results.map(stringify) } - }); - if (result instanceof Error) { - throw result; - } - return result; - } - await this.#initialSync(); - // Bootstrap enough runners to meet quorum - const running = new Set(); - let inflightQuorum = 0; - while (true) { - const runner = this.#addRunner(running, req); - if (runner == null) { - break; - } - inflightQuorum += runner.config.weight; - if (inflightQuorum >= this.quorum) { - break; - } - } - const result = await this.#waitForQuorum(running, req); - // Track requests sent to a provider that are still - // outstanding after quorum has been otherwise found - for (const runner of running) { - if (runner.perform && runner.result == null) { - runner.config.lateResponses++; - } - } - return result; - } - async destroy() { - for (const { provider } of this.#configs) { - provider.destroy(); - } - super.destroy(); - } - } - - function isWebSocketLike(value) { - return (value && typeof (value.send) === "function" && - typeof (value.close) === "function"); - } - const Testnets = "goerli kovan sepolia classicKotti optimism-goerli arbitrum-goerli matic-mumbai bnbt".split(" "); - /** - * Returns a default provider for %%network%%. - * - * If %%network%% is a [[WebSocketLike]] or string that begins with - * ``"ws:"`` or ``"wss:"``, a [[WebSocketProvider]] is returned backed - * by that WebSocket or URL. - * - * If %%network%% is a string that begins with ``"HTTP:"`` or ``"HTTPS:"``, - * a [[JsonRpcProvider]] is returned connected to that URL. - * - * Otherwise, a default provider is created backed by well-known public - * Web3 backends (such as [[link-infura]]) using community-provided API - * keys. - * - * The %%options%% allows specifying custom API keys per backend (setting - * an API key to ``"-"`` will omit that provider) and ``options.exclusive`` - * can be set to either a backend name or and array of backend names, which - * will whitelist **only** those backends. - * - * Current backend strings supported are: - * - ``"alchemy"`` - * - ``"ankr"`` - * - ``"cloudflare"`` - * - ``"chainstack"`` - * - ``"etherscan"`` - * - ``"infura"`` - * - ``"publicPolygon"`` - * - ``"quicknode"`` - * - * @example: - * // Connect to a local Geth node - * provider = getDefaultProvider("http://localhost:8545/"); - * - * // Connect to Ethereum mainnet with any current and future - * // third-party services available - * provider = getDefaultProvider("mainnet"); - * - * // Connect to Polygon, but only allow Etherscan and - * // INFURA and use "MY_API_KEY" in calls to Etherscan. - * provider = getDefaultProvider("matic", { - * etherscan: "MY_API_KEY", - * exclusive: [ "etherscan", "infura" ] - * }); - */ - function getDefaultProvider(network, options) { - if (options == null) { - options = {}; - } - const allowService = (name) => { - if (options[name] === "-") { - return false; - } - if (typeof (options.exclusive) === "string") { - return (name === options.exclusive); - } - if (Array.isArray(options.exclusive)) { - return (options.exclusive.indexOf(name) !== -1); - } - return true; - }; - if (typeof (network) === "string" && network.match(/^https?:/)) { - return new JsonRpcProvider(network); - } - if (typeof (network) === "string" && network.match(/^wss?:/) || isWebSocketLike(network)) { - return new WebSocketProvider(network); - } - // Get the network and name, if possible - let staticNetwork = null; - try { - staticNetwork = Network.from(network); - } - catch (error) { } - const providers = []; - if (allowService("publicPolygon") && staticNetwork) { - if (staticNetwork.name === "matic") { - providers.push(new JsonRpcProvider("https:/\/polygon-rpc.com/", staticNetwork, { staticNetwork })); - } - else if (staticNetwork.name === "matic-amoy") { - providers.push(new JsonRpcProvider("https:/\/rpc-amoy.polygon.technology/", staticNetwork, { staticNetwork })); - } - } - if (allowService("alchemy")) { - try { - providers.push(new AlchemyProvider(network, options.alchemy)); - } - catch (error) { } - } - if (allowService("ankr") && options.ankr != null) { - try { - providers.push(new AnkrProvider(network, options.ankr)); - } - catch (error) { } - } - /* Temporarily remove until custom error issue is fixed - if (allowService("blockscout")) { - try { - providers.push(new BlockscoutProvider(network, options.blockscout)); - } catch (error) { } - } - */ - if (allowService("chainstack")) { - try { - providers.push(new ChainstackProvider(network, options.chainstack)); - } - catch (error) { } - } - if (allowService("cloudflare")) { - try { - providers.push(new CloudflareProvider(network)); - } - catch (error) { } - } - if (allowService("etherscan")) { - try { - providers.push(new EtherscanProvider(network, options.etherscan)); - } - catch (error) { } - } - if (allowService("infura")) { - try { - let projectId = options.infura; - let projectSecret = undefined; - if (typeof (projectId) === "object") { - projectSecret = projectId.projectSecret; - projectId = projectId.projectId; - } - providers.push(new InfuraProvider(network, projectId, projectSecret)); - } - catch (error) { } - } - /* - if (options.pocket !== "-") { - try { - let appId = options.pocket; - let secretKey: undefined | string = undefined; - let loadBalancer: undefined | boolean = undefined; - if (typeof(appId) === "object") { - loadBalancer = !!appId.loadBalancer; - secretKey = appId.secretKey; - appId = appId.appId; - } - providers.push(new PocketProvider(network, appId, secretKey, loadBalancer)); - } catch (error) { console.log(error); } - } - */ - if (allowService("quicknode")) { - try { - let token = options.quicknode; - providers.push(new QuickNodeProvider(network, token)); - } - catch (error) { } - } - assert(providers.length, "unsupported default network", "UNSUPPORTED_OPERATION", { - operation: "getDefaultProvider" - }); - // No need for a FallbackProvider - if (providers.length === 1) { - return providers[0]; - } - // We use the floor because public third-party providers can be unreliable, - // so a low number of providers with a large quorum will fail too often - let quorum = Math.floor(providers.length / 2); - if (quorum > 2) { - quorum = 2; - } - // Testnets don't need as strong a security gaurantee and speed is - // more useful during testing - if (staticNetwork && Testnets.indexOf(staticNetwork.name) !== -1) { - quorum = 1; - } - // Provided override qorum takes priority - if (options && options.quorum) { - quorum = options.quorum; - } - return new FallbackProvider(providers, undefined, { quorum }); - } - - /** - * A **NonceManager** wraps another [[Signer]] and automatically manages - * the nonce, ensuring serialized and sequential nonces are used during - * transaction. - */ - class NonceManager extends AbstractSigner { - /** - * The Signer being managed. - */ - signer; - #noncePromise; - #delta; - /** - * Creates a new **NonceManager** to manage %%signer%%. - */ - constructor(signer) { - super(signer.provider); - defineProperties(this, { signer }); - this.#noncePromise = null; - this.#delta = 0; - } - async getAddress() { - return this.signer.getAddress(); - } - connect(provider) { - return new NonceManager(this.signer.connect(provider)); - } - async getNonce(blockTag) { - if (blockTag === "pending") { - if (this.#noncePromise == null) { - this.#noncePromise = super.getNonce("pending"); - } - const delta = this.#delta; - return (await this.#noncePromise) + delta; - } - return super.getNonce(blockTag); - } - /** - * Manually increment the nonce. This may be useful when managng - * offline transactions. - */ - increment() { - this.#delta++; - } - /** - * Resets the nonce, causing the **NonceManager** to reload the current - * nonce from the blockchain on the next transaction. - */ - reset() { - this.#delta = 0; - this.#noncePromise = null; - } - async sendTransaction(tx) { - const noncePromise = this.getNonce("pending"); - this.increment(); - tx = await this.signer.populateTransaction(tx); - tx.nonce = await noncePromise; - // @TODO: Maybe handle interesting/recoverable errors? - // Like don't increment if the tx was certainly not sent - return await this.signer.sendTransaction(tx); - } - signTransaction(tx) { - return this.signer.signTransaction(tx); - } - signMessage(message) { - return this.signer.signMessage(message); - } - signTypedData(domain, types, value) { - return this.signer.signTypedData(domain, types, value); - } - } - - /** - * A **BrowserProvider** is intended to wrap an injected provider which - * adheres to the [[link-eip-1193]] standard, which most (if not all) - * currently do. - */ - class BrowserProvider extends JsonRpcApiPollingProvider { - #request; - #providerInfo; - /** - * Connect to the %%ethereum%% provider, optionally forcing the - * %%network%%. - */ - constructor(ethereum, network, _options) { - // Copy the options - const options = Object.assign({}, ((_options != null) ? _options : {}), { batchMaxCount: 1 }); - assertArgument(ethereum && ethereum.request, "invalid EIP-1193 provider", "ethereum", ethereum); - super(network, options); - this.#providerInfo = null; - if (_options && _options.providerInfo) { - this.#providerInfo = _options.providerInfo; - } - this.#request = async (method, params) => { - const payload = { method, params }; - this.emit("debug", { action: "sendEip1193Request", payload }); - try { - const result = await ethereum.request(payload); - this.emit("debug", { action: "receiveEip1193Result", result }); - return result; - } - catch (e) { - const error = new Error(e.message); - error.code = e.code; - error.data = e.data; - error.payload = payload; - this.emit("debug", { action: "receiveEip1193Error", error }); - throw error; - } - }; - } - get providerInfo() { - return this.#providerInfo; - } - async send(method, params) { - await this._start(); - return await super.send(method, params); - } - async _send(payload) { - assertArgument(!Array.isArray(payload), "EIP-1193 does not support batch request", "payload", payload); - try { - const result = await this.#request(payload.method, payload.params || []); - return [{ id: payload.id, result }]; - } - catch (e) { - return [{ - id: payload.id, - error: { code: e.code, data: e.data, message: e.message } - }]; - } - } - getRpcError(payload, error) { - error = JSON.parse(JSON.stringify(error)); - // EIP-1193 gives us some machine-readable error codes, so rewrite - // them into Ethers standard errors. - switch (error.error.code || -1) { - case 4001: - error.error.message = `ethers-user-denied: ${error.error.message}`; - break; - case 4200: - error.error.message = `ethers-unsupported: ${error.error.message}`; - break; - } - return super.getRpcError(payload, error); - } - /** - * Resolves to ``true`` if the provider manages the %%address%%. - */ - async hasSigner(address) { - if (address == null) { - address = 0; - } - const accounts = await this.send("eth_accounts", []); - if (typeof (address) === "number") { - return (accounts.length > address); - } - address = address.toLowerCase(); - return accounts.filter((a) => (a.toLowerCase() === address)).length !== 0; - } - async getSigner(address) { - if (address == null) { - address = 0; - } - if (!(await this.hasSigner(address))) { - try { - await this.#request("eth_requestAccounts", []); - } - catch (error) { - const payload = error.payload; - throw this.getRpcError(payload, { id: payload.id, error }); - } - } - return await super.getSigner(address); - } - /** - * Discover and connect to a Provider in the Browser using the - * [[link-eip-6963]] discovery mechanism. If no providers are - * present, ``null`` is resolved. - */ - static async discover(options) { - if (options == null) { - options = {}; - } - if (options.provider) { - return new BrowserProvider(options.provider); - } - const context = options.window ? options.window : - (typeof (window) !== "undefined") ? window : null; - if (context == null) { - return null; - } - const anyProvider = options.anyProvider; - if (anyProvider && context.ethereum) { - return new BrowserProvider(context.ethereum); - } - if (!("addEventListener" in context && "dispatchEvent" in context - && "removeEventListener" in context)) { - return null; - } - const timeout = options.timeout ? options.timeout : 300; - if (timeout === 0) { - return null; - } - return await (new Promise((resolve, reject) => { - let found = []; - const addProvider = (event) => { - found.push(event.detail); - if (anyProvider) { - finalize(); - } - }; - const finalize = () => { - clearTimeout(timer); - if (found.length) { - // If filtering is provided: - if (options && options.filter) { - // Call filter, with a copies of found provider infos - const filtered = options.filter(found.map(i => Object.assign({}, (i.info)))); - if (filtered == null) { - // No provider selected - resolve(null); - } - else if (filtered instanceof BrowserProvider) { - // Custom provider created - resolve(filtered); - } - else { - // Find the matching provider - let match = null; - if (filtered.uuid) { - const matches = found.filter(f => (filtered.uuid === f.info.uuid)); - // @TODO: What should happen if multiple values - // for the same UUID? - match = matches[0]; - } - if (match) { - const { provider, info } = match; - resolve(new BrowserProvider(provider, undefined, { - providerInfo: info - })); - } - else { - reject(makeError("filter returned unknown info", "UNSUPPORTED_OPERATION", { - value: filtered - })); - } - } - } - else { - // Pick the first found provider - const { provider, info } = found[0]; - resolve(new BrowserProvider(provider, undefined, { - providerInfo: info - })); - } - } - else { - // Nothing found - resolve(null); - } - context.removeEventListener("eip6963:announceProvider", addProvider); - }; - const timer = setTimeout(() => { finalize(); }, timeout); - context.addEventListener("eip6963:announceProvider", addProvider); - context.dispatchEvent(new Event("eip6963:requestProvider")); - })); - } - } - - /** - * [[link-blockscout]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Sepolia Testnet (``sepolia``) - * - Holesky Testnet (``holesky``) - * - Ethereum Classic (``classic``) - * - Arbitrum (``arbitrum``) - * - Base (``base``) - * - Base Sepolia Testnet (``base-sepolia``) - * - Gnosis (``xdai``) - * - Optimism (``optimism``) - * - Optimism Sepolia Testnet (``optimism-sepolia``) - * - Polygon (``matic``) - * - * @_subsection: api/providers/thirdparty:Blockscout [providers-blockscout] - */ - function getUrl(name) { - switch (name) { - case "mainnet": - return "https:/\/eth.blockscout.com/api/eth-rpc"; - case "sepolia": - return "https:/\/eth-sepolia.blockscout.com/api/eth-rpc"; - case "holesky": - return "https:/\/eth-holesky.blockscout.com/api/eth-rpc"; - case "classic": - return "https:/\/etc.blockscout.com/api/eth-rpc"; - case "arbitrum": - return "https:/\/arbitrum.blockscout.com/api/eth-rpc"; - case "base": - return "https:/\/base.blockscout.com/api/eth-rpc"; - case "base-sepolia": - return "https:/\/base-sepolia.blockscout.com/api/eth-rpc"; - case "matic": - return "https:/\/polygon.blockscout.com/api/eth-rpc"; - case "optimism": - return "https:/\/optimism.blockscout.com/api/eth-rpc"; - case "optimism-sepolia": - return "https:/\/optimism-sepolia.blockscout.com/api/eth-rpc"; - case "xdai": - return "https:/\/gnosis.blockscout.com/api/eth-rpc"; - } - assertArgument(false, "unsupported network", "network", name); - } - /** - * The **BlockscoutProvider** connects to the [[link-blockscout]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-blockscout). - */ - class BlockscoutProvider extends JsonRpcProvider { - /** - * The API key. - */ - apiKey; - /** - * Creates a new **BlockscoutProvider**. - */ - constructor(_network, apiKey) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (apiKey == null) { - apiKey = null; - } - const request = BlockscoutProvider.getRequest(network); - super(request, network, { staticNetwork: network }); - defineProperties(this, { apiKey }); - } - _getProvider(chainId) { - try { - return new BlockscoutProvider(chainId, this.apiKey); - } - catch (error) { } - return super._getProvider(chainId); - } - isCommunityResource() { - return (this.apiKey === null); - } - getRpcRequest(req) { - // Blockscout enforces the TAG argument for estimateGas - const resp = super.getRpcRequest(req); - if (resp && resp.method === "eth_estimateGas" && resp.args.length == 1) { - resp.args = resp.args.slice(); - resp.args.push("latest"); - } - return resp; - } - getRpcError(payload, _error) { - const error = _error ? _error.error : null; - // Blockscout currently drops the VM result and replaces it with a - // human-readable string, so we need to make it machine-readable. - if (error && error.code === -32015 && !isHexString(error.data || "", true)) { - const panicCodes = { - "assert(false)": "01", - "arithmetic underflow or overflow": "11", - "division or modulo by zero": "12", - "out-of-bounds array access; popping on an empty array": "31", - "out-of-bounds access of an array or bytesN": "32" - }; - let panicCode = ""; - if (error.message === "VM execution error.") { - // eth_call passes this message - panicCode = panicCodes[error.data] || ""; - } - else if (panicCodes[error.message || ""]) { - panicCode = panicCodes[error.message || ""]; - } - if (panicCode) { - error.message += ` (reverted: ${error.data})`; - error.data = "0x4e487b7100000000000000000000000000000000000000000000000000000000000000" + panicCode; - } - } - else if (error && error.code === -32000) { - if (error.message === "wrong transaction nonce") { - error.message += " (nonce too low)"; - } - } - return super.getRpcError(payload, _error); - } - /** - * Returns a prepared request for connecting to %%network%% - * with %%apiKey%%. - */ - static getRequest(network) { - const request = new FetchRequest(getUrl(network.name)); - request.allowGzip = true; - return request; - } - } - - /** - * [[link-pocket]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Polygon (``matic``) - * - Arbitrum (``arbitrum``) - * - * @_subsection: api/providers/thirdparty:Pocket [providers-pocket] - */ - const defaultApplicationId = "62e1ad51b37b8e00394bda3b"; - function getHost(name) { - switch (name) { - case "mainnet": - return "eth-mainnet.gateway.pokt.network"; - case "goerli": - return "eth-goerli.gateway.pokt.network"; - case "matic": - return "poly-mainnet.gateway.pokt.network"; - case "matic-mumbai": - return "polygon-mumbai-rpc.gateway.pokt.network"; - } - assertArgument(false, "unsupported network", "network", name); - } - /** - * The **PocketProvider** connects to the [[link-pocket]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-pocket-signup). - */ - class PocketProvider extends JsonRpcProvider { - /** - * The Application ID for the Pocket connection. - */ - applicationId; - /** - * The Application Secret for making authenticated requests - * to the Pocket connection. - */ - applicationSecret; - /** - * Create a new **PocketProvider**. - * - * By default connecting to ``mainnet`` with a highly throttled - * API key. - */ - constructor(_network, applicationId, applicationSecret) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (applicationId == null) { - applicationId = defaultApplicationId; - } - if (applicationSecret == null) { - applicationSecret = null; - } - const options = { staticNetwork: network }; - const request = PocketProvider.getRequest(network, applicationId, applicationSecret); - super(request, network, options); - defineProperties(this, { applicationId, applicationSecret }); - } - _getProvider(chainId) { - try { - return new PocketProvider(chainId, this.applicationId, this.applicationSecret); - } - catch (error) { } - return super._getProvider(chainId); - } - /** - * Returns a prepared request for connecting to %%network%% with - * %%applicationId%%. - */ - static getRequest(network, applicationId, applicationSecret) { - if (applicationId == null) { - applicationId = defaultApplicationId; - } - const request = new FetchRequest(`https:/\/${getHost(network.name)}/v1/lb/${applicationId}`); - request.allowGzip = true; - if (applicationSecret) { - request.setCredentials("", applicationSecret); - } - if (applicationId === defaultApplicationId) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("PocketProvider"); - return true; - }; - } - return request; - } - isCommunityResource() { - return (this.applicationId === defaultApplicationId); - } - } - - const IpcSocketProvider = undefined; - - /** - * The **BaseWallet** is a stream-lined implementation of a - * [[Signer]] that operates with a private key. - * - * It is preferred to use the [[Wallet]] class, as it offers - * additional functionality and simplifies loading a variety - * of JSON formats, Mnemonic Phrases, etc. - * - * This class may be of use for those attempting to implement - * a minimal Signer. - */ - class BaseWallet extends AbstractSigner { - /** - * The wallet address. - */ - address; - #signingKey; - /** - * Creates a new BaseWallet for %%privateKey%%, optionally - * connected to %%provider%%. - * - * If %%provider%% is not specified, only offline methods can - * be used. - */ - constructor(privateKey, provider) { - super(provider); - assertArgument(privateKey && typeof (privateKey.sign) === "function", "invalid private key", "privateKey", "[ REDACTED ]"); - this.#signingKey = privateKey; - const address = computeAddress(this.signingKey.publicKey); - defineProperties(this, { address }); - } - // Store private values behind getters to reduce visibility - // in console.log - /** - * The [[SigningKey]] used for signing payloads. - */ - get signingKey() { return this.#signingKey; } - /** - * The private key for this wallet. - */ - get privateKey() { return this.signingKey.privateKey; } - async getAddress() { return this.address; } - connect(provider) { - return new BaseWallet(this.#signingKey, provider); - } - async signTransaction(tx) { - tx = copyRequest(tx); - // Replace any Addressable or ENS name with an address - const { to, from } = await resolveProperties({ - to: (tx.to ? resolveAddress(tx.to, this) : undefined), - from: (tx.from ? resolveAddress(tx.from, this) : undefined) - }); - if (to != null) { - tx.to = to; - } - if (from != null) { - tx.from = from; - } - if (tx.from != null) { - assertArgument(getAddress((tx.from)) === this.address, "transaction from address mismatch", "tx.from", tx.from); - delete tx.from; - } - // Build the transaction - const btx = Transaction.from(tx); - btx.signature = this.signingKey.sign(btx.unsignedHash); - return btx.serialized; - } - async signMessage(message) { - return this.signMessageSync(message); - } - // @TODO: Add a secialized signTx and signTyped sync that enforces - // all parameters are known? - /** - * Returns the signature for %%message%% signed with this wallet. - */ - signMessageSync(message) { - return this.signingKey.sign(hashMessage(message)).serialized; - } - /** - * Returns the Authorization for %%auth%%. - */ - authorizeSync(auth) { - assertArgument(typeof (auth.address) === "string", "invalid address for authorizeSync", "auth.address", auth); - const signature = this.signingKey.sign(hashAuthorization(auth)); - return Object.assign({}, { - address: getAddress(auth.address), - nonce: getBigInt(auth.nonce || 0), - chainId: getBigInt(auth.chainId || 0), - }, { signature }); - } - /** - * Resolves to the Authorization for %%auth%%. - */ - async authorize(auth) { - auth = Object.assign({}, auth, { - address: await resolveAddress(auth.address, this) - }); - return this.authorizeSync(await this.populateAuthorization(auth)); - } - async signTypedData(domain, types, value) { - // Populate any ENS names - const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (name) => { - // @TODO: this should use resolveName; addresses don't - // need a provider - assert(this.provider != null, "cannot resolve ENS names without a provider", "UNSUPPORTED_OPERATION", { - operation: "resolveName", - info: { name } - }); - const address = await this.provider.resolveName(name); - assert(address != null, "unconfigured ENS name", "UNCONFIGURED_NAME", { - value: name - }); - return address; - }); - return this.signingKey.sign(TypedDataEncoder.hash(populated.domain, types, populated.value)).serialized; - } - } - - const subsChrs = " !#$%&'()*+,-./<=>?@[]^_`{|}~"; - const Word = /^[a-z]*$/i; - function unfold(words, sep) { - let initial = 97; - return words.reduce((accum, word) => { - if (word === sep) { - initial++; - } - else if (word.match(Word)) { - accum.push(String.fromCharCode(initial) + word); - } - else { - initial = 97; - accum.push(word); - } - return accum; - }, []); - } - /** - * @_ignore - */ - function decode(data, subs) { - // Replace all the substitutions with their expanded form - for (let i = subsChrs.length - 1; i >= 0; i--) { - data = data.split(subsChrs[i]).join(subs.substring(2 * i, 2 * i + 2)); - } - // Get all tle clumps; each suffix, first-increment and second-increment - const clumps = []; - const leftover = data.replace(/(:|([0-9])|([A-Z][a-z]*))/g, (all, item, semi, word) => { - if (semi) { - for (let i = parseInt(semi); i >= 0; i--) { - clumps.push(";"); - } - } - else { - clumps.push(item.toLowerCase()); - } - return ""; - }); - /* c8 ignore start */ - if (leftover) { - throw new Error(`leftovers: ${JSON.stringify(leftover)}`); - } - /* c8 ignore stop */ - return unfold(unfold(clumps, ";"), ":"); - } - /** - * @_ignore - */ - function decodeOwl(data) { - assertArgument(data[0] === "0", "unsupported auwl data", "data", data); - return decode(data.substring(1 + 2 * subsChrs.length), data.substring(1, 1 + 2 * subsChrs.length)); - } - - /** - * A Wordlist represents a collection of language-specific - * words used to encode and devoce [[link-bip-39]] encoded data - * by mapping words to 11-bit values and vice versa. - */ - class Wordlist { - locale; - /** - * Creates a new Wordlist instance. - * - * Sub-classes MUST call this if they provide their own constructor, - * passing in the locale string of the language. - * - * Generally there is no need to create instances of a Wordlist, - * since each language-specific Wordlist creates an instance and - * there is no state kept internally, so they are safe to share. - */ - constructor(locale) { - defineProperties(this, { locale }); - } - /** - * Sub-classes may override this to provide a language-specific - * method for spliting %%phrase%% into individual words. - * - * By default, %%phrase%% is split using any sequences of - * white-space as defined by regular expressions (i.e. ``/\s+/``). - */ - split(phrase) { - return phrase.toLowerCase().split(/\s+/g); - } - /** - * Sub-classes may override this to provider a language-specific - * method for joining %%words%% into a phrase. - * - * By default, %%words%% are joined by a single space. - */ - join(words) { - return words.join(" "); - } - } - - // Use the encode-latin.js script to create the necessary - // data files to be consumed by this class - /** - * An OWL format Wordlist is an encoding method that exploits - * the general locality of alphabetically sorted words to - * achieve a simple but effective means of compression. - * - * This class is generally not useful to most developers as - * it is used mainly internally to keep Wordlists for languages - * based on ASCII-7 small. - * - * If necessary, there are tools within the ``generation/`` folder - * to create the necessary data. - */ - class WordlistOwl extends Wordlist { - #data; - #checksum; - /** - * Creates a new Wordlist for %%locale%% using the OWL %%data%% - * and validated against the %%checksum%%. - */ - constructor(locale, data, checksum) { - super(locale); - this.#data = data; - this.#checksum = checksum; - this.#words = null; - } - /** - * The OWL-encoded data. - */ - get _data() { return this.#data; } - /** - * Decode all the words for the wordlist. - */ - _decodeWords() { - return decodeOwl(this.#data); - } - #words; - #loadWords() { - if (this.#words == null) { - const words = this._decodeWords(); - // Verify the computed list matches the official list - const checksum = id(words.join("\n") + "\n"); - /* c8 ignore start */ - if (checksum !== this.#checksum) { - throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`); - } - /* c8 ignore stop */ - this.#words = words; - } - return this.#words; - } - getWord(index) { - const words = this.#loadWords(); - assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); - return words[index]; - } - getWordIndex(word) { - return this.#loadWords().indexOf(word); - } - } - - const words = "0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-EgSe0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-PM&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryFN Noc|PutQuirySSue0Em1Ory:CketGu?RZz3AlousAns~yWel9BInKeUr}yY5D+I)MpNg!Ni%Nk/:Ng?oo3EnEpT^upY3CkDD}yNdNgdomSsTT^&TeTt&Wi4E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ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOgAyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NNGradeHoldOnP Set1BOng::Rd3Ar~ow9UUngU`:3BraRo9NeO"; - const checksum = "0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"; - let wordlist = null; - /** - * The [[link-bip39-en]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ - class LangEn extends WordlistOwl { - /** - * Creates a new instance of the English language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langEn]] should suffice. - * - * @_ignore: - */ - constructor() { super("en", words, checksum); } - /** - * Returns a singleton instance of a ``LangEn``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist == null) { - wordlist = new LangEn(); - } - return wordlist; - } - } - - // Returns a byte with the MSB bits set - function getUpperMask(bits) { - return ((1 << bits) - 1) << (8 - bits) & 0xff; - } - // Returns a byte with the LSB bits set - function getLowerMask(bits) { - return ((1 << bits) - 1) & 0xff; - } - function mnemonicToEntropy(mnemonic, wordlist) { - assertNormalize("NFKD"); - if (wordlist == null) { - wordlist = LangEn.wordlist(); - } - const words = wordlist.split(mnemonic); - assertArgument((words.length % 3) === 0 && words.length >= 12 && words.length <= 24, "invalid mnemonic length", "mnemonic", "[ REDACTED ]"); - const entropy = new Uint8Array(Math.ceil(11 * words.length / 8)); - let offset = 0; - for (let i = 0; i < words.length; i++) { - let index = wordlist.getWordIndex(words[i].normalize("NFKD")); - assertArgument(index >= 0, `invalid mnemonic word at index ${i}`, "mnemonic", "[ REDACTED ]"); - for (let bit = 0; bit < 11; bit++) { - if (index & (1 << (10 - bit))) { - entropy[offset >> 3] |= (1 << (7 - (offset % 8))); - } - offset++; - } - } - const entropyBits = 32 * words.length / 3; - const checksumBits = words.length / 3; - const checksumMask = getUpperMask(checksumBits); - const checksum = getBytes(sha256(entropy.slice(0, entropyBits / 8)))[0] & checksumMask; - assertArgument(checksum === (entropy[entropy.length - 1] & checksumMask), "invalid mnemonic checksum", "mnemonic", "[ REDACTED ]"); - return hexlify(entropy.slice(0, entropyBits / 8)); - } - function entropyToMnemonic(entropy, wordlist) { - assertArgument((entropy.length % 4) === 0 && entropy.length >= 16 && entropy.length <= 32, "invalid entropy size", "entropy", "[ REDACTED ]"); - if (wordlist == null) { - wordlist = LangEn.wordlist(); - } - const indices = [0]; - let remainingBits = 11; - for (let i = 0; i < entropy.length; i++) { - // Consume the whole byte (with still more to go) - if (remainingBits > 8) { - indices[indices.length - 1] <<= 8; - indices[indices.length - 1] |= entropy[i]; - remainingBits -= 8; - // This byte will complete an 11-bit index - } - else { - indices[indices.length - 1] <<= remainingBits; - indices[indices.length - 1] |= entropy[i] >> (8 - remainingBits); - // Start the next word - indices.push(entropy[i] & getLowerMask(8 - remainingBits)); - remainingBits += 3; - } - } - // Compute the checksum bits - const checksumBits = entropy.length / 4; - const checksum = parseInt(sha256(entropy).substring(2, 4), 16) & getUpperMask(checksumBits); - // Shift the checksum into the word indices - indices[indices.length - 1] <<= checksumBits; - indices[indices.length - 1] |= (checksum >> (8 - checksumBits)); - return wordlist.join(indices.map((index) => wordlist.getWord(index))); - } - const _guard$1 = {}; - /** - * A **Mnemonic** wraps all properties required to compute [[link-bip-39]] - * seeds and convert between phrases and entropy. - */ - class Mnemonic { - /** - * The mnemonic phrase of 12, 15, 18, 21 or 24 words. - * - * Use the [[wordlist]] ``split`` method to get the individual words. - */ - phrase; - /** - * The password used for this mnemonic. If no password is used this - * is the empty string (i.e. ``""``) as per the specification. - */ - password; - /** - * The wordlist for this mnemonic. - */ - wordlist; - /** - * The underlying entropy which the mnemonic encodes. - */ - entropy; - /** - * @private - */ - constructor(guard, entropy, phrase, password, wordlist) { - if (password == null) { - password = ""; - } - if (wordlist == null) { - wordlist = LangEn.wordlist(); - } - assertPrivate(guard, _guard$1, "Mnemonic"); - defineProperties(this, { phrase, password, wordlist, entropy }); - } - /** - * Returns the seed for the mnemonic. - */ - computeSeed() { - const salt = toUtf8Bytes("mnemonic" + this.password, "NFKD"); - return pbkdf2(toUtf8Bytes(this.phrase, "NFKD"), salt, 2048, 64, "sha512"); - } - /** - * Creates a new Mnemonic for the %%phrase%%. - * - * The default %%password%% is the empty string and the default - * wordlist is the [English wordlists](LangEn). - */ - static fromPhrase(phrase, password, wordlist) { - // Normalize the case and space; throws if invalid - const entropy = mnemonicToEntropy(phrase, wordlist); - phrase = entropyToMnemonic(getBytes(entropy), wordlist); - return new Mnemonic(_guard$1, entropy, phrase, password, wordlist); - } - /** - * Create a new **Mnemonic** from the %%entropy%%. - * - * The default %%password%% is the empty string and the default - * wordlist is the [English wordlists](LangEn). - */ - static fromEntropy(_entropy, password, wordlist) { - const entropy = getBytes(_entropy, "entropy"); - const phrase = entropyToMnemonic(entropy, wordlist); - return new Mnemonic(_guard$1, hexlify(entropy), phrase, password, wordlist); - } - /** - * Returns the phrase for %%mnemonic%%. - */ - static entropyToPhrase(_entropy, wordlist) { - const entropy = getBytes(_entropy, "entropy"); - return entropyToMnemonic(entropy, wordlist); - } - /** - * Returns the entropy for %%phrase%%. - */ - static phraseToEntropy(phrase, wordlist) { - return mnemonicToEntropy(phrase, wordlist); - } - /** - * Returns true if %%phrase%% is a valid [[link-bip-39]] phrase. - * - * This checks all the provided words belong to the %%wordlist%%, - * that the length is valid and the checksum is correct. - */ - static isValidMnemonic(phrase, wordlist) { - try { - mnemonicToEntropy(phrase, wordlist); - return true; - } - catch (error) { } - return false; - } - } - - /*! MIT License. Copyright 2015-2022 Richard Moore . See LICENSE.txt. */ - var __classPrivateFieldGet$2 = (__$G && __$G.__classPrivateFieldGet) || function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - var __classPrivateFieldSet$2 = (__$G && __$G.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - var _AES_key, _AES_Kd, _AES_Ke; - // Number of rounds by keysize - const numberOfRounds = { 16: 10, 24: 12, 32: 14 }; - // Round constant words - const rcon = [0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91]; - // S-box and Inverse S-box (S is for Substitution) - const S = [0x63, 0x7c, 0x77, 0x7b,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 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d]; - // Transformations for encryption - const T1 = [0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d, 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554, 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d, 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a, 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87, 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b, 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea, 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b, 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a, 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f, 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108, 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f, 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e, 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5, 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d, 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f, 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e, 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb, 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce, 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497, 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c, 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed, 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b, 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a, 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16, 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594, 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81, 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3, 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a, 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504, 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163, 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d, 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f, 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739, 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47, 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395, 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f, 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883, 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c, 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76, 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e, 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4, 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6, 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b, 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7, 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0, 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25, 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818, 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72, 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651, 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21, 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85, 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa, 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12, 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0, 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9, 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133, 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7, 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920, 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a, 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17, 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8, 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11, 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a]; - const T2 = [0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b, 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5, 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b, 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676, 0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d, 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0, 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf, 0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0, 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626, 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc, 0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1, 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515, 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3, 0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a, 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2, 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575, 0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a, 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0, 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3, 0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484, 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded, 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b, 0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939, 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf, 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb, 0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585, 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f, 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8, 0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f, 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5, 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121, 0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2, 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec, 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717, 0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d, 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373, 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc, 0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888, 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414, 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb, 0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a, 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c, 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262, 0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979, 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d, 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9, 0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea, 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808, 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e, 0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6, 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f, 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a, 0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666, 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e, 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9, 0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e, 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111, 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494, 0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9, 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf, 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d, 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868, 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f, 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616]; - const T3 = [0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b, 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5, 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b, 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76, 0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d, 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0, 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af, 0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0, 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26, 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc, 0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1, 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15, 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3, 0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a, 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2, 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75, 0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a, 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0, 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3, 0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384, 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed, 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b, 0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239, 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf, 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb, 0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185, 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f, 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8, 0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f, 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5, 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221, 0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2, 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec, 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17, 0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d, 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673, 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc, 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88, 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814, 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb, 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a, 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c, 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462, 0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279, 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d, 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9, 0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea, 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008, 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e, 0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6, 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f, 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a, 0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66, 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e, 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9, 0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e, 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211, 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394, 0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9, 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df, 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d, 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068, 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f, 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16]; - const T4 = [0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6, 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491, 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56, 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec, 0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa, 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb, 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45, 0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b, 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c, 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83, 0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9, 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a, 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d, 0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f, 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf, 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea, 0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34, 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b, 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d, 0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713, 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1, 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6, 0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72, 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85, 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed, 0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411, 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe, 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b, 0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05, 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1, 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342, 0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf, 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3, 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e, 0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a, 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6, 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3, 0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b, 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28, 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad, 0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14, 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8, 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4, 0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2, 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da, 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049, 0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf, 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810, 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c, 0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197, 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e, 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f, 0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc, 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c, 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069, 0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927, 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322, 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733, 0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9, 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5, 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a, 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0, 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e, 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c]; - // Transformations for decryption - const T5 = [0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96, 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393, 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25, 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f, 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1, 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6, 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da, 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844, 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd, 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4, 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45, 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94, 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7, 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a, 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5, 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c, 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1, 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a, 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75, 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051, 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46, 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff, 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77, 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb, 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000, 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e, 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927, 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a, 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e, 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16, 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d, 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8, 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd, 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34, 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163, 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120, 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d, 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0, 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422, 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef, 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36, 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4, 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662, 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5, 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3, 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b, 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8, 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6, 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6, 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0, 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815, 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f, 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df, 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f, 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e, 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713, 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89, 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c, 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf, 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86, 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f, 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541, 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190, 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742]; - const T6 = [0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e, 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303, 0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c, 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3, 0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0, 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9, 0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259, 0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8, 0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971, 0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a, 0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f, 0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b, 0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8, 0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab, 0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708, 0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682, 0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2, 0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe, 0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb, 0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10, 0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd, 0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015, 0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e, 0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee, 0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000, 0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72, 0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39, 0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e, 0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91, 0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a, 0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17, 0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9, 0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60, 0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e, 0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1, 0xcad731dc, 0x10426385, 0x40139722, 0x2084c611, 0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1, 0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3, 0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964, 0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390, 0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b, 0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf, 0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46, 0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af, 0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512, 0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb, 0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a, 0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8, 0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c, 0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266, 0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8, 0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6, 0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604, 0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551, 0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41, 0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647, 0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c, 0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1, 0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737, 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db, 0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340, 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95, 0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1, 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857]; - const T7 = [0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27, 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3, 0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502, 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562, 0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe, 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3, 0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552, 0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9, 0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9, 0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce, 0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253, 0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908, 0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b, 0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655, 0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337, 0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16, 0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69, 0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6, 0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6, 0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e, 0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6, 0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050, 0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9, 0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8, 0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000, 0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a, 0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d, 0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436, 0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b, 0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12, 0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b, 0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e, 0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f, 0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb, 0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4, 0xdccad731, 0x85104263, 0x22401397, 0x112084c6, 0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729, 0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1, 0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9, 0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233, 0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4, 0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad, 0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e, 0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3, 0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25, 0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b, 0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f, 0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15, 0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0, 0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2, 0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7, 0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791, 0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496, 0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665, 0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b, 0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6, 0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13, 0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47, 0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7, 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844, 0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3, 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d, 0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456, 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8]; - const T8 = [0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a, 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b, 0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5, 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5, 0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d, 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b, 0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95, 0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e, 0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27, 0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d, 0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562, 0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9, 0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752, 0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66, 0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3, 0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced, 0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e, 0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4, 0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4, 0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd, 0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d, 0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60, 0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767, 0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79, 0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000, 0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c, 0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736, 0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24, 0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b, 0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c, 0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12, 0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814, 0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3, 0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b, 0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8, 0x31dccad7, 0x63851042, 0x97224013, 0xc6112084, 0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7, 0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077, 0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247, 0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22, 0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698, 0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f, 0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254, 0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582, 0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf, 0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb, 0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883, 0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef, 0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629, 0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035, 0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533, 0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17, 0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4, 0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46, 0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb, 0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d, 0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb, 0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a, 0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73, 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678, 0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2, 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff, 0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064, 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0]; - // Transformations for decryption key expansion - const U1 = [0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3]; - const U2 = [0x00000000, 0x0b0e090d, 0x161c121a, 0x1d121b17, 0x2c382434, 0x27362d39, 0x3a24362e, 0x312a3f23, 0x58704868, 0x537e4165, 0x4e6c5a72, 0x4562537f, 0x74486c5c, 0x7f466551, 0x62547e46, 0x695a774b, 0xb0e090d0, 0xbbee99dd, 0xa6fc82ca, 0xadf28bc7, 0x9cd8b4e4, 0x97d6bde9, 0x8ac4a6fe, 0x81caaff3, 0xe890d8b8, 0xe39ed1b5, 0xfe8ccaa2, 0xf582c3af, 0xc4a8fc8c, 0xcfa6f581, 0xd2b4ee96, 0xd9bae79b, 0x7bdb3bbb, 0x70d532b6, 0x6dc729a1, 0x66c920ac, 0x57e31f8f, 0x5ced1682, 0x41ff0d95, 0x4af10498, 0x23ab73d3, 0x28a57ade, 0x35b761c9, 0x3eb968c4, 0x0f9357e7, 0x049d5eea, 0x198f45fd, 0x12814cf0, 0xcb3bab6b, 0xc035a266, 0xdd27b971, 0xd629b07c, 0xe7038f5f, 0xec0d8652, 0xf11f9d45, 0xfa119448, 0x934be303, 0x9845ea0e, 0x8557f119, 0x8e59f814, 0xbf73c737, 0xb47dce3a, 0xa96fd52d, 0xa261dc20, 0xf6ad766d, 0xfda37f60, 0xe0b16477, 0xebbf6d7a, 0xda955259, 0xd19b5b54, 0xcc894043, 0xc787494e, 0xaedd3e05, 0xa5d33708, 0xb8c12c1f, 0xb3cf2512, 0x82e51a31, 0x89eb133c, 0x94f9082b, 0x9ff70126, 0x464de6bd, 0x4d43efb0, 0x5051f4a7, 0x5b5ffdaa, 0x6a75c289, 0x617bcb84, 0x7c69d093, 0x7767d99e, 0x1e3daed5, 0x1533a7d8, 0x0821bccf, 0x032fb5c2, 0x32058ae1, 0x390b83ec, 0x241998fb, 0x2f1791f6, 0x8d764dd6, 0x867844db, 0x9b6a5fcc, 0x906456c1, 0xa14e69e2, 0xaa4060ef, 0xb7527bf8, 0xbc5c72f5, 0xd50605be, 0xde080cb3, 0xc31a17a4, 0xc8141ea9, 0xf93e218a, 0xf2302887, 0xef223390, 0xe42c3a9d, 0x3d96dd06, 0x3698d40b, 0x2b8acf1c, 0x2084c611, 0x11aef932, 0x1aa0f03f, 0x07b2eb28, 0x0cbce225, 0x65e6956e, 0x6ee89c63, 0x73fa8774, 0x78f48e79, 0x49deb15a, 0x42d0b857, 0x5fc2a340, 0x54ccaa4d, 0xf741ecda, 0xfc4fe5d7, 0xe15dfec0, 0xea53f7cd, 0xdb79c8ee, 0xd077c1e3, 0xcd65daf4, 0xc66bd3f9, 0xaf31a4b2, 0xa43fadbf, 0xb92db6a8, 0xb223bfa5, 0x83098086, 0x8807898b, 0x9515929c, 0x9e1b9b91, 0x47a17c0a, 0x4caf7507, 0x51bd6e10, 0x5ab3671d, 0x6b99583e, 0x60975133, 0x7d854a24, 0x768b4329, 0x1fd13462, 0x14df3d6f, 0x09cd2678, 0x02c32f75, 0x33e91056, 0x38e7195b, 0x25f5024c, 0x2efb0b41, 0x8c9ad761, 0x8794de6c, 0x9a86c57b, 0x9188cc76, 0xa0a2f355, 0xabacfa58, 0xb6bee14f, 0xbdb0e842, 0xd4ea9f09, 0xdfe49604, 0xc2f68d13, 0xc9f8841e, 0xf8d2bb3d, 0xf3dcb230, 0xeecea927, 0xe5c0a02a, 0x3c7a47b1, 0x37744ebc, 0x2a6655ab, 0x21685ca6, 0x10426385, 0x1b4c6a88, 0x065e719f, 0x0d507892, 0x640a0fd9, 0x6f0406d4, 0x72161dc3, 0x791814ce, 0x48322bed, 0x433c22e0, 0x5e2e39f7, 0x552030fa, 0x01ec9ab7, 0x0ae293ba, 0x17f088ad, 0x1cfe81a0, 0x2dd4be83, 0x26dab78e, 0x3bc8ac99, 0x30c6a594, 0x599cd2df, 0x5292dbd2, 0x4f80c0c5, 0x448ec9c8, 0x75a4f6eb, 0x7eaaffe6, 0x63b8e4f1, 0x68b6edfc, 0xb10c0a67, 0xba02036a, 0xa710187d, 0xac1e1170, 0x9d342e53, 0x963a275e, 0x8b283c49, 0x80263544, 0xe97c420f, 0xe2724b02, 0xff605015, 0xf46e5918, 0xc544663b, 0xce4a6f36, 0xd3587421, 0xd8567d2c, 0x7a37a10c, 0x7139a801, 0x6c2bb316, 0x6725ba1b, 0x560f8538, 0x5d018c35, 0x40139722, 0x4b1d9e2f, 0x2247e964, 0x2949e069, 0x345bfb7e, 0x3f55f273, 0x0e7fcd50, 0x0571c45d, 0x1863df4a, 0x136dd647, 0xcad731dc, 0xc1d938d1, 0xdccb23c6, 0xd7c52acb, 0xe6ef15e8, 0xede11ce5, 0xf0f307f2, 0xfbfd0eff, 0x92a779b4, 0x99a970b9, 0x84bb6bae, 0x8fb562a3, 0xbe9f5d80, 0xb591548d, 0xa8834f9a, 0xa38d4697]; - const U3 = [0x00000000, 0x0d0b0e09, 0x1a161c12, 0x171d121b, 0x342c3824, 0x3927362d, 0x2e3a2436, 0x23312a3f, 0x68587048, 0x65537e41, 0x724e6c5a, 0x7f456253, 0x5c74486c, 0x517f4665, 0x4662547e, 0x4b695a77, 0xd0b0e090, 0xddbbee99, 0xcaa6fc82, 0xc7adf28b, 0xe49cd8b4, 0xe997d6bd, 0xfe8ac4a6, 0xf381caaf, 0xb8e890d8, 0xb5e39ed1, 0xa2fe8cca, 0xaff582c3, 0x8cc4a8fc, 0x81cfa6f5, 0x96d2b4ee, 0x9bd9bae7, 0xbb7bdb3b, 0xb670d532, 0xa16dc729, 0xac66c920, 0x8f57e31f, 0x825ced16, 0x9541ff0d, 0x984af104, 0xd323ab73, 0xde28a57a, 0xc935b761, 0xc43eb968, 0xe70f9357, 0xea049d5e, 0xfd198f45, 0xf012814c, 0x6bcb3bab, 0x66c035a2, 0x71dd27b9, 0x7cd629b0, 0x5fe7038f, 0x52ec0d86, 0x45f11f9d, 0x48fa1194, 0x03934be3, 0x0e9845ea, 0x198557f1, 0x148e59f8, 0x37bf73c7, 0x3ab47dce, 0x2da96fd5, 0x20a261dc, 0x6df6ad76, 0x60fda37f, 0x77e0b164, 0x7aebbf6d, 0x59da9552, 0x54d19b5b, 0x43cc8940, 0x4ec78749, 0x05aedd3e, 0x08a5d337, 0x1fb8c12c, 0x12b3cf25, 0x3182e51a, 0x3c89eb13, 0x2b94f908, 0x269ff701, 0xbd464de6, 0xb04d43ef, 0xa75051f4, 0xaa5b5ffd, 0x896a75c2, 0x84617bcb, 0x937c69d0, 0x9e7767d9, 0xd51e3dae, 0xd81533a7, 0xcf0821bc, 0xc2032fb5, 0xe132058a, 0xec390b83, 0xfb241998, 0xf62f1791, 0xd68d764d, 0xdb867844, 0xcc9b6a5f, 0xc1906456, 0xe2a14e69, 0xefaa4060, 0xf8b7527b, 0xf5bc5c72, 0xbed50605, 0xb3de080c, 0xa4c31a17, 0xa9c8141e, 0x8af93e21, 0x87f23028, 0x90ef2233, 0x9de42c3a, 0x063d96dd, 0x0b3698d4, 0x1c2b8acf, 0x112084c6, 0x3211aef9, 0x3f1aa0f0, 0x2807b2eb, 0x250cbce2, 0x6e65e695, 0x636ee89c, 0x7473fa87, 0x7978f48e, 0x5a49deb1, 0x5742d0b8, 0x405fc2a3, 0x4d54ccaa, 0xdaf741ec, 0xd7fc4fe5, 0xc0e15dfe, 0xcdea53f7, 0xeedb79c8, 0xe3d077c1, 0xf4cd65da, 0xf9c66bd3, 0xb2af31a4, 0xbfa43fad, 0xa8b92db6, 0xa5b223bf, 0x86830980, 0x8b880789, 0x9c951592, 0x919e1b9b, 0x0a47a17c, 0x074caf75, 0x1051bd6e, 0x1d5ab367, 0x3e6b9958, 0x33609751, 0x247d854a, 0x29768b43, 0x621fd134, 0x6f14df3d, 0x7809cd26, 0x7502c32f, 0x5633e910, 0x5b38e719, 0x4c25f502, 0x412efb0b, 0x618c9ad7, 0x6c8794de, 0x7b9a86c5, 0x769188cc, 0x55a0a2f3, 0x58abacfa, 0x4fb6bee1, 0x42bdb0e8, 0x09d4ea9f, 0x04dfe496, 0x13c2f68d, 0x1ec9f884, 0x3df8d2bb, 0x30f3dcb2, 0x27eecea9, 0x2ae5c0a0, 0xb13c7a47, 0xbc37744e, 0xab2a6655, 0xa621685c, 0x85104263, 0x881b4c6a, 0x9f065e71, 0x920d5078, 0xd9640a0f, 0xd46f0406, 0xc372161d, 0xce791814, 0xed48322b, 0xe0433c22, 0xf75e2e39, 0xfa552030, 0xb701ec9a, 0xba0ae293, 0xad17f088, 0xa01cfe81, 0x832dd4be, 0x8e26dab7, 0x993bc8ac, 0x9430c6a5, 0xdf599cd2, 0xd25292db, 0xc54f80c0, 0xc8448ec9, 0xeb75a4f6, 0xe67eaaff, 0xf163b8e4, 0xfc68b6ed, 0x67b10c0a, 0x6aba0203, 0x7da71018, 0x70ac1e11, 0x539d342e, 0x5e963a27, 0x498b283c, 0x44802635, 0x0fe97c42, 0x02e2724b, 0x15ff6050, 0x18f46e59, 0x3bc54466, 0x36ce4a6f, 0x21d35874, 0x2cd8567d, 0x0c7a37a1, 0x017139a8, 0x166c2bb3, 0x1b6725ba, 0x38560f85, 0x355d018c, 0x22401397, 0x2f4b1d9e, 0x642247e9, 0x692949e0, 0x7e345bfb, 0x733f55f2, 0x500e7fcd, 0x5d0571c4, 0x4a1863df, 0x47136dd6, 0xdccad731, 0xd1c1d938, 0xc6dccb23, 0xcbd7c52a, 0xe8e6ef15, 0xe5ede11c, 0xf2f0f307, 0xfffbfd0e, 0xb492a779, 0xb999a970, 0xae84bb6b, 0xa38fb562, 0x80be9f5d, 0x8db59154, 0x9aa8834f, 0x97a38d46]; - const U4 = [0x00000000, 0x090d0b0e, 0x121a161c, 0x1b171d12, 0x24342c38, 0x2d392736, 0x362e3a24, 0x3f23312a, 0x48685870, 0x4165537e, 0x5a724e6c, 0x537f4562, 0x6c5c7448, 0x65517f46, 0x7e466254, 0x774b695a, 0x90d0b0e0, 0x99ddbbee, 0x82caa6fc, 0x8bc7adf2, 0xb4e49cd8, 0xbde997d6, 0xa6fe8ac4, 0xaff381ca, 0xd8b8e890, 0xd1b5e39e, 0xcaa2fe8c, 0xc3aff582, 0xfc8cc4a8, 0xf581cfa6, 0xee96d2b4, 0xe79bd9ba, 0x3bbb7bdb, 0x32b670d5, 0x29a16dc7, 0x20ac66c9, 0x1f8f57e3, 0x16825ced, 0x0d9541ff, 0x04984af1, 0x73d323ab, 0x7ade28a5, 0x61c935b7, 0x68c43eb9, 0x57e70f93, 0x5eea049d, 0x45fd198f, 0x4cf01281, 0xab6bcb3b, 0xa266c035, 0xb971dd27, 0xb07cd629, 0x8f5fe703, 0x8652ec0d, 0x9d45f11f, 0x9448fa11, 0xe303934b, 0xea0e9845, 0xf1198557, 0xf8148e59, 0xc737bf73, 0xce3ab47d, 0xd52da96f, 0xdc20a261, 0x766df6ad, 0x7f60fda3, 0x6477e0b1, 0x6d7aebbf, 0x5259da95, 0x5b54d19b, 0x4043cc89, 0x494ec787, 0x3e05aedd, 0x3708a5d3, 0x2c1fb8c1, 0x2512b3cf, 0x1a3182e5, 0x133c89eb, 0x082b94f9, 0x01269ff7, 0xe6bd464d, 0xefb04d43, 0xf4a75051, 0xfdaa5b5f, 0xc2896a75, 0xcb84617b, 0xd0937c69, 0xd99e7767, 0xaed51e3d, 0xa7d81533, 0xbccf0821, 0xb5c2032f, 0x8ae13205, 0x83ec390b, 0x98fb2419, 0x91f62f17, 0x4dd68d76, 0x44db8678, 0x5fcc9b6a, 0x56c19064, 0x69e2a14e, 0x60efaa40, 0x7bf8b752, 0x72f5bc5c, 0x05bed506, 0x0cb3de08, 0x17a4c31a, 0x1ea9c814, 0x218af93e, 0x2887f230, 0x3390ef22, 0x3a9de42c, 0xdd063d96, 0xd40b3698, 0xcf1c2b8a, 0xc6112084, 0xf93211ae, 0xf03f1aa0, 0xeb2807b2, 0xe2250cbc, 0x956e65e6, 0x9c636ee8, 0x877473fa, 0x8e7978f4, 0xb15a49de, 0xb85742d0, 0xa3405fc2, 0xaa4d54cc, 0xecdaf741, 0xe5d7fc4f, 0xfec0e15d, 0xf7cdea53, 0xc8eedb79, 0xc1e3d077, 0xdaf4cd65, 0xd3f9c66b, 0xa4b2af31, 0xadbfa43f, 0xb6a8b92d, 0xbfa5b223, 0x80868309, 0x898b8807, 0x929c9515, 0x9b919e1b, 0x7c0a47a1, 0x75074caf, 0x6e1051bd, 0x671d5ab3, 0x583e6b99, 0x51336097, 0x4a247d85, 0x4329768b, 0x34621fd1, 0x3d6f14df, 0x267809cd, 0x2f7502c3, 0x105633e9, 0x195b38e7, 0x024c25f5, 0x0b412efb, 0xd7618c9a, 0xde6c8794, 0xc57b9a86, 0xcc769188, 0xf355a0a2, 0xfa58abac, 0xe14fb6be, 0xe842bdb0, 0x9f09d4ea, 0x9604dfe4, 0x8d13c2f6, 0x841ec9f8, 0xbb3df8d2, 0xb230f3dc, 0xa927eece, 0xa02ae5c0, 0x47b13c7a, 0x4ebc3774, 0x55ab2a66, 0x5ca62168, 0x63851042, 0x6a881b4c, 0x719f065e, 0x78920d50, 0x0fd9640a, 0x06d46f04, 0x1dc37216, 0x14ce7918, 0x2bed4832, 0x22e0433c, 0x39f75e2e, 0x30fa5520, 0x9ab701ec, 0x93ba0ae2, 0x88ad17f0, 0x81a01cfe, 0xbe832dd4, 0xb78e26da, 0xac993bc8, 0xa59430c6, 0xd2df599c, 0xdbd25292, 0xc0c54f80, 0xc9c8448e, 0xf6eb75a4, 0xffe67eaa, 0xe4f163b8, 0xedfc68b6, 0x0a67b10c, 0x036aba02, 0x187da710, 0x1170ac1e, 0x2e539d34, 0x275e963a, 0x3c498b28, 0x35448026, 0x420fe97c, 0x4b02e272, 0x5015ff60, 0x5918f46e, 0x663bc544, 0x6f36ce4a, 0x7421d358, 0x7d2cd856, 0xa10c7a37, 0xa8017139, 0xb3166c2b, 0xba1b6725, 0x8538560f, 0x8c355d01, 0x97224013, 0x9e2f4b1d, 0xe9642247, 0xe0692949, 0xfb7e345b, 0xf2733f55, 0xcd500e7f, 0xc45d0571, 0xdf4a1863, 0xd647136d, 0x31dccad7, 0x38d1c1d9, 0x23c6dccb, 0x2acbd7c5, 0x15e8e6ef, 0x1ce5ede1, 0x07f2f0f3, 0x0efffbfd, 0x79b492a7, 0x70b999a9, 0x6bae84bb, 0x62a38fb5, 0x5d80be9f, 0x548db591, 0x4f9aa883, 0x4697a38d]; - function convertToInt32(bytes) { - const result = []; - for (let i = 0; i < bytes.length; i += 4) { - result.push((bytes[i] << 24) | (bytes[i + 1] << 16) | (bytes[i + 2] << 8) | bytes[i + 3]); - } - return result; - } - class AES { - get key() { return __classPrivateFieldGet$2(this, _AES_key, "f").slice(); } - constructor(key) { - _AES_key.set(this, void 0); - _AES_Kd.set(this, void 0); - _AES_Ke.set(this, void 0); - if (!(this instanceof AES)) { - throw Error('AES must be instanitated with `new`'); - } - __classPrivateFieldSet$2(this, _AES_key, new Uint8Array(key), "f"); - const rounds = numberOfRounds[this.key.length]; - if (rounds == null) { - throw new TypeError('invalid key size (must be 16, 24 or 32 bytes)'); - } - // encryption round keys - __classPrivateFieldSet$2(this, _AES_Ke, [], "f"); - // decryption round keys - __classPrivateFieldSet$2(this, _AES_Kd, [], "f"); - for (let i = 0; i <= rounds; i++) { - __classPrivateFieldGet$2(this, _AES_Ke, "f").push([0, 0, 0, 0]); - __classPrivateFieldGet$2(this, _AES_Kd, "f").push([0, 0, 0, 0]); - } - const roundKeyCount = (rounds + 1) * 4; - const KC = this.key.length / 4; - // convert the key into ints - const tk = convertToInt32(this.key); - // copy values into round key arrays - let index; - for (let i = 0; i < KC; i++) { - index = i >> 2; - __classPrivateFieldGet$2(this, _AES_Ke, "f")[index][i % 4] = tk[i]; - __classPrivateFieldGet$2(this, _AES_Kd, "f")[rounds - index][i % 4] = tk[i]; - } - // key expansion (fips-197 section 5.2) - let rconpointer = 0; - let t = KC, tt; - while (t < roundKeyCount) { - tt = tk[KC - 1]; - tk[0] ^= ((S[(tt >> 16) & 0xFF] << 24) ^ - (S[(tt >> 8) & 0xFF] << 16) ^ - (S[tt & 0xFF] << 8) ^ - S[(tt >> 24) & 0xFF] ^ - (rcon[rconpointer] << 24)); - rconpointer += 1; - // key expansion (for non-256 bit) - if (KC != 8) { - for (let i = 1; i < KC; i++) { - tk[i] ^= tk[i - 1]; - } - // key expansion for 256-bit keys is "slightly different" (fips-197) - } - else { - for (let i = 1; i < (KC / 2); i++) { - tk[i] ^= tk[i - 1]; - } - tt = tk[(KC / 2) - 1]; - tk[KC / 2] ^= (S[tt & 0xFF] ^ - (S[(tt >> 8) & 0xFF] << 8) ^ - (S[(tt >> 16) & 0xFF] << 16) ^ - (S[(tt >> 24) & 0xFF] << 24)); - for (let i = (KC / 2) + 1; i < KC; i++) { - tk[i] ^= tk[i - 1]; - } - } - // copy values into round key arrays - let i = 0, r, c; - while (i < KC && t < roundKeyCount) { - r = t >> 2; - c = t % 4; - __classPrivateFieldGet$2(this, _AES_Ke, "f")[r][c] = tk[i]; - __classPrivateFieldGet$2(this, _AES_Kd, "f")[rounds - r][c] = tk[i++]; - t++; - } - } - // inverse-cipher-ify the decryption round key (fips-197 section 5.3) - for (let r = 1; r < rounds; r++) { - for (let c = 0; c < 4; c++) { - tt = __classPrivateFieldGet$2(this, _AES_Kd, "f")[r][c]; - __classPrivateFieldGet$2(this, _AES_Kd, "f")[r][c] = (U1[(tt >> 24) & 0xFF] ^ - U2[(tt >> 16) & 0xFF] ^ - U3[(tt >> 8) & 0xFF] ^ - U4[tt & 0xFF]); - } - } - } - encrypt(plaintext) { - if (plaintext.length != 16) { - throw new TypeError('invalid plaintext size (must be 16 bytes)'); - } - const rounds = __classPrivateFieldGet$2(this, _AES_Ke, "f").length - 1; - const a = [0, 0, 0, 0]; - // convert plaintext to (ints ^ key) - let t = convertToInt32(plaintext); - for (let i = 0; i < 4; i++) { - t[i] ^= __classPrivateFieldGet$2(this, _AES_Ke, "f")[0][i]; - } - // apply round transforms - for (let r = 1; r < rounds; r++) { - for (let i = 0; i < 4; i++) { - a[i] = (T1[(t[i] >> 24) & 0xff] ^ - T2[(t[(i + 1) % 4] >> 16) & 0xff] ^ - T3[(t[(i + 2) % 4] >> 8) & 0xff] ^ - T4[t[(i + 3) % 4] & 0xff] ^ - __classPrivateFieldGet$2(this, _AES_Ke, "f")[r][i]); - } - t = a.slice(); - } - // the last round is special - const result = new Uint8Array(16); - let tt = 0; - for (let i = 0; i < 4; i++) { - tt = __classPrivateFieldGet$2(this, _AES_Ke, "f")[rounds][i]; - result[4 * i] = (S[(t[i] >> 24) & 0xff] ^ (tt >> 24)) & 0xff; - result[4 * i + 1] = (S[(t[(i + 1) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff; - result[4 * i + 2] = (S[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff; - result[4 * i + 3] = (S[t[(i + 3) % 4] & 0xff] ^ tt) & 0xff; - } - return result; - } - decrypt(ciphertext) { - if (ciphertext.length != 16) { - throw new TypeError('invalid ciphertext size (must be 16 bytes)'); - } - const rounds = __classPrivateFieldGet$2(this, _AES_Kd, "f").length - 1; - const a = [0, 0, 0, 0]; - // convert plaintext to (ints ^ key) - let t = convertToInt32(ciphertext); - for (let i = 0; i < 4; i++) { - t[i] ^= __classPrivateFieldGet$2(this, _AES_Kd, "f")[0][i]; - } - // apply round transforms - for (let r = 1; r < rounds; r++) { - for (let i = 0; i < 4; i++) { - a[i] = (T5[(t[i] >> 24) & 0xff] ^ - T6[(t[(i + 3) % 4] >> 16) & 0xff] ^ - T7[(t[(i + 2) % 4] >> 8) & 0xff] ^ - T8[t[(i + 1) % 4] & 0xff] ^ - __classPrivateFieldGet$2(this, _AES_Kd, "f")[r][i]); - } - t = a.slice(); - } - // the last round is special - const result = new Uint8Array(16); - let tt = 0; - for (let i = 0; i < 4; i++) { - tt = __classPrivateFieldGet$2(this, _AES_Kd, "f")[rounds][i]; - result[4 * i] = (Si[(t[i] >> 24) & 0xff] ^ (tt >> 24)) & 0xff; - result[4 * i + 1] = (Si[(t[(i + 3) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff; - result[4 * i + 2] = (Si[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff; - result[4 * i + 3] = (Si[t[(i + 1) % 4] & 0xff] ^ tt) & 0xff; - } - return result; - } - } - _AES_key = new WeakMap(), _AES_Kd = new WeakMap(), _AES_Ke = new WeakMap(); - - class ModeOfOperation { - constructor(name, key, cls) { - if (cls && !(this instanceof cls)) { - throw new Error(`${name} must be instantiated with "new"`); - } - Object.defineProperties(this, { - aes: { enumerable: true, value: new AES(key) }, - name: { enumerable: true, value: name } - }); - } - } - - // Cipher Block Chaining - var __classPrivateFieldSet$1 = (__$G && __$G.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - var __classPrivateFieldGet$1 = (__$G && __$G.__classPrivateFieldGet) || function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - var _CBC_iv, _CBC_lastBlock; - class CBC extends ModeOfOperation { - constructor(key, iv) { - super("ECC", key, CBC); - _CBC_iv.set(this, void 0); - _CBC_lastBlock.set(this, void 0); - if (iv) { - if (iv.length % 16) { - throw new TypeError("invalid iv size (must be 16 bytes)"); - } - __classPrivateFieldSet$1(this, _CBC_iv, new Uint8Array(iv), "f"); - } - else { - __classPrivateFieldSet$1(this, _CBC_iv, new Uint8Array(16), "f"); - } - __classPrivateFieldSet$1(this, _CBC_lastBlock, this.iv, "f"); - } - get iv() { return new Uint8Array(__classPrivateFieldGet$1(this, _CBC_iv, "f")); } - encrypt(plaintext) { - if (plaintext.length % 16) { - throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)"); - } - const ciphertext = new Uint8Array(plaintext.length); - for (let i = 0; i < plaintext.length; i += 16) { - for (let j = 0; j < 16; j++) { - __classPrivateFieldGet$1(this, _CBC_lastBlock, "f")[j] ^= plaintext[i + j]; - } - __classPrivateFieldSet$1(this, _CBC_lastBlock, this.aes.encrypt(__classPrivateFieldGet$1(this, _CBC_lastBlock, "f")), "f"); - ciphertext.set(__classPrivateFieldGet$1(this, _CBC_lastBlock, "f"), i); - } - return ciphertext; - } - decrypt(ciphertext) { - if (ciphertext.length % 16) { - throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)"); - } - const plaintext = new Uint8Array(ciphertext.length); - for (let i = 0; i < ciphertext.length; i += 16) { - const block = this.aes.decrypt(ciphertext.subarray(i, i + 16)); - for (let j = 0; j < 16; j++) { - plaintext[i + j] = block[j] ^ __classPrivateFieldGet$1(this, _CBC_lastBlock, "f")[j]; - __classPrivateFieldGet$1(this, _CBC_lastBlock, "f")[j] = ciphertext[i + j]; - } - } - return plaintext; - } - } - _CBC_iv = new WeakMap(), _CBC_lastBlock = new WeakMap(); - - // Counter Mode - var __classPrivateFieldSet = (__$G && __$G.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - var __classPrivateFieldGet = (__$G && __$G.__classPrivateFieldGet) || function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - var _CTR_remaining, _CTR_remainingIndex, _CTR_counter; - class CTR extends ModeOfOperation { - constructor(key, initialValue) { - super("CTR", key, CTR); - // Remaining bytes for the one-time pad - _CTR_remaining.set(this, void 0); - _CTR_remainingIndex.set(this, void 0); - // The current counter - _CTR_counter.set(this, void 0); - __classPrivateFieldSet(this, _CTR_counter, new Uint8Array(16), "f"); - __classPrivateFieldGet(this, _CTR_counter, "f").fill(0); - __classPrivateFieldSet(this, _CTR_remaining, __classPrivateFieldGet(this, _CTR_counter, "f"), "f"); // This will be discarded immediately - __classPrivateFieldSet(this, _CTR_remainingIndex, 16, "f"); - if (initialValue == null) { - initialValue = 1; - } - if (typeof (initialValue) === "number") { - this.setCounterValue(initialValue); - } - else { - this.setCounterBytes(initialValue); - } - } - get counter() { return new Uint8Array(__classPrivateFieldGet(this, _CTR_counter, "f")); } - setCounterValue(value) { - if (!Number.isInteger(value) || value < 0 || value > Number.MAX_SAFE_INTEGER) { - throw new TypeError("invalid counter initial integer value"); - } - for (let index = 15; index >= 0; --index) { - __classPrivateFieldGet(this, _CTR_counter, "f")[index] = value % 256; - value = Math.floor(value / 256); - } - } - setCounterBytes(value) { - if (value.length !== 16) { - throw new TypeError("invalid counter initial Uint8Array value length"); - } - __classPrivateFieldGet(this, _CTR_counter, "f").set(value); - } - increment() { - for (let i = 15; i >= 0; i--) { - if (__classPrivateFieldGet(this, _CTR_counter, "f")[i] === 255) { - __classPrivateFieldGet(this, _CTR_counter, "f")[i] = 0; - } - else { - __classPrivateFieldGet(this, _CTR_counter, "f")[i]++; - break; - } - } - } - encrypt(plaintext) { - var _a, _b; - const crypttext = new Uint8Array(plaintext); - for (let i = 0; i < crypttext.length; i++) { - if (__classPrivateFieldGet(this, _CTR_remainingIndex, "f") === 16) { - __classPrivateFieldSet(this, _CTR_remaining, this.aes.encrypt(__classPrivateFieldGet(this, _CTR_counter, "f")), "f"); - __classPrivateFieldSet(this, _CTR_remainingIndex, 0, "f"); - this.increment(); - } - crypttext[i] ^= __classPrivateFieldGet(this, _CTR_remaining, "f")[__classPrivateFieldSet(this, _CTR_remainingIndex, (_b = __classPrivateFieldGet(this, _CTR_remainingIndex, "f"), _a = _b++, _b), "f"), _a]; - } - return crypttext; - } - decrypt(ciphertext) { - return this.encrypt(ciphertext); - } - } - _CTR_remaining = new WeakMap(), _CTR_remainingIndex = new WeakMap(), _CTR_counter = new WeakMap(); - - function pkcs7Strip(data) { - if (data.length < 16) { - throw new TypeError('PKCS#7 invalid length'); - } - const padder = data[data.length - 1]; - if (padder > 16) { - throw new TypeError('PKCS#7 padding byte out of range'); - } - const length = data.length - padder; - for (let i = 0; i < padder; i++) { - if (data[length + i] !== padder) { - throw new TypeError('PKCS#7 invalid padding byte'); - } - } - return new Uint8Array(data.subarray(0, length)); - } - - /** - * @_ignore - */ - function looseArrayify(hexString) { - if (typeof (hexString) === "string" && !hexString.startsWith("0x")) { - hexString = "0x" + hexString; - } - return getBytesCopy(hexString); - } - function zpad$1(value, length) { - value = String(value); - while (value.length < length) { - value = '0' + value; - } - return value; - } - function getPassword(password) { - if (typeof (password) === 'string') { - return toUtf8Bytes(password, "NFKC"); - } - return getBytesCopy(password); - } - function spelunk(object, _path) { - const match = _path.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i); - assertArgument(match != null, "invalid path", "path", _path); - const path = match[1]; - const type = match[3]; - const reqd = (match[4] === "!"); - let cur = object; - for (const comp of path.toLowerCase().split('.')) { - // Search for a child object with a case-insensitive matching key - if (Array.isArray(cur)) { - if (!comp.match(/^[0-9]+$/)) { - break; - } - cur = cur[parseInt(comp)]; - } - else if (typeof (cur) === "object") { - let found = null; - for (const key in cur) { - if (key.toLowerCase() === comp) { - found = cur[key]; - break; - } - } - cur = found; - } - else { - cur = null; - } - if (cur == null) { - break; - } - } - assertArgument(!reqd || cur != null, "missing required value", "path", path); - if (type && cur != null) { - if (type === "int") { - if (typeof (cur) === "string" && cur.match(/^-?[0-9]+$/)) { - return parseInt(cur); - } - else if (Number.isSafeInteger(cur)) { - return cur; - } - } - if (type === "number") { - if (typeof (cur) === "string" && cur.match(/^-?[0-9.]*$/)) { - return parseFloat(cur); - } - } - if (type === "data") { - if (typeof (cur) === "string") { - return looseArrayify(cur); - } - } - if (type === "array" && Array.isArray(cur)) { - return cur; - } - if (type === typeof (cur)) { - return cur; - } - assertArgument(false, `wrong type found for ${type} `, "path", path); - } - return cur; - } - /* - export function follow(object: any, path: string): null | string { - let currentChild = object; - - for (const comp of path.toLowerCase().split('/')) { - - // Search for a child object with a case-insensitive matching key - let matchingChild = null; - for (const key in currentChild) { - if (key.toLowerCase() === comp) { - matchingChild = currentChild[key]; - break; - } - } - - if (matchingChild === null) { return null; } - - currentChild = matchingChild; - } - - return currentChild; - } - - // "path/to/something:type!" - export function followRequired(data: any, path: string): string { - const value = follow(data, path); - if (value != null) { return value; } - return logger.throwArgumentError("invalid value", `data:${ path }`, - JSON.stringify(data)); - } - */ - // See: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4) - /* - export function uuidV4(randomBytes: BytesLike): string { - const bytes = getBytes(randomBytes, "randomBytes"); - - // Section: 4.1.3: - // - time_hi_and_version[12:16] = 0b0100 - bytes[6] = (bytes[6] & 0x0f) | 0x40; - - // Section 4.4 - // - clock_seq_hi_and_reserved[6] = 0b0 - // - clock_seq_hi_and_reserved[7] = 0b1 - bytes[8] = (bytes[8] & 0x3f) | 0x80; - - const value = hexlify(bytes); - - return [ - value.substring(2, 10), - value.substring(10, 14), - value.substring(14, 18), - value.substring(18, 22), - value.substring(22, 34), - ].join("-"); - } - */ - - /** - * The JSON Wallet formats allow a simple way to store the private - * keys needed in Ethereum along with related information and allows - * for extensible forms of encryption. - * - * These utilities facilitate decrypting and encrypting the most common - * JSON Wallet formats. - * - * @_subsection: api/wallet:JSON Wallets [json-wallets] - */ - const defaultPath$1 = "m/44'/60'/0'/0/0"; - /** - * Returns true if %%json%% is a valid JSON Keystore Wallet. - */ - function isKeystoreJson(json) { - try { - const data = JSON.parse(json); - const version = ((data.version != null) ? parseInt(data.version) : 0); - if (version === 3) { - return true; - } - } - catch (error) { } - return false; - } - function decrypt(data, key, ciphertext) { - const cipher = spelunk(data, "crypto.cipher:string"); - if (cipher === "aes-128-ctr") { - const iv = spelunk(data, "crypto.cipherparams.iv:data!"); - const aesCtr = new CTR(key, iv); - return hexlify(aesCtr.decrypt(ciphertext)); - } - assert(false, "unsupported cipher", "UNSUPPORTED_OPERATION", { - operation: "decrypt" - }); - } - function getAccount(data, _key) { - const key = getBytes(_key); - const ciphertext = spelunk(data, "crypto.ciphertext:data!"); - const computedMAC = hexlify(keccak256(concat([key.slice(16, 32), ciphertext]))).substring(2); - assertArgument(computedMAC === spelunk(data, "crypto.mac:string!").toLowerCase(), "incorrect password", "password", "[ REDACTED ]"); - const privateKey = decrypt(data, key.slice(0, 16), ciphertext); - const address = computeAddress(privateKey); - if (data.address) { - let check = data.address.toLowerCase(); - if (!check.startsWith("0x")) { - check = "0x" + check; - } - assertArgument(getAddress(check) === address, "keystore address/privateKey mismatch", "address", data.address); - } - const account = { address, privateKey }; - // Version 0.1 x-ethers metadata must contain an encrypted mnemonic phrase - const version = spelunk(data, "x-ethers.version:string"); - if (version === "0.1") { - const mnemonicKey = key.slice(32, 64); - const mnemonicCiphertext = spelunk(data, "x-ethers.mnemonicCiphertext:data!"); - const mnemonicIv = spelunk(data, "x-ethers.mnemonicCounter:data!"); - const mnemonicAesCtr = new CTR(mnemonicKey, mnemonicIv); - account.mnemonic = { - path: (spelunk(data, "x-ethers.path:string") || defaultPath$1), - locale: (spelunk(data, "x-ethers.locale:string") || "en"), - entropy: hexlify(getBytes(mnemonicAesCtr.decrypt(mnemonicCiphertext))) - }; - } - return account; - } - function getDecryptKdfParams(data) { - const kdf = spelunk(data, "crypto.kdf:string"); - if (kdf && typeof (kdf) === "string") { - if (kdf.toLowerCase() === "scrypt") { - const salt = spelunk(data, "crypto.kdfparams.salt:data!"); - const N = spelunk(data, "crypto.kdfparams.n:int!"); - const r = spelunk(data, "crypto.kdfparams.r:int!"); - const p = spelunk(data, "crypto.kdfparams.p:int!"); - // Make sure N is a power of 2 - assertArgument(N > 0 && (N & (N - 1)) === 0, "invalid kdf.N", "kdf.N", N); - assertArgument(r > 0 && p > 0, "invalid kdf", "kdf", kdf); - const dkLen = spelunk(data, "crypto.kdfparams.dklen:int!"); - assertArgument(dkLen === 32, "invalid kdf.dklen", "kdf.dflen", dkLen); - return { name: "scrypt", salt, N, r, p, dkLen: 64 }; - } - else if (kdf.toLowerCase() === "pbkdf2") { - const salt = spelunk(data, "crypto.kdfparams.salt:data!"); - const prf = spelunk(data, "crypto.kdfparams.prf:string!"); - const algorithm = prf.split("-").pop(); - assertArgument(algorithm === "sha256" || algorithm === "sha512", "invalid kdf.pdf", "kdf.pdf", prf); - const count = spelunk(data, "crypto.kdfparams.c:int!"); - const dkLen = spelunk(data, "crypto.kdfparams.dklen:int!"); - assertArgument(dkLen === 32, "invalid kdf.dklen", "kdf.dklen", dkLen); - return { name: "pbkdf2", salt, count, dkLen, algorithm }; - } - } - assertArgument(false, "unsupported key-derivation function", "kdf", kdf); - } - /** - * Returns the account details for the JSON Keystore Wallet %%json%% - * using %%password%%. - * - * It is preferred to use the [async version](decryptKeystoreJson) - * instead, which allows a [[ProgressCallback]] to keep the user informed - * as to the decryption status. - * - * This method will block the event loop (freezing all UI) until decryption - * is complete, which can take quite some time, depending on the wallet - * paramters and platform. - */ - function decryptKeystoreJsonSync(json, _password) { - const data = JSON.parse(json); - const password = getPassword(_password); - const params = getDecryptKdfParams(data); - if (params.name === "pbkdf2") { - const { salt, count, dkLen, algorithm } = params; - const key = pbkdf2(password, salt, count, dkLen, algorithm); - return getAccount(data, key); - } - assert(params.name === "scrypt", "cannot be reached", "UNKNOWN_ERROR", { params }); - const { salt, N, r, p, dkLen } = params; - const key = scryptSync(password, salt, N, r, p, dkLen); - return getAccount(data, key); - } - function stall$1(duration) { - return new Promise((resolve) => { setTimeout(() => { resolve(); }, duration); }); - } - /** - * Resolves to the decrypted JSON Keystore Wallet %%json%% using the - * %%password%%. - * - * If provided, %%progress%% will be called periodically during the - * decrpytion to provide feedback, and if the function returns - * ``false`` will halt decryption. - * - * The %%progressCallback%% will **always** receive ``0`` before - * decryption begins and ``1`` when complete. - */ - async function decryptKeystoreJson(json, _password, progress) { - const data = JSON.parse(json); - const password = getPassword(_password); - const params = getDecryptKdfParams(data); - if (params.name === "pbkdf2") { - if (progress) { - progress(0); - await stall$1(0); - } - const { salt, count, dkLen, algorithm } = params; - const key = pbkdf2(password, salt, count, dkLen, algorithm); - if (progress) { - progress(1); - await stall$1(0); - } - return getAccount(data, key); - } - assert(params.name === "scrypt", "cannot be reached", "UNKNOWN_ERROR", { params }); - const { salt, N, r, p, dkLen } = params; - const key = await scrypt(password, salt, N, r, p, dkLen, progress); - return getAccount(data, key); - } - function getEncryptKdfParams(options) { - // Check/generate the salt - const salt = (options.salt != null) ? getBytes(options.salt, "options.salt") : randomBytes(32); - // Override the scrypt password-based key derivation function parameters - let N = (1 << 17), r = 8, p = 1; - if (options.scrypt) { - if (options.scrypt.N) { - N = options.scrypt.N; - } - if (options.scrypt.r) { - r = options.scrypt.r; - } - if (options.scrypt.p) { - p = options.scrypt.p; - } - } - assertArgument(typeof (N) === "number" && N > 0 && Number.isSafeInteger(N) && (BigInt(N) & BigInt(N - 1)) === BigInt(0), "invalid scrypt N parameter", "options.N", N); - assertArgument(typeof (r) === "number" && r > 0 && Number.isSafeInteger(r), "invalid scrypt r parameter", "options.r", r); - assertArgument(typeof (p) === "number" && p > 0 && Number.isSafeInteger(p), "invalid scrypt p parameter", "options.p", p); - return { name: "scrypt", dkLen: 32, salt, N, r, p }; - } - function _encryptKeystore(key, kdf, account, options) { - const privateKey = getBytes(account.privateKey, "privateKey"); - // Override initialization vector - const iv = (options.iv != null) ? getBytes(options.iv, "options.iv") : randomBytes(16); - assertArgument(iv.length === 16, "invalid options.iv length", "options.iv", options.iv); - // Override the uuid - const uuidRandom = (options.uuid != null) ? getBytes(options.uuid, "options.uuid") : randomBytes(16); - assertArgument(uuidRandom.length === 16, "invalid options.uuid length", "options.uuid", options.iv); - // This will be used to encrypt the wallet (as per Web3 secret storage) - // - 32 bytes As normal for the Web3 secret storage (derivedKey, macPrefix) - // - 32 bytes AES key to encrypt mnemonic with (required here to be Ethers Wallet) - const derivedKey = key.slice(0, 16); - const macPrefix = key.slice(16, 32); - // Encrypt the private key - const aesCtr = new CTR(derivedKey, iv); - const ciphertext = getBytes(aesCtr.encrypt(privateKey)); - // Compute the message authentication code, used to check the password - const mac = keccak256(concat([macPrefix, ciphertext])); - // See: https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition - const data = { - address: account.address.substring(2).toLowerCase(), - id: uuidV4(uuidRandom), - version: 3, - Crypto: { - cipher: "aes-128-ctr", - cipherparams: { - iv: hexlify(iv).substring(2), - }, - ciphertext: hexlify(ciphertext).substring(2), - kdf: "scrypt", - kdfparams: { - salt: hexlify(kdf.salt).substring(2), - n: kdf.N, - dklen: 32, - p: kdf.p, - r: kdf.r - }, - mac: mac.substring(2) - } - }; - // If we have a mnemonic, encrypt it into the JSON wallet - if (account.mnemonic) { - const client = (options.client != null) ? options.client : `ethers/${version}`; - const path = account.mnemonic.path || defaultPath$1; - const locale = account.mnemonic.locale || "en"; - const mnemonicKey = key.slice(32, 64); - const entropy = getBytes(account.mnemonic.entropy, "account.mnemonic.entropy"); - const mnemonicIv = randomBytes(16); - const mnemonicAesCtr = new CTR(mnemonicKey, mnemonicIv); - const mnemonicCiphertext = getBytes(mnemonicAesCtr.encrypt(entropy)); - const now = new Date(); - const timestamp = (now.getUTCFullYear() + "-" + - zpad$1(now.getUTCMonth() + 1, 2) + "-" + - zpad$1(now.getUTCDate(), 2) + "T" + - zpad$1(now.getUTCHours(), 2) + "-" + - zpad$1(now.getUTCMinutes(), 2) + "-" + - zpad$1(now.getUTCSeconds(), 2) + ".0Z"); - const gethFilename = ("UTC--" + timestamp + "--" + data.address); - data["x-ethers"] = { - client, gethFilename, path, locale, - mnemonicCounter: hexlify(mnemonicIv).substring(2), - mnemonicCiphertext: hexlify(mnemonicCiphertext).substring(2), - version: "0.1" - }; - } - return JSON.stringify(data); - } - /** - * Return the JSON Keystore Wallet for %%account%% encrypted with - * %%password%%. - * - * The %%options%% can be used to tune the password-based key - * derivation function parameters, explicitly set the random values - * used. Any provided [[ProgressCallback]] is ignord. - */ - function encryptKeystoreJsonSync(account, password, options) { - if (options == null) { - options = {}; - } - const passwordBytes = getPassword(password); - const kdf = getEncryptKdfParams(options); - const key = scryptSync(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64); - return _encryptKeystore(getBytes(key), kdf, account, options); - } - /** - * Resolved to the JSON Keystore Wallet for %%account%% encrypted - * with %%password%%. - * - * The %%options%% can be used to tune the password-based key - * derivation function parameters, explicitly set the random values - * used and provide a [[ProgressCallback]] to receive periodic updates - * on the completion status.. - */ - async function encryptKeystoreJson(account, password, options) { - if (options == null) { - options = {}; - } - const passwordBytes = getPassword(password); - const kdf = getEncryptKdfParams(options); - const key = await scrypt(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64, options.progressCallback); - return _encryptKeystore(getBytes(key), kdf, account, options); - } - - /** - * Explain HD Wallets.. - * - * @_subsection: api/wallet:HD Wallets [hd-wallets] - */ - /** - * The default derivation path for Ethereum HD Nodes. (i.e. ``"m/44'/60'/0'/0/0"``) - */ - const defaultPath = "m/44'/60'/0'/0/0"; - // "Bitcoin seed" - const MasterSecret = new Uint8Array([66, 105, 116, 99, 111, 105, 110, 32, 115, 101, 101, 100]); - const HardenedBit = 0x80000000; - const N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); - const Nibbles = "0123456789abcdef"; - function zpad(value, length) { - let result = ""; - while (value) { - result = Nibbles[value % 16] + result; - value = Math.trunc(value / 16); - } - while (result.length < length * 2) { - result = "0" + result; - } - return "0x" + result; - } - function encodeBase58Check(_value) { - const value = getBytes(_value); - const check = dataSlice(sha256(sha256(value)), 0, 4); - const bytes = concat([value, check]); - return encodeBase58(bytes); - } - const _guard = {}; - function ser_I(index, chainCode, publicKey, privateKey) { - const data = new Uint8Array(37); - if (index & HardenedBit) { - assert(privateKey != null, "cannot derive child of neutered node", "UNSUPPORTED_OPERATION", { - operation: "deriveChild" - }); - // Data = 0x00 || ser_256(k_par) - data.set(getBytes(privateKey), 1); - } - else { - // Data = ser_p(point(k_par)) - data.set(getBytes(publicKey)); - } - // Data += ser_32(i) - for (let i = 24; i >= 0; i -= 8) { - data[33 + (i >> 3)] = ((index >> (24 - i)) & 0xff); - } - const I = getBytes(computeHmac("sha512", chainCode, data)); - return { IL: I.slice(0, 32), IR: I.slice(32) }; - } - function derivePath(node, path) { - const components = path.split("/"); - assertArgument(components.length > 0, "invalid path", "path", path); - if (components[0] === "m") { - assertArgument(node.depth === 0, `cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${node.depth}`, "path", path); - components.shift(); - } - let result = node; - for (let i = 0; i < components.length; i++) { - const component = components[i]; - if (component.match(/^[0-9]+'$/)) { - const index = parseInt(component.substring(0, component.length - 1)); - assertArgument(index < HardenedBit, "invalid path index", `path[${i}]`, component); - result = result.deriveChild(HardenedBit + index); - } - else if (component.match(/^[0-9]+$/)) { - const index = parseInt(component); - assertArgument(index < HardenedBit, "invalid path index", `path[${i}]`, component); - result = result.deriveChild(index); - } - else { - assertArgument(false, "invalid path component", `path[${i}]`, component); - } - } - return result; - } - /** - * An **HDNodeWallet** is a [[Signer]] backed by the private key derived - * from an HD Node using the [[link-bip-32]] stantard. - * - * An HD Node forms a hierarchal structure with each HD Node having a - * private key and the ability to derive child HD Nodes, defined by - * a path indicating the index of each child. - */ - class HDNodeWallet extends BaseWallet { - /** - * The compressed public key. - */ - publicKey; - /** - * The fingerprint. - * - * A fingerprint allows quick qay to detect parent and child nodes, - * but developers should be prepared to deal with collisions as it - * is only 4 bytes. - */ - fingerprint; - /** - * The parent fingerprint. - */ - parentFingerprint; - /** - * The mnemonic used to create this HD Node, if available. - * - * Sources such as extended keys do not encode the mnemonic, in - * which case this will be ``null``. - */ - mnemonic; - /** - * The chaincode, which is effectively a public key used - * to derive children. - */ - chainCode; - /** - * The derivation path of this wallet. - * - * Since extended keys do not provide full path details, this - * may be ``null``, if instantiated from a source that does not - * encode it. - */ - path; - /** - * The child index of this wallet. Values over ``2 *\* 31`` indicate - * the node is hardened. - */ - index; - /** - * The depth of this wallet, which is the number of components - * in its path. - */ - depth; - /** - * @private - */ - constructor(guard, signingKey, parentFingerprint, chainCode, path, index, depth, mnemonic, provider) { - super(signingKey, provider); - assertPrivate(guard, _guard, "HDNodeWallet"); - defineProperties(this, { publicKey: signingKey.compressedPublicKey }); - const fingerprint = dataSlice(ripemd160(sha256(this.publicKey)), 0, 4); - defineProperties(this, { - parentFingerprint, fingerprint, - chainCode, path, index, depth - }); - defineProperties(this, { mnemonic }); - } - connect(provider) { - return new HDNodeWallet(_guard, this.signingKey, this.parentFingerprint, this.chainCode, this.path, this.index, this.depth, this.mnemonic, provider); - } - #account() { - const account = { address: this.address, privateKey: this.privateKey }; - const m = this.mnemonic; - if (this.path && m && m.wordlist.locale === "en" && m.password === "") { - account.mnemonic = { - path: this.path, - locale: "en", - entropy: m.entropy - }; - } - return account; - } - /** - * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with - * %%password%%. - * - * If %%progressCallback%% is specified, it will receive periodic - * updates as the encryption process progreses. - */ - async encrypt(password, progressCallback) { - return await encryptKeystoreJson(this.#account(), password, { progressCallback }); - } - /** - * Returns a [JSON Keystore Wallet](json-wallets) encryped with - * %%password%%. - * - * It is preferred to use the [async version](encrypt) instead, - * which allows a [[ProgressCallback]] to keep the user informed. - * - * This method will block the event loop (freezing all UI) until - * it is complete, which may be a non-trivial duration. - */ - encryptSync(password) { - return encryptKeystoreJsonSync(this.#account(), password); - } - /** - * The extended key. - * - * This key will begin with the prefix ``xpriv`` and can be used to - * reconstruct this HD Node to derive its children. - */ - get extendedKey() { - // We only support the mainnet values for now, but if anyone needs - // testnet values, let me know. I believe current sentiment is that - // we should always use mainnet, and use BIP-44 to derive the network - // - Mainnet: public=0x0488B21E, private=0x0488ADE4 - // - Testnet: public=0x043587CF, private=0x04358394 - assert(this.depth < 256, "Depth too deep", "UNSUPPORTED_OPERATION", { operation: "extendedKey" }); - return encodeBase58Check(concat([ - "0x0488ADE4", zpad(this.depth, 1), this.parentFingerprint, - zpad(this.index, 4), this.chainCode, - concat(["0x00", this.privateKey]) - ])); - } - /** - * Returns true if this wallet has a path, providing a Type Guard - * that the path is non-null. - */ - hasPath() { return (this.path != null); } - /** - * Returns a neutered HD Node, which removes the private details - * of an HD Node. - * - * A neutered node has no private key, but can be used to derive - * child addresses and other public data about the HD Node. - */ - neuter() { - return new HDNodeVoidWallet(_guard, this.address, this.publicKey, this.parentFingerprint, this.chainCode, this.path, this.index, this.depth, this.provider); - } - /** - * Return the child for %%index%%. - */ - deriveChild(_index) { - const index = getNumber(_index, "index"); - assertArgument(index <= 0xffffffff, "invalid index", "index", index); - // Base path - let path = this.path; - if (path) { - path += "/" + (index & ~HardenedBit); - if (index & HardenedBit) { - path += "'"; - } - } - const { IR, IL } = ser_I(index, this.chainCode, this.publicKey, this.privateKey); - const ki = new SigningKey(toBeHex((toBigInt(IL) + BigInt(this.privateKey)) % N, 32)); - return new HDNodeWallet(_guard, ki, this.fingerprint, hexlify(IR), path, index, this.depth + 1, this.mnemonic, this.provider); - } - /** - * Return the HDNode for %%path%% from this node. - */ - derivePath(path) { - return derivePath(this, path); - } - static #fromSeed(_seed, mnemonic) { - assertArgument(isBytesLike(_seed), "invalid seed", "seed", "[REDACTED]"); - const seed = getBytes(_seed, "seed"); - assertArgument(seed.length >= 16 && seed.length <= 64, "invalid seed", "seed", "[REDACTED]"); - const I = getBytes(computeHmac("sha512", MasterSecret, seed)); - const signingKey = new SigningKey(hexlify(I.slice(0, 32))); - return new HDNodeWallet(_guard, signingKey, "0x00000000", hexlify(I.slice(32)), "m", 0, 0, mnemonic, null); - } - /** - * Creates a new HD Node from %%extendedKey%%. - * - * If the %%extendedKey%% will either have a prefix or ``xpub`` or - * ``xpriv``, returning a neutered HD Node ([[HDNodeVoidWallet]]) - * or full HD Node ([[HDNodeWallet) respectively. - */ - static fromExtendedKey(extendedKey) { - const bytes = toBeArray(decodeBase58(extendedKey)); // @TODO: redact - assertArgument(bytes.length === 82 || encodeBase58Check(bytes.slice(0, 78)) === extendedKey, "invalid extended key", "extendedKey", "[ REDACTED ]"); - const depth = bytes[4]; - const parentFingerprint = hexlify(bytes.slice(5, 9)); - const index = parseInt(hexlify(bytes.slice(9, 13)).substring(2), 16); - const chainCode = hexlify(bytes.slice(13, 45)); - const key = bytes.slice(45, 78); - switch (hexlify(bytes.slice(0, 4))) { - // Public Key - case "0x0488b21e": - case "0x043587cf": { - const publicKey = hexlify(key); - return new HDNodeVoidWallet(_guard, computeAddress(publicKey), publicKey, parentFingerprint, chainCode, null, index, depth, null); - } - // Private Key - case "0x0488ade4": - case "0x04358394 ": - if (key[0] !== 0) { - break; - } - return new HDNodeWallet(_guard, new SigningKey(key.slice(1)), parentFingerprint, chainCode, null, index, depth, null, null); - } - assertArgument(false, "invalid extended key prefix", "extendedKey", "[ REDACTED ]"); - } - /** - * Creates a new random HDNode. - */ - static createRandom(password, path, wordlist) { - if (password == null) { - password = ""; - } - if (path == null) { - path = defaultPath; - } - if (wordlist == null) { - wordlist = LangEn.wordlist(); - } - const mnemonic = Mnemonic.fromEntropy(randomBytes(16), password, wordlist); - return HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path); - } - /** - * Create an HD Node from %%mnemonic%%. - */ - static fromMnemonic(mnemonic, path) { - if (!path) { - path = defaultPath; - } - return HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path); - } - /** - * Creates an HD Node from a mnemonic %%phrase%%. - */ - static fromPhrase(phrase, password, path, wordlist) { - if (password == null) { - password = ""; - } - if (path == null) { - path = defaultPath; - } - if (wordlist == null) { - wordlist = LangEn.wordlist(); - } - const mnemonic = Mnemonic.fromPhrase(phrase, password, wordlist); - return HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path); - } - /** - * Creates an HD Node from a %%seed%%. - */ - static fromSeed(seed) { - return HDNodeWallet.#fromSeed(seed, null); - } - } - /** - * A **HDNodeVoidWallet** cannot sign, but provides access to - * the children nodes of a [[link-bip-32]] HD wallet addresses. - * - * The can be created by using an extended ``xpub`` key to - * [[HDNodeWallet_fromExtendedKey]] or by - * [nuetering](HDNodeWallet-neuter) a [[HDNodeWallet]]. - */ - class HDNodeVoidWallet extends VoidSigner { - /** - * The compressed public key. - */ - publicKey; - /** - * The fingerprint. - * - * A fingerprint allows quick qay to detect parent and child nodes, - * but developers should be prepared to deal with collisions as it - * is only 4 bytes. - */ - fingerprint; - /** - * The parent node fingerprint. - */ - parentFingerprint; - /** - * The chaincode, which is effectively a public key used - * to derive children. - */ - chainCode; - /** - * The derivation path of this wallet. - * - * Since extended keys do not provider full path details, this - * may be ``null``, if instantiated from a source that does not - * enocde it. - */ - path; - /** - * The child index of this wallet. Values over ``2 *\* 31`` indicate - * the node is hardened. - */ - index; - /** - * The depth of this wallet, which is the number of components - * in its path. - */ - depth; - /** - * @private - */ - constructor(guard, address, publicKey, parentFingerprint, chainCode, path, index, depth, provider) { - super(address, provider); - assertPrivate(guard, _guard, "HDNodeVoidWallet"); - defineProperties(this, { publicKey }); - const fingerprint = dataSlice(ripemd160(sha256(publicKey)), 0, 4); - defineProperties(this, { - publicKey, fingerprint, parentFingerprint, chainCode, path, index, depth - }); - } - connect(provider) { - return new HDNodeVoidWallet(_guard, this.address, this.publicKey, this.parentFingerprint, this.chainCode, this.path, this.index, this.depth, provider); - } - /** - * The extended key. - * - * This key will begin with the prefix ``xpub`` and can be used to - * reconstruct this neutered key to derive its children addresses. - */ - get extendedKey() { - // We only support the mainnet values for now, but if anyone needs - // testnet values, let me know. I believe current sentiment is that - // we should always use mainnet, and use BIP-44 to derive the network - // - Mainnet: public=0x0488B21E, private=0x0488ADE4 - // - Testnet: public=0x043587CF, private=0x04358394 - assert(this.depth < 256, "Depth too deep", "UNSUPPORTED_OPERATION", { operation: "extendedKey" }); - return encodeBase58Check(concat([ - "0x0488B21E", - zpad(this.depth, 1), - this.parentFingerprint, - zpad(this.index, 4), - this.chainCode, - this.publicKey, - ])); - } - /** - * Returns true if this wallet has a path, providing a Type Guard - * that the path is non-null. - */ - hasPath() { return (this.path != null); } - /** - * Return the child for %%index%%. - */ - deriveChild(_index) { - const index = getNumber(_index, "index"); - assertArgument(index <= 0xffffffff, "invalid index", "index", index); - // Base path - let path = this.path; - if (path) { - path += "/" + (index & ~HardenedBit); - if (index & HardenedBit) { - path += "'"; - } - } - const { IR, IL } = ser_I(index, this.chainCode, this.publicKey, null); - const Ki = SigningKey.addPoints(IL, this.publicKey, true); - const address = computeAddress(Ki); - return new HDNodeVoidWallet(_guard, address, Ki, this.fingerprint, hexlify(IR), path, index, this.depth + 1, this.provider); - } - /** - * Return the signer for %%path%% from this node. - */ - derivePath(path) { - return derivePath(this, path); - } - } - /* - export class HDNodeWalletManager { - #root: HDNodeWallet; - - constructor(phrase: string, password?: null | string, path?: null | string, locale?: null | Wordlist) { - if (password == null) { password = ""; } - if (path == null) { path = "m/44'/60'/0'/0"; } - if (locale == null) { locale = LangEn.wordlist(); } - this.#root = HDNodeWallet.fromPhrase(phrase, password, path, locale); - } - - getSigner(index?: number): HDNodeWallet { - return this.#root.deriveChild((index == null) ? 0: index); - } - } - */ - /** - * Returns the [[link-bip-32]] path for the account at %%index%%. - * - * This is the pattern used by wallets like Ledger. - * - * There is also an [alternate pattern](getIndexedAccountPath) used by - * some software. - */ - function getAccountPath(_index) { - const index = getNumber(_index, "index"); - assertArgument(index >= 0 && index < HardenedBit, "invalid account index", "index", index); - return `m/44'/60'/${index}'/0/0`; - } - /** - * Returns the path using an alternative pattern for deriving accounts, - * at %%index%%. - * - * This derivation path uses the //index// component rather than the - * //account// component to derive sequential accounts. - * - * This is the pattern used by wallets like MetaMask. - */ - function getIndexedAccountPath(_index) { - const index = getNumber(_index, "index"); - assertArgument(index >= 0 && index < HardenedBit, "invalid account index", "index", index); - return `m/44'/60'/0'/0/${index}`; - } - - /** - * @_subsection: api/wallet:JSON Wallets [json-wallets] - */ - /** - * Returns true if %%json%% is a valid JSON Crowdsale wallet. - */ - function isCrowdsaleJson(json) { - try { - const data = JSON.parse(json); - if (data.encseed) { - return true; - } - } - catch (error) { } - return false; - } - // See: https://github.com/ethereum/pyethsaletool - /** - * Before Ethereum launched, it was necessary to create a wallet - * format for backers to use, which would be used to receive ether - * as a reward for contributing to the project. - * - * The [[link-crowdsale]] format is now obsolete, but it is still - * useful to support and the additional code is fairly trivial as - * all the primitives required are used through core portions of - * the library. - */ - function decryptCrowdsaleJson(json, _password) { - const data = JSON.parse(json); - const password = getPassword(_password); - // Ethereum Address - const address = getAddress(spelunk(data, "ethaddr:string!")); - // Encrypted Seed - const encseed = looseArrayify(spelunk(data, "encseed:string!")); - assertArgument(encseed && (encseed.length % 16) === 0, "invalid encseed", "json", json); - const key = getBytes(pbkdf2(password, password, 2000, 32, "sha256")).slice(0, 16); - const iv = encseed.slice(0, 16); - const encryptedSeed = encseed.slice(16); - // Decrypt the seed - const aesCbc = new CBC(key, iv); - const seed = pkcs7Strip(getBytes(aesCbc.decrypt(encryptedSeed))); - // This wallet format is weird... Convert the binary encoded hex to a string. - let seedHex = ""; - for (let i = 0; i < seed.length; i++) { - seedHex += String.fromCharCode(seed[i]); - } - return { address, privateKey: id(seedHex) }; - } - - function stall(duration) { - return new Promise((resolve) => { setTimeout(() => { resolve(); }, duration); }); - } - /** - * A **Wallet** manages a single private key which is used to sign - * transactions, messages and other common payloads. - * - * This class is generally the main entry point for developers - * that wish to use a private key directly, as it can create - * instances from a large variety of common sources, including - * raw private key, [[link-bip-39]] mnemonics and encrypte JSON - * wallets. - */ - class Wallet extends BaseWallet { - /** - * Create a new wallet for the private %%key%%, optionally connected - * to %%provider%%. - */ - constructor(key, provider) { - if (typeof (key) === "string" && !key.startsWith("0x")) { - key = "0x" + key; - } - let signingKey = (typeof (key) === "string") ? new SigningKey(key) : key; - super(signingKey, provider); - } - connect(provider) { - return new Wallet(this.signingKey, provider); - } - /** - * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with - * %%password%%. - * - * If %%progressCallback%% is specified, it will receive periodic - * updates as the encryption process progreses. - */ - async encrypt(password, progressCallback) { - const account = { address: this.address, privateKey: this.privateKey }; - return await encryptKeystoreJson(account, password, { progressCallback }); - } - /** - * Returns a [JSON Keystore Wallet](json-wallets) encryped with - * %%password%%. - * - * It is preferred to use the [async version](encrypt) instead, - * which allows a [[ProgressCallback]] to keep the user informed. - * - * This method will block the event loop (freezing all UI) until - * it is complete, which may be a non-trivial duration. - */ - encryptSync(password) { - const account = { address: this.address, privateKey: this.privateKey }; - return encryptKeystoreJsonSync(account, password); - } - static #fromAccount(account) { - assertArgument(account, "invalid JSON wallet", "json", "[ REDACTED ]"); - if ("mnemonic" in account && account.mnemonic && account.mnemonic.locale === "en") { - const mnemonic = Mnemonic.fromEntropy(account.mnemonic.entropy); - const wallet = HDNodeWallet.fromMnemonic(mnemonic, account.mnemonic.path); - if (wallet.address === account.address && wallet.privateKey === account.privateKey) { - return wallet; - } - console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key"); - } - const wallet = new Wallet(account.privateKey); - assertArgument(wallet.address === account.address, "address/privateKey mismatch", "json", "[ REDACTED ]"); - return wallet; - } - /** - * Creates (asynchronously) a **Wallet** by decrypting the %%json%% - * with %%password%%. - * - * If %%progress%% is provided, it is called periodically during - * decryption so that any UI can be updated. - */ - static async fromEncryptedJson(json, password, progress) { - let account = null; - if (isKeystoreJson(json)) { - account = await decryptKeystoreJson(json, password, progress); - } - else if (isCrowdsaleJson(json)) { - if (progress) { - progress(0); - await stall(0); - } - account = decryptCrowdsaleJson(json, password); - if (progress) { - progress(1); - await stall(0); - } - } - return Wallet.#fromAccount(account); - } - /** - * Creates a **Wallet** by decrypting the %%json%% with %%password%%. - * - * The [[fromEncryptedJson]] method is preferred, as this method - * will lock up and freeze the UI during decryption, which may take - * some time. - */ - static fromEncryptedJsonSync(json, password) { - let account = null; - if (isKeystoreJson(json)) { - account = decryptKeystoreJsonSync(json, password); - } - else if (isCrowdsaleJson(json)) { - account = decryptCrowdsaleJson(json, password); - } - else { - assertArgument(false, "invalid JSON wallet", "json", "[ REDACTED ]"); - } - return Wallet.#fromAccount(account); - } - /** - * Creates a new random [[HDNodeWallet]] using the available - * [cryptographic random source](randomBytes). - * - * If there is no crytographic random source, this will throw. - */ - static createRandom(provider) { - const wallet = HDNodeWallet.createRandom(); - if (provider) { - return wallet.connect(provider); - } - return wallet; - } - /** - * Creates a [[HDNodeWallet]] for %%phrase%%. - */ - static fromPhrase(phrase, provider) { - const wallet = HDNodeWallet.fromPhrase(phrase); - if (provider) { - return wallet.connect(provider); - } - return wallet; - } - } - - const Base64 = ")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_"; - /** - * @_ignore - */ - function decodeBits(width, data) { - const maxValue = (1 << width) - 1; - const result = []; - let accum = 0, bits = 0, flood = 0; - for (let i = 0; i < data.length; i++) { - // Accumulate 6 bits of data - accum = ((accum << 6) | Base64.indexOf(data[i])); - bits += 6; - // While we have enough for a word... - while (bits >= width) { - // ...read the word - const value = (accum >> (bits - width)); - accum &= (1 << (bits - width)) - 1; - bits -= width; - // A value of 0 indicates we exceeded maxValue, it - // floods over into the next value - if (value === 0) { - flood += maxValue; - } - else { - result.push(value + flood); - flood = 0; - } - } - } - return result; - } - - /** - * @_ignore - */ - function decodeOwlA(data, accents) { - let words = decodeOwl(data).join(","); - // Inject the accents - accents.split(/,/g).forEach((accent) => { - const match = accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/); - assertArgument(match !== null, "internal error parsing accents", "accents", accents); - let posOffset = 0; - const positions = decodeBits(parseInt(match[3]), match[4]); - const charCode = parseInt(match[2]); - const regex = new RegExp(`([${match[1]}])`, "g"); - words = words.replace(regex, (all, letter) => { - const rem = --positions[posOffset]; - if (rem === 0) { - letter = String.fromCharCode(letter.charCodeAt(0), charCode); - posOffset++; - } - return letter; - }); - }); - return words.split(","); - } - - /** - * An OWL-A format Wordlist extends the OWL format to add an - * overlay onto an OWL format Wordlist to support diacritic - * marks. - * - * This class is generally not useful to most developers as - * it is used mainly internally to keep Wordlists for languages - * based on latin-1 small. - * - * If necessary, there are tools within the ``generation/`` folder - * to create the necessary data. - */ - class WordlistOwlA extends WordlistOwl { - #accent; - /** - * Creates a new Wordlist for %%locale%% using the OWLA %%data%% - * and %%accent%% data and validated against the %%checksum%%. - */ - constructor(locale, data, accent, checksum) { - super(locale, data, checksum); - this.#accent = accent; - } - /** - * The OWLA-encoded accent data. - */ - get _accent() { return this.#accent; } - /** - * Decode all the words for the wordlist. - */ - _decodeWords() { - return decodeOwlA(this._data, this._accent); - } - } - - const wordlists = { - en: LangEn.wordlist(), - }; - - ///////////////////////////// - // - // dummy change; to pick-up ws security issue changes - - var ethers = /*#__PURE__*/Object.freeze({ - __proto__: null, - AbiCoder: AbiCoder, - AbstractProvider: AbstractProvider, - AbstractSigner: AbstractSigner, - AlchemyProvider: AlchemyProvider, - AnkrProvider: AnkrProvider, - BaseContract: BaseContract, - BaseWallet: BaseWallet, - Block: Block, - BlockscoutProvider: BlockscoutProvider, - BrowserProvider: BrowserProvider, - ChainstackProvider: ChainstackProvider, - CloudflareProvider: CloudflareProvider, - ConstructorFragment: ConstructorFragment, - Contract: Contract, - ContractEventPayload: ContractEventPayload, - ContractFactory: ContractFactory, - ContractTransactionReceipt: ContractTransactionReceipt, - ContractTransactionResponse: ContractTransactionResponse, - ContractUnknownEventPayload: ContractUnknownEventPayload, - EnsPlugin: EnsPlugin, - EnsResolver: EnsResolver, - ErrorDescription: ErrorDescription, - ErrorFragment: ErrorFragment, - EtherSymbol: EtherSymbol, - EtherscanPlugin: EtherscanPlugin, - EtherscanProvider: EtherscanProvider, - EventFragment: EventFragment, - EventLog: EventLog, - EventPayload: EventPayload, - FallbackFragment: FallbackFragment, - FallbackProvider: FallbackProvider, - FeeData: FeeData, - FeeDataNetworkPlugin: FeeDataNetworkPlugin, - FetchCancelSignal: FetchCancelSignal, - FetchRequest: FetchRequest, - FetchResponse: FetchResponse, - FetchUrlFeeDataNetworkPlugin: FetchUrlFeeDataNetworkPlugin, - FixedNumber: FixedNumber, - Fragment: Fragment, - FunctionFragment: FunctionFragment, - GasCostPlugin: GasCostPlugin, - HDNodeVoidWallet: HDNodeVoidWallet, - HDNodeWallet: HDNodeWallet, - Indexed: Indexed, - InfuraProvider: InfuraProvider, - InfuraWebSocketProvider: InfuraWebSocketProvider, - Interface: Interface, - IpcSocketProvider: IpcSocketProvider, - JsonRpcApiProvider: JsonRpcApiProvider, - JsonRpcProvider: JsonRpcProvider, - JsonRpcSigner: JsonRpcSigner, - LangEn: LangEn, - Log: Log, - LogDescription: LogDescription, - MaxInt256: MaxInt256, - MaxUint256: MaxUint256, - MessagePrefix: MessagePrefix, - MinInt256: MinInt256, - Mnemonic: Mnemonic, - MulticoinProviderPlugin: MulticoinProviderPlugin, - N: N$1, - NamedFragment: NamedFragment, - Network: Network, - NetworkPlugin: NetworkPlugin, - NonceManager: NonceManager, - ParamType: ParamType, - PocketProvider: PocketProvider, - QuickNodeProvider: QuickNodeProvider, - Result: Result, - Signature: Signature, - SigningKey: SigningKey, - SocketBlockSubscriber: SocketBlockSubscriber, - SocketEventSubscriber: SocketEventSubscriber, - SocketPendingSubscriber: SocketPendingSubscriber, - SocketProvider: SocketProvider, - SocketSubscriber: SocketSubscriber, - StructFragment: StructFragment, - Transaction: Transaction, - TransactionDescription: TransactionDescription, - TransactionReceipt: TransactionReceipt, - TransactionResponse: TransactionResponse, - Typed: Typed, - TypedDataEncoder: TypedDataEncoder, - UndecodedEventLog: UndecodedEventLog, - UnmanagedSubscriber: UnmanagedSubscriber, - Utf8ErrorFuncs: Utf8ErrorFuncs, - VoidSigner: VoidSigner, - Wallet: Wallet, - WebSocketProvider: WebSocketProvider, - WeiPerEther: WeiPerEther, - Wordlist: Wordlist, - WordlistOwl: WordlistOwl, - WordlistOwlA: WordlistOwlA, - ZeroAddress: ZeroAddress, - ZeroHash: ZeroHash, - accessListify: accessListify, - assert: assert, - assertArgument: assertArgument, - assertArgumentCount: assertArgumentCount, - assertNormalize: assertNormalize, - assertPrivate: assertPrivate, - authorizationify: authorizationify, - checkResultErrors: checkResultErrors, - computeAddress: computeAddress, - computeHmac: computeHmac, - concat: concat, - copyRequest: copyRequest, - dataLength: dataLength, - dataSlice: dataSlice, - decodeBase58: decodeBase58, - decodeBase64: decodeBase64, - decodeBytes32String: decodeBytes32String, - decodeRlp: decodeRlp, - decryptCrowdsaleJson: decryptCrowdsaleJson, - decryptKeystoreJson: decryptKeystoreJson, - decryptKeystoreJsonSync: decryptKeystoreJsonSync, - defaultPath: defaultPath, - defineProperties: defineProperties, - dnsEncode: dnsEncode, - encodeBase58: encodeBase58, - encodeBase64: encodeBase64, - encodeBytes32String: encodeBytes32String, - encodeRlp: encodeRlp, - encryptKeystoreJson: encryptKeystoreJson, - encryptKeystoreJsonSync: encryptKeystoreJsonSync, - ensNormalize: ensNormalize, - formatEther: formatEther, - formatUnits: formatUnits, - fromTwos: fromTwos, - getAccountPath: getAccountPath, - getAddress: getAddress, - getBigInt: getBigInt, - getBytes: getBytes, - getBytesCopy: getBytesCopy, - getCreate2Address: getCreate2Address, - getCreateAddress: getCreateAddress, - getDefaultProvider: getDefaultProvider, - getIcapAddress: getIcapAddress, - getIndexedAccountPath: getIndexedAccountPath, - getNumber: getNumber, - getUint: getUint, - hashAuthorization: hashAuthorization, - hashMessage: hashMessage, - hexlify: hexlify, - id: id, - isAddress: isAddress, - isAddressable: isAddressable, - isBytesLike: isBytesLike, - isCallException: isCallException, - isCrowdsaleJson: isCrowdsaleJson, - isError: isError, - isHexString: isHexString, - isKeystoreJson: isKeystoreJson, - isValidName: isValidName, - keccak256: keccak256, - lock: lock, - makeError: makeError, - mask: mask, - namehash: namehash, - parseEther: parseEther, - parseUnits: parseUnits$1, - pbkdf2: pbkdf2, - randomBytes: randomBytes, - recoverAddress: recoverAddress, - resolveAddress: resolveAddress, - resolveProperties: resolveProperties, - ripemd160: ripemd160, - scrypt: scrypt, - scryptSync: scryptSync, - sha256: sha256, - sha512: sha512, - showThrottleMessage: showThrottleMessage, - solidityPacked: solidityPacked, - solidityPackedKeccak256: solidityPackedKeccak256, - solidityPackedSha256: solidityPackedSha256, - stripZerosLeft: stripZerosLeft, - toBeArray: toBeArray, - toBeHex: toBeHex, - toBigInt: toBigInt, - toNumber: toNumber, - toQuantity: toQuantity, - toTwos: toTwos, - toUtf8Bytes: toUtf8Bytes, - toUtf8CodePoints: toUtf8CodePoints, - toUtf8String: toUtf8String, - uuidV4: uuidV4, - verifyAuthorization: verifyAuthorization, - verifyMessage: verifyMessage, - verifyTypedData: verifyTypedData, - version: version, - wordlists: wordlists, - zeroPadBytes: zeroPadBytes, - zeroPadValue: zeroPadValue - }); - - exports.AbiCoder = AbiCoder; - exports.AbstractProvider = AbstractProvider; - exports.AbstractSigner = AbstractSigner; - exports.AlchemyProvider = AlchemyProvider; - exports.AnkrProvider = AnkrProvider; - exports.BaseContract = BaseContract; - exports.BaseWallet = BaseWallet; - exports.Block = Block; - exports.BlockscoutProvider = BlockscoutProvider; - exports.BrowserProvider = BrowserProvider; - exports.ChainstackProvider = ChainstackProvider; - exports.CloudflareProvider = CloudflareProvider; - exports.ConstructorFragment = ConstructorFragment; - exports.Contract = Contract; - exports.ContractEventPayload = ContractEventPayload; - exports.ContractFactory = ContractFactory; - exports.ContractTransactionReceipt = ContractTransactionReceipt; - exports.ContractTransactionResponse = ContractTransactionResponse; - exports.ContractUnknownEventPayload = ContractUnknownEventPayload; - exports.EnsPlugin = EnsPlugin; - exports.EnsResolver = EnsResolver; - exports.ErrorDescription = ErrorDescription; - exports.ErrorFragment = ErrorFragment; - exports.EtherSymbol = EtherSymbol; - exports.EtherscanPlugin = EtherscanPlugin; - exports.EtherscanProvider = EtherscanProvider; - exports.EventFragment = EventFragment; - exports.EventLog = EventLog; - exports.EventPayload = EventPayload; - exports.FallbackFragment = FallbackFragment; - exports.FallbackProvider = FallbackProvider; - exports.FeeData = FeeData; - exports.FeeDataNetworkPlugin = FeeDataNetworkPlugin; - exports.FetchCancelSignal = FetchCancelSignal; - exports.FetchRequest = FetchRequest; - exports.FetchResponse = FetchResponse; - exports.FetchUrlFeeDataNetworkPlugin = FetchUrlFeeDataNetworkPlugin; - exports.FixedNumber = FixedNumber; - exports.Fragment = Fragment; - exports.FunctionFragment = FunctionFragment; - exports.GasCostPlugin = GasCostPlugin; - exports.HDNodeVoidWallet = HDNodeVoidWallet; - exports.HDNodeWallet = HDNodeWallet; - exports.Indexed = Indexed; - exports.InfuraProvider = InfuraProvider; - exports.InfuraWebSocketProvider = InfuraWebSocketProvider; - exports.Interface = Interface; - exports.IpcSocketProvider = IpcSocketProvider; - exports.JsonRpcApiProvider = JsonRpcApiProvider; - exports.JsonRpcProvider = JsonRpcProvider; - exports.JsonRpcSigner = JsonRpcSigner; - exports.LangEn = LangEn; - exports.Log = Log; - exports.LogDescription = LogDescription; - exports.MaxInt256 = MaxInt256; - exports.MaxUint256 = MaxUint256; - exports.MessagePrefix = MessagePrefix; - exports.MinInt256 = MinInt256; - exports.Mnemonic = Mnemonic; - exports.MulticoinProviderPlugin = MulticoinProviderPlugin; - exports.N = N$1; - exports.NamedFragment = NamedFragment; - exports.Network = Network; - exports.NetworkPlugin = NetworkPlugin; - exports.NonceManager = NonceManager; - exports.ParamType = ParamType; - exports.PocketProvider = PocketProvider; - exports.QuickNodeProvider = QuickNodeProvider; - exports.Result = Result; - exports.Signature = Signature; - exports.SigningKey = SigningKey; - exports.SocketBlockSubscriber = SocketBlockSubscriber; - exports.SocketEventSubscriber = SocketEventSubscriber; - exports.SocketPendingSubscriber = SocketPendingSubscriber; - exports.SocketProvider = SocketProvider; - exports.SocketSubscriber = SocketSubscriber; - exports.StructFragment = StructFragment; - exports.Transaction = Transaction; - exports.TransactionDescription = TransactionDescription; - exports.TransactionReceipt = TransactionReceipt; - exports.TransactionResponse = TransactionResponse; - exports.Typed = Typed; - exports.TypedDataEncoder = TypedDataEncoder; - exports.UndecodedEventLog = UndecodedEventLog; - exports.UnmanagedSubscriber = UnmanagedSubscriber; - exports.Utf8ErrorFuncs = Utf8ErrorFuncs; - exports.VoidSigner = VoidSigner; - exports.Wallet = Wallet; - exports.WebSocketProvider = WebSocketProvider; - exports.WeiPerEther = WeiPerEther; - exports.Wordlist = Wordlist; - exports.WordlistOwl = WordlistOwl; - exports.WordlistOwlA = WordlistOwlA; - exports.ZeroAddress = ZeroAddress; - exports.ZeroHash = ZeroHash; - exports.accessListify = accessListify; - exports.assert = assert; - exports.assertArgument = assertArgument; - exports.assertArgumentCount = assertArgumentCount; - exports.assertNormalize = assertNormalize; - exports.assertPrivate = assertPrivate; - exports.authorizationify = authorizationify; - exports.checkResultErrors = checkResultErrors; - exports.computeAddress = computeAddress; - exports.computeHmac = computeHmac; - exports.concat = concat; - exports.copyRequest = copyRequest; - exports.dataLength = dataLength; - exports.dataSlice = dataSlice; - exports.decodeBase58 = decodeBase58; - exports.decodeBase64 = decodeBase64; - exports.decodeBytes32String = decodeBytes32String; - exports.decodeRlp = decodeRlp; - exports.decryptCrowdsaleJson = decryptCrowdsaleJson; - exports.decryptKeystoreJson = decryptKeystoreJson; - exports.decryptKeystoreJsonSync = decryptKeystoreJsonSync; - exports.defaultPath = defaultPath; - exports.defineProperties = defineProperties; - exports.dnsEncode = dnsEncode; - exports.encodeBase58 = encodeBase58; - exports.encodeBase64 = encodeBase64; - exports.encodeBytes32String = encodeBytes32String; - exports.encodeRlp = encodeRlp; - exports.encryptKeystoreJson = encryptKeystoreJson; - exports.encryptKeystoreJsonSync = encryptKeystoreJsonSync; - exports.ensNormalize = ensNormalize; - exports.ethers = ethers; - exports.formatEther = formatEther; - exports.formatUnits = formatUnits; - exports.fromTwos = fromTwos; - exports.getAccountPath = getAccountPath; - exports.getAddress = getAddress; - exports.getBigInt = getBigInt; - exports.getBytes = getBytes; - exports.getBytesCopy = getBytesCopy; - exports.getCreate2Address = getCreate2Address; - exports.getCreateAddress = getCreateAddress; - exports.getDefaultProvider = getDefaultProvider; - exports.getIcapAddress = getIcapAddress; - exports.getIndexedAccountPath = getIndexedAccountPath; - exports.getNumber = getNumber; - exports.getUint = getUint; - exports.hashAuthorization = hashAuthorization; - exports.hashMessage = hashMessage; - exports.hexlify = hexlify; - exports.id = id; - exports.isAddress = isAddress; - exports.isAddressable = isAddressable; - exports.isBytesLike = isBytesLike; - exports.isCallException = isCallException; - exports.isCrowdsaleJson = isCrowdsaleJson; - exports.isError = isError; - exports.isHexString = isHexString; - exports.isKeystoreJson = isKeystoreJson; - exports.isValidName = isValidName; - exports.keccak256 = keccak256; - exports.lock = lock; - exports.makeError = makeError; - exports.mask = mask; - exports.namehash = namehash; - exports.parseEther = parseEther; - exports.parseUnits = parseUnits$1; - exports.pbkdf2 = pbkdf2; - exports.randomBytes = randomBytes; - exports.recoverAddress = recoverAddress; - exports.resolveAddress = resolveAddress; - exports.resolveProperties = resolveProperties; - exports.ripemd160 = ripemd160; - exports.scrypt = scrypt; - exports.scryptSync = scryptSync; - exports.sha256 = sha256; - exports.sha512 = sha512; - exports.showThrottleMessage = showThrottleMessage; - exports.solidityPacked = solidityPacked; - exports.solidityPackedKeccak256 = solidityPackedKeccak256; - exports.solidityPackedSha256 = solidityPackedSha256; - exports.stripZerosLeft = stripZerosLeft; - exports.toBeArray = toBeArray; - exports.toBeHex = toBeHex; - exports.toBigInt = toBigInt; - exports.toNumber = toNumber; - exports.toQuantity = toQuantity; - exports.toTwos = toTwos; - exports.toUtf8Bytes = toUtf8Bytes; - exports.toUtf8CodePoints = toUtf8CodePoints; - exports.toUtf8String = toUtf8String; - exports.uuidV4 = uuidV4; - exports.verifyAuthorization = verifyAuthorization; - exports.verifyMessage = verifyMessage; - exports.verifyTypedData = verifyTypedData; - exports.version = version; - exports.wordlists = wordlists; - exports.zeroPadBytes = zeroPadBytes; - exports.zeroPadValue = zeroPadValue; - -})); -//# sourceMappingURL=ethers.umd.js.map diff --git a/tools/mnemonic-test/node_modules/ethers/dist/ethers.umd.js.map b/tools/mnemonic-test/node_modules/ethers/dist/ethers.umd.js.map deleted file mode 100644 index b0ad458c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/dist/ethers.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ethers.umd.js","sources":["../lib.esm/_version.js","../lib.esm/utils/properties.js","../lib.esm/utils/errors.js","../lib.esm/utils/data.js","../lib.esm/utils/maths.js","../lib.esm/utils/base58.js","../lib.esm/utils/base64-browser.js","../lib.esm/utils/events.js","../lib.esm/utils/utf8.js","../lib.esm/utils/geturl-browser.js","../lib.esm/utils/fetch.js","../lib.esm/utils/fixednumber.js","../lib.esm/utils/rlp-decode.js","../lib.esm/utils/rlp-encode.js","../lib.esm/utils/units.js","../lib.esm/utils/uuid.js","../lib.esm/abi/coders/abstract-coder.js","../node_modules/@noble/hashes/esm/_assert.js","../node_modules/@noble/hashes/esm/crypto.js","../node_modules/@noble/hashes/esm/utils.js","../node_modules/@noble/hashes/esm/hmac.js","../node_modules/@noble/hashes/esm/pbkdf2.js","../node_modules/@noble/hashes/esm/_sha2.js","../node_modules/@noble/hashes/esm/sha256.js","../node_modules/@noble/hashes/esm/_u64.js","../node_modules/@noble/hashes/esm/sha512.js","../lib.esm/crypto/crypto-browser.js","../lib.esm/crypto/hmac.js","../node_modules/@noble/hashes/esm/sha3.js","../lib.esm/crypto/keccak.js","../node_modules/@noble/hashes/esm/ripemd160.js","../lib.esm/crypto/ripemd160.js","../lib.esm/crypto/pbkdf2.js","../lib.esm/crypto/random.js","../node_modules/@noble/hashes/esm/scrypt.js","../lib.esm/crypto/scrypt.js","../lib.esm/crypto/sha2.js","../node_modules/@noble/curves/esm/abstract/utils.js","../node_modules/@noble/curves/esm/abstract/modular.js","../node_modules/@noble/curves/esm/abstract/curve.js","../node_modules/@noble/curves/esm/abstract/weierstrass.js","../node_modules/@noble/curves/esm/_shortw_utils.js","../node_modules/@noble/curves/esm/secp256k1.js","../lib.esm/constants/addresses.js","../lib.esm/constants/hashes.js","../lib.esm/constants/numbers.js","../lib.esm/constants/strings.js","../lib.esm/crypto/signature.js","../lib.esm/crypto/signing-key.js","../lib.esm/crypto/index.js","../lib.esm/address/address.js","../lib.esm/address/contract-address.js","../lib.esm/address/checks.js","../lib.esm/abi/typed.js","../lib.esm/abi/coders/address.js","../lib.esm/abi/coders/anonymous.js","../lib.esm/abi/coders/array.js","../lib.esm/abi/coders/boolean.js","../lib.esm/abi/coders/bytes.js","../lib.esm/abi/coders/fixed-bytes.js","../lib.esm/abi/coders/null.js","../lib.esm/abi/coders/number.js","../lib.esm/abi/coders/string.js","../lib.esm/abi/coders/tuple.js","../lib.esm/transaction/accesslist.js","../lib.esm/transaction/authorization.js","../lib.esm/transaction/address.js","../lib.esm/transaction/transaction.js","../lib.esm/hash/authorization.js","../lib.esm/hash/id.js","../node_modules/@adraffy/ens-normalize/dist/index.mjs","../lib.esm/hash/namehash.js","../lib.esm/hash/message.js","../lib.esm/hash/solidity.js","../lib.esm/hash/typed-data.js","../lib.esm/abi/fragments.js","../lib.esm/abi/abi-coder.js","../lib.esm/abi/bytes32.js","../lib.esm/abi/interface.js","../lib.esm/providers/provider.js","../lib.esm/contract/wrappers.js","../lib.esm/contract/contract.js","../lib.esm/contract/factory.js","../lib.esm/providers/ens-resolver.js","../lib.esm/providers/format.js","../lib.esm/providers/plugins-network.js","../lib.esm/providers/network.js","../lib.esm/providers/subscriber-polling.js","../lib.esm/providers/abstract-provider.js","../lib.esm/providers/abstract-signer.js","../lib.esm/providers/community.js","../lib.esm/providers/subscriber-filterid.js","../lib.esm/providers/provider-jsonrpc.js","../lib.esm/providers/provider-ankr.js","../lib.esm/providers/provider-alchemy.js","../lib.esm/providers/provider-chainstack.js","../lib.esm/providers/provider-cloudflare.js","../lib.esm/providers/provider-etherscan.js","../lib.esm/providers/ws-browser.js","../lib.esm/providers/provider-socket.js","../lib.esm/providers/provider-websocket.js","../lib.esm/providers/provider-infura.js","../lib.esm/providers/provider-quicknode.js","../lib.esm/providers/provider-fallback.js","../lib.esm/providers/default-provider.js","../lib.esm/providers/signer-noncemanager.js","../lib.esm/providers/provider-browser.js","../lib.esm/providers/provider-blockscout.js","../lib.esm/providers/provider-pocket.js","../lib.esm/providers/provider-ipcsocket-browser.js","../lib.esm/wallet/base-wallet.js","../lib.esm/wordlists/decode-owl.js","../lib.esm/wordlists/wordlist.js","../lib.esm/wordlists/wordlist-owl.js","../lib.esm/wordlists/lang-en.js","../lib.esm/wallet/mnemonic.js","../node_modules/aes-js/lib.esm/aes.js","../node_modules/aes-js/lib.esm/mode.js","../node_modules/aes-js/lib.esm/mode-cbc.js","../node_modules/aes-js/lib.esm/mode-ctr.js","../node_modules/aes-js/lib.esm/padding.js","../lib.esm/wallet/utils.js","../lib.esm/wallet/json-keystore.js","../lib.esm/wallet/hdwallet.js","../lib.esm/wallet/json-crowdsale.js","../lib.esm/wallet/wallet.js","../lib.esm/wordlists/bit-reader.js","../lib.esm/wordlists/decode-owla.js","../lib.esm/wordlists/wordlist-owla.js","../lib.esm/wordlists/wordlists-browser.js","../lib.esm/ethers.js"],"sourcesContent":["/* Do NOT modify this file; see /src.ts/_admin/update-version.ts */\n/**\n * The current version of Ethers.\n */\nexport const version = \"6.16.0\";\n//# sourceMappingURL=_version.js.map","/**\n * Property helper functions.\n *\n * @_subsection api/utils:Properties [about-properties]\n */\nfunction checkType(value, type, name) {\n const types = type.split(\"|\").map(t => t.trim());\n for (let i = 0; i < types.length; i++) {\n switch (type) {\n case \"any\":\n return;\n case \"bigint\":\n case \"boolean\":\n case \"number\":\n case \"string\":\n if (typeof (value) === type) {\n return;\n }\n }\n }\n const error = new Error(`invalid value for type ${type}`);\n error.code = \"INVALID_ARGUMENT\";\n error.argument = `value.${name}`;\n error.value = value;\n throw error;\n}\n/**\n * Resolves to a new object that is a copy of %%value%%, but with all\n * values resolved.\n */\nexport async function resolveProperties(value) {\n const keys = Object.keys(value);\n const results = await Promise.all(keys.map((k) => Promise.resolve(value[k])));\n return results.reduce((accum, v, index) => {\n accum[keys[index]] = v;\n return accum;\n }, {});\n}\n/**\n * Assigns the %%values%% to %%target%% as read-only values.\n *\n * It %%types%% is specified, the values are checked.\n */\nexport function defineProperties(target, values, types) {\n for (let key in values) {\n let value = values[key];\n const type = (types ? types[key] : null);\n if (type) {\n checkType(value, type, key);\n }\n Object.defineProperty(target, key, { enumerable: true, value, writable: false });\n }\n}\n//# sourceMappingURL=properties.js.map","/**\n * All errors in ethers include properties to ensure they are both\n * human-readable (i.e. ``.message``) and machine-readable (i.e. ``.code``).\n *\n * The [[isError]] function can be used to check the error ``code`` and\n * provide a type guard for the properties present on that error interface.\n *\n * @_section: api/utils/errors:Errors [about-errors]\n */\nimport { version } from \"../_version.js\";\nimport { defineProperties } from \"./properties.js\";\nfunction stringify(value, seen) {\n if (value == null) {\n return \"null\";\n }\n if (seen == null) {\n seen = new Set();\n }\n if (typeof (value) === \"object\") {\n if (seen.has(value)) {\n return \"[Circular]\";\n }\n seen.add(value);\n }\n if (Array.isArray(value)) {\n return \"[ \" + (value.map((v) => stringify(v, seen))).join(\", \") + \" ]\";\n }\n if (value instanceof Uint8Array) {\n const HEX = \"0123456789abcdef\";\n let result = \"0x\";\n for (let i = 0; i < value.length; i++) {\n result += HEX[value[i] >> 4];\n result += HEX[value[i] & 0xf];\n }\n return result;\n }\n if (typeof (value) === \"object\" && typeof (value.toJSON) === \"function\") {\n return stringify(value.toJSON(), seen);\n }\n switch (typeof (value)) {\n case \"boolean\":\n case \"number\":\n case \"symbol\":\n return value.toString();\n case \"bigint\":\n return BigInt(value).toString();\n case \"string\":\n return JSON.stringify(value);\n case \"object\": {\n const keys = Object.keys(value);\n keys.sort();\n return \"{ \" + keys.map((k) => `${stringify(k, seen)}: ${stringify(value[k], seen)}`).join(\", \") + \" }\";\n }\n }\n return `[ COULD NOT SERIALIZE ]`;\n}\n/**\n * Returns true if the %%error%% matches an error thrown by ethers\n * that matches the error %%code%%.\n *\n * In TypeScript environments, this can be used to check that %%error%%\n * matches an EthersError type, which means the expected properties will\n * be set.\n *\n * @See [ErrorCodes](api:ErrorCode)\n * @example\n * try {\n * // code....\n * } catch (e) {\n * if (isError(e, \"CALL_EXCEPTION\")) {\n * // The Type Guard has validated this object\n * console.log(e.data);\n * }\n * }\n */\nexport function isError(error, code) {\n return (error && error.code === code);\n}\n/**\n * Returns true if %%error%% is a [[CallExceptionError].\n */\nexport function isCallException(error) {\n return isError(error, \"CALL_EXCEPTION\");\n}\n/**\n * Returns a new Error configured to the format ethers emits errors, with\n * the %%message%%, [[api:ErrorCode]] %%code%% and additional properties\n * for the corresponding EthersError.\n *\n * Each error in ethers includes the version of ethers, a\n * machine-readable [[ErrorCode]], and depending on %%code%%, additional\n * required properties. The error message will also include the %%message%%,\n * ethers version, %%code%% and all additional properties, serialized.\n */\nexport function makeError(message, code, info) {\n let shortMessage = message;\n {\n const details = [];\n if (info) {\n if (\"message\" in info || \"code\" in info || \"name\" in info) {\n throw new Error(`value will overwrite populated values: ${stringify(info)}`);\n }\n for (const key in info) {\n if (key === \"shortMessage\") {\n continue;\n }\n const value = (info[key]);\n // try {\n details.push(key + \"=\" + stringify(value));\n // } catch (error: any) {\n // console.log(\"MMM\", error.message);\n // details.push(key + \"=[could not serialize object]\");\n // }\n }\n }\n details.push(`code=${code}`);\n details.push(`version=${version}`);\n if (details.length) {\n message += \" (\" + details.join(\", \") + \")\";\n }\n }\n let error;\n switch (code) {\n case \"INVALID_ARGUMENT\":\n error = new TypeError(message);\n break;\n case \"NUMERIC_FAULT\":\n case \"BUFFER_OVERRUN\":\n error = new RangeError(message);\n break;\n default:\n error = new Error(message);\n }\n defineProperties(error, { code });\n if (info) {\n Object.assign(error, info);\n }\n if (error.shortMessage == null) {\n defineProperties(error, { shortMessage });\n }\n return error;\n}\n/**\n * Throws an EthersError with %%message%%, %%code%% and additional error\n * %%info%% when %%check%% is falsish..\n *\n * @see [[api:makeError]]\n */\nexport function assert(check, message, code, info) {\n if (!check) {\n throw makeError(message, code, info);\n }\n}\n/**\n * A simple helper to simply ensuring provided arguments match expected\n * constraints, throwing if not.\n *\n * In TypeScript environments, the %%check%% has been asserted true, so\n * any further code does not need additional compile-time checks.\n */\nexport function assertArgument(check, message, name, value) {\n assert(check, message, \"INVALID_ARGUMENT\", { argument: name, value: value });\n}\nexport function assertArgumentCount(count, expectedCount, message) {\n if (message == null) {\n message = \"\";\n }\n if (message) {\n message = \": \" + message;\n }\n assert(count >= expectedCount, \"missing argument\" + message, \"MISSING_ARGUMENT\", {\n count: count,\n expectedCount: expectedCount\n });\n assert(count <= expectedCount, \"too many arguments\" + message, \"UNEXPECTED_ARGUMENT\", {\n count: count,\n expectedCount: expectedCount\n });\n}\nconst _normalizeForms = [\"NFD\", \"NFC\", \"NFKD\", \"NFKC\"].reduce((accum, form) => {\n try {\n // General test for normalize\n /* c8 ignore start */\n if (\"test\".normalize(form) !== \"test\") {\n throw new Error(\"bad\");\n }\n ;\n /* c8 ignore stop */\n if (form === \"NFD\") {\n const check = String.fromCharCode(0xe9).normalize(\"NFD\");\n const expected = String.fromCharCode(0x65, 0x0301);\n /* c8 ignore start */\n if (check !== expected) {\n throw new Error(\"broken\");\n }\n /* c8 ignore stop */\n }\n accum.push(form);\n }\n catch (error) { }\n return accum;\n}, []);\n/**\n * Throws if the normalization %%form%% is not supported.\n */\nexport function assertNormalize(form) {\n assert(_normalizeForms.indexOf(form) >= 0, \"platform missing String.prototype.normalize\", \"UNSUPPORTED_OPERATION\", {\n operation: \"String.prototype.normalize\", info: { form }\n });\n}\n/**\n * Many classes use file-scoped values to guard the constructor,\n * making it effectively private. This facilitates that pattern\n * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%,\n * throwing if not, indicating the %%className%% if provided.\n */\nexport function assertPrivate(givenGuard, guard, className) {\n if (className == null) {\n className = \"\";\n }\n if (givenGuard !== guard) {\n let method = className, operation = \"new\";\n if (className) {\n method += \".\";\n operation += \" \" + className;\n }\n assert(false, `private constructor; use ${method}from* methods`, \"UNSUPPORTED_OPERATION\", {\n operation\n });\n }\n}\n//# sourceMappingURL=errors.js.map","/**\n * Some data helpers.\n *\n *\n * @_subsection api/utils:Data Helpers [about-data]\n */\nimport { assert, assertArgument } from \"./errors.js\";\nfunction _getBytes(value, name, copy) {\n if (value instanceof Uint8Array) {\n if (copy) {\n return new Uint8Array(value);\n }\n return value;\n }\n if (typeof (value) === \"string\" && (value.length % 2) === 0 &&\n value.match(/^0x[0-9a-f]*$/i)) {\n const result = new Uint8Array((value.length - 2) / 2);\n let offset = 2;\n for (let i = 0; i < result.length; i++) {\n result[i] = parseInt(value.substring(offset, offset + 2), 16);\n offset += 2;\n }\n return result;\n }\n assertArgument(false, \"invalid BytesLike value\", name || \"value\", value);\n}\n/**\n * Get a typed Uint8Array for %%value%%. If already a Uint8Array\n * the original %%value%% is returned; if a copy is required use\n * [[getBytesCopy]].\n *\n * @see: getBytesCopy\n */\nexport function getBytes(value, name) {\n return _getBytes(value, name, false);\n}\n/**\n * Get a typed Uint8Array for %%value%%, creating a copy if necessary\n * to prevent any modifications of the returned value from being\n * reflected elsewhere.\n *\n * @see: getBytes\n */\nexport function getBytesCopy(value, name) {\n return _getBytes(value, name, true);\n}\n/**\n * Returns true if %%value%% is a valid [[HexString]].\n *\n * If %%length%% is ``true`` or a //number//, it also checks that\n * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//)\n * bytes of data (e.g. ``0x1234`` is 2 bytes).\n */\nexport function isHexString(value, length) {\n if (typeof (value) !== \"string\" || !value.match(/^0x[0-9A-Fa-f]*$/)) {\n return false;\n }\n if (typeof (length) === \"number\" && value.length !== 2 + 2 * length) {\n return false;\n }\n if (length === true && (value.length % 2) !== 0) {\n return false;\n }\n return true;\n}\n/**\n * Returns true if %%value%% is a valid representation of arbitrary\n * data (i.e. a valid [[DataHexString]] or a Uint8Array).\n */\nexport function isBytesLike(value) {\n return (isHexString(value, true) || (value instanceof Uint8Array));\n}\nconst HexCharacters = \"0123456789abcdef\";\n/**\n * Returns a [[DataHexString]] representation of %%data%%.\n */\nexport function hexlify(data) {\n const bytes = getBytes(data);\n let result = \"0x\";\n for (let i = 0; i < bytes.length; i++) {\n const v = bytes[i];\n result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f];\n }\n return result;\n}\n/**\n * Returns a [[DataHexString]] by concatenating all values\n * within %%data%%.\n */\nexport function concat(datas) {\n return \"0x\" + datas.map((d) => hexlify(d).substring(2)).join(\"\");\n}\n/**\n * Returns the length of %%data%%, in bytes.\n */\nexport function dataLength(data) {\n if (isHexString(data, true)) {\n return (data.length - 2) / 2;\n }\n return getBytes(data).length;\n}\n/**\n * Returns a [[DataHexString]] by slicing %%data%% from the %%start%%\n * offset to the %%end%% offset.\n *\n * By default %%start%% is 0 and %%end%% is the length of %%data%%.\n */\nexport function dataSlice(data, start, end) {\n const bytes = getBytes(data);\n if (end != null && end > bytes.length) {\n assert(false, \"cannot slice beyond data bounds\", \"BUFFER_OVERRUN\", {\n buffer: bytes, length: bytes.length, offset: end\n });\n }\n return hexlify(bytes.slice((start == null) ? 0 : start, (end == null) ? bytes.length : end));\n}\n/**\n * Return the [[DataHexString]] result by stripping all **leading**\n ** zero bytes from %%data%%.\n */\nexport function stripZerosLeft(data) {\n let bytes = hexlify(data).substring(2);\n while (bytes.startsWith(\"00\")) {\n bytes = bytes.substring(2);\n }\n return \"0x\" + bytes;\n}\nfunction zeroPad(data, length, left) {\n const bytes = getBytes(data);\n assert(length >= bytes.length, \"padding exceeds data length\", \"BUFFER_OVERRUN\", {\n buffer: new Uint8Array(bytes),\n length: length,\n offset: length + 1\n });\n const result = new Uint8Array(length);\n result.fill(0);\n if (left) {\n result.set(bytes, length - bytes.length);\n }\n else {\n result.set(bytes, 0);\n }\n return hexlify(result);\n}\n/**\n * Return the [[DataHexString]] of %%data%% padded on the **left**\n * to %%length%% bytes.\n *\n * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is\n * thrown.\n *\n * This pads data the same as **values** are in Solidity\n * (e.g. ``uint128``).\n */\nexport function zeroPadValue(data, length) {\n return zeroPad(data, length, true);\n}\n/**\n * Return the [[DataHexString]] of %%data%% padded on the **right**\n * to %%length%% bytes.\n *\n * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is\n * thrown.\n *\n * This pads data the same as **bytes** are in Solidity\n * (e.g. ``bytes16``).\n */\nexport function zeroPadBytes(data, length) {\n return zeroPad(data, length, false);\n}\n//# sourceMappingURL=data.js.map","/**\n * Some mathematic operations.\n *\n * @_subsection: api/utils:Math Helpers [about-maths]\n */\nimport { hexlify, isBytesLike } from \"./data.js\";\nimport { assert, assertArgument } from \"./errors.js\";\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\n//const BN_Max256 = (BN_1 << BigInt(256)) - BN_1;\n// IEEE 754 support 53-bits of mantissa\nconst maxValue = 0x1fffffffffffff;\n/**\n * Convert %%value%% from a twos-compliment representation of %%width%%\n * bits to its value.\n *\n * If the highest bit is ``1``, the result will be negative.\n */\nexport function fromTwos(_value, _width) {\n const value = getUint(_value, \"value\");\n const width = BigInt(getNumber(_width, \"width\"));\n assert((value >> width) === BN_0, \"overflow\", \"NUMERIC_FAULT\", {\n operation: \"fromTwos\", fault: \"overflow\", value: _value\n });\n // Top bit set; treat as a negative value\n if (value >> (width - BN_1)) {\n const mask = (BN_1 << width) - BN_1;\n return -(((~value) & mask) + BN_1);\n }\n return value;\n}\n/**\n * Convert %%value%% to a twos-compliment representation of\n * %%width%% bits.\n *\n * The result will always be positive.\n */\nexport function toTwos(_value, _width) {\n let value = getBigInt(_value, \"value\");\n const width = BigInt(getNumber(_width, \"width\"));\n const limit = (BN_1 << (width - BN_1));\n if (value < BN_0) {\n value = -value;\n assert(value <= limit, \"too low\", \"NUMERIC_FAULT\", {\n operation: \"toTwos\", fault: \"overflow\", value: _value\n });\n const mask = (BN_1 << width) - BN_1;\n return ((~value) & mask) + BN_1;\n }\n else {\n assert(value < limit, \"too high\", \"NUMERIC_FAULT\", {\n operation: \"toTwos\", fault: \"overflow\", value: _value\n });\n }\n return value;\n}\n/**\n * Mask %%value%% with a bitmask of %%bits%% ones.\n */\nexport function mask(_value, _bits) {\n const value = getUint(_value, \"value\");\n const bits = BigInt(getNumber(_bits, \"bits\"));\n return value & ((BN_1 << bits) - BN_1);\n}\n/**\n * Gets a BigInt from %%value%%. If it is an invalid value for\n * a BigInt, then an ArgumentError will be thrown for %%name%%.\n */\nexport function getBigInt(value, name) {\n switch (typeof (value)) {\n case \"bigint\": return value;\n case \"number\":\n assertArgument(Number.isInteger(value), \"underflow\", name || \"value\", value);\n assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n return BigInt(value);\n case \"string\":\n try {\n if (value === \"\") {\n throw new Error(\"empty string\");\n }\n if (value[0] === \"-\" && value[1] !== \"-\") {\n return -BigInt(value.substring(1));\n }\n return BigInt(value);\n }\n catch (e) {\n assertArgument(false, `invalid BigNumberish string: ${e.message}`, name || \"value\", value);\n }\n }\n assertArgument(false, \"invalid BigNumberish value\", name || \"value\", value);\n}\n/**\n * Returns %%value%% as a bigint, validating it is valid as a bigint\n * value and that it is positive.\n */\nexport function getUint(value, name) {\n const result = getBigInt(value, name);\n assert(result >= BN_0, \"unsigned value cannot be negative\", \"NUMERIC_FAULT\", {\n fault: \"overflow\", operation: \"getUint\", value\n });\n return result;\n}\nconst Nibbles = \"0123456789abcdef\";\n/*\n * Converts %%value%% to a BigInt. If %%value%% is a Uint8Array, it\n * is treated as Big Endian data.\n */\nexport function toBigInt(value) {\n if (value instanceof Uint8Array) {\n let result = \"0x0\";\n for (const v of value) {\n result += Nibbles[v >> 4];\n result += Nibbles[v & 0x0f];\n }\n return BigInt(result);\n }\n return getBigInt(value);\n}\n/**\n * Gets a //number// from %%value%%. If it is an invalid value for\n * a //number//, then an ArgumentError will be thrown for %%name%%.\n */\nexport function getNumber(value, name) {\n switch (typeof (value)) {\n case \"bigint\":\n assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n return Number(value);\n case \"number\":\n assertArgument(Number.isInteger(value), \"underflow\", name || \"value\", value);\n assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n return value;\n case \"string\":\n try {\n if (value === \"\") {\n throw new Error(\"empty string\");\n }\n return getNumber(BigInt(value), name);\n }\n catch (e) {\n assertArgument(false, `invalid numeric string: ${e.message}`, name || \"value\", value);\n }\n }\n assertArgument(false, \"invalid numeric value\", name || \"value\", value);\n}\n/**\n * Converts %%value%% to a number. If %%value%% is a Uint8Array, it\n * is treated as Big Endian data. Throws if the value is not safe.\n */\nexport function toNumber(value) {\n return getNumber(toBigInt(value));\n}\n/**\n * Converts %%value%% to a Big Endian hexstring, optionally padded to\n * %%width%% bytes.\n */\nexport function toBeHex(_value, _width) {\n const value = getUint(_value, \"value\");\n let result = value.toString(16);\n if (_width == null) {\n // Ensure the value is of even length\n if (result.length % 2) {\n result = \"0\" + result;\n }\n }\n else {\n const width = getNumber(_width, \"width\");\n // Special case when both value and width are 0 (see: #5025)\n if (width === 0 && value === BN_0) {\n return \"0x\";\n }\n assert(width * 2 >= result.length, `value exceeds width (${width} bytes)`, \"NUMERIC_FAULT\", {\n operation: \"toBeHex\",\n fault: \"overflow\",\n value: _value\n });\n // Pad the value to the required width\n while (result.length < (width * 2)) {\n result = \"0\" + result;\n }\n }\n return \"0x\" + result;\n}\n/**\n * Converts %%value%% to a Big Endian Uint8Array.\n */\nexport function toBeArray(_value, _width) {\n const value = getUint(_value, \"value\");\n if (value === BN_0) {\n const width = (_width != null) ? getNumber(_width, \"width\") : 0;\n return new Uint8Array(width);\n }\n let hex = value.toString(16);\n if (hex.length % 2) {\n hex = \"0\" + hex;\n }\n if (_width != null) {\n const width = getNumber(_width, \"width\");\n while (hex.length < (width * 2)) {\n hex = \"00\" + hex;\n }\n assert((width * 2) === hex.length, `value exceeds width (${width} bytes)`, \"NUMERIC_FAULT\", {\n operation: \"toBeArray\",\n fault: \"overflow\",\n value: _value\n });\n }\n const result = new Uint8Array(hex.length / 2);\n for (let i = 0; i < result.length; i++) {\n const offset = i * 2;\n result[i] = parseInt(hex.substring(offset, offset + 2), 16);\n }\n return result;\n}\n/**\n * Returns a [[HexString]] for %%value%% safe to use as a //Quantity//.\n *\n * A //Quantity// does not have and leading 0 values unless the value is\n * the literal value `0x0`. This is most commonly used for JSSON-RPC\n * numeric values.\n */\nexport function toQuantity(value) {\n let result = hexlify(isBytesLike(value) ? value : toBeArray(value)).substring(2);\n while (result.startsWith(\"0\")) {\n result = result.substring(1);\n }\n if (result === \"\") {\n result = \"0\";\n }\n return \"0x\" + result;\n}\n//# sourceMappingURL=maths.js.map","/**\n * The [Base58 Encoding](link-base58) scheme allows a **numeric** value\n * to be encoded as a compact string using a radix of 58 using only\n * alpha-numeric characters. Confusingly similar characters are omitted\n * (i.e. ``\"l0O\"``).\n *\n * Note that Base58 encodes a **numeric** value, not arbitrary bytes,\n * since any zero-bytes on the left would get removed. To mitigate this\n * issue most schemes that use Base58 choose specific high-order values\n * to ensure non-zero prefixes.\n *\n * @_subsection: api/utils:Base58 Encoding [about-base58]\n */\nimport { getBytes } from \"./data.js\";\nimport { assertArgument } from \"./errors.js\";\nimport { toBigInt } from \"./maths.js\";\nconst Alphabet = \"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz\";\nlet Lookup = null;\nfunction getAlpha(letter) {\n if (Lookup == null) {\n Lookup = {};\n for (let i = 0; i < Alphabet.length; i++) {\n Lookup[Alphabet[i]] = BigInt(i);\n }\n }\n const result = Lookup[letter];\n assertArgument(result != null, `invalid base58 value`, \"letter\", letter);\n return result;\n}\nconst BN_0 = BigInt(0);\nconst BN_58 = BigInt(58);\n/**\n * Encode %%value%% as a Base58-encoded string.\n */\nexport function encodeBase58(_value) {\n const bytes = getBytes(_value);\n let value = toBigInt(bytes);\n let result = \"\";\n while (value) {\n result = Alphabet[Number(value % BN_58)] + result;\n value /= BN_58;\n }\n // Account for leading padding zeros\n for (let i = 0; i < bytes.length; i++) {\n if (bytes[i]) {\n break;\n }\n result = Alphabet[0] + result;\n }\n return result;\n}\n/**\n * Decode the Base58-encoded %%value%%.\n */\nexport function decodeBase58(value) {\n let result = BN_0;\n for (let i = 0; i < value.length; i++) {\n result *= BN_58;\n result += getAlpha(value[i]);\n }\n return result;\n}\n//# sourceMappingURL=base58.js.map","// utils/base64-browser\nimport { getBytes } from \"./data.js\";\nexport function decodeBase64(textData) {\n textData = atob(textData);\n const data = new Uint8Array(textData.length);\n for (let i = 0; i < textData.length; i++) {\n data[i] = textData.charCodeAt(i);\n }\n return getBytes(data);\n}\nexport function encodeBase64(_data) {\n const data = getBytes(_data);\n let textData = \"\";\n for (let i = 0; i < data.length; i++) {\n textData += String.fromCharCode(data[i]);\n }\n return btoa(textData);\n}\n//# sourceMappingURL=base64-browser.js.map","/**\n * Events allow for applications to use the observer pattern, which\n * allows subscribing and publishing events, outside the normal\n * execution paths.\n *\n * @_section api/utils/events:Events [about-events]\n */\nimport { defineProperties } from \"./properties.js\";\n/**\n * When an [[EventEmitterable]] triggers a [[Listener]], the\n * callback always ahas one additional argument passed, which is\n * an **EventPayload**.\n */\nexport class EventPayload {\n /**\n * The event filter.\n */\n filter;\n /**\n * The **EventEmitterable**.\n */\n emitter;\n #listener;\n /**\n * Create a new **EventPayload** for %%emitter%% with\n * the %%listener%% and for %%filter%%.\n */\n constructor(emitter, listener, filter) {\n this.#listener = listener;\n defineProperties(this, { emitter, filter });\n }\n /**\n * Unregister the triggered listener for future events.\n */\n async removeListener() {\n if (this.#listener == null) {\n return;\n }\n await this.emitter.off(this.filter, this.#listener);\n }\n}\n//# sourceMappingURL=events.js.map","/**\n * Using strings in Ethereum (or any security-basd system) requires\n * additional care. These utilities attempt to mitigate some of the\n * safety issues as well as provide the ability to recover and analyse\n * strings.\n *\n * @_subsection api/utils:Strings and UTF-8 [about-strings]\n */\nimport { getBytes } from \"./data.js\";\nimport { assertArgument, assertNormalize } from \"./errors.js\";\nfunction errorFunc(reason, offset, bytes, output, badCodepoint) {\n assertArgument(false, `invalid codepoint at offset ${offset}; ${reason}`, \"bytes\", bytes);\n}\nfunction ignoreFunc(reason, offset, bytes, output, badCodepoint) {\n // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes\n if (reason === \"BAD_PREFIX\" || reason === \"UNEXPECTED_CONTINUE\") {\n let i = 0;\n for (let o = offset + 1; o < bytes.length; o++) {\n if (bytes[o] >> 6 !== 0x02) {\n break;\n }\n i++;\n }\n return i;\n }\n // This byte runs us past the end of the string, so just jump to the end\n // (but the first byte was read already read and therefore skipped)\n if (reason === \"OVERRUN\") {\n return bytes.length - offset - 1;\n }\n // Nothing to skip\n return 0;\n}\nfunction replaceFunc(reason, offset, bytes, output, badCodepoint) {\n // Overlong representations are otherwise \"valid\" code points; just non-deistingtished\n if (reason === \"OVERLONG\") {\n assertArgument(typeof (badCodepoint) === \"number\", \"invalid bad code point for replacement\", \"badCodepoint\", badCodepoint);\n output.push(badCodepoint);\n return 0;\n }\n // Put the replacement character into the output\n output.push(0xfffd);\n // Otherwise, process as if ignoring errors\n return ignoreFunc(reason, offset, bytes, output, badCodepoint);\n}\n/**\n * A handful of popular, built-in UTF-8 error handling strategies.\n *\n * **``\"error\"``** - throws on ANY illegal UTF-8 sequence or\n * non-canonical (overlong) codepoints (this is the default)\n *\n * **``\"ignore\"``** - silently drops any illegal UTF-8 sequence\n * and accepts non-canonical (overlong) codepoints\n *\n * **``\"replace\"``** - replace any illegal UTF-8 sequence with the\n * UTF-8 replacement character (i.e. ``\"\\\\ufffd\"``) and accepts\n * non-canonical (overlong) codepoints\n *\n * @returns: Record<\"error\" | \"ignore\" | \"replace\", Utf8ErrorFunc>\n */\nexport const Utf8ErrorFuncs = Object.freeze({\n error: errorFunc,\n ignore: ignoreFunc,\n replace: replaceFunc\n});\n// http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499\nfunction getUtf8CodePoints(_bytes, onError) {\n if (onError == null) {\n onError = Utf8ErrorFuncs.error;\n }\n const bytes = getBytes(_bytes, \"bytes\");\n const result = [];\n let i = 0;\n // Invalid bytes are ignored\n while (i < bytes.length) {\n const c = bytes[i++];\n // 0xxx xxxx\n if (c >> 7 === 0) {\n result.push(c);\n continue;\n }\n // Multibyte; how many bytes left for this character?\n let extraLength = null;\n let overlongMask = null;\n // 110x xxxx 10xx xxxx\n if ((c & 0xe0) === 0xc0) {\n extraLength = 1;\n overlongMask = 0x7f;\n // 1110 xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf0) === 0xe0) {\n extraLength = 2;\n overlongMask = 0x7ff;\n // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf8) === 0xf0) {\n extraLength = 3;\n overlongMask = 0xffff;\n }\n else {\n if ((c & 0xc0) === 0x80) {\n i += onError(\"UNEXPECTED_CONTINUE\", i - 1, bytes, result);\n }\n else {\n i += onError(\"BAD_PREFIX\", i - 1, bytes, result);\n }\n continue;\n }\n // Do we have enough bytes in our data?\n if (i - 1 + extraLength >= bytes.length) {\n i += onError(\"OVERRUN\", i - 1, bytes, result);\n continue;\n }\n // Remove the length prefix from the char\n let res = c & ((1 << (8 - extraLength - 1)) - 1);\n for (let j = 0; j < extraLength; j++) {\n let nextChar = bytes[i];\n // Invalid continuation byte\n if ((nextChar & 0xc0) != 0x80) {\n i += onError(\"MISSING_CONTINUE\", i, bytes, result);\n res = null;\n break;\n }\n ;\n res = (res << 6) | (nextChar & 0x3f);\n i++;\n }\n // See above loop for invalid continuation byte\n if (res === null) {\n continue;\n }\n // Maximum code point\n if (res > 0x10ffff) {\n i += onError(\"OUT_OF_RANGE\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Reserved for UTF-16 surrogate halves\n if (res >= 0xd800 && res <= 0xdfff) {\n i += onError(\"UTF16_SURROGATE\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Check for overlong sequences (more bytes than needed)\n if (res <= overlongMask) {\n i += onError(\"OVERLONG\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n result.push(res);\n }\n return result;\n}\n// http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array\n/**\n * Returns the UTF-8 byte representation of %%str%%.\n *\n * If %%form%% is specified, the string is normalized.\n */\nexport function toUtf8Bytes(str, form) {\n assertArgument(typeof (str) === \"string\", \"invalid string value\", \"str\", str);\n if (form != null) {\n assertNormalize(form);\n str = str.normalize(form);\n }\n let result = [];\n for (let i = 0; i < str.length; i++) {\n const c = str.charCodeAt(i);\n if (c < 0x80) {\n result.push(c);\n }\n else if (c < 0x800) {\n result.push((c >> 6) | 0xc0);\n result.push((c & 0x3f) | 0x80);\n }\n else if ((c & 0xfc00) == 0xd800) {\n i++;\n const c2 = str.charCodeAt(i);\n assertArgument(i < str.length && ((c2 & 0xfc00) === 0xdc00), \"invalid surrogate pair\", \"str\", str);\n // Surrogate Pair\n const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff);\n result.push((pair >> 18) | 0xf0);\n result.push(((pair >> 12) & 0x3f) | 0x80);\n result.push(((pair >> 6) & 0x3f) | 0x80);\n result.push((pair & 0x3f) | 0x80);\n }\n else {\n result.push((c >> 12) | 0xe0);\n result.push(((c >> 6) & 0x3f) | 0x80);\n result.push((c & 0x3f) | 0x80);\n }\n }\n return new Uint8Array(result);\n}\n;\n//export \nfunction _toUtf8String(codePoints) {\n return codePoints.map((codePoint) => {\n if (codePoint <= 0xffff) {\n return String.fromCharCode(codePoint);\n }\n codePoint -= 0x10000;\n return String.fromCharCode((((codePoint >> 10) & 0x3ff) + 0xd800), ((codePoint & 0x3ff) + 0xdc00));\n }).join(\"\");\n}\n/**\n * Returns the string represented by the UTF-8 data %%bytes%%.\n *\n * When %%onError%% function is specified, it is called on UTF-8\n * errors allowing recovery using the [[Utf8ErrorFunc]] API.\n * (default: [error](Utf8ErrorFuncs))\n */\nexport function toUtf8String(bytes, onError) {\n return _toUtf8String(getUtf8CodePoints(bytes, onError));\n}\n/**\n * Returns the UTF-8 code-points for %%str%%.\n *\n * If %%form%% is specified, the string is normalized.\n */\nexport function toUtf8CodePoints(str, form) {\n return getUtf8CodePoints(toUtf8Bytes(str, form));\n}\n//# sourceMappingURL=utf8.js.map","import { assert, makeError } from \"./errors.js\";\nexport function createGetUrl(options) {\n async function getUrl(req, _signal) {\n assert(_signal == null || !_signal.cancelled, \"request cancelled before sending\", \"CANCELLED\");\n const protocol = req.url.split(\":\")[0].toLowerCase();\n assert(protocol === \"http\" || protocol === \"https\", `unsupported protocol ${protocol}`, \"UNSUPPORTED_OPERATION\", {\n info: { protocol },\n operation: \"request\"\n });\n assert(protocol === \"https\" || !req.credentials || req.allowInsecureAuthentication, \"insecure authorized connections unsupported\", \"UNSUPPORTED_OPERATION\", {\n operation: \"request\"\n });\n let error = null;\n const controller = new AbortController();\n const timer = setTimeout(() => {\n error = makeError(\"request timeout\", \"TIMEOUT\");\n controller.abort();\n }, req.timeout);\n if (_signal) {\n _signal.addListener(() => {\n error = makeError(\"request cancelled\", \"CANCELLED\");\n controller.abort();\n });\n }\n const init = Object.assign({}, options, {\n method: req.method,\n headers: new Headers(Array.from(req)),\n body: req.body || undefined,\n signal: controller.signal\n });\n let resp;\n try {\n resp = await fetch(req.url, init);\n }\n catch (_error) {\n clearTimeout(timer);\n if (error) {\n throw error;\n }\n throw _error;\n }\n clearTimeout(timer);\n const headers = {};\n resp.headers.forEach((value, key) => {\n headers[key.toLowerCase()] = value;\n });\n const respBody = await resp.arrayBuffer();\n const body = (respBody == null) ? null : new Uint8Array(respBody);\n return {\n statusCode: resp.status,\n statusMessage: resp.statusText,\n headers, body\n };\n }\n return getUrl;\n}\n// @TODO: remove in v7; provided for backwards compat\nconst defaultGetUrl = createGetUrl({});\nexport async function getUrl(req, _signal) {\n return defaultGetUrl(req, _signal);\n}\n//# sourceMappingURL=geturl-browser.js.map","/**\n * Fetching content from the web is environment-specific, so Ethers\n * provides an abstraction that each environment can implement to provide\n * this service.\n *\n * On [Node.js](link-node), the ``http`` and ``https`` libs are used to\n * create a request object, register event listeners and process data\n * and populate the [[FetchResponse]].\n *\n * In a browser, the [DOM fetch](link-js-fetch) is used, and the resulting\n * ``Promise`` is waited on to retrieve the payload.\n *\n * The [[FetchRequest]] is responsible for handling many common situations,\n * such as redirects, server throttling, authentication, etc.\n *\n * It also handles common gateways, such as IPFS and data URIs.\n *\n * @_section api/utils/fetching:Fetching Web Content [about-fetch]\n */\nimport { decodeBase64, encodeBase64 } from \"./base64.js\";\nimport { hexlify } from \"./data.js\";\nimport { assert, assertArgument } from \"./errors.js\";\nimport { defineProperties } from \"./properties.js\";\nimport { toUtf8Bytes, toUtf8String } from \"./utf8.js\";\nimport { createGetUrl } from \"./geturl.js\";\nconst MAX_ATTEMPTS = 12;\nconst SLOT_INTERVAL = 250;\n// The global FetchGetUrlFunc implementation.\nlet defaultGetUrlFunc = createGetUrl();\nconst reData = new RegExp(\"^data:([^;:]*)?(;base64)?,(.*)$\", \"i\");\nconst reIpfs = new RegExp(\"^ipfs:/\\/(ipfs/)?(.*)$\", \"i\");\n// If locked, new Gateways cannot be added\nlet locked = false;\n// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs\nasync function dataGatewayFunc(url, signal) {\n try {\n const match = url.match(reData);\n if (!match) {\n throw new Error(\"invalid data\");\n }\n return new FetchResponse(200, \"OK\", {\n \"content-type\": (match[1] || \"text/plain\"),\n }, (match[2] ? decodeBase64(match[3]) : unpercent(match[3])));\n }\n catch (error) {\n return new FetchResponse(599, \"BAD REQUEST (invalid data: URI)\", {}, null, new FetchRequest(url));\n }\n}\n/**\n * Returns a [[FetchGatewayFunc]] for fetching content from a standard\n * IPFS gateway hosted at %%baseUrl%%.\n */\nfunction getIpfsGatewayFunc(baseUrl) {\n async function gatewayIpfs(url, signal) {\n try {\n const match = url.match(reIpfs);\n if (!match) {\n throw new Error(\"invalid link\");\n }\n return new FetchRequest(`${baseUrl}${match[2]}`);\n }\n catch (error) {\n return new FetchResponse(599, \"BAD REQUEST (invalid IPFS URI)\", {}, null, new FetchRequest(url));\n }\n }\n return gatewayIpfs;\n}\nconst Gateways = {\n \"data\": dataGatewayFunc,\n \"ipfs\": getIpfsGatewayFunc(\"https:/\\/gateway.ipfs.io/ipfs/\")\n};\nconst fetchSignals = new WeakMap();\n/**\n * @_ignore\n */\nexport class FetchCancelSignal {\n #listeners;\n #cancelled;\n constructor(request) {\n this.#listeners = [];\n this.#cancelled = false;\n fetchSignals.set(request, () => {\n if (this.#cancelled) {\n return;\n }\n this.#cancelled = true;\n for (const listener of this.#listeners) {\n setTimeout(() => { listener(); }, 0);\n }\n this.#listeners = [];\n });\n }\n addListener(listener) {\n assert(!this.#cancelled, \"singal already cancelled\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fetchCancelSignal.addCancelListener\"\n });\n this.#listeners.push(listener);\n }\n get cancelled() { return this.#cancelled; }\n checkSignal() {\n assert(!this.cancelled, \"cancelled\", \"CANCELLED\", {});\n }\n}\n// Check the signal, throwing if it is cancelled\nfunction checkSignal(signal) {\n if (signal == null) {\n throw new Error(\"missing signal; should not happen\");\n }\n signal.checkSignal();\n return signal;\n}\n/**\n * Represents a request for a resource using a URI.\n *\n * By default, the supported schemes are ``HTTP``, ``HTTPS``, ``data:``,\n * and ``IPFS:``.\n *\n * Additional schemes can be added globally using [[registerGateway]].\n *\n * @example:\n * req = new FetchRequest(\"https://www.ricmoo.com\")\n * resp = await req.send()\n * resp.body.length\n * //_result:\n */\nexport class FetchRequest {\n #allowInsecure;\n #gzip;\n #headers;\n #method;\n #timeout;\n #url;\n #body;\n #bodyType;\n #creds;\n // Hooks\n #preflight;\n #process;\n #retry;\n #signal;\n #throttle;\n #getUrlFunc;\n /**\n * The fetch URL to request.\n */\n get url() { return this.#url; }\n set url(url) {\n this.#url = String(url);\n }\n /**\n * The fetch body, if any, to send as the request body. //(default: null)//\n *\n * When setting a body, the intrinsic ``Content-Type`` is automatically\n * set and will be used if **not overridden** by setting a custom\n * header.\n *\n * If %%body%% is null, the body is cleared (along with the\n * intrinsic ``Content-Type``).\n *\n * If %%body%% is a string, the intrinsic ``Content-Type`` is set to\n * ``text/plain``.\n *\n * If %%body%% is a Uint8Array, the intrinsic ``Content-Type`` is set to\n * ``application/octet-stream``.\n *\n * If %%body%% is any other object, the intrinsic ``Content-Type`` is\n * set to ``application/json``.\n */\n get body() {\n if (this.#body == null) {\n return null;\n }\n return new Uint8Array(this.#body);\n }\n set body(body) {\n if (body == null) {\n this.#body = undefined;\n this.#bodyType = undefined;\n }\n else if (typeof (body) === \"string\") {\n this.#body = toUtf8Bytes(body);\n this.#bodyType = \"text/plain\";\n }\n else if (body instanceof Uint8Array) {\n this.#body = body;\n this.#bodyType = \"application/octet-stream\";\n }\n else if (typeof (body) === \"object\") {\n this.#body = toUtf8Bytes(JSON.stringify(body));\n this.#bodyType = \"application/json\";\n }\n else {\n throw new Error(\"invalid body\");\n }\n }\n /**\n * Returns true if the request has a body.\n */\n hasBody() {\n return (this.#body != null);\n }\n /**\n * The HTTP method to use when requesting the URI. If no method\n * has been explicitly set, then ``GET`` is used if the body is\n * null and ``POST`` otherwise.\n */\n get method() {\n if (this.#method) {\n return this.#method;\n }\n if (this.hasBody()) {\n return \"POST\";\n }\n return \"GET\";\n }\n set method(method) {\n if (method == null) {\n method = \"\";\n }\n this.#method = String(method).toUpperCase();\n }\n /**\n * The headers that will be used when requesting the URI. All\n * keys are lower-case.\n *\n * This object is a copy, so any changes will **NOT** be reflected\n * in the ``FetchRequest``.\n *\n * To set a header entry, use the ``setHeader`` method.\n */\n get headers() {\n const headers = Object.assign({}, this.#headers);\n if (this.#creds) {\n headers[\"authorization\"] = `Basic ${encodeBase64(toUtf8Bytes(this.#creds))}`;\n }\n ;\n if (this.allowGzip) {\n headers[\"accept-encoding\"] = \"gzip\";\n }\n if (headers[\"content-type\"] == null && this.#bodyType) {\n headers[\"content-type\"] = this.#bodyType;\n }\n if (this.body) {\n headers[\"content-length\"] = String(this.body.length);\n }\n return headers;\n }\n /**\n * Get the header for %%key%%, ignoring case.\n */\n getHeader(key) {\n return this.headers[key.toLowerCase()];\n }\n /**\n * Set the header for %%key%% to %%value%%. All values are coerced\n * to a string.\n */\n setHeader(key, value) {\n this.#headers[String(key).toLowerCase()] = String(value);\n }\n /**\n * Clear all headers, resetting all intrinsic headers.\n */\n clearHeaders() {\n this.#headers = {};\n }\n [Symbol.iterator]() {\n const headers = this.headers;\n const keys = Object.keys(headers);\n let index = 0;\n return {\n next: () => {\n if (index < keys.length) {\n const key = keys[index++];\n return {\n value: [key, headers[key]], done: false\n };\n }\n return { value: undefined, done: true };\n }\n };\n }\n /**\n * The value that will be sent for the ``Authorization`` header.\n *\n * To set the credentials, use the ``setCredentials`` method.\n */\n get credentials() {\n return this.#creds || null;\n }\n /**\n * Sets an ``Authorization`` for %%username%% with %%password%%.\n */\n setCredentials(username, password) {\n assertArgument(!username.match(/:/), \"invalid basic authentication username\", \"username\", \"[REDACTED]\");\n this.#creds = `${username}:${password}`;\n }\n /**\n * Enable and request gzip-encoded responses. The response will\n * automatically be decompressed. //(default: true)//\n */\n get allowGzip() {\n return this.#gzip;\n }\n set allowGzip(value) {\n this.#gzip = !!value;\n }\n /**\n * Allow ``Authentication`` credentials to be sent over insecure\n * channels. //(default: false)//\n */\n get allowInsecureAuthentication() {\n return !!this.#allowInsecure;\n }\n set allowInsecureAuthentication(value) {\n this.#allowInsecure = !!value;\n }\n /**\n * The timeout (in milliseconds) to wait for a complete response.\n * //(default: 5 minutes)//\n */\n get timeout() { return this.#timeout; }\n set timeout(timeout) {\n assertArgument(timeout >= 0, \"timeout must be non-zero\", \"timeout\", timeout);\n this.#timeout = timeout;\n }\n /**\n * This function is called prior to each request, for example\n * during a redirection or retry in case of server throttling.\n *\n * This offers an opportunity to populate headers or update\n * content before sending a request.\n */\n get preflightFunc() {\n return this.#preflight || null;\n }\n set preflightFunc(preflight) {\n this.#preflight = preflight;\n }\n /**\n * This function is called after each response, offering an\n * opportunity to provide client-level throttling or updating\n * response data.\n *\n * Any error thrown in this causes the ``send()`` to throw.\n *\n * To schedule a retry attempt (assuming the maximum retry limit\n * has not been reached), use [[response.throwThrottleError]].\n */\n get processFunc() {\n return this.#process || null;\n }\n set processFunc(process) {\n this.#process = process;\n }\n /**\n * This function is called on each retry attempt.\n */\n get retryFunc() {\n return this.#retry || null;\n }\n set retryFunc(retry) {\n this.#retry = retry;\n }\n /**\n * This function is called to fetch content from HTTP and\n * HTTPS URLs and is platform specific (e.g. nodejs vs\n * browsers).\n *\n * This is by default the currently registered global getUrl\n * function, which can be changed using [[registerGetUrl]].\n * If this has been set, setting is to ``null`` will cause\n * this FetchRequest (and any future clones) to revert back to\n * using the currently registered global getUrl function.\n *\n * Setting this is generally not necessary, but may be useful\n * for developers that wish to intercept requests or to\n * configurege a proxy or other agent.\n */\n get getUrlFunc() {\n return this.#getUrlFunc || defaultGetUrlFunc;\n }\n set getUrlFunc(value) {\n this.#getUrlFunc = value;\n }\n /**\n * Create a new FetchRequest instance with default values.\n *\n * Once created, each property may be set before issuing a\n * ``.send()`` to make the request.\n */\n constructor(url) {\n this.#url = String(url);\n this.#allowInsecure = false;\n this.#gzip = true;\n this.#headers = {};\n this.#method = \"\";\n this.#timeout = 300000;\n this.#throttle = {\n slotInterval: SLOT_INTERVAL,\n maxAttempts: MAX_ATTEMPTS\n };\n this.#getUrlFunc = null;\n }\n toString() {\n return ``;\n }\n /**\n * Update the throttle parameters used to determine maximum\n * attempts and exponential-backoff properties.\n */\n setThrottleParams(params) {\n if (params.slotInterval != null) {\n this.#throttle.slotInterval = params.slotInterval;\n }\n if (params.maxAttempts != null) {\n this.#throttle.maxAttempts = params.maxAttempts;\n }\n }\n async #send(attempt, expires, delay, _request, _response) {\n if (attempt >= this.#throttle.maxAttempts) {\n return _response.makeServerError(\"exceeded maximum retry limit\");\n }\n assert(getTime() <= expires, \"timeout\", \"TIMEOUT\", {\n operation: \"request.send\", reason: \"timeout\", request: _request\n });\n if (delay > 0) {\n await wait(delay);\n }\n let req = this.clone();\n const scheme = (req.url.split(\":\")[0] || \"\").toLowerCase();\n // Process any Gateways\n if (scheme in Gateways) {\n const result = await Gateways[scheme](req.url, checkSignal(_request.#signal));\n if (result instanceof FetchResponse) {\n let response = result;\n if (this.processFunc) {\n checkSignal(_request.#signal);\n try {\n response = await this.processFunc(req, response);\n }\n catch (error) {\n // Something went wrong during processing; throw a 5xx server error\n if (error.throttle == null || typeof (error.stall) !== \"number\") {\n response.makeServerError(\"error in post-processing function\", error).assertOk();\n }\n // Ignore throttling\n }\n }\n return response;\n }\n req = result;\n }\n // We have a preflight function; update the request\n if (this.preflightFunc) {\n req = await this.preflightFunc(req);\n }\n const resp = await this.getUrlFunc(req, checkSignal(_request.#signal));\n let response = new FetchResponse(resp.statusCode, resp.statusMessage, resp.headers, resp.body, _request);\n if (response.statusCode === 301 || response.statusCode === 302) {\n // Redirect\n try {\n const location = response.headers.location || \"\";\n return req.redirect(location).#send(attempt + 1, expires, 0, _request, response);\n }\n catch (error) { }\n // Things won't get any better on another attempt; abort\n return response;\n }\n else if (response.statusCode === 429) {\n // Throttle\n if (this.retryFunc == null || (await this.retryFunc(req, response, attempt))) {\n const retryAfter = response.headers[\"retry-after\"];\n let delay = this.#throttle.slotInterval * Math.trunc(Math.random() * Math.pow(2, attempt));\n if (typeof (retryAfter) === \"string\" && retryAfter.match(/^[1-9][0-9]*$/)) {\n delay = parseInt(retryAfter);\n }\n return req.clone().#send(attempt + 1, expires, delay, _request, response);\n }\n }\n if (this.processFunc) {\n checkSignal(_request.#signal);\n try {\n response = await this.processFunc(req, response);\n }\n catch (error) {\n // Something went wrong during processing; throw a 5xx server error\n if (error.throttle == null || typeof (error.stall) !== \"number\") {\n response.makeServerError(\"error in post-processing function\", error).assertOk();\n }\n // Throttle\n let delay = this.#throttle.slotInterval * Math.trunc(Math.random() * Math.pow(2, attempt));\n ;\n if (error.stall >= 0) {\n delay = error.stall;\n }\n return req.clone().#send(attempt + 1, expires, delay, _request, response);\n }\n }\n return response;\n }\n /**\n * Resolves to the response by sending the request.\n */\n send() {\n assert(this.#signal == null, \"request already sent\", \"UNSUPPORTED_OPERATION\", { operation: \"fetchRequest.send\" });\n this.#signal = new FetchCancelSignal(this);\n return this.#send(0, getTime() + this.timeout, 0, this, new FetchResponse(0, \"\", {}, null, this));\n }\n /**\n * Cancels the inflight response, causing a ``CANCELLED``\n * error to be rejected from the [[send]].\n */\n cancel() {\n assert(this.#signal != null, \"request has not been sent\", \"UNSUPPORTED_OPERATION\", { operation: \"fetchRequest.cancel\" });\n const signal = fetchSignals.get(this);\n if (!signal) {\n throw new Error(\"missing signal; should not happen\");\n }\n signal();\n }\n /**\n * Returns a new [[FetchRequest]] that represents the redirection\n * to %%location%%.\n */\n redirect(location) {\n // Redirection; for now we only support absolute locations\n const current = this.url.split(\":\")[0].toLowerCase();\n const target = location.split(\":\")[0].toLowerCase();\n // Don't allow redirecting:\n // - non-GET requests\n // - downgrading the security (e.g. https => http)\n // - to non-HTTP (or non-HTTPS) protocols [this could be relaxed?]\n assert(this.method === \"GET\" && (current !== \"https\" || target !== \"http\") && location.match(/^https?:/), `unsupported redirect`, \"UNSUPPORTED_OPERATION\", {\n operation: `redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(location)})`\n });\n // Create a copy of this request, with a new URL\n const req = new FetchRequest(location);\n req.method = \"GET\";\n req.allowGzip = this.allowGzip;\n req.timeout = this.timeout;\n req.#headers = Object.assign({}, this.#headers);\n if (this.#body) {\n req.#body = new Uint8Array(this.#body);\n }\n req.#bodyType = this.#bodyType;\n // Do not forward credentials unless on the same domain; only absolute\n //req.allowInsecure = false;\n // paths are currently supported; may want a way to specify to forward?\n //setStore(req.#props, \"creds\", getStore(this.#pros, \"creds\"));\n return req;\n }\n /**\n * Create a new copy of this request.\n */\n clone() {\n const clone = new FetchRequest(this.url);\n // Preserve \"default method\" (i.e. null)\n clone.#method = this.#method;\n // Preserve \"default body\" with type, copying the Uint8Array is present\n if (this.#body) {\n clone.#body = this.#body;\n }\n clone.#bodyType = this.#bodyType;\n // Preserve \"default headers\"\n clone.#headers = Object.assign({}, this.#headers);\n // Credentials is readonly, so we copy internally\n clone.#creds = this.#creds;\n if (this.allowGzip) {\n clone.allowGzip = true;\n }\n clone.timeout = this.timeout;\n if (this.allowInsecureAuthentication) {\n clone.allowInsecureAuthentication = true;\n }\n clone.#preflight = this.#preflight;\n clone.#process = this.#process;\n clone.#retry = this.#retry;\n clone.#throttle = Object.assign({}, this.#throttle);\n clone.#getUrlFunc = this.#getUrlFunc;\n return clone;\n }\n /**\n * Locks all static configuration for gateways and FetchGetUrlFunc\n * registration.\n */\n static lockConfig() {\n locked = true;\n }\n /**\n * Get the current Gateway function for %%scheme%%.\n */\n static getGateway(scheme) {\n return Gateways[scheme.toLowerCase()] || null;\n }\n /**\n * Use the %%func%% when fetching URIs using %%scheme%%.\n *\n * This method affects all requests globally.\n *\n * If [[lockConfig]] has been called, no change is made and this\n * throws.\n */\n static registerGateway(scheme, func) {\n scheme = scheme.toLowerCase();\n if (scheme === \"http\" || scheme === \"https\") {\n throw new Error(`cannot intercept ${scheme}; use registerGetUrl`);\n }\n if (locked) {\n throw new Error(\"gateways locked\");\n }\n Gateways[scheme] = func;\n }\n /**\n * Use %%getUrl%% when fetching URIs over HTTP and HTTPS requests.\n *\n * This method affects all requests globally.\n *\n * If [[lockConfig]] has been called, no change is made and this\n * throws.\n */\n static registerGetUrl(getUrl) {\n if (locked) {\n throw new Error(\"gateways locked\");\n }\n defaultGetUrlFunc = getUrl;\n }\n /**\n * Creates a getUrl function that fetches content from HTTP and\n * HTTPS URLs.\n *\n * The available %%options%% are dependent on the platform\n * implementation of the default getUrl function.\n *\n * This is not generally something that is needed, but is useful\n * when trying to customize simple behaviour when fetching HTTP\n * content.\n */\n static createGetUrlFunc(options) {\n return createGetUrl(options);\n }\n /**\n * Creates a function that can \"fetch\" data URIs.\n *\n * Note that this is automatically done internally to support\n * data URIs, so it is not necessary to register it.\n *\n * This is not generally something that is needed, but may\n * be useful in a wrapper to perfom custom data URI functionality.\n */\n static createDataGateway() {\n return dataGatewayFunc;\n }\n /**\n * Creates a function that will fetch IPFS (unvalidated) from\n * a custom gateway baseUrl.\n *\n * The default IPFS gateway used internally is\n * ``\"https:/\\/gateway.ipfs.io/ipfs/\"``.\n */\n static createIpfsGatewayFunc(baseUrl) {\n return getIpfsGatewayFunc(baseUrl);\n }\n}\n;\n/**\n * The response for a FetchRequest.\n */\nexport class FetchResponse {\n #statusCode;\n #statusMessage;\n #headers;\n #body;\n #request;\n #error;\n toString() {\n return ``;\n }\n /**\n * The response status code.\n */\n get statusCode() { return this.#statusCode; }\n /**\n * The response status message.\n */\n get statusMessage() { return this.#statusMessage; }\n /**\n * The response headers. All keys are lower-case.\n */\n get headers() { return Object.assign({}, this.#headers); }\n /**\n * The response body, or ``null`` if there was no body.\n */\n get body() {\n return (this.#body == null) ? null : new Uint8Array(this.#body);\n }\n /**\n * The response body as a UTF-8 encoded string, or the empty\n * string (i.e. ``\"\"``) if there was no body.\n *\n * An error is thrown if the body is invalid UTF-8 data.\n */\n get bodyText() {\n try {\n return (this.#body == null) ? \"\" : toUtf8String(this.#body);\n }\n catch (error) {\n assert(false, \"response body is not valid UTF-8 data\", \"UNSUPPORTED_OPERATION\", {\n operation: \"bodyText\", info: { response: this }\n });\n }\n }\n /**\n * The response body, decoded as JSON.\n *\n * An error is thrown if the body is invalid JSON-encoded data\n * or if there was no body.\n */\n get bodyJson() {\n try {\n return JSON.parse(this.bodyText);\n }\n catch (error) {\n assert(false, \"response body is not valid JSON\", \"UNSUPPORTED_OPERATION\", {\n operation: \"bodyJson\", info: { response: this }\n });\n }\n }\n [Symbol.iterator]() {\n const headers = this.headers;\n const keys = Object.keys(headers);\n let index = 0;\n return {\n next: () => {\n if (index < keys.length) {\n const key = keys[index++];\n return {\n value: [key, headers[key]], done: false\n };\n }\n return { value: undefined, done: true };\n }\n };\n }\n constructor(statusCode, statusMessage, headers, body, request) {\n this.#statusCode = statusCode;\n this.#statusMessage = statusMessage;\n this.#headers = Object.keys(headers).reduce((accum, k) => {\n accum[k.toLowerCase()] = String(headers[k]);\n return accum;\n }, {});\n this.#body = ((body == null) ? null : new Uint8Array(body));\n this.#request = (request || null);\n this.#error = { message: \"\" };\n }\n /**\n * Return a Response with matching headers and body, but with\n * an error status code (i.e. 599) and %%message%% with an\n * optional %%error%%.\n */\n makeServerError(message, error) {\n let statusMessage;\n if (!message) {\n message = `${this.statusCode} ${this.statusMessage}`;\n statusMessage = `CLIENT ESCALATED SERVER ERROR (${message})`;\n }\n else {\n statusMessage = `CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${message})`;\n }\n const response = new FetchResponse(599, statusMessage, this.headers, this.body, this.#request || undefined);\n response.#error = { message, error };\n return response;\n }\n /**\n * If called within a [request.processFunc](FetchRequest-processFunc)\n * call, causes the request to retry as if throttled for %%stall%%\n * milliseconds.\n */\n throwThrottleError(message, stall) {\n if (stall == null) {\n stall = -1;\n }\n else {\n assertArgument(Number.isInteger(stall) && stall >= 0, \"invalid stall timeout\", \"stall\", stall);\n }\n const error = new Error(message || \"throttling requests\");\n defineProperties(error, { stall, throttle: true });\n throw error;\n }\n /**\n * Get the header value for %%key%%, ignoring case.\n */\n getHeader(key) {\n return this.headers[key.toLowerCase()];\n }\n /**\n * Returns true if the response has a body.\n */\n hasBody() {\n return (this.#body != null);\n }\n /**\n * The request made for this response.\n */\n get request() { return this.#request; }\n /**\n * Returns true if this response was a success statusCode.\n */\n ok() {\n return (this.#error.message === \"\" && this.statusCode >= 200 && this.statusCode < 300);\n }\n /**\n * Throws a ``SERVER_ERROR`` if this response is not ok.\n */\n assertOk() {\n if (this.ok()) {\n return;\n }\n let { message, error } = this.#error;\n if (message === \"\") {\n message = `server response ${this.statusCode} ${this.statusMessage}`;\n }\n let requestUrl = null;\n if (this.request) {\n requestUrl = this.request.url;\n }\n let responseBody = null;\n try {\n if (this.#body) {\n responseBody = toUtf8String(this.#body);\n }\n }\n catch (e) { }\n assert(false, message, \"SERVER_ERROR\", {\n request: (this.request || \"unknown request\"), response: this, error,\n info: {\n requestUrl, responseBody,\n responseStatus: `${this.statusCode} ${this.statusMessage}`\n }\n });\n }\n}\nfunction getTime() { return (new Date()).getTime(); }\nfunction unpercent(value) {\n return toUtf8Bytes(value.replace(/%([0-9a-f][0-9a-f])/gi, (all, code) => {\n return String.fromCharCode(parseInt(code, 16));\n }));\n}\nfunction wait(delay) {\n return new Promise((resolve) => setTimeout(resolve, delay));\n}\n//# sourceMappingURL=fetch.js.map","/**\n * The **FixedNumber** class permits using values with decimal places,\n * using fixed-pont math.\n *\n * Fixed-point math is still based on integers under-the-hood, but uses an\n * internal offset to store fractional components below, and each operation\n * corrects for this after each operation.\n *\n * @_section: api/utils/fixed-point-math:Fixed-Point Maths [about-fixed-point-math]\n */\nimport { getBytes } from \"./data.js\";\nimport { assert, assertArgument, assertPrivate } from \"./errors.js\";\nimport { getBigInt, getNumber, fromTwos, mask, toBigInt } from \"./maths.js\";\nimport { defineProperties } from \"./properties.js\";\nconst BN_N1 = BigInt(-1);\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_5 = BigInt(5);\nconst _guard = {};\n// Constant to pull zeros from for multipliers\nlet Zeros = \"0000\";\nwhile (Zeros.length < 80) {\n Zeros += Zeros;\n}\n// Returns a string \"1\" followed by decimal \"0\"s\nfunction getTens(decimals) {\n let result = Zeros;\n while (result.length < decimals) {\n result += result;\n }\n return BigInt(\"1\" + result.substring(0, decimals));\n}\nfunction checkValue(val, format, safeOp) {\n const width = BigInt(format.width);\n if (format.signed) {\n const limit = (BN_1 << (width - BN_1));\n assert(safeOp == null || (val >= -limit && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp, fault: \"overflow\", value: val\n });\n if (val > BN_0) {\n val = fromTwos(mask(val, width), width);\n }\n else {\n val = -fromTwos(mask(-val, width), width);\n }\n }\n else {\n const limit = (BN_1 << width);\n assert(safeOp == null || (val >= 0 && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp, fault: \"overflow\", value: val\n });\n val = (((val % limit) + limit) % limit) & (limit - BN_1);\n }\n return val;\n}\nfunction getFormat(value) {\n if (typeof (value) === \"number\") {\n value = `fixed128x${value}`;\n }\n let signed = true;\n let width = 128;\n let decimals = 18;\n if (typeof (value) === \"string\") {\n // Parse the format string\n if (value === \"fixed\") {\n // defaults...\n }\n else if (value === \"ufixed\") {\n signed = false;\n }\n else {\n const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);\n assertArgument(match, \"invalid fixed format\", \"format\", value);\n signed = (match[1] !== \"u\");\n width = parseInt(match[2]);\n decimals = parseInt(match[3]);\n }\n }\n else if (value) {\n // Extract the values from the object\n const v = value;\n const check = (key, type, defaultValue) => {\n if (v[key] == null) {\n return defaultValue;\n }\n assertArgument(typeof (v[key]) === type, \"invalid fixed format (\" + key + \" not \" + type + \")\", \"format.\" + key, v[key]);\n return v[key];\n };\n signed = check(\"signed\", \"boolean\", signed);\n width = check(\"width\", \"number\", width);\n decimals = check(\"decimals\", \"number\", decimals);\n }\n assertArgument((width % 8) === 0, \"invalid FixedNumber width (not byte aligned)\", \"format.width\", width);\n assertArgument(decimals <= 80, \"invalid FixedNumber decimals (too large)\", \"format.decimals\", decimals);\n const name = (signed ? \"\" : \"u\") + \"fixed\" + String(width) + \"x\" + String(decimals);\n return { signed, width, decimals, name };\n}\nfunction toString(val, decimals) {\n let negative = \"\";\n if (val < BN_0) {\n negative = \"-\";\n val *= BN_N1;\n }\n let str = val.toString();\n // No decimal point for whole values\n if (decimals === 0) {\n return (negative + str);\n }\n // Pad out to the whole component (including a whole digit)\n while (str.length <= decimals) {\n str = Zeros + str;\n }\n // Insert the decimal point\n const index = str.length - decimals;\n str = str.substring(0, index) + \".\" + str.substring(index);\n // Trim the whole component (leaving at least one 0)\n while (str[0] === \"0\" && str[1] !== \".\") {\n str = str.substring(1);\n }\n // Trim the decimal component (leaving at least one 0)\n while (str[str.length - 1] === \"0\" && str[str.length - 2] !== \".\") {\n str = str.substring(0, str.length - 1);\n }\n return (negative + str);\n}\n/**\n * A FixedNumber represents a value over its [[FixedFormat]]\n * arithmetic field.\n *\n * A FixedNumber can be used to perform math, losslessly, on\n * values which have decmial places.\n *\n * A FixedNumber has a fixed bit-width to store values in, and stores all\n * values internally by multiplying the value by 10 raised to the power of\n * %%decimals%%.\n *\n * If operations are performed that cause a value to grow too high (close to\n * positive infinity) or too low (close to negative infinity), the value\n * is said to //overflow//.\n *\n * For example, an 8-bit signed value, with 0 decimals may only be within\n * the range ``-128`` to ``127``; so ``-128 - 1`` will overflow and become\n * ``127``. Likewise, ``127 + 1`` will overflow and become ``-127``.\n *\n * Many operation have a normal and //unsafe// variant. The normal variant\n * will throw a [[NumericFaultError]] on any overflow, while the //unsafe//\n * variant will silently allow overflow, corrupting its value value.\n *\n * If operations are performed that cause a value to become too small\n * (close to zero), the value loses precison and is said to //underflow//.\n *\n * For example, a value with 1 decimal place may store a number as small\n * as ``0.1``, but the value of ``0.1 / 2`` is ``0.05``, which cannot fit\n * into 1 decimal place, so underflow occurs which means precision is lost\n * and the value becomes ``0``.\n *\n * Some operations have a normal and //signalling// variant. The normal\n * variant will silently ignore underflow, while the //signalling// variant\n * will thow a [[NumericFaultError]] on underflow.\n */\nexport class FixedNumber {\n /**\n * The specific fixed-point arithmetic field for this value.\n */\n format;\n #format;\n // The actual value (accounting for decimals)\n #val;\n // A base-10 value to multiple values by to maintain the magnitude\n #tens;\n /**\n * This is a property so console.log shows a human-meaningful value.\n *\n * @private\n */\n _value;\n // Use this when changing this file to get some typing info,\n // but then switch to any to mask the internal type\n //constructor(guard: any, value: bigint, format: _FixedFormat) {\n /**\n * @private\n */\n constructor(guard, value, format) {\n assertPrivate(guard, _guard, \"FixedNumber\");\n this.#val = value;\n this.#format = format;\n const _value = toString(value, format.decimals);\n defineProperties(this, { format: format.name, _value });\n this.#tens = getTens(format.decimals);\n }\n /**\n * If true, negative values are permitted, otherwise only\n * positive values and zero are allowed.\n */\n get signed() { return this.#format.signed; }\n /**\n * The number of bits available to store the value.\n */\n get width() { return this.#format.width; }\n /**\n * The number of decimal places in the fixed-point arithment field.\n */\n get decimals() { return this.#format.decimals; }\n /**\n * The value as an integer, based on the smallest unit the\n * [[decimals]] allow.\n */\n get value() { return this.#val; }\n #checkFormat(other) {\n assertArgument(this.format === other.format, \"incompatible format; use fixedNumber.toFormat\", \"other\", other);\n }\n #checkValue(val, safeOp) {\n /*\n const width = BigInt(this.width);\n if (this.signed) {\n const limit = (BN_1 << (width - BN_1));\n assert(safeOp == null || (val >= -limit && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp, fault: \"overflow\", value: val\n });\n \n if (val > BN_0) {\n val = fromTwos(mask(val, width), width);\n } else {\n val = -fromTwos(mask(-val, width), width);\n }\n \n } else {\n const masked = mask(val, width);\n assert(safeOp == null || (val >= 0 && val === masked), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp, fault: \"overflow\", value: val\n });\n val = masked;\n }\n */\n val = checkValue(val, this.#format, safeOp);\n return new FixedNumber(_guard, val, this.#format);\n }\n #add(o, safeOp) {\n this.#checkFormat(o);\n return this.#checkValue(this.#val + o.#val, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% added\n * to %%other%%, ignoring overflow.\n */\n addUnsafe(other) { return this.#add(other); }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% added\n * to %%other%%. A [[NumericFaultError]] is thrown if overflow\n * occurs.\n */\n add(other) { return this.#add(other, \"add\"); }\n #sub(o, safeOp) {\n this.#checkFormat(o);\n return this.#checkValue(this.#val - o.#val, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%other%% subtracted\n * from %%this%%, ignoring overflow.\n */\n subUnsafe(other) { return this.#sub(other); }\n /**\n * Returns a new [[FixedNumber]] with the result of %%other%% subtracted\n * from %%this%%. A [[NumericFaultError]] is thrown if overflow\n * occurs.\n */\n sub(other) { return this.#sub(other, \"sub\"); }\n #mul(o, safeOp) {\n this.#checkFormat(o);\n return this.#checkValue((this.#val * o.#val) / this.#tens, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n * by %%other%%, ignoring overflow and underflow (precision loss).\n */\n mulUnsafe(other) { return this.#mul(other); }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n * by %%other%%. A [[NumericFaultError]] is thrown if overflow\n * occurs.\n */\n mul(other) { return this.#mul(other, \"mul\"); }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n * by %%other%%. A [[NumericFaultError]] is thrown if overflow\n * occurs or if underflow (precision loss) occurs.\n */\n mulSignal(other) {\n this.#checkFormat(other);\n const value = this.#val * other.#val;\n assert((value % this.#tens) === BN_0, \"precision lost during signalling mul\", \"NUMERIC_FAULT\", {\n operation: \"mulSignal\", fault: \"underflow\", value: this\n });\n return this.#checkValue(value / this.#tens, \"mulSignal\");\n }\n #div(o, safeOp) {\n assert(o.#val !== BN_0, \"division by zero\", \"NUMERIC_FAULT\", {\n operation: \"div\", fault: \"divide-by-zero\", value: this\n });\n this.#checkFormat(o);\n return this.#checkValue((this.#val * this.#tens) / o.#val, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% divided\n * by %%other%%, ignoring underflow (precision loss). A\n * [[NumericFaultError]] is thrown if overflow occurs.\n */\n divUnsafe(other) { return this.#div(other); }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% divided\n * by %%other%%, ignoring underflow (precision loss). A\n * [[NumericFaultError]] is thrown if overflow occurs.\n */\n div(other) { return this.#div(other, \"div\"); }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% divided\n * by %%other%%. A [[NumericFaultError]] is thrown if underflow\n * (precision loss) occurs.\n */\n divSignal(other) {\n assert(other.#val !== BN_0, \"division by zero\", \"NUMERIC_FAULT\", {\n operation: \"div\", fault: \"divide-by-zero\", value: this\n });\n this.#checkFormat(other);\n const value = (this.#val * this.#tens);\n assert((value % other.#val) === BN_0, \"precision lost during signalling div\", \"NUMERIC_FAULT\", {\n operation: \"divSignal\", fault: \"underflow\", value: this\n });\n return this.#checkValue(value / other.#val, \"divSignal\");\n }\n /**\n * Returns a comparison result between %%this%% and %%other%%.\n *\n * This is suitable for use in sorting, where ``-1`` implies %%this%%\n * is smaller, ``1`` implies %%this%% is larger and ``0`` implies\n * both are equal.\n */\n cmp(other) {\n let a = this.value, b = other.value;\n // Coerce a and b to the same magnitude\n const delta = this.decimals - other.decimals;\n if (delta > 0) {\n b *= getTens(delta);\n }\n else if (delta < 0) {\n a *= getTens(-delta);\n }\n // Comnpare\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return 1;\n }\n return 0;\n }\n /**\n * Returns true if %%other%% is equal to %%this%%.\n */\n eq(other) { return this.cmp(other) === 0; }\n /**\n * Returns true if %%other%% is less than to %%this%%.\n */\n lt(other) { return this.cmp(other) < 0; }\n /**\n * Returns true if %%other%% is less than or equal to %%this%%.\n */\n lte(other) { return this.cmp(other) <= 0; }\n /**\n * Returns true if %%other%% is greater than to %%this%%.\n */\n gt(other) { return this.cmp(other) > 0; }\n /**\n * Returns true if %%other%% is greater than or equal to %%this%%.\n */\n gte(other) { return this.cmp(other) >= 0; }\n /**\n * Returns a new [[FixedNumber]] which is the largest **integer**\n * that is less than or equal to %%this%%.\n *\n * The decimal component of the result will always be ``0``.\n */\n floor() {\n let val = this.#val;\n if (this.#val < BN_0) {\n val -= this.#tens - BN_1;\n }\n val = (this.#val / this.#tens) * this.#tens;\n return this.#checkValue(val, \"floor\");\n }\n /**\n * Returns a new [[FixedNumber]] which is the smallest **integer**\n * that is greater than or equal to %%this%%.\n *\n * The decimal component of the result will always be ``0``.\n */\n ceiling() {\n let val = this.#val;\n if (this.#val > BN_0) {\n val += this.#tens - BN_1;\n }\n val = (this.#val / this.#tens) * this.#tens;\n return this.#checkValue(val, \"ceiling\");\n }\n /**\n * Returns a new [[FixedNumber]] with the decimal component\n * rounded up on ties at %%decimals%% places.\n */\n round(decimals) {\n if (decimals == null) {\n decimals = 0;\n }\n // Not enough precision to not already be rounded\n if (decimals >= this.decimals) {\n return this;\n }\n const delta = this.decimals - decimals;\n const bump = BN_5 * getTens(delta - 1);\n let value = this.value + bump;\n const tens = getTens(delta);\n value = (value / tens) * tens;\n checkValue(value, this.#format, \"round\");\n return new FixedNumber(_guard, value, this.#format);\n }\n /**\n * Returns true if %%this%% is equal to ``0``.\n */\n isZero() { return (this.#val === BN_0); }\n /**\n * Returns true if %%this%% is less than ``0``.\n */\n isNegative() { return (this.#val < BN_0); }\n /**\n * Returns the string representation of %%this%%.\n */\n toString() { return this._value; }\n /**\n * Returns a float approximation.\n *\n * Due to IEEE 754 precission (or lack thereof), this function\n * can only return an approximation and most values will contain\n * rounding errors.\n */\n toUnsafeFloat() { return parseFloat(this.toString()); }\n /**\n * Return a new [[FixedNumber]] with the same value but has had\n * its field set to %%format%%.\n *\n * This will throw if the value cannot fit into %%format%%.\n */\n toFormat(format) {\n return FixedNumber.fromString(this.toString(), format);\n }\n /**\n * Creates a new [[FixedNumber]] for %%value%% divided by\n * %%decimal%% places with %%format%%.\n *\n * This will throw a [[NumericFaultError]] if %%value%% (once adjusted\n * for %%decimals%%) cannot fit in %%format%%, either due to overflow\n * or underflow (precision loss).\n */\n static fromValue(_value, _decimals, _format) {\n const decimals = (_decimals == null) ? 0 : getNumber(_decimals);\n const format = getFormat(_format);\n let value = getBigInt(_value, \"value\");\n const delta = decimals - format.decimals;\n if (delta > 0) {\n const tens = getTens(delta);\n assert((value % tens) === BN_0, \"value loses precision for format\", \"NUMERIC_FAULT\", {\n operation: \"fromValue\", fault: \"underflow\", value: _value\n });\n value /= tens;\n }\n else if (delta < 0) {\n value *= getTens(-delta);\n }\n checkValue(value, format, \"fromValue\");\n return new FixedNumber(_guard, value, format);\n }\n /**\n * Creates a new [[FixedNumber]] for %%value%% with %%format%%.\n *\n * This will throw a [[NumericFaultError]] if %%value%% cannot fit\n * in %%format%%, either due to overflow or underflow (precision loss).\n */\n static fromString(_value, _format) {\n const match = _value.match(/^(-?)([0-9]*)\\.?([0-9]*)$/);\n assertArgument(match && (match[2].length + match[3].length) > 0, \"invalid FixedNumber string value\", \"value\", _value);\n const format = getFormat(_format);\n let whole = (match[2] || \"0\"), decimal = (match[3] || \"\");\n // Pad out the decimals\n while (decimal.length < format.decimals) {\n decimal += Zeros;\n }\n // Check precision is safe\n assert(decimal.substring(format.decimals).match(/^0*$/), \"too many decimals for format\", \"NUMERIC_FAULT\", {\n operation: \"fromString\", fault: \"underflow\", value: _value\n });\n // Remove extra padding\n decimal = decimal.substring(0, format.decimals);\n const value = BigInt(match[1] + whole + decimal);\n checkValue(value, format, \"fromString\");\n return new FixedNumber(_guard, value, format);\n }\n /**\n * Creates a new [[FixedNumber]] with the big-endian representation\n * %%value%% with %%format%%.\n *\n * This will throw a [[NumericFaultError]] if %%value%% cannot fit\n * in %%format%% due to overflow.\n */\n static fromBytes(_value, _format) {\n let value = toBigInt(getBytes(_value, \"value\"));\n const format = getFormat(_format);\n if (format.signed) {\n value = fromTwos(value, format.width);\n }\n checkValue(value, format, \"fromBytes\");\n return new FixedNumber(_guard, value, format);\n }\n}\n//const f1 = FixedNumber.fromString(\"12.56\", \"fixed16x2\");\n//const f2 = FixedNumber.fromString(\"0.3\", \"fixed16x2\");\n//console.log(f1.divSignal(f2));\n//const BUMP = FixedNumber.from(\"0.5\");\n//# sourceMappingURL=fixednumber.js.map","//See: https://github.com/ethereum/wiki/wiki/RLP\nimport { hexlify } from \"./data.js\";\nimport { assert, assertArgument } from \"./errors.js\";\nimport { getBytes } from \"./data.js\";\nfunction hexlifyByte(value) {\n let result = value.toString(16);\n while (result.length < 2) {\n result = \"0\" + result;\n }\n return \"0x\" + result;\n}\nfunction unarrayifyInteger(data, offset, length) {\n let result = 0;\n for (let i = 0; i < length; i++) {\n result = (result * 256) + data[offset + i];\n }\n return result;\n}\nfunction _decodeChildren(data, offset, childOffset, length) {\n const result = [];\n while (childOffset < offset + 1 + length) {\n const decoded = _decode(data, childOffset);\n result.push(decoded.result);\n childOffset += decoded.consumed;\n assert(childOffset <= offset + 1 + length, \"child data too short\", \"BUFFER_OVERRUN\", {\n buffer: data, length, offset\n });\n }\n return { consumed: (1 + length), result: result };\n}\n// returns { consumed: number, result: Object }\nfunction _decode(data, offset) {\n assert(data.length !== 0, \"data too short\", \"BUFFER_OVERRUN\", {\n buffer: data, length: 0, offset: 1\n });\n const checkOffset = (offset) => {\n assert(offset <= data.length, \"data short segment too short\", \"BUFFER_OVERRUN\", {\n buffer: data, length: data.length, offset\n });\n };\n // Array with extra length prefix\n if (data[offset] >= 0xf8) {\n const lengthLength = data[offset] - 0xf7;\n checkOffset(offset + 1 + lengthLength);\n const length = unarrayifyInteger(data, offset + 1, lengthLength);\n checkOffset(offset + 1 + lengthLength + length);\n return _decodeChildren(data, offset, offset + 1 + lengthLength, lengthLength + length);\n }\n else if (data[offset] >= 0xc0) {\n const length = data[offset] - 0xc0;\n checkOffset(offset + 1 + length);\n return _decodeChildren(data, offset, offset + 1, length);\n }\n else if (data[offset] >= 0xb8) {\n const lengthLength = data[offset] - 0xb7;\n checkOffset(offset + 1 + lengthLength);\n const length = unarrayifyInteger(data, offset + 1, lengthLength);\n checkOffset(offset + 1 + lengthLength + length);\n const result = hexlify(data.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length));\n return { consumed: (1 + lengthLength + length), result: result };\n }\n else if (data[offset] >= 0x80) {\n const length = data[offset] - 0x80;\n checkOffset(offset + 1 + length);\n const result = hexlify(data.slice(offset + 1, offset + 1 + length));\n return { consumed: (1 + length), result: result };\n }\n return { consumed: 1, result: hexlifyByte(data[offset]) };\n}\n/**\n * Decodes %%data%% into the structured data it represents.\n */\nexport function decodeRlp(_data) {\n const data = getBytes(_data, \"data\");\n const decoded = _decode(data, 0);\n assertArgument(decoded.consumed === data.length, \"unexpected junk after rlp payload\", \"data\", _data);\n return decoded.result;\n}\n//# sourceMappingURL=rlp-decode.js.map","//See: https://github.com/ethereum/wiki/wiki/RLP\nimport { getBytes } from \"./data.js\";\nfunction arrayifyInteger(value) {\n const result = [];\n while (value) {\n result.unshift(value & 0xff);\n value >>= 8;\n }\n return result;\n}\nfunction _encode(object) {\n if (Array.isArray(object)) {\n let payload = [];\n object.forEach(function (child) {\n payload = payload.concat(_encode(child));\n });\n if (payload.length <= 55) {\n payload.unshift(0xc0 + payload.length);\n return payload;\n }\n const length = arrayifyInteger(payload.length);\n length.unshift(0xf7 + length.length);\n return length.concat(payload);\n }\n const data = Array.prototype.slice.call(getBytes(object, \"object\"));\n if (data.length === 1 && data[0] <= 0x7f) {\n return data;\n }\n else if (data.length <= 55) {\n data.unshift(0x80 + data.length);\n return data;\n }\n const length = arrayifyInteger(data.length);\n length.unshift(0xb7 + length.length);\n return length.concat(data);\n}\nconst nibbles = \"0123456789abcdef\";\n/**\n * Encodes %%object%% as an RLP-encoded [[DataHexString]].\n */\nexport function encodeRlp(object) {\n let result = \"0x\";\n for (const v of _encode(object)) {\n result += nibbles[v >> 4];\n result += nibbles[v & 0xf];\n }\n return result;\n}\n//# sourceMappingURL=rlp-encode.js.map","/**\n * Most interactions with Ethereum requires integer values, which use\n * the smallest magnitude unit.\n *\n * For example, imagine dealing with dollars and cents. Since dollars\n * are divisible, non-integer values are possible, such as ``$10.77``.\n * By using the smallest indivisible unit (i.e. cents), the value can\n * be kept as the integer ``1077``.\n *\n * When receiving decimal input from the user (as a decimal string),\n * the value should be converted to an integer and when showing a user\n * a value, the integer value should be converted to a decimal string.\n *\n * This creates a clear distinction, between values to be used by code\n * (integers) and values used for display logic to users (decimals).\n *\n * The native unit in Ethereum, //ether// is divisible to 18 decimal places,\n * where each individual unit is called a //wei//.\n *\n * @_subsection api/utils:Unit Conversion [about-units]\n */\nimport { assertArgument } from \"./errors.js\";\nimport { FixedNumber } from \"./fixednumber.js\";\nimport { getNumber } from \"./maths.js\";\nconst names = [\n \"wei\",\n \"kwei\",\n \"mwei\",\n \"gwei\",\n \"szabo\",\n \"finney\",\n \"ether\",\n];\n/**\n * Converts %%value%% into a //decimal string//, assuming %%unit%% decimal\n * places. The %%unit%% may be the number of decimal places or the name of\n * a unit (e.g. ``\"gwei\"`` for 9 decimal places).\n *\n */\nexport function formatUnits(value, unit) {\n let decimals = 18;\n if (typeof (unit) === \"string\") {\n const index = names.indexOf(unit);\n assertArgument(index >= 0, \"invalid unit\", \"unit\", unit);\n decimals = 3 * index;\n }\n else if (unit != null) {\n decimals = getNumber(unit, \"unit\");\n }\n return FixedNumber.fromValue(value, decimals, { decimals, width: 512 }).toString();\n}\n/**\n * Converts the //decimal string// %%value%% to a BigInt, assuming\n * %%unit%% decimal places. The %%unit%% may the number of decimal places\n * or the name of a unit (e.g. ``\"gwei\"`` for 9 decimal places).\n */\nexport function parseUnits(value, unit) {\n assertArgument(typeof (value) === \"string\", \"value must be a string\", \"value\", value);\n let decimals = 18;\n if (typeof (unit) === \"string\") {\n const index = names.indexOf(unit);\n assertArgument(index >= 0, \"invalid unit\", \"unit\", unit);\n decimals = 3 * index;\n }\n else if (unit != null) {\n decimals = getNumber(unit, \"unit\");\n }\n return FixedNumber.fromString(value, { decimals, width: 512 }).value;\n}\n/**\n * Converts %%value%% into a //decimal string// using 18 decimal places.\n */\nexport function formatEther(wei) {\n return formatUnits(wei, 18);\n}\n/**\n * Converts the //decimal string// %%ether%% to a BigInt, using 18\n * decimal places.\n */\nexport function parseEther(ether) {\n return parseUnits(ether, 18);\n}\n//# sourceMappingURL=units.js.map","/**\n * Explain UUID and link to RFC here.\n *\n * @_subsection: api/utils:UUID [about-uuid]\n */\nimport { getBytes, hexlify } from \"./data.js\";\n/**\n * Returns the version 4 [[link-uuid]] for the %%randomBytes%%.\n *\n * @see: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4)\n */\nexport function uuidV4(randomBytes) {\n const bytes = getBytes(randomBytes, \"randomBytes\");\n // Section: 4.1.3:\n // - time_hi_and_version[12:16] = 0b0100\n bytes[6] = (bytes[6] & 0x0f) | 0x40;\n // Section 4.4\n // - clock_seq_hi_and_reserved[6] = 0b0\n // - clock_seq_hi_and_reserved[7] = 0b1\n bytes[8] = (bytes[8] & 0x3f) | 0x80;\n const value = hexlify(bytes);\n return [\n value.substring(2, 10),\n value.substring(10, 14),\n value.substring(14, 18),\n value.substring(18, 22),\n value.substring(22, 34),\n ].join(\"-\");\n}\n//# sourceMappingURL=uuid.js.map","import { defineProperties, concat, getBytesCopy, getNumber, hexlify, toBeArray, toBigInt, toNumber, assert, assertArgument\n/*, isError*/\n } from \"../../utils/index.js\";\n/**\n * @_ignore:\n */\nexport const WordSize = 32;\nconst Padding = new Uint8Array(WordSize);\n// Properties used to immediate pass through to the underlying object\n// - `then` is used to detect if an object is a Promise for await\nconst passProperties = [\"then\"];\nconst _guard = {};\nconst resultNames = new WeakMap();\nfunction getNames(result) {\n return resultNames.get(result);\n}\nfunction setNames(result, names) {\n resultNames.set(result, names);\n}\nfunction throwError(name, error) {\n const wrapped = new Error(`deferred error during ABI decoding triggered accessing ${name}`);\n wrapped.error = error;\n throw wrapped;\n}\nfunction toObject(names, items, deep) {\n if (names.indexOf(null) >= 0) {\n return items.map((item, index) => {\n if (item instanceof Result) {\n return toObject(getNames(item), item, deep);\n }\n return item;\n });\n }\n return names.reduce((accum, name, index) => {\n let item = items.getValue(name);\n if (!(name in accum)) {\n if (deep && item instanceof Result) {\n item = toObject(getNames(item), item, deep);\n }\n accum[name] = item;\n }\n return accum;\n }, {});\n}\n/**\n * A [[Result]] is a sub-class of Array, which allows accessing any\n * of its values either positionally by its index or, if keys are\n * provided by its name.\n *\n * @_docloc: api/abi\n */\nexport class Result extends Array {\n // No longer used; but cannot be removed as it will remove the\n // #private field from the .d.ts which may break backwards\n // compatibility\n #names;\n /**\n * @private\n */\n constructor(...args) {\n // To properly sub-class Array so the other built-in\n // functions work, the constructor has to behave fairly\n // well. So, in the event we are created via fromItems()\n // we build the read-only Result object we want, but on\n // any other input, we use the default constructor\n // constructor(guard: any, items: Array, keys?: Array);\n const guard = args[0];\n let items = args[1];\n let names = (args[2] || []).slice();\n let wrap = true;\n if (guard !== _guard) {\n items = args;\n names = [];\n wrap = false;\n }\n // Can't just pass in ...items since an array of length 1\n // is a special case in the super.\n super(items.length);\n items.forEach((item, index) => { this[index] = item; });\n // Find all unique keys\n const nameCounts = names.reduce((accum, name) => {\n if (typeof (name) === \"string\") {\n accum.set(name, (accum.get(name) || 0) + 1);\n }\n return accum;\n }, (new Map()));\n // Remove any key thats not unique\n setNames(this, Object.freeze(items.map((item, index) => {\n const name = names[index];\n if (name != null && nameCounts.get(name) === 1) {\n return name;\n }\n return null;\n })));\n // Dummy operations to prevent TypeScript from complaining\n this.#names = [];\n if (this.#names == null) {\n void (this.#names);\n }\n if (!wrap) {\n return;\n }\n // A wrapped Result is immutable\n Object.freeze(this);\n // Proxy indices and names so we can trap deferred errors\n const proxy = new Proxy(this, {\n get: (target, prop, receiver) => {\n if (typeof (prop) === \"string\") {\n // Index accessor\n if (prop.match(/^[0-9]+$/)) {\n const index = getNumber(prop, \"%index\");\n if (index < 0 || index >= this.length) {\n throw new RangeError(\"out of result range\");\n }\n const item = target[index];\n if (item instanceof Error) {\n throwError(`index ${index}`, item);\n }\n return item;\n }\n // Pass important checks (like `then` for Promise) through\n if (passProperties.indexOf(prop) >= 0) {\n return Reflect.get(target, prop, receiver);\n }\n const value = target[prop];\n if (value instanceof Function) {\n // Make sure functions work with private variables\n // See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy#no_private_property_forwarding\n return function (...args) {\n return value.apply((this === receiver) ? target : this, args);\n };\n }\n else if (!(prop in target)) {\n // Possible name accessor\n return target.getValue.apply((this === receiver) ? target : this, [prop]);\n }\n }\n return Reflect.get(target, prop, receiver);\n }\n });\n setNames(proxy, getNames(this));\n return proxy;\n }\n /**\n * Returns the Result as a normal Array. If %%deep%%, any children\n * which are Result objects are also converted to a normal Array.\n *\n * This will throw if there are any outstanding deferred\n * errors.\n */\n toArray(deep) {\n const result = [];\n this.forEach((item, index) => {\n if (item instanceof Error) {\n throwError(`index ${index}`, item);\n }\n if (deep && item instanceof Result) {\n item = item.toArray(deep);\n }\n result.push(item);\n });\n return result;\n }\n /**\n * Returns the Result as an Object with each name-value pair. If\n * %%deep%%, any children which are Result objects are also\n * converted to an Object.\n *\n * This will throw if any value is unnamed, or if there are\n * any outstanding deferred errors.\n */\n toObject(deep) {\n const names = getNames(this);\n return names.reduce((accum, name, index) => {\n assert(name != null, `value at index ${index} unnamed`, \"UNSUPPORTED_OPERATION\", {\n operation: \"toObject()\"\n });\n return toObject(names, this, deep);\n }, {});\n }\n /**\n * @_ignore\n */\n slice(start, end) {\n if (start == null) {\n start = 0;\n }\n if (start < 0) {\n start += this.length;\n if (start < 0) {\n start = 0;\n }\n }\n if (end == null) {\n end = this.length;\n }\n if (end < 0) {\n end += this.length;\n if (end < 0) {\n end = 0;\n }\n }\n if (end > this.length) {\n end = this.length;\n }\n const _names = getNames(this);\n const result = [], names = [];\n for (let i = start; i < end; i++) {\n result.push(this[i]);\n names.push(_names[i]);\n }\n return new Result(_guard, result, names);\n }\n /**\n * @_ignore\n */\n filter(callback, thisArg) {\n const _names = getNames(this);\n const result = [], names = [];\n for (let i = 0; i < this.length; i++) {\n const item = this[i];\n if (item instanceof Error) {\n throwError(`index ${i}`, item);\n }\n if (callback.call(thisArg, item, i, this)) {\n result.push(item);\n names.push(_names[i]);\n }\n }\n return new Result(_guard, result, names);\n }\n /**\n * @_ignore\n */\n map(callback, thisArg) {\n const result = [];\n for (let i = 0; i < this.length; i++) {\n const item = this[i];\n if (item instanceof Error) {\n throwError(`index ${i}`, item);\n }\n result.push(callback.call(thisArg, item, i, this));\n }\n return result;\n }\n /**\n * Returns the value for %%name%%.\n *\n * Since it is possible to have a key whose name conflicts with\n * a method on a [[Result]] or its superclass Array, or any\n * JavaScript keyword, this ensures all named values are still\n * accessible by name.\n */\n getValue(name) {\n const index = getNames(this).indexOf(name);\n if (index === -1) {\n return undefined;\n }\n const value = this[index];\n if (value instanceof Error) {\n throwError(`property ${JSON.stringify(name)}`, value.error);\n }\n return value;\n }\n /**\n * Creates a new [[Result]] for %%items%% with each entry\n * also accessible by its corresponding name in %%keys%%.\n */\n static fromItems(items, keys) {\n return new Result(_guard, items, keys);\n }\n}\n/**\n * Returns all errors found in a [[Result]].\n *\n * Since certain errors encountered when creating a [[Result]] do\n * not impact the ability to continue parsing data, they are\n * deferred until they are actually accessed. Hence a faulty string\n * in an Event that is never used does not impact the program flow.\n *\n * However, sometimes it may be useful to access, identify or\n * validate correctness of a [[Result]].\n *\n * @_docloc api/abi\n */\nexport function checkResultErrors(result) {\n // Find the first error (if any)\n const errors = [];\n const checkErrors = function (path, object) {\n if (!Array.isArray(object)) {\n return;\n }\n for (let key in object) {\n const childPath = path.slice();\n childPath.push(key);\n try {\n checkErrors(childPath, object[key]);\n }\n catch (error) {\n errors.push({ path: childPath, error: error });\n }\n }\n };\n checkErrors([], result);\n return errors;\n}\nfunction getValue(value) {\n let bytes = toBeArray(value);\n assert(bytes.length <= WordSize, \"value out-of-bounds\", \"BUFFER_OVERRUN\", { buffer: bytes, length: WordSize, offset: bytes.length });\n if (bytes.length !== WordSize) {\n bytes = getBytesCopy(concat([Padding.slice(bytes.length % WordSize), bytes]));\n }\n return bytes;\n}\n/**\n * @_ignore\n */\nexport class Coder {\n // The coder name:\n // - address, uint256, tuple, array, etc.\n name;\n // The fully expanded type, including composite types:\n // - address, uint256, tuple(address,bytes), uint256[3][4][], etc.\n type;\n // The localName bound in the signature, in this example it is \"baz\":\n // - tuple(address foo, uint bar) baz\n localName;\n // Whether this type is dynamic:\n // - Dynamic: bytes, string, address[], tuple(boolean[]), etc.\n // - Not Dynamic: address, uint256, boolean[3], tuple(address, uint8)\n dynamic;\n constructor(name, type, localName, dynamic) {\n defineProperties(this, { name, type, localName, dynamic }, {\n name: \"string\", type: \"string\", localName: \"string\", dynamic: \"boolean\"\n });\n }\n _throwError(message, value) {\n assertArgument(false, message, this.localName, value);\n }\n}\n/**\n * @_ignore\n */\nexport class Writer {\n // An array of WordSize lengthed objects to concatenation\n #data;\n #dataLength;\n constructor() {\n this.#data = [];\n this.#dataLength = 0;\n }\n get data() {\n return concat(this.#data);\n }\n get length() { return this.#dataLength; }\n #writeData(data) {\n this.#data.push(data);\n this.#dataLength += data.length;\n return data.length;\n }\n appendWriter(writer) {\n return this.#writeData(getBytesCopy(writer.data));\n }\n // Arrayish item; pad on the right to *nearest* WordSize\n writeBytes(value) {\n let bytes = getBytesCopy(value);\n const paddingOffset = bytes.length % WordSize;\n if (paddingOffset) {\n bytes = getBytesCopy(concat([bytes, Padding.slice(paddingOffset)]));\n }\n return this.#writeData(bytes);\n }\n // Numeric item; pad on the left *to* WordSize\n writeValue(value) {\n return this.#writeData(getValue(value));\n }\n // Inserts a numeric place-holder, returning a callback that can\n // be used to asjust the value later\n writeUpdatableValue() {\n const offset = this.#data.length;\n this.#data.push(Padding);\n this.#dataLength += WordSize;\n return (value) => {\n this.#data[offset] = getValue(value);\n };\n }\n}\n/**\n * @_ignore\n */\nexport class Reader {\n // Allows incomplete unpadded data to be read; otherwise an error\n // is raised if attempting to overrun the buffer. This is required\n // to deal with an old Solidity bug, in which event data for\n // external (not public thoguh) was tightly packed.\n allowLoose;\n #data;\n #offset;\n #bytesRead;\n #parent;\n #maxInflation;\n constructor(data, allowLoose, maxInflation) {\n defineProperties(this, { allowLoose: !!allowLoose });\n this.#data = getBytesCopy(data);\n this.#bytesRead = 0;\n this.#parent = null;\n this.#maxInflation = (maxInflation != null) ? maxInflation : 1024;\n this.#offset = 0;\n }\n get data() { return hexlify(this.#data); }\n get dataLength() { return this.#data.length; }\n get consumed() { return this.#offset; }\n get bytes() { return new Uint8Array(this.#data); }\n #incrementBytesRead(count) {\n if (this.#parent) {\n return this.#parent.#incrementBytesRead(count);\n }\n this.#bytesRead += count;\n // Check for excessive inflation (see: #4537)\n assert(this.#maxInflation < 1 || this.#bytesRead <= this.#maxInflation * this.dataLength, `compressed ABI data exceeds inflation ratio of ${this.#maxInflation} ( see: https:/\\/github.com/ethers-io/ethers.js/issues/4537 )`, \"BUFFER_OVERRUN\", {\n buffer: getBytesCopy(this.#data), offset: this.#offset,\n length: count, info: {\n bytesRead: this.#bytesRead,\n dataLength: this.dataLength\n }\n });\n }\n #peekBytes(offset, length, loose) {\n let alignedLength = Math.ceil(length / WordSize) * WordSize;\n if (this.#offset + alignedLength > this.#data.length) {\n if (this.allowLoose && loose && this.#offset + length <= this.#data.length) {\n alignedLength = length;\n }\n else {\n assert(false, \"data out-of-bounds\", \"BUFFER_OVERRUN\", {\n buffer: getBytesCopy(this.#data),\n length: this.#data.length,\n offset: this.#offset + alignedLength\n });\n }\n }\n return this.#data.slice(this.#offset, this.#offset + alignedLength);\n }\n // Create a sub-reader with the same underlying data, but offset\n subReader(offset) {\n const reader = new Reader(this.#data.slice(this.#offset + offset), this.allowLoose, this.#maxInflation);\n reader.#parent = this;\n return reader;\n }\n // Read bytes\n readBytes(length, loose) {\n let bytes = this.#peekBytes(0, length, !!loose);\n this.#incrementBytesRead(length);\n this.#offset += bytes.length;\n // @TODO: Make sure the length..end bytes are all 0?\n return bytes.slice(0, length);\n }\n // Read a numeric values\n readValue() {\n return toBigInt(this.readBytes(WordSize));\n }\n readIndex() {\n return toNumber(this.readBytes(WordSize));\n }\n}\n//# sourceMappingURL=abstract-coder.js.map","function number(n) {\n if (!Number.isSafeInteger(n) || n < 0)\n throw new Error(`Wrong positive integer: ${n}`);\n}\nfunction bool(b) {\n if (typeof b !== 'boolean')\n throw new Error(`Expected boolean, not ${b}`);\n}\nfunction bytes(b, ...lengths) {\n if (!(b instanceof Uint8Array))\n throw new Error('Expected Uint8Array');\n if (lengths.length > 0 && !lengths.includes(b.length))\n throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`);\n}\nfunction hash(hash) {\n if (typeof hash !== 'function' || typeof hash.create !== 'function')\n throw new Error('Hash should be wrapped by utils.wrapConstructor');\n number(hash.outputLen);\n number(hash.blockLen);\n}\nfunction exists(instance, checkFinished = true) {\n if (instance.destroyed)\n throw new Error('Hash instance has been destroyed');\n if (checkFinished && instance.finished)\n throw new Error('Hash#digest() has already been called');\n}\nfunction output(out, instance) {\n bytes(out);\n const min = instance.outputLen;\n if (out.length < min) {\n throw new Error(`digestInto() expects output buffer of length at least ${min}`);\n }\n}\nexport { number, bool, bytes, hash, exists, output };\nconst assert = { number, bool, bytes, hash, exists, output };\nexport default assert;\n//# sourceMappingURL=_assert.js.map","export const crypto = typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined;\n//# sourceMappingURL=crypto.js.map","/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+.\n// node.js versions earlier than v19 don't declare it in global scope.\n// For node.js, package.json#exports field mapping rewrites import\n// from `crypto` to `cryptoNode`, which imports native module.\n// Makes the utils un-importable in browsers without a bundler.\n// Once node.js 18 is deprecated, we can just drop the import.\nimport { crypto } from '@noble/hashes/crypto';\nconst u8a = (a) => a instanceof Uint8Array;\n// Cast array to different type\nexport const u8 = (arr) => new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\nexport const u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n// Cast array to view\nexport const createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n// The rotate right (circular right shift) operation for uint32\nexport const rotr = (word, shift) => (word << (32 - shift)) | (word >>> shift);\n// big-endian hardware is rare. Just in case someone still decides to run hashes:\n// early-throw an error because we don't support BE yet.\nexport const isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44;\nif (!isLE)\n throw new Error('Non little-endian hardware is not supported');\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));\n/**\n * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'\n */\nexport function bytesToHex(bytes) {\n if (!u8a(bytes))\n throw new Error('Uint8Array expected');\n // pre-caching improves the speed 6x\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += hexes[bytes[i]];\n }\n return hex;\n}\n/**\n * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n */\nexport function hexToBytes(hex) {\n if (typeof hex !== 'string')\n throw new Error('hex string expected, got ' + typeof hex);\n const len = hex.length;\n if (len % 2)\n throw new Error('padded hex string expected, got unpadded hex of length ' + len);\n const array = new Uint8Array(len / 2);\n for (let i = 0; i < array.length; i++) {\n const j = i * 2;\n const hexByte = hex.slice(j, j + 2);\n const byte = Number.parseInt(hexByte, 16);\n if (Number.isNaN(byte) || byte < 0)\n throw new Error('Invalid byte sequence');\n array[i] = byte;\n }\n return array;\n}\n// There is no setImmediate in browser and setTimeout is slow.\n// call of async fn will return Promise, which will be fullfiled only on\n// next scheduler queue processing step and this is exactly what we need.\nexport const nextTick = async () => { };\n// Returns control to thread each 'tick' ms to avoid blocking\nexport async function asyncLoop(iters, tick, cb) {\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick)\n continue;\n await nextTick();\n ts += diff;\n }\n}\n/**\n * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99])\n */\nexport function utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new Error(`utf8ToBytes expected string, got ${typeof str}`);\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\n/**\n * Normalizes (non-hex) string or Uint8Array to Uint8Array.\n * Warning: when Uint8Array is passed, it would NOT get copied.\n * Keep in mind for future mutable operations.\n */\nexport function toBytes(data) {\n if (typeof data === 'string')\n data = utf8ToBytes(data);\n if (!u8a(data))\n throw new Error(`expected Uint8Array, got ${typeof data}`);\n return data;\n}\n/**\n * Copies several Uint8Arrays into one.\n */\nexport function concatBytes(...arrays) {\n const r = new Uint8Array(arrays.reduce((sum, a) => sum + a.length, 0));\n let pad = 0; // walk through each item, ensure they have proper type\n arrays.forEach((a) => {\n if (!u8a(a))\n throw new Error('Uint8Array expected');\n r.set(a, pad);\n pad += a.length;\n });\n return r;\n}\n// For runtime check if class implements interface\nexport class Hash {\n // Safe version that clones internal state\n clone() {\n return this._cloneInto();\n }\n}\nconst toStr = {}.toString;\nexport function checkOpts(defaults, opts) {\n if (opts !== undefined && toStr.call(opts) !== '[object Object]')\n throw new Error('Options should be object or undefined');\n const merged = Object.assign(defaults, opts);\n return merged;\n}\nexport function wrapConstructor(hashCons) {\n const hashC = (msg) => hashCons().update(toBytes(msg)).digest();\n const tmp = hashCons();\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = () => hashCons();\n return hashC;\n}\nexport function wrapConstructorWithOpts(hashCons) {\n const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({});\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n return hashC;\n}\nexport function wrapXOFConstructorWithOpts(hashCons) {\n const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({});\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n return hashC;\n}\n/**\n * Secure PRNG. Uses `crypto.getRandomValues`, which defers to OS.\n */\nexport function randomBytes(bytesLength = 32) {\n if (crypto && typeof crypto.getRandomValues === 'function') {\n return crypto.getRandomValues(new Uint8Array(bytesLength));\n }\n throw new Error('crypto.getRandomValues must be defined');\n}\n//# sourceMappingURL=utils.js.map","import { hash as assertHash, bytes as assertBytes, exists as assertExists } from './_assert.js';\nimport { Hash, toBytes } from './utils.js';\n// HMAC (RFC 2104)\nexport class HMAC extends Hash {\n constructor(hash, _key) {\n super();\n this.finished = false;\n this.destroyed = false;\n assertHash(hash);\n const key = toBytes(_key);\n this.iHash = hash.create();\n if (typeof this.iHash.update !== 'function')\n throw new Error('Expected instance of class which extends utils.Hash');\n this.blockLen = this.iHash.blockLen;\n this.outputLen = this.iHash.outputLen;\n const blockLen = this.blockLen;\n const pad = new Uint8Array(blockLen);\n // blockLen can be bigger than outputLen\n pad.set(key.length > blockLen ? hash.create().update(key).digest() : key);\n for (let i = 0; i < pad.length; i++)\n pad[i] ^= 0x36;\n this.iHash.update(pad);\n // By doing update (processing of first block) of outer hash here we can re-use it between multiple calls via clone\n this.oHash = hash.create();\n // Undo internal XOR && apply outer XOR\n for (let i = 0; i < pad.length; i++)\n pad[i] ^= 0x36 ^ 0x5c;\n this.oHash.update(pad);\n pad.fill(0);\n }\n update(buf) {\n assertExists(this);\n this.iHash.update(buf);\n return this;\n }\n digestInto(out) {\n assertExists(this);\n assertBytes(out, this.outputLen);\n this.finished = true;\n this.iHash.digestInto(out);\n this.oHash.update(out);\n this.oHash.digestInto(out);\n this.destroy();\n }\n digest() {\n const out = new Uint8Array(this.oHash.outputLen);\n this.digestInto(out);\n return out;\n }\n _cloneInto(to) {\n // Create new instance without calling constructor since key already in state and we don't know it.\n to || (to = Object.create(Object.getPrototypeOf(this), {}));\n const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this;\n to = to;\n to.finished = finished;\n to.destroyed = destroyed;\n to.blockLen = blockLen;\n to.outputLen = outputLen;\n to.oHash = oHash._cloneInto(to.oHash);\n to.iHash = iHash._cloneInto(to.iHash);\n return to;\n }\n destroy() {\n this.destroyed = true;\n this.oHash.destroy();\n this.iHash.destroy();\n }\n}\n/**\n * HMAC: RFC2104 message authentication code.\n * @param hash - function that would be used e.g. sha256\n * @param key - message key\n * @param message - message data\n */\nexport const hmac = (hash, key, message) => new HMAC(hash, key).update(message).digest();\nhmac.create = (hash, key) => new HMAC(hash, key);\n//# sourceMappingURL=hmac.js.map","import { hash as assertHash, number as assertNumber } from './_assert.js';\nimport { hmac } from './hmac.js';\nimport { createView, toBytes, checkOpts, asyncLoop } from './utils.js';\n// Common prologue and epilogue for sync/async functions\nfunction pbkdf2Init(hash, _password, _salt, _opts) {\n assertHash(hash);\n const opts = checkOpts({ dkLen: 32, asyncTick: 10 }, _opts);\n const { c, dkLen, asyncTick } = opts;\n assertNumber(c);\n assertNumber(dkLen);\n assertNumber(asyncTick);\n if (c < 1)\n throw new Error('PBKDF2: iterations (c) should be >= 1');\n const password = toBytes(_password);\n const salt = toBytes(_salt);\n // DK = PBKDF2(PRF, Password, Salt, c, dkLen);\n const DK = new Uint8Array(dkLen);\n // U1 = PRF(Password, Salt + INT_32_BE(i))\n const PRF = hmac.create(hash, password);\n const PRFSalt = PRF._cloneInto().update(salt);\n return { c, dkLen, asyncTick, DK, PRF, PRFSalt };\n}\nfunction pbkdf2Output(PRF, PRFSalt, DK, prfW, u) {\n PRF.destroy();\n PRFSalt.destroy();\n if (prfW)\n prfW.destroy();\n u.fill(0);\n return DK;\n}\n/**\n * PBKDF2-HMAC: RFC 2898 key derivation function\n * @param hash - hash function that would be used e.g. sha256\n * @param password - password from which a derived key is generated\n * @param salt - cryptographic salt\n * @param opts - {c, dkLen} where c is work factor and dkLen is output message size\n */\nexport function pbkdf2(hash, password, salt, opts) {\n const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts);\n let prfW; // Working copy\n const arr = new Uint8Array(4);\n const view = createView(arr);\n const u = new Uint8Array(PRF.outputLen);\n // DK = T1 + T2 + ⋯ + Tdklen/hlen\n for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) {\n // Ti = F(Password, Salt, c, i)\n const Ti = DK.subarray(pos, pos + PRF.outputLen);\n view.setInt32(0, ti, false);\n // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc\n // U1 = PRF(Password, Salt + INT_32_BE(i))\n (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u);\n Ti.set(u.subarray(0, Ti.length));\n for (let ui = 1; ui < c; ui++) {\n // Uc = PRF(Password, Uc−1)\n PRF._cloneInto(prfW).update(u).digestInto(u);\n for (let i = 0; i < Ti.length; i++)\n Ti[i] ^= u[i];\n }\n }\n return pbkdf2Output(PRF, PRFSalt, DK, prfW, u);\n}\nexport async function pbkdf2Async(hash, password, salt, opts) {\n const { c, dkLen, asyncTick, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts);\n let prfW; // Working copy\n const arr = new Uint8Array(4);\n const view = createView(arr);\n const u = new Uint8Array(PRF.outputLen);\n // DK = T1 + T2 + ⋯ + Tdklen/hlen\n for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) {\n // Ti = F(Password, Salt, c, i)\n const Ti = DK.subarray(pos, pos + PRF.outputLen);\n view.setInt32(0, ti, false);\n // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc\n // U1 = PRF(Password, Salt + INT_32_BE(i))\n (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u);\n Ti.set(u.subarray(0, Ti.length));\n await asyncLoop(c - 1, asyncTick, () => {\n // Uc = PRF(Password, Uc−1)\n PRF._cloneInto(prfW).update(u).digestInto(u);\n for (let i = 0; i < Ti.length; i++)\n Ti[i] ^= u[i];\n });\n }\n return pbkdf2Output(PRF, PRFSalt, DK, prfW, u);\n}\n//# sourceMappingURL=pbkdf2.js.map","import { exists, output } from './_assert.js';\nimport { Hash, createView, toBytes } from './utils.js';\n// Polyfill for Safari 14\nfunction setBigUint64(view, byteOffset, value, isLE) {\n if (typeof view.setBigUint64 === 'function')\n return view.setBigUint64(byteOffset, value, isLE);\n const _32n = BigInt(32);\n const _u32_max = BigInt(0xffffffff);\n const wh = Number((value >> _32n) & _u32_max);\n const wl = Number(value & _u32_max);\n const h = isLE ? 4 : 0;\n const l = isLE ? 0 : 4;\n view.setUint32(byteOffset + h, wh, isLE);\n view.setUint32(byteOffset + l, wl, isLE);\n}\n// Base SHA2 class (RFC 6234)\nexport class SHA2 extends Hash {\n constructor(blockLen, outputLen, padOffset, isLE) {\n super();\n this.blockLen = blockLen;\n this.outputLen = outputLen;\n this.padOffset = padOffset;\n this.isLE = isLE;\n this.finished = false;\n this.length = 0;\n this.pos = 0;\n this.destroyed = false;\n this.buffer = new Uint8Array(blockLen);\n this.view = createView(this.buffer);\n }\n update(data) {\n exists(this);\n const { view, buffer, blockLen } = this;\n data = toBytes(data);\n const len = data.length;\n for (let pos = 0; pos < len;) {\n const take = Math.min(blockLen - this.pos, len - pos);\n // Fast path: we have at least one block in input, cast it to view and process\n if (take === blockLen) {\n const dataView = createView(data);\n for (; blockLen <= len - pos; pos += blockLen)\n this.process(dataView, pos);\n continue;\n }\n buffer.set(data.subarray(pos, pos + take), this.pos);\n this.pos += take;\n pos += take;\n if (this.pos === blockLen) {\n this.process(view, 0);\n this.pos = 0;\n }\n }\n this.length += data.length;\n this.roundClean();\n return this;\n }\n digestInto(out) {\n exists(this);\n output(out, this);\n this.finished = true;\n // Padding\n // We can avoid allocation of buffer for padding completely if it\n // was previously not allocated here. But it won't change performance.\n const { buffer, view, blockLen, isLE } = this;\n let { pos } = this;\n // append the bit '1' to the message\n buffer[pos++] = 0b10000000;\n this.buffer.subarray(pos).fill(0);\n // we have less than padOffset left in buffer, so we cannot put length in current block, need process it and pad again\n if (this.padOffset > blockLen - pos) {\n this.process(view, 0);\n pos = 0;\n }\n // Pad until full block byte with zeros\n for (let i = pos; i < blockLen; i++)\n buffer[i] = 0;\n // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that\n // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen.\n // So we just write lowest 64 bits of that value.\n setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE);\n this.process(view, 0);\n const oview = createView(out);\n const len = this.outputLen;\n // NOTE: we do division by 4 later, which should be fused in single op with modulo by JIT\n if (len % 4)\n throw new Error('_sha2: outputLen should be aligned to 32bit');\n const outLen = len / 4;\n const state = this.get();\n if (outLen > state.length)\n throw new Error('_sha2: outputLen bigger than state');\n for (let i = 0; i < outLen; i++)\n oview.setUint32(4 * i, state[i], isLE);\n }\n digest() {\n const { buffer, outputLen } = this;\n this.digestInto(buffer);\n const res = buffer.slice(0, outputLen);\n this.destroy();\n return res;\n }\n _cloneInto(to) {\n to || (to = new this.constructor());\n to.set(...this.get());\n const { blockLen, buffer, length, finished, destroyed, pos } = this;\n to.length = length;\n to.pos = pos;\n to.finished = finished;\n to.destroyed = destroyed;\n if (length % blockLen)\n to.buffer.set(buffer);\n return to;\n }\n}\n//# sourceMappingURL=_sha2.js.map","import { SHA2 } from './_sha2.js';\nimport { rotr, wrapConstructor } from './utils.js';\n// SHA2-256 need to try 2^128 hashes to execute birthday attack.\n// BTC network is doing 2^67 hashes/sec as per early 2023.\n// Choice: a ? b : c\nconst Chi = (a, b, c) => (a & b) ^ (~a & c);\n// Majority function, true if any two inpust is true\nconst Maj = (a, b, c) => (a & b) ^ (a & c) ^ (b & c);\n// Round constants:\n// first 32 bits of the fractional parts of the cube roots of the first 64 primes 2..311)\n// prettier-ignore\nconst SHA256_K = /* @__PURE__ */ new Uint32Array([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n]);\n// Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19):\n// prettier-ignore\nconst IV = /* @__PURE__ */ new Uint32Array([\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19\n]);\n// Temporary buffer, not used to store anything between runs\n// Named this way because it matches specification.\nconst SHA256_W = /* @__PURE__ */ new Uint32Array(64);\nclass SHA256 extends SHA2 {\n constructor() {\n super(64, 32, 8, false);\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n this.A = IV[0] | 0;\n this.B = IV[1] | 0;\n this.C = IV[2] | 0;\n this.D = IV[3] | 0;\n this.E = IV[4] | 0;\n this.F = IV[5] | 0;\n this.G = IV[6] | 0;\n this.H = IV[7] | 0;\n }\n get() {\n const { A, B, C, D, E, F, G, H } = this;\n return [A, B, C, D, E, F, G, H];\n }\n // prettier-ignore\n set(A, B, C, D, E, F, G, H) {\n this.A = A | 0;\n this.B = B | 0;\n this.C = C | 0;\n this.D = D | 0;\n this.E = E | 0;\n this.F = F | 0;\n this.G = G | 0;\n this.H = H | 0;\n }\n process(view, offset) {\n // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4)\n SHA256_W[i] = view.getUint32(offset, false);\n for (let i = 16; i < 64; i++) {\n const W15 = SHA256_W[i - 15];\n const W2 = SHA256_W[i - 2];\n const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3);\n const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10);\n SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0;\n }\n // Compression function main loop, 64 rounds\n let { A, B, C, D, E, F, G, H } = this;\n for (let i = 0; i < 64; i++) {\n const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);\n const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22);\n const T2 = (sigma0 + Maj(A, B, C)) | 0;\n H = G;\n G = F;\n F = E;\n E = (D + T1) | 0;\n D = C;\n C = B;\n B = A;\n A = (T1 + T2) | 0;\n }\n // Add the compressed chunk to the current hash value\n A = (A + this.A) | 0;\n B = (B + this.B) | 0;\n C = (C + this.C) | 0;\n D = (D + this.D) | 0;\n E = (E + this.E) | 0;\n F = (F + this.F) | 0;\n G = (G + this.G) | 0;\n H = (H + this.H) | 0;\n this.set(A, B, C, D, E, F, G, H);\n }\n roundClean() {\n SHA256_W.fill(0);\n }\n destroy() {\n this.set(0, 0, 0, 0, 0, 0, 0, 0);\n this.buffer.fill(0);\n }\n}\n// Constants from https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\nclass SHA224 extends SHA256 {\n constructor() {\n super();\n this.A = 0xc1059ed8 | 0;\n this.B = 0x367cd507 | 0;\n this.C = 0x3070dd17 | 0;\n this.D = 0xf70e5939 | 0;\n this.E = 0xffc00b31 | 0;\n this.F = 0x68581511 | 0;\n this.G = 0x64f98fa7 | 0;\n this.H = 0xbefa4fa4 | 0;\n this.outputLen = 28;\n }\n}\n/**\n * SHA2-256 hash function\n * @param message - data that would be hashed\n */\nexport const sha256 = /* @__PURE__ */ wrapConstructor(() => new SHA256());\nexport const sha224 = /* @__PURE__ */ wrapConstructor(() => new SHA224());\n//# sourceMappingURL=sha256.js.map","const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);\nconst _32n = /* @__PURE__ */ BigInt(32);\n// We are not using BigUint64Array, because they are extremely slow as per 2022\nfunction fromBig(n, le = false) {\n if (le)\n return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };\n return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };\n}\nfunction split(lst, le = false) {\n let Ah = new Uint32Array(lst.length);\n let Al = new Uint32Array(lst.length);\n for (let i = 0; i < lst.length; i++) {\n const { h, l } = fromBig(lst[i], le);\n [Ah[i], Al[i]] = [h, l];\n }\n return [Ah, Al];\n}\nconst toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);\n// for Shift in [0, 32)\nconst shrSH = (h, _l, s) => h >>> s;\nconst shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// Right rotate for Shift in [1, 32)\nconst rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s));\nconst rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// Right rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32));\nconst rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s));\n// Right rotate for shift===32 (just swaps l&h)\nconst rotr32H = (_h, l) => l;\nconst rotr32L = (h, _l) => h;\n// Left rotate for Shift in [1, 32)\nconst rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s));\nconst rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s));\n// Left rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s));\nconst rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s));\n// JS uses 32-bit signed integers for bitwise operations which means we cannot\n// simple take carry out of low bit sum by shift, we need to use division.\nfunction add(Ah, Al, Bh, Bl) {\n const l = (Al >>> 0) + (Bl >>> 0);\n return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };\n}\n// Addition with more than 2 elements\nconst add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);\nconst add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0;\nconst add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);\nconst add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0;\nconst add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);\nconst add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;\n// prettier-ignore\nexport { fromBig, split, toBig, shrSH, shrSL, rotrSH, rotrSL, rotrBH, rotrBL, rotr32H, rotr32L, rotlSH, rotlSL, rotlBH, rotlBL, add, add3L, add3H, add4L, add4H, add5H, add5L, };\n// prettier-ignore\nconst u64 = {\n fromBig, split, toBig,\n shrSH, shrSL,\n rotrSH, rotrSL, rotrBH, rotrBL,\n rotr32H, rotr32L,\n rotlSH, rotlSL, rotlBH, rotlBL,\n add, add3L, add3H, add4L, add4H, add5H, add5L,\n};\nexport default u64;\n//# sourceMappingURL=_u64.js.map","import { SHA2 } from './_sha2.js';\nimport u64 from './_u64.js';\nimport { wrapConstructor } from './utils.js';\n// Round contants (first 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409):\n// prettier-ignore\nconst [SHA512_Kh, SHA512_Kl] = /* @__PURE__ */ (() => u64.split([\n '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc',\n '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118',\n '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2',\n '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694',\n '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65',\n '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5',\n '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4',\n '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70',\n '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df',\n '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b',\n '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30',\n '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8',\n '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8',\n '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3',\n '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec',\n '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b',\n '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178',\n '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b',\n '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c',\n '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817'\n].map(n => BigInt(n))))();\n// Temporary buffer, not used to store anything between runs\nconst SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);\nconst SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);\nexport class SHA512 extends SHA2 {\n constructor() {\n super(128, 64, 16, false);\n // We cannot use array here since array allows indexing by variable which means optimizer/compiler cannot use registers.\n // Also looks cleaner and easier to verify with spec.\n // Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19):\n // h -- high 32 bits, l -- low 32 bits\n this.Ah = 0x6a09e667 | 0;\n this.Al = 0xf3bcc908 | 0;\n this.Bh = 0xbb67ae85 | 0;\n this.Bl = 0x84caa73b | 0;\n this.Ch = 0x3c6ef372 | 0;\n this.Cl = 0xfe94f82b | 0;\n this.Dh = 0xa54ff53a | 0;\n this.Dl = 0x5f1d36f1 | 0;\n this.Eh = 0x510e527f | 0;\n this.El = 0xade682d1 | 0;\n this.Fh = 0x9b05688c | 0;\n this.Fl = 0x2b3e6c1f | 0;\n this.Gh = 0x1f83d9ab | 0;\n this.Gl = 0xfb41bd6b | 0;\n this.Hh = 0x5be0cd19 | 0;\n this.Hl = 0x137e2179 | 0;\n }\n // prettier-ignore\n get() {\n const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl];\n }\n // prettier-ignore\n set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) {\n this.Ah = Ah | 0;\n this.Al = Al | 0;\n this.Bh = Bh | 0;\n this.Bl = Bl | 0;\n this.Ch = Ch | 0;\n this.Cl = Cl | 0;\n this.Dh = Dh | 0;\n this.Dl = Dl | 0;\n this.Eh = Eh | 0;\n this.El = El | 0;\n this.Fh = Fh | 0;\n this.Fl = Fl | 0;\n this.Gh = Gh | 0;\n this.Gl = Gl | 0;\n this.Hh = Hh | 0;\n this.Hl = Hl | 0;\n }\n process(view, offset) {\n // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4) {\n SHA512_W_H[i] = view.getUint32(offset);\n SHA512_W_L[i] = view.getUint32((offset += 4));\n }\n for (let i = 16; i < 80; i++) {\n // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7)\n const W15h = SHA512_W_H[i - 15] | 0;\n const W15l = SHA512_W_L[i - 15] | 0;\n const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7);\n const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7);\n // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6)\n const W2h = SHA512_W_H[i - 2] | 0;\n const W2l = SHA512_W_L[i - 2] | 0;\n const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6);\n const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6);\n // SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16];\n const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);\n const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);\n SHA512_W_H[i] = SUMh | 0;\n SHA512_W_L[i] = SUMl | 0;\n }\n let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n // Compression function main loop, 80 rounds\n for (let i = 0; i < 80; i++) {\n // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41)\n const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41);\n const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41);\n //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const CHIh = (Eh & Fh) ^ (~Eh & Gh);\n const CHIl = (El & Fl) ^ (~El & Gl);\n // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i]\n // prettier-ignore\n const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);\n const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);\n const T1l = T1ll | 0;\n // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39)\n const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39);\n const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39);\n const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch);\n const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl);\n Hh = Gh | 0;\n Hl = Gl | 0;\n Gh = Fh | 0;\n Gl = Fl | 0;\n Fh = Eh | 0;\n Fl = El | 0;\n ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));\n Dh = Ch | 0;\n Dl = Cl | 0;\n Ch = Bh | 0;\n Cl = Bl | 0;\n Bh = Ah | 0;\n Bl = Al | 0;\n const All = u64.add3L(T1l, sigma0l, MAJl);\n Ah = u64.add3H(All, T1h, sigma0h, MAJh);\n Al = All | 0;\n }\n // Add the compressed chunk to the current hash value\n ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));\n ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));\n ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));\n ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));\n ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));\n ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));\n ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));\n ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));\n this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);\n }\n roundClean() {\n SHA512_W_H.fill(0);\n SHA512_W_L.fill(0);\n }\n destroy() {\n this.buffer.fill(0);\n this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n }\n}\nclass SHA512_224 extends SHA512 {\n constructor() {\n super();\n // h -- high 32 bits, l -- low 32 bits\n this.Ah = 0x8c3d37c8 | 0;\n this.Al = 0x19544da2 | 0;\n this.Bh = 0x73e19966 | 0;\n this.Bl = 0x89dcd4d6 | 0;\n this.Ch = 0x1dfab7ae | 0;\n this.Cl = 0x32ff9c82 | 0;\n this.Dh = 0x679dd514 | 0;\n this.Dl = 0x582f9fcf | 0;\n this.Eh = 0x0f6d2b69 | 0;\n this.El = 0x7bd44da8 | 0;\n this.Fh = 0x77e36f73 | 0;\n this.Fl = 0x04c48942 | 0;\n this.Gh = 0x3f9d85a8 | 0;\n this.Gl = 0x6a1d36c8 | 0;\n this.Hh = 0x1112e6ad | 0;\n this.Hl = 0x91d692a1 | 0;\n this.outputLen = 28;\n }\n}\nclass SHA512_256 extends SHA512 {\n constructor() {\n super();\n // h -- high 32 bits, l -- low 32 bits\n this.Ah = 0x22312194 | 0;\n this.Al = 0xfc2bf72c | 0;\n this.Bh = 0x9f555fa3 | 0;\n this.Bl = 0xc84c64c2 | 0;\n this.Ch = 0x2393b86b | 0;\n this.Cl = 0x6f53b151 | 0;\n this.Dh = 0x96387719 | 0;\n this.Dl = 0x5940eabd | 0;\n this.Eh = 0x96283ee2 | 0;\n this.El = 0xa88effe3 | 0;\n this.Fh = 0xbe5e1e25 | 0;\n this.Fl = 0x53863992 | 0;\n this.Gh = 0x2b0199fc | 0;\n this.Gl = 0x2c85b8aa | 0;\n this.Hh = 0x0eb72ddc | 0;\n this.Hl = 0x81c52ca2 | 0;\n this.outputLen = 32;\n }\n}\nclass SHA384 extends SHA512 {\n constructor() {\n super();\n // h -- high 32 bits, l -- low 32 bits\n this.Ah = 0xcbbb9d5d | 0;\n this.Al = 0xc1059ed8 | 0;\n this.Bh = 0x629a292a | 0;\n this.Bl = 0x367cd507 | 0;\n this.Ch = 0x9159015a | 0;\n this.Cl = 0x3070dd17 | 0;\n this.Dh = 0x152fecd8 | 0;\n this.Dl = 0xf70e5939 | 0;\n this.Eh = 0x67332667 | 0;\n this.El = 0xffc00b31 | 0;\n this.Fh = 0x8eb44a87 | 0;\n this.Fl = 0x68581511 | 0;\n this.Gh = 0xdb0c2e0d | 0;\n this.Gl = 0x64f98fa7 | 0;\n this.Hh = 0x47b5481d | 0;\n this.Hl = 0xbefa4fa4 | 0;\n this.outputLen = 48;\n }\n}\nexport const sha512 = /* @__PURE__ */ wrapConstructor(() => new SHA512());\nexport const sha512_224 = /* @__PURE__ */ wrapConstructor(() => new SHA512_224());\nexport const sha512_256 = /* @__PURE__ */ wrapConstructor(() => new SHA512_256());\nexport const sha384 = /* @__PURE__ */ wrapConstructor(() => new SHA384());\n//# sourceMappingURL=sha512.js.map","/* Browser Crypto Shims */\nimport { hmac } from \"@noble/hashes/hmac\";\nimport { pbkdf2 } from \"@noble/hashes/pbkdf2\";\nimport { sha256 } from \"@noble/hashes/sha256\";\nimport { sha512 } from \"@noble/hashes/sha512\";\nimport { assert, assertArgument } from \"../utils/index.js\";\nfunction getGlobal() {\n if (typeof self !== 'undefined') {\n return self;\n }\n if (typeof window !== 'undefined') {\n return window;\n }\n if (typeof global !== 'undefined') {\n return global;\n }\n throw new Error('unable to locate global object');\n}\n;\nconst anyGlobal = getGlobal();\nconst crypto = anyGlobal.crypto || anyGlobal.msCrypto;\nexport function createHash(algo) {\n switch (algo) {\n case \"sha256\": return sha256.create();\n case \"sha512\": return sha512.create();\n }\n assertArgument(false, \"invalid hashing algorithm name\", \"algorithm\", algo);\n}\nexport function createHmac(_algo, key) {\n const algo = ({ sha256, sha512 }[_algo]);\n assertArgument(algo != null, \"invalid hmac algorithm\", \"algorithm\", _algo);\n return hmac.create(algo, key);\n}\nexport function pbkdf2Sync(password, salt, iterations, keylen, _algo) {\n const algo = ({ sha256, sha512 }[_algo]);\n assertArgument(algo != null, \"invalid pbkdf2 algorithm\", \"algorithm\", _algo);\n return pbkdf2(algo, password, salt, { c: iterations, dkLen: keylen });\n}\nexport function randomBytes(length) {\n assert(crypto != null, \"platform does not support secure random numbers\", \"UNSUPPORTED_OPERATION\", {\n operation: \"randomBytes\"\n });\n assertArgument(Number.isInteger(length) && length > 0 && length <= 1024, \"invalid length\", \"length\", length);\n const result = new Uint8Array(length);\n crypto.getRandomValues(result);\n return result;\n}\n//# sourceMappingURL=crypto-browser.js.map","/**\n * An **HMAC** enables verification that a given key was used\n * to authenticate a payload.\n *\n * See: [[link-wiki-hmac]]\n *\n * @_subsection: api/crypto:HMAC [about-hmac]\n */\nimport { createHmac } from \"./crypto.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _computeHmac = function (algorithm, key, data) {\n return createHmac(algorithm, key).update(data).digest();\n};\nlet __computeHmac = _computeHmac;\n/**\n * Return the HMAC for %%data%% using the %%key%% key with the underlying\n * %%algo%% used for compression.\n *\n * @example:\n * key = id(\"some-secret\")\n *\n * // Compute the HMAC\n * computeHmac(\"sha256\", key, \"0x1337\")\n * //_result:\n *\n * // To compute the HMAC of UTF-8 data, the data must be\n * // converted to UTF-8 bytes\n * computeHmac(\"sha256\", key, toUtf8Bytes(\"Hello World\"))\n * //_result:\n *\n */\nexport function computeHmac(algorithm, _key, _data) {\n const key = getBytes(_key, \"key\");\n const data = getBytes(_data, \"data\");\n return hexlify(__computeHmac(algorithm, key, data));\n}\ncomputeHmac._ = _computeHmac;\ncomputeHmac.lock = function () { locked = true; };\ncomputeHmac.register = function (func) {\n if (locked) {\n throw new Error(\"computeHmac is locked\");\n }\n __computeHmac = func;\n};\nObject.freeze(computeHmac);\n//# sourceMappingURL=hmac.js.map","import { bytes, exists, number, output } from './_assert.js';\nimport { rotlBH, rotlBL, rotlSH, rotlSL, split } from './_u64.js';\nimport { Hash, u32, toBytes, wrapConstructor, wrapXOFConstructorWithOpts, } from './utils.js';\n// SHA3 (keccak) is based on a new design: basically, the internal state is bigger than output size.\n// It's called a sponge function.\n// Various per round constants calculations\nconst [SHA3_PI, SHA3_ROTL, _SHA3_IOTA] = [[], [], []];\nconst _0n = /* @__PURE__ */ BigInt(0);\nconst _1n = /* @__PURE__ */ BigInt(1);\nconst _2n = /* @__PURE__ */ BigInt(2);\nconst _7n = /* @__PURE__ */ BigInt(7);\nconst _256n = /* @__PURE__ */ BigInt(256);\nconst _0x71n = /* @__PURE__ */ BigInt(0x71);\nfor (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {\n // Pi\n [x, y] = [y, (2 * x + 3 * y) % 5];\n SHA3_PI.push(2 * (5 * y + x));\n // Rotational\n SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64);\n // Iota\n let t = _0n;\n for (let j = 0; j < 7; j++) {\n R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n;\n if (R & _2n)\n t ^= _1n << ((_1n << /* @__PURE__ */ BigInt(j)) - _1n);\n }\n _SHA3_IOTA.push(t);\n}\nconst [SHA3_IOTA_H, SHA3_IOTA_L] = /* @__PURE__ */ split(_SHA3_IOTA, true);\n// Left rotation (without 0, 32, 64)\nconst rotlH = (h, l, s) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s));\nconst rotlL = (h, l, s) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s));\n// Same as keccakf1600, but allows to skip some rounds\nexport function keccakP(s, rounds = 24) {\n const B = new Uint32Array(5 * 2);\n // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js)\n for (let round = 24 - rounds; round < 24; round++) {\n // Theta θ\n for (let x = 0; x < 10; x++)\n B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];\n for (let x = 0; x < 10; x += 2) {\n const idx1 = (x + 8) % 10;\n const idx0 = (x + 2) % 10;\n const B0 = B[idx0];\n const B1 = B[idx0 + 1];\n const Th = rotlH(B0, B1, 1) ^ B[idx1];\n const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];\n for (let y = 0; y < 50; y += 10) {\n s[x + y] ^= Th;\n s[x + y + 1] ^= Tl;\n }\n }\n // Rho (ρ) and Pi (π)\n let curH = s[2];\n let curL = s[3];\n for (let t = 0; t < 24; t++) {\n const shift = SHA3_ROTL[t];\n const Th = rotlH(curH, curL, shift);\n const Tl = rotlL(curH, curL, shift);\n const PI = SHA3_PI[t];\n curH = s[PI];\n curL = s[PI + 1];\n s[PI] = Th;\n s[PI + 1] = Tl;\n }\n // Chi (χ)\n for (let y = 0; y < 50; y += 10) {\n for (let x = 0; x < 10; x++)\n B[x] = s[y + x];\n for (let x = 0; x < 10; x++)\n s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];\n }\n // Iota (ι)\n s[0] ^= SHA3_IOTA_H[round];\n s[1] ^= SHA3_IOTA_L[round];\n }\n B.fill(0);\n}\nexport class Keccak extends Hash {\n // NOTE: we accept arguments in bytes instead of bits here.\n constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {\n super();\n this.blockLen = blockLen;\n this.suffix = suffix;\n this.outputLen = outputLen;\n this.enableXOF = enableXOF;\n this.rounds = rounds;\n this.pos = 0;\n this.posOut = 0;\n this.finished = false;\n this.destroyed = false;\n // Can be passed from user as dkLen\n number(outputLen);\n // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes\n if (0 >= this.blockLen || this.blockLen >= 200)\n throw new Error('Sha3 supports only keccak-f1600 function');\n this.state = new Uint8Array(200);\n this.state32 = u32(this.state);\n }\n keccak() {\n keccakP(this.state32, this.rounds);\n this.posOut = 0;\n this.pos = 0;\n }\n update(data) {\n exists(this);\n const { blockLen, state } = this;\n data = toBytes(data);\n const len = data.length;\n for (let pos = 0; pos < len;) {\n const take = Math.min(blockLen - this.pos, len - pos);\n for (let i = 0; i < take; i++)\n state[this.pos++] ^= data[pos++];\n if (this.pos === blockLen)\n this.keccak();\n }\n return this;\n }\n finish() {\n if (this.finished)\n return;\n this.finished = true;\n const { state, suffix, pos, blockLen } = this;\n // Do the padding\n state[pos] ^= suffix;\n if ((suffix & 0x80) !== 0 && pos === blockLen - 1)\n this.keccak();\n state[blockLen - 1] ^= 0x80;\n this.keccak();\n }\n writeInto(out) {\n exists(this, false);\n bytes(out);\n this.finish();\n const bufferOut = this.state;\n const { blockLen } = this;\n for (let pos = 0, len = out.length; pos < len;) {\n if (this.posOut >= blockLen)\n this.keccak();\n const take = Math.min(blockLen - this.posOut, len - pos);\n out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);\n this.posOut += take;\n pos += take;\n }\n return out;\n }\n xofInto(out) {\n // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF\n if (!this.enableXOF)\n throw new Error('XOF is not possible for this instance');\n return this.writeInto(out);\n }\n xof(bytes) {\n number(bytes);\n return this.xofInto(new Uint8Array(bytes));\n }\n digestInto(out) {\n output(out, this);\n if (this.finished)\n throw new Error('digest() was already called');\n this.writeInto(out);\n this.destroy();\n return out;\n }\n digest() {\n return this.digestInto(new Uint8Array(this.outputLen));\n }\n destroy() {\n this.destroyed = true;\n this.state.fill(0);\n }\n _cloneInto(to) {\n const { blockLen, suffix, outputLen, rounds, enableXOF } = this;\n to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds));\n to.state32.set(this.state32);\n to.pos = this.pos;\n to.posOut = this.posOut;\n to.finished = this.finished;\n to.rounds = rounds;\n // Suffix can change in cSHAKE\n to.suffix = suffix;\n to.outputLen = outputLen;\n to.enableXOF = enableXOF;\n to.destroyed = this.destroyed;\n return to;\n }\n}\nconst gen = (suffix, blockLen, outputLen) => wrapConstructor(() => new Keccak(blockLen, suffix, outputLen));\nexport const sha3_224 = /* @__PURE__ */ gen(0x06, 144, 224 / 8);\n/**\n * SHA3-256 hash function\n * @param message - that would be hashed\n */\nexport const sha3_256 = /* @__PURE__ */ gen(0x06, 136, 256 / 8);\nexport const sha3_384 = /* @__PURE__ */ gen(0x06, 104, 384 / 8);\nexport const sha3_512 = /* @__PURE__ */ gen(0x06, 72, 512 / 8);\nexport const keccak_224 = /* @__PURE__ */ gen(0x01, 144, 224 / 8);\n/**\n * keccak-256 hash function. Different from SHA3-256.\n * @param message - that would be hashed\n */\nexport const keccak_256 = /* @__PURE__ */ gen(0x01, 136, 256 / 8);\nexport const keccak_384 = /* @__PURE__ */ gen(0x01, 104, 384 / 8);\nexport const keccak_512 = /* @__PURE__ */ gen(0x01, 72, 512 / 8);\nconst genShake = (suffix, blockLen, outputLen) => wrapXOFConstructorWithOpts((opts = {}) => new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true));\nexport const shake128 = /* @__PURE__ */ genShake(0x1f, 168, 128 / 8);\nexport const shake256 = /* @__PURE__ */ genShake(0x1f, 136, 256 / 8);\n//# sourceMappingURL=sha3.js.map","/**\n * Cryptographic hashing functions\n *\n * @_subsection: api/crypto:Hash Functions [about-crypto-hashing]\n */\nimport { keccak_256 } from \"@noble/hashes/sha3\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _keccak256 = function (data) {\n return keccak_256(data);\n};\nlet __keccak256 = _keccak256;\n/**\n * Compute the cryptographic KECCAK256 hash of %%data%%.\n *\n * The %%data%% **must** be a data representation, to compute the\n * hash of UTF-8 data use the [[id]] function.\n *\n * @returns DataHexstring\n * @example:\n * keccak256(\"0x\")\n * //_result:\n *\n * keccak256(\"0x1337\")\n * //_result:\n *\n * keccak256(new Uint8Array([ 0x13, 0x37 ]))\n * //_result:\n *\n * // Strings are assumed to be DataHexString, otherwise it will\n * // throw. To hash UTF-8 data, see the note above.\n * keccak256(\"Hello World\")\n * //_error:\n */\nexport function keccak256(_data) {\n const data = getBytes(_data, \"data\");\n return hexlify(__keccak256(data));\n}\nkeccak256._ = _keccak256;\nkeccak256.lock = function () { locked = true; };\nkeccak256.register = function (func) {\n if (locked) {\n throw new TypeError(\"keccak256 is locked\");\n }\n __keccak256 = func;\n};\nObject.freeze(keccak256);\n//# sourceMappingURL=keccak.js.map","import { SHA2 } from './_sha2.js';\nimport { wrapConstructor } from './utils.js';\n// https://homes.esat.kuleuven.be/~bosselae/ripemd160.html\n// https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf\nconst Rho = /* @__PURE__ */ new Uint8Array([7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8]);\nconst Id = /* @__PURE__ */ Uint8Array.from({ length: 16 }, (_, i) => i);\nconst Pi = /* @__PURE__ */ Id.map((i) => (9 * i + 5) % 16);\nlet idxL = [Id];\nlet idxR = [Pi];\nfor (let i = 0; i < 4; i++)\n for (let j of [idxL, idxR])\n j.push(j[i].map((k) => Rho[k]));\nconst shifts = /* @__PURE__ */ [\n [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8],\n [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7],\n [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9],\n [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6],\n [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5],\n].map((i) => new Uint8Array(i));\nconst shiftsL = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts[i][j]));\nconst shiftsR = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts[i][j]));\nconst Kl = /* @__PURE__ */ new Uint32Array([\n 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e,\n]);\nconst Kr = /* @__PURE__ */ new Uint32Array([\n 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000,\n]);\n// The rotate left (circular left shift) operation for uint32\nconst rotl = (word, shift) => (word << shift) | (word >>> (32 - shift));\n// It's called f() in spec.\nfunction f(group, x, y, z) {\n if (group === 0)\n return x ^ y ^ z;\n else if (group === 1)\n return (x & y) | (~x & z);\n else if (group === 2)\n return (x | ~y) ^ z;\n else if (group === 3)\n return (x & z) | (y & ~z);\n else\n return x ^ (y | ~z);\n}\n// Temporary buffer, not used to store anything between runs\nconst BUF = /* @__PURE__ */ new Uint32Array(16);\nexport class RIPEMD160 extends SHA2 {\n constructor() {\n super(64, 20, 8, true);\n this.h0 = 0x67452301 | 0;\n this.h1 = 0xefcdab89 | 0;\n this.h2 = 0x98badcfe | 0;\n this.h3 = 0x10325476 | 0;\n this.h4 = 0xc3d2e1f0 | 0;\n }\n get() {\n const { h0, h1, h2, h3, h4 } = this;\n return [h0, h1, h2, h3, h4];\n }\n set(h0, h1, h2, h3, h4) {\n this.h0 = h0 | 0;\n this.h1 = h1 | 0;\n this.h2 = h2 | 0;\n this.h3 = h3 | 0;\n this.h4 = h4 | 0;\n }\n process(view, offset) {\n for (let i = 0; i < 16; i++, offset += 4)\n BUF[i] = view.getUint32(offset, true);\n // prettier-ignore\n let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el;\n // Instead of iterating 0 to 80, we split it into 5 groups\n // And use the groups in constants, functions, etc. Much simpler\n for (let group = 0; group < 5; group++) {\n const rGroup = 4 - group;\n const hbl = Kl[group], hbr = Kr[group]; // prettier-ignore\n const rl = idxL[group], rr = idxR[group]; // prettier-ignore\n const sl = shiftsL[group], sr = shiftsR[group]; // prettier-ignore\n for (let i = 0; i < 16; i++) {\n const tl = (rotl(al + f(group, bl, cl, dl) + BUF[rl[i]] + hbl, sl[i]) + el) | 0;\n al = el, el = dl, dl = rotl(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore\n }\n // 2 loops are 10% faster\n for (let i = 0; i < 16; i++) {\n const tr = (rotl(ar + f(rGroup, br, cr, dr) + BUF[rr[i]] + hbr, sr[i]) + er) | 0;\n ar = er, er = dr, dr = rotl(cr, 10) | 0, cr = br, br = tr; // prettier-ignore\n }\n }\n // Add the compressed chunk to the current hash value\n this.set((this.h1 + cl + dr) | 0, (this.h2 + dl + er) | 0, (this.h3 + el + ar) | 0, (this.h4 + al + br) | 0, (this.h0 + bl + cr) | 0);\n }\n roundClean() {\n BUF.fill(0);\n }\n destroy() {\n this.destroyed = true;\n this.buffer.fill(0);\n this.set(0, 0, 0, 0, 0);\n }\n}\n/**\n * RIPEMD-160 - a hash function from 1990s.\n * @param message - msg that would be hashed\n */\nexport const ripemd160 = /* @__PURE__ */ wrapConstructor(() => new RIPEMD160());\n//# sourceMappingURL=ripemd160.js.map","import { ripemd160 as noble_ripemd160 } from \"@noble/hashes/ripemd160\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _ripemd160 = function (data) {\n return noble_ripemd160(data);\n};\nlet __ripemd160 = _ripemd160;\n/**\n * Compute the cryptographic RIPEMD-160 hash of %%data%%.\n *\n * @_docloc: api/crypto:Hash Functions\n * @returns DataHexstring\n *\n * @example:\n * ripemd160(\"0x\")\n * //_result:\n *\n * ripemd160(\"0x1337\")\n * //_result:\n *\n * ripemd160(new Uint8Array([ 0x13, 0x37 ]))\n * //_result:\n *\n */\nexport function ripemd160(_data) {\n const data = getBytes(_data, \"data\");\n return hexlify(__ripemd160(data));\n}\nripemd160._ = _ripemd160;\nripemd160.lock = function () { locked = true; };\nripemd160.register = function (func) {\n if (locked) {\n throw new TypeError(\"ripemd160 is locked\");\n }\n __ripemd160 = func;\n};\nObject.freeze(ripemd160);\n//# sourceMappingURL=ripemd160.js.map","/**\n * A **Password-Based Key-Derivation Function** is designed to create\n * a sequence of bytes suitible as a **key** from a human-rememberable\n * password.\n *\n * @_subsection: api/crypto:Passwords [about-pbkdf]\n */\nimport { pbkdf2Sync } from \"./crypto.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _pbkdf2 = function (password, salt, iterations, keylen, algo) {\n return pbkdf2Sync(password, salt, iterations, keylen, algo);\n};\nlet __pbkdf2 = _pbkdf2;\n/**\n * Return the [[link-pbkdf2]] for %%keylen%% bytes for %%password%% using\n * the %%salt%% and using %%iterations%% of %%algo%%.\n *\n * This PBKDF is outdated and should not be used in new projects, but is\n * required to decrypt older files.\n *\n * @example:\n * // The password must be converted to bytes, and it is generally\n * // best practices to ensure the string has been normalized. Many\n * // formats explicitly indicate the normalization form to use.\n * password = \"hello\"\n * passwordBytes = toUtf8Bytes(password, \"NFKC\")\n *\n * salt = id(\"some-salt\")\n *\n * // Compute the PBKDF2\n * pbkdf2(passwordBytes, salt, 1024, 16, \"sha256\")\n * //_result:\n */\nexport function pbkdf2(_password, _salt, iterations, keylen, algo) {\n const password = getBytes(_password, \"password\");\n const salt = getBytes(_salt, \"salt\");\n return hexlify(__pbkdf2(password, salt, iterations, keylen, algo));\n}\npbkdf2._ = _pbkdf2;\npbkdf2.lock = function () { locked = true; };\npbkdf2.register = function (func) {\n if (locked) {\n throw new Error(\"pbkdf2 is locked\");\n }\n __pbkdf2 = func;\n};\nObject.freeze(pbkdf2);\n//# sourceMappingURL=pbkdf2.js.map","/**\n * A **Cryptographically Secure Random Value** is one that has been\n * generated with additional care take to prevent side-channels\n * from allowing others to detect it and prevent others from through\n * coincidence generate the same values.\n *\n * @_subsection: api/crypto:Random Values [about-crypto-random]\n */\nimport { randomBytes as crypto_random } from \"./crypto.js\";\nlet locked = false;\nconst _randomBytes = function (length) {\n return new Uint8Array(crypto_random(length));\n};\nlet __randomBytes = _randomBytes;\n/**\n * Return %%length%% bytes of cryptographically secure random data.\n *\n * @example:\n * randomBytes(8)\n * //_result:\n */\nexport function randomBytes(length) {\n return __randomBytes(length);\n}\nrandomBytes._ = _randomBytes;\nrandomBytes.lock = function () { locked = true; };\nrandomBytes.register = function (func) {\n if (locked) {\n throw new Error(\"randomBytes is locked\");\n }\n __randomBytes = func;\n};\nObject.freeze(randomBytes);\n//# sourceMappingURL=random.js.map","import { number as assertNumber } from './_assert.js';\nimport { sha256 } from './sha256.js';\nimport { pbkdf2 } from './pbkdf2.js';\nimport { asyncLoop, checkOpts, u32 } from './utils.js';\n// RFC 7914 Scrypt KDF\n// Left rotate for uint32\nconst rotl = (a, b) => (a << b) | (a >>> (32 - b));\n// The main Scrypt loop: uses Salsa extensively.\n// Six versions of the function were tried, this is the fastest one.\n// prettier-ignore\nfunction XorAndSalsa(prev, pi, input, ii, out, oi) {\n // Based on https://cr.yp.to/salsa20.html\n // Xor blocks\n let y00 = prev[pi++] ^ input[ii++], y01 = prev[pi++] ^ input[ii++];\n let y02 = prev[pi++] ^ input[ii++], y03 = prev[pi++] ^ input[ii++];\n let y04 = prev[pi++] ^ input[ii++], y05 = prev[pi++] ^ input[ii++];\n let y06 = prev[pi++] ^ input[ii++], y07 = prev[pi++] ^ input[ii++];\n let y08 = prev[pi++] ^ input[ii++], y09 = prev[pi++] ^ input[ii++];\n let y10 = prev[pi++] ^ input[ii++], y11 = prev[pi++] ^ input[ii++];\n let y12 = prev[pi++] ^ input[ii++], y13 = prev[pi++] ^ input[ii++];\n let y14 = prev[pi++] ^ input[ii++], y15 = prev[pi++] ^ input[ii++];\n // Save state to temporary variables (salsa)\n let x00 = y00, x01 = y01, x02 = y02, x03 = y03, x04 = y04, x05 = y05, x06 = y06, x07 = y07, x08 = y08, x09 = y09, x10 = y10, x11 = y11, x12 = y12, x13 = y13, x14 = y14, x15 = y15;\n // Main loop (salsa)\n for (let i = 0; i < 8; i += 2) {\n x04 ^= rotl(x00 + x12 | 0, 7);\n x08 ^= rotl(x04 + x00 | 0, 9);\n x12 ^= rotl(x08 + x04 | 0, 13);\n x00 ^= rotl(x12 + x08 | 0, 18);\n x09 ^= rotl(x05 + x01 | 0, 7);\n x13 ^= rotl(x09 + x05 | 0, 9);\n x01 ^= rotl(x13 + x09 | 0, 13);\n x05 ^= rotl(x01 + x13 | 0, 18);\n x14 ^= rotl(x10 + x06 | 0, 7);\n x02 ^= rotl(x14 + x10 | 0, 9);\n x06 ^= rotl(x02 + x14 | 0, 13);\n x10 ^= rotl(x06 + x02 | 0, 18);\n x03 ^= rotl(x15 + x11 | 0, 7);\n x07 ^= rotl(x03 + x15 | 0, 9);\n x11 ^= rotl(x07 + x03 | 0, 13);\n x15 ^= rotl(x11 + x07 | 0, 18);\n x01 ^= rotl(x00 + x03 | 0, 7);\n x02 ^= rotl(x01 + x00 | 0, 9);\n x03 ^= rotl(x02 + x01 | 0, 13);\n x00 ^= rotl(x03 + x02 | 0, 18);\n x06 ^= rotl(x05 + x04 | 0, 7);\n x07 ^= rotl(x06 + x05 | 0, 9);\n x04 ^= rotl(x07 + x06 | 0, 13);\n x05 ^= rotl(x04 + x07 | 0, 18);\n x11 ^= rotl(x10 + x09 | 0, 7);\n x08 ^= rotl(x11 + x10 | 0, 9);\n x09 ^= rotl(x08 + x11 | 0, 13);\n x10 ^= rotl(x09 + x08 | 0, 18);\n x12 ^= rotl(x15 + x14 | 0, 7);\n x13 ^= rotl(x12 + x15 | 0, 9);\n x14 ^= rotl(x13 + x12 | 0, 13);\n x15 ^= rotl(x14 + x13 | 0, 18);\n }\n // Write output (salsa)\n out[oi++] = (y00 + x00) | 0;\n out[oi++] = (y01 + x01) | 0;\n out[oi++] = (y02 + x02) | 0;\n out[oi++] = (y03 + x03) | 0;\n out[oi++] = (y04 + x04) | 0;\n out[oi++] = (y05 + x05) | 0;\n out[oi++] = (y06 + x06) | 0;\n out[oi++] = (y07 + x07) | 0;\n out[oi++] = (y08 + x08) | 0;\n out[oi++] = (y09 + x09) | 0;\n out[oi++] = (y10 + x10) | 0;\n out[oi++] = (y11 + x11) | 0;\n out[oi++] = (y12 + x12) | 0;\n out[oi++] = (y13 + x13) | 0;\n out[oi++] = (y14 + x14) | 0;\n out[oi++] = (y15 + x15) | 0;\n}\nfunction BlockMix(input, ii, out, oi, r) {\n // The block B is r 128-byte chunks (which is equivalent of 2r 64-byte chunks)\n let head = oi + 0;\n let tail = oi + 16 * r;\n for (let i = 0; i < 16; i++)\n out[tail + i] = input[ii + (2 * r - 1) * 16 + i]; // X ← B[2r−1]\n for (let i = 0; i < r; i++, head += 16, ii += 16) {\n // We write odd & even Yi at same time. Even: 0bXXXXX0 Odd: 0bXXXXX1\n XorAndSalsa(out, tail, input, ii, out, head); // head[i] = Salsa(blockIn[2*i] ^ tail[i-1])\n if (i > 0)\n tail += 16; // First iteration overwrites tmp value in tail\n XorAndSalsa(out, head, input, (ii += 16), out, tail); // tail[i] = Salsa(blockIn[2*i+1] ^ head[i])\n }\n}\n// Common prologue and epilogue for sync/async functions\nfunction scryptInit(password, salt, _opts) {\n // Maxmem - 1GB+1KB by default\n const opts = checkOpts({\n dkLen: 32,\n asyncTick: 10,\n maxmem: 1024 ** 3 + 1024,\n }, _opts);\n const { N, r, p, dkLen, asyncTick, maxmem, onProgress } = opts;\n assertNumber(N);\n assertNumber(r);\n assertNumber(p);\n assertNumber(dkLen);\n assertNumber(asyncTick);\n assertNumber(maxmem);\n if (onProgress !== undefined && typeof onProgress !== 'function')\n throw new Error('progressCb should be function');\n const blockSize = 128 * r;\n const blockSize32 = blockSize / 4;\n if (N <= 1 || (N & (N - 1)) !== 0 || N >= 2 ** (blockSize / 8) || N > 2 ** 32) {\n // NOTE: we limit N to be less than 2**32 because of 32 bit variant of Integrify function\n // There is no JS engines that allows alocate more than 4GB per single Uint8Array for now, but can change in future.\n throw new Error('Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32');\n }\n if (p < 0 || p > ((2 ** 32 - 1) * 32) / blockSize) {\n throw new Error('Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)');\n }\n if (dkLen < 0 || dkLen > (2 ** 32 - 1) * 32) {\n throw new Error('Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32');\n }\n const memUsed = blockSize * (N + p);\n if (memUsed > maxmem) {\n throw new Error(`Scrypt: parameters too large, ${memUsed} (128 * r * (N + p)) > ${maxmem} (maxmem)`);\n }\n // [B0...Bp−1] ← PBKDF2HMAC-SHA256(Passphrase, Salt, 1, blockSize*ParallelizationFactor)\n // Since it has only one iteration there is no reason to use async variant\n const B = pbkdf2(sha256, password, salt, { c: 1, dkLen: blockSize * p });\n const B32 = u32(B);\n // Re-used between parallel iterations. Array(iterations) of B\n const V = u32(new Uint8Array(blockSize * N));\n const tmp = u32(new Uint8Array(blockSize));\n let blockMixCb = () => { };\n if (onProgress) {\n const totalBlockMix = 2 * N * p;\n // Invoke callback if progress changes from 10.01 to 10.02\n // Allows to draw smooth progress bar on up to 8K screen\n const callbackPer = Math.max(Math.floor(totalBlockMix / 10000), 1);\n let blockMixCnt = 0;\n blockMixCb = () => {\n blockMixCnt++;\n if (onProgress && (!(blockMixCnt % callbackPer) || blockMixCnt === totalBlockMix))\n onProgress(blockMixCnt / totalBlockMix);\n };\n }\n return { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick };\n}\nfunction scryptOutput(password, dkLen, B, V, tmp) {\n const res = pbkdf2(sha256, password, B, { c: 1, dkLen });\n B.fill(0);\n V.fill(0);\n tmp.fill(0);\n return res;\n}\n/**\n * Scrypt KDF from RFC 7914.\n * @param password - pass\n * @param salt - salt\n * @param opts - parameters\n * - `N` is cpu/mem work factor (power of 2 e.g. 2**18)\n * - `r` is block size (8 is common), fine-tunes sequential memory read size and performance\n * - `p` is parallelization factor (1 is common)\n * - `dkLen` is output key length in bytes e.g. 32.\n * - `asyncTick` - (default: 10) max time in ms for which async function can block execution\n * - `maxmem` - (default: `1024 ** 3 + 1024` aka 1GB+1KB). A limit that the app could use for scrypt\n * - `onProgress` - callback function that would be executed for progress report\n * @returns Derived key\n */\nexport function scrypt(password, salt, opts) {\n const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb } = scryptInit(password, salt, opts);\n for (let pi = 0; pi < p; pi++) {\n const Pi = blockSize32 * pi;\n for (let i = 0; i < blockSize32; i++)\n V[i] = B32[Pi + i]; // V[0] = B[i]\n for (let i = 0, pos = 0; i < N - 1; i++) {\n BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]);\n blockMixCb();\n }\n BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element\n blockMixCb();\n for (let i = 0; i < N; i++) {\n // First u32 of the last 64-byte block (u32 is LE)\n const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations\n for (let k = 0; k < blockSize32; k++)\n tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j]\n BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j])\n blockMixCb();\n }\n }\n return scryptOutput(password, dkLen, B, V, tmp);\n}\n/**\n * Scrypt KDF from RFC 7914.\n */\nexport async function scryptAsync(password, salt, opts) {\n const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick } = scryptInit(password, salt, opts);\n for (let pi = 0; pi < p; pi++) {\n const Pi = blockSize32 * pi;\n for (let i = 0; i < blockSize32; i++)\n V[i] = B32[Pi + i]; // V[0] = B[i]\n let pos = 0;\n await asyncLoop(N - 1, asyncTick, () => {\n BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]);\n blockMixCb();\n });\n BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element\n blockMixCb();\n await asyncLoop(N, asyncTick, () => {\n // First u32 of the last 64-byte block (u32 is LE)\n const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations\n for (let k = 0; k < blockSize32; k++)\n tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j]\n BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j])\n blockMixCb();\n });\n }\n return scryptOutput(password, dkLen, B, V, tmp);\n}\n//# sourceMappingURL=scrypt.js.map","import { scrypt as _nobleSync, scryptAsync as _nobleAsync } from \"@noble/hashes/scrypt\";\nimport { getBytes, hexlify as H } from \"../utils/index.js\";\nlet lockedSync = false, lockedAsync = false;\nconst _scryptAsync = async function (passwd, salt, N, r, p, dkLen, onProgress) {\n return await _nobleAsync(passwd, salt, { N, r, p, dkLen, onProgress });\n};\nconst _scryptSync = function (passwd, salt, N, r, p, dkLen) {\n return _nobleSync(passwd, salt, { N, r, p, dkLen });\n};\nlet __scryptAsync = _scryptAsync;\nlet __scryptSync = _scryptSync;\n/**\n * The [[link-wiki-scrypt]] uses a memory and cpu hard method of\n * derivation to increase the resource cost to brute-force a password\n * for a given key.\n *\n * This means this algorithm is intentionally slow, and can be tuned to\n * become slower. As computation and memory speed improve over time,\n * increasing the difficulty maintains the cost of an attacker.\n *\n * For example, if a target time of 5 seconds is used, a legitimate user\n * which knows their password requires only 5 seconds to unlock their\n * account. A 6 character password has 68 billion possibilities, which\n * would require an attacker to invest over 10,000 years of CPU time. This\n * is of course a crude example (as password generally aren't random),\n * but demonstrates to value of imposing large costs to decryption.\n *\n * For this reason, if building a UI which involved decrypting or\n * encrypting datsa using scrypt, it is recommended to use a\n * [[ProgressCallback]] (as event short periods can seem lik an eternity\n * if the UI freezes). Including the phrase //\"decrypting\"// in the UI\n * can also help, assuring the user their waiting is for a good reason.\n *\n * @_docloc: api/crypto:Passwords\n *\n * @example:\n * // The password must be converted to bytes, and it is generally\n * // best practices to ensure the string has been normalized. Many\n * // formats explicitly indicate the normalization form to use.\n * password = \"hello\"\n * passwordBytes = toUtf8Bytes(password, \"NFKC\")\n *\n * salt = id(\"some-salt\")\n *\n * // Compute the scrypt\n * scrypt(passwordBytes, salt, 1024, 8, 1, 16)\n * //_result:\n */\nexport async function scrypt(_passwd, _salt, N, r, p, dkLen, progress) {\n const passwd = getBytes(_passwd, \"passwd\");\n const salt = getBytes(_salt, \"salt\");\n return H(await __scryptAsync(passwd, salt, N, r, p, dkLen, progress));\n}\nscrypt._ = _scryptAsync;\nscrypt.lock = function () { lockedAsync = true; };\nscrypt.register = function (func) {\n if (lockedAsync) {\n throw new Error(\"scrypt is locked\");\n }\n __scryptAsync = func;\n};\nObject.freeze(scrypt);\n/**\n * Provides a synchronous variant of [[scrypt]].\n *\n * This will completely lock up and freeze the UI in a browser and will\n * prevent any event loop from progressing. For this reason, it is\n * preferred to use the [async variant](scrypt).\n *\n * @_docloc: api/crypto:Passwords\n *\n * @example:\n * // The password must be converted to bytes, and it is generally\n * // best practices to ensure the string has been normalized. Many\n * // formats explicitly indicate the normalization form to use.\n * password = \"hello\"\n * passwordBytes = toUtf8Bytes(password, \"NFKC\")\n *\n * salt = id(\"some-salt\")\n *\n * // Compute the scrypt\n * scryptSync(passwordBytes, salt, 1024, 8, 1, 16)\n * //_result:\n */\nexport function scryptSync(_passwd, _salt, N, r, p, dkLen) {\n const passwd = getBytes(_passwd, \"passwd\");\n const salt = getBytes(_salt, \"salt\");\n return H(__scryptSync(passwd, salt, N, r, p, dkLen));\n}\nscryptSync._ = _scryptSync;\nscryptSync.lock = function () { lockedSync = true; };\nscryptSync.register = function (func) {\n if (lockedSync) {\n throw new Error(\"scryptSync is locked\");\n }\n __scryptSync = func;\n};\nObject.freeze(scryptSync);\n//# sourceMappingURL=scrypt.js.map","import { createHash } from \"./crypto.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nconst _sha256 = function (data) {\n return createHash(\"sha256\").update(data).digest();\n};\nconst _sha512 = function (data) {\n return createHash(\"sha512\").update(data).digest();\n};\nlet __sha256 = _sha256;\nlet __sha512 = _sha512;\nlet locked256 = false, locked512 = false;\n/**\n * Compute the cryptographic SHA2-256 hash of %%data%%.\n *\n * @_docloc: api/crypto:Hash Functions\n * @returns DataHexstring\n *\n * @example:\n * sha256(\"0x\")\n * //_result:\n *\n * sha256(\"0x1337\")\n * //_result:\n *\n * sha256(new Uint8Array([ 0x13, 0x37 ]))\n * //_result:\n *\n */\nexport function sha256(_data) {\n const data = getBytes(_data, \"data\");\n return hexlify(__sha256(data));\n}\nsha256._ = _sha256;\nsha256.lock = function () { locked256 = true; };\nsha256.register = function (func) {\n if (locked256) {\n throw new Error(\"sha256 is locked\");\n }\n __sha256 = func;\n};\nObject.freeze(sha256);\n/**\n * Compute the cryptographic SHA2-512 hash of %%data%%.\n *\n * @_docloc: api/crypto:Hash Functions\n * @returns DataHexstring\n *\n * @example:\n * sha512(\"0x\")\n * //_result:\n *\n * sha512(\"0x1337\")\n * //_result:\n *\n * sha512(new Uint8Array([ 0x13, 0x37 ]))\n * //_result:\n */\nexport function sha512(_data) {\n const data = getBytes(_data, \"data\");\n return hexlify(__sha512(data));\n}\nsha512._ = _sha512;\nsha512.lock = function () { locked512 = true; };\nsha512.register = function (func) {\n if (locked512) {\n throw new Error(\"sha512 is locked\");\n }\n __sha512 = func;\n};\nObject.freeze(sha256);\n//# sourceMappingURL=sha2.js.map","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// 100 lines of code in the file are duplicated from noble-hashes (utils).\n// This is OK: `abstract` directory does not use noble-hashes.\n// User may opt-in into using different hashing library. This way, noble-hashes\n// won't be included into their bundle.\nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\nconst _2n = BigInt(2);\nconst u8a = (a) => a instanceof Uint8Array;\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));\n/**\n * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'\n */\nexport function bytesToHex(bytes) {\n if (!u8a(bytes))\n throw new Error('Uint8Array expected');\n // pre-caching improves the speed 6x\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += hexes[bytes[i]];\n }\n return hex;\n}\nexport function numberToHexUnpadded(num) {\n const hex = num.toString(16);\n return hex.length & 1 ? `0${hex}` : hex;\n}\nexport function hexToNumber(hex) {\n if (typeof hex !== 'string')\n throw new Error('hex string expected, got ' + typeof hex);\n // Big Endian\n return BigInt(hex === '' ? '0' : `0x${hex}`);\n}\n/**\n * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n */\nexport function hexToBytes(hex) {\n if (typeof hex !== 'string')\n throw new Error('hex string expected, got ' + typeof hex);\n const len = hex.length;\n if (len % 2)\n throw new Error('padded hex string expected, got unpadded hex of length ' + len);\n const array = new Uint8Array(len / 2);\n for (let i = 0; i < array.length; i++) {\n const j = i * 2;\n const hexByte = hex.slice(j, j + 2);\n const byte = Number.parseInt(hexByte, 16);\n if (Number.isNaN(byte) || byte < 0)\n throw new Error('Invalid byte sequence');\n array[i] = byte;\n }\n return array;\n}\n// BE: Big Endian, LE: Little Endian\nexport function bytesToNumberBE(bytes) {\n return hexToNumber(bytesToHex(bytes));\n}\nexport function bytesToNumberLE(bytes) {\n if (!u8a(bytes))\n throw new Error('Uint8Array expected');\n return hexToNumber(bytesToHex(Uint8Array.from(bytes).reverse()));\n}\nexport function numberToBytesBE(n, len) {\n return hexToBytes(n.toString(16).padStart(len * 2, '0'));\n}\nexport function numberToBytesLE(n, len) {\n return numberToBytesBE(n, len).reverse();\n}\n// Unpadded, rarely used\nexport function numberToVarBytesBE(n) {\n return hexToBytes(numberToHexUnpadded(n));\n}\n/**\n * Takes hex string or Uint8Array, converts to Uint8Array.\n * Validates output length.\n * Will throw error for other types.\n * @param title descriptive title for an error e.g. 'private key'\n * @param hex hex string or Uint8Array\n * @param expectedLength optional, will compare to result array's length\n * @returns\n */\nexport function ensureBytes(title, hex, expectedLength) {\n let res;\n if (typeof hex === 'string') {\n try {\n res = hexToBytes(hex);\n }\n catch (e) {\n throw new Error(`${title} must be valid hex string, got \"${hex}\". Cause: ${e}`);\n }\n }\n else if (u8a(hex)) {\n // Uint8Array.from() instead of hash.slice() because node.js Buffer\n // is instance of Uint8Array, and its slice() creates **mutable** copy\n res = Uint8Array.from(hex);\n }\n else {\n throw new Error(`${title} must be hex string or Uint8Array`);\n }\n const len = res.length;\n if (typeof expectedLength === 'number' && len !== expectedLength)\n throw new Error(`${title} expected ${expectedLength} bytes, got ${len}`);\n return res;\n}\n/**\n * Copies several Uint8Arrays into one.\n */\nexport function concatBytes(...arrays) {\n const r = new Uint8Array(arrays.reduce((sum, a) => sum + a.length, 0));\n let pad = 0; // walk through each item, ensure they have proper type\n arrays.forEach((a) => {\n if (!u8a(a))\n throw new Error('Uint8Array expected');\n r.set(a, pad);\n pad += a.length;\n });\n return r;\n}\nexport function equalBytes(b1, b2) {\n // We don't care about timing attacks here\n if (b1.length !== b2.length)\n return false;\n for (let i = 0; i < b1.length; i++)\n if (b1[i] !== b2[i])\n return false;\n return true;\n}\n/**\n * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99])\n */\nexport function utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new Error(`utf8ToBytes expected string, got ${typeof str}`);\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\n// Bit operations\n/**\n * Calculates amount of bits in a bigint.\n * Same as `n.toString(2).length`\n */\nexport function bitLen(n) {\n let len;\n for (len = 0; n > _0n; n >>= _1n, len += 1)\n ;\n return len;\n}\n/**\n * Gets single bit at position.\n * NOTE: first bit position is 0 (same as arrays)\n * Same as `!!+Array.from(n.toString(2)).reverse()[pos]`\n */\nexport function bitGet(n, pos) {\n return (n >> BigInt(pos)) & _1n;\n}\n/**\n * Sets single bit at position.\n */\nexport const bitSet = (n, pos, value) => {\n return n | ((value ? _1n : _0n) << BigInt(pos));\n};\n/**\n * Calculate mask for N bits. Not using ** operator with bigints because of old engines.\n * Same as BigInt(`0b${Array(i).fill('1').join('')}`)\n */\nexport const bitMask = (n) => (_2n << BigInt(n - 1)) - _1n;\n// DRBG\nconst u8n = (data) => new Uint8Array(data); // creates Uint8Array\nconst u8fr = (arr) => Uint8Array.from(arr); // another shortcut\n/**\n * Minimal HMAC-DRBG from NIST 800-90 for RFC6979 sigs.\n * @returns function that will call DRBG until 2nd arg returns something meaningful\n * @example\n * const drbg = createHmacDRBG(32, 32, hmac);\n * drbg(seed, bytesToKey); // bytesToKey must return Key or undefined\n */\nexport function createHmacDrbg(hashLen, qByteLen, hmacFn) {\n if (typeof hashLen !== 'number' || hashLen < 2)\n throw new Error('hashLen must be a number');\n if (typeof qByteLen !== 'number' || qByteLen < 2)\n throw new Error('qByteLen must be a number');\n if (typeof hmacFn !== 'function')\n throw new Error('hmacFn must be a function');\n // Step B, Step C: set hashLen to 8*ceil(hlen/8)\n let v = u8n(hashLen); // Minimal non-full-spec HMAC-DRBG from NIST 800-90 for RFC6979 sigs.\n let k = u8n(hashLen); // Steps B and C of RFC6979 3.2: set hashLen, in our case always same\n let i = 0; // Iterations counter, will throw when over 1000\n const reset = () => {\n v.fill(1);\n k.fill(0);\n i = 0;\n };\n const h = (...b) => hmacFn(k, v, ...b); // hmac(k)(v, ...values)\n const reseed = (seed = u8n()) => {\n // HMAC-DRBG reseed() function. Steps D-G\n k = h(u8fr([0x00]), seed); // k = hmac(k || v || 0x00 || seed)\n v = h(); // v = hmac(k || v)\n if (seed.length === 0)\n return;\n k = h(u8fr([0x01]), seed); // k = hmac(k || v || 0x01 || seed)\n v = h(); // v = hmac(k || v)\n };\n const gen = () => {\n // HMAC-DRBG generate() function\n if (i++ >= 1000)\n throw new Error('drbg: tried 1000 values');\n let len = 0;\n const out = [];\n while (len < qByteLen) {\n v = h();\n const sl = v.slice();\n out.push(sl);\n len += v.length;\n }\n return concatBytes(...out);\n };\n const genUntil = (seed, pred) => {\n reset();\n reseed(seed); // Steps D-G\n let res = undefined; // Step H: grind until k is in [1..n-1]\n while (!(res = pred(gen())))\n reseed();\n reset();\n return res;\n };\n return genUntil;\n}\n// Validating curves and fields\nconst validatorFns = {\n bigint: (val) => typeof val === 'bigint',\n function: (val) => typeof val === 'function',\n boolean: (val) => typeof val === 'boolean',\n string: (val) => typeof val === 'string',\n stringOrUint8Array: (val) => typeof val === 'string' || val instanceof Uint8Array,\n isSafeInteger: (val) => Number.isSafeInteger(val),\n array: (val) => Array.isArray(val),\n field: (val, object) => object.Fp.isValid(val),\n hash: (val) => typeof val === 'function' && Number.isSafeInteger(val.outputLen),\n};\n// type Record = { [P in K]: T; }\nexport function validateObject(object, validators, optValidators = {}) {\n const checkField = (fieldName, type, isOptional) => {\n const checkVal = validatorFns[type];\n if (typeof checkVal !== 'function')\n throw new Error(`Invalid validator \"${type}\", expected function`);\n const val = object[fieldName];\n if (isOptional && val === undefined)\n return;\n if (!checkVal(val, object)) {\n throw new Error(`Invalid param ${String(fieldName)}=${val} (${typeof val}), expected ${type}`);\n }\n };\n for (const [fieldName, type] of Object.entries(validators))\n checkField(fieldName, type, false);\n for (const [fieldName, type] of Object.entries(optValidators))\n checkField(fieldName, type, true);\n return object;\n}\n// validate type tests\n// const o: { a: number; b: number; c: number } = { a: 1, b: 5, c: 6 };\n// const z0 = validateObject(o, { a: 'isSafeInteger' }, { c: 'bigint' }); // Ok!\n// // Should fail type-check\n// const z1 = validateObject(o, { a: 'tmp' }, { c: 'zz' });\n// const z2 = validateObject(o, { a: 'isSafeInteger' }, { c: 'zz' });\n// const z3 = validateObject(o, { test: 'boolean', z: 'bug' });\n// const z4 = validateObject(o, { a: 'boolean', z: 'bug' });\n//# sourceMappingURL=utils.js.map","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// Utilities for modular arithmetics and finite fields\nimport { bitMask, numberToBytesBE, numberToBytesLE, bytesToNumberBE, bytesToNumberLE, ensureBytes, validateObject, } from './utils.js';\n// prettier-ignore\nconst _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3);\n// prettier-ignore\nconst _4n = BigInt(4), _5n = BigInt(5), _8n = BigInt(8);\n// prettier-ignore\nconst _9n = BigInt(9), _16n = BigInt(16);\n// Calculates a modulo b\nexport function mod(a, b) {\n const result = a % b;\n return result >= _0n ? result : b + result;\n}\n/**\n * Efficiently raise num to power and do modular division.\n * Unsafe in some contexts: uses ladder, so can expose bigint bits.\n * @example\n * pow(2n, 6n, 11n) // 64n % 11n == 9n\n */\n// TODO: use field version && remove\nexport function pow(num, power, modulo) {\n if (modulo <= _0n || power < _0n)\n throw new Error('Expected power/modulo > 0');\n if (modulo === _1n)\n return _0n;\n let res = _1n;\n while (power > _0n) {\n if (power & _1n)\n res = (res * num) % modulo;\n num = (num * num) % modulo;\n power >>= _1n;\n }\n return res;\n}\n// Does x ^ (2 ^ power) mod p. pow2(30, 4) == 30 ^ (2 ^ 4)\nexport function pow2(x, power, modulo) {\n let res = x;\n while (power-- > _0n) {\n res *= res;\n res %= modulo;\n }\n return res;\n}\n// Inverses number over modulo\nexport function invert(number, modulo) {\n if (number === _0n || modulo <= _0n) {\n throw new Error(`invert: expected positive integers, got n=${number} mod=${modulo}`);\n }\n // Euclidean GCD https://brilliant.org/wiki/extended-euclidean-algorithm/\n // Fermat's little theorem \"CT-like\" version inv(n) = n^(m-2) mod m is 30x slower.\n let a = mod(number, modulo);\n let b = modulo;\n // prettier-ignore\n let x = _0n, y = _1n, u = _1n, v = _0n;\n while (a !== _0n) {\n // JIT applies optimization if those two lines follow each other\n const q = b / a;\n const r = b % a;\n const m = x - u * q;\n const n = y - v * q;\n // prettier-ignore\n b = a, a = r, x = u, y = v, u = m, v = n;\n }\n const gcd = b;\n if (gcd !== _1n)\n throw new Error('invert: does not exist');\n return mod(x, modulo);\n}\n/**\n * Tonelli-Shanks square root search algorithm.\n * 1. https://eprint.iacr.org/2012/685.pdf (page 12)\n * 2. Square Roots from 1; 24, 51, 10 to Dan Shanks\n * Will start an infinite loop if field order P is not prime.\n * @param P field order\n * @returns function that takes field Fp (created from P) and number n\n */\nexport function tonelliShanks(P) {\n // Legendre constant: used to calculate Legendre symbol (a | p),\n // which denotes the value of a^((p-1)/2) (mod p).\n // (a | p) ≡ 1 if a is a square (mod p)\n // (a | p) ≡ -1 if a is not a square (mod p)\n // (a | p) ≡ 0 if a ≡ 0 (mod p)\n const legendreC = (P - _1n) / _2n;\n let Q, S, Z;\n // Step 1: By factoring out powers of 2 from p - 1,\n // find q and s such that p - 1 = q*(2^s) with q odd\n for (Q = P - _1n, S = 0; Q % _2n === _0n; Q /= _2n, S++)\n ;\n // Step 2: Select a non-square z such that (z | p) ≡ -1 and set c ≡ zq\n for (Z = _2n; Z < P && pow(Z, legendreC, P) !== P - _1n; Z++)\n ;\n // Fast-path\n if (S === 1) {\n const p1div4 = (P + _1n) / _4n;\n return function tonelliFast(Fp, n) {\n const root = Fp.pow(n, p1div4);\n if (!Fp.eql(Fp.sqr(root), n))\n throw new Error('Cannot find square root');\n return root;\n };\n }\n // Slow-path\n const Q1div2 = (Q + _1n) / _2n;\n return function tonelliSlow(Fp, n) {\n // Step 0: Check that n is indeed a square: (n | p) should not be ≡ -1\n if (Fp.pow(n, legendreC) === Fp.neg(Fp.ONE))\n throw new Error('Cannot find square root');\n let r = S;\n // TODO: will fail at Fp2/etc\n let g = Fp.pow(Fp.mul(Fp.ONE, Z), Q); // will update both x and b\n let x = Fp.pow(n, Q1div2); // first guess at the square root\n let b = Fp.pow(n, Q); // first guess at the fudge factor\n while (!Fp.eql(b, Fp.ONE)) {\n if (Fp.eql(b, Fp.ZERO))\n return Fp.ZERO; // https://en.wikipedia.org/wiki/Tonelli%E2%80%93Shanks_algorithm (4. If t = 0, return r = 0)\n // Find m such b^(2^m)==1\n let m = 1;\n for (let t2 = Fp.sqr(b); m < r; m++) {\n if (Fp.eql(t2, Fp.ONE))\n break;\n t2 = Fp.sqr(t2); // t2 *= t2\n }\n // NOTE: r-m-1 can be bigger than 32, need to convert to bigint before shift, otherwise there will be overflow\n const ge = Fp.pow(g, _1n << BigInt(r - m - 1)); // ge = 2^(r-m-1)\n g = Fp.sqr(ge); // g = ge * ge\n x = Fp.mul(x, ge); // x *= ge\n b = Fp.mul(b, g); // b *= g\n r = m;\n }\n return x;\n };\n}\nexport function FpSqrt(P) {\n // NOTE: different algorithms can give different roots, it is up to user to decide which one they want.\n // For example there is FpSqrtOdd/FpSqrtEven to choice root based on oddness (used for hash-to-curve).\n // P ≡ 3 (mod 4)\n // √n = n^((P+1)/4)\n if (P % _4n === _3n) {\n // Not all roots possible!\n // const ORDER =\n // 0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaabn;\n // const NUM = 72057594037927816n;\n const p1div4 = (P + _1n) / _4n;\n return function sqrt3mod4(Fp, n) {\n const root = Fp.pow(n, p1div4);\n // Throw if root**2 != n\n if (!Fp.eql(Fp.sqr(root), n))\n throw new Error('Cannot find square root');\n return root;\n };\n }\n // Atkin algorithm for q ≡ 5 (mod 8), https://eprint.iacr.org/2012/685.pdf (page 10)\n if (P % _8n === _5n) {\n const c1 = (P - _5n) / _8n;\n return function sqrt5mod8(Fp, n) {\n const n2 = Fp.mul(n, _2n);\n const v = Fp.pow(n2, c1);\n const nv = Fp.mul(n, v);\n const i = Fp.mul(Fp.mul(nv, _2n), v);\n const root = Fp.mul(nv, Fp.sub(i, Fp.ONE));\n if (!Fp.eql(Fp.sqr(root), n))\n throw new Error('Cannot find square root');\n return root;\n };\n }\n // P ≡ 9 (mod 16)\n if (P % _16n === _9n) {\n // NOTE: tonelli is too slow for bls-Fp2 calculations even on start\n // Means we cannot use sqrt for constants at all!\n //\n // const c1 = Fp.sqrt(Fp.negate(Fp.ONE)); // 1. c1 = sqrt(-1) in F, i.e., (c1^2) == -1 in F\n // const c2 = Fp.sqrt(c1); // 2. c2 = sqrt(c1) in F, i.e., (c2^2) == c1 in F\n // const c3 = Fp.sqrt(Fp.negate(c1)); // 3. c3 = sqrt(-c1) in F, i.e., (c3^2) == -c1 in F\n // const c4 = (P + _7n) / _16n; // 4. c4 = (q + 7) / 16 # Integer arithmetic\n // sqrt = (x) => {\n // let tv1 = Fp.pow(x, c4); // 1. tv1 = x^c4\n // let tv2 = Fp.mul(c1, tv1); // 2. tv2 = c1 * tv1\n // const tv3 = Fp.mul(c2, tv1); // 3. tv3 = c2 * tv1\n // let tv4 = Fp.mul(c3, tv1); // 4. tv4 = c3 * tv1\n // const e1 = Fp.equals(Fp.square(tv2), x); // 5. e1 = (tv2^2) == x\n // const e2 = Fp.equals(Fp.square(tv3), x); // 6. e2 = (tv3^2) == x\n // tv1 = Fp.cmov(tv1, tv2, e1); // 7. tv1 = CMOV(tv1, tv2, e1) # Select tv2 if (tv2^2) == x\n // tv2 = Fp.cmov(tv4, tv3, e2); // 8. tv2 = CMOV(tv4, tv3, e2) # Select tv3 if (tv3^2) == x\n // const e3 = Fp.equals(Fp.square(tv2), x); // 9. e3 = (tv2^2) == x\n // return Fp.cmov(tv1, tv2, e3); // 10. z = CMOV(tv1, tv2, e3) # Select the sqrt from tv1 and tv2\n // }\n }\n // Other cases: Tonelli-Shanks algorithm\n return tonelliShanks(P);\n}\n// Little-endian check for first LE bit (last BE bit);\nexport const isNegativeLE = (num, modulo) => (mod(num, modulo) & _1n) === _1n;\n// prettier-ignore\nconst FIELD_FIELDS = [\n 'create', 'isValid', 'is0', 'neg', 'inv', 'sqrt', 'sqr',\n 'eql', 'add', 'sub', 'mul', 'pow', 'div',\n 'addN', 'subN', 'mulN', 'sqrN'\n];\nexport function validateField(field) {\n const initial = {\n ORDER: 'bigint',\n MASK: 'bigint',\n BYTES: 'isSafeInteger',\n BITS: 'isSafeInteger',\n };\n const opts = FIELD_FIELDS.reduce((map, val) => {\n map[val] = 'function';\n return map;\n }, initial);\n return validateObject(field, opts);\n}\n// Generic field functions\n/**\n * Same as `pow` but for Fp: non-constant-time.\n * Unsafe in some contexts: uses ladder, so can expose bigint bits.\n */\nexport function FpPow(f, num, power) {\n // Should have same speed as pow for bigints\n // TODO: benchmark!\n if (power < _0n)\n throw new Error('Expected power > 0');\n if (power === _0n)\n return f.ONE;\n if (power === _1n)\n return num;\n let p = f.ONE;\n let d = num;\n while (power > _0n) {\n if (power & _1n)\n p = f.mul(p, d);\n d = f.sqr(d);\n power >>= _1n;\n }\n return p;\n}\n/**\n * Efficiently invert an array of Field elements.\n * `inv(0)` will return `undefined` here: make sure to throw an error.\n */\nexport function FpInvertBatch(f, nums) {\n const tmp = new Array(nums.length);\n // Walk from first to last, multiply them by each other MOD p\n const lastMultiplied = nums.reduce((acc, num, i) => {\n if (f.is0(num))\n return acc;\n tmp[i] = acc;\n return f.mul(acc, num);\n }, f.ONE);\n // Invert last element\n const inverted = f.inv(lastMultiplied);\n // Walk from last to first, multiply them by inverted each other MOD p\n nums.reduceRight((acc, num, i) => {\n if (f.is0(num))\n return acc;\n tmp[i] = f.mul(acc, tmp[i]);\n return f.mul(acc, num);\n }, inverted);\n return tmp;\n}\nexport function FpDiv(f, lhs, rhs) {\n return f.mul(lhs, typeof rhs === 'bigint' ? invert(rhs, f.ORDER) : f.inv(rhs));\n}\n// This function returns True whenever the value x is a square in the field F.\nexport function FpIsSquare(f) {\n const legendreConst = (f.ORDER - _1n) / _2n; // Integer arithmetic\n return (x) => {\n const p = f.pow(x, legendreConst);\n return f.eql(p, f.ZERO) || f.eql(p, f.ONE);\n };\n}\n// CURVE.n lengths\nexport function nLength(n, nBitLength) {\n // Bit size, byte size of CURVE.n\n const _nBitLength = nBitLength !== undefined ? nBitLength : n.toString(2).length;\n const nByteLength = Math.ceil(_nBitLength / 8);\n return { nBitLength: _nBitLength, nByteLength };\n}\n/**\n * Initializes a finite field over prime. **Non-primes are not supported.**\n * Do not init in loop: slow. Very fragile: always run a benchmark on a change.\n * Major performance optimizations:\n * * a) denormalized operations like mulN instead of mul\n * * b) same object shape: never add or remove keys\n * * c) Object.freeze\n * @param ORDER prime positive bigint\n * @param bitLen how many bits the field consumes\n * @param isLE (def: false) if encoding / decoding should be in little-endian\n * @param redef optional faster redefinitions of sqrt and other methods\n */\nexport function Field(ORDER, bitLen, isLE = false, redef = {}) {\n if (ORDER <= _0n)\n throw new Error(`Expected Field ORDER > 0, got ${ORDER}`);\n const { nBitLength: BITS, nByteLength: BYTES } = nLength(ORDER, bitLen);\n if (BYTES > 2048)\n throw new Error('Field lengths over 2048 bytes are not supported');\n const sqrtP = FpSqrt(ORDER);\n const f = Object.freeze({\n ORDER,\n BITS,\n BYTES,\n MASK: bitMask(BITS),\n ZERO: _0n,\n ONE: _1n,\n create: (num) => mod(num, ORDER),\n isValid: (num) => {\n if (typeof num !== 'bigint')\n throw new Error(`Invalid field element: expected bigint, got ${typeof num}`);\n return _0n <= num && num < ORDER; // 0 is valid element, but it's not invertible\n },\n is0: (num) => num === _0n,\n isOdd: (num) => (num & _1n) === _1n,\n neg: (num) => mod(-num, ORDER),\n eql: (lhs, rhs) => lhs === rhs,\n sqr: (num) => mod(num * num, ORDER),\n add: (lhs, rhs) => mod(lhs + rhs, ORDER),\n sub: (lhs, rhs) => mod(lhs - rhs, ORDER),\n mul: (lhs, rhs) => mod(lhs * rhs, ORDER),\n pow: (num, power) => FpPow(f, num, power),\n div: (lhs, rhs) => mod(lhs * invert(rhs, ORDER), ORDER),\n // Same as above, but doesn't normalize\n sqrN: (num) => num * num,\n addN: (lhs, rhs) => lhs + rhs,\n subN: (lhs, rhs) => lhs - rhs,\n mulN: (lhs, rhs) => lhs * rhs,\n inv: (num) => invert(num, ORDER),\n sqrt: redef.sqrt || ((n) => sqrtP(f, n)),\n invertBatch: (lst) => FpInvertBatch(f, lst),\n // TODO: do we really need constant cmov?\n // We don't have const-time bigints anyway, so probably will be not very useful\n cmov: (a, b, c) => (c ? b : a),\n toBytes: (num) => (isLE ? numberToBytesLE(num, BYTES) : numberToBytesBE(num, BYTES)),\n fromBytes: (bytes) => {\n if (bytes.length !== BYTES)\n throw new Error(`Fp.fromBytes: expected ${BYTES}, got ${bytes.length}`);\n return isLE ? bytesToNumberLE(bytes) : bytesToNumberBE(bytes);\n },\n });\n return Object.freeze(f);\n}\nexport function FpSqrtOdd(Fp, elm) {\n if (!Fp.isOdd)\n throw new Error(`Field doesn't have isOdd`);\n const root = Fp.sqrt(elm);\n return Fp.isOdd(root) ? root : Fp.neg(root);\n}\nexport function FpSqrtEven(Fp, elm) {\n if (!Fp.isOdd)\n throw new Error(`Field doesn't have isOdd`);\n const root = Fp.sqrt(elm);\n return Fp.isOdd(root) ? Fp.neg(root) : root;\n}\n/**\n * \"Constant-time\" private key generation utility.\n * Same as mapKeyToField, but accepts less bytes (40 instead of 48 for 32-byte field).\n * Which makes it slightly more biased, less secure.\n * @deprecated use mapKeyToField instead\n */\nexport function hashToPrivateScalar(hash, groupOrder, isLE = false) {\n hash = ensureBytes('privateHash', hash);\n const hashLen = hash.length;\n const minLen = nLength(groupOrder).nByteLength + 8;\n if (minLen < 24 || hashLen < minLen || hashLen > 1024)\n throw new Error(`hashToPrivateScalar: expected ${minLen}-1024 bytes of input, got ${hashLen}`);\n const num = isLE ? bytesToNumberLE(hash) : bytesToNumberBE(hash);\n return mod(num, groupOrder - _1n) + _1n;\n}\n/**\n * Returns total number of bytes consumed by the field element.\n * For example, 32 bytes for usual 256-bit weierstrass curve.\n * @param fieldOrder number of field elements, usually CURVE.n\n * @returns byte length of field\n */\nexport function getFieldBytesLength(fieldOrder) {\n if (typeof fieldOrder !== 'bigint')\n throw new Error('field order must be bigint');\n const bitLength = fieldOrder.toString(2).length;\n return Math.ceil(bitLength / 8);\n}\n/**\n * Returns minimal amount of bytes that can be safely reduced\n * by field order.\n * Should be 2^-128 for 128-bit curve such as P256.\n * @param fieldOrder number of field elements, usually CURVE.n\n * @returns byte length of target hash\n */\nexport function getMinHashLength(fieldOrder) {\n const length = getFieldBytesLength(fieldOrder);\n return length + Math.ceil(length / 2);\n}\n/**\n * \"Constant-time\" private key generation utility.\n * Can take (n + n/2) or more bytes of uniform input e.g. from CSPRNG or KDF\n * and convert them into private scalar, with the modulo bias being negligible.\n * Needs at least 48 bytes of input for 32-byte private key.\n * https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/\n * FIPS 186-5, A.2 https://csrc.nist.gov/publications/detail/fips/186/5/final\n * RFC 9380, https://www.rfc-editor.org/rfc/rfc9380#section-5\n * @param hash hash output from SHA3 or a similar function\n * @param groupOrder size of subgroup - (e.g. secp256k1.CURVE.n)\n * @param isLE interpret hash bytes as LE num\n * @returns valid private scalar\n */\nexport function mapHashToField(key, fieldOrder, isLE = false) {\n const len = key.length;\n const fieldLen = getFieldBytesLength(fieldOrder);\n const minLen = getMinHashLength(fieldOrder);\n // No small numbers: need to understand bias story. No huge numbers: easier to detect JS timings.\n if (len < 16 || len < minLen || len > 1024)\n throw new Error(`expected ${minLen}-1024 bytes of input, got ${len}`);\n const num = isLE ? bytesToNumberBE(key) : bytesToNumberLE(key);\n // `mod(x, 11)` can sometimes produce 0. `mod(x, 10) + 1` is the same, but no 0\n const reduced = mod(num, fieldOrder - _1n) + _1n;\n return isLE ? numberToBytesLE(reduced, fieldLen) : numberToBytesBE(reduced, fieldLen);\n}\n//# sourceMappingURL=modular.js.map","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// Abelian group utilities\nimport { validateField, nLength } from './modular.js';\nimport { validateObject } from './utils.js';\nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\n// Elliptic curve multiplication of Point by scalar. Fragile.\n// Scalars should always be less than curve order: this should be checked inside of a curve itself.\n// Creates precomputation tables for fast multiplication:\n// - private scalar is split by fixed size windows of W bits\n// - every window point is collected from window's table & added to accumulator\n// - since windows are different, same point inside tables won't be accessed more than once per calc\n// - each multiplication is 'Math.ceil(CURVE_ORDER / 𝑊) + 1' point additions (fixed for any scalar)\n// - +1 window is neccessary for wNAF\n// - wNAF reduces table size: 2x less memory + 2x faster generation, but 10% slower multiplication\n// TODO: Research returning 2d JS array of windows, instead of a single window. This would allow\n// windows to be in different memory locations\nexport function wNAF(c, bits) {\n const constTimeNegate = (condition, item) => {\n const neg = item.negate();\n return condition ? neg : item;\n };\n const opts = (W) => {\n const windows = Math.ceil(bits / W) + 1; // +1, because\n const windowSize = 2 ** (W - 1); // -1 because we skip zero\n return { windows, windowSize };\n };\n return {\n constTimeNegate,\n // non-const time multiplication ladder\n unsafeLadder(elm, n) {\n let p = c.ZERO;\n let d = elm;\n while (n > _0n) {\n if (n & _1n)\n p = p.add(d);\n d = d.double();\n n >>= _1n;\n }\n return p;\n },\n /**\n * Creates a wNAF precomputation window. Used for caching.\n * Default window size is set by `utils.precompute()` and is equal to 8.\n * Number of precomputed points depends on the curve size:\n * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where:\n * - 𝑊 is the window size\n * - 𝑛 is the bitlength of the curve order.\n * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224.\n * @returns precomputed point tables flattened to a single array\n */\n precomputeWindow(elm, W) {\n const { windows, windowSize } = opts(W);\n const points = [];\n let p = elm;\n let base = p;\n for (let window = 0; window < windows; window++) {\n base = p;\n points.push(base);\n // =1, because we skip zero\n for (let i = 1; i < windowSize; i++) {\n base = base.add(p);\n points.push(base);\n }\n p = base.double();\n }\n return points;\n },\n /**\n * Implements ec multiplication using precomputed tables and w-ary non-adjacent form.\n * @param W window size\n * @param precomputes precomputed tables\n * @param n scalar (we don't check here, but should be less than curve order)\n * @returns real and fake (for const-time) points\n */\n wNAF(W, precomputes, n) {\n // TODO: maybe check that scalar is less than group order? wNAF behavious is undefined otherwise\n // But need to carefully remove other checks before wNAF. ORDER == bits here\n const { windows, windowSize } = opts(W);\n let p = c.ZERO;\n let f = c.BASE;\n const mask = BigInt(2 ** W - 1); // Create mask with W ones: 0b1111 for W=4 etc.\n const maxNumber = 2 ** W;\n const shiftBy = BigInt(W);\n for (let window = 0; window < windows; window++) {\n const offset = window * windowSize;\n // Extract W bits.\n let wbits = Number(n & mask);\n // Shift number by W bits.\n n >>= shiftBy;\n // If the bits are bigger than max size, we'll split those.\n // +224 => 256 - 32\n if (wbits > windowSize) {\n wbits -= maxNumber;\n n += _1n;\n }\n // This code was first written with assumption that 'f' and 'p' will never be infinity point:\n // since each addition is multiplied by 2 ** W, it cannot cancel each other. However,\n // there is negate now: it is possible that negated element from low value\n // would be the same as high element, which will create carry into next window.\n // It's not obvious how this can fail, but still worth investigating later.\n // Check if we're onto Zero point.\n // Add random point inside current window to f.\n const offset1 = offset;\n const offset2 = offset + Math.abs(wbits) - 1; // -1 because we skip zero\n const cond1 = window % 2 !== 0;\n const cond2 = wbits < 0;\n if (wbits === 0) {\n // The most important part for const-time getPublicKey\n f = f.add(constTimeNegate(cond1, precomputes[offset1]));\n }\n else {\n p = p.add(constTimeNegate(cond2, precomputes[offset2]));\n }\n }\n // JIT-compiler should not eliminate f here, since it will later be used in normalizeZ()\n // Even if the variable is still unused, there are some checks which will\n // throw an exception, so compiler needs to prove they won't happen, which is hard.\n // At this point there is a way to F be infinity-point even if p is not,\n // which makes it less const-time: around 1 bigint multiply.\n return { p, f };\n },\n wNAFCached(P, precomputesMap, n, transform) {\n // @ts-ignore\n const W = P._WINDOW_SIZE || 1;\n // Calculate precomputes on a first run, reuse them after\n let comp = precomputesMap.get(P);\n if (!comp) {\n comp = this.precomputeWindow(P, W);\n if (W !== 1) {\n precomputesMap.set(P, transform(comp));\n }\n }\n return this.wNAF(W, comp, n);\n },\n };\n}\nexport function validateBasic(curve) {\n validateField(curve.Fp);\n validateObject(curve, {\n n: 'bigint',\n h: 'bigint',\n Gx: 'field',\n Gy: 'field',\n }, {\n nBitLength: 'isSafeInteger',\n nByteLength: 'isSafeInteger',\n });\n // Set defaults\n return Object.freeze({\n ...nLength(curve.n, curve.nBitLength),\n ...curve,\n ...{ p: curve.Fp.ORDER },\n });\n}\n//# sourceMappingURL=curve.js.map","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// Short Weierstrass curve. The formula is: y² = x³ + ax + b\nimport * as mod from './modular.js';\nimport * as ut from './utils.js';\nimport { ensureBytes } from './utils.js';\nimport { wNAF, validateBasic } from './curve.js';\nfunction validatePointOpts(curve) {\n const opts = validateBasic(curve);\n ut.validateObject(opts, {\n a: 'field',\n b: 'field',\n }, {\n allowedPrivateKeyLengths: 'array',\n wrapPrivateKey: 'boolean',\n isTorsionFree: 'function',\n clearCofactor: 'function',\n allowInfinityPoint: 'boolean',\n fromBytes: 'function',\n toBytes: 'function',\n });\n const { endo, Fp, a } = opts;\n if (endo) {\n if (!Fp.eql(a, Fp.ZERO)) {\n throw new Error('Endomorphism can only be defined for Koblitz curves that have a=0');\n }\n if (typeof endo !== 'object' ||\n typeof endo.beta !== 'bigint' ||\n typeof endo.splitScalar !== 'function') {\n throw new Error('Expected endomorphism with beta: bigint and splitScalar: function');\n }\n }\n return Object.freeze({ ...opts });\n}\n// ASN.1 DER encoding utilities\nconst { bytesToNumberBE: b2n, hexToBytes: h2b } = ut;\nexport const DER = {\n // asn.1 DER encoding utils\n Err: class DERErr extends Error {\n constructor(m = '') {\n super(m);\n }\n },\n _parseInt(data) {\n const { Err: E } = DER;\n if (data.length < 2 || data[0] !== 0x02)\n throw new E('Invalid signature integer tag');\n const len = data[1];\n const res = data.subarray(2, len + 2);\n if (!len || res.length !== len)\n throw new E('Invalid signature integer: wrong length');\n // https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag,\n // since we always use positive integers here. It must always be empty:\n // - add zero byte if exists\n // - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding)\n if (res[0] & 0b10000000)\n throw new E('Invalid signature integer: negative');\n if (res[0] === 0x00 && !(res[1] & 0b10000000))\n throw new E('Invalid signature integer: unnecessary leading zero');\n return { d: b2n(res), l: data.subarray(len + 2) }; // d is data, l is left\n },\n toSig(hex) {\n // parse DER signature\n const { Err: E } = DER;\n const data = typeof hex === 'string' ? h2b(hex) : hex;\n if (!(data instanceof Uint8Array))\n throw new Error('ui8a expected');\n let l = data.length;\n if (l < 2 || data[0] != 0x30)\n throw new E('Invalid signature tag');\n if (data[1] !== l - 2)\n throw new E('Invalid signature: incorrect length');\n const { d: r, l: sBytes } = DER._parseInt(data.subarray(2));\n const { d: s, l: rBytesLeft } = DER._parseInt(sBytes);\n if (rBytesLeft.length)\n throw new E('Invalid signature: left bytes after parsing');\n return { r, s };\n },\n hexFromSig(sig) {\n // Add leading zero if first byte has negative bit enabled. More details in '_parseInt'\n const slice = (s) => (Number.parseInt(s[0], 16) & 0b1000 ? '00' + s : s);\n const h = (num) => {\n const hex = num.toString(16);\n return hex.length & 1 ? `0${hex}` : hex;\n };\n const s = slice(h(sig.s));\n const r = slice(h(sig.r));\n const shl = s.length / 2;\n const rhl = r.length / 2;\n const sl = h(shl);\n const rl = h(rhl);\n return `30${h(rhl + shl + 4)}02${rl}${r}02${sl}${s}`;\n },\n};\n// Be friendly to bad ECMAScript parsers by not using bigint literals\n// prettier-ignore\nconst _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = BigInt(4);\nexport function weierstrassPoints(opts) {\n const CURVE = validatePointOpts(opts);\n const { Fp } = CURVE; // All curves has same field / group length as for now, but they can differ\n const toBytes = CURVE.toBytes ||\n ((_c, point, _isCompressed) => {\n const a = point.toAffine();\n return ut.concatBytes(Uint8Array.from([0x04]), Fp.toBytes(a.x), Fp.toBytes(a.y));\n });\n const fromBytes = CURVE.fromBytes ||\n ((bytes) => {\n // const head = bytes[0];\n const tail = bytes.subarray(1);\n // if (head !== 0x04) throw new Error('Only non-compressed encoding is supported');\n const x = Fp.fromBytes(tail.subarray(0, Fp.BYTES));\n const y = Fp.fromBytes(tail.subarray(Fp.BYTES, 2 * Fp.BYTES));\n return { x, y };\n });\n /**\n * y² = x³ + ax + b: Short weierstrass curve formula\n * @returns y²\n */\n function weierstrassEquation(x) {\n const { a, b } = CURVE;\n const x2 = Fp.sqr(x); // x * x\n const x3 = Fp.mul(x2, x); // x2 * x\n return Fp.add(Fp.add(x3, Fp.mul(x, a)), b); // x3 + a * x + b\n }\n // Validate whether the passed curve params are valid.\n // We check if curve equation works for generator point.\n // `assertValidity()` won't work: `isTorsionFree()` is not available at this point in bls12-381.\n // ProjectivePoint class has not been initialized yet.\n if (!Fp.eql(Fp.sqr(CURVE.Gy), weierstrassEquation(CURVE.Gx)))\n throw new Error('bad generator point: equation left != right');\n // Valid group elements reside in range 1..n-1\n function isWithinCurveOrder(num) {\n return typeof num === 'bigint' && _0n < num && num < CURVE.n;\n }\n function assertGE(num) {\n if (!isWithinCurveOrder(num))\n throw new Error('Expected valid bigint: 0 < bigint < curve.n');\n }\n // Validates if priv key is valid and converts it to bigint.\n // Supports options allowedPrivateKeyLengths and wrapPrivateKey.\n function normPrivateKeyToScalar(key) {\n const { allowedPrivateKeyLengths: lengths, nByteLength, wrapPrivateKey, n } = CURVE;\n if (lengths && typeof key !== 'bigint') {\n if (key instanceof Uint8Array)\n key = ut.bytesToHex(key);\n // Normalize to hex string, pad. E.g. P521 would norm 130-132 char hex to 132-char bytes\n if (typeof key !== 'string' || !lengths.includes(key.length))\n throw new Error('Invalid key');\n key = key.padStart(nByteLength * 2, '0');\n }\n let num;\n try {\n num =\n typeof key === 'bigint'\n ? key\n : ut.bytesToNumberBE(ensureBytes('private key', key, nByteLength));\n }\n catch (error) {\n throw new Error(`private key must be ${nByteLength} bytes, hex or bigint, not ${typeof key}`);\n }\n if (wrapPrivateKey)\n num = mod.mod(num, n); // disabled by default, enabled for BLS\n assertGE(num); // num in range [1..N-1]\n return num;\n }\n const pointPrecomputes = new Map();\n function assertPrjPoint(other) {\n if (!(other instanceof Point))\n throw new Error('ProjectivePoint expected');\n }\n /**\n * Projective Point works in 3d / projective (homogeneous) coordinates: (x, y, z) ∋ (x=x/z, y=y/z)\n * Default Point works in 2d / affine coordinates: (x, y)\n * We're doing calculations in projective, because its operations don't require costly inversion.\n */\n class Point {\n constructor(px, py, pz) {\n this.px = px;\n this.py = py;\n this.pz = pz;\n if (px == null || !Fp.isValid(px))\n throw new Error('x required');\n if (py == null || !Fp.isValid(py))\n throw new Error('y required');\n if (pz == null || !Fp.isValid(pz))\n throw new Error('z required');\n }\n // Does not validate if the point is on-curve.\n // Use fromHex instead, or call assertValidity() later.\n static fromAffine(p) {\n const { x, y } = p || {};\n if (!p || !Fp.isValid(x) || !Fp.isValid(y))\n throw new Error('invalid affine point');\n if (p instanceof Point)\n throw new Error('projective point not allowed');\n const is0 = (i) => Fp.eql(i, Fp.ZERO);\n // fromAffine(x:0, y:0) would produce (x:0, y:0, z:1), but we need (x:0, y:1, z:0)\n if (is0(x) && is0(y))\n return Point.ZERO;\n return new Point(x, y, Fp.ONE);\n }\n get x() {\n return this.toAffine().x;\n }\n get y() {\n return this.toAffine().y;\n }\n /**\n * Takes a bunch of Projective Points but executes only one\n * inversion on all of them. Inversion is very slow operation,\n * so this improves performance massively.\n * Optimization: converts a list of projective points to a list of identical points with Z=1.\n */\n static normalizeZ(points) {\n const toInv = Fp.invertBatch(points.map((p) => p.pz));\n return points.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine);\n }\n /**\n * Converts hash string or Uint8Array to Point.\n * @param hex short/long ECDSA hex\n */\n static fromHex(hex) {\n const P = Point.fromAffine(fromBytes(ensureBytes('pointHex', hex)));\n P.assertValidity();\n return P;\n }\n // Multiplies generator point by privateKey.\n static fromPrivateKey(privateKey) {\n return Point.BASE.multiply(normPrivateKeyToScalar(privateKey));\n }\n // \"Private method\", don't use it directly\n _setWindowSize(windowSize) {\n this._WINDOW_SIZE = windowSize;\n pointPrecomputes.delete(this);\n }\n // A point on curve is valid if it conforms to equation.\n assertValidity() {\n if (this.is0()) {\n // (0, 1, 0) aka ZERO is invalid in most contexts.\n // In BLS, ZERO can be serialized, so we allow it.\n // (0, 0, 0) is wrong representation of ZERO and is always invalid.\n if (CURVE.allowInfinityPoint && !Fp.is0(this.py))\n return;\n throw new Error('bad point: ZERO');\n }\n // Some 3rd-party test vectors require different wording between here & `fromCompressedHex`\n const { x, y } = this.toAffine();\n // Check if x, y are valid field elements\n if (!Fp.isValid(x) || !Fp.isValid(y))\n throw new Error('bad point: x or y not FE');\n const left = Fp.sqr(y); // y²\n const right = weierstrassEquation(x); // x³ + ax + b\n if (!Fp.eql(left, right))\n throw new Error('bad point: equation left != right');\n if (!this.isTorsionFree())\n throw new Error('bad point: not in prime-order subgroup');\n }\n hasEvenY() {\n const { y } = this.toAffine();\n if (Fp.isOdd)\n return !Fp.isOdd(y);\n throw new Error(\"Field doesn't support isOdd\");\n }\n /**\n * Compare one point to another.\n */\n equals(other) {\n assertPrjPoint(other);\n const { px: X1, py: Y1, pz: Z1 } = this;\n const { px: X2, py: Y2, pz: Z2 } = other;\n const U1 = Fp.eql(Fp.mul(X1, Z2), Fp.mul(X2, Z1));\n const U2 = Fp.eql(Fp.mul(Y1, Z2), Fp.mul(Y2, Z1));\n return U1 && U2;\n }\n /**\n * Flips point to one corresponding to (x, -y) in Affine coordinates.\n */\n negate() {\n return new Point(this.px, Fp.neg(this.py), this.pz);\n }\n // Renes-Costello-Batina exception-free doubling formula.\n // There is 30% faster Jacobian formula, but it is not complete.\n // https://eprint.iacr.org/2015/1060, algorithm 3\n // Cost: 8M + 3S + 3*a + 2*b3 + 15add.\n double() {\n const { a, b } = CURVE;\n const b3 = Fp.mul(b, _3n);\n const { px: X1, py: Y1, pz: Z1 } = this;\n let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore\n let t0 = Fp.mul(X1, X1); // step 1\n let t1 = Fp.mul(Y1, Y1);\n let t2 = Fp.mul(Z1, Z1);\n let t3 = Fp.mul(X1, Y1);\n t3 = Fp.add(t3, t3); // step 5\n Z3 = Fp.mul(X1, Z1);\n Z3 = Fp.add(Z3, Z3);\n X3 = Fp.mul(a, Z3);\n Y3 = Fp.mul(b3, t2);\n Y3 = Fp.add(X3, Y3); // step 10\n X3 = Fp.sub(t1, Y3);\n Y3 = Fp.add(t1, Y3);\n Y3 = Fp.mul(X3, Y3);\n X3 = Fp.mul(t3, X3);\n Z3 = Fp.mul(b3, Z3); // step 15\n t2 = Fp.mul(a, t2);\n t3 = Fp.sub(t0, t2);\n t3 = Fp.mul(a, t3);\n t3 = Fp.add(t3, Z3);\n Z3 = Fp.add(t0, t0); // step 20\n t0 = Fp.add(Z3, t0);\n t0 = Fp.add(t0, t2);\n t0 = Fp.mul(t0, t3);\n Y3 = Fp.add(Y3, t0);\n t2 = Fp.mul(Y1, Z1); // step 25\n t2 = Fp.add(t2, t2);\n t0 = Fp.mul(t2, t3);\n X3 = Fp.sub(X3, t0);\n Z3 = Fp.mul(t2, t1);\n Z3 = Fp.add(Z3, Z3); // step 30\n Z3 = Fp.add(Z3, Z3);\n return new Point(X3, Y3, Z3);\n }\n // Renes-Costello-Batina exception-free addition formula.\n // There is 30% faster Jacobian formula, but it is not complete.\n // https://eprint.iacr.org/2015/1060, algorithm 1\n // Cost: 12M + 0S + 3*a + 3*b3 + 23add.\n add(other) {\n assertPrjPoint(other);\n const { px: X1, py: Y1, pz: Z1 } = this;\n const { px: X2, py: Y2, pz: Z2 } = other;\n let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore\n const a = CURVE.a;\n const b3 = Fp.mul(CURVE.b, _3n);\n let t0 = Fp.mul(X1, X2); // step 1\n let t1 = Fp.mul(Y1, Y2);\n let t2 = Fp.mul(Z1, Z2);\n let t3 = Fp.add(X1, Y1);\n let t4 = Fp.add(X2, Y2); // step 5\n t3 = Fp.mul(t3, t4);\n t4 = Fp.add(t0, t1);\n t3 = Fp.sub(t3, t4);\n t4 = Fp.add(X1, Z1);\n let t5 = Fp.add(X2, Z2); // step 10\n t4 = Fp.mul(t4, t5);\n t5 = Fp.add(t0, t2);\n t4 = Fp.sub(t4, t5);\n t5 = Fp.add(Y1, Z1);\n X3 = Fp.add(Y2, Z2); // step 15\n t5 = Fp.mul(t5, X3);\n X3 = Fp.add(t1, t2);\n t5 = Fp.sub(t5, X3);\n Z3 = Fp.mul(a, t4);\n X3 = Fp.mul(b3, t2); // step 20\n Z3 = Fp.add(X3, Z3);\n X3 = Fp.sub(t1, Z3);\n Z3 = Fp.add(t1, Z3);\n Y3 = Fp.mul(X3, Z3);\n t1 = Fp.add(t0, t0); // step 25\n t1 = Fp.add(t1, t0);\n t2 = Fp.mul(a, t2);\n t4 = Fp.mul(b3, t4);\n t1 = Fp.add(t1, t2);\n t2 = Fp.sub(t0, t2); // step 30\n t2 = Fp.mul(a, t2);\n t4 = Fp.add(t4, t2);\n t0 = Fp.mul(t1, t4);\n Y3 = Fp.add(Y3, t0);\n t0 = Fp.mul(t5, t4); // step 35\n X3 = Fp.mul(t3, X3);\n X3 = Fp.sub(X3, t0);\n t0 = Fp.mul(t3, t1);\n Z3 = Fp.mul(t5, Z3);\n Z3 = Fp.add(Z3, t0); // step 40\n return new Point(X3, Y3, Z3);\n }\n subtract(other) {\n return this.add(other.negate());\n }\n is0() {\n return this.equals(Point.ZERO);\n }\n wNAF(n) {\n return wnaf.wNAFCached(this, pointPrecomputes, n, (comp) => {\n const toInv = Fp.invertBatch(comp.map((p) => p.pz));\n return comp.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine);\n });\n }\n /**\n * Non-constant-time multiplication. Uses double-and-add algorithm.\n * It's faster, but should only be used when you don't care about\n * an exposed private key e.g. sig verification, which works over *public* keys.\n */\n multiplyUnsafe(n) {\n const I = Point.ZERO;\n if (n === _0n)\n return I;\n assertGE(n); // Will throw on 0\n if (n === _1n)\n return this;\n const { endo } = CURVE;\n if (!endo)\n return wnaf.unsafeLadder(this, n);\n // Apply endomorphism\n let { k1neg, k1, k2neg, k2 } = endo.splitScalar(n);\n let k1p = I;\n let k2p = I;\n let d = this;\n while (k1 > _0n || k2 > _0n) {\n if (k1 & _1n)\n k1p = k1p.add(d);\n if (k2 & _1n)\n k2p = k2p.add(d);\n d = d.double();\n k1 >>= _1n;\n k2 >>= _1n;\n }\n if (k1neg)\n k1p = k1p.negate();\n if (k2neg)\n k2p = k2p.negate();\n k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz);\n return k1p.add(k2p);\n }\n /**\n * Constant time multiplication.\n * Uses wNAF method. Windowed method may be 10% faster,\n * but takes 2x longer to generate and consumes 2x memory.\n * Uses precomputes when available.\n * Uses endomorphism for Koblitz curves.\n * @param scalar by which the point would be multiplied\n * @returns New point\n */\n multiply(scalar) {\n assertGE(scalar);\n let n = scalar;\n let point, fake; // Fake point is used to const-time mult\n const { endo } = CURVE;\n if (endo) {\n const { k1neg, k1, k2neg, k2 } = endo.splitScalar(n);\n let { p: k1p, f: f1p } = this.wNAF(k1);\n let { p: k2p, f: f2p } = this.wNAF(k2);\n k1p = wnaf.constTimeNegate(k1neg, k1p);\n k2p = wnaf.constTimeNegate(k2neg, k2p);\n k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz);\n point = k1p.add(k2p);\n fake = f1p.add(f2p);\n }\n else {\n const { p, f } = this.wNAF(n);\n point = p;\n fake = f;\n }\n // Normalize `z` for both points, but return only real one\n return Point.normalizeZ([point, fake])[0];\n }\n /**\n * Efficiently calculate `aP + bQ`. Unsafe, can expose private key, if used incorrectly.\n * Not using Strauss-Shamir trick: precomputation tables are faster.\n * The trick could be useful if both P and Q are not G (not in our case).\n * @returns non-zero affine point\n */\n multiplyAndAddUnsafe(Q, a, b) {\n const G = Point.BASE; // No Strauss-Shamir trick: we have 10% faster G precomputes\n const mul = (P, a // Select faster multiply() method\n ) => (a === _0n || a === _1n || !P.equals(G) ? P.multiplyUnsafe(a) : P.multiply(a));\n const sum = mul(this, a).add(mul(Q, b));\n return sum.is0() ? undefined : sum;\n }\n // Converts Projective point to affine (x, y) coordinates.\n // Can accept precomputed Z^-1 - for example, from invertBatch.\n // (x, y, z) ∋ (x=x/z, y=y/z)\n toAffine(iz) {\n const { px: x, py: y, pz: z } = this;\n const is0 = this.is0();\n // If invZ was 0, we return zero point. However we still want to execute\n // all operations, so we replace invZ with a random number, 1.\n if (iz == null)\n iz = is0 ? Fp.ONE : Fp.inv(z);\n const ax = Fp.mul(x, iz);\n const ay = Fp.mul(y, iz);\n const zz = Fp.mul(z, iz);\n if (is0)\n return { x: Fp.ZERO, y: Fp.ZERO };\n if (!Fp.eql(zz, Fp.ONE))\n throw new Error('invZ was invalid');\n return { x: ax, y: ay };\n }\n isTorsionFree() {\n const { h: cofactor, isTorsionFree } = CURVE;\n if (cofactor === _1n)\n return true; // No subgroups, always torsion-free\n if (isTorsionFree)\n return isTorsionFree(Point, this);\n throw new Error('isTorsionFree() has not been declared for the elliptic curve');\n }\n clearCofactor() {\n const { h: cofactor, clearCofactor } = CURVE;\n if (cofactor === _1n)\n return this; // Fast-path\n if (clearCofactor)\n return clearCofactor(Point, this);\n return this.multiplyUnsafe(CURVE.h);\n }\n toRawBytes(isCompressed = true) {\n this.assertValidity();\n return toBytes(Point, this, isCompressed);\n }\n toHex(isCompressed = true) {\n return ut.bytesToHex(this.toRawBytes(isCompressed));\n }\n }\n Point.BASE = new Point(CURVE.Gx, CURVE.Gy, Fp.ONE);\n Point.ZERO = new Point(Fp.ZERO, Fp.ONE, Fp.ZERO);\n const _bits = CURVE.nBitLength;\n const wnaf = wNAF(Point, CURVE.endo ? Math.ceil(_bits / 2) : _bits);\n // Validate if generator point is on curve\n return {\n CURVE,\n ProjectivePoint: Point,\n normPrivateKeyToScalar,\n weierstrassEquation,\n isWithinCurveOrder,\n };\n}\nfunction validateOpts(curve) {\n const opts = validateBasic(curve);\n ut.validateObject(opts, {\n hash: 'hash',\n hmac: 'function',\n randomBytes: 'function',\n }, {\n bits2int: 'function',\n bits2int_modN: 'function',\n lowS: 'boolean',\n });\n return Object.freeze({ lowS: true, ...opts });\n}\nexport function weierstrass(curveDef) {\n const CURVE = validateOpts(curveDef);\n const { Fp, n: CURVE_ORDER } = CURVE;\n const compressedLen = Fp.BYTES + 1; // e.g. 33 for 32\n const uncompressedLen = 2 * Fp.BYTES + 1; // e.g. 65 for 32\n function isValidFieldElement(num) {\n return _0n < num && num < Fp.ORDER; // 0 is banned since it's not invertible FE\n }\n function modN(a) {\n return mod.mod(a, CURVE_ORDER);\n }\n function invN(a) {\n return mod.invert(a, CURVE_ORDER);\n }\n const { ProjectivePoint: Point, normPrivateKeyToScalar, weierstrassEquation, isWithinCurveOrder, } = weierstrassPoints({\n ...CURVE,\n toBytes(_c, point, isCompressed) {\n const a = point.toAffine();\n const x = Fp.toBytes(a.x);\n const cat = ut.concatBytes;\n if (isCompressed) {\n return cat(Uint8Array.from([point.hasEvenY() ? 0x02 : 0x03]), x);\n }\n else {\n return cat(Uint8Array.from([0x04]), x, Fp.toBytes(a.y));\n }\n },\n fromBytes(bytes) {\n const len = bytes.length;\n const head = bytes[0];\n const tail = bytes.subarray(1);\n // this.assertValidity() is done inside of fromHex\n if (len === compressedLen && (head === 0x02 || head === 0x03)) {\n const x = ut.bytesToNumberBE(tail);\n if (!isValidFieldElement(x))\n throw new Error('Point is not on curve');\n const y2 = weierstrassEquation(x); // y² = x³ + ax + b\n let y = Fp.sqrt(y2); // y = y² ^ (p+1)/4\n const isYOdd = (y & _1n) === _1n;\n // ECDSA\n const isHeadOdd = (head & 1) === 1;\n if (isHeadOdd !== isYOdd)\n y = Fp.neg(y);\n return { x, y };\n }\n else if (len === uncompressedLen && head === 0x04) {\n const x = Fp.fromBytes(tail.subarray(0, Fp.BYTES));\n const y = Fp.fromBytes(tail.subarray(Fp.BYTES, 2 * Fp.BYTES));\n return { x, y };\n }\n else {\n throw new Error(`Point of length ${len} was invalid. Expected ${compressedLen} compressed bytes or ${uncompressedLen} uncompressed bytes`);\n }\n },\n });\n const numToNByteStr = (num) => ut.bytesToHex(ut.numberToBytesBE(num, CURVE.nByteLength));\n function isBiggerThanHalfOrder(number) {\n const HALF = CURVE_ORDER >> _1n;\n return number > HALF;\n }\n function normalizeS(s) {\n return isBiggerThanHalfOrder(s) ? modN(-s) : s;\n }\n // slice bytes num\n const slcNum = (b, from, to) => ut.bytesToNumberBE(b.slice(from, to));\n /**\n * ECDSA signature with its (r, s) properties. Supports DER & compact representations.\n */\n class Signature {\n constructor(r, s, recovery) {\n this.r = r;\n this.s = s;\n this.recovery = recovery;\n this.assertValidity();\n }\n // pair (bytes of r, bytes of s)\n static fromCompact(hex) {\n const l = CURVE.nByteLength;\n hex = ensureBytes('compactSignature', hex, l * 2);\n return new Signature(slcNum(hex, 0, l), slcNum(hex, l, 2 * l));\n }\n // DER encoded ECDSA signature\n // https://bitcoin.stackexchange.com/questions/57644/what-are-the-parts-of-a-bitcoin-transaction-input-script\n static fromDER(hex) {\n const { r, s } = DER.toSig(ensureBytes('DER', hex));\n return new Signature(r, s);\n }\n assertValidity() {\n // can use assertGE here\n if (!isWithinCurveOrder(this.r))\n throw new Error('r must be 0 < r < CURVE.n');\n if (!isWithinCurveOrder(this.s))\n throw new Error('s must be 0 < s < CURVE.n');\n }\n addRecoveryBit(recovery) {\n return new Signature(this.r, this.s, recovery);\n }\n recoverPublicKey(msgHash) {\n const { r, s, recovery: rec } = this;\n const h = bits2int_modN(ensureBytes('msgHash', msgHash)); // Truncate hash\n if (rec == null || ![0, 1, 2, 3].includes(rec))\n throw new Error('recovery id invalid');\n const radj = rec === 2 || rec === 3 ? r + CURVE.n : r;\n if (radj >= Fp.ORDER)\n throw new Error('recovery id 2 or 3 invalid');\n const prefix = (rec & 1) === 0 ? '02' : '03';\n const R = Point.fromHex(prefix + numToNByteStr(radj));\n const ir = invN(radj); // r^-1\n const u1 = modN(-h * ir); // -hr^-1\n const u2 = modN(s * ir); // sr^-1\n const Q = Point.BASE.multiplyAndAddUnsafe(R, u1, u2); // (sr^-1)R-(hr^-1)G = -(hr^-1)G + (sr^-1)\n if (!Q)\n throw new Error('point at infinify'); // unsafe is fine: no priv data leaked\n Q.assertValidity();\n return Q;\n }\n // Signatures should be low-s, to prevent malleability.\n hasHighS() {\n return isBiggerThanHalfOrder(this.s);\n }\n normalizeS() {\n return this.hasHighS() ? new Signature(this.r, modN(-this.s), this.recovery) : this;\n }\n // DER-encoded\n toDERRawBytes() {\n return ut.hexToBytes(this.toDERHex());\n }\n toDERHex() {\n return DER.hexFromSig({ r: this.r, s: this.s });\n }\n // padded bytes of r, then padded bytes of s\n toCompactRawBytes() {\n return ut.hexToBytes(this.toCompactHex());\n }\n toCompactHex() {\n return numToNByteStr(this.r) + numToNByteStr(this.s);\n }\n }\n const utils = {\n isValidPrivateKey(privateKey) {\n try {\n normPrivateKeyToScalar(privateKey);\n return true;\n }\n catch (error) {\n return false;\n }\n },\n normPrivateKeyToScalar: normPrivateKeyToScalar,\n /**\n * Produces cryptographically secure private key from random of size\n * (groupLen + ceil(groupLen / 2)) with modulo bias being negligible.\n */\n randomPrivateKey: () => {\n const length = mod.getMinHashLength(CURVE.n);\n return mod.mapHashToField(CURVE.randomBytes(length), CURVE.n);\n },\n /**\n * Creates precompute table for an arbitrary EC point. Makes point \"cached\".\n * Allows to massively speed-up `point.multiply(scalar)`.\n * @returns cached point\n * @example\n * const fast = utils.precompute(8, ProjectivePoint.fromHex(someonesPubKey));\n * fast.multiply(privKey); // much faster ECDH now\n */\n precompute(windowSize = 8, point = Point.BASE) {\n point._setWindowSize(windowSize);\n point.multiply(BigInt(3)); // 3 is arbitrary, just need any number here\n return point;\n },\n };\n /**\n * Computes public key for a private key. Checks for validity of the private key.\n * @param privateKey private key\n * @param isCompressed whether to return compact (default), or full key\n * @returns Public key, full when isCompressed=false; short when isCompressed=true\n */\n function getPublicKey(privateKey, isCompressed = true) {\n return Point.fromPrivateKey(privateKey).toRawBytes(isCompressed);\n }\n /**\n * Quick and dirty check for item being public key. Does not validate hex, or being on-curve.\n */\n function isProbPub(item) {\n const arr = item instanceof Uint8Array;\n const str = typeof item === 'string';\n const len = (arr || str) && item.length;\n if (arr)\n return len === compressedLen || len === uncompressedLen;\n if (str)\n return len === 2 * compressedLen || len === 2 * uncompressedLen;\n if (item instanceof Point)\n return true;\n return false;\n }\n /**\n * ECDH (Elliptic Curve Diffie Hellman).\n * Computes shared public key from private key and public key.\n * Checks: 1) private key validity 2) shared key is on-curve.\n * Does NOT hash the result.\n * @param privateA private key\n * @param publicB different public key\n * @param isCompressed whether to return compact (default), or full key\n * @returns shared public key\n */\n function getSharedSecret(privateA, publicB, isCompressed = true) {\n if (isProbPub(privateA))\n throw new Error('first arg must be private key');\n if (!isProbPub(publicB))\n throw new Error('second arg must be public key');\n const b = Point.fromHex(publicB); // check for being on-curve\n return b.multiply(normPrivateKeyToScalar(privateA)).toRawBytes(isCompressed);\n }\n // RFC6979: ensure ECDSA msg is X bytes and < N. RFC suggests optional truncating via bits2octets.\n // FIPS 186-4 4.6 suggests the leftmost min(nBitLen, outLen) bits, which matches bits2int.\n // bits2int can produce res>N, we can do mod(res, N) since the bitLen is the same.\n // int2octets can't be used; pads small msgs with 0: unacceptatble for trunc as per RFC vectors\n const bits2int = CURVE.bits2int ||\n function (bytes) {\n // For curves with nBitLength % 8 !== 0: bits2octets(bits2octets(m)) !== bits2octets(m)\n // for some cases, since bytes.length * 8 is not actual bitLength.\n const num = ut.bytesToNumberBE(bytes); // check for == u8 done here\n const delta = bytes.length * 8 - CURVE.nBitLength; // truncate to nBitLength leftmost bits\n return delta > 0 ? num >> BigInt(delta) : num;\n };\n const bits2int_modN = CURVE.bits2int_modN ||\n function (bytes) {\n return modN(bits2int(bytes)); // can't use bytesToNumberBE here\n };\n // NOTE: pads output with zero as per spec\n const ORDER_MASK = ut.bitMask(CURVE.nBitLength);\n /**\n * Converts to bytes. Checks if num in `[0..ORDER_MASK-1]` e.g.: `[0..2^256-1]`.\n */\n function int2octets(num) {\n if (typeof num !== 'bigint')\n throw new Error('bigint expected');\n if (!(_0n <= num && num < ORDER_MASK))\n throw new Error(`bigint expected < 2^${CURVE.nBitLength}`);\n // works with order, can have different size than numToField!\n return ut.numberToBytesBE(num, CURVE.nByteLength);\n }\n // Steps A, D of RFC6979 3.2\n // Creates RFC6979 seed; converts msg/privKey to numbers.\n // Used only in sign, not in verify.\n // NOTE: we cannot assume here that msgHash has same amount of bytes as curve order, this will be wrong at least for P521.\n // Also it can be bigger for P224 + SHA256\n function prepSig(msgHash, privateKey, opts = defaultSigOpts) {\n if (['recovered', 'canonical'].some((k) => k in opts))\n throw new Error('sign() legacy options not supported');\n const { hash, randomBytes } = CURVE;\n let { lowS, prehash, extraEntropy: ent } = opts; // generates low-s sigs by default\n if (lowS == null)\n lowS = true; // RFC6979 3.2: we skip step A, because we already provide hash\n msgHash = ensureBytes('msgHash', msgHash);\n if (prehash)\n msgHash = ensureBytes('prehashed msgHash', hash(msgHash));\n // We can't later call bits2octets, since nested bits2int is broken for curves\n // with nBitLength % 8 !== 0. Because of that, we unwrap it here as int2octets call.\n // const bits2octets = (bits) => int2octets(bits2int_modN(bits))\n const h1int = bits2int_modN(msgHash);\n const d = normPrivateKeyToScalar(privateKey); // validate private key, convert to bigint\n const seedArgs = [int2octets(d), int2octets(h1int)];\n // extraEntropy. RFC6979 3.6: additional k' (optional).\n if (ent != null) {\n // K = HMAC_K(V || 0x00 || int2octets(x) || bits2octets(h1) || k')\n const e = ent === true ? randomBytes(Fp.BYTES) : ent; // generate random bytes OR pass as-is\n seedArgs.push(ensureBytes('extraEntropy', e)); // check for being bytes\n }\n const seed = ut.concatBytes(...seedArgs); // Step D of RFC6979 3.2\n const m = h1int; // NOTE: no need to call bits2int second time here, it is inside truncateHash!\n // Converts signature params into point w r/s, checks result for validity.\n function k2sig(kBytes) {\n // RFC 6979 Section 3.2, step 3: k = bits2int(T)\n const k = bits2int(kBytes); // Cannot use fields methods, since it is group element\n if (!isWithinCurveOrder(k))\n return; // Important: all mod() calls here must be done over N\n const ik = invN(k); // k^-1 mod n\n const q = Point.BASE.multiply(k).toAffine(); // q = Gk\n const r = modN(q.x); // r = q.x mod n\n if (r === _0n)\n return;\n // Can use scalar blinding b^-1(bm + bdr) where b ∈ [1,q−1] according to\n // https://tches.iacr.org/index.php/TCHES/article/view/7337/6509. We've decided against it:\n // a) dependency on CSPRNG b) 15% slowdown c) doesn't really help since bigints are not CT\n const s = modN(ik * modN(m + r * d)); // Not using blinding here\n if (s === _0n)\n return;\n let recovery = (q.x === r ? 0 : 2) | Number(q.y & _1n); // recovery bit (2 or 3, when q.x > n)\n let normS = s;\n if (lowS && isBiggerThanHalfOrder(s)) {\n normS = normalizeS(s); // if lowS was passed, ensure s is always\n recovery ^= 1; // // in the bottom half of N\n }\n return new Signature(r, normS, recovery); // use normS, not s\n }\n return { seed, k2sig };\n }\n const defaultSigOpts = { lowS: CURVE.lowS, prehash: false };\n const defaultVerOpts = { lowS: CURVE.lowS, prehash: false };\n /**\n * Signs message hash with a private key.\n * ```\n * sign(m, d, k) where\n * (x, y) = G × k\n * r = x mod n\n * s = (m + dr)/k mod n\n * ```\n * @param msgHash NOT message. msg needs to be hashed to `msgHash`, or use `prehash`.\n * @param privKey private key\n * @param opts lowS for non-malleable sigs. extraEntropy for mixing randomness into k. prehash will hash first arg.\n * @returns signature with recovery param\n */\n function sign(msgHash, privKey, opts = defaultSigOpts) {\n const { seed, k2sig } = prepSig(msgHash, privKey, opts); // Steps A, D of RFC6979 3.2.\n const C = CURVE;\n const drbg = ut.createHmacDrbg(C.hash.outputLen, C.nByteLength, C.hmac);\n return drbg(seed, k2sig); // Steps B, C, D, E, F, G\n }\n // Enable precomputes. Slows down first publicKey computation by 20ms.\n Point.BASE._setWindowSize(8);\n // utils.precompute(8, ProjectivePoint.BASE)\n /**\n * Verifies a signature against message hash and public key.\n * Rejects lowS signatures by default: to override,\n * specify option `{lowS: false}`. Implements section 4.1.4 from https://www.secg.org/sec1-v2.pdf:\n *\n * ```\n * verify(r, s, h, P) where\n * U1 = hs^-1 mod n\n * U2 = rs^-1 mod n\n * R = U1⋅G - U2⋅P\n * mod(R.x, n) == r\n * ```\n */\n function verify(signature, msgHash, publicKey, opts = defaultVerOpts) {\n const sg = signature;\n msgHash = ensureBytes('msgHash', msgHash);\n publicKey = ensureBytes('publicKey', publicKey);\n if ('strict' in opts)\n throw new Error('options.strict was renamed to lowS');\n const { lowS, prehash } = opts;\n let _sig = undefined;\n let P;\n try {\n if (typeof sg === 'string' || sg instanceof Uint8Array) {\n // Signature can be represented in 2 ways: compact (2*nByteLength) & DER (variable-length).\n // Since DER can also be 2*nByteLength bytes, we check for it first.\n try {\n _sig = Signature.fromDER(sg);\n }\n catch (derError) {\n if (!(derError instanceof DER.Err))\n throw derError;\n _sig = Signature.fromCompact(sg);\n }\n }\n else if (typeof sg === 'object' && typeof sg.r === 'bigint' && typeof sg.s === 'bigint') {\n const { r, s } = sg;\n _sig = new Signature(r, s);\n }\n else {\n throw new Error('PARSE');\n }\n P = Point.fromHex(publicKey);\n }\n catch (error) {\n if (error.message === 'PARSE')\n throw new Error(`signature must be Signature instance, Uint8Array or hex string`);\n return false;\n }\n if (lowS && _sig.hasHighS())\n return false;\n if (prehash)\n msgHash = CURVE.hash(msgHash);\n const { r, s } = _sig;\n const h = bits2int_modN(msgHash); // Cannot use fields methods, since it is group element\n const is = invN(s); // s^-1\n const u1 = modN(h * is); // u1 = hs^-1 mod n\n const u2 = modN(r * is); // u2 = rs^-1 mod n\n const R = Point.BASE.multiplyAndAddUnsafe(P, u1, u2)?.toAffine(); // R = u1⋅G + u2⋅P\n if (!R)\n return false;\n const v = modN(R.x);\n return v === r;\n }\n return {\n CURVE,\n getPublicKey,\n getSharedSecret,\n sign,\n verify,\n ProjectivePoint: Point,\n Signature,\n utils,\n };\n}\n/**\n * Implementation of the Shallue and van de Woestijne method for any weierstrass curve.\n * TODO: check if there is a way to merge this with uvRatio in Edwards; move to modular.\n * b = True and y = sqrt(u / v) if (u / v) is square in F, and\n * b = False and y = sqrt(Z * (u / v)) otherwise.\n * @param Fp\n * @param Z\n * @returns\n */\nexport function SWUFpSqrtRatio(Fp, Z) {\n // Generic implementation\n const q = Fp.ORDER;\n let l = _0n;\n for (let o = q - _1n; o % _2n === _0n; o /= _2n)\n l += _1n;\n const c1 = l; // 1. c1, the largest integer such that 2^c1 divides q - 1.\n // We need 2n ** c1 and 2n ** (c1-1). We can't use **; but we can use <<.\n // 2n ** c1 == 2n << (c1-1)\n const _2n_pow_c1_1 = _2n << (c1 - _1n - _1n);\n const _2n_pow_c1 = _2n_pow_c1_1 * _2n;\n const c2 = (q - _1n) / _2n_pow_c1; // 2. c2 = (q - 1) / (2^c1) # Integer arithmetic\n const c3 = (c2 - _1n) / _2n; // 3. c3 = (c2 - 1) / 2 # Integer arithmetic\n const c4 = _2n_pow_c1 - _1n; // 4. c4 = 2^c1 - 1 # Integer arithmetic\n const c5 = _2n_pow_c1_1; // 5. c5 = 2^(c1 - 1) # Integer arithmetic\n const c6 = Fp.pow(Z, c2); // 6. c6 = Z^c2\n const c7 = Fp.pow(Z, (c2 + _1n) / _2n); // 7. c7 = Z^((c2 + 1) / 2)\n let sqrtRatio = (u, v) => {\n let tv1 = c6; // 1. tv1 = c6\n let tv2 = Fp.pow(v, c4); // 2. tv2 = v^c4\n let tv3 = Fp.sqr(tv2); // 3. tv3 = tv2^2\n tv3 = Fp.mul(tv3, v); // 4. tv3 = tv3 * v\n let tv5 = Fp.mul(u, tv3); // 5. tv5 = u * tv3\n tv5 = Fp.pow(tv5, c3); // 6. tv5 = tv5^c3\n tv5 = Fp.mul(tv5, tv2); // 7. tv5 = tv5 * tv2\n tv2 = Fp.mul(tv5, v); // 8. tv2 = tv5 * v\n tv3 = Fp.mul(tv5, u); // 9. tv3 = tv5 * u\n let tv4 = Fp.mul(tv3, tv2); // 10. tv4 = tv3 * tv2\n tv5 = Fp.pow(tv4, c5); // 11. tv5 = tv4^c5\n let isQR = Fp.eql(tv5, Fp.ONE); // 12. isQR = tv5 == 1\n tv2 = Fp.mul(tv3, c7); // 13. tv2 = tv3 * c7\n tv5 = Fp.mul(tv4, tv1); // 14. tv5 = tv4 * tv1\n tv3 = Fp.cmov(tv2, tv3, isQR); // 15. tv3 = CMOV(tv2, tv3, isQR)\n tv4 = Fp.cmov(tv5, tv4, isQR); // 16. tv4 = CMOV(tv5, tv4, isQR)\n // 17. for i in (c1, c1 - 1, ..., 2):\n for (let i = c1; i > _1n; i--) {\n let tv5 = i - _2n; // 18. tv5 = i - 2\n tv5 = _2n << (tv5 - _1n); // 19. tv5 = 2^tv5\n let tvv5 = Fp.pow(tv4, tv5); // 20. tv5 = tv4^tv5\n const e1 = Fp.eql(tvv5, Fp.ONE); // 21. e1 = tv5 == 1\n tv2 = Fp.mul(tv3, tv1); // 22. tv2 = tv3 * tv1\n tv1 = Fp.mul(tv1, tv1); // 23. tv1 = tv1 * tv1\n tvv5 = Fp.mul(tv4, tv1); // 24. tv5 = tv4 * tv1\n tv3 = Fp.cmov(tv2, tv3, e1); // 25. tv3 = CMOV(tv2, tv3, e1)\n tv4 = Fp.cmov(tvv5, tv4, e1); // 26. tv4 = CMOV(tv5, tv4, e1)\n }\n return { isValid: isQR, value: tv3 };\n };\n if (Fp.ORDER % _4n === _3n) {\n // sqrt_ratio_3mod4(u, v)\n const c1 = (Fp.ORDER - _3n) / _4n; // 1. c1 = (q - 3) / 4 # Integer arithmetic\n const c2 = Fp.sqrt(Fp.neg(Z)); // 2. c2 = sqrt(-Z)\n sqrtRatio = (u, v) => {\n let tv1 = Fp.sqr(v); // 1. tv1 = v^2\n const tv2 = Fp.mul(u, v); // 2. tv2 = u * v\n tv1 = Fp.mul(tv1, tv2); // 3. tv1 = tv1 * tv2\n let y1 = Fp.pow(tv1, c1); // 4. y1 = tv1^c1\n y1 = Fp.mul(y1, tv2); // 5. y1 = y1 * tv2\n const y2 = Fp.mul(y1, c2); // 6. y2 = y1 * c2\n const tv3 = Fp.mul(Fp.sqr(y1), v); // 7. tv3 = y1^2; 8. tv3 = tv3 * v\n const isQR = Fp.eql(tv3, u); // 9. isQR = tv3 == u\n let y = Fp.cmov(y2, y1, isQR); // 10. y = CMOV(y2, y1, isQR)\n return { isValid: isQR, value: y }; // 11. return (isQR, y) isQR ? y : y*c2\n };\n }\n // No curves uses that\n // if (Fp.ORDER % _8n === _5n) // sqrt_ratio_5mod8\n return sqrtRatio;\n}\n/**\n * Simplified Shallue-van de Woestijne-Ulas Method\n * https://www.rfc-editor.org/rfc/rfc9380#section-6.6.2\n */\nexport function mapToCurveSimpleSWU(Fp, opts) {\n mod.validateField(Fp);\n if (!Fp.isValid(opts.A) || !Fp.isValid(opts.B) || !Fp.isValid(opts.Z))\n throw new Error('mapToCurveSimpleSWU: invalid opts');\n const sqrtRatio = SWUFpSqrtRatio(Fp, opts.Z);\n if (!Fp.isOdd)\n throw new Error('Fp.isOdd is not implemented!');\n // Input: u, an element of F.\n // Output: (x, y), a point on E.\n return (u) => {\n // prettier-ignore\n let tv1, tv2, tv3, tv4, tv5, tv6, x, y;\n tv1 = Fp.sqr(u); // 1. tv1 = u^2\n tv1 = Fp.mul(tv1, opts.Z); // 2. tv1 = Z * tv1\n tv2 = Fp.sqr(tv1); // 3. tv2 = tv1^2\n tv2 = Fp.add(tv2, tv1); // 4. tv2 = tv2 + tv1\n tv3 = Fp.add(tv2, Fp.ONE); // 5. tv3 = tv2 + 1\n tv3 = Fp.mul(tv3, opts.B); // 6. tv3 = B * tv3\n tv4 = Fp.cmov(opts.Z, Fp.neg(tv2), !Fp.eql(tv2, Fp.ZERO)); // 7. tv4 = CMOV(Z, -tv2, tv2 != 0)\n tv4 = Fp.mul(tv4, opts.A); // 8. tv4 = A * tv4\n tv2 = Fp.sqr(tv3); // 9. tv2 = tv3^2\n tv6 = Fp.sqr(tv4); // 10. tv6 = tv4^2\n tv5 = Fp.mul(tv6, opts.A); // 11. tv5 = A * tv6\n tv2 = Fp.add(tv2, tv5); // 12. tv2 = tv2 + tv5\n tv2 = Fp.mul(tv2, tv3); // 13. tv2 = tv2 * tv3\n tv6 = Fp.mul(tv6, tv4); // 14. tv6 = tv6 * tv4\n tv5 = Fp.mul(tv6, opts.B); // 15. tv5 = B * tv6\n tv2 = Fp.add(tv2, tv5); // 16. tv2 = tv2 + tv5\n x = Fp.mul(tv1, tv3); // 17. x = tv1 * tv3\n const { isValid, value } = sqrtRatio(tv2, tv6); // 18. (is_gx1_square, y1) = sqrt_ratio(tv2, tv6)\n y = Fp.mul(tv1, u); // 19. y = tv1 * u -> Z * u^3 * y1\n y = Fp.mul(y, value); // 20. y = y * y1\n x = Fp.cmov(x, tv3, isValid); // 21. x = CMOV(x, tv3, is_gx1_square)\n y = Fp.cmov(y, value, isValid); // 22. y = CMOV(y, y1, is_gx1_square)\n const e1 = Fp.isOdd(u) === Fp.isOdd(y); // 23. e1 = sgn0(u) == sgn0(y)\n y = Fp.cmov(Fp.neg(y), y, e1); // 24. y = CMOV(-y, y, e1)\n x = Fp.div(x, tv4); // 25. x = x / tv4\n return { x, y };\n };\n}\n//# sourceMappingURL=weierstrass.js.map","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nimport { hmac } from '@noble/hashes/hmac';\nimport { concatBytes, randomBytes } from '@noble/hashes/utils';\nimport { weierstrass } from './abstract/weierstrass.js';\n// connects noble-curves to noble-hashes\nexport function getHash(hash) {\n return {\n hash,\n hmac: (key, ...msgs) => hmac(hash, key, concatBytes(...msgs)),\n randomBytes,\n };\n}\nexport function createCurve(curveDef, defHash) {\n const create = (hash) => weierstrass({ ...curveDef, ...getHash(hash) });\n return Object.freeze({ ...create(defHash), create });\n}\n//# sourceMappingURL=_shortw_utils.js.map","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nimport { sha256 } from '@noble/hashes/sha256';\nimport { randomBytes } from '@noble/hashes/utils';\nimport { Field, mod, pow2 } from './abstract/modular.js';\nimport { mapToCurveSimpleSWU } from './abstract/weierstrass.js';\nimport { bytesToNumberBE, concatBytes, ensureBytes, numberToBytesBE } from './abstract/utils.js';\nimport { createHasher, isogenyMap } from './abstract/hash-to-curve.js';\nimport { createCurve } from './_shortw_utils.js';\nconst secp256k1P = BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f');\nconst secp256k1N = BigInt('0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141');\nconst _1n = BigInt(1);\nconst _2n = BigInt(2);\nconst divNearest = (a, b) => (a + b / _2n) / b;\n/**\n * √n = n^((p+1)/4) for fields p = 3 mod 4. We unwrap the loop and multiply bit-by-bit.\n * (P+1n/4n).toString(2) would produce bits [223x 1, 0, 22x 1, 4x 0, 11, 00]\n */\nfunction sqrtMod(y) {\n const P = secp256k1P;\n // prettier-ignore\n const _3n = BigInt(3), _6n = BigInt(6), _11n = BigInt(11), _22n = BigInt(22);\n // prettier-ignore\n const _23n = BigInt(23), _44n = BigInt(44), _88n = BigInt(88);\n const b2 = (y * y * y) % P; // x^3, 11\n const b3 = (b2 * b2 * y) % P; // x^7\n const b6 = (pow2(b3, _3n, P) * b3) % P;\n const b9 = (pow2(b6, _3n, P) * b3) % P;\n const b11 = (pow2(b9, _2n, P) * b2) % P;\n const b22 = (pow2(b11, _11n, P) * b11) % P;\n const b44 = (pow2(b22, _22n, P) * b22) % P;\n const b88 = (pow2(b44, _44n, P) * b44) % P;\n const b176 = (pow2(b88, _88n, P) * b88) % P;\n const b220 = (pow2(b176, _44n, P) * b44) % P;\n const b223 = (pow2(b220, _3n, P) * b3) % P;\n const t1 = (pow2(b223, _23n, P) * b22) % P;\n const t2 = (pow2(t1, _6n, P) * b2) % P;\n const root = pow2(t2, _2n, P);\n if (!Fp.eql(Fp.sqr(root), y))\n throw new Error('Cannot find square root');\n return root;\n}\nconst Fp = Field(secp256k1P, undefined, undefined, { sqrt: sqrtMod });\nexport const secp256k1 = createCurve({\n a: BigInt(0),\n b: BigInt(7),\n Fp,\n n: secp256k1N,\n // Base point (x, y) aka generator point\n Gx: BigInt('55066263022277343669578718895168534326250603453777594175500187360389116729240'),\n Gy: BigInt('32670510020758816978083085130507043184471273380659243275938904335757337482424'),\n h: BigInt(1),\n lowS: true,\n /**\n * secp256k1 belongs to Koblitz curves: it has efficiently computable endomorphism.\n * Endomorphism uses 2x less RAM, speeds up precomputation by 2x and ECDH / key recovery by 20%.\n * For precomputed wNAF it trades off 1/2 init time & 1/3 ram for 20% perf hit.\n * Explanation: https://gist.github.com/paulmillr/eb670806793e84df628a7c434a873066\n */\n endo: {\n beta: BigInt('0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee'),\n splitScalar: (k) => {\n const n = secp256k1N;\n const a1 = BigInt('0x3086d221a7d46bcde86c90e49284eb15');\n const b1 = -_1n * BigInt('0xe4437ed6010e88286f547fa90abfe4c3');\n const a2 = BigInt('0x114ca50f7a8e2f3f657c1108d9d44cfd8');\n const b2 = a1;\n const POW_2_128 = BigInt('0x100000000000000000000000000000000'); // (2n**128n).toString(16)\n const c1 = divNearest(b2 * k, n);\n const c2 = divNearest(-b1 * k, n);\n let k1 = mod(k - c1 * a1 - c2 * a2, n);\n let k2 = mod(-c1 * b1 - c2 * b2, n);\n const k1neg = k1 > POW_2_128;\n const k2neg = k2 > POW_2_128;\n if (k1neg)\n k1 = n - k1;\n if (k2neg)\n k2 = n - k2;\n if (k1 > POW_2_128 || k2 > POW_2_128) {\n throw new Error('splitScalar: Endomorphism failed, k=' + k);\n }\n return { k1neg, k1, k2neg, k2 };\n },\n },\n}, sha256);\n// Schnorr signatures are superior to ECDSA from above. Below is Schnorr-specific BIP0340 code.\n// https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki\nconst _0n = BigInt(0);\nconst fe = (x) => typeof x === 'bigint' && _0n < x && x < secp256k1P;\nconst ge = (x) => typeof x === 'bigint' && _0n < x && x < secp256k1N;\n/** An object mapping tags to their tagged hash prefix of [SHA256(tag) | SHA256(tag)] */\nconst TAGGED_HASH_PREFIXES = {};\nfunction taggedHash(tag, ...messages) {\n let tagP = TAGGED_HASH_PREFIXES[tag];\n if (tagP === undefined) {\n const tagH = sha256(Uint8Array.from(tag, (c) => c.charCodeAt(0)));\n tagP = concatBytes(tagH, tagH);\n TAGGED_HASH_PREFIXES[tag] = tagP;\n }\n return sha256(concatBytes(tagP, ...messages));\n}\n// ECDSA compact points are 33-byte. Schnorr is 32: we strip first byte 0x02 or 0x03\nconst pointToBytes = (point) => point.toRawBytes(true).slice(1);\nconst numTo32b = (n) => numberToBytesBE(n, 32);\nconst modP = (x) => mod(x, secp256k1P);\nconst modN = (x) => mod(x, secp256k1N);\nconst Point = secp256k1.ProjectivePoint;\nconst GmulAdd = (Q, a, b) => Point.BASE.multiplyAndAddUnsafe(Q, a, b);\n// Calculate point, scalar and bytes\nfunction schnorrGetExtPubKey(priv) {\n let d_ = secp256k1.utils.normPrivateKeyToScalar(priv); // same method executed in fromPrivateKey\n let p = Point.fromPrivateKey(d_); // P = d'⋅G; 0 < d' < n check is done inside\n const scalar = p.hasEvenY() ? d_ : modN(-d_);\n return { scalar: scalar, bytes: pointToBytes(p) };\n}\n/**\n * lift_x from BIP340. Convert 32-byte x coordinate to elliptic curve point.\n * @returns valid point checked for being on-curve\n */\nfunction lift_x(x) {\n if (!fe(x))\n throw new Error('bad x: need 0 < x < p'); // Fail if x ≥ p.\n const xx = modP(x * x);\n const c = modP(xx * x + BigInt(7)); // Let c = x³ + 7 mod p.\n let y = sqrtMod(c); // Let y = c^(p+1)/4 mod p.\n if (y % _2n !== _0n)\n y = modP(-y); // Return the unique point P such that x(P) = x and\n const p = new Point(x, y, _1n); // y(P) = y if y mod 2 = 0 or y(P) = p-y otherwise.\n p.assertValidity();\n return p;\n}\n/**\n * Create tagged hash, convert it to bigint, reduce modulo-n.\n */\nfunction challenge(...args) {\n return modN(bytesToNumberBE(taggedHash('BIP0340/challenge', ...args)));\n}\n/**\n * Schnorr public key is just `x` coordinate of Point as per BIP340.\n */\nfunction schnorrGetPublicKey(privateKey) {\n return schnorrGetExtPubKey(privateKey).bytes; // d'=int(sk). Fail if d'=0 or d'≥n. Ret bytes(d'⋅G)\n}\n/**\n * Creates Schnorr signature as per BIP340. Verifies itself before returning anything.\n * auxRand is optional and is not the sole source of k generation: bad CSPRNG won't be dangerous.\n */\nfunction schnorrSign(message, privateKey, auxRand = randomBytes(32)) {\n const m = ensureBytes('message', message);\n const { bytes: px, scalar: d } = schnorrGetExtPubKey(privateKey); // checks for isWithinCurveOrder\n const a = ensureBytes('auxRand', auxRand, 32); // Auxiliary random data a: a 32-byte array\n const t = numTo32b(d ^ bytesToNumberBE(taggedHash('BIP0340/aux', a))); // Let t be the byte-wise xor of bytes(d) and hash/aux(a)\n const rand = taggedHash('BIP0340/nonce', t, px, m); // Let rand = hash/nonce(t || bytes(P) || m)\n const k_ = modN(bytesToNumberBE(rand)); // Let k' = int(rand) mod n\n if (k_ === _0n)\n throw new Error('sign failed: k is zero'); // Fail if k' = 0.\n const { bytes: rx, scalar: k } = schnorrGetExtPubKey(k_); // Let R = k'⋅G.\n const e = challenge(rx, px, m); // Let e = int(hash/challenge(bytes(R) || bytes(P) || m)) mod n.\n const sig = new Uint8Array(64); // Let sig = bytes(R) || bytes((k + ed) mod n).\n sig.set(rx, 0);\n sig.set(numTo32b(modN(k + e * d)), 32);\n // If Verify(bytes(P), m, sig) (see below) returns failure, abort\n if (!schnorrVerify(sig, m, px))\n throw new Error('sign: Invalid signature produced');\n return sig;\n}\n/**\n * Verifies Schnorr signature.\n * Will swallow errors & return false except for initial type validation of arguments.\n */\nfunction schnorrVerify(signature, message, publicKey) {\n const sig = ensureBytes('signature', signature, 64);\n const m = ensureBytes('message', message);\n const pub = ensureBytes('publicKey', publicKey, 32);\n try {\n const P = lift_x(bytesToNumberBE(pub)); // P = lift_x(int(pk)); fail if that fails\n const r = bytesToNumberBE(sig.subarray(0, 32)); // Let r = int(sig[0:32]); fail if r ≥ p.\n if (!fe(r))\n return false;\n const s = bytesToNumberBE(sig.subarray(32, 64)); // Let s = int(sig[32:64]); fail if s ≥ n.\n if (!ge(s))\n return false;\n const e = challenge(numTo32b(r), pointToBytes(P), m); // int(challenge(bytes(r)||bytes(P)||m))%n\n const R = GmulAdd(P, s, modN(-e)); // R = s⋅G - e⋅P\n if (!R || !R.hasEvenY() || R.toAffine().x !== r)\n return false; // -eP == (n-e)P\n return true; // Fail if is_infinite(R) / not has_even_y(R) / x(R) ≠ r.\n }\n catch (error) {\n return false;\n }\n}\nexport const schnorr = /* @__PURE__ */ (() => ({\n getPublicKey: schnorrGetPublicKey,\n sign: schnorrSign,\n verify: schnorrVerify,\n utils: {\n randomPrivateKey: secp256k1.utils.randomPrivateKey,\n lift_x,\n pointToBytes,\n numberToBytesBE,\n bytesToNumberBE,\n taggedHash,\n mod,\n },\n}))();\nconst isoMap = /* @__PURE__ */ (() => isogenyMap(Fp, [\n // xNum\n [\n '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7',\n '0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581',\n '0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262',\n '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c',\n ],\n // xDen\n [\n '0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b',\n '0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14',\n '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1\n ],\n // yNum\n [\n '0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c',\n '0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3',\n '0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931',\n '0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84',\n ],\n // yDen\n [\n '0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b',\n '0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573',\n '0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f',\n '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1\n ],\n].map((i) => i.map((j) => BigInt(j)))))();\nconst mapSWU = /* @__PURE__ */ (() => mapToCurveSimpleSWU(Fp, {\n A: BigInt('0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533'),\n B: BigInt('1771'),\n Z: Fp.create(BigInt('-11')),\n}))();\nconst htf = /* @__PURE__ */ (() => createHasher(secp256k1.ProjectivePoint, (scalars) => {\n const { x, y } = mapSWU(Fp.create(scalars[0]));\n return isoMap(x, y);\n}, {\n DST: 'secp256k1_XMD:SHA-256_SSWU_RO_',\n encodeDST: 'secp256k1_XMD:SHA-256_SSWU_NU_',\n p: Fp.ORDER,\n m: 1,\n k: 128,\n expand: 'xmd',\n hash: sha256,\n}))();\nexport const hashToCurve = /* @__PURE__ */ (() => htf.hashToCurve)();\nexport const encodeToCurve = /* @__PURE__ */ (() => htf.encodeToCurve)();\n//# sourceMappingURL=secp256k1.js.map","/**\n * A constant for the zero address.\n *\n * (**i.e.** ``\"0x0000000000000000000000000000000000000000\"``)\n */\nexport const ZeroAddress = \"0x0000000000000000000000000000000000000000\";\n//# sourceMappingURL=addresses.js.map","/**\n * A constant for the zero hash.\n *\n * (**i.e.** ``\"0x0000000000000000000000000000000000000000000000000000000000000000\"``)\n */\nexport const ZeroHash = \"0x0000000000000000000000000000000000000000000000000000000000000000\";\n//# sourceMappingURL=hashes.js.map","/**\n * A constant for the order N for the secp256k1 curve.\n *\n * (**i.e.** ``0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n``)\n */\nexport const N = BigInt(\"0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141\");\n/**\n * A constant for the number of wei in a single ether.\n *\n * (**i.e.** ``1000000000000000000n``)\n */\nexport const WeiPerEther = BigInt(\"1000000000000000000\");\n/**\n * A constant for the maximum value for a ``uint256``.\n *\n * (**i.e.** ``0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``)\n */\nexport const MaxUint256 = BigInt(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\n/**\n * A constant for the minimum value for an ``int256``.\n *\n * (**i.e.** ``-8000000000000000000000000000000000000000000000000000000000000000n``)\n */\nexport const MinInt256 = BigInt(\"0x8000000000000000000000000000000000000000000000000000000000000000\") * BigInt(-1);\n/**\n * A constant for the maximum value for an ``int256``.\n *\n * (**i.e.** ``0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``)\n */\nexport const MaxInt256 = BigInt(\"0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\n//# sourceMappingURL=numbers.js.map","// NFKC (composed) // (decomposed)\n/**\n * A constant for the ether symbol (normalized using NFKC).\n *\n * (**i.e.** ``\"\\\\u039e\"``)\n */\nexport const EtherSymbol = \"\\u039e\"; // \"\\uD835\\uDF63\";\n/**\n * A constant for the [[link-eip-191]] personal message prefix.\n *\n * (**i.e.** ``\"\\\\x19Ethereum Signed Message:\\\\n\"``)\n */\nexport const MessagePrefix = \"\\x19Ethereum Signed Message:\\n\";\n//# sourceMappingURL=strings.js.map","import { ZeroHash } from \"../constants/index.js\";\nimport { concat, dataLength, getBigInt, getBytes, getNumber, hexlify, toBeArray, isHexString, zeroPadValue, assertArgument, assertPrivate } from \"../utils/index.js\";\n// Constants\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_2 = BigInt(2);\nconst BN_27 = BigInt(27);\nconst BN_28 = BigInt(28);\nconst BN_35 = BigInt(35);\nconst BN_N = BigInt(\"0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141\");\nconst BN_N_2 = BN_N / BN_2; // Must be integer (floor) division; do NOT shifts\nconst inspect = Symbol.for(\"nodejs.util.inspect.custom\");\nconst _guard = {};\nfunction toUint256(value) {\n return zeroPadValue(toBeArray(value), 32);\n}\n/**\n * A Signature @TODO\n *\n *\n * @_docloc: api/crypto:Signing\n */\nexport class Signature {\n #r;\n #s;\n #v;\n #networkV;\n /**\n * The ``r`` value for a signature.\n *\n * This represents the ``x`` coordinate of a \"reference\" or\n * challenge point, from which the ``y`` can be computed.\n */\n get r() { return this.#r; }\n set r(value) {\n assertArgument(dataLength(value) === 32, \"invalid r\", \"value\", value);\n this.#r = hexlify(value);\n }\n /**\n * The ``s`` value for a signature.\n */\n get s() {\n assertArgument(parseInt(this.#s.substring(0, 3)) < 8, \"non-canonical s; use ._s\", \"s\", this.#s);\n return this.#s;\n }\n set s(_value) {\n assertArgument(dataLength(_value) === 32, \"invalid s\", \"value\", _value);\n this.#s = hexlify(_value);\n }\n /**\n * Return the s value, unchecked for EIP-2 compliance.\n *\n * This should generally not be used and is for situations where\n * a non-canonical S value might be relevant, such as Frontier blocks\n * that were mined prior to EIP-2 or invalid Authorization List\n * signatures.\n */\n get _s() { return this.#s; }\n /**\n * Returns true if the Signature is valid for [[link-eip-2]] signatures.\n */\n isValid() {\n const s = BigInt(this.#s);\n return (s <= BN_N_2);\n }\n /**\n * The ``v`` value for a signature.\n *\n * Since a given ``x`` value for ``r`` has two possible values for\n * its correspondin ``y``, the ``v`` indicates which of the two ``y``\n * values to use.\n *\n * It is normalized to the values ``27`` or ``28`` for legacy\n * purposes.\n */\n get v() { return this.#v; }\n set v(value) {\n const v = getNumber(value, \"value\");\n assertArgument(v === 27 || v === 28, \"invalid v\", \"v\", value);\n this.#v = v;\n }\n /**\n * The EIP-155 ``v`` for legacy transactions. For non-legacy\n * transactions, this value is ``null``.\n */\n get networkV() { return this.#networkV; }\n /**\n * The chain ID for EIP-155 legacy transactions. For non-legacy\n * transactions, this value is ``null``.\n */\n get legacyChainId() {\n const v = this.networkV;\n if (v == null) {\n return null;\n }\n return Signature.getChainId(v);\n }\n /**\n * The ``yParity`` for the signature.\n *\n * See ``v`` for more details on how this value is used.\n */\n get yParity() {\n return (this.v === 27) ? 0 : 1;\n }\n /**\n * The [[link-eip-2098]] compact representation of the ``yParity``\n * and ``s`` compacted into a single ``bytes32``.\n */\n get yParityAndS() {\n // The EIP-2098 compact representation\n const yParityAndS = getBytes(this.s);\n if (this.yParity) {\n yParityAndS[0] |= 0x80;\n }\n return hexlify(yParityAndS);\n }\n /**\n * The [[link-eip-2098]] compact representation.\n */\n get compactSerialized() {\n return concat([this.r, this.yParityAndS]);\n }\n /**\n * The serialized representation.\n */\n get serialized() {\n return concat([this.r, this.s, (this.yParity ? \"0x1c\" : \"0x1b\")]);\n }\n /**\n * @private\n */\n constructor(guard, r, s, v) {\n assertPrivate(guard, _guard, \"Signature\");\n this.#r = r;\n this.#s = s;\n this.#v = v;\n this.#networkV = null;\n }\n /**\n * Returns the canonical signature.\n *\n * This is only necessary when dealing with legacy transaction which\n * did not enforce canonical S values (i.e. [[link-eip-2]]. Most\n * developers should never require this.\n */\n getCanonical() {\n if (this.isValid()) {\n return this;\n }\n // Compute the canonical signature; s' = N - s, v = !v\n const s = BN_N - BigInt(this._s);\n const v = (55 - this.v);\n const result = new Signature(_guard, this.r, toUint256(s), v);\n // Populate the networkV if necessary\n if (this.networkV) {\n result.#networkV = this.networkV;\n }\n return result;\n }\n /**\n * Returns a new identical [[Signature]].\n */\n clone() {\n const clone = new Signature(_guard, this.r, this._s, this.v);\n if (this.networkV) {\n clone.#networkV = this.networkV;\n }\n return clone;\n }\n /**\n * Returns a representation that is compatible with ``JSON.stringify``.\n */\n toJSON() {\n const networkV = this.networkV;\n return {\n _type: \"signature\",\n networkV: ((networkV != null) ? networkV.toString() : null),\n r: this.r, s: this._s, v: this.v,\n };\n }\n [inspect]() {\n return this.toString();\n }\n toString() {\n if (this.isValid()) {\n return `Signature { r: ${this.r}, s: ${this._s}, v: ${this.v} }`;\n }\n return `Signature { r: ${this.r}, s: ${this._s}, v: ${this.v}, valid: false }`;\n }\n /**\n * Compute the chain ID from the ``v`` in a legacy EIP-155 transactions.\n *\n * @example:\n * Signature.getChainId(45)\n * //_result:\n *\n * Signature.getChainId(46)\n * //_result:\n */\n static getChainId(v) {\n const bv = getBigInt(v, \"v\");\n // The v is not an EIP-155 v, so it is the unspecified chain ID\n if ((bv == BN_27) || (bv == BN_28)) {\n return BN_0;\n }\n // Bad value for an EIP-155 v\n assertArgument(bv >= BN_35, \"invalid EIP-155 v\", \"v\", v);\n return (bv - BN_35) / BN_2;\n }\n /**\n * Compute the ``v`` for a chain ID for a legacy EIP-155 transactions.\n *\n * Legacy transactions which use [[link-eip-155]] hijack the ``v``\n * property to include the chain ID.\n *\n * @example:\n * Signature.getChainIdV(5, 27)\n * //_result:\n *\n * Signature.getChainIdV(5, 28)\n * //_result:\n *\n */\n static getChainIdV(chainId, v) {\n return (getBigInt(chainId) * BN_2) + BigInt(35 + v - 27);\n }\n /**\n * Compute the normalized legacy transaction ``v`` from a ``yParirty``,\n * a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction.\n *\n * @example:\n * // The values 0 and 1 imply v is actually yParity\n * Signature.getNormalizedV(0)\n * //_result:\n *\n * // Legacy non-EIP-1559 transaction (i.e. 27 or 28)\n * Signature.getNormalizedV(27)\n * //_result:\n *\n * // Legacy EIP-155 transaction (i.e. >= 35)\n * Signature.getNormalizedV(46)\n * //_result:\n *\n * // Invalid values throw\n * Signature.getNormalizedV(5)\n * //_error:\n */\n static getNormalizedV(v) {\n const bv = getBigInt(v);\n if (bv === BN_0 || bv === BN_27) {\n return 27;\n }\n if (bv === BN_1 || bv === BN_28) {\n return 28;\n }\n assertArgument(bv >= BN_35, \"invalid v\", \"v\", v);\n // Otherwise, EIP-155 v means odd is 27 and even is 28\n return (bv & BN_1) ? 27 : 28;\n }\n /**\n * Creates a new [[Signature]].\n *\n * If no %%sig%% is provided, a new [[Signature]] is created\n * with default values.\n *\n * If %%sig%% is a string, it is parsed.\n */\n static from(sig) {\n function assertError(check, message) {\n assertArgument(check, message, \"signature\", sig);\n }\n ;\n if (sig == null) {\n return new Signature(_guard, ZeroHash, ZeroHash, 27);\n }\n if (typeof (sig) === \"string\") {\n const bytes = getBytes(sig, \"signature\");\n if (bytes.length === 64) {\n const r = hexlify(bytes.slice(0, 32));\n const s = bytes.slice(32, 64);\n const v = (s[0] & 0x80) ? 28 : 27;\n s[0] &= 0x7f;\n return new Signature(_guard, r, hexlify(s), v);\n }\n if (bytes.length === 65) {\n const r = hexlify(bytes.slice(0, 32));\n const s = hexlify(bytes.slice(32, 64));\n const v = Signature.getNormalizedV(bytes[64]);\n return new Signature(_guard, r, s, v);\n }\n assertError(false, \"invalid raw signature length\");\n }\n if (sig instanceof Signature) {\n return sig.clone();\n }\n // Get r\n const _r = sig.r;\n assertError(_r != null, \"missing r\");\n const r = toUint256(_r);\n // Get s; by any means necessary (we check consistency below)\n const s = (function (s, yParityAndS) {\n if (s != null) {\n return toUint256(s);\n }\n if (yParityAndS != null) {\n assertError(isHexString(yParityAndS, 32), \"invalid yParityAndS\");\n const bytes = getBytes(yParityAndS);\n bytes[0] &= 0x7f;\n return hexlify(bytes);\n }\n assertError(false, \"missing s\");\n })(sig.s, sig.yParityAndS);\n // Get v; by any means necessary (we check consistency below)\n const { networkV, v } = (function (_v, yParityAndS, yParity) {\n if (_v != null) {\n const v = getBigInt(_v);\n return {\n networkV: ((v >= BN_35) ? v : undefined),\n v: Signature.getNormalizedV(v)\n };\n }\n if (yParityAndS != null) {\n assertError(isHexString(yParityAndS, 32), \"invalid yParityAndS\");\n return { v: ((getBytes(yParityAndS)[0] & 0x80) ? 28 : 27) };\n }\n if (yParity != null) {\n switch (getNumber(yParity, \"sig.yParity\")) {\n case 0: return { v: 27 };\n case 1: return { v: 28 };\n }\n assertError(false, \"invalid yParity\");\n }\n assertError(false, \"missing v\");\n })(sig.v, sig.yParityAndS, sig.yParity);\n const result = new Signature(_guard, r, s, v);\n if (networkV) {\n result.#networkV = networkV;\n }\n // If multiple of v, yParity, yParityAndS we given, check they match\n assertError(sig.yParity == null || getNumber(sig.yParity, \"sig.yParity\") === result.yParity, \"yParity mismatch\");\n assertError(sig.yParityAndS == null || sig.yParityAndS === result.yParityAndS, \"yParityAndS mismatch\");\n return result;\n }\n}\n//# sourceMappingURL=signature.js.map","/**\n * Add details about signing here.\n *\n * @_subsection: api/crypto:Signing [about-signing]\n */\nimport { secp256k1 } from \"@noble/curves/secp256k1\";\nimport { concat, dataLength, getBytes, getBytesCopy, hexlify, toBeHex, assertArgument } from \"../utils/index.js\";\nimport { Signature } from \"./signature.js\";\n/**\n * A **SigningKey** provides high-level access to the elliptic curve\n * cryptography (ECC) operations and key management.\n */\nexport class SigningKey {\n #privateKey;\n /**\n * Creates a new **SigningKey** for %%privateKey%%.\n */\n constructor(privateKey) {\n assertArgument(dataLength(privateKey) === 32, \"invalid private key\", \"privateKey\", \"[REDACTED]\");\n this.#privateKey = hexlify(privateKey);\n }\n /**\n * The private key.\n */\n get privateKey() { return this.#privateKey; }\n /**\n * The uncompressed public key.\n *\n * This will always begin with the prefix ``0x04`` and be 132\n * characters long (the ``0x`` prefix and 130 hexadecimal nibbles).\n */\n get publicKey() { return SigningKey.computePublicKey(this.#privateKey); }\n /**\n * The compressed public key.\n *\n * This will always begin with either the prefix ``0x02`` or ``0x03``\n * and be 68 characters long (the ``0x`` prefix and 33 hexadecimal\n * nibbles)\n */\n get compressedPublicKey() { return SigningKey.computePublicKey(this.#privateKey, true); }\n /**\n * Return the signature of the signed %%digest%%.\n */\n sign(digest) {\n assertArgument(dataLength(digest) === 32, \"invalid digest length\", \"digest\", digest);\n const sig = secp256k1.sign(getBytesCopy(digest), getBytesCopy(this.#privateKey), {\n lowS: true\n });\n return Signature.from({\n r: toBeHex(sig.r, 32),\n s: toBeHex(sig.s, 32),\n v: (sig.recovery ? 0x1c : 0x1b)\n });\n }\n /**\n * Returns the [[link-wiki-ecdh]] shared secret between this\n * private key and the %%other%% key.\n *\n * The %%other%% key may be any type of key, a raw public key,\n * a compressed/uncompressed pubic key or aprivate key.\n *\n * Best practice is usually to use a cryptographic hash on the\n * returned value before using it as a symetric secret.\n *\n * @example:\n * sign1 = new SigningKey(id(\"some-secret-1\"))\n * sign2 = new SigningKey(id(\"some-secret-2\"))\n *\n * // Notice that privA.computeSharedSecret(pubB)...\n * sign1.computeSharedSecret(sign2.publicKey)\n * //_result:\n *\n * // ...is equal to privB.computeSharedSecret(pubA).\n * sign2.computeSharedSecret(sign1.publicKey)\n * //_result:\n */\n computeSharedSecret(other) {\n const pubKey = SigningKey.computePublicKey(other);\n return hexlify(secp256k1.getSharedSecret(getBytesCopy(this.#privateKey), getBytes(pubKey), false));\n }\n /**\n * Compute the public key for %%key%%, optionally %%compressed%%.\n *\n * The %%key%% may be any type of key, a raw public key, a\n * compressed/uncompressed public key or private key.\n *\n * @example:\n * sign = new SigningKey(id(\"some-secret\"));\n *\n * // Compute the uncompressed public key for a private key\n * SigningKey.computePublicKey(sign.privateKey)\n * //_result:\n *\n * // Compute the compressed public key for a private key\n * SigningKey.computePublicKey(sign.privateKey, true)\n * //_result:\n *\n * // Compute the uncompressed public key\n * SigningKey.computePublicKey(sign.publicKey, false);\n * //_result:\n *\n * // Compute the Compressed a public key\n * SigningKey.computePublicKey(sign.publicKey, true);\n * //_result:\n */\n static computePublicKey(key, compressed) {\n let bytes = getBytes(key, \"key\");\n // private key\n if (bytes.length === 32) {\n const pubKey = secp256k1.getPublicKey(bytes, !!compressed);\n return hexlify(pubKey);\n }\n // raw public key; use uncompressed key with 0x04 prefix\n if (bytes.length === 64) {\n const pub = new Uint8Array(65);\n pub[0] = 0x04;\n pub.set(bytes, 1);\n bytes = pub;\n }\n const point = secp256k1.ProjectivePoint.fromHex(bytes);\n return hexlify(point.toRawBytes(compressed));\n }\n /**\n * Returns the public key for the private key which produced the\n * %%signature%% for the given %%digest%%.\n *\n * @example:\n * key = new SigningKey(id(\"some-secret\"))\n * digest = id(\"hello world\")\n * sig = key.sign(digest)\n *\n * // Notice the signer public key...\n * key.publicKey\n * //_result:\n *\n * // ...is equal to the recovered public key\n * SigningKey.recoverPublicKey(digest, sig)\n * //_result:\n *\n */\n static recoverPublicKey(digest, signature) {\n assertArgument(dataLength(digest) === 32, \"invalid digest length\", \"digest\", digest);\n const sig = Signature.from(signature);\n let secpSig = secp256k1.Signature.fromCompact(getBytesCopy(concat([sig.r, sig.s])));\n secpSig = secpSig.addRecoveryBit(sig.yParity);\n const pubKey = secpSig.recoverPublicKey(getBytesCopy(digest));\n assertArgument(pubKey != null, \"invalid signature for digest\", \"signature\", signature);\n return \"0x\" + pubKey.toHex(false);\n }\n /**\n * Returns the point resulting from adding the ellipic curve points\n * %%p0%% and %%p1%%.\n *\n * This is not a common function most developers should require, but\n * can be useful for certain privacy-specific techniques.\n *\n * For example, it is used by [[HDNodeWallet]] to compute child\n * addresses from parent public keys and chain codes.\n */\n static addPoints(p0, p1, compressed) {\n const pub0 = secp256k1.ProjectivePoint.fromHex(SigningKey.computePublicKey(p0).substring(2));\n const pub1 = secp256k1.ProjectivePoint.fromHex(SigningKey.computePublicKey(p1).substring(2));\n return \"0x\" + pub0.add(pub1).toHex(!!compressed);\n }\n}\n//# sourceMappingURL=signing-key.js.map","/**\n * A fundamental building block of Ethereum is the underlying\n * cryptographic primitives.\n *\n * @_section: api/crypto:Cryptographic Functions [about-crypto]\n */\nnull;\n// We import all these so we can export lock()\nimport { computeHmac } from \"./hmac.js\";\nimport { keccak256 } from \"./keccak.js\";\nimport { ripemd160 } from \"./ripemd160.js\";\nimport { pbkdf2 } from \"./pbkdf2.js\";\nimport { randomBytes } from \"./random.js\";\nimport { scrypt, scryptSync } from \"./scrypt.js\";\nimport { sha256, sha512 } from \"./sha2.js\";\nexport { computeHmac, randomBytes, keccak256, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync };\nexport { SigningKey } from \"./signing-key.js\";\nexport { Signature } from \"./signature.js\";\n/**\n * Once called, prevents any future change to the underlying cryptographic\n * primitives using the ``.register`` feature for hooks.\n */\nfunction lock() {\n computeHmac.lock();\n keccak256.lock();\n pbkdf2.lock();\n randomBytes.lock();\n ripemd160.lock();\n scrypt.lock();\n scryptSync.lock();\n sha256.lock();\n sha512.lock();\n randomBytes.lock();\n}\nexport { lock };\n//# sourceMappingURL=index.js.map","import { keccak256 } from \"../crypto/index.js\";\nimport { getBytes, assertArgument } from \"../utils/index.js\";\nconst BN_0 = BigInt(0);\nconst BN_36 = BigInt(36);\nfunction getChecksumAddress(address) {\n // if (!isHexString(address, 20)) {\n // logger.throwArgumentError(\"invalid address\", \"address\", address);\n // }\n address = address.toLowerCase();\n const chars = address.substring(2).split(\"\");\n const expanded = new Uint8Array(40);\n for (let i = 0; i < 40; i++) {\n expanded[i] = chars[i].charCodeAt(0);\n }\n const hashed = getBytes(keccak256(expanded));\n for (let i = 0; i < 40; i += 2) {\n if ((hashed[i >> 1] >> 4) >= 8) {\n chars[i] = chars[i].toUpperCase();\n }\n if ((hashed[i >> 1] & 0x0f) >= 8) {\n chars[i + 1] = chars[i + 1].toUpperCase();\n }\n }\n return \"0x\" + chars.join(\"\");\n}\n// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number\n// Create lookup table\nconst ibanLookup = {};\nfor (let i = 0; i < 10; i++) {\n ibanLookup[String(i)] = String(i);\n}\nfor (let i = 0; i < 26; i++) {\n ibanLookup[String.fromCharCode(65 + i)] = String(10 + i);\n}\n// How many decimal digits can we process? (for 64-bit float, this is 15)\n// i.e. Math.floor(Math.log10(Number.MAX_SAFE_INTEGER));\nconst safeDigits = 15;\nfunction ibanChecksum(address) {\n address = address.toUpperCase();\n address = address.substring(4) + address.substring(0, 2) + \"00\";\n let expanded = address.split(\"\").map((c) => { return ibanLookup[c]; }).join(\"\");\n // Javascript can handle integers safely up to 15 (decimal) digits\n while (expanded.length >= safeDigits) {\n let block = expanded.substring(0, safeDigits);\n expanded = parseInt(block, 10) % 97 + expanded.substring(block.length);\n }\n let checksum = String(98 - (parseInt(expanded, 10) % 97));\n while (checksum.length < 2) {\n checksum = \"0\" + checksum;\n }\n return checksum;\n}\n;\nconst Base36 = (function () {\n ;\n const result = {};\n for (let i = 0; i < 36; i++) {\n const key = \"0123456789abcdefghijklmnopqrstuvwxyz\"[i];\n result[key] = BigInt(i);\n }\n return result;\n})();\nfunction fromBase36(value) {\n value = value.toLowerCase();\n let result = BN_0;\n for (let i = 0; i < value.length; i++) {\n result = result * BN_36 + Base36[value[i]];\n }\n return result;\n}\n/**\n * Returns a normalized and checksumed address for %%address%%.\n * This accepts non-checksum addresses, checksum addresses and\n * [[getIcapAddress]] formats.\n *\n * The checksum in Ethereum uses the capitalization (upper-case\n * vs lower-case) of the characters within an address to encode\n * its checksum, which offers, on average, a checksum of 15-bits.\n *\n * If %%address%% contains both upper-case and lower-case, it is\n * assumed to already be a checksum address and its checksum is\n * validated, and if the address fails its expected checksum an\n * error is thrown.\n *\n * If you wish the checksum of %%address%% to be ignore, it should\n * be converted to lower-case (i.e. ``.toLowercase()``) before\n * being passed in. This should be a very rare situation though,\n * that you wish to bypass the safegaurds in place to protect\n * against an address that has been incorrectly copied from another\n * source.\n *\n * @example:\n * // Adds the checksum (via upper-casing specific letters)\n * getAddress(\"0x8ba1f109551bd432803012645ac136ddd64dba72\")\n * //_result:\n *\n * // Converts ICAP address and adds checksum\n * getAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\");\n * //_result:\n *\n * // Throws an error if an address contains mixed case,\n * // but the checksum fails\n * getAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBA72\")\n * //_error:\n */\nexport function getAddress(address) {\n assertArgument(typeof (address) === \"string\", \"invalid address\", \"address\", address);\n if (address.match(/^(0x)?[0-9a-fA-F]{40}$/)) {\n // Missing the 0x prefix\n if (!address.startsWith(\"0x\")) {\n address = \"0x\" + address;\n }\n const result = getChecksumAddress(address);\n // It is a checksummed address with a bad checksum\n assertArgument(!address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) || result === address, \"bad address checksum\", \"address\", address);\n return result;\n }\n // Maybe ICAP? (we only support direct mode)\n if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {\n // It is an ICAP address with a bad checksum\n assertArgument(address.substring(2, 4) === ibanChecksum(address), \"bad icap checksum\", \"address\", address);\n let result = fromBase36(address.substring(4)).toString(16);\n while (result.length < 40) {\n result = \"0\" + result;\n }\n return getChecksumAddress(\"0x\" + result);\n }\n assertArgument(false, \"invalid address\", \"address\", address);\n}\n/**\n * The [ICAP Address format](link-icap) format is an early checksum\n * format which attempts to be compatible with the banking\n * industry [IBAN format](link-wiki-iban) for bank accounts.\n *\n * It is no longer common or a recommended format.\n *\n * @example:\n * getIcapAddress(\"0x8ba1f109551bd432803012645ac136ddd64dba72\");\n * //_result:\n *\n * getIcapAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\");\n * //_result:\n *\n * // Throws an error if the ICAP checksum is wrong\n * getIcapAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK37\");\n * //_error:\n */\nexport function getIcapAddress(address) {\n //let base36 = _base16To36(getAddress(address).substring(2)).toUpperCase();\n let base36 = BigInt(getAddress(address)).toString(36).toUpperCase();\n while (base36.length < 30) {\n base36 = \"0\" + base36;\n }\n return \"XE\" + ibanChecksum(\"XE00\" + base36) + base36;\n}\n//# sourceMappingURL=address.js.map","import { keccak256 } from \"../crypto/index.js\";\nimport { concat, dataSlice, getBigInt, getBytes, encodeRlp, assertArgument } from \"../utils/index.js\";\nimport { getAddress } from \"./address.js\";\n// http://ethereum.stackexchange.com/questions/760/how-is-the-address-of-an-ethereum-contract-computed\n/**\n * Returns the address that would result from a ``CREATE`` for %%tx%%.\n *\n * This can be used to compute the address a contract will be\n * deployed to by an EOA when sending a deployment transaction (i.e.\n * when the ``to`` address is ``null``).\n *\n * This can also be used to compute the address a contract will be\n * deployed to by a contract, by using the contract's address as the\n * ``to`` and the contract's nonce.\n *\n * @example\n * from = \"0x8ba1f109551bD432803012645Ac136ddd64DBA72\";\n * nonce = 5;\n *\n * getCreateAddress({ from, nonce });\n * //_result:\n */\nexport function getCreateAddress(tx) {\n const from = getAddress(tx.from);\n const nonce = getBigInt(tx.nonce, \"tx.nonce\");\n let nonceHex = nonce.toString(16);\n if (nonceHex === \"0\") {\n nonceHex = \"0x\";\n }\n else if (nonceHex.length % 2) {\n nonceHex = \"0x0\" + nonceHex;\n }\n else {\n nonceHex = \"0x\" + nonceHex;\n }\n return getAddress(dataSlice(keccak256(encodeRlp([from, nonceHex])), 12));\n}\n/**\n * Returns the address that would result from a ``CREATE2`` operation\n * with the given %%from%%, %%salt%% and %%initCodeHash%%.\n *\n * To compute the %%initCodeHash%% from a contract's init code, use\n * the [[keccak256]] function.\n *\n * For a quick overview and example of ``CREATE2``, see [[link-ricmoo-wisps]].\n *\n * @example\n * // The address of the contract\n * from = \"0x8ba1f109551bD432803012645Ac136ddd64DBA72\"\n *\n * // The salt\n * salt = id(\"HelloWorld\")\n *\n * // The hash of the initCode\n * initCode = \"0x6394198df16000526103ff60206004601c335afa6040516060f3\";\n * initCodeHash = keccak256(initCode)\n *\n * getCreate2Address(from, salt, initCodeHash)\n * //_result:\n */\nexport function getCreate2Address(_from, _salt, _initCodeHash) {\n const from = getAddress(_from);\n const salt = getBytes(_salt, \"salt\");\n const initCodeHash = getBytes(_initCodeHash, \"initCodeHash\");\n assertArgument(salt.length === 32, \"salt must be 32 bytes\", \"salt\", _salt);\n assertArgument(initCodeHash.length === 32, \"initCodeHash must be 32 bytes\", \"initCodeHash\", _initCodeHash);\n return getAddress(dataSlice(keccak256(concat([\"0xff\", from, salt, initCodeHash])), 12));\n}\n//# sourceMappingURL=contract-address.js.map","import { assert, assertArgument } from \"../utils/index.js\";\nimport { getAddress } from \"./address.js\";\n/**\n * Returns true if %%value%% is an object which implements the\n * [[Addressable]] interface.\n *\n * @example:\n * // Wallets and AbstractSigner sub-classes\n * isAddressable(Wallet.createRandom())\n * //_result:\n *\n * // Contracts\n * contract = new Contract(\"dai.tokens.ethers.eth\", [ ], provider)\n * isAddressable(contract)\n * //_result:\n */\nexport function isAddressable(value) {\n return (value && typeof (value.getAddress) === \"function\");\n}\n/**\n * Returns true if %%value%% is a valid address.\n *\n * @example:\n * // Valid address\n * isAddress(\"0x8ba1f109551bD432803012645Ac136ddd64DBA72\")\n * //_result:\n *\n * // Valid ICAP address\n * isAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\")\n * //_result:\n *\n * // Invalid checksum\n * isAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBa72\")\n * //_result:\n *\n * // Invalid ICAP checksum\n * isAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBA72\")\n * //_result:\n *\n * // Not an address (an ENS name requires a provided and an\n * // asynchronous API to access)\n * isAddress(\"ricmoo.eth\")\n * //_result:\n */\nexport function isAddress(value) {\n try {\n getAddress(value);\n return true;\n }\n catch (error) { }\n return false;\n}\nasync function checkAddress(target, promise) {\n const result = await promise;\n if (result == null || result === \"0x0000000000000000000000000000000000000000\") {\n assert(typeof (target) !== \"string\", \"unconfigured name\", \"UNCONFIGURED_NAME\", { value: target });\n assertArgument(false, \"invalid AddressLike value; did not resolve to a value address\", \"target\", target);\n }\n return getAddress(result);\n}\n/**\n * Resolves to an address for the %%target%%, which may be any\n * supported address type, an [[Addressable]] or a Promise which\n * resolves to an address.\n *\n * If an ENS name is provided, but that name has not been correctly\n * configured a [[UnconfiguredNameError]] is thrown.\n *\n * @example:\n * addr = \"0x6B175474E89094C44Da98b954EedeAC495271d0F\"\n *\n * // Addresses are return synchronously\n * resolveAddress(addr, provider)\n * //_result:\n *\n * // Address promises are resolved asynchronously\n * resolveAddress(Promise.resolve(addr))\n * //_result:\n *\n * // ENS names are resolved asynchronously\n * resolveAddress(\"dai.tokens.ethers.eth\", provider)\n * //_result:\n *\n * // Addressable objects are resolved asynchronously\n * contract = new Contract(addr, [ ])\n * resolveAddress(contract, provider)\n * //_result:\n *\n * // Unconfigured ENS names reject\n * resolveAddress(\"nothing-here.ricmoo.eth\", provider)\n * //_error:\n *\n * // ENS names require a NameResolver object passed in\n * // (notice the provider was omitted)\n * resolveAddress(\"nothing-here.ricmoo.eth\")\n * //_error:\n */\nexport function resolveAddress(target, resolver) {\n if (typeof (target) === \"string\") {\n if (target.match(/^0x[0-9a-f]{40}$/i)) {\n return getAddress(target);\n }\n assert(resolver != null, \"ENS resolution requires a provider\", \"UNSUPPORTED_OPERATION\", { operation: \"resolveName\" });\n return checkAddress(target, resolver.resolveName(target));\n }\n else if (isAddressable(target)) {\n return checkAddress(target, target.getAddress());\n }\n else if (target && typeof (target.then) === \"function\") {\n return checkAddress(target, target);\n }\n assertArgument(false, \"unsupported addressable value\", \"target\", target);\n}\n//# sourceMappingURL=checks.js.map","/**\n * A Typed object allows a value to have its type explicitly\n * specified.\n *\n * For example, in Solidity, the value ``45`` could represent a\n * ``uint8`` or a ``uint256``. The value ``0x1234`` could represent\n * a ``bytes2`` or ``bytes``.\n *\n * Since JavaScript has no meaningful way to explicitly inform any\n * APIs which what the type is, this allows transparent interoperation\n * with Soldity.\n *\n * @_subsection: api/abi:Typed Values\n */\nimport { assertPrivate, defineProperties } from \"../utils/index.js\";\nconst _gaurd = {};\nfunction n(value, width) {\n let signed = false;\n if (width < 0) {\n signed = true;\n width *= -1;\n }\n // @TODO: Check range is valid for value\n return new Typed(_gaurd, `${signed ? \"\" : \"u\"}int${width}`, value, { signed, width });\n}\nfunction b(value, size) {\n // @TODO: Check range is valid for value\n return new Typed(_gaurd, `bytes${(size) ? size : \"\"}`, value, { size });\n}\nconst _typedSymbol = Symbol.for(\"_ethers_typed\");\n/**\n * The **Typed** class to wrap values providing explicit type information.\n */\nexport class Typed {\n /**\n * The type, as a Solidity-compatible type.\n */\n type;\n /**\n * The actual value.\n */\n value;\n #options;\n /**\n * @_ignore:\n */\n _typedSymbol;\n /**\n * @_ignore:\n */\n constructor(gaurd, type, value, options) {\n if (options == null) {\n options = null;\n }\n assertPrivate(_gaurd, gaurd, \"Typed\");\n defineProperties(this, { _typedSymbol, type, value });\n this.#options = options;\n // Check the value is valid\n this.format();\n }\n /**\n * Format the type as a Human-Readable type.\n */\n format() {\n if (this.type === \"array\") {\n throw new Error(\"\");\n }\n else if (this.type === \"dynamicArray\") {\n throw new Error(\"\");\n }\n else if (this.type === \"tuple\") {\n return `tuple(${this.value.map((v) => v.format()).join(\",\")})`;\n }\n return this.type;\n }\n /**\n * The default value returned by this type.\n */\n defaultValue() {\n return 0;\n }\n /**\n * The minimum value for numeric types.\n */\n minValue() {\n return 0;\n }\n /**\n * The maximum value for numeric types.\n */\n maxValue() {\n return 0;\n }\n /**\n * Returns ``true`` and provides a type guard is this is a [[TypedBigInt]].\n */\n isBigInt() {\n return !!(this.type.match(/^u?int[0-9]+$/));\n }\n /**\n * Returns ``true`` and provides a type guard is this is a [[TypedData]].\n */\n isData() {\n return this.type.startsWith(\"bytes\");\n }\n /**\n * Returns ``true`` and provides a type guard is this is a [[TypedString]].\n */\n isString() {\n return (this.type === \"string\");\n }\n /**\n * Returns the tuple name, if this is a tuple. Throws otherwise.\n */\n get tupleName() {\n if (this.type !== \"tuple\") {\n throw TypeError(\"not a tuple\");\n }\n return this.#options;\n }\n // Returns the length of this type as an array\n // - `null` indicates the length is unforced, it could be dynamic\n // - `-1` indicates the length is dynamic\n // - any other value indicates it is a static array and is its length\n /**\n * Returns the length of the array type or ``-1`` if it is dynamic.\n *\n * Throws if the type is not an array.\n */\n get arrayLength() {\n if (this.type !== \"array\") {\n throw TypeError(\"not an array\");\n }\n if (this.#options === true) {\n return -1;\n }\n if (this.#options === false) {\n return (this.value).length;\n }\n return null;\n }\n /**\n * Returns a new **Typed** of %%type%% with the %%value%%.\n */\n static from(type, value) {\n return new Typed(_gaurd, type, value);\n }\n /**\n * Return a new ``uint8`` type for %%v%%.\n */\n static uint8(v) { return n(v, 8); }\n /**\n * Return a new ``uint16`` type for %%v%%.\n */\n static uint16(v) { return n(v, 16); }\n /**\n * Return a new ``uint24`` type for %%v%%.\n */\n static uint24(v) { return n(v, 24); }\n /**\n * Return a new ``uint32`` type for %%v%%.\n */\n static uint32(v) { return n(v, 32); }\n /**\n * Return a new ``uint40`` type for %%v%%.\n */\n static uint40(v) { return n(v, 40); }\n /**\n * Return a new ``uint48`` type for %%v%%.\n */\n static uint48(v) { return n(v, 48); }\n /**\n * Return a new ``uint56`` type for %%v%%.\n */\n static uint56(v) { return n(v, 56); }\n /**\n * Return a new ``uint64`` type for %%v%%.\n */\n static uint64(v) { return n(v, 64); }\n /**\n * Return a new ``uint72`` type for %%v%%.\n */\n static uint72(v) { return n(v, 72); }\n /**\n * Return a new ``uint80`` type for %%v%%.\n */\n static uint80(v) { return n(v, 80); }\n /**\n * Return a new ``uint88`` type for %%v%%.\n */\n static uint88(v) { return n(v, 88); }\n /**\n * Return a new ``uint96`` type for %%v%%.\n */\n static uint96(v) { return n(v, 96); }\n /**\n * Return a new ``uint104`` type for %%v%%.\n */\n static uint104(v) { return n(v, 104); }\n /**\n * Return a new ``uint112`` type for %%v%%.\n */\n static uint112(v) { return n(v, 112); }\n /**\n * Return a new ``uint120`` type for %%v%%.\n */\n static uint120(v) { return n(v, 120); }\n /**\n * Return a new ``uint128`` type for %%v%%.\n */\n static uint128(v) { return n(v, 128); }\n /**\n * Return a new ``uint136`` type for %%v%%.\n */\n static uint136(v) { return n(v, 136); }\n /**\n * Return a new ``uint144`` type for %%v%%.\n */\n static uint144(v) { return n(v, 144); }\n /**\n * Return a new ``uint152`` type for %%v%%.\n */\n static uint152(v) { return n(v, 152); }\n /**\n * Return a new ``uint160`` type for %%v%%.\n */\n static uint160(v) { return n(v, 160); }\n /**\n * Return a new ``uint168`` type for %%v%%.\n */\n static uint168(v) { return n(v, 168); }\n /**\n * Return a new ``uint176`` type for %%v%%.\n */\n static uint176(v) { return n(v, 176); }\n /**\n * Return a new ``uint184`` type for %%v%%.\n */\n static uint184(v) { return n(v, 184); }\n /**\n * Return a new ``uint192`` type for %%v%%.\n */\n static uint192(v) { return n(v, 192); }\n /**\n * Return a new ``uint200`` type for %%v%%.\n */\n static uint200(v) { return n(v, 200); }\n /**\n * Return a new ``uint208`` type for %%v%%.\n */\n static uint208(v) { return n(v, 208); }\n /**\n * Return a new ``uint216`` type for %%v%%.\n */\n static uint216(v) { return n(v, 216); }\n /**\n * Return a new ``uint224`` type for %%v%%.\n */\n static uint224(v) { return n(v, 224); }\n /**\n * Return a new ``uint232`` type for %%v%%.\n */\n static uint232(v) { return n(v, 232); }\n /**\n * Return a new ``uint240`` type for %%v%%.\n */\n static uint240(v) { return n(v, 240); }\n /**\n * Return a new ``uint248`` type for %%v%%.\n */\n static uint248(v) { return n(v, 248); }\n /**\n * Return a new ``uint256`` type for %%v%%.\n */\n static uint256(v) { return n(v, 256); }\n /**\n * Return a new ``uint256`` type for %%v%%.\n */\n static uint(v) { return n(v, 256); }\n /**\n * Return a new ``int8`` type for %%v%%.\n */\n static int8(v) { return n(v, -8); }\n /**\n * Return a new ``int16`` type for %%v%%.\n */\n static int16(v) { return n(v, -16); }\n /**\n * Return a new ``int24`` type for %%v%%.\n */\n static int24(v) { return n(v, -24); }\n /**\n * Return a new ``int32`` type for %%v%%.\n */\n static int32(v) { return n(v, -32); }\n /**\n * Return a new ``int40`` type for %%v%%.\n */\n static int40(v) { return n(v, -40); }\n /**\n * Return a new ``int48`` type for %%v%%.\n */\n static int48(v) { return n(v, -48); }\n /**\n * Return a new ``int56`` type for %%v%%.\n */\n static int56(v) { return n(v, -56); }\n /**\n * Return a new ``int64`` type for %%v%%.\n */\n static int64(v) { return n(v, -64); }\n /**\n * Return a new ``int72`` type for %%v%%.\n */\n static int72(v) { return n(v, -72); }\n /**\n * Return a new ``int80`` type for %%v%%.\n */\n static int80(v) { return n(v, -80); }\n /**\n * Return a new ``int88`` type for %%v%%.\n */\n static int88(v) { return n(v, -88); }\n /**\n * Return a new ``int96`` type for %%v%%.\n */\n static int96(v) { return n(v, -96); }\n /**\n * Return a new ``int104`` type for %%v%%.\n */\n static int104(v) { return n(v, -104); }\n /**\n * Return a new ``int112`` type for %%v%%.\n */\n static int112(v) { return n(v, -112); }\n /**\n * Return a new ``int120`` type for %%v%%.\n */\n static int120(v) { return n(v, -120); }\n /**\n * Return a new ``int128`` type for %%v%%.\n */\n static int128(v) { return n(v, -128); }\n /**\n * Return a new ``int136`` type for %%v%%.\n */\n static int136(v) { return n(v, -136); }\n /**\n * Return a new ``int144`` type for %%v%%.\n */\n static int144(v) { return n(v, -144); }\n /**\n * Return a new ``int52`` type for %%v%%.\n */\n static int152(v) { return n(v, -152); }\n /**\n * Return a new ``int160`` type for %%v%%.\n */\n static int160(v) { return n(v, -160); }\n /**\n * Return a new ``int168`` type for %%v%%.\n */\n static int168(v) { return n(v, -168); }\n /**\n * Return a new ``int176`` type for %%v%%.\n */\n static int176(v) { return n(v, -176); }\n /**\n * Return a new ``int184`` type for %%v%%.\n */\n static int184(v) { return n(v, -184); }\n /**\n * Return a new ``int92`` type for %%v%%.\n */\n static int192(v) { return n(v, -192); }\n /**\n * Return a new ``int200`` type for %%v%%.\n */\n static int200(v) { return n(v, -200); }\n /**\n * Return a new ``int208`` type for %%v%%.\n */\n static int208(v) { return n(v, -208); }\n /**\n * Return a new ``int216`` type for %%v%%.\n */\n static int216(v) { return n(v, -216); }\n /**\n * Return a new ``int224`` type for %%v%%.\n */\n static int224(v) { return n(v, -224); }\n /**\n * Return a new ``int232`` type for %%v%%.\n */\n static int232(v) { return n(v, -232); }\n /**\n * Return a new ``int240`` type for %%v%%.\n */\n static int240(v) { return n(v, -240); }\n /**\n * Return a new ``int248`` type for %%v%%.\n */\n static int248(v) { return n(v, -248); }\n /**\n * Return a new ``int256`` type for %%v%%.\n */\n static int256(v) { return n(v, -256); }\n /**\n * Return a new ``int256`` type for %%v%%.\n */\n static int(v) { return n(v, -256); }\n /**\n * Return a new ``bytes1`` type for %%v%%.\n */\n static bytes1(v) { return b(v, 1); }\n /**\n * Return a new ``bytes2`` type for %%v%%.\n */\n static bytes2(v) { return b(v, 2); }\n /**\n * Return a new ``bytes3`` type for %%v%%.\n */\n static bytes3(v) { return b(v, 3); }\n /**\n * Return a new ``bytes4`` type for %%v%%.\n */\n static bytes4(v) { return b(v, 4); }\n /**\n * Return a new ``bytes5`` type for %%v%%.\n */\n static bytes5(v) { return b(v, 5); }\n /**\n * Return a new ``bytes6`` type for %%v%%.\n */\n static bytes6(v) { return b(v, 6); }\n /**\n * Return a new ``bytes7`` type for %%v%%.\n */\n static bytes7(v) { return b(v, 7); }\n /**\n * Return a new ``bytes8`` type for %%v%%.\n */\n static bytes8(v) { return b(v, 8); }\n /**\n * Return a new ``bytes9`` type for %%v%%.\n */\n static bytes9(v) { return b(v, 9); }\n /**\n * Return a new ``bytes10`` type for %%v%%.\n */\n static bytes10(v) { return b(v, 10); }\n /**\n * Return a new ``bytes11`` type for %%v%%.\n */\n static bytes11(v) { return b(v, 11); }\n /**\n * Return a new ``bytes12`` type for %%v%%.\n */\n static bytes12(v) { return b(v, 12); }\n /**\n * Return a new ``bytes13`` type for %%v%%.\n */\n static bytes13(v) { return b(v, 13); }\n /**\n * Return a new ``bytes14`` type for %%v%%.\n */\n static bytes14(v) { return b(v, 14); }\n /**\n * Return a new ``bytes15`` type for %%v%%.\n */\n static bytes15(v) { return b(v, 15); }\n /**\n * Return a new ``bytes16`` type for %%v%%.\n */\n static bytes16(v) { return b(v, 16); }\n /**\n * Return a new ``bytes17`` type for %%v%%.\n */\n static bytes17(v) { return b(v, 17); }\n /**\n * Return a new ``bytes18`` type for %%v%%.\n */\n static bytes18(v) { return b(v, 18); }\n /**\n * Return a new ``bytes19`` type for %%v%%.\n */\n static bytes19(v) { return b(v, 19); }\n /**\n * Return a new ``bytes20`` type for %%v%%.\n */\n static bytes20(v) { return b(v, 20); }\n /**\n * Return a new ``bytes21`` type for %%v%%.\n */\n static bytes21(v) { return b(v, 21); }\n /**\n * Return a new ``bytes22`` type for %%v%%.\n */\n static bytes22(v) { return b(v, 22); }\n /**\n * Return a new ``bytes23`` type for %%v%%.\n */\n static bytes23(v) { return b(v, 23); }\n /**\n * Return a new ``bytes24`` type for %%v%%.\n */\n static bytes24(v) { return b(v, 24); }\n /**\n * Return a new ``bytes25`` type for %%v%%.\n */\n static bytes25(v) { return b(v, 25); }\n /**\n * Return a new ``bytes26`` type for %%v%%.\n */\n static bytes26(v) { return b(v, 26); }\n /**\n * Return a new ``bytes27`` type for %%v%%.\n */\n static bytes27(v) { return b(v, 27); }\n /**\n * Return a new ``bytes28`` type for %%v%%.\n */\n static bytes28(v) { return b(v, 28); }\n /**\n * Return a new ``bytes29`` type for %%v%%.\n */\n static bytes29(v) { return b(v, 29); }\n /**\n * Return a new ``bytes30`` type for %%v%%.\n */\n static bytes30(v) { return b(v, 30); }\n /**\n * Return a new ``bytes31`` type for %%v%%.\n */\n static bytes31(v) { return b(v, 31); }\n /**\n * Return a new ``bytes32`` type for %%v%%.\n */\n static bytes32(v) { return b(v, 32); }\n /**\n * Return a new ``address`` type for %%v%%.\n */\n static address(v) { return new Typed(_gaurd, \"address\", v); }\n /**\n * Return a new ``bool`` type for %%v%%.\n */\n static bool(v) { return new Typed(_gaurd, \"bool\", !!v); }\n /**\n * Return a new ``bytes`` type for %%v%%.\n */\n static bytes(v) { return new Typed(_gaurd, \"bytes\", v); }\n /**\n * Return a new ``string`` type for %%v%%.\n */\n static string(v) { return new Typed(_gaurd, \"string\", v); }\n /**\n * Return a new ``array`` type for %%v%%, allowing %%dynamic%% length.\n */\n static array(v, dynamic) {\n throw new Error(\"not implemented yet\");\n return new Typed(_gaurd, \"array\", v, dynamic);\n }\n /**\n * Return a new ``tuple`` type for %%v%%, with the optional %%name%%.\n */\n static tuple(v, name) {\n throw new Error(\"not implemented yet\");\n return new Typed(_gaurd, \"tuple\", v, name);\n }\n /**\n * Return a new ``uint8`` type for %%v%%.\n */\n static overrides(v) {\n return new Typed(_gaurd, \"overrides\", Object.assign({}, v));\n }\n /**\n * Returns true only if %%value%% is a [[Typed]] instance.\n */\n static isTyped(value) {\n return (value\n && typeof (value) === \"object\"\n && \"_typedSymbol\" in value\n && value._typedSymbol === _typedSymbol);\n }\n /**\n * If the value is a [[Typed]] instance, validates the underlying value\n * and returns it, otherwise returns value directly.\n *\n * This is useful for functions that with to accept either a [[Typed]]\n * object or values.\n */\n static dereference(value, type) {\n if (Typed.isTyped(value)) {\n if (value.type !== type) {\n throw new Error(`invalid type: expecetd ${type}, got ${value.type}`);\n }\n return value.value;\n }\n return value;\n }\n}\n//# sourceMappingURL=typed.js.map","import { getAddress } from \"../../address/index.js\";\nimport { toBeHex } from \"../../utils/maths.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class AddressCoder extends Coder {\n constructor(localName) {\n super(\"address\", \"address\", localName, false);\n }\n defaultValue() {\n return \"0x0000000000000000000000000000000000000000\";\n }\n encode(writer, _value) {\n let value = Typed.dereference(_value, \"string\");\n try {\n value = getAddress(value);\n }\n catch (error) {\n return this._throwError(error.message, _value);\n }\n return writer.writeValue(value);\n }\n decode(reader) {\n return getAddress(toBeHex(reader.readValue(), 20));\n }\n}\n//# sourceMappingURL=address.js.map","import { Coder } from \"./abstract-coder.js\";\n/**\n * Clones the functionality of an existing Coder, but without a localName\n *\n * @_ignore\n */\nexport class AnonymousCoder extends Coder {\n coder;\n constructor(coder) {\n super(coder.name, coder.type, \"_\", coder.dynamic);\n this.coder = coder;\n }\n defaultValue() {\n return this.coder.defaultValue();\n }\n encode(writer, value) {\n return this.coder.encode(writer, value);\n }\n decode(reader) {\n return this.coder.decode(reader);\n }\n}\n//# sourceMappingURL=anonymous.js.map","import { defineProperties, isError, assert, assertArgument, assertArgumentCount } from \"../../utils/index.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder, Result, WordSize, Writer } from \"./abstract-coder.js\";\nimport { AnonymousCoder } from \"./anonymous.js\";\n/**\n * @_ignore\n */\nexport function pack(writer, coders, values) {\n let arrayValues = [];\n if (Array.isArray(values)) {\n arrayValues = values;\n }\n else if (values && typeof (values) === \"object\") {\n let unique = {};\n arrayValues = coders.map((coder) => {\n const name = coder.localName;\n assert(name, \"cannot encode object for signature with missing names\", \"INVALID_ARGUMENT\", { argument: \"values\", info: { coder }, value: values });\n assert(!unique[name], \"cannot encode object for signature with duplicate names\", \"INVALID_ARGUMENT\", { argument: \"values\", info: { coder }, value: values });\n unique[name] = true;\n return values[name];\n });\n }\n else {\n assertArgument(false, \"invalid tuple value\", \"tuple\", values);\n }\n assertArgument(coders.length === arrayValues.length, \"types/value length mismatch\", \"tuple\", values);\n let staticWriter = new Writer();\n let dynamicWriter = new Writer();\n let updateFuncs = [];\n coders.forEach((coder, index) => {\n let value = arrayValues[index];\n if (coder.dynamic) {\n // Get current dynamic offset (for the future pointer)\n let dynamicOffset = dynamicWriter.length;\n // Encode the dynamic value into the dynamicWriter\n coder.encode(dynamicWriter, value);\n // Prepare to populate the correct offset once we are done\n let updateFunc = staticWriter.writeUpdatableValue();\n updateFuncs.push((baseOffset) => {\n updateFunc(baseOffset + dynamicOffset);\n });\n }\n else {\n coder.encode(staticWriter, value);\n }\n });\n // Backfill all the dynamic offsets, now that we know the static length\n updateFuncs.forEach((func) => { func(staticWriter.length); });\n let length = writer.appendWriter(staticWriter);\n length += writer.appendWriter(dynamicWriter);\n return length;\n}\n/**\n * @_ignore\n */\nexport function unpack(reader, coders) {\n let values = [];\n let keys = [];\n // A reader anchored to this base\n let baseReader = reader.subReader(0);\n coders.forEach((coder) => {\n let value = null;\n if (coder.dynamic) {\n let offset = reader.readIndex();\n let offsetReader = baseReader.subReader(offset);\n try {\n value = coder.decode(offsetReader);\n }\n catch (error) {\n // Cannot recover from this\n if (isError(error, \"BUFFER_OVERRUN\")) {\n throw error;\n }\n value = error;\n value.baseType = coder.name;\n value.name = coder.localName;\n value.type = coder.type;\n }\n }\n else {\n try {\n value = coder.decode(reader);\n }\n catch (error) {\n // Cannot recover from this\n if (isError(error, \"BUFFER_OVERRUN\")) {\n throw error;\n }\n value = error;\n value.baseType = coder.name;\n value.name = coder.localName;\n value.type = coder.type;\n }\n }\n if (value == undefined) {\n throw new Error(\"investigate\");\n }\n values.push(value);\n keys.push(coder.localName || null);\n });\n return Result.fromItems(values, keys);\n}\n/**\n * @_ignore\n */\nexport class ArrayCoder extends Coder {\n coder;\n length;\n constructor(coder, length, localName) {\n const type = (coder.type + \"[\" + (length >= 0 ? length : \"\") + \"]\");\n const dynamic = (length === -1 || coder.dynamic);\n super(\"array\", type, localName, dynamic);\n defineProperties(this, { coder, length });\n }\n defaultValue() {\n // Verifies the child coder is valid (even if the array is dynamic or 0-length)\n const defaultChild = this.coder.defaultValue();\n const result = [];\n for (let i = 0; i < this.length; i++) {\n result.push(defaultChild);\n }\n return result;\n }\n encode(writer, _value) {\n const value = Typed.dereference(_value, \"array\");\n if (!Array.isArray(value)) {\n this._throwError(\"expected array value\", value);\n }\n let count = this.length;\n if (count === -1) {\n count = value.length;\n writer.writeValue(value.length);\n }\n assertArgumentCount(value.length, count, \"coder array\" + (this.localName ? (\" \" + this.localName) : \"\"));\n let coders = [];\n for (let i = 0; i < value.length; i++) {\n coders.push(this.coder);\n }\n return pack(writer, coders, value);\n }\n decode(reader) {\n let count = this.length;\n if (count === -1) {\n count = reader.readIndex();\n // Check that there is *roughly* enough data to ensure\n // stray random data is not being read as a length. Each\n // slot requires at least 32 bytes for their value (or 32\n // bytes as a link to the data). This could use a much\n // tighter bound, but we are erroring on the side of safety.\n assert(count * WordSize <= reader.dataLength, \"insufficient data length\", \"BUFFER_OVERRUN\", { buffer: reader.bytes, offset: count * WordSize, length: reader.dataLength });\n }\n let coders = [];\n for (let i = 0; i < count; i++) {\n coders.push(new AnonymousCoder(this.coder));\n }\n return unpack(reader, coders);\n }\n}\n//# sourceMappingURL=array.js.map","import { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class BooleanCoder extends Coder {\n constructor(localName) {\n super(\"bool\", \"bool\", localName, false);\n }\n defaultValue() {\n return false;\n }\n encode(writer, _value) {\n const value = Typed.dereference(_value, \"bool\");\n return writer.writeValue(value ? 1 : 0);\n }\n decode(reader) {\n return !!reader.readValue();\n }\n}\n//# sourceMappingURL=boolean.js.map","import { getBytesCopy, hexlify } from \"../../utils/index.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class DynamicBytesCoder extends Coder {\n constructor(type, localName) {\n super(type, type, localName, true);\n }\n defaultValue() {\n return \"0x\";\n }\n encode(writer, value) {\n value = getBytesCopy(value);\n let length = writer.writeValue(value.length);\n length += writer.writeBytes(value);\n return length;\n }\n decode(reader) {\n return reader.readBytes(reader.readIndex(), true);\n }\n}\n/**\n * @_ignore\n */\nexport class BytesCoder extends DynamicBytesCoder {\n constructor(localName) {\n super(\"bytes\", localName);\n }\n decode(reader) {\n return hexlify(super.decode(reader));\n }\n}\n//# sourceMappingURL=bytes.js.map","import { defineProperties, getBytesCopy, hexlify } from \"../../utils/index.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class FixedBytesCoder extends Coder {\n size;\n constructor(size, localName) {\n let name = \"bytes\" + String(size);\n super(name, name, localName, false);\n defineProperties(this, { size }, { size: \"number\" });\n }\n defaultValue() {\n return (\"0x0000000000000000000000000000000000000000000000000000000000000000\").substring(0, 2 + this.size * 2);\n }\n encode(writer, _value) {\n let data = getBytesCopy(Typed.dereference(_value, this.type));\n if (data.length !== this.size) {\n this._throwError(\"incorrect data length\", _value);\n }\n return writer.writeBytes(data);\n }\n decode(reader) {\n return hexlify(reader.readBytes(this.size));\n }\n}\n//# sourceMappingURL=fixed-bytes.js.map","import { Coder } from \"./abstract-coder.js\";\nconst Empty = new Uint8Array([]);\n/**\n * @_ignore\n */\nexport class NullCoder extends Coder {\n constructor(localName) {\n super(\"null\", \"\", localName, false);\n }\n defaultValue() {\n return null;\n }\n encode(writer, value) {\n if (value != null) {\n this._throwError(\"not null\", value);\n }\n return writer.writeBytes(Empty);\n }\n decode(reader) {\n reader.readBytes(0);\n return null;\n }\n}\n//# sourceMappingURL=null.js.map","import { defineProperties, fromTwos, getBigInt, mask, toTwos } from \"../../utils/index.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder, WordSize } from \"./abstract-coder.js\";\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_MAX_UINT256 = BigInt(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\n/**\n * @_ignore\n */\nexport class NumberCoder extends Coder {\n size;\n signed;\n constructor(size, signed, localName) {\n const name = ((signed ? \"int\" : \"uint\") + (size * 8));\n super(name, name, localName, false);\n defineProperties(this, { size, signed }, { size: \"number\", signed: \"boolean\" });\n }\n defaultValue() {\n return 0;\n }\n encode(writer, _value) {\n let value = getBigInt(Typed.dereference(_value, this.type));\n // Check bounds are safe for encoding\n let maxUintValue = mask(BN_MAX_UINT256, WordSize * 8);\n if (this.signed) {\n let bounds = mask(maxUintValue, (this.size * 8) - 1);\n if (value > bounds || value < -(bounds + BN_1)) {\n this._throwError(\"value out-of-bounds\", _value);\n }\n value = toTwos(value, 8 * WordSize);\n }\n else if (value < BN_0 || value > mask(maxUintValue, this.size * 8)) {\n this._throwError(\"value out-of-bounds\", _value);\n }\n return writer.writeValue(value);\n }\n decode(reader) {\n let value = mask(reader.readValue(), this.size * 8);\n if (this.signed) {\n value = fromTwos(value, this.size * 8);\n }\n return value;\n }\n}\n//# sourceMappingURL=number.js.map","import { toUtf8Bytes, toUtf8String } from \"../../utils/utf8.js\";\nimport { Typed } from \"../typed.js\";\nimport { DynamicBytesCoder } from \"./bytes.js\";\n/**\n * @_ignore\n */\nexport class StringCoder extends DynamicBytesCoder {\n constructor(localName) {\n super(\"string\", localName);\n }\n defaultValue() {\n return \"\";\n }\n encode(writer, _value) {\n return super.encode(writer, toUtf8Bytes(Typed.dereference(_value, \"string\")));\n }\n decode(reader) {\n return toUtf8String(super.decode(reader));\n }\n}\n//# sourceMappingURL=string.js.map","import { defineProperties } from \"../../utils/properties.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\nimport { pack, unpack } from \"./array.js\";\n/**\n * @_ignore\n */\nexport class TupleCoder extends Coder {\n coders;\n constructor(coders, localName) {\n let dynamic = false;\n const types = [];\n coders.forEach((coder) => {\n if (coder.dynamic) {\n dynamic = true;\n }\n types.push(coder.type);\n });\n const type = (\"tuple(\" + types.join(\",\") + \")\");\n super(\"tuple\", type, localName, dynamic);\n defineProperties(this, { coders: Object.freeze(coders.slice()) });\n }\n defaultValue() {\n const values = [];\n this.coders.forEach((coder) => {\n values.push(coder.defaultValue());\n });\n // We only output named properties for uniquely named coders\n const uniqueNames = this.coders.reduce((accum, coder) => {\n const name = coder.localName;\n if (name) {\n if (!accum[name]) {\n accum[name] = 0;\n }\n accum[name]++;\n }\n return accum;\n }, {});\n // Add named values\n this.coders.forEach((coder, index) => {\n let name = coder.localName;\n if (!name || uniqueNames[name] !== 1) {\n return;\n }\n if (name === \"length\") {\n name = \"_length\";\n }\n if (values[name] != null) {\n return;\n }\n values[name] = values[index];\n });\n return Object.freeze(values);\n }\n encode(writer, _value) {\n const value = Typed.dereference(_value, \"tuple\");\n return pack(writer, this.coders, value);\n }\n decode(reader) {\n return unpack(reader, this.coders);\n }\n}\n//# sourceMappingURL=tuple.js.map","import { getAddress } from \"../address/index.js\";\nimport { assertArgument, isHexString } from \"../utils/index.js\";\nfunction accessSetify(addr, storageKeys) {\n return {\n address: getAddress(addr),\n storageKeys: storageKeys.map((storageKey, index) => {\n assertArgument(isHexString(storageKey, 32), \"invalid slot\", `storageKeys[${index}]`, storageKey);\n return storageKey.toLowerCase();\n })\n };\n}\n/**\n * Returns a [[AccessList]] from any ethers-supported access-list structure.\n */\nexport function accessListify(value) {\n if (Array.isArray(value)) {\n return value.map((set, index) => {\n if (Array.isArray(set)) {\n assertArgument(set.length === 2, \"invalid slot set\", `value[${index}]`, set);\n return accessSetify(set[0], set[1]);\n }\n assertArgument(set != null && typeof (set) === \"object\", \"invalid address-slot set\", \"value\", value);\n return accessSetify(set.address, set.storageKeys);\n });\n }\n assertArgument(value != null && typeof (value) === \"object\", \"invalid access list\", \"value\", value);\n const result = Object.keys(value).map((addr) => {\n const storageKeys = value[addr].reduce((accum, storageKey) => {\n accum[storageKey] = true;\n return accum;\n }, {});\n return accessSetify(addr, Object.keys(storageKeys).sort());\n });\n result.sort((a, b) => (a.address.localeCompare(b.address)));\n return result;\n}\n//# sourceMappingURL=accesslist.js.map","import { getAddress } from \"../address/index.js\";\nimport { Signature } from \"../crypto/index.js\";\nimport { getBigInt } from \"../utils/index.js\";\nexport function authorizationify(auth) {\n return {\n address: getAddress(auth.address),\n nonce: getBigInt((auth.nonce != null) ? auth.nonce : 0),\n chainId: getBigInt((auth.chainId != null) ? auth.chainId : 0),\n signature: Signature.from(auth.signature)\n };\n}\n//# sourceMappingURL=authorization.js.map","import { getAddress } from \"../address/index.js\";\nimport { keccak256, SigningKey } from \"../crypto/index.js\";\n/**\n * Returns the address for the %%key%%.\n *\n * The key may be any standard form of public key or a private key.\n */\nexport function computeAddress(key) {\n let pubkey;\n if (typeof (key) === \"string\") {\n pubkey = SigningKey.computePublicKey(key, false);\n }\n else {\n pubkey = key.publicKey;\n }\n return getAddress(keccak256(\"0x\" + pubkey.substring(4)).substring(26));\n}\n/**\n * Returns the recovered address for the private key that was\n * used to sign %%digest%% that resulted in %%signature%%.\n */\nexport function recoverAddress(digest, signature) {\n return computeAddress(SigningKey.recoverPublicKey(digest, signature));\n}\n//# sourceMappingURL=address.js.map","import { getAddress } from \"../address/index.js\";\nimport { ZeroAddress } from \"../constants/addresses.js\";\nimport { keccak256, sha256, Signature, SigningKey } from \"../crypto/index.js\";\nimport { concat, decodeRlp, encodeRlp, getBytes, getBigInt, getNumber, hexlify, assert, assertArgument, isBytesLike, isHexString, toBeArray, zeroPadValue } from \"../utils/index.js\";\nimport { accessListify } from \"./accesslist.js\";\nimport { authorizationify } from \"./authorization.js\";\nimport { recoverAddress } from \"./address.js\";\nconst BN_0 = BigInt(0);\nconst BN_2 = BigInt(2);\nconst BN_27 = BigInt(27);\nconst BN_28 = BigInt(28);\nconst BN_35 = BigInt(35);\nconst BN_MAX_UINT = BigInt(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\nconst inspect = Symbol.for(\"nodejs.util.inspect.custom\");\nconst BLOB_SIZE = 4096 * 32;\nconst CELL_COUNT = 128;\n/**\n * Returns a BLOb proof as its cells for [[link-eip-7594]] BLOb.\n *\n * The default %%cellCount%% is 128.\n */\nexport function splitBlobCells(_proof, cellCount) {\n if (cellCount == null) {\n cellCount = CELL_COUNT;\n }\n const cellProofs = [];\n const proof = getBytes(_proof);\n const cellSize = proof.length / cellCount;\n for (let i = 0; i < proof.length; i += cellSize) {\n cellProofs.push(hexlify(proof.subarray(i, i + cellSize)));\n }\n return cellProofs;\n}\nfunction getKzgLibrary(kzg) {\n const blobToKzgCommitment = (blob) => {\n if (\"computeBlobProof\" in kzg) {\n // micro-ecc-signer; check for computeBlobProof since this API\n // expects a string while the kzg-wasm below expects a Unit8Array\n if (\"blobToKzgCommitment\" in kzg && typeof (kzg.blobToKzgCommitment) === \"function\") {\n return getBytes(kzg.blobToKzgCommitment(hexlify(blob)));\n }\n }\n else if (\"blobToKzgCommitment\" in kzg && typeof (kzg.blobToKzgCommitment) === \"function\") {\n // kzg-wasm <0.5.0; blobToKzgCommitment(Uint8Array) => Uint8Array\n return getBytes(kzg.blobToKzgCommitment(blob));\n }\n // kzg-wasm >= 0.5.0; blobToKZGCommitment(string) => string\n if (\"blobToKZGCommitment\" in kzg && typeof (kzg.blobToKZGCommitment) === \"function\") {\n return getBytes(kzg.blobToKZGCommitment(hexlify(blob)));\n }\n assertArgument(false, \"unsupported KZG library\", \"kzg\", kzg);\n };\n const computeBlobKzgProof = (blob, commitment) => {\n // micro-ecc-signer\n if (\"computeBlobProof\" in kzg && typeof (kzg.computeBlobProof) === \"function\") {\n return getBytes(kzg.computeBlobProof(hexlify(blob), hexlify(commitment)));\n }\n // kzg-wasm <0.5.0; computeBlobKzgProof(Uint8Array, Uint8Array) => Uint8Array\n if (\"computeBlobKzgProof\" in kzg && typeof (kzg.computeBlobKzgProof) === \"function\") {\n return kzg.computeBlobKzgProof(blob, commitment);\n }\n // kzg-wasm >= 0.5.0; computeBlobKZGProof(string, string) => string\n if (\"computeBlobKZGProof\" in kzg && typeof (kzg.computeBlobKZGProof) === \"function\") {\n return getBytes(kzg.computeBlobKZGProof(hexlify(blob), hexlify(commitment)));\n }\n assertArgument(false, \"unsupported KZG library\", \"kzg\", kzg);\n };\n return { blobToKzgCommitment, computeBlobKzgProof };\n}\nfunction getVersionedHash(version, hash) {\n let versioned = version.toString(16);\n while (versioned.length < 2) {\n versioned = \"0\" + versioned;\n }\n versioned += sha256(hash).substring(4);\n return \"0x\" + versioned;\n}\nfunction handleAddress(value) {\n if (value === \"0x\") {\n return null;\n }\n return getAddress(value);\n}\nfunction handleAccessList(value, param) {\n try {\n return accessListify(value);\n }\n catch (error) {\n assertArgument(false, error.message, param, value);\n }\n}\nfunction handleAuthorizationList(value, param) {\n try {\n if (!Array.isArray(value)) {\n throw new Error(\"authorizationList: invalid array\");\n }\n const result = [];\n for (let i = 0; i < value.length; i++) {\n const auth = value[i];\n if (!Array.isArray(auth)) {\n throw new Error(`authorization[${i}]: invalid array`);\n }\n if (auth.length !== 6) {\n throw new Error(`authorization[${i}]: wrong length`);\n }\n if (!auth[1]) {\n throw new Error(`authorization[${i}]: null address`);\n }\n result.push({\n address: handleAddress(auth[1]),\n nonce: handleUint(auth[2], \"nonce\"),\n chainId: handleUint(auth[0], \"chainId\"),\n signature: Signature.from({\n yParity: handleNumber(auth[3], \"yParity\"),\n r: zeroPadValue(auth[4], 32),\n s: zeroPadValue(auth[5], 32)\n })\n });\n }\n return result;\n }\n catch (error) {\n assertArgument(false, error.message, param, value);\n }\n}\nfunction handleNumber(_value, param) {\n if (_value === \"0x\") {\n return 0;\n }\n return getNumber(_value, param);\n}\nfunction handleUint(_value, param) {\n if (_value === \"0x\") {\n return BN_0;\n }\n const value = getBigInt(_value, param);\n assertArgument(value <= BN_MAX_UINT, \"value exceeds uint size\", param, value);\n return value;\n}\nfunction formatNumber(_value, name) {\n const value = getBigInt(_value, \"value\");\n const result = toBeArray(value);\n assertArgument(result.length <= 32, `value too large`, `tx.${name}`, value);\n return result;\n}\nfunction formatAccessList(value) {\n return accessListify(value).map((set) => [set.address, set.storageKeys]);\n}\nfunction formatAuthorizationList(value) {\n return value.map((a) => {\n return [\n formatNumber(a.chainId, \"chainId\"),\n a.address,\n formatNumber(a.nonce, \"nonce\"),\n formatNumber(a.signature.yParity, \"yParity\"),\n toBeArray(a.signature.r),\n toBeArray(a.signature._s)\n ];\n });\n}\nfunction formatHashes(value, param) {\n assertArgument(Array.isArray(value), `invalid ${param}`, \"value\", value);\n for (let i = 0; i < value.length; i++) {\n assertArgument(isHexString(value[i], 32), \"invalid ${ param } hash\", `value[${i}]`, value[i]);\n }\n return value;\n}\nfunction _parseLegacy(data) {\n const fields = decodeRlp(data);\n assertArgument(Array.isArray(fields) && (fields.length === 9 || fields.length === 6), \"invalid field count for legacy transaction\", \"data\", data);\n const tx = {\n type: 0,\n nonce: handleNumber(fields[0], \"nonce\"),\n gasPrice: handleUint(fields[1], \"gasPrice\"),\n gasLimit: handleUint(fields[2], \"gasLimit\"),\n to: handleAddress(fields[3]),\n value: handleUint(fields[4], \"value\"),\n data: hexlify(fields[5]),\n chainId: BN_0\n };\n // Legacy unsigned transaction\n if (fields.length === 6) {\n return tx;\n }\n const v = handleUint(fields[6], \"v\");\n const r = handleUint(fields[7], \"r\");\n const s = handleUint(fields[8], \"s\");\n if (r === BN_0 && s === BN_0) {\n // EIP-155 unsigned transaction\n tx.chainId = v;\n }\n else {\n // Compute the EIP-155 chain ID (or 0 for legacy)\n let chainId = (v - BN_35) / BN_2;\n if (chainId < BN_0) {\n chainId = BN_0;\n }\n tx.chainId = chainId;\n // Signed Legacy Transaction\n assertArgument(chainId !== BN_0 || (v === BN_27 || v === BN_28), \"non-canonical legacy v\", \"v\", fields[6]);\n tx.signature = Signature.from({\n r: zeroPadValue(fields[7], 32),\n s: zeroPadValue(fields[8], 32),\n v\n });\n //tx.hash = keccak256(data);\n }\n return tx;\n}\nfunction _serializeLegacy(tx, sig) {\n const fields = [\n formatNumber(tx.nonce, \"nonce\"),\n formatNumber(tx.gasPrice || 0, \"gasPrice\"),\n formatNumber(tx.gasLimit, \"gasLimit\"),\n (tx.to || \"0x\"),\n formatNumber(tx.value, \"value\"),\n tx.data,\n ];\n let chainId = BN_0;\n if (tx.chainId != BN_0) {\n // A chainId was provided; if non-zero we'll use EIP-155\n chainId = getBigInt(tx.chainId, \"tx.chainId\");\n // We have a chainId in the tx and an EIP-155 v in the signature,\n // make sure they agree with each other\n assertArgument(!sig || sig.networkV == null || sig.legacyChainId === chainId, \"tx.chainId/sig.v mismatch\", \"sig\", sig);\n }\n else if (tx.signature) {\n // No explicit chainId, but EIP-155 have a derived implicit chainId\n const legacy = tx.signature.legacyChainId;\n if (legacy != null) {\n chainId = legacy;\n }\n }\n // Requesting an unsigned transaction\n if (!sig) {\n // We have an EIP-155 transaction (chainId was specified and non-zero)\n if (chainId !== BN_0) {\n fields.push(toBeArray(chainId));\n fields.push(\"0x\");\n fields.push(\"0x\");\n }\n return encodeRlp(fields);\n }\n // @TODO: We should probably check that tx.signature, chainId, and sig\n // match but that logic could break existing code, so schedule\n // this for the next major bump.\n // Compute the EIP-155 v\n let v = BigInt(27 + sig.yParity);\n if (chainId !== BN_0) {\n v = Signature.getChainIdV(chainId, sig.v);\n }\n else if (BigInt(sig.v) !== v) {\n assertArgument(false, \"tx.chainId/sig.v mismatch\", \"sig\", sig);\n }\n // Add the signature\n fields.push(toBeArray(v));\n fields.push(toBeArray(sig.r));\n fields.push(toBeArray(sig._s));\n return encodeRlp(fields);\n}\nfunction _parseEipSignature(tx, fields) {\n let yParity;\n try {\n yParity = handleNumber(fields[0], \"yParity\");\n if (yParity !== 0 && yParity !== 1) {\n throw new Error(\"bad yParity\");\n }\n }\n catch (error) {\n assertArgument(false, \"invalid yParity\", \"yParity\", fields[0]);\n }\n const r = zeroPadValue(fields[1], 32);\n const s = zeroPadValue(fields[2], 32);\n const signature = Signature.from({ r, s, yParity });\n tx.signature = signature;\n}\nfunction _parseEip1559(data) {\n const fields = decodeRlp(getBytes(data).slice(1));\n assertArgument(Array.isArray(fields) && (fields.length === 9 || fields.length === 12), \"invalid field count for transaction type: 2\", \"data\", hexlify(data));\n const tx = {\n type: 2,\n chainId: handleUint(fields[0], \"chainId\"),\n nonce: handleNumber(fields[1], \"nonce\"),\n maxPriorityFeePerGas: handleUint(fields[2], \"maxPriorityFeePerGas\"),\n maxFeePerGas: handleUint(fields[3], \"maxFeePerGas\"),\n gasPrice: null,\n gasLimit: handleUint(fields[4], \"gasLimit\"),\n to: handleAddress(fields[5]),\n value: handleUint(fields[6], \"value\"),\n data: hexlify(fields[7]),\n accessList: handleAccessList(fields[8], \"accessList\"),\n };\n // Unsigned EIP-1559 Transaction\n if (fields.length === 9) {\n return tx;\n }\n //tx.hash = keccak256(data);\n _parseEipSignature(tx, fields.slice(9));\n return tx;\n}\nfunction _serializeEip1559(tx, sig) {\n const fields = [\n formatNumber(tx.chainId, \"chainId\"),\n formatNumber(tx.nonce, \"nonce\"),\n formatNumber(tx.maxPriorityFeePerGas || 0, \"maxPriorityFeePerGas\"),\n formatNumber(tx.maxFeePerGas || 0, \"maxFeePerGas\"),\n formatNumber(tx.gasLimit, \"gasLimit\"),\n (tx.to || \"0x\"),\n formatNumber(tx.value, \"value\"),\n tx.data,\n formatAccessList(tx.accessList || [])\n ];\n if (sig) {\n fields.push(formatNumber(sig.yParity, \"yParity\"));\n fields.push(toBeArray(sig.r));\n fields.push(toBeArray(sig.s));\n }\n return concat([\"0x02\", encodeRlp(fields)]);\n}\nfunction _parseEip2930(data) {\n const fields = decodeRlp(getBytes(data).slice(1));\n assertArgument(Array.isArray(fields) && (fields.length === 8 || fields.length === 11), \"invalid field count for transaction type: 1\", \"data\", hexlify(data));\n const tx = {\n type: 1,\n chainId: handleUint(fields[0], \"chainId\"),\n nonce: handleNumber(fields[1], \"nonce\"),\n gasPrice: handleUint(fields[2], \"gasPrice\"),\n gasLimit: handleUint(fields[3], \"gasLimit\"),\n to: handleAddress(fields[4]),\n value: handleUint(fields[5], \"value\"),\n data: hexlify(fields[6]),\n accessList: handleAccessList(fields[7], \"accessList\")\n };\n // Unsigned EIP-2930 Transaction\n if (fields.length === 8) {\n return tx;\n }\n //tx.hash = keccak256(data);\n _parseEipSignature(tx, fields.slice(8));\n return tx;\n}\nfunction _serializeEip2930(tx, sig) {\n const fields = [\n formatNumber(tx.chainId, \"chainId\"),\n formatNumber(tx.nonce, \"nonce\"),\n formatNumber(tx.gasPrice || 0, \"gasPrice\"),\n formatNumber(tx.gasLimit, \"gasLimit\"),\n (tx.to || \"0x\"),\n formatNumber(tx.value, \"value\"),\n tx.data,\n formatAccessList(tx.accessList || [])\n ];\n if (sig) {\n fields.push(formatNumber(sig.yParity, \"recoveryParam\"));\n fields.push(toBeArray(sig.r));\n fields.push(toBeArray(sig.s));\n }\n return concat([\"0x01\", encodeRlp(fields)]);\n}\nfunction _parseEip4844(data) {\n let fields = decodeRlp(getBytes(data).slice(1));\n let typeName = \"3\";\n let blobWrapperVersion = null;\n let blobs = null;\n // Parse the network format\n if (fields.length === 4 && Array.isArray(fields[0])) {\n // EIP-4844 format with sidecar\n typeName = \"3 (network format)\";\n const fBlobs = fields[1], fCommits = fields[2], fProofs = fields[3];\n assertArgument(Array.isArray(fBlobs), \"invalid network format: blobs not an array\", \"fields[1]\", fBlobs);\n assertArgument(Array.isArray(fCommits), \"invalid network format: commitments not an array\", \"fields[2]\", fCommits);\n assertArgument(Array.isArray(fProofs), \"invalid network format: proofs not an array\", \"fields[3]\", fProofs);\n assertArgument(fBlobs.length === fCommits.length, \"invalid network format: blobs/commitments length mismatch\", \"fields\", fields);\n assertArgument(fBlobs.length === fProofs.length, \"invalid network format: blobs/proofs length mismatch\", \"fields\", fields);\n blobs = [];\n for (let i = 0; i < fields[1].length; i++) {\n blobs.push({\n data: fBlobs[i],\n commitment: fCommits[i],\n proof: fProofs[i],\n });\n }\n fields = fields[0];\n }\n else if (fields.length === 5 && Array.isArray(fields[0])) {\n // EIP-7594 format with sidecar\n typeName = \"3 (EIP-7594 network format)\";\n blobWrapperVersion = getNumber(fields[1]);\n const fBlobs = fields[2], fCommits = fields[3], fProofs = fields[4];\n assertArgument(blobWrapperVersion === 1, `unsupported EIP-7594 network format version: ${blobWrapperVersion}`, \"fields[1]\", blobWrapperVersion);\n assertArgument(Array.isArray(fBlobs), \"invalid EIP-7594 network format: blobs not an array\", \"fields[2]\", fBlobs);\n assertArgument(Array.isArray(fCommits), \"invalid EIP-7594 network format: commitments not an array\", \"fields[3]\", fCommits);\n assertArgument(Array.isArray(fProofs), \"invalid EIP-7594 network format: proofs not an array\", \"fields[4]\", fProofs);\n assertArgument(fBlobs.length === fCommits.length, \"invalid network format: blobs/commitments length mismatch\", \"fields\", fields);\n assertArgument(fBlobs.length * CELL_COUNT === fProofs.length, \"invalid network format: blobs/proofs length mismatch\", \"fields\", fields);\n blobs = [];\n for (let i = 0; i < fBlobs.length; i++) {\n const proof = [];\n for (let j = 0; j < CELL_COUNT; j++) {\n proof.push(fProofs[(i * CELL_COUNT) + j]);\n }\n blobs.push({\n data: fBlobs[i],\n commitment: fCommits[i],\n proof: concat(proof)\n });\n }\n fields = fields[0];\n }\n assertArgument(Array.isArray(fields) && (fields.length === 11 || fields.length === 14), `invalid field count for transaction type: ${typeName}`, \"data\", hexlify(data));\n const tx = {\n type: 3,\n chainId: handleUint(fields[0], \"chainId\"),\n nonce: handleNumber(fields[1], \"nonce\"),\n maxPriorityFeePerGas: handleUint(fields[2], \"maxPriorityFeePerGas\"),\n maxFeePerGas: handleUint(fields[3], \"maxFeePerGas\"),\n gasPrice: null,\n gasLimit: handleUint(fields[4], \"gasLimit\"),\n to: handleAddress(fields[5]),\n value: handleUint(fields[6], \"value\"),\n data: hexlify(fields[7]),\n accessList: handleAccessList(fields[8], \"accessList\"),\n maxFeePerBlobGas: handleUint(fields[9], \"maxFeePerBlobGas\"),\n blobVersionedHashes: fields[10],\n blobWrapperVersion\n };\n if (blobs) {\n tx.blobs = blobs;\n }\n assertArgument(tx.to != null, `invalid address for transaction type: ${typeName}`, \"data\", data);\n assertArgument(Array.isArray(tx.blobVersionedHashes), \"invalid blobVersionedHashes: must be an array\", \"data\", data);\n for (let i = 0; i < tx.blobVersionedHashes.length; i++) {\n assertArgument(isHexString(tx.blobVersionedHashes[i], 32), `invalid blobVersionedHash at index ${i}: must be length 32`, \"data\", data);\n }\n // Unsigned EIP-4844 Transaction\n if (fields.length === 11) {\n return tx;\n }\n // @TODO: Do we need to do this? This is only called internally\n // and used to verify hashes; it might save time to not do this\n //tx.hash = keccak256(concat([ \"0x03\", encodeRlp(fields) ]));\n _parseEipSignature(tx, fields.slice(11));\n return tx;\n}\nfunction _serializeEip4844(tx, sig, blobs) {\n const fields = [\n formatNumber(tx.chainId, \"chainId\"),\n formatNumber(tx.nonce, \"nonce\"),\n formatNumber(tx.maxPriorityFeePerGas || 0, \"maxPriorityFeePerGas\"),\n formatNumber(tx.maxFeePerGas || 0, \"maxFeePerGas\"),\n formatNumber(tx.gasLimit, \"gasLimit\"),\n (tx.to || ZeroAddress),\n formatNumber(tx.value, \"value\"),\n tx.data,\n formatAccessList(tx.accessList || []),\n formatNumber(tx.maxFeePerBlobGas || 0, \"maxFeePerBlobGas\"),\n formatHashes(tx.blobVersionedHashes || [], \"blobVersionedHashes\")\n ];\n if (sig) {\n fields.push(formatNumber(sig.yParity, \"yParity\"));\n fields.push(toBeArray(sig.r));\n fields.push(toBeArray(sig.s));\n // We have blobs; return the network wrapped format\n if (blobs) {\n // Use EIP-7594\n if (tx.blobWrapperVersion != null) {\n const wrapperVersion = toBeArray(tx.blobWrapperVersion);\n const cellProofs = [];\n for (const { proof } of blobs) {\n const p = getBytes(proof);\n const cellSize = p.length / CELL_COUNT;\n for (let i = 0; i < p.length; i += cellSize) {\n cellProofs.push(p.subarray(i, i + cellSize));\n }\n }\n return concat([\n \"0x03\",\n encodeRlp([\n fields,\n wrapperVersion,\n blobs.map((b) => b.data),\n blobs.map((b) => b.commitment),\n cellProofs\n ])\n ]);\n }\n // Fall back onto classic EIP-4844 behavior\n return concat([\n \"0x03\",\n encodeRlp([\n fields,\n blobs.map((b) => b.data),\n blobs.map((b) => b.commitment),\n blobs.map((b) => b.proof),\n ])\n ]);\n }\n }\n return concat([\"0x03\", encodeRlp(fields)]);\n}\nfunction _parseEip7702(data) {\n const fields = decodeRlp(getBytes(data).slice(1));\n assertArgument(Array.isArray(fields) && (fields.length === 10 || fields.length === 13), \"invalid field count for transaction type: 4\", \"data\", hexlify(data));\n const tx = {\n type: 4,\n chainId: handleUint(fields[0], \"chainId\"),\n nonce: handleNumber(fields[1], \"nonce\"),\n maxPriorityFeePerGas: handleUint(fields[2], \"maxPriorityFeePerGas\"),\n maxFeePerGas: handleUint(fields[3], \"maxFeePerGas\"),\n gasPrice: null,\n gasLimit: handleUint(fields[4], \"gasLimit\"),\n to: handleAddress(fields[5]),\n value: handleUint(fields[6], \"value\"),\n data: hexlify(fields[7]),\n accessList: handleAccessList(fields[8], \"accessList\"),\n authorizationList: handleAuthorizationList(fields[9], \"authorizationList\"),\n };\n // Unsigned EIP-7702 Transaction\n if (fields.length === 10) {\n return tx;\n }\n _parseEipSignature(tx, fields.slice(10));\n return tx;\n}\nfunction _serializeEip7702(tx, sig) {\n const fields = [\n formatNumber(tx.chainId, \"chainId\"),\n formatNumber(tx.nonce, \"nonce\"),\n formatNumber(tx.maxPriorityFeePerGas || 0, \"maxPriorityFeePerGas\"),\n formatNumber(tx.maxFeePerGas || 0, \"maxFeePerGas\"),\n formatNumber(tx.gasLimit, \"gasLimit\"),\n (tx.to || \"0x\"),\n formatNumber(tx.value, \"value\"),\n tx.data,\n formatAccessList(tx.accessList || []),\n formatAuthorizationList(tx.authorizationList || [])\n ];\n if (sig) {\n fields.push(formatNumber(sig.yParity, \"yParity\"));\n fields.push(toBeArray(sig.r));\n fields.push(toBeArray(sig.s));\n }\n return concat([\"0x04\", encodeRlp(fields)]);\n}\n/**\n * A **Transaction** describes an operation to be executed on\n * Ethereum by an Externally Owned Account (EOA). It includes\n * who (the [[to]] address), what (the [[data]]) and how much (the\n * [[value]] in ether) the operation should entail.\n *\n * @example:\n * tx = new Transaction()\n * //_result:\n *\n * tx.data = \"0x1234\";\n * //_result:\n */\nexport class Transaction {\n #type;\n #to;\n #data;\n #nonce;\n #gasLimit;\n #gasPrice;\n #maxPriorityFeePerGas;\n #maxFeePerGas;\n #value;\n #chainId;\n #sig;\n #accessList;\n #maxFeePerBlobGas;\n #blobVersionedHashes;\n #kzg;\n #blobs;\n #auths;\n #blobWrapperVersion;\n /**\n * The transaction type.\n *\n * If null, the type will be automatically inferred based on\n * explicit properties.\n */\n get type() { return this.#type; }\n set type(value) {\n switch (value) {\n case null:\n this.#type = null;\n break;\n case 0:\n case \"legacy\":\n this.#type = 0;\n break;\n case 1:\n case \"berlin\":\n case \"eip-2930\":\n this.#type = 1;\n break;\n case 2:\n case \"london\":\n case \"eip-1559\":\n this.#type = 2;\n break;\n case 3:\n case \"cancun\":\n case \"eip-4844\":\n this.#type = 3;\n break;\n case 4:\n case \"pectra\":\n case \"eip-7702\":\n this.#type = 4;\n break;\n default:\n assertArgument(false, \"unsupported transaction type\", \"type\", value);\n }\n }\n /**\n * The name of the transaction type.\n */\n get typeName() {\n switch (this.type) {\n case 0: return \"legacy\";\n case 1: return \"eip-2930\";\n case 2: return \"eip-1559\";\n case 3: return \"eip-4844\";\n case 4: return \"eip-7702\";\n }\n return null;\n }\n /**\n * The ``to`` address for the transaction or ``null`` if the\n * transaction is an ``init`` transaction.\n */\n get to() {\n const value = this.#to;\n if (value == null && this.type === 3) {\n return ZeroAddress;\n }\n return value;\n }\n set to(value) {\n this.#to = (value == null) ? null : getAddress(value);\n }\n /**\n * The transaction nonce.\n */\n get nonce() { return this.#nonce; }\n set nonce(value) { this.#nonce = getNumber(value, \"value\"); }\n /**\n * The gas limit.\n */\n get gasLimit() { return this.#gasLimit; }\n set gasLimit(value) { this.#gasLimit = getBigInt(value); }\n /**\n * The gas price.\n *\n * On legacy networks this defines the fee that will be paid. On\n * EIP-1559 networks, this should be ``null``.\n */\n get gasPrice() {\n const value = this.#gasPrice;\n if (value == null && (this.type === 0 || this.type === 1)) {\n return BN_0;\n }\n return value;\n }\n set gasPrice(value) {\n this.#gasPrice = (value == null) ? null : getBigInt(value, \"gasPrice\");\n }\n /**\n * The maximum priority fee per unit of gas to pay. On legacy\n * networks this should be ``null``.\n */\n get maxPriorityFeePerGas() {\n const value = this.#maxPriorityFeePerGas;\n if (value == null) {\n if (this.type === 2 || this.type === 3) {\n return BN_0;\n }\n return null;\n }\n return value;\n }\n set maxPriorityFeePerGas(value) {\n this.#maxPriorityFeePerGas = (value == null) ? null : getBigInt(value, \"maxPriorityFeePerGas\");\n }\n /**\n * The maximum total fee per unit of gas to pay. On legacy\n * networks this should be ``null``.\n */\n get maxFeePerGas() {\n const value = this.#maxFeePerGas;\n if (value == null) {\n if (this.type === 2 || this.type === 3) {\n return BN_0;\n }\n return null;\n }\n return value;\n }\n set maxFeePerGas(value) {\n this.#maxFeePerGas = (value == null) ? null : getBigInt(value, \"maxFeePerGas\");\n }\n /**\n * The transaction data. For ``init`` transactions this is the\n * deployment code.\n */\n get data() { return this.#data; }\n set data(value) { this.#data = hexlify(value); }\n /**\n * The amount of ether (in wei) to send in this transactions.\n */\n get value() { return this.#value; }\n set value(value) {\n this.#value = getBigInt(value, \"value\");\n }\n /**\n * The chain ID this transaction is valid on.\n */\n get chainId() { return this.#chainId; }\n set chainId(value) { this.#chainId = getBigInt(value); }\n /**\n * If signed, the signature for this transaction.\n */\n get signature() { return this.#sig || null; }\n set signature(value) {\n this.#sig = (value == null) ? null : Signature.from(value);\n }\n isValid() {\n const sig = this.signature;\n if (sig && !sig.isValid()) {\n return false;\n }\n const auths = this.authorizationList;\n if (auths) {\n for (const auth of auths) {\n if (!auth.signature.isValid()) {\n return false;\n }\n }\n }\n return true;\n }\n /**\n * The access list.\n *\n * An access list permits discounted (but pre-paid) access to\n * bytecode and state variable access within contract execution.\n */\n get accessList() {\n const value = this.#accessList || null;\n if (value == null) {\n if (this.type === 1 || this.type === 2 || this.type === 3) {\n // @TODO: in v7, this should assign the value or become\n // a live object itself, otherwise mutation is inconsistent\n return [];\n }\n return null;\n }\n return value;\n }\n set accessList(value) {\n this.#accessList = (value == null) ? null : accessListify(value);\n }\n get authorizationList() {\n const value = this.#auths || null;\n if (value == null) {\n if (this.type === 4) {\n // @TODO: in v7, this should become a live object itself,\n // otherwise mutation is inconsistent\n return [];\n }\n }\n return value;\n }\n set authorizationList(auths) {\n this.#auths = (auths == null) ? null : auths.map((a) => authorizationify(a));\n }\n /**\n * The max fee per blob gas for Cancun transactions.\n */\n get maxFeePerBlobGas() {\n const value = this.#maxFeePerBlobGas;\n if (value == null && this.type === 3) {\n return BN_0;\n }\n return value;\n }\n set maxFeePerBlobGas(value) {\n this.#maxFeePerBlobGas = (value == null) ? null : getBigInt(value, \"maxFeePerBlobGas\");\n }\n /**\n * The BLOb versioned hashes for Cancun transactions.\n */\n get blobVersionedHashes() {\n // @TODO: Mutation is inconsistent; if unset, the returned value\n // cannot mutate the object, if set it can\n let value = this.#blobVersionedHashes;\n if (value == null && this.type === 3) {\n return [];\n }\n return value;\n }\n set blobVersionedHashes(value) {\n if (value != null) {\n assertArgument(Array.isArray(value), \"blobVersionedHashes must be an Array\", \"value\", value);\n value = value.slice();\n for (let i = 0; i < value.length; i++) {\n assertArgument(isHexString(value[i], 32), \"invalid blobVersionedHash\", `value[${i}]`, value[i]);\n }\n }\n this.#blobVersionedHashes = value;\n }\n /**\n * The BLObs for the Transaction, if any.\n *\n * If ``blobs`` is non-``null``, then the [[seriailized]]\n * will return the network formatted sidecar, otherwise it\n * will return the standard [[link-eip-2718]] payload. The\n * [[unsignedSerialized]] is unaffected regardless.\n *\n * When setting ``blobs``, either fully valid [[Blob]] objects\n * may be specified (i.e. correctly padded, with correct\n * committments and proofs) or a raw [[BytesLike]] may\n * be provided.\n *\n * If raw [[BytesLike]] are provided, the [[kzg]] property **must**\n * be already set. The blob will be correctly padded and the\n * [[KzgLibrary]] will be used to compute the committment and\n * proof for the blob.\n *\n * A BLOb is a sequence of field elements, each of which must\n * be within the BLS field modulo, so some additional processing\n * may be required to encode arbitrary data to ensure each 32 byte\n * field is within the valid range.\n *\n * Setting this automatically populates [[blobVersionedHashes]],\n * overwriting any existing values. Setting this to ``null``\n * does **not** remove the [[blobVersionedHashes]], leaving them\n * present.\n */\n get blobs() {\n if (this.#blobs == null) {\n return null;\n }\n return this.#blobs.map((b) => Object.assign({}, b));\n }\n set blobs(_blobs) {\n if (_blobs == null) {\n this.#blobs = null;\n return;\n }\n const blobs = [];\n const versionedHashes = [];\n for (let i = 0; i < _blobs.length; i++) {\n const blob = _blobs[i];\n if (isBytesLike(blob)) {\n assert(this.#kzg, \"adding a raw blob requires a KZG library\", \"UNSUPPORTED_OPERATION\", {\n operation: \"set blobs()\"\n });\n let data = getBytes(blob);\n assertArgument(data.length <= BLOB_SIZE, \"blob is too large\", `blobs[${i}]`, blob);\n // Pad blob if necessary\n if (data.length !== BLOB_SIZE) {\n const padded = new Uint8Array(BLOB_SIZE);\n padded.set(data);\n data = padded;\n }\n const commit = this.#kzg.blobToKzgCommitment(data);\n const proof = hexlify(this.#kzg.computeBlobKzgProof(data, commit));\n blobs.push({\n data: hexlify(data),\n commitment: hexlify(commit),\n proof\n });\n versionedHashes.push(getVersionedHash(1, commit));\n }\n else {\n const data = hexlify(blob.data);\n const commitment = hexlify(blob.commitment);\n const proof = hexlify(blob.proof);\n blobs.push({ data, commitment, proof });\n versionedHashes.push(getVersionedHash(1, commitment));\n }\n }\n this.#blobs = blobs;\n this.#blobVersionedHashes = versionedHashes;\n }\n get kzg() { return this.#kzg; }\n set kzg(kzg) {\n if (kzg == null) {\n this.#kzg = null;\n }\n else {\n this.#kzg = getKzgLibrary(kzg);\n }\n }\n get blobWrapperVersion() {\n return this.#blobWrapperVersion;\n }\n set blobWrapperVersion(value) {\n this.#blobWrapperVersion = value;\n }\n /**\n * Creates a new Transaction with default values.\n */\n constructor() {\n this.#type = null;\n this.#to = null;\n this.#nonce = 0;\n this.#gasLimit = BN_0;\n this.#gasPrice = null;\n this.#maxPriorityFeePerGas = null;\n this.#maxFeePerGas = null;\n this.#data = \"0x\";\n this.#value = BN_0;\n this.#chainId = BN_0;\n this.#sig = null;\n this.#accessList = null;\n this.#maxFeePerBlobGas = null;\n this.#blobVersionedHashes = null;\n this.#kzg = null;\n this.#blobs = null;\n this.#auths = null;\n this.#blobWrapperVersion = null;\n }\n /**\n * The transaction hash, if signed. Otherwise, ``null``.\n */\n get hash() {\n if (this.signature == null) {\n return null;\n }\n return keccak256(this.#getSerialized(true, false));\n }\n /**\n * The pre-image hash of this transaction.\n *\n * This is the digest that a [[Signer]] must sign to authorize\n * this transaction.\n */\n get unsignedHash() {\n return keccak256(this.unsignedSerialized);\n }\n /**\n * The sending address, if signed. Otherwise, ``null``.\n */\n get from() {\n if (this.signature == null) {\n return null;\n }\n return recoverAddress(this.unsignedHash, this.signature.getCanonical());\n }\n /**\n * The public key of the sender, if signed. Otherwise, ``null``.\n */\n get fromPublicKey() {\n if (this.signature == null) {\n return null;\n }\n return SigningKey.recoverPublicKey(this.unsignedHash, this.signature.getCanonical());\n }\n /**\n * Returns true if signed.\n *\n * This provides a Type Guard that properties requiring a signed\n * transaction are non-null.\n */\n isSigned() {\n return this.signature != null;\n }\n #getSerialized(signed, sidecar) {\n assert(!signed || this.signature != null, \"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized\", \"UNSUPPORTED_OPERATION\", { operation: \".serialized\" });\n const sig = signed ? this.signature : null;\n switch (this.inferType()) {\n case 0:\n return _serializeLegacy(this, sig);\n case 1:\n return _serializeEip2930(this, sig);\n case 2:\n return _serializeEip1559(this, sig);\n case 3:\n return _serializeEip4844(this, sig, sidecar ? this.blobs : null);\n case 4:\n return _serializeEip7702(this, sig);\n }\n assert(false, \"unsupported transaction type\", \"UNSUPPORTED_OPERATION\", { operation: \".serialized\" });\n }\n /**\n * The serialized transaction.\n *\n * This throws if the transaction is unsigned. For the pre-image,\n * use [[unsignedSerialized]].\n */\n get serialized() {\n return this.#getSerialized(true, true);\n }\n /**\n * The transaction pre-image.\n *\n * The hash of this is the digest which needs to be signed to\n * authorize this transaction.\n */\n get unsignedSerialized() {\n return this.#getSerialized(false, false);\n }\n /**\n * Return the most \"likely\" type; currently the highest\n * supported transaction type.\n */\n inferType() {\n const types = this.inferTypes();\n // Prefer London (EIP-1559) over Cancun (BLOb)\n if (types.indexOf(2) >= 0) {\n return 2;\n }\n // Return the highest inferred type\n return (types.pop());\n }\n /**\n * Validates the explicit properties and returns a list of compatible\n * transaction types.\n */\n inferTypes() {\n // Checks that there are no conflicting properties set\n const hasGasPrice = this.gasPrice != null;\n const hasFee = (this.maxFeePerGas != null || this.maxPriorityFeePerGas != null);\n const hasAccessList = (this.accessList != null);\n const hasBlob = (this.#maxFeePerBlobGas != null || this.#blobVersionedHashes);\n //if (hasGasPrice && hasFee) {\n // throw new Error(\"transaction cannot have gasPrice and maxFeePerGas\");\n //}\n if (this.maxFeePerGas != null && this.maxPriorityFeePerGas != null) {\n assert(this.maxFeePerGas >= this.maxPriorityFeePerGas, \"priorityFee cannot be more than maxFee\", \"BAD_DATA\", { value: this });\n }\n //if (this.type === 2 && hasGasPrice) {\n // throw new Error(\"eip-1559 transaction cannot have gasPrice\");\n //}\n assert(!hasFee || (this.type !== 0 && this.type !== 1), \"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas\", \"BAD_DATA\", { value: this });\n assert(this.type !== 0 || !hasAccessList, \"legacy transaction cannot have accessList\", \"BAD_DATA\", { value: this });\n const types = [];\n // Explicit type\n if (this.type != null) {\n types.push(this.type);\n }\n else {\n if (this.authorizationList && this.authorizationList.length) {\n types.push(4);\n }\n else if (hasFee) {\n types.push(2);\n }\n else if (hasGasPrice) {\n types.push(1);\n if (!hasAccessList) {\n types.push(0);\n }\n }\n else if (hasAccessList) {\n types.push(1);\n types.push(2);\n }\n else if (hasBlob && this.to) {\n types.push(3);\n }\n else {\n types.push(0);\n types.push(1);\n types.push(2);\n types.push(3);\n }\n }\n types.sort();\n return types;\n }\n /**\n * Returns true if this transaction is a legacy transaction (i.e.\n * ``type === 0``).\n *\n * This provides a Type Guard that the related properties are\n * non-null.\n */\n isLegacy() {\n return (this.type === 0);\n }\n /**\n * Returns true if this transaction is berlin hardform transaction (i.e.\n * ``type === 1``).\n *\n * This provides a Type Guard that the related properties are\n * non-null.\n */\n isBerlin() {\n return (this.type === 1);\n }\n /**\n * Returns true if this transaction is london hardform transaction (i.e.\n * ``type === 2``).\n *\n * This provides a Type Guard that the related properties are\n * non-null.\n */\n isLondon() {\n return (this.type === 2);\n }\n /**\n * Returns true if this transaction is an [[link-eip-4844]] BLOB\n * transaction.\n *\n * This provides a Type Guard that the related properties are\n * non-null.\n */\n isCancun() {\n return (this.type === 3);\n }\n /**\n * Create a copy of this transaciton.\n */\n clone() {\n return Transaction.from(this);\n }\n /**\n * Return a JSON-friendly object.\n */\n toJSON() {\n const s = (v) => {\n if (v == null) {\n return null;\n }\n return v.toString();\n };\n return {\n type: this.type,\n to: this.to,\n // from: this.from,\n data: this.data,\n nonce: this.nonce,\n gasLimit: s(this.gasLimit),\n gasPrice: s(this.gasPrice),\n maxPriorityFeePerGas: s(this.maxPriorityFeePerGas),\n maxFeePerGas: s(this.maxFeePerGas),\n value: s(this.value),\n chainId: s(this.chainId),\n sig: this.signature ? this.signature.toJSON() : null,\n accessList: this.accessList\n };\n }\n [inspect]() {\n return this.toString();\n }\n toString() {\n const output = [];\n const add = (key) => {\n let value = this[key];\n if (typeof (value) === \"string\") {\n value = JSON.stringify(value);\n }\n output.push(`${key}: ${value}`);\n };\n if (this.type) {\n add(\"type\");\n }\n add(\"to\");\n add(\"data\");\n add(\"nonce\");\n add(\"gasLimit\");\n add(\"value\");\n if (this.chainId != null) {\n add(\"chainId\");\n }\n if (this.signature) {\n add(\"from\");\n output.push(`signature: ${this.signature.toString()}`);\n }\n // @TODO: accessList\n // @TODO: blobs (might make output huge; maybe just include a flag?)\n const auths = this.authorizationList;\n if (auths) {\n const outputAuths = [];\n for (const auth of auths) {\n const o = [];\n o.push(`address: ${JSON.stringify(auth.address)}`);\n if (auth.nonce != null) {\n o.push(`nonce: ${auth.nonce}`);\n }\n if (auth.chainId != null) {\n o.push(`chainId: ${auth.chainId}`);\n }\n if (auth.signature) {\n o.push(`signature: ${auth.signature.toString()}`);\n }\n outputAuths.push(`Authorization { ${o.join(\", \")} }`);\n }\n output.push(`authorizations: [ ${outputAuths.join(\", \")} ]`);\n }\n return `Transaction { ${output.join(\", \")} }`;\n }\n /**\n * Create a **Transaction** from a serialized transaction or a\n * Transaction-like object.\n */\n static from(tx) {\n if (tx == null) {\n return new Transaction();\n }\n if (typeof (tx) === \"string\") {\n const payload = getBytes(tx);\n if (payload[0] >= 0x7f) { // @TODO: > vs >= ??\n return Transaction.from(_parseLegacy(payload));\n }\n switch (payload[0]) {\n case 1: return Transaction.from(_parseEip2930(payload));\n case 2: return Transaction.from(_parseEip1559(payload));\n case 3: return Transaction.from(_parseEip4844(payload));\n case 4: return Transaction.from(_parseEip7702(payload));\n }\n assert(false, \"unsupported transaction type\", \"UNSUPPORTED_OPERATION\", { operation: \"from\" });\n }\n const result = new Transaction();\n if (tx.type != null) {\n result.type = tx.type;\n }\n if (tx.to != null) {\n result.to = tx.to;\n }\n if (tx.nonce != null) {\n result.nonce = tx.nonce;\n }\n if (tx.gasLimit != null) {\n result.gasLimit = tx.gasLimit;\n }\n if (tx.gasPrice != null) {\n result.gasPrice = tx.gasPrice;\n }\n if (tx.maxPriorityFeePerGas != null) {\n result.maxPriorityFeePerGas = tx.maxPriorityFeePerGas;\n }\n if (tx.maxFeePerGas != null) {\n result.maxFeePerGas = tx.maxFeePerGas;\n }\n if (tx.maxFeePerBlobGas != null) {\n result.maxFeePerBlobGas = tx.maxFeePerBlobGas;\n }\n if (tx.data != null) {\n result.data = tx.data;\n }\n if (tx.value != null) {\n result.value = tx.value;\n }\n if (tx.chainId != null) {\n result.chainId = tx.chainId;\n }\n if (tx.signature != null) {\n result.signature = Signature.from(tx.signature);\n }\n if (tx.accessList != null) {\n result.accessList = tx.accessList;\n }\n if (tx.authorizationList != null) {\n result.authorizationList = tx.authorizationList;\n }\n // This will get overwritten by blobs, if present\n if (tx.blobVersionedHashes != null) {\n result.blobVersionedHashes = tx.blobVersionedHashes;\n }\n // Make sure we assign the kzg before assigning blobs, which\n // require the library in the event raw blob data is provided.\n if (tx.kzg != null) {\n result.kzg = tx.kzg;\n }\n if (tx.blobWrapperVersion != null) {\n result.blobWrapperVersion = tx.blobWrapperVersion;\n }\n if (tx.blobs != null) {\n result.blobs = tx.blobs;\n }\n if (tx.hash != null) {\n assertArgument(result.isSigned(), \"unsigned transaction cannot define '.hash'\", \"tx\", tx);\n assertArgument(result.hash === tx.hash, \"hash mismatch\", \"tx\", tx);\n }\n if (tx.from != null) {\n assertArgument(result.isSigned(), \"unsigned transaction cannot define '.from'\", \"tx\", tx);\n assertArgument(result.from.toLowerCase() === (tx.from || \"\").toLowerCase(), \"from mismatch\", \"tx\", tx);\n }\n return result;\n }\n}\n//# sourceMappingURL=transaction.js.map","import { getAddress } from \"../address/index.js\";\nimport { keccak256 } from \"../crypto/index.js\";\nimport { recoverAddress } from \"../transaction/index.js\";\nimport { assertArgument, concat, encodeRlp, toBeArray } from \"../utils/index.js\";\n/**\n * Computes the [[link-eip-7702]] authorization digest to sign.\n */\nexport function hashAuthorization(auth) {\n assertArgument(typeof (auth.address) === \"string\", \"invalid address for hashAuthorization\", \"auth.address\", auth);\n return keccak256(concat([\n \"0x05\", encodeRlp([\n (auth.chainId != null) ? toBeArray(auth.chainId) : \"0x\",\n getAddress(auth.address),\n (auth.nonce != null) ? toBeArray(auth.nonce) : \"0x\",\n ])\n ]));\n}\n/**\n * Return the address of the private key that produced\n * the signature %%sig%% during signing for %%message%%.\n */\nexport function verifyAuthorization(auth, sig) {\n return recoverAddress(hashAuthorization(auth), sig);\n}\n//# sourceMappingURL=authorization.js.map","import { keccak256 } from \"../crypto/index.js\";\nimport { toUtf8Bytes } from \"../utils/index.js\";\n/**\n * A simple hashing function which operates on UTF-8 strings to\n * compute an 32-byte identifier.\n *\n * This simply computes the [UTF-8 bytes](toUtf8Bytes) and computes\n * the [[keccak256]].\n *\n * @example:\n * id(\"hello world\")\n * //_result:\n */\nexport function id(value) {\n return keccak256(toUtf8Bytes(value));\n}\n//# sourceMappingURL=id.js.map","// created 2023-09-25T01:01:55.148Z\n// compressed base64-encoded blob for include-ens data\n// source: https://github.com/adraffy/ens-normalize.js/blob/main/src/make.js\n// see: https://github.com/adraffy/ens-normalize.js#security\n// SHA-256: 0565ed049b9cf1614bb9e11ba7d8ac6a6fb96c893253d890f7e2b2884b9ded32\nvar COMPRESSED$1 = 'AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+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joHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI';\nconst FENCED = new Map([[8217,\"apostrophe\"],[8260,\"fraction slash\"],[12539,\"middle dot\"]]);\nconst NSM_MAX = 4;\n\nfunction decode_arithmetic(bytes) {\r\n\tlet pos = 0;\r\n\tfunction u16() { return (bytes[pos++] << 8) | bytes[pos++]; }\r\n\t\r\n\t// decode the frequency table\r\n\tlet symbol_count = u16();\r\n\tlet total = 1;\r\n\tlet acc = [0, 1]; // first symbol has frequency 1\r\n\tfor (let i = 1; i < symbol_count; i++) {\r\n\t\tacc.push(total += u16());\r\n\t}\r\n\r\n\t// skip the sized-payload that the last 3 symbols index into\r\n\tlet skip = u16();\r\n\tlet pos_payload = pos;\r\n\tpos += skip;\r\n\r\n\tlet read_width = 0;\r\n\tlet read_buffer = 0; \r\n\tfunction read_bit() {\r\n\t\tif (read_width == 0) {\r\n\t\t\t// this will read beyond end of buffer\r\n\t\t\t// but (undefined|0) => zero pad\r\n\t\t\tread_buffer = (read_buffer << 8) | bytes[pos++];\r\n\t\t\tread_width = 8;\r\n\t\t}\r\n\t\treturn (read_buffer >> --read_width) & 1;\r\n\t}\r\n\r\n\tconst N = 31;\r\n\tconst FULL = 2**N;\r\n\tconst HALF = FULL >>> 1;\r\n\tconst QRTR = HALF >> 1;\r\n\tconst MASK = FULL - 1;\r\n\r\n\t// fill register\r\n\tlet register = 0;\r\n\tfor (let i = 0; i < N; i++) register = (register << 1) | read_bit();\r\n\r\n\tlet symbols = [];\r\n\tlet low = 0;\r\n\tlet range = FULL; // treat like a float\r\n\twhile (true) {\r\n\t\tlet value = Math.floor((((register - low + 1) * total) - 1) / range);\r\n\t\tlet start = 0;\r\n\t\tlet end = symbol_count;\r\n\t\twhile (end - start > 1) { // binary search\r\n\t\t\tlet mid = (start + end) >>> 1;\r\n\t\t\tif (value < acc[mid]) {\r\n\t\t\t\tend = mid;\r\n\t\t\t} else {\r\n\t\t\t\tstart = mid;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (start == 0) break; // first symbol is end mark\r\n\t\tsymbols.push(start);\r\n\t\tlet a = low + Math.floor(range * acc[start] / total);\r\n\t\tlet b = low + Math.floor(range * acc[start+1] / total) - 1;\r\n\t\twhile (((a ^ b) & HALF) == 0) {\r\n\t\t\tregister = (register << 1) & MASK | read_bit();\r\n\t\t\ta = (a << 1) & MASK;\r\n\t\t\tb = (b << 1) & MASK | 1;\r\n\t\t}\r\n\t\twhile (a & ~b & QRTR) {\r\n\t\t\tregister = (register & HALF) | ((register << 1) & (MASK >>> 1)) | read_bit();\r\n\t\t\ta = (a << 1) ^ HALF;\r\n\t\t\tb = ((b ^ HALF) << 1) | HALF | 1;\r\n\t\t}\r\n\t\tlow = a;\r\n\t\trange = 1 + b - a;\r\n\t}\r\n\tlet offset = symbol_count - 4;\r\n\treturn symbols.map(x => { // index into payload\r\n\t\tswitch (x - offset) {\r\n\t\t\tcase 3: return offset + 0x10100 + ((bytes[pos_payload++] << 16) | (bytes[pos_payload++] << 8) | bytes[pos_payload++]);\r\n\t\t\tcase 2: return offset + 0x100 + ((bytes[pos_payload++] << 8) | bytes[pos_payload++]);\r\n\t\t\tcase 1: return offset + bytes[pos_payload++];\r\n\t\t\tdefault: return x - 1;\r\n\t\t}\r\n\t});\r\n}\t\r\n\r\n// returns an iterator which returns the next symbol\r\nfunction read_payload(v) {\r\n\tlet pos = 0;\r\n\treturn () => v[pos++];\r\n}\r\nfunction read_compressed_payload(s) {\r\n\treturn read_payload(decode_arithmetic(unsafe_atob(s)));\r\n}\r\n\r\n// unsafe in the sense:\r\n// expected well-formed Base64 w/o padding \r\n// 20220922: added for https://github.com/adraffy/ens-normalize.js/issues/4\r\nfunction unsafe_atob(s) {\r\n\tlet lookup = [];\r\n\t[...'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'].forEach((c, i) => lookup[c.charCodeAt(0)] = i);\r\n\tlet n = s.length;\r\n\tlet ret = new Uint8Array((6 * n) >> 3);\r\n\tfor (let i = 0, pos = 0, width = 0, carry = 0; i < n; i++) {\r\n\t\tcarry = (carry << 6) | lookup[s.charCodeAt(i)];\r\n\t\twidth += 6;\r\n\t\tif (width >= 8) {\r\n\t\t\tret[pos++] = (carry >> (width -= 8));\r\n\t\t}\r\n\t}\r\n\treturn ret;\r\n}\r\n\r\n// eg. [0,1,2,3...] => [0,-1,1,-2,...]\r\nfunction signed(i) { \r\n\treturn (i & 1) ? (~i >> 1) : (i >> 1);\r\n}\r\n\r\nfunction read_deltas(n, next) {\r\n\tlet v = Array(n);\r\n\tfor (let i = 0, x = 0; i < n; i++) v[i] = x += signed(next());\r\n\treturn v;\r\n}\r\n\r\n// [123][5] => [0 3] [1 1] [0 0]\r\nfunction read_sorted(next, prev = 0) {\r\n\tlet ret = [];\r\n\twhile (true) {\r\n\t\tlet x = next();\r\n\t\tlet n = next();\r\n\t\tif (!n) break;\r\n\t\tprev += x;\r\n\t\tfor (let i = 0; i < n; i++) {\r\n\t\t\tret.push(prev + i);\r\n\t\t}\r\n\t\tprev += n + 1;\r\n\t}\r\n\treturn ret;\r\n}\r\n\r\nfunction read_sorted_arrays(next) {\r\n\treturn read_array_while(() => { \r\n\t\tlet v = read_sorted(next);\r\n\t\tif (v.length) return v;\r\n\t});\r\n}\r\n\r\n// returns map of x => ys\r\nfunction read_mapped(next) {\r\n\tlet ret = [];\r\n\twhile (true) {\r\n\t\tlet w = next();\r\n\t\tif (w == 0) break;\r\n\t\tret.push(read_linear_table(w, next));\r\n\t}\r\n\twhile (true) {\r\n\t\tlet w = next() - 1;\r\n\t\tif (w < 0) break;\r\n\t\tret.push(read_replacement_table(w, next));\r\n\t}\r\n\treturn ret.flat();\r\n}\r\n\r\n// read until next is falsy\r\n// return array of read values\r\nfunction read_array_while(next) {\r\n\tlet v = [];\r\n\twhile (true) {\r\n\t\tlet x = next(v.length);\r\n\t\tif (!x) break;\r\n\t\tv.push(x);\r\n\t}\r\n\treturn v;\r\n}\r\n\r\n// read w columns of length n\r\n// return as n rows of length w\r\nfunction read_transposed(n, w, next) {\r\n\tlet m = Array(n).fill().map(() => []);\r\n\tfor (let i = 0; i < w; i++) {\r\n\t\tread_deltas(n, next).forEach((x, j) => m[j].push(x));\r\n\t}\r\n\treturn m;\r\n}\r\n \r\n// returns [[x, ys], [x+dx, ys+dy], [x+2*dx, ys+2*dy], ...]\r\n// where dx/dy = steps, n = run size, w = length of y\r\nfunction read_linear_table(w, next) {\r\n\tlet dx = 1 + next();\r\n\tlet dy = next();\r\n\tlet vN = read_array_while(next);\r\n\tlet m = read_transposed(vN.length, 1+w, next);\r\n\treturn m.flatMap((v, i) => {\r\n\t\tlet [x, ...ys] = v;\r\n\t\treturn Array(vN[i]).fill().map((_, j) => {\r\n\t\t\tlet j_dy = j * dy;\r\n\t\t\treturn [x + j * dx, ys.map(y => y + j_dy)];\r\n\t\t});\r\n\t});\r\n}\r\n\r\n// return [[x, ys...], ...]\r\n// where w = length of y\r\nfunction read_replacement_table(w, next) { \r\n\tlet n = 1 + next();\r\n\tlet m = read_transposed(n, 1+w, next);\r\n\treturn m.map(v => [v[0], v.slice(1)]);\r\n}\r\n\r\n\r\nfunction read_trie(next) {\r\n\tlet ret = [];\r\n\tlet sorted = read_sorted(next); \r\n\texpand(decode([]), []);\r\n\treturn ret; // not sorted\r\n\tfunction decode(Q) { // characters that lead into this node\r\n\t\tlet S = next(); // state: valid, save, check\r\n\t\tlet B = read_array_while(() => { // buckets leading to new nodes\r\n\t\t\tlet cps = read_sorted(next).map(i => sorted[i]);\r\n\t\t\tif (cps.length) return decode(cps);\r\n\t\t});\r\n\t\treturn {S, B, Q};\r\n\t}\r\n\tfunction expand({S, B}, cps, saved) {\r\n\t\tif (S & 4 && saved === cps[cps.length-1]) return;\r\n\t\tif (S & 2) saved = cps[cps.length-1];\r\n\t\tif (S & 1) ret.push(cps); \r\n\t\tfor (let br of B) {\r\n\t\t\tfor (let cp of br.Q) {\r\n\t\t\t\texpand(br, [...cps, cp], saved);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\n\nfunction hex_cp(cp) {\r\n\treturn cp.toString(16).toUpperCase().padStart(2, '0');\r\n}\r\n\r\nfunction quote_cp(cp) {\r\n\treturn `{${hex_cp(cp)}}`; // raffy convention: like \"\\u{X}\" w/o the \"\\u\"\r\n}\r\n\r\n/*\r\nexport function explode_cp(s) {\r\n\treturn [...s].map(c => c.codePointAt(0));\r\n}\r\n*/\r\nfunction explode_cp(s) { // this is about 2x faster\r\n\tlet cps = [];\r\n\tfor (let pos = 0, len = s.length; pos < len; ) {\r\n\t\tlet cp = s.codePointAt(pos);\r\n\t\tpos += cp < 0x10000 ? 1 : 2;\r\n\t\tcps.push(cp);\r\n\t}\r\n\treturn cps;\r\n}\r\n\r\nfunction str_from_cps(cps) {\r\n\tconst chunk = 4096;\r\n\tlet len = cps.length;\r\n\tif (len < chunk) return String.fromCodePoint(...cps);\r\n\tlet buf = [];\r\n\tfor (let i = 0; i < len; ) {\r\n\t\tbuf.push(String.fromCodePoint(...cps.slice(i, i += chunk)));\r\n\t}\r\n\treturn buf.join('');\r\n}\r\n\r\nfunction compare_arrays(a, b) {\r\n\tlet n = a.length;\r\n\tlet c = n - b.length;\r\n\tfor (let i = 0; c == 0 && i < n; i++) c = a[i] - b[i];\r\n\treturn c;\r\n}\n\n// created 2023-09-25T01:01:55.148Z\n// compressed base64-encoded blob for include-nf data\n// source: https://github.com/adraffy/ens-normalize.js/blob/main/src/make.js\n// see: https://github.com/adraffy/ens-normalize.js#security\n// SHA-256: a974b6f8541fc29d919bc85118af0a44015851fab5343f8679cb31be2bdb209e\nvar COMPRESSED = 'AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26PTQyy8FfEQ8AY8IPAGcEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiACnwRZEkkVsS7tANAsBG0RuAQLEPABv9HICTUBXigPZwRBApMDOwAamhtaABqEAY8KvKx3LQ4ArAB8UhwEBAVSagD8AEFZADkBIadVj2UMUgx5Il4ANQC9AxIB1BlbEPMAs30CGxlXAhwZKQIECBc6EbsCoxngzv7UzRQA8M0BawL6ZwkN7wABAD33OQRcsgLJCjMCjqUChtw/km+NAsXPAoP2BT84PwURAK0RAvptb6cApQS/OMMey5HJS84UdxpxTPkCogVFITaTOwERAK5pAvkNBOVyA7q3BKlOJSALAgUIBRcEdASpBXqzABXFSWZOawLCOqw//AolCZdvv3dSBkEQGyelEPcMMwG1ATsN7UvYBPEGOwTJH30ZGQ/NlZwIpS3dDO0m4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78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g';\n\n// https://unicode.org/reports/tr15/\r\n// for reference implementation\r\n// see: /derive/nf.js\r\n\r\n\r\n// algorithmic hangul\r\n// https://www.unicode.org/versions/Unicode15.0.0/ch03.pdf (page 144)\r\nconst S0 = 0xAC00;\r\nconst L0 = 0x1100;\r\nconst V0 = 0x1161;\r\nconst T0 = 0x11A7;\r\nconst L_COUNT = 19;\r\nconst V_COUNT = 21;\r\nconst T_COUNT = 28;\r\nconst N_COUNT = V_COUNT * T_COUNT;\r\nconst S_COUNT = L_COUNT * N_COUNT;\r\nconst S1 = S0 + S_COUNT;\r\nconst L1 = L0 + L_COUNT;\r\nconst V1 = V0 + V_COUNT;\r\nconst T1 = T0 + T_COUNT;\r\n\r\nfunction unpack_cc(packed) {\r\n\treturn (packed >> 24) & 0xFF;\r\n}\r\nfunction unpack_cp(packed) {\r\n\treturn packed & 0xFFFFFF;\r\n}\r\n\r\nlet SHIFTED_RANK, EXCLUSIONS, DECOMP, RECOMP;\r\n\r\nfunction init$1() {\r\n\t//console.time('nf');\r\n\tlet r = read_compressed_payload(COMPRESSED);\r\n\tSHIFTED_RANK = new Map(read_sorted_arrays(r).flatMap((v, i) => v.map(x => [x, (i+1) << 24]))); // pre-shifted\r\n\tEXCLUSIONS = new Set(read_sorted(r));\r\n\tDECOMP = new Map();\r\n\tRECOMP = new Map();\r\n\tfor (let [cp, cps] of read_mapped(r)) {\r\n\t\tif (!EXCLUSIONS.has(cp) && cps.length == 2) {\r\n\t\t\tlet [a, b] = cps;\r\n\t\t\tlet bucket = RECOMP.get(a);\r\n\t\t\tif (!bucket) {\r\n\t\t\t\tbucket = new Map();\r\n\t\t\t\tRECOMP.set(a, bucket);\r\n\t\t\t}\r\n\t\t\tbucket.set(b, cp);\r\n\t\t}\r\n\t\tDECOMP.set(cp, cps.reverse()); // stored reversed\r\n\t}\r\n\t//console.timeEnd('nf');\r\n\t// 20230905: 11ms\r\n}\r\n\r\nfunction is_hangul(cp) {\r\n\treturn cp >= S0 && cp < S1;\r\n}\r\n\r\nfunction compose_pair(a, b) {\r\n\tif (a >= L0 && a < L1 && b >= V0 && b < V1) {\r\n\t\treturn S0 + (a - L0) * N_COUNT + (b - V0) * T_COUNT;\r\n\t} else if (is_hangul(a) && b > T0 && b < T1 && (a - S0) % T_COUNT == 0) {\r\n\t\treturn a + (b - T0);\r\n\t} else {\r\n\t\tlet recomp = RECOMP.get(a);\r\n\t\tif (recomp) {\r\n\t\t\trecomp = recomp.get(b);\r\n\t\t\tif (recomp) {\r\n\t\t\t\treturn recomp;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn -1;\r\n\t}\r\n}\r\n\r\nfunction decomposed(cps) {\r\n\tif (!SHIFTED_RANK) init$1();\r\n\tlet ret = [];\r\n\tlet buf = [];\r\n\tlet check_order = false;\r\n\tfunction add(cp) {\r\n\t\tlet cc = SHIFTED_RANK.get(cp);\r\n\t\tif (cc) {\r\n\t\t\tcheck_order = true;\r\n\t\t\tcp |= cc;\r\n\t\t}\r\n\t\tret.push(cp);\r\n\t}\r\n\tfor (let cp of cps) {\r\n\t\twhile (true) {\r\n\t\t\tif (cp < 0x80) {\r\n\t\t\t\tret.push(cp);\r\n\t\t\t} else if (is_hangul(cp)) {\r\n\t\t\t\tlet s_index = cp - S0;\r\n\t\t\t\tlet l_index = s_index / N_COUNT | 0;\r\n\t\t\t\tlet v_index = (s_index % N_COUNT) / T_COUNT | 0;\r\n\t\t\t\tlet t_index = s_index % T_COUNT;\r\n\t\t\t\tadd(L0 + l_index);\r\n\t\t\t\tadd(V0 + v_index);\r\n\t\t\t\tif (t_index > 0) add(T0 + t_index);\r\n\t\t\t} else {\r\n\t\t\t\tlet mapped = DECOMP.get(cp);\r\n\t\t\t\tif (mapped) {\r\n\t\t\t\t\tbuf.push(...mapped);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tadd(cp);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!buf.length) break;\r\n\t\t\tcp = buf.pop();\r\n\t\t}\r\n\t}\r\n\tif (check_order && ret.length > 1) {\r\n\t\tlet prev_cc = unpack_cc(ret[0]);\r\n\t\tfor (let i = 1; i < ret.length; i++) {\r\n\t\t\tlet cc = unpack_cc(ret[i]);\r\n\t\t\tif (cc == 0 || prev_cc <= cc) {\r\n\t\t\t\tprev_cc = cc;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tlet j = i-1;\r\n\t\t\twhile (true) {\r\n\t\t\t\tlet tmp = ret[j+1];\r\n\t\t\t\tret[j+1] = ret[j];\r\n\t\t\t\tret[j] = tmp;\r\n\t\t\t\tif (!j) break;\r\n\t\t\t\tprev_cc = unpack_cc(ret[--j]);\r\n\t\t\t\tif (prev_cc <= cc) break;\r\n\t\t\t}\r\n\t\t\tprev_cc = unpack_cc(ret[i]);\r\n\t\t}\r\n\t}\r\n\treturn ret;\r\n}\r\n\r\nfunction composed_from_decomposed(v) {\r\n\tlet ret = [];\r\n\tlet stack = [];\r\n\tlet prev_cp = -1;\r\n\tlet prev_cc = 0;\r\n\tfor (let packed of v) {\r\n\t\tlet cc = unpack_cc(packed);\r\n\t\tlet cp = unpack_cp(packed);\r\n\t\tif (prev_cp == -1) {\r\n\t\t\tif (cc == 0) {\r\n\t\t\t\tprev_cp = cp;\r\n\t\t\t} else {\r\n\t\t\t\tret.push(cp);\r\n\t\t\t}\r\n\t\t} else if (prev_cc > 0 && prev_cc >= cc) {\r\n\t\t\tif (cc == 0) {\r\n\t\t\t\tret.push(prev_cp, ...stack);\r\n\t\t\t\tstack.length = 0;\r\n\t\t\t\tprev_cp = cp;\r\n\t\t\t} else {\r\n\t\t\t\tstack.push(cp);\r\n\t\t\t}\r\n\t\t\tprev_cc = cc;\r\n\t\t} else {\r\n\t\t\tlet composed = compose_pair(prev_cp, cp);\r\n\t\t\tif (composed >= 0) {\r\n\t\t\t\tprev_cp = composed;\r\n\t\t\t} else if (prev_cc == 0 && cc == 0) {\r\n\t\t\t\tret.push(prev_cp);\r\n\t\t\t\tprev_cp = cp;\r\n\t\t\t} else {\r\n\t\t\t\tstack.push(cp);\r\n\t\t\t\tprev_cc = cc;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (prev_cp >= 0) {\r\n\t\tret.push(prev_cp, ...stack);\t\r\n\t}\r\n\treturn ret;\r\n}\r\n\r\n// note: cps can be iterable\r\nfunction nfd(cps) {\r\n\treturn decomposed(cps).map(unpack_cp);\r\n}\r\nfunction nfc(cps) {\r\n\treturn composed_from_decomposed(decomposed(cps));\r\n}\n\nconst HYPHEN = 0x2D;\r\nconst STOP = 0x2E;\r\nconst STOP_CH = '.';\r\nconst FE0F = 0xFE0F;\r\nconst UNIQUE_PH = 1;\r\n\r\n// 20230913: replace [...v] with Array_from(v) to avoid large spreads\r\nconst Array_from = x => Array.from(x); // Array.from.bind(Array);\r\n\r\nfunction group_has_cp(g, cp) {\r\n\t// 20230913: keep primary and secondary distinct instead of creating valid union\r\n\treturn g.P.has(cp) || g.Q.has(cp);\r\n}\r\n\r\nclass Emoji extends Array {\r\n\tget is_emoji() { return true; } // free tagging system\r\n}\r\n\r\nlet MAPPED, IGNORED, CM, NSM, ESCAPE, NFC_CHECK, GROUPS, WHOLE_VALID, WHOLE_MAP, VALID, EMOJI_LIST, EMOJI_ROOT;\r\n\r\nfunction init() {\r\n\tif (MAPPED) return;\r\n\t\r\n\tlet r = read_compressed_payload(COMPRESSED$1);\r\n\tconst read_sorted_array = () => read_sorted(r);\r\n\tconst read_sorted_set = () => new Set(read_sorted_array());\r\n\tconst set_add_many = (set, v) => v.forEach(x => set.add(x));\r\n\r\n\tMAPPED = new Map(read_mapped(r)); \r\n\tIGNORED = read_sorted_set(); // ignored characters are not valid, so just read raw codepoints\r\n\r\n\t/*\r\n\t// direct include from payload is smaller than the decompression code\r\n\tconst FENCED = new Map(read_array_while(() => {\r\n\t\tlet cp = r();\r\n\t\tif (cp) return [cp, read_str(r())];\r\n\t}));\r\n\t*/\r\n\t// 20230217: we still need all CM for proper error formatting\r\n\t// but norm only needs NSM subset that are potentially-valid\r\n\tCM = read_sorted_array();\r\n\tNSM = new Set(read_sorted_array().map(i => CM[i]));\r\n\tCM = new Set(CM);\r\n\t\r\n\tESCAPE = read_sorted_set(); // characters that should not be printed\r\n\tNFC_CHECK = read_sorted_set(); // only needed to illustrate ens_tokenize() transformations\r\n\r\n\tlet chunks = read_sorted_arrays(r);\r\n\tlet unrestricted = r();\r\n\t//const read_chunked = () => new Set(read_sorted_array().flatMap(i => chunks[i]).concat(read_sorted_array()));\r\n\tconst read_chunked = () => {\r\n\t\t// 20230921: build set in parts, 2x faster\r\n\t\tlet set = new Set();\r\n\t\tread_sorted_array().forEach(i => set_add_many(set, chunks[i]));\r\n\t\tset_add_many(set, read_sorted_array());\r\n\t\treturn set; \r\n\t};\r\n\tGROUPS = read_array_while(i => {\r\n\t\t// minifier property mangling seems unsafe\r\n\t\t// so these are manually renamed to single chars\r\n\t\tlet N = read_array_while(r).map(x => x+0x60);\r\n\t\tif (N.length) {\r\n\t\t\tlet R = i >= unrestricted; // unrestricted then restricted\r\n\t\t\tN[0] -= 32; // capitalize\r\n\t\t\tN = str_from_cps(N);\r\n\t\t\tif (R) N=`Restricted[${N}]`;\r\n\t\t\tlet P = read_chunked(); // primary\r\n\t\t\tlet Q = read_chunked(); // secondary\r\n\t\t\tlet M = !r(); // not-whitelisted, check for NSM\r\n\t\t\t// *** this code currently isn't needed ***\r\n\t\t\t/*\r\n\t\t\tlet V = [...P, ...Q].sort((a, b) => a-b); // derive: sorted valid\r\n\t\t\tlet M = r()-1; // number of combining mark\r\n\t\t\tif (M < 0) { // whitelisted\r\n\t\t\t\tM = new Map(read_array_while(() => {\r\n\t\t\t\t\tlet i = r();\r\n\t\t\t\t\tif (i) return [V[i-1], read_array_while(() => {\r\n\t\t\t\t\t\tlet v = read_array_while(r);\r\n\t\t\t\t\t\tif (v.length) return v.map(x => x-1);\r\n\t\t\t\t\t})];\r\n\t\t\t\t}));\r\n\t\t\t}*/\r\n\t\t\treturn {N, P, Q, M, R};\r\n\t\t}\r\n\t});\r\n\r\n\t// decode compressed wholes\r\n\tWHOLE_VALID = read_sorted_set();\r\n\tWHOLE_MAP = new Map();\r\n\tlet wholes = read_sorted_array().concat(Array_from(WHOLE_VALID)).sort((a, b) => a-b); // must be sorted\r\n\twholes.forEach((cp, i) => {\r\n\t\tlet d = r(); \r\n\t\tlet w = wholes[i] = d ? wholes[i-d] : {V: [], M: new Map()};\r\n\t\tw.V.push(cp); // add to member set\r\n\t\tif (!WHOLE_VALID.has(cp)) {\r\n\t\t\tWHOLE_MAP.set(cp, w); // register with whole map\r\n\t\t}\r\n\t});\r\n\r\n\t// compute confusable-extent complements\r\n\t// usage: WHOLE_MAP.get(cp).M.get(cp) = complement set\r\n\tfor (let {V, M} of new Set(WHOLE_MAP.values())) {\r\n\t\t// connect all groups that have each whole character\r\n\t\tlet recs = [];\r\n\t\tfor (let cp of V) {\r\n\t\t\tlet gs = GROUPS.filter(g => group_has_cp(g, cp));\r\n\t\t\tlet rec = recs.find(({G}) => gs.some(g => G.has(g)));\r\n\t\t\tif (!rec) {\r\n\t\t\t\trec = {G: new Set(), V: []};\r\n\t\t\t\trecs.push(rec);\r\n\t\t\t}\r\n\t\t\trec.V.push(cp);\r\n\t\t\tset_add_many(rec.G, gs);\r\n\t\t}\r\n\t\t// per character cache groups which are not a member of the extent\r\n\t\tlet union = recs.flatMap(x => Array_from(x.G)); // all of the groups used by this whole\r\n\t\tfor (let {G, V} of recs) {\r\n\t\t\tlet complement = new Set(union.filter(g => !G.has(g))); // groups not covered by the extent\r\n\t\t\tfor (let cp of V) {\r\n\t\t\t\tM.set(cp, complement); // this is the same reference\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// compute valid set\r\n\t// 20230924: VALID was union but can be re-used\r\n\tVALID = new Set(); // exists in 1+ groups\r\n\tlet multi = new Set(); // exists in 2+ groups\r\n\tconst add_to_union = cp => VALID.has(cp) ? multi.add(cp) : VALID.add(cp);\r\n\tfor (let g of GROUPS) {\r\n\t\tfor (let cp of g.P) add_to_union(cp);\r\n\t\tfor (let cp of g.Q) add_to_union(cp);\r\n\t}\r\n\t// dual purpose WHOLE_MAP: return placeholder if unique non-confusable\r\n\tfor (let cp of VALID) {\r\n\t\tif (!WHOLE_MAP.has(cp) && !multi.has(cp)) {\r\n\t\t\tWHOLE_MAP.set(cp, UNIQUE_PH);\r\n\t\t}\r\n\t}\r\n\t// add all decomposed parts\r\n\t// see derive: \"Valid is Closed (via Brute-force)\"\r\n\tset_add_many(VALID, nfd(VALID));\r\n\t\r\n\t// decode emoji\r\n\t// 20230719: emoji are now fully-expanded to avoid quirk logic \r\n\tEMOJI_LIST = read_trie(r).map(v => Emoji.from(v)).sort(compare_arrays);\r\n\tEMOJI_ROOT = new Map(); // this has approx 7K nodes (2+ per emoji)\r\n\tfor (let cps of EMOJI_LIST) {\r\n\t\t// 20230719: change to *slightly* stricter algorithm which disallows \r\n\t\t// insertion of misplaced FE0F in emoji sequences (matching ENSIP-15)\r\n\t\t// example: beautified [A B] (eg. flag emoji) \r\n\t\t// before: allow: [A FE0F B], error: [A FE0F FE0F B] \r\n\t\t// after: error: both\r\n\t\t// note: this code now matches ENSNormalize.{cs,java} logic\r\n\t\tlet prev = [EMOJI_ROOT];\r\n\t\tfor (let cp of cps) {\r\n\t\t\tlet next = prev.map(node => {\r\n\t\t\t\tlet child = node.get(cp);\r\n\t\t\t\tif (!child) {\r\n\t\t\t\t\t// should this be object? \r\n\t\t\t\t\t// (most have 1-2 items, few have many)\r\n\t\t\t\t\t// 20230719: no, v8 default map is 4?\r\n\t\t\t\t\tchild = new Map();\r\n\t\t\t\t\tnode.set(cp, child);\r\n\t\t\t\t}\r\n\t\t\t\treturn child;\r\n\t\t\t});\r\n\t\t\tif (cp === FE0F) {\r\n\t\t\t\tprev.push(...next); // less than 20 elements\r\n\t\t\t} else {\r\n\t\t\t\tprev = next;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (let x of prev) {\r\n\t\t\tx.V = cps;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n// if escaped: {HEX}\r\n// else: \"x\" {HEX}\r\nfunction quoted_cp(cp) {\r\n\treturn (should_escape(cp) ? '' : `${bidi_qq(safe_str_from_cps([cp]))} `) + quote_cp(cp);\r\n}\r\n\r\n// 20230211: some messages can be mixed-directional and result in spillover\r\n// use 200E after a quoted string to force the remainder of a string from \r\n// acquring the direction of the quote\r\n// https://www.w3.org/International/questions/qa-bidi-unicode-controls#exceptions\r\nfunction bidi_qq(s) {\r\n\treturn `\"${s}\"\\u200E`; // strong LTR\r\n}\r\n\r\nfunction check_label_extension(cps) {\r\n\tif (cps.length >= 4 && cps[2] == HYPHEN && cps[3] == HYPHEN) {\r\n\t\tthrow new Error(`invalid label extension: \"${str_from_cps(cps.slice(0, 4))}\"`); // this can only be ascii so cant be bidi\r\n\t}\r\n}\r\nfunction check_leading_underscore(cps) {\r\n\tconst UNDERSCORE = 0x5F;\r\n\tfor (let i = cps.lastIndexOf(UNDERSCORE); i > 0; ) {\r\n\t\tif (cps[--i] !== UNDERSCORE) {\r\n\t\t\tthrow new Error('underscore allowed only at start');\r\n\t\t}\r\n\t}\r\n}\r\n// check that a fenced cp is not leading, trailing, or touching another fenced cp\r\nfunction check_fenced(cps) {\r\n\tlet cp = cps[0];\r\n\tlet prev = FENCED.get(cp);\r\n\tif (prev) throw error_placement(`leading ${prev}`);\r\n\tlet n = cps.length;\r\n\tlet last = -1; // prevents trailing from throwing\r\n\tfor (let i = 1; i < n; i++) {\r\n\t\tcp = cps[i];\r\n\t\tlet match = FENCED.get(cp);\r\n\t\tif (match) {\r\n\t\t\t// since cps[0] isn't fenced, cps[1] cannot throw\r\n\t\t\tif (last == i) throw error_placement(`${prev} + ${match}`);\r\n\t\t\tlast = i + 1;\r\n\t\t\tprev = match;\r\n\t\t}\r\n\t}\r\n\tif (last == n) throw error_placement(`trailing ${prev}`);\r\n}\r\n\r\n// create a safe to print string \r\n// invisibles are escaped\r\n// leading cm uses placeholder\r\n// if cps exceed max, middle truncate with ellipsis\r\n// quoter(cp) => string, eg. 3000 => \"{3000}\"\r\n// note: in html, you'd call this function then replace [<>&] with entities\r\nfunction safe_str_from_cps(cps, max = Infinity, quoter = quote_cp) {\r\n\t//if (Number.isInteger(cps)) cps = [cps];\r\n\t//if (!Array.isArray(cps)) throw new TypeError(`expected codepoints`);\r\n\tlet buf = [];\r\n\tif (is_combining_mark(cps[0])) buf.push('◌');\r\n\tif (cps.length > max) {\r\n\t\tmax >>= 1;\r\n\t\tcps = [...cps.slice(0, max), 0x2026, ...cps.slice(-max)];\r\n\t}\r\n\tlet prev = 0;\r\n\tlet n = cps.length;\r\n\tfor (let i = 0; i < n; i++) {\r\n\t\tlet cp = cps[i];\r\n\t\tif (should_escape(cp)) {\r\n\t\t\tbuf.push(str_from_cps(cps.slice(prev, i)));\r\n\t\t\tbuf.push(quoter(cp));\r\n\t\t\tprev = i + 1;\r\n\t\t}\r\n\t}\r\n\tbuf.push(str_from_cps(cps.slice(prev, n)));\r\n\treturn buf.join('');\r\n}\r\n\r\n// note: set(s) cannot be exposed because they can be modified\r\n// note: Object.freeze() doesn't work\r\nfunction is_combining_mark(cp) {\r\n\tinit();\r\n\treturn CM.has(cp);\r\n}\r\nfunction should_escape(cp) {\r\n\tinit();\r\n\treturn ESCAPE.has(cp);\r\n}\r\n\r\n// return all supported emoji as fully-qualified emoji \r\n// ordered by length then lexicographic \r\nfunction ens_emoji() {\r\n\tinit();\r\n\treturn EMOJI_LIST.map(x => x.slice()); // emoji are exposed so copy\r\n}\r\n\r\nfunction ens_normalize_fragment(frag, decompose) {\r\n\tinit();\r\n\tlet nf = decompose ? nfd : nfc;\r\n\treturn frag.split(STOP_CH).map(label => str_from_cps(tokens_from_str(explode_cp(label), nf, filter_fe0f).flat())).join(STOP_CH);\r\n}\r\n\r\nfunction ens_normalize(name) {\r\n\treturn flatten(split(name, nfc, filter_fe0f));\r\n}\r\n\r\nfunction ens_beautify(name) {\r\n\tlet labels = split(name, nfc, x => x); // emoji not exposed\r\n\tfor (let {type, output, error} of labels) {\r\n\t\tif (error) break; // flatten will throw\r\n\r\n\t\t// replace leading/trailing hyphen\r\n\t\t// 20230121: consider beautifing all or leading/trailing hyphen to unicode variant\r\n\t\t// not exactly the same in every font, but very similar: \"-\" vs \"‐\"\r\n\t\t/*\r\n\t\tconst UNICODE_HYPHEN = 0x2010;\r\n\t\t// maybe this should replace all for visual consistancy?\r\n\t\t// `node tools/reg-count.js regex ^-\\{2,\\}` => 592\r\n\t\t//for (let i = 0; i < output.length; i++) if (output[i] == 0x2D) output[i] = 0x2010;\r\n\t\tif (output[0] == HYPHEN) output[0] = UNICODE_HYPHEN;\r\n\t\tlet end = output.length-1;\r\n\t\tif (output[end] == HYPHEN) output[end] = UNICODE_HYPHEN;\r\n\t\t*/\r\n\t\t// 20230123: WHATWG URL uses \"CheckHyphens\" false\r\n\t\t// https://url.spec.whatwg.org/#idna\r\n\r\n\t\t// update ethereum symbol\r\n\t\t// ξ => Ξ if not greek\r\n\t\tif (type !== 'Greek') array_replace(output, 0x3BE, 0x39E);\r\n\r\n\t\t// 20221213: fixes bidi subdomain issue, but breaks invariant (200E is disallowed)\r\n\t\t// could be fixed with special case for: 2D (.) + 200E (LTR)\r\n\t\t// https://discuss.ens.domains/t/bidi-label-ordering-spoof/15824\r\n\t\t//output.splice(0, 0, 0x200E);\r\n\t}\r\n\treturn flatten(labels);\r\n}\r\n\r\nfunction array_replace(v, a, b) {\r\n\tlet prev = 0;\r\n\twhile (true) {\r\n\t\tlet next = v.indexOf(a, prev);\r\n\t\tif (next < 0) break;\r\n\t\tv[next] = b; \r\n\t\tprev = next + 1;\r\n\t}\r\n}\r\n\r\nfunction ens_split(name, preserve_emoji) {\r\n\treturn split(name, nfc, preserve_emoji ? x => x.slice() : filter_fe0f); // emoji are exposed so copy\r\n}\r\n\r\nfunction split(name, nf, ef) {\r\n\tif (!name) return []; // 20230719: empty name allowance\r\n\tinit();\r\n\tlet offset = 0;\r\n\t// https://unicode.org/reports/tr46/#Validity_Criteria\r\n\t// 4.) \"The label must not contain a U+002E ( . ) FULL STOP.\"\r\n\treturn name.split(STOP_CH).map(label => {\r\n\t\tlet input = explode_cp(label);\r\n\t\tlet info = {\r\n\t\t\tinput,\r\n\t\t\toffset, // codepoint, not substring!\r\n\t\t};\r\n\t\toffset += input.length + 1; // + stop\r\n\t\ttry {\r\n\t\t\t// 1.) \"The label must be in Unicode Normalization Form NFC\"\r\n\t\t\tlet tokens = info.tokens = tokens_from_str(input, nf, ef);\r\n\t\t\tlet token_count = tokens.length;\r\n\t\t\tlet type;\r\n\t\t\tif (!token_count) { // the label was effectively empty (could of had ignored characters)\r\n\t\t\t\t//norm = [];\r\n\t\t\t\t//type = 'None'; // use this instead of next match, \"ASCII\"\r\n\t\t\t\t// 20230120: change to strict\r\n\t\t\t\t// https://discuss.ens.domains/t/ens-name-normalization-2nd/14564/59\r\n\t\t\t\tthrow new Error(`empty label`);\r\n\t\t\t} \r\n\t\t\tlet norm = info.output = tokens.flat();\r\n\t\t\tcheck_leading_underscore(norm);\r\n\t\t\tlet emoji = info.emoji = token_count > 1 || tokens[0].is_emoji; // same as: tokens.some(x => x.is_emoji);\r\n\t\t\tif (!emoji && norm.every(cp => cp < 0x80)) { // special case for ascii\r\n\t\t\t\t// 20230123: matches matches WHATWG, see note 3.3\r\n\t\t\t\tcheck_label_extension(norm); // only needed for ascii\r\n\t\t\t\t// cant have fenced\r\n\t\t\t\t// cant have cm\r\n\t\t\t\t// cant have wholes\r\n\t\t\t\t// see derive: \"Fastpath ASCII\"\r\n\t\t\t\ttype = 'ASCII';\r\n\t\t\t} else {\r\n\t\t\t\tlet chars = tokens.flatMap(x => x.is_emoji ? [] : x); // all of the nfc tokens concat together\r\n\t\t\t\tif (!chars.length) { // theres no text, just emoji\r\n\t\t\t\t\ttype = 'Emoji';\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// 5.) \"The label must not begin with a combining mark, that is: General_Category=Mark.\"\r\n\t\t\t\t\tif (CM.has(norm[0])) throw error_placement('leading combining mark');\r\n\t\t\t\t\tfor (let i = 1; i < token_count; i++) { // we've already checked the first token\r\n\t\t\t\t\t\tlet cps = tokens[i];\r\n\t\t\t\t\t\tif (!cps.is_emoji && CM.has(cps[0])) { // every text token has emoji neighbors, eg. EtEEEtEt...\r\n\t\t\t\t\t\t\t// bidi_qq() not needed since emoji is LTR and cps is a CM\r\n\t\t\t\t\t\t\tthrow error_placement(`emoji + combining mark: \"${str_from_cps(tokens[i-1])} + ${safe_str_from_cps([cps[0]])}\"`); \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcheck_fenced(norm);\r\n\t\t\t\t\tlet unique = Array_from(new Set(chars));\r\n\t\t\t\t\tlet [g] = determine_group(unique); // take the first match\r\n\t\t\t\t\t// see derive: \"Matching Groups have Same CM Style\"\r\n\t\t\t\t\t// alternative: could form a hybrid type: Latin/Japanese/...\t\r\n\t\t\t\t\tcheck_group(g, chars); // need text in order\r\n\t\t\t\t\tcheck_whole(g, unique); // only need unique text (order would be required for multiple-char confusables)\r\n\t\t\t\t\ttype = g.N;\r\n\t\t\t\t\t// 20230121: consider exposing restricted flag\r\n\t\t\t\t\t// it's simpler to just check for 'Restricted'\r\n\t\t\t\t\t// or even better: type.endsWith(']')\r\n\t\t\t\t\t//if (g.R) info.restricted = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tinfo.type = type;\r\n\t\t} catch (err) {\r\n\t\t\tinfo.error = err; // use full error object\r\n\t\t}\r\n\t\treturn info;\r\n\t});\r\n}\r\n\r\nfunction check_whole(group, unique) {\r\n\tlet maker;\r\n\tlet shared = [];\r\n\tfor (let cp of unique) {\r\n\t\tlet whole = WHOLE_MAP.get(cp);\r\n\t\tif (whole === UNIQUE_PH) return; // unique, non-confusable\r\n\t\tif (whole) {\r\n\t\t\tlet set = whole.M.get(cp); // groups which have a character that look-like this character\r\n\t\t\tmaker = maker ? maker.filter(g => set.has(g)) : Array_from(set);\r\n\t\t\tif (!maker.length) return; // confusable intersection is empty\r\n\t\t} else {\r\n\t\t\tshared.push(cp); \r\n\t\t}\r\n\t}\r\n\tif (maker) {\r\n\t\t// we have 1+ confusable\r\n\t\t// check if any of the remaining groups\r\n\t\t// contain the shared characters too\r\n\t\tfor (let g of maker) {\r\n\t\t\tif (shared.every(cp => group_has_cp(g, cp))) {\r\n\t\t\t\tthrow new Error(`whole-script confusable: ${group.N}/${g.N}`);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n// assumption: unique.size > 0\r\n// returns list of matching groups\r\nfunction determine_group(unique) {\r\n\tlet groups = GROUPS;\r\n\tfor (let cp of unique) {\r\n\t\t// note: we need to dodge CM that are whitelisted\r\n\t\t// but that code isn't currently necessary\r\n\t\tlet gs = groups.filter(g => group_has_cp(g, cp));\r\n\t\tif (!gs.length) {\r\n\t\t\tif (!GROUPS.some(g => group_has_cp(g, cp))) { \r\n\t\t\t\t// the character was composed of valid parts\r\n\t\t\t\t// but it's NFC form is invalid\r\n\t\t\t\t// 20230716: change to more exact statement, see: ENSNormalize.{cs,java}\r\n\t\t\t\t// note: this doesn't have to be a composition\r\n\t\t\t\t// 20230720: change to full check\r\n\t\t\t\tthrow error_disallowed(cp); // this should be rare\r\n\t\t\t} else {\r\n\t\t\t\t// there is no group that contains all these characters\r\n\t\t\t\t// throw using the highest priority group that matched\r\n\t\t\t\t// https://www.unicode.org/reports/tr39/#mixed_script_confusables\r\n\t\t\t\tthrow error_group_member(groups[0], cp);\r\n\t\t\t}\r\n\t\t}\r\n\t\tgroups = gs;\r\n\t\tif (gs.length == 1) break; // there is only one group left\r\n\t}\r\n\t// there are at least 1 group(s) with all of these characters\r\n\treturn groups;\r\n}\r\n\r\n// throw on first error\r\nfunction flatten(split) {\r\n\treturn split.map(({input, error, output}) => {\r\n\t\tif (error) {\r\n\t\t\t// don't print label again if just a single label\r\n\t\t\tlet msg = error.message;\r\n\t\t\t// bidi_qq() only necessary if msg is digits\r\n\t\t\tthrow new Error(split.length == 1 ? msg : `Invalid label ${bidi_qq(safe_str_from_cps(input, 63))}: ${msg}`); \r\n\t\t}\r\n\t\treturn str_from_cps(output);\r\n\t}).join(STOP_CH);\r\n}\r\n\r\nfunction error_disallowed(cp) {\r\n\t// TODO: add cp to error?\r\n\treturn new Error(`disallowed character: ${quoted_cp(cp)}`); \r\n}\r\nfunction error_group_member(g, cp) {\r\n\tlet quoted = quoted_cp(cp);\r\n\tlet gg = GROUPS.find(g => g.P.has(cp)); // only check primary\r\n\tif (gg) {\r\n\t\tquoted = `${gg.N} ${quoted}`;\r\n\t}\r\n\treturn new Error(`illegal mixture: ${g.N} + ${quoted}`);\r\n}\r\nfunction error_placement(where) {\r\n\treturn new Error(`illegal placement: ${where}`);\r\n}\r\n\r\n// assumption: cps.length > 0\r\n// assumption: cps[0] isn't a CM\r\n// assumption: the previous character isn't an emoji\r\nfunction check_group(g, cps) {\r\n\tfor (let cp of cps) {\r\n\t\tif (!group_has_cp(g, cp)) {\r\n\t\t\t// for whitelisted scripts, this will throw illegal mixture on invalid cm, eg. \"e{300}{300}\"\r\n\t\t\t// at the moment, it's unnecessary to introduce an extra error type\r\n\t\t\t// until there exists a whitelisted multi-character\r\n\t\t\t// eg. if (M < 0 && is_combining_mark(cp)) { ... }\r\n\t\t\t// there are 3 cases:\r\n\t\t\t// 1. illegal cm for wrong group => mixture error\r\n\t\t\t// 2. illegal cm for same group => cm error\r\n\t\t\t// requires set of whitelist cm per group: \r\n\t\t\t// eg. new Set([...g.P, ...g.Q].flatMap(nfc).filter(cp => CM.has(cp)))\r\n\t\t\t// 3. wrong group => mixture error\r\n\t\t\tthrow error_group_member(g, cp);\r\n\t\t}\r\n\t}\r\n\t//if (M >= 0) { // we have a known fixed cm count\r\n\tif (g.M) { // we need to check for NSM\r\n\t\tlet decomposed = nfd(cps);\r\n\t\tfor (let i = 1, e = decomposed.length; i < e; i++) { // see: assumption\r\n\t\t\t// 20230210: bugfix: using cps instead of decomposed h/t Carbon225\r\n\t\t\t/*\r\n\t\t\tif (CM.has(decomposed[i])) {\r\n\t\t\t\tlet j = i + 1;\r\n\t\t\t\twhile (j < e && CM.has(decomposed[j])) j++;\r\n\t\t\t\tif (j - i > M) {\r\n\t\t\t\t\tthrow new Error(`too many combining marks: ${g.N} ${bidi_qq(str_from_cps(decomposed.slice(i-1, j)))} (${j-i}/${M})`);\r\n\t\t\t\t}\r\n\t\t\t\ti = j;\r\n\t\t\t}\r\n\t\t\t*/\r\n\t\t\t// 20230217: switch to NSM counting\r\n\t\t\t// https://www.unicode.org/reports/tr39/#Optional_Detection\r\n\t\t\tif (NSM.has(decomposed[i])) {\r\n\t\t\t\tlet j = i + 1;\r\n\t\t\t\tfor (let cp; j < e && NSM.has(cp = decomposed[j]); j++) {\r\n\t\t\t\t\t// a. Forbid sequences of the same nonspacing mark.\r\n\t\t\t\t\tfor (let k = i; k < j; k++) { // O(n^2) but n < 100\r\n\t\t\t\t\t\tif (decomposed[k] == cp) {\r\n\t\t\t\t\t\t\tthrow new Error(`duplicate non-spacing marks: ${quoted_cp(cp)}`);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// parse to end so we have full nsm count\r\n\t\t\t\t// b. Forbid sequences of more than 4 nonspacing marks (gc=Mn or gc=Me).\r\n\t\t\t\tif (j - i > NSM_MAX) {\r\n\t\t\t\t\t// note: this slice starts with a base char or spacing-mark cm\r\n\t\t\t\t\tthrow new Error(`excessive non-spacing marks: ${bidi_qq(safe_str_from_cps(decomposed.slice(i-1, j)))} (${j-i}/${NSM_MAX})`);\r\n\t\t\t\t}\r\n\t\t\t\ti = j;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t// *** this code currently isn't needed ***\r\n\t/*\r\n\tlet cm_whitelist = M instanceof Map;\r\n\tfor (let i = 0, e = cps.length; i < e; ) {\r\n\t\tlet cp = cps[i++];\r\n\t\tlet seqs = cm_whitelist && M.get(cp);\r\n\t\tif (seqs) { \r\n\t\t\t// list of codepoints that can follow\r\n\t\t\t// if this exists, this will always be 1+\r\n\t\t\tlet j = i;\r\n\t\t\twhile (j < e && CM.has(cps[j])) j++;\r\n\t\t\tlet cms = cps.slice(i, j);\r\n\t\t\tlet match = seqs.find(seq => !compare_arrays(seq, cms));\r\n\t\t\tif (!match) throw new Error(`disallowed combining mark sequence: \"${safe_str_from_cps([cp, ...cms])}\"`);\r\n\t\t\ti = j;\r\n\t\t} else if (!V.has(cp)) {\r\n\t\t\t// https://www.unicode.org/reports/tr39/#mixed_script_confusables\r\n\t\t\tlet quoted = quoted_cp(cp);\r\n\t\t\tfor (let cp of cps) {\r\n\t\t\t\tlet u = UNIQUE.get(cp);\r\n\t\t\t\tif (u && u !== g) {\r\n\t\t\t\t\t// if both scripts are restricted this error is confusing\r\n\t\t\t\t\t// because we don't differentiate RestrictedA from RestrictedB \r\n\t\t\t\t\tif (!u.R) quoted = `${quoted} is ${u.N}`;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthrow new Error(`disallowed ${g.N} character: ${quoted}`);\r\n\t\t\t//throw new Error(`disallowed character: ${quoted} (expected ${g.N})`);\r\n\t\t\t//throw new Error(`${g.N} does not allow: ${quoted}`);\r\n\t\t}\r\n\t}\r\n\tif (!cm_whitelist) {\r\n\t\tlet decomposed = nfd(cps);\r\n\t\tfor (let i = 1, e = decomposed.length; i < e; i++) { // we know it can't be cm leading\r\n\t\t\tif (CM.has(decomposed[i])) {\r\n\t\t\t\tlet j = i + 1;\r\n\t\t\t\twhile (j < e && CM.has(decomposed[j])) j++;\r\n\t\t\t\tif (j - i > M) {\r\n\t\t\t\t\tthrow new Error(`too many combining marks: \"${str_from_cps(decomposed.slice(i-1, j))}\" (${j-i}/${M})`);\r\n\t\t\t\t}\r\n\t\t\t\ti = j;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t*/\r\n}\r\n\r\n// given a list of codepoints\r\n// returns a list of lists, where emoji are a fully-qualified (as Array subclass)\r\n// eg. explode_cp(\"abc💩d\") => [[61, 62, 63], Emoji[1F4A9, FE0F], [64]]\r\n// 20230818: rename for 'process' name collision h/t Javarome\r\n// https://github.com/adraffy/ens-normalize.js/issues/23\r\nfunction tokens_from_str(input, nf, ef) {\r\n\tlet ret = [];\r\n\tlet chars = [];\r\n\tinput = input.slice().reverse(); // flip so we can pop\r\n\twhile (input.length) {\r\n\t\tlet emoji = consume_emoji_reversed(input);\r\n\t\tif (emoji) {\r\n\t\t\tif (chars.length) {\r\n\t\t\t\tret.push(nf(chars));\r\n\t\t\t\tchars = [];\r\n\t\t\t}\r\n\t\t\tret.push(ef(emoji));\r\n\t\t} else {\r\n\t\t\tlet cp = input.pop();\r\n\t\t\tif (VALID.has(cp)) {\r\n\t\t\t\tchars.push(cp);\r\n\t\t\t} else {\r\n\t\t\t\tlet cps = MAPPED.get(cp);\r\n\t\t\t\tif (cps) {\r\n\t\t\t\t\tchars.push(...cps); // less than 10 elements\r\n\t\t\t\t} else if (!IGNORED.has(cp)) {\r\n\t\t\t\t\t// 20230912: unicode 15.1 changed the order of processing such that\r\n\t\t\t\t\t// disallowed parts are only rejected after NFC\r\n\t\t\t\t\t// https://unicode.org/reports/tr46/#Validity_Criteria\r\n\t\t\t\t\t// this doesn't impact normalization as of today\r\n\t\t\t\t\t// technically, this error can be removed as the group logic will apply similar logic\r\n\t\t\t\t\t// however the error type might be less clear\r\n\t\t\t\t\tthrow error_disallowed(cp);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (chars.length) {\r\n\t\tret.push(nf(chars));\r\n\t}\r\n\treturn ret;\r\n}\r\n\r\nfunction filter_fe0f(cps) {\r\n\treturn cps.filter(cp => cp != FE0F);\r\n}\r\n\r\n// given array of codepoints\r\n// returns the longest valid emoji sequence (or undefined if no match)\r\n// *MUTATES* the supplied array\r\n// disallows interleaved ignored characters\r\n// fills (optional) eaten array with matched codepoints\r\nfunction consume_emoji_reversed(cps, eaten) {\r\n\tlet node = EMOJI_ROOT;\r\n\tlet emoji;\r\n\tlet pos = cps.length;\r\n\twhile (pos) {\r\n\t\tnode = node.get(cps[--pos]);\r\n\t\tif (!node) break;\r\n\t\tlet {V} = node;\r\n\t\tif (V) { // this is a valid emoji (so far)\r\n\t\t\temoji = V;\r\n\t\t\tif (eaten) eaten.push(...cps.slice(pos).reverse()); // (optional) copy input, used for ens_tokenize()\r\n\t\t\tcps.length = pos; // truncate\r\n\t\t}\r\n\t}\r\n\treturn emoji;\r\n}\r\n\r\n// ************************************************************\r\n// tokenizer \r\n\r\nconst TY_VALID = 'valid';\r\nconst TY_MAPPED = 'mapped';\r\nconst TY_IGNORED = 'ignored';\r\nconst TY_DISALLOWED = 'disallowed';\r\nconst TY_EMOJI = 'emoji';\r\nconst TY_NFC = 'nfc';\r\nconst TY_STOP = 'stop';\r\n\r\nfunction ens_tokenize(name, {\r\n\tnf = true, // collapse unnormalized runs into a single token\r\n} = {}) {\r\n\tinit();\r\n\tlet input = explode_cp(name).reverse();\r\n\tlet eaten = [];\r\n\tlet tokens = [];\r\n\twhile (input.length) {\r\n\t\tlet emoji = consume_emoji_reversed(input, eaten);\r\n\t\tif (emoji) {\r\n\t\t\ttokens.push({\r\n\t\t\t\ttype: TY_EMOJI,\r\n\t\t\t\temoji: emoji.slice(), // copy emoji\r\n\t\t\t\tinput: eaten,\r\n\t\t\t\tcps: filter_fe0f(emoji)\r\n\t\t\t});\r\n\t\t\teaten = []; // reset buffer\r\n\t\t} else {\r\n\t\t\tlet cp = input.pop();\r\n\t\t\tif (cp == STOP) {\r\n\t\t\t\ttokens.push({type: TY_STOP, cp});\r\n\t\t\t} else if (VALID.has(cp)) {\r\n\t\t\t\ttokens.push({type: TY_VALID, cps: [cp]});\r\n\t\t\t} else if (IGNORED.has(cp)) {\r\n\t\t\t\ttokens.push({type: TY_IGNORED, cp});\r\n\t\t\t} else {\r\n\t\t\t\tlet cps = MAPPED.get(cp);\r\n\t\t\t\tif (cps) {\r\n\t\t\t\t\ttokens.push({type: TY_MAPPED, cp, cps: cps.slice()});\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttokens.push({type: TY_DISALLOWED, cp});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (nf) {\r\n\t\tfor (let i = 0, start = -1; i < tokens.length; i++) {\r\n\t\t\tlet token = tokens[i];\r\n\t\t\tif (is_valid_or_mapped(token.type)) {\r\n\t\t\t\tif (requires_check(token.cps)) { // normalization might be needed\r\n\t\t\t\t\tlet end = i + 1;\r\n\t\t\t\t\tfor (let pos = end; pos < tokens.length; pos++) { // find adjacent text\r\n\t\t\t\t\t\tlet {type, cps} = tokens[pos];\r\n\t\t\t\t\t\tif (is_valid_or_mapped(type)) {\r\n\t\t\t\t\t\t\tif (!requires_check(cps)) break;\r\n\t\t\t\t\t\t\tend = pos + 1;\r\n\t\t\t\t\t\t} else if (type !== TY_IGNORED) { // || type !== TY_DISALLOWED) { \r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (start < 0) start = i;\r\n\t\t\t\t\tlet slice = tokens.slice(start, end);\r\n\t\t\t\t\tlet cps0 = slice.flatMap(x => is_valid_or_mapped(x.type) ? x.cps : []); // strip junk tokens\r\n\t\t\t\t\tlet cps = nfc(cps0);\r\n\t\t\t\t\tif (compare_arrays(cps, cps0)) { // bundle into an nfc token\r\n\t\t\t\t\t\ttokens.splice(start, end - start, {\r\n\t\t\t\t\t\t\ttype: TY_NFC, \r\n\t\t\t\t\t\t\tinput: cps0, // there are 3 states: tokens0 ==(process)=> input ==(nfc)=> tokens/cps\r\n\t\t\t\t\t\t\tcps, \r\n\t\t\t\t\t\t\ttokens0: collapse_valid_tokens(slice),\r\n\t\t\t\t\t\t\ttokens: ens_tokenize(str_from_cps(cps), {nf: false})\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\ti = start;\r\n\t\t\t\t\t} else { \r\n\t\t\t\t\t\ti = end - 1; // skip to end of slice\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstart = -1; // reset\r\n\t\t\t\t} else {\r\n\t\t\t\t\tstart = i; // remember last\r\n\t\t\t\t}\r\n\t\t\t} else if (token.type !== TY_IGNORED) { // 20221024: is this correct?\r\n\t\t\t\tstart = -1; // reset\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn collapse_valid_tokens(tokens);\r\n}\r\n\r\nfunction is_valid_or_mapped(type) {\r\n\treturn type == TY_VALID || type == TY_MAPPED;\r\n}\r\n\r\nfunction requires_check(cps) {\r\n\treturn cps.some(cp => NFC_CHECK.has(cp));\r\n}\r\n\r\nfunction collapse_valid_tokens(tokens) {\r\n\tfor (let i = 0; i < tokens.length; i++) {\r\n\t\tif (tokens[i].type == TY_VALID) {\r\n\t\t\tlet j = i + 1;\r\n\t\t\twhile (j < tokens.length && tokens[j].type == TY_VALID) j++;\r\n\t\t\ttokens.splice(i, j - i, {type: TY_VALID, cps: tokens.slice(i, j).flatMap(x => x.cps)});\r\n\t\t}\r\n\t}\r\n\treturn tokens;\r\n}\n\nexport { ens_beautify, ens_emoji, ens_normalize, ens_normalize_fragment, ens_split, ens_tokenize, is_combining_mark, nfc, nfd, safe_str_from_cps, should_escape };\n","import { keccak256 } from \"../crypto/index.js\";\nimport { concat, hexlify, assertArgument, toUtf8Bytes } from \"../utils/index.js\";\nimport { ens_normalize } from \"@adraffy/ens-normalize\";\nconst Zeros = new Uint8Array(32);\nZeros.fill(0);\nfunction checkComponent(comp) {\n assertArgument(comp.length !== 0, \"invalid ENS name; empty component\", \"comp\", comp);\n return comp;\n}\nfunction ensNameSplit(name) {\n const bytes = toUtf8Bytes(ensNormalize(name));\n const comps = [];\n if (name.length === 0) {\n return comps;\n }\n let last = 0;\n for (let i = 0; i < bytes.length; i++) {\n const d = bytes[i];\n // A separator (i.e. \".\"); copy this component\n if (d === 0x2e) {\n comps.push(checkComponent(bytes.slice(last, i)));\n last = i + 1;\n }\n }\n // There was a stray separator at the end of the name\n assertArgument(last < bytes.length, \"invalid ENS name; empty component\", \"name\", name);\n comps.push(checkComponent(bytes.slice(last)));\n return comps;\n}\n/**\n * Returns the ENS %%name%% normalized.\n */\nexport function ensNormalize(name) {\n try {\n if (name.length === 0) {\n throw new Error(\"empty label\");\n }\n return ens_normalize(name);\n }\n catch (error) {\n assertArgument(false, `invalid ENS name (${error.message})`, \"name\", name);\n }\n}\n/**\n * Returns ``true`` if %%name%% is a valid ENS name.\n */\nexport function isValidName(name) {\n try {\n return (ensNameSplit(name).length !== 0);\n }\n catch (error) { }\n return false;\n}\n/**\n * Returns the [[link-namehash]] for %%name%%.\n */\nexport function namehash(name) {\n assertArgument(typeof (name) === \"string\", \"invalid ENS name; not a string\", \"name\", name);\n assertArgument(name.length, `invalid ENS name (empty label)`, \"name\", name);\n let result = Zeros;\n const comps = ensNameSplit(name);\n while (comps.length) {\n result = keccak256(concat([result, keccak256((comps.pop()))]));\n }\n return hexlify(result);\n}\n/**\n * Returns the DNS encoded %%name%%.\n *\n * This is used for various parts of ENS name resolution, such\n * as the wildcard resolution.\n */\nexport function dnsEncode(name, _maxLength) {\n const length = (_maxLength != null) ? _maxLength : 63;\n assertArgument(length <= 255, \"DNS encoded label cannot exceed 255\", \"length\", length);\n return hexlify(concat(ensNameSplit(name).map((comp) => {\n assertArgument(comp.length <= length, `label ${JSON.stringify(name)} exceeds ${length} bytes`, \"name\", name);\n const bytes = new Uint8Array(comp.length + 1);\n bytes.set(comp, 1);\n bytes[0] = bytes.length - 1;\n return bytes;\n }))) + \"00\";\n}\n//# sourceMappingURL=namehash.js.map","import { keccak256 } from \"../crypto/index.js\";\nimport { MessagePrefix } from \"../constants/index.js\";\nimport { recoverAddress } from \"../transaction/index.js\";\nimport { concat, toUtf8Bytes } from \"../utils/index.js\";\n/**\n * Computes the [[link-eip-191]] personal-sign message digest to sign.\n *\n * This prefixes the message with [[MessagePrefix]] and the decimal length\n * of %%message%% and computes the [[keccak256]] digest.\n *\n * If %%message%% is a string, it is converted to its UTF-8 bytes\n * first. To compute the digest of a [[DataHexString]], it must be converted\n * to [bytes](getBytes).\n *\n * @example:\n * hashMessage(\"Hello World\")\n * //_result:\n *\n * // Hashes the SIX (6) string characters, i.e.\n * // [ \"0\", \"x\", \"4\", \"2\", \"4\", \"3\" ]\n * hashMessage(\"0x4243\")\n * //_result:\n *\n * // Hashes the TWO (2) bytes [ 0x42, 0x43 ]...\n * hashMessage(getBytes(\"0x4243\"))\n * //_result:\n *\n * // ...which is equal to using data\n * hashMessage(new Uint8Array([ 0x42, 0x43 ]))\n * //_result:\n *\n */\nexport function hashMessage(message) {\n if (typeof (message) === \"string\") {\n message = toUtf8Bytes(message);\n }\n return keccak256(concat([\n toUtf8Bytes(MessagePrefix),\n toUtf8Bytes(String(message.length)),\n message\n ]));\n}\n/**\n * Return the address of the private key that produced\n * the signature %%sig%% during signing for %%message%%.\n */\nexport function verifyMessage(message, sig) {\n const digest = hashMessage(message);\n return recoverAddress(digest, sig);\n}\n//# sourceMappingURL=message.js.map","import { getAddress } from \"../address/index.js\";\nimport { keccak256 as _keccak256, sha256 as _sha256 } from \"../crypto/index.js\";\nimport { concat, dataLength, getBytes, hexlify, toBeArray, toTwos, toUtf8Bytes, zeroPadBytes, zeroPadValue, assertArgument } from \"../utils/index.js\";\nconst regexBytes = new RegExp(\"^bytes([0-9]+)$\");\nconst regexNumber = new RegExp(\"^(u?int)([0-9]*)$\");\nconst regexArray = new RegExp(\"^(.*)\\\\[([0-9]*)\\\\]$\");\nfunction _pack(type, value, isArray) {\n switch (type) {\n case \"address\":\n if (isArray) {\n return getBytes(zeroPadValue(value, 32));\n }\n return getBytes(getAddress(value));\n case \"string\":\n return toUtf8Bytes(value);\n case \"bytes\":\n return getBytes(value);\n case \"bool\":\n value = (!!value ? \"0x01\" : \"0x00\");\n if (isArray) {\n return getBytes(zeroPadValue(value, 32));\n }\n return getBytes(value);\n }\n let match = type.match(regexNumber);\n if (match) {\n let signed = (match[1] === \"int\");\n let size = parseInt(match[2] || \"256\");\n assertArgument((!match[2] || match[2] === String(size)) && (size % 8 === 0) && size !== 0 && size <= 256, \"invalid number type\", \"type\", type);\n if (isArray) {\n size = 256;\n }\n if (signed) {\n value = toTwos(value, size);\n }\n return getBytes(zeroPadValue(toBeArray(value), size / 8));\n }\n match = type.match(regexBytes);\n if (match) {\n const size = parseInt(match[1]);\n assertArgument(String(size) === match[1] && size !== 0 && size <= 32, \"invalid bytes type\", \"type\", type);\n assertArgument(dataLength(value) === size, `invalid value for ${type}`, \"value\", value);\n if (isArray) {\n return getBytes(zeroPadBytes(value, 32));\n }\n return value;\n }\n match = type.match(regexArray);\n if (match && Array.isArray(value)) {\n const baseType = match[1];\n const count = parseInt(match[2] || String(value.length));\n assertArgument(count === value.length, `invalid array length for ${type}`, \"value\", value);\n const result = [];\n value.forEach(function (value) {\n result.push(_pack(baseType, value, true));\n });\n return getBytes(concat(result));\n }\n assertArgument(false, \"invalid type\", \"type\", type);\n}\n// @TODO: Array Enum\n/**\n * Computes the [[link-solc-packed]] representation of %%values%%\n * respectively to their %%types%%.\n *\n * @example:\n * addr = \"0x8ba1f109551bd432803012645ac136ddd64dba72\"\n * solidityPacked([ \"address\", \"uint\" ], [ addr, 45 ]);\n * //_result:\n */\nexport function solidityPacked(types, values) {\n assertArgument(types.length === values.length, \"wrong number of values; expected ${ types.length }\", \"values\", values);\n const tight = [];\n types.forEach(function (type, index) {\n tight.push(_pack(type, values[index]));\n });\n return hexlify(concat(tight));\n}\n/**\n * Computes the [[link-solc-packed]] [[keccak256]] hash of %%values%%\n * respectively to their %%types%%.\n *\n * @example:\n * addr = \"0x8ba1f109551bd432803012645ac136ddd64dba72\"\n * solidityPackedKeccak256([ \"address\", \"uint\" ], [ addr, 45 ]);\n * //_result:\n */\nexport function solidityPackedKeccak256(types, values) {\n return _keccak256(solidityPacked(types, values));\n}\n/**\n * Computes the [[link-solc-packed]] [[sha256]] hash of %%values%%\n * respectively to their %%types%%.\n *\n * @example:\n * addr = \"0x8ba1f109551bd432803012645ac136ddd64dba72\"\n * solidityPackedSha256([ \"address\", \"uint\" ], [ addr, 45 ]);\n * //_result:\n */\nexport function solidityPackedSha256(types, values) {\n return _sha256(solidityPacked(types, values));\n}\n//# sourceMappingURL=solidity.js.map","//import { TypedDataDomain, TypedDataField } from \"@ethersproject/providerabstract-signer\";\nimport { getAddress } from \"../address/index.js\";\nimport { keccak256 } from \"../crypto/index.js\";\nimport { recoverAddress } from \"../transaction/index.js\";\nimport { concat, defineProperties, getBigInt, getBytes, hexlify, isHexString, mask, toBeHex, toQuantity, toTwos, zeroPadValue, assertArgument } from \"../utils/index.js\";\nimport { id } from \"./id.js\";\nconst padding = new Uint8Array(32);\npadding.fill(0);\nconst BN__1 = BigInt(-1);\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_MAX_UINT256 = BigInt(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\n;\n;\nfunction hexPadRight(value) {\n const bytes = getBytes(value);\n const padOffset = bytes.length % 32;\n if (padOffset) {\n return concat([bytes, padding.slice(padOffset)]);\n }\n return hexlify(bytes);\n}\nconst hexTrue = toBeHex(BN_1, 32);\nconst hexFalse = toBeHex(BN_0, 32);\nconst domainFieldTypes = {\n name: \"string\",\n version: \"string\",\n chainId: \"uint256\",\n verifyingContract: \"address\",\n salt: \"bytes32\"\n};\nconst domainFieldNames = [\n \"name\", \"version\", \"chainId\", \"verifyingContract\", \"salt\"\n];\nfunction checkString(key) {\n return function (value) {\n assertArgument(typeof (value) === \"string\", `invalid domain value for ${JSON.stringify(key)}`, `domain.${key}`, value);\n return value;\n };\n}\nconst domainChecks = {\n name: checkString(\"name\"),\n version: checkString(\"version\"),\n chainId: function (_value) {\n const value = getBigInt(_value, \"domain.chainId\");\n assertArgument(value >= 0, \"invalid chain ID\", \"domain.chainId\", _value);\n if (Number.isSafeInteger(value)) {\n return Number(value);\n }\n return toQuantity(value);\n },\n verifyingContract: function (value) {\n try {\n return getAddress(value).toLowerCase();\n }\n catch (error) { }\n assertArgument(false, `invalid domain value \"verifyingContract\"`, \"domain.verifyingContract\", value);\n },\n salt: function (value) {\n const bytes = getBytes(value, \"domain.salt\");\n assertArgument(bytes.length === 32, `invalid domain value \"salt\"`, \"domain.salt\", value);\n return hexlify(bytes);\n }\n};\nfunction getBaseEncoder(type) {\n // intXX and uintXX\n {\n const match = type.match(/^(u?)int(\\d+)$/);\n if (match) {\n const signed = (match[1] === \"\");\n const width = parseInt(match[2]);\n assertArgument(width % 8 === 0 && width !== 0 && width <= 256 && match[2] === String(width), \"invalid numeric width\", \"type\", type);\n const boundsUpper = mask(BN_MAX_UINT256, signed ? (width - 1) : width);\n const boundsLower = signed ? ((boundsUpper + BN_1) * BN__1) : BN_0;\n return function (_value) {\n const value = getBigInt(_value, \"value\");\n assertArgument(value >= boundsLower && value <= boundsUpper, `value out-of-bounds for ${type}`, \"value\", value);\n return toBeHex(signed ? toTwos(value, 256) : value, 32);\n };\n }\n }\n // bytesXX\n {\n const match = type.match(/^bytes(\\d+)$/);\n if (match) {\n const width = parseInt(match[1]);\n assertArgument(width !== 0 && width <= 32 && match[1] === String(width), \"invalid bytes width\", \"type\", type);\n return function (value) {\n const bytes = getBytes(value);\n assertArgument(bytes.length === width, `invalid length for ${type}`, \"value\", value);\n return hexPadRight(value);\n };\n }\n }\n switch (type) {\n case \"address\": return function (value) {\n return zeroPadValue(getAddress(value), 32);\n };\n case \"bool\": return function (value) {\n return ((!value) ? hexFalse : hexTrue);\n };\n case \"bytes\": return function (value) {\n return keccak256(value);\n };\n case \"string\": return function (value) {\n return id(value);\n };\n }\n return null;\n}\nfunction encodeType(name, fields) {\n return `${name}(${fields.map(({ name, type }) => (type + \" \" + name)).join(\",\")})`;\n}\n// foo[][3] => { base: \"foo\", index: \"[][3]\", array: {\n// base: \"foo\", prefix: \"foo[]\", count: 3 } }\nfunction splitArray(type) {\n const match = type.match(/^([^\\x5b]*)((\\x5b\\d*\\x5d)*)(\\x5b(\\d*)\\x5d)$/);\n if (match) {\n return {\n base: match[1],\n index: (match[2] + match[4]),\n array: {\n base: match[1],\n prefix: (match[1] + match[2]),\n count: (match[5] ? parseInt(match[5]) : -1),\n }\n };\n }\n return { base: type };\n}\n/**\n * A **TypedDataEncode** prepares and encodes [[link-eip-712]] payloads\n * for signed typed data.\n *\n * This is useful for those that wish to compute various components of a\n * typed data hash, primary types, or sub-components, but generally the\n * higher level [[Signer-signTypedData]] is more useful.\n */\nexport class TypedDataEncoder {\n /**\n * The primary type for the structured [[types]].\n *\n * This is derived automatically from the [[types]], since no\n * recursion is possible, once the DAG for the types is consturcted\n * internally, the primary type must be the only remaining type with\n * no parent nodes.\n */\n primaryType;\n #types;\n /**\n * The types.\n */\n get types() {\n return JSON.parse(this.#types);\n }\n #fullTypes;\n #encoderCache;\n /**\n * Create a new **TypedDataEncoder** for %%types%%.\n *\n * This performs all necessary checking that types are valid and\n * do not violate the [[link-eip-712]] structural constraints as\n * well as computes the [[primaryType]].\n */\n constructor(_types) {\n this.#fullTypes = new Map();\n this.#encoderCache = new Map();\n // Link struct types to their direct child structs\n const links = new Map();\n // Link structs to structs which contain them as a child\n const parents = new Map();\n // Link all subtypes within a given struct\n const subtypes = new Map();\n const types = {};\n Object.keys(_types).forEach((type) => {\n types[type] = _types[type].map(({ name, type }) => {\n // Normalize the base type (unless name conflict)\n let { base, index } = splitArray(type);\n if (base === \"int\" && !_types[\"int\"]) {\n base = \"int256\";\n }\n if (base === \"uint\" && !_types[\"uint\"]) {\n base = \"uint256\";\n }\n return { name, type: (base + (index || \"\")) };\n });\n links.set(type, new Set());\n parents.set(type, []);\n subtypes.set(type, new Set());\n });\n this.#types = JSON.stringify(types);\n for (const name in types) {\n const uniqueNames = new Set();\n for (const field of types[name]) {\n // Check each field has a unique name\n assertArgument(!uniqueNames.has(field.name), `duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`, \"types\", _types);\n uniqueNames.add(field.name);\n // Get the base type (drop any array specifiers)\n const baseType = splitArray(field.type).base;\n assertArgument(baseType !== name, `circular type reference to ${JSON.stringify(baseType)}`, \"types\", _types);\n // Is this a base encoding type?\n const encoder = getBaseEncoder(baseType);\n if (encoder) {\n continue;\n }\n assertArgument(parents.has(baseType), `unknown type ${JSON.stringify(baseType)}`, \"types\", _types);\n // Add linkage\n parents.get(baseType).push(name);\n links.get(name).add(baseType);\n }\n }\n // Deduce the primary type\n const primaryTypes = Array.from(parents.keys()).filter((n) => (parents.get(n).length === 0));\n assertArgument(primaryTypes.length !== 0, \"missing primary type\", \"types\", _types);\n assertArgument(primaryTypes.length === 1, `ambiguous primary types or unused types: ${primaryTypes.map((t) => (JSON.stringify(t))).join(\", \")}`, \"types\", _types);\n defineProperties(this, { primaryType: primaryTypes[0] });\n // Check for circular type references\n function checkCircular(type, found) {\n assertArgument(!found.has(type), `circular type reference to ${JSON.stringify(type)}`, \"types\", _types);\n found.add(type);\n for (const child of links.get(type)) {\n if (!parents.has(child)) {\n continue;\n }\n // Recursively check children\n checkCircular(child, found);\n // Mark all ancestors as having this decendant\n for (const subtype of found) {\n subtypes.get(subtype).add(child);\n }\n }\n found.delete(type);\n }\n checkCircular(this.primaryType, new Set());\n // Compute each fully describe type\n for (const [name, set] of subtypes) {\n const st = Array.from(set);\n st.sort();\n this.#fullTypes.set(name, encodeType(name, types[name]) + st.map((t) => encodeType(t, types[t])).join(\"\"));\n }\n }\n /**\n * Returnthe encoder for the specific %%type%%.\n */\n getEncoder(type) {\n let encoder = this.#encoderCache.get(type);\n if (!encoder) {\n encoder = this.#getEncoder(type);\n this.#encoderCache.set(type, encoder);\n }\n return encoder;\n }\n #getEncoder(type) {\n // Basic encoder type (address, bool, uint256, etc)\n {\n const encoder = getBaseEncoder(type);\n if (encoder) {\n return encoder;\n }\n }\n // Array\n const array = splitArray(type).array;\n if (array) {\n const subtype = array.prefix;\n const subEncoder = this.getEncoder(subtype);\n return (value) => {\n assertArgument(array.count === -1 || array.count === value.length, `array length mismatch; expected length ${array.count}`, \"value\", value);\n let result = value.map(subEncoder);\n if (this.#fullTypes.has(subtype)) {\n result = result.map(keccak256);\n }\n return keccak256(concat(result));\n };\n }\n // Struct\n const fields = this.types[type];\n if (fields) {\n const encodedType = id(this.#fullTypes.get(type));\n return (value) => {\n const values = fields.map(({ name, type }) => {\n const result = this.getEncoder(type)(value[name]);\n if (this.#fullTypes.has(type)) {\n return keccak256(result);\n }\n return result;\n });\n values.unshift(encodedType);\n return concat(values);\n };\n }\n assertArgument(false, `unknown type: ${type}`, \"type\", type);\n }\n /**\n * Return the full type for %%name%%.\n */\n encodeType(name) {\n const result = this.#fullTypes.get(name);\n assertArgument(result, `unknown type: ${JSON.stringify(name)}`, \"name\", name);\n return result;\n }\n /**\n * Return the encoded %%value%% for the %%type%%.\n */\n encodeData(type, value) {\n return this.getEncoder(type)(value);\n }\n /**\n * Returns the hash of %%value%% for the type of %%name%%.\n */\n hashStruct(name, value) {\n return keccak256(this.encodeData(name, value));\n }\n /**\n * Return the fulled encoded %%value%% for the [[types]].\n */\n encode(value) {\n return this.encodeData(this.primaryType, value);\n }\n /**\n * Return the hash of the fully encoded %%value%% for the [[types]].\n */\n hash(value) {\n return this.hashStruct(this.primaryType, value);\n }\n /**\n * @_ignore:\n */\n _visit(type, value, callback) {\n // Basic encoder type (address, bool, uint256, etc)\n {\n const encoder = getBaseEncoder(type);\n if (encoder) {\n return callback(type, value);\n }\n }\n // Array\n const array = splitArray(type).array;\n if (array) {\n assertArgument(array.count === -1 || array.count === value.length, `array length mismatch; expected length ${array.count}`, \"value\", value);\n return value.map((v) => this._visit(array.prefix, v, callback));\n }\n // Struct\n const fields = this.types[type];\n if (fields) {\n return fields.reduce((accum, { name, type }) => {\n accum[name] = this._visit(type, value[name], callback);\n return accum;\n }, {});\n }\n assertArgument(false, `unknown type: ${type}`, \"type\", type);\n }\n /**\n * Call %%calback%% for each value in %%value%%, passing the type and\n * component within %%value%%.\n *\n * This is useful for replacing addresses or other transformation that\n * may be desired on each component, based on its type.\n */\n visit(value, callback) {\n return this._visit(this.primaryType, value, callback);\n }\n /**\n * Create a new **TypedDataEncoder** for %%types%%.\n */\n static from(types) {\n return new TypedDataEncoder(types);\n }\n /**\n * Return the primary type for %%types%%.\n */\n static getPrimaryType(types) {\n return TypedDataEncoder.from(types).primaryType;\n }\n /**\n * Return the hashed struct for %%value%% using %%types%% and %%name%%.\n */\n static hashStruct(name, types, value) {\n return TypedDataEncoder.from(types).hashStruct(name, value);\n }\n /**\n * Return the domain hash for %%domain%%.\n */\n static hashDomain(domain) {\n const domainFields = [];\n for (const name in domain) {\n if (domain[name] == null) {\n continue;\n }\n const type = domainFieldTypes[name];\n assertArgument(type, `invalid typed-data domain key: ${JSON.stringify(name)}`, \"domain\", domain);\n domainFields.push({ name, type });\n }\n domainFields.sort((a, b) => {\n return domainFieldNames.indexOf(a.name) - domainFieldNames.indexOf(b.name);\n });\n return TypedDataEncoder.hashStruct(\"EIP712Domain\", { EIP712Domain: domainFields }, domain);\n }\n /**\n * Return the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%.\n */\n static encode(domain, types, value) {\n return concat([\n \"0x1901\",\n TypedDataEncoder.hashDomain(domain),\n TypedDataEncoder.from(types).hash(value)\n ]);\n }\n /**\n * Return the hash of the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%.\n */\n static hash(domain, types, value) {\n return keccak256(TypedDataEncoder.encode(domain, types, value));\n }\n // Replaces all address types with ENS names with their looked up address\n /**\n * Resolves to the value from resolving all addresses in %%value%% for\n * %%types%% and the %%domain%%.\n */\n static async resolveNames(domain, types, value, resolveName) {\n // Make a copy to isolate it from the object passed in\n domain = Object.assign({}, domain);\n // Allow passing null to ignore value\n for (const key in domain) {\n if (domain[key] == null) {\n delete domain[key];\n }\n }\n // Look up all ENS names\n const ensCache = {};\n // Do we need to look up the domain's verifyingContract?\n if (domain.verifyingContract && !isHexString(domain.verifyingContract, 20)) {\n ensCache[domain.verifyingContract] = \"0x\";\n }\n // We are going to use the encoder to visit all the base values\n const encoder = TypedDataEncoder.from(types);\n // Get a list of all the addresses\n encoder.visit(value, (type, value) => {\n if (type === \"address\" && !isHexString(value, 20)) {\n ensCache[value] = \"0x\";\n }\n return value;\n });\n // Lookup each name\n for (const name in ensCache) {\n ensCache[name] = await resolveName(name);\n }\n // Replace the domain verifyingContract if needed\n if (domain.verifyingContract && ensCache[domain.verifyingContract]) {\n domain.verifyingContract = ensCache[domain.verifyingContract];\n }\n // Replace all ENS names with their address\n value = encoder.visit(value, (type, value) => {\n if (type === \"address\" && ensCache[value]) {\n return ensCache[value];\n }\n return value;\n });\n return { domain, value };\n }\n /**\n * Returns the JSON-encoded payload expected by nodes which implement\n * the JSON-RPC [[link-eip-712]] method.\n */\n static getPayload(domain, types, value) {\n // Validate the domain fields\n TypedDataEncoder.hashDomain(domain);\n // Derive the EIP712Domain Struct reference type\n const domainValues = {};\n const domainTypes = [];\n domainFieldNames.forEach((name) => {\n const value = domain[name];\n if (value == null) {\n return;\n }\n domainValues[name] = domainChecks[name](value);\n domainTypes.push({ name, type: domainFieldTypes[name] });\n });\n const encoder = TypedDataEncoder.from(types);\n // Get the normalized types\n types = encoder.types;\n const typesWithDomain = Object.assign({}, types);\n assertArgument(typesWithDomain.EIP712Domain == null, \"types must not contain EIP712Domain type\", \"types.EIP712Domain\", types);\n typesWithDomain.EIP712Domain = domainTypes;\n // Validate the data structures and types\n encoder.encode(value);\n return {\n types: typesWithDomain,\n domain: domainValues,\n primaryType: encoder.primaryType,\n message: encoder.visit(value, (type, value) => {\n // bytes\n if (type.match(/^bytes(\\d*)/)) {\n return hexlify(getBytes(value));\n }\n // uint or int\n if (type.match(/^u?int/)) {\n return getBigInt(value).toString();\n }\n switch (type) {\n case \"address\":\n return value.toLowerCase();\n case \"bool\":\n return !!value;\n case \"string\":\n assertArgument(typeof (value) === \"string\", \"invalid string\", \"value\", value);\n return value;\n }\n assertArgument(false, \"unsupported type\", \"type\", type);\n })\n };\n }\n}\n/**\n * Compute the address used to sign the typed data for the %%signature%%.\n */\nexport function verifyTypedData(domain, types, value, signature) {\n return recoverAddress(TypedDataEncoder.hash(domain, types, value), signature);\n}\n//# sourceMappingURL=typed-data.js.map","/**\n * A fragment is a single item from an ABI, which may represent any of:\n *\n * - [Functions](FunctionFragment)\n * - [Events](EventFragment)\n * - [Constructors](ConstructorFragment)\n * - Custom [Errors](ErrorFragment)\n * - [Fallback or Receive](FallbackFragment) functions\n *\n * @_subsection api/abi/abi-coder:Fragments [about-fragments]\n */\nimport { defineProperties, getBigInt, getNumber, assert, assertPrivate, assertArgument } from \"../utils/index.js\";\nimport { id } from \"../hash/index.js\";\n;\n// [ \"a\", \"b\" ] => { \"a\": 1, \"b\": 1 }\nfunction setify(items) {\n const result = new Set();\n items.forEach((k) => result.add(k));\n return Object.freeze(result);\n}\nconst _kwVisibDeploy = \"external public payable override\";\nconst KwVisibDeploy = setify(_kwVisibDeploy.split(\" \"));\n// Visibility Keywords\nconst _kwVisib = \"constant external internal payable private public pure view override\";\nconst KwVisib = setify(_kwVisib.split(\" \"));\nconst _kwTypes = \"constructor error event fallback function receive struct\";\nconst KwTypes = setify(_kwTypes.split(\" \"));\nconst _kwModifiers = \"calldata memory storage payable indexed\";\nconst KwModifiers = setify(_kwModifiers.split(\" \"));\nconst _kwOther = \"tuple returns\";\n// All Keywords\nconst _keywords = [_kwTypes, _kwModifiers, _kwOther, _kwVisib].join(\" \");\nconst Keywords = setify(_keywords.split(\" \"));\n// Single character tokens\nconst SimpleTokens = {\n \"(\": \"OPEN_PAREN\", \")\": \"CLOSE_PAREN\",\n \"[\": \"OPEN_BRACKET\", \"]\": \"CLOSE_BRACKET\",\n \",\": \"COMMA\", \"@\": \"AT\"\n};\n// Parser regexes to consume the next token\nconst regexWhitespacePrefix = new RegExp(\"^(\\\\s*)\");\nconst regexNumberPrefix = new RegExp(\"^([0-9]+)\");\nconst regexIdPrefix = new RegExp(\"^([a-zA-Z$_][a-zA-Z0-9$_]*)\");\n// Parser regexs to check validity\nconst regexId = new RegExp(\"^([a-zA-Z$_][a-zA-Z0-9$_]*)$\");\nconst regexType = new RegExp(\"^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$\");\nclass TokenString {\n #offset;\n #tokens;\n get offset() { return this.#offset; }\n get length() { return this.#tokens.length - this.#offset; }\n constructor(tokens) {\n this.#offset = 0;\n this.#tokens = tokens.slice();\n }\n clone() { return new TokenString(this.#tokens); }\n reset() { this.#offset = 0; }\n #subTokenString(from = 0, to = 0) {\n return new TokenString(this.#tokens.slice(from, to).map((t) => {\n return Object.freeze(Object.assign({}, t, {\n match: (t.match - from),\n linkBack: (t.linkBack - from),\n linkNext: (t.linkNext - from),\n }));\n }));\n }\n // Pops and returns the value of the next token, if it is a keyword in allowed; throws if out of tokens\n popKeyword(allowed) {\n const top = this.peek();\n if (top.type !== \"KEYWORD\" || !allowed.has(top.text)) {\n throw new Error(`expected keyword ${top.text}`);\n }\n return this.pop().text;\n }\n // Pops and returns the value of the next token if it is `type`; throws if out of tokens\n popType(type) {\n if (this.peek().type !== type) {\n const top = this.peek();\n throw new Error(`expected ${type}; got ${top.type} ${JSON.stringify(top.text)}`);\n }\n return this.pop().text;\n }\n // Pops and returns a \"(\" TOKENS \")\"\n popParen() {\n const top = this.peek();\n if (top.type !== \"OPEN_PAREN\") {\n throw new Error(\"bad start\");\n }\n const result = this.#subTokenString(this.#offset + 1, top.match + 1);\n this.#offset = top.match + 1;\n return result;\n }\n // Pops and returns the items within \"(\" ITEM1 \",\" ITEM2 \",\" ... \")\"\n popParams() {\n const top = this.peek();\n if (top.type !== \"OPEN_PAREN\") {\n throw new Error(\"bad start\");\n }\n const result = [];\n while (this.#offset < top.match - 1) {\n const link = this.peek().linkNext;\n result.push(this.#subTokenString(this.#offset + 1, link));\n this.#offset = link;\n }\n this.#offset = top.match + 1;\n return result;\n }\n // Returns the top Token, throwing if out of tokens\n peek() {\n if (this.#offset >= this.#tokens.length) {\n throw new Error(\"out-of-bounds\");\n }\n return this.#tokens[this.#offset];\n }\n // Returns the next value, if it is a keyword in `allowed`\n peekKeyword(allowed) {\n const top = this.peekType(\"KEYWORD\");\n return (top != null && allowed.has(top)) ? top : null;\n }\n // Returns the value of the next token if it is `type`\n peekType(type) {\n if (this.length === 0) {\n return null;\n }\n const top = this.peek();\n return (top.type === type) ? top.text : null;\n }\n // Returns the next token; throws if out of tokens\n pop() {\n const result = this.peek();\n this.#offset++;\n return result;\n }\n toString() {\n const tokens = [];\n for (let i = this.#offset; i < this.#tokens.length; i++) {\n const token = this.#tokens[i];\n tokens.push(`${token.type}:${token.text}`);\n }\n return ``;\n }\n}\nfunction lex(text) {\n const tokens = [];\n const throwError = (message) => {\n const token = (offset < text.length) ? JSON.stringify(text[offset]) : \"$EOI\";\n throw new Error(`invalid token ${token} at ${offset}: ${message}`);\n };\n let brackets = [];\n let commas = [];\n let offset = 0;\n while (offset < text.length) {\n // Strip off any leading whitespace\n let cur = text.substring(offset);\n let match = cur.match(regexWhitespacePrefix);\n if (match) {\n offset += match[1].length;\n cur = text.substring(offset);\n }\n const token = { depth: brackets.length, linkBack: -1, linkNext: -1, match: -1, type: \"\", text: \"\", offset, value: -1 };\n tokens.push(token);\n let type = (SimpleTokens[cur[0]] || \"\");\n if (type) {\n token.type = type;\n token.text = cur[0];\n offset++;\n if (type === \"OPEN_PAREN\") {\n brackets.push(tokens.length - 1);\n commas.push(tokens.length - 1);\n }\n else if (type == \"CLOSE_PAREN\") {\n if (brackets.length === 0) {\n throwError(\"no matching open bracket\");\n }\n token.match = brackets.pop();\n (tokens[token.match]).match = tokens.length - 1;\n token.depth--;\n token.linkBack = commas.pop();\n (tokens[token.linkBack]).linkNext = tokens.length - 1;\n }\n else if (type === \"COMMA\") {\n token.linkBack = commas.pop();\n (tokens[token.linkBack]).linkNext = tokens.length - 1;\n commas.push(tokens.length - 1);\n }\n else if (type === \"OPEN_BRACKET\") {\n token.type = \"BRACKET\";\n }\n else if (type === \"CLOSE_BRACKET\") {\n // Remove the CLOSE_BRACKET\n let suffix = tokens.pop().text;\n if (tokens.length > 0 && tokens[tokens.length - 1].type === \"NUMBER\") {\n const value = tokens.pop().text;\n suffix = value + suffix;\n (tokens[tokens.length - 1]).value = getNumber(value);\n }\n if (tokens.length === 0 || tokens[tokens.length - 1].type !== \"BRACKET\") {\n throw new Error(\"missing opening bracket\");\n }\n (tokens[tokens.length - 1]).text += suffix;\n }\n continue;\n }\n match = cur.match(regexIdPrefix);\n if (match) {\n token.text = match[1];\n offset += token.text.length;\n if (Keywords.has(token.text)) {\n token.type = \"KEYWORD\";\n continue;\n }\n if (token.text.match(regexType)) {\n token.type = \"TYPE\";\n continue;\n }\n token.type = \"ID\";\n continue;\n }\n match = cur.match(regexNumberPrefix);\n if (match) {\n token.text = match[1];\n token.type = \"NUMBER\";\n offset += token.text.length;\n continue;\n }\n throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset}`);\n }\n return new TokenString(tokens.map((t) => Object.freeze(t)));\n}\n// Check only one of `allowed` is in `set`\nfunction allowSingle(set, allowed) {\n let included = [];\n for (const key in allowed.keys()) {\n if (set.has(key)) {\n included.push(key);\n }\n }\n if (included.length > 1) {\n throw new Error(`conflicting types: ${included.join(\", \")}`);\n }\n}\n// Functions to process a Solidity Signature TokenString from left-to-right for...\n// ...the name with an optional type, returning the name\nfunction consumeName(type, tokens) {\n if (tokens.peekKeyword(KwTypes)) {\n const keyword = tokens.pop().text;\n if (keyword !== type) {\n throw new Error(`expected ${type}, got ${keyword}`);\n }\n }\n return tokens.popType(\"ID\");\n}\n// ...all keywords matching allowed, returning the keywords\nfunction consumeKeywords(tokens, allowed) {\n const keywords = new Set();\n while (true) {\n const keyword = tokens.peekType(\"KEYWORD\");\n if (keyword == null || (allowed && !allowed.has(keyword))) {\n break;\n }\n tokens.pop();\n if (keywords.has(keyword)) {\n throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`);\n }\n keywords.add(keyword);\n }\n return Object.freeze(keywords);\n}\n// ...all visibility keywords, returning the coalesced mutability\nfunction consumeMutability(tokens) {\n let modifiers = consumeKeywords(tokens, KwVisib);\n // Detect conflicting modifiers\n allowSingle(modifiers, setify(\"constant payable nonpayable\".split(\" \")));\n allowSingle(modifiers, setify(\"pure view payable nonpayable\".split(\" \")));\n // Process mutability states\n if (modifiers.has(\"view\")) {\n return \"view\";\n }\n if (modifiers.has(\"pure\")) {\n return \"pure\";\n }\n if (modifiers.has(\"payable\")) {\n return \"payable\";\n }\n if (modifiers.has(\"nonpayable\")) {\n return \"nonpayable\";\n }\n // Process legacy `constant` last\n if (modifiers.has(\"constant\")) {\n return \"view\";\n }\n return \"nonpayable\";\n}\n// ...a parameter list, returning the ParamType list\nfunction consumeParams(tokens, allowIndexed) {\n return tokens.popParams().map((t) => ParamType.from(t, allowIndexed));\n}\n// ...a gas limit, returning a BigNumber or null if none\nfunction consumeGas(tokens) {\n if (tokens.peekType(\"AT\")) {\n tokens.pop();\n if (tokens.peekType(\"NUMBER\")) {\n return getBigInt(tokens.pop().text);\n }\n throw new Error(\"invalid gas\");\n }\n return null;\n}\nfunction consumeEoi(tokens) {\n if (tokens.length) {\n throw new Error(`unexpected tokens at offset ${tokens.offset}: ${tokens.toString()}`);\n }\n}\nconst regexArrayType = new RegExp(/^(.*)\\[([0-9]*)\\]$/);\nfunction verifyBasicType(type) {\n const match = type.match(regexType);\n assertArgument(match, \"invalid type\", \"type\", type);\n if (type === \"uint\") {\n return \"uint256\";\n }\n if (type === \"int\") {\n return \"int256\";\n }\n if (match[2]) {\n // bytesXX\n const length = parseInt(match[2]);\n assertArgument(length !== 0 && length <= 32, \"invalid bytes length\", \"type\", type);\n }\n else if (match[3]) {\n // intXX or uintXX\n const size = parseInt(match[3]);\n assertArgument(size !== 0 && size <= 256 && (size % 8) === 0, \"invalid numeric width\", \"type\", type);\n }\n return type;\n}\n// Make the Fragment constructors effectively private\nconst _guard = {};\nconst internal = Symbol.for(\"_ethers_internal\");\nconst ParamTypeInternal = \"_ParamTypeInternal\";\nconst ErrorFragmentInternal = \"_ErrorInternal\";\nconst EventFragmentInternal = \"_EventInternal\";\nconst ConstructorFragmentInternal = \"_ConstructorInternal\";\nconst FallbackFragmentInternal = \"_FallbackInternal\";\nconst FunctionFragmentInternal = \"_FunctionInternal\";\nconst StructFragmentInternal = \"_StructInternal\";\n/**\n * Each input and output of a [[Fragment]] is an Array of **ParamType**.\n */\nexport class ParamType {\n /**\n * The local name of the parameter (or ``\"\"`` if unbound)\n */\n name;\n /**\n * The fully qualified type (e.g. ``\"address\"``, ``\"tuple(address)\"``,\n * ``\"uint256[3][]\"``)\n */\n type;\n /**\n * The base type (e.g. ``\"address\"``, ``\"tuple\"``, ``\"array\"``)\n */\n baseType;\n /**\n * True if the parameters is indexed.\n *\n * For non-indexable types this is ``null``.\n */\n indexed;\n /**\n * The components for the tuple.\n *\n * For non-tuple types this is ``null``.\n */\n components;\n /**\n * The array length, or ``-1`` for dynamic-lengthed arrays.\n *\n * For non-array types this is ``null``.\n */\n arrayLength;\n /**\n * The type of each child in the array.\n *\n * For non-array types this is ``null``.\n */\n arrayChildren;\n /**\n * @private\n */\n constructor(guard, name, type, baseType, indexed, components, arrayLength, arrayChildren) {\n assertPrivate(guard, _guard, \"ParamType\");\n Object.defineProperty(this, internal, { value: ParamTypeInternal });\n if (components) {\n components = Object.freeze(components.slice());\n }\n if (baseType === \"array\") {\n if (arrayLength == null || arrayChildren == null) {\n throw new Error(\"\");\n }\n }\n else if (arrayLength != null || arrayChildren != null) {\n throw new Error(\"\");\n }\n if (baseType === \"tuple\") {\n if (components == null) {\n throw new Error(\"\");\n }\n }\n else if (components != null) {\n throw new Error(\"\");\n }\n defineProperties(this, {\n name, type, baseType, indexed, components, arrayLength, arrayChildren\n });\n }\n /**\n * Return a string representation of this type.\n *\n * For example,\n *\n * ``sighash\" => \"(uint256,address)\"``\n *\n * ``\"minimal\" => \"tuple(uint256,address) indexed\"``\n *\n * ``\"full\" => \"tuple(uint256 foo, address bar) indexed baz\"``\n */\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n const name = this.name || \"\";\n if (this.isArray()) {\n const result = JSON.parse(this.arrayChildren.format(\"json\"));\n result.name = name;\n result.type += `[${(this.arrayLength < 0 ? \"\" : String(this.arrayLength))}]`;\n return JSON.stringify(result);\n }\n const result = {\n type: ((this.baseType === \"tuple\") ? \"tuple\" : this.type),\n name\n };\n if (typeof (this.indexed) === \"boolean\") {\n result.indexed = this.indexed;\n }\n if (this.isTuple()) {\n result.components = this.components.map((c) => JSON.parse(c.format(format)));\n }\n return JSON.stringify(result);\n }\n let result = \"\";\n // Array\n if (this.isArray()) {\n result += this.arrayChildren.format(format);\n result += `[${(this.arrayLength < 0 ? \"\" : String(this.arrayLength))}]`;\n }\n else {\n if (this.isTuple()) {\n result += \"(\" + this.components.map((comp) => comp.format(format)).join((format === \"full\") ? \", \" : \",\") + \")\";\n }\n else {\n result += this.type;\n }\n }\n if (format !== \"sighash\") {\n if (this.indexed === true) {\n result += \" indexed\";\n }\n if (format === \"full\" && this.name) {\n result += \" \" + this.name;\n }\n }\n return result;\n }\n /**\n * Returns true if %%this%% is an Array type.\n *\n * This provides a type gaurd ensuring that [[arrayChildren]]\n * and [[arrayLength]] are non-null.\n */\n isArray() {\n return (this.baseType === \"array\");\n }\n /**\n * Returns true if %%this%% is a Tuple type.\n *\n * This provides a type gaurd ensuring that [[components]]\n * is non-null.\n */\n isTuple() {\n return (this.baseType === \"tuple\");\n }\n /**\n * Returns true if %%this%% is an Indexable type.\n *\n * This provides a type gaurd ensuring that [[indexed]]\n * is non-null.\n */\n isIndexable() {\n return (this.indexed != null);\n }\n /**\n * Walks the **ParamType** with %%value%%, calling %%process%%\n * on each type, destructing the %%value%% recursively.\n */\n walk(value, process) {\n if (this.isArray()) {\n if (!Array.isArray(value)) {\n throw new Error(\"invalid array value\");\n }\n if (this.arrayLength !== -1 && value.length !== this.arrayLength) {\n throw new Error(\"array is wrong length\");\n }\n const _this = this;\n return value.map((v) => (_this.arrayChildren.walk(v, process)));\n }\n if (this.isTuple()) {\n if (!Array.isArray(value)) {\n throw new Error(\"invalid tuple value\");\n }\n if (value.length !== this.components.length) {\n throw new Error(\"array is wrong length\");\n }\n const _this = this;\n return value.map((v, i) => (_this.components[i].walk(v, process)));\n }\n return process(this.type, value);\n }\n #walkAsync(promises, value, process, setValue) {\n if (this.isArray()) {\n if (!Array.isArray(value)) {\n throw new Error(\"invalid array value\");\n }\n if (this.arrayLength !== -1 && value.length !== this.arrayLength) {\n throw new Error(\"array is wrong length\");\n }\n const childType = this.arrayChildren;\n const result = value.slice();\n result.forEach((value, index) => {\n childType.#walkAsync(promises, value, process, (value) => {\n result[index] = value;\n });\n });\n setValue(result);\n return;\n }\n if (this.isTuple()) {\n const components = this.components;\n // Convert the object into an array\n let result;\n if (Array.isArray(value)) {\n result = value.slice();\n }\n else {\n if (value == null || typeof (value) !== \"object\") {\n throw new Error(\"invalid tuple value\");\n }\n result = components.map((param) => {\n if (!param.name) {\n throw new Error(\"cannot use object value with unnamed components\");\n }\n if (!(param.name in value)) {\n throw new Error(`missing value for component ${param.name}`);\n }\n return value[param.name];\n });\n }\n if (result.length !== this.components.length) {\n throw new Error(\"array is wrong length\");\n }\n result.forEach((value, index) => {\n components[index].#walkAsync(promises, value, process, (value) => {\n result[index] = value;\n });\n });\n setValue(result);\n return;\n }\n const result = process(this.type, value);\n if (result.then) {\n promises.push((async function () { setValue(await result); })());\n }\n else {\n setValue(result);\n }\n }\n /**\n * Walks the **ParamType** with %%value%%, asynchronously calling\n * %%process%% on each type, destructing the %%value%% recursively.\n *\n * This can be used to resolve ENS names by walking and resolving each\n * ``\"address\"`` type.\n */\n async walkAsync(value, process) {\n const promises = [];\n const result = [value];\n this.#walkAsync(promises, value, process, (value) => {\n result[0] = value;\n });\n if (promises.length) {\n await Promise.all(promises);\n }\n return result[0];\n }\n /**\n * Creates a new **ParamType** for %%obj%%.\n *\n * If %%allowIndexed%% then the ``indexed`` keyword is permitted,\n * otherwise the ``indexed`` keyword will throw an error.\n */\n static from(obj, allowIndexed) {\n if (ParamType.isParamType(obj)) {\n return obj;\n }\n if (typeof (obj) === \"string\") {\n try {\n return ParamType.from(lex(obj), allowIndexed);\n }\n catch (error) {\n assertArgument(false, \"invalid param type\", \"obj\", obj);\n }\n }\n else if (obj instanceof TokenString) {\n let type = \"\", baseType = \"\";\n let comps = null;\n if (consumeKeywords(obj, setify([\"tuple\"])).has(\"tuple\") || obj.peekType(\"OPEN_PAREN\")) {\n // Tuple\n baseType = \"tuple\";\n comps = obj.popParams().map((t) => ParamType.from(t));\n type = `tuple(${comps.map((c) => c.format()).join(\",\")})`;\n }\n else {\n // Normal\n type = verifyBasicType(obj.popType(\"TYPE\"));\n baseType = type;\n }\n // Check for Array\n let arrayChildren = null;\n let arrayLength = null;\n while (obj.length && obj.peekType(\"BRACKET\")) {\n const bracket = obj.pop(); //arrays[i];\n arrayChildren = new ParamType(_guard, \"\", type, baseType, null, comps, arrayLength, arrayChildren);\n arrayLength = bracket.value;\n type += bracket.text;\n baseType = \"array\";\n comps = null;\n }\n let indexed = null;\n const keywords = consumeKeywords(obj, KwModifiers);\n if (keywords.has(\"indexed\")) {\n if (!allowIndexed) {\n throw new Error(\"\");\n }\n indexed = true;\n }\n const name = (obj.peekType(\"ID\") ? obj.pop().text : \"\");\n if (obj.length) {\n throw new Error(\"leftover tokens\");\n }\n return new ParamType(_guard, name, type, baseType, indexed, comps, arrayLength, arrayChildren);\n }\n const name = obj.name;\n assertArgument(!name || (typeof (name) === \"string\" && name.match(regexId)), \"invalid name\", \"obj.name\", name);\n let indexed = obj.indexed;\n if (indexed != null) {\n assertArgument(allowIndexed, \"parameter cannot be indexed\", \"obj.indexed\", obj.indexed);\n indexed = !!indexed;\n }\n let type = obj.type;\n let arrayMatch = type.match(regexArrayType);\n if (arrayMatch) {\n const arrayLength = parseInt(arrayMatch[2] || \"-1\");\n const arrayChildren = ParamType.from({\n type: arrayMatch[1],\n components: obj.components\n });\n return new ParamType(_guard, name || \"\", type, \"array\", indexed, null, arrayLength, arrayChildren);\n }\n if (type === \"tuple\" || type.startsWith(\"tuple(\" /* fix: ) */) || type.startsWith(\"(\" /* fix: ) */)) {\n const comps = (obj.components != null) ? obj.components.map((c) => ParamType.from(c)) : null;\n const tuple = new ParamType(_guard, name || \"\", type, \"tuple\", indexed, comps, null, null);\n // @TODO: use lexer to validate and normalize type\n return tuple;\n }\n type = verifyBasicType(obj.type);\n return new ParamType(_guard, name || \"\", type, type, indexed, null, null, null);\n }\n /**\n * Returns true if %%value%% is a **ParamType**.\n */\n static isParamType(value) {\n return (value && value[internal] === ParamTypeInternal);\n }\n}\n/**\n * An abstract class to represent An individual fragment from a parse ABI.\n */\nexport class Fragment {\n /**\n * The type of the fragment.\n */\n type;\n /**\n * The inputs for the fragment.\n */\n inputs;\n /**\n * @private\n */\n constructor(guard, type, inputs) {\n assertPrivate(guard, _guard, \"Fragment\");\n inputs = Object.freeze(inputs.slice());\n defineProperties(this, { type, inputs });\n }\n /**\n * Creates a new **Fragment** for %%obj%%, wich can be any supported\n * ABI frgament type.\n */\n static from(obj) {\n if (typeof (obj) === \"string\") {\n // Try parsing JSON...\n try {\n Fragment.from(JSON.parse(obj));\n }\n catch (e) { }\n // ...otherwise, use the human-readable lexer\n return Fragment.from(lex(obj));\n }\n if (obj instanceof TokenString) {\n // Human-readable ABI (already lexed)\n const type = obj.peekKeyword(KwTypes);\n switch (type) {\n case \"constructor\": return ConstructorFragment.from(obj);\n case \"error\": return ErrorFragment.from(obj);\n case \"event\": return EventFragment.from(obj);\n case \"fallback\":\n case \"receive\":\n return FallbackFragment.from(obj);\n case \"function\": return FunctionFragment.from(obj);\n case \"struct\": return StructFragment.from(obj);\n }\n }\n else if (typeof (obj) === \"object\") {\n // JSON ABI\n switch (obj.type) {\n case \"constructor\": return ConstructorFragment.from(obj);\n case \"error\": return ErrorFragment.from(obj);\n case \"event\": return EventFragment.from(obj);\n case \"fallback\":\n case \"receive\":\n return FallbackFragment.from(obj);\n case \"function\": return FunctionFragment.from(obj);\n case \"struct\": return StructFragment.from(obj);\n }\n assert(false, `unsupported type: ${obj.type}`, \"UNSUPPORTED_OPERATION\", {\n operation: \"Fragment.from\"\n });\n }\n assertArgument(false, \"unsupported frgament object\", \"obj\", obj);\n }\n /**\n * Returns true if %%value%% is a [[ConstructorFragment]].\n */\n static isConstructor(value) {\n return ConstructorFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is an [[ErrorFragment]].\n */\n static isError(value) {\n return ErrorFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is an [[EventFragment]].\n */\n static isEvent(value) {\n return EventFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is a [[FunctionFragment]].\n */\n static isFunction(value) {\n return FunctionFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is a [[StructFragment]].\n */\n static isStruct(value) {\n return StructFragment.isFragment(value);\n }\n}\n/**\n * An abstract class to represent An individual fragment\n * which has a name from a parse ABI.\n */\nexport class NamedFragment extends Fragment {\n /**\n * The name of the fragment.\n */\n name;\n /**\n * @private\n */\n constructor(guard, type, name, inputs) {\n super(guard, type, inputs);\n assertArgument(typeof (name) === \"string\" && name.match(regexId), \"invalid identifier\", \"name\", name);\n inputs = Object.freeze(inputs.slice());\n defineProperties(this, { name });\n }\n}\nfunction joinParams(format, params) {\n return \"(\" + params.map((p) => p.format(format)).join((format === \"full\") ? \", \" : \",\") + \")\";\n}\n/**\n * A Fragment which represents a //Custom Error//.\n */\nexport class ErrorFragment extends NamedFragment {\n /**\n * @private\n */\n constructor(guard, name, inputs) {\n super(guard, \"error\", name, inputs);\n Object.defineProperty(this, internal, { value: ErrorFragmentInternal });\n }\n /**\n * The Custom Error selector.\n */\n get selector() {\n return id(this.format(\"sighash\")).substring(0, 10);\n }\n /**\n * Returns a string representation of this fragment as %%format%%.\n */\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n return JSON.stringify({\n type: \"error\",\n name: this.name,\n inputs: this.inputs.map((input) => JSON.parse(input.format(format))),\n });\n }\n const result = [];\n if (format !== \"sighash\") {\n result.push(\"error\");\n }\n result.push(this.name + joinParams(format, this.inputs));\n return result.join(\" \");\n }\n /**\n * Returns a new **ErrorFragment** for %%obj%%.\n */\n static from(obj) {\n if (ErrorFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof (obj) === \"string\") {\n return ErrorFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"error\", obj);\n const inputs = consumeParams(obj);\n consumeEoi(obj);\n return new ErrorFragment(_guard, name, inputs);\n }\n return new ErrorFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []);\n }\n /**\n * Returns ``true`` and provides a type guard if %%value%% is an\n * **ErrorFragment**.\n */\n static isFragment(value) {\n return (value && value[internal] === ErrorFragmentInternal);\n }\n}\n/**\n * A Fragment which represents an Event.\n */\nexport class EventFragment extends NamedFragment {\n /**\n * Whether this event is anonymous.\n */\n anonymous;\n /**\n * @private\n */\n constructor(guard, name, inputs, anonymous) {\n super(guard, \"event\", name, inputs);\n Object.defineProperty(this, internal, { value: EventFragmentInternal });\n defineProperties(this, { anonymous });\n }\n /**\n * The Event topic hash.\n */\n get topicHash() {\n return id(this.format(\"sighash\"));\n }\n /**\n * Returns a string representation of this event as %%format%%.\n */\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n return JSON.stringify({\n type: \"event\",\n anonymous: this.anonymous,\n name: this.name,\n inputs: this.inputs.map((i) => JSON.parse(i.format(format)))\n });\n }\n const result = [];\n if (format !== \"sighash\") {\n result.push(\"event\");\n }\n result.push(this.name + joinParams(format, this.inputs));\n if (format !== \"sighash\" && this.anonymous) {\n result.push(\"anonymous\");\n }\n return result.join(\" \");\n }\n /**\n * Return the topic hash for an event with %%name%% and %%params%%.\n */\n static getTopicHash(name, params) {\n params = (params || []).map((p) => ParamType.from(p));\n const fragment = new EventFragment(_guard, name, params, false);\n return fragment.topicHash;\n }\n /**\n * Returns a new **EventFragment** for %%obj%%.\n */\n static from(obj) {\n if (EventFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof (obj) === \"string\") {\n try {\n return EventFragment.from(lex(obj));\n }\n catch (error) {\n assertArgument(false, \"invalid event fragment\", \"obj\", obj);\n }\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"event\", obj);\n const inputs = consumeParams(obj, true);\n const anonymous = !!consumeKeywords(obj, setify([\"anonymous\"])).has(\"anonymous\");\n consumeEoi(obj);\n return new EventFragment(_guard, name, inputs, anonymous);\n }\n return new EventFragment(_guard, obj.name, obj.inputs ? obj.inputs.map((p) => ParamType.from(p, true)) : [], !!obj.anonymous);\n }\n /**\n * Returns ``true`` and provides a type guard if %%value%% is an\n * **EventFragment**.\n */\n static isFragment(value) {\n return (value && value[internal] === EventFragmentInternal);\n }\n}\n/**\n * A Fragment which represents a constructor.\n */\nexport class ConstructorFragment extends Fragment {\n /**\n * Whether the constructor can receive an endowment.\n */\n payable;\n /**\n * The recommended gas limit for deployment or ``null``.\n */\n gas;\n /**\n * @private\n */\n constructor(guard, type, inputs, payable, gas) {\n super(guard, type, inputs);\n Object.defineProperty(this, internal, { value: ConstructorFragmentInternal });\n defineProperties(this, { payable, gas });\n }\n /**\n * Returns a string representation of this constructor as %%format%%.\n */\n format(format) {\n assert(format != null && format !== \"sighash\", \"cannot format a constructor for sighash\", \"UNSUPPORTED_OPERATION\", { operation: \"format(sighash)\" });\n if (format === \"json\") {\n return JSON.stringify({\n type: \"constructor\",\n stateMutability: (this.payable ? \"payable\" : \"undefined\"),\n payable: this.payable,\n gas: ((this.gas != null) ? this.gas : undefined),\n inputs: this.inputs.map((i) => JSON.parse(i.format(format)))\n });\n }\n const result = [`constructor${joinParams(format, this.inputs)}`];\n if (this.payable) {\n result.push(\"payable\");\n }\n if (this.gas != null) {\n result.push(`@${this.gas.toString()}`);\n }\n return result.join(\" \");\n }\n /**\n * Returns a new **ConstructorFragment** for %%obj%%.\n */\n static from(obj) {\n if (ConstructorFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof (obj) === \"string\") {\n try {\n return ConstructorFragment.from(lex(obj));\n }\n catch (error) {\n assertArgument(false, \"invalid constuctor fragment\", \"obj\", obj);\n }\n }\n else if (obj instanceof TokenString) {\n consumeKeywords(obj, setify([\"constructor\"]));\n const inputs = consumeParams(obj);\n const payable = !!consumeKeywords(obj, KwVisibDeploy).has(\"payable\");\n const gas = consumeGas(obj);\n consumeEoi(obj);\n return new ConstructorFragment(_guard, \"constructor\", inputs, payable, gas);\n }\n return new ConstructorFragment(_guard, \"constructor\", obj.inputs ? obj.inputs.map(ParamType.from) : [], !!obj.payable, (obj.gas != null) ? obj.gas : null);\n }\n /**\n * Returns ``true`` and provides a type guard if %%value%% is a\n * **ConstructorFragment**.\n */\n static isFragment(value) {\n return (value && value[internal] === ConstructorFragmentInternal);\n }\n}\n/**\n * A Fragment which represents a method.\n */\nexport class FallbackFragment extends Fragment {\n /**\n * If the function can be sent value during invocation.\n */\n payable;\n constructor(guard, inputs, payable) {\n super(guard, \"fallback\", inputs);\n Object.defineProperty(this, internal, { value: FallbackFragmentInternal });\n defineProperties(this, { payable });\n }\n /**\n * Returns a string representation of this fallback as %%format%%.\n */\n format(format) {\n const type = ((this.inputs.length === 0) ? \"receive\" : \"fallback\");\n if (format === \"json\") {\n const stateMutability = (this.payable ? \"payable\" : \"nonpayable\");\n return JSON.stringify({ type, stateMutability });\n }\n return `${type}()${this.payable ? \" payable\" : \"\"}`;\n }\n /**\n * Returns a new **FallbackFragment** for %%obj%%.\n */\n static from(obj) {\n if (FallbackFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof (obj) === \"string\") {\n try {\n return FallbackFragment.from(lex(obj));\n }\n catch (error) {\n assertArgument(false, \"invalid fallback fragment\", \"obj\", obj);\n }\n }\n else if (obj instanceof TokenString) {\n const errorObj = obj.toString();\n const topIsValid = obj.peekKeyword(setify([\"fallback\", \"receive\"]));\n assertArgument(topIsValid, \"type must be fallback or receive\", \"obj\", errorObj);\n const type = obj.popKeyword(setify([\"fallback\", \"receive\"]));\n // receive()\n if (type === \"receive\") {\n const inputs = consumeParams(obj);\n assertArgument(inputs.length === 0, `receive cannot have arguments`, \"obj.inputs\", inputs);\n consumeKeywords(obj, setify([\"payable\"]));\n consumeEoi(obj);\n return new FallbackFragment(_guard, [], true);\n }\n // fallback() [payable]\n // fallback(bytes) [payable] returns (bytes)\n let inputs = consumeParams(obj);\n if (inputs.length) {\n assertArgument(inputs.length === 1 && inputs[0].type === \"bytes\", \"invalid fallback inputs\", \"obj.inputs\", inputs.map((i) => i.format(\"minimal\")).join(\", \"));\n }\n else {\n inputs = [ParamType.from(\"bytes\")];\n }\n const mutability = consumeMutability(obj);\n assertArgument(mutability === \"nonpayable\" || mutability === \"payable\", \"fallback cannot be constants\", \"obj.stateMutability\", mutability);\n if (consumeKeywords(obj, setify([\"returns\"])).has(\"returns\")) {\n const outputs = consumeParams(obj);\n assertArgument(outputs.length === 1 && outputs[0].type === \"bytes\", \"invalid fallback outputs\", \"obj.outputs\", outputs.map((i) => i.format(\"minimal\")).join(\", \"));\n }\n consumeEoi(obj);\n return new FallbackFragment(_guard, inputs, mutability === \"payable\");\n }\n if (obj.type === \"receive\") {\n return new FallbackFragment(_guard, [], true);\n }\n if (obj.type === \"fallback\") {\n const inputs = [ParamType.from(\"bytes\")];\n const payable = (obj.stateMutability === \"payable\");\n return new FallbackFragment(_guard, inputs, payable);\n }\n assertArgument(false, \"invalid fallback description\", \"obj\", obj);\n }\n /**\n * Returns ``true`` and provides a type guard if %%value%% is a\n * **FallbackFragment**.\n */\n static isFragment(value) {\n return (value && value[internal] === FallbackFragmentInternal);\n }\n}\n/**\n * A Fragment which represents a method.\n */\nexport class FunctionFragment extends NamedFragment {\n /**\n * If the function is constant (e.g. ``pure`` or ``view`` functions).\n */\n constant;\n /**\n * The returned types for the result of calling this function.\n */\n outputs;\n /**\n * The state mutability (e.g. ``payable``, ``nonpayable``, ``view``\n * or ``pure``)\n */\n stateMutability;\n /**\n * If the function can be sent value during invocation.\n */\n payable;\n /**\n * The recommended gas limit to send when calling this function.\n */\n gas;\n /**\n * @private\n */\n constructor(guard, name, stateMutability, inputs, outputs, gas) {\n super(guard, \"function\", name, inputs);\n Object.defineProperty(this, internal, { value: FunctionFragmentInternal });\n outputs = Object.freeze(outputs.slice());\n const constant = (stateMutability === \"view\" || stateMutability === \"pure\");\n const payable = (stateMutability === \"payable\");\n defineProperties(this, { constant, gas, outputs, payable, stateMutability });\n }\n /**\n * The Function selector.\n */\n get selector() {\n return id(this.format(\"sighash\")).substring(0, 10);\n }\n /**\n * Returns a string representation of this function as %%format%%.\n */\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n return JSON.stringify({\n type: \"function\",\n name: this.name,\n constant: this.constant,\n stateMutability: ((this.stateMutability !== \"nonpayable\") ? this.stateMutability : undefined),\n payable: this.payable,\n gas: ((this.gas != null) ? this.gas : undefined),\n inputs: this.inputs.map((i) => JSON.parse(i.format(format))),\n outputs: this.outputs.map((o) => JSON.parse(o.format(format))),\n });\n }\n const result = [];\n if (format !== \"sighash\") {\n result.push(\"function\");\n }\n result.push(this.name + joinParams(format, this.inputs));\n if (format !== \"sighash\") {\n if (this.stateMutability !== \"nonpayable\") {\n result.push(this.stateMutability);\n }\n if (this.outputs && this.outputs.length) {\n result.push(\"returns\");\n result.push(joinParams(format, this.outputs));\n }\n if (this.gas != null) {\n result.push(`@${this.gas.toString()}`);\n }\n }\n return result.join(\" \");\n }\n /**\n * Return the selector for a function with %%name%% and %%params%%.\n */\n static getSelector(name, params) {\n params = (params || []).map((p) => ParamType.from(p));\n const fragment = new FunctionFragment(_guard, name, \"view\", params, [], null);\n return fragment.selector;\n }\n /**\n * Returns a new **FunctionFragment** for %%obj%%.\n */\n static from(obj) {\n if (FunctionFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof (obj) === \"string\") {\n try {\n return FunctionFragment.from(lex(obj));\n }\n catch (error) {\n assertArgument(false, \"invalid function fragment\", \"obj\", obj);\n }\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"function\", obj);\n const inputs = consumeParams(obj);\n const mutability = consumeMutability(obj);\n let outputs = [];\n if (consumeKeywords(obj, setify([\"returns\"])).has(\"returns\")) {\n outputs = consumeParams(obj);\n }\n const gas = consumeGas(obj);\n consumeEoi(obj);\n return new FunctionFragment(_guard, name, mutability, inputs, outputs, gas);\n }\n let stateMutability = obj.stateMutability;\n // Use legacy Solidity ABI logic if stateMutability is missing\n if (stateMutability == null) {\n stateMutability = \"payable\";\n if (typeof (obj.constant) === \"boolean\") {\n stateMutability = \"view\";\n if (!obj.constant) {\n stateMutability = \"payable\";\n if (typeof (obj.payable) === \"boolean\" && !obj.payable) {\n stateMutability = \"nonpayable\";\n }\n }\n }\n else if (typeof (obj.payable) === \"boolean\" && !obj.payable) {\n stateMutability = \"nonpayable\";\n }\n }\n // @TODO: verifyState for stateMutability (e.g. throw if\n // payable: false but stateMutability is \"nonpayable\")\n return new FunctionFragment(_guard, obj.name, stateMutability, obj.inputs ? obj.inputs.map(ParamType.from) : [], obj.outputs ? obj.outputs.map(ParamType.from) : [], (obj.gas != null) ? obj.gas : null);\n }\n /**\n * Returns ``true`` and provides a type guard if %%value%% is a\n * **FunctionFragment**.\n */\n static isFragment(value) {\n return (value && value[internal] === FunctionFragmentInternal);\n }\n}\n/**\n * A Fragment which represents a structure.\n */\nexport class StructFragment extends NamedFragment {\n /**\n * @private\n */\n constructor(guard, name, inputs) {\n super(guard, \"struct\", name, inputs);\n Object.defineProperty(this, internal, { value: StructFragmentInternal });\n }\n /**\n * Returns a string representation of this struct as %%format%%.\n */\n format() {\n throw new Error(\"@TODO\");\n }\n /**\n * Returns a new **StructFragment** for %%obj%%.\n */\n static from(obj) {\n if (typeof (obj) === \"string\") {\n try {\n return StructFragment.from(lex(obj));\n }\n catch (error) {\n assertArgument(false, \"invalid struct fragment\", \"obj\", obj);\n }\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"struct\", obj);\n const inputs = consumeParams(obj);\n consumeEoi(obj);\n return new StructFragment(_guard, name, inputs);\n }\n return new StructFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []);\n }\n // @TODO: fix this return type\n /**\n * Returns ``true`` and provides a type guard if %%value%% is a\n * **StructFragment**.\n */\n static isFragment(value) {\n return (value && value[internal] === StructFragmentInternal);\n }\n}\n//# sourceMappingURL=fragments.js.map","/**\n * When sending values to or receiving values from a [[Contract]], the\n * data is generally encoded using the [ABI standard](link-solc-abi).\n *\n * The AbiCoder provides a utility to encode values to ABI data and\n * decode values from ABI data.\n *\n * Most of the time, developers should favour the [[Contract]] class,\n * which further abstracts a lot of the finer details of ABI data.\n *\n * @_section api/abi/abi-coder:ABI Encoding\n */\n// See: https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI\nimport { assertArgumentCount, assertArgument } from \"../utils/index.js\";\nimport { Reader, Writer } from \"./coders/abstract-coder.js\";\nimport { AddressCoder } from \"./coders/address.js\";\nimport { ArrayCoder } from \"./coders/array.js\";\nimport { BooleanCoder } from \"./coders/boolean.js\";\nimport { BytesCoder } from \"./coders/bytes.js\";\nimport { FixedBytesCoder } from \"./coders/fixed-bytes.js\";\nimport { NullCoder } from \"./coders/null.js\";\nimport { NumberCoder } from \"./coders/number.js\";\nimport { StringCoder } from \"./coders/string.js\";\nimport { TupleCoder } from \"./coders/tuple.js\";\nimport { ParamType } from \"./fragments.js\";\nimport { getAddress } from \"../address/index.js\";\nimport { getBytes, hexlify, makeError } from \"../utils/index.js\";\n// https://docs.soliditylang.org/en/v0.8.17/control-structures.html\nconst PanicReasons = new Map();\nPanicReasons.set(0x00, \"GENERIC_PANIC\");\nPanicReasons.set(0x01, \"ASSERT_FALSE\");\nPanicReasons.set(0x11, \"OVERFLOW\");\nPanicReasons.set(0x12, \"DIVIDE_BY_ZERO\");\nPanicReasons.set(0x21, \"ENUM_RANGE_ERROR\");\nPanicReasons.set(0x22, \"BAD_STORAGE_DATA\");\nPanicReasons.set(0x31, \"STACK_UNDERFLOW\");\nPanicReasons.set(0x32, \"ARRAY_RANGE_ERROR\");\nPanicReasons.set(0x41, \"OUT_OF_MEMORY\");\nPanicReasons.set(0x51, \"UNINITIALIZED_FUNCTION_CALL\");\nconst paramTypeBytes = new RegExp(/^bytes([0-9]*)$/);\nconst paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/);\nlet defaultCoder = null;\nlet defaultMaxInflation = 1024;\nfunction getBuiltinCallException(action, tx, data, abiCoder) {\n let message = \"missing revert data\";\n let reason = null;\n const invocation = null;\n let revert = null;\n if (data) {\n message = \"execution reverted\";\n const bytes = getBytes(data);\n data = hexlify(data);\n if (bytes.length === 0) {\n message += \" (no data present; likely require(false) occurred\";\n reason = \"require(false)\";\n }\n else if (bytes.length % 32 !== 4) {\n message += \" (could not decode reason; invalid data length)\";\n }\n else if (hexlify(bytes.slice(0, 4)) === \"0x08c379a0\") {\n // Error(string)\n try {\n reason = abiCoder.decode([\"string\"], bytes.slice(4))[0];\n revert = {\n signature: \"Error(string)\",\n name: \"Error\",\n args: [reason]\n };\n message += `: ${JSON.stringify(reason)}`;\n }\n catch (error) {\n message += \" (could not decode reason; invalid string data)\";\n }\n }\n else if (hexlify(bytes.slice(0, 4)) === \"0x4e487b71\") {\n // Panic(uint256)\n try {\n const code = Number(abiCoder.decode([\"uint256\"], bytes.slice(4))[0]);\n revert = {\n signature: \"Panic(uint256)\",\n name: \"Panic\",\n args: [code]\n };\n reason = `Panic due to ${PanicReasons.get(code) || \"UNKNOWN\"}(${code})`;\n message += `: ${reason}`;\n }\n catch (error) {\n message += \" (could not decode panic code)\";\n }\n }\n else {\n message += \" (unknown custom error)\";\n }\n }\n const transaction = {\n to: (tx.to ? getAddress(tx.to) : null),\n data: (tx.data || \"0x\")\n };\n if (tx.from) {\n transaction.from = getAddress(tx.from);\n }\n return makeError(message, \"CALL_EXCEPTION\", {\n action, data, reason, transaction, invocation, revert\n });\n}\n/**\n * The **AbiCoder** is a low-level class responsible for encoding JavaScript\n * values into binary data and decoding binary data into JavaScript values.\n */\nexport class AbiCoder {\n #getCoder(param) {\n if (param.isArray()) {\n return new ArrayCoder(this.#getCoder(param.arrayChildren), param.arrayLength, param.name);\n }\n if (param.isTuple()) {\n return new TupleCoder(param.components.map((c) => this.#getCoder(c)), param.name);\n }\n switch (param.baseType) {\n case \"address\":\n return new AddressCoder(param.name);\n case \"bool\":\n return new BooleanCoder(param.name);\n case \"string\":\n return new StringCoder(param.name);\n case \"bytes\":\n return new BytesCoder(param.name);\n case \"\":\n return new NullCoder(param.name);\n }\n // u?int[0-9]*\n let match = param.type.match(paramTypeNumber);\n if (match) {\n let size = parseInt(match[2] || \"256\");\n assertArgument(size !== 0 && size <= 256 && (size % 8) === 0, \"invalid \" + match[1] + \" bit length\", \"param\", param);\n return new NumberCoder(size / 8, (match[1] === \"int\"), param.name);\n }\n // bytes[0-9]+\n match = param.type.match(paramTypeBytes);\n if (match) {\n let size = parseInt(match[1]);\n assertArgument(size !== 0 && size <= 32, \"invalid bytes length\", \"param\", param);\n return new FixedBytesCoder(size, param.name);\n }\n assertArgument(false, \"invalid type\", \"type\", param.type);\n }\n /**\n * Get the default values for the given %%types%%.\n *\n * For example, a ``uint`` is by default ``0`` and ``bool``\n * is by default ``false``.\n */\n getDefaultValue(types) {\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n return coder.defaultValue();\n }\n /**\n * Encode the %%values%% as the %%types%% into ABI data.\n *\n * @returns DataHexstring\n */\n encode(types, values) {\n assertArgumentCount(values.length, types.length, \"types/values length mismatch\");\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = (new TupleCoder(coders, \"_\"));\n const writer = new Writer();\n coder.encode(writer, values);\n return writer.data;\n }\n /**\n * Decode the ABI %%data%% as the %%types%% into values.\n *\n * If %%loose%% decoding is enabled, then strict padding is\n * not enforced. Some older versions of Solidity incorrectly\n * padded event data emitted from ``external`` functions.\n */\n decode(types, data, loose) {\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n return coder.decode(new Reader(data, loose, defaultMaxInflation));\n }\n static _setDefaultMaxInflation(value) {\n assertArgument(typeof (value) === \"number\" && Number.isInteger(value), \"invalid defaultMaxInflation factor\", \"value\", value);\n defaultMaxInflation = value;\n }\n /**\n * Returns the shared singleton instance of a default [[AbiCoder]].\n *\n * On the first call, the instance is created internally.\n */\n static defaultAbiCoder() {\n if (defaultCoder == null) {\n defaultCoder = new AbiCoder();\n }\n return defaultCoder;\n }\n /**\n * Returns an ethers-compatible [[CallExceptionError]] Error for the given\n * result %%data%% for the [[CallExceptionAction]] %%action%% against\n * the Transaction %%tx%%.\n */\n static getBuiltinCallException(action, tx, data) {\n return getBuiltinCallException(action, tx, data, AbiCoder.defaultAbiCoder());\n }\n}\n//# sourceMappingURL=abi-coder.js.map","/**\n * About bytes32 strings...\n *\n * @_docloc: api/utils:Bytes32 Strings\n */\nimport { getBytes, toUtf8Bytes, toUtf8String, zeroPadBytes } from \"../utils/index.js\";\n/**\n * Encodes %%text%% as a Bytes32 string.\n */\nexport function encodeBytes32String(text) {\n // Get the bytes\n const bytes = toUtf8Bytes(text);\n // Check we have room for null-termination\n if (bytes.length > 31) {\n throw new Error(\"bytes32 string must be less than 32 bytes\");\n }\n // Zero-pad (implicitly null-terminates)\n return zeroPadBytes(bytes, 32);\n}\n/**\n * Encodes the Bytes32-encoded %%bytes%% into a string.\n */\nexport function decodeBytes32String(_bytes) {\n const data = getBytes(_bytes, \"bytes\");\n // Must be 32 bytes with a null-termination\n if (data.length !== 32) {\n throw new Error(\"invalid bytes32 - not 32 bytes long\");\n }\n if (data[31] !== 0) {\n throw new Error(\"invalid bytes32 string - no null terminator\");\n }\n // Find the null termination\n let length = 31;\n while (data[length - 1] === 0) {\n length--;\n }\n // Determine the string value\n return toUtf8String(data.slice(0, length));\n}\n//# sourceMappingURL=bytes32.js.map","/**\n * The Interface class is a low-level class that accepts an\n * ABI and provides all the necessary functionality to encode\n * and decode paramaters to and results from methods, events\n * and errors.\n *\n * It also provides several convenience methods to automatically\n * search and find matching transactions and events to parse them.\n *\n * @_subsection api/abi:Interfaces [interfaces]\n */\nimport { keccak256 } from \"../crypto/index.js\";\nimport { id } from \"../hash/index.js\";\nimport { concat, dataSlice, getBigInt, getBytes, getBytesCopy, hexlify, zeroPadBytes, zeroPadValue, isHexString, defineProperties, assertArgument, toBeHex, assert } from \"../utils/index.js\";\nimport { AbiCoder } from \"./abi-coder.js\";\nimport { checkResultErrors, Result } from \"./coders/abstract-coder.js\";\nimport { ConstructorFragment, ErrorFragment, EventFragment, Fragment, FunctionFragment, ParamType } from \"./fragments.js\";\nimport { Typed } from \"./typed.js\";\nexport { checkResultErrors, Result };\n/**\n * When using the [[Interface-parseLog]] to automatically match a Log to its event\n * for parsing, a **LogDescription** is returned.\n */\nexport class LogDescription {\n /**\n * The matching fragment for the ``topic0``.\n */\n fragment;\n /**\n * The name of the Event.\n */\n name;\n /**\n * The full Event signature.\n */\n signature;\n /**\n * The topic hash for the Event.\n */\n topic;\n /**\n * The arguments passed into the Event with ``emit``.\n */\n args;\n /**\n * @_ignore:\n */\n constructor(fragment, topic, args) {\n const name = fragment.name, signature = fragment.format();\n defineProperties(this, {\n fragment, name, signature, topic, args\n });\n }\n}\n/**\n * When using the [[Interface-parseTransaction]] to automatically match\n * a transaction data to its function for parsing,\n * a **TransactionDescription** is returned.\n */\nexport class TransactionDescription {\n /**\n * The matching fragment from the transaction ``data``.\n */\n fragment;\n /**\n * The name of the Function from the transaction ``data``.\n */\n name;\n /**\n * The arguments passed to the Function from the transaction ``data``.\n */\n args;\n /**\n * The full Function signature from the transaction ``data``.\n */\n signature;\n /**\n * The selector for the Function from the transaction ``data``.\n */\n selector;\n /**\n * The ``value`` (in wei) from the transaction.\n */\n value;\n /**\n * @_ignore:\n */\n constructor(fragment, selector, args, value) {\n const name = fragment.name, signature = fragment.format();\n defineProperties(this, {\n fragment, name, args, signature, selector, value\n });\n }\n}\n/**\n * When using the [[Interface-parseError]] to automatically match an\n * error for a call result for parsing, an **ErrorDescription** is returned.\n */\nexport class ErrorDescription {\n /**\n * The matching fragment.\n */\n fragment;\n /**\n * The name of the Error.\n */\n name;\n /**\n * The arguments passed to the Error with ``revert``.\n */\n args;\n /**\n * The full Error signature.\n */\n signature;\n /**\n * The selector for the Error.\n */\n selector;\n /**\n * @_ignore:\n */\n constructor(fragment, selector, args) {\n const name = fragment.name, signature = fragment.format();\n defineProperties(this, {\n fragment, name, args, signature, selector\n });\n }\n}\n/**\n * An **Indexed** is used as a value when a value that does not\n * fit within a topic (i.e. not a fixed-length, 32-byte type). It\n * is the ``keccak256`` of the value, and used for types such as\n * arrays, tuples, bytes and strings.\n */\nexport class Indexed {\n /**\n * The ``keccak256`` of the value logged.\n */\n hash;\n /**\n * @_ignore:\n */\n _isIndexed;\n /**\n * Returns ``true`` if %%value%% is an **Indexed**.\n *\n * This provides a Type Guard for property access.\n */\n static isIndexed(value) {\n return !!(value && value._isIndexed);\n }\n /**\n * @_ignore:\n */\n constructor(hash) {\n defineProperties(this, { hash, _isIndexed: true });\n }\n}\n// https://docs.soliditylang.org/en/v0.8.13/control-structures.html?highlight=panic#panic-via-assert-and-error-via-require\nconst PanicReasons = {\n \"0\": \"generic panic\",\n \"1\": \"assert(false)\",\n \"17\": \"arithmetic overflow\",\n \"18\": \"division or modulo by zero\",\n \"33\": \"enum overflow\",\n \"34\": \"invalid encoded storage byte array accessed\",\n \"49\": \"out-of-bounds array access; popping on an empty array\",\n \"50\": \"out-of-bounds access of an array or bytesN\",\n \"65\": \"out of memory\",\n \"81\": \"uninitialized function\",\n};\nconst BuiltinErrors = {\n \"0x08c379a0\": {\n signature: \"Error(string)\",\n name: \"Error\",\n inputs: [\"string\"],\n reason: (message) => {\n return `reverted with reason string ${JSON.stringify(message)}`;\n }\n },\n \"0x4e487b71\": {\n signature: \"Panic(uint256)\",\n name: \"Panic\",\n inputs: [\"uint256\"],\n reason: (code) => {\n let reason = \"unknown panic code\";\n if (code >= 0 && code <= 0xff && PanicReasons[code.toString()]) {\n reason = PanicReasons[code.toString()];\n }\n return `reverted with panic code 0x${code.toString(16)} (${reason})`;\n }\n }\n};\n/**\n * An Interface abstracts many of the low-level details for\n * encoding and decoding the data on the blockchain.\n *\n * An ABI provides information on how to encode data to send to\n * a Contract, how to decode the results and events and how to\n * interpret revert errors.\n *\n * The ABI can be specified by [any supported format](InterfaceAbi).\n */\nexport class Interface {\n /**\n * All the Contract ABI members (i.e. methods, events, errors, etc).\n */\n fragments;\n /**\n * The Contract constructor.\n */\n deploy;\n /**\n * The Fallback method, if any.\n */\n fallback;\n /**\n * If receiving ether is supported.\n */\n receive;\n #errors;\n #events;\n #functions;\n // #structs: Map;\n #abiCoder;\n /**\n * Create a new Interface for the %%fragments%%.\n */\n constructor(fragments) {\n let abi = [];\n if (typeof (fragments) === \"string\") {\n abi = JSON.parse(fragments);\n }\n else {\n abi = fragments;\n }\n this.#functions = new Map();\n this.#errors = new Map();\n this.#events = new Map();\n // this.#structs = new Map();\n const frags = [];\n for (const a of abi) {\n try {\n frags.push(Fragment.from(a));\n }\n catch (error) {\n console.log(`[Warning] Invalid Fragment ${JSON.stringify(a)}:`, error.message);\n }\n }\n defineProperties(this, {\n fragments: Object.freeze(frags)\n });\n let fallback = null;\n let receive = false;\n this.#abiCoder = this.getAbiCoder();\n // Add all fragments by their signature\n this.fragments.forEach((fragment, index) => {\n let bucket;\n switch (fragment.type) {\n case \"constructor\":\n if (this.deploy) {\n console.log(\"duplicate definition - constructor\");\n return;\n }\n //checkNames(fragment, \"input\", fragment.inputs);\n defineProperties(this, { deploy: fragment });\n return;\n case \"fallback\":\n if (fragment.inputs.length === 0) {\n receive = true;\n }\n else {\n assertArgument(!fallback || fragment.payable !== fallback.payable, \"conflicting fallback fragments\", `fragments[${index}]`, fragment);\n fallback = fragment;\n receive = fallback.payable;\n }\n return;\n case \"function\":\n //checkNames(fragment, \"input\", fragment.inputs);\n //checkNames(fragment, \"output\", (fragment).outputs);\n bucket = this.#functions;\n break;\n case \"event\":\n //checkNames(fragment, \"input\", fragment.inputs);\n bucket = this.#events;\n break;\n case \"error\":\n bucket = this.#errors;\n break;\n default:\n return;\n }\n // Two identical entries; ignore it\n const signature = fragment.format();\n if (bucket.has(signature)) {\n return;\n }\n bucket.set(signature, fragment);\n });\n // If we do not have a constructor add a default\n if (!this.deploy) {\n defineProperties(this, {\n deploy: ConstructorFragment.from(\"constructor()\")\n });\n }\n defineProperties(this, { fallback, receive });\n }\n /**\n * Returns the entire Human-Readable ABI, as an array of\n * signatures, optionally as %%minimal%% strings, which\n * removes parameter names and unneceesary spaces.\n */\n format(minimal) {\n const format = (minimal ? \"minimal\" : \"full\");\n const abi = this.fragments.map((f) => f.format(format));\n return abi;\n }\n /**\n * Return the JSON-encoded ABI. This is the format Solidiy\n * returns.\n */\n formatJson() {\n const abi = this.fragments.map((f) => f.format(\"json\"));\n // We need to re-bundle the JSON fragments a bit\n return JSON.stringify(abi.map((j) => JSON.parse(j)));\n }\n /**\n * The ABI coder that will be used to encode and decode binary\n * data.\n */\n getAbiCoder() {\n return AbiCoder.defaultAbiCoder();\n }\n // Find a function definition by any means necessary (unless it is ambiguous)\n #getFunction(key, values, forceUnique) {\n // Selector\n if (isHexString(key)) {\n const selector = key.toLowerCase();\n for (const fragment of this.#functions.values()) {\n if (selector === fragment.selector) {\n return fragment;\n }\n }\n return null;\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (key.indexOf(\"(\") === -1) {\n const matching = [];\n for (const [name, fragment] of this.#functions) {\n if (name.split(\"(\" /* fix:) */)[0] === key) {\n matching.push(fragment);\n }\n }\n if (values) {\n const lastValue = (values.length > 0) ? values[values.length - 1] : null;\n let valueLength = values.length;\n let allowOptions = true;\n if (Typed.isTyped(lastValue) && lastValue.type === \"overrides\") {\n allowOptions = false;\n valueLength--;\n }\n // Remove all matches that don't have a compatible length. The args\n // may contain an overrides, so the match may have n or n - 1 parameters\n for (let i = matching.length - 1; i >= 0; i--) {\n const inputs = matching[i].inputs.length;\n if (inputs !== valueLength && (!allowOptions || inputs !== valueLength - 1)) {\n matching.splice(i, 1);\n }\n }\n // Remove all matches that don't match the Typed signature\n for (let i = matching.length - 1; i >= 0; i--) {\n const inputs = matching[i].inputs;\n for (let j = 0; j < values.length; j++) {\n // Not a typed value\n if (!Typed.isTyped(values[j])) {\n continue;\n }\n // We are past the inputs\n if (j >= inputs.length) {\n if (values[j].type === \"overrides\") {\n continue;\n }\n matching.splice(i, 1);\n break;\n }\n // Make sure the value type matches the input type\n if (values[j].type !== inputs[j].baseType) {\n matching.splice(i, 1);\n break;\n }\n }\n }\n }\n // We found a single matching signature with an overrides, but the\n // last value is something that cannot possibly be an options\n if (matching.length === 1 && values && values.length !== matching[0].inputs.length) {\n const lastArg = values[values.length - 1];\n if (lastArg == null || Array.isArray(lastArg) || typeof (lastArg) !== \"object\") {\n matching.splice(0, 1);\n }\n }\n if (matching.length === 0) {\n return null;\n }\n if (matching.length > 1 && forceUnique) {\n const matchStr = matching.map((m) => JSON.stringify(m.format())).join(\", \");\n assertArgument(false, `ambiguous function description (i.e. matches ${matchStr})`, \"key\", key);\n }\n return matching[0];\n }\n // Normalize the signature and lookup the function\n const result = this.#functions.get(FunctionFragment.from(key).format());\n if (result) {\n return result;\n }\n return null;\n }\n /**\n * Get the function name for %%key%%, which may be a function selector,\n * function name or function signature that belongs to the ABI.\n */\n getFunctionName(key) {\n const fragment = this.#getFunction(key, null, false);\n assertArgument(fragment, \"no matching function\", \"key\", key);\n return fragment.name;\n }\n /**\n * Returns true if %%key%% (a function selector, function name or\n * function signature) is present in the ABI.\n *\n * In the case of a function name, the name may be ambiguous, so\n * accessing the [[FunctionFragment]] may require refinement.\n */\n hasFunction(key) {\n return !!this.#getFunction(key, null, false);\n }\n /**\n * Get the [[FunctionFragment]] for %%key%%, which may be a function\n * selector, function name or function signature that belongs to the ABI.\n *\n * If %%values%% is provided, it will use the Typed API to handle\n * ambiguous cases where multiple functions match by name.\n *\n * If the %%key%% and %%values%% do not refine to a single function in\n * the ABI, this will throw.\n */\n getFunction(key, values) {\n return this.#getFunction(key, values || null, true);\n }\n /**\n * Iterate over all functions, calling %%callback%%, sorted by their name.\n */\n forEachFunction(callback) {\n const names = Array.from(this.#functions.keys());\n names.sort((a, b) => a.localeCompare(b));\n for (let i = 0; i < names.length; i++) {\n const name = names[i];\n callback((this.#functions.get(name)), i);\n }\n }\n // Find an event definition by any means necessary (unless it is ambiguous)\n #getEvent(key, values, forceUnique) {\n // EventTopic\n if (isHexString(key)) {\n const eventTopic = key.toLowerCase();\n for (const fragment of this.#events.values()) {\n if (eventTopic === fragment.topicHash) {\n return fragment;\n }\n }\n return null;\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (key.indexOf(\"(\") === -1) {\n const matching = [];\n for (const [name, fragment] of this.#events) {\n if (name.split(\"(\" /* fix:) */)[0] === key) {\n matching.push(fragment);\n }\n }\n if (values) {\n // Remove all matches that don't have a compatible length.\n for (let i = matching.length - 1; i >= 0; i--) {\n if (matching[i].inputs.length < values.length) {\n matching.splice(i, 1);\n }\n }\n // Remove all matches that don't match the Typed signature\n for (let i = matching.length - 1; i >= 0; i--) {\n const inputs = matching[i].inputs;\n for (let j = 0; j < values.length; j++) {\n // Not a typed value\n if (!Typed.isTyped(values[j])) {\n continue;\n }\n // Make sure the value type matches the input type\n if (values[j].type !== inputs[j].baseType) {\n matching.splice(i, 1);\n break;\n }\n }\n }\n }\n if (matching.length === 0) {\n return null;\n }\n if (matching.length > 1 && forceUnique) {\n const matchStr = matching.map((m) => JSON.stringify(m.format())).join(\", \");\n assertArgument(false, `ambiguous event description (i.e. matches ${matchStr})`, \"key\", key);\n }\n return matching[0];\n }\n // Normalize the signature and lookup the function\n const result = this.#events.get(EventFragment.from(key).format());\n if (result) {\n return result;\n }\n return null;\n }\n /**\n * Get the event name for %%key%%, which may be a topic hash,\n * event name or event signature that belongs to the ABI.\n */\n getEventName(key) {\n const fragment = this.#getEvent(key, null, false);\n assertArgument(fragment, \"no matching event\", \"key\", key);\n return fragment.name;\n }\n /**\n * Returns true if %%key%% (an event topic hash, event name or\n * event signature) is present in the ABI.\n *\n * In the case of an event name, the name may be ambiguous, so\n * accessing the [[EventFragment]] may require refinement.\n */\n hasEvent(key) {\n return !!this.#getEvent(key, null, false);\n }\n /**\n * Get the [[EventFragment]] for %%key%%, which may be a topic hash,\n * event name or event signature that belongs to the ABI.\n *\n * If %%values%% is provided, it will use the Typed API to handle\n * ambiguous cases where multiple events match by name.\n *\n * If the %%key%% and %%values%% do not refine to a single event in\n * the ABI, this will throw.\n */\n getEvent(key, values) {\n return this.#getEvent(key, values || null, true);\n }\n /**\n * Iterate over all events, calling %%callback%%, sorted by their name.\n */\n forEachEvent(callback) {\n const names = Array.from(this.#events.keys());\n names.sort((a, b) => a.localeCompare(b));\n for (let i = 0; i < names.length; i++) {\n const name = names[i];\n callback((this.#events.get(name)), i);\n }\n }\n /**\n * Get the [[ErrorFragment]] for %%key%%, which may be an error\n * selector, error name or error signature that belongs to the ABI.\n *\n * If %%values%% is provided, it will use the Typed API to handle\n * ambiguous cases where multiple errors match by name.\n *\n * If the %%key%% and %%values%% do not refine to a single error in\n * the ABI, this will throw.\n */\n getError(key, values) {\n if (isHexString(key)) {\n const selector = key.toLowerCase();\n if (BuiltinErrors[selector]) {\n return ErrorFragment.from(BuiltinErrors[selector].signature);\n }\n for (const fragment of this.#errors.values()) {\n if (selector === fragment.selector) {\n return fragment;\n }\n }\n return null;\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (key.indexOf(\"(\") === -1) {\n const matching = [];\n for (const [name, fragment] of this.#errors) {\n if (name.split(\"(\" /* fix:) */)[0] === key) {\n matching.push(fragment);\n }\n }\n if (matching.length === 0) {\n if (key === \"Error\") {\n return ErrorFragment.from(\"error Error(string)\");\n }\n if (key === \"Panic\") {\n return ErrorFragment.from(\"error Panic(uint256)\");\n }\n return null;\n }\n else if (matching.length > 1) {\n const matchStr = matching.map((m) => JSON.stringify(m.format())).join(\", \");\n assertArgument(false, `ambiguous error description (i.e. ${matchStr})`, \"name\", key);\n }\n return matching[0];\n }\n // Normalize the signature and lookup the function\n key = ErrorFragment.from(key).format();\n if (key === \"Error(string)\") {\n return ErrorFragment.from(\"error Error(string)\");\n }\n if (key === \"Panic(uint256)\") {\n return ErrorFragment.from(\"error Panic(uint256)\");\n }\n const result = this.#errors.get(key);\n if (result) {\n return result;\n }\n return null;\n }\n /**\n * Iterate over all errors, calling %%callback%%, sorted by their name.\n */\n forEachError(callback) {\n const names = Array.from(this.#errors.keys());\n names.sort((a, b) => a.localeCompare(b));\n for (let i = 0; i < names.length; i++) {\n const name = names[i];\n callback((this.#errors.get(name)), i);\n }\n }\n // Get the 4-byte selector used by Solidity to identify a function\n /*\ngetSelector(fragment: ErrorFragment | FunctionFragment): string {\n if (typeof(fragment) === \"string\") {\n const matches: Array = [ ];\n\n try { matches.push(this.getFunction(fragment)); } catch (error) { }\n try { matches.push(this.getError(fragment)); } catch (_) { }\n\n if (matches.length === 0) {\n logger.throwArgumentError(\"unknown fragment\", \"key\", fragment);\n } else if (matches.length > 1) {\n logger.throwArgumentError(\"ambiguous fragment matches function and error\", \"key\", fragment);\n }\n\n fragment = matches[0];\n }\n\n return dataSlice(id(fragment.format()), 0, 4);\n}\n */\n // Get the 32-byte topic hash used by Solidity to identify an event\n /*\n getEventTopic(fragment: EventFragment): string {\n //if (typeof(fragment) === \"string\") { fragment = this.getEvent(eventFragment); }\n return id(fragment.format());\n }\n */\n _decodeParams(params, data) {\n return this.#abiCoder.decode(params, data);\n }\n _encodeParams(params, values) {\n return this.#abiCoder.encode(params, values);\n }\n /**\n * Encodes a ``tx.data`` object for deploying the Contract with\n * the %%values%% as the constructor arguments.\n */\n encodeDeploy(values) {\n return this._encodeParams(this.deploy.inputs, values || []);\n }\n /**\n * Decodes the result %%data%% (e.g. from an ``eth_call``) for the\n * specified error (see [[getError]] for valid values for\n * %%key%%).\n *\n * Most developers should prefer the [[parseCallResult]] method instead,\n * which will automatically detect a ``CALL_EXCEPTION`` and throw the\n * corresponding error.\n */\n decodeErrorResult(fragment, data) {\n if (typeof (fragment) === \"string\") {\n const f = this.getError(fragment);\n assertArgument(f, \"unknown error\", \"fragment\", fragment);\n fragment = f;\n }\n assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match error ${fragment.name}.`, \"data\", data);\n return this._decodeParams(fragment.inputs, dataSlice(data, 4));\n }\n /**\n * Encodes the transaction revert data for a call result that\n * reverted from the the Contract with the sepcified %%error%%\n * (see [[getError]] for valid values for %%fragment%%) with the %%values%%.\n *\n * This is generally not used by most developers, unless trying to mock\n * a result from a Contract.\n */\n encodeErrorResult(fragment, values) {\n if (typeof (fragment) === \"string\") {\n const f = this.getError(fragment);\n assertArgument(f, \"unknown error\", \"fragment\", fragment);\n fragment = f;\n }\n return concat([\n fragment.selector,\n this._encodeParams(fragment.inputs, values || [])\n ]);\n }\n /**\n * Decodes the %%data%% from a transaction ``tx.data`` for\n * the function specified (see [[getFunction]] for valid values\n * for %%fragment%%).\n *\n * Most developers should prefer the [[parseTransaction]] method\n * instead, which will automatically detect the fragment.\n */\n decodeFunctionData(fragment, data) {\n if (typeof (fragment) === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match function ${fragment.name}.`, \"data\", data);\n return this._decodeParams(fragment.inputs, dataSlice(data, 4));\n }\n /**\n * Encodes the ``tx.data`` for a transaction that calls the function\n * specified (see [[getFunction]] for valid values for %%fragment%%) with\n * the %%values%%.\n */\n encodeFunctionData(fragment, values) {\n if (typeof (fragment) === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n return concat([\n fragment.selector,\n this._encodeParams(fragment.inputs, values || [])\n ]);\n }\n /**\n * Decodes the result %%data%% (e.g. from an ``eth_call``) for the\n * specified function (see [[getFunction]] for valid values for\n * %%key%%).\n *\n * Most developers should prefer the [[parseCallResult]] method instead,\n * which will automatically detect a ``CALL_EXCEPTION`` and throw the\n * corresponding error.\n */\n decodeFunctionResult(fragment, data) {\n if (typeof (fragment) === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n let message = \"invalid length for result data\";\n const bytes = getBytesCopy(data);\n if ((bytes.length % 32) === 0) {\n try {\n return this.#abiCoder.decode(fragment.outputs, bytes);\n }\n catch (error) {\n message = \"could not decode result data\";\n }\n }\n // Call returned data with no error, but the data is junk\n assert(false, message, \"BAD_DATA\", {\n value: hexlify(bytes),\n info: { method: fragment.name, signature: fragment.format() }\n });\n }\n makeError(_data, tx) {\n const data = getBytes(_data, \"data\");\n const error = AbiCoder.getBuiltinCallException(\"call\", tx, data);\n // Not a built-in error; try finding a custom error\n const customPrefix = \"execution reverted (unknown custom error)\";\n if (error.message.startsWith(customPrefix)) {\n const selector = hexlify(data.slice(0, 4));\n const ef = this.getError(selector);\n if (ef) {\n try {\n const args = this.#abiCoder.decode(ef.inputs, data.slice(4));\n error.revert = {\n name: ef.name, signature: ef.format(), args\n };\n error.reason = error.revert.signature;\n error.message = `execution reverted: ${error.reason}`;\n }\n catch (e) {\n error.message = `execution reverted (coult not decode custom error)`;\n }\n }\n }\n // Add the invocation, if available\n const parsed = this.parseTransaction(tx);\n if (parsed) {\n error.invocation = {\n method: parsed.name,\n signature: parsed.signature,\n args: parsed.args\n };\n }\n return error;\n }\n /**\n * Encodes the result data (e.g. from an ``eth_call``) for the\n * specified function (see [[getFunction]] for valid values\n * for %%fragment%%) with %%values%%.\n *\n * This is generally not used by most developers, unless trying to mock\n * a result from a Contract.\n */\n encodeFunctionResult(fragment, values) {\n if (typeof (fragment) === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n return hexlify(this.#abiCoder.encode(fragment.outputs, values || []));\n }\n /*\n spelunk(inputs: Array, values: ReadonlyArray, processfunc: (type: string, value: any) => Promise): Promise> {\n const promises: Array> = [ ];\n const process = function(type: ParamType, value: any): any {\n if (type.baseType === \"array\") {\n return descend(type.child\n }\n if (type. === \"address\") {\n }\n };\n \n const descend = function (inputs: Array, values: ReadonlyArray) {\n if (inputs.length !== values.length) { throw new Error(\"length mismatch\"); }\n \n };\n \n const result: Array = [ ];\n values.forEach((value, index) => {\n if (value == null) {\n topics.push(null);\n } else if (param.baseType === \"array\" || param.baseType === \"tuple\") {\n logger.throwArgumentError(\"filtering with tuples or arrays not supported\", (\"contract.\" + param.name), value);\n } else if (Array.isArray(value)) {\n topics.push(value.map((value) => encodeTopic(param, value)));\n } else {\n topics.push(encodeTopic(param, value));\n }\n });\n }\n */\n // Create the filter for the event with search criteria (e.g. for eth_filterLog)\n encodeFilterTopics(fragment, values) {\n if (typeof (fragment) === \"string\") {\n const f = this.getEvent(fragment);\n assertArgument(f, \"unknown event\", \"eventFragment\", fragment);\n fragment = f;\n }\n assert(values.length <= fragment.inputs.length, `too many arguments for ${fragment.format()}`, \"UNEXPECTED_ARGUMENT\", { count: values.length, expectedCount: fragment.inputs.length });\n const topics = [];\n if (!fragment.anonymous) {\n topics.push(fragment.topicHash);\n }\n // @TODO: Use the coders for this; to properly support tuples, etc.\n const encodeTopic = (param, value) => {\n if (param.type === \"string\") {\n return id(value);\n }\n else if (param.type === \"bytes\") {\n return keccak256(hexlify(value));\n }\n if (param.type === \"bool\" && typeof (value) === \"boolean\") {\n value = (value ? \"0x01\" : \"0x00\");\n }\n else if (param.type.match(/^u?int/)) {\n value = toBeHex(value); // @TODO: Should this toTwos??\n }\n else if (param.type.match(/^bytes/)) {\n value = zeroPadBytes(value, 32);\n }\n else if (param.type === \"address\") {\n // Check addresses are valid\n this.#abiCoder.encode([\"address\"], [value]);\n }\n return zeroPadValue(hexlify(value), 32);\n };\n values.forEach((value, index) => {\n const param = fragment.inputs[index];\n if (!param.indexed) {\n assertArgument(value == null, \"cannot filter non-indexed parameters; must be null\", (\"contract.\" + param.name), value);\n return;\n }\n if (value == null) {\n topics.push(null);\n }\n else if (param.baseType === \"array\" || param.baseType === \"tuple\") {\n assertArgument(false, \"filtering with tuples or arrays not supported\", (\"contract.\" + param.name), value);\n }\n else if (Array.isArray(value)) {\n topics.push(value.map((value) => encodeTopic(param, value)));\n }\n else {\n topics.push(encodeTopic(param, value));\n }\n });\n // Trim off trailing nulls\n while (topics.length && topics[topics.length - 1] === null) {\n topics.pop();\n }\n return topics;\n }\n encodeEventLog(fragment, values) {\n if (typeof (fragment) === \"string\") {\n const f = this.getEvent(fragment);\n assertArgument(f, \"unknown event\", \"eventFragment\", fragment);\n fragment = f;\n }\n const topics = [];\n const dataTypes = [];\n const dataValues = [];\n if (!fragment.anonymous) {\n topics.push(fragment.topicHash);\n }\n assertArgument(values.length === fragment.inputs.length, \"event arguments/values mismatch\", \"values\", values);\n fragment.inputs.forEach((param, index) => {\n const value = values[index];\n if (param.indexed) {\n if (param.type === \"string\") {\n topics.push(id(value));\n }\n else if (param.type === \"bytes\") {\n topics.push(keccak256(value));\n }\n else if (param.baseType === \"tuple\" || param.baseType === \"array\") {\n // @TODO\n throw new Error(\"not implemented\");\n }\n else {\n topics.push(this.#abiCoder.encode([param.type], [value]));\n }\n }\n else {\n dataTypes.push(param);\n dataValues.push(value);\n }\n });\n return {\n data: this.#abiCoder.encode(dataTypes, dataValues),\n topics: topics\n };\n }\n // Decode a filter for the event and the search criteria\n decodeEventLog(fragment, data, topics) {\n if (typeof (fragment) === \"string\") {\n const f = this.getEvent(fragment);\n assertArgument(f, \"unknown event\", \"eventFragment\", fragment);\n fragment = f;\n }\n if (topics != null && !fragment.anonymous) {\n const eventTopic = fragment.topicHash;\n assertArgument(isHexString(topics[0], 32) && topics[0].toLowerCase() === eventTopic, \"fragment/topic mismatch\", \"topics[0]\", topics[0]);\n topics = topics.slice(1);\n }\n const indexed = [];\n const nonIndexed = [];\n const dynamic = [];\n fragment.inputs.forEach((param, index) => {\n if (param.indexed) {\n if (param.type === \"string\" || param.type === \"bytes\" || param.baseType === \"tuple\" || param.baseType === \"array\") {\n indexed.push(ParamType.from({ type: \"bytes32\", name: param.name }));\n dynamic.push(true);\n }\n else {\n indexed.push(param);\n dynamic.push(false);\n }\n }\n else {\n nonIndexed.push(param);\n dynamic.push(false);\n }\n });\n const resultIndexed = (topics != null) ? this.#abiCoder.decode(indexed, concat(topics)) : null;\n const resultNonIndexed = this.#abiCoder.decode(nonIndexed, data, true);\n //const result: (Array & { [ key: string ]: any }) = [ ];\n const values = [];\n const keys = [];\n let nonIndexedIndex = 0, indexedIndex = 0;\n fragment.inputs.forEach((param, index) => {\n let value = null;\n if (param.indexed) {\n if (resultIndexed == null) {\n value = new Indexed(null);\n }\n else if (dynamic[index]) {\n value = new Indexed(resultIndexed[indexedIndex++]);\n }\n else {\n try {\n value = resultIndexed[indexedIndex++];\n }\n catch (error) {\n value = error;\n }\n }\n }\n else {\n try {\n value = resultNonIndexed[nonIndexedIndex++];\n }\n catch (error) {\n value = error;\n }\n }\n values.push(value);\n keys.push(param.name || null);\n });\n return Result.fromItems(values, keys);\n }\n /**\n * Parses a transaction, finding the matching function and extracts\n * the parameter values along with other useful function details.\n *\n * If the matching function cannot be found, return null.\n */\n parseTransaction(tx) {\n const data = getBytes(tx.data, \"tx.data\");\n const value = getBigInt((tx.value != null) ? tx.value : 0, \"tx.value\");\n const fragment = this.getFunction(hexlify(data.slice(0, 4)));\n if (!fragment) {\n return null;\n }\n const args = this.#abiCoder.decode(fragment.inputs, data.slice(4));\n return new TransactionDescription(fragment, fragment.selector, args, value);\n }\n parseCallResult(data) {\n throw new Error(\"@TODO\");\n }\n /**\n * Parses a receipt log, finding the matching event and extracts\n * the parameter values along with other useful event details.\n *\n * If the matching event cannot be found, returns null.\n */\n parseLog(log) {\n const fragment = this.getEvent(log.topics[0]);\n if (!fragment || fragment.anonymous) {\n return null;\n }\n // @TODO: If anonymous, and the only method, and the input count matches, should we parse?\n // Probably not, because just because it is the only event in the ABI does\n // not mean we have the full ABI; maybe just a fragment?\n return new LogDescription(fragment, fragment.topicHash, this.decodeEventLog(fragment, log.data, log.topics));\n }\n /**\n * Parses a revert data, finding the matching error and extracts\n * the parameter values along with other useful error details.\n *\n * If the matching error cannot be found, returns null.\n */\n parseError(data) {\n const hexData = hexlify(data);\n const fragment = this.getError(dataSlice(hexData, 0, 4));\n if (!fragment) {\n return null;\n }\n const args = this.#abiCoder.decode(fragment.inputs, dataSlice(hexData, 4));\n return new ErrorDescription(fragment, fragment.selector, args);\n }\n /**\n * Creates a new [[Interface]] from the ABI %%value%%.\n *\n * The %%value%% may be provided as an existing [[Interface]] object,\n * a JSON-encoded ABI or any Human-Readable ABI format.\n */\n static from(value) {\n // Already an Interface, which is immutable\n if (value instanceof Interface) {\n return value;\n }\n // JSON\n if (typeof (value) === \"string\") {\n return new Interface(JSON.parse(value));\n }\n // An Interface; possibly from another v6 instance\n if (typeof (value.formatJson) === \"function\") {\n return new Interface(value.formatJson());\n }\n // A legacy Interface; from an older version\n if (typeof (value.format) === \"function\") {\n return new Interface(value.format(\"json\"));\n }\n // Array of fragments\n return new Interface(value);\n }\n}\n//# sourceMappingURL=interface.js.map","//import { resolveAddress } from \"@ethersproject/address\";\nimport { defineProperties, getBigInt, getNumber, hexlify, isBytesLike, resolveProperties, assert, assertArgument, isError, makeError } from \"../utils/index.js\";\nimport { accessListify } from \"../transaction/index.js\";\nconst BN_0 = BigInt(0);\n// -----------------------\nfunction getValue(value) {\n if (value == null) {\n return null;\n }\n return value;\n}\nfunction toJson(value) {\n if (value == null) {\n return null;\n }\n return value.toString();\n}\n// @TODO? implements Required\n/**\n * A **FeeData** wraps all the fee-related values associated with\n * the network.\n */\nexport class FeeData {\n /**\n * The gas price for legacy networks.\n */\n gasPrice;\n /**\n * The maximum fee to pay per gas.\n *\n * The base fee per gas is defined by the network and based on\n * congestion, increasing the cost during times of heavy load\n * and lowering when less busy.\n *\n * The actual fee per gas will be the base fee for the block\n * and the priority fee, up to the max fee per gas.\n *\n * This will be ``null`` on legacy networks (i.e. [pre-EIP-1559](link-eip-1559))\n */\n maxFeePerGas;\n /**\n * The additional amout to pay per gas to encourage a validator\n * to include the transaction.\n *\n * The purpose of this is to compensate the validator for the\n * adjusted risk for including a given transaction.\n *\n * This will be ``null`` on legacy networks (i.e. [pre-EIP-1559](link-eip-1559))\n */\n maxPriorityFeePerGas;\n /**\n * Creates a new FeeData for %%gasPrice%%, %%maxFeePerGas%% and\n * %%maxPriorityFeePerGas%%.\n */\n constructor(gasPrice, maxFeePerGas, maxPriorityFeePerGas) {\n defineProperties(this, {\n gasPrice: getValue(gasPrice),\n maxFeePerGas: getValue(maxFeePerGas),\n maxPriorityFeePerGas: getValue(maxPriorityFeePerGas)\n });\n }\n /**\n * Returns a JSON-friendly value.\n */\n toJSON() {\n const { gasPrice, maxFeePerGas, maxPriorityFeePerGas } = this;\n return {\n _type: \"FeeData\",\n gasPrice: toJson(gasPrice),\n maxFeePerGas: toJson(maxFeePerGas),\n maxPriorityFeePerGas: toJson(maxPriorityFeePerGas),\n };\n }\n}\n;\n/**\n * Returns a copy of %%req%% with all properties coerced to their strict\n * types.\n */\nexport function copyRequest(req) {\n const result = {};\n // These could be addresses, ENS names or Addressables\n if (req.to) {\n result.to = req.to;\n }\n if (req.from) {\n result.from = req.from;\n }\n if (req.data) {\n result.data = hexlify(req.data);\n }\n const bigIntKeys = \"chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value\".split(/,/);\n for (const key of bigIntKeys) {\n if (!(key in req) || req[key] == null) {\n continue;\n }\n result[key] = getBigInt(req[key], `request.${key}`);\n }\n const numberKeys = \"type,nonce\".split(/,/);\n for (const key of numberKeys) {\n if (!(key in req) || req[key] == null) {\n continue;\n }\n result[key] = getNumber(req[key], `request.${key}`);\n }\n if (req.accessList) {\n result.accessList = accessListify(req.accessList);\n }\n if (req.authorizationList) {\n result.authorizationList = req.authorizationList.slice();\n }\n if (\"blockTag\" in req) {\n result.blockTag = req.blockTag;\n }\n if (\"enableCcipRead\" in req) {\n result.enableCcipRead = !!req.enableCcipRead;\n }\n if (\"customData\" in req) {\n result.customData = req.customData;\n }\n if (\"blobVersionedHashes\" in req && req.blobVersionedHashes) {\n result.blobVersionedHashes = req.blobVersionedHashes.slice();\n }\n if (\"kzg\" in req) {\n result.kzg = req.kzg;\n }\n if (\"blobWrapperVersion\" in req) {\n result.blobWrapperVersion = req.blobWrapperVersion;\n }\n if (\"blobs\" in req && req.blobs) {\n result.blobs = req.blobs.map((b) => {\n if (isBytesLike(b)) {\n return hexlify(b);\n }\n return Object.assign({}, b);\n });\n }\n return result;\n}\n/**\n * A **Block** represents the data associated with a full block on\n * Ethereum.\n */\nexport class Block {\n /**\n * The provider connected to the block used to fetch additional details\n * if necessary.\n */\n provider;\n /**\n * The block number, sometimes called the block height. This is a\n * sequential number that is one higher than the parent block.\n */\n number;\n /**\n * The block hash.\n *\n * This hash includes all properties, so can be safely used to identify\n * an exact set of block properties.\n */\n hash;\n /**\n * The timestamp for this block, which is the number of seconds since\n * epoch that this block was included.\n */\n timestamp;\n /**\n * The block hash of the parent block.\n */\n parentHash;\n /**\n * The hash tree root of the parent beacon block for the given\n * execution block. See [[link-eip-4788]].\n */\n parentBeaconBlockRoot;\n /**\n * The nonce.\n *\n * On legacy networks, this is the random number inserted which\n * permitted the difficulty target to be reached.\n */\n nonce;\n /**\n * The difficulty target.\n *\n * On legacy networks, this is the proof-of-work target required\n * for a block to meet the protocol rules to be included.\n *\n * On modern networks, this is a random number arrived at using\n * randao. @TODO: Find links?\n */\n difficulty;\n /**\n * The total gas limit for this block.\n */\n gasLimit;\n /**\n * The total gas used in this block.\n */\n gasUsed;\n /**\n * The root hash for the global state after applying changes\n * in this block.\n */\n stateRoot;\n /**\n * The hash of the transaction receipts trie.\n */\n receiptsRoot;\n /**\n * The total amount of blob gas consumed by the transactions\n * within the block. See [[link-eip-4844]].\n */\n blobGasUsed;\n /**\n * The running total of blob gas consumed in excess of the\n * target, prior to the block. See [[link-eip-4844]].\n */\n excessBlobGas;\n /**\n * The miner coinbase address, wihch receives any subsidies for\n * including this block.\n */\n miner;\n /**\n * The latest RANDAO mix of the post beacon state of\n * the previous block.\n */\n prevRandao;\n /**\n * Any extra data the validator wished to include.\n */\n extraData;\n /**\n * The base fee per gas that all transactions in this block were\n * charged.\n *\n * This adjusts after each block, depending on how congested the network\n * is.\n */\n baseFeePerGas;\n #transactions;\n /**\n * Create a new **Block** object.\n *\n * This should generally not be necessary as the unless implementing a\n * low-level library.\n */\n constructor(block, provider) {\n this.#transactions = block.transactions.map((tx) => {\n if (typeof (tx) !== \"string\") {\n return new TransactionResponse(tx, provider);\n }\n return tx;\n });\n defineProperties(this, {\n provider,\n hash: getValue(block.hash),\n number: block.number,\n timestamp: block.timestamp,\n parentHash: block.parentHash,\n parentBeaconBlockRoot: block.parentBeaconBlockRoot,\n nonce: block.nonce,\n difficulty: block.difficulty,\n gasLimit: block.gasLimit,\n gasUsed: block.gasUsed,\n blobGasUsed: block.blobGasUsed,\n excessBlobGas: block.excessBlobGas,\n miner: block.miner,\n prevRandao: getValue(block.prevRandao),\n extraData: block.extraData,\n baseFeePerGas: getValue(block.baseFeePerGas),\n stateRoot: block.stateRoot,\n receiptsRoot: block.receiptsRoot,\n });\n }\n /**\n * Returns the list of transaction hashes, in the order\n * they were executed within the block.\n */\n get transactions() {\n return this.#transactions.map((tx) => {\n if (typeof (tx) === \"string\") {\n return tx;\n }\n return tx.hash;\n });\n }\n /**\n * Returns the complete transactions, in the order they\n * were executed within the block.\n *\n * This is only available for blocks which prefetched\n * transactions, by passing ``true`` to %%prefetchTxs%%\n * into [[Provider-getBlock]].\n */\n get prefetchedTransactions() {\n const txs = this.#transactions.slice();\n // Doesn't matter...\n if (txs.length === 0) {\n return [];\n }\n // Make sure we prefetched the transactions\n assert(typeof (txs[0]) === \"object\", \"transactions were not prefetched with block request\", \"UNSUPPORTED_OPERATION\", {\n operation: \"transactionResponses()\"\n });\n return txs;\n }\n /**\n * Returns a JSON-friendly value.\n */\n toJSON() {\n const { baseFeePerGas, difficulty, extraData, gasLimit, gasUsed, hash, miner, prevRandao, nonce, number, parentHash, parentBeaconBlockRoot, stateRoot, receiptsRoot, timestamp, transactions } = this;\n return {\n _type: \"Block\",\n baseFeePerGas: toJson(baseFeePerGas),\n difficulty: toJson(difficulty),\n extraData,\n gasLimit: toJson(gasLimit),\n gasUsed: toJson(gasUsed),\n blobGasUsed: toJson(this.blobGasUsed),\n excessBlobGas: toJson(this.excessBlobGas),\n hash, miner, prevRandao, nonce, number, parentHash, timestamp,\n parentBeaconBlockRoot, stateRoot, receiptsRoot,\n transactions,\n };\n }\n [Symbol.iterator]() {\n let index = 0;\n const txs = this.transactions;\n return {\n next: () => {\n if (index < this.length) {\n return {\n value: txs[index++], done: false\n };\n }\n return { value: undefined, done: true };\n }\n };\n }\n /**\n * The number of transactions in this block.\n */\n get length() { return this.#transactions.length; }\n /**\n * The [[link-js-date]] this block was included at.\n */\n get date() {\n if (this.timestamp == null) {\n return null;\n }\n return new Date(this.timestamp * 1000);\n }\n /**\n * Get the transaction at %%indexe%% within this block.\n */\n async getTransaction(indexOrHash) {\n // Find the internal value by its index or hash\n let tx = undefined;\n if (typeof (indexOrHash) === \"number\") {\n tx = this.#transactions[indexOrHash];\n }\n else {\n const hash = indexOrHash.toLowerCase();\n for (const v of this.#transactions) {\n if (typeof (v) === \"string\") {\n if (v !== hash) {\n continue;\n }\n tx = v;\n break;\n }\n else {\n if (v.hash !== hash) {\n continue;\n }\n tx = v;\n break;\n }\n }\n }\n if (tx == null) {\n throw new Error(\"no such tx\");\n }\n if (typeof (tx) === \"string\") {\n return (await this.provider.getTransaction(tx));\n }\n else {\n return tx;\n }\n }\n /**\n * If a **Block** was fetched with a request to include the transactions\n * this will allow synchronous access to those transactions.\n *\n * If the transactions were not prefetched, this will throw.\n */\n getPrefetchedTransaction(indexOrHash) {\n const txs = this.prefetchedTransactions;\n if (typeof (indexOrHash) === \"number\") {\n return txs[indexOrHash];\n }\n indexOrHash = indexOrHash.toLowerCase();\n for (const tx of txs) {\n if (tx.hash === indexOrHash) {\n return tx;\n }\n }\n assertArgument(false, \"no matching transaction\", \"indexOrHash\", indexOrHash);\n }\n /**\n * Returns true if this block been mined. This provides a type guard\n * for all properties on a [[MinedBlock]].\n */\n isMined() { return !!this.hash; }\n /**\n * Returns true if this block is an [[link-eip-2930]] block.\n */\n isLondon() {\n return !!this.baseFeePerGas;\n }\n /**\n * @_ignore:\n */\n orphanedEvent() {\n if (!this.isMined()) {\n throw new Error(\"\");\n }\n return createOrphanedBlockFilter(this);\n }\n}\n//////////////////////\n// Log\n/**\n * A **Log** in Ethereum represents an event that has been included in a\n * transaction using the ``LOG*`` opcodes, which are most commonly used by\n * Solidity's emit for announcing events.\n */\nexport class Log {\n /**\n * The provider connected to the log used to fetch additional details\n * if necessary.\n */\n provider;\n /**\n * The transaction hash of the transaction this log occurred in. Use the\n * [[Log-getTransaction]] to get the [[TransactionResponse]].\n */\n transactionHash;\n /**\n * The block hash of the block this log occurred in. Use the\n * [[Log-getBlock]] to get the [[Block]].\n */\n blockHash;\n /**\n * The block number of the block this log occurred in. It is preferred\n * to use the [[Block-hash]] when fetching the related [[Block]],\n * since in the case of an orphaned block, the block at that height may\n * have changed.\n */\n blockNumber;\n /**\n * If the **Log** represents a block that was removed due to an orphaned\n * block, this will be true.\n *\n * This can only happen within an orphan event listener.\n */\n removed;\n /**\n * The address of the contract that emitted this log.\n */\n address;\n /**\n * The data included in this log when it was emitted.\n */\n data;\n /**\n * The indexed topics included in this log when it was emitted.\n *\n * All topics are included in the bloom filters, so they can be\n * efficiently filtered using the [[Provider-getLogs]] method.\n */\n topics;\n /**\n * The index within the block this log occurred at. This is generally\n * not useful to developers, but can be used with the various roots\n * to proof inclusion within a block.\n */\n index;\n /**\n * The index within the transaction of this log.\n */\n transactionIndex;\n /**\n * @_ignore:\n */\n constructor(log, provider) {\n this.provider = provider;\n const topics = Object.freeze(log.topics.slice());\n defineProperties(this, {\n transactionHash: log.transactionHash,\n blockHash: log.blockHash,\n blockNumber: log.blockNumber,\n removed: log.removed,\n address: log.address,\n data: log.data,\n topics,\n index: log.index,\n transactionIndex: log.transactionIndex,\n });\n }\n /**\n * Returns a JSON-compatible object.\n */\n toJSON() {\n const { address, blockHash, blockNumber, data, index, removed, topics, transactionHash, transactionIndex } = this;\n return {\n _type: \"log\",\n address, blockHash, blockNumber, data, index,\n removed, topics, transactionHash, transactionIndex\n };\n }\n /**\n * Returns the block that this log occurred in.\n */\n async getBlock() {\n const block = await this.provider.getBlock(this.blockHash);\n assert(!!block, \"failed to find transaction\", \"UNKNOWN_ERROR\", {});\n return block;\n }\n /**\n * Returns the transaction that this log occurred in.\n */\n async getTransaction() {\n const tx = await this.provider.getTransaction(this.transactionHash);\n assert(!!tx, \"failed to find transaction\", \"UNKNOWN_ERROR\", {});\n return tx;\n }\n /**\n * Returns the transaction receipt fot the transaction that this\n * log occurred in.\n */\n async getTransactionReceipt() {\n const receipt = await this.provider.getTransactionReceipt(this.transactionHash);\n assert(!!receipt, \"failed to find transaction receipt\", \"UNKNOWN_ERROR\", {});\n return receipt;\n }\n /**\n * @_ignore:\n */\n removedEvent() {\n return createRemovedLogFilter(this);\n }\n}\n//////////////////////\n// Transaction Receipt\n/*\nexport interface LegacyTransactionReceipt {\n byzantium: false;\n status: null;\n root: string;\n}\n\nexport interface ByzantiumTransactionReceipt {\n byzantium: true;\n status: number;\n root: null;\n}\n*/\n/**\n * A **TransactionReceipt** includes additional information about a\n * transaction that is only available after it has been mined.\n */\nexport class TransactionReceipt {\n /**\n * The provider connected to the log used to fetch additional details\n * if necessary.\n */\n provider;\n /**\n * The address the transaction was sent to.\n */\n to;\n /**\n * The sender of the transaction.\n */\n from;\n /**\n * The address of the contract if the transaction was directly\n * responsible for deploying one.\n *\n * This is non-null **only** if the ``to`` is empty and the ``data``\n * was successfully executed as initcode.\n */\n contractAddress;\n /**\n * The transaction hash.\n */\n hash;\n /**\n * The index of this transaction within the block transactions.\n */\n index;\n /**\n * The block hash of the [[Block]] this transaction was included in.\n */\n blockHash;\n /**\n * The block number of the [[Block]] this transaction was included in.\n */\n blockNumber;\n /**\n * The bloom filter bytes that represent all logs that occurred within\n * this transaction. This is generally not useful for most developers,\n * but can be used to validate the included logs.\n */\n logsBloom;\n /**\n * The actual amount of gas used by this transaction.\n *\n * When creating a transaction, the amount of gas that will be used can\n * only be approximated, but the sender must pay the gas fee for the\n * entire gas limit. After the transaction, the difference is refunded.\n */\n gasUsed;\n /**\n * The gas used for BLObs. See [[link-eip-4844]].\n */\n blobGasUsed;\n /**\n * The amount of gas used by all transactions within the block for this\n * and all transactions with a lower ``index``.\n *\n * This is generally not useful for developers but can be used to\n * validate certain aspects of execution.\n */\n cumulativeGasUsed;\n /**\n * The actual gas price used during execution.\n *\n * Due to the complexity of [[link-eip-1559]] this value can only\n * be caluclated after the transaction has been mined, snce the base\n * fee is protocol-enforced.\n */\n gasPrice;\n /**\n * The price paid per BLOB in gas. See [[link-eip-4844]].\n */\n blobGasPrice;\n /**\n * The [[link-eip-2718]] transaction type.\n */\n type;\n //readonly byzantium!: boolean;\n /**\n * The status of this transaction, indicating success (i.e. ``1``) or\n * a revert (i.e. ``0``).\n *\n * This is available in post-byzantium blocks, but some backends may\n * backfill this value.\n */\n status;\n /**\n * The root hash of this transaction.\n *\n * This is no present and was only included in pre-byzantium blocks, but\n * could be used to validate certain parts of the receipt.\n */\n root;\n #logs;\n /**\n * @_ignore:\n */\n constructor(tx, provider) {\n this.#logs = Object.freeze(tx.logs.map((log) => {\n return new Log(log, provider);\n }));\n let gasPrice = BN_0;\n if (tx.effectiveGasPrice != null) {\n gasPrice = tx.effectiveGasPrice;\n }\n else if (tx.gasPrice != null) {\n gasPrice = tx.gasPrice;\n }\n defineProperties(this, {\n provider,\n to: tx.to,\n from: tx.from,\n contractAddress: tx.contractAddress,\n hash: tx.hash,\n index: tx.index,\n blockHash: tx.blockHash,\n blockNumber: tx.blockNumber,\n logsBloom: tx.logsBloom,\n gasUsed: tx.gasUsed,\n cumulativeGasUsed: tx.cumulativeGasUsed,\n blobGasUsed: tx.blobGasUsed,\n gasPrice,\n blobGasPrice: tx.blobGasPrice,\n type: tx.type,\n //byzantium: tx.byzantium,\n status: tx.status,\n root: tx.root\n });\n }\n /**\n * The logs for this transaction.\n */\n get logs() { return this.#logs; }\n /**\n * Returns a JSON-compatible representation.\n */\n toJSON() {\n const { to, from, contractAddress, hash, index, blockHash, blockNumber, logsBloom, logs, //byzantium, \n status, root } = this;\n return {\n _type: \"TransactionReceipt\",\n blockHash, blockNumber,\n //byzantium, \n contractAddress,\n cumulativeGasUsed: toJson(this.cumulativeGasUsed),\n from,\n gasPrice: toJson(this.gasPrice),\n blobGasUsed: toJson(this.blobGasUsed),\n blobGasPrice: toJson(this.blobGasPrice),\n gasUsed: toJson(this.gasUsed),\n hash, index, logs, logsBloom, root, status, to\n };\n }\n /**\n * @_ignore:\n */\n get length() { return this.logs.length; }\n [Symbol.iterator]() {\n let index = 0;\n return {\n next: () => {\n if (index < this.length) {\n return { value: this.logs[index++], done: false };\n }\n return { value: undefined, done: true };\n }\n };\n }\n /**\n * The total fee for this transaction, in wei.\n */\n get fee() {\n return this.gasUsed * this.gasPrice;\n }\n /**\n * Resolves to the block this transaction occurred in.\n */\n async getBlock() {\n const block = await this.provider.getBlock(this.blockHash);\n if (block == null) {\n throw new Error(\"TODO\");\n }\n return block;\n }\n /**\n * Resolves to the transaction this transaction occurred in.\n */\n async getTransaction() {\n const tx = await this.provider.getTransaction(this.hash);\n if (tx == null) {\n throw new Error(\"TODO\");\n }\n return tx;\n }\n /**\n * Resolves to the return value of the execution of this transaction.\n *\n * Support for this feature is limited, as it requires an archive node\n * with the ``debug_`` or ``trace_`` API enabled.\n */\n async getResult() {\n return (await this.provider.getTransactionResult(this.hash));\n }\n /**\n * Resolves to the number of confirmations this transaction has.\n */\n async confirmations() {\n return (await this.provider.getBlockNumber()) - this.blockNumber + 1;\n }\n /**\n * @_ignore:\n */\n removedEvent() {\n return createRemovedTransactionFilter(this);\n }\n /**\n * @_ignore:\n */\n reorderedEvent(other) {\n assert(!other || other.isMined(), \"unmined 'other' transction cannot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"reorderedEvent(other)\" });\n return createReorderedTransactionFilter(this, other);\n }\n}\n/**\n * A **TransactionResponse** includes all properties about a transaction\n * that was sent to the network, which may or may not be included in a\n * block.\n *\n * The [[TransactionResponse-isMined]] can be used to check if the\n * transaction has been mined as well as type guard that the otherwise\n * possibly ``null`` properties are defined.\n */\nexport class TransactionResponse {\n /**\n * The provider this is connected to, which will influence how its\n * methods will resolve its async inspection methods.\n */\n provider;\n /**\n * The block number of the block that this transaction was included in.\n *\n * This is ``null`` for pending transactions.\n */\n blockNumber;\n /**\n * The blockHash of the block that this transaction was included in.\n *\n * This is ``null`` for pending transactions.\n */\n blockHash;\n /**\n * The index within the block that this transaction resides at.\n */\n index;\n /**\n * The transaction hash.\n */\n hash;\n /**\n * The [[link-eip-2718]] transaction envelope type. This is\n * ``0`` for legacy transactions types.\n */\n type;\n /**\n * The receiver of this transaction.\n *\n * If ``null``, then the transaction is an initcode transaction.\n * This means the result of executing the [[data]] will be deployed\n * as a new contract on chain (assuming it does not revert) and the\n * address may be computed using [[getCreateAddress]].\n */\n to;\n /**\n * The sender of this transaction. It is implicitly computed\n * from the transaction pre-image hash (as the digest) and the\n * [[signature]] using ecrecover.\n */\n from;\n /**\n * The nonce, which is used to prevent replay attacks and offer\n * a method to ensure transactions from a given sender are explicitly\n * ordered.\n *\n * When sending a transaction, this must be equal to the number of\n * transactions ever sent by [[from]].\n */\n nonce;\n /**\n * The maximum units of gas this transaction can consume. If execution\n * exceeds this, the entries transaction is reverted and the sender\n * is charged for the full amount, despite not state changes being made.\n */\n gasLimit;\n /**\n * The gas price can have various values, depending on the network.\n *\n * In modern networks, for transactions that are included this is\n * the //effective gas price// (the fee per gas that was actually\n * charged), while for transactions that have not been included yet\n * is the [[maxFeePerGas]].\n *\n * For legacy transactions, or transactions on legacy networks, this\n * is the fee that will be charged per unit of gas the transaction\n * consumes.\n */\n gasPrice;\n /**\n * The maximum priority fee (per unit of gas) to allow a\n * validator to charge the sender. This is inclusive of the\n * [[maxFeeFeePerGas]].\n */\n maxPriorityFeePerGas;\n /**\n * The maximum fee (per unit of gas) to allow this transaction\n * to charge the sender.\n */\n maxFeePerGas;\n /**\n * The [[link-eip-4844]] max fee per BLOb gas.\n */\n maxFeePerBlobGas;\n /**\n * The data.\n */\n data;\n /**\n * The value, in wei. Use [[formatEther]] to format this value\n * as ether.\n */\n value;\n /**\n * The chain ID.\n */\n chainId;\n /**\n * The signature.\n */\n signature;\n /**\n * The [[link-eip-2930]] access list for transaction types that\n * support it, otherwise ``null``.\n */\n accessList;\n /**\n * The [[link-eip-4844]] BLOb versioned hashes.\n */\n blobVersionedHashes;\n /**\n * The [[link-eip-7702]] authorizations (if any).\n */\n authorizationList;\n #startBlock;\n /**\n * @_ignore:\n */\n constructor(tx, provider) {\n this.provider = provider;\n this.blockNumber = (tx.blockNumber != null) ? tx.blockNumber : null;\n this.blockHash = (tx.blockHash != null) ? tx.blockHash : null;\n this.hash = tx.hash;\n this.index = tx.index;\n this.type = tx.type;\n this.from = tx.from;\n this.to = tx.to || null;\n this.gasLimit = tx.gasLimit;\n this.nonce = tx.nonce;\n this.data = tx.data;\n this.value = tx.value;\n this.gasPrice = tx.gasPrice;\n this.maxPriorityFeePerGas = (tx.maxPriorityFeePerGas != null) ? tx.maxPriorityFeePerGas : null;\n this.maxFeePerGas = (tx.maxFeePerGas != null) ? tx.maxFeePerGas : null;\n this.maxFeePerBlobGas = (tx.maxFeePerBlobGas != null) ? tx.maxFeePerBlobGas : null;\n this.chainId = tx.chainId;\n this.signature = tx.signature;\n this.accessList = (tx.accessList != null) ? tx.accessList : null;\n this.blobVersionedHashes = (tx.blobVersionedHashes != null) ? tx.blobVersionedHashes : null;\n this.authorizationList = (tx.authorizationList != null) ? tx.authorizationList : null;\n this.#startBlock = -1;\n }\n /**\n * Returns a JSON-compatible representation of this transaction.\n */\n toJSON() {\n const { blockNumber, blockHash, index, hash, type, to, from, nonce, data, signature, accessList, blobVersionedHashes } = this;\n return {\n _type: \"TransactionResponse\",\n accessList, blockNumber, blockHash,\n blobVersionedHashes,\n chainId: toJson(this.chainId),\n data, from,\n gasLimit: toJson(this.gasLimit),\n gasPrice: toJson(this.gasPrice),\n hash,\n maxFeePerGas: toJson(this.maxFeePerGas),\n maxPriorityFeePerGas: toJson(this.maxPriorityFeePerGas),\n maxFeePerBlobGas: toJson(this.maxFeePerBlobGas),\n nonce, signature, to, index, type,\n value: toJson(this.value),\n };\n }\n /**\n * Resolves to the Block that this transaction was included in.\n *\n * This will return null if the transaction has not been included yet.\n */\n async getBlock() {\n let blockNumber = this.blockNumber;\n if (blockNumber == null) {\n const tx = await this.getTransaction();\n if (tx) {\n blockNumber = tx.blockNumber;\n }\n }\n if (blockNumber == null) {\n return null;\n }\n const block = this.provider.getBlock(blockNumber);\n if (block == null) {\n throw new Error(\"TODO\");\n }\n return block;\n }\n /**\n * Resolves to this transaction being re-requested from the\n * provider. This can be used if you have an unmined transaction\n * and wish to get an up-to-date populated instance.\n */\n async getTransaction() {\n return this.provider.getTransaction(this.hash);\n }\n /**\n * Resolve to the number of confirmations this transaction has.\n */\n async confirmations() {\n if (this.blockNumber == null) {\n const { tx, blockNumber } = await resolveProperties({\n tx: this.getTransaction(),\n blockNumber: this.provider.getBlockNumber()\n });\n // Not mined yet...\n if (tx == null || tx.blockNumber == null) {\n return 0;\n }\n return blockNumber - tx.blockNumber + 1;\n }\n const blockNumber = await this.provider.getBlockNumber();\n return blockNumber - this.blockNumber + 1;\n }\n /**\n * Resolves once this transaction has been mined and has\n * %%confirms%% blocks including it (default: ``1``) with an\n * optional %%timeout%%.\n *\n * This can resolve to ``null`` only if %%confirms%% is ``0``\n * and the transaction has not been mined, otherwise this will\n * wait until enough confirmations have completed.\n */\n async wait(_confirms, _timeout) {\n const confirms = (_confirms == null) ? 1 : _confirms;\n const timeout = (_timeout == null) ? 0 : _timeout;\n let startBlock = this.#startBlock;\n let nextScan = -1;\n let stopScanning = (startBlock === -1) ? true : false;\n const checkReplacement = async () => {\n // Get the current transaction count for this sender\n if (stopScanning) {\n return null;\n }\n const { blockNumber, nonce } = await resolveProperties({\n blockNumber: this.provider.getBlockNumber(),\n nonce: this.provider.getTransactionCount(this.from)\n });\n // No transaction or our nonce has not been mined yet; but we\n // can start scanning later when we do start\n if (nonce < this.nonce) {\n startBlock = blockNumber;\n return;\n }\n // We were mined; no replacement\n if (stopScanning) {\n return null;\n }\n const mined = await this.getTransaction();\n if (mined && mined.blockNumber != null) {\n return;\n }\n // We were replaced; start scanning for that transaction\n // Starting to scan; look back a few extra blocks for safety\n if (nextScan === -1) {\n nextScan = startBlock - 3;\n if (nextScan < this.#startBlock) {\n nextScan = this.#startBlock;\n }\n }\n while (nextScan <= blockNumber) {\n // Get the next block to scan\n if (stopScanning) {\n return null;\n }\n const block = await this.provider.getBlock(nextScan, true);\n // This should not happen; but we'll try again shortly\n if (block == null) {\n return;\n }\n // We were mined; no replacement\n for (const hash of block) {\n if (hash === this.hash) {\n return;\n }\n }\n // Search for the transaction that replaced us\n for (let i = 0; i < block.length; i++) {\n const tx = await block.getTransaction(i);\n if (tx.from === this.from && tx.nonce === this.nonce) {\n // Get the receipt\n if (stopScanning) {\n return null;\n }\n const receipt = await this.provider.getTransactionReceipt(tx.hash);\n // This should not happen; but we'll try again shortly\n if (receipt == null) {\n return;\n }\n // We will retry this on the next block (this case could be optimized)\n if ((blockNumber - receipt.blockNumber + 1) < confirms) {\n return;\n }\n // The reason we were replaced\n let reason = \"replaced\";\n if (tx.data === this.data && tx.to === this.to && tx.value === this.value) {\n reason = \"repriced\";\n }\n else if (tx.data === \"0x\" && tx.from === tx.to && tx.value === BN_0) {\n reason = \"cancelled\";\n }\n assert(false, \"transaction was replaced\", \"TRANSACTION_REPLACED\", {\n cancelled: (reason === \"replaced\" || reason === \"cancelled\"),\n reason,\n replacement: tx.replaceableTransaction(startBlock),\n hash: tx.hash,\n receipt\n });\n }\n }\n nextScan++;\n }\n return;\n };\n const checkReceipt = (receipt) => {\n if (receipt == null || receipt.status !== 0) {\n return receipt;\n }\n assert(false, \"transaction execution reverted\", \"CALL_EXCEPTION\", {\n action: \"sendTransaction\",\n data: null, reason: null, invocation: null, revert: null,\n transaction: {\n to: receipt.to,\n from: receipt.from,\n data: \"\" // @TODO: in v7, split out sendTransaction properties\n }, receipt\n });\n };\n const receipt = await this.provider.getTransactionReceipt(this.hash);\n if (confirms === 0) {\n return checkReceipt(receipt);\n }\n if (receipt) {\n if (confirms === 1 || (await receipt.confirmations()) >= confirms) {\n return checkReceipt(receipt);\n }\n }\n else {\n // Check for a replacement; throws if a replacement was found\n await checkReplacement();\n // Allow null only when the confirms is 0\n if (confirms === 0) {\n return null;\n }\n }\n const waiter = new Promise((resolve, reject) => {\n // List of things to cancel when we have a result (one way or the other)\n const cancellers = [];\n const cancel = () => { cancellers.forEach((c) => c()); };\n // On cancel, stop scanning for replacements\n cancellers.push(() => { stopScanning = true; });\n // Set up any timeout requested\n if (timeout > 0) {\n const timer = setTimeout(() => {\n cancel();\n reject(makeError(\"wait for transaction timeout\", \"TIMEOUT\"));\n }, timeout);\n cancellers.push(() => { clearTimeout(timer); });\n }\n const txListener = async (receipt) => {\n // Done; return it!\n if ((await receipt.confirmations()) >= confirms) {\n cancel();\n try {\n resolve(checkReceipt(receipt));\n }\n catch (error) {\n reject(error);\n }\n }\n };\n cancellers.push(() => { this.provider.off(this.hash, txListener); });\n this.provider.on(this.hash, txListener);\n // We support replacement detection; start checking\n if (startBlock >= 0) {\n const replaceListener = async () => {\n try {\n // Check for a replacement; this throws only if one is found\n await checkReplacement();\n }\n catch (error) {\n // We were replaced (with enough confirms); re-throw the error\n if (isError(error, \"TRANSACTION_REPLACED\")) {\n cancel();\n reject(error);\n return;\n }\n }\n // Rescheudle a check on the next block\n if (!stopScanning) {\n this.provider.once(\"block\", replaceListener);\n }\n };\n cancellers.push(() => { this.provider.off(\"block\", replaceListener); });\n this.provider.once(\"block\", replaceListener);\n }\n });\n return await waiter;\n }\n /**\n * Returns ``true`` if this transaction has been included.\n *\n * This is effective only as of the time the TransactionResponse\n * was instantiated. To get up-to-date information, use\n * [[getTransaction]].\n *\n * This provides a Type Guard that this transaction will have\n * non-null property values for properties that are null for\n * unmined transactions.\n */\n isMined() {\n return (this.blockHash != null);\n }\n /**\n * Returns true if the transaction is a legacy (i.e. ``type == 0``)\n * transaction.\n *\n * This provides a Type Guard that this transaction will have\n * the ``null``-ness for hardfork-specific properties set correctly.\n */\n isLegacy() {\n return (this.type === 0);\n }\n /**\n * Returns true if the transaction is a Berlin (i.e. ``type == 1``)\n * transaction. See [[link-eip-2070]].\n *\n * This provides a Type Guard that this transaction will have\n * the ``null``-ness for hardfork-specific properties set correctly.\n */\n isBerlin() {\n return (this.type === 1);\n }\n /**\n * Returns true if the transaction is a London (i.e. ``type == 2``)\n * transaction. See [[link-eip-1559]].\n *\n * This provides a Type Guard that this transaction will have\n * the ``null``-ness for hardfork-specific properties set correctly.\n */\n isLondon() {\n return (this.type === 2);\n }\n /**\n * Returns true if hte transaction is a Cancun (i.e. ``type == 3``)\n * transaction. See [[link-eip-4844]].\n */\n isCancun() {\n return (this.type === 3);\n }\n /**\n * Returns a filter which can be used to listen for orphan events\n * that evict this transaction.\n */\n removedEvent() {\n assert(this.isMined(), \"unmined transaction canot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"removeEvent()\" });\n return createRemovedTransactionFilter(this);\n }\n /**\n * Returns a filter which can be used to listen for orphan events\n * that re-order this event against %%other%%.\n */\n reorderedEvent(other) {\n assert(this.isMined(), \"unmined transaction canot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"removeEvent()\" });\n assert(!other || other.isMined(), \"unmined 'other' transaction canot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"removeEvent()\" });\n return createReorderedTransactionFilter(this, other);\n }\n /**\n * Returns a new TransactionResponse instance which has the ability to\n * detect (and throw an error) if the transaction is replaced, which\n * will begin scanning at %%startBlock%%.\n *\n * This should generally not be used by developers and is intended\n * primarily for internal use. Setting an incorrect %%startBlock%% can\n * have devastating performance consequences if used incorrectly.\n */\n replaceableTransaction(startBlock) {\n assertArgument(Number.isInteger(startBlock) && startBlock >= 0, \"invalid startBlock\", \"startBlock\", startBlock);\n const tx = new TransactionResponse(this, this.provider);\n tx.#startBlock = startBlock;\n return tx;\n }\n}\nfunction createOrphanedBlockFilter(block) {\n return { orphan: \"drop-block\", hash: block.hash, number: block.number };\n}\nfunction createReorderedTransactionFilter(tx, other) {\n return { orphan: \"reorder-transaction\", tx, other };\n}\nfunction createRemovedTransactionFilter(tx) {\n return { orphan: \"drop-transaction\", tx };\n}\nfunction createRemovedLogFilter(log) {\n return { orphan: \"drop-log\", log: {\n transactionHash: log.transactionHash,\n blockHash: log.blockHash,\n blockNumber: log.blockNumber,\n address: log.address,\n data: log.data,\n topics: Object.freeze(log.topics.slice()),\n index: log.index\n } };\n}\n//# sourceMappingURL=provider.js.map","// import from provider.ts instead of index.ts to prevent circular dep\n// from EtherscanProvider\nimport { Log, TransactionReceipt, TransactionResponse } from \"../providers/provider.js\";\nimport { defineProperties, EventPayload } from \"../utils/index.js\";\n/**\n * An **EventLog** contains additional properties parsed from the [[Log]].\n */\nexport class EventLog extends Log {\n /**\n * The Contract Interface.\n */\n interface;\n /**\n * The matching event.\n */\n fragment;\n /**\n * The parsed arguments passed to the event by ``emit``.\n */\n args;\n /**\n * @_ignore:\n */\n constructor(log, iface, fragment) {\n super(log, log.provider);\n const args = iface.decodeEventLog(fragment, log.data, log.topics);\n defineProperties(this, { args, fragment, interface: iface });\n }\n /**\n * The name of the event.\n */\n get eventName() { return this.fragment.name; }\n /**\n * The signature of the event.\n */\n get eventSignature() { return this.fragment.format(); }\n}\n/**\n * An **EventLog** contains additional properties parsed from the [[Log]].\n */\nexport class UndecodedEventLog extends Log {\n /**\n * The error encounted when trying to decode the log.\n */\n error;\n /**\n * @_ignore:\n */\n constructor(log, error) {\n super(log, log.provider);\n defineProperties(this, { error });\n }\n}\n/**\n * A **ContractTransactionReceipt** includes the parsed logs from a\n * [[TransactionReceipt]].\n */\nexport class ContractTransactionReceipt extends TransactionReceipt {\n #iface;\n /**\n * @_ignore:\n */\n constructor(iface, provider, tx) {\n super(tx, provider);\n this.#iface = iface;\n }\n /**\n * The parsed logs for any [[Log]] which has a matching event in the\n * Contract ABI.\n */\n get logs() {\n return super.logs.map((log) => {\n const fragment = log.topics.length ? this.#iface.getEvent(log.topics[0]) : null;\n if (fragment) {\n try {\n return new EventLog(log, this.#iface, fragment);\n }\n catch (error) {\n return new UndecodedEventLog(log, error);\n }\n }\n return log;\n });\n }\n}\n/**\n * A **ContractTransactionResponse** will return a\n * [[ContractTransactionReceipt]] when waited on.\n */\nexport class ContractTransactionResponse extends TransactionResponse {\n #iface;\n /**\n * @_ignore:\n */\n constructor(iface, provider, tx) {\n super(tx, provider);\n this.#iface = iface;\n }\n /**\n * Resolves once this transaction has been mined and has\n * %%confirms%% blocks including it (default: ``1``) with an\n * optional %%timeout%%.\n *\n * This can resolve to ``null`` only if %%confirms%% is ``0``\n * and the transaction has not been mined, otherwise this will\n * wait until enough confirmations have completed.\n */\n async wait(confirms, timeout) {\n const receipt = await super.wait(confirms, timeout);\n if (receipt == null) {\n return null;\n }\n return new ContractTransactionReceipt(this.#iface, this.provider, receipt);\n }\n}\n/**\n * A **ContractUnknownEventPayload** is included as the last parameter to\n * Contract Events when the event does not match any events in the ABI.\n */\nexport class ContractUnknownEventPayload extends EventPayload {\n /**\n * The log with no matching events.\n */\n log;\n /**\n * @_event:\n */\n constructor(contract, listener, filter, log) {\n super(contract, listener, filter);\n defineProperties(this, { log });\n }\n /**\n * Resolves to the block the event occured in.\n */\n async getBlock() {\n return await this.log.getBlock();\n }\n /**\n * Resolves to the transaction the event occured in.\n */\n async getTransaction() {\n return await this.log.getTransaction();\n }\n /**\n * Resolves to the transaction receipt the event occured in.\n */\n async getTransactionReceipt() {\n return await this.log.getTransactionReceipt();\n }\n}\n/**\n * A **ContractEventPayload** is included as the last parameter to\n * Contract Events when the event is known.\n */\nexport class ContractEventPayload extends ContractUnknownEventPayload {\n /**\n * @_ignore:\n */\n constructor(contract, listener, filter, fragment, _log) {\n super(contract, listener, filter, new EventLog(_log, contract.interface, fragment));\n const args = contract.interface.decodeEventLog(fragment, this.log.data, this.log.topics);\n defineProperties(this, { args, fragment });\n }\n /**\n * The event name.\n */\n get eventName() {\n return this.fragment.name;\n }\n /**\n * The event signature.\n */\n get eventSignature() {\n return this.fragment.format();\n }\n}\n//# sourceMappingURL=wrappers.js.map","import { Interface, Typed } from \"../abi/index.js\";\nimport { isAddressable, resolveAddress } from \"../address/index.js\";\n// import from provider.ts instead of index.ts to prevent circular dep\n// from EtherscanProvider\nimport { copyRequest, Log } from \"../providers/provider.js\";\nimport { defineProperties, getBigInt, isCallException, isHexString, resolveProperties, isError, makeError, assert, assertArgument } from \"../utils/index.js\";\nimport { ContractEventPayload, ContractUnknownEventPayload, ContractTransactionResponse, EventLog, UndecodedEventLog } from \"./wrappers.js\";\nconst BN_0 = BigInt(0);\nfunction canCall(value) {\n return (value && typeof (value.call) === \"function\");\n}\nfunction canEstimate(value) {\n return (value && typeof (value.estimateGas) === \"function\");\n}\nfunction canResolve(value) {\n return (value && typeof (value.resolveName) === \"function\");\n}\nfunction canSend(value) {\n return (value && typeof (value.sendTransaction) === \"function\");\n}\nfunction getResolver(value) {\n if (value != null) {\n if (canResolve(value)) {\n return value;\n }\n if (value.provider) {\n return value.provider;\n }\n }\n return undefined;\n}\nclass PreparedTopicFilter {\n #filter;\n fragment;\n constructor(contract, fragment, args) {\n defineProperties(this, { fragment });\n if (fragment.inputs.length < args.length) {\n throw new Error(\"too many arguments\");\n }\n // Recursively descend into args and resolve any addresses\n const runner = getRunner(contract.runner, \"resolveName\");\n const resolver = canResolve(runner) ? runner : null;\n this.#filter = (async function () {\n const resolvedArgs = await Promise.all(fragment.inputs.map((param, index) => {\n const arg = args[index];\n if (arg == null) {\n return null;\n }\n return param.walkAsync(args[index], (type, value) => {\n if (type === \"address\") {\n if (Array.isArray(value)) {\n return Promise.all(value.map((v) => resolveAddress(v, resolver)));\n }\n return resolveAddress(value, resolver);\n }\n return value;\n });\n }));\n return contract.interface.encodeFilterTopics(fragment, resolvedArgs);\n })();\n }\n getTopicFilter() {\n return this.#filter;\n }\n}\n// A = Arguments passed in as a tuple\n// R = The result type of the call (i.e. if only one return type,\n// the qualified type, otherwise Result)\n// D = The type the default call will return (i.e. R for view/pure,\n// TransactionResponse otherwise)\n//export interface ContractMethod = Array, R = any, D extends R | ContractTransactionResponse = ContractTransactionResponse> {\nfunction getRunner(value, feature) {\n if (value == null) {\n return null;\n }\n if (typeof (value[feature]) === \"function\") {\n return value;\n }\n if (value.provider && typeof (value.provider[feature]) === \"function\") {\n return value.provider;\n }\n return null;\n}\nfunction getProvider(value) {\n if (value == null) {\n return null;\n }\n return value.provider || null;\n}\n/**\n * @_ignore:\n */\nexport async function copyOverrides(arg, allowed) {\n // Make sure the overrides passed in are a valid overrides object\n const _overrides = Typed.dereference(arg, \"overrides\");\n assertArgument(typeof (_overrides) === \"object\", \"invalid overrides parameter\", \"overrides\", arg);\n // Create a shallow copy (we'll deep-ify anything needed during normalizing)\n const overrides = copyRequest(_overrides);\n assertArgument(overrides.to == null || (allowed || []).indexOf(\"to\") >= 0, \"cannot override to\", \"overrides.to\", overrides.to);\n assertArgument(overrides.data == null || (allowed || []).indexOf(\"data\") >= 0, \"cannot override data\", \"overrides.data\", overrides.data);\n // Resolve any from\n if (overrides.from) {\n overrides.from = overrides.from;\n }\n return overrides;\n}\n/**\n * @_ignore:\n */\nexport async function resolveArgs(_runner, inputs, args) {\n // Recursively descend into args and resolve any addresses\n const runner = getRunner(_runner, \"resolveName\");\n const resolver = canResolve(runner) ? runner : null;\n return await Promise.all(inputs.map((param, index) => {\n return param.walkAsync(args[index], (type, value) => {\n value = Typed.dereference(value, type);\n if (type === \"address\") {\n return resolveAddress(value, resolver);\n }\n return value;\n });\n }));\n}\nfunction buildWrappedFallback(contract) {\n const populateTransaction = async function (overrides) {\n // If an overrides was passed in, copy it and normalize the values\n const tx = (await copyOverrides(overrides, [\"data\"]));\n tx.to = await contract.getAddress();\n if (tx.from) {\n tx.from = await resolveAddress(tx.from, getResolver(contract.runner));\n }\n const iface = contract.interface;\n const noValue = (getBigInt((tx.value || BN_0), \"overrides.value\") === BN_0);\n const noData = ((tx.data || \"0x\") === \"0x\");\n if (iface.fallback && !iface.fallback.payable && iface.receive && !noData && !noValue) {\n assertArgument(false, \"cannot send data to receive or send value to non-payable fallback\", \"overrides\", overrides);\n }\n assertArgument(iface.fallback || noData, \"cannot send data to receive-only contract\", \"overrides.data\", tx.data);\n // Only allow payable contracts to set non-zero value\n const payable = iface.receive || (iface.fallback && iface.fallback.payable);\n assertArgument(payable || noValue, \"cannot send value to non-payable fallback\", \"overrides.value\", tx.value);\n // Only allow fallback contracts to set non-empty data\n assertArgument(iface.fallback || noData, \"cannot send data to receive-only contract\", \"overrides.data\", tx.data);\n return tx;\n };\n const staticCall = async function (overrides) {\n const runner = getRunner(contract.runner, \"call\");\n assert(canCall(runner), \"contract runner does not support calling\", \"UNSUPPORTED_OPERATION\", { operation: \"call\" });\n const tx = await populateTransaction(overrides);\n try {\n return await runner.call(tx);\n }\n catch (error) {\n if (isCallException(error) && error.data) {\n throw contract.interface.makeError(error.data, tx);\n }\n throw error;\n }\n };\n const send = async function (overrides) {\n const runner = contract.runner;\n assert(canSend(runner), \"contract runner does not support sending transactions\", \"UNSUPPORTED_OPERATION\", { operation: \"sendTransaction\" });\n const tx = await runner.sendTransaction(await populateTransaction(overrides));\n const provider = getProvider(contract.runner);\n // @TODO: the provider can be null; make a custom dummy provider that will throw a\n // meaningful error\n return new ContractTransactionResponse(contract.interface, provider, tx);\n };\n const estimateGas = async function (overrides) {\n const runner = getRunner(contract.runner, \"estimateGas\");\n assert(canEstimate(runner), \"contract runner does not support gas estimation\", \"UNSUPPORTED_OPERATION\", { operation: \"estimateGas\" });\n return await runner.estimateGas(await populateTransaction(overrides));\n };\n const method = async (overrides) => {\n return await send(overrides);\n };\n defineProperties(method, {\n _contract: contract,\n estimateGas,\n populateTransaction,\n send, staticCall\n });\n return method;\n}\nfunction buildWrappedMethod(contract, key) {\n const getFragment = function (...args) {\n const fragment = contract.interface.getFunction(key, args);\n assert(fragment, \"no matching fragment\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n info: { key, args }\n });\n return fragment;\n };\n const populateTransaction = async function (...args) {\n const fragment = getFragment(...args);\n // If an overrides was passed in, copy it and normalize the values\n let overrides = {};\n if (fragment.inputs.length + 1 === args.length) {\n overrides = await copyOverrides(args.pop());\n if (overrides.from) {\n overrides.from = await resolveAddress(overrides.from, getResolver(contract.runner));\n }\n }\n if (fragment.inputs.length !== args.length) {\n throw new Error(\"internal error: fragment inputs doesn't match arguments; should not happen\");\n }\n const resolvedArgs = await resolveArgs(contract.runner, fragment.inputs, args);\n return Object.assign({}, overrides, await resolveProperties({\n to: contract.getAddress(),\n data: contract.interface.encodeFunctionData(fragment, resolvedArgs)\n }));\n };\n const staticCall = async function (...args) {\n const result = await staticCallResult(...args);\n if (result.length === 1) {\n return result[0];\n }\n return result;\n };\n const send = async function (...args) {\n const runner = contract.runner;\n assert(canSend(runner), \"contract runner does not support sending transactions\", \"UNSUPPORTED_OPERATION\", { operation: \"sendTransaction\" });\n const tx = await runner.sendTransaction(await populateTransaction(...args));\n const provider = getProvider(contract.runner);\n // @TODO: the provider can be null; make a custom dummy provider that will throw a\n // meaningful error\n return new ContractTransactionResponse(contract.interface, provider, tx);\n };\n const estimateGas = async function (...args) {\n const runner = getRunner(contract.runner, \"estimateGas\");\n assert(canEstimate(runner), \"contract runner does not support gas estimation\", \"UNSUPPORTED_OPERATION\", { operation: \"estimateGas\" });\n return await runner.estimateGas(await populateTransaction(...args));\n };\n const staticCallResult = async function (...args) {\n const runner = getRunner(contract.runner, \"call\");\n assert(canCall(runner), \"contract runner does not support calling\", \"UNSUPPORTED_OPERATION\", { operation: \"call\" });\n const tx = await populateTransaction(...args);\n let result = \"0x\";\n try {\n result = await runner.call(tx);\n }\n catch (error) {\n if (isCallException(error) && error.data) {\n throw contract.interface.makeError(error.data, tx);\n }\n throw error;\n }\n const fragment = getFragment(...args);\n return contract.interface.decodeFunctionResult(fragment, result);\n };\n const method = async (...args) => {\n const fragment = getFragment(...args);\n if (fragment.constant) {\n return await staticCall(...args);\n }\n return await send(...args);\n };\n defineProperties(method, {\n name: contract.interface.getFunctionName(key),\n _contract: contract, _key: key,\n getFragment,\n estimateGas,\n populateTransaction,\n send, staticCall, staticCallResult,\n });\n // Only works on non-ambiguous keys (refined fragment is always non-ambiguous)\n Object.defineProperty(method, \"fragment\", {\n configurable: false,\n enumerable: true,\n get: () => {\n const fragment = contract.interface.getFunction(key);\n assert(fragment, \"no matching fragment\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n info: { key }\n });\n return fragment;\n }\n });\n return method;\n}\nfunction buildWrappedEvent(contract, key) {\n const getFragment = function (...args) {\n const fragment = contract.interface.getEvent(key, args);\n assert(fragment, \"no matching fragment\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n info: { key, args }\n });\n return fragment;\n };\n const method = function (...args) {\n return new PreparedTopicFilter(contract, getFragment(...args), args);\n };\n defineProperties(method, {\n name: contract.interface.getEventName(key),\n _contract: contract, _key: key,\n getFragment\n });\n // Only works on non-ambiguous keys (refined fragment is always non-ambiguous)\n Object.defineProperty(method, \"fragment\", {\n configurable: false,\n enumerable: true,\n get: () => {\n const fragment = contract.interface.getEvent(key);\n assert(fragment, \"no matching fragment\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n info: { key }\n });\n return fragment;\n }\n });\n return method;\n}\n// The combination of TypeScrype, Private Fields and Proxies makes\n// the world go boom; so we hide variables with some trickery keeping\n// a symbol attached to each BaseContract which its sub-class (even\n// via a Proxy) can reach and use to look up its internal values.\nconst internal = Symbol.for(\"_ethersInternal_contract\");\nconst internalValues = new WeakMap();\nfunction setInternal(contract, values) {\n internalValues.set(contract[internal], values);\n}\nfunction getInternal(contract) {\n return internalValues.get(contract[internal]);\n}\nfunction isDeferred(value) {\n return (value && typeof (value) === \"object\" && (\"getTopicFilter\" in value) &&\n (typeof (value.getTopicFilter) === \"function\") && value.fragment);\n}\nasync function getSubInfo(contract, event) {\n let topics;\n let fragment = null;\n // Convert named events to topicHash and get the fragment for\n // events which need deconstructing.\n if (Array.isArray(event)) {\n const topicHashify = function (name) {\n if (isHexString(name, 32)) {\n return name;\n }\n const fragment = contract.interface.getEvent(name);\n assertArgument(fragment, \"unknown fragment\", \"name\", name);\n return fragment.topicHash;\n };\n // Array of Topics and Names; e.g. `[ \"0x1234...89ab\", \"Transfer(address)\" ]`\n topics = event.map((e) => {\n if (e == null) {\n return null;\n }\n if (Array.isArray(e)) {\n return e.map(topicHashify);\n }\n return topicHashify(e);\n });\n }\n else if (event === \"*\") {\n topics = [null];\n }\n else if (typeof (event) === \"string\") {\n if (isHexString(event, 32)) {\n // Topic Hash\n topics = [event];\n }\n else {\n // Name or Signature; e.g. `\"Transfer\", `\"Transfer(address)\"`\n fragment = contract.interface.getEvent(event);\n assertArgument(fragment, \"unknown fragment\", \"event\", event);\n topics = [fragment.topicHash];\n }\n }\n else if (isDeferred(event)) {\n // Deferred Topic Filter; e.g. `contract.filter.Transfer(from)`\n topics = await event.getTopicFilter();\n }\n else if (\"fragment\" in event) {\n // ContractEvent; e.g. `contract.filter.Transfer`\n fragment = event.fragment;\n topics = [fragment.topicHash];\n }\n else {\n assertArgument(false, \"unknown event name\", \"event\", event);\n }\n // Normalize topics and sort TopicSets\n topics = topics.map((t) => {\n if (t == null) {\n return null;\n }\n if (Array.isArray(t)) {\n const items = Array.from(new Set(t.map((t) => t.toLowerCase())).values());\n if (items.length === 1) {\n return items[0];\n }\n items.sort();\n return items;\n }\n return t.toLowerCase();\n });\n const tag = topics.map((t) => {\n if (t == null) {\n return \"null\";\n }\n if (Array.isArray(t)) {\n return t.join(\"|\");\n }\n return t;\n }).join(\"&\");\n return { fragment, tag, topics };\n}\nasync function hasSub(contract, event) {\n const { subs } = getInternal(contract);\n return subs.get((await getSubInfo(contract, event)).tag) || null;\n}\nasync function getSub(contract, operation, event) {\n // Make sure our runner can actually subscribe to events\n const provider = getProvider(contract.runner);\n assert(provider, \"contract runner does not support subscribing\", \"UNSUPPORTED_OPERATION\", { operation });\n const { fragment, tag, topics } = await getSubInfo(contract, event);\n const { addr, subs } = getInternal(contract);\n let sub = subs.get(tag);\n if (!sub) {\n const address = (addr ? addr : contract);\n const filter = { address, topics };\n const listener = (log) => {\n let foundFragment = fragment;\n if (foundFragment == null) {\n try {\n foundFragment = contract.interface.getEvent(log.topics[0]);\n }\n catch (error) { }\n }\n // If fragment is null, we do not deconstruct the args to emit\n if (foundFragment) {\n const _foundFragment = foundFragment;\n const args = fragment ? contract.interface.decodeEventLog(fragment, log.data, log.topics) : [];\n emit(contract, event, args, (listener) => {\n return new ContractEventPayload(contract, listener, event, _foundFragment, log);\n });\n }\n else {\n emit(contract, event, [], (listener) => {\n return new ContractUnknownEventPayload(contract, listener, event, log);\n });\n }\n };\n let starting = [];\n const start = () => {\n if (starting.length) {\n return;\n }\n starting.push(provider.on(filter, listener));\n };\n const stop = async () => {\n if (starting.length == 0) {\n return;\n }\n let started = starting;\n starting = [];\n await Promise.all(started);\n provider.off(filter, listener);\n };\n sub = { tag, listeners: [], start, stop };\n subs.set(tag, sub);\n }\n return sub;\n}\n// We use this to ensure one emit resolves before firing the next to\n// ensure correct ordering (note this cannot throw and just adds the\n// notice to the event queu using setTimeout).\nlet lastEmit = Promise.resolve();\nasync function _emit(contract, event, args, payloadFunc) {\n await lastEmit;\n const sub = await hasSub(contract, event);\n if (!sub) {\n return false;\n }\n const count = sub.listeners.length;\n sub.listeners = sub.listeners.filter(({ listener, once }) => {\n const passArgs = Array.from(args);\n if (payloadFunc) {\n passArgs.push(payloadFunc(once ? null : listener));\n }\n try {\n listener.call(contract, ...passArgs);\n }\n catch (error) { }\n return !once;\n });\n if (sub.listeners.length === 0) {\n sub.stop();\n getInternal(contract).subs.delete(sub.tag);\n }\n return (count > 0);\n}\nasync function emit(contract, event, args, payloadFunc) {\n try {\n await lastEmit;\n }\n catch (error) { }\n const resultPromise = _emit(contract, event, args, payloadFunc);\n lastEmit = resultPromise;\n return await resultPromise;\n}\nconst passProperties = [\"then\"];\nexport class BaseContract {\n /**\n * The target to connect to.\n *\n * This can be an address, ENS name or any [[Addressable]], such as\n * another contract. To get the resolved address, use the ``getAddress``\n * method.\n */\n target;\n /**\n * The contract Interface.\n */\n interface;\n /**\n * The connected runner. This is generally a [[Provider]] or a\n * [[Signer]], which dictates what operations are supported.\n *\n * For example, a **Contract** connected to a [[Provider]] may\n * only execute read-only operations.\n */\n runner;\n /**\n * All the Events available on this contract.\n */\n filters;\n /**\n * @_ignore:\n */\n [internal];\n /**\n * The fallback or receive function if any.\n */\n fallback;\n /**\n * Creates a new contract connected to %%target%% with the %%abi%% and\n * optionally connected to a %%runner%% to perform operations on behalf\n * of.\n */\n constructor(target, abi, runner, _deployTx) {\n assertArgument(typeof (target) === \"string\" || isAddressable(target), \"invalid value for Contract target\", \"target\", target);\n if (runner == null) {\n runner = null;\n }\n const iface = Interface.from(abi);\n defineProperties(this, { target, runner, interface: iface });\n Object.defineProperty(this, internal, { value: {} });\n let addrPromise;\n let addr = null;\n let deployTx = null;\n if (_deployTx) {\n const provider = getProvider(runner);\n // @TODO: the provider can be null; make a custom dummy provider that will throw a\n // meaningful error\n deployTx = new ContractTransactionResponse(this.interface, provider, _deployTx);\n }\n let subs = new Map();\n // Resolve the target as the address\n if (typeof (target) === \"string\") {\n if (isHexString(target)) {\n addr = target;\n addrPromise = Promise.resolve(target);\n }\n else {\n const resolver = getRunner(runner, \"resolveName\");\n if (!canResolve(resolver)) {\n throw makeError(\"contract runner does not support name resolution\", \"UNSUPPORTED_OPERATION\", {\n operation: \"resolveName\"\n });\n }\n addrPromise = resolver.resolveName(target).then((addr) => {\n if (addr == null) {\n throw makeError(\"an ENS name used for a contract target must be correctly configured\", \"UNCONFIGURED_NAME\", {\n value: target\n });\n }\n getInternal(this).addr = addr;\n return addr;\n });\n }\n }\n else {\n addrPromise = target.getAddress().then((addr) => {\n if (addr == null) {\n throw new Error(\"TODO\");\n }\n getInternal(this).addr = addr;\n return addr;\n });\n }\n // Set our private values\n setInternal(this, { addrPromise, addr, deployTx, subs });\n // Add the event filters\n const filters = new Proxy({}, {\n get: (target, prop, receiver) => {\n // Pass important checks (like `then` for Promise) through\n if (typeof (prop) === \"symbol\" || passProperties.indexOf(prop) >= 0) {\n return Reflect.get(target, prop, receiver);\n }\n try {\n return this.getEvent(prop);\n }\n catch (error) {\n if (!isError(error, \"INVALID_ARGUMENT\") || error.argument !== \"key\") {\n throw error;\n }\n }\n return undefined;\n },\n has: (target, prop) => {\n // Pass important checks (like `then` for Promise) through\n if (passProperties.indexOf(prop) >= 0) {\n return Reflect.has(target, prop);\n }\n return Reflect.has(target, prop) || this.interface.hasEvent(String(prop));\n }\n });\n defineProperties(this, { filters });\n defineProperties(this, {\n fallback: ((iface.receive || iface.fallback) ? (buildWrappedFallback(this)) : null)\n });\n // Return a Proxy that will respond to functions\n return new Proxy(this, {\n get: (target, prop, receiver) => {\n if (typeof (prop) === \"symbol\" || prop in target || passProperties.indexOf(prop) >= 0) {\n return Reflect.get(target, prop, receiver);\n }\n // Undefined properties should return undefined\n try {\n return target.getFunction(prop);\n }\n catch (error) {\n if (!isError(error, \"INVALID_ARGUMENT\") || error.argument !== \"key\") {\n throw error;\n }\n }\n return undefined;\n },\n has: (target, prop) => {\n if (typeof (prop) === \"symbol\" || prop in target || passProperties.indexOf(prop) >= 0) {\n return Reflect.has(target, prop);\n }\n return target.interface.hasFunction(prop);\n }\n });\n }\n /**\n * Return a new Contract instance with the same target and ABI, but\n * a different %%runner%%.\n */\n connect(runner) {\n return new BaseContract(this.target, this.interface, runner);\n }\n /**\n * Return a new Contract instance with the same ABI and runner, but\n * a different %%target%%.\n */\n attach(target) {\n return new BaseContract(target, this.interface, this.runner);\n }\n /**\n * Return the resolved address of this Contract.\n */\n async getAddress() { return await getInternal(this).addrPromise; }\n /**\n * Return the deployed bytecode or null if no bytecode is found.\n */\n async getDeployedCode() {\n const provider = getProvider(this.runner);\n assert(provider, \"runner does not support .provider\", \"UNSUPPORTED_OPERATION\", { operation: \"getDeployedCode\" });\n const code = await provider.getCode(await this.getAddress());\n if (code === \"0x\") {\n return null;\n }\n return code;\n }\n /**\n * Resolve to this Contract once the bytecode has been deployed, or\n * resolve immediately if already deployed.\n */\n async waitForDeployment() {\n // We have the deployment transaction; just use that (throws if deployment fails)\n const deployTx = this.deploymentTransaction();\n if (deployTx) {\n await deployTx.wait();\n return this;\n }\n // Check for code\n const code = await this.getDeployedCode();\n if (code != null) {\n return this;\n }\n // Make sure we can subscribe to a provider event\n const provider = getProvider(this.runner);\n assert(provider != null, \"contract runner does not support .provider\", \"UNSUPPORTED_OPERATION\", { operation: \"waitForDeployment\" });\n return new Promise((resolve, reject) => {\n const checkCode = async () => {\n try {\n const code = await this.getDeployedCode();\n if (code != null) {\n return resolve(this);\n }\n provider.once(\"block\", checkCode);\n }\n catch (error) {\n reject(error);\n }\n };\n checkCode();\n });\n }\n /**\n * Return the transaction used to deploy this contract.\n *\n * This is only available if this instance was returned from a\n * [[ContractFactory]].\n */\n deploymentTransaction() {\n return getInternal(this).deployTx;\n }\n /**\n * Return the function for a given name. This is useful when a contract\n * method name conflicts with a JavaScript name such as ``prototype`` or\n * when using a Contract programmatically.\n */\n getFunction(key) {\n if (typeof (key) !== \"string\") {\n key = key.format();\n }\n const func = buildWrappedMethod(this, key);\n return func;\n }\n /**\n * Return the event for a given name. This is useful when a contract\n * event name conflicts with a JavaScript name such as ``prototype`` or\n * when using a Contract programmatically.\n */\n getEvent(key) {\n if (typeof (key) !== \"string\") {\n key = key.format();\n }\n return buildWrappedEvent(this, key);\n }\n /**\n * @_ignore:\n */\n async queryTransaction(hash) {\n throw new Error(\"@TODO\");\n }\n /*\n // @TODO: this is a non-backwards compatible change, but will be added\n // in v7 and in a potential SmartContract class in an upcoming\n // v6 release\n async getTransactionReceipt(hash: string): Promise {\n const provider = getProvider(this.runner);\n assert(provider, \"contract runner does not have a provider\",\n \"UNSUPPORTED_OPERATION\", { operation: \"queryTransaction\" });\n\n const receipt = await provider.getTransactionReceipt(hash);\n if (receipt == null) { return null; }\n\n return new ContractTransactionReceipt(this.interface, provider, receipt);\n }\n */\n /**\n * Provide historic access to event data for %%event%% in the range\n * %%fromBlock%% (default: ``0``) to %%toBlock%% (default: ``\"latest\"``)\n * inclusive.\n */\n async queryFilter(event, fromBlock, toBlock) {\n if (fromBlock == null) {\n fromBlock = 0;\n }\n if (toBlock == null) {\n toBlock = \"latest\";\n }\n const { addr, addrPromise } = getInternal(this);\n const address = (addr ? addr : (await addrPromise));\n const { fragment, topics } = await getSubInfo(this, event);\n const filter = { address, topics, fromBlock, toBlock };\n const provider = getProvider(this.runner);\n assert(provider, \"contract runner does not have a provider\", \"UNSUPPORTED_OPERATION\", { operation: \"queryFilter\" });\n return (await provider.getLogs(filter)).map((log) => {\n let foundFragment = fragment;\n if (foundFragment == null) {\n try {\n foundFragment = this.interface.getEvent(log.topics[0]);\n }\n catch (error) { }\n }\n if (foundFragment) {\n try {\n return new EventLog(log, this.interface, foundFragment);\n }\n catch (error) {\n return new UndecodedEventLog(log, error);\n }\n }\n return new Log(log, provider);\n });\n }\n /**\n * Add an event %%listener%% for the %%event%%.\n */\n async on(event, listener) {\n const sub = await getSub(this, \"on\", event);\n sub.listeners.push({ listener, once: false });\n sub.start();\n return this;\n }\n /**\n * Add an event %%listener%% for the %%event%%, but remove the listener\n * after it is fired once.\n */\n async once(event, listener) {\n const sub = await getSub(this, \"once\", event);\n sub.listeners.push({ listener, once: true });\n sub.start();\n return this;\n }\n /**\n * Emit an %%event%% calling all listeners with %%args%%.\n *\n * Resolves to ``true`` if any listeners were called.\n */\n async emit(event, ...args) {\n return await emit(this, event, args, null);\n }\n /**\n * Resolves to the number of listeners of %%event%% or the total number\n * of listeners if unspecified.\n */\n async listenerCount(event) {\n if (event) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return 0;\n }\n return sub.listeners.length;\n }\n const { subs } = getInternal(this);\n let total = 0;\n for (const { listeners } of subs.values()) {\n total += listeners.length;\n }\n return total;\n }\n /**\n * Resolves to the listeners subscribed to %%event%% or all listeners\n * if unspecified.\n */\n async listeners(event) {\n if (event) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return [];\n }\n return sub.listeners.map(({ listener }) => listener);\n }\n const { subs } = getInternal(this);\n let result = [];\n for (const { listeners } of subs.values()) {\n result = result.concat(listeners.map(({ listener }) => listener));\n }\n return result;\n }\n /**\n * Remove the %%listener%% from the listeners for %%event%% or remove\n * all listeners if unspecified.\n */\n async off(event, listener) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return this;\n }\n if (listener) {\n const index = sub.listeners.map(({ listener }) => listener).indexOf(listener);\n if (index >= 0) {\n sub.listeners.splice(index, 1);\n }\n }\n if (listener == null || sub.listeners.length === 0) {\n sub.stop();\n getInternal(this).subs.delete(sub.tag);\n }\n return this;\n }\n /**\n * Remove all the listeners for %%event%% or remove all listeners if\n * unspecified.\n */\n async removeAllListeners(event) {\n if (event) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return this;\n }\n sub.stop();\n getInternal(this).subs.delete(sub.tag);\n }\n else {\n const { subs } = getInternal(this);\n for (const { tag, stop } of subs.values()) {\n stop();\n subs.delete(tag);\n }\n }\n return this;\n }\n /**\n * Alias for [on].\n */\n async addListener(event, listener) {\n return await this.on(event, listener);\n }\n /**\n * Alias for [off].\n */\n async removeListener(event, listener) {\n return await this.off(event, listener);\n }\n /**\n * Create a new Class for the %%abi%%.\n */\n static buildClass(abi) {\n class CustomContract extends BaseContract {\n constructor(address, runner = null) {\n super(address, abi, runner);\n }\n }\n return CustomContract;\n }\n ;\n /**\n * Create a new BaseContract with a specified Interface.\n */\n static from(target, abi, runner) {\n if (runner == null) {\n runner = null;\n }\n const contract = new this(target, abi, runner);\n return contract;\n }\n}\nfunction _ContractBase() {\n return BaseContract;\n}\n/**\n * A [[BaseContract]] with no type guards on its methods or events.\n */\nexport class Contract extends _ContractBase() {\n}\n//# sourceMappingURL=contract.js.map","import { Interface } from \"../abi/index.js\";\nimport { getCreateAddress } from \"../address/index.js\";\nimport { concat, defineProperties, getBytes, hexlify, assert, assertArgument } from \"../utils/index.js\";\nimport { BaseContract, copyOverrides, resolveArgs } from \"./contract.js\";\n// A = Arguments to the constructor\n// I = Interface of deployed contracts\n/**\n * A **ContractFactory** is used to deploy a Contract to the blockchain.\n */\nexport class ContractFactory {\n /**\n * The Contract Interface.\n */\n interface;\n /**\n * The Contract deployment bytecode. Often called the initcode.\n */\n bytecode;\n /**\n * The ContractRunner to deploy the Contract as.\n */\n runner;\n /**\n * Create a new **ContractFactory** with %%abi%% and %%bytecode%%,\n * optionally connected to %%runner%%.\n *\n * The %%bytecode%% may be the ``bytecode`` property within the\n * standard Solidity JSON output.\n */\n constructor(abi, bytecode, runner) {\n const iface = Interface.from(abi);\n // Dereference Solidity bytecode objects and allow a missing `0x`-prefix\n if (bytecode instanceof Uint8Array) {\n bytecode = hexlify(getBytes(bytecode));\n }\n else {\n if (typeof (bytecode) === \"object\") {\n bytecode = bytecode.object;\n }\n if (!bytecode.startsWith(\"0x\")) {\n bytecode = \"0x\" + bytecode;\n }\n bytecode = hexlify(getBytes(bytecode));\n }\n defineProperties(this, {\n bytecode, interface: iface, runner: (runner || null)\n });\n }\n attach(target) {\n return new BaseContract(target, this.interface, this.runner);\n }\n /**\n * Resolves to the transaction to deploy the contract, passing %%args%%\n * into the constructor.\n */\n async getDeployTransaction(...args) {\n let overrides = {};\n const fragment = this.interface.deploy;\n if (fragment.inputs.length + 1 === args.length) {\n overrides = await copyOverrides(args.pop());\n }\n if (fragment.inputs.length !== args.length) {\n throw new Error(\"incorrect number of arguments to constructor\");\n }\n const resolvedArgs = await resolveArgs(this.runner, fragment.inputs, args);\n const data = concat([this.bytecode, this.interface.encodeDeploy(resolvedArgs)]);\n return Object.assign({}, overrides, { data });\n }\n /**\n * Resolves to the Contract deployed by passing %%args%% into the\n * constructor.\n *\n * This will resolve to the Contract before it has been deployed to the\n * network, so the [[BaseContract-waitForDeployment]] should be used before\n * sending any transactions to it.\n */\n async deploy(...args) {\n const tx = await this.getDeployTransaction(...args);\n assert(this.runner && typeof (this.runner.sendTransaction) === \"function\", \"factory runner does not support sending transactions\", \"UNSUPPORTED_OPERATION\", {\n operation: \"sendTransaction\"\n });\n const sentTx = await this.runner.sendTransaction(tx);\n const address = getCreateAddress(sentTx);\n return new BaseContract(address, this.interface, this.runner, sentTx);\n }\n /**\n * Return a new **ContractFactory** with the same ABI and bytecode,\n * but connected to %%runner%%.\n */\n connect(runner) {\n return new ContractFactory(this.interface, this.bytecode, runner);\n }\n /**\n * Create a new **ContractFactory** from the standard Solidity JSON output.\n */\n static fromSolidity(output, runner) {\n assertArgument(output != null, \"bad compiler output\", \"output\", output);\n if (typeof (output) === \"string\") {\n output = JSON.parse(output);\n }\n const abi = output.abi;\n let bytecode = \"\";\n if (output.bytecode) {\n bytecode = output.bytecode;\n }\n else if (output.evm && output.evm.bytecode) {\n bytecode = output.evm.bytecode;\n }\n return new this(abi, bytecode, runner);\n }\n}\n//# sourceMappingURL=factory.js.map","/**\n * ENS is a service which allows easy-to-remember names to map to\n * network addresses.\n *\n * @_section: api/providers/ens-resolver:ENS Resolver [about-ens-rsolver]\n */\nimport { getAddress } from \"../address/index.js\";\nimport { ZeroAddress } from \"../constants/index.js\";\nimport { Contract } from \"../contract/index.js\";\nimport { dnsEncode, namehash } from \"../hash/index.js\";\nimport { hexlify, isHexString, toBeHex, defineProperties, encodeBase58, assert, assertArgument, isError, FetchRequest } from \"../utils/index.js\";\n// @TODO: This should use the fetch-data:ipfs gateway\n// Trim off the ipfs:// prefix and return the default gateway URL\nfunction getIpfsLink(link) {\n if (link.match(/^ipfs:\\/\\/ipfs\\//i)) {\n link = link.substring(12);\n }\n else if (link.match(/^ipfs:\\/\\//i)) {\n link = link.substring(7);\n }\n else {\n assertArgument(false, \"unsupported IPFS format\", \"link\", link);\n }\n return `https:/\\/gateway.ipfs.io/ipfs/${link}`;\n}\n;\n;\n/**\n * A provider plugin super-class for processing multicoin address types.\n */\nexport class MulticoinProviderPlugin {\n /**\n * The name.\n */\n name;\n /**\n * Creates a new **MulticoinProviderPluing** for %%name%%.\n */\n constructor(name) {\n defineProperties(this, { name });\n }\n connect(proivder) {\n return this;\n }\n /**\n * Returns ``true`` if %%coinType%% is supported by this plugin.\n */\n supportsCoinType(coinType) {\n return false;\n }\n /**\n * Resolves to the encoded %%address%% for %%coinType%%.\n */\n async encodeAddress(coinType, address) {\n throw new Error(\"unsupported coin\");\n }\n /**\n * Resolves to the decoded %%data%% for %%coinType%%.\n */\n async decodeAddress(coinType, data) {\n throw new Error(\"unsupported coin\");\n }\n}\nconst BasicMulticoinPluginId = \"org.ethers.plugins.provider.BasicMulticoin\";\n/**\n * A **BasicMulticoinProviderPlugin** provides service for common\n * coin types, which do not require additional libraries to encode or\n * decode.\n */\nexport class BasicMulticoinProviderPlugin extends MulticoinProviderPlugin {\n /**\n * Creates a new **BasicMulticoinProviderPlugin**.\n */\n constructor() {\n super(BasicMulticoinPluginId);\n }\n}\nconst matcherIpfs = new RegExp(\"^(ipfs):/\\/(.*)$\", \"i\");\nconst matchers = [\n new RegExp(\"^(https):/\\/(.*)$\", \"i\"),\n new RegExp(\"^(data):(.*)$\", \"i\"),\n matcherIpfs,\n new RegExp(\"^eip155:[0-9]+/(erc[0-9]+):(.*)$\", \"i\"),\n];\n/**\n * A connected object to a resolved ENS name resolver, which can be\n * used to query additional details.\n */\nexport class EnsResolver {\n /**\n * The connected provider.\n */\n provider;\n /**\n * The address of the resolver.\n */\n address;\n /**\n * The name this resolver was resolved against.\n */\n name;\n // For EIP-2544 names, the ancestor that provided the resolver\n #supports2544;\n #resolver;\n constructor(provider, address, name) {\n defineProperties(this, { provider, address, name });\n this.#supports2544 = null;\n this.#resolver = new Contract(address, [\n \"function supportsInterface(bytes4) view returns (bool)\",\n \"function resolve(bytes, bytes) view returns (bytes)\",\n \"function addr(bytes32) view returns (address)\",\n \"function addr(bytes32, uint) view returns (bytes)\",\n \"function text(bytes32, string) view returns (string)\",\n \"function contenthash(bytes32) view returns (bytes)\",\n ], provider);\n }\n /**\n * Resolves to true if the resolver supports wildcard resolution.\n */\n async supportsWildcard() {\n if (this.#supports2544 == null) {\n this.#supports2544 = (async () => {\n try {\n return await this.#resolver.supportsInterface(\"0x9061b923\");\n }\n catch (error) {\n // Wildcard resolvers must understand supportsInterface\n // and return true.\n if (isError(error, \"CALL_EXCEPTION\")) {\n return false;\n }\n // Let future attempts try again...\n this.#supports2544 = null;\n throw error;\n }\n })();\n }\n return await this.#supports2544;\n }\n async #fetch(funcName, params) {\n params = (params || []).slice();\n const iface = this.#resolver.interface;\n // The first parameters is always the nodehash\n params.unshift(namehash(this.name));\n let fragment = null;\n if (await this.supportsWildcard()) {\n fragment = iface.getFunction(funcName);\n assert(fragment, \"missing fragment\", \"UNKNOWN_ERROR\", {\n info: { funcName }\n });\n params = [\n dnsEncode(this.name, 255),\n iface.encodeFunctionData(fragment, params)\n ];\n funcName = \"resolve(bytes,bytes)\";\n }\n params.push({\n enableCcipRead: true\n });\n try {\n const result = await this.#resolver[funcName](...params);\n if (fragment) {\n return iface.decodeFunctionResult(fragment, result)[0];\n }\n return result;\n }\n catch (error) {\n if (!isError(error, \"CALL_EXCEPTION\")) {\n throw error;\n }\n }\n return null;\n }\n /**\n * Resolves to the address for %%coinType%% or null if the\n * provided %%coinType%% has not been configured.\n */\n async getAddress(coinType) {\n if (coinType == null) {\n coinType = 60;\n }\n if (coinType === 60) {\n try {\n const result = await this.#fetch(\"addr(bytes32)\");\n // No address\n if (result == null || result === ZeroAddress) {\n return null;\n }\n return result;\n }\n catch (error) {\n if (isError(error, \"CALL_EXCEPTION\")) {\n return null;\n }\n throw error;\n }\n }\n // Try decoding its EVM canonical chain as an EVM chain address first\n if (coinType >= 0 && coinType < 0x80000000) {\n let ethCoinType = coinType + 0x80000000;\n const data = await this.#fetch(\"addr(bytes32,uint)\", [ethCoinType]);\n if (isHexString(data, 20)) {\n return getAddress(data);\n }\n }\n let coinPlugin = null;\n for (const plugin of this.provider.plugins) {\n if (!(plugin instanceof MulticoinProviderPlugin)) {\n continue;\n }\n if (plugin.supportsCoinType(coinType)) {\n coinPlugin = plugin;\n break;\n }\n }\n if (coinPlugin == null) {\n return null;\n }\n // keccak256(\"addr(bytes32,uint256\")\n const data = await this.#fetch(\"addr(bytes32,uint)\", [coinType]);\n // No address\n if (data == null || data === \"0x\") {\n return null;\n }\n // Compute the address\n const address = await coinPlugin.decodeAddress(coinType, data);\n if (address != null) {\n return address;\n }\n assert(false, `invalid coin data`, \"UNSUPPORTED_OPERATION\", {\n operation: `getAddress(${coinType})`,\n info: { coinType, data }\n });\n }\n /**\n * Resolves to the EIP-634 text record for %%key%%, or ``null``\n * if unconfigured.\n */\n async getText(key) {\n const data = await this.#fetch(\"text(bytes32,string)\", [key]);\n if (data == null || data === \"0x\") {\n return null;\n }\n return data;\n }\n /**\n * Rsolves to the content-hash or ``null`` if unconfigured.\n */\n async getContentHash() {\n // keccak256(\"contenthash()\")\n const data = await this.#fetch(\"contenthash(bytes32)\");\n // No contenthash\n if (data == null || data === \"0x\") {\n return null;\n }\n // IPFS (CID: 1, Type: 70=DAG-PB, 72=libp2p-key)\n const ipfs = data.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);\n if (ipfs) {\n const scheme = (ipfs[1] === \"e3010170\") ? \"ipfs\" : \"ipns\";\n const length = parseInt(ipfs[4], 16);\n if (ipfs[5].length === length * 2) {\n return `${scheme}:/\\/${encodeBase58(\"0x\" + ipfs[2])}`;\n }\n }\n // Swarm (CID: 1, Type: swarm-manifest; hash/length hard-coded to keccak256/32)\n const swarm = data.match(/^0xe40101fa011b20([0-9a-f]*)$/);\n if (swarm && swarm[1].length === 64) {\n return `bzz:/\\/${swarm[1]}`;\n }\n assert(false, `invalid or unsupported content hash data`, \"UNSUPPORTED_OPERATION\", {\n operation: \"getContentHash()\",\n info: { data }\n });\n }\n /**\n * Resolves to the avatar url or ``null`` if the avatar is either\n * unconfigured or incorrectly configured (e.g. references an NFT\n * not owned by the address).\n *\n * If diagnosing issues with configurations, the [[_getAvatar]]\n * method may be useful.\n */\n async getAvatar() {\n const avatar = await this._getAvatar();\n return avatar.url;\n }\n /**\n * When resolving an avatar, there are many steps involved, such\n * fetching metadata and possibly validating ownership of an\n * NFT.\n *\n * This method can be used to examine each step and the value it\n * was working from.\n */\n async _getAvatar() {\n const linkage = [{ type: \"name\", value: this.name }];\n try {\n // test data for ricmoo.eth\n //const avatar = \"eip155:1/erc721:0x265385c7f4132228A0d54EB1A9e7460b91c0cC68/29233\";\n const avatar = await this.getText(\"avatar\");\n if (avatar == null) {\n linkage.push({ type: \"!avatar\", value: \"\" });\n return { url: null, linkage };\n }\n linkage.push({ type: \"avatar\", value: avatar });\n for (let i = 0; i < matchers.length; i++) {\n const match = avatar.match(matchers[i]);\n if (match == null) {\n continue;\n }\n const scheme = match[1].toLowerCase();\n switch (scheme) {\n case \"https\":\n case \"data\":\n linkage.push({ type: \"url\", value: avatar });\n return { linkage, url: avatar };\n case \"ipfs\": {\n const url = getIpfsLink(avatar);\n linkage.push({ type: \"ipfs\", value: avatar });\n linkage.push({ type: \"url\", value: url });\n return { linkage, url };\n }\n case \"erc721\":\n case \"erc1155\": {\n // Depending on the ERC type, use tokenURI(uint256) or url(uint256)\n const selector = (scheme === \"erc721\") ? \"tokenURI(uint256)\" : \"uri(uint256)\";\n linkage.push({ type: scheme, value: avatar });\n // The owner of this name\n const owner = await this.getAddress();\n if (owner == null) {\n linkage.push({ type: \"!owner\", value: \"\" });\n return { url: null, linkage };\n }\n const comps = (match[2] || \"\").split(\"/\");\n if (comps.length !== 2) {\n linkage.push({ type: `!${scheme}caip`, value: (match[2] || \"\") });\n return { url: null, linkage };\n }\n const tokenId = comps[1];\n const contract = new Contract(comps[0], [\n // ERC-721\n \"function tokenURI(uint) view returns (string)\",\n \"function ownerOf(uint) view returns (address)\",\n // ERC-1155\n \"function uri(uint) view returns (string)\",\n \"function balanceOf(address, uint256) view returns (uint)\"\n ], this.provider);\n // Check that this account owns the token\n if (scheme === \"erc721\") {\n const tokenOwner = await contract.ownerOf(tokenId);\n if (owner !== tokenOwner) {\n linkage.push({ type: \"!owner\", value: tokenOwner });\n return { url: null, linkage };\n }\n linkage.push({ type: \"owner\", value: tokenOwner });\n }\n else if (scheme === \"erc1155\") {\n const balance = await contract.balanceOf(owner, tokenId);\n if (!balance) {\n linkage.push({ type: \"!balance\", value: \"0\" });\n return { url: null, linkage };\n }\n linkage.push({ type: \"balance\", value: balance.toString() });\n }\n // Call the token contract for the metadata URL\n let metadataUrl = await contract[selector](tokenId);\n if (metadataUrl == null || metadataUrl === \"0x\") {\n linkage.push({ type: \"!metadata-url\", value: \"\" });\n return { url: null, linkage };\n }\n linkage.push({ type: \"metadata-url-base\", value: metadataUrl });\n // ERC-1155 allows a generic {id} in the URL\n if (scheme === \"erc1155\") {\n metadataUrl = metadataUrl.replace(\"{id}\", toBeHex(tokenId, 32).substring(2));\n linkage.push({ type: \"metadata-url-expanded\", value: metadataUrl });\n }\n // Transform IPFS metadata links\n if (metadataUrl.match(/^ipfs:/i)) {\n metadataUrl = getIpfsLink(metadataUrl);\n }\n linkage.push({ type: \"metadata-url\", value: metadataUrl });\n // Get the token metadata\n let metadata = {};\n const response = await (new FetchRequest(metadataUrl)).send();\n response.assertOk();\n try {\n metadata = response.bodyJson;\n }\n catch (error) {\n try {\n linkage.push({ type: \"!metadata\", value: response.bodyText });\n }\n catch (error) {\n const bytes = response.body;\n if (bytes) {\n linkage.push({ type: \"!metadata\", value: hexlify(bytes) });\n }\n return { url: null, linkage };\n }\n return { url: null, linkage };\n }\n if (!metadata) {\n linkage.push({ type: \"!metadata\", value: \"\" });\n return { url: null, linkage };\n }\n linkage.push({ type: \"metadata\", value: JSON.stringify(metadata) });\n // Pull the image URL out\n let imageUrl = metadata.image;\n if (typeof (imageUrl) !== \"string\") {\n linkage.push({ type: \"!imageUrl\", value: \"\" });\n return { url: null, linkage };\n }\n if (imageUrl.match(/^(https:\\/\\/|data:)/i)) {\n // Allow\n }\n else {\n // Transform IPFS link to gateway\n const ipfs = imageUrl.match(matcherIpfs);\n if (ipfs == null) {\n linkage.push({ type: \"!imageUrl-ipfs\", value: imageUrl });\n return { url: null, linkage };\n }\n linkage.push({ type: \"imageUrl-ipfs\", value: imageUrl });\n imageUrl = getIpfsLink(imageUrl);\n }\n linkage.push({ type: \"url\", value: imageUrl });\n return { linkage, url: imageUrl };\n }\n }\n }\n }\n catch (error) { }\n return { linkage, url: null };\n }\n static async getEnsAddress(provider) {\n const network = await provider.getNetwork();\n const ensPlugin = network.getPlugin(\"org.ethers.plugins.network.Ens\");\n // No ENS...\n assert(ensPlugin, \"network does not support ENS\", \"UNSUPPORTED_OPERATION\", {\n operation: \"getEnsAddress\", info: { network }\n });\n return ensPlugin.address;\n }\n static async #getResolver(provider, name) {\n const ensAddr = await EnsResolver.getEnsAddress(provider);\n try {\n const contract = new Contract(ensAddr, [\n \"function resolver(bytes32) view returns (address)\"\n ], provider);\n const addr = await contract.resolver(namehash(name), {\n enableCcipRead: true\n });\n if (addr === ZeroAddress) {\n return null;\n }\n return addr;\n }\n catch (error) {\n // ENS registry cannot throw errors on resolver(bytes32),\n // so probably a link error\n throw error;\n }\n return null;\n }\n /**\n * Resolve to the ENS resolver for %%name%% using %%provider%% or\n * ``null`` if unconfigured.\n */\n static async fromName(provider, name) {\n let currentName = name;\n while (true) {\n if (currentName === \"\" || currentName === \".\") {\n return null;\n }\n // Optimization since the eth node cannot change and does\n // not have a wildcard resolver\n if (name !== \"eth\" && currentName === \"eth\") {\n return null;\n }\n // Check the current node for a resolver\n const addr = await EnsResolver.#getResolver(provider, currentName);\n // Found a resolver!\n if (addr != null) {\n const resolver = new EnsResolver(provider, addr, name);\n // Legacy resolver found, using EIP-2544 so it isn't safe to use\n if (currentName !== name && !(await resolver.supportsWildcard())) {\n return null;\n }\n return resolver;\n }\n // Get the parent node\n currentName = currentName.split(\".\").slice(1).join(\".\");\n }\n }\n}\n//# sourceMappingURL=ens-resolver.js.map","/**\n * @_ignore\n */\nimport { getAddress, getCreateAddress } from \"../address/index.js\";\nimport { Signature } from \"../crypto/index.js\";\nimport { accessListify } from \"../transaction/index.js\";\nimport { getBigInt, getNumber, hexlify, isHexString, zeroPadValue, assert, assertArgument } from \"../utils/index.js\";\nconst BN_0 = BigInt(0);\nexport function allowNull(format, nullValue) {\n return (function (value) {\n if (value == null) {\n return nullValue;\n }\n return format(value);\n });\n}\nexport function arrayOf(format, allowNull) {\n return ((array) => {\n if (allowNull && array == null) {\n return null;\n }\n if (!Array.isArray(array)) {\n throw new Error(\"not an array\");\n }\n return array.map((i) => format(i));\n });\n}\n// Requires an object which matches a fleet of other formatters\n// Any FormatFunc may return `undefined` to have the value omitted\n// from the result object. Calls preserve `this`.\nexport function object(format, altNames) {\n return ((value) => {\n const result = {};\n for (const key in format) {\n let srcKey = key;\n if (altNames && key in altNames && !(srcKey in value)) {\n for (const altKey of altNames[key]) {\n if (altKey in value) {\n srcKey = altKey;\n break;\n }\n }\n }\n try {\n const nv = format[key](value[srcKey]);\n if (nv !== undefined) {\n result[key] = nv;\n }\n }\n catch (error) {\n const message = (error instanceof Error) ? error.message : \"not-an-error\";\n assert(false, `invalid value for value.${key} (${message})`, \"BAD_DATA\", { value });\n }\n }\n return result;\n });\n}\nexport function formatBoolean(value) {\n switch (value) {\n case true:\n case \"true\":\n return true;\n case false:\n case \"false\":\n return false;\n }\n assertArgument(false, `invalid boolean; ${JSON.stringify(value)}`, \"value\", value);\n}\nexport function formatData(value) {\n assertArgument(isHexString(value, true), \"invalid data\", \"value\", value);\n return value;\n}\nexport function formatHash(value) {\n assertArgument(isHexString(value, 32), \"invalid hash\", \"value\", value);\n return value;\n}\nexport function formatUint256(value) {\n if (!isHexString(value)) {\n throw new Error(\"invalid uint256\");\n }\n return zeroPadValue(value, 32);\n}\nconst _formatLog = object({\n address: getAddress,\n blockHash: formatHash,\n blockNumber: getNumber,\n data: formatData,\n index: getNumber,\n removed: allowNull(formatBoolean, false),\n topics: arrayOf(formatHash),\n transactionHash: formatHash,\n transactionIndex: getNumber,\n}, {\n index: [\"logIndex\"]\n});\nexport function formatLog(value) {\n return _formatLog(value);\n}\nconst _formatBlock = object({\n hash: allowNull(formatHash),\n parentHash: formatHash,\n parentBeaconBlockRoot: allowNull(formatHash, null),\n number: getNumber,\n timestamp: getNumber,\n nonce: allowNull(formatData),\n difficulty: getBigInt,\n gasLimit: getBigInt,\n gasUsed: getBigInt,\n stateRoot: allowNull(formatHash, null),\n receiptsRoot: allowNull(formatHash, null),\n blobGasUsed: allowNull(getBigInt, null),\n excessBlobGas: allowNull(getBigInt, null),\n miner: allowNull(getAddress),\n prevRandao: allowNull(formatHash, null),\n extraData: formatData,\n baseFeePerGas: allowNull(getBigInt)\n}, {\n prevRandao: [\"mixHash\"]\n});\nexport function formatBlock(value) {\n const result = _formatBlock(value);\n result.transactions = value.transactions.map((tx) => {\n if (typeof (tx) === \"string\") {\n return tx;\n }\n return formatTransactionResponse(tx);\n });\n return result;\n}\nconst _formatReceiptLog = object({\n transactionIndex: getNumber,\n blockNumber: getNumber,\n transactionHash: formatHash,\n address: getAddress,\n topics: arrayOf(formatHash),\n data: formatData,\n index: getNumber,\n blockHash: formatHash,\n}, {\n index: [\"logIndex\"]\n});\nexport function formatReceiptLog(value) {\n return _formatReceiptLog(value);\n}\nconst _formatTransactionReceipt = object({\n to: allowNull(getAddress, null),\n from: allowNull(getAddress, null),\n contractAddress: allowNull(getAddress, null),\n // should be allowNull(hash), but broken-EIP-658 support is handled in receipt\n index: getNumber,\n root: allowNull(hexlify),\n gasUsed: getBigInt,\n blobGasUsed: allowNull(getBigInt, null),\n logsBloom: allowNull(formatData),\n blockHash: formatHash,\n hash: formatHash,\n logs: arrayOf(formatReceiptLog),\n blockNumber: getNumber,\n //confirmations: allowNull(getNumber, null),\n cumulativeGasUsed: getBigInt,\n effectiveGasPrice: allowNull(getBigInt),\n blobGasPrice: allowNull(getBigInt, null),\n status: allowNull(getNumber),\n type: allowNull(getNumber, 0)\n}, {\n effectiveGasPrice: [\"gasPrice\"],\n hash: [\"transactionHash\"],\n index: [\"transactionIndex\"],\n});\nexport function formatTransactionReceipt(value) {\n return _formatTransactionReceipt(value);\n}\nexport function formatTransactionResponse(value) {\n // Some clients (TestRPC) do strange things like return 0x0 for the\n // 0 address; correct this to be a real address\n if (value.to && getBigInt(value.to) === BN_0) {\n value.to = \"0x0000000000000000000000000000000000000000\";\n }\n const result = object({\n hash: formatHash,\n // Some nodes do not return this, usually test nodes (like Ganache)\n index: allowNull(getNumber, undefined),\n type: (value) => {\n if (value === \"0x\" || value == null) {\n return 0;\n }\n return getNumber(value);\n },\n accessList: allowNull(accessListify, null),\n blobVersionedHashes: allowNull(arrayOf(formatHash, true), null),\n authorizationList: allowNull(arrayOf((v) => {\n let sig;\n if (v.signature) {\n sig = v.signature;\n }\n else {\n let yParity = v.yParity;\n if (yParity === \"0x1b\") {\n yParity = 0;\n }\n else if (yParity === \"0x1c\") {\n yParity = 1;\n }\n sig = Object.assign({}, v, { yParity });\n }\n return {\n address: getAddress(v.address),\n chainId: getBigInt(v.chainId),\n nonce: getBigInt(v.nonce),\n signature: Signature.from(sig)\n };\n }, false), null),\n blockHash: allowNull(formatHash, null),\n blockNumber: allowNull(getNumber, null),\n transactionIndex: allowNull(getNumber, null),\n from: getAddress,\n // either (gasPrice) or (maxPriorityFeePerGas + maxFeePerGas) must be set\n gasPrice: allowNull(getBigInt),\n maxPriorityFeePerGas: allowNull(getBigInt),\n maxFeePerGas: allowNull(getBigInt),\n maxFeePerBlobGas: allowNull(getBigInt, null),\n gasLimit: getBigInt,\n to: allowNull(getAddress, null),\n value: getBigInt,\n nonce: getNumber,\n data: formatData,\n creates: allowNull(getAddress, null),\n chainId: allowNull(getBigInt, null)\n }, {\n data: [\"input\"],\n gasLimit: [\"gas\"],\n index: [\"transactionIndex\"]\n })(value);\n // If to and creates are empty, populate the creates from the value\n if (result.to == null && result.creates == null) {\n result.creates = getCreateAddress(result);\n }\n // @TODO: Check fee data\n // Add an access list to supported transaction types\n if ((value.type === 1 || value.type === 2) && value.accessList == null) {\n result.accessList = [];\n }\n // Compute the signature\n if (value.signature) {\n result.signature = Signature.from(value.signature);\n }\n else {\n result.signature = Signature.from(value);\n }\n // Some backends omit ChainId on legacy transactions, but we can compute it\n if (result.chainId == null) {\n const chainId = result.signature.legacyChainId;\n if (chainId != null) {\n result.chainId = chainId;\n }\n }\n // @TODO: check chainID\n /*\n if (value.chainId != null) {\n let chainId = value.chainId;\n\n if (isHexString(chainId)) {\n chainId = BigNumber.from(chainId).toNumber();\n }\n\n result.chainId = chainId;\n\n } else {\n let chainId = value.networkId;\n\n // geth-etc returns chainId\n if (chainId == null && result.v == null) {\n chainId = value.chainId;\n }\n\n if (isHexString(chainId)) {\n chainId = BigNumber.from(chainId).toNumber();\n }\n\n if (typeof(chainId) !== \"number\" && result.v != null) {\n chainId = (result.v - 35) / 2;\n if (chainId < 0) { chainId = 0; }\n chainId = parseInt(chainId);\n }\n\n if (typeof(chainId) !== \"number\") { chainId = 0; }\n\n result.chainId = chainId;\n }\n */\n // 0x0000... should actually be null\n if (result.blockHash && getBigInt(result.blockHash) === BN_0) {\n result.blockHash = null;\n }\n return result;\n}\n//# sourceMappingURL=format.js.map","import { defineProperties } from \"../utils/properties.js\";\nimport { assertArgument } from \"../utils/index.js\";\nconst EnsAddress = \"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e\";\n/**\n * A **NetworkPlugin** provides additional functionality on a [[Network]].\n */\nexport class NetworkPlugin {\n /**\n * The name of the plugin.\n *\n * It is recommended to use reverse-domain-notation, which permits\n * unique names with a known authority as well as hierarchal entries.\n */\n name;\n /**\n * Creates a new **NetworkPlugin**.\n */\n constructor(name) {\n defineProperties(this, { name });\n }\n /**\n * Creates a copy of this plugin.\n */\n clone() {\n return new NetworkPlugin(this.name);\n }\n}\n/**\n * A **GasCostPlugin** allows a network to provide alternative values when\n * computing the intrinsic gas required for a transaction.\n */\nexport class GasCostPlugin extends NetworkPlugin {\n /**\n * The block number to treat these values as valid from.\n *\n * This allows a hardfork to have updated values included as well as\n * mulutiple hardforks to be supported.\n */\n effectiveBlock;\n /**\n * The transactions base fee.\n */\n txBase;\n /**\n * The fee for creating a new account.\n */\n txCreate;\n /**\n * The fee per zero-byte in the data.\n */\n txDataZero;\n /**\n * The fee per non-zero-byte in the data.\n */\n txDataNonzero;\n /**\n * The fee per storage key in the [[link-eip-2930]] access list.\n */\n txAccessListStorageKey;\n /**\n * The fee per address in the [[link-eip-2930]] access list.\n */\n txAccessListAddress;\n /**\n * Creates a new GasCostPlugin from %%effectiveBlock%% until the\n * latest block or another GasCostPlugin supercedes that block number,\n * with the associated %%costs%%.\n */\n constructor(effectiveBlock, costs) {\n if (effectiveBlock == null) {\n effectiveBlock = 0;\n }\n super(`org.ethers.network.plugins.GasCost#${(effectiveBlock || 0)}`);\n const props = { effectiveBlock };\n function set(name, nullish) {\n let value = (costs || {})[name];\n if (value == null) {\n value = nullish;\n }\n assertArgument(typeof (value) === \"number\", `invalud value for ${name}`, \"costs\", costs);\n props[name] = value;\n }\n set(\"txBase\", 21000);\n set(\"txCreate\", 32000);\n set(\"txDataZero\", 4);\n set(\"txDataNonzero\", 16);\n set(\"txAccessListStorageKey\", 1900);\n set(\"txAccessListAddress\", 2400);\n defineProperties(this, props);\n }\n clone() {\n return new GasCostPlugin(this.effectiveBlock, this);\n }\n}\n/**\n * An **EnsPlugin** allows a [[Network]] to specify the ENS Registry\n * Contract address and the target network to use when using that\n * contract.\n *\n * Various testnets have their own instance of the contract to use, but\n * in general, the mainnet instance supports multi-chain addresses and\n * should be used.\n */\nexport class EnsPlugin extends NetworkPlugin {\n /**\n * The ENS Registrty Contract address.\n */\n address;\n /**\n * The chain ID that the ENS contract lives on.\n */\n targetNetwork;\n /**\n * Creates a new **EnsPlugin** connected to %%address%% on the\n * %%targetNetwork%%. The default ENS address and mainnet is used\n * if unspecified.\n */\n constructor(address, targetNetwork) {\n super(\"org.ethers.plugins.network.Ens\");\n defineProperties(this, {\n address: (address || EnsAddress),\n targetNetwork: ((targetNetwork == null) ? 1 : targetNetwork)\n });\n }\n clone() {\n return new EnsPlugin(this.address, this.targetNetwork);\n }\n}\n/**\n * A **FeeDataNetworkPlugin** allows a network to provide and alternate\n * means to specify its fee data.\n *\n * For example, a network which does not support [[link-eip-1559]] may\n * choose to use a Gas Station site to approximate the gas price.\n */\nexport class FeeDataNetworkPlugin extends NetworkPlugin {\n #feeDataFunc;\n /**\n * The fee data function provided to the constructor.\n */\n get feeDataFunc() {\n return this.#feeDataFunc;\n }\n /**\n * Creates a new **FeeDataNetworkPlugin**.\n */\n constructor(feeDataFunc) {\n super(\"org.ethers.plugins.network.FeeData\");\n this.#feeDataFunc = feeDataFunc;\n }\n /**\n * Resolves to the fee data.\n */\n async getFeeData(provider) {\n return await this.#feeDataFunc(provider);\n }\n clone() {\n return new FeeDataNetworkPlugin(this.#feeDataFunc);\n }\n}\nexport class FetchUrlFeeDataNetworkPlugin extends NetworkPlugin {\n #url;\n #processFunc;\n /**\n * The URL to initialize the FetchRequest with in %%processFunc%%.\n */\n get url() { return this.#url; }\n /**\n * The callback to use when computing the FeeData.\n */\n get processFunc() { return this.#processFunc; }\n /**\n * Creates a new **FetchUrlFeeDataNetworkPlugin** which will\n * be used when computing the fee data for the network.\n */\n constructor(url, processFunc) {\n super(\"org.ethers.plugins.network.FetchUrlFeeDataPlugin\");\n this.#url = url;\n this.#processFunc = processFunc;\n }\n // We are immutable, so we can serve as our own clone\n clone() { return this; }\n}\n/*\nexport class CustomBlockNetworkPlugin extends NetworkPlugin {\n readonly #blockFunc: (provider: Provider, block: BlockParams) => Block;\n readonly #blockWithTxsFunc: (provider: Provider, block: BlockParams) => Block;\n\n constructor(blockFunc: (provider: Provider, block: BlockParams) => Block, blockWithTxsFunc: (provider: Provider, block: BlockParams) => Block) {\n super(\"org.ethers.network-plugins.custom-block\");\n this.#blockFunc = blockFunc;\n this.#blockWithTxsFunc = blockWithTxsFunc;\n }\n\n async getBlock(provider: Provider, block: BlockParams): Promise> {\n return await this.#blockFunc(provider, block);\n }\n\n async getBlockions(provider: Provider, block: BlockParams): Promise> {\n return await this.#blockWithTxsFunc(provider, block);\n }\n\n clone(): CustomBlockNetworkPlugin {\n return new CustomBlockNetworkPlugin(this.#blockFunc, this.#blockWithTxsFunc);\n }\n}\n*/\n//# sourceMappingURL=plugins-network.js.map","/**\n * A **Network** encapsulates the various properties required to\n * interact with a specific chain.\n *\n * @_subsection: api/providers:Networks [networks]\n */\nimport { accessListify } from \"../transaction/index.js\";\nimport { getBigInt, assert, assertArgument } from \"../utils/index.js\";\nimport { EnsPlugin, FetchUrlFeeDataNetworkPlugin, GasCostPlugin } from \"./plugins-network.js\";\n/* * * *\n// Networks which operation against an L2 can use this plugin to\n// specify how to access L1, for the purpose of resolving ENS,\n// for example.\nexport class LayerOneConnectionPlugin extends NetworkPlugin {\n readonly provider!: Provider;\n// @TODO: Rename to ChainAccess and allow for connecting to any chain\n constructor(provider: Provider) {\n super(\"org.ethers.plugins.layer-one-connection\");\n defineProperties(this, { provider });\n }\n\n clone(): LayerOneConnectionPlugin {\n return new LayerOneConnectionPlugin(this.provider);\n }\n}\n*/\nconst Networks = new Map();\n/**\n * A **Network** provides access to a chain's properties and allows\n * for plug-ins to extend functionality.\n */\nexport class Network {\n #name;\n #chainId;\n #plugins;\n /**\n * Creates a new **Network** for %%name%% and %%chainId%%.\n */\n constructor(name, chainId) {\n this.#name = name;\n this.#chainId = getBigInt(chainId);\n this.#plugins = new Map();\n }\n /**\n * Returns a JSON-compatible representation of a Network.\n */\n toJSON() {\n return { name: this.name, chainId: String(this.chainId) };\n }\n /**\n * The network common name.\n *\n * This is the canonical name, as networks migh have multiple\n * names.\n */\n get name() { return this.#name; }\n set name(value) { this.#name = value; }\n /**\n * The network chain ID.\n */\n get chainId() { return this.#chainId; }\n set chainId(value) { this.#chainId = getBigInt(value, \"chainId\"); }\n /**\n * Returns true if %%other%% matches this network. Any chain ID\n * must match, and if no chain ID is present, the name must match.\n *\n * This method does not currently check for additional properties,\n * such as ENS address or plug-in compatibility.\n */\n matches(other) {\n if (other == null) {\n return false;\n }\n if (typeof (other) === \"string\") {\n try {\n return (this.chainId === getBigInt(other));\n }\n catch (error) { }\n return (this.name === other);\n }\n if (typeof (other) === \"number\" || typeof (other) === \"bigint\") {\n try {\n return (this.chainId === getBigInt(other));\n }\n catch (error) { }\n return false;\n }\n if (typeof (other) === \"object\") {\n if (other.chainId != null) {\n try {\n return (this.chainId === getBigInt(other.chainId));\n }\n catch (error) { }\n return false;\n }\n if (other.name != null) {\n return (this.name === other.name);\n }\n return false;\n }\n return false;\n }\n /**\n * Returns the list of plugins currently attached to this Network.\n */\n get plugins() {\n return Array.from(this.#plugins.values());\n }\n /**\n * Attach a new %%plugin%% to this Network. The network name\n * must be unique, excluding any fragment.\n */\n attachPlugin(plugin) {\n if (this.#plugins.get(plugin.name)) {\n throw new Error(`cannot replace existing plugin: ${plugin.name} `);\n }\n this.#plugins.set(plugin.name, plugin.clone());\n return this;\n }\n /**\n * Return the plugin, if any, matching %%name%% exactly. Plugins\n * with fragments will not be returned unless %%name%% includes\n * a fragment.\n */\n getPlugin(name) {\n return (this.#plugins.get(name)) || null;\n }\n /**\n * Gets a list of all plugins that match %%name%%, with otr without\n * a fragment.\n */\n getPlugins(basename) {\n return (this.plugins.filter((p) => (p.name.split(\"#\")[0] === basename)));\n }\n /**\n * Create a copy of this Network.\n */\n clone() {\n const clone = new Network(this.name, this.chainId);\n this.plugins.forEach((plugin) => {\n clone.attachPlugin(plugin.clone());\n });\n return clone;\n }\n /**\n * Compute the intrinsic gas required for a transaction.\n *\n * A GasCostPlugin can be attached to override the default\n * values.\n */\n computeIntrinsicGas(tx) {\n const costs = this.getPlugin(\"org.ethers.plugins.network.GasCost\") || (new GasCostPlugin());\n let gas = costs.txBase;\n if (tx.to == null) {\n gas += costs.txCreate;\n }\n if (tx.data) {\n for (let i = 2; i < tx.data.length; i += 2) {\n if (tx.data.substring(i, i + 2) === \"00\") {\n gas += costs.txDataZero;\n }\n else {\n gas += costs.txDataNonzero;\n }\n }\n }\n if (tx.accessList) {\n const accessList = accessListify(tx.accessList);\n for (const addr in accessList) {\n gas += costs.txAccessListAddress + costs.txAccessListStorageKey * accessList[addr].storageKeys.length;\n }\n }\n return gas;\n }\n /**\n * Returns a new Network for the %%network%% name or chainId.\n */\n static from(network) {\n injectCommonNetworks();\n // Default network\n if (network == null) {\n return Network.from(\"mainnet\");\n }\n // Canonical name or chain ID\n if (typeof (network) === \"number\") {\n network = BigInt(network);\n }\n if (typeof (network) === \"string\" || typeof (network) === \"bigint\") {\n const networkFunc = Networks.get(network);\n if (networkFunc) {\n return networkFunc();\n }\n if (typeof (network) === \"bigint\") {\n return new Network(\"unknown\", network);\n }\n assertArgument(false, \"unknown network\", \"network\", network);\n }\n // Clonable with network-like abilities\n if (typeof (network.clone) === \"function\") {\n const clone = network.clone();\n //if (typeof(network.name) !== \"string\" || typeof(network.chainId) !== \"number\") {\n //}\n return clone;\n }\n // Networkish\n if (typeof (network) === \"object\") {\n assertArgument(typeof (network.name) === \"string\" && typeof (network.chainId) === \"number\", \"invalid network object name or chainId\", \"network\", network);\n const custom = new Network((network.name), (network.chainId));\n if (network.ensAddress || network.ensNetwork != null) {\n custom.attachPlugin(new EnsPlugin(network.ensAddress, network.ensNetwork));\n }\n //if ((network).layerOneConnection) {\n // custom.attachPlugin(new LayerOneConnectionPlugin((network).layerOneConnection));\n //}\n return custom;\n }\n assertArgument(false, \"invalid network\", \"network\", network);\n }\n /**\n * Register %%nameOrChainId%% with a function which returns\n * an instance of a Network representing that chain.\n */\n static register(nameOrChainId, networkFunc) {\n if (typeof (nameOrChainId) === \"number\") {\n nameOrChainId = BigInt(nameOrChainId);\n }\n const existing = Networks.get(nameOrChainId);\n if (existing) {\n assertArgument(false, `conflicting network for ${JSON.stringify(existing.name)}`, \"nameOrChainId\", nameOrChainId);\n }\n Networks.set(nameOrChainId, networkFunc);\n }\n}\n// We don't want to bring in formatUnits because it is backed by\n// FixedNumber and we want to keep Networks tiny. The values\n// included by the Gas Stations are also IEEE 754 with lots of\n// rounding issues and exceed the strict checks formatUnits has.\nfunction parseUnits(_value, decimals) {\n const value = String(_value);\n if (!value.match(/^[0-9.]+$/)) {\n throw new Error(`invalid gwei value: ${_value}`);\n }\n // Break into [ whole, fraction ]\n const comps = value.split(\".\");\n if (comps.length === 1) {\n comps.push(\"\");\n }\n // More than 1 decimal point or too many fractional positions\n if (comps.length !== 2) {\n throw new Error(`invalid gwei value: ${_value}`);\n }\n // Pad the fraction to 9 decimalplaces\n while (comps[1].length < decimals) {\n comps[1] += \"0\";\n }\n // Too many decimals and some non-zero ending, take the ceiling\n if (comps[1].length > 9) {\n let frac = BigInt(comps[1].substring(0, 9));\n if (!comps[1].substring(9).match(/^0+$/)) {\n frac++;\n }\n comps[1] = frac.toString();\n }\n return BigInt(comps[0] + comps[1]);\n}\n// Used by Polygon to use a gas station for fee data\nfunction getGasStationPlugin(url) {\n return new FetchUrlFeeDataNetworkPlugin(url, async (fetchFeeData, provider, request) => {\n // Prevent Cloudflare from blocking our request in node.js\n request.setHeader(\"User-Agent\", \"ethers\");\n let response;\n try {\n const [_response, _feeData] = await Promise.all([\n request.send(), fetchFeeData()\n ]);\n response = _response;\n const payload = response.bodyJson.standard;\n const feeData = {\n gasPrice: _feeData.gasPrice,\n maxFeePerGas: parseUnits(payload.maxFee, 9),\n maxPriorityFeePerGas: parseUnits(payload.maxPriorityFee, 9),\n };\n return feeData;\n }\n catch (error) {\n assert(false, `error encountered with polygon gas station (${JSON.stringify(request.url)})`, \"SERVER_ERROR\", { request, response, error });\n }\n });\n}\n// See: https://chainlist.org\nlet injected = false;\nfunction injectCommonNetworks() {\n if (injected) {\n return;\n }\n injected = true;\n /// Register popular Ethereum networks\n function registerEth(name, chainId, options) {\n const func = function () {\n const network = new Network(name, chainId);\n // We use 0 to disable ENS\n if (options.ensNetwork != null) {\n network.attachPlugin(new EnsPlugin(null, options.ensNetwork));\n }\n network.attachPlugin(new GasCostPlugin());\n (options.plugins || []).forEach((plugin) => {\n network.attachPlugin(plugin);\n });\n return network;\n };\n // Register the network by name and chain ID\n Network.register(name, func);\n Network.register(chainId, func);\n if (options.altNames) {\n options.altNames.forEach((name) => {\n Network.register(name, func);\n });\n }\n }\n registerEth(\"mainnet\", 1, { ensNetwork: 1, altNames: [\"homestead\"] });\n registerEth(\"ropsten\", 3, { ensNetwork: 3 });\n registerEth(\"rinkeby\", 4, { ensNetwork: 4 });\n registerEth(\"goerli\", 5, { ensNetwork: 5 });\n registerEth(\"kovan\", 42, { ensNetwork: 42 });\n registerEth(\"sepolia\", 11155111, { ensNetwork: 11155111 });\n registerEth(\"holesky\", 17000, { ensNetwork: 17000 });\n registerEth(\"classic\", 61, {});\n registerEth(\"classicKotti\", 6, {});\n registerEth(\"arbitrum\", 42161, {\n ensNetwork: 1,\n });\n registerEth(\"arbitrum-goerli\", 421613, {});\n registerEth(\"arbitrum-sepolia\", 421614, {});\n registerEth(\"base\", 8453, { ensNetwork: 1 });\n registerEth(\"base-goerli\", 84531, {});\n registerEth(\"base-sepolia\", 84532, {});\n registerEth(\"bnb\", 56, { ensNetwork: 1 });\n registerEth(\"bnbt\", 97, {});\n registerEth(\"filecoin\", 314, {});\n registerEth(\"filecoin-calibration\", 314159, {});\n registerEth(\"linea\", 59144, { ensNetwork: 1 });\n registerEth(\"linea-goerli\", 59140, {});\n registerEth(\"linea-sepolia\", 59141, {});\n registerEth(\"matic\", 137, {\n ensNetwork: 1,\n plugins: [\n getGasStationPlugin(\"https:/\\/gasstation.polygon.technology/v2\")\n ]\n });\n registerEth(\"matic-amoy\", 80002, {});\n registerEth(\"matic-mumbai\", 80001, {\n altNames: [\"maticMumbai\", \"maticmum\"],\n plugins: [\n getGasStationPlugin(\"https:/\\/gasstation-testnet.polygon.technology/v2\")\n ]\n });\n registerEth(\"optimism\", 10, {\n ensNetwork: 1,\n plugins: []\n });\n registerEth(\"optimism-goerli\", 420, {});\n registerEth(\"optimism-sepolia\", 11155420, {});\n registerEth(\"xdai\", 100, { ensNetwork: 1 });\n}\n//# sourceMappingURL=network.js.map","import { assert, isHexString } from \"../utils/index.js\";\nfunction copy(obj) {\n return JSON.parse(JSON.stringify(obj));\n}\n/**\n * Return the polling subscriber for common events.\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport function getPollingSubscriber(provider, event) {\n if (event === \"block\") {\n return new PollingBlockSubscriber(provider);\n }\n if (isHexString(event, 32)) {\n return new PollingTransactionSubscriber(provider, event);\n }\n assert(false, \"unsupported polling event\", \"UNSUPPORTED_OPERATION\", {\n operation: \"getPollingSubscriber\", info: { event }\n });\n}\n// @TODO: refactor this\n/**\n * A **PollingBlockSubscriber** polls at a regular interval for a change\n * in the block number.\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class PollingBlockSubscriber {\n #provider;\n #poller;\n #interval;\n // The most recent block we have scanned for events. The value -2\n // indicates we still need to fetch an initial block number\n #blockNumber;\n /**\n * Create a new **PollingBlockSubscriber** attached to %%provider%%.\n */\n constructor(provider) {\n this.#provider = provider;\n this.#poller = null;\n this.#interval = 4000;\n this.#blockNumber = -2;\n }\n /**\n * The polling interval.\n */\n get pollingInterval() { return this.#interval; }\n set pollingInterval(value) { this.#interval = value; }\n async #poll() {\n try {\n const blockNumber = await this.#provider.getBlockNumber();\n // Bootstrap poll to setup our initial block number\n if (this.#blockNumber === -2) {\n this.#blockNumber = blockNumber;\n return;\n }\n // @TODO: Put a cap on the maximum number of events per loop?\n if (blockNumber !== this.#blockNumber) {\n for (let b = this.#blockNumber + 1; b <= blockNumber; b++) {\n // We have been stopped\n if (this.#poller == null) {\n return;\n }\n await this.#provider.emit(\"block\", b);\n }\n this.#blockNumber = blockNumber;\n }\n }\n catch (error) {\n // @TODO: Minor bump, add an \"error\" event to let subscribers\n // know things went awry.\n //console.log(error);\n }\n // We have been stopped\n if (this.#poller == null) {\n return;\n }\n this.#poller = this.#provider._setTimeout(this.#poll.bind(this), this.#interval);\n }\n start() {\n if (this.#poller) {\n return;\n }\n this.#poller = this.#provider._setTimeout(this.#poll.bind(this), this.#interval);\n this.#poll();\n }\n stop() {\n if (!this.#poller) {\n return;\n }\n this.#provider._clearTimeout(this.#poller);\n this.#poller = null;\n }\n pause(dropWhilePaused) {\n this.stop();\n if (dropWhilePaused) {\n this.#blockNumber = -2;\n }\n }\n resume() {\n this.start();\n }\n}\n/**\n * An **OnBlockSubscriber** can be sub-classed, with a [[_poll]]\n * implmentation which will be called on every new block.\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class OnBlockSubscriber {\n #provider;\n #poll;\n #running;\n /**\n * Create a new **OnBlockSubscriber** attached to %%provider%%.\n */\n constructor(provider) {\n this.#provider = provider;\n this.#running = false;\n this.#poll = (blockNumber) => {\n this._poll(blockNumber, this.#provider);\n };\n }\n /**\n * Called on every new block.\n */\n async _poll(blockNumber, provider) {\n throw new Error(\"sub-classes must override this\");\n }\n start() {\n if (this.#running) {\n return;\n }\n this.#running = true;\n this.#poll(-2);\n this.#provider.on(\"block\", this.#poll);\n }\n stop() {\n if (!this.#running) {\n return;\n }\n this.#running = false;\n this.#provider.off(\"block\", this.#poll);\n }\n pause(dropWhilePaused) { this.stop(); }\n resume() { this.start(); }\n}\nexport class PollingBlockTagSubscriber extends OnBlockSubscriber {\n #tag;\n #lastBlock;\n constructor(provider, tag) {\n super(provider);\n this.#tag = tag;\n this.#lastBlock = -2;\n }\n pause(dropWhilePaused) {\n if (dropWhilePaused) {\n this.#lastBlock = -2;\n }\n super.pause(dropWhilePaused);\n }\n async _poll(blockNumber, provider) {\n const block = await provider.getBlock(this.#tag);\n if (block == null) {\n return;\n }\n if (this.#lastBlock === -2) {\n this.#lastBlock = block.number;\n }\n else if (block.number > this.#lastBlock) {\n provider.emit(this.#tag, block.number);\n this.#lastBlock = block.number;\n }\n }\n}\n/**\n * @_ignore:\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class PollingOrphanSubscriber extends OnBlockSubscriber {\n #filter;\n constructor(provider, filter) {\n super(provider);\n this.#filter = copy(filter);\n }\n async _poll(blockNumber, provider) {\n throw new Error(\"@TODO\");\n console.log(this.#filter);\n }\n}\n/**\n * A **PollingTransactionSubscriber** will poll for a given transaction\n * hash for its receipt.\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class PollingTransactionSubscriber extends OnBlockSubscriber {\n #hash;\n /**\n * Create a new **PollingTransactionSubscriber** attached to\n * %%provider%%, listening for %%hash%%.\n */\n constructor(provider, hash) {\n super(provider);\n this.#hash = hash;\n }\n async _poll(blockNumber, provider) {\n const tx = await provider.getTransactionReceipt(this.#hash);\n if (tx) {\n provider.emit(this.#hash, tx);\n }\n }\n}\n/**\n * A **PollingEventSubscriber** will poll for a given filter for its logs.\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class PollingEventSubscriber {\n #provider;\n #filter;\n #poller;\n #running;\n // The most recent block we have scanned for events. The value -2\n // indicates we still need to fetch an initial block number\n #blockNumber;\n /**\n * Create a new **PollingTransactionSubscriber** attached to\n * %%provider%%, listening for %%filter%%.\n */\n constructor(provider, filter) {\n this.#provider = provider;\n this.#filter = copy(filter);\n this.#poller = this.#poll.bind(this);\n this.#running = false;\n this.#blockNumber = -2;\n }\n async #poll(blockNumber) {\n // The initial block hasn't been determined yet\n if (this.#blockNumber === -2) {\n return;\n }\n const filter = copy(this.#filter);\n filter.fromBlock = this.#blockNumber + 1;\n filter.toBlock = blockNumber;\n const logs = await this.#provider.getLogs(filter);\n // No logs could just mean the node has not indexed them yet,\n // so we keep a sliding window of 60 blocks to keep scanning\n if (logs.length === 0) {\n if (this.#blockNumber < blockNumber - 60) {\n this.#blockNumber = blockNumber - 60;\n }\n return;\n }\n for (const log of logs) {\n this.#provider.emit(this.#filter, log);\n // Only advance the block number when logs were found to\n // account for networks (like BNB and Polygon) which may\n // sacrifice event consistency for block event speed\n this.#blockNumber = log.blockNumber;\n }\n }\n start() {\n if (this.#running) {\n return;\n }\n this.#running = true;\n if (this.#blockNumber === -2) {\n this.#provider.getBlockNumber().then((blockNumber) => {\n this.#blockNumber = blockNumber;\n });\n }\n this.#provider.on(\"block\", this.#poller);\n }\n stop() {\n if (!this.#running) {\n return;\n }\n this.#running = false;\n this.#provider.off(\"block\", this.#poller);\n }\n pause(dropWhilePaused) {\n this.stop();\n if (dropWhilePaused) {\n this.#blockNumber = -2;\n }\n }\n resume() {\n this.start();\n }\n}\n//# sourceMappingURL=subscriber-polling.js.map","/**\n * The available providers should suffice for most developers purposes,\n * but the [[AbstractProvider]] class has many features which enable\n * sub-classing it for specific purposes.\n *\n * @_section: api/providers/abstract-provider: Subclassing Provider [abstract-provider]\n */\n// @TODO\n// Event coalescence\n// When we register an event with an async value (e.g. address is a Signer\n// or ENS name), we need to add it immeidately for the Event API, but also\n// need time to resolve the address. Upon resolving the address, we need to\n// migrate the listener to the static event. We also need to maintain a map\n// of Signer/ENS name to address so we can sync respond to listenerCount.\nimport { getAddress, resolveAddress } from \"../address/index.js\";\nimport { ZeroAddress } from \"../constants/index.js\";\nimport { Contract } from \"../contract/index.js\";\nimport { namehash } from \"../hash/index.js\";\nimport { Transaction } from \"../transaction/index.js\";\nimport { concat, dataLength, dataSlice, hexlify, isHexString, getBigInt, getBytes, getNumber, isCallException, isError, makeError, assert, assertArgument, FetchRequest, toBeArray, toQuantity, defineProperties, EventPayload, resolveProperties, toUtf8String } from \"../utils/index.js\";\nimport { EnsResolver } from \"./ens-resolver.js\";\nimport { formatBlock, formatLog, formatTransactionReceipt, formatTransactionResponse } from \"./format.js\";\nimport { Network } from \"./network.js\";\nimport { copyRequest, Block, FeeData, Log, TransactionReceipt, TransactionResponse } from \"./provider.js\";\nimport { PollingBlockSubscriber, PollingBlockTagSubscriber, PollingEventSubscriber, PollingOrphanSubscriber, PollingTransactionSubscriber } from \"./subscriber-polling.js\";\n// Constants\nconst BN_2 = BigInt(2);\nconst MAX_CCIP_REDIRECTS = 10;\nfunction isPromise(value) {\n return (value && typeof (value.then) === \"function\");\n}\nfunction getTag(prefix, value) {\n return prefix + \":\" + JSON.stringify(value, (k, v) => {\n if (v == null) {\n return \"null\";\n }\n if (typeof (v) === \"bigint\") {\n return `bigint:${v.toString()}`;\n }\n if (typeof (v) === \"string\") {\n return v.toLowerCase();\n }\n // Sort object keys\n if (typeof (v) === \"object\" && !Array.isArray(v)) {\n const keys = Object.keys(v);\n keys.sort();\n return keys.reduce((accum, key) => {\n accum[key] = v[key];\n return accum;\n }, {});\n }\n return v;\n });\n}\n/**\n * An **UnmanagedSubscriber** is useful for events which do not require\n * any additional management, such as ``\"debug\"`` which only requires\n * emit in synchronous event loop triggered calls.\n */\nexport class UnmanagedSubscriber {\n /**\n * The name fof the event.\n */\n name;\n /**\n * Create a new UnmanagedSubscriber with %%name%%.\n */\n constructor(name) { defineProperties(this, { name }); }\n start() { }\n stop() { }\n pause(dropWhilePaused) { }\n resume() { }\n}\nfunction copy(value) {\n return JSON.parse(JSON.stringify(value));\n}\nfunction concisify(items) {\n items = Array.from((new Set(items)).values());\n items.sort();\n return items;\n}\nasync function getSubscription(_event, provider) {\n if (_event == null) {\n throw new Error(\"invalid event\");\n }\n // Normalize topic array info an EventFilter\n if (Array.isArray(_event)) {\n _event = { topics: _event };\n }\n if (typeof (_event) === \"string\") {\n switch (_event) {\n case \"block\":\n case \"debug\":\n case \"error\":\n case \"finalized\":\n case \"network\":\n case \"pending\":\n case \"safe\": {\n return { type: _event, tag: _event };\n }\n }\n }\n if (isHexString(_event, 32)) {\n const hash = _event.toLowerCase();\n return { type: \"transaction\", tag: getTag(\"tx\", { hash }), hash };\n }\n if (_event.orphan) {\n const event = _event;\n // @TODO: Should lowercase and whatnot things here instead of copy...\n return { type: \"orphan\", tag: getTag(\"orphan\", event), filter: copy(event) };\n }\n if ((_event.address || _event.topics)) {\n const event = _event;\n const filter = {\n topics: ((event.topics || []).map((t) => {\n if (t == null) {\n return null;\n }\n if (Array.isArray(t)) {\n return concisify(t.map((t) => t.toLowerCase()));\n }\n return t.toLowerCase();\n }))\n };\n if (event.address) {\n const addresses = [];\n const promises = [];\n const addAddress = (addr) => {\n if (isHexString(addr)) {\n addresses.push(addr);\n }\n else {\n promises.push((async () => {\n addresses.push(await resolveAddress(addr, provider));\n })());\n }\n };\n if (Array.isArray(event.address)) {\n event.address.forEach(addAddress);\n }\n else {\n addAddress(event.address);\n }\n if (promises.length) {\n await Promise.all(promises);\n }\n filter.address = concisify(addresses.map((a) => a.toLowerCase()));\n }\n return { filter, tag: getTag(\"event\", filter), type: \"event\" };\n }\n assertArgument(false, \"unknown ProviderEvent\", \"event\", _event);\n}\nfunction getTime() { return (new Date()).getTime(); }\nconst defaultOptions = {\n cacheTimeout: 250,\n pollingInterval: 4000\n};\n/**\n * An **AbstractProvider** provides a base class for other sub-classes to\n * implement the [[Provider]] API by normalizing input arguments and\n * formatting output results as well as tracking events for consistent\n * behaviour on an eventually-consistent network.\n */\nexport class AbstractProvider {\n #subs;\n #plugins;\n // null=unpaused, true=paused+dropWhilePaused, false=paused\n #pausedState;\n #destroyed;\n #networkPromise;\n #anyNetwork;\n #performCache;\n // The most recent block number if running an event or -1 if no \"block\" event\n #lastBlockNumber;\n #nextTimer;\n #timers;\n #disableCcipRead;\n #options;\n /**\n * Create a new **AbstractProvider** connected to %%network%%, or\n * use the various network detection capabilities to discover the\n * [[Network]] if necessary.\n */\n constructor(_network, options) {\n this.#options = Object.assign({}, defaultOptions, options || {});\n if (_network === \"any\") {\n this.#anyNetwork = true;\n this.#networkPromise = null;\n }\n else if (_network) {\n const network = Network.from(_network);\n this.#anyNetwork = false;\n this.#networkPromise = Promise.resolve(network);\n setTimeout(() => { this.emit(\"network\", network, null); }, 0);\n }\n else {\n this.#anyNetwork = false;\n this.#networkPromise = null;\n }\n this.#lastBlockNumber = -1;\n this.#performCache = new Map();\n this.#subs = new Map();\n this.#plugins = new Map();\n this.#pausedState = null;\n this.#destroyed = false;\n this.#nextTimer = 1;\n this.#timers = new Map();\n this.#disableCcipRead = false;\n }\n get pollingInterval() { return this.#options.pollingInterval; }\n /**\n * Returns ``this``, to allow an **AbstractProvider** to implement\n * the [[ContractRunner]] interface.\n */\n get provider() { return this; }\n /**\n * Returns all the registered plug-ins.\n */\n get plugins() {\n return Array.from(this.#plugins.values());\n }\n /**\n * Attach a new plug-in.\n */\n attachPlugin(plugin) {\n if (this.#plugins.get(plugin.name)) {\n throw new Error(`cannot replace existing plugin: ${plugin.name} `);\n }\n this.#plugins.set(plugin.name, plugin.connect(this));\n return this;\n }\n /**\n * Get a plugin by name.\n */\n getPlugin(name) {\n return (this.#plugins.get(name)) || null;\n }\n /**\n * Prevent any CCIP-read operation, regardless of whether requested\n * in a [[call]] using ``enableCcipRead``.\n */\n get disableCcipRead() { return this.#disableCcipRead; }\n set disableCcipRead(value) { this.#disableCcipRead = !!value; }\n // Shares multiple identical requests made during the same 250ms\n async #perform(req) {\n const timeout = this.#options.cacheTimeout;\n // Caching disabled\n if (timeout < 0) {\n return await this._perform(req);\n }\n // Create a tag\n const tag = getTag(req.method, req);\n let perform = this.#performCache.get(tag);\n if (!perform) {\n perform = this._perform(req);\n this.#performCache.set(tag, perform);\n setTimeout(() => {\n if (this.#performCache.get(tag) === perform) {\n this.#performCache.delete(tag);\n }\n }, timeout);\n }\n return await perform;\n }\n /**\n * Resolves to the data for executing the CCIP-read operations.\n */\n async ccipReadFetch(tx, calldata, urls) {\n if (this.disableCcipRead || urls.length === 0 || tx.to == null) {\n return null;\n }\n const sender = tx.to.toLowerCase();\n const data = calldata.toLowerCase();\n const errorMessages = [];\n for (let i = 0; i < urls.length; i++) {\n const url = urls[i];\n // URL expansion\n const href = url.replace(\"{sender}\", sender).replace(\"{data}\", data);\n // If no {data} is present, use POST; otherwise GET\n //const json: string | null = (url.indexOf(\"{data}\") >= 0) ? null: JSON.stringify({ data, sender });\n //const result = await fetchJson({ url: href, errorPassThrough: true }, json, (value, response) => {\n // value.status = response.statusCode;\n // return value;\n //});\n const request = new FetchRequest(href);\n if (url.indexOf(\"{data}\") === -1) {\n request.body = { data, sender };\n }\n this.emit(\"debug\", { action: \"sendCcipReadFetchRequest\", request, index: i, urls });\n let errorMessage = \"unknown error\";\n // Fetch the resource...\n let resp;\n try {\n resp = await request.send();\n }\n catch (error) {\n // ...low-level fetch error (missing host, bad SSL, etc.),\n // so try next URL\n errorMessages.push(error.message);\n this.emit(\"debug\", { action: \"receiveCcipReadFetchError\", request, result: { error } });\n continue;\n }\n try {\n const result = resp.bodyJson;\n if (result.data) {\n this.emit(\"debug\", { action: \"receiveCcipReadFetchResult\", request, result });\n return result.data;\n }\n if (result.message) {\n errorMessage = result.message;\n }\n this.emit(\"debug\", { action: \"receiveCcipReadFetchError\", request, result });\n }\n catch (error) { }\n // 4xx indicates the result is not present; stop\n assert(resp.statusCode < 400 || resp.statusCode >= 500, `response not found during CCIP fetch: ${errorMessage}`, \"OFFCHAIN_FAULT\", { reason: \"404_MISSING_RESOURCE\", transaction: tx, info: { url, errorMessage } });\n // 5xx indicates server issue; try the next url\n errorMessages.push(errorMessage);\n }\n assert(false, `error encountered during CCIP fetch: ${errorMessages.map((m) => JSON.stringify(m)).join(\", \")}`, \"OFFCHAIN_FAULT\", {\n reason: \"500_SERVER_ERROR\",\n transaction: tx, info: { urls, errorMessages }\n });\n }\n /**\n * Provides the opportunity for a sub-class to wrap a block before\n * returning it, to add additional properties or an alternate\n * sub-class of [[Block]].\n */\n _wrapBlock(value, network) {\n return new Block(formatBlock(value), this);\n }\n /**\n * Provides the opportunity for a sub-class to wrap a log before\n * returning it, to add additional properties or an alternate\n * sub-class of [[Log]].\n */\n _wrapLog(value, network) {\n return new Log(formatLog(value), this);\n }\n /**\n * Provides the opportunity for a sub-class to wrap a transaction\n * receipt before returning it, to add additional properties or an\n * alternate sub-class of [[TransactionReceipt]].\n */\n _wrapTransactionReceipt(value, network) {\n return new TransactionReceipt(formatTransactionReceipt(value), this);\n }\n /**\n * Provides the opportunity for a sub-class to wrap a transaction\n * response before returning it, to add additional properties or an\n * alternate sub-class of [[TransactionResponse]].\n */\n _wrapTransactionResponse(tx, network) {\n return new TransactionResponse(formatTransactionResponse(tx), this);\n }\n /**\n * Resolves to the Network, forcing a network detection using whatever\n * technique the sub-class requires.\n *\n * Sub-classes **must** override this.\n */\n _detectNetwork() {\n assert(false, \"sub-classes must implement this\", \"UNSUPPORTED_OPERATION\", {\n operation: \"_detectNetwork\"\n });\n }\n /**\n * Sub-classes should use this to perform all built-in operations. All\n * methods sanitizes and normalizes the values passed into this.\n *\n * Sub-classes **must** override this.\n */\n async _perform(req) {\n assert(false, `unsupported method: ${req.method}`, \"UNSUPPORTED_OPERATION\", {\n operation: req.method,\n info: req\n });\n }\n // State\n async getBlockNumber() {\n const blockNumber = getNumber(await this.#perform({ method: \"getBlockNumber\" }), \"%response\");\n if (this.#lastBlockNumber >= 0) {\n this.#lastBlockNumber = blockNumber;\n }\n return blockNumber;\n }\n /**\n * Returns or resolves to the address for %%address%%, resolving ENS\n * names and [[Addressable]] objects and returning if already an\n * address.\n */\n _getAddress(address) {\n return resolveAddress(address, this);\n }\n /**\n * Returns or resolves to a valid block tag for %%blockTag%%, resolving\n * negative values and returning if already a valid block tag.\n */\n _getBlockTag(blockTag) {\n if (blockTag == null) {\n return \"latest\";\n }\n switch (blockTag) {\n case \"earliest\":\n return \"0x0\";\n case \"finalized\":\n case \"latest\":\n case \"pending\":\n case \"safe\":\n return blockTag;\n }\n if (isHexString(blockTag)) {\n if (isHexString(blockTag, 32)) {\n return blockTag;\n }\n return toQuantity(blockTag);\n }\n if (typeof (blockTag) === \"bigint\") {\n blockTag = getNumber(blockTag, \"blockTag\");\n }\n if (typeof (blockTag) === \"number\") {\n if (blockTag >= 0) {\n return toQuantity(blockTag);\n }\n if (this.#lastBlockNumber >= 0) {\n return toQuantity(this.#lastBlockNumber + blockTag);\n }\n return this.getBlockNumber().then((b) => toQuantity(b + blockTag));\n }\n assertArgument(false, \"invalid blockTag\", \"blockTag\", blockTag);\n }\n /**\n * Returns or resolves to a filter for %%filter%%, resolving any ENS\n * names or [[Addressable]] object and returning if already a valid\n * filter.\n */\n _getFilter(filter) {\n // Create a canonical representation of the topics\n const topics = (filter.topics || []).map((t) => {\n if (t == null) {\n return null;\n }\n if (Array.isArray(t)) {\n return concisify(t.map((t) => t.toLowerCase()));\n }\n return t.toLowerCase();\n });\n const blockHash = (\"blockHash\" in filter) ? filter.blockHash : undefined;\n const resolve = (_address, fromBlock, toBlock) => {\n let address = undefined;\n switch (_address.length) {\n case 0: break;\n case 1:\n address = _address[0];\n break;\n default:\n _address.sort();\n address = _address;\n }\n if (blockHash) {\n if (fromBlock != null || toBlock != null) {\n throw new Error(\"invalid filter\");\n }\n }\n const filter = {};\n if (address) {\n filter.address = address;\n }\n if (topics.length) {\n filter.topics = topics;\n }\n if (fromBlock) {\n filter.fromBlock = fromBlock;\n }\n if (toBlock) {\n filter.toBlock = toBlock;\n }\n if (blockHash) {\n filter.blockHash = blockHash;\n }\n return filter;\n };\n // Addresses could be async (ENS names or Addressables)\n let address = [];\n if (filter.address) {\n if (Array.isArray(filter.address)) {\n for (const addr of filter.address) {\n address.push(this._getAddress(addr));\n }\n }\n else {\n address.push(this._getAddress(filter.address));\n }\n }\n let fromBlock = undefined;\n if (\"fromBlock\" in filter) {\n fromBlock = this._getBlockTag(filter.fromBlock);\n }\n let toBlock = undefined;\n if (\"toBlock\" in filter) {\n toBlock = this._getBlockTag(filter.toBlock);\n }\n if (address.filter((a) => (typeof (a) !== \"string\")).length ||\n (fromBlock != null && typeof (fromBlock) !== \"string\") ||\n (toBlock != null && typeof (toBlock) !== \"string\")) {\n return Promise.all([Promise.all(address), fromBlock, toBlock]).then((result) => {\n return resolve(result[0], result[1], result[2]);\n });\n }\n return resolve(address, fromBlock, toBlock);\n }\n /**\n * Returns or resolves to a transaction for %%request%%, resolving\n * any ENS names or [[Addressable]] and returning if already a valid\n * transaction.\n */\n _getTransactionRequest(_request) {\n const request = copyRequest(_request);\n const promises = [];\n [\"to\", \"from\"].forEach((key) => {\n if (request[key] == null) {\n return;\n }\n const addr = resolveAddress(request[key], this);\n if (isPromise(addr)) {\n promises.push((async function () { request[key] = await addr; })());\n }\n else {\n request[key] = addr;\n }\n });\n if (request.blockTag != null) {\n const blockTag = this._getBlockTag(request.blockTag);\n if (isPromise(blockTag)) {\n promises.push((async function () { request.blockTag = await blockTag; })());\n }\n else {\n request.blockTag = blockTag;\n }\n }\n if (promises.length) {\n return (async function () {\n await Promise.all(promises);\n return request;\n })();\n }\n return request;\n }\n async getNetwork() {\n // No explicit network was set and this is our first time\n if (this.#networkPromise == null) {\n // Detect the current network (shared with all calls)\n const detectNetwork = (async () => {\n try {\n const network = await this._detectNetwork();\n this.emit(\"network\", network, null);\n return network;\n }\n catch (error) {\n if (this.#networkPromise === detectNetwork) {\n this.#networkPromise = null;\n }\n throw error;\n }\n })();\n this.#networkPromise = detectNetwork;\n return (await detectNetwork).clone();\n }\n const networkPromise = this.#networkPromise;\n const [expected, actual] = await Promise.all([\n networkPromise,\n this._detectNetwork() // The actual connected network\n ]);\n if (expected.chainId !== actual.chainId) {\n if (this.#anyNetwork) {\n // The \"any\" network can change, so notify listeners\n this.emit(\"network\", actual, expected);\n // Update the network if something else hasn't already changed it\n if (this.#networkPromise === networkPromise) {\n this.#networkPromise = Promise.resolve(actual);\n }\n }\n else {\n // Otherwise, we do not allow changes to the underlying network\n assert(false, `network changed: ${expected.chainId} => ${actual.chainId} `, \"NETWORK_ERROR\", {\n event: \"changed\"\n });\n }\n }\n return expected.clone();\n }\n async getFeeData() {\n const network = await this.getNetwork();\n const getFeeDataFunc = async () => {\n const { _block, gasPrice, priorityFee } = await resolveProperties({\n _block: this.#getBlock(\"latest\", false),\n gasPrice: ((async () => {\n try {\n const value = await this.#perform({ method: \"getGasPrice\" });\n return getBigInt(value, \"%response\");\n }\n catch (error) { }\n return null;\n })()),\n priorityFee: ((async () => {\n try {\n const value = await this.#perform({ method: \"getPriorityFee\" });\n return getBigInt(value, \"%response\");\n }\n catch (error) { }\n return null;\n })())\n });\n let maxFeePerGas = null;\n let maxPriorityFeePerGas = null;\n // These are the recommended EIP-1559 heuristics for fee data\n const block = this._wrapBlock(_block, network);\n if (block && block.baseFeePerGas) {\n maxPriorityFeePerGas = (priorityFee != null) ? priorityFee : BigInt(\"1000000000\");\n maxFeePerGas = (block.baseFeePerGas * BN_2) + maxPriorityFeePerGas;\n }\n return new FeeData(gasPrice, maxFeePerGas, maxPriorityFeePerGas);\n };\n // Check for a FeeDataNetWorkPlugin\n const plugin = network.getPlugin(\"org.ethers.plugins.network.FetchUrlFeeDataPlugin\");\n if (plugin) {\n const req = new FetchRequest(plugin.url);\n const feeData = await plugin.processFunc(getFeeDataFunc, this, req);\n return new FeeData(feeData.gasPrice, feeData.maxFeePerGas, feeData.maxPriorityFeePerGas);\n }\n return await getFeeDataFunc();\n }\n async estimateGas(_tx) {\n let tx = this._getTransactionRequest(_tx);\n if (isPromise(tx)) {\n tx = await tx;\n }\n return getBigInt(await this.#perform({\n method: \"estimateGas\", transaction: tx\n }), \"%response\");\n }\n async #call(tx, blockTag, attempt) {\n assert(attempt < MAX_CCIP_REDIRECTS, \"CCIP read exceeded maximum redirections\", \"OFFCHAIN_FAULT\", {\n reason: \"TOO_MANY_REDIRECTS\",\n transaction: Object.assign({}, tx, { blockTag, enableCcipRead: true })\n });\n // This came in as a PerformActionTransaction, so to/from are safe; we can cast\n const transaction = copyRequest(tx);\n try {\n return hexlify(await this._perform({ method: \"call\", transaction, blockTag }));\n }\n catch (error) {\n // CCIP Read OffchainLookup\n if (!this.disableCcipRead && isCallException(error) && error.data && attempt >= 0 && blockTag === \"latest\" && transaction.to != null && dataSlice(error.data, 0, 4) === \"0x556f1830\") {\n const data = error.data;\n const txSender = await resolveAddress(transaction.to, this);\n // Parse the CCIP Read Arguments\n let ccipArgs;\n try {\n ccipArgs = parseOffchainLookup(dataSlice(error.data, 4));\n }\n catch (error) {\n assert(false, error.message, \"OFFCHAIN_FAULT\", {\n reason: \"BAD_DATA\", transaction, info: { data }\n });\n }\n // Check the sender of the OffchainLookup matches the transaction\n assert(ccipArgs.sender.toLowerCase() === txSender.toLowerCase(), \"CCIP Read sender mismatch\", \"CALL_EXCEPTION\", {\n action: \"call\",\n data,\n reason: \"OffchainLookup\",\n transaction: transaction,\n invocation: null,\n revert: {\n signature: \"OffchainLookup(address,string[],bytes,bytes4,bytes)\",\n name: \"OffchainLookup\",\n args: ccipArgs.errorArgs\n }\n });\n const ccipResult = await this.ccipReadFetch(transaction, ccipArgs.calldata, ccipArgs.urls);\n assert(ccipResult != null, \"CCIP Read failed to fetch data\", \"OFFCHAIN_FAULT\", {\n reason: \"FETCH_FAILED\", transaction, info: { data: error.data, errorArgs: ccipArgs.errorArgs }\n });\n const tx = {\n to: txSender,\n data: concat([ccipArgs.selector, encodeBytes([ccipResult, ccipArgs.extraData])])\n };\n this.emit(\"debug\", { action: \"sendCcipReadCall\", transaction: tx });\n try {\n const result = await this.#call(tx, blockTag, attempt + 1);\n this.emit(\"debug\", { action: \"receiveCcipReadCallResult\", transaction: Object.assign({}, tx), result });\n return result;\n }\n catch (error) {\n this.emit(\"debug\", { action: \"receiveCcipReadCallError\", transaction: Object.assign({}, tx), error });\n throw error;\n }\n }\n throw error;\n }\n }\n async #checkNetwork(promise) {\n const { value } = await resolveProperties({\n network: this.getNetwork(),\n value: promise\n });\n return value;\n }\n async call(_tx) {\n const { tx, blockTag } = await resolveProperties({\n tx: this._getTransactionRequest(_tx),\n blockTag: this._getBlockTag(_tx.blockTag)\n });\n return await this.#checkNetwork(this.#call(tx, blockTag, _tx.enableCcipRead ? 0 : -1));\n }\n // Account\n async #getAccountValue(request, _address, _blockTag) {\n let address = this._getAddress(_address);\n let blockTag = this._getBlockTag(_blockTag);\n if (typeof (address) !== \"string\" || typeof (blockTag) !== \"string\") {\n [address, blockTag] = await Promise.all([address, blockTag]);\n }\n return await this.#checkNetwork(this.#perform(Object.assign(request, { address, blockTag })));\n }\n async getBalance(address, blockTag) {\n return getBigInt(await this.#getAccountValue({ method: \"getBalance\" }, address, blockTag), \"%response\");\n }\n async getTransactionCount(address, blockTag) {\n return getNumber(await this.#getAccountValue({ method: \"getTransactionCount\" }, address, blockTag), \"%response\");\n }\n async getCode(address, blockTag) {\n return hexlify(await this.#getAccountValue({ method: \"getCode\" }, address, blockTag));\n }\n async getStorage(address, _position, blockTag) {\n const position = getBigInt(_position, \"position\");\n return hexlify(await this.#getAccountValue({ method: \"getStorage\", position }, address, blockTag));\n }\n // Write\n async broadcastTransaction(signedTx) {\n const { blockNumber, hash, network } = await resolveProperties({\n blockNumber: this.getBlockNumber(),\n hash: this._perform({\n method: \"broadcastTransaction\",\n signedTransaction: signedTx\n }),\n network: this.getNetwork()\n });\n const tx = Transaction.from(signedTx);\n if (tx.hash !== hash) {\n throw new Error(\"@TODO: the returned hash did not match\");\n }\n return this._wrapTransactionResponse(tx, network).replaceableTransaction(blockNumber);\n }\n async #getBlock(block, includeTransactions) {\n // @TODO: Add CustomBlockPlugin check\n if (isHexString(block, 32)) {\n return await this.#perform({\n method: \"getBlock\", blockHash: block, includeTransactions\n });\n }\n let blockTag = this._getBlockTag(block);\n if (typeof (blockTag) !== \"string\") {\n blockTag = await blockTag;\n }\n return await this.#perform({\n method: \"getBlock\", blockTag, includeTransactions\n });\n }\n // Queries\n async getBlock(block, prefetchTxs) {\n const { network, params } = await resolveProperties({\n network: this.getNetwork(),\n params: this.#getBlock(block, !!prefetchTxs)\n });\n if (params == null) {\n return null;\n }\n return this._wrapBlock(params, network);\n }\n async getTransaction(hash) {\n const { network, params } = await resolveProperties({\n network: this.getNetwork(),\n params: this.#perform({ method: \"getTransaction\", hash })\n });\n if (params == null) {\n return null;\n }\n return this._wrapTransactionResponse(params, network);\n }\n async getTransactionReceipt(hash) {\n const { network, params } = await resolveProperties({\n network: this.getNetwork(),\n params: this.#perform({ method: \"getTransactionReceipt\", hash })\n });\n if (params == null) {\n return null;\n }\n // Some backends did not backfill the effectiveGasPrice into old transactions\n // in the receipt, so we look it up manually and inject it.\n if (params.gasPrice == null && params.effectiveGasPrice == null) {\n const tx = await this.#perform({ method: \"getTransaction\", hash });\n if (tx == null) {\n throw new Error(\"report this; could not find tx or effectiveGasPrice\");\n }\n params.effectiveGasPrice = tx.gasPrice;\n }\n return this._wrapTransactionReceipt(params, network);\n }\n async getTransactionResult(hash) {\n const { result } = await resolveProperties({\n network: this.getNetwork(),\n result: this.#perform({ method: \"getTransactionResult\", hash })\n });\n if (result == null) {\n return null;\n }\n return hexlify(result);\n }\n // Bloom-filter Queries\n async getLogs(_filter) {\n let filter = this._getFilter(_filter);\n if (isPromise(filter)) {\n filter = await filter;\n }\n const { network, params } = await resolveProperties({\n network: this.getNetwork(),\n params: this.#perform({ method: \"getLogs\", filter })\n });\n return params.map((p) => this._wrapLog(p, network));\n }\n // ENS\n _getProvider(chainId) {\n assert(false, \"provider cannot connect to target network\", \"UNSUPPORTED_OPERATION\", {\n operation: \"_getProvider()\"\n });\n }\n async getResolver(name) {\n return await EnsResolver.fromName(this, name);\n }\n async getAvatar(name) {\n const resolver = await this.getResolver(name);\n if (resolver) {\n return await resolver.getAvatar();\n }\n return null;\n }\n async resolveName(name) {\n const resolver = await this.getResolver(name);\n if (resolver) {\n return await resolver.getAddress();\n }\n return null;\n }\n async lookupAddress(address) {\n address = getAddress(address);\n const node = namehash(address.substring(2).toLowerCase() + \".addr.reverse\");\n try {\n const ensAddr = await EnsResolver.getEnsAddress(this);\n const ensContract = new Contract(ensAddr, [\n \"function resolver(bytes32) view returns (address)\"\n ], this);\n const resolver = await ensContract.resolver(node);\n if (resolver == null || resolver === ZeroAddress) {\n return null;\n }\n const resolverContract = new Contract(resolver, [\n \"function name(bytes32) view returns (string)\"\n ], this);\n const name = await resolverContract.name(node);\n // Failed forward resolution\n const check = await this.resolveName(name);\n if (check !== address) {\n return null;\n }\n return name;\n }\n catch (error) {\n // No data was returned from the resolver\n if (isError(error, \"BAD_DATA\") && error.value === \"0x\") {\n return null;\n }\n // Something reerted\n if (isError(error, \"CALL_EXCEPTION\")) {\n return null;\n }\n throw error;\n }\n return null;\n }\n async waitForTransaction(hash, _confirms, timeout) {\n const confirms = (_confirms != null) ? _confirms : 1;\n if (confirms === 0) {\n return this.getTransactionReceipt(hash);\n }\n return new Promise(async (resolve, reject) => {\n let timer = null;\n const listener = (async (blockNumber) => {\n try {\n const receipt = await this.getTransactionReceipt(hash);\n if (receipt != null) {\n if (blockNumber - receipt.blockNumber + 1 >= confirms) {\n resolve(receipt);\n //this.off(\"block\", listener);\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n return;\n }\n }\n }\n catch (error) {\n console.log(\"EEE\", error);\n }\n this.once(\"block\", listener);\n });\n if (timeout != null) {\n timer = setTimeout(() => {\n if (timer == null) {\n return;\n }\n timer = null;\n this.off(\"block\", listener);\n reject(makeError(\"timeout\", \"TIMEOUT\", { reason: \"timeout\" }));\n }, timeout);\n }\n listener(await this.getBlockNumber());\n });\n }\n async waitForBlock(blockTag) {\n assert(false, \"not implemented yet\", \"NOT_IMPLEMENTED\", {\n operation: \"waitForBlock\"\n });\n }\n /**\n * Clear a timer created using the [[_setTimeout]] method.\n */\n _clearTimeout(timerId) {\n const timer = this.#timers.get(timerId);\n if (!timer) {\n return;\n }\n if (timer.timer) {\n clearTimeout(timer.timer);\n }\n this.#timers.delete(timerId);\n }\n /**\n * Create a timer that will execute %%func%% after at least %%timeout%%\n * (in ms). If %%timeout%% is unspecified, then %%func%% will execute\n * in the next event loop.\n *\n * [Pausing](AbstractProvider-paused) the provider will pause any\n * associated timers.\n */\n _setTimeout(_func, timeout) {\n if (timeout == null) {\n timeout = 0;\n }\n const timerId = this.#nextTimer++;\n const func = () => {\n this.#timers.delete(timerId);\n _func();\n };\n if (this.paused) {\n this.#timers.set(timerId, { timer: null, func, time: timeout });\n }\n else {\n const timer = setTimeout(func, timeout);\n this.#timers.set(timerId, { timer, func, time: getTime() });\n }\n return timerId;\n }\n /**\n * Perform %%func%% on each subscriber.\n */\n _forEachSubscriber(func) {\n for (const sub of this.#subs.values()) {\n func(sub.subscriber);\n }\n }\n /**\n * Sub-classes may override this to customize subscription\n * implementations.\n */\n _getSubscriber(sub) {\n switch (sub.type) {\n case \"debug\":\n case \"error\":\n case \"network\":\n return new UnmanagedSubscriber(sub.type);\n case \"block\": {\n const subscriber = new PollingBlockSubscriber(this);\n subscriber.pollingInterval = this.pollingInterval;\n return subscriber;\n }\n case \"safe\":\n case \"finalized\":\n return new PollingBlockTagSubscriber(this, sub.type);\n case \"event\":\n return new PollingEventSubscriber(this, sub.filter);\n case \"transaction\":\n return new PollingTransactionSubscriber(this, sub.hash);\n case \"orphan\":\n return new PollingOrphanSubscriber(this, sub.filter);\n }\n throw new Error(`unsupported event: ${sub.type}`);\n }\n /**\n * If a [[Subscriber]] fails and needs to replace itself, this\n * method may be used.\n *\n * For example, this is used for providers when using the\n * ``eth_getFilterChanges`` method, which can return null if state\n * filters are not supported by the backend, allowing the Subscriber\n * to swap in a [[PollingEventSubscriber]].\n */\n _recoverSubscriber(oldSub, newSub) {\n for (const sub of this.#subs.values()) {\n if (sub.subscriber === oldSub) {\n if (sub.started) {\n sub.subscriber.stop();\n }\n sub.subscriber = newSub;\n if (sub.started) {\n newSub.start();\n }\n if (this.#pausedState != null) {\n newSub.pause(this.#pausedState);\n }\n break;\n }\n }\n }\n async #hasSub(event, emitArgs) {\n let sub = await getSubscription(event, this);\n // This is a log that is removing an existing log; we actually want\n // to emit an orphan event for the removed log\n if (sub.type === \"event\" && emitArgs && emitArgs.length > 0 && emitArgs[0].removed === true) {\n sub = await getSubscription({ orphan: \"drop-log\", log: emitArgs[0] }, this);\n }\n return this.#subs.get(sub.tag) || null;\n }\n async #getSub(event) {\n const subscription = await getSubscription(event, this);\n // Prevent tampering with our tag in any subclass' _getSubscriber\n const tag = subscription.tag;\n let sub = this.#subs.get(tag);\n if (!sub) {\n const subscriber = this._getSubscriber(subscription);\n const addressableMap = new WeakMap();\n const nameMap = new Map();\n sub = { subscriber, tag, addressableMap, nameMap, started: false, listeners: [] };\n this.#subs.set(tag, sub);\n }\n return sub;\n }\n async on(event, listener) {\n const sub = await this.#getSub(event);\n sub.listeners.push({ listener, once: false });\n if (!sub.started) {\n sub.subscriber.start();\n sub.started = true;\n if (this.#pausedState != null) {\n sub.subscriber.pause(this.#pausedState);\n }\n }\n return this;\n }\n async once(event, listener) {\n const sub = await this.#getSub(event);\n sub.listeners.push({ listener, once: true });\n if (!sub.started) {\n sub.subscriber.start();\n sub.started = true;\n if (this.#pausedState != null) {\n sub.subscriber.pause(this.#pausedState);\n }\n }\n return this;\n }\n async emit(event, ...args) {\n const sub = await this.#hasSub(event, args);\n // If there is not subscription or if a recent emit removed\n // the last of them (which also deleted the sub) do nothing\n if (!sub || sub.listeners.length === 0) {\n return false;\n }\n ;\n const count = sub.listeners.length;\n sub.listeners = sub.listeners.filter(({ listener, once }) => {\n const payload = new EventPayload(this, (once ? null : listener), event);\n try {\n listener.call(this, ...args, payload);\n }\n catch (error) { }\n return !once;\n });\n if (sub.listeners.length === 0) {\n if (sub.started) {\n sub.subscriber.stop();\n }\n this.#subs.delete(sub.tag);\n }\n return (count > 0);\n }\n async listenerCount(event) {\n if (event) {\n const sub = await this.#hasSub(event);\n if (!sub) {\n return 0;\n }\n return sub.listeners.length;\n }\n let total = 0;\n for (const { listeners } of this.#subs.values()) {\n total += listeners.length;\n }\n return total;\n }\n async listeners(event) {\n if (event) {\n const sub = await this.#hasSub(event);\n if (!sub) {\n return [];\n }\n return sub.listeners.map(({ listener }) => listener);\n }\n let result = [];\n for (const { listeners } of this.#subs.values()) {\n result = result.concat(listeners.map(({ listener }) => listener));\n }\n return result;\n }\n async off(event, listener) {\n const sub = await this.#hasSub(event);\n if (!sub) {\n return this;\n }\n if (listener) {\n const index = sub.listeners.map(({ listener }) => listener).indexOf(listener);\n if (index >= 0) {\n sub.listeners.splice(index, 1);\n }\n }\n if (!listener || sub.listeners.length === 0) {\n if (sub.started) {\n sub.subscriber.stop();\n }\n this.#subs.delete(sub.tag);\n }\n return this;\n }\n async removeAllListeners(event) {\n if (event) {\n const { tag, started, subscriber } = await this.#getSub(event);\n if (started) {\n subscriber.stop();\n }\n this.#subs.delete(tag);\n }\n else {\n for (const [tag, { started, subscriber }] of this.#subs) {\n if (started) {\n subscriber.stop();\n }\n this.#subs.delete(tag);\n }\n }\n return this;\n }\n // Alias for \"on\"\n async addListener(event, listener) {\n return await this.on(event, listener);\n }\n // Alias for \"off\"\n async removeListener(event, listener) {\n return this.off(event, listener);\n }\n /**\n * If this provider has been destroyed using the [[destroy]] method.\n *\n * Once destroyed, all resources are reclaimed, internal event loops\n * and timers are cleaned up and no further requests may be sent to\n * the provider.\n */\n get destroyed() {\n return this.#destroyed;\n }\n /**\n * Sub-classes may use this to shutdown any sockets or release their\n * resources and reject any pending requests.\n *\n * Sub-classes **must** call ``super.destroy()``.\n */\n destroy() {\n // Stop all listeners\n this.removeAllListeners();\n // Shut down all tiemrs\n for (const timerId of this.#timers.keys()) {\n this._clearTimeout(timerId);\n }\n this.#destroyed = true;\n }\n /**\n * Whether the provider is currently paused.\n *\n * A paused provider will not emit any events, and generally should\n * not make any requests to the network, but that is up to sub-classes\n * to manage.\n *\n * Setting ``paused = true`` is identical to calling ``.pause(false)``,\n * which will buffer any events that occur while paused until the\n * provider is unpaused.\n */\n get paused() { return (this.#pausedState != null); }\n set paused(pause) {\n if (!!pause === this.paused) {\n return;\n }\n if (this.paused) {\n this.resume();\n }\n else {\n this.pause(false);\n }\n }\n /**\n * Pause the provider. If %%dropWhilePaused%%, any events that occur\n * while paused are dropped, otherwise all events will be emitted once\n * the provider is unpaused.\n */\n pause(dropWhilePaused) {\n this.#lastBlockNumber = -1;\n if (this.#pausedState != null) {\n if (this.#pausedState == !!dropWhilePaused) {\n return;\n }\n assert(false, \"cannot change pause type; resume first\", \"UNSUPPORTED_OPERATION\", {\n operation: \"pause\"\n });\n }\n this._forEachSubscriber((s) => s.pause(dropWhilePaused));\n this.#pausedState = !!dropWhilePaused;\n for (const timer of this.#timers.values()) {\n // Clear the timer\n if (timer.timer) {\n clearTimeout(timer.timer);\n }\n // Remaining time needed for when we become unpaused\n timer.time = getTime() - timer.time;\n }\n }\n /**\n * Resume the provider.\n */\n resume() {\n if (this.#pausedState == null) {\n return;\n }\n this._forEachSubscriber((s) => s.resume());\n this.#pausedState = null;\n for (const timer of this.#timers.values()) {\n // Remaining time when we were paused\n let timeout = timer.time;\n if (timeout < 0) {\n timeout = 0;\n }\n // Start time (in cause paused, so we con compute remaininf time)\n timer.time = getTime();\n // Start the timer\n setTimeout(timer.func, timeout);\n }\n }\n}\nfunction _parseString(result, start) {\n try {\n const bytes = _parseBytes(result, start);\n if (bytes) {\n return toUtf8String(bytes);\n }\n }\n catch (error) { }\n return null;\n}\nfunction _parseBytes(result, start) {\n if (result === \"0x\") {\n return null;\n }\n try {\n const offset = getNumber(dataSlice(result, start, start + 32));\n const length = getNumber(dataSlice(result, offset, offset + 32));\n return dataSlice(result, offset + 32, offset + 32 + length);\n }\n catch (error) { }\n return null;\n}\nfunction numPad(value) {\n const result = toBeArray(value);\n if (result.length > 32) {\n throw new Error(\"internal; should not happen\");\n }\n const padded = new Uint8Array(32);\n padded.set(result, 32 - result.length);\n return padded;\n}\nfunction bytesPad(value) {\n if ((value.length % 32) === 0) {\n return value;\n }\n const result = new Uint8Array(Math.ceil(value.length / 32) * 32);\n result.set(value);\n return result;\n}\nconst empty = new Uint8Array([]);\n// ABI Encodes a series of (bytes, bytes, ...)\nfunction encodeBytes(datas) {\n const result = [];\n let byteCount = 0;\n // Add place-holders for pointers as we add items\n for (let i = 0; i < datas.length; i++) {\n result.push(empty);\n byteCount += 32;\n }\n for (let i = 0; i < datas.length; i++) {\n const data = getBytes(datas[i]);\n // Update the bytes offset\n result[i] = numPad(byteCount);\n // The length and padded value of data\n result.push(numPad(data.length));\n result.push(bytesPad(data));\n byteCount += 32 + Math.ceil(data.length / 32) * 32;\n }\n return concat(result);\n}\nconst zeros = \"0x0000000000000000000000000000000000000000000000000000000000000000\";\nfunction parseOffchainLookup(data) {\n const result = {\n sender: \"\", urls: [], calldata: \"\", selector: \"\", extraData: \"\", errorArgs: []\n };\n assert(dataLength(data) >= 5 * 32, \"insufficient OffchainLookup data\", \"OFFCHAIN_FAULT\", {\n reason: \"insufficient OffchainLookup data\"\n });\n const sender = dataSlice(data, 0, 32);\n assert(dataSlice(sender, 0, 12) === dataSlice(zeros, 0, 12), \"corrupt OffchainLookup sender\", \"OFFCHAIN_FAULT\", {\n reason: \"corrupt OffchainLookup sender\"\n });\n result.sender = dataSlice(sender, 12);\n // Read the URLs from the response\n try {\n const urls = [];\n const urlsOffset = getNumber(dataSlice(data, 32, 64));\n const urlsLength = getNumber(dataSlice(data, urlsOffset, urlsOffset + 32));\n const urlsData = dataSlice(data, urlsOffset + 32);\n for (let u = 0; u < urlsLength; u++) {\n const url = _parseString(urlsData, u * 32);\n if (url == null) {\n throw new Error(\"abort\");\n }\n urls.push(url);\n }\n result.urls = urls;\n }\n catch (error) {\n assert(false, \"corrupt OffchainLookup urls\", \"OFFCHAIN_FAULT\", {\n reason: \"corrupt OffchainLookup urls\"\n });\n }\n // Get the CCIP calldata to forward\n try {\n const calldata = _parseBytes(data, 64);\n if (calldata == null) {\n throw new Error(\"abort\");\n }\n result.calldata = calldata;\n }\n catch (error) {\n assert(false, \"corrupt OffchainLookup calldata\", \"OFFCHAIN_FAULT\", {\n reason: \"corrupt OffchainLookup calldata\"\n });\n }\n // Get the callbackSelector (bytes4)\n assert(dataSlice(data, 100, 128) === dataSlice(zeros, 0, 28), \"corrupt OffchainLookup callbaackSelector\", \"OFFCHAIN_FAULT\", {\n reason: \"corrupt OffchainLookup callbaackSelector\"\n });\n result.selector = dataSlice(data, 96, 100);\n // Get the extra data to send back to the contract as context\n try {\n const extraData = _parseBytes(data, 128);\n if (extraData == null) {\n throw new Error(\"abort\");\n }\n result.extraData = extraData;\n }\n catch (error) {\n assert(false, \"corrupt OffchainLookup extraData\", \"OFFCHAIN_FAULT\", {\n reason: \"corrupt OffchainLookup extraData\"\n });\n }\n result.errorArgs = \"sender,urls,calldata,selector,extraData\".split(/,/).map((k) => result[k]);\n return result;\n}\n//# sourceMappingURL=abstract-provider.js.map","/**\n * Generally the [[Wallet]] and [[JsonRpcSigner]] and their sub-classes\n * are sufficient for most developers, but this is provided to\n * fascilitate more complex Signers.\n *\n * @_section: api/providers/abstract-signer: Subclassing Signer [abstract-signer]\n */\nimport { resolveAddress } from \"../address/index.js\";\nimport { Transaction } from \"../transaction/index.js\";\nimport { defineProperties, getBigInt, resolveProperties, assert, assertArgument } from \"../utils/index.js\";\nimport { copyRequest } from \"./provider.js\";\nfunction checkProvider(signer, operation) {\n if (signer.provider) {\n return signer.provider;\n }\n assert(false, \"missing provider\", \"UNSUPPORTED_OPERATION\", { operation });\n}\nasync function populate(signer, tx) {\n let pop = copyRequest(tx);\n if (pop.to != null) {\n pop.to = resolveAddress(pop.to, signer);\n }\n if (pop.from != null) {\n const from = pop.from;\n pop.from = Promise.all([\n signer.getAddress(),\n resolveAddress(from, signer)\n ]).then(([address, from]) => {\n assertArgument(address.toLowerCase() === from.toLowerCase(), \"transaction from mismatch\", \"tx.from\", from);\n return address;\n });\n }\n else {\n pop.from = signer.getAddress();\n }\n return await resolveProperties(pop);\n}\n/**\n * An **AbstractSigner** includes most of teh functionality required\n * to get a [[Signer]] working as expected, but requires a few\n * Signer-specific methods be overridden.\n *\n */\nexport class AbstractSigner {\n /**\n * The provider this signer is connected to.\n */\n provider;\n /**\n * Creates a new Signer connected to %%provider%%.\n */\n constructor(provider) {\n defineProperties(this, { provider: (provider || null) });\n }\n async getNonce(blockTag) {\n return checkProvider(this, \"getTransactionCount\").getTransactionCount(await this.getAddress(), blockTag);\n }\n async populateCall(tx) {\n const pop = await populate(this, tx);\n return pop;\n }\n async populateTransaction(tx) {\n const provider = checkProvider(this, \"populateTransaction\");\n const pop = await populate(this, tx);\n if (pop.nonce == null) {\n pop.nonce = await this.getNonce(\"pending\");\n }\n if (pop.gasLimit == null) {\n pop.gasLimit = await this.estimateGas(pop);\n }\n // Populate the chain ID\n const network = await (this.provider).getNetwork();\n if (pop.chainId != null) {\n const chainId = getBigInt(pop.chainId);\n assertArgument(chainId === network.chainId, \"transaction chainId mismatch\", \"tx.chainId\", tx.chainId);\n }\n else {\n pop.chainId = network.chainId;\n }\n // Do not allow mixing pre-eip-1559 and eip-1559 properties\n const hasEip1559 = (pop.maxFeePerGas != null || pop.maxPriorityFeePerGas != null);\n if (pop.gasPrice != null && (pop.type === 2 || hasEip1559)) {\n assertArgument(false, \"eip-1559 transaction do not support gasPrice\", \"tx\", tx);\n }\n else if ((pop.type === 0 || pop.type === 1) && hasEip1559) {\n assertArgument(false, \"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas\", \"tx\", tx);\n }\n if ((pop.type === 2 || pop.type == null) && (pop.maxFeePerGas != null && pop.maxPriorityFeePerGas != null)) {\n // Fully-formed EIP-1559 transaction (skip getFeeData)\n pop.type = 2;\n }\n else if (pop.type === 0 || pop.type === 1) {\n // Explicit Legacy or EIP-2930 transaction\n // We need to get fee data to determine things\n const feeData = await provider.getFeeData();\n assert(feeData.gasPrice != null, \"network does not support gasPrice\", \"UNSUPPORTED_OPERATION\", {\n operation: \"getGasPrice\"\n });\n // Populate missing gasPrice\n if (pop.gasPrice == null) {\n pop.gasPrice = feeData.gasPrice;\n }\n }\n else {\n // We need to get fee data to determine things\n const feeData = await provider.getFeeData();\n if (pop.type == null) {\n // We need to auto-detect the intended type of this transaction...\n if (feeData.maxFeePerGas != null && feeData.maxPriorityFeePerGas != null) {\n // The network supports EIP-1559!\n // Upgrade transaction from null to eip-1559\n if (pop.authorizationList && pop.authorizationList.length) {\n pop.type = 4;\n }\n else {\n pop.type = 2;\n }\n if (pop.gasPrice != null) {\n // Using legacy gasPrice property on an eip-1559 network,\n // so use gasPrice as both fee properties\n const gasPrice = pop.gasPrice;\n delete pop.gasPrice;\n pop.maxFeePerGas = gasPrice;\n pop.maxPriorityFeePerGas = gasPrice;\n }\n else {\n // Populate missing fee data\n if (pop.maxFeePerGas == null) {\n pop.maxFeePerGas = feeData.maxFeePerGas;\n }\n if (pop.maxPriorityFeePerGas == null) {\n pop.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas;\n }\n }\n }\n else if (feeData.gasPrice != null) {\n // Network doesn't support EIP-1559...\n // ...but they are trying to use EIP-1559 properties\n assert(!hasEip1559, \"network does not support EIP-1559\", \"UNSUPPORTED_OPERATION\", {\n operation: \"populateTransaction\"\n });\n // Populate missing fee data\n if (pop.gasPrice == null) {\n pop.gasPrice = feeData.gasPrice;\n }\n // Explicitly set untyped transaction to legacy\n // @TODO: Maybe this shold allow type 1?\n pop.type = 0;\n }\n else {\n // getFeeData has failed us.\n assert(false, \"failed to get consistent fee data\", \"UNSUPPORTED_OPERATION\", {\n operation: \"signer.getFeeData\"\n });\n }\n }\n else if (pop.type === 2 || pop.type === 3 || pop.type === 4) {\n // Explicitly using EIP-1559 or EIP-4844\n // Populate missing fee data\n if (pop.maxFeePerGas == null) {\n pop.maxFeePerGas = feeData.maxFeePerGas;\n }\n if (pop.maxPriorityFeePerGas == null) {\n pop.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas;\n }\n }\n }\n //@TOOD: Don't await all over the place; save them up for\n // the end for better batching\n return await resolveProperties(pop);\n }\n async populateAuthorization(_auth) {\n const auth = Object.assign({}, _auth);\n // Add a chain ID if not explicitly set to 0\n if (auth.chainId == null) {\n auth.chainId = (await checkProvider(this, \"getNetwork\").getNetwork()).chainId;\n }\n // @TODO: Take chain ID into account when populating noce?\n if (auth.nonce == null) {\n auth.nonce = await this.getNonce();\n }\n return auth;\n }\n async estimateGas(tx) {\n return checkProvider(this, \"estimateGas\").estimateGas(await this.populateCall(tx));\n }\n async call(tx) {\n return checkProvider(this, \"call\").call(await this.populateCall(tx));\n }\n async resolveName(name) {\n const provider = checkProvider(this, \"resolveName\");\n return await provider.resolveName(name);\n }\n async sendTransaction(tx) {\n const provider = checkProvider(this, \"sendTransaction\");\n const pop = await this.populateTransaction(tx);\n delete pop.from;\n const txObj = Transaction.from(pop);\n return await provider.broadcastTransaction(await this.signTransaction(txObj));\n }\n // @TODO: in v7 move this to be abstract\n authorize(authorization) {\n assert(false, \"authorization not implemented for this signer\", \"UNSUPPORTED_OPERATION\", { operation: \"authorize\" });\n }\n}\n/**\n * A **VoidSigner** is a class designed to allow an address to be used\n * in any API which accepts a Signer, but for which there are no\n * credentials available to perform any actual signing.\n *\n * This for example allow impersonating an account for the purpose of\n * static calls or estimating gas, but does not allow sending transactions.\n */\nexport class VoidSigner extends AbstractSigner {\n /**\n * The signer address.\n */\n address;\n /**\n * Creates a new **VoidSigner** with %%address%% attached to\n * %%provider%%.\n */\n constructor(address, provider) {\n super(provider);\n defineProperties(this, { address });\n }\n async getAddress() { return this.address; }\n connect(provider) {\n return new VoidSigner(this.address, provider);\n }\n #throwUnsupported(suffix, operation) {\n assert(false, `VoidSigner cannot sign ${suffix}`, \"UNSUPPORTED_OPERATION\", { operation });\n }\n async signTransaction(tx) {\n this.#throwUnsupported(\"transactions\", \"signTransaction\");\n }\n async signMessage(message) {\n this.#throwUnsupported(\"messages\", \"signMessage\");\n }\n async signTypedData(domain, types, value) {\n this.#throwUnsupported(\"typed-data\", \"signTypedData\");\n }\n}\n//# sourceMappingURL=abstract-signer.js.map","/**\n * There are many awesome community services that provide Ethereum\n * nodes both for developers just starting out and for large-scale\n * communities.\n *\n * @_section: api/providers/thirdparty: Community Providers [thirdparty]\n */\n// Show the throttle message only once per service\nconst shown = new Set();\n/**\n * Displays a warning in the console when the community resource is\n * being used too heavily by the app, recommending the developer\n * acquire their own credentials instead of using the community\n * credentials.\n *\n * The notification will only occur once per service.\n */\nexport function showThrottleMessage(service) {\n if (shown.has(service)) {\n return;\n }\n shown.add(service);\n console.log(\"========= NOTICE =========\");\n console.log(`Request-Rate Exceeded for ${service} (this message will not be repeated)`);\n console.log(\"\");\n console.log(\"The default API keys for each service are provided as a highly-throttled,\");\n console.log(\"community resource for low-traffic projects and early prototyping.\");\n console.log(\"\");\n console.log(\"While your application will continue to function, we highly recommended\");\n console.log(\"signing up for your own API keys to improve performance, increase your\");\n console.log(\"request rate/limit and enable other perks, such as metrics and advanced APIs.\");\n console.log(\"\");\n console.log(\"For more details: https:/\\/docs.ethers.org/api-keys/\");\n console.log(\"==========================\");\n}\n//# sourceMappingURL=community.js.map","import { isError } from \"../utils/index.js\";\nimport { PollingEventSubscriber } from \"./subscriber-polling.js\";\nfunction copy(obj) {\n return JSON.parse(JSON.stringify(obj));\n}\n/**\n * Some backends support subscribing to events using a Filter ID.\n *\n * When subscribing with this technique, the node issues a unique\n * //Filter ID//. At this point the node dedicates resources to\n * the filter, so that periodic calls to follow up on the //Filter ID//\n * will receive any events since the last call.\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class FilterIdSubscriber {\n #provider;\n #filterIdPromise;\n #poller;\n #running;\n #network;\n #hault;\n /**\n * Creates a new **FilterIdSubscriber** which will used [[_subscribe]]\n * and [[_emitResults]] to setup the subscription and provide the event\n * to the %%provider%%.\n */\n constructor(provider) {\n this.#provider = provider;\n this.#filterIdPromise = null;\n this.#poller = this.#poll.bind(this);\n this.#running = false;\n this.#network = null;\n this.#hault = false;\n }\n /**\n * Sub-classes **must** override this to begin the subscription.\n */\n _subscribe(provider) {\n throw new Error(\"subclasses must override this\");\n }\n /**\n * Sub-classes **must** override this handle the events.\n */\n _emitResults(provider, result) {\n throw new Error(\"subclasses must override this\");\n }\n /**\n * Sub-classes **must** override this handle recovery on errors.\n */\n _recover(provider) {\n throw new Error(\"subclasses must override this\");\n }\n async #poll(blockNumber) {\n try {\n // Subscribe if necessary\n if (this.#filterIdPromise == null) {\n this.#filterIdPromise = this._subscribe(this.#provider);\n }\n // Get the Filter ID\n let filterId = null;\n try {\n filterId = await this.#filterIdPromise;\n }\n catch (error) {\n if (!isError(error, \"UNSUPPORTED_OPERATION\") || error.operation !== \"eth_newFilter\") {\n throw error;\n }\n }\n // The backend does not support Filter ID; downgrade to\n // polling\n if (filterId == null) {\n this.#filterIdPromise = null;\n this.#provider._recoverSubscriber(this, this._recover(this.#provider));\n return;\n }\n const network = await this.#provider.getNetwork();\n if (!this.#network) {\n this.#network = network;\n }\n if (this.#network.chainId !== network.chainId) {\n throw new Error(\"chaid changed\");\n }\n if (this.#hault) {\n return;\n }\n const result = await this.#provider.send(\"eth_getFilterChanges\", [filterId]);\n await this._emitResults(this.#provider, result);\n }\n catch (error) {\n console.log(\"@TODO\", error);\n }\n this.#provider.once(\"block\", this.#poller);\n }\n #teardown() {\n const filterIdPromise = this.#filterIdPromise;\n if (filterIdPromise) {\n this.#filterIdPromise = null;\n filterIdPromise.then((filterId) => {\n if (this.#provider.destroyed) {\n return;\n }\n this.#provider.send(\"eth_uninstallFilter\", [filterId]);\n });\n }\n }\n start() {\n if (this.#running) {\n return;\n }\n this.#running = true;\n this.#poll(-2);\n }\n stop() {\n if (!this.#running) {\n return;\n }\n this.#running = false;\n this.#hault = true;\n this.#teardown();\n this.#provider.off(\"block\", this.#poller);\n }\n pause(dropWhilePaused) {\n if (dropWhilePaused) {\n this.#teardown();\n }\n this.#provider.off(\"block\", this.#poller);\n }\n resume() { this.start(); }\n}\n/**\n * A **FilterIdSubscriber** for receiving contract events.\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class FilterIdEventSubscriber extends FilterIdSubscriber {\n #event;\n /**\n * Creates a new **FilterIdEventSubscriber** attached to %%provider%%\n * listening for %%filter%%.\n */\n constructor(provider, filter) {\n super(provider);\n this.#event = copy(filter);\n }\n _recover(provider) {\n return new PollingEventSubscriber(provider, this.#event);\n }\n async _subscribe(provider) {\n const filterId = await provider.send(\"eth_newFilter\", [this.#event]);\n return filterId;\n }\n async _emitResults(provider, results) {\n for (const result of results) {\n provider.emit(this.#event, provider._wrapLog(result, provider._network));\n }\n }\n}\n/**\n * A **FilterIdSubscriber** for receiving pending transactions events.\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class FilterIdPendingSubscriber extends FilterIdSubscriber {\n async _subscribe(provider) {\n return await provider.send(\"eth_newPendingTransactionFilter\", []);\n }\n async _emitResults(provider, results) {\n for (const result of results) {\n provider.emit(\"pending\", result);\n }\n }\n}\n//# sourceMappingURL=subscriber-filterid.js.map","/**\n * One of the most common ways to interact with the blockchain is\n * by a node running a JSON-RPC interface which can be connected to,\n * based on the transport, using:\n *\n * - HTTP or HTTPS - [[JsonRpcProvider]]\n * - WebSocket - [[WebSocketProvider]]\n * - IPC - [[IpcSocketProvider]]\n *\n * @_section: api/providers/jsonrpc:JSON-RPC Provider [about-jsonrpcProvider]\n */\n// @TODO:\n// - Add the batching API\n// https://playground.open-rpc.org/?schemaUrl=https://raw.githubusercontent.com/ethereum/eth1.0-apis/assembled-spec/openrpc.json&uiSchema%5BappBar%5D%5Bui:splitView%5D=true&uiSchema%5BappBar%5D%5Bui:input%5D=false&uiSchema%5BappBar%5D%5Bui:examplesDropdown%5D=false\nimport { AbiCoder } from \"../abi/index.js\";\nimport { getAddress, resolveAddress } from \"../address/index.js\";\nimport { TypedDataEncoder } from \"../hash/index.js\";\nimport { accessListify, authorizationify } from \"../transaction/index.js\";\nimport { defineProperties, getBigInt, hexlify, isHexString, toQuantity, toUtf8Bytes, isError, makeError, assert, assertArgument, FetchRequest, resolveProperties } from \"../utils/index.js\";\nimport { AbstractProvider, UnmanagedSubscriber } from \"./abstract-provider.js\";\nimport { AbstractSigner } from \"./abstract-signer.js\";\nimport { Network } from \"./network.js\";\nimport { FilterIdEventSubscriber, FilterIdPendingSubscriber } from \"./subscriber-filterid.js\";\nimport { PollingEventSubscriber } from \"./subscriber-polling.js\";\nconst Primitive = \"bigint,boolean,function,number,string,symbol\".split(/,/g);\n//const Methods = \"getAddress,then\".split(/,/g);\nfunction deepCopy(value) {\n if (value == null || Primitive.indexOf(typeof (value)) >= 0) {\n return value;\n }\n // Keep any Addressable\n if (typeof (value.getAddress) === \"function\") {\n return value;\n }\n if (Array.isArray(value)) {\n return (value.map(deepCopy));\n }\n if (typeof (value) === \"object\") {\n return Object.keys(value).reduce((accum, key) => {\n accum[key] = value[key];\n return accum;\n }, {});\n }\n throw new Error(`should not happen: ${value} (${typeof (value)})`);\n}\nfunction stall(duration) {\n return new Promise((resolve) => { setTimeout(resolve, duration); });\n}\nfunction getLowerCase(value) {\n if (value) {\n return value.toLowerCase();\n }\n return value;\n}\nfunction isPollable(value) {\n return (value && typeof (value.pollingInterval) === \"number\");\n}\nconst defaultOptions = {\n polling: false,\n staticNetwork: null,\n batchStallTime: 10,\n batchMaxSize: (1 << 20),\n batchMaxCount: 100,\n cacheTimeout: 250,\n pollingInterval: 4000\n};\n// @TODO: Unchecked Signers\nexport class JsonRpcSigner extends AbstractSigner {\n address;\n constructor(provider, address) {\n super(provider);\n address = getAddress(address);\n defineProperties(this, { address });\n }\n connect(provider) {\n assert(false, \"cannot reconnect JsonRpcSigner\", \"UNSUPPORTED_OPERATION\", {\n operation: \"signer.connect\"\n });\n }\n async getAddress() {\n return this.address;\n }\n // JSON-RPC will automatially fill in nonce, etc. so we just check from\n async populateTransaction(tx) {\n return await this.populateCall(tx);\n }\n // Returns just the hash of the transaction after sent, which is what\n // the bare JSON-RPC API does;\n async sendUncheckedTransaction(_tx) {\n const tx = deepCopy(_tx);\n const promises = [];\n // Make sure the from matches the sender\n if (tx.from) {\n const _from = tx.from;\n promises.push((async () => {\n const from = await resolveAddress(_from, this.provider);\n assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(), \"from address mismatch\", \"transaction\", _tx);\n tx.from = from;\n })());\n }\n else {\n tx.from = this.address;\n }\n // The JSON-RPC for eth_sendTransaction uses 90000 gas; if the user\n // wishes to use this, it is easy to specify explicitly, otherwise\n // we look it up for them.\n if (tx.gasLimit == null) {\n promises.push((async () => {\n tx.gasLimit = await this.provider.estimateGas({ ...tx, from: this.address });\n })());\n }\n // The address may be an ENS name or Addressable\n if (tx.to != null) {\n const _to = tx.to;\n promises.push((async () => {\n tx.to = await resolveAddress(_to, this.provider);\n })());\n }\n // Wait until all of our properties are filled in\n if (promises.length) {\n await Promise.all(promises);\n }\n const hexTx = this.provider.getRpcTransaction(tx);\n return this.provider.send(\"eth_sendTransaction\", [hexTx]);\n }\n async sendTransaction(tx) {\n // This cannot be mined any earlier than any recent block\n const blockNumber = await this.provider.getBlockNumber();\n // Send the transaction\n const hash = await this.sendUncheckedTransaction(tx);\n // Unfortunately, JSON-RPC only provides and opaque transaction hash\n // for a response, and we need the actual transaction, so we poll\n // for it; it should show up very quickly\n return await (new Promise((resolve, reject) => {\n const timeouts = [1000, 100];\n let invalids = 0;\n const checkTx = async () => {\n try {\n // Try getting the transaction\n const tx = await this.provider.getTransaction(hash);\n if (tx != null) {\n resolve(tx.replaceableTransaction(blockNumber));\n return;\n }\n }\n catch (error) {\n // If we were cancelled: stop polling.\n // If the data is bad: the node returns bad transactions\n // If the network changed: calling again will also fail\n // If unsupported: likely destroyed\n if (isError(error, \"CANCELLED\") || isError(error, \"BAD_DATA\") ||\n isError(error, \"NETWORK_ERROR\") || isError(error, \"UNSUPPORTED_OPERATION\")) {\n if (error.info == null) {\n error.info = {};\n }\n error.info.sendTransactionHash = hash;\n reject(error);\n return;\n }\n // Stop-gap for misbehaving backends; see #4513\n if (isError(error, \"INVALID_ARGUMENT\")) {\n invalids++;\n if (error.info == null) {\n error.info = {};\n }\n error.info.sendTransactionHash = hash;\n if (invalids > 10) {\n reject(error);\n return;\n }\n }\n // Notify anyone that cares; but we will try again, since\n // it is likely an intermittent service error\n this.provider.emit(\"error\", makeError(\"failed to fetch transation after sending (will try again)\", \"UNKNOWN_ERROR\", { error }));\n }\n // Wait another 4 seconds\n this.provider._setTimeout(() => { checkTx(); }, timeouts.pop() || 4000);\n };\n checkTx();\n }));\n }\n async signTransaction(_tx) {\n const tx = deepCopy(_tx);\n // Make sure the from matches the sender\n if (tx.from) {\n const from = await resolveAddress(tx.from, this.provider);\n assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(), \"from address mismatch\", \"transaction\", _tx);\n tx.from = from;\n }\n else {\n tx.from = this.address;\n }\n const hexTx = this.provider.getRpcTransaction(tx);\n return await this.provider.send(\"eth_signTransaction\", [hexTx]);\n }\n async signMessage(_message) {\n const message = ((typeof (_message) === \"string\") ? toUtf8Bytes(_message) : _message);\n return await this.provider.send(\"personal_sign\", [\n hexlify(message), this.address.toLowerCase()\n ]);\n }\n async signTypedData(domain, types, _value) {\n const value = deepCopy(_value);\n // Populate any ENS names (in-place)\n const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (value) => {\n const address = await resolveAddress(value);\n assertArgument(address != null, \"TypedData does not support null address\", \"value\", value);\n return address;\n });\n return await this.provider.send(\"eth_signTypedData_v4\", [\n this.address.toLowerCase(),\n JSON.stringify(TypedDataEncoder.getPayload(populated.domain, types, populated.value))\n ]);\n }\n async unlock(password) {\n return this.provider.send(\"personal_unlockAccount\", [\n this.address.toLowerCase(), password, null\n ]);\n }\n // https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign\n async _legacySignMessage(_message) {\n const message = ((typeof (_message) === \"string\") ? toUtf8Bytes(_message) : _message);\n return await this.provider.send(\"eth_sign\", [\n this.address.toLowerCase(), hexlify(message)\n ]);\n }\n}\n/**\n * The JsonRpcApiProvider is an abstract class and **MUST** be\n * sub-classed.\n *\n * It provides the base for all JSON-RPC-based Provider interaction.\n *\n * Sub-classing Notes:\n * - a sub-class MUST override _send\n * - a sub-class MUST call the `_start()` method once connected\n */\nexport class JsonRpcApiProvider extends AbstractProvider {\n #options;\n // The next ID to use for the JSON-RPC ID field\n #nextId;\n // Payloads are queued and triggered in batches using the drainTimer\n #payloads;\n #drainTimer;\n #notReady;\n #network;\n #pendingDetectNetwork;\n #scheduleDrain() {\n if (this.#drainTimer) {\n return;\n }\n // If we aren't using batching, no harm in sending it immediately\n const stallTime = (this._getOption(\"batchMaxCount\") === 1) ? 0 : this._getOption(\"batchStallTime\");\n this.#drainTimer = setTimeout(() => {\n this.#drainTimer = null;\n const payloads = this.#payloads;\n this.#payloads = [];\n while (payloads.length) {\n // Create payload batches that satisfy our batch constraints\n const batch = [(payloads.shift())];\n while (payloads.length) {\n if (batch.length === this.#options.batchMaxCount) {\n break;\n }\n batch.push((payloads.shift()));\n const bytes = JSON.stringify(batch.map((p) => p.payload));\n if (bytes.length > this.#options.batchMaxSize) {\n payloads.unshift((batch.pop()));\n break;\n }\n }\n // Process the result to each payload\n (async () => {\n const payload = ((batch.length === 1) ? batch[0].payload : batch.map((p) => p.payload));\n this.emit(\"debug\", { action: \"sendRpcPayload\", payload });\n try {\n const result = await this._send(payload);\n this.emit(\"debug\", { action: \"receiveRpcResult\", result });\n // Process results in batch order\n for (const { resolve, reject, payload } of batch) {\n if (this.destroyed) {\n reject(makeError(\"provider destroyed; cancelled request\", \"UNSUPPORTED_OPERATION\", { operation: payload.method }));\n continue;\n }\n // Find the matching result\n const resp = result.filter((r) => (r.id === payload.id))[0];\n // No result; the node failed us in unexpected ways\n if (resp == null) {\n const error = makeError(\"missing response for request\", \"BAD_DATA\", {\n value: result, info: { payload }\n });\n this.emit(\"error\", error);\n reject(error);\n continue;\n }\n // The response is an error\n if (\"error\" in resp) {\n reject(this.getRpcError(payload, resp));\n continue;\n }\n // All good; send the result\n resolve(resp.result);\n }\n }\n catch (error) {\n this.emit(\"debug\", { action: \"receiveRpcError\", error });\n for (const { reject } of batch) {\n // @TODO: augment the error with the payload\n reject(error);\n }\n }\n })();\n }\n }, stallTime);\n }\n constructor(network, options) {\n super(network, options);\n this.#nextId = 1;\n this.#options = Object.assign({}, defaultOptions, options || {});\n this.#payloads = [];\n this.#drainTimer = null;\n this.#network = null;\n this.#pendingDetectNetwork = null;\n {\n let resolve = null;\n const promise = new Promise((_resolve) => {\n resolve = _resolve;\n });\n this.#notReady = { promise, resolve };\n }\n const staticNetwork = this._getOption(\"staticNetwork\");\n if (typeof (staticNetwork) === \"boolean\") {\n assertArgument(!staticNetwork || network !== \"any\", \"staticNetwork cannot be used on special network 'any'\", \"options\", options);\n if (staticNetwork && network != null) {\n this.#network = Network.from(network);\n }\n }\n else if (staticNetwork) {\n // Make sure any static network is compatbile with the provided netwrok\n assertArgument(network == null || staticNetwork.matches(network), \"staticNetwork MUST match network object\", \"options\", options);\n this.#network = staticNetwork;\n }\n }\n /**\n * Returns the value associated with the option %%key%%.\n *\n * Sub-classes can use this to inquire about configuration options.\n */\n _getOption(key) {\n return this.#options[key];\n }\n /**\n * Gets the [[Network]] this provider has committed to. On each call, the network\n * is detected, and if it has changed, the call will reject.\n */\n get _network() {\n assert(this.#network, \"network is not available yet\", \"NETWORK_ERROR\");\n return this.#network;\n }\n /**\n * Resolves to the non-normalized value by performing %%req%%.\n *\n * Sub-classes may override this to modify behavior of actions,\n * and should generally call ``super._perform`` as a fallback.\n */\n async _perform(req) {\n // Legacy networks do not like the type field being passed along (which\n // is fair), so we delete type if it is 0 and a non-EIP-1559 network\n if (req.method === \"call\" || req.method === \"estimateGas\") {\n let tx = req.transaction;\n if (tx && tx.type != null && getBigInt(tx.type)) {\n // If there are no EIP-1559 or newer properties, it might be pre-EIP-1559\n if (tx.maxFeePerGas == null && tx.maxPriorityFeePerGas == null) {\n const feeData = await this.getFeeData();\n if (feeData.maxFeePerGas == null && feeData.maxPriorityFeePerGas == null) {\n // Network doesn't know about EIP-1559 (and hence type)\n req = Object.assign({}, req, {\n transaction: Object.assign({}, tx, { type: undefined })\n });\n }\n }\n }\n }\n const request = this.getRpcRequest(req);\n if (request != null) {\n return await this.send(request.method, request.args);\n }\n return super._perform(req);\n }\n /**\n * Sub-classes may override this; it detects the *actual* network that\n * we are **currently** connected to.\n *\n * Keep in mind that [[send]] may only be used once [[ready]], otherwise the\n * _send primitive must be used instead.\n */\n async _detectNetwork() {\n const network = this._getOption(\"staticNetwork\");\n if (network) {\n if (network === true) {\n if (this.#network) {\n return this.#network;\n }\n }\n else {\n return network;\n }\n }\n if (this.#pendingDetectNetwork) {\n return await this.#pendingDetectNetwork;\n }\n // If we are ready, use ``send``, which enabled requests to be batched\n if (this.ready) {\n this.#pendingDetectNetwork = (async () => {\n try {\n const result = Network.from(getBigInt(await this.send(\"eth_chainId\", [])));\n this.#pendingDetectNetwork = null;\n return result;\n }\n catch (error) {\n this.#pendingDetectNetwork = null;\n throw error;\n }\n })();\n return await this.#pendingDetectNetwork;\n }\n // We are not ready yet; use the primitive _send\n this.#pendingDetectNetwork = (async () => {\n const payload = {\n id: this.#nextId++, method: \"eth_chainId\", params: [], jsonrpc: \"2.0\"\n };\n this.emit(\"debug\", { action: \"sendRpcPayload\", payload });\n let result;\n try {\n result = (await this._send(payload))[0];\n this.#pendingDetectNetwork = null;\n }\n catch (error) {\n this.#pendingDetectNetwork = null;\n this.emit(\"debug\", { action: \"receiveRpcError\", error });\n throw error;\n }\n this.emit(\"debug\", { action: \"receiveRpcResult\", result });\n if (\"result\" in result) {\n return Network.from(getBigInt(result.result));\n }\n throw this.getRpcError(payload, result);\n })();\n return await this.#pendingDetectNetwork;\n }\n /**\n * Sub-classes **MUST** call this. Until [[_start]] has been called, no calls\n * will be passed to [[_send]] from [[send]]. If it is overridden, then\n * ``super._start()`` **MUST** be called.\n *\n * Calling it multiple times is safe and has no effect.\n */\n _start() {\n if (this.#notReady == null || this.#notReady.resolve == null) {\n return;\n }\n this.#notReady.resolve();\n this.#notReady = null;\n (async () => {\n // Bootstrap the network\n while (this.#network == null && !this.destroyed) {\n try {\n this.#network = await this._detectNetwork();\n }\n catch (error) {\n if (this.destroyed) {\n break;\n }\n console.log(\"JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)\");\n this.emit(\"error\", makeError(\"failed to bootstrap network detection\", \"NETWORK_ERROR\", { event: \"initial-network-discovery\", info: { error } }));\n await stall(1000);\n }\n }\n // Start dispatching requests\n this.#scheduleDrain();\n })();\n }\n /**\n * Resolves once the [[_start]] has been called. This can be used in\n * sub-classes to defer sending data until the connection has been\n * established.\n */\n async _waitUntilReady() {\n if (this.#notReady == null) {\n return;\n }\n return await this.#notReady.promise;\n }\n /**\n * Return a Subscriber that will manage the %%sub%%.\n *\n * Sub-classes may override this to modify the behavior of\n * subscription management.\n */\n _getSubscriber(sub) {\n // Pending Filters aren't availble via polling\n if (sub.type === \"pending\") {\n return new FilterIdPendingSubscriber(this);\n }\n if (sub.type === \"event\") {\n if (this._getOption(\"polling\")) {\n return new PollingEventSubscriber(this, sub.filter);\n }\n return new FilterIdEventSubscriber(this, sub.filter);\n }\n // Orphaned Logs are handled automatically, by the filter, since\n // logs with removed are emitted by it\n if (sub.type === \"orphan\" && sub.filter.orphan === \"drop-log\") {\n return new UnmanagedSubscriber(\"orphan\");\n }\n return super._getSubscriber(sub);\n }\n /**\n * Returns true only if the [[_start]] has been called.\n */\n get ready() { return this.#notReady == null; }\n /**\n * Returns %%tx%% as a normalized JSON-RPC transaction request,\n * which has all values hexlified and any numeric values converted\n * to Quantity values.\n */\n getRpcTransaction(tx) {\n const result = {};\n // JSON-RPC now requires numeric values to be \"quantity\" values\n [\"chainId\", \"gasLimit\", \"gasPrice\", \"type\", \"maxFeePerGas\", \"maxPriorityFeePerGas\", \"nonce\", \"value\"].forEach((key) => {\n if (tx[key] == null) {\n return;\n }\n let dstKey = key;\n if (key === \"gasLimit\") {\n dstKey = \"gas\";\n }\n result[dstKey] = toQuantity(getBigInt(tx[key], `tx.${key}`));\n });\n // Make sure addresses and data are lowercase\n [\"from\", \"to\", \"data\"].forEach((key) => {\n if (tx[key] == null) {\n return;\n }\n result[key] = hexlify(tx[key]);\n });\n // Normalize the access list object\n if (tx.accessList) {\n result[\"accessList\"] = accessListify(tx.accessList);\n }\n if (tx.blobVersionedHashes) {\n // @TODO: Remove this case once EIP-4844 added to prepared tx\n result[\"blobVersionedHashes\"] = tx.blobVersionedHashes.map(h => h.toLowerCase());\n }\n if (tx.authorizationList) {\n result[\"authorizationList\"] = tx.authorizationList.map((_a) => {\n const a = authorizationify(_a);\n return {\n address: a.address,\n nonce: toQuantity(a.nonce),\n chainId: toQuantity(a.chainId),\n yParity: toQuantity(a.signature.yParity),\n r: toQuantity(a.signature.r),\n s: toQuantity(a.signature.s),\n };\n });\n }\n // @TODO: blobs should probably also be copied over, optionally\n // accounting for the kzg property to backfill blobVersionedHashes\n // using the commitment. Or should that be left as an exercise to\n // the caller?\n return result;\n }\n /**\n * Returns the request method and arguments required to perform\n * %%req%%.\n */\n getRpcRequest(req) {\n switch (req.method) {\n case \"chainId\":\n return { method: \"eth_chainId\", args: [] };\n case \"getBlockNumber\":\n return { method: \"eth_blockNumber\", args: [] };\n case \"getGasPrice\":\n return { method: \"eth_gasPrice\", args: [] };\n case \"getPriorityFee\":\n return { method: \"eth_maxPriorityFeePerGas\", args: [] };\n case \"getBalance\":\n return {\n method: \"eth_getBalance\",\n args: [getLowerCase(req.address), req.blockTag]\n };\n case \"getTransactionCount\":\n return {\n method: \"eth_getTransactionCount\",\n args: [getLowerCase(req.address), req.blockTag]\n };\n case \"getCode\":\n return {\n method: \"eth_getCode\",\n args: [getLowerCase(req.address), req.blockTag]\n };\n case \"getStorage\":\n return {\n method: \"eth_getStorageAt\",\n args: [\n getLowerCase(req.address),\n (\"0x\" + req.position.toString(16)),\n req.blockTag\n ]\n };\n case \"broadcastTransaction\":\n return {\n method: \"eth_sendRawTransaction\",\n args: [req.signedTransaction]\n };\n case \"getBlock\":\n if (\"blockTag\" in req) {\n return {\n method: \"eth_getBlockByNumber\",\n args: [req.blockTag, !!req.includeTransactions]\n };\n }\n else if (\"blockHash\" in req) {\n return {\n method: \"eth_getBlockByHash\",\n args: [req.blockHash, !!req.includeTransactions]\n };\n }\n break;\n case \"getTransaction\":\n return {\n method: \"eth_getTransactionByHash\",\n args: [req.hash]\n };\n case \"getTransactionReceipt\":\n return {\n method: \"eth_getTransactionReceipt\",\n args: [req.hash]\n };\n case \"call\":\n return {\n method: \"eth_call\",\n args: [this.getRpcTransaction(req.transaction), req.blockTag]\n };\n case \"estimateGas\": {\n return {\n method: \"eth_estimateGas\",\n args: [this.getRpcTransaction(req.transaction)]\n };\n }\n case \"getLogs\":\n if (req.filter && req.filter.address != null) {\n if (Array.isArray(req.filter.address)) {\n req.filter.address = req.filter.address.map(getLowerCase);\n }\n else {\n req.filter.address = getLowerCase(req.filter.address);\n }\n }\n return { method: \"eth_getLogs\", args: [req.filter] };\n }\n return null;\n }\n /**\n * Returns an ethers-style Error for the given JSON-RPC error\n * %%payload%%, coalescing the various strings and error shapes\n * that different nodes return, coercing them into a machine-readable\n * standardized error.\n */\n getRpcError(payload, _error) {\n const { method } = payload;\n const { error } = _error;\n if (method === \"eth_estimateGas\" && error.message) {\n const msg = error.message;\n if (!msg.match(/revert/i) && msg.match(/insufficient funds/i)) {\n return makeError(\"insufficient funds\", \"INSUFFICIENT_FUNDS\", {\n transaction: (payload.params[0]),\n info: { payload, error }\n });\n }\n else if (msg.match(/nonce/i) && msg.match(/too low/i)) {\n return makeError(\"nonce has already been used\", \"NONCE_EXPIRED\", {\n transaction: (payload.params[0]),\n info: { payload, error }\n });\n }\n }\n if (method === \"eth_call\" || method === \"eth_estimateGas\") {\n const result = spelunkData(error);\n const e = AbiCoder.getBuiltinCallException((method === \"eth_call\") ? \"call\" : \"estimateGas\", (payload.params[0]), (result ? result.data : null));\n e.info = { error, payload };\n return e;\n }\n // Only estimateGas and call can return arbitrary contract-defined text, so now we\n // we can process text safely.\n const message = JSON.stringify(spelunkMessage(error));\n if (typeof (error.message) === \"string\" && error.message.match(/user denied|ethers-user-denied/i)) {\n const actionMap = {\n eth_sign: \"signMessage\",\n personal_sign: \"signMessage\",\n eth_signTypedData_v4: \"signTypedData\",\n eth_signTransaction: \"signTransaction\",\n eth_sendTransaction: \"sendTransaction\",\n eth_requestAccounts: \"requestAccess\",\n wallet_requestAccounts: \"requestAccess\",\n };\n return makeError(`user rejected action`, \"ACTION_REJECTED\", {\n action: (actionMap[method] || \"unknown\"),\n reason: \"rejected\",\n info: { payload, error }\n });\n }\n if (method === \"eth_sendRawTransaction\" || method === \"eth_sendTransaction\") {\n const transaction = (payload.params[0]);\n if (message.match(/insufficient funds|base fee exceeds gas limit/i)) {\n return makeError(\"insufficient funds for intrinsic transaction cost\", \"INSUFFICIENT_FUNDS\", {\n transaction, info: { error }\n });\n }\n if (message.match(/nonce/i) && message.match(/too low/i)) {\n return makeError(\"nonce has already been used\", \"NONCE_EXPIRED\", { transaction, info: { error } });\n }\n // \"replacement transaction underpriced\"\n if (message.match(/replacement transaction/i) && message.match(/underpriced/i)) {\n return makeError(\"replacement fee too low\", \"REPLACEMENT_UNDERPRICED\", { transaction, info: { error } });\n }\n if (message.match(/only replay-protected/i)) {\n return makeError(\"legacy pre-eip-155 transactions not supported\", \"UNSUPPORTED_OPERATION\", {\n operation: method, info: { transaction, info: { error } }\n });\n }\n }\n let unsupported = !!message.match(/the method .* does not exist/i);\n if (!unsupported) {\n if (error && error.details && error.details.startsWith(\"Unauthorized method:\")) {\n unsupported = true;\n }\n }\n if (unsupported) {\n return makeError(\"unsupported operation\", \"UNSUPPORTED_OPERATION\", {\n operation: payload.method, info: { error, payload }\n });\n }\n return makeError(\"could not coalesce error\", \"UNKNOWN_ERROR\", { error, payload });\n }\n /**\n * Requests the %%method%% with %%params%% via the JSON-RPC protocol\n * over the underlying channel. This can be used to call methods\n * on the backend that do not have a high-level API within the Provider\n * API.\n *\n * This method queues requests according to the batch constraints\n * in the options, assigns the request a unique ID.\n *\n * **Do NOT override** this method in sub-classes; instead\n * override [[_send]] or force the options values in the\n * call to the constructor to modify this method's behavior.\n */\n send(method, params) {\n // @TODO: cache chainId?? purge on switch_networks\n // We have been destroyed; no operations are supported anymore\n if (this.destroyed) {\n return Promise.reject(makeError(\"provider destroyed; cancelled request\", \"UNSUPPORTED_OPERATION\", { operation: method }));\n }\n const id = this.#nextId++;\n const promise = new Promise((resolve, reject) => {\n this.#payloads.push({\n resolve, reject,\n payload: { method, params, id, jsonrpc: \"2.0\" }\n });\n });\n // If there is not a pending drainTimer, set one\n this.#scheduleDrain();\n return promise;\n }\n /**\n * Resolves to the [[Signer]] account for %%address%% managed by\n * the client.\n *\n * If the %%address%% is a number, it is used as an index in the\n * the accounts from [[listAccounts]].\n *\n * This can only be used on clients which manage accounts (such as\n * Geth with imported account or MetaMask).\n *\n * Throws if the account doesn't exist.\n */\n async getSigner(address) {\n if (address == null) {\n address = 0;\n }\n const accountsPromise = this.send(\"eth_accounts\", []);\n // Account index\n if (typeof (address) === \"number\") {\n const accounts = (await accountsPromise);\n if (address >= accounts.length) {\n throw new Error(\"no such account\");\n }\n return new JsonRpcSigner(this, accounts[address]);\n }\n const { accounts } = await resolveProperties({\n network: this.getNetwork(),\n accounts: accountsPromise\n });\n // Account address\n address = getAddress(address);\n for (const account of accounts) {\n if (getAddress(account) === address) {\n return new JsonRpcSigner(this, address);\n }\n }\n throw new Error(\"invalid account\");\n }\n async listAccounts() {\n const accounts = await this.send(\"eth_accounts\", []);\n return accounts.map((a) => new JsonRpcSigner(this, a));\n }\n destroy() {\n // Stop processing requests\n if (this.#drainTimer) {\n clearTimeout(this.#drainTimer);\n this.#drainTimer = null;\n }\n // Cancel all pending requests\n for (const { payload, reject } of this.#payloads) {\n reject(makeError(\"provider destroyed; cancelled request\", \"UNSUPPORTED_OPERATION\", { operation: payload.method }));\n }\n this.#payloads = [];\n // Parent clean-up\n super.destroy();\n }\n}\n// @TODO: remove this in v7, it is not exported because this functionality\n// is exposed in the JsonRpcApiProvider by setting polling to true. It should\n// be safe to remove regardless, because it isn't reachable, but just in case.\n/**\n * @_ignore:\n */\nexport class JsonRpcApiPollingProvider extends JsonRpcApiProvider {\n #pollingInterval;\n constructor(network, options) {\n super(network, options);\n let pollingInterval = this._getOption(\"pollingInterval\");\n if (pollingInterval == null) {\n pollingInterval = defaultOptions.pollingInterval;\n }\n this.#pollingInterval = pollingInterval;\n }\n _getSubscriber(sub) {\n const subscriber = super._getSubscriber(sub);\n if (isPollable(subscriber)) {\n subscriber.pollingInterval = this.#pollingInterval;\n }\n return subscriber;\n }\n /**\n * The polling interval (default: 4000 ms)\n */\n get pollingInterval() { return this.#pollingInterval; }\n set pollingInterval(value) {\n if (!Number.isInteger(value) || value < 0) {\n throw new Error(\"invalid interval\");\n }\n this.#pollingInterval = value;\n this._forEachSubscriber((sub) => {\n if (isPollable(sub)) {\n sub.pollingInterval = this.#pollingInterval;\n }\n });\n }\n}\n/**\n * The JsonRpcProvider is one of the most common Providers,\n * which performs all operations over HTTP (or HTTPS) requests.\n *\n * Events are processed by polling the backend for the current block\n * number; when it advances, all block-base events are then checked\n * for updates.\n */\nexport class JsonRpcProvider extends JsonRpcApiPollingProvider {\n #connect;\n constructor(url, network, options) {\n if (url == null) {\n url = \"http:/\\/localhost:8545\";\n }\n super(network, options);\n if (typeof (url) === \"string\") {\n this.#connect = new FetchRequest(url);\n }\n else {\n this.#connect = url.clone();\n }\n }\n _getConnection() {\n return this.#connect.clone();\n }\n async send(method, params) {\n // All requests are over HTTP, so we can just start handling requests\n // We do this here rather than the constructor so that we don't send any\n // requests to the network (i.e. eth_chainId) until we absolutely have to.\n await this._start();\n return await super.send(method, params);\n }\n async _send(payload) {\n // Configure a POST connection for the requested method\n const request = this._getConnection();\n request.body = JSON.stringify(payload);\n request.setHeader(\"content-type\", \"application/json\");\n const response = await request.send();\n response.assertOk();\n let resp = response.bodyJson;\n if (!Array.isArray(resp)) {\n resp = [resp];\n }\n return resp;\n }\n}\nfunction spelunkData(value) {\n if (value == null) {\n return null;\n }\n // These *are* the droids we're looking for.\n if (typeof (value.message) === \"string\" && value.message.match(/revert/i) && isHexString(value.data)) {\n return { message: value.message, data: value.data };\n }\n // Spelunk further...\n if (typeof (value) === \"object\") {\n for (const key in value) {\n const result = spelunkData(value[key]);\n if (result) {\n return result;\n }\n }\n return null;\n }\n // Might be a JSON string we can further descend...\n if (typeof (value) === \"string\") {\n try {\n return spelunkData(JSON.parse(value));\n }\n catch (error) { }\n }\n return null;\n}\nfunction _spelunkMessage(value, result) {\n if (value == null) {\n return;\n }\n // These *are* the droids we're looking for.\n if (typeof (value.message) === \"string\") {\n result.push(value.message);\n }\n // Spelunk further...\n if (typeof (value) === \"object\") {\n for (const key in value) {\n _spelunkMessage(value[key], result);\n }\n }\n // Might be a JSON string we can further descend...\n if (typeof (value) === \"string\") {\n try {\n return _spelunkMessage(JSON.parse(value), result);\n }\n catch (error) { }\n }\n}\nfunction spelunkMessage(value) {\n const result = [];\n _spelunkMessage(value, result);\n return result;\n}\n//# sourceMappingURL=provider-jsonrpc.js.map","/**\n * [[link-ankr]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Ethereum Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Sepolia Testnet (``sepolia``)\n * - Arbitrum (``arbitrum``)\n * - Base (``base``)\n * - Base Goerlia Testnet (``base-goerli``)\n * - Base Sepolia Testnet (``base-sepolia``)\n * - BNB (``bnb``)\n * - BNB Testnet (``bnbt``)\n * - Filecoin (``filecoin``)\n * - Filecoin Calibration Testnet (``filecoin-calibration``)\n * - Optimism (``optimism``)\n * - Optimism Goerli Testnet (``optimism-goerli``)\n * - Optimism Sepolia Testnet (``optimism-sepolia``)\n * - Polygon (``matic``)\n * - Polygon Mumbai Testnet (``matic-mumbai``)\n *\n * @_subsection: api/providers/thirdparty:Ankr [providers-ankr]\n */\nimport { defineProperties, FetchRequest, assertArgument } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultApiKey = \"9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"rpc.ankr.com/eth\";\n case \"goerli\":\n return \"rpc.ankr.com/eth_goerli\";\n case \"sepolia\":\n return \"rpc.ankr.com/eth_sepolia\";\n case \"arbitrum\":\n return \"rpc.ankr.com/arbitrum\";\n case \"base\":\n return \"rpc.ankr.com/base\";\n case \"base-goerli\":\n return \"rpc.ankr.com/base_goerli\";\n case \"base-sepolia\":\n return \"rpc.ankr.com/base_sepolia\";\n case \"bnb\":\n return \"rpc.ankr.com/bsc\";\n case \"bnbt\":\n return \"rpc.ankr.com/bsc_testnet_chapel\";\n case \"filecoin\":\n return \"rpc.ankr.com/filecoin\";\n case \"filecoin-calibration\":\n return \"rpc.ankr.com/filecoin_testnet\";\n case \"matic\":\n return \"rpc.ankr.com/polygon\";\n case \"matic-mumbai\":\n return \"rpc.ankr.com/polygon_mumbai\";\n case \"optimism\":\n return \"rpc.ankr.com/optimism\";\n case \"optimism-goerli\":\n return \"rpc.ankr.com/optimism_testnet\";\n case \"optimism-sepolia\":\n return \"rpc.ankr.com/optimism_sepolia\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **AnkrProvider** connects to the [[link-ankr]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-ankr-signup).\n */\nexport class AnkrProvider extends JsonRpcProvider {\n /**\n * The API key for the Ankr connection.\n */\n apiKey;\n /**\n * Create a new **AnkrProvider**.\n *\n * By default connecting to ``mainnet`` with a highly throttled\n * API key.\n */\n constructor(_network, apiKey) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n // Ankr does not support filterId, so we force polling\n const options = { polling: true, staticNetwork: network };\n const request = AnkrProvider.getRequest(network, apiKey);\n super(request, network, options);\n defineProperties(this, { apiKey });\n }\n _getProvider(chainId) {\n try {\n return new AnkrProvider(chainId, this.apiKey);\n }\n catch (error) { }\n return super._getProvider(chainId);\n }\n /**\n * Returns a prepared request for connecting to %%network%% with\n * %%apiKey%%.\n */\n static getRequest(network, apiKey) {\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/${apiKey}`);\n request.allowGzip = true;\n if (apiKey === defaultApiKey) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"AnkrProvider\");\n return true;\n };\n }\n return request;\n }\n getRpcError(payload, error) {\n if (payload.method === \"eth_sendRawTransaction\") {\n if (error && error.error && error.error.message === \"INTERNAL_ERROR: could not replace existing tx\") {\n error.error.message = \"replacement transaction underpriced\";\n }\n }\n return super.getRpcError(payload, error);\n }\n isCommunityResource() {\n return (this.apiKey === defaultApiKey);\n }\n}\n//# sourceMappingURL=provider-ankr.js.map","/**\n * [[link-alchemy]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Ethereum Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Sepolia Testnet (``sepolia``)\n * - Arbitrum (``arbitrum``)\n * - Arbitrum Goerli Testnet (``arbitrum-goerli``)\n * - Arbitrum Sepolia Testnet (``arbitrum-sepolia``)\n * - Base (``base``)\n * - Base Goerlia Testnet (``base-goerli``)\n * - Base Sepolia Testnet (``base-sepolia``)\n * - Optimism (``optimism``)\n * - Optimism Goerli Testnet (``optimism-goerli``)\n * - Optimism Sepolia Testnet (``optimism-sepolia``)\n * - Polygon (``matic``)\n * - Polygon Amoy Testnet (``matic-amoy``)\n * - Polygon Mumbai Testnet (``matic-mumbai``)\n *\n * @_subsection: api/providers/thirdparty:Alchemy [providers-alchemy]\n */\nimport { defineProperties, resolveProperties, assert, assertArgument, FetchRequest } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultApiKey = \"_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"eth-mainnet.g.alchemy.com\";\n case \"goerli\":\n return \"eth-goerli.g.alchemy.com\";\n case \"sepolia\":\n return \"eth-sepolia.g.alchemy.com\";\n case \"arbitrum\":\n return \"arb-mainnet.g.alchemy.com\";\n case \"arbitrum-goerli\":\n return \"arb-goerli.g.alchemy.com\";\n case \"arbitrum-sepolia\":\n return \"arb-sepolia.g.alchemy.com\";\n case \"base\":\n return \"base-mainnet.g.alchemy.com\";\n case \"base-goerli\":\n return \"base-goerli.g.alchemy.com\";\n case \"base-sepolia\":\n return \"base-sepolia.g.alchemy.com\";\n case \"matic\":\n return \"polygon-mainnet.g.alchemy.com\";\n case \"matic-amoy\":\n return \"polygon-amoy.g.alchemy.com\";\n case \"matic-mumbai\":\n return \"polygon-mumbai.g.alchemy.com\";\n case \"optimism\":\n return \"opt-mainnet.g.alchemy.com\";\n case \"optimism-goerli\":\n return \"opt-goerli.g.alchemy.com\";\n case \"optimism-sepolia\":\n return \"opt-sepolia.g.alchemy.com\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **AlchemyProvider** connects to the [[link-alchemy]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-alchemy-signup).\n *\n * @_docloc: api/providers/thirdparty\n */\nexport class AlchemyProvider extends JsonRpcProvider {\n apiKey;\n constructor(_network, apiKey) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n const request = AlchemyProvider.getRequest(network, apiKey);\n super(request, network, { staticNetwork: network });\n defineProperties(this, { apiKey });\n }\n _getProvider(chainId) {\n try {\n return new AlchemyProvider(chainId, this.apiKey);\n }\n catch (error) { }\n return super._getProvider(chainId);\n }\n async _perform(req) {\n // https://docs.alchemy.com/reference/trace-transaction\n if (req.method === \"getTransactionResult\") {\n const { trace, tx } = await resolveProperties({\n trace: this.send(\"trace_transaction\", [req.hash]),\n tx: this.getTransaction(req.hash)\n });\n if (trace == null || tx == null) {\n return null;\n }\n let data;\n let error = false;\n try {\n data = trace[0].result.output;\n error = (trace[0].error === \"Reverted\");\n }\n catch (error) { }\n if (data) {\n assert(!error, \"an error occurred during transaction executions\", \"CALL_EXCEPTION\", {\n action: \"getTransactionResult\",\n data,\n reason: null,\n transaction: tx,\n invocation: null,\n revert: null // @TODO\n });\n return data;\n }\n assert(false, \"could not parse trace result\", \"BAD_DATA\", { value: trace });\n }\n return await super._perform(req);\n }\n isCommunityResource() {\n return (this.apiKey === defaultApiKey);\n }\n static getRequest(network, apiKey) {\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/v2/${apiKey}`);\n request.allowGzip = true;\n if (apiKey === defaultApiKey) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"alchemy\");\n return true;\n };\n }\n return request;\n }\n}\n//# sourceMappingURL=provider-alchemy.js.map","/**\n * [[link-chainstack]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Ethereum Mainnet (``mainnet``)\n * - Arbitrum (``arbitrum``)\n * - BNB Smart Chain Mainnet (``bnb``)\n * - Polygon (``matic``)\n *\n * @_subsection: api/providers/thirdparty:Chainstack [providers-chainstack]\n */\nimport { defineProperties, FetchRequest, assertArgument } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nfunction getApiKey(name) {\n switch (name) {\n case \"mainnet\": return \"39f1d67cedf8b7831010a665328c9197\";\n case \"arbitrum\": return \"0550c209db33c3abf4cc927e1e18cea1\";\n case \"bnb\": return \"98b5a77e531614387366f6fc5da097f8\";\n case \"matic\": return \"cd9d4d70377471aa7c142ec4a4205249\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"ethereum-mainnet.core.chainstack.com\";\n case \"arbitrum\":\n return \"arbitrum-mainnet.core.chainstack.com\";\n case \"bnb\":\n return \"bsc-mainnet.core.chainstack.com\";\n case \"matic\":\n return \"polygon-mainnet.core.chainstack.com\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **ChainstackProvider** connects to the [[link-chainstack]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-chainstack).\n */\nexport class ChainstackProvider extends JsonRpcProvider {\n /**\n * The API key for the Chainstack connection.\n */\n apiKey;\n /**\n * Creates a new **ChainstackProvider**.\n */\n constructor(_network, apiKey) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (apiKey == null) {\n apiKey = getApiKey(network.name);\n }\n const request = ChainstackProvider.getRequest(network, apiKey);\n super(request, network, { staticNetwork: network });\n defineProperties(this, { apiKey });\n }\n _getProvider(chainId) {\n try {\n return new ChainstackProvider(chainId, this.apiKey);\n }\n catch (error) { }\n return super._getProvider(chainId);\n }\n isCommunityResource() {\n return (this.apiKey === getApiKey(this._network.name));\n }\n /**\n * Returns a prepared request for connecting to %%network%%\n * with %%apiKey%% and %%projectSecret%%.\n */\n static getRequest(network, apiKey) {\n if (apiKey == null) {\n apiKey = getApiKey(network.name);\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/${apiKey}`);\n request.allowGzip = true;\n if (apiKey === getApiKey(network.name)) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"ChainstackProvider\");\n return true;\n };\n }\n return request;\n }\n}\n//# sourceMappingURL=provider-chainstack.js.map","/**\n * About Cloudflare\n *\n * @_subsection: api/providers/thirdparty:Cloudflare [providers-cloudflare]\n */\nimport { assertArgument } from \"../utils/index.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\n/**\n * About Cloudflare...\n */\nexport class CloudflareProvider extends JsonRpcProvider {\n constructor(_network) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n assertArgument(network.name === \"mainnet\", \"unsupported network\", \"network\", _network);\n super(\"https:/\\/cloudflare-eth.com/\", network, { staticNetwork: network });\n }\n}\n//# sourceMappingURL=provider-cloudflare.js.map","/**\n * [[link-etherscan]] provides a third-party service for connecting to\n * various blockchains over a combination of JSON-RPC and custom API\n * endpoints.\n *\n * **Supported Networks**\n *\n * - Ethereum Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Sepolia Testnet (``sepolia``)\n * - Holesky Testnet (``holesky``)\n * - Arbitrum (``arbitrum``)\n * - Arbitrum Goerli Testnet (``arbitrum-goerli``)\n * - Base (``base``)\n * - Base Sepolia Testnet (``base-sepolia``)\n * - BNB Smart Chain Mainnet (``bnb``)\n * - BNB Smart Chain Testnet (``bnbt``)\n * - Optimism (``optimism``)\n * - Optimism Goerli Testnet (``optimism-goerli``)\n * - Polygon (``matic``)\n * - Polygon Mumbai Testnet (``matic-mumbai``)\n * - Polygon Amoy Testnet (``matic-amoy``)\n *\n * @_subsection api/providers/thirdparty:Etherscan [providers-etherscan]\n */\nimport { AbiCoder } from \"../abi/index.js\";\nimport { Contract } from \"../contract/index.js\";\nimport { accessListify, Transaction } from \"../transaction/index.js\";\nimport { defineProperties, hexlify, toQuantity, FetchRequest, assert, assertArgument, isError, \n// parseUnits,\ntoUtf8String } from \"../utils/index.js\";\nimport { AbstractProvider } from \"./abstract-provider.js\";\nimport { Network } from \"./network.js\";\nimport { NetworkPlugin } from \"./plugins-network.js\";\nimport { showThrottleMessage } from \"./community.js\";\n// See: https://docs.etherscan.io/supported-chains\nconst Supported = (\"1 11155111 17000 560048 2741 11124 33111 33139 42170 \" +\n \"42161 421614 43114 43113 8453 84532 80069 80094 199 1029 81457 \" +\n \"168587773 56 97 42220 11142220 252 2523 100 999 737373 747474 \" +\n \"59144 59141 5000 5003 43521 143 10143 1287 1284 1285 10 \" +\n \"11155420 204 5611 80002 137 534352 534351 1329 1328 146 14601 \" +\n \"988 2201 1923 1924 167013 167000 130 1301 480 4801 51 50 324 300\").split(/ /g);\nconst THROTTLE = 2000;\nfunction isPromise(value) {\n return (value && typeof (value.then) === \"function\");\n}\nconst EtherscanPluginId = \"org.ethers.plugins.provider.Etherscan\";\n/**\n * A Network can include an **EtherscanPlugin** to provide\n * a custom base URL.\n *\n * @_docloc: api/providers/thirdparty:Etherscan\n */\nexport class EtherscanPlugin extends NetworkPlugin {\n /**\n * The Etherscan API base URL.\n */\n baseUrl;\n /**\n * Creates a new **EtherscanProvider** which will use\n * %%baseUrl%%.\n */\n constructor(baseUrl) {\n super(EtherscanPluginId);\n defineProperties(this, { baseUrl });\n }\n clone() {\n return new EtherscanPlugin(this.baseUrl);\n }\n}\nconst skipKeys = [\"enableCcipRead\"];\nlet nextId = 1;\n/**\n * The **EtherscanBaseProvider** is the super-class of\n * [[EtherscanProvider]], which should generally be used instead.\n *\n * Since the **EtherscanProvider** includes additional code for\n * [[Contract]] access, in //rare cases// that contracts are not\n * used, this class can reduce code size.\n *\n * @_docloc: api/providers/thirdparty:Etherscan\n */\nexport class EtherscanProvider extends AbstractProvider {\n /**\n * The connected network.\n */\n network;\n /**\n * The API key or null if using the community provided bandwidth.\n */\n apiKey;\n #plugin;\n /**\n * Creates a new **EtherscanBaseProvider**.\n */\n constructor(_network, _apiKey) {\n const apiKey = (_apiKey != null) ? _apiKey : null;\n super();\n const network = Network.from(_network);\n assertArgument(Supported.indexOf(`${network.chainId}`) >= 0, \"unsupported network\", \"network\", network);\n this.#plugin = network.getPlugin(EtherscanPluginId);\n defineProperties(this, { apiKey, network });\n }\n /**\n * Returns the base URL.\n *\n * If an [[EtherscanPlugin]] is configured on the\n * [[EtherscanBaseProvider_network]], returns the plugin's\n * baseUrl.\n *\n * Deprecated; for Etherscan v2 the base is no longer a simply\n * host, but instead a URL including a chainId parameter. Changing\n * this to return a URL prefix could break some libraries, so it\n * is left intact but will be removed in the future as it is unused.\n */\n getBaseUrl() {\n if (this.#plugin) {\n return this.#plugin.baseUrl;\n }\n switch (this.network.name) {\n case \"mainnet\":\n return \"https:/\\/api.etherscan.io\";\n case \"goerli\":\n return \"https:/\\/api-goerli.etherscan.io\";\n case \"sepolia\":\n return \"https:/\\/api-sepolia.etherscan.io\";\n case \"holesky\":\n return \"https:/\\/api-holesky.etherscan.io\";\n case \"arbitrum\":\n return \"https:/\\/api.arbiscan.io\";\n case \"arbitrum-goerli\":\n return \"https:/\\/api-goerli.arbiscan.io\";\n case \"base\":\n return \"https:/\\/api.basescan.org\";\n case \"base-sepolia\":\n return \"https:/\\/api-sepolia.basescan.org\";\n case \"bnb\":\n return \"https:/\\/api.bscscan.com\";\n case \"bnbt\":\n return \"https:/\\/api-testnet.bscscan.com\";\n case \"matic\":\n return \"https:/\\/api.polygonscan.com\";\n case \"matic-amoy\":\n return \"https:/\\/api-amoy.polygonscan.com\";\n case \"matic-mumbai\":\n return \"https:/\\/api-testnet.polygonscan.com\";\n case \"optimism\":\n return \"https:/\\/api-optimistic.etherscan.io\";\n case \"optimism-goerli\":\n return \"https:/\\/api-goerli-optimistic.etherscan.io\";\n default:\n }\n assertArgument(false, \"unsupported network\", \"network\", this.network);\n }\n /**\n * Returns the URL for the %%module%% and %%params%%.\n */\n getUrl(module, params) {\n let query = Object.keys(params).reduce((accum, key) => {\n const value = params[key];\n if (value != null) {\n accum += `&${key}=${value}`;\n }\n return accum;\n }, \"\");\n if (this.apiKey) {\n query += `&apikey=${this.apiKey}`;\n }\n return `https:/\\/api.etherscan.io/v2/api?chainid=${this.network.chainId}&module=${module}${query}`;\n }\n /**\n * Returns the URL for using POST requests.\n */\n getPostUrl() {\n return `https:/\\/api.etherscan.io/v2/api?chainid=${this.network.chainId}`;\n }\n /**\n * Returns the parameters for using POST requests.\n */\n getPostData(module, params) {\n params.module = module;\n params.apikey = this.apiKey;\n params.chainid = this.network.chainId;\n return params;\n }\n async detectNetwork() {\n return this.network;\n }\n /**\n * Resolves to the result of calling %%module%% with %%params%%.\n *\n * If %%post%%, the request is made as a POST request.\n */\n async fetch(module, params, post) {\n const id = nextId++;\n const url = (post ? this.getPostUrl() : this.getUrl(module, params));\n const payload = (post ? this.getPostData(module, params) : null);\n this.emit(\"debug\", { action: \"sendRequest\", id, url, payload: payload });\n const request = new FetchRequest(url);\n request.setThrottleParams({ slotInterval: 1000 });\n request.retryFunc = (req, resp, attempt) => {\n if (this.isCommunityResource()) {\n showThrottleMessage(\"Etherscan\");\n }\n return Promise.resolve(true);\n };\n request.processFunc = async (request, response) => {\n const result = response.hasBody() ? JSON.parse(toUtf8String(response.body)) : {};\n const throttle = ((typeof (result.result) === \"string\") ? result.result : \"\").toLowerCase().indexOf(\"rate limit\") >= 0;\n if (module === \"proxy\") {\n // This JSON response indicates we are being throttled\n if (result && result.status == 0 && result.message == \"NOTOK\" && throttle) {\n this.emit(\"debug\", { action: \"receiveError\", id, reason: \"proxy-NOTOK\", error: result });\n response.throwThrottleError(result.result, THROTTLE);\n }\n }\n else {\n if (throttle) {\n this.emit(\"debug\", { action: \"receiveError\", id, reason: \"null result\", error: result.result });\n response.throwThrottleError(result.result, THROTTLE);\n }\n }\n return response;\n };\n if (payload) {\n request.setHeader(\"content-type\", \"application/x-www-form-urlencoded; charset=UTF-8\");\n request.body = Object.keys(payload).map((k) => `${k}=${payload[k]}`).join(\"&\");\n }\n const response = await request.send();\n try {\n response.assertOk();\n }\n catch (error) {\n this.emit(\"debug\", { action: \"receiveError\", id, error, reason: \"assertOk\" });\n assert(false, \"response error\", \"SERVER_ERROR\", { request, response });\n }\n if (!response.hasBody()) {\n this.emit(\"debug\", { action: \"receiveError\", id, error: \"missing body\", reason: \"null body\" });\n assert(false, \"missing response\", \"SERVER_ERROR\", { request, response });\n }\n const result = JSON.parse(toUtf8String(response.body));\n if (module === \"proxy\") {\n if (result.jsonrpc != \"2.0\") {\n this.emit(\"debug\", { action: \"receiveError\", id, result, reason: \"invalid JSON-RPC\" });\n assert(false, \"invalid JSON-RPC response (missing jsonrpc='2.0')\", \"SERVER_ERROR\", { request, response, info: { result } });\n }\n if (result.error) {\n this.emit(\"debug\", { action: \"receiveError\", id, result, reason: \"JSON-RPC error\" });\n assert(false, \"error response\", \"SERVER_ERROR\", { request, response, info: { result } });\n }\n this.emit(\"debug\", { action: \"receiveRequest\", id, result });\n return result.result;\n }\n else {\n // getLogs, getHistory have weird success responses\n if (result.status == 0 && (result.message === \"No records found\" || result.message === \"No transactions found\")) {\n this.emit(\"debug\", { action: \"receiveRequest\", id, result });\n return result.result;\n }\n if (result.status != 1 || (typeof (result.message) === \"string\" && !result.message.match(/^OK/))) {\n this.emit(\"debug\", { action: \"receiveError\", id, result });\n assert(false, \"error response\", \"SERVER_ERROR\", { request, response, info: { result } });\n }\n this.emit(\"debug\", { action: \"receiveRequest\", id, result });\n return result.result;\n }\n }\n /**\n * Returns %%transaction%% normalized for the Etherscan API.\n */\n _getTransactionPostData(transaction) {\n const result = {};\n for (let key in transaction) {\n if (skipKeys.indexOf(key) >= 0) {\n continue;\n }\n if (transaction[key] == null) {\n continue;\n }\n let value = transaction[key];\n if (key === \"type\" && value === 0) {\n continue;\n }\n if (key === \"blockTag\" && value === \"latest\") {\n continue;\n }\n // Quantity-types require no leading zero, unless 0\n if ({ type: true, gasLimit: true, gasPrice: true, maxFeePerGs: true, maxPriorityFeePerGas: true, nonce: true, value: true }[key]) {\n value = toQuantity(value);\n }\n else if (key === \"accessList\") {\n value = \"[\" + accessListify(value).map((set) => {\n return `{address:\"${set.address}\",storageKeys:[\"${set.storageKeys.join('\",\"')}\"]}`;\n }).join(\",\") + \"]\";\n }\n else if (key === \"blobVersionedHashes\") {\n if (value.length === 0) {\n continue;\n }\n // @TODO: update this once the API supports blobs\n assert(false, \"Etherscan API does not support blobVersionedHashes\", \"UNSUPPORTED_OPERATION\", {\n operation: \"_getTransactionPostData\",\n info: { transaction }\n });\n }\n else {\n value = hexlify(value);\n }\n result[key] = value;\n }\n return result;\n }\n /**\n * Throws the normalized Etherscan error.\n */\n _checkError(req, error, transaction) {\n // Pull any message out if, possible\n let message = \"\";\n if (isError(error, \"SERVER_ERROR\")) {\n // Check for an error emitted by a proxy call\n try {\n message = error.info.result.error.message;\n }\n catch (e) { }\n if (!message) {\n try {\n message = error.info.message;\n }\n catch (e) { }\n }\n }\n if (req.method === \"estimateGas\") {\n if (!message.match(/revert/i) && message.match(/insufficient funds/i)) {\n assert(false, \"insufficient funds\", \"INSUFFICIENT_FUNDS\", {\n transaction: req.transaction\n });\n }\n }\n if (req.method === \"call\" || req.method === \"estimateGas\") {\n if (message.match(/execution reverted/i)) {\n let data = \"\";\n try {\n data = error.info.result.error.data;\n }\n catch (error) { }\n const e = AbiCoder.getBuiltinCallException(req.method, req.transaction, data);\n e.info = { request: req, error };\n throw e;\n }\n }\n if (message) {\n if (req.method === \"broadcastTransaction\") {\n const transaction = Transaction.from(req.signedTransaction);\n if (message.match(/replacement/i) && message.match(/underpriced/i)) {\n assert(false, \"replacement fee too low\", \"REPLACEMENT_UNDERPRICED\", {\n transaction\n });\n }\n if (message.match(/insufficient funds/)) {\n assert(false, \"insufficient funds for intrinsic transaction cost\", \"INSUFFICIENT_FUNDS\", {\n transaction\n });\n }\n if (message.match(/same hash was already imported|transaction nonce is too low|nonce too low/)) {\n assert(false, \"nonce has already been used\", \"NONCE_EXPIRED\", {\n transaction\n });\n }\n }\n }\n // Something we could not process\n throw error;\n }\n async _detectNetwork() {\n return this.network;\n }\n async _perform(req) {\n switch (req.method) {\n case \"chainId\":\n return this.network.chainId;\n case \"getBlockNumber\":\n return this.fetch(\"proxy\", { action: \"eth_blockNumber\" });\n case \"getGasPrice\":\n return this.fetch(\"proxy\", { action: \"eth_gasPrice\" });\n case \"getPriorityFee\":\n // This is temporary until Etherscan completes support\n if (this.network.name === \"mainnet\") {\n return \"1000000000\";\n }\n else if (this.network.name === \"optimism\") {\n return \"1000000\";\n }\n else {\n throw new Error(\"fallback onto the AbstractProvider default\");\n }\n /* Working with Etherscan to get this added:\n try {\n const test = await this.fetch(\"proxy\", {\n action: \"eth_maxPriorityFeePerGas\"\n });\n console.log(test);\n return test;\n } catch (e) {\n console.log(\"DEBUG\", e);\n throw e;\n }\n */\n /* This might be safe; but due to rounding neither myself\n or Etherscan are necessarily comfortable with this. :)\n try {\n const result = await this.fetch(\"gastracker\", { action: \"gasoracle\" });\n console.log(result);\n const gasPrice = parseUnits(result.SafeGasPrice, \"gwei\");\n const baseFee = parseUnits(result.suggestBaseFee, \"gwei\");\n const priorityFee = gasPrice - baseFee;\n if (priorityFee < 0) { throw new Error(\"negative priority fee; defer to abstract provider default\"); }\n return priorityFee;\n } catch (error) {\n console.log(\"DEBUG\", error);\n throw error;\n }\n */\n case \"getBalance\":\n // Returns base-10 result\n return this.fetch(\"account\", {\n action: \"balance\",\n address: req.address,\n tag: req.blockTag\n });\n case \"getTransactionCount\":\n return this.fetch(\"proxy\", {\n action: \"eth_getTransactionCount\",\n address: req.address,\n tag: req.blockTag\n });\n case \"getCode\":\n return this.fetch(\"proxy\", {\n action: \"eth_getCode\",\n address: req.address,\n tag: req.blockTag\n });\n case \"getStorage\":\n return this.fetch(\"proxy\", {\n action: \"eth_getStorageAt\",\n address: req.address,\n position: req.position,\n tag: req.blockTag\n });\n case \"broadcastTransaction\":\n return this.fetch(\"proxy\", {\n action: \"eth_sendRawTransaction\",\n hex: req.signedTransaction\n }, true).catch((error) => {\n return this._checkError(req, error, req.signedTransaction);\n });\n case \"getBlock\":\n if (\"blockTag\" in req) {\n return this.fetch(\"proxy\", {\n action: \"eth_getBlockByNumber\",\n tag: req.blockTag,\n boolean: (req.includeTransactions ? \"true\" : \"false\")\n });\n }\n assert(false, \"getBlock by blockHash not supported by Etherscan\", \"UNSUPPORTED_OPERATION\", {\n operation: \"getBlock(blockHash)\"\n });\n case \"getTransaction\":\n return this.fetch(\"proxy\", {\n action: \"eth_getTransactionByHash\",\n txhash: req.hash\n });\n case \"getTransactionReceipt\":\n return this.fetch(\"proxy\", {\n action: \"eth_getTransactionReceipt\",\n txhash: req.hash\n });\n case \"call\": {\n if (req.blockTag !== \"latest\") {\n throw new Error(\"EtherscanProvider does not support blockTag for call\");\n }\n const postData = this._getTransactionPostData(req.transaction);\n postData.module = \"proxy\";\n postData.action = \"eth_call\";\n try {\n return await this.fetch(\"proxy\", postData, true);\n }\n catch (error) {\n return this._checkError(req, error, req.transaction);\n }\n }\n case \"estimateGas\": {\n const postData = this._getTransactionPostData(req.transaction);\n postData.module = \"proxy\";\n postData.action = \"eth_estimateGas\";\n try {\n return await this.fetch(\"proxy\", postData, true);\n }\n catch (error) {\n return this._checkError(req, error, req.transaction);\n }\n }\n /*\n case \"getLogs\": {\n // Needs to complain if more than one address is passed in\n const args: Record = { action: \"getLogs\" }\n \n if (params.filter.fromBlock) {\n args.fromBlock = checkLogTag(params.filter.fromBlock);\n }\n \n if (params.filter.toBlock) {\n args.toBlock = checkLogTag(params.filter.toBlock);\n }\n \n if (params.filter.address) {\n args.address = params.filter.address;\n }\n \n // @TODO: We can handle slightly more complicated logs using the logs API\n if (params.filter.topics && params.filter.topics.length > 0) {\n if (params.filter.topics.length > 1) {\n logger.throwError(\"unsupported topic count\", Logger.Errors.UNSUPPORTED_OPERATION, { topics: params.filter.topics });\n }\n if (params.filter.topics.length === 1) {\n const topic0 = params.filter.topics[0];\n if (typeof(topic0) !== \"string\" || topic0.length !== 66) {\n logger.throwError(\"unsupported topic format\", Logger.Errors.UNSUPPORTED_OPERATION, { topic0: topic0 });\n }\n args.topic0 = topic0;\n }\n }\n \n const logs: Array = await this.fetch(\"logs\", args);\n \n // Cache txHash => blockHash\n let blocks: { [tag: string]: string } = {};\n \n // Add any missing blockHash to the logs\n for (let i = 0; i < logs.length; i++) {\n const log = logs[i];\n if (log.blockHash != null) { continue; }\n if (blocks[log.blockNumber] == null) {\n const block = await this.getBlock(log.blockNumber);\n if (block) {\n blocks[log.blockNumber] = block.hash;\n }\n }\n \n log.blockHash = blocks[log.blockNumber];\n }\n \n return logs;\n }\n */\n default:\n break;\n }\n return super._perform(req);\n }\n async getNetwork() {\n return this.network;\n }\n /**\n * Resolves to the current price of ether.\n *\n * This returns ``0`` on any network other than ``mainnet``.\n */\n async getEtherPrice() {\n if (this.network.name !== \"mainnet\") {\n return 0.0;\n }\n return parseFloat((await this.fetch(\"stats\", { action: \"ethprice\" })).ethusd);\n }\n /**\n * Resolves to a [Contract]] for %%address%%, using the\n * Etherscan API to retreive the Contract ABI.\n */\n async getContract(_address) {\n let address = this._getAddress(_address);\n if (isPromise(address)) {\n address = await address;\n }\n try {\n const resp = await this.fetch(\"contract\", {\n action: \"getabi\", address\n });\n const abi = JSON.parse(resp);\n return new Contract(address, abi, this);\n }\n catch (error) {\n return null;\n }\n }\n isCommunityResource() {\n return (this.apiKey == null);\n }\n}\n//# sourceMappingURL=provider-etherscan.js.map","function getGlobal() {\n if (typeof self !== 'undefined') {\n return self;\n }\n if (typeof window !== 'undefined') {\n return window;\n }\n if (typeof global !== 'undefined') {\n return global;\n }\n throw new Error('unable to locate global object');\n}\n;\nconst _WebSocket = getGlobal().WebSocket;\nexport { _WebSocket as WebSocket };\n//# sourceMappingURL=ws-browser.js.map","/**\n * Generic long-lived socket provider.\n *\n * Sub-classing notes\n * - a sub-class MUST call the `_start()` method once connected\n * - a sub-class MUST override the `_write(string)` method\n * - a sub-class MUST call `_processMessage(string)` for each message\n *\n * @_subsection: api/providers/abstract-provider:Socket Providers [about-socketProvider]\n */\nimport { UnmanagedSubscriber } from \"./abstract-provider.js\";\nimport { assert, assertArgument, makeError } from \"../utils/index.js\";\nimport { JsonRpcApiProvider } from \"./provider-jsonrpc.js\";\n/**\n * A **SocketSubscriber** uses a socket transport to handle events and\n * should use [[_emit]] to manage the events.\n */\nexport class SocketSubscriber {\n #provider;\n #filter;\n /**\n * The filter.\n */\n get filter() { return JSON.parse(this.#filter); }\n #filterId;\n #paused;\n #emitPromise;\n /**\n * Creates a new **SocketSubscriber** attached to %%provider%% listening\n * to %%filter%%.\n */\n constructor(provider, filter) {\n this.#provider = provider;\n this.#filter = JSON.stringify(filter);\n this.#filterId = null;\n this.#paused = null;\n this.#emitPromise = null;\n }\n start() {\n this.#filterId = this.#provider.send(\"eth_subscribe\", this.filter).then((filterId) => {\n ;\n this.#provider._register(filterId, this);\n return filterId;\n });\n }\n stop() {\n (this.#filterId).then((filterId) => {\n if (this.#provider.destroyed) {\n return;\n }\n this.#provider.send(\"eth_unsubscribe\", [filterId]);\n });\n this.#filterId = null;\n }\n // @TODO: pause should trap the current blockNumber, unsub, and on resume use getLogs\n // and resume\n pause(dropWhilePaused) {\n assert(dropWhilePaused, \"preserve logs while paused not supported by SocketSubscriber yet\", \"UNSUPPORTED_OPERATION\", { operation: \"pause(false)\" });\n this.#paused = !!dropWhilePaused;\n }\n resume() {\n this.#paused = null;\n }\n /**\n * @_ignore:\n */\n _handleMessage(message) {\n if (this.#filterId == null) {\n return;\n }\n if (this.#paused === null) {\n let emitPromise = this.#emitPromise;\n if (emitPromise == null) {\n emitPromise = this._emit(this.#provider, message);\n }\n else {\n emitPromise = emitPromise.then(async () => {\n await this._emit(this.#provider, message);\n });\n }\n this.#emitPromise = emitPromise.then(() => {\n if (this.#emitPromise === emitPromise) {\n this.#emitPromise = null;\n }\n });\n }\n }\n /**\n * Sub-classes **must** override this to emit the events on the\n * provider.\n */\n async _emit(provider, message) {\n throw new Error(\"sub-classes must implemente this; _emit\");\n }\n}\n/**\n * A **SocketBlockSubscriber** listens for ``newHeads`` events and emits\n * ``\"block\"`` events.\n */\nexport class SocketBlockSubscriber extends SocketSubscriber {\n /**\n * @_ignore:\n */\n constructor(provider) {\n super(provider, [\"newHeads\"]);\n }\n async _emit(provider, message) {\n provider.emit(\"block\", parseInt(message.number));\n }\n}\n/**\n * A **SocketPendingSubscriber** listens for pending transacitons and emits\n * ``\"pending\"`` events.\n */\nexport class SocketPendingSubscriber extends SocketSubscriber {\n /**\n * @_ignore:\n */\n constructor(provider) {\n super(provider, [\"newPendingTransactions\"]);\n }\n async _emit(provider, message) {\n provider.emit(\"pending\", message);\n }\n}\n/**\n * A **SocketEventSubscriber** listens for event logs.\n */\nexport class SocketEventSubscriber extends SocketSubscriber {\n #logFilter;\n /**\n * The filter.\n */\n get logFilter() { return JSON.parse(this.#logFilter); }\n /**\n * @_ignore:\n */\n constructor(provider, filter) {\n super(provider, [\"logs\", filter]);\n this.#logFilter = JSON.stringify(filter);\n }\n async _emit(provider, message) {\n provider.emit(this.logFilter, provider._wrapLog(message, provider._network));\n }\n}\n/**\n * A **SocketProvider** is backed by a long-lived connection over a\n * socket, which can subscribe and receive real-time messages over\n * its communication channel.\n */\nexport class SocketProvider extends JsonRpcApiProvider {\n #callbacks;\n // Maps each filterId to its subscriber\n #subs;\n // If any events come in before a subscriber has finished\n // registering, queue them\n #pending;\n /**\n * Creates a new **SocketProvider** connected to %%network%%.\n *\n * If unspecified, the network will be discovered.\n */\n constructor(network, _options) {\n // Copy the options\n const options = Object.assign({}, (_options != null) ? _options : {});\n // Support for batches is generally not supported for\n // connection-base providers; if this changes in the future\n // the _send should be updated to reflect this\n assertArgument(options.batchMaxCount == null || options.batchMaxCount === 1, \"sockets-based providers do not support batches\", \"options.batchMaxCount\", _options);\n options.batchMaxCount = 1;\n // Socket-based Providers (generally) cannot change their network,\n // since they have a long-lived connection; but let people override\n // this if they have just cause.\n if (options.staticNetwork == null) {\n options.staticNetwork = true;\n }\n super(network, options);\n this.#callbacks = new Map();\n this.#subs = new Map();\n this.#pending = new Map();\n }\n // This value is only valid after _start has been called\n /*\n get _network(): Network {\n if (this.#network == null) {\n throw new Error(\"this shouldn't happen\");\n }\n return this.#network.clone();\n }\n */\n _getSubscriber(sub) {\n switch (sub.type) {\n case \"close\":\n return new UnmanagedSubscriber(\"close\");\n case \"block\":\n return new SocketBlockSubscriber(this);\n case \"pending\":\n return new SocketPendingSubscriber(this);\n case \"event\":\n return new SocketEventSubscriber(this, sub.filter);\n case \"orphan\":\n // Handled auto-matically within AbstractProvider\n // when the log.removed = true\n if (sub.filter.orphan === \"drop-log\") {\n return new UnmanagedSubscriber(\"drop-log\");\n }\n }\n return super._getSubscriber(sub);\n }\n /**\n * Register a new subscriber. This is used internalled by Subscribers\n * and generally is unecessary unless extending capabilities.\n */\n _register(filterId, subscriber) {\n this.#subs.set(filterId, subscriber);\n const pending = this.#pending.get(filterId);\n if (pending) {\n for (const message of pending) {\n subscriber._handleMessage(message);\n }\n this.#pending.delete(filterId);\n }\n }\n async _send(payload) {\n // WebSocket provider doesn't accept batches\n assertArgument(!Array.isArray(payload), \"WebSocket does not support batch send\", \"payload\", payload);\n // @TODO: stringify payloads here and store to prevent mutations\n // Prepare a promise to respond to\n const promise = new Promise((resolve, reject) => {\n this.#callbacks.set(payload.id, { payload, resolve, reject });\n });\n // Wait until the socket is connected before writing to it\n await this._waitUntilReady();\n // Write the request to the socket\n await this._write(JSON.stringify(payload));\n return [await promise];\n }\n // Sub-classes must call this once they are connected\n /*\n async _start(): Promise {\n if (this.#ready) { return; }\n\n for (const { payload } of this.#callbacks.values()) {\n await this._write(JSON.stringify(payload));\n }\n\n this.#ready = (async function() {\n await super._start();\n })();\n }\n */\n /**\n * Sub-classes **must** call this with messages received over their\n * transport to be processed and dispatched.\n */\n async _processMessage(message) {\n const result = (JSON.parse(message));\n if (result && typeof (result) === \"object\" && \"id\" in result) {\n const callback = this.#callbacks.get(result.id);\n if (callback == null) {\n this.emit(\"error\", makeError(\"received result for unknown id\", \"UNKNOWN_ERROR\", {\n reasonCode: \"UNKNOWN_ID\",\n result\n }));\n return;\n }\n this.#callbacks.delete(result.id);\n callback.resolve(result);\n }\n else if (result && result.method === \"eth_subscription\") {\n const filterId = result.params.subscription;\n const subscriber = this.#subs.get(filterId);\n if (subscriber) {\n subscriber._handleMessage(result.params.result);\n }\n else {\n let pending = this.#pending.get(filterId);\n if (pending == null) {\n pending = [];\n this.#pending.set(filterId, pending);\n }\n pending.push(result.params.result);\n }\n }\n else {\n this.emit(\"error\", makeError(\"received unexpected message\", \"UNKNOWN_ERROR\", {\n reasonCode: \"UNEXPECTED_MESSAGE\",\n result\n }));\n return;\n }\n }\n /**\n * Sub-classes **must** override this to send %%message%% over their\n * transport.\n */\n async _write(message) {\n throw new Error(\"sub-classes must override this\");\n }\n}\n//# sourceMappingURL=provider-socket.js.map","import { WebSocket as _WebSocket } from \"./ws.js\"; /*-browser*/\nimport { SocketProvider } from \"./provider-socket.js\";\n/**\n * A JSON-RPC provider which is backed by a WebSocket.\n *\n * WebSockets are often preferred because they retain a live connection\n * to a server, which permits more instant access to events.\n *\n * However, this incurs higher server infrasturture costs, so additional\n * resources may be required to host your own WebSocket nodes and many\n * third-party services charge additional fees for WebSocket endpoints.\n */\nexport class WebSocketProvider extends SocketProvider {\n #connect;\n #websocket;\n get websocket() {\n if (this.#websocket == null) {\n throw new Error(\"websocket closed\");\n }\n return this.#websocket;\n }\n constructor(url, network, options) {\n super(network, options);\n if (typeof (url) === \"string\") {\n this.#connect = () => { return new _WebSocket(url); };\n this.#websocket = this.#connect();\n }\n else if (typeof (url) === \"function\") {\n this.#connect = url;\n this.#websocket = url();\n }\n else {\n this.#connect = null;\n this.#websocket = url;\n }\n this.websocket.onopen = async () => {\n try {\n await this._start();\n this.resume();\n }\n catch (error) {\n console.log(\"failed to start WebsocketProvider\", error);\n // @TODO: now what? Attempt reconnect?\n }\n };\n this.websocket.onmessage = (message) => {\n this._processMessage(message.data);\n };\n /*\n this.websocket.onclose = (event) => {\n // @TODO: What event.code should we reconnect on?\n const reconnect = false;\n if (reconnect) {\n this.pause(true);\n if (this.#connect) {\n this.#websocket = this.#connect();\n this.#websocket.onopen = ...\n // @TODO: this requires the super class to rebroadcast; move it there\n }\n this._reconnect();\n }\n };\n */\n }\n async _write(message) {\n this.websocket.send(message);\n }\n async destroy() {\n if (this.#websocket != null) {\n this.#websocket.close();\n this.#websocket = null;\n }\n super.destroy();\n }\n}\n//# sourceMappingURL=provider-websocket.js.map","/**\n * [[link-infura]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Ethereum Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Sepolia Testnet (``sepolia``)\n * - Arbitrum (``arbitrum``)\n * - Arbitrum Goerli Testnet (``arbitrum-goerli``)\n * - Arbitrum Sepolia Testnet (``arbitrum-sepolia``)\n * - Base (``base``)\n * - Base Goerlia Testnet (``base-goerli``)\n * - Base Sepolia Testnet (``base-sepolia``)\n * - BNB Smart Chain Mainnet (``bnb``)\n * - BNB Smart Chain Testnet (``bnbt``)\n * - Linea (``linea``)\n * - Linea Goerli Testnet (``linea-goerli``)\n * - Linea Sepolia Testnet (``linea-sepolia``)\n * - Optimism (``optimism``)\n * - Optimism Goerli Testnet (``optimism-goerli``)\n * - Optimism Sepolia Testnet (``optimism-sepolia``)\n * - Polygon (``matic``)\n * - Polygon Amoy Testnet (``matic-amoy``)\n * - Polygon Mumbai Testnet (``matic-mumbai``)\n *\n * @_subsection: api/providers/thirdparty:INFURA [providers-infura]\n */\nimport { defineProperties, FetchRequest, assert, assertArgument } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nimport { WebSocketProvider } from \"./provider-websocket.js\";\nconst defaultProjectId = \"84842078b09946638c03157f83405213\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"mainnet.infura.io\";\n case \"goerli\":\n return \"goerli.infura.io\";\n case \"sepolia\":\n return \"sepolia.infura.io\";\n case \"arbitrum\":\n return \"arbitrum-mainnet.infura.io\";\n case \"arbitrum-goerli\":\n return \"arbitrum-goerli.infura.io\";\n case \"arbitrum-sepolia\":\n return \"arbitrum-sepolia.infura.io\";\n case \"base\":\n return \"base-mainnet.infura.io\";\n case \"base-goerlia\": // @TODO: Remove this typo in the future!\n case \"base-goerli\":\n return \"base-goerli.infura.io\";\n case \"base-sepolia\":\n return \"base-sepolia.infura.io\";\n case \"bnb\":\n return \"bsc-mainnet.infura.io\";\n case \"bnbt\":\n return \"bsc-testnet.infura.io\";\n case \"linea\":\n return \"linea-mainnet.infura.io\";\n case \"linea-goerli\":\n return \"linea-goerli.infura.io\";\n case \"linea-sepolia\":\n return \"linea-sepolia.infura.io\";\n case \"matic\":\n return \"polygon-mainnet.infura.io\";\n case \"matic-amoy\":\n return \"polygon-amoy.infura.io\";\n case \"matic-mumbai\":\n return \"polygon-mumbai.infura.io\";\n case \"optimism\":\n return \"optimism-mainnet.infura.io\";\n case \"optimism-goerli\":\n return \"optimism-goerli.infura.io\";\n case \"optimism-sepolia\":\n return \"optimism-sepolia.infura.io\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **InfuraWebSocketProvider** connects to the [[link-infura]]\n * WebSocket end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-infura-signup).\n */\nexport class InfuraWebSocketProvider extends WebSocketProvider {\n /**\n * The Project ID for the INFURA connection.\n */\n projectId;\n /**\n * The Project Secret.\n *\n * If null, no authenticated requests are made. This should not\n * be used outside of private contexts.\n */\n projectSecret;\n /**\n * Creates a new **InfuraWebSocketProvider**.\n */\n constructor(network, projectId) {\n const provider = new InfuraProvider(network, projectId);\n const req = provider._getConnection();\n assert(!req.credentials, \"INFURA WebSocket project secrets unsupported\", \"UNSUPPORTED_OPERATION\", { operation: \"InfuraProvider.getWebSocketProvider()\" });\n const url = req.url.replace(/^http/i, \"ws\").replace(\"/v3/\", \"/ws/v3/\");\n super(url, provider._network);\n defineProperties(this, {\n projectId: provider.projectId,\n projectSecret: provider.projectSecret\n });\n }\n isCommunityResource() {\n return (this.projectId === defaultProjectId);\n }\n}\n/**\n * The **InfuraProvider** connects to the [[link-infura]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-infura-signup).\n */\nexport class InfuraProvider extends JsonRpcProvider {\n /**\n * The Project ID for the INFURA connection.\n */\n projectId;\n /**\n * The Project Secret.\n *\n * If null, no authenticated requests are made. This should not\n * be used outside of private contexts.\n */\n projectSecret;\n /**\n * Creates a new **InfuraProvider**.\n */\n constructor(_network, projectId, projectSecret) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (projectId == null) {\n projectId = defaultProjectId;\n }\n if (projectSecret == null) {\n projectSecret = null;\n }\n const request = InfuraProvider.getRequest(network, projectId, projectSecret);\n super(request, network, { staticNetwork: network });\n defineProperties(this, { projectId, projectSecret });\n }\n _getProvider(chainId) {\n try {\n return new InfuraProvider(chainId, this.projectId, this.projectSecret);\n }\n catch (error) { }\n return super._getProvider(chainId);\n }\n isCommunityResource() {\n return (this.projectId === defaultProjectId);\n }\n /**\n * Creates a new **InfuraWebSocketProvider**.\n */\n static getWebSocketProvider(network, projectId) {\n return new InfuraWebSocketProvider(network, projectId);\n }\n /**\n * Returns a prepared request for connecting to %%network%%\n * with %%projectId%% and %%projectSecret%%.\n */\n static getRequest(network, projectId, projectSecret) {\n if (projectId == null) {\n projectId = defaultProjectId;\n }\n if (projectSecret == null) {\n projectSecret = null;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/v3/${projectId}`);\n request.allowGzip = true;\n if (projectSecret) {\n request.setCredentials(\"\", projectSecret);\n }\n if (projectId === defaultProjectId) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"InfuraProvider\");\n return true;\n };\n }\n return request;\n }\n}\n//# sourceMappingURL=provider-infura.js.map","/**\n * [[link-quicknode]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Ethereum Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Sepolia Testnet (``sepolia``)\n * - Holesky Testnet (``holesky``)\n * - Arbitrum (``arbitrum``)\n * - Arbitrum Goerli Testnet (``arbitrum-goerli``)\n * - Arbitrum Sepolia Testnet (``arbitrum-sepolia``)\n * - Base Mainnet (``base``);\n * - Base Goerli Testnet (``base-goerli``);\n * - Base Sepolia Testnet (``base-sepolia``);\n * - BNB Smart Chain Mainnet (``bnb``)\n * - BNB Smart Chain Testnet (``bnbt``)\n * - Optimism (``optimism``)\n * - Optimism Goerli Testnet (``optimism-goerli``)\n * - Optimism Sepolia Testnet (``optimism-sepolia``)\n * - Polygon (``matic``)\n * - Polygon Mumbai Testnet (``matic-mumbai``)\n *\n * @_subsection: api/providers/thirdparty:QuickNode [providers-quicknode]\n */\nimport { defineProperties, FetchRequest, assertArgument } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultToken = \"919b412a057b5e9c9b6dce193c5a60242d6efadb\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"ethers.quiknode.pro\";\n case \"goerli\":\n return \"ethers.ethereum-goerli.quiknode.pro\";\n case \"sepolia\":\n return \"ethers.ethereum-sepolia.quiknode.pro\";\n case \"holesky\":\n return \"ethers.ethereum-holesky.quiknode.pro\";\n case \"arbitrum\":\n return \"ethers.arbitrum-mainnet.quiknode.pro\";\n case \"arbitrum-goerli\":\n return \"ethers.arbitrum-goerli.quiknode.pro\";\n case \"arbitrum-sepolia\":\n return \"ethers.arbitrum-sepolia.quiknode.pro\";\n case \"base\":\n return \"ethers.base-mainnet.quiknode.pro\";\n case \"base-goerli\":\n return \"ethers.base-goerli.quiknode.pro\";\n case \"base-spolia\":\n return \"ethers.base-sepolia.quiknode.pro\";\n case \"bnb\":\n return \"ethers.bsc.quiknode.pro\";\n case \"bnbt\":\n return \"ethers.bsc-testnet.quiknode.pro\";\n case \"matic\":\n return \"ethers.matic.quiknode.pro\";\n case \"matic-mumbai\":\n return \"ethers.matic-testnet.quiknode.pro\";\n case \"optimism\":\n return \"ethers.optimism.quiknode.pro\";\n case \"optimism-goerli\":\n return \"ethers.optimism-goerli.quiknode.pro\";\n case \"optimism-sepolia\":\n return \"ethers.optimism-sepolia.quiknode.pro\";\n case \"xdai\":\n return \"ethers.xdai.quiknode.pro\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/*\n@TODO:\n These networks are not currently present in the Network\n default included networks. Research them and ensure they\n are EVM compatible and work with ethers\n\n http://ethers.matic-amoy.quiknode.pro\n\n http://ethers.avalanche-mainnet.quiknode.pro\n http://ethers.avalanche-testnet.quiknode.pro\n http://ethers.blast-sepolia.quiknode.pro\n http://ethers.celo-mainnet.quiknode.pro\n http://ethers.fantom.quiknode.pro\n http://ethers.imx-demo.quiknode.pro\n http://ethers.imx-mainnet.quiknode.pro\n http://ethers.imx-testnet.quiknode.pro\n http://ethers.near-mainnet.quiknode.pro\n http://ethers.near-testnet.quiknode.pro\n http://ethers.nova-mainnet.quiknode.pro\n http://ethers.scroll-mainnet.quiknode.pro\n http://ethers.scroll-testnet.quiknode.pro\n http://ethers.tron-mainnet.quiknode.pro\n http://ethers.zkevm-mainnet.quiknode.pro\n http://ethers.zkevm-testnet.quiknode.pro\n http://ethers.zksync-mainnet.quiknode.pro\n http://ethers.zksync-testnet.quiknode.pro\n*/\n/**\n * The **QuickNodeProvider** connects to the [[link-quicknode]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API token is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-quicknode).\n */\nexport class QuickNodeProvider extends JsonRpcProvider {\n /**\n * The API token.\n */\n token;\n /**\n * Creates a new **QuickNodeProvider**.\n */\n constructor(_network, token) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (token == null) {\n token = defaultToken;\n }\n const request = QuickNodeProvider.getRequest(network, token);\n super(request, network, { staticNetwork: network });\n defineProperties(this, { token });\n }\n _getProvider(chainId) {\n try {\n return new QuickNodeProvider(chainId, this.token);\n }\n catch (error) { }\n return super._getProvider(chainId);\n }\n isCommunityResource() {\n return (this.token === defaultToken);\n }\n /**\n * Returns a new request prepared for %%network%% and the\n * %%token%%.\n */\n static getRequest(network, token) {\n if (token == null) {\n token = defaultToken;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/${token}`);\n request.allowGzip = true;\n //if (projectSecret) { request.setCredentials(\"\", projectSecret); }\n if (token === defaultToken) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"QuickNodeProvider\");\n return true;\n };\n }\n return request;\n }\n}\n//# sourceMappingURL=provider-quicknode.js.map","/**\n * A **FallbackProvider** provides resilience, security and performance\n * in a way that is customizable and configurable.\n *\n * @_section: api/providers/fallback-provider:Fallback Provider [about-fallback-provider]\n */\nimport { assert, assertArgument, getBigInt, getNumber, isError } from \"../utils/index.js\";\nimport { AbstractProvider } from \"./abstract-provider.js\";\nimport { Network } from \"./network.js\";\nconst BN_1 = BigInt(\"1\");\nconst BN_2 = BigInt(\"2\");\nfunction shuffle(array) {\n for (let i = array.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n const tmp = array[i];\n array[i] = array[j];\n array[j] = tmp;\n }\n}\nfunction stall(duration) {\n return new Promise((resolve) => { setTimeout(resolve, duration); });\n}\nfunction getTime() { return (new Date()).getTime(); }\nfunction stringify(value) {\n return JSON.stringify(value, (key, value) => {\n if (typeof (value) === \"bigint\") {\n return { type: \"bigint\", value: value.toString() };\n }\n return value;\n });\n}\n;\nconst defaultConfig = { stallTimeout: 400, priority: 1, weight: 1 };\nconst defaultState = {\n blockNumber: -2, requests: 0, lateResponses: 0, errorResponses: 0,\n outOfSync: -1, unsupportedEvents: 0, rollingDuration: 0, score: 0,\n _network: null, _updateNumber: null, _totalTime: 0,\n _lastFatalError: null, _lastFatalErrorTimestamp: 0\n};\nasync function waitForSync(config, blockNumber) {\n while (config.blockNumber < 0 || config.blockNumber < blockNumber) {\n if (!config._updateNumber) {\n config._updateNumber = (async () => {\n try {\n const blockNumber = await config.provider.getBlockNumber();\n if (blockNumber > config.blockNumber) {\n config.blockNumber = blockNumber;\n }\n }\n catch (error) {\n config.blockNumber = -2;\n config._lastFatalError = error;\n config._lastFatalErrorTimestamp = getTime();\n }\n config._updateNumber = null;\n })();\n }\n await config._updateNumber;\n config.outOfSync++;\n if (config._lastFatalError) {\n break;\n }\n }\n}\nfunction _normalize(value) {\n if (value == null) {\n return \"null\";\n }\n if (Array.isArray(value)) {\n return \"[\" + (value.map(_normalize)).join(\",\") + \"]\";\n }\n if (typeof (value) === \"object\" && typeof (value.toJSON) === \"function\") {\n return _normalize(value.toJSON());\n }\n switch (typeof (value)) {\n case \"boolean\":\n case \"symbol\":\n return value.toString();\n case \"bigint\":\n case \"number\":\n return BigInt(value).toString();\n case \"string\":\n return JSON.stringify(value);\n case \"object\": {\n const keys = Object.keys(value);\n keys.sort();\n return \"{\" + keys.map((k) => `${JSON.stringify(k)}:${_normalize(value[k])}`).join(\",\") + \"}\";\n }\n }\n console.log(\"Could not serialize\", value);\n throw new Error(\"Hmm...\");\n}\nfunction normalizeResult(method, value) {\n if (\"error\" in value) {\n const error = value.error;\n let tag;\n if (isError(error, \"CALL_EXCEPTION\")) {\n tag = _normalize(Object.assign({}, error, {\n shortMessage: undefined, reason: undefined, info: undefined\n }));\n }\n else {\n tag = _normalize(error);\n }\n return { tag, value: error };\n }\n const result = value.result;\n return { tag: _normalize(result), value: result };\n}\n// This strategy picks the highest weight result, as long as the weight is\n// equal to or greater than quorum\nfunction checkQuorum(quorum, results) {\n const tally = new Map();\n for (const { value, tag, weight } of results) {\n const t = tally.get(tag) || { value, weight: 0 };\n t.weight += weight;\n tally.set(tag, t);\n }\n let best = null;\n for (const r of tally.values()) {\n if (r.weight >= quorum && (!best || r.weight > best.weight)) {\n best = r;\n }\n }\n if (best) {\n return best.value;\n }\n return undefined;\n}\nfunction getMedian(quorum, results) {\n let resultWeight = 0;\n const errorMap = new Map();\n let bestError = null;\n const values = [];\n for (const { value, tag, weight } of results) {\n if (value instanceof Error) {\n const e = errorMap.get(tag) || { value, weight: 0 };\n e.weight += weight;\n errorMap.set(tag, e);\n if (bestError == null || e.weight > bestError.weight) {\n bestError = e;\n }\n }\n else {\n values.push(BigInt(value));\n resultWeight += weight;\n }\n }\n if (resultWeight < quorum) {\n // We have quorum for an error\n if (bestError && bestError.weight >= quorum) {\n return bestError.value;\n }\n // We do not have quorum for a result\n return undefined;\n }\n // Get the sorted values\n values.sort((a, b) => ((a < b) ? -1 : (b > a) ? 1 : 0));\n const mid = Math.floor(values.length / 2);\n // Odd-length; take the middle value\n if (values.length % 2) {\n return values[mid];\n }\n // Even length; take the ceiling of the mean of the center two values\n return (values[mid - 1] + values[mid] + BN_1) / BN_2;\n}\nfunction getAnyResult(quorum, results) {\n // If any value or error meets quorum, that is our preferred result\n const result = checkQuorum(quorum, results);\n if (result !== undefined) {\n return result;\n }\n // Otherwise, do we have any result?\n for (const r of results) {\n if (r.value) {\n return r.value;\n }\n }\n // Nope!\n return undefined;\n}\nfunction getFuzzyMode(quorum, results) {\n if (quorum === 1) {\n return getNumber(getMedian(quorum, results), \"%internal\");\n }\n const tally = new Map();\n const add = (result, weight) => {\n const t = tally.get(result) || { result, weight: 0 };\n t.weight += weight;\n tally.set(result, t);\n };\n for (const { weight, value } of results) {\n const r = getNumber(value);\n add(r - 1, weight);\n add(r, weight);\n add(r + 1, weight);\n }\n let bestWeight = 0;\n let bestResult = undefined;\n for (const { weight, result } of tally.values()) {\n // Use this result, if this result meets quorum and has either:\n // - a better weight\n // - or equal weight, but the result is larger\n if (weight >= quorum && (weight > bestWeight || (bestResult != null && weight === bestWeight && result > bestResult))) {\n bestWeight = weight;\n bestResult = result;\n }\n }\n return bestResult;\n}\n/**\n * A **FallbackProvider** manages several [[Providers]] providing\n * resilience by switching between slow or misbehaving nodes, security\n * by requiring multiple backends to aggree and performance by allowing\n * faster backends to respond earlier.\n *\n */\nexport class FallbackProvider extends AbstractProvider {\n /**\n * The number of backends that must agree on a value before it is\n * accpeted.\n */\n quorum;\n /**\n * @_ignore:\n */\n eventQuorum;\n /**\n * @_ignore:\n */\n eventWorkers;\n #configs;\n #height;\n #initialSyncPromise;\n /**\n * Creates a new **FallbackProvider** with %%providers%% connected to\n * %%network%%.\n *\n * If a [[Provider]] is included in %%providers%%, defaults are used\n * for the configuration.\n */\n constructor(providers, network, options) {\n super(network, options);\n this.#configs = providers.map((p) => {\n if (p instanceof AbstractProvider) {\n return Object.assign({ provider: p }, defaultConfig, defaultState);\n }\n else {\n return Object.assign({}, defaultConfig, p, defaultState);\n }\n });\n this.#height = -2;\n this.#initialSyncPromise = null;\n if (options && options.quorum != null) {\n this.quorum = options.quorum;\n }\n else {\n this.quorum = Math.ceil(this.#configs.reduce((accum, config) => {\n accum += config.weight;\n return accum;\n }, 0) / 2);\n }\n this.eventQuorum = 1;\n this.eventWorkers = 1;\n assertArgument(this.quorum <= this.#configs.reduce((a, c) => (a + c.weight), 0), \"quorum exceed provider weight\", \"quorum\", this.quorum);\n }\n get providerConfigs() {\n return this.#configs.map((c) => {\n const result = Object.assign({}, c);\n for (const key in result) {\n if (key[0] === \"_\") {\n delete result[key];\n }\n }\n return result;\n });\n }\n async _detectNetwork() {\n return Network.from(getBigInt(await this._perform({ method: \"chainId\" })));\n }\n // @TODO: Add support to select providers to be the event subscriber\n //_getSubscriber(sub: Subscription): Subscriber {\n // throw new Error(\"@TODO\");\n //}\n /**\n * Transforms a %%req%% into the correct method call on %%provider%%.\n */\n async _translatePerform(provider, req) {\n switch (req.method) {\n case \"broadcastTransaction\":\n return await provider.broadcastTransaction(req.signedTransaction);\n case \"call\":\n return await provider.call(Object.assign({}, req.transaction, { blockTag: req.blockTag }));\n case \"chainId\":\n return (await provider.getNetwork()).chainId;\n case \"estimateGas\":\n return await provider.estimateGas(req.transaction);\n case \"getBalance\":\n return await provider.getBalance(req.address, req.blockTag);\n case \"getBlock\": {\n const block = (\"blockHash\" in req) ? req.blockHash : req.blockTag;\n return await provider.getBlock(block, req.includeTransactions);\n }\n case \"getBlockNumber\":\n return await provider.getBlockNumber();\n case \"getCode\":\n return await provider.getCode(req.address, req.blockTag);\n case \"getGasPrice\":\n return (await provider.getFeeData()).gasPrice;\n case \"getPriorityFee\":\n return (await provider.getFeeData()).maxPriorityFeePerGas;\n case \"getLogs\":\n return await provider.getLogs(req.filter);\n case \"getStorage\":\n return await provider.getStorage(req.address, req.position, req.blockTag);\n case \"getTransaction\":\n return await provider.getTransaction(req.hash);\n case \"getTransactionCount\":\n return await provider.getTransactionCount(req.address, req.blockTag);\n case \"getTransactionReceipt\":\n return await provider.getTransactionReceipt(req.hash);\n case \"getTransactionResult\":\n return await provider.getTransactionResult(req.hash);\n }\n }\n // Grab the next (random) config that is not already part of\n // the running set\n #getNextConfig(running) {\n // @TODO: Maybe do a check here to favour (heavily) providers that\n // do not require waitForSync and disfavour providers that\n // seem down-ish or are behaving slowly\n const configs = Array.from(running).map((r) => r.config);\n // Shuffle the states, sorted by priority\n const allConfigs = this.#configs.slice();\n shuffle(allConfigs);\n allConfigs.sort((a, b) => (a.priority - b.priority));\n for (const config of allConfigs) {\n if (config._lastFatalError) {\n continue;\n }\n if (configs.indexOf(config) === -1) {\n return config;\n }\n }\n return null;\n }\n // Adds a new runner (if available) to running.\n #addRunner(running, req) {\n const config = this.#getNextConfig(running);\n // No runners available\n if (config == null) {\n return null;\n }\n // Create a new runner\n const runner = {\n config, result: null, didBump: false,\n perform: null, staller: null\n };\n const now = getTime();\n // Start performing this operation\n runner.perform = (async () => {\n try {\n config.requests++;\n const result = await this._translatePerform(config.provider, req);\n runner.result = { result };\n }\n catch (error) {\n config.errorResponses++;\n runner.result = { error };\n }\n const dt = (getTime() - now);\n config._totalTime += dt;\n config.rollingDuration = 0.95 * config.rollingDuration + 0.05 * dt;\n runner.perform = null;\n })();\n // Start a staller; when this times out, it's time to force\n // kicking off another runner because we are taking too long\n runner.staller = (async () => {\n await stall(config.stallTimeout);\n runner.staller = null;\n })();\n running.add(runner);\n return runner;\n }\n // Initializes the blockNumber and network for each runner and\n // blocks until initialized\n async #initialSync() {\n let initialSync = this.#initialSyncPromise;\n if (!initialSync) {\n const promises = [];\n this.#configs.forEach((config) => {\n promises.push((async () => {\n await waitForSync(config, 0);\n if (!config._lastFatalError) {\n config._network = await config.provider.getNetwork();\n }\n })());\n });\n this.#initialSyncPromise = initialSync = (async () => {\n // Wait for all providers to have a block number and network\n await Promise.all(promises);\n // Check all the networks match\n let chainId = null;\n for (const config of this.#configs) {\n if (config._lastFatalError) {\n continue;\n }\n const network = (config._network);\n if (chainId == null) {\n chainId = network.chainId;\n }\n else if (network.chainId !== chainId) {\n assert(false, \"cannot mix providers on different networks\", \"UNSUPPORTED_OPERATION\", {\n operation: \"new FallbackProvider\"\n });\n }\n }\n })();\n }\n await initialSync;\n }\n async #checkQuorum(running, req) {\n // Get all the result objects\n const results = [];\n for (const runner of running) {\n if (runner.result != null) {\n const { tag, value } = normalizeResult(req.method, runner.result);\n results.push({ tag, value, weight: runner.config.weight });\n }\n }\n // Are there enough results to event meet quorum?\n if (results.reduce((a, r) => (a + r.weight), 0) < this.quorum) {\n return undefined;\n }\n switch (req.method) {\n case \"getBlockNumber\": {\n // We need to get the bootstrap block height\n if (this.#height === -2) {\n this.#height = Math.ceil(getNumber(getMedian(this.quorum, this.#configs.filter((c) => (!c._lastFatalError)).map((c) => ({\n value: c.blockNumber,\n tag: getNumber(c.blockNumber).toString(),\n weight: c.weight\n })))));\n }\n // Find the mode across all the providers, allowing for\n // a little drift between block heights\n const mode = getFuzzyMode(this.quorum, results);\n if (mode === undefined) {\n return undefined;\n }\n if (mode > this.#height) {\n this.#height = mode;\n }\n return this.#height;\n }\n case \"getGasPrice\":\n case \"getPriorityFee\":\n case \"estimateGas\":\n return getMedian(this.quorum, results);\n case \"getBlock\":\n // Pending blocks are in the mempool and already\n // quite untrustworthy; just grab anything\n if (\"blockTag\" in req && req.blockTag === \"pending\") {\n return getAnyResult(this.quorum, results);\n }\n return checkQuorum(this.quorum, results);\n case \"call\":\n case \"chainId\":\n case \"getBalance\":\n case \"getTransactionCount\":\n case \"getCode\":\n case \"getStorage\":\n case \"getTransaction\":\n case \"getTransactionReceipt\":\n case \"getLogs\":\n return checkQuorum(this.quorum, results);\n case \"broadcastTransaction\":\n return getAnyResult(this.quorum, results);\n }\n assert(false, \"unsupported method\", \"UNSUPPORTED_OPERATION\", {\n operation: `_perform(${stringify(req.method)})`\n });\n }\n async #waitForQuorum(running, req) {\n if (running.size === 0) {\n throw new Error(\"no runners?!\");\n }\n // Any promises that are interesting to watch for; an expired stall\n // or a successful perform\n const interesting = [];\n let newRunners = 0;\n for (const runner of running) {\n // No responses, yet; keep an eye on it\n if (runner.perform) {\n interesting.push(runner.perform);\n }\n // Still stalling...\n if (runner.staller) {\n interesting.push(runner.staller);\n continue;\n }\n // This runner has already triggered another runner\n if (runner.didBump) {\n continue;\n }\n // Got a response (result or error) or stalled; kick off another runner\n runner.didBump = true;\n newRunners++;\n }\n // Check if we have reached quorum on a result (or error)\n const value = await this.#checkQuorum(running, req);\n if (value !== undefined) {\n if (value instanceof Error) {\n throw value;\n }\n return value;\n }\n // Add any new runners, because a staller timed out or a result\n // or error response came in.\n for (let i = 0; i < newRunners; i++) {\n this.#addRunner(running, req);\n }\n // All providers have returned, and we have no result\n assert(interesting.length > 0, \"quorum not met\", \"SERVER_ERROR\", {\n request: \"%sub-requests\",\n info: { request: req, results: Array.from(running).map((r) => stringify(r.result)) }\n });\n // Wait for someone to either complete its perform or stall out\n await Promise.race(interesting);\n // This is recursive, but at worst case the depth is 2x the\n // number of providers (each has a perform and a staller)\n return await this.#waitForQuorum(running, req);\n }\n async _perform(req) {\n // Broadcasting a transaction is rare (ish) and already incurs\n // a cost on the user, so spamming is safe-ish. Just send it to\n // every backend.\n if (req.method === \"broadcastTransaction\") {\n // Once any broadcast provides a positive result, use it. No\n // need to wait for anyone else\n const results = this.#configs.map((c) => null);\n const broadcasts = this.#configs.map(async ({ provider, weight }, index) => {\n try {\n const result = await provider._perform(req);\n results[index] = Object.assign(normalizeResult(req.method, { result }), { weight });\n }\n catch (error) {\n results[index] = Object.assign(normalizeResult(req.method, { error }), { weight });\n }\n });\n // As each promise finishes...\n while (true) {\n // Check for a valid broadcast result\n const done = results.filter((r) => (r != null));\n for (const { value } of done) {\n if (!(value instanceof Error)) {\n return value;\n }\n }\n // Check for a legit broadcast error (one which we cannot\n // recover from; some nodes may return the following red\n // herring events:\n // - alredy seend (UNKNOWN_ERROR)\n // - NONCE_EXPIRED\n // - REPLACEMENT_UNDERPRICED\n const result = checkQuorum(this.quorum, results.filter((r) => (r != null)));\n if (isError(result, \"INSUFFICIENT_FUNDS\")) {\n throw result;\n }\n // Kick off the next provider (if any)\n const waiting = broadcasts.filter((b, i) => (results[i] == null));\n if (waiting.length === 0) {\n break;\n }\n await Promise.race(waiting);\n }\n // Use standard quorum results; any result was returned above,\n // so this will find any error that met quorum if any\n const result = getAnyResult(this.quorum, results);\n assert(result !== undefined, \"problem multi-broadcasting\", \"SERVER_ERROR\", {\n request: \"%sub-requests\",\n info: { request: req, results: results.map(stringify) }\n });\n if (result instanceof Error) {\n throw result;\n }\n return result;\n }\n await this.#initialSync();\n // Bootstrap enough runners to meet quorum\n const running = new Set();\n let inflightQuorum = 0;\n while (true) {\n const runner = this.#addRunner(running, req);\n if (runner == null) {\n break;\n }\n inflightQuorum += runner.config.weight;\n if (inflightQuorum >= this.quorum) {\n break;\n }\n }\n const result = await this.#waitForQuorum(running, req);\n // Track requests sent to a provider that are still\n // outstanding after quorum has been otherwise found\n for (const runner of running) {\n if (runner.perform && runner.result == null) {\n runner.config.lateResponses++;\n }\n }\n return result;\n }\n async destroy() {\n for (const { provider } of this.#configs) {\n provider.destroy();\n }\n super.destroy();\n }\n}\n//# sourceMappingURL=provider-fallback.js.map","import { assert } from \"../utils/index.js\";\nimport { AnkrProvider } from \"./provider-ankr.js\";\nimport { AlchemyProvider } from \"./provider-alchemy.js\";\n//import { BlockscoutProvider } from \"./provider-blockscout.js\";\nimport { ChainstackProvider } from \"./provider-chainstack.js\";\nimport { CloudflareProvider } from \"./provider-cloudflare.js\";\nimport { EtherscanProvider } from \"./provider-etherscan.js\";\nimport { InfuraProvider } from \"./provider-infura.js\";\n//import { PocketProvider } from \"./provider-pocket.js\";\nimport { QuickNodeProvider } from \"./provider-quicknode.js\";\nimport { FallbackProvider } from \"./provider-fallback.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nimport { Network } from \"./network.js\";\nimport { WebSocketProvider } from \"./provider-websocket.js\";\nfunction isWebSocketLike(value) {\n return (value && typeof (value.send) === \"function\" &&\n typeof (value.close) === \"function\");\n}\nconst Testnets = \"goerli kovan sepolia classicKotti optimism-goerli arbitrum-goerli matic-mumbai bnbt\".split(\" \");\n/**\n * Returns a default provider for %%network%%.\n *\n * If %%network%% is a [[WebSocketLike]] or string that begins with\n * ``\"ws:\"`` or ``\"wss:\"``, a [[WebSocketProvider]] is returned backed\n * by that WebSocket or URL.\n *\n * If %%network%% is a string that begins with ``\"HTTP:\"`` or ``\"HTTPS:\"``,\n * a [[JsonRpcProvider]] is returned connected to that URL.\n *\n * Otherwise, a default provider is created backed by well-known public\n * Web3 backends (such as [[link-infura]]) using community-provided API\n * keys.\n *\n * The %%options%% allows specifying custom API keys per backend (setting\n * an API key to ``\"-\"`` will omit that provider) and ``options.exclusive``\n * can be set to either a backend name or and array of backend names, which\n * will whitelist **only** those backends.\n *\n * Current backend strings supported are:\n * - ``\"alchemy\"``\n * - ``\"ankr\"``\n * - ``\"cloudflare\"``\n * - ``\"chainstack\"``\n * - ``\"etherscan\"``\n * - ``\"infura\"``\n * - ``\"publicPolygon\"``\n * - ``\"quicknode\"``\n *\n * @example:\n * // Connect to a local Geth node\n * provider = getDefaultProvider(\"http://localhost:8545/\");\n *\n * // Connect to Ethereum mainnet with any current and future\n * // third-party services available\n * provider = getDefaultProvider(\"mainnet\");\n *\n * // Connect to Polygon, but only allow Etherscan and\n * // INFURA and use \"MY_API_KEY\" in calls to Etherscan.\n * provider = getDefaultProvider(\"matic\", {\n * etherscan: \"MY_API_KEY\",\n * exclusive: [ \"etherscan\", \"infura\" ]\n * });\n */\nexport function getDefaultProvider(network, options) {\n if (options == null) {\n options = {};\n }\n const allowService = (name) => {\n if (options[name] === \"-\") {\n return false;\n }\n if (typeof (options.exclusive) === \"string\") {\n return (name === options.exclusive);\n }\n if (Array.isArray(options.exclusive)) {\n return (options.exclusive.indexOf(name) !== -1);\n }\n return true;\n };\n if (typeof (network) === \"string\" && network.match(/^https?:/)) {\n return new JsonRpcProvider(network);\n }\n if (typeof (network) === \"string\" && network.match(/^wss?:/) || isWebSocketLike(network)) {\n return new WebSocketProvider(network);\n }\n // Get the network and name, if possible\n let staticNetwork = null;\n try {\n staticNetwork = Network.from(network);\n }\n catch (error) { }\n const providers = [];\n if (allowService(\"publicPolygon\") && staticNetwork) {\n if (staticNetwork.name === \"matic\") {\n providers.push(new JsonRpcProvider(\"https:/\\/polygon-rpc.com/\", staticNetwork, { staticNetwork }));\n }\n else if (staticNetwork.name === \"matic-amoy\") {\n providers.push(new JsonRpcProvider(\"https:/\\/rpc-amoy.polygon.technology/\", staticNetwork, { staticNetwork }));\n }\n }\n if (allowService(\"alchemy\")) {\n try {\n providers.push(new AlchemyProvider(network, options.alchemy));\n }\n catch (error) { }\n }\n if (allowService(\"ankr\") && options.ankr != null) {\n try {\n providers.push(new AnkrProvider(network, options.ankr));\n }\n catch (error) { }\n }\n /* Temporarily remove until custom error issue is fixed\n if (allowService(\"blockscout\")) {\n try {\n providers.push(new BlockscoutProvider(network, options.blockscout));\n } catch (error) { }\n }\n */\n if (allowService(\"chainstack\")) {\n try {\n providers.push(new ChainstackProvider(network, options.chainstack));\n }\n catch (error) { }\n }\n if (allowService(\"cloudflare\")) {\n try {\n providers.push(new CloudflareProvider(network));\n }\n catch (error) { }\n }\n if (allowService(\"etherscan\")) {\n try {\n providers.push(new EtherscanProvider(network, options.etherscan));\n }\n catch (error) { }\n }\n if (allowService(\"infura\")) {\n try {\n let projectId = options.infura;\n let projectSecret = undefined;\n if (typeof (projectId) === \"object\") {\n projectSecret = projectId.projectSecret;\n projectId = projectId.projectId;\n }\n providers.push(new InfuraProvider(network, projectId, projectSecret));\n }\n catch (error) { }\n }\n /*\n if (options.pocket !== \"-\") {\n try {\n let appId = options.pocket;\n let secretKey: undefined | string = undefined;\n let loadBalancer: undefined | boolean = undefined;\n if (typeof(appId) === \"object\") {\n loadBalancer = !!appId.loadBalancer;\n secretKey = appId.secretKey;\n appId = appId.appId;\n }\n providers.push(new PocketProvider(network, appId, secretKey, loadBalancer));\n } catch (error) { console.log(error); }\n }\n */\n if (allowService(\"quicknode\")) {\n try {\n let token = options.quicknode;\n providers.push(new QuickNodeProvider(network, token));\n }\n catch (error) { }\n }\n assert(providers.length, \"unsupported default network\", \"UNSUPPORTED_OPERATION\", {\n operation: \"getDefaultProvider\"\n });\n // No need for a FallbackProvider\n if (providers.length === 1) {\n return providers[0];\n }\n // We use the floor because public third-party providers can be unreliable,\n // so a low number of providers with a large quorum will fail too often\n let quorum = Math.floor(providers.length / 2);\n if (quorum > 2) {\n quorum = 2;\n }\n // Testnets don't need as strong a security gaurantee and speed is\n // more useful during testing\n if (staticNetwork && Testnets.indexOf(staticNetwork.name) !== -1) {\n quorum = 1;\n }\n // Provided override qorum takes priority\n if (options && options.quorum) {\n quorum = options.quorum;\n }\n return new FallbackProvider(providers, undefined, { quorum });\n}\n//# sourceMappingURL=default-provider.js.map","import { defineProperties } from \"../utils/index.js\";\nimport { AbstractSigner } from \"./abstract-signer.js\";\n/**\n * A **NonceManager** wraps another [[Signer]] and automatically manages\n * the nonce, ensuring serialized and sequential nonces are used during\n * transaction.\n */\nexport class NonceManager extends AbstractSigner {\n /**\n * The Signer being managed.\n */\n signer;\n #noncePromise;\n #delta;\n /**\n * Creates a new **NonceManager** to manage %%signer%%.\n */\n constructor(signer) {\n super(signer.provider);\n defineProperties(this, { signer });\n this.#noncePromise = null;\n this.#delta = 0;\n }\n async getAddress() {\n return this.signer.getAddress();\n }\n connect(provider) {\n return new NonceManager(this.signer.connect(provider));\n }\n async getNonce(blockTag) {\n if (blockTag === \"pending\") {\n if (this.#noncePromise == null) {\n this.#noncePromise = super.getNonce(\"pending\");\n }\n const delta = this.#delta;\n return (await this.#noncePromise) + delta;\n }\n return super.getNonce(blockTag);\n }\n /**\n * Manually increment the nonce. This may be useful when managng\n * offline transactions.\n */\n increment() {\n this.#delta++;\n }\n /**\n * Resets the nonce, causing the **NonceManager** to reload the current\n * nonce from the blockchain on the next transaction.\n */\n reset() {\n this.#delta = 0;\n this.#noncePromise = null;\n }\n async sendTransaction(tx) {\n const noncePromise = this.getNonce(\"pending\");\n this.increment();\n tx = await this.signer.populateTransaction(tx);\n tx.nonce = await noncePromise;\n // @TODO: Maybe handle interesting/recoverable errors?\n // Like don't increment if the tx was certainly not sent\n return await this.signer.sendTransaction(tx);\n }\n signTransaction(tx) {\n return this.signer.signTransaction(tx);\n }\n signMessage(message) {\n return this.signer.signMessage(message);\n }\n signTypedData(domain, types, value) {\n return this.signer.signTypedData(domain, types, value);\n }\n}\n//# sourceMappingURL=signer-noncemanager.js.map","import { assertArgument, makeError } from \"../utils/index.js\";\nimport { JsonRpcApiPollingProvider } from \"./provider-jsonrpc.js\";\n;\n/**\n * A **BrowserProvider** is intended to wrap an injected provider which\n * adheres to the [[link-eip-1193]] standard, which most (if not all)\n * currently do.\n */\nexport class BrowserProvider extends JsonRpcApiPollingProvider {\n #request;\n #providerInfo;\n /**\n * Connect to the %%ethereum%% provider, optionally forcing the\n * %%network%%.\n */\n constructor(ethereum, network, _options) {\n // Copy the options\n const options = Object.assign({}, ((_options != null) ? _options : {}), { batchMaxCount: 1 });\n assertArgument(ethereum && ethereum.request, \"invalid EIP-1193 provider\", \"ethereum\", ethereum);\n super(network, options);\n this.#providerInfo = null;\n if (_options && _options.providerInfo) {\n this.#providerInfo = _options.providerInfo;\n }\n this.#request = async (method, params) => {\n const payload = { method, params };\n this.emit(\"debug\", { action: \"sendEip1193Request\", payload });\n try {\n const result = await ethereum.request(payload);\n this.emit(\"debug\", { action: \"receiveEip1193Result\", result });\n return result;\n }\n catch (e) {\n const error = new Error(e.message);\n error.code = e.code;\n error.data = e.data;\n error.payload = payload;\n this.emit(\"debug\", { action: \"receiveEip1193Error\", error });\n throw error;\n }\n };\n }\n get providerInfo() {\n return this.#providerInfo;\n }\n async send(method, params) {\n await this._start();\n return await super.send(method, params);\n }\n async _send(payload) {\n assertArgument(!Array.isArray(payload), \"EIP-1193 does not support batch request\", \"payload\", payload);\n try {\n const result = await this.#request(payload.method, payload.params || []);\n return [{ id: payload.id, result }];\n }\n catch (e) {\n return [{\n id: payload.id,\n error: { code: e.code, data: e.data, message: e.message }\n }];\n }\n }\n getRpcError(payload, error) {\n error = JSON.parse(JSON.stringify(error));\n // EIP-1193 gives us some machine-readable error codes, so rewrite\n // them into Ethers standard errors.\n switch (error.error.code || -1) {\n case 4001:\n error.error.message = `ethers-user-denied: ${error.error.message}`;\n break;\n case 4200:\n error.error.message = `ethers-unsupported: ${error.error.message}`;\n break;\n }\n return super.getRpcError(payload, error);\n }\n /**\n * Resolves to ``true`` if the provider manages the %%address%%.\n */\n async hasSigner(address) {\n if (address == null) {\n address = 0;\n }\n const accounts = await this.send(\"eth_accounts\", []);\n if (typeof (address) === \"number\") {\n return (accounts.length > address);\n }\n address = address.toLowerCase();\n return accounts.filter((a) => (a.toLowerCase() === address)).length !== 0;\n }\n async getSigner(address) {\n if (address == null) {\n address = 0;\n }\n if (!(await this.hasSigner(address))) {\n try {\n await this.#request(\"eth_requestAccounts\", []);\n }\n catch (error) {\n const payload = error.payload;\n throw this.getRpcError(payload, { id: payload.id, error });\n }\n }\n return await super.getSigner(address);\n }\n /**\n * Discover and connect to a Provider in the Browser using the\n * [[link-eip-6963]] discovery mechanism. If no providers are\n * present, ``null`` is resolved.\n */\n static async discover(options) {\n if (options == null) {\n options = {};\n }\n if (options.provider) {\n return new BrowserProvider(options.provider);\n }\n const context = options.window ? options.window :\n (typeof (window) !== \"undefined\") ? window : null;\n if (context == null) {\n return null;\n }\n const anyProvider = options.anyProvider;\n if (anyProvider && context.ethereum) {\n return new BrowserProvider(context.ethereum);\n }\n if (!(\"addEventListener\" in context && \"dispatchEvent\" in context\n && \"removeEventListener\" in context)) {\n return null;\n }\n const timeout = options.timeout ? options.timeout : 300;\n if (timeout === 0) {\n return null;\n }\n return await (new Promise((resolve, reject) => {\n let found = [];\n const addProvider = (event) => {\n found.push(event.detail);\n if (anyProvider) {\n finalize();\n }\n };\n const finalize = () => {\n clearTimeout(timer);\n if (found.length) {\n // If filtering is provided:\n if (options && options.filter) {\n // Call filter, with a copies of found provider infos\n const filtered = options.filter(found.map(i => Object.assign({}, (i.info))));\n if (filtered == null) {\n // No provider selected\n resolve(null);\n }\n else if (filtered instanceof BrowserProvider) {\n // Custom provider created\n resolve(filtered);\n }\n else {\n // Find the matching provider\n let match = null;\n if (filtered.uuid) {\n const matches = found.filter(f => (filtered.uuid === f.info.uuid));\n // @TODO: What should happen if multiple values\n // for the same UUID?\n match = matches[0];\n }\n if (match) {\n const { provider, info } = match;\n resolve(new BrowserProvider(provider, undefined, {\n providerInfo: info\n }));\n }\n else {\n reject(makeError(\"filter returned unknown info\", \"UNSUPPORTED_OPERATION\", {\n value: filtered\n }));\n }\n }\n }\n else {\n // Pick the first found provider\n const { provider, info } = found[0];\n resolve(new BrowserProvider(provider, undefined, {\n providerInfo: info\n }));\n }\n }\n else {\n // Nothing found\n resolve(null);\n }\n context.removeEventListener(\"eip6963:announceProvider\", addProvider);\n };\n const timer = setTimeout(() => { finalize(); }, timeout);\n context.addEventListener(\"eip6963:announceProvider\", addProvider);\n context.dispatchEvent(new Event(\"eip6963:requestProvider\"));\n }));\n }\n}\n//# sourceMappingURL=provider-browser.js.map","/**\n * [[link-blockscout]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Ethereum Mainnet (``mainnet``)\n * - Sepolia Testnet (``sepolia``)\n * - Holesky Testnet (``holesky``)\n * - Ethereum Classic (``classic``)\n * - Arbitrum (``arbitrum``)\n * - Base (``base``)\n * - Base Sepolia Testnet (``base-sepolia``)\n * - Gnosis (``xdai``)\n * - Optimism (``optimism``)\n * - Optimism Sepolia Testnet (``optimism-sepolia``)\n * - Polygon (``matic``)\n *\n * @_subsection: api/providers/thirdparty:Blockscout [providers-blockscout]\n */\nimport { assertArgument, defineProperties, FetchRequest, isHexString } from \"../utils/index.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nfunction getUrl(name) {\n switch (name) {\n case \"mainnet\":\n return \"https:/\\/eth.blockscout.com/api/eth-rpc\";\n case \"sepolia\":\n return \"https:/\\/eth-sepolia.blockscout.com/api/eth-rpc\";\n case \"holesky\":\n return \"https:/\\/eth-holesky.blockscout.com/api/eth-rpc\";\n case \"classic\":\n return \"https:/\\/etc.blockscout.com/api/eth-rpc\";\n case \"arbitrum\":\n return \"https:/\\/arbitrum.blockscout.com/api/eth-rpc\";\n case \"base\":\n return \"https:/\\/base.blockscout.com/api/eth-rpc\";\n case \"base-sepolia\":\n return \"https:/\\/base-sepolia.blockscout.com/api/eth-rpc\";\n case \"matic\":\n return \"https:/\\/polygon.blockscout.com/api/eth-rpc\";\n case \"optimism\":\n return \"https:/\\/optimism.blockscout.com/api/eth-rpc\";\n case \"optimism-sepolia\":\n return \"https:/\\/optimism-sepolia.blockscout.com/api/eth-rpc\";\n case \"xdai\":\n return \"https:/\\/gnosis.blockscout.com/api/eth-rpc\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **BlockscoutProvider** connects to the [[link-blockscout]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-blockscout).\n */\nexport class BlockscoutProvider extends JsonRpcProvider {\n /**\n * The API key.\n */\n apiKey;\n /**\n * Creates a new **BlockscoutProvider**.\n */\n constructor(_network, apiKey) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (apiKey == null) {\n apiKey = null;\n }\n const request = BlockscoutProvider.getRequest(network);\n super(request, network, { staticNetwork: network });\n defineProperties(this, { apiKey });\n }\n _getProvider(chainId) {\n try {\n return new BlockscoutProvider(chainId, this.apiKey);\n }\n catch (error) { }\n return super._getProvider(chainId);\n }\n isCommunityResource() {\n return (this.apiKey === null);\n }\n getRpcRequest(req) {\n // Blockscout enforces the TAG argument for estimateGas\n const resp = super.getRpcRequest(req);\n if (resp && resp.method === \"eth_estimateGas\" && resp.args.length == 1) {\n resp.args = resp.args.slice();\n resp.args.push(\"latest\");\n }\n return resp;\n }\n getRpcError(payload, _error) {\n const error = _error ? _error.error : null;\n // Blockscout currently drops the VM result and replaces it with a\n // human-readable string, so we need to make it machine-readable.\n if (error && error.code === -32015 && !isHexString(error.data || \"\", true)) {\n const panicCodes = {\n \"assert(false)\": \"01\",\n \"arithmetic underflow or overflow\": \"11\",\n \"division or modulo by zero\": \"12\",\n \"out-of-bounds array access; popping on an empty array\": \"31\",\n \"out-of-bounds access of an array or bytesN\": \"32\"\n };\n let panicCode = \"\";\n if (error.message === \"VM execution error.\") {\n // eth_call passes this message\n panicCode = panicCodes[error.data] || \"\";\n }\n else if (panicCodes[error.message || \"\"]) {\n panicCode = panicCodes[error.message || \"\"];\n }\n if (panicCode) {\n error.message += ` (reverted: ${error.data})`;\n error.data = \"0x4e487b7100000000000000000000000000000000000000000000000000000000000000\" + panicCode;\n }\n }\n else if (error && error.code === -32000) {\n if (error.message === \"wrong transaction nonce\") {\n error.message += \" (nonce too low)\";\n }\n }\n return super.getRpcError(payload, _error);\n }\n /**\n * Returns a prepared request for connecting to %%network%%\n * with %%apiKey%%.\n */\n static getRequest(network) {\n const request = new FetchRequest(getUrl(network.name));\n request.allowGzip = true;\n return request;\n }\n}\n//# sourceMappingURL=provider-blockscout.js.map","/**\n * [[link-pocket]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Ethereum Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Polygon (``matic``)\n * - Arbitrum (``arbitrum``)\n *\n * @_subsection: api/providers/thirdparty:Pocket [providers-pocket]\n */\nimport { defineProperties, FetchRequest, assertArgument } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultApplicationId = \"62e1ad51b37b8e00394bda3b\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"eth-mainnet.gateway.pokt.network\";\n case \"goerli\":\n return \"eth-goerli.gateway.pokt.network\";\n case \"matic\":\n return \"poly-mainnet.gateway.pokt.network\";\n case \"matic-mumbai\":\n return \"polygon-mumbai-rpc.gateway.pokt.network\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **PocketProvider** connects to the [[link-pocket]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-pocket-signup).\n */\nexport class PocketProvider extends JsonRpcProvider {\n /**\n * The Application ID for the Pocket connection.\n */\n applicationId;\n /**\n * The Application Secret for making authenticated requests\n * to the Pocket connection.\n */\n applicationSecret;\n /**\n * Create a new **PocketProvider**.\n *\n * By default connecting to ``mainnet`` with a highly throttled\n * API key.\n */\n constructor(_network, applicationId, applicationSecret) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (applicationId == null) {\n applicationId = defaultApplicationId;\n }\n if (applicationSecret == null) {\n applicationSecret = null;\n }\n const options = { staticNetwork: network };\n const request = PocketProvider.getRequest(network, applicationId, applicationSecret);\n super(request, network, options);\n defineProperties(this, { applicationId, applicationSecret });\n }\n _getProvider(chainId) {\n try {\n return new PocketProvider(chainId, this.applicationId, this.applicationSecret);\n }\n catch (error) { }\n return super._getProvider(chainId);\n }\n /**\n * Returns a prepared request for connecting to %%network%% with\n * %%applicationId%%.\n */\n static getRequest(network, applicationId, applicationSecret) {\n if (applicationId == null) {\n applicationId = defaultApplicationId;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/v1/lb/${applicationId}`);\n request.allowGzip = true;\n if (applicationSecret) {\n request.setCredentials(\"\", applicationSecret);\n }\n if (applicationId === defaultApplicationId) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"PocketProvider\");\n return true;\n };\n }\n return request;\n }\n isCommunityResource() {\n return (this.applicationId === defaultApplicationId);\n }\n}\n//# sourceMappingURL=provider-pocket.js.map","const IpcSocketProvider = undefined;\nexport { IpcSocketProvider };\n//# sourceMappingURL=provider-ipcsocket-browser.js.map","import { getAddress, resolveAddress } from \"../address/index.js\";\nimport { hashAuthorization, hashMessage, TypedDataEncoder } from \"../hash/index.js\";\nimport { AbstractSigner, copyRequest } from \"../providers/index.js\";\nimport { computeAddress, Transaction } from \"../transaction/index.js\";\nimport { defineProperties, getBigInt, resolveProperties, assert, assertArgument } from \"../utils/index.js\";\n/**\n * The **BaseWallet** is a stream-lined implementation of a\n * [[Signer]] that operates with a private key.\n *\n * It is preferred to use the [[Wallet]] class, as it offers\n * additional functionality and simplifies loading a variety\n * of JSON formats, Mnemonic Phrases, etc.\n *\n * This class may be of use for those attempting to implement\n * a minimal Signer.\n */\nexport class BaseWallet extends AbstractSigner {\n /**\n * The wallet address.\n */\n address;\n #signingKey;\n /**\n * Creates a new BaseWallet for %%privateKey%%, optionally\n * connected to %%provider%%.\n *\n * If %%provider%% is not specified, only offline methods can\n * be used.\n */\n constructor(privateKey, provider) {\n super(provider);\n assertArgument(privateKey && typeof (privateKey.sign) === \"function\", \"invalid private key\", \"privateKey\", \"[ REDACTED ]\");\n this.#signingKey = privateKey;\n const address = computeAddress(this.signingKey.publicKey);\n defineProperties(this, { address });\n }\n // Store private values behind getters to reduce visibility\n // in console.log\n /**\n * The [[SigningKey]] used for signing payloads.\n */\n get signingKey() { return this.#signingKey; }\n /**\n * The private key for this wallet.\n */\n get privateKey() { return this.signingKey.privateKey; }\n async getAddress() { return this.address; }\n connect(provider) {\n return new BaseWallet(this.#signingKey, provider);\n }\n async signTransaction(tx) {\n tx = copyRequest(tx);\n // Replace any Addressable or ENS name with an address\n const { to, from } = await resolveProperties({\n to: (tx.to ? resolveAddress(tx.to, this) : undefined),\n from: (tx.from ? resolveAddress(tx.from, this) : undefined)\n });\n if (to != null) {\n tx.to = to;\n }\n if (from != null) {\n tx.from = from;\n }\n if (tx.from != null) {\n assertArgument(getAddress((tx.from)) === this.address, \"transaction from address mismatch\", \"tx.from\", tx.from);\n delete tx.from;\n }\n // Build the transaction\n const btx = Transaction.from(tx);\n btx.signature = this.signingKey.sign(btx.unsignedHash);\n return btx.serialized;\n }\n async signMessage(message) {\n return this.signMessageSync(message);\n }\n // @TODO: Add a secialized signTx and signTyped sync that enforces\n // all parameters are known?\n /**\n * Returns the signature for %%message%% signed with this wallet.\n */\n signMessageSync(message) {\n return this.signingKey.sign(hashMessage(message)).serialized;\n }\n /**\n * Returns the Authorization for %%auth%%.\n */\n authorizeSync(auth) {\n assertArgument(typeof (auth.address) === \"string\", \"invalid address for authorizeSync\", \"auth.address\", auth);\n const signature = this.signingKey.sign(hashAuthorization(auth));\n return Object.assign({}, {\n address: getAddress(auth.address),\n nonce: getBigInt(auth.nonce || 0),\n chainId: getBigInt(auth.chainId || 0),\n }, { signature });\n }\n /**\n * Resolves to the Authorization for %%auth%%.\n */\n async authorize(auth) {\n auth = Object.assign({}, auth, {\n address: await resolveAddress(auth.address, this)\n });\n return this.authorizeSync(await this.populateAuthorization(auth));\n }\n async signTypedData(domain, types, value) {\n // Populate any ENS names\n const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (name) => {\n // @TODO: this should use resolveName; addresses don't\n // need a provider\n assert(this.provider != null, \"cannot resolve ENS names without a provider\", \"UNSUPPORTED_OPERATION\", {\n operation: \"resolveName\",\n info: { name }\n });\n const address = await this.provider.resolveName(name);\n assert(address != null, \"unconfigured ENS name\", \"UNCONFIGURED_NAME\", {\n value: name\n });\n return address;\n });\n return this.signingKey.sign(TypedDataEncoder.hash(populated.domain, types, populated.value)).serialized;\n }\n}\n//# sourceMappingURL=base-wallet.js.map","import { assertArgument } from \"../utils/index.js\";\nconst subsChrs = \" !#$%&'()*+,-./<=>?@[]^_`{|}~\";\nconst Word = /^[a-z]*$/i;\nfunction unfold(words, sep) {\n let initial = 97;\n return words.reduce((accum, word) => {\n if (word === sep) {\n initial++;\n }\n else if (word.match(Word)) {\n accum.push(String.fromCharCode(initial) + word);\n }\n else {\n initial = 97;\n accum.push(word);\n }\n return accum;\n }, []);\n}\n/**\n * @_ignore\n */\nexport function decode(data, subs) {\n // Replace all the substitutions with their expanded form\n for (let i = subsChrs.length - 1; i >= 0; i--) {\n data = data.split(subsChrs[i]).join(subs.substring(2 * i, 2 * i + 2));\n }\n // Get all tle clumps; each suffix, first-increment and second-increment\n const clumps = [];\n const leftover = data.replace(/(:|([0-9])|([A-Z][a-z]*))/g, (all, item, semi, word) => {\n if (semi) {\n for (let i = parseInt(semi); i >= 0; i--) {\n clumps.push(\";\");\n }\n }\n else {\n clumps.push(item.toLowerCase());\n }\n return \"\";\n });\n /* c8 ignore start */\n if (leftover) {\n throw new Error(`leftovers: ${JSON.stringify(leftover)}`);\n }\n /* c8 ignore stop */\n return unfold(unfold(clumps, \";\"), \":\");\n}\n/**\n * @_ignore\n */\nexport function decodeOwl(data) {\n assertArgument(data[0] === \"0\", \"unsupported auwl data\", \"data\", data);\n return decode(data.substring(1 + 2 * subsChrs.length), data.substring(1, 1 + 2 * subsChrs.length));\n}\n//# sourceMappingURL=decode-owl.js.map","import { defineProperties } from \"../utils/index.js\";\n/**\n * A Wordlist represents a collection of language-specific\n * words used to encode and devoce [[link-bip-39]] encoded data\n * by mapping words to 11-bit values and vice versa.\n */\nexport class Wordlist {\n locale;\n /**\n * Creates a new Wordlist instance.\n *\n * Sub-classes MUST call this if they provide their own constructor,\n * passing in the locale string of the language.\n *\n * Generally there is no need to create instances of a Wordlist,\n * since each language-specific Wordlist creates an instance and\n * there is no state kept internally, so they are safe to share.\n */\n constructor(locale) {\n defineProperties(this, { locale });\n }\n /**\n * Sub-classes may override this to provide a language-specific\n * method for spliting %%phrase%% into individual words.\n *\n * By default, %%phrase%% is split using any sequences of\n * white-space as defined by regular expressions (i.e. ``/\\s+/``).\n */\n split(phrase) {\n return phrase.toLowerCase().split(/\\s+/g);\n }\n /**\n * Sub-classes may override this to provider a language-specific\n * method for joining %%words%% into a phrase.\n *\n * By default, %%words%% are joined by a single space.\n */\n join(words) {\n return words.join(\" \");\n }\n}\n//# sourceMappingURL=wordlist.js.map","// Use the encode-latin.js script to create the necessary\n// data files to be consumed by this class\nimport { id } from \"../hash/index.js\";\nimport { assertArgument } from \"../utils/index.js\";\nimport { decodeOwl } from \"./decode-owl.js\";\nimport { Wordlist } from \"./wordlist.js\";\n/**\n * An OWL format Wordlist is an encoding method that exploits\n * the general locality of alphabetically sorted words to\n * achieve a simple but effective means of compression.\n *\n * This class is generally not useful to most developers as\n * it is used mainly internally to keep Wordlists for languages\n * based on ASCII-7 small.\n *\n * If necessary, there are tools within the ``generation/`` folder\n * to create the necessary data.\n */\nexport class WordlistOwl extends Wordlist {\n #data;\n #checksum;\n /**\n * Creates a new Wordlist for %%locale%% using the OWL %%data%%\n * and validated against the %%checksum%%.\n */\n constructor(locale, data, checksum) {\n super(locale);\n this.#data = data;\n this.#checksum = checksum;\n this.#words = null;\n }\n /**\n * The OWL-encoded data.\n */\n get _data() { return this.#data; }\n /**\n * Decode all the words for the wordlist.\n */\n _decodeWords() {\n return decodeOwl(this.#data);\n }\n #words;\n #loadWords() {\n if (this.#words == null) {\n const words = this._decodeWords();\n // Verify the computed list matches the official list\n const checksum = id(words.join(\"\\n\") + \"\\n\");\n /* c8 ignore start */\n if (checksum !== this.#checksum) {\n throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);\n }\n /* c8 ignore stop */\n this.#words = words;\n }\n return this.#words;\n }\n getWord(index) {\n const words = this.#loadWords();\n assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n return words[index];\n }\n getWordIndex(word) {\n return this.#loadWords().indexOf(word);\n }\n}\n//# sourceMappingURL=wordlist-owl.js.map","import { WordlistOwl } from \"./wordlist-owl.js\";\nconst words = \"0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-EgSe0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=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ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOgAyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NNGradeHoldOnP Set1BOng::Rd3Ar~ow9UUngU`:3BraRo9NeO\";\nconst checksum = \"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60\";\nlet wordlist = null;\n/**\n * The [[link-bip39-en]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangEn extends WordlistOwl {\n /**\n * Creates a new instance of the English language Wordlist.\n *\n * This should be unnecessary most of the time as the exported\n * [[langEn]] should suffice.\n *\n * @_ignore:\n */\n constructor() { super(\"en\", words, checksum); }\n /**\n * Returns a singleton instance of a ``LangEn``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangEn();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-en.js.map","import { pbkdf2, sha256 } from \"../crypto/index.js\";\nimport { defineProperties, getBytes, hexlify, assertNormalize, assertPrivate, assertArgument, toUtf8Bytes } from \"../utils/index.js\";\nimport { LangEn } from \"../wordlists/lang-en.js\";\n// Returns a byte with the MSB bits set\nfunction getUpperMask(bits) {\n return ((1 << bits) - 1) << (8 - bits) & 0xff;\n}\n// Returns a byte with the LSB bits set\nfunction getLowerMask(bits) {\n return ((1 << bits) - 1) & 0xff;\n}\nfunction mnemonicToEntropy(mnemonic, wordlist) {\n assertNormalize(\"NFKD\");\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n const words = wordlist.split(mnemonic);\n assertArgument((words.length % 3) === 0 && words.length >= 12 && words.length <= 24, \"invalid mnemonic length\", \"mnemonic\", \"[ REDACTED ]\");\n const entropy = new Uint8Array(Math.ceil(11 * words.length / 8));\n let offset = 0;\n for (let i = 0; i < words.length; i++) {\n let index = wordlist.getWordIndex(words[i].normalize(\"NFKD\"));\n assertArgument(index >= 0, `invalid mnemonic word at index ${i}`, \"mnemonic\", \"[ REDACTED ]\");\n for (let bit = 0; bit < 11; bit++) {\n if (index & (1 << (10 - bit))) {\n entropy[offset >> 3] |= (1 << (7 - (offset % 8)));\n }\n offset++;\n }\n }\n const entropyBits = 32 * words.length / 3;\n const checksumBits = words.length / 3;\n const checksumMask = getUpperMask(checksumBits);\n const checksum = getBytes(sha256(entropy.slice(0, entropyBits / 8)))[0] & checksumMask;\n assertArgument(checksum === (entropy[entropy.length - 1] & checksumMask), \"invalid mnemonic checksum\", \"mnemonic\", \"[ REDACTED ]\");\n return hexlify(entropy.slice(0, entropyBits / 8));\n}\nfunction entropyToMnemonic(entropy, wordlist) {\n assertArgument((entropy.length % 4) === 0 && entropy.length >= 16 && entropy.length <= 32, \"invalid entropy size\", \"entropy\", \"[ REDACTED ]\");\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n const indices = [0];\n let remainingBits = 11;\n for (let i = 0; i < entropy.length; i++) {\n // Consume the whole byte (with still more to go)\n if (remainingBits > 8) {\n indices[indices.length - 1] <<= 8;\n indices[indices.length - 1] |= entropy[i];\n remainingBits -= 8;\n // This byte will complete an 11-bit index\n }\n else {\n indices[indices.length - 1] <<= remainingBits;\n indices[indices.length - 1] |= entropy[i] >> (8 - remainingBits);\n // Start the next word\n indices.push(entropy[i] & getLowerMask(8 - remainingBits));\n remainingBits += 3;\n }\n }\n // Compute the checksum bits\n const checksumBits = entropy.length / 4;\n const checksum = parseInt(sha256(entropy).substring(2, 4), 16) & getUpperMask(checksumBits);\n // Shift the checksum into the word indices\n indices[indices.length - 1] <<= checksumBits;\n indices[indices.length - 1] |= (checksum >> (8 - checksumBits));\n return wordlist.join(indices.map((index) => wordlist.getWord(index)));\n}\nconst _guard = {};\n/**\n * A **Mnemonic** wraps all properties required to compute [[link-bip-39]]\n * seeds and convert between phrases and entropy.\n */\nexport class Mnemonic {\n /**\n * The mnemonic phrase of 12, 15, 18, 21 or 24 words.\n *\n * Use the [[wordlist]] ``split`` method to get the individual words.\n */\n phrase;\n /**\n * The password used for this mnemonic. If no password is used this\n * is the empty string (i.e. ``\"\"``) as per the specification.\n */\n password;\n /**\n * The wordlist for this mnemonic.\n */\n wordlist;\n /**\n * The underlying entropy which the mnemonic encodes.\n */\n entropy;\n /**\n * @private\n */\n constructor(guard, entropy, phrase, password, wordlist) {\n if (password == null) {\n password = \"\";\n }\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n assertPrivate(guard, _guard, \"Mnemonic\");\n defineProperties(this, { phrase, password, wordlist, entropy });\n }\n /**\n * Returns the seed for the mnemonic.\n */\n computeSeed() {\n const salt = toUtf8Bytes(\"mnemonic\" + this.password, \"NFKD\");\n return pbkdf2(toUtf8Bytes(this.phrase, \"NFKD\"), salt, 2048, 64, \"sha512\");\n }\n /**\n * Creates a new Mnemonic for the %%phrase%%.\n *\n * The default %%password%% is the empty string and the default\n * wordlist is the [English wordlists](LangEn).\n */\n static fromPhrase(phrase, password, wordlist) {\n // Normalize the case and space; throws if invalid\n const entropy = mnemonicToEntropy(phrase, wordlist);\n phrase = entropyToMnemonic(getBytes(entropy), wordlist);\n return new Mnemonic(_guard, entropy, phrase, password, wordlist);\n }\n /**\n * Create a new **Mnemonic** from the %%entropy%%.\n *\n * The default %%password%% is the empty string and the default\n * wordlist is the [English wordlists](LangEn).\n */\n static fromEntropy(_entropy, password, wordlist) {\n const entropy = getBytes(_entropy, \"entropy\");\n const phrase = entropyToMnemonic(entropy, wordlist);\n return new Mnemonic(_guard, hexlify(entropy), phrase, password, wordlist);\n }\n /**\n * Returns the phrase for %%mnemonic%%.\n */\n static entropyToPhrase(_entropy, wordlist) {\n const entropy = getBytes(_entropy, \"entropy\");\n return entropyToMnemonic(entropy, wordlist);\n }\n /**\n * Returns the entropy for %%phrase%%.\n */\n static phraseToEntropy(phrase, wordlist) {\n return mnemonicToEntropy(phrase, wordlist);\n }\n /**\n * Returns true if %%phrase%% is a valid [[link-bip-39]] phrase.\n *\n * This checks all the provided words belong to the %%wordlist%%,\n * that the length is valid and the checksum is correct.\n */\n static isValidMnemonic(phrase, wordlist) {\n try {\n mnemonicToEntropy(phrase, wordlist);\n return true;\n }\n catch (error) { }\n return false;\n }\n}\n//# sourceMappingURL=mnemonic.js.map","/*! MIT License. Copyright 2015-2022 Richard Moore . See LICENSE.txt. */\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar _AES_key, _AES_Kd, _AES_Ke;\n// Number of rounds by keysize\nconst numberOfRounds = { 16: 10, 24: 12, 32: 14 };\n// Round constant words\nconst rcon = [0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91];\n// S-box and Inverse S-box (S is for Substitution)\nconst S = [0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3,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, 0x5a, 0xf4, 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d];\n// Transformations for encryption\nconst T1 = [0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d, 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554, 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d, 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a, 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87, 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b, 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea, 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b, 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a, 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f, 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108, 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f, 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e, 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5, 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d, 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f, 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e, 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb, 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce, 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497, 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c, 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed, 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b, 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a, 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16, 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594, 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81, 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3, 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a, 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504, 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163, 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d, 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f, 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739, 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47, 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395, 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f, 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883, 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c, 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76, 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e, 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4, 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6, 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b, 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7, 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0, 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25, 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818, 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72, 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651, 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21, 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85, 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa, 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12, 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0, 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9, 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133, 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7, 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920, 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a, 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17, 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8, 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11, 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a];\nconst T2 = [0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b, 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5, 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b, 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676, 0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d, 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0, 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf, 0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0, 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626, 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc, 0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1, 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515, 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3, 0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a, 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2, 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575, 0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a, 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0, 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3, 0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484, 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded, 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b, 0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939, 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf, 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb, 0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585, 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f, 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8, 0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f, 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5, 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121, 0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2, 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec, 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717, 0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d, 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373, 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc, 0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888, 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414, 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb, 0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a, 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c, 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262, 0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979, 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d, 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9, 0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea, 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808, 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e, 0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6, 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f, 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a, 0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666, 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e, 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9, 0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e, 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111, 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494, 0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9, 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf, 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d, 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868, 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f, 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616];\nconst T3 = [0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b, 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5, 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b, 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76, 0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d, 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0, 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af, 0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0, 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26, 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc, 0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1, 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15, 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3, 0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a, 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2, 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75, 0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a, 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0, 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3, 0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384, 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed, 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b, 0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239, 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf, 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb, 0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185, 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f, 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8, 0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f, 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5, 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221, 0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2, 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec, 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17, 0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d, 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673, 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc, 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88, 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814, 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb, 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a, 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c, 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462, 0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279, 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d, 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9, 0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea, 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008, 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e, 0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6, 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f, 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a, 0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66, 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e, 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9, 0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e, 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211, 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394, 0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9, 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df, 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d, 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068, 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f, 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16];\nconst T4 = [0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6, 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491, 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56, 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec, 0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa, 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb, 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45, 0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b, 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c, 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83, 0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9, 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a, 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d, 0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f, 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf, 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea, 0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34, 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b, 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d, 0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713, 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1, 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6, 0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72, 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85, 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed, 0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411, 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe, 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b, 0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05, 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1, 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342, 0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf, 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3, 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e, 0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a, 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6, 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3, 0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b, 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28, 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad, 0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14, 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8, 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4, 0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2, 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da, 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049, 0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf, 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810, 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c, 0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197, 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e, 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f, 0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc, 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c, 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069, 0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927, 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322, 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733, 0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9, 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5, 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a, 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0, 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e, 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c];\n// Transformations for decryption\nconst T5 = [0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96, 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393, 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25, 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f, 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1, 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6, 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da, 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844, 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd, 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4, 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45, 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94, 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7, 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a, 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5, 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c, 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1, 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a, 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75, 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051, 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46, 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff, 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77, 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb, 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000, 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e, 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927, 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a, 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e, 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16, 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d, 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8, 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd, 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34, 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163, 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120, 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d, 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0, 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422, 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef, 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36, 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4, 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662, 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5, 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3, 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b, 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8, 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6, 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6, 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0, 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815, 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f, 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df, 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f, 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e, 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713, 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89, 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c, 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf, 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86, 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f, 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541, 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190, 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742];\nconst T6 = [0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e, 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303, 0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c, 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3, 0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0, 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9, 0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259, 0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8, 0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971, 0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a, 0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f, 0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b, 0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8, 0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab, 0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708, 0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682, 0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2, 0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe, 0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb, 0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10, 0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd, 0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015, 0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e, 0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee, 0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000, 0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72, 0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39, 0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e, 0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91, 0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a, 0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17, 0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9, 0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60, 0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e, 0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1, 0xcad731dc, 0x10426385, 0x40139722, 0x2084c611, 0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1, 0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3, 0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964, 0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390, 0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b, 0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf, 0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46, 0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af, 0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512, 0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb, 0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a, 0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8, 0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c, 0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266, 0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8, 0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6, 0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604, 0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551, 0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41, 0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647, 0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c, 0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1, 0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737, 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db, 0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340, 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95, 0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1, 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857];\nconst T7 = [0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27, 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3, 0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502, 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562, 0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe, 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3, 0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552, 0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9, 0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9, 0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce, 0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253, 0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908, 0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b, 0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655, 0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337, 0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16, 0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69, 0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6, 0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6, 0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e, 0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6, 0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050, 0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9, 0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8, 0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000, 0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a, 0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d, 0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436, 0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b, 0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12, 0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b, 0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e, 0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f, 0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb, 0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4, 0xdccad731, 0x85104263, 0x22401397, 0x112084c6, 0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729, 0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1, 0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9, 0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233, 0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4, 0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad, 0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e, 0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3, 0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25, 0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b, 0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f, 0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15, 0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0, 0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2, 0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7, 0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791, 0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496, 0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665, 0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b, 0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6, 0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13, 0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47, 0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7, 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844, 0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3, 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d, 0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456, 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8];\nconst T8 = [0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a, 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b, 0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5, 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5, 0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d, 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b, 0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95, 0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e, 0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27, 0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d, 0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562, 0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9, 0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752, 0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66, 0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3, 0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced, 0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e, 0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4, 0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4, 0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd, 0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d, 0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60, 0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767, 0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79, 0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000, 0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c, 0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736, 0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24, 0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b, 0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c, 0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12, 0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814, 0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3, 0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b, 0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8, 0x31dccad7, 0x63851042, 0x97224013, 0xc6112084, 0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7, 0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077, 0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247, 0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22, 0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698, 0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f, 0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254, 0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582, 0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf, 0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb, 0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883, 0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef, 0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629, 0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035, 0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533, 0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17, 0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4, 0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46, 0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb, 0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d, 0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb, 0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a, 0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73, 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678, 0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2, 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff, 0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064, 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0];\n// Transformations for decryption key expansion\nconst U1 = [0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3];\nconst U2 = [0x00000000, 0x0b0e090d, 0x161c121a, 0x1d121b17, 0x2c382434, 0x27362d39, 0x3a24362e, 0x312a3f23, 0x58704868, 0x537e4165, 0x4e6c5a72, 0x4562537f, 0x74486c5c, 0x7f466551, 0x62547e46, 0x695a774b, 0xb0e090d0, 0xbbee99dd, 0xa6fc82ca, 0xadf28bc7, 0x9cd8b4e4, 0x97d6bde9, 0x8ac4a6fe, 0x81caaff3, 0xe890d8b8, 0xe39ed1b5, 0xfe8ccaa2, 0xf582c3af, 0xc4a8fc8c, 0xcfa6f581, 0xd2b4ee96, 0xd9bae79b, 0x7bdb3bbb, 0x70d532b6, 0x6dc729a1, 0x66c920ac, 0x57e31f8f, 0x5ced1682, 0x41ff0d95, 0x4af10498, 0x23ab73d3, 0x28a57ade, 0x35b761c9, 0x3eb968c4, 0x0f9357e7, 0x049d5eea, 0x198f45fd, 0x12814cf0, 0xcb3bab6b, 0xc035a266, 0xdd27b971, 0xd629b07c, 0xe7038f5f, 0xec0d8652, 0xf11f9d45, 0xfa119448, 0x934be303, 0x9845ea0e, 0x8557f119, 0x8e59f814, 0xbf73c737, 0xb47dce3a, 0xa96fd52d, 0xa261dc20, 0xf6ad766d, 0xfda37f60, 0xe0b16477, 0xebbf6d7a, 0xda955259, 0xd19b5b54, 0xcc894043, 0xc787494e, 0xaedd3e05, 0xa5d33708, 0xb8c12c1f, 0xb3cf2512, 0x82e51a31, 0x89eb133c, 0x94f9082b, 0x9ff70126, 0x464de6bd, 0x4d43efb0, 0x5051f4a7, 0x5b5ffdaa, 0x6a75c289, 0x617bcb84, 0x7c69d093, 0x7767d99e, 0x1e3daed5, 0x1533a7d8, 0x0821bccf, 0x032fb5c2, 0x32058ae1, 0x390b83ec, 0x241998fb, 0x2f1791f6, 0x8d764dd6, 0x867844db, 0x9b6a5fcc, 0x906456c1, 0xa14e69e2, 0xaa4060ef, 0xb7527bf8, 0xbc5c72f5, 0xd50605be, 0xde080cb3, 0xc31a17a4, 0xc8141ea9, 0xf93e218a, 0xf2302887, 0xef223390, 0xe42c3a9d, 0x3d96dd06, 0x3698d40b, 0x2b8acf1c, 0x2084c611, 0x11aef932, 0x1aa0f03f, 0x07b2eb28, 0x0cbce225, 0x65e6956e, 0x6ee89c63, 0x73fa8774, 0x78f48e79, 0x49deb15a, 0x42d0b857, 0x5fc2a340, 0x54ccaa4d, 0xf741ecda, 0xfc4fe5d7, 0xe15dfec0, 0xea53f7cd, 0xdb79c8ee, 0xd077c1e3, 0xcd65daf4, 0xc66bd3f9, 0xaf31a4b2, 0xa43fadbf, 0xb92db6a8, 0xb223bfa5, 0x83098086, 0x8807898b, 0x9515929c, 0x9e1b9b91, 0x47a17c0a, 0x4caf7507, 0x51bd6e10, 0x5ab3671d, 0x6b99583e, 0x60975133, 0x7d854a24, 0x768b4329, 0x1fd13462, 0x14df3d6f, 0x09cd2678, 0x02c32f75, 0x33e91056, 0x38e7195b, 0x25f5024c, 0x2efb0b41, 0x8c9ad761, 0x8794de6c, 0x9a86c57b, 0x9188cc76, 0xa0a2f355, 0xabacfa58, 0xb6bee14f, 0xbdb0e842, 0xd4ea9f09, 0xdfe49604, 0xc2f68d13, 0xc9f8841e, 0xf8d2bb3d, 0xf3dcb230, 0xeecea927, 0xe5c0a02a, 0x3c7a47b1, 0x37744ebc, 0x2a6655ab, 0x21685ca6, 0x10426385, 0x1b4c6a88, 0x065e719f, 0x0d507892, 0x640a0fd9, 0x6f0406d4, 0x72161dc3, 0x791814ce, 0x48322bed, 0x433c22e0, 0x5e2e39f7, 0x552030fa, 0x01ec9ab7, 0x0ae293ba, 0x17f088ad, 0x1cfe81a0, 0x2dd4be83, 0x26dab78e, 0x3bc8ac99, 0x30c6a594, 0x599cd2df, 0x5292dbd2, 0x4f80c0c5, 0x448ec9c8, 0x75a4f6eb, 0x7eaaffe6, 0x63b8e4f1, 0x68b6edfc, 0xb10c0a67, 0xba02036a, 0xa710187d, 0xac1e1170, 0x9d342e53, 0x963a275e, 0x8b283c49, 0x80263544, 0xe97c420f, 0xe2724b02, 0xff605015, 0xf46e5918, 0xc544663b, 0xce4a6f36, 0xd3587421, 0xd8567d2c, 0x7a37a10c, 0x7139a801, 0x6c2bb316, 0x6725ba1b, 0x560f8538, 0x5d018c35, 0x40139722, 0x4b1d9e2f, 0x2247e964, 0x2949e069, 0x345bfb7e, 0x3f55f273, 0x0e7fcd50, 0x0571c45d, 0x1863df4a, 0x136dd647, 0xcad731dc, 0xc1d938d1, 0xdccb23c6, 0xd7c52acb, 0xe6ef15e8, 0xede11ce5, 0xf0f307f2, 0xfbfd0eff, 0x92a779b4, 0x99a970b9, 0x84bb6bae, 0x8fb562a3, 0xbe9f5d80, 0xb591548d, 0xa8834f9a, 0xa38d4697];\nconst U3 = [0x00000000, 0x0d0b0e09, 0x1a161c12, 0x171d121b, 0x342c3824, 0x3927362d, 0x2e3a2436, 0x23312a3f, 0x68587048, 0x65537e41, 0x724e6c5a, 0x7f456253, 0x5c74486c, 0x517f4665, 0x4662547e, 0x4b695a77, 0xd0b0e090, 0xddbbee99, 0xcaa6fc82, 0xc7adf28b, 0xe49cd8b4, 0xe997d6bd, 0xfe8ac4a6, 0xf381caaf, 0xb8e890d8, 0xb5e39ed1, 0xa2fe8cca, 0xaff582c3, 0x8cc4a8fc, 0x81cfa6f5, 0x96d2b4ee, 0x9bd9bae7, 0xbb7bdb3b, 0xb670d532, 0xa16dc729, 0xac66c920, 0x8f57e31f, 0x825ced16, 0x9541ff0d, 0x984af104, 0xd323ab73, 0xde28a57a, 0xc935b761, 0xc43eb968, 0xe70f9357, 0xea049d5e, 0xfd198f45, 0xf012814c, 0x6bcb3bab, 0x66c035a2, 0x71dd27b9, 0x7cd629b0, 0x5fe7038f, 0x52ec0d86, 0x45f11f9d, 0x48fa1194, 0x03934be3, 0x0e9845ea, 0x198557f1, 0x148e59f8, 0x37bf73c7, 0x3ab47dce, 0x2da96fd5, 0x20a261dc, 0x6df6ad76, 0x60fda37f, 0x77e0b164, 0x7aebbf6d, 0x59da9552, 0x54d19b5b, 0x43cc8940, 0x4ec78749, 0x05aedd3e, 0x08a5d337, 0x1fb8c12c, 0x12b3cf25, 0x3182e51a, 0x3c89eb13, 0x2b94f908, 0x269ff701, 0xbd464de6, 0xb04d43ef, 0xa75051f4, 0xaa5b5ffd, 0x896a75c2, 0x84617bcb, 0x937c69d0, 0x9e7767d9, 0xd51e3dae, 0xd81533a7, 0xcf0821bc, 0xc2032fb5, 0xe132058a, 0xec390b83, 0xfb241998, 0xf62f1791, 0xd68d764d, 0xdb867844, 0xcc9b6a5f, 0xc1906456, 0xe2a14e69, 0xefaa4060, 0xf8b7527b, 0xf5bc5c72, 0xbed50605, 0xb3de080c, 0xa4c31a17, 0xa9c8141e, 0x8af93e21, 0x87f23028, 0x90ef2233, 0x9de42c3a, 0x063d96dd, 0x0b3698d4, 0x1c2b8acf, 0x112084c6, 0x3211aef9, 0x3f1aa0f0, 0x2807b2eb, 0x250cbce2, 0x6e65e695, 0x636ee89c, 0x7473fa87, 0x7978f48e, 0x5a49deb1, 0x5742d0b8, 0x405fc2a3, 0x4d54ccaa, 0xdaf741ec, 0xd7fc4fe5, 0xc0e15dfe, 0xcdea53f7, 0xeedb79c8, 0xe3d077c1, 0xf4cd65da, 0xf9c66bd3, 0xb2af31a4, 0xbfa43fad, 0xa8b92db6, 0xa5b223bf, 0x86830980, 0x8b880789, 0x9c951592, 0x919e1b9b, 0x0a47a17c, 0x074caf75, 0x1051bd6e, 0x1d5ab367, 0x3e6b9958, 0x33609751, 0x247d854a, 0x29768b43, 0x621fd134, 0x6f14df3d, 0x7809cd26, 0x7502c32f, 0x5633e910, 0x5b38e719, 0x4c25f502, 0x412efb0b, 0x618c9ad7, 0x6c8794de, 0x7b9a86c5, 0x769188cc, 0x55a0a2f3, 0x58abacfa, 0x4fb6bee1, 0x42bdb0e8, 0x09d4ea9f, 0x04dfe496, 0x13c2f68d, 0x1ec9f884, 0x3df8d2bb, 0x30f3dcb2, 0x27eecea9, 0x2ae5c0a0, 0xb13c7a47, 0xbc37744e, 0xab2a6655, 0xa621685c, 0x85104263, 0x881b4c6a, 0x9f065e71, 0x920d5078, 0xd9640a0f, 0xd46f0406, 0xc372161d, 0xce791814, 0xed48322b, 0xe0433c22, 0xf75e2e39, 0xfa552030, 0xb701ec9a, 0xba0ae293, 0xad17f088, 0xa01cfe81, 0x832dd4be, 0x8e26dab7, 0x993bc8ac, 0x9430c6a5, 0xdf599cd2, 0xd25292db, 0xc54f80c0, 0xc8448ec9, 0xeb75a4f6, 0xe67eaaff, 0xf163b8e4, 0xfc68b6ed, 0x67b10c0a, 0x6aba0203, 0x7da71018, 0x70ac1e11, 0x539d342e, 0x5e963a27, 0x498b283c, 0x44802635, 0x0fe97c42, 0x02e2724b, 0x15ff6050, 0x18f46e59, 0x3bc54466, 0x36ce4a6f, 0x21d35874, 0x2cd8567d, 0x0c7a37a1, 0x017139a8, 0x166c2bb3, 0x1b6725ba, 0x38560f85, 0x355d018c, 0x22401397, 0x2f4b1d9e, 0x642247e9, 0x692949e0, 0x7e345bfb, 0x733f55f2, 0x500e7fcd, 0x5d0571c4, 0x4a1863df, 0x47136dd6, 0xdccad731, 0xd1c1d938, 0xc6dccb23, 0xcbd7c52a, 0xe8e6ef15, 0xe5ede11c, 0xf2f0f307, 0xfffbfd0e, 0xb492a779, 0xb999a970, 0xae84bb6b, 0xa38fb562, 0x80be9f5d, 0x8db59154, 0x9aa8834f, 0x97a38d46];\nconst U4 = [0x00000000, 0x090d0b0e, 0x121a161c, 0x1b171d12, 0x24342c38, 0x2d392736, 0x362e3a24, 0x3f23312a, 0x48685870, 0x4165537e, 0x5a724e6c, 0x537f4562, 0x6c5c7448, 0x65517f46, 0x7e466254, 0x774b695a, 0x90d0b0e0, 0x99ddbbee, 0x82caa6fc, 0x8bc7adf2, 0xb4e49cd8, 0xbde997d6, 0xa6fe8ac4, 0xaff381ca, 0xd8b8e890, 0xd1b5e39e, 0xcaa2fe8c, 0xc3aff582, 0xfc8cc4a8, 0xf581cfa6, 0xee96d2b4, 0xe79bd9ba, 0x3bbb7bdb, 0x32b670d5, 0x29a16dc7, 0x20ac66c9, 0x1f8f57e3, 0x16825ced, 0x0d9541ff, 0x04984af1, 0x73d323ab, 0x7ade28a5, 0x61c935b7, 0x68c43eb9, 0x57e70f93, 0x5eea049d, 0x45fd198f, 0x4cf01281, 0xab6bcb3b, 0xa266c035, 0xb971dd27, 0xb07cd629, 0x8f5fe703, 0x8652ec0d, 0x9d45f11f, 0x9448fa11, 0xe303934b, 0xea0e9845, 0xf1198557, 0xf8148e59, 0xc737bf73, 0xce3ab47d, 0xd52da96f, 0xdc20a261, 0x766df6ad, 0x7f60fda3, 0x6477e0b1, 0x6d7aebbf, 0x5259da95, 0x5b54d19b, 0x4043cc89, 0x494ec787, 0x3e05aedd, 0x3708a5d3, 0x2c1fb8c1, 0x2512b3cf, 0x1a3182e5, 0x133c89eb, 0x082b94f9, 0x01269ff7, 0xe6bd464d, 0xefb04d43, 0xf4a75051, 0xfdaa5b5f, 0xc2896a75, 0xcb84617b, 0xd0937c69, 0xd99e7767, 0xaed51e3d, 0xa7d81533, 0xbccf0821, 0xb5c2032f, 0x8ae13205, 0x83ec390b, 0x98fb2419, 0x91f62f17, 0x4dd68d76, 0x44db8678, 0x5fcc9b6a, 0x56c19064, 0x69e2a14e, 0x60efaa40, 0x7bf8b752, 0x72f5bc5c, 0x05bed506, 0x0cb3de08, 0x17a4c31a, 0x1ea9c814, 0x218af93e, 0x2887f230, 0x3390ef22, 0x3a9de42c, 0xdd063d96, 0xd40b3698, 0xcf1c2b8a, 0xc6112084, 0xf93211ae, 0xf03f1aa0, 0xeb2807b2, 0xe2250cbc, 0x956e65e6, 0x9c636ee8, 0x877473fa, 0x8e7978f4, 0xb15a49de, 0xb85742d0, 0xa3405fc2, 0xaa4d54cc, 0xecdaf741, 0xe5d7fc4f, 0xfec0e15d, 0xf7cdea53, 0xc8eedb79, 0xc1e3d077, 0xdaf4cd65, 0xd3f9c66b, 0xa4b2af31, 0xadbfa43f, 0xb6a8b92d, 0xbfa5b223, 0x80868309, 0x898b8807, 0x929c9515, 0x9b919e1b, 0x7c0a47a1, 0x75074caf, 0x6e1051bd, 0x671d5ab3, 0x583e6b99, 0x51336097, 0x4a247d85, 0x4329768b, 0x34621fd1, 0x3d6f14df, 0x267809cd, 0x2f7502c3, 0x105633e9, 0x195b38e7, 0x024c25f5, 0x0b412efb, 0xd7618c9a, 0xde6c8794, 0xc57b9a86, 0xcc769188, 0xf355a0a2, 0xfa58abac, 0xe14fb6be, 0xe842bdb0, 0x9f09d4ea, 0x9604dfe4, 0x8d13c2f6, 0x841ec9f8, 0xbb3df8d2, 0xb230f3dc, 0xa927eece, 0xa02ae5c0, 0x47b13c7a, 0x4ebc3774, 0x55ab2a66, 0x5ca62168, 0x63851042, 0x6a881b4c, 0x719f065e, 0x78920d50, 0x0fd9640a, 0x06d46f04, 0x1dc37216, 0x14ce7918, 0x2bed4832, 0x22e0433c, 0x39f75e2e, 0x30fa5520, 0x9ab701ec, 0x93ba0ae2, 0x88ad17f0, 0x81a01cfe, 0xbe832dd4, 0xb78e26da, 0xac993bc8, 0xa59430c6, 0xd2df599c, 0xdbd25292, 0xc0c54f80, 0xc9c8448e, 0xf6eb75a4, 0xffe67eaa, 0xe4f163b8, 0xedfc68b6, 0x0a67b10c, 0x036aba02, 0x187da710, 0x1170ac1e, 0x2e539d34, 0x275e963a, 0x3c498b28, 0x35448026, 0x420fe97c, 0x4b02e272, 0x5015ff60, 0x5918f46e, 0x663bc544, 0x6f36ce4a, 0x7421d358, 0x7d2cd856, 0xa10c7a37, 0xa8017139, 0xb3166c2b, 0xba1b6725, 0x8538560f, 0x8c355d01, 0x97224013, 0x9e2f4b1d, 0xe9642247, 0xe0692949, 0xfb7e345b, 0xf2733f55, 0xcd500e7f, 0xc45d0571, 0xdf4a1863, 0xd647136d, 0x31dccad7, 0x38d1c1d9, 0x23c6dccb, 0x2acbd7c5, 0x15e8e6ef, 0x1ce5ede1, 0x07f2f0f3, 0x0efffbfd, 0x79b492a7, 0x70b999a9, 0x6bae84bb, 0x62a38fb5, 0x5d80be9f, 0x548db591, 0x4f9aa883, 0x4697a38d];\nfunction convertToInt32(bytes) {\n const result = [];\n for (let i = 0; i < bytes.length; i += 4) {\n result.push((bytes[i] << 24) | (bytes[i + 1] << 16) | (bytes[i + 2] << 8) | bytes[i + 3]);\n }\n return result;\n}\nexport class AES {\n get key() { return __classPrivateFieldGet(this, _AES_key, \"f\").slice(); }\n constructor(key) {\n _AES_key.set(this, void 0);\n _AES_Kd.set(this, void 0);\n _AES_Ke.set(this, void 0);\n if (!(this instanceof AES)) {\n throw Error('AES must be instanitated with `new`');\n }\n __classPrivateFieldSet(this, _AES_key, new Uint8Array(key), \"f\");\n const rounds = numberOfRounds[this.key.length];\n if (rounds == null) {\n throw new TypeError('invalid key size (must be 16, 24 or 32 bytes)');\n }\n // encryption round keys\n __classPrivateFieldSet(this, _AES_Ke, [], \"f\");\n // decryption round keys\n __classPrivateFieldSet(this, _AES_Kd, [], \"f\");\n for (let i = 0; i <= rounds; i++) {\n __classPrivateFieldGet(this, _AES_Ke, \"f\").push([0, 0, 0, 0]);\n __classPrivateFieldGet(this, _AES_Kd, \"f\").push([0, 0, 0, 0]);\n }\n const roundKeyCount = (rounds + 1) * 4;\n const KC = this.key.length / 4;\n // convert the key into ints\n const tk = convertToInt32(this.key);\n // copy values into round key arrays\n let index;\n for (let i = 0; i < KC; i++) {\n index = i >> 2;\n __classPrivateFieldGet(this, _AES_Ke, \"f\")[index][i % 4] = tk[i];\n __classPrivateFieldGet(this, _AES_Kd, \"f\")[rounds - index][i % 4] = tk[i];\n }\n // key expansion (fips-197 section 5.2)\n let rconpointer = 0;\n let t = KC, tt;\n while (t < roundKeyCount) {\n tt = tk[KC - 1];\n tk[0] ^= ((S[(tt >> 16) & 0xFF] << 24) ^\n (S[(tt >> 8) & 0xFF] << 16) ^\n (S[tt & 0xFF] << 8) ^\n S[(tt >> 24) & 0xFF] ^\n (rcon[rconpointer] << 24));\n rconpointer += 1;\n // key expansion (for non-256 bit)\n if (KC != 8) {\n for (let i = 1; i < KC; i++) {\n tk[i] ^= tk[i - 1];\n }\n // key expansion for 256-bit keys is \"slightly different\" (fips-197)\n }\n else {\n for (let i = 1; i < (KC / 2); i++) {\n tk[i] ^= tk[i - 1];\n }\n tt = tk[(KC / 2) - 1];\n tk[KC / 2] ^= (S[tt & 0xFF] ^\n (S[(tt >> 8) & 0xFF] << 8) ^\n (S[(tt >> 16) & 0xFF] << 16) ^\n (S[(tt >> 24) & 0xFF] << 24));\n for (let i = (KC / 2) + 1; i < KC; i++) {\n tk[i] ^= tk[i - 1];\n }\n }\n // copy values into round key arrays\n let i = 0, r, c;\n while (i < KC && t < roundKeyCount) {\n r = t >> 2;\n c = t % 4;\n __classPrivateFieldGet(this, _AES_Ke, \"f\")[r][c] = tk[i];\n __classPrivateFieldGet(this, _AES_Kd, \"f\")[rounds - r][c] = tk[i++];\n t++;\n }\n }\n // inverse-cipher-ify the decryption round key (fips-197 section 5.3)\n for (let r = 1; r < rounds; r++) {\n for (let c = 0; c < 4; c++) {\n tt = __classPrivateFieldGet(this, _AES_Kd, \"f\")[r][c];\n __classPrivateFieldGet(this, _AES_Kd, \"f\")[r][c] = (U1[(tt >> 24) & 0xFF] ^\n U2[(tt >> 16) & 0xFF] ^\n U3[(tt >> 8) & 0xFF] ^\n U4[tt & 0xFF]);\n }\n }\n }\n encrypt(plaintext) {\n if (plaintext.length != 16) {\n throw new TypeError('invalid plaintext size (must be 16 bytes)');\n }\n const rounds = __classPrivateFieldGet(this, _AES_Ke, \"f\").length - 1;\n const a = [0, 0, 0, 0];\n // convert plaintext to (ints ^ key)\n let t = convertToInt32(plaintext);\n for (let i = 0; i < 4; i++) {\n t[i] ^= __classPrivateFieldGet(this, _AES_Ke, \"f\")[0][i];\n }\n // apply round transforms\n for (let r = 1; r < rounds; r++) {\n for (let i = 0; i < 4; i++) {\n a[i] = (T1[(t[i] >> 24) & 0xff] ^\n T2[(t[(i + 1) % 4] >> 16) & 0xff] ^\n T3[(t[(i + 2) % 4] >> 8) & 0xff] ^\n T4[t[(i + 3) % 4] & 0xff] ^\n __classPrivateFieldGet(this, _AES_Ke, \"f\")[r][i]);\n }\n t = a.slice();\n }\n // the last round is special\n const result = new Uint8Array(16);\n let tt = 0;\n for (let i = 0; i < 4; i++) {\n tt = __classPrivateFieldGet(this, _AES_Ke, \"f\")[rounds][i];\n result[4 * i] = (S[(t[i] >> 24) & 0xff] ^ (tt >> 24)) & 0xff;\n result[4 * i + 1] = (S[(t[(i + 1) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff;\n result[4 * i + 2] = (S[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff;\n result[4 * i + 3] = (S[t[(i + 3) % 4] & 0xff] ^ tt) & 0xff;\n }\n return result;\n }\n decrypt(ciphertext) {\n if (ciphertext.length != 16) {\n throw new TypeError('invalid ciphertext size (must be 16 bytes)');\n }\n const rounds = __classPrivateFieldGet(this, _AES_Kd, \"f\").length - 1;\n const a = [0, 0, 0, 0];\n // convert plaintext to (ints ^ key)\n let t = convertToInt32(ciphertext);\n for (let i = 0; i < 4; i++) {\n t[i] ^= __classPrivateFieldGet(this, _AES_Kd, \"f\")[0][i];\n }\n // apply round transforms\n for (let r = 1; r < rounds; r++) {\n for (let i = 0; i < 4; i++) {\n a[i] = (T5[(t[i] >> 24) & 0xff] ^\n T6[(t[(i + 3) % 4] >> 16) & 0xff] ^\n T7[(t[(i + 2) % 4] >> 8) & 0xff] ^\n T8[t[(i + 1) % 4] & 0xff] ^\n __classPrivateFieldGet(this, _AES_Kd, \"f\")[r][i]);\n }\n t = a.slice();\n }\n // the last round is special\n const result = new Uint8Array(16);\n let tt = 0;\n for (let i = 0; i < 4; i++) {\n tt = __classPrivateFieldGet(this, _AES_Kd, \"f\")[rounds][i];\n result[4 * i] = (Si[(t[i] >> 24) & 0xff] ^ (tt >> 24)) & 0xff;\n result[4 * i + 1] = (Si[(t[(i + 3) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff;\n result[4 * i + 2] = (Si[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff;\n result[4 * i + 3] = (Si[t[(i + 1) % 4] & 0xff] ^ tt) & 0xff;\n }\n return result;\n }\n}\n_AES_key = new WeakMap(), _AES_Kd = new WeakMap(), _AES_Ke = new WeakMap();\n//# sourceMappingURL=aes.js.map","import { AES } from \"./aes.js\";\nexport class ModeOfOperation {\n constructor(name, key, cls) {\n if (cls && !(this instanceof cls)) {\n throw new Error(`${name} must be instantiated with \"new\"`);\n }\n Object.defineProperties(this, {\n aes: { enumerable: true, value: new AES(key) },\n name: { enumerable: true, value: name }\n });\n }\n}\n//# sourceMappingURL=mode.js.map","// Cipher Block Chaining\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _CBC_iv, _CBC_lastBlock;\nimport { ModeOfOperation } from \"./mode.js\";\nexport class CBC extends ModeOfOperation {\n constructor(key, iv) {\n super(\"ECC\", key, CBC);\n _CBC_iv.set(this, void 0);\n _CBC_lastBlock.set(this, void 0);\n if (iv) {\n if (iv.length % 16) {\n throw new TypeError(\"invalid iv size (must be 16 bytes)\");\n }\n __classPrivateFieldSet(this, _CBC_iv, new Uint8Array(iv), \"f\");\n }\n else {\n __classPrivateFieldSet(this, _CBC_iv, new Uint8Array(16), \"f\");\n }\n __classPrivateFieldSet(this, _CBC_lastBlock, this.iv, \"f\");\n }\n get iv() { return new Uint8Array(__classPrivateFieldGet(this, _CBC_iv, \"f\")); }\n encrypt(plaintext) {\n if (plaintext.length % 16) {\n throw new TypeError(\"invalid plaintext size (must be multiple of 16 bytes)\");\n }\n const ciphertext = new Uint8Array(plaintext.length);\n for (let i = 0; i < plaintext.length; i += 16) {\n for (let j = 0; j < 16; j++) {\n __classPrivateFieldGet(this, _CBC_lastBlock, \"f\")[j] ^= plaintext[i + j];\n }\n __classPrivateFieldSet(this, _CBC_lastBlock, this.aes.encrypt(__classPrivateFieldGet(this, _CBC_lastBlock, \"f\")), \"f\");\n ciphertext.set(__classPrivateFieldGet(this, _CBC_lastBlock, \"f\"), i);\n }\n return ciphertext;\n }\n decrypt(ciphertext) {\n if (ciphertext.length % 16) {\n throw new TypeError(\"invalid ciphertext size (must be multiple of 16 bytes)\");\n }\n const plaintext = new Uint8Array(ciphertext.length);\n for (let i = 0; i < ciphertext.length; i += 16) {\n const block = this.aes.decrypt(ciphertext.subarray(i, i + 16));\n for (let j = 0; j < 16; j++) {\n plaintext[i + j] = block[j] ^ __classPrivateFieldGet(this, _CBC_lastBlock, \"f\")[j];\n __classPrivateFieldGet(this, _CBC_lastBlock, \"f\")[j] = ciphertext[i + j];\n }\n }\n return plaintext;\n }\n}\n_CBC_iv = new WeakMap(), _CBC_lastBlock = new WeakMap();\n//# sourceMappingURL=mode-cbc.js.map","// Counter Mode\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _CTR_remaining, _CTR_remainingIndex, _CTR_counter;\nimport { ModeOfOperation } from \"./mode.js\";\nexport class CTR extends ModeOfOperation {\n constructor(key, initialValue) {\n super(\"CTR\", key, CTR);\n // Remaining bytes for the one-time pad\n _CTR_remaining.set(this, void 0);\n _CTR_remainingIndex.set(this, void 0);\n // The current counter\n _CTR_counter.set(this, void 0);\n __classPrivateFieldSet(this, _CTR_counter, new Uint8Array(16), \"f\");\n __classPrivateFieldGet(this, _CTR_counter, \"f\").fill(0);\n __classPrivateFieldSet(this, _CTR_remaining, __classPrivateFieldGet(this, _CTR_counter, \"f\"), \"f\"); // This will be discarded immediately\n __classPrivateFieldSet(this, _CTR_remainingIndex, 16, \"f\");\n if (initialValue == null) {\n initialValue = 1;\n }\n if (typeof (initialValue) === \"number\") {\n this.setCounterValue(initialValue);\n }\n else {\n this.setCounterBytes(initialValue);\n }\n }\n get counter() { return new Uint8Array(__classPrivateFieldGet(this, _CTR_counter, \"f\")); }\n setCounterValue(value) {\n if (!Number.isInteger(value) || value < 0 || value > Number.MAX_SAFE_INTEGER) {\n throw new TypeError(\"invalid counter initial integer value\");\n }\n for (let index = 15; index >= 0; --index) {\n __classPrivateFieldGet(this, _CTR_counter, \"f\")[index] = value % 256;\n value = Math.floor(value / 256);\n }\n }\n setCounterBytes(value) {\n if (value.length !== 16) {\n throw new TypeError(\"invalid counter initial Uint8Array value length\");\n }\n __classPrivateFieldGet(this, _CTR_counter, \"f\").set(value);\n }\n increment() {\n for (let i = 15; i >= 0; i--) {\n if (__classPrivateFieldGet(this, _CTR_counter, \"f\")[i] === 255) {\n __classPrivateFieldGet(this, _CTR_counter, \"f\")[i] = 0;\n }\n else {\n __classPrivateFieldGet(this, _CTR_counter, \"f\")[i]++;\n break;\n }\n }\n }\n encrypt(plaintext) {\n var _a, _b;\n const crypttext = new Uint8Array(plaintext);\n for (let i = 0; i < crypttext.length; i++) {\n if (__classPrivateFieldGet(this, _CTR_remainingIndex, \"f\") === 16) {\n __classPrivateFieldSet(this, _CTR_remaining, this.aes.encrypt(__classPrivateFieldGet(this, _CTR_counter, \"f\")), \"f\");\n __classPrivateFieldSet(this, _CTR_remainingIndex, 0, \"f\");\n this.increment();\n }\n crypttext[i] ^= __classPrivateFieldGet(this, _CTR_remaining, \"f\")[__classPrivateFieldSet(this, _CTR_remainingIndex, (_b = __classPrivateFieldGet(this, _CTR_remainingIndex, \"f\"), _a = _b++, _b), \"f\"), _a];\n }\n return crypttext;\n }\n decrypt(ciphertext) {\n return this.encrypt(ciphertext);\n }\n}\n_CTR_remaining = new WeakMap(), _CTR_remainingIndex = new WeakMap(), _CTR_counter = new WeakMap();\n//# sourceMappingURL=mode-ctr.js.map","export function pkcs7Pad(data) {\n const padder = 16 - (data.length % 16);\n const result = new Uint8Array(data.length + padder);\n result.set(data);\n for (let i = data.length; i < result.length; i++) {\n result[i] = padder;\n }\n return result;\n}\nexport function pkcs7Strip(data) {\n if (data.length < 16) {\n throw new TypeError('PKCS#7 invalid length');\n }\n const padder = data[data.length - 1];\n if (padder > 16) {\n throw new TypeError('PKCS#7 padding byte out of range');\n }\n const length = data.length - padder;\n for (let i = 0; i < padder; i++) {\n if (data[length + i] !== padder) {\n throw new TypeError('PKCS#7 invalid padding byte');\n }\n }\n return new Uint8Array(data.subarray(0, length));\n}\n//# sourceMappingURL=padding.js.map","/**\n * @_ignore\n */\nimport { getBytesCopy, assertArgument, toUtf8Bytes } from \"../utils/index.js\";\nexport function looseArrayify(hexString) {\n if (typeof (hexString) === \"string\" && !hexString.startsWith(\"0x\")) {\n hexString = \"0x\" + hexString;\n }\n return getBytesCopy(hexString);\n}\nexport function zpad(value, length) {\n value = String(value);\n while (value.length < length) {\n value = '0' + value;\n }\n return value;\n}\nexport function getPassword(password) {\n if (typeof (password) === 'string') {\n return toUtf8Bytes(password, \"NFKC\");\n }\n return getBytesCopy(password);\n}\nexport function spelunk(object, _path) {\n const match = _path.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);\n assertArgument(match != null, \"invalid path\", \"path\", _path);\n const path = match[1];\n const type = match[3];\n const reqd = (match[4] === \"!\");\n let cur = object;\n for (const comp of path.toLowerCase().split('.')) {\n // Search for a child object with a case-insensitive matching key\n if (Array.isArray(cur)) {\n if (!comp.match(/^[0-9]+$/)) {\n break;\n }\n cur = cur[parseInt(comp)];\n }\n else if (typeof (cur) === \"object\") {\n let found = null;\n for (const key in cur) {\n if (key.toLowerCase() === comp) {\n found = cur[key];\n break;\n }\n }\n cur = found;\n }\n else {\n cur = null;\n }\n if (cur == null) {\n break;\n }\n }\n assertArgument(!reqd || cur != null, \"missing required value\", \"path\", path);\n if (type && cur != null) {\n if (type === \"int\") {\n if (typeof (cur) === \"string\" && cur.match(/^-?[0-9]+$/)) {\n return parseInt(cur);\n }\n else if (Number.isSafeInteger(cur)) {\n return cur;\n }\n }\n if (type === \"number\") {\n if (typeof (cur) === \"string\" && cur.match(/^-?[0-9.]*$/)) {\n return parseFloat(cur);\n }\n }\n if (type === \"data\") {\n if (typeof (cur) === \"string\") {\n return looseArrayify(cur);\n }\n }\n if (type === \"array\" && Array.isArray(cur)) {\n return cur;\n }\n if (type === typeof (cur)) {\n return cur;\n }\n assertArgument(false, `wrong type found for ${type} `, \"path\", path);\n }\n return cur;\n}\n/*\nexport function follow(object: any, path: string): null | string {\n let currentChild = object;\n\n for (const comp of path.toLowerCase().split('/')) {\n\n // Search for a child object with a case-insensitive matching key\n let matchingChild = null;\n for (const key in currentChild) {\n if (key.toLowerCase() === comp) {\n matchingChild = currentChild[key];\n break;\n }\n }\n\n if (matchingChild === null) { return null; }\n\n currentChild = matchingChild;\n }\n\n return currentChild;\n}\n\n// \"path/to/something:type!\"\nexport function followRequired(data: any, path: string): string {\n const value = follow(data, path);\n if (value != null) { return value; }\n return logger.throwArgumentError(\"invalid value\", `data:${ path }`,\n JSON.stringify(data));\n}\n*/\n// See: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4)\n/*\nexport function uuidV4(randomBytes: BytesLike): string {\n const bytes = getBytes(randomBytes, \"randomBytes\");\n\n // Section: 4.1.3:\n // - time_hi_and_version[12:16] = 0b0100\n bytes[6] = (bytes[6] & 0x0f) | 0x40;\n\n // Section 4.4\n // - clock_seq_hi_and_reserved[6] = 0b0\n // - clock_seq_hi_and_reserved[7] = 0b1\n bytes[8] = (bytes[8] & 0x3f) | 0x80;\n\n const value = hexlify(bytes);\n\n return [\n value.substring(2, 10),\n value.substring(10, 14),\n value.substring(14, 18),\n value.substring(18, 22),\n value.substring(22, 34),\n ].join(\"-\");\n}\n*/\n//# sourceMappingURL=utils.js.map","/**\n * The JSON Wallet formats allow a simple way to store the private\n * keys needed in Ethereum along with related information and allows\n * for extensible forms of encryption.\n *\n * These utilities facilitate decrypting and encrypting the most common\n * JSON Wallet formats.\n *\n * @_subsection: api/wallet:JSON Wallets [json-wallets]\n */\nimport { CTR } from \"aes-js\";\nimport { getAddress } from \"../address/index.js\";\nimport { keccak256, pbkdf2, randomBytes, scrypt, scryptSync } from \"../crypto/index.js\";\nimport { computeAddress } from \"../transaction/index.js\";\nimport { concat, getBytes, hexlify, uuidV4, assert, assertArgument } from \"../utils/index.js\";\nimport { getPassword, spelunk, zpad } from \"./utils.js\";\nimport { version } from \"../_version.js\";\nconst defaultPath = \"m/44'/60'/0'/0/0\";\n/**\n * Returns true if %%json%% is a valid JSON Keystore Wallet.\n */\nexport function isKeystoreJson(json) {\n try {\n const data = JSON.parse(json);\n const version = ((data.version != null) ? parseInt(data.version) : 0);\n if (version === 3) {\n return true;\n }\n }\n catch (error) { }\n return false;\n}\nfunction decrypt(data, key, ciphertext) {\n const cipher = spelunk(data, \"crypto.cipher:string\");\n if (cipher === \"aes-128-ctr\") {\n const iv = spelunk(data, \"crypto.cipherparams.iv:data!\");\n const aesCtr = new CTR(key, iv);\n return hexlify(aesCtr.decrypt(ciphertext));\n }\n assert(false, \"unsupported cipher\", \"UNSUPPORTED_OPERATION\", {\n operation: \"decrypt\"\n });\n}\nfunction getAccount(data, _key) {\n const key = getBytes(_key);\n const ciphertext = spelunk(data, \"crypto.ciphertext:data!\");\n const computedMAC = hexlify(keccak256(concat([key.slice(16, 32), ciphertext]))).substring(2);\n assertArgument(computedMAC === spelunk(data, \"crypto.mac:string!\").toLowerCase(), \"incorrect password\", \"password\", \"[ REDACTED ]\");\n const privateKey = decrypt(data, key.slice(0, 16), ciphertext);\n const address = computeAddress(privateKey);\n if (data.address) {\n let check = data.address.toLowerCase();\n if (!check.startsWith(\"0x\")) {\n check = \"0x\" + check;\n }\n assertArgument(getAddress(check) === address, \"keystore address/privateKey mismatch\", \"address\", data.address);\n }\n const account = { address, privateKey };\n // Version 0.1 x-ethers metadata must contain an encrypted mnemonic phrase\n const version = spelunk(data, \"x-ethers.version:string\");\n if (version === \"0.1\") {\n const mnemonicKey = key.slice(32, 64);\n const mnemonicCiphertext = spelunk(data, \"x-ethers.mnemonicCiphertext:data!\");\n const mnemonicIv = spelunk(data, \"x-ethers.mnemonicCounter:data!\");\n const mnemonicAesCtr = new CTR(mnemonicKey, mnemonicIv);\n account.mnemonic = {\n path: (spelunk(data, \"x-ethers.path:string\") || defaultPath),\n locale: (spelunk(data, \"x-ethers.locale:string\") || \"en\"),\n entropy: hexlify(getBytes(mnemonicAesCtr.decrypt(mnemonicCiphertext)))\n };\n }\n return account;\n}\nfunction getDecryptKdfParams(data) {\n const kdf = spelunk(data, \"crypto.kdf:string\");\n if (kdf && typeof (kdf) === \"string\") {\n if (kdf.toLowerCase() === \"scrypt\") {\n const salt = spelunk(data, \"crypto.kdfparams.salt:data!\");\n const N = spelunk(data, \"crypto.kdfparams.n:int!\");\n const r = spelunk(data, \"crypto.kdfparams.r:int!\");\n const p = spelunk(data, \"crypto.kdfparams.p:int!\");\n // Make sure N is a power of 2\n assertArgument(N > 0 && (N & (N - 1)) === 0, \"invalid kdf.N\", \"kdf.N\", N);\n assertArgument(r > 0 && p > 0, \"invalid kdf\", \"kdf\", kdf);\n const dkLen = spelunk(data, \"crypto.kdfparams.dklen:int!\");\n assertArgument(dkLen === 32, \"invalid kdf.dklen\", \"kdf.dflen\", dkLen);\n return { name: \"scrypt\", salt, N, r, p, dkLen: 64 };\n }\n else if (kdf.toLowerCase() === \"pbkdf2\") {\n const salt = spelunk(data, \"crypto.kdfparams.salt:data!\");\n const prf = spelunk(data, \"crypto.kdfparams.prf:string!\");\n const algorithm = prf.split(\"-\").pop();\n assertArgument(algorithm === \"sha256\" || algorithm === \"sha512\", \"invalid kdf.pdf\", \"kdf.pdf\", prf);\n const count = spelunk(data, \"crypto.kdfparams.c:int!\");\n const dkLen = spelunk(data, \"crypto.kdfparams.dklen:int!\");\n assertArgument(dkLen === 32, \"invalid kdf.dklen\", \"kdf.dklen\", dkLen);\n return { name: \"pbkdf2\", salt, count, dkLen, algorithm };\n }\n }\n assertArgument(false, \"unsupported key-derivation function\", \"kdf\", kdf);\n}\n/**\n * Returns the account details for the JSON Keystore Wallet %%json%%\n * using %%password%%.\n *\n * It is preferred to use the [async version](decryptKeystoreJson)\n * instead, which allows a [[ProgressCallback]] to keep the user informed\n * as to the decryption status.\n *\n * This method will block the event loop (freezing all UI) until decryption\n * is complete, which can take quite some time, depending on the wallet\n * paramters and platform.\n */\nexport function decryptKeystoreJsonSync(json, _password) {\n const data = JSON.parse(json);\n const password = getPassword(_password);\n const params = getDecryptKdfParams(data);\n if (params.name === \"pbkdf2\") {\n const { salt, count, dkLen, algorithm } = params;\n const key = pbkdf2(password, salt, count, dkLen, algorithm);\n return getAccount(data, key);\n }\n assert(params.name === \"scrypt\", \"cannot be reached\", \"UNKNOWN_ERROR\", { params });\n const { salt, N, r, p, dkLen } = params;\n const key = scryptSync(password, salt, N, r, p, dkLen);\n return getAccount(data, key);\n}\nfunction stall(duration) {\n return new Promise((resolve) => { setTimeout(() => { resolve(); }, duration); });\n}\n/**\n * Resolves to the decrypted JSON Keystore Wallet %%json%% using the\n * %%password%%.\n *\n * If provided, %%progress%% will be called periodically during the\n * decrpytion to provide feedback, and if the function returns\n * ``false`` will halt decryption.\n *\n * The %%progressCallback%% will **always** receive ``0`` before\n * decryption begins and ``1`` when complete.\n */\nexport async function decryptKeystoreJson(json, _password, progress) {\n const data = JSON.parse(json);\n const password = getPassword(_password);\n const params = getDecryptKdfParams(data);\n if (params.name === \"pbkdf2\") {\n if (progress) {\n progress(0);\n await stall(0);\n }\n const { salt, count, dkLen, algorithm } = params;\n const key = pbkdf2(password, salt, count, dkLen, algorithm);\n if (progress) {\n progress(1);\n await stall(0);\n }\n return getAccount(data, key);\n }\n assert(params.name === \"scrypt\", \"cannot be reached\", \"UNKNOWN_ERROR\", { params });\n const { salt, N, r, p, dkLen } = params;\n const key = await scrypt(password, salt, N, r, p, dkLen, progress);\n return getAccount(data, key);\n}\nfunction getEncryptKdfParams(options) {\n // Check/generate the salt\n const salt = (options.salt != null) ? getBytes(options.salt, \"options.salt\") : randomBytes(32);\n // Override the scrypt password-based key derivation function parameters\n let N = (1 << 17), r = 8, p = 1;\n if (options.scrypt) {\n if (options.scrypt.N) {\n N = options.scrypt.N;\n }\n if (options.scrypt.r) {\n r = options.scrypt.r;\n }\n if (options.scrypt.p) {\n p = options.scrypt.p;\n }\n }\n assertArgument(typeof (N) === \"number\" && N > 0 && Number.isSafeInteger(N) && (BigInt(N) & BigInt(N - 1)) === BigInt(0), \"invalid scrypt N parameter\", \"options.N\", N);\n assertArgument(typeof (r) === \"number\" && r > 0 && Number.isSafeInteger(r), \"invalid scrypt r parameter\", \"options.r\", r);\n assertArgument(typeof (p) === \"number\" && p > 0 && Number.isSafeInteger(p), \"invalid scrypt p parameter\", \"options.p\", p);\n return { name: \"scrypt\", dkLen: 32, salt, N, r, p };\n}\nfunction _encryptKeystore(key, kdf, account, options) {\n const privateKey = getBytes(account.privateKey, \"privateKey\");\n // Override initialization vector\n const iv = (options.iv != null) ? getBytes(options.iv, \"options.iv\") : randomBytes(16);\n assertArgument(iv.length === 16, \"invalid options.iv length\", \"options.iv\", options.iv);\n // Override the uuid\n const uuidRandom = (options.uuid != null) ? getBytes(options.uuid, \"options.uuid\") : randomBytes(16);\n assertArgument(uuidRandom.length === 16, \"invalid options.uuid length\", \"options.uuid\", options.iv);\n // This will be used to encrypt the wallet (as per Web3 secret storage)\n // - 32 bytes As normal for the Web3 secret storage (derivedKey, macPrefix)\n // - 32 bytes AES key to encrypt mnemonic with (required here to be Ethers Wallet)\n const derivedKey = key.slice(0, 16);\n const macPrefix = key.slice(16, 32);\n // Encrypt the private key\n const aesCtr = new CTR(derivedKey, iv);\n const ciphertext = getBytes(aesCtr.encrypt(privateKey));\n // Compute the message authentication code, used to check the password\n const mac = keccak256(concat([macPrefix, ciphertext]));\n // See: https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition\n const data = {\n address: account.address.substring(2).toLowerCase(),\n id: uuidV4(uuidRandom),\n version: 3,\n Crypto: {\n cipher: \"aes-128-ctr\",\n cipherparams: {\n iv: hexlify(iv).substring(2),\n },\n ciphertext: hexlify(ciphertext).substring(2),\n kdf: \"scrypt\",\n kdfparams: {\n salt: hexlify(kdf.salt).substring(2),\n n: kdf.N,\n dklen: 32,\n p: kdf.p,\n r: kdf.r\n },\n mac: mac.substring(2)\n }\n };\n // If we have a mnemonic, encrypt it into the JSON wallet\n if (account.mnemonic) {\n const client = (options.client != null) ? options.client : `ethers/${version}`;\n const path = account.mnemonic.path || defaultPath;\n const locale = account.mnemonic.locale || \"en\";\n const mnemonicKey = key.slice(32, 64);\n const entropy = getBytes(account.mnemonic.entropy, \"account.mnemonic.entropy\");\n const mnemonicIv = randomBytes(16);\n const mnemonicAesCtr = new CTR(mnemonicKey, mnemonicIv);\n const mnemonicCiphertext = getBytes(mnemonicAesCtr.encrypt(entropy));\n const now = new Date();\n const timestamp = (now.getUTCFullYear() + \"-\" +\n zpad(now.getUTCMonth() + 1, 2) + \"-\" +\n zpad(now.getUTCDate(), 2) + \"T\" +\n zpad(now.getUTCHours(), 2) + \"-\" +\n zpad(now.getUTCMinutes(), 2) + \"-\" +\n zpad(now.getUTCSeconds(), 2) + \".0Z\");\n const gethFilename = (\"UTC--\" + timestamp + \"--\" + data.address);\n data[\"x-ethers\"] = {\n client, gethFilename, path, locale,\n mnemonicCounter: hexlify(mnemonicIv).substring(2),\n mnemonicCiphertext: hexlify(mnemonicCiphertext).substring(2),\n version: \"0.1\"\n };\n }\n return JSON.stringify(data);\n}\n/**\n * Return the JSON Keystore Wallet for %%account%% encrypted with\n * %%password%%.\n *\n * The %%options%% can be used to tune the password-based key\n * derivation function parameters, explicitly set the random values\n * used. Any provided [[ProgressCallback]] is ignord.\n */\nexport function encryptKeystoreJsonSync(account, password, options) {\n if (options == null) {\n options = {};\n }\n const passwordBytes = getPassword(password);\n const kdf = getEncryptKdfParams(options);\n const key = scryptSync(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64);\n return _encryptKeystore(getBytes(key), kdf, account, options);\n}\n/**\n * Resolved to the JSON Keystore Wallet for %%account%% encrypted\n * with %%password%%.\n *\n * The %%options%% can be used to tune the password-based key\n * derivation function parameters, explicitly set the random values\n * used and provide a [[ProgressCallback]] to receive periodic updates\n * on the completion status..\n */\nexport async function encryptKeystoreJson(account, password, options) {\n if (options == null) {\n options = {};\n }\n const passwordBytes = getPassword(password);\n const kdf = getEncryptKdfParams(options);\n const key = await scrypt(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64, options.progressCallback);\n return _encryptKeystore(getBytes(key), kdf, account, options);\n}\n//# sourceMappingURL=json-keystore.js.map","/**\n * Explain HD Wallets..\n *\n * @_subsection: api/wallet:HD Wallets [hd-wallets]\n */\nimport { computeHmac, randomBytes, ripemd160, SigningKey, sha256 } from \"../crypto/index.js\";\nimport { VoidSigner } from \"../providers/index.js\";\nimport { computeAddress } from \"../transaction/index.js\";\nimport { concat, dataSlice, decodeBase58, defineProperties, encodeBase58, getBytes, hexlify, isBytesLike, getNumber, toBeArray, toBigInt, toBeHex, assertPrivate, assert, assertArgument } from \"../utils/index.js\";\nimport { LangEn } from \"../wordlists/lang-en.js\";\nimport { BaseWallet } from \"./base-wallet.js\";\nimport { Mnemonic } from \"./mnemonic.js\";\nimport { encryptKeystoreJson, encryptKeystoreJsonSync, } from \"./json-keystore.js\";\n/**\n * The default derivation path for Ethereum HD Nodes. (i.e. ``\"m/44'/60'/0'/0/0\"``)\n */\nexport const defaultPath = \"m/44'/60'/0'/0/0\";\n// \"Bitcoin seed\"\nconst MasterSecret = new Uint8Array([66, 105, 116, 99, 111, 105, 110, 32, 115, 101, 101, 100]);\nconst HardenedBit = 0x80000000;\nconst N = BigInt(\"0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141\");\nconst Nibbles = \"0123456789abcdef\";\nfunction zpad(value, length) {\n let result = \"\";\n while (value) {\n result = Nibbles[value % 16] + result;\n value = Math.trunc(value / 16);\n }\n while (result.length < length * 2) {\n result = \"0\" + result;\n }\n return \"0x\" + result;\n}\nfunction encodeBase58Check(_value) {\n const value = getBytes(_value);\n const check = dataSlice(sha256(sha256(value)), 0, 4);\n const bytes = concat([value, check]);\n return encodeBase58(bytes);\n}\nconst _guard = {};\nfunction ser_I(index, chainCode, publicKey, privateKey) {\n const data = new Uint8Array(37);\n if (index & HardenedBit) {\n assert(privateKey != null, \"cannot derive child of neutered node\", \"UNSUPPORTED_OPERATION\", {\n operation: \"deriveChild\"\n });\n // Data = 0x00 || ser_256(k_par)\n data.set(getBytes(privateKey), 1);\n }\n else {\n // Data = ser_p(point(k_par))\n data.set(getBytes(publicKey));\n }\n // Data += ser_32(i)\n for (let i = 24; i >= 0; i -= 8) {\n data[33 + (i >> 3)] = ((index >> (24 - i)) & 0xff);\n }\n const I = getBytes(computeHmac(\"sha512\", chainCode, data));\n return { IL: I.slice(0, 32), IR: I.slice(32) };\n}\nfunction derivePath(node, path) {\n const components = path.split(\"/\");\n assertArgument(components.length > 0, \"invalid path\", \"path\", path);\n if (components[0] === \"m\") {\n assertArgument(node.depth === 0, `cannot derive root path (i.e. path starting with \"m/\") for a node at non-zero depth ${node.depth}`, \"path\", path);\n components.shift();\n }\n let result = node;\n for (let i = 0; i < components.length; i++) {\n const component = components[i];\n if (component.match(/^[0-9]+'$/)) {\n const index = parseInt(component.substring(0, component.length - 1));\n assertArgument(index < HardenedBit, \"invalid path index\", `path[${i}]`, component);\n result = result.deriveChild(HardenedBit + index);\n }\n else if (component.match(/^[0-9]+$/)) {\n const index = parseInt(component);\n assertArgument(index < HardenedBit, \"invalid path index\", `path[${i}]`, component);\n result = result.deriveChild(index);\n }\n else {\n assertArgument(false, \"invalid path component\", `path[${i}]`, component);\n }\n }\n return result;\n}\n/**\n * An **HDNodeWallet** is a [[Signer]] backed by the private key derived\n * from an HD Node using the [[link-bip-32]] stantard.\n *\n * An HD Node forms a hierarchal structure with each HD Node having a\n * private key and the ability to derive child HD Nodes, defined by\n * a path indicating the index of each child.\n */\nexport class HDNodeWallet extends BaseWallet {\n /**\n * The compressed public key.\n */\n publicKey;\n /**\n * The fingerprint.\n *\n * A fingerprint allows quick qay to detect parent and child nodes,\n * but developers should be prepared to deal with collisions as it\n * is only 4 bytes.\n */\n fingerprint;\n /**\n * The parent fingerprint.\n */\n parentFingerprint;\n /**\n * The mnemonic used to create this HD Node, if available.\n *\n * Sources such as extended keys do not encode the mnemonic, in\n * which case this will be ``null``.\n */\n mnemonic;\n /**\n * The chaincode, which is effectively a public key used\n * to derive children.\n */\n chainCode;\n /**\n * The derivation path of this wallet.\n *\n * Since extended keys do not provide full path details, this\n * may be ``null``, if instantiated from a source that does not\n * encode it.\n */\n path;\n /**\n * The child index of this wallet. Values over ``2 *\\* 31`` indicate\n * the node is hardened.\n */\n index;\n /**\n * The depth of this wallet, which is the number of components\n * in its path.\n */\n depth;\n /**\n * @private\n */\n constructor(guard, signingKey, parentFingerprint, chainCode, path, index, depth, mnemonic, provider) {\n super(signingKey, provider);\n assertPrivate(guard, _guard, \"HDNodeWallet\");\n defineProperties(this, { publicKey: signingKey.compressedPublicKey });\n const fingerprint = dataSlice(ripemd160(sha256(this.publicKey)), 0, 4);\n defineProperties(this, {\n parentFingerprint, fingerprint,\n chainCode, path, index, depth\n });\n defineProperties(this, { mnemonic });\n }\n connect(provider) {\n return new HDNodeWallet(_guard, this.signingKey, this.parentFingerprint, this.chainCode, this.path, this.index, this.depth, this.mnemonic, provider);\n }\n #account() {\n const account = { address: this.address, privateKey: this.privateKey };\n const m = this.mnemonic;\n if (this.path && m && m.wordlist.locale === \"en\" && m.password === \"\") {\n account.mnemonic = {\n path: this.path,\n locale: \"en\",\n entropy: m.entropy\n };\n }\n return account;\n }\n /**\n * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with\n * %%password%%.\n *\n * If %%progressCallback%% is specified, it will receive periodic\n * updates as the encryption process progreses.\n */\n async encrypt(password, progressCallback) {\n return await encryptKeystoreJson(this.#account(), password, { progressCallback });\n }\n /**\n * Returns a [JSON Keystore Wallet](json-wallets) encryped with\n * %%password%%.\n *\n * It is preferred to use the [async version](encrypt) instead,\n * which allows a [[ProgressCallback]] to keep the user informed.\n *\n * This method will block the event loop (freezing all UI) until\n * it is complete, which may be a non-trivial duration.\n */\n encryptSync(password) {\n return encryptKeystoreJsonSync(this.#account(), password);\n }\n /**\n * The extended key.\n *\n * This key will begin with the prefix ``xpriv`` and can be used to\n * reconstruct this HD Node to derive its children.\n */\n get extendedKey() {\n // We only support the mainnet values for now, but if anyone needs\n // testnet values, let me know. I believe current sentiment is that\n // we should always use mainnet, and use BIP-44 to derive the network\n // - Mainnet: public=0x0488B21E, private=0x0488ADE4\n // - Testnet: public=0x043587CF, private=0x04358394\n assert(this.depth < 256, \"Depth too deep\", \"UNSUPPORTED_OPERATION\", { operation: \"extendedKey\" });\n return encodeBase58Check(concat([\n \"0x0488ADE4\", zpad(this.depth, 1), this.parentFingerprint,\n zpad(this.index, 4), this.chainCode,\n concat([\"0x00\", this.privateKey])\n ]));\n }\n /**\n * Returns true if this wallet has a path, providing a Type Guard\n * that the path is non-null.\n */\n hasPath() { return (this.path != null); }\n /**\n * Returns a neutered HD Node, which removes the private details\n * of an HD Node.\n *\n * A neutered node has no private key, but can be used to derive\n * child addresses and other public data about the HD Node.\n */\n neuter() {\n return new HDNodeVoidWallet(_guard, this.address, this.publicKey, this.parentFingerprint, this.chainCode, this.path, this.index, this.depth, this.provider);\n }\n /**\n * Return the child for %%index%%.\n */\n deriveChild(_index) {\n const index = getNumber(_index, \"index\");\n assertArgument(index <= 0xffffffff, \"invalid index\", \"index\", index);\n // Base path\n let path = this.path;\n if (path) {\n path += \"/\" + (index & ~HardenedBit);\n if (index & HardenedBit) {\n path += \"'\";\n }\n }\n const { IR, IL } = ser_I(index, this.chainCode, this.publicKey, this.privateKey);\n const ki = new SigningKey(toBeHex((toBigInt(IL) + BigInt(this.privateKey)) % N, 32));\n return new HDNodeWallet(_guard, ki, this.fingerprint, hexlify(IR), path, index, this.depth + 1, this.mnemonic, this.provider);\n }\n /**\n * Return the HDNode for %%path%% from this node.\n */\n derivePath(path) {\n return derivePath(this, path);\n }\n static #fromSeed(_seed, mnemonic) {\n assertArgument(isBytesLike(_seed), \"invalid seed\", \"seed\", \"[REDACTED]\");\n const seed = getBytes(_seed, \"seed\");\n assertArgument(seed.length >= 16 && seed.length <= 64, \"invalid seed\", \"seed\", \"[REDACTED]\");\n const I = getBytes(computeHmac(\"sha512\", MasterSecret, seed));\n const signingKey = new SigningKey(hexlify(I.slice(0, 32)));\n return new HDNodeWallet(_guard, signingKey, \"0x00000000\", hexlify(I.slice(32)), \"m\", 0, 0, mnemonic, null);\n }\n /**\n * Creates a new HD Node from %%extendedKey%%.\n *\n * If the %%extendedKey%% will either have a prefix or ``xpub`` or\n * ``xpriv``, returning a neutered HD Node ([[HDNodeVoidWallet]])\n * or full HD Node ([[HDNodeWallet) respectively.\n */\n static fromExtendedKey(extendedKey) {\n const bytes = toBeArray(decodeBase58(extendedKey)); // @TODO: redact\n assertArgument(bytes.length === 82 || encodeBase58Check(bytes.slice(0, 78)) === extendedKey, \"invalid extended key\", \"extendedKey\", \"[ REDACTED ]\");\n const depth = bytes[4];\n const parentFingerprint = hexlify(bytes.slice(5, 9));\n const index = parseInt(hexlify(bytes.slice(9, 13)).substring(2), 16);\n const chainCode = hexlify(bytes.slice(13, 45));\n const key = bytes.slice(45, 78);\n switch (hexlify(bytes.slice(0, 4))) {\n // Public Key\n case \"0x0488b21e\":\n case \"0x043587cf\": {\n const publicKey = hexlify(key);\n return new HDNodeVoidWallet(_guard, computeAddress(publicKey), publicKey, parentFingerprint, chainCode, null, index, depth, null);\n }\n // Private Key\n case \"0x0488ade4\":\n case \"0x04358394 \":\n if (key[0] !== 0) {\n break;\n }\n return new HDNodeWallet(_guard, new SigningKey(key.slice(1)), parentFingerprint, chainCode, null, index, depth, null, null);\n }\n assertArgument(false, \"invalid extended key prefix\", \"extendedKey\", \"[ REDACTED ]\");\n }\n /**\n * Creates a new random HDNode.\n */\n static createRandom(password, path, wordlist) {\n if (password == null) {\n password = \"\";\n }\n if (path == null) {\n path = defaultPath;\n }\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n const mnemonic = Mnemonic.fromEntropy(randomBytes(16), password, wordlist);\n return HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path);\n }\n /**\n * Create an HD Node from %%mnemonic%%.\n */\n static fromMnemonic(mnemonic, path) {\n if (!path) {\n path = defaultPath;\n }\n return HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path);\n }\n /**\n * Creates an HD Node from a mnemonic %%phrase%%.\n */\n static fromPhrase(phrase, password, path, wordlist) {\n if (password == null) {\n password = \"\";\n }\n if (path == null) {\n path = defaultPath;\n }\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n const mnemonic = Mnemonic.fromPhrase(phrase, password, wordlist);\n return HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path);\n }\n /**\n * Creates an HD Node from a %%seed%%.\n */\n static fromSeed(seed) {\n return HDNodeWallet.#fromSeed(seed, null);\n }\n}\n/**\n * A **HDNodeVoidWallet** cannot sign, but provides access to\n * the children nodes of a [[link-bip-32]] HD wallet addresses.\n *\n * The can be created by using an extended ``xpub`` key to\n * [[HDNodeWallet_fromExtendedKey]] or by\n * [nuetering](HDNodeWallet-neuter) a [[HDNodeWallet]].\n */\nexport class HDNodeVoidWallet extends VoidSigner {\n /**\n * The compressed public key.\n */\n publicKey;\n /**\n * The fingerprint.\n *\n * A fingerprint allows quick qay to detect parent and child nodes,\n * but developers should be prepared to deal with collisions as it\n * is only 4 bytes.\n */\n fingerprint;\n /**\n * The parent node fingerprint.\n */\n parentFingerprint;\n /**\n * The chaincode, which is effectively a public key used\n * to derive children.\n */\n chainCode;\n /**\n * The derivation path of this wallet.\n *\n * Since extended keys do not provider full path details, this\n * may be ``null``, if instantiated from a source that does not\n * enocde it.\n */\n path;\n /**\n * The child index of this wallet. Values over ``2 *\\* 31`` indicate\n * the node is hardened.\n */\n index;\n /**\n * The depth of this wallet, which is the number of components\n * in its path.\n */\n depth;\n /**\n * @private\n */\n constructor(guard, address, publicKey, parentFingerprint, chainCode, path, index, depth, provider) {\n super(address, provider);\n assertPrivate(guard, _guard, \"HDNodeVoidWallet\");\n defineProperties(this, { publicKey });\n const fingerprint = dataSlice(ripemd160(sha256(publicKey)), 0, 4);\n defineProperties(this, {\n publicKey, fingerprint, parentFingerprint, chainCode, path, index, depth\n });\n }\n connect(provider) {\n return new HDNodeVoidWallet(_guard, this.address, this.publicKey, this.parentFingerprint, this.chainCode, this.path, this.index, this.depth, provider);\n }\n /**\n * The extended key.\n *\n * This key will begin with the prefix ``xpub`` and can be used to\n * reconstruct this neutered key to derive its children addresses.\n */\n get extendedKey() {\n // We only support the mainnet values for now, but if anyone needs\n // testnet values, let me know. I believe current sentiment is that\n // we should always use mainnet, and use BIP-44 to derive the network\n // - Mainnet: public=0x0488B21E, private=0x0488ADE4\n // - Testnet: public=0x043587CF, private=0x04358394\n assert(this.depth < 256, \"Depth too deep\", \"UNSUPPORTED_OPERATION\", { operation: \"extendedKey\" });\n return encodeBase58Check(concat([\n \"0x0488B21E\",\n zpad(this.depth, 1),\n this.parentFingerprint,\n zpad(this.index, 4),\n this.chainCode,\n this.publicKey,\n ]));\n }\n /**\n * Returns true if this wallet has a path, providing a Type Guard\n * that the path is non-null.\n */\n hasPath() { return (this.path != null); }\n /**\n * Return the child for %%index%%.\n */\n deriveChild(_index) {\n const index = getNumber(_index, \"index\");\n assertArgument(index <= 0xffffffff, \"invalid index\", \"index\", index);\n // Base path\n let path = this.path;\n if (path) {\n path += \"/\" + (index & ~HardenedBit);\n if (index & HardenedBit) {\n path += \"'\";\n }\n }\n const { IR, IL } = ser_I(index, this.chainCode, this.publicKey, null);\n const Ki = SigningKey.addPoints(IL, this.publicKey, true);\n const address = computeAddress(Ki);\n return new HDNodeVoidWallet(_guard, address, Ki, this.fingerprint, hexlify(IR), path, index, this.depth + 1, this.provider);\n }\n /**\n * Return the signer for %%path%% from this node.\n */\n derivePath(path) {\n return derivePath(this, path);\n }\n}\n/*\nexport class HDNodeWalletManager {\n #root: HDNodeWallet;\n\n constructor(phrase: string, password?: null | string, path?: null | string, locale?: null | Wordlist) {\n if (password == null) { password = \"\"; }\n if (path == null) { path = \"m/44'/60'/0'/0\"; }\n if (locale == null) { locale = LangEn.wordlist(); }\n this.#root = HDNodeWallet.fromPhrase(phrase, password, path, locale);\n }\n\n getSigner(index?: number): HDNodeWallet {\n return this.#root.deriveChild((index == null) ? 0: index);\n }\n}\n*/\n/**\n * Returns the [[link-bip-32]] path for the account at %%index%%.\n *\n * This is the pattern used by wallets like Ledger.\n *\n * There is also an [alternate pattern](getIndexedAccountPath) used by\n * some software.\n */\nexport function getAccountPath(_index) {\n const index = getNumber(_index, \"index\");\n assertArgument(index >= 0 && index < HardenedBit, \"invalid account index\", \"index\", index);\n return `m/44'/60'/${index}'/0/0`;\n}\n/**\n * Returns the path using an alternative pattern for deriving accounts,\n * at %%index%%.\n *\n * This derivation path uses the //index// component rather than the\n * //account// component to derive sequential accounts.\n *\n * This is the pattern used by wallets like MetaMask.\n */\nexport function getIndexedAccountPath(_index) {\n const index = getNumber(_index, \"index\");\n assertArgument(index >= 0 && index < HardenedBit, \"invalid account index\", \"index\", index);\n return `m/44'/60'/0'/0/${index}`;\n}\n//# sourceMappingURL=hdwallet.js.map","/**\n * @_subsection: api/wallet:JSON Wallets [json-wallets]\n */\nimport { CBC, pkcs7Strip } from \"aes-js\";\nimport { getAddress } from \"../address/index.js\";\nimport { pbkdf2 } from \"../crypto/index.js\";\nimport { id } from \"../hash/index.js\";\nimport { getBytes, assertArgument } from \"../utils/index.js\";\nimport { getPassword, looseArrayify, spelunk } from \"./utils.js\";\n/**\n * Returns true if %%json%% is a valid JSON Crowdsale wallet.\n */\nexport function isCrowdsaleJson(json) {\n try {\n const data = JSON.parse(json);\n if (data.encseed) {\n return true;\n }\n }\n catch (error) { }\n return false;\n}\n// See: https://github.com/ethereum/pyethsaletool\n/**\n * Before Ethereum launched, it was necessary to create a wallet\n * format for backers to use, which would be used to receive ether\n * as a reward for contributing to the project.\n *\n * The [[link-crowdsale]] format is now obsolete, but it is still\n * useful to support and the additional code is fairly trivial as\n * all the primitives required are used through core portions of\n * the library.\n */\nexport function decryptCrowdsaleJson(json, _password) {\n const data = JSON.parse(json);\n const password = getPassword(_password);\n // Ethereum Address\n const address = getAddress(spelunk(data, \"ethaddr:string!\"));\n // Encrypted Seed\n const encseed = looseArrayify(spelunk(data, \"encseed:string!\"));\n assertArgument(encseed && (encseed.length % 16) === 0, \"invalid encseed\", \"json\", json);\n const key = getBytes(pbkdf2(password, password, 2000, 32, \"sha256\")).slice(0, 16);\n const iv = encseed.slice(0, 16);\n const encryptedSeed = encseed.slice(16);\n // Decrypt the seed\n const aesCbc = new CBC(key, iv);\n const seed = pkcs7Strip(getBytes(aesCbc.decrypt(encryptedSeed)));\n // This wallet format is weird... Convert the binary encoded hex to a string.\n let seedHex = \"\";\n for (let i = 0; i < seed.length; i++) {\n seedHex += String.fromCharCode(seed[i]);\n }\n return { address, privateKey: id(seedHex) };\n}\n//# sourceMappingURL=json-crowdsale.js.map","import { SigningKey } from \"../crypto/index.js\";\nimport { assertArgument } from \"../utils/index.js\";\nimport { BaseWallet } from \"./base-wallet.js\";\nimport { HDNodeWallet } from \"./hdwallet.js\";\nimport { decryptCrowdsaleJson, isCrowdsaleJson } from \"./json-crowdsale.js\";\nimport { decryptKeystoreJson, decryptKeystoreJsonSync, encryptKeystoreJson, encryptKeystoreJsonSync, isKeystoreJson } from \"./json-keystore.js\";\nimport { Mnemonic } from \"./mnemonic.js\";\nfunction stall(duration) {\n return new Promise((resolve) => { setTimeout(() => { resolve(); }, duration); });\n}\n/**\n * A **Wallet** manages a single private key which is used to sign\n * transactions, messages and other common payloads.\n *\n * This class is generally the main entry point for developers\n * that wish to use a private key directly, as it can create\n * instances from a large variety of common sources, including\n * raw private key, [[link-bip-39]] mnemonics and encrypte JSON\n * wallets.\n */\nexport class Wallet extends BaseWallet {\n /**\n * Create a new wallet for the private %%key%%, optionally connected\n * to %%provider%%.\n */\n constructor(key, provider) {\n if (typeof (key) === \"string\" && !key.startsWith(\"0x\")) {\n key = \"0x\" + key;\n }\n let signingKey = (typeof (key) === \"string\") ? new SigningKey(key) : key;\n super(signingKey, provider);\n }\n connect(provider) {\n return new Wallet(this.signingKey, provider);\n }\n /**\n * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with\n * %%password%%.\n *\n * If %%progressCallback%% is specified, it will receive periodic\n * updates as the encryption process progreses.\n */\n async encrypt(password, progressCallback) {\n const account = { address: this.address, privateKey: this.privateKey };\n return await encryptKeystoreJson(account, password, { progressCallback });\n }\n /**\n * Returns a [JSON Keystore Wallet](json-wallets) encryped with\n * %%password%%.\n *\n * It is preferred to use the [async version](encrypt) instead,\n * which allows a [[ProgressCallback]] to keep the user informed.\n *\n * This method will block the event loop (freezing all UI) until\n * it is complete, which may be a non-trivial duration.\n */\n encryptSync(password) {\n const account = { address: this.address, privateKey: this.privateKey };\n return encryptKeystoreJsonSync(account, password);\n }\n static #fromAccount(account) {\n assertArgument(account, \"invalid JSON wallet\", \"json\", \"[ REDACTED ]\");\n if (\"mnemonic\" in account && account.mnemonic && account.mnemonic.locale === \"en\") {\n const mnemonic = Mnemonic.fromEntropy(account.mnemonic.entropy);\n const wallet = HDNodeWallet.fromMnemonic(mnemonic, account.mnemonic.path);\n if (wallet.address === account.address && wallet.privateKey === account.privateKey) {\n return wallet;\n }\n console.log(\"WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key\");\n }\n const wallet = new Wallet(account.privateKey);\n assertArgument(wallet.address === account.address, \"address/privateKey mismatch\", \"json\", \"[ REDACTED ]\");\n return wallet;\n }\n /**\n * Creates (asynchronously) a **Wallet** by decrypting the %%json%%\n * with %%password%%.\n *\n * If %%progress%% is provided, it is called periodically during\n * decryption so that any UI can be updated.\n */\n static async fromEncryptedJson(json, password, progress) {\n let account = null;\n if (isKeystoreJson(json)) {\n account = await decryptKeystoreJson(json, password, progress);\n }\n else if (isCrowdsaleJson(json)) {\n if (progress) {\n progress(0);\n await stall(0);\n }\n account = decryptCrowdsaleJson(json, password);\n if (progress) {\n progress(1);\n await stall(0);\n }\n }\n return Wallet.#fromAccount(account);\n }\n /**\n * Creates a **Wallet** by decrypting the %%json%% with %%password%%.\n *\n * The [[fromEncryptedJson]] method is preferred, as this method\n * will lock up and freeze the UI during decryption, which may take\n * some time.\n */\n static fromEncryptedJsonSync(json, password) {\n let account = null;\n if (isKeystoreJson(json)) {\n account = decryptKeystoreJsonSync(json, password);\n }\n else if (isCrowdsaleJson(json)) {\n account = decryptCrowdsaleJson(json, password);\n }\n else {\n assertArgument(false, \"invalid JSON wallet\", \"json\", \"[ REDACTED ]\");\n }\n return Wallet.#fromAccount(account);\n }\n /**\n * Creates a new random [[HDNodeWallet]] using the available\n * [cryptographic random source](randomBytes).\n *\n * If there is no crytographic random source, this will throw.\n */\n static createRandom(provider) {\n const wallet = HDNodeWallet.createRandom();\n if (provider) {\n return wallet.connect(provider);\n }\n return wallet;\n }\n /**\n * Creates a [[HDNodeWallet]] for %%phrase%%.\n */\n static fromPhrase(phrase, provider) {\n const wallet = HDNodeWallet.fromPhrase(phrase);\n if (provider) {\n return wallet.connect(provider);\n }\n return wallet;\n }\n}\n//# sourceMappingURL=wallet.js.map","const Base64 = \")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_\";\n/**\n * @_ignore\n */\nexport function decodeBits(width, data) {\n const maxValue = (1 << width) - 1;\n const result = [];\n let accum = 0, bits = 0, flood = 0;\n for (let i = 0; i < data.length; i++) {\n // Accumulate 6 bits of data\n accum = ((accum << 6) | Base64.indexOf(data[i]));\n bits += 6;\n // While we have enough for a word...\n while (bits >= width) {\n // ...read the word\n const value = (accum >> (bits - width));\n accum &= (1 << (bits - width)) - 1;\n bits -= width;\n // A value of 0 indicates we exceeded maxValue, it\n // floods over into the next value\n if (value === 0) {\n flood += maxValue;\n }\n else {\n result.push(value + flood);\n flood = 0;\n }\n }\n }\n return result;\n}\n//# sourceMappingURL=bit-reader.js.map","import { assertArgument } from \"../utils/index.js\";\nimport { decodeBits } from \"./bit-reader.js\";\nimport { decodeOwl } from \"./decode-owl.js\";\n/**\n * @_ignore\n */\nexport function decodeOwlA(data, accents) {\n let words = decodeOwl(data).join(\",\");\n // Inject the accents\n accents.split(/,/g).forEach((accent) => {\n const match = accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);\n assertArgument(match !== null, \"internal error parsing accents\", \"accents\", accents);\n let posOffset = 0;\n const positions = decodeBits(parseInt(match[3]), match[4]);\n const charCode = parseInt(match[2]);\n const regex = new RegExp(`([${match[1]}])`, \"g\");\n words = words.replace(regex, (all, letter) => {\n const rem = --positions[posOffset];\n if (rem === 0) {\n letter = String.fromCharCode(letter.charCodeAt(0), charCode);\n posOffset++;\n }\n return letter;\n });\n });\n return words.split(\",\");\n}\n//# sourceMappingURL=decode-owla.js.map","import { WordlistOwl } from \"./wordlist-owl.js\";\nimport { decodeOwlA } from \"./decode-owla.js\";\n/**\n * An OWL-A format Wordlist extends the OWL format to add an\n * overlay onto an OWL format Wordlist to support diacritic\n * marks.\n *\n * This class is generally not useful to most developers as\n * it is used mainly internally to keep Wordlists for languages\n * based on latin-1 small.\n *\n * If necessary, there are tools within the ``generation/`` folder\n * to create the necessary data.\n */\nexport class WordlistOwlA extends WordlistOwl {\n #accent;\n /**\n * Creates a new Wordlist for %%locale%% using the OWLA %%data%%\n * and %%accent%% data and validated against the %%checksum%%.\n */\n constructor(locale, data, accent, checksum) {\n super(locale, data, checksum);\n this.#accent = accent;\n }\n /**\n * The OWLA-encoded accent data.\n */\n get _accent() { return this.#accent; }\n /**\n * Decode all the words for the wordlist.\n */\n _decodeWords() {\n return decodeOwlA(this._data, this._accent);\n }\n}\n//# sourceMappingURL=wordlist-owla.js.map","import { LangEn } from \"./lang-en.js\";\nexport const wordlists = {\n en: LangEn.wordlist(),\n};\n//# sourceMappingURL=wordlists-browser.js.map","/////////////////////////////\n//\nexport { version } from \"./_version.js\";\nexport { decodeBytes32String, encodeBytes32String, AbiCoder, ConstructorFragment, ErrorFragment, EventFragment, Fragment, FallbackFragment, FunctionFragment, NamedFragment, ParamType, StructFragment, checkResultErrors, ErrorDescription, Indexed, Interface, LogDescription, Result, TransactionDescription, Typed, } from \"./abi/index.js\";\nexport { getAddress, getIcapAddress, getCreateAddress, getCreate2Address, isAddressable, isAddress, resolveAddress } from \"./address/index.js\";\nexport { ZeroAddress, WeiPerEther, MaxUint256, MinInt256, MaxInt256, N, ZeroHash, EtherSymbol, MessagePrefix } from \"./constants/index.js\";\nexport { BaseContract, Contract, ContractFactory, ContractEventPayload, ContractTransactionReceipt, ContractTransactionResponse, ContractUnknownEventPayload, EventLog, UndecodedEventLog } from \"./contract/index.js\";\nexport { computeHmac, randomBytes, keccak256, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync, lock, Signature, SigningKey } from \"./crypto/index.js\";\nexport { id, ensNormalize, isValidName, namehash, dnsEncode, hashAuthorization, verifyAuthorization, hashMessage, verifyMessage, solidityPacked, solidityPackedKeccak256, solidityPackedSha256, TypedDataEncoder, verifyTypedData } from \"./hash/index.js\";\nexport { getDefaultProvider, Block, FeeData, Log, TransactionReceipt, TransactionResponse, AbstractSigner, NonceManager, VoidSigner, AbstractProvider, FallbackProvider, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, BrowserProvider, AlchemyProvider, AnkrProvider, BlockscoutProvider, ChainstackProvider, CloudflareProvider, EtherscanProvider, InfuraProvider, InfuraWebSocketProvider, PocketProvider, QuickNodeProvider, IpcSocketProvider, SocketProvider, WebSocketProvider, EnsResolver, Network, EnsPlugin, EtherscanPlugin, FeeDataNetworkPlugin, FetchUrlFeeDataNetworkPlugin, GasCostPlugin, NetworkPlugin, MulticoinProviderPlugin, SocketBlockSubscriber, SocketEventSubscriber, SocketPendingSubscriber, SocketSubscriber, UnmanagedSubscriber, copyRequest, showThrottleMessage } from \"./providers/index.js\";\nexport { accessListify, authorizationify, computeAddress, recoverAddress, Transaction } from \"./transaction/index.js\";\nexport { decodeBase58, encodeBase58, decodeBase64, encodeBase64, concat, dataLength, dataSlice, getBytes, getBytesCopy, hexlify, isHexString, isBytesLike, stripZerosLeft, zeroPadBytes, zeroPadValue, defineProperties, resolveProperties, assert, assertArgument, assertArgumentCount, assertNormalize, assertPrivate, makeError, isCallException, isError, EventPayload, FetchRequest, FetchResponse, FetchCancelSignal, FixedNumber, getBigInt, getNumber, getUint, toBeArray, toBigInt, toBeHex, toNumber, toQuantity, fromTwos, toTwos, mask, formatEther, parseEther, formatUnits, parseUnits, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, decodeRlp, encodeRlp, uuidV4, } from \"./utils/index.js\";\nexport { Mnemonic, BaseWallet, HDNodeWallet, HDNodeVoidWallet, Wallet, defaultPath, getAccountPath, getIndexedAccountPath, isCrowdsaleJson, isKeystoreJson, decryptCrowdsaleJson, decryptKeystoreJsonSync, decryptKeystoreJson, encryptKeystoreJson, encryptKeystoreJsonSync, } from \"./wallet/index.js\";\nexport { Wordlist, LangEn, WordlistOwl, WordlistOwlA, wordlists } from \"./wordlists/index.js\";\n// dummy change; to pick-up ws security issue changes\n//# sourceMappingURL=ethers.js.map"],"names":["stringify","BN_0","BN_1","Nibbles","locked","getTime","_guard","Zeros","parseUnits","passProperties","getValue","crypto","u8a","utf8ToBytes","concatBytes","randomBytes","hash","assertHash","assertExists","assertBytes","assertNumber","pbkdf2","sha256","split","sha512","getGlobal","_0n","_1n","_2n","rotl","ripemd160","noble_ripemd160","crypto_random","scrypt","_nobleAsync","_nobleSync","H","_3n","ut.validateObject","ut.concatBytes","ut.bytesToHex","ut.bytesToNumberBE","mod.mod","mod.invert","ut.numberToBytesBE","ut.hexToBytes","mod.getMinHashLength","mod.mapHashToField","ut.bitMask","ut.createHmacDrbg","N","BN_2","BN_27","BN_28","BN_35","inspect","BN_MAX_UINT256","T1","_keccak256","_sha256","internal","PanicReasons","copy","isPromise","defaultOptions","stall","defaultApiKey","getHost","__classPrivateFieldGet","this","__classPrivateFieldSet","zpad","defaultPath"],"mappings":";;;;;;;IAAA;IACA;IACA;IACA;AACY,UAAC,OAAO,GAAG;;ICJvB;IACA;IACA;IACA;IACA;IACA,SAAS,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE;IACtC,IAAI,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IACrD,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;IAC3C,QAAQ,QAAQ,IAAI;IACpB,YAA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aAAa;IACb,YAAY,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IACxC,SAAS,CAAC,CAAC;IACX,KAAK;IACL,IAAI,OAAO,MAAM,CAAC;IAClB,CAAC;IACD;IACA;IACA;IACA;IACO,MAAM,KAAK,CAAC;IACnB;IACA;IACA;IACA;IACA,IAAI,QAAQ,CAAC;IACb;IACA;IACA;IACA;IACA,IAAI,MAAM,CAAC;IACX;IACA;IACA;IACA;IACA;IACA;IACA,IAAI,IAAI,CAAC;IACT;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC;IACd;IACA;IACA;IACA,IAAI,UAAU,CAAC;IACf;IACA;IACA;IACA;IACA,IAAI,qBAAqB,CAAC;IAC1B;IACA;IACA;IACA;IACA;IACA;IACA,IAAI,KAAK,CAAC;IACV;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,IAAI,UAAU,CAAC;IACf;IACA;IACA;IACA,IAAI,QAAQ,CAAC;IACb;IACA;IACA;IACA,IAAI,OAAO,CAAC;IACZ;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC;IACd;IACA;IACA;IACA,IAAI,YAAY,CAAC;IACjB;IACA;IACA;IACA;IACA,IAAI,WAAW,CAAC;IAChB;IACA;IACA;IACA;IACA,IAAI,aAAa,CAAC;IAClB;IACA;IACA;IACA;IACA,IAAI,KAAK,CAAC;IACV;IACA;IACA;IACA;IACA,IAAI,UAAU,CAAC;IACf;IACA;IACA;IACA,IAAI,SAAS,CAAC;IACd;IACA;IACA;IACA;IACA;IACA;IACA;IACA,IAAI,aAAa,CAAC;IAClB,IAAI,aAAa,CAAC;IAClB;IACA;IACA;IACA;IACA;IACA;IACA,IAAI,WAAW,CAAC,KAAK,EAAE,QAAQ,EAAE;IACjC,QAAQ,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK;IAC5D,YAAY,IAAI,QAAQ,EAAE,CAAC,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node_modules/ethers/dist/ethers.umd.min.js b/tools/mnemonic-test/node_modules/ethers/dist/ethers.umd.min.js deleted file mode 100644 index ed0d3fd0..00000000 --- a/tools/mnemonic-test/node_modules/ethers/dist/ethers.umd.min.js +++ /dev/null @@ -1 +0,0 @@ -const __$G=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?factory(exports):typeof define==="function"&&define.amd?define(["exports"],factory):(global=typeof globalThis!=="undefined"?globalThis:global||self,factory(global.ethers={}))})(this,function(exports){"use strict";const version="6.16.0";function checkType(value,type,name){const types=type.split("|").map(t=>t.trim());for(let i=0;iPromise.resolve(value[k])));return results.reduce((accum,v,index)=>{accum[keys[index]]=v;return accum},{})}function defineProperties(target,values,types){for(let key in values){let value=values[key];const type=types?types[key]:null;if(type){checkType(value,type,key)}Object.defineProperty(target,key,{enumerable:true,value:value,writable:false})}}function stringify$1(value,seen){if(value==null){return"null"}if(seen==null){seen=new Set}if(typeof value==="object"){if(seen.has(value)){return"[Circular]"}seen.add(value)}if(Array.isArray(value)){return"[ "+value.map(v=>stringify$1(v,seen)).join(", ")+" ]"}if(value instanceof Uint8Array){const HEX="0123456789abcdef";let result="0x";for(let i=0;i>4];result+=HEX[value[i]&15]}return result}if(typeof value==="object"&&typeof value.toJSON==="function"){return stringify$1(value.toJSON(),seen)}switch(typeof value){case"boolean":case"number":case"symbol":return value.toString();case"bigint":return BigInt(value).toString();case"string":return JSON.stringify(value);case"object":{const keys=Object.keys(value);keys.sort();return"{ "+keys.map(k=>`${stringify$1(k,seen)}: ${stringify$1(value[k],seen)}`).join(", ")+" }"}}return`[ COULD NOT SERIALIZE ]`}function isError(error,code){return error&&error.code===code}function isCallException(error){return isError(error,"CALL_EXCEPTION")}function makeError(message,code,info){let shortMessage=message;{const details=[];if(info){if("message"in info||"code"in info||"name"in info){throw new Error(`value will overwrite populated values: ${stringify$1(info)}`)}for(const key in info){if(key==="shortMessage"){continue}const value=info[key];details.push(key+"="+stringify$1(value))}}details.push(`code=${code}`);details.push(`version=${version}`);if(details.length){message+=" ("+details.join(", ")+")"}}let error;switch(code){case"INVALID_ARGUMENT":error=new TypeError(message);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":error=new RangeError(message);break;default:error=new Error(message)}defineProperties(error,{code:code});if(info){Object.assign(error,info)}if(error.shortMessage==null){defineProperties(error,{shortMessage:shortMessage})}return error}function assert(check,message,code,info){if(!check){throw makeError(message,code,info)}}function assertArgument(check,message,name,value){assert(check,message,"INVALID_ARGUMENT",{argument:name,value:value})}function assertArgumentCount(count,expectedCount,message){if(message==null){message=""}if(message){message=": "+message}assert(count>=expectedCount,"missing argument"+message,"MISSING_ARGUMENT",{count:count,expectedCount:expectedCount});assert(count<=expectedCount,"too many arguments"+message,"UNEXPECTED_ARGUMENT",{count:count,expectedCount:expectedCount})}const _normalizeForms=["NFD","NFC","NFKD","NFKC"].reduce((accum,form)=>{try{if("test".normalize(form)!=="test"){throw new Error("bad")}if(form==="NFD"){const check=String.fromCharCode(233).normalize("NFD");const expected=String.fromCharCode(101,769);if(check!==expected){throw new Error("broken")}}accum.push(form)}catch(error){}return accum},[]);function assertNormalize(form){assert(_normalizeForms.indexOf(form)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:form}})}function assertPrivate(givenGuard,guard,className){if(className==null){className=""}if(givenGuard!==guard){let method=className,operation="new";if(className){method+=".";operation+=" "+className}assert(false,`private constructor; use ${method}from* methods`,"UNSUPPORTED_OPERATION",{operation:operation})}}function _getBytes(value,name,copy){if(value instanceof Uint8Array){if(copy){return new Uint8Array(value)}return value}if(typeof value==="string"&&value.length%2===0&&value.match(/^0x[0-9a-f]*$/i)){const result=new Uint8Array((value.length-2)/2);let offset=2;for(let i=0;i>4]+HexCharacters[v&15]}return result}function concat(datas){return"0x"+datas.map(d=>hexlify(d).substring(2)).join("")}function dataLength(data){if(isHexString(data,true)){return(data.length-2)/2}return getBytes(data).length}function dataSlice(data,start,end){const bytes=getBytes(data);if(end!=null&&end>bytes.length){assert(false,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:bytes,length:bytes.length,offset:end})}return hexlify(bytes.slice(start==null?0:start,end==null?bytes.length:end))}function stripZerosLeft(data){let bytes=hexlify(data).substring(2);while(bytes.startsWith("00")){bytes=bytes.substring(2)}return"0x"+bytes}function zeroPad(data,length,left){const bytes=getBytes(data);assert(length>=bytes.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(bytes),length:length,offset:length+1});const result=new Uint8Array(length);result.fill(0);if(left){result.set(bytes,length-bytes.length)}else{result.set(bytes,0)}return hexlify(result)}function zeroPadValue(data,length){return zeroPad(data,length,true)}function zeroPadBytes(data,length){return zeroPad(data,length,false)}const BN_0$a=BigInt(0);const BN_1$5=BigInt(1);const maxValue=9007199254740991;function fromTwos(_value,_width){const value=getUint(_value,"value");const width=BigInt(getNumber(_width,"width"));assert(value>>width===BN_0$a,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:_value});if(value>>width-BN_1$5){const mask=(BN_1$5<=-maxValue&&value<=maxValue,"overflow",name||"value",value);return BigInt(value);case"string":try{if(value===""){throw new Error("empty string")}if(value[0]==="-"&&value[1]!=="-"){return-BigInt(value.substring(1))}return BigInt(value)}catch(e){assertArgument(false,`invalid BigNumberish string: ${e.message}`,name||"value",value)}}assertArgument(false,"invalid BigNumberish value",name||"value",value)}function getUint(value,name){const result=getBigInt(value,name);assert(result>=BN_0$a,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:value});return result}const Nibbles$1="0123456789abcdef";function toBigInt(value){if(value instanceof Uint8Array){let result="0x0";for(const v of value){result+=Nibbles$1[v>>4];result+=Nibbles$1[v&15]}return BigInt(result)}return getBigInt(value)}function getNumber(value,name){switch(typeof value){case"bigint":assertArgument(value>=-maxValue&&value<=maxValue,"overflow",name||"value",value);return Number(value);case"number":assertArgument(Number.isInteger(value),"underflow",name||"value",value);assertArgument(value>=-maxValue&&value<=maxValue,"overflow",name||"value",value);return value;case"string":try{if(value===""){throw new Error("empty string")}return getNumber(BigInt(value),name)}catch(e){assertArgument(false,`invalid numeric string: ${e.message}`,name||"value",value)}}assertArgument(false,"invalid numeric value",name||"value",value)}function toNumber(value){return getNumber(toBigInt(value))}function toBeHex(_value,_width){const value=getUint(_value,"value");let result=value.toString(16);if(_width==null){if(result.length%2){result="0"+result}}else{const width=getNumber(_width,"width");if(width===0&&value===BN_0$a){return"0x"}assert(width*2>=result.length,`value exceeds width (${width} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:_value});while(result.length>6!==2){break}i++}return i}if(reason==="OVERRUN"){return bytes.length-offset-1}return 0}function replaceFunc(reason,offset,bytes,output,badCodepoint){if(reason==="OVERLONG"){assertArgument(typeof badCodepoint==="number","invalid bad code point for replacement","badCodepoint",badCodepoint);output.push(badCodepoint);return 0}output.push(65533);return ignoreFunc(reason,offset,bytes)}const Utf8ErrorFuncs=Object.freeze({error:errorFunc,ignore:ignoreFunc,replace:replaceFunc});function getUtf8CodePoints(_bytes,onError){if(onError==null){onError=Utf8ErrorFuncs.error}const bytes=getBytes(_bytes,"bytes");const result=[];let i=0;while(i>7===0){result.push(c);continue}let extraLength=null;let overlongMask=null;if((c&224)===192){extraLength=1;overlongMask=127}else if((c&240)===224){extraLength=2;overlongMask=2047}else if((c&248)===240){extraLength=3;overlongMask=65535}else{if((c&192)===128){i+=onError("UNEXPECTED_CONTINUE",i-1,bytes,result)}else{i+=onError("BAD_PREFIX",i-1,bytes,result)}continue}if(i-1+extraLength>=bytes.length){i+=onError("OVERRUN",i-1,bytes,result);continue}let res=c&(1<<8-extraLength-1)-1;for(let j=0;j1114111){i+=onError("OUT_OF_RANGE",i-1-extraLength,bytes,result,res);continue}if(res>=55296&&res<=57343){i+=onError("UTF16_SURROGATE",i-1-extraLength,bytes,result,res);continue}if(res<=overlongMask){i+=onError("OVERLONG",i-1-extraLength,bytes,result,res);continue}result.push(res)}return result}function toUtf8Bytes(str,form){assertArgument(typeof str==="string","invalid string value","str",str);if(form!=null){assertNormalize(form);str=str.normalize(form)}let result=[];for(let i=0;i>6|192);result.push(c&63|128)}else if((c&64512)==55296){i++;const c2=str.charCodeAt(i);assertArgument(i>18|240);result.push(pair>>12&63|128);result.push(pair>>6&63|128);result.push(pair&63|128)}else{result.push(c>>12|224);result.push(c>>6&63|128);result.push(c&63|128)}}return new Uint8Array(result)}function _toUtf8String(codePoints){return codePoints.map(codePoint=>{if(codePoint<=65535){return String.fromCharCode(codePoint)}codePoint-=65536;return String.fromCharCode((codePoint>>10&1023)+55296,(codePoint&1023)+56320)}).join("")}function toUtf8String(bytes,onError){return _toUtf8String(getUtf8CodePoints(bytes,onError))}function toUtf8CodePoints(str,form){return getUtf8CodePoints(toUtf8Bytes(str,form))}function createGetUrl(options){async function getUrl(req,_signal){assert(_signal==null||!_signal.cancelled,"request cancelled before sending","CANCELLED");const protocol=req.url.split(":")[0].toLowerCase();assert(protocol==="http"||protocol==="https",`unsupported protocol ${protocol}`,"UNSUPPORTED_OPERATION",{info:{protocol:protocol},operation:"request"});assert(protocol==="https"||!req.credentials||req.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let error=null;const controller=new AbortController;const timer=setTimeout(()=>{error=makeError("request timeout","TIMEOUT");controller.abort()},req.timeout);if(_signal){_signal.addListener(()=>{error=makeError("request cancelled","CANCELLED");controller.abort()})}const init=Object.assign({},options,{method:req.method,headers:new Headers(Array.from(req)),body:req.body||undefined,signal:controller.signal});let resp;try{resp=await fetch(req.url,init)}catch(_error){clearTimeout(timer);if(error){throw error}throw _error}clearTimeout(timer);const headers={};resp.headers.forEach((value,key)=>{headers[key.toLowerCase()]=value});const respBody=await resp.arrayBuffer();const body=respBody==null?null:new Uint8Array(respBody);return{statusCode:resp.status,statusMessage:resp.statusText,headers:headers,body:body}}return getUrl}const MAX_ATTEMPTS=12;const SLOT_INTERVAL=250;let defaultGetUrlFunc=createGetUrl();const reData=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i");const reIpfs=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let locked$5=false;async function dataGatewayFunc(url,signal){try{const match=url.match(reData);if(!match){throw new Error("invalid data")}return new FetchResponse(200,"OK",{"content-type":match[1]||"text/plain"},match[2]?decodeBase64(match[3]):unpercent(match[3]))}catch(error){return new FetchResponse(599,"BAD REQUEST (invalid data: URI)",{},null,new FetchRequest(url))}}function getIpfsGatewayFunc(baseUrl){async function gatewayIpfs(url,signal){try{const match=url.match(reIpfs);if(!match){throw new Error("invalid link")}return new FetchRequest(`${baseUrl}${match[2]}`)}catch(error){return new FetchResponse(599,"BAD REQUEST (invalid IPFS URI)",{},null,new FetchRequest(url))}}return gatewayIpfs}const Gateways={data:dataGatewayFunc,ipfs:getIpfsGatewayFunc("https://gateway.ipfs.io/ipfs/")};const fetchSignals=new WeakMap;class FetchCancelSignal{#listeners;#cancelled;constructor(request){this.#listeners=[];this.#cancelled=false;fetchSignals.set(request,()=>{if(this.#cancelled){return}this.#cancelled=true;for(const listener of this.#listeners){setTimeout(()=>{listener()},0)}this.#listeners=[]})}addListener(listener){assert(!this.#cancelled,"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"});this.#listeners.push(listener)}get cancelled(){return this.#cancelled}checkSignal(){assert(!this.cancelled,"cancelled","CANCELLED",{})}}function checkSignal(signal){if(signal==null){throw new Error("missing signal; should not happen")}signal.checkSignal();return signal}class FetchRequest{#allowInsecure;#gzip;#headers;#method;#timeout;#url;#body;#bodyType;#creds;#preflight;#process;#retry;#signal;#throttle;#getUrlFunc;get url(){return this.#url}set url(url){this.#url=String(url)}get body(){if(this.#body==null){return null}return new Uint8Array(this.#body)}set body(body){if(body==null){this.#body=undefined;this.#bodyType=undefined}else if(typeof body==="string"){this.#body=toUtf8Bytes(body);this.#bodyType="text/plain"}else if(body instanceof Uint8Array){this.#body=body;this.#bodyType="application/octet-stream"}else if(typeof body==="object"){this.#body=toUtf8Bytes(JSON.stringify(body));this.#bodyType="application/json"}else{throw new Error("invalid body")}}hasBody(){return this.#body!=null}get method(){if(this.#method){return this.#method}if(this.hasBody()){return"POST"}return"GET"}set method(method){if(method==null){method=""}this.#method=String(method).toUpperCase()}get headers(){const headers=Object.assign({},this.#headers);if(this.#creds){headers["authorization"]=`Basic ${encodeBase64(toUtf8Bytes(this.#creds))}`}if(this.allowGzip){headers["accept-encoding"]="gzip"}if(headers["content-type"]==null&&this.#bodyType){headers["content-type"]=this.#bodyType}if(this.body){headers["content-length"]=String(this.body.length)}return headers}getHeader(key){return this.headers[key.toLowerCase()]}setHeader(key,value){this.#headers[String(key).toLowerCase()]=String(value)}clearHeaders(){this.#headers={}}[Symbol.iterator](){const headers=this.headers;const keys=Object.keys(headers);let index=0;return{next:()=>{if(index=0,"timeout must be non-zero","timeout",timeout);this.#timeout=timeout}get preflightFunc(){return this.#preflight||null}set preflightFunc(preflight){this.#preflight=preflight}get processFunc(){return this.#process||null}set processFunc(process){this.#process=process}get retryFunc(){return this.#retry||null}set retryFunc(retry){this.#retry=retry}get getUrlFunc(){return this.#getUrlFunc||defaultGetUrlFunc}set getUrlFunc(value){this.#getUrlFunc=value}constructor(url){this.#url=String(url);this.#allowInsecure=false;this.#gzip=true;this.#headers={};this.#method="";this.#timeout=3e5;this.#throttle={slotInterval:SLOT_INTERVAL,maxAttempts:MAX_ATTEMPTS};this.#getUrlFunc=null}toString(){return``}setThrottleParams(params){if(params.slotInterval!=null){this.#throttle.slotInterval=params.slotInterval}if(params.maxAttempts!=null){this.#throttle.maxAttempts=params.maxAttempts}}async#send(attempt,expires,delay,_request,_response){if(attempt>=this.#throttle.maxAttempts){return _response.makeServerError("exceeded maximum retry limit")}assert(getTime$2()<=expires,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:_request});if(delay>0){await wait(delay)}let req=this.clone();const scheme=(req.url.split(":")[0]||"").toLowerCase();if(scheme in Gateways){const result=await Gateways[scheme](req.url,checkSignal(_request.#signal));if(result instanceof FetchResponse){let response=result;if(this.processFunc){checkSignal(_request.#signal);try{response=await this.processFunc(req,response)}catch(error){if(error.throttle==null||typeof error.stall!=="number"){response.makeServerError("error in post-processing function",error).assertOk()}}}return response}req=result}if(this.preflightFunc){req=await this.preflightFunc(req)}const resp=await this.getUrlFunc(req,checkSignal(_request.#signal));let response=new FetchResponse(resp.statusCode,resp.statusMessage,resp.headers,resp.body,_request);if(response.statusCode===301||response.statusCode===302){try{const location=response.headers.location||"";return req.redirect(location).#send(attempt+1,expires,0,_request,response)}catch(error){}return response}else if(response.statusCode===429){if(this.retryFunc==null||await this.retryFunc(req,response,attempt)){const retryAfter=response.headers["retry-after"];let delay=this.#throttle.slotInterval*Math.trunc(Math.random()*Math.pow(2,attempt));if(typeof retryAfter==="string"&&retryAfter.match(/^[1-9][0-9]*$/)){delay=parseInt(retryAfter)}return req.clone().#send(attempt+1,expires,delay,_request,response)}}if(this.processFunc){checkSignal(_request.#signal);try{response=await this.processFunc(req,response)}catch(error){if(error.throttle==null||typeof error.stall!=="number"){response.makeServerError("error in post-processing function",error).assertOk()}let delay=this.#throttle.slotInterval*Math.trunc(Math.random()*Math.pow(2,attempt));if(error.stall>=0){delay=error.stall}return req.clone().#send(attempt+1,expires,delay,_request,response)}}return response}send(){assert(this.#signal==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"});this.#signal=new FetchCancelSignal(this);return this.#send(0,getTime$2()+this.timeout,0,this,new FetchResponse(0,"",{},null,this))}cancel(){assert(this.#signal!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const signal=fetchSignals.get(this);if(!signal){throw new Error("missing signal; should not happen")}signal()}redirect(location){const current=this.url.split(":")[0].toLowerCase();const target=location.split(":")[0].toLowerCase();assert(this.method==="GET"&&(current!=="https"||target!=="http")&&location.match(/^https?:/),`unsupported redirect`,"UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(location)})`});const req=new FetchRequest(location);req.method="GET";req.allowGzip=this.allowGzip;req.timeout=this.timeout;req.#headers=Object.assign({},this.#headers);if(this.#body){req.#body=new Uint8Array(this.#body)}req.#bodyType=this.#bodyType;return req}clone(){const clone=new FetchRequest(this.url);clone.#method=this.#method;if(this.#body){clone.#body=this.#body}clone.#bodyType=this.#bodyType;clone.#headers=Object.assign({},this.#headers);clone.#creds=this.#creds;if(this.allowGzip){clone.allowGzip=true}clone.timeout=this.timeout;if(this.allowInsecureAuthentication){clone.allowInsecureAuthentication=true}clone.#preflight=this.#preflight;clone.#process=this.#process;clone.#retry=this.#retry;clone.#throttle=Object.assign({},this.#throttle);clone.#getUrlFunc=this.#getUrlFunc;return clone}static lockConfig(){locked$5=true}static getGateway(scheme){return Gateways[scheme.toLowerCase()]||null}static registerGateway(scheme,func){scheme=scheme.toLowerCase();if(scheme==="http"||scheme==="https"){throw new Error(`cannot intercept ${scheme}; use registerGetUrl`)}if(locked$5){throw new Error("gateways locked")}Gateways[scheme]=func}static registerGetUrl(getUrl){if(locked$5){throw new Error("gateways locked")}defaultGetUrlFunc=getUrl}static createGetUrlFunc(options){return createGetUrl(options)}static createDataGateway(){return dataGatewayFunc}static createIpfsGatewayFunc(baseUrl){return getIpfsGatewayFunc(baseUrl)}}class FetchResponse{#statusCode;#statusMessage;#headers;#body;#request;#error;toString(){return``}get statusCode(){return this.#statusCode}get statusMessage(){return this.#statusMessage}get headers(){return Object.assign({},this.#headers)}get body(){return this.#body==null?null:new Uint8Array(this.#body)}get bodyText(){try{return this.#body==null?"":toUtf8String(this.#body)}catch(error){assert(false,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch(error){assert(false,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const headers=this.headers;const keys=Object.keys(headers);let index=0;return{next:()=>{if(index{accum[k.toLowerCase()]=String(headers[k]);return accum},{});this.#body=body==null?null:new Uint8Array(body);this.#request=request||null;this.#error={message:""}}makeServerError(message,error){let statusMessage;if(!message){message=`${this.statusCode} ${this.statusMessage}`;statusMessage=`CLIENT ESCALATED SERVER ERROR (${message})`}else{statusMessage=`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${message})`}const response=new FetchResponse(599,statusMessage,this.headers,this.body,this.#request||undefined);response.#error={message:message,error:error};return response}throwThrottleError(message,stall){if(stall==null){stall=-1}else{assertArgument(Number.isInteger(stall)&&stall>=0,"invalid stall timeout","stall",stall)}const error=new Error(message||"throttling requests");defineProperties(error,{stall:stall,throttle:true});throw error}getHeader(key){return this.headers[key.toLowerCase()]}hasBody(){return this.#body!=null}get request(){return this.#request}ok(){return this.#error.message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok()){return}let{message,error}=this.#error;if(message===""){message=`server response ${this.statusCode} ${this.statusMessage}`}let requestUrl=null;if(this.request){requestUrl=this.request.url}let responseBody=null;try{if(this.#body){responseBody=toUtf8String(this.#body)}}catch(e){}assert(false,message,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:error,info:{requestUrl:requestUrl,responseBody:responseBody,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}}function getTime$2(){return(new Date).getTime()}function unpercent(value){return toUtf8Bytes(value.replace(/%([0-9a-f][0-9a-f])/gi,(all,code)=>{return String.fromCharCode(parseInt(code,16))}))}function wait(delay){return new Promise(resolve=>setTimeout(resolve,delay))}const BN_N1=BigInt(-1);const BN_0$8=BigInt(0);const BN_1$4=BigInt(1);const BN_5=BigInt(5);const _guard$5={};let Zeros$1="0000";while(Zeros$1.length<80){Zeros$1+=Zeros$1}function getTens(decimals){let result=Zeros$1;while(result.length=-limit&&valBN_0$8){val=fromTwos(mask(val,width),width)}else{val=-fromTwos(mask(-val,width),width)}}else{const limit=BN_1$4<=0&&val{if(v[key]==null){return defaultValue}assertArgument(typeof v[key]===type,"invalid fixed format ("+key+" not "+type+")","format."+key,v[key]);return v[key]};signed=check("signed","boolean",signed);width=check("width","number",width);decimals=check("decimals","number",decimals)}assertArgument(width%8===0,"invalid FixedNumber width (not byte aligned)","format.width",width);assertArgument(decimals<=80,"invalid FixedNumber decimals (too large)","format.decimals",decimals);const name=(signed?"":"u")+"fixed"+String(width)+"x"+String(decimals);return{signed:signed,width:width,decimals:decimals,name:name}}function toString(val,decimals){let negative="";if(val0){b*=getTens(delta)}else if(delta<0){a*=getTens(-delta)}if(ab){return 1}return 0}eq(other){return this.cmp(other)===0}lt(other){return this.cmp(other)<0}lte(other){return this.cmp(other)<=0}gt(other){return this.cmp(other)>0}gte(other){return this.cmp(other)>=0}floor(){let val=this.#val;if(this.#valBN_0$8){val+=this.#tens-BN_1$4}val=this.#val/this.#tens*this.#tens;return this.#checkValue(val,"ceiling")}round(decimals){if(decimals==null){decimals=0}if(decimals>=this.decimals){return this}const delta=this.decimals-decimals;const bump=BN_5*getTens(delta-1);let value=this.value+bump;const tens=getTens(delta);value=value/tens*tens;checkValue(value,this.#format,"round");return new FixedNumber(_guard$5,value,this.#format)}isZero(){return this.#val===BN_0$8}isNegative(){return this.#val0){const tens=getTens(delta);assert(value%tens===BN_0$8,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:_value});value/=tens}else if(delta<0){value*=getTens(-delta)}checkValue(value,format,"fromValue");return new FixedNumber(_guard$5,value,format)}static fromString(_value,_format){const match=_value.match(/^(-?)([0-9]*)\.?([0-9]*)$/);assertArgument(match&&match[2].length+match[3].length>0,"invalid FixedNumber string value","value",_value);const format=getFormat(_format);let whole=match[2]||"0",decimal=match[3]||"";while(decimal.length{assert(offset<=data.length,"data short segment too short","BUFFER_OVERRUN",{buffer:data,length:data.length,offset:offset})};if(data[offset]>=248){const lengthLength=data[offset]-247;checkOffset(offset+1+lengthLength);const length=unarrayifyInteger(data,offset+1,lengthLength);checkOffset(offset+1+lengthLength+length);return _decodeChildren(data,offset,offset+1+lengthLength,lengthLength+length)}else if(data[offset]>=192){const length=data[offset]-192;checkOffset(offset+1+length);return _decodeChildren(data,offset,offset+1,length)}else if(data[offset]>=184){const lengthLength=data[offset]-183;checkOffset(offset+1+lengthLength);const length=unarrayifyInteger(data,offset+1,lengthLength);checkOffset(offset+1+lengthLength+length);const result=hexlify(data.slice(offset+1+lengthLength,offset+1+lengthLength+length));return{consumed:1+lengthLength+length,result:result}}else if(data[offset]>=128){const length=data[offset]-128;checkOffset(offset+1+length);const result=hexlify(data.slice(offset+1,offset+1+length));return{consumed:1+length,result:result}}return{consumed:1,result:hexlifyByte(data[offset])}}function decodeRlp(_data){const data=getBytes(_data,"data");const decoded=_decode(data,0);assertArgument(decoded.consumed===data.length,"unexpected junk after rlp payload","data",_data);return decoded.result}function arrayifyInteger(value){const result=[];while(value){result.unshift(value&255);value>>=8}return result}function _encode(object){if(Array.isArray(object)){let payload=[];object.forEach(function(child){payload=payload.concat(_encode(child))});if(payload.length<=55){payload.unshift(192+payload.length);return payload}const length=arrayifyInteger(payload.length);length.unshift(247+length.length);return length.concat(payload)}const data=Array.prototype.slice.call(getBytes(object,"object"));if(data.length===1&&data[0]<=127){return data}else if(data.length<=55){data.unshift(128+data.length);return data}const length=arrayifyInteger(data.length);length.unshift(183+length.length);return length.concat(data)}const nibbles="0123456789abcdef";function encodeRlp(object){let result="0x";for(const v of _encode(object)){result+=nibbles[v>>4];result+=nibbles[v&15]}return result}const names=["wei","kwei","mwei","gwei","szabo","finney","ether"];function formatUnits(value,unit){let decimals=18;if(typeof unit==="string"){const index=names.indexOf(unit);assertArgument(index>=0,"invalid unit","unit",unit);decimals=3*index}else if(unit!=null){decimals=getNumber(unit,"unit")}return FixedNumber.fromValue(value,decimals,{decimals:decimals,width:512}).toString()}function parseUnits$1(value,unit){assertArgument(typeof value==="string","value must be a string","value",value);let decimals=18;if(typeof unit==="string"){const index=names.indexOf(unit);assertArgument(index>=0,"invalid unit","unit",unit);decimals=3*index}else if(unit!=null){decimals=getNumber(unit,"unit")}return FixedNumber.fromString(value,{decimals:decimals,width:512}).value}function formatEther(wei){return formatUnits(wei,18)}function parseEther(ether){return parseUnits$1(ether,18)}function uuidV4(randomBytes){const bytes=getBytes(randomBytes,"randomBytes");bytes[6]=bytes[6]&15|64;bytes[8]=bytes[8]&63|128;const value=hexlify(bytes);return[value.substring(2,10),value.substring(10,14),value.substring(14,18),value.substring(18,22),value.substring(22,34)].join("-")}const WordSize=32;const Padding=new Uint8Array(WordSize);const passProperties$1=["then"];const _guard$4={};const resultNames=new WeakMap;function getNames(result){return resultNames.get(result)}function setNames(result,names){resultNames.set(result,names)}function throwError(name,error){const wrapped=new Error(`deferred error during ABI decoding triggered accessing ${name}`);wrapped.error=error;throw wrapped}function toObject(names,items,deep){if(names.indexOf(null)>=0){return items.map((item,index)=>{if(item instanceof Result){return toObject(getNames(item),item,deep)}return item})}return names.reduce((accum,name,index)=>{let item=items.getValue(name);if(!(name in accum)){if(deep&&item instanceof Result){item=toObject(getNames(item),item,deep)}accum[name]=item}return accum},{})}class Result extends Array{#names;constructor(...args){const guard=args[0];let items=args[1];let names=(args[2]||[]).slice();let wrap=true;if(guard!==_guard$4){items=args;names=[];wrap=false}super(items.length);items.forEach((item,index)=>{this[index]=item});const nameCounts=names.reduce((accum,name)=>{if(typeof name==="string"){accum.set(name,(accum.get(name)||0)+1)}return accum},new Map);setNames(this,Object.freeze(items.map((item,index)=>{const name=names[index];if(name!=null&&nameCounts.get(name)===1){return name}return null})));this.#names=[];if(this.#names==null){void this.#names}if(!wrap){return}Object.freeze(this);const proxy=new Proxy(this,{get:(target,prop,receiver)=>{if(typeof prop==="string"){if(prop.match(/^[0-9]+$/)){const index=getNumber(prop,"%index");if(index<0||index>=this.length){throw new RangeError("out of result range")}const item=target[index];if(item instanceof Error){throwError(`index ${index}`,item)}return item}if(passProperties$1.indexOf(prop)>=0){return Reflect.get(target,prop,receiver)}const value=target[prop];if(value instanceof Function){return function(...args){return value.apply(this===receiver?target:this,args)}}else if(!(prop in target)){return target.getValue.apply(this===receiver?target:this,[prop])}}return Reflect.get(target,prop,receiver)}});setNames(proxy,getNames(this));return proxy}toArray(deep){const result=[];this.forEach((item,index)=>{if(item instanceof Error){throwError(`index ${index}`,item)}if(deep&&item instanceof Result){item=item.toArray(deep)}result.push(item)});return result}toObject(deep){const names=getNames(this);return names.reduce((accum,name,index)=>{assert(name!=null,`value at index ${index} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"});return toObject(names,this,deep)},{})}slice(start,end){if(start==null){start=0}if(start<0){start+=this.length;if(start<0){start=0}}if(end==null){end=this.length}if(end<0){end+=this.length;if(end<0){end=0}}if(end>this.length){end=this.length}const _names=getNames(this);const result=[],names=[];for(let i=start;i{this.#data[offset]=getValue$1(value)}}}class Reader{allowLoose;#data;#offset;#bytesRead;#parent;#maxInflation;constructor(data,allowLoose,maxInflation){defineProperties(this,{allowLoose:!!allowLoose});this.#data=getBytesCopy(data);this.#bytesRead=0;this.#parent=null;this.#maxInflation=maxInflation!=null?maxInflation:1024;this.#offset=0}get data(){return hexlify(this.#data)}get dataLength(){return this.#data.length}get consumed(){return this.#offset}get bytes(){return new Uint8Array(this.#data)}#incrementBytesRead(count){if(this.#parent){return this.#parent.#incrementBytesRead(count)}this.#bytesRead+=count;assert(this.#maxInflation<1||this.#bytesRead<=this.#maxInflation*this.dataLength,`compressed ABI data exceeds inflation ratio of ${this.#maxInflation} ( see: https:/\/github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:getBytesCopy(this.#data),offset:this.#offset,length:count,info:{bytesRead:this.#bytesRead,dataLength:this.dataLength}})}#peekBytes(offset,length,loose){let alignedLength=Math.ceil(length/WordSize)*WordSize;if(this.#offset+alignedLength>this.#data.length){if(this.allowLoose&&loose&&this.#offset+length<=this.#data.length){alignedLength=length}else{assert(false,"data out-of-bounds","BUFFER_OVERRUN",{buffer:getBytesCopy(this.#data),length:this.#data.length,offset:this.#offset+alignedLength})}}return this.#data.slice(this.#offset,this.#offset+alignedLength)}subReader(offset){const reader=new Reader(this.#data.slice(this.#offset+offset),this.allowLoose,this.#maxInflation);reader.#parent=this;return reader}readBytes(length,loose){let bytes=this.#peekBytes(0,length,!!loose);this.#incrementBytesRead(length);this.#offset+=bytes.length;return bytes.slice(0,length)}readValue(){return toBigInt(this.readBytes(WordSize))}readIndex(){return toNumber(this.readBytes(WordSize))}}function number(n){if(!Number.isSafeInteger(n)||n<0)throw new Error(`Wrong positive integer: ${n}`)}function bytes(b,...lengths){if(!(b instanceof Uint8Array))throw new Error("Expected Uint8Array");if(lengths.length>0&&!lengths.includes(b.length))throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`)}function hash(hash){if(typeof hash!=="function"||typeof hash.create!=="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");number(hash.outputLen);number(hash.blockLen)}function exists(instance,checkFinished=true){if(instance.destroyed)throw new Error("Hash instance has been destroyed");if(checkFinished&&instance.finished)throw new Error("Hash#digest() has already been called")}function output(out,instance){bytes(out);const min=instance.outputLen;if(out.lengtha instanceof Uint8Array;const u32=arr=>new Uint32Array(arr.buffer,arr.byteOffset,Math.floor(arr.byteLength/4));const createView=arr=>new DataView(arr.buffer,arr.byteOffset,arr.byteLength);const rotr=(word,shift)=>word<<32-shift|word>>>shift;const isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!isLE)throw new Error("Non little-endian hardware is not supported");const nextTick=async()=>{};async function asyncLoop(iters,tick,cb){let ts=Date.now();for(let i=0;i=0&&diffsum+a.length,0));let pad=0;arrays.forEach(a=>{if(!u8a$1(a))throw new Error("Uint8Array expected");r.set(a,pad);pad+=a.length});return r}class Hash{clone(){return this._cloneInto()}}const toStr={}.toString;function checkOpts(defaults,opts){if(opts!==undefined&&toStr.call(opts)!=="[object Object]")throw new Error("Options should be object or undefined");const merged=Object.assign(defaults,opts);return merged}function wrapConstructor(hashCons){const hashC=msg=>hashCons().update(toBytes(msg)).digest();const tmp=hashCons();hashC.outputLen=tmp.outputLen;hashC.blockLen=tmp.blockLen;hashC.create=()=>hashCons();return hashC}function randomBytes$2(bytesLength=32){if(crypto$1&&typeof crypto$1.getRandomValues==="function"){return crypto$1.getRandomValues(new Uint8Array(bytesLength))}throw new Error("crypto.getRandomValues must be defined")}class HMAC extends Hash{constructor(hash$1,_key){super();this.finished=false;this.destroyed=false;hash(hash$1);const key=toBytes(_key);this.iHash=hash$1.create();if(typeof this.iHash.update!=="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen;this.outputLen=this.iHash.outputLen;const blockLen=this.blockLen;const pad=new Uint8Array(blockLen);pad.set(key.length>blockLen?hash$1.create().update(key).digest():key);for(let i=0;inew HMAC(hash,key).update(message).digest();hmac.create=(hash,key)=>new HMAC(hash,key);function pbkdf2Init(hash$1,_password,_salt,_opts){hash(hash$1);const opts=checkOpts({dkLen:32,asyncTick:10},_opts);const{c,dkLen,asyncTick}=opts;number(c);number(dkLen);number(asyncTick);if(c<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const password=toBytes(_password);const salt=toBytes(_salt);const DK=new Uint8Array(dkLen);const PRF=hmac.create(hash$1,password);const PRFSalt=PRF._cloneInto().update(salt);return{c:c,dkLen:dkLen,asyncTick:asyncTick,DK:DK,PRF:PRF,PRFSalt:PRFSalt}}function pbkdf2Output(PRF,PRFSalt,DK,prfW,u){PRF.destroy();PRFSalt.destroy();if(prfW)prfW.destroy();u.fill(0);return DK}function pbkdf2$1(hash,password,salt,opts){const{c,dkLen,DK,PRF,PRFSalt}=pbkdf2Init(hash,password,salt,opts);let prfW;const arr=new Uint8Array(4);const view=createView(arr);const u=new Uint8Array(PRF.outputLen);for(let ti=1,pos=0;pos>_32n&_u32_max);const wl=Number(value&_u32_max);const h=isLE?4:0;const l=isLE?0:4;view.setUint32(byteOffset+h,wh,isLE);view.setUint32(byteOffset+l,wl,isLE)}class SHA2 extends Hash{constructor(blockLen,outputLen,padOffset,isLE){super();this.blockLen=blockLen;this.outputLen=outputLen;this.padOffset=padOffset;this.isLE=isLE;this.finished=false;this.length=0;this.pos=0;this.destroyed=false;this.buffer=new Uint8Array(blockLen);this.view=createView(this.buffer)}update(data){exists(this);const{view,buffer,blockLen}=this;data=toBytes(data);const len=data.length;for(let pos=0;posblockLen-pos){this.process(view,0);pos=0}for(let i=pos;istate.length)throw new Error("_sha2: outputLen bigger than state");for(let i=0;ia&b^~a&c;const Maj=(a,b,c)=>a&b^a&c^b&c;const SHA256_K=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);const IV=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);const SHA256_W=new Uint32Array(64);class SHA256 extends SHA2{constructor(){super(64,32,8,false);this.A=IV[0]|0;this.B=IV[1]|0;this.C=IV[2]|0;this.D=IV[3]|0;this.E=IV[4]|0;this.F=IV[5]|0;this.G=IV[6]|0;this.H=IV[7]|0}get(){const{A,B,C,D,E,F,G,H}=this;return[A,B,C,D,E,F,G,H]}set(A,B,C,D,E,F,G,H){this.A=A|0;this.B=B|0;this.C=C|0;this.D=D|0;this.E=E|0;this.F=F|0;this.G=G|0;this.H=H|0}process(view,offset){for(let i=0;i<16;i++,offset+=4)SHA256_W[i]=view.getUint32(offset,false);for(let i=16;i<64;i++){const W15=SHA256_W[i-15];const W2=SHA256_W[i-2];const s0=rotr(W15,7)^rotr(W15,18)^W15>>>3;const s1=rotr(W2,17)^rotr(W2,19)^W2>>>10;SHA256_W[i]=s1+SHA256_W[i-7]+s0+SHA256_W[i-16]|0}let{A,B,C,D,E,F,G,H}=this;for(let i=0;i<64;i++){const sigma1=rotr(E,6)^rotr(E,11)^rotr(E,25);const T1=H+sigma1+Chi(E,F,G)+SHA256_K[i]+SHA256_W[i]|0;const sigma0=rotr(A,2)^rotr(A,13)^rotr(A,22);const T2=sigma0+Maj(A,B,C)|0;H=G;G=F;F=E;E=D+T1|0;D=C;C=B;B=A;A=T1+T2|0}A=A+this.A|0;B=B+this.B|0;C=C+this.C|0;D=D+this.D|0;E=E+this.E|0;F=F+this.F|0;G=G+this.G|0;H=H+this.H|0;this.set(A,B,C,D,E,F,G,H)}roundClean(){SHA256_W.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0);this.buffer.fill(0)}}const sha256$1=wrapConstructor(()=>new SHA256);const U32_MASK64=BigInt(2**32-1);const _32n=BigInt(32);function fromBig(n,le=false){if(le)return{h:Number(n&U32_MASK64),l:Number(n>>_32n&U32_MASK64)};return{h:Number(n>>_32n&U32_MASK64)|0,l:Number(n&U32_MASK64)|0}}function split$1(lst,le=false){let Ah=new Uint32Array(lst.length);let Al=new Uint32Array(lst.length);for(let i=0;iBigInt(h>>>0)<<_32n|BigInt(l>>>0);const shrSH=(h,_l,s)=>h>>>s;const shrSL=(h,l,s)=>h<<32-s|l>>>s;const rotrSH=(h,l,s)=>h>>>s|l<<32-s;const rotrSL=(h,l,s)=>h<<32-s|l>>>s;const rotrBH=(h,l,s)=>h<<64-s|l>>>s-32;const rotrBL=(h,l,s)=>h>>>s-32|l<<64-s;const rotr32H=(_h,l)=>l;const rotr32L=(h,_l)=>h;const rotlSH=(h,l,s)=>h<>>32-s;const rotlSL=(h,l,s)=>l<>>32-s;const rotlBH=(h,l,s)=>l<>>64-s;const rotlBL=(h,l,s)=>h<>>64-s;function add(Ah,Al,Bh,Bl){const l=(Al>>>0)+(Bl>>>0);return{h:Ah+Bh+(l/2**32|0)|0,l:l|0}}const add3L=(Al,Bl,Cl)=>(Al>>>0)+(Bl>>>0)+(Cl>>>0);const add3H=(low,Ah,Bh,Ch)=>Ah+Bh+Ch+(low/2**32|0)|0;const add4L=(Al,Bl,Cl,Dl)=>(Al>>>0)+(Bl>>>0)+(Cl>>>0)+(Dl>>>0);const add4H=(low,Ah,Bh,Ch,Dh)=>Ah+Bh+Ch+Dh+(low/2**32|0)|0;const add5L=(Al,Bl,Cl,Dl,El)=>(Al>>>0)+(Bl>>>0)+(Cl>>>0)+(Dl>>>0)+(El>>>0);const add5H=(low,Ah,Bh,Ch,Dh,Eh)=>Ah+Bh+Ch+Dh+Eh+(low/2**32|0)|0;const u64={fromBig:fromBig,split:split$1,toBig:toBig,shrSH:shrSH,shrSL:shrSL,rotrSH:rotrSH,rotrSL:rotrSL,rotrBH:rotrBH,rotrBL:rotrBL,rotr32H:rotr32H,rotr32L:rotr32L,rotlSH:rotlSH,rotlSL:rotlSL,rotlBH:rotlBH,rotlBL:rotlBL,add:add,add3L:add3L,add3H:add3H,add4L:add4L,add4H:add4H,add5H:add5H,add5L:add5L};const[SHA512_Kh,SHA512_Kl]=(()=>u64.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(n=>BigInt(n))))();const SHA512_W_H=new Uint32Array(80);const SHA512_W_L=new Uint32Array(80);class SHA512 extends SHA2{constructor(){super(128,64,16,false);this.Ah=1779033703|0;this.Al=4089235720|0;this.Bh=3144134277|0;this.Bl=2227873595|0;this.Ch=1013904242|0;this.Cl=4271175723|0;this.Dh=2773480762|0;this.Dl=1595750129|0;this.Eh=1359893119|0;this.El=2917565137|0;this.Fh=2600822924|0;this.Fl=725511199|0;this.Gh=528734635|0;this.Gl=4215389547|0;this.Hh=1541459225|0;this.Hl=327033209|0}get(){const{Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl}=this;return[Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl]}set(Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl){this.Ah=Ah|0;this.Al=Al|0;this.Bh=Bh|0;this.Bl=Bl|0;this.Ch=Ch|0;this.Cl=Cl|0;this.Dh=Dh|0;this.Dl=Dl|0;this.Eh=Eh|0;this.El=El|0;this.Fh=Fh|0;this.Fl=Fl|0;this.Gh=Gh|0;this.Gl=Gl|0;this.Hh=Hh|0;this.Hl=Hl|0}process(view,offset){for(let i=0;i<16;i++,offset+=4){SHA512_W_H[i]=view.getUint32(offset);SHA512_W_L[i]=view.getUint32(offset+=4)}for(let i=16;i<80;i++){const W15h=SHA512_W_H[i-15]|0;const W15l=SHA512_W_L[i-15]|0;const s0h=u64.rotrSH(W15h,W15l,1)^u64.rotrSH(W15h,W15l,8)^u64.shrSH(W15h,W15l,7);const s0l=u64.rotrSL(W15h,W15l,1)^u64.rotrSL(W15h,W15l,8)^u64.shrSL(W15h,W15l,7);const W2h=SHA512_W_H[i-2]|0;const W2l=SHA512_W_L[i-2]|0;const s1h=u64.rotrSH(W2h,W2l,19)^u64.rotrBH(W2h,W2l,61)^u64.shrSH(W2h,W2l,6);const s1l=u64.rotrSL(W2h,W2l,19)^u64.rotrBL(W2h,W2l,61)^u64.shrSL(W2h,W2l,6);const SUMl=u64.add4L(s0l,s1l,SHA512_W_L[i-7],SHA512_W_L[i-16]);const SUMh=u64.add4H(SUMl,s0h,s1h,SHA512_W_H[i-7],SHA512_W_H[i-16]);SHA512_W_H[i]=SUMh|0;SHA512_W_L[i]=SUMl|0}let{Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl}=this;for(let i=0;i<80;i++){const sigma1h=u64.rotrSH(Eh,El,14)^u64.rotrSH(Eh,El,18)^u64.rotrBH(Eh,El,41);const sigma1l=u64.rotrSL(Eh,El,14)^u64.rotrSL(Eh,El,18)^u64.rotrBL(Eh,El,41);const CHIh=Eh&Fh^~Eh&Gh;const CHIl=El&Fl^~El&Gl;const T1ll=u64.add5L(Hl,sigma1l,CHIl,SHA512_Kl[i],SHA512_W_L[i]);const T1h=u64.add5H(T1ll,Hh,sigma1h,CHIh,SHA512_Kh[i],SHA512_W_H[i]);const T1l=T1ll|0;const sigma0h=u64.rotrSH(Ah,Al,28)^u64.rotrBH(Ah,Al,34)^u64.rotrBH(Ah,Al,39);const sigma0l=u64.rotrSL(Ah,Al,28)^u64.rotrBL(Ah,Al,34)^u64.rotrBL(Ah,Al,39);const MAJh=Ah&Bh^Ah&Ch^Bh&Ch;const MAJl=Al&Bl^Al&Cl^Bl&Cl;Hh=Gh|0;Hl=Gl|0;Gh=Fh|0;Gl=Fl|0;Fh=Eh|0;Fl=El|0;({h:Eh,l:El}=u64.add(Dh|0,Dl|0,T1h|0,T1l|0));Dh=Ch|0;Dl=Cl|0;Ch=Bh|0;Cl=Bl|0;Bh=Ah|0;Bl=Al|0;const All=u64.add3L(T1l,sigma0l,MAJl);Ah=u64.add3H(All,T1h,sigma0h,MAJh);Al=All|0}({h:Ah,l:Al}=u64.add(this.Ah|0,this.Al|0,Ah|0,Al|0));({h:Bh,l:Bl}=u64.add(this.Bh|0,this.Bl|0,Bh|0,Bl|0));({h:Ch,l:Cl}=u64.add(this.Ch|0,this.Cl|0,Ch|0,Cl|0));({h:Dh,l:Dl}=u64.add(this.Dh|0,this.Dl|0,Dh|0,Dl|0));({h:Eh,l:El}=u64.add(this.Eh|0,this.El|0,Eh|0,El|0));({h:Fh,l:Fl}=u64.add(this.Fh|0,this.Fl|0,Fh|0,Fl|0));({h:Gh,l:Gl}=u64.add(this.Gh|0,this.Gl|0,Gh|0,Gl|0));({h:Hh,l:Hl}=u64.add(this.Hh|0,this.Hl|0,Hh|0,Hl|0));this.set(Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl)}roundClean(){SHA512_W_H.fill(0);SHA512_W_L.fill(0)}destroy(){this.buffer.fill(0);this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const sha512$1=wrapConstructor(()=>new SHA512);function getGlobal$1(){if(typeof self!=="undefined"){return self}if(typeof window!=="undefined"){return window}if(typeof global!=="undefined"){return global}throw new Error("unable to locate global object")}const anyGlobal=getGlobal$1();const crypto=anyGlobal.crypto||anyGlobal.msCrypto;function createHash(algo){switch(algo){case"sha256":return sha256$1.create();case"sha512":return sha512$1.create()}assertArgument(false,"invalid hashing algorithm name","algorithm",algo)}function createHmac(_algo,key){const algo={sha256:sha256$1,sha512:sha512$1}[_algo];assertArgument(algo!=null,"invalid hmac algorithm","algorithm",_algo);return hmac.create(algo,key)}function pbkdf2Sync(password,salt,iterations,keylen,_algo){const algo={sha256:sha256$1,sha512:sha512$1}[_algo];assertArgument(algo!=null,"invalid pbkdf2 algorithm","algorithm",_algo);return pbkdf2$1(algo,password,salt,{c:iterations,dkLen:keylen})}function randomBytes$1(length){assert(crypto!=null,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"});assertArgument(Number.isInteger(length)&&length>0&&length<=1024,"invalid length","length",length);const result=new Uint8Array(length);crypto.getRandomValues(result);return result}let locked$4=false;const _computeHmac=function(algorithm,key,data){return createHmac(algorithm,key).update(data).digest()};let __computeHmac=_computeHmac;function computeHmac(algorithm,_key,_data){const key=getBytes(_key,"key");const data=getBytes(_data,"data");return hexlify(__computeHmac(algorithm,key,data))}computeHmac._=_computeHmac;computeHmac.lock=function(){locked$4=true};computeHmac.register=function(func){if(locked$4){throw new Error("computeHmac is locked")}__computeHmac=func};Object.freeze(computeHmac);const[SHA3_PI,SHA3_ROTL,_SHA3_IOTA]=[[],[],[]];const _0n$4=BigInt(0);const _1n$5=BigInt(1);const _2n$3=BigInt(2);const _7n=BigInt(7);const _256n=BigInt(256);const _0x71n=BigInt(113);for(let round=0,R=_1n$5,x=1,y=0;round<24;round++){[x,y]=[y,(2*x+3*y)%5];SHA3_PI.push(2*(5*y+x));SHA3_ROTL.push((round+1)*(round+2)/2%64);let t=_0n$4;for(let j=0;j<7;j++){R=(R<<_1n$5^(R>>_7n)*_0x71n)%_256n;if(R&_2n$3)t^=_1n$5<<(_1n$5<s>32?rotlBH(h,l,s):rotlSH(h,l,s);const rotlL=(h,l,s)=>s>32?rotlBL(h,l,s):rotlSL(h,l,s);function keccakP(s,rounds=24){const B=new Uint32Array(5*2);for(let round=24-rounds;round<24;round++){for(let x=0;x<10;x++)B[x]=s[x]^s[x+10]^s[x+20]^s[x+30]^s[x+40];for(let x=0;x<10;x+=2){const idx1=(x+8)%10;const idx0=(x+2)%10;const B0=B[idx0];const B1=B[idx0+1];const Th=rotlH(B0,B1,1)^B[idx1];const Tl=rotlL(B0,B1,1)^B[idx1+1];for(let y=0;y<50;y+=10){s[x+y]^=Th;s[x+y+1]^=Tl}}let curH=s[2];let curL=s[3];for(let t=0;t<24;t++){const shift=SHA3_ROTL[t];const Th=rotlH(curH,curL,shift);const Tl=rotlL(curH,curL,shift);const PI=SHA3_PI[t];curH=s[PI];curL=s[PI+1];s[PI]=Th;s[PI+1]=Tl}for(let y=0;y<50;y+=10){for(let x=0;x<10;x++)B[x]=s[y+x];for(let x=0;x<10;x++)s[y+x]^=~B[(x+2)%10]&B[(x+4)%10]}s[0]^=SHA3_IOTA_H[round];s[1]^=SHA3_IOTA_L[round]}B.fill(0)}class Keccak extends Hash{constructor(blockLen,suffix,outputLen,enableXOF=false,rounds=24){super();this.blockLen=blockLen;this.suffix=suffix;this.outputLen=outputLen;this.enableXOF=enableXOF;this.rounds=rounds;this.pos=0;this.posOut=0;this.finished=false;this.destroyed=false;number(outputLen);if(0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200);this.state32=u32(this.state)}keccak(){keccakP(this.state32,this.rounds);this.posOut=0;this.pos=0}update(data){exists(this);const{blockLen,state}=this;data=toBytes(data);const len=data.length;for(let pos=0;pos=blockLen)this.keccak();const take=Math.min(blockLen-this.posOut,len-pos);out.set(bufferOut.subarray(this.posOut,this.posOut+take),pos);this.posOut+=take;pos+=take}return out}xofInto(out){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(out)}xof(bytes){number(bytes);return this.xofInto(new Uint8Array(bytes))}digestInto(out){output(out,this);if(this.finished)throw new Error("digest() was already called");this.writeInto(out);this.destroy();return out}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=true;this.state.fill(0)}_cloneInto(to){const{blockLen,suffix,outputLen,rounds,enableXOF}=this;to||(to=new Keccak(blockLen,suffix,outputLen,enableXOF,rounds));to.state32.set(this.state32);to.pos=this.pos;to.posOut=this.posOut;to.finished=this.finished;to.rounds=rounds;to.suffix=suffix;to.outputLen=outputLen;to.enableXOF=enableXOF;to.destroyed=this.destroyed;return to}}const gen=(suffix,blockLen,outputLen)=>wrapConstructor(()=>new Keccak(blockLen,suffix,outputLen));const keccak_256=gen(1,136,256/8);let locked$3=false;const _keccak256=function(data){return keccak_256(data)};let __keccak256=_keccak256;function keccak256(_data){const data=getBytes(_data,"data");return hexlify(__keccak256(data))}keccak256._=_keccak256;keccak256.lock=function(){locked$3=true};keccak256.register=function(func){if(locked$3){throw new TypeError("keccak256 is locked")}__keccak256=func};Object.freeze(keccak256);const Rho=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]);const Id=Uint8Array.from({length:16},(_,i)=>i);const Pi=Id.map(i=>(9*i+5)%16);let idxL=[Id];let idxR=[Pi];for(let i=0;i<4;i++)for(let j of[idxL,idxR])j.push(j[i].map(k=>Rho[k]));const shifts=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(i=>new Uint8Array(i));const shiftsL=idxL.map((idx,i)=>idx.map(j=>shifts[i][j]));const shiftsR=idxR.map((idx,i)=>idx.map(j=>shifts[i][j]));const Kl=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]);const Kr=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]);const rotl$1=(word,shift)=>word<>>32-shift;function f(group,x,y,z){if(group===0)return x^y^z;else if(group===1)return x&y|~x&z;else if(group===2)return(x|~y)^z;else if(group===3)return x&z|y&~z;else return x^(y|~z)}const BUF=new Uint32Array(16);class RIPEMD160 extends SHA2{constructor(){super(64,20,8,true);this.h0=1732584193|0;this.h1=4023233417|0;this.h2=2562383102|0;this.h3=271733878|0;this.h4=3285377520|0}get(){const{h0,h1,h2,h3,h4}=this;return[h0,h1,h2,h3,h4]}set(h0,h1,h2,h3,h4){this.h0=h0|0;this.h1=h1|0;this.h2=h2|0;this.h3=h3|0;this.h4=h4|0}process(view,offset){for(let i=0;i<16;i++,offset+=4)BUF[i]=view.getUint32(offset,true);let al=this.h0|0,ar=al,bl=this.h1|0,br=bl,cl=this.h2|0,cr=cl,dl=this.h3|0,dr=dl,el=this.h4|0,er=el;for(let group=0;group<5;group++){const rGroup=4-group;const hbl=Kl[group],hbr=Kr[group];const rl=idxL[group],rr=idxR[group];const sl=shiftsL[group],sr=shiftsR[group];for(let i=0;i<16;i++){const tl=rotl$1(al+f(group,bl,cl,dl)+BUF[rl[i]]+hbl,sl[i])+el|0;al=el,el=dl,dl=rotl$1(cl,10)|0,cl=bl,bl=tl}for(let i=0;i<16;i++){const tr=rotl$1(ar+f(rGroup,br,cr,dr)+BUF[rr[i]]+hbr,sr[i])+er|0;ar=er,er=dr,dr=rotl$1(cr,10)|0,cr=br,br=tr}}this.set(this.h1+cl+dr|0,this.h2+dl+er|0,this.h3+el+ar|0,this.h4+al+br|0,this.h0+bl+cr|0)}roundClean(){BUF.fill(0)}destroy(){this.destroyed=true;this.buffer.fill(0);this.set(0,0,0,0,0)}}const ripemd160$1=wrapConstructor(()=>new RIPEMD160);let locked$2=false;const _ripemd160=function(data){return ripemd160$1(data)};let __ripemd160=_ripemd160;function ripemd160(_data){const data=getBytes(_data,"data");return hexlify(__ripemd160(data))}ripemd160._=_ripemd160;ripemd160.lock=function(){locked$2=true};ripemd160.register=function(func){if(locked$2){throw new TypeError("ripemd160 is locked")}__ripemd160=func};Object.freeze(ripemd160);let locked$1=false;const _pbkdf2=function(password,salt,iterations,keylen,algo){return pbkdf2Sync(password,salt,iterations,keylen,algo)};let __pbkdf2=_pbkdf2;function pbkdf2(_password,_salt,iterations,keylen,algo){const password=getBytes(_password,"password");const salt=getBytes(_salt,"salt");return hexlify(__pbkdf2(password,salt,iterations,keylen,algo))}pbkdf2._=_pbkdf2;pbkdf2.lock=function(){locked$1=true};pbkdf2.register=function(func){if(locked$1){throw new Error("pbkdf2 is locked")}__pbkdf2=func};Object.freeze(pbkdf2);let locked=false;const _randomBytes=function(length){return new Uint8Array(randomBytes$1(length))};let __randomBytes=_randomBytes;function randomBytes(length){return __randomBytes(length)}randomBytes._=_randomBytes;randomBytes.lock=function(){locked=true};randomBytes.register=function(func){if(locked){throw new Error("randomBytes is locked")}__randomBytes=func};Object.freeze(randomBytes);const rotl=(a,b)=>a<>>32-b;function XorAndSalsa(prev,pi,input,ii,out,oi){let y00=prev[pi++]^input[ii++],y01=prev[pi++]^input[ii++];let y02=prev[pi++]^input[ii++],y03=prev[pi++]^input[ii++];let y04=prev[pi++]^input[ii++],y05=prev[pi++]^input[ii++];let y06=prev[pi++]^input[ii++],y07=prev[pi++]^input[ii++];let y08=prev[pi++]^input[ii++],y09=prev[pi++]^input[ii++];let y10=prev[pi++]^input[ii++],y11=prev[pi++]^input[ii++];let y12=prev[pi++]^input[ii++],y13=prev[pi++]^input[ii++];let y14=prev[pi++]^input[ii++],y15=prev[pi++]^input[ii++];let x00=y00,x01=y01,x02=y02,x03=y03,x04=y04,x05=y05,x06=y06,x07=y07,x08=y08,x09=y09,x10=y10,x11=y11,x12=y12,x13=y13,x14=y14,x15=y15;for(let i=0;i<8;i+=2){x04^=rotl(x00+x12|0,7);x08^=rotl(x04+x00|0,9);x12^=rotl(x08+x04|0,13);x00^=rotl(x12+x08|0,18);x09^=rotl(x05+x01|0,7);x13^=rotl(x09+x05|0,9);x01^=rotl(x13+x09|0,13);x05^=rotl(x01+x13|0,18);x14^=rotl(x10+x06|0,7);x02^=rotl(x14+x10|0,9);x06^=rotl(x02+x14|0,13);x10^=rotl(x06+x02|0,18);x03^=rotl(x15+x11|0,7);x07^=rotl(x03+x15|0,9);x11^=rotl(x07+x03|0,13);x15^=rotl(x11+x07|0,18);x01^=rotl(x00+x03|0,7);x02^=rotl(x01+x00|0,9);x03^=rotl(x02+x01|0,13);x00^=rotl(x03+x02|0,18);x06^=rotl(x05+x04|0,7);x07^=rotl(x06+x05|0,9);x04^=rotl(x07+x06|0,13);x05^=rotl(x04+x07|0,18);x11^=rotl(x10+x09|0,7);x08^=rotl(x11+x10|0,9);x09^=rotl(x08+x11|0,13);x10^=rotl(x09+x08|0,18);x12^=rotl(x15+x14|0,7);x13^=rotl(x12+x15|0,9);x14^=rotl(x13+x12|0,13);x15^=rotl(x14+x13|0,18)}out[oi++]=y00+x00|0;out[oi++]=y01+x01|0;out[oi++]=y02+x02|0;out[oi++]=y03+x03|0;out[oi++]=y04+x04|0;out[oi++]=y05+x05|0;out[oi++]=y06+x06|0;out[oi++]=y07+x07|0;out[oi++]=y08+x08|0;out[oi++]=y09+x09|0;out[oi++]=y10+x10|0;out[oi++]=y11+x11|0;out[oi++]=y12+x12|0;out[oi++]=y13+x13|0;out[oi++]=y14+x14|0;out[oi++]=y15+x15|0}function BlockMix(input,ii,out,oi,r){let head=oi+0;let tail=oi+16*r;for(let i=0;i<16;i++)out[tail+i]=input[ii+(2*r-1)*16+i];for(let i=0;i0)tail+=16;XorAndSalsa(out,head,input,ii+=16,out,tail)}}function scryptInit(password,salt,_opts){const opts=checkOpts({dkLen:32,asyncTick:10,maxmem:1024**3+1024},_opts);const{N,r,p,dkLen,asyncTick,maxmem,onProgress}=opts;number(N);number(r);number(p);number(dkLen);number(asyncTick);number(maxmem);if(onProgress!==undefined&&typeof onProgress!=="function")throw new Error("progressCb should be function");const blockSize=128*r;const blockSize32=blockSize/4;if(N<=1||(N&N-1)!==0||N>=2**(blockSize/8)||N>2**32){throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32")}if(p<0||p>(2**32-1)*32/blockSize){throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)")}if(dkLen<0||dkLen>(2**32-1)*32){throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32")}const memUsed=blockSize*(N+p);if(memUsed>maxmem){throw new Error(`Scrypt: parameters too large, ${memUsed} (128 * r * (N + p)) > ${maxmem} (maxmem)`)}const B=pbkdf2$1(sha256$1,password,salt,{c:1,dkLen:blockSize*p});const B32=u32(B);const V=u32(new Uint8Array(blockSize*N));const tmp=u32(new Uint8Array(blockSize));let blockMixCb=()=>{};if(onProgress){const totalBlockMix=2*N*p;const callbackPer=Math.max(Math.floor(totalBlockMix/1e4),1);let blockMixCnt=0;blockMixCb=()=>{blockMixCnt++;if(onProgress&&(!(blockMixCnt%callbackPer)||blockMixCnt===totalBlockMix))onProgress(blockMixCnt/totalBlockMix)}}return{N:N,r:r,p:p,dkLen:dkLen,blockSize32:blockSize32,V:V,B32:B32,B:B,tmp:tmp,blockMixCb:blockMixCb,asyncTick:asyncTick}}function scryptOutput(password,dkLen,B,V,tmp){const res=pbkdf2$1(sha256$1,password,B,{c:1,dkLen:dkLen});B.fill(0);V.fill(0);tmp.fill(0);return res}function scrypt$1(password,salt,opts){const{N,r,p,dkLen,blockSize32,V,B32,B,tmp,blockMixCb}=scryptInit(password,salt,opts);for(let pi=0;pi{BlockMix(V,pos,V,pos+=blockSize32,r);blockMixCb()});BlockMix(V,(N-1)*blockSize32,B32,Pi,r);blockMixCb();await asyncLoop(N,asyncTick,()=>{const j=B32[Pi+blockSize32-16]%N;for(let k=0;ka instanceof Uint8Array;const hexes=Array.from({length:256},(_,i)=>i.toString(16).padStart(2,"0"));function bytesToHex(bytes){if(!u8a(bytes))throw new Error("Uint8Array expected");let hex="";for(let i=0;isum+a.length,0));let pad=0;arrays.forEach(a=>{if(!u8a(a))throw new Error("Uint8Array expected");r.set(a,pad);pad+=a.length});return r}function equalBytes(b1,b2){if(b1.length!==b2.length)return false;for(let i=0;i_0n$3;n>>=_1n$4,len+=1);return len}function bitGet(n,pos){return n>>BigInt(pos)&_1n$4}const bitSet=(n,pos,value)=>{return n|(value?_1n$4:_0n$3)<(_2n$2<new Uint8Array(data);const u8fr=arr=>Uint8Array.from(arr);function createHmacDrbg(hashLen,qByteLen,hmacFn){if(typeof hashLen!=="number"||hashLen<2)throw new Error("hashLen must be a number");if(typeof qByteLen!=="number"||qByteLen<2)throw new Error("qByteLen must be a number");if(typeof hmacFn!=="function")throw new Error("hmacFn must be a function");let v=u8n(hashLen);let k=u8n(hashLen);let i=0;const reset=()=>{v.fill(1);k.fill(0);i=0};const h=(...b)=>hmacFn(k,v,...b);const reseed=(seed=u8n())=>{k=h(u8fr([0]),seed);v=h();if(seed.length===0)return;k=h(u8fr([1]),seed);v=h()};const gen=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let len=0;const out=[];while(len{reset();reseed(seed);let res=undefined;while(!(res=pred(gen())))reseed();reset();return res};return genUntil}const validatorFns={bigint:val=>typeof val==="bigint",function:val=>typeof val==="function",boolean:val=>typeof val==="boolean",string:val=>typeof val==="string",stringOrUint8Array:val=>typeof val==="string"||val instanceof Uint8Array,isSafeInteger:val=>Number.isSafeInteger(val),array:val=>Array.isArray(val),field:(val,object)=>object.Fp.isValid(val),hash:val=>typeof val==="function"&&Number.isSafeInteger(val.outputLen)};function validateObject(object,validators,optValidators={}){const checkField=(fieldName,type,isOptional)=>{const checkVal=validatorFns[type];if(typeof checkVal!=="function")throw new Error(`Invalid validator "${type}", expected function`);const val=object[fieldName];if(isOptional&&val===undefined)return;if(!checkVal(val,object)){throw new Error(`Invalid param ${String(fieldName)}=${val} (${typeof val}), expected ${type}`)}};for(const[fieldName,type]of Object.entries(validators))checkField(fieldName,type,false);for(const[fieldName,type]of Object.entries(optValidators))checkField(fieldName,type,true);return object}var ut=Object.freeze({__proto__:null,bitGet:bitGet,bitLen:bitLen,bitMask:bitMask,bitSet:bitSet,bytesToHex:bytesToHex,bytesToNumberBE:bytesToNumberBE,bytesToNumberLE:bytesToNumberLE,concatBytes:concatBytes,createHmacDrbg:createHmacDrbg,ensureBytes:ensureBytes,equalBytes:equalBytes,hexToBytes:hexToBytes,hexToNumber:hexToNumber,numberToBytesBE:numberToBytesBE,numberToBytesLE:numberToBytesLE,numberToHexUnpadded:numberToHexUnpadded,numberToVarBytesBE:numberToVarBytesBE,utf8ToBytes:utf8ToBytes,validateObject:validateObject});const _0n$2=BigInt(0),_1n$3=BigInt(1),_2n$1=BigInt(2),_3n$1=BigInt(3);const _4n=BigInt(4),_5n=BigInt(5),_8n=BigInt(8);BigInt(9);BigInt(16);function mod(a,b){const result=a%b;return result>=_0n$2?result:b+result}function pow(num,power,modulo){if(modulo<=_0n$2||power<_0n$2)throw new Error("Expected power/modulo > 0");if(modulo===_1n$3)return _0n$2;let res=_1n$3;while(power>_0n$2){if(power&_1n$3)res=res*num%modulo;num=num*num%modulo;power>>=_1n$3}return res}function pow2(x,power,modulo){let res=x;while(power-- >_0n$2){res*=res;res%=modulo}return res}function invert(number,modulo){if(number===_0n$2||modulo<=_0n$2){throw new Error(`invert: expected positive integers, got n=${number} mod=${modulo}`)}let a=mod(number,modulo);let b=modulo;let x=_0n$2,u=_1n$3;while(a!==_0n$2){const q=b/a;const r=b%a;const m=x-u*q;b=a,a=r,x=u,u=m}const gcd=b;if(gcd!==_1n$3)throw new Error("invert: does not exist");return mod(x,modulo)}function tonelliShanks(P){const legendreC=(P-_1n$3)/_2n$1;let Q,S,Z;for(Q=P-_1n$3,S=0;Q%_2n$1===_0n$2;Q/=_2n$1,S++);for(Z=_2n$1;Z{map[val]="function";return map},initial);return validateObject(field,opts)}function FpPow(f,num,power){if(power<_0n$2)throw new Error("Expected power > 0");if(power===_0n$2)return f.ONE;if(power===_1n$3)return num;let p=f.ONE;let d=num;while(power>_0n$2){if(power&_1n$3)p=f.mul(p,d);d=f.sqr(d);power>>=_1n$3}return p}function FpInvertBatch(f,nums){const tmp=new Array(nums.length);const lastMultiplied=nums.reduce((acc,num,i)=>{if(f.is0(num))return acc;tmp[i]=acc;return f.mul(acc,num)},f.ONE);const inverted=f.inv(lastMultiplied);nums.reduceRight((acc,num,i)=>{if(f.is0(num))return acc;tmp[i]=f.mul(acc,tmp[i]);return f.mul(acc,num)},inverted);return tmp}function nLength(n,nBitLength){const _nBitLength=nBitLength!==undefined?nBitLength:n.toString(2).length;const nByteLength=Math.ceil(_nBitLength/8);return{nBitLength:_nBitLength,nByteLength:nByteLength}}function Field(ORDER,bitLen,isLE=false,redef={}){if(ORDER<=_0n$2)throw new Error(`Expected Field ORDER > 0, got ${ORDER}`);const{nBitLength:BITS,nByteLength:BYTES}=nLength(ORDER,bitLen);if(BYTES>2048)throw new Error("Field lengths over 2048 bytes are not supported");const sqrtP=FpSqrt(ORDER);const f=Object.freeze({ORDER:ORDER,BITS:BITS,BYTES:BYTES,MASK:bitMask(BITS),ZERO:_0n$2,ONE:_1n$3,create:num=>mod(num,ORDER),isValid:num=>{if(typeof num!=="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof num}`);return _0n$2<=num&&numnum===_0n$2,isOdd:num=>(num&_1n$3)===_1n$3,neg:num=>mod(-num,ORDER),eql:(lhs,rhs)=>lhs===rhs,sqr:num=>mod(num*num,ORDER),add:(lhs,rhs)=>mod(lhs+rhs,ORDER),sub:(lhs,rhs)=>mod(lhs-rhs,ORDER),mul:(lhs,rhs)=>mod(lhs*rhs,ORDER),pow:(num,power)=>FpPow(f,num,power),div:(lhs,rhs)=>mod(lhs*invert(rhs,ORDER),ORDER),sqrN:num=>num*num,addN:(lhs,rhs)=>lhs+rhs,subN:(lhs,rhs)=>lhs-rhs,mulN:(lhs,rhs)=>lhs*rhs,inv:num=>invert(num,ORDER),sqrt:redef.sqrt||(n=>sqrtP(f,n)),invertBatch:lst=>FpInvertBatch(f,lst),cmov:(a,b,c)=>c?b:a,toBytes:num=>isLE?numberToBytesLE(num,BYTES):numberToBytesBE(num,BYTES),fromBytes:bytes=>{if(bytes.length!==BYTES)throw new Error(`Fp.fromBytes: expected ${BYTES}, got ${bytes.length}`);return isLE?bytesToNumberLE(bytes):bytesToNumberBE(bytes)}});return Object.freeze(f)}function getFieldBytesLength(fieldOrder){if(typeof fieldOrder!=="bigint")throw new Error("field order must be bigint");const bitLength=fieldOrder.toString(2).length;return Math.ceil(bitLength/8)}function getMinHashLength(fieldOrder){const length=getFieldBytesLength(fieldOrder);return length+Math.ceil(length/2)}function mapHashToField(key,fieldOrder,isLE=false){const len=key.length;const fieldLen=getFieldBytesLength(fieldOrder);const minLen=getMinHashLength(fieldOrder);if(len<16||len1024)throw new Error(`expected ${minLen}-1024 bytes of input, got ${len}`);const num=isLE?bytesToNumberBE(key):bytesToNumberLE(key);const reduced=mod(num,fieldOrder-_1n$3)+_1n$3;return isLE?numberToBytesLE(reduced,fieldLen):numberToBytesBE(reduced,fieldLen)}const _0n$1=BigInt(0);const _1n$2=BigInt(1);function wNAF(c,bits){const constTimeNegate=(condition,item)=>{const neg=item.negate();return condition?neg:item};const opts=W=>{const windows=Math.ceil(bits/W)+1;const windowSize=2**(W-1);return{windows:windows,windowSize:windowSize}};return{constTimeNegate:constTimeNegate,unsafeLadder(elm,n){let p=c.ZERO;let d=elm;while(n>_0n$1){if(n&_1n$2)p=p.add(d);d=d.double();n>>=_1n$2}return p},precomputeWindow(elm,W){const{windows,windowSize}=opts(W);const points=[];let p=elm;let base=p;for(let window=0;window>=shiftBy;if(wbits>windowSize){wbits-=maxNumber;n+=_1n$2}const offset1=offset;const offset2=offset+Math.abs(wbits)-1;const cond1=window%2!==0;const cond2=wbits<0;if(wbits===0){f=f.add(constTimeNegate(cond1,precomputes[offset1]))}else{p=p.add(constTimeNegate(cond2,precomputes[offset2]))}}return{p:p,f:f}},wNAFCached(P,precomputesMap,n,transform){const W=P._WINDOW_SIZE||1;let comp=precomputesMap.get(P);if(!comp){comp=this.precomputeWindow(P,W);if(W!==1){precomputesMap.set(P,transform(comp))}}return this.wNAF(W,comp,n)}}}function validateBasic(curve){validateField(curve.Fp);validateObject(curve,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"});return Object.freeze({...nLength(curve.n,curve.nBitLength),...curve,...{p:curve.Fp.ORDER}})}function validatePointOpts(curve){const opts=validateBasic(curve);validateObject(opts,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo,Fp,a}=opts;if(endo){if(!Fp.eql(a,Fp.ZERO)){throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0")}if(typeof endo!=="object"||typeof endo.beta!=="bigint"||typeof endo.splitScalar!=="function"){throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}}return Object.freeze({...opts})}const{bytesToNumberBE:b2n,hexToBytes:h2b}=ut;const DER={Err:class DERErr extends Error{constructor(m=""){super(m)}},_parseInt(data){const{Err:E}=DER;if(data.length<2||data[0]!==2)throw new E("Invalid signature integer tag");const len=data[1];const res=data.subarray(2,len+2);if(!len||res.length!==len)throw new E("Invalid signature integer: wrong length");if(res[0]&128)throw new E("Invalid signature integer: negative");if(res[0]===0&&!(res[1]&128))throw new E("Invalid signature integer: unnecessary leading zero");return{d:b2n(res),l:data.subarray(len+2)}},toSig(hex){const{Err:E}=DER;const data=typeof hex==="string"?h2b(hex):hex;if(!(data instanceof Uint8Array))throw new Error("ui8a expected");let l=data.length;if(l<2||data[0]!=48)throw new E("Invalid signature tag");if(data[1]!==l-2)throw new E("Invalid signature: incorrect length");const{d:r,l:sBytes}=DER._parseInt(data.subarray(2));const{d:s,l:rBytesLeft}=DER._parseInt(sBytes);if(rBytesLeft.length)throw new E("Invalid signature: left bytes after parsing");return{r:r,s:s}},hexFromSig(sig){const slice=s=>Number.parseInt(s[0],16)&8?"00"+s:s;const h=num=>{const hex=num.toString(16);return hex.length&1?`0${hex}`:hex};const s=slice(h(sig.s));const r=slice(h(sig.r));const shl=s.length/2;const rhl=r.length/2;const sl=h(shl);const rl=h(rhl);return`30${h(rhl+shl+4)}02${rl}${r}02${sl}${s}`}};const _0n=BigInt(0),_1n$1=BigInt(1);BigInt(2);const _3n=BigInt(3);BigInt(4);function weierstrassPoints(opts){const CURVE=validatePointOpts(opts);const{Fp}=CURVE;const toBytes=CURVE.toBytes||((_c,point,_isCompressed)=>{const a=point.toAffine();return concatBytes(Uint8Array.from([4]),Fp.toBytes(a.x),Fp.toBytes(a.y))});const fromBytes=CURVE.fromBytes||(bytes=>{const tail=bytes.subarray(1);const x=Fp.fromBytes(tail.subarray(0,Fp.BYTES));const y=Fp.fromBytes(tail.subarray(Fp.BYTES,2*Fp.BYTES));return{x:x,y:y}});function weierstrassEquation(x){const{a,b}=CURVE;const x2=Fp.sqr(x);const x3=Fp.mul(x2,x);return Fp.add(Fp.add(x3,Fp.mul(x,a)),b)}if(!Fp.eql(Fp.sqr(CURVE.Gy),weierstrassEquation(CURVE.Gx)))throw new Error("bad generator point: equation left != right");function isWithinCurveOrder(num){return typeof num==="bigint"&&_0nFp.eql(i,Fp.ZERO);if(is0(x)&&is0(y))return Point.ZERO;return new Point(x,y,Fp.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(points){const toInv=Fp.invertBatch(points.map(p=>p.pz));return points.map((p,i)=>p.toAffine(toInv[i])).map(Point.fromAffine)}static fromHex(hex){const P=Point.fromAffine(fromBytes(ensureBytes("pointHex",hex)));P.assertValidity();return P}static fromPrivateKey(privateKey){return Point.BASE.multiply(normPrivateKeyToScalar(privateKey))}_setWindowSize(windowSize){this._WINDOW_SIZE=windowSize;pointPrecomputes.delete(this)}assertValidity(){if(this.is0()){if(CURVE.allowInfinityPoint&&!Fp.is0(this.py))return;throw new Error("bad point: ZERO")}const{x,y}=this.toAffine();if(!Fp.isValid(x)||!Fp.isValid(y))throw new Error("bad point: x or y not FE");const left=Fp.sqr(y);const right=weierstrassEquation(x);if(!Fp.eql(left,right))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y}=this.toAffine();if(Fp.isOdd)return!Fp.isOdd(y);throw new Error("Field doesn't support isOdd")}equals(other){assertPrjPoint(other);const{px:X1,py:Y1,pz:Z1}=this;const{px:X2,py:Y2,pz:Z2}=other;const U1=Fp.eql(Fp.mul(X1,Z2),Fp.mul(X2,Z1));const U2=Fp.eql(Fp.mul(Y1,Z2),Fp.mul(Y2,Z1));return U1&&U2}negate(){return new Point(this.px,Fp.neg(this.py),this.pz)}double(){const{a,b}=CURVE;const b3=Fp.mul(b,_3n);const{px:X1,py:Y1,pz:Z1}=this;let X3=Fp.ZERO,Y3=Fp.ZERO,Z3=Fp.ZERO;let t0=Fp.mul(X1,X1);let t1=Fp.mul(Y1,Y1);let t2=Fp.mul(Z1,Z1);let t3=Fp.mul(X1,Y1);t3=Fp.add(t3,t3);Z3=Fp.mul(X1,Z1);Z3=Fp.add(Z3,Z3);X3=Fp.mul(a,Z3);Y3=Fp.mul(b3,t2);Y3=Fp.add(X3,Y3);X3=Fp.sub(t1,Y3);Y3=Fp.add(t1,Y3);Y3=Fp.mul(X3,Y3);X3=Fp.mul(t3,X3);Z3=Fp.mul(b3,Z3);t2=Fp.mul(a,t2);t3=Fp.sub(t0,t2);t3=Fp.mul(a,t3);t3=Fp.add(t3,Z3);Z3=Fp.add(t0,t0);t0=Fp.add(Z3,t0);t0=Fp.add(t0,t2);t0=Fp.mul(t0,t3);Y3=Fp.add(Y3,t0);t2=Fp.mul(Y1,Z1);t2=Fp.add(t2,t2);t0=Fp.mul(t2,t3);X3=Fp.sub(X3,t0);Z3=Fp.mul(t2,t1);Z3=Fp.add(Z3,Z3);Z3=Fp.add(Z3,Z3);return new Point(X3,Y3,Z3)}add(other){assertPrjPoint(other);const{px:X1,py:Y1,pz:Z1}=this;const{px:X2,py:Y2,pz:Z2}=other;let X3=Fp.ZERO,Y3=Fp.ZERO,Z3=Fp.ZERO;const a=CURVE.a;const b3=Fp.mul(CURVE.b,_3n);let t0=Fp.mul(X1,X2);let t1=Fp.mul(Y1,Y2);let t2=Fp.mul(Z1,Z2);let t3=Fp.add(X1,Y1);let t4=Fp.add(X2,Y2);t3=Fp.mul(t3,t4);t4=Fp.add(t0,t1);t3=Fp.sub(t3,t4);t4=Fp.add(X1,Z1);let t5=Fp.add(X2,Z2);t4=Fp.mul(t4,t5);t5=Fp.add(t0,t2);t4=Fp.sub(t4,t5);t5=Fp.add(Y1,Z1);X3=Fp.add(Y2,Z2);t5=Fp.mul(t5,X3);X3=Fp.add(t1,t2);t5=Fp.sub(t5,X3);Z3=Fp.mul(a,t4);X3=Fp.mul(b3,t2);Z3=Fp.add(X3,Z3);X3=Fp.sub(t1,Z3);Z3=Fp.add(t1,Z3);Y3=Fp.mul(X3,Z3);t1=Fp.add(t0,t0);t1=Fp.add(t1,t0);t2=Fp.mul(a,t2);t4=Fp.mul(b3,t4);t1=Fp.add(t1,t2);t2=Fp.sub(t0,t2);t2=Fp.mul(a,t2);t4=Fp.add(t4,t2);t0=Fp.mul(t1,t4);Y3=Fp.add(Y3,t0);t0=Fp.mul(t5,t4);X3=Fp.mul(t3,X3);X3=Fp.sub(X3,t0);t0=Fp.mul(t3,t1);Z3=Fp.mul(t5,Z3);Z3=Fp.add(Z3,t0);return new Point(X3,Y3,Z3)}subtract(other){return this.add(other.negate())}is0(){return this.equals(Point.ZERO)}wNAF(n){return wnaf.wNAFCached(this,pointPrecomputes,n,comp=>{const toInv=Fp.invertBatch(comp.map(p=>p.pz));return comp.map((p,i)=>p.toAffine(toInv[i])).map(Point.fromAffine)})}multiplyUnsafe(n){const I=Point.ZERO;if(n===_0n)return I;assertGE(n);if(n===_1n$1)return this;const{endo}=CURVE;if(!endo)return wnaf.unsafeLadder(this,n);let{k1neg,k1,k2neg,k2}=endo.splitScalar(n);let k1p=I;let k2p=I;let d=this;while(k1>_0n||k2>_0n){if(k1&_1n$1)k1p=k1p.add(d);if(k2&_1n$1)k2p=k2p.add(d);d=d.double();k1>>=_1n$1;k2>>=_1n$1}if(k1neg)k1p=k1p.negate();if(k2neg)k2p=k2p.negate();k2p=new Point(Fp.mul(k2p.px,endo.beta),k2p.py,k2p.pz);return k1p.add(k2p)}multiply(scalar){assertGE(scalar);let n=scalar;let point,fake;const{endo}=CURVE;if(endo){const{k1neg,k1,k2neg,k2}=endo.splitScalar(n);let{p:k1p,f:f1p}=this.wNAF(k1);let{p:k2p,f:f2p}=this.wNAF(k2);k1p=wnaf.constTimeNegate(k1neg,k1p);k2p=wnaf.constTimeNegate(k2neg,k2p);k2p=new Point(Fp.mul(k2p.px,endo.beta),k2p.py,k2p.pz);point=k1p.add(k2p);fake=f1p.add(f2p)}else{const{p,f}=this.wNAF(n);point=p;fake=f}return Point.normalizeZ([point,fake])[0]}multiplyAndAddUnsafe(Q,a,b){const G=Point.BASE;const mul=(P,a)=>a===_0n||a===_1n$1||!P.equals(G)?P.multiplyUnsafe(a):P.multiply(a);const sum=mul(this,a).add(mul(Q,b));return sum.is0()?undefined:sum}toAffine(iz){const{px:x,py:y,pz:z}=this;const is0=this.is0();if(iz==null)iz=is0?Fp.ONE:Fp.inv(z);const ax=Fp.mul(x,iz);const ay=Fp.mul(y,iz);const zz=Fp.mul(z,iz);if(is0)return{x:Fp.ZERO,y:Fp.ZERO};if(!Fp.eql(zz,Fp.ONE))throw new Error("invZ was invalid");return{x:ax,y:ay}}isTorsionFree(){const{h:cofactor,isTorsionFree}=CURVE;if(cofactor===_1n$1)return true;if(isTorsionFree)return isTorsionFree(Point,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:cofactor,clearCofactor}=CURVE;if(cofactor===_1n$1)return this;if(clearCofactor)return clearCofactor(Point,this);return this.multiplyUnsafe(CURVE.h)}toRawBytes(isCompressed=true){this.assertValidity();return toBytes(Point,this,isCompressed)}toHex(isCompressed=true){return bytesToHex(this.toRawBytes(isCompressed))}}Point.BASE=new Point(CURVE.Gx,CURVE.Gy,Fp.ONE);Point.ZERO=new Point(Fp.ZERO,Fp.ONE,Fp.ZERO);const _bits=CURVE.nBitLength;const wnaf=wNAF(Point,CURVE.endo?Math.ceil(_bits/2):_bits);return{CURVE:CURVE,ProjectivePoint:Point,normPrivateKeyToScalar:normPrivateKeyToScalar,weierstrassEquation:weierstrassEquation,isWithinCurveOrder:isWithinCurveOrder}}function validateOpts(curve){const opts=validateBasic(curve);validateObject(opts,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"});return Object.freeze({lowS:true,...opts})}function weierstrass(curveDef){const CURVE=validateOpts(curveDef);const{Fp,n:CURVE_ORDER}=CURVE;const compressedLen=Fp.BYTES+1;const uncompressedLen=2*Fp.BYTES+1;function isValidFieldElement(num){return _0nbytesToHex(numberToBytesBE(num,CURVE.nByteLength));function isBiggerThanHalfOrder(number){const HALF=CURVE_ORDER>>_1n$1;return number>HALF}function normalizeS(s){return isBiggerThanHalfOrder(s)?modN(-s):s}const slcNum=(b,from,to)=>bytesToNumberBE(b.slice(from,to));class Signature{constructor(r,s,recovery){this.r=r;this.s=s;this.recovery=recovery;this.assertValidity()}static fromCompact(hex){const l=CURVE.nByteLength;hex=ensureBytes("compactSignature",hex,l*2);return new Signature(slcNum(hex,0,l),slcNum(hex,l,2*l))}static fromDER(hex){const{r,s}=DER.toSig(ensureBytes("DER",hex));return new Signature(r,s)}assertValidity(){if(!isWithinCurveOrder(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!isWithinCurveOrder(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(recovery){return new Signature(this.r,this.s,recovery)}recoverPublicKey(msgHash){const{r,s,recovery:rec}=this;const h=bits2int_modN(ensureBytes("msgHash",msgHash));if(rec==null||![0,1,2,3].includes(rec))throw new Error("recovery id invalid");const radj=rec===2||rec===3?r+CURVE.n:r;if(radj>=Fp.ORDER)throw new Error("recovery id 2 or 3 invalid");const prefix=(rec&1)===0?"02":"03";const R=Point.fromHex(prefix+numToNByteStr(radj));const ir=invN(radj);const u1=modN(-h*ir);const u2=modN(s*ir);const Q=Point.BASE.multiplyAndAddUnsafe(R,u1,u2);if(!Q)throw new Error("point at infinify");Q.assertValidity();return Q}hasHighS(){return isBiggerThanHalfOrder(this.s)}normalizeS(){return this.hasHighS()?new Signature(this.r,modN(-this.s),this.recovery):this}toDERRawBytes(){return hexToBytes(this.toDERHex())}toDERHex(){return DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return hexToBytes(this.toCompactHex())}toCompactHex(){return numToNByteStr(this.r)+numToNByteStr(this.s)}}const utils={isValidPrivateKey(privateKey){try{normPrivateKeyToScalar(privateKey);return true}catch(error){return false}},normPrivateKeyToScalar:normPrivateKeyToScalar,randomPrivateKey:()=>{const length=getMinHashLength(CURVE.n);return mapHashToField(CURVE.randomBytes(length),CURVE.n)},precompute(windowSize=8,point=Point.BASE){point._setWindowSize(windowSize);point.multiply(BigInt(3));return point}};function getPublicKey(privateKey,isCompressed=true){return Point.fromPrivateKey(privateKey).toRawBytes(isCompressed)}function isProbPub(item){const arr=item instanceof Uint8Array;const str=typeof item==="string";const len=(arr||str)&&item.length;if(arr)return len===compressedLen||len===uncompressedLen;if(str)return len===2*compressedLen||len===2*uncompressedLen;if(item instanceof Point)return true;return false}function getSharedSecret(privateA,publicB,isCompressed=true){if(isProbPub(privateA))throw new Error("first arg must be private key");if(!isProbPub(publicB))throw new Error("second arg must be public key");const b=Point.fromHex(publicB);return b.multiply(normPrivateKeyToScalar(privateA)).toRawBytes(isCompressed)}const bits2int=CURVE.bits2int||function(bytes){const num=bytesToNumberBE(bytes);const delta=bytes.length*8-CURVE.nBitLength;return delta>0?num>>BigInt(delta):num};const bits2int_modN=CURVE.bits2int_modN||function(bytes){return modN(bits2int(bytes))};const ORDER_MASK=bitMask(CURVE.nBitLength);function int2octets(num){if(typeof num!=="bigint")throw new Error("bigint expected");if(!(_0n<=num&&numk in opts))throw new Error("sign() legacy options not supported");const{hash,randomBytes}=CURVE;let{lowS,prehash,extraEntropy:ent}=opts;if(lowS==null)lowS=true;msgHash=ensureBytes("msgHash",msgHash);if(prehash)msgHash=ensureBytes("prehashed msgHash",hash(msgHash));const h1int=bits2int_modN(msgHash);const d=normPrivateKeyToScalar(privateKey);const seedArgs=[int2octets(d),int2octets(h1int)];if(ent!=null){const e=ent===true?randomBytes(Fp.BYTES):ent;seedArgs.push(ensureBytes("extraEntropy",e))}const seed=concatBytes(...seedArgs);const m=h1int;function k2sig(kBytes){const k=bits2int(kBytes);if(!isWithinCurveOrder(k))return;const ik=invN(k);const q=Point.BASE.multiply(k).toAffine();const r=modN(q.x);if(r===_0n)return;const s=modN(ik*modN(m+r*d));if(s===_0n)return;let recovery=(q.x===r?0:2)|Number(q.y&_1n$1);let normS=s;if(lowS&&isBiggerThanHalfOrder(s)){normS=normalizeS(s);recovery^=1}return new Signature(r,normS,recovery)}return{seed:seed,k2sig:k2sig}}const defaultSigOpts={lowS:CURVE.lowS,prehash:false};const defaultVerOpts={lowS:CURVE.lowS,prehash:false};function sign(msgHash,privKey,opts=defaultSigOpts){const{seed,k2sig}=prepSig(msgHash,privKey,opts);const C=CURVE;const drbg=createHmacDrbg(C.hash.outputLen,C.nByteLength,C.hmac);return drbg(seed,k2sig)}Point.BASE._setWindowSize(8);function verify(signature,msgHash,publicKey,opts=defaultVerOpts){const sg=signature;msgHash=ensureBytes("msgHash",msgHash);publicKey=ensureBytes("publicKey",publicKey);if("strict"in opts)throw new Error("options.strict was renamed to lowS");const{lowS,prehash}=opts;let _sig=undefined;let P;try{if(typeof sg==="string"||sg instanceof Uint8Array){try{_sig=Signature.fromDER(sg)}catch(derError){if(!(derError instanceof DER.Err))throw derError;_sig=Signature.fromCompact(sg)}}else if(typeof sg==="object"&&typeof sg.r==="bigint"&&typeof sg.s==="bigint"){const{r,s}=sg;_sig=new Signature(r,s)}else{throw new Error("PARSE")}P=Point.fromHex(publicKey)}catch(error){if(error.message==="PARSE")throw new Error(`signature must be Signature instance, Uint8Array or hex string`);return false}if(lowS&&_sig.hasHighS())return false;if(prehash)msgHash=CURVE.hash(msgHash);const{r,s}=_sig;const h=bits2int_modN(msgHash);const is=invN(s);const u1=modN(h*is);const u2=modN(r*is);const R=Point.BASE.multiplyAndAddUnsafe(P,u1,u2)?.toAffine();if(!R)return false;const v=modN(R.x);return v===r}return{CURVE:CURVE,getPublicKey:getPublicKey,getSharedSecret:getSharedSecret,sign:sign,verify:verify,ProjectivePoint:Point,Signature:Signature,utils:utils}}function getHash(hash){return{hash:hash,hmac:(key,...msgs)=>hmac(hash,key,concatBytes$1(...msgs)),randomBytes:randomBytes$2}}function createCurve(curveDef,defHash){const create=hash=>weierstrass({...curveDef,...getHash(hash)});return Object.freeze({...create(defHash),create:create})}const secp256k1P=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f");const secp256k1N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");const _1n=BigInt(1);const _2n=BigInt(2);const divNearest=(a,b)=>(a+b/_2n)/b;function sqrtMod(y){const P=secp256k1P;const _3n=BigInt(3),_6n=BigInt(6),_11n=BigInt(11),_22n=BigInt(22);const _23n=BigInt(23),_44n=BigInt(44),_88n=BigInt(88);const b2=y*y*y%P;const b3=b2*b2*y%P;const b6=pow2(b3,_3n,P)*b3%P;const b9=pow2(b6,_3n,P)*b3%P;const b11=pow2(b9,_2n,P)*b2%P;const b22=pow2(b11,_11n,P)*b11%P;const b44=pow2(b22,_22n,P)*b22%P;const b88=pow2(b44,_44n,P)*b44%P;const b176=pow2(b88,_88n,P)*b88%P;const b220=pow2(b176,_44n,P)*b44%P;const b223=pow2(b220,_3n,P)*b3%P;const t1=pow2(b223,_23n,P)*b22%P;const t2=pow2(t1,_6n,P)*b2%P;const root=pow2(t2,_2n,P);if(!Fp.eql(Fp.sqr(root),y))throw new Error("Cannot find square root");return root}const Fp=Field(secp256k1P,undefined,undefined,{sqrt:sqrtMod});const secp256k1=createCurve({a:BigInt(0),b:BigInt(7),Fp:Fp,n:secp256k1N,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:true,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:k=>{const n=secp256k1N;const a1=BigInt("0x3086d221a7d46bcde86c90e49284eb15");const b1=-_1n*BigInt("0xe4437ed6010e88286f547fa90abfe4c3");const a2=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8");const b2=a1;const POW_2_128=BigInt("0x100000000000000000000000000000000");const c1=divNearest(b2*k,n);const c2=divNearest(-b1*k,n);let k1=mod(k-c1*a1-c2*a2,n);let k2=mod(-c1*b1-c2*b2,n);const k1neg=k1>POW_2_128;const k2neg=k2>POW_2_128;if(k1neg)k1=n-k1;if(k2neg)k2=n-k2;if(k1>POW_2_128||k2>POW_2_128){throw new Error("splitScalar: Endomorphism failed, k="+k)}return{k1neg:k1neg,k1:k1,k2neg:k2neg,k2:k2}}}},sha256$1);BigInt(0);secp256k1.ProjectivePoint;const ZeroAddress="0x0000000000000000000000000000000000000000";const ZeroHash="0x0000000000000000000000000000000000000000000000000000000000000000";const N$1=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");const WeiPerEther=BigInt("1000000000000000000");const MaxUint256=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const MinInt256=BigInt("0x8000000000000000000000000000000000000000000000000000000000000000")*BigInt(-1);const MaxInt256=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const EtherSymbol="Ξ";const MessagePrefix="Ethereum Signed Message:\n";const BN_0$7=BigInt(0);const BN_1$3=BigInt(1);const BN_2$3=BigInt(2);const BN_27$1=BigInt(27);const BN_28$1=BigInt(28);const BN_35$1=BigInt(35);const BN_N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");const BN_N_2=BN_N/BN_2$3;const inspect$1=Symbol.for("nodejs.util.inspect.custom");const _guard$3={};function toUint256(value){return zeroPadValue(toBeArray(value),32)}class Signature{#r;#s;#v;#networkV;get r(){return this.#r}set r(value){assertArgument(dataLength(value)===32,"invalid r","value",value);this.#r=hexlify(value)}get s(){assertArgument(parseInt(this.#s.substring(0,3))<8,"non-canonical s; use ._s","s",this.#s);return this.#s}set s(_value){assertArgument(dataLength(_value)===32,"invalid s","value",_value);this.#s=hexlify(_value)}get _s(){return this.#s}isValid(){const s=BigInt(this.#s);return s<=BN_N_2}get v(){return this.#v}set v(value){const v=getNumber(value,"value");assertArgument(v===27||v===28,"invalid v","v",value);this.#v=v}get networkV(){return this.#networkV}get legacyChainId(){const v=this.networkV;if(v==null){return null}return Signature.getChainId(v)}get yParity(){return this.v===27?0:1}get yParityAndS(){const yParityAndS=getBytes(this.s);if(this.yParity){yParityAndS[0]|=128}return hexlify(yParityAndS)}get compactSerialized(){return concat([this.r,this.yParityAndS])}get serialized(){return concat([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(guard,r,s,v){assertPrivate(guard,_guard$3,"Signature");this.#r=r;this.#s=s;this.#v=v;this.#networkV=null}getCanonical(){if(this.isValid()){return this}const s=BN_N-BigInt(this._s);const v=55-this.v;const result=new Signature(_guard$3,this.r,toUint256(s),v);if(this.networkV){result.#networkV=this.networkV}return result}clone(){const clone=new Signature(_guard$3,this.r,this._s,this.v);if(this.networkV){clone.#networkV=this.networkV}return clone}toJSON(){const networkV=this.networkV;return{_type:"signature",networkV:networkV!=null?networkV.toString():null,r:this.r,s:this._s,v:this.v}}[inspect$1](){return this.toString()}toString(){if(this.isValid()){return`Signature { r: ${this.r}, s: ${this._s}, v: ${this.v} }`}return`Signature { r: ${this.r}, s: ${this._s}, v: ${this.v}, valid: false }`}static getChainId(v){const bv=getBigInt(v,"v");if(bv==BN_27$1||bv==BN_28$1){return BN_0$7}assertArgument(bv>=BN_35$1,"invalid EIP-155 v","v",v);return(bv-BN_35$1)/BN_2$3}static getChainIdV(chainId,v){return getBigInt(chainId)*BN_2$3+BigInt(35+v-27)}static getNormalizedV(v){const bv=getBigInt(v);if(bv===BN_0$7||bv===BN_27$1){return 27}if(bv===BN_1$3||bv===BN_28$1){return 28}assertArgument(bv>=BN_35$1,"invalid v","v",v);return bv&BN_1$3?27:28}static from(sig){function assertError(check,message){assertArgument(check,message,"signature",sig)}if(sig==null){return new Signature(_guard$3,ZeroHash,ZeroHash,27)}if(typeof sig==="string"){const bytes=getBytes(sig,"signature");if(bytes.length===64){const r=hexlify(bytes.slice(0,32));const s=bytes.slice(32,64);const v=s[0]&128?28:27;s[0]&=127;return new Signature(_guard$3,r,hexlify(s),v)}if(bytes.length===65){const r=hexlify(bytes.slice(0,32));const s=hexlify(bytes.slice(32,64));const v=Signature.getNormalizedV(bytes[64]);return new Signature(_guard$3,r,s,v)}assertError(false,"invalid raw signature length")}if(sig instanceof Signature){return sig.clone()}const _r=sig.r;assertError(_r!=null,"missing r");const r=toUint256(_r);const s=function(s,yParityAndS){if(s!=null){return toUint256(s)}if(yParityAndS!=null){assertError(isHexString(yParityAndS,32),"invalid yParityAndS");const bytes=getBytes(yParityAndS);bytes[0]&=127;return hexlify(bytes)}assertError(false,"missing s")}(sig.s,sig.yParityAndS);const{networkV,v}=function(_v,yParityAndS,yParity){if(_v!=null){const v=getBigInt(_v);return{networkV:v>=BN_35$1?v:undefined,v:Signature.getNormalizedV(v)}}if(yParityAndS!=null){assertError(isHexString(yParityAndS,32),"invalid yParityAndS");return{v:getBytes(yParityAndS)[0]&128?28:27}}if(yParity!=null){switch(getNumber(yParity,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}assertError(false,"invalid yParity")}assertError(false,"missing v")}(sig.v,sig.yParityAndS,sig.yParity);const result=new Signature(_guard$3,r,s,v);if(networkV){result.#networkV=networkV}assertError(sig.yParity==null||getNumber(sig.yParity,"sig.yParity")===result.yParity,"yParity mismatch");assertError(sig.yParityAndS==null||sig.yParityAndS===result.yParityAndS,"yParityAndS mismatch");return result}}class SigningKey{#privateKey;constructor(privateKey){assertArgument(dataLength(privateKey)===32,"invalid private key","privateKey","[REDACTED]");this.#privateKey=hexlify(privateKey)}get privateKey(){return this.#privateKey}get publicKey(){return SigningKey.computePublicKey(this.#privateKey)}get compressedPublicKey(){return SigningKey.computePublicKey(this.#privateKey,true)}sign(digest){assertArgument(dataLength(digest)===32,"invalid digest length","digest",digest);const sig=secp256k1.sign(getBytesCopy(digest),getBytesCopy(this.#privateKey),{lowS:true});return Signature.from({r:toBeHex(sig.r,32),s:toBeHex(sig.s,32),v:sig.recovery?28:27})}computeSharedSecret(other){const pubKey=SigningKey.computePublicKey(other);return hexlify(secp256k1.getSharedSecret(getBytesCopy(this.#privateKey),getBytes(pubKey),false))}static computePublicKey(key,compressed){let bytes=getBytes(key,"key");if(bytes.length===32){const pubKey=secp256k1.getPublicKey(bytes,!!compressed);return hexlify(pubKey)}if(bytes.length===64){const pub=new Uint8Array(65);pub[0]=4;pub.set(bytes,1);bytes=pub}const point=secp256k1.ProjectivePoint.fromHex(bytes);return hexlify(point.toRawBytes(compressed))}static recoverPublicKey(digest,signature){assertArgument(dataLength(digest)===32,"invalid digest length","digest",digest);const sig=Signature.from(signature);let secpSig=secp256k1.Signature.fromCompact(getBytesCopy(concat([sig.r,sig.s])));secpSig=secpSig.addRecoveryBit(sig.yParity);const pubKey=secpSig.recoverPublicKey(getBytesCopy(digest));assertArgument(pubKey!=null,"invalid signature for digest","signature",signature);return"0x"+pubKey.toHex(false)}static addPoints(p0,p1,compressed){const pub0=secp256k1.ProjectivePoint.fromHex(SigningKey.computePublicKey(p0).substring(2));const pub1=secp256k1.ProjectivePoint.fromHex(SigningKey.computePublicKey(p1).substring(2));return"0x"+pub0.add(pub1).toHex(!!compressed)}}function lock(){computeHmac.lock();keccak256.lock();pbkdf2.lock();randomBytes.lock();ripemd160.lock();scrypt.lock();scryptSync.lock();sha256.lock();sha512.lock();randomBytes.lock()}const BN_0$6=BigInt(0);const BN_36=BigInt(36);function getChecksumAddress(address){address=address.toLowerCase();const chars=address.substring(2).split("");const expanded=new Uint8Array(40);for(let i=0;i<40;i++){expanded[i]=chars[i].charCodeAt(0)}const hashed=getBytes(keccak256(expanded));for(let i=0;i<40;i+=2){if(hashed[i>>1]>>4>=8){chars[i]=chars[i].toUpperCase()}if((hashed[i>>1]&15)>=8){chars[i+1]=chars[i+1].toUpperCase()}}return"0x"+chars.join("")}const ibanLookup={};for(let i=0;i<10;i++){ibanLookup[String(i)]=String(i)}for(let i=0;i<26;i++){ibanLookup[String.fromCharCode(65+i)]=String(10+i)}const safeDigits=15;function ibanChecksum(address){address=address.toUpperCase();address=address.substring(4)+address.substring(0,2)+"00";let expanded=address.split("").map(c=>{return ibanLookup[c]}).join("");while(expanded.length>=safeDigits){let block=expanded.substring(0,safeDigits);expanded=parseInt(block,10)%97+expanded.substring(block.length)}let checksum=String(98-parseInt(expanded,10)%97);while(checksum.length<2){checksum="0"+checksum}return checksum}const Base36=function(){const result={};for(let i=0;i<36;i++){const key="0123456789abcdefghijklmnopqrstuvwxyz"[i];result[key]=BigInt(i)}return result}();function fromBase36(value){value=value.toLowerCase();let result=BN_0$6;for(let i=0;iv.format()).join(",")})`}return this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple"){throw TypeError("not a tuple")}return this.#options}get arrayLength(){if(this.type!=="array"){throw TypeError("not an array")}if(this.#options===true){return-1}if(this.#options===false){return this.value.length}return null}static from(type,value){return new Typed(_gaurd,type,value)}static uint8(v){return n(v,8)}static uint16(v){return n(v,16)}static uint24(v){return n(v,24)}static uint32(v){return n(v,32)}static uint40(v){return n(v,40)}static uint48(v){return n(v,48)}static uint56(v){return n(v,56)}static uint64(v){return n(v,64)}static uint72(v){return n(v,72)}static uint80(v){return n(v,80)}static uint88(v){return n(v,88)}static uint96(v){return n(v,96)}static uint104(v){return n(v,104)}static uint112(v){return n(v,112)}static uint120(v){return n(v,120)}static uint128(v){return n(v,128)}static uint136(v){return n(v,136)}static uint144(v){return n(v,144)}static uint152(v){return n(v,152)}static uint160(v){return n(v,160)}static uint168(v){return n(v,168)}static uint176(v){return n(v,176)}static uint184(v){return n(v,184)}static uint192(v){return n(v,192)}static uint200(v){return n(v,200)}static uint208(v){return n(v,208)}static uint216(v){return n(v,216)}static uint224(v){return n(v,224)}static uint232(v){return n(v,232)}static uint240(v){return n(v,240)}static uint248(v){return n(v,248)}static uint256(v){return n(v,256)}static uint(v){return n(v,256)}static int8(v){return n(v,-8)}static int16(v){return n(v,-16)}static int24(v){return n(v,-24)}static int32(v){return n(v,-32)}static int40(v){return n(v,-40)}static int48(v){return n(v,-48)}static int56(v){return n(v,-56)}static int64(v){return n(v,-64)}static int72(v){return n(v,-72)}static int80(v){return n(v,-80)}static int88(v){return n(v,-88)}static int96(v){return n(v,-96)}static int104(v){return n(v,-104)}static int112(v){return n(v,-112)}static int120(v){return n(v,-120)}static int128(v){return n(v,-128)}static int136(v){return n(v,-136)}static int144(v){return n(v,-144)}static int152(v){return n(v,-152)}static int160(v){return n(v,-160)}static int168(v){return n(v,-168)}static int176(v){return n(v,-176)}static int184(v){return n(v,-184)}static int192(v){return n(v,-192)}static int200(v){return n(v,-200)}static int208(v){return n(v,-208)}static int216(v){return n(v,-216)}static int224(v){return n(v,-224)}static int232(v){return n(v,-232)}static int240(v){return n(v,-240)}static int248(v){return n(v,-248)}static int256(v){return n(v,-256)}static int(v){return n(v,-256)}static bytes1(v){return b(v,1)}static bytes2(v){return b(v,2)}static bytes3(v){return b(v,3)}static bytes4(v){return b(v,4)}static bytes5(v){return b(v,5)}static bytes6(v){return b(v,6)}static bytes7(v){return b(v,7)}static bytes8(v){return b(v,8)}static bytes9(v){return b(v,9)}static bytes10(v){return b(v,10)}static bytes11(v){return b(v,11)}static bytes12(v){return b(v,12)}static bytes13(v){return b(v,13)}static bytes14(v){return b(v,14)}static bytes15(v){return b(v,15)}static bytes16(v){return b(v,16)}static bytes17(v){return b(v,17)}static bytes18(v){return b(v,18)}static bytes19(v){return b(v,19)}static bytes20(v){return b(v,20)}static bytes21(v){return b(v,21)}static bytes22(v){return b(v,22)}static bytes23(v){return b(v,23)}static bytes24(v){return b(v,24)}static bytes25(v){return b(v,25)}static bytes26(v){return b(v,26)}static bytes27(v){return b(v,27)}static bytes28(v){return b(v,28)}static bytes29(v){return b(v,29)}static bytes30(v){return b(v,30)}static bytes31(v){return b(v,31)}static bytes32(v){return b(v,32)}static address(v){return new Typed(_gaurd,"address",v)}static bool(v){return new Typed(_gaurd,"bool",!!v)}static bytes(v){return new Typed(_gaurd,"bytes",v)}static string(v){return new Typed(_gaurd,"string",v)}static array(v,dynamic){throw new Error("not implemented yet")}static tuple(v,name){throw new Error("not implemented yet")}static overrides(v){return new Typed(_gaurd,"overrides",Object.assign({},v))}static isTyped(value){return value&&typeof value==="object"&&"_typedSymbol"in value&&value._typedSymbol===_typedSymbol}static dereference(value,type){if(Typed.isTyped(value)){if(value.type!==type){throw new Error(`invalid type: expecetd ${type}, got ${value.type}`)}return value.value}return value}}class AddressCoder extends Coder{constructor(localName){super("address","address",localName,false)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(writer,_value){let value=Typed.dereference(_value,"string");try{value=getAddress(value)}catch(error){return this._throwError(error.message,_value)}return writer.writeValue(value)}decode(reader){return getAddress(toBeHex(reader.readValue(),20))}}class AnonymousCoder extends Coder{coder;constructor(coder){super(coder.name,coder.type,"_",coder.dynamic);this.coder=coder}defaultValue(){return this.coder.defaultValue()}encode(writer,value){return this.coder.encode(writer,value)}decode(reader){return this.coder.decode(reader)}}function pack(writer,coders,values){let arrayValues=[];if(Array.isArray(values)){arrayValues=values}else if(values&&typeof values==="object"){let unique={};arrayValues=coders.map(coder=>{const name=coder.localName;assert(name,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:coder},value:values});assert(!unique[name],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:coder},value:values});unique[name]=true;return values[name]})}else{assertArgument(false,"invalid tuple value","tuple",values)}assertArgument(coders.length===arrayValues.length,"types/value length mismatch","tuple",values);let staticWriter=new Writer;let dynamicWriter=new Writer;let updateFuncs=[];coders.forEach((coder,index)=>{let value=arrayValues[index];if(coder.dynamic){let dynamicOffset=dynamicWriter.length;coder.encode(dynamicWriter,value);let updateFunc=staticWriter.writeUpdatableValue();updateFuncs.push(baseOffset=>{updateFunc(baseOffset+dynamicOffset)})}else{coder.encode(staticWriter,value)}});updateFuncs.forEach(func=>{func(staticWriter.length)});let length=writer.appendWriter(staticWriter);length+=writer.appendWriter(dynamicWriter);return length}function unpack(reader,coders){let values=[];let keys=[];let baseReader=reader.subReader(0);coders.forEach(coder=>{let value=null;if(coder.dynamic){let offset=reader.readIndex();let offsetReader=baseReader.subReader(offset);try{value=coder.decode(offsetReader)}catch(error){if(isError(error,"BUFFER_OVERRUN")){throw error}value=error;value.baseType=coder.name;value.name=coder.localName;value.type=coder.type}}else{try{value=coder.decode(reader)}catch(error){if(isError(error,"BUFFER_OVERRUN")){throw error}value=error;value.baseType=coder.name;value.name=coder.localName;value.type=coder.type}}if(value==undefined){throw new Error("investigate")}values.push(value);keys.push(coder.localName||null)});return Result.fromItems(values,keys)}class ArrayCoder extends Coder{coder;length;constructor(coder,length,localName){const type=coder.type+"["+(length>=0?length:"")+"]";const dynamic=length===-1||coder.dynamic;super("array",type,localName,dynamic);defineProperties(this,{coder:coder,length:length})}defaultValue(){const defaultChild=this.coder.defaultValue();const result=[];for(let i=0;ibounds||value<-(bounds+BN_1$2)){this._throwError("value out-of-bounds",_value)}value=toTwos(value,8*WordSize)}else if(valuemask(maxUintValue,this.size*8)){this._throwError("value out-of-bounds",_value)}return writer.writeValue(value)}decode(reader){let value=mask(reader.readValue(),this.size*8);if(this.signed){value=fromTwos(value,this.size*8)}return value}}class StringCoder extends DynamicBytesCoder{constructor(localName){super("string",localName)}defaultValue(){return""}encode(writer,_value){return super.encode(writer,toUtf8Bytes(Typed.dereference(_value,"string")))}decode(reader){return toUtf8String(super.decode(reader))}}class TupleCoder extends Coder{coders;constructor(coders,localName){let dynamic=false;const types=[];coders.forEach(coder=>{if(coder.dynamic){dynamic=true}types.push(coder.type)});const type="tuple("+types.join(",")+")";super("tuple",type,localName,dynamic);defineProperties(this,{coders:Object.freeze(coders.slice())})}defaultValue(){const values=[];this.coders.forEach(coder=>{values.push(coder.defaultValue())});const uniqueNames=this.coders.reduce((accum,coder)=>{const name=coder.localName;if(name){if(!accum[name]){accum[name]=0}accum[name]++}return accum},{});this.coders.forEach((coder,index)=>{let name=coder.localName;if(!name||uniqueNames[name]!==1){return}if(name==="length"){name="_length"}if(values[name]!=null){return}values[name]=values[index]});return Object.freeze(values)}encode(writer,_value){const value=Typed.dereference(_value,"tuple");return pack(writer,this.coders,value)}decode(reader){return unpack(reader,this.coders)}}function accessSetify(addr,storageKeys){return{address:getAddress(addr),storageKeys:storageKeys.map((storageKey,index)=>{assertArgument(isHexString(storageKey,32),"invalid slot",`storageKeys[${index}]`,storageKey);return storageKey.toLowerCase()})}}function accessListify(value){if(Array.isArray(value)){return value.map((set,index)=>{if(Array.isArray(set)){assertArgument(set.length===2,"invalid slot set",`value[${index}]`,set);return accessSetify(set[0],set[1])}assertArgument(set!=null&&typeof set==="object","invalid address-slot set","value",value);return accessSetify(set.address,set.storageKeys)})}assertArgument(value!=null&&typeof value==="object","invalid access list","value",value);const result=Object.keys(value).map(addr=>{const storageKeys=value[addr].reduce((accum,storageKey)=>{accum[storageKey]=true;return accum},{});return accessSetify(addr,Object.keys(storageKeys).sort())});result.sort((a,b)=>a.address.localeCompare(b.address));return result}function authorizationify(auth){return{address:getAddress(auth.address),nonce:getBigInt(auth.nonce!=null?auth.nonce:0),chainId:getBigInt(auth.chainId!=null?auth.chainId:0),signature:Signature.from(auth.signature)}}function computeAddress(key){let pubkey;if(typeof key==="string"){pubkey=SigningKey.computePublicKey(key,false)}else{pubkey=key.publicKey}return getAddress(keccak256("0x"+pubkey.substring(4)).substring(26))}function recoverAddress(digest,signature){return computeAddress(SigningKey.recoverPublicKey(digest,signature))}const BN_0$4=BigInt(0);const BN_2$2=BigInt(2);const BN_27=BigInt(27);const BN_28=BigInt(28);const BN_35=BigInt(35);const BN_MAX_UINT=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const inspect=Symbol.for("nodejs.util.inspect.custom");const BLOB_SIZE=4096*32;const CELL_COUNT=128;function getKzgLibrary(kzg){const blobToKzgCommitment=blob=>{if("computeBlobProof"in kzg){if("blobToKzgCommitment"in kzg&&typeof kzg.blobToKzgCommitment==="function"){return getBytes(kzg.blobToKzgCommitment(hexlify(blob)))}}else if("blobToKzgCommitment"in kzg&&typeof kzg.blobToKzgCommitment==="function"){return getBytes(kzg.blobToKzgCommitment(blob))}if("blobToKZGCommitment"in kzg&&typeof kzg.blobToKZGCommitment==="function"){return getBytes(kzg.blobToKZGCommitment(hexlify(blob)))}assertArgument(false,"unsupported KZG library","kzg",kzg)};const computeBlobKzgProof=(blob,commitment)=>{if("computeBlobProof"in kzg&&typeof kzg.computeBlobProof==="function"){return getBytes(kzg.computeBlobProof(hexlify(blob),hexlify(commitment)))}if("computeBlobKzgProof"in kzg&&typeof kzg.computeBlobKzgProof==="function"){return kzg.computeBlobKzgProof(blob,commitment)}if("computeBlobKZGProof"in kzg&&typeof kzg.computeBlobKZGProof==="function"){return getBytes(kzg.computeBlobKZGProof(hexlify(blob),hexlify(commitment)))}assertArgument(false,"unsupported KZG library","kzg",kzg)};return{blobToKzgCommitment:blobToKzgCommitment,computeBlobKzgProof:computeBlobKzgProof}}function getVersionedHash(version,hash){let versioned=version.toString(16);while(versioned.length<2){versioned="0"+versioned}versioned+=sha256(hash).substring(4);return"0x"+versioned}function handleAddress(value){if(value==="0x"){return null}return getAddress(value)}function handleAccessList(value,param){try{return accessListify(value)}catch(error){assertArgument(false,error.message,param,value)}}function handleAuthorizationList(value,param){try{if(!Array.isArray(value)){throw new Error("authorizationList: invalid array")}const result=[];for(let i=0;i[set.address,set.storageKeys])}function formatAuthorizationList(value){return value.map(a=>{return[formatNumber(a.chainId,"chainId"),a.address,formatNumber(a.nonce,"nonce"),formatNumber(a.signature.yParity,"yParity"),toBeArray(a.signature.r),toBeArray(a.signature._s)]})}function formatHashes(value,param){assertArgument(Array.isArray(value),`invalid ${param}`,"value",value);for(let i=0;ib.data),blobs.map(b=>b.commitment),cellProofs])])}return concat(["0x03",encodeRlp([fields,blobs.map(b=>b.data),blobs.map(b=>b.commitment),blobs.map(b=>b.proof)])])}}return concat(["0x03",encodeRlp(fields)])}function _parseEip7702(data){const fields=decodeRlp(getBytes(data).slice(1));assertArgument(Array.isArray(fields)&&(fields.length===10||fields.length===13),"invalid field count for transaction type: 4","data",hexlify(data));const tx={type:4,chainId:handleUint(fields[0],"chainId"),nonce:handleNumber(fields[1],"nonce"),maxPriorityFeePerGas:handleUint(fields[2],"maxPriorityFeePerGas"),maxFeePerGas:handleUint(fields[3],"maxFeePerGas"),gasPrice:null,gasLimit:handleUint(fields[4],"gasLimit"),to:handleAddress(fields[5]),value:handleUint(fields[6],"value"),data:hexlify(fields[7]),accessList:handleAccessList(fields[8],"accessList"),authorizationList:handleAuthorizationList(fields[9],"authorizationList")};if(fields.length===10){return tx}_parseEipSignature(tx,fields.slice(10));return tx}function _serializeEip7702(tx,sig){const fields=[formatNumber(tx.chainId,"chainId"),formatNumber(tx.nonce,"nonce"),formatNumber(tx.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),formatNumber(tx.maxFeePerGas||0,"maxFeePerGas"),formatNumber(tx.gasLimit,"gasLimit"),tx.to||"0x",formatNumber(tx.value,"value"),tx.data,formatAccessList(tx.accessList||[]),formatAuthorizationList(tx.authorizationList||[])];if(sig){fields.push(formatNumber(sig.yParity,"yParity"));fields.push(toBeArray(sig.r));fields.push(toBeArray(sig.s))}return concat(["0x04",encodeRlp(fields)])}class Transaction{#type;#to;#data;#nonce;#gasLimit;#gasPrice;#maxPriorityFeePerGas;#maxFeePerGas;#value;#chainId;#sig;#accessList;#maxFeePerBlobGas;#blobVersionedHashes;#kzg;#blobs;#auths;#blobWrapperVersion;get type(){return this.#type}set type(value){switch(value){case null:this.#type=null;break;case 0:case"legacy":this.#type=0;break;case 1:case"berlin":case"eip-2930":this.#type=1;break;case 2:case"london":case"eip-1559":this.#type=2;break;case 3:case"cancun":case"eip-4844":this.#type=3;break;case 4:case"pectra":case"eip-7702":this.#type=4;break;default:assertArgument(false,"unsupported transaction type","type",value)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844";case 4:return"eip-7702"}return null}get to(){const value=this.#to;if(value==null&&this.type===3){return ZeroAddress}return value}set to(value){this.#to=value==null?null:getAddress(value)}get nonce(){return this.#nonce}set nonce(value){this.#nonce=getNumber(value,"value")}get gasLimit(){return this.#gasLimit}set gasLimit(value){this.#gasLimit=getBigInt(value)}get gasPrice(){const value=this.#gasPrice;if(value==null&&(this.type===0||this.type===1)){return BN_0$4}return value}set gasPrice(value){this.#gasPrice=value==null?null:getBigInt(value,"gasPrice")}get maxPriorityFeePerGas(){const value=this.#maxPriorityFeePerGas;if(value==null){if(this.type===2||this.type===3){return BN_0$4}return null}return value}set maxPriorityFeePerGas(value){this.#maxPriorityFeePerGas=value==null?null:getBigInt(value,"maxPriorityFeePerGas")}get maxFeePerGas(){const value=this.#maxFeePerGas;if(value==null){if(this.type===2||this.type===3){return BN_0$4}return null}return value}set maxFeePerGas(value){this.#maxFeePerGas=value==null?null:getBigInt(value,"maxFeePerGas")}get data(){return this.#data}set data(value){this.#data=hexlify(value)}get value(){return this.#value}set value(value){this.#value=getBigInt(value,"value")}get chainId(){return this.#chainId}set chainId(value){this.#chainId=getBigInt(value)}get signature(){return this.#sig||null}set signature(value){this.#sig=value==null?null:Signature.from(value)}isValid(){const sig=this.signature;if(sig&&!sig.isValid()){return false}const auths=this.authorizationList;if(auths){for(const auth of auths){if(!auth.signature.isValid()){return false}}}return true}get accessList(){const value=this.#accessList||null;if(value==null){if(this.type===1||this.type===2||this.type===3){return[]}return null}return value}set accessList(value){this.#accessList=value==null?null:accessListify(value)}get authorizationList(){const value=this.#auths||null;if(value==null){if(this.type===4){return[]}}return value}set authorizationList(auths){this.#auths=auths==null?null:auths.map(a=>authorizationify(a))}get maxFeePerBlobGas(){const value=this.#maxFeePerBlobGas;if(value==null&&this.type===3){return BN_0$4}return value}set maxFeePerBlobGas(value){this.#maxFeePerBlobGas=value==null?null:getBigInt(value,"maxFeePerBlobGas")}get blobVersionedHashes(){let value=this.#blobVersionedHashes;if(value==null&&this.type===3){return[]}return value}set blobVersionedHashes(value){if(value!=null){assertArgument(Array.isArray(value),"blobVersionedHashes must be an Array","value",value);value=value.slice();for(let i=0;iObject.assign({},b))}set blobs(_blobs){if(_blobs==null){this.#blobs=null;return}const blobs=[];const versionedHashes=[];for(let i=0;i<_blobs.length;i++){const blob=_blobs[i];if(isBytesLike(blob)){assert(this.#kzg,"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let data=getBytes(blob);assertArgument(data.length<=BLOB_SIZE,"blob is too large",`blobs[${i}]`,blob);if(data.length!==BLOB_SIZE){const padded=new Uint8Array(BLOB_SIZE);padded.set(data);data=padded}const commit=this.#kzg.blobToKzgCommitment(data);const proof=hexlify(this.#kzg.computeBlobKzgProof(data,commit));blobs.push({data:hexlify(data),commitment:hexlify(commit),proof:proof});versionedHashes.push(getVersionedHash(1,commit))}else{const data=hexlify(blob.data);const commitment=hexlify(blob.commitment);const proof=hexlify(blob.proof);blobs.push({data:data,commitment:commitment,proof:proof});versionedHashes.push(getVersionedHash(1,commitment))}}this.#blobs=blobs;this.#blobVersionedHashes=versionedHashes}get kzg(){return this.#kzg}set kzg(kzg){if(kzg==null){this.#kzg=null}else{this.#kzg=getKzgLibrary(kzg)}}get blobWrapperVersion(){return this.#blobWrapperVersion}set blobWrapperVersion(value){this.#blobWrapperVersion=value}constructor(){this.#type=null;this.#to=null;this.#nonce=0;this.#gasLimit=BN_0$4;this.#gasPrice=null;this.#maxPriorityFeePerGas=null;this.#maxFeePerGas=null;this.#data="0x";this.#value=BN_0$4;this.#chainId=BN_0$4;this.#sig=null;this.#accessList=null;this.#maxFeePerBlobGas=null;this.#blobVersionedHashes=null;this.#kzg=null;this.#blobs=null;this.#auths=null;this.#blobWrapperVersion=null}get hash(){if(this.signature==null){return null}return keccak256(this.#getSerialized(true,false))}get unsignedHash(){return keccak256(this.unsignedSerialized)}get from(){if(this.signature==null){return null}return recoverAddress(this.unsignedHash,this.signature.getCanonical())}get fromPublicKey(){if(this.signature==null){return null}return SigningKey.recoverPublicKey(this.unsignedHash,this.signature.getCanonical())}isSigned(){return this.signature!=null}#getSerialized(signed,sidecar){assert(!signed||this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});const sig=signed?this.signature:null;switch(this.inferType()){case 0:return _serializeLegacy(this,sig);case 1:return _serializeEip2930(this,sig);case 2:return _serializeEip1559(this,sig);case 3:return _serializeEip4844(this,sig,sidecar?this.blobs:null);case 4:return _serializeEip7702(this,sig)}assert(false,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}get serialized(){return this.#getSerialized(true,true)}get unsignedSerialized(){return this.#getSerialized(false,false)}inferType(){const types=this.inferTypes();if(types.indexOf(2)>=0){return 2}return types.pop()}inferTypes(){const hasGasPrice=this.gasPrice!=null;const hasFee=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null;const hasAccessList=this.accessList!=null;const hasBlob=this.#maxFeePerBlobGas!=null||this.#blobVersionedHashes;if(this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null){assert(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this})}assert(!hasFee||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this});assert(this.type!==0||!hasAccessList,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const types=[];if(this.type!=null){types.push(this.type)}else{if(this.authorizationList&&this.authorizationList.length){types.push(4)}else if(hasFee){types.push(2)}else if(hasGasPrice){types.push(1);if(!hasAccessList){types.push(0)}}else if(hasAccessList){types.push(1);types.push(2)}else if(hasBlob&&this.to){types.push(3)}else{types.push(0);types.push(1);types.push(2);types.push(3)}}types.sort();return types}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return Transaction.from(this)}toJSON(){const s=v=>{if(v==null){return null}return v.toString()};return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:s(this.gasLimit),gasPrice:s(this.gasPrice),maxPriorityFeePerGas:s(this.maxPriorityFeePerGas),maxFeePerGas:s(this.maxFeePerGas),value:s(this.value),chainId:s(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}[inspect](){return this.toString()}toString(){const output=[];const add=key=>{let value=this[key];if(typeof value==="string"){value=JSON.stringify(value)}output.push(`${key}: ${value}`)};if(this.type){add("type")}add("to");add("data");add("nonce");add("gasLimit");add("value");if(this.chainId!=null){add("chainId")}if(this.signature){add("from");output.push(`signature: ${this.signature.toString()}`)}const auths=this.authorizationList;if(auths){const outputAuths=[];for(const auth of auths){const o=[];o.push(`address: ${JSON.stringify(auth.address)}`);if(auth.nonce!=null){o.push(`nonce: ${auth.nonce}`)}if(auth.chainId!=null){o.push(`chainId: ${auth.chainId}`)}if(auth.signature){o.push(`signature: ${auth.signature.toString()}`)}outputAuths.push(`Authorization { ${o.join(", ")} }`)}output.push(`authorizations: [ ${outputAuths.join(", ")} ]`)}return`Transaction { ${output.join(", ")} }`}static from(tx){if(tx==null){return new Transaction}if(typeof tx==="string"){const payload=getBytes(tx);if(payload[0]>=127){return Transaction.from(_parseLegacy(payload))}switch(payload[0]){case 1:return Transaction.from(_parseEip2930(payload));case 2:return Transaction.from(_parseEip1559(payload));case 3:return Transaction.from(_parseEip4844(payload));case 4:return Transaction.from(_parseEip7702(payload))}assert(false,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const result=new Transaction;if(tx.type!=null){result.type=tx.type}if(tx.to!=null){result.to=tx.to}if(tx.nonce!=null){result.nonce=tx.nonce}if(tx.gasLimit!=null){result.gasLimit=tx.gasLimit}if(tx.gasPrice!=null){result.gasPrice=tx.gasPrice}if(tx.maxPriorityFeePerGas!=null){result.maxPriorityFeePerGas=tx.maxPriorityFeePerGas}if(tx.maxFeePerGas!=null){result.maxFeePerGas=tx.maxFeePerGas}if(tx.maxFeePerBlobGas!=null){result.maxFeePerBlobGas=tx.maxFeePerBlobGas}if(tx.data!=null){result.data=tx.data}if(tx.value!=null){result.value=tx.value}if(tx.chainId!=null){result.chainId=tx.chainId}if(tx.signature!=null){result.signature=Signature.from(tx.signature)}if(tx.accessList!=null){result.accessList=tx.accessList}if(tx.authorizationList!=null){result.authorizationList=tx.authorizationList}if(tx.blobVersionedHashes!=null){result.blobVersionedHashes=tx.blobVersionedHashes}if(tx.kzg!=null){result.kzg=tx.kzg}if(tx.blobWrapperVersion!=null){result.blobWrapperVersion=tx.blobWrapperVersion}if(tx.blobs!=null){result.blobs=tx.blobs}if(tx.hash!=null){assertArgument(result.isSigned(),"unsigned transaction cannot define '.hash'","tx",tx);assertArgument(result.hash===tx.hash,"hash mismatch","tx",tx)}if(tx.from!=null){assertArgument(result.isSigned(),"unsigned transaction cannot define '.from'","tx",tx);assertArgument(result.from.toLowerCase()===(tx.from||"").toLowerCase(),"from mismatch","tx",tx)}return result}}function hashAuthorization(auth){assertArgument(typeof auth.address==="string","invalid address for hashAuthorization","auth.address",auth);return keccak256(concat(["0x05",encodeRlp([auth.chainId!=null?toBeArray(auth.chainId):"0x",getAddress(auth.address),auth.nonce!=null?toBeArray(auth.nonce):"0x"])]))}function verifyAuthorization(auth,sig){return recoverAddress(hashAuthorization(auth),sig)}function id(value){return keccak256(toUtf8Bytes(value))}var COMPRESSED$1="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9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/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const FENCED=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]);const NSM_MAX=4;function decode_arithmetic(bytes){let pos=0;function u16(){return bytes[pos++]<<8|bytes[pos++]}let symbol_count=u16();let total=1;let acc=[0,1];for(let i=1;i>--read_width&1}const N=31;const FULL=2**N;const HALF=FULL>>>1;const QRTR=HALF>>1;const MASK=FULL-1;let register=0;for(let i=0;i1){let mid=start+end>>>1;if(value>>1|read_bit();a=a<<1^HALF;b=(b^HALF)<<1|HALF|1}low=a;range=1+b-a}let offset=symbol_count-4;return symbols.map(x=>{switch(x-offset){case 3:return offset+65792+(bytes[pos_payload++]<<16|bytes[pos_payload++]<<8|bytes[pos_payload++]);case 2:return offset+256+(bytes[pos_payload++]<<8|bytes[pos_payload++]);case 1:return offset+bytes[pos_payload++];default:return x-1}})}function read_payload(v){let pos=0;return()=>v[pos++]}function read_compressed_payload(s){return read_payload(decode_arithmetic(unsafe_atob(s)))}function unsafe_atob(s){let lookup=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((c,i)=>lookup[c.charCodeAt(0)]=i);let n=s.length;let ret=new Uint8Array(6*n>>3);for(let i=0,pos=0,width=0,carry=0;i=8){ret[pos++]=carry>>(width-=8)}}return ret}function signed(i){return i&1?~i>>1:i>>1}function read_deltas(n,next){let v=Array(n);for(let i=0,x=0;i{let v=read_sorted(next);if(v.length)return v})}function read_mapped(next){let ret=[];while(true){let w=next();if(w==0)break;ret.push(read_linear_table(w,next))}while(true){let w=next()-1;if(w<0)break;ret.push(read_replacement_table(w,next))}return ret.flat()}function read_array_while(next){let v=[];while(true){let x=next(v.length);if(!x)break;v.push(x)}return v}function read_transposed(n,w,next){let m=Array(n).fill().map(()=>[]);for(let i=0;im[j].push(x))}return m}function read_linear_table(w,next){let dx=1+next();let dy=next();let vN=read_array_while(next);let m=read_transposed(vN.length,1+w,next);return m.flatMap((v,i)=>{let[x,...ys]=v;return Array(vN[i]).fill().map((_,j)=>{let j_dy=j*dy;return[x+j*dx,ys.map(y=>y+j_dy)]})})}function read_replacement_table(w,next){let n=1+next();let m=read_transposed(n,1+w,next);return m.map(v=>[v[0],v.slice(1)])}function read_trie(next){let ret=[];let sorted=read_sorted(next);expand(decode([]),[]);return ret;function decode(Q){let S=next();let B=read_array_while(()=>{let cps=read_sorted(next).map(i=>sorted[i]);if(cps.length)return decode(cps)});return{S:S,B:B,Q:Q}}function expand({S,B},cps,saved){if(S&4&&saved===cps[cps.length-1])return;if(S&2)saved=cps[cps.length-1];if(S&1)ret.push(cps);for(let br of B){for(let cp of br.Q){expand(br,[...cps,cp],saved)}}}}function hex_cp(cp){return cp.toString(16).toUpperCase().padStart(2,"0")}function quote_cp(cp){return`{${hex_cp(cp)}}`}function explode_cp(s){let cps=[];for(let pos=0,len=s.length;pos>24&255}function unpack_cp(packed){return packed&16777215}let SHIFTED_RANK,EXCLUSIONS,DECOMP,RECOMP;function init$1(){let r=read_compressed_payload(COMPRESSED);SHIFTED_RANK=new Map(read_sorted_arrays(r).flatMap((v,i)=>v.map(x=>[x,i+1<<24])));EXCLUSIONS=new Set(read_sorted(r));DECOMP=new Map;RECOMP=new Map;for(let[cp,cps]of read_mapped(r)){if(!EXCLUSIONS.has(cp)&&cps.length==2){let[a,b]=cps;let bucket=RECOMP.get(a);if(!bucket){bucket=new Map;RECOMP.set(a,bucket)}bucket.set(b,cp)}DECOMP.set(cp,cps.reverse())}}function is_hangul(cp){return cp>=S0&&cp=L0&&a=V0&&bT0&&b0)add(T0+t_index)}else{let mapped=DECOMP.get(cp);if(mapped){buf.push(...mapped)}else{add(cp)}}if(!buf.length)break;cp=buf.pop()}}if(check_order&&ret.length>1){let prev_cc=unpack_cc(ret[0]);for(let i=1;i0&&prev_cc>=cc){if(cc==0){ret.push(prev_cp,...stack);stack.length=0;prev_cp=cp}else{stack.push(cp)}prev_cc=cc}else{let composed=compose_pair(prev_cp,cp);if(composed>=0){prev_cp=composed}else if(prev_cc==0&&cc==0){ret.push(prev_cp);prev_cp=cp}else{stack.push(cp);prev_cc=cc}}}if(prev_cp>=0){ret.push(prev_cp,...stack)}return ret}function nfd(cps){return decomposed(cps).map(unpack_cp)}function nfc(cps){return composed_from_decomposed(decomposed(cps))}const HYPHEN=45;const STOP_CH=".";const FE0F=65039;const UNIQUE_PH=1;const Array_from=x=>Array.from(x);function group_has_cp(g,cp){return g.P.has(cp)||g.Q.has(cp)}class Emoji extends Array{get is_emoji(){return true}}let MAPPED,IGNORED,CM,NSM,ESCAPE,GROUPS,WHOLE_VALID,WHOLE_MAP,VALID,EMOJI_LIST,EMOJI_ROOT;function init(){if(MAPPED)return;let r=read_compressed_payload(COMPRESSED$1);const read_sorted_array=()=>read_sorted(r);const read_sorted_set=()=>new Set(read_sorted_array());const set_add_many=(set,v)=>v.forEach(x=>set.add(x));MAPPED=new Map(read_mapped(r));IGNORED=read_sorted_set();CM=read_sorted_array();NSM=new Set(read_sorted_array().map(i=>CM[i]));CM=new Set(CM);ESCAPE=read_sorted_set();read_sorted_set();let chunks=read_sorted_arrays(r);let unrestricted=r();const read_chunked=()=>{let set=new Set;read_sorted_array().forEach(i=>set_add_many(set,chunks[i]));set_add_many(set,read_sorted_array());return set};GROUPS=read_array_while(i=>{let N=read_array_while(r).map(x=>x+96);if(N.length){let R=i>=unrestricted;N[0]-=32;N=str_from_cps(N);if(R)N=`Restricted[${N}]`;let P=read_chunked();let Q=read_chunked();let M=!r();return{N:N,P:P,Q:Q,M:M,R:R}}});WHOLE_VALID=read_sorted_set();WHOLE_MAP=new Map;let wholes=read_sorted_array().concat(Array_from(WHOLE_VALID)).sort((a,b)=>a-b);wholes.forEach((cp,i)=>{let d=r();let w=wholes[i]=d?wholes[i-d]:{V:[],M:new Map};w.V.push(cp);if(!WHOLE_VALID.has(cp)){WHOLE_MAP.set(cp,w)}});for(let{V,M}of new Set(WHOLE_MAP.values())){let recs=[];for(let cp of V){let gs=GROUPS.filter(g=>group_has_cp(g,cp));let rec=recs.find(({G})=>gs.some(g=>G.has(g)));if(!rec){rec={G:new Set,V:[]};recs.push(rec)}rec.V.push(cp);set_add_many(rec.G,gs)}let union=recs.flatMap(x=>Array_from(x.G));for(let{G,V}of recs){let complement=new Set(union.filter(g=>!G.has(g)));for(let cp of V){M.set(cp,complement)}}}VALID=new Set;let multi=new Set;const add_to_union=cp=>VALID.has(cp)?multi.add(cp):VALID.add(cp);for(let g of GROUPS){for(let cp of g.P)add_to_union(cp);for(let cp of g.Q)add_to_union(cp)}for(let cp of VALID){if(!WHOLE_MAP.has(cp)&&!multi.has(cp)){WHOLE_MAP.set(cp,UNIQUE_PH)}}set_add_many(VALID,nfd(VALID));EMOJI_LIST=read_trie(r).map(v=>Emoji.from(v)).sort(compare_arrays);EMOJI_ROOT=new Map;for(let cps of EMOJI_LIST){let prev=[EMOJI_ROOT];for(let cp of cps){let next=prev.map(node=>{let child=node.get(cp);if(!child){child=new Map;node.set(cp,child)}return child});if(cp===FE0F){prev.push(...next)}else{prev=next}}for(let x of prev){x.V=cps}}}function quoted_cp(cp){return(should_escape(cp)?"":`${bidi_qq(safe_str_from_cps([cp]))} `)+quote_cp(cp)}function bidi_qq(s){return`"${s}"\u200E`}function check_label_extension(cps){if(cps.length>=4&&cps[2]==HYPHEN&&cps[3]==HYPHEN){throw new Error(`invalid label extension: "${str_from_cps(cps.slice(0,4))}"`)}}function check_leading_underscore(cps){const UNDERSCORE=95;for(let i=cps.lastIndexOf(UNDERSCORE);i>0;){if(cps[--i]!==UNDERSCORE){throw new Error("underscore allowed only at start")}}}function check_fenced(cps){let cp=cps[0];let prev=FENCED.get(cp);if(prev)throw error_placement(`leading ${prev}`);let n=cps.length;let last=-1;for(let i=1;imax){max>>=1;cps=[...cps.slice(0,max),8230,...cps.slice(-max)]}let prev=0;let n=cps.length;for(let i=0;i{let input=explode_cp(label);let info={input:input,offset:offset};offset+=input.length+1;try{let tokens=info.tokens=tokens_from_str(input,nf,ef);let token_count=tokens.length;let type;if(!token_count){throw new Error(`empty label`)}let norm=info.output=tokens.flat();check_leading_underscore(norm);let emoji=info.emoji=token_count>1||tokens[0].is_emoji;if(!emoji&&norm.every(cp=>cp<128)){check_label_extension(norm);type="ASCII"}else{let chars=tokens.flatMap(x=>x.is_emoji?[]:x);if(!chars.length){type="Emoji"}else{if(CM.has(norm[0]))throw error_placement("leading combining mark");for(let i=1;iset.has(g)):Array_from(set);if(!maker.length)return}else{shared.push(cp)}}if(maker){for(let g of maker){if(shared.every(cp=>group_has_cp(g,cp))){throw new Error(`whole-script confusable: ${group.N}/${g.N}`)}}}}function determine_group(unique){let groups=GROUPS;for(let cp of unique){let gs=groups.filter(g=>group_has_cp(g,cp));if(!gs.length){if(!GROUPS.some(g=>group_has_cp(g,cp))){throw error_disallowed(cp)}else{throw error_group_member(groups[0],cp)}}groups=gs;if(gs.length==1)break}return groups}function flatten(split){return split.map(({input,error,output})=>{if(error){let msg=error.message;throw new Error(split.length==1?msg:`Invalid label ${bidi_qq(safe_str_from_cps(input,63))}: ${msg}`)}return str_from_cps(output)}).join(STOP_CH)}function error_disallowed(cp){return new Error(`disallowed character: ${quoted_cp(cp)}`)}function error_group_member(g,cp){let quoted=quoted_cp(cp);let gg=GROUPS.find(g=>g.P.has(cp));if(gg){quoted=`${gg.N} ${quoted}`}return new Error(`illegal mixture: ${g.N} + ${quoted}`)}function error_placement(where){return new Error(`illegal placement: ${where}`)}function check_group(g,cps){for(let cp of cps){if(!group_has_cp(g,cp)){throw error_group_member(g,cp)}}if(g.M){let decomposed=nfd(cps);for(let i=1,e=decomposed.length;iNSM_MAX){throw new Error(`excessive non-spacing marks: ${bidi_qq(safe_str_from_cps(decomposed.slice(i-1,j)))} (${j-i}/${NSM_MAX})`)}i=j}}}}function tokens_from_str(input,nf,ef){let ret=[];let chars=[];input=input.slice().reverse();while(input.length){let emoji=consume_emoji_reversed(input);if(emoji){if(chars.length){ret.push(nf(chars));chars=[]}ret.push(ef(emoji))}else{let cp=input.pop();if(VALID.has(cp)){chars.push(cp)}else{let cps=MAPPED.get(cp);if(cps){chars.push(...cps)}else if(!IGNORED.has(cp)){throw error_disallowed(cp)}}}}if(chars.length){ret.push(nf(chars))}return ret}function filter_fe0f(cps){return cps.filter(cp=>cp!=FE0F)}function consume_emoji_reversed(cps,eaten){let node=EMOJI_ROOT;let emoji;let pos=cps.length;while(pos){node=node.get(cps[--pos]);if(!node)break;let{V}=node;if(V){emoji=V;cps.length=pos}}return emoji}const Zeros=new Uint8Array(32);Zeros.fill(0);function checkComponent(comp){assertArgument(comp.length!==0,"invalid ENS name; empty component","comp",comp);return comp}function ensNameSplit(name){const bytes=toUtf8Bytes(ensNormalize(name));const comps=[];if(name.length===0){return comps}let last=0;for(let i=0;i{assertArgument(comp.length<=length,`label ${JSON.stringify(name)} exceeds ${length} bytes`,"name",name);const bytes=new Uint8Array(comp.length+1);bytes.set(comp,1);bytes[0]=bytes.length-1;return bytes})))+"00"}function hashMessage(message){if(typeof message==="string"){message=toUtf8Bytes(message)}return keccak256(concat([toUtf8Bytes(MessagePrefix),toUtf8Bytes(String(message.length)),message]))}function verifyMessage(message,sig){const digest=hashMessage(message);return recoverAddress(digest,sig)}const regexBytes=new RegExp("^bytes([0-9]+)$");const regexNumber=new RegExp("^(u?int)([0-9]*)$");const regexArray=new RegExp("^(.*)\\[([0-9]*)\\]$");function _pack(type,value,isArray){switch(type){case"address":if(isArray){return getBytes(zeroPadValue(value,32))}return getBytes(getAddress(value));case"string":return toUtf8Bytes(value);case"bytes":return getBytes(value);case"bool":value=!!value?"0x01":"0x00";if(isArray){return getBytes(zeroPadValue(value,32))}return getBytes(value)}let match=type.match(regexNumber);if(match){let signed=match[1]==="int";let size=parseInt(match[2]||"256");assertArgument((!match[2]||match[2]===String(size))&&size%8===0&&size!==0&&size<=256,"invalid number type","type",type);if(isArray){size=256}if(signed){value=toTwos(value,size)}return getBytes(zeroPadValue(toBeArray(value),size/8))}match=type.match(regexBytes);if(match){const size=parseInt(match[1]);assertArgument(String(size)===match[1]&&size!==0&&size<=32,"invalid bytes type","type",type);assertArgument(dataLength(value)===size,`invalid value for ${type}`,"value",value);if(isArray){return getBytes(zeroPadBytes(value,32))}return value}match=type.match(regexArray);if(match&&Array.isArray(value)){const baseType=match[1];const count=parseInt(match[2]||String(value.length));assertArgument(count===value.length,`invalid array length for ${type}`,"value",value);const result=[];value.forEach(function(value){result.push(_pack(baseType,value,true))});return getBytes(concat(result))}assertArgument(false,"invalid type","type",type)}function solidityPacked(types,values){assertArgument(types.length===values.length,"wrong number of values; expected ${ types.length }","values",values);const tight=[];types.forEach(function(type,index){tight.push(_pack(type,values[index]))});return hexlify(concat(tight))}function solidityPackedKeccak256(types,values){return keccak256(solidityPacked(types,values))}function solidityPackedSha256(types,values){return sha256(solidityPacked(types,values))}const padding=new Uint8Array(32);padding.fill(0);const BN__1=BigInt(-1);const BN_0$3=BigInt(0);const BN_1$1=BigInt(1);const BN_MAX_UINT256=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function hexPadRight(value){const bytes=getBytes(value);const padOffset=bytes.length%32;if(padOffset){return concat([bytes,padding.slice(padOffset)])}return hexlify(bytes)}const hexTrue=toBeHex(BN_1$1,32);const hexFalse=toBeHex(BN_0$3,32);const domainFieldTypes={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"};const domainFieldNames=["name","version","chainId","verifyingContract","salt"];function checkString(key){return function(value){assertArgument(typeof value==="string",`invalid domain value for ${JSON.stringify(key)}`,`domain.${key}`,value);return value}}const domainChecks={name:checkString("name"),version:checkString("version"),chainId:function(_value){const value=getBigInt(_value,"domain.chainId");assertArgument(value>=0,"invalid chain ID","domain.chainId",_value);if(Number.isSafeInteger(value)){return Number(value)}return toQuantity(value)},verifyingContract:function(value){try{return getAddress(value).toLowerCase()}catch(error){}assertArgument(false,`invalid domain value "verifyingContract"`,"domain.verifyingContract",value)},salt:function(value){const bytes=getBytes(value,"domain.salt");assertArgument(bytes.length===32,`invalid domain value "salt"`,"domain.salt",value);return hexlify(bytes)}};function getBaseEncoder(type){{const match=type.match(/^(u?)int(\d+)$/);if(match){const signed=match[1]==="";const width=parseInt(match[2]);assertArgument(width%8===0&&width!==0&&width<=256&&match[2]===String(width),"invalid numeric width","type",type);const boundsUpper=mask(BN_MAX_UINT256,signed?width-1:width);const boundsLower=signed?(boundsUpper+BN_1$1)*BN__1:BN_0$3;return function(_value){const value=getBigInt(_value,"value");assertArgument(value>=boundsLower&&value<=boundsUpper,`value out-of-bounds for ${type}`,"value",value);return toBeHex(signed?toTwos(value,256):value,32)}}}{const match=type.match(/^bytes(\d+)$/);if(match){const width=parseInt(match[1]);assertArgument(width!==0&&width<=32&&match[1]===String(width),"invalid bytes width","type",type);return function(value){const bytes=getBytes(value);assertArgument(bytes.length===width,`invalid length for ${type}`,"value",value);return hexPadRight(value)}}}switch(type){case"address":return function(value){return zeroPadValue(getAddress(value),32)};case"bool":return function(value){return!value?hexFalse:hexTrue};case"bytes":return function(value){return keccak256(value)};case"string":return function(value){return id(value)}}return null}function encodeType(name,fields){return`${name}(${fields.map(({name,type})=>type+" "+name).join(",")})`}function splitArray(type){const match=type.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);if(match){return{base:match[1],index:match[2]+match[4],array:{base:match[1],prefix:match[1]+match[2],count:match[5]?parseInt(match[5]):-1}}}return{base:type}}class TypedDataEncoder{primaryType;#types;get types(){return JSON.parse(this.#types)}#fullTypes;#encoderCache;constructor(_types){this.#fullTypes=new Map;this.#encoderCache=new Map;const links=new Map;const parents=new Map;const subtypes=new Map;const types={};Object.keys(_types).forEach(type=>{types[type]=_types[type].map(({name,type})=>{let{base,index}=splitArray(type);if(base==="int"&&!_types["int"]){base="int256"}if(base==="uint"&&!_types["uint"]){base="uint256"}return{name:name,type:base+(index||"")}});links.set(type,new Set);parents.set(type,[]);subtypes.set(type,new Set)});this.#types=JSON.stringify(types);for(const name in types){const uniqueNames=new Set;for(const field of types[name]){assertArgument(!uniqueNames.has(field.name),`duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`,"types",_types);uniqueNames.add(field.name);const baseType=splitArray(field.type).base;assertArgument(baseType!==name,`circular type reference to ${JSON.stringify(baseType)}`,"types",_types);const encoder=getBaseEncoder(baseType);if(encoder){continue}assertArgument(parents.has(baseType),`unknown type ${JSON.stringify(baseType)}`,"types",_types);parents.get(baseType).push(name);links.get(name).add(baseType)}}const primaryTypes=Array.from(parents.keys()).filter(n=>parents.get(n).length===0);assertArgument(primaryTypes.length!==0,"missing primary type","types",_types);assertArgument(primaryTypes.length===1,`ambiguous primary types or unused types: ${primaryTypes.map(t=>JSON.stringify(t)).join(", ")}`,"types",_types);defineProperties(this,{primaryType:primaryTypes[0]});function checkCircular(type,found){assertArgument(!found.has(type),`circular type reference to ${JSON.stringify(type)}`,"types",_types);found.add(type);for(const child of links.get(type)){if(!parents.has(child)){continue}checkCircular(child,found);for(const subtype of found){subtypes.get(subtype).add(child)}}found.delete(type)}checkCircular(this.primaryType,new Set);for(const[name,set]of subtypes){const st=Array.from(set);st.sort();this.#fullTypes.set(name,encodeType(name,types[name])+st.map(t=>encodeType(t,types[t])).join(""))}}getEncoder(type){let encoder=this.#encoderCache.get(type);if(!encoder){encoder=this.#getEncoder(type);this.#encoderCache.set(type,encoder)}return encoder}#getEncoder(type){{const encoder=getBaseEncoder(type);if(encoder){return encoder}}const array=splitArray(type).array;if(array){const subtype=array.prefix;const subEncoder=this.getEncoder(subtype);return value=>{assertArgument(array.count===-1||array.count===value.length,`array length mismatch; expected length ${array.count}`,"value",value);let result=value.map(subEncoder);if(this.#fullTypes.has(subtype)){result=result.map(keccak256)}return keccak256(concat(result))}}const fields=this.types[type];if(fields){const encodedType=id(this.#fullTypes.get(type));return value=>{const values=fields.map(({name,type})=>{const result=this.getEncoder(type)(value[name]);if(this.#fullTypes.has(type)){return keccak256(result)}return result});values.unshift(encodedType);return concat(values)}}assertArgument(false,`unknown type: ${type}`,"type",type)}encodeType(name){const result=this.#fullTypes.get(name);assertArgument(result,`unknown type: ${JSON.stringify(name)}`,"name",name);return result}encodeData(type,value){return this.getEncoder(type)(value)}hashStruct(name,value){return keccak256(this.encodeData(name,value))}encode(value){return this.encodeData(this.primaryType,value)}hash(value){return this.hashStruct(this.primaryType,value)}_visit(type,value,callback){{const encoder=getBaseEncoder(type);if(encoder){return callback(type,value)}}const array=splitArray(type).array;if(array){assertArgument(array.count===-1||array.count===value.length,`array length mismatch; expected length ${array.count}`,"value",value);return value.map(v=>this._visit(array.prefix,v,callback))}const fields=this.types[type];if(fields){return fields.reduce((accum,{name,type})=>{accum[name]=this._visit(type,value[name],callback);return accum},{})}assertArgument(false,`unknown type: ${type}`,"type",type)}visit(value,callback){return this._visit(this.primaryType,value,callback)}static from(types){return new TypedDataEncoder(types)}static getPrimaryType(types){return TypedDataEncoder.from(types).primaryType}static hashStruct(name,types,value){return TypedDataEncoder.from(types).hashStruct(name,value)}static hashDomain(domain){const domainFields=[];for(const name in domain){if(domain[name]==null){continue}const type=domainFieldTypes[name];assertArgument(type,`invalid typed-data domain key: ${JSON.stringify(name)}`,"domain",domain);domainFields.push({name:name,type:type})}domainFields.sort((a,b)=>{return domainFieldNames.indexOf(a.name)-domainFieldNames.indexOf(b.name)});return TypedDataEncoder.hashStruct("EIP712Domain",{EIP712Domain:domainFields},domain)}static encode(domain,types,value){return concat(["0x1901",TypedDataEncoder.hashDomain(domain),TypedDataEncoder.from(types).hash(value)])}static hash(domain,types,value){return keccak256(TypedDataEncoder.encode(domain,types,value))}static async resolveNames(domain,types,value,resolveName){domain=Object.assign({},domain);for(const key in domain){if(domain[key]==null){delete domain[key]}}const ensCache={};if(domain.verifyingContract&&!isHexString(domain.verifyingContract,20)){ensCache[domain.verifyingContract]="0x"}const encoder=TypedDataEncoder.from(types);encoder.visit(value,(type,value)=>{if(type==="address"&&!isHexString(value,20)){ensCache[value]="0x"}return value});for(const name in ensCache){ensCache[name]=await resolveName(name)}if(domain.verifyingContract&&ensCache[domain.verifyingContract]){domain.verifyingContract=ensCache[domain.verifyingContract]}value=encoder.visit(value,(type,value)=>{if(type==="address"&&ensCache[value]){return ensCache[value]}return value});return{domain:domain,value:value}}static getPayload(domain,types,value){TypedDataEncoder.hashDomain(domain);const domainValues={};const domainTypes=[];domainFieldNames.forEach(name=>{const value=domain[name];if(value==null){return}domainValues[name]=domainChecks[name](value);domainTypes.push({name:name,type:domainFieldTypes[name]})});const encoder=TypedDataEncoder.from(types);types=encoder.types;const typesWithDomain=Object.assign({},types);assertArgument(typesWithDomain.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",types);typesWithDomain.EIP712Domain=domainTypes;encoder.encode(value);return{types:typesWithDomain,domain:domainValues,primaryType:encoder.primaryType,message:encoder.visit(value,(type,value)=>{if(type.match(/^bytes(\d*)/)){return hexlify(getBytes(value))}if(type.match(/^u?int/)){return getBigInt(value).toString()}switch(type){case"address":return value.toLowerCase();case"bool":return!!value;case"string":assertArgument(typeof value==="string","invalid string","value",value);return value}assertArgument(false,"unsupported type","type",type)})}}}function verifyTypedData(domain,types,value,signature){return recoverAddress(TypedDataEncoder.hash(domain,types,value),signature)}function setify(items){const result=new Set;items.forEach(k=>result.add(k));return Object.freeze(result)}const _kwVisibDeploy="external public payable override";const KwVisibDeploy=setify(_kwVisibDeploy.split(" "));const _kwVisib="constant external internal payable private public pure view override";const KwVisib=setify(_kwVisib.split(" "));const _kwTypes="constructor error event fallback function receive struct";const KwTypes=setify(_kwTypes.split(" "));const _kwModifiers="calldata memory storage payable indexed";const KwModifiers=setify(_kwModifiers.split(" "));const _kwOther="tuple returns";const _keywords=[_kwTypes,_kwModifiers,_kwOther,_kwVisib].join(" ");const Keywords=setify(_keywords.split(" "));const SimpleTokens={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"};const regexWhitespacePrefix=new RegExp("^(\\s*)");const regexNumberPrefix=new RegExp("^([0-9]+)");const regexIdPrefix=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)");const regexId=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$");const regexType=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");class TokenString{#offset;#tokens;get offset(){return this.#offset}get length(){return this.#tokens.length-this.#offset}constructor(tokens){this.#offset=0;this.#tokens=tokens.slice()}clone(){return new TokenString(this.#tokens)}reset(){this.#offset=0}#subTokenString(from=0,to=0){return new TokenString(this.#tokens.slice(from,to).map(t=>{return Object.freeze(Object.assign({},t,{match:t.match-from,linkBack:t.linkBack-from,linkNext:t.linkNext-from}))}))}popKeyword(allowed){const top=this.peek();if(top.type!=="KEYWORD"||!allowed.has(top.text)){throw new Error(`expected keyword ${top.text}`)}return this.pop().text}popType(type){if(this.peek().type!==type){const top=this.peek();throw new Error(`expected ${type}; got ${top.type} ${JSON.stringify(top.text)}`)}return this.pop().text}popParen(){const top=this.peek();if(top.type!=="OPEN_PAREN"){throw new Error("bad start")}const result=this.#subTokenString(this.#offset+1,top.match+1);this.#offset=top.match+1;return result}popParams(){const top=this.peek();if(top.type!=="OPEN_PAREN"){throw new Error("bad start")}const result=[];while(this.#offset=this.#tokens.length){throw new Error("out-of-bounds")}return this.#tokens[this.#offset]}peekKeyword(allowed){const top=this.peekType("KEYWORD");return top!=null&&allowed.has(top)?top:null}peekType(type){if(this.length===0){return null}const top=this.peek();return top.type===type?top.text:null}pop(){const result=this.peek();this.#offset++;return result}toString(){const tokens=[];for(let i=this.#offset;i`}}function lex(text){const tokens=[];const throwError=message=>{const token=offset0&&tokens[tokens.length-1].type==="NUMBER"){const value=tokens.pop().text;suffix=value+suffix;tokens[tokens.length-1].value=getNumber(value)}if(tokens.length===0||tokens[tokens.length-1].type!=="BRACKET"){throw new Error("missing opening bracket")}tokens[tokens.length-1].text+=suffix}continue}match=cur.match(regexIdPrefix);if(match){token.text=match[1];offset+=token.text.length;if(Keywords.has(token.text)){token.type="KEYWORD";continue}if(token.text.match(regexType)){token.type="TYPE";continue}token.type="ID";continue}match=cur.match(regexNumberPrefix);if(match){token.text=match[1];token.type="NUMBER";offset+=token.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset}`)}return new TokenString(tokens.map(t=>Object.freeze(t)))}function allowSingle(set,allowed){let included=[];for(const key in allowed.keys()){if(set.has(key)){included.push(key)}}if(included.length>1){throw new Error(`conflicting types: ${included.join(", ")}`)}}function consumeName(type,tokens){if(tokens.peekKeyword(KwTypes)){const keyword=tokens.pop().text;if(keyword!==type){throw new Error(`expected ${type}, got ${keyword}`)}}return tokens.popType("ID")}function consumeKeywords(tokens,allowed){const keywords=new Set;while(true){const keyword=tokens.peekType("KEYWORD");if(keyword==null||allowed&&!allowed.has(keyword)){break}tokens.pop();if(keywords.has(keyword)){throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`)}keywords.add(keyword)}return Object.freeze(keywords)}function consumeMutability(tokens){let modifiers=consumeKeywords(tokens,KwVisib);allowSingle(modifiers,setify("constant payable nonpayable".split(" ")));allowSingle(modifiers,setify("pure view payable nonpayable".split(" ")));if(modifiers.has("view")){return"view"}if(modifiers.has("pure")){return"pure"}if(modifiers.has("payable")){return"payable"}if(modifiers.has("nonpayable")){return"nonpayable"}if(modifiers.has("constant")){return"view"}return"nonpayable"}function consumeParams(tokens,allowIndexed){return tokens.popParams().map(t=>ParamType.from(t,allowIndexed))}function consumeGas(tokens){if(tokens.peekType("AT")){tokens.pop();if(tokens.peekType("NUMBER")){return getBigInt(tokens.pop().text)}throw new Error("invalid gas")}return null}function consumeEoi(tokens){if(tokens.length){throw new Error(`unexpected tokens at offset ${tokens.offset}: ${tokens.toString()}`)}}const regexArrayType=new RegExp(/^(.*)\[([0-9]*)\]$/);function verifyBasicType(type){const match=type.match(regexType);assertArgument(match,"invalid type","type",type);if(type==="uint"){return"uint256"}if(type==="int"){return"int256"}if(match[2]){const length=parseInt(match[2]);assertArgument(length!==0&&length<=32,"invalid bytes length","type",type)}else if(match[3]){const size=parseInt(match[3]);assertArgument(size!==0&&size<=256&&size%8===0,"invalid numeric width","type",type)}return type}const _guard$2={};const internal$1=Symbol.for("_ethers_internal");const ParamTypeInternal="_ParamTypeInternal";const ErrorFragmentInternal="_ErrorInternal";const EventFragmentInternal="_EventInternal";const ConstructorFragmentInternal="_ConstructorInternal";const FallbackFragmentInternal="_FallbackInternal";const FunctionFragmentInternal="_FunctionInternal";const StructFragmentInternal="_StructInternal";class ParamType{name;type;baseType;indexed;components;arrayLength;arrayChildren;constructor(guard,name,type,baseType,indexed,components,arrayLength,arrayChildren){assertPrivate(guard,_guard$2,"ParamType");Object.defineProperty(this,internal$1,{value:ParamTypeInternal});if(components){components=Object.freeze(components.slice())}if(baseType==="array"){if(arrayLength==null||arrayChildren==null){throw new Error("")}}else if(arrayLength!=null||arrayChildren!=null){throw new Error("")}if(baseType==="tuple"){if(components==null){throw new Error("")}}else if(components!=null){throw new Error("")}defineProperties(this,{name:name,type:type,baseType:baseType,indexed:indexed,components:components,arrayLength:arrayLength,arrayChildren:arrayChildren})}format(format){if(format==null){format="sighash"}if(format==="json"){const name=this.name||"";if(this.isArray()){const result=JSON.parse(this.arrayChildren.format("json"));result.name=name;result.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`;return JSON.stringify(result)}const result={type:this.baseType==="tuple"?"tuple":this.type,name:name};if(typeof this.indexed==="boolean"){result.indexed=this.indexed}if(this.isTuple()){result.components=this.components.map(c=>JSON.parse(c.format(format)))}return JSON.stringify(result)}let result="";if(this.isArray()){result+=this.arrayChildren.format(format);result+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`}else{if(this.isTuple()){result+="("+this.components.map(comp=>comp.format(format)).join(format==="full"?", ":",")+")"}else{result+=this.type}}if(format!=="sighash"){if(this.indexed===true){result+=" indexed"}if(format==="full"&&this.name){result+=" "+this.name}}return result}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(value,process){if(this.isArray()){if(!Array.isArray(value)){throw new Error("invalid array value")}if(this.arrayLength!==-1&&value.length!==this.arrayLength){throw new Error("array is wrong length")}const _this=this;return value.map(v=>_this.arrayChildren.walk(v,process))}if(this.isTuple()){if(!Array.isArray(value)){throw new Error("invalid tuple value")}if(value.length!==this.components.length){throw new Error("array is wrong length")}const _this=this;return value.map((v,i)=>_this.components[i].walk(v,process))}return process(this.type,value)}#walkAsync(promises,value,process,setValue){if(this.isArray()){if(!Array.isArray(value)){throw new Error("invalid array value")}if(this.arrayLength!==-1&&value.length!==this.arrayLength){throw new Error("array is wrong length")}const childType=this.arrayChildren;const result=value.slice();result.forEach((value,index)=>{childType.#walkAsync(promises,value,process,value=>{result[index]=value})});setValue(result);return}if(this.isTuple()){const components=this.components;let result;if(Array.isArray(value)){result=value.slice()}else{if(value==null||typeof value!=="object"){throw new Error("invalid tuple value")}result=components.map(param=>{if(!param.name){throw new Error("cannot use object value with unnamed components")}if(!(param.name in value)){throw new Error(`missing value for component ${param.name}`)}return value[param.name]})}if(result.length!==this.components.length){throw new Error("array is wrong length")}result.forEach((value,index)=>{components[index].#walkAsync(promises,value,process,value=>{result[index]=value})});setValue(result);return}const result=process(this.type,value);if(result.then){promises.push(async function(){setValue(await result)}())}else{setValue(result)}}async walkAsync(value,process){const promises=[];const result=[value];this.#walkAsync(promises,value,process,value=>{result[0]=value});if(promises.length){await Promise.all(promises)}return result[0]}static from(obj,allowIndexed){if(ParamType.isParamType(obj)){return obj}if(typeof obj==="string"){try{return ParamType.from(lex(obj),allowIndexed)}catch(error){assertArgument(false,"invalid param type","obj",obj)}}else if(obj instanceof TokenString){let type="",baseType="";let comps=null;if(consumeKeywords(obj,setify(["tuple"])).has("tuple")||obj.peekType("OPEN_PAREN")){baseType="tuple";comps=obj.popParams().map(t=>ParamType.from(t));type=`tuple(${comps.map(c=>c.format()).join(",")})`}else{type=verifyBasicType(obj.popType("TYPE"));baseType=type}let arrayChildren=null;let arrayLength=null;while(obj.length&&obj.peekType("BRACKET")){const bracket=obj.pop();arrayChildren=new ParamType(_guard$2,"",type,baseType,null,comps,arrayLength,arrayChildren);arrayLength=bracket.value;type+=bracket.text;baseType="array";comps=null}let indexed=null;const keywords=consumeKeywords(obj,KwModifiers);if(keywords.has("indexed")){if(!allowIndexed){throw new Error("")}indexed=true}const name=obj.peekType("ID")?obj.pop().text:"";if(obj.length){throw new Error("leftover tokens")}return new ParamType(_guard$2,name,type,baseType,indexed,comps,arrayLength,arrayChildren)}const name=obj.name;assertArgument(!name||typeof name==="string"&&name.match(regexId),"invalid name","obj.name",name);let indexed=obj.indexed;if(indexed!=null){assertArgument(allowIndexed,"parameter cannot be indexed","obj.indexed",obj.indexed);indexed=!!indexed}let type=obj.type;let arrayMatch=type.match(regexArrayType);if(arrayMatch){const arrayLength=parseInt(arrayMatch[2]||"-1");const arrayChildren=ParamType.from({type:arrayMatch[1],components:obj.components});return new ParamType(_guard$2,name||"",type,"array",indexed,null,arrayLength,arrayChildren)}if(type==="tuple"||type.startsWith("tuple(")||type.startsWith("(")){const comps=obj.components!=null?obj.components.map(c=>ParamType.from(c)):null;const tuple=new ParamType(_guard$2,name||"",type,"tuple",indexed,comps,null,null);return tuple}type=verifyBasicType(obj.type);return new ParamType(_guard$2,name||"",type,type,indexed,null,null,null)}static isParamType(value){return value&&value[internal$1]===ParamTypeInternal}}class Fragment{type;inputs;constructor(guard,type,inputs){assertPrivate(guard,_guard$2,"Fragment");inputs=Object.freeze(inputs.slice());defineProperties(this,{type:type,inputs:inputs})}static from(obj){if(typeof obj==="string"){try{Fragment.from(JSON.parse(obj))}catch(e){}return Fragment.from(lex(obj))}if(obj instanceof TokenString){const type=obj.peekKeyword(KwTypes);switch(type){case"constructor":return ConstructorFragment.from(obj);case"error":return ErrorFragment.from(obj);case"event":return EventFragment.from(obj);case"fallback":case"receive":return FallbackFragment.from(obj);case"function":return FunctionFragment.from(obj);case"struct":return StructFragment.from(obj)}}else if(typeof obj==="object"){switch(obj.type){case"constructor":return ConstructorFragment.from(obj);case"error":return ErrorFragment.from(obj);case"event":return EventFragment.from(obj);case"fallback":case"receive":return FallbackFragment.from(obj);case"function":return FunctionFragment.from(obj);case"struct":return StructFragment.from(obj)}assert(false,`unsupported type: ${obj.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}assertArgument(false,"unsupported frgament object","obj",obj)}static isConstructor(value){return ConstructorFragment.isFragment(value)}static isError(value){return ErrorFragment.isFragment(value)}static isEvent(value){return EventFragment.isFragment(value)}static isFunction(value){return FunctionFragment.isFragment(value)}static isStruct(value){return StructFragment.isFragment(value)}}class NamedFragment extends Fragment{name;constructor(guard,type,name,inputs){super(guard,type,inputs);assertArgument(typeof name==="string"&&name.match(regexId),"invalid identifier","name",name);inputs=Object.freeze(inputs.slice());defineProperties(this,{name:name})}}function joinParams(format,params){return"("+params.map(p=>p.format(format)).join(format==="full"?", ":",")+")"}class ErrorFragment extends NamedFragment{constructor(guard,name,inputs){super(guard,"error",name,inputs);Object.defineProperty(this,internal$1,{value:ErrorFragmentInternal})}get selector(){return id(this.format("sighash")).substring(0,10)}format(format){if(format==null){format="sighash"}if(format==="json"){return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(input=>JSON.parse(input.format(format)))})}const result=[];if(format!=="sighash"){result.push("error")}result.push(this.name+joinParams(format,this.inputs));return result.join(" ")}static from(obj){if(ErrorFragment.isFragment(obj)){return obj}if(typeof obj==="string"){return ErrorFragment.from(lex(obj))}else if(obj instanceof TokenString){const name=consumeName("error",obj);const inputs=consumeParams(obj);consumeEoi(obj);return new ErrorFragment(_guard$2,name,inputs)}return new ErrorFragment(_guard$2,obj.name,obj.inputs?obj.inputs.map(ParamType.from):[])}static isFragment(value){return value&&value[internal$1]===ErrorFragmentInternal}}class EventFragment extends NamedFragment{anonymous;constructor(guard,name,inputs,anonymous){super(guard,"event",name,inputs);Object.defineProperty(this,internal$1,{value:EventFragmentInternal});defineProperties(this,{anonymous:anonymous})}get topicHash(){return id(this.format("sighash"))}format(format){if(format==null){format="sighash"}if(format==="json"){return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(format)))})}const result=[];if(format!=="sighash"){result.push("event")}result.push(this.name+joinParams(format,this.inputs));if(format!=="sighash"&&this.anonymous){result.push("anonymous")}return result.join(" ")}static getTopicHash(name,params){params=(params||[]).map(p=>ParamType.from(p));const fragment=new EventFragment(_guard$2,name,params,false);return fragment.topicHash}static from(obj){if(EventFragment.isFragment(obj)){return obj}if(typeof obj==="string"){try{return EventFragment.from(lex(obj))}catch(error){assertArgument(false,"invalid event fragment","obj",obj)}}else if(obj instanceof TokenString){const name=consumeName("event",obj);const inputs=consumeParams(obj,true);const anonymous=!!consumeKeywords(obj,setify(["anonymous"])).has("anonymous");consumeEoi(obj);return new EventFragment(_guard$2,name,inputs,anonymous)}return new EventFragment(_guard$2,obj.name,obj.inputs?obj.inputs.map(p=>ParamType.from(p,true)):[],!!obj.anonymous)}static isFragment(value){return value&&value[internal$1]===EventFragmentInternal}}class ConstructorFragment extends Fragment{payable;gas;constructor(guard,type,inputs,payable,gas){super(guard,type,inputs);Object.defineProperty(this,internal$1,{value:ConstructorFragmentInternal});defineProperties(this,{payable:payable,gas:gas})}format(format){assert(format!=null&&format!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"});if(format==="json"){return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:undefined,inputs:this.inputs.map(i=>JSON.parse(i.format(format)))})}const result=[`constructor${joinParams(format,this.inputs)}`];if(this.payable){result.push("payable")}if(this.gas!=null){result.push(`@${this.gas.toString()}`)}return result.join(" ")}static from(obj){if(ConstructorFragment.isFragment(obj)){return obj}if(typeof obj==="string"){try{return ConstructorFragment.from(lex(obj))}catch(error){assertArgument(false,"invalid constuctor fragment","obj",obj)}}else if(obj instanceof TokenString){consumeKeywords(obj,setify(["constructor"]));const inputs=consumeParams(obj);const payable=!!consumeKeywords(obj,KwVisibDeploy).has("payable");const gas=consumeGas(obj);consumeEoi(obj);return new ConstructorFragment(_guard$2,"constructor",inputs,payable,gas)}return new ConstructorFragment(_guard$2,"constructor",obj.inputs?obj.inputs.map(ParamType.from):[],!!obj.payable,obj.gas!=null?obj.gas:null)}static isFragment(value){return value&&value[internal$1]===ConstructorFragmentInternal}}class FallbackFragment extends Fragment{payable;constructor(guard,inputs,payable){super(guard,"fallback",inputs);Object.defineProperty(this,internal$1,{value:FallbackFragmentInternal});defineProperties(this,{payable:payable})}format(format){const type=this.inputs.length===0?"receive":"fallback";if(format==="json"){const stateMutability=this.payable?"payable":"nonpayable";return JSON.stringify({type:type,stateMutability:stateMutability})}return`${type}()${this.payable?" payable":""}`}static from(obj){if(FallbackFragment.isFragment(obj)){return obj}if(typeof obj==="string"){try{return FallbackFragment.from(lex(obj))}catch(error){assertArgument(false,"invalid fallback fragment","obj",obj)}}else if(obj instanceof TokenString){const errorObj=obj.toString();const topIsValid=obj.peekKeyword(setify(["fallback","receive"]));assertArgument(topIsValid,"type must be fallback or receive","obj",errorObj);const type=obj.popKeyword(setify(["fallback","receive"]));if(type==="receive"){const inputs=consumeParams(obj);assertArgument(inputs.length===0,`receive cannot have arguments`,"obj.inputs",inputs);consumeKeywords(obj,setify(["payable"]));consumeEoi(obj);return new FallbackFragment(_guard$2,[],true)}let inputs=consumeParams(obj);if(inputs.length){assertArgument(inputs.length===1&&inputs[0].type==="bytes","invalid fallback inputs","obj.inputs",inputs.map(i=>i.format("minimal")).join(", "))}else{inputs=[ParamType.from("bytes")]}const mutability=consumeMutability(obj);assertArgument(mutability==="nonpayable"||mutability==="payable","fallback cannot be constants","obj.stateMutability",mutability);if(consumeKeywords(obj,setify(["returns"])).has("returns")){const outputs=consumeParams(obj);assertArgument(outputs.length===1&&outputs[0].type==="bytes","invalid fallback outputs","obj.outputs",outputs.map(i=>i.format("minimal")).join(", "))}consumeEoi(obj);return new FallbackFragment(_guard$2,inputs,mutability==="payable")}if(obj.type==="receive"){return new FallbackFragment(_guard$2,[],true)}if(obj.type==="fallback"){const inputs=[ParamType.from("bytes")];const payable=obj.stateMutability==="payable";return new FallbackFragment(_guard$2,inputs,payable)}assertArgument(false,"invalid fallback description","obj",obj)}static isFragment(value){return value&&value[internal$1]===FallbackFragmentInternal}}class FunctionFragment extends NamedFragment{constant;outputs;stateMutability;payable;gas;constructor(guard,name,stateMutability,inputs,outputs,gas){super(guard,"function",name,inputs);Object.defineProperty(this,internal$1,{value:FunctionFragmentInternal});outputs=Object.freeze(outputs.slice());const constant=stateMutability==="view"||stateMutability==="pure";const payable=stateMutability==="payable";defineProperties(this,{constant:constant,gas:gas,outputs:outputs,payable:payable,stateMutability:stateMutability})}get selector(){return id(this.format("sighash")).substring(0,10)}format(format){if(format==null){format="sighash"}if(format==="json"){return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:undefined,payable:this.payable,gas:this.gas!=null?this.gas:undefined,inputs:this.inputs.map(i=>JSON.parse(i.format(format))),outputs:this.outputs.map(o=>JSON.parse(o.format(format)))})}const result=[];if(format!=="sighash"){result.push("function")}result.push(this.name+joinParams(format,this.inputs));if(format!=="sighash"){if(this.stateMutability!=="nonpayable"){result.push(this.stateMutability)}if(this.outputs&&this.outputs.length){result.push("returns");result.push(joinParams(format,this.outputs))}if(this.gas!=null){result.push(`@${this.gas.toString()}`)}}return result.join(" ")}static getSelector(name,params){params=(params||[]).map(p=>ParamType.from(p));const fragment=new FunctionFragment(_guard$2,name,"view",params,[],null);return fragment.selector}static from(obj){if(FunctionFragment.isFragment(obj)){return obj}if(typeof obj==="string"){try{return FunctionFragment.from(lex(obj))}catch(error){assertArgument(false,"invalid function fragment","obj",obj)}}else if(obj instanceof TokenString){const name=consumeName("function",obj);const inputs=consumeParams(obj);const mutability=consumeMutability(obj);let outputs=[];if(consumeKeywords(obj,setify(["returns"])).has("returns")){outputs=consumeParams(obj)}const gas=consumeGas(obj);consumeEoi(obj);return new FunctionFragment(_guard$2,name,mutability,inputs,outputs,gas)}let stateMutability=obj.stateMutability;if(stateMutability==null){stateMutability="payable";if(typeof obj.constant==="boolean"){stateMutability="view";if(!obj.constant){stateMutability="payable";if(typeof obj.payable==="boolean"&&!obj.payable){stateMutability="nonpayable"}}}else if(typeof obj.payable==="boolean"&&!obj.payable){stateMutability="nonpayable"}}return new FunctionFragment(_guard$2,obj.name,stateMutability,obj.inputs?obj.inputs.map(ParamType.from):[],obj.outputs?obj.outputs.map(ParamType.from):[],obj.gas!=null?obj.gas:null)}static isFragment(value){return value&&value[internal$1]===FunctionFragmentInternal}}class StructFragment extends NamedFragment{constructor(guard,name,inputs){super(guard,"struct",name,inputs);Object.defineProperty(this,internal$1,{value:StructFragmentInternal})}format(){throw new Error("@TODO")}static from(obj){if(typeof obj==="string"){try{return StructFragment.from(lex(obj))}catch(error){assertArgument(false,"invalid struct fragment","obj",obj)}}else if(obj instanceof TokenString){const name=consumeName("struct",obj);const inputs=consumeParams(obj);consumeEoi(obj);return new StructFragment(_guard$2,name,inputs)}return new StructFragment(_guard$2,obj.name,obj.inputs?obj.inputs.map(ParamType.from):[])}static isFragment(value){return value&&value[internal$1]===StructFragmentInternal}}const PanicReasons$1=new Map;PanicReasons$1.set(0,"GENERIC_PANIC");PanicReasons$1.set(1,"ASSERT_FALSE");PanicReasons$1.set(17,"OVERFLOW");PanicReasons$1.set(18,"DIVIDE_BY_ZERO");PanicReasons$1.set(33,"ENUM_RANGE_ERROR");PanicReasons$1.set(34,"BAD_STORAGE_DATA");PanicReasons$1.set(49,"STACK_UNDERFLOW");PanicReasons$1.set(50,"ARRAY_RANGE_ERROR");PanicReasons$1.set(65,"OUT_OF_MEMORY");PanicReasons$1.set(81,"UNINITIALIZED_FUNCTION_CALL");const paramTypeBytes=new RegExp(/^bytes([0-9]*)$/);const paramTypeNumber=new RegExp(/^(u?int)([0-9]*)$/);let defaultCoder=null;let defaultMaxInflation=1024;function getBuiltinCallException(action,tx,data,abiCoder){let message="missing revert data";let reason=null;const invocation=null;let revert=null;if(data){message="execution reverted";const bytes=getBytes(data);data=hexlify(data);if(bytes.length===0){message+=" (no data present; likely require(false) occurred";reason="require(false)"}else if(bytes.length%32!==4){message+=" (could not decode reason; invalid data length)"}else if(hexlify(bytes.slice(0,4))==="0x08c379a0"){try{reason=abiCoder.decode(["string"],bytes.slice(4))[0];revert={signature:"Error(string)",name:"Error",args:[reason]};message+=`: ${JSON.stringify(reason)}`}catch(error){message+=" (could not decode reason; invalid string data)"}}else if(hexlify(bytes.slice(0,4))==="0x4e487b71"){try{const code=Number(abiCoder.decode(["uint256"],bytes.slice(4))[0]);revert={signature:"Panic(uint256)",name:"Panic",args:[code]};reason=`Panic due to ${PanicReasons$1.get(code)||"UNKNOWN"}(${code})`;message+=`: ${reason}`}catch(error){message+=" (could not decode panic code)"}}else{message+=" (unknown custom error)"}}const transaction={to:tx.to?getAddress(tx.to):null,data:tx.data||"0x"};if(tx.from){transaction.from=getAddress(tx.from)}return makeError(message,"CALL_EXCEPTION",{action:action,data:data,reason:reason,transaction:transaction,invocation:invocation,revert:revert})}class AbiCoder{#getCoder(param){if(param.isArray()){return new ArrayCoder(this.#getCoder(param.arrayChildren),param.arrayLength,param.name)}if(param.isTuple()){return new TupleCoder(param.components.map(c=>this.#getCoder(c)),param.name)}switch(param.baseType){case"address":return new AddressCoder(param.name);case"bool":return new BooleanCoder(param.name);case"string":return new StringCoder(param.name);case"bytes":return new BytesCoder(param.name);case"":return new NullCoder(param.name)}let match=param.type.match(paramTypeNumber);if(match){let size=parseInt(match[2]||"256");assertArgument(size!==0&&size<=256&&size%8===0,"invalid "+match[1]+" bit length","param",param);return new NumberCoder(size/8,match[1]==="int",param.name)}match=param.type.match(paramTypeBytes);if(match){let size=parseInt(match[1]);assertArgument(size!==0&&size<=32,"invalid bytes length","param",param);return new FixedBytesCoder(size,param.name)}assertArgument(false,"invalid type","type",param.type)}getDefaultValue(types){const coders=types.map(type=>this.#getCoder(ParamType.from(type)));const coder=new TupleCoder(coders,"_");return coder.defaultValue()}encode(types,values){assertArgumentCount(values.length,types.length,"types/values length mismatch");const coders=types.map(type=>this.#getCoder(ParamType.from(type)));const coder=new TupleCoder(coders,"_");const writer=new Writer;coder.encode(writer,values);return writer.data}decode(types,data,loose){const coders=types.map(type=>this.#getCoder(ParamType.from(type)));const coder=new TupleCoder(coders,"_");return coder.decode(new Reader(data,loose,defaultMaxInflation))}static _setDefaultMaxInflation(value){assertArgument(typeof value==="number"&&Number.isInteger(value),"invalid defaultMaxInflation factor","value",value);defaultMaxInflation=value}static defaultAbiCoder(){if(defaultCoder==null){defaultCoder=new AbiCoder}return defaultCoder}static getBuiltinCallException(action,tx,data){return getBuiltinCallException(action,tx,data,AbiCoder.defaultAbiCoder())}}function encodeBytes32String(text){const bytes=toUtf8Bytes(text);if(bytes.length>31){throw new Error("bytes32 string must be less than 32 bytes")}return zeroPadBytes(bytes,32)}function decodeBytes32String(_bytes){const data=getBytes(_bytes,"bytes");if(data.length!==32){throw new Error("invalid bytes32 - not 32 bytes long")}if(data[31]!==0){throw new Error("invalid bytes32 string - no null terminator")}let length=31;while(data[length-1]===0){length--}return toUtf8String(data.slice(0,length))}class LogDescription{fragment;name;signature;topic;args;constructor(fragment,topic,args){const name=fragment.name,signature=fragment.format();defineProperties(this,{fragment:fragment,name:name,signature:signature,topic:topic,args:args})}}class TransactionDescription{fragment;name;args;signature;selector;value;constructor(fragment,selector,args,value){const name=fragment.name,signature=fragment.format();defineProperties(this,{fragment:fragment,name:name,args:args,signature:signature,selector:selector,value:value})}}class ErrorDescription{fragment;name;args;signature;selector;constructor(fragment,selector,args){const name=fragment.name,signature=fragment.format();defineProperties(this,{fragment:fragment,name:name,args:args,signature:signature,selector:selector})}}class Indexed{hash;_isIndexed;static isIndexed(value){return!!(value&&value._isIndexed)}constructor(hash){defineProperties(this,{hash:hash,_isIndexed:true})}}const PanicReasons={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"};const BuiltinErrors={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:message=>{return`reverted with reason string ${JSON.stringify(message)}`}},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:code=>{let reason="unknown panic code";if(code>=0&&code<=255&&PanicReasons[code.toString()]){reason=PanicReasons[code.toString()]}return`reverted with panic code 0x${code.toString(16)} (${reason})`}}};class Interface{fragments;deploy;fallback;receive;#errors;#events;#functions;#abiCoder;constructor(fragments){let abi=[];if(typeof fragments==="string"){abi=JSON.parse(fragments)}else{abi=fragments}this.#functions=new Map;this.#errors=new Map;this.#events=new Map;const frags=[];for(const a of abi){try{frags.push(Fragment.from(a))}catch(error){console.log(`[Warning] Invalid Fragment ${JSON.stringify(a)}:`,error.message)}}defineProperties(this,{fragments:Object.freeze(frags)});let fallback=null;let receive=false;this.#abiCoder=this.getAbiCoder();this.fragments.forEach((fragment,index)=>{let bucket;switch(fragment.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}defineProperties(this,{deploy:fragment});return;case"fallback":if(fragment.inputs.length===0){receive=true}else{assertArgument(!fallback||fragment.payable!==fallback.payable,"conflicting fallback fragments",`fragments[${index}]`,fragment);fallback=fragment;receive=fallback.payable}return;case"function":bucket=this.#functions;break;case"event":bucket=this.#events;break;case"error":bucket=this.#errors;break;default:return}const signature=fragment.format();if(bucket.has(signature)){return}bucket.set(signature,fragment)});if(!this.deploy){defineProperties(this,{deploy:ConstructorFragment.from("constructor()")})}defineProperties(this,{fallback:fallback,receive:receive})}format(minimal){const format=minimal?"minimal":"full";const abi=this.fragments.map(f=>f.format(format));return abi}formatJson(){const abi=this.fragments.map(f=>f.format("json"));return JSON.stringify(abi.map(j=>JSON.parse(j)))}getAbiCoder(){return AbiCoder.defaultAbiCoder()}#getFunction(key,values,forceUnique){if(isHexString(key)){const selector=key.toLowerCase();for(const fragment of this.#functions.values()){if(selector===fragment.selector){return fragment}}return null}if(key.indexOf("(")===-1){const matching=[];for(const[name,fragment]of this.#functions){if(name.split("(")[0]===key){matching.push(fragment)}}if(values){const lastValue=values.length>0?values[values.length-1]:null;let valueLength=values.length;let allowOptions=true;if(Typed.isTyped(lastValue)&&lastValue.type==="overrides"){allowOptions=false;valueLength--}for(let i=matching.length-1;i>=0;i--){const inputs=matching[i].inputs.length;if(inputs!==valueLength&&(!allowOptions||inputs!==valueLength-1)){matching.splice(i,1)}}for(let i=matching.length-1;i>=0;i--){const inputs=matching[i].inputs;for(let j=0;j=inputs.length){if(values[j].type==="overrides"){continue}matching.splice(i,1);break}if(values[j].type!==inputs[j].baseType){matching.splice(i,1);break}}}}if(matching.length===1&&values&&values.length!==matching[0].inputs.length){const lastArg=values[values.length-1];if(lastArg==null||Array.isArray(lastArg)||typeof lastArg!=="object"){matching.splice(0,1)}}if(matching.length===0){return null}if(matching.length>1&&forceUnique){const matchStr=matching.map(m=>JSON.stringify(m.format())).join(", ");assertArgument(false,`ambiguous function description (i.e. matches ${matchStr})`,"key",key)}return matching[0]}const result=this.#functions.get(FunctionFragment.from(key).format());if(result){return result}return null}getFunctionName(key){const fragment=this.#getFunction(key,null,false);assertArgument(fragment,"no matching function","key",key);return fragment.name}hasFunction(key){return!!this.#getFunction(key,null,false)}getFunction(key,values){return this.#getFunction(key,values||null,true)}forEachFunction(callback){const names=Array.from(this.#functions.keys());names.sort((a,b)=>a.localeCompare(b));for(let i=0;i=0;i--){if(matching[i].inputs.length=0;i--){const inputs=matching[i].inputs;for(let j=0;j1&&forceUnique){const matchStr=matching.map(m=>JSON.stringify(m.format())).join(", ");assertArgument(false,`ambiguous event description (i.e. matches ${matchStr})`,"key",key)}return matching[0]}const result=this.#events.get(EventFragment.from(key).format());if(result){return result}return null}getEventName(key){const fragment=this.#getEvent(key,null,false);assertArgument(fragment,"no matching event","key",key);return fragment.name}hasEvent(key){return!!this.#getEvent(key,null,false)}getEvent(key,values){return this.#getEvent(key,values||null,true)}forEachEvent(callback){const names=Array.from(this.#events.keys());names.sort((a,b)=>a.localeCompare(b));for(let i=0;i1){const matchStr=matching.map(m=>JSON.stringify(m.format())).join(", ");assertArgument(false,`ambiguous error description (i.e. ${matchStr})`,"name",key)}return matching[0]}key=ErrorFragment.from(key).format();if(key==="Error(string)"){return ErrorFragment.from("error Error(string)")}if(key==="Panic(uint256)"){return ErrorFragment.from("error Panic(uint256)")}const result=this.#errors.get(key);if(result){return result}return null}forEachError(callback){const names=Array.from(this.#errors.keys());names.sort((a,b)=>a.localeCompare(b));for(let i=0;i{if(param.type==="string"){return id(value)}else if(param.type==="bytes"){return keccak256(hexlify(value))}if(param.type==="bool"&&typeof value==="boolean"){value=value?"0x01":"0x00"}else if(param.type.match(/^u?int/)){value=toBeHex(value)}else if(param.type.match(/^bytes/)){value=zeroPadBytes(value,32)}else if(param.type==="address"){this.#abiCoder.encode(["address"],[value])}return zeroPadValue(hexlify(value),32)};values.forEach((value,index)=>{const param=fragment.inputs[index];if(!param.indexed){assertArgument(value==null,"cannot filter non-indexed parameters; must be null","contract."+param.name,value);return}if(value==null){topics.push(null)}else if(param.baseType==="array"||param.baseType==="tuple"){assertArgument(false,"filtering with tuples or arrays not supported","contract."+param.name,value)}else if(Array.isArray(value)){topics.push(value.map(value=>encodeTopic(param,value)))}else{topics.push(encodeTopic(param,value))}});while(topics.length&&topics[topics.length-1]===null){topics.pop()}return topics}encodeEventLog(fragment,values){if(typeof fragment==="string"){const f=this.getEvent(fragment);assertArgument(f,"unknown event","eventFragment",fragment);fragment=f}const topics=[];const dataTypes=[];const dataValues=[];if(!fragment.anonymous){topics.push(fragment.topicHash)}assertArgument(values.length===fragment.inputs.length,"event arguments/values mismatch","values",values);fragment.inputs.forEach((param,index)=>{const value=values[index];if(param.indexed){if(param.type==="string"){topics.push(id(value))}else if(param.type==="bytes"){topics.push(keccak256(value))}else if(param.baseType==="tuple"||param.baseType==="array"){throw new Error("not implemented")}else{topics.push(this.#abiCoder.encode([param.type],[value]))}}else{dataTypes.push(param);dataValues.push(value)}});return{data:this.#abiCoder.encode(dataTypes,dataValues),topics:topics}}decodeEventLog(fragment,data,topics){if(typeof fragment==="string"){const f=this.getEvent(fragment);assertArgument(f,"unknown event","eventFragment",fragment);fragment=f}if(topics!=null&&!fragment.anonymous){const eventTopic=fragment.topicHash;assertArgument(isHexString(topics[0],32)&&topics[0].toLowerCase()===eventTopic,"fragment/topic mismatch","topics[0]",topics[0]);topics=topics.slice(1)}const indexed=[];const nonIndexed=[];const dynamic=[];fragment.inputs.forEach((param,index)=>{if(param.indexed){if(param.type==="string"||param.type==="bytes"||param.baseType==="tuple"||param.baseType==="array"){indexed.push(ParamType.from({type:"bytes32",name:param.name}));dynamic.push(true)}else{indexed.push(param);dynamic.push(false)}}else{nonIndexed.push(param);dynamic.push(false)}});const resultIndexed=topics!=null?this.#abiCoder.decode(indexed,concat(topics)):null;const resultNonIndexed=this.#abiCoder.decode(nonIndexed,data,true);const values=[];const keys=[];let nonIndexedIndex=0,indexedIndex=0;fragment.inputs.forEach((param,index)=>{let value=null;if(param.indexed){if(resultIndexed==null){value=new Indexed(null)}else if(dynamic[index]){value=new Indexed(resultIndexed[indexedIndex++])}else{try{value=resultIndexed[indexedIndex++]}catch(error){value=error}}}else{try{value=resultNonIndexed[nonIndexedIndex++]}catch(error){value=error}}values.push(value);keys.push(param.name||null)});return Result.fromItems(values,keys)}parseTransaction(tx){const data=getBytes(tx.data,"tx.data");const value=getBigInt(tx.value!=null?tx.value:0,"tx.value");const fragment=this.getFunction(hexlify(data.slice(0,4)));if(!fragment){return null}const args=this.#abiCoder.decode(fragment.inputs,data.slice(4));return new TransactionDescription(fragment,fragment.selector,args,value)}parseCallResult(data){throw new Error("@TODO")}parseLog(log){const fragment=this.getEvent(log.topics[0]);if(!fragment||fragment.anonymous){return null}return new LogDescription(fragment,fragment.topicHash,this.decodeEventLog(fragment,log.data,log.topics))}parseError(data){const hexData=hexlify(data);const fragment=this.getError(dataSlice(hexData,0,4));if(!fragment){return null}const args=this.#abiCoder.decode(fragment.inputs,dataSlice(hexData,4));return new ErrorDescription(fragment,fragment.selector,args)}static from(value){if(value instanceof Interface){return value}if(typeof value==="string"){return new Interface(JSON.parse(value))}if(typeof value.formatJson==="function"){return new Interface(value.formatJson())}if(typeof value.format==="function"){return new Interface(value.format("json"))}return new Interface(value)}}const BN_0$2=BigInt(0);function getValue(value){if(value==null){return null}return value}function toJson(value){if(value==null){return null}return value.toString()}class FeeData{gasPrice;maxFeePerGas;maxPriorityFeePerGas;constructor(gasPrice,maxFeePerGas,maxPriorityFeePerGas){defineProperties(this,{gasPrice:getValue(gasPrice),maxFeePerGas:getValue(maxFeePerGas),maxPriorityFeePerGas:getValue(maxPriorityFeePerGas)})}toJSON(){const{gasPrice,maxFeePerGas,maxPriorityFeePerGas}=this;return{_type:"FeeData",gasPrice:toJson(gasPrice),maxFeePerGas:toJson(maxFeePerGas),maxPriorityFeePerGas:toJson(maxPriorityFeePerGas)}}}function copyRequest(req){const result={};if(req.to){result.to=req.to}if(req.from){result.from=req.from}if(req.data){result.data=hexlify(req.data)}const bigIntKeys="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const key of bigIntKeys){if(!(key in req)||req[key]==null){continue}result[key]=getBigInt(req[key],`request.${key}`)}const numberKeys="type,nonce".split(/,/);for(const key of numberKeys){if(!(key in req)||req[key]==null){continue}result[key]=getNumber(req[key],`request.${key}`)}if(req.accessList){result.accessList=accessListify(req.accessList)}if(req.authorizationList){result.authorizationList=req.authorizationList.slice()}if("blockTag"in req){result.blockTag=req.blockTag}if("enableCcipRead"in req){result.enableCcipRead=!!req.enableCcipRead}if("customData"in req){result.customData=req.customData}if("blobVersionedHashes"in req&&req.blobVersionedHashes){result.blobVersionedHashes=req.blobVersionedHashes.slice()}if("kzg"in req){result.kzg=req.kzg}if("blobWrapperVersion"in req){result.blobWrapperVersion=req.blobWrapperVersion}if("blobs"in req&&req.blobs){result.blobs=req.blobs.map(b=>{if(isBytesLike(b)){return hexlify(b)}return Object.assign({},b)})}return result}class Block{provider;number;hash;timestamp;parentHash;parentBeaconBlockRoot;nonce;difficulty;gasLimit;gasUsed;stateRoot;receiptsRoot;blobGasUsed;excessBlobGas;miner;prevRandao;extraData;baseFeePerGas;#transactions;constructor(block,provider){this.#transactions=block.transactions.map(tx=>{if(typeof tx!=="string"){return new TransactionResponse(tx,provider)}return tx});defineProperties(this,{provider:provider,hash:getValue(block.hash),number:block.number,timestamp:block.timestamp,parentHash:block.parentHash,parentBeaconBlockRoot:block.parentBeaconBlockRoot,nonce:block.nonce,difficulty:block.difficulty,gasLimit:block.gasLimit,gasUsed:block.gasUsed,blobGasUsed:block.blobGasUsed,excessBlobGas:block.excessBlobGas,miner:block.miner,prevRandao:getValue(block.prevRandao),extraData:block.extraData,baseFeePerGas:getValue(block.baseFeePerGas),stateRoot:block.stateRoot,receiptsRoot:block.receiptsRoot})}get transactions(){return this.#transactions.map(tx=>{if(typeof tx==="string"){return tx}return tx.hash})}get prefetchedTransactions(){const txs=this.#transactions.slice();if(txs.length===0){return[]}assert(typeof txs[0]==="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"});return txs}toJSON(){const{baseFeePerGas,difficulty,extraData,gasLimit,gasUsed,hash,miner,prevRandao,nonce,number,parentHash,parentBeaconBlockRoot,stateRoot,receiptsRoot,timestamp,transactions}=this;return{_type:"Block",baseFeePerGas:toJson(baseFeePerGas),difficulty:toJson(difficulty),extraData:extraData,gasLimit:toJson(gasLimit),gasUsed:toJson(gasUsed),blobGasUsed:toJson(this.blobGasUsed),excessBlobGas:toJson(this.excessBlobGas),hash:hash,miner:miner,prevRandao:prevRandao,nonce:nonce,number:number,parentHash:parentHash,timestamp:timestamp,parentBeaconBlockRoot:parentBeaconBlockRoot,stateRoot:stateRoot,receiptsRoot:receiptsRoot,transactions:transactions}}[Symbol.iterator](){let index=0;const txs=this.transactions;return{next:()=>{if(index{return new Log(log,provider)}));let gasPrice=BN_0$2;if(tx.effectiveGasPrice!=null){gasPrice=tx.effectiveGasPrice}else if(tx.gasPrice!=null){gasPrice=tx.gasPrice}defineProperties(this,{provider:provider,to:tx.to,from:tx.from,contractAddress:tx.contractAddress,hash:tx.hash,index:tx.index,blockHash:tx.blockHash,blockNumber:tx.blockNumber,logsBloom:tx.logsBloom,gasUsed:tx.gasUsed,cumulativeGasUsed:tx.cumulativeGasUsed,blobGasUsed:tx.blobGasUsed,gasPrice:gasPrice,blobGasPrice:tx.blobGasPrice,type:tx.type,status:tx.status,root:tx.root})}get logs(){return this.#logs}toJSON(){const{to,from,contractAddress,hash,index,blockHash,blockNumber,logsBloom,logs,status,root}=this;return{_type:"TransactionReceipt",blockHash:blockHash,blockNumber:blockNumber,contractAddress:contractAddress,cumulativeGasUsed:toJson(this.cumulativeGasUsed),from:from,gasPrice:toJson(this.gasPrice),blobGasUsed:toJson(this.blobGasUsed),blobGasPrice:toJson(this.blobGasPrice),gasUsed:toJson(this.gasUsed),hash:hash,index:index,logs:logs,logsBloom:logsBloom,root:root,status:status,to:to}}get length(){return this.logs.length}[Symbol.iterator](){let index=0;return{next:()=>{if(index{if(stopScanning){return null}const{blockNumber,nonce}=await resolveProperties({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(nonce{if(receipt==null||receipt.status!==0){return receipt}assert(false,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:receipt.to,from:receipt.from,data:""},receipt:receipt})};const receipt=await this.provider.getTransactionReceipt(this.hash);if(confirms===0){return checkReceipt(receipt)}if(receipt){if(confirms===1||await receipt.confirmations()>=confirms){return checkReceipt(receipt)}}else{await checkReplacement();if(confirms===0){return null}}const waiter=new Promise((resolve,reject)=>{const cancellers=[];const cancel=()=>{cancellers.forEach(c=>c())};cancellers.push(()=>{stopScanning=true});if(timeout>0){const timer=setTimeout(()=>{cancel();reject(makeError("wait for transaction timeout","TIMEOUT"))},timeout);cancellers.push(()=>{clearTimeout(timer)})}const txListener=async receipt=>{if(await receipt.confirmations()>=confirms){cancel();try{resolve(checkReceipt(receipt))}catch(error){reject(error)}}};cancellers.push(()=>{this.provider.off(this.hash,txListener)});this.provider.on(this.hash,txListener);if(startBlock>=0){const replaceListener=async()=>{try{await checkReplacement()}catch(error){if(isError(error,"TRANSACTION_REPLACED")){cancel();reject(error);return}}if(!stopScanning){this.provider.once("block",replaceListener)}};cancellers.push(()=>{this.provider.off("block",replaceListener)});this.provider.once("block",replaceListener)}});return await waiter}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){assert(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"});return createRemovedTransactionFilter(this)}reorderedEvent(other){assert(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"});assert(!other||other.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"});return createReorderedTransactionFilter(this,other)}replaceableTransaction(startBlock){assertArgument(Number.isInteger(startBlock)&&startBlock>=0,"invalid startBlock","startBlock",startBlock);const tx=new TransactionResponse(this,this.provider);tx.#startBlock=startBlock;return tx}}function createOrphanedBlockFilter(block){return{orphan:"drop-block",hash:block.hash,number:block.number}}function createReorderedTransactionFilter(tx,other){return{orphan:"reorder-transaction",tx:tx,other:other}}function createRemovedTransactionFilter(tx){return{orphan:"drop-transaction",tx:tx}}function createRemovedLogFilter(log){return{orphan:"drop-log",log:{transactionHash:log.transactionHash,blockHash:log.blockHash,blockNumber:log.blockNumber,address:log.address,data:log.data,topics:Object.freeze(log.topics.slice()),index:log.index}}}class EventLog extends Log{interface;fragment;args;constructor(log,iface,fragment){super(log,log.provider);const args=iface.decodeEventLog(fragment,log.data,log.topics);defineProperties(this,{args:args,fragment:fragment,interface:iface})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class UndecodedEventLog extends Log{error;constructor(log,error){super(log,log.provider);defineProperties(this,{error:error})}}class ContractTransactionReceipt extends TransactionReceipt{#iface;constructor(iface,provider,tx){super(tx,provider);this.#iface=iface}get logs(){return super.logs.map(log=>{const fragment=log.topics.length?this.#iface.getEvent(log.topics[0]):null;if(fragment){try{return new EventLog(log,this.#iface,fragment)}catch(error){return new UndecodedEventLog(log,error)}}return log})}}class ContractTransactionResponse extends TransactionResponse{#iface;constructor(iface,provider,tx){super(tx,provider);this.#iface=iface}async wait(confirms,timeout){const receipt=await super.wait(confirms,timeout);if(receipt==null){return null}return new ContractTransactionReceipt(this.#iface,this.provider,receipt)}}class ContractUnknownEventPayload extends EventPayload{log;constructor(contract,listener,filter,log){super(contract,listener,filter);defineProperties(this,{log:log})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class ContractEventPayload extends ContractUnknownEventPayload{constructor(contract,listener,filter,fragment,_log){super(contract,listener,filter,new EventLog(_log,contract.interface,fragment));const args=contract.interface.decodeEventLog(fragment,this.log.data,this.log.topics);defineProperties(this,{args:args,fragment:fragment})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const BN_0$1=BigInt(0);function canCall(value){return value&&typeof value.call==="function"}function canEstimate(value){return value&&typeof value.estimateGas==="function"}function canResolve(value){return value&&typeof value.resolveName==="function"}function canSend(value){return value&&typeof value.sendTransaction==="function"}function getResolver(value){if(value!=null){if(canResolve(value)){return value}if(value.provider){return value.provider}}return undefined}class PreparedTopicFilter{#filter;fragment;constructor(contract,fragment,args){defineProperties(this,{fragment:fragment});if(fragment.inputs.length{const arg=args[index];if(arg==null){return null}return param.walkAsync(args[index],(type,value)=>{if(type==="address"){if(Array.isArray(value)){return Promise.all(value.map(v=>resolveAddress(v,resolver)))}return resolveAddress(value,resolver)}return value})}));return contract.interface.encodeFilterTopics(fragment,resolvedArgs)}()}getTopicFilter(){return this.#filter}}function getRunner(value,feature){if(value==null){return null}if(typeof value[feature]==="function"){return value}if(value.provider&&typeof value.provider[feature]==="function"){return value.provider}return null}function getProvider(value){if(value==null){return null}return value.provider||null}async function copyOverrides(arg,allowed){const _overrides=Typed.dereference(arg,"overrides");assertArgument(typeof _overrides==="object","invalid overrides parameter","overrides",arg);const overrides=copyRequest(_overrides);assertArgument(overrides.to==null||(allowed||[]).indexOf("to")>=0,"cannot override to","overrides.to",overrides.to);assertArgument(overrides.data==null||(allowed||[]).indexOf("data")>=0,"cannot override data","overrides.data",overrides.data);if(overrides.from){overrides.from=overrides.from}return overrides}async function resolveArgs(_runner,inputs,args){const runner=getRunner(_runner,"resolveName");const resolver=canResolve(runner)?runner:null;return await Promise.all(inputs.map((param,index)=>{return param.walkAsync(args[index],(type,value)=>{value=Typed.dereference(value,type);if(type==="address"){return resolveAddress(value,resolver)}return value})}))}function buildWrappedFallback(contract){const populateTransaction=async function(overrides){const tx=await copyOverrides(overrides,["data"]);tx.to=await contract.getAddress();if(tx.from){tx.from=await resolveAddress(tx.from,getResolver(contract.runner))}const iface=contract.interface;const noValue=getBigInt(tx.value||BN_0$1,"overrides.value")===BN_0$1;const noData=(tx.data||"0x")==="0x";if(iface.fallback&&!iface.fallback.payable&&iface.receive&&!noData&&!noValue){assertArgument(false,"cannot send data to receive or send value to non-payable fallback","overrides",overrides)}assertArgument(iface.fallback||noData,"cannot send data to receive-only contract","overrides.data",tx.data);const payable=iface.receive||iface.fallback&&iface.fallback.payable;assertArgument(payable||noValue,"cannot send value to non-payable fallback","overrides.value",tx.value);assertArgument(iface.fallback||noData,"cannot send data to receive-only contract","overrides.data",tx.data);return tx};const staticCall=async function(overrides){const runner=getRunner(contract.runner,"call");assert(canCall(runner),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const tx=await populateTransaction(overrides);try{return await runner.call(tx)}catch(error){if(isCallException(error)&&error.data){throw contract.interface.makeError(error.data,tx)}throw error}};const send=async function(overrides){const runner=contract.runner;assert(canSend(runner),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const tx=await runner.sendTransaction(await populateTransaction(overrides));const provider=getProvider(contract.runner);return new ContractTransactionResponse(contract.interface,provider,tx)};const estimateGas=async function(overrides){const runner=getRunner(contract.runner,"estimateGas");assert(canEstimate(runner),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"});return await runner.estimateGas(await populateTransaction(overrides))};const method=async overrides=>{return await send(overrides)};defineProperties(method,{_contract:contract,estimateGas:estimateGas,populateTransaction:populateTransaction,send:send,staticCall:staticCall});return method}function buildWrappedMethod(contract,key){const getFragment=function(...args){const fragment=contract.interface.getFunction(key,args);assert(fragment,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:key,args:args}});return fragment};const populateTransaction=async function(...args){const fragment=getFragment(...args);let overrides={};if(fragment.inputs.length+1===args.length){overrides=await copyOverrides(args.pop());if(overrides.from){overrides.from=await resolveAddress(overrides.from,getResolver(contract.runner))}}if(fragment.inputs.length!==args.length){throw new Error("internal error: fragment inputs doesn't match arguments; should not happen")}const resolvedArgs=await resolveArgs(contract.runner,fragment.inputs,args);return Object.assign({},overrides,await resolveProperties({to:contract.getAddress(),data:contract.interface.encodeFunctionData(fragment,resolvedArgs)}))};const staticCall=async function(...args){const result=await staticCallResult(...args);if(result.length===1){return result[0]}return result};const send=async function(...args){const runner=contract.runner;assert(canSend(runner),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const tx=await runner.sendTransaction(await populateTransaction(...args));const provider=getProvider(contract.runner);return new ContractTransactionResponse(contract.interface,provider,tx)};const estimateGas=async function(...args){const runner=getRunner(contract.runner,"estimateGas");assert(canEstimate(runner),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"});return await runner.estimateGas(await populateTransaction(...args))};const staticCallResult=async function(...args){const runner=getRunner(contract.runner,"call");assert(canCall(runner),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const tx=await populateTransaction(...args);let result="0x";try{result=await runner.call(tx)}catch(error){if(isCallException(error)&&error.data){throw contract.interface.makeError(error.data,tx)}throw error}const fragment=getFragment(...args);return contract.interface.decodeFunctionResult(fragment,result)};const method=async(...args)=>{const fragment=getFragment(...args);if(fragment.constant){return await staticCall(...args)}return await send(...args)};defineProperties(method,{name:contract.interface.getFunctionName(key),_contract:contract,_key:key,getFragment:getFragment,estimateGas:estimateGas,populateTransaction:populateTransaction,send:send,staticCall:staticCall,staticCallResult:staticCallResult});Object.defineProperty(method,"fragment",{configurable:false,enumerable:true,get:()=>{const fragment=contract.interface.getFunction(key);assert(fragment,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:key}});return fragment}});return method}function buildWrappedEvent(contract,key){const getFragment=function(...args){const fragment=contract.interface.getEvent(key,args);assert(fragment,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:key,args:args}});return fragment};const method=function(...args){return new PreparedTopicFilter(contract,getFragment(...args),args)};defineProperties(method,{name:contract.interface.getEventName(key),_contract:contract,_key:key,getFragment:getFragment});Object.defineProperty(method,"fragment",{configurable:false,enumerable:true,get:()=>{const fragment=contract.interface.getEvent(key);assert(fragment,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:key}});return fragment}});return method}const internal=Symbol.for("_ethersInternal_contract");const internalValues=new WeakMap;function setInternal(contract,values){internalValues.set(contract[internal],values)}function getInternal(contract){return internalValues.get(contract[internal])}function isDeferred(value){return value&&typeof value==="object"&&"getTopicFilter"in value&&typeof value.getTopicFilter==="function"&&value.fragment}async function getSubInfo(contract,event){let topics;let fragment=null;if(Array.isArray(event)){const topicHashify=function(name){if(isHexString(name,32)){return name}const fragment=contract.interface.getEvent(name);assertArgument(fragment,"unknown fragment","name",name);return fragment.topicHash};topics=event.map(e=>{if(e==null){return null}if(Array.isArray(e)){return e.map(topicHashify)}return topicHashify(e)})}else if(event==="*"){topics=[null]}else if(typeof event==="string"){if(isHexString(event,32)){topics=[event]}else{fragment=contract.interface.getEvent(event);assertArgument(fragment,"unknown fragment","event",event);topics=[fragment.topicHash]}}else if(isDeferred(event)){topics=await event.getTopicFilter()}else if("fragment"in event){fragment=event.fragment;topics=[fragment.topicHash]}else{assertArgument(false,"unknown event name","event",event)}topics=topics.map(t=>{if(t==null){return null}if(Array.isArray(t)){const items=Array.from(new Set(t.map(t=>t.toLowerCase())).values());if(items.length===1){return items[0]}items.sort();return items}return t.toLowerCase()});const tag=topics.map(t=>{if(t==null){return"null"}if(Array.isArray(t)){return t.join("|")}return t}).join("&");return{fragment:fragment,tag:tag,topics:topics}}async function hasSub(contract,event){const{subs}=getInternal(contract);return subs.get((await getSubInfo(contract,event)).tag)||null}async function getSub(contract,operation,event){const provider=getProvider(contract.runner);assert(provider,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:operation});const{fragment,tag,topics}=await getSubInfo(contract,event);const{addr,subs}=getInternal(contract);let sub=subs.get(tag);if(!sub){const address=addr?addr:contract;const filter={address:address,topics:topics};const listener=log=>{let foundFragment=fragment;if(foundFragment==null){try{foundFragment=contract.interface.getEvent(log.topics[0])}catch(error){}}if(foundFragment){const _foundFragment=foundFragment;const args=fragment?contract.interface.decodeEventLog(fragment,log.data,log.topics):[];emit(contract,event,args,listener=>{return new ContractEventPayload(contract,listener,event,_foundFragment,log)})}else{emit(contract,event,[],listener=>{return new ContractUnknownEventPayload(contract,listener,event,log)})}};let starting=[];const start=()=>{if(starting.length){return}starting.push(provider.on(filter,listener))};const stop=async()=>{if(starting.length==0){return}let started=starting;starting=[];await Promise.all(started);provider.off(filter,listener)};sub={tag:tag,listeners:[],start:start,stop:stop};subs.set(tag,sub)}return sub}let lastEmit=Promise.resolve();async function _emit(contract,event,args,payloadFunc){await lastEmit;const sub=await hasSub(contract,event);if(!sub){return false}const count=sub.listeners.length;sub.listeners=sub.listeners.filter(({listener,once})=>{const passArgs=Array.from(args);if(payloadFunc){passArgs.push(payloadFunc(once?null:listener))}try{listener.call(contract,...passArgs)}catch(error){}return!once});if(sub.listeners.length===0){sub.stop();getInternal(contract).subs.delete(sub.tag)}return count>0}async function emit(contract,event,args,payloadFunc){try{await lastEmit}catch(error){}const resultPromise=_emit(contract,event,args,payloadFunc);lastEmit=resultPromise;return await resultPromise}const passProperties=["then"];class BaseContract{target;interface;runner;filters;[internal];fallback;constructor(target,abi,runner,_deployTx){assertArgument(typeof target==="string"||isAddressable(target),"invalid value for Contract target","target",target);if(runner==null){runner=null}const iface=Interface.from(abi);defineProperties(this,{target:target,runner:runner,interface:iface});Object.defineProperty(this,internal,{value:{}});let addrPromise;let addr=null;let deployTx=null;if(_deployTx){const provider=getProvider(runner);deployTx=new ContractTransactionResponse(this.interface,provider,_deployTx)}let subs=new Map;if(typeof target==="string"){if(isHexString(target)){addr=target;addrPromise=Promise.resolve(target)}else{const resolver=getRunner(runner,"resolveName");if(!canResolve(resolver)){throw makeError("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"})}addrPromise=resolver.resolveName(target).then(addr=>{if(addr==null){throw makeError("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:target})}getInternal(this).addr=addr;return addr})}}else{addrPromise=target.getAddress().then(addr=>{if(addr==null){throw new Error("TODO")}getInternal(this).addr=addr;return addr})}setInternal(this,{addrPromise:addrPromise,addr:addr,deployTx:deployTx,subs:subs});const filters=new Proxy({},{get:(target,prop,receiver)=>{if(typeof prop==="symbol"||passProperties.indexOf(prop)>=0){return Reflect.get(target,prop,receiver)}try{return this.getEvent(prop)}catch(error){if(!isError(error,"INVALID_ARGUMENT")||error.argument!=="key"){throw error}}return undefined},has:(target,prop)=>{if(passProperties.indexOf(prop)>=0){return Reflect.has(target,prop)}return Reflect.has(target,prop)||this.interface.hasEvent(String(prop))}});defineProperties(this,{filters:filters});defineProperties(this,{fallback:iface.receive||iface.fallback?buildWrappedFallback(this):null});return new Proxy(this,{get:(target,prop,receiver)=>{if(typeof prop==="symbol"||prop in target||passProperties.indexOf(prop)>=0){return Reflect.get(target,prop,receiver)}try{return target.getFunction(prop)}catch(error){if(!isError(error,"INVALID_ARGUMENT")||error.argument!=="key"){throw error}}return undefined},has:(target,prop)=>{if(typeof prop==="symbol"||prop in target||passProperties.indexOf(prop)>=0){return Reflect.has(target,prop)}return target.interface.hasFunction(prop)}})}connect(runner){return new BaseContract(this.target,this.interface,runner)}attach(target){return new BaseContract(target,this.interface,this.runner)}async getAddress(){return await getInternal(this).addrPromise}async getDeployedCode(){const provider=getProvider(this.runner);assert(provider,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const code=await provider.getCode(await this.getAddress());if(code==="0x"){return null}return code}async waitForDeployment(){const deployTx=this.deploymentTransaction();if(deployTx){await deployTx.wait();return this}const code=await this.getDeployedCode();if(code!=null){return this}const provider=getProvider(this.runner);assert(provider!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"});return new Promise((resolve,reject)=>{const checkCode=async()=>{try{const code=await this.getDeployedCode();if(code!=null){return resolve(this)}provider.once("block",checkCode)}catch(error){reject(error)}};checkCode()})}deploymentTransaction(){return getInternal(this).deployTx}getFunction(key){if(typeof key!=="string"){key=key.format()}const func=buildWrappedMethod(this,key);return func}getEvent(key){if(typeof key!=="string"){key=key.format()}return buildWrappedEvent(this,key)}async queryTransaction(hash){throw new Error("@TODO")}async queryFilter(event,fromBlock,toBlock){if(fromBlock==null){fromBlock=0}if(toBlock==null){toBlock="latest"}const{addr,addrPromise}=getInternal(this);const address=addr?addr:await addrPromise;const{fragment,topics}=await getSubInfo(this,event);const filter={address:address,topics:topics,fromBlock:fromBlock,toBlock:toBlock};const provider=getProvider(this.runner);assert(provider,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"});return(await provider.getLogs(filter)).map(log=>{let foundFragment=fragment;if(foundFragment==null){try{foundFragment=this.interface.getEvent(log.topics[0])}catch(error){}}if(foundFragment){try{return new EventLog(log,this.interface,foundFragment)}catch(error){return new UndecodedEventLog(log,error)}}return new Log(log,provider)})}async on(event,listener){const sub=await getSub(this,"on",event);sub.listeners.push({listener:listener,once:false});sub.start();return this}async once(event,listener){const sub=await getSub(this,"once",event);sub.listeners.push({listener:listener,once:true});sub.start();return this}async emit(event,...args){return await emit(this,event,args,null)}async listenerCount(event){if(event){const sub=await hasSub(this,event);if(!sub){return 0}return sub.listeners.length}const{subs}=getInternal(this);let total=0;for(const{listeners}of subs.values()){total+=listeners.length}return total}async listeners(event){if(event){const sub=await hasSub(this,event);if(!sub){return[]}return sub.listeners.map(({listener})=>listener)}const{subs}=getInternal(this);let result=[];for(const{listeners}of subs.values()){result=result.concat(listeners.map(({listener})=>listener))}return result}async off(event,listener){const sub=await hasSub(this,event);if(!sub){return this}if(listener){const index=sub.listeners.map(({listener})=>listener).indexOf(listener);if(index>=0){sub.listeners.splice(index,1)}}if(listener==null||sub.listeners.length===0){sub.stop();getInternal(this).subs.delete(sub.tag)}return this}async removeAllListeners(event){if(event){const sub=await hasSub(this,event);if(!sub){return this}sub.stop();getInternal(this).subs.delete(sub.tag)}else{const{subs}=getInternal(this);for(const{tag,stop}of subs.values()){stop();subs.delete(tag)}}return this}async addListener(event,listener){return await this.on(event,listener)}async removeListener(event,listener){return await this.off(event,listener)}static buildClass(abi){class CustomContract extends BaseContract{constructor(address,runner=null){super(address,abi,runner)}}return CustomContract}static from(target,abi,runner){if(runner==null){runner=null}const contract=new this(target,abi,runner);return contract}}function _ContractBase(){return BaseContract}class Contract extends _ContractBase(){}class ContractFactory{interface;bytecode;runner;constructor(abi,bytecode,runner){const iface=Interface.from(abi);if(bytecode instanceof Uint8Array){bytecode=hexlify(getBytes(bytecode))}else{if(typeof bytecode==="object"){bytecode=bytecode.object}if(!bytecode.startsWith("0x")){bytecode="0x"+bytecode}bytecode=hexlify(getBytes(bytecode))}defineProperties(this,{bytecode:bytecode,interface:iface,runner:runner||null})}attach(target){return new BaseContract(target,this.interface,this.runner)}async getDeployTransaction(...args){let overrides={};const fragment=this.interface.deploy;if(fragment.inputs.length+1===args.length){overrides=await copyOverrides(args.pop())}if(fragment.inputs.length!==args.length){throw new Error("incorrect number of arguments to constructor")}const resolvedArgs=await resolveArgs(this.runner,fragment.inputs,args);const data=concat([this.bytecode,this.interface.encodeDeploy(resolvedArgs)]);return Object.assign({},overrides,{data:data})}async deploy(...args){const tx=await this.getDeployTransaction(...args);assert(this.runner&&typeof this.runner.sendTransaction==="function","factory runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const sentTx=await this.runner.sendTransaction(tx);const address=getCreateAddress(sentTx);return new BaseContract(address,this.interface,this.runner,sentTx)}connect(runner){return new ContractFactory(this.interface,this.bytecode,runner)}static fromSolidity(output,runner){assertArgument(output!=null,"bad compiler output","output",output);if(typeof output==="string"){output=JSON.parse(output)}const abi=output.abi;let bytecode="";if(output.bytecode){bytecode=output.bytecode}else if(output.evm&&output.evm.bytecode){bytecode=output.evm.bytecode}return new this(abi,bytecode,runner)}}function getIpfsLink(link){if(link.match(/^ipfs:\/\/ipfs\//i)){link=link.substring(12)}else if(link.match(/^ipfs:\/\//i)){link=link.substring(7)}else{assertArgument(false,"unsupported IPFS format","link",link)}return`https:/\/gateway.ipfs.io/ipfs/${link}`}class MulticoinProviderPlugin{name;constructor(name){defineProperties(this,{name:name})}connect(proivder){return this}supportsCoinType(coinType){return false}async encodeAddress(coinType,address){throw new Error("unsupported coin")}async decodeAddress(coinType,data){throw new Error("unsupported coin")}}const matcherIpfs=new RegExp("^(ipfs)://(.*)$","i");const matchers=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),matcherIpfs,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];class EnsResolver{provider;address;name;#supports2544;#resolver;constructor(provider,address,name){defineProperties(this,{provider:provider,address:address,name:name});this.#supports2544=null;this.#resolver=new Contract(address,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],provider)}async supportsWildcard(){if(this.#supports2544==null){this.#supports2544=(async()=>{try{return await this.#resolver.supportsInterface("0x9061b923")}catch(error){if(isError(error,"CALL_EXCEPTION")){return false}this.#supports2544=null;throw error}})()}return await this.#supports2544}async#fetch(funcName,params){params=(params||[]).slice();const iface=this.#resolver.interface;params.unshift(namehash(this.name));let fragment=null;if(await this.supportsWildcard()){fragment=iface.getFunction(funcName);assert(fragment,"missing fragment","UNKNOWN_ERROR",{info:{funcName:funcName}});params=[dnsEncode(this.name,255),iface.encodeFunctionData(fragment,params)];funcName="resolve(bytes,bytes)"}params.push({enableCcipRead:true});try{const result=await this.#resolver[funcName](...params);if(fragment){return iface.decodeFunctionResult(fragment,result)[0]}return result}catch(error){if(!isError(error,"CALL_EXCEPTION")){throw error}}return null}async getAddress(coinType){if(coinType==null){coinType=60}if(coinType===60){try{const result=await this.#fetch("addr(bytes32)");if(result==null||result===ZeroAddress){return null}return result}catch(error){if(isError(error,"CALL_EXCEPTION")){return null}throw error}}if(coinType>=0&&coinType<2147483648){let ethCoinType=coinType+2147483648;const data=await this.#fetch("addr(bytes32,uint)",[ethCoinType]);if(isHexString(data,20)){return getAddress(data)}}let coinPlugin=null;for(const plugin of this.provider.plugins){if(!(plugin instanceof MulticoinProviderPlugin)){continue}if(plugin.supportsCoinType(coinType)){coinPlugin=plugin;break}}if(coinPlugin==null){return null}const data=await this.#fetch("addr(bytes32,uint)",[coinType]);if(data==null||data==="0x"){return null}const address=await coinPlugin.decodeAddress(coinType,data);if(address!=null){return address}assert(false,`invalid coin data`,"UNSUPPORTED_OPERATION",{operation:`getAddress(${coinType})`,info:{coinType:coinType,data:data}})}async getText(key){const data=await this.#fetch("text(bytes32,string)",[key]);if(data==null||data==="0x"){return null}return data}async getContentHash(){const data=await this.#fetch("contenthash(bytes32)");if(data==null||data==="0x"){return null}const ipfs=data.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(ipfs){const scheme=ipfs[1]==="e3010170"?"ipfs":"ipns";const length=parseInt(ipfs[4],16);if(ipfs[5].length===length*2){return`${scheme}:/\/${encodeBase58("0x"+ipfs[2])}`}}const swarm=data.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(swarm&&swarm[1].length===64){return`bzz:/\/${swarm[1]}`}assert(false,`invalid or unsupported content hash data`,"UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:data}})}async getAvatar(){const avatar=await this._getAvatar();return avatar.url}async _getAvatar(){const linkage=[{type:"name",value:this.name}];try{const avatar=await this.getText("avatar");if(avatar==null){linkage.push({type:"!avatar",value:""});return{url:null,linkage:linkage}}linkage.push({type:"avatar",value:avatar});for(let i=0;i{if(allowNull&&array==null){return null}if(!Array.isArray(array)){throw new Error("not an array")}return array.map(i=>format(i))}}function object(format,altNames){return value=>{const result={};for(const key in format){let srcKey=key;if(altNames&&key in altNames&&!(srcKey in value)){for(const altKey of altNames[key]){if(altKey in value){srcKey=altKey;break}}}try{const nv=format[key](value[srcKey]);if(nv!==undefined){result[key]=nv}}catch(error){const message=error instanceof Error?error.message:"not-an-error";assert(false,`invalid value for value.${key} (${message})`,"BAD_DATA",{value:value})}}return result}}function formatBoolean(value){switch(value){case true:case"true":return true;case false:case"false":return false}assertArgument(false,`invalid boolean; ${JSON.stringify(value)}`,"value",value)}function formatData(value){assertArgument(isHexString(value,true),"invalid data","value",value);return value}function formatHash(value){assertArgument(isHexString(value,32),"invalid hash","value",value);return value}const _formatLog=object({address:getAddress,blockHash:formatHash,blockNumber:getNumber,data:formatData,index:getNumber,removed:allowNull(formatBoolean,false),topics:arrayOf(formatHash),transactionHash:formatHash,transactionIndex:getNumber},{index:["logIndex"]});function formatLog(value){return _formatLog(value)}const _formatBlock=object({hash:allowNull(formatHash),parentHash:formatHash,parentBeaconBlockRoot:allowNull(formatHash,null),number:getNumber,timestamp:getNumber,nonce:allowNull(formatData),difficulty:getBigInt,gasLimit:getBigInt,gasUsed:getBigInt,stateRoot:allowNull(formatHash,null),receiptsRoot:allowNull(formatHash,null),blobGasUsed:allowNull(getBigInt,null),excessBlobGas:allowNull(getBigInt,null),miner:allowNull(getAddress),prevRandao:allowNull(formatHash,null),extraData:formatData,baseFeePerGas:allowNull(getBigInt)},{prevRandao:["mixHash"]});function formatBlock(value){const result=_formatBlock(value);result.transactions=value.transactions.map(tx=>{if(typeof tx==="string"){return tx}return formatTransactionResponse(tx)});return result}const _formatReceiptLog=object({transactionIndex:getNumber,blockNumber:getNumber,transactionHash:formatHash,address:getAddress,topics:arrayOf(formatHash),data:formatData,index:getNumber,blockHash:formatHash},{index:["logIndex"]});function formatReceiptLog(value){return _formatReceiptLog(value)}const _formatTransactionReceipt=object({to:allowNull(getAddress,null),from:allowNull(getAddress,null),contractAddress:allowNull(getAddress,null),index:getNumber,root:allowNull(hexlify),gasUsed:getBigInt,blobGasUsed:allowNull(getBigInt,null),logsBloom:allowNull(formatData),blockHash:formatHash,hash:formatHash,logs:arrayOf(formatReceiptLog),blockNumber:getNumber,cumulativeGasUsed:getBigInt,effectiveGasPrice:allowNull(getBigInt),blobGasPrice:allowNull(getBigInt,null),status:allowNull(getNumber),type:allowNull(getNumber,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function formatTransactionReceipt(value){return _formatTransactionReceipt(value)}function formatTransactionResponse(value){if(value.to&&getBigInt(value.to)===BN_0){value.to="0x0000000000000000000000000000000000000000"}const result=object({hash:formatHash,index:allowNull(getNumber,undefined),type:value=>{if(value==="0x"||value==null){return 0}return getNumber(value)},accessList:allowNull(accessListify,null),blobVersionedHashes:allowNull(arrayOf(formatHash,true),null),authorizationList:allowNull(arrayOf(v=>{let sig;if(v.signature){sig=v.signature}else{let yParity=v.yParity;if(yParity==="0x1b"){yParity=0}else if(yParity==="0x1c"){yParity=1}sig=Object.assign({},v,{yParity:yParity})}return{address:getAddress(v.address),chainId:getBigInt(v.chainId),nonce:getBigInt(v.nonce),signature:Signature.from(sig)}},false),null),blockHash:allowNull(formatHash,null),blockNumber:allowNull(getNumber,null),transactionIndex:allowNull(getNumber,null),from:getAddress,gasPrice:allowNull(getBigInt),maxPriorityFeePerGas:allowNull(getBigInt),maxFeePerGas:allowNull(getBigInt),maxFeePerBlobGas:allowNull(getBigInt,null),gasLimit:getBigInt,to:allowNull(getAddress,null),value:getBigInt,nonce:getNumber,data:formatData,creates:allowNull(getAddress,null),chainId:allowNull(getBigInt,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(value);if(result.to==null&&result.creates==null){result.creates=getCreateAddress(result)}if((value.type===1||value.type===2)&&value.accessList==null){result.accessList=[]}if(value.signature){result.signature=Signature.from(value.signature)}else{result.signature=Signature.from(value)}if(result.chainId==null){const chainId=result.signature.legacyChainId;if(chainId!=null){result.chainId=chainId}}if(result.blockHash&&getBigInt(result.blockHash)===BN_0){result.blockHash=null}return result}const EnsAddress="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class NetworkPlugin{name;constructor(name){defineProperties(this,{name:name})}clone(){return new NetworkPlugin(this.name)}}class GasCostPlugin extends NetworkPlugin{effectiveBlock;txBase;txCreate;txDataZero;txDataNonzero;txAccessListStorageKey;txAccessListAddress;constructor(effectiveBlock,costs){if(effectiveBlock==null){effectiveBlock=0}super(`org.ethers.network.plugins.GasCost#${effectiveBlock||0}`);const props={effectiveBlock:effectiveBlock};function set(name,nullish){let value=(costs||{})[name];if(value==null){value=nullish}assertArgument(typeof value==="number",`invalud value for ${name}`,"costs",costs);props[name]=value}set("txBase",21e3);set("txCreate",32e3);set("txDataZero",4);set("txDataNonzero",16);set("txAccessListStorageKey",1900);set("txAccessListAddress",2400);defineProperties(this,props)}clone(){return new GasCostPlugin(this.effectiveBlock,this)}}class EnsPlugin extends NetworkPlugin{address;targetNetwork;constructor(address,targetNetwork){super("org.ethers.plugins.network.Ens");defineProperties(this,{address:address||EnsAddress,targetNetwork:targetNetwork==null?1:targetNetwork})}clone(){return new EnsPlugin(this.address,this.targetNetwork)}}class FeeDataNetworkPlugin extends NetworkPlugin{#feeDataFunc;get feeDataFunc(){return this.#feeDataFunc}constructor(feeDataFunc){super("org.ethers.plugins.network.FeeData");this.#feeDataFunc=feeDataFunc}async getFeeData(provider){return await this.#feeDataFunc(provider)}clone(){return new FeeDataNetworkPlugin(this.#feeDataFunc)}}class FetchUrlFeeDataNetworkPlugin extends NetworkPlugin{#url;#processFunc;get url(){return this.#url}get processFunc(){return this.#processFunc}constructor(url,processFunc){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");this.#url=url;this.#processFunc=processFunc}clone(){return this}}const Networks=new Map;class Network{#name;#chainId;#plugins;constructor(name,chainId){this.#name=name;this.#chainId=getBigInt(chainId);this.#plugins=new Map}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return this.#name}set name(value){this.#name=value}get chainId(){return this.#chainId}set chainId(value){this.#chainId=getBigInt(value,"chainId")}matches(other){if(other==null){return false}if(typeof other==="string"){try{return this.chainId===getBigInt(other)}catch(error){}return this.name===other}if(typeof other==="number"||typeof other==="bigint"){try{return this.chainId===getBigInt(other)}catch(error){}return false}if(typeof other==="object"){if(other.chainId!=null){try{return this.chainId===getBigInt(other.chainId)}catch(error){}return false}if(other.name!=null){return this.name===other.name}return false}return false}get plugins(){return Array.from(this.#plugins.values())}attachPlugin(plugin){if(this.#plugins.get(plugin.name)){throw new Error(`cannot replace existing plugin: ${plugin.name} `)}this.#plugins.set(plugin.name,plugin.clone());return this}getPlugin(name){return this.#plugins.get(name)||null}getPlugins(basename){return this.plugins.filter(p=>p.name.split("#")[0]===basename)}clone(){const clone=new Network(this.name,this.chainId);this.plugins.forEach(plugin=>{clone.attachPlugin(plugin.clone())});return clone}computeIntrinsicGas(tx){const costs=this.getPlugin("org.ethers.plugins.network.GasCost")||new GasCostPlugin;let gas=costs.txBase;if(tx.to==null){gas+=costs.txCreate}if(tx.data){for(let i=2;i9){let frac=BigInt(comps[1].substring(0,9));if(!comps[1].substring(9).match(/^0+$/)){frac++}comps[1]=frac.toString()}return BigInt(comps[0]+comps[1])}function getGasStationPlugin(url){return new FetchUrlFeeDataNetworkPlugin(url,async(fetchFeeData,provider,request)=>{request.setHeader("User-Agent","ethers");let response;try{const[_response,_feeData]=await Promise.all([request.send(),fetchFeeData()]);response=_response;const payload=response.bodyJson.standard;const feeData={gasPrice:_feeData.gasPrice,maxFeePerGas:parseUnits(payload.maxFee,9),maxPriorityFeePerGas:parseUnits(payload.maxPriorityFee,9)};return feeData}catch(error){assert(false,`error encountered with polygon gas station (${JSON.stringify(request.url)})`,"SERVER_ERROR",{request:request,response:response,error:error})}})}let injected=false;function injectCommonNetworks(){if(injected){return}injected=true;function registerEth(name,chainId,options){const func=function(){const network=new Network(name,chainId);if(options.ensNetwork!=null){network.attachPlugin(new EnsPlugin(null,options.ensNetwork))}network.attachPlugin(new GasCostPlugin);(options.plugins||[]).forEach(plugin=>{network.attachPlugin(plugin)});return network};Network.register(name,func);Network.register(chainId,func);if(options.altNames){options.altNames.forEach(name=>{Network.register(name,func)})}}registerEth("mainnet",1,{ensNetwork:1,altNames:["homestead"]});registerEth("ropsten",3,{ensNetwork:3});registerEth("rinkeby",4,{ensNetwork:4});registerEth("goerli",5,{ensNetwork:5});registerEth("kovan",42,{ensNetwork:42});registerEth("sepolia",11155111,{ensNetwork:11155111});registerEth("holesky",17e3,{ensNetwork:17e3});registerEth("classic",61,{});registerEth("classicKotti",6,{});registerEth("arbitrum",42161,{ensNetwork:1});registerEth("arbitrum-goerli",421613,{});registerEth("arbitrum-sepolia",421614,{});registerEth("base",8453,{ensNetwork:1});registerEth("base-goerli",84531,{});registerEth("base-sepolia",84532,{});registerEth("bnb",56,{ensNetwork:1});registerEth("bnbt",97,{});registerEth("filecoin",314,{});registerEth("filecoin-calibration",314159,{});registerEth("linea",59144,{ensNetwork:1});registerEth("linea-goerli",59140,{});registerEth("linea-sepolia",59141,{});registerEth("matic",137,{ensNetwork:1,plugins:[getGasStationPlugin("https://gasstation.polygon.technology/v2")]});registerEth("matic-amoy",80002,{});registerEth("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[getGasStationPlugin("https://gasstation-testnet.polygon.technology/v2")]});registerEth("optimism",10,{ensNetwork:1,plugins:[]});registerEth("optimism-goerli",420,{});registerEth("optimism-sepolia",11155420,{});registerEth("xdai",100,{ensNetwork:1})}function copy$2(obj){return JSON.parse(JSON.stringify(obj))}class PollingBlockSubscriber{#provider;#poller;#interval;#blockNumber;constructor(provider){this.#provider=provider;this.#poller=null;this.#interval=4e3;this.#blockNumber=-2}get pollingInterval(){return this.#interval}set pollingInterval(value){this.#interval=value}async#poll(){try{const blockNumber=await this.#provider.getBlockNumber();if(this.#blockNumber===-2){this.#blockNumber=blockNumber;return}if(blockNumber!==this.#blockNumber){for(let b=this.#blockNumber+1;b<=blockNumber;b++){if(this.#poller==null){return}await this.#provider.emit("block",b)}this.#blockNumber=blockNumber}}catch(error){}if(this.#poller==null){return}this.#poller=this.#provider._setTimeout(this.#poll.bind(this),this.#interval)}start(){if(this.#poller){return}this.#poller=this.#provider._setTimeout(this.#poll.bind(this),this.#interval);this.#poll()}stop(){if(!this.#poller){return}this.#provider._clearTimeout(this.#poller);this.#poller=null}pause(dropWhilePaused){this.stop();if(dropWhilePaused){this.#blockNumber=-2}}resume(){this.start()}}class OnBlockSubscriber{#provider;#poll;#running;constructor(provider){this.#provider=provider;this.#running=false;this.#poll=blockNumber=>{this._poll(blockNumber,this.#provider)}}async _poll(blockNumber,provider){throw new Error("sub-classes must override this")}start(){if(this.#running){return}this.#running=true;this.#poll(-2);this.#provider.on("block",this.#poll)}stop(){if(!this.#running){return}this.#running=false;this.#provider.off("block",this.#poll)}pause(dropWhilePaused){this.stop()}resume(){this.start()}}class PollingBlockTagSubscriber extends OnBlockSubscriber{#tag;#lastBlock;constructor(provider,tag){super(provider);this.#tag=tag;this.#lastBlock=-2}pause(dropWhilePaused){if(dropWhilePaused){this.#lastBlock=-2}super.pause(dropWhilePaused)}async _poll(blockNumber,provider){const block=await provider.getBlock(this.#tag);if(block==null){return}if(this.#lastBlock===-2){this.#lastBlock=block.number}else if(block.number>this.#lastBlock){provider.emit(this.#tag,block.number);this.#lastBlock=block.number}}}class PollingOrphanSubscriber extends OnBlockSubscriber{#filter;constructor(provider,filter){super(provider);this.#filter=copy$2(filter)}async _poll(blockNumber,provider){throw new Error("@TODO")}}class PollingTransactionSubscriber extends OnBlockSubscriber{#hash;constructor(provider,hash){super(provider);this.#hash=hash}async _poll(blockNumber,provider){const tx=await provider.getTransactionReceipt(this.#hash);if(tx){provider.emit(this.#hash,tx)}}}class PollingEventSubscriber{#provider;#filter;#poller;#running;#blockNumber;constructor(provider,filter){this.#provider=provider;this.#filter=copy$2(filter);this.#poller=this.#poll.bind(this);this.#running=false;this.#blockNumber=-2}async#poll(blockNumber){if(this.#blockNumber===-2){return}const filter=copy$2(this.#filter);filter.fromBlock=this.#blockNumber+1;filter.toBlock=blockNumber;const logs=await this.#provider.getLogs(filter);if(logs.length===0){if(this.#blockNumber{this.#blockNumber=blockNumber})}this.#provider.on("block",this.#poller)}stop(){if(!this.#running){return}this.#running=false;this.#provider.off("block",this.#poller)}pause(dropWhilePaused){this.stop();if(dropWhilePaused){this.#blockNumber=-2}}resume(){this.start()}}const BN_2$1=BigInt(2);const MAX_CCIP_REDIRECTS=10;function isPromise$1(value){return value&&typeof value.then==="function"}function getTag(prefix,value){return prefix+":"+JSON.stringify(value,(k,v)=>{if(v==null){return"null"}if(typeof v==="bigint"){return`bigint:${v.toString()}`}if(typeof v==="string"){return v.toLowerCase()}if(typeof v==="object"&&!Array.isArray(v)){const keys=Object.keys(v);keys.sort();return keys.reduce((accum,key)=>{accum[key]=v[key];return accum},{})}return v})}class UnmanagedSubscriber{name;constructor(name){defineProperties(this,{name:name})}start(){}stop(){}pause(dropWhilePaused){}resume(){}}function copy$1(value){return JSON.parse(JSON.stringify(value))}function concisify(items){items=Array.from(new Set(items).values());items.sort();return items}async function getSubscription(_event,provider){if(_event==null){throw new Error("invalid event")}if(Array.isArray(_event)){_event={topics:_event}}if(typeof _event==="string"){switch(_event){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":{return{type:_event,tag:_event}}}}if(isHexString(_event,32)){const hash=_event.toLowerCase();return{type:"transaction",tag:getTag("tx",{hash:hash}),hash:hash}}if(_event.orphan){const event=_event;return{type:"orphan",tag:getTag("orphan",event),filter:copy$1(event)}}if(_event.address||_event.topics){const event=_event;const filter={topics:(event.topics||[]).map(t=>{if(t==null){return null}if(Array.isArray(t)){return concisify(t.map(t=>t.toLowerCase()))}return t.toLowerCase()})};if(event.address){const addresses=[];const promises=[];const addAddress=addr=>{if(isHexString(addr)){addresses.push(addr)}else{promises.push((async()=>{addresses.push(await resolveAddress(addr,provider))})())}};if(Array.isArray(event.address)){event.address.forEach(addAddress)}else{addAddress(event.address)}if(promises.length){await Promise.all(promises)}filter.address=concisify(addresses.map(a=>a.toLowerCase()))}return{filter:filter,tag:getTag("event",filter),type:"event"}}assertArgument(false,"unknown ProviderEvent","event",_event)}function getTime$1(){return(new Date).getTime()}const defaultOptions$1={cacheTimeout:250,pollingInterval:4e3};class AbstractProvider{#subs;#plugins;#pausedState;#destroyed;#networkPromise;#anyNetwork;#performCache;#lastBlockNumber;#nextTimer;#timers;#disableCcipRead;#options;constructor(_network,options){this.#options=Object.assign({},defaultOptions$1,options||{});if(_network==="any"){this.#anyNetwork=true;this.#networkPromise=null}else if(_network){const network=Network.from(_network);this.#anyNetwork=false;this.#networkPromise=Promise.resolve(network);setTimeout(()=>{this.emit("network",network,null)},0)}else{this.#anyNetwork=false;this.#networkPromise=null}this.#lastBlockNumber=-1;this.#performCache=new Map;this.#subs=new Map;this.#plugins=new Map;this.#pausedState=null;this.#destroyed=false;this.#nextTimer=1;this.#timers=new Map;this.#disableCcipRead=false}get pollingInterval(){return this.#options.pollingInterval}get provider(){return this}get plugins(){return Array.from(this.#plugins.values())}attachPlugin(plugin){if(this.#plugins.get(plugin.name)){throw new Error(`cannot replace existing plugin: ${plugin.name} `)}this.#plugins.set(plugin.name,plugin.connect(this));return this}getPlugin(name){return this.#plugins.get(name)||null}get disableCcipRead(){return this.#disableCcipRead}set disableCcipRead(value){this.#disableCcipRead=!!value}async#perform(req){const timeout=this.#options.cacheTimeout;if(timeout<0){return await this._perform(req)}const tag=getTag(req.method,req);let perform=this.#performCache.get(tag);if(!perform){perform=this._perform(req);this.#performCache.set(tag,perform);setTimeout(()=>{if(this.#performCache.get(tag)===perform){this.#performCache.delete(tag)}},timeout)}return await perform}async ccipReadFetch(tx,calldata,urls){if(this.disableCcipRead||urls.length===0||tx.to==null){return null}const sender=tx.to.toLowerCase();const data=calldata.toLowerCase();const errorMessages=[];for(let i=0;i=500,`response not found during CCIP fetch: ${errorMessage}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:tx,info:{url:url,errorMessage:errorMessage}});errorMessages.push(errorMessage)}assert(false,`error encountered during CCIP fetch: ${errorMessages.map(m=>JSON.stringify(m)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:tx,info:{urls:urls,errorMessages:errorMessages}})}_wrapBlock(value,network){return new Block(formatBlock(value),this)}_wrapLog(value,network){return new Log(formatLog(value),this)}_wrapTransactionReceipt(value,network){return new TransactionReceipt(formatTransactionReceipt(value),this)}_wrapTransactionResponse(tx,network){return new TransactionResponse(formatTransactionResponse(tx),this)}_detectNetwork(){assert(false,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(req){assert(false,`unsupported method: ${req.method}`,"UNSUPPORTED_OPERATION",{operation:req.method,info:req})}async getBlockNumber(){const blockNumber=getNumber(await this.#perform({method:"getBlockNumber"}),"%response");if(this.#lastBlockNumber>=0){this.#lastBlockNumber=blockNumber}return blockNumber}_getAddress(address){return resolveAddress(address,this)}_getBlockTag(blockTag){if(blockTag==null){return"latest"}switch(blockTag){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return blockTag}if(isHexString(blockTag)){if(isHexString(blockTag,32)){return blockTag}return toQuantity(blockTag)}if(typeof blockTag==="bigint"){blockTag=getNumber(blockTag,"blockTag")}if(typeof blockTag==="number"){if(blockTag>=0){return toQuantity(blockTag)}if(this.#lastBlockNumber>=0){return toQuantity(this.#lastBlockNumber+blockTag)}return this.getBlockNumber().then(b=>toQuantity(b+blockTag))}assertArgument(false,"invalid blockTag","blockTag",blockTag)}_getFilter(filter){const topics=(filter.topics||[]).map(t=>{if(t==null){return null}if(Array.isArray(t)){return concisify(t.map(t=>t.toLowerCase()))}return t.toLowerCase()});const blockHash="blockHash"in filter?filter.blockHash:undefined;const resolve=(_address,fromBlock,toBlock)=>{let address=undefined;switch(_address.length){case 0:break;case 1:address=_address[0];break;default:_address.sort();address=_address}if(blockHash){if(fromBlock!=null||toBlock!=null){throw new Error("invalid filter")}}const filter={};if(address){filter.address=address}if(topics.length){filter.topics=topics}if(fromBlock){filter.fromBlock=fromBlock}if(toBlock){filter.toBlock=toBlock}if(blockHash){filter.blockHash=blockHash}return filter};let address=[];if(filter.address){if(Array.isArray(filter.address)){for(const addr of filter.address){address.push(this._getAddress(addr))}}else{address.push(this._getAddress(filter.address))}}let fromBlock=undefined;if("fromBlock"in filter){fromBlock=this._getBlockTag(filter.fromBlock)}let toBlock=undefined;if("toBlock"in filter){toBlock=this._getBlockTag(filter.toBlock)}if(address.filter(a=>typeof a!=="string").length||fromBlock!=null&&typeof fromBlock!=="string"||toBlock!=null&&typeof toBlock!=="string"){return Promise.all([Promise.all(address),fromBlock,toBlock]).then(result=>{return resolve(result[0],result[1],result[2])})}return resolve(address,fromBlock,toBlock)}_getTransactionRequest(_request){const request=copyRequest(_request);const promises=[];["to","from"].forEach(key=>{if(request[key]==null){return}const addr=resolveAddress(request[key],this);if(isPromise$1(addr)){promises.push(async function(){request[key]=await addr}())}else{request[key]=addr}});if(request.blockTag!=null){const blockTag=this._getBlockTag(request.blockTag);if(isPromise$1(blockTag)){promises.push(async function(){request.blockTag=await blockTag}())}else{request.blockTag=blockTag}}if(promises.length){return async function(){await Promise.all(promises);return request}()}return request}async getNetwork(){if(this.#networkPromise==null){const detectNetwork=(async()=>{try{const network=await this._detectNetwork();this.emit("network",network,null);return network}catch(error){if(this.#networkPromise===detectNetwork){this.#networkPromise=null}throw error}})();this.#networkPromise=detectNetwork;return(await detectNetwork).clone()}const networkPromise=this.#networkPromise;const[expected,actual]=await Promise.all([networkPromise,this._detectNetwork()]);if(expected.chainId!==actual.chainId){if(this.#anyNetwork){this.emit("network",actual,expected);if(this.#networkPromise===networkPromise){this.#networkPromise=Promise.resolve(actual)}}else{assert(false,`network changed: ${expected.chainId} => ${actual.chainId} `,"NETWORK_ERROR",{event:"changed"})}}return expected.clone()}async getFeeData(){const network=await this.getNetwork();const getFeeDataFunc=async()=>{const{_block,gasPrice,priorityFee}=await resolveProperties({_block:this.#getBlock("latest",false),gasPrice:(async()=>{try{const value=await this.#perform({method:"getGasPrice"});return getBigInt(value,"%response")}catch(error){}return null})(),priorityFee:(async()=>{try{const value=await this.#perform({method:"getPriorityFee"});return getBigInt(value,"%response")}catch(error){}return null})()});let maxFeePerGas=null;let maxPriorityFeePerGas=null;const block=this._wrapBlock(_block,network);if(block&&block.baseFeePerGas){maxPriorityFeePerGas=priorityFee!=null?priorityFee:BigInt("1000000000");maxFeePerGas=block.baseFeePerGas*BN_2$1+maxPriorityFeePerGas}return new FeeData(gasPrice,maxFeePerGas,maxPriorityFeePerGas)};const plugin=network.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(plugin){const req=new FetchRequest(plugin.url);const feeData=await plugin.processFunc(getFeeDataFunc,this,req);return new FeeData(feeData.gasPrice,feeData.maxFeePerGas,feeData.maxPriorityFeePerGas)}return await getFeeDataFunc()}async estimateGas(_tx){let tx=this._getTransactionRequest(_tx);if(isPromise$1(tx)){tx=await tx}return getBigInt(await this.#perform({method:"estimateGas",transaction:tx}),"%response")}async#call(tx,blockTag,attempt){assert(attempt=0&&blockTag==="latest"&&transaction.to!=null&&dataSlice(error.data,0,4)==="0x556f1830"){const data=error.data;const txSender=await resolveAddress(transaction.to,this);let ccipArgs;try{ccipArgs=parseOffchainLookup(dataSlice(error.data,4))}catch(error){assert(false,error.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:transaction,info:{data:data}})}assert(ccipArgs.sender.toLowerCase()===txSender.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:data,reason:"OffchainLookup",transaction:transaction,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:ccipArgs.errorArgs}});const ccipResult=await this.ccipReadFetch(transaction,ccipArgs.calldata,ccipArgs.urls);assert(ccipResult!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:transaction,info:{data:error.data,errorArgs:ccipArgs.errorArgs}});const tx={to:txSender,data:concat([ccipArgs.selector,encodeBytes([ccipResult,ccipArgs.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:tx});try{const result=await this.#call(tx,blockTag,attempt+1);this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},tx),result:result});return result}catch(error){this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},tx),error:error});throw error}}throw error}}async#checkNetwork(promise){const{value}=await resolveProperties({network:this.getNetwork(),value:promise});return value}async call(_tx){const{tx,blockTag}=await resolveProperties({tx:this._getTransactionRequest(_tx),blockTag:this._getBlockTag(_tx.blockTag)});return await this.#checkNetwork(this.#call(tx,blockTag,_tx.enableCcipRead?0:-1))}async#getAccountValue(request,_address,_blockTag){let address=this._getAddress(_address);let blockTag=this._getBlockTag(_blockTag);if(typeof address!=="string"||typeof blockTag!=="string"){[address,blockTag]=await Promise.all([address,blockTag])}return await this.#checkNetwork(this.#perform(Object.assign(request,{address:address,blockTag:blockTag})))}async getBalance(address,blockTag){return getBigInt(await this.#getAccountValue({method:"getBalance"},address,blockTag),"%response")}async getTransactionCount(address,blockTag){return getNumber(await this.#getAccountValue({method:"getTransactionCount"},address,blockTag),"%response")}async getCode(address,blockTag){return hexlify(await this.#getAccountValue({method:"getCode"},address,blockTag))}async getStorage(address,_position,blockTag){const position=getBigInt(_position,"position");return hexlify(await this.#getAccountValue({method:"getStorage",position:position},address,blockTag))}async broadcastTransaction(signedTx){const{blockNumber,hash,network}=await resolveProperties({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:signedTx}),network:this.getNetwork()});const tx=Transaction.from(signedTx);if(tx.hash!==hash){throw new Error("@TODO: the returned hash did not match")}return this._wrapTransactionResponse(tx,network).replaceableTransaction(blockNumber)}async#getBlock(block,includeTransactions){if(isHexString(block,32)){return await this.#perform({method:"getBlock",blockHash:block,includeTransactions:includeTransactions})}let blockTag=this._getBlockTag(block);if(typeof blockTag!=="string"){blockTag=await blockTag}return await this.#perform({method:"getBlock",blockTag:blockTag,includeTransactions:includeTransactions})}async getBlock(block,prefetchTxs){const{network,params}=await resolveProperties({network:this.getNetwork(),params:this.#getBlock(block,!!prefetchTxs)});if(params==null){return null}return this._wrapBlock(params,network)}async getTransaction(hash){const{network,params}=await resolveProperties({network:this.getNetwork(),params:this.#perform({method:"getTransaction",hash:hash})});if(params==null){return null}return this._wrapTransactionResponse(params,network)}async getTransactionReceipt(hash){const{network,params}=await resolveProperties({network:this.getNetwork(),params:this.#perform({method:"getTransactionReceipt",hash:hash})});if(params==null){return null}if(params.gasPrice==null&¶ms.effectiveGasPrice==null){const tx=await this.#perform({method:"getTransaction",hash:hash});if(tx==null){throw new Error("report this; could not find tx or effectiveGasPrice")}params.effectiveGasPrice=tx.gasPrice}return this._wrapTransactionReceipt(params,network)}async getTransactionResult(hash){const{result}=await resolveProperties({network:this.getNetwork(),result:this.#perform({method:"getTransactionResult",hash:hash})});if(result==null){return null}return hexlify(result)}async getLogs(_filter){let filter=this._getFilter(_filter);if(isPromise$1(filter)){filter=await filter}const{network,params}=await resolveProperties({network:this.getNetwork(),params:this.#perform({method:"getLogs",filter:filter})});return params.map(p=>this._wrapLog(p,network))}_getProvider(chainId){assert(false,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(name){return await EnsResolver.fromName(this,name)}async getAvatar(name){const resolver=await this.getResolver(name);if(resolver){return await resolver.getAvatar()}return null}async resolveName(name){const resolver=await this.getResolver(name);if(resolver){return await resolver.getAddress()}return null}async lookupAddress(address){address=getAddress(address);const node=namehash(address.substring(2).toLowerCase()+".addr.reverse");try{const ensAddr=await EnsResolver.getEnsAddress(this);const ensContract=new Contract(ensAddr,["function resolver(bytes32) view returns (address)"],this);const resolver=await ensContract.resolver(node);if(resolver==null||resolver===ZeroAddress){return null}const resolverContract=new Contract(resolver,["function name(bytes32) view returns (string)"],this);const name=await resolverContract.name(node);const check=await this.resolveName(name);if(check!==address){return null}return name}catch(error){if(isError(error,"BAD_DATA")&&error.value==="0x"){return null}if(isError(error,"CALL_EXCEPTION")){return null}throw error}return null}async waitForTransaction(hash,_confirms,timeout){const confirms=_confirms!=null?_confirms:1;if(confirms===0){return this.getTransactionReceipt(hash)}return new Promise(async(resolve,reject)=>{let timer=null;const listener=async blockNumber=>{try{const receipt=await this.getTransactionReceipt(hash);if(receipt!=null){if(blockNumber-receipt.blockNumber+1>=confirms){resolve(receipt);if(timer){clearTimeout(timer);timer=null}return}}}catch(error){console.log("EEE",error)}this.once("block",listener)};if(timeout!=null){timer=setTimeout(()=>{if(timer==null){return}timer=null;this.off("block",listener);reject(makeError("timeout","TIMEOUT",{reason:"timeout"}))},timeout)}listener(await this.getBlockNumber())})}async waitForBlock(blockTag){assert(false,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(timerId){const timer=this.#timers.get(timerId);if(!timer){return}if(timer.timer){clearTimeout(timer.timer)}this.#timers.delete(timerId)}_setTimeout(_func,timeout){if(timeout==null){timeout=0}const timerId=this.#nextTimer++;const func=()=>{this.#timers.delete(timerId);_func()};if(this.paused){this.#timers.set(timerId,{timer:null,func:func,time:timeout})}else{const timer=setTimeout(func,timeout);this.#timers.set(timerId,{timer:timer,func:func,time:getTime$1()})}return timerId}_forEachSubscriber(func){for(const sub of this.#subs.values()){func(sub.subscriber)}}_getSubscriber(sub){switch(sub.type){case"debug":case"error":case"network":return new UnmanagedSubscriber(sub.type);case"block":{const subscriber=new PollingBlockSubscriber(this);subscriber.pollingInterval=this.pollingInterval;return subscriber}case"safe":case"finalized":return new PollingBlockTagSubscriber(this,sub.type);case"event":return new PollingEventSubscriber(this,sub.filter);case"transaction":return new PollingTransactionSubscriber(this,sub.hash);case"orphan":return new PollingOrphanSubscriber(this,sub.filter)}throw new Error(`unsupported event: ${sub.type}`)}_recoverSubscriber(oldSub,newSub){for(const sub of this.#subs.values()){if(sub.subscriber===oldSub){if(sub.started){sub.subscriber.stop()}sub.subscriber=newSub;if(sub.started){newSub.start()}if(this.#pausedState!=null){newSub.pause(this.#pausedState)}break}}}async#hasSub(event,emitArgs){let sub=await getSubscription(event,this);if(sub.type==="event"&&emitArgs&&emitArgs.length>0&&emitArgs[0].removed===true){sub=await getSubscription({orphan:"drop-log",log:emitArgs[0]},this)}return this.#subs.get(sub.tag)||null}async#getSub(event){const subscription=await getSubscription(event,this);const tag=subscription.tag;let sub=this.#subs.get(tag);if(!sub){const subscriber=this._getSubscriber(subscription);const addressableMap=new WeakMap;const nameMap=new Map;sub={subscriber:subscriber,tag:tag,addressableMap:addressableMap,nameMap:nameMap,started:false,listeners:[]};this.#subs.set(tag,sub)}return sub}async on(event,listener){const sub=await this.#getSub(event);sub.listeners.push({listener:listener,once:false});if(!sub.started){sub.subscriber.start();sub.started=true;if(this.#pausedState!=null){sub.subscriber.pause(this.#pausedState)}}return this}async once(event,listener){const sub=await this.#getSub(event);sub.listeners.push({listener:listener,once:true});if(!sub.started){sub.subscriber.start();sub.started=true;if(this.#pausedState!=null){sub.subscriber.pause(this.#pausedState)}}return this}async emit(event,...args){const sub=await this.#hasSub(event,args);if(!sub||sub.listeners.length===0){return false}const count=sub.listeners.length;sub.listeners=sub.listeners.filter(({listener,once})=>{const payload=new EventPayload(this,once?null:listener,event);try{listener.call(this,...args,payload)}catch(error){}return!once});if(sub.listeners.length===0){if(sub.started){sub.subscriber.stop()}this.#subs.delete(sub.tag)}return count>0}async listenerCount(event){if(event){const sub=await this.#hasSub(event);if(!sub){return 0}return sub.listeners.length}let total=0;for(const{listeners}of this.#subs.values()){total+=listeners.length}return total}async listeners(event){if(event){const sub=await this.#hasSub(event);if(!sub){return[]}return sub.listeners.map(({listener})=>listener)}let result=[];for(const{listeners}of this.#subs.values()){result=result.concat(listeners.map(({listener})=>listener))}return result}async off(event,listener){const sub=await this.#hasSub(event);if(!sub){return this}if(listener){const index=sub.listeners.map(({listener})=>listener).indexOf(listener);if(index>=0){sub.listeners.splice(index,1)}}if(!listener||sub.listeners.length===0){if(sub.started){sub.subscriber.stop()}this.#subs.delete(sub.tag)}return this}async removeAllListeners(event){if(event){const{tag,started,subscriber}=await this.#getSub(event);if(started){subscriber.stop()}this.#subs.delete(tag)}else{for(const[tag,{started,subscriber}]of this.#subs){if(started){subscriber.stop()}this.#subs.delete(tag)}}return this}async addListener(event,listener){return await this.on(event,listener)}async removeListener(event,listener){return this.off(event,listener)}get destroyed(){return this.#destroyed}destroy(){this.removeAllListeners();for(const timerId of this.#timers.keys()){this._clearTimeout(timerId)}this.#destroyed=true}get paused(){return this.#pausedState!=null}set paused(pause){if(!!pause===this.paused){return}if(this.paused){this.resume()}else{this.pause(false)}}pause(dropWhilePaused){this.#lastBlockNumber=-1;if(this.#pausedState!=null){if(this.#pausedState==!!dropWhilePaused){return}assert(false,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(s=>s.pause(dropWhilePaused));this.#pausedState=!!dropWhilePaused;for(const timer of this.#timers.values()){if(timer.timer){clearTimeout(timer.timer)}timer.time=getTime$1()-timer.time}}resume(){if(this.#pausedState==null){return}this._forEachSubscriber(s=>s.resume());this.#pausedState=null;for(const timer of this.#timers.values()){let timeout=timer.time;if(timeout<0){timeout=0}timer.time=getTime$1();setTimeout(timer.func,timeout)}}}function _parseString(result,start){try{const bytes=_parseBytes(result,start);if(bytes){return toUtf8String(bytes)}}catch(error){}return null}function _parseBytes(result,start){if(result==="0x"){return null}try{const offset=getNumber(dataSlice(result,start,start+32));const length=getNumber(dataSlice(result,offset,offset+32));return dataSlice(result,offset+32,offset+32+length)}catch(error){}return null}function numPad(value){const result=toBeArray(value);if(result.length>32){throw new Error("internal; should not happen")}const padded=new Uint8Array(32);padded.set(result,32-result.length);return padded}function bytesPad(value){if(value.length%32===0){return value}const result=new Uint8Array(Math.ceil(value.length/32)*32);result.set(value);return result}const empty=new Uint8Array([]);function encodeBytes(datas){const result=[];let byteCount=0;for(let i=0;i=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const sender=dataSlice(data,0,32);assert(dataSlice(sender,0,12)===dataSlice(zeros,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"});result.sender=dataSlice(sender,12);try{const urls=[];const urlsOffset=getNumber(dataSlice(data,32,64));const urlsLength=getNumber(dataSlice(data,urlsOffset,urlsOffset+32));const urlsData=dataSlice(data,urlsOffset+32);for(let u=0;uresult[k]);return result}function checkProvider(signer,operation){if(signer.provider){return signer.provider}assert(false,"missing provider","UNSUPPORTED_OPERATION",{operation:operation})}async function populate(signer,tx){let pop=copyRequest(tx);if(pop.to!=null){pop.to=resolveAddress(pop.to,signer)}if(pop.from!=null){const from=pop.from;pop.from=Promise.all([signer.getAddress(),resolveAddress(from,signer)]).then(([address,from])=>{assertArgument(address.toLowerCase()===from.toLowerCase(),"transaction from mismatch","tx.from",from);return address})}else{pop.from=signer.getAddress()}return await resolveProperties(pop)}class AbstractSigner{provider;constructor(provider){defineProperties(this,{provider:provider||null})}async getNonce(blockTag){return checkProvider(this,"getTransactionCount").getTransactionCount(await this.getAddress(),blockTag)}async populateCall(tx){const pop=await populate(this,tx);return pop}async populateTransaction(tx){const provider=checkProvider(this,"populateTransaction");const pop=await populate(this,tx);if(pop.nonce==null){pop.nonce=await this.getNonce("pending")}if(pop.gasLimit==null){pop.gasLimit=await this.estimateGas(pop)}const network=await this.provider.getNetwork();if(pop.chainId!=null){const chainId=getBigInt(pop.chainId);assertArgument(chainId===network.chainId,"transaction chainId mismatch","tx.chainId",tx.chainId)}else{pop.chainId=network.chainId}const hasEip1559=pop.maxFeePerGas!=null||pop.maxPriorityFeePerGas!=null;if(pop.gasPrice!=null&&(pop.type===2||hasEip1559)){assertArgument(false,"eip-1559 transaction do not support gasPrice","tx",tx)}else if((pop.type===0||pop.type===1)&&hasEip1559){assertArgument(false,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",tx)}if((pop.type===2||pop.type==null)&&(pop.maxFeePerGas!=null&&pop.maxPriorityFeePerGas!=null)){pop.type=2}else if(pop.type===0||pop.type===1){const feeData=await provider.getFeeData();assert(feeData.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"});if(pop.gasPrice==null){pop.gasPrice=feeData.gasPrice}}else{const feeData=await provider.getFeeData();if(pop.type==null){if(feeData.maxFeePerGas!=null&&feeData.maxPriorityFeePerGas!=null){if(pop.authorizationList&&pop.authorizationList.length){pop.type=4}else{pop.type=2}if(pop.gasPrice!=null){const gasPrice=pop.gasPrice;delete pop.gasPrice;pop.maxFeePerGas=gasPrice;pop.maxPriorityFeePerGas=gasPrice}else{if(pop.maxFeePerGas==null){pop.maxFeePerGas=feeData.maxFeePerGas}if(pop.maxPriorityFeePerGas==null){pop.maxPriorityFeePerGas=feeData.maxPriorityFeePerGas}}}else if(feeData.gasPrice!=null){assert(!hasEip1559,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"});if(pop.gasPrice==null){pop.gasPrice=feeData.gasPrice}pop.type=0}else{assert(false,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"})}}else if(pop.type===2||pop.type===3||pop.type===4){if(pop.maxFeePerGas==null){pop.maxFeePerGas=feeData.maxFeePerGas}if(pop.maxPriorityFeePerGas==null){pop.maxPriorityFeePerGas=feeData.maxPriorityFeePerGas}}}return await resolveProperties(pop)}async populateAuthorization(_auth){const auth=Object.assign({},_auth);if(auth.chainId==null){auth.chainId=(await checkProvider(this,"getNetwork").getNetwork()).chainId}if(auth.nonce==null){auth.nonce=await this.getNonce()}return auth}async estimateGas(tx){return checkProvider(this,"estimateGas").estimateGas(await this.populateCall(tx))}async call(tx){return checkProvider(this,"call").call(await this.populateCall(tx))}async resolveName(name){const provider=checkProvider(this,"resolveName");return await provider.resolveName(name)}async sendTransaction(tx){const provider=checkProvider(this,"sendTransaction");const pop=await this.populateTransaction(tx);delete pop.from;const txObj=Transaction.from(pop);return await provider.broadcastTransaction(await this.signTransaction(txObj))}authorize(authorization){assert(false,"authorization not implemented for this signer","UNSUPPORTED_OPERATION",{operation:"authorize"})}}class VoidSigner extends AbstractSigner{address;constructor(address,provider){super(provider);defineProperties(this,{address:address})}async getAddress(){return this.address}connect(provider){return new VoidSigner(this.address,provider)}#throwUnsupported(suffix,operation){assert(false,`VoidSigner cannot sign ${suffix}`,"UNSUPPORTED_OPERATION",{operation:operation})}async signTransaction(tx){this.#throwUnsupported("transactions","signTransaction")}async signMessage(message){this.#throwUnsupported("messages","signMessage")}async signTypedData(domain,types,value){this.#throwUnsupported("typed-data","signTypedData")}}const shown=new Set;function showThrottleMessage(service){if(shown.has(service)){return}shown.add(service);console.log("========= NOTICE =========");console.log(`Request-Rate Exceeded for ${service} (this message will not be repeated)`);console.log("");console.log("The default API keys for each service are provided as a highly-throttled,");console.log("community resource for low-traffic projects and early prototyping.");console.log("");console.log("While your application will continue to function, we highly recommended");console.log("signing up for your own API keys to improve performance, increase your");console.log("request rate/limit and enable other perks, such as metrics and advanced APIs.");console.log("");console.log("For more details: https://docs.ethers.org/api-keys/");console.log("==========================")}function copy(obj){return JSON.parse(JSON.stringify(obj))}class FilterIdSubscriber{#provider;#filterIdPromise;#poller;#running;#network;#hault;constructor(provider){this.#provider=provider;this.#filterIdPromise=null;this.#poller=this.#poll.bind(this);this.#running=false;this.#network=null;this.#hault=false}_subscribe(provider){throw new Error("subclasses must override this")}_emitResults(provider,result){throw new Error("subclasses must override this")}_recover(provider){throw new Error("subclasses must override this")}async#poll(blockNumber){try{if(this.#filterIdPromise==null){this.#filterIdPromise=this._subscribe(this.#provider)}let filterId=null;try{filterId=await this.#filterIdPromise}catch(error){if(!isError(error,"UNSUPPORTED_OPERATION")||error.operation!=="eth_newFilter"){throw error}}if(filterId==null){this.#filterIdPromise=null;this.#provider._recoverSubscriber(this,this._recover(this.#provider));return}const network=await this.#provider.getNetwork();if(!this.#network){this.#network=network}if(this.#network.chainId!==network.chainId){throw new Error("chaid changed")}if(this.#hault){return}const result=await this.#provider.send("eth_getFilterChanges",[filterId]);await this._emitResults(this.#provider,result)}catch(error){console.log("@TODO",error)}this.#provider.once("block",this.#poller)}#teardown(){const filterIdPromise=this.#filterIdPromise;if(filterIdPromise){this.#filterIdPromise=null;filterIdPromise.then(filterId=>{if(this.#provider.destroyed){return}this.#provider.send("eth_uninstallFilter",[filterId])})}}start(){if(this.#running){return}this.#running=true;this.#poll(-2)}stop(){if(!this.#running){return}this.#running=false;this.#hault=true;this.#teardown();this.#provider.off("block",this.#poller)}pause(dropWhilePaused){if(dropWhilePaused){this.#teardown()}this.#provider.off("block",this.#poller)}resume(){this.start()}}class FilterIdEventSubscriber extends FilterIdSubscriber{#event;constructor(provider,filter){super(provider);this.#event=copy(filter)}_recover(provider){return new PollingEventSubscriber(provider,this.#event)}async _subscribe(provider){const filterId=await provider.send("eth_newFilter",[this.#event]);return filterId}async _emitResults(provider,results){for(const result of results){provider.emit(this.#event,provider._wrapLog(result,provider._network))}}}class FilterIdPendingSubscriber extends FilterIdSubscriber{async _subscribe(provider){return await provider.send("eth_newPendingTransactionFilter",[])}async _emitResults(provider,results){for(const result of results){provider.emit("pending",result)}}}const Primitive="bigint,boolean,function,number,string,symbol".split(/,/g);function deepCopy(value){if(value==null||Primitive.indexOf(typeof value)>=0){return value}if(typeof value.getAddress==="function"){return value}if(Array.isArray(value)){return value.map(deepCopy)}if(typeof value==="object"){return Object.keys(value).reduce((accum,key)=>{accum[key]=value[key];return accum},{})}throw new Error(`should not happen: ${value} (${typeof value})`)}function stall$3(duration){return new Promise(resolve=>{setTimeout(resolve,duration)})}function getLowerCase(value){if(value){return value.toLowerCase()}return value}function isPollable(value){return value&&typeof value.pollingInterval==="number"}const defaultOptions={polling:false,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class JsonRpcSigner extends AbstractSigner{address;constructor(provider,address){super(provider);address=getAddress(address);defineProperties(this,{address:address})}connect(provider){assert(false,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(tx){return await this.populateCall(tx)}async sendUncheckedTransaction(_tx){const tx=deepCopy(_tx);const promises=[];if(tx.from){const _from=tx.from;promises.push((async()=>{const from=await resolveAddress(_from,this.provider);assertArgument(from!=null&&from.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",_tx);tx.from=from})())}else{tx.from=this.address}if(tx.gasLimit==null){promises.push((async()=>{tx.gasLimit=await this.provider.estimateGas({...tx,from:this.address})})())}if(tx.to!=null){const _to=tx.to;promises.push((async()=>{tx.to=await resolveAddress(_to,this.provider)})())}if(promises.length){await Promise.all(promises)}const hexTx=this.provider.getRpcTransaction(tx);return this.provider.send("eth_sendTransaction",[hexTx])}async sendTransaction(tx){const blockNumber=await this.provider.getBlockNumber();const hash=await this.sendUncheckedTransaction(tx);return await new Promise((resolve,reject)=>{const timeouts=[1e3,100];let invalids=0;const checkTx=async()=>{try{const tx=await this.provider.getTransaction(hash);if(tx!=null){resolve(tx.replaceableTransaction(blockNumber));return}}catch(error){if(isError(error,"CANCELLED")||isError(error,"BAD_DATA")||isError(error,"NETWORK_ERROR")||isError(error,"UNSUPPORTED_OPERATION")){if(error.info==null){error.info={}}error.info.sendTransactionHash=hash;reject(error);return}if(isError(error,"INVALID_ARGUMENT")){invalids++;if(error.info==null){error.info={}}error.info.sendTransactionHash=hash;if(invalids>10){reject(error);return}}this.provider.emit("error",makeError("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:error}))}this.provider._setTimeout(()=>{checkTx()},timeouts.pop()||4e3)};checkTx()})}async signTransaction(_tx){const tx=deepCopy(_tx);if(tx.from){const from=await resolveAddress(tx.from,this.provider);assertArgument(from!=null&&from.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",_tx);tx.from=from}else{tx.from=this.address}const hexTx=this.provider.getRpcTransaction(tx);return await this.provider.send("eth_signTransaction",[hexTx])}async signMessage(_message){const message=typeof _message==="string"?toUtf8Bytes(_message):_message;return await this.provider.send("personal_sign",[hexlify(message),this.address.toLowerCase()])}async signTypedData(domain,types,_value){const value=deepCopy(_value);const populated=await TypedDataEncoder.resolveNames(domain,types,value,async value=>{const address=await resolveAddress(value);assertArgument(address!=null,"TypedData does not support null address","value",value);return address});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(TypedDataEncoder.getPayload(populated.domain,types,populated.value))])}async unlock(password){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),password,null])}async _legacySignMessage(_message){const message=typeof _message==="string"?toUtf8Bytes(_message):_message;return await this.provider.send("eth_sign",[this.address.toLowerCase(),hexlify(message)])}}class JsonRpcApiProvider extends AbstractProvider{#options;#nextId;#payloads;#drainTimer;#notReady;#network;#pendingDetectNetwork;#scheduleDrain(){if(this.#drainTimer){return}const stallTime=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");this.#drainTimer=setTimeout(()=>{this.#drainTimer=null;const payloads=this.#payloads;this.#payloads=[];while(payloads.length){const batch=[payloads.shift()];while(payloads.length){if(batch.length===this.#options.batchMaxCount){break}batch.push(payloads.shift());const bytes=JSON.stringify(batch.map(p=>p.payload));if(bytes.length>this.#options.batchMaxSize){payloads.unshift(batch.pop());break}}(async()=>{const payload=batch.length===1?batch[0].payload:batch.map(p=>p.payload);this.emit("debug",{action:"sendRpcPayload",payload:payload});try{const result=await this._send(payload);this.emit("debug",{action:"receiveRpcResult",result:result});for(const{resolve,reject,payload}of batch){if(this.destroyed){reject(makeError("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:payload.method}));continue}const resp=result.filter(r=>r.id===payload.id)[0];if(resp==null){const error=makeError("missing response for request","BAD_DATA",{value:result,info:{payload:payload}});this.emit("error",error);reject(error);continue}if("error"in resp){reject(this.getRpcError(payload,resp));continue}resolve(resp.result)}}catch(error){this.emit("debug",{action:"receiveRpcError",error:error});for(const{reject}of batch){reject(error)}}})()}},stallTime)}constructor(network,options){super(network,options);this.#nextId=1;this.#options=Object.assign({},defaultOptions,options||{});this.#payloads=[];this.#drainTimer=null;this.#network=null;this.#pendingDetectNetwork=null;{let resolve=null;const promise=new Promise(_resolve=>{resolve=_resolve});this.#notReady={promise:promise,resolve:resolve}}const staticNetwork=this._getOption("staticNetwork");if(typeof staticNetwork==="boolean"){assertArgument(!staticNetwork||network!=="any","staticNetwork cannot be used on special network 'any'","options",options);if(staticNetwork&&network!=null){this.#network=Network.from(network)}}else if(staticNetwork){assertArgument(network==null||staticNetwork.matches(network),"staticNetwork MUST match network object","options",options);this.#network=staticNetwork}}_getOption(key){return this.#options[key]}get _network(){assert(this.#network,"network is not available yet","NETWORK_ERROR");return this.#network}async _perform(req){if(req.method==="call"||req.method==="estimateGas"){let tx=req.transaction;if(tx&&tx.type!=null&&getBigInt(tx.type)){if(tx.maxFeePerGas==null&&tx.maxPriorityFeePerGas==null){const feeData=await this.getFeeData();if(feeData.maxFeePerGas==null&&feeData.maxPriorityFeePerGas==null){req=Object.assign({},req,{transaction:Object.assign({},tx,{type:undefined})})}}}}const request=this.getRpcRequest(req);if(request!=null){return await this.send(request.method,request.args)}return super._perform(req)}async _detectNetwork(){const network=this._getOption("staticNetwork");if(network){if(network===true){if(this.#network){return this.#network}}else{return network}}if(this.#pendingDetectNetwork){return await this.#pendingDetectNetwork}if(this.ready){this.#pendingDetectNetwork=(async()=>{try{const result=Network.from(getBigInt(await this.send("eth_chainId",[])));this.#pendingDetectNetwork=null;return result}catch(error){this.#pendingDetectNetwork=null;throw error}})();return await this.#pendingDetectNetwork}this.#pendingDetectNetwork=(async()=>{const payload={id:this.#nextId++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:payload});let result;try{result=(await this._send(payload))[0];this.#pendingDetectNetwork=null}catch(error){this.#pendingDetectNetwork=null;this.emit("debug",{action:"receiveRpcError",error:error});throw error}this.emit("debug",{action:"receiveRpcResult",result:result});if("result"in result){return Network.from(getBigInt(result.result))}throw this.getRpcError(payload,result)})();return await this.#pendingDetectNetwork}_start(){if(this.#notReady==null||this.#notReady.resolve==null){return}this.#notReady.resolve();this.#notReady=null;(async()=>{while(this.#network==null&&!this.destroyed){try{this.#network=await this._detectNetwork()}catch(error){if(this.destroyed){break}console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)");this.emit("error",makeError("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:error}}));await stall$3(1e3)}}this.#scheduleDrain()})()}async _waitUntilReady(){if(this.#notReady==null){return}return await this.#notReady.promise}_getSubscriber(sub){if(sub.type==="pending"){return new FilterIdPendingSubscriber(this)}if(sub.type==="event"){if(this._getOption("polling")){return new PollingEventSubscriber(this,sub.filter)}return new FilterIdEventSubscriber(this,sub.filter)}if(sub.type==="orphan"&&sub.filter.orphan==="drop-log"){return new UnmanagedSubscriber("orphan")}return super._getSubscriber(sub)}get ready(){return this.#notReady==null}getRpcTransaction(tx){const result={};["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(key=>{if(tx[key]==null){return}let dstKey=key;if(key==="gasLimit"){dstKey="gas"}result[dstKey]=toQuantity(getBigInt(tx[key],`tx.${key}`))});["from","to","data"].forEach(key=>{if(tx[key]==null){return}result[key]=hexlify(tx[key])});if(tx.accessList){result["accessList"]=accessListify(tx.accessList)}if(tx.blobVersionedHashes){result["blobVersionedHashes"]=tx.blobVersionedHashes.map(h=>h.toLowerCase())}if(tx.authorizationList){result["authorizationList"]=tx.authorizationList.map(_a=>{const a=authorizationify(_a);return{address:a.address,nonce:toQuantity(a.nonce),chainId:toQuantity(a.chainId),yParity:toQuantity(a.signature.yParity),r:toQuantity(a.signature.r),s:toQuantity(a.signature.s)}})}return result}getRpcRequest(req){switch(req.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[getLowerCase(req.address),req.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[getLowerCase(req.address),req.blockTag]};case"getCode":return{method:"eth_getCode",args:[getLowerCase(req.address),req.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[getLowerCase(req.address),"0x"+req.position.toString(16),req.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[req.signedTransaction]};case"getBlock":if("blockTag"in req){return{method:"eth_getBlockByNumber",args:[req.blockTag,!!req.includeTransactions]}}else if("blockHash"in req){return{method:"eth_getBlockByHash",args:[req.blockHash,!!req.includeTransactions]}}break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[req.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[req.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(req.transaction),req.blockTag]};case"estimateGas":{return{method:"eth_estimateGas",args:[this.getRpcTransaction(req.transaction)]}}case"getLogs":if(req.filter&&req.filter.address!=null){if(Array.isArray(req.filter.address)){req.filter.address=req.filter.address.map(getLowerCase)}else{req.filter.address=getLowerCase(req.filter.address)}}return{method:"eth_getLogs",args:[req.filter]}}return null}getRpcError(payload,_error){const{method}=payload;const{error}=_error;if(method==="eth_estimateGas"&&error.message){const msg=error.message;if(!msg.match(/revert/i)&&msg.match(/insufficient funds/i)){return makeError("insufficient funds","INSUFFICIENT_FUNDS",{transaction:payload.params[0],info:{payload:payload,error:error}})}else if(msg.match(/nonce/i)&&msg.match(/too low/i)){return makeError("nonce has already been used","NONCE_EXPIRED",{transaction:payload.params[0],info:{payload:payload,error:error}})}}if(method==="eth_call"||method==="eth_estimateGas"){const result=spelunkData(error);const e=AbiCoder.getBuiltinCallException(method==="eth_call"?"call":"estimateGas",payload.params[0],result?result.data:null);e.info={error:error,payload:payload};return e}const message=JSON.stringify(spelunkMessage(error));if(typeof error.message==="string"&&error.message.match(/user denied|ethers-user-denied/i)){const actionMap={eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"};return makeError(`user rejected action`,"ACTION_REJECTED",{action:actionMap[method]||"unknown",reason:"rejected",info:{payload:payload,error:error}})}if(method==="eth_sendRawTransaction"||method==="eth_sendTransaction"){const transaction=payload.params[0];if(message.match(/insufficient funds|base fee exceeds gas limit/i)){return makeError("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:transaction,info:{error:error}})}if(message.match(/nonce/i)&&message.match(/too low/i)){return makeError("nonce has already been used","NONCE_EXPIRED",{transaction:transaction,info:{error:error}})}if(message.match(/replacement transaction/i)&&message.match(/underpriced/i)){return makeError("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:transaction,info:{error:error}})}if(message.match(/only replay-protected/i)){return makeError("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:method,info:{transaction:transaction,info:{error:error}}})}}let unsupported=!!message.match(/the method .* does not exist/i);if(!unsupported){if(error&&error.details&&error.details.startsWith("Unauthorized method:")){unsupported=true}}if(unsupported){return makeError("unsupported operation","UNSUPPORTED_OPERATION",{operation:payload.method,info:{error:error,payload:payload}})}return makeError("could not coalesce error","UNKNOWN_ERROR",{error:error,payload:payload})}send(method,params){if(this.destroyed){return Promise.reject(makeError("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:method}))}const id=this.#nextId++;const promise=new Promise((resolve,reject)=>{this.#payloads.push({resolve:resolve,reject:reject,payload:{method:method,params:params,id:id,jsonrpc:"2.0"}})});this.#scheduleDrain();return promise}async getSigner(address){if(address==null){address=0}const accountsPromise=this.send("eth_accounts",[]);if(typeof address==="number"){const accounts=await accountsPromise;if(address>=accounts.length){throw new Error("no such account")}return new JsonRpcSigner(this,accounts[address])}const{accounts}=await resolveProperties({network:this.getNetwork(),accounts:accountsPromise});address=getAddress(address);for(const account of accounts){if(getAddress(account)===address){return new JsonRpcSigner(this,address)}}throw new Error("invalid account")}async listAccounts(){const accounts=await this.send("eth_accounts",[]);return accounts.map(a=>new JsonRpcSigner(this,a))}destroy(){if(this.#drainTimer){clearTimeout(this.#drainTimer);this.#drainTimer=null}for(const{payload,reject}of this.#payloads){reject(makeError("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:payload.method}))}this.#payloads=[];super.destroy()}}class JsonRpcApiPollingProvider extends JsonRpcApiProvider{#pollingInterval;constructor(network,options){super(network,options);let pollingInterval=this._getOption("pollingInterval");if(pollingInterval==null){pollingInterval=defaultOptions.pollingInterval}this.#pollingInterval=pollingInterval}_getSubscriber(sub){const subscriber=super._getSubscriber(sub);if(isPollable(subscriber)){subscriber.pollingInterval=this.#pollingInterval}return subscriber}get pollingInterval(){return this.#pollingInterval}set pollingInterval(value){if(!Number.isInteger(value)||value<0){throw new Error("invalid interval")}this.#pollingInterval=value;this._forEachSubscriber(sub=>{if(isPollable(sub)){sub.pollingInterval=this.#pollingInterval}})}}class JsonRpcProvider extends JsonRpcApiPollingProvider{#connect;constructor(url,network,options){if(url==null){url="http://localhost:8545"}super(network,options);if(typeof url==="string"){this.#connect=new FetchRequest(url)}else{this.#connect=url.clone()}}_getConnection(){return this.#connect.clone()}async send(method,params){await this._start();return await super.send(method,params)}async _send(payload){const request=this._getConnection();request.body=JSON.stringify(payload);request.setHeader("content-type","application/json");const response=await request.send();response.assertOk();let resp=response.bodyJson;if(!Array.isArray(resp)){resp=[resp]}return resp}}function spelunkData(value){if(value==null){return null}if(typeof value.message==="string"&&value.message.match(/revert/i)&&isHexString(value.data)){return{message:value.message,data:value.data}}if(typeof value==="object"){for(const key in value){const result=spelunkData(value[key]);if(result){return result}}return null}if(typeof value==="string"){try{return spelunkData(JSON.parse(value))}catch(error){}}return null}function _spelunkMessage(value,result){if(value==null){return}if(typeof value.message==="string"){result.push(value.message)}if(typeof value==="object"){for(const key in value){_spelunkMessage(value[key],result)}}if(typeof value==="string"){try{return _spelunkMessage(JSON.parse(value),result)}catch(error){}}}function spelunkMessage(value){const result=[];_spelunkMessage(value,result);return result}const defaultApiKey$1="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function getHost$5(name){switch(name){case"mainnet":return"rpc.ankr.com/eth";case"goerli":return"rpc.ankr.com/eth_goerli";case"sepolia":return"rpc.ankr.com/eth_sepolia";case"arbitrum":return"rpc.ankr.com/arbitrum";case"base":return"rpc.ankr.com/base";case"base-goerli":return"rpc.ankr.com/base_goerli";case"base-sepolia":return"rpc.ankr.com/base_sepolia";case"bnb":return"rpc.ankr.com/bsc";case"bnbt":return"rpc.ankr.com/bsc_testnet_chapel";case"filecoin":return"rpc.ankr.com/filecoin";case"filecoin-calibration":return"rpc.ankr.com/filecoin_testnet";case"matic":return"rpc.ankr.com/polygon";case"matic-mumbai":return"rpc.ankr.com/polygon_mumbai";case"optimism":return"rpc.ankr.com/optimism";case"optimism-goerli":return"rpc.ankr.com/optimism_testnet";case"optimism-sepolia":return"rpc.ankr.com/optimism_sepolia"}assertArgument(false,"unsupported network","network",name)}class AnkrProvider extends JsonRpcProvider{apiKey;constructor(_network,apiKey){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(apiKey==null){apiKey=defaultApiKey$1}const options={polling:true,staticNetwork:network};const request=AnkrProvider.getRequest(network,apiKey);super(request,network,options);defineProperties(this,{apiKey:apiKey})}_getProvider(chainId){try{return new AnkrProvider(chainId,this.apiKey)}catch(error){}return super._getProvider(chainId)}static getRequest(network,apiKey){if(apiKey==null){apiKey=defaultApiKey$1}const request=new FetchRequest(`https:/\/${getHost$5(network.name)}/${apiKey}`);request.allowGzip=true;if(apiKey===defaultApiKey$1){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("AnkrProvider");return true}}return request}getRpcError(payload,error){if(payload.method==="eth_sendRawTransaction"){if(error&&error.error&&error.error.message==="INTERNAL_ERROR: could not replace existing tx"){error.error.message="replacement transaction underpriced"}}return super.getRpcError(payload,error)}isCommunityResource(){return this.apiKey===defaultApiKey$1}}const defaultApiKey="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";function getHost$4(name){switch(name){case"mainnet":return"eth-mainnet.g.alchemy.com";case"goerli":return"eth-goerli.g.alchemy.com";case"sepolia":return"eth-sepolia.g.alchemy.com";case"arbitrum":return"arb-mainnet.g.alchemy.com";case"arbitrum-goerli":return"arb-goerli.g.alchemy.com";case"arbitrum-sepolia":return"arb-sepolia.g.alchemy.com";case"base":return"base-mainnet.g.alchemy.com";case"base-goerli":return"base-goerli.g.alchemy.com";case"base-sepolia":return"base-sepolia.g.alchemy.com";case"matic":return"polygon-mainnet.g.alchemy.com";case"matic-amoy":return"polygon-amoy.g.alchemy.com";case"matic-mumbai":return"polygon-mumbai.g.alchemy.com";case"optimism":return"opt-mainnet.g.alchemy.com";case"optimism-goerli":return"opt-goerli.g.alchemy.com";case"optimism-sepolia":return"opt-sepolia.g.alchemy.com"}assertArgument(false,"unsupported network","network",name)}class AlchemyProvider extends JsonRpcProvider{apiKey;constructor(_network,apiKey){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(apiKey==null){apiKey=defaultApiKey}const request=AlchemyProvider.getRequest(network,apiKey);super(request,network,{staticNetwork:network});defineProperties(this,{apiKey:apiKey})}_getProvider(chainId){try{return new AlchemyProvider(chainId,this.apiKey)}catch(error){}return super._getProvider(chainId)}async _perform(req){if(req.method==="getTransactionResult"){const{trace,tx}=await resolveProperties({trace:this.send("trace_transaction",[req.hash]),tx:this.getTransaction(req.hash)});if(trace==null||tx==null){return null}let data;let error=false;try{data=trace[0].result.output;error=trace[0].error==="Reverted"}catch(error){}if(data){assert(!error,"an error occurred during transaction executions","CALL_EXCEPTION",{action:"getTransactionResult",data:data,reason:null,transaction:tx,invocation:null,revert:null});return data}assert(false,"could not parse trace result","BAD_DATA",{value:trace})}return await super._perform(req)}isCommunityResource(){return this.apiKey===defaultApiKey}static getRequest(network,apiKey){if(apiKey==null){apiKey=defaultApiKey}const request=new FetchRequest(`https:/\/${getHost$4(network.name)}/v2/${apiKey}`);request.allowGzip=true;if(apiKey===defaultApiKey){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("alchemy");return true}}return request}}function getApiKey(name){switch(name){case"mainnet":return"39f1d67cedf8b7831010a665328c9197";case"arbitrum":return"0550c209db33c3abf4cc927e1e18cea1";case"bnb":return"98b5a77e531614387366f6fc5da097f8";case"matic":return"cd9d4d70377471aa7c142ec4a4205249"}assertArgument(false,"unsupported network","network",name)}function getHost$3(name){switch(name){case"mainnet":return"ethereum-mainnet.core.chainstack.com";case"arbitrum":return"arbitrum-mainnet.core.chainstack.com";case"bnb":return"bsc-mainnet.core.chainstack.com";case"matic":return"polygon-mainnet.core.chainstack.com"}assertArgument(false,"unsupported network","network",name)}class ChainstackProvider extends JsonRpcProvider{apiKey;constructor(_network,apiKey){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(apiKey==null){apiKey=getApiKey(network.name)}const request=ChainstackProvider.getRequest(network,apiKey);super(request,network,{staticNetwork:network});defineProperties(this,{apiKey:apiKey})}_getProvider(chainId){try{return new ChainstackProvider(chainId,this.apiKey)}catch(error){}return super._getProvider(chainId)}isCommunityResource(){return this.apiKey===getApiKey(this._network.name)}static getRequest(network,apiKey){if(apiKey==null){apiKey=getApiKey(network.name)}const request=new FetchRequest(`https:/\/${getHost$3(network.name)}/${apiKey}`);request.allowGzip=true;if(apiKey===getApiKey(network.name)){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("ChainstackProvider");return true}}return request}}class CloudflareProvider extends JsonRpcProvider{constructor(_network){if(_network==null){_network="mainnet"}const network=Network.from(_network);assertArgument(network.name==="mainnet","unsupported network","network",_network);super("https://cloudflare-eth.com/",network,{staticNetwork:network})}}const Supported=("1 11155111 17000 560048 2741 11124 33111 33139 42170 "+"42161 421614 43114 43113 8453 84532 80069 80094 199 1029 81457 "+"168587773 56 97 42220 11142220 252 2523 100 999 737373 747474 "+"59144 59141 5000 5003 43521 143 10143 1287 1284 1285 10 "+"11155420 204 5611 80002 137 534352 534351 1329 1328 146 14601 "+"988 2201 1923 1924 167013 167000 130 1301 480 4801 51 50 324 300").split(/ /g);const THROTTLE=2e3;function isPromise(value){return value&&typeof value.then==="function"}const EtherscanPluginId="org.ethers.plugins.provider.Etherscan";class EtherscanPlugin extends NetworkPlugin{baseUrl;constructor(baseUrl){super(EtherscanPluginId);defineProperties(this,{baseUrl:baseUrl})}clone(){return new EtherscanPlugin(this.baseUrl)}}const skipKeys=["enableCcipRead"];let nextId=1;class EtherscanProvider extends AbstractProvider{network;apiKey;#plugin;constructor(_network,_apiKey){const apiKey=_apiKey!=null?_apiKey:null;super();const network=Network.from(_network);assertArgument(Supported.indexOf(`${network.chainId}`)>=0,"unsupported network","network",network);this.#plugin=network.getPlugin(EtherscanPluginId);defineProperties(this,{apiKey:apiKey,network:network})}getBaseUrl(){if(this.#plugin){return this.#plugin.baseUrl}switch(this.network.name){case"mainnet":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"holesky":return"https://api-holesky.etherscan.io";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"base":return"https://api.basescan.org";case"base-sepolia":return"https://api-sepolia.basescan.org";case"bnb":return"https://api.bscscan.com";case"bnbt":return"https://api-testnet.bscscan.com";case"matic":return"https://api.polygonscan.com";case"matic-amoy":return"https://api-amoy.polygonscan.com";case"matic-mumbai":return"https://api-testnet.polygonscan.com";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}assertArgument(false,"unsupported network","network",this.network)}getUrl(module,params){let query=Object.keys(params).reduce((accum,key)=>{const value=params[key];if(value!=null){accum+=`&${key}=${value}`}return accum},"");if(this.apiKey){query+=`&apikey=${this.apiKey}`}return`https:/\/api.etherscan.io/v2/api?chainid=${this.network.chainId}&module=${module}${query}`}getPostUrl(){return`https:/\/api.etherscan.io/v2/api?chainid=${this.network.chainId}`}getPostData(module,params){params.module=module;params.apikey=this.apiKey;params.chainid=this.network.chainId;return params}async detectNetwork(){return this.network}async fetch(module,params,post){const id=nextId++;const url=post?this.getPostUrl():this.getUrl(module,params);const payload=post?this.getPostData(module,params):null;this.emit("debug",{action:"sendRequest",id:id,url:url,payload:payload});const request=new FetchRequest(url);request.setThrottleParams({slotInterval:1e3});request.retryFunc=(req,resp,attempt)=>{if(this.isCommunityResource()){showThrottleMessage("Etherscan")}return Promise.resolve(true)};request.processFunc=async(request,response)=>{const result=response.hasBody()?JSON.parse(toUtf8String(response.body)):{};const throttle=(typeof result.result==="string"?result.result:"").toLowerCase().indexOf("rate limit")>=0;if(module==="proxy"){if(result&&result.status==0&&result.message=="NOTOK"&&throttle){this.emit("debug",{action:"receiveError",id:id,reason:"proxy-NOTOK",error:result});response.throwThrottleError(result.result,THROTTLE)}}else{if(throttle){this.emit("debug",{action:"receiveError",id:id,reason:"null result",error:result.result});response.throwThrottleError(result.result,THROTTLE)}}return response};if(payload){request.setHeader("content-type","application/x-www-form-urlencoded; charset=UTF-8");request.body=Object.keys(payload).map(k=>`${k}=${payload[k]}`).join("&")}const response=await request.send();try{response.assertOk()}catch(error){this.emit("debug",{action:"receiveError",id:id,error:error,reason:"assertOk"});assert(false,"response error","SERVER_ERROR",{request:request,response:response})}if(!response.hasBody()){this.emit("debug",{action:"receiveError",id:id,error:"missing body",reason:"null body"});assert(false,"missing response","SERVER_ERROR",{request:request,response:response})}const result=JSON.parse(toUtf8String(response.body));if(module==="proxy"){if(result.jsonrpc!="2.0"){this.emit("debug",{action:"receiveError",id:id,result:result,reason:"invalid JSON-RPC"});assert(false,"invalid JSON-RPC response (missing jsonrpc='2.0')","SERVER_ERROR",{request:request,response:response,info:{result:result}})}if(result.error){this.emit("debug",{action:"receiveError",id:id,result:result,reason:"JSON-RPC error"});assert(false,"error response","SERVER_ERROR",{request:request,response:response,info:{result:result}})}this.emit("debug",{action:"receiveRequest",id:id,result:result});return result.result}else{if(result.status==0&&(result.message==="No records found"||result.message==="No transactions found")){this.emit("debug",{action:"receiveRequest",id:id,result:result});return result.result}if(result.status!=1||typeof result.message==="string"&&!result.message.match(/^OK/)){this.emit("debug",{action:"receiveError",id:id,result:result});assert(false,"error response","SERVER_ERROR",{request:request,response:response,info:{result:result}})}this.emit("debug",{action:"receiveRequest",id:id,result:result});return result.result}}_getTransactionPostData(transaction){const result={};for(let key in transaction){if(skipKeys.indexOf(key)>=0){continue}if(transaction[key]==null){continue}let value=transaction[key];if(key==="type"&&value===0){continue}if(key==="blockTag"&&value==="latest"){continue}if({type:true,gasLimit:true,gasPrice:true,maxFeePerGs:true,maxPriorityFeePerGas:true,nonce:true,value:true}[key]){value=toQuantity(value)}else if(key==="accessList"){value="["+accessListify(value).map(set=>{return`{address:"${set.address}",storageKeys:["${set.storageKeys.join('","')}"]}`}).join(",")+"]"}else if(key==="blobVersionedHashes"){if(value.length===0){continue}assert(false,"Etherscan API does not support blobVersionedHashes","UNSUPPORTED_OPERATION",{operation:"_getTransactionPostData",info:{transaction:transaction}})}else{value=hexlify(value)}result[key]=value}return result}_checkError(req,error,transaction){let message="";if(isError(error,"SERVER_ERROR")){try{message=error.info.result.error.message}catch(e){}if(!message){try{message=error.info.message}catch(e){}}}if(req.method==="estimateGas"){if(!message.match(/revert/i)&&message.match(/insufficient funds/i)){assert(false,"insufficient funds","INSUFFICIENT_FUNDS",{transaction:req.transaction})}}if(req.method==="call"||req.method==="estimateGas"){if(message.match(/execution reverted/i)){let data="";try{data=error.info.result.error.data}catch(error){}const e=AbiCoder.getBuiltinCallException(req.method,req.transaction,data);e.info={request:req,error:error};throw e}}if(message){if(req.method==="broadcastTransaction"){const transaction=Transaction.from(req.signedTransaction);if(message.match(/replacement/i)&&message.match(/underpriced/i)){assert(false,"replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:transaction})}if(message.match(/insufficient funds/)){assert(false,"insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:transaction})}if(message.match(/same hash was already imported|transaction nonce is too low|nonce too low/)){assert(false,"nonce has already been used","NONCE_EXPIRED",{transaction:transaction})}}}throw error}async _detectNetwork(){return this.network}async _perform(req){switch(req.method){case"chainId":return this.network.chainId;case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getPriorityFee":if(this.network.name==="mainnet"){return"1000000000"}else if(this.network.name==="optimism"){return"1000000"}else{throw new Error("fallback onto the AbstractProvider default")}case"getBalance":return this.fetch("account",{action:"balance",address:req.address,tag:req.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:req.address,tag:req.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:req.address,tag:req.blockTag});case"getStorage":return this.fetch("proxy",{action:"eth_getStorageAt",address:req.address,position:req.position,tag:req.blockTag});case"broadcastTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:req.signedTransaction},true).catch(error=>{return this._checkError(req,error,req.signedTransaction)});case"getBlock":if("blockTag"in req){return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:req.blockTag,boolean:req.includeTransactions?"true":"false"})}assert(false,"getBlock by blockHash not supported by Etherscan","UNSUPPORTED_OPERATION",{operation:"getBlock(blockHash)"});case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:req.hash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:req.hash});case"call":{if(req.blockTag!=="latest"){throw new Error("EtherscanProvider does not support blockTag for call")}const postData=this._getTransactionPostData(req.transaction);postData.module="proxy";postData.action="eth_call";try{return await this.fetch("proxy",postData,true)}catch(error){return this._checkError(req,error,req.transaction)}}case"estimateGas":{const postData=this._getTransactionPostData(req.transaction);postData.module="proxy";postData.action="eth_estimateGas";try{return await this.fetch("proxy",postData,true)}catch(error){return this._checkError(req,error,req.transaction)}}}return super._perform(req)}async getNetwork(){return this.network}async getEtherPrice(){if(this.network.name!=="mainnet"){return 0}return parseFloat((await this.fetch("stats",{action:"ethprice"})).ethusd)}async getContract(_address){let address=this._getAddress(_address);if(isPromise(address)){address=await address}try{const resp=await this.fetch("contract",{action:"getabi",address:address});const abi=JSON.parse(resp);return new Contract(address,abi,this)}catch(error){return null}}isCommunityResource(){return this.apiKey==null}}function getGlobal(){if(typeof self!=="undefined"){return self}if(typeof window!=="undefined"){return window}if(typeof global!=="undefined"){return global}throw new Error("unable to locate global object")}const _WebSocket=getGlobal().WebSocket;class SocketSubscriber{#provider;#filter;get filter(){return JSON.parse(this.#filter)}#filterId;#paused;#emitPromise;constructor(provider,filter){this.#provider=provider;this.#filter=JSON.stringify(filter);this.#filterId=null;this.#paused=null;this.#emitPromise=null}start(){this.#filterId=this.#provider.send("eth_subscribe",this.filter).then(filterId=>{this.#provider._register(filterId,this);return filterId})}stop(){this.#filterId.then(filterId=>{if(this.#provider.destroyed){return}this.#provider.send("eth_unsubscribe",[filterId])});this.#filterId=null}pause(dropWhilePaused){assert(dropWhilePaused,"preserve logs while paused not supported by SocketSubscriber yet","UNSUPPORTED_OPERATION",{operation:"pause(false)"});this.#paused=!!dropWhilePaused}resume(){this.#paused=null}_handleMessage(message){if(this.#filterId==null){return}if(this.#paused===null){let emitPromise=this.#emitPromise;if(emitPromise==null){emitPromise=this._emit(this.#provider,message)}else{emitPromise=emitPromise.then(async()=>{await this._emit(this.#provider,message)})}this.#emitPromise=emitPromise.then(()=>{if(this.#emitPromise===emitPromise){this.#emitPromise=null}})}}async _emit(provider,message){throw new Error("sub-classes must implemente this; _emit")}}class SocketBlockSubscriber extends SocketSubscriber{constructor(provider){super(provider,["newHeads"])}async _emit(provider,message){provider.emit("block",parseInt(message.number))}}class SocketPendingSubscriber extends SocketSubscriber{constructor(provider){super(provider,["newPendingTransactions"])}async _emit(provider,message){provider.emit("pending",message)}}class SocketEventSubscriber extends SocketSubscriber{#logFilter;get logFilter(){return JSON.parse(this.#logFilter)}constructor(provider,filter){super(provider,["logs",filter]);this.#logFilter=JSON.stringify(filter)}async _emit(provider,message){provider.emit(this.logFilter,provider._wrapLog(message,provider._network))}}class SocketProvider extends JsonRpcApiProvider{#callbacks;#subs;#pending;constructor(network,_options){const options=Object.assign({},_options!=null?_options:{});assertArgument(options.batchMaxCount==null||options.batchMaxCount===1,"sockets-based providers do not support batches","options.batchMaxCount",_options);options.batchMaxCount=1;if(options.staticNetwork==null){options.staticNetwork=true}super(network,options);this.#callbacks=new Map;this.#subs=new Map;this.#pending=new Map}_getSubscriber(sub){switch(sub.type){case"close":return new UnmanagedSubscriber("close");case"block":return new SocketBlockSubscriber(this);case"pending":return new SocketPendingSubscriber(this);case"event":return new SocketEventSubscriber(this,sub.filter);case"orphan":if(sub.filter.orphan==="drop-log"){return new UnmanagedSubscriber("drop-log")}}return super._getSubscriber(sub)}_register(filterId,subscriber){this.#subs.set(filterId,subscriber);const pending=this.#pending.get(filterId);if(pending){for(const message of pending){subscriber._handleMessage(message)}this.#pending.delete(filterId)}}async _send(payload){assertArgument(!Array.isArray(payload),"WebSocket does not support batch send","payload",payload);const promise=new Promise((resolve,reject)=>{this.#callbacks.set(payload.id,{payload:payload,resolve:resolve,reject:reject})});await this._waitUntilReady();await this._write(JSON.stringify(payload));return[await promise]}async _processMessage(message){const result=JSON.parse(message);if(result&&typeof result==="object"&&"id"in result){const callback=this.#callbacks.get(result.id);if(callback==null){this.emit("error",makeError("received result for unknown id","UNKNOWN_ERROR",{reasonCode:"UNKNOWN_ID",result:result}));return}this.#callbacks.delete(result.id);callback.resolve(result)}else if(result&&result.method==="eth_subscription"){const filterId=result.params.subscription;const subscriber=this.#subs.get(filterId);if(subscriber){subscriber._handleMessage(result.params.result)}else{let pending=this.#pending.get(filterId);if(pending==null){pending=[];this.#pending.set(filterId,pending)}pending.push(result.params.result)}}else{this.emit("error",makeError("received unexpected message","UNKNOWN_ERROR",{reasonCode:"UNEXPECTED_MESSAGE",result:result}));return}}async _write(message){throw new Error("sub-classes must override this")}}class WebSocketProvider extends SocketProvider{#connect;#websocket;get websocket(){if(this.#websocket==null){throw new Error("websocket closed")}return this.#websocket}constructor(url,network,options){super(network,options);if(typeof url==="string"){this.#connect=()=>{return new _WebSocket(url)};this.#websocket=this.#connect()}else if(typeof url==="function"){this.#connect=url;this.#websocket=url()}else{this.#connect=null;this.#websocket=url}this.websocket.onopen=async()=>{try{await this._start();this.resume()}catch(error){console.log("failed to start WebsocketProvider",error)}};this.websocket.onmessage=message=>{this._processMessage(message.data)}}async _write(message){this.websocket.send(message)}async destroy(){if(this.#websocket!=null){this.#websocket.close();this.#websocket=null}super.destroy()}}const defaultProjectId="84842078b09946638c03157f83405213";function getHost$2(name){switch(name){case"mainnet":return"mainnet.infura.io";case"goerli":return"goerli.infura.io";case"sepolia":return"sepolia.infura.io";case"arbitrum":return"arbitrum-mainnet.infura.io";case"arbitrum-goerli":return"arbitrum-goerli.infura.io";case"arbitrum-sepolia":return"arbitrum-sepolia.infura.io";case"base":return"base-mainnet.infura.io";case"base-goerlia":case"base-goerli":return"base-goerli.infura.io";case"base-sepolia":return"base-sepolia.infura.io";case"bnb":return"bsc-mainnet.infura.io";case"bnbt":return"bsc-testnet.infura.io";case"linea":return"linea-mainnet.infura.io";case"linea-goerli":return"linea-goerli.infura.io";case"linea-sepolia":return"linea-sepolia.infura.io";case"matic":return"polygon-mainnet.infura.io";case"matic-amoy":return"polygon-amoy.infura.io";case"matic-mumbai":return"polygon-mumbai.infura.io";case"optimism":return"optimism-mainnet.infura.io";case"optimism-goerli":return"optimism-goerli.infura.io";case"optimism-sepolia":return"optimism-sepolia.infura.io"}assertArgument(false,"unsupported network","network",name)}class InfuraWebSocketProvider extends WebSocketProvider{projectId;projectSecret;constructor(network,projectId){const provider=new InfuraProvider(network,projectId);const req=provider._getConnection();assert(!req.credentials,"INFURA WebSocket project secrets unsupported","UNSUPPORTED_OPERATION",{operation:"InfuraProvider.getWebSocketProvider()"});const url=req.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");super(url,provider._network);defineProperties(this,{projectId:provider.projectId,projectSecret:provider.projectSecret})}isCommunityResource(){return this.projectId===defaultProjectId}}class InfuraProvider extends JsonRpcProvider{projectId;projectSecret;constructor(_network,projectId,projectSecret){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(projectId==null){projectId=defaultProjectId}if(projectSecret==null){projectSecret=null}const request=InfuraProvider.getRequest(network,projectId,projectSecret);super(request,network,{staticNetwork:network});defineProperties(this,{projectId:projectId,projectSecret:projectSecret})}_getProvider(chainId){try{return new InfuraProvider(chainId,this.projectId,this.projectSecret)}catch(error){}return super._getProvider(chainId)}isCommunityResource(){return this.projectId===defaultProjectId}static getWebSocketProvider(network,projectId){return new InfuraWebSocketProvider(network,projectId)}static getRequest(network,projectId,projectSecret){if(projectId==null){projectId=defaultProjectId}if(projectSecret==null){projectSecret=null}const request=new FetchRequest(`https:/\/${getHost$2(network.name)}/v3/${projectId}`);request.allowGzip=true;if(projectSecret){request.setCredentials("",projectSecret)}if(projectId===defaultProjectId){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("InfuraProvider");return true}}return request}}const defaultToken="919b412a057b5e9c9b6dce193c5a60242d6efadb";function getHost$1(name){switch(name){case"mainnet":return"ethers.quiknode.pro";case"goerli":return"ethers.ethereum-goerli.quiknode.pro";case"sepolia":return"ethers.ethereum-sepolia.quiknode.pro";case"holesky":return"ethers.ethereum-holesky.quiknode.pro";case"arbitrum":return"ethers.arbitrum-mainnet.quiknode.pro";case"arbitrum-goerli":return"ethers.arbitrum-goerli.quiknode.pro";case"arbitrum-sepolia":return"ethers.arbitrum-sepolia.quiknode.pro";case"base":return"ethers.base-mainnet.quiknode.pro";case"base-goerli":return"ethers.base-goerli.quiknode.pro";case"base-spolia":return"ethers.base-sepolia.quiknode.pro";case"bnb":return"ethers.bsc.quiknode.pro";case"bnbt":return"ethers.bsc-testnet.quiknode.pro";case"matic":return"ethers.matic.quiknode.pro";case"matic-mumbai":return"ethers.matic-testnet.quiknode.pro";case"optimism":return"ethers.optimism.quiknode.pro";case"optimism-goerli":return"ethers.optimism-goerli.quiknode.pro";case"optimism-sepolia":return"ethers.optimism-sepolia.quiknode.pro";case"xdai":return"ethers.xdai.quiknode.pro"}assertArgument(false,"unsupported network","network",name)}class QuickNodeProvider extends JsonRpcProvider{token;constructor(_network,token){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(token==null){token=defaultToken}const request=QuickNodeProvider.getRequest(network,token);super(request,network,{staticNetwork:network});defineProperties(this,{token:token})}_getProvider(chainId){try{return new QuickNodeProvider(chainId,this.token)}catch(error){}return super._getProvider(chainId)}isCommunityResource(){return this.token===defaultToken}static getRequest(network,token){if(token==null){token=defaultToken}const request=new FetchRequest(`https:/\/${getHost$1(network.name)}/${token}`);request.allowGzip=true;if(token===defaultToken){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("QuickNodeProvider");return true}}return request}}const BN_1=BigInt("1");const BN_2=BigInt("2");function shuffle(array){for(let i=array.length-1;i>0;i--){const j=Math.floor(Math.random()*(i+1));const tmp=array[i];array[i]=array[j];array[j]=tmp}}function stall$2(duration){return new Promise(resolve=>{setTimeout(resolve,duration)})}function getTime(){return(new Date).getTime()}function stringify(value){return JSON.stringify(value,(key,value)=>{if(typeof value==="bigint"){return{type:"bigint",value:value.toString()}}return value})}const defaultConfig={stallTimeout:400,priority:1,weight:1};const defaultState={blockNumber:-2,requests:0,lateResponses:0,errorResponses:0,outOfSync:-1,unsupportedEvents:0,rollingDuration:0,score:0,_network:null,_updateNumber:null,_totalTime:0,_lastFatalError:null,_lastFatalErrorTimestamp:0};async function waitForSync(config,blockNumber){while(config.blockNumber<0||config.blockNumber{try{const blockNumber=await config.provider.getBlockNumber();if(blockNumber>config.blockNumber){config.blockNumber=blockNumber}}catch(error){config.blockNumber=-2;config._lastFatalError=error;config._lastFatalErrorTimestamp=getTime()}config._updateNumber=null})()}await config._updateNumber;config.outOfSync++;if(config._lastFatalError){break}}}function _normalize(value){if(value==null){return"null"}if(Array.isArray(value)){return"["+value.map(_normalize).join(",")+"]"}if(typeof value==="object"&&typeof value.toJSON==="function"){return _normalize(value.toJSON())}switch(typeof value){case"boolean":case"symbol":return value.toString();case"bigint":case"number":return BigInt(value).toString();case"string":return JSON.stringify(value);case"object":{const keys=Object.keys(value);keys.sort();return"{"+keys.map(k=>`${JSON.stringify(k)}:${_normalize(value[k])}`).join(",")+"}"}}console.log("Could not serialize",value);throw new Error("Hmm...")}function normalizeResult(method,value){if("error"in value){const error=value.error;let tag;if(isError(error,"CALL_EXCEPTION")){tag=_normalize(Object.assign({},error,{shortMessage:undefined,reason:undefined,info:undefined}))}else{tag=_normalize(error)}return{tag:tag,value:error}}const result=value.result;return{tag:_normalize(result),value:result}}function checkQuorum(quorum,results){const tally=new Map;for(const{value,tag,weight}of results){const t=tally.get(tag)||{value:value,weight:0};t.weight+=weight;tally.set(tag,t)}let best=null;for(const r of tally.values()){if(r.weight>=quorum&&(!best||r.weight>best.weight)){best=r}}if(best){return best.value}return undefined}function getMedian(quorum,results){let resultWeight=0;const errorMap=new Map;let bestError=null;const values=[];for(const{value,tag,weight}of results){if(value instanceof Error){const e=errorMap.get(tag)||{value:value,weight:0};e.weight+=weight;errorMap.set(tag,e);if(bestError==null||e.weight>bestError.weight){bestError=e}}else{values.push(BigInt(value));resultWeight+=weight}}if(resultWeight=quorum){return bestError.value}return undefined}values.sort((a,b)=>aa?1:0);const mid=Math.floor(values.length/2);if(values.length%2){return values[mid]}return(values[mid-1]+values[mid]+BN_1)/BN_2}function getAnyResult(quorum,results){const result=checkQuorum(quorum,results);if(result!==undefined){return result}for(const r of results){if(r.value){return r.value}}return undefined}function getFuzzyMode(quorum,results){if(quorum===1){return getNumber(getMedian(quorum,results),"%internal")}const tally=new Map;const add=(result,weight)=>{const t=tally.get(result)||{result:result,weight:0};t.weight+=weight;tally.set(result,t)};for(const{weight,value}of results){const r=getNumber(value);add(r-1,weight);add(r,weight);add(r+1,weight)}let bestWeight=0;let bestResult=undefined;for(const{weight,result}of tally.values()){if(weight>=quorum&&(weight>bestWeight||bestResult!=null&&weight===bestWeight&&result>bestResult)){bestWeight=weight;bestResult=result}}return bestResult}class FallbackProvider extends AbstractProvider{quorum;eventQuorum;eventWorkers;#configs;#height;#initialSyncPromise;constructor(providers,network,options){super(network,options);this.#configs=providers.map(p=>{if(p instanceof AbstractProvider){return Object.assign({provider:p},defaultConfig,defaultState)}else{return Object.assign({},defaultConfig,p,defaultState)}});this.#height=-2;this.#initialSyncPromise=null;if(options&&options.quorum!=null){this.quorum=options.quorum}else{this.quorum=Math.ceil(this.#configs.reduce((accum,config)=>{accum+=config.weight;return accum},0)/2)}this.eventQuorum=1;this.eventWorkers=1;assertArgument(this.quorum<=this.#configs.reduce((a,c)=>a+c.weight,0),"quorum exceed provider weight","quorum",this.quorum)}get providerConfigs(){return this.#configs.map(c=>{const result=Object.assign({},c);for(const key in result){if(key[0]==="_"){delete result[key]}}return result})}async _detectNetwork(){return Network.from(getBigInt(await this._perform({method:"chainId"})))}async _translatePerform(provider,req){switch(req.method){case"broadcastTransaction":return await provider.broadcastTransaction(req.signedTransaction);case"call":return await provider.call(Object.assign({},req.transaction,{blockTag:req.blockTag}));case"chainId":return(await provider.getNetwork()).chainId;case"estimateGas":return await provider.estimateGas(req.transaction);case"getBalance":return await provider.getBalance(req.address,req.blockTag);case"getBlock":{const block="blockHash"in req?req.blockHash:req.blockTag;return await provider.getBlock(block,req.includeTransactions)}case"getBlockNumber":return await provider.getBlockNumber();case"getCode":return await provider.getCode(req.address,req.blockTag);case"getGasPrice":return(await provider.getFeeData()).gasPrice;case"getPriorityFee":return(await provider.getFeeData()).maxPriorityFeePerGas;case"getLogs":return await provider.getLogs(req.filter);case"getStorage":return await provider.getStorage(req.address,req.position,req.blockTag);case"getTransaction":return await provider.getTransaction(req.hash);case"getTransactionCount":return await provider.getTransactionCount(req.address,req.blockTag);case"getTransactionReceipt":return await provider.getTransactionReceipt(req.hash);case"getTransactionResult":return await provider.getTransactionResult(req.hash)}}#getNextConfig(running){const configs=Array.from(running).map(r=>r.config);const allConfigs=this.#configs.slice();shuffle(allConfigs);allConfigs.sort((a,b)=>a.priority-b.priority);for(const config of allConfigs){if(config._lastFatalError){continue}if(configs.indexOf(config)===-1){return config}}return null}#addRunner(running,req){const config=this.#getNextConfig(running);if(config==null){return null}const runner={config:config,result:null,didBump:false,perform:null,staller:null};const now=getTime();runner.perform=(async()=>{try{config.requests++;const result=await this._translatePerform(config.provider,req);runner.result={result:result}}catch(error){config.errorResponses++;runner.result={error:error}}const dt=getTime()-now;config._totalTime+=dt;config.rollingDuration=.95*config.rollingDuration+.05*dt;runner.perform=null})();runner.staller=(async()=>{await stall$2(config.stallTimeout);runner.staller=null})();running.add(runner);return runner}async#initialSync(){let initialSync=this.#initialSyncPromise;if(!initialSync){const promises=[];this.#configs.forEach(config=>{promises.push((async()=>{await waitForSync(config,0);if(!config._lastFatalError){config._network=await config.provider.getNetwork()}})())});this.#initialSyncPromise=initialSync=(async()=>{await Promise.all(promises);let chainId=null;for(const config of this.#configs){if(config._lastFatalError){continue}const network=config._network;if(chainId==null){chainId=network.chainId}else if(network.chainId!==chainId){assert(false,"cannot mix providers on different networks","UNSUPPORTED_OPERATION",{operation:"new FallbackProvider"})}}})()}await initialSync}async#checkQuorum(running,req){const results=[];for(const runner of running){if(runner.result!=null){const{tag,value}=normalizeResult(req.method,runner.result);results.push({tag:tag,value:value,weight:runner.config.weight})}}if(results.reduce((a,r)=>a+r.weight,0)!c._lastFatalError).map(c=>({value:c.blockNumber,tag:getNumber(c.blockNumber).toString(),weight:c.weight})))))}const mode=getFuzzyMode(this.quorum,results);if(mode===undefined){return undefined}if(mode>this.#height){this.#height=mode}return this.#height}case"getGasPrice":case"getPriorityFee":case"estimateGas":return getMedian(this.quorum,results);case"getBlock":if("blockTag"in req&&req.blockTag==="pending"){return getAnyResult(this.quorum,results)}return checkQuorum(this.quorum,results);case"call":case"chainId":case"getBalance":case"getTransactionCount":case"getCode":case"getStorage":case"getTransaction":case"getTransactionReceipt":case"getLogs":return checkQuorum(this.quorum,results);case"broadcastTransaction":return getAnyResult(this.quorum,results)}assert(false,"unsupported method","UNSUPPORTED_OPERATION",{operation:`_perform(${stringify(req.method)})`})}async#waitForQuorum(running,req){if(running.size===0){throw new Error("no runners?!")}const interesting=[];let newRunners=0;for(const runner of running){if(runner.perform){interesting.push(runner.perform)}if(runner.staller){interesting.push(runner.staller);continue}if(runner.didBump){continue}runner.didBump=true;newRunners++}const value=await this.#checkQuorum(running,req);if(value!==undefined){if(value instanceof Error){throw value}return value}for(let i=0;i0,"quorum not met","SERVER_ERROR",{request:"%sub-requests",info:{request:req,results:Array.from(running).map(r=>stringify(r.result))}});await Promise.race(interesting);return await this.#waitForQuorum(running,req)}async _perform(req){if(req.method==="broadcastTransaction"){const results=this.#configs.map(c=>null);const broadcasts=this.#configs.map(async({provider,weight},index)=>{try{const result=await provider._perform(req);results[index]=Object.assign(normalizeResult(req.method,{result:result}),{weight:weight})}catch(error){results[index]=Object.assign(normalizeResult(req.method,{error:error}),{weight:weight})}});while(true){const done=results.filter(r=>r!=null);for(const{value}of done){if(!(value instanceof Error)){return value}}const result=checkQuorum(this.quorum,results.filter(r=>r!=null));if(isError(result,"INSUFFICIENT_FUNDS")){throw result}const waiting=broadcasts.filter((b,i)=>results[i]==null);if(waiting.length===0){break}await Promise.race(waiting)}const result=getAnyResult(this.quorum,results);assert(result!==undefined,"problem multi-broadcasting","SERVER_ERROR",{request:"%sub-requests",info:{request:req,results:results.map(stringify)}});if(result instanceof Error){throw result}return result}await this.#initialSync();const running=new Set;let inflightQuorum=0;while(true){const runner=this.#addRunner(running,req);if(runner==null){break}inflightQuorum+=runner.config.weight;if(inflightQuorum>=this.quorum){break}}const result=await this.#waitForQuorum(running,req);for(const runner of running){if(runner.perform&&runner.result==null){runner.config.lateResponses++}}return result}async destroy(){for(const{provider}of this.#configs){provider.destroy()}super.destroy()}}function isWebSocketLike(value){return value&&typeof value.send==="function"&&typeof value.close==="function"}const Testnets="goerli kovan sepolia classicKotti optimism-goerli arbitrum-goerli matic-mumbai bnbt".split(" ");function getDefaultProvider(network,options){if(options==null){options={}}const allowService=name=>{if(options[name]==="-"){return false}if(typeof options.exclusive==="string"){return name===options.exclusive}if(Array.isArray(options.exclusive)){return options.exclusive.indexOf(name)!==-1}return true};if(typeof network==="string"&&network.match(/^https?:/)){return new JsonRpcProvider(network)}if(typeof network==="string"&&network.match(/^wss?:/)||isWebSocketLike(network)){return new WebSocketProvider(network)}let staticNetwork=null;try{staticNetwork=Network.from(network)}catch(error){}const providers=[];if(allowService("publicPolygon")&&staticNetwork){if(staticNetwork.name==="matic"){providers.push(new JsonRpcProvider("https://polygon-rpc.com/",staticNetwork,{staticNetwork:staticNetwork}))}else if(staticNetwork.name==="matic-amoy"){providers.push(new JsonRpcProvider("https://rpc-amoy.polygon.technology/",staticNetwork,{staticNetwork:staticNetwork}))}}if(allowService("alchemy")){try{providers.push(new AlchemyProvider(network,options.alchemy))}catch(error){}}if(allowService("ankr")&&options.ankr!=null){try{providers.push(new AnkrProvider(network,options.ankr))}catch(error){}}if(allowService("chainstack")){try{providers.push(new ChainstackProvider(network,options.chainstack))}catch(error){}}if(allowService("cloudflare")){try{providers.push(new CloudflareProvider(network))}catch(error){}}if(allowService("etherscan")){try{providers.push(new EtherscanProvider(network,options.etherscan))}catch(error){}}if(allowService("infura")){try{let projectId=options.infura;let projectSecret=undefined;if(typeof projectId==="object"){projectSecret=projectId.projectSecret;projectId=projectId.projectId}providers.push(new InfuraProvider(network,projectId,projectSecret))}catch(error){}}if(allowService("quicknode")){try{let token=options.quicknode;providers.push(new QuickNodeProvider(network,token))}catch(error){}}assert(providers.length,"unsupported default network","UNSUPPORTED_OPERATION",{operation:"getDefaultProvider"});if(providers.length===1){return providers[0]}let quorum=Math.floor(providers.length/2);if(quorum>2){quorum=2}if(staticNetwork&&Testnets.indexOf(staticNetwork.name)!==-1){quorum=1}if(options&&options.quorum){quorum=options.quorum}return new FallbackProvider(providers,undefined,{quorum:quorum})}class NonceManager extends AbstractSigner{signer;#noncePromise;#delta;constructor(signer){super(signer.provider);defineProperties(this,{signer:signer});this.#noncePromise=null;this.#delta=0}async getAddress(){return this.signer.getAddress()}connect(provider){return new NonceManager(this.signer.connect(provider))}async getNonce(blockTag){if(blockTag==="pending"){if(this.#noncePromise==null){this.#noncePromise=super.getNonce("pending")}const delta=this.#delta;return await this.#noncePromise+delta}return super.getNonce(blockTag)}increment(){this.#delta++}reset(){this.#delta=0;this.#noncePromise=null}async sendTransaction(tx){const noncePromise=this.getNonce("pending");this.increment();tx=await this.signer.populateTransaction(tx);tx.nonce=await noncePromise;return await this.signer.sendTransaction(tx)}signTransaction(tx){return this.signer.signTransaction(tx)}signMessage(message){return this.signer.signMessage(message)}signTypedData(domain,types,value){return this.signer.signTypedData(domain,types,value)}}class BrowserProvider extends JsonRpcApiPollingProvider{#request;#providerInfo;constructor(ethereum,network,_options){const options=Object.assign({},_options!=null?_options:{},{batchMaxCount:1});assertArgument(ethereum&ðereum.request,"invalid EIP-1193 provider","ethereum",ethereum);super(network,options);this.#providerInfo=null;if(_options&&_options.providerInfo){this.#providerInfo=_options.providerInfo}this.#request=async(method,params)=>{const payload={method:method,params:params};this.emit("debug",{action:"sendEip1193Request",payload:payload});try{const result=await ethereum.request(payload);this.emit("debug",{action:"receiveEip1193Result",result:result});return result}catch(e){const error=new Error(e.message);error.code=e.code;error.data=e.data;error.payload=payload;this.emit("debug",{action:"receiveEip1193Error",error:error});throw error}}}get providerInfo(){return this.#providerInfo}async send(method,params){await this._start();return await super.send(method,params)}async _send(payload){assertArgument(!Array.isArray(payload),"EIP-1193 does not support batch request","payload",payload);try{const result=await this.#request(payload.method,payload.params||[]);return[{id:payload.id,result:result}]}catch(e){return[{id:payload.id,error:{code:e.code,data:e.data,message:e.message}}]}}getRpcError(payload,error){error=JSON.parse(JSON.stringify(error));switch(error.error.code||-1){case 4001:error.error.message=`ethers-user-denied: ${error.error.message}`;break;case 4200:error.error.message=`ethers-unsupported: ${error.error.message}`;break}return super.getRpcError(payload,error)}async hasSigner(address){if(address==null){address=0}const accounts=await this.send("eth_accounts",[]);if(typeof address==="number"){return accounts.length>address}address=address.toLowerCase();return accounts.filter(a=>a.toLowerCase()===address).length!==0}async getSigner(address){if(address==null){address=0}if(!await this.hasSigner(address)){try{await this.#request("eth_requestAccounts",[])}catch(error){const payload=error.payload;throw this.getRpcError(payload,{id:payload.id,error:error})}}return await super.getSigner(address)}static async discover(options){if(options==null){options={}}if(options.provider){return new BrowserProvider(options.provider)}const context=options.window?options.window:typeof window!=="undefined"?window:null;if(context==null){return null}const anyProvider=options.anyProvider;if(anyProvider&&context.ethereum){return new BrowserProvider(context.ethereum)}if(!("addEventListener"in context&&"dispatchEvent"in context&&"removeEventListener"in context)){return null}const timeout=options.timeout?options.timeout:300;if(timeout===0){return null}return await new Promise((resolve,reject)=>{let found=[];const addProvider=event=>{found.push(event.detail);if(anyProvider){finalize()}};const finalize=()=>{clearTimeout(timer);if(found.length){if(options&&options.filter){const filtered=options.filter(found.map(i=>Object.assign({},i.info)));if(filtered==null){resolve(null)}else if(filtered instanceof BrowserProvider){resolve(filtered)}else{let match=null;if(filtered.uuid){const matches=found.filter(f=>filtered.uuid===f.info.uuid);match=matches[0]}if(match){const{provider,info}=match;resolve(new BrowserProvider(provider,undefined,{providerInfo:info}))}else{reject(makeError("filter returned unknown info","UNSUPPORTED_OPERATION",{value:filtered}))}}}else{const{provider,info}=found[0];resolve(new BrowserProvider(provider,undefined,{providerInfo:info}))}}else{resolve(null)}context.removeEventListener("eip6963:announceProvider",addProvider)};const timer=setTimeout(()=>{finalize()},timeout);context.addEventListener("eip6963:announceProvider",addProvider);context.dispatchEvent(new Event("eip6963:requestProvider"))})}}function getUrl(name){switch(name){case"mainnet":return"https://eth.blockscout.com/api/eth-rpc";case"sepolia":return"https://eth-sepolia.blockscout.com/api/eth-rpc";case"holesky":return"https://eth-holesky.blockscout.com/api/eth-rpc";case"classic":return"https://etc.blockscout.com/api/eth-rpc";case"arbitrum":return"https://arbitrum.blockscout.com/api/eth-rpc";case"base":return"https://base.blockscout.com/api/eth-rpc";case"base-sepolia":return"https://base-sepolia.blockscout.com/api/eth-rpc";case"matic":return"https://polygon.blockscout.com/api/eth-rpc";case"optimism":return"https://optimism.blockscout.com/api/eth-rpc";case"optimism-sepolia":return"https://optimism-sepolia.blockscout.com/api/eth-rpc";case"xdai":return"https://gnosis.blockscout.com/api/eth-rpc"}assertArgument(false,"unsupported network","network",name)}class BlockscoutProvider extends JsonRpcProvider{apiKey;constructor(_network,apiKey){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(apiKey==null){apiKey=null}const request=BlockscoutProvider.getRequest(network);super(request,network,{staticNetwork:network});defineProperties(this,{apiKey:apiKey})}_getProvider(chainId){try{return new BlockscoutProvider(chainId,this.apiKey)}catch(error){}return super._getProvider(chainId)}isCommunityResource(){return this.apiKey===null}getRpcRequest(req){const resp=super.getRpcRequest(req);if(resp&&resp.method==="eth_estimateGas"&&resp.args.length==1){resp.args=resp.args.slice();resp.args.push("latest")}return resp}getRpcError(payload,_error){const error=_error?_error.error:null;if(error&&error.code===-32015&&!isHexString(error.data||"",true)){const panicCodes={"assert(false)":"01","arithmetic underflow or overflow":"11","division or modulo by zero":"12","out-of-bounds array access; popping on an empty array":"31","out-of-bounds access of an array or bytesN":"32"};let panicCode="";if(error.message==="VM execution error."){panicCode=panicCodes[error.data]||""}else if(panicCodes[error.message||""]){panicCode=panicCodes[error.message||""]}if(panicCode){error.message+=` (reverted: ${error.data})`;error.data="0x4e487b7100000000000000000000000000000000000000000000000000000000000000"+panicCode}}else if(error&&error.code===-32e3){if(error.message==="wrong transaction nonce"){error.message+=" (nonce too low)"}}return super.getRpcError(payload,_error)}static getRequest(network){const request=new FetchRequest(getUrl(network.name));request.allowGzip=true;return request}}const defaultApplicationId="62e1ad51b37b8e00394bda3b";function getHost(name){switch(name){case"mainnet":return"eth-mainnet.gateway.pokt.network";case"goerli":return"eth-goerli.gateway.pokt.network";case"matic":return"poly-mainnet.gateway.pokt.network";case"matic-mumbai":return"polygon-mumbai-rpc.gateway.pokt.network"}assertArgument(false,"unsupported network","network",name)}class PocketProvider extends JsonRpcProvider{applicationId;applicationSecret;constructor(_network,applicationId,applicationSecret){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(applicationId==null){applicationId=defaultApplicationId}if(applicationSecret==null){applicationSecret=null}const options={staticNetwork:network};const request=PocketProvider.getRequest(network,applicationId,applicationSecret);super(request,network,options);defineProperties(this,{applicationId:applicationId,applicationSecret:applicationSecret})}_getProvider(chainId){try{return new PocketProvider(chainId,this.applicationId,this.applicationSecret)}catch(error){}return super._getProvider(chainId)}static getRequest(network,applicationId,applicationSecret){if(applicationId==null){applicationId=defaultApplicationId}const request=new FetchRequest(`https:/\/${getHost(network.name)}/v1/lb/${applicationId}`);request.allowGzip=true;if(applicationSecret){request.setCredentials("",applicationSecret)}if(applicationId===defaultApplicationId){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("PocketProvider");return true}}return request}isCommunityResource(){return this.applicationId===defaultApplicationId}}const IpcSocketProvider=undefined;class BaseWallet extends AbstractSigner{address;#signingKey;constructor(privateKey,provider){super(provider);assertArgument(privateKey&&typeof privateKey.sign==="function","invalid private key","privateKey","[ REDACTED ]");this.#signingKey=privateKey;const address=computeAddress(this.signingKey.publicKey);defineProperties(this,{address:address})}get signingKey(){return this.#signingKey}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(provider){return new BaseWallet(this.#signingKey,provider)}async signTransaction(tx){tx=copyRequest(tx);const{to,from}=await resolveProperties({to:tx.to?resolveAddress(tx.to,this):undefined,from:tx.from?resolveAddress(tx.from,this):undefined});if(to!=null){tx.to=to}if(from!=null){tx.from=from}if(tx.from!=null){assertArgument(getAddress(tx.from)===this.address,"transaction from address mismatch","tx.from",tx.from);delete tx.from}const btx=Transaction.from(tx);btx.signature=this.signingKey.sign(btx.unsignedHash);return btx.serialized}async signMessage(message){return this.signMessageSync(message)}signMessageSync(message){return this.signingKey.sign(hashMessage(message)).serialized}authorizeSync(auth){assertArgument(typeof auth.address==="string","invalid address for authorizeSync","auth.address",auth);const signature=this.signingKey.sign(hashAuthorization(auth));return Object.assign({},{address:getAddress(auth.address),nonce:getBigInt(auth.nonce||0),chainId:getBigInt(auth.chainId||0)},{signature:signature})}async authorize(auth){auth=Object.assign({},auth,{address:await resolveAddress(auth.address,this)});return this.authorizeSync(await this.populateAuthorization(auth))}async signTypedData(domain,types,value){const populated=await TypedDataEncoder.resolveNames(domain,types,value,async name=>{assert(this.provider!=null,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:name}});const address=await this.provider.resolveName(name);assert(address!=null,"unconfigured ENS name","UNCONFIGURED_NAME",{value:name});return address});return this.signingKey.sign(TypedDataEncoder.hash(populated.domain,types,populated.value)).serialized}}const subsChrs=" !#$%&'()*+,-./<=>?@[]^_`{|}~";const Word=/^[a-z]*$/i;function unfold(words,sep){let initial=97;return words.reduce((accum,word)=>{if(word===sep){initial++}else if(word.match(Word)){accum.push(String.fromCharCode(initial)+word)}else{initial=97;accum.push(word)}return accum},[])}function decode(data,subs){for(let i=subsChrs.length-1;i>=0;i--){data=data.split(subsChrs[i]).join(subs.substring(2*i,2*i+2))}const clumps=[];const leftover=data.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(all,item,semi,word)=>{if(semi){for(let i=parseInt(semi);i>=0;i--){clumps.push(";")}}else{clumps.push(item.toLowerCase())}return""});if(leftover){throw new Error(`leftovers: ${JSON.stringify(leftover)}`)}return unfold(unfold(clumps,";"),":")}function decodeOwl(data){assertArgument(data[0]==="0","unsupported auwl data","data",data);return decode(data.substring(1+2*subsChrs.length),data.substring(1,1+2*subsChrs.length))}class Wordlist{locale;constructor(locale){defineProperties(this,{locale:locale})}split(phrase){return phrase.toLowerCase().split(/\s+/g)}join(words){return words.join(" ")}}class WordlistOwl extends Wordlist{#data;#checksum;constructor(locale,data,checksum){super(locale);this.#data=data;this.#checksum=checksum;this.#words=null}get _data(){return this.#data}_decodeWords(){return decodeOwl(this.#data)}#words;#loadWords(){if(this.#words==null){const words=this._decodeWords();const checksum=id(words.join("\n")+"\n");if(checksum!==this.#checksum){throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`)}this.#words=words}return this.#words}getWord(index){const words=this.#loadWords();assertArgument(index>=0&&index=12&&words.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const entropy=new Uint8Array(Math.ceil(11*words.length/8));let offset=0;for(let i=0;i=0,`invalid mnemonic word at index ${i}`,"mnemonic","[ REDACTED ]");for(let bit=0;bit<11;bit++){if(index&1<<10-bit){entropy[offset>>3]|=1<<7-offset%8}offset++}}const entropyBits=32*words.length/3;const checksumBits=words.length/3;const checksumMask=getUpperMask(checksumBits);const checksum=getBytes(sha256(entropy.slice(0,entropyBits/8)))[0]&checksumMask;assertArgument(checksum===(entropy[entropy.length-1]&checksumMask),"invalid mnemonic checksum","mnemonic","[ REDACTED ]");return hexlify(entropy.slice(0,entropyBits/8))}function entropyToMnemonic(entropy,wordlist){assertArgument(entropy.length%4===0&&entropy.length>=16&&entropy.length<=32,"invalid entropy size","entropy","[ REDACTED ]");if(wordlist==null){wordlist=LangEn.wordlist()}const indices=[0];let remainingBits=11;for(let i=0;i8){indices[indices.length-1]<<=8;indices[indices.length-1]|=entropy[i];remainingBits-=8}else{indices[indices.length-1]<<=remainingBits;indices[indices.length-1]|=entropy[i]>>8-remainingBits;indices.push(entropy[i]&getLowerMask(8-remainingBits));remainingBits+=3}}const checksumBits=entropy.length/4;const checksum=parseInt(sha256(entropy).substring(2,4),16)&getUpperMask(checksumBits);indices[indices.length-1]<<=checksumBits;indices[indices.length-1]|=checksum>>8-checksumBits;return wordlist.join(indices.map(index=>wordlist.getWord(index)))}const _guard$1={};class Mnemonic{phrase;password;wordlist;entropy;constructor(guard,entropy,phrase,password,wordlist){if(password==null){password=""}if(wordlist==null){wordlist=LangEn.wordlist()}assertPrivate(guard,_guard$1,"Mnemonic");defineProperties(this,{phrase:phrase,password:password,wordlist:wordlist,entropy:entropy})}computeSeed(){const salt=toUtf8Bytes("mnemonic"+this.password,"NFKD");return pbkdf2(toUtf8Bytes(this.phrase,"NFKD"),salt,2048,64,"sha512")}static fromPhrase(phrase,password,wordlist){const entropy=mnemonicToEntropy(phrase,wordlist);phrase=entropyToMnemonic(getBytes(entropy),wordlist);return new Mnemonic(_guard$1,entropy,phrase,password,wordlist)}static fromEntropy(_entropy,password,wordlist){const entropy=getBytes(_entropy,"entropy");const phrase=entropyToMnemonic(entropy,wordlist);return new Mnemonic(_guard$1,hexlify(entropy),phrase,password,wordlist)}static entropyToPhrase(_entropy,wordlist){const entropy=getBytes(_entropy,"entropy");return entropyToMnemonic(entropy,wordlist)}static phraseToEntropy(phrase,wordlist){return mnemonicToEntropy(phrase,wordlist)}static isValidMnemonic(phrase,wordlist){try{mnemonicToEntropy(phrase,wordlist);return true}catch(error){}return false}}var __classPrivateFieldGet$2=__$G&&__$G.__classPrivateFieldGet||function(receiver,state,kind,f){if(kind==="a"&&!f)throw new TypeError("Private accessor was defined without a getter");if(typeof state==="function"?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return kind==="m"?f:kind==="a"?f.call(receiver):f?f.value:state.get(receiver)};var __classPrivateFieldSet$2=__$G&&__$G.__classPrivateFieldSet||function(receiver,state,value,kind,f){if(kind==="m")throw new TypeError("Private method is not writable");if(kind==="a"&&!f)throw new TypeError("Private accessor was defined without a setter");if(typeof state==="function"?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return kind==="a"?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value};var _AES_key,_AES_Kd,_AES_Ke;const numberOfRounds={16:10,24:12,32:14};const rcon=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145];const S=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22];const Si=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125];const T1=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986];const T2=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766];const T3=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126];const T4=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436];const T5=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890];const T6=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935];const T7=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600];const T8=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480];const U1=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795];const U2=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855];const U3=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150];const U4=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function convertToInt32(bytes){const result=[];for(let i=0;i>2;__classPrivateFieldGet$2(this,_AES_Ke,"f")[index][i%4]=tk[i];__classPrivateFieldGet$2(this,_AES_Kd,"f")[rounds-index][i%4]=tk[i]}let rconpointer=0;let t=KC,tt;while(t>16&255]<<24^S[tt>>8&255]<<16^S[tt&255]<<8^S[tt>>24&255]^rcon[rconpointer]<<24;rconpointer+=1;if(KC!=8){for(let i=1;i>8&255]<<8^S[tt>>16&255]<<16^S[tt>>24&255]<<24;for(let i=KC/2+1;i>2;c=t%4;__classPrivateFieldGet$2(this,_AES_Ke,"f")[r][c]=tk[i];__classPrivateFieldGet$2(this,_AES_Kd,"f")[rounds-r][c]=tk[i++];t++}}for(let r=1;r>24&255]^U2[tt>>16&255]^U3[tt>>8&255]^U4[tt&255]}}}encrypt(plaintext){if(plaintext.length!=16){throw new TypeError("invalid plaintext size (must be 16 bytes)")}const rounds=__classPrivateFieldGet$2(this,_AES_Ke,"f").length-1;const a=[0,0,0,0];let t=convertToInt32(plaintext);for(let i=0;i<4;i++){t[i]^=__classPrivateFieldGet$2(this,_AES_Ke,"f")[0][i]}for(let r=1;r>24&255]^T2[t[(i+1)%4]>>16&255]^T3[t[(i+2)%4]>>8&255]^T4[t[(i+3)%4]&255]^__classPrivateFieldGet$2(this,_AES_Ke,"f")[r][i]}t=a.slice()}const result=new Uint8Array(16);let tt=0;for(let i=0;i<4;i++){tt=__classPrivateFieldGet$2(this,_AES_Ke,"f")[rounds][i];result[4*i]=(S[t[i]>>24&255]^tt>>24)&255;result[4*i+1]=(S[t[(i+1)%4]>>16&255]^tt>>16)&255;result[4*i+2]=(S[t[(i+2)%4]>>8&255]^tt>>8)&255;result[4*i+3]=(S[t[(i+3)%4]&255]^tt)&255}return result}decrypt(ciphertext){if(ciphertext.length!=16){throw new TypeError("invalid ciphertext size (must be 16 bytes)")}const rounds=__classPrivateFieldGet$2(this,_AES_Kd,"f").length-1;const a=[0,0,0,0];let t=convertToInt32(ciphertext);for(let i=0;i<4;i++){t[i]^=__classPrivateFieldGet$2(this,_AES_Kd,"f")[0][i]}for(let r=1;r>24&255]^T6[t[(i+3)%4]>>16&255]^T7[t[(i+2)%4]>>8&255]^T8[t[(i+1)%4]&255]^__classPrivateFieldGet$2(this,_AES_Kd,"f")[r][i]}t=a.slice()}const result=new Uint8Array(16);let tt=0;for(let i=0;i<4;i++){tt=__classPrivateFieldGet$2(this,_AES_Kd,"f")[rounds][i];result[4*i]=(Si[t[i]>>24&255]^tt>>24)&255;result[4*i+1]=(Si[t[(i+3)%4]>>16&255]^tt>>16)&255;result[4*i+2]=(Si[t[(i+2)%4]>>8&255]^tt>>8)&255;result[4*i+3]=(Si[t[(i+1)%4]&255]^tt)&255}return result}}_AES_key=new WeakMap,_AES_Kd=new WeakMap,_AES_Ke=new WeakMap;class ModeOfOperation{constructor(name,key,cls){if(cls&&!(this instanceof cls)){throw new Error(`${name} must be instantiated with "new"`)}Object.defineProperties(this,{aes:{enumerable:true,value:new AES(key)},name:{enumerable:true,value:name}})}}var __classPrivateFieldSet$1=__$G&&__$G.__classPrivateFieldSet||function(receiver,state,value,kind,f){if(kind==="m")throw new TypeError("Private method is not writable");if(kind==="a"&&!f)throw new TypeError("Private accessor was defined without a setter");if(typeof state==="function"?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return kind==="a"?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value};var __classPrivateFieldGet$1=__$G&&__$G.__classPrivateFieldGet||function(receiver,state,kind,f){if(kind==="a"&&!f)throw new TypeError("Private accessor was defined without a getter");if(typeof state==="function"?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return kind==="m"?f:kind==="a"?f.call(receiver):f?f.value:state.get(receiver)};var _CBC_iv,_CBC_lastBlock;class CBC extends ModeOfOperation{constructor(key,iv){super("ECC",key,CBC);_CBC_iv.set(this,void 0);_CBC_lastBlock.set(this,void 0);if(iv){if(iv.length%16){throw new TypeError("invalid iv size (must be 16 bytes)")}__classPrivateFieldSet$1(this,_CBC_iv,new Uint8Array(iv),"f")}else{__classPrivateFieldSet$1(this,_CBC_iv,new Uint8Array(16),"f")}__classPrivateFieldSet$1(this,_CBC_lastBlock,this.iv,"f")}get iv(){return new Uint8Array(__classPrivateFieldGet$1(this,_CBC_iv,"f"))}encrypt(plaintext){if(plaintext.length%16){throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)")}const ciphertext=new Uint8Array(plaintext.length);for(let i=0;iNumber.MAX_SAFE_INTEGER){throw new TypeError("invalid counter initial integer value")}for(let index=15;index>=0;--index){__classPrivateFieldGet(this,_CTR_counter,"f")[index]=value%256;value=Math.floor(value/256)}}setCounterBytes(value){if(value.length!==16){throw new TypeError("invalid counter initial Uint8Array value length")}__classPrivateFieldGet(this,_CTR_counter,"f").set(value)}increment(){for(let i=15;i>=0;i--){if(__classPrivateFieldGet(this,_CTR_counter,"f")[i]===255){__classPrivateFieldGet(this,_CTR_counter,"f")[i]=0}else{__classPrivateFieldGet(this,_CTR_counter,"f")[i]++;break}}}encrypt(plaintext){var _a,_b;const crypttext=new Uint8Array(plaintext);for(let i=0;i16){throw new TypeError("PKCS#7 padding byte out of range")}const length=data.length-padder;for(let i=0;i0&&(N&N-1)===0,"invalid kdf.N","kdf.N",N);assertArgument(r>0&&p>0,"invalid kdf","kdf",kdf);const dkLen=spelunk(data,"crypto.kdfparams.dklen:int!");assertArgument(dkLen===32,"invalid kdf.dklen","kdf.dflen",dkLen);return{name:"scrypt",salt:salt,N:N,r:r,p:p,dkLen:64}}else if(kdf.toLowerCase()==="pbkdf2"){const salt=spelunk(data,"crypto.kdfparams.salt:data!");const prf=spelunk(data,"crypto.kdfparams.prf:string!");const algorithm=prf.split("-").pop();assertArgument(algorithm==="sha256"||algorithm==="sha512","invalid kdf.pdf","kdf.pdf",prf);const count=spelunk(data,"crypto.kdfparams.c:int!");const dkLen=spelunk(data,"crypto.kdfparams.dklen:int!");assertArgument(dkLen===32,"invalid kdf.dklen","kdf.dklen",dkLen);return{name:"pbkdf2",salt:salt,count:count,dkLen:dkLen,algorithm:algorithm}}}assertArgument(false,"unsupported key-derivation function","kdf",kdf)}function decryptKeystoreJsonSync(json,_password){const data=JSON.parse(json);const password=getPassword(_password);const params=getDecryptKdfParams(data);if(params.name==="pbkdf2"){const{salt,count,dkLen,algorithm}=params;const key=pbkdf2(password,salt,count,dkLen,algorithm);return getAccount(data,key)}assert(params.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:params});const{salt,N,r,p,dkLen}=params;const key=scryptSync(password,salt,N,r,p,dkLen);return getAccount(data,key)}function stall$1(duration){return new Promise(resolve=>{setTimeout(()=>{resolve()},duration)})}async function decryptKeystoreJson(json,_password,progress){const data=JSON.parse(json);const password=getPassword(_password);const params=getDecryptKdfParams(data);if(params.name==="pbkdf2"){if(progress){progress(0);await stall$1(0)}const{salt,count,dkLen,algorithm}=params;const key=pbkdf2(password,salt,count,dkLen,algorithm);if(progress){progress(1);await stall$1(0)}return getAccount(data,key)}assert(params.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:params});const{salt,N,r,p,dkLen}=params;const key=await scrypt(password,salt,N,r,p,dkLen,progress);return getAccount(data,key)}function getEncryptKdfParams(options){const salt=options.salt!=null?getBytes(options.salt,"options.salt"):randomBytes(32);let N=1<<17,r=8,p=1;if(options.scrypt){if(options.scrypt.N){N=options.scrypt.N}if(options.scrypt.r){r=options.scrypt.r}if(options.scrypt.p){p=options.scrypt.p}}assertArgument(typeof N==="number"&&N>0&&Number.isSafeInteger(N)&&(BigInt(N)&BigInt(N-1))===BigInt(0),"invalid scrypt N parameter","options.N",N);assertArgument(typeof r==="number"&&r>0&&Number.isSafeInteger(r),"invalid scrypt r parameter","options.r",r);assertArgument(typeof p==="number"&&p>0&&Number.isSafeInteger(p),"invalid scrypt p parameter","options.p",p);return{name:"scrypt",dkLen:32,salt:salt,N:N,r:r,p:p}}function _encryptKeystore(key,kdf,account,options){const privateKey=getBytes(account.privateKey,"privateKey");const iv=options.iv!=null?getBytes(options.iv,"options.iv"):randomBytes(16);assertArgument(iv.length===16,"invalid options.iv length","options.iv",options.iv);const uuidRandom=options.uuid!=null?getBytes(options.uuid,"options.uuid"):randomBytes(16);assertArgument(uuidRandom.length===16,"invalid options.uuid length","options.uuid",options.iv);const derivedKey=key.slice(0,16);const macPrefix=key.slice(16,32);const aesCtr=new CTR(derivedKey,iv);const ciphertext=getBytes(aesCtr.encrypt(privateKey));const mac=keccak256(concat([macPrefix,ciphertext]));const data={address:account.address.substring(2).toLowerCase(),id:uuidV4(uuidRandom),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:hexlify(iv).substring(2)},ciphertext:hexlify(ciphertext).substring(2),kdf:"scrypt",kdfparams:{salt:hexlify(kdf.salt).substring(2),n:kdf.N,dklen:32,p:kdf.p,r:kdf.r},mac:mac.substring(2)}};if(account.mnemonic){const client=options.client!=null?options.client:`ethers/${version}`;const path=account.mnemonic.path||defaultPath$1;const locale=account.mnemonic.locale||"en";const mnemonicKey=key.slice(32,64);const entropy=getBytes(account.mnemonic.entropy,"account.mnemonic.entropy");const mnemonicIv=randomBytes(16);const mnemonicAesCtr=new CTR(mnemonicKey,mnemonicIv);const mnemonicCiphertext=getBytes(mnemonicAesCtr.encrypt(entropy));const now=new Date;const timestamp=now.getUTCFullYear()+"-"+zpad$1(now.getUTCMonth()+1,2)+"-"+zpad$1(now.getUTCDate(),2)+"T"+zpad$1(now.getUTCHours(),2)+"-"+zpad$1(now.getUTCMinutes(),2)+"-"+zpad$1(now.getUTCSeconds(),2)+".0Z";const gethFilename="UTC--"+timestamp+"--"+data.address;data["x-ethers"]={client:client,gethFilename:gethFilename,path:path,locale:locale,mnemonicCounter:hexlify(mnemonicIv).substring(2),mnemonicCiphertext:hexlify(mnemonicCiphertext).substring(2),version:"0.1"}}return JSON.stringify(data)}function encryptKeystoreJsonSync(account,password,options){if(options==null){options={}}const passwordBytes=getPassword(password);const kdf=getEncryptKdfParams(options);const key=scryptSync(passwordBytes,kdf.salt,kdf.N,kdf.r,kdf.p,64);return _encryptKeystore(getBytes(key),kdf,account,options)}async function encryptKeystoreJson(account,password,options){if(options==null){options={}}const passwordBytes=getPassword(password);const kdf=getEncryptKdfParams(options);const key=await scrypt(passwordBytes,kdf.salt,kdf.N,kdf.r,kdf.p,64,options.progressCallback);return _encryptKeystore(getBytes(key),kdf,account,options)}const defaultPath="m/44'/60'/0'/0/0";const MasterSecret=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]);const HardenedBit=2147483648;const N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");const Nibbles="0123456789abcdef";function zpad(value,length){let result="";while(value){result=Nibbles[value%16]+result;value=Math.trunc(value/16)}while(result.length=0;i-=8){data[33+(i>>3)]=index>>24-i&255}const I=getBytes(computeHmac("sha512",chainCode,data));return{IL:I.slice(0,32),IR:I.slice(32)}}function derivePath(node,path){const components=path.split("/");assertArgument(components.length>0,"invalid path","path",path);if(components[0]==="m"){assertArgument(node.depth===0,`cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${node.depth}`,"path",path);components.shift()}let result=node;for(let i=0;i=16&&seed.length<=64,"invalid seed","seed","[REDACTED]");const I=getBytes(computeHmac("sha512",MasterSecret,seed));const signingKey=new SigningKey(hexlify(I.slice(0,32)));return new HDNodeWallet(_guard,signingKey,"0x00000000",hexlify(I.slice(32)),"m",0,0,mnemonic,null)}static fromExtendedKey(extendedKey){const bytes=toBeArray(decodeBase58(extendedKey));assertArgument(bytes.length===82||encodeBase58Check(bytes.slice(0,78))===extendedKey,"invalid extended key","extendedKey","[ REDACTED ]");const depth=bytes[4];const parentFingerprint=hexlify(bytes.slice(5,9));const index=parseInt(hexlify(bytes.slice(9,13)).substring(2),16);const chainCode=hexlify(bytes.slice(13,45));const key=bytes.slice(45,78);switch(hexlify(bytes.slice(0,4))){case"0x0488b21e":case"0x043587cf":{const publicKey=hexlify(key);return new HDNodeVoidWallet(_guard,computeAddress(publicKey),publicKey,parentFingerprint,chainCode,null,index,depth,null)}case"0x0488ade4":case"0x04358394 ":if(key[0]!==0){break}return new HDNodeWallet(_guard,new SigningKey(key.slice(1)),parentFingerprint,chainCode,null,index,depth,null,null)}assertArgument(false,"invalid extended key prefix","extendedKey","[ REDACTED ]")}static createRandom(password,path,wordlist){if(password==null){password=""}if(path==null){path=defaultPath}if(wordlist==null){wordlist=LangEn.wordlist()}const mnemonic=Mnemonic.fromEntropy(randomBytes(16),password,wordlist);return HDNodeWallet.#fromSeed(mnemonic.computeSeed(),mnemonic).derivePath(path)}static fromMnemonic(mnemonic,path){if(!path){path=defaultPath}return HDNodeWallet.#fromSeed(mnemonic.computeSeed(),mnemonic).derivePath(path)}static fromPhrase(phrase,password,path,wordlist){if(password==null){password=""}if(path==null){path=defaultPath}if(wordlist==null){wordlist=LangEn.wordlist()}const mnemonic=Mnemonic.fromPhrase(phrase,password,wordlist);return HDNodeWallet.#fromSeed(mnemonic.computeSeed(),mnemonic).derivePath(path)}static fromSeed(seed){return HDNodeWallet.#fromSeed(seed,null)}}class HDNodeVoidWallet extends VoidSigner{publicKey;fingerprint;parentFingerprint;chainCode;path;index;depth;constructor(guard,address,publicKey,parentFingerprint,chainCode,path,index,depth,provider){super(address,provider);assertPrivate(guard,_guard,"HDNodeVoidWallet");defineProperties(this,{publicKey:publicKey});const fingerprint=dataSlice(ripemd160(sha256(publicKey)),0,4);defineProperties(this,{publicKey:publicKey,fingerprint:fingerprint,parentFingerprint:parentFingerprint,chainCode:chainCode,path:path,index:index,depth:depth})}connect(provider){return new HDNodeVoidWallet(_guard,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,provider)}get extendedKey(){assert(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"});return encodeBase58Check(concat(["0x0488B21E",zpad(this.depth,1),this.parentFingerprint,zpad(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return this.path!=null}deriveChild(_index){const index=getNumber(_index,"index");assertArgument(index<=4294967295,"invalid index","index",index);let path=this.path;if(path){path+="/"+(index&~HardenedBit);if(index&HardenedBit){path+="'"}}const{IR,IL}=ser_I(index,this.chainCode,this.publicKey,null);const Ki=SigningKey.addPoints(IL,this.publicKey,true);const address=computeAddress(Ki);return new HDNodeVoidWallet(_guard,address,Ki,this.fingerprint,hexlify(IR),path,index,this.depth+1,this.provider)}derivePath(path){return derivePath(this,path)}}function getAccountPath(_index){const index=getNumber(_index,"index");assertArgument(index>=0&&index=0&&index{setTimeout(()=>{resolve()},duration)})}class Wallet extends BaseWallet{constructor(key,provider){if(typeof key==="string"&&!key.startsWith("0x")){key="0x"+key}let signingKey=typeof key==="string"?new SigningKey(key):key;super(signingKey,provider)}connect(provider){return new Wallet(this.signingKey,provider)}async encrypt(password,progressCallback){const account={address:this.address,privateKey:this.privateKey};return await encryptKeystoreJson(account,password,{progressCallback:progressCallback})}encryptSync(password){const account={address:this.address,privateKey:this.privateKey};return encryptKeystoreJsonSync(account,password)}static#fromAccount(account){assertArgument(account,"invalid JSON wallet","json","[ REDACTED ]");if("mnemonic"in account&&account.mnemonic&&account.mnemonic.locale==="en"){const mnemonic=Mnemonic.fromEntropy(account.mnemonic.entropy);const wallet=HDNodeWallet.fromMnemonic(mnemonic,account.mnemonic.path);if(wallet.address===account.address&&wallet.privateKey===account.privateKey){return wallet}console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}const wallet=new Wallet(account.privateKey);assertArgument(wallet.address===account.address,"address/privateKey mismatch","json","[ REDACTED ]");return wallet}static async fromEncryptedJson(json,password,progress){let account=null;if(isKeystoreJson(json)){account=await decryptKeystoreJson(json,password,progress)}else if(isCrowdsaleJson(json)){if(progress){progress(0);await stall(0)}account=decryptCrowdsaleJson(json,password);if(progress){progress(1);await stall(0)}}return Wallet.#fromAccount(account)}static fromEncryptedJsonSync(json,password){let account=null;if(isKeystoreJson(json)){account=decryptKeystoreJsonSync(json,password)}else if(isCrowdsaleJson(json)){account=decryptCrowdsaleJson(json,password)}else{assertArgument(false,"invalid JSON wallet","json","[ REDACTED ]")}return Wallet.#fromAccount(account)}static createRandom(provider){const wallet=HDNodeWallet.createRandom();if(provider){return wallet.connect(provider)}return wallet}static fromPhrase(phrase,provider){const wallet=HDNodeWallet.fromPhrase(phrase);if(provider){return wallet.connect(provider)}return wallet}}const Base64=")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_";function decodeBits(width,data){const maxValue=(1<=width){const value=accum>>bits-width;accum&=(1<{const match=accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);assertArgument(match!==null,"internal error parsing accents","accents",accents);let posOffset=0;const positions=decodeBits(parseInt(match[3]),match[4]);const charCode=parseInt(match[2]);const regex=new RegExp(`([${match[1]}])`,"g");words=words.replace(regex,(all,letter)=>{const rem=--positions[posOffset];if(rem===0){letter=String.fromCharCode(letter.charCodeAt(0),charCode);posOffset++}return letter})});return words.split(",")}class WordlistOwlA extends WordlistOwl{#accent;constructor(locale,data,accent,checksum){super(locale,data,checksum);this.#accent=accent}get _accent(){return this.#accent}_decodeWords(){return decodeOwlA(this._data,this._accent)}}const wordlists={en:LangEn.wordlist()};var ethers=Object.freeze({__proto__:null,AbiCoder:AbiCoder,AbstractProvider:AbstractProvider,AbstractSigner:AbstractSigner,AlchemyProvider:AlchemyProvider,AnkrProvider:AnkrProvider,BaseContract:BaseContract,BaseWallet:BaseWallet,Block:Block,BlockscoutProvider:BlockscoutProvider,BrowserProvider:BrowserProvider,ChainstackProvider:ChainstackProvider,CloudflareProvider:CloudflareProvider,ConstructorFragment:ConstructorFragment,Contract:Contract,ContractEventPayload:ContractEventPayload,ContractFactory:ContractFactory,ContractTransactionReceipt:ContractTransactionReceipt,ContractTransactionResponse:ContractTransactionResponse,ContractUnknownEventPayload:ContractUnknownEventPayload,EnsPlugin:EnsPlugin,EnsResolver:EnsResolver,ErrorDescription:ErrorDescription,ErrorFragment:ErrorFragment,EtherSymbol:EtherSymbol,EtherscanPlugin:EtherscanPlugin,EtherscanProvider:EtherscanProvider,EventFragment:EventFragment,EventLog:EventLog,EventPayload:EventPayload,FallbackFragment:FallbackFragment,FallbackProvider:FallbackProvider,FeeData:FeeData,FeeDataNetworkPlugin:FeeDataNetworkPlugin,FetchCancelSignal:FetchCancelSignal,FetchRequest:FetchRequest,FetchResponse:FetchResponse,FetchUrlFeeDataNetworkPlugin:FetchUrlFeeDataNetworkPlugin,FixedNumber:FixedNumber,Fragment:Fragment,FunctionFragment:FunctionFragment,GasCostPlugin:GasCostPlugin,HDNodeVoidWallet:HDNodeVoidWallet,HDNodeWallet:HDNodeWallet,Indexed:Indexed,InfuraProvider:InfuraProvider,InfuraWebSocketProvider:InfuraWebSocketProvider,Interface:Interface,IpcSocketProvider:IpcSocketProvider,JsonRpcApiProvider:JsonRpcApiProvider,JsonRpcProvider:JsonRpcProvider,JsonRpcSigner:JsonRpcSigner,LangEn:LangEn,Log:Log,LogDescription:LogDescription,MaxInt256:MaxInt256,MaxUint256:MaxUint256,MessagePrefix:MessagePrefix,MinInt256:MinInt256,Mnemonic:Mnemonic,MulticoinProviderPlugin:MulticoinProviderPlugin,N:N$1,NamedFragment:NamedFragment,Network:Network,NetworkPlugin:NetworkPlugin,NonceManager:NonceManager,ParamType:ParamType,PocketProvider:PocketProvider,QuickNodeProvider:QuickNodeProvider,Result:Result,Signature:Signature,SigningKey:SigningKey,SocketBlockSubscriber:SocketBlockSubscriber,SocketEventSubscriber:SocketEventSubscriber,SocketPendingSubscriber:SocketPendingSubscriber,SocketProvider:SocketProvider,SocketSubscriber:SocketSubscriber,StructFragment:StructFragment,Transaction:Transaction,TransactionDescription:TransactionDescription,TransactionReceipt:TransactionReceipt,TransactionResponse:TransactionResponse,Typed:Typed,TypedDataEncoder:TypedDataEncoder,UndecodedEventLog:UndecodedEventLog,UnmanagedSubscriber:UnmanagedSubscriber,Utf8ErrorFuncs:Utf8ErrorFuncs,VoidSigner:VoidSigner,Wallet:Wallet,WebSocketProvider:WebSocketProvider,WeiPerEther:WeiPerEther,Wordlist:Wordlist,WordlistOwl:WordlistOwl,WordlistOwlA:WordlistOwlA,ZeroAddress:ZeroAddress,ZeroHash:ZeroHash,accessListify:accessListify,assert:assert,assertArgument:assertArgument,assertArgumentCount:assertArgumentCount,assertNormalize:assertNormalize,assertPrivate:assertPrivate,authorizationify:authorizationify,checkResultErrors:checkResultErrors,computeAddress:computeAddress,computeHmac:computeHmac,concat:concat,copyRequest:copyRequest,dataLength:dataLength,dataSlice:dataSlice,decodeBase58:decodeBase58,decodeBase64:decodeBase64,decodeBytes32String:decodeBytes32String,decodeRlp:decodeRlp,decryptCrowdsaleJson:decryptCrowdsaleJson,decryptKeystoreJson:decryptKeystoreJson,decryptKeystoreJsonSync:decryptKeystoreJsonSync,defaultPath:defaultPath,defineProperties:defineProperties,dnsEncode:dnsEncode,encodeBase58:encodeBase58,encodeBase64:encodeBase64,encodeBytes32String:encodeBytes32String,encodeRlp:encodeRlp,encryptKeystoreJson:encryptKeystoreJson,encryptKeystoreJsonSync:encryptKeystoreJsonSync,ensNormalize:ensNormalize,formatEther:formatEther,formatUnits:formatUnits,fromTwos:fromTwos,getAccountPath:getAccountPath,getAddress:getAddress,getBigInt:getBigInt,getBytes:getBytes,getBytesCopy:getBytesCopy,getCreate2Address:getCreate2Address,getCreateAddress:getCreateAddress,getDefaultProvider:getDefaultProvider,getIcapAddress:getIcapAddress,getIndexedAccountPath:getIndexedAccountPath,getNumber:getNumber,getUint:getUint,hashAuthorization:hashAuthorization,hashMessage:hashMessage,hexlify:hexlify,id:id,isAddress:isAddress,isAddressable:isAddressable,isBytesLike:isBytesLike,isCallException:isCallException,isCrowdsaleJson:isCrowdsaleJson,isError:isError,isHexString:isHexString,isKeystoreJson:isKeystoreJson,isValidName:isValidName,keccak256:keccak256,lock:lock,makeError:makeError,mask:mask,namehash:namehash,parseEther:parseEther,parseUnits:parseUnits$1,pbkdf2:pbkdf2,randomBytes:randomBytes,recoverAddress:recoverAddress,resolveAddress:resolveAddress,resolveProperties:resolveProperties,ripemd160:ripemd160,scrypt:scrypt,scryptSync:scryptSync,sha256:sha256,sha512:sha512,showThrottleMessage:showThrottleMessage,solidityPacked:solidityPacked,solidityPackedKeccak256:solidityPackedKeccak256,solidityPackedSha256:solidityPackedSha256,stripZerosLeft:stripZerosLeft,toBeArray:toBeArray,toBeHex:toBeHex,toBigInt:toBigInt,toNumber:toNumber,toQuantity:toQuantity,toTwos:toTwos,toUtf8Bytes:toUtf8Bytes,toUtf8CodePoints:toUtf8CodePoints,toUtf8String:toUtf8String,uuidV4:uuidV4,verifyAuthorization:verifyAuthorization,verifyMessage:verifyMessage,verifyTypedData:verifyTypedData,version:version,wordlists:wordlists,zeroPadBytes:zeroPadBytes,zeroPadValue:zeroPadValue});exports.AbiCoder=AbiCoder;exports.AbstractProvider=AbstractProvider;exports.AbstractSigner=AbstractSigner;exports.AlchemyProvider=AlchemyProvider;exports.AnkrProvider=AnkrProvider;exports.BaseContract=BaseContract;exports.BaseWallet=BaseWallet;exports.Block=Block;exports.BlockscoutProvider=BlockscoutProvider;exports.BrowserProvider=BrowserProvider;exports.ChainstackProvider=ChainstackProvider;exports.CloudflareProvider=CloudflareProvider;exports.ConstructorFragment=ConstructorFragment;exports.Contract=Contract;exports.ContractEventPayload=ContractEventPayload;exports.ContractFactory=ContractFactory;exports.ContractTransactionReceipt=ContractTransactionReceipt;exports.ContractTransactionResponse=ContractTransactionResponse;exports.ContractUnknownEventPayload=ContractUnknownEventPayload;exports.EnsPlugin=EnsPlugin;exports.EnsResolver=EnsResolver;exports.ErrorDescription=ErrorDescription;exports.ErrorFragment=ErrorFragment;exports.EtherSymbol=EtherSymbol;exports.EtherscanPlugin=EtherscanPlugin;exports.EtherscanProvider=EtherscanProvider;exports.EventFragment=EventFragment;exports.EventLog=EventLog;exports.EventPayload=EventPayload;exports.FallbackFragment=FallbackFragment;exports.FallbackProvider=FallbackProvider;exports.FeeData=FeeData;exports.FeeDataNetworkPlugin=FeeDataNetworkPlugin;exports.FetchCancelSignal=FetchCancelSignal;exports.FetchRequest=FetchRequest;exports.FetchResponse=FetchResponse;exports.FetchUrlFeeDataNetworkPlugin=FetchUrlFeeDataNetworkPlugin;exports.FixedNumber=FixedNumber;exports.Fragment=Fragment;exports.FunctionFragment=FunctionFragment;exports.GasCostPlugin=GasCostPlugin;exports.HDNodeVoidWallet=HDNodeVoidWallet;exports.HDNodeWallet=HDNodeWallet;exports.Indexed=Indexed;exports.InfuraProvider=InfuraProvider;exports.InfuraWebSocketProvider=InfuraWebSocketProvider;exports.Interface=Interface;exports.IpcSocketProvider=IpcSocketProvider;exports.JsonRpcApiProvider=JsonRpcApiProvider;exports.JsonRpcProvider=JsonRpcProvider;exports.JsonRpcSigner=JsonRpcSigner;exports.LangEn=LangEn;exports.Log=Log;exports.LogDescription=LogDescription;exports.MaxInt256=MaxInt256;exports.MaxUint256=MaxUint256;exports.MessagePrefix=MessagePrefix;exports.MinInt256=MinInt256;exports.Mnemonic=Mnemonic;exports.MulticoinProviderPlugin=MulticoinProviderPlugin;exports.N=N$1;exports.NamedFragment=NamedFragment;exports.Network=Network;exports.NetworkPlugin=NetworkPlugin;exports.NonceManager=NonceManager;exports.ParamType=ParamType;exports.PocketProvider=PocketProvider;exports.QuickNodeProvider=QuickNodeProvider;exports.Result=Result;exports.Signature=Signature;exports.SigningKey=SigningKey;exports.SocketBlockSubscriber=SocketBlockSubscriber;exports.SocketEventSubscriber=SocketEventSubscriber;exports.SocketPendingSubscriber=SocketPendingSubscriber;exports.SocketProvider=SocketProvider;exports.SocketSubscriber=SocketSubscriber;exports.StructFragment=StructFragment;exports.Transaction=Transaction;exports.TransactionDescription=TransactionDescription;exports.TransactionReceipt=TransactionReceipt;exports.TransactionResponse=TransactionResponse;exports.Typed=Typed;exports.TypedDataEncoder=TypedDataEncoder;exports.UndecodedEventLog=UndecodedEventLog;exports.UnmanagedSubscriber=UnmanagedSubscriber;exports.Utf8ErrorFuncs=Utf8ErrorFuncs;exports.VoidSigner=VoidSigner;exports.Wallet=Wallet;exports.WebSocketProvider=WebSocketProvider;exports.WeiPerEther=WeiPerEther;exports.Wordlist=Wordlist;exports.WordlistOwl=WordlistOwl;exports.WordlistOwlA=WordlistOwlA;exports.ZeroAddress=ZeroAddress;exports.ZeroHash=ZeroHash;exports.accessListify=accessListify;exports.assert=assert;exports.assertArgument=assertArgument;exports.assertArgumentCount=assertArgumentCount;exports.assertNormalize=assertNormalize;exports.assertPrivate=assertPrivate;exports.authorizationify=authorizationify;exports.checkResultErrors=checkResultErrors;exports.computeAddress=computeAddress;exports.computeHmac=computeHmac;exports.concat=concat;exports.copyRequest=copyRequest;exports.dataLength=dataLength;exports.dataSlice=dataSlice;exports.decodeBase58=decodeBase58;exports.decodeBase64=decodeBase64;exports.decodeBytes32String=decodeBytes32String;exports.decodeRlp=decodeRlp;exports.decryptCrowdsaleJson=decryptCrowdsaleJson;exports.decryptKeystoreJson=decryptKeystoreJson;exports.decryptKeystoreJsonSync=decryptKeystoreJsonSync;exports.defaultPath=defaultPath;exports.defineProperties=defineProperties;exports.dnsEncode=dnsEncode;exports.encodeBase58=encodeBase58;exports.encodeBase64=encodeBase64;exports.encodeBytes32String=encodeBytes32String;exports.encodeRlp=encodeRlp;exports.encryptKeystoreJson=encryptKeystoreJson;exports.encryptKeystoreJsonSync=encryptKeystoreJsonSync;exports.ensNormalize=ensNormalize;exports.ethers=ethers;exports.formatEther=formatEther;exports.formatUnits=formatUnits;exports.fromTwos=fromTwos;exports.getAccountPath=getAccountPath;exports.getAddress=getAddress;exports.getBigInt=getBigInt;exports.getBytes=getBytes;exports.getBytesCopy=getBytesCopy;exports.getCreate2Address=getCreate2Address;exports.getCreateAddress=getCreateAddress;exports.getDefaultProvider=getDefaultProvider;exports.getIcapAddress=getIcapAddress;exports.getIndexedAccountPath=getIndexedAccountPath;exports.getNumber=getNumber;exports.getUint=getUint;exports.hashAuthorization=hashAuthorization;exports.hashMessage=hashMessage;exports.hexlify=hexlify;exports.id=id;exports.isAddress=isAddress;exports.isAddressable=isAddressable;exports.isBytesLike=isBytesLike;exports.isCallException=isCallException;exports.isCrowdsaleJson=isCrowdsaleJson;exports.isError=isError;exports.isHexString=isHexString;exports.isKeystoreJson=isKeystoreJson;exports.isValidName=isValidName;exports.keccak256=keccak256;exports.lock=lock;exports.makeError=makeError;exports.mask=mask;exports.namehash=namehash;exports.parseEther=parseEther;exports.parseUnits=parseUnits$1;exports.pbkdf2=pbkdf2;exports.randomBytes=randomBytes;exports.recoverAddress=recoverAddress;exports.resolveAddress=resolveAddress;exports.resolveProperties=resolveProperties;exports.ripemd160=ripemd160;exports.scrypt=scrypt;exports.scryptSync=scryptSync;exports.sha256=sha256;exports.sha512=sha512;exports.showThrottleMessage=showThrottleMessage;exports.solidityPacked=solidityPacked;exports.solidityPackedKeccak256=solidityPackedKeccak256;exports.solidityPackedSha256=solidityPackedSha256;exports.stripZerosLeft=stripZerosLeft;exports.toBeArray=toBeArray;exports.toBeHex=toBeHex;exports.toBigInt=toBigInt;exports.toNumber=toNumber;exports.toQuantity=toQuantity;exports.toTwos=toTwos;exports.toUtf8Bytes=toUtf8Bytes;exports.toUtf8CodePoints=toUtf8CodePoints;exports.toUtf8String=toUtf8String;exports.uuidV4=uuidV4;exports.verifyAuthorization=verifyAuthorization;exports.verifyMessage=verifyMessage;exports.verifyTypedData=verifyTypedData;exports.version=version;exports.wordlists=wordlists;exports.zeroPadBytes=zeroPadBytes;exports.zeroPadValue=zeroPadValue}); \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/dist/wordlists-extra.js b/tools/mnemonic-test/node_modules/ethers/dist/wordlists-extra.js deleted file mode 100644 index 724c366a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/dist/wordlists-extra.js +++ /dev/null @@ -1,1509 +0,0 @@ -function number(n) { - if (!Number.isSafeInteger(n) || n < 0) - throw new Error(`Wrong positive integer: ${n}`); -} -function bytes(b, ...lengths) { - if (!(b instanceof Uint8Array)) - throw new Error('Expected Uint8Array'); - if (lengths.length > 0 && !lengths.includes(b.length)) - throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`); -} -function exists(instance, checkFinished = true) { - if (instance.destroyed) - throw new Error('Hash instance has been destroyed'); - if (checkFinished && instance.finished) - throw new Error('Hash#digest() has already been called'); -} -function output(out, instance) { - bytes(out); - const min = instance.outputLen; - if (out.length < min) { - throw new Error(`digestInto() expects output buffer of length at least ${min}`); - } -} - -/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+. -// node.js versions earlier than v19 don't declare it in global scope. -// For node.js, package.json#exports field mapping rewrites import -// from `crypto` to `cryptoNode`, which imports native module. -// Makes the utils un-importable in browsers without a bundler. -// Once node.js 18 is deprecated, we can just drop the import. -const u8a = (a) => a instanceof Uint8Array; -const u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); -// big-endian hardware is rare. Just in case someone still decides to run hashes: -// early-throw an error because we don't support BE yet. -const isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44; -if (!isLE) - throw new Error('Non little-endian hardware is not supported'); -/** - * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99]) - */ -function utf8ToBytes(str) { - if (typeof str !== 'string') - throw new Error(`utf8ToBytes expected string, got ${typeof str}`); - return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809 -} -/** - * Normalizes (non-hex) string or Uint8Array to Uint8Array. - * Warning: when Uint8Array is passed, it would NOT get copied. - * Keep in mind for future mutable operations. - */ -function toBytes(data) { - if (typeof data === 'string') - data = utf8ToBytes(data); - if (!u8a(data)) - throw new Error(`expected Uint8Array, got ${typeof data}`); - return data; -} -// For runtime check if class implements interface -class Hash { - // Safe version that clones internal state - clone() { - return this._cloneInto(); - } -} -function wrapConstructor(hashCons) { - const hashC = (msg) => hashCons().update(toBytes(msg)).digest(); - const tmp = hashCons(); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = () => hashCons(); - return hashC; -} - -const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1); -const _32n = /* @__PURE__ */ BigInt(32); -// We are not using BigUint64Array, because they are extremely slow as per 2022 -function fromBig(n, le = false) { - if (le) - return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) }; - return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 }; -} -function split(lst, le = false) { - let Ah = new Uint32Array(lst.length); - let Al = new Uint32Array(lst.length); - for (let i = 0; i < lst.length; i++) { - const { h, l } = fromBig(lst[i], le); - [Ah[i], Al[i]] = [h, l]; - } - return [Ah, Al]; -} -// Left rotate for Shift in [1, 32) -const rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s)); -const rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s)); -// Left rotate for Shift in (32, 64), NOTE: 32 is special case. -const rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s)); -const rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s)); - -/* Do NOT modify this file; see /src.ts/_admin/update-version.ts */ -/** - * The current version of Ethers. - */ -const version = "6.16.0"; - -/** - * Property helper functions. - * - * @_subsection api/utils:Properties [about-properties] - */ -/** - * Assigns the %%values%% to %%target%% as read-only values. - * - * It %%types%% is specified, the values are checked. - */ -function defineProperties(target, values, types) { - for (let key in values) { - let value = values[key]; - Object.defineProperty(target, key, { enumerable: true, value, writable: false }); - } -} - -/** - * All errors in ethers include properties to ensure they are both - * human-readable (i.e. ``.message``) and machine-readable (i.e. ``.code``). - * - * The [[isError]] function can be used to check the error ``code`` and - * provide a type guard for the properties present on that error interface. - * - * @_section: api/utils/errors:Errors [about-errors] - */ -function stringify(value, seen) { - if (value == null) { - return "null"; - } - if (seen == null) { - seen = new Set(); - } - if (typeof (value) === "object") { - if (seen.has(value)) { - return "[Circular]"; - } - seen.add(value); - } - if (Array.isArray(value)) { - return "[ " + (value.map((v) => stringify(v, seen))).join(", ") + " ]"; - } - if (value instanceof Uint8Array) { - const HEX = "0123456789abcdef"; - let result = "0x"; - for (let i = 0; i < value.length; i++) { - result += HEX[value[i] >> 4]; - result += HEX[value[i] & 0xf]; - } - return result; - } - if (typeof (value) === "object" && typeof (value.toJSON) === "function") { - return stringify(value.toJSON(), seen); - } - switch (typeof (value)) { - case "boolean": - case "number": - case "symbol": - return value.toString(); - case "bigint": - return BigInt(value).toString(); - case "string": - return JSON.stringify(value); - case "object": { - const keys = Object.keys(value); - keys.sort(); - return "{ " + keys.map((k) => `${stringify(k, seen)}: ${stringify(value[k], seen)}`).join(", ") + " }"; - } - } - return `[ COULD NOT SERIALIZE ]`; -} -/** - * Returns a new Error configured to the format ethers emits errors, with - * the %%message%%, [[api:ErrorCode]] %%code%% and additional properties - * for the corresponding EthersError. - * - * Each error in ethers includes the version of ethers, a - * machine-readable [[ErrorCode]], and depending on %%code%%, additional - * required properties. The error message will also include the %%message%%, - * ethers version, %%code%% and all additional properties, serialized. - */ -function makeError(message, code, info) { - let shortMessage = message; - { - const details = []; - if (info) { - if ("message" in info || "code" in info || "name" in info) { - throw new Error(`value will overwrite populated values: ${stringify(info)}`); - } - for (const key in info) { - if (key === "shortMessage") { - continue; - } - const value = (info[key]); - // try { - details.push(key + "=" + stringify(value)); - // } catch (error: any) { - // console.log("MMM", error.message); - // details.push(key + "=[could not serialize object]"); - // } - } - } - details.push(`code=${code}`); - details.push(`version=${version}`); - if (details.length) { - message += " (" + details.join(", ") + ")"; - } - } - let error; - switch (code) { - case "INVALID_ARGUMENT": - error = new TypeError(message); - break; - case "NUMERIC_FAULT": - case "BUFFER_OVERRUN": - error = new RangeError(message); - break; - default: - error = new Error(message); - } - defineProperties(error, { code }); - if (info) { - Object.assign(error, info); - } - if (error.shortMessage == null) { - defineProperties(error, { shortMessage }); - } - return error; -} -/** - * Throws an EthersError with %%message%%, %%code%% and additional error - * %%info%% when %%check%% is falsish.. - * - * @see [[api:makeError]] - */ -function assert(check, message, code, info) { - if (!check) { - throw makeError(message, code, info); - } -} -/** - * A simple helper to simply ensuring provided arguments match expected - * constraints, throwing if not. - * - * In TypeScript environments, the %%check%% has been asserted true, so - * any further code does not need additional compile-time checks. - */ -function assertArgument(check, message, name, value) { - assert(check, message, "INVALID_ARGUMENT", { argument: name, value: value }); -} -["NFD", "NFC", "NFKD", "NFKC"].reduce((accum, form) => { - try { - // General test for normalize - /* c8 ignore start */ - if ("test".normalize(form) !== "test") { - throw new Error("bad"); - } - ; - /* c8 ignore stop */ - if (form === "NFD") { - const check = String.fromCharCode(0xe9).normalize("NFD"); - const expected = String.fromCharCode(0x65, 0x0301); - /* c8 ignore start */ - if (check !== expected) { - throw new Error("broken"); - } - /* c8 ignore stop */ - } - accum.push(form); - } - catch (error) { } - return accum; -}, []); - -/** - * Some data helpers. - * - * - * @_subsection api/utils:Data Helpers [about-data] - */ -function _getBytes(value, name, copy) { - if (value instanceof Uint8Array) { - return value; - } - if (typeof (value) === "string" && (value.length % 2) === 0 && - value.match(/^0x[0-9a-f]*$/i)) { - const result = new Uint8Array((value.length - 2) / 2); - let offset = 2; - for (let i = 0; i < result.length; i++) { - result[i] = parseInt(value.substring(offset, offset + 2), 16); - offset += 2; - } - return result; - } - assertArgument(false, "invalid BytesLike value", name || "value", value); -} -/** - * Get a typed Uint8Array for %%value%%. If already a Uint8Array - * the original %%value%% is returned; if a copy is required use - * [[getBytesCopy]]. - * - * @see: getBytesCopy - */ -function getBytes(value, name) { - return _getBytes(value, name); -} -const HexCharacters = "0123456789abcdef"; -/** - * Returns a [[DataHexString]] representation of %%data%%. - */ -function hexlify(data) { - const bytes = getBytes(data); - let result = "0x"; - for (let i = 0; i < bytes.length; i++) { - const v = bytes[i]; - result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f]; - } - return result; -} - -/** - * Using strings in Ethereum (or any security-basd system) requires - * additional care. These utilities attempt to mitigate some of the - * safety issues as well as provide the ability to recover and analyse - * strings. - * - * @_subsection api/utils:Strings and UTF-8 [about-strings] - */ -function errorFunc(reason, offset, bytes, output, badCodepoint) { - assertArgument(false, `invalid codepoint at offset ${offset}; ${reason}`, "bytes", bytes); -} -function ignoreFunc(reason, offset, bytes, output, badCodepoint) { - // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes - if (reason === "BAD_PREFIX" || reason === "UNEXPECTED_CONTINUE") { - let i = 0; - for (let o = offset + 1; o < bytes.length; o++) { - if (bytes[o] >> 6 !== 0x02) { - break; - } - i++; - } - return i; - } - // This byte runs us past the end of the string, so just jump to the end - // (but the first byte was read already read and therefore skipped) - if (reason === "OVERRUN") { - return bytes.length - offset - 1; - } - // Nothing to skip - return 0; -} -function replaceFunc(reason, offset, bytes, output, badCodepoint) { - // Overlong representations are otherwise "valid" code points; just non-deistingtished - if (reason === "OVERLONG") { - assertArgument(typeof (badCodepoint) === "number", "invalid bad code point for replacement", "badCodepoint", badCodepoint); - output.push(badCodepoint); - return 0; - } - // Put the replacement character into the output - output.push(0xfffd); - // Otherwise, process as if ignoring errors - return ignoreFunc(reason, offset, bytes); -} -/** - * A handful of popular, built-in UTF-8 error handling strategies. - * - * **``"error"``** - throws on ANY illegal UTF-8 sequence or - * non-canonical (overlong) codepoints (this is the default) - * - * **``"ignore"``** - silently drops any illegal UTF-8 sequence - * and accepts non-canonical (overlong) codepoints - * - * **``"replace"``** - replace any illegal UTF-8 sequence with the - * UTF-8 replacement character (i.e. ``"\\ufffd"``) and accepts - * non-canonical (overlong) codepoints - * - * @returns: Record<"error" | "ignore" | "replace", Utf8ErrorFunc> - */ -const Utf8ErrorFuncs = Object.freeze({ - error: errorFunc, - ignore: ignoreFunc, - replace: replaceFunc -}); -// http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499 -function getUtf8CodePoints(_bytes, onError) { - if (onError == null) { - onError = Utf8ErrorFuncs.error; - } - const bytes = getBytes(_bytes, "bytes"); - const result = []; - let i = 0; - // Invalid bytes are ignored - while (i < bytes.length) { - const c = bytes[i++]; - // 0xxx xxxx - if (c >> 7 === 0) { - result.push(c); - continue; - } - // Multibyte; how many bytes left for this character? - let extraLength = null; - let overlongMask = null; - // 110x xxxx 10xx xxxx - if ((c & 0xe0) === 0xc0) { - extraLength = 1; - overlongMask = 0x7f; - // 1110 xxxx 10xx xxxx 10xx xxxx - } - else if ((c & 0xf0) === 0xe0) { - extraLength = 2; - overlongMask = 0x7ff; - // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx - } - else if ((c & 0xf8) === 0xf0) { - extraLength = 3; - overlongMask = 0xffff; - } - else { - if ((c & 0xc0) === 0x80) { - i += onError("UNEXPECTED_CONTINUE", i - 1, bytes, result); - } - else { - i += onError("BAD_PREFIX", i - 1, bytes, result); - } - continue; - } - // Do we have enough bytes in our data? - if (i - 1 + extraLength >= bytes.length) { - i += onError("OVERRUN", i - 1, bytes, result); - continue; - } - // Remove the length prefix from the char - let res = c & ((1 << (8 - extraLength - 1)) - 1); - for (let j = 0; j < extraLength; j++) { - let nextChar = bytes[i]; - // Invalid continuation byte - if ((nextChar & 0xc0) != 0x80) { - i += onError("MISSING_CONTINUE", i, bytes, result); - res = null; - break; - } - res = (res << 6) | (nextChar & 0x3f); - i++; - } - // See above loop for invalid continuation byte - if (res === null) { - continue; - } - // Maximum code point - if (res > 0x10ffff) { - i += onError("OUT_OF_RANGE", i - 1 - extraLength, bytes, result, res); - continue; - } - // Reserved for UTF-16 surrogate halves - if (res >= 0xd800 && res <= 0xdfff) { - i += onError("UTF16_SURROGATE", i - 1 - extraLength, bytes, result, res); - continue; - } - // Check for overlong sequences (more bytes than needed) - if (res <= overlongMask) { - i += onError("OVERLONG", i - 1 - extraLength, bytes, result, res); - continue; - } - result.push(res); - } - return result; -} -// http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array -/** - * Returns the UTF-8 byte representation of %%str%%. - * - * If %%form%% is specified, the string is normalized. - */ -function toUtf8Bytes(str, form) { - assertArgument(typeof (str) === "string", "invalid string value", "str", str); - let result = []; - for (let i = 0; i < str.length; i++) { - const c = str.charCodeAt(i); - if (c < 0x80) { - result.push(c); - } - else if (c < 0x800) { - result.push((c >> 6) | 0xc0); - result.push((c & 0x3f) | 0x80); - } - else if ((c & 0xfc00) == 0xd800) { - i++; - const c2 = str.charCodeAt(i); - assertArgument(i < str.length && ((c2 & 0xfc00) === 0xdc00), "invalid surrogate pair", "str", str); - // Surrogate Pair - const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff); - result.push((pair >> 18) | 0xf0); - result.push(((pair >> 12) & 0x3f) | 0x80); - result.push(((pair >> 6) & 0x3f) | 0x80); - result.push((pair & 0x3f) | 0x80); - } - else { - result.push((c >> 12) | 0xe0); - result.push(((c >> 6) & 0x3f) | 0x80); - result.push((c & 0x3f) | 0x80); - } - } - return new Uint8Array(result); -} -//export -function _toUtf8String(codePoints) { - return codePoints.map((codePoint) => { - if (codePoint <= 0xffff) { - return String.fromCharCode(codePoint); - } - codePoint -= 0x10000; - return String.fromCharCode((((codePoint >> 10) & 0x3ff) + 0xd800), ((codePoint & 0x3ff) + 0xdc00)); - }).join(""); -} -/** - * Returns the string represented by the UTF-8 data %%bytes%%. - * - * When %%onError%% function is specified, it is called on UTF-8 - * errors allowing recovery using the [[Utf8ErrorFunc]] API. - * (default: [error](Utf8ErrorFuncs)) - */ -function toUtf8String(bytes, onError) { - return _toUtf8String(getUtf8CodePoints(bytes, onError)); -} - -// SHA3 (keccak) is based on a new design: basically, the internal state is bigger than output size. -// It's called a sponge function. -// Various per round constants calculations -const [SHA3_PI, SHA3_ROTL, _SHA3_IOTA] = [[], [], []]; -const _0n = /* @__PURE__ */ BigInt(0); -const _1n = /* @__PURE__ */ BigInt(1); -const _2n = /* @__PURE__ */ BigInt(2); -const _7n = /* @__PURE__ */ BigInt(7); -const _256n = /* @__PURE__ */ BigInt(256); -const _0x71n = /* @__PURE__ */ BigInt(0x71); -for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) { - // Pi - [x, y] = [y, (2 * x + 3 * y) % 5]; - SHA3_PI.push(2 * (5 * y + x)); - // Rotational - SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64); - // Iota - let t = _0n; - for (let j = 0; j < 7; j++) { - R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n; - if (R & _2n) - t ^= _1n << ((_1n << /* @__PURE__ */ BigInt(j)) - _1n); - } - _SHA3_IOTA.push(t); -} -const [SHA3_IOTA_H, SHA3_IOTA_L] = /* @__PURE__ */ split(_SHA3_IOTA, true); -// Left rotation (without 0, 32, 64) -const rotlH = (h, l, s) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s)); -const rotlL = (h, l, s) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s)); -// Same as keccakf1600, but allows to skip some rounds -function keccakP(s, rounds = 24) { - const B = new Uint32Array(5 * 2); - // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js) - for (let round = 24 - rounds; round < 24; round++) { - // Theta θ - for (let x = 0; x < 10; x++) - B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40]; - for (let x = 0; x < 10; x += 2) { - const idx1 = (x + 8) % 10; - const idx0 = (x + 2) % 10; - const B0 = B[idx0]; - const B1 = B[idx0 + 1]; - const Th = rotlH(B0, B1, 1) ^ B[idx1]; - const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1]; - for (let y = 0; y < 50; y += 10) { - s[x + y] ^= Th; - s[x + y + 1] ^= Tl; - } - } - // Rho (ρ) and Pi (π) - let curH = s[2]; - let curL = s[3]; - for (let t = 0; t < 24; t++) { - const shift = SHA3_ROTL[t]; - const Th = rotlH(curH, curL, shift); - const Tl = rotlL(curH, curL, shift); - const PI = SHA3_PI[t]; - curH = s[PI]; - curL = s[PI + 1]; - s[PI] = Th; - s[PI + 1] = Tl; - } - // Chi (χ) - for (let y = 0; y < 50; y += 10) { - for (let x = 0; x < 10; x++) - B[x] = s[y + x]; - for (let x = 0; x < 10; x++) - s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10]; - } - // Iota (ι) - s[0] ^= SHA3_IOTA_H[round]; - s[1] ^= SHA3_IOTA_L[round]; - } - B.fill(0); -} -class Keccak extends Hash { - // NOTE: we accept arguments in bytes instead of bits here. - constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) { - super(); - this.blockLen = blockLen; - this.suffix = suffix; - this.outputLen = outputLen; - this.enableXOF = enableXOF; - this.rounds = rounds; - this.pos = 0; - this.posOut = 0; - this.finished = false; - this.destroyed = false; - // Can be passed from user as dkLen - number(outputLen); - // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes - if (0 >= this.blockLen || this.blockLen >= 200) - throw new Error('Sha3 supports only keccak-f1600 function'); - this.state = new Uint8Array(200); - this.state32 = u32(this.state); - } - keccak() { - keccakP(this.state32, this.rounds); - this.posOut = 0; - this.pos = 0; - } - update(data) { - exists(this); - const { blockLen, state } = this; - data = toBytes(data); - const len = data.length; - for (let pos = 0; pos < len;) { - const take = Math.min(blockLen - this.pos, len - pos); - for (let i = 0; i < take; i++) - state[this.pos++] ^= data[pos++]; - if (this.pos === blockLen) - this.keccak(); - } - return this; - } - finish() { - if (this.finished) - return; - this.finished = true; - const { state, suffix, pos, blockLen } = this; - // Do the padding - state[pos] ^= suffix; - if ((suffix & 0x80) !== 0 && pos === blockLen - 1) - this.keccak(); - state[blockLen - 1] ^= 0x80; - this.keccak(); - } - writeInto(out) { - exists(this, false); - bytes(out); - this.finish(); - const bufferOut = this.state; - const { blockLen } = this; - for (let pos = 0, len = out.length; pos < len;) { - if (this.posOut >= blockLen) - this.keccak(); - const take = Math.min(blockLen - this.posOut, len - pos); - out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); - this.posOut += take; - pos += take; - } - return out; - } - xofInto(out) { - // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF - if (!this.enableXOF) - throw new Error('XOF is not possible for this instance'); - return this.writeInto(out); - } - xof(bytes) { - number(bytes); - return this.xofInto(new Uint8Array(bytes)); - } - digestInto(out) { - output(out, this); - if (this.finished) - throw new Error('digest() was already called'); - this.writeInto(out); - this.destroy(); - return out; - } - digest() { - return this.digestInto(new Uint8Array(this.outputLen)); - } - destroy() { - this.destroyed = true; - this.state.fill(0); - } - _cloneInto(to) { - const { blockLen, suffix, outputLen, rounds, enableXOF } = this; - to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds)); - to.state32.set(this.state32); - to.pos = this.pos; - to.posOut = this.posOut; - to.finished = this.finished; - to.rounds = rounds; - // Suffix can change in cSHAKE - to.suffix = suffix; - to.outputLen = outputLen; - to.enableXOF = enableXOF; - to.destroyed = this.destroyed; - return to; - } -} -const gen = (suffix, blockLen, outputLen) => wrapConstructor(() => new Keccak(blockLen, suffix, outputLen)); -/** - * keccak-256 hash function. Different from SHA3-256. - * @param message - that would be hashed - */ -const keccak_256 = /* @__PURE__ */ gen(0x01, 136, 256 / 8); - -/** - * Cryptographic hashing functions - * - * @_subsection: api/crypto:Hash Functions [about-crypto-hashing] - */ -let locked = false; -const _keccak256 = function (data) { - return keccak_256(data); -}; -let __keccak256 = _keccak256; -/** - * Compute the cryptographic KECCAK256 hash of %%data%%. - * - * The %%data%% **must** be a data representation, to compute the - * hash of UTF-8 data use the [[id]] function. - * - * @returns DataHexstring - * @example: - * keccak256("0x") - * //_result: - * - * keccak256("0x1337") - * //_result: - * - * keccak256(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - * // Strings are assumed to be DataHexString, otherwise it will - * // throw. To hash UTF-8 data, see the note above. - * keccak256("Hello World") - * //_error: - */ -function keccak256(_data) { - const data = getBytes(_data, "data"); - return hexlify(__keccak256(data)); -} -keccak256._ = _keccak256; -keccak256.lock = function () { locked = true; }; -keccak256.register = function (func) { - if (locked) { - throw new TypeError("keccak256 is locked"); - } - __keccak256 = func; -}; -Object.freeze(keccak256); - -/** - * A simple hashing function which operates on UTF-8 strings to - * compute an 32-byte identifier. - * - * This simply computes the [UTF-8 bytes](toUtf8Bytes) and computes - * the [[keccak256]]. - * - * @example: - * id("hello world") - * //_result: - */ -function id(value) { - return keccak256(toUtf8Bytes(value)); -} - -const subsChrs = " !#$%&'()*+,-./<=>?@[]^_`{|}~"; -const Word = /^[a-z]*$/i; -function unfold(words, sep) { - let initial = 97; - return words.reduce((accum, word) => { - if (word === sep) { - initial++; - } - else if (word.match(Word)) { - accum.push(String.fromCharCode(initial) + word); - } - else { - initial = 97; - accum.push(word); - } - return accum; - }, []); -} -/** - * @_ignore - */ -function decode(data, subs) { - // Replace all the substitutions with their expanded form - for (let i = subsChrs.length - 1; i >= 0; i--) { - data = data.split(subsChrs[i]).join(subs.substring(2 * i, 2 * i + 2)); - } - // Get all tle clumps; each suffix, first-increment and second-increment - const clumps = []; - const leftover = data.replace(/(:|([0-9])|([A-Z][a-z]*))/g, (all, item, semi, word) => { - if (semi) { - for (let i = parseInt(semi); i >= 0; i--) { - clumps.push(";"); - } - } - else { - clumps.push(item.toLowerCase()); - } - return ""; - }); - /* c8 ignore start */ - if (leftover) { - throw new Error(`leftovers: ${JSON.stringify(leftover)}`); - } - /* c8 ignore stop */ - return unfold(unfold(clumps, ";"), ":"); -} -/** - * @_ignore - */ -function decodeOwl(data) { - assertArgument(data[0] === "0", "unsupported auwl data", "data", data); - return decode(data.substring(1 + 2 * subsChrs.length), data.substring(1, 1 + 2 * subsChrs.length)); -} - -/** - * A Wordlist represents a collection of language-specific - * words used to encode and devoce [[link-bip-39]] encoded data - * by mapping words to 11-bit values and vice versa. - */ -class Wordlist { - locale; - /** - * Creates a new Wordlist instance. - * - * Sub-classes MUST call this if they provide their own constructor, - * passing in the locale string of the language. - * - * Generally there is no need to create instances of a Wordlist, - * since each language-specific Wordlist creates an instance and - * there is no state kept internally, so they are safe to share. - */ - constructor(locale) { - defineProperties(this, { locale }); - } - /** - * Sub-classes may override this to provide a language-specific - * method for spliting %%phrase%% into individual words. - * - * By default, %%phrase%% is split using any sequences of - * white-space as defined by regular expressions (i.e. ``/\s+/``). - */ - split(phrase) { - return phrase.toLowerCase().split(/\s+/g); - } - /** - * Sub-classes may override this to provider a language-specific - * method for joining %%words%% into a phrase. - * - * By default, %%words%% are joined by a single space. - */ - join(words) { - return words.join(" "); - } -} - -// Use the encode-latin.js script to create the necessary -// data files to be consumed by this class -/** - * An OWL format Wordlist is an encoding method that exploits - * the general locality of alphabetically sorted words to - * achieve a simple but effective means of compression. - * - * This class is generally not useful to most developers as - * it is used mainly internally to keep Wordlists for languages - * based on ASCII-7 small. - * - * If necessary, there are tools within the ``generation/`` folder - * to create the necessary data. - */ -class WordlistOwl extends Wordlist { - #data; - #checksum; - /** - * Creates a new Wordlist for %%locale%% using the OWL %%data%% - * and validated against the %%checksum%%. - */ - constructor(locale, data, checksum) { - super(locale); - this.#data = data; - this.#checksum = checksum; - this.#words = null; - } - /** - * The OWL-encoded data. - */ - get _data() { return this.#data; } - /** - * Decode all the words for the wordlist. - */ - _decodeWords() { - return decodeOwl(this.#data); - } - #words; - #loadWords() { - if (this.#words == null) { - const words = this._decodeWords(); - // Verify the computed list matches the official list - const checksum = id(words.join("\n") + "\n"); - /* c8 ignore start */ - if (checksum !== this.#checksum) { - throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`); - } - /* c8 ignore stop */ - this.#words = words; - } - return this.#words; - } - getWord(index) { - const words = this.#loadWords(); - assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); - return words[index]; - } - getWordIndex(word) { - return this.#loadWords().indexOf(word); - } -} - -const words$4 = "0itatkastcenaovo$taouleraeki&chor*teci%enbalodaeladet'!Chn=0Di#%E%^1Resa2Rese3CeT'#0EjKohol0Pu)%0A&sDul#Ekdo)Ke)Ti#Ul|3}aOgan%0FaltI$@tPi,%TmaTronom0LasL{i#Ol0Tobus4Yl:B#}R'?TaUb_U/!U^U+Ur!Xer2A^v#Ambo,An#AtrEp)Ike)KoLohOnzOskevUn{#Usin#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kuEs_aOnR!Uk'odYk"; -const checksum$4 = "0x25f44555f4af25b51a711136e1c7d6e50ce9f8917d39d6b1f076b2bb4d2fac1a"; -let wordlist$6 = null; -/** - * The [[link-bip39-cz]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -class LangCz extends WordlistOwl { - /** - * Creates a new instance of the Czech language Wordlist. - * - * Using the constructor should be unnecessary, instead use the - * [[wordlist]] singleton method. - * - * @_ignore: - */ - constructor() { super("cz", words$4, checksum$4); } - /** - * Returns a singleton instance of a ``LangCz``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist$6 == null) { - wordlist$6 = new LangCz(); - } - return wordlist$6; - } -} - -const Base64 = ")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_"; -/** - * @_ignore - */ -function decodeBits(width, data) { - const maxValue = (1 << width) - 1; - const result = []; - let accum = 0, bits = 0, flood = 0; - for (let i = 0; i < data.length; i++) { - // Accumulate 6 bits of data - accum = ((accum << 6) | Base64.indexOf(data[i])); - bits += 6; - // While we have enough for a word... - while (bits >= width) { - // ...read the word - const value = (accum >> (bits - width)); - accum &= (1 << (bits - width)) - 1; - bits -= width; - // A value of 0 indicates we exceeded maxValue, it - // floods over into the next value - if (value === 0) { - flood += maxValue; - } - else { - result.push(value + flood); - flood = 0; - } - } - } - return result; -} - -/** - * @_ignore - */ -function decodeOwlA(data, accents) { - let words = decodeOwl(data).join(","); - // Inject the accents - accents.split(/,/g).forEach((accent) => { - const match = accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/); - assertArgument(match !== null, "internal error parsing accents", "accents", accents); - let posOffset = 0; - const positions = decodeBits(parseInt(match[3]), match[4]); - const charCode = parseInt(match[2]); - const regex = new RegExp(`([${match[1]}])`, "g"); - words = words.replace(regex, (all, letter) => { - const rem = --positions[posOffset]; - if (rem === 0) { - letter = String.fromCharCode(letter.charCodeAt(0), charCode); - posOffset++; - } - return letter; - }); - }); - return words.split(","); -} - -/** - * An OWL-A format Wordlist extends the OWL format to add an - * overlay onto an OWL format Wordlist to support diacritic - * marks. - * - * This class is generally not useful to most developers as - * it is used mainly internally to keep Wordlists for languages - * based on latin-1 small. - * - * If necessary, there are tools within the ``generation/`` folder - * to create the necessary data. - */ -class WordlistOwlA extends WordlistOwl { - #accent; - /** - * Creates a new Wordlist for %%locale%% using the OWLA %%data%% - * and %%accent%% data and validated against the %%checksum%%. - */ - constructor(locale, data, accent, checksum) { - super(locale, data, checksum); - this.#accent = accent; - } - /** - * The OWLA-encoded accent data. - */ - get _accent() { return this.#accent; } - /** - * Decode all the words for the wordlist. - */ - _decodeWords() { - return decodeOwlA(this._data, this._accent); - } -} - -const words$3 = "0arertoiotadonoaRteirroenaNonaLsolocoiliaralaorrenadaChoN$n0A>Dom,EjaI!#Oga&O'Or#RazoR*Ue=U<0Ab Adem@CeLe%OmoRa!RozUn0DazD$GeLaM,#S,)T^0AlAnceA+EEl]`E`EstruzI.I<2ErU{U'0Af[nArO)Uc Uf_Ul:BaB^|eH@IleJ Lanz/c.LdeMbuN>Nd-oRb(>RnizR+Scu]S#nSu[Tal]T!@T*Tu%UlZ 3BeBid/=S SoSt@3|oEnNgo2An>OqueUsa2ABi`BoCaCi`DaDegaIn//!oLsaMb-{dNi#N}saiRdeRr SqueTeTinVe{Zal2AvoAzoEchaEveIl=In>IsaOcaOmaOnceO)UjaUs>U#2CeoCleE'EyFan{F.HoIt_L#Rbuj(l(+Sc TacaZ.:Bal=BezaBi`B[CaoDav!D,aErFeI{ImanJaJ.LLam Lc$L&Li{dLleLm/^LvoMaMb$Mel=Mi'Mp}c!Nd?Nel-gu+Nic-#N-.ObaOsPazPi%nPo)Pt Puch((b.RcelRe%Rg(i'RneRpe%R+R%SaS>S!oSpaS#rT^ceT_U{lUsaZo3Bol]D!D+Ld/eb_LoAmpuAnc]ApaAr]I>Is)IvoOqueOzaUle%Up 0Cl.EgoE=EnEr#F[G +M->NeN%P_sR>Rue]SneT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9C!a0B[l0I{dIrIv! b) { - return 1; - } - return 0; - } - // Load all the words - for (let length = 3; length <= 9; length++) { - const d = data$2[length - 3]; - for (let offset = 0; offset < d.length; offset += length) { - const word = []; - for (let i = 0; i < length; i++) { - const k = mapping.indexOf(d[offset + i]); - word.push(227); - word.push((k & 0x40) ? 130 : 129); - word.push((k & 0x3f) + 128); - } - wordlist.push(toString(word)); - } - } - wordlist.sort(sortJapanese); - // For some reason kyoku and kiyoku are flipped in node (!!). - // The order SHOULD be: - // - kyoku - // - kiyoku - // This should ignore "if", but that doesn't work here?? - /* c8 ignore start */ - if (hex(wordlist[442]) === KiYoKu && hex(wordlist[443]) === KyoKu) { - const tmp = wordlist[442]; - wordlist[442] = wordlist[443]; - wordlist[443] = tmp; - } - /* c8 ignore stop */ - // Verify the computed list matches the official list - /* istanbul ignore if */ - const checksum = id(wordlist.join("\n") + "\n"); - /* c8 ignore start */ - if (checksum !== "0xcb36b09e6baa935787fd762ce65e80b0c6a8dabdfbc3a7f86ac0e2c4fd111600") { - throw new Error("BIP39 Wordlist for ja (Japanese) FAILED"); - } - /* c8 ignore stop */ - _wordlist$2 = wordlist; - return wordlist; -} -let wordlist$3 = null; -/** - * The [[link-bip39-ja]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -class LangJa extends Wordlist { - /** - * Creates a new instance of the Japanese language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langJa]] should suffice. - * - * @_ignore: - */ - constructor() { super("ja"); } - getWord(index) { - const words = loadWords$2(); - assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); - return words[index]; - } - getWordIndex(word) { - return loadWords$2().indexOf(word); - } - split(phrase) { - //logger.assertNormalize(); - return phrase.split(/(?:\u3000| )+/g); - } - join(words) { - return words.join("\u3000"); - } - /** - * Returns a singleton instance of a ``LangJa``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist$3 == null) { - wordlist$3 = new LangJa(); - } - return wordlist$3; - } -} - -const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Fn3RnoLdCVSTGZrLeSTvGXCnLg3MnoLn3MToLlrETvMT8SToAl3MbrDU6GTvMb8LX4LhrPlrLXGXCnSToLf8Rg3STrDb8LTrSTvLTHXMnSb3RYLnMnSgOg6ATFg", - "HUDlGnrQXrJTrHgLnrAcJYMb8DULc8LTvFgGnCk3Mg8JbAnLX4QYvFYHnMXrRUoJnGnvFnRlvFTJlQnoSTrBXHXrLYSUJgLfoMT8Se8DTrHbDb", - "AbDl8SToJU8An3RbAb8ST8DUSTrGnrAgoLbFU6Db8LTrMg8AaHT8Jb8ObDl8SToJU8Pb3RlvFYoJl" -]; -const codes$1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*"; -function getHangul(code) { - if (code >= 40) { - code = code + 168 - 40; - } - else if (code >= 19) { - code = code + 97 - 19; - } - return toUtf8String(new Uint8Array([225, (code >> 6) + 132, (code & 0x3f) + 128])); -} -let _wordlist$1 = null; -function loadWords$1() { - if (_wordlist$1 != null) { - return _wordlist$1; - } - const wordlist = []; - data$1.forEach((data, length) => { - length += 4; - for (let i = 0; i < data.length; i += length) { - let word = ""; - for (let j = 0; j < length; j++) { - word += getHangul(codes$1.indexOf(data[i + j])); - } - wordlist.push(word); - } - }); - wordlist.sort(); - // Verify the computed list matches the official list - /* istanbul ignore if */ - const checksum = id(wordlist.join("\n") + "\n"); - /* c8 ignore start */ - if (checksum !== "0xf9eddeace9c5d3da9c93cf7d3cd38f6a13ed3affb933259ae865714e8a3ae71a") { - throw new Error("BIP39 Wordlist for ko (Korean) FAILED"); - } - /* c8 ignore stop */ - _wordlist$1 = wordlist; - return wordlist; -} -let wordlist$2 = null; -/** - * The [[link-bip39-ko]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -class LangKo extends Wordlist { - /** - * Creates a new instance of the Korean language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langKo]] should suffice. - * - * @_ignore: - */ - constructor() { - super("ko"); - } - getWord(index) { - const words = loadWords$1(); - assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); - return words[index]; - } - getWordIndex(word) { - return loadWords$1().indexOf(word); - } - /** - * Returns a singleton instance of a ``LangKo``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist$2 == null) { - wordlist$2 = new LangKo(); - } - return wordlist$2; - } -} - -const words$1 = "0torea noica!iosorolotaleratelanena%oiadoencotivomai t ca%a0A]Bagl'Bin#E.Is(Oli!Rasi_Rog#0Cade!C[$Cus#E Roba+U 0Ag'Deb{DomeEgu#Eri!IpeOtt&Ul&1Fabi,Fe|Fis(F-n Oris`O(R~$0AveEn.E_,Ganc'I!It&OnismoR>*Rume Uzzo4AbardaA Bat)Ber#BoBumeCeCol>E|Ertu-OdePari!Pe^ Pogg'P)@Pun Ri,1Ab~AchideAgos+Ald~Anc'Atu-AzzoBit)Chiv'D{Eni,G[ GiSoTef%eZil*0Ciu|Col EpsiEtt>Fal I$O/Pir#P)Sagg'SeSolu Sur@TaT[u T%eT-|0Av>EismoOm>O$TesaTiv&Tor$Tr{Tua,0Sil'Str?Tis+To$moTun$0Anz#E!V[i!Vi(Volge!3IoS(Tos+Ttu U,VaVosa3C]FfaLg'LvaNdaNe_,Nig$Nzi=ReRli=Ta3Bi+CiDoR@S]Tan>T^$Zzo*2Acc'AdipoA`An}Avu-E.l/Eve|EzzaIgl?Il/n.Ind&Oc]*O@Onzi=Ul*U$2BboT+di$UffoVet+Vi,2Ass>In~O)2C]Dar@D%eE!n.G$meLl&Lm#Lo!Lpo(L^v#LzaMaMe+M`n@Mo@Mpu.rMuS+n.Ttu-V#2A.!Avat+E#Ede!Emo(Esci+E+Ice I=,IsiIt>OceO=}Os++Uc?,Us}2Ci!Cu*Gi$Ll#Po/R#!R(!R_Sci$S de:DoI$L`+Meri$Nie/N$(Nz&T#Van^Vve)3Bu|C[n'Ci(Cli$Col*C! D%#Fin{FormeG$Leg&Lfi$Lir'L+M[zaNot#Nt)Pos{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uss#0Elli!Erv#O@0BbalzoBr'C]r(C?,Da,Ffi|G$Ld#L[M`NdaNe|Nnife)Pi!Ppe(P-Rge!Rpas(Rri(R(R.gg'R_l#Spi)S+T^,0AdaAl/Arge!A /Av[ Azzo/EcieEdi!EgRappoReg#Ridu*Rozz&Ru|Ucc&UfoUp[@0B[t)C](Do!Gger{GoL+$On&PerboPpor Rgel#R)g#Ssur)Tu-0Ag&EdeseEgl'El&Enu Ez?IluppoIs+Izze-Ol+Uot&:Bac]Bul#Cci&Citur$LeLis`$MpoVer=Vo/+Zza3CaCn>Lefo$Me-r'MpoMu N@Pog-foRagg'RoTan'To*Tuban.Z'Zzo<5Cc&L,r&L Mbo/MoNfoNsil/Paz'Po*g?PpaRbaRn&R)L,t+Lo)(Lut&L_/Mpa+Ng&N{(NoN+gg'Nve-Po!Ra$Rc#R?n.S}3Det+DovaDu Ge+,I]*Lc)Li=Llu LoceN#Ndemm?N RaceRba,Rgog=Rif~RoRru}Rt~,Sc~Ssil*S+,Te-$Tri=Tus 3Andan.B-n.C[daChingoCi=nzaDim&Gil?G< Go!LeL/$MiniNc{!O/Pe-Rgo/Ro*goRu,n S](S'5Cche)Fo*LuPpa"; -const checksum$1 = "0x5c1362d88fd4cf614a96f3234941d29f7d37c08c5292fde03bf62c2db6ff7620"; -let wordlist$1 = null; -/** - * The [[link-bip39-it]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -class LangIt extends WordlistOwl { - /** - * Creates a new instance of the Italian language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langIt]] should suffice. - * - * @_ignore: - */ - constructor() { super("it", words$1, checksum$1); } - /** - * Returns a singleton instance of a ``LangIt``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist$1 == null) { - wordlist$1 = new LangIt(); - } - return wordlist$1; - } -} - -const words = "0arad!ototealirertainrasoent hoandoaR#riareha!aroele'oronul0Aca%AixoAl A%rDuz'El]Er$IsmoO$ Rum S-&T(i&TigoVo[=0F&.Il#P' S?S* So&/Sun$Tr&0Ac#Adu+Al/A[f E End(Er_EuIng'Ir?IvoOl{oRac Revi=RizU&Um0Di$rM-.R>o+TismoT|@Tu 0Ali An%Ar@Ent&Es,I?Is Ul,1Ila1Ar E=Ei%Ulejo:B BosaC&]uCh `C@GagemI+c>~/Se#S)n%Ta)Te=rTidaTomTuc Unil]3B(IjoIr^IsebolLd!eLezaLgaLisc Ndi$Ng&aNz(RimbauRl*d>_Sou_XigaZ(_3CoCu=En&Foc&Furc G|naLhe%Mest[Mo$rOlog@OmboOsf(aPol Rr-$Scoi$Sne$SpoSsex$TolaZ _2Ind#OcoOque 2A$BagemC#CejoChec]Ico.L^LetimL]LoMb{oNdeNecoNi)Rb~h>d>e&R+c]V*oXe?2AncoAsaAvezaEuIgaIl/Inc OaOchu+Onze O$Uxo2C]DismoF LeRacoScaS$Z*a:Bimb Rn{oRpe%R['>)zRv&/SacoScaSeb[S%loS~oT a)Tiv UleUs?U%l V&oV(na3BolaDil]G}]Lebr L~ Nou+N,N%ioRc Rr#R%'oRvejaTimV^2Aco)Al{aAm#Ap^ArmeAticeAveEfeEg^E'oEqueIco%If[In`oOc&/Ov(UmboU.Uva0CatrizCl}eD!eD['aEn%Gcui$Rurg@T 2A[zaE_Ic OneUbe2A=Ag'Ba@B($rBr C^El/Ent_E,Gum`oIb'IfaIo%L L{aLh(Lid'Lme@L}oLunaM<=Mb* M-.MitivaMov(MplexoMumNc]N=rNec.Nfu,Ng` Nhec(Njug Nsum'Nt+$Nvi%Op( P{oPi?PoQue%lRagemRdi&Rne)R}h>p|&R[ioR%joRuj>voSs-oS%laT}e%U_UveVilZ*]2A%+AvoEcheE=rEmeErEspoI^Im*&Io~oIseItic Os)UaUz{o2B+m SafioSbo.Sc<,S-/Sfi#Sgas%Sigu&SlizeSmam SovaSpesaS)queSvi T&h T-$rT} Tri$UsaV(Vi=Vot#Z-a3Ag+maAle$Da)Fu,Gi.Lat#Lu-%M*u'Nast@Nh{oOceseRe$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>$S.UcaUp{aX*a2Ab&/Acej Adu$rAfeg Aje$AmaAnc ApoAs{oAt?Av E*oEm(Epid EvoIagemIboIcicloId-%Ilog@Ind!eIploItur Iunf&Oc Ombe)OvaUnfoUque2B~ CquesaT` T|i&:7V 3Bigo0HaId!eIf|me3Olog@SoTigaUbu0A=InaUfru':C*aDi G o,I=,LaL-%Lid!eLo[sN)gemQu{oRe)Rr(Sc~ Sil]S,u+Z Zio3A=D Ge.Ic~ L{oLhiceLu=Nce=rNdav&N( Nt[Rb&Rd!eRe?Rg}h>m`/RnizRs R%n%SpaSti=T|i&3Adu$AgemAj Atu+Br?D{aDr @ElaGaG-%Gi G| L ejoNcoNhe)NilOle)R!>tudeSi.S$Tr&V{oZ*/5A=rArG&L<%LeibolL)gemLumo,Nt!e5L$Vuz`a::D[zRope3QueRe.Rife3Ng ::Ng#Rp 3BuL?9Mb Olog@5Mbi="; -const checksum = "0x2219000926df7b50d8aa0a3d495826b988287df4657fbd100e6fe596c8f737ac"; -let wordlist = null; -/** - * The [[link-bip39-pt]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -class LangPt extends WordlistOwl { - /** - * Creates a new instance of the Portuguese language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langPt]] should suffice. - * - * @_ignore: - */ - constructor() { super("pt", words, checksum); } - /** - * Returns a singleton instance of a ``LangPt``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist == null) { - wordlist = new LangPt(); - } - return wordlist; - } -} - -const data = "}aE#4A=Yv&co#4N#6G=cJ&SM#66|/Z#4t&kn~46#4K~4q%b9=IR#7l,mB#7W_X2*dl}Uo~7s}Uf&Iw#9c&cw~6O&H6&wx&IG%v5=IQ~8a&Pv#47$PR&50%Ko&QM&3l#5f,D9#4L|/H&tQ;v0~6n]nN> 2), - 128 + codes.indexOf(data[i * 3 + 1]), - 128 + codes.indexOf(data[i * 3 + 2]), - ]; - if (locale === "zh_tw") { - const common = s % 4; - for (let i = common; i < 3; i++) { - bytes[i] = codes.indexOf(deltaData[deltaOffset++]) + ((i == 0) ? 228 : 128); - } - } - wordlist.push(toUtf8String(new Uint8Array(bytes))); - } - // Verify the computed list matches the official list - const checksum = id(wordlist.join("\n") + "\n"); - /* c8 ignore start */ - if (checksum !== Checks[locale]) { - throw new Error(`BIP39 Wordlist for ${locale} (Chinese) FAILED`); - } - /* c8 ignore stop */ - _wordlist[locale] = wordlist; - return wordlist; -} -const wordlists = {}; -/** - * The [[link-bip39-zh_cn]] and [[link-bip39-zh_tw]] for - * [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -class LangZh extends Wordlist { - /** - * Creates a new instance of the Chinese language Wordlist for - * the %%dialect%%, either ``"cn"`` or ``"tw"`` for simplified - * or traditional, respectively. - * - * This should be unnecessary most of the time as the exported - * [[langZhCn]] and [[langZhTw]] should suffice. - * - * @_ignore: - */ - constructor(dialect) { super("zh_" + dialect); } - getWord(index) { - const words = loadWords(this.locale); - assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); - return words[index]; - } - getWordIndex(word) { - return loadWords(this.locale).indexOf(word); - } - split(phrase) { - phrase = phrase.replace(/(?:\u3000| )+/g, ""); - return phrase.split(""); - } - /** - * Returns a singleton instance of a ``LangZh`` for %%dialect%%, - * creating it if this is the first time being called. - * - * Use the %%dialect%% ``"cn"`` or ``"tw"`` for simplified or - * traditional, respectively. - */ - static wordlist(dialect) { - if (wordlists[dialect] == null) { - wordlists[dialect] = new LangZh(dialect); - } - return wordlists[dialect]; - } -} - -export { LangCz, LangEs, LangFr, LangIt, LangJa, LangKo, LangPt, LangZh }; -//# sourceMappingURL=wordlists-extra.js.map diff --git a/tools/mnemonic-test/node_modules/ethers/dist/wordlists-extra.js.map b/tools/mnemonic-test/node_modules/ethers/dist/wordlists-extra.js.map deleted file mode 100644 index 7eccf8d7..00000000 --- a/tools/mnemonic-test/node_modules/ethers/dist/wordlists-extra.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlists-extra.js","sources":["../node_modules/@noble/hashes/esm/_assert.js","../node_modules/@noble/hashes/esm/utils.js","../node_modules/@noble/hashes/esm/_u64.js","../lib.esm/_version.js","../lib.esm/utils/properties.js","../lib.esm/utils/errors.js","../lib.esm/utils/data.js","../lib.esm/utils/utf8.js","../node_modules/@noble/hashes/esm/sha3.js","../lib.esm/crypto/keccak.js","../lib.esm/hash/id.js","../lib.esm/wordlists/decode-owl.js","../lib.esm/wordlists/wordlist.js","../lib.esm/wordlists/wordlist-owl.js","../lib.esm/wordlists/lang-cz.js","../lib.esm/wordlists/bit-reader.js","../lib.esm/wordlists/decode-owla.js","../lib.esm/wordlists/wordlist-owla.js","../lib.esm/wordlists/lang-es.js","../lib.esm/wordlists/lang-fr.js","../lib.esm/wordlists/lang-ja.js","../lib.esm/wordlists/lang-ko.js","../lib.esm/wordlists/lang-it.js","../lib.esm/wordlists/lang-pt.js","../lib.esm/wordlists/lang-zh.js"],"sourcesContent":["function number(n) {\n if (!Number.isSafeInteger(n) || n < 0)\n throw new Error(`Wrong positive integer: ${n}`);\n}\nfunction bool(b) {\n if (typeof b !== 'boolean')\n throw new Error(`Expected boolean, not ${b}`);\n}\nfunction bytes(b, ...lengths) {\n if (!(b instanceof Uint8Array))\n throw new Error('Expected Uint8Array');\n if (lengths.length > 0 && !lengths.includes(b.length))\n throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`);\n}\nfunction hash(hash) {\n if (typeof hash !== 'function' || typeof hash.create !== 'function')\n throw new Error('Hash should be wrapped by utils.wrapConstructor');\n number(hash.outputLen);\n number(hash.blockLen);\n}\nfunction exists(instance, checkFinished = true) {\n if (instance.destroyed)\n throw new Error('Hash instance has been destroyed');\n if (checkFinished && instance.finished)\n throw new Error('Hash#digest() has already been called');\n}\nfunction output(out, instance) {\n bytes(out);\n const min = instance.outputLen;\n if (out.length < min) {\n throw new Error(`digestInto() expects output buffer of length at least ${min}`);\n }\n}\nexport { number, bool, bytes, hash, exists, output };\nconst assert = { number, bool, bytes, hash, exists, output };\nexport default assert;\n//# sourceMappingURL=_assert.js.map","/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+.\n// node.js versions earlier than v19 don't declare it in global scope.\n// For node.js, package.json#exports field mapping rewrites import\n// from `crypto` to `cryptoNode`, which imports native module.\n// Makes the utils un-importable in browsers without a bundler.\n// Once node.js 18 is deprecated, we can just drop the import.\nimport { crypto } from '@noble/hashes/crypto';\nconst u8a = (a) => a instanceof Uint8Array;\n// Cast array to different type\nexport const u8 = (arr) => new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\nexport const u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n// Cast array to view\nexport const createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n// The rotate right (circular right shift) operation for uint32\nexport const rotr = (word, shift) => (word << (32 - shift)) | (word >>> shift);\n// big-endian hardware is rare. Just in case someone still decides to run hashes:\n// early-throw an error because we don't support BE yet.\nexport const isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44;\nif (!isLE)\n throw new Error('Non little-endian hardware is not supported');\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));\n/**\n * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'\n */\nexport function bytesToHex(bytes) {\n if (!u8a(bytes))\n throw new Error('Uint8Array expected');\n // pre-caching improves the speed 6x\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += hexes[bytes[i]];\n }\n return hex;\n}\n/**\n * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n */\nexport function hexToBytes(hex) {\n if (typeof hex !== 'string')\n throw new Error('hex string expected, got ' + typeof hex);\n const len = hex.length;\n if (len % 2)\n throw new Error('padded hex string expected, got unpadded hex of length ' + len);\n const array = new Uint8Array(len / 2);\n for (let i = 0; i < array.length; i++) {\n const j = i * 2;\n const hexByte = hex.slice(j, j + 2);\n const byte = Number.parseInt(hexByte, 16);\n if (Number.isNaN(byte) || byte < 0)\n throw new Error('Invalid byte sequence');\n array[i] = byte;\n }\n return array;\n}\n// There is no setImmediate in browser and setTimeout is slow.\n// call of async fn will return Promise, which will be fullfiled only on\n// next scheduler queue processing step and this is exactly what we need.\nexport const nextTick = async () => { };\n// Returns control to thread each 'tick' ms to avoid blocking\nexport async function asyncLoop(iters, tick, cb) {\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick)\n continue;\n await nextTick();\n ts += diff;\n }\n}\n/**\n * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99])\n */\nexport function utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new Error(`utf8ToBytes expected string, got ${typeof str}`);\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\n/**\n * Normalizes (non-hex) string or Uint8Array to Uint8Array.\n * Warning: when Uint8Array is passed, it would NOT get copied.\n * Keep in mind for future mutable operations.\n */\nexport function toBytes(data) {\n if (typeof data === 'string')\n data = utf8ToBytes(data);\n if (!u8a(data))\n throw new Error(`expected Uint8Array, got ${typeof data}`);\n return data;\n}\n/**\n * Copies several Uint8Arrays into one.\n */\nexport function concatBytes(...arrays) {\n const r = new Uint8Array(arrays.reduce((sum, a) => sum + a.length, 0));\n let pad = 0; // walk through each item, ensure they have proper type\n arrays.forEach((a) => {\n if (!u8a(a))\n throw new Error('Uint8Array expected');\n r.set(a, pad);\n pad += a.length;\n });\n return r;\n}\n// For runtime check if class implements interface\nexport class Hash {\n // Safe version that clones internal state\n clone() {\n return this._cloneInto();\n }\n}\nconst toStr = {}.toString;\nexport function checkOpts(defaults, opts) {\n if (opts !== undefined && toStr.call(opts) !== '[object Object]')\n throw new Error('Options should be object or undefined');\n const merged = Object.assign(defaults, opts);\n return merged;\n}\nexport function wrapConstructor(hashCons) {\n const hashC = (msg) => hashCons().update(toBytes(msg)).digest();\n const tmp = hashCons();\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = () => hashCons();\n return hashC;\n}\nexport function wrapConstructorWithOpts(hashCons) {\n const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({});\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n return hashC;\n}\nexport function wrapXOFConstructorWithOpts(hashCons) {\n const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({});\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n return hashC;\n}\n/**\n * Secure PRNG. Uses `crypto.getRandomValues`, which defers to OS.\n */\nexport function randomBytes(bytesLength = 32) {\n if (crypto && typeof crypto.getRandomValues === 'function') {\n return crypto.getRandomValues(new Uint8Array(bytesLength));\n }\n throw new Error('crypto.getRandomValues must be defined');\n}\n//# sourceMappingURL=utils.js.map","const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);\nconst _32n = /* @__PURE__ */ BigInt(32);\n// We are not using BigUint64Array, because they are extremely slow as per 2022\nfunction fromBig(n, le = false) {\n if (le)\n return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };\n return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };\n}\nfunction split(lst, le = false) {\n let Ah = new Uint32Array(lst.length);\n let Al = new Uint32Array(lst.length);\n for (let i = 0; i < lst.length; i++) {\n const { h, l } = fromBig(lst[i], le);\n [Ah[i], Al[i]] = [h, l];\n }\n return [Ah, Al];\n}\nconst toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);\n// for Shift in [0, 32)\nconst shrSH = (h, _l, s) => h >>> s;\nconst shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// Right rotate for Shift in [1, 32)\nconst rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s));\nconst rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// Right rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32));\nconst rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s));\n// Right rotate for shift===32 (just swaps l&h)\nconst rotr32H = (_h, l) => l;\nconst rotr32L = (h, _l) => h;\n// Left rotate for Shift in [1, 32)\nconst rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s));\nconst rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s));\n// Left rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s));\nconst rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s));\n// JS uses 32-bit signed integers for bitwise operations which means we cannot\n// simple take carry out of low bit sum by shift, we need to use division.\nfunction add(Ah, Al, Bh, Bl) {\n const l = (Al >>> 0) + (Bl >>> 0);\n return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };\n}\n// Addition with more than 2 elements\nconst add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);\nconst add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0;\nconst add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);\nconst add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0;\nconst add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);\nconst add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;\n// prettier-ignore\nexport { fromBig, split, toBig, shrSH, shrSL, rotrSH, rotrSL, rotrBH, rotrBL, rotr32H, rotr32L, rotlSH, rotlSL, rotlBH, rotlBL, add, add3L, add3H, add4L, add4H, add5H, add5L, };\n// prettier-ignore\nconst u64 = {\n fromBig, split, toBig,\n shrSH, shrSL,\n rotrSH, rotrSL, rotrBH, rotrBL,\n rotr32H, rotr32L,\n rotlSH, rotlSL, rotlBH, rotlBL,\n add, add3L, add3H, add4L, add4H, add5H, add5L,\n};\nexport default u64;\n//# sourceMappingURL=_u64.js.map","/* Do NOT modify this file; see /src.ts/_admin/update-version.ts */\n/**\n * The current version of Ethers.\n */\nexport const version = \"6.16.0\";\n//# sourceMappingURL=_version.js.map","/**\n * Property helper functions.\n *\n * @_subsection api/utils:Properties [about-properties]\n */\nfunction checkType(value, type, name) {\n const types = type.split(\"|\").map(t => t.trim());\n for (let i = 0; i < types.length; i++) {\n switch (type) {\n case \"any\":\n return;\n case \"bigint\":\n case \"boolean\":\n case \"number\":\n case \"string\":\n if (typeof (value) === type) {\n return;\n }\n }\n }\n const error = new Error(`invalid value for type ${type}`);\n error.code = \"INVALID_ARGUMENT\";\n error.argument = `value.${name}`;\n error.value = value;\n throw error;\n}\n/**\n * Resolves to a new object that is a copy of %%value%%, but with all\n * values resolved.\n */\nexport async function resolveProperties(value) {\n const keys = Object.keys(value);\n const results = await Promise.all(keys.map((k) => Promise.resolve(value[k])));\n return results.reduce((accum, v, index) => {\n accum[keys[index]] = v;\n return accum;\n }, {});\n}\n/**\n * Assigns the %%values%% to %%target%% as read-only values.\n *\n * It %%types%% is specified, the values are checked.\n */\nexport function defineProperties(target, values, types) {\n for (let key in values) {\n let value = values[key];\n const type = (types ? types[key] : null);\n if (type) {\n checkType(value, type, key);\n }\n Object.defineProperty(target, key, { enumerable: true, value, writable: false });\n }\n}\n//# sourceMappingURL=properties.js.map","/**\n * All errors in ethers include properties to ensure they are both\n * human-readable (i.e. ``.message``) and machine-readable (i.e. ``.code``).\n *\n * The [[isError]] function can be used to check the error ``code`` and\n * provide a type guard for the properties present on that error interface.\n *\n * @_section: api/utils/errors:Errors [about-errors]\n */\nimport { version } from \"../_version.js\";\nimport { defineProperties } from \"./properties.js\";\nfunction stringify(value, seen) {\n if (value == null) {\n return \"null\";\n }\n if (seen == null) {\n seen = new Set();\n }\n if (typeof (value) === \"object\") {\n if (seen.has(value)) {\n return \"[Circular]\";\n }\n seen.add(value);\n }\n if (Array.isArray(value)) {\n return \"[ \" + (value.map((v) => stringify(v, seen))).join(\", \") + \" ]\";\n }\n if (value instanceof Uint8Array) {\n const HEX = \"0123456789abcdef\";\n let result = \"0x\";\n for (let i = 0; i < value.length; i++) {\n result += HEX[value[i] >> 4];\n result += HEX[value[i] & 0xf];\n }\n return result;\n }\n if (typeof (value) === \"object\" && typeof (value.toJSON) === \"function\") {\n return stringify(value.toJSON(), seen);\n }\n switch (typeof (value)) {\n case \"boolean\":\n case \"number\":\n case \"symbol\":\n return value.toString();\n case \"bigint\":\n return BigInt(value).toString();\n case \"string\":\n return JSON.stringify(value);\n case \"object\": {\n const keys = Object.keys(value);\n keys.sort();\n return \"{ \" + keys.map((k) => `${stringify(k, seen)}: ${stringify(value[k], seen)}`).join(\", \") + \" }\";\n }\n }\n return `[ COULD NOT SERIALIZE ]`;\n}\n/**\n * Returns true if the %%error%% matches an error thrown by ethers\n * that matches the error %%code%%.\n *\n * In TypeScript environments, this can be used to check that %%error%%\n * matches an EthersError type, which means the expected properties will\n * be set.\n *\n * @See [ErrorCodes](api:ErrorCode)\n * @example\n * try {\n * // code....\n * } catch (e) {\n * if (isError(e, \"CALL_EXCEPTION\")) {\n * // The Type Guard has validated this object\n * console.log(e.data);\n * }\n * }\n */\nexport function isError(error, code) {\n return (error && error.code === code);\n}\n/**\n * Returns true if %%error%% is a [[CallExceptionError].\n */\nexport function isCallException(error) {\n return isError(error, \"CALL_EXCEPTION\");\n}\n/**\n * Returns a new Error configured to the format ethers emits errors, with\n * the %%message%%, [[api:ErrorCode]] %%code%% and additional properties\n * for the corresponding EthersError.\n *\n * Each error in ethers includes the version of ethers, a\n * machine-readable [[ErrorCode]], and depending on %%code%%, additional\n * required properties. The error message will also include the %%message%%,\n * ethers version, %%code%% and all additional properties, serialized.\n */\nexport function makeError(message, code, info) {\n let shortMessage = message;\n {\n const details = [];\n if (info) {\n if (\"message\" in info || \"code\" in info || \"name\" in info) {\n throw new Error(`value will overwrite populated values: ${stringify(info)}`);\n }\n for (const key in info) {\n if (key === \"shortMessage\") {\n continue;\n }\n const value = (info[key]);\n // try {\n details.push(key + \"=\" + stringify(value));\n // } catch (error: any) {\n // console.log(\"MMM\", error.message);\n // details.push(key + \"=[could not serialize object]\");\n // }\n }\n }\n details.push(`code=${code}`);\n details.push(`version=${version}`);\n if (details.length) {\n message += \" (\" + details.join(\", \") + \")\";\n }\n }\n let error;\n switch (code) {\n case \"INVALID_ARGUMENT\":\n error = new TypeError(message);\n break;\n case \"NUMERIC_FAULT\":\n case \"BUFFER_OVERRUN\":\n error = new RangeError(message);\n break;\n default:\n error = new Error(message);\n }\n defineProperties(error, { code });\n if (info) {\n Object.assign(error, info);\n }\n if (error.shortMessage == null) {\n defineProperties(error, { shortMessage });\n }\n return error;\n}\n/**\n * Throws an EthersError with %%message%%, %%code%% and additional error\n * %%info%% when %%check%% is falsish..\n *\n * @see [[api:makeError]]\n */\nexport function assert(check, message, code, info) {\n if (!check) {\n throw makeError(message, code, info);\n }\n}\n/**\n * A simple helper to simply ensuring provided arguments match expected\n * constraints, throwing if not.\n *\n * In TypeScript environments, the %%check%% has been asserted true, so\n * any further code does not need additional compile-time checks.\n */\nexport function assertArgument(check, message, name, value) {\n assert(check, message, \"INVALID_ARGUMENT\", { argument: name, value: value });\n}\nexport function assertArgumentCount(count, expectedCount, message) {\n if (message == null) {\n message = \"\";\n }\n if (message) {\n message = \": \" + message;\n }\n assert(count >= expectedCount, \"missing argument\" + message, \"MISSING_ARGUMENT\", {\n count: count,\n expectedCount: expectedCount\n });\n assert(count <= expectedCount, \"too many arguments\" + message, \"UNEXPECTED_ARGUMENT\", {\n count: count,\n expectedCount: expectedCount\n });\n}\nconst _normalizeForms = [\"NFD\", \"NFC\", \"NFKD\", \"NFKC\"].reduce((accum, form) => {\n try {\n // General test for normalize\n /* c8 ignore start */\n if (\"test\".normalize(form) !== \"test\") {\n throw new Error(\"bad\");\n }\n ;\n /* c8 ignore stop */\n if (form === \"NFD\") {\n const check = String.fromCharCode(0xe9).normalize(\"NFD\");\n const expected = String.fromCharCode(0x65, 0x0301);\n /* c8 ignore start */\n if (check !== expected) {\n throw new Error(\"broken\");\n }\n /* c8 ignore stop */\n }\n accum.push(form);\n }\n catch (error) { }\n return accum;\n}, []);\n/**\n * Throws if the normalization %%form%% is not supported.\n */\nexport function assertNormalize(form) {\n assert(_normalizeForms.indexOf(form) >= 0, \"platform missing String.prototype.normalize\", \"UNSUPPORTED_OPERATION\", {\n operation: \"String.prototype.normalize\", info: { form }\n });\n}\n/**\n * Many classes use file-scoped values to guard the constructor,\n * making it effectively private. This facilitates that pattern\n * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%,\n * throwing if not, indicating the %%className%% if provided.\n */\nexport function assertPrivate(givenGuard, guard, className) {\n if (className == null) {\n className = \"\";\n }\n if (givenGuard !== guard) {\n let method = className, operation = \"new\";\n if (className) {\n method += \".\";\n operation += \" \" + className;\n }\n assert(false, `private constructor; use ${method}from* methods`, \"UNSUPPORTED_OPERATION\", {\n operation\n });\n }\n}\n//# sourceMappingURL=errors.js.map","/**\n * Some data helpers.\n *\n *\n * @_subsection api/utils:Data Helpers [about-data]\n */\nimport { assert, assertArgument } from \"./errors.js\";\nfunction _getBytes(value, name, copy) {\n if (value instanceof Uint8Array) {\n if (copy) {\n return new Uint8Array(value);\n }\n return value;\n }\n if (typeof (value) === \"string\" && (value.length % 2) === 0 &&\n value.match(/^0x[0-9a-f]*$/i)) {\n const result = new Uint8Array((value.length - 2) / 2);\n let offset = 2;\n for (let i = 0; i < result.length; i++) {\n result[i] = parseInt(value.substring(offset, offset + 2), 16);\n offset += 2;\n }\n return result;\n }\n assertArgument(false, \"invalid BytesLike value\", name || \"value\", value);\n}\n/**\n * Get a typed Uint8Array for %%value%%. If already a Uint8Array\n * the original %%value%% is returned; if a copy is required use\n * [[getBytesCopy]].\n *\n * @see: getBytesCopy\n */\nexport function getBytes(value, name) {\n return _getBytes(value, name, false);\n}\n/**\n * Get a typed Uint8Array for %%value%%, creating a copy if necessary\n * to prevent any modifications of the returned value from being\n * reflected elsewhere.\n *\n * @see: getBytes\n */\nexport function getBytesCopy(value, name) {\n return _getBytes(value, name, true);\n}\n/**\n * Returns true if %%value%% is a valid [[HexString]].\n *\n * If %%length%% is ``true`` or a //number//, it also checks that\n * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//)\n * bytes of data (e.g. ``0x1234`` is 2 bytes).\n */\nexport function isHexString(value, length) {\n if (typeof (value) !== \"string\" || !value.match(/^0x[0-9A-Fa-f]*$/)) {\n return false;\n }\n if (typeof (length) === \"number\" && value.length !== 2 + 2 * length) {\n return false;\n }\n if (length === true && (value.length % 2) !== 0) {\n return false;\n }\n return true;\n}\n/**\n * Returns true if %%value%% is a valid representation of arbitrary\n * data (i.e. a valid [[DataHexString]] or a Uint8Array).\n */\nexport function isBytesLike(value) {\n return (isHexString(value, true) || (value instanceof Uint8Array));\n}\nconst HexCharacters = \"0123456789abcdef\";\n/**\n * Returns a [[DataHexString]] representation of %%data%%.\n */\nexport function hexlify(data) {\n const bytes = getBytes(data);\n let result = \"0x\";\n for (let i = 0; i < bytes.length; i++) {\n const v = bytes[i];\n result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f];\n }\n return result;\n}\n/**\n * Returns a [[DataHexString]] by concatenating all values\n * within %%data%%.\n */\nexport function concat(datas) {\n return \"0x\" + datas.map((d) => hexlify(d).substring(2)).join(\"\");\n}\n/**\n * Returns the length of %%data%%, in bytes.\n */\nexport function dataLength(data) {\n if (isHexString(data, true)) {\n return (data.length - 2) / 2;\n }\n return getBytes(data).length;\n}\n/**\n * Returns a [[DataHexString]] by slicing %%data%% from the %%start%%\n * offset to the %%end%% offset.\n *\n * By default %%start%% is 0 and %%end%% is the length of %%data%%.\n */\nexport function dataSlice(data, start, end) {\n const bytes = getBytes(data);\n if (end != null && end > bytes.length) {\n assert(false, \"cannot slice beyond data bounds\", \"BUFFER_OVERRUN\", {\n buffer: bytes, length: bytes.length, offset: end\n });\n }\n return hexlify(bytes.slice((start == null) ? 0 : start, (end == null) ? bytes.length : end));\n}\n/**\n * Return the [[DataHexString]] result by stripping all **leading**\n ** zero bytes from %%data%%.\n */\nexport function stripZerosLeft(data) {\n let bytes = hexlify(data).substring(2);\n while (bytes.startsWith(\"00\")) {\n bytes = bytes.substring(2);\n }\n return \"0x\" + bytes;\n}\nfunction zeroPad(data, length, left) {\n const bytes = getBytes(data);\n assert(length >= bytes.length, \"padding exceeds data length\", \"BUFFER_OVERRUN\", {\n buffer: new Uint8Array(bytes),\n length: length,\n offset: length + 1\n });\n const result = new Uint8Array(length);\n result.fill(0);\n if (left) {\n result.set(bytes, length - bytes.length);\n }\n else {\n result.set(bytes, 0);\n }\n return hexlify(result);\n}\n/**\n * Return the [[DataHexString]] of %%data%% padded on the **left**\n * to %%length%% bytes.\n *\n * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is\n * thrown.\n *\n * This pads data the same as **values** are in Solidity\n * (e.g. ``uint128``).\n */\nexport function zeroPadValue(data, length) {\n return zeroPad(data, length, true);\n}\n/**\n * Return the [[DataHexString]] of %%data%% padded on the **right**\n * to %%length%% bytes.\n *\n * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is\n * thrown.\n *\n * This pads data the same as **bytes** are in Solidity\n * (e.g. ``bytes16``).\n */\nexport function zeroPadBytes(data, length) {\n return zeroPad(data, length, false);\n}\n//# sourceMappingURL=data.js.map","/**\n * Using strings in Ethereum (or any security-basd system) requires\n * additional care. These utilities attempt to mitigate some of the\n * safety issues as well as provide the ability to recover and analyse\n * strings.\n *\n * @_subsection api/utils:Strings and UTF-8 [about-strings]\n */\nimport { getBytes } from \"./data.js\";\nimport { assertArgument, assertNormalize } from \"./errors.js\";\nfunction errorFunc(reason, offset, bytes, output, badCodepoint) {\n assertArgument(false, `invalid codepoint at offset ${offset}; ${reason}`, \"bytes\", bytes);\n}\nfunction ignoreFunc(reason, offset, bytes, output, badCodepoint) {\n // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes\n if (reason === \"BAD_PREFIX\" || reason === \"UNEXPECTED_CONTINUE\") {\n let i = 0;\n for (let o = offset + 1; o < bytes.length; o++) {\n if (bytes[o] >> 6 !== 0x02) {\n break;\n }\n i++;\n }\n return i;\n }\n // This byte runs us past the end of the string, so just jump to the end\n // (but the first byte was read already read and therefore skipped)\n if (reason === \"OVERRUN\") {\n return bytes.length - offset - 1;\n }\n // Nothing to skip\n return 0;\n}\nfunction replaceFunc(reason, offset, bytes, output, badCodepoint) {\n // Overlong representations are otherwise \"valid\" code points; just non-deistingtished\n if (reason === \"OVERLONG\") {\n assertArgument(typeof (badCodepoint) === \"number\", \"invalid bad code point for replacement\", \"badCodepoint\", badCodepoint);\n output.push(badCodepoint);\n return 0;\n }\n // Put the replacement character into the output\n output.push(0xfffd);\n // Otherwise, process as if ignoring errors\n return ignoreFunc(reason, offset, bytes, output, badCodepoint);\n}\n/**\n * A handful of popular, built-in UTF-8 error handling strategies.\n *\n * **``\"error\"``** - throws on ANY illegal UTF-8 sequence or\n * non-canonical (overlong) codepoints (this is the default)\n *\n * **``\"ignore\"``** - silently drops any illegal UTF-8 sequence\n * and accepts non-canonical (overlong) codepoints\n *\n * **``\"replace\"``** - replace any illegal UTF-8 sequence with the\n * UTF-8 replacement character (i.e. ``\"\\\\ufffd\"``) and accepts\n * non-canonical (overlong) codepoints\n *\n * @returns: Record<\"error\" | \"ignore\" | \"replace\", Utf8ErrorFunc>\n */\nexport const Utf8ErrorFuncs = Object.freeze({\n error: errorFunc,\n ignore: ignoreFunc,\n replace: replaceFunc\n});\n// http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499\nfunction getUtf8CodePoints(_bytes, onError) {\n if (onError == null) {\n onError = Utf8ErrorFuncs.error;\n }\n const bytes = getBytes(_bytes, \"bytes\");\n const result = [];\n let i = 0;\n // Invalid bytes are ignored\n while (i < bytes.length) {\n const c = bytes[i++];\n // 0xxx xxxx\n if (c >> 7 === 0) {\n result.push(c);\n continue;\n }\n // Multibyte; how many bytes left for this character?\n let extraLength = null;\n let overlongMask = null;\n // 110x xxxx 10xx xxxx\n if ((c & 0xe0) === 0xc0) {\n extraLength = 1;\n overlongMask = 0x7f;\n // 1110 xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf0) === 0xe0) {\n extraLength = 2;\n overlongMask = 0x7ff;\n // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf8) === 0xf0) {\n extraLength = 3;\n overlongMask = 0xffff;\n }\n else {\n if ((c & 0xc0) === 0x80) {\n i += onError(\"UNEXPECTED_CONTINUE\", i - 1, bytes, result);\n }\n else {\n i += onError(\"BAD_PREFIX\", i - 1, bytes, result);\n }\n continue;\n }\n // Do we have enough bytes in our data?\n if (i - 1 + extraLength >= bytes.length) {\n i += onError(\"OVERRUN\", i - 1, bytes, result);\n continue;\n }\n // Remove the length prefix from the char\n let res = c & ((1 << (8 - extraLength - 1)) - 1);\n for (let j = 0; j < extraLength; j++) {\n let nextChar = bytes[i];\n // Invalid continuation byte\n if ((nextChar & 0xc0) != 0x80) {\n i += onError(\"MISSING_CONTINUE\", i, bytes, result);\n res = null;\n break;\n }\n ;\n res = (res << 6) | (nextChar & 0x3f);\n i++;\n }\n // See above loop for invalid continuation byte\n if (res === null) {\n continue;\n }\n // Maximum code point\n if (res > 0x10ffff) {\n i += onError(\"OUT_OF_RANGE\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Reserved for UTF-16 surrogate halves\n if (res >= 0xd800 && res <= 0xdfff) {\n i += onError(\"UTF16_SURROGATE\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Check for overlong sequences (more bytes than needed)\n if (res <= overlongMask) {\n i += onError(\"OVERLONG\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n result.push(res);\n }\n return result;\n}\n// http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array\n/**\n * Returns the UTF-8 byte representation of %%str%%.\n *\n * If %%form%% is specified, the string is normalized.\n */\nexport function toUtf8Bytes(str, form) {\n assertArgument(typeof (str) === \"string\", \"invalid string value\", \"str\", str);\n if (form != null) {\n assertNormalize(form);\n str = str.normalize(form);\n }\n let result = [];\n for (let i = 0; i < str.length; i++) {\n const c = str.charCodeAt(i);\n if (c < 0x80) {\n result.push(c);\n }\n else if (c < 0x800) {\n result.push((c >> 6) | 0xc0);\n result.push((c & 0x3f) | 0x80);\n }\n else if ((c & 0xfc00) == 0xd800) {\n i++;\n const c2 = str.charCodeAt(i);\n assertArgument(i < str.length && ((c2 & 0xfc00) === 0xdc00), \"invalid surrogate pair\", \"str\", str);\n // Surrogate Pair\n const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff);\n result.push((pair >> 18) | 0xf0);\n result.push(((pair >> 12) & 0x3f) | 0x80);\n result.push(((pair >> 6) & 0x3f) | 0x80);\n result.push((pair & 0x3f) | 0x80);\n }\n else {\n result.push((c >> 12) | 0xe0);\n result.push(((c >> 6) & 0x3f) | 0x80);\n result.push((c & 0x3f) | 0x80);\n }\n }\n return new Uint8Array(result);\n}\n;\n//export \nfunction _toUtf8String(codePoints) {\n return codePoints.map((codePoint) => {\n if (codePoint <= 0xffff) {\n return String.fromCharCode(codePoint);\n }\n codePoint -= 0x10000;\n return String.fromCharCode((((codePoint >> 10) & 0x3ff) + 0xd800), ((codePoint & 0x3ff) + 0xdc00));\n }).join(\"\");\n}\n/**\n * Returns the string represented by the UTF-8 data %%bytes%%.\n *\n * When %%onError%% function is specified, it is called on UTF-8\n * errors allowing recovery using the [[Utf8ErrorFunc]] API.\n * (default: [error](Utf8ErrorFuncs))\n */\nexport function toUtf8String(bytes, onError) {\n return _toUtf8String(getUtf8CodePoints(bytes, onError));\n}\n/**\n * Returns the UTF-8 code-points for %%str%%.\n *\n * If %%form%% is specified, the string is normalized.\n */\nexport function toUtf8CodePoints(str, form) {\n return getUtf8CodePoints(toUtf8Bytes(str, form));\n}\n//# sourceMappingURL=utf8.js.map","import { bytes, exists, number, output } from './_assert.js';\nimport { rotlBH, rotlBL, rotlSH, rotlSL, split } from './_u64.js';\nimport { Hash, u32, toBytes, wrapConstructor, wrapXOFConstructorWithOpts, } from './utils.js';\n// SHA3 (keccak) is based on a new design: basically, the internal state is bigger than output size.\n// It's called a sponge function.\n// Various per round constants calculations\nconst [SHA3_PI, SHA3_ROTL, _SHA3_IOTA] = [[], [], []];\nconst _0n = /* @__PURE__ */ BigInt(0);\nconst _1n = /* @__PURE__ */ BigInt(1);\nconst _2n = /* @__PURE__ */ BigInt(2);\nconst _7n = /* @__PURE__ */ BigInt(7);\nconst _256n = /* @__PURE__ */ BigInt(256);\nconst _0x71n = /* @__PURE__ */ BigInt(0x71);\nfor (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {\n // Pi\n [x, y] = [y, (2 * x + 3 * y) % 5];\n SHA3_PI.push(2 * (5 * y + x));\n // Rotational\n SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64);\n // Iota\n let t = _0n;\n for (let j = 0; j < 7; j++) {\n R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n;\n if (R & _2n)\n t ^= _1n << ((_1n << /* @__PURE__ */ BigInt(j)) - _1n);\n }\n _SHA3_IOTA.push(t);\n}\nconst [SHA3_IOTA_H, SHA3_IOTA_L] = /* @__PURE__ */ split(_SHA3_IOTA, true);\n// Left rotation (without 0, 32, 64)\nconst rotlH = (h, l, s) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s));\nconst rotlL = (h, l, s) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s));\n// Same as keccakf1600, but allows to skip some rounds\nexport function keccakP(s, rounds = 24) {\n const B = new Uint32Array(5 * 2);\n // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js)\n for (let round = 24 - rounds; round < 24; round++) {\n // Theta θ\n for (let x = 0; x < 10; x++)\n B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];\n for (let x = 0; x < 10; x += 2) {\n const idx1 = (x + 8) % 10;\n const idx0 = (x + 2) % 10;\n const B0 = B[idx0];\n const B1 = B[idx0 + 1];\n const Th = rotlH(B0, B1, 1) ^ B[idx1];\n const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];\n for (let y = 0; y < 50; y += 10) {\n s[x + y] ^= Th;\n s[x + y + 1] ^= Tl;\n }\n }\n // Rho (ρ) and Pi (π)\n let curH = s[2];\n let curL = s[3];\n for (let t = 0; t < 24; t++) {\n const shift = SHA3_ROTL[t];\n const Th = rotlH(curH, curL, shift);\n const Tl = rotlL(curH, curL, shift);\n const PI = SHA3_PI[t];\n curH = s[PI];\n curL = s[PI + 1];\n s[PI] = Th;\n s[PI + 1] = Tl;\n }\n // Chi (χ)\n for (let y = 0; y < 50; y += 10) {\n for (let x = 0; x < 10; x++)\n B[x] = s[y + x];\n for (let x = 0; x < 10; x++)\n s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];\n }\n // Iota (ι)\n s[0] ^= SHA3_IOTA_H[round];\n s[1] ^= SHA3_IOTA_L[round];\n }\n B.fill(0);\n}\nexport class Keccak extends Hash {\n // NOTE: we accept arguments in bytes instead of bits here.\n constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {\n super();\n this.blockLen = blockLen;\n this.suffix = suffix;\n this.outputLen = outputLen;\n this.enableXOF = enableXOF;\n this.rounds = rounds;\n this.pos = 0;\n this.posOut = 0;\n this.finished = false;\n this.destroyed = false;\n // Can be passed from user as dkLen\n number(outputLen);\n // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes\n if (0 >= this.blockLen || this.blockLen >= 200)\n throw new Error('Sha3 supports only keccak-f1600 function');\n this.state = new Uint8Array(200);\n this.state32 = u32(this.state);\n }\n keccak() {\n keccakP(this.state32, this.rounds);\n this.posOut = 0;\n this.pos = 0;\n }\n update(data) {\n exists(this);\n const { blockLen, state } = this;\n data = toBytes(data);\n const len = data.length;\n for (let pos = 0; pos < len;) {\n const take = Math.min(blockLen - this.pos, len - pos);\n for (let i = 0; i < take; i++)\n state[this.pos++] ^= data[pos++];\n if (this.pos === blockLen)\n this.keccak();\n }\n return this;\n }\n finish() {\n if (this.finished)\n return;\n this.finished = true;\n const { state, suffix, pos, blockLen } = this;\n // Do the padding\n state[pos] ^= suffix;\n if ((suffix & 0x80) !== 0 && pos === blockLen - 1)\n this.keccak();\n state[blockLen - 1] ^= 0x80;\n this.keccak();\n }\n writeInto(out) {\n exists(this, false);\n bytes(out);\n this.finish();\n const bufferOut = this.state;\n const { blockLen } = this;\n for (let pos = 0, len = out.length; pos < len;) {\n if (this.posOut >= blockLen)\n this.keccak();\n const take = Math.min(blockLen - this.posOut, len - pos);\n out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);\n this.posOut += take;\n pos += take;\n }\n return out;\n }\n xofInto(out) {\n // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF\n if (!this.enableXOF)\n throw new Error('XOF is not possible for this instance');\n return this.writeInto(out);\n }\n xof(bytes) {\n number(bytes);\n return this.xofInto(new Uint8Array(bytes));\n }\n digestInto(out) {\n output(out, this);\n if (this.finished)\n throw new Error('digest() was already called');\n this.writeInto(out);\n this.destroy();\n return out;\n }\n digest() {\n return this.digestInto(new Uint8Array(this.outputLen));\n }\n destroy() {\n this.destroyed = true;\n this.state.fill(0);\n }\n _cloneInto(to) {\n const { blockLen, suffix, outputLen, rounds, enableXOF } = this;\n to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds));\n to.state32.set(this.state32);\n to.pos = this.pos;\n to.posOut = this.posOut;\n to.finished = this.finished;\n to.rounds = rounds;\n // Suffix can change in cSHAKE\n to.suffix = suffix;\n to.outputLen = outputLen;\n to.enableXOF = enableXOF;\n to.destroyed = this.destroyed;\n return to;\n }\n}\nconst gen = (suffix, blockLen, outputLen) => wrapConstructor(() => new Keccak(blockLen, suffix, outputLen));\nexport const sha3_224 = /* @__PURE__ */ gen(0x06, 144, 224 / 8);\n/**\n * SHA3-256 hash function\n * @param message - that would be hashed\n */\nexport const sha3_256 = /* @__PURE__ */ gen(0x06, 136, 256 / 8);\nexport const sha3_384 = /* @__PURE__ */ gen(0x06, 104, 384 / 8);\nexport const sha3_512 = /* @__PURE__ */ gen(0x06, 72, 512 / 8);\nexport const keccak_224 = /* @__PURE__ */ gen(0x01, 144, 224 / 8);\n/**\n * keccak-256 hash function. Different from SHA3-256.\n * @param message - that would be hashed\n */\nexport const keccak_256 = /* @__PURE__ */ gen(0x01, 136, 256 / 8);\nexport const keccak_384 = /* @__PURE__ */ gen(0x01, 104, 384 / 8);\nexport const keccak_512 = /* @__PURE__ */ gen(0x01, 72, 512 / 8);\nconst genShake = (suffix, blockLen, outputLen) => wrapXOFConstructorWithOpts((opts = {}) => new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true));\nexport const shake128 = /* @__PURE__ */ genShake(0x1f, 168, 128 / 8);\nexport const shake256 = /* @__PURE__ */ genShake(0x1f, 136, 256 / 8);\n//# sourceMappingURL=sha3.js.map","/**\n * Cryptographic hashing functions\n *\n * @_subsection: api/crypto:Hash Functions [about-crypto-hashing]\n */\nimport { keccak_256 } from \"@noble/hashes/sha3\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _keccak256 = function (data) {\n return keccak_256(data);\n};\nlet __keccak256 = _keccak256;\n/**\n * Compute the cryptographic KECCAK256 hash of %%data%%.\n *\n * The %%data%% **must** be a data representation, to compute the\n * hash of UTF-8 data use the [[id]] function.\n *\n * @returns DataHexstring\n * @example:\n * keccak256(\"0x\")\n * //_result:\n *\n * keccak256(\"0x1337\")\n * //_result:\n *\n * keccak256(new Uint8Array([ 0x13, 0x37 ]))\n * //_result:\n *\n * // Strings are assumed to be DataHexString, otherwise it will\n * // throw. To hash UTF-8 data, see the note above.\n * keccak256(\"Hello World\")\n * //_error:\n */\nexport function keccak256(_data) {\n const data = getBytes(_data, \"data\");\n return hexlify(__keccak256(data));\n}\nkeccak256._ = _keccak256;\nkeccak256.lock = function () { locked = true; };\nkeccak256.register = function (func) {\n if (locked) {\n throw new TypeError(\"keccak256 is locked\");\n }\n __keccak256 = func;\n};\nObject.freeze(keccak256);\n//# sourceMappingURL=keccak.js.map","import { keccak256 } from \"../crypto/index.js\";\nimport { toUtf8Bytes } from \"../utils/index.js\";\n/**\n * A simple hashing function which operates on UTF-8 strings to\n * compute an 32-byte identifier.\n *\n * This simply computes the [UTF-8 bytes](toUtf8Bytes) and computes\n * the [[keccak256]].\n *\n * @example:\n * id(\"hello world\")\n * //_result:\n */\nexport function id(value) {\n return keccak256(toUtf8Bytes(value));\n}\n//# sourceMappingURL=id.js.map","import { assertArgument } from \"../utils/index.js\";\nconst subsChrs = \" !#$%&'()*+,-./<=>?@[]^_`{|}~\";\nconst Word = /^[a-z]*$/i;\nfunction unfold(words, sep) {\n let initial = 97;\n return words.reduce((accum, word) => {\n if (word === sep) {\n initial++;\n }\n else if (word.match(Word)) {\n accum.push(String.fromCharCode(initial) + word);\n }\n else {\n initial = 97;\n accum.push(word);\n }\n return accum;\n }, []);\n}\n/**\n * @_ignore\n */\nexport function decode(data, subs) {\n // Replace all the substitutions with their expanded form\n for (let i = subsChrs.length - 1; i >= 0; i--) {\n data = data.split(subsChrs[i]).join(subs.substring(2 * i, 2 * i + 2));\n }\n // Get all tle clumps; each suffix, first-increment and second-increment\n const clumps = [];\n const leftover = data.replace(/(:|([0-9])|([A-Z][a-z]*))/g, (all, item, semi, word) => {\n if (semi) {\n for (let i = parseInt(semi); i >= 0; i--) {\n clumps.push(\";\");\n }\n }\n else {\n clumps.push(item.toLowerCase());\n }\n return \"\";\n });\n /* c8 ignore start */\n if (leftover) {\n throw new Error(`leftovers: ${JSON.stringify(leftover)}`);\n }\n /* c8 ignore stop */\n return unfold(unfold(clumps, \";\"), \":\");\n}\n/**\n * @_ignore\n */\nexport function decodeOwl(data) {\n assertArgument(data[0] === \"0\", \"unsupported auwl data\", \"data\", data);\n return decode(data.substring(1 + 2 * subsChrs.length), data.substring(1, 1 + 2 * subsChrs.length));\n}\n//# sourceMappingURL=decode-owl.js.map","import { defineProperties } from \"../utils/index.js\";\n/**\n * A Wordlist represents a collection of language-specific\n * words used to encode and devoce [[link-bip-39]] encoded data\n * by mapping words to 11-bit values and vice versa.\n */\nexport class Wordlist {\n locale;\n /**\n * Creates a new Wordlist instance.\n *\n * Sub-classes MUST call this if they provide their own constructor,\n * passing in the locale string of the language.\n *\n * Generally there is no need to create instances of a Wordlist,\n * since each language-specific Wordlist creates an instance and\n * there is no state kept internally, so they are safe to share.\n */\n constructor(locale) {\n defineProperties(this, { locale });\n }\n /**\n * Sub-classes may override this to provide a language-specific\n * method for spliting %%phrase%% into individual words.\n *\n * By default, %%phrase%% is split using any sequences of\n * white-space as defined by regular expressions (i.e. ``/\\s+/``).\n */\n split(phrase) {\n return phrase.toLowerCase().split(/\\s+/g);\n }\n /**\n * Sub-classes may override this to provider a language-specific\n * method for joining %%words%% into a phrase.\n *\n * By default, %%words%% are joined by a single space.\n */\n join(words) {\n return words.join(\" \");\n }\n}\n//# sourceMappingURL=wordlist.js.map","// Use the encode-latin.js script to create the necessary\n// data files to be consumed by this class\nimport { id } from \"../hash/index.js\";\nimport { assertArgument } from \"../utils/index.js\";\nimport { decodeOwl } from \"./decode-owl.js\";\nimport { Wordlist } from \"./wordlist.js\";\n/**\n * An OWL format Wordlist is an encoding method that exploits\n * the general locality of alphabetically sorted words to\n * achieve a simple but effective means of compression.\n *\n * This class is generally not useful to most developers as\n * it is used mainly internally to keep Wordlists for languages\n * based on ASCII-7 small.\n *\n * If necessary, there are tools within the ``generation/`` folder\n * to create the necessary data.\n */\nexport class WordlistOwl extends Wordlist {\n #data;\n #checksum;\n /**\n * Creates a new Wordlist for %%locale%% using the OWL %%data%%\n * and validated against the %%checksum%%.\n */\n constructor(locale, data, checksum) {\n super(locale);\n this.#data = data;\n this.#checksum = checksum;\n this.#words = null;\n }\n /**\n * The OWL-encoded data.\n */\n get _data() { return this.#data; }\n /**\n * Decode all the words for the wordlist.\n */\n _decodeWords() {\n return decodeOwl(this.#data);\n }\n #words;\n #loadWords() {\n if (this.#words == null) {\n const words = this._decodeWords();\n // Verify the computed list matches the official list\n const checksum = id(words.join(\"\\n\") + \"\\n\");\n /* c8 ignore start */\n if (checksum !== this.#checksum) {\n throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);\n }\n /* c8 ignore stop */\n this.#words = words;\n }\n return this.#words;\n }\n getWord(index) {\n const words = this.#loadWords();\n assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n return words[index];\n }\n getWordIndex(word) {\n return this.#loadWords().indexOf(word);\n }\n}\n//# sourceMappingURL=wordlist-owl.js.map","import { WordlistOwl } from \"./wordlist-owl.js\";\nconst words = \"0itatkastcenaovo$taouleraeki&chor*teci%enbalodaeladet'!Chn=0Di#%E%^1Resa2Rese3CeT'#0EjKohol0Pu)%0A&sDul#Ekdo)Ke)Ti#Ul|3}aOgan%0FaltI$@tPi,%TmaTronom0LasL{i#Ol0Tobus4Yl:B#}R'?TaUb_U/!U^U+Ur!Xer2A^v#Ambo,An#AtrEp)Ike)KoLohOnzOskevUn{#Usin#Z^Zy2Bl.Bn|})D _D#D'aF{Jar(Kv?LdokLvaN^NkrRzaTikVolZola3D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9f8917d39d6b1f076b2bb4d2fac1a\";\nlet wordlist = null;\n/**\n * The [[link-bip39-cz]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangCz extends WordlistOwl {\n /**\n * Creates a new instance of the Czech language Wordlist.\n *\n * Using the constructor should be unnecessary, instead use the\n * [[wordlist]] singleton method.\n *\n * @_ignore:\n */\n constructor() { super(\"cz\", words, checksum); }\n /**\n * Returns a singleton instance of a ``LangCz``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangCz();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-cz.js.map","const Base64 = \")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_\";\n/**\n * @_ignore\n */\nexport function decodeBits(width, data) {\n const maxValue = (1 << width) - 1;\n const result = [];\n let accum = 0, bits = 0, flood = 0;\n for (let i = 0; i < data.length; i++) {\n // Accumulate 6 bits of data\n accum = ((accum << 6) | Base64.indexOf(data[i]));\n bits += 6;\n // While we have enough for a word...\n while (bits >= width) {\n // ...read the word\n const value = (accum >> (bits - width));\n accum &= (1 << (bits - width)) - 1;\n bits -= width;\n // A value of 0 indicates we exceeded maxValue, it\n // floods over into the next value\n if (value === 0) {\n flood += maxValue;\n }\n else {\n result.push(value + flood);\n flood = 0;\n }\n }\n }\n return result;\n}\n//# sourceMappingURL=bit-reader.js.map","import { assertArgument } from \"../utils/index.js\";\nimport { decodeBits } from \"./bit-reader.js\";\nimport { decodeOwl } from \"./decode-owl.js\";\n/**\n * @_ignore\n */\nexport function decodeOwlA(data, accents) {\n let words = decodeOwl(data).join(\",\");\n // Inject the accents\n accents.split(/,/g).forEach((accent) => {\n const match = accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);\n assertArgument(match !== null, \"internal error parsing accents\", \"accents\", accents);\n let posOffset = 0;\n const positions = decodeBits(parseInt(match[3]), match[4]);\n const charCode = parseInt(match[2]);\n const regex = new RegExp(`([${match[1]}])`, \"g\");\n words = words.replace(regex, (all, letter) => {\n const rem = --positions[posOffset];\n if (rem === 0) {\n letter = String.fromCharCode(letter.charCodeAt(0), charCode);\n posOffset++;\n }\n return letter;\n });\n });\n return words.split(\",\");\n}\n//# sourceMappingURL=decode-owla.js.map","import { WordlistOwl } from \"./wordlist-owl.js\";\nimport { decodeOwlA } from \"./decode-owla.js\";\n/**\n * An OWL-A format Wordlist extends the OWL format to add an\n * overlay onto an OWL format Wordlist to support diacritic\n * marks.\n *\n * This class is generally not useful to most developers as\n * it is used mainly internally to keep Wordlists for languages\n * based on latin-1 small.\n *\n * If necessary, there are tools within the ``generation/`` folder\n * to create the necessary data.\n */\nexport class WordlistOwlA extends WordlistOwl {\n #accent;\n /**\n * Creates a new Wordlist for %%locale%% using the OWLA %%data%%\n * and %%accent%% data and validated against the %%checksum%%.\n */\n constructor(locale, data, accent, checksum) {\n super(locale, data, checksum);\n this.#accent = accent;\n }\n /**\n * The OWLA-encoded accent data.\n */\n get _accent() { return this.#accent; }\n /**\n * Decode all the words for the wordlist.\n */\n _decodeWords() {\n return decodeOwlA(this._data, this._accent);\n }\n}\n//# sourceMappingURL=wordlist-owla.js.map","import { WordlistOwlA } from \"./wordlist-owla.js\";\nconst words = \"0arertoiotadonoaRteirroenaNonaLsolocoiliaralaorrenadaChoN$n0A>Dom,EjaI!#Oga&O'Or#RazoR*Ue=U<0Ab Adem@CeLe%OmoRa!RozUn0DazD$GeLaM,#S,)T^0AlAnceA+EEl]`E`EstruzI.I<2ErU{U'0Af[nArO)Uc Uf_Ul:BaB^|eH@IleJ Lanz/c.LdeMbuN>Nd-oRb(>RnizR+Scu]S#nSu[Tal]T!@T*Tu%UlZ 3BeBid/=S SoSt@3|oEnNgo2An>OqueUsa2ABi`BoCaCi`DaDegaIn//!oLsaMb-{dNi#N}saiRdeRr SqueTeTinVe{Zal2AvoAzoEchaEveIl=In>IsaOcaOmaOnceO)UjaUs>U#2CeoCleE'E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ai!0E'Or/t1F_}Fic>Fr*0Ive1Se|S`l$2Fac%fIv>0Bra.Ett!0Ct){Du]E!{Iri^1A#A^Er Ini$PortunPrim T Ti^1A.{An.Bi&D$n E`#G/eG)`Ifi-Ne?ntQ)T+0C`]MoPo,PyrusRadoxeR-l#ResIss$Iv!Lai!Lic>L#nLyg$eMma@Mp>Nct)lNd NeyR%^Si%$SZz#3Rami@:99AsarE!l#Es%$Ietu@It,O%_t:C(eC$,D+{G$d(I@'Is(L_%rLl$.Mas}Pi@Sa.Tis}Vag V(Y$n 3Ac%fAg*Ali}Anim Cevo*Ci,Clam Col,Cru,Cu]Cyc]Dig Dou,Fai!F#xeForm Fra(Fu.G=+nGi$Gla.Gul>I, Je,Jou La%fLev L+fMar^Me@MiPor,Prie5Che{M/-Mp!N-Nd(Se|S>Ta%fTorTu#U.U`#U#|U%[Y|?5B/BisCheEl#G){In Is<|S S%^3Th?:B]Bo,B!Co~eFariGesRcas?Rd(eT' Ug!nuUm$U,Uva.V/tV$n 1AlpelAnda#E]atEnarioEpt!HemaI_-Ind O!Ru%nUlp,1An-Cab#Ch Cou C!,Da%fDui!Ig['Jo'Lec%fMa(eMb]M_-M(=Na&'Nsib#N&n-Par Q)n-Re(R.ntR+{Rru!RumRvi-Sa?V*Vra.Xtup#3D =Ec#Eg Ff]G#Gn=L_-LiciumMp#Nc eNist!Ph$RopSmi^Tu 1I 3Ci=C#DiumIg[{LdatLe`Litu@Lub#Mb!M?`Mno]N@N.'N[t&No!Rc>R%rS+T%Rfa-Rica&R?n RpriC%#Il]L_tLism/L$n Mbo'Mi}Ngib#PisQu( Rd RifR%[SI$I^Itai!Iv s3AniumBa(Tic/t0A.I[UelU!0I#Op+:Car?Cc(Gab$dG)Ill/tInc!Is<|Lab#LiSe{Ss=S&3C&'Det&Get=Hicu#InardLo-Nd!diN Ng Ni?{Ntou b) {\n return 1;\n }\n return 0;\n }\n // Load all the words\n for (let length = 3; length <= 9; length++) {\n const d = data[length - 3];\n for (let offset = 0; offset < d.length; offset += length) {\n const word = [];\n for (let i = 0; i < length; i++) {\n const k = mapping.indexOf(d[offset + i]);\n word.push(227);\n word.push((k & 0x40) ? 130 : 129);\n word.push((k & 0x3f) + 128);\n }\n wordlist.push(toString(word));\n }\n }\n wordlist.sort(sortJapanese);\n // For some reason kyoku and kiyoku are flipped in node (!!).\n // The order SHOULD be:\n // - kyoku\n // - kiyoku\n // This should ignore \"if\", but that doesn't work here??\n /* c8 ignore start */\n if (hex(wordlist[442]) === KiYoKu && hex(wordlist[443]) === KyoKu) {\n const tmp = wordlist[442];\n wordlist[442] = wordlist[443];\n wordlist[443] = tmp;\n }\n /* c8 ignore stop */\n // Verify the computed list matches the official list\n /* istanbul ignore if */\n const checksum = id(wordlist.join(\"\\n\") + \"\\n\");\n /* c8 ignore start */\n if (checksum !== \"0xcb36b09e6baa935787fd762ce65e80b0c6a8dabdfbc3a7f86ac0e2c4fd111600\") {\n throw new Error(\"BIP39 Wordlist for ja (Japanese) FAILED\");\n }\n /* c8 ignore stop */\n _wordlist = wordlist;\n return wordlist;\n}\nlet wordlist = null;\n/**\n * The [[link-bip39-ja]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangJa extends Wordlist {\n /**\n * Creates a new instance of the Japanese language Wordlist.\n *\n * This should be unnecessary most of the time as the exported\n * [[langJa]] should suffice.\n *\n * @_ignore:\n */\n constructor() { super(\"ja\"); }\n getWord(index) {\n const words = loadWords();\n assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n return words[index];\n }\n getWordIndex(word) {\n return loadWords().indexOf(word);\n }\n split(phrase) {\n //logger.assertNormalize();\n return phrase.split(/(?:\\u3000| )+/g);\n }\n join(words) {\n return words.join(\"\\u3000\");\n }\n /**\n * Returns a singleton instance of a ``LangJa``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangJa();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-ja.js.map","import { id } from \"../hash/index.js\";\nimport { assertArgument, toUtf8String } from \"../utils/index.js\";\nimport { Wordlist } from \"./wordlist.js\";\nconst data = [\n \"OYAa\",\n \"ATAZoATBl3ATCTrATCl8ATDloATGg3ATHT8ATJT8ATJl3ATLlvATLn4ATMT8ATMX8ATMboATMgoAToLbAToMTATrHgATvHnAT3AnAT3JbAT3MTAT8DbAT8JTAT8LmAT8MYAT8MbAT#LnAUHT8AUHZvAUJXrAUJX8AULnrAXJnvAXLUoAXLgvAXMn6AXRg3AXrMbAX3JTAX3QbAYLn3AZLgvAZrSUAZvAcAZ8AaAZ8AbAZ8AnAZ8HnAZ8LgAZ8MYAZ8MgAZ8OnAaAboAaDTrAaFTrAaJTrAaJboAaLVoAaMXvAaOl8AaSeoAbAUoAbAg8AbAl4AbGnrAbMT8AbMXrAbMn4AbQb8AbSV8AbvRlAb8AUAb8AnAb8HgAb8JTAb8NTAb8RbAcGboAcLnvAcMT8AcMX8AcSToAcrAaAcrFnAc8AbAc8MgAfGgrAfHboAfJnvAfLV8AfLkoAfMT8AfMnoAfQb8AfScrAfSgrAgAZ8AgFl3AgGX8AgHZvAgHgrAgJXoAgJX8AgJboAgLZoAgLn4AgOX8AgoATAgoAnAgoCUAgoJgAgoLXAgoMYAgoSeAgrDUAgrJTAhrFnAhrLjAhrQgAjAgoAjJnrAkMX8AkOnoAlCTvAlCV8AlClvAlFg4AlFl6AlFn3AloSnAlrAXAlrAfAlrFUAlrFbAlrGgAlrOXAlvKnAlvMTAl3AbAl3MnAnATrAnAcrAnCZ3AnCl8AnDg8AnFboAnFl3AnHX4AnHbrAnHgrAnIl3AnJgvAnLXoAnLX4AnLbrAnLgrAnLhrAnMXoAnMgrAnOn3AnSbrAnSeoAnvLnAn3OnCTGgvCTSlvCTvAUCTvKnCTvNTCT3CZCT3GUCT3MTCT8HnCUCZrCULf8CULnvCU3HnCU3JUCY6NUCbDb8CbFZoCbLnrCboOTCboScCbrFnCbvLnCb8AgCb8HgCb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MXoSUrDlHUoScvHTvSnSfLkvMXo\",\n \"AUoAcrMXoAZ8HboAg8AbOg6ATFgAg8AloMXoAl3AT8JTrAl8MX8MXoCT3SToJU8Cl8Db8MXoDT8HgrATrDboOT8MXoGTOTrATMnGT8LhrAZ8GnvFnGnQXHToGgvAcrHTvAXvLl3HbrAZoMXoHgBlFXLg3HgMnFXrSnHgrSb8JUoHn6HT8LgvITvATrJUoJUoLZrRnvJU8HT8Jb8JXvFX8QT8JXvLToJTrJYrQnGnQXJgrJnoATrJnoJU8ScvJnvMnvMXoLTCTLgrJXLTJlRTvQlLbRnJlQYvLbrMb8LnvLbvFn3RnoLdCVSTGZrLeSTvGXCnLg3MnoLn3MToLlrETvMT8SToAl3MbrDU6GTvMb8LX4LhrPlrLXGXCnSToLf8Rg3STrDb8LTrSTvLTHXMnSb3RYLnMnSgOg6ATFg\",\n \"HUDlGnrQXrJTrHgLnrAcJYMb8DULc8LTvFgGnCk3Mg8JbAnLX4QYvFYHnMXrRUoJnGnvFnRlvFTJlQnoSTrBXHXrLYSUJgLfoMT8Se8DTrHbDb\",\n \"AbDl8SToJU8An3RbAb8ST8DUSTrGnrAgoLbFU6Db8LTrMg8AaHT8Jb8ObDl8SToJU8Pb3RlvFYoJl\"\n];\nconst codes = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*\";\nfunction getHangul(code) {\n if (code >= 40) {\n code = code + 168 - 40;\n }\n else if (code >= 19) {\n code = code + 97 - 19;\n }\n return toUtf8String(new Uint8Array([225, (code >> 6) + 132, (code & 0x3f) + 128]));\n}\nlet _wordlist = null;\nfunction loadWords() {\n if (_wordlist != null) {\n return _wordlist;\n }\n const wordlist = [];\n data.forEach((data, length) => {\n length += 4;\n for (let i = 0; i < data.length; i += length) {\n let word = \"\";\n for (let j = 0; j < length; j++) {\n word += getHangul(codes.indexOf(data[i + j]));\n }\n wordlist.push(word);\n }\n });\n wordlist.sort();\n // Verify the computed list matches the official list\n /* istanbul ignore if */\n const checksum = id(wordlist.join(\"\\n\") + \"\\n\");\n /* c8 ignore start */\n if (checksum !== \"0xf9eddeace9c5d3da9c93cf7d3cd38f6a13ed3affb933259ae865714e8a3ae71a\") {\n throw new Error(\"BIP39 Wordlist for ko (Korean) FAILED\");\n }\n /* c8 ignore stop */\n _wordlist = wordlist;\n return wordlist;\n}\nlet wordlist = null;\n/**\n * The [[link-bip39-ko]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangKo extends Wordlist {\n /**\n * Creates a new instance of the Korean language Wordlist.\n *\n * This should be unnecessary most of the time as the exported\n * [[langKo]] should suffice.\n *\n * @_ignore:\n */\n constructor() {\n super(\"ko\");\n }\n getWord(index) {\n const words = loadWords();\n assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n return words[index];\n }\n getWordIndex(word) {\n return loadWords().indexOf(word);\n }\n /**\n * Returns a singleton instance of a ``LangKo``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangKo();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-ko.js.map","import { WordlistOwl } from \"./wordlist-owl.js\";\nconst words = \"0torea noica!iosorolotaleratelanena%oiadoencotivomai t ca%a0A]Bagl'Bin#E.Is(Oli!Rasi_Rog#0Cade!C[$Cus#E Roba+U 0Ag'Deb{DomeEgu#Eri!IpeOtt&Ul&1Fabi,Fe|Fis(F-n Oris`O(R~$0AveEn.E_,Ganc'I!It&OnismoR>*Rume Uzzo4AbardaA Bat)Ber#BoBumeCeCol>E|Ertu-OdePari!Pe^ Pogg'P)@Pun Ri,1Ab~AchideAgos+Ald~Anc'Atu-AzzoBit)Chiv'D{Eni,G[ GiSoTef%eZil*0Ciu|Col EpsiEtt>Fal I$O/Pir#P)Sagg'SeSolu Sur@TaT[u T%eT-|0Av>EismoOm>O$TesaTiv&Tor$Tr{Tua,0Sil'Str?Tis+To$moTun$0Anz#E!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u,n S](S'5Cche)Fo*LuPpa\";\nconst checksum = \"0x5c1362d88fd4cf614a96f3234941d29f7d37c08c5292fde03bf62c2db6ff7620\";\nlet wordlist = null;\n/**\n * The [[link-bip39-it]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangIt extends WordlistOwl {\n /**\n * Creates a new instance of the Italian language Wordlist.\n *\n * This should be unnecessary most of the time as the exported\n * [[langIt]] should suffice.\n *\n * @_ignore:\n */\n constructor() { super(\"it\", words, checksum); }\n /**\n * Returns a singleton instance of a ``LangIt``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangIt();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-it.js.map","import { WordlistOwl } from \"./wordlist-owl.js\";\nconst words = \"0arad!ototealirertainrasoent hoandoaR#riareha!aroele'oronul0Aca%AixoAl A%rDuz'El]Er$IsmoO$ Rum S-&T(i&TigoVo[=0F&.Il#P' S?S* So&/Sun$Tr&0Ac#Adu+Al/A[f E End(Er_EuIng'Ir?IvoOl{oRac Revi=RizU&Um0Di$rM-.R>o+TismoT|@Tu 0Ali An%Ar@Ent&Es,I?Is Ul,1Ila1Ar E=Ei%Ulejo:B BosaC&]uCh `C@GagemI+c>~/Se#S)n%Ta)Te=rTidaTomTuc Unil]3B(IjoIr^IsebolLd!eLezaLgaLisc Ndi$Ng&aNz(RimbauRl*d>_Sou_XigaZ(_3CoCu=En&Foc&Furc G|naLhe%Mest[Mo$rOlog@OmboOsf(aPol Rr-$Scoi$Sne$SpoSsex$TolaZ _2Ind#OcoOque 2A$BagemC#CejoChec]Ico.L^LetimL]LoMb{oNdeNecoNi)Rb~h>d>e&R+c]V*oXe?2AncoAsaAvezaEuIgaIl/Inc OaOchu+Onze O$Uxo2C]DismoF LeRacoScaS$Z*a:Bimb Rn{oRpe%R['>)zRv&/SacoScaSeb[S%loS~oT a)Tiv UleUs?U%l V&oV(na3BolaDil]G}]Lebr L~ Nou+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Us 3C~i D& Dest[D@t+D+G^I$r&IxeLeLicplexoRsi<>%nceRucaSc#SquisaS,aTisc 3AdaC#Ed!eGm-$Last+Lh#Lo.M-)Nc`NguimN]No%N.On{oPocaQue%ResRue)Sc S$laTg-$Rje)Tur Ud!eXof}eZ}&3C C~ DaD-$Di#Do,Du$rGm-$G[=Gun=IvaLe$LvagemM<&M-%N?N/rNsu&Nt#P #Rei>*g>+RvoTemb_T|3GiloLhue)Lic}eMetr@Mpat@M~ N&Nc(oNg~ NopseN$ni>-eRiTu#5B(fis)Rp[s>[&Rt'Sp'oS%n$:B`aBle%Bu^C/G `aLh(LoLvezMdioRef>j>+xaTuagemUr*oXativoXis)3Atr&C(Ci=Cl#Dio,IaIm Lef}eLh#Mp(oN-%N,rN.Rm&RnoRr-oSeSou+St#ToXtu+Xugo3A+G`aJoloMbr MidezNgi=N%'oRagemT~ 5Al]C]L( LiceM^Mil/N`Ntu+Pe%R>ci=RneioRqueRr!>$S.UcaUp{aX*a2Ab&/Acej Adu$rAfeg Aje$AmaAnc ApoAs{oAt?Av E*oEm(Epid EvoIagemIboIcicloId-%Ilog@Ind!eIploItur Iunf&Oc Ombe)OvaUnfoUque2B~ CquesaT` T|i&:7V 3Bigo0HaId!eIf|me3Olog@SoTigaUbu0A=InaUfru':C*aDi G o,I=,LaL-%Lid!eLo[sN)gemQu{oRe)Rr(Sc~ Sil]S,u+Z Zio3A=D Ge.Ic~ L{oLhiceLu=Nce=rNdav&N( Nt[Rb&Rd!eRe?Rg}h>m`/RnizRs R%n%SpaSti=T|i&3Adu$AgemAj Atu+Br?D{aDr @ElaGaG-%Gi G| L ejoNcoNhe)NilOle)R!>tudeSi.S$Tr&V{oZ*/5A=rArG&L<%LeibolL)gemLumo,Nt!e5L$Vuz`a::D[zRope3QueRe.Rife3Ng ::Ng#Rp 3BuL?9Mb Olog@5Mbi=\";\nconst checksum = \"0x2219000926df7b50d8aa0a3d495826b988287df4657fbd100e6fe596c8f737ac\";\nlet wordlist = null;\n/**\n * The [[link-bip39-pt]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangPt extends WordlistOwl {\n /**\n * Creates a new instance of the Portuguese language Wordlist.\n *\n * This should be unnecessary most of the time as the exported\n * [[langPt]] should suffice.\n *\n * @_ignore:\n */\n constructor() { super(\"pt\", words, checksum); }\n /**\n * Returns a singleton instance of a ``LangPt``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangPt();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-pt.js.map","import { id } from \"../hash/index.js\";\nimport { assertArgument, toUtf8String } from \"../utils/index.js\";\nimport { Wordlist } from \"./wordlist.js\";\nconst data = \"}aE#4A=Yv&co#4N#6G=cJ&SM#66|/Z#4t&kn~46#4K~4q%b9=IR#7l,mB#7W_X2*dl}Uo~7s}Uf&Iw#9c&cw~6O&H6&wx&IG%v5=IQ~8a&Pv#47$PR&50%Ko&QM&3l#5f,D9#4L|/H&tQ;v0~6n]nN?\";\nfunction loadWords(locale) {\n if (_wordlist[locale] != null) {\n return _wordlist[locale];\n }\n const wordlist = [];\n let deltaOffset = 0;\n for (let i = 0; i < 2048; i++) {\n const s = style.indexOf(data[i * 3]);\n const bytes = [\n 228 + (s >> 2),\n 128 + codes.indexOf(data[i * 3 + 1]),\n 128 + codes.indexOf(data[i * 3 + 2]),\n ];\n if (locale === \"zh_tw\") {\n const common = s % 4;\n for (let i = common; i < 3; i++) {\n bytes[i] = codes.indexOf(deltaData[deltaOffset++]) + ((i == 0) ? 228 : 128);\n }\n }\n wordlist.push(toUtf8String(new Uint8Array(bytes)));\n }\n // Verify the computed list matches the official list\n const checksum = id(wordlist.join(\"\\n\") + \"\\n\");\n /* c8 ignore start */\n if (checksum !== Checks[locale]) {\n throw new Error(`BIP39 Wordlist for ${locale} (Chinese) FAILED`);\n }\n /* c8 ignore stop */\n _wordlist[locale] = wordlist;\n return wordlist;\n}\nconst wordlists = {};\n/**\n * The [[link-bip39-zh_cn]] and [[link-bip39-zh_tw]] for\n * [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangZh extends Wordlist {\n /**\n * Creates a new instance of the Chinese language Wordlist for\n * the %%dialect%%, either ``\"cn\"`` or ``\"tw\"`` for simplified\n * or traditional, respectively.\n *\n * This should be unnecessary most of the time as the exported\n * [[langZhCn]] and [[langZhTw]] should suffice.\n *\n * @_ignore:\n */\n constructor(dialect) { super(\"zh_\" + dialect); }\n getWord(index) {\n const words = loadWords(this.locale);\n assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n return words[index];\n }\n getWordIndex(word) {\n return loadWords(this.locale).indexOf(word);\n }\n split(phrase) {\n phrase = phrase.replace(/(?:\\u3000| )+/g, \"\");\n return phrase.split(\"\");\n }\n /**\n * Returns a singleton instance of a ``LangZh`` for %%dialect%%,\n * creating it if this is the first time being called.\n *\n * Use the %%dialect%% ``\"cn\"`` or ``\"tw\"`` for simplified or\n * traditional, respectively.\n */\n static wordlist(dialect) {\n if (wordlists[dialect] == null) {\n wordlists[dialect] = new LangZh(dialect);\n }\n return wordlists[dialect];\n }\n}\n//# sourceMappingURL=lang-zh.js.map"],"names":["words","checksum","wordlist","accents","data","_wordlist","loadWords","codes"],"mappings":"AAAA,SAAS,MAAM,CAAC,CAAC,EAAE;AACnB,IAAI,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;AACzC,QAAQ,MAAM,IAAI,KAAK,CAAC,CAAC,wBAAwB,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AACxD,CAAC;AAKD,SAAS,KAAK,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE;AAC9B,IAAI,IAAI,EAAE,CAAC,YAAY,UAAU,CAAC;AAClC,QAAQ,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;AAC/C,IAAI,IAAI,OAAO,CAAC,MAAM,GAAG,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AAO,CAAC,IAAI,CAAC,CAAC;AACpD,KAAK;AACL,IAAI,KAAK,CAAC,MAAM,EAAE;AAClB,QAAQ,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;AACtD,QAAQ,OAAO,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAChC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,QAAQ,CAAC,OAAO,EAAE;AAC7B,QAAQ,IAAI,SAAS,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE;AACxC,YAAY,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;AACrD,SAAS;AACT,QAAQ,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC;AAClC,KAAK;AACL;;;;","x_google_ignoreList":[0,1,2,8]} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/dist/wordlists-extra.min.js b/tools/mnemonic-test/node_modules/ethers/dist/wordlists-extra.min.js deleted file mode 100644 index 17d993d5..00000000 --- a/tools/mnemonic-test/node_modules/ethers/dist/wordlists-extra.min.js +++ /dev/null @@ -1 +0,0 @@ -function number(n){if(!Number.isSafeInteger(n)||n<0)throw new Error(`Wrong positive integer: ${n}`)}function bytes(b,...lengths){if(!(b instanceof Uint8Array))throw new Error("Expected Uint8Array");if(lengths.length>0&&!lengths.includes(b.length))throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`)}function exists(instance,checkFinished=true){if(instance.destroyed)throw new Error("Hash instance has been destroyed");if(checkFinished&&instance.finished)throw new Error("Hash#digest() has already been called")}function output(out,instance){bytes(out);const min=instance.outputLen;if(out.lengtha instanceof Uint8Array;const u32=arr=>new Uint32Array(arr.buffer,arr.byteOffset,Math.floor(arr.byteLength/4));const isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!isLE)throw new Error("Non little-endian hardware is not supported");function utf8ToBytes(str){if(typeof str!=="string")throw new Error(`utf8ToBytes expected string, got ${typeof str}`);return new Uint8Array((new TextEncoder).encode(str))}function toBytes(data){if(typeof data==="string")data=utf8ToBytes(data);if(!u8a(data))throw new Error(`expected Uint8Array, got ${typeof data}`);return data}class Hash{clone(){return this._cloneInto()}}function wrapConstructor(hashCons){const hashC=msg=>hashCons().update(toBytes(msg)).digest();const tmp=hashCons();hashC.outputLen=tmp.outputLen;hashC.blockLen=tmp.blockLen;hashC.create=()=>hashCons();return hashC}const U32_MASK64=BigInt(2**32-1);const _32n=BigInt(32);function fromBig(n,le=false){if(le)return{h:Number(n&U32_MASK64),l:Number(n>>_32n&U32_MASK64)};return{h:Number(n>>_32n&U32_MASK64)|0,l:Number(n&U32_MASK64)|0}}function split(lst,le=false){let Ah=new Uint32Array(lst.length);let Al=new Uint32Array(lst.length);for(let i=0;ih<>>32-s;const rotlSL=(h,l,s)=>l<>>32-s;const rotlBH=(h,l,s)=>l<>>64-s;const rotlBL=(h,l,s)=>h<>>64-s;const version="6.16.0";function defineProperties(target,values,types){for(let key in values){let value=values[key];Object.defineProperty(target,key,{enumerable:true,value:value,writable:false})}}function stringify(value,seen){if(value==null){return"null"}if(seen==null){seen=new Set}if(typeof value==="object"){if(seen.has(value)){return"[Circular]"}seen.add(value)}if(Array.isArray(value)){return"[ "+value.map(v=>stringify(v,seen)).join(", ")+" ]"}if(value instanceof Uint8Array){const HEX="0123456789abcdef";let result="0x";for(let i=0;i>4];result+=HEX[value[i]&15]}return result}if(typeof value==="object"&&typeof value.toJSON==="function"){return stringify(value.toJSON(),seen)}switch(typeof value){case"boolean":case"number":case"symbol":return value.toString();case"bigint":return BigInt(value).toString();case"string":return JSON.stringify(value);case"object":{const keys=Object.keys(value);keys.sort();return"{ "+keys.map(k=>`${stringify(k,seen)}: ${stringify(value[k],seen)}`).join(", ")+" }"}}return`[ COULD NOT SERIALIZE ]`}function makeError(message,code,info){let shortMessage=message;{const details=[];if(info){if("message"in info||"code"in info||"name"in info){throw new Error(`value will overwrite populated values: ${stringify(info)}`)}for(const key in info){if(key==="shortMessage"){continue}const value=info[key];details.push(key+"="+stringify(value))}}details.push(`code=${code}`);details.push(`version=${version}`);if(details.length){message+=" ("+details.join(", ")+")"}}let error;switch(code){case"INVALID_ARGUMENT":error=new TypeError(message);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":error=new RangeError(message);break;default:error=new Error(message)}defineProperties(error,{code:code});if(info){Object.assign(error,info)}if(error.shortMessage==null){defineProperties(error,{shortMessage:shortMessage})}return error}function assert(check,message,code,info){if(!check){throw makeError(message,code,info)}}function assertArgument(check,message,name,value){assert(check,message,"INVALID_ARGUMENT",{argument:name,value:value})}["NFD","NFC","NFKD","NFKC"].reduce((accum,form)=>{try{if("test".normalize(form)!=="test"){throw new Error("bad")}if(form==="NFD"){const check=String.fromCharCode(233).normalize("NFD");const expected=String.fromCharCode(101,769);if(check!==expected){throw new Error("broken")}}accum.push(form)}catch(error){}return accum},[]);function _getBytes(value,name,copy){if(value instanceof Uint8Array){return value}if(typeof value==="string"&&value.length%2===0&&value.match(/^0x[0-9a-f]*$/i)){const result=new Uint8Array((value.length-2)/2);let offset=2;for(let i=0;i>4]+HexCharacters[v&15]}return result}function errorFunc(reason,offset,bytes,output,badCodepoint){assertArgument(false,`invalid codepoint at offset ${offset}; ${reason}`,"bytes",bytes)}function ignoreFunc(reason,offset,bytes,output,badCodepoint){if(reason==="BAD_PREFIX"||reason==="UNEXPECTED_CONTINUE"){let i=0;for(let o=offset+1;o>6!==2){break}i++}return i}if(reason==="OVERRUN"){return bytes.length-offset-1}return 0}function replaceFunc(reason,offset,bytes,output,badCodepoint){if(reason==="OVERLONG"){assertArgument(typeof badCodepoint==="number","invalid bad code point for replacement","badCodepoint",badCodepoint);output.push(badCodepoint);return 0}output.push(65533);return ignoreFunc(reason,offset,bytes)}const Utf8ErrorFuncs=Object.freeze({error:errorFunc,ignore:ignoreFunc,replace:replaceFunc});function getUtf8CodePoints(_bytes,onError){if(onError==null){onError=Utf8ErrorFuncs.error}const bytes=getBytes(_bytes,"bytes");const result=[];let i=0;while(i>7===0){result.push(c);continue}let extraLength=null;let overlongMask=null;if((c&224)===192){extraLength=1;overlongMask=127}else if((c&240)===224){extraLength=2;overlongMask=2047}else if((c&248)===240){extraLength=3;overlongMask=65535}else{if((c&192)===128){i+=onError("UNEXPECTED_CONTINUE",i-1,bytes,result)}else{i+=onError("BAD_PREFIX",i-1,bytes,result)}continue}if(i-1+extraLength>=bytes.length){i+=onError("OVERRUN",i-1,bytes,result);continue}let res=c&(1<<8-extraLength-1)-1;for(let j=0;j1114111){i+=onError("OUT_OF_RANGE",i-1-extraLength,bytes,result,res);continue}if(res>=55296&&res<=57343){i+=onError("UTF16_SURROGATE",i-1-extraLength,bytes,result,res);continue}if(res<=overlongMask){i+=onError("OVERLONG",i-1-extraLength,bytes,result,res);continue}result.push(res)}return result}function toUtf8Bytes(str,form){assertArgument(typeof str==="string","invalid string value","str",str);let result=[];for(let i=0;i>6|192);result.push(c&63|128)}else if((c&64512)==55296){i++;const c2=str.charCodeAt(i);assertArgument(i>18|240);result.push(pair>>12&63|128);result.push(pair>>6&63|128);result.push(pair&63|128)}else{result.push(c>>12|224);result.push(c>>6&63|128);result.push(c&63|128)}}return new Uint8Array(result)}function _toUtf8String(codePoints){return codePoints.map(codePoint=>{if(codePoint<=65535){return String.fromCharCode(codePoint)}codePoint-=65536;return String.fromCharCode((codePoint>>10&1023)+55296,(codePoint&1023)+56320)}).join("")}function toUtf8String(bytes,onError){return _toUtf8String(getUtf8CodePoints(bytes,onError))}const[SHA3_PI,SHA3_ROTL,_SHA3_IOTA]=[[],[],[]];const _0n=BigInt(0);const _1n=BigInt(1);const _2n=BigInt(2);const _7n=BigInt(7);const _256n=BigInt(256);const _0x71n=BigInt(113);for(let round=0,R=_1n,x=1,y=0;round<24;round++){[x,y]=[y,(2*x+3*y)%5];SHA3_PI.push(2*(5*y+x));SHA3_ROTL.push((round+1)*(round+2)/2%64);let t=_0n;for(let j=0;j<7;j++){R=(R<<_1n^(R>>_7n)*_0x71n)%_256n;if(R&_2n)t^=_1n<<(_1n<s>32?rotlBH(h,l,s):rotlSH(h,l,s);const rotlL=(h,l,s)=>s>32?rotlBL(h,l,s):rotlSL(h,l,s);function keccakP(s,rounds=24){const B=new Uint32Array(5*2);for(let round=24-rounds;round<24;round++){for(let x=0;x<10;x++)B[x]=s[x]^s[x+10]^s[x+20]^s[x+30]^s[x+40];for(let x=0;x<10;x+=2){const idx1=(x+8)%10;const idx0=(x+2)%10;const B0=B[idx0];const B1=B[idx0+1];const Th=rotlH(B0,B1,1)^B[idx1];const Tl=rotlL(B0,B1,1)^B[idx1+1];for(let y=0;y<50;y+=10){s[x+y]^=Th;s[x+y+1]^=Tl}}let curH=s[2];let curL=s[3];for(let t=0;t<24;t++){const shift=SHA3_ROTL[t];const Th=rotlH(curH,curL,shift);const Tl=rotlL(curH,curL,shift);const PI=SHA3_PI[t];curH=s[PI];curL=s[PI+1];s[PI]=Th;s[PI+1]=Tl}for(let y=0;y<50;y+=10){for(let x=0;x<10;x++)B[x]=s[y+x];for(let x=0;x<10;x++)s[y+x]^=~B[(x+2)%10]&B[(x+4)%10]}s[0]^=SHA3_IOTA_H[round];s[1]^=SHA3_IOTA_L[round]}B.fill(0)}class Keccak extends Hash{constructor(blockLen,suffix,outputLen,enableXOF=false,rounds=24){super();this.blockLen=blockLen;this.suffix=suffix;this.outputLen=outputLen;this.enableXOF=enableXOF;this.rounds=rounds;this.pos=0;this.posOut=0;this.finished=false;this.destroyed=false;number(outputLen);if(0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200);this.state32=u32(this.state)}keccak(){keccakP(this.state32,this.rounds);this.posOut=0;this.pos=0}update(data){exists(this);const{blockLen,state}=this;data=toBytes(data);const len=data.length;for(let pos=0;pos=blockLen)this.keccak();const take=Math.min(blockLen-this.posOut,len-pos);out.set(bufferOut.subarray(this.posOut,this.posOut+take),pos);this.posOut+=take;pos+=take}return out}xofInto(out){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(out)}xof(bytes){number(bytes);return this.xofInto(new Uint8Array(bytes))}digestInto(out){output(out,this);if(this.finished)throw new Error("digest() was already called");this.writeInto(out);this.destroy();return out}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=true;this.state.fill(0)}_cloneInto(to){const{blockLen,suffix,outputLen,rounds,enableXOF}=this;to||(to=new Keccak(blockLen,suffix,outputLen,enableXOF,rounds));to.state32.set(this.state32);to.pos=this.pos;to.posOut=this.posOut;to.finished=this.finished;to.rounds=rounds;to.suffix=suffix;to.outputLen=outputLen;to.enableXOF=enableXOF;to.destroyed=this.destroyed;return to}}const gen=(suffix,blockLen,outputLen)=>wrapConstructor(()=>new Keccak(blockLen,suffix,outputLen));const keccak_256=gen(1,136,256/8);let locked=false;const _keccak256=function(data){return keccak_256(data)};let __keccak256=_keccak256;function keccak256(_data){const data=getBytes(_data,"data");return hexlify(__keccak256(data))}keccak256._=_keccak256;keccak256.lock=function(){locked=true};keccak256.register=function(func){if(locked){throw new TypeError("keccak256 is locked")}__keccak256=func};Object.freeze(keccak256);function id(value){return keccak256(toUtf8Bytes(value))}const subsChrs=" !#$%&'()*+,-./<=>?@[]^_`{|}~";const Word=/^[a-z]*$/i;function unfold(words,sep){let initial=97;return words.reduce((accum,word)=>{if(word===sep){initial++}else if(word.match(Word)){accum.push(String.fromCharCode(initial)+word)}else{initial=97;accum.push(word)}return accum},[])}function decode(data,subs){for(let i=subsChrs.length-1;i>=0;i--){data=data.split(subsChrs[i]).join(subs.substring(2*i,2*i+2))}const clumps=[];const leftover=data.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(all,item,semi,word)=>{if(semi){for(let i=parseInt(semi);i>=0;i--){clumps.push(";")}}else{clumps.push(item.toLowerCase())}return""});if(leftover){throw new Error(`leftovers: ${JSON.stringify(leftover)}`)}return unfold(unfold(clumps,";"),":")}function decodeOwl(data){assertArgument(data[0]==="0","unsupported auwl data","data",data);return decode(data.substring(1+2*subsChrs.length),data.substring(1,1+2*subsChrs.length))}class Wordlist{locale;constructor(locale){defineProperties(this,{locale:locale})}split(phrase){return phrase.toLowerCase().split(/\s+/g)}join(words){return words.join(" ")}}class WordlistOwl extends Wordlist{#data;#checksum;constructor(locale,data,checksum){super(locale);this.#data=data;this.#checksum=checksum;this.#words=null}get _data(){return this.#data}_decodeWords(){return decodeOwl(this.#data)}#words;#loadWords(){if(this.#words==null){const words=this._decodeWords();const checksum=id(words.join("\n")+"\n");if(checksum!==this.#checksum){throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`)}this.#words=words}return this.#words}getWord(index){const words=this.#loadWords();assertArgument(index>=0&&index=width){const value=accum>>bits-width;accum&=(1<{const match=accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);assertArgument(match!==null,"internal error parsing accents","accents",accents);let posOffset=0;const positions=decodeBits(parseInt(match[3]),match[4]);const charCode=parseInt(match[2]);const regex=new RegExp(`([${match[1]}])`,"g");words=words.replace(regex,(all,letter)=>{const rem=--positions[posOffset];if(rem===0){letter=String.fromCharCode(letter.charCodeAt(0),charCode);posOffset++}return letter})});return words.split(",")}class WordlistOwlA extends WordlistOwl{#accent;constructor(locale,data,accent,checksum){super(locale,data,checksum);this.#accent=accent}get _accent(){return this.#accent}_decodeWords(){return decodeOwlA(this._data,this._accent)}}const words$3="0arertoiotadonoaRteirroenaNonaLsolocoiliaralaorrenadaChoN$n0A>Dom,EjaI!#Oga&O'Or#RazoR*Ue=U<0Ab Adem@CeLe%OmoRa!RozUn0DazD$GeLaM,#S,)T^0AlAnceA+EEl]`E`EstruzI.I<2ErU{U'0Af[nArO)Uc Uf_Ul:BaB^|eH@IleJ Lanz/c.LdeMbuN>Nd-oRb(>RnizR+Scu]S#nSu[Tal]T!@T*Tu%UlZ 3BeBid/=S SoSt@3|oEnNgo2An>OqueUsa2ABi`BoCaCi`DaDegaIn//!o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ba>BiqueB]BuCoC#JoL L>L,#Ll/.Ma'Mb^Ng}quePaPe)P@P.Qu?l(deRe(if(je%RotR+R%TuajeU+ZaZ.3At+|oC]CnicaJa&J!Ji&L/efo'MaM^Mp=NazNd!N!NisNRmi'Rnur(+rSisSo+StigoT!aX#Z3B$Bu+nEmpoEn{Er[EPoR(.TanT!eTu=Za5Al]B?=C Ci'DoG/&M N}#P PeQueRaxR!oRm,%RneoRoRpe&R_RS!Xi>2AbajoAc#rA!Afi>AgoAjeAmoAnceA#AumaAz EbolEguaEin%EnEp EsIbuIgoIpaIs)IunfoOfeoOmpaOn>OpaO)OzoU>Ue'Ufa2B!@BoEr#MbaM^NelNic(bin(ismoR'T^:0Ic 9C!a0B[l0I{dIrIv!b){return 1}return 0}for(let length=3;length<=9;length++){const d=data$2[length-3];for(let offset=0;offset=0&&index=40){code=code+168-40}else if(code>=19){code=code+97-19}return toUtf8String(new Uint8Array([225,(code>>6)+132,(code&63)+128]))}let _wordlist$1=null;function loadWords$1(){if(_wordlist$1!=null){return _wordlist$1}const wordlist=[];data$1.forEach((data,length)=>{length+=4;for(let i=0;i=0&&index>2),128+codes.indexOf(data[i*3+1]),128+codes.indexOf(data[i*3+2])];if(locale==="zh_tw"){const common=s%4;for(let i=common;i<3;i++){bytes[i]=codes.indexOf(deltaData[deltaOffset++])+(i==0?228:128)}}wordlist.push(toUtf8String(new Uint8Array(bytes)))}const checksum=id(wordlist.join("\n")+"\n");if(checksum!==Checks[locale]){throw new Error(`BIP39 Wordlist for ${locale} (Chinese) FAILED`)}_wordlist[locale]=wordlist;return wordlist}const wordlists={};class LangZh extends Wordlist{constructor(dialect){super("zh_"+dialect)}getWord(index){const words=loadWords(this.locale);assertArgument(index>=0&&index): Result; - /** - * Encode the %%values%% as the %%types%% into ABI data. - * - * @returns DataHexstring - */ - encode(types: ReadonlyArray, values: ReadonlyArray): string; - /** - * Decode the ABI %%data%% as the %%types%% into values. - * - * If %%loose%% decoding is enabled, then strict padding is - * not enforced. Some older versions of Solidity incorrectly - * padded event data emitted from ``external`` functions. - */ - decode(types: ReadonlyArray, data: BytesLike, loose?: boolean): Result; - static _setDefaultMaxInflation(value: number): void; - /** - * Returns the shared singleton instance of a default [[AbiCoder]]. - * - * On the first call, the instance is created internally. - */ - static defaultAbiCoder(): AbiCoder; - /** - * Returns an ethers-compatible [[CallExceptionError]] Error for the given - * result %%data%% for the [[CallExceptionAction]] %%action%% against - * the Transaction %%tx%%. - */ - static getBuiltinCallException(action: CallExceptionAction, tx: { - to?: null | string; - from?: null | string; - data?: string; - }, data: null | BytesLike): CallExceptionError; -} -//# sourceMappingURL=abi-coder.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/abi-coder.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/abi-coder.d.ts.map deleted file mode 100644 index 0a0c483e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/abi-coder.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abi-coder.d.ts","sourceRoot":"","sources":["../../src.ts/abi/abi-coder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,OAAO,EAAiB,MAAM,EAAU,MAAM,4BAA4B,CAAC;AAU3E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK3C,OAAO,KAAK,EACR,SAAS,EACT,mBAAmB,EAAE,kBAAkB,EAC1C,MAAM,mBAAmB,CAAC;AAuF3B;;;GAGG;AACH,qBAAa,QAAQ;;IA4CjB;;;;;OAKG;IACH,eAAe,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,MAAM;IAMjE;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG,MAAM;IAWpF;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM;IAM1F,MAAM,CAAC,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAKnD;;;;OAIG;IACH,MAAM,CAAC,eAAe,IAAI,QAAQ;IAOlC;;;;OAIG;IACH,MAAM,CAAC,uBAAuB,CAAC,MAAM,EAAE,mBAAmB,EAAE,EAAE,EAAE;QAAE,EAAE,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,IAAI,EAAE,IAAI,GAAG,SAAS,GAAG,kBAAkB;CAG3K"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/abi-coder.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/abi-coder.js deleted file mode 100644 index 78eb80db..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/abi-coder.js +++ /dev/null @@ -1,210 +0,0 @@ -"use strict"; -/** - * When sending values to or receiving values from a [[Contract]], the - * data is generally encoded using the [ABI standard](link-solc-abi). - * - * The AbiCoder provides a utility to encode values to ABI data and - * decode values from ABI data. - * - * Most of the time, developers should favour the [[Contract]] class, - * which further abstracts a lot of the finer details of ABI data. - * - * @_section api/abi/abi-coder:ABI Encoding - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.AbiCoder = void 0; -// See: https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI -const index_js_1 = require("../utils/index.js"); -const abstract_coder_js_1 = require("./coders/abstract-coder.js"); -const address_js_1 = require("./coders/address.js"); -const array_js_1 = require("./coders/array.js"); -const boolean_js_1 = require("./coders/boolean.js"); -const bytes_js_1 = require("./coders/bytes.js"); -const fixed_bytes_js_1 = require("./coders/fixed-bytes.js"); -const null_js_1 = require("./coders/null.js"); -const number_js_1 = require("./coders/number.js"); -const string_js_1 = require("./coders/string.js"); -const tuple_js_1 = require("./coders/tuple.js"); -const fragments_js_1 = require("./fragments.js"); -const index_js_2 = require("../address/index.js"); -const index_js_3 = require("../utils/index.js"); -// https://docs.soliditylang.org/en/v0.8.17/control-structures.html -const PanicReasons = new Map(); -PanicReasons.set(0x00, "GENERIC_PANIC"); -PanicReasons.set(0x01, "ASSERT_FALSE"); -PanicReasons.set(0x11, "OVERFLOW"); -PanicReasons.set(0x12, "DIVIDE_BY_ZERO"); -PanicReasons.set(0x21, "ENUM_RANGE_ERROR"); -PanicReasons.set(0x22, "BAD_STORAGE_DATA"); -PanicReasons.set(0x31, "STACK_UNDERFLOW"); -PanicReasons.set(0x32, "ARRAY_RANGE_ERROR"); -PanicReasons.set(0x41, "OUT_OF_MEMORY"); -PanicReasons.set(0x51, "UNINITIALIZED_FUNCTION_CALL"); -const paramTypeBytes = new RegExp(/^bytes([0-9]*)$/); -const paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/); -let defaultCoder = null; -let defaultMaxInflation = 1024; -function getBuiltinCallException(action, tx, data, abiCoder) { - let message = "missing revert data"; - let reason = null; - const invocation = null; - let revert = null; - if (data) { - message = "execution reverted"; - const bytes = (0, index_js_3.getBytes)(data); - data = (0, index_js_3.hexlify)(data); - if (bytes.length === 0) { - message += " (no data present; likely require(false) occurred"; - reason = "require(false)"; - } - else if (bytes.length % 32 !== 4) { - message += " (could not decode reason; invalid data length)"; - } - else if ((0, index_js_3.hexlify)(bytes.slice(0, 4)) === "0x08c379a0") { - // Error(string) - try { - reason = abiCoder.decode(["string"], bytes.slice(4))[0]; - revert = { - signature: "Error(string)", - name: "Error", - args: [reason] - }; - message += `: ${JSON.stringify(reason)}`; - } - catch (error) { - message += " (could not decode reason; invalid string data)"; - } - } - else if ((0, index_js_3.hexlify)(bytes.slice(0, 4)) === "0x4e487b71") { - // Panic(uint256) - try { - const code = Number(abiCoder.decode(["uint256"], bytes.slice(4))[0]); - revert = { - signature: "Panic(uint256)", - name: "Panic", - args: [code] - }; - reason = `Panic due to ${PanicReasons.get(code) || "UNKNOWN"}(${code})`; - message += `: ${reason}`; - } - catch (error) { - message += " (could not decode panic code)"; - } - } - else { - message += " (unknown custom error)"; - } - } - const transaction = { - to: (tx.to ? (0, index_js_2.getAddress)(tx.to) : null), - data: (tx.data || "0x") - }; - if (tx.from) { - transaction.from = (0, index_js_2.getAddress)(tx.from); - } - return (0, index_js_3.makeError)(message, "CALL_EXCEPTION", { - action, data, reason, transaction, invocation, revert - }); -} -/** - * The **AbiCoder** is a low-level class responsible for encoding JavaScript - * values into binary data and decoding binary data into JavaScript values. - */ -class AbiCoder { - #getCoder(param) { - if (param.isArray()) { - return new array_js_1.ArrayCoder(this.#getCoder(param.arrayChildren), param.arrayLength, param.name); - } - if (param.isTuple()) { - return new tuple_js_1.TupleCoder(param.components.map((c) => this.#getCoder(c)), param.name); - } - switch (param.baseType) { - case "address": - return new address_js_1.AddressCoder(param.name); - case "bool": - return new boolean_js_1.BooleanCoder(param.name); - case "string": - return new string_js_1.StringCoder(param.name); - case "bytes": - return new bytes_js_1.BytesCoder(param.name); - case "": - return new null_js_1.NullCoder(param.name); - } - // u?int[0-9]* - let match = param.type.match(paramTypeNumber); - if (match) { - let size = parseInt(match[2] || "256"); - (0, index_js_1.assertArgument)(size !== 0 && size <= 256 && (size % 8) === 0, "invalid " + match[1] + " bit length", "param", param); - return new number_js_1.NumberCoder(size / 8, (match[1] === "int"), param.name); - } - // bytes[0-9]+ - match = param.type.match(paramTypeBytes); - if (match) { - let size = parseInt(match[1]); - (0, index_js_1.assertArgument)(size !== 0 && size <= 32, "invalid bytes length", "param", param); - return new fixed_bytes_js_1.FixedBytesCoder(size, param.name); - } - (0, index_js_1.assertArgument)(false, "invalid type", "type", param.type); - } - /** - * Get the default values for the given %%types%%. - * - * For example, a ``uint`` is by default ``0`` and ``bool`` - * is by default ``false``. - */ - getDefaultValue(types) { - const coders = types.map((type) => this.#getCoder(fragments_js_1.ParamType.from(type))); - const coder = new tuple_js_1.TupleCoder(coders, "_"); - return coder.defaultValue(); - } - /** - * Encode the %%values%% as the %%types%% into ABI data. - * - * @returns DataHexstring - */ - encode(types, values) { - (0, index_js_1.assertArgumentCount)(values.length, types.length, "types/values length mismatch"); - const coders = types.map((type) => this.#getCoder(fragments_js_1.ParamType.from(type))); - const coder = (new tuple_js_1.TupleCoder(coders, "_")); - const writer = new abstract_coder_js_1.Writer(); - coder.encode(writer, values); - return writer.data; - } - /** - * Decode the ABI %%data%% as the %%types%% into values. - * - * If %%loose%% decoding is enabled, then strict padding is - * not enforced. Some older versions of Solidity incorrectly - * padded event data emitted from ``external`` functions. - */ - decode(types, data, loose) { - const coders = types.map((type) => this.#getCoder(fragments_js_1.ParamType.from(type))); - const coder = new tuple_js_1.TupleCoder(coders, "_"); - return coder.decode(new abstract_coder_js_1.Reader(data, loose, defaultMaxInflation)); - } - static _setDefaultMaxInflation(value) { - (0, index_js_1.assertArgument)(typeof (value) === "number" && Number.isInteger(value), "invalid defaultMaxInflation factor", "value", value); - defaultMaxInflation = value; - } - /** - * Returns the shared singleton instance of a default [[AbiCoder]]. - * - * On the first call, the instance is created internally. - */ - static defaultAbiCoder() { - if (defaultCoder == null) { - defaultCoder = new AbiCoder(); - } - return defaultCoder; - } - /** - * Returns an ethers-compatible [[CallExceptionError]] Error for the given - * result %%data%% for the [[CallExceptionAction]] %%action%% against - * the Transaction %%tx%%. - */ - static getBuiltinCallException(action, tx, data) { - return getBuiltinCallException(action, tx, data, AbiCoder.defaultAbiCoder()); - } -} -exports.AbiCoder = AbiCoder; -//# sourceMappingURL=abi-coder.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/abi-coder.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/abi-coder.js.map deleted file mode 100644 index 5a6cbbf3..00000000 --- a/tools/mnemonic-test/node_modules/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AAE,QAAQ,CAAC,eAAe,EAAE,CAAC,CAAC;IACjF,CAAC;CACJ;AA9GD,4BA8GC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/bytes32.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/bytes32.d.ts deleted file mode 100644 index 73455cb5..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/bytes32.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * About bytes32 strings... - * - * @_docloc: api/utils:Bytes32 Strings - */ -import type { BytesLike } from "../utils/index.js"; -/** - * Encodes %%text%% as a Bytes32 string. - */ -export declare function encodeBytes32String(text: string): string; -/** - * Encodes the Bytes32-encoded %%bytes%% into a string. - */ -export declare function decodeBytes32String(_bytes: BytesLike): string; -//# sourceMappingURL=bytes32.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/bytes32.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/bytes32.d.ts.map deleted file mode 100644 index 1d56cd6f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/bytes32.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bytes32.d.ts","sourceRoot":"","sources":["../../src.ts/abi/bytes32.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAUxD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAa7D"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/bytes32.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/bytes32.js deleted file mode 100644 index e5c22aa3..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/bytes32.js +++ /dev/null @@ -1,45 +0,0 @@ -"use strict"; -/** - * About bytes32 strings... - * - * @_docloc: api/utils:Bytes32 Strings - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.decodeBytes32String = exports.encodeBytes32String = void 0; -const index_js_1 = require("../utils/index.js"); -/** - * Encodes %%text%% as a Bytes32 string. - */ -function encodeBytes32String(text) { - // Get the bytes - const bytes = (0, index_js_1.toUtf8Bytes)(text); - // Check we have room for null-termination - if (bytes.length > 31) { - throw new Error("bytes32 string must be less than 32 bytes"); - } - // Zero-pad (implicitly null-terminates) - return (0, index_js_1.zeroPadBytes)(bytes, 32); -} -exports.encodeBytes32String = encodeBytes32String; -/** - * Encodes the Bytes32-encoded %%bytes%% into a string. - */ -function decodeBytes32String(_bytes) { - const data = (0, index_js_1.getBytes)(_bytes, "bytes"); - // Must be 32 bytes with a null-termination - if (data.length !== 32) { - throw new Error("invalid bytes32 - not 32 bytes long"); - } - if (data[31] !== 0) { - throw new Error("invalid bytes32 string - no null terminator"); - } - // Find the null termination - let length = 31; - while (data[length - 1] === 0) { - length--; - } - // Determine the string value - return (0, index_js_1.toUtf8String)(data.slice(0, length)); -} -exports.decodeBytes32String = decodeBytes32String; -//# sourceMappingURL=bytes32.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/bytes32.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/bytes32.js.map deleted file mode 100644 index 9e0828f8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/bytes32.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bytes32.js","sourceRoot":"","sources":["../../src.ts/abi/bytes32.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,gDAE2B;AAI3B;;GAEG;AACH,SAAgB,mBAAmB,CAAC,IAAY;IAE5C,gBAAgB;IAChB,MAAM,KAAK,GAAG,IAAA,sBAAW,EAAC,IAAI,CAAC,CAAC;IAEhC,0CAA0C;IAC1C,IAAI,KAAK,CAAC,MAAM,GAAG,EAAE,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;KAAE;IAExF,wCAAwC;IACxC,OAAO,IAAA,uBAAY,EAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACnC,CAAC;AAVD,kDAUC;AAED;;GAEG;AACH,SAAgB,mBAAmB,CAAC,MAAiB;IACjD,MAAM,IAAI,GAAG,IAAA,mBAAQ,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEvC,2CAA2C;IAC3C,IAAI,IAAI,CAAC,MAAM,KAAK,EAAE,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;KAAE;IACnF,IAAI,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;KAAE;IAEvF,4BAA4B;IAC5B,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE;QAAE,MAAM,EAAE,CAAC;KAAE;IAE5C,6BAA6B;IAC7B,OAAO,IAAA,uBAAY,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;AAC/C,CAAC;AAbD,kDAaC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/abstract-coder.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/abstract-coder.d.ts deleted file mode 100644 index 6223aea0..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/abstract-coder.d.ts +++ /dev/null @@ -1,124 +0,0 @@ -import type { BigNumberish, BytesLike } from "../../utils/index.js"; -/** - * @_ignore: - */ -export declare const WordSize: number; -/** - * A [[Result]] is a sub-class of Array, which allows accessing any - * of its values either positionally by its index or, if keys are - * provided by its name. - * - * @_docloc: api/abi - */ -export declare class Result extends Array { - #private; - [K: string | number]: any; - /** - * @private - */ - constructor(...args: Array); - /** - * Returns the Result as a normal Array. If %%deep%%, any children - * which are Result objects are also converted to a normal Array. - * - * This will throw if there are any outstanding deferred - * errors. - */ - toArray(deep?: boolean): Array; - /** - * Returns the Result as an Object with each name-value pair. If - * %%deep%%, any children which are Result objects are also - * converted to an Object. - * - * This will throw if any value is unnamed, or if there are - * any outstanding deferred errors. - */ - toObject(deep?: boolean): Record; - /** - * @_ignore - */ - slice(start?: number | undefined, end?: number | undefined): Result; - /** - * @_ignore - */ - filter(callback: (el: any, index: number, array: Result) => boolean, thisArg?: any): Result; - /** - * @_ignore - */ - map(callback: (el: any, index: number, array: Result) => T, thisArg?: any): Array; - /** - * Returns the value for %%name%%. - * - * Since it is possible to have a key whose name conflicts with - * a method on a [[Result]] or its superclass Array, or any - * JavaScript keyword, this ensures all named values are still - * accessible by name. - */ - getValue(name: string): any; - /** - * Creates a new [[Result]] for %%items%% with each entry - * also accessible by its corresponding name in %%keys%%. - */ - static fromItems(items: Array, keys?: Array): Result; -} -/** - * Returns all errors found in a [[Result]]. - * - * Since certain errors encountered when creating a [[Result]] do - * not impact the ability to continue parsing data, they are - * deferred until they are actually accessed. Hence a faulty string - * in an Event that is never used does not impact the program flow. - * - * However, sometimes it may be useful to access, identify or - * validate correctness of a [[Result]]. - * - * @_docloc api/abi - */ -export declare function checkResultErrors(result: Result): Array<{ - path: Array; - error: Error; -}>; -/** - * @_ignore - */ -export declare abstract class Coder { - readonly name: string; - readonly type: string; - readonly localName: string; - readonly dynamic: boolean; - constructor(name: string, type: string, localName: string, dynamic: boolean); - _throwError(message: string, value: any): never; - abstract encode(writer: Writer, value: any): number; - abstract decode(reader: Reader): any; - abstract defaultValue(): any; -} -/** - * @_ignore - */ -export declare class Writer { - #private; - constructor(); - get data(): string; - get length(): number; - appendWriter(writer: Writer): number; - writeBytes(value: BytesLike): number; - writeValue(value: BigNumberish): number; - writeUpdatableValue(): (value: BigNumberish) => void; -} -/** - * @_ignore - */ -export declare class Reader { - #private; - readonly allowLoose: boolean; - constructor(data: BytesLike, allowLoose?: boolean, maxInflation?: number); - get data(): string; - get dataLength(): number; - get consumed(): number; - get bytes(): Uint8Array; - subReader(offset: number): Reader; - readBytes(length: number, loose?: boolean): Uint8Array; - readValue(): bigint; - readIndex(): number; -} -//# sourceMappingURL=abstract-coder.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/abstract-coder.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/abstract-coder.d.ts.map deleted file mode 100644 index 8ecc4d8a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/abstract-coder.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abstract-coder.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/abstract-coder.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,MAAW,CAAC;AA+CnC;;;;;;GAMG;AACH,qBAAa,MAAO,SAAQ,KAAK,CAAC,GAAG,CAAC;;IAMlC,CAAE,CAAC,EAAE,MAAM,GAAG,MAAM,GAAI,GAAG,CAAA;IAE3B;;OAEG;gBACS,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IA+F/B;;;;;;OAMG;IACH,OAAO,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC;IAYnC;;;;;;;OAOG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAY7C;;OAEG;IACH,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,CAAC,EAAE,MA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;IAI/C,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM;IACnD,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;IAEpC,QAAQ,CAAC,YAAY,IAAI,GAAG;CAC/B;AAED;;GAEG;AACH,qBAAa,MAAM;;;IAUf,IAAI,IAAI,IAAI,MAAM,CAEjB;IACD,IAAI,MAAM,IAAI,MAAM,CAA6B;IAQjD,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAKpC,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM;IAUpC,UAAU,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM;IAMvC,mBAAmB,IAAI,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI;CAQvD;AAED;;GAEG;AACH,qBAAa,MAAM;;IAKf,QAAQ,CAAC,UAAU,EAAG,OAAO,CAAC;gBASlB,IAAI,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,MAAM;IAWxE,IAAI,IAAI,IAAI,MAAM,CAAgC;IAClD,IAAI,UAAU,IAAI,MAAM,CAA8B;IACtD,IAAI,QAAQ,IAAI,MAAM,CAAyB;IAC/C,IAAI,KAAK,IAAI,UAAU,CAAuC;IAkC9D,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAOjC,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,UAAU;IAStD,SAAS,IAAI,MAAM;IAInB,SAAS,IAAI,MAAM;CAGtB"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/abstract-coder.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/abstract-coder.js deleted file mode 100644 index 3a873bcf..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/abstract-coder.js +++ /dev/null @@ -1,472 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Reader = exports.Writer = exports.Coder = exports.checkResultErrors = exports.Result = exports.WordSize = void 0; -const index_js_1 = require("../../utils/index.js"); -/** - * @_ignore: - */ -exports.WordSize = 32; -const Padding = new Uint8Array(exports.WordSize); -// Properties used to immediate pass through to the underlying object -// - `then` is used to detect if an object is a Promise for await -const passProperties = ["then"]; -const _guard = {}; -const resultNames = new WeakMap(); -function getNames(result) { - return resultNames.get(result); -} -function setNames(result, names) { - resultNames.set(result, names); -} -function throwError(name, error) { - const wrapped = new Error(`deferred error during ABI decoding triggered accessing ${name}`); - wrapped.error = error; - throw wrapped; -} -function toObject(names, items, deep) { - if (names.indexOf(null) >= 0) { - return items.map((item, index) => { - if (item instanceof Result) { - return toObject(getNames(item), item, deep); - } - return item; - }); - } - return names.reduce((accum, name, index) => { - let item = items.getValue(name); - if (!(name in accum)) { - if (deep && item instanceof Result) { - item = toObject(getNames(item), item, deep); - } - accum[name] = item; - } - return accum; - }, {}); -} -/** - * A [[Result]] is a sub-class of Array, which allows accessing any - * of its values either positionally by its index or, if keys are - * provided by its name. - * - * @_docloc: api/abi - */ -class Result extends Array { - // No longer used; but cannot be removed as it will remove the - // #private field from the .d.ts which may break backwards - // compatibility - #names; - /** - * @private - */ - constructor(...args) { - // To properly sub-class Array so the other built-in - // functions work, the constructor has to behave fairly - // well. So, in the event we are created via fromItems() - // we build the read-only Result object we want, but on - // any other input, we use the default constructor - // constructor(guard: any, items: Array, keys?: Array); - const guard = args[0]; - let items = args[1]; - let names = (args[2] || []).slice(); - let wrap = true; - if (guard !== _guard) { - items = args; - names = []; - wrap = false; - } - // Can't just pass in ...items since an array of length 1 - // is a special case in the super. - super(items.length); - items.forEach((item, index) => { this[index] = item; }); - // Find all unique keys - const nameCounts = names.reduce((accum, name) => { - if (typeof (name) === "string") { - accum.set(name, (accum.get(name) || 0) + 1); - } - return accum; - }, (new Map())); - // Remove any key thats not unique - setNames(this, Object.freeze(items.map((item, index) => { - const name = names[index]; - if (name != null && nameCounts.get(name) === 1) { - return name; - } - return null; - }))); - // Dummy operations to prevent TypeScript from complaining - this.#names = []; - if (this.#names == null) { - void (this.#names); - } - if (!wrap) { - return; - } - // A wrapped Result is immutable - Object.freeze(this); - // Proxy indices and names so we can trap deferred errors - const proxy = new Proxy(this, { - get: (target, prop, receiver) => { - if (typeof (prop) === "string") { - // Index accessor - if (prop.match(/^[0-9]+$/)) { - const index = (0, index_js_1.getNumber)(prop, "%index"); - if (index < 0 || index >= this.length) { - throw new RangeError("out of result range"); - } - const item = target[index]; - if (item instanceof Error) { - throwError(`index ${index}`, item); - } - return item; - } - // Pass important checks (like `then` for Promise) through - if (passProperties.indexOf(prop) >= 0) { - return Reflect.get(target, prop, receiver); - } - const value = target[prop]; - if (value instanceof Function) { - // Make sure functions work with private variables - // See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy#no_private_property_forwarding - return function (...args) { - return value.apply((this === receiver) ? target : this, args); - }; - } - else if (!(prop in target)) { - // Possible name accessor - return target.getValue.apply((this === receiver) ? target : this, [prop]); - } - } - return Reflect.get(target, prop, receiver); - } - }); - setNames(proxy, getNames(this)); - return proxy; - } - /** - * Returns the Result as a normal Array. If %%deep%%, any children - * which are Result objects are also converted to a normal Array. - * - * This will throw if there are any outstanding deferred - * errors. - */ - toArray(deep) { - const result = []; - this.forEach((item, index) => { - if (item instanceof Error) { - throwError(`index ${index}`, item); - } - if (deep && item instanceof Result) { - item = item.toArray(deep); - } - result.push(item); - }); - return result; - } - /** - * Returns the Result as an Object with each name-value pair. If - * %%deep%%, any children which are Result objects are also - * converted to an Object. - * - * This will throw if any value is unnamed, or if there are - * any outstanding deferred errors. - */ - toObject(deep) { - const names = getNames(this); - return names.reduce((accum, name, index) => { - (0, index_js_1.assert)(name != null, `value at index ${index} unnamed`, "UNSUPPORTED_OPERATION", { - operation: "toObject()" - }); - return toObject(names, this, deep); - }, {}); - } - /** - * @_ignore - */ - slice(start, end) { - if (start == null) { - start = 0; - } - if (start < 0) { - start += this.length; - if (start < 0) { - start = 0; - } - } - if (end == null) { - end = this.length; - } - if (end < 0) { - end += this.length; - if (end < 0) { - end = 0; - } - } - if (end > this.length) { - end = this.length; - } - const _names = getNames(this); - const result = [], names = []; - for (let i = start; i < end; i++) { - result.push(this[i]); - names.push(_names[i]); - } - return new Result(_guard, result, names); - } - /** - * @_ignore - */ - filter(callback, thisArg) { - const _names = getNames(this); - const result = [], names = []; - for (let i = 0; i < this.length; i++) { - const item = this[i]; - if (item instanceof Error) { - throwError(`index ${i}`, item); - } - if (callback.call(thisArg, item, i, this)) { - result.push(item); - names.push(_names[i]); - } - } - return new Result(_guard, result, names); - } - /** - * @_ignore - */ - map(callback, thisArg) { - const result = []; - for (let i = 0; i < this.length; i++) { - const item = this[i]; - if (item instanceof Error) { - throwError(`index ${i}`, item); - } - result.push(callback.call(thisArg, item, i, this)); - } - return result; - } - /** - * Returns the value for %%name%%. - * - * Since it is possible to have a key whose name conflicts with - * a method on a [[Result]] or its superclass Array, or any - * JavaScript keyword, this ensures all named values are still - * accessible by name. - */ - getValue(name) { - const index = getNames(this).indexOf(name); - if (index === -1) { - return undefined; - } - const value = this[index]; - if (value instanceof Error) { - throwError(`property ${JSON.stringify(name)}`, value.error); - } - return value; - } - /** - * Creates a new [[Result]] for %%items%% with each entry - * also accessible by its corresponding name in %%keys%%. - */ - static fromItems(items, keys) { - return new Result(_guard, items, keys); - } -} -exports.Result = Result; -/** - * Returns all errors found in a [[Result]]. - * - * Since certain errors encountered when creating a [[Result]] do - * not impact the ability to continue parsing data, they are - * deferred until they are actually accessed. Hence a faulty string - * in an Event that is never used does not impact the program flow. - * - * However, sometimes it may be useful to access, identify or - * validate correctness of a [[Result]]. - * - * @_docloc api/abi - */ -function checkResultErrors(result) { - // Find the first error (if any) - const errors = []; - const checkErrors = function (path, object) { - if (!Array.isArray(object)) { - return; - } - for (let key in object) { - const childPath = path.slice(); - childPath.push(key); - try { - checkErrors(childPath, object[key]); - } - catch (error) { - errors.push({ path: childPath, error: error }); - } - } - }; - checkErrors([], result); - return errors; -} -exports.checkResultErrors = checkResultErrors; -function getValue(value) { - let bytes = (0, index_js_1.toBeArray)(value); - (0, index_js_1.assert)(bytes.length <= exports.WordSize, "value out-of-bounds", "BUFFER_OVERRUN", { buffer: bytes, length: exports.WordSize, offset: bytes.length }); - if (bytes.length !== exports.WordSize) { - bytes = (0, index_js_1.getBytesCopy)((0, index_js_1.concat)([Padding.slice(bytes.length % exports.WordSize), bytes])); - } - return bytes; -} -/** - * @_ignore - */ -class Coder { - // The coder name: - // - address, uint256, tuple, array, etc. - name; - // The fully expanded type, including composite types: - // - address, uint256, tuple(address,bytes), uint256[3][4][], etc. - type; - // The localName bound in the signature, in this example it is "baz": - // - tuple(address foo, uint bar) baz - localName; - // Whether this type is dynamic: - // - Dynamic: bytes, string, address[], tuple(boolean[]), etc. - // - Not Dynamic: address, uint256, boolean[3], tuple(address, uint8) - dynamic; - constructor(name, type, localName, dynamic) { - (0, index_js_1.defineProperties)(this, { name, type, localName, dynamic }, { - name: "string", type: "string", localName: "string", dynamic: "boolean" - }); - } - _throwError(message, value) { - (0, index_js_1.assertArgument)(false, message, this.localName, value); - } -} -exports.Coder = Coder; -/** - * @_ignore - */ -class Writer { - // An array of WordSize lengthed objects to concatenation - #data; - #dataLength; - constructor() { - this.#data = []; - this.#dataLength = 0; - } - get data() { - return (0, index_js_1.concat)(this.#data); - } - get length() { return this.#dataLength; } - #writeData(data) { - this.#data.push(data); - this.#dataLength += data.length; - return data.length; - } - appendWriter(writer) { - return this.#writeData((0, index_js_1.getBytesCopy)(writer.data)); - } - // Arrayish item; pad on the right to *nearest* WordSize - writeBytes(value) { - let bytes = (0, index_js_1.getBytesCopy)(value); - const paddingOffset = bytes.length % exports.WordSize; - if (paddingOffset) { - bytes = (0, index_js_1.getBytesCopy)((0, index_js_1.concat)([bytes, Padding.slice(paddingOffset)])); - } - return this.#writeData(bytes); - } - // Numeric item; pad on the left *to* WordSize - writeValue(value) { - return this.#writeData(getValue(value)); - } - // Inserts a numeric place-holder, returning a callback that can - // be used to asjust the value later - writeUpdatableValue() { - const offset = this.#data.length; - this.#data.push(Padding); - this.#dataLength += exports.WordSize; - return (value) => { - this.#data[offset] = getValue(value); - }; - } -} -exports.Writer = Writer; -/** - * @_ignore - */ -class Reader { - // Allows incomplete unpadded data to be read; otherwise an error - // is raised if attempting to overrun the buffer. This is required - // to deal with an old Solidity bug, in which event data for - // external (not public thoguh) was tightly packed. - allowLoose; - #data; - #offset; - #bytesRead; - #parent; - #maxInflation; - constructor(data, allowLoose, maxInflation) { - (0, index_js_1.defineProperties)(this, { allowLoose: !!allowLoose }); - this.#data = (0, index_js_1.getBytesCopy)(data); - this.#bytesRead = 0; - this.#parent = null; - this.#maxInflation = (maxInflation != null) ? maxInflation : 1024; - this.#offset = 0; - } - get data() { return (0, index_js_1.hexlify)(this.#data); } - get dataLength() { return this.#data.length; } - get consumed() { return this.#offset; } - get bytes() { return new Uint8Array(this.#data); } - #incrementBytesRead(count) { - if (this.#parent) { - return this.#parent.#incrementBytesRead(count); - } - this.#bytesRead += count; - // Check for excessive inflation (see: #4537) - (0, index_js_1.assert)(this.#maxInflation < 1 || this.#bytesRead <= this.#maxInflation * this.dataLength, `compressed ABI data exceeds inflation ratio of ${this.#maxInflation} ( see: https:/\/github.com/ethers-io/ethers.js/issues/4537 )`, "BUFFER_OVERRUN", { - buffer: (0, index_js_1.getBytesCopy)(this.#data), offset: this.#offset, - length: count, info: { - bytesRead: this.#bytesRead, - dataLength: this.dataLength - } - }); - } - #peekBytes(offset, length, loose) { - let alignedLength = Math.ceil(length / exports.WordSize) * exports.WordSize; - if (this.#offset + alignedLength > this.#data.length) { - if (this.allowLoose && loose && this.#offset + length <= this.#data.length) { - alignedLength = length; - } - else { - (0, index_js_1.assert)(false, "data out-of-bounds", "BUFFER_OVERRUN", { - buffer: (0, index_js_1.getBytesCopy)(this.#data), - length: this.#data.length, - offset: this.#offset + alignedLength - }); - } - } - return this.#data.slice(this.#offset, this.#offset + alignedLength); - } - // Create a sub-reader with the same underlying data, but offset - subReader(offset) { - const reader = new Reader(this.#data.slice(this.#offset + offset), this.allowLoose, this.#maxInflation); - reader.#parent = this; - return reader; - } - // Read bytes - readBytes(length, loose) { - let bytes = this.#peekBytes(0, length, !!loose); - this.#incrementBytesRead(length); - this.#offset += bytes.length; - // @TODO: Make sure the length..end bytes are all 0? - return bytes.slice(0, length); - } - // Read a numeric values - readValue() { - return (0, index_js_1.toBigInt)(this.readBytes(exports.WordSize)); - } - readIndex() { - return (0, index_js_1.toNumber)(this.readBytes(exports.WordSize)); - } -} -exports.Reader = Reader; -//# sourceMappingURL=abstract-coder.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/abstract-coder.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/abstract-coder.js.map deleted file mode 100644 index 1b8b20d1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/abstract-coder.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abstract-coder.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/abstract-coder.ts"],"names":[],"mappings":";;;AACA,mDAK8B;AAI9B;;GAEG;AACU,QAAA,QAAQ,GAAW,EAAE,CAAC;AACnC,MAAM,OAAO,GAAG,IAAI,UAAU,CAAC,gBAAQ,CAAC,CAAC;AAEzC,qEAAqE;AACrE,iEAAiE;AACjE,MAAM,cAAc,GAAG,CAAE,MAAM,CAAE,CAAC;AAElC,MAAM,MAAM,GAAG,EAAG,CAAC;AAEnB,MAAM,WAAW,GAAkD,IAAI,OAAO,EAAE,CAAC;AAEjF,SAAS,QAAQ,CAAC,MAAc;IAC5B,OAAO,WAAW,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC;AACpC,CAAC;AACD,SAAS,QAAQ,CAAC,MAAc,EAAE,KA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CAAC;QACjC,IAAI,CAAC,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC;QAC7B,oDAAoD;QACpD,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IAClC,CAAC;IAED,wBAAwB;IACxB,SAAS;QACL,OAAO,IAAA,mBAAQ,EAAC,IAAI,CAAC,SAAS,CAAC,gBAAQ,CAAC,CAAC,CAAC;IAC9C,CAAC;IAED,SAAS;QACL,OAAO,IAAA,mBAAQ,EAAC,IAAI,CAAC,SAAS,CAAC,gBAAQ,CAAC,CAAC,CAAC;IAC9C,CAAC;CACJ;AArFD,wBAqFC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/address.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/address.d.ts deleted file mode 100644 index 8befac03..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/address.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class AddressCoder extends Coder { - constructor(localName: string); - defaultValue(): string; - encode(writer: Writer, _value: string | Typed): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=address.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/address.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/address.d.ts.map deleted file mode 100644 index f86c8f18..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/address.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/address.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG1D;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;gBAEvB,SAAS,EAAE,MAAM;IAI7B,YAAY,IAAI,MAAM;IAItB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM;IAUtD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG9B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/address.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/address.js deleted file mode 100644 index 65940831..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/address.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.AddressCoder = void 0; -const index_js_1 = require("../../address/index.js"); -const maths_js_1 = require("../../utils/maths.js"); -const typed_js_1 = require("../typed.js"); -const abstract_coder_js_1 = require("./abstract-coder.js"); -/** - * @_ignore - */ -class AddressCoder extends abstract_coder_js_1.Coder { - constructor(localName) { - super("address", "address", localName, false); - } - defaultValue() { - return "0x0000000000000000000000000000000000000000"; - } - encode(writer, _value) { - let value = typed_js_1.Typed.dereference(_value, "string"); - try { - value = (0, index_js_1.getAddress)(value); - } - catch (error) { - return this._throwError(error.message, _value); - } - return writer.writeValue(value); - } - decode(reader) { - return (0, index_js_1.getAddress)((0, maths_js_1.toBeHex)(reader.readValue(), 20)); - } -} -exports.AddressCoder = AddressCoder; -//# sourceMappingURL=address.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/address.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/address.js.map deleted file mode 100644 index 4ac28306..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/address.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"address.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/address.ts"],"names":[],"mappings":";;;AAAA,qDAAoD;AACpD,mDAA+C;AAE/C,0CAAoC;AACpC,2DAA4C;AAK5C;;GAEG;AACH,MAAa,YAAa,SAAQ,yBAAK;IAEnC,YAAY,SAAiB;QACzB,KAAK,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IAClD,CAAC;IAED,YAAY;QACR,OAAO,4CAA4C,CAAC;IACxD,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,MAAsB;QACzC,IAAI,KAAK,GAAG,gBAAK,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAChD,IAAI;YACA,KAAK,GAAG,IAAA,qBAAU,EAAC,KAAK,CAAC,CAAC;SAC7B;QAAC,OAAO,KAAU,EAAE;YACjB,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;SAClD;QACD,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;IAED,MAAM,CAAC,MAAc;QACjB,OAAO,IAAA,qBAAU,EAAC,IAAA,kBAAO,EAAC,MAAM,CAAC,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IACvD,CAAC;CACJ;AAvBD,oCAuBC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/anonymous.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/anonymous.d.ts deleted file mode 100644 index 554bf03f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/anonymous.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Coder } from "./abstract-coder.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * Clones the functionality of an existing Coder, but without a localName - * - * @_ignore - */ -export declare class AnonymousCoder extends Coder { - private coder; - constructor(coder: Coder); - defaultValue(): any; - encode(writer: Writer, value: any): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=anonymous.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/anonymous.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/anonymous.d.ts.map deleted file mode 100644 index f150f060..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/anonymous.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"anonymous.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/anonymous.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;;;GAIG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACrC,OAAO,CAAC,KAAK,CAAQ;gBAET,KAAK,EAAE,KAAK;IAKxB,YAAY,IAAI,GAAG;IAInB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM;IAI1C,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG9B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/anonymous.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/anonymous.js deleted file mode 100644 index cbd655c6..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/anonymous.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.AnonymousCoder = void 0; -const abstract_coder_js_1 = require("./abstract-coder.js"); -/** - * Clones the functionality of an existing Coder, but without a localName - * - * @_ignore - */ -class AnonymousCoder extends abstract_coder_js_1.Coder { - coder; - constructor(coder) { - super(coder.name, coder.type, "_", coder.dynamic); - this.coder = coder; - } - defaultValue() { - return this.coder.defaultValue(); - } - encode(writer, value) { - return this.coder.encode(writer, value); - } - decode(reader) { - return this.coder.decode(reader); - } -} -exports.AnonymousCoder = AnonymousCoder; -//# sourceMappingURL=anonymous.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/anonymous.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/anonymous.js.map deleted file mode 100644 index 9999d0b8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/anonymous.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"anonymous.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/anonymous.ts"],"names":[],"mappings":";;;AAAA,2DAA4C;AAI5C;;;;GAIG;AACH,MAAa,cAAe,SAAQ,yBAAK;IAC7B,KAAK,CAAQ;IAErB,YAAY,KAAY;QACpB,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QAClD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,YAAY;QACR,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;IACrC,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,KAAU;QAC7B,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC5C,CAAC;IAED,MAAM,CAAC,MAAc;QACjB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC;CACJ;AAnBD,wCAmBC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/array.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/array.d.ts deleted file mode 100644 index 954c4e17..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/array.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Typed } from "../typed.js"; -import { Coder, Result, Writer } from "./abstract-coder.js"; -import type { Reader } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare function pack(writer: Writer, coders: ReadonlyArray, values: Array | { - [name: string]: any; -}): number; -/** - * @_ignore - */ -export declare function unpack(reader: Reader, coders: ReadonlyArray): Result; -/** - * @_ignore - */ -export declare class ArrayCoder extends Coder { - readonly coder: Coder; - readonly length: number; - constructor(coder: Coder, length: number, localName: string); - defaultValue(): Array; - encode(writer: Writer, _value: Array | Typed): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=array.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/array.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/array.d.ts.map deleted file mode 100644 index c3a6d622..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/array.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/array.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAY,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD;;GAEG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG;IAAE,CAAE,IAAI,EAAE,MAAM,GAAI,GAAG,CAAA;CAAE,GAAG,MAAM,CA2DzH;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,MAAM,CAoD3E;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACjC,QAAQ,CAAC,KAAK,EAAG,KAAK,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;gBAEb,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAO3D,YAAY,IAAI,KAAK,CAAC,GAAG,CAAC;IAW1B,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,GAAG,MAAM;IAsB1D,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAkB9B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/array.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/array.js deleted file mode 100644 index 8bee18a0..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/array.js +++ /dev/null @@ -1,165 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ArrayCoder = exports.unpack = exports.pack = void 0; -const index_js_1 = require("../../utils/index.js"); -const typed_js_1 = require("../typed.js"); -const abstract_coder_js_1 = require("./abstract-coder.js"); -const anonymous_js_1 = require("./anonymous.js"); -/** - * @_ignore - */ -function pack(writer, coders, values) { - let arrayValues = []; - if (Array.isArray(values)) { - arrayValues = values; - } - else if (values && typeof (values) === "object") { - let unique = {}; - arrayValues = coders.map((coder) => { - const name = coder.localName; - (0, index_js_1.assert)(name, "cannot encode object for signature with missing names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values }); - (0, index_js_1.assert)(!unique[name], "cannot encode object for signature with duplicate names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values }); - unique[name] = true; - return values[name]; - }); - } - else { - (0, index_js_1.assertArgument)(false, "invalid tuple value", "tuple", values); - } - (0, index_js_1.assertArgument)(coders.length === arrayValues.length, "types/value length mismatch", "tuple", values); - let staticWriter = new abstract_coder_js_1.Writer(); - let dynamicWriter = new abstract_coder_js_1.Writer(); - let updateFuncs = []; - coders.forEach((coder, index) => { - let value = arrayValues[index]; - if (coder.dynamic) { - // Get current dynamic offset (for the future pointer) - let dynamicOffset = dynamicWriter.length; - // Encode the dynamic value into the dynamicWriter - coder.encode(dynamicWriter, value); - // Prepare to populate the correct offset once we are done - let updateFunc = staticWriter.writeUpdatableValue(); - updateFuncs.push((baseOffset) => { - updateFunc(baseOffset + dynamicOffset); - }); - } - else { - coder.encode(staticWriter, value); - } - }); - // Backfill all the dynamic offsets, now that we know the static length - updateFuncs.forEach((func) => { func(staticWriter.length); }); - let length = writer.appendWriter(staticWriter); - length += writer.appendWriter(dynamicWriter); - return length; -} -exports.pack = pack; -/** - * @_ignore - */ -function unpack(reader, coders) { - let values = []; - let keys = []; - // A reader anchored to this base - let baseReader = reader.subReader(0); - coders.forEach((coder) => { - let value = null; - if (coder.dynamic) { - let offset = reader.readIndex(); - let offsetReader = baseReader.subReader(offset); - try { - value = coder.decode(offsetReader); - } - catch (error) { - // Cannot recover from this - if ((0, index_js_1.isError)(error, "BUFFER_OVERRUN")) { - throw error; - } - value = error; - value.baseType = coder.name; - value.name = coder.localName; - value.type = coder.type; - } - } - else { - try { - value = coder.decode(reader); - } - catch (error) { - // Cannot recover from this - if ((0, index_js_1.isError)(error, "BUFFER_OVERRUN")) { - throw error; - } - value = error; - value.baseType = coder.name; - value.name = coder.localName; - value.type = coder.type; - } - } - if (value == undefined) { - throw new Error("investigate"); - } - values.push(value); - keys.push(coder.localName || null); - }); - return abstract_coder_js_1.Result.fromItems(values, keys); -} -exports.unpack = unpack; -/** - * @_ignore - */ -class ArrayCoder extends abstract_coder_js_1.Coder { - coder; - length; - constructor(coder, length, localName) { - const type = (coder.type + "[" + (length >= 0 ? length : "") + "]"); - const dynamic = (length === -1 || coder.dynamic); - super("array", type, localName, dynamic); - (0, index_js_1.defineProperties)(this, { coder, length }); - } - defaultValue() { - // Verifies the child coder is valid (even if the array is dynamic or 0-length) - const defaultChild = this.coder.defaultValue(); - const result = []; - for (let i = 0; i < this.length; i++) { - result.push(defaultChild); - } - return result; - } - encode(writer, _value) { - const value = typed_js_1.Typed.dereference(_value, "array"); - if (!Array.isArray(value)) { - this._throwError("expected array value", value); - } - let count = this.length; - if (count === -1) { - count = value.length; - writer.writeValue(value.length); - } - (0, index_js_1.assertArgumentCount)(value.length, count, "coder array" + (this.localName ? (" " + this.localName) : "")); - let coders = []; - for (let i = 0; i < value.length; i++) { - coders.push(this.coder); - } - return pack(writer, coders, value); - } - decode(reader) { - let count = this.length; - if (count === -1) { - count = reader.readIndex(); - // Check that there is *roughly* enough data to ensure - // stray random data is not being read as a length. Each - // slot requires at least 32 bytes for their value (or 32 - // bytes as a link to the data). This could use a much - // tighter bound, but we are erroring on the side of safety. - (0, index_js_1.assert)(count * abstract_coder_js_1.WordSize <= reader.dataLength, "insufficient data length", "BUFFER_OVERRUN", { buffer: reader.bytes, offset: count * abstract_coder_js_1.WordSize, length: reader.dataLength }); - } - let coders = []; - for (let i = 0; i < count; i++) { - coders.push(new anonymous_js_1.AnonymousCoder(this.coder)); - } - return unpack(reader, coders); - } -} -exports.ArrayCoder = ArrayCoder; -//# sourceMappingURL=array.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/array.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/array.js.map deleted file mode 100644 index 0f4a7871..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/array.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"array.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/array.ts"],"names":[],"mappings":";;;AAAA,mDAE8B;AAE9B,0CAAoC;AAEpC,2DAAsE;AACtE,iDAAgD;AAIhD;;GAEG;AACH,SAAgB,IAAI,CAAC,MAAc,EAAE,MAA4B,EAAE,MAA8C;IAC7G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,CAAC,IAAI,6BAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;SAAE;QAEhF,OAAO,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,CAAC;CACJ;AA9DD,gCA8DC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/boolean.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/boolean.d.ts deleted file mode 100644 index f073e37e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/boolean.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class BooleanCoder extends Coder { - constructor(localName: string); - defaultValue(): boolean; - encode(writer: Writer, _value: boolean | Typed): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=boolean.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/boolean.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/boolean.d.ts.map deleted file mode 100644 index b1b5811e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/boolean.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"boolean.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/boolean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;gBAEvB,SAAS,EAAE,MAAM;IAI7B,YAAY,IAAI,OAAO;IAIvB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM;IAKvD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG9B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/boolean.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/boolean.js deleted file mode 100644 index bc8b5073..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/boolean.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.BooleanCoder = void 0; -const typed_js_1 = require("../typed.js"); -const abstract_coder_js_1 = require("./abstract-coder.js"); -/** - * @_ignore - */ -class BooleanCoder extends abstract_coder_js_1.Coder { - constructor(localName) { - super("bool", "bool", localName, false); - } - defaultValue() { - return false; - } - encode(writer, _value) { - const value = typed_js_1.Typed.dereference(_value, "bool"); - return writer.writeValue(value ? 1 : 0); - } - decode(reader) { - return !!reader.readValue(); - } -} -exports.BooleanCoder = BooleanCoder; -//# sourceMappingURL=boolean.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/boolean.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/boolean.js.map deleted file mode 100644 index 4fe42916..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/boolean.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"boolean.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/boolean.ts"],"names":[],"mappings":";;;AAAA,0CAAoC;AACpC,2DAA4C;AAI5C;;GAEG;AACH,MAAa,YAAa,SAAQ,yBAAK;IAEnC,YAAY,SAAiB;QACzB,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IAC5C,CAAC;IAED,YAAY;QACR,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,MAAuB;QAC1C,MAAM,KAAK,GAAG,gBAAK,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAChD,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3C,CAAC;IAED,MAAM,CAAC,MAAc;QACjB,OAAO,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;IAChC,CAAC;CACJ;AAlBD,oCAkBC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/bytes.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/bytes.d.ts deleted file mode 100644 index 1e554582..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/bytes.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Coder } from "./abstract-coder.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class DynamicBytesCoder extends Coder { - constructor(type: string, localName: string); - defaultValue(): string; - encode(writer: Writer, value: any): number; - decode(reader: Reader): any; -} -/** - * @_ignore - */ -export declare class BytesCoder extends DynamicBytesCoder { - constructor(localName: string); - decode(reader: Reader): any; -} -//# sourceMappingURL=bytes.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/bytes.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/bytes.d.ts.map deleted file mode 100644 index f1696167..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/bytes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bytes.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/bytes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG1D;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;gBAC5B,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAI3C,YAAY,IAAI,MAAM;IAItB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM;IAO1C,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG9B;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,iBAAiB;gBACjC,SAAS,EAAE,MAAM;IAI7B,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG9B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/bytes.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/bytes.js deleted file mode 100644 index 0788ed62..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/bytes.js +++ /dev/null @@ -1,39 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.BytesCoder = exports.DynamicBytesCoder = void 0; -const index_js_1 = require("../../utils/index.js"); -const abstract_coder_js_1 = require("./abstract-coder.js"); -/** - * @_ignore - */ -class DynamicBytesCoder extends abstract_coder_js_1.Coder { - constructor(type, localName) { - super(type, type, localName, true); - } - defaultValue() { - return "0x"; - } - encode(writer, value) { - value = (0, index_js_1.getBytesCopy)(value); - let length = writer.writeValue(value.length); - length += writer.writeBytes(value); - return length; - } - decode(reader) { - return reader.readBytes(reader.readIndex(), true); - } -} -exports.DynamicBytesCoder = DynamicBytesCoder; -/** - * @_ignore - */ -class BytesCoder extends DynamicBytesCoder { - constructor(localName) { - super("bytes", localName); - } - decode(reader) { - return (0, index_js_1.hexlify)(super.decode(reader)); - } -} -exports.BytesCoder = BytesCoder; -//# sourceMappingURL=bytes.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/bytes.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/bytes.js.map deleted file mode 100644 index 21ce2300..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/bytes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bytes.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/bytes.ts"],"names":[],"mappings":";;;AAAA,mDAA6D;AAE7D,2DAA4C;AAK5C;;GAEG;AACH,MAAa,iBAAkB,SAAQ,yBAAK;IACxC,YAAY,IAAY,EAAE,SAAiB;QACxC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;IACtC,CAAC;IAED,YAAY;QACR,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,KAAU;QAC7B,KAAK,GAAG,IAAA,uBAAY,EAAC,KAAK,CAAC,CAAC;QAC5B,IAAI,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC7C,MAAM,IAAI,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACnC,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,MAAM,CAAC,MAAc;QACjB,OAAO,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,IAAI,CAAC,CAAC;IACtD,CAAC;CACJ;AAnBD,8CAmBC;AAED;;GAEG;AACH,MAAa,UAAW,SAAQ,iBAAiB;IAC7C,YAAY,SAAiB;QACzB,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM,CAAC,MAAc;QACjB,OAAO,IAAA,kBAAO,EAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IACzC,CAAC;CACJ;AARD,gCAQC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/fixed-bytes.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/fixed-bytes.d.ts deleted file mode 100644 index 5c485fef..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/fixed-bytes.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; -import type { BytesLike } from "../../utils/index.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class FixedBytesCoder extends Coder { - readonly size: number; - constructor(size: number, localName: string); - defaultValue(): string; - encode(writer: Writer, _value: BytesLike | Typed): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=fixed-bytes.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/fixed-bytes.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/fixed-bytes.d.ts.map deleted file mode 100644 index fcf0893d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/fixed-bytes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fixed-bytes.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/fixed-bytes.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG1D;;GAEG;AACH,qBAAa,eAAgB,SAAQ,KAAK;IACtC,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;gBAEX,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAM3C,YAAY,IAAI,MAAM;IAItB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,KAAK,GAAG,MAAM;IAMzD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG9B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/fixed-bytes.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/fixed-bytes.js deleted file mode 100644 index 120d748a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/fixed-bytes.js +++ /dev/null @@ -1,32 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FixedBytesCoder = void 0; -const index_js_1 = require("../../utils/index.js"); -const typed_js_1 = require("../typed.js"); -const abstract_coder_js_1 = require("./abstract-coder.js"); -/** - * @_ignore - */ -class FixedBytesCoder extends abstract_coder_js_1.Coder { - size; - constructor(size, localName) { - let name = "bytes" + String(size); - super(name, name, localName, false); - (0, index_js_1.defineProperties)(this, { size }, { size: "number" }); - } - defaultValue() { - return ("0x0000000000000000000000000000000000000000000000000000000000000000").substring(0, 2 + this.size * 2); - } - encode(writer, _value) { - let data = (0, index_js_1.getBytesCopy)(typed_js_1.Typed.dereference(_value, this.type)); - if (data.length !== this.size) { - this._throwError("incorrect data length", _value); - } - return writer.writeBytes(data); - } - decode(reader) { - return (0, index_js_1.hexlify)(reader.readBytes(this.size)); - } -} -exports.FixedBytesCoder = FixedBytesCoder; -//# sourceMappingURL=fixed-bytes.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/fixed-bytes.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/fixed-bytes.js.map deleted file mode 100644 index 8bde48f1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/fixed-bytes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fixed-bytes.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/fixed-bytes.ts"],"names":[],"mappings":";;;AACA,mDAA+E;AAE/E,0CAAoC;AACpC,2DAA4C;AAO5C;;GAEG;AACH,MAAa,eAAgB,SAAQ,yBAAK;IAC7B,IAAI,CAAU;IAEvB,YAAY,IAAY,EAAE,SAAiB;QACvC,IAAI,IAAI,GAAG,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;QAClC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;QACpC,IAAA,2BAAgB,EAAkB,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED,YAAY;QACR,OAAO,CAAC,oEAAoE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;IAClH,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,MAAyB;QAC5C,IAAI,IAAI,GAAG,IAAA,uBAAY,EAAC,gBAAK,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC9D,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,IAAI,EAAE;YAAE,IAAI,CAAC,WAAW,CAAC,uBAAuB,EAAE,MAAM,CAAC,CAAC;SAAE;QACrF,OAAO,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,MAAM,CAAC,MAAc;QACjB,OAAO,IAAA,kBAAO,EAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAChD,CAAC;CACJ;AAtBD,0CAsBC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/null.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/null.d.ts deleted file mode 100644 index 5df5da34..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/null.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Coder } from "./abstract-coder.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class NullCoder extends Coder { - constructor(localName: string); - defaultValue(): null; - encode(writer: Writer, value: any): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=null.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/null.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/null.d.ts.map deleted file mode 100644 index 4c87b845..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/null.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"null.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/null.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAI1D;;GAEG;AACH,qBAAa,SAAU,SAAQ,KAAK;gBAEpB,SAAS,EAAE,MAAM;IAI7B,YAAY,IAAI,IAAI;IAIpB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM;IAK1C,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAI9B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/null.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/null.js deleted file mode 100644 index e9af0056..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/null.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.NullCoder = void 0; -const abstract_coder_js_1 = require("./abstract-coder.js"); -const Empty = new Uint8Array([]); -/** - * @_ignore - */ -class NullCoder extends abstract_coder_js_1.Coder { - constructor(localName) { - super("null", "", localName, false); - } - defaultValue() { - return null; - } - encode(writer, value) { - if (value != null) { - this._throwError("not null", value); - } - return writer.writeBytes(Empty); - } - decode(reader) { - reader.readBytes(0); - return null; - } -} -exports.NullCoder = NullCoder; -//# sourceMappingURL=null.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/null.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/null.js.map deleted file mode 100644 index 032ea260..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/null.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"null.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/null.ts"],"names":[],"mappings":";;;AAAA,2DAA4C;AAG5C,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,EAAG,CAAC,CAAC;AAElC;;GAEG;AACH,MAAa,SAAU,SAAQ,yBAAK;IAEhC,YAAY,SAAiB;QACzB,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IACxC,CAAC;IAED,YAAY;QACR,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,KAAU;QAC7B,IAAI,KAAK,IAAI,IAAI,EAAE;YAAE,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;SAAE;QAC3D,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;IAED,MAAM,CAAC,MAAc;QACjB,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QACpB,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAnBD,8BAmBC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/number.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/number.d.ts deleted file mode 100644 index 822cc6df..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/number.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; -import type { BigNumberish } from "../../utils/index.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class NumberCoder extends Coder { - readonly size: number; - readonly signed: boolean; - constructor(size: number, signed: boolean, localName: string); - defaultValue(): number; - encode(writer: Writer, _value: BigNumberish | Typed): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=number.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/number.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/number.d.ts.map deleted file mode 100644 index a02820f6..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/number.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/number.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAY,MAAM,qBAAqB,CAAC;AAEtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAO1D;;GAEG;AACH,qBAAa,WAAY,SAAQ,KAAK;IAClC,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAG,OAAO,CAAC;gBAEd,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM;IAO5D,YAAY,IAAI,MAAM;IAItB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,KAAK,GAAG,MAAM;IAkB5D,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAS9B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/number.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/number.js deleted file mode 100644 index efce6f71..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/number.js +++ /dev/null @@ -1,49 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.NumberCoder = void 0; -const index_js_1 = require("../../utils/index.js"); -const typed_js_1 = require("../typed.js"); -const abstract_coder_js_1 = require("./abstract-coder.js"); -const BN_0 = BigInt(0); -const BN_1 = BigInt(1); -const BN_MAX_UINT256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); -/** - * @_ignore - */ -class NumberCoder extends abstract_coder_js_1.Coder { - size; - signed; - constructor(size, signed, localName) { - const name = ((signed ? "int" : "uint") + (size * 8)); - super(name, name, localName, false); - (0, index_js_1.defineProperties)(this, { size, signed }, { size: "number", signed: "boolean" }); - } - defaultValue() { - return 0; - } - encode(writer, _value) { - let value = (0, index_js_1.getBigInt)(typed_js_1.Typed.dereference(_value, this.type)); - // Check bounds are safe for encoding - let maxUintValue = (0, index_js_1.mask)(BN_MAX_UINT256, abstract_coder_js_1.WordSize * 8); - if (this.signed) { - let bounds = (0, index_js_1.mask)(maxUintValue, (this.size * 8) - 1); - if (value > bounds || value < -(bounds + BN_1)) { - this._throwError("value out-of-bounds", _value); - } - value = (0, index_js_1.toTwos)(value, 8 * abstract_coder_js_1.WordSize); - } - else if (value < BN_0 || value > (0, index_js_1.mask)(maxUintValue, this.size * 8)) { - this._throwError("value out-of-bounds", _value); - } - return writer.writeValue(value); - } - decode(reader) { - let value = (0, index_js_1.mask)(reader.readValue(), this.size * 8); - if (this.signed) { - value = (0, index_js_1.fromTwos)(value, this.size * 8); - } - return value; - } -} -exports.NumberCoder = NumberCoder; -//# sourceMappingURL=number.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/number.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/number.js.map deleted file mode 100644 index f0c9ee72..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/number.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"number.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/number.ts"],"names":[],"mappings":";;;AAAA,mDAE8B;AAE9B,0CAAoC;AACpC,2DAAsD;AAOtD,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,cAAc,GAAG,MAAM,CAAC,oEAAoE,CAAC,CAAC;AAEpG;;GAEG;AACH,MAAa,WAAY,SAAQ,yBAAK;IACzB,IAAI,CAAU;IACd,MAAM,CAAW;IAE1B,YAAY,IAAY,EAAE,MAAe,EAAE,SAAiB;QACxD,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAA,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC;QACrD,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;QAEpC,IAAA,2BAAgB,EAAc,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;IACjG,CAAC;IAED,YAAY;QACR,OAAO,CAAC,CAAC;IACb,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,MAA4B;QAC/C,IAAI,KAAK,GAAG,IAAA,oBAAS,EAAC,gBAAK,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAE5D,qCAAqC;QACrC,IAAI,YAAY,GAAG,IAAA,eAAI,EAAC,cAAc,EAAE,4BAAQ,GAAG,CAAC,CAAC,CAAC;QACtD,IAAI,IAAI,CAAC,MAAM,EAAE;YACb,IAAI,MAAM,GAAG,IAAA,eAAI,EAAC,YAAY,EAAE,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YACrD,IAAI,KAAK,GAAG,MAAM,IAAI,KAAK,GAAG,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE;gBAC5C,IAAI,CAAC,WAAW,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;aACnD;YACD,KAAK,GAAG,IAAA,iBAAM,EAAC,KAAK,EAAE,CAAC,GAAG,4BAAQ,CAAC,CAAC;SACvC;aAAM,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,GAAG,IAAA,eAAI,EAAC,YAAY,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,EAAE;YAClE,IAAI,CAAC,WAAW,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;SACnD;QAED,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;IAED,MAAM,CAAC,MAAc;QACjB,IAAI,KAAK,GAAG,IAAA,eAAI,EAAC,MAAM,CAAC,SAAS,EAAE,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;QAEpD,IAAI,IAAI,CAAC,MAAM,EAAE;YACb,KAAK,GAAG,IAAA,mBAAQ,EAAC,KAAK,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;SAC1C;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ;AA1CD,kCA0CC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/string.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/string.d.ts deleted file mode 100644 index 8e1c6359..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/string.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Typed } from "../typed.js"; -import { DynamicBytesCoder } from "./bytes.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class StringCoder extends DynamicBytesCoder { - constructor(localName: string); - defaultValue(): string; - encode(writer: Writer, _value: string | Typed): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=string.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/string.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/string.d.ts.map deleted file mode 100644 index 8141f2ea..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/string.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/string.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG1D;;GAEG;AACH,qBAAa,WAAY,SAAQ,iBAAiB;gBAElC,SAAS,EAAE,MAAM;IAI7B,YAAY,IAAI,MAAM;IAItB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM;IAItD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG9B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/string.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/string.js deleted file mode 100644 index 7370af01..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/string.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.StringCoder = void 0; -const utf8_js_1 = require("../../utils/utf8.js"); -const typed_js_1 = require("../typed.js"); -const bytes_js_1 = require("./bytes.js"); -/** - * @_ignore - */ -class StringCoder extends bytes_js_1.DynamicBytesCoder { - constructor(localName) { - super("string", localName); - } - defaultValue() { - return ""; - } - encode(writer, _value) { - return super.encode(writer, (0, utf8_js_1.toUtf8Bytes)(typed_js_1.Typed.dereference(_value, "string"))); - } - decode(reader) { - return (0, utf8_js_1.toUtf8String)(super.decode(reader)); - } -} -exports.StringCoder = StringCoder; -//# sourceMappingURL=string.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/string.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/string.js.map deleted file mode 100644 index 1c65f067..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/string.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"string.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/string.ts"],"names":[],"mappings":";;;AAAA,iDAAgE;AAEhE,0CAAoC;AACpC,yCAA+C;AAK/C;;GAEG;AACH,MAAa,WAAY,SAAQ,4BAAiB;IAE9C,YAAY,SAAiB;QACzB,KAAK,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IAC/B,CAAC;IAED,YAAY;QACR,OAAO,EAAE,CAAC;IACd,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,MAAsB;QACzC,OAAO,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,IAAA,qBAAW,EAAC,gBAAK,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IAClF,CAAC;IAED,MAAM,CAAC,MAAc;QACjB,OAAO,IAAA,sBAAY,EAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9C,CAAC;CACJ;AAjBD,kCAiBC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/tuple.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/tuple.d.ts deleted file mode 100644 index fe3ec032..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/tuple.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class TupleCoder extends Coder { - readonly coders: ReadonlyArray; - constructor(coders: Array, localName: string); - defaultValue(): any; - encode(writer: Writer, _value: Array | { - [name: string]: any; - } | Typed): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=tuple.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/tuple.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/tuple.d.ts.map deleted file mode 100644 index a7a22ec0..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/tuple.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tuple.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/tuple.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAI5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACjC,QAAQ,CAAC,MAAM,EAAG,aAAa,CAAC,KAAK,CAAC,CAAC;gBAE3B,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,MAAM;IAanD,YAAY,IAAI,GAAG;IA+BnB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG;QAAE,CAAE,IAAI,EAAE,MAAM,GAAI,GAAG,CAAA;KAAE,GAAG,KAAK,GAAG,MAAM;IAKtF,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG9B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/tuple.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/tuple.js deleted file mode 100644 index 0990ef5a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/tuple.js +++ /dev/null @@ -1,67 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.TupleCoder = void 0; -const properties_js_1 = require("../../utils/properties.js"); -const typed_js_1 = require("../typed.js"); -const abstract_coder_js_1 = require("./abstract-coder.js"); -const array_js_1 = require("./array.js"); -/** - * @_ignore - */ -class TupleCoder extends abstract_coder_js_1.Coder { - coders; - constructor(coders, localName) { - let dynamic = false; - const types = []; - coders.forEach((coder) => { - if (coder.dynamic) { - dynamic = true; - } - types.push(coder.type); - }); - const type = ("tuple(" + types.join(",") + ")"); - super("tuple", type, localName, dynamic); - (0, properties_js_1.defineProperties)(this, { coders: Object.freeze(coders.slice()) }); - } - defaultValue() { - const values = []; - this.coders.forEach((coder) => { - values.push(coder.defaultValue()); - }); - // We only output named properties for uniquely named coders - const uniqueNames = this.coders.reduce((accum, coder) => { - const name = coder.localName; - if (name) { - if (!accum[name]) { - accum[name] = 0; - } - accum[name]++; - } - return accum; - }, {}); - // Add named values - this.coders.forEach((coder, index) => { - let name = coder.localName; - if (!name || uniqueNames[name] !== 1) { - return; - } - if (name === "length") { - name = "_length"; - } - if (values[name] != null) { - return; - } - values[name] = values[index]; - }); - return Object.freeze(values); - } - encode(writer, _value) { - const value = typed_js_1.Typed.dereference(_value, "tuple"); - return (0, array_js_1.pack)(writer, this.coders, value); - } - decode(reader) { - return (0, array_js_1.unpack)(reader, this.coders); - } -} -exports.TupleCoder = TupleCoder; -//# sourceMappingURL=tuple.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/tuple.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/tuple.js.map deleted file mode 100644 index ad66de8b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/coders/tuple.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tuple.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/tuple.ts"],"names":[],"mappings":";;;AAAA,6DAA6D;AAE7D,0CAAoC;AACpC,2DAA4C;AAE5C,yCAA0C;AAI1C;;GAEG;AACH,MAAa,UAAW,SAAQ,yBAAK;IACxB,MAAM,CAAwB;IAEvC,YAAY,MAAoB,EAAE,SAAiB;QAC/C,IAAI,OAAO,GAAG,KAAK,CAAC;QACpB,MAAM,KAAK,GAAkB,EAAE,CAAC;QAChC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YACrB,IAAI,KAAK,CAAC,OAAO,EAAE;gBAAE,OAAO,GAAG,IAAI,CAAC;aAAE;YACtC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC;QACH,MAAM,IAAI,GAAG,CAAC,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC;QAEhD,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;QACzC,IAAA,gCAAgB,EAAa,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;IAClF,CAAC;IAED,YAAY;QACR,MAAM,MAAM,GAAQ,EAAG,CAAC;QACxB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YAC1B,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;QAEH,4DAA4D;QAC5D,MAAM,WAAW,GAAG,IAAI,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AuDC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/fragments.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/fragments.d.ts deleted file mode 100644 index cafb0a5a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/fragments.d.ts +++ /dev/null @@ -1,466 +0,0 @@ -/** - * A fragment is a single item from an ABI, which may represent any of: - * - * - [Functions](FunctionFragment) - * - [Events](EventFragment) - * - [Constructors](ConstructorFragment) - * - Custom [Errors](ErrorFragment) - * - [Fallback or Receive](FallbackFragment) functions - * - * @_subsection api/abi/abi-coder:Fragments [about-fragments] - */ -/** - * A Type description in a [JSON ABI format](link-solc-jsonabi). - */ -export interface JsonFragmentType { - /** - * The parameter name. - */ - readonly name?: string; - /** - * If the parameter is indexed. - */ - readonly indexed?: boolean; - /** - * The type of the parameter. - */ - readonly type?: string; - /** - * The internal Solidity type. - */ - readonly internalType?: string; - /** - * The components for a tuple. - */ - readonly components?: ReadonlyArray; -} -/** - * A fragment for a method, event or error in a [JSON ABI format](link-solc-jsonabi). - */ -export interface JsonFragment { - /** - * The name of the error, event, function, etc. - */ - readonly name?: string; - /** - * The type of the fragment (e.g. ``event``, ``"function"``, etc.) - */ - readonly type?: string; - /** - * If the event is anonymous. - */ - readonly anonymous?: boolean; - /** - * If the function is payable. - */ - readonly payable?: boolean; - /** - * If the function is constant. - */ - readonly constant?: boolean; - /** - * The mutability state of the function. - */ - readonly stateMutability?: string; - /** - * The input parameters. - */ - readonly inputs?: ReadonlyArray; - /** - * The output parameters. - */ - readonly outputs?: ReadonlyArray; - /** - * The gas limit to use when sending a transaction for this function. - */ - readonly gas?: string; -} -/** - * The format to serialize the output as. - * - * **``"sighash"``** - the bare formatting, used to compute the selector - * or topic hash; this format cannot be reversed (as it discards ``indexed``) - * so cannot by used to export an [[Interface]]. - * - * **``"minimal"``** - Human-Readable ABI with minimal spacing and without - * names, so it is compact, but will result in Result objects that cannot - * be accessed by name. - * - * **``"full"``** - Full Human-Readable ABI, with readable spacing and names - * intact; this is generally the recommended format. - * - * **``"json"``** - The [JSON ABI format](link-solc-jsonabi). - */ -export type FormatType = "sighash" | "minimal" | "full" | "json"; -/** - * When [walking](ParamType-walk) a [[ParamType]], this is called - * on each component. - */ -export type ParamTypeWalkFunc = (type: string, value: any) => any; -/** - * When [walking asynchronously](ParamType-walkAsync) a [[ParamType]], - * this is called on each component. - */ -export type ParamTypeWalkAsyncFunc = (type: string, value: any) => any | Promise; -/** - * Each input and output of a [[Fragment]] is an Array of **ParamType**. - */ -export declare class ParamType { - #private; - /** - * The local name of the parameter (or ``""`` if unbound) - */ - readonly name: string; - /** - * The fully qualified type (e.g. ``"address"``, ``"tuple(address)"``, - * ``"uint256[3][]"``) - */ - readonly type: string; - /** - * The base type (e.g. ``"address"``, ``"tuple"``, ``"array"``) - */ - readonly baseType: string; - /** - * True if the parameters is indexed. - * - * For non-indexable types this is ``null``. - */ - readonly indexed: null | boolean; - /** - * The components for the tuple. - * - * For non-tuple types this is ``null``. - */ - readonly components: null | ReadonlyArray; - /** - * The array length, or ``-1`` for dynamic-lengthed arrays. - * - * For non-array types this is ``null``. - */ - readonly arrayLength: null | number; - /** - * The type of each child in the array. - * - * For non-array types this is ``null``. - */ - readonly arrayChildren: null | ParamType; - /** - * @private - */ - constructor(guard: any, name: string, type: string, baseType: string, indexed: null | boolean, components: null | ReadonlyArray, arrayLength: null | number, arrayChildren: null | ParamType); - /** - * Return a string representation of this type. - * - * For example, - * - * ``sighash" => "(uint256,address)"`` - * - * ``"minimal" => "tuple(uint256,address) indexed"`` - * - * ``"full" => "tuple(uint256 foo, address bar) indexed baz"`` - */ - format(format?: FormatType): string; - /** - * Returns true if %%this%% is an Array type. - * - * This provides a type gaurd ensuring that [[arrayChildren]] - * and [[arrayLength]] are non-null. - */ - isArray(): this is (ParamType & { - arrayChildren: ParamType; - arrayLength: number; - }); - /** - * Returns true if %%this%% is a Tuple type. - * - * This provides a type gaurd ensuring that [[components]] - * is non-null. - */ - isTuple(): this is (ParamType & { - components: ReadonlyArray; - }); - /** - * Returns true if %%this%% is an Indexable type. - * - * This provides a type gaurd ensuring that [[indexed]] - * is non-null. - */ - isIndexable(): this is (ParamType & { - indexed: boolean; - }); - /** - * Walks the **ParamType** with %%value%%, calling %%process%% - * on each type, destructing the %%value%% recursively. - */ - walk(value: any, process: ParamTypeWalkFunc): any; - /** - * Walks the **ParamType** with %%value%%, asynchronously calling - * %%process%% on each type, destructing the %%value%% recursively. - * - * This can be used to resolve ENS names by walking and resolving each - * ``"address"`` type. - */ - walkAsync(value: any, process: ParamTypeWalkAsyncFunc): Promise; - /** - * Creates a new **ParamType** for %%obj%%. - * - * If %%allowIndexed%% then the ``indexed`` keyword is permitted, - * otherwise the ``indexed`` keyword will throw an error. - */ - static from(obj: any, allowIndexed?: boolean): ParamType; - /** - * Returns true if %%value%% is a **ParamType**. - */ - static isParamType(value: any): value is ParamType; -} -/** - * The type of a [[Fragment]]. - */ -export type FragmentType = "constructor" | "error" | "event" | "fallback" | "function" | "struct"; -/** - * An abstract class to represent An individual fragment from a parse ABI. - */ -export declare abstract class Fragment { - /** - * The type of the fragment. - */ - readonly type: FragmentType; - /** - * The inputs for the fragment. - */ - readonly inputs: ReadonlyArray; - /** - * @private - */ - constructor(guard: any, type: FragmentType, inputs: ReadonlyArray); - /** - * Returns a string representation of this fragment as %%format%%. - */ - abstract format(format?: FormatType): string; - /** - * Creates a new **Fragment** for %%obj%%, wich can be any supported - * ABI frgament type. - */ - static from(obj: any): Fragment; - /** - * Returns true if %%value%% is a [[ConstructorFragment]]. - */ - static isConstructor(value: any): value is ConstructorFragment; - /** - * Returns true if %%value%% is an [[ErrorFragment]]. - */ - static isError(value: any): value is ErrorFragment; - /** - * Returns true if %%value%% is an [[EventFragment]]. - */ - static isEvent(value: any): value is EventFragment; - /** - * Returns true if %%value%% is a [[FunctionFragment]]. - */ - static isFunction(value: any): value is FunctionFragment; - /** - * Returns true if %%value%% is a [[StructFragment]]. - */ - static isStruct(value: any): value is StructFragment; -} -/** - * An abstract class to represent An individual fragment - * which has a name from a parse ABI. - */ -export declare abstract class NamedFragment extends Fragment { - /** - * The name of the fragment. - */ - readonly name: string; - /** - * @private - */ - constructor(guard: any, type: FragmentType, name: string, inputs: ReadonlyArray); -} -/** - * A Fragment which represents a //Custom Error//. - */ -export declare class ErrorFragment extends NamedFragment { - /** - * @private - */ - constructor(guard: any, name: string, inputs: ReadonlyArray); - /** - * The Custom Error selector. - */ - get selector(): string; - /** - * Returns a string representation of this fragment as %%format%%. - */ - format(format?: FormatType): string; - /** - * Returns a new **ErrorFragment** for %%obj%%. - */ - static from(obj: any): ErrorFragment; - /** - * Returns ``true`` and provides a type guard if %%value%% is an - * **ErrorFragment**. - */ - static isFragment(value: any): value is ErrorFragment; -} -/** - * A Fragment which represents an Event. - */ -export declare class EventFragment extends NamedFragment { - /** - * Whether this event is anonymous. - */ - readonly anonymous: boolean; - /** - * @private - */ - constructor(guard: any, name: string, inputs: ReadonlyArray, anonymous: boolean); - /** - * The Event topic hash. - */ - get topicHash(): string; - /** - * Returns a string representation of this event as %%format%%. - */ - format(format?: FormatType): string; - /** - * Return the topic hash for an event with %%name%% and %%params%%. - */ - static getTopicHash(name: string, params?: Array): string; - /** - * Returns a new **EventFragment** for %%obj%%. - */ - static from(obj: any): EventFragment; - /** - * Returns ``true`` and provides a type guard if %%value%% is an - * **EventFragment**. - */ - static isFragment(value: any): value is EventFragment; -} -/** - * A Fragment which represents a constructor. - */ -export declare class ConstructorFragment extends Fragment { - /** - * Whether the constructor can receive an endowment. - */ - readonly payable: boolean; - /** - * The recommended gas limit for deployment or ``null``. - */ - readonly gas: null | bigint; - /** - * @private - */ - constructor(guard: any, type: FragmentType, inputs: ReadonlyArray, payable: boolean, gas: null | bigint); - /** - * Returns a string representation of this constructor as %%format%%. - */ - format(format?: FormatType): string; - /** - * Returns a new **ConstructorFragment** for %%obj%%. - */ - static from(obj: any): ConstructorFragment; - /** - * Returns ``true`` and provides a type guard if %%value%% is a - * **ConstructorFragment**. - */ - static isFragment(value: any): value is ConstructorFragment; -} -/** - * A Fragment which represents a method. - */ -export declare class FallbackFragment extends Fragment { - /** - * If the function can be sent value during invocation. - */ - readonly payable: boolean; - constructor(guard: any, inputs: ReadonlyArray, payable: boolean); - /** - * Returns a string representation of this fallback as %%format%%. - */ - format(format?: FormatType): string; - /** - * Returns a new **FallbackFragment** for %%obj%%. - */ - static from(obj: any): FallbackFragment; - /** - * Returns ``true`` and provides a type guard if %%value%% is a - * **FallbackFragment**. - */ - static isFragment(value: any): value is FallbackFragment; -} -/** - * A Fragment which represents a method. - */ -export declare class FunctionFragment extends NamedFragment { - /** - * If the function is constant (e.g. ``pure`` or ``view`` functions). - */ - readonly constant: boolean; - /** - * The returned types for the result of calling this function. - */ - readonly outputs: ReadonlyArray; - /** - * The state mutability (e.g. ``payable``, ``nonpayable``, ``view`` - * or ``pure``) - */ - readonly stateMutability: "payable" | "nonpayable" | "view" | "pure"; - /** - * If the function can be sent value during invocation. - */ - readonly payable: boolean; - /** - * The recommended gas limit to send when calling this function. - */ - readonly gas: null | bigint; - /** - * @private - */ - constructor(guard: any, name: string, stateMutability: "payable" | "nonpayable" | "view" | "pure", inputs: ReadonlyArray, outputs: ReadonlyArray, gas: null | bigint); - /** - * The Function selector. - */ - get selector(): string; - /** - * Returns a string representation of this function as %%format%%. - */ - format(format?: FormatType): string; - /** - * Return the selector for a function with %%name%% and %%params%%. - */ - static getSelector(name: string, params?: Array): string; - /** - * Returns a new **FunctionFragment** for %%obj%%. - */ - static from(obj: any): FunctionFragment; - /** - * Returns ``true`` and provides a type guard if %%value%% is a - * **FunctionFragment**. - */ - static isFragment(value: any): value is FunctionFragment; -} -/** - * A Fragment which represents a structure. - */ -export declare class StructFragment extends NamedFragment { - /** - * @private - */ - constructor(guard: any, name: string, inputs: ReadonlyArray); - /** - * Returns a string representation of this struct as %%format%%. - */ - format(): string; - /** - * Returns a new **StructFragment** for %%obj%%. - */ - static from(obj: any): StructFragment; - /** - * Returns ``true`` and provides a type guard if %%value%% is a - * **StructFragment**. - */ - static isFragment(value: any): value is FunctionFragment; -} -//# sourceMappingURL=fragments.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/fragments.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/fragments.d.ts.map deleted file mode 100644 index 8ff0a603..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/fragments.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fragments.d.ts","sourceRoot":"","sources":["../../src.ts/abi/fragments.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAQH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAE/B;;OAEG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;CACzD;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAE5B;;OAEG;IACH,QAAQ,CAAC,eAAe,CAAC,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,EAAE,IAAI,GAAG,MAAM;IAS1L;;OAEG;IACH,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED;;OAEG;IACH,MAAM,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,MAAM;IAoCnC;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM;IAM7D;;OAEG;IACH,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,gBAAgB;IAuDvC;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,gBAAgB;CAG3D;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,aAAa;IAE7C;;OAEG;gBACS,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC;IAKtE;;OAEG;IACH,MAAM,IAAI,MAAM;IAIhB;;OAEG;IACH,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,cAAc;IAmBrC;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,gBAAgB;CAG3D"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/fragments.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/fragments.js deleted file mode 100644 index 4bbbe7c6..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/fragments.js +++ /dev/null @@ -1,1331 +0,0 @@ -"use strict"; -/** - * A fragment is a single item from an ABI, which may represent any of: - * - * - [Functions](FunctionFragment) - * - [Events](EventFragment) - * - [Constructors](ConstructorFragment) - * - Custom [Errors](ErrorFragment) - * - [Fallback or Receive](FallbackFragment) functions - * - * @_subsection api/abi/abi-coder:Fragments [about-fragments] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.StructFragment = exports.FunctionFragment = exports.FallbackFragment = exports.ConstructorFragment = exports.EventFragment = exports.ErrorFragment = exports.NamedFragment = exports.Fragment = exports.ParamType = void 0; -const index_js_1 = require("../utils/index.js"); -const index_js_2 = require("../hash/index.js"); -; -// [ "a", "b" ] => { "a": 1, "b": 1 } -function setify(items) { - const result = new Set(); - items.forEach((k) => result.add(k)); - return Object.freeze(result); -} -const _kwVisibDeploy = "external public payable override"; -const KwVisibDeploy = setify(_kwVisibDeploy.split(" ")); -// Visibility Keywords -const _kwVisib = "constant external internal payable private public pure view override"; -const KwVisib = setify(_kwVisib.split(" ")); -const _kwTypes = "constructor error event fallback function receive struct"; -const KwTypes = setify(_kwTypes.split(" ")); -const _kwModifiers = "calldata memory storage payable indexed"; -const KwModifiers = setify(_kwModifiers.split(" ")); -const _kwOther = "tuple returns"; -// All Keywords -const _keywords = [_kwTypes, _kwModifiers, _kwOther, _kwVisib].join(" "); -const Keywords = setify(_keywords.split(" ")); -// Single character tokens -const SimpleTokens = { - "(": "OPEN_PAREN", ")": "CLOSE_PAREN", - "[": "OPEN_BRACKET", "]": "CLOSE_BRACKET", - ",": "COMMA", "@": "AT" -}; -// Parser regexes to consume the next token -const regexWhitespacePrefix = new RegExp("^(\\s*)"); -const regexNumberPrefix = new RegExp("^([0-9]+)"); -const regexIdPrefix = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"); -// Parser regexs to check validity -const regexId = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"); -const regexType = new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$"); -class TokenString { - #offset; - #tokens; - get offset() { return this.#offset; } - get length() { return this.#tokens.length - this.#offset; } - constructor(tokens) { - this.#offset = 0; - this.#tokens = tokens.slice(); - } - clone() { return new TokenString(this.#tokens); } - reset() { this.#offset = 0; } - #subTokenString(from = 0, to = 0) { - return new TokenString(this.#tokens.slice(from, to).map((t) => { - return Object.freeze(Object.assign({}, t, { - match: (t.match - from), - linkBack: (t.linkBack - from), - linkNext: (t.linkNext - from), - })); - })); - } - // Pops and returns the value of the next token, if it is a keyword in allowed; throws if out of tokens - popKeyword(allowed) { - const top = this.peek(); - if (top.type !== "KEYWORD" || !allowed.has(top.text)) { - throw new Error(`expected keyword ${top.text}`); - } - return this.pop().text; - } - // Pops and returns the value of the next token if it is `type`; throws if out of tokens - popType(type) { - if (this.peek().type !== type) { - const top = this.peek(); - throw new Error(`expected ${type}; got ${top.type} ${JSON.stringify(top.text)}`); - } - return this.pop().text; - } - // Pops and returns a "(" TOKENS ")" - popParen() { - const top = this.peek(); - if (top.type !== "OPEN_PAREN") { - throw new Error("bad start"); - } - const result = this.#subTokenString(this.#offset + 1, top.match + 1); - this.#offset = top.match + 1; - return result; - } - // Pops and returns the items within "(" ITEM1 "," ITEM2 "," ... ")" - popParams() { - const top = this.peek(); - if (top.type !== "OPEN_PAREN") { - throw new Error("bad start"); - } - const result = []; - while (this.#offset < top.match - 1) { - const link = this.peek().linkNext; - result.push(this.#subTokenString(this.#offset + 1, link)); - this.#offset = link; - } - this.#offset = top.match + 1; - return result; - } - // Returns the top Token, throwing if out of tokens - peek() { - if (this.#offset >= this.#tokens.length) { - throw new Error("out-of-bounds"); - } - return this.#tokens[this.#offset]; - } - // Returns the next value, if it is a keyword in `allowed` - peekKeyword(allowed) { - const top = this.peekType("KEYWORD"); - return (top != null && allowed.has(top)) ? top : null; - } - // Returns the value of the next token if it is `type` - peekType(type) { - if (this.length === 0) { - return null; - } - const top = this.peek(); - return (top.type === type) ? top.text : null; - } - // Returns the next token; throws if out of tokens - pop() { - const result = this.peek(); - this.#offset++; - return result; - } - toString() { - const tokens = []; - for (let i = this.#offset; i < this.#tokens.length; i++) { - const token = this.#tokens[i]; - tokens.push(`${token.type}:${token.text}`); - } - return ``; - } -} -function lex(text) { - const tokens = []; - const throwError = (message) => { - const token = (offset < text.length) ? JSON.stringify(text[offset]) : "$EOI"; - throw new Error(`invalid token ${token} at ${offset}: ${message}`); - }; - let brackets = []; - let commas = []; - let offset = 0; - while (offset < text.length) { - // Strip off any leading whitespace - let cur = text.substring(offset); - let match = cur.match(regexWhitespacePrefix); - if (match) { - offset += match[1].length; - cur = text.substring(offset); - } - const token = { depth: brackets.length, linkBack: -1, linkNext: -1, match: -1, type: "", text: "", offset, value: -1 }; - tokens.push(token); - let type = (SimpleTokens[cur[0]] || ""); - if (type) { - token.type = type; - token.text = cur[0]; - offset++; - if (type === "OPEN_PAREN") { - brackets.push(tokens.length - 1); - commas.push(tokens.length - 1); - } - else if (type == "CLOSE_PAREN") { - if (brackets.length === 0) { - throwError("no matching open bracket"); - } - token.match = brackets.pop(); - (tokens[token.match]).match = tokens.length - 1; - token.depth--; - token.linkBack = commas.pop(); - (tokens[token.linkBack]).linkNext = tokens.length - 1; - } - else if (type === "COMMA") { - token.linkBack = commas.pop(); - (tokens[token.linkBack]).linkNext = tokens.length - 1; - commas.push(tokens.length - 1); - } - else if (type === "OPEN_BRACKET") { - token.type = "BRACKET"; - } - else if (type === "CLOSE_BRACKET") { - // Remove the CLOSE_BRACKET - let suffix = tokens.pop().text; - if (tokens.length > 0 && tokens[tokens.length - 1].type === "NUMBER") { - const value = tokens.pop().text; - suffix = value + suffix; - (tokens[tokens.length - 1]).value = (0, index_js_1.getNumber)(value); - } - if (tokens.length === 0 || tokens[tokens.length - 1].type !== "BRACKET") { - throw new Error("missing opening bracket"); - } - (tokens[tokens.length - 1]).text += suffix; - } - continue; - } - match = cur.match(regexIdPrefix); - if (match) { - token.text = match[1]; - offset += token.text.length; - if (Keywords.has(token.text)) { - token.type = "KEYWORD"; - continue; - } - if (token.text.match(regexType)) { - token.type = "TYPE"; - continue; - } - token.type = "ID"; - continue; - } - match = cur.match(regexNumberPrefix); - if (match) { - token.text = match[1]; - token.type = "NUMBER"; - offset += token.text.length; - continue; - } - throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset}`); - } - return new TokenString(tokens.map((t) => Object.freeze(t))); -} -// Check only one of `allowed` is in `set` -function allowSingle(set, allowed) { - let included = []; - for (const key in allowed.keys()) { - if (set.has(key)) { - included.push(key); - } - } - if (included.length > 1) { - throw new Error(`conflicting types: ${included.join(", ")}`); - } -} -// Functions to process a Solidity Signature TokenString from left-to-right for... -// ...the name with an optional type, returning the name -function consumeName(type, tokens) { - if (tokens.peekKeyword(KwTypes)) { - const keyword = tokens.pop().text; - if (keyword !== type) { - throw new Error(`expected ${type}, got ${keyword}`); - } - } - return tokens.popType("ID"); -} -// ...all keywords matching allowed, returning the keywords -function consumeKeywords(tokens, allowed) { - const keywords = new Set(); - while (true) { - const keyword = tokens.peekType("KEYWORD"); - if (keyword == null || (allowed && !allowed.has(keyword))) { - break; - } - tokens.pop(); - if (keywords.has(keyword)) { - throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`); - } - keywords.add(keyword); - } - return Object.freeze(keywords); -} -// ...all visibility keywords, returning the coalesced mutability -function consumeMutability(tokens) { - let modifiers = consumeKeywords(tokens, KwVisib); - // Detect conflicting modifiers - allowSingle(modifiers, setify("constant payable nonpayable".split(" "))); - allowSingle(modifiers, setify("pure view payable nonpayable".split(" "))); - // Process mutability states - if (modifiers.has("view")) { - return "view"; - } - if (modifiers.has("pure")) { - return "pure"; - } - if (modifiers.has("payable")) { - return "payable"; - } - if (modifiers.has("nonpayable")) { - return "nonpayable"; - } - // Process legacy `constant` last - if (modifiers.has("constant")) { - return "view"; - } - return "nonpayable"; -} -// ...a parameter list, returning the ParamType list -function consumeParams(tokens, allowIndexed) { - return tokens.popParams().map((t) => ParamType.from(t, allowIndexed)); -} -// ...a gas limit, returning a BigNumber or null if none -function consumeGas(tokens) { - if (tokens.peekType("AT")) { - tokens.pop(); - if (tokens.peekType("NUMBER")) { - return (0, index_js_1.getBigInt)(tokens.pop().text); - } - throw new Error("invalid gas"); - } - return null; -} -function consumeEoi(tokens) { - if (tokens.length) { - throw new Error(`unexpected tokens at offset ${tokens.offset}: ${tokens.toString()}`); - } -} -const regexArrayType = new RegExp(/^(.*)\[([0-9]*)\]$/); -function verifyBasicType(type) { - const match = type.match(regexType); - (0, index_js_1.assertArgument)(match, "invalid type", "type", type); - if (type === "uint") { - return "uint256"; - } - if (type === "int") { - return "int256"; - } - if (match[2]) { - // bytesXX - const length = parseInt(match[2]); - (0, index_js_1.assertArgument)(length !== 0 && length <= 32, "invalid bytes length", "type", type); - } - else if (match[3]) { - // intXX or uintXX - const size = parseInt(match[3]); - (0, index_js_1.assertArgument)(size !== 0 && size <= 256 && (size % 8) === 0, "invalid numeric width", "type", type); - } - return type; -} -// Make the Fragment constructors effectively private -const _guard = {}; -const internal = Symbol.for("_ethers_internal"); -const ParamTypeInternal = "_ParamTypeInternal"; -const ErrorFragmentInternal = "_ErrorInternal"; -const EventFragmentInternal = "_EventInternal"; -const ConstructorFragmentInternal = "_ConstructorInternal"; -const FallbackFragmentInternal = "_FallbackInternal"; -const FunctionFragmentInternal = "_FunctionInternal"; -const StructFragmentInternal = "_StructInternal"; -/** - * Each input and output of a [[Fragment]] is an Array of **ParamType**. - */ -class ParamType { - /** - * The local name of the parameter (or ``""`` if unbound) - */ - name; - /** - * The fully qualified type (e.g. ``"address"``, ``"tuple(address)"``, - * ``"uint256[3][]"``) - */ - type; - /** - * The base type (e.g. ``"address"``, ``"tuple"``, ``"array"``) - */ - baseType; - /** - * True if the parameters is indexed. - * - * For non-indexable types this is ``null``. - */ - indexed; - /** - * The components for the tuple. - * - * For non-tuple types this is ``null``. - */ - components; - /** - * The array length, or ``-1`` for dynamic-lengthed arrays. - * - * For non-array types this is ``null``. - */ - arrayLength; - /** - * The type of each child in the array. - * - * For non-array types this is ``null``. - */ - arrayChildren; - /** - * @private - */ - constructor(guard, name, type, baseType, indexed, components, arrayLength, arrayChildren) { - (0, index_js_1.assertPrivate)(guard, _guard, "ParamType"); - Object.defineProperty(this, internal, { value: ParamTypeInternal }); - if (components) { - components = Object.freeze(components.slice()); - } - if (baseType === "array") { - if (arrayLength == null || arrayChildren == null) { - throw new Error(""); - } - } - else if (arrayLength != null || arrayChildren != null) { - throw new Error(""); - } - if (baseType === "tuple") { - if (components == null) { - throw new Error(""); - } - } - else if (components != null) { - throw new Error(""); - } - (0, index_js_1.defineProperties)(this, { - name, type, baseType, indexed, components, arrayLength, arrayChildren - }); - } - /** - * Return a string representation of this type. - * - * For example, - * - * ``sighash" => "(uint256,address)"`` - * - * ``"minimal" => "tuple(uint256,address) indexed"`` - * - * ``"full" => "tuple(uint256 foo, address bar) indexed baz"`` - */ - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - const name = this.name || ""; - if (this.isArray()) { - const result = JSON.parse(this.arrayChildren.format("json")); - result.name = name; - result.type += `[${(this.arrayLength < 0 ? "" : String(this.arrayLength))}]`; - return JSON.stringify(result); - } - const result = { - type: ((this.baseType === "tuple") ? "tuple" : this.type), - name - }; - if (typeof (this.indexed) === "boolean") { - result.indexed = this.indexed; - } - if (this.isTuple()) { - result.components = this.components.map((c) => JSON.parse(c.format(format))); - } - return JSON.stringify(result); - } - let result = ""; - // Array - if (this.isArray()) { - result += this.arrayChildren.format(format); - result += `[${(this.arrayLength < 0 ? "" : String(this.arrayLength))}]`; - } - else { - if (this.isTuple()) { - result += "(" + this.components.map((comp) => comp.format(format)).join((format === "full") ? ", " : ",") + ")"; - } - else { - result += this.type; - } - } - if (format !== "sighash") { - if (this.indexed === true) { - result += " indexed"; - } - if (format === "full" && this.name) { - result += " " + this.name; - } - } - return result; - } - /** - * Returns true if %%this%% is an Array type. - * - * This provides a type gaurd ensuring that [[arrayChildren]] - * and [[arrayLength]] are non-null. - */ - isArray() { - return (this.baseType === "array"); - } - /** - * Returns true if %%this%% is a Tuple type. - * - * This provides a type gaurd ensuring that [[components]] - * is non-null. - */ - isTuple() { - return (this.baseType === "tuple"); - } - /** - * Returns true if %%this%% is an Indexable type. - * - * This provides a type gaurd ensuring that [[indexed]] - * is non-null. - */ - isIndexable() { - return (this.indexed != null); - } - /** - * Walks the **ParamType** with %%value%%, calling %%process%% - * on each type, destructing the %%value%% recursively. - */ - walk(value, process) { - if (this.isArray()) { - if (!Array.isArray(value)) { - throw new Error("invalid array value"); - } - if (this.arrayLength !== -1 && value.length !== this.arrayLength) { - throw new Error("array is wrong length"); - } - const _this = this; - return value.map((v) => (_this.arrayChildren.walk(v, process))); - } - if (this.isTuple()) { - if (!Array.isArray(value)) { - throw new Error("invalid tuple value"); - } - if (value.length !== this.components.length) { - throw new Error("array is wrong length"); - } - const _this = this; - return value.map((v, i) => (_this.components[i].walk(v, process))); - } - return process(this.type, value); - } - #walkAsync(promises, value, process, setValue) { - if (this.isArray()) { - if (!Array.isArray(value)) { - throw new Error("invalid array value"); - } - if (this.arrayLength !== -1 && value.length !== this.arrayLength) { - throw new Error("array is wrong length"); - } - const childType = this.arrayChildren; - const result = value.slice(); - result.forEach((value, index) => { - childType.#walkAsync(promises, value, process, (value) => { - result[index] = value; - }); - }); - setValue(result); - return; - } - if (this.isTuple()) { - const components = this.components; - // Convert the object into an array - let result; - if (Array.isArray(value)) { - result = value.slice(); - } - else { - if (value == null || typeof (value) !== "object") { - throw new Error("invalid tuple value"); - } - result = components.map((param) => { - if (!param.name) { - throw new Error("cannot use object value with unnamed components"); - } - if (!(param.name in value)) { - throw new Error(`missing value for component ${param.name}`); - } - return value[param.name]; - }); - } - if (result.length !== this.components.length) { - throw new Error("array is wrong length"); - } - result.forEach((value, index) => { - components[index].#walkAsync(promises, value, process, (value) => { - result[index] = value; - }); - }); - setValue(result); - return; - } - const result = process(this.type, value); - if (result.then) { - promises.push((async function () { setValue(await result); })()); - } - else { - setValue(result); - } - } - /** - * Walks the **ParamType** with %%value%%, asynchronously calling - * %%process%% on each type, destructing the %%value%% recursively. - * - * This can be used to resolve ENS names by walking and resolving each - * ``"address"`` type. - */ - async walkAsync(value, process) { - const promises = []; - const result = [value]; - this.#walkAsync(promises, value, process, (value) => { - result[0] = value; - }); - if (promises.length) { - await Promise.all(promises); - } - return result[0]; - } - /** - * Creates a new **ParamType** for %%obj%%. - * - * If %%allowIndexed%% then the ``indexed`` keyword is permitted, - * otherwise the ``indexed`` keyword will throw an error. - */ - static from(obj, allowIndexed) { - if (ParamType.isParamType(obj)) { - return obj; - } - if (typeof (obj) === "string") { - try { - return ParamType.from(lex(obj), allowIndexed); - } - catch (error) { - (0, index_js_1.assertArgument)(false, "invalid param type", "obj", obj); - } - } - else if (obj instanceof TokenString) { - let type = "", baseType = ""; - let comps = null; - if (consumeKeywords(obj, setify(["tuple"])).has("tuple") || obj.peekType("OPEN_PAREN")) { - // Tuple - baseType = "tuple"; - comps = obj.popParams().map((t) => ParamType.from(t)); - type = `tuple(${comps.map((c) => c.format()).join(",")})`; - } - else { - // Normal - type = verifyBasicType(obj.popType("TYPE")); - baseType = type; - } - // Check for Array - let arrayChildren = null; - let arrayLength = null; - while (obj.length && obj.peekType("BRACKET")) { - const bracket = obj.pop(); //arrays[i]; - arrayChildren = new ParamType(_guard, "", type, baseType, null, comps, arrayLength, arrayChildren); - arrayLength = bracket.value; - type += bracket.text; - baseType = "array"; - comps = null; - } - let indexed = null; - const keywords = consumeKeywords(obj, KwModifiers); - if (keywords.has("indexed")) { - if (!allowIndexed) { - throw new Error(""); - } - indexed = true; - } - const name = (obj.peekType("ID") ? obj.pop().text : ""); - if (obj.length) { - throw new Error("leftover tokens"); - } - return new ParamType(_guard, name, type, baseType, indexed, comps, arrayLength, arrayChildren); - } - const name = obj.name; - (0, index_js_1.assertArgument)(!name || (typeof (name) === "string" && name.match(regexId)), "invalid name", "obj.name", name); - let indexed = obj.indexed; - if (indexed != null) { - (0, index_js_1.assertArgument)(allowIndexed, "parameter cannot be indexed", "obj.indexed", obj.indexed); - indexed = !!indexed; - } - let type = obj.type; - let arrayMatch = type.match(regexArrayType); - if (arrayMatch) { - const arrayLength = parseInt(arrayMatch[2] || "-1"); - const arrayChildren = ParamType.from({ - type: arrayMatch[1], - components: obj.components - }); - return new ParamType(_guard, name || "", type, "array", indexed, null, arrayLength, arrayChildren); - } - if (type === "tuple" || type.startsWith("tuple(" /* fix: ) */) || type.startsWith("(" /* fix: ) */)) { - const comps = (obj.components != null) ? obj.components.map((c) => ParamType.from(c)) : null; - const tuple = new ParamType(_guard, name || "", type, "tuple", indexed, comps, null, null); - // @TODO: use lexer to validate and normalize type - return tuple; - } - type = verifyBasicType(obj.type); - return new ParamType(_guard, name || "", type, type, indexed, null, null, null); - } - /** - * Returns true if %%value%% is a **ParamType**. - */ - static isParamType(value) { - return (value && value[internal] === ParamTypeInternal); - } -} -exports.ParamType = ParamType; -/** - * An abstract class to represent An individual fragment from a parse ABI. - */ -class Fragment { - /** - * The type of the fragment. - */ - type; - /** - * The inputs for the fragment. - */ - inputs; - /** - * @private - */ - constructor(guard, type, inputs) { - (0, index_js_1.assertPrivate)(guard, _guard, "Fragment"); - inputs = Object.freeze(inputs.slice()); - (0, index_js_1.defineProperties)(this, { type, inputs }); - } - /** - * Creates a new **Fragment** for %%obj%%, wich can be any supported - * ABI frgament type. - */ - static from(obj) { - if (typeof (obj) === "string") { - // Try parsing JSON... - try { - Fragment.from(JSON.parse(obj)); - } - catch (e) { } - // ...otherwise, use the human-readable lexer - return Fragment.from(lex(obj)); - } - if (obj instanceof TokenString) { - // Human-readable ABI (already lexed) - const type = obj.peekKeyword(KwTypes); - switch (type) { - case "constructor": return ConstructorFragment.from(obj); - case "error": return ErrorFragment.from(obj); - case "event": return EventFragment.from(obj); - case "fallback": - case "receive": - return FallbackFragment.from(obj); - case "function": return FunctionFragment.from(obj); - case "struct": return StructFragment.from(obj); - } - } - else if (typeof (obj) === "object") { - // JSON ABI - switch (obj.type) { - case "constructor": return ConstructorFragment.from(obj); - case "error": return ErrorFragment.from(obj); - case "event": return EventFragment.from(obj); - case "fallback": - case "receive": - return FallbackFragment.from(obj); - case "function": return FunctionFragment.from(obj); - case "struct": return StructFragment.from(obj); - } - (0, index_js_1.assert)(false, `unsupported type: ${obj.type}`, "UNSUPPORTED_OPERATION", { - operation: "Fragment.from" - }); - } - (0, index_js_1.assertArgument)(false, "unsupported frgament object", "obj", obj); - } - /** - * Returns true if %%value%% is a [[ConstructorFragment]]. - */ - static isConstructor(value) { - return ConstructorFragment.isFragment(value); - } - /** - * Returns true if %%value%% is an [[ErrorFragment]]. - */ - static isError(value) { - return ErrorFragment.isFragment(value); - } - /** - * Returns true if %%value%% is an [[EventFragment]]. - */ - static isEvent(value) { - return EventFragment.isFragment(value); - } - /** - * Returns true if %%value%% is a [[FunctionFragment]]. - */ - static isFunction(value) { - return FunctionFragment.isFragment(value); - } - /** - * Returns true if %%value%% is a [[StructFragment]]. - */ - static isStruct(value) { - return StructFragment.isFragment(value); - } -} -exports.Fragment = Fragment; -/** - * An abstract class to represent An individual fragment - * which has a name from a parse ABI. - */ -class NamedFragment extends Fragment { - /** - * The name of the fragment. - */ - name; - /** - * @private - */ - constructor(guard, type, name, inputs) { - super(guard, type, inputs); - (0, index_js_1.assertArgument)(typeof (name) === "string" && name.match(regexId), "invalid identifier", "name", name); - inputs = Object.freeze(inputs.slice()); - (0, index_js_1.defineProperties)(this, { name }); - } -} -exports.NamedFragment = NamedFragment; -function joinParams(format, params) { - return "(" + params.map((p) => p.format(format)).join((format === "full") ? ", " : ",") + ")"; -} -/** - * A Fragment which represents a //Custom Error//. - */ -class ErrorFragment extends NamedFragment { - /** - * @private - */ - constructor(guard, name, inputs) { - super(guard, "error", name, inputs); - Object.defineProperty(this, internal, { value: ErrorFragmentInternal }); - } - /** - * The Custom Error selector. - */ - get selector() { - return (0, index_js_2.id)(this.format("sighash")).substring(0, 10); - } - /** - * Returns a string representation of this fragment as %%format%%. - */ - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - return JSON.stringify({ - type: "error", - name: this.name, - inputs: this.inputs.map((input) => JSON.parse(input.format(format))), - }); - } - const result = []; - if (format !== "sighash") { - result.push("error"); - } - result.push(this.name + joinParams(format, this.inputs)); - return result.join(" "); - } - /** - * Returns a new **ErrorFragment** for %%obj%%. - */ - static from(obj) { - if (ErrorFragment.isFragment(obj)) { - return obj; - } - if (typeof (obj) === "string") { - return ErrorFragment.from(lex(obj)); - } - else if (obj instanceof TokenString) { - const name = consumeName("error", obj); - const inputs = consumeParams(obj); - consumeEoi(obj); - return new ErrorFragment(_guard, name, inputs); - } - return new ErrorFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []); - } - /** - * Returns ``true`` and provides a type guard if %%value%% is an - * **ErrorFragment**. - */ - static isFragment(value) { - return (value && value[internal] === ErrorFragmentInternal); - } -} -exports.ErrorFragment = ErrorFragment; -/** - * A Fragment which represents an Event. - */ -class EventFragment extends NamedFragment { - /** - * Whether this event is anonymous. - */ - anonymous; - /** - * @private - */ - constructor(guard, name, inputs, anonymous) { - super(guard, "event", name, inputs); - Object.defineProperty(this, internal, { value: EventFragmentInternal }); - (0, index_js_1.defineProperties)(this, { anonymous }); - } - /** - * The Event topic hash. - */ - get topicHash() { - return (0, index_js_2.id)(this.format("sighash")); - } - /** - * Returns a string representation of this event as %%format%%. - */ - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - return JSON.stringify({ - type: "event", - anonymous: this.anonymous, - name: this.name, - inputs: this.inputs.map((i) => JSON.parse(i.format(format))) - }); - } - const result = []; - if (format !== "sighash") { - result.push("event"); - } - result.push(this.name + joinParams(format, this.inputs)); - if (format !== "sighash" && this.anonymous) { - result.push("anonymous"); - } - return result.join(" "); - } - /** - * Return the topic hash for an event with %%name%% and %%params%%. - */ - static getTopicHash(name, params) { - params = (params || []).map((p) => ParamType.from(p)); - const fragment = new EventFragment(_guard, name, params, false); - return fragment.topicHash; - } - /** - * Returns a new **EventFragment** for %%obj%%. - */ - static from(obj) { - if (EventFragment.isFragment(obj)) { - return obj; - } - if (typeof (obj) === "string") { - try { - return EventFragment.from(lex(obj)); - } - catch (error) { - (0, index_js_1.assertArgument)(false, "invalid event fragment", "obj", obj); - } - } - else if (obj instanceof TokenString) { - const name = consumeName("event", obj); - const inputs = consumeParams(obj, true); - const anonymous = !!consumeKeywords(obj, setify(["anonymous"])).has("anonymous"); - consumeEoi(obj); - return new EventFragment(_guard, name, inputs, anonymous); - } - return new EventFragment(_guard, obj.name, obj.inputs ? obj.inputs.map((p) => ParamType.from(p, true)) : [], !!obj.anonymous); - } - /** - * Returns ``true`` and provides a type guard if %%value%% is an - * **EventFragment**. - */ - static isFragment(value) { - return (value && value[internal] === EventFragmentInternal); - } -} -exports.EventFragment = EventFragment; -/** - * A Fragment which represents a constructor. - */ -class ConstructorFragment extends Fragment { - /** - * Whether the constructor can receive an endowment. - */ - payable; - /** - * The recommended gas limit for deployment or ``null``. - */ - gas; - /** - * @private - */ - constructor(guard, type, inputs, payable, gas) { - super(guard, type, inputs); - Object.defineProperty(this, internal, { value: ConstructorFragmentInternal }); - (0, index_js_1.defineProperties)(this, { payable, gas }); - } - /** - * Returns a string representation of this constructor as %%format%%. - */ - format(format) { - (0, index_js_1.assert)(format != null && format !== "sighash", "cannot format a constructor for sighash", "UNSUPPORTED_OPERATION", { operation: "format(sighash)" }); - if (format === "json") { - return JSON.stringify({ - type: "constructor", - stateMutability: (this.payable ? "payable" : "undefined"), - payable: this.payable, - gas: ((this.gas != null) ? this.gas : undefined), - inputs: this.inputs.map((i) => JSON.parse(i.format(format))) - }); - } - const result = [`constructor${joinParams(format, this.inputs)}`]; - if (this.payable) { - result.push("payable"); - } - if (this.gas != null) { - result.push(`@${this.gas.toString()}`); - } - return result.join(" "); - } - /** - * Returns a new **ConstructorFragment** for %%obj%%. - */ - static from(obj) { - if (ConstructorFragment.isFragment(obj)) { - return obj; - } - if (typeof (obj) === "string") { - try { - return ConstructorFragment.from(lex(obj)); - } - catch (error) { - (0, index_js_1.assertArgument)(false, "invalid constuctor fragment", "obj", obj); - } - } - else if (obj instanceof TokenString) { - consumeKeywords(obj, setify(["constructor"])); - const inputs = consumeParams(obj); - const payable = !!consumeKeywords(obj, KwVisibDeploy).has("payable"); - const gas = consumeGas(obj); - consumeEoi(obj); - return new ConstructorFragment(_guard, "constructor", inputs, payable, gas); - } - return new ConstructorFragment(_guard, "constructor", obj.inputs ? obj.inputs.map(ParamType.from) : [], !!obj.payable, (obj.gas != null) ? obj.gas : null); - } - /** - * Returns ``true`` and provides a type guard if %%value%% is a - * **ConstructorFragment**. - */ - static isFragment(value) { - return (value && value[internal] === ConstructorFragmentInternal); - } -} -exports.ConstructorFragment = ConstructorFragment; -/** - * A Fragment which represents a method. - */ -class FallbackFragment extends Fragment { - /** - * If the function can be sent value during invocation. - */ - payable; - constructor(guard, inputs, payable) { - super(guard, "fallback", inputs); - Object.defineProperty(this, internal, { value: FallbackFragmentInternal }); - (0, index_js_1.defineProperties)(this, { payable }); - } - /** - * Returns a string representation of this fallback as %%format%%. - */ - format(format) { - const type = ((this.inputs.length === 0) ? "receive" : "fallback"); - if (format === "json") { - const stateMutability = (this.payable ? "payable" : "nonpayable"); - return JSON.stringify({ type, stateMutability }); - } - return `${type}()${this.payable ? " payable" : ""}`; - } - /** - * Returns a new **FallbackFragment** for %%obj%%. - */ - static from(obj) { - if (FallbackFragment.isFragment(obj)) { - return obj; - } - if (typeof (obj) === "string") { - try { - return FallbackFragment.from(lex(obj)); - } - catch (error) { - (0, index_js_1.assertArgument)(false, "invalid fallback fragment", "obj", obj); - } - } - else if (obj instanceof TokenString) { - const errorObj = obj.toString(); - const topIsValid = obj.peekKeyword(setify(["fallback", "receive"])); - (0, index_js_1.assertArgument)(topIsValid, "type must be fallback or receive", "obj", errorObj); - const type = obj.popKeyword(setify(["fallback", "receive"])); - // receive() - if (type === "receive") { - const inputs = consumeParams(obj); - (0, index_js_1.assertArgument)(inputs.length === 0, `receive cannot have arguments`, "obj.inputs", inputs); - consumeKeywords(obj, setify(["payable"])); - consumeEoi(obj); - return new FallbackFragment(_guard, [], true); - } - // fallback() [payable] - // fallback(bytes) [payable] returns (bytes) - let inputs = consumeParams(obj); - if (inputs.length) { - (0, index_js_1.assertArgument)(inputs.length === 1 && inputs[0].type === "bytes", "invalid fallback inputs", "obj.inputs", inputs.map((i) => i.format("minimal")).join(", ")); - } - else { - inputs = [ParamType.from("bytes")]; - } - const mutability = consumeMutability(obj); - (0, index_js_1.assertArgument)(mutability === "nonpayable" || mutability === "payable", "fallback cannot be constants", "obj.stateMutability", mutability); - if (consumeKeywords(obj, setify(["returns"])).has("returns")) { - const outputs = consumeParams(obj); - (0, index_js_1.assertArgument)(outputs.length === 1 && outputs[0].type === "bytes", "invalid fallback outputs", "obj.outputs", outputs.map((i) => i.format("minimal")).join(", ")); - } - consumeEoi(obj); - return new FallbackFragment(_guard, inputs, mutability === "payable"); - } - if (obj.type === "receive") { - return new FallbackFragment(_guard, [], true); - } - if (obj.type === "fallback") { - const inputs = [ParamType.from("bytes")]; - const payable = (obj.stateMutability === "payable"); - return new FallbackFragment(_guard, inputs, payable); - } - (0, index_js_1.assertArgument)(false, "invalid fallback description", "obj", obj); - } - /** - * Returns ``true`` and provides a type guard if %%value%% is a - * **FallbackFragment**. - */ - static isFragment(value) { - return (value && value[internal] === FallbackFragmentInternal); - } -} -exports.FallbackFragment = FallbackFragment; -/** - * A Fragment which represents a method. - */ -class FunctionFragment extends NamedFragment { - /** - * If the function is constant (e.g. ``pure`` or ``view`` functions). - */ - constant; - /** - * The returned types for the result of calling this function. - */ - outputs; - /** - * The state mutability (e.g. ``payable``, ``nonpayable``, ``view`` - * or ``pure``) - */ - stateMutability; - /** - * If the function can be sent value during invocation. - */ - payable; - /** - * The recommended gas limit to send when calling this function. - */ - gas; - /** - * @private - */ - constructor(guard, name, stateMutability, inputs, outputs, gas) { - super(guard, "function", name, inputs); - Object.defineProperty(this, internal, { value: FunctionFragmentInternal }); - outputs = Object.freeze(outputs.slice()); - const constant = (stateMutability === "view" || stateMutability === "pure"); - const payable = (stateMutability === "payable"); - (0, index_js_1.defineProperties)(this, { constant, gas, outputs, payable, stateMutability }); - } - /** - * The Function selector. - */ - get selector() { - return (0, index_js_2.id)(this.format("sighash")).substring(0, 10); - } - /** - * Returns a string representation of this function as %%format%%. - */ - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - return JSON.stringify({ - type: "function", - name: this.name, - constant: this.constant, - stateMutability: ((this.stateMutability !== "nonpayable") ? this.stateMutability : undefined), - payable: this.payable, - gas: ((this.gas != null) ? this.gas : undefined), - inputs: this.inputs.map((i) => JSON.parse(i.format(format))), - outputs: this.outputs.map((o) => JSON.parse(o.format(format))), - }); - } - const result = []; - if (format !== "sighash") { - result.push("function"); - } - result.push(this.name + joinParams(format, this.inputs)); - if (format !== "sighash") { - if (this.stateMutability !== "nonpayable") { - result.push(this.stateMutability); - } - if (this.outputs && this.outputs.length) { - result.push("returns"); - result.push(joinParams(format, this.outputs)); - } - if (this.gas != null) { - result.push(`@${this.gas.toString()}`); - } - } - return result.join(" "); - } - /** - * Return the selector for a function with %%name%% and %%params%%. - */ - static getSelector(name, params) { - params = (params || []).map((p) => ParamType.from(p)); - const fragment = new FunctionFragment(_guard, name, "view", params, [], null); - return fragment.selector; - } - /** - * Returns a new **FunctionFragment** for %%obj%%. - */ - static from(obj) { - if (FunctionFragment.isFragment(obj)) { - return obj; - } - if (typeof (obj) === "string") { - try { - return FunctionFragment.from(lex(obj)); - } - catch (error) { - (0, index_js_1.assertArgument)(false, "invalid function fragment", "obj", obj); - } - } - else if (obj instanceof TokenString) { - const name = consumeName("function", obj); - const inputs = consumeParams(obj); - const mutability = consumeMutability(obj); - let outputs = []; - if (consumeKeywords(obj, setify(["returns"])).has("returns")) { - outputs = consumeParams(obj); - } - const gas = consumeGas(obj); - consumeEoi(obj); - return new FunctionFragment(_guard, name, mutability, inputs, outputs, gas); - } - let stateMutability = obj.stateMutability; - // Use legacy Solidity ABI logic if stateMutability is missing - if (stateMutability == null) { - stateMutability = "payable"; - if (typeof (obj.constant) === "boolean") { - stateMutability = "view"; - if (!obj.constant) { - stateMutability = "payable"; - if (typeof (obj.payable) === "boolean" && !obj.payable) { - stateMutability = "nonpayable"; - } - } - } - else if (typeof (obj.payable) === "boolean" && !obj.payable) { - stateMutability = "nonpayable"; - } - } - // @TODO: verifyState for stateMutability (e.g. throw if - // payable: false but stateMutability is "nonpayable") - return new FunctionFragment(_guard, obj.name, stateMutability, obj.inputs ? obj.inputs.map(ParamType.from) : [], obj.outputs ? obj.outputs.map(ParamType.from) : [], (obj.gas != null) ? obj.gas : null); - } - /** - * Returns ``true`` and provides a type guard if %%value%% is a - * **FunctionFragment**. - */ - static isFragment(value) { - return (value && value[internal] === FunctionFragmentInternal); - } -} -exports.FunctionFragment = FunctionFragment; -/** - * A Fragment which represents a structure. - */ -class StructFragment extends NamedFragment { - /** - * @private - */ - constructor(guard, name, inputs) { - super(guard, "struct", name, inputs); - Object.defineProperty(this, internal, { value: StructFragmentInternal }); - } - /** - * Returns a string representation of this struct as %%format%%. - */ - format() { - throw new Error("@TODO"); - } - /** - * Returns a new **StructFragment** for %%obj%%. - */ - static from(obj) { - if (typeof (obj) === "string") { - try { - return StructFragment.from(lex(obj)); - } - catch (error) { - (0, index_js_1.assertArgument)(false, "invalid struct fragment", "obj", obj); - } - } - else if (obj instanceof TokenString) { - const name = consumeName("struct", obj); - const inputs = consumeParams(obj); - consumeEoi(obj); - return new StructFragment(_guard, name, inputs); - } - return new StructFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []); - } - // @TODO: fix this return type - /** - * Returns ``true`` and provides a type guard if %%value%% is a - * **StructFragment**. - */ - static isFragment(value) { - return (value && value[internal] === StructFragmentInternal); - } -} -exports.StructFragment = StructFragment; -//# sourceMappingURL=fragments.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/fragments.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/fragments.js.map deleted file mode 100644 index e2668bf0..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/fragments.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fragments.js","sourceRoot":"","sources":["../../src.ts/abi/fragments.ts"],"names":[],"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KAAK,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,sBAAsB,CAAC,CAAC;IACjE,CAAC;CACJ;AA9CD,wCA8CC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/index.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/index.d.ts deleted file mode 100644 index 2bf39932..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/index.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * The Application Binary Interface (ABI) describes how method input - * parameters should be encoded, their results decoded, and how to - * decode events and errors. - * - * See [About ABIs](docs-abi) for more details how they are used. - * - * @_section api/abi:Application Binary Interface [about-abi] - * @_navTitle: ABI - */ -export { AbiCoder } from "./abi-coder.js"; -export { decodeBytes32String, encodeBytes32String } from "./bytes32.js"; -export { ConstructorFragment, ErrorFragment, EventFragment, FallbackFragment, Fragment, FunctionFragment, NamedFragment, ParamType, StructFragment, } from "./fragments.js"; -export { checkResultErrors, Indexed, Interface, ErrorDescription, LogDescription, TransactionDescription, Result } from "./interface.js"; -export { Typed } from "./typed.js"; -export type { JsonFragment, JsonFragmentType, FormatType, FragmentType, ParamTypeWalkAsyncFunc, ParamTypeWalkFunc } from "./fragments.js"; -export type { InterfaceAbi, } from "./interface.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/index.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/index.d.ts.map deleted file mode 100644 index 0d99c19b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/abi/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,EACH,mBAAmB,EAAE,aAAa,EAAE,aAAa,EAAE,gBAAgB,EACnE,QAAQ,EAAE,gBAAgB,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,GACvE,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACH,iBAAiB,EACjB,OAAO,EACP,SAAS,EACT,gBAAgB,EAAE,cAAc,EAAE,sBAAsB,EACxD,MAAM,EACT,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,YAAY,EACR,YAAY,EAAE,gBAAgB,EAC9B,UAAU,EAAE,YAAY,EAAE,sBAAsB,EAAE,iBAAiB,EACtE,MAAM,gBAAgB,CAAC;AAExB,YAAY,EACR,YAAY,GACf,MAAM,gBAAgB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/index.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/index.js deleted file mode 100644 index b7bb84aa..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/index.js +++ /dev/null @@ -1,40 +0,0 @@ -"use strict"; -/** - * The Application Binary Interface (ABI) describes how method input - * parameters should be encoded, their results decoded, and how to - * decode events and errors. - * - * See [About ABIs](docs-abi) for more details how they are used. - * - * @_section api/abi:Application Binary Interface [about-abi] - * @_navTitle: ABI - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Typed = exports.Result = exports.TransactionDescription = exports.LogDescription = exports.ErrorDescription = exports.Interface = exports.Indexed = exports.checkResultErrors = exports.StructFragment = exports.ParamType = exports.NamedFragment = exports.FunctionFragment = exports.Fragment = exports.FallbackFragment = exports.EventFragment = exports.ErrorFragment = exports.ConstructorFragment = exports.encodeBytes32String = exports.decodeBytes32String = exports.AbiCoder = void 0; -////// -var abi_coder_js_1 = require("./abi-coder.js"); -Object.defineProperty(exports, "AbiCoder", { enumerable: true, get: function () { return abi_coder_js_1.AbiCoder; } }); -var bytes32_js_1 = require("./bytes32.js"); -Object.defineProperty(exports, "decodeBytes32String", { enumerable: true, get: function () { return bytes32_js_1.decodeBytes32String; } }); -Object.defineProperty(exports, "encodeBytes32String", { enumerable: true, get: function () { return bytes32_js_1.encodeBytes32String; } }); -var fragments_js_1 = require("./fragments.js"); -Object.defineProperty(exports, "ConstructorFragment", { enumerable: true, get: function () { return fragments_js_1.ConstructorFragment; } }); -Object.defineProperty(exports, "ErrorFragment", { enumerable: true, get: function () { return fragments_js_1.ErrorFragment; } }); -Object.defineProperty(exports, "EventFragment", { enumerable: true, get: function () { return fragments_js_1.EventFragment; } }); -Object.defineProperty(exports, "FallbackFragment", { enumerable: true, get: function () { return fragments_js_1.FallbackFragment; } }); -Object.defineProperty(exports, "Fragment", { enumerable: true, get: function () { return fragments_js_1.Fragment; } }); -Object.defineProperty(exports, "FunctionFragment", { enumerable: true, get: function () { return fragments_js_1.FunctionFragment; } }); -Object.defineProperty(exports, "NamedFragment", { enumerable: true, get: function () { return fragments_js_1.NamedFragment; } }); -Object.defineProperty(exports, "ParamType", { enumerable: true, get: function () { return fragments_js_1.ParamType; } }); -Object.defineProperty(exports, "StructFragment", { enumerable: true, get: function () { return fragments_js_1.StructFragment; } }); -var interface_js_1 = require("./interface.js"); -Object.defineProperty(exports, "checkResultErrors", { enumerable: true, get: function () { return interface_js_1.checkResultErrors; } }); -Object.defineProperty(exports, "Indexed", { enumerable: true, get: function () { return interface_js_1.Indexed; } }); -Object.defineProperty(exports, "Interface", { enumerable: true, get: function () { return interface_js_1.Interface; } }); -Object.defineProperty(exports, "ErrorDescription", { enumerable: true, get: function () { return interface_js_1.ErrorDescription; } }); -Object.defineProperty(exports, "LogDescription", { enumerable: true, get: function () { return interface_js_1.LogDescription; } }); -Object.defineProperty(exports, "TransactionDescription", { enumerable: true, get: function () { return interface_js_1.TransactionDescription; } }); -Object.defineProperty(exports, "Result", { enumerable: true, get: function () { return interface_js_1.Result; } }); -var typed_js_1 = require("./typed.js"); -Object.defineProperty(exports, "Typed", { enumerable: true, get: function () { return typed_js_1.Typed; } }); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/index.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/index.js.map deleted file mode 100644 index 1c338741..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/abi/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAGH,MAAM;AACN,+CAA0C;AAAjC,wGAAA,QAAQ,OAAA;AAEjB,2CAAwE;AAA/D,iHAAA,mBAAmB,OAAA;AAAE,iHAAA,mBAAmB,OAAA;AAEjD,+CAGwB;AAFpB,mHAAA,mBAAmB,OAAA;AAAE,6GAAA,aAAa,OAAA;AAAE,6GAAA,aAAa,OAAA;AAAE,gHAAA,gBAAgB,OAAA;AACnE,wGAAA,QAAQ,OAAA;AAAE,gHAAA,gBAAgB,OAAA;AAAE,6GAAA,aAAa,OAAA;AAAE,yGAAA,SAAS,OAAA;AAAE,8GAAA,cAAc,OAAA;AAGxE,+CAMwB;AALpB,iHAAA,iBAAiB,OAAA;AACjB,uGAAA,OAAO,OAAA;AACP,yGAAA,SAAS,OAAA;AACT,gHAAA,gBAAgB,OAAA;AAAE,8GAAA,cAAc,OAAA;AAAE,sHAAA,sBAAsB,OAAA;AACxD,sGAAA,MAAM,OAAA;AAGV,uCAAmC;AAA1B,iGAAA,KAAK,OAAA"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/interface.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/interface.d.ts deleted file mode 100644 index afa4ebb2..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/interface.d.ts +++ /dev/null @@ -1,382 +0,0 @@ -/** - * The Interface class is a low-level class that accepts an - * ABI and provides all the necessary functionality to encode - * and decode paramaters to and results from methods, events - * and errors. - * - * It also provides several convenience methods to automatically - * search and find matching transactions and events to parse them. - * - * @_subsection api/abi:Interfaces [interfaces] - */ -import { AbiCoder } from "./abi-coder.js"; -import { checkResultErrors, Result } from "./coders/abstract-coder.js"; -import { ConstructorFragment, ErrorFragment, EventFragment, FallbackFragment, Fragment, FunctionFragment, ParamType } from "./fragments.js"; -import { Typed } from "./typed.js"; -import type { BigNumberish, BytesLike, CallExceptionError, CallExceptionTransaction } from "../utils/index.js"; -import type { JsonFragment } from "./fragments.js"; -export { checkResultErrors, Result }; -/** - * When using the [[Interface-parseLog]] to automatically match a Log to its event - * for parsing, a **LogDescription** is returned. - */ -export declare class LogDescription { - /** - * The matching fragment for the ``topic0``. - */ - readonly fragment: EventFragment; - /** - * The name of the Event. - */ - readonly name: string; - /** - * The full Event signature. - */ - readonly signature: string; - /** - * The topic hash for the Event. - */ - readonly topic: string; - /** - * The arguments passed into the Event with ``emit``. - */ - readonly args: Result; - /** - * @_ignore: - */ - constructor(fragment: EventFragment, topic: string, args: Result); -} -/** - * When using the [[Interface-parseTransaction]] to automatically match - * a transaction data to its function for parsing, - * a **TransactionDescription** is returned. - */ -export declare class TransactionDescription { - /** - * The matching fragment from the transaction ``data``. - */ - readonly fragment: FunctionFragment; - /** - * The name of the Function from the transaction ``data``. - */ - readonly name: string; - /** - * The arguments passed to the Function from the transaction ``data``. - */ - readonly args: Result; - /** - * The full Function signature from the transaction ``data``. - */ - readonly signature: string; - /** - * The selector for the Function from the transaction ``data``. - */ - readonly selector: string; - /** - * The ``value`` (in wei) from the transaction. - */ - readonly value: bigint; - /** - * @_ignore: - */ - constructor(fragment: FunctionFragment, selector: string, args: Result, value: bigint); -} -/** - * When using the [[Interface-parseError]] to automatically match an - * error for a call result for parsing, an **ErrorDescription** is returned. - */ -export declare class ErrorDescription { - /** - * The matching fragment. - */ - readonly fragment: ErrorFragment; - /** - * The name of the Error. - */ - readonly name: string; - /** - * The arguments passed to the Error with ``revert``. - */ - readonly args: Result; - /** - * The full Error signature. - */ - readonly signature: string; - /** - * The selector for the Error. - */ - readonly selector: string; - /** - * @_ignore: - */ - constructor(fragment: ErrorFragment, selector: string, args: Result); -} -/** - * An **Indexed** is used as a value when a value that does not - * fit within a topic (i.e. not a fixed-length, 32-byte type). It - * is the ``keccak256`` of the value, and used for types such as - * arrays, tuples, bytes and strings. - */ -export declare class Indexed { - /** - * The ``keccak256`` of the value logged. - */ - readonly hash: null | string; - /** - * @_ignore: - */ - readonly _isIndexed: boolean; - /** - * Returns ``true`` if %%value%% is an **Indexed**. - * - * This provides a Type Guard for property access. - */ - static isIndexed(value: any): value is Indexed; - /** - * @_ignore: - */ - constructor(hash: null | string); -} -/** - * An **InterfaceAbi** may be any supported ABI format. - * - * A string is expected to be a JSON string, which will be parsed - * using ``JSON.parse``. This means that the value **must** be a valid - * JSON string, with no stray commas, etc. - * - * An array may contain any combination of: - * - Human-Readable fragments - * - Parsed JSON fragment - * - [[Fragment]] instances - * - * A **Human-Readable Fragment** is a string which resembles a Solidity - * signature and is introduced in [this blog entry](link-ricmoo-humanreadableabi). - * For example, ``function balanceOf(address) view returns (uint)``. - * - * A **Parsed JSON Fragment** is a JavaScript Object desribed in the - * [Solidity documentation](link-solc-jsonabi). - */ -export type InterfaceAbi = string | ReadonlyArray; -/** - * An Interface abstracts many of the low-level details for - * encoding and decoding the data on the blockchain. - * - * An ABI provides information on how to encode data to send to - * a Contract, how to decode the results and events and how to - * interpret revert errors. - * - * The ABI can be specified by [any supported format](InterfaceAbi). - */ -export declare class Interface { - #private; - /** - * All the Contract ABI members (i.e. methods, events, errors, etc). - */ - readonly fragments: ReadonlyArray; - /** - * The Contract constructor. - */ - readonly deploy: ConstructorFragment; - /** - * The Fallback method, if any. - */ - readonly fallback: null | FallbackFragment; - /** - * If receiving ether is supported. - */ - readonly receive: boolean; - /** - * Create a new Interface for the %%fragments%%. - */ - constructor(fragments: InterfaceAbi); - /** - * Returns the entire Human-Readable ABI, as an array of - * signatures, optionally as %%minimal%% strings, which - * removes parameter names and unneceesary spaces. - */ - format(minimal?: boolean): Array; - /** - * Return the JSON-encoded ABI. This is the format Solidiy - * returns. - */ - formatJson(): string; - /** - * The ABI coder that will be used to encode and decode binary - * data. - */ - getAbiCoder(): AbiCoder; - /** - * Get the function name for %%key%%, which may be a function selector, - * function name or function signature that belongs to the ABI. - */ - getFunctionName(key: string): string; - /** - * Returns true if %%key%% (a function selector, function name or - * function signature) is present in the ABI. - * - * In the case of a function name, the name may be ambiguous, so - * accessing the [[FunctionFragment]] may require refinement. - */ - hasFunction(key: string): boolean; - /** - * Get the [[FunctionFragment]] for %%key%%, which may be a function - * selector, function name or function signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple functions match by name. - * - * If the %%key%% and %%values%% do not refine to a single function in - * the ABI, this will throw. - */ - getFunction(key: string, values?: Array): null | FunctionFragment; - /** - * Iterate over all functions, calling %%callback%%, sorted by their name. - */ - forEachFunction(callback: (func: FunctionFragment, index: number) => void): void; - /** - * Get the event name for %%key%%, which may be a topic hash, - * event name or event signature that belongs to the ABI. - */ - getEventName(key: string): string; - /** - * Returns true if %%key%% (an event topic hash, event name or - * event signature) is present in the ABI. - * - * In the case of an event name, the name may be ambiguous, so - * accessing the [[EventFragment]] may require refinement. - */ - hasEvent(key: string): boolean; - /** - * Get the [[EventFragment]] for %%key%%, which may be a topic hash, - * event name or event signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple events match by name. - * - * If the %%key%% and %%values%% do not refine to a single event in - * the ABI, this will throw. - */ - getEvent(key: string, values?: Array): null | EventFragment; - /** - * Iterate over all events, calling %%callback%%, sorted by their name. - */ - forEachEvent(callback: (func: EventFragment, index: number) => void): void; - /** - * Get the [[ErrorFragment]] for %%key%%, which may be an error - * selector, error name or error signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple errors match by name. - * - * If the %%key%% and %%values%% do not refine to a single error in - * the ABI, this will throw. - */ - getError(key: string, values?: Array): null | ErrorFragment; - /** - * Iterate over all errors, calling %%callback%%, sorted by their name. - */ - forEachError(callback: (func: ErrorFragment, index: number) => void): void; - _decodeParams(params: ReadonlyArray, data: BytesLike): Result; - _encodeParams(params: ReadonlyArray, values: ReadonlyArray): string; - /** - * Encodes a ``tx.data`` object for deploying the Contract with - * the %%values%% as the constructor arguments. - */ - encodeDeploy(values?: ReadonlyArray): string; - /** - * Decodes the result %%data%% (e.g. from an ``eth_call``) for the - * specified error (see [[getError]] for valid values for - * %%key%%). - * - * Most developers should prefer the [[parseCallResult]] method instead, - * which will automatically detect a ``CALL_EXCEPTION`` and throw the - * corresponding error. - */ - decodeErrorResult(fragment: ErrorFragment | string, data: BytesLike): Result; - /** - * Encodes the transaction revert data for a call result that - * reverted from the the Contract with the sepcified %%error%% - * (see [[getError]] for valid values for %%fragment%%) with the %%values%%. - * - * This is generally not used by most developers, unless trying to mock - * a result from a Contract. - */ - encodeErrorResult(fragment: ErrorFragment | string, values?: ReadonlyArray): string; - /** - * Decodes the %%data%% from a transaction ``tx.data`` for - * the function specified (see [[getFunction]] for valid values - * for %%fragment%%). - * - * Most developers should prefer the [[parseTransaction]] method - * instead, which will automatically detect the fragment. - */ - decodeFunctionData(fragment: FunctionFragment | string, data: BytesLike): Result; - /** - * Encodes the ``tx.data`` for a transaction that calls the function - * specified (see [[getFunction]] for valid values for %%fragment%%) with - * the %%values%%. - */ - encodeFunctionData(fragment: FunctionFragment | string, values?: ReadonlyArray): string; - /** - * Decodes the result %%data%% (e.g. from an ``eth_call``) for the - * specified function (see [[getFunction]] for valid values for - * %%key%%). - * - * Most developers should prefer the [[parseCallResult]] method instead, - * which will automatically detect a ``CALL_EXCEPTION`` and throw the - * corresponding error. - */ - decodeFunctionResult(fragment: FunctionFragment | string, data: BytesLike): Result; - makeError(_data: BytesLike, tx: CallExceptionTransaction): CallExceptionError; - /** - * Encodes the result data (e.g. from an ``eth_call``) for the - * specified function (see [[getFunction]] for valid values - * for %%fragment%%) with %%values%%. - * - * This is generally not used by most developers, unless trying to mock - * a result from a Contract. - */ - encodeFunctionResult(fragment: FunctionFragment | string, values?: ReadonlyArray): string; - encodeFilterTopics(fragment: EventFragment | string, values: ReadonlyArray): Array>; - encodeEventLog(fragment: EventFragment | string, values: ReadonlyArray): { - data: string; - topics: Array; - }; - decodeEventLog(fragment: EventFragment | string, data: BytesLike, topics?: ReadonlyArray): Result; - /** - * Parses a transaction, finding the matching function and extracts - * the parameter values along with other useful function details. - * - * If the matching function cannot be found, return null. - */ - parseTransaction(tx: { - data: string; - value?: BigNumberish; - }): null | TransactionDescription; - parseCallResult(data: BytesLike): Result; - /** - * Parses a receipt log, finding the matching event and extracts - * the parameter values along with other useful event details. - * - * If the matching event cannot be found, returns null. - */ - parseLog(log: { - topics: ReadonlyArray; - data: string; - }): null | LogDescription; - /** - * Parses a revert data, finding the matching error and extracts - * the parameter values along with other useful error details. - * - * If the matching error cannot be found, returns null. - */ - parseError(data: BytesLike): null | ErrorDescription; - /** - * Creates a new [[Interface]] from the ABI %%value%%. - * - * The %%value%% may be provided as an existing [[Interface]] object, - * a JSON-encoded ABI or any Human-Readable ABI format. - */ - static from(value: InterfaceAbi | Interface): Interface; -} -//# sourceMappingURL=interface.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/interface.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/interface.d.ts.map deleted file mode 100644 index d9367c1a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/interface.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src.ts/abi/interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAUH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAA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AAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,GAAG,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IAgEtH,cAAc,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;KAAE;IA6CrH,cAAc,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,MAAM;IAuEzG;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,YAAY,CAAA;KAAE,GAAG,IAAI,GAAG,sBAAsB;IAY3F,eAAe,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM;IAIxC;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE;QAAE,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,GAAG,IAAI,GAAG,cAAc;IAapF;;;;;OAKG;IACH,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,GAAG,gBAAgB;IAWpD;;;;;OAKG;IACH,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,GAAG,SAAS;CAoB1D"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/interface.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/interface.js deleted file mode 100644 index b597be04..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/interface.js +++ /dev/null @@ -1,1110 +0,0 @@ -"use strict"; -/** - * The Interface class is a low-level class that accepts an - * ABI and provides all the necessary functionality to encode - * and decode paramaters to and results from methods, events - * and errors. - * - * It also provides several convenience methods to automatically - * search and find matching transactions and events to parse them. - * - * @_subsection api/abi:Interfaces [interfaces] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Interface = exports.Indexed = exports.ErrorDescription = exports.TransactionDescription = exports.LogDescription = exports.Result = exports.checkResultErrors = void 0; -const index_js_1 = require("../crypto/index.js"); -const index_js_2 = require("../hash/index.js"); -const index_js_3 = require("../utils/index.js"); -const abi_coder_js_1 = require("./abi-coder.js"); -const abstract_coder_js_1 = require("./coders/abstract-coder.js"); -Object.defineProperty(exports, "checkResultErrors", { enumerable: true, get: function () { return abstract_coder_js_1.checkResultErrors; } }); -Object.defineProperty(exports, "Result", { enumerable: true, get: function () { return abstract_coder_js_1.Result; } }); -const fragments_js_1 = require("./fragments.js"); -const typed_js_1 = require("./typed.js"); -/** - * When using the [[Interface-parseLog]] to automatically match a Log to its event - * for parsing, a **LogDescription** is returned. - */ -class LogDescription { - /** - * The matching fragment for the ``topic0``. - */ - fragment; - /** - * The name of the Event. - */ - name; - /** - * The full Event signature. - */ - signature; - /** - * The topic hash for the Event. - */ - topic; - /** - * The arguments passed into the Event with ``emit``. - */ - args; - /** - * @_ignore: - */ - constructor(fragment, topic, args) { - const name = fragment.name, signature = fragment.format(); - (0, index_js_3.defineProperties)(this, { - fragment, name, signature, topic, args - }); - } -} -exports.LogDescription = LogDescription; -/** - * When using the [[Interface-parseTransaction]] to automatically match - * a transaction data to its function for parsing, - * a **TransactionDescription** is returned. - */ -class TransactionDescription { - /** - * The matching fragment from the transaction ``data``. - */ - fragment; - /** - * The name of the Function from the transaction ``data``. - */ - name; - /** - * The arguments passed to the Function from the transaction ``data``. - */ - args; - /** - * The full Function signature from the transaction ``data``. - */ - signature; - /** - * The selector for the Function from the transaction ``data``. - */ - selector; - /** - * The ``value`` (in wei) from the transaction. - */ - value; - /** - * @_ignore: - */ - constructor(fragment, selector, args, value) { - const name = fragment.name, signature = fragment.format(); - (0, index_js_3.defineProperties)(this, { - fragment, name, args, signature, selector, value - }); - } -} -exports.TransactionDescription = TransactionDescription; -/** - * When using the [[Interface-parseError]] to automatically match an - * error for a call result for parsing, an **ErrorDescription** is returned. - */ -class ErrorDescription { - /** - * The matching fragment. - */ - fragment; - /** - * The name of the Error. - */ - name; - /** - * The arguments passed to the Error with ``revert``. - */ - args; - /** - * The full Error signature. - */ - signature; - /** - * The selector for the Error. - */ - selector; - /** - * @_ignore: - */ - constructor(fragment, selector, args) { - const name = fragment.name, signature = fragment.format(); - (0, index_js_3.defineProperties)(this, { - fragment, name, args, signature, selector - }); - } -} -exports.ErrorDescription = ErrorDescription; -/** - * An **Indexed** is used as a value when a value that does not - * fit within a topic (i.e. not a fixed-length, 32-byte type). It - * is the ``keccak256`` of the value, and used for types such as - * arrays, tuples, bytes and strings. - */ -class Indexed { - /** - * The ``keccak256`` of the value logged. - */ - hash; - /** - * @_ignore: - */ - _isIndexed; - /** - * Returns ``true`` if %%value%% is an **Indexed**. - * - * This provides a Type Guard for property access. - */ - static isIndexed(value) { - return !!(value && value._isIndexed); - } - /** - * @_ignore: - */ - constructor(hash) { - (0, index_js_3.defineProperties)(this, { hash, _isIndexed: true }); - } -} -exports.Indexed = Indexed; -// https://docs.soliditylang.org/en/v0.8.13/control-structures.html?highlight=panic#panic-via-assert-and-error-via-require -const PanicReasons = { - "0": "generic panic", - "1": "assert(false)", - "17": "arithmetic overflow", - "18": "division or modulo by zero", - "33": "enum overflow", - "34": "invalid encoded storage byte array accessed", - "49": "out-of-bounds array access; popping on an empty array", - "50": "out-of-bounds access of an array or bytesN", - "65": "out of memory", - "81": "uninitialized function", -}; -const BuiltinErrors = { - "0x08c379a0": { - signature: "Error(string)", - name: "Error", - inputs: ["string"], - reason: (message) => { - return `reverted with reason string ${JSON.stringify(message)}`; - } - }, - "0x4e487b71": { - signature: "Panic(uint256)", - name: "Panic", - inputs: ["uint256"], - reason: (code) => { - let reason = "unknown panic code"; - if (code >= 0 && code <= 0xff && PanicReasons[code.toString()]) { - reason = PanicReasons[code.toString()]; - } - return `reverted with panic code 0x${code.toString(16)} (${reason})`; - } - } -}; -/** - * An Interface abstracts many of the low-level details for - * encoding and decoding the data on the blockchain. - * - * An ABI provides information on how to encode data to send to - * a Contract, how to decode the results and events and how to - * interpret revert errors. - * - * The ABI can be specified by [any supported format](InterfaceAbi). - */ -class Interface { - /** - * All the Contract ABI members (i.e. methods, events, errors, etc). - */ - fragments; - /** - * The Contract constructor. - */ - deploy; - /** - * The Fallback method, if any. - */ - fallback; - /** - * If receiving ether is supported. - */ - receive; - #errors; - #events; - #functions; - // #structs: Map; - #abiCoder; - /** - * Create a new Interface for the %%fragments%%. - */ - constructor(fragments) { - let abi = []; - if (typeof (fragments) === "string") { - abi = JSON.parse(fragments); - } - else { - abi = fragments; - } - this.#functions = new Map(); - this.#errors = new Map(); - this.#events = new Map(); - // this.#structs = new Map(); - const frags = []; - for (const a of abi) { - try { - frags.push(fragments_js_1.Fragment.from(a)); - } - catch (error) { - console.log(`[Warning] Invalid Fragment ${JSON.stringify(a)}:`, error.message); - } - } - (0, index_js_3.defineProperties)(this, { - fragments: Object.freeze(frags) - }); - let fallback = null; - let receive = false; - this.#abiCoder = this.getAbiCoder(); - // Add all fragments by their signature - this.fragments.forEach((fragment, index) => { - let bucket; - switch (fragment.type) { - case "constructor": - if (this.deploy) { - console.log("duplicate definition - constructor"); - return; - } - //checkNames(fragment, "input", fragment.inputs); - (0, index_js_3.defineProperties)(this, { deploy: fragment }); - return; - case "fallback": - if (fragment.inputs.length === 0) { - receive = true; - } - else { - (0, index_js_3.assertArgument)(!fallback || fragment.payable !== fallback.payable, "conflicting fallback fragments", `fragments[${index}]`, fragment); - fallback = fragment; - receive = fallback.payable; - } - return; - case "function": - //checkNames(fragment, "input", fragment.inputs); - //checkNames(fragment, "output", (fragment).outputs); - bucket = this.#functions; - break; - case "event": - //checkNames(fragment, "input", fragment.inputs); - bucket = this.#events; - break; - case "error": - bucket = this.#errors; - break; - default: - return; - } - // Two identical entries; ignore it - const signature = fragment.format(); - if (bucket.has(signature)) { - return; - } - bucket.set(signature, fragment); - }); - // If we do not have a constructor add a default - if (!this.deploy) { - (0, index_js_3.defineProperties)(this, { - deploy: fragments_js_1.ConstructorFragment.from("constructor()") - }); - } - (0, index_js_3.defineProperties)(this, { fallback, receive }); - } - /** - * Returns the entire Human-Readable ABI, as an array of - * signatures, optionally as %%minimal%% strings, which - * removes parameter names and unneceesary spaces. - */ - format(minimal) { - const format = (minimal ? "minimal" : "full"); - const abi = this.fragments.map((f) => f.format(format)); - return abi; - } - /** - * Return the JSON-encoded ABI. This is the format Solidiy - * returns. - */ - formatJson() { - const abi = this.fragments.map((f) => f.format("json")); - // We need to re-bundle the JSON fragments a bit - return JSON.stringify(abi.map((j) => JSON.parse(j))); - } - /** - * The ABI coder that will be used to encode and decode binary - * data. - */ - getAbiCoder() { - return abi_coder_js_1.AbiCoder.defaultAbiCoder(); - } - // Find a function definition by any means necessary (unless it is ambiguous) - #getFunction(key, values, forceUnique) { - // Selector - if ((0, index_js_3.isHexString)(key)) { - const selector = key.toLowerCase(); - for (const fragment of this.#functions.values()) { - if (selector === fragment.selector) { - return fragment; - } - } - return null; - } - // It is a bare name, look up the function (will return null if ambiguous) - if (key.indexOf("(") === -1) { - const matching = []; - for (const [name, fragment] of this.#functions) { - if (name.split("(" /* fix:) */)[0] === key) { - matching.push(fragment); - } - } - if (values) { - const lastValue = (values.length > 0) ? values[values.length - 1] : null; - let valueLength = values.length; - let allowOptions = true; - if (typed_js_1.Typed.isTyped(lastValue) && lastValue.type === "overrides") { - allowOptions = false; - valueLength--; - } - // Remove all matches that don't have a compatible length. The args - // may contain an overrides, so the match may have n or n - 1 parameters - for (let i = matching.length - 1; i >= 0; i--) { - const inputs = matching[i].inputs.length; - if (inputs !== valueLength && (!allowOptions || inputs !== valueLength - 1)) { - matching.splice(i, 1); - } - } - // Remove all matches that don't match the Typed signature - for (let i = matching.length - 1; i >= 0; i--) { - const inputs = matching[i].inputs; - for (let j = 0; j < values.length; j++) { - // Not a typed value - if (!typed_js_1.Typed.isTyped(values[j])) { - continue; - } - // We are past the inputs - if (j >= inputs.length) { - if (values[j].type === "overrides") { - continue; - } - matching.splice(i, 1); - break; - } - // Make sure the value type matches the input type - if (values[j].type !== inputs[j].baseType) { - matching.splice(i, 1); - break; - } - } - } - } - // We found a single matching signature with an overrides, but the - // last value is something that cannot possibly be an options - if (matching.length === 1 && values && values.length !== matching[0].inputs.length) { - const lastArg = values[values.length - 1]; - if (lastArg == null || Array.isArray(lastArg) || typeof (lastArg) !== "object") { - matching.splice(0, 1); - } - } - if (matching.length === 0) { - return null; - } - if (matching.length > 1 && forceUnique) { - const matchStr = matching.map((m) => JSON.stringify(m.format())).join(", "); - (0, index_js_3.assertArgument)(false, `ambiguous function description (i.e. matches ${matchStr})`, "key", key); - } - return matching[0]; - } - // Normalize the signature and lookup the function - const result = this.#functions.get(fragments_js_1.FunctionFragment.from(key).format()); - if (result) { - return result; - } - return null; - } - /** - * Get the function name for %%key%%, which may be a function selector, - * function name or function signature that belongs to the ABI. - */ - getFunctionName(key) { - const fragment = this.#getFunction(key, null, false); - (0, index_js_3.assertArgument)(fragment, "no matching function", "key", key); - return fragment.name; - } - /** - * Returns true if %%key%% (a function selector, function name or - * function signature) is present in the ABI. - * - * In the case of a function name, the name may be ambiguous, so - * accessing the [[FunctionFragment]] may require refinement. - */ - hasFunction(key) { - return !!this.#getFunction(key, null, false); - } - /** - * Get the [[FunctionFragment]] for %%key%%, which may be a function - * selector, function name or function signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple functions match by name. - * - * If the %%key%% and %%values%% do not refine to a single function in - * the ABI, this will throw. - */ - getFunction(key, values) { - return this.#getFunction(key, values || null, true); - } - /** - * Iterate over all functions, calling %%callback%%, sorted by their name. - */ - forEachFunction(callback) { - const names = Array.from(this.#functions.keys()); - names.sort((a, b) => a.localeCompare(b)); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - callback((this.#functions.get(name)), i); - } - } - // Find an event definition by any means necessary (unless it is ambiguous) - #getEvent(key, values, forceUnique) { - // EventTopic - if ((0, index_js_3.isHexString)(key)) { - const eventTopic = key.toLowerCase(); - for (const fragment of this.#events.values()) { - if (eventTopic === fragment.topicHash) { - return fragment; - } - } - return null; - } - // It is a bare name, look up the function (will return null if ambiguous) - if (key.indexOf("(") === -1) { - const matching = []; - for (const [name, fragment] of this.#events) { - if (name.split("(" /* fix:) */)[0] === key) { - matching.push(fragment); - } - } - if (values) { - // Remove all matches that don't have a compatible length. - for (let i = matching.length - 1; i >= 0; i--) { - if (matching[i].inputs.length < values.length) { - matching.splice(i, 1); - } - } - // Remove all matches that don't match the Typed signature - for (let i = matching.length - 1; i >= 0; i--) { - const inputs = matching[i].inputs; - for (let j = 0; j < values.length; j++) { - // Not a typed value - if (!typed_js_1.Typed.isTyped(values[j])) { - continue; - } - // Make sure the value type matches the input type - if (values[j].type !== inputs[j].baseType) { - matching.splice(i, 1); - break; - } - } - } - } - if (matching.length === 0) { - return null; - } - if (matching.length > 1 && forceUnique) { - const matchStr = matching.map((m) => JSON.stringify(m.format())).join(", "); - (0, index_js_3.assertArgument)(false, `ambiguous event description (i.e. matches ${matchStr})`, "key", key); - } - return matching[0]; - } - // Normalize the signature and lookup the function - const result = this.#events.get(fragments_js_1.EventFragment.from(key).format()); - if (result) { - return result; - } - return null; - } - /** - * Get the event name for %%key%%, which may be a topic hash, - * event name or event signature that belongs to the ABI. - */ - getEventName(key) { - const fragment = this.#getEvent(key, null, false); - (0, index_js_3.assertArgument)(fragment, "no matching event", "key", key); - return fragment.name; - } - /** - * Returns true if %%key%% (an event topic hash, event name or - * event signature) is present in the ABI. - * - * In the case of an event name, the name may be ambiguous, so - * accessing the [[EventFragment]] may require refinement. - */ - hasEvent(key) { - return !!this.#getEvent(key, null, false); - } - /** - * Get the [[EventFragment]] for %%key%%, which may be a topic hash, - * event name or event signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple events match by name. - * - * If the %%key%% and %%values%% do not refine to a single event in - * the ABI, this will throw. - */ - getEvent(key, values) { - return this.#getEvent(key, values || null, true); - } - /** - * Iterate over all events, calling %%callback%%, sorted by their name. - */ - forEachEvent(callback) { - const names = Array.from(this.#events.keys()); - names.sort((a, b) => a.localeCompare(b)); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - callback((this.#events.get(name)), i); - } - } - /** - * Get the [[ErrorFragment]] for %%key%%, which may be an error - * selector, error name or error signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple errors match by name. - * - * If the %%key%% and %%values%% do not refine to a single error in - * the ABI, this will throw. - */ - getError(key, values) { - if ((0, index_js_3.isHexString)(key)) { - const selector = key.toLowerCase(); - if (BuiltinErrors[selector]) { - return fragments_js_1.ErrorFragment.from(BuiltinErrors[selector].signature); - } - for (const fragment of this.#errors.values()) { - if (selector === fragment.selector) { - return fragment; - } - } - return null; - } - // It is a bare name, look up the function (will return null if ambiguous) - if (key.indexOf("(") === -1) { - const matching = []; - for (const [name, fragment] of this.#errors) { - if (name.split("(" /* fix:) */)[0] === key) { - matching.push(fragment); - } - } - if (matching.length === 0) { - if (key === "Error") { - return fragments_js_1.ErrorFragment.from("error Error(string)"); - } - if (key === "Panic") { - return fragments_js_1.ErrorFragment.from("error Panic(uint256)"); - } - return null; - } - else if (matching.length > 1) { - const matchStr = matching.map((m) => JSON.stringify(m.format())).join(", "); - (0, index_js_3.assertArgument)(false, `ambiguous error description (i.e. ${matchStr})`, "name", key); - } - return matching[0]; - } - // Normalize the signature and lookup the function - key = fragments_js_1.ErrorFragment.from(key).format(); - if (key === "Error(string)") { - return fragments_js_1.ErrorFragment.from("error Error(string)"); - } - if (key === "Panic(uint256)") { - return fragments_js_1.ErrorFragment.from("error Panic(uint256)"); - } - const result = this.#errors.get(key); - if (result) { - return result; - } - return null; - } - /** - * Iterate over all errors, calling %%callback%%, sorted by their name. - */ - forEachError(callback) { - const names = Array.from(this.#errors.keys()); - names.sort((a, b) => a.localeCompare(b)); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - callback((this.#errors.get(name)), i); - } - } - // Get the 4-byte selector used by Solidity to identify a function - /* -getSelector(fragment: ErrorFragment | FunctionFragment): string { - if (typeof(fragment) === "string") { - const matches: Array = [ ]; - - try { matches.push(this.getFunction(fragment)); } catch (error) { } - try { matches.push(this.getError(fragment)); } catch (_) { } - - if (matches.length === 0) { - logger.throwArgumentError("unknown fragment", "key", fragment); - } else if (matches.length > 1) { - logger.throwArgumentError("ambiguous fragment matches function and error", "key", fragment); - } - - fragment = matches[0]; - } - - return dataSlice(id(fragment.format()), 0, 4); -} - */ - // Get the 32-byte topic hash used by Solidity to identify an event - /* - getEventTopic(fragment: EventFragment): string { - //if (typeof(fragment) === "string") { fragment = this.getEvent(eventFragment); } - return id(fragment.format()); - } - */ - _decodeParams(params, data) { - return this.#abiCoder.decode(params, data); - } - _encodeParams(params, values) { - return this.#abiCoder.encode(params, values); - } - /** - * Encodes a ``tx.data`` object for deploying the Contract with - * the %%values%% as the constructor arguments. - */ - encodeDeploy(values) { - return this._encodeParams(this.deploy.inputs, values || []); - } - /** - * Decodes the result %%data%% (e.g. from an ``eth_call``) for the - * specified error (see [[getError]] for valid values for - * %%key%%). - * - * Most developers should prefer the [[parseCallResult]] method instead, - * which will automatically detect a ``CALL_EXCEPTION`` and throw the - * corresponding error. - */ - decodeErrorResult(fragment, data) { - if (typeof (fragment) === "string") { - const f = this.getError(fragment); - (0, index_js_3.assertArgument)(f, "unknown error", "fragment", fragment); - fragment = f; - } - (0, index_js_3.assertArgument)((0, index_js_3.dataSlice)(data, 0, 4) === fragment.selector, `data signature does not match error ${fragment.name}.`, "data", data); - return this._decodeParams(fragment.inputs, (0, index_js_3.dataSlice)(data, 4)); - } - /** - * Encodes the transaction revert data for a call result that - * reverted from the the Contract with the sepcified %%error%% - * (see [[getError]] for valid values for %%fragment%%) with the %%values%%. - * - * This is generally not used by most developers, unless trying to mock - * a result from a Contract. - */ - encodeErrorResult(fragment, values) { - if (typeof (fragment) === "string") { - const f = this.getError(fragment); - (0, index_js_3.assertArgument)(f, "unknown error", "fragment", fragment); - fragment = f; - } - return (0, index_js_3.concat)([ - fragment.selector, - this._encodeParams(fragment.inputs, values || []) - ]); - } - /** - * Decodes the %%data%% from a transaction ``tx.data`` for - * the function specified (see [[getFunction]] for valid values - * for %%fragment%%). - * - * Most developers should prefer the [[parseTransaction]] method - * instead, which will automatically detect the fragment. - */ - decodeFunctionData(fragment, data) { - if (typeof (fragment) === "string") { - const f = this.getFunction(fragment); - (0, index_js_3.assertArgument)(f, "unknown function", "fragment", fragment); - fragment = f; - } - (0, index_js_3.assertArgument)((0, index_js_3.dataSlice)(data, 0, 4) === fragment.selector, `data signature does not match function ${fragment.name}.`, "data", data); - return this._decodeParams(fragment.inputs, (0, index_js_3.dataSlice)(data, 4)); - } - /** - * Encodes the ``tx.data`` for a transaction that calls the function - * specified (see [[getFunction]] for valid values for %%fragment%%) with - * the %%values%%. - */ - encodeFunctionData(fragment, values) { - if (typeof (fragment) === "string") { - const f = this.getFunction(fragment); - (0, index_js_3.assertArgument)(f, "unknown function", "fragment", fragment); - fragment = f; - } - return (0, index_js_3.concat)([ - fragment.selector, - this._encodeParams(fragment.inputs, values || []) - ]); - } - /** - * Decodes the result %%data%% (e.g. from an ``eth_call``) for the - * specified function (see [[getFunction]] for valid values for - * %%key%%). - * - * Most developers should prefer the [[parseCallResult]] method instead, - * which will automatically detect a ``CALL_EXCEPTION`` and throw the - * corresponding error. - */ - decodeFunctionResult(fragment, data) { - if (typeof (fragment) === "string") { - const f = this.getFunction(fragment); - (0, index_js_3.assertArgument)(f, "unknown function", "fragment", fragment); - fragment = f; - } - let message = "invalid length for result data"; - const bytes = (0, index_js_3.getBytesCopy)(data); - if ((bytes.length % 32) === 0) { - try { - return this.#abiCoder.decode(fragment.outputs, bytes); - } - catch (error) { - message = "could not decode result data"; - } - } - // Call returned data with no error, but the data is junk - (0, index_js_3.assert)(false, message, "BAD_DATA", { - value: (0, index_js_3.hexlify)(bytes), - info: { method: fragment.name, signature: fragment.format() } - }); - } - makeError(_data, tx) { - const data = (0, index_js_3.getBytes)(_data, "data"); - const error = abi_coder_js_1.AbiCoder.getBuiltinCallException("call", tx, data); - // Not a built-in error; try finding a custom error - const customPrefix = "execution reverted (unknown custom error)"; - if (error.message.startsWith(customPrefix)) { - const selector = (0, index_js_3.hexlify)(data.slice(0, 4)); - const ef = this.getError(selector); - if (ef) { - try { - const args = this.#abiCoder.decode(ef.inputs, data.slice(4)); - error.revert = { - name: ef.name, signature: ef.format(), args - }; - error.reason = error.revert.signature; - error.message = `execution reverted: ${error.reason}`; - } - catch (e) { - error.message = `execution reverted (coult not decode custom error)`; - } - } - } - // Add the invocation, if available - const parsed = this.parseTransaction(tx); - if (parsed) { - error.invocation = { - method: parsed.name, - signature: parsed.signature, - args: parsed.args - }; - } - return error; - } - /** - * Encodes the result data (e.g. from an ``eth_call``) for the - * specified function (see [[getFunction]] for valid values - * for %%fragment%%) with %%values%%. - * - * This is generally not used by most developers, unless trying to mock - * a result from a Contract. - */ - encodeFunctionResult(fragment, values) { - if (typeof (fragment) === "string") { - const f = this.getFunction(fragment); - (0, index_js_3.assertArgument)(f, "unknown function", "fragment", fragment); - fragment = f; - } - return (0, index_js_3.hexlify)(this.#abiCoder.encode(fragment.outputs, values || [])); - } - /* - spelunk(inputs: Array, values: ReadonlyArray, processfunc: (type: string, value: any) => Promise): Promise> { - const promises: Array> = [ ]; - const process = function(type: ParamType, value: any): any { - if (type.baseType === "array") { - return descend(type.child - } - if (type. === "address") { - } - }; - - const descend = function (inputs: Array, values: ReadonlyArray) { - if (inputs.length !== values.length) { throw new Error("length mismatch"); } - - }; - - const result: Array = [ ]; - values.forEach((value, index) => { - if (value == null) { - topics.push(null); - } else if (param.baseType === "array" || param.baseType === "tuple") { - logger.throwArgumentError("filtering with tuples or arrays not supported", ("contract." + param.name), value); - } else if (Array.isArray(value)) { - topics.push(value.map((value) => encodeTopic(param, value))); - } else { - topics.push(encodeTopic(param, value)); - } - }); - } - */ - // Create the filter for the event with search criteria (e.g. for eth_filterLog) - encodeFilterTopics(fragment, values) { - if (typeof (fragment) === "string") { - const f = this.getEvent(fragment); - (0, index_js_3.assertArgument)(f, "unknown event", "eventFragment", fragment); - fragment = f; - } - (0, index_js_3.assert)(values.length <= fragment.inputs.length, `too many arguments for ${fragment.format()}`, "UNEXPECTED_ARGUMENT", { count: values.length, expectedCount: fragment.inputs.length }); - const topics = []; - if (!fragment.anonymous) { - topics.push(fragment.topicHash); - } - // @TODO: Use the coders for this; to properly support tuples, etc. - const encodeTopic = (param, value) => { - if (param.type === "string") { - return (0, index_js_2.id)(value); - } - else if (param.type === "bytes") { - return (0, index_js_1.keccak256)((0, index_js_3.hexlify)(value)); - } - if (param.type === "bool" && typeof (value) === "boolean") { - value = (value ? "0x01" : "0x00"); - } - else if (param.type.match(/^u?int/)) { - value = (0, index_js_3.toBeHex)(value); // @TODO: Should this toTwos?? - } - else if (param.type.match(/^bytes/)) { - value = (0, index_js_3.zeroPadBytes)(value, 32); - } - else if (param.type === "address") { - // Check addresses are valid - this.#abiCoder.encode(["address"], [value]); - } - return (0, index_js_3.zeroPadValue)((0, index_js_3.hexlify)(value), 32); - }; - values.forEach((value, index) => { - const param = fragment.inputs[index]; - if (!param.indexed) { - (0, index_js_3.assertArgument)(value == null, "cannot filter non-indexed parameters; must be null", ("contract." + param.name), value); - return; - } - if (value == null) { - topics.push(null); - } - else if (param.baseType === "array" || param.baseType === "tuple") { - (0, index_js_3.assertArgument)(false, "filtering with tuples or arrays not supported", ("contract." + param.name), value); - } - else if (Array.isArray(value)) { - topics.push(value.map((value) => encodeTopic(param, value))); - } - else { - topics.push(encodeTopic(param, value)); - } - }); - // Trim off trailing nulls - while (topics.length && topics[topics.length - 1] === null) { - topics.pop(); - } - return topics; - } - encodeEventLog(fragment, values) { - if (typeof (fragment) === "string") { - const f = this.getEvent(fragment); - (0, index_js_3.assertArgument)(f, "unknown event", "eventFragment", fragment); - fragment = f; - } - const topics = []; - const dataTypes = []; - const dataValues = []; - if (!fragment.anonymous) { - topics.push(fragment.topicHash); - } - (0, index_js_3.assertArgument)(values.length === fragment.inputs.length, "event arguments/values mismatch", "values", values); - fragment.inputs.forEach((param, index) => { - const value = values[index]; - if (param.indexed) { - if (param.type === "string") { - topics.push((0, index_js_2.id)(value)); - } - else if (param.type === "bytes") { - topics.push((0, index_js_1.keccak256)(value)); - } - else if (param.baseType === "tuple" || param.baseType === "array") { - // @TODO - throw new Error("not implemented"); - } - else { - topics.push(this.#abiCoder.encode([param.type], [value])); - } - } - else { - dataTypes.push(param); - dataValues.push(value); - } - }); - return { - data: this.#abiCoder.encode(dataTypes, dataValues), - topics: topics - }; - } - // Decode a filter for the event and the search criteria - decodeEventLog(fragment, data, topics) { - if (typeof (fragment) === "string") { - const f = this.getEvent(fragment); - (0, index_js_3.assertArgument)(f, "unknown event", "eventFragment", fragment); - fragment = f; - } - if (topics != null && !fragment.anonymous) { - const eventTopic = fragment.topicHash; - (0, index_js_3.assertArgument)((0, index_js_3.isHexString)(topics[0], 32) && topics[0].toLowerCase() === eventTopic, "fragment/topic mismatch", "topics[0]", topics[0]); - topics = topics.slice(1); - } - const indexed = []; - const nonIndexed = []; - const dynamic = []; - fragment.inputs.forEach((param, index) => { - if (param.indexed) { - if (param.type === "string" || param.type === "bytes" || param.baseType === "tuple" || param.baseType === "array") { - indexed.push(fragments_js_1.ParamType.from({ type: "bytes32", name: param.name })); - dynamic.push(true); - } - else { - indexed.push(param); - dynamic.push(false); - } - } - else { - nonIndexed.push(param); - dynamic.push(false); - } - }); - const resultIndexed = (topics != null) ? this.#abiCoder.decode(indexed, (0, index_js_3.concat)(topics)) : null; - const resultNonIndexed = this.#abiCoder.decode(nonIndexed, data, true); - //const result: (Array & { [ key: string ]: any }) = [ ]; - const values = []; - const keys = []; - let nonIndexedIndex = 0, indexedIndex = 0; - fragment.inputs.forEach((param, index) => { - let value = null; - if (param.indexed) { - if (resultIndexed == null) { - value = new Indexed(null); - } - else if (dynamic[index]) { - value = new Indexed(resultIndexed[indexedIndex++]); - } - else { - try { - value = resultIndexed[indexedIndex++]; - } - catch (error) { - value = error; - } - } - } - else { - try { - value = resultNonIndexed[nonIndexedIndex++]; - } - catch (error) { - value = error; - } - } - values.push(value); - keys.push(param.name || null); - }); - return abstract_coder_js_1.Result.fromItems(values, keys); - } - /** - * Parses a transaction, finding the matching function and extracts - * the parameter values along with other useful function details. - * - * If the matching function cannot be found, return null. - */ - parseTransaction(tx) { - const data = (0, index_js_3.getBytes)(tx.data, "tx.data"); - const value = (0, index_js_3.getBigInt)((tx.value != null) ? tx.value : 0, "tx.value"); - const fragment = this.getFunction((0, index_js_3.hexlify)(data.slice(0, 4))); - if (!fragment) { - return null; - } - const args = this.#abiCoder.decode(fragment.inputs, data.slice(4)); - return new TransactionDescription(fragment, fragment.selector, args, value); - } - parseCallResult(data) { - throw new Error("@TODO"); - } - /** - * Parses a receipt log, finding the matching event and extracts - * the parameter values along with other useful event details. - * - * If the matching event cannot be found, returns null. - */ - parseLog(log) { - const fragment = this.getEvent(log.topics[0]); - if (!fragment || fragment.anonymous) { - return null; - } - // @TODO: If anonymous, and the only method, and the input count matches, should we parse? - // Probably not, because just because it is the only event in the ABI does - // not mean we have the full ABI; maybe just a fragment? - return new LogDescription(fragment, fragment.topicHash, this.decodeEventLog(fragment, log.data, log.topics)); - } - /** - * Parses a revert data, finding the matching error and extracts - * the parameter values along with other useful error details. - * - * If the matching error cannot be found, returns null. - */ - parseError(data) { - const hexData = (0, index_js_3.hexlify)(data); - const fragment = this.getError((0, index_js_3.dataSlice)(hexData, 0, 4)); - if (!fragment) { - return null; - } - const args = this.#abiCoder.decode(fragment.inputs, (0, index_js_3.dataSlice)(hexData, 4)); - return new ErrorDescription(fragment, fragment.selector, args); - } - /** - * Creates a new [[Interface]] from the ABI %%value%%. - * - * The %%value%% may be provided as an existing [[Interface]] object, - * a JSON-encoded ABI or any Human-Readable ABI format. - */ - static from(value) { - // Already an Interface, which is immutable - if (value instanceof Interface) { - return value; - } - // JSON - if (typeof (value) === "string") { - return new Interface(JSON.parse(value)); - } - // An Interface; possibly from another v6 instance - if (typeof (value.formatJson) === "function") { - return new Interface(value.formatJson()); - } - // A legacy Interface; from an older version - if (typeof (value.format) === "function") { - return new Interface(value.format("json")); - } - // Array of fragments - return new Interface(value); - } -} -exports.Interface = Interface; -//# sourceMappingURL=interface.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/interface.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/interface.js.map deleted file mode 100644 index 048c213c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/interface.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src.ts/abi/interface.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAEH,iDAA8C;AAC9C,+CAAqC;AACrC,gDAI2B;AAE3B,iDAA0C;AAC1C,kEAAuE;AAY9D,kGAZA,qCAAiB,OAYA;AAAE,uFAZA,0BAAM,OAYA;AAXlC,iDAGwB;AACxB,yCAAmC;AASnC;;;GAGG;AACH,MAAa,cAAc;IACvB;;OAEG;IACM,QAAQ,CAAiB;IAElC;;OAEG;IACM,IAAI,CAAU;IAEvB;;OAEG;IACM,SAAS,CAAU;IAE5B;;OAEG;IACM,KAAK,CAAU;IAExB;;OAEG;IACM,IAAI,CAAS;IAEtB;;OAEG;IACH,YAAY,QAAuB,EAAE,KAAa,EAAE,IAAY;QAC5D,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC;QAC1D,IAAA,2BAAgB,EAAiB,IAAI,EAAE;YACnC,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI;SACz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MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;SACrD;QAED,qBAAqB;QACrB,OAAO,IAAI,SAAS,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC;CACJ;AAh9BD,8BAg9BC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/typed.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/typed.d.ts deleted file mode 100644 index 8707a62f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/typed.d.ts +++ /dev/null @@ -1,570 +0,0 @@ -/** - * A Typed object allows a value to have its type explicitly - * specified. - * - * For example, in Solidity, the value ``45`` could represent a - * ``uint8`` or a ``uint256``. The value ``0x1234`` could represent - * a ``bytes2`` or ``bytes``. - * - * Since JavaScript has no meaningful way to explicitly inform any - * APIs which what the type is, this allows transparent interoperation - * with Soldity. - * - * @_subsection: api/abi:Typed Values - */ -import type { Addressable } from "../address/index.js"; -import type { BigNumberish, BytesLike } from "../utils/index.js"; -import type { Result } from "./coders/abstract-coder.js"; -/** - * @_ignore: - */ -export interface TypedNumber extends Typed { - value: number; - defaultValue(): number; - minValue(): number; - maxValue(): number; -} -/** - * A **Typed** that represents a numeric value. - */ -export interface TypedBigInt extends Typed { - /** - * The value. - */ - value: bigint; - /** - * The default value for all numeric types is ``0``. - */ - defaultValue(): bigint; - /** - * The minimum value for this type, accounting for bit-width and signed-ness. - */ - minValue(): bigint; - /** - * The minimum value for this type, accounting for bit-width. - */ - maxValue(): bigint; -} -/** - * A **Typed** that represents a binary sequence of data as bytes. - */ -export interface TypedData extends Typed { - /** - * The value. - */ - value: string; - /** - * The default value for this type. - */ - defaultValue(): string; -} -/** - * A **Typed** that represents a UTF-8 sequence of bytes. - */ -export interface TypedString extends Typed { - /** - * The value. - */ - value: string; - /** - * The default value for the string type is the empty string (i.e. ``""``). - */ - defaultValue(): string; -} -/** - * The **Typed** class to wrap values providing explicit type information. - */ -export declare class Typed { - #private; - /** - * The type, as a Solidity-compatible type. - */ - readonly type: string; - /** - * The actual value. - */ - readonly value: any; - /** - * @_ignore: - */ - readonly _typedSymbol: Symbol; - /** - * @_ignore: - */ - constructor(gaurd: any, type: string, value: any, options?: any); - /** - * Format the type as a Human-Readable type. - */ - format(): string; - /** - * The default value returned by this type. - */ - defaultValue(): string | number | bigint | Result; - /** - * The minimum value for numeric types. - */ - minValue(): string | number | bigint; - /** - * The maximum value for numeric types. - */ - maxValue(): string | number | bigint; - /** - * Returns ``true`` and provides a type guard is this is a [[TypedBigInt]]. - */ - isBigInt(): this is TypedBigInt; - /** - * Returns ``true`` and provides a type guard is this is a [[TypedData]]. - */ - isData(): this is TypedData; - /** - * Returns ``true`` and provides a type guard is this is a [[TypedString]]. - */ - isString(): this is TypedString; - /** - * Returns the tuple name, if this is a tuple. Throws otherwise. - */ - get tupleName(): null | string; - /** - * Returns the length of the array type or ``-1`` if it is dynamic. - * - * Throws if the type is not an array. - */ - get arrayLength(): null | number; - /** - * Returns a new **Typed** of %%type%% with the %%value%%. - */ - static from(type: string, value: any): Typed; - /** - * Return a new ``uint8`` type for %%v%%. - */ - static uint8(v: BigNumberish): Typed; - /** - * Return a new ``uint16`` type for %%v%%. - */ - static uint16(v: BigNumberish): Typed; - /** - * Return a new ``uint24`` type for %%v%%. - */ - static uint24(v: BigNumberish): Typed; - /** - * Return a new ``uint32`` type for %%v%%. - */ - static uint32(v: BigNumberish): Typed; - /** - * Return a new ``uint40`` type for %%v%%. - */ - static uint40(v: BigNumberish): Typed; - /** - * Return a new ``uint48`` type for %%v%%. - */ - static uint48(v: BigNumberish): Typed; - /** - * Return a new ``uint56`` type for %%v%%. - */ - static uint56(v: BigNumberish): Typed; - /** - * Return a new ``uint64`` type for %%v%%. - */ - static uint64(v: BigNumberish): Typed; - /** - * Return a new ``uint72`` type for %%v%%. - */ - static uint72(v: BigNumberish): Typed; - /** - * Return a new ``uint80`` type for %%v%%. - */ - static uint80(v: BigNumberish): Typed; - /** - * Return a new ``uint88`` type for %%v%%. - */ - static uint88(v: BigNumberish): Typed; - /** - * Return a new ``uint96`` type for %%v%%. - */ - static uint96(v: BigNumberish): Typed; - /** - * Return a new ``uint104`` type for %%v%%. - */ - static uint104(v: BigNumberish): Typed; - /** - * Return a new ``uint112`` type for %%v%%. - */ - static uint112(v: BigNumberish): Typed; - /** - * Return a new ``uint120`` type for %%v%%. - */ - static uint120(v: BigNumberish): Typed; - /** - * Return a new ``uint128`` type for %%v%%. - */ - static uint128(v: BigNumberish): Typed; - /** - * Return a new ``uint136`` type for %%v%%. - */ - static uint136(v: BigNumberish): Typed; - /** - * Return a new ``uint144`` type for %%v%%. - */ - static uint144(v: BigNumberish): Typed; - /** - * Return a new ``uint152`` type for %%v%%. - */ - static uint152(v: BigNumberish): Typed; - /** - * Return a new ``uint160`` type for %%v%%. - */ - static uint160(v: BigNumberish): Typed; - /** - * Return a new ``uint168`` type for %%v%%. - */ - static uint168(v: BigNumberish): Typed; - /** - * Return a new ``uint176`` type for %%v%%. - */ - static uint176(v: BigNumberish): Typed; - /** - * Return a new ``uint184`` type for %%v%%. - */ - static uint184(v: BigNumberish): Typed; - /** - * Return a new ``uint192`` type for %%v%%. - */ - static uint192(v: BigNumberish): Typed; - /** - * Return a new ``uint200`` type for %%v%%. - */ - static uint200(v: BigNumberish): Typed; - /** - * Return a new ``uint208`` type for %%v%%. - */ - static uint208(v: BigNumberish): Typed; - /** - * Return a new ``uint216`` type for %%v%%. - */ - static uint216(v: BigNumberish): Typed; - /** - * Return a new ``uint224`` type for %%v%%. - */ - static uint224(v: BigNumberish): Typed; - /** - * Return a new ``uint232`` type for %%v%%. - */ - static uint232(v: BigNumberish): Typed; - /** - * Return a new ``uint240`` type for %%v%%. - */ - static uint240(v: BigNumberish): Typed; - /** - * Return a new ``uint248`` type for %%v%%. - */ - static uint248(v: BigNumberish): Typed; - /** - * Return a new ``uint256`` type for %%v%%. - */ - static uint256(v: BigNumberish): Typed; - /** - * Return a new ``uint256`` type for %%v%%. - */ - static uint(v: BigNumberish): Typed; - /** - * Return a new ``int8`` type for %%v%%. - */ - static int8(v: BigNumberish): Typed; - /** - * Return a new ``int16`` type for %%v%%. - */ - static int16(v: BigNumberish): Typed; - /** - * Return a new ``int24`` type for %%v%%. - */ - static int24(v: BigNumberish): Typed; - /** - * Return a new ``int32`` type for %%v%%. - */ - static int32(v: BigNumberish): Typed; - /** - * Return a new ``int40`` type for %%v%%. - */ - static int40(v: BigNumberish): Typed; - /** - * Return a new ``int48`` type for %%v%%. - */ - static int48(v: BigNumberish): Typed; - /** - * Return a new ``int56`` type for %%v%%. - */ - static int56(v: BigNumberish): Typed; - /** - * Return a new ``int64`` type for %%v%%. - */ - static int64(v: BigNumberish): Typed; - /** - * Return a new ``int72`` type for %%v%%. - */ - static int72(v: BigNumberish): Typed; - /** - * Return a new ``int80`` type for %%v%%. - */ - static int80(v: BigNumberish): Typed; - /** - * Return a new ``int88`` type for %%v%%. - */ - static int88(v: BigNumberish): Typed; - /** - * Return a new ``int96`` type for %%v%%. - */ - static int96(v: BigNumberish): Typed; - /** - * Return a new ``int104`` type for %%v%%. - */ - static int104(v: BigNumberish): Typed; - /** - * Return a new ``int112`` type for %%v%%. - */ - static int112(v: BigNumberish): Typed; - /** - * Return a new ``int120`` type for %%v%%. - */ - static int120(v: BigNumberish): Typed; - /** - * Return a new ``int128`` type for %%v%%. - */ - static int128(v: BigNumberish): Typed; - /** - * Return a new ``int136`` type for %%v%%. - */ - static int136(v: BigNumberish): Typed; - /** - * Return a new ``int144`` type for %%v%%. - */ - static int144(v: BigNumberish): Typed; - /** - * Return a new ``int52`` type for %%v%%. - */ - static int152(v: BigNumberish): Typed; - /** - * Return a new ``int160`` type for %%v%%. - */ - static int160(v: BigNumberish): Typed; - /** - * Return a new ``int168`` type for %%v%%. - */ - static int168(v: BigNumberish): Typed; - /** - * Return a new ``int176`` type for %%v%%. - */ - static int176(v: BigNumberish): Typed; - /** - * Return a new ``int184`` type for %%v%%. - */ - static int184(v: BigNumberish): Typed; - /** - * Return a new ``int92`` type for %%v%%. - */ - static int192(v: BigNumberish): Typed; - /** - * Return a new ``int200`` type for %%v%%. - */ - static int200(v: BigNumberish): Typed; - /** - * Return a new ``int208`` type for %%v%%. - */ - static int208(v: BigNumberish): Typed; - /** - * Return a new ``int216`` type for %%v%%. - */ - static int216(v: BigNumberish): Typed; - /** - * Return a new ``int224`` type for %%v%%. - */ - static int224(v: BigNumberish): Typed; - /** - * Return a new ``int232`` type for %%v%%. - */ - static int232(v: BigNumberish): Typed; - /** - * Return a new ``int240`` type for %%v%%. - */ - static int240(v: BigNumberish): Typed; - /** - * Return a new ``int248`` type for %%v%%. - */ - static int248(v: BigNumberish): Typed; - /** - * Return a new ``int256`` type for %%v%%. - */ - static int256(v: BigNumberish): Typed; - /** - * Return a new ``int256`` type for %%v%%. - */ - static int(v: BigNumberish): Typed; - /** - * Return a new ``bytes1`` type for %%v%%. - */ - static bytes1(v: BytesLike): Typed; - /** - * Return a new ``bytes2`` type for %%v%%. - */ - static bytes2(v: BytesLike): Typed; - /** - * Return a new ``bytes3`` type for %%v%%. - */ - static bytes3(v: BytesLike): Typed; - /** - * Return a new ``bytes4`` type for %%v%%. - */ - static bytes4(v: BytesLike): Typed; - /** - * Return a new ``bytes5`` type for %%v%%. - */ - static bytes5(v: BytesLike): Typed; - /** - * Return a new ``bytes6`` type for %%v%%. - */ - static bytes6(v: BytesLike): Typed; - /** - * Return a new ``bytes7`` type for %%v%%. - */ - static bytes7(v: BytesLike): Typed; - /** - * Return a new ``bytes8`` type for %%v%%. - */ - static bytes8(v: BytesLike): Typed; - /** - * Return a new ``bytes9`` type for %%v%%. - */ - static bytes9(v: BytesLike): Typed; - /** - * Return a new ``bytes10`` type for %%v%%. - */ - static bytes10(v: BytesLike): Typed; - /** - * Return a new ``bytes11`` type for %%v%%. - */ - static bytes11(v: BytesLike): Typed; - /** - * Return a new ``bytes12`` type for %%v%%. - */ - static bytes12(v: BytesLike): Typed; - /** - * Return a new ``bytes13`` type for %%v%%. - */ - static bytes13(v: BytesLike): Typed; - /** - * Return a new ``bytes14`` type for %%v%%. - */ - static bytes14(v: BytesLike): Typed; - /** - * Return a new ``bytes15`` type for %%v%%. - */ - static bytes15(v: BytesLike): Typed; - /** - * Return a new ``bytes16`` type for %%v%%. - */ - static bytes16(v: BytesLike): Typed; - /** - * Return a new ``bytes17`` type for %%v%%. - */ - static bytes17(v: BytesLike): Typed; - /** - * Return a new ``bytes18`` type for %%v%%. - */ - static bytes18(v: BytesLike): Typed; - /** - * Return a new ``bytes19`` type for %%v%%. - */ - static bytes19(v: BytesLike): Typed; - /** - * Return a new ``bytes20`` type for %%v%%. - */ - static bytes20(v: BytesLike): Typed; - /** - * Return a new ``bytes21`` type for %%v%%. - */ - static bytes21(v: BytesLike): Typed; - /** - * Return a new ``bytes22`` type for %%v%%. - */ - static bytes22(v: BytesLike): Typed; - /** - * Return a new ``bytes23`` type for %%v%%. - */ - static bytes23(v: BytesLike): Typed; - /** - * Return a new ``bytes24`` type for %%v%%. - */ - static bytes24(v: BytesLike): Typed; - /** - * Return a new ``bytes25`` type for %%v%%. - */ - static bytes25(v: BytesLike): Typed; - /** - * Return a new ``bytes26`` type for %%v%%. - */ - static bytes26(v: BytesLike): Typed; - /** - * Return a new ``bytes27`` type for %%v%%. - */ - static bytes27(v: BytesLike): Typed; - /** - * Return a new ``bytes28`` type for %%v%%. - */ - static bytes28(v: BytesLike): Typed; - /** - * Return a new ``bytes29`` type for %%v%%. - */ - static bytes29(v: BytesLike): Typed; - /** - * Return a new ``bytes30`` type for %%v%%. - */ - static bytes30(v: BytesLike): Typed; - /** - * Return a new ``bytes31`` type for %%v%%. - */ - static bytes31(v: BytesLike): Typed; - /** - * Return a new ``bytes32`` type for %%v%%. - */ - static bytes32(v: BytesLike): Typed; - /** - * Return a new ``address`` type for %%v%%. - */ - static address(v: string | Addressable): Typed; - /** - * Return a new ``bool`` type for %%v%%. - */ - static bool(v: any): Typed; - /** - * Return a new ``bytes`` type for %%v%%. - */ - static bytes(v: BytesLike): Typed; - /** - * Return a new ``string`` type for %%v%%. - */ - static string(v: string): Typed; - /** - * Return a new ``array`` type for %%v%%, allowing %%dynamic%% length. - */ - static array(v: Array, dynamic?: null | boolean): Typed; - /** - * Return a new ``tuple`` type for %%v%%, with the optional %%name%%. - */ - static tuple(v: Array | Record, name?: string): Typed; - /** - * Return a new ``uint8`` type for %%v%%. - */ - static overrides(v: Record): Typed; - /** - * Returns true only if %%value%% is a [[Typed]] instance. - */ - static isTyped(value: any): value is Typed; - /** - * If the value is a [[Typed]] instance, validates the underlying value - * and returns it, otherwise returns value directly. - * - * This is useful for functions that with to accept either a [[Typed]] - * object or values. - */ - static dereference(value: Typed | T, type: string): T; -} -//# sourceMappingURL=typed.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/typed.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/typed.d.ts.map deleted file mode 100644 index d7d2b42a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/typed.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"typed.d.ts","sourceRoot":"","sources":["../../src.ts/abi/typed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEjE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAqBzD;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,KAAK;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,IAAI,MAAM,CAAC;IACvB,QAAQ,IAAI,MAAM,CAAC;IACnB,QAAQ,IAAI,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,KAAK;IACtC;;OAEG;IACH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,IAAI,CAAC,CAAC,EAAE,GAAG,GAAG,KAAK;IAE1B;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,GAAG,KAAK;IAEjC;;OAEG;IACH,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,KAAK;IAG/B;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,EAAE,OAAO,CAAC,EAAE,IAAI,GAAG,OAAO,GAAG,KAAK;IAMpE;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,GAAG,KAAK,CAAC,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK;IAMvF;;OAEG;IACH,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,KAAK;IAI/C;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,KAAK;IAO1C;;;;;;OAMG;IACH,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC;CAS3D"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/typed.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/typed.js deleted file mode 100644 index cc757a83..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/typed.js +++ /dev/null @@ -1,606 +0,0 @@ -"use strict"; -/** - * A Typed object allows a value to have its type explicitly - * specified. - * - * For example, in Solidity, the value ``45`` could represent a - * ``uint8`` or a ``uint256``. The value ``0x1234`` could represent - * a ``bytes2`` or ``bytes``. - * - * Since JavaScript has no meaningful way to explicitly inform any - * APIs which what the type is, this allows transparent interoperation - * with Soldity. - * - * @_subsection: api/abi:Typed Values - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Typed = void 0; -const index_js_1 = require("../utils/index.js"); -const _gaurd = {}; -function n(value, width) { - let signed = false; - if (width < 0) { - signed = true; - width *= -1; - } - // @TODO: Check range is valid for value - return new Typed(_gaurd, `${signed ? "" : "u"}int${width}`, value, { signed, width }); -} -function b(value, size) { - // @TODO: Check range is valid for value - return new Typed(_gaurd, `bytes${(size) ? size : ""}`, value, { size }); -} -const _typedSymbol = Symbol.for("_ethers_typed"); -/** - * The **Typed** class to wrap values providing explicit type information. - */ -class Typed { - /** - * The type, as a Solidity-compatible type. - */ - type; - /** - * The actual value. - */ - value; - #options; - /** - * @_ignore: - */ - _typedSymbol; - /** - * @_ignore: - */ - constructor(gaurd, type, value, options) { - if (options == null) { - options = null; - } - (0, index_js_1.assertPrivate)(_gaurd, gaurd, "Typed"); - (0, index_js_1.defineProperties)(this, { _typedSymbol, type, value }); - this.#options = options; - // Check the value is valid - this.format(); - } - /** - * Format the type as a Human-Readable type. - */ - format() { - if (this.type === "array") { - throw new Error(""); - } - else if (this.type === "dynamicArray") { - throw new Error(""); - } - else if (this.type === "tuple") { - return `tuple(${this.value.map((v) => v.format()).join(",")})`; - } - return this.type; - } - /** - * The default value returned by this type. - */ - defaultValue() { - return 0; - } - /** - * The minimum value for numeric types. - */ - minValue() { - return 0; - } - /** - * The maximum value for numeric types. - */ - maxValue() { - return 0; - } - /** - * Returns ``true`` and provides a type guard is this is a [[TypedBigInt]]. - */ - isBigInt() { - return !!(this.type.match(/^u?int[0-9]+$/)); - } - /** - * Returns ``true`` and provides a type guard is this is a [[TypedData]]. - */ - isData() { - return this.type.startsWith("bytes"); - } - /** - * Returns ``true`` and provides a type guard is this is a [[TypedString]]. - */ - isString() { - return (this.type === "string"); - } - /** - * Returns the tuple name, if this is a tuple. Throws otherwise. - */ - get tupleName() { - if (this.type !== "tuple") { - throw TypeError("not a tuple"); - } - return this.#options; - } - // Returns the length of this type as an array - // - `null` indicates the length is unforced, it could be dynamic - // - `-1` indicates the length is dynamic - // - any other value indicates it is a static array and is its length - /** - * Returns the length of the array type or ``-1`` if it is dynamic. - * - * Throws if the type is not an array. - */ - get arrayLength() { - if (this.type !== "array") { - throw TypeError("not an array"); - } - if (this.#options === true) { - return -1; - } - if (this.#options === false) { - return (this.value).length; - } - return null; - } - /** - * Returns a new **Typed** of %%type%% with the %%value%%. - */ - static from(type, value) { - return new Typed(_gaurd, type, value); - } - /** - * Return a new ``uint8`` type for %%v%%. - */ - static uint8(v) { return n(v, 8); } - /** - * Return a new ``uint16`` type for %%v%%. - */ - static uint16(v) { return n(v, 16); } - /** - * Return a new ``uint24`` type for %%v%%. - */ - static uint24(v) { return n(v, 24); } - /** - * Return a new ``uint32`` type for %%v%%. - */ - static uint32(v) { return n(v, 32); } - /** - * Return a new ``uint40`` type for %%v%%. - */ - static uint40(v) { return n(v, 40); } - /** - * Return a new ``uint48`` type for %%v%%. - */ - static uint48(v) { return n(v, 48); } - /** - * Return a new ``uint56`` type for %%v%%. - */ - static uint56(v) { return n(v, 56); } - /** - * Return a new ``uint64`` type for %%v%%. - */ - static uint64(v) { return n(v, 64); } - /** - * Return a new ``uint72`` type for %%v%%. - */ - static uint72(v) { return n(v, 72); } - /** - * Return a new ``uint80`` type for %%v%%. - */ - static uint80(v) { return n(v, 80); } - /** - * Return a new ``uint88`` type for %%v%%. - */ - static uint88(v) { return n(v, 88); } - /** - * Return a new ``uint96`` type for %%v%%. - */ - static uint96(v) { return n(v, 96); } - /** - * Return a new ``uint104`` type for %%v%%. - */ - static uint104(v) { return n(v, 104); } - /** - * Return a new ``uint112`` type for %%v%%. - */ - static uint112(v) { return n(v, 112); } - /** - * Return a new ``uint120`` type for %%v%%. - */ - static uint120(v) { return n(v, 120); } - /** - * Return a new ``uint128`` type for %%v%%. - */ - static uint128(v) { return n(v, 128); } - /** - * Return a new ``uint136`` type for %%v%%. - */ - static uint136(v) { return n(v, 136); } - /** - * Return a new ``uint144`` type for %%v%%. - */ - static uint144(v) { return n(v, 144); } - /** - * Return a new ``uint152`` type for %%v%%. - */ - static uint152(v) { return n(v, 152); } - /** - * Return a new ``uint160`` type for %%v%%. - */ - static uint160(v) { return n(v, 160); } - /** - * Return a new ``uint168`` type for %%v%%. - */ - static uint168(v) { return n(v, 168); } - /** - * Return a new ``uint176`` type for %%v%%. - */ - static uint176(v) { return n(v, 176); } - /** - * Return a new ``uint184`` type for %%v%%. - */ - static uint184(v) { return n(v, 184); } - /** - * Return a new ``uint192`` type for %%v%%. - */ - static uint192(v) { return n(v, 192); } - /** - * Return a new ``uint200`` type for %%v%%. - */ - static uint200(v) { return n(v, 200); } - /** - * Return a new ``uint208`` type for %%v%%. - */ - static uint208(v) { return n(v, 208); } - /** - * Return a new ``uint216`` type for %%v%%. - */ - static uint216(v) { return n(v, 216); } - /** - * Return a new ``uint224`` type for %%v%%. - */ - static uint224(v) { return n(v, 224); } - /** - * Return a new ``uint232`` type for %%v%%. - */ - static uint232(v) { return n(v, 232); } - /** - * Return a new ``uint240`` type for %%v%%. - */ - static uint240(v) { return n(v, 240); } - /** - * Return a new ``uint248`` type for %%v%%. - */ - static uint248(v) { return n(v, 248); } - /** - * Return a new ``uint256`` type for %%v%%. - */ - static uint256(v) { return n(v, 256); } - /** - * Return a new ``uint256`` type for %%v%%. - */ - static uint(v) { return n(v, 256); } - /** - * Return a new ``int8`` type for %%v%%. - */ - static int8(v) { return n(v, -8); } - /** - * Return a new ``int16`` type for %%v%%. - */ - static int16(v) { return n(v, -16); } - /** - * Return a new ``int24`` type for %%v%%. - */ - static int24(v) { return n(v, -24); } - /** - * Return a new ``int32`` type for %%v%%. - */ - static int32(v) { return n(v, -32); } - /** - * Return a new ``int40`` type for %%v%%. - */ - static int40(v) { return n(v, -40); } - /** - * Return a new ``int48`` type for %%v%%. - */ - static int48(v) { return n(v, -48); } - /** - * Return a new ``int56`` type for %%v%%. - */ - static int56(v) { return n(v, -56); } - /** - * Return a new ``int64`` type for %%v%%. - */ - static int64(v) { return n(v, -64); } - /** - * Return a new ``int72`` type for %%v%%. - */ - static int72(v) { return n(v, -72); } - /** - * Return a new ``int80`` type for %%v%%. - */ - static int80(v) { return n(v, -80); } - /** - * Return a new ``int88`` type for %%v%%. - */ - static int88(v) { return n(v, -88); } - /** - * Return a new ``int96`` type for %%v%%. - */ - static int96(v) { return n(v, -96); } - /** - * Return a new ``int104`` type for %%v%%. - */ - static int104(v) { return n(v, -104); } - /** - * Return a new ``int112`` type for %%v%%. - */ - static int112(v) { return n(v, -112); } - /** - * Return a new ``int120`` type for %%v%%. - */ - static int120(v) { return n(v, -120); } - /** - * Return a new ``int128`` type for %%v%%. - */ - static int128(v) { return n(v, -128); } - /** - * Return a new ``int136`` type for %%v%%. - */ - static int136(v) { return n(v, -136); } - /** - * Return a new ``int144`` type for %%v%%. - */ - static int144(v) { return n(v, -144); } - /** - * Return a new ``int52`` type for %%v%%. - */ - static int152(v) { return n(v, -152); } - /** - * Return a new ``int160`` type for %%v%%. - */ - static int160(v) { return n(v, -160); } - /** - * Return a new ``int168`` type for %%v%%. - */ - static int168(v) { return n(v, -168); } - /** - * Return a new ``int176`` type for %%v%%. - */ - static int176(v) { return n(v, -176); } - /** - * Return a new ``int184`` type for %%v%%. - */ - static int184(v) { return n(v, -184); } - /** - * Return a new ``int92`` type for %%v%%. - */ - static int192(v) { return n(v, -192); } - /** - * Return a new ``int200`` type for %%v%%. - */ - static int200(v) { return n(v, -200); } - /** - * Return a new ``int208`` type for %%v%%. - */ - static int208(v) { return n(v, -208); } - /** - * Return a new ``int216`` type for %%v%%. - */ - static int216(v) { return n(v, -216); } - /** - * Return a new ``int224`` type for %%v%%. - */ - static int224(v) { return n(v, -224); } - /** - * Return a new ``int232`` type for %%v%%. - */ - static int232(v) { return n(v, -232); } - /** - * Return a new ``int240`` type for %%v%%. - */ - static int240(v) { return n(v, -240); } - /** - * Return a new ``int248`` type for %%v%%. - */ - static int248(v) { return n(v, -248); } - /** - * Return a new ``int256`` type for %%v%%. - */ - static int256(v) { return n(v, -256); } - /** - * Return a new ``int256`` type for %%v%%. - */ - static int(v) { return n(v, -256); } - /** - * Return a new ``bytes1`` type for %%v%%. - */ - static bytes1(v) { return b(v, 1); } - /** - * Return a new ``bytes2`` type for %%v%%. - */ - static bytes2(v) { return b(v, 2); } - /** - * Return a new ``bytes3`` type for %%v%%. - */ - static bytes3(v) { return b(v, 3); } - /** - * Return a new ``bytes4`` type for %%v%%. - */ - static bytes4(v) { return b(v, 4); } - /** - * Return a new ``bytes5`` type for %%v%%. - */ - static bytes5(v) { return b(v, 5); } - /** - * Return a new ``bytes6`` type for %%v%%. - */ - static bytes6(v) { return b(v, 6); } - /** - * Return a new ``bytes7`` type for %%v%%. - */ - static bytes7(v) { return b(v, 7); } - /** - * Return a new ``bytes8`` type for %%v%%. - */ - static bytes8(v) { return b(v, 8); } - /** - * Return a new ``bytes9`` type for %%v%%. - */ - static bytes9(v) { return b(v, 9); } - /** - * Return a new ``bytes10`` type for %%v%%. - */ - static bytes10(v) { return b(v, 10); } - /** - * Return a new ``bytes11`` type for %%v%%. - */ - static bytes11(v) { return b(v, 11); } - /** - * Return a new ``bytes12`` type for %%v%%. - */ - static bytes12(v) { return b(v, 12); } - /** - * Return a new ``bytes13`` type for %%v%%. - */ - static bytes13(v) { return b(v, 13); } - /** - * Return a new ``bytes14`` type for %%v%%. - */ - static bytes14(v) { return b(v, 14); } - /** - * Return a new ``bytes15`` type for %%v%%. - */ - static bytes15(v) { return b(v, 15); } - /** - * Return a new ``bytes16`` type for %%v%%. - */ - static bytes16(v) { return b(v, 16); } - /** - * Return a new ``bytes17`` type for %%v%%. - */ - static bytes17(v) { return b(v, 17); } - /** - * Return a new ``bytes18`` type for %%v%%. - */ - static bytes18(v) { return b(v, 18); } - /** - * Return a new ``bytes19`` type for %%v%%. - */ - static bytes19(v) { return b(v, 19); } - /** - * Return a new ``bytes20`` type for %%v%%. - */ - static bytes20(v) { return b(v, 20); } - /** - * Return a new ``bytes21`` type for %%v%%. - */ - static bytes21(v) { return b(v, 21); } - /** - * Return a new ``bytes22`` type for %%v%%. - */ - static bytes22(v) { return b(v, 22); } - /** - * Return a new ``bytes23`` type for %%v%%. - */ - static bytes23(v) { return b(v, 23); } - /** - * Return a new ``bytes24`` type for %%v%%. - */ - static bytes24(v) { return b(v, 24); } - /** - * Return a new ``bytes25`` type for %%v%%. - */ - static bytes25(v) { return b(v, 25); } - /** - * Return a new ``bytes26`` type for %%v%%. - */ - static bytes26(v) { return b(v, 26); } - /** - * Return a new ``bytes27`` type for %%v%%. - */ - static bytes27(v) { return b(v, 27); } - /** - * Return a new ``bytes28`` type for %%v%%. - */ - static bytes28(v) { return b(v, 28); } - /** - * Return a new ``bytes29`` type for %%v%%. - */ - static bytes29(v) { return b(v, 29); } - /** - * Return a new ``bytes30`` type for %%v%%. - */ - static bytes30(v) { return b(v, 30); } - /** - * Return a new ``bytes31`` type for %%v%%. - */ - static bytes31(v) { return b(v, 31); } - /** - * Return a new ``bytes32`` type for %%v%%. - */ - static bytes32(v) { return b(v, 32); } - /** - * Return a new ``address`` type for %%v%%. - */ - static address(v) { return new Typed(_gaurd, "address", v); } - /** - * Return a new ``bool`` type for %%v%%. - */ - static bool(v) { return new Typed(_gaurd, "bool", !!v); } - /** - * Return a new ``bytes`` type for %%v%%. - */ - static bytes(v) { return new Typed(_gaurd, "bytes", v); } - /** - * Return a new ``string`` type for %%v%%. - */ - static string(v) { return new Typed(_gaurd, "string", v); } - /** - * Return a new ``array`` type for %%v%%, allowing %%dynamic%% length. - */ - static array(v, dynamic) { - throw new Error("not implemented yet"); - return new Typed(_gaurd, "array", v, dynamic); - } - /** - * Return a new ``tuple`` type for %%v%%, with the optional %%name%%. - */ - static tuple(v, name) { - throw new Error("not implemented yet"); - return new Typed(_gaurd, "tuple", v, name); - } - /** - * Return a new ``uint8`` type for %%v%%. - */ - static overrides(v) { - return new Typed(_gaurd, "overrides", Object.assign({}, v)); - } - /** - * Returns true only if %%value%% is a [[Typed]] instance. - */ - static isTyped(value) { - return (value - && typeof (value) === "object" - && "_typedSymbol" in value - && value._typedSymbol === _typedSymbol); - } - /** - * If the value is a [[Typed]] instance, validates the underlying value - * and returns it, otherwise returns value directly. - * - * This is useful for functions that with to accept either a [[Typed]] - * object or values. - */ - static dereference(value, type) { - if (Typed.isTyped(value)) { - if (value.type !== type) { - throw new Error(`invalid type: expecetd ${type}, got ${value.type}`); - } - return value.value; - } - return value; - } -} -exports.Typed = Typed; -//# sourceMappingURL=typed.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/typed.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/typed.js.map deleted file mode 100644 index 357a6dae..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/abi/typed.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"typed.js","sourceRoot":"","sources":["../../src.ts/abi/typed.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAEH,gDAAoE;AAOpE,MAAM,MAAM,GAAG,EAAG,CAAC;AAEnB,SAAS,CAAC,CAAC,KAAmB,EAAE,KAAa;IACzC,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,IAAI,KAAK,GAAG,CAAC,EAAE;QACX,MAAM,GAAG,IAAI,CAAC;QACd,KAAK,IAAI,CAAC,CAAC,CAAC;KACf;IAED,wCAAwC;IACxC,OAAO,IAAI,KAAK,CAAC,MAAM,EAAE,GAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAA,CAAC,CAAC,GAAI,MAAO,KAAM,EAAE,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;AAC7F,CAAC;AAED,SAAS,CAAC,CAAC,KAAgB,EAAE,IAAa;IACtC,wCAAwC;IACxC,OAAO,IAAI,KAAK,CAAC,MAAM,EAAE,QAAS,CAAC,IAAI,CAAC,CAAC,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I,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACvC,OAAO,IAAI,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;IAC/C,CAAC;IAGD;;OAEG;IACH,MAAM,CAAC,SAAS,CAAC,CAAsB;QACnC,OAAO,IAAI,KAAK,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,EAAG,EAAE,CAAC,CAAC,CAAC,CAAC;IACjE,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,KAAU;QACrB,OAAO,CAAC,KAAK;eACN,OAAM,CAAC,KAAK,CAAC,KAAK,QAAQ;eAC1B,cAAc,IAAI,KAAK;eACvB,KAAK,CAAC,YAAY,KAAK,YAAY,CAAC,CAAC;IAChD,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,WAAW,CAAI,KAAgB,EAAE,IAAY;QAChD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YACtB,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,EAAE;gBACrB,MAAM,IAAI,KAAK,CAAC,0BAA2B,IAAK,SAAU,KAAK,CAAC,IAAK,EAAE,CAAC,CAAC;aAC5E;YACD,OAAO,KAAK,CAAC,KAAK,CAAC;SACtB;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ;AA5qBD,sBA4qBC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/address.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/address.d.ts deleted file mode 100644 index 581be4fc..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/address.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Returns a normalized and checksumed address for %%address%%. - * This accepts non-checksum addresses, checksum addresses and - * [[getIcapAddress]] formats. - * - * The checksum in Ethereum uses the capitalization (upper-case - * vs lower-case) of the characters within an address to encode - * its checksum, which offers, on average, a checksum of 15-bits. - * - * If %%address%% contains both upper-case and lower-case, it is - * assumed to already be a checksum address and its checksum is - * validated, and if the address fails its expected checksum an - * error is thrown. - * - * If you wish the checksum of %%address%% to be ignore, it should - * be converted to lower-case (i.e. ``.toLowercase()``) before - * being passed in. This should be a very rare situation though, - * that you wish to bypass the safegaurds in place to protect - * against an address that has been incorrectly copied from another - * source. - * - * @example: - * // Adds the checksum (via upper-casing specific letters) - * getAddress("0x8ba1f109551bd432803012645ac136ddd64dba72") - * //_result: - * - * // Converts ICAP address and adds checksum - * getAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36"); - * //_result: - * - * // Throws an error if an address contains mixed case, - * // but the checksum fails - * getAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72") - * //_error: - */ -export declare function getAddress(address: string): string; -/** - * The [ICAP Address format](link-icap) format is an early checksum - * format which attempts to be compatible with the banking - * industry [IBAN format](link-wiki-iban) for bank accounts. - * - * It is no longer common or a recommended format. - * - * @example: - * getIcapAddress("0x8ba1f109551bd432803012645ac136ddd64dba72"); - * //_result: - * - * getIcapAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36"); - * //_result: - * - * // Throws an error if the ICAP checksum is wrong - * getIcapAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK37"); - * //_error: - */ -export declare function getIcapAddress(address: string): string; -//# sourceMappingURL=address.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/address.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/address.d.ts.map deleted file mode 100644 index 9dec1887..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/address.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src.ts/address/address.ts"],"names":[],"mappings":"AAmFA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CA6BlD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAKtD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/address.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/address.js deleted file mode 100644 index 991c5ddb..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/address.js +++ /dev/null @@ -1,161 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getIcapAddress = exports.getAddress = void 0; -const index_js_1 = require("../crypto/index.js"); -const index_js_2 = require("../utils/index.js"); -const BN_0 = BigInt(0); -const BN_36 = BigInt(36); -function getChecksumAddress(address) { - // if (!isHexString(address, 20)) { - // logger.throwArgumentError("invalid address", "address", address); - // } - address = address.toLowerCase(); - const chars = address.substring(2).split(""); - const expanded = new Uint8Array(40); - for (let i = 0; i < 40; i++) { - expanded[i] = chars[i].charCodeAt(0); - } - const hashed = (0, index_js_2.getBytes)((0, index_js_1.keccak256)(expanded)); - for (let i = 0; i < 40; i += 2) { - if ((hashed[i >> 1] >> 4) >= 8) { - chars[i] = chars[i].toUpperCase(); - } - if ((hashed[i >> 1] & 0x0f) >= 8) { - chars[i + 1] = chars[i + 1].toUpperCase(); - } - } - return "0x" + chars.join(""); -} -// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number -// Create lookup table -const ibanLookup = {}; -for (let i = 0; i < 10; i++) { - ibanLookup[String(i)] = String(i); -} -for (let i = 0; i < 26; i++) { - ibanLookup[String.fromCharCode(65 + i)] = String(10 + i); -} -// How many decimal digits can we process? (for 64-bit float, this is 15) -// i.e. Math.floor(Math.log10(Number.MAX_SAFE_INTEGER)); -const safeDigits = 15; -function ibanChecksum(address) { - address = address.toUpperCase(); - address = address.substring(4) + address.substring(0, 2) + "00"; - let expanded = address.split("").map((c) => { return ibanLookup[c]; }).join(""); - // Javascript can handle integers safely up to 15 (decimal) digits - while (expanded.length >= safeDigits) { - let block = expanded.substring(0, safeDigits); - expanded = parseInt(block, 10) % 97 + expanded.substring(block.length); - } - let checksum = String(98 - (parseInt(expanded, 10) % 97)); - while (checksum.length < 2) { - checksum = "0" + checksum; - } - return checksum; -} -; -const Base36 = (function () { - ; - const result = {}; - for (let i = 0; i < 36; i++) { - const key = "0123456789abcdefghijklmnopqrstuvwxyz"[i]; - result[key] = BigInt(i); - } - return result; -})(); -function fromBase36(value) { - value = value.toLowerCase(); - let result = BN_0; - for (let i = 0; i < value.length; i++) { - result = result * BN_36 + Base36[value[i]]; - } - return result; -} -/** - * Returns a normalized and checksumed address for %%address%%. - * This accepts non-checksum addresses, checksum addresses and - * [[getIcapAddress]] formats. - * - * The checksum in Ethereum uses the capitalization (upper-case - * vs lower-case) of the characters within an address to encode - * its checksum, which offers, on average, a checksum of 15-bits. - * - * If %%address%% contains both upper-case and lower-case, it is - * assumed to already be a checksum address and its checksum is - * validated, and if the address fails its expected checksum an - * error is thrown. - * - * If you wish the checksum of %%address%% to be ignore, it should - * be converted to lower-case (i.e. ``.toLowercase()``) before - * being passed in. This should be a very rare situation though, - * that you wish to bypass the safegaurds in place to protect - * against an address that has been incorrectly copied from another - * source. - * - * @example: - * // Adds the checksum (via upper-casing specific letters) - * getAddress("0x8ba1f109551bd432803012645ac136ddd64dba72") - * //_result: - * - * // Converts ICAP address and adds checksum - * getAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36"); - * //_result: - * - * // Throws an error if an address contains mixed case, - * // but the checksum fails - * getAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72") - * //_error: - */ -function getAddress(address) { - (0, index_js_2.assertArgument)(typeof (address) === "string", "invalid address", "address", address); - if (address.match(/^(0x)?[0-9a-fA-F]{40}$/)) { - // Missing the 0x prefix - if (!address.startsWith("0x")) { - address = "0x" + address; - } - const result = getChecksumAddress(address); - // It is a checksummed address with a bad checksum - (0, index_js_2.assertArgument)(!address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) || result === address, "bad address checksum", "address", address); - return result; - } - // Maybe ICAP? (we only support direct mode) - if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) { - // It is an ICAP address with a bad checksum - (0, index_js_2.assertArgument)(address.substring(2, 4) === ibanChecksum(address), "bad icap checksum", "address", address); - let result = fromBase36(address.substring(4)).toString(16); - while (result.length < 40) { - result = "0" + result; - } - return getChecksumAddress("0x" + result); - } - (0, index_js_2.assertArgument)(false, "invalid address", "address", address); -} -exports.getAddress = getAddress; -/** - * The [ICAP Address format](link-icap) format is an early checksum - * format which attempts to be compatible with the banking - * industry [IBAN format](link-wiki-iban) for bank accounts. - * - * It is no longer common or a recommended format. - * - * @example: - * getIcapAddress("0x8ba1f109551bd432803012645ac136ddd64dba72"); - * //_result: - * - * getIcapAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36"); - * //_result: - * - * // Throws an error if the ICAP checksum is wrong - * getIcapAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK37"); - * //_error: - */ -function getIcapAddress(address) { - //let base36 = _base16To36(getAddress(address).substring(2)).toUpperCase(); - let base36 = BigInt(getAddress(address)).toString(36).toUpperCase(); - while (base36.length < 30) { - base36 = "0" + base36; - } - return "XE" + ibanChecksum("XE00" + base36) + base36; -} -exports.getIcapAddress = getIcapAddress; -//# sourceMappingURL=address.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/address.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/address.js.map deleted file mode 100644 index 51b8e0dc..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/address.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"address.js","sourceRoot":"","sources":["../../src.ts/address/address.ts"],"names":[],"mappings":";;;AAAA,iDAA+C;AAC/C,gDAA6D;AAG7D,MAAM,IAAI,GAAG,MAA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;IACrD,OAAO,IAAI,GAAG,YAAY,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,MAAM,CAAC;AACzD,CAAC;AALD,wCAKC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/checks.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/checks.d.ts deleted file mode 100644 index 24e781f8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/checks.d.ts +++ /dev/null @@ -1,81 +0,0 @@ -import type { Addressable, AddressLike, NameResolver } from "./index.js"; -/** - * Returns true if %%value%% is an object which implements the - * [[Addressable]] interface. - * - * @example: - * // Wallets and AbstractSigner sub-classes - * isAddressable(Wallet.createRandom()) - * //_result: - * - * // Contracts - * contract = new Contract("dai.tokens.ethers.eth", [ ], provider) - * isAddressable(contract) - * //_result: - */ -export declare function isAddressable(value: any): value is Addressable; -/** - * Returns true if %%value%% is a valid address. - * - * @example: - * // Valid address - * isAddress("0x8ba1f109551bD432803012645Ac136ddd64DBA72") - * //_result: - * - * // Valid ICAP address - * isAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36") - * //_result: - * - * // Invalid checksum - * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBa72") - * //_result: - * - * // Invalid ICAP checksum - * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72") - * //_result: - * - * // Not an address (an ENS name requires a provided and an - * // asynchronous API to access) - * isAddress("ricmoo.eth") - * //_result: - */ -export declare function isAddress(value: any): value is string; -/** - * Resolves to an address for the %%target%%, which may be any - * supported address type, an [[Addressable]] or a Promise which - * resolves to an address. - * - * If an ENS name is provided, but that name has not been correctly - * configured a [[UnconfiguredNameError]] is thrown. - * - * @example: - * addr = "0x6B175474E89094C44Da98b954EedeAC495271d0F" - * - * // Addresses are return synchronously - * resolveAddress(addr, provider) - * //_result: - * - * // Address promises are resolved asynchronously - * resolveAddress(Promise.resolve(addr)) - * //_result: - * - * // ENS names are resolved asynchronously - * resolveAddress("dai.tokens.ethers.eth", provider) - * //_result: - * - * // Addressable objects are resolved asynchronously - * contract = new Contract(addr, [ ]) - * resolveAddress(contract, provider) - * //_result: - * - * // Unconfigured ENS names reject - * resolveAddress("nothing-here.ricmoo.eth", provider) - * //_error: - * - * // ENS names require a NameResolver object passed in - * // (notice the provider was omitted) - * resolveAddress("nothing-here.ricmoo.eth") - * //_error: - */ -export declare function resolveAddress(target: AddressLike, resolver?: null | NameResolver): string | Promise; -//# sourceMappingURL=checks.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/checks.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/checks.d.ts.map deleted file mode 100644 index e2e020d1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/checks.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"checks.d.ts","sourceRoot":"","sources":["../../src.ts/address/checks.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAGzE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,WAAW,CAE9D;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,MAAM,CAMrD;AAWD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,YAAY,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAkB5G"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/checks.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/checks.js deleted file mode 100644 index 0e7727f4..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/checks.js +++ /dev/null @@ -1,120 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.resolveAddress = exports.isAddress = exports.isAddressable = void 0; -const index_js_1 = require("../utils/index.js"); -const address_js_1 = require("./address.js"); -/** - * Returns true if %%value%% is an object which implements the - * [[Addressable]] interface. - * - * @example: - * // Wallets and AbstractSigner sub-classes - * isAddressable(Wallet.createRandom()) - * //_result: - * - * // Contracts - * contract = new Contract("dai.tokens.ethers.eth", [ ], provider) - * isAddressable(contract) - * //_result: - */ -function isAddressable(value) { - return (value && typeof (value.getAddress) === "function"); -} -exports.isAddressable = isAddressable; -/** - * Returns true if %%value%% is a valid address. - * - * @example: - * // Valid address - * isAddress("0x8ba1f109551bD432803012645Ac136ddd64DBA72") - * //_result: - * - * // Valid ICAP address - * isAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36") - * //_result: - * - * // Invalid checksum - * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBa72") - * //_result: - * - * // Invalid ICAP checksum - * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72") - * //_result: - * - * // Not an address (an ENS name requires a provided and an - * // asynchronous API to access) - * isAddress("ricmoo.eth") - * //_result: - */ -function isAddress(value) { - try { - (0, address_js_1.getAddress)(value); - return true; - } - catch (error) { } - return false; -} -exports.isAddress = isAddress; -async function checkAddress(target, promise) { - const result = await promise; - if (result == null || result === "0x0000000000000000000000000000000000000000") { - (0, index_js_1.assert)(typeof (target) !== "string", "unconfigured name", "UNCONFIGURED_NAME", { value: target }); - (0, index_js_1.assertArgument)(false, "invalid AddressLike value; did not resolve to a value address", "target", target); - } - return (0, address_js_1.getAddress)(result); -} -/** - * Resolves to an address for the %%target%%, which may be any - * supported address type, an [[Addressable]] or a Promise which - * resolves to an address. - * - * If an ENS name is provided, but that name has not been correctly - * configured a [[UnconfiguredNameError]] is thrown. - * - * @example: - * addr = "0x6B175474E89094C44Da98b954EedeAC495271d0F" - * - * // Addresses are return synchronously - * resolveAddress(addr, provider) - * //_result: - * - * // Address promises are resolved asynchronously - * resolveAddress(Promise.resolve(addr)) - * //_result: - * - * // ENS names are resolved asynchronously - * resolveAddress("dai.tokens.ethers.eth", provider) - * //_result: - * - * // Addressable objects are resolved asynchronously - * contract = new Contract(addr, [ ]) - * resolveAddress(contract, provider) - * //_result: - * - * // Unconfigured ENS names reject - * resolveAddress("nothing-here.ricmoo.eth", provider) - * //_error: - * - * // ENS names require a NameResolver object passed in - * // (notice the provider was omitted) - * resolveAddress("nothing-here.ricmoo.eth") - * //_error: - */ -function resolveAddress(target, resolver) { - if (typeof (target) === "string") { - if (target.match(/^0x[0-9a-f]{40}$/i)) { - return (0, address_js_1.getAddress)(target); - } - (0, index_js_1.assert)(resolver != null, "ENS resolution requires a provider", "UNSUPPORTED_OPERATION", { operation: "resolveName" }); - return checkAddress(target, resolver.resolveName(target)); - } - else if (isAddressable(target)) { - return checkAddress(target, target.getAddress()); - } - else if (target && typeof (target.then) === "function") { - return checkAddress(target, target); - } - (0, index_js_1.assertArgument)(false, "unsupported addressable value", "target", target); -} -exports.resolveAddress = resolveAddress; -//# sourceMappingURL=checks.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/checks.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/checks.js.map deleted file mode 100644 index 8d13f247..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/checks.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"checks.js","sourceRoot":"","sources":["../../src.ts/address/checks.ts"],"names":[],"mappings":";;;AAAA,gDAA2D;AAE3D,6CAA0C;AAK1C;;;;;;;;;;;;;GAaG;AACH,SAAgB,aAAa,CAAC,KAAU;IACpC,OAAO,CAAC,KAAK,IAAI,OAAM,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,UAAU,CAAC,CAAC;AAC9D,C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O,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;KAEpD;SAAM,IAAI,MAAM,IAAI,OAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,UAAU,EAAE;QACrD,OAAO,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACvC;IAED,IAAA,yBAAc,EAAC,KAAK,EAAE,+BAA+B,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAC7E,CAAC;AAlBD,wCAkBC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/contract-address.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/contract-address.d.ts deleted file mode 100644 index 42b36f7f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/contract-address.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -import type { BigNumberish, BytesLike } from "../utils/index.js"; -/** - * Returns the address that would result from a ``CREATE`` for %%tx%%. - * - * This can be used to compute the address a contract will be - * deployed to by an EOA when sending a deployment transaction (i.e. - * when the ``to`` address is ``null``). - * - * This can also be used to compute the address a contract will be - * deployed to by a contract, by using the contract's address as the - * ``to`` and the contract's nonce. - * - * @example - * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72"; - * nonce = 5; - * - * getCreateAddress({ from, nonce }); - * //_result: - */ -export declare function getCreateAddress(tx: { - from: string; - nonce: BigNumberish; -}): string; -/** - * Returns the address that would result from a ``CREATE2`` operation - * with the given %%from%%, %%salt%% and %%initCodeHash%%. - * - * To compute the %%initCodeHash%% from a contract's init code, use - * the [[keccak256]] function. - * - * For a quick overview and example of ``CREATE2``, see [[link-ricmoo-wisps]]. - * - * @example - * // The address of the contract - * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72" - * - * // The salt - * salt = id("HelloWorld") - * - * // The hash of the initCode - * initCode = "0x6394198df16000526103ff60206004601c335afa6040516060f3"; - * initCodeHash = keccak256(initCode) - * - * getCreate2Address(from, salt, initCodeHash) - * //_result: - */ -export declare function getCreate2Address(_from: string, _salt: BytesLike, _initCodeHash: BytesLike): string; -//# sourceMappingURL=contract-address.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/contract-address.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/contract-address.d.ts.map deleted file mode 100644 index 624f8426..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/contract-address.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contract-address.d.ts","sourceRoot":"","sources":["../../src.ts/address/contract-address.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAKjE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,YAAY,CAAA;CAAE,GAAG,MAAM,CAclF;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,GAAG,MAAM,CAUnG"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/contract-address.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/contract-address.js deleted file mode 100644 index 6c545bbf..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/contract-address.js +++ /dev/null @@ -1,74 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getCreate2Address = exports.getCreateAddress = void 0; -const index_js_1 = require("../crypto/index.js"); -const index_js_2 = require("../utils/index.js"); -const address_js_1 = require("./address.js"); -// http://ethereum.stackexchange.com/questions/760/how-is-the-address-of-an-ethereum-contract-computed -/** - * Returns the address that would result from a ``CREATE`` for %%tx%%. - * - * This can be used to compute the address a contract will be - * deployed to by an EOA when sending a deployment transaction (i.e. - * when the ``to`` address is ``null``). - * - * This can also be used to compute the address a contract will be - * deployed to by a contract, by using the contract's address as the - * ``to`` and the contract's nonce. - * - * @example - * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72"; - * nonce = 5; - * - * getCreateAddress({ from, nonce }); - * //_result: - */ -function getCreateAddress(tx) { - const from = (0, address_js_1.getAddress)(tx.from); - const nonce = (0, index_js_2.getBigInt)(tx.nonce, "tx.nonce"); - let nonceHex = nonce.toString(16); - if (nonceHex === "0") { - nonceHex = "0x"; - } - else if (nonceHex.length % 2) { - nonceHex = "0x0" + nonceHex; - } - else { - nonceHex = "0x" + nonceHex; - } - return (0, address_js_1.getAddress)((0, index_js_2.dataSlice)((0, index_js_1.keccak256)((0, index_js_2.encodeRlp)([from, nonceHex])), 12)); -} -exports.getCreateAddress = getCreateAddress; -/** - * Returns the address that would result from a ``CREATE2`` operation - * with the given %%from%%, %%salt%% and %%initCodeHash%%. - * - * To compute the %%initCodeHash%% from a contract's init code, use - * the [[keccak256]] function. - * - * For a quick overview and example of ``CREATE2``, see [[link-ricmoo-wisps]]. - * - * @example - * // The address of the contract - * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72" - * - * // The salt - * salt = id("HelloWorld") - * - * // The hash of the initCode - * initCode = "0x6394198df16000526103ff60206004601c335afa6040516060f3"; - * initCodeHash = keccak256(initCode) - * - * getCreate2Address(from, salt, initCodeHash) - * //_result: - */ -function getCreate2Address(_from, _salt, _initCodeHash) { - const from = (0, address_js_1.getAddress)(_from); - const salt = (0, index_js_2.getBytes)(_salt, "salt"); - const initCodeHash = (0, index_js_2.getBytes)(_initCodeHash, "initCodeHash"); - (0, index_js_2.assertArgument)(salt.length === 32, "salt must be 32 bytes", "salt", _salt); - (0, index_js_2.assertArgument)(initCodeHash.length === 32, "initCodeHash must be 32 bytes", "initCodeHash", _initCodeHash); - return (0, address_js_1.getAddress)((0, index_js_2.dataSlice)((0, index_js_1.keccak256)((0, index_js_2.concat)(["0xff", from, salt, initCodeHash])), 12)); -} -exports.getCreate2Address = getCreate2Address; -//# sourceMappingURL=contract-address.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/contract-address.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/contract-address.js.map deleted file mode 100644 index a64f5da5..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/contract-address.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contract-address.js","sourceRoot":"","sources":["../../src.ts/address/contract-address.ts"],"names":[],"mappings":";;;AAAA,iDAA+C;AAC/C,gDAE2B;AAE3B,6CAA0C;AAK1C,sGAAsG;AAEtG;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,gBAAgB,CAAC,EAAyC;IACtE,MAAM,IAAI,GAAG,IAAA,uBAAU,EAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IACjC,MAAM,KAAK,GAAG,IAAA,oBAAS,EAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;IAE9C,IAAI,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAClC,IAAI,QAAQ,KAAK,GAAG,EAAE;QAClB,QAAQ,GAAG,IAAI,CAAC;KACnB;SAAM,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;QAC5B,QAAQ,GAAG,KAAK,GAAG,QAAQ,CAAC;KAC/B;SAAM;QACH,QAAQ,GAAG,IAAI,GAAG,QAAQ,CAAC;KAC9B;IAED,OAAO,IAAA,uBAAU,EAAC,IAAA,oBAAS,EAAC,IAAA,oBAAS,EAAC,IAAA,oBAAS,EAAC,CAAE,IAAI,EAAE,QAAQ,CAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/E,CAAC;AAdD,4CAcC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAgB,iBAAiB,CAAC,KAAa,EAAE,KAAgB,EAAE,aAAwB;IACvF,MAAM,IAAI,GAAG,IAAA,uBAAU,EAAC,KAAK,CAAC,CAAC;IAC/B,MAAM,IAAI,GAAG,IAAA,mBAAQ,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,MAAM,YAAY,GAAG,IAAA,mBAAQ,EAAC,aAAa,EAAE,cAAc,CAAC,CAAC;IAE7D,IAAA,yBAAc,EAAC,IAAI,CAAC,MAAM,KAAK,EAAE,EAAE,uBAAuB,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAE3E,IAAA,yBAAc,EAAC,YAAY,CAAC,MAAM,KAAK,EAAE,EAAE,+BAA+B,EAAE,cAAc,EAAE,aAAa,CAAC,CAAC;IAE3G,OAAO,IAAA,uBAAU,EAAC,IAAA,oBAAS,EAAC,IAAA,oBAAS,EAAC,IAAA,iBAAM,EAAC,CAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,CAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;AAC7F,CAAC;AAVD,8CAUC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/index.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/index.d.ts deleted file mode 100644 index c813ab83..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/index.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Addresses are a fundamental part of interacting with Ethereum. They - * represent the global identity of Externally Owned Accounts (accounts - * backed by a private key) and contracts. - * - * The Ethereum Naming Service (ENS) provides an interconnected ecosystem - * of contracts, standards and libraries which enable looking up an - * address for an ENS name. - * - * These functions help convert between various formats, validate - * addresses and safely resolve ENS names. - * - * @_section: api/address:Addresses [about-addresses] - */ -/** - * An interface for objects which have an address, and can - * resolve it asyncronously. - * - * This allows objects such as [[Signer]] or [[Contract]] to - * be used most places an address can be, for example getting - * the [balance](Provider-getBalance). - */ -export interface Addressable { - /** - * Get the object address. - */ - getAddress(): Promise; -} -/** - * Anything that can be used to return or resolve an address. - */ -export type AddressLike = string | Promise | Addressable; -/** - * An interface for any object which can resolve an ENS name. - */ -export interface NameResolver { - /** - * Resolve to the address for the ENS %%name%%. - * - * Resolves to ``null`` if the name is unconfigued. Use - * [[resolveAddress]] (passing this object as %%resolver%%) to - * throw for names that are unconfigured. - */ - resolveName(name: string): Promise; -} -export { getAddress, getIcapAddress } from "./address.js"; -export { getCreateAddress, getCreate2Address } from "./contract-address.js"; -export { isAddressable, isAddress, resolveAddress } from "./checks.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/index.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/index.d.ts.map deleted file mode 100644 index 87b489ff..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/address/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IACxB;;OAEG;IACH,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB;;;;;;OAMG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;CACrD;AAED,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE1D,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG5E,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/index.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/index.js deleted file mode 100644 index b09270af..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/index.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict"; -/** - * Addresses are a fundamental part of interacting with Ethereum. They - * represent the global identity of Externally Owned Accounts (accounts - * backed by a private key) and contracts. - * - * The Ethereum Naming Service (ENS) provides an interconnected ecosystem - * of contracts, standards and libraries which enable looking up an - * address for an ENS name. - * - * These functions help convert between various formats, validate - * addresses and safely resolve ENS names. - * - * @_section: api/address:Addresses [about-addresses] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.resolveAddress = exports.isAddress = exports.isAddressable = exports.getCreate2Address = exports.getCreateAddress = exports.getIcapAddress = exports.getAddress = void 0; -null; -var address_js_1 = require("./address.js"); -Object.defineProperty(exports, "getAddress", { enumerable: true, get: function () { return address_js_1.getAddress; } }); -Object.defineProperty(exports, "getIcapAddress", { enumerable: true, get: function () { return address_js_1.getIcapAddress; } }); -var contract_address_js_1 = require("./contract-address.js"); -Object.defineProperty(exports, "getCreateAddress", { enumerable: true, get: function () { return contract_address_js_1.getCreateAddress; } }); -Object.defineProperty(exports, "getCreate2Address", { enumerable: true, get: function () { return contract_address_js_1.getCreate2Address; } }); -var checks_js_1 = require("./checks.js"); -Object.defineProperty(exports, "isAddressable", { enumerable: true, get: function () { return checks_js_1.isAddressable; } }); -Object.defineProperty(exports, "isAddress", { enumerable: true, get: function () { return checks_js_1.isAddress; } }); -Object.defineProperty(exports, "resolveAddress", { enumerable: true, get: function () { return checks_js_1.resolveAddress; } }); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/index.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/index.js.map deleted file mode 100644 index eeb1d7bc..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/address/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/address/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAEH,IAAI,CAAC;AAoCL,2CAA0D;AAAjD,wGAAA,UAAU,OAAA;AAAE,4GAAA,cAAc,OAAA;AAEnC,6DAA4E;AAAnE,uHAAA,gBAAgB,OAAA;AAAE,wHAAA,iBAAiB,OAAA;AAG5C,yCAAuE;AAA9D,0GAAA,aAAa,OAAA;AAAE,sGAAA,SAAS,OAAA;AAAE,2GAAA,cAAc,OAAA"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/addresses.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/addresses.d.ts deleted file mode 100644 index a32d6be0..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/addresses.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * A constant for the zero address. - * - * (**i.e.** ``"0x0000000000000000000000000000000000000000"``) - */ -export declare const ZeroAddress: string; -//# sourceMappingURL=addresses.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/addresses.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/addresses.d.ts.map deleted file mode 100644 index 35a5c221..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/addresses.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"addresses.d.ts","sourceRoot":"","sources":["../../src.ts/constants/addresses.ts"],"names":[],"mappings":"AACA;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,MAAqD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/addresses.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/addresses.js deleted file mode 100644 index ff4fb40a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/addresses.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ZeroAddress = void 0; -/** - * A constant for the zero address. - * - * (**i.e.** ``"0x0000000000000000000000000000000000000000"``) - */ -exports.ZeroAddress = "0x0000000000000000000000000000000000000000"; -//# sourceMappingURL=addresses.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/addresses.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/addresses.js.map deleted file mode 100644 index 304c9fcd..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/addresses.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"addresses.js","sourceRoot":"","sources":["../../src.ts/constants/addresses.ts"],"names":[],"mappings":";;;AACA;;;;GAIG;AACU,QAAA,WAAW,GAAW,4CAA4C,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/hashes.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/hashes.d.ts deleted file mode 100644 index 784df715..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/hashes.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * A constant for the zero hash. - * - * (**i.e.** ``"0x0000000000000000000000000000000000000000000000000000000000000000"``) - */ -export declare const ZeroHash: string; -//# sourceMappingURL=hashes.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/hashes.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/hashes.d.ts.map deleted file mode 100644 index 23f5213c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/hashes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hashes.d.ts","sourceRoot":"","sources":["../../src.ts/constants/hashes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,MAA6E,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/hashes.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/hashes.js deleted file mode 100644 index fbcd74c8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/hashes.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ZeroHash = void 0; -/** - * A constant for the zero hash. - * - * (**i.e.** ``"0x0000000000000000000000000000000000000000000000000000000000000000"``) - */ -exports.ZeroHash = "0x0000000000000000000000000000000000000000000000000000000000000000"; -//# sourceMappingURL=hashes.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/hashes.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/hashes.js.map deleted file mode 100644 index 93e87e33..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/hashes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hashes.js","sourceRoot":"","sources":["../../src.ts/constants/hashes.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACU,QAAA,QAAQ,GAAW,oEAAoE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/index.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/index.d.ts deleted file mode 100644 index fa4e9e7a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Some common constants useful for Ethereum. - * - * @_section: api/constants: Constants [about-constants] - */ -export { ZeroAddress } from "./addresses.js"; -export { ZeroHash } from "./hashes.js"; -export { N, WeiPerEther, MaxUint256, MinInt256, MaxInt256 } from "./numbers.js"; -export { EtherSymbol, MessagePrefix } from "./strings.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/index.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/index.d.ts.map deleted file mode 100644 index 4df7cd4c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/constants/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACH,CAAC,EACD,WAAW,EACX,UAAU,EACV,SAAS,EACT,SAAS,EACZ,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/index.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/index.js deleted file mode 100644 index 6be74a77..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/index.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; -/** - * Some common constants useful for Ethereum. - * - * @_section: api/constants: Constants [about-constants] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.MessagePrefix = exports.EtherSymbol = exports.MaxInt256 = exports.MinInt256 = exports.MaxUint256 = exports.WeiPerEther = exports.N = exports.ZeroHash = exports.ZeroAddress = void 0; -var addresses_js_1 = require("./addresses.js"); -Object.defineProperty(exports, "ZeroAddress", { enumerable: true, get: function () { return addresses_js_1.ZeroAddress; } }); -var hashes_js_1 = require("./hashes.js"); -Object.defineProperty(exports, "ZeroHash", { enumerable: true, get: function () { return hashes_js_1.ZeroHash; } }); -var numbers_js_1 = require("./numbers.js"); -Object.defineProperty(exports, "N", { enumerable: true, get: function () { return numbers_js_1.N; } }); -Object.defineProperty(exports, "WeiPerEther", { enumerable: true, get: function () { return numbers_js_1.WeiPerEther; } }); -Object.defineProperty(exports, "MaxUint256", { enumerable: true, get: function () { return numbers_js_1.MaxUint256; } }); -Object.defineProperty(exports, "MinInt256", { enumerable: true, get: function () { return numbers_js_1.MinInt256; } }); -Object.defineProperty(exports, "MaxInt256", { enumerable: true, get: function () { return numbers_js_1.MaxInt256; } }); -var strings_js_1 = require("./strings.js"); -Object.defineProperty(exports, "EtherSymbol", { enumerable: true, get: function () { return strings_js_1.EtherSymbol; } }); -Object.defineProperty(exports, "MessagePrefix", { enumerable: true, get: function () { return strings_js_1.MessagePrefix; } }); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/index.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/index.js.map deleted file mode 100644 index d831b4ab..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/constants/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,+CAA6C;AAApC,2GAAA,WAAW,OAAA;AACpB,yCAAuC;AAA9B,qGAAA,QAAQ,OAAA;AACjB,2CAMsB;AALlB,+FAAA,CAAC,OAAA;AACD,yGAAA,WAAW,OAAA;AACX,wGAAA,UAAU,OAAA;AACV,uGAAA,SAAS,OAAA;AACT,uGAAA,SAAS,OAAA;AAEb,2CAA0D;AAAjD,yGAAA,WAAW,OAAA;AAAE,2GAAA,aAAa,OAAA"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/numbers.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/numbers.d.ts deleted file mode 100644 index 7c84eaa6..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/numbers.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * A constant for the order N for the secp256k1 curve. - * - * (**i.e.** ``0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n``) - */ -export declare const N: bigint; -/** - * A constant for the number of wei in a single ether. - * - * (**i.e.** ``1000000000000000000n``) - */ -export declare const WeiPerEther: bigint; -/** - * A constant for the maximum value for a ``uint256``. - * - * (**i.e.** ``0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) - */ -export declare const MaxUint256: bigint; -/** - * A constant for the minimum value for an ``int256``. - * - * (**i.e.** ``-8000000000000000000000000000000000000000000000000000000000000000n``) - */ -export declare const MinInt256: bigint; -/** - * A constant for the maximum value for an ``int256``. - * - * (**i.e.** ``0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) - */ -export declare const MaxInt256: bigint; -//# sourceMappingURL=numbers.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/numbers.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/numbers.d.ts.map deleted file mode 100644 index 6391e1fd..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/numbers.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"numbers.d.ts","sourceRoot":"","sources":["../../src.ts/constants/numbers.ts"],"names":[],"mappings":"AACA;;;;GAIG;AACH,eAAO,MAAM,CAAC,EAAE,MAAqF,CAAC;AAEtG;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,MAAsC,CAAC;AAEjE;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,MAAqF,CAAC;AAE/G;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,MAAkG,CAAC;AAE3H;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,MAAqF,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/numbers.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/numbers.js deleted file mode 100644 index 2ab9150b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/numbers.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.MaxInt256 = exports.MinInt256 = exports.MaxUint256 = exports.WeiPerEther = exports.N = void 0; -/** - * A constant for the order N for the secp256k1 curve. - * - * (**i.e.** ``0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n``) - */ -exports.N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); -/** - * A constant for the number of wei in a single ether. - * - * (**i.e.** ``1000000000000000000n``) - */ -exports.WeiPerEther = BigInt("1000000000000000000"); -/** - * A constant for the maximum value for a ``uint256``. - * - * (**i.e.** ``0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) - */ -exports.MaxUint256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); -/** - * A constant for the minimum value for an ``int256``. - * - * (**i.e.** ``-8000000000000000000000000000000000000000000000000000000000000000n``) - */ -exports.MinInt256 = BigInt("0x8000000000000000000000000000000000000000000000000000000000000000") * BigInt(-1); -/** - * A constant for the maximum value for an ``int256``. - * - * (**i.e.** ``0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) - */ -exports.MaxInt256 = BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); -//# sourceMappingURL=numbers.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/numbers.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/numbers.js.map deleted file mode 100644 index 38d1f6f2..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/numbers.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"numbers.js","sourceRoot":"","sources":["../../src.ts/constants/numbers.ts"],"names":[],"mappings":";;;AACA;;;;GAIG;AACU,QAAA,CAAC,GAAW,MAAM,CAAC,oEAAoE,CAAC,CAAC;AAEtG;;;;GAIG;AACU,QAAA,WAAW,GAAW,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAEjE;;;;GAIG;AACU,QAAA,UAAU,GAAW,MAAM,CAAC,oEAAoE,CAAC,CAAC;AAE/G;;;;GAIG;AACU,QAAA,SAAS,GAAW,MAAM,CAAC,oEAAoE,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAE3H;;;;GAIG;AACU,QAAA,SAAS,GAAW,MAAM,CAAC,oEAAoE,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/strings.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/strings.d.ts deleted file mode 100644 index 0ad1c868..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/strings.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * A constant for the ether symbol (normalized using NFKC). - * - * (**i.e.** ``"\\u039e"``) - */ -export declare const EtherSymbol: string; -/** - * A constant for the [[link-eip-191]] personal message prefix. - * - * (**i.e.** ``"\\x19Ethereum Signed Message:\\n"``) - */ -export declare const MessagePrefix: string; -//# sourceMappingURL=strings.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/strings.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/strings.d.ts.map deleted file mode 100644 index b911a56b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/strings.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../../src.ts/constants/strings.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,MAAiB,CAAC;AAG5C;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,MAAyC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/strings.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/strings.js deleted file mode 100644 index 78ebe30d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/strings.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -// NFKC (composed) // (decomposed) -Object.defineProperty(exports, "__esModule", { value: true }); -exports.MessagePrefix = exports.EtherSymbol = void 0; -/** - * A constant for the ether symbol (normalized using NFKC). - * - * (**i.e.** ``"\\u039e"``) - */ -exports.EtherSymbol = "\u039e"; // "\uD835\uDF63"; -/** - * A constant for the [[link-eip-191]] personal message prefix. - * - * (**i.e.** ``"\\x19Ethereum Signed Message:\\n"``) - */ -exports.MessagePrefix = "\x19Ethereum Signed Message:\n"; -//# sourceMappingURL=strings.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/strings.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/strings.js.map deleted file mode 100644 index 52f851ec..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/constants/strings.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"strings.js","sourceRoot":"","sources":["../../src.ts/constants/strings.ts"],"names":[],"mappings":";AAAA,8CAA8C;;;AAE9C;;;;GAIG;AACU,QAAA,WAAW,GAAW,QAAQ,CAAC,CAAE,kBAAkB;AAGhE;;;;GAIG;AACU,QAAA,aAAa,GAAW,gCAAgC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/contract.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/contract.d.ts deleted file mode 100644 index 13031522..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/contract.d.ts +++ /dev/null @@ -1,168 +0,0 @@ -import { Interface } from "../abi/index.js"; -import { Log, TransactionResponse } from "../providers/provider.js"; -import { ContractTransactionResponse, EventLog } from "./wrappers.js"; -import type { EventFragment, FunctionFragment, InterfaceAbi, ParamType } from "../abi/index.js"; -import type { Addressable } from "../address/index.js"; -import type { EventEmitterable, Listener } from "../utils/index.js"; -import type { BlockTag, ContractRunner } from "../providers/index.js"; -import type { ContractEventName, ContractInterface, ContractMethod, ContractEvent, ContractTransaction, WrappedFallback } from "./types.js"; -/** - * @_ignore: - */ -export declare function copyOverrides(arg: any, allowed?: Array): Promise>; -/** - * @_ignore: - */ -export declare function resolveArgs(_runner: null | ContractRunner, inputs: ReadonlyArray, args: Array): Promise>; -declare const internal: unique symbol; -export declare class BaseContract implements Addressable, EventEmitterable { - /** - * The target to connect to. - * - * This can be an address, ENS name or any [[Addressable]], such as - * another contract. To get the resolved address, use the ``getAddress`` - * method. - */ - readonly target: string | Addressable; - /** - * The contract Interface. - */ - readonly interface: Interface; - /** - * The connected runner. This is generally a [[Provider]] or a - * [[Signer]], which dictates what operations are supported. - * - * For example, a **Contract** connected to a [[Provider]] may - * only execute read-only operations. - */ - readonly runner: null | ContractRunner; - /** - * All the Events available on this contract. - */ - readonly filters: Record; - /** - * @_ignore: - */ - readonly [internal]: any; - /** - * The fallback or receive function if any. - */ - readonly fallback: null | WrappedFallback; - /** - * Creates a new contract connected to %%target%% with the %%abi%% and - * optionally connected to a %%runner%% to perform operations on behalf - * of. - */ - constructor(target: string | Addressable, abi: Interface | InterfaceAbi, runner?: null | ContractRunner, _deployTx?: null | TransactionResponse); - /** - * Return a new Contract instance with the same target and ABI, but - * a different %%runner%%. - */ - connect(runner: null | ContractRunner): BaseContract; - /** - * Return a new Contract instance with the same ABI and runner, but - * a different %%target%%. - */ - attach(target: string | Addressable): BaseContract; - /** - * Return the resolved address of this Contract. - */ - getAddress(): Promise; - /** - * Return the deployed bytecode or null if no bytecode is found. - */ - getDeployedCode(): Promise; - /** - * Resolve to this Contract once the bytecode has been deployed, or - * resolve immediately if already deployed. - */ - waitForDeployment(): Promise; - /** - * Return the transaction used to deploy this contract. - * - * This is only available if this instance was returned from a - * [[ContractFactory]]. - */ - deploymentTransaction(): null | ContractTransactionResponse; - /** - * Return the function for a given name. This is useful when a contract - * method name conflicts with a JavaScript name such as ``prototype`` or - * when using a Contract programmatically. - */ - getFunction(key: string | FunctionFragment): T; - /** - * Return the event for a given name. This is useful when a contract - * event name conflicts with a JavaScript name such as ``prototype`` or - * when using a Contract programmatically. - */ - getEvent(key: string | EventFragment): ContractEvent; - /** - * @_ignore: - */ - queryTransaction(hash: string): Promise>; - /** - * Provide historic access to event data for %%event%% in the range - * %%fromBlock%% (default: ``0``) to %%toBlock%% (default: ``"latest"``) - * inclusive. - */ - queryFilter(event: ContractEventName, fromBlock?: BlockTag, toBlock?: BlockTag): Promise>; - /** - * Add an event %%listener%% for the %%event%%. - */ - on(event: ContractEventName, listener: Listener): Promise; - /** - * Add an event %%listener%% for the %%event%%, but remove the listener - * after it is fired once. - */ - once(event: ContractEventName, listener: Listener): Promise; - /** - * Emit an %%event%% calling all listeners with %%args%%. - * - * Resolves to ``true`` if any listeners were called. - */ - emit(event: ContractEventName, ...args: Array): Promise; - /** - * Resolves to the number of listeners of %%event%% or the total number - * of listeners if unspecified. - */ - listenerCount(event?: ContractEventName): Promise; - /** - * Resolves to the listeners subscribed to %%event%% or all listeners - * if unspecified. - */ - listeners(event?: ContractEventName): Promise>; - /** - * Remove the %%listener%% from the listeners for %%event%% or remove - * all listeners if unspecified. - */ - off(event: ContractEventName, listener?: Listener): Promise; - /** - * Remove all the listeners for %%event%% or remove all listeners if - * unspecified. - */ - removeAllListeners(event?: ContractEventName): Promise; - /** - * Alias for [on]. - */ - addListener(event: ContractEventName, listener: Listener): Promise; - /** - * Alias for [off]. - */ - removeListener(event: ContractEventName, listener: Listener): Promise; - /** - * Create a new Class for the %%abi%%. - */ - static buildClass(abi: Interface | InterfaceAbi): new (target: string, runner?: null | ContractRunner) => BaseContract & Omit; - /** - * Create a new BaseContract with a specified Interface. - */ - static from(target: string, abi: Interface | InterfaceAbi, runner?: null | ContractRunner): BaseContract & Omit; -} -declare const Contract_base: new (target: string | Addressable, abi: Interface | InterfaceAbi, runner?: ContractRunner | null | undefined) => BaseContract & Omit; -/** - * A [[BaseContract]] with no type guards on its methods or events. - */ -export declare class Contract extends Contract_base { -} -export {}; -//# sourceMappingURL=contract.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/contract.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/contract.d.ts.map deleted file mode 100644 index 57f47f54..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/contract.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src.ts/contract/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAS,MAAM,iBAAiB,CAAC;AAInD,OAAO,EAAe,GAAG,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAMjF,OAAO,EAEH,2BAA2B,EAC3B,QAAQ,EACX,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,YAAY,EAAE,SAAS,EAAU,MAAM,iBAAiB,CAAC;AACxG,OAAO,KAAK,EAAE,WAAW,EAAgB,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EACR,QAAQ,EAAE,cAAc,EAC3B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAER,iBAAiB,EACjB,iBAAiB,EAEjB,cAAc,EAEd,aAAa,EACb,mBAAmB,EAEnB,eAAe,EAClB,MAAM,YAAY,CAAC;AAwGpB;;GAEG;AACH,wBAAsB,aAAa,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,KAAK,CAAC,MAAM,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AE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAiBvE;;;OAGG;IACG,kBAAkB,CAAC,KAAK,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAiBlE;;OAEG;IACG,WAAW,CAAC,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9E;;OAEG;IACG,cAAc,CAAC,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjF;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,iBAAiB,EAAE,GAAG,EAAE,SAAS,GAAG,YAAY,GAAG,KAAK,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,cAAc,KAAK,YAAY,GAAG,IAAI,CAAC,CAAC,EAAE,MAAM,YAAY,CAAC;IAS3K;;OAEG;IACH,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,iBAAiB,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,GAAG,YAAY,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,cAAc,GAAG,YAAY,GAAG,IAAI,CAAC,CAAC,EAAE,MAAM,YAAY,CAAC;CAKhK;;AAMD;;GAEG;AACH,qBAAa,QAAS,SAAQ,aAAe;CAAI"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/contract.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/contract.js deleted file mode 100644 index ff26f83a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/contract.js +++ /dev/null @@ -1,960 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Contract = exports.BaseContract = exports.resolveArgs = exports.copyOverrides = void 0; -const index_js_1 = require("../abi/index.js"); -const index_js_2 = require("../address/index.js"); -// import from provider.ts instead of index.ts to prevent circular dep -// from EtherscanProvider -const provider_js_1 = require("../providers/provider.js"); -const index_js_3 = require("../utils/index.js"); -const wrappers_js_1 = require("./wrappers.js"); -const BN_0 = BigInt(0); -function canCall(value) { - return (value && typeof (value.call) === "function"); -} -function canEstimate(value) { - return (value && typeof (value.estimateGas) === "function"); -} -function canResolve(value) { - return (value && typeof (value.resolveName) === "function"); -} -function canSend(value) { - return (value && typeof (value.sendTransaction) === "function"); -} -function getResolver(value) { - if (value != null) { - if (canResolve(value)) { - return value; - } - if (value.provider) { - return value.provider; - } - } - return undefined; -} -class PreparedTopicFilter { - #filter; - fragment; - constructor(contract, fragment, args) { - (0, index_js_3.defineProperties)(this, { fragment }); - if (fragment.inputs.length < args.length) { - throw new Error("too many arguments"); - } - // Recursively descend into args and resolve any addresses - const runner = getRunner(contract.runner, "resolveName"); - const resolver = canResolve(runner) ? runner : null; - this.#filter = (async function () { - const resolvedArgs = await Promise.all(fragment.inputs.map((param, index) => { - const arg = args[index]; - if (arg == null) { - return null; - } - return param.walkAsync(args[index], (type, value) => { - if (type === "address") { - if (Array.isArray(value)) { - return Promise.all(value.map((v) => (0, index_js_2.resolveAddress)(v, resolver))); - } - return (0, index_js_2.resolveAddress)(value, resolver); - } - return value; - }); - })); - return contract.interface.encodeFilterTopics(fragment, resolvedArgs); - })(); - } - getTopicFilter() { - return this.#filter; - } -} -// A = Arguments passed in as a tuple -// R = The result type of the call (i.e. if only one return type, -// the qualified type, otherwise Result) -// D = The type the default call will return (i.e. R for view/pure, -// TransactionResponse otherwise) -//export interface ContractMethod = Array, R = any, D extends R | ContractTransactionResponse = ContractTransactionResponse> { -function getRunner(value, feature) { - if (value == null) { - return null; - } - if (typeof (value[feature]) === "function") { - return value; - } - if (value.provider && typeof (value.provider[feature]) === "function") { - return value.provider; - } - return null; -} -function getProvider(value) { - if (value == null) { - return null; - } - return value.provider || null; -} -/** - * @_ignore: - */ -async function copyOverrides(arg, allowed) { - // Make sure the overrides passed in are a valid overrides object - const _overrides = index_js_1.Typed.dereference(arg, "overrides"); - (0, index_js_3.assertArgument)(typeof (_overrides) === "object", "invalid overrides parameter", "overrides", arg); - // Create a shallow copy (we'll deep-ify anything needed during normalizing) - const overrides = (0, provider_js_1.copyRequest)(_overrides); - (0, index_js_3.assertArgument)(overrides.to == null || (allowed || []).indexOf("to") >= 0, "cannot override to", "overrides.to", overrides.to); - (0, index_js_3.assertArgument)(overrides.data == null || (allowed || []).indexOf("data") >= 0, "cannot override data", "overrides.data", overrides.data); - // Resolve any from - if (overrides.from) { - overrides.from = overrides.from; - } - return overrides; -} -exports.copyOverrides = copyOverrides; -/** - * @_ignore: - */ -async function resolveArgs(_runner, inputs, args) { - // Recursively descend into args and resolve any addresses - const runner = getRunner(_runner, "resolveName"); - const resolver = canResolve(runner) ? runner : null; - return await Promise.all(inputs.map((param, index) => { - return param.walkAsync(args[index], (type, value) => { - value = index_js_1.Typed.dereference(value, type); - if (type === "address") { - return (0, index_js_2.resolveAddress)(value, resolver); - } - return value; - }); - })); -} -exports.resolveArgs = resolveArgs; -function buildWrappedFallback(contract) { - const populateTransaction = async function (overrides) { - // If an overrides was passed in, copy it and normalize the values - const tx = (await copyOverrides(overrides, ["data"])); - tx.to = await contract.getAddress(); - if (tx.from) { - tx.from = await (0, index_js_2.resolveAddress)(tx.from, getResolver(contract.runner)); - } - const iface = contract.interface; - const noValue = ((0, index_js_3.getBigInt)((tx.value || BN_0), "overrides.value") === BN_0); - const noData = ((tx.data || "0x") === "0x"); - if (iface.fallback && !iface.fallback.payable && iface.receive && !noData && !noValue) { - (0, index_js_3.assertArgument)(false, "cannot send data to receive or send value to non-payable fallback", "overrides", overrides); - } - (0, index_js_3.assertArgument)(iface.fallback || noData, "cannot send data to receive-only contract", "overrides.data", tx.data); - // Only allow payable contracts to set non-zero value - const payable = iface.receive || (iface.fallback && iface.fallback.payable); - (0, index_js_3.assertArgument)(payable || noValue, "cannot send value to non-payable fallback", "overrides.value", tx.value); - // Only allow fallback contracts to set non-empty data - (0, index_js_3.assertArgument)(iface.fallback || noData, "cannot send data to receive-only contract", "overrides.data", tx.data); - return tx; - }; - const staticCall = async function (overrides) { - const runner = getRunner(contract.runner, "call"); - (0, index_js_3.assert)(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" }); - const tx = await populateTransaction(overrides); - try { - return await runner.call(tx); - } - catch (error) { - if ((0, index_js_3.isCallException)(error) && error.data) { - throw contract.interface.makeError(error.data, tx); - } - throw error; - } - }; - const send = async function (overrides) { - const runner = contract.runner; - (0, index_js_3.assert)(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" }); - const tx = await runner.sendTransaction(await populateTransaction(overrides)); - const provider = getProvider(contract.runner); - // @TODO: the provider can be null; make a custom dummy provider that will throw a - // meaningful error - return new wrappers_js_1.ContractTransactionResponse(contract.interface, provider, tx); - }; - const estimateGas = async function (overrides) { - const runner = getRunner(contract.runner, "estimateGas"); - (0, index_js_3.assert)(canEstimate(runner), "contract runner does not support gas estimation", "UNSUPPORTED_OPERATION", { operation: "estimateGas" }); - return await runner.estimateGas(await populateTransaction(overrides)); - }; - const method = async (overrides) => { - return await send(overrides); - }; - (0, index_js_3.defineProperties)(method, { - _contract: contract, - estimateGas, - populateTransaction, - send, staticCall - }); - return method; -} -function buildWrappedMethod(contract, key) { - const getFragment = function (...args) { - const fragment = contract.interface.getFunction(key, args); - (0, index_js_3.assert)(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", { - operation: "fragment", - info: { key, args } - }); - return fragment; - }; - const populateTransaction = async function (...args) { - const fragment = getFragment(...args); - // If an overrides was passed in, copy it and normalize the values - let overrides = {}; - if (fragment.inputs.length + 1 === args.length) { - overrides = await copyOverrides(args.pop()); - if (overrides.from) { - overrides.from = await (0, index_js_2.resolveAddress)(overrides.from, getResolver(contract.runner)); - } - } - if (fragment.inputs.length !== args.length) { - throw new Error("internal error: fragment inputs doesn't match arguments; should not happen"); - } - const resolvedArgs = await resolveArgs(contract.runner, fragment.inputs, args); - return Object.assign({}, overrides, await (0, index_js_3.resolveProperties)({ - to: contract.getAddress(), - data: contract.interface.encodeFunctionData(fragment, resolvedArgs) - })); - }; - const staticCall = async function (...args) { - const result = await staticCallResult(...args); - if (result.length === 1) { - return result[0]; - } - return result; - }; - const send = async function (...args) { - const runner = contract.runner; - (0, index_js_3.assert)(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" }); - const tx = await runner.sendTransaction(await populateTransaction(...args)); - const provider = getProvider(contract.runner); - // @TODO: the provider can be null; make a custom dummy provider that will throw a - // meaningful error - return new wrappers_js_1.ContractTransactionResponse(contract.interface, provider, tx); - }; - const estimateGas = async function (...args) { - const runner = getRunner(contract.runner, "estimateGas"); - (0, index_js_3.assert)(canEstimate(runner), "contract runner does not support gas estimation", "UNSUPPORTED_OPERATION", { operation: "estimateGas" }); - return await runner.estimateGas(await populateTransaction(...args)); - }; - const staticCallResult = async function (...args) { - const runner = getRunner(contract.runner, "call"); - (0, index_js_3.assert)(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" }); - const tx = await populateTransaction(...args); - let result = "0x"; - try { - result = await runner.call(tx); - } - catch (error) { - if ((0, index_js_3.isCallException)(error) && error.data) { - throw contract.interface.makeError(error.data, tx); - } - throw error; - } - const fragment = getFragment(...args); - return contract.interface.decodeFunctionResult(fragment, result); - }; - const method = async (...args) => { - const fragment = getFragment(...args); - if (fragment.constant) { - return await staticCall(...args); - } - return await send(...args); - }; - (0, index_js_3.defineProperties)(method, { - name: contract.interface.getFunctionName(key), - _contract: contract, _key: key, - getFragment, - estimateGas, - populateTransaction, - send, staticCall, staticCallResult, - }); - // Only works on non-ambiguous keys (refined fragment is always non-ambiguous) - Object.defineProperty(method, "fragment", { - configurable: false, - enumerable: true, - get: () => { - const fragment = contract.interface.getFunction(key); - (0, index_js_3.assert)(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", { - operation: "fragment", - info: { key } - }); - return fragment; - } - }); - return method; -} -function buildWrappedEvent(contract, key) { - const getFragment = function (...args) { - const fragment = contract.interface.getEvent(key, args); - (0, index_js_3.assert)(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", { - operation: "fragment", - info: { key, args } - }); - return fragment; - }; - const method = function (...args) { - return new PreparedTopicFilter(contract, getFragment(...args), args); - }; - (0, index_js_3.defineProperties)(method, { - name: contract.interface.getEventName(key), - _contract: contract, _key: key, - getFragment - }); - // Only works on non-ambiguous keys (refined fragment is always non-ambiguous) - Object.defineProperty(method, "fragment", { - configurable: false, - enumerable: true, - get: () => { - const fragment = contract.interface.getEvent(key); - (0, index_js_3.assert)(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", { - operation: "fragment", - info: { key } - }); - return fragment; - } - }); - return method; -} -// The combination of TypeScrype, Private Fields and Proxies makes -// the world go boom; so we hide variables with some trickery keeping -// a symbol attached to each BaseContract which its sub-class (even -// via a Proxy) can reach and use to look up its internal values. -const internal = Symbol.for("_ethersInternal_contract"); -const internalValues = new WeakMap(); -function setInternal(contract, values) { - internalValues.set(contract[internal], values); -} -function getInternal(contract) { - return internalValues.get(contract[internal]); -} -function isDeferred(value) { - return (value && typeof (value) === "object" && ("getTopicFilter" in value) && - (typeof (value.getTopicFilter) === "function") && value.fragment); -} -async function getSubInfo(contract, event) { - let topics; - let fragment = null; - // Convert named events to topicHash and get the fragment for - // events which need deconstructing. - if (Array.isArray(event)) { - const topicHashify = function (name) { - if ((0, index_js_3.isHexString)(name, 32)) { - return name; - } - const fragment = contract.interface.getEvent(name); - (0, index_js_3.assertArgument)(fragment, "unknown fragment", "name", name); - return fragment.topicHash; - }; - // Array of Topics and Names; e.g. `[ "0x1234...89ab", "Transfer(address)" ]` - topics = event.map((e) => { - if (e == null) { - return null; - } - if (Array.isArray(e)) { - return e.map(topicHashify); - } - return topicHashify(e); - }); - } - else if (event === "*") { - topics = [null]; - } - else if (typeof (event) === "string") { - if ((0, index_js_3.isHexString)(event, 32)) { - // Topic Hash - topics = [event]; - } - else { - // Name or Signature; e.g. `"Transfer", `"Transfer(address)"` - fragment = contract.interface.getEvent(event); - (0, index_js_3.assertArgument)(fragment, "unknown fragment", "event", event); - topics = [fragment.topicHash]; - } - } - else if (isDeferred(event)) { - // Deferred Topic Filter; e.g. `contract.filter.Transfer(from)` - topics = await event.getTopicFilter(); - } - else if ("fragment" in event) { - // ContractEvent; e.g. `contract.filter.Transfer` - fragment = event.fragment; - topics = [fragment.topicHash]; - } - else { - (0, index_js_3.assertArgument)(false, "unknown event name", "event", event); - } - // Normalize topics and sort TopicSets - topics = topics.map((t) => { - if (t == null) { - return null; - } - if (Array.isArray(t)) { - const items = Array.from(new Set(t.map((t) => t.toLowerCase())).values()); - if (items.length === 1) { - return items[0]; - } - items.sort(); - return items; - } - return t.toLowerCase(); - }); - const tag = topics.map((t) => { - if (t == null) { - return "null"; - } - if (Array.isArray(t)) { - return t.join("|"); - } - return t; - }).join("&"); - return { fragment, tag, topics }; -} -async function hasSub(contract, event) { - const { subs } = getInternal(contract); - return subs.get((await getSubInfo(contract, event)).tag) || null; -} -async function getSub(contract, operation, event) { - // Make sure our runner can actually subscribe to events - const provider = getProvider(contract.runner); - (0, index_js_3.assert)(provider, "contract runner does not support subscribing", "UNSUPPORTED_OPERATION", { operation }); - const { fragment, tag, topics } = await getSubInfo(contract, event); - const { addr, subs } = getInternal(contract); - let sub = subs.get(tag); - if (!sub) { - const address = (addr ? addr : contract); - const filter = { address, topics }; - const listener = (log) => { - let foundFragment = fragment; - if (foundFragment == null) { - try { - foundFragment = contract.interface.getEvent(log.topics[0]); - } - catch (error) { } - } - // If fragment is null, we do not deconstruct the args to emit - if (foundFragment) { - const _foundFragment = foundFragment; - const args = fragment ? contract.interface.decodeEventLog(fragment, log.data, log.topics) : []; - emit(contract, event, args, (listener) => { - return new wrappers_js_1.ContractEventPayload(contract, listener, event, _foundFragment, log); - }); - } - else { - emit(contract, event, [], (listener) => { - return new wrappers_js_1.ContractUnknownEventPayload(contract, listener, event, log); - }); - } - }; - let starting = []; - const start = () => { - if (starting.length) { - return; - } - starting.push(provider.on(filter, listener)); - }; - const stop = async () => { - if (starting.length == 0) { - return; - } - let started = starting; - starting = []; - await Promise.all(started); - provider.off(filter, listener); - }; - sub = { tag, listeners: [], start, stop }; - subs.set(tag, sub); - } - return sub; -} -// We use this to ensure one emit resolves before firing the next to -// ensure correct ordering (note this cannot throw and just adds the -// notice to the event queu using setTimeout). -let lastEmit = Promise.resolve(); -async function _emit(contract, event, args, payloadFunc) { - await lastEmit; - const sub = await hasSub(contract, event); - if (!sub) { - return false; - } - const count = sub.listeners.length; - sub.listeners = sub.listeners.filter(({ listener, once }) => { - const passArgs = Array.from(args); - if (payloadFunc) { - passArgs.push(payloadFunc(once ? null : listener)); - } - try { - listener.call(contract, ...passArgs); - } - catch (error) { } - return !once; - }); - if (sub.listeners.length === 0) { - sub.stop(); - getInternal(contract).subs.delete(sub.tag); - } - return (count > 0); -} -async function emit(contract, event, args, payloadFunc) { - try { - await lastEmit; - } - catch (error) { } - const resultPromise = _emit(contract, event, args, payloadFunc); - lastEmit = resultPromise; - return await resultPromise; -} -const passProperties = ["then"]; -class BaseContract { - /** - * The target to connect to. - * - * This can be an address, ENS name or any [[Addressable]], such as - * another contract. To get the resolved address, use the ``getAddress`` - * method. - */ - target; - /** - * The contract Interface. - */ - interface; - /** - * The connected runner. This is generally a [[Provider]] or a - * [[Signer]], which dictates what operations are supported. - * - * For example, a **Contract** connected to a [[Provider]] may - * only execute read-only operations. - */ - runner; - /** - * All the Events available on this contract. - */ - filters; - /** - * @_ignore: - */ - [internal]; - /** - * The fallback or receive function if any. - */ - fallback; - /** - * Creates a new contract connected to %%target%% with the %%abi%% and - * optionally connected to a %%runner%% to perform operations on behalf - * of. - */ - constructor(target, abi, runner, _deployTx) { - (0, index_js_3.assertArgument)(typeof (target) === "string" || (0, index_js_2.isAddressable)(target), "invalid value for Contract target", "target", target); - if (runner == null) { - runner = null; - } - const iface = index_js_1.Interface.from(abi); - (0, index_js_3.defineProperties)(this, { target, runner, interface: iface }); - Object.defineProperty(this, internal, { value: {} }); - let addrPromise; - let addr = null; - let deployTx = null; - if (_deployTx) { - const provider = getProvider(runner); - // @TODO: the provider can be null; make a custom dummy provider that will throw a - // meaningful error - deployTx = new wrappers_js_1.ContractTransactionResponse(this.interface, provider, _deployTx); - } - let subs = new Map(); - // Resolve the target as the address - if (typeof (target) === "string") { - if ((0, index_js_3.isHexString)(target)) { - addr = target; - addrPromise = Promise.resolve(target); - } - else { - const resolver = getRunner(runner, "resolveName"); - if (!canResolve(resolver)) { - throw (0, index_js_3.makeError)("contract runner does not support name resolution", "UNSUPPORTED_OPERATION", { - operation: "resolveName" - }); - } - addrPromise = resolver.resolveName(target).then((addr) => { - if (addr == null) { - throw (0, index_js_3.makeError)("an ENS name used for a contract target must be correctly configured", "UNCONFIGURED_NAME", { - value: target - }); - } - getInternal(this).addr = addr; - return addr; - }); - } - } - else { - addrPromise = target.getAddress().then((addr) => { - if (addr == null) { - throw new Error("TODO"); - } - getInternal(this).addr = addr; - return addr; - }); - } - // Set our private values - setInternal(this, { addrPromise, addr, deployTx, subs }); - // Add the event filters - const filters = new Proxy({}, { - get: (target, prop, receiver) => { - // Pass important checks (like `then` for Promise) through - if (typeof (prop) === "symbol" || passProperties.indexOf(prop) >= 0) { - return Reflect.get(target, prop, receiver); - } - try { - return this.getEvent(prop); - } - catch (error) { - if (!(0, index_js_3.isError)(error, "INVALID_ARGUMENT") || error.argument !== "key") { - throw error; - } - } - return undefined; - }, - has: (target, prop) => { - // Pass important checks (like `then` for Promise) through - if (passProperties.indexOf(prop) >= 0) { - return Reflect.has(target, prop); - } - return Reflect.has(target, prop) || this.interface.hasEvent(String(prop)); - } - }); - (0, index_js_3.defineProperties)(this, { filters }); - (0, index_js_3.defineProperties)(this, { - fallback: ((iface.receive || iface.fallback) ? (buildWrappedFallback(this)) : null) - }); - // Return a Proxy that will respond to functions - return new Proxy(this, { - get: (target, prop, receiver) => { - if (typeof (prop) === "symbol" || prop in target || passProperties.indexOf(prop) >= 0) { - return Reflect.get(target, prop, receiver); - } - // Undefined properties should return undefined - try { - return target.getFunction(prop); - } - catch (error) { - if (!(0, index_js_3.isError)(error, "INVALID_ARGUMENT") || error.argument !== "key") { - throw error; - } - } - return undefined; - }, - has: (target, prop) => { - if (typeof (prop) === "symbol" || prop in target || passProperties.indexOf(prop) >= 0) { - return Reflect.has(target, prop); - } - return target.interface.hasFunction(prop); - } - }); - } - /** - * Return a new Contract instance with the same target and ABI, but - * a different %%runner%%. - */ - connect(runner) { - return new BaseContract(this.target, this.interface, runner); - } - /** - * Return a new Contract instance with the same ABI and runner, but - * a different %%target%%. - */ - attach(target) { - return new BaseContract(target, this.interface, this.runner); - } - /** - * Return the resolved address of this Contract. - */ - async getAddress() { return await getInternal(this).addrPromise; } - /** - * Return the deployed bytecode or null if no bytecode is found. - */ - async getDeployedCode() { - const provider = getProvider(this.runner); - (0, index_js_3.assert)(provider, "runner does not support .provider", "UNSUPPORTED_OPERATION", { operation: "getDeployedCode" }); - const code = await provider.getCode(await this.getAddress()); - if (code === "0x") { - return null; - } - return code; - } - /** - * Resolve to this Contract once the bytecode has been deployed, or - * resolve immediately if already deployed. - */ - async waitForDeployment() { - // We have the deployment transaction; just use that (throws if deployment fails) - const deployTx = this.deploymentTransaction(); - if (deployTx) { - await deployTx.wait(); - return this; - } - // Check for code - const code = await this.getDeployedCode(); - if (code != null) { - return this; - } - // Make sure we can subscribe to a provider event - const provider = getProvider(this.runner); - (0, index_js_3.assert)(provider != null, "contract runner does not support .provider", "UNSUPPORTED_OPERATION", { operation: "waitForDeployment" }); - return new Promise((resolve, reject) => { - const checkCode = async () => { - try { - const code = await this.getDeployedCode(); - if (code != null) { - return resolve(this); - } - provider.once("block", checkCode); - } - catch (error) { - reject(error); - } - }; - checkCode(); - }); - } - /** - * Return the transaction used to deploy this contract. - * - * This is only available if this instance was returned from a - * [[ContractFactory]]. - */ - deploymentTransaction() { - return getInternal(this).deployTx; - } - /** - * Return the function for a given name. This is useful when a contract - * method name conflicts with a JavaScript name such as ``prototype`` or - * when using a Contract programmatically. - */ - getFunction(key) { - if (typeof (key) !== "string") { - key = key.format(); - } - const func = buildWrappedMethod(this, key); - return func; - } - /** - * Return the event for a given name. This is useful when a contract - * event name conflicts with a JavaScript name such as ``prototype`` or - * when using a Contract programmatically. - */ - getEvent(key) { - if (typeof (key) !== "string") { - key = key.format(); - } - return buildWrappedEvent(this, key); - } - /** - * @_ignore: - */ - async queryTransaction(hash) { - throw new Error("@TODO"); - } - /* - // @TODO: this is a non-backwards compatible change, but will be added - // in v7 and in a potential SmartContract class in an upcoming - // v6 release - async getTransactionReceipt(hash: string): Promise { - const provider = getProvider(this.runner); - assert(provider, "contract runner does not have a provider", - "UNSUPPORTED_OPERATION", { operation: "queryTransaction" }); - - const receipt = await provider.getTransactionReceipt(hash); - if (receipt == null) { return null; } - - return new ContractTransactionReceipt(this.interface, provider, receipt); - } - */ - /** - * Provide historic access to event data for %%event%% in the range - * %%fromBlock%% (default: ``0``) to %%toBlock%% (default: ``"latest"``) - * inclusive. - */ - async queryFilter(event, fromBlock, toBlock) { - if (fromBlock == null) { - fromBlock = 0; - } - if (toBlock == null) { - toBlock = "latest"; - } - const { addr, addrPromise } = getInternal(this); - const address = (addr ? addr : (await addrPromise)); - const { fragment, topics } = await getSubInfo(this, event); - const filter = { address, topics, fromBlock, toBlock }; - const provider = getProvider(this.runner); - (0, index_js_3.assert)(provider, "contract runner does not have a provider", "UNSUPPORTED_OPERATION", { operation: "queryFilter" }); - return (await provider.getLogs(filter)).map((log) => { - let foundFragment = fragment; - if (foundFragment == null) { - try { - foundFragment = this.interface.getEvent(log.topics[0]); - } - catch (error) { } - } - if (foundFragment) { - try { - return new wrappers_js_1.EventLog(log, this.interface, foundFragment); - } - catch (error) { - return new wrappers_js_1.UndecodedEventLog(log, error); - } - } - return new provider_js_1.Log(log, provider); - }); - } - /** - * Add an event %%listener%% for the %%event%%. - */ - async on(event, listener) { - const sub = await getSub(this, "on", event); - sub.listeners.push({ listener, once: false }); - sub.start(); - return this; - } - /** - * Add an event %%listener%% for the %%event%%, but remove the listener - * after it is fired once. - */ - async once(event, listener) { - const sub = await getSub(this, "once", event); - sub.listeners.push({ listener, once: true }); - sub.start(); - return this; - } - /** - * Emit an %%event%% calling all listeners with %%args%%. - * - * Resolves to ``true`` if any listeners were called. - */ - async emit(event, ...args) { - return await emit(this, event, args, null); - } - /** - * Resolves to the number of listeners of %%event%% or the total number - * of listeners if unspecified. - */ - async listenerCount(event) { - if (event) { - const sub = await hasSub(this, event); - if (!sub) { - return 0; - } - return sub.listeners.length; - } - const { subs } = getInternal(this); - let total = 0; - for (const { listeners } of subs.values()) { - total += listeners.length; - } - return total; - } - /** - * Resolves to the listeners subscribed to %%event%% or all listeners - * if unspecified. - */ - async listeners(event) { - if (event) { - const sub = await hasSub(this, event); - if (!sub) { - return []; - } - return sub.listeners.map(({ listener }) => listener); - } - const { subs } = getInternal(this); - let result = []; - for (const { listeners } of subs.values()) { - result = result.concat(listeners.map(({ listener }) => listener)); - } - return result; - } - /** - * Remove the %%listener%% from the listeners for %%event%% or remove - * all listeners if unspecified. - */ - async off(event, listener) { - const sub = await hasSub(this, event); - if (!sub) { - return this; - } - if (listener) { - const index = sub.listeners.map(({ listener }) => listener).indexOf(listener); - if (index >= 0) { - sub.listeners.splice(index, 1); - } - } - if (listener == null || sub.listeners.length === 0) { - sub.stop(); - getInternal(this).subs.delete(sub.tag); - } - return this; - } - /** - * Remove all the listeners for %%event%% or remove all listeners if - * unspecified. - */ - async removeAllListeners(event) { - if (event) { - const sub = await hasSub(this, event); - if (!sub) { - return this; - } - sub.stop(); - getInternal(this).subs.delete(sub.tag); - } - else { - const { subs } = getInternal(this); - for (const { tag, stop } of subs.values()) { - stop(); - subs.delete(tag); - } - } - return this; - } - /** - * Alias for [on]. - */ - async addListener(event, listener) { - return await this.on(event, listener); - } - /** - * Alias for [off]. - */ - async removeListener(event, listener) { - return await this.off(event, listener); - } - /** - * Create a new Class for the %%abi%%. - */ - static buildClass(abi) { - class CustomContract extends BaseContract { - constructor(address, runner = null) { - super(address, abi, runner); - } - } - return CustomContract; - } - ; - /** - * Create a new BaseContract with a specified Interface. - */ - static from(target, abi, runner) { - if (runner == null) { - runner = null; - } - const contract = new this(target, abi, runner); - return contract; - } -} -exports.BaseContract = BaseContract; -function _ContractBase() { - return BaseContract; -} -/** - * A [[BaseContract]] with no type guards on its methods or events. - */ -class Contract extends _ContractBase() { -} -exports.Contract = Contract; -//# sourceMappingURL=contract.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/contract.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/contract.js.map deleted file mode 100644 index 7be39877..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/contract.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contract.js","sourceRoot":"","sources":["../../src.ts/contract/contract.ts"],"names":[],"mappings":";;;AAAA,8CAAmD;AACnD,kDAAoE;AACpE,sEAAsE;AACtE,yBAAyB;AACzB,0DAAiF;AACjF,gDAG2B;AAE3B,+CAIuB;AAsBvB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAkBvB,SAAS,OAAO,CAAC,KAAU;IACvB,OAAO,CAAC,KAAK,IAAI,OAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,UAAU,CAAC,CAAC;AACxD,CAAC;AAED,SAAS,WAAW,CAAC,KAAU;IAC3B,OAAO,CAAC,KAAK,IAAI,OAAM,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,UAAU,CAAC,CAAC;AAC/D,CAAC;AAED,SAAS,UAAU,CAAC,KAAU;IAC1B,OAAO,CAAC,KAAK,IAAI,OAAM,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,UAAU,CAAC,CAA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GAA6B;QAClE,MAAM,cAAe,SAAQ,YAAY;YACrC,YAAY,OAAe,EAAE,SAAgC,IAAI;gBAC7D,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;YAChC,CAAC;SACJ;QACD,OAAO,cAAqB,CAAC;IACjC,CAAC;IAAA,CAAC;IAEF;;OAEG;IACH,MAAM,CAAC,IAAI,CAAwB,MAAc,EAAE,GAA6B,EAAE,MAA8B;QAC5G,IAAI,MAAM,IAAI,IAAI,EAAE;YAAE,MAAM,GAAG,IAAI,CAAC;SAAE;QACtC,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,CAAE,CAAC;QAChD,OAAO,QAAe,CAAC;IAC3B,CAAC;CACJ;AAtdD,oCAsdC;AAED,SAAS,aAAa;IAClB,OAAO,YAAmB,CAAC;AAC/B,CAAC;AAED;;GAEG;AACH,MAAa,QAAS,SAAQ,aAAa,EAAE;CAAI;AAAjD,4BAAiD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/factory.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/factory.d.ts deleted file mode 100644 index e472eb93..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/factory.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { Interface } from "../abi/index.js"; -import { BaseContract } from "./contract.js"; -import type { InterfaceAbi } from "../abi/index.js"; -import type { Addressable } from "../address/index.js"; -import type { ContractRunner } from "../providers/index.js"; -import type { BytesLike } from "../utils/index.js"; -import type { ContractInterface, ContractMethodArgs, ContractDeployTransaction } from "./types.js"; -import type { ContractTransactionResponse } from "./wrappers.js"; -/** - * A **ContractFactory** is used to deploy a Contract to the blockchain. - */ -export declare class ContractFactory = Array, I = BaseContract> { - /** - * The Contract Interface. - */ - readonly interface: Interface; - /** - * The Contract deployment bytecode. Often called the initcode. - */ - readonly bytecode: string; - /** - * The ContractRunner to deploy the Contract as. - */ - readonly runner: null | ContractRunner; - /** - * Create a new **ContractFactory** with %%abi%% and %%bytecode%%, - * optionally connected to %%runner%%. - * - * The %%bytecode%% may be the ``bytecode`` property within the - * standard Solidity JSON output. - */ - constructor(abi: Interface | InterfaceAbi, bytecode: BytesLike | { - object: string; - }, runner?: null | ContractRunner); - attach(target: string | Addressable): BaseContract & Omit; - /** - * Resolves to the transaction to deploy the contract, passing %%args%% - * into the constructor. - */ - getDeployTransaction(...args: ContractMethodArgs): Promise; - /** - * Resolves to the Contract deployed by passing %%args%% into the - * constructor. - * - * This will resolve to the Contract before it has been deployed to the - * network, so the [[BaseContract-waitForDeployment]] should be used before - * sending any transactions to it. - */ - deploy(...args: ContractMethodArgs): Promise>; - /** - * Return a new **ContractFactory** with the same ABI and bytecode, - * but connected to %%runner%%. - */ - connect(runner: null | ContractRunner): ContractFactory; - /** - * Create a new **ContractFactory** from the standard Solidity JSON output. - */ - static fromSolidity = Array, I = ContractInterface>(output: any, runner?: ContractRunner): ContractFactory; -} -//# sourceMappingURL=factory.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/factory.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/factory.d.ts.map deleted file mode 100644 index dc031ea9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/factory.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src.ts/contract/factory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAO5C,OAAO,EAAE,YAAY,EAA8B,MAAM,eAAe,CAAC;AAEzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AA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,CAAC,YAAY,CAAC,CAAC,SAAS,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,iBAAiB,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,cAAc,GAAG,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC;CAgB7I"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/factory.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/factory.js deleted file mode 100644 index cf67a034..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/factory.js +++ /dev/null @@ -1,116 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ContractFactory = void 0; -const index_js_1 = require("../abi/index.js"); -const index_js_2 = require("../address/index.js"); -const index_js_3 = require("../utils/index.js"); -const contract_js_1 = require("./contract.js"); -// A = Arguments to the constructor -// I = Interface of deployed contracts -/** - * A **ContractFactory** is used to deploy a Contract to the blockchain. - */ -class ContractFactory { - /** - * The Contract Interface. - */ - interface; - /** - * The Contract deployment bytecode. Often called the initcode. - */ - bytecode; - /** - * The ContractRunner to deploy the Contract as. - */ - runner; - /** - * Create a new **ContractFactory** with %%abi%% and %%bytecode%%, - * optionally connected to %%runner%%. - * - * The %%bytecode%% may be the ``bytecode`` property within the - * standard Solidity JSON output. - */ - constructor(abi, bytecode, runner) { - const iface = index_js_1.Interface.from(abi); - // Dereference Solidity bytecode objects and allow a missing `0x`-prefix - if (bytecode instanceof Uint8Array) { - bytecode = (0, index_js_3.hexlify)((0, index_js_3.getBytes)(bytecode)); - } - else { - if (typeof (bytecode) === "object") { - bytecode = bytecode.object; - } - if (!bytecode.startsWith("0x")) { - bytecode = "0x" + bytecode; - } - bytecode = (0, index_js_3.hexlify)((0, index_js_3.getBytes)(bytecode)); - } - (0, index_js_3.defineProperties)(this, { - bytecode, interface: iface, runner: (runner || null) - }); - } - attach(target) { - return new contract_js_1.BaseContract(target, this.interface, this.runner); - } - /** - * Resolves to the transaction to deploy the contract, passing %%args%% - * into the constructor. - */ - async getDeployTransaction(...args) { - let overrides = {}; - const fragment = this.interface.deploy; - if (fragment.inputs.length + 1 === args.length) { - overrides = await (0, contract_js_1.copyOverrides)(args.pop()); - } - if (fragment.inputs.length !== args.length) { - throw new Error("incorrect number of arguments to constructor"); - } - const resolvedArgs = await (0, contract_js_1.resolveArgs)(this.runner, fragment.inputs, args); - const data = (0, index_js_3.concat)([this.bytecode, this.interface.encodeDeploy(resolvedArgs)]); - return Object.assign({}, overrides, { data }); - } - /** - * Resolves to the Contract deployed by passing %%args%% into the - * constructor. - * - * This will resolve to the Contract before it has been deployed to the - * network, so the [[BaseContract-waitForDeployment]] should be used before - * sending any transactions to it. - */ - async deploy(...args) { - const tx = await this.getDeployTransaction(...args); - (0, index_js_3.assert)(this.runner && typeof (this.runner.sendTransaction) === "function", "factory runner does not support sending transactions", "UNSUPPORTED_OPERATION", { - operation: "sendTransaction" - }); - const sentTx = await this.runner.sendTransaction(tx); - const address = (0, index_js_2.getCreateAddress)(sentTx); - return new contract_js_1.BaseContract(address, this.interface, this.runner, sentTx); - } - /** - * Return a new **ContractFactory** with the same ABI and bytecode, - * but connected to %%runner%%. - */ - connect(runner) { - return new ContractFactory(this.interface, this.bytecode, runner); - } - /** - * Create a new **ContractFactory** from the standard Solidity JSON output. - */ - static fromSolidity(output, runner) { - (0, index_js_3.assertArgument)(output != null, "bad compiler output", "output", output); - if (typeof (output) === "string") { - output = JSON.parse(output); - } - const abi = output.abi; - let bytecode = ""; - if (output.bytecode) { - bytecode = output.bytecode; - } - else if (output.evm && output.evm.bytecode) { - bytecode = output.evm.bytecode; - } - return new this(abi, bytecode, runner); - } -} -exports.ContractFactory = ContractFactory; -//# sourceMappingURL=factory.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/factory.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/factory.js.map deleted file mode 100644 index 3af619f4..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/factory.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../src.ts/contract/factory.ts"],"names":[],"mappings":";;;AACA,8CAA4C;AAC5C,kDAAuD;AACvD,gDAG2B;AAE3B,+CAAyE;AAazE,mCAAmC;AACnC,sCAAsC;AAEtC;;GAEG;AACH,MAAa,eAAe;IAExB;;OAEG;IACM,SAAS,CAAa;IAE/B;;OAEG;IACM,QAAQ,CAAU;IAE3B;;OAEG;IACM,MAAM,CAAyB;IAExC;;;;;;OAMG;IACH,YAAY,GAA6B,EAAE,QAAwC,EAAE,MAA8B;QAC/G,MAAM,KAAK,GAAG,oBAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAElC,wEAAwE;QACxE,IAAI,QAAQ,YAAY,UAAU,EAAE;YAChC,QAAQ,GAAG,IAAA,kBAAO,EAAC,IAAA,mBAAQ,EAAC,QAAQ,CAAC,CAAC,CAAC;SAC1C;aAAM;YACH,IAAI,OAAM,CAAC,QAAQ,CAAC,KAAK,QAAQ,EAAE;gBAAE,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC;aAAE;YAClE,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;gBAAE,QAAQ,GAAG,IAAI,GAAG,QAAQ,CAAC;aAAE;YAC/D,QAAQ,GAAG,IAAA,kBAAO,EAAC,IAAA,mBAAQ,EAAC,QAAQ,CAAC,CAAC,CAAC;SAC1C;QAED,IAAA,2BAAgB,EAAkB,IAAI,EAAE;YACpC,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,MAAM,IAAI,IAAI,CAAC;SACvD,CAAC,CAAC;IACP,CAAC;IAED,MAAM,CAAC,MAA4B;QAC/B,OAAO,IAAU,0BAAa,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,EAA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,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;QACrD,MAAM,OAAO,GAAG,IAAA,2BAAgB,EAAC,MAAM,CAAC,CAAC;QACzC,OAAO,IAAU,0BAAa,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjF,CAAC;IAED;;;OAGG;IACH,OAAO,CAAC,MAA6B;QACjC,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACtE,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,YAAY,CAA2D,MAAW,EAAE,MAAuB;QAC9G,IAAA,yBAAc,EAAC,MAAM,IAAI,IAAI,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QAExE,IAAI,OAAM,CAAC,MAAM,CAAC,KAAK,QAAQ,EAAE;YAAE,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;SAAE;QAEjE,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;QAEvB,IAAI,QAAQ,GAAG,EAAE,CAAC;QAClB,IAAI,MAAM,CAAC,QAAQ,EAAE;YACjB,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;SAC9B;aAAM,IAAI,MAAM,CAAC,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE;YAC1C,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;SAClC;QAED,OAAO,IAAI,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC;CACJ;AAnHD,0CAmHC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/index.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/index.d.ts deleted file mode 100644 index b7f2c818..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * A **Contract** object is a meta-class (a class whose definition is - * defined at runtime), which communicates with a deployed smart contract - * on the blockchain and provides a simple JavaScript interface to call - * methods, send transaction, query historic logs and listen for its events. - * - * @_section: api/contract:Contracts [about-contracts] - */ -export { BaseContract, Contract } from "./contract.js"; -export { ContractFactory } from "./factory.js"; -export { ContractEventPayload, ContractUnknownEventPayload, ContractTransactionReceipt, ContractTransactionResponse, EventLog, UndecodedEventLog } from "./wrappers.js"; -export type { BaseContractMethod, ConstantContractMethod, PostfixOverrides, ContractEvent, ContractEventArgs, ContractEventName, ContractDeployTransaction, ContractInterface, ContractMethod, ContractMethodArgs, ContractTransaction, DeferredTopicFilter, Overrides, WrappedFallback } from "./types.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/index.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/index.d.ts.map deleted file mode 100644 index aad3d029..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/contract/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACH,YAAY,EAAE,QAAQ,EACzB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACH,eAAe,EAClB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACH,oBAAoB,EAAE,2BAA2B,EACjD,0BAA0B,EAAE,2BAA2B,EACvD,QAAQ,EAAE,iBAAiB,EAC9B,MAAM,eAAe,CAAC;AAEvB,YAAY,EACR,kBAAkB,EAAE,sBAAsB,EAC1C,gBAAgB,EAChB,aAAa,EAAE,iBAAiB,EAAE,iBAAiB,EACnD,yBAAyB,EACzB,iBAAiB,EAAE,cAAc,EAAE,kBAAkB,EAAE,mBAAmB,EAC1E,mBAAmB,EAAE,SAAS,EAC9B,eAAe,EAClB,MAAM,YAAY,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/index.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/index.js deleted file mode 100644 index 331b92fb..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/index.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.UndecodedEventLog = exports.EventLog = exports.ContractTransactionResponse = exports.ContractTransactionReceipt = exports.ContractUnknownEventPayload = exports.ContractEventPayload = exports.ContractFactory = exports.Contract = exports.BaseContract = void 0; -/** - * A **Contract** object is a meta-class (a class whose definition is - * defined at runtime), which communicates with a deployed smart contract - * on the blockchain and provides a simple JavaScript interface to call - * methods, send transaction, query historic logs and listen for its events. - * - * @_section: api/contract:Contracts [about-contracts] - */ -var contract_js_1 = require("./contract.js"); -Object.defineProperty(exports, "BaseContract", { enumerable: true, get: function () { return contract_js_1.BaseContract; } }); -Object.defineProperty(exports, "Contract", { enumerable: true, get: function () { return contract_js_1.Contract; } }); -var factory_js_1 = require("./factory.js"); -Object.defineProperty(exports, "ContractFactory", { enumerable: true, get: function () { return factory_js_1.ContractFactory; } }); -var wrappers_js_1 = require("./wrappers.js"); -Object.defineProperty(exports, "ContractEventPayload", { enumerable: true, get: function () { return wrappers_js_1.ContractEventPayload; } }); -Object.defineProperty(exports, "ContractUnknownEventPayload", { enumerable: true, get: function () { return wrappers_js_1.ContractUnknownEventPayload; } }); -Object.defineProperty(exports, "ContractTransactionReceipt", { enumerable: true, get: function () { return wrappers_js_1.ContractTransactionReceipt; } }); -Object.defineProperty(exports, "ContractTransactionResponse", { enumerable: true, get: function () { return wrappers_js_1.ContractTransactionResponse; } }); -Object.defineProperty(exports, "EventLog", { enumerable: true, get: function () { return wrappers_js_1.EventLog; } }); -Object.defineProperty(exports, "UndecodedEventLog", { enumerable: true, get: function () { return wrappers_js_1.UndecodedEventLog; } }); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/index.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/index.js.map deleted file mode 100644 index 3dc664a0..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/contract/index.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACH,6CAEuB;AADnB,2GAAA,YAAY,OAAA;AAAE,uGAAA,QAAQ,OAAA;AAG1B,2CAEsB;AADlB,6GAAA,eAAe,OAAA;AAGnB,6CAIuB;AAHnB,mHAAA,oBAAoB,OAAA;AAAE,0HAAA,2BAA2B,OAAA;AACjD,yHAAA,0BAA0B,OAAA;AAAE,0HAAA,2BAA2B,OAAA;AACvD,uGAAA,QAAQ,OAAA;AAAE,gHAAA,iBAAiB,OAAA"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/types.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/types.d.ts deleted file mode 100644 index e844463f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/types.d.ts +++ /dev/null @@ -1,193 +0,0 @@ -import type { EventFragment, FunctionFragment, Result, Typed } from "../abi/index.js"; -import type { TransactionRequest, PreparedTransactionRequest, TopicFilter } from "../providers/index.js"; -import type { ContractTransactionResponse } from "./wrappers.js"; -/** - * The name for an event used for subscribing to Contract events. - * - * **``string``** - An event by name. The event must be non-ambiguous. - * The parameters will be dereferenced when passed into the listener. - * - * [[ContractEvent]] - A filter from the ``contract.filters``, which will - * pass only the EventPayload as a single parameter, which includes a - * ``.signature`` property that can be used to further filter the event. - * - * [[TopicFilter]] - A filter defined using the standard Ethereum API - * which provides the specific topic hash or topic hashes to watch for along - * with any additional values to filter by. This will only pass a single - * parameter to the listener, the EventPayload which will include additional - * details to refine by, such as the event name and signature. - * - * [[DeferredTopicFilter]] - A filter created by calling a [[ContractEvent]] - * with parameters, which will create a filter for a specific event - * signature and dereference each parameter when calling the listener. - */ -export type ContractEventName = string | ContractEvent | TopicFilter | DeferredTopicFilter; -/** - * A Contract with no method constraints. - */ -export interface ContractInterface { - [name: string]: BaseContractMethod; -} -/** - * When creating a filter using the ``contract.filters``, this is returned. - */ -export interface DeferredTopicFilter { - getTopicFilter(): Promise; - fragment: EventFragment; -} -/** - * When populating a transaction this type is returned. - */ -export interface ContractTransaction extends PreparedTransactionRequest { - /** - * The target address. - */ - to: string; - /** - * The transaction data. - */ - data: string; - /** - * The from address, if any. - */ - from?: string; -} -/** - * A deployment transaction for a contract. - */ -export interface ContractDeployTransaction extends Omit { -} -/** - * The overrides for a contract transaction. - */ -export interface Overrides extends Omit { -} -/** - * Arguments to a Contract method can always include an additional and - * optional overrides parameter. - * - * @_ignore: - */ -export type PostfixOverrides> = A | [...A, Overrides]; -/** - * Arguments to a Contract method can always include an additional and - * optional overrides parameter, and each parameter can optionally be - * [[Typed]]. - * - * @_ignore: - */ -export type ContractMethodArgs> = PostfixOverrides<{ - [I in keyof A]-?: A[I] | Typed; -}>; -/** - * A Contract method can be called directly, or used in various ways. - */ -export interface BaseContractMethod = Array, R = any, D extends R | ContractTransactionResponse = R | ContractTransactionResponse> { - (...args: ContractMethodArgs): Promise; - /** - * The name of the Contract method. - */ - name: string; - /** - * The fragment of the Contract method. This will throw on ambiguous - * method names. - */ - fragment: FunctionFragment; - /** - * Returns the fragment constrained by %%args%%. This can be used to - * resolve ambiguous method names. - */ - getFragment(...args: ContractMethodArgs): FunctionFragment; - /** - * Returns a populated transaction that can be used to perform the - * contract method with %%args%%. - */ - populateTransaction(...args: ContractMethodArgs): Promise; - /** - * Call the contract method with %%args%% and return the value. - * - * If the return value is a single type, it will be dereferenced and - * returned directly, otherwise the full Result will be returned. - */ - staticCall(...args: ContractMethodArgs): Promise; - /** - * Send a transaction for the contract method with %%args%%. - */ - send(...args: ContractMethodArgs): Promise; - /** - * Estimate the gas to send the contract method with %%args%%. - */ - estimateGas(...args: ContractMethodArgs): Promise; - /** - * Call the contract method with %%args%% and return the Result - * without any dereferencing. - */ - staticCallResult(...args: ContractMethodArgs): Promise; -} -/** - * A contract method on a Contract. - */ -export interface ContractMethod = Array, R = any, D extends R | ContractTransactionResponse = R | ContractTransactionResponse> extends BaseContractMethod { -} -/** - * A pure of view method on a Contract. - */ -export interface ConstantContractMethod, R = any> extends ContractMethod { -} -/** - * Each argument of an event is nullable (to indicate matching //any//. - * - * @_ignore: - */ -export type ContractEventArgs> = { - [I in keyof A]?: A[I] | Typed | null; -}; -export interface ContractEvent = Array> { - (...args: ContractEventArgs): DeferredTopicFilter; - /** - * The name of the Contract event. - */ - name: string; - /** - * The fragment of the Contract event. This will throw on ambiguous - * method names. - */ - fragment: EventFragment; - /** - * Returns the fragment constrained by %%args%%. This can be used to - * resolve ambiguous event names. - */ - getFragment(...args: ContractEventArgs): EventFragment; -} -/** - * A Fallback or Receive function on a Contract. - */ -export interface WrappedFallback { - (overrides?: Omit): Promise; - /** - * Returns a populated transaction that can be used to perform the - * fallback method. - * - * For non-receive fallback, ``data`` may be overridden. - */ - populateTransaction(overrides?: Omit): Promise; - /** - * Call the contract fallback and return the result. - * - * For non-receive fallback, ``data`` may be overridden. - */ - staticCall(overrides?: Omit): Promise; - /** - * Send a transaction to the contract fallback. - * - * For non-receive fallback, ``data`` may be overridden. - */ - send(overrides?: Omit): Promise; - /** - * Estimate the gas to send a transaction to the contract fallback. - * - * For non-receive fallback, ``data`` may be overridden. - */ - estimateGas(overrides?: Omit): Promise; -} -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/types.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/types.d.ts.map deleted file mode 100644 index 918f46cb..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src.ts/contract/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,aAAa,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,EACjD,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACR,kBAAkB,EAAE,0BAA0B,EAAE,WAAW,EAC9D,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAGjE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,aAAa,GAAG,WAAW,GAAG,mBAAmB,CAAC;AAE3F;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAC9B,CAAE,IAAI,EAAE,MAAM,GAAI,kBAAkB,CAAC;CACxC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;IACvC,QAAQ,EAAE,aAAa,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,0BAA0B;IACnE;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,yBAA0B,SAAQ,IAAI,CAAC,mBAAmB,EAAE,IAAI,CAAC;CAAI;AAEtF;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,kBAAkB,EAAE,IAAI,GAAG,MAAM,CAAC;CAAI;AAG9E;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAE,GAAG,CAAC,EAAE,SAAS,C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,SAAS,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAE9F;;;;OAIG;IACH,UAAU,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAExE;;;;OAIG;IACH,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAEvF;;;;OAIG;IACH,WAAW,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC5E"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/types.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/types.js deleted file mode 100644 index c1325264..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/types.js +++ /dev/null @@ -1,6 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -; -; -; -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/types.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/types.js.map deleted file mode 100644 index 8f8455d7..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src.ts/contract/types.ts"],"names":[],"mappings":";;AAqCC,CAAC;AAsC4E,CAAC;AA4H9E,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/wrappers.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/wrappers.d.ts deleted file mode 100644 index 90f9e1ea..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/wrappers.d.ts +++ /dev/null @@ -1,143 +0,0 @@ -import { Block, Log, TransactionReceipt, TransactionResponse } from "../providers/provider.js"; -import { EventPayload } from "../utils/index.js"; -import type { EventFragment, Interface, Result } from "../abi/index.js"; -import type { Listener } from "../utils/index.js"; -import type { Provider } from "../providers/index.js"; -import type { BaseContract } from "./contract.js"; -import type { ContractEventName } from "./types.js"; -/** - * An **EventLog** contains additional properties parsed from the [[Log]]. - */ -export declare class EventLog extends Log { - /** - * The Contract Interface. - */ - readonly interface: Interface; - /** - * The matching event. - */ - readonly fragment: EventFragment; - /** - * The parsed arguments passed to the event by ``emit``. - */ - readonly args: Result; - /** - * @_ignore: - */ - constructor(log: Log, iface: Interface, fragment: EventFragment); - /** - * The name of the event. - */ - get eventName(): string; - /** - * The signature of the event. - */ - get eventSignature(): string; -} -/** - * An **EventLog** contains additional properties parsed from the [[Log]]. - */ -export declare class UndecodedEventLog extends Log { - /** - * The error encounted when trying to decode the log. - */ - readonly error: Error; - /** - * @_ignore: - */ - constructor(log: Log, error: Error); -} -/** - * A **ContractTransactionReceipt** includes the parsed logs from a - * [[TransactionReceipt]]. - */ -export declare class ContractTransactionReceipt extends TransactionReceipt { - #private; - /** - * @_ignore: - */ - constructor(iface: Interface, provider: Provider, tx: TransactionReceipt); - /** - * The parsed logs for any [[Log]] which has a matching event in the - * Contract ABI. - */ - get logs(): Array; -} -/** - * A **ContractTransactionResponse** will return a - * [[ContractTransactionReceipt]] when waited on. - */ -export declare class ContractTransactionResponse extends TransactionResponse { - #private; - /** - * @_ignore: - */ - constructor(iface: Interface, provider: Provider, tx: TransactionResponse); - /** - * Resolves once this transaction has been mined and has - * %%confirms%% blocks including it (default: ``1``) with an - * optional %%timeout%%. - * - * This can resolve to ``null`` only if %%confirms%% is ``0`` - * and the transaction has not been mined, otherwise this will - * wait until enough confirmations have completed. - */ - wait(confirms?: number, timeout?: number): Promise; -} -/** - * A **ContractUnknownEventPayload** is included as the last parameter to - * Contract Events when the event does not match any events in the ABI. - */ -export declare class ContractUnknownEventPayload extends EventPayload { - /** - * The log with no matching events. - */ - readonly log: Log; - /** - * @_event: - */ - constructor(contract: BaseContract, listener: null | Listener, filter: ContractEventName, log: Log); - /** - * Resolves to the block the event occured in. - */ - getBlock(): Promise; - /** - * Resolves to the transaction the event occured in. - */ - getTransaction(): Promise; - /** - * Resolves to the transaction receipt the event occured in. - */ - getTransactionReceipt(): Promise; -} -/** - * A **ContractEventPayload** is included as the last parameter to - * Contract Events when the event is known. - */ -export declare class ContractEventPayload extends ContractUnknownEventPayload { - /** - * The matching event. - */ - readonly fragment: EventFragment; - /** - * The log, with parsed properties. - */ - readonly log: EventLog; - /** - * The parsed arguments passed to the event by ``emit``. - */ - readonly args: Result; - /** - * @_ignore: - */ - constructor(contract: BaseContract, listener: null | Listener, filter: ContractEventName, fragment: EventFragment, _log: Log); - /** - * The event name. - */ - get eventName(): string; - /** - * The event signature. - */ - get eventSignature(): string; -} -//# sourceMappingURL=wrappers.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/wrappers.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/wrappers.d.ts.map deleted file mode 100644 index d17e816c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/wrappers.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wrappers.d.ts","sourceRoot":"","sources":["../../src.ts/contract/wrappers.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,EAAE,GAAG,EAAE,kBAAkB,EAAE,mBAAmB,EACtD,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAoB,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AA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IAAI,GAAG,0BAA0B,CAAC;CAK9F;AAED;;;GAGG;AACH,qBAAc,2BAA4B,SAAQ,YAAY,CAAC,iBAAiB,CAAC;IAC7E;;OAEG;IACH,QAAQ,CAAC,GAAG,EAAG,GAAG,CAAC;IAEnB;;OAEG;gBACS,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,GAAG,QAAQ,EAAE,MAAM,EAAE,iBAAiB,EAAE,GAAG,EAAE,GAAG;IAKlG;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,KAAK,CAAC;IAIhC;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAIpD;;OAEG;IACG,qBAAqB,IAAI,OAAO,CAAC,kBAAkB,CAAC;CAG7D;AAED;;;GAGG;AACH,qBAAa,oBAAqB,SAAQ,2BAA2B;IAEjE;;OAEG;IACH,SAAiB,QAAQ,EAAE,aAAa,CAAC;IAEzC;;OAEG;IACH,SAAiB,GAAG,EAAE,QAAQ,CAAC;IAE/B;;OAEG;IACH,SAAiB,IAAI,EAAE,MAAM,CAAC;IAE9B;;OAEG;gBACS,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,GAAG,QAAQ,EAAE,MAAM,EAAE,iBAAiB,EAAE,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,GAAG;IAM5H;;OAEG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED;;OAEG;IACH,IAAI,cAAc,IAAI,MAAM,CAE3B;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/wrappers.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/wrappers.js deleted file mode 100644 index 7292050b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/wrappers.js +++ /dev/null @@ -1,186 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ContractEventPayload = exports.ContractUnknownEventPayload = exports.ContractTransactionResponse = exports.ContractTransactionReceipt = exports.UndecodedEventLog = exports.EventLog = void 0; -// import from provider.ts instead of index.ts to prevent circular dep -// from EtherscanProvider -const provider_js_1 = require("../providers/provider.js"); -const index_js_1 = require("../utils/index.js"); -/** - * An **EventLog** contains additional properties parsed from the [[Log]]. - */ -class EventLog extends provider_js_1.Log { - /** - * The Contract Interface. - */ - interface; - /** - * The matching event. - */ - fragment; - /** - * The parsed arguments passed to the event by ``emit``. - */ - args; - /** - * @_ignore: - */ - constructor(log, iface, fragment) { - super(log, log.provider); - const args = iface.decodeEventLog(fragment, log.data, log.topics); - (0, index_js_1.defineProperties)(this, { args, fragment, interface: iface }); - } - /** - * The name of the event. - */ - get eventName() { return this.fragment.name; } - /** - * The signature of the event. - */ - get eventSignature() { return this.fragment.format(); } -} -exports.EventLog = EventLog; -/** - * An **EventLog** contains additional properties parsed from the [[Log]]. - */ -class UndecodedEventLog extends provider_js_1.Log { - /** - * The error encounted when trying to decode the log. - */ - error; - /** - * @_ignore: - */ - constructor(log, error) { - super(log, log.provider); - (0, index_js_1.defineProperties)(this, { error }); - } -} -exports.UndecodedEventLog = UndecodedEventLog; -/** - * A **ContractTransactionReceipt** includes the parsed logs from a - * [[TransactionReceipt]]. - */ -class ContractTransactionReceipt extends provider_js_1.TransactionReceipt { - #iface; - /** - * @_ignore: - */ - constructor(iface, provider, tx) { - super(tx, provider); - this.#iface = iface; - } - /** - * The parsed logs for any [[Log]] which has a matching event in the - * Contract ABI. - */ - get logs() { - return super.logs.map((log) => { - const fragment = log.topics.length ? this.#iface.getEvent(log.topics[0]) : null; - if (fragment) { - try { - return new EventLog(log, this.#iface, fragment); - } - catch (error) { - return new UndecodedEventLog(log, error); - } - } - return log; - }); - } -} -exports.ContractTransactionReceipt = ContractTransactionReceipt; -/** - * A **ContractTransactionResponse** will return a - * [[ContractTransactionReceipt]] when waited on. - */ -class ContractTransactionResponse extends provider_js_1.TransactionResponse { - #iface; - /** - * @_ignore: - */ - constructor(iface, provider, tx) { - super(tx, provider); - this.#iface = iface; - } - /** - * Resolves once this transaction has been mined and has - * %%confirms%% blocks including it (default: ``1``) with an - * optional %%timeout%%. - * - * This can resolve to ``null`` only if %%confirms%% is ``0`` - * and the transaction has not been mined, otherwise this will - * wait until enough confirmations have completed. - */ - async wait(confirms, timeout) { - const receipt = await super.wait(confirms, timeout); - if (receipt == null) { - return null; - } - return new ContractTransactionReceipt(this.#iface, this.provider, receipt); - } -} -exports.ContractTransactionResponse = ContractTransactionResponse; -/** - * A **ContractUnknownEventPayload** is included as the last parameter to - * Contract Events when the event does not match any events in the ABI. - */ -class ContractUnknownEventPayload extends index_js_1.EventPayload { - /** - * The log with no matching events. - */ - log; - /** - * @_event: - */ - constructor(contract, listener, filter, log) { - super(contract, listener, filter); - (0, index_js_1.defineProperties)(this, { log }); - } - /** - * Resolves to the block the event occured in. - */ - async getBlock() { - return await this.log.getBlock(); - } - /** - * Resolves to the transaction the event occured in. - */ - async getTransaction() { - return await this.log.getTransaction(); - } - /** - * Resolves to the transaction receipt the event occured in. - */ - async getTransactionReceipt() { - return await this.log.getTransactionReceipt(); - } -} -exports.ContractUnknownEventPayload = ContractUnknownEventPayload; -/** - * A **ContractEventPayload** is included as the last parameter to - * Contract Events when the event is known. - */ -class ContractEventPayload extends ContractUnknownEventPayload { - /** - * @_ignore: - */ - constructor(contract, listener, filter, fragment, _log) { - super(contract, listener, filter, new EventLog(_log, contract.interface, fragment)); - const args = contract.interface.decodeEventLog(fragment, this.log.data, this.log.topics); - (0, index_js_1.defineProperties)(this, { args, fragment }); - } - /** - * The event name. - */ - get eventName() { - return this.fragment.name; - } - /** - * The event signature. - */ - get eventSignature() { - return this.fragment.format(); - } -} -exports.ContractEventPayload = ContractEventPayload; -//# sourceMappingURL=wrappers.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/wrappers.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/wrappers.js.map deleted file mode 100644 index bb65d40a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/contract/wrappers.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wrappers.js","sourceRoot":"","sources":["../../src.ts/contract/wrappers.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,yBAAyB;AACzB,0DAEkC;AAClC,gDAAmE;AAWnE;;GAEG;AACH,MAAa,QAAS,SAAQ,iBAAG;IAC7B;;OAEG;IACM,SAAS,CAAa;IAE/B;;OAEG;IACM,QAAQ,CAAiB;IAElC;;OAEG;IACM,IAAI,CAAU;IAEvB;;OAEG;IACH,YAAY,GAAQ,EAAE,KAAgB,EAAE,QAAuB;QAC3D,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;QACzB,MAAM,IAAI,GAAG,KAAK,CAAC,cAAc,CAAC,QAAQ,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;QAClE,IAAA,2BAAgB,EAAW,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED;;OAEG;IACH,IAAI,SAAS,KAAa,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IAEtD;;OAEG;IACH,IAAI,cAAc,KAAa,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;CAClE;AAlCD,4BAkCC;AAED;;GAEG;AACH,MAAa,iBAAkB,SAAQ,iBAAG;IAEtC;;OAEG;IACM,KAAK,CAAS;IAEvB;;OAEG;IACH,YAAY,GAAQ,EAAE,KAAY;QAC9B,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;QACzB,IAAA,2BAAgB,EAAoB,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACzD,CAAC;CACJ;AAdD,8CAcC;AAED;;;GAGG;AACH,MAAa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QACzF,IAAA,2BAAgB,EAAuB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;OAEG;IACH,IAAI,SAAS;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,IAAI,cAAc;QACd,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;IAClC,CAAC;CACJ;AAvCD,oDAuCC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/crypto-browser.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/crypto-browser.d.ts deleted file mode 100644 index ba0bbf19..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/crypto-browser.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -declare global { - interface Window { - } - const window: Window; - const self: Window; -} -export interface CryptoHasher { - update(data: Uint8Array): CryptoHasher; - digest(): Uint8Array; -} -export declare function createHash(algo: string): CryptoHasher; -export declare function createHmac(_algo: string, key: Uint8Array): CryptoHasher; -export declare function pbkdf2Sync(password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, _algo: "sha256" | "sha512"): Uint8Array; -export declare function randomBytes(length: number): Uint8Array; -//# sourceMappingURL=crypto-browser.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/crypto-browser.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/crypto-browser.d.ts.map deleted file mode 100644 index b6950c78..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/crypto-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto-browser.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/crypto-browser.ts"],"names":[],"mappings":"AAUA,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;KAAI;IAEpB,MAAM,MAAM,EAAE,MAAM,CAAC;IACrB,MAAM,IAAI,EAAE,MAAM,CAAC;CACtB;AAcD,MAAM,WAAW,YAAY;IACzB,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,CAAC;IACvC,MAAM,IAAI,UAAU,CAAC;CACxB;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAMrD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,GAAG,YAAY,CAIvE;AAED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAI7I;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAStD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/crypto-browser.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/crypto-browser.js deleted file mode 100644 index 69e20e6c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/crypto-browser.js +++ /dev/null @@ -1,55 +0,0 @@ -"use strict"; -/* Browser Crypto Shims */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.randomBytes = exports.pbkdf2Sync = exports.createHmac = exports.createHash = void 0; -const hmac_1 = require("@noble/hashes/hmac"); -const pbkdf2_1 = require("@noble/hashes/pbkdf2"); -const sha256_1 = require("@noble/hashes/sha256"); -const sha512_1 = require("@noble/hashes/sha512"); -const index_js_1 = require("../utils/index.js"); -function getGlobal() { - if (typeof self !== 'undefined') { - return self; - } - if (typeof window !== 'undefined') { - return window; - } - if (typeof global !== 'undefined') { - return global; - } - throw new Error('unable to locate global object'); -} -; -const anyGlobal = getGlobal(); -const crypto = anyGlobal.crypto || anyGlobal.msCrypto; -function createHash(algo) { - switch (algo) { - case "sha256": return sha256_1.sha256.create(); - case "sha512": return sha512_1.sha512.create(); - } - (0, index_js_1.assertArgument)(false, "invalid hashing algorithm name", "algorithm", algo); -} -exports.createHash = createHash; -function createHmac(_algo, key) { - const algo = ({ sha256: sha256_1.sha256, sha512: sha512_1.sha512 }[_algo]); - (0, index_js_1.assertArgument)(algo != null, "invalid hmac algorithm", "algorithm", _algo); - return hmac_1.hmac.create(algo, key); -} -exports.createHmac = createHmac; -function pbkdf2Sync(password, salt, iterations, keylen, _algo) { - const algo = ({ sha256: sha256_1.sha256, sha512: sha512_1.sha512 }[_algo]); - (0, index_js_1.assertArgument)(algo != null, "invalid pbkdf2 algorithm", "algorithm", _algo); - return (0, pbkdf2_1.pbkdf2)(algo, password, salt, { c: iterations, dkLen: keylen }); -} -exports.pbkdf2Sync = pbkdf2Sync; -function randomBytes(length) { - (0, index_js_1.assert)(crypto != null, "platform does not support secure random numbers", "UNSUPPORTED_OPERATION", { - operation: "randomBytes" - }); - (0, index_js_1.assertArgument)(Number.isInteger(length) && length > 0 && length <= 1024, "invalid length", "length", length); - const result = new Uint8Array(length); - crypto.getRandomValues(result); - return result; -} -exports.randomBytes = randomBytes; -//# sourceMappingURL=crypto-browser.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/crypto-browser.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/crypto-browser.js.map deleted file mode 100644 index 1760c11d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/crypto-browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto-browser.js","sourceRoot":"","sources":["../../src.ts/crypto/crypto-browser.ts"],"names":[],"mappings":";AAAA,0BAA0B;;;AAE1B,6CAA0C;AAC1C,iDAA8C;AAC9C,iDAA8C;AAC9C,iDAA8C;AAE9C,gDAA2D;AAW3D,SAAS,SAAS;IAChB,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;QAAE,OAAO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,IAAI,IAAI,EAAE,0BAA0B,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;IAC7E,OAAO,IAAA,eAAM,EAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;AAC1E,CAAC;AAJD,gCAIC;AAED,SAAgB,WAAW,CAAC,MAAc;IACtC,IAAA,iBAAM,EAAC,MAAM,IAAI,IAAI,EAAE,iDAAiD,EAAE,uBAAuB,EAAE;QAC/F,SAAS,EAAE,aAAa;KAAE,CAAC,CAAC;IAEhC,IAAA,yBAAc,EAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,IAAI,MAAM,IAAI,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAE7G,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;IACtC,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IAC/B,OAAO,MAAM,CAAC;AAClB,CAAC;AATD,kCASC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/crypto.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/crypto.d.ts deleted file mode 100644 index e9c555de..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/crypto.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { createHash, createHmac, pbkdf2Sync, randomBytes } from "crypto"; -//# sourceMappingURL=crypto.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/crypto.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/crypto.d.ts.map deleted file mode 100644 index c417228d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/crypto.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/crypto.ts"],"names":[],"mappings":"AACA,OAAO,EACH,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAClD,MAAM,QAAQ,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/crypto.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/crypto.js deleted file mode 100644 index 31e54d52..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/crypto.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.randomBytes = exports.pbkdf2Sync = exports.createHmac = exports.createHash = void 0; -var crypto_1 = require("crypto"); -Object.defineProperty(exports, "createHash", { enumerable: true, get: function () { return crypto_1.createHash; } }); -Object.defineProperty(exports, "createHmac", { enumerable: true, get: function () { return crypto_1.createHmac; } }); -Object.defineProperty(exports, "pbkdf2Sync", { enumerable: true, get: function () { return crypto_1.pbkdf2Sync; } }); -Object.defineProperty(exports, "randomBytes", { enumerable: true, get: function () { return crypto_1.randomBytes; } }); -//# sourceMappingURL=crypto.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/crypto.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/crypto.js.map deleted file mode 100644 index 5978cca6..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/crypto.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../src.ts/crypto/crypto.ts"],"names":[],"mappings":";;;AACA,iCAEgB;AADZ,oGAAA,UAAU,OAAA;AAAE,oGAAA,UAAU,OAAA;AAAE,oGAAA,UAAU,OAAA;AAAE,qGAAA,WAAW,OAAA"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/hmac.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/hmac.d.ts deleted file mode 100644 index 4c5e3227..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/hmac.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { BytesLike } from "../utils/index.js"; -/** - * Return the HMAC for %%data%% using the %%key%% key with the underlying - * %%algo%% used for compression. - * - * @example: - * key = id("some-secret") - * - * // Compute the HMAC - * computeHmac("sha256", key, "0x1337") - * //_result: - * - * // To compute the HMAC of UTF-8 data, the data must be - * // converted to UTF-8 bytes - * computeHmac("sha256", key, toUtf8Bytes("Hello World")) - * //_result: - * - */ -export declare function computeHmac(algorithm: "sha256" | "sha512", _key: BytesLike, _data: BytesLike): string; -export declare namespace computeHmac { - var _: (algorithm: "sha256" | "sha512", key: Uint8Array, data: Uint8Array) => BytesLike; - var lock: () => void; - var register: (func: (algorithm: "sha256" | "sha512", key: Uint8Array, data: Uint8Array) => BytesLike) => void; -} -//# sourceMappingURL=hmac.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/hmac.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/hmac.d.ts.map deleted file mode 100644 index aa56a49f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/hmac.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hmac.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/hmac.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAWnD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,QAAQ,GAAG,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,GAAG,MAAM,CAIrG;yBAJe,WAAW"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/hmac.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/hmac.js deleted file mode 100644 index a13ef914..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/hmac.js +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.computeHmac = void 0; -/** - * An **HMAC** enables verification that a given key was used - * to authenticate a payload. - * - * See: [[link-wiki-hmac]] - * - * @_subsection: api/crypto:HMAC [about-hmac] - */ -const crypto_js_1 = require("./crypto.js"); -const index_js_1 = require("../utils/index.js"); -let locked = false; -const _computeHmac = function (algorithm, key, data) { - return (0, crypto_js_1.createHmac)(algorithm, key).update(data).digest(); -}; -let __computeHmac = _computeHmac; -/** - * Return the HMAC for %%data%% using the %%key%% key with the underlying - * %%algo%% used for compression. - * - * @example: - * key = id("some-secret") - * - * // Compute the HMAC - * computeHmac("sha256", key, "0x1337") - * //_result: - * - * // To compute the HMAC of UTF-8 data, the data must be - * // converted to UTF-8 bytes - * computeHmac("sha256", key, toUtf8Bytes("Hello World")) - * //_result: - * - */ -function computeHmac(algorithm, _key, _data) { - const key = (0, index_js_1.getBytes)(_key, "key"); - const data = (0, index_js_1.getBytes)(_data, "data"); - return (0, index_js_1.hexlify)(__computeHmac(algorithm, key, data)); -} -exports.computeHmac = computeHmac; -computeHmac._ = _computeHmac; -computeHmac.lock = function () { locked = true; }; -computeHmac.register = function (func) { - if (locked) { - throw new Error("computeHmac is locked"); - } - __computeHmac = func; -}; -Object.freeze(computeHmac); -//# sourceMappingURL=hmac.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/hmac.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/hmac.js.map deleted file mode 100644 index f129b30f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/hmac.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hmac.js","sourceRoot":"","sources":["../../src.ts/crypto/hmac.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACH,2CAAyC;AACzC,gDAAsD;AAKtD,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,MAAM,YAAY,GAAG,UAAS,SAA8B,EAAE,GAAe,EAAE,IAAgB;IAC3F,OAAO,IAAA,sBAAU,EAAC,SAAS,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;AAC5D,CAAC,CAAA;AAED,IAAI,aAAa,GAAG,YAAY,CAAC;AAEjC;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,WAAW,CAAC,SAA8B,EAAE,IAAe,EAAE,KAAgB;IACzF,MAAM,GAAG,GAAG,IAAA,mBAAQ,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAClC,MAAM,IAAI,GAAG,IAAA,mBAAQ,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,IAAA,kBAAO,EAAC,aAAa,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;AACxD,CAAC;AAJD,kCAIC;AACD,WAAW,CAAC,CAAC,GAAG,YAAY,CAAC;AAC7B,WAAW,CAAC,IAAI,GAAI,cAAa,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;AACjD,WAAW,CAAC,QAAQ,GAAG,UAAS,IAAsF;IAClH,IAAI,MAAM,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;KAAE;IACzD,aAAa,GAAG,IAAI,CAAC;AACzB,CAAC,CAAA;AACD,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/index.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/index.d.ts deleted file mode 100644 index 8d6bc562..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/index.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * A fundamental building block of Ethereum is the underlying - * cryptographic primitives. - * - * @_section: api/crypto:Cryptographic Functions [about-crypto] - */ -import { computeHmac } from "./hmac.js"; -import { keccak256 } from "./keccak.js"; -import { ripemd160 } from "./ripemd160.js"; -import { pbkdf2 } from "./pbkdf2.js"; -import { randomBytes } from "./random.js"; -import { scrypt, scryptSync } from "./scrypt.js"; -import { sha256, sha512 } from "./sha2.js"; -export { computeHmac, randomBytes, keccak256, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync }; -export { SigningKey } from "./signing-key.js"; -export { Signature } from "./signature.js"; -/** - * Once called, prevents any future change to the underlying cryptographic - * primitives using the ``.register`` feature for hooks. - */ -declare function lock(): void; -export { lock }; -export type { ProgressCallback } from "./scrypt.js"; -export type { SignatureLike } from "./signature.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/index.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/index.d.ts.map deleted file mode 100644 index 4f8d3c46..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EACH,WAAW,EAEX,WAAW,EAEX,SAAS,EACT,SAAS,EACT,MAAM,EAAE,MAAM,EAEd,MAAM,EACN,MAAM,EAAE,UAAU,EACrB,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C;;;GAGG;AACH,iBAAS,IAAI,IAAI,IAAI,CAWpB;AAED,OAAO,EAAE,IAAI,EAAE,CAAC;AAKhB,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/index.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/index.js deleted file mode 100644 index 39a4b356..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/index.js +++ /dev/null @@ -1,49 +0,0 @@ -"use strict"; -/** - * A fundamental building block of Ethereum is the underlying - * cryptographic primitives. - * - * @_section: api/crypto:Cryptographic Functions [about-crypto] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.lock = exports.Signature = exports.SigningKey = exports.scryptSync = exports.scrypt = exports.pbkdf2 = exports.sha512 = exports.sha256 = exports.ripemd160 = exports.keccak256 = exports.randomBytes = exports.computeHmac = void 0; -null; -// We import all these so we can export lock() -const hmac_js_1 = require("./hmac.js"); -Object.defineProperty(exports, "computeHmac", { enumerable: true, get: function () { return hmac_js_1.computeHmac; } }); -const keccak_js_1 = require("./keccak.js"); -Object.defineProperty(exports, "keccak256", { enumerable: true, get: function () { return keccak_js_1.keccak256; } }); -const ripemd160_js_1 = require("./ripemd160.js"); -Object.defineProperty(exports, "ripemd160", { enumerable: true, get: function () { return ripemd160_js_1.ripemd160; } }); -const pbkdf2_js_1 = require("./pbkdf2.js"); -Object.defineProperty(exports, "pbkdf2", { enumerable: true, get: function () { return pbkdf2_js_1.pbkdf2; } }); -const random_js_1 = require("./random.js"); -Object.defineProperty(exports, "randomBytes", { enumerable: true, get: function () { return random_js_1.randomBytes; } }); -const scrypt_js_1 = require("./scrypt.js"); -Object.defineProperty(exports, "scrypt", { enumerable: true, get: function () { return scrypt_js_1.scrypt; } }); -Object.defineProperty(exports, "scryptSync", { enumerable: true, get: function () { return scrypt_js_1.scryptSync; } }); -const sha2_js_1 = require("./sha2.js"); -Object.defineProperty(exports, "sha256", { enumerable: true, get: function () { return sha2_js_1.sha256; } }); -Object.defineProperty(exports, "sha512", { enumerable: true, get: function () { return sha2_js_1.sha512; } }); -var signing_key_js_1 = require("./signing-key.js"); -Object.defineProperty(exports, "SigningKey", { enumerable: true, get: function () { return signing_key_js_1.SigningKey; } }); -var signature_js_1 = require("./signature.js"); -Object.defineProperty(exports, "Signature", { enumerable: true, get: function () { return signature_js_1.Signature; } }); -/** - * Once called, prevents any future change to the underlying cryptographic - * primitives using the ``.register`` feature for hooks. - */ -function lock() { - hmac_js_1.computeHmac.lock(); - keccak_js_1.keccak256.lock(); - pbkdf2_js_1.pbkdf2.lock(); - random_js_1.randomBytes.lock(); - ripemd160_js_1.ripemd160.lock(); - scrypt_js_1.scrypt.lock(); - scrypt_js_1.scryptSync.lock(); - sha2_js_1.sha256.lock(); - sha2_js_1.sha512.lock(); - random_js_1.randomBytes.lock(); -} -exports.lock = lock; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/index.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/index.js.map deleted file mode 100644 index 4fbf8d92..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/crypto/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,IAAI,CAAA;AAEJ,8CAA8C;AAC9C,uCAAwC;AASpC,4FATK,qBAAW,OASL;AARf,2CAAwC;AAYpC,0FAZK,qBAAS,OAYL;AAXb,iDAA2C;AAYvC,0FAZK,wBAAS,OAYL;AAXb,2CAAqC;AAcjC,uFAdK,kBAAM,OAcL;AAbV,2CAA0C;AAOtC,4FAPK,uBAAW,OAOL;AANf,2CAAiD;AAa7C,uFAbK,kBAAM,OAaL;AAAE,2FAbK,sBAAU,OAaL;AAZtB,uCAA2C;AASvC,uFATK,gBAAM,OASL;AAAE,uFATK,gBAAM,OASL;AAMlB,mDAA8C;AAArC,4GAAA,UAAU,OAAA;AACnB,+CAA2C;AAAlC,yGAAA,SAAS,OAAA;AAElB;;;GAGG;AACH,SAAS,IAAI;IACT,qBAAW,CAAC,IAAI,EAAE,CAAC;IACnB,qBAAS,CAAC,IAAI,EAAE,CAAC;IACjB,kBAAM,CAAC,IAAI,EAAE,CAAC;IACd,uBAAW,CAAC,IAAI,EAAE,CAAC;IACnB,wBAAS,CAAC,IAAI,EAAE,CAAC;IACjB,kBAAM,CAAC,IAAI,EAAE,CAAC;IACd,sBAAU,CAAC,IAAI,EAAE,CAAC;IAClB,gBAAM,CAAC,IAAI,EAAE,CAAC;IACd,gBAAM,CAAC,IAAI,EAAE,CAAC;IACd,uBAAW,CAAC,IAAI,EAAE,CAAC;AACvB,CAAC;AAEQ,oBAAI"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/keccak.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/keccak.d.ts deleted file mode 100644 index 533f46dc..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/keccak.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Cryptographic hashing functions - * - * @_subsection: api/crypto:Hash Functions [about-crypto-hashing] - */ -import type { BytesLike } from "../utils/index.js"; -/** - * Compute the cryptographic KECCAK256 hash of %%data%%. - * - * The %%data%% **must** be a data representation, to compute the - * hash of UTF-8 data use the [[id]] function. - * - * @returns DataHexstring - * @example: - * keccak256("0x") - * //_result: - * - * keccak256("0x1337") - * //_result: - * - * keccak256(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - * // Strings are assumed to be DataHexString, otherwise it will - * // throw. To hash UTF-8 data, see the note above. - * keccak256("Hello World") - * //_error: - */ -export declare function keccak256(_data: BytesLike): string; -export declare namespace keccak256 { - var _: (data: Uint8Array) => Uint8Array; - var lock: () => void; - var register: (func: (data: Uint8Array) => BytesLike) => void; -} -//# sourceMappingURL=keccak.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/keccak.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/keccak.d.ts.map deleted file mode 100644 index a0064495..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/keccak.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"keccak.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/keccak.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAWnD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAGlD;yBAHe,SAAS"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/keccak.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/keccak.js deleted file mode 100644 index ea51d66f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/keccak.js +++ /dev/null @@ -1,52 +0,0 @@ -"use strict"; -/** - * Cryptographic hashing functions - * - * @_subsection: api/crypto:Hash Functions [about-crypto-hashing] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.keccak256 = void 0; -const sha3_1 = require("@noble/hashes/sha3"); -const index_js_1 = require("../utils/index.js"); -let locked = false; -const _keccak256 = function (data) { - return (0, sha3_1.keccak_256)(data); -}; -let __keccak256 = _keccak256; -/** - * Compute the cryptographic KECCAK256 hash of %%data%%. - * - * The %%data%% **must** be a data representation, to compute the - * hash of UTF-8 data use the [[id]] function. - * - * @returns DataHexstring - * @example: - * keccak256("0x") - * //_result: - * - * keccak256("0x1337") - * //_result: - * - * keccak256(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - * // Strings are assumed to be DataHexString, otherwise it will - * // throw. To hash UTF-8 data, see the note above. - * keccak256("Hello World") - * //_error: - */ -function keccak256(_data) { - const data = (0, index_js_1.getBytes)(_data, "data"); - return (0, index_js_1.hexlify)(__keccak256(data)); -} -exports.keccak256 = keccak256; -keccak256._ = _keccak256; -keccak256.lock = function () { locked = true; }; -keccak256.register = function (func) { - if (locked) { - throw new TypeError("keccak256 is locked"); - } - __keccak256 = func; -}; -Object.freeze(keccak256); -//# sourceMappingURL=keccak.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/keccak.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/keccak.js.map deleted file mode 100644 index e9959035..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/keccak.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"keccak.js","sourceRoot":"","sources":["../../src.ts/crypto/keccak.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,6CAAgD;AAEhD,gDAAsD;AAKtD,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,MAAM,UAAU,GAAG,UAAS,IAAgB;IACxC,OAAO,IAAA,iBAAU,EAAC,IAAI,CAAC,CAAC;AAC5B,CAAC,CAAA;AAED,IAAI,WAAW,GAAoC,UAAU,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,SAAS,CAAC,KAAgB;IACtC,MAAM,IAAI,GAAG,IAAA,mBAAQ,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,IAAA,kBAAO,EAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;AACtC,CAAC;AAHD,8BAGC;AACD,SAAS,CAAC,CAAC,GAAG,UAAU,CAAC;AACzB,SAAS,CAAC,IAAI,GAAG,cAAmB,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;AACpD,SAAS,CAAC,QAAQ,GAAG,UAAS,IAAqC;IAC/D,IAAI,MAAM,EAAE;QAAE,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAC;KAAE;IAC3D,WAAW,GAAG,IAAI,CAAC;AACvB,CAAC,CAAA;AACD,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/pbkdf2.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/pbkdf2.d.ts deleted file mode 100644 index 400e9744..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/pbkdf2.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * A **Password-Based Key-Derivation Function** is designed to create - * a sequence of bytes suitible as a **key** from a human-rememberable - * password. - * - * @_subsection: api/crypto:Passwords [about-pbkdf] - */ -import type { BytesLike } from "../utils/index.js"; -/** - * Return the [[link-pbkdf2]] for %%keylen%% bytes for %%password%% using - * the %%salt%% and using %%iterations%% of %%algo%%. - * - * This PBKDF is outdated and should not be used in new projects, but is - * required to decrypt older files. - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the PBKDF2 - * pbkdf2(passwordBytes, salt, 1024, 16, "sha256") - * //_result: - */ -export declare function pbkdf2(_password: BytesLike, _salt: BytesLike, iterations: number, keylen: number, algo: "sha256" | "sha512"): string; -export declare namespace pbkdf2 { - var _: (password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, algo: "sha256" | "sha512") => BytesLike; - var lock: () => void; - var register: (func: (password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, algo: "sha256" | "sha512") => BytesLike) => void; -} -//# sourceMappingURL=pbkdf2.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/pbkdf2.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/pbkdf2.d.ts.map deleted file mode 100644 index f869e13c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/pbkdf2.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pbkdf2.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/pbkdf2.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAWnD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,MAAM,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAIpI;yBAJe,MAAM"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/pbkdf2.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/pbkdf2.js deleted file mode 100644 index b771a19f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/pbkdf2.js +++ /dev/null @@ -1,53 +0,0 @@ -"use strict"; -/** - * A **Password-Based Key-Derivation Function** is designed to create - * a sequence of bytes suitible as a **key** from a human-rememberable - * password. - * - * @_subsection: api/crypto:Passwords [about-pbkdf] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.pbkdf2 = void 0; -const crypto_js_1 = require("./crypto.js"); -const index_js_1 = require("../utils/index.js"); -let locked = false; -const _pbkdf2 = function (password, salt, iterations, keylen, algo) { - return (0, crypto_js_1.pbkdf2Sync)(password, salt, iterations, keylen, algo); -}; -let __pbkdf2 = _pbkdf2; -/** - * Return the [[link-pbkdf2]] for %%keylen%% bytes for %%password%% using - * the %%salt%% and using %%iterations%% of %%algo%%. - * - * This PBKDF is outdated and should not be used in new projects, but is - * required to decrypt older files. - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the PBKDF2 - * pbkdf2(passwordBytes, salt, 1024, 16, "sha256") - * //_result: - */ -function pbkdf2(_password, _salt, iterations, keylen, algo) { - const password = (0, index_js_1.getBytes)(_password, "password"); - const salt = (0, index_js_1.getBytes)(_salt, "salt"); - return (0, index_js_1.hexlify)(__pbkdf2(password, salt, iterations, keylen, algo)); -} -exports.pbkdf2 = pbkdf2; -pbkdf2._ = _pbkdf2; -pbkdf2.lock = function () { locked = true; }; -pbkdf2.register = function (func) { - if (locked) { - throw new Error("pbkdf2 is locked"); - } - __pbkdf2 = func; -}; -Object.freeze(pbkdf2); -//# sourceMappingURL=pbkdf2.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/pbkdf2.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/pbkdf2.js.map deleted file mode 100644 index 0401de41..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/pbkdf2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pbkdf2.js","sourceRoot":"","sources":["../../src.ts/crypto/pbkdf2.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,2CAAyC;AAEzC,gDAAsD;AAKtD,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,MAAM,OAAO,GAAG,UAAS,QAAoB,EAAE,IAAgB,EAAE,UAAkB,EAAE,MAAc,EAAE,IAAyB;IAC1H,OAAO,IAAA,sBAAU,EAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;AAChE,CAAC,CAAA;AAED,IAAI,QAAQ,GAAG,OAAO,CAAC;AAEvB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,MAAM,CAAC,SAAoB,EAAE,KAAgB,EAAE,UAAkB,EAAE,MAAc,EAAE,IAAyB;IACxH,MAAM,QAAQ,GAAG,IAAA,mBAAQ,EAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IACjD,MAAM,IAAI,GAAG,IAAA,mBAAQ,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,IAAA,kBAAO,EAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;AACvE,CAAC;AAJD,wBAIC;AACD,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC;AACnB,MAAM,CAAC,IAAI,GAAG,cAAmB,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;AACjD,MAAM,CAAC,QAAQ,GAAG,UAAS,IAA0H;IACjJ,IAAI,MAAM,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;KAAE;IACpD,QAAQ,GAAG,IAAI,CAAC;AACpB,CAAC,CAAA;AACD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/random.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/random.d.ts deleted file mode 100644 index fd937800..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/random.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Return %%length%% bytes of cryptographically secure random data. - * - * @example: - * randomBytes(8) - * //_result: - */ -export declare function randomBytes(length: number): Uint8Array; -export declare namespace randomBytes { - var _: (length: number) => Uint8Array; - var lock: () => void; - var register: (func: (length: number) => Uint8Array) => void; -} -//# sourceMappingURL=random.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/random.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/random.d.ts.map deleted file mode 100644 index a907fd7e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/random.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/random.ts"],"names":[],"mappings":"AAkBA;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAEtD;yBAFe,WAAW"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/random.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/random.js deleted file mode 100644 index b8e4aca9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/random.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.randomBytes = void 0; -/** - * A **Cryptographically Secure Random Value** is one that has been - * generated with additional care take to prevent side-channels - * from allowing others to detect it and prevent others from through - * coincidence generate the same values. - * - * @_subsection: api/crypto:Random Values [about-crypto-random] - */ -const crypto_js_1 = require("./crypto.js"); -let locked = false; -const _randomBytes = function (length) { - return new Uint8Array((0, crypto_js_1.randomBytes)(length)); -}; -let __randomBytes = _randomBytes; -/** - * Return %%length%% bytes of cryptographically secure random data. - * - * @example: - * randomBytes(8) - * //_result: - */ -function randomBytes(length) { - return __randomBytes(length); -} -exports.randomBytes = randomBytes; -randomBytes._ = _randomBytes; -randomBytes.lock = function () { locked = true; }; -randomBytes.register = function (func) { - if (locked) { - throw new Error("randomBytes is locked"); - } - __randomBytes = func; -}; -Object.freeze(randomBytes); -//# sourceMappingURL=random.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/random.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/random.js.map deleted file mode 100644 index 16ef92a9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/random.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"random.js","sourceRoot":"","sources":["../../src.ts/crypto/random.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACH,2CAA2D;AAE3D,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,MAAM,YAAY,GAAG,UAAS,MAAc;IACxC,OAAO,IAAI,UAAU,CAAC,IAAA,uBAAa,EAAC,MAAM,CAAC,CAAC,CAAC;AACjD,CAAC,CAAA;AAED,IAAI,aAAa,GAAG,YAAY,CAAC;AAEjC;;;;;;GAMG;AACH,SAAgB,WAAW,CAAC,MAAc;IACtC,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC;AAFD,kCAEC;AAED,WAAW,CAAC,CAAC,GAAG,YAAY,CAAC;AAC7B,WAAW,CAAC,IAAI,GAAG,cAAmB,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;AACtD,WAAW,CAAC,QAAQ,GAAG,UAAS,IAAoC;IAChE,IAAI,MAAM,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;KAAE;IACzD,aAAa,GAAG,IAAI,CAAC;AACzB,CAAC,CAAA;AACD,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/ripemd160.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/ripemd160.d.ts deleted file mode 100644 index 27b7b4a1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/ripemd160.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { BytesLike } from "../utils/index.js"; -/** - * Compute the cryptographic RIPEMD-160 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * ripemd160("0x") - * //_result: - * - * ripemd160("0x1337") - * //_result: - * - * ripemd160(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - */ -export declare function ripemd160(_data: BytesLike): string; -export declare namespace ripemd160 { - var _: (data: Uint8Array) => Uint8Array; - var lock: () => void; - var register: (func: (data: Uint8Array) => BytesLike) => void; -} -//# sourceMappingURL=ripemd160.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/ripemd160.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/ripemd160.d.ts.map deleted file mode 100644 index 03f10806..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/ripemd160.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ripemd160.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ripemd160.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAWnD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAGlD;yBAHe,SAAS"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/ripemd160.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/ripemd160.js deleted file mode 100644 index ac69f3a1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/ripemd160.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ripemd160 = void 0; -const ripemd160_1 = require("@noble/hashes/ripemd160"); -const index_js_1 = require("../utils/index.js"); -let locked = false; -const _ripemd160 = function (data) { - return (0, ripemd160_1.ripemd160)(data); -}; -let __ripemd160 = _ripemd160; -/** - * Compute the cryptographic RIPEMD-160 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * ripemd160("0x") - * //_result: - * - * ripemd160("0x1337") - * //_result: - * - * ripemd160(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - */ -function ripemd160(_data) { - const data = (0, index_js_1.getBytes)(_data, "data"); - return (0, index_js_1.hexlify)(__ripemd160(data)); -} -exports.ripemd160 = ripemd160; -ripemd160._ = _ripemd160; -ripemd160.lock = function () { locked = true; }; -ripemd160.register = function (func) { - if (locked) { - throw new TypeError("ripemd160 is locked"); - } - __ripemd160 = func; -}; -Object.freeze(ripemd160); -//# sourceMappingURL=ripemd160.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/ripemd160.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/ripemd160.js.map deleted file mode 100644 index d5e51b4f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/ripemd160.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ripemd160.js","sourceRoot":"","sources":["../../src.ts/crypto/ripemd160.ts"],"names":[],"mappings":";;;AAAA,uDAAuE;AAEvE,gDAAuD;AAKvD,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,MAAM,UAAU,GAAG,UAAS,IAAgB;IACxC,OAAO,IAAA,qBAAe,EAAC,IAAI,CAAC,CAAC;AACjC,CAAC,CAAA;AAED,IAAI,WAAW,GAAoC,UAAU,CAAC;AAE9D;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,SAAS,CAAC,KAAgB;IACtC,MAAM,IAAI,GAAG,IAAA,mBAAQ,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,IAAA,kBAAO,EAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;AACtC,CAAC;AAHD,8BAGC;AACD,SAAS,CAAC,CAAC,GAAG,UAAU,CAAC;AACzB,SAAS,CAAC,IAAI,GAAG,cAAmB,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;AACpD,SAAS,CAAC,QAAQ,GAAG,UAAS,IAAqC;IAC/D,IAAI,MAAM,EAAE;QAAE,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAC;KAAE;IAC3D,WAAW,GAAG,IAAI,CAAC;AACvB,CAAC,CAAA;AACD,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/scrypt.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/scrypt.d.ts deleted file mode 100644 index b0e678f5..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/scrypt.d.ts +++ /dev/null @@ -1,82 +0,0 @@ -import type { BytesLike } from "../utils/index.js"; -/** - * A callback during long-running operations to update any - * UI or provide programatic access to the progress. - * - * The %%percent%% is a value between ``0`` and ``1``. - * - * @_docloc: api/crypto:Passwords - */ -export type ProgressCallback = (percent: number) => void; -/** - * The [[link-wiki-scrypt]] uses a memory and cpu hard method of - * derivation to increase the resource cost to brute-force a password - * for a given key. - * - * This means this algorithm is intentionally slow, and can be tuned to - * become slower. As computation and memory speed improve over time, - * increasing the difficulty maintains the cost of an attacker. - * - * For example, if a target time of 5 seconds is used, a legitimate user - * which knows their password requires only 5 seconds to unlock their - * account. A 6 character password has 68 billion possibilities, which - * would require an attacker to invest over 10,000 years of CPU time. This - * is of course a crude example (as password generally aren't random), - * but demonstrates to value of imposing large costs to decryption. - * - * For this reason, if building a UI which involved decrypting or - * encrypting datsa using scrypt, it is recommended to use a - * [[ProgressCallback]] (as event short periods can seem lik an eternity - * if the UI freezes). Including the phrase //"decrypting"// in the UI - * can also help, assuring the user their waiting is for a good reason. - * - * @_docloc: api/crypto:Passwords - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the scrypt - * scrypt(passwordBytes, salt, 1024, 8, 1, 16) - * //_result: - */ -export declare function scrypt(_passwd: BytesLike, _salt: BytesLike, N: number, r: number, p: number, dkLen: number, progress?: ProgressCallback): Promise; -export declare namespace scrypt { - var _: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number, onProgress?: ProgressCallback | undefined) => Promise; - var lock: () => void; - var register: (func: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number, progress?: ProgressCallback | undefined) => Promise) => void; -} -/** - * Provides a synchronous variant of [[scrypt]]. - * - * This will completely lock up and freeze the UI in a browser and will - * prevent any event loop from progressing. For this reason, it is - * preferred to use the [async variant](scrypt). - * - * @_docloc: api/crypto:Passwords - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the scrypt - * scryptSync(passwordBytes, salt, 1024, 8, 1, 16) - * //_result: - */ -export declare function scryptSync(_passwd: BytesLike, _salt: BytesLike, N: number, r: number, p: number, dkLen: number): string; -export declare namespace scryptSync { - var _: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number) => Uint8Array; - var lock: () => void; - var register: (func: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number) => BytesLike) => void; -} -//# sourceMappingURL=scrypt.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/scrypt.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/scrypt.d.ts.map deleted file mode 100644 index af193f1a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/scrypt.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"scrypt.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/scrypt.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;AAgBzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAsB,MAAM,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAI/J;yBAJqB,MAAM;;;;;AAa5B;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAIvH;yBAJe,UAAU"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/scrypt.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/scrypt.js deleted file mode 100644 index 4f500191..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/scrypt.js +++ /dev/null @@ -1,104 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.scryptSync = exports.scrypt = void 0; -const scrypt_1 = require("@noble/hashes/scrypt"); -const index_js_1 = require("../utils/index.js"); -let lockedSync = false, lockedAsync = false; -const _scryptAsync = async function (passwd, salt, N, r, p, dkLen, onProgress) { - return await (0, scrypt_1.scryptAsync)(passwd, salt, { N, r, p, dkLen, onProgress }); -}; -const _scryptSync = function (passwd, salt, N, r, p, dkLen) { - return (0, scrypt_1.scrypt)(passwd, salt, { N, r, p, dkLen }); -}; -let __scryptAsync = _scryptAsync; -let __scryptSync = _scryptSync; -/** - * The [[link-wiki-scrypt]] uses a memory and cpu hard method of - * derivation to increase the resource cost to brute-force a password - * for a given key. - * - * This means this algorithm is intentionally slow, and can be tuned to - * become slower. As computation and memory speed improve over time, - * increasing the difficulty maintains the cost of an attacker. - * - * For example, if a target time of 5 seconds is used, a legitimate user - * which knows their password requires only 5 seconds to unlock their - * account. A 6 character password has 68 billion possibilities, which - * would require an attacker to invest over 10,000 years of CPU time. This - * is of course a crude example (as password generally aren't random), - * but demonstrates to value of imposing large costs to decryption. - * - * For this reason, if building a UI which involved decrypting or - * encrypting datsa using scrypt, it is recommended to use a - * [[ProgressCallback]] (as event short periods can seem lik an eternity - * if the UI freezes). Including the phrase //"decrypting"// in the UI - * can also help, assuring the user their waiting is for a good reason. - * - * @_docloc: api/crypto:Passwords - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the scrypt - * scrypt(passwordBytes, salt, 1024, 8, 1, 16) - * //_result: - */ -async function scrypt(_passwd, _salt, N, r, p, dkLen, progress) { - const passwd = (0, index_js_1.getBytes)(_passwd, "passwd"); - const salt = (0, index_js_1.getBytes)(_salt, "salt"); - return (0, index_js_1.hexlify)(await __scryptAsync(passwd, salt, N, r, p, dkLen, progress)); -} -exports.scrypt = scrypt; -scrypt._ = _scryptAsync; -scrypt.lock = function () { lockedAsync = true; }; -scrypt.register = function (func) { - if (lockedAsync) { - throw new Error("scrypt is locked"); - } - __scryptAsync = func; -}; -Object.freeze(scrypt); -/** - * Provides a synchronous variant of [[scrypt]]. - * - * This will completely lock up and freeze the UI in a browser and will - * prevent any event loop from progressing. For this reason, it is - * preferred to use the [async variant](scrypt). - * - * @_docloc: api/crypto:Passwords - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the scrypt - * scryptSync(passwordBytes, salt, 1024, 8, 1, 16) - * //_result: - */ -function scryptSync(_passwd, _salt, N, r, p, dkLen) { - const passwd = (0, index_js_1.getBytes)(_passwd, "passwd"); - const salt = (0, index_js_1.getBytes)(_salt, "salt"); - return (0, index_js_1.hexlify)(__scryptSync(passwd, salt, N, r, p, dkLen)); -} -exports.scryptSync = scryptSync; -scryptSync._ = _scryptSync; -scryptSync.lock = function () { lockedSync = true; }; -scryptSync.register = function (func) { - if (lockedSync) { - throw new Error("scryptSync is locked"); - } - __scryptSync = func; -}; -Object.freeze(scryptSync); -//# sourceMappingURL=scrypt.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/scrypt.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/scrypt.js.map deleted file mode 100644 index b2cd0103..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/scrypt.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"scrypt.js","sourceRoot":"","sources":["../../src.ts/crypto/scrypt.ts"],"names":[],"mappings":";;;AAAA,iDAAwF;AAExF,gDAA2D;AAe3D,IAAI,UAAU,GAAG,KAAK,EAAE,WAAW,GAAG,KAAK,CAAC;AAE5C,MAAM,YAAY,GAAG,KAAK,WAAU,MAAkB,EAAE,IAAgB,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,KAAa,EAAE,UAA6B;IACnJ,OAAO,MAAM,IAAA,oBAAW,EAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;AAC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EAAE,KAAgB,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,KAAa;IAC3G,MAAM,MAAM,GAAG,IAAA,mBAAQ,EAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC3C,MAAM,IAAI,GAAG,IAAA,mBAAQ,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,IAAA,kBAAC,EAAC,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;AACzD,CAAC;AAJD,gCAIC;AACD,UAAU,CAAC,CAAC,GAAG,WAAW,CAAC;AAC3B,UAAU,CAAC,IAAI,GAAG,cAAmB,UAAU,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;AACzD,UAAU,CAAC,QAAQ,GAAG,UAAS,IAAyG;IACpI,IAAI,UAAU,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;KAAE;IAC5D,YAAY,GAAG,IAAI,CAAC;AACxB,CAAC,CAAA;AACD,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/sha2.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/sha2.d.ts deleted file mode 100644 index 348ccdc7..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/sha2.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -import type { BytesLike } from "../utils/index.js"; -/** - * Compute the cryptographic SHA2-256 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * sha256("0x") - * //_result: - * - * sha256("0x1337") - * //_result: - * - * sha256(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - */ -export declare function sha256(_data: BytesLike): string; -export declare namespace sha256 { - var _: (data: Uint8Array) => Uint8Array; - var lock: () => void; - var register: (func: (data: Uint8Array) => BytesLike) => void; -} -/** - * Compute the cryptographic SHA2-512 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * sha512("0x") - * //_result: - * - * sha512("0x1337") - * //_result: - * - * sha512(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - */ -export declare function sha512(_data: BytesLike): string; -export declare namespace sha512 { - var _: (data: Uint8Array) => Uint8Array; - var lock: () => void; - var register: (func: (data: Uint8Array) => BytesLike) => void; -} -//# sourceMappingURL=sha2.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/sha2.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/sha2.d.ts.map deleted file mode 100644 index 9e42678e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/sha2.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha2.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/sha2.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAiBnD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAG/C;yBAHe,MAAM;;;;;AAatB;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAG/C;yBAHe,MAAM"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/sha2.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/sha2.js deleted file mode 100644 index c5ed9915..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/sha2.js +++ /dev/null @@ -1,76 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.sha512 = exports.sha256 = void 0; -const crypto_js_1 = require("./crypto.js"); -const index_js_1 = require("../utils/index.js"); -const _sha256 = function (data) { - return (0, crypto_js_1.createHash)("sha256").update(data).digest(); -}; -const _sha512 = function (data) { - return (0, crypto_js_1.createHash)("sha512").update(data).digest(); -}; -let __sha256 = _sha256; -let __sha512 = _sha512; -let locked256 = false, locked512 = false; -/** - * Compute the cryptographic SHA2-256 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * sha256("0x") - * //_result: - * - * sha256("0x1337") - * //_result: - * - * sha256(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - */ -function sha256(_data) { - const data = (0, index_js_1.getBytes)(_data, "data"); - return (0, index_js_1.hexlify)(__sha256(data)); -} -exports.sha256 = sha256; -sha256._ = _sha256; -sha256.lock = function () { locked256 = true; }; -sha256.register = function (func) { - if (locked256) { - throw new Error("sha256 is locked"); - } - __sha256 = func; -}; -Object.freeze(sha256); -/** - * Compute the cryptographic SHA2-512 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * sha512("0x") - * //_result: - * - * sha512("0x1337") - * //_result: - * - * sha512(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - */ -function sha512(_data) { - const data = (0, index_js_1.getBytes)(_data, "data"); - return (0, index_js_1.hexlify)(__sha512(data)); -} -exports.sha512 = sha512; -sha512._ = _sha512; -sha512.lock = function () { locked512 = true; }; -sha512.register = function (func) { - if (locked512) { - throw new Error("sha512 is locked"); - } - __sha512 = func; -}; -Object.freeze(sha256); -//# sourceMappingURL=sha2.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/sha2.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/sha2.js.map deleted file mode 100644 index 05fa16e9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/sha2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha2.js","sourceRoot":"","sources":["../../src.ts/crypto/sha2.ts"],"names":[],"mappings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C,IAAI,CAAC,CAAC,CAAC;AACnC,CAAC;AAHD,wBAGC;AACD,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC;AACnB,MAAM,CAAC,IAAI,GAAG,cAAmB,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;AACpD,MAAM,CAAC,QAAQ,GAAG,UAAS,IAAqC;IAC5D,IAAI,SAAS,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;KAAE;IACvD,QAAQ,GAAG,IAAI,CAAC;AACpB,CAAC,CAAA;AACD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/signature.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/signature.d.ts deleted file mode 100644 index ab39d2a8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/signature.d.ts +++ /dev/null @@ -1,183 +0,0 @@ -import type { BigNumberish, BytesLike } from "../utils/index.js"; -declare const inspect: unique symbol; -/** - * A SignatureLike - * - * @_docloc: api/crypto:Signing - */ -export type SignatureLike = Signature | string | { - r: string; - s: string; - v: BigNumberish; - yParity?: 0 | 1; - yParityAndS?: string; -} | { - r: string; - yParityAndS: string; - yParity?: 0 | 1; - s?: string; - v?: number; -} | { - r: string; - s: string; - yParity: 0 | 1; - v?: BigNumberish; - yParityAndS?: string; -}; -/** - * A Signature @TODO - * - * - * @_docloc: api/crypto:Signing - */ -export declare class Signature { - #private; - /** - * The ``r`` value for a signature. - * - * This represents the ``x`` coordinate of a "reference" or - * challenge point, from which the ``y`` can be computed. - */ - get r(): string; - set r(value: BytesLike); - /** - * The ``s`` value for a signature. - */ - get s(): string; - set s(_value: BytesLike); - /** - * Return the s value, unchecked for EIP-2 compliance. - * - * This should generally not be used and is for situations where - * a non-canonical S value might be relevant, such as Frontier blocks - * that were mined prior to EIP-2 or invalid Authorization List - * signatures. - */ - get _s(): string; - /** - * Returns true if the Signature is valid for [[link-eip-2]] signatures. - */ - isValid(): boolean; - /** - * The ``v`` value for a signature. - * - * Since a given ``x`` value for ``r`` has two possible values for - * its correspondin ``y``, the ``v`` indicates which of the two ``y`` - * values to use. - * - * It is normalized to the values ``27`` or ``28`` for legacy - * purposes. - */ - get v(): 27 | 28; - set v(value: BigNumberish); - /** - * The EIP-155 ``v`` for legacy transactions. For non-legacy - * transactions, this value is ``null``. - */ - get networkV(): null | bigint; - /** - * The chain ID for EIP-155 legacy transactions. For non-legacy - * transactions, this value is ``null``. - */ - get legacyChainId(): null | bigint; - /** - * The ``yParity`` for the signature. - * - * See ``v`` for more details on how this value is used. - */ - get yParity(): 0 | 1; - /** - * The [[link-eip-2098]] compact representation of the ``yParity`` - * and ``s`` compacted into a single ``bytes32``. - */ - get yParityAndS(): string; - /** - * The [[link-eip-2098]] compact representation. - */ - get compactSerialized(): string; - /** - * The serialized representation. - */ - get serialized(): string; - /** - * @private - */ - constructor(guard: any, r: string, s: string, v: 27 | 28); - /** - * Returns the canonical signature. - * - * This is only necessary when dealing with legacy transaction which - * did not enforce canonical S values (i.e. [[link-eip-2]]. Most - * developers should never require this. - */ - getCanonical(): Signature; - /** - * Returns a new identical [[Signature]]. - */ - clone(): Signature; - /** - * Returns a representation that is compatible with ``JSON.stringify``. - */ - toJSON(): any; - [inspect](): string; - toString(): string; - /** - * Compute the chain ID from the ``v`` in a legacy EIP-155 transactions. - * - * @example: - * Signature.getChainId(45) - * //_result: - * - * Signature.getChainId(46) - * //_result: - */ - static getChainId(v: BigNumberish): bigint; - /** - * Compute the ``v`` for a chain ID for a legacy EIP-155 transactions. - * - * Legacy transactions which use [[link-eip-155]] hijack the ``v`` - * property to include the chain ID. - * - * @example: - * Signature.getChainIdV(5, 27) - * //_result: - * - * Signature.getChainIdV(5, 28) - * //_result: - * - */ - static getChainIdV(chainId: BigNumberish, v: 27 | 28): bigint; - /** - * Compute the normalized legacy transaction ``v`` from a ``yParirty``, - * a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction. - * - * @example: - * // The values 0 and 1 imply v is actually yParity - * Signature.getNormalizedV(0) - * //_result: - * - * // Legacy non-EIP-1559 transaction (i.e. 27 or 28) - * Signature.getNormalizedV(27) - * //_result: - * - * // Legacy EIP-155 transaction (i.e. >= 35) - * Signature.getNormalizedV(46) - * //_result: - * - * // Invalid values throw - * Signature.getNormalizedV(5) - * //_error: - */ - static getNormalizedV(v: BigNumberish): 27 | 28; - /** - * Creates a new [[Signature]]. - * - * If no %%sig%% is provided, a new [[Signature]] is created - * with default values. - * - * If %%sig%% is a string, it is parsed. - */ - static from(sig?: SignatureLike): Signature; -} -export {}; -//# sourceMappingURL=signature.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/signature.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/signature.d.ts.map deleted file mode 100644 index 4ee80592..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/signature.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/signature.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACR,YAAY,EAAE,SAAS,EAC1B,MAAM,mBAAmB,CAAC;AAa3B,QAAA,MAAM,OAAO,eAA2C,CAAC;AAMzD;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,MAAM,GAAG;IAC7C,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,YAAY,CAAC;IAChB,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB,GAAG;IACA,CAAC,EAAE,MAAM,CAAC;IACV,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAChB,CAAC,CAAC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;;OAEG;IACH,MAAM,IAAI,GAAG;IASb,CAAC,OAAO,CAAC,IAAI,MAAM;IAInB,QAAQ,IAAI,MAAM;IAOlB;;;;;;;;;OASG;IACH,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE,YAAY,GAAG,MAAM;IAY1C;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,YAAY,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,MAAM;IAI7D;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,YAAY,GAAG,EAAE,GAAG,EAAE;IAY/C;;;;;;;OAOG;IACH,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,aAAa,GAAG,SAAS;CAqF9C"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/signature.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/signature.js deleted file mode 100644 index 8512064a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/signature.js +++ /dev/null @@ -1,350 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Signature = void 0; -const index_js_1 = require("../constants/index.js"); -const index_js_2 = require("../utils/index.js"); -// Constants -const BN_0 = BigInt(0); -const BN_1 = BigInt(1); -const BN_2 = BigInt(2); -const BN_27 = BigInt(27); -const BN_28 = BigInt(28); -const BN_35 = BigInt(35); -const BN_N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); -const BN_N_2 = BN_N / BN_2; // Must be integer (floor) division; do NOT shifts -const inspect = Symbol.for("nodejs.util.inspect.custom"); -const _guard = {}; -function toUint256(value) { - return (0, index_js_2.zeroPadValue)((0, index_js_2.toBeArray)(value), 32); -} -/** - * A Signature @TODO - * - * - * @_docloc: api/crypto:Signing - */ -class Signature { - #r; - #s; - #v; - #networkV; - /** - * The ``r`` value for a signature. - * - * This represents the ``x`` coordinate of a "reference" or - * challenge point, from which the ``y`` can be computed. - */ - get r() { return this.#r; } - set r(value) { - (0, index_js_2.assertArgument)((0, index_js_2.dataLength)(value) === 32, "invalid r", "value", value); - this.#r = (0, index_js_2.hexlify)(value); - } - /** - * The ``s`` value for a signature. - */ - get s() { - (0, index_js_2.assertArgument)(parseInt(this.#s.substring(0, 3)) < 8, "non-canonical s; use ._s", "s", this.#s); - return this.#s; - } - set s(_value) { - (0, index_js_2.assertArgument)((0, index_js_2.dataLength)(_value) === 32, "invalid s", "value", _value); - this.#s = (0, index_js_2.hexlify)(_value); - } - /** - * Return the s value, unchecked for EIP-2 compliance. - * - * This should generally not be used and is for situations where - * a non-canonical S value might be relevant, such as Frontier blocks - * that were mined prior to EIP-2 or invalid Authorization List - * signatures. - */ - get _s() { return this.#s; } - /** - * Returns true if the Signature is valid for [[link-eip-2]] signatures. - */ - isValid() { - const s = BigInt(this.#s); - return (s <= BN_N_2); - } - /** - * The ``v`` value for a signature. - * - * Since a given ``x`` value for ``r`` has two possible values for - * its correspondin ``y``, the ``v`` indicates which of the two ``y`` - * values to use. - * - * It is normalized to the values ``27`` or ``28`` for legacy - * purposes. - */ - get v() { return this.#v; } - set v(value) { - const v = (0, index_js_2.getNumber)(value, "value"); - (0, index_js_2.assertArgument)(v === 27 || v === 28, "invalid v", "v", value); - this.#v = v; - } - /** - * The EIP-155 ``v`` for legacy transactions. For non-legacy - * transactions, this value is ``null``. - */ - get networkV() { return this.#networkV; } - /** - * The chain ID for EIP-155 legacy transactions. For non-legacy - * transactions, this value is ``null``. - */ - get legacyChainId() { - const v = this.networkV; - if (v == null) { - return null; - } - return Signature.getChainId(v); - } - /** - * The ``yParity`` for the signature. - * - * See ``v`` for more details on how this value is used. - */ - get yParity() { - return (this.v === 27) ? 0 : 1; - } - /** - * The [[link-eip-2098]] compact representation of the ``yParity`` - * and ``s`` compacted into a single ``bytes32``. - */ - get yParityAndS() { - // The EIP-2098 compact representation - const yParityAndS = (0, index_js_2.getBytes)(this.s); - if (this.yParity) { - yParityAndS[0] |= 0x80; - } - return (0, index_js_2.hexlify)(yParityAndS); - } - /** - * The [[link-eip-2098]] compact representation. - */ - get compactSerialized() { - return (0, index_js_2.concat)([this.r, this.yParityAndS]); - } - /** - * The serialized representation. - */ - get serialized() { - return (0, index_js_2.concat)([this.r, this.s, (this.yParity ? "0x1c" : "0x1b")]); - } - /** - * @private - */ - constructor(guard, r, s, v) { - (0, index_js_2.assertPrivate)(guard, _guard, "Signature"); - this.#r = r; - this.#s = s; - this.#v = v; - this.#networkV = null; - } - /** - * Returns the canonical signature. - * - * This is only necessary when dealing with legacy transaction which - * did not enforce canonical S values (i.e. [[link-eip-2]]. Most - * developers should never require this. - */ - getCanonical() { - if (this.isValid()) { - return this; - } - // Compute the canonical signature; s' = N - s, v = !v - const s = BN_N - BigInt(this._s); - const v = (55 - this.v); - const result = new Signature(_guard, this.r, toUint256(s), v); - // Populate the networkV if necessary - if (this.networkV) { - result.#networkV = this.networkV; - } - return result; - } - /** - * Returns a new identical [[Signature]]. - */ - clone() { - const clone = new Signature(_guard, this.r, this._s, this.v); - if (this.networkV) { - clone.#networkV = this.networkV; - } - return clone; - } - /** - * Returns a representation that is compatible with ``JSON.stringify``. - */ - toJSON() { - const networkV = this.networkV; - return { - _type: "signature", - networkV: ((networkV != null) ? networkV.toString() : null), - r: this.r, s: this._s, v: this.v, - }; - } - [inspect]() { - return this.toString(); - } - toString() { - if (this.isValid()) { - return `Signature { r: ${this.r}, s: ${this._s}, v: ${this.v} }`; - } - return `Signature { r: ${this.r}, s: ${this._s}, v: ${this.v}, valid: false }`; - } - /** - * Compute the chain ID from the ``v`` in a legacy EIP-155 transactions. - * - * @example: - * Signature.getChainId(45) - * //_result: - * - * Signature.getChainId(46) - * //_result: - */ - static getChainId(v) { - const bv = (0, index_js_2.getBigInt)(v, "v"); - // The v is not an EIP-155 v, so it is the unspecified chain ID - if ((bv == BN_27) || (bv == BN_28)) { - return BN_0; - } - // Bad value for an EIP-155 v - (0, index_js_2.assertArgument)(bv >= BN_35, "invalid EIP-155 v", "v", v); - return (bv - BN_35) / BN_2; - } - /** - * Compute the ``v`` for a chain ID for a legacy EIP-155 transactions. - * - * Legacy transactions which use [[link-eip-155]] hijack the ``v`` - * property to include the chain ID. - * - * @example: - * Signature.getChainIdV(5, 27) - * //_result: - * - * Signature.getChainIdV(5, 28) - * //_result: - * - */ - static getChainIdV(chainId, v) { - return ((0, index_js_2.getBigInt)(chainId) * BN_2) + BigInt(35 + v - 27); - } - /** - * Compute the normalized legacy transaction ``v`` from a ``yParirty``, - * a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction. - * - * @example: - * // The values 0 and 1 imply v is actually yParity - * Signature.getNormalizedV(0) - * //_result: - * - * // Legacy non-EIP-1559 transaction (i.e. 27 or 28) - * Signature.getNormalizedV(27) - * //_result: - * - * // Legacy EIP-155 transaction (i.e. >= 35) - * Signature.getNormalizedV(46) - * //_result: - * - * // Invalid values throw - * Signature.getNormalizedV(5) - * //_error: - */ - static getNormalizedV(v) { - const bv = (0, index_js_2.getBigInt)(v); - if (bv === BN_0 || bv === BN_27) { - return 27; - } - if (bv === BN_1 || bv === BN_28) { - return 28; - } - (0, index_js_2.assertArgument)(bv >= BN_35, "invalid v", "v", v); - // Otherwise, EIP-155 v means odd is 27 and even is 28 - return (bv & BN_1) ? 27 : 28; - } - /** - * Creates a new [[Signature]]. - * - * If no %%sig%% is provided, a new [[Signature]] is created - * with default values. - * - * If %%sig%% is a string, it is parsed. - */ - static from(sig) { - function assertError(check, message) { - (0, index_js_2.assertArgument)(check, message, "signature", sig); - } - ; - if (sig == null) { - return new Signature(_guard, index_js_1.ZeroHash, index_js_1.ZeroHash, 27); - } - if (typeof (sig) === "string") { - const bytes = (0, index_js_2.getBytes)(sig, "signature"); - if (bytes.length === 64) { - const r = (0, index_js_2.hexlify)(bytes.slice(0, 32)); - const s = bytes.slice(32, 64); - const v = (s[0] & 0x80) ? 28 : 27; - s[0] &= 0x7f; - return new Signature(_guard, r, (0, index_js_2.hexlify)(s), v); - } - if (bytes.length === 65) { - const r = (0, index_js_2.hexlify)(bytes.slice(0, 32)); - const s = (0, index_js_2.hexlify)(bytes.slice(32, 64)); - const v = Signature.getNormalizedV(bytes[64]); - return new Signature(_guard, r, s, v); - } - assertError(false, "invalid raw signature length"); - } - if (sig instanceof Signature) { - return sig.clone(); - } - // Get r - const _r = sig.r; - assertError(_r != null, "missing r"); - const r = toUint256(_r); - // Get s; by any means necessary (we check consistency below) - const s = (function (s, yParityAndS) { - if (s != null) { - return toUint256(s); - } - if (yParityAndS != null) { - assertError((0, index_js_2.isHexString)(yParityAndS, 32), "invalid yParityAndS"); - const bytes = (0, index_js_2.getBytes)(yParityAndS); - bytes[0] &= 0x7f; - return (0, index_js_2.hexlify)(bytes); - } - assertError(false, "missing s"); - })(sig.s, sig.yParityAndS); - // Get v; by any means necessary (we check consistency below) - const { networkV, v } = (function (_v, yParityAndS, yParity) { - if (_v != null) { - const v = (0, index_js_2.getBigInt)(_v); - return { - networkV: ((v >= BN_35) ? v : undefined), - v: Signature.getNormalizedV(v) - }; - } - if (yParityAndS != null) { - assertError((0, index_js_2.isHexString)(yParityAndS, 32), "invalid yParityAndS"); - return { v: (((0, index_js_2.getBytes)(yParityAndS)[0] & 0x80) ? 28 : 27) }; - } - if (yParity != null) { - switch ((0, index_js_2.getNumber)(yParity, "sig.yParity")) { - case 0: return { v: 27 }; - case 1: return { v: 28 }; - } - assertError(false, "invalid yParity"); - } - assertError(false, "missing v"); - })(sig.v, sig.yParityAndS, sig.yParity); - const result = new Signature(_guard, r, s, v); - if (networkV) { - result.#networkV = networkV; - } - // If multiple of v, yParity, yParityAndS we given, check they match - assertError(sig.yParity == null || (0, index_js_2.getNumber)(sig.yParity, "sig.yParity") === result.yParity, "yParity mismatch"); - assertError(sig.yParityAndS == null || sig.yParityAndS === result.yParityAndS, "yParityAndS mismatch"); - return result; - } -} -exports.Signature = Signature; -//# sourceMappingURL=signature.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/signature.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/signature.js.map deleted file mode 100644 index d8b530d0..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/signature.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signature.js","sourceRoot":"","sources":["../../src.ts/crypto/signature.ts"],"names":[],"mappings":";;;AACA,oDAAiD;AACjD,gDAI2B;AAO3B,YAAY;AACZ,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;AACzB,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;AACzB,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;AACzB,MAAM,IAAI,GAAG,MAAM,CAAC,oEAAoE,CAAC,CAAC;AAC1F,MAAM,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,kDAAkD;AAE9E,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAEzD,MAAM,MAAM,GAAG,EAAG,CAAC;AA6BnB,SAAS,SAAS,CAAC,KAAmB;IAClC,OAAO,IAAA,uBAAY,EAAC,IAAA,oBAAS,EAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;AAC9C,CAAC;AAED;;;;;GAKG;AACH,MAAa,SAAS;IAClB,EAAE,CAAS;IACX,EAAE,CAAS;IACX,EAAE,CAAU;IACZ,SAAS,CAAgB;IAEzB;;;;;OAKG;IACH,IAAI,CAAC,KAAa,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IACnC,IAAI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AAC;oBACzB,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;iBAC5B;gBACD,WAAW,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC;aACzC;YAED,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;QAExC,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAC9C,IAAI,QAAQ,EAAE;YAAE,MAAM,CAAC,SAAS,GAAI,QAAQ,CAAC;SAAE;QAE/C,oEAAoE;QACpE,WAAW,CAAC,GAAG,CAAC,OAAO,IAAI,IAAI,IAAI,IAAA,oBAAS,EAAC,GAAG,CAAC,OAAO,EAAE,aAAa,CAAC,KAAK,MAAM,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;QACjH,WAAW,CAAC,GAAG,CAAC,WAAW,IAAI,IAAI,IAAI,GAAG,CAAC,WAAW,KAAK,MAAM,CAAC,WAAW,EAAE,sBAAsB,CAAC,CAAC;QAEvG,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AAzVD,8BAyVC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/signing-key.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/signing-key.d.ts deleted file mode 100644 index 0864d3b8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/signing-key.d.ts +++ /dev/null @@ -1,122 +0,0 @@ -/** - * Add details about signing here. - * - * @_subsection: api/crypto:Signing [about-signing] - */ -import { Signature } from "./signature.js"; -import type { BytesLike } from "../utils/index.js"; -import type { SignatureLike } from "./index.js"; -/** - * A **SigningKey** provides high-level access to the elliptic curve - * cryptography (ECC) operations and key management. - */ -export declare class SigningKey { - #private; - /** - * Creates a new **SigningKey** for %%privateKey%%. - */ - constructor(privateKey: BytesLike); - /** - * The private key. - */ - get privateKey(): string; - /** - * The uncompressed public key. - * - * This will always begin with the prefix ``0x04`` and be 132 - * characters long (the ``0x`` prefix and 130 hexadecimal nibbles). - */ - get publicKey(): string; - /** - * The compressed public key. - * - * This will always begin with either the prefix ``0x02`` or ``0x03`` - * and be 68 characters long (the ``0x`` prefix and 33 hexadecimal - * nibbles) - */ - get compressedPublicKey(): string; - /** - * Return the signature of the signed %%digest%%. - */ - sign(digest: BytesLike): Signature; - /** - * Returns the [[link-wiki-ecdh]] shared secret between this - * private key and the %%other%% key. - * - * The %%other%% key may be any type of key, a raw public key, - * a compressed/uncompressed pubic key or aprivate key. - * - * Best practice is usually to use a cryptographic hash on the - * returned value before using it as a symetric secret. - * - * @example: - * sign1 = new SigningKey(id("some-secret-1")) - * sign2 = new SigningKey(id("some-secret-2")) - * - * // Notice that privA.computeSharedSecret(pubB)... - * sign1.computeSharedSecret(sign2.publicKey) - * //_result: - * - * // ...is equal to privB.computeSharedSecret(pubA). - * sign2.computeSharedSecret(sign1.publicKey) - * //_result: - */ - computeSharedSecret(other: BytesLike): string; - /** - * Compute the public key for %%key%%, optionally %%compressed%%. - * - * The %%key%% may be any type of key, a raw public key, a - * compressed/uncompressed public key or private key. - * - * @example: - * sign = new SigningKey(id("some-secret")); - * - * // Compute the uncompressed public key for a private key - * SigningKey.computePublicKey(sign.privateKey) - * //_result: - * - * // Compute the compressed public key for a private key - * SigningKey.computePublicKey(sign.privateKey, true) - * //_result: - * - * // Compute the uncompressed public key - * SigningKey.computePublicKey(sign.publicKey, false); - * //_result: - * - * // Compute the Compressed a public key - * SigningKey.computePublicKey(sign.publicKey, true); - * //_result: - */ - static computePublicKey(key: BytesLike, compressed?: boolean): string; - /** - * Returns the public key for the private key which produced the - * %%signature%% for the given %%digest%%. - * - * @example: - * key = new SigningKey(id("some-secret")) - * digest = id("hello world") - * sig = key.sign(digest) - * - * // Notice the signer public key... - * key.publicKey - * //_result: - * - * // ...is equal to the recovered public key - * SigningKey.recoverPublicKey(digest, sig) - * //_result: - * - */ - static recoverPublicKey(digest: BytesLike, signature: SignatureLike): string; - /** - * Returns the point resulting from adding the ellipic curve points - * %%p0%% and %%p1%%. - * - * This is not a common function most developers should require, but - * can be useful for certain privacy-specific techniques. - * - * For example, it is used by [[HDNodeWallet]] to compute child - * addresses from parent public keys and chain codes. - */ - static addPoints(p0: BytesLike, p1: BytesLike, compressed?: boolean): string; -} -//# sourceMappingURL=signing-key.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/signing-key.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/signing-key.d.ts.map deleted file mode 100644 index 6ce11800..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/signing-key.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signing-key.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/signing-key.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD;;;GAGG;AACH,qBAAa,UAAU;;IAGnB;;OAEG;gBACS,UAAU,EAAE,SAAS;IAKjC;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAA6B;IAErD;;;;;OAKG;IACH,IAAI,SAAS,IAAI,MAAM,CAA0D;IAEjF;;;;;;OAMG;IACH,IAAI,mBAAmB,IAAI,MAAM,CAAgE;IAEjG;;OAEG;IACH,IAAI,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS;IAclC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM;IAK7C;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM;IAqBrE;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,GAAG,MAAM;IAc5E;;;;;;;;;OASG;IACH,MAAM,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM;CAK/E"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/signing-key.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/signing-key.js deleted file mode 100644 index 7ab3d54e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/signing-key.js +++ /dev/null @@ -1,170 +0,0 @@ -"use strict"; -/** - * Add details about signing here. - * - * @_subsection: api/crypto:Signing [about-signing] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.SigningKey = void 0; -const secp256k1_1 = require("@noble/curves/secp256k1"); -const index_js_1 = require("../utils/index.js"); -const signature_js_1 = require("./signature.js"); -/** - * A **SigningKey** provides high-level access to the elliptic curve - * cryptography (ECC) operations and key management. - */ -class SigningKey { - #privateKey; - /** - * Creates a new **SigningKey** for %%privateKey%%. - */ - constructor(privateKey) { - (0, index_js_1.assertArgument)((0, index_js_1.dataLength)(privateKey) === 32, "invalid private key", "privateKey", "[REDACTED]"); - this.#privateKey = (0, index_js_1.hexlify)(privateKey); - } - /** - * The private key. - */ - get privateKey() { return this.#privateKey; } - /** - * The uncompressed public key. - * - * This will always begin with the prefix ``0x04`` and be 132 - * characters long (the ``0x`` prefix and 130 hexadecimal nibbles). - */ - get publicKey() { return SigningKey.computePublicKey(this.#privateKey); } - /** - * The compressed public key. - * - * This will always begin with either the prefix ``0x02`` or ``0x03`` - * and be 68 characters long (the ``0x`` prefix and 33 hexadecimal - * nibbles) - */ - get compressedPublicKey() { return SigningKey.computePublicKey(this.#privateKey, true); } - /** - * Return the signature of the signed %%digest%%. - */ - sign(digest) { - (0, index_js_1.assertArgument)((0, index_js_1.dataLength)(digest) === 32, "invalid digest length", "digest", digest); - const sig = secp256k1_1.secp256k1.sign((0, index_js_1.getBytesCopy)(digest), (0, index_js_1.getBytesCopy)(this.#privateKey), { - lowS: true - }); - return signature_js_1.Signature.from({ - r: (0, index_js_1.toBeHex)(sig.r, 32), - s: (0, index_js_1.toBeHex)(sig.s, 32), - v: (sig.recovery ? 0x1c : 0x1b) - }); - } - /** - * Returns the [[link-wiki-ecdh]] shared secret between this - * private key and the %%other%% key. - * - * The %%other%% key may be any type of key, a raw public key, - * a compressed/uncompressed pubic key or aprivate key. - * - * Best practice is usually to use a cryptographic hash on the - * returned value before using it as a symetric secret. - * - * @example: - * sign1 = new SigningKey(id("some-secret-1")) - * sign2 = new SigningKey(id("some-secret-2")) - * - * // Notice that privA.computeSharedSecret(pubB)... - * sign1.computeSharedSecret(sign2.publicKey) - * //_result: - * - * // ...is equal to privB.computeSharedSecret(pubA). - * sign2.computeSharedSecret(sign1.publicKey) - * //_result: - */ - computeSharedSecret(other) { - const pubKey = SigningKey.computePublicKey(other); - return (0, index_js_1.hexlify)(secp256k1_1.secp256k1.getSharedSecret((0, index_js_1.getBytesCopy)(this.#privateKey), (0, index_js_1.getBytes)(pubKey), false)); - } - /** - * Compute the public key for %%key%%, optionally %%compressed%%. - * - * The %%key%% may be any type of key, a raw public key, a - * compressed/uncompressed public key or private key. - * - * @example: - * sign = new SigningKey(id("some-secret")); - * - * // Compute the uncompressed public key for a private key - * SigningKey.computePublicKey(sign.privateKey) - * //_result: - * - * // Compute the compressed public key for a private key - * SigningKey.computePublicKey(sign.privateKey, true) - * //_result: - * - * // Compute the uncompressed public key - * SigningKey.computePublicKey(sign.publicKey, false); - * //_result: - * - * // Compute the Compressed a public key - * SigningKey.computePublicKey(sign.publicKey, true); - * //_result: - */ - static computePublicKey(key, compressed) { - let bytes = (0, index_js_1.getBytes)(key, "key"); - // private key - if (bytes.length === 32) { - const pubKey = secp256k1_1.secp256k1.getPublicKey(bytes, !!compressed); - return (0, index_js_1.hexlify)(pubKey); - } - // raw public key; use uncompressed key with 0x04 prefix - if (bytes.length === 64) { - const pub = new Uint8Array(65); - pub[0] = 0x04; - pub.set(bytes, 1); - bytes = pub; - } - const point = secp256k1_1.secp256k1.ProjectivePoint.fromHex(bytes); - return (0, index_js_1.hexlify)(point.toRawBytes(compressed)); - } - /** - * Returns the public key for the private key which produced the - * %%signature%% for the given %%digest%%. - * - * @example: - * key = new SigningKey(id("some-secret")) - * digest = id("hello world") - * sig = key.sign(digest) - * - * // Notice the signer public key... - * key.publicKey - * //_result: - * - * // ...is equal to the recovered public key - * SigningKey.recoverPublicKey(digest, sig) - * //_result: - * - */ - static recoverPublicKey(digest, signature) { - (0, index_js_1.assertArgument)((0, index_js_1.dataLength)(digest) === 32, "invalid digest length", "digest", digest); - const sig = signature_js_1.Signature.from(signature); - let secpSig = secp256k1_1.secp256k1.Signature.fromCompact((0, index_js_1.getBytesCopy)((0, index_js_1.concat)([sig.r, sig.s]))); - secpSig = secpSig.addRecoveryBit(sig.yParity); - const pubKey = secpSig.recoverPublicKey((0, index_js_1.getBytesCopy)(digest)); - (0, index_js_1.assertArgument)(pubKey != null, "invalid signature for digest", "signature", signature); - return "0x" + pubKey.toHex(false); - } - /** - * Returns the point resulting from adding the ellipic curve points - * %%p0%% and %%p1%%. - * - * This is not a common function most developers should require, but - * can be useful for certain privacy-specific techniques. - * - * For example, it is used by [[HDNodeWallet]] to compute child - * addresses from parent public keys and chain codes. - */ - static addPoints(p0, p1, compressed) { - const pub0 = secp256k1_1.secp256k1.ProjectivePoint.fromHex(SigningKey.computePublicKey(p0).substring(2)); - const pub1 = secp256k1_1.secp256k1.ProjectivePoint.fromHex(SigningKey.computePublicKey(p1).substring(2)); - return "0x" + pub0.add(pub1).toHex(!!compressed); - } -} -exports.SigningKey = SigningKey; -//# sourceMappingURL=signing-key.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/signing-key.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/signing-key.js.map deleted file mode 100644 index 78fd2c8c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/crypto/signing-key.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signing-key.js","sourceRoot":"","sources":["../../src.ts/crypto/signing-key.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,uDAAoD;AAEpD,gDAG2B;AAE3B,iDAA2C;AAO3C;;;GAGG;AACH,MAAa,UAAU;IACnB,WAAW,CAAS;IAEpB;;OAEG;IACH,YAAY,UAAqB;QAC7B,IAAA,yBAAc,EAAC,IAAA,qBAAU,EAAC,UAAU,CAAC,KAAK,EAAE,EAAE,qBAAqB,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;QACjG,IAAI,CAAC,WAAW,GAAG,IAAA,kBAAO,EAAC,UAAU,CAAC,CAAC;IAC3C,CAAC;IAED;;OAEG;IACH,IAAI,UAAU,KAAa,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IAErD;;;;;OAKG;IACH,IAAI,SAAS,KAAa,OAAO,UAAU,CAAC,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAEjF;;;;;;OAMG;IACH,IAAI,mBAAmB,KAAa,OAAO,UAAU,CAAC,gBAAgB,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IAEjG;;OAEG;IACH,IAAI,CAAC,MAAiB;QAClB,IAAA,yBAAc,EAAC,IAAA,qBAAU,EAAC,MAAM,CAAC,KAAK,EAAE,EAAE,uBAAuB,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QAErF,M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E,UAAoB;QAC/D,MAAM,IAAI,GAAG,qBAAS,CAAC,eAAe,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7F,MAAM,IAAI,GAAG,qBAAS,CAAC,eAAe,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7F,OAAO,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,CAAA;IACpD,CAAC;CACJ;AA1KD,gCA0KC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/ethers.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/ethers.d.ts deleted file mode 100644 index 11d3614e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/ethers.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -export { version } from "./_version.js"; -export { decodeBytes32String, encodeBytes32String, AbiCoder, ConstructorFragment, ErrorFragment, EventFragment, Fragment, FallbackFragment, FunctionFragment, NamedFragment, ParamType, StructFragment, checkResultErrors, ErrorDescription, Indexed, Interface, LogDescription, Result, TransactionDescription, Typed, } from "./abi/index.js"; -export { getAddress, getIcapAddress, getCreateAddress, getCreate2Address, isAddressable, isAddress, resolveAddress } from "./address/index.js"; -export { ZeroAddress, WeiPerEther, MaxUint256, MinInt256, MaxInt256, N, ZeroHash, EtherSymbol, MessagePrefix } from "./constants/index.js"; -export { BaseContract, Contract, ContractFactory, ContractEventPayload, ContractTransactionReceipt, ContractTransactionResponse, ContractUnknownEventPayload, EventLog, UndecodedEventLog } from "./contract/index.js"; -export { computeHmac, randomBytes, keccak256, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync, lock, Signature, SigningKey } from "./crypto/index.js"; -export { id, ensNormalize, isValidName, namehash, dnsEncode, hashAuthorization, verifyAuthorization, hashMessage, verifyMessage, solidityPacked, solidityPackedKeccak256, solidityPackedSha256, TypedDataEncoder, verifyTypedData } from "./hash/index.js"; -export { getDefaultProvider, Block, FeeData, Log, TransactionReceipt, TransactionResponse, AbstractSigner, NonceManager, VoidSigner, AbstractProvider, FallbackProvider, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, BrowserProvider, AlchemyProvider, AnkrProvider, BlockscoutProvider, ChainstackProvider, CloudflareProvider, EtherscanProvider, InfuraProvider, InfuraWebSocketProvider, PocketProvider, QuickNodeProvider, IpcSocketProvider, SocketProvider, WebSocketProvider, EnsResolver, Network, EnsPlugin, EtherscanPlugin, FeeDataNetworkPlugin, FetchUrlFeeDataNetworkPlugin, GasCostPlugin, NetworkPlugin, MulticoinProviderPlugin, SocketBlockSubscriber, SocketEventSubscriber, SocketPendingSubscriber, SocketSubscriber, UnmanagedSubscriber, copyRequest, showThrottleMessage } from "./providers/index.js"; -export { accessListify, authorizationify, computeAddress, recoverAddress, Transaction } from "./transaction/index.js"; -export { decodeBase58, encodeBase58, decodeBase64, encodeBase64, concat, dataLength, dataSlice, getBytes, getBytesCopy, hexlify, isHexString, isBytesLike, stripZerosLeft, zeroPadBytes, zeroPadValue, defineProperties, resolveProperties, assert, assertArgument, assertArgumentCount, assertNormalize, assertPrivate, makeError, isCallException, isError, EventPayload, FetchRequest, FetchResponse, FetchCancelSignal, FixedNumber, getBigInt, getNumber, getUint, toBeArray, toBigInt, toBeHex, toNumber, toQuantity, fromTwos, toTwos, mask, formatEther, parseEther, formatUnits, parseUnits, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, decodeRlp, encodeRlp, uuidV4, } from "./utils/index.js"; -export { Mnemonic, BaseWallet, HDNodeWallet, HDNodeVoidWallet, Wallet, defaultPath, getAccountPath, getIndexedAccountPath, isCrowdsaleJson, isKeystoreJson, decryptCrowdsaleJson, decryptKeystoreJsonSync, decryptKeystoreJson, encryptKeystoreJson, encryptKeystoreJsonSync, } from "./wallet/index.js"; -export { Wordlist, LangEn, WordlistOwl, WordlistOwlA, wordlists } from "./wordlists/index.js"; -export type { JsonFragment, JsonFragmentType, FormatType, FragmentType, InterfaceAbi, ParamTypeWalkFunc, ParamTypeWalkAsyncFunc } from "./abi/index.js"; -export type { Addressable, AddressLike, NameResolver } from "./address/index.js"; -export type { ConstantContractMethod, ContractEvent, ContractEventArgs, ContractEventName, ContractInterface, ContractMethod, ContractMethodArgs, ContractTransaction, DeferredTopicFilter, Overrides, BaseContractMethod, ContractDeployTransaction, PostfixOverrides, WrappedFallback } from "./contract/index.js"; -export type { ProgressCallback, SignatureLike } from "./crypto/index.js"; -export type { AuthorizationRequest, TypedDataDomain, TypedDataField } from "./hash/index.js"; -export type { Provider, Signer, CommunityResourcable, AbstractProviderOptions, BrowserProviderOptions, FallbackProviderOptions, AbstractProviderPlugin, BlockParams, BlockTag, BrowserDiscoverOptions, ContractRunner, DebugEventBrowserProvider, Eip1193Provider, Eip6963ProviderInfo, EventFilter, Filter, FilterByBlockHash, GasCostParameters, JsonRpcApiProviderOptions, JsonRpcError, JsonRpcPayload, JsonRpcResult, JsonRpcTransactionRequest, LogParams, MinedBlock, MinedTransactionResponse, Networkish, OrphanFilter, PerformActionFilter, PerformActionRequest, PerformActionTransaction, PreparedTransactionRequest, ProviderEvent, Subscriber, Subscription, TopicFilter, TransactionReceiptParams, TransactionRequest, TransactionResponseParams, WebSocketCreator, WebSocketLike } from "./providers/index.js"; -export type { AccessList, AccessListish, AccessListEntry, Authorization, AuthorizationLike, Blob, BlobLike, KzgLibrary, KzgLibraryLike, TransactionLike } from "./transaction/index.js"; -export type { BytesLike, BigNumberish, Numeric, ErrorCode, FixedFormat, Utf8ErrorFunc, UnicodeNormalizationForm, Utf8ErrorReason, RlpStructuredData, RlpStructuredDataish, GetUrlResponse, FetchPreflightFunc, FetchProcessFunc, FetchRetryFunc, FetchGatewayFunc, FetchGetUrlFunc, EthersError, UnknownError, NotImplementedError, UnsupportedOperationError, NetworkError, ServerError, TimeoutError, BadDataError, CancelledError, BufferOverrunError, NumericFaultError, InvalidArgumentError, MissingArgumentError, UnexpectedArgumentError, CallExceptionError, InsufficientFundsError, NonceExpiredError, OffchainFaultError, ReplacementUnderpricedError, TransactionReplacedError, UnconfiguredNameError, ActionRejectedError, CodedEthersError, CallExceptionAction, CallExceptionTransaction, EventEmitterable, Listener } from "./utils/index.js"; -export type { CrowdsaleAccount, KeystoreAccount, EncryptOptions } from "./wallet/index.js"; -//# sourceMappingURL=ethers.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/ethers.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/ethers.d.ts.map deleted file mode 100644 index d7cab7f1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/ethers.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ethers.d.ts","sourceRoot":"","sources":["../src.ts/ethers.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EACH,mBAAmB,EAAE,mBAAmB,EAExC,QAAQ,EACR,mBAAmB,EAAE,aAAa,EAAE,aAAa,EAAE,QAAQ,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAEzI,iBAAiB,EAAE,gBAAgB,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,sBAAsB,EACvG,KAAK,GACR,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACH,UAAU,EAAE,cAAc,EAC1B,gBAAgB,EAAE,iBAAiB,EACnC,aAAa,EAAE,SAAS,EAAE,cAAc,EAC3C,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACH,WAAW,EACX,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,EAChD,QAAQ,EACR,WAAW,EA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hC,YAAY,EACR,SAAS,EACT,YAAY,EAAE,OAAO,EACrB,SAAS,EACT,WAAW,EACX,aAAa,EAAE,wBAAwB,EAAE,eAAe,EACxD,iBAAiB,EAAE,oBAAoB,EAEvC,cAAc,EACd,kBAAkB,EAAE,gBAAgB,EAAE,cAAc,EACpD,gBAAgB,EAAE,eAAe,EAEjC,WAAW,EAAE,YAAY,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,YAAY,EACvF,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAC3E,iBAAiB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,uBAAuB,EACtF,kBAAkB,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,kBAAkB,EACjF,2BAA2B,EAAE,wBAAwB,EAAE,qBAAqB,EAC5E,mBAAmB,EACnB,gBAAgB,EAEhB,mBAAmB,EAAE,wBAAwB,EAC7C,gBAAgB,EAAE,QAAQ,EAC7B,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACR,gBAAgB,EAAE,eAAe,EAAE,cAAc,EACpD,MAAM,mBAAmB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/ethers.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/ethers.js deleted file mode 100644 index 5a1e0589..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/ethers.js +++ /dev/null @@ -1,215 +0,0 @@ -"use strict"; -///////////////////////////// -// -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ripemd160 = exports.keccak256 = exports.randomBytes = exports.computeHmac = exports.UndecodedEventLog = exports.EventLog = exports.ContractUnknownEventPayload = exports.ContractTransactionResponse = exports.ContractTransactionReceipt = exports.ContractEventPayload = exports.ContractFactory = exports.Contract = exports.BaseContract = exports.MessagePrefix = exports.EtherSymbol = exports.ZeroHash = exports.N = exports.MaxInt256 = exports.MinInt256 = exports.MaxUint256 = exports.WeiPerEther = exports.ZeroAddress = exports.resolveAddress = exports.isAddress = exports.isAddressable = exports.getCreate2Address = exports.getCreateAddress = exports.getIcapAddress = exports.getAddress = exports.Typed = exports.TransactionDescription = exports.Result = exports.LogDescription = exports.Interface = exports.Indexed = exports.ErrorDescription = exports.checkResultErrors = exports.StructFragment = exports.ParamType = exports.NamedFragment = exports.FunctionFragment = exports.FallbackFragment = exports.Fragment = exports.EventFragment = exports.ErrorFragment = exports.ConstructorFragment = exports.AbiCoder = exports.encodeBytes32String = exports.decodeBytes32String = exports.version = void 0; -exports.WebSocketProvider = exports.SocketProvider = exports.IpcSocketProvider = exports.QuickNodeProvider = exports.PocketProvider = exports.InfuraWebSocketProvider = exports.InfuraProvider = exports.EtherscanProvider = exports.CloudflareProvider = exports.ChainstackProvider = exports.BlockscoutProvider = exports.AnkrProvider = exports.AlchemyProvider = exports.BrowserProvider = exports.JsonRpcSigner = exports.JsonRpcProvider = exports.JsonRpcApiProvider = exports.FallbackProvider = exports.AbstractProvider = exports.VoidSigner = exports.NonceManager = exports.AbstractSigner = exports.TransactionResponse = exports.TransactionReceipt = exports.Log = exports.FeeData = exports.Block = exports.getDefaultProvider = exports.verifyTypedData = exports.TypedDataEncoder = exports.solidityPackedSha256 = exports.solidityPackedKeccak256 = exports.solidityPacked = exports.verifyMessage = exports.hashMessage = exports.verifyAuthorization = exports.hashAuthorization = exports.dnsEncode = exports.namehash = exports.isValidName = exports.ensNormalize = exports.id = exports.SigningKey = exports.Signature = exports.lock = exports.scryptSync = exports.scrypt = exports.pbkdf2 = exports.sha512 = exports.sha256 = void 0; -exports.FetchCancelSignal = exports.FetchResponse = exports.FetchRequest = exports.EventPayload = exports.isError = exports.isCallException = exports.makeError = exports.assertPrivate = exports.assertNormalize = exports.assertArgumentCount = exports.assertArgument = exports.assert = exports.resolveProperties = exports.defineProperties = exports.zeroPadValue = exports.zeroPadBytes = exports.stripZerosLeft = exports.isBytesLike = exports.isHexString = exports.hexlify = exports.getBytesCopy = exports.getBytes = exports.dataSlice = exports.dataLength = exports.concat = exports.encodeBase64 = exports.decodeBase64 = exports.encodeBase58 = exports.decodeBase58 = exports.Transaction = exports.recoverAddress = exports.computeAddress = exports.authorizationify = exports.accessListify = exports.showThrottleMessage = exports.copyRequest = exports.UnmanagedSubscriber = exports.SocketSubscriber = exports.SocketPendingSubscriber = exports.SocketEventSubscriber = exports.SocketBlockSubscriber = exports.MulticoinProviderPlugin = exports.NetworkPlugin = exports.GasCostPlugin = exports.FetchUrlFeeDataNetworkPlugin = exports.FeeDataNetworkPlugin = exports.EtherscanPlugin = exports.EnsPlugin = exports.Network = exports.EnsResolver = void 0; -exports.wordlists = exports.WordlistOwlA = exports.WordlistOwl = exports.LangEn = exports.Wordlist = exports.encryptKeystoreJsonSync = exports.encryptKeystoreJson = exports.decryptKeystoreJson = exports.decryptKeystoreJsonSync = exports.decryptCrowdsaleJson = exports.isKeystoreJson = exports.isCrowdsaleJson = exports.getIndexedAccountPath = exports.getAccountPath = exports.defaultPath = exports.Wallet = exports.HDNodeVoidWallet = exports.HDNodeWallet = exports.BaseWallet = exports.Mnemonic = exports.uuidV4 = exports.encodeRlp = exports.decodeRlp = exports.Utf8ErrorFuncs = exports.toUtf8String = exports.toUtf8CodePoints = exports.toUtf8Bytes = exports.parseUnits = exports.formatUnits = exports.parseEther = exports.formatEther = exports.mask = exports.toTwos = exports.fromTwos = exports.toQuantity = exports.toNumber = exports.toBeHex = exports.toBigInt = exports.toBeArray = exports.getUint = exports.getNumber = exports.getBigInt = exports.FixedNumber = void 0; -var _version_js_1 = require("./_version.js"); -Object.defineProperty(exports, "version", { enumerable: true, get: function () { return _version_js_1.version; } }); -var index_js_1 = require("./abi/index.js"); -Object.defineProperty(exports, "decodeBytes32String", { enumerable: true, get: function () { return index_js_1.decodeBytes32String; } }); -Object.defineProperty(exports, "encodeBytes32String", { enumerable: true, get: function () { return index_js_1.encodeBytes32String; } }); -Object.defineProperty(exports, "AbiCoder", { enumerable: true, get: function () { return index_js_1.AbiCoder; } }); -Object.defineProperty(exports, "ConstructorFragment", { enumerable: true, get: function () { return index_js_1.ConstructorFragment; } }); -Object.defineProperty(exports, "ErrorFragment", { enumerable: true, get: function () { return index_js_1.ErrorFragment; } }); -Object.defineProperty(exports, "EventFragment", { enumerable: true, get: function () { return index_js_1.EventFragment; } }); -Object.defineProperty(exports, "Fragment", { enumerable: true, get: function () { return index_js_1.Fragment; } }); -Object.defineProperty(exports, "FallbackFragment", { enumerable: true, get: function () { return index_js_1.FallbackFragment; } }); -Object.defineProperty(exports, "FunctionFragment", { enumerable: true, get: function () { return index_js_1.FunctionFragment; } }); -Object.defineProperty(exports, "NamedFragment", { enumerable: true, get: function () { return index_js_1.NamedFragment; } }); -Object.defineProperty(exports, "ParamType", { enumerable: true, get: function () { return index_js_1.ParamType; } }); -Object.defineProperty(exports, "StructFragment", { enumerable: true, get: function () { return index_js_1.StructFragment; } }); -Object.defineProperty(exports, "checkResultErrors", { enumerable: true, get: function () { return index_js_1.checkResultErrors; } }); -Object.defineProperty(exports, "ErrorDescription", { enumerable: true, get: function () { return index_js_1.ErrorDescription; } }); -Object.defineProperty(exports, "Indexed", { enumerable: true, get: function () { return index_js_1.Indexed; } }); -Object.defineProperty(exports, "Interface", { enumerable: true, get: function () { return index_js_1.Interface; } }); -Object.defineProperty(exports, "LogDescription", { enumerable: true, get: function () { return index_js_1.LogDescription; } }); -Object.defineProperty(exports, "Result", { enumerable: true, get: function () { return index_js_1.Result; } }); -Object.defineProperty(exports, "TransactionDescription", { enumerable: true, get: function () { return index_js_1.TransactionDescription; } }); -Object.defineProperty(exports, "Typed", { enumerable: true, get: function () { return index_js_1.Typed; } }); -var index_js_2 = require("./address/index.js"); -Object.defineProperty(exports, "getAddress", { enumerable: true, get: function () { return index_js_2.getAddress; } }); -Object.defineProperty(exports, "getIcapAddress", { enumerable: true, get: function () { return index_js_2.getIcapAddress; } }); -Object.defineProperty(exports, "getCreateAddress", { enumerable: true, get: function () { return index_js_2.getCreateAddress; } }); -Object.defineProperty(exports, "getCreate2Address", { enumerable: true, get: function () { return index_js_2.getCreate2Address; } }); -Object.defineProperty(exports, "isAddressable", { enumerable: true, get: function () { return index_js_2.isAddressable; } }); -Object.defineProperty(exports, "isAddress", { enumerable: true, get: function () { return index_js_2.isAddress; } }); -Object.defineProperty(exports, "resolveAddress", { enumerable: true, get: function () { return index_js_2.resolveAddress; } }); -var index_js_3 = require("./constants/index.js"); -Object.defineProperty(exports, "ZeroAddress", { enumerable: true, get: function () { return index_js_3.ZeroAddress; } }); -Object.defineProperty(exports, "WeiPerEther", { enumerable: true, get: function () { return index_js_3.WeiPerEther; } }); -Object.defineProperty(exports, "MaxUint256", { enumerable: true, get: function () { return index_js_3.MaxUint256; } }); -Object.defineProperty(exports, "MinInt256", { enumerable: true, get: function () { return index_js_3.MinInt256; } }); -Object.defineProperty(exports, "MaxInt256", { enumerable: true, get: function () { return index_js_3.MaxInt256; } }); -Object.defineProperty(exports, "N", { enumerable: true, get: function () { return index_js_3.N; } }); -Object.defineProperty(exports, "ZeroHash", { enumerable: true, get: function () { return index_js_3.ZeroHash; } }); -Object.defineProperty(exports, "EtherSymbol", { enumerable: true, get: function () { return index_js_3.EtherSymbol; } }); -Object.defineProperty(exports, "MessagePrefix", { enumerable: true, get: function () { return index_js_3.MessagePrefix; } }); -var index_js_4 = require("./contract/index.js"); -Object.defineProperty(exports, "BaseContract", { enumerable: true, get: function () { return index_js_4.BaseContract; } }); -Object.defineProperty(exports, "Contract", { enumerable: true, get: function () { return index_js_4.Contract; } }); -Object.defineProperty(exports, "ContractFactory", { enumerable: true, get: function () { return index_js_4.ContractFactory; } }); -Object.defineProperty(exports, "ContractEventPayload", { enumerable: true, get: function () { return index_js_4.ContractEventPayload; } }); -Object.defineProperty(exports, "ContractTransactionReceipt", { enumerable: true, get: function () { return index_js_4.ContractTransactionReceipt; } }); -Object.defineProperty(exports, "ContractTransactionResponse", { enumerable: true, get: function () { return index_js_4.ContractTransactionResponse; } }); -Object.defineProperty(exports, "ContractUnknownEventPayload", { enumerable: true, get: function () { return index_js_4.ContractUnknownEventPayload; } }); -Object.defineProperty(exports, "EventLog", { enumerable: true, get: function () { return index_js_4.EventLog; } }); -Object.defineProperty(exports, "UndecodedEventLog", { enumerable: true, get: function () { return index_js_4.UndecodedEventLog; } }); -var index_js_5 = require("./crypto/index.js"); -Object.defineProperty(exports, "computeHmac", { enumerable: true, get: function () { return index_js_5.computeHmac; } }); -Object.defineProperty(exports, "randomBytes", { enumerable: true, get: function () { return index_js_5.randomBytes; } }); -Object.defineProperty(exports, "keccak256", { enumerable: true, get: function () { return index_js_5.keccak256; } }); -Object.defineProperty(exports, "ripemd160", { enumerable: true, get: function () { return index_js_5.ripemd160; } }); -Object.defineProperty(exports, "sha256", { enumerable: true, get: function () { return index_js_5.sha256; } }); -Object.defineProperty(exports, "sha512", { enumerable: true, get: function () { return index_js_5.sha512; } }); -Object.defineProperty(exports, "pbkdf2", { enumerable: true, get: function () { return index_js_5.pbkdf2; } }); -Object.defineProperty(exports, "scrypt", { enumerable: true, get: function () { return index_js_5.scrypt; } }); -Object.defineProperty(exports, "scryptSync", { enumerable: true, get: function () { return index_js_5.scryptSync; } }); -Object.defineProperty(exports, "lock", { enumerable: true, get: function () { return index_js_5.lock; } }); -Object.defineProperty(exports, "Signature", { enumerable: true, get: function () { return index_js_5.Signature; } }); -Object.defineProperty(exports, "SigningKey", { enumerable: true, get: function () { return index_js_5.SigningKey; } }); -var index_js_6 = require("./hash/index.js"); -Object.defineProperty(exports, "id", { enumerable: true, get: function () { return index_js_6.id; } }); -Object.defineProperty(exports, "ensNormalize", { enumerable: true, get: function () { return index_js_6.ensNormalize; } }); -Object.defineProperty(exports, "isValidName", { enumerable: true, get: function () { return index_js_6.isValidName; } }); -Object.defineProperty(exports, "namehash", { enumerable: true, get: function () { return index_js_6.namehash; } }); -Object.defineProperty(exports, "dnsEncode", { enumerable: true, get: function () { return index_js_6.dnsEncode; } }); -Object.defineProperty(exports, "hashAuthorization", { enumerable: true, get: function () { return index_js_6.hashAuthorization; } }); -Object.defineProperty(exports, "verifyAuthorization", { enumerable: true, get: function () { return index_js_6.verifyAuthorization; } }); -Object.defineProperty(exports, "hashMessage", { enumerable: true, get: function () { return index_js_6.hashMessage; } }); -Object.defineProperty(exports, "verifyMessage", { enumerable: true, get: function () { return index_js_6.verifyMessage; } }); -Object.defineProperty(exports, "solidityPacked", { enumerable: true, get: function () { return index_js_6.solidityPacked; } }); -Object.defineProperty(exports, "solidityPackedKeccak256", { enumerable: true, get: function () { return index_js_6.solidityPackedKeccak256; } }); -Object.defineProperty(exports, "solidityPackedSha256", { enumerable: true, get: function () { return index_js_6.solidityPackedSha256; } }); -Object.defineProperty(exports, "TypedDataEncoder", { enumerable: true, get: function () { return index_js_6.TypedDataEncoder; } }); -Object.defineProperty(exports, "verifyTypedData", { enumerable: true, get: function () { return index_js_6.verifyTypedData; } }); -var index_js_7 = require("./providers/index.js"); -Object.defineProperty(exports, "getDefaultProvider", { enumerable: true, get: function () { return index_js_7.getDefaultProvider; } }); -Object.defineProperty(exports, "Block", { enumerable: true, get: function () { return index_js_7.Block; } }); -Object.defineProperty(exports, "FeeData", { enumerable: true, get: function () { return index_js_7.FeeData; } }); -Object.defineProperty(exports, "Log", { enumerable: true, get: function () { return index_js_7.Log; } }); -Object.defineProperty(exports, "TransactionReceipt", { enumerable: true, get: function () { return index_js_7.TransactionReceipt; } }); -Object.defineProperty(exports, "TransactionResponse", { enumerable: true, get: function () { return index_js_7.TransactionResponse; } }); -Object.defineProperty(exports, "AbstractSigner", { enumerable: true, get: function () { return index_js_7.AbstractSigner; } }); -Object.defineProperty(exports, "NonceManager", { enumerable: true, get: function () { return index_js_7.NonceManager; } }); -Object.defineProperty(exports, "VoidSigner", { enumerable: true, get: function () { return index_js_7.VoidSigner; } }); -Object.defineProperty(exports, "AbstractProvider", { enumerable: true, get: function () { return index_js_7.AbstractProvider; } }); -Object.defineProperty(exports, "FallbackProvider", { enumerable: true, get: function () { return index_js_7.FallbackProvider; } }); -Object.defineProperty(exports, "JsonRpcApiProvider", { enumerable: true, get: function () { return index_js_7.JsonRpcApiProvider; } }); -Object.defineProperty(exports, "JsonRpcProvider", { enumerable: true, get: function () { return index_js_7.JsonRpcProvider; } }); -Object.defineProperty(exports, "JsonRpcSigner", { enumerable: true, get: function () { return index_js_7.JsonRpcSigner; } }); -Object.defineProperty(exports, "BrowserProvider", { enumerable: true, get: function () { return index_js_7.BrowserProvider; } }); -Object.defineProperty(exports, "AlchemyProvider", { enumerable: true, get: function () { return index_js_7.AlchemyProvider; } }); -Object.defineProperty(exports, "AnkrProvider", { enumerable: true, get: function () { return index_js_7.AnkrProvider; } }); -Object.defineProperty(exports, "BlockscoutProvider", { enumerable: true, get: function () { return index_js_7.BlockscoutProvider; } }); -Object.defineProperty(exports, "ChainstackProvider", { enumerable: true, get: function () { return index_js_7.ChainstackProvider; } }); -Object.defineProperty(exports, "CloudflareProvider", { enumerable: true, get: function () { return index_js_7.CloudflareProvider; } }); -Object.defineProperty(exports, "EtherscanProvider", { enumerable: true, get: function () { return index_js_7.EtherscanProvider; } }); -Object.defineProperty(exports, "InfuraProvider", { enumerable: true, get: function () { return index_js_7.InfuraProvider; } }); -Object.defineProperty(exports, "InfuraWebSocketProvider", { enumerable: true, get: function () { return index_js_7.InfuraWebSocketProvider; } }); -Object.defineProperty(exports, "PocketProvider", { enumerable: true, get: function () { return index_js_7.PocketProvider; } }); -Object.defineProperty(exports, "QuickNodeProvider", { enumerable: true, get: function () { return index_js_7.QuickNodeProvider; } }); -Object.defineProperty(exports, "IpcSocketProvider", { enumerable: true, get: function () { return index_js_7.IpcSocketProvider; } }); -Object.defineProperty(exports, "SocketProvider", { enumerable: true, get: function () { return index_js_7.SocketProvider; } }); -Object.defineProperty(exports, "WebSocketProvider", { enumerable: true, get: function () { return index_js_7.WebSocketProvider; } }); -Object.defineProperty(exports, "EnsResolver", { enumerable: true, get: function () { return index_js_7.EnsResolver; } }); -Object.defineProperty(exports, "Network", { enumerable: true, get: function () { return index_js_7.Network; } }); -Object.defineProperty(exports, "EnsPlugin", { enumerable: true, get: function () { return index_js_7.EnsPlugin; } }); -Object.defineProperty(exports, "EtherscanPlugin", { enumerable: true, get: function () { return index_js_7.EtherscanPlugin; } }); -Object.defineProperty(exports, "FeeDataNetworkPlugin", { enumerable: true, get: function () { return index_js_7.FeeDataNetworkPlugin; } }); -Object.defineProperty(exports, "FetchUrlFeeDataNetworkPlugin", { enumerable: true, get: function () { return index_js_7.FetchUrlFeeDataNetworkPlugin; } }); -Object.defineProperty(exports, "GasCostPlugin", { enumerable: true, get: function () { return index_js_7.GasCostPlugin; } }); -Object.defineProperty(exports, "NetworkPlugin", { enumerable: true, get: function () { return index_js_7.NetworkPlugin; } }); -Object.defineProperty(exports, "MulticoinProviderPlugin", { enumerable: true, get: function () { return index_js_7.MulticoinProviderPlugin; } }); -Object.defineProperty(exports, "SocketBlockSubscriber", { enumerable: true, get: function () { return index_js_7.SocketBlockSubscriber; } }); -Object.defineProperty(exports, "SocketEventSubscriber", { enumerable: true, get: function () { return index_js_7.SocketEventSubscriber; } }); -Object.defineProperty(exports, "SocketPendingSubscriber", { enumerable: true, get: function () { return index_js_7.SocketPendingSubscriber; } }); -Object.defineProperty(exports, "SocketSubscriber", { enumerable: true, get: function () { return index_js_7.SocketSubscriber; } }); -Object.defineProperty(exports, "UnmanagedSubscriber", { enumerable: true, get: function () { return index_js_7.UnmanagedSubscriber; } }); -Object.defineProperty(exports, "copyRequest", { enumerable: true, get: function () { return index_js_7.copyRequest; } }); -Object.defineProperty(exports, "showThrottleMessage", { enumerable: true, get: function () { return index_js_7.showThrottleMessage; } }); -var index_js_8 = require("./transaction/index.js"); -Object.defineProperty(exports, "accessListify", { enumerable: true, get: function () { return index_js_8.accessListify; } }); -Object.defineProperty(exports, "authorizationify", { enumerable: true, get: function () { return index_js_8.authorizationify; } }); -Object.defineProperty(exports, "computeAddress", { enumerable: true, get: function () { return index_js_8.computeAddress; } }); -Object.defineProperty(exports, "recoverAddress", { enumerable: true, get: function () { return index_js_8.recoverAddress; } }); -Object.defineProperty(exports, "Transaction", { enumerable: true, get: function () { return index_js_8.Transaction; } }); -var index_js_9 = require("./utils/index.js"); -Object.defineProperty(exports, "decodeBase58", { enumerable: true, get: function () { return index_js_9.decodeBase58; } }); -Object.defineProperty(exports, "encodeBase58", { enumerable: true, get: function () { return index_js_9.encodeBase58; } }); -Object.defineProperty(exports, "decodeBase64", { enumerable: true, get: function () { return index_js_9.decodeBase64; } }); -Object.defineProperty(exports, "encodeBase64", { enumerable: true, get: function () { return index_js_9.encodeBase64; } }); -Object.defineProperty(exports, "concat", { enumerable: true, get: function () { return index_js_9.concat; } }); -Object.defineProperty(exports, "dataLength", { enumerable: true, get: function () { return index_js_9.dataLength; } }); -Object.defineProperty(exports, "dataSlice", { enumerable: true, get: function () { return index_js_9.dataSlice; } }); -Object.defineProperty(exports, "getBytes", { enumerable: true, get: function () { return index_js_9.getBytes; } }); -Object.defineProperty(exports, "getBytesCopy", { enumerable: true, get: function () { return index_js_9.getBytesCopy; } }); -Object.defineProperty(exports, "hexlify", { enumerable: true, get: function () { return index_js_9.hexlify; } }); -Object.defineProperty(exports, "isHexString", { enumerable: true, get: function () { return index_js_9.isHexString; } }); -Object.defineProperty(exports, "isBytesLike", { enumerable: true, get: function () { return index_js_9.isBytesLike; } }); -Object.defineProperty(exports, "stripZerosLeft", { enumerable: true, get: function () { return index_js_9.stripZerosLeft; } }); -Object.defineProperty(exports, "zeroPadBytes", { enumerable: true, get: function () { return index_js_9.zeroPadBytes; } }); -Object.defineProperty(exports, "zeroPadValue", { enumerable: true, get: function () { return index_js_9.zeroPadValue; } }); -Object.defineProperty(exports, "defineProperties", { enumerable: true, get: function () { return index_js_9.defineProperties; } }); -Object.defineProperty(exports, "resolveProperties", { enumerable: true, get: function () { return index_js_9.resolveProperties; } }); -Object.defineProperty(exports, "assert", { enumerable: true, get: function () { return index_js_9.assert; } }); -Object.defineProperty(exports, "assertArgument", { enumerable: true, get: function () { return index_js_9.assertArgument; } }); -Object.defineProperty(exports, "assertArgumentCount", { enumerable: true, get: function () { return index_js_9.assertArgumentCount; } }); -Object.defineProperty(exports, "assertNormalize", { enumerable: true, get: function () { return index_js_9.assertNormalize; } }); -Object.defineProperty(exports, "assertPrivate", { enumerable: true, get: function () { return index_js_9.assertPrivate; } }); -Object.defineProperty(exports, "makeError", { enumerable: true, get: function () { return index_js_9.makeError; } }); -Object.defineProperty(exports, "isCallException", { enumerable: true, get: function () { return index_js_9.isCallException; } }); -Object.defineProperty(exports, "isError", { enumerable: true, get: function () { return index_js_9.isError; } }); -Object.defineProperty(exports, "EventPayload", { enumerable: true, get: function () { return index_js_9.EventPayload; } }); -Object.defineProperty(exports, "FetchRequest", { enumerable: true, get: function () { return index_js_9.FetchRequest; } }); -Object.defineProperty(exports, "FetchResponse", { enumerable: true, get: function () { return index_js_9.FetchResponse; } }); -Object.defineProperty(exports, "FetchCancelSignal", { enumerable: true, get: function () { return index_js_9.FetchCancelSignal; } }); -Object.defineProperty(exports, "FixedNumber", { enumerable: true, get: function () { return index_js_9.FixedNumber; } }); -Object.defineProperty(exports, "getBigInt", { enumerable: true, get: function () { return index_js_9.getBigInt; } }); -Object.defineProperty(exports, "getNumber", { enumerable: true, get: function () { return index_js_9.getNumber; } }); -Object.defineProperty(exports, "getUint", { enumerable: true, get: function () { return index_js_9.getUint; } }); -Object.defineProperty(exports, "toBeArray", { enumerable: true, get: function () { return index_js_9.toBeArray; } }); -Object.defineProperty(exports, "toBigInt", { enumerable: true, get: function () { return index_js_9.toBigInt; } }); -Object.defineProperty(exports, "toBeHex", { enumerable: true, get: function () { return index_js_9.toBeHex; } }); -Object.defineProperty(exports, "toNumber", { enumerable: true, get: function () { return index_js_9.toNumber; } }); -Object.defineProperty(exports, "toQuantity", { enumerable: true, get: function () { return index_js_9.toQuantity; } }); -Object.defineProperty(exports, "fromTwos", { enumerable: true, get: function () { return index_js_9.fromTwos; } }); -Object.defineProperty(exports, "toTwos", { enumerable: true, get: function () { return index_js_9.toTwos; } }); -Object.defineProperty(exports, "mask", { enumerable: true, get: function () { return index_js_9.mask; } }); -Object.defineProperty(exports, "formatEther", { enumerable: true, get: function () { return index_js_9.formatEther; } }); -Object.defineProperty(exports, "parseEther", { enumerable: true, get: function () { return index_js_9.parseEther; } }); -Object.defineProperty(exports, "formatUnits", { enumerable: true, get: function () { return index_js_9.formatUnits; } }); -Object.defineProperty(exports, "parseUnits", { enumerable: true, get: function () { return index_js_9.parseUnits; } }); -Object.defineProperty(exports, "toUtf8Bytes", { enumerable: true, get: function () { return index_js_9.toUtf8Bytes; } }); -Object.defineProperty(exports, "toUtf8CodePoints", { enumerable: true, get: function () { return index_js_9.toUtf8CodePoints; } }); -Object.defineProperty(exports, "toUtf8String", { enumerable: true, get: function () { return index_js_9.toUtf8String; } }); -Object.defineProperty(exports, "Utf8ErrorFuncs", { enumerable: true, get: function () { return index_js_9.Utf8ErrorFuncs; } }); -Object.defineProperty(exports, "decodeRlp", { enumerable: true, get: function () { return index_js_9.decodeRlp; } }); -Object.defineProperty(exports, "encodeRlp", { enumerable: true, get: function () { return index_js_9.encodeRlp; } }); -Object.defineProperty(exports, "uuidV4", { enumerable: true, get: function () { return index_js_9.uuidV4; } }); -var index_js_10 = require("./wallet/index.js"); -Object.defineProperty(exports, "Mnemonic", { enumerable: true, get: function () { return index_js_10.Mnemonic; } }); -Object.defineProperty(exports, "BaseWallet", { enumerable: true, get: function () { return index_js_10.BaseWallet; } }); -Object.defineProperty(exports, "HDNodeWallet", { enumerable: true, get: function () { return index_js_10.HDNodeWallet; } }); -Object.defineProperty(exports, "HDNodeVoidWallet", { enumerable: true, get: function () { return index_js_10.HDNodeVoidWallet; } }); -Object.defineProperty(exports, "Wallet", { enumerable: true, get: function () { return index_js_10.Wallet; } }); -Object.defineProperty(exports, "defaultPath", { enumerable: true, get: function () { return index_js_10.defaultPath; } }); -Object.defineProperty(exports, "getAccountPath", { enumerable: true, get: function () { return index_js_10.getAccountPath; } }); -Object.defineProperty(exports, "getIndexedAccountPath", { enumerable: true, get: function () { return index_js_10.getIndexedAccountPath; } }); -Object.defineProperty(exports, "isCrowdsaleJson", { enumerable: true, get: function () { return index_js_10.isCrowdsaleJson; } }); -Object.defineProperty(exports, "isKeystoreJson", { enumerable: true, get: function () { return index_js_10.isKeystoreJson; } }); -Object.defineProperty(exports, "decryptCrowdsaleJson", { enumerable: true, get: function () { return index_js_10.decryptCrowdsaleJson; } }); -Object.defineProperty(exports, "decryptKeystoreJsonSync", { enumerable: true, get: function () { return index_js_10.decryptKeystoreJsonSync; } }); -Object.defineProperty(exports, "decryptKeystoreJson", { enumerable: true, get: function () { return index_js_10.decryptKeystoreJson; } }); -Object.defineProperty(exports, "encryptKeystoreJson", { enumerable: true, get: function () { return index_js_10.encryptKeystoreJson; } }); -Object.defineProperty(exports, "encryptKeystoreJsonSync", { enumerable: true, get: function () { return index_js_10.encryptKeystoreJsonSync; } }); -var index_js_11 = require("./wordlists/index.js"); -Object.defineProperty(exports, "Wordlist", { enumerable: true, get: function () { return index_js_11.Wordlist; } }); -Object.defineProperty(exports, "LangEn", { enumerable: true, get: function () { return index_js_11.LangEn; } }); -Object.defineProperty(exports, "WordlistOwl", { enumerable: true, get: function () { return index_js_11.WordlistOwl; } }); -Object.defineProperty(exports, "WordlistOwlA", { enumerable: true, get: function () { return index_js_11.WordlistOwlA; } }); -Object.defineProperty(exports, "wordlists", { enumerable: true, get: function () { return index_js_11.wordlists; } }); -// dummy change; to pick-up ws security issue changes -//# sourceMappingURL=ethers.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/ethers.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/ethers.js.map deleted file mode 100644 index 5c0c0eaa..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/ethers.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ethers.js","sourceRoot":"","sources":["../src.ts/ethers.ts"],"names":[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AAqB,OAAA;AACrC,4GAAA,eAAe,OAAA;AAAE,2GAAA,cAAc,OAAA;AAE/B,iHAAA,oBAAoB,OAAA;AAAE,oHAAA,uBAAuB,OAAA;AAAE,gHAAA,mBAAmB,OAAA;AAClE,gHAAA,mBAAmB,OAAA;AAAE,oHAAA,uBAAuB,OAAA;AAGhD,kDAE8B;AAD1B,qGAAA,QAAQ,OAAA;AAAE,mGAAA,MAAM,OAAA;AAAE,wGAAA,WAAW,OAAA;AAAE,yGAAA,YAAY,OAAA;AAAE,sGAAA,SAAS,OAAA;AAuF1D,qDAAqD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/authorization.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/authorization.d.ts deleted file mode 100644 index 0d883a2f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/authorization.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { Addressable } from "../address/index.js"; -import type { SignatureLike } from "../crypto/index.js"; -import type { BigNumberish, Numeric } from "../utils/index.js"; -export interface AuthorizationRequest { - address: string | Addressable; - nonce?: Numeric; - chainId?: BigNumberish; -} -/** - * Computes the [[link-eip-7702]] authorization digest to sign. - */ -export declare function hashAuthorization(auth: AuthorizationRequest): string; -/** - * Return the address of the private key that produced - * the signature %%sig%% during signing for %%message%%. - */ -export declare function verifyAuthorization(auth: AuthorizationRequest, sig: SignatureLike): string; -//# sourceMappingURL=authorization.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/authorization.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/authorization.d.ts.map deleted file mode 100644 index e8899a24..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/authorization.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"authorization.d.ts","sourceRoot":"","sources":["../../src.ts/hash/authorization.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE/D,MAAM,WAAW,oBAAoB;IACjC,OAAO,EAAE,MAAM,GAAG,WAAW,CAAC;IAC9B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,YAAY,CAAC;CAC1B;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,oBAAoB,GAAG,MAAM,CASpE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,oBAAoB,EAAE,GAAG,EAAE,aAAa,GAAG,MAAM,CAE1F"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/authorization.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/authorization.js deleted file mode 100644 index 31241179..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/authorization.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.verifyAuthorization = exports.hashAuthorization = void 0; -const index_js_1 = require("../address/index.js"); -const index_js_2 = require("../crypto/index.js"); -const index_js_3 = require("../transaction/index.js"); -const index_js_4 = require("../utils/index.js"); -/** - * Computes the [[link-eip-7702]] authorization digest to sign. - */ -function hashAuthorization(auth) { - (0, index_js_4.assertArgument)(typeof (auth.address) === "string", "invalid address for hashAuthorization", "auth.address", auth); - return (0, index_js_2.keccak256)((0, index_js_4.concat)([ - "0x05", (0, index_js_4.encodeRlp)([ - (auth.chainId != null) ? (0, index_js_4.toBeArray)(auth.chainId) : "0x", - (0, index_js_1.getAddress)(auth.address), - (auth.nonce != null) ? (0, index_js_4.toBeArray)(auth.nonce) : "0x", - ]) - ])); -} -exports.hashAuthorization = hashAuthorization; -/** - * Return the address of the private key that produced - * the signature %%sig%% during signing for %%message%%. - */ -function verifyAuthorization(auth, sig) { - return (0, index_js_3.recoverAddress)(hashAuthorization(auth), sig); -} -exports.verifyAuthorization = verifyAuthorization; -//# sourceMappingURL=authorization.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/authorization.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/authorization.js.map deleted file mode 100644 index 2edb904c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/authorization.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"authorization.js","sourceRoot":"","sources":["../../src.ts/hash/authorization.ts"],"names":[],"mappings":";;;AAAA,kDAAiD;AACjD,iDAA+C;AAC/C,sDAAyD;AACzD,gDAE2B;AAY3B;;GAEG;AACH,SAAgB,iBAAiB,CAAC,IAA0B;IACxD,IAAA,yBAAc,EAAC,OAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,QAAQ,EAAE,uCAAuC,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;IACjH,OAAO,IAAA,oBAAS,EAAC,IAAA,iBAAM,EAAC;QACpB,MAAM,EAAE,IAAA,oBAAS,EAAC;YACd,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAA,oBAAS,EAAC,IAAI,CAAC,OAAO,CAAC,CAAA,CAAC,CAAC,IAAI;YACtD,IAAA,qBAAU,EAAC,IAAI,CAAC,OAAO,CAAC;YACxB,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAA,oBAAS,EAAC,IAAI,CAAC,KAAK,CAAC,CAAA,CAAC,CAAC,IAAI;SACrD,CAAC;KACL,CAAC,CAAC,CAAC;AACR,CAAC;AATD,8CASC;AAED;;;GAGG;AACH,SAAgB,mBAAmB,CAAC,IAA0B,EAAE,GAAkB;IAC9E,OAAO,IAAA,yBAAc,EAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;AACxD,CAAC;AAFD,kDAEC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/id.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/id.d.ts deleted file mode 100644 index 8d5e0579..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/id.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * A simple hashing function which operates on UTF-8 strings to - * compute an 32-byte identifier. - * - * This simply computes the [UTF-8 bytes](toUtf8Bytes) and computes - * the [[keccak256]]. - * - * @example: - * id("hello world") - * //_result: - */ -export declare function id(value: string): string; -//# sourceMappingURL=id.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/id.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/id.d.ts.map deleted file mode 100644 index 713788d8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/id.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../src.ts/hash/id.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,wBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAExC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/id.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/id.js deleted file mode 100644 index 47dc5912..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/id.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.id = void 0; -const index_js_1 = require("../crypto/index.js"); -const index_js_2 = require("../utils/index.js"); -/** - * A simple hashing function which operates on UTF-8 strings to - * compute an 32-byte identifier. - * - * This simply computes the [UTF-8 bytes](toUtf8Bytes) and computes - * the [[keccak256]]. - * - * @example: - * id("hello world") - * //_result: - */ -function id(value) { - return (0, index_js_1.keccak256)((0, index_js_2.toUtf8Bytes)(value)); -} -exports.id = id; -//# sourceMappingURL=id.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/id.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/id.js.map deleted file mode 100644 index 3ba78637..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/id.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"id.js","sourceRoot":"","sources":["../../src.ts/hash/id.ts"],"names":[],"mappings":";;;AAAA,iDAA+C;AAC/C,gDAAgD;AAEhD;;;;;;;;;;GAUG;AACH,SAAgB,EAAE,CAAC,KAAa;IAC5B,OAAO,IAAA,oBAAS,EAAC,IAAA,sBAAW,EAAC,KAAK,CAAC,CAAC,CAAC;AACzC,CAAC;AAFD,gBAEC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/index.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/index.d.ts deleted file mode 100644 index 5b216e52..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/index.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Utilities for common tasks involving hashing. Also see - * [cryptographic hashing](about-crypto-hashing). - * - * @_section: api/hashing:Hashing Utilities [about-hashing] - */ -export { hashAuthorization, verifyAuthorization } from "./authorization.js"; -export { id } from "./id.js"; -export { ensNormalize, isValidName, namehash, dnsEncode } from "./namehash.js"; -export { hashMessage, verifyMessage } from "./message.js"; -export { solidityPacked, solidityPackedKeccak256, solidityPackedSha256 } from "./solidity.js"; -export { TypedDataEncoder, verifyTypedData } from "./typed-data.js"; -export type { AuthorizationRequest } from "./authorization.js"; -export type { TypedDataDomain, TypedDataField } from "./typed-data.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/index.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/index.d.ts.map deleted file mode 100644 index 7fec7492..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/hash/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EACH,cAAc,EAAE,uBAAuB,EAAE,oBAAoB,EAChE,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEpE,YAAY,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/index.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/index.js deleted file mode 100644 index 157e78c5..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/index.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -/** - * Utilities for common tasks involving hashing. Also see - * [cryptographic hashing](about-crypto-hashing). - * - * @_section: api/hashing:Hashing Utilities [about-hashing] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.verifyTypedData = exports.TypedDataEncoder = exports.solidityPackedSha256 = exports.solidityPackedKeccak256 = exports.solidityPacked = exports.verifyMessage = exports.hashMessage = exports.dnsEncode = exports.namehash = exports.isValidName = exports.ensNormalize = exports.id = exports.verifyAuthorization = exports.hashAuthorization = void 0; -var authorization_js_1 = require("./authorization.js"); -Object.defineProperty(exports, "hashAuthorization", { enumerable: true, get: function () { return authorization_js_1.hashAuthorization; } }); -Object.defineProperty(exports, "verifyAuthorization", { enumerable: true, get: function () { return authorization_js_1.verifyAuthorization; } }); -var id_js_1 = require("./id.js"); -Object.defineProperty(exports, "id", { enumerable: true, get: function () { return id_js_1.id; } }); -var namehash_js_1 = require("./namehash.js"); -Object.defineProperty(exports, "ensNormalize", { enumerable: true, get: function () { return namehash_js_1.ensNormalize; } }); -Object.defineProperty(exports, "isValidName", { enumerable: true, get: function () { return namehash_js_1.isValidName; } }); -Object.defineProperty(exports, "namehash", { enumerable: true, get: function () { return namehash_js_1.namehash; } }); -Object.defineProperty(exports, "dnsEncode", { enumerable: true, get: function () { return namehash_js_1.dnsEncode; } }); -var message_js_1 = require("./message.js"); -Object.defineProperty(exports, "hashMessage", { enumerable: true, get: function () { return message_js_1.hashMessage; } }); -Object.defineProperty(exports, "verifyMessage", { enumerable: true, get: function () { return message_js_1.verifyMessage; } }); -var solidity_js_1 = require("./solidity.js"); -Object.defineProperty(exports, "solidityPacked", { enumerable: true, get: function () { return solidity_js_1.solidityPacked; } }); -Object.defineProperty(exports, "solidityPackedKeccak256", { enumerable: true, get: function () { return solidity_js_1.solidityPackedKeccak256; } }); -Object.defineProperty(exports, "solidityPackedSha256", { enumerable: true, get: function () { return solidity_js_1.solidityPackedSha256; } }); -var typed_data_js_1 = require("./typed-data.js"); -Object.defineProperty(exports, "TypedDataEncoder", { enumerable: true, get: function () { return typed_data_js_1.TypedDataEncoder; } }); -Object.defineProperty(exports, "verifyTypedData", { enumerable: true, get: function () { return typed_data_js_1.verifyTypedData; } }); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/index.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/index.js.map deleted file mode 100644 index b979ffe8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/hash/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,uDAA4E;AAAnE,qHAAA,iBAAiB,OAAA;AAAE,uHAAA,mBAAmB,OAAA;AAC/C,iCAA4B;AAAnB,2FAAA,EAAE,OAAA;AACX,6CAA+E;AAAtE,2GAAA,YAAY,OAAA;AAAE,0GAAA,WAAW,OAAA;AAAE,uGAAA,QAAQ,OAAA;AAAE,wGAAA,SAAS,OAAA;AACvD,2CAA0D;AAAjD,yGAAA,WAAW,OAAA;AAAE,2GAAA,aAAa,OAAA;AACnC,6CAEuB;AADnB,6GAAA,cAAc,OAAA;AAAE,sHAAA,uBAAuB,OAAA;AAAE,mHAAA,oBAAoB,OAAA;AAEjE,iDAAoE;AAA3D,iHAAA,gBAAgB,OAAA;AAAE,gHAAA,eAAe,OAAA"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/message.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/message.d.ts deleted file mode 100644 index 9e088beb..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/message.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import type { SignatureLike } from "../crypto/index.js"; -/** - * Computes the [[link-eip-191]] personal-sign message digest to sign. - * - * This prefixes the message with [[MessagePrefix]] and the decimal length - * of %%message%% and computes the [[keccak256]] digest. - * - * If %%message%% is a string, it is converted to its UTF-8 bytes - * first. To compute the digest of a [[DataHexString]], it must be converted - * to [bytes](getBytes). - * - * @example: - * hashMessage("Hello World") - * //_result: - * - * // Hashes the SIX (6) string characters, i.e. - * // [ "0", "x", "4", "2", "4", "3" ] - * hashMessage("0x4243") - * //_result: - * - * // Hashes the TWO (2) bytes [ 0x42, 0x43 ]... - * hashMessage(getBytes("0x4243")) - * //_result: - * - * // ...which is equal to using data - * hashMessage(new Uint8Array([ 0x42, 0x43 ])) - * //_result: - * - */ -export declare function hashMessage(message: Uint8Array | string): string; -/** - * Return the address of the private key that produced - * the signature %%sig%% during signing for %%message%%. - */ -export declare function verifyMessage(message: Uint8Array | string, sig: SignatureLike): string; -//# sourceMappingURL=message.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/message.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/message.d.ts.map deleted file mode 100644 index d57b1223..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/message.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src.ts/hash/message.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,CAOhE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,EAAE,GAAG,EAAE,aAAa,GAAG,MAAM,CAGtF"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/message.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/message.js deleted file mode 100644 index cc5da95b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/message.js +++ /dev/null @@ -1,56 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.verifyMessage = exports.hashMessage = void 0; -const index_js_1 = require("../crypto/index.js"); -const index_js_2 = require("../constants/index.js"); -const index_js_3 = require("../transaction/index.js"); -const index_js_4 = require("../utils/index.js"); -/** - * Computes the [[link-eip-191]] personal-sign message digest to sign. - * - * This prefixes the message with [[MessagePrefix]] and the decimal length - * of %%message%% and computes the [[keccak256]] digest. - * - * If %%message%% is a string, it is converted to its UTF-8 bytes - * first. To compute the digest of a [[DataHexString]], it must be converted - * to [bytes](getBytes). - * - * @example: - * hashMessage("Hello World") - * //_result: - * - * // Hashes the SIX (6) string characters, i.e. - * // [ "0", "x", "4", "2", "4", "3" ] - * hashMessage("0x4243") - * //_result: - * - * // Hashes the TWO (2) bytes [ 0x42, 0x43 ]... - * hashMessage(getBytes("0x4243")) - * //_result: - * - * // ...which is equal to using data - * hashMessage(new Uint8Array([ 0x42, 0x43 ])) - * //_result: - * - */ -function hashMessage(message) { - if (typeof (message) === "string") { - message = (0, index_js_4.toUtf8Bytes)(message); - } - return (0, index_js_1.keccak256)((0, index_js_4.concat)([ - (0, index_js_4.toUtf8Bytes)(index_js_2.MessagePrefix), - (0, index_js_4.toUtf8Bytes)(String(message.length)), - message - ])); -} -exports.hashMessage = hashMessage; -/** - * Return the address of the private key that produced - * the signature %%sig%% during signing for %%message%%. - */ -function verifyMessage(message, sig) { - const digest = hashMessage(message); - return (0, index_js_3.recoverAddress)(digest, sig); -} -exports.verifyMessage = verifyMessage; -//# sourceMappingURL=message.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/message.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/message.js.map deleted file mode 100644 index 20331052..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/message.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"message.js","sourceRoot":"","sources":["../../src.ts/hash/message.ts"],"names":[],"mappings":";;;AAAA,iDAA+C;AAC/C,oDAAsD;AACtD,sDAAyD;AACzD,gDAAwD;AAGxD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,SAAgB,WAAW,CAAC,OAA4B;IACpD,IAAI,OAAM,CAAC,OAAO,CAAC,KAAK,QAAQ,EAAE;QAAE,OAAO,GAAG,IAAA,sBAAW,EAAC,OAAO,CAAC,CAAC;KAAE;IACrE,OAAO,IAAA,oBAAS,EAAC,IAAA,iBAAM,EAAC;QACpB,IAAA,sBAAW,EAAC,wBAAa,CAAC;QAC1B,IAAA,sBAAW,EAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACnC,OAAO;KACV,CAAC,CAAC,CAAC;AACR,CAAC;AAPD,kCAOC;AAED;;;GAGG;AACH,SAAgB,aAAa,CAAC,OAA4B,EAAE,GAAkB;IAC1E,MAAM,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;IACpC,OAAO,IAAA,yBAAc,EAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AACvC,CAAC;AAHD,sCAGC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/namehash.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/namehash.d.ts deleted file mode 100644 index d29b9c11..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/namehash.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Returns the ENS %%name%% normalized. - */ -export declare function ensNormalize(name: string): string; -/** - * Returns ``true`` if %%name%% is a valid ENS name. - */ -export declare function isValidName(name: string): name is string; -/** - * Returns the [[link-namehash]] for %%name%%. - */ -export declare function namehash(name: string): string; -/** - * Returns the DNS encoded %%name%%. - * - * This is used for various parts of ENS name resolution, such - * as the wildcard resolution. - */ -export declare function dnsEncode(name: string, _maxLength?: number): string; -//# sourceMappingURL=namehash.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/namehash.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/namehash.d.ts.map deleted file mode 100644 index af0b8eae..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/namehash.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"namehash.d.ts","sourceRoot":"","sources":["../../src.ts/hash/namehash.ts"],"names":[],"mappings":"AAyCA;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOjD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,MAAM,CAKxD;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAa7C;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAanE"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/namehash.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/namehash.js deleted file mode 100644 index c11fae0a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/namehash.js +++ /dev/null @@ -1,91 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.dnsEncode = exports.namehash = exports.isValidName = exports.ensNormalize = void 0; -const index_js_1 = require("../crypto/index.js"); -const index_js_2 = require("../utils/index.js"); -const ens_normalize_1 = require("@adraffy/ens-normalize"); -const Zeros = new Uint8Array(32); -Zeros.fill(0); -function checkComponent(comp) { - (0, index_js_2.assertArgument)(comp.length !== 0, "invalid ENS name; empty component", "comp", comp); - return comp; -} -function ensNameSplit(name) { - const bytes = (0, index_js_2.toUtf8Bytes)(ensNormalize(name)); - const comps = []; - if (name.length === 0) { - return comps; - } - let last = 0; - for (let i = 0; i < bytes.length; i++) { - const d = bytes[i]; - // A separator (i.e. "."); copy this component - if (d === 0x2e) { - comps.push(checkComponent(bytes.slice(last, i))); - last = i + 1; - } - } - // There was a stray separator at the end of the name - (0, index_js_2.assertArgument)(last < bytes.length, "invalid ENS name; empty component", "name", name); - comps.push(checkComponent(bytes.slice(last))); - return comps; -} -/** - * Returns the ENS %%name%% normalized. - */ -function ensNormalize(name) { - try { - if (name.length === 0) { - throw new Error("empty label"); - } - return (0, ens_normalize_1.ens_normalize)(name); - } - catch (error) { - (0, index_js_2.assertArgument)(false, `invalid ENS name (${error.message})`, "name", name); - } -} -exports.ensNormalize = ensNormalize; -/** - * Returns ``true`` if %%name%% is a valid ENS name. - */ -function isValidName(name) { - try { - return (ensNameSplit(name).length !== 0); - } - catch (error) { } - return false; -} -exports.isValidName = isValidName; -/** - * Returns the [[link-namehash]] for %%name%%. - */ -function namehash(name) { - (0, index_js_2.assertArgument)(typeof (name) === "string", "invalid ENS name; not a string", "name", name); - (0, index_js_2.assertArgument)(name.length, `invalid ENS name (empty label)`, "name", name); - let result = Zeros; - const comps = ensNameSplit(name); - while (comps.length) { - result = (0, index_js_1.keccak256)((0, index_js_2.concat)([result, (0, index_js_1.keccak256)((comps.pop()))])); - } - return (0, index_js_2.hexlify)(result); -} -exports.namehash = namehash; -/** - * Returns the DNS encoded %%name%%. - * - * This is used for various parts of ENS name resolution, such - * as the wildcard resolution. - */ -function dnsEncode(name, _maxLength) { - const length = (_maxLength != null) ? _maxLength : 63; - (0, index_js_2.assertArgument)(length <= 255, "DNS encoded label cannot exceed 255", "length", length); - return (0, index_js_2.hexlify)((0, index_js_2.concat)(ensNameSplit(name).map((comp) => { - (0, index_js_2.assertArgument)(comp.length <= length, `label ${JSON.stringify(name)} exceeds ${length} bytes`, "name", name); - const bytes = new Uint8Array(comp.length + 1); - bytes.set(comp, 1); - bytes[0] = bytes.length - 1; - return bytes; - }))) + "00"; -} -exports.dnsEncode = dnsEncode; -//# sourceMappingURL=namehash.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/namehash.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/namehash.js.map deleted file mode 100644 index 288c23e9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/namehash.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":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AC;AAbD,4BAaC;AAED;;;;;GAKG;AACH,SAAgB,SAAS,CAAC,IAAY,EAAE,UAAmB;IACvD,MAAM,MAAM,GAAG,CAAC,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,CAAA,CAAC,CAAC,EAAE,CAAC;IAErD,IAAA,yBAAc,EAAC,MAAM,IAAI,GAAG,EAAE,qCAAqC,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAEvF,OAAO,IAAA,kBAAO,EAAC,IAAA,iBAAM,EAAC,YAAY,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QAClD,IAAA,yBAAc,EAAC,IAAI,CAAC,MAAM,IAAI,MAAM,EAAE,SAAU,IAAI,CAAC,SAAS,CAAC,IAAI,CAAE,YAAa,MAAO,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QAEjH,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC9C,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QACnB,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;QAC5B,OAAO,KAAK,CAAC;IACjB,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;AAChB,CAAC;AAbD,8BAaC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/solidity.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/solidity.d.ts deleted file mode 100644 index 9b8035eb..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/solidity.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Computes the [[link-solc-packed]] representation of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPacked([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ -export declare function solidityPacked(types: ReadonlyArray, values: ReadonlyArray): string; -/** - * Computes the [[link-solc-packed]] [[keccak256]] hash of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPackedKeccak256([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ -export declare function solidityPackedKeccak256(types: ReadonlyArray, values: ReadonlyArray): string; -/** - * Computes the [[link-solc-packed]] [[sha256]] hash of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPackedSha256([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ -export declare function solidityPackedSha256(types: ReadonlyArray, values: ReadonlyArray): string; -//# sourceMappingURL=solidity.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/solidity.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/solidity.d.ts.map deleted file mode 100644 index 742707df..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/solidity.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"solidity.d.ts","sourceRoot":"","sources":["../../src.ts/hash/solidity.ts"],"names":[],"mappings":"AAyEA;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG,MAAM,CAQ/F;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG,MAAM,CAExG;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG,MAAM,CAErG"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/solidity.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/solidity.js deleted file mode 100644 index c828e270..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/solidity.js +++ /dev/null @@ -1,109 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.solidityPackedSha256 = exports.solidityPackedKeccak256 = exports.solidityPacked = void 0; -const index_js_1 = require("../address/index.js"); -const index_js_2 = require("../crypto/index.js"); -const index_js_3 = require("../utils/index.js"); -const regexBytes = new RegExp("^bytes([0-9]+)$"); -const regexNumber = new RegExp("^(u?int)([0-9]*)$"); -const regexArray = new RegExp("^(.*)\\[([0-9]*)\\]$"); -function _pack(type, value, isArray) { - switch (type) { - case "address": - if (isArray) { - return (0, index_js_3.getBytes)((0, index_js_3.zeroPadValue)(value, 32)); - } - return (0, index_js_3.getBytes)((0, index_js_1.getAddress)(value)); - case "string": - return (0, index_js_3.toUtf8Bytes)(value); - case "bytes": - return (0, index_js_3.getBytes)(value); - case "bool": - value = (!!value ? "0x01" : "0x00"); - if (isArray) { - return (0, index_js_3.getBytes)((0, index_js_3.zeroPadValue)(value, 32)); - } - return (0, index_js_3.getBytes)(value); - } - let match = type.match(regexNumber); - if (match) { - let signed = (match[1] === "int"); - let size = parseInt(match[2] || "256"); - (0, index_js_3.assertArgument)((!match[2] || match[2] === String(size)) && (size % 8 === 0) && size !== 0 && size <= 256, "invalid number type", "type", type); - if (isArray) { - size = 256; - } - if (signed) { - value = (0, index_js_3.toTwos)(value, size); - } - return (0, index_js_3.getBytes)((0, index_js_3.zeroPadValue)((0, index_js_3.toBeArray)(value), size / 8)); - } - match = type.match(regexBytes); - if (match) { - const size = parseInt(match[1]); - (0, index_js_3.assertArgument)(String(size) === match[1] && size !== 0 && size <= 32, "invalid bytes type", "type", type); - (0, index_js_3.assertArgument)((0, index_js_3.dataLength)(value) === size, `invalid value for ${type}`, "value", value); - if (isArray) { - return (0, index_js_3.getBytes)((0, index_js_3.zeroPadBytes)(value, 32)); - } - return value; - } - match = type.match(regexArray); - if (match && Array.isArray(value)) { - const baseType = match[1]; - const count = parseInt(match[2] || String(value.length)); - (0, index_js_3.assertArgument)(count === value.length, `invalid array length for ${type}`, "value", value); - const result = []; - value.forEach(function (value) { - result.push(_pack(baseType, value, true)); - }); - return (0, index_js_3.getBytes)((0, index_js_3.concat)(result)); - } - (0, index_js_3.assertArgument)(false, "invalid type", "type", type); -} -// @TODO: Array Enum -/** - * Computes the [[link-solc-packed]] representation of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPacked([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ -function solidityPacked(types, values) { - (0, index_js_3.assertArgument)(types.length === values.length, "wrong number of values; expected ${ types.length }", "values", values); - const tight = []; - types.forEach(function (type, index) { - tight.push(_pack(type, values[index])); - }); - return (0, index_js_3.hexlify)((0, index_js_3.concat)(tight)); -} -exports.solidityPacked = solidityPacked; -/** - * Computes the [[link-solc-packed]] [[keccak256]] hash of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPackedKeccak256([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ -function solidityPackedKeccak256(types, values) { - return (0, index_js_2.keccak256)(solidityPacked(types, values)); -} -exports.solidityPackedKeccak256 = solidityPackedKeccak256; -/** - * Computes the [[link-solc-packed]] [[sha256]] hash of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPackedSha256([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ -function solidityPackedSha256(types, values) { - return (0, index_js_2.sha256)(solidityPacked(types, values)); -} -exports.solidityPackedSha256 = solidityPackedSha256; -//# sourceMappingURL=solidity.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/solidity.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/solidity.js.map deleted file mode 100644 index 2ba9e5ef..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/solidity.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"solidity.js","sourceRoot":"","sources":["../../src.ts/hash/solidity.ts"],"names":[],"mappings":";;;AAAA,kDAAiD;AACjD,iDAE4B;AAC5B,gDAG2B;AAG3B,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,iBAAiB,CAAC,CAAC;AACjD,MAAM,WAAW,GAAG,IAAI,MAAM,CAAC,mBAAmB,CAAC,CAAC;AACpD,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,sBAAsB,CAAC,CAAC;AAGtD,SAAS,KAAK,CAAC,IAAY,EAAE,KAAU,EAAE,OAAiB;IACtD,QAAO,IAAI,EAAE;QACT,KAAK,SAAS;YACV,IAAI,OAAO,EAAE;gBAAE,OAAO,IAAA,mBAAQ,EAAC,IAAA,uBAAY,EAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;aAAE;YAC1D,OAAO,IAAA,mBAAQ,EAAC,IAAA,qBAAU,EAAC,KAAK,CAAC,CAAC,CAAC;QACvC,KAAK,QAAQ;YACT,OAAO,IAAA,sBAAW,EAAC,KAAK,CAAC,CAAC;QAC9B,KAAK,OAAO;YACR,OAAO,IAAA,mBAAQ,EAAC,KAAK,CAAC,CAAC;QAC3B,KAAK,MAAM;YACP,KAAK,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAA,CAAC,CAAC,MAAM,CAAC,CAAC;YACnC,IAAI,OAAO,EAAE;gBAAE,OAAO,IAAA,mBAAQ,EAAC,IAAA,uBAAY,EAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;aAAE;YAC1D,OAAO,IAAA,mBAAQ,EAAC,KAAK,CAAC,CAAC;KAC9B;IAED,IAAI,KAAK,GAAI,IAAI,C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AS,IAAI,EAAE,KAAK;QAC9B,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;IACH,OAAO,IAAA,kBAAO,EAAC,IAAA,iBAAM,EAAC,KAAK,CAAC,CAAC,CAAC;AAClC,CAAC;AARD,wCAQC;AAED;;;;;;;;GAQG;AACH,SAAgB,uBAAuB,CAAC,KAA4B,EAAE,MAA0B;IAC5F,OAAO,IAAA,oBAAU,EAAC,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;AACrD,CAAC;AAFD,0DAEC;AAED;;;;;;;;GAQG;AACH,SAAgB,oBAAoB,CAAC,KAA4B,EAAE,MAA0B;IACzF,OAAO,IAAA,iBAAO,EAAC,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;AAClD,CAAC;AAFD,oDAEC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/typed-data.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/typed-data.d.ts deleted file mode 100644 index 47c345b1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/typed-data.d.ts +++ /dev/null @@ -1,150 +0,0 @@ -import type { SignatureLike } from "../crypto/index.js"; -import type { BigNumberish, BytesLike } from "../utils/index.js"; -/** - * The domain for an [[link-eip-712]] payload. - */ -export interface TypedDataDomain { - /** - * The human-readable name of the signing domain. - */ - name?: null | string; - /** - * The major version of the signing domain. - */ - version?: null | string; - /** - * The chain ID of the signing domain. - */ - chainId?: null | BigNumberish; - /** - * The the address of the contract that will verify the signature. - */ - verifyingContract?: null | string; - /** - * A salt used for purposes decided by the specific domain. - */ - salt?: null | BytesLike; -} -/** - * A specific field of a structured [[link-eip-712]] type. - */ -export interface TypedDataField { - /** - * The field name. - */ - name: string; - /** - * The type of the field. - */ - type: string; -} -/** - * A **TypedDataEncode** prepares and encodes [[link-eip-712]] payloads - * for signed typed data. - * - * This is useful for those that wish to compute various components of a - * typed data hash, primary types, or sub-components, but generally the - * higher level [[Signer-signTypedData]] is more useful. - */ -export declare class TypedDataEncoder { - #private; - /** - * The primary type for the structured [[types]]. - * - * This is derived automatically from the [[types]], since no - * recursion is possible, once the DAG for the types is consturcted - * internally, the primary type must be the only remaining type with - * no parent nodes. - */ - readonly primaryType: string; - /** - * The types. - */ - get types(): Record>; - /** - * Create a new **TypedDataEncoder** for %%types%%. - * - * This performs all necessary checking that types are valid and - * do not violate the [[link-eip-712]] structural constraints as - * well as computes the [[primaryType]]. - */ - constructor(_types: Record>); - /** - * Returnthe encoder for the specific %%type%%. - */ - getEncoder(type: string): (value: any) => string; - /** - * Return the full type for %%name%%. - */ - encodeType(name: string): string; - /** - * Return the encoded %%value%% for the %%type%%. - */ - encodeData(type: string, value: any): string; - /** - * Returns the hash of %%value%% for the type of %%name%%. - */ - hashStruct(name: string, value: Record): string; - /** - * Return the fulled encoded %%value%% for the [[types]]. - */ - encode(value: Record): string; - /** - * Return the hash of the fully encoded %%value%% for the [[types]]. - */ - hash(value: Record): string; - /** - * @_ignore: - */ - _visit(type: string, value: any, callback: (type: string, data: any) => any): any; - /** - * Call %%calback%% for each value in %%value%%, passing the type and - * component within %%value%%. - * - * This is useful for replacing addresses or other transformation that - * may be desired on each component, based on its type. - */ - visit(value: Record, callback: (type: string, data: any) => any): any; - /** - * Create a new **TypedDataEncoder** for %%types%%. - */ - static from(types: Record>): TypedDataEncoder; - /** - * Return the primary type for %%types%%. - */ - static getPrimaryType(types: Record>): string; - /** - * Return the hashed struct for %%value%% using %%types%% and %%name%%. - */ - static hashStruct(name: string, types: Record>, value: Record): string; - /** - * Return the domain hash for %%domain%%. - */ - static hashDomain(domain: TypedDataDomain): string; - /** - * Return the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%. - */ - static encode(domain: TypedDataDomain, types: Record>, value: Record): string; - /** - * Return the hash of the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%. - */ - static hash(domain: TypedDataDomain, types: Record>, value: Record): string; - /** - * Resolves to the value from resolving all addresses in %%value%% for - * %%types%% and the %%domain%%. - */ - static resolveNames(domain: TypedDataDomain, types: Record>, value: Record, resolveName: (name: string) => Promise): Promise<{ - domain: TypedDataDomain; - value: any; - }>; - /** - * Returns the JSON-encoded payload expected by nodes which implement - * the JSON-RPC [[link-eip-712]] method. - */ - static getPayload(domain: TypedDataDomain, types: Record>, value: Record): any; -} -/** - * Compute the address used to sign the typed data for the %%signature%%. - */ -export declare function verifyTypedData(domain: TypedDataDomain, types: Record>, value: Record, signature: SignatureLike): string; -//# sourceMappingURL=typed-data.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/typed-data.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/typed-data.d.ts.map deleted file mode 100644 index dee91781..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/typed-data.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"typed-data.d.ts","sourceRoot":"","sources":["../../src.ts/hash/typed-data.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAajE;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAErB;;OAEG;IACH,OAAO,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAExB;;OAEG;IACH,OAAO,CAAC,EAAE,IAAI,GAAG,YAAY,CAAC;IAE9B;;OAEG;IACH,iBAAiB,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAElC;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;CAC3B;AAED;;GAEG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AAO,CAAC;QAAE,MAAM,EAAE,eAAe,CAAC;QAAC,KAAK,EAAE,GAAG,CAAA;KAAE,CAAC;IAiD9N;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG;CA0D5H;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,SAAS,EAAE,aAAa,GAAG,MAAM,CAEnK"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/typed-data.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/typed-data.js deleted file mode 100644 index b9daad1d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/typed-data.js +++ /dev/null @@ -1,524 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.verifyTypedData = exports.TypedDataEncoder = void 0; -//import { TypedDataDomain, TypedDataField } from "@ethersproject/providerabstract-signer"; -const index_js_1 = require("../address/index.js"); -const index_js_2 = require("../crypto/index.js"); -const index_js_3 = require("../transaction/index.js"); -const index_js_4 = require("../utils/index.js"); -const id_js_1 = require("./id.js"); -const padding = new Uint8Array(32); -padding.fill(0); -const BN__1 = BigInt(-1); -const BN_0 = BigInt(0); -const BN_1 = BigInt(1); -const BN_MAX_UINT256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); -; -; -function hexPadRight(value) { - const bytes = (0, index_js_4.getBytes)(value); - const padOffset = bytes.length % 32; - if (padOffset) { - return (0, index_js_4.concat)([bytes, padding.slice(padOffset)]); - } - return (0, index_js_4.hexlify)(bytes); -} -const hexTrue = (0, index_js_4.toBeHex)(BN_1, 32); -const hexFalse = (0, index_js_4.toBeHex)(BN_0, 32); -const domainFieldTypes = { - name: "string", - version: "string", - chainId: "uint256", - verifyingContract: "address", - salt: "bytes32" -}; -const domainFieldNames = [ - "name", "version", "chainId", "verifyingContract", "salt" -]; -function checkString(key) { - return function (value) { - (0, index_js_4.assertArgument)(typeof (value) === "string", `invalid domain value for ${JSON.stringify(key)}`, `domain.${key}`, value); - return value; - }; -} -const domainChecks = { - name: checkString("name"), - version: checkString("version"), - chainId: function (_value) { - const value = (0, index_js_4.getBigInt)(_value, "domain.chainId"); - (0, index_js_4.assertArgument)(value >= 0, "invalid chain ID", "domain.chainId", _value); - if (Number.isSafeInteger(value)) { - return Number(value); - } - return (0, index_js_4.toQuantity)(value); - }, - verifyingContract: function (value) { - try { - return (0, index_js_1.getAddress)(value).toLowerCase(); - } - catch (error) { } - (0, index_js_4.assertArgument)(false, `invalid domain value "verifyingContract"`, "domain.verifyingContract", value); - }, - salt: function (value) { - const bytes = (0, index_js_4.getBytes)(value, "domain.salt"); - (0, index_js_4.assertArgument)(bytes.length === 32, `invalid domain value "salt"`, "domain.salt", value); - return (0, index_js_4.hexlify)(bytes); - } -}; -function getBaseEncoder(type) { - // intXX and uintXX - { - const match = type.match(/^(u?)int(\d+)$/); - if (match) { - const signed = (match[1] === ""); - const width = parseInt(match[2]); - (0, index_js_4.assertArgument)(width % 8 === 0 && width !== 0 && width <= 256 && match[2] === String(width), "invalid numeric width", "type", type); - const boundsUpper = (0, index_js_4.mask)(BN_MAX_UINT256, signed ? (width - 1) : width); - const boundsLower = signed ? ((boundsUpper + BN_1) * BN__1) : BN_0; - return function (_value) { - const value = (0, index_js_4.getBigInt)(_value, "value"); - (0, index_js_4.assertArgument)(value >= boundsLower && value <= boundsUpper, `value out-of-bounds for ${type}`, "value", value); - return (0, index_js_4.toBeHex)(signed ? (0, index_js_4.toTwos)(value, 256) : value, 32); - }; - } - } - // bytesXX - { - const match = type.match(/^bytes(\d+)$/); - if (match) { - const width = parseInt(match[1]); - (0, index_js_4.assertArgument)(width !== 0 && width <= 32 && match[1] === String(width), "invalid bytes width", "type", type); - return function (value) { - const bytes = (0, index_js_4.getBytes)(value); - (0, index_js_4.assertArgument)(bytes.length === width, `invalid length for ${type}`, "value", value); - return hexPadRight(value); - }; - } - } - switch (type) { - case "address": return function (value) { - return (0, index_js_4.zeroPadValue)((0, index_js_1.getAddress)(value), 32); - }; - case "bool": return function (value) { - return ((!value) ? hexFalse : hexTrue); - }; - case "bytes": return function (value) { - return (0, index_js_2.keccak256)(value); - }; - case "string": return function (value) { - return (0, id_js_1.id)(value); - }; - } - return null; -} -function encodeType(name, fields) { - return `${name}(${fields.map(({ name, type }) => (type + " " + name)).join(",")})`; -} -// foo[][3] => { base: "foo", index: "[][3]", array: { -// base: "foo", prefix: "foo[]", count: 3 } } -function splitArray(type) { - const match = type.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/); - if (match) { - return { - base: match[1], - index: (match[2] + match[4]), - array: { - base: match[1], - prefix: (match[1] + match[2]), - count: (match[5] ? parseInt(match[5]) : -1), - } - }; - } - return { base: type }; -} -/** - * A **TypedDataEncode** prepares and encodes [[link-eip-712]] payloads - * for signed typed data. - * - * This is useful for those that wish to compute various components of a - * typed data hash, primary types, or sub-components, but generally the - * higher level [[Signer-signTypedData]] is more useful. - */ -class TypedDataEncoder { - /** - * The primary type for the structured [[types]]. - * - * This is derived automatically from the [[types]], since no - * recursion is possible, once the DAG for the types is consturcted - * internally, the primary type must be the only remaining type with - * no parent nodes. - */ - primaryType; - #types; - /** - * The types. - */ - get types() { - return JSON.parse(this.#types); - } - #fullTypes; - #encoderCache; - /** - * Create a new **TypedDataEncoder** for %%types%%. - * - * This performs all necessary checking that types are valid and - * do not violate the [[link-eip-712]] structural constraints as - * well as computes the [[primaryType]]. - */ - constructor(_types) { - this.#fullTypes = new Map(); - this.#encoderCache = new Map(); - // Link struct types to their direct child structs - const links = new Map(); - // Link structs to structs which contain them as a child - const parents = new Map(); - // Link all subtypes within a given struct - const subtypes = new Map(); - const types = {}; - Object.keys(_types).forEach((type) => { - types[type] = _types[type].map(({ name, type }) => { - // Normalize the base type (unless name conflict) - let { base, index } = splitArray(type); - if (base === "int" && !_types["int"]) { - base = "int256"; - } - if (base === "uint" && !_types["uint"]) { - base = "uint256"; - } - return { name, type: (base + (index || "")) }; - }); - links.set(type, new Set()); - parents.set(type, []); - subtypes.set(type, new Set()); - }); - this.#types = JSON.stringify(types); - for (const name in types) { - const uniqueNames = new Set(); - for (const field of types[name]) { - // Check each field has a unique name - (0, index_js_4.assertArgument)(!uniqueNames.has(field.name), `duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`, "types", _types); - uniqueNames.add(field.name); - // Get the base type (drop any array specifiers) - const baseType = splitArray(field.type).base; - (0, index_js_4.assertArgument)(baseType !== name, `circular type reference to ${JSON.stringify(baseType)}`, "types", _types); - // Is this a base encoding type? - const encoder = getBaseEncoder(baseType); - if (encoder) { - continue; - } - (0, index_js_4.assertArgument)(parents.has(baseType), `unknown type ${JSON.stringify(baseType)}`, "types", _types); - // Add linkage - parents.get(baseType).push(name); - links.get(name).add(baseType); - } - } - // Deduce the primary type - const primaryTypes = Array.from(parents.keys()).filter((n) => (parents.get(n).length === 0)); - (0, index_js_4.assertArgument)(primaryTypes.length !== 0, "missing primary type", "types", _types); - (0, index_js_4.assertArgument)(primaryTypes.length === 1, `ambiguous primary types or unused types: ${primaryTypes.map((t) => (JSON.stringify(t))).join(", ")}`, "types", _types); - (0, index_js_4.defineProperties)(this, { primaryType: primaryTypes[0] }); - // Check for circular type references - function checkCircular(type, found) { - (0, index_js_4.assertArgument)(!found.has(type), `circular type reference to ${JSON.stringify(type)}`, "types", _types); - found.add(type); - for (const child of links.get(type)) { - if (!parents.has(child)) { - continue; - } - // Recursively check children - checkCircular(child, found); - // Mark all ancestors as having this decendant - for (const subtype of found) { - subtypes.get(subtype).add(child); - } - } - found.delete(type); - } - checkCircular(this.primaryType, new Set()); - // Compute each fully describe type - for (const [name, set] of subtypes) { - const st = Array.from(set); - st.sort(); - this.#fullTypes.set(name, encodeType(name, types[name]) + st.map((t) => encodeType(t, types[t])).join("")); - } - } - /** - * Returnthe encoder for the specific %%type%%. - */ - getEncoder(type) { - let encoder = this.#encoderCache.get(type); - if (!encoder) { - encoder = this.#getEncoder(type); - this.#encoderCache.set(type, encoder); - } - return encoder; - } - #getEncoder(type) { - // Basic encoder type (address, bool, uint256, etc) - { - const encoder = getBaseEncoder(type); - if (encoder) { - return encoder; - } - } - // Array - const array = splitArray(type).array; - if (array) { - const subtype = array.prefix; - const subEncoder = this.getEncoder(subtype); - return (value) => { - (0, index_js_4.assertArgument)(array.count === -1 || array.count === value.length, `array length mismatch; expected length ${array.count}`, "value", value); - let result = value.map(subEncoder); - if (this.#fullTypes.has(subtype)) { - result = result.map(index_js_2.keccak256); - } - return (0, index_js_2.keccak256)((0, index_js_4.concat)(result)); - }; - } - // Struct - const fields = this.types[type]; - if (fields) { - const encodedType = (0, id_js_1.id)(this.#fullTypes.get(type)); - return (value) => { - const values = fields.map(({ name, type }) => { - const result = this.getEncoder(type)(value[name]); - if (this.#fullTypes.has(type)) { - return (0, index_js_2.keccak256)(result); - } - return result; - }); - values.unshift(encodedType); - return (0, index_js_4.concat)(values); - }; - } - (0, index_js_4.assertArgument)(false, `unknown type: ${type}`, "type", type); - } - /** - * Return the full type for %%name%%. - */ - encodeType(name) { - const result = this.#fullTypes.get(name); - (0, index_js_4.assertArgument)(result, `unknown type: ${JSON.stringify(name)}`, "name", name); - return result; - } - /** - * Return the encoded %%value%% for the %%type%%. - */ - encodeData(type, value) { - return this.getEncoder(type)(value); - } - /** - * Returns the hash of %%value%% for the type of %%name%%. - */ - hashStruct(name, value) { - return (0, index_js_2.keccak256)(this.encodeData(name, value)); - } - /** - * Return the fulled encoded %%value%% for the [[types]]. - */ - encode(value) { - return this.encodeData(this.primaryType, value); - } - /** - * Return the hash of the fully encoded %%value%% for the [[types]]. - */ - hash(value) { - return this.hashStruct(this.primaryType, value); - } - /** - * @_ignore: - */ - _visit(type, value, callback) { - // Basic encoder type (address, bool, uint256, etc) - { - const encoder = getBaseEncoder(type); - if (encoder) { - return callback(type, value); - } - } - // Array - const array = splitArray(type).array; - if (array) { - (0, index_js_4.assertArgument)(array.count === -1 || array.count === value.length, `array length mismatch; expected length ${array.count}`, "value", value); - return value.map((v) => this._visit(array.prefix, v, callback)); - } - // Struct - const fields = this.types[type]; - if (fields) { - return fields.reduce((accum, { name, type }) => { - accum[name] = this._visit(type, value[name], callback); - return accum; - }, {}); - } - (0, index_js_4.assertArgument)(false, `unknown type: ${type}`, "type", type); - } - /** - * Call %%calback%% for each value in %%value%%, passing the type and - * component within %%value%%. - * - * This is useful for replacing addresses or other transformation that - * may be desired on each component, based on its type. - */ - visit(value, callback) { - return this._visit(this.primaryType, value, callback); - } - /** - * Create a new **TypedDataEncoder** for %%types%%. - */ - static from(types) { - return new TypedDataEncoder(types); - } - /** - * Return the primary type for %%types%%. - */ - static getPrimaryType(types) { - return TypedDataEncoder.from(types).primaryType; - } - /** - * Return the hashed struct for %%value%% using %%types%% and %%name%%. - */ - static hashStruct(name, types, value) { - return TypedDataEncoder.from(types).hashStruct(name, value); - } - /** - * Return the domain hash for %%domain%%. - */ - static hashDomain(domain) { - const domainFields = []; - for (const name in domain) { - if (domain[name] == null) { - continue; - } - const type = domainFieldTypes[name]; - (0, index_js_4.assertArgument)(type, `invalid typed-data domain key: ${JSON.stringify(name)}`, "domain", domain); - domainFields.push({ name, type }); - } - domainFields.sort((a, b) => { - return domainFieldNames.indexOf(a.name) - domainFieldNames.indexOf(b.name); - }); - return TypedDataEncoder.hashStruct("EIP712Domain", { EIP712Domain: domainFields }, domain); - } - /** - * Return the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%. - */ - static encode(domain, types, value) { - return (0, index_js_4.concat)([ - "0x1901", - TypedDataEncoder.hashDomain(domain), - TypedDataEncoder.from(types).hash(value) - ]); - } - /** - * Return the hash of the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%. - */ - static hash(domain, types, value) { - return (0, index_js_2.keccak256)(TypedDataEncoder.encode(domain, types, value)); - } - // Replaces all address types with ENS names with their looked up address - /** - * Resolves to the value from resolving all addresses in %%value%% for - * %%types%% and the %%domain%%. - */ - static async resolveNames(domain, types, value, resolveName) { - // Make a copy to isolate it from the object passed in - domain = Object.assign({}, domain); - // Allow passing null to ignore value - for (const key in domain) { - if (domain[key] == null) { - delete domain[key]; - } - } - // Look up all ENS names - const ensCache = {}; - // Do we need to look up the domain's verifyingContract? - if (domain.verifyingContract && !(0, index_js_4.isHexString)(domain.verifyingContract, 20)) { - ensCache[domain.verifyingContract] = "0x"; - } - // We are going to use the encoder to visit all the base values - const encoder = TypedDataEncoder.from(types); - // Get a list of all the addresses - encoder.visit(value, (type, value) => { - if (type === "address" && !(0, index_js_4.isHexString)(value, 20)) { - ensCache[value] = "0x"; - } - return value; - }); - // Lookup each name - for (const name in ensCache) { - ensCache[name] = await resolveName(name); - } - // Replace the domain verifyingContract if needed - if (domain.verifyingContract && ensCache[domain.verifyingContract]) { - domain.verifyingContract = ensCache[domain.verifyingContract]; - } - // Replace all ENS names with their address - value = encoder.visit(value, (type, value) => { - if (type === "address" && ensCache[value]) { - return ensCache[value]; - } - return value; - }); - return { domain, value }; - } - /** - * Returns the JSON-encoded payload expected by nodes which implement - * the JSON-RPC [[link-eip-712]] method. - */ - static getPayload(domain, types, value) { - // Validate the domain fields - TypedDataEncoder.hashDomain(domain); - // Derive the EIP712Domain Struct reference type - const domainValues = {}; - const domainTypes = []; - domainFieldNames.forEach((name) => { - const value = domain[name]; - if (value == null) { - return; - } - domainValues[name] = domainChecks[name](value); - domainTypes.push({ name, type: domainFieldTypes[name] }); - }); - const encoder = TypedDataEncoder.from(types); - // Get the normalized types - types = encoder.types; - const typesWithDomain = Object.assign({}, types); - (0, index_js_4.assertArgument)(typesWithDomain.EIP712Domain == null, "types must not contain EIP712Domain type", "types.EIP712Domain", types); - typesWithDomain.EIP712Domain = domainTypes; - // Validate the data structures and types - encoder.encode(value); - return { - types: typesWithDomain, - domain: domainValues, - primaryType: encoder.primaryType, - message: encoder.visit(value, (type, value) => { - // bytes - if (type.match(/^bytes(\d*)/)) { - return (0, index_js_4.hexlify)((0, index_js_4.getBytes)(value)); - } - // uint or int - if (type.match(/^u?int/)) { - return (0, index_js_4.getBigInt)(value).toString(); - } - switch (type) { - case "address": - return value.toLowerCase(); - case "bool": - return !!value; - case "string": - (0, index_js_4.assertArgument)(typeof (value) === "string", "invalid string", "value", value); - return value; - } - (0, index_js_4.assertArgument)(false, "unsupported type", "type", type); - }) - }; - } -} -exports.TypedDataEncoder = TypedDataEncoder; -/** - * Compute the address used to sign the typed data for the %%signature%%. - */ -function verifyTypedData(domain, types, value, signature) { - return (0, index_js_3.recoverAddress)(TypedDataEncoder.hash(domain, types, value), signature); -} -exports.verifyTypedData = verifyTypedData; -//# sourceMappingURL=typed-data.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/typed-data.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/typed-data.js.map deleted file mode 100644 index 7da76baf..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/hash/typed-data.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"typed-data.js","sourceRoot":"","sources":["../../src.ts/hash/typed-data.ts"],"names":[],"mappings":";;;AAAA,2FAA2F;AAC3F,kDAAiD;AACjD,iDAA+C;AAC/C,sDAAyD;AACzD,gDAG2B;AAE3B,mCAA6B;AAM7B,MAAM,OAAO,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;AACnC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAEhB,MAAM,KAAK,GAAG,MAAM,CAAC,C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c,EAAC,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;YAC5D,CAAC,CAAC;SACL,CAAC;IACN,CAAC;CACJ;AA9aD,4CA8aC;AAED;;GAEG;AACH,SAAgB,eAAe,CAAC,MAAuB,EAAE,KAA4C,EAAE,KAA0B,EAAE,SAAwB;IACvJ,OAAO,IAAA,yBAAc,EAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,SAAS,CAAC,CAAC;AAClF,CAAC;AAFD,0CAEC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/index.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/index.d.ts deleted file mode 100644 index 558c263f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/index.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * The Application Programming Interface (API) is the collection of - * functions, classes and types offered by the Ethers library. - * - * @_section: api:Application Programming Interface [about-api] - * @_navTitle: API - */ -import * as ethers from "./ethers.js"; -export { ethers }; -export * from "./ethers.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/index.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/index.d.ts.map deleted file mode 100644 index 2334d69a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src.ts/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,MAAM,EAAE,CAAC;AAElB,cAAc,aAAa,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/index.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/index.js deleted file mode 100644 index 672d61fa..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/index.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ethers = void 0; -const tslib_1 = require("tslib"); -/** - * The Application Programming Interface (API) is the collection of - * functions, classes and types offered by the Ethers library. - * - * @_section: api:Application Programming Interface [about-api] - * @_navTitle: API - */ -const ethers = tslib_1.__importStar(require("./ethers.js")); -exports.ethers = ethers; -tslib_1.__exportStar(require("./ethers.js"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/index.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/index.js.map deleted file mode 100644 index 51e9bfec..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src.ts/index.ts"],"names":[],"mappings":";;;;AAAA;;;;;;GAMG;AACH,4DAAsC;AAE7B,wBAAM;AAEf,sDAA4B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/package.json b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/package.json deleted file mode 100644 index 0e211685..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "browser": { - "./crypto/crypto.js": "./crypto/crypto-browser.js", - "./providers/provider-ipcsocket.js": "./providers/provider-ipcsocket-browser.js", - "./providers/ws.js": "./providers/ws-browser.js", - "./utils/base64.js": "./utils/base64-browser.js", - "./utils/geturl.js": "./utils/geturl-browser.js", - "./wordlists/wordlists.js": "./wordlists/wordlists-browser.js" - }, - "sideEffects": false, - "type": "commonjs" -} diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/abstract-provider.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/abstract-provider.d.ts deleted file mode 100644 index 50659206..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/abstract-provider.d.ts +++ /dev/null @@ -1,451 +0,0 @@ -/** - * The available providers should suffice for most developers purposes, - * but the [[AbstractProvider]] class has many features which enable - * sub-classing it for specific purposes. - * - * @_section: api/providers/abstract-provider: Subclassing Provider [abstract-provider] - */ -import { FetchRequest } from "../utils/index.js"; -import { EnsResolver } from "./ens-resolver.js"; -import { Network } from "./network.js"; -import { Block, FeeData, Log, TransactionReceipt, TransactionResponse } from "./provider.js"; -import type { AddressLike } from "../address/index.js"; -import type { BigNumberish } from "../utils/index.js"; -import type { Listener } from "../utils/index.js"; -import type { Networkish } from "./network.js"; -import type { BlockParams, LogParams, TransactionReceiptParams, TransactionResponseParams } from "./formatting.js"; -import type { BlockTag, EventFilter, Filter, FilterByBlockHash, OrphanFilter, PreparedTransactionRequest, Provider, ProviderEvent, TransactionRequest } from "./provider.js"; -/** - * The types of additional event values that can be emitted for the - * ``"debug"`` event. - */ -export type DebugEventAbstractProvider = { - action: "sendCcipReadFetchRequest"; - request: FetchRequest; - index: number; - urls: Array; -} | { - action: "receiveCcipReadFetchResult"; - request: FetchRequest; - result: any; -} | { - action: "receiveCcipReadFetchError"; - request: FetchRequest; - result: any; -} | { - action: "sendCcipReadCall"; - transaction: { - to: string; - data: string; - }; -} | { - action: "receiveCcipReadCallResult"; - transaction: { - to: string; - data: string; - }; - result: string; -} | { - action: "receiveCcipReadCallError"; - transaction: { - to: string; - data: string; - }; - error: Error; -}; -/** - * The value passed to the [[AbstractProvider-_getSubscriber]] method. - * - * Only developers sub-classing [[AbstractProvider[[ will care about this, - * if they are modifying a low-level feature of how subscriptions operate. - */ -export type Subscription = { - type: "block" | "close" | "debug" | "error" | "finalized" | "network" | "pending" | "safe"; - tag: string; -} | { - type: "transaction"; - tag: string; - hash: string; -} | { - type: "event"; - tag: string; - filter: EventFilter; -} | { - type: "orphan"; - tag: string; - filter: OrphanFilter; -}; -/** - * A **Subscriber** manages a subscription. - * - * Only developers sub-classing [[AbstractProvider[[ will care about this, - * if they are modifying a low-level feature of how subscriptions operate. - */ -export interface Subscriber { - /** - * Called initially when a subscriber is added the first time. - */ - start(): void; - /** - * Called when there are no more subscribers to the event. - */ - stop(): void; - /** - * Called when the subscription should pause. - * - * If %%dropWhilePaused%%, events that occur while paused should not - * be emitted [[resume]]. - */ - pause(dropWhilePaused?: boolean): void; - /** - * Resume a paused subscriber. - */ - resume(): void; - /** - * The frequency (in ms) to poll for events, if polling is used by - * the subscriber. - * - * For non-polling subscribers, this must return ``undefined``. - */ - pollingInterval?: number; -} -/** - * An **UnmanagedSubscriber** is useful for events which do not require - * any additional management, such as ``"debug"`` which only requires - * emit in synchronous event loop triggered calls. - */ -export declare class UnmanagedSubscriber implements Subscriber { - /** - * The name fof the event. - */ - name: string; - /** - * Create a new UnmanagedSubscriber with %%name%%. - */ - constructor(name: string); - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; -} -/** - * An **AbstractPlugin** is used to provide additional internal services - * to an [[AbstractProvider]] without adding backwards-incompatible changes - * to method signatures or other internal and complex logic. - */ -export interface AbstractProviderPlugin { - /** - * The reverse domain notation of the plugin. - */ - readonly name: string; - /** - * Creates a new instance of the plugin, connected to %%provider%%. - */ - connect(provider: AbstractProvider): AbstractProviderPlugin; -} -/** - * A normalized filter used for [[PerformActionRequest]] objects. - */ -export type PerformActionFilter = { - address?: string | Array; - topics?: Array>; - fromBlock?: BlockTag; - toBlock?: BlockTag; -} | { - address?: string | Array; - topics?: Array>; - blockHash?: string; -}; -/** - * A normalized transactions used for [[PerformActionRequest]] objects. - */ -export interface PerformActionTransaction extends PreparedTransactionRequest { - /** - * The ``to`` address of the transaction. - */ - to?: string; - /** - * The sender of the transaction. - */ - from?: string; -} -/** - * The [[AbstractProvider]] methods will normalize all values and pass this - * type to [[AbstractProvider-_perform]]. - */ -export type PerformActionRequest = { - method: "broadcastTransaction"; - signedTransaction: string; -} | { - method: "call"; - transaction: PerformActionTransaction; - blockTag: BlockTag; -} | { - method: "chainId"; -} | { - method: "estimateGas"; - transaction: PerformActionTransaction; -} | { - method: "getBalance"; - address: string; - blockTag: BlockTag; -} | { - method: "getBlock"; - blockTag: BlockTag; - includeTransactions: boolean; -} | { - method: "getBlock"; - blockHash: string; - includeTransactions: boolean; -} | { - method: "getBlockNumber"; -} | { - method: "getCode"; - address: string; - blockTag: BlockTag; -} | { - method: "getGasPrice"; -} | { - method: "getLogs"; - filter: PerformActionFilter; -} | { - method: "getPriorityFee"; -} | { - method: "getStorage"; - address: string; - position: bigint; - blockTag: BlockTag; -} | { - method: "getTransaction"; - hash: string; -} | { - method: "getTransactionCount"; - address: string; - blockTag: BlockTag; -} | { - method: "getTransactionReceipt"; - hash: string; -} | { - method: "getTransactionResult"; - hash: string; -}; -/** - * Options for configuring some internal aspects of an [[AbstractProvider]]. - * - * **``cacheTimeout``** - how long to cache a low-level ``_perform`` - * for, based on input parameters. This reduces the number of calls - * to getChainId and getBlockNumber, but may break test chains which - * can perform operations (internally) synchronously. Use ``-1`` to - * disable, ``0`` will only buffer within the same event loop and - * any other value is in ms. (default: ``250``) - */ -export type AbstractProviderOptions = { - cacheTimeout?: number; - pollingInterval?: number; -}; -/** - * An **AbstractProvider** provides a base class for other sub-classes to - * implement the [[Provider]] API by normalizing input arguments and - * formatting output results as well as tracking events for consistent - * behaviour on an eventually-consistent network. - */ -export declare class AbstractProvider implements Provider { - #private; - /** - * Create a new **AbstractProvider** connected to %%network%%, or - * use the various network detection capabilities to discover the - * [[Network]] if necessary. - */ - constructor(_network?: "any" | Networkish, options?: AbstractProviderOptions); - get pollingInterval(): number; - /** - * Returns ``this``, to allow an **AbstractProvider** to implement - * the [[ContractRunner]] interface. - */ - get provider(): this; - /** - * Returns all the registered plug-ins. - */ - get plugins(): Array; - /** - * Attach a new plug-in. - */ - attachPlugin(plugin: AbstractProviderPlugin): this; - /** - * Get a plugin by name. - */ - getPlugin(name: string): null | T; - /** - * Prevent any CCIP-read operation, regardless of whether requested - * in a [[call]] using ``enableCcipRead``. - */ - get disableCcipRead(): boolean; - set disableCcipRead(value: boolean); - /** - * Resolves to the data for executing the CCIP-read operations. - */ - ccipReadFetch(tx: PerformActionTransaction, calldata: string, urls: Array): Promise; - /** - * Provides the opportunity for a sub-class to wrap a block before - * returning it, to add additional properties or an alternate - * sub-class of [[Block]]. - */ - _wrapBlock(value: BlockParams, network: Network): Block; - /** - * Provides the opportunity for a sub-class to wrap a log before - * returning it, to add additional properties or an alternate - * sub-class of [[Log]]. - */ - _wrapLog(value: LogParams, network: Network): Log; - /** - * Provides the opportunity for a sub-class to wrap a transaction - * receipt before returning it, to add additional properties or an - * alternate sub-class of [[TransactionReceipt]]. - */ - _wrapTransactionReceipt(value: TransactionReceiptParams, network: Network): TransactionReceipt; - /** - * Provides the opportunity for a sub-class to wrap a transaction - * response before returning it, to add additional properties or an - * alternate sub-class of [[TransactionResponse]]. - */ - _wrapTransactionResponse(tx: TransactionResponseParams, network: Network): TransactionResponse; - /** - * Resolves to the Network, forcing a network detection using whatever - * technique the sub-class requires. - * - * Sub-classes **must** override this. - */ - _detectNetwork(): Promise; - /** - * Sub-classes should use this to perform all built-in operations. All - * methods sanitizes and normalizes the values passed into this. - * - * Sub-classes **must** override this. - */ - _perform(req: PerformActionRequest): Promise; - getBlockNumber(): Promise; - /** - * Returns or resolves to the address for %%address%%, resolving ENS - * names and [[Addressable]] objects and returning if already an - * address. - */ - _getAddress(address: AddressLike): string | Promise; - /** - * Returns or resolves to a valid block tag for %%blockTag%%, resolving - * negative values and returning if already a valid block tag. - */ - _getBlockTag(blockTag?: BlockTag): string | Promise; - /** - * Returns or resolves to a filter for %%filter%%, resolving any ENS - * names or [[Addressable]] object and returning if already a valid - * filter. - */ - _getFilter(filter: Filter | FilterByBlockHash): PerformActionFilter | Promise; - /** - * Returns or resolves to a transaction for %%request%%, resolving - * any ENS names or [[Addressable]] and returning if already a valid - * transaction. - */ - _getTransactionRequest(_request: TransactionRequest): PerformActionTransaction | Promise; - getNetwork(): Promise; - getFeeData(): Promise; - estimateGas(_tx: TransactionRequest): Promise; - call(_tx: TransactionRequest): Promise; - getBalance(address: AddressLike, blockTag?: BlockTag): Promise; - getTransactionCount(address: AddressLike, blockTag?: BlockTag): Promise; - getCode(address: AddressLike, blockTag?: BlockTag): Promise; - getStorage(address: AddressLike, _position: BigNumberish, blockTag?: BlockTag): Promise; - broadcastTransaction(signedTx: string): Promise; - getBlock(block: BlockTag | string, prefetchTxs?: boolean): Promise; - getTransaction(hash: string): Promise; - getTransactionReceipt(hash: string): Promise; - getTransactionResult(hash: string): Promise; - getLogs(_filter: Filter | FilterByBlockHash): Promise>; - _getProvider(chainId: number): AbstractProvider; - getResolver(name: string): Promise; - getAvatar(name: string): Promise; - resolveName(name: string): Promise; - lookupAddress(address: string): Promise; - waitForTransaction(hash: string, _confirms?: null | number, timeout?: null | number): Promise; - waitForBlock(blockTag?: BlockTag): Promise; - /** - * Clear a timer created using the [[_setTimeout]] method. - */ - _clearTimeout(timerId: number): void; - /** - * Create a timer that will execute %%func%% after at least %%timeout%% - * (in ms). If %%timeout%% is unspecified, then %%func%% will execute - * in the next event loop. - * - * [Pausing](AbstractProvider-paused) the provider will pause any - * associated timers. - */ - _setTimeout(_func: () => void, timeout?: number): number; - /** - * Perform %%func%% on each subscriber. - */ - _forEachSubscriber(func: (s: Subscriber) => void): void; - /** - * Sub-classes may override this to customize subscription - * implementations. - */ - _getSubscriber(sub: Subscription): Subscriber; - /** - * If a [[Subscriber]] fails and needs to replace itself, this - * method may be used. - * - * For example, this is used for providers when using the - * ``eth_getFilterChanges`` method, which can return null if state - * filters are not supported by the backend, allowing the Subscriber - * to swap in a [[PollingEventSubscriber]]. - */ - _recoverSubscriber(oldSub: Subscriber, newSub: Subscriber): void; - on(event: ProviderEvent, listener: Listener): Promise; - once(event: ProviderEvent, listener: Listener): Promise; - emit(event: ProviderEvent, ...args: Array): Promise; - listenerCount(event?: ProviderEvent): Promise; - listeners(event?: ProviderEvent): Promise>; - off(event: ProviderEvent, listener?: Listener): Promise; - removeAllListeners(event?: ProviderEvent): Promise; - addListener(event: ProviderEvent, listener: Listener): Promise; - removeListener(event: ProviderEvent, listener: Listener): Promise; - /** - * If this provider has been destroyed using the [[destroy]] method. - * - * Once destroyed, all resources are reclaimed, internal event loops - * and timers are cleaned up and no further requests may be sent to - * the provider. - */ - get destroyed(): boolean; - /** - * Sub-classes may use this to shutdown any sockets or release their - * resources and reject any pending requests. - * - * Sub-classes **must** call ``super.destroy()``. - */ - destroy(): void; - /** - * Whether the provider is currently paused. - * - * A paused provider will not emit any events, and generally should - * not make any requests to the network, but that is up to sub-classes - * to manage. - * - * Setting ``paused = true`` is identical to calling ``.pause(false)``, - * which will buffer any events that occur while paused until the - * provider is unpaused. - */ - get paused(): boolean; - set paused(pause: boolean); - /** - * Pause the provider. If %%dropWhilePaused%%, any events that occur - * while paused are dropped, otherwise all events will be emitted once - * the provider is unpaused. - */ - pause(dropWhilePaused?: boolean): void; - /** - * Resume the provider. - */ - resume(): void; -} -//# sourceMappingURL=abstract-provider.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/abstract-provider.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/abstract-provider.d.ts.map deleted file mode 100644 index 740581dc..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/abstract-provider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abstract-provider.d.ts","sourceRoot":"","sources":["../../src.ts/providers/abstract-provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAeH,OAAO,EAIH,YAAY,EAIf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIhD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAe,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,kBAAkB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K,EAAE,OAAO,EAQxB;IAED;;;;OAIG;IACH,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI;IAsBtC;;OAEG;IACH,MAAM,IAAI,IAAI;CAiBjB"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/abstract-provider.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/abstract-provider.js deleted file mode 100644 index 9a53a48b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/abstract-provider.js +++ /dev/null @@ -1,1409 +0,0 @@ -"use strict"; -/** - * The available providers should suffice for most developers purposes, - * but the [[AbstractProvider]] class has many features which enable - * sub-classing it for specific purposes. - * - * @_section: api/providers/abstract-provider: Subclassing Provider [abstract-provider] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.AbstractProvider = exports.UnmanagedSubscriber = void 0; -// @TODO -// Event coalescence -// When we register an event with an async value (e.g. address is a Signer -// or ENS name), we need to add it immeidately for the Event API, but also -// need time to resolve the address. Upon resolving the address, we need to -// migrate the listener to the static event. We also need to maintain a map -// of Signer/ENS name to address so we can sync respond to listenerCount. -const index_js_1 = require("../address/index.js"); -const index_js_2 = require("../constants/index.js"); -const index_js_3 = require("../contract/index.js"); -const index_js_4 = require("../hash/index.js"); -const index_js_5 = require("../transaction/index.js"); -const index_js_6 = require("../utils/index.js"); -const ens_resolver_js_1 = require("./ens-resolver.js"); -const format_js_1 = require("./format.js"); -const network_js_1 = require("./network.js"); -const provider_js_1 = require("./provider.js"); -const subscriber_polling_js_1 = require("./subscriber-polling.js"); -// Constants -const BN_2 = BigInt(2); -const MAX_CCIP_REDIRECTS = 10; -function isPromise(value) { - return (value && typeof (value.then) === "function"); -} -function getTag(prefix, value) { - return prefix + ":" + JSON.stringify(value, (k, v) => { - if (v == null) { - return "null"; - } - if (typeof (v) === "bigint") { - return `bigint:${v.toString()}`; - } - if (typeof (v) === "string") { - return v.toLowerCase(); - } - // Sort object keys - if (typeof (v) === "object" && !Array.isArray(v)) { - const keys = Object.keys(v); - keys.sort(); - return keys.reduce((accum, key) => { - accum[key] = v[key]; - return accum; - }, {}); - } - return v; - }); -} -/** - * An **UnmanagedSubscriber** is useful for events which do not require - * any additional management, such as ``"debug"`` which only requires - * emit in synchronous event loop triggered calls. - */ -class UnmanagedSubscriber { - /** - * The name fof the event. - */ - name; - /** - * Create a new UnmanagedSubscriber with %%name%%. - */ - constructor(name) { (0, index_js_6.defineProperties)(this, { name }); } - start() { } - stop() { } - pause(dropWhilePaused) { } - resume() { } -} -exports.UnmanagedSubscriber = UnmanagedSubscriber; -function copy(value) { - return JSON.parse(JSON.stringify(value)); -} -function concisify(items) { - items = Array.from((new Set(items)).values()); - items.sort(); - return items; -} -async function getSubscription(_event, provider) { - if (_event == null) { - throw new Error("invalid event"); - } - // Normalize topic array info an EventFilter - if (Array.isArray(_event)) { - _event = { topics: _event }; - } - if (typeof (_event) === "string") { - switch (_event) { - case "block": - case "debug": - case "error": - case "finalized": - case "network": - case "pending": - case "safe": { - return { type: _event, tag: _event }; - } - } - } - if ((0, index_js_6.isHexString)(_event, 32)) { - const hash = _event.toLowerCase(); - return { type: "transaction", tag: getTag("tx", { hash }), hash }; - } - if (_event.orphan) { - const event = _event; - // @TODO: Should lowercase and whatnot things here instead of copy... - return { type: "orphan", tag: getTag("orphan", event), filter: copy(event) }; - } - if ((_event.address || _event.topics)) { - const event = _event; - const filter = { - topics: ((event.topics || []).map((t) => { - if (t == null) { - return null; - } - if (Array.isArray(t)) { - return concisify(t.map((t) => t.toLowerCase())); - } - return t.toLowerCase(); - })) - }; - if (event.address) { - const addresses = []; - const promises = []; - const addAddress = (addr) => { - if ((0, index_js_6.isHexString)(addr)) { - addresses.push(addr); - } - else { - promises.push((async () => { - addresses.push(await (0, index_js_1.resolveAddress)(addr, provider)); - })()); - } - }; - if (Array.isArray(event.address)) { - event.address.forEach(addAddress); - } - else { - addAddress(event.address); - } - if (promises.length) { - await Promise.all(promises); - } - filter.address = concisify(addresses.map((a) => a.toLowerCase())); - } - return { filter, tag: getTag("event", filter), type: "event" }; - } - (0, index_js_6.assertArgument)(false, "unknown ProviderEvent", "event", _event); -} -function getTime() { return (new Date()).getTime(); } -const defaultOptions = { - cacheTimeout: 250, - pollingInterval: 4000 -}; -/** - * An **AbstractProvider** provides a base class for other sub-classes to - * implement the [[Provider]] API by normalizing input arguments and - * formatting output results as well as tracking events for consistent - * behaviour on an eventually-consistent network. - */ -class AbstractProvider { - #subs; - #plugins; - // null=unpaused, true=paused+dropWhilePaused, false=paused - #pausedState; - #destroyed; - #networkPromise; - #anyNetwork; - #performCache; - // The most recent block number if running an event or -1 if no "block" event - #lastBlockNumber; - #nextTimer; - #timers; - #disableCcipRead; - #options; - /** - * Create a new **AbstractProvider** connected to %%network%%, or - * use the various network detection capabilities to discover the - * [[Network]] if necessary. - */ - constructor(_network, options) { - this.#options = Object.assign({}, defaultOptions, options || {}); - if (_network === "any") { - this.#anyNetwork = true; - this.#networkPromise = null; - } - else if (_network) { - const network = network_js_1.Network.from(_network); - this.#anyNetwork = false; - this.#networkPromise = Promise.resolve(network); - setTimeout(() => { this.emit("network", network, null); }, 0); - } - else { - this.#anyNetwork = false; - this.#networkPromise = null; - } - this.#lastBlockNumber = -1; - this.#performCache = new Map(); - this.#subs = new Map(); - this.#plugins = new Map(); - this.#pausedState = null; - this.#destroyed = false; - this.#nextTimer = 1; - this.#timers = new Map(); - this.#disableCcipRead = false; - } - get pollingInterval() { return this.#options.pollingInterval; } - /** - * Returns ``this``, to allow an **AbstractProvider** to implement - * the [[ContractRunner]] interface. - */ - get provider() { return this; } - /** - * Returns all the registered plug-ins. - */ - get plugins() { - return Array.from(this.#plugins.values()); - } - /** - * Attach a new plug-in. - */ - attachPlugin(plugin) { - if (this.#plugins.get(plugin.name)) { - throw new Error(`cannot replace existing plugin: ${plugin.name} `); - } - this.#plugins.set(plugin.name, plugin.connect(this)); - return this; - } - /** - * Get a plugin by name. - */ - getPlugin(name) { - return (this.#plugins.get(name)) || null; - } - /** - * Prevent any CCIP-read operation, regardless of whether requested - * in a [[call]] using ``enableCcipRead``. - */ - get disableCcipRead() { return this.#disableCcipRead; } - set disableCcipRead(value) { this.#disableCcipRead = !!value; } - // Shares multiple identical requests made during the same 250ms - async #perform(req) { - const timeout = this.#options.cacheTimeout; - // Caching disabled - if (timeout < 0) { - return await this._perform(req); - } - // Create a tag - const tag = getTag(req.method, req); - let perform = this.#performCache.get(tag); - if (!perform) { - perform = this._perform(req); - this.#performCache.set(tag, perform); - setTimeout(() => { - if (this.#performCache.get(tag) === perform) { - this.#performCache.delete(tag); - } - }, timeout); - } - return await perform; - } - /** - * Resolves to the data for executing the CCIP-read operations. - */ - async ccipReadFetch(tx, calldata, urls) { - if (this.disableCcipRead || urls.length === 0 || tx.to == null) { - return null; - } - const sender = tx.to.toLowerCase(); - const data = calldata.toLowerCase(); - const errorMessages = []; - for (let i = 0; i < urls.length; i++) { - const url = urls[i]; - // URL expansion - const href = url.replace("{sender}", sender).replace("{data}", data); - // If no {data} is present, use POST; otherwise GET - //const json: string | null = (url.indexOf("{data}") >= 0) ? null: JSON.stringify({ data, sender }); - //const result = await fetchJson({ url: href, errorPassThrough: true }, json, (value, response) => { - // value.status = response.statusCode; - // return value; - //}); - const request = new index_js_6.FetchRequest(href); - if (url.indexOf("{data}") === -1) { - request.body = { data, sender }; - } - this.emit("debug", { action: "sendCcipReadFetchRequest", request, index: i, urls }); - let errorMessage = "unknown error"; - // Fetch the resource... - let resp; - try { - resp = await request.send(); - } - catch (error) { - // ...low-level fetch error (missing host, bad SSL, etc.), - // so try next URL - errorMessages.push(error.message); - this.emit("debug", { action: "receiveCcipReadFetchError", request, result: { error } }); - continue; - } - try { - const result = resp.bodyJson; - if (result.data) { - this.emit("debug", { action: "receiveCcipReadFetchResult", request, result }); - return result.data; - } - if (result.message) { - errorMessage = result.message; - } - this.emit("debug", { action: "receiveCcipReadFetchError", request, result }); - } - catch (error) { } - // 4xx indicates the result is not present; stop - (0, index_js_6.assert)(resp.statusCode < 400 || resp.statusCode >= 500, `response not found during CCIP fetch: ${errorMessage}`, "OFFCHAIN_FAULT", { reason: "404_MISSING_RESOURCE", transaction: tx, info: { url, errorMessage } }); - // 5xx indicates server issue; try the next url - errorMessages.push(errorMessage); - } - (0, index_js_6.assert)(false, `error encountered during CCIP fetch: ${errorMessages.map((m) => JSON.stringify(m)).join(", ")}`, "OFFCHAIN_FAULT", { - reason: "500_SERVER_ERROR", - transaction: tx, info: { urls, errorMessages } - }); - } - /** - * Provides the opportunity for a sub-class to wrap a block before - * returning it, to add additional properties or an alternate - * sub-class of [[Block]]. - */ - _wrapBlock(value, network) { - return new provider_js_1.Block((0, format_js_1.formatBlock)(value), this); - } - /** - * Provides the opportunity for a sub-class to wrap a log before - * returning it, to add additional properties or an alternate - * sub-class of [[Log]]. - */ - _wrapLog(value, network) { - return new provider_js_1.Log((0, format_js_1.formatLog)(value), this); - } - /** - * Provides the opportunity for a sub-class to wrap a transaction - * receipt before returning it, to add additional properties or an - * alternate sub-class of [[TransactionReceipt]]. - */ - _wrapTransactionReceipt(value, network) { - return new provider_js_1.TransactionReceipt((0, format_js_1.formatTransactionReceipt)(value), this); - } - /** - * Provides the opportunity for a sub-class to wrap a transaction - * response before returning it, to add additional properties or an - * alternate sub-class of [[TransactionResponse]]. - */ - _wrapTransactionResponse(tx, network) { - return new provider_js_1.TransactionResponse((0, format_js_1.formatTransactionResponse)(tx), this); - } - /** - * Resolves to the Network, forcing a network detection using whatever - * technique the sub-class requires. - * - * Sub-classes **must** override this. - */ - _detectNetwork() { - (0, index_js_6.assert)(false, "sub-classes must implement this", "UNSUPPORTED_OPERATION", { - operation: "_detectNetwork" - }); - } - /** - * Sub-classes should use this to perform all built-in operations. All - * methods sanitizes and normalizes the values passed into this. - * - * Sub-classes **must** override this. - */ - async _perform(req) { - (0, index_js_6.assert)(false, `unsupported method: ${req.method}`, "UNSUPPORTED_OPERATION", { - operation: req.method, - info: req - }); - } - // State - async getBlockNumber() { - const blockNumber = (0, index_js_6.getNumber)(await this.#perform({ method: "getBlockNumber" }), "%response"); - if (this.#lastBlockNumber >= 0) { - this.#lastBlockNumber = blockNumber; - } - return blockNumber; - } - /** - * Returns or resolves to the address for %%address%%, resolving ENS - * names and [[Addressable]] objects and returning if already an - * address. - */ - _getAddress(address) { - return (0, index_js_1.resolveAddress)(address, this); - } - /** - * Returns or resolves to a valid block tag for %%blockTag%%, resolving - * negative values and returning if already a valid block tag. - */ - _getBlockTag(blockTag) { - if (blockTag == null) { - return "latest"; - } - switch (blockTag) { - case "earliest": - return "0x0"; - case "finalized": - case "latest": - case "pending": - case "safe": - return blockTag; - } - if ((0, index_js_6.isHexString)(blockTag)) { - if ((0, index_js_6.isHexString)(blockTag, 32)) { - return blockTag; - } - return (0, index_js_6.toQuantity)(blockTag); - } - if (typeof (blockTag) === "bigint") { - blockTag = (0, index_js_6.getNumber)(blockTag, "blockTag"); - } - if (typeof (blockTag) === "number") { - if (blockTag >= 0) { - return (0, index_js_6.toQuantity)(blockTag); - } - if (this.#lastBlockNumber >= 0) { - return (0, index_js_6.toQuantity)(this.#lastBlockNumber + blockTag); - } - return this.getBlockNumber().then((b) => (0, index_js_6.toQuantity)(b + blockTag)); - } - (0, index_js_6.assertArgument)(false, "invalid blockTag", "blockTag", blockTag); - } - /** - * Returns or resolves to a filter for %%filter%%, resolving any ENS - * names or [[Addressable]] object and returning if already a valid - * filter. - */ - _getFilter(filter) { - // Create a canonical representation of the topics - const topics = (filter.topics || []).map((t) => { - if (t == null) { - return null; - } - if (Array.isArray(t)) { - return concisify(t.map((t) => t.toLowerCase())); - } - return t.toLowerCase(); - }); - const blockHash = ("blockHash" in filter) ? filter.blockHash : undefined; - const resolve = (_address, fromBlock, toBlock) => { - let address = undefined; - switch (_address.length) { - case 0: break; - case 1: - address = _address[0]; - break; - default: - _address.sort(); - address = _address; - } - if (blockHash) { - if (fromBlock != null || toBlock != null) { - throw new Error("invalid filter"); - } - } - const filter = {}; - if (address) { - filter.address = address; - } - if (topics.length) { - filter.topics = topics; - } - if (fromBlock) { - filter.fromBlock = fromBlock; - } - if (toBlock) { - filter.toBlock = toBlock; - } - if (blockHash) { - filter.blockHash = blockHash; - } - return filter; - }; - // Addresses could be async (ENS names or Addressables) - let address = []; - if (filter.address) { - if (Array.isArray(filter.address)) { - for (const addr of filter.address) { - address.push(this._getAddress(addr)); - } - } - else { - address.push(this._getAddress(filter.address)); - } - } - let fromBlock = undefined; - if ("fromBlock" in filter) { - fromBlock = this._getBlockTag(filter.fromBlock); - } - let toBlock = undefined; - if ("toBlock" in filter) { - toBlock = this._getBlockTag(filter.toBlock); - } - if (address.filter((a) => (typeof (a) !== "string")).length || - (fromBlock != null && typeof (fromBlock) !== "string") || - (toBlock != null && typeof (toBlock) !== "string")) { - return Promise.all([Promise.all(address), fromBlock, toBlock]).then((result) => { - return resolve(result[0], result[1], result[2]); - }); - } - return resolve(address, fromBlock, toBlock); - } - /** - * Returns or resolves to a transaction for %%request%%, resolving - * any ENS names or [[Addressable]] and returning if already a valid - * transaction. - */ - _getTransactionRequest(_request) { - const request = (0, provider_js_1.copyRequest)(_request); - const promises = []; - ["to", "from"].forEach((key) => { - if (request[key] == null) { - return; - } - const addr = (0, index_js_1.resolveAddress)(request[key], this); - if (isPromise(addr)) { - promises.push((async function () { request[key] = await addr; })()); - } - else { - request[key] = addr; - } - }); - if (request.blockTag != null) { - const blockTag = this._getBlockTag(request.blockTag); - if (isPromise(blockTag)) { - promises.push((async function () { request.blockTag = await blockTag; })()); - } - else { - request.blockTag = blockTag; - } - } - if (promises.length) { - return (async function () { - await Promise.all(promises); - return request; - })(); - } - return request; - } - async getNetwork() { - // No explicit network was set and this is our first time - if (this.#networkPromise == null) { - // Detect the current network (shared with all calls) - const detectNetwork = (async () => { - try { - const network = await this._detectNetwork(); - this.emit("network", network, null); - return network; - } - catch (error) { - if (this.#networkPromise === detectNetwork) { - this.#networkPromise = null; - } - throw error; - } - })(); - this.#networkPromise = detectNetwork; - return (await detectNetwork).clone(); - } - const networkPromise = this.#networkPromise; - const [expected, actual] = await Promise.all([ - networkPromise, - this._detectNetwork() // The actual connected network - ]); - if (expected.chainId !== actual.chainId) { - if (this.#anyNetwork) { - // The "any" network can change, so notify listeners - this.emit("network", actual, expected); - // Update the network if something else hasn't already changed it - if (this.#networkPromise === networkPromise) { - this.#networkPromise = Promise.resolve(actual); - } - } - else { - // Otherwise, we do not allow changes to the underlying network - (0, index_js_6.assert)(false, `network changed: ${expected.chainId} => ${actual.chainId} `, "NETWORK_ERROR", { - event: "changed" - }); - } - } - return expected.clone(); - } - async getFeeData() { - const network = await this.getNetwork(); - const getFeeDataFunc = async () => { - const { _block, gasPrice, priorityFee } = await (0, index_js_6.resolveProperties)({ - _block: this.#getBlock("latest", false), - gasPrice: ((async () => { - try { - const value = await this.#perform({ method: "getGasPrice" }); - return (0, index_js_6.getBigInt)(value, "%response"); - } - catch (error) { } - return null; - })()), - priorityFee: ((async () => { - try { - const value = await this.#perform({ method: "getPriorityFee" }); - return (0, index_js_6.getBigInt)(value, "%response"); - } - catch (error) { } - return null; - })()) - }); - let maxFeePerGas = null; - let maxPriorityFeePerGas = null; - // These are the recommended EIP-1559 heuristics for fee data - const block = this._wrapBlock(_block, network); - if (block && block.baseFeePerGas) { - maxPriorityFeePerGas = (priorityFee != null) ? priorityFee : BigInt("1000000000"); - maxFeePerGas = (block.baseFeePerGas * BN_2) + maxPriorityFeePerGas; - } - return new provider_js_1.FeeData(gasPrice, maxFeePerGas, maxPriorityFeePerGas); - }; - // Check for a FeeDataNetWorkPlugin - const plugin = network.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin"); - if (plugin) { - const req = new index_js_6.FetchRequest(plugin.url); - const feeData = await plugin.processFunc(getFeeDataFunc, this, req); - return new provider_js_1.FeeData(feeData.gasPrice, feeData.maxFeePerGas, feeData.maxPriorityFeePerGas); - } - return await getFeeDataFunc(); - } - async estimateGas(_tx) { - let tx = this._getTransactionRequest(_tx); - if (isPromise(tx)) { - tx = await tx; - } - return (0, index_js_6.getBigInt)(await this.#perform({ - method: "estimateGas", transaction: tx - }), "%response"); - } - async #call(tx, blockTag, attempt) { - (0, index_js_6.assert)(attempt < MAX_CCIP_REDIRECTS, "CCIP read exceeded maximum redirections", "OFFCHAIN_FAULT", { - reason: "TOO_MANY_REDIRECTS", - transaction: Object.assign({}, tx, { blockTag, enableCcipRead: true }) - }); - // This came in as a PerformActionTransaction, so to/from are safe; we can cast - const transaction = (0, provider_js_1.copyRequest)(tx); - try { - return (0, index_js_6.hexlify)(await this._perform({ method: "call", transaction, blockTag })); - } - catch (error) { - // CCIP Read OffchainLookup - if (!this.disableCcipRead && (0, index_js_6.isCallException)(error) && error.data && attempt >= 0 && blockTag === "latest" && transaction.to != null && (0, index_js_6.dataSlice)(error.data, 0, 4) === "0x556f1830") { - const data = error.data; - const txSender = await (0, index_js_1.resolveAddress)(transaction.to, this); - // Parse the CCIP Read Arguments - let ccipArgs; - try { - ccipArgs = parseOffchainLookup((0, index_js_6.dataSlice)(error.data, 4)); - } - catch (error) { - (0, index_js_6.assert)(false, error.message, "OFFCHAIN_FAULT", { - reason: "BAD_DATA", transaction, info: { data } - }); - } - // Check the sender of the OffchainLookup matches the transaction - (0, index_js_6.assert)(ccipArgs.sender.toLowerCase() === txSender.toLowerCase(), "CCIP Read sender mismatch", "CALL_EXCEPTION", { - action: "call", - data, - reason: "OffchainLookup", - transaction: transaction, - invocation: null, - revert: { - signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)", - name: "OffchainLookup", - args: ccipArgs.errorArgs - } - }); - const ccipResult = await this.ccipReadFetch(transaction, ccipArgs.calldata, ccipArgs.urls); - (0, index_js_6.assert)(ccipResult != null, "CCIP Read failed to fetch data", "OFFCHAIN_FAULT", { - reason: "FETCH_FAILED", transaction, info: { data: error.data, errorArgs: ccipArgs.errorArgs } - }); - const tx = { - to: txSender, - data: (0, index_js_6.concat)([ccipArgs.selector, encodeBytes([ccipResult, ccipArgs.extraData])]) - }; - this.emit("debug", { action: "sendCcipReadCall", transaction: tx }); - try { - const result = await this.#call(tx, blockTag, attempt + 1); - this.emit("debug", { action: "receiveCcipReadCallResult", transaction: Object.assign({}, tx), result }); - return result; - } - catch (error) { - this.emit("debug", { action: "receiveCcipReadCallError", transaction: Object.assign({}, tx), error }); - throw error; - } - } - throw error; - } - } - async #checkNetwork(promise) { - const { value } = await (0, index_js_6.resolveProperties)({ - network: this.getNetwork(), - value: promise - }); - return value; - } - async call(_tx) { - const { tx, blockTag } = await (0, index_js_6.resolveProperties)({ - tx: this._getTransactionRequest(_tx), - blockTag: this._getBlockTag(_tx.blockTag) - }); - return await this.#checkNetwork(this.#call(tx, blockTag, _tx.enableCcipRead ? 0 : -1)); - } - // Account - async #getAccountValue(request, _address, _blockTag) { - let address = this._getAddress(_address); - let blockTag = this._getBlockTag(_blockTag); - if (typeof (address) !== "string" || typeof (blockTag) !== "string") { - [address, blockTag] = await Promise.all([address, blockTag]); - } - return await this.#checkNetwork(this.#perform(Object.assign(request, { address, blockTag }))); - } - async getBalance(address, blockTag) { - return (0, index_js_6.getBigInt)(await this.#getAccountValue({ method: "getBalance" }, address, blockTag), "%response"); - } - async getTransactionCount(address, blockTag) { - return (0, index_js_6.getNumber)(await this.#getAccountValue({ method: "getTransactionCount" }, address, blockTag), "%response"); - } - async getCode(address, blockTag) { - return (0, index_js_6.hexlify)(await this.#getAccountValue({ method: "getCode" }, address, blockTag)); - } - async getStorage(address, _position, blockTag) { - const position = (0, index_js_6.getBigInt)(_position, "position"); - return (0, index_js_6.hexlify)(await this.#getAccountValue({ method: "getStorage", position }, address, blockTag)); - } - // Write - async broadcastTransaction(signedTx) { - const { blockNumber, hash, network } = await (0, index_js_6.resolveProperties)({ - blockNumber: this.getBlockNumber(), - hash: this._perform({ - method: "broadcastTransaction", - signedTransaction: signedTx - }), - network: this.getNetwork() - }); - const tx = index_js_5.Transaction.from(signedTx); - if (tx.hash !== hash) { - throw new Error("@TODO: the returned hash did not match"); - } - return this._wrapTransactionResponse(tx, network).replaceableTransaction(blockNumber); - } - async #getBlock(block, includeTransactions) { - // @TODO: Add CustomBlockPlugin check - if ((0, index_js_6.isHexString)(block, 32)) { - return await this.#perform({ - method: "getBlock", blockHash: block, includeTransactions - }); - } - let blockTag = this._getBlockTag(block); - if (typeof (blockTag) !== "string") { - blockTag = await blockTag; - } - return await this.#perform({ - method: "getBlock", blockTag, includeTransactions - }); - } - // Queries - async getBlock(block, prefetchTxs) { - const { network, params } = await (0, index_js_6.resolveProperties)({ - network: this.getNetwork(), - params: this.#getBlock(block, !!prefetchTxs) - }); - if (params == null) { - return null; - } - return this._wrapBlock(params, network); - } - async getTransaction(hash) { - const { network, params } = await (0, index_js_6.resolveProperties)({ - network: this.getNetwork(), - params: this.#perform({ method: "getTransaction", hash }) - }); - if (params == null) { - return null; - } - return this._wrapTransactionResponse(params, network); - } - async getTransactionReceipt(hash) { - const { network, params } = await (0, index_js_6.resolveProperties)({ - network: this.getNetwork(), - params: this.#perform({ method: "getTransactionReceipt", hash }) - }); - if (params == null) { - return null; - } - // Some backends did not backfill the effectiveGasPrice into old transactions - // in the receipt, so we look it up manually and inject it. - if (params.gasPrice == null && params.effectiveGasPrice == null) { - const tx = await this.#perform({ method: "getTransaction", hash }); - if (tx == null) { - throw new Error("report this; could not find tx or effectiveGasPrice"); - } - params.effectiveGasPrice = tx.gasPrice; - } - return this._wrapTransactionReceipt(params, network); - } - async getTransactionResult(hash) { - const { result } = await (0, index_js_6.resolveProperties)({ - network: this.getNetwork(), - result: this.#perform({ method: "getTransactionResult", hash }) - }); - if (result == null) { - return null; - } - return (0, index_js_6.hexlify)(result); - } - // Bloom-filter Queries - async getLogs(_filter) { - let filter = this._getFilter(_filter); - if (isPromise(filter)) { - filter = await filter; - } - const { network, params } = await (0, index_js_6.resolveProperties)({ - network: this.getNetwork(), - params: this.#perform({ method: "getLogs", filter }) - }); - return params.map((p) => this._wrapLog(p, network)); - } - // ENS - _getProvider(chainId) { - (0, index_js_6.assert)(false, "provider cannot connect to target network", "UNSUPPORTED_OPERATION", { - operation: "_getProvider()" - }); - } - async getResolver(name) { - return await ens_resolver_js_1.EnsResolver.fromName(this, name); - } - async getAvatar(name) { - const resolver = await this.getResolver(name); - if (resolver) { - return await resolver.getAvatar(); - } - return null; - } - async resolveName(name) { - const resolver = await this.getResolver(name); - if (resolver) { - return await resolver.getAddress(); - } - return null; - } - async lookupAddress(address) { - address = (0, index_js_1.getAddress)(address); - const node = (0, index_js_4.namehash)(address.substring(2).toLowerCase() + ".addr.reverse"); - try { - const ensAddr = await ens_resolver_js_1.EnsResolver.getEnsAddress(this); - const ensContract = new index_js_3.Contract(ensAddr, [ - "function resolver(bytes32) view returns (address)" - ], this); - const resolver = await ensContract.resolver(node); - if (resolver == null || resolver === index_js_2.ZeroAddress) { - return null; - } - const resolverContract = new index_js_3.Contract(resolver, [ - "function name(bytes32) view returns (string)" - ], this); - const name = await resolverContract.name(node); - // Failed forward resolution - const check = await this.resolveName(name); - if (check !== address) { - return null; - } - return name; - } - catch (error) { - // No data was returned from the resolver - if ((0, index_js_6.isError)(error, "BAD_DATA") && error.value === "0x") { - return null; - } - // Something reerted - if ((0, index_js_6.isError)(error, "CALL_EXCEPTION")) { - return null; - } - throw error; - } - return null; - } - async waitForTransaction(hash, _confirms, timeout) { - const confirms = (_confirms != null) ? _confirms : 1; - if (confirms === 0) { - return this.getTransactionReceipt(hash); - } - return new Promise(async (resolve, reject) => { - let timer = null; - const listener = (async (blockNumber) => { - try { - const receipt = await this.getTransactionReceipt(hash); - if (receipt != null) { - if (blockNumber - receipt.blockNumber + 1 >= confirms) { - resolve(receipt); - //this.off("block", listener); - if (timer) { - clearTimeout(timer); - timer = null; - } - return; - } - } - } - catch (error) { - console.log("EEE", error); - } - this.once("block", listener); - }); - if (timeout != null) { - timer = setTimeout(() => { - if (timer == null) { - return; - } - timer = null; - this.off("block", listener); - reject((0, index_js_6.makeError)("timeout", "TIMEOUT", { reason: "timeout" })); - }, timeout); - } - listener(await this.getBlockNumber()); - }); - } - async waitForBlock(blockTag) { - (0, index_js_6.assert)(false, "not implemented yet", "NOT_IMPLEMENTED", { - operation: "waitForBlock" - }); - } - /** - * Clear a timer created using the [[_setTimeout]] method. - */ - _clearTimeout(timerId) { - const timer = this.#timers.get(timerId); - if (!timer) { - return; - } - if (timer.timer) { - clearTimeout(timer.timer); - } - this.#timers.delete(timerId); - } - /** - * Create a timer that will execute %%func%% after at least %%timeout%% - * (in ms). If %%timeout%% is unspecified, then %%func%% will execute - * in the next event loop. - * - * [Pausing](AbstractProvider-paused) the provider will pause any - * associated timers. - */ - _setTimeout(_func, timeout) { - if (timeout == null) { - timeout = 0; - } - const timerId = this.#nextTimer++; - const func = () => { - this.#timers.delete(timerId); - _func(); - }; - if (this.paused) { - this.#timers.set(timerId, { timer: null, func, time: timeout }); - } - else { - const timer = setTimeout(func, timeout); - this.#timers.set(timerId, { timer, func, time: getTime() }); - } - return timerId; - } - /** - * Perform %%func%% on each subscriber. - */ - _forEachSubscriber(func) { - for (const sub of this.#subs.values()) { - func(sub.subscriber); - } - } - /** - * Sub-classes may override this to customize subscription - * implementations. - */ - _getSubscriber(sub) { - switch (sub.type) { - case "debug": - case "error": - case "network": - return new UnmanagedSubscriber(sub.type); - case "block": { - const subscriber = new subscriber_polling_js_1.PollingBlockSubscriber(this); - subscriber.pollingInterval = this.pollingInterval; - return subscriber; - } - case "safe": - case "finalized": - return new subscriber_polling_js_1.PollingBlockTagSubscriber(this, sub.type); - case "event": - return new subscriber_polling_js_1.PollingEventSubscriber(this, sub.filter); - case "transaction": - return new subscriber_polling_js_1.PollingTransactionSubscriber(this, sub.hash); - case "orphan": - return new subscriber_polling_js_1.PollingOrphanSubscriber(this, sub.filter); - } - throw new Error(`unsupported event: ${sub.type}`); - } - /** - * If a [[Subscriber]] fails and needs to replace itself, this - * method may be used. - * - * For example, this is used for providers when using the - * ``eth_getFilterChanges`` method, which can return null if state - * filters are not supported by the backend, allowing the Subscriber - * to swap in a [[PollingEventSubscriber]]. - */ - _recoverSubscriber(oldSub, newSub) { - for (const sub of this.#subs.values()) { - if (sub.subscriber === oldSub) { - if (sub.started) { - sub.subscriber.stop(); - } - sub.subscriber = newSub; - if (sub.started) { - newSub.start(); - } - if (this.#pausedState != null) { - newSub.pause(this.#pausedState); - } - break; - } - } - } - async #hasSub(event, emitArgs) { - let sub = await getSubscription(event, this); - // This is a log that is removing an existing log; we actually want - // to emit an orphan event for the removed log - if (sub.type === "event" && emitArgs && emitArgs.length > 0 && emitArgs[0].removed === true) { - sub = await getSubscription({ orphan: "drop-log", log: emitArgs[0] }, this); - } - return this.#subs.get(sub.tag) || null; - } - async #getSub(event) { - const subscription = await getSubscription(event, this); - // Prevent tampering with our tag in any subclass' _getSubscriber - const tag = subscription.tag; - let sub = this.#subs.get(tag); - if (!sub) { - const subscriber = this._getSubscriber(subscription); - const addressableMap = new WeakMap(); - const nameMap = new Map(); - sub = { subscriber, tag, addressableMap, nameMap, started: false, listeners: [] }; - this.#subs.set(tag, sub); - } - return sub; - } - async on(event, listener) { - const sub = await this.#getSub(event); - sub.listeners.push({ listener, once: false }); - if (!sub.started) { - sub.subscriber.start(); - sub.started = true; - if (this.#pausedState != null) { - sub.subscriber.pause(this.#pausedState); - } - } - return this; - } - async once(event, listener) { - const sub = await this.#getSub(event); - sub.listeners.push({ listener, once: true }); - if (!sub.started) { - sub.subscriber.start(); - sub.started = true; - if (this.#pausedState != null) { - sub.subscriber.pause(this.#pausedState); - } - } - return this; - } - async emit(event, ...args) { - const sub = await this.#hasSub(event, args); - // If there is not subscription or if a recent emit removed - // the last of them (which also deleted the sub) do nothing - if (!sub || sub.listeners.length === 0) { - return false; - } - ; - const count = sub.listeners.length; - sub.listeners = sub.listeners.filter(({ listener, once }) => { - const payload = new index_js_6.EventPayload(this, (once ? null : listener), event); - try { - listener.call(this, ...args, payload); - } - catch (error) { } - return !once; - }); - if (sub.listeners.length === 0) { - if (sub.started) { - sub.subscriber.stop(); - } - this.#subs.delete(sub.tag); - } - return (count > 0); - } - async listenerCount(event) { - if (event) { - const sub = await this.#hasSub(event); - if (!sub) { - return 0; - } - return sub.listeners.length; - } - let total = 0; - for (const { listeners } of this.#subs.values()) { - total += listeners.length; - } - return total; - } - async listeners(event) { - if (event) { - const sub = await this.#hasSub(event); - if (!sub) { - return []; - } - return sub.listeners.map(({ listener }) => listener); - } - let result = []; - for (const { listeners } of this.#subs.values()) { - result = result.concat(listeners.map(({ listener }) => listener)); - } - return result; - } - async off(event, listener) { - const sub = await this.#hasSub(event); - if (!sub) { - return this; - } - if (listener) { - const index = sub.listeners.map(({ listener }) => listener).indexOf(listener); - if (index >= 0) { - sub.listeners.splice(index, 1); - } - } - if (!listener || sub.listeners.length === 0) { - if (sub.started) { - sub.subscriber.stop(); - } - this.#subs.delete(sub.tag); - } - return this; - } - async removeAllListeners(event) { - if (event) { - const { tag, started, subscriber } = await this.#getSub(event); - if (started) { - subscriber.stop(); - } - this.#subs.delete(tag); - } - else { - for (const [tag, { started, subscriber }] of this.#subs) { - if (started) { - subscriber.stop(); - } - this.#subs.delete(tag); - } - } - return this; - } - // Alias for "on" - async addListener(event, listener) { - return await this.on(event, listener); - } - // Alias for "off" - async removeListener(event, listener) { - return this.off(event, listener); - } - /** - * If this provider has been destroyed using the [[destroy]] method. - * - * Once destroyed, all resources are reclaimed, internal event loops - * and timers are cleaned up and no further requests may be sent to - * the provider. - */ - get destroyed() { - return this.#destroyed; - } - /** - * Sub-classes may use this to shutdown any sockets or release their - * resources and reject any pending requests. - * - * Sub-classes **must** call ``super.destroy()``. - */ - destroy() { - // Stop all listeners - this.removeAllListeners(); - // Shut down all tiemrs - for (const timerId of this.#timers.keys()) { - this._clearTimeout(timerId); - } - this.#destroyed = true; - } - /** - * Whether the provider is currently paused. - * - * A paused provider will not emit any events, and generally should - * not make any requests to the network, but that is up to sub-classes - * to manage. - * - * Setting ``paused = true`` is identical to calling ``.pause(false)``, - * which will buffer any events that occur while paused until the - * provider is unpaused. - */ - get paused() { return (this.#pausedState != null); } - set paused(pause) { - if (!!pause === this.paused) { - return; - } - if (this.paused) { - this.resume(); - } - else { - this.pause(false); - } - } - /** - * Pause the provider. If %%dropWhilePaused%%, any events that occur - * while paused are dropped, otherwise all events will be emitted once - * the provider is unpaused. - */ - pause(dropWhilePaused) { - this.#lastBlockNumber = -1; - if (this.#pausedState != null) { - if (this.#pausedState == !!dropWhilePaused) { - return; - } - (0, index_js_6.assert)(false, "cannot change pause type; resume first", "UNSUPPORTED_OPERATION", { - operation: "pause" - }); - } - this._forEachSubscriber((s) => s.pause(dropWhilePaused)); - this.#pausedState = !!dropWhilePaused; - for (const timer of this.#timers.values()) { - // Clear the timer - if (timer.timer) { - clearTimeout(timer.timer); - } - // Remaining time needed for when we become unpaused - timer.time = getTime() - timer.time; - } - } - /** - * Resume the provider. - */ - resume() { - if (this.#pausedState == null) { - return; - } - this._forEachSubscriber((s) => s.resume()); - this.#pausedState = null; - for (const timer of this.#timers.values()) { - // Remaining time when we were paused - let timeout = timer.time; - if (timeout < 0) { - timeout = 0; - } - // Start time (in cause paused, so we con compute remaininf time) - timer.time = getTime(); - // Start the timer - setTimeout(timer.func, timeout); - } - } -} -exports.AbstractProvider = AbstractProvider; -function _parseString(result, start) { - try { - const bytes = _parseBytes(result, start); - if (bytes) { - return (0, index_js_6.toUtf8String)(bytes); - } - } - catch (error) { } - return null; -} -function _parseBytes(result, start) { - if (result === "0x") { - return null; - } - try { - const offset = (0, index_js_6.getNumber)((0, index_js_6.dataSlice)(result, start, start + 32)); - const length = (0, index_js_6.getNumber)((0, index_js_6.dataSlice)(result, offset, offset + 32)); - return (0, index_js_6.dataSlice)(result, offset + 32, offset + 32 + length); - } - catch (error) { } - return null; -} -function numPad(value) { - const result = (0, index_js_6.toBeArray)(value); - if (result.length > 32) { - throw new Error("internal; should not happen"); - } - const padded = new Uint8Array(32); - padded.set(result, 32 - result.length); - return padded; -} -function bytesPad(value) { - if ((value.length % 32) === 0) { - return value; - } - const result = new Uint8Array(Math.ceil(value.length / 32) * 32); - result.set(value); - return result; -} -const empty = new Uint8Array([]); -// ABI Encodes a series of (bytes, bytes, ...) -function encodeBytes(datas) { - const result = []; - let byteCount = 0; - // Add place-holders for pointers as we add items - for (let i = 0; i < datas.length; i++) { - result.push(empty); - byteCount += 32; - } - for (let i = 0; i < datas.length; i++) { - const data = (0, index_js_6.getBytes)(datas[i]); - // Update the bytes offset - result[i] = numPad(byteCount); - // The length and padded value of data - result.push(numPad(data.length)); - result.push(bytesPad(data)); - byteCount += 32 + Math.ceil(data.length / 32) * 32; - } - return (0, index_js_6.concat)(result); -} -const zeros = "0x0000000000000000000000000000000000000000000000000000000000000000"; -function parseOffchainLookup(data) { - const result = { - sender: "", urls: [], calldata: "", selector: "", extraData: "", errorArgs: [] - }; - (0, index_js_6.assert)((0, index_js_6.dataLength)(data) >= 5 * 32, "insufficient OffchainLookup data", "OFFCHAIN_FAULT", { - reason: "insufficient OffchainLookup data" - }); - const sender = (0, index_js_6.dataSlice)(data, 0, 32); - (0, index_js_6.assert)((0, index_js_6.dataSlice)(sender, 0, 12) === (0, index_js_6.dataSlice)(zeros, 0, 12), "corrupt OffchainLookup sender", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup sender" - }); - result.sender = (0, index_js_6.dataSlice)(sender, 12); - // Read the URLs from the response - try { - const urls = []; - const urlsOffset = (0, index_js_6.getNumber)((0, index_js_6.dataSlice)(data, 32, 64)); - const urlsLength = (0, index_js_6.getNumber)((0, index_js_6.dataSlice)(data, urlsOffset, urlsOffset + 32)); - const urlsData = (0, index_js_6.dataSlice)(data, urlsOffset + 32); - for (let u = 0; u < urlsLength; u++) { - const url = _parseString(urlsData, u * 32); - if (url == null) { - throw new Error("abort"); - } - urls.push(url); - } - result.urls = urls; - } - catch (error) { - (0, index_js_6.assert)(false, "corrupt OffchainLookup urls", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup urls" - }); - } - // Get the CCIP calldata to forward - try { - const calldata = _parseBytes(data, 64); - if (calldata == null) { - throw new Error("abort"); - } - result.calldata = calldata; - } - catch (error) { - (0, index_js_6.assert)(false, "corrupt OffchainLookup calldata", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup calldata" - }); - } - // Get the callbackSelector (bytes4) - (0, index_js_6.assert)((0, index_js_6.dataSlice)(data, 100, 128) === (0, index_js_6.dataSlice)(zeros, 0, 28), "corrupt OffchainLookup callbaackSelector", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup callbaackSelector" - }); - result.selector = (0, index_js_6.dataSlice)(data, 96, 100); - // Get the extra data to send back to the contract as context - try { - const extraData = _parseBytes(data, 128); - if (extraData == null) { - throw new Error("abort"); - } - result.extraData = extraData; - } - catch (error) { - (0, index_js_6.assert)(false, "corrupt OffchainLookup extraData", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup extraData" - }); - } - result.errorArgs = "sender,urls,calldata,selector,extraData".split(/,/).map((k) => result[k]); - return result; -} -//# sourceMappingURL=abstract-provider.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/abstract-provider.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/abstract-provider.js.map deleted file mode 100644 index d08b8a65..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/abstract-provider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abstract-provider.js","sourceRoot":"","sources":["../../src.ts/providers/abstract-provider.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,QAAQ;AACR,oBAAoB;AACpB,4EAA4E;AAC5E,4EAA4E;AAC5E,6EAA6E;AAC7E,6EAA6E;AAC7E,2EAA2E;AAE3E,kDAAiE;AACjE,oDAAoD;AACpD,mDAAgD;AAChD,+CAA4C;AAC5C,sDAAsD;AACtD,gDAQ2B;AAE3B,uDAAgD;AAChD,2CAEqB;AACrB,6CAAuC;AACvC,+C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G,QAAQ,CAAC;KAC9B;IAAC,OAAO,KAAK,EAAE;QACZ,IAAA,iBAAM,EAAC,KAAK,EAAE,iCAAiC,EAAE,gBAAgB,EAAE;YAC/D,MAAM,EAAE,iCAAiC;SAC5C,CAAC,CAAC;KACN;IAED,oCAAoC;IACpC,IAAA,iBAAM,EAAC,IAAA,oBAAS,EAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,KAAK,IAAA,oBAAS,EAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,0CAA0C,EAAE,gBAAgB,EAAE;QACxH,MAAM,EAAE,0CAA0C;KACrD,CAAC,CAAC;IACH,MAAM,CAAC,QAAQ,GAAG,IAAA,oBAAS,EAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC;IAE3C,6DAA6D;IAC7D,IAAI;QACA,MAAM,SAAS,GAAG,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACzC,IAAI,SAAS,IAAI,IAAI,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;SAAE;QACpD,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;KAChC;IAAC,OAAO,KAAK,EAAE;QACZ,IAAA,iBAAM,EAAC,KAAK,EAAE,kCAAkC,EAAE,gBAAgB,EAAE;YAChE,MAAM,EAAE,kCAAkC;SAC7C,CAAC,CAAC;KACN;IAED,MAAM,CAAC,SAAS,GAAG,yCAAyC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAO,MAAO,CAAC,CAAC,CAAC,CAAC,CAAA;IAEpG,OAAO,MAAM,CAAC;AAClB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/abstract-signer.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/abstract-signer.d.ts deleted file mode 100644 index 6bfe2688..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/abstract-signer.d.ts +++ /dev/null @@ -1,69 +0,0 @@ -import type { AuthorizationRequest, TypedDataDomain, TypedDataField } from "../hash/index.js"; -import type { Authorization, TransactionLike } from "../transaction/index.js"; -import type { BlockTag, Provider, TransactionRequest, TransactionResponse } from "./provider.js"; -import type { Signer } from "./signer.js"; -/** - * An **AbstractSigner** includes most of teh functionality required - * to get a [[Signer]] working as expected, but requires a few - * Signer-specific methods be overridden. - * - */ -export declare abstract class AbstractSigner

implements Signer { - /** - * The provider this signer is connected to. - */ - readonly provider: P; - /** - * Creates a new Signer connected to %%provider%%. - */ - constructor(provider?: P); - /** - * Resolves to the Signer address. - */ - abstract getAddress(): Promise; - /** - * Returns the signer connected to %%provider%%. - * - * This may throw, for example, a Signer connected over a Socket or - * to a specific instance of a node may not be transferrable. - */ - abstract connect(provider: null | Provider): Signer; - getNonce(blockTag?: BlockTag): Promise; - populateCall(tx: TransactionRequest): Promise>; - populateTransaction(tx: TransactionRequest): Promise>; - populateAuthorization(_auth: AuthorizationRequest): Promise; - estimateGas(tx: TransactionRequest): Promise; - call(tx: TransactionRequest): Promise; - resolveName(name: string): Promise; - sendTransaction(tx: TransactionRequest): Promise; - authorize(authorization: AuthorizationRequest): Promise; - abstract signTransaction(tx: TransactionRequest): Promise; - abstract signMessage(message: string | Uint8Array): Promise; - abstract signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise; -} -/** - * A **VoidSigner** is a class designed to allow an address to be used - * in any API which accepts a Signer, but for which there are no - * credentials available to perform any actual signing. - * - * This for example allow impersonating an account for the purpose of - * static calls or estimating gas, but does not allow sending transactions. - */ -export declare class VoidSigner extends AbstractSigner { - #private; - /** - * The signer address. - */ - readonly address: string; - /** - * Creates a new **VoidSigner** with %%address%% attached to - * %%provider%%. - */ - constructor(address: string, provider?: null | Provider); - getAddress(): Promise; - connect(provider: null | Provider): VoidSigner; - signTransaction(tx: TransactionRequest): Promise; - signMessage(message: string | Uint8Array): Promise; - signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise; -} -//# sourceMappingURL=abstract-signer.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/abstract-signer.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/abstract-signer.d.ts.map deleted file mode 100644 index 6d2c1c6f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/abstract-signer.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abstract-signer.d.ts","sourceRoot":"","sources":["../../src.ts/providers/abstract-signer.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACR,oBAAoB,EAAE,eAAe,EAAE,cAAc,EACxD,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE9E,OAAO,KAAK,EACR,QAAQ,EAAE,QAAQ,EAAE,kBAAkB,EAAE,mBAAmB,EAC9D,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AA8B1C;;;;;GAKG;AACH,8BAAsB,cAAc,CAAC,CAAC,SAAS,IAAI,GAAG,QAAQ,GAAG,IAAI,GAAG,QAAQ,CAAE,YAAW,MAAM;IAC/F;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAG,CAAC,CAAC;IAEtB;;OAEG;gBACS,QAAQ,CAAC,EAAE,CAAC;IAIxB;;OAEG;IACH,QAAQ,CAAC,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC;IAEtC;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,GAAG,QAAQ,GAAG,MAAM;IAE7C,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;IAI9C,YAAY,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC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CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IAIxD,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;IAI1D,aAAa,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;CAG1I"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/abstract-signer.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/abstract-signer.js deleted file mode 100644 index 29b32e12..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/abstract-signer.js +++ /dev/null @@ -1,249 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.VoidSigner = exports.AbstractSigner = void 0; -/** - * Generally the [[Wallet]] and [[JsonRpcSigner]] and their sub-classes - * are sufficient for most developers, but this is provided to - * fascilitate more complex Signers. - * - * @_section: api/providers/abstract-signer: Subclassing Signer [abstract-signer] - */ -const index_js_1 = require("../address/index.js"); -const index_js_2 = require("../transaction/index.js"); -const index_js_3 = require("../utils/index.js"); -const provider_js_1 = require("./provider.js"); -function checkProvider(signer, operation) { - if (signer.provider) { - return signer.provider; - } - (0, index_js_3.assert)(false, "missing provider", "UNSUPPORTED_OPERATION", { operation }); -} -async function populate(signer, tx) { - let pop = (0, provider_js_1.copyRequest)(tx); - if (pop.to != null) { - pop.to = (0, index_js_1.resolveAddress)(pop.to, signer); - } - if (pop.from != null) { - const from = pop.from; - pop.from = Promise.all([ - signer.getAddress(), - (0, index_js_1.resolveAddress)(from, signer) - ]).then(([address, from]) => { - (0, index_js_3.assertArgument)(address.toLowerCase() === from.toLowerCase(), "transaction from mismatch", "tx.from", from); - return address; - }); - } - else { - pop.from = signer.getAddress(); - } - return await (0, index_js_3.resolveProperties)(pop); -} -/** - * An **AbstractSigner** includes most of teh functionality required - * to get a [[Signer]] working as expected, but requires a few - * Signer-specific methods be overridden. - * - */ -class AbstractSigner { - /** - * The provider this signer is connected to. - */ - provider; - /** - * Creates a new Signer connected to %%provider%%. - */ - constructor(provider) { - (0, index_js_3.defineProperties)(this, { provider: (provider || null) }); - } - async getNonce(blockTag) { - return checkProvider(this, "getTransactionCount").getTransactionCount(await this.getAddress(), blockTag); - } - async populateCall(tx) { - const pop = await populate(this, tx); - return pop; - } - async populateTransaction(tx) { - const provider = checkProvider(this, "populateTransaction"); - const pop = await populate(this, tx); - if (pop.nonce == null) { - pop.nonce = await this.getNonce("pending"); - } - if (pop.gasLimit == null) { - pop.gasLimit = await this.estimateGas(pop); - } - // Populate the chain ID - const network = await (this.provider).getNetwork(); - if (pop.chainId != null) { - const chainId = (0, index_js_3.getBigInt)(pop.chainId); - (0, index_js_3.assertArgument)(chainId === network.chainId, "transaction chainId mismatch", "tx.chainId", tx.chainId); - } - else { - pop.chainId = network.chainId; - } - // Do not allow mixing pre-eip-1559 and eip-1559 properties - const hasEip1559 = (pop.maxFeePerGas != null || pop.maxPriorityFeePerGas != null); - if (pop.gasPrice != null && (pop.type === 2 || hasEip1559)) { - (0, index_js_3.assertArgument)(false, "eip-1559 transaction do not support gasPrice", "tx", tx); - } - else if ((pop.type === 0 || pop.type === 1) && hasEip1559) { - (0, index_js_3.assertArgument)(false, "pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas", "tx", tx); - } - if ((pop.type === 2 || pop.type == null) && (pop.maxFeePerGas != null && pop.maxPriorityFeePerGas != null)) { - // Fully-formed EIP-1559 transaction (skip getFeeData) - pop.type = 2; - } - else if (pop.type === 0 || pop.type === 1) { - // Explicit Legacy or EIP-2930 transaction - // We need to get fee data to determine things - const feeData = await provider.getFeeData(); - (0, index_js_3.assert)(feeData.gasPrice != null, "network does not support gasPrice", "UNSUPPORTED_OPERATION", { - operation: "getGasPrice" - }); - // Populate missing gasPrice - if (pop.gasPrice == null) { - pop.gasPrice = feeData.gasPrice; - } - } - else { - // We need to get fee data to determine things - const feeData = await provider.getFeeData(); - if (pop.type == null) { - // We need to auto-detect the intended type of this transaction... - if (feeData.maxFeePerGas != null && feeData.maxPriorityFeePerGas != null) { - // The network supports EIP-1559! - // Upgrade transaction from null to eip-1559 - if (pop.authorizationList && pop.authorizationList.length) { - pop.type = 4; - } - else { - pop.type = 2; - } - if (pop.gasPrice != null) { - // Using legacy gasPrice property on an eip-1559 network, - // so use gasPrice as both fee properties - const gasPrice = pop.gasPrice; - delete pop.gasPrice; - pop.maxFeePerGas = gasPrice; - pop.maxPriorityFeePerGas = gasPrice; - } - else { - // Populate missing fee data - if (pop.maxFeePerGas == null) { - pop.maxFeePerGas = feeData.maxFeePerGas; - } - if (pop.maxPriorityFeePerGas == null) { - pop.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas; - } - } - } - else if (feeData.gasPrice != null) { - // Network doesn't support EIP-1559... - // ...but they are trying to use EIP-1559 properties - (0, index_js_3.assert)(!hasEip1559, "network does not support EIP-1559", "UNSUPPORTED_OPERATION", { - operation: "populateTransaction" - }); - // Populate missing fee data - if (pop.gasPrice == null) { - pop.gasPrice = feeData.gasPrice; - } - // Explicitly set untyped transaction to legacy - // @TODO: Maybe this shold allow type 1? - pop.type = 0; - } - else { - // getFeeData has failed us. - (0, index_js_3.assert)(false, "failed to get consistent fee data", "UNSUPPORTED_OPERATION", { - operation: "signer.getFeeData" - }); - } - } - else if (pop.type === 2 || pop.type === 3 || pop.type === 4) { - // Explicitly using EIP-1559 or EIP-4844 - // Populate missing fee data - if (pop.maxFeePerGas == null) { - pop.maxFeePerGas = feeData.maxFeePerGas; - } - if (pop.maxPriorityFeePerGas == null) { - pop.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas; - } - } - } - //@TOOD: Don't await all over the place; save them up for - // the end for better batching - return await (0, index_js_3.resolveProperties)(pop); - } - async populateAuthorization(_auth) { - const auth = Object.assign({}, _auth); - // Add a chain ID if not explicitly set to 0 - if (auth.chainId == null) { - auth.chainId = (await checkProvider(this, "getNetwork").getNetwork()).chainId; - } - // @TODO: Take chain ID into account when populating noce? - if (auth.nonce == null) { - auth.nonce = await this.getNonce(); - } - return auth; - } - async estimateGas(tx) { - return checkProvider(this, "estimateGas").estimateGas(await this.populateCall(tx)); - } - async call(tx) { - return checkProvider(this, "call").call(await this.populateCall(tx)); - } - async resolveName(name) { - const provider = checkProvider(this, "resolveName"); - return await provider.resolveName(name); - } - async sendTransaction(tx) { - const provider = checkProvider(this, "sendTransaction"); - const pop = await this.populateTransaction(tx); - delete pop.from; - const txObj = index_js_2.Transaction.from(pop); - return await provider.broadcastTransaction(await this.signTransaction(txObj)); - } - // @TODO: in v7 move this to be abstract - authorize(authorization) { - (0, index_js_3.assert)(false, "authorization not implemented for this signer", "UNSUPPORTED_OPERATION", { operation: "authorize" }); - } -} -exports.AbstractSigner = AbstractSigner; -/** - * A **VoidSigner** is a class designed to allow an address to be used - * in any API which accepts a Signer, but for which there are no - * credentials available to perform any actual signing. - * - * This for example allow impersonating an account for the purpose of - * static calls or estimating gas, but does not allow sending transactions. - */ -class VoidSigner extends AbstractSigner { - /** - * The signer address. - */ - address; - /** - * Creates a new **VoidSigner** with %%address%% attached to - * %%provider%%. - */ - constructor(address, provider) { - super(provider); - (0, index_js_3.defineProperties)(this, { address }); - } - async getAddress() { return this.address; } - connect(provider) { - return new VoidSigner(this.address, provider); - } - #throwUnsupported(suffix, operation) { - (0, index_js_3.assert)(false, `VoidSigner cannot sign ${suffix}`, "UNSUPPORTED_OPERATION", { operation }); - } - async signTransaction(tx) { - this.#throwUnsupported("transactions", "signTransaction"); - } - async signMessage(message) { - this.#throwUnsupported("messages", "signMessage"); - } - async signTypedData(domain, types, value) { - this.#throwUnsupported("typed-data", "signTypedData"); - } -} -exports.VoidSigner = VoidSigner; -//# sourceMappingURL=abstract-signer.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/abstract-signer.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/abstract-signer.js.map deleted file mode 100644 index 1f32a9dc..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/abstract-signer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abstract-signer.js","sourceRoot":"","sources":["../../src.ts/providers/abstract-signer.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,kDAAqD;AACrD,sDAAsD;AACtD,gDAG2B;AAE3B,+CAA4C;AAY5C,SAAS,aAAa,CAAC,MAAsB,EAAE,SAAiB;IAC5D,IAAI,MAAM,CAAC,QAAQ,EAAE;QAAE,OAAO,MAAM,CAAC,QAAQ,CAAC;KAAE;IAChD,IAAA,iBAAM,EAAC,KAAK,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;AAC9E,CAAC;AAED,KAAK,UAAU,QAAQ,CAAC,MAAsB,EAAE,EAAsB;IAClE,IAAI,GAAG,GAAQ,IAAA,yBAAW,EAAC,EAAE,CAAC,CAAC;IAE/B,IAAI,GAAG,CAAC,EAAE,IAAI,IAAI,EAAE;QAAE,GAAG,CAAC,EAAE,GAAG,IAAA,yBAAc,EAAC,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;KAAE;IAEhE,IAAI,GAAG,CAAC,IAAI,IAAI,IAAI,EAAE;QAClB,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;QACtB,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC;YACnB,MAAM,CAAC,UAAU,EAAE;YACnB,IAAA,yBAAc,EAAC,IAAI,EAAE,MAAM,CAAC;SAC/B,CAAC,CAAC,IAAI,CAAC,CAAC,CAAE,OAAO,EAAE,IAAI,CAAE,EAAE,EAAE;YAC1B,IAAA,yBAAc,EAAC,OAAO,CAAC,WAA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C,MAAuB,EAAE,KAA4C,EAAE,KAA0B;QACjH,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;IAC1D,CAAC;CACJ;AApCD,gCAoCC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/community.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/community.d.ts deleted file mode 100644 index db64d2db..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/community.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * There are many awesome community services that provide Ethereum - * nodes both for developers just starting out and for large-scale - * communities. - * - * @_section: api/providers/thirdparty: Community Providers [thirdparty] - */ -/** - * Providers which offer community credentials should extend this - * to notify any interested consumers whether community credentials - * are in-use. - */ -export interface CommunityResourcable { - /** - * Returns true if the instance is connected using the community - * credentials. - */ - isCommunityResource(): boolean; -} -/** - * Displays a warning in the console when the community resource is - * being used too heavily by the app, recommending the developer - * acquire their own credentials instead of using the community - * credentials. - * - * The notification will only occur once per service. - */ -export declare function showThrottleMessage(service: string): void; -//# sourceMappingURL=community.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/community.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/community.d.ts.map deleted file mode 100644 index ffecbb46..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/community.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"community.d.ts","sourceRoot":"","sources":["../../src.ts/providers/community.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACjC;;;OAGG;IACH,mBAAmB,IAAI,OAAO,CAAC;CAClC;AAKD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAgBzD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/community.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/community.js deleted file mode 100644 index db40e1a0..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/community.js +++ /dev/null @@ -1,40 +0,0 @@ -"use strict"; -/** - * There are many awesome community services that provide Ethereum - * nodes both for developers just starting out and for large-scale - * communities. - * - * @_section: api/providers/thirdparty: Community Providers [thirdparty] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.showThrottleMessage = void 0; -// Show the throttle message only once per service -const shown = new Set(); -/** - * Displays a warning in the console when the community resource is - * being used too heavily by the app, recommending the developer - * acquire their own credentials instead of using the community - * credentials. - * - * The notification will only occur once per service. - */ -function showThrottleMessage(service) { - if (shown.has(service)) { - return; - } - shown.add(service); - console.log("========= NOTICE ========="); - console.log(`Request-Rate Exceeded for ${service} (this message will not be repeated)`); - console.log(""); - console.log("The default API keys for each service are provided as a highly-throttled,"); - console.log("community resource for low-traffic projects and early prototyping."); - console.log(""); - console.log("While your application will continue to function, we highly recommended"); - console.log("signing up for your own API keys to improve performance, increase your"); - console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."); - console.log(""); - console.log("For more details: https:/\/docs.ethers.org/api-keys/"); - console.log("=========================="); -} -exports.showThrottleMessage = showThrottleMessage; -//# sourceMappingURL=community.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/community.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/community.js.map deleted file mode 100644 index 75fa41cc..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/community.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"community.js","sourceRoot":"","sources":["../../src.ts/providers/community.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAeH,kDAAkD;AAClD,MAAM,KAAK,GAAgB,IAAI,GAAG,EAAE,CAAC;AAErC;;;;;;;GAOG;AACH,SAAgB,mBAAmB,CAAC,OAAe;IAC/C,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;QAAE,OAAO;KAAE;IACnC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAEnB,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAA;IACzC,OAAO,CAAC,GAAG,CAAC,6BAA8B,OAAQ,sCAAsC,CAAC,CAAC;IAC1F,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,2EAA2E,CAAC,CAAC;IACzF,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;IAClF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,yEAAyE,CAAC,CAAC;IACvF,OAAO,CAAC,GAAG,CAAC,wEAAwE,CAAC,CAAC;IACtF,OAAO,CAAC,GAAG,CAAC,+EAA+E,CAAC,CAAC;IAC7F,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,sDAAsD,CAAC,CAAC;IACpE,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAC9C,CAAC;AAhBD,kDAgBC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/contracts.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/contracts.d.ts deleted file mode 100644 index e5f1d42d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/contracts.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import type { Provider, TransactionRequest, TransactionResponse } from "./provider.js"; -/** - * A **ContractRunner** is a generic interface which defines an object - * capable of interacting with a Contract on the network. - * - * The more operations supported, the more utility it is capable of. - * - * The most common ContractRunners are [Providers](Provider) which enable - * read-only access and [Signers](Signer) which enable write-access. - */ -export interface ContractRunner { - /** - * The provider used for necessary state querying operations. - * - * This can also point to the **ContractRunner** itself, in the - * case of an [[AbstractProvider]]. - */ - provider: null | Provider; - /** - * Required to estimate gas. - */ - estimateGas?: (tx: TransactionRequest) => Promise; - /** - * Required for pure, view or static calls to contracts. - */ - call?: (tx: TransactionRequest) => Promise; - /** - * Required to support ENS names - */ - resolveName?: (name: string) => Promise; - /** - * Required for state mutating calls - */ - sendTransaction?: (tx: TransactionRequest) => Promise; -} -//# sourceMappingURL=contracts.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/contracts.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/contracts.d.ts.map deleted file mode 100644 index 078fdc87..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/contracts.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src.ts/providers/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,QAAQ,EAAE,kBAAkB,EAAE,mBAAmB,EACpD,MAAM,eAAe,CAAC;AAEvB;;;;;;;;GAQG;AACH,MAAM,WAAW,cAAc;IAC3B;;;;;OAKG;IACH,QAAQ,EAAE,IAAI,GAAG,QAAQ,CAAC;IAE1B;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAE1D;;OAEG;IACH,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnD;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;IAEvD;;OAEG;IACH,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC9E"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/contracts.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/contracts.js deleted file mode 100644 index 705cd38a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/contracts.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=contracts.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/contracts.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/contracts.js.map deleted file mode 100644 index 42ac4de8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/contracts.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../src.ts/providers/contracts.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/default-provider.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/default-provider.d.ts deleted file mode 100644 index 73704c76..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/default-provider.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -import type { AbstractProvider } from "./abstract-provider.js"; -import type { Networkish } from "./network.js"; -import { WebSocketLike } from "./provider-websocket.js"; -/** - * Returns a default provider for %%network%%. - * - * If %%network%% is a [[WebSocketLike]] or string that begins with - * ``"ws:"`` or ``"wss:"``, a [[WebSocketProvider]] is returned backed - * by that WebSocket or URL. - * - * If %%network%% is a string that begins with ``"HTTP:"`` or ``"HTTPS:"``, - * a [[JsonRpcProvider]] is returned connected to that URL. - * - * Otherwise, a default provider is created backed by well-known public - * Web3 backends (such as [[link-infura]]) using community-provided API - * keys. - * - * The %%options%% allows specifying custom API keys per backend (setting - * an API key to ``"-"`` will omit that provider) and ``options.exclusive`` - * can be set to either a backend name or and array of backend names, which - * will whitelist **only** those backends. - * - * Current backend strings supported are: - * - ``"alchemy"`` - * - ``"ankr"`` - * - ``"cloudflare"`` - * - ``"chainstack"`` - * - ``"etherscan"`` - * - ``"infura"`` - * - ``"publicPolygon"`` - * - ``"quicknode"`` - * - * @example: - * // Connect to a local Geth node - * provider = getDefaultProvider("http://localhost:8545/"); - * - * // Connect to Ethereum mainnet with any current and future - * // third-party services available - * provider = getDefaultProvider("mainnet"); - * - * // Connect to Polygon, but only allow Etherscan and - * // INFURA and use "MY_API_KEY" in calls to Etherscan. - * provider = getDefaultProvider("matic", { - * etherscan: "MY_API_KEY", - * exclusive: [ "etherscan", "infura" ] - * }); - */ -export declare function getDefaultProvider(network?: string | Networkish | WebSocketLike, options?: any): AbstractProvider; -//# sourceMappingURL=default-provider.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/default-provider.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/default-provider.d.ts.map deleted file mode 100644 index 1cea7a66..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/default-provider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"default-provider.d.ts","sourceRoot":"","sources":["../../src.ts/providers/default-provider.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AASxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,aAAa,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,gBAAgB,CAgIjH"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/default-provider.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/default-provider.js deleted file mode 100644 index c72dcb10..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/default-provider.js +++ /dev/null @@ -1,200 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getDefaultProvider = void 0; -const index_js_1 = require("../utils/index.js"); -const provider_ankr_js_1 = require("./provider-ankr.js"); -const provider_alchemy_js_1 = require("./provider-alchemy.js"); -//import { BlockscoutProvider } from "./provider-blockscout.js"; -const provider_chainstack_js_1 = require("./provider-chainstack.js"); -const provider_cloudflare_js_1 = require("./provider-cloudflare.js"); -const provider_etherscan_js_1 = require("./provider-etherscan.js"); -const provider_infura_js_1 = require("./provider-infura.js"); -//import { PocketProvider } from "./provider-pocket.js"; -const provider_quicknode_js_1 = require("./provider-quicknode.js"); -const provider_fallback_js_1 = require("./provider-fallback.js"); -const provider_jsonrpc_js_1 = require("./provider-jsonrpc.js"); -const network_js_1 = require("./network.js"); -const provider_websocket_js_1 = require("./provider-websocket.js"); -function isWebSocketLike(value) { - return (value && typeof (value.send) === "function" && - typeof (value.close) === "function"); -} -const Testnets = "goerli kovan sepolia classicKotti optimism-goerli arbitrum-goerli matic-mumbai bnbt".split(" "); -/** - * Returns a default provider for %%network%%. - * - * If %%network%% is a [[WebSocketLike]] or string that begins with - * ``"ws:"`` or ``"wss:"``, a [[WebSocketProvider]] is returned backed - * by that WebSocket or URL. - * - * If %%network%% is a string that begins with ``"HTTP:"`` or ``"HTTPS:"``, - * a [[JsonRpcProvider]] is returned connected to that URL. - * - * Otherwise, a default provider is created backed by well-known public - * Web3 backends (such as [[link-infura]]) using community-provided API - * keys. - * - * The %%options%% allows specifying custom API keys per backend (setting - * an API key to ``"-"`` will omit that provider) and ``options.exclusive`` - * can be set to either a backend name or and array of backend names, which - * will whitelist **only** those backends. - * - * Current backend strings supported are: - * - ``"alchemy"`` - * - ``"ankr"`` - * - ``"cloudflare"`` - * - ``"chainstack"`` - * - ``"etherscan"`` - * - ``"infura"`` - * - ``"publicPolygon"`` - * - ``"quicknode"`` - * - * @example: - * // Connect to a local Geth node - * provider = getDefaultProvider("http://localhost:8545/"); - * - * // Connect to Ethereum mainnet with any current and future - * // third-party services available - * provider = getDefaultProvider("mainnet"); - * - * // Connect to Polygon, but only allow Etherscan and - * // INFURA and use "MY_API_KEY" in calls to Etherscan. - * provider = getDefaultProvider("matic", { - * etherscan: "MY_API_KEY", - * exclusive: [ "etherscan", "infura" ] - * }); - */ -function getDefaultProvider(network, options) { - if (options == null) { - options = {}; - } - const allowService = (name) => { - if (options[name] === "-") { - return false; - } - if (typeof (options.exclusive) === "string") { - return (name === options.exclusive); - } - if (Array.isArray(options.exclusive)) { - return (options.exclusive.indexOf(name) !== -1); - } - return true; - }; - if (typeof (network) === "string" && network.match(/^https?:/)) { - return new provider_jsonrpc_js_1.JsonRpcProvider(network); - } - if (typeof (network) === "string" && network.match(/^wss?:/) || isWebSocketLike(network)) { - return new provider_websocket_js_1.WebSocketProvider(network); - } - // Get the network and name, if possible - let staticNetwork = null; - try { - staticNetwork = network_js_1.Network.from(network); - } - catch (error) { } - const providers = []; - if (allowService("publicPolygon") && staticNetwork) { - if (staticNetwork.name === "matic") { - providers.push(new provider_jsonrpc_js_1.JsonRpcProvider("https:/\/polygon-rpc.com/", staticNetwork, { staticNetwork })); - } - else if (staticNetwork.name === "matic-amoy") { - providers.push(new provider_jsonrpc_js_1.JsonRpcProvider("https:/\/rpc-amoy.polygon.technology/", staticNetwork, { staticNetwork })); - } - } - if (allowService("alchemy")) { - try { - providers.push(new provider_alchemy_js_1.AlchemyProvider(network, options.alchemy)); - } - catch (error) { } - } - if (allowService("ankr") && options.ankr != null) { - try { - providers.push(new provider_ankr_js_1.AnkrProvider(network, options.ankr)); - } - catch (error) { } - } - /* Temporarily remove until custom error issue is fixed - if (allowService("blockscout")) { - try { - providers.push(new BlockscoutProvider(network, options.blockscout)); - } catch (error) { } - } - */ - if (allowService("chainstack")) { - try { - providers.push(new provider_chainstack_js_1.ChainstackProvider(network, options.chainstack)); - } - catch (error) { } - } - if (allowService("cloudflare")) { - try { - providers.push(new provider_cloudflare_js_1.CloudflareProvider(network)); - } - catch (error) { } - } - if (allowService("etherscan")) { - try { - providers.push(new provider_etherscan_js_1.EtherscanProvider(network, options.etherscan)); - } - catch (error) { } - } - if (allowService("infura")) { - try { - let projectId = options.infura; - let projectSecret = undefined; - if (typeof (projectId) === "object") { - projectSecret = projectId.projectSecret; - projectId = projectId.projectId; - } - providers.push(new provider_infura_js_1.InfuraProvider(network, projectId, projectSecret)); - } - catch (error) { } - } - /* - if (options.pocket !== "-") { - try { - let appId = options.pocket; - let secretKey: undefined | string = undefined; - let loadBalancer: undefined | boolean = undefined; - if (typeof(appId) === "object") { - loadBalancer = !!appId.loadBalancer; - secretKey = appId.secretKey; - appId = appId.appId; - } - providers.push(new PocketProvider(network, appId, secretKey, loadBalancer)); - } catch (error) { console.log(error); } - } - */ - if (allowService("quicknode")) { - try { - let token = options.quicknode; - providers.push(new provider_quicknode_js_1.QuickNodeProvider(network, token)); - } - catch (error) { } - } - (0, index_js_1.assert)(providers.length, "unsupported default network", "UNSUPPORTED_OPERATION", { - operation: "getDefaultProvider" - }); - // No need for a FallbackProvider - if (providers.length === 1) { - return providers[0]; - } - // We use the floor because public third-party providers can be unreliable, - // so a low number of providers with a large quorum will fail too often - let quorum = Math.floor(providers.length / 2); - if (quorum > 2) { - quorum = 2; - } - // Testnets don't need as strong a security gaurantee and speed is - // more useful during testing - if (staticNetwork && Testnets.indexOf(staticNetwork.name) !== -1) { - quorum = 1; - } - // Provided override qorum takes priority - if (options && options.quorum) { - quorum = options.quorum; - } - return new provider_fallback_js_1.FallbackProvider(providers, undefined, { quorum }); -} -exports.getDefaultProvider = getDefaultProvider; -//# sourceMappingURL=default-provider.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/default-provider.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/default-provider.js.map deleted file mode 100644 index 3606f6eb..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/default-provider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"default-provider.js","sourceRoot":"","sources":["../../src.ts/providers/default-provider.ts"],"names":[],"mappings":";;;AACA,gDAA2C;AAE3C,yDAAkD;AAClD,+DAAwD;AACxD,gEAAgE;AAChE,qEAA8D;AAC9D,qEAA8D;AAC9D,mEAA4D;AAC5D,6DAAsD;AACtD,wDAAwD;AACxD,mEAA4D;AAE5D,iEAA0D;AAC1D,+DAAwD;AACxD,6CAAuC;AACvC,mEAA4D;AAM5D,SAAS,eAAe,CAAC,KAAU;IAC/B,OAAO,CAAC,KAAK,IAAI,OAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,UAAU;QAC9C,OAAM,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,UAAU,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,QAAQ,GAAG,qFAAqF,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAElH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,SAAgB,kBAAkB,CAAC,OAA6C,EAAE,OAAa;IAC3F,IAAI,OAAO,IAAI,IAAI,EAAE;QAAE,OAAO,GAAG,EAAG,CAAC;KAAE;IAEvC,MAAM,YAAY,GAAG,CAAC,IAAY,EAAE,EAAE;QAClC,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,GAAG,EAAE;YAAE,OAAO,KAAK,CAAC;SAAE;QAC5C,IAAI,OAAM,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,QAAQ,EAAE;YACxC,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC;SACvC;QACD,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;YAClC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SACnD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B,IAAI;YACA,IAAI,KAAK,GAAG,OAAO,CAAC,SAAS,CAAC;YAC9B,SAAS,CAAC,IAAI,CAAC,IAAI,yCAAiB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;SACzD;QAAC,OAAO,KAAK,EAAE,GAAG;KACtB;IAED,IAAA,iBAAM,EAAC,SAAS,CAAC,MAAM,EAAE,6BAA6B,EAAE,uBAAuB,EAAE;QAC7E,SAAS,EAAE,oBAAoB;KAClC,CAAC,CAAC;IAEH,iCAAiC;IACjC,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;QAAE,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;KAAE;IAEpD,2EAA2E;IAC3E,uEAAuE;IACvE,IAAI,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC9C,IAAI,MAAM,GAAG,CAAC,EAAE;QAAE,MAAM,GAAG,CAAC,CAAC;KAAE;IAE/B,kEAAkE;IAClE,6BAA6B;IAC7B,IAAI,aAAa,IAAI,QAAQ,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE;QAAE,MAAM,GAAG,CAAC,CAAC;KAAE;IAEjF,yCAAyC;IACzC,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE;QAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;KAAE;IAE3D,OAAO,IAAI,uCAAgB,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;AAClE,CAAC;AAhID,gDAgIC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ens-resolver.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ens-resolver.d.ts deleted file mode 100644 index 8c3b37fe..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ens-resolver.d.ts +++ /dev/null @@ -1,147 +0,0 @@ -/** - * ENS is a service which allows easy-to-remember names to map to - * network addresses. - * - * @_section: api/providers/ens-resolver:ENS Resolver [about-ens-rsolver] - */ -import type { BytesLike } from "../utils/index.js"; -import type { AbstractProvider, AbstractProviderPlugin } from "./abstract-provider.js"; -import type { Provider } from "./provider.js"; -/** - * The type of data found during a steip during avatar resolution. - */ -export type AvatarLinkageType = "name" | "avatar" | "!avatar" | "url" | "data" | "ipfs" | "erc721" | "erc1155" | "!erc721-caip" | "!erc1155-caip" | "!owner" | "owner" | "!balance" | "balance" | "metadata-url-base" | "metadata-url-expanded" | "metadata-url" | "!metadata-url" | "!metadata" | "metadata" | "!imageUrl" | "imageUrl-ipfs" | "imageUrl" | "!imageUrl-ipfs"; -/** - * An individual record for each step during avatar resolution. - */ -export interface AvatarLinkage { - /** - * The type of linkage. - */ - type: AvatarLinkageType; - /** - * The linkage value. - */ - value: string; -} -/** - * When resolving an avatar for an ENS name, there are many - * steps involved, fetching metadata, validating results, et cetera. - * - * Some applications may wish to analyse this data, or use this data - * to diagnose promblems, so an **AvatarResult** provides details of - * each completed step during avatar resolution. - */ -export interface AvatarResult { - /** - * How the [[url]] was arrived at, resolving the many steps required - * for an avatar URL. - */ - linkage: Array; - /** - * The avatar URL or null if the avatar was not set, or there was - * an issue during validation (such as the address not owning the - * avatar or a metadata error). - */ - url: null | string; -} -/** - * A provider plugin super-class for processing multicoin address types. - */ -export declare abstract class MulticoinProviderPlugin implements AbstractProviderPlugin { - /** - * The name. - */ - readonly name: string; - /** - * Creates a new **MulticoinProviderPluing** for %%name%%. - */ - constructor(name: string); - connect(proivder: Provider): MulticoinProviderPlugin; - /** - * Returns ``true`` if %%coinType%% is supported by this plugin. - */ - supportsCoinType(coinType: number): boolean; - /** - * Resolves to the encoded %%address%% for %%coinType%%. - */ - encodeAddress(coinType: number, address: string): Promise; - /** - * Resolves to the decoded %%data%% for %%coinType%%. - */ - decodeAddress(coinType: number, data: BytesLike): Promise; -} -/** - * A **BasicMulticoinProviderPlugin** provides service for common - * coin types, which do not require additional libraries to encode or - * decode. - */ -export declare class BasicMulticoinProviderPlugin extends MulticoinProviderPlugin { - /** - * Creates a new **BasicMulticoinProviderPlugin**. - */ - constructor(); -} -/** - * A connected object to a resolved ENS name resolver, which can be - * used to query additional details. - */ -export declare class EnsResolver { - #private; - /** - * The connected provider. - */ - provider: AbstractProvider; - /** - * The address of the resolver. - */ - address: string; - /** - * The name this resolver was resolved against. - */ - name: string; - constructor(provider: AbstractProvider, address: string, name: string); - /** - * Resolves to true if the resolver supports wildcard resolution. - */ - supportsWildcard(): Promise; - /** - * Resolves to the address for %%coinType%% or null if the - * provided %%coinType%% has not been configured. - */ - getAddress(coinType?: number): Promise; - /** - * Resolves to the EIP-634 text record for %%key%%, or ``null`` - * if unconfigured. - */ - getText(key: string): Promise; - /** - * Rsolves to the content-hash or ``null`` if unconfigured. - */ - getContentHash(): Promise; - /** - * Resolves to the avatar url or ``null`` if the avatar is either - * unconfigured or incorrectly configured (e.g. references an NFT - * not owned by the address). - * - * If diagnosing issues with configurations, the [[_getAvatar]] - * method may be useful. - */ - getAvatar(): Promise; - /** - * When resolving an avatar, there are many steps involved, such - * fetching metadata and possibly validating ownership of an - * NFT. - * - * This method can be used to examine each step and the value it - * was working from. - */ - _getAvatar(): Promise; - static getEnsAddress(provider: Provider): Promise; - /** - * Resolve to the ENS resolver for %%name%% using %%provider%% or - * ``null`` if unconfigured. - */ - static fromName(provider: AbstractProvider, name: string): Promise; -} -//# sourceMappingURL=ens-resolver.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ens-resolver.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ens-resolver.d.ts.map deleted file mode 100644 index 5bbaa89f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ens-resolver.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ens-resolver.d.ts","sourceRoot":"","sources":["../../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,CAAC,MAAM,CAAC;IAIvE;;OAEG;IACG,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC;CAG1E;AAID;;;;GAIG;AACH,qBAAa,4BAA6B,SAAQ,uBAAuB;IACrE;;OAEG;;CAIN;AAUD;;;GAGG;AACH,qBAAa,WAAW;;IACpB;;OAEG;IACH,QAAQ,EAAG,gBAAgB,CAAC;IAE5B;;OAEG;IACH,OAAO,EAAG,MAAM,CAAC;IAEjB;;OAEG;IACH,IAAI,EAAG,MAAM,CAAC;gBAOF,QAAQ,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAerE;;OAEG;IACG,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC;IA8D1C;;;OAGG;IACG,UAAU,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC;IAoD3D;;;OAGG;IACG,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC;IAMlD;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC;IA6B9C;;;;;;;OAOG;IACG,SAAS,IAAI,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC;IAKzC;;;;;;;OAOG;IACG,UAAU,IAAI,OAAO,CAAC,YAAY,CAAC;WAgK5B,aAAa,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;IAoC/D;;;OAGG;WACU,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,WAAW,CAAC;CA2B/F"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ens-resolver.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ens-resolver.js deleted file mode 100644 index 2c3e2c75..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ens-resolver.js +++ /dev/null @@ -1,502 +0,0 @@ -"use strict"; -/** - * ENS is a service which allows easy-to-remember names to map to - * network addresses. - * - * @_section: api/providers/ens-resolver:ENS Resolver [about-ens-rsolver] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.EnsResolver = exports.BasicMulticoinProviderPlugin = exports.MulticoinProviderPlugin = void 0; -const index_js_1 = require("../address/index.js"); -const index_js_2 = require("../constants/index.js"); -const index_js_3 = require("../contract/index.js"); -const index_js_4 = require("../hash/index.js"); -const index_js_5 = require("../utils/index.js"); -// @TODO: This should use the fetch-data:ipfs gateway -// Trim off the ipfs:// prefix and return the default gateway URL -function getIpfsLink(link) { - if (link.match(/^ipfs:\/\/ipfs\//i)) { - link = link.substring(12); - } - else if (link.match(/^ipfs:\/\//i)) { - link = link.substring(7); - } - else { - (0, index_js_5.assertArgument)(false, "unsupported IPFS format", "link", link); - } - return `https:/\/gateway.ipfs.io/ipfs/${link}`; -} -; -; -/** - * A provider plugin super-class for processing multicoin address types. - */ -class MulticoinProviderPlugin { - /** - * The name. - */ - name; - /** - * Creates a new **MulticoinProviderPluing** for %%name%%. - */ - constructor(name) { - (0, index_js_5.defineProperties)(this, { name }); - } - connect(proivder) { - return this; - } - /** - * Returns ``true`` if %%coinType%% is supported by this plugin. - */ - supportsCoinType(coinType) { - return false; - } - /** - * Resolves to the encoded %%address%% for %%coinType%%. - */ - async encodeAddress(coinType, address) { - throw new Error("unsupported coin"); - } - /** - * Resolves to the decoded %%data%% for %%coinType%%. - */ - async decodeAddress(coinType, data) { - throw new Error("unsupported coin"); - } -} -exports.MulticoinProviderPlugin = MulticoinProviderPlugin; -const BasicMulticoinPluginId = "org.ethers.plugins.provider.BasicMulticoin"; -/** - * A **BasicMulticoinProviderPlugin** provides service for common - * coin types, which do not require additional libraries to encode or - * decode. - */ -class BasicMulticoinProviderPlugin extends MulticoinProviderPlugin { - /** - * Creates a new **BasicMulticoinProviderPlugin**. - */ - constructor() { - super(BasicMulticoinPluginId); - } -} -exports.BasicMulticoinProviderPlugin = BasicMulticoinProviderPlugin; -const matcherIpfs = new RegExp("^(ipfs):/\/(.*)$", "i"); -const matchers = [ - new RegExp("^(https):/\/(.*)$", "i"), - new RegExp("^(data):(.*)$", "i"), - matcherIpfs, - new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$", "i"), -]; -/** - * A connected object to a resolved ENS name resolver, which can be - * used to query additional details. - */ -class EnsResolver { - /** - * The connected provider. - */ - provider; - /** - * The address of the resolver. - */ - address; - /** - * The name this resolver was resolved against. - */ - name; - // For EIP-2544 names, the ancestor that provided the resolver - #supports2544; - #resolver; - constructor(provider, address, name) { - (0, index_js_5.defineProperties)(this, { provider, address, name }); - this.#supports2544 = null; - this.#resolver = new index_js_3.Contract(address, [ - "function supportsInterface(bytes4) view returns (bool)", - "function resolve(bytes, bytes) view returns (bytes)", - "function addr(bytes32) view returns (address)", - "function addr(bytes32, uint) view returns (bytes)", - "function text(bytes32, string) view returns (string)", - "function contenthash(bytes32) view returns (bytes)", - ], provider); - } - /** - * Resolves to true if the resolver supports wildcard resolution. - */ - async supportsWildcard() { - if (this.#supports2544 == null) { - this.#supports2544 = (async () => { - try { - return await this.#resolver.supportsInterface("0x9061b923"); - } - catch (error) { - // Wildcard resolvers must understand supportsInterface - // and return true. - if ((0, index_js_5.isError)(error, "CALL_EXCEPTION")) { - return false; - } - // Let future attempts try again... - this.#supports2544 = null; - throw error; - } - })(); - } - return await this.#supports2544; - } - async #fetch(funcName, params) { - params = (params || []).slice(); - const iface = this.#resolver.interface; - // The first parameters is always the nodehash - params.unshift((0, index_js_4.namehash)(this.name)); - let fragment = null; - if (await this.supportsWildcard()) { - fragment = iface.getFunction(funcName); - (0, index_js_5.assert)(fragment, "missing fragment", "UNKNOWN_ERROR", { - info: { funcName } - }); - params = [ - (0, index_js_4.dnsEncode)(this.name, 255), - iface.encodeFunctionData(fragment, params) - ]; - funcName = "resolve(bytes,bytes)"; - } - params.push({ - enableCcipRead: true - }); - try { - const result = await this.#resolver[funcName](...params); - if (fragment) { - return iface.decodeFunctionResult(fragment, result)[0]; - } - return result; - } - catch (error) { - if (!(0, index_js_5.isError)(error, "CALL_EXCEPTION")) { - throw error; - } - } - return null; - } - /** - * Resolves to the address for %%coinType%% or null if the - * provided %%coinType%% has not been configured. - */ - async getAddress(coinType) { - if (coinType == null) { - coinType = 60; - } - if (coinType === 60) { - try { - const result = await this.#fetch("addr(bytes32)"); - // No address - if (result == null || result === index_js_2.ZeroAddress) { - return null; - } - return result; - } - catch (error) { - if ((0, index_js_5.isError)(error, "CALL_EXCEPTION")) { - return null; - } - throw error; - } - } - // Try decoding its EVM canonical chain as an EVM chain address first - if (coinType >= 0 && coinType < 0x80000000) { - let ethCoinType = coinType + 0x80000000; - const data = await this.#fetch("addr(bytes32,uint)", [ethCoinType]); - if ((0, index_js_5.isHexString)(data, 20)) { - return (0, index_js_1.getAddress)(data); - } - } - let coinPlugin = null; - for (const plugin of this.provider.plugins) { - if (!(plugin instanceof MulticoinProviderPlugin)) { - continue; - } - if (plugin.supportsCoinType(coinType)) { - coinPlugin = plugin; - break; - } - } - if (coinPlugin == null) { - return null; - } - // keccak256("addr(bytes32,uint256") - const data = await this.#fetch("addr(bytes32,uint)", [coinType]); - // No address - if (data == null || data === "0x") { - return null; - } - // Compute the address - const address = await coinPlugin.decodeAddress(coinType, data); - if (address != null) { - return address; - } - (0, index_js_5.assert)(false, `invalid coin data`, "UNSUPPORTED_OPERATION", { - operation: `getAddress(${coinType})`, - info: { coinType, data } - }); - } - /** - * Resolves to the EIP-634 text record for %%key%%, or ``null`` - * if unconfigured. - */ - async getText(key) { - const data = await this.#fetch("text(bytes32,string)", [key]); - if (data == null || data === "0x") { - return null; - } - return data; - } - /** - * Rsolves to the content-hash or ``null`` if unconfigured. - */ - async getContentHash() { - // keccak256("contenthash()") - const data = await this.#fetch("contenthash(bytes32)"); - // No contenthash - if (data == null || data === "0x") { - return null; - } - // IPFS (CID: 1, Type: 70=DAG-PB, 72=libp2p-key) - const ipfs = data.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/); - if (ipfs) { - const scheme = (ipfs[1] === "e3010170") ? "ipfs" : "ipns"; - const length = parseInt(ipfs[4], 16); - if (ipfs[5].length === length * 2) { - return `${scheme}:/\/${(0, index_js_5.encodeBase58)("0x" + ipfs[2])}`; - } - } - // Swarm (CID: 1, Type: swarm-manifest; hash/length hard-coded to keccak256/32) - const swarm = data.match(/^0xe40101fa011b20([0-9a-f]*)$/); - if (swarm && swarm[1].length === 64) { - return `bzz:/\/${swarm[1]}`; - } - (0, index_js_5.assert)(false, `invalid or unsupported content hash data`, "UNSUPPORTED_OPERATION", { - operation: "getContentHash()", - info: { data } - }); - } - /** - * Resolves to the avatar url or ``null`` if the avatar is either - * unconfigured or incorrectly configured (e.g. references an NFT - * not owned by the address). - * - * If diagnosing issues with configurations, the [[_getAvatar]] - * method may be useful. - */ - async getAvatar() { - const avatar = await this._getAvatar(); - return avatar.url; - } - /** - * When resolving an avatar, there are many steps involved, such - * fetching metadata and possibly validating ownership of an - * NFT. - * - * This method can be used to examine each step and the value it - * was working from. - */ - async _getAvatar() { - const linkage = [{ type: "name", value: this.name }]; - try { - // test data for ricmoo.eth - //const avatar = "eip155:1/erc721:0x265385c7f4132228A0d54EB1A9e7460b91c0cC68/29233"; - const avatar = await this.getText("avatar"); - if (avatar == null) { - linkage.push({ type: "!avatar", value: "" }); - return { url: null, linkage }; - } - linkage.push({ type: "avatar", value: avatar }); - for (let i = 0; i < matchers.length; i++) { - const match = avatar.match(matchers[i]); - if (match == null) { - continue; - } - const scheme = match[1].toLowerCase(); - switch (scheme) { - case "https": - case "data": - linkage.push({ type: "url", value: avatar }); - return { linkage, url: avatar }; - case "ipfs": { - const url = getIpfsLink(avatar); - linkage.push({ type: "ipfs", value: avatar }); - linkage.push({ type: "url", value: url }); - return { linkage, url }; - } - case "erc721": - case "erc1155": { - // Depending on the ERC type, use tokenURI(uint256) or url(uint256) - const selector = (scheme === "erc721") ? "tokenURI(uint256)" : "uri(uint256)"; - linkage.push({ type: scheme, value: avatar }); - // The owner of this name - const owner = await this.getAddress(); - if (owner == null) { - linkage.push({ type: "!owner", value: "" }); - return { url: null, linkage }; - } - const comps = (match[2] || "").split("/"); - if (comps.length !== 2) { - linkage.push({ type: `!${scheme}caip`, value: (match[2] || "") }); - return { url: null, linkage }; - } - const tokenId = comps[1]; - const contract = new index_js_3.Contract(comps[0], [ - // ERC-721 - "function tokenURI(uint) view returns (string)", - "function ownerOf(uint) view returns (address)", - // ERC-1155 - "function uri(uint) view returns (string)", - "function balanceOf(address, uint256) view returns (uint)" - ], this.provider); - // Check that this account owns the token - if (scheme === "erc721") { - const tokenOwner = await contract.ownerOf(tokenId); - if (owner !== tokenOwner) { - linkage.push({ type: "!owner", value: tokenOwner }); - return { url: null, linkage }; - } - linkage.push({ type: "owner", value: tokenOwner }); - } - else if (scheme === "erc1155") { - const balance = await contract.balanceOf(owner, tokenId); - if (!balance) { - linkage.push({ type: "!balance", value: "0" }); - return { url: null, linkage }; - } - linkage.push({ type: "balance", value: balance.toString() }); - } - // Call the token contract for the metadata URL - let metadataUrl = await contract[selector](tokenId); - if (metadataUrl == null || metadataUrl === "0x") { - linkage.push({ type: "!metadata-url", value: "" }); - return { url: null, linkage }; - } - linkage.push({ type: "metadata-url-base", value: metadataUrl }); - // ERC-1155 allows a generic {id} in the URL - if (scheme === "erc1155") { - metadataUrl = metadataUrl.replace("{id}", (0, index_js_5.toBeHex)(tokenId, 32).substring(2)); - linkage.push({ type: "metadata-url-expanded", value: metadataUrl }); - } - // Transform IPFS metadata links - if (metadataUrl.match(/^ipfs:/i)) { - metadataUrl = getIpfsLink(metadataUrl); - } - linkage.push({ type: "metadata-url", value: metadataUrl }); - // Get the token metadata - let metadata = {}; - const response = await (new index_js_5.FetchRequest(metadataUrl)).send(); - response.assertOk(); - try { - metadata = response.bodyJson; - } - catch (error) { - try { - linkage.push({ type: "!metadata", value: response.bodyText }); - } - catch (error) { - const bytes = response.body; - if (bytes) { - linkage.push({ type: "!metadata", value: (0, index_js_5.hexlify)(bytes) }); - } - return { url: null, linkage }; - } - return { url: null, linkage }; - } - if (!metadata) { - linkage.push({ type: "!metadata", value: "" }); - return { url: null, linkage }; - } - linkage.push({ type: "metadata", value: JSON.stringify(metadata) }); - // Pull the image URL out - let imageUrl = metadata.image; - if (typeof (imageUrl) !== "string") { - linkage.push({ type: "!imageUrl", value: "" }); - return { url: null, linkage }; - } - if (imageUrl.match(/^(https:\/\/|data:)/i)) { - // Allow - } - else { - // Transform IPFS link to gateway - const ipfs = imageUrl.match(matcherIpfs); - if (ipfs == null) { - linkage.push({ type: "!imageUrl-ipfs", value: imageUrl }); - return { url: null, linkage }; - } - linkage.push({ type: "imageUrl-ipfs", value: imageUrl }); - imageUrl = getIpfsLink(imageUrl); - } - linkage.push({ type: "url", value: imageUrl }); - return { linkage, url: imageUrl }; - } - } - } - } - catch (error) { } - return { linkage, url: null }; - } - static async getEnsAddress(provider) { - const network = await provider.getNetwork(); - const ensPlugin = network.getPlugin("org.ethers.plugins.network.Ens"); - // No ENS... - (0, index_js_5.assert)(ensPlugin, "network does not support ENS", "UNSUPPORTED_OPERATION", { - operation: "getEnsAddress", info: { network } - }); - return ensPlugin.address; - } - static async #getResolver(provider, name) { - const ensAddr = await EnsResolver.getEnsAddress(provider); - try { - const contract = new index_js_3.Contract(ensAddr, [ - "function resolver(bytes32) view returns (address)" - ], provider); - const addr = await contract.resolver((0, index_js_4.namehash)(name), { - enableCcipRead: true - }); - if (addr === index_js_2.ZeroAddress) { - return null; - } - return addr; - } - catch (error) { - // ENS registry cannot throw errors on resolver(bytes32), - // so probably a link error - throw error; - } - return null; - } - /** - * Resolve to the ENS resolver for %%name%% using %%provider%% or - * ``null`` if unconfigured. - */ - static async fromName(provider, name) { - let currentName = name; - while (true) { - if (currentName === "" || currentName === ".") { - return null; - } - // Optimization since the eth node cannot change and does - // not have a wildcard resolver - if (name !== "eth" && currentName === "eth") { - return null; - } - // Check the current node for a resolver - const addr = await EnsResolver.#getResolver(provider, currentName); - // Found a resolver! - if (addr != null) { - const resolver = new EnsResolver(provider, addr, name); - // Legacy resolver found, using EIP-2544 so it isn't safe to use - if (currentName !== name && !(await resolver.supportsWildcard())) { - return null; - } - return resolver; - } - // Get the parent node - currentName = currentName.split(".").slice(1).join("."); - } - } -} -exports.EnsResolver = EnsResolver; -//# sourceMappingURL=ens-resolver.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ens-resolver.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ens-resolver.js.map deleted file mode 100644 index f44944b1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ens-resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ens-resolver.js","sourceRoot":"","sources":["../../src.ts/providers/ens-resolver.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,kDAAiD;AACjD,oDAAoD;AACpD,mDAAgD;AAChD,+CAAuD;AACvD,gDAK2B;AAU3B,qDAAqD;AACrD,iEAAiE;AACjE,SAAS,WAAW,CAAC,IAAY;IAC7B,IAAI,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,EAAE;QACjC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;KAC7B;SAAM,IAAI,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE;QAClC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;KAC5B;SAAM;QACH,IAAA,yBAAc,EAAC,KAAK,EAAE,yBAAyB,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;KAClE;IAED,OAAO,iCAAkC,IAAK,EAAE,CAAC;AACrD,CAAC;AAyBA,CAAC;AAuB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AI,KAAK,KAAK,IAAI,WAAW,KAAK,KAAK,EAAE;gBAAE,OAAO,IAAI,CAAC;aAAE;YAE7D,wCAAwC;YACxC,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC,YAAY,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;YAEnE,oBAAoB;YACpB,IAAI,IAAI,IAAI,IAAI,EAAE;gBACd,MAAM,QAAQ,GAAG,IAAI,WAAW,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;gBAEvD,gEAAgE;gBAChE,IAAI,WAAW,KAAK,IAAI,IAAI,CAAC,CAAC,MAAM,QAAQ,CAAC,gBAAgB,EAAE,CAAC,EAAE;oBAAE,OAAO,IAAI,CAAC;iBAAE;gBAElF,OAAO,QAAQ,CAAC;aACnB;YAED,sBAAsB;YACtB,WAAW,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SAC3D;IACL,CAAC;CACJ;AA/bD,kCA+bC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/format.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/format.d.ts deleted file mode 100644 index 0967704e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/format.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { BlockParams, LogParams, TransactionReceiptParams, TransactionResponseParams } from "./formatting.js"; -export type FormatFunc = (value: any) => any; -export declare function allowNull(format: FormatFunc, nullValue?: any): FormatFunc; -export declare function arrayOf(format: FormatFunc, allowNull?: boolean): FormatFunc; -export declare function object(format: Record, altNames?: Record>): FormatFunc; -export declare function formatBoolean(value: any): boolean; -export declare function formatData(value: string): string; -export declare function formatHash(value: any): string; -export declare function formatUint256(value: any): string; -export declare function formatLog(value: any): LogParams; -export declare function formatBlock(value: any): BlockParams; -export declare function formatReceiptLog(value: any): LogParams; -export declare function formatTransactionReceipt(value: any): TransactionReceiptParams; -export declare function formatTransactionResponse(value: any): TransactionResponseParams; -//# sourceMappingURL=format.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/format.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/format.d.ts.map deleted file mode 100644 index 00537f2b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/format.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src.ts/providers/format.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACR,WAAW,EAAE,SAAS,EACtB,wBAAwB,EAAE,yBAAyB,EACtD,MAAM,iBAAiB,CAAC;AAKzB,MAAM,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAC;AAE7C,wBAAgB,SAAS,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,GAAG,GAAG,UAAU,CAKzE;AAED,wBAAgB,OAAO,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,UAAU,CAM3E;AAKD,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,UAAU,CAwB/G;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAQjD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGhD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,CAG7C;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,CAKhD;AAgBD,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,SAAS,CAE/C;AA+BD,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,GAAG,WAAW,CAOnD;AAeD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,GAAG,GAAG,SAAS,CAEtD;AA4BD,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,GAAG,GAAG,wBAAwB,CAE7E;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,GAAG,GAAG,yBAAyB,CA0I/E"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/format.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/format.js deleted file mode 100644 index ed11dc2a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/format.js +++ /dev/null @@ -1,312 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.formatTransactionResponse = exports.formatTransactionReceipt = exports.formatReceiptLog = exports.formatBlock = exports.formatLog = exports.formatUint256 = exports.formatHash = exports.formatData = exports.formatBoolean = exports.object = exports.arrayOf = exports.allowNull = void 0; -/** - * @_ignore - */ -const index_js_1 = require("../address/index.js"); -const index_js_2 = require("../crypto/index.js"); -const index_js_3 = require("../transaction/index.js"); -const index_js_4 = require("../utils/index.js"); -const BN_0 = BigInt(0); -function allowNull(format, nullValue) { - return (function (value) { - if (value == null) { - return nullValue; - } - return format(value); - }); -} -exports.allowNull = allowNull; -function arrayOf(format, allowNull) { - return ((array) => { - if (allowNull && array == null) { - return null; - } - if (!Array.isArray(array)) { - throw new Error("not an array"); - } - return array.map((i) => format(i)); - }); -} -exports.arrayOf = arrayOf; -// Requires an object which matches a fleet of other formatters -// Any FormatFunc may return `undefined` to have the value omitted -// from the result object. Calls preserve `this`. -function object(format, altNames) { - return ((value) => { - const result = {}; - for (const key in format) { - let srcKey = key; - if (altNames && key in altNames && !(srcKey in value)) { - for (const altKey of altNames[key]) { - if (altKey in value) { - srcKey = altKey; - break; - } - } - } - try { - const nv = format[key](value[srcKey]); - if (nv !== undefined) { - result[key] = nv; - } - } - catch (error) { - const message = (error instanceof Error) ? error.message : "not-an-error"; - (0, index_js_4.assert)(false, `invalid value for value.${key} (${message})`, "BAD_DATA", { value }); - } - } - return result; - }); -} -exports.object = object; -function formatBoolean(value) { - switch (value) { - case true: - case "true": - return true; - case false: - case "false": - return false; - } - (0, index_js_4.assertArgument)(false, `invalid boolean; ${JSON.stringify(value)}`, "value", value); -} -exports.formatBoolean = formatBoolean; -function formatData(value) { - (0, index_js_4.assertArgument)((0, index_js_4.isHexString)(value, true), "invalid data", "value", value); - return value; -} -exports.formatData = formatData; -function formatHash(value) { - (0, index_js_4.assertArgument)((0, index_js_4.isHexString)(value, 32), "invalid hash", "value", value); - return value; -} -exports.formatHash = formatHash; -function formatUint256(value) { - if (!(0, index_js_4.isHexString)(value)) { - throw new Error("invalid uint256"); - } - return (0, index_js_4.zeroPadValue)(value, 32); -} -exports.formatUint256 = formatUint256; -const _formatLog = object({ - address: index_js_1.getAddress, - blockHash: formatHash, - blockNumber: index_js_4.getNumber, - data: formatData, - index: index_js_4.getNumber, - removed: allowNull(formatBoolean, false), - topics: arrayOf(formatHash), - transactionHash: formatHash, - transactionIndex: index_js_4.getNumber, -}, { - index: ["logIndex"] -}); -function formatLog(value) { - return _formatLog(value); -} -exports.formatLog = formatLog; -const _formatBlock = object({ - hash: allowNull(formatHash), - parentHash: formatHash, - parentBeaconBlockRoot: allowNull(formatHash, null), - number: index_js_4.getNumber, - timestamp: index_js_4.getNumber, - nonce: allowNull(formatData), - difficulty: index_js_4.getBigInt, - gasLimit: index_js_4.getBigInt, - gasUsed: index_js_4.getBigInt, - stateRoot: allowNull(formatHash, null), - receiptsRoot: allowNull(formatHash, null), - blobGasUsed: allowNull(index_js_4.getBigInt, null), - excessBlobGas: allowNull(index_js_4.getBigInt, null), - miner: allowNull(index_js_1.getAddress), - prevRandao: allowNull(formatHash, null), - extraData: formatData, - baseFeePerGas: allowNull(index_js_4.getBigInt) -}, { - prevRandao: ["mixHash"] -}); -function formatBlock(value) { - const result = _formatBlock(value); - result.transactions = value.transactions.map((tx) => { - if (typeof (tx) === "string") { - return tx; - } - return formatTransactionResponse(tx); - }); - return result; -} -exports.formatBlock = formatBlock; -const _formatReceiptLog = object({ - transactionIndex: index_js_4.getNumber, - blockNumber: index_js_4.getNumber, - transactionHash: formatHash, - address: index_js_1.getAddress, - topics: arrayOf(formatHash), - data: formatData, - index: index_js_4.getNumber, - blockHash: formatHash, -}, { - index: ["logIndex"] -}); -function formatReceiptLog(value) { - return _formatReceiptLog(value); -} -exports.formatReceiptLog = formatReceiptLog; -const _formatTransactionReceipt = object({ - to: allowNull(index_js_1.getAddress, null), - from: allowNull(index_js_1.getAddress, null), - contractAddress: allowNull(index_js_1.getAddress, null), - // should be allowNull(hash), but broken-EIP-658 support is handled in receipt - index: index_js_4.getNumber, - root: allowNull(index_js_4.hexlify), - gasUsed: index_js_4.getBigInt, - blobGasUsed: allowNull(index_js_4.getBigInt, null), - logsBloom: allowNull(formatData), - blockHash: formatHash, - hash: formatHash, - logs: arrayOf(formatReceiptLog), - blockNumber: index_js_4.getNumber, - //confirmations: allowNull(getNumber, null), - cumulativeGasUsed: index_js_4.getBigInt, - effectiveGasPrice: allowNull(index_js_4.getBigInt), - blobGasPrice: allowNull(index_js_4.getBigInt, null), - status: allowNull(index_js_4.getNumber), - type: allowNull(index_js_4.getNumber, 0) -}, { - effectiveGasPrice: ["gasPrice"], - hash: ["transactionHash"], - index: ["transactionIndex"], -}); -function formatTransactionReceipt(value) { - return _formatTransactionReceipt(value); -} -exports.formatTransactionReceipt = formatTransactionReceipt; -function formatTransactionResponse(value) { - // Some clients (TestRPC) do strange things like return 0x0 for the - // 0 address; correct this to be a real address - if (value.to && (0, index_js_4.getBigInt)(value.to) === BN_0) { - value.to = "0x0000000000000000000000000000000000000000"; - } - const result = object({ - hash: formatHash, - // Some nodes do not return this, usually test nodes (like Ganache) - index: allowNull(index_js_4.getNumber, undefined), - type: (value) => { - if (value === "0x" || value == null) { - return 0; - } - return (0, index_js_4.getNumber)(value); - }, - accessList: allowNull(index_js_3.accessListify, null), - blobVersionedHashes: allowNull(arrayOf(formatHash, true), null), - authorizationList: allowNull(arrayOf((v) => { - let sig; - if (v.signature) { - sig = v.signature; - } - else { - let yParity = v.yParity; - if (yParity === "0x1b") { - yParity = 0; - } - else if (yParity === "0x1c") { - yParity = 1; - } - sig = Object.assign({}, v, { yParity }); - } - return { - address: (0, index_js_1.getAddress)(v.address), - chainId: (0, index_js_4.getBigInt)(v.chainId), - nonce: (0, index_js_4.getBigInt)(v.nonce), - signature: index_js_2.Signature.from(sig) - }; - }, false), null), - blockHash: allowNull(formatHash, null), - blockNumber: allowNull(index_js_4.getNumber, null), - transactionIndex: allowNull(index_js_4.getNumber, null), - from: index_js_1.getAddress, - // either (gasPrice) or (maxPriorityFeePerGas + maxFeePerGas) must be set - gasPrice: allowNull(index_js_4.getBigInt), - maxPriorityFeePerGas: allowNull(index_js_4.getBigInt), - maxFeePerGas: allowNull(index_js_4.getBigInt), - maxFeePerBlobGas: allowNull(index_js_4.getBigInt, null), - gasLimit: index_js_4.getBigInt, - to: allowNull(index_js_1.getAddress, null), - value: index_js_4.getBigInt, - nonce: index_js_4.getNumber, - data: formatData, - creates: allowNull(index_js_1.getAddress, null), - chainId: allowNull(index_js_4.getBigInt, null) - }, { - data: ["input"], - gasLimit: ["gas"], - index: ["transactionIndex"] - })(value); - // If to and creates are empty, populate the creates from the value - if (result.to == null && result.creates == null) { - result.creates = (0, index_js_1.getCreateAddress)(result); - } - // @TODO: Check fee data - // Add an access list to supported transaction types - if ((value.type === 1 || value.type === 2) && value.accessList == null) { - result.accessList = []; - } - // Compute the signature - if (value.signature) { - result.signature = index_js_2.Signature.from(value.signature); - } - else { - result.signature = index_js_2.Signature.from(value); - } - // Some backends omit ChainId on legacy transactions, but we can compute it - if (result.chainId == null) { - const chainId = result.signature.legacyChainId; - if (chainId != null) { - result.chainId = chainId; - } - } - // @TODO: check chainID - /* - if (value.chainId != null) { - let chainId = value.chainId; - - if (isHexString(chainId)) { - chainId = BigNumber.from(chainId).toNumber(); - } - - result.chainId = chainId; - - } else { - let chainId = value.networkId; - - // geth-etc returns chainId - if (chainId == null && result.v == null) { - chainId = value.chainId; - } - - if (isHexString(chainId)) { - chainId = BigNumber.from(chainId).toNumber(); - } - - if (typeof(chainId) !== "number" && result.v != null) { - chainId = (result.v - 35) / 2; - if (chainId < 0) { chainId = 0; } - chainId = parseInt(chainId); - } - - if (typeof(chainId) !== "number") { chainId = 0; } - - result.chainId = chainId; - } - */ - // 0x0000... should actually be null - if (result.blockHash && (0, index_js_4.getBigInt)(result.blockHash) === BN_0) { - result.blockHash = null; - } - return result; -} -exports.formatTransactionResponse = formatTransactionResponse; -//# sourceMappingURL=format.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/format.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/format.js.map deleted file mode 100644 index 1dc1ad9f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/format.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src.ts/providers/format.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,kDAAmE;AACnE,iDAA8C;AAC9C,sDAAwD;AACxD,gDAG2B;AAS3B,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAIvB,SAAgB,SAAS,CAAC,MAAkB,EAAE,SAAe;IACzD,OAAO,CAAC,UAAS,KAAU;QACvB,IAAI,KAAK,IAAI,IAAI,EAAE;YAAE,OAAO,SAAS,CAAC;SAAE;QACxC,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;AACP,CAAC;AALD,8BAKC;AAED,SAAgB,OAAO,CAAC,MAAkB,EAAE,SAAmB;IAC3D,OAAO,CAAC,CAAC,KAAU,EAAE,EAAE;QACnB,IAAI,SA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;;;;;;;;;;;;;;;;;;;;MAgCE;IAEF,oCAAoC;IACpC,IAAI,MAAM,CAAC,SAAS,IAAI,IAAA,oBAAS,EAAC,MAAM,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;QAC1D,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;KAC3B;IAED,OAAO,MAAM,CAAC;AAClB,CAAC;AA1ID,8DA0IC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/formatting.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/formatting.d.ts deleted file mode 100644 index e0b8c8f4..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/formatting.d.ts +++ /dev/null @@ -1,318 +0,0 @@ -/** - * About provider formatting? - * - * @_section: api/providers/formatting:Formatting [provider-formatting] - */ -import type { Signature } from "../crypto/index.js"; -import type { Authorization, AccessList } from "../transaction/index.js"; -/** - * a **BlockParams** encodes the minimal required properties for a - * formatted block. - */ -export interface BlockParams { - /** - * The block hash. - */ - hash?: null | string; - /** - * The block number. - */ - number: number; - /** - * The timestamp for this block, which is the number of seconds - * since epoch that this block was included. - */ - timestamp: number; - /** - * The hash of the previous block in the blockchain. The genesis block - * has the parentHash of the [[ZeroHash]]. - */ - parentHash: string; - /** - * The hash tree root of the parent beacon block for the given - * execution block. See [[link-eip-4788]]. - */ - parentBeaconBlockRoot?: null | string; - /** - * A random sequence provided during the mining process for - * proof-of-work networks. - */ - nonce: string; - /** - * For proof-of-work networks, the difficulty target is used to - * adjust the difficulty in mining to ensure an expected block rate. - */ - difficulty: bigint; - /** - * The maximum amount of gas a block can consume. - */ - gasLimit: bigint; - /** - * The amount of gas a block consumed. - */ - gasUsed: bigint; - /** - * The total amount of BLOb gas consumed by transactions within - * the block. See [[link-eip4844]. - */ - blobGasUsed?: null | bigint; - /** - * The running total of BLOb gas consumed in excess of the target - * prior to the block. See [[link-eip-4844]]. - */ - excessBlobGas?: null | bigint; - /** - * The miner (or author) of a block. - */ - miner: string; - /** - * The latest RANDAO mix of the post beacon state of - * the previous block. - */ - prevRandao?: null | string; - /** - * Additional data the miner choose to include. - */ - extraData: string; - /** - * The protocol-defined base fee per gas in an [[link-eip-1559]] - * block. - */ - baseFeePerGas: null | bigint; - /** - * The root hash for the global state after applying changes - * in this block. - */ - stateRoot?: null | string; - /** - * The hash of the transaction receipts trie. - */ - receiptsRoot?: null | string; - /** - * The list of transactions in the block. - */ - transactions: ReadonlyArray; -} -/** - * a **LogParams** encodes the minimal required properties for a - * formatted log. - */ -export interface LogParams { - /** - * The transaction hash for the transaxction the log occurred in. - */ - transactionHash: string; - /** - * The block hash of the block that included the transaction for this - * log. - */ - blockHash: string; - /** - * The block number of the block that included the transaction for this - * log. - */ - blockNumber: number; - /** - * Whether this log was removed due to the transaction it was included - * in being removed dur to an orphaned block. - */ - removed: boolean; - /** - * The address of the contract that emitted this log. - */ - address: string; - /** - * The data emitted with this log. - */ - data: string; - /** - * The topics emitted with this log. - */ - topics: ReadonlyArray; - /** - * The index of this log. - */ - index: number; - /** - * The transaction index of this log. - */ - transactionIndex: number; -} -/** - * a **TransactionReceiptParams** encodes the minimal required properties - * for a formatted transaction receipt. - */ -export interface TransactionReceiptParams { - /** - * The target of the transaction. If null, the transaction was trying - * to deploy a transaction with the ``data`` as the initi=code. - */ - to: null | string; - /** - * The sender of the transaction. - */ - from: string; - /** - * If the transaction was directly deploying a contract, the [[to]] - * will be null, the ``data`` will be initcode and if successful, this - * will be the address of the contract deployed. - */ - contractAddress: null | string; - /** - * The transaction hash. - */ - hash: string; - /** - * The transaction index. - */ - index: number; - /** - * The block hash of the block that included this transaction. - */ - blockHash: string; - /** - * The block number of the block that included this transaction. - */ - blockNumber: number; - /** - * The bloom filter for the logs emitted during execution of this - * transaction. - */ - logsBloom: string; - /** - * The logs emitted during the execution of this transaction. - */ - logs: ReadonlyArray; - /** - * The amount of gas consumed executing this transaction. - */ - gasUsed: bigint; - /** - * The amount of BLOb gas used. See [[link-eip-4844]]. - */ - blobGasUsed?: null | bigint; - /** - * The total amount of gas consumed during the entire block up to - * and including this transaction. - */ - cumulativeGasUsed: bigint; - /** - * The actual gas price per gas charged for this transaction. - */ - gasPrice?: null | bigint; - /** - * The actual BLOb gas price that was charged. See [[link-eip-4844]]. - */ - blobGasPrice?: null | bigint; - /** - * The actual gas price per gas charged for this transaction. - */ - effectiveGasPrice?: null | bigint; - /** - * The [[link-eip-2718]] envelope type. - */ - type: number; - /** - * The status of the transaction execution. If ``1`` then the - * the transaction returned success, if ``0`` then the transaction - * was reverted. For pre-byzantium blocks, this is usually null, but - * some nodes may have backfilled this data. - */ - status: null | number; - /** - * The root of this transaction in a pre-bazatium block. In - * post-byzantium blocks this is null. - */ - root: null | string; -} -/** - * a **TransactionResponseParams** encodes the minimal required properties - * for a formatted transaction response. - */ -export interface TransactionResponseParams { - /** - * The block number of the block that included this transaction. - */ - blockNumber: null | number; - /** - * The block hash of the block that included this transaction. - */ - blockHash: null | string; - /** - * The transaction hash. - */ - hash: string; - /** - * The transaction index. - */ - index: number; - /** - * The [[link-eip-2718]] transaction type. - */ - type: number; - /** - * The target of the transaction. If ``null``, the ``data`` is initcode - * and this transaction is a deployment transaction. - */ - to: null | string; - /** - * The sender of the transaction. - */ - from: string; - /** - * The nonce of the transaction, used for replay protection. - */ - nonce: number; - /** - * The maximum amount of gas this transaction is authorized to consume. - */ - gasLimit: bigint; - /** - * For legacy transactions, this is the gas price per gas to pay. - */ - gasPrice: bigint; - /** - * For [[link-eip-1559]] transactions, this is the maximum priority - * fee to allow a producer to claim. - */ - maxPriorityFeePerGas: null | bigint; - /** - * For [[link-eip-1559]] transactions, this is the maximum fee that - * will be paid. - */ - maxFeePerGas: null | bigint; - /** - * For [[link-eip-4844]] transactions, this is the maximum fee that - * will be paid per BLOb. - */ - maxFeePerBlobGas?: null | bigint; - /** - * The transaction data. - */ - data: string; - /** - * The transaction value (in wei). - */ - value: bigint; - /** - * The chain ID this transaction is valid on. - */ - chainId: bigint; - /** - * The signature of the transaction. - */ - signature: Signature; - /** - * The transaction access list. - */ - accessList: null | AccessList; - /** - * The [[link-eip-4844]] BLOb versioned hashes. - */ - blobVersionedHashes?: null | Array; - /** - * The [[link-eip-7702]] authorizations (if any). - */ - authorizationList: null | Array; -} -//# sourceMappingURL=formatting.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/formatting.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/formatting.d.ts.map deleted file mode 100644 index a28257d0..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/formatting.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../src.ts/providers/formatting.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAMzE;;;GAGG;AACH,MAAM,WAAW,WAAW;IACxB;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAErB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAEtC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,WAAW,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAE5B;;;OAGG;IACH,aAAa,CAAC,EAAE,IAAI,GAAG,MA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AE5B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAEjC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,SAAS,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,UAAU,EAAE,IAAI,GAAG,UAAU,CAAC;IAE9B;;OAEG;IACH,mBAAmB,CAAC,EAAE,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IAE3C;;OAEG;IACH,iBAAiB,EAAE,IAAI,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC;CAClD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/formatting.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/formatting.js deleted file mode 100644 index aa2ace79..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/formatting.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; -/** - * About provider formatting? - * - * @_section: api/providers/formatting:Formatting [provider-formatting] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -; -; -//# sourceMappingURL=formatting.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/formatting.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/formatting.js.map deleted file mode 100644 index 034ced5a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/formatting.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"formatting.js","sourceRoot":"","sources":["../../src.ts/providers/formatting.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAiHF,CAAC;AA0SD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/index.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/index.d.ts deleted file mode 100644 index 172c487a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/index.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * A **Provider** provides a connection to the blockchain, whch can be - * used to query its current state, simulate execution and send transactions - * to update the state. - * - * It is one of the most fundamental components of interacting with a - * blockchain application, and there are many ways to connect, such as over - * HTTP, WebSockets or injected providers such as [MetaMask](link-metamask). - * - * @_section: api/providers:Providers [about-providers] - */ -export { AbstractProvider, UnmanagedSubscriber } from "./abstract-provider.js"; -export { AbstractSigner, VoidSigner, } from "./abstract-signer.js"; -export { showThrottleMessage } from "./community.js"; -export { getDefaultProvider } from "./default-provider.js"; -export { EnsResolver, MulticoinProviderPlugin } from "./ens-resolver.js"; -export { Network } from "./network.js"; -export { NonceManager } from "./signer-noncemanager.js"; -export { NetworkPlugin, GasCostPlugin, EnsPlugin, FeeDataNetworkPlugin, FetchUrlFeeDataNetworkPlugin, } from "./plugins-network.js"; -export { Block, FeeData, Log, TransactionReceipt, TransactionResponse, copyRequest, } from "./provider.js"; -export { FallbackProvider } from "./provider-fallback.js"; -export { JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner } from "./provider-jsonrpc.js"; -export { BrowserProvider } from "./provider-browser.js"; -export { AlchemyProvider } from "./provider-alchemy.js"; -export { BlockscoutProvider } from "./provider-blockscout.js"; -export { AnkrProvider } from "./provider-ankr.js"; -export { CloudflareProvider } from "./provider-cloudflare.js"; -export { ChainstackProvider } from "./provider-chainstack.js"; -export { EtherscanProvider, EtherscanPlugin } from "./provider-etherscan.js"; -export { InfuraProvider, InfuraWebSocketProvider } from "./provider-infura.js"; -export { PocketProvider } from "./provider-pocket.js"; -export { QuickNodeProvider } from "./provider-quicknode.js"; -import { IpcSocketProvider } from "./provider-ipcsocket.js"; -export { IpcSocketProvider }; -export { SocketProvider } from "./provider-socket.js"; -export { WebSocketProvider } from "./provider-websocket.js"; -export { SocketSubscriber, SocketBlockSubscriber, SocketPendingSubscriber, SocketEventSubscriber } from "./provider-socket.js"; -export type { AbstractProviderOptions, Subscription, Subscriber, AbstractProviderPlugin, PerformActionFilter, PerformActionTransaction, PerformActionRequest, } from "./abstract-provider.js"; -export type { ContractRunner } from "./contracts.js"; -export type { BlockParams, LogParams, TransactionReceiptParams, TransactionResponseParams, } from "./formatting.js"; -export type { CommunityResourcable } from "./community.js"; -export type { Networkish } from "./network.js"; -export type { GasCostParameters } from "./plugins-network.js"; -export type { BlockTag, TransactionRequest, PreparedTransactionRequest, EventFilter, Filter, FilterByBlockHash, OrphanFilter, ProviderEvent, TopicFilter, Provider, MinedBlock, MinedTransactionResponse } from "./provider.js"; -export type { BrowserDiscoverOptions, BrowserProviderOptions, DebugEventBrowserProvider, Eip1193Provider, Eip6963ProviderInfo } from "./provider-browser.js"; -export type { FallbackProviderOptions } from "./provider-fallback.js"; -export type { JsonRpcPayload, JsonRpcResult, JsonRpcError, JsonRpcApiProviderOptions, JsonRpcTransactionRequest, } from "./provider-jsonrpc.js"; -export type { WebSocketCreator, WebSocketLike } from "./provider-websocket.js"; -export type { Signer } from "./signer.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/index.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/index.d.ts.map deleted file mode 100644 index 2d26abd9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/providers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EACH,gBAAgB,EAAE,mBAAmB,EACxC,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACH,cAAc,EACd,UAAU,GACb,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACH,mBAAmB,EACtB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAA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,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EACH,gBAAgB,EAAE,qBAAqB,EAAE,uBAAuB,EAChE,qBAAqB,EACxB,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EACR,uBAAuB,EAAE,YAAY,EAAE,UAAU,EACjD,sBAAsB,EACtB,mBAAmB,EAAE,wBAAwB,EAAE,oBAAoB,GACtE,MAAM,wBAAwB,CAAA;AAE/B,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,YAAY,EACR,WAAW,EAAE,SAAS,EAAE,wBAAwB,EAChD,yBAAyB,GAC5B,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EACR,oBAAoB,EACvB,MAAM,gBAAgB,CAAC;AAOxB,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,YAAY,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,YAAY,EACR,QAAQ,EACR,kBAAkB,EAAE,0BAA0B,EAC9C,WAAW,EAAE,MAAM,EAAE,iBAAiB,EAAE,YAAY,EAAE,aAAa,EACnE,WAAW,EACX,QAAQ,EACR,UAAU,EAAE,wBAAwB,EACvC,MAAM,eAAe,CAAC;AAEvB,YAAY,EACR,sBAAsB,EAAE,sBAAsB,EAAE,yBAAyB,EACzE,eAAe,EAAE,mBAAmB,EACvC,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEtE,YAAY,EACR,cAAc,EAAE,aAAa,EAAE,YAAY,EAC3C,yBAAyB,EACzB,yBAAyB,GAC5B,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACR,gBAAgB,EAAE,aAAa,EAClC,MAAM,yBAAyB,CAAC;AAEjC,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/index.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/index.js deleted file mode 100644 index 39d24f62..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/index.js +++ /dev/null @@ -1,84 +0,0 @@ -"use strict"; -/** - * A **Provider** provides a connection to the blockchain, whch can be - * used to query its current state, simulate execution and send transactions - * to update the state. - * - * It is one of the most fundamental components of interacting with a - * blockchain application, and there are many ways to connect, such as over - * HTTP, WebSockets or injected providers such as [MetaMask](link-metamask). - * - * @_section: api/providers:Providers [about-providers] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.SocketEventSubscriber = exports.SocketPendingSubscriber = exports.SocketBlockSubscriber = exports.SocketSubscriber = exports.WebSocketProvider = exports.SocketProvider = exports.IpcSocketProvider = exports.QuickNodeProvider = exports.PocketProvider = exports.InfuraWebSocketProvider = exports.InfuraProvider = exports.EtherscanPlugin = exports.EtherscanProvider = exports.ChainstackProvider = exports.CloudflareProvider = exports.AnkrProvider = exports.BlockscoutProvider = exports.AlchemyProvider = exports.BrowserProvider = exports.JsonRpcSigner = exports.JsonRpcProvider = exports.JsonRpcApiProvider = exports.FallbackProvider = exports.copyRequest = exports.TransactionResponse = exports.TransactionReceipt = exports.Log = exports.FeeData = exports.Block = exports.FetchUrlFeeDataNetworkPlugin = exports.FeeDataNetworkPlugin = exports.EnsPlugin = exports.GasCostPlugin = exports.NetworkPlugin = exports.NonceManager = exports.Network = exports.MulticoinProviderPlugin = exports.EnsResolver = exports.getDefaultProvider = exports.showThrottleMessage = exports.VoidSigner = exports.AbstractSigner = exports.UnmanagedSubscriber = exports.AbstractProvider = void 0; -var abstract_provider_js_1 = require("./abstract-provider.js"); -Object.defineProperty(exports, "AbstractProvider", { enumerable: true, get: function () { return abstract_provider_js_1.AbstractProvider; } }); -Object.defineProperty(exports, "UnmanagedSubscriber", { enumerable: true, get: function () { return abstract_provider_js_1.UnmanagedSubscriber; } }); -var abstract_signer_js_1 = require("./abstract-signer.js"); -Object.defineProperty(exports, "AbstractSigner", { enumerable: true, get: function () { return abstract_signer_js_1.AbstractSigner; } }); -Object.defineProperty(exports, "VoidSigner", { enumerable: true, get: function () { return abstract_signer_js_1.VoidSigner; } }); -var community_js_1 = require("./community.js"); -Object.defineProperty(exports, "showThrottleMessage", { enumerable: true, get: function () { return community_js_1.showThrottleMessage; } }); -var default_provider_js_1 = require("./default-provider.js"); -Object.defineProperty(exports, "getDefaultProvider", { enumerable: true, get: function () { return default_provider_js_1.getDefaultProvider; } }); -var ens_resolver_js_1 = require("./ens-resolver.js"); -Object.defineProperty(exports, "EnsResolver", { enumerable: true, get: function () { return ens_resolver_js_1.EnsResolver; } }); -Object.defineProperty(exports, "MulticoinProviderPlugin", { enumerable: true, get: function () { return ens_resolver_js_1.MulticoinProviderPlugin; } }); -var network_js_1 = require("./network.js"); -Object.defineProperty(exports, "Network", { enumerable: true, get: function () { return network_js_1.Network; } }); -var signer_noncemanager_js_1 = require("./signer-noncemanager.js"); -Object.defineProperty(exports, "NonceManager", { enumerable: true, get: function () { return signer_noncemanager_js_1.NonceManager; } }); -var plugins_network_js_1 = require("./plugins-network.js"); -Object.defineProperty(exports, "NetworkPlugin", { enumerable: true, get: function () { return plugins_network_js_1.NetworkPlugin; } }); -Object.defineProperty(exports, "GasCostPlugin", { enumerable: true, get: function () { return plugins_network_js_1.GasCostPlugin; } }); -Object.defineProperty(exports, "EnsPlugin", { enumerable: true, get: function () { return plugins_network_js_1.EnsPlugin; } }); -Object.defineProperty(exports, "FeeDataNetworkPlugin", { enumerable: true, get: function () { return plugins_network_js_1.FeeDataNetworkPlugin; } }); -Object.defineProperty(exports, "FetchUrlFeeDataNetworkPlugin", { enumerable: true, get: function () { return plugins_network_js_1.FetchUrlFeeDataNetworkPlugin; } }); -var provider_js_1 = require("./provider.js"); -Object.defineProperty(exports, "Block", { enumerable: true, get: function () { return provider_js_1.Block; } }); -Object.defineProperty(exports, "FeeData", { enumerable: true, get: function () { return provider_js_1.FeeData; } }); -Object.defineProperty(exports, "Log", { enumerable: true, get: function () { return provider_js_1.Log; } }); -Object.defineProperty(exports, "TransactionReceipt", { enumerable: true, get: function () { return provider_js_1.TransactionReceipt; } }); -Object.defineProperty(exports, "TransactionResponse", { enumerable: true, get: function () { return provider_js_1.TransactionResponse; } }); -Object.defineProperty(exports, "copyRequest", { enumerable: true, get: function () { return provider_js_1.copyRequest; } }); -var provider_fallback_js_1 = require("./provider-fallback.js"); -Object.defineProperty(exports, "FallbackProvider", { enumerable: true, get: function () { return provider_fallback_js_1.FallbackProvider; } }); -var provider_jsonrpc_js_1 = require("./provider-jsonrpc.js"); -Object.defineProperty(exports, "JsonRpcApiProvider", { enumerable: true, get: function () { return provider_jsonrpc_js_1.JsonRpcApiProvider; } }); -Object.defineProperty(exports, "JsonRpcProvider", { enumerable: true, get: function () { return provider_jsonrpc_js_1.JsonRpcProvider; } }); -Object.defineProperty(exports, "JsonRpcSigner", { enumerable: true, get: function () { return provider_jsonrpc_js_1.JsonRpcSigner; } }); -var provider_browser_js_1 = require("./provider-browser.js"); -Object.defineProperty(exports, "BrowserProvider", { enumerable: true, get: function () { return provider_browser_js_1.BrowserProvider; } }); -var provider_alchemy_js_1 = require("./provider-alchemy.js"); -Object.defineProperty(exports, "AlchemyProvider", { enumerable: true, get: function () { return provider_alchemy_js_1.AlchemyProvider; } }); -var provider_blockscout_js_1 = require("./provider-blockscout.js"); -Object.defineProperty(exports, "BlockscoutProvider", { enumerable: true, get: function () { return provider_blockscout_js_1.BlockscoutProvider; } }); -var provider_ankr_js_1 = require("./provider-ankr.js"); -Object.defineProperty(exports, "AnkrProvider", { enumerable: true, get: function () { return provider_ankr_js_1.AnkrProvider; } }); -var provider_cloudflare_js_1 = require("./provider-cloudflare.js"); -Object.defineProperty(exports, "CloudflareProvider", { enumerable: true, get: function () { return provider_cloudflare_js_1.CloudflareProvider; } }); -var provider_chainstack_js_1 = require("./provider-chainstack.js"); -Object.defineProperty(exports, "ChainstackProvider", { enumerable: true, get: function () { return provider_chainstack_js_1.ChainstackProvider; } }); -var provider_etherscan_js_1 = require("./provider-etherscan.js"); -Object.defineProperty(exports, "EtherscanProvider", { enumerable: true, get: function () { return provider_etherscan_js_1.EtherscanProvider; } }); -Object.defineProperty(exports, "EtherscanPlugin", { enumerable: true, get: function () { return provider_etherscan_js_1.EtherscanPlugin; } }); -var provider_infura_js_1 = require("./provider-infura.js"); -Object.defineProperty(exports, "InfuraProvider", { enumerable: true, get: function () { return provider_infura_js_1.InfuraProvider; } }); -Object.defineProperty(exports, "InfuraWebSocketProvider", { enumerable: true, get: function () { return provider_infura_js_1.InfuraWebSocketProvider; } }); -var provider_pocket_js_1 = require("./provider-pocket.js"); -Object.defineProperty(exports, "PocketProvider", { enumerable: true, get: function () { return provider_pocket_js_1.PocketProvider; } }); -var provider_quicknode_js_1 = require("./provider-quicknode.js"); -Object.defineProperty(exports, "QuickNodeProvider", { enumerable: true, get: function () { return provider_quicknode_js_1.QuickNodeProvider; } }); -const provider_ipcsocket_js_1 = require("./provider-ipcsocket.js"); /*-browser*/ -Object.defineProperty(exports, "IpcSocketProvider", { enumerable: true, get: function () { return provider_ipcsocket_js_1.IpcSocketProvider; } }); -var provider_socket_js_1 = require("./provider-socket.js"); -Object.defineProperty(exports, "SocketProvider", { enumerable: true, get: function () { return provider_socket_js_1.SocketProvider; } }); -var provider_websocket_js_1 = require("./provider-websocket.js"); -Object.defineProperty(exports, "WebSocketProvider", { enumerable: true, get: function () { return provider_websocket_js_1.WebSocketProvider; } }); -var provider_socket_js_2 = require("./provider-socket.js"); -Object.defineProperty(exports, "SocketSubscriber", { enumerable: true, get: function () { return provider_socket_js_2.SocketSubscriber; } }); -Object.defineProperty(exports, "SocketBlockSubscriber", { enumerable: true, get: function () { return provider_socket_js_2.SocketBlockSubscriber; } }); -Object.defineProperty(exports, "SocketPendingSubscriber", { enumerable: true, get: function () { return provider_socket_js_2.SocketPendingSubscriber; } }); -Object.defineProperty(exports, "SocketEventSubscriber", { enumerable: true, get: function () { return provider_socket_js_2.SocketEventSubscriber; } }); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/index.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/index.js.map deleted file mode 100644 index 4795ace5..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/providers/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAGH,+DAEgC;AAD5B,wHAAA,gBAAgB,OAAA;AAAE,2HAAA,mBAAmB,OAAA;AAGzC,2DAG8B;AAF1B,oHAAA,cAAc,OAAA;AACd,gHAAA,UAAU,OAAA;AAGd,+CAEwB;AADpB,mHAAA,mBAAmB,OAAA;AAGvB,6DAA2D;AAAlD,yHAAA,kBAAkB,OAAA;AAE3B,qDAG2B;AAFvB,8GAAA,WAAW,OAAA;AACX,0HAAA,uBAAuB,OAAA;AAG3B,2CAAuC;AAA9B,qGAAA,OAAO,OAAA;AAEhB,mEAAwD;AAA/C,sHAAA,YAAY,OAAA;AAErB,2DAM8B;AAL1B,mHAAA,aAAa,OAAA;AACb,mHAAA,aAAa,OAAA;AACb,+GAAA,SAAS,OAAA;AACT,0HAAA,oBAAoB,OAAA;AACpB,kIAAA,4BAA4B,OAAA;AAGhC,6CASuB;AARnB,oGAAA,KAAK,OAAA;AACL,sGAAA,OAAO,OAAA;AACP,kGAAA,GAAG,OAAA;AACH,iHAAA,kBAAkB,OAAA;AAClB,kHAAA,mBAAmB,OAAA;AAEnB,0GAAA,WAAW,OAAA;AAIf,+DAA0D;AAAjD,wHAAA,gBAAgB,OAAA;AACzB,6DAA0F;AAAjF,yHAAA,kBAAkB,OAAA;AAAE,sHAAA,eAAe,OAAA;AAAE,oHAAA,aAAa,OAAA;AAE3D,6DAAwD;AAA/C,sHAAA,eAAe,OAAA;AAExB,6DAAwD;AAA/C,sHAAA,eAAe,OAAA;AACxB,mEAA8D;AAArD,4HAAA,kBAAkB,OAAA;AAC3B,uDAAkD;AAAzC,gHAAA,YAAY,OAAA;AACrB,mEAA8D;AAArD,4HAAA,kBAAkB,OAAA;AAC3B,mEAA8D;AAArD,4HAAA,kBAAkB,OAAA;AAC3B,iEAA6E;AAApE,0HAAA,iBAAiB,OAAA;AAAE,wHAAA,eAAe,OAAA;AAC3C,2DAA+E;AAAtE,oHAAA,cAAc,OAAA;AAAE,6HAAA,uBAAuB,OAAA;AAChD,2DAAsD;AAA7C,oHAAA,cAAc,OAAA;AACvB,iEAA4D;AAAnD,0HAAA,iBAAiB,OAAA;AAE1B,mEAA4D,CAAC,YAAY;AAChE,kGADA,yCAAiB,OACA;AAC1B,2DAAsD;AAA7C,oHAAA,cAAc,OAAA;AACvB,iEAA4D;AAAnD,0HAAA,iBAAiB,OAAA;AAE1B,2DAG8B;AAF1B,sHAAA,gBAAgB,OAAA;AAAE,2HAAA,qBAAqB,OAAA;AAAE,6HAAA,uBAAuB,OAAA;AAChE,2HAAA,qBAAqB,OAAA"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/network.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/network.d.ts deleted file mode 100644 index 2355df44..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/network.d.ts +++ /dev/null @@ -1,99 +0,0 @@ -/** - * A **Network** encapsulates the various properties required to - * interact with a specific chain. - * - * @_subsection: api/providers:Networks [networks] - */ -import type { BigNumberish } from "../utils/index.js"; -import type { TransactionLike } from "../transaction/index.js"; -import type { NetworkPlugin } from "./plugins-network.js"; -/** - * A Networkish can be used to allude to a Network, by specifing: - * - a [[Network]] object - * - a well-known (or registered) network name - * - a well-known (or registered) chain ID - * - an object with sufficient details to describe a network - */ -export type Networkish = Network | number | bigint | string | { - name?: string; - chainId?: number; - ensAddress?: string; - ensNetwork?: number; -}; -/** - * A **Network** provides access to a chain's properties and allows - * for plug-ins to extend functionality. - */ -export declare class Network { - #private; - /** - * Creates a new **Network** for %%name%% and %%chainId%%. - */ - constructor(name: string, chainId: BigNumberish); - /** - * Returns a JSON-compatible representation of a Network. - */ - toJSON(): any; - /** - * The network common name. - * - * This is the canonical name, as networks migh have multiple - * names. - */ - get name(): string; - set name(value: string); - /** - * The network chain ID. - */ - get chainId(): bigint; - set chainId(value: BigNumberish); - /** - * Returns true if %%other%% matches this network. Any chain ID - * must match, and if no chain ID is present, the name must match. - * - * This method does not currently check for additional properties, - * such as ENS address or plug-in compatibility. - */ - matches(other: Networkish): boolean; - /** - * Returns the list of plugins currently attached to this Network. - */ - get plugins(): Array; - /** - * Attach a new %%plugin%% to this Network. The network name - * must be unique, excluding any fragment. - */ - attachPlugin(plugin: NetworkPlugin): this; - /** - * Return the plugin, if any, matching %%name%% exactly. Plugins - * with fragments will not be returned unless %%name%% includes - * a fragment. - */ - getPlugin(name: string): null | T; - /** - * Gets a list of all plugins that match %%name%%, with otr without - * a fragment. - */ - getPlugins(basename: string): Array; - /** - * Create a copy of this Network. - */ - clone(): Network; - /** - * Compute the intrinsic gas required for a transaction. - * - * A GasCostPlugin can be attached to override the default - * values. - */ - computeIntrinsicGas(tx: TransactionLike): number; - /** - * Returns a new Network for the %%network%% name or chainId. - */ - static from(network?: Networkish): Network; - /** - * Register %%nameOrChainId%% with a function which returns - * an instance of a Network representing that chain. - */ - static register(nameOrChainId: string | number | bigint, networkFunc: () => Network): void; -} -//# sourceMappingURL=network.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/network.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/network.d.ts.map deleted file mode 100644 index b849aebb..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/network.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../src.ts/providers/network.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;A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;;OAKG;IACH,mBAAmB,CAAC,EAAE,EAAE,eAAe,GAAG,MAAM;IAyBhD;;OAEG;IACH,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO;IA+C1C;;;OAGG;IACH,MAAM,CAAC,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,WAAW,EAAE,MAAM,OAAO,GAAG,IAAI;CAQ7F"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/network.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/network.js deleted file mode 100644 index 44fe5fc1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/network.js +++ /dev/null @@ -1,369 +0,0 @@ -"use strict"; -/** - * A **Network** encapsulates the various properties required to - * interact with a specific chain. - * - * @_subsection: api/providers:Networks [networks] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Network = void 0; -const index_js_1 = require("../transaction/index.js"); -const index_js_2 = require("../utils/index.js"); -const plugins_network_js_1 = require("./plugins-network.js"); -/* * * * -// Networks which operation against an L2 can use this plugin to -// specify how to access L1, for the purpose of resolving ENS, -// for example. -export class LayerOneConnectionPlugin extends NetworkPlugin { - readonly provider!: Provider; -// @TODO: Rename to ChainAccess and allow for connecting to any chain - constructor(provider: Provider) { - super("org.ethers.plugins.layer-one-connection"); - defineProperties(this, { provider }); - } - - clone(): LayerOneConnectionPlugin { - return new LayerOneConnectionPlugin(this.provider); - } -} -*/ -const Networks = new Map(); -/** - * A **Network** provides access to a chain's properties and allows - * for plug-ins to extend functionality. - */ -class Network { - #name; - #chainId; - #plugins; - /** - * Creates a new **Network** for %%name%% and %%chainId%%. - */ - constructor(name, chainId) { - this.#name = name; - this.#chainId = (0, index_js_2.getBigInt)(chainId); - this.#plugins = new Map(); - } - /** - * Returns a JSON-compatible representation of a Network. - */ - toJSON() { - return { name: this.name, chainId: String(this.chainId) }; - } - /** - * The network common name. - * - * This is the canonical name, as networks migh have multiple - * names. - */ - get name() { return this.#name; } - set name(value) { this.#name = value; } - /** - * The network chain ID. - */ - get chainId() { return this.#chainId; } - set chainId(value) { this.#chainId = (0, index_js_2.getBigInt)(value, "chainId"); } - /** - * Returns true if %%other%% matches this network. Any chain ID - * must match, and if no chain ID is present, the name must match. - * - * This method does not currently check for additional properties, - * such as ENS address or plug-in compatibility. - */ - matches(other) { - if (other == null) { - return false; - } - if (typeof (other) === "string") { - try { - return (this.chainId === (0, index_js_2.getBigInt)(other)); - } - catch (error) { } - return (this.name === other); - } - if (typeof (other) === "number" || typeof (other) === "bigint") { - try { - return (this.chainId === (0, index_js_2.getBigInt)(other)); - } - catch (error) { } - return false; - } - if (typeof (other) === "object") { - if (other.chainId != null) { - try { - return (this.chainId === (0, index_js_2.getBigInt)(other.chainId)); - } - catch (error) { } - return false; - } - if (other.name != null) { - return (this.name === other.name); - } - return false; - } - return false; - } - /** - * Returns the list of plugins currently attached to this Network. - */ - get plugins() { - return Array.from(this.#plugins.values()); - } - /** - * Attach a new %%plugin%% to this Network. The network name - * must be unique, excluding any fragment. - */ - attachPlugin(plugin) { - if (this.#plugins.get(plugin.name)) { - throw new Error(`cannot replace existing plugin: ${plugin.name} `); - } - this.#plugins.set(plugin.name, plugin.clone()); - return this; - } - /** - * Return the plugin, if any, matching %%name%% exactly. Plugins - * with fragments will not be returned unless %%name%% includes - * a fragment. - */ - getPlugin(name) { - return (this.#plugins.get(name)) || null; - } - /** - * Gets a list of all plugins that match %%name%%, with otr without - * a fragment. - */ - getPlugins(basename) { - return (this.plugins.filter((p) => (p.name.split("#")[0] === basename))); - } - /** - * Create a copy of this Network. - */ - clone() { - const clone = new Network(this.name, this.chainId); - this.plugins.forEach((plugin) => { - clone.attachPlugin(plugin.clone()); - }); - return clone; - } - /** - * Compute the intrinsic gas required for a transaction. - * - * A GasCostPlugin can be attached to override the default - * values. - */ - computeIntrinsicGas(tx) { - const costs = this.getPlugin("org.ethers.plugins.network.GasCost") || (new plugins_network_js_1.GasCostPlugin()); - let gas = costs.txBase; - if (tx.to == null) { - gas += costs.txCreate; - } - if (tx.data) { - for (let i = 2; i < tx.data.length; i += 2) { - if (tx.data.substring(i, i + 2) === "00") { - gas += costs.txDataZero; - } - else { - gas += costs.txDataNonzero; - } - } - } - if (tx.accessList) { - const accessList = (0, index_js_1.accessListify)(tx.accessList); - for (const addr in accessList) { - gas += costs.txAccessListAddress + costs.txAccessListStorageKey * accessList[addr].storageKeys.length; - } - } - return gas; - } - /** - * Returns a new Network for the %%network%% name or chainId. - */ - static from(network) { - injectCommonNetworks(); - // Default network - if (network == null) { - return Network.from("mainnet"); - } - // Canonical name or chain ID - if (typeof (network) === "number") { - network = BigInt(network); - } - if (typeof (network) === "string" || typeof (network) === "bigint") { - const networkFunc = Networks.get(network); - if (networkFunc) { - return networkFunc(); - } - if (typeof (network) === "bigint") { - return new Network("unknown", network); - } - (0, index_js_2.assertArgument)(false, "unknown network", "network", network); - } - // Clonable with network-like abilities - if (typeof (network.clone) === "function") { - const clone = network.clone(); - //if (typeof(network.name) !== "string" || typeof(network.chainId) !== "number") { - //} - return clone; - } - // Networkish - if (typeof (network) === "object") { - (0, index_js_2.assertArgument)(typeof (network.name) === "string" && typeof (network.chainId) === "number", "invalid network object name or chainId", "network", network); - const custom = new Network((network.name), (network.chainId)); - if (network.ensAddress || network.ensNetwork != null) { - custom.attachPlugin(new plugins_network_js_1.EnsPlugin(network.ensAddress, network.ensNetwork)); - } - //if ((network).layerOneConnection) { - // custom.attachPlugin(new LayerOneConnectionPlugin((network).layerOneConnection)); - //} - return custom; - } - (0, index_js_2.assertArgument)(false, "invalid network", "network", network); - } - /** - * Register %%nameOrChainId%% with a function which returns - * an instance of a Network representing that chain. - */ - static register(nameOrChainId, networkFunc) { - if (typeof (nameOrChainId) === "number") { - nameOrChainId = BigInt(nameOrChainId); - } - const existing = Networks.get(nameOrChainId); - if (existing) { - (0, index_js_2.assertArgument)(false, `conflicting network for ${JSON.stringify(existing.name)}`, "nameOrChainId", nameOrChainId); - } - Networks.set(nameOrChainId, networkFunc); - } -} -exports.Network = Network; -// We don't want to bring in formatUnits because it is backed by -// FixedNumber and we want to keep Networks tiny. The values -// included by the Gas Stations are also IEEE 754 with lots of -// rounding issues and exceed the strict checks formatUnits has. -function parseUnits(_value, decimals) { - const value = String(_value); - if (!value.match(/^[0-9.]+$/)) { - throw new Error(`invalid gwei value: ${_value}`); - } - // Break into [ whole, fraction ] - const comps = value.split("."); - if (comps.length === 1) { - comps.push(""); - } - // More than 1 decimal point or too many fractional positions - if (comps.length !== 2) { - throw new Error(`invalid gwei value: ${_value}`); - } - // Pad the fraction to 9 decimalplaces - while (comps[1].length < decimals) { - comps[1] += "0"; - } - // Too many decimals and some non-zero ending, take the ceiling - if (comps[1].length > 9) { - let frac = BigInt(comps[1].substring(0, 9)); - if (!comps[1].substring(9).match(/^0+$/)) { - frac++; - } - comps[1] = frac.toString(); - } - return BigInt(comps[0] + comps[1]); -} -// Used by Polygon to use a gas station for fee data -function getGasStationPlugin(url) { - return new plugins_network_js_1.FetchUrlFeeDataNetworkPlugin(url, async (fetchFeeData, provider, request) => { - // Prevent Cloudflare from blocking our request in node.js - request.setHeader("User-Agent", "ethers"); - let response; - try { - const [_response, _feeData] = await Promise.all([ - request.send(), fetchFeeData() - ]); - response = _response; - const payload = response.bodyJson.standard; - const feeData = { - gasPrice: _feeData.gasPrice, - maxFeePerGas: parseUnits(payload.maxFee, 9), - maxPriorityFeePerGas: parseUnits(payload.maxPriorityFee, 9), - }; - return feeData; - } - catch (error) { - (0, index_js_2.assert)(false, `error encountered with polygon gas station (${JSON.stringify(request.url)})`, "SERVER_ERROR", { request, response, error }); - } - }); -} -// See: https://chainlist.org -let injected = false; -function injectCommonNetworks() { - if (injected) { - return; - } - injected = true; - /// Register popular Ethereum networks - function registerEth(name, chainId, options) { - const func = function () { - const network = new Network(name, chainId); - // We use 0 to disable ENS - if (options.ensNetwork != null) { - network.attachPlugin(new plugins_network_js_1.EnsPlugin(null, options.ensNetwork)); - } - network.attachPlugin(new plugins_network_js_1.GasCostPlugin()); - (options.plugins || []).forEach((plugin) => { - network.attachPlugin(plugin); - }); - return network; - }; - // Register the network by name and chain ID - Network.register(name, func); - Network.register(chainId, func); - if (options.altNames) { - options.altNames.forEach((name) => { - Network.register(name, func); - }); - } - } - registerEth("mainnet", 1, { ensNetwork: 1, altNames: ["homestead"] }); - registerEth("ropsten", 3, { ensNetwork: 3 }); - registerEth("rinkeby", 4, { ensNetwork: 4 }); - registerEth("goerli", 5, { ensNetwork: 5 }); - registerEth("kovan", 42, { ensNetwork: 42 }); - registerEth("sepolia", 11155111, { ensNetwork: 11155111 }); - registerEth("holesky", 17000, { ensNetwork: 17000 }); - registerEth("classic", 61, {}); - registerEth("classicKotti", 6, {}); - registerEth("arbitrum", 42161, { - ensNetwork: 1, - }); - registerEth("arbitrum-goerli", 421613, {}); - registerEth("arbitrum-sepolia", 421614, {}); - registerEth("base", 8453, { ensNetwork: 1 }); - registerEth("base-goerli", 84531, {}); - registerEth("base-sepolia", 84532, {}); - registerEth("bnb", 56, { ensNetwork: 1 }); - registerEth("bnbt", 97, {}); - registerEth("filecoin", 314, {}); - registerEth("filecoin-calibration", 314159, {}); - registerEth("linea", 59144, { ensNetwork: 1 }); - registerEth("linea-goerli", 59140, {}); - registerEth("linea-sepolia", 59141, {}); - registerEth("matic", 137, { - ensNetwork: 1, - plugins: [ - getGasStationPlugin("https:/\/gasstation.polygon.technology/v2") - ] - }); - registerEth("matic-amoy", 80002, {}); - registerEth("matic-mumbai", 80001, { - altNames: ["maticMumbai", "maticmum"], - plugins: [ - getGasStationPlugin("https:/\/gasstation-testnet.polygon.technology/v2") - ] - }); - registerEth("optimism", 10, { - ensNetwork: 1, - plugins: [] - }); - registerEth("optimism-goerli", 420, {}); - registerEth("optimism-sepolia", 11155420, {}); - registerEth("xdai", 100, { ensNetwork: 1 }); -} -//# sourceMappingURL=network.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/network.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/network.js.map deleted file mode 100644 index 1a29b656..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/network.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"network.js","sourceRoot":"","sources":["../../src.ts/providers/network.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,sDAAwD;AACxD,gDAAsE;AAEtE,6DAE8B;AA0B9B;;;;;;;;;;;;;;;;EAgBE;AAGF,MAAM,QAAQ,GAAwC,IAAI,GAAG,EAAE,CAAC;AAGhE;;;GAGG;AACH,MAAa,OAAO;IAChB,KAAK,CAAS;IACd,QAAQ,CAAS;IAEjB,QAAQ,CAA6B;IAErC;;OAEG;IACH,YAAY,IAAY,EAAE,OAAqB;QAC3C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,IAAA,oBAAS,EAAC,OAAO,CAAC,CAAC;QACnC,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,EAAE,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,MAAM;QACF,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;IAC9D,CAAC;IAED;;;;;OAKG;IACH,IAAI,IAAI,KAAa,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACzC,IAAI,IAAI,CAAC,KAAa,IAAI,IAAI,CAAC,KAAK,GAAI,KAAK,CAAC,CAAC,CAAC;IAEhD;;OAEG;IACH,IAAI,OAAO,KAAa,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC/C,IAAI,OAAO,CAAC,KAAmB,IAAI,IAAI,CAAC,QAAQ,GAAG,IAAA,oBAAS,EAAC,KAAK,EAAE,SAAS,CAAC,CAAC,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AE,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC;AAChD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/pagination.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/pagination.d.ts deleted file mode 100644 index a772a85c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/pagination.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface PaginationResult extends Array { - next(): Promise>; - totalResults: null | number; - done: boolean; -} -//# sourceMappingURL=pagination.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/pagination.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/pagination.d.ts.map deleted file mode 100644 index 083dedb3..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/pagination.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src.ts/providers/pagination.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB,CAAC,CAAC,CAAE,SAAQ,KAAK,CAAC,CAAC,CAAC;IACjD,IAAI,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;IAGrC,YAAY,EAAE,IAAI,GAAG,MAAM,CAAC;IAE5B,IAAI,EAAE,OAAO,CAAC;CACjB"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/pagination.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/pagination.js deleted file mode 100644 index 7696f1a4..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/pagination.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=pagination.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/pagination.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/pagination.js.map deleted file mode 100644 index d08e925c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/pagination.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../src.ts/providers/pagination.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/plugin-fallback.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/plugin-fallback.d.ts deleted file mode 100644 index 6c525ec2..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/plugin-fallback.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { AbstractProviderPlugin } from "./abstract-provider.js"; -import type { AbstractProvider, PerformActionRequest } from "./abstract-provider.js"; -export declare const PluginIdFallbackProvider = "org.ethers.plugins.provider.QualifiedPlugin"; -export declare class CheckQualifiedPlugin implements AbstractProviderPlugin { - name: string; - constructor(); - connect(provider: AbstractProvider): CheckQualifiedPlugin; - isQualified(action: PerformActionRequest, result: any): boolean; -} -export declare class PossiblyPrunedTransactionPlugin extends CheckQualifiedPlugin { - isQualified(action: PerformActionRequest, result: any): boolean; -} -//# sourceMappingURL=plugin-fallback.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/plugin-fallback.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/plugin-fallback.d.ts.map deleted file mode 100644 index 95867512..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/plugin-fallback.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"plugin-fallback.d.ts","sourceRoot":"","sources":["../../src.ts/providers/plugin-fallback.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAGhE,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAGrF,eAAO,MAAM,wBAAwB,gDAAgD,CAAC;AAEtF,qBAAa,oBAAqB,YAAW,sBAAsB;IACvD,IAAI,EAAE,MAAM,CAAC;;IAMrB,OAAO,CAAC,QAAQ,EAAE,gBAAgB,GAAG,oBAAoB;IAMzD,WAAW,CAAC,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO;CAGlE;AAED,qBAAa,+BAAgC,SAAQ,oBAAoB;IACrE,WAAW,CAAC,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO;CAMlE"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/plugin-fallback.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/plugin-fallback.js deleted file mode 100644 index 9bb91933..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/plugin-fallback.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.PossiblyPrunedTransactionPlugin = exports.CheckQualifiedPlugin = exports.PluginIdFallbackProvider = void 0; -const index_js_1 = require("../utils/index.js"); -exports.PluginIdFallbackProvider = "org.ethers.plugins.provider.QualifiedPlugin"; -class CheckQualifiedPlugin { - constructor() { - (0, index_js_1.defineProperties)(this, { name: exports.PluginIdFallbackProvider }); - } - connect(provider) { - return this; - } - // Retruns true if this value should be considered qualified for - // inclusion in the quorum. - isQualified(action, result) { - return true; - } -} -exports.CheckQualifiedPlugin = CheckQualifiedPlugin; -class PossiblyPrunedTransactionPlugin extends CheckQualifiedPlugin { - isQualified(action, result) { - if (action.method === "getTransaction" || action.method === "getTransactionReceipt") { - if (result == null) { - return false; - } - } - return super.isQualified(action, result); - } -} -exports.PossiblyPrunedTransactionPlugin = PossiblyPrunedTransactionPlugin; -//# sourceMappingURL=plugin-fallback.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/plugin-fallback.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/plugin-fallback.js.map deleted file mode 100644 index 7fc4a690..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/plugin-fallback.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"plugin-fallback.js","sourceRoot":"","sources":["../../src.ts/providers/plugin-fallback.ts"],"names":[],"mappings":";;;AAEA,gDAAqD;AAKxC,QAAA,wBAAwB,GAAG,6CAA6C,CAAC;AAEtF,MAAa,oBAAoB;IAG7B;QACI,IAAA,2BAAgB,EAAuB,IAAI,EAAE,EAAE,IAAI,EAAE,gCAAwB,EAAE,CAAC,CAAC;IACrF,CAAC;IAED,OAAO,CAAC,QAA0B;QAC9B,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,gEAAgE;IAChE,2BAA2B;IAC3B,WAAW,CAAC,MAA4B,EAAE,MAAW;QACjD,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAhBD,oDAgBC;AAED,MAAa,+BAAgC,SAAQ,oBAAoB;IACrE,WAAW,CAAC,MAA4B,EAAE,MAAW;QACjD,IAAI,MAAM,CAAC,MAAM,KAAK,gBAAgB,IAAI,MAAM,CAAC,MAAM,KAAK,uBAAuB,EAAE;YACjF,IAAI,MAAM,IAAI,IAAI,EAAE;gBAAE,OAAO,KAAK,CAAC;aAAE;SACxC;QACD,OAAO,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C,CAAC;CACJ;AAPD,0EAOC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/plugins-network.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/plugins-network.d.ts deleted file mode 100644 index 73857820..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/plugins-network.d.ts +++ /dev/null @@ -1,170 +0,0 @@ -import type { FeeData, Provider } from "./provider.js"; -import type { FetchRequest } from "../utils/fetch.js"; -/** - * A **NetworkPlugin** provides additional functionality on a [[Network]]. - */ -export declare class NetworkPlugin { - /** - * The name of the plugin. - * - * It is recommended to use reverse-domain-notation, which permits - * unique names with a known authority as well as hierarchal entries. - */ - readonly name: string; - /** - * Creates a new **NetworkPlugin**. - */ - constructor(name: string); - /** - * Creates a copy of this plugin. - */ - clone(): NetworkPlugin; -} -/** - * The gas cost parameters for a [[GasCostPlugin]]. - */ -export type GasCostParameters = { - /** - * The transactions base fee. - */ - txBase?: number; - /** - * The fee for creating a new account. - */ - txCreate?: number; - /** - * The fee per zero-byte in the data. - */ - txDataZero?: number; - /** - * The fee per non-zero-byte in the data. - */ - txDataNonzero?: number; - /** - * The fee per storage key in the [[link-eip-2930]] access list. - */ - txAccessListStorageKey?: number; - /** - * The fee per address in the [[link-eip-2930]] access list. - */ - txAccessListAddress?: number; -}; -/** - * A **GasCostPlugin** allows a network to provide alternative values when - * computing the intrinsic gas required for a transaction. - */ -export declare class GasCostPlugin extends NetworkPlugin implements GasCostParameters { - /** - * The block number to treat these values as valid from. - * - * This allows a hardfork to have updated values included as well as - * mulutiple hardforks to be supported. - */ - readonly effectiveBlock: number; - /** - * The transactions base fee. - */ - readonly txBase: number; - /** - * The fee for creating a new account. - */ - readonly txCreate: number; - /** - * The fee per zero-byte in the data. - */ - readonly txDataZero: number; - /** - * The fee per non-zero-byte in the data. - */ - readonly txDataNonzero: number; - /** - * The fee per storage key in the [[link-eip-2930]] access list. - */ - readonly txAccessListStorageKey: number; - /** - * The fee per address in the [[link-eip-2930]] access list. - */ - readonly txAccessListAddress: number; - /** - * Creates a new GasCostPlugin from %%effectiveBlock%% until the - * latest block or another GasCostPlugin supercedes that block number, - * with the associated %%costs%%. - */ - constructor(effectiveBlock?: number, costs?: GasCostParameters); - clone(): GasCostPlugin; -} -/** - * An **EnsPlugin** allows a [[Network]] to specify the ENS Registry - * Contract address and the target network to use when using that - * contract. - * - * Various testnets have their own instance of the contract to use, but - * in general, the mainnet instance supports multi-chain addresses and - * should be used. - */ -export declare class EnsPlugin extends NetworkPlugin { - /** - * The ENS Registrty Contract address. - */ - readonly address: string; - /** - * The chain ID that the ENS contract lives on. - */ - readonly targetNetwork: number; - /** - * Creates a new **EnsPlugin** connected to %%address%% on the - * %%targetNetwork%%. The default ENS address and mainnet is used - * if unspecified. - */ - constructor(address?: null | string, targetNetwork?: null | number); - clone(): EnsPlugin; -} -/** - * A **FeeDataNetworkPlugin** allows a network to provide and alternate - * means to specify its fee data. - * - * For example, a network which does not support [[link-eip-1559]] may - * choose to use a Gas Station site to approximate the gas price. - */ -export declare class FeeDataNetworkPlugin extends NetworkPlugin { - #private; - /** - * The fee data function provided to the constructor. - */ - get feeDataFunc(): (provider: Provider) => Promise; - /** - * Creates a new **FeeDataNetworkPlugin**. - */ - constructor(feeDataFunc: (provider: Provider) => Promise); - /** - * Resolves to the fee data. - */ - getFeeData(provider: Provider): Promise; - clone(): FeeDataNetworkPlugin; -} -export declare class FetchUrlFeeDataNetworkPlugin extends NetworkPlugin { - #private; - /** - * The URL to initialize the FetchRequest with in %%processFunc%%. - */ - get url(): string; - /** - * The callback to use when computing the FeeData. - */ - get processFunc(): (f: () => Promise, p: Provider, r: FetchRequest) => Promise<{ - gasPrice?: null | bigint; - maxFeePerGas?: null | bigint; - maxPriorityFeePerGas?: null | bigint; - }>; - /** - * Creates a new **FetchUrlFeeDataNetworkPlugin** which will - * be used when computing the fee data for the network. - */ - constructor(url: string, processFunc: (f: () => Promise, p: Provider, r: FetchRequest) => Promise<{ - gasPrice?: null | bigint; - maxFeePerGas?: null | bigint; - maxPriorityFeePerGas?: null | bigint; - }>); - clone(): FetchUrlFeeDataNetworkPlugin; -} -//# sourceMappingURL=plugins-network.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/plugins-network.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/plugins-network.d.ts.map deleted file mode 100644 index 77938545..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/plugins-network.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"plugins-network.d.ts","sourceRoot":"","sources":["../../src.ts/providers/plugins-network.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAKtD;;GAEG;AACH,qBAAa,aAAa;IACtB;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;IAEvB;;OAEG;gBACS,IAAI,EAAE,MAAM;IAIxB;;OAEG;IACH,KAAK,IAAI,aAAa;CAOzB;AAGD;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC5B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAEhC;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAChC,CAAC;AAEF;;;GAGG;AACH,qBAAa,aAAc,SAAQ,aAAc,YAAW,iBAAiB;IACzE;;;;;OAKG;IACH,QAAQ,CAAC,cAAc,EAAG,MAAM,CAAC;IAEjC;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAEzB;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAG,MAAM,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAG,MAAM,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAG,MAAM,CAAC;IAEhC;;OAEG;IACH,QAAQ,CAAC,sBAAsB,EAAG,MAAM,CAAC;IAEzC;;OA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;gBACS,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,YAAY,KAAK,OAAO,CAAC;QAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QAAC,oBAAoB,CAAC,EAAE,IAAI,GAAG,MAAM,CAAA;KAAE,CAAC;IAO5M,KAAK,IAAI,4BAA4B;CACxC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/plugins-network.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/plugins-network.js deleted file mode 100644 index cd6fd0e9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/plugins-network.js +++ /dev/null @@ -1,216 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FetchUrlFeeDataNetworkPlugin = exports.FeeDataNetworkPlugin = exports.EnsPlugin = exports.GasCostPlugin = exports.NetworkPlugin = void 0; -const properties_js_1 = require("../utils/properties.js"); -const index_js_1 = require("../utils/index.js"); -const EnsAddress = "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"; -/** - * A **NetworkPlugin** provides additional functionality on a [[Network]]. - */ -class NetworkPlugin { - /** - * The name of the plugin. - * - * It is recommended to use reverse-domain-notation, which permits - * unique names with a known authority as well as hierarchal entries. - */ - name; - /** - * Creates a new **NetworkPlugin**. - */ - constructor(name) { - (0, properties_js_1.defineProperties)(this, { name }); - } - /** - * Creates a copy of this plugin. - */ - clone() { - return new NetworkPlugin(this.name); - } -} -exports.NetworkPlugin = NetworkPlugin; -/** - * A **GasCostPlugin** allows a network to provide alternative values when - * computing the intrinsic gas required for a transaction. - */ -class GasCostPlugin extends NetworkPlugin { - /** - * The block number to treat these values as valid from. - * - * This allows a hardfork to have updated values included as well as - * mulutiple hardforks to be supported. - */ - effectiveBlock; - /** - * The transactions base fee. - */ - txBase; - /** - * The fee for creating a new account. - */ - txCreate; - /** - * The fee per zero-byte in the data. - */ - txDataZero; - /** - * The fee per non-zero-byte in the data. - */ - txDataNonzero; - /** - * The fee per storage key in the [[link-eip-2930]] access list. - */ - txAccessListStorageKey; - /** - * The fee per address in the [[link-eip-2930]] access list. - */ - txAccessListAddress; - /** - * Creates a new GasCostPlugin from %%effectiveBlock%% until the - * latest block or another GasCostPlugin supercedes that block number, - * with the associated %%costs%%. - */ - constructor(effectiveBlock, costs) { - if (effectiveBlock == null) { - effectiveBlock = 0; - } - super(`org.ethers.network.plugins.GasCost#${(effectiveBlock || 0)}`); - const props = { effectiveBlock }; - function set(name, nullish) { - let value = (costs || {})[name]; - if (value == null) { - value = nullish; - } - (0, index_js_1.assertArgument)(typeof (value) === "number", `invalud value for ${name}`, "costs", costs); - props[name] = value; - } - set("txBase", 21000); - set("txCreate", 32000); - set("txDataZero", 4); - set("txDataNonzero", 16); - set("txAccessListStorageKey", 1900); - set("txAccessListAddress", 2400); - (0, properties_js_1.defineProperties)(this, props); - } - clone() { - return new GasCostPlugin(this.effectiveBlock, this); - } -} -exports.GasCostPlugin = GasCostPlugin; -/** - * An **EnsPlugin** allows a [[Network]] to specify the ENS Registry - * Contract address and the target network to use when using that - * contract. - * - * Various testnets have their own instance of the contract to use, but - * in general, the mainnet instance supports multi-chain addresses and - * should be used. - */ -class EnsPlugin extends NetworkPlugin { - /** - * The ENS Registrty Contract address. - */ - address; - /** - * The chain ID that the ENS contract lives on. - */ - targetNetwork; - /** - * Creates a new **EnsPlugin** connected to %%address%% on the - * %%targetNetwork%%. The default ENS address and mainnet is used - * if unspecified. - */ - constructor(address, targetNetwork) { - super("org.ethers.plugins.network.Ens"); - (0, properties_js_1.defineProperties)(this, { - address: (address || EnsAddress), - targetNetwork: ((targetNetwork == null) ? 1 : targetNetwork) - }); - } - clone() { - return new EnsPlugin(this.address, this.targetNetwork); - } -} -exports.EnsPlugin = EnsPlugin; -/** - * A **FeeDataNetworkPlugin** allows a network to provide and alternate - * means to specify its fee data. - * - * For example, a network which does not support [[link-eip-1559]] may - * choose to use a Gas Station site to approximate the gas price. - */ -class FeeDataNetworkPlugin extends NetworkPlugin { - #feeDataFunc; - /** - * The fee data function provided to the constructor. - */ - get feeDataFunc() { - return this.#feeDataFunc; - } - /** - * Creates a new **FeeDataNetworkPlugin**. - */ - constructor(feeDataFunc) { - super("org.ethers.plugins.network.FeeData"); - this.#feeDataFunc = feeDataFunc; - } - /** - * Resolves to the fee data. - */ - async getFeeData(provider) { - return await this.#feeDataFunc(provider); - } - clone() { - return new FeeDataNetworkPlugin(this.#feeDataFunc); - } -} -exports.FeeDataNetworkPlugin = FeeDataNetworkPlugin; -class FetchUrlFeeDataNetworkPlugin extends NetworkPlugin { - #url; - #processFunc; - /** - * The URL to initialize the FetchRequest with in %%processFunc%%. - */ - get url() { return this.#url; } - /** - * The callback to use when computing the FeeData. - */ - get processFunc() { return this.#processFunc; } - /** - * Creates a new **FetchUrlFeeDataNetworkPlugin** which will - * be used when computing the fee data for the network. - */ - constructor(url, processFunc) { - super("org.ethers.plugins.network.FetchUrlFeeDataPlugin"); - this.#url = url; - this.#processFunc = processFunc; - } - // We are immutable, so we can serve as our own clone - clone() { return this; } -} -exports.FetchUrlFeeDataNetworkPlugin = FetchUrlFeeDataNetworkPlugin; -/* -export class CustomBlockNetworkPlugin extends NetworkPlugin { - readonly #blockFunc: (provider: Provider, block: BlockParams) => Block; - readonly #blockWithTxsFunc: (provider: Provider, block: BlockParams) => Block; - - constructor(blockFunc: (provider: Provider, block: BlockParams) => Block, blockWithTxsFunc: (provider: Provider, block: BlockParams) => Block) { - super("org.ethers.network-plugins.custom-block"); - this.#blockFunc = blockFunc; - this.#blockWithTxsFunc = blockWithTxsFunc; - } - - async getBlock(provider: Provider, block: BlockParams): Promise> { - return await this.#blockFunc(provider, block); - } - - async getBlockions(provider: Provider, block: BlockParams): Promise> { - return await this.#blockWithTxsFunc(provider, block); - } - - clone(): CustomBlockNetworkPlugin { - return new CustomBlockNetworkPlugin(this.#blockFunc, this.#blockWithTxsFunc); - } -} -*/ -//# sourceMappingURL=plugins-network.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/plugins-network.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/plugins-network.js.map deleted file mode 100644 index dc819d56..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/plugins-network.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"plugins-network.js","sourceRoot":"","sources":["../../src.ts/providers/plugins-network.ts"],"names":[],"mappings":";;;AAAA,0DAA0D;AAE1D,gDAAmD;AAMnD,MAAM,UAAU,GAAG,4CAA4C,CAAC;AAEhE;;GAEG;AACH,MAAa,aAAa;IACtB;;;;;OAKG;IACM,IAAI,CAAU;IAEvB;;OAEG;IACH,YAAY,IAAY;QACpB,IAAA,gCAAgB,EAAgB,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IACpD,CAAC;IAED;;OAEG;IACH,KAAK;QACD,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;CAKJ;AA1BD,sCA0BC;AAsCD;;;GAGG;AACH,MAAa,aAAc,SAAQ,aAAa;IAC5C;;;;;OAKG;IACM,cAAc,CAAU;IAEjC;;OAEG;IACM,MAAM,CAAU;IAEzB;;OAEG;IACM,QAAQ,CAAU;IAE3B;;OAEG;IACM,UAAU,CAAU;IAE7B;;OAEG;IACM,aAAa,CAAU;IAEhC;;OAEG;IACM,sBAAsB,CAAU;IAEzC;;OAEG;IACM,mBAAmB,CAAU;IAGtC;;;;OAIG;IACH,YAAY,cAAuB,EAAE,KAAyB;QAC1D,IAAI,cAAc,IAAI,IAAI,EAAE;YAAE,cAAc,GAAG,CAAC,CAAC;SAAE;QACnD,KAAK,CAAC,sCAAuC,CAAC,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,CAAC,CAAC,CAAC;CACzD;AA1BD,oEA0BC;AAED;;;;;;;;;;;;;;;;;;;;;;;EAuBE"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-alchemy.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-alchemy.d.ts deleted file mode 100644 index 0fe1a7d1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-alchemy.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * [[link-alchemy]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Arbitrum Sepolia Testnet (``arbitrum-sepolia``) - * - Base (``base``) - * - Base Goerlia Testnet (``base-goerli``) - * - Base Sepolia Testnet (``base-sepolia``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Optimism Sepolia Testnet (``optimism-sepolia``) - * - Polygon (``matic``) - * - Polygon Amoy Testnet (``matic-amoy``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:Alchemy [providers-alchemy] - */ -import { FetchRequest } from "../utils/index.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import type { AbstractProvider, PerformActionRequest } from "./abstract-provider.js"; -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; -/** - * The **AlchemyProvider** connects to the [[link-alchemy]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-alchemy-signup). - * - * @_docloc: api/providers/thirdparty - */ -export declare class AlchemyProvider extends JsonRpcProvider implements CommunityResourcable { - readonly apiKey: string; - constructor(_network?: Networkish, apiKey?: null | string); - _getProvider(chainId: number): AbstractProvider; - _perform(req: PerformActionRequest): Promise; - isCommunityResource(): boolean; - static getRequest(network: Network, apiKey?: string): FetchRequest; -} -//# sourceMappingURL=provider-alchemy.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-alchemy.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-alchemy.d.ts.map deleted file mode 100644 index 9cbe30b8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-alchemy.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-alchemy.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-alchemy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAEH,YAAY,EACf,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACrF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA2C/C;;;;;;;;;;GAUG;AACH,qBAAa,eAAgB,SAAQ,eAAgB,YAAW,oBAAoB;IAChF,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;gBAEb,QAAQ,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM;IAWzD,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB;IAOzC,QAAQ,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC;IAmCvD,mBAAmB,IAAI,OAAO;IAI9B,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,YAAY;CAerE"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-alchemy.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-alchemy.js deleted file mode 100644 index a53bf680..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-alchemy.js +++ /dev/null @@ -1,151 +0,0 @@ -"use strict"; -/** - * [[link-alchemy]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Arbitrum Sepolia Testnet (``arbitrum-sepolia``) - * - Base (``base``) - * - Base Goerlia Testnet (``base-goerli``) - * - Base Sepolia Testnet (``base-sepolia``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Optimism Sepolia Testnet (``optimism-sepolia``) - * - Polygon (``matic``) - * - Polygon Amoy Testnet (``matic-amoy``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:Alchemy [providers-alchemy] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.AlchemyProvider = void 0; -const index_js_1 = require("../utils/index.js"); -const community_js_1 = require("./community.js"); -const network_js_1 = require("./network.js"); -const provider_jsonrpc_js_1 = require("./provider-jsonrpc.js"); -const defaultApiKey = "_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC"; -function getHost(name) { - switch (name) { - case "mainnet": - return "eth-mainnet.g.alchemy.com"; - case "goerli": - return "eth-goerli.g.alchemy.com"; - case "sepolia": - return "eth-sepolia.g.alchemy.com"; - case "arbitrum": - return "arb-mainnet.g.alchemy.com"; - case "arbitrum-goerli": - return "arb-goerli.g.alchemy.com"; - case "arbitrum-sepolia": - return "arb-sepolia.g.alchemy.com"; - case "base": - return "base-mainnet.g.alchemy.com"; - case "base-goerli": - return "base-goerli.g.alchemy.com"; - case "base-sepolia": - return "base-sepolia.g.alchemy.com"; - case "matic": - return "polygon-mainnet.g.alchemy.com"; - case "matic-amoy": - return "polygon-amoy.g.alchemy.com"; - case "matic-mumbai": - return "polygon-mumbai.g.alchemy.com"; - case "optimism": - return "opt-mainnet.g.alchemy.com"; - case "optimism-goerli": - return "opt-goerli.g.alchemy.com"; - case "optimism-sepolia": - return "opt-sepolia.g.alchemy.com"; - } - (0, index_js_1.assertArgument)(false, "unsupported network", "network", name); -} -/** - * The **AlchemyProvider** connects to the [[link-alchemy]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-alchemy-signup). - * - * @_docloc: api/providers/thirdparty - */ -class AlchemyProvider extends provider_jsonrpc_js_1.JsonRpcProvider { - apiKey; - constructor(_network, apiKey) { - if (_network == null) { - _network = "mainnet"; - } - const network = network_js_1.Network.from(_network); - if (apiKey == null) { - apiKey = defaultApiKey; - } - const request = AlchemyProvider.getRequest(network, apiKey); - super(request, network, { staticNetwork: network }); - (0, index_js_1.defineProperties)(this, { apiKey }); - } - _getProvider(chainId) { - try { - return new AlchemyProvider(chainId, this.apiKey); - } - catch (error) { } - return super._getProvider(chainId); - } - async _perform(req) { - // https://docs.alchemy.com/reference/trace-transaction - if (req.method === "getTransactionResult") { - const { trace, tx } = await (0, index_js_1.resolveProperties)({ - trace: this.send("trace_transaction", [req.hash]), - tx: this.getTransaction(req.hash) - }); - if (trace == null || tx == null) { - return null; - } - let data; - let error = false; - try { - data = trace[0].result.output; - error = (trace[0].error === "Reverted"); - } - catch (error) { } - if (data) { - (0, index_js_1.assert)(!error, "an error occurred during transaction executions", "CALL_EXCEPTION", { - action: "getTransactionResult", - data, - reason: null, - transaction: tx, - invocation: null, - revert: null // @TODO - }); - return data; - } - (0, index_js_1.assert)(false, "could not parse trace result", "BAD_DATA", { value: trace }); - } - return await super._perform(req); - } - isCommunityResource() { - return (this.apiKey === defaultApiKey); - } - static getRequest(network, apiKey) { - if (apiKey == null) { - apiKey = defaultApiKey; - } - const request = new index_js_1.FetchRequest(`https:/\/${getHost(network.name)}/v2/${apiKey}`); - request.allowGzip = true; - if (apiKey === defaultApiKey) { - request.retryFunc = async (request, response, attempt) => { - (0, community_js_1.showThrottleMessage)("alchemy"); - return true; - }; - } - return request; - } -} -exports.AlchemyProvider = AlchemyProvider; -//# sourceMappingURL=provider-alchemy.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-alchemy.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-alchemy.js.map deleted file mode 100644 index a214f597..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-alchemy.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-alchemy.js","sourceRoot":"","sources":["../../src.ts/providers/provider-alchemy.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;;;AAEH,gDAG2B;AAE3B,iDAAqD;AACrD,6CAAuC;AACvC,+DAAwD;AAOxD,MAAM,aAAa,GAAG,kCAAkC,CAAA;AAExD,SAAS,OAAO,CAAC,IAAY;IACzB,QAAO,IAAI,EAAE;QACT,KAAK,SAAS;YACV,OAAO,2BAA2B,CAAC;QACvC,KAAK,QAAQ;YACT,OAAO,0BAA0B,CAAC;QACtC,KAAK,SAAS;YACV,OAAO,2BAA2B,CAAC;QAEvC,KAAK,UAAU;YACX,OAAO,2BAA2B,CAAC;QACvC,KAAK,iBAAiB;YAClB,OAAO,0BAA0B,CAAC;QACtC,KAAK,kBAAkB;YACnB,OAAO,2BAA2B,CAAC;QACvC,KAAK,MAAM;YACP,OAAO,4BAA4B,CAAC;QACxC,KAAK,aAAa;YACd,OAAO,2BAA2B,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AAC,CAAC;IAC3C,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,OAAgB,EAAE,MAAe;QAC/C,IAAI,MAAM,IAAI,IAAI,EAAE;YAAE,MAAM,GAAG,aAAa,CAAC;SAAE;QAE/C,MAAM,OAAO,GAAG,IAAI,uBAAY,CAAC,YAAa,OAAO,CAAC,OAAO,CAAC,IAAI,CAAE,OAAQ,MAAO,EAAE,CAAC,CAAC;QACvF,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;QAEzB,IAAI,MAAM,KAAK,aAAa,EAAE;YAC1B,OAAO,CAAC,SAAS,GAAG,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;gBACrD,IAAA,kCAAmB,EAAC,SAAS,CAAC,CAAC;gBAC/B,OAAO,IAAI,CAAC;YAChB,CAAC,CAAA;SACJ;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ;AA3ED,0CA2EC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ankr.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ankr.d.ts deleted file mode 100644 index 8791b0aa..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ankr.d.ts +++ /dev/null @@ -1,63 +0,0 @@ -/** - * [[link-ankr]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Arbitrum (``arbitrum``) - * - Base (``base``) - * - Base Goerlia Testnet (``base-goerli``) - * - Base Sepolia Testnet (``base-sepolia``) - * - BNB (``bnb``) - * - BNB Testnet (``bnbt``) - * - Filecoin (``filecoin``) - * - Filecoin Calibration Testnet (``filecoin-calibration``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Optimism Sepolia Testnet (``optimism-sepolia``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:Ankr [providers-ankr] - */ -import { FetchRequest } from "../utils/index.js"; -import { AbstractProvider } from "./abstract-provider.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; -import type { JsonRpcError, JsonRpcPayload } from "./provider-jsonrpc.js"; -/** - * The **AnkrProvider** connects to the [[link-ankr]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-ankr-signup). - */ -export declare class AnkrProvider extends JsonRpcProvider implements CommunityResourcable { - /** - * The API key for the Ankr connection. - */ - readonly apiKey: string; - /** - * Create a new **AnkrProvider**. - * - * By default connecting to ``mainnet`` with a highly throttled - * API key. - */ - constructor(_network?: Networkish, apiKey?: null | string); - _getProvider(chainId: number): AbstractProvider; - /** - * Returns a prepared request for connecting to %%network%% with - * %%apiKey%%. - */ - static getRequest(network: Network, apiKey?: null | string): FetchRequest; - getRpcError(payload: JsonRpcPayload, error: JsonRpcError): Error; - isCommunityResource(): boolean; -} -//# sourceMappingURL=provider-ankr.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ankr.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ankr.d.ts.map deleted file mode 100644 index 392d3d03..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ankr.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-ankr.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-ankr.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EACe,YAAY,EACjC,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AA8C1E;;;;;;;;GAQG;AACH,qBAAa,YAAa,SAAQ,eAAgB,YAAW,oBAAoB;IAE7E;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAEzB;;;;;OAKG;gBACS,QAAQ,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM;IAczD,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB;IAO/C;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY;IAgBzE,WAAW,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,GAAG,KAAK;IAUhE,mBAAmB,IAAI,OAAO;CAGjC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ankr.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ankr.js deleted file mode 100644 index 9b4410d3..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ankr.js +++ /dev/null @@ -1,143 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.AnkrProvider = void 0; -/** - * [[link-ankr]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Arbitrum (``arbitrum``) - * - Base (``base``) - * - Base Goerlia Testnet (``base-goerli``) - * - Base Sepolia Testnet (``base-sepolia``) - * - BNB (``bnb``) - * - BNB Testnet (``bnbt``) - * - Filecoin (``filecoin``) - * - Filecoin Calibration Testnet (``filecoin-calibration``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Optimism Sepolia Testnet (``optimism-sepolia``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:Ankr [providers-ankr] - */ -const index_js_1 = require("../utils/index.js"); -const community_js_1 = require("./community.js"); -const network_js_1 = require("./network.js"); -const provider_jsonrpc_js_1 = require("./provider-jsonrpc.js"); -const defaultApiKey = "9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972"; -function getHost(name) { - switch (name) { - case "mainnet": - return "rpc.ankr.com/eth"; - case "goerli": - return "rpc.ankr.com/eth_goerli"; - case "sepolia": - return "rpc.ankr.com/eth_sepolia"; - case "arbitrum": - return "rpc.ankr.com/arbitrum"; - case "base": - return "rpc.ankr.com/base"; - case "base-goerli": - return "rpc.ankr.com/base_goerli"; - case "base-sepolia": - return "rpc.ankr.com/base_sepolia"; - case "bnb": - return "rpc.ankr.com/bsc"; - case "bnbt": - return "rpc.ankr.com/bsc_testnet_chapel"; - case "filecoin": - return "rpc.ankr.com/filecoin"; - case "filecoin-calibration": - return "rpc.ankr.com/filecoin_testnet"; - case "matic": - return "rpc.ankr.com/polygon"; - case "matic-mumbai": - return "rpc.ankr.com/polygon_mumbai"; - case "optimism": - return "rpc.ankr.com/optimism"; - case "optimism-goerli": - return "rpc.ankr.com/optimism_testnet"; - case "optimism-sepolia": - return "rpc.ankr.com/optimism_sepolia"; - } - (0, index_js_1.assertArgument)(false, "unsupported network", "network", name); -} -/** - * The **AnkrProvider** connects to the [[link-ankr]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-ankr-signup). - */ -class AnkrProvider extends provider_jsonrpc_js_1.JsonRpcProvider { - /** - * The API key for the Ankr connection. - */ - apiKey; - /** - * Create a new **AnkrProvider**. - * - * By default connecting to ``mainnet`` with a highly throttled - * API key. - */ - constructor(_network, apiKey) { - if (_network == null) { - _network = "mainnet"; - } - const network = network_js_1.Network.from(_network); - if (apiKey == null) { - apiKey = defaultApiKey; - } - // Ankr does not support filterId, so we force polling - const options = { polling: true, staticNetwork: network }; - const request = AnkrProvider.getRequest(network, apiKey); - super(request, network, options); - (0, index_js_1.defineProperties)(this, { apiKey }); - } - _getProvider(chainId) { - try { - return new AnkrProvider(chainId, this.apiKey); - } - catch (error) { } - return super._getProvider(chainId); - } - /** - * Returns a prepared request for connecting to %%network%% with - * %%apiKey%%. - */ - static getRequest(network, apiKey) { - if (apiKey == null) { - apiKey = defaultApiKey; - } - const request = new index_js_1.FetchRequest(`https:/\/${getHost(network.name)}/${apiKey}`); - request.allowGzip = true; - if (apiKey === defaultApiKey) { - request.retryFunc = async (request, response, attempt) => { - (0, community_js_1.showThrottleMessage)("AnkrProvider"); - return true; - }; - } - return request; - } - getRpcError(payload, error) { - if (payload.method === "eth_sendRawTransaction") { - if (error && error.error && error.error.message === "INTERNAL_ERROR: could not replace existing tx") { - error.error.message = "replacement transaction underpriced"; - } - } - return super.getRpcError(payload, error); - } - isCommunityResource() { - return (this.apiKey === defaultApiKey); - } -} -exports.AnkrProvider = AnkrProvider; -//# sourceMappingURL=provider-ankr.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ankr.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ankr.js.map deleted file mode 100644 index ed0c9185..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ankr.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-ankr.js","sourceRoot":"","sources":["../../src.ts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;IAED,WAAW,CAAC,OAAuB,EAAE,KAAmB;QACpD,IAAI,OAAO,CAAC,MAAM,KAAK,wBAAwB,EAAE;YAC7C,IAAI,KAAK,IAAI,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,OAAO,KAAK,+CAA+C,EAAE;gBACjG,KAAK,CAAC,KAAK,CAAC,OAAO,GAAG,qCAAqC,CAAC;aAC/D;SACJ;QAED,OAAO,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC7C,CAAC;IAED,mBAAmB;QACf,OAAO,CAAC,IAAI,CAAC,MAAM,KAAK,aAAa,CAAC,CAAC;IAC3C,CAAC;CACJ;AAnED,oCAmEC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-blockscout.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-blockscout.d.ts deleted file mode 100644 index be8c395e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-blockscout.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -/** - * [[link-blockscout]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Sepolia Testnet (``sepolia``) - * - Holesky Testnet (``holesky``) - * - Ethereum Classic (``classic``) - * - Arbitrum (``arbitrum``) - * - Base (``base``) - * - Base Sepolia Testnet (``base-sepolia``) - * - Gnosis (``xdai``) - * - Optimism (``optimism``) - * - Optimism Sepolia Testnet (``optimism-sepolia``) - * - Polygon (``matic``) - * - * @_subsection: api/providers/thirdparty:Blockscout [providers-blockscout] - */ -import { FetchRequest } from "../utils/index.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import type { AbstractProvider, PerformActionRequest } from "./abstract-provider.js"; -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; -import type { JsonRpcPayload, JsonRpcError } from "./provider-jsonrpc.js"; -/** - * The **BlockscoutProvider** connects to the [[link-blockscout]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-blockscout). - */ -export declare class BlockscoutProvider extends JsonRpcProvider implements CommunityResourcable { - /** - * The API key. - */ - readonly apiKey: null | string; - /** - * Creates a new **BlockscoutProvider**. - */ - constructor(_network?: Networkish, apiKey?: null | string); - _getProvider(chainId: number): AbstractProvider; - isCommunityResource(): boolean; - getRpcRequest(req: PerformActionRequest): null | { - method: string; - args: Array; - }; - getRpcError(payload: JsonRpcPayload, _error: JsonRpcError): Error; - /** - * Returns a prepared request for connecting to %%network%% - * with %%apiKey%%. - */ - static getRequest(network: Network): FetchRequest; -} -//# sourceMappingURL=provider-blockscout.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-blockscout.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-blockscout.d.ts.map deleted file mode 100644 index 41eb14f6..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-blockscout.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-blockscout.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-blockscout.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAC+B,YAAY,EACjD,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACrF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAuC1E;;;;;;;;GAQG;AACH,qBAAa,kBAAmB,SAAQ,eAAgB,YAAW,oBAAoB;IACnF;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAG,IAAI,GAAG,MAAM,CAAC;IAEhC;;OAEG;gBACS,QAAQ,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM;IAYzD,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB;IAO/C,mBAAmB,IAAI,OAAO;IAI9B,aAAa,CAAC,GAAG,EAAE,oBAAoB,GAAG,IAAI,GAAG;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;KAAE;IAUrF,WAAW,CAAC,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,GAAG,KAAK;IAoCjE;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,YAAY;CAKpD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-blockscout.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-blockscout.js deleted file mode 100644 index 03e34766..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-blockscout.js +++ /dev/null @@ -1,145 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.BlockscoutProvider = void 0; -/** - * [[link-blockscout]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Sepolia Testnet (``sepolia``) - * - Holesky Testnet (``holesky``) - * - Ethereum Classic (``classic``) - * - Arbitrum (``arbitrum``) - * - Base (``base``) - * - Base Sepolia Testnet (``base-sepolia``) - * - Gnosis (``xdai``) - * - Optimism (``optimism``) - * - Optimism Sepolia Testnet (``optimism-sepolia``) - * - Polygon (``matic``) - * - * @_subsection: api/providers/thirdparty:Blockscout [providers-blockscout] - */ -const index_js_1 = require("../utils/index.js"); -const network_js_1 = require("./network.js"); -const provider_jsonrpc_js_1 = require("./provider-jsonrpc.js"); -function getUrl(name) { - switch (name) { - case "mainnet": - return "https:/\/eth.blockscout.com/api/eth-rpc"; - case "sepolia": - return "https:/\/eth-sepolia.blockscout.com/api/eth-rpc"; - case "holesky": - return "https:/\/eth-holesky.blockscout.com/api/eth-rpc"; - case "classic": - return "https:/\/etc.blockscout.com/api/eth-rpc"; - case "arbitrum": - return "https:/\/arbitrum.blockscout.com/api/eth-rpc"; - case "base": - return "https:/\/base.blockscout.com/api/eth-rpc"; - case "base-sepolia": - return "https:/\/base-sepolia.blockscout.com/api/eth-rpc"; - case "matic": - return "https:/\/polygon.blockscout.com/api/eth-rpc"; - case "optimism": - return "https:/\/optimism.blockscout.com/api/eth-rpc"; - case "optimism-sepolia": - return "https:/\/optimism-sepolia.blockscout.com/api/eth-rpc"; - case "xdai": - return "https:/\/gnosis.blockscout.com/api/eth-rpc"; - } - (0, index_js_1.assertArgument)(false, "unsupported network", "network", name); -} -/** - * The **BlockscoutProvider** connects to the [[link-blockscout]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-blockscout). - */ -class BlockscoutProvider extends provider_jsonrpc_js_1.JsonRpcProvider { - /** - * The API key. - */ - apiKey; - /** - * Creates a new **BlockscoutProvider**. - */ - constructor(_network, apiKey) { - if (_network == null) { - _network = "mainnet"; - } - const network = network_js_1.Network.from(_network); - if (apiKey == null) { - apiKey = null; - } - const request = BlockscoutProvider.getRequest(network); - super(request, network, { staticNetwork: network }); - (0, index_js_1.defineProperties)(this, { apiKey }); - } - _getProvider(chainId) { - try { - return new BlockscoutProvider(chainId, this.apiKey); - } - catch (error) { } - return super._getProvider(chainId); - } - isCommunityResource() { - return (this.apiKey === null); - } - getRpcRequest(req) { - // Blockscout enforces the TAG argument for estimateGas - const resp = super.getRpcRequest(req); - if (resp && resp.method === "eth_estimateGas" && resp.args.length == 1) { - resp.args = resp.args.slice(); - resp.args.push("latest"); - } - return resp; - } - getRpcError(payload, _error) { - const error = _error ? _error.error : null; - // Blockscout currently drops the VM result and replaces it with a - // human-readable string, so we need to make it machine-readable. - if (error && error.code === -32015 && !(0, index_js_1.isHexString)(error.data || "", true)) { - const panicCodes = { - "assert(false)": "01", - "arithmetic underflow or overflow": "11", - "division or modulo by zero": "12", - "out-of-bounds array access; popping on an empty array": "31", - "out-of-bounds access of an array or bytesN": "32" - }; - let panicCode = ""; - if (error.message === "VM execution error.") { - // eth_call passes this message - panicCode = panicCodes[error.data] || ""; - } - else if (panicCodes[error.message || ""]) { - panicCode = panicCodes[error.message || ""]; - } - if (panicCode) { - error.message += ` (reverted: ${error.data})`; - error.data = "0x4e487b7100000000000000000000000000000000000000000000000000000000000000" + panicCode; - } - } - else if (error && error.code === -32000) { - if (error.message === "wrong transaction nonce") { - error.message += " (nonce too low)"; - } - } - return super.getRpcError(payload, _error); - } - /** - * Returns a prepared request for connecting to %%network%% - * with %%apiKey%%. - */ - static getRequest(network) { - const request = new index_js_1.FetchRequest(getUrl(network.name)); - request.allowGzip = true; - return request; - } -} -exports.BlockscoutProvider = BlockscoutProvider; -//# sourceMappingURL=provider-blockscout.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-blockscout.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-blockscout.js.map deleted file mode 100644 index 25ac8225..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-blockscout.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-blockscout.js","sourceRoot":"","sources":["../../src.ts/providers/provider-blockscout.ts"],"names":[],"mappings":";;;AACA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,gDA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CAAC;YACnB,IAAI,KAAK,CAAC,OAAO,KAAK,qBAAqB,EAAE;gBACzC,+BAA+B;gBAC/B,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;aAC5C;iBAAM,IAAI,UAAU,CAAC,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE;gBACxC,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;aAC/C;YAED,IAAI,SAAS,EAAE;gBACX,KAAK,CAAC,OAAO,IAAI,eAAgB,KAAK,CAAC,IAAK,GAAG,CAAC;gBAChD,KAAK,CAAC,IAAI,GAAG,0EAA0E,GAAG,SAAS,CAAC;aACvG;SAEJ;aAAM,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,EAAE;YACvC,IAAI,KAAK,CAAC,OAAO,KAAK,yBAAyB,EAAE;gBAC7C,KAAK,CAAC,OAAO,IAAI,kBAAkB,CAAC;aACvC;SACJ;QAED,OAAO,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC9C,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAgB;QAC9B,MAAM,OAAO,GAAG,IAAI,uBAAY,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACvD,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;QACzB,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ;AAvFD,gDAuFC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-browser.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-browser.d.ts deleted file mode 100644 index 02a5e778..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-browser.d.ts +++ /dev/null @@ -1,108 +0,0 @@ -import { JsonRpcApiPollingProvider } from "./provider-jsonrpc.js"; -import type { JsonRpcError, JsonRpcPayload, JsonRpcResult, JsonRpcSigner } from "./provider-jsonrpc.js"; -import type { Network, Networkish } from "./network.js"; -/** - * The interface to an [[link-eip-1193]] provider, which is a standard - * used by most injected providers, which the [[BrowserProvider]] accepts - * and exposes the API of. - */ -export interface Eip1193Provider { - /** - * See [[link-eip-1193]] for details on this method. - */ - request(request: { - method: string; - params?: Array | Record; - }): Promise; -} -/** - * The possible additional events dispatched when using the ``"debug"`` - * event on a [[BrowserProvider]]. - */ -export type DebugEventBrowserProvider = { - action: "sendEip1193Payload"; - payload: { - method: string; - params: Array; - }; -} | { - action: "receiveEip1193Result"; - result: any; -} | { - action: "receiveEip1193Error"; - error: Error; -}; -/** - * Provider info provided by the [[link-eip-6963]] discovery mechanism. - */ -export interface Eip6963ProviderInfo { - uuid: string; - name: string; - icon: string; - rdns: string; -} -export type BrowserProviderOptions = { - polling?: boolean; - staticNetwork?: null | boolean | Network; - cacheTimeout?: number; - pollingInterval?: number; - providerInfo?: Eip6963ProviderInfo; -}; -/** - * Specifies how [[link-eip-6963]] discovery should proceed. - * - * See: [[BrowserProvider-discover]] - */ -export interface BrowserDiscoverOptions { - /** - * Override provider detection with this provider. - */ - provider?: Eip1193Provider; - /** - * Duration to wait to detect providers. (default: 300ms) - */ - timeout?: number; - /** - * Return the first detected provider. Otherwise wait for %%timeout%% - * and allowing filtering before selecting the desired provider. - */ - anyProvider?: boolean; - /** - * Use the provided window context. Useful in non-standard - * environments or to hijack where a provider comes from. - */ - window?: any; - /** - * Explicitly choose which provider to used once scanning is complete. - */ - filter?: (found: Array) => null | BrowserProvider | Eip6963ProviderInfo; -} -/** - * A **BrowserProvider** is intended to wrap an injected provider which - * adheres to the [[link-eip-1193]] standard, which most (if not all) - * currently do. - */ -export declare class BrowserProvider extends JsonRpcApiPollingProvider { - #private; - /** - * Connect to the %%ethereum%% provider, optionally forcing the - * %%network%%. - */ - constructor(ethereum: Eip1193Provider, network?: Networkish, _options?: BrowserProviderOptions); - get providerInfo(): null | Eip6963ProviderInfo; - send(method: string, params: Array | Record): Promise; - _send(payload: JsonRpcPayload | Array): Promise>; - getRpcError(payload: JsonRpcPayload, error: JsonRpcError): Error; - /** - * Resolves to ``true`` if the provider manages the %%address%%. - */ - hasSigner(address: number | string): Promise; - getSigner(address?: number | string): Promise; - /** - * Discover and connect to a Provider in the Browser using the - * [[link-eip-6963]] discovery mechanism. If no providers are - * present, ``null`` is resolved. - */ - static discover(options?: BrowserDiscoverOptions): Promise; -} -//# sourceMappingURL=provider-browser.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-browser.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-browser.d.ts.map deleted file mode 100644 index 82554ebb..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-browser.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-browser.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,KAAK,EAER,YAAY,EAAE,cAAc,EAAE,aAAa,EAC3C,aAAa,EAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAExD;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC5B;;OAEG;IACH,OAAO,CAAC,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KAAE,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;CACjG;AAED;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACpC,MAAM,EAAE,oBAAoB,CAAC;IAC7B,OAAO,EAAE;QAAE,MAAM,EAAE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EK,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IAM5E,KAAK,CAAC,OAAO,EAAE,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,aAAa,GAAG,YAAY,CAAC,CAAC;IAc1G,WAAW,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,GAAG,KAAK;IAkBhE;;OAEG;IACG,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAYrD,SAAS,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAgBlE;;;;OAIG;WACU,QAAQ,CAAC,OAAO,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,GAAG,eAAe,CAAC;CAsG3F"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-browser.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-browser.js deleted file mode 100644 index 4f4f3238..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-browser.js +++ /dev/null @@ -1,204 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.BrowserProvider = void 0; -const index_js_1 = require("../utils/index.js"); -const provider_jsonrpc_js_1 = require("./provider-jsonrpc.js"); -; -/** - * A **BrowserProvider** is intended to wrap an injected provider which - * adheres to the [[link-eip-1193]] standard, which most (if not all) - * currently do. - */ -class BrowserProvider extends provider_jsonrpc_js_1.JsonRpcApiPollingProvider { - #request; - #providerInfo; - /** - * Connect to the %%ethereum%% provider, optionally forcing the - * %%network%%. - */ - constructor(ethereum, network, _options) { - // Copy the options - const options = Object.assign({}, ((_options != null) ? _options : {}), { batchMaxCount: 1 }); - (0, index_js_1.assertArgument)(ethereum && ethereum.request, "invalid EIP-1193 provider", "ethereum", ethereum); - super(network, options); - this.#providerInfo = null; - if (_options && _options.providerInfo) { - this.#providerInfo = _options.providerInfo; - } - this.#request = async (method, params) => { - const payload = { method, params }; - this.emit("debug", { action: "sendEip1193Request", payload }); - try { - const result = await ethereum.request(payload); - this.emit("debug", { action: "receiveEip1193Result", result }); - return result; - } - catch (e) { - const error = new Error(e.message); - error.code = e.code; - error.data = e.data; - error.payload = payload; - this.emit("debug", { action: "receiveEip1193Error", error }); - throw error; - } - }; - } - get providerInfo() { - return this.#providerInfo; - } - async send(method, params) { - await this._start(); - return await super.send(method, params); - } - async _send(payload) { - (0, index_js_1.assertArgument)(!Array.isArray(payload), "EIP-1193 does not support batch request", "payload", payload); - try { - const result = await this.#request(payload.method, payload.params || []); - return [{ id: payload.id, result }]; - } - catch (e) { - return [{ - id: payload.id, - error: { code: e.code, data: e.data, message: e.message } - }]; - } - } - getRpcError(payload, error) { - error = JSON.parse(JSON.stringify(error)); - // EIP-1193 gives us some machine-readable error codes, so rewrite - // them into Ethers standard errors. - switch (error.error.code || -1) { - case 4001: - error.error.message = `ethers-user-denied: ${error.error.message}`; - break; - case 4200: - error.error.message = `ethers-unsupported: ${error.error.message}`; - break; - } - return super.getRpcError(payload, error); - } - /** - * Resolves to ``true`` if the provider manages the %%address%%. - */ - async hasSigner(address) { - if (address == null) { - address = 0; - } - const accounts = await this.send("eth_accounts", []); - if (typeof (address) === "number") { - return (accounts.length > address); - } - address = address.toLowerCase(); - return accounts.filter((a) => (a.toLowerCase() === address)).length !== 0; - } - async getSigner(address) { - if (address == null) { - address = 0; - } - if (!(await this.hasSigner(address))) { - try { - await this.#request("eth_requestAccounts", []); - } - catch (error) { - const payload = error.payload; - throw this.getRpcError(payload, { id: payload.id, error }); - } - } - return await super.getSigner(address); - } - /** - * Discover and connect to a Provider in the Browser using the - * [[link-eip-6963]] discovery mechanism. If no providers are - * present, ``null`` is resolved. - */ - static async discover(options) { - if (options == null) { - options = {}; - } - if (options.provider) { - return new BrowserProvider(options.provider); - } - const context = options.window ? options.window : - (typeof (window) !== "undefined") ? window : null; - if (context == null) { - return null; - } - const anyProvider = options.anyProvider; - if (anyProvider && context.ethereum) { - return new BrowserProvider(context.ethereum); - } - if (!("addEventListener" in context && "dispatchEvent" in context - && "removeEventListener" in context)) { - return null; - } - const timeout = options.timeout ? options.timeout : 300; - if (timeout === 0) { - return null; - } - return await (new Promise((resolve, reject) => { - let found = []; - const addProvider = (event) => { - found.push(event.detail); - if (anyProvider) { - finalize(); - } - }; - const finalize = () => { - clearTimeout(timer); - if (found.length) { - // If filtering is provided: - if (options && options.filter) { - // Call filter, with a copies of found provider infos - const filtered = options.filter(found.map(i => Object.assign({}, (i.info)))); - if (filtered == null) { - // No provider selected - resolve(null); - } - else if (filtered instanceof BrowserProvider) { - // Custom provider created - resolve(filtered); - } - else { - // Find the matching provider - let match = null; - if (filtered.uuid) { - const matches = found.filter(f => (filtered.uuid === f.info.uuid)); - // @TODO: What should happen if multiple values - // for the same UUID? - match = matches[0]; - } - if (match) { - const { provider, info } = match; - resolve(new BrowserProvider(provider, undefined, { - providerInfo: info - })); - } - else { - reject((0, index_js_1.makeError)("filter returned unknown info", "UNSUPPORTED_OPERATION", { - value: filtered - })); - } - } - } - else { - // Pick the first found provider - const { provider, info } = found[0]; - resolve(new BrowserProvider(provider, undefined, { - providerInfo: info - })); - } - } - else { - // Nothing found - resolve(null); - } - context.removeEventListener("eip6963:announceProvider", addProvider); - }; - const timer = setTimeout(() => { finalize(); }, timeout); - context.addEventListener("eip6963:announceProvider", addProvider); - context.dispatchEvent(new Event("eip6963:requestProvider")); - })); - } -} -exports.BrowserProvider = BrowserProvider; -//# sourceMappingURL=provider-browser.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-browser.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-browser.js.map deleted file mode 100644 index cd5156a1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-browser.js","sourceRoot":"","sources":["../../src.ts/providers/provider-browser.ts"],"names":[],"mappings":";;;AACA,gDAA8D;AAE9D,+DAAkE;AAmBjE,CAAC;AAmFF;;;;GAIG;AACH,MAAa,eAAgB,SAAQ,+CAAyB;IAC1D,QAAQ,CAA6E;IAErF,aAAa,CAA6B;IAE1C;;;OAGG;IACH,YAAY,QAAyB,EAAE,OAAoB,EAAE,QAAiC;QAE1F,mBAAmB;QACnB,MAAM,OAAO,GAA8B,MAAM,CAAC,MAAM,CAAC,EAAG,EAC1D,CAAC,CAAC,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAA,CAAC,CAAC,EAAG,CAAC,EACpC,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC,CAAC;QAExB,IAAA,yBAAc,EAAC,QAAQ,IAAI,QAAQ,CAAC,OAAO,EAAE,2BAA2B,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;QAEhG,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAExB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,QAAQ,IAAI,QAAQ,CAAC,YAAY,EAAE;YACnC,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC,YAAY,CAAC;SAC9C;QAED,IAAI,CAAC,QAAQ,GAAG,KAAK,EAAE,MAAc,EAAE,MAAwC,EAAE,EAAE;YAC/E,MAAM,OAAO,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;YACnC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,oBAAoB,EAAE,OAAO,EAAE,CAAC,CAAC;YAC9D,IAAI;gBACA,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAA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,CAAM,0BAA0B,EACtD,WAAW,CAAC,CAAC;YAEf,OAAO,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC,CAAC;QAChE,CAAC,CAAC,CAAC,CAAC;IACR,CAAC;CACJ;AA/ND,0CA+NC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-chainstack.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-chainstack.d.ts deleted file mode 100644 index dfc4f8ed..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-chainstack.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * [[link-chainstack]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Arbitrum (``arbitrum``) - * - BNB Smart Chain Mainnet (``bnb``) - * - Polygon (``matic``) - * - * @_subsection: api/providers/thirdparty:Chainstack [providers-chainstack] - */ -import { FetchRequest } from "../utils/index.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import type { AbstractProvider } from "./abstract-provider.js"; -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; -/** - * The **ChainstackProvider** connects to the [[link-chainstack]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-chainstack). - */ -export declare class ChainstackProvider extends JsonRpcProvider implements CommunityResourcable { - /** - * The API key for the Chainstack connection. - */ - readonly apiKey: string; - /** - * Creates a new **ChainstackProvider**. - */ - constructor(_network?: Networkish, apiKey?: null | string); - _getProvider(chainId: number): AbstractProvider; - isCommunityResource(): boolean; - /** - * Returns a prepared request for connecting to %%network%% - * with %%apiKey%% and %%projectSecret%%. - */ - static getRequest(network: Network, apiKey?: null | string): FetchRequest; -} -//# sourceMappingURL=provider-chainstack.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-chainstack.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-chainstack.d.ts.map deleted file mode 100644 index 54601b2d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-chainstack.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-chainstack.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-chainstack.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EACe,YAAY,EACjC,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA6B/C;;;;;;;;GAQG;AACH,qBAAa,kBAAmB,SAAQ,eAAgB,YAAW,oBAAoB;IACnF;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAEzB;;OAEG;gBACS,QAAQ,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM;IAYzD,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB;IAO/C,mBAAmB,IAAI,OAAO;IAI9B;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY;CAe5E"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-chainstack.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-chainstack.js deleted file mode 100644 index c36a8128..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-chainstack.js +++ /dev/null @@ -1,102 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ChainstackProvider = void 0; -/** - * [[link-chainstack]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Arbitrum (``arbitrum``) - * - BNB Smart Chain Mainnet (``bnb``) - * - Polygon (``matic``) - * - * @_subsection: api/providers/thirdparty:Chainstack [providers-chainstack] - */ -const index_js_1 = require("../utils/index.js"); -const community_js_1 = require("./community.js"); -const network_js_1 = require("./network.js"); -const provider_jsonrpc_js_1 = require("./provider-jsonrpc.js"); -function getApiKey(name) { - switch (name) { - case "mainnet": return "39f1d67cedf8b7831010a665328c9197"; - case "arbitrum": return "0550c209db33c3abf4cc927e1e18cea1"; - case "bnb": return "98b5a77e531614387366f6fc5da097f8"; - case "matic": return "cd9d4d70377471aa7c142ec4a4205249"; - } - (0, index_js_1.assertArgument)(false, "unsupported network", "network", name); -} -function getHost(name) { - switch (name) { - case "mainnet": - return "ethereum-mainnet.core.chainstack.com"; - case "arbitrum": - return "arbitrum-mainnet.core.chainstack.com"; - case "bnb": - return "bsc-mainnet.core.chainstack.com"; - case "matic": - return "polygon-mainnet.core.chainstack.com"; - } - (0, index_js_1.assertArgument)(false, "unsupported network", "network", name); -} -/** - * The **ChainstackProvider** connects to the [[link-chainstack]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-chainstack). - */ -class ChainstackProvider extends provider_jsonrpc_js_1.JsonRpcProvider { - /** - * The API key for the Chainstack connection. - */ - apiKey; - /** - * Creates a new **ChainstackProvider**. - */ - constructor(_network, apiKey) { - if (_network == null) { - _network = "mainnet"; - } - const network = network_js_1.Network.from(_network); - if (apiKey == null) { - apiKey = getApiKey(network.name); - } - const request = ChainstackProvider.getRequest(network, apiKey); - super(request, network, { staticNetwork: network }); - (0, index_js_1.defineProperties)(this, { apiKey }); - } - _getProvider(chainId) { - try { - return new ChainstackProvider(chainId, this.apiKey); - } - catch (error) { } - return super._getProvider(chainId); - } - isCommunityResource() { - return (this.apiKey === getApiKey(this._network.name)); - } - /** - * Returns a prepared request for connecting to %%network%% - * with %%apiKey%% and %%projectSecret%%. - */ - static getRequest(network, apiKey) { - if (apiKey == null) { - apiKey = getApiKey(network.name); - } - const request = new index_js_1.FetchRequest(`https:/\/${getHost(network.name)}/${apiKey}`); - request.allowGzip = true; - if (apiKey === getApiKey(network.name)) { - request.retryFunc = async (request, response, attempt) => { - (0, community_js_1.showThrottleMessage)("ChainstackProvider"); - return true; - }; - } - return request; - } -} -exports.ChainstackProvider = ChainstackProvider; -//# sourceMappingURL=provider-chainstack.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-chainstack.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-chainstack.js.map deleted file mode 100644 index 75998723..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-chainstack.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-chainstack.js","sourceRoot":"","sources":["../../src.ts/providers/provider-chainstack.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;GAYG;AACH,gDAE2B;AAE3B,iDAAqD;AACrD,6CAAuC;AACvC,+DAAwD;AAOxD,SAAS,SAAS,CAAC,IAAY;IAC3B,QAAQ,IAAI,EAAE;QACV,KAAK,SAAS,CAAC,CAAC,OAAO,kCAAkC,CAAC;QAC1D,KAAK,UAAU,CAAC,CAAC,OAAO,kCAAkC,CAAA;QAC1D,KAAK,KAAK,CAAC,CAAC,OAAO,kCAAkC,CAAC;QACtD,KAAK,OAAO,CAAC,CAAC,OAAO,kCAAkC,CAAC;KAC3D;IAED,IAAA,yBAAc,EAAC,KAAK,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BAAmB;QACf,OAAO,CAAC,IAAI,CAAC,MAAM,KAAK,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IAC3D,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAgB,EAAE,MAAsB;QACtD,IAAI,MAAM,IAAI,IAAI,EAAE;YAAE,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;SAAE;QAEzD,MAAM,OAAO,GAAG,IAAI,uBAAY,CAAC,YAAa,OAAO,CAAC,OAAO,CAAC,IAAI,CAAE,IAAK,MAAO,EAAE,CAAC,CAAC;QACpF,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;QAEzB,IAAI,MAAM,KAAK,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACpC,OAAO,CAAC,SAAS,GAAG,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;gBACrD,IAAA,kCAAmB,EAAC,oBAAoB,CAAC,CAAC;gBAC1C,OAAO,IAAI,CAAC;YAChB,CAAC,CAAC;SACL;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ;AAnDD,gDAmDC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-cloudflare.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-cloudflare.d.ts deleted file mode 100644 index 869651f4..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-cloudflare.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * About Cloudflare - * - * @_subsection: api/providers/thirdparty:Cloudflare [providers-cloudflare] - */ -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import type { Networkish } from "./network.js"; -/** - * About Cloudflare... - */ -export declare class CloudflareProvider extends JsonRpcProvider { - constructor(_network?: Networkish); -} -//# sourceMappingURL=provider-cloudflare.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-cloudflare.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-cloudflare.d.ts.map deleted file mode 100644 index a7469a00..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-cloudflare.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-cloudflare.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-cloudflare.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,eAAe;gBACvC,QAAQ,CAAC,EAAE,UAAU;CAMpC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-cloudflare.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-cloudflare.js deleted file mode 100644 index 9e870acf..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-cloudflare.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; -/** - * About Cloudflare - * - * @_subsection: api/providers/thirdparty:Cloudflare [providers-cloudflare] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.CloudflareProvider = void 0; -const index_js_1 = require("../utils/index.js"); -const network_js_1 = require("./network.js"); -const provider_jsonrpc_js_1 = require("./provider-jsonrpc.js"); -/** - * About Cloudflare... - */ -class CloudflareProvider extends provider_jsonrpc_js_1.JsonRpcProvider { - constructor(_network) { - if (_network == null) { - _network = "mainnet"; - } - const network = network_js_1.Network.from(_network); - (0, index_js_1.assertArgument)(network.name === "mainnet", "unsupported network", "network", _network); - super("https:/\/cloudflare-eth.com/", network, { staticNetwork: network }); - } -} -exports.CloudflareProvider = CloudflareProvider; -//# sourceMappingURL=provider-cloudflare.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-cloudflare.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-cloudflare.js.map deleted file mode 100644 index e075d533..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-cloudflare.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-cloudflare.js","sourceRoot":"","sources":["../../src.ts/providers/provider-cloudflare.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,gDAAmD;AAEnD,6CAAuC;AACvC,+DAAwD;AAIxD;;GAEG;AACH,MAAa,kBAAmB,SAAQ,qCAAe;IACnD,YAAY,QAAqB;QAC7B,IAAI,QAAQ,IAAI,IAAI,EAAE;YAAE,QAAQ,GAAG,SAAS,CAAC;SAAE;QAC/C,MAAM,OAAO,GAAG,oBAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvC,IAAA,yBAAc,EAAC,OAAO,CAAC,IAAI,KAAK,SAAS,EAAE,qBAAqB,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;QACvF,KAAK,CAAC,8BAA8B,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;CACJ;AAPD,gDAOC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-etherscan.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-etherscan.d.ts deleted file mode 100644 index bb45e4fa..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-etherscan.d.ts +++ /dev/null @@ -1,152 +0,0 @@ -/** - * [[link-etherscan]] provides a third-party service for connecting to - * various blockchains over a combination of JSON-RPC and custom API - * endpoints. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Holesky Testnet (``holesky``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Base (``base``) - * - Base Sepolia Testnet (``base-sepolia``) - * - BNB Smart Chain Mainnet (``bnb``) - * - BNB Smart Chain Testnet (``bnbt``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - Polygon Amoy Testnet (``matic-amoy``) - * - * @_subsection api/providers/thirdparty:Etherscan [providers-etherscan] - */ -import { Contract } from "../contract/index.js"; -import { AbstractProvider } from "./abstract-provider.js"; -import { Network } from "./network.js"; -import { NetworkPlugin } from "./plugins-network.js"; -import { PerformActionRequest } from "./abstract-provider.js"; -import type { Networkish } from "./network.js"; -import type { TransactionRequest } from "./provider.js"; -/** - * When subscribing to the ``"debug"`` event on an Etherscan-based - * provider, the events receive a **DebugEventEtherscanProvider** - * payload. - * - * @_docloc: api/providers/thirdparty:Etherscan - */ -export type DebugEventEtherscanProvider = { - action: "sendRequest"; - id: number; - url: string; - payload: Record; -} | { - action: "receiveRequest"; - id: number; - result: any; -} | { - action: "receiveError"; - id: number; - error: any; -}; -/** - * A Network can include an **EtherscanPlugin** to provide - * a custom base URL. - * - * @_docloc: api/providers/thirdparty:Etherscan - */ -export declare class EtherscanPlugin extends NetworkPlugin { - /** - * The Etherscan API base URL. - */ - readonly baseUrl: string; - /** - * Creates a new **EtherscanProvider** which will use - * %%baseUrl%%. - */ - constructor(baseUrl: string); - clone(): EtherscanPlugin; -} -/** - * The **EtherscanBaseProvider** is the super-class of - * [[EtherscanProvider]], which should generally be used instead. - * - * Since the **EtherscanProvider** includes additional code for - * [[Contract]] access, in //rare cases// that contracts are not - * used, this class can reduce code size. - * - * @_docloc: api/providers/thirdparty:Etherscan - */ -export declare class EtherscanProvider extends AbstractProvider { - #private; - /** - * The connected network. - */ - readonly network: Network; - /** - * The API key or null if using the community provided bandwidth. - */ - readonly apiKey: null | string; - /** - * Creates a new **EtherscanBaseProvider**. - */ - constructor(_network?: Networkish, _apiKey?: string); - /** - * Returns the base URL. - * - * If an [[EtherscanPlugin]] is configured on the - * [[EtherscanBaseProvider_network]], returns the plugin's - * baseUrl. - * - * Deprecated; for Etherscan v2 the base is no longer a simply - * host, but instead a URL including a chainId parameter. Changing - * this to return a URL prefix could break some libraries, so it - * is left intact but will be removed in the future as it is unused. - */ - getBaseUrl(): string; - /** - * Returns the URL for the %%module%% and %%params%%. - */ - getUrl(module: string, params: Record): string; - /** - * Returns the URL for using POST requests. - */ - getPostUrl(): string; - /** - * Returns the parameters for using POST requests. - */ - getPostData(module: string, params: Record): Record; - detectNetwork(): Promise; - /** - * Resolves to the result of calling %%module%% with %%params%%. - * - * If %%post%%, the request is made as a POST request. - */ - fetch(module: string, params: Record, post?: boolean): Promise; - /** - * Returns %%transaction%% normalized for the Etherscan API. - */ - _getTransactionPostData(transaction: TransactionRequest): Record; - /** - * Throws the normalized Etherscan error. - */ - _checkError(req: PerformActionRequest, error: Error, transaction: any): never; - _detectNetwork(): Promise; - _perform(req: PerformActionRequest): Promise; - getNetwork(): Promise; - /** - * Resolves to the current price of ether. - * - * This returns ``0`` on any network other than ``mainnet``. - */ - getEtherPrice(): Promise; - /** - * Resolves to a [Contract]] for %%address%%, using the - * Etherscan API to retreive the Contract ABI. - */ - getContract(_address: string): Promise; - isCommunityResource(): boolean; -} -//# sourceMappingURL=provider-etherscan.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-etherscan.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-etherscan.d.ts.map deleted file mode 100644 index 4837002e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-etherscan.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-etherscan.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-etherscan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;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AAM;IAgBnD;;;;;;;;;;;OAWG;IACH,UAAU,IAAI,MAAM;IA0CpB;;OAEG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM;IAY9D;;OAEG;IACH,UAAU,IAAI,MAAM;IAIpB;;OAEG;IACH,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAOvE,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC;IAIvC;;;;OAIG;IACG,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC;IAsFtF;;OAEG;IACH,uBAAuB,CAAC,WAAW,EAAE,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAoChF;;OAEG;IACH,WAAW,CAAC,GAAG,EAAE,oBAAoB,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,GAAG,KAAK;IAgEvE,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;IAIlC,QAAQ,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC;IAsMjD,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;IAIpC;;;;OAIG;IACG,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;IAKtC;;;OAGG;IACG,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,QAAQ,CAAC;IAc7D,mBAAmB,IAAI,OAAO;CAGjC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-etherscan.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-etherscan.js deleted file mode 100644 index 9d3dd3eb..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-etherscan.js +++ /dev/null @@ -1,601 +0,0 @@ -"use strict"; -/** - * [[link-etherscan]] provides a third-party service for connecting to - * various blockchains over a combination of JSON-RPC and custom API - * endpoints. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Holesky Testnet (``holesky``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Base (``base``) - * - Base Sepolia Testnet (``base-sepolia``) - * - BNB Smart Chain Mainnet (``bnb``) - * - BNB Smart Chain Testnet (``bnbt``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - Polygon Amoy Testnet (``matic-amoy``) - * - * @_subsection api/providers/thirdparty:Etherscan [providers-etherscan] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.EtherscanProvider = exports.EtherscanPlugin = void 0; -const index_js_1 = require("../abi/index.js"); -const index_js_2 = require("../contract/index.js"); -const index_js_3 = require("../transaction/index.js"); -const index_js_4 = require("../utils/index.js"); -const abstract_provider_js_1 = require("./abstract-provider.js"); -const network_js_1 = require("./network.js"); -const plugins_network_js_1 = require("./plugins-network.js"); -const community_js_1 = require("./community.js"); -// See: https://docs.etherscan.io/supported-chains -const Supported = ("1 11155111 17000 560048 2741 11124 33111 33139 42170 " + - "42161 421614 43114 43113 8453 84532 80069 80094 199 1029 81457 " + - "168587773 56 97 42220 11142220 252 2523 100 999 737373 747474 " + - "59144 59141 5000 5003 43521 143 10143 1287 1284 1285 10 " + - "11155420 204 5611 80002 137 534352 534351 1329 1328 146 14601 " + - "988 2201 1923 1924 167013 167000 130 1301 480 4801 51 50 324 300").split(/ /g); -const THROTTLE = 2000; -function isPromise(value) { - return (value && typeof (value.then) === "function"); -} -const EtherscanPluginId = "org.ethers.plugins.provider.Etherscan"; -/** - * A Network can include an **EtherscanPlugin** to provide - * a custom base URL. - * - * @_docloc: api/providers/thirdparty:Etherscan - */ -class EtherscanPlugin extends plugins_network_js_1.NetworkPlugin { - /** - * The Etherscan API base URL. - */ - baseUrl; - /** - * Creates a new **EtherscanProvider** which will use - * %%baseUrl%%. - */ - constructor(baseUrl) { - super(EtherscanPluginId); - (0, index_js_4.defineProperties)(this, { baseUrl }); - } - clone() { - return new EtherscanPlugin(this.baseUrl); - } -} -exports.EtherscanPlugin = EtherscanPlugin; -const skipKeys = ["enableCcipRead"]; -let nextId = 1; -/** - * The **EtherscanBaseProvider** is the super-class of - * [[EtherscanProvider]], which should generally be used instead. - * - * Since the **EtherscanProvider** includes additional code for - * [[Contract]] access, in //rare cases// that contracts are not - * used, this class can reduce code size. - * - * @_docloc: api/providers/thirdparty:Etherscan - */ -class EtherscanProvider extends abstract_provider_js_1.AbstractProvider { - /** - * The connected network. - */ - network; - /** - * The API key or null if using the community provided bandwidth. - */ - apiKey; - #plugin; - /** - * Creates a new **EtherscanBaseProvider**. - */ - constructor(_network, _apiKey) { - const apiKey = (_apiKey != null) ? _apiKey : null; - super(); - const network = network_js_1.Network.from(_network); - (0, index_js_4.assertArgument)(Supported.indexOf(`${network.chainId}`) >= 0, "unsupported network", "network", network); - this.#plugin = network.getPlugin(EtherscanPluginId); - (0, index_js_4.defineProperties)(this, { apiKey, network }); - } - /** - * Returns the base URL. - * - * If an [[EtherscanPlugin]] is configured on the - * [[EtherscanBaseProvider_network]], returns the plugin's - * baseUrl. - * - * Deprecated; for Etherscan v2 the base is no longer a simply - * host, but instead a URL including a chainId parameter. Changing - * this to return a URL prefix could break some libraries, so it - * is left intact but will be removed in the future as it is unused. - */ - getBaseUrl() { - if (this.#plugin) { - return this.#plugin.baseUrl; - } - switch (this.network.name) { - case "mainnet": - return "https:/\/api.etherscan.io"; - case "goerli": - return "https:/\/api-goerli.etherscan.io"; - case "sepolia": - return "https:/\/api-sepolia.etherscan.io"; - case "holesky": - return "https:/\/api-holesky.etherscan.io"; - case "arbitrum": - return "https:/\/api.arbiscan.io"; - case "arbitrum-goerli": - return "https:/\/api-goerli.arbiscan.io"; - case "base": - return "https:/\/api.basescan.org"; - case "base-sepolia": - return "https:/\/api-sepolia.basescan.org"; - case "bnb": - return "https:/\/api.bscscan.com"; - case "bnbt": - return "https:/\/api-testnet.bscscan.com"; - case "matic": - return "https:/\/api.polygonscan.com"; - case "matic-amoy": - return "https:/\/api-amoy.polygonscan.com"; - case "matic-mumbai": - return "https:/\/api-testnet.polygonscan.com"; - case "optimism": - return "https:/\/api-optimistic.etherscan.io"; - case "optimism-goerli": - return "https:/\/api-goerli-optimistic.etherscan.io"; - default: - } - (0, index_js_4.assertArgument)(false, "unsupported network", "network", this.network); - } - /** - * Returns the URL for the %%module%% and %%params%%. - */ - getUrl(module, params) { - let query = Object.keys(params).reduce((accum, key) => { - const value = params[key]; - if (value != null) { - accum += `&${key}=${value}`; - } - return accum; - }, ""); - if (this.apiKey) { - query += `&apikey=${this.apiKey}`; - } - return `https:/\/api.etherscan.io/v2/api?chainid=${this.network.chainId}&module=${module}${query}`; - } - /** - * Returns the URL for using POST requests. - */ - getPostUrl() { - return `https:/\/api.etherscan.io/v2/api?chainid=${this.network.chainId}`; - } - /** - * Returns the parameters for using POST requests. - */ - getPostData(module, params) { - params.module = module; - params.apikey = this.apiKey; - params.chainid = this.network.chainId; - return params; - } - async detectNetwork() { - return this.network; - } - /** - * Resolves to the result of calling %%module%% with %%params%%. - * - * If %%post%%, the request is made as a POST request. - */ - async fetch(module, params, post) { - const id = nextId++; - const url = (post ? this.getPostUrl() : this.getUrl(module, params)); - const payload = (post ? this.getPostData(module, params) : null); - this.emit("debug", { action: "sendRequest", id, url, payload: payload }); - const request = new index_js_4.FetchRequest(url); - request.setThrottleParams({ slotInterval: 1000 }); - request.retryFunc = (req, resp, attempt) => { - if (this.isCommunityResource()) { - (0, community_js_1.showThrottleMessage)("Etherscan"); - } - return Promise.resolve(true); - }; - request.processFunc = async (request, response) => { - const result = response.hasBody() ? JSON.parse((0, index_js_4.toUtf8String)(response.body)) : {}; - const throttle = ((typeof (result.result) === "string") ? result.result : "").toLowerCase().indexOf("rate limit") >= 0; - if (module === "proxy") { - // This JSON response indicates we are being throttled - if (result && result.status == 0 && result.message == "NOTOK" && throttle) { - this.emit("debug", { action: "receiveError", id, reason: "proxy-NOTOK", error: result }); - response.throwThrottleError(result.result, THROTTLE); - } - } - else { - if (throttle) { - this.emit("debug", { action: "receiveError", id, reason: "null result", error: result.result }); - response.throwThrottleError(result.result, THROTTLE); - } - } - return response; - }; - if (payload) { - request.setHeader("content-type", "application/x-www-form-urlencoded; charset=UTF-8"); - request.body = Object.keys(payload).map((k) => `${k}=${payload[k]}`).join("&"); - } - const response = await request.send(); - try { - response.assertOk(); - } - catch (error) { - this.emit("debug", { action: "receiveError", id, error, reason: "assertOk" }); - (0, index_js_4.assert)(false, "response error", "SERVER_ERROR", { request, response }); - } - if (!response.hasBody()) { - this.emit("debug", { action: "receiveError", id, error: "missing body", reason: "null body" }); - (0, index_js_4.assert)(false, "missing response", "SERVER_ERROR", { request, response }); - } - const result = JSON.parse((0, index_js_4.toUtf8String)(response.body)); - if (module === "proxy") { - if (result.jsonrpc != "2.0") { - this.emit("debug", { action: "receiveError", id, result, reason: "invalid JSON-RPC" }); - (0, index_js_4.assert)(false, "invalid JSON-RPC response (missing jsonrpc='2.0')", "SERVER_ERROR", { request, response, info: { result } }); - } - if (result.error) { - this.emit("debug", { action: "receiveError", id, result, reason: "JSON-RPC error" }); - (0, index_js_4.assert)(false, "error response", "SERVER_ERROR", { request, response, info: { result } }); - } - this.emit("debug", { action: "receiveRequest", id, result }); - return result.result; - } - else { - // getLogs, getHistory have weird success responses - if (result.status == 0 && (result.message === "No records found" || result.message === "No transactions found")) { - this.emit("debug", { action: "receiveRequest", id, result }); - return result.result; - } - if (result.status != 1 || (typeof (result.message) === "string" && !result.message.match(/^OK/))) { - this.emit("debug", { action: "receiveError", id, result }); - (0, index_js_4.assert)(false, "error response", "SERVER_ERROR", { request, response, info: { result } }); - } - this.emit("debug", { action: "receiveRequest", id, result }); - return result.result; - } - } - /** - * Returns %%transaction%% normalized for the Etherscan API. - */ - _getTransactionPostData(transaction) { - const result = {}; - for (let key in transaction) { - if (skipKeys.indexOf(key) >= 0) { - continue; - } - if (transaction[key] == null) { - continue; - } - let value = transaction[key]; - if (key === "type" && value === 0) { - continue; - } - if (key === "blockTag" && value === "latest") { - continue; - } - // Quantity-types require no leading zero, unless 0 - if ({ type: true, gasLimit: true, gasPrice: true, maxFeePerGs: true, maxPriorityFeePerGas: true, nonce: true, value: true }[key]) { - value = (0, index_js_4.toQuantity)(value); - } - else if (key === "accessList") { - value = "[" + (0, index_js_3.accessListify)(value).map((set) => { - return `{address:"${set.address}",storageKeys:["${set.storageKeys.join('","')}"]}`; - }).join(",") + "]"; - } - else if (key === "blobVersionedHashes") { - if (value.length === 0) { - continue; - } - // @TODO: update this once the API supports blobs - (0, index_js_4.assert)(false, "Etherscan API does not support blobVersionedHashes", "UNSUPPORTED_OPERATION", { - operation: "_getTransactionPostData", - info: { transaction } - }); - } - else { - value = (0, index_js_4.hexlify)(value); - } - result[key] = value; - } - return result; - } - /** - * Throws the normalized Etherscan error. - */ - _checkError(req, error, transaction) { - // Pull any message out if, possible - let message = ""; - if ((0, index_js_4.isError)(error, "SERVER_ERROR")) { - // Check for an error emitted by a proxy call - try { - message = error.info.result.error.message; - } - catch (e) { } - if (!message) { - try { - message = error.info.message; - } - catch (e) { } - } - } - if (req.method === "estimateGas") { - if (!message.match(/revert/i) && message.match(/insufficient funds/i)) { - (0, index_js_4.assert)(false, "insufficient funds", "INSUFFICIENT_FUNDS", { - transaction: req.transaction - }); - } - } - if (req.method === "call" || req.method === "estimateGas") { - if (message.match(/execution reverted/i)) { - let data = ""; - try { - data = error.info.result.error.data; - } - catch (error) { } - const e = index_js_1.AbiCoder.getBuiltinCallException(req.method, req.transaction, data); - e.info = { request: req, error }; - throw e; - } - } - if (message) { - if (req.method === "broadcastTransaction") { - const transaction = index_js_3.Transaction.from(req.signedTransaction); - if (message.match(/replacement/i) && message.match(/underpriced/i)) { - (0, index_js_4.assert)(false, "replacement fee too low", "REPLACEMENT_UNDERPRICED", { - transaction - }); - } - if (message.match(/insufficient funds/)) { - (0, index_js_4.assert)(false, "insufficient funds for intrinsic transaction cost", "INSUFFICIENT_FUNDS", { - transaction - }); - } - if (message.match(/same hash was already imported|transaction nonce is too low|nonce too low/)) { - (0, index_js_4.assert)(false, "nonce has already been used", "NONCE_EXPIRED", { - transaction - }); - } - } - } - // Something we could not process - throw error; - } - async _detectNetwork() { - return this.network; - } - async _perform(req) { - switch (req.method) { - case "chainId": - return this.network.chainId; - case "getBlockNumber": - return this.fetch("proxy", { action: "eth_blockNumber" }); - case "getGasPrice": - return this.fetch("proxy", { action: "eth_gasPrice" }); - case "getPriorityFee": - // This is temporary until Etherscan completes support - if (this.network.name === "mainnet") { - return "1000000000"; - } - else if (this.network.name === "optimism") { - return "1000000"; - } - else { - throw new Error("fallback onto the AbstractProvider default"); - } - /* Working with Etherscan to get this added: - try { - const test = await this.fetch("proxy", { - action: "eth_maxPriorityFeePerGas" - }); - console.log(test); - return test; - } catch (e) { - console.log("DEBUG", e); - throw e; - } - */ - /* This might be safe; but due to rounding neither myself - or Etherscan are necessarily comfortable with this. :) - try { - const result = await this.fetch("gastracker", { action: "gasoracle" }); - console.log(result); - const gasPrice = parseUnits(result.SafeGasPrice, "gwei"); - const baseFee = parseUnits(result.suggestBaseFee, "gwei"); - const priorityFee = gasPrice - baseFee; - if (priorityFee < 0) { throw new Error("negative priority fee; defer to abstract provider default"); } - return priorityFee; - } catch (error) { - console.log("DEBUG", error); - throw error; - } - */ - case "getBalance": - // Returns base-10 result - return this.fetch("account", { - action: "balance", - address: req.address, - tag: req.blockTag - }); - case "getTransactionCount": - return this.fetch("proxy", { - action: "eth_getTransactionCount", - address: req.address, - tag: req.blockTag - }); - case "getCode": - return this.fetch("proxy", { - action: "eth_getCode", - address: req.address, - tag: req.blockTag - }); - case "getStorage": - return this.fetch("proxy", { - action: "eth_getStorageAt", - address: req.address, - position: req.position, - tag: req.blockTag - }); - case "broadcastTransaction": - return this.fetch("proxy", { - action: "eth_sendRawTransaction", - hex: req.signedTransaction - }, true).catch((error) => { - return this._checkError(req, error, req.signedTransaction); - }); - case "getBlock": - if ("blockTag" in req) { - return this.fetch("proxy", { - action: "eth_getBlockByNumber", - tag: req.blockTag, - boolean: (req.includeTransactions ? "true" : "false") - }); - } - (0, index_js_4.assert)(false, "getBlock by blockHash not supported by Etherscan", "UNSUPPORTED_OPERATION", { - operation: "getBlock(blockHash)" - }); - case "getTransaction": - return this.fetch("proxy", { - action: "eth_getTransactionByHash", - txhash: req.hash - }); - case "getTransactionReceipt": - return this.fetch("proxy", { - action: "eth_getTransactionReceipt", - txhash: req.hash - }); - case "call": { - if (req.blockTag !== "latest") { - throw new Error("EtherscanProvider does not support blockTag for call"); - } - const postData = this._getTransactionPostData(req.transaction); - postData.module = "proxy"; - postData.action = "eth_call"; - try { - return await this.fetch("proxy", postData, true); - } - catch (error) { - return this._checkError(req, error, req.transaction); - } - } - case "estimateGas": { - const postData = this._getTransactionPostData(req.transaction); - postData.module = "proxy"; - postData.action = "eth_estimateGas"; - try { - return await this.fetch("proxy", postData, true); - } - catch (error) { - return this._checkError(req, error, req.transaction); - } - } - /* - case "getLogs": { - // Needs to complain if more than one address is passed in - const args: Record = { action: "getLogs" } - - if (params.filter.fromBlock) { - args.fromBlock = checkLogTag(params.filter.fromBlock); - } - - if (params.filter.toBlock) { - args.toBlock = checkLogTag(params.filter.toBlock); - } - - if (params.filter.address) { - args.address = params.filter.address; - } - - // @TODO: We can handle slightly more complicated logs using the logs API - if (params.filter.topics && params.filter.topics.length > 0) { - if (params.filter.topics.length > 1) { - logger.throwError("unsupported topic count", Logger.Errors.UNSUPPORTED_OPERATION, { topics: params.filter.topics }); - } - if (params.filter.topics.length === 1) { - const topic0 = params.filter.topics[0]; - if (typeof(topic0) !== "string" || topic0.length !== 66) { - logger.throwError("unsupported topic format", Logger.Errors.UNSUPPORTED_OPERATION, { topic0: topic0 }); - } - args.topic0 = topic0; - } - } - - const logs: Array = await this.fetch("logs", args); - - // Cache txHash => blockHash - let blocks: { [tag: string]: string } = {}; - - // Add any missing blockHash to the logs - for (let i = 0; i < logs.length; i++) { - const log = logs[i]; - if (log.blockHash != null) { continue; } - if (blocks[log.blockNumber] == null) { - const block = await this.getBlock(log.blockNumber); - if (block) { - blocks[log.blockNumber] = block.hash; - } - } - - log.blockHash = blocks[log.blockNumber]; - } - - return logs; - } - */ - default: - break; - } - return super._perform(req); - } - async getNetwork() { - return this.network; - } - /** - * Resolves to the current price of ether. - * - * This returns ``0`` on any network other than ``mainnet``. - */ - async getEtherPrice() { - if (this.network.name !== "mainnet") { - return 0.0; - } - return parseFloat((await this.fetch("stats", { action: "ethprice" })).ethusd); - } - /** - * Resolves to a [Contract]] for %%address%%, using the - * Etherscan API to retreive the Contract ABI. - */ - async getContract(_address) { - let address = this._getAddress(_address); - if (isPromise(address)) { - address = await address; - } - try { - const resp = await this.fetch("contract", { - action: "getabi", address - }); - const abi = JSON.parse(resp); - return new index_js_2.Contract(address, abi, this); - } - catch (error) { - return null; - } - } - isCommunityResource() { - return (this.apiKey == null); - } -} -exports.EtherscanProvider = EtherscanProvider; -//# sourceMappingURL=provider-etherscan.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-etherscan.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-etherscan.js.map deleted file mode 100644 index b5c031ed..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-etherscan.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-etherscan.js","sourceRoot":"","sources":["../../src.ts/providers/provider-etherscan.ts"],"names":[],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ED,KAAK,CAAC,UAAU;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,aAAa;QACf,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,KAAK,SAAS,EAAE;YAAE,OAAO,GAAG,CAAC;SAAE;QACpD,OAAO,UAAU,CAAC,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAClF,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,WAAW,CAAC,QAAgB;QAC9B,IAAI,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QACzC,IAAI,SAAS,CAAC,OAAO,CAAC,EAAE;YAAE,OAAO,GAAG,MAAM,OAAO,CAAC;SAAE;QAEpD,IAAI;YACA,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE;gBAC1C,MAAM,EAAE,QAAQ,EAAE,OAAO;aAAE,CAAC,CAAC;YAC7B,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC7B,OAAO,IAAI,mBAAQ,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;SAC3C;QAAC,OAAO,KAAK,EAAE;YACZ,OAAO,IAAI,CAAC;SACf;IACL,CAAC;IAED,mBAAmB;QACf,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC;IACjC,CAAC;CACJ;AA7iBD,8CA6iBC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-fallback.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-fallback.d.ts deleted file mode 100644 index 39d79352..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-fallback.d.ts +++ /dev/null @@ -1,115 +0,0 @@ -import { AbstractProvider } from "./abstract-provider.js"; -import { Network } from "./network.js"; -import type { PerformActionRequest } from "./abstract-provider.js"; -import type { Networkish } from "./network.js"; -/** - * A configuration entry for how to use a [[Provider]]. - */ -export interface FallbackProviderConfig { - /** - * The provider. - */ - provider: AbstractProvider; - /** - * The amount of time to wait before kicking off the next provider. - * - * Any providers that have not responded can still respond and be - * counted, but this ensures new providers start. - */ - stallTimeout?: number; - /** - * The priority. Lower priority providers are dispatched first. - */ - priority?: number; - /** - * The amount of weight a provider is given against the quorum. - */ - weight?: number; -} -/** - * The statistics and state maintained for a [[Provider]]. - */ -export interface FallbackProviderState extends Required { - /** - * The most recent blockNumber this provider has reported (-2 if none). - */ - blockNumber: number; - /** - * The number of total requests ever sent to this provider. - */ - requests: number; - /** - * The number of responses that errored. - */ - errorResponses: number; - /** - * The number of responses that occured after the result resolved. - */ - lateResponses: number; - /** - * How many times syncing was required to catch up the expected block. - */ - outOfSync: number; - /** - * The number of requests which reported unsupported operation. - */ - unsupportedEvents: number; - /** - * A rolling average (5% current duration) for response time. - */ - rollingDuration: number; - /** - * The ratio of quorum-agreed results to total. - */ - score: number; -} -/** - * Additional options to configure a [[FallbackProvider]]. - */ -export type FallbackProviderOptions = { - quorum?: number; - eventQuorum?: number; - eventWorkers?: number; - cacheTimeout?: number; - pollingInterval?: number; -}; -/** - * A **FallbackProvider** manages several [[Providers]] providing - * resilience by switching between slow or misbehaving nodes, security - * by requiring multiple backends to aggree and performance by allowing - * faster backends to respond earlier. - * - */ -export declare class FallbackProvider extends AbstractProvider { - #private; - /** - * The number of backends that must agree on a value before it is - * accpeted. - */ - readonly quorum: number; - /** - * @_ignore: - */ - readonly eventQuorum: number; - /** - * @_ignore: - */ - readonly eventWorkers: number; - /** - * Creates a new **FallbackProvider** with %%providers%% connected to - * %%network%%. - * - * If a [[Provider]] is included in %%providers%%, defaults are used - * for the configuration. - */ - constructor(providers: Array, network?: Networkish, options?: FallbackProviderOptions); - get providerConfigs(): Array; - _detectNetwork(): Promise; - /** - * Transforms a %%req%% into the correct method call on %%provider%%. - */ - _translatePerform(provider: AbstractProvider, req: PerformActionRequest): Promise; - _perform(req: PerformActionRequest): Promise; - destroy(): Promise; -} -//# sourceMappingURL=provider-fallback.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-fallback.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-fallback.d.ts.map deleted file mode 100644 index 8aa88fa2..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-fallback.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-fallback.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-fallback.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AA6B9C;;GAEG;AACH,MAAM,WAAW,sBAAsB;IAEnC;;OAEG;IACH,QAAQ,EAAE,gBAAgB,CAAC;IAE3B;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAMD;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,QAAQ,CAAC,sBAAsB,CAAC;IAE3E;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACjB;AAyCD;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IAGlC,MAAM,CAAC,EAAE,MAAM,CAAC;IAIhB,WAAW,CAAC,EAAE,MAAM,CAAC;IAKrB,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAiLF;;;;;;GAMG;AACH,qBAAa,gBAAiB,SAAQ,gBAAgB;;IAElD;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAO9B;;;;;;OAMG;gBACS,SAAS,EAAE,KAAK,CAAC,gBAAgB,GAAG,sBAAsB,CAAC,EAAE,OAAO,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,uBAAuB;IA8BhI,IAAI,eAAe,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAQlD;IAEK,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;IASxC;;OAEG;IACG,iBAAiB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC;IA6QtF,QAAQ,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,CAAC,CAAC;IA8ExD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAMjC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-fallback.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-fallback.js deleted file mode 100644 index a6c6da86..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-fallback.js +++ /dev/null @@ -1,624 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FallbackProvider = void 0; -/** - * A **FallbackProvider** provides resilience, security and performance - * in a way that is customizable and configurable. - * - * @_section: api/providers/fallback-provider:Fallback Provider [about-fallback-provider] - */ -const index_js_1 = require("../utils/index.js"); -const abstract_provider_js_1 = require("./abstract-provider.js"); -const network_js_1 = require("./network.js"); -const BN_1 = BigInt("1"); -const BN_2 = BigInt("2"); -function shuffle(array) { - for (let i = array.length - 1; i > 0; i--) { - const j = Math.floor(Math.random() * (i + 1)); - const tmp = array[i]; - array[i] = array[j]; - array[j] = tmp; - } -} -function stall(duration) { - return new Promise((resolve) => { setTimeout(resolve, duration); }); -} -function getTime() { return (new Date()).getTime(); } -function stringify(value) { - return JSON.stringify(value, (key, value) => { - if (typeof (value) === "bigint") { - return { type: "bigint", value: value.toString() }; - } - return value; - }); -} -; -const defaultConfig = { stallTimeout: 400, priority: 1, weight: 1 }; -const defaultState = { - blockNumber: -2, requests: 0, lateResponses: 0, errorResponses: 0, - outOfSync: -1, unsupportedEvents: 0, rollingDuration: 0, score: 0, - _network: null, _updateNumber: null, _totalTime: 0, - _lastFatalError: null, _lastFatalErrorTimestamp: 0 -}; -async function waitForSync(config, blockNumber) { - while (config.blockNumber < 0 || config.blockNumber < blockNumber) { - if (!config._updateNumber) { - config._updateNumber = (async () => { - try { - const blockNumber = await config.provider.getBlockNumber(); - if (blockNumber > config.blockNumber) { - config.blockNumber = blockNumber; - } - } - catch (error) { - config.blockNumber = -2; - config._lastFatalError = error; - config._lastFatalErrorTimestamp = getTime(); - } - config._updateNumber = null; - })(); - } - await config._updateNumber; - config.outOfSync++; - if (config._lastFatalError) { - break; - } - } -} -function _normalize(value) { - if (value == null) { - return "null"; - } - if (Array.isArray(value)) { - return "[" + (value.map(_normalize)).join(",") + "]"; - } - if (typeof (value) === "object" && typeof (value.toJSON) === "function") { - return _normalize(value.toJSON()); - } - switch (typeof (value)) { - case "boolean": - case "symbol": - return value.toString(); - case "bigint": - case "number": - return BigInt(value).toString(); - case "string": - return JSON.stringify(value); - case "object": { - const keys = Object.keys(value); - keys.sort(); - return "{" + keys.map((k) => `${JSON.stringify(k)}:${_normalize(value[k])}`).join(",") + "}"; - } - } - console.log("Could not serialize", value); - throw new Error("Hmm..."); -} -function normalizeResult(method, value) { - if ("error" in value) { - const error = value.error; - let tag; - if ((0, index_js_1.isError)(error, "CALL_EXCEPTION")) { - tag = _normalize(Object.assign({}, error, { - shortMessage: undefined, reason: undefined, info: undefined - })); - } - else { - tag = _normalize(error); - } - return { tag, value: error }; - } - const result = value.result; - return { tag: _normalize(result), value: result }; -} -// This strategy picks the highest weight result, as long as the weight is -// equal to or greater than quorum -function checkQuorum(quorum, results) { - const tally = new Map(); - for (const { value, tag, weight } of results) { - const t = tally.get(tag) || { value, weight: 0 }; - t.weight += weight; - tally.set(tag, t); - } - let best = null; - for (const r of tally.values()) { - if (r.weight >= quorum && (!best || r.weight > best.weight)) { - best = r; - } - } - if (best) { - return best.value; - } - return undefined; -} -function getMedian(quorum, results) { - let resultWeight = 0; - const errorMap = new Map(); - let bestError = null; - const values = []; - for (const { value, tag, weight } of results) { - if (value instanceof Error) { - const e = errorMap.get(tag) || { value, weight: 0 }; - e.weight += weight; - errorMap.set(tag, e); - if (bestError == null || e.weight > bestError.weight) { - bestError = e; - } - } - else { - values.push(BigInt(value)); - resultWeight += weight; - } - } - if (resultWeight < quorum) { - // We have quorum for an error - if (bestError && bestError.weight >= quorum) { - return bestError.value; - } - // We do not have quorum for a result - return undefined; - } - // Get the sorted values - values.sort((a, b) => ((a < b) ? -1 : (b > a) ? 1 : 0)); - const mid = Math.floor(values.length / 2); - // Odd-length; take the middle value - if (values.length % 2) { - return values[mid]; - } - // Even length; take the ceiling of the mean of the center two values - return (values[mid - 1] + values[mid] + BN_1) / BN_2; -} -function getAnyResult(quorum, results) { - // If any value or error meets quorum, that is our preferred result - const result = checkQuorum(quorum, results); - if (result !== undefined) { - return result; - } - // Otherwise, do we have any result? - for (const r of results) { - if (r.value) { - return r.value; - } - } - // Nope! - return undefined; -} -function getFuzzyMode(quorum, results) { - if (quorum === 1) { - return (0, index_js_1.getNumber)(getMedian(quorum, results), "%internal"); - } - const tally = new Map(); - const add = (result, weight) => { - const t = tally.get(result) || { result, weight: 0 }; - t.weight += weight; - tally.set(result, t); - }; - for (const { weight, value } of results) { - const r = (0, index_js_1.getNumber)(value); - add(r - 1, weight); - add(r, weight); - add(r + 1, weight); - } - let bestWeight = 0; - let bestResult = undefined; - for (const { weight, result } of tally.values()) { - // Use this result, if this result meets quorum and has either: - // - a better weight - // - or equal weight, but the result is larger - if (weight >= quorum && (weight > bestWeight || (bestResult != null && weight === bestWeight && result > bestResult))) { - bestWeight = weight; - bestResult = result; - } - } - return bestResult; -} -/** - * A **FallbackProvider** manages several [[Providers]] providing - * resilience by switching between slow or misbehaving nodes, security - * by requiring multiple backends to aggree and performance by allowing - * faster backends to respond earlier. - * - */ -class FallbackProvider extends abstract_provider_js_1.AbstractProvider { - /** - * The number of backends that must agree on a value before it is - * accpeted. - */ - quorum; - /** - * @_ignore: - */ - eventQuorum; - /** - * @_ignore: - */ - eventWorkers; - #configs; - #height; - #initialSyncPromise; - /** - * Creates a new **FallbackProvider** with %%providers%% connected to - * %%network%%. - * - * If a [[Provider]] is included in %%providers%%, defaults are used - * for the configuration. - */ - constructor(providers, network, options) { - super(network, options); - this.#configs = providers.map((p) => { - if (p instanceof abstract_provider_js_1.AbstractProvider) { - return Object.assign({ provider: p }, defaultConfig, defaultState); - } - else { - return Object.assign({}, defaultConfig, p, defaultState); - } - }); - this.#height = -2; - this.#initialSyncPromise = null; - if (options && options.quorum != null) { - this.quorum = options.quorum; - } - else { - this.quorum = Math.ceil(this.#configs.reduce((accum, config) => { - accum += config.weight; - return accum; - }, 0) / 2); - } - this.eventQuorum = 1; - this.eventWorkers = 1; - (0, index_js_1.assertArgument)(this.quorum <= this.#configs.reduce((a, c) => (a + c.weight), 0), "quorum exceed provider weight", "quorum", this.quorum); - } - get providerConfigs() { - return this.#configs.map((c) => { - const result = Object.assign({}, c); - for (const key in result) { - if (key[0] === "_") { - delete result[key]; - } - } - return result; - }); - } - async _detectNetwork() { - return network_js_1.Network.from((0, index_js_1.getBigInt)(await this._perform({ method: "chainId" }))); - } - // @TODO: Add support to select providers to be the event subscriber - //_getSubscriber(sub: Subscription): Subscriber { - // throw new Error("@TODO"); - //} - /** - * Transforms a %%req%% into the correct method call on %%provider%%. - */ - async _translatePerform(provider, req) { - switch (req.method) { - case "broadcastTransaction": - return await provider.broadcastTransaction(req.signedTransaction); - case "call": - return await provider.call(Object.assign({}, req.transaction, { blockTag: req.blockTag })); - case "chainId": - return (await provider.getNetwork()).chainId; - case "estimateGas": - return await provider.estimateGas(req.transaction); - case "getBalance": - return await provider.getBalance(req.address, req.blockTag); - case "getBlock": { - const block = ("blockHash" in req) ? req.blockHash : req.blockTag; - return await provider.getBlock(block, req.includeTransactions); - } - case "getBlockNumber": - return await provider.getBlockNumber(); - case "getCode": - return await provider.getCode(req.address, req.blockTag); - case "getGasPrice": - return (await provider.getFeeData()).gasPrice; - case "getPriorityFee": - return (await provider.getFeeData()).maxPriorityFeePerGas; - case "getLogs": - return await provider.getLogs(req.filter); - case "getStorage": - return await provider.getStorage(req.address, req.position, req.blockTag); - case "getTransaction": - return await provider.getTransaction(req.hash); - case "getTransactionCount": - return await provider.getTransactionCount(req.address, req.blockTag); - case "getTransactionReceipt": - return await provider.getTransactionReceipt(req.hash); - case "getTransactionResult": - return await provider.getTransactionResult(req.hash); - } - } - // Grab the next (random) config that is not already part of - // the running set - #getNextConfig(running) { - // @TODO: Maybe do a check here to favour (heavily) providers that - // do not require waitForSync and disfavour providers that - // seem down-ish or are behaving slowly - const configs = Array.from(running).map((r) => r.config); - // Shuffle the states, sorted by priority - const allConfigs = this.#configs.slice(); - shuffle(allConfigs); - allConfigs.sort((a, b) => (a.priority - b.priority)); - for (const config of allConfigs) { - if (config._lastFatalError) { - continue; - } - if (configs.indexOf(config) === -1) { - return config; - } - } - return null; - } - // Adds a new runner (if available) to running. - #addRunner(running, req) { - const config = this.#getNextConfig(running); - // No runners available - if (config == null) { - return null; - } - // Create a new runner - const runner = { - config, result: null, didBump: false, - perform: null, staller: null - }; - const now = getTime(); - // Start performing this operation - runner.perform = (async () => { - try { - config.requests++; - const result = await this._translatePerform(config.provider, req); - runner.result = { result }; - } - catch (error) { - config.errorResponses++; - runner.result = { error }; - } - const dt = (getTime() - now); - config._totalTime += dt; - config.rollingDuration = 0.95 * config.rollingDuration + 0.05 * dt; - runner.perform = null; - })(); - // Start a staller; when this times out, it's time to force - // kicking off another runner because we are taking too long - runner.staller = (async () => { - await stall(config.stallTimeout); - runner.staller = null; - })(); - running.add(runner); - return runner; - } - // Initializes the blockNumber and network for each runner and - // blocks until initialized - async #initialSync() { - let initialSync = this.#initialSyncPromise; - if (!initialSync) { - const promises = []; - this.#configs.forEach((config) => { - promises.push((async () => { - await waitForSync(config, 0); - if (!config._lastFatalError) { - config._network = await config.provider.getNetwork(); - } - })()); - }); - this.#initialSyncPromise = initialSync = (async () => { - // Wait for all providers to have a block number and network - await Promise.all(promises); - // Check all the networks match - let chainId = null; - for (const config of this.#configs) { - if (config._lastFatalError) { - continue; - } - const network = (config._network); - if (chainId == null) { - chainId = network.chainId; - } - else if (network.chainId !== chainId) { - (0, index_js_1.assert)(false, "cannot mix providers on different networks", "UNSUPPORTED_OPERATION", { - operation: "new FallbackProvider" - }); - } - } - })(); - } - await initialSync; - } - async #checkQuorum(running, req) { - // Get all the result objects - const results = []; - for (const runner of running) { - if (runner.result != null) { - const { tag, value } = normalizeResult(req.method, runner.result); - results.push({ tag, value, weight: runner.config.weight }); - } - } - // Are there enough results to event meet quorum? - if (results.reduce((a, r) => (a + r.weight), 0) < this.quorum) { - return undefined; - } - switch (req.method) { - case "getBlockNumber": { - // We need to get the bootstrap block height - if (this.#height === -2) { - this.#height = Math.ceil((0, index_js_1.getNumber)(getMedian(this.quorum, this.#configs.filter((c) => (!c._lastFatalError)).map((c) => ({ - value: c.blockNumber, - tag: (0, index_js_1.getNumber)(c.blockNumber).toString(), - weight: c.weight - }))))); - } - // Find the mode across all the providers, allowing for - // a little drift between block heights - const mode = getFuzzyMode(this.quorum, results); - if (mode === undefined) { - return undefined; - } - if (mode > this.#height) { - this.#height = mode; - } - return this.#height; - } - case "getGasPrice": - case "getPriorityFee": - case "estimateGas": - return getMedian(this.quorum, results); - case "getBlock": - // Pending blocks are in the mempool and already - // quite untrustworthy; just grab anything - if ("blockTag" in req && req.blockTag === "pending") { - return getAnyResult(this.quorum, results); - } - return checkQuorum(this.quorum, results); - case "call": - case "chainId": - case "getBalance": - case "getTransactionCount": - case "getCode": - case "getStorage": - case "getTransaction": - case "getTransactionReceipt": - case "getLogs": - return checkQuorum(this.quorum, results); - case "broadcastTransaction": - return getAnyResult(this.quorum, results); - } - (0, index_js_1.assert)(false, "unsupported method", "UNSUPPORTED_OPERATION", { - operation: `_perform(${stringify(req.method)})` - }); - } - async #waitForQuorum(running, req) { - if (running.size === 0) { - throw new Error("no runners?!"); - } - // Any promises that are interesting to watch for; an expired stall - // or a successful perform - const interesting = []; - let newRunners = 0; - for (const runner of running) { - // No responses, yet; keep an eye on it - if (runner.perform) { - interesting.push(runner.perform); - } - // Still stalling... - if (runner.staller) { - interesting.push(runner.staller); - continue; - } - // This runner has already triggered another runner - if (runner.didBump) { - continue; - } - // Got a response (result or error) or stalled; kick off another runner - runner.didBump = true; - newRunners++; - } - // Check if we have reached quorum on a result (or error) - const value = await this.#checkQuorum(running, req); - if (value !== undefined) { - if (value instanceof Error) { - throw value; - } - return value; - } - // Add any new runners, because a staller timed out or a result - // or error response came in. - for (let i = 0; i < newRunners; i++) { - this.#addRunner(running, req); - } - // All providers have returned, and we have no result - (0, index_js_1.assert)(interesting.length > 0, "quorum not met", "SERVER_ERROR", { - request: "%sub-requests", - info: { request: req, results: Array.from(running).map((r) => stringify(r.result)) } - }); - // Wait for someone to either complete its perform or stall out - await Promise.race(interesting); - // This is recursive, but at worst case the depth is 2x the - // number of providers (each has a perform and a staller) - return await this.#waitForQuorum(running, req); - } - async _perform(req) { - // Broadcasting a transaction is rare (ish) and already incurs - // a cost on the user, so spamming is safe-ish. Just send it to - // every backend. - if (req.method === "broadcastTransaction") { - // Once any broadcast provides a positive result, use it. No - // need to wait for anyone else - const results = this.#configs.map((c) => null); - const broadcasts = this.#configs.map(async ({ provider, weight }, index) => { - try { - const result = await provider._perform(req); - results[index] = Object.assign(normalizeResult(req.method, { result }), { weight }); - } - catch (error) { - results[index] = Object.assign(normalizeResult(req.method, { error }), { weight }); - } - }); - // As each promise finishes... - while (true) { - // Check for a valid broadcast result - const done = results.filter((r) => (r != null)); - for (const { value } of done) { - if (!(value instanceof Error)) { - return value; - } - } - // Check for a legit broadcast error (one which we cannot - // recover from; some nodes may return the following red - // herring events: - // - alredy seend (UNKNOWN_ERROR) - // - NONCE_EXPIRED - // - REPLACEMENT_UNDERPRICED - const result = checkQuorum(this.quorum, results.filter((r) => (r != null))); - if ((0, index_js_1.isError)(result, "INSUFFICIENT_FUNDS")) { - throw result; - } - // Kick off the next provider (if any) - const waiting = broadcasts.filter((b, i) => (results[i] == null)); - if (waiting.length === 0) { - break; - } - await Promise.race(waiting); - } - // Use standard quorum results; any result was returned above, - // so this will find any error that met quorum if any - const result = getAnyResult(this.quorum, results); - (0, index_js_1.assert)(result !== undefined, "problem multi-broadcasting", "SERVER_ERROR", { - request: "%sub-requests", - info: { request: req, results: results.map(stringify) } - }); - if (result instanceof Error) { - throw result; - } - return result; - } - await this.#initialSync(); - // Bootstrap enough runners to meet quorum - const running = new Set(); - let inflightQuorum = 0; - while (true) { - const runner = this.#addRunner(running, req); - if (runner == null) { - break; - } - inflightQuorum += runner.config.weight; - if (inflightQuorum >= this.quorum) { - break; - } - } - const result = await this.#waitForQuorum(running, req); - // Track requests sent to a provider that are still - // outstanding after quorum has been otherwise found - for (const runner of running) { - if (runner.perform && runner.result == null) { - runner.config.lateResponses++; - } - } - return result; - } - async destroy() { - for (const { provider } of this.#configs) { - provider.destroy(); - } - super.destroy(); - } -} -exports.FallbackProvider = FallbackProvider; -//# sourceMappingURL=provider-fallback.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-fallback.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-fallback.js.map deleted file mode 100644 index a2ea29b4..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-fallback.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-fallback.js","sourceRoot":"","sources":["../../src.ts/providers/provider-fallback.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,gDAE2B;AAE3B,iEAA0D;AAC1D,6CAAsC;AAKtC,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AACzB,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AAEzB,SAAS,OAAO,CAAU,KAAe;IACrC,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;QACvC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC9C,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACrB,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACpB,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;KAClB;AACL,CAAC;AAED,SAAS,KAAK,CAAC,QAAgB;IAC3B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,E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,IAAI,IAAI,CAAC,MAAM,EAAE;gBAAE,MAAM;aAAE;SAChD;QAED,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAEvD,mDAAmD;QACnD,oDAAoD;QACpD,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;YAC1B,IAAI,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,MAAM,IAAI,IAAI,EAAE;gBACzC,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC;aACjC;SACJ;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,OAAO;QACT,KAAK,MAAM,EAAE,QAAQ,EAAE,IAAI,IAAI,CAAC,QAAQ,EAAE;YACtC,QAAQ,CAAC,OAAO,EAAE,CAAC;SACtB;QACD,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;CACJ;AAnbD,4CAmbC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-infura.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-infura.d.ts deleted file mode 100644 index 6ee73ec1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-infura.d.ts +++ /dev/null @@ -1,101 +0,0 @@ -/** - * [[link-infura]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Arbitrum Sepolia Testnet (``arbitrum-sepolia``) - * - Base (``base``) - * - Base Goerlia Testnet (``base-goerli``) - * - Base Sepolia Testnet (``base-sepolia``) - * - BNB Smart Chain Mainnet (``bnb``) - * - BNB Smart Chain Testnet (``bnbt``) - * - Linea (``linea``) - * - Linea Goerli Testnet (``linea-goerli``) - * - Linea Sepolia Testnet (``linea-sepolia``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Optimism Sepolia Testnet (``optimism-sepolia``) - * - Polygon (``matic``) - * - Polygon Amoy Testnet (``matic-amoy``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:INFURA [providers-infura] - */ -import { FetchRequest } from "../utils/index.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import { WebSocketProvider } from "./provider-websocket.js"; -import type { AbstractProvider } from "./abstract-provider.js"; -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; -/** - * The **InfuraWebSocketProvider** connects to the [[link-infura]] - * WebSocket end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-infura-signup). - */ -export declare class InfuraWebSocketProvider extends WebSocketProvider implements CommunityResourcable { - /** - * The Project ID for the INFURA connection. - */ - readonly projectId: string; - /** - * The Project Secret. - * - * If null, no authenticated requests are made. This should not - * be used outside of private contexts. - */ - readonly projectSecret: null | string; - /** - * Creates a new **InfuraWebSocketProvider**. - */ - constructor(network?: Networkish, projectId?: string); - isCommunityResource(): boolean; -} -/** - * The **InfuraProvider** connects to the [[link-infura]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-infura-signup). - */ -export declare class InfuraProvider extends JsonRpcProvider implements CommunityResourcable { - /** - * The Project ID for the INFURA connection. - */ - readonly projectId: string; - /** - * The Project Secret. - * - * If null, no authenticated requests are made. This should not - * be used outside of private contexts. - */ - readonly projectSecret: null | string; - /** - * Creates a new **InfuraProvider**. - */ - constructor(_network?: Networkish, projectId?: null | string, projectSecret?: null | string); - _getProvider(chainId: number): AbstractProvider; - isCommunityResource(): boolean; - /** - * Creates a new **InfuraWebSocketProvider**. - */ - static getWebSocketProvider(network?: Networkish, projectId?: string): InfuraWebSocketProvider; - /** - * Returns a prepared request for connecting to %%network%% - * with %%projectId%% and %%projectSecret%%. - */ - static getRequest(network: Network, projectId?: null | string, projectSecret?: null | string): FetchRequest; -} -//# sourceMappingURL=provider-infura.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-infura.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-infura.d.ts.map deleted file mode 100644 index 69016b16..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-infura.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-infura.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-infura.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,EACe,YAAY,EACjC,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAsD/C;;;;;;;;GAQG;AACH,qBAAa,uBAAwB,SAAQ,iBAAkB,YAAW,oBAAoB;IAE1F;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAG,MAAM,CAAC;IAE5B;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAG,IAAI,GAAG,MAAM,CAAC;IAEvC;;OAEG;gBACS,OAAO,CAAC,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,MAAM;IAgBpD,mBAAmB,IAAI,OAAO;CAGjC;AAED;;;;;;;;GAQG;AACH,qBAAa,cAAe,SAAQ,eAAgB,YAAW,oBAAoB;IAC/E;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAG,MAAM,CAAC;IAE5B;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAG,IAAI,GAAG,MAAM,CAAC;IAEvC;;OAEG;gBACS,QAAQ,CAAC,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,EAAE,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM;IAY3F,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB;IAO/C,mBAAmB,IAAI,OAAO;IAI9B;;OAEG;IACH,MAAM,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,uBAAuB;IAI9F;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,EAAE,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY;CAiB9G"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-infura.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-infura.js deleted file mode 100644 index 959b5c10..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-infura.js +++ /dev/null @@ -1,206 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.InfuraProvider = exports.InfuraWebSocketProvider = void 0; -/** - * [[link-infura]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Arbitrum Sepolia Testnet (``arbitrum-sepolia``) - * - Base (``base``) - * - Base Goerlia Testnet (``base-goerli``) - * - Base Sepolia Testnet (``base-sepolia``) - * - BNB Smart Chain Mainnet (``bnb``) - * - BNB Smart Chain Testnet (``bnbt``) - * - Linea (``linea``) - * - Linea Goerli Testnet (``linea-goerli``) - * - Linea Sepolia Testnet (``linea-sepolia``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Optimism Sepolia Testnet (``optimism-sepolia``) - * - Polygon (``matic``) - * - Polygon Amoy Testnet (``matic-amoy``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:INFURA [providers-infura] - */ -const index_js_1 = require("../utils/index.js"); -const community_js_1 = require("./community.js"); -const network_js_1 = require("./network.js"); -const provider_jsonrpc_js_1 = require("./provider-jsonrpc.js"); -const provider_websocket_js_1 = require("./provider-websocket.js"); -const defaultProjectId = "84842078b09946638c03157f83405213"; -function getHost(name) { - switch (name) { - case "mainnet": - return "mainnet.infura.io"; - case "goerli": - return "goerli.infura.io"; - case "sepolia": - return "sepolia.infura.io"; - case "arbitrum": - return "arbitrum-mainnet.infura.io"; - case "arbitrum-goerli": - return "arbitrum-goerli.infura.io"; - case "arbitrum-sepolia": - return "arbitrum-sepolia.infura.io"; - case "base": - return "base-mainnet.infura.io"; - case "base-goerlia": // @TODO: Remove this typo in the future! - case "base-goerli": - return "base-goerli.infura.io"; - case "base-sepolia": - return "base-sepolia.infura.io"; - case "bnb": - return "bsc-mainnet.infura.io"; - case "bnbt": - return "bsc-testnet.infura.io"; - case "linea": - return "linea-mainnet.infura.io"; - case "linea-goerli": - return "linea-goerli.infura.io"; - case "linea-sepolia": - return "linea-sepolia.infura.io"; - case "matic": - return "polygon-mainnet.infura.io"; - case "matic-amoy": - return "polygon-amoy.infura.io"; - case "matic-mumbai": - return "polygon-mumbai.infura.io"; - case "optimism": - return "optimism-mainnet.infura.io"; - case "optimism-goerli": - return "optimism-goerli.infura.io"; - case "optimism-sepolia": - return "optimism-sepolia.infura.io"; - } - (0, index_js_1.assertArgument)(false, "unsupported network", "network", name); -} -/** - * The **InfuraWebSocketProvider** connects to the [[link-infura]] - * WebSocket end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-infura-signup). - */ -class InfuraWebSocketProvider extends provider_websocket_js_1.WebSocketProvider { - /** - * The Project ID for the INFURA connection. - */ - projectId; - /** - * The Project Secret. - * - * If null, no authenticated requests are made. This should not - * be used outside of private contexts. - */ - projectSecret; - /** - * Creates a new **InfuraWebSocketProvider**. - */ - constructor(network, projectId) { - const provider = new InfuraProvider(network, projectId); - const req = provider._getConnection(); - (0, index_js_1.assert)(!req.credentials, "INFURA WebSocket project secrets unsupported", "UNSUPPORTED_OPERATION", { operation: "InfuraProvider.getWebSocketProvider()" }); - const url = req.url.replace(/^http/i, "ws").replace("/v3/", "/ws/v3/"); - super(url, provider._network); - (0, index_js_1.defineProperties)(this, { - projectId: provider.projectId, - projectSecret: provider.projectSecret - }); - } - isCommunityResource() { - return (this.projectId === defaultProjectId); - } -} -exports.InfuraWebSocketProvider = InfuraWebSocketProvider; -/** - * The **InfuraProvider** connects to the [[link-infura]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-infura-signup). - */ -class InfuraProvider extends provider_jsonrpc_js_1.JsonRpcProvider { - /** - * The Project ID for the INFURA connection. - */ - projectId; - /** - * The Project Secret. - * - * If null, no authenticated requests are made. This should not - * be used outside of private contexts. - */ - projectSecret; - /** - * Creates a new **InfuraProvider**. - */ - constructor(_network, projectId, projectSecret) { - if (_network == null) { - _network = "mainnet"; - } - const network = network_js_1.Network.from(_network); - if (projectId == null) { - projectId = defaultProjectId; - } - if (projectSecret == null) { - projectSecret = null; - } - const request = InfuraProvider.getRequest(network, projectId, projectSecret); - super(request, network, { staticNetwork: network }); - (0, index_js_1.defineProperties)(this, { projectId, projectSecret }); - } - _getProvider(chainId) { - try { - return new InfuraProvider(chainId, this.projectId, this.projectSecret); - } - catch (error) { } - return super._getProvider(chainId); - } - isCommunityResource() { - return (this.projectId === defaultProjectId); - } - /** - * Creates a new **InfuraWebSocketProvider**. - */ - static getWebSocketProvider(network, projectId) { - return new InfuraWebSocketProvider(network, projectId); - } - /** - * Returns a prepared request for connecting to %%network%% - * with %%projectId%% and %%projectSecret%%. - */ - static getRequest(network, projectId, projectSecret) { - if (projectId == null) { - projectId = defaultProjectId; - } - if (projectSecret == null) { - projectSecret = null; - } - const request = new index_js_1.FetchRequest(`https:/\/${getHost(network.name)}/v3/${projectId}`); - request.allowGzip = true; - if (projectSecret) { - request.setCredentials("", projectSecret); - } - if (projectId === defaultProjectId) { - request.retryFunc = async (request, response, attempt) => { - (0, community_js_1.showThrottleMessage)("InfuraProvider"); - return true; - }; - } - return request; - } -} -exports.InfuraProvider = InfuraProvider; -//# sourceMappingURL=provider-infura.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-infura.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-infura.js.map deleted file mode 100644 index 93eb08f9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-infura.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-infura.js","sourceRoot":"","sources":["../../src.ts/providers/provider-infura.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,gDAE2B;AAE3B,iDAAqD;AACrD,6CAAuC;AACvC,+DAAwD;AACxD,mEAA4D;AAO5D,MAAM,gBAAgB,GAAG,kCAAkC,CAAC;AAE5D,SAAS,OAAO,CAAC,IAAY;IACzB,QAAO,IAAI,EAAE;QACT,KAAK,SAAS;YACV,OAAO,mBAAmB,CAAC;QAC/B,KAAK,QAAQ;YACT,OAAO,kBAAkB,CAAC;QAC9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;SACL;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ;AApED,wCAoEC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ipcsocket-browser.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ipcsocket-browser.d.ts deleted file mode 100644 index 6aae787d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ipcsocket-browser.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const IpcSocketProvider: undefined; -export { IpcSocketProvider }; -//# sourceMappingURL=provider-ipcsocket-browser.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ipcsocket-browser.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ipcsocket-browser.d.ts.map deleted file mode 100644 index e49cd58d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ipcsocket-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-ipcsocket-browser.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-ipcsocket-browser.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,iBAAiB,WAAY,CAAC;AAEpC,OAAO,EAAE,iBAAiB,EAAE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ipcsocket-browser.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ipcsocket-browser.js deleted file mode 100644 index 7a8728ff..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ipcsocket-browser.js +++ /dev/null @@ -1,6 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.IpcSocketProvider = void 0; -const IpcSocketProvider = undefined; -exports.IpcSocketProvider = IpcSocketProvider; -//# sourceMappingURL=provider-ipcsocket-browser.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ipcsocket-browser.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ipcsocket-browser.js.map deleted file mode 100644 index a4527c7a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ipcsocket-browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-ipcsocket-browser.js","sourceRoot":"","sources":["../../src.ts/providers/provider-ipcsocket-browser.ts"],"names":[],"mappings":";;;AAAA,MAAM,iBAAiB,GAAG,SAAS,CAAC;AAE3B,8CAAiB"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ipcsocket.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ipcsocket.d.ts deleted file mode 100644 index 23d1f2f6..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ipcsocket.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/// -import { SocketProvider } from "./provider-socket.js"; -import type { Socket } from "net"; -import type { JsonRpcApiProviderOptions } from "./provider-jsonrpc.js"; -import type { Networkish } from "./network.js"; -/** - * An **IpcSocketProvider** connects over an IPC socket on the host - * which provides fast access to the node, but requires the node and - * the script run on the same machine. - */ -export declare class IpcSocketProvider extends SocketProvider { - #private; - /** - * The connected socket. - */ - get socket(): Socket; - constructor(path: string, network?: Networkish, options?: JsonRpcApiProviderOptions); - destroy(): void; - _write(message: string): Promise; -} -//# sourceMappingURL=provider-ipcsocket.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ipcsocket.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ipcsocket.d.ts.map deleted file mode 100644 index 876e470e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ipcsocket.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-ipcsocket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-ipcsocket.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAElC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAmB/C;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,cAAc;;IAGjD;;OAEG;IACH,IAAI,MAAM,IAAI,MAAM,CAAyB;gBAEjC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,yBAAyB;IA8BnF,OAAO,IAAI,IAAI;IAOT,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAI/C"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ipcsocket.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ipcsocket.js deleted file mode 100644 index a63c8e76..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ipcsocket.js +++ /dev/null @@ -1,72 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.IpcSocketProvider = void 0; -const net_1 = require("net"); -const provider_socket_js_1 = require("./provider-socket.js"); -// @TODO: Is this sufficient? Is this robust? Will newlines occur between -// all payloads and only between payloads? -function splitBuffer(data) { - const messages = []; - let lastStart = 0; - while (true) { - const nl = data.indexOf(10, lastStart); - if (nl === -1) { - break; - } - messages.push(data.subarray(lastStart, nl).toString().trim()); - lastStart = nl + 1; - } - return { messages, remaining: data.subarray(lastStart) }; -} -/** - * An **IpcSocketProvider** connects over an IPC socket on the host - * which provides fast access to the node, but requires the node and - * the script run on the same machine. - */ -class IpcSocketProvider extends provider_socket_js_1.SocketProvider { - #socket; - /** - * The connected socket. - */ - get socket() { return this.#socket; } - constructor(path, network, options) { - super(network, options); - this.#socket = (0, net_1.connect)(path); - this.socket.on("ready", async () => { - try { - await this._start(); - } - catch (error) { - console.log("failed to start IpcSocketProvider", error); - // @TODO: Now what? Restart? - } - }); - let response = Buffer.alloc(0); - this.socket.on("data", (data) => { - response = Buffer.concat([response, data]); - const { messages, remaining } = splitBuffer(response); - messages.forEach((message) => { - this._processMessage(message); - }); - response = remaining; - }); - this.socket.on("end", () => { - this.emit("close"); - this.socket.destroy(); - this.socket.end(); - }); - } - destroy() { - this.socket.destroy(); - this.socket.end(); - super.destroy(); - } - async _write(message) { - if (!message.endsWith("\n")) { - message += "\n"; - } - this.socket.write(message); - } -} -exports.IpcSocketProvider = IpcSocketProvider; -//# sourceMappingURL=provider-ipcsocket.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ipcsocket.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ipcsocket.js.map deleted file mode 100644 index eec8ddcd..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-ipcsocket.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-ipcsocket.js","sourceRoot":"","sources":["../../src.ts/providers/provider-ipcsocket.ts"],"names":[],"mappings":";;;AACA,6BAA8B;AAC9B,6DAAsD;AAQtD,yEAAyE;AACzE,0CAA0C;AAC1C,SAAS,WAAW,CAAC,IAAY;IAC7B,MAAM,QAAQ,GAAkB,EAAG,CAAC;IAEpC,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,OAAO,IAAI,EAAE;QACT,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;QACvC,IAAI,EAAE,KAAK,CAAC,CAAC,EAAE;YAAE,MAAM;SAAE;QACzB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,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ClC,CAAC,CAAC,CAAC;YACH,QAAQ,GAAG,SAAS,CAAC;QACzB,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;YACvB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACnB,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACtB,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;QACtB,CAAC,CAAC,CAAC;IACP,CAAC;IAED,OAAO;QACH,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACtB,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;QAElB,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,OAAe;QACxB,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;YAAE,OAAO,IAAI,IAAI,CAAC;SAAE;QACjD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;CACJ;AAjDD,8CAiDC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-jsonrpc.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-jsonrpc.d.ts deleted file mode 100644 index cd837819..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-jsonrpc.d.ts +++ /dev/null @@ -1,361 +0,0 @@ -/** - * One of the most common ways to interact with the blockchain is - * by a node running a JSON-RPC interface which can be connected to, - * based on the transport, using: - * - * - HTTP or HTTPS - [[JsonRpcProvider]] - * - WebSocket - [[WebSocketProvider]] - * - IPC - [[IpcSocketProvider]] - * - * @_section: api/providers/jsonrpc:JSON-RPC Provider [about-jsonrpcProvider] - */ -import { FetchRequest } from "../utils/index.js"; -import { AbstractProvider } from "./abstract-provider.js"; -import { AbstractSigner } from "./abstract-signer.js"; -import { Network } from "./network.js"; -import type { TypedDataDomain, TypedDataField } from "../hash/index.js"; -import type { TransactionLike } from "../transaction/index.js"; -import type { PerformActionRequest, Subscriber, Subscription } from "./abstract-provider.js"; -import type { Networkish } from "./network.js"; -import type { Provider, TransactionRequest, TransactionResponse } from "./provider.js"; -import type { Signer } from "./signer.js"; -/** - * A JSON-RPC payload, which are sent to a JSON-RPC server. - */ -export type JsonRpcPayload = { - /** - * The JSON-RPC request ID. - */ - id: number; - /** - * The JSON-RPC request method. - */ - method: string; - /** - * The JSON-RPC request parameters. - */ - params: Array | Record; - /** - * A required constant in the JSON-RPC specification. - */ - jsonrpc: "2.0"; -}; -/** - * A JSON-RPC result, which are returned on success from a JSON-RPC server. - */ -export type JsonRpcResult = { - /** - * The response ID to match it to the relevant request. - */ - id: number; - /** - * The response result. - */ - result: any; -}; -/** - * A JSON-RPC error, which are returned on failure from a JSON-RPC server. - */ -export type JsonRpcError = { - /** - * The response ID to match it to the relevant request. - */ - id: number; - /** - * The response error. - */ - error: { - code: number; - message?: string; - data?: any; - }; -}; -/** - * When subscribing to the ``"debug"`` event, the [[Listener]] will - * receive this object as the first parameter. - */ -export type DebugEventJsonRpcApiProvider = { - action: "sendRpcPayload"; - payload: JsonRpcPayload | Array; -} | { - action: "receiveRpcResult"; - result: Array; -} | { - action: "receiveRpcError"; - error: Error; -}; -/** - * Options for configuring a [[JsonRpcApiProvider]]. Much of this - * is targetted towards sub-classes, which often will not expose - * any of these options to their consumers. - * - * **``polling``** - use the polling strategy is used immediately - * for events; otherwise, attempt to use filters and fall back onto - * polling (default: ``false``) - * - * **``staticNetwork``** - do not request chain ID on requests to - * validate the underlying chain has not changed (default: ``null``) - * - * This should **ONLY** be used if it is **certain** that the network - * cannot change, such as when using INFURA (since the URL dictates the - * network). If the network is assumed static and it does change, this - * can have tragic consequences. For example, this **CANNOT** be used - * with MetaMask, since the user can select a new network from the - * drop-down at any time. - * - * **``batchStallTime``** - how long (ms) to aggregate requests into a - * single batch. ``0`` indicates batching will only encompass the current - * event loop. If ``batchMaxCount = 1``, this is ignored. (default: ``10``) - * - * **``batchMaxSize``** - target maximum size (bytes) to allow per batch - * request (default: 1Mb) - * - * **``batchMaxCount``** - maximum number of requests to allow in a batch. - * If ``batchMaxCount = 1``, then batching is disabled. (default: ``100``) - * - * **``cacheTimeout``** - passed as [[AbstractProviderOptions]]. - */ -export type JsonRpcApiProviderOptions = { - polling?: boolean; - staticNetwork?: null | boolean | Network; - batchStallTime?: number; - batchMaxSize?: number; - batchMaxCount?: number; - cacheTimeout?: number; - pollingInterval?: number; -}; -/** - * A **JsonRpcTransactionRequest** is formatted as needed by the JSON-RPC - * Ethereum API specification. - */ -export interface JsonRpcTransactionRequest { - /** - * The sender address to use when signing. - */ - from?: string; - /** - * The target address. - */ - to?: string; - /** - * The transaction data. - */ - data?: string; - /** - * The chain ID the transaction is valid on. - */ - chainId?: string; - /** - * The [[link-eip-2718]] transaction type. - */ - type?: string; - /** - * The maximum amount of gas to allow a transaction to consume. - * - * In most other places in ethers, this is called ``gasLimit`` which - * differs from the JSON-RPC Ethereum API specification. - */ - gas?: string; - /** - * The gas price per wei for transactions prior to [[link-eip-1559]]. - */ - gasPrice?: string; - /** - * The maximum fee per gas for [[link-eip-1559]] transactions. - */ - maxFeePerGas?: string; - /** - * The maximum priority fee per gas for [[link-eip-1559]] transactions. - */ - maxPriorityFeePerGas?: string; - /** - * The nonce for the transaction. - */ - nonce?: string; - /** - * The transaction value (in wei). - */ - value?: string; - /** - * The transaction access list. - */ - accessList?: Array<{ - address: string; - storageKeys: Array; - }>; - /** - * The transaction authorization list. - */ - authorizationList?: Array<{ - address: string; - nonce: string; - chainId: string; - yParity: string; - r: string; - s: string; - }>; -} -export declare class JsonRpcSigner extends AbstractSigner { - address: string; - constructor(provider: JsonRpcApiProvider, address: string); - connect(provider: null | Provider): Signer; - getAddress(): Promise; - populateTransaction(tx: TransactionRequest): Promise>; - sendUncheckedTransaction(_tx: TransactionRequest): Promise; - sendTransaction(tx: TransactionRequest): Promise; - signTransaction(_tx: TransactionRequest): Promise; - signMessage(_message: string | Uint8Array): Promise; - signTypedData(domain: TypedDataDomain, types: Record>, _value: Record): Promise; - unlock(password: string): Promise; - _legacySignMessage(_message: string | Uint8Array): Promise; -} -/** - * The JsonRpcApiProvider is an abstract class and **MUST** be - * sub-classed. - * - * It provides the base for all JSON-RPC-based Provider interaction. - * - * Sub-classing Notes: - * - a sub-class MUST override _send - * - a sub-class MUST call the `_start()` method once connected - */ -export declare abstract class JsonRpcApiProvider extends AbstractProvider { - #private; - constructor(network?: Networkish, options?: JsonRpcApiProviderOptions); - /** - * Returns the value associated with the option %%key%%. - * - * Sub-classes can use this to inquire about configuration options. - */ - _getOption(key: K): JsonRpcApiProviderOptions[K]; - /** - * Gets the [[Network]] this provider has committed to. On each call, the network - * is detected, and if it has changed, the call will reject. - */ - get _network(): Network; - /** - * Sends a JSON-RPC %%payload%% (or a batch) to the underlying channel. - * - * Sub-classes **MUST** override this. - */ - abstract _send(payload: JsonRpcPayload | Array): Promise>; - /** - * Resolves to the non-normalized value by performing %%req%%. - * - * Sub-classes may override this to modify behavior of actions, - * and should generally call ``super._perform`` as a fallback. - */ - _perform(req: PerformActionRequest): Promise; - /** - * Sub-classes may override this; it detects the *actual* network that - * we are **currently** connected to. - * - * Keep in mind that [[send]] may only be used once [[ready]], otherwise the - * _send primitive must be used instead. - */ - _detectNetwork(): Promise; - /** - * Sub-classes **MUST** call this. Until [[_start]] has been called, no calls - * will be passed to [[_send]] from [[send]]. If it is overridden, then - * ``super._start()`` **MUST** be called. - * - * Calling it multiple times is safe and has no effect. - */ - _start(): void; - /** - * Resolves once the [[_start]] has been called. This can be used in - * sub-classes to defer sending data until the connection has been - * established. - */ - _waitUntilReady(): Promise; - /** - * Return a Subscriber that will manage the %%sub%%. - * - * Sub-classes may override this to modify the behavior of - * subscription management. - */ - _getSubscriber(sub: Subscription): Subscriber; - /** - * Returns true only if the [[_start]] has been called. - */ - get ready(): boolean; - /** - * Returns %%tx%% as a normalized JSON-RPC transaction request, - * which has all values hexlified and any numeric values converted - * to Quantity values. - */ - getRpcTransaction(tx: TransactionRequest): JsonRpcTransactionRequest; - /** - * Returns the request method and arguments required to perform - * %%req%%. - */ - getRpcRequest(req: PerformActionRequest): null | { - method: string; - args: Array; - }; - /** - * Returns an ethers-style Error for the given JSON-RPC error - * %%payload%%, coalescing the various strings and error shapes - * that different nodes return, coercing them into a machine-readable - * standardized error. - */ - getRpcError(payload: JsonRpcPayload, _error: JsonRpcError): Error; - /** - * Requests the %%method%% with %%params%% via the JSON-RPC protocol - * over the underlying channel. This can be used to call methods - * on the backend that do not have a high-level API within the Provider - * API. - * - * This method queues requests according to the batch constraints - * in the options, assigns the request a unique ID. - * - * **Do NOT override** this method in sub-classes; instead - * override [[_send]] or force the options values in the - * call to the constructor to modify this method's behavior. - */ - send(method: string, params: Array | Record): Promise; - /** - * Resolves to the [[Signer]] account for %%address%% managed by - * the client. - * - * If the %%address%% is a number, it is used as an index in the - * the accounts from [[listAccounts]]. - * - * This can only be used on clients which manage accounts (such as - * Geth with imported account or MetaMask). - * - * Throws if the account doesn't exist. - */ - getSigner(address?: number | string): Promise; - listAccounts(): Promise>; - destroy(): void; -} -/** - * @_ignore: - */ -export declare abstract class JsonRpcApiPollingProvider extends JsonRpcApiProvider { - #private; - constructor(network?: Networkish, options?: JsonRpcApiProviderOptions); - _getSubscriber(sub: Subscription): Subscriber; - /** - * The polling interval (default: 4000 ms) - */ - get pollingInterval(): number; - set pollingInterval(value: number); -} -/** - * The JsonRpcProvider is one of the most common Providers, - * which performs all operations over HTTP (or HTTPS) requests. - * - * Events are processed by polling the backend for the current block - * number; when it advances, all block-base events are then checked - * for updates. - */ -export declare class JsonRpcProvider extends JsonRpcApiPollingProvider { - #private; - constructor(url?: string | FetchRequest, network?: Networkish, options?: JsonRpcApiProviderOptions); - _getConnection(): FetchRequest; - send(method: string, params: Array | Record): Promise; - _send(payload: JsonRpcPayload | Array): Promise>; -} -//# sourceMappingURL=provider-jsonrpc.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-jsonrpc.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-jsonrpc.d.ts.map deleted file mode 100644 index 8a6f870a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-jsonrpc.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-jsonrpc.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-jsonrpc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAWH,OAAO,EAGH,YAAY,EACf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAuB,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAIvC,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC7F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACvF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AA6C1C;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IACzB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,C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,SAAQ,yBAAyB;;gBAG9C,GAAG,CAAC,EAAE,MAAM,GAAG,YAAY,EAAE,OAAO,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,yBAAyB;IAWlG,cAAc,IAAI,YAAY;IAIxB,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IAS5E,KAAK,CAAC,OAAO,EAAE,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;CAa9F"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-jsonrpc.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-jsonrpc.js deleted file mode 100644 index f0a66dfc..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-jsonrpc.js +++ /dev/null @@ -1,980 +0,0 @@ -"use strict"; -/** - * One of the most common ways to interact with the blockchain is - * by a node running a JSON-RPC interface which can be connected to, - * based on the transport, using: - * - * - HTTP or HTTPS - [[JsonRpcProvider]] - * - WebSocket - [[WebSocketProvider]] - * - IPC - [[IpcSocketProvider]] - * - * @_section: api/providers/jsonrpc:JSON-RPC Provider [about-jsonrpcProvider] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.JsonRpcProvider = exports.JsonRpcApiPollingProvider = exports.JsonRpcApiProvider = exports.JsonRpcSigner = void 0; -// @TODO: -// - Add the batching API -// https://playground.open-rpc.org/?schemaUrl=https://raw.githubusercontent.com/ethereum/eth1.0-apis/assembled-spec/openrpc.json&uiSchema%5BappBar%5D%5Bui:splitView%5D=true&uiSchema%5BappBar%5D%5Bui:input%5D=false&uiSchema%5BappBar%5D%5Bui:examplesDropdown%5D=false -const index_js_1 = require("../abi/index.js"); -const index_js_2 = require("../address/index.js"); -const index_js_3 = require("../hash/index.js"); -const index_js_4 = require("../transaction/index.js"); -const index_js_5 = require("../utils/index.js"); -const abstract_provider_js_1 = require("./abstract-provider.js"); -const abstract_signer_js_1 = require("./abstract-signer.js"); -const network_js_1 = require("./network.js"); -const subscriber_filterid_js_1 = require("./subscriber-filterid.js"); -const subscriber_polling_js_1 = require("./subscriber-polling.js"); -const Primitive = "bigint,boolean,function,number,string,symbol".split(/,/g); -//const Methods = "getAddress,then".split(/,/g); -function deepCopy(value) { - if (value == null || Primitive.indexOf(typeof (value)) >= 0) { - return value; - } - // Keep any Addressable - if (typeof (value.getAddress) === "function") { - return value; - } - if (Array.isArray(value)) { - return (value.map(deepCopy)); - } - if (typeof (value) === "object") { - return Object.keys(value).reduce((accum, key) => { - accum[key] = value[key]; - return accum; - }, {}); - } - throw new Error(`should not happen: ${value} (${typeof (value)})`); -} -function stall(duration) { - return new Promise((resolve) => { setTimeout(resolve, duration); }); -} -function getLowerCase(value) { - if (value) { - return value.toLowerCase(); - } - return value; -} -function isPollable(value) { - return (value && typeof (value.pollingInterval) === "number"); -} -const defaultOptions = { - polling: false, - staticNetwork: null, - batchStallTime: 10, - batchMaxSize: (1 << 20), - batchMaxCount: 100, - cacheTimeout: 250, - pollingInterval: 4000 -}; -// @TODO: Unchecked Signers -class JsonRpcSigner extends abstract_signer_js_1.AbstractSigner { - address; - constructor(provider, address) { - super(provider); - address = (0, index_js_2.getAddress)(address); - (0, index_js_5.defineProperties)(this, { address }); - } - connect(provider) { - (0, index_js_5.assert)(false, "cannot reconnect JsonRpcSigner", "UNSUPPORTED_OPERATION", { - operation: "signer.connect" - }); - } - async getAddress() { - return this.address; - } - // JSON-RPC will automatially fill in nonce, etc. so we just check from - async populateTransaction(tx) { - return await this.populateCall(tx); - } - // Returns just the hash of the transaction after sent, which is what - // the bare JSON-RPC API does; - async sendUncheckedTransaction(_tx) { - const tx = deepCopy(_tx); - const promises = []; - // Make sure the from matches the sender - if (tx.from) { - const _from = tx.from; - promises.push((async () => { - const from = await (0, index_js_2.resolveAddress)(_from, this.provider); - (0, index_js_5.assertArgument)(from != null && from.toLowerCase() === this.address.toLowerCase(), "from address mismatch", "transaction", _tx); - tx.from = from; - })()); - } - else { - tx.from = this.address; - } - // The JSON-RPC for eth_sendTransaction uses 90000 gas; if the user - // wishes to use this, it is easy to specify explicitly, otherwise - // we look it up for them. - if (tx.gasLimit == null) { - promises.push((async () => { - tx.gasLimit = await this.provider.estimateGas({ ...tx, from: this.address }); - })()); - } - // The address may be an ENS name or Addressable - if (tx.to != null) { - const _to = tx.to; - promises.push((async () => { - tx.to = await (0, index_js_2.resolveAddress)(_to, this.provider); - })()); - } - // Wait until all of our properties are filled in - if (promises.length) { - await Promise.all(promises); - } - const hexTx = this.provider.getRpcTransaction(tx); - return this.provider.send("eth_sendTransaction", [hexTx]); - } - async sendTransaction(tx) { - // This cannot be mined any earlier than any recent block - const blockNumber = await this.provider.getBlockNumber(); - // Send the transaction - const hash = await this.sendUncheckedTransaction(tx); - // Unfortunately, JSON-RPC only provides and opaque transaction hash - // for a response, and we need the actual transaction, so we poll - // for it; it should show up very quickly - return await (new Promise((resolve, reject) => { - const timeouts = [1000, 100]; - let invalids = 0; - const checkTx = async () => { - try { - // Try getting the transaction - const tx = await this.provider.getTransaction(hash); - if (tx != null) { - resolve(tx.replaceableTransaction(blockNumber)); - return; - } - } - catch (error) { - // If we were cancelled: stop polling. - // If the data is bad: the node returns bad transactions - // If the network changed: calling again will also fail - // If unsupported: likely destroyed - if ((0, index_js_5.isError)(error, "CANCELLED") || (0, index_js_5.isError)(error, "BAD_DATA") || - (0, index_js_5.isError)(error, "NETWORK_ERROR") || (0, index_js_5.isError)(error, "UNSUPPORTED_OPERATION")) { - if (error.info == null) { - error.info = {}; - } - error.info.sendTransactionHash = hash; - reject(error); - return; - } - // Stop-gap for misbehaving backends; see #4513 - if ((0, index_js_5.isError)(error, "INVALID_ARGUMENT")) { - invalids++; - if (error.info == null) { - error.info = {}; - } - error.info.sendTransactionHash = hash; - if (invalids > 10) { - reject(error); - return; - } - } - // Notify anyone that cares; but we will try again, since - // it is likely an intermittent service error - this.provider.emit("error", (0, index_js_5.makeError)("failed to fetch transation after sending (will try again)", "UNKNOWN_ERROR", { error })); - } - // Wait another 4 seconds - this.provider._setTimeout(() => { checkTx(); }, timeouts.pop() || 4000); - }; - checkTx(); - })); - } - async signTransaction(_tx) { - const tx = deepCopy(_tx); - // Make sure the from matches the sender - if (tx.from) { - const from = await (0, index_js_2.resolveAddress)(tx.from, this.provider); - (0, index_js_5.assertArgument)(from != null && from.toLowerCase() === this.address.toLowerCase(), "from address mismatch", "transaction", _tx); - tx.from = from; - } - else { - tx.from = this.address; - } - const hexTx = this.provider.getRpcTransaction(tx); - return await this.provider.send("eth_signTransaction", [hexTx]); - } - async signMessage(_message) { - const message = ((typeof (_message) === "string") ? (0, index_js_5.toUtf8Bytes)(_message) : _message); - return await this.provider.send("personal_sign", [ - (0, index_js_5.hexlify)(message), this.address.toLowerCase() - ]); - } - async signTypedData(domain, types, _value) { - const value = deepCopy(_value); - // Populate any ENS names (in-place) - const populated = await index_js_3.TypedDataEncoder.resolveNames(domain, types, value, async (value) => { - const address = await (0, index_js_2.resolveAddress)(value); - (0, index_js_5.assertArgument)(address != null, "TypedData does not support null address", "value", value); - return address; - }); - return await this.provider.send("eth_signTypedData_v4", [ - this.address.toLowerCase(), - JSON.stringify(index_js_3.TypedDataEncoder.getPayload(populated.domain, types, populated.value)) - ]); - } - async unlock(password) { - return this.provider.send("personal_unlockAccount", [ - this.address.toLowerCase(), password, null - ]); - } - // https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign - async _legacySignMessage(_message) { - const message = ((typeof (_message) === "string") ? (0, index_js_5.toUtf8Bytes)(_message) : _message); - return await this.provider.send("eth_sign", [ - this.address.toLowerCase(), (0, index_js_5.hexlify)(message) - ]); - } -} -exports.JsonRpcSigner = JsonRpcSigner; -/** - * The JsonRpcApiProvider is an abstract class and **MUST** be - * sub-classed. - * - * It provides the base for all JSON-RPC-based Provider interaction. - * - * Sub-classing Notes: - * - a sub-class MUST override _send - * - a sub-class MUST call the `_start()` method once connected - */ -class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider { - #options; - // The next ID to use for the JSON-RPC ID field - #nextId; - // Payloads are queued and triggered in batches using the drainTimer - #payloads; - #drainTimer; - #notReady; - #network; - #pendingDetectNetwork; - #scheduleDrain() { - if (this.#drainTimer) { - return; - } - // If we aren't using batching, no harm in sending it immediately - const stallTime = (this._getOption("batchMaxCount") === 1) ? 0 : this._getOption("batchStallTime"); - this.#drainTimer = setTimeout(() => { - this.#drainTimer = null; - const payloads = this.#payloads; - this.#payloads = []; - while (payloads.length) { - // Create payload batches that satisfy our batch constraints - const batch = [(payloads.shift())]; - while (payloads.length) { - if (batch.length === this.#options.batchMaxCount) { - break; - } - batch.push((payloads.shift())); - const bytes = JSON.stringify(batch.map((p) => p.payload)); - if (bytes.length > this.#options.batchMaxSize) { - payloads.unshift((batch.pop())); - break; - } - } - // Process the result to each payload - (async () => { - const payload = ((batch.length === 1) ? batch[0].payload : batch.map((p) => p.payload)); - this.emit("debug", { action: "sendRpcPayload", payload }); - try { - const result = await this._send(payload); - this.emit("debug", { action: "receiveRpcResult", result }); - // Process results in batch order - for (const { resolve, reject, payload } of batch) { - if (this.destroyed) { - reject((0, index_js_5.makeError)("provider destroyed; cancelled request", "UNSUPPORTED_OPERATION", { operation: payload.method })); - continue; - } - // Find the matching result - const resp = result.filter((r) => (r.id === payload.id))[0]; - // No result; the node failed us in unexpected ways - if (resp == null) { - const error = (0, index_js_5.makeError)("missing response for request", "BAD_DATA", { - value: result, info: { payload } - }); - this.emit("error", error); - reject(error); - continue; - } - // The response is an error - if ("error" in resp) { - reject(this.getRpcError(payload, resp)); - continue; - } - // All good; send the result - resolve(resp.result); - } - } - catch (error) { - this.emit("debug", { action: "receiveRpcError", error }); - for (const { reject } of batch) { - // @TODO: augment the error with the payload - reject(error); - } - } - })(); - } - }, stallTime); - } - constructor(network, options) { - super(network, options); - this.#nextId = 1; - this.#options = Object.assign({}, defaultOptions, options || {}); - this.#payloads = []; - this.#drainTimer = null; - this.#network = null; - this.#pendingDetectNetwork = null; - { - let resolve = null; - const promise = new Promise((_resolve) => { - resolve = _resolve; - }); - this.#notReady = { promise, resolve }; - } - const staticNetwork = this._getOption("staticNetwork"); - if (typeof (staticNetwork) === "boolean") { - (0, index_js_5.assertArgument)(!staticNetwork || network !== "any", "staticNetwork cannot be used on special network 'any'", "options", options); - if (staticNetwork && network != null) { - this.#network = network_js_1.Network.from(network); - } - } - else if (staticNetwork) { - // Make sure any static network is compatbile with the provided netwrok - (0, index_js_5.assertArgument)(network == null || staticNetwork.matches(network), "staticNetwork MUST match network object", "options", options); - this.#network = staticNetwork; - } - } - /** - * Returns the value associated with the option %%key%%. - * - * Sub-classes can use this to inquire about configuration options. - */ - _getOption(key) { - return this.#options[key]; - } - /** - * Gets the [[Network]] this provider has committed to. On each call, the network - * is detected, and if it has changed, the call will reject. - */ - get _network() { - (0, index_js_5.assert)(this.#network, "network is not available yet", "NETWORK_ERROR"); - return this.#network; - } - /** - * Resolves to the non-normalized value by performing %%req%%. - * - * Sub-classes may override this to modify behavior of actions, - * and should generally call ``super._perform`` as a fallback. - */ - async _perform(req) { - // Legacy networks do not like the type field being passed along (which - // is fair), so we delete type if it is 0 and a non-EIP-1559 network - if (req.method === "call" || req.method === "estimateGas") { - let tx = req.transaction; - if (tx && tx.type != null && (0, index_js_5.getBigInt)(tx.type)) { - // If there are no EIP-1559 or newer properties, it might be pre-EIP-1559 - if (tx.maxFeePerGas == null && tx.maxPriorityFeePerGas == null) { - const feeData = await this.getFeeData(); - if (feeData.maxFeePerGas == null && feeData.maxPriorityFeePerGas == null) { - // Network doesn't know about EIP-1559 (and hence type) - req = Object.assign({}, req, { - transaction: Object.assign({}, tx, { type: undefined }) - }); - } - } - } - } - const request = this.getRpcRequest(req); - if (request != null) { - return await this.send(request.method, request.args); - } - return super._perform(req); - } - /** - * Sub-classes may override this; it detects the *actual* network that - * we are **currently** connected to. - * - * Keep in mind that [[send]] may only be used once [[ready]], otherwise the - * _send primitive must be used instead. - */ - async _detectNetwork() { - const network = this._getOption("staticNetwork"); - if (network) { - if (network === true) { - if (this.#network) { - return this.#network; - } - } - else { - return network; - } - } - if (this.#pendingDetectNetwork) { - return await this.#pendingDetectNetwork; - } - // If we are ready, use ``send``, which enabled requests to be batched - if (this.ready) { - this.#pendingDetectNetwork = (async () => { - try { - const result = network_js_1.Network.from((0, index_js_5.getBigInt)(await this.send("eth_chainId", []))); - this.#pendingDetectNetwork = null; - return result; - } - catch (error) { - this.#pendingDetectNetwork = null; - throw error; - } - })(); - return await this.#pendingDetectNetwork; - } - // We are not ready yet; use the primitive _send - this.#pendingDetectNetwork = (async () => { - const payload = { - id: this.#nextId++, method: "eth_chainId", params: [], jsonrpc: "2.0" - }; - this.emit("debug", { action: "sendRpcPayload", payload }); - let result; - try { - result = (await this._send(payload))[0]; - this.#pendingDetectNetwork = null; - } - catch (error) { - this.#pendingDetectNetwork = null; - this.emit("debug", { action: "receiveRpcError", error }); - throw error; - } - this.emit("debug", { action: "receiveRpcResult", result }); - if ("result" in result) { - return network_js_1.Network.from((0, index_js_5.getBigInt)(result.result)); - } - throw this.getRpcError(payload, result); - })(); - return await this.#pendingDetectNetwork; - } - /** - * Sub-classes **MUST** call this. Until [[_start]] has been called, no calls - * will be passed to [[_send]] from [[send]]. If it is overridden, then - * ``super._start()`` **MUST** be called. - * - * Calling it multiple times is safe and has no effect. - */ - _start() { - if (this.#notReady == null || this.#notReady.resolve == null) { - return; - } - this.#notReady.resolve(); - this.#notReady = null; - (async () => { - // Bootstrap the network - while (this.#network == null && !this.destroyed) { - try { - this.#network = await this._detectNetwork(); - } - catch (error) { - if (this.destroyed) { - break; - } - console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"); - this.emit("error", (0, index_js_5.makeError)("failed to bootstrap network detection", "NETWORK_ERROR", { event: "initial-network-discovery", info: { error } })); - await stall(1000); - } - } - // Start dispatching requests - this.#scheduleDrain(); - })(); - } - /** - * Resolves once the [[_start]] has been called. This can be used in - * sub-classes to defer sending data until the connection has been - * established. - */ - async _waitUntilReady() { - if (this.#notReady == null) { - return; - } - return await this.#notReady.promise; - } - /** - * Return a Subscriber that will manage the %%sub%%. - * - * Sub-classes may override this to modify the behavior of - * subscription management. - */ - _getSubscriber(sub) { - // Pending Filters aren't availble via polling - if (sub.type === "pending") { - return new subscriber_filterid_js_1.FilterIdPendingSubscriber(this); - } - if (sub.type === "event") { - if (this._getOption("polling")) { - return new subscriber_polling_js_1.PollingEventSubscriber(this, sub.filter); - } - return new subscriber_filterid_js_1.FilterIdEventSubscriber(this, sub.filter); - } - // Orphaned Logs are handled automatically, by the filter, since - // logs with removed are emitted by it - if (sub.type === "orphan" && sub.filter.orphan === "drop-log") { - return new abstract_provider_js_1.UnmanagedSubscriber("orphan"); - } - return super._getSubscriber(sub); - } - /** - * Returns true only if the [[_start]] has been called. - */ - get ready() { return this.#notReady == null; } - /** - * Returns %%tx%% as a normalized JSON-RPC transaction request, - * which has all values hexlified and any numeric values converted - * to Quantity values. - */ - getRpcTransaction(tx) { - const result = {}; - // JSON-RPC now requires numeric values to be "quantity" values - ["chainId", "gasLimit", "gasPrice", "type", "maxFeePerGas", "maxPriorityFeePerGas", "nonce", "value"].forEach((key) => { - if (tx[key] == null) { - return; - } - let dstKey = key; - if (key === "gasLimit") { - dstKey = "gas"; - } - result[dstKey] = (0, index_js_5.toQuantity)((0, index_js_5.getBigInt)(tx[key], `tx.${key}`)); - }); - // Make sure addresses and data are lowercase - ["from", "to", "data"].forEach((key) => { - if (tx[key] == null) { - return; - } - result[key] = (0, index_js_5.hexlify)(tx[key]); - }); - // Normalize the access list object - if (tx.accessList) { - result["accessList"] = (0, index_js_4.accessListify)(tx.accessList); - } - if (tx.blobVersionedHashes) { - // @TODO: Remove this case once EIP-4844 added to prepared tx - result["blobVersionedHashes"] = tx.blobVersionedHashes.map(h => h.toLowerCase()); - } - if (tx.authorizationList) { - result["authorizationList"] = tx.authorizationList.map((_a) => { - const a = (0, index_js_4.authorizationify)(_a); - return { - address: a.address, - nonce: (0, index_js_5.toQuantity)(a.nonce), - chainId: (0, index_js_5.toQuantity)(a.chainId), - yParity: (0, index_js_5.toQuantity)(a.signature.yParity), - r: (0, index_js_5.toQuantity)(a.signature.r), - s: (0, index_js_5.toQuantity)(a.signature.s), - }; - }); - } - // @TODO: blobs should probably also be copied over, optionally - // accounting for the kzg property to backfill blobVersionedHashes - // using the commitment. Or should that be left as an exercise to - // the caller? - return result; - } - /** - * Returns the request method and arguments required to perform - * %%req%%. - */ - getRpcRequest(req) { - switch (req.method) { - case "chainId": - return { method: "eth_chainId", args: [] }; - case "getBlockNumber": - return { method: "eth_blockNumber", args: [] }; - case "getGasPrice": - return { method: "eth_gasPrice", args: [] }; - case "getPriorityFee": - return { method: "eth_maxPriorityFeePerGas", args: [] }; - case "getBalance": - return { - method: "eth_getBalance", - args: [getLowerCase(req.address), req.blockTag] - }; - case "getTransactionCount": - return { - method: "eth_getTransactionCount", - args: [getLowerCase(req.address), req.blockTag] - }; - case "getCode": - return { - method: "eth_getCode", - args: [getLowerCase(req.address), req.blockTag] - }; - case "getStorage": - return { - method: "eth_getStorageAt", - args: [ - getLowerCase(req.address), - ("0x" + req.position.toString(16)), - req.blockTag - ] - }; - case "broadcastTransaction": - return { - method: "eth_sendRawTransaction", - args: [req.signedTransaction] - }; - case "getBlock": - if ("blockTag" in req) { - return { - method: "eth_getBlockByNumber", - args: [req.blockTag, !!req.includeTransactions] - }; - } - else if ("blockHash" in req) { - return { - method: "eth_getBlockByHash", - args: [req.blockHash, !!req.includeTransactions] - }; - } - break; - case "getTransaction": - return { - method: "eth_getTransactionByHash", - args: [req.hash] - }; - case "getTransactionReceipt": - return { - method: "eth_getTransactionReceipt", - args: [req.hash] - }; - case "call": - return { - method: "eth_call", - args: [this.getRpcTransaction(req.transaction), req.blockTag] - }; - case "estimateGas": { - return { - method: "eth_estimateGas", - args: [this.getRpcTransaction(req.transaction)] - }; - } - case "getLogs": - if (req.filter && req.filter.address != null) { - if (Array.isArray(req.filter.address)) { - req.filter.address = req.filter.address.map(getLowerCase); - } - else { - req.filter.address = getLowerCase(req.filter.address); - } - } - return { method: "eth_getLogs", args: [req.filter] }; - } - return null; - } - /** - * Returns an ethers-style Error for the given JSON-RPC error - * %%payload%%, coalescing the various strings and error shapes - * that different nodes return, coercing them into a machine-readable - * standardized error. - */ - getRpcError(payload, _error) { - const { method } = payload; - const { error } = _error; - if (method === "eth_estimateGas" && error.message) { - const msg = error.message; - if (!msg.match(/revert/i) && msg.match(/insufficient funds/i)) { - return (0, index_js_5.makeError)("insufficient funds", "INSUFFICIENT_FUNDS", { - transaction: (payload.params[0]), - info: { payload, error } - }); - } - else if (msg.match(/nonce/i) && msg.match(/too low/i)) { - return (0, index_js_5.makeError)("nonce has already been used", "NONCE_EXPIRED", { - transaction: (payload.params[0]), - info: { payload, error } - }); - } - } - if (method === "eth_call" || method === "eth_estimateGas") { - const result = spelunkData(error); - const e = index_js_1.AbiCoder.getBuiltinCallException((method === "eth_call") ? "call" : "estimateGas", (payload.params[0]), (result ? result.data : null)); - e.info = { error, payload }; - return e; - } - // Only estimateGas and call can return arbitrary contract-defined text, so now we - // we can process text safely. - const message = JSON.stringify(spelunkMessage(error)); - if (typeof (error.message) === "string" && error.message.match(/user denied|ethers-user-denied/i)) { - const actionMap = { - eth_sign: "signMessage", - personal_sign: "signMessage", - eth_signTypedData_v4: "signTypedData", - eth_signTransaction: "signTransaction", - eth_sendTransaction: "sendTransaction", - eth_requestAccounts: "requestAccess", - wallet_requestAccounts: "requestAccess", - }; - return (0, index_js_5.makeError)(`user rejected action`, "ACTION_REJECTED", { - action: (actionMap[method] || "unknown"), - reason: "rejected", - info: { payload, error } - }); - } - if (method === "eth_sendRawTransaction" || method === "eth_sendTransaction") { - const transaction = (payload.params[0]); - if (message.match(/insufficient funds|base fee exceeds gas limit/i)) { - return (0, index_js_5.makeError)("insufficient funds for intrinsic transaction cost", "INSUFFICIENT_FUNDS", { - transaction, info: { error } - }); - } - if (message.match(/nonce/i) && message.match(/too low/i)) { - return (0, index_js_5.makeError)("nonce has already been used", "NONCE_EXPIRED", { transaction, info: { error } }); - } - // "replacement transaction underpriced" - if (message.match(/replacement transaction/i) && message.match(/underpriced/i)) { - return (0, index_js_5.makeError)("replacement fee too low", "REPLACEMENT_UNDERPRICED", { transaction, info: { error } }); - } - if (message.match(/only replay-protected/i)) { - return (0, index_js_5.makeError)("legacy pre-eip-155 transactions not supported", "UNSUPPORTED_OPERATION", { - operation: method, info: { transaction, info: { error } } - }); - } - } - let unsupported = !!message.match(/the method .* does not exist/i); - if (!unsupported) { - if (error && error.details && error.details.startsWith("Unauthorized method:")) { - unsupported = true; - } - } - if (unsupported) { - return (0, index_js_5.makeError)("unsupported operation", "UNSUPPORTED_OPERATION", { - operation: payload.method, info: { error, payload } - }); - } - return (0, index_js_5.makeError)("could not coalesce error", "UNKNOWN_ERROR", { error, payload }); - } - /** - * Requests the %%method%% with %%params%% via the JSON-RPC protocol - * over the underlying channel. This can be used to call methods - * on the backend that do not have a high-level API within the Provider - * API. - * - * This method queues requests according to the batch constraints - * in the options, assigns the request a unique ID. - * - * **Do NOT override** this method in sub-classes; instead - * override [[_send]] or force the options values in the - * call to the constructor to modify this method's behavior. - */ - send(method, params) { - // @TODO: cache chainId?? purge on switch_networks - // We have been destroyed; no operations are supported anymore - if (this.destroyed) { - return Promise.reject((0, index_js_5.makeError)("provider destroyed; cancelled request", "UNSUPPORTED_OPERATION", { operation: method })); - } - const id = this.#nextId++; - const promise = new Promise((resolve, reject) => { - this.#payloads.push({ - resolve, reject, - payload: { method, params, id, jsonrpc: "2.0" } - }); - }); - // If there is not a pending drainTimer, set one - this.#scheduleDrain(); - return promise; - } - /** - * Resolves to the [[Signer]] account for %%address%% managed by - * the client. - * - * If the %%address%% is a number, it is used as an index in the - * the accounts from [[listAccounts]]. - * - * This can only be used on clients which manage accounts (such as - * Geth with imported account or MetaMask). - * - * Throws if the account doesn't exist. - */ - async getSigner(address) { - if (address == null) { - address = 0; - } - const accountsPromise = this.send("eth_accounts", []); - // Account index - if (typeof (address) === "number") { - const accounts = (await accountsPromise); - if (address >= accounts.length) { - throw new Error("no such account"); - } - return new JsonRpcSigner(this, accounts[address]); - } - const { accounts } = await (0, index_js_5.resolveProperties)({ - network: this.getNetwork(), - accounts: accountsPromise - }); - // Account address - address = (0, index_js_2.getAddress)(address); - for (const account of accounts) { - if ((0, index_js_2.getAddress)(account) === address) { - return new JsonRpcSigner(this, address); - } - } - throw new Error("invalid account"); - } - async listAccounts() { - const accounts = await this.send("eth_accounts", []); - return accounts.map((a) => new JsonRpcSigner(this, a)); - } - destroy() { - // Stop processing requests - if (this.#drainTimer) { - clearTimeout(this.#drainTimer); - this.#drainTimer = null; - } - // Cancel all pending requests - for (const { payload, reject } of this.#payloads) { - reject((0, index_js_5.makeError)("provider destroyed; cancelled request", "UNSUPPORTED_OPERATION", { operation: payload.method })); - } - this.#payloads = []; - // Parent clean-up - super.destroy(); - } -} -exports.JsonRpcApiProvider = JsonRpcApiProvider; -// @TODO: remove this in v7, it is not exported because this functionality -// is exposed in the JsonRpcApiProvider by setting polling to true. It should -// be safe to remove regardless, because it isn't reachable, but just in case. -/** - * @_ignore: - */ -class JsonRpcApiPollingProvider extends JsonRpcApiProvider { - #pollingInterval; - constructor(network, options) { - super(network, options); - let pollingInterval = this._getOption("pollingInterval"); - if (pollingInterval == null) { - pollingInterval = defaultOptions.pollingInterval; - } - this.#pollingInterval = pollingInterval; - } - _getSubscriber(sub) { - const subscriber = super._getSubscriber(sub); - if (isPollable(subscriber)) { - subscriber.pollingInterval = this.#pollingInterval; - } - return subscriber; - } - /** - * The polling interval (default: 4000 ms) - */ - get pollingInterval() { return this.#pollingInterval; } - set pollingInterval(value) { - if (!Number.isInteger(value) || value < 0) { - throw new Error("invalid interval"); - } - this.#pollingInterval = value; - this._forEachSubscriber((sub) => { - if (isPollable(sub)) { - sub.pollingInterval = this.#pollingInterval; - } - }); - } -} -exports.JsonRpcApiPollingProvider = JsonRpcApiPollingProvider; -/** - * The JsonRpcProvider is one of the most common Providers, - * which performs all operations over HTTP (or HTTPS) requests. - * - * Events are processed by polling the backend for the current block - * number; when it advances, all block-base events are then checked - * for updates. - */ -class JsonRpcProvider extends JsonRpcApiPollingProvider { - #connect; - constructor(url, network, options) { - if (url == null) { - url = "http:/\/localhost:8545"; - } - super(network, options); - if (typeof (url) === "string") { - this.#connect = new index_js_5.FetchRequest(url); - } - else { - this.#connect = url.clone(); - } - } - _getConnection() { - return this.#connect.clone(); - } - async send(method, params) { - // All requests are over HTTP, so we can just start handling requests - // We do this here rather than the constructor so that we don't send any - // requests to the network (i.e. eth_chainId) until we absolutely have to. - await this._start(); - return await super.send(method, params); - } - async _send(payload) { - // Configure a POST connection for the requested method - const request = this._getConnection(); - request.body = JSON.stringify(payload); - request.setHeader("content-type", "application/json"); - const response = await request.send(); - response.assertOk(); - let resp = response.bodyJson; - if (!Array.isArray(resp)) { - resp = [resp]; - } - return resp; - } -} -exports.JsonRpcProvider = JsonRpcProvider; -function spelunkData(value) { - if (value == null) { - return null; - } - // These *are* the droids we're looking for. - if (typeof (value.message) === "string" && value.message.match(/revert/i) && (0, index_js_5.isHexString)(value.data)) { - return { message: value.message, data: value.data }; - } - // Spelunk further... - if (typeof (value) === "object") { - for (const key in value) { - const result = spelunkData(value[key]); - if (result) { - return result; - } - } - return null; - } - // Might be a JSON string we can further descend... - if (typeof (value) === "string") { - try { - return spelunkData(JSON.parse(value)); - } - catch (error) { } - } - return null; -} -function _spelunkMessage(value, result) { - if (value == null) { - return; - } - // These *are* the droids we're looking for. - if (typeof (value.message) === "string") { - result.push(value.message); - } - // Spelunk further... - if (typeof (value) === "object") { - for (const key in value) { - _spelunkMessage(value[key], result); - } - } - // Might be a JSON string we can further descend... - if (typeof (value) === "string") { - try { - return _spelunkMessage(JSON.parse(value), result); - } - catch (error) { } - } -} -function spelunkMessage(value) { - const result = []; - _spelunkMessage(value, result); - return result; -} -//# sourceMappingURL=provider-jsonrpc.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-jsonrpc.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-jsonrpc.js.map deleted file mode 100644 index 11981e35..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-jsonrpc.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-jsonrpc.js","sourceRoot":"","sources":["../../src.ts/providers/provider-jsonrpc.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAEH,SAAS;AACT,yBAAyB;AAEzB,yQAAyQ;AAEzQ,8CAA2C;AAC3C,kDAAiE;AACjE,+CAAoD;AACpD,sDAA0E;AAC1E,gDAI2B;AAE3B,iEAA+E;AAC/E,6DAAsD;AACtD,6CAAuC;AACvC,qEAA8F;AAC9F,mEAAiE;AAYjE,MAAM,SAAS,GAAG,8CAA8C,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAC7E,gDAAgD;AAChD,SAAS,QAAQ,CAAU,KAAQ;IAC/B,IAAI,KAAK,IAAI,IAAI,IAAI,SAAS,CAAC,OAAO,CAAC,OAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE;QACxD,OAAO,KAAK,CAAC;KAChB;IAED,uBAAuB;IACvB,IAAI,OAAM,CAAO,KAAM,CAAC,UAAU,CAAC,KAAK,UAAU,EAAE;QAChD,OAAO,KAAK,CAAC;KAChB;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QAAE,OAAY,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;KAAE;IAEhE,IAAI,OAAM,CAAC,KAAK,CAAC,KAAK,QAAQ,EAAE;QA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AAE;QACpC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;KAC9B;IAED,qBAAqB;IACrB,IAAI,OAAM,CAAC,KAAK,CAAC,KAAK,QAAQ,EAAE;QAC5B,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE;YACrB,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC;SACvC;KACJ;IAED,mDAAmD;IACnD,IAAI,OAAM,CAAC,KAAK,CAAC,KAAK,QAAQ,EAAE;QAC5B,IAAI;YACA,OAAO,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC;SACrD;QAAC,OAAO,KAAK,EAAE,GAAG;KACtB;AACL,CAAC;AAED,SAAS,cAAc,CAAC,KAAU;IAC9B,MAAM,MAAM,GAAkB,EAAG,CAAC;IAClC,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC/B,OAAO,MAAM,CAAC;AAClB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-pocket.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-pocket.d.ts deleted file mode 100644 index e0c4dc81..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-pocket.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -/** - * [[link-pocket]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Polygon (``matic``) - * - Arbitrum (``arbitrum``) - * - * @_subsection: api/providers/thirdparty:Pocket [providers-pocket] - */ -import { FetchRequest } from "../utils/index.js"; -import { AbstractProvider } from "./abstract-provider.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; -/** - * The **PocketProvider** connects to the [[link-pocket]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-pocket-signup). - */ -export declare class PocketProvider extends JsonRpcProvider implements CommunityResourcable { - /** - * The Application ID for the Pocket connection. - */ - readonly applicationId: string; - /** - * The Application Secret for making authenticated requests - * to the Pocket connection. - */ - readonly applicationSecret: null | string; - /** - * Create a new **PocketProvider**. - * - * By default connecting to ``mainnet`` with a highly throttled - * API key. - */ - constructor(_network?: Networkish, applicationId?: null | string, applicationSecret?: null | string); - _getProvider(chainId: number): AbstractProvider; - /** - * Returns a prepared request for connecting to %%network%% with - * %%applicationId%%. - */ - static getRequest(network: Network, applicationId?: null | string, applicationSecret?: null | string): FetchRequest; - isCommunityResource(): boolean; -} -//# sourceMappingURL=provider-pocket.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-pocket.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-pocket.d.ts.map deleted file mode 100644 index 1d989750..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-pocket.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-pocket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-pocket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EACe,YAAY,EACjC,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAqB/C;;;;;;;;GAQG;AACH,qBAAa,cAAe,SAAQ,eAAgB,YAAW,oBAAoB;IAE/E;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAG,MAAM,CAAC;IAEhC;;;OAGG;IACH,QAAQ,CAAC,iBAAiB,EAAG,IAAI,GAAG,MAAM,CAAC;IAE3C;;;;;OAKG;gBACS,QAAQ,CAAC,EAAE,UAAU,EAAE,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,EAAE,iBAAiB,CAAC,EAAE,IAAI,GAAG,MAAM;IAcnG,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB;IAO/C;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,EAAE,iBAAiB,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY;IAoBnH,mBAAmB,IAAI,OAAO;CAGjC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-pocket.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-pocket.js deleted file mode 100644 index b53a2d1a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-pocket.js +++ /dev/null @@ -1,109 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.PocketProvider = void 0; -/** - * [[link-pocket]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Polygon (``matic``) - * - Arbitrum (``arbitrum``) - * - * @_subsection: api/providers/thirdparty:Pocket [providers-pocket] - */ -const index_js_1 = require("../utils/index.js"); -const community_js_1 = require("./community.js"); -const network_js_1 = require("./network.js"); -const provider_jsonrpc_js_1 = require("./provider-jsonrpc.js"); -const defaultApplicationId = "62e1ad51b37b8e00394bda3b"; -function getHost(name) { - switch (name) { - case "mainnet": - return "eth-mainnet.gateway.pokt.network"; - case "goerli": - return "eth-goerli.gateway.pokt.network"; - case "matic": - return "poly-mainnet.gateway.pokt.network"; - case "matic-mumbai": - return "polygon-mumbai-rpc.gateway.pokt.network"; - } - (0, index_js_1.assertArgument)(false, "unsupported network", "network", name); -} -/** - * The **PocketProvider** connects to the [[link-pocket]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-pocket-signup). - */ -class PocketProvider extends provider_jsonrpc_js_1.JsonRpcProvider { - /** - * The Application ID for the Pocket connection. - */ - applicationId; - /** - * The Application Secret for making authenticated requests - * to the Pocket connection. - */ - applicationSecret; - /** - * Create a new **PocketProvider**. - * - * By default connecting to ``mainnet`` with a highly throttled - * API key. - */ - constructor(_network, applicationId, applicationSecret) { - if (_network == null) { - _network = "mainnet"; - } - const network = network_js_1.Network.from(_network); - if (applicationId == null) { - applicationId = defaultApplicationId; - } - if (applicationSecret == null) { - applicationSecret = null; - } - const options = { staticNetwork: network }; - const request = PocketProvider.getRequest(network, applicationId, applicationSecret); - super(request, network, options); - (0, index_js_1.defineProperties)(this, { applicationId, applicationSecret }); - } - _getProvider(chainId) { - try { - return new PocketProvider(chainId, this.applicationId, this.applicationSecret); - } - catch (error) { } - return super._getProvider(chainId); - } - /** - * Returns a prepared request for connecting to %%network%% with - * %%applicationId%%. - */ - static getRequest(network, applicationId, applicationSecret) { - if (applicationId == null) { - applicationId = defaultApplicationId; - } - const request = new index_js_1.FetchRequest(`https:/\/${getHost(network.name)}/v1/lb/${applicationId}`); - request.allowGzip = true; - if (applicationSecret) { - request.setCredentials("", applicationSecret); - } - if (applicationId === defaultApplicationId) { - request.retryFunc = async (request, response, attempt) => { - (0, community_js_1.showThrottleMessage)("PocketProvider"); - return true; - }; - } - return request; - } - isCommunityResource() { - return (this.applicationId === defaultApplicationId); - } -} -exports.PocketProvider = PocketProvider; -//# sourceMappingURL=provider-pocket.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-pocket.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-pocket.js.map deleted file mode 100644 index 0c515927..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-pocket.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-pocket.js","sourceRoot":"","sources":["../../src.ts/providers/provider-pocket.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;GAYG;AACH,gDAE2B;AAG3B,iDAAqD;AACrD,6CAAuC;AACvC,+DAAwD;AAKxD,MAAM,oBAAoB,GAAG,0BAA0B,CAAC;AAExD,SAAS,OAAO,CAAC,IAAY;IACzB,QAAQ,IAAI,EAAE;QACV,KAAK,SAAS;YACV,OAAQ,kCAAkC,CAAC;QAC/C,KAAK,QAAQ;YACT,OAAO,iCAAiC,CAAC;QAE7C,KAAK,OAAO;YACR,OAAO,mCAAmC,CAAC;QAC/C,KAAK,cAAc;YACf,OAAO,yCAAyC,CAAC;KACxD;IAED,IAAA,yBAAc,EAAC,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;AAClE,CAAC;AAGD;;;;;;;;GAQG;AACH,MAAa,cAAe,SAAQ,qCAAe;IAE/C;;OAEG;IACM,aAAa,CAAU;IAEhC;;;OAGG;IACM,iBAAiB,CAAiB;IAE3C;;;;;OAKG;IACH,YAAY,QAAqB,EAAE,aAA6B,EAAE,iBAAiC;QAC/F,IAAI,QAAQ,IAAI,IAAI,EAAE;YAAE,QAAQ,GAAG,SAAS,CAAC;SAAE;QAC/C,MAAM,OAAO,GAAG,oBAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvC,IAAI,aAAa,IAAI,IAAI,EAAE;YAAE,aAAa,GAAG,oBAAoB,CAAC;SAAE;QACpE,IAAI,iBAAiB,IAAI,IAAI,EAAE;YAAE,iBAAiB,GAAG,IAAI,CAAC;SAAE;QAE5D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IAAI,CAAC,aAAa,KAAK,oBAAoB,CAAC,CAAC;IACzD,CAAC;CACJ;AAnED,wCAmEC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-quicknode.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-quicknode.d.ts deleted file mode 100644 index 244ce2a9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-quicknode.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -/** - * [[link-quicknode]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Holesky Testnet (``holesky``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Arbitrum Sepolia Testnet (``arbitrum-sepolia``) - * - Base Mainnet (``base``); - * - Base Goerli Testnet (``base-goerli``); - * - Base Sepolia Testnet (``base-sepolia``); - * - BNB Smart Chain Mainnet (``bnb``) - * - BNB Smart Chain Testnet (``bnbt``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Optimism Sepolia Testnet (``optimism-sepolia``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:QuickNode [providers-quicknode] - */ -import { FetchRequest } from "../utils/index.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import type { AbstractProvider } from "./abstract-provider.js"; -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; -/** - * The **QuickNodeProvider** connects to the [[link-quicknode]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API token is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-quicknode). - */ -export declare class QuickNodeProvider extends JsonRpcProvider implements CommunityResourcable { - /** - * The API token. - */ - readonly token: string; - /** - * Creates a new **QuickNodeProvider**. - */ - constructor(_network?: Networkish, token?: null | string); - _getProvider(chainId: number): AbstractProvider; - isCommunityResource(): boolean; - /** - * Returns a new request prepared for %%network%% and the - * %%token%%. - */ - static getRequest(network: Network, token?: null | string): FetchRequest; -} -//# sourceMappingURL=provider-quicknode.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-quicknode.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-quicknode.d.ts.map deleted file mode 100644 index 1078f183..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-quicknode.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-quicknode.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-quicknode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EACe,YAAY,EACjC,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA+E/C;;;;;;;;GAQG;AACH,qBAAa,iBAAkB,SAAQ,eAAgB,YAAW,oBAAoB;IAClF;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAG,MAAM,CAAC;IAExB;;OAEG;gBACS,QAAQ,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM;IAWxD,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB;IAO/C,mBAAmB,IAAI,OAAO;IAI9B;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY;CAgB3E"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-quicknode.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-quicknode.js deleted file mode 100644 index bbc9a05b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-quicknode.js +++ /dev/null @@ -1,163 +0,0 @@ -"use strict"; -/** - * [[link-quicknode]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Holesky Testnet (``holesky``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Arbitrum Sepolia Testnet (``arbitrum-sepolia``) - * - Base Mainnet (``base``); - * - Base Goerli Testnet (``base-goerli``); - * - Base Sepolia Testnet (``base-sepolia``); - * - BNB Smart Chain Mainnet (``bnb``) - * - BNB Smart Chain Testnet (``bnbt``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Optimism Sepolia Testnet (``optimism-sepolia``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:QuickNode [providers-quicknode] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.QuickNodeProvider = void 0; -const index_js_1 = require("../utils/index.js"); -const community_js_1 = require("./community.js"); -const network_js_1 = require("./network.js"); -const provider_jsonrpc_js_1 = require("./provider-jsonrpc.js"); -const defaultToken = "919b412a057b5e9c9b6dce193c5a60242d6efadb"; -function getHost(name) { - switch (name) { - case "mainnet": - return "ethers.quiknode.pro"; - case "goerli": - return "ethers.ethereum-goerli.quiknode.pro"; - case "sepolia": - return "ethers.ethereum-sepolia.quiknode.pro"; - case "holesky": - return "ethers.ethereum-holesky.quiknode.pro"; - case "arbitrum": - return "ethers.arbitrum-mainnet.quiknode.pro"; - case "arbitrum-goerli": - return "ethers.arbitrum-goerli.quiknode.pro"; - case "arbitrum-sepolia": - return "ethers.arbitrum-sepolia.quiknode.pro"; - case "base": - return "ethers.base-mainnet.quiknode.pro"; - case "base-goerli": - return "ethers.base-goerli.quiknode.pro"; - case "base-spolia": - return "ethers.base-sepolia.quiknode.pro"; - case "bnb": - return "ethers.bsc.quiknode.pro"; - case "bnbt": - return "ethers.bsc-testnet.quiknode.pro"; - case "matic": - return "ethers.matic.quiknode.pro"; - case "matic-mumbai": - return "ethers.matic-testnet.quiknode.pro"; - case "optimism": - return "ethers.optimism.quiknode.pro"; - case "optimism-goerli": - return "ethers.optimism-goerli.quiknode.pro"; - case "optimism-sepolia": - return "ethers.optimism-sepolia.quiknode.pro"; - case "xdai": - return "ethers.xdai.quiknode.pro"; - } - (0, index_js_1.assertArgument)(false, "unsupported network", "network", name); -} -/* -@TODO: - These networks are not currently present in the Network - default included networks. Research them and ensure they - are EVM compatible and work with ethers - - http://ethers.matic-amoy.quiknode.pro - - http://ethers.avalanche-mainnet.quiknode.pro - http://ethers.avalanche-testnet.quiknode.pro - http://ethers.blast-sepolia.quiknode.pro - http://ethers.celo-mainnet.quiknode.pro - http://ethers.fantom.quiknode.pro - http://ethers.imx-demo.quiknode.pro - http://ethers.imx-mainnet.quiknode.pro - http://ethers.imx-testnet.quiknode.pro - http://ethers.near-mainnet.quiknode.pro - http://ethers.near-testnet.quiknode.pro - http://ethers.nova-mainnet.quiknode.pro - http://ethers.scroll-mainnet.quiknode.pro - http://ethers.scroll-testnet.quiknode.pro - http://ethers.tron-mainnet.quiknode.pro - http://ethers.zkevm-mainnet.quiknode.pro - http://ethers.zkevm-testnet.quiknode.pro - http://ethers.zksync-mainnet.quiknode.pro - http://ethers.zksync-testnet.quiknode.pro -*/ -/** - * The **QuickNodeProvider** connects to the [[link-quicknode]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API token is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-quicknode). - */ -class QuickNodeProvider extends provider_jsonrpc_js_1.JsonRpcProvider { - /** - * The API token. - */ - token; - /** - * Creates a new **QuickNodeProvider**. - */ - constructor(_network, token) { - if (_network == null) { - _network = "mainnet"; - } - const network = network_js_1.Network.from(_network); - if (token == null) { - token = defaultToken; - } - const request = QuickNodeProvider.getRequest(network, token); - super(request, network, { staticNetwork: network }); - (0, index_js_1.defineProperties)(this, { token }); - } - _getProvider(chainId) { - try { - return new QuickNodeProvider(chainId, this.token); - } - catch (error) { } - return super._getProvider(chainId); - } - isCommunityResource() { - return (this.token === defaultToken); - } - /** - * Returns a new request prepared for %%network%% and the - * %%token%%. - */ - static getRequest(network, token) { - if (token == null) { - token = defaultToken; - } - const request = new index_js_1.FetchRequest(`https:/\/${getHost(network.name)}/${token}`); - request.allowGzip = true; - //if (projectSecret) { request.setCredentials("", projectSecret); } - if (token === defaultToken) { - request.retryFunc = async (request, response, attempt) => { - (0, community_js_1.showThrottleMessage)("QuickNodeProvider"); - return true; - }; - } - return request; - } -} -exports.QuickNodeProvider = QuickNodeProvider; -//# sourceMappingURL=provider-quicknode.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-quicknode.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-quicknode.js.map deleted file mode 100644 index 00e244d8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-quicknode.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-quicknode.js","sourceRoot":"","sources":["../../src.ts/providers/provider-quicknode.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;;;AAEH,gDAE2B;AAE3B,iDAAqD;AACrD,6CAAuC;AACvC,+DAAwD;AAOxD,MAAM,YAAY,GAAG,0C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J;AAnDD,8CAmDC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-socket.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-socket.d.ts deleted file mode 100644 index 41c58fc0..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-socket.d.ts +++ /dev/null @@ -1,113 +0,0 @@ -/** - * Generic long-lived socket provider. - * - * Sub-classing notes - * - a sub-class MUST call the `_start()` method once connected - * - a sub-class MUST override the `_write(string)` method - * - a sub-class MUST call `_processMessage(string)` for each message - * - * @_subsection: api/providers/abstract-provider:Socket Providers [about-socketProvider] - */ -import { JsonRpcApiProvider } from "./provider-jsonrpc.js"; -import type { Subscriber, Subscription } from "./abstract-provider.js"; -import type { EventFilter } from "./provider.js"; -import type { JsonRpcApiProviderOptions, JsonRpcError, JsonRpcPayload, JsonRpcResult } from "./provider-jsonrpc.js"; -import type { Networkish } from "./network.js"; -/** - * A **SocketSubscriber** uses a socket transport to handle events and - * should use [[_emit]] to manage the events. - */ -export declare class SocketSubscriber implements Subscriber { - #private; - /** - * The filter. - */ - get filter(): Array; - /** - * Creates a new **SocketSubscriber** attached to %%provider%% listening - * to %%filter%%. - */ - constructor(provider: SocketProvider, filter: Array); - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; - /** - * @_ignore: - */ - _handleMessage(message: any): void; - /** - * Sub-classes **must** override this to emit the events on the - * provider. - */ - _emit(provider: SocketProvider, message: any): Promise; -} -/** - * A **SocketBlockSubscriber** listens for ``newHeads`` events and emits - * ``"block"`` events. - */ -export declare class SocketBlockSubscriber extends SocketSubscriber { - /** - * @_ignore: - */ - constructor(provider: SocketProvider); - _emit(provider: SocketProvider, message: any): Promise; -} -/** - * A **SocketPendingSubscriber** listens for pending transacitons and emits - * ``"pending"`` events. - */ -export declare class SocketPendingSubscriber extends SocketSubscriber { - /** - * @_ignore: - */ - constructor(provider: SocketProvider); - _emit(provider: SocketProvider, message: any): Promise; -} -/** - * A **SocketEventSubscriber** listens for event logs. - */ -export declare class SocketEventSubscriber extends SocketSubscriber { - #private; - /** - * The filter. - */ - get logFilter(): EventFilter; - /** - * @_ignore: - */ - constructor(provider: SocketProvider, filter: EventFilter); - _emit(provider: SocketProvider, message: any): Promise; -} -/** - * A **SocketProvider** is backed by a long-lived connection over a - * socket, which can subscribe and receive real-time messages over - * its communication channel. - */ -export declare class SocketProvider extends JsonRpcApiProvider { - #private; - /** - * Creates a new **SocketProvider** connected to %%network%%. - * - * If unspecified, the network will be discovered. - */ - constructor(network?: Networkish, _options?: JsonRpcApiProviderOptions); - _getSubscriber(sub: Subscription): Subscriber; - /** - * Register a new subscriber. This is used internalled by Subscribers - * and generally is unecessary unless extending capabilities. - */ - _register(filterId: number | string, subscriber: SocketSubscriber): void; - _send(payload: JsonRpcPayload | Array): Promise>; - /** - * Sub-classes **must** call this with messages received over their - * transport to be processed and dispatched. - */ - _processMessage(message: string): Promise; - /** - * Sub-classes **must** override this to send %%message%% over their - * transport. - */ - _write(message: string): Promise; -} -//# sourceMappingURL=provider-socket.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-socket.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-socket.d.ts.map deleted file mode 100644 index 6748e7c2..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-socket.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-socket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-socket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EACR,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,GAAG,OAAO,CAAC,IAAI,CAAC;CAGrE;AAED;;;;GAIG;AACH,qBAAa,cAAe,SAAQ,kBAAkB;;IAUlD;;;;OAIG;gBACS,OAAO,CAAC,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,yBAAyB;IAgCtE,cAAc,CAAC,GAAG,EAAE,YAAY,GAAG,UAAU;IAoB7C;;;OAGG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,UAAU,EAAE,gBAAgB,GAAG,IAAI;IAWlE,KAAK,CAAC,OAAO,EAAE,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,aAAa,GAAG,YAAY,CAAC,CAAC;IAmC1G;;;OAGG;IACG,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAuCrD;;;OAGG;IACG,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAG/C"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-socket.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-socket.js deleted file mode 100644 index 37323dd7..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-socket.js +++ /dev/null @@ -1,309 +0,0 @@ -"use strict"; -/** - * Generic long-lived socket provider. - * - * Sub-classing notes - * - a sub-class MUST call the `_start()` method once connected - * - a sub-class MUST override the `_write(string)` method - * - a sub-class MUST call `_processMessage(string)` for each message - * - * @_subsection: api/providers/abstract-provider:Socket Providers [about-socketProvider] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.SocketProvider = exports.SocketEventSubscriber = exports.SocketPendingSubscriber = exports.SocketBlockSubscriber = exports.SocketSubscriber = void 0; -const abstract_provider_js_1 = require("./abstract-provider.js"); -const index_js_1 = require("../utils/index.js"); -const provider_jsonrpc_js_1 = require("./provider-jsonrpc.js"); -/** - * A **SocketSubscriber** uses a socket transport to handle events and - * should use [[_emit]] to manage the events. - */ -class SocketSubscriber { - #provider; - #filter; - /** - * The filter. - */ - get filter() { return JSON.parse(this.#filter); } - #filterId; - #paused; - #emitPromise; - /** - * Creates a new **SocketSubscriber** attached to %%provider%% listening - * to %%filter%%. - */ - constructor(provider, filter) { - this.#provider = provider; - this.#filter = JSON.stringify(filter); - this.#filterId = null; - this.#paused = null; - this.#emitPromise = null; - } - start() { - this.#filterId = this.#provider.send("eth_subscribe", this.filter).then((filterId) => { - ; - this.#provider._register(filterId, this); - return filterId; - }); - } - stop() { - (this.#filterId).then((filterId) => { - if (this.#provider.destroyed) { - return; - } - this.#provider.send("eth_unsubscribe", [filterId]); - }); - this.#filterId = null; - } - // @TODO: pause should trap the current blockNumber, unsub, and on resume use getLogs - // and resume - pause(dropWhilePaused) { - (0, index_js_1.assert)(dropWhilePaused, "preserve logs while paused not supported by SocketSubscriber yet", "UNSUPPORTED_OPERATION", { operation: "pause(false)" }); - this.#paused = !!dropWhilePaused; - } - resume() { - this.#paused = null; - } - /** - * @_ignore: - */ - _handleMessage(message) { - if (this.#filterId == null) { - return; - } - if (this.#paused === null) { - let emitPromise = this.#emitPromise; - if (emitPromise == null) { - emitPromise = this._emit(this.#provider, message); - } - else { - emitPromise = emitPromise.then(async () => { - await this._emit(this.#provider, message); - }); - } - this.#emitPromise = emitPromise.then(() => { - if (this.#emitPromise === emitPromise) { - this.#emitPromise = null; - } - }); - } - } - /** - * Sub-classes **must** override this to emit the events on the - * provider. - */ - async _emit(provider, message) { - throw new Error("sub-classes must implemente this; _emit"); - } -} -exports.SocketSubscriber = SocketSubscriber; -/** - * A **SocketBlockSubscriber** listens for ``newHeads`` events and emits - * ``"block"`` events. - */ -class SocketBlockSubscriber extends SocketSubscriber { - /** - * @_ignore: - */ - constructor(provider) { - super(provider, ["newHeads"]); - } - async _emit(provider, message) { - provider.emit("block", parseInt(message.number)); - } -} -exports.SocketBlockSubscriber = SocketBlockSubscriber; -/** - * A **SocketPendingSubscriber** listens for pending transacitons and emits - * ``"pending"`` events. - */ -class SocketPendingSubscriber extends SocketSubscriber { - /** - * @_ignore: - */ - constructor(provider) { - super(provider, ["newPendingTransactions"]); - } - async _emit(provider, message) { - provider.emit("pending", message); - } -} -exports.SocketPendingSubscriber = SocketPendingSubscriber; -/** - * A **SocketEventSubscriber** listens for event logs. - */ -class SocketEventSubscriber extends SocketSubscriber { - #logFilter; - /** - * The filter. - */ - get logFilter() { return JSON.parse(this.#logFilter); } - /** - * @_ignore: - */ - constructor(provider, filter) { - super(provider, ["logs", filter]); - this.#logFilter = JSON.stringify(filter); - } - async _emit(provider, message) { - provider.emit(this.logFilter, provider._wrapLog(message, provider._network)); - } -} -exports.SocketEventSubscriber = SocketEventSubscriber; -/** - * A **SocketProvider** is backed by a long-lived connection over a - * socket, which can subscribe and receive real-time messages over - * its communication channel. - */ -class SocketProvider extends provider_jsonrpc_js_1.JsonRpcApiProvider { - #callbacks; - // Maps each filterId to its subscriber - #subs; - // If any events come in before a subscriber has finished - // registering, queue them - #pending; - /** - * Creates a new **SocketProvider** connected to %%network%%. - * - * If unspecified, the network will be discovered. - */ - constructor(network, _options) { - // Copy the options - const options = Object.assign({}, (_options != null) ? _options : {}); - // Support for batches is generally not supported for - // connection-base providers; if this changes in the future - // the _send should be updated to reflect this - (0, index_js_1.assertArgument)(options.batchMaxCount == null || options.batchMaxCount === 1, "sockets-based providers do not support batches", "options.batchMaxCount", _options); - options.batchMaxCount = 1; - // Socket-based Providers (generally) cannot change their network, - // since they have a long-lived connection; but let people override - // this if they have just cause. - if (options.staticNetwork == null) { - options.staticNetwork = true; - } - super(network, options); - this.#callbacks = new Map(); - this.#subs = new Map(); - this.#pending = new Map(); - } - // This value is only valid after _start has been called - /* - get _network(): Network { - if (this.#network == null) { - throw new Error("this shouldn't happen"); - } - return this.#network.clone(); - } - */ - _getSubscriber(sub) { - switch (sub.type) { - case "close": - return new abstract_provider_js_1.UnmanagedSubscriber("close"); - case "block": - return new SocketBlockSubscriber(this); - case "pending": - return new SocketPendingSubscriber(this); - case "event": - return new SocketEventSubscriber(this, sub.filter); - case "orphan": - // Handled auto-matically within AbstractProvider - // when the log.removed = true - if (sub.filter.orphan === "drop-log") { - return new abstract_provider_js_1.UnmanagedSubscriber("drop-log"); - } - } - return super._getSubscriber(sub); - } - /** - * Register a new subscriber. This is used internalled by Subscribers - * and generally is unecessary unless extending capabilities. - */ - _register(filterId, subscriber) { - this.#subs.set(filterId, subscriber); - const pending = this.#pending.get(filterId); - if (pending) { - for (const message of pending) { - subscriber._handleMessage(message); - } - this.#pending.delete(filterId); - } - } - async _send(payload) { - // WebSocket provider doesn't accept batches - (0, index_js_1.assertArgument)(!Array.isArray(payload), "WebSocket does not support batch send", "payload", payload); - // @TODO: stringify payloads here and store to prevent mutations - // Prepare a promise to respond to - const promise = new Promise((resolve, reject) => { - this.#callbacks.set(payload.id, { payload, resolve, reject }); - }); - // Wait until the socket is connected before writing to it - await this._waitUntilReady(); - // Write the request to the socket - await this._write(JSON.stringify(payload)); - return [await promise]; - } - // Sub-classes must call this once they are connected - /* - async _start(): Promise { - if (this.#ready) { return; } - - for (const { payload } of this.#callbacks.values()) { - await this._write(JSON.stringify(payload)); - } - - this.#ready = (async function() { - await super._start(); - })(); - } - */ - /** - * Sub-classes **must** call this with messages received over their - * transport to be processed and dispatched. - */ - async _processMessage(message) { - const result = (JSON.parse(message)); - if (result && typeof (result) === "object" && "id" in result) { - const callback = this.#callbacks.get(result.id); - if (callback == null) { - this.emit("error", (0, index_js_1.makeError)("received result for unknown id", "UNKNOWN_ERROR", { - reasonCode: "UNKNOWN_ID", - result - })); - return; - } - this.#callbacks.delete(result.id); - callback.resolve(result); - } - else if (result && result.method === "eth_subscription") { - const filterId = result.params.subscription; - const subscriber = this.#subs.get(filterId); - if (subscriber) { - subscriber._handleMessage(result.params.result); - } - else { - let pending = this.#pending.get(filterId); - if (pending == null) { - pending = []; - this.#pending.set(filterId, pending); - } - pending.push(result.params.result); - } - } - else { - this.emit("error", (0, index_js_1.makeError)("received unexpected message", "UNKNOWN_ERROR", { - reasonCode: "UNEXPECTED_MESSAGE", - result - })); - return; - } - } - /** - * Sub-classes **must** override this to send %%message%% over their - * transport. - */ - async _write(message) { - throw new Error("sub-classes must override this"); - } -} -exports.SocketProvider = SocketProvider; -//# sourceMappingURL=provider-socket.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-socket.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-socket.js.map deleted file mode 100644 index 6aa6aa4e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-socket.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-socket.js","sourceRoot":"","sources":["../../src.ts/providers/provider-socket.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAEH,iEAA6D;AAC7D,gDAAsE;AACtE,+DAA2D;AAkB3D;;;GAGG;AACH,MAAa,gBAAgB;IACzB,SAAS,CAAiB;IAE1B,OAAO,CAAS;IAEhB;;OAEG;IACH,IAAI,MAAM,KAAiB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAE7D,SAAS,CAAiC;IAC1C,OAAO,CAAiB;IAExB,YAAY,CAAuB;IAEnC;;;OAGG;IACH,YAAY,QAAwB,EAAE,MAAkB;QACpD,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACtC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;IAC7B,CAAC;IAED,KAAK;QACD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,e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,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YAElC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;SAE5B;aAAM,IAAI,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,kBAAkB,EAAE;YACvD,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;YAC5C,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YAC5C,IAAI,UAAU,EAAE;gBACZ,UAAU,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;aACnD;iBAAM;gBACH,IAAI,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;gBAC1C,IAAI,OAAO,IAAI,IAAI,EAAE;oBACjB,OAAO,GAAG,EAAG,CAAC;oBACd,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;iBACxC;gBACD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;aACtC;SAEJ;aAAM;YACH,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAA,oBAAS,EAAC,6BAA6B,EAAE,eAAe,EAAE;gBACzE,UAAU,EAAE,oBAAoB;gBAChC,MAAM;aACT,CAAC,CAAC,CAAC;YACJ,OAAO;SACV;IACL,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,MAAM,CAAC,OAAe;QACxB,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACtD,CAAC;CACJ;AAvKD,wCAuKC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-websocket.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-websocket.d.ts deleted file mode 100644 index b34c9842..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-websocket.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { SocketProvider } from "./provider-socket.js"; -import type { JsonRpcApiProviderOptions } from "./provider-jsonrpc.js"; -import type { Networkish } from "./network.js"; -/** - * A generic interface to a Websocket-like object. - */ -export interface WebSocketLike { - onopen: null | ((...args: Array) => any); - onmessage: null | ((...args: Array) => any); - onerror: null | ((...args: Array) => any); - readyState: number; - send(payload: any): void; - close(code?: number, reason?: string): void; -} -/** - * A function which can be used to re-create a WebSocket connection - * on disconnect. - */ -export type WebSocketCreator = () => WebSocketLike; -/** - * A JSON-RPC provider which is backed by a WebSocket. - * - * WebSockets are often preferred because they retain a live connection - * to a server, which permits more instant access to events. - * - * However, this incurs higher server infrasturture costs, so additional - * resources may be required to host your own WebSocket nodes and many - * third-party services charge additional fees for WebSocket endpoints. - */ -export declare class WebSocketProvider extends SocketProvider { - #private; - get websocket(): WebSocketLike; - constructor(url: string | WebSocketLike | WebSocketCreator, network?: Networkish, options?: JsonRpcApiProviderOptions); - _write(message: string): Promise; - destroy(): Promise; -} -//# sourceMappingURL=provider-websocket.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-websocket.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-websocket.d.ts.map deleted file mode 100644 index 886b1976..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-websocket.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-websocket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-websocket.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,yBAAyB,EAAC,MAAM,uBAAuB,CAAC;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B,MAAM,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;IAC9C,SAAS,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;IACjD,OAAO,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;IAE/C,UAAU,EAAE,MAAM,CAAC;IAEnB,IAAI,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI,CAAC;IACzB,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/C;AAED;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,aAAa,CAAC;AAEnD;;;;;;;;;GASG;AACH,qBAAa,iBAAkB,SAAQ,cAAc;;IAIjD,IAAI,SAAS,IAAI,aAAa,CAG7B;gBAEW,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,gBAAgB,EAAE,OAAO,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,yBAAyB;IA2C/G,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAItC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAOjC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-websocket.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-websocket.js deleted file mode 100644 index 5d46ed3e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-websocket.js +++ /dev/null @@ -1,80 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.WebSocketProvider = void 0; -const ws_js_1 = require("./ws.js"); /*-browser*/ -const provider_socket_js_1 = require("./provider-socket.js"); -/** - * A JSON-RPC provider which is backed by a WebSocket. - * - * WebSockets are often preferred because they retain a live connection - * to a server, which permits more instant access to events. - * - * However, this incurs higher server infrasturture costs, so additional - * resources may be required to host your own WebSocket nodes and many - * third-party services charge additional fees for WebSocket endpoints. - */ -class WebSocketProvider extends provider_socket_js_1.SocketProvider { - #connect; - #websocket; - get websocket() { - if (this.#websocket == null) { - throw new Error("websocket closed"); - } - return this.#websocket; - } - constructor(url, network, options) { - super(network, options); - if (typeof (url) === "string") { - this.#connect = () => { return new ws_js_1.WebSocket(url); }; - this.#websocket = this.#connect(); - } - else if (typeof (url) === "function") { - this.#connect = url; - this.#websocket = url(); - } - else { - this.#connect = null; - this.#websocket = url; - } - this.websocket.onopen = async () => { - try { - await this._start(); - this.resume(); - } - catch (error) { - console.log("failed to start WebsocketProvider", error); - // @TODO: now what? Attempt reconnect? - } - }; - this.websocket.onmessage = (message) => { - this._processMessage(message.data); - }; - /* - this.websocket.onclose = (event) => { - // @TODO: What event.code should we reconnect on? - const reconnect = false; - if (reconnect) { - this.pause(true); - if (this.#connect) { - this.#websocket = this.#connect(); - this.#websocket.onopen = ... - // @TODO: this requires the super class to rebroadcast; move it there - } - this._reconnect(); - } - }; - */ - } - async _write(message) { - this.websocket.send(message); - } - async destroy() { - if (this.#websocket != null) { - this.#websocket.close(); - this.#websocket = null; - } - super.destroy(); - } -} -exports.WebSocketProvider = WebSocketProvider; -//# sourceMappingURL=provider-websocket.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-websocket.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-websocket.js.map deleted file mode 100644 index 779b65f0..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider-websocket.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-websocket.js","sourceRoot":"","sources":["../../src.ts/providers/provider-websocket.ts"],"names":[],"mappings":";;;AAEA,mCAAkD,CAAC,YAAY;AAE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AAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACvC,CAAC,CAAC;QACV;;;;;;;;;;;;;;UAcE;IACE,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,OAAe;QACxB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACjC,CAAC;IAED,KAAK,CAAC,OAAO;QACT,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,EAAE;YACzB,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;YACxB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;SAC1B;QACD,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;CACJ;AA/DD,8CA+DC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider.d.ts deleted file mode 100644 index 6443dbc3..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider.d.ts +++ /dev/null @@ -1,1230 +0,0 @@ -import type { AddressLike, NameResolver } from "../address/index.js"; -import type { BigNumberish, EventEmitterable } from "../utils/index.js"; -import type { Signature } from "../crypto/index.js"; -import type { AccessList, AccessListish, Authorization, AuthorizationLike, BlobLike, KzgLibraryLike, TransactionLike } from "../transaction/index.js"; -import type { ContractRunner } from "./contracts.js"; -import type { Network } from "./network.js"; -/** - * A **BlockTag** specifies a specific block. - * - * **numeric value** - specifies the block height, where - * the genesis block is block 0; many operations accept a negative - * value which indicates the block number should be deducted from - * the most recent block. A numeric value may be a ``number``, ``bigint``, - * or a decimal of hex string. - * - * **blockhash** - specifies a specific block by its blockhash; this allows - * potentially orphaned blocks to be specifed, without ambiguity, but many - * backends do not support this for some operations. - */ -export type BlockTag = BigNumberish | string; -import { BlockParams, LogParams, TransactionReceiptParams, TransactionResponseParams } from "./formatting.js"; -/** - * A **FeeData** wraps all the fee-related values associated with - * the network. - */ -export declare class FeeData { - /** - * The gas price for legacy networks. - */ - readonly gasPrice: null | bigint; - /** - * The maximum fee to pay per gas. - * - * The base fee per gas is defined by the network and based on - * congestion, increasing the cost during times of heavy load - * and lowering when less busy. - * - * The actual fee per gas will be the base fee for the block - * and the priority fee, up to the max fee per gas. - * - * This will be ``null`` on legacy networks (i.e. [pre-EIP-1559](link-eip-1559)) - */ - readonly maxFeePerGas: null | bigint; - /** - * The additional amout to pay per gas to encourage a validator - * to include the transaction. - * - * The purpose of this is to compensate the validator for the - * adjusted risk for including a given transaction. - * - * This will be ``null`` on legacy networks (i.e. [pre-EIP-1559](link-eip-1559)) - */ - readonly maxPriorityFeePerGas: null | bigint; - /** - * Creates a new FeeData for %%gasPrice%%, %%maxFeePerGas%% and - * %%maxPriorityFeePerGas%%. - */ - constructor(gasPrice?: null | bigint, maxFeePerGas?: null | bigint, maxPriorityFeePerGas?: null | bigint); - /** - * Returns a JSON-friendly value. - */ - toJSON(): any; -} -/** - * A **TransactionRequest** is a transactions with potentially various - * properties not defined, or with less strict types for its values. - * - * This is used to pass to various operations, which will internally - * coerce any types and populate any necessary values. - */ -export interface TransactionRequest { - /** - * The transaction type. - */ - type?: null | number; - /** - * The target of the transaction. - */ - to?: null | AddressLike; - /** - * The sender of the transaction. - */ - from?: null | AddressLike; - /** - * The nonce of the transaction, used to prevent replay attacks. - */ - nonce?: null | number; - /** - * The maximum amount of gas to allow this transaction to consume. - */ - gasLimit?: null | BigNumberish; - /** - * The gas price to use for legacy transactions or transactions on - * legacy networks. - * - * Most of the time the ``max*FeePerGas`` is preferred. - */ - gasPrice?: null | BigNumberish; - /** - * The [[link-eip-1559]] maximum priority fee to pay per gas. - */ - maxPriorityFeePerGas?: null | BigNumberish; - /** - * The [[link-eip-1559]] maximum total fee to pay per gas. The actual - * value used is protocol enforced to be the block's base fee. - */ - maxFeePerGas?: null | BigNumberish; - /** - * The transaction data. - */ - data?: null | string; - /** - * The transaction value (in wei). - */ - value?: null | BigNumberish; - /** - * The chain ID for the network this transaction is valid on. - */ - chainId?: null | BigNumberish; - /** - * The [[link-eip-2930]] access list. Storage slots included in the access - * list are //warmed// by pre-loading them, so their initial cost to - * fetch is guaranteed, but then each additional access is cheaper. - */ - accessList?: null | AccessListish; - /** - * A custom object, which can be passed along for network-specific - * values. - */ - customData?: any; - /** - * When using ``call`` or ``estimateGas``, this allows a specific - * block to be queried. Many backends do not support this and when - * unsupported errors are silently squelched and ``"latest"`` is used. - */ - blockTag?: BlockTag; - /** - * When using ``call``, this enables CCIP-read, which permits the - * provider to be redirected to web-based content during execution, - * which is then further validated by the contract. - * - * There are potential security implications allowing CCIP-read, as - * it could be used to expose the IP address or user activity during - * the fetch to unexpected parties. - */ - enableCcipRead?: boolean; - /** - * The blob versioned hashes (see [[link-eip-4844]]). - */ - blobVersionedHashes?: null | Array; - /** - * The maximum fee per blob gas (see [[link-eip-4844]]). - */ - maxFeePerBlobGas?: null | BigNumberish; - /** - * Any blobs to include in the transaction (see [[link-eip-4844]]). - */ - blobs?: null | Array; - /** - * An external library for computing the KZG commitments and - * proofs necessary for EIP-4844 transactions (see [[link-eip-4844]]). - * - * This is generally ``null``, unless you are creating BLOb - * transactions. - */ - kzg?: null | KzgLibraryLike; - /** - * The [[link-eip-7594]] BLOb Wrapper Version used for PeerDAS. - * - * For networks that use EIP-7594, this property is required to - * serialize the sidecar correctly. - */ - blobWrapperVersion?: null | number; - /** - * The [[link-eip-7702]] authorizations (if any). - */ - authorizationList?: null | Array; -} -/** - * A **PreparedTransactionRequest** is identical to a [[TransactionRequest]] - * except all the property types are strictly enforced. - */ -export interface PreparedTransactionRequest { - /** - * The transaction type. - */ - type?: number; - /** - * The target of the transaction. - */ - to?: AddressLike; - /** - * The sender of the transaction. - */ - from?: AddressLike; - /** - * The nonce of the transaction, used to prevent replay attacks. - */ - nonce?: number; - /** - * The maximum amount of gas to allow this transaction to consume. - */ - gasLimit?: bigint; - /** - * The gas price to use for legacy transactions or transactions on - * legacy networks. - * - * Most of the time the ``max*FeePerGas`` is preferred. - */ - gasPrice?: bigint; - /** - * The [[link-eip-1559]] maximum priority fee to pay per gas. - */ - maxPriorityFeePerGas?: bigint; - /** - * The [[link-eip-1559]] maximum total fee to pay per gas. The actual - * value used is protocol enforced to be the block's base fee. - */ - maxFeePerGas?: bigint; - /** - * The transaction data. - */ - data?: string; - /** - * The transaction value (in wei). - */ - value?: bigint; - /** - * The chain ID for the network this transaction is valid on. - */ - chainId?: bigint; - /** - * The [[link-eip-2930]] access list. Storage slots included in the access - * list are //warmed// by pre-loading them, so their initial cost to - * fetch is guaranteed, but then each additional access is cheaper. - */ - accessList?: AccessList; - /** - * The [[link-eip-7702]] authorizations (if any). - */ - authorizationList?: Array; - /** - * A custom object, which can be passed along for network-specific - * values. - */ - customData?: any; - /** - * When using ``call`` or ``estimateGas``, this allows a specific - * block to be queried. Many backends do not support this and when - * unsupported errors are silently squelched and ``"latest"`` is used. - */ - blockTag?: BlockTag; - /** - * When using ``call``, this enables CCIP-read, which permits the - * provider to be redirected to web-based content during execution, - * which is then further validated by the contract. - * - * There are potential security implications allowing CCIP-read, as - * it could be used to expose the IP address or user activity during - * the fetch to unexpected parties. - */ - enableCcipRead?: boolean; -} -/** - * Returns a copy of %%req%% with all properties coerced to their strict - * types. - */ -export declare function copyRequest(req: TransactionRequest): PreparedTransactionRequest; -/** - * An Interface to indicate a [[Block]] has been included in the - * blockchain. This asserts a Type Guard that necessary properties - * are non-null. - * - * Before a block is included, it is a //pending// block. - */ -export interface MinedBlock extends Block { - /** - * The block number also known as the block height. - */ - readonly number: number; - /** - * The block hash. - */ - readonly hash: string; - /** - * The block timestamp, in seconds from epoch. - */ - readonly timestamp: number; - /** - * The block date, created from the [[timestamp]]. - */ - readonly date: Date; - /** - * The miner of the block, also known as the ``author`` or - * block ``producer``. - */ - readonly miner: string; -} -/** - * A **Block** represents the data associated with a full block on - * Ethereum. - */ -export declare class Block implements BlockParams, Iterable { - #private; - /** - * The provider connected to the block used to fetch additional details - * if necessary. - */ - readonly provider: Provider; - /** - * The block number, sometimes called the block height. This is a - * sequential number that is one higher than the parent block. - */ - readonly number: number; - /** - * The block hash. - * - * This hash includes all properties, so can be safely used to identify - * an exact set of block properties. - */ - readonly hash: null | string; - /** - * The timestamp for this block, which is the number of seconds since - * epoch that this block was included. - */ - readonly timestamp: number; - /** - * The block hash of the parent block. - */ - readonly parentHash: string; - /** - * The hash tree root of the parent beacon block for the given - * execution block. See [[link-eip-4788]]. - */ - parentBeaconBlockRoot: null | string; - /** - * The nonce. - * - * On legacy networks, this is the random number inserted which - * permitted the difficulty target to be reached. - */ - readonly nonce: string; - /** - * The difficulty target. - * - * On legacy networks, this is the proof-of-work target required - * for a block to meet the protocol rules to be included. - * - * On modern networks, this is a random number arrived at using - * randao. @TODO: Find links? - */ - readonly difficulty: bigint; - /** - * The total gas limit for this block. - */ - readonly gasLimit: bigint; - /** - * The total gas used in this block. - */ - readonly gasUsed: bigint; - /** - * The root hash for the global state after applying changes - * in this block. - */ - readonly stateRoot: null | string; - /** - * The hash of the transaction receipts trie. - */ - readonly receiptsRoot: null | string; - /** - * The total amount of blob gas consumed by the transactions - * within the block. See [[link-eip-4844]]. - */ - readonly blobGasUsed: null | bigint; - /** - * The running total of blob gas consumed in excess of the - * target, prior to the block. See [[link-eip-4844]]. - */ - readonly excessBlobGas: null | bigint; - /** - * The miner coinbase address, wihch receives any subsidies for - * including this block. - */ - readonly miner: string; - /** - * The latest RANDAO mix of the post beacon state of - * the previous block. - */ - readonly prevRandao: null | string; - /** - * Any extra data the validator wished to include. - */ - readonly extraData: string; - /** - * The base fee per gas that all transactions in this block were - * charged. - * - * This adjusts after each block, depending on how congested the network - * is. - */ - readonly baseFeePerGas: null | bigint; - /** - * Create a new **Block** object. - * - * This should generally not be necessary as the unless implementing a - * low-level library. - */ - constructor(block: BlockParams, provider: Provider); - /** - * Returns the list of transaction hashes, in the order - * they were executed within the block. - */ - get transactions(): ReadonlyArray; - /** - * Returns the complete transactions, in the order they - * were executed within the block. - * - * This is only available for blocks which prefetched - * transactions, by passing ``true`` to %%prefetchTxs%% - * into [[Provider-getBlock]]. - */ - get prefetchedTransactions(): Array; - /** - * Returns a JSON-friendly value. - */ - toJSON(): any; - [Symbol.iterator](): Iterator; - /** - * The number of transactions in this block. - */ - get length(): number; - /** - * The [[link-js-date]] this block was included at. - */ - get date(): null | Date; - /** - * Get the transaction at %%indexe%% within this block. - */ - getTransaction(indexOrHash: number | string): Promise; - /** - * If a **Block** was fetched with a request to include the transactions - * this will allow synchronous access to those transactions. - * - * If the transactions were not prefetched, this will throw. - */ - getPrefetchedTransaction(indexOrHash: number | string): TransactionResponse; - /** - * Returns true if this block been mined. This provides a type guard - * for all properties on a [[MinedBlock]]. - */ - isMined(): this is MinedBlock; - /** - * Returns true if this block is an [[link-eip-2930]] block. - */ - isLondon(): this is (Block & { - baseFeePerGas: bigint; - }); - /** - * @_ignore: - */ - orphanedEvent(): OrphanFilter; -} -/** - * A **Log** in Ethereum represents an event that has been included in a - * transaction using the ``LOG*`` opcodes, which are most commonly used by - * Solidity's emit for announcing events. - */ -export declare class Log implements LogParams { - /** - * The provider connected to the log used to fetch additional details - * if necessary. - */ - readonly provider: Provider; - /** - * The transaction hash of the transaction this log occurred in. Use the - * [[Log-getTransaction]] to get the [[TransactionResponse]]. - */ - readonly transactionHash: string; - /** - * The block hash of the block this log occurred in. Use the - * [[Log-getBlock]] to get the [[Block]]. - */ - readonly blockHash: string; - /** - * The block number of the block this log occurred in. It is preferred - * to use the [[Block-hash]] when fetching the related [[Block]], - * since in the case of an orphaned block, the block at that height may - * have changed. - */ - readonly blockNumber: number; - /** - * If the **Log** represents a block that was removed due to an orphaned - * block, this will be true. - * - * This can only happen within an orphan event listener. - */ - readonly removed: boolean; - /** - * The address of the contract that emitted this log. - */ - readonly address: string; - /** - * The data included in this log when it was emitted. - */ - readonly data: string; - /** - * The indexed topics included in this log when it was emitted. - * - * All topics are included in the bloom filters, so they can be - * efficiently filtered using the [[Provider-getLogs]] method. - */ - readonly topics: ReadonlyArray; - /** - * The index within the block this log occurred at. This is generally - * not useful to developers, but can be used with the various roots - * to proof inclusion within a block. - */ - readonly index: number; - /** - * The index within the transaction of this log. - */ - readonly transactionIndex: number; - /** - * @_ignore: - */ - constructor(log: LogParams, provider: Provider); - /** - * Returns a JSON-compatible object. - */ - toJSON(): any; - /** - * Returns the block that this log occurred in. - */ - getBlock(): Promise; - /** - * Returns the transaction that this log occurred in. - */ - getTransaction(): Promise; - /** - * Returns the transaction receipt fot the transaction that this - * log occurred in. - */ - getTransactionReceipt(): Promise; - /** - * @_ignore: - */ - removedEvent(): OrphanFilter; -} -/** - * A **TransactionReceipt** includes additional information about a - * transaction that is only available after it has been mined. - */ -export declare class TransactionReceipt implements TransactionReceiptParams, Iterable { - #private; - /** - * The provider connected to the log used to fetch additional details - * if necessary. - */ - readonly provider: Provider; - /** - * The address the transaction was sent to. - */ - readonly to: null | string; - /** - * The sender of the transaction. - */ - readonly from: string; - /** - * The address of the contract if the transaction was directly - * responsible for deploying one. - * - * This is non-null **only** if the ``to`` is empty and the ``data`` - * was successfully executed as initcode. - */ - readonly contractAddress: null | string; - /** - * The transaction hash. - */ - readonly hash: string; - /** - * The index of this transaction within the block transactions. - */ - readonly index: number; - /** - * The block hash of the [[Block]] this transaction was included in. - */ - readonly blockHash: string; - /** - * The block number of the [[Block]] this transaction was included in. - */ - readonly blockNumber: number; - /** - * The bloom filter bytes that represent all logs that occurred within - * this transaction. This is generally not useful for most developers, - * but can be used to validate the included logs. - */ - readonly logsBloom: string; - /** - * The actual amount of gas used by this transaction. - * - * When creating a transaction, the amount of gas that will be used can - * only be approximated, but the sender must pay the gas fee for the - * entire gas limit. After the transaction, the difference is refunded. - */ - readonly gasUsed: bigint; - /** - * The gas used for BLObs. See [[link-eip-4844]]. - */ - readonly blobGasUsed: null | bigint; - /** - * The amount of gas used by all transactions within the block for this - * and all transactions with a lower ``index``. - * - * This is generally not useful for developers but can be used to - * validate certain aspects of execution. - */ - readonly cumulativeGasUsed: bigint; - /** - * The actual gas price used during execution. - * - * Due to the complexity of [[link-eip-1559]] this value can only - * be caluclated after the transaction has been mined, snce the base - * fee is protocol-enforced. - */ - readonly gasPrice: bigint; - /** - * The price paid per BLOB in gas. See [[link-eip-4844]]. - */ - readonly blobGasPrice: null | bigint; - /** - * The [[link-eip-2718]] transaction type. - */ - readonly type: number; - /** - * The status of this transaction, indicating success (i.e. ``1``) or - * a revert (i.e. ``0``). - * - * This is available in post-byzantium blocks, but some backends may - * backfill this value. - */ - readonly status: null | number; - /** - * The root hash of this transaction. - * - * This is no present and was only included in pre-byzantium blocks, but - * could be used to validate certain parts of the receipt. - */ - readonly root: null | string; - /** - * @_ignore: - */ - constructor(tx: TransactionReceiptParams, provider: Provider); - /** - * The logs for this transaction. - */ - get logs(): ReadonlyArray; - /** - * Returns a JSON-compatible representation. - */ - toJSON(): any; - /** - * @_ignore: - */ - get length(): number; - [Symbol.iterator](): Iterator; - /** - * The total fee for this transaction, in wei. - */ - get fee(): bigint; - /** - * Resolves to the block this transaction occurred in. - */ - getBlock(): Promise; - /** - * Resolves to the transaction this transaction occurred in. - */ - getTransaction(): Promise; - /** - * Resolves to the return value of the execution of this transaction. - * - * Support for this feature is limited, as it requires an archive node - * with the ``debug_`` or ``trace_`` API enabled. - */ - getResult(): Promise; - /** - * Resolves to the number of confirmations this transaction has. - */ - confirmations(): Promise; - /** - * @_ignore: - */ - removedEvent(): OrphanFilter; - /** - * @_ignore: - */ - reorderedEvent(other?: TransactionResponse): OrphanFilter; -} -/** - * A **MinedTransactionResponse** is an interface representing a - * transaction which has been mined and allows for a type guard for its - * property values being defined. - */ -export interface MinedTransactionResponse extends TransactionResponse { - /** - * The block number this transaction occurred in. - */ - blockNumber: number; - /** - * The block hash this transaction occurred in. - */ - blockHash: string; - /** - * The date this transaction occurred on. - */ - date: Date; -} -/** - * A **TransactionResponse** includes all properties about a transaction - * that was sent to the network, which may or may not be included in a - * block. - * - * The [[TransactionResponse-isMined]] can be used to check if the - * transaction has been mined as well as type guard that the otherwise - * possibly ``null`` properties are defined. - */ -export declare class TransactionResponse implements TransactionLike, TransactionResponseParams { - #private; - /** - * The provider this is connected to, which will influence how its - * methods will resolve its async inspection methods. - */ - readonly provider: Provider; - /** - * The block number of the block that this transaction was included in. - * - * This is ``null`` for pending transactions. - */ - readonly blockNumber: null | number; - /** - * The blockHash of the block that this transaction was included in. - * - * This is ``null`` for pending transactions. - */ - readonly blockHash: null | string; - /** - * The index within the block that this transaction resides at. - */ - readonly index: number; - /** - * The transaction hash. - */ - readonly hash: string; - /** - * The [[link-eip-2718]] transaction envelope type. This is - * ``0`` for legacy transactions types. - */ - readonly type: number; - /** - * The receiver of this transaction. - * - * If ``null``, then the transaction is an initcode transaction. - * This means the result of executing the [[data]] will be deployed - * as a new contract on chain (assuming it does not revert) and the - * address may be computed using [[getCreateAddress]]. - */ - readonly to: null | string; - /** - * The sender of this transaction. It is implicitly computed - * from the transaction pre-image hash (as the digest) and the - * [[signature]] using ecrecover. - */ - readonly from: string; - /** - * The nonce, which is used to prevent replay attacks and offer - * a method to ensure transactions from a given sender are explicitly - * ordered. - * - * When sending a transaction, this must be equal to the number of - * transactions ever sent by [[from]]. - */ - readonly nonce: number; - /** - * The maximum units of gas this transaction can consume. If execution - * exceeds this, the entries transaction is reverted and the sender - * is charged for the full amount, despite not state changes being made. - */ - readonly gasLimit: bigint; - /** - * The gas price can have various values, depending on the network. - * - * In modern networks, for transactions that are included this is - * the //effective gas price// (the fee per gas that was actually - * charged), while for transactions that have not been included yet - * is the [[maxFeePerGas]]. - * - * For legacy transactions, or transactions on legacy networks, this - * is the fee that will be charged per unit of gas the transaction - * consumes. - */ - readonly gasPrice: bigint; - /** - * The maximum priority fee (per unit of gas) to allow a - * validator to charge the sender. This is inclusive of the - * [[maxFeeFeePerGas]]. - */ - readonly maxPriorityFeePerGas: null | bigint; - /** - * The maximum fee (per unit of gas) to allow this transaction - * to charge the sender. - */ - readonly maxFeePerGas: null | bigint; - /** - * The [[link-eip-4844]] max fee per BLOb gas. - */ - readonly maxFeePerBlobGas: null | bigint; - /** - * The data. - */ - readonly data: string; - /** - * The value, in wei. Use [[formatEther]] to format this value - * as ether. - */ - readonly value: bigint; - /** - * The chain ID. - */ - readonly chainId: bigint; - /** - * The signature. - */ - readonly signature: Signature; - /** - * The [[link-eip-2930]] access list for transaction types that - * support it, otherwise ``null``. - */ - readonly accessList: null | AccessList; - /** - * The [[link-eip-4844]] BLOb versioned hashes. - */ - readonly blobVersionedHashes: null | Array; - /** - * The [[link-eip-7702]] authorizations (if any). - */ - readonly authorizationList: null | Array; - /** - * @_ignore: - */ - constructor(tx: TransactionResponseParams, provider: Provider); - /** - * Returns a JSON-compatible representation of this transaction. - */ - toJSON(): any; - /** - * Resolves to the Block that this transaction was included in. - * - * This will return null if the transaction has not been included yet. - */ - getBlock(): Promise; - /** - * Resolves to this transaction being re-requested from the - * provider. This can be used if you have an unmined transaction - * and wish to get an up-to-date populated instance. - */ - getTransaction(): Promise; - /** - * Resolve to the number of confirmations this transaction has. - */ - confirmations(): Promise; - /** - * Resolves once this transaction has been mined and has - * %%confirms%% blocks including it (default: ``1``) with an - * optional %%timeout%%. - * - * This can resolve to ``null`` only if %%confirms%% is ``0`` - * and the transaction has not been mined, otherwise this will - * wait until enough confirmations have completed. - */ - wait(_confirms?: number, _timeout?: number): Promise; - /** - * Returns ``true`` if this transaction has been included. - * - * This is effective only as of the time the TransactionResponse - * was instantiated. To get up-to-date information, use - * [[getTransaction]]. - * - * This provides a Type Guard that this transaction will have - * non-null property values for properties that are null for - * unmined transactions. - */ - isMined(): this is MinedTransactionResponse; - /** - * Returns true if the transaction is a legacy (i.e. ``type == 0``) - * transaction. - * - * This provides a Type Guard that this transaction will have - * the ``null``-ness for hardfork-specific properties set correctly. - */ - isLegacy(): this is (TransactionResponse & { - accessList: null; - maxFeePerGas: null; - maxPriorityFeePerGas: null; - }); - /** - * Returns true if the transaction is a Berlin (i.e. ``type == 1``) - * transaction. See [[link-eip-2070]]. - * - * This provides a Type Guard that this transaction will have - * the ``null``-ness for hardfork-specific properties set correctly. - */ - isBerlin(): this is (TransactionResponse & { - accessList: AccessList; - maxFeePerGas: null; - maxPriorityFeePerGas: null; - }); - /** - * Returns true if the transaction is a London (i.e. ``type == 2``) - * transaction. See [[link-eip-1559]]. - * - * This provides a Type Guard that this transaction will have - * the ``null``-ness for hardfork-specific properties set correctly. - */ - isLondon(): this is (TransactionResponse & { - accessList: AccessList; - maxFeePerGas: bigint; - maxPriorityFeePerGas: bigint; - }); - /** - * Returns true if hte transaction is a Cancun (i.e. ``type == 3``) - * transaction. See [[link-eip-4844]]. - */ - isCancun(): this is (TransactionResponse & { - accessList: AccessList; - maxFeePerGas: bigint; - maxPriorityFeePerGas: bigint; - maxFeePerBlobGas: bigint; - blobVersionedHashes: Array; - }); - /** - * Returns a filter which can be used to listen for orphan events - * that evict this transaction. - */ - removedEvent(): OrphanFilter; - /** - * Returns a filter which can be used to listen for orphan events - * that re-order this event against %%other%%. - */ - reorderedEvent(other?: TransactionResponse): OrphanFilter; - /** - * Returns a new TransactionResponse instance which has the ability to - * detect (and throw an error) if the transaction is replaced, which - * will begin scanning at %%startBlock%%. - * - * This should generally not be used by developers and is intended - * primarily for internal use. Setting an incorrect %%startBlock%% can - * have devastating performance consequences if used incorrectly. - */ - replaceableTransaction(startBlock: number): TransactionResponse; -} -/** - * An Orphan Filter allows detecting when an orphan block has - * resulted in dropping a block or transaction or has resulted - * in transactions changing order. - * - * Not currently fully supported. - */ -export type OrphanFilter = { - orphan: "drop-block"; - hash: string; - number: number; -} | { - orphan: "drop-transaction"; - tx: { - hash: string; - blockHash: string; - blockNumber: number; - }; - other?: { - hash: string; - blockHash: string; - blockNumber: number; - }; -} | { - orphan: "reorder-transaction"; - tx: { - hash: string; - blockHash: string; - blockNumber: number; - }; - other?: { - hash: string; - blockHash: string; - blockNumber: number; - }; -} | { - orphan: "drop-log"; - log: { - transactionHash: string; - blockHash: string; - blockNumber: number; - address: string; - data: string; - topics: ReadonlyArray; - index: number; - }; -}; -/** - * A **TopicFilter** provides a struture to define bloom-filter - * queries. - * - * Each field that is ``null`` matches **any** value, a field that is - * a ``string`` must match exactly that value and ``array`` is - * effectively an ``OR``-ed set, where any one of those values must - * match. - */ -export type TopicFilter = Array>; -/** - * An **EventFilter** allows efficiently filtering logs (also known as - * events) using bloom filters included within blocks. - */ -export interface EventFilter { - address?: AddressLike | Array; - topics?: TopicFilter; -} -/** - * A **Filter** allows searching a specific range of blocks for mathcing - * logs. - */ -export interface Filter extends EventFilter { - /** - * The start block for the filter (inclusive). - */ - fromBlock?: BlockTag; - /** - * The end block for the filter (inclusive). - */ - toBlock?: BlockTag; -} -/** - * A **FilterByBlockHash** allows searching a specific block for mathcing - * logs. - */ -export interface FilterByBlockHash extends EventFilter { - /** - * The blockhash of the specific block for the filter. - */ - blockHash?: string; -} -/** - * A **ProviderEvent** provides the types of events that can be subscribed - * to on a [[Provider]]. - * - * Each provider may include additional possible events it supports, but - * the most commonly supported are: - * - * **``"block"``** - calls the listener with the current block number on each - * new block. - * - * **``"error"``** - calls the listener on each async error that occurs during - * the event loop, with the error. - * - * **``"debug"``** - calls the listener on debug events, which can be used to - * troubleshoot network errors, provider problems, etc. - * - * **``transaction hash``** - calls the listener on each block after the - * transaction has been mined; generally ``.once`` is more appropriate for - * this event. - * - * **``Array``** - calls the listener on each log that matches the filter. - * - * [[EventFilter]] - calls the listener with each matching log - */ -export type ProviderEvent = string | Array> | EventFilter | OrphanFilter; -/** - * A **Provider** is the primary method to interact with the read-only - * content on Ethereum. - * - * It allows access to details about accounts, blocks and transactions - * and the ability to query event logs and simulate contract execution. - * - * Account data includes the [balance](getBalance), - * [transaction count](getTransactionCount), [code](getCode) and - * [state trie storage](getStorage). - * - * Simulating execution can be used to [call](call), - * [estimate gas](estimateGas) and - * [get transaction results](getTransactionResult). - * - * The [[broadcastTransaction]] is the only method which allows updating - * the blockchain, but it is usually accessed by a [[Signer]], since a - * private key must be used to sign the transaction before it can be - * broadcast. - */ -export interface Provider extends ContractRunner, EventEmitterable, NameResolver { - /** - * The provider iteself. - * - * This is part of the necessary API for executing a contract, as - * it provides a common property on any [[ContractRunner]] that - * can be used to access the read-only portion of the runner. - */ - provider: this; - /** - * Shutdown any resources this provider is using. No additional - * calls should be made to this provider after calling this. - */ - destroy(): void; - /** - * Get the current block number. - */ - getBlockNumber(): Promise; - /** - * Get the connected [[Network]]. - */ - getNetwork(): Promise; - /** - * Get the best guess at the recommended [[FeeData]]. - */ - getFeeData(): Promise; - /** - * Get the account balance (in wei) of %%address%%. If %%blockTag%% - * is specified and the node supports archive access for that - * %%blockTag%%, the balance is as of that [[BlockTag]]. - * - * @note On nodes without archive access enabled, the %%blockTag%% may be - * **silently ignored** by the node, which may cause issues if relied on. - */ - getBalance(address: AddressLike, blockTag?: BlockTag): Promise; - /** - * Get the number of transactions ever sent for %%address%%, which - * is used as the ``nonce`` when sending a transaction. If - * %%blockTag%% is specified and the node supports archive access - * for that %%blockTag%%, the transaction count is as of that - * [[BlockTag]]. - * - * @note On nodes without archive access enabled, the %%blockTag%% may be - * **silently ignored** by the node, which may cause issues if relied on. - */ - getTransactionCount(address: AddressLike, blockTag?: BlockTag): Promise; - /** - * Get the bytecode for %%address%%. - * - * @note On nodes without archive access enabled, the %%blockTag%% may be - * **silently ignored** by the node, which may cause issues if relied on. - */ - getCode(address: AddressLike, blockTag?: BlockTag): Promise; - /** - * Get the storage slot value for %%address%% at slot %%position%%. - * - * @note On nodes without archive access enabled, the %%blockTag%% may be - * **silently ignored** by the node, which may cause issues if relied on. - */ - getStorage(address: AddressLike, position: BigNumberish, blockTag?: BlockTag): Promise; - /** - * Estimates the amount of gas required to execute %%tx%%. - */ - estimateGas(tx: TransactionRequest): Promise; - /** - * Simulate the execution of %%tx%%. If the call reverts, it will - * throw a [[CallExceptionError]] which includes the revert data. - */ - call(tx: TransactionRequest): Promise; - /** - * Broadcasts the %%signedTx%% to the network, adding it to the - * memory pool of any node for which the transaction meets the - * rebroadcast requirements. - */ - broadcastTransaction(signedTx: string): Promise; - /** - * Resolves to the block for %%blockHashOrBlockTag%%. - * - * If %%prefetchTxs%%, and the backend supports including transactions - * with block requests, all transactions will be included and the - * [[Block]] object will not need to make remote calls for getting - * transactions. - */ - getBlock(blockHashOrBlockTag: BlockTag | string, prefetchTxs?: boolean): Promise; - /** - * Resolves to the transaction for %%hash%%. - * - * If the transaction is unknown or on pruning nodes which - * discard old transactions this resolves to ``null``. - */ - getTransaction(hash: string): Promise; - /** - * Resolves to the transaction receipt for %%hash%%, if mined. - * - * If the transaction has not been mined, is unknown or on - * pruning nodes which discard old transactions this resolves to - * ``null``. - */ - getTransactionReceipt(hash: string): Promise; - /** - * Resolves to the result returned by the executions of %%hash%%. - * - * This is only supported on nodes with archive access and with - * the necessary debug APIs enabled. - */ - getTransactionResult(hash: string): Promise; - /** - * Resolves to the list of Logs that match %%filter%% - */ - getLogs(filter: Filter | FilterByBlockHash): Promise>; - /** - * Resolves to the address configured for the %%ensName%% or - * ``null`` if unconfigured. - */ - resolveName(ensName: string): Promise; - /** - * Resolves to the ENS name associated for the %%address%% or - * ``null`` if the //primary name// is not configured. - * - * Users must perform additional steps to configure a //primary name//, - * which is not currently common. - */ - lookupAddress(address: string): Promise; - /** - * Waits until the transaction %%hash%% is mined and has %%confirms%% - * confirmations. - */ - waitForTransaction(hash: string, confirms?: number, timeout?: number): Promise; - /** - * Resolves to the block at %%blockTag%% once it has been mined. - * - * This can be useful for waiting some number of blocks by using - * the ``currentBlockNumber + N``. - */ - waitForBlock(blockTag?: BlockTag): Promise; -} -//# sourceMappingURL=provider.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider.d.ts.map deleted file mode 100644 index fc135586..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider.d.ts.map +++ /dev/null @@ -1 +0,0 @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E,OAAO,GAAG,OAAO,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC;IAE/F;;;;;OAKG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,mBAAmB,CAAC,CAAC;IAElE;;;;;;OAMG;IACH,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,kBAAkB,CAAC,CAAC;IAExE;;;;;OAKG;IACH,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;IAM3D;;OAEG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IAMjE;;;OAGG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;IAErD;;;;;;OAMG;IACH,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;IAEvD;;;OAGG;IACH,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,kBAAkB,CAAC,CAAC;IAE1G;;;;;OAKG;IACH,YAAY,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;CACrD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider.js deleted file mode 100644 index c537175c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider.js +++ /dev/null @@ -1,1324 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.TransactionResponse = exports.TransactionReceipt = exports.Log = exports.Block = exports.copyRequest = exports.FeeData = void 0; -//import { resolveAddress } from "@ethersproject/address"; -const index_js_1 = require("../utils/index.js"); -const index_js_2 = require("../transaction/index.js"); -const BN_0 = BigInt(0); -// ----------------------- -function getValue(value) { - if (value == null) { - return null; - } - return value; -} -function toJson(value) { - if (value == null) { - return null; - } - return value.toString(); -} -// @TODO? implements Required -/** - * A **FeeData** wraps all the fee-related values associated with - * the network. - */ -class FeeData { - /** - * The gas price for legacy networks. - */ - gasPrice; - /** - * The maximum fee to pay per gas. - * - * The base fee per gas is defined by the network and based on - * congestion, increasing the cost during times of heavy load - * and lowering when less busy. - * - * The actual fee per gas will be the base fee for the block - * and the priority fee, up to the max fee per gas. - * - * This will be ``null`` on legacy networks (i.e. [pre-EIP-1559](link-eip-1559)) - */ - maxFeePerGas; - /** - * The additional amout to pay per gas to encourage a validator - * to include the transaction. - * - * The purpose of this is to compensate the validator for the - * adjusted risk for including a given transaction. - * - * This will be ``null`` on legacy networks (i.e. [pre-EIP-1559](link-eip-1559)) - */ - maxPriorityFeePerGas; - /** - * Creates a new FeeData for %%gasPrice%%, %%maxFeePerGas%% and - * %%maxPriorityFeePerGas%%. - */ - constructor(gasPrice, maxFeePerGas, maxPriorityFeePerGas) { - (0, index_js_1.defineProperties)(this, { - gasPrice: getValue(gasPrice), - maxFeePerGas: getValue(maxFeePerGas), - maxPriorityFeePerGas: getValue(maxPriorityFeePerGas) - }); - } - /** - * Returns a JSON-friendly value. - */ - toJSON() { - const { gasPrice, maxFeePerGas, maxPriorityFeePerGas } = this; - return { - _type: "FeeData", - gasPrice: toJson(gasPrice), - maxFeePerGas: toJson(maxFeePerGas), - maxPriorityFeePerGas: toJson(maxPriorityFeePerGas), - }; - } -} -exports.FeeData = FeeData; -; -/** - * Returns a copy of %%req%% with all properties coerced to their strict - * types. - */ -function copyRequest(req) { - const result = {}; - // These could be addresses, ENS names or Addressables - if (req.to) { - result.to = req.to; - } - if (req.from) { - result.from = req.from; - } - if (req.data) { - result.data = (0, index_js_1.hexlify)(req.data); - } - const bigIntKeys = "chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/); - for (const key of bigIntKeys) { - if (!(key in req) || req[key] == null) { - continue; - } - result[key] = (0, index_js_1.getBigInt)(req[key], `request.${key}`); - } - const numberKeys = "type,nonce".split(/,/); - for (const key of numberKeys) { - if (!(key in req) || req[key] == null) { - continue; - } - result[key] = (0, index_js_1.getNumber)(req[key], `request.${key}`); - } - if (req.accessList) { - result.accessList = (0, index_js_2.accessListify)(req.accessList); - } - if (req.authorizationList) { - result.authorizationList = req.authorizationList.slice(); - } - if ("blockTag" in req) { - result.blockTag = req.blockTag; - } - if ("enableCcipRead" in req) { - result.enableCcipRead = !!req.enableCcipRead; - } - if ("customData" in req) { - result.customData = req.customData; - } - if ("blobVersionedHashes" in req && req.blobVersionedHashes) { - result.blobVersionedHashes = req.blobVersionedHashes.slice(); - } - if ("kzg" in req) { - result.kzg = req.kzg; - } - if ("blobWrapperVersion" in req) { - result.blobWrapperVersion = req.blobWrapperVersion; - } - if ("blobs" in req && req.blobs) { - result.blobs = req.blobs.map((b) => { - if ((0, index_js_1.isBytesLike)(b)) { - return (0, index_js_1.hexlify)(b); - } - return Object.assign({}, b); - }); - } - return result; -} -exports.copyRequest = copyRequest; -/** - * A **Block** represents the data associated with a full block on - * Ethereum. - */ -class Block { - /** - * The provider connected to the block used to fetch additional details - * if necessary. - */ - provider; - /** - * The block number, sometimes called the block height. This is a - * sequential number that is one higher than the parent block. - */ - number; - /** - * The block hash. - * - * This hash includes all properties, so can be safely used to identify - * an exact set of block properties. - */ - hash; - /** - * The timestamp for this block, which is the number of seconds since - * epoch that this block was included. - */ - timestamp; - /** - * The block hash of the parent block. - */ - parentHash; - /** - * The hash tree root of the parent beacon block for the given - * execution block. See [[link-eip-4788]]. - */ - parentBeaconBlockRoot; - /** - * The nonce. - * - * On legacy networks, this is the random number inserted which - * permitted the difficulty target to be reached. - */ - nonce; - /** - * The difficulty target. - * - * On legacy networks, this is the proof-of-work target required - * for a block to meet the protocol rules to be included. - * - * On modern networks, this is a random number arrived at using - * randao. @TODO: Find links? - */ - difficulty; - /** - * The total gas limit for this block. - */ - gasLimit; - /** - * The total gas used in this block. - */ - gasUsed; - /** - * The root hash for the global state after applying changes - * in this block. - */ - stateRoot; - /** - * The hash of the transaction receipts trie. - */ - receiptsRoot; - /** - * The total amount of blob gas consumed by the transactions - * within the block. See [[link-eip-4844]]. - */ - blobGasUsed; - /** - * The running total of blob gas consumed in excess of the - * target, prior to the block. See [[link-eip-4844]]. - */ - excessBlobGas; - /** - * The miner coinbase address, wihch receives any subsidies for - * including this block. - */ - miner; - /** - * The latest RANDAO mix of the post beacon state of - * the previous block. - */ - prevRandao; - /** - * Any extra data the validator wished to include. - */ - extraData; - /** - * The base fee per gas that all transactions in this block were - * charged. - * - * This adjusts after each block, depending on how congested the network - * is. - */ - baseFeePerGas; - #transactions; - /** - * Create a new **Block** object. - * - * This should generally not be necessary as the unless implementing a - * low-level library. - */ - constructor(block, provider) { - this.#transactions = block.transactions.map((tx) => { - if (typeof (tx) !== "string") { - return new TransactionResponse(tx, provider); - } - return tx; - }); - (0, index_js_1.defineProperties)(this, { - provider, - hash: getValue(block.hash), - number: block.number, - timestamp: block.timestamp, - parentHash: block.parentHash, - parentBeaconBlockRoot: block.parentBeaconBlockRoot, - nonce: block.nonce, - difficulty: block.difficulty, - gasLimit: block.gasLimit, - gasUsed: block.gasUsed, - blobGasUsed: block.blobGasUsed, - excessBlobGas: block.excessBlobGas, - miner: block.miner, - prevRandao: getValue(block.prevRandao), - extraData: block.extraData, - baseFeePerGas: getValue(block.baseFeePerGas), - stateRoot: block.stateRoot, - receiptsRoot: block.receiptsRoot, - }); - } - /** - * Returns the list of transaction hashes, in the order - * they were executed within the block. - */ - get transactions() { - return this.#transactions.map((tx) => { - if (typeof (tx) === "string") { - return tx; - } - return tx.hash; - }); - } - /** - * Returns the complete transactions, in the order they - * were executed within the block. - * - * This is only available for blocks which prefetched - * transactions, by passing ``true`` to %%prefetchTxs%% - * into [[Provider-getBlock]]. - */ - get prefetchedTransactions() { - const txs = this.#transactions.slice(); - // Doesn't matter... - if (txs.length === 0) { - return []; - } - // Make sure we prefetched the transactions - (0, index_js_1.assert)(typeof (txs[0]) === "object", "transactions were not prefetched with block request", "UNSUPPORTED_OPERATION", { - operation: "transactionResponses()" - }); - return txs; - } - /** - * Returns a JSON-friendly value. - */ - toJSON() { - const { baseFeePerGas, difficulty, extraData, gasLimit, gasUsed, hash, miner, prevRandao, nonce, number, parentHash, parentBeaconBlockRoot, stateRoot, receiptsRoot, timestamp, transactions } = this; - return { - _type: "Block", - baseFeePerGas: toJson(baseFeePerGas), - difficulty: toJson(difficulty), - extraData, - gasLimit: toJson(gasLimit), - gasUsed: toJson(gasUsed), - blobGasUsed: toJson(this.blobGasUsed), - excessBlobGas: toJson(this.excessBlobGas), - hash, miner, prevRandao, nonce, number, parentHash, timestamp, - parentBeaconBlockRoot, stateRoot, receiptsRoot, - transactions, - }; - } - [Symbol.iterator]() { - let index = 0; - const txs = this.transactions; - return { - next: () => { - if (index < this.length) { - return { - value: txs[index++], done: false - }; - } - return { value: undefined, done: true }; - } - }; - } - /** - * The number of transactions in this block. - */ - get length() { return this.#transactions.length; } - /** - * The [[link-js-date]] this block was included at. - */ - get date() { - if (this.timestamp == null) { - return null; - } - return new Date(this.timestamp * 1000); - } - /** - * Get the transaction at %%indexe%% within this block. - */ - async getTransaction(indexOrHash) { - // Find the internal value by its index or hash - let tx = undefined; - if (typeof (indexOrHash) === "number") { - tx = this.#transactions[indexOrHash]; - } - else { - const hash = indexOrHash.toLowerCase(); - for (const v of this.#transactions) { - if (typeof (v) === "string") { - if (v !== hash) { - continue; - } - tx = v; - break; - } - else { - if (v.hash !== hash) { - continue; - } - tx = v; - break; - } - } - } - if (tx == null) { - throw new Error("no such tx"); - } - if (typeof (tx) === "string") { - return (await this.provider.getTransaction(tx)); - } - else { - return tx; - } - } - /** - * If a **Block** was fetched with a request to include the transactions - * this will allow synchronous access to those transactions. - * - * If the transactions were not prefetched, this will throw. - */ - getPrefetchedTransaction(indexOrHash) { - const txs = this.prefetchedTransactions; - if (typeof (indexOrHash) === "number") { - return txs[indexOrHash]; - } - indexOrHash = indexOrHash.toLowerCase(); - for (const tx of txs) { - if (tx.hash === indexOrHash) { - return tx; - } - } - (0, index_js_1.assertArgument)(false, "no matching transaction", "indexOrHash", indexOrHash); - } - /** - * Returns true if this block been mined. This provides a type guard - * for all properties on a [[MinedBlock]]. - */ - isMined() { return !!this.hash; } - /** - * Returns true if this block is an [[link-eip-2930]] block. - */ - isLondon() { - return !!this.baseFeePerGas; - } - /** - * @_ignore: - */ - orphanedEvent() { - if (!this.isMined()) { - throw new Error(""); - } - return createOrphanedBlockFilter(this); - } -} -exports.Block = Block; -////////////////////// -// Log -/** - * A **Log** in Ethereum represents an event that has been included in a - * transaction using the ``LOG*`` opcodes, which are most commonly used by - * Solidity's emit for announcing events. - */ -class Log { - /** - * The provider connected to the log used to fetch additional details - * if necessary. - */ - provider; - /** - * The transaction hash of the transaction this log occurred in. Use the - * [[Log-getTransaction]] to get the [[TransactionResponse]]. - */ - transactionHash; - /** - * The block hash of the block this log occurred in. Use the - * [[Log-getBlock]] to get the [[Block]]. - */ - blockHash; - /** - * The block number of the block this log occurred in. It is preferred - * to use the [[Block-hash]] when fetching the related [[Block]], - * since in the case of an orphaned block, the block at that height may - * have changed. - */ - blockNumber; - /** - * If the **Log** represents a block that was removed due to an orphaned - * block, this will be true. - * - * This can only happen within an orphan event listener. - */ - removed; - /** - * The address of the contract that emitted this log. - */ - address; - /** - * The data included in this log when it was emitted. - */ - data; - /** - * The indexed topics included in this log when it was emitted. - * - * All topics are included in the bloom filters, so they can be - * efficiently filtered using the [[Provider-getLogs]] method. - */ - topics; - /** - * The index within the block this log occurred at. This is generally - * not useful to developers, but can be used with the various roots - * to proof inclusion within a block. - */ - index; - /** - * The index within the transaction of this log. - */ - transactionIndex; - /** - * @_ignore: - */ - constructor(log, provider) { - this.provider = provider; - const topics = Object.freeze(log.topics.slice()); - (0, index_js_1.defineProperties)(this, { - transactionHash: log.transactionHash, - blockHash: log.blockHash, - blockNumber: log.blockNumber, - removed: log.removed, - address: log.address, - data: log.data, - topics, - index: log.index, - transactionIndex: log.transactionIndex, - }); - } - /** - * Returns a JSON-compatible object. - */ - toJSON() { - const { address, blockHash, blockNumber, data, index, removed, topics, transactionHash, transactionIndex } = this; - return { - _type: "log", - address, blockHash, blockNumber, data, index, - removed, topics, transactionHash, transactionIndex - }; - } - /** - * Returns the block that this log occurred in. - */ - async getBlock() { - const block = await this.provider.getBlock(this.blockHash); - (0, index_js_1.assert)(!!block, "failed to find transaction", "UNKNOWN_ERROR", {}); - return block; - } - /** - * Returns the transaction that this log occurred in. - */ - async getTransaction() { - const tx = await this.provider.getTransaction(this.transactionHash); - (0, index_js_1.assert)(!!tx, "failed to find transaction", "UNKNOWN_ERROR", {}); - return tx; - } - /** - * Returns the transaction receipt fot the transaction that this - * log occurred in. - */ - async getTransactionReceipt() { - const receipt = await this.provider.getTransactionReceipt(this.transactionHash); - (0, index_js_1.assert)(!!receipt, "failed to find transaction receipt", "UNKNOWN_ERROR", {}); - return receipt; - } - /** - * @_ignore: - */ - removedEvent() { - return createRemovedLogFilter(this); - } -} -exports.Log = Log; -////////////////////// -// Transaction Receipt -/* -export interface LegacyTransactionReceipt { - byzantium: false; - status: null; - root: string; -} - -export interface ByzantiumTransactionReceipt { - byzantium: true; - status: number; - root: null; -} -*/ -/** - * A **TransactionReceipt** includes additional information about a - * transaction that is only available after it has been mined. - */ -class TransactionReceipt { - /** - * The provider connected to the log used to fetch additional details - * if necessary. - */ - provider; - /** - * The address the transaction was sent to. - */ - to; - /** - * The sender of the transaction. - */ - from; - /** - * The address of the contract if the transaction was directly - * responsible for deploying one. - * - * This is non-null **only** if the ``to`` is empty and the ``data`` - * was successfully executed as initcode. - */ - contractAddress; - /** - * The transaction hash. - */ - hash; - /** - * The index of this transaction within the block transactions. - */ - index; - /** - * The block hash of the [[Block]] this transaction was included in. - */ - blockHash; - /** - * The block number of the [[Block]] this transaction was included in. - */ - blockNumber; - /** - * The bloom filter bytes that represent all logs that occurred within - * this transaction. This is generally not useful for most developers, - * but can be used to validate the included logs. - */ - logsBloom; - /** - * The actual amount of gas used by this transaction. - * - * When creating a transaction, the amount of gas that will be used can - * only be approximated, but the sender must pay the gas fee for the - * entire gas limit. After the transaction, the difference is refunded. - */ - gasUsed; - /** - * The gas used for BLObs. See [[link-eip-4844]]. - */ - blobGasUsed; - /** - * The amount of gas used by all transactions within the block for this - * and all transactions with a lower ``index``. - * - * This is generally not useful for developers but can be used to - * validate certain aspects of execution. - */ - cumulativeGasUsed; - /** - * The actual gas price used during execution. - * - * Due to the complexity of [[link-eip-1559]] this value can only - * be caluclated after the transaction has been mined, snce the base - * fee is protocol-enforced. - */ - gasPrice; - /** - * The price paid per BLOB in gas. See [[link-eip-4844]]. - */ - blobGasPrice; - /** - * The [[link-eip-2718]] transaction type. - */ - type; - //readonly byzantium!: boolean; - /** - * The status of this transaction, indicating success (i.e. ``1``) or - * a revert (i.e. ``0``). - * - * This is available in post-byzantium blocks, but some backends may - * backfill this value. - */ - status; - /** - * The root hash of this transaction. - * - * This is no present and was only included in pre-byzantium blocks, but - * could be used to validate certain parts of the receipt. - */ - root; - #logs; - /** - * @_ignore: - */ - constructor(tx, provider) { - this.#logs = Object.freeze(tx.logs.map((log) => { - return new Log(log, provider); - })); - let gasPrice = BN_0; - if (tx.effectiveGasPrice != null) { - gasPrice = tx.effectiveGasPrice; - } - else if (tx.gasPrice != null) { - gasPrice = tx.gasPrice; - } - (0, index_js_1.defineProperties)(this, { - provider, - to: tx.to, - from: tx.from, - contractAddress: tx.contractAddress, - hash: tx.hash, - index: tx.index, - blockHash: tx.blockHash, - blockNumber: tx.blockNumber, - logsBloom: tx.logsBloom, - gasUsed: tx.gasUsed, - cumulativeGasUsed: tx.cumulativeGasUsed, - blobGasUsed: tx.blobGasUsed, - gasPrice, - blobGasPrice: tx.blobGasPrice, - type: tx.type, - //byzantium: tx.byzantium, - status: tx.status, - root: tx.root - }); - } - /** - * The logs for this transaction. - */ - get logs() { return this.#logs; } - /** - * Returns a JSON-compatible representation. - */ - toJSON() { - const { to, from, contractAddress, hash, index, blockHash, blockNumber, logsBloom, logs, //byzantium, - status, root } = this; - return { - _type: "TransactionReceipt", - blockHash, blockNumber, - //byzantium, - contractAddress, - cumulativeGasUsed: toJson(this.cumulativeGasUsed), - from, - gasPrice: toJson(this.gasPrice), - blobGasUsed: toJson(this.blobGasUsed), - blobGasPrice: toJson(this.blobGasPrice), - gasUsed: toJson(this.gasUsed), - hash, index, logs, logsBloom, root, status, to - }; - } - /** - * @_ignore: - */ - get length() { return this.logs.length; } - [Symbol.iterator]() { - let index = 0; - return { - next: () => { - if (index < this.length) { - return { value: this.logs[index++], done: false }; - } - return { value: undefined, done: true }; - } - }; - } - /** - * The total fee for this transaction, in wei. - */ - get fee() { - return this.gasUsed * this.gasPrice; - } - /** - * Resolves to the block this transaction occurred in. - */ - async getBlock() { - const block = await this.provider.getBlock(this.blockHash); - if (block == null) { - throw new Error("TODO"); - } - return block; - } - /** - * Resolves to the transaction this transaction occurred in. - */ - async getTransaction() { - const tx = await this.provider.getTransaction(this.hash); - if (tx == null) { - throw new Error("TODO"); - } - return tx; - } - /** - * Resolves to the return value of the execution of this transaction. - * - * Support for this feature is limited, as it requires an archive node - * with the ``debug_`` or ``trace_`` API enabled. - */ - async getResult() { - return (await this.provider.getTransactionResult(this.hash)); - } - /** - * Resolves to the number of confirmations this transaction has. - */ - async confirmations() { - return (await this.provider.getBlockNumber()) - this.blockNumber + 1; - } - /** - * @_ignore: - */ - removedEvent() { - return createRemovedTransactionFilter(this); - } - /** - * @_ignore: - */ - reorderedEvent(other) { - (0, index_js_1.assert)(!other || other.isMined(), "unmined 'other' transction cannot be orphaned", "UNSUPPORTED_OPERATION", { operation: "reorderedEvent(other)" }); - return createReorderedTransactionFilter(this, other); - } -} -exports.TransactionReceipt = TransactionReceipt; -/** - * A **TransactionResponse** includes all properties about a transaction - * that was sent to the network, which may or may not be included in a - * block. - * - * The [[TransactionResponse-isMined]] can be used to check if the - * transaction has been mined as well as type guard that the otherwise - * possibly ``null`` properties are defined. - */ -class TransactionResponse { - /** - * The provider this is connected to, which will influence how its - * methods will resolve its async inspection methods. - */ - provider; - /** - * The block number of the block that this transaction was included in. - * - * This is ``null`` for pending transactions. - */ - blockNumber; - /** - * The blockHash of the block that this transaction was included in. - * - * This is ``null`` for pending transactions. - */ - blockHash; - /** - * The index within the block that this transaction resides at. - */ - index; - /** - * The transaction hash. - */ - hash; - /** - * The [[link-eip-2718]] transaction envelope type. This is - * ``0`` for legacy transactions types. - */ - type; - /** - * The receiver of this transaction. - * - * If ``null``, then the transaction is an initcode transaction. - * This means the result of executing the [[data]] will be deployed - * as a new contract on chain (assuming it does not revert) and the - * address may be computed using [[getCreateAddress]]. - */ - to; - /** - * The sender of this transaction. It is implicitly computed - * from the transaction pre-image hash (as the digest) and the - * [[signature]] using ecrecover. - */ - from; - /** - * The nonce, which is used to prevent replay attacks and offer - * a method to ensure transactions from a given sender are explicitly - * ordered. - * - * When sending a transaction, this must be equal to the number of - * transactions ever sent by [[from]]. - */ - nonce; - /** - * The maximum units of gas this transaction can consume. If execution - * exceeds this, the entries transaction is reverted and the sender - * is charged for the full amount, despite not state changes being made. - */ - gasLimit; - /** - * The gas price can have various values, depending on the network. - * - * In modern networks, for transactions that are included this is - * the //effective gas price// (the fee per gas that was actually - * charged), while for transactions that have not been included yet - * is the [[maxFeePerGas]]. - * - * For legacy transactions, or transactions on legacy networks, this - * is the fee that will be charged per unit of gas the transaction - * consumes. - */ - gasPrice; - /** - * The maximum priority fee (per unit of gas) to allow a - * validator to charge the sender. This is inclusive of the - * [[maxFeeFeePerGas]]. - */ - maxPriorityFeePerGas; - /** - * The maximum fee (per unit of gas) to allow this transaction - * to charge the sender. - */ - maxFeePerGas; - /** - * The [[link-eip-4844]] max fee per BLOb gas. - */ - maxFeePerBlobGas; - /** - * The data. - */ - data; - /** - * The value, in wei. Use [[formatEther]] to format this value - * as ether. - */ - value; - /** - * The chain ID. - */ - chainId; - /** - * The signature. - */ - signature; - /** - * The [[link-eip-2930]] access list for transaction types that - * support it, otherwise ``null``. - */ - accessList; - /** - * The [[link-eip-4844]] BLOb versioned hashes. - */ - blobVersionedHashes; - /** - * The [[link-eip-7702]] authorizations (if any). - */ - authorizationList; - #startBlock; - /** - * @_ignore: - */ - constructor(tx, provider) { - this.provider = provider; - this.blockNumber = (tx.blockNumber != null) ? tx.blockNumber : null; - this.blockHash = (tx.blockHash != null) ? tx.blockHash : null; - this.hash = tx.hash; - this.index = tx.index; - this.type = tx.type; - this.from = tx.from; - this.to = tx.to || null; - this.gasLimit = tx.gasLimit; - this.nonce = tx.nonce; - this.data = tx.data; - this.value = tx.value; - this.gasPrice = tx.gasPrice; - this.maxPriorityFeePerGas = (tx.maxPriorityFeePerGas != null) ? tx.maxPriorityFeePerGas : null; - this.maxFeePerGas = (tx.maxFeePerGas != null) ? tx.maxFeePerGas : null; - this.maxFeePerBlobGas = (tx.maxFeePerBlobGas != null) ? tx.maxFeePerBlobGas : null; - this.chainId = tx.chainId; - this.signature = tx.signature; - this.accessList = (tx.accessList != null) ? tx.accessList : null; - this.blobVersionedHashes = (tx.blobVersionedHashes != null) ? tx.blobVersionedHashes : null; - this.authorizationList = (tx.authorizationList != null) ? tx.authorizationList : null; - this.#startBlock = -1; - } - /** - * Returns a JSON-compatible representation of this transaction. - */ - toJSON() { - const { blockNumber, blockHash, index, hash, type, to, from, nonce, data, signature, accessList, blobVersionedHashes } = this; - return { - _type: "TransactionResponse", - accessList, blockNumber, blockHash, - blobVersionedHashes, - chainId: toJson(this.chainId), - data, from, - gasLimit: toJson(this.gasLimit), - gasPrice: toJson(this.gasPrice), - hash, - maxFeePerGas: toJson(this.maxFeePerGas), - maxPriorityFeePerGas: toJson(this.maxPriorityFeePerGas), - maxFeePerBlobGas: toJson(this.maxFeePerBlobGas), - nonce, signature, to, index, type, - value: toJson(this.value), - }; - } - /** - * Resolves to the Block that this transaction was included in. - * - * This will return null if the transaction has not been included yet. - */ - async getBlock() { - let blockNumber = this.blockNumber; - if (blockNumber == null) { - const tx = await this.getTransaction(); - if (tx) { - blockNumber = tx.blockNumber; - } - } - if (blockNumber == null) { - return null; - } - const block = this.provider.getBlock(blockNumber); - if (block == null) { - throw new Error("TODO"); - } - return block; - } - /** - * Resolves to this transaction being re-requested from the - * provider. This can be used if you have an unmined transaction - * and wish to get an up-to-date populated instance. - */ - async getTransaction() { - return this.provider.getTransaction(this.hash); - } - /** - * Resolve to the number of confirmations this transaction has. - */ - async confirmations() { - if (this.blockNumber == null) { - const { tx, blockNumber } = await (0, index_js_1.resolveProperties)({ - tx: this.getTransaction(), - blockNumber: this.provider.getBlockNumber() - }); - // Not mined yet... - if (tx == null || tx.blockNumber == null) { - return 0; - } - return blockNumber - tx.blockNumber + 1; - } - const blockNumber = await this.provider.getBlockNumber(); - return blockNumber - this.blockNumber + 1; - } - /** - * Resolves once this transaction has been mined and has - * %%confirms%% blocks including it (default: ``1``) with an - * optional %%timeout%%. - * - * This can resolve to ``null`` only if %%confirms%% is ``0`` - * and the transaction has not been mined, otherwise this will - * wait until enough confirmations have completed. - */ - async wait(_confirms, _timeout) { - const confirms = (_confirms == null) ? 1 : _confirms; - const timeout = (_timeout == null) ? 0 : _timeout; - let startBlock = this.#startBlock; - let nextScan = -1; - let stopScanning = (startBlock === -1) ? true : false; - const checkReplacement = async () => { - // Get the current transaction count for this sender - if (stopScanning) { - return null; - } - const { blockNumber, nonce } = await (0, index_js_1.resolveProperties)({ - blockNumber: this.provider.getBlockNumber(), - nonce: this.provider.getTransactionCount(this.from) - }); - // No transaction or our nonce has not been mined yet; but we - // can start scanning later when we do start - if (nonce < this.nonce) { - startBlock = blockNumber; - return; - } - // We were mined; no replacement - if (stopScanning) { - return null; - } - const mined = await this.getTransaction(); - if (mined && mined.blockNumber != null) { - return; - } - // We were replaced; start scanning for that transaction - // Starting to scan; look back a few extra blocks for safety - if (nextScan === -1) { - nextScan = startBlock - 3; - if (nextScan < this.#startBlock) { - nextScan = this.#startBlock; - } - } - while (nextScan <= blockNumber) { - // Get the next block to scan - if (stopScanning) { - return null; - } - const block = await this.provider.getBlock(nextScan, true); - // This should not happen; but we'll try again shortly - if (block == null) { - return; - } - // We were mined; no replacement - for (const hash of block) { - if (hash === this.hash) { - return; - } - } - // Search for the transaction that replaced us - for (let i = 0; i < block.length; i++) { - const tx = await block.getTransaction(i); - if (tx.from === this.from && tx.nonce === this.nonce) { - // Get the receipt - if (stopScanning) { - return null; - } - const receipt = await this.provider.getTransactionReceipt(tx.hash); - // This should not happen; but we'll try again shortly - if (receipt == null) { - return; - } - // We will retry this on the next block (this case could be optimized) - if ((blockNumber - receipt.blockNumber + 1) < confirms) { - return; - } - // The reason we were replaced - let reason = "replaced"; - if (tx.data === this.data && tx.to === this.to && tx.value === this.value) { - reason = "repriced"; - } - else if (tx.data === "0x" && tx.from === tx.to && tx.value === BN_0) { - reason = "cancelled"; - } - (0, index_js_1.assert)(false, "transaction was replaced", "TRANSACTION_REPLACED", { - cancelled: (reason === "replaced" || reason === "cancelled"), - reason, - replacement: tx.replaceableTransaction(startBlock), - hash: tx.hash, - receipt - }); - } - } - nextScan++; - } - return; - }; - const checkReceipt = (receipt) => { - if (receipt == null || receipt.status !== 0) { - return receipt; - } - (0, index_js_1.assert)(false, "transaction execution reverted", "CALL_EXCEPTION", { - action: "sendTransaction", - data: null, reason: null, invocation: null, revert: null, - transaction: { - to: receipt.to, - from: receipt.from, - data: "" // @TODO: in v7, split out sendTransaction properties - }, receipt - }); - }; - const receipt = await this.provider.getTransactionReceipt(this.hash); - if (confirms === 0) { - return checkReceipt(receipt); - } - if (receipt) { - if (confirms === 1 || (await receipt.confirmations()) >= confirms) { - return checkReceipt(receipt); - } - } - else { - // Check for a replacement; throws if a replacement was found - await checkReplacement(); - // Allow null only when the confirms is 0 - if (confirms === 0) { - return null; - } - } - const waiter = new Promise((resolve, reject) => { - // List of things to cancel when we have a result (one way or the other) - const cancellers = []; - const cancel = () => { cancellers.forEach((c) => c()); }; - // On cancel, stop scanning for replacements - cancellers.push(() => { stopScanning = true; }); - // Set up any timeout requested - if (timeout > 0) { - const timer = setTimeout(() => { - cancel(); - reject((0, index_js_1.makeError)("wait for transaction timeout", "TIMEOUT")); - }, timeout); - cancellers.push(() => { clearTimeout(timer); }); - } - const txListener = async (receipt) => { - // Done; return it! - if ((await receipt.confirmations()) >= confirms) { - cancel(); - try { - resolve(checkReceipt(receipt)); - } - catch (error) { - reject(error); - } - } - }; - cancellers.push(() => { this.provider.off(this.hash, txListener); }); - this.provider.on(this.hash, txListener); - // We support replacement detection; start checking - if (startBlock >= 0) { - const replaceListener = async () => { - try { - // Check for a replacement; this throws only if one is found - await checkReplacement(); - } - catch (error) { - // We were replaced (with enough confirms); re-throw the error - if ((0, index_js_1.isError)(error, "TRANSACTION_REPLACED")) { - cancel(); - reject(error); - return; - } - } - // Rescheudle a check on the next block - if (!stopScanning) { - this.provider.once("block", replaceListener); - } - }; - cancellers.push(() => { this.provider.off("block", replaceListener); }); - this.provider.once("block", replaceListener); - } - }); - return await waiter; - } - /** - * Returns ``true`` if this transaction has been included. - * - * This is effective only as of the time the TransactionResponse - * was instantiated. To get up-to-date information, use - * [[getTransaction]]. - * - * This provides a Type Guard that this transaction will have - * non-null property values for properties that are null for - * unmined transactions. - */ - isMined() { - return (this.blockHash != null); - } - /** - * Returns true if the transaction is a legacy (i.e. ``type == 0``) - * transaction. - * - * This provides a Type Guard that this transaction will have - * the ``null``-ness for hardfork-specific properties set correctly. - */ - isLegacy() { - return (this.type === 0); - } - /** - * Returns true if the transaction is a Berlin (i.e. ``type == 1``) - * transaction. See [[link-eip-2070]]. - * - * This provides a Type Guard that this transaction will have - * the ``null``-ness for hardfork-specific properties set correctly. - */ - isBerlin() { - return (this.type === 1); - } - /** - * Returns true if the transaction is a London (i.e. ``type == 2``) - * transaction. See [[link-eip-1559]]. - * - * This provides a Type Guard that this transaction will have - * the ``null``-ness for hardfork-specific properties set correctly. - */ - isLondon() { - return (this.type === 2); - } - /** - * Returns true if hte transaction is a Cancun (i.e. ``type == 3``) - * transaction. See [[link-eip-4844]]. - */ - isCancun() { - return (this.type === 3); - } - /** - * Returns a filter which can be used to listen for orphan events - * that evict this transaction. - */ - removedEvent() { - (0, index_js_1.assert)(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); - return createRemovedTransactionFilter(this); - } - /** - * Returns a filter which can be used to listen for orphan events - * that re-order this event against %%other%%. - */ - reorderedEvent(other) { - (0, index_js_1.assert)(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); - (0, index_js_1.assert)(!other || other.isMined(), "unmined 'other' transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); - return createReorderedTransactionFilter(this, other); - } - /** - * Returns a new TransactionResponse instance which has the ability to - * detect (and throw an error) if the transaction is replaced, which - * will begin scanning at %%startBlock%%. - * - * This should generally not be used by developers and is intended - * primarily for internal use. Setting an incorrect %%startBlock%% can - * have devastating performance consequences if used incorrectly. - */ - replaceableTransaction(startBlock) { - (0, index_js_1.assertArgument)(Number.isInteger(startBlock) && startBlock >= 0, "invalid startBlock", "startBlock", startBlock); - const tx = new TransactionResponse(this, this.provider); - tx.#startBlock = startBlock; - return tx; - } -} -exports.TransactionResponse = TransactionResponse; -function createOrphanedBlockFilter(block) { - return { orphan: "drop-block", hash: block.hash, number: block.number }; -} -function createReorderedTransactionFilter(tx, other) { - return { orphan: "reorder-transaction", tx, other }; -} -function createRemovedTransactionFilter(tx) { - return { orphan: "drop-transaction", tx }; -} -function createRemovedLogFilter(log) { - return { orphan: "drop-log", log: { - transactionHash: log.transactionHash, - blockHash: log.blockHash, - blockNumber: log.blockNumber, - address: log.address, - data: log.data, - topics: Object.freeze(log.topics.slice()), - index: log.index - } }; -} -//# sourceMappingURL=provider.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider.js.map deleted file mode 100644 index 1ba66af5..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/provider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src.ts/providers/provider.ts"],"names":[],"mappings":";;;AAAA,0DAA0D;AAC1D,gDAI2B;AAC3B,sDAAwD;AAcxD,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAsBvB,0BAA0B;AAE1B,SAAS,QAAQ,CAAI,KAA2B;IAC5C,IAAI,KAAK,IAAI,IAAI,EAAE;QAAE,OAAO,IAAI,CAAC;KAAE;IACnC,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,SAAS,MAAM,CAAC,KAAoB;IAChC,IAAI,KAAK,IAAI,IAAI,EAAE;QAAE,OAAO,IAAI,CAAC;KAAE;IACnC,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;AAC5B,CAAC;AAED,0DAA0D;AAE1D;;;GAGG;AACH,MAAa,OAAO;IAChB;;OAEG;IACM,QAAQ,CAAiB;IAElC;;;;;;;;;;;OAWG;IACM,YAAY,CAAiB;IAEtC;;;;;;;;OAQG;IACM,oBAAoB,CAAiB;IAE9C;;;OAGG;IACH,YAAY,QAAwB,EAAE,YAA4B,EAAE,oBAAoC;QACpG,IAAA,2BAAgB,EAAU,IAAI,EAAE;YAC5B,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC;YAC5B,YAAY,EAAE,QAAQ,CAAC,YAAY,CAAC;YACpC,oBAAoB,EAAE,QAAQ,CAAC,oBAAoB,CAAC;SACvD,CAAC,CAAC;IACP,CAAC;IAED;;OAEG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M,CAAC,KAAK,EAAE,CAAC;YACzC,KAAK,EAAE,GAAG,CAAC,KAAK;SACnB,EAAE,CAAC;AACR,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/signer-noncemanager.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/signer-noncemanager.d.ts deleted file mode 100644 index 4224b601..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/signer-noncemanager.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { AbstractSigner } from "./abstract-signer.js"; -import type { TypedDataDomain, TypedDataField } from "../hash/index.js"; -import type { BlockTag, Provider, TransactionRequest, TransactionResponse } from "./provider.js"; -import type { Signer } from "./signer.js"; -/** - * A **NonceManager** wraps another [[Signer]] and automatically manages - * the nonce, ensuring serialized and sequential nonces are used during - * transaction. - */ -export declare class NonceManager extends AbstractSigner { - #private; - /** - * The Signer being managed. - */ - signer: Signer; - /** - * Creates a new **NonceManager** to manage %%signer%%. - */ - constructor(signer: Signer); - getAddress(): Promise; - connect(provider: null | Provider): NonceManager; - getNonce(blockTag?: BlockTag): Promise; - /** - * Manually increment the nonce. This may be useful when managng - * offline transactions. - */ - increment(): void; - /** - * Resets the nonce, causing the **NonceManager** to reload the current - * nonce from the blockchain on the next transaction. - */ - reset(): void; - sendTransaction(tx: TransactionRequest): Promise; - signTransaction(tx: TransactionRequest): Promise; - signMessage(message: string | Uint8Array): Promise; - signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise; -} -//# sourceMappingURL=signer-noncemanager.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/signer-noncemanager.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/signer-noncemanager.d.ts.map deleted file mode 100644 index 7142ec44..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/signer-noncemanager.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signer-noncemanager.d.ts","sourceRoot":"","sources":["../../src.ts/providers/signer-noncemanager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAExE,OAAO,KAAK,EACR,QAAQ,EAAE,QAAQ,EAAE,kBAAkB,EAAE,mBAAmB,EAC9D,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAG1C;;;;GAIG;AACH,qBAAa,YAAa,SAAQ,cAAc;;IAC5C;;OAEG;IACH,MAAM,EAAG,MAAM,CAAC;IAKhB;;OAEG;gBACS,MAAM,EAAE,MAAM;IAQpB,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC;IAInC,OAAO,CAAC,QAAQ,EAAE,IAAI,GAAG,QAAQ,GAAG,YAAY;IAI1C,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;IAapD;;;OAGG;IACH,SAAS,IAAI,IAAI;IAIjB;;;OAGG;IACH,KAAK,IAAI,IAAI;IAKP,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAY3E,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IAIxD,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;IAI1D,aAAa,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;CAGpI"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/signer-noncemanager.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/signer-noncemanager.js deleted file mode 100644 index 4989e410..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/signer-noncemanager.js +++ /dev/null @@ -1,78 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.NonceManager = void 0; -const index_js_1 = require("../utils/index.js"); -const abstract_signer_js_1 = require("./abstract-signer.js"); -/** - * A **NonceManager** wraps another [[Signer]] and automatically manages - * the nonce, ensuring serialized and sequential nonces are used during - * transaction. - */ -class NonceManager extends abstract_signer_js_1.AbstractSigner { - /** - * The Signer being managed. - */ - signer; - #noncePromise; - #delta; - /** - * Creates a new **NonceManager** to manage %%signer%%. - */ - constructor(signer) { - super(signer.provider); - (0, index_js_1.defineProperties)(this, { signer }); - this.#noncePromise = null; - this.#delta = 0; - } - async getAddress() { - return this.signer.getAddress(); - } - connect(provider) { - return new NonceManager(this.signer.connect(provider)); - } - async getNonce(blockTag) { - if (blockTag === "pending") { - if (this.#noncePromise == null) { - this.#noncePromise = super.getNonce("pending"); - } - const delta = this.#delta; - return (await this.#noncePromise) + delta; - } - return super.getNonce(blockTag); - } - /** - * Manually increment the nonce. This may be useful when managng - * offline transactions. - */ - increment() { - this.#delta++; - } - /** - * Resets the nonce, causing the **NonceManager** to reload the current - * nonce from the blockchain on the next transaction. - */ - reset() { - this.#delta = 0; - this.#noncePromise = null; - } - async sendTransaction(tx) { - const noncePromise = this.getNonce("pending"); - this.increment(); - tx = await this.signer.populateTransaction(tx); - tx.nonce = await noncePromise; - // @TODO: Maybe handle interesting/recoverable errors? - // Like don't increment if the tx was certainly not sent - return await this.signer.sendTransaction(tx); - } - signTransaction(tx) { - return this.signer.signTransaction(tx); - } - signMessage(message) { - return this.signer.signMessage(message); - } - signTypedData(domain, types, value) { - return this.signer.signTypedData(domain, types, value); - } -} -exports.NonceManager = NonceManager; -//# sourceMappingURL=signer-noncemanager.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/signer-noncemanager.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/signer-noncemanager.js.map deleted file mode 100644 index e3efb0be..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/signer-noncemanager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signer-noncemanager.js","sourceRoot":"","sources":["../../src.ts/providers/signer-noncemanager.ts"],"names":[],"mappings":";;;AAAA,gDAAqD;AACrD,6DAAsD;AAUtD;;;;GAIG;AACH,MAAa,YAAa,SAAQ,mCAAc;IAC5C;;OAEG;IACH,MAAM,CAAU;IAEhB,aAAa,CAAyB;IACtC,MAAM,CAAS;IAEf;;OAEG;IACH,YAAY,MAAc;QACtB,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACvB,IAAA,2BAAgB,EAAe,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QAEjD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IACpB,CAAC;IAED,KAAK,CAAC,UAAU;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;IACpC,CAAC;IAED,OAAO,CAAC,QAAyB;QAC7B,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC3D,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,QAAmB;QAC9B,IAAI,QAAQ,KAAK,SAAS,EAAE;YACxB,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,EAAE;gBAC5B,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;aAClD;YAED,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;YAC1B,OAAO,CAAC,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,KAAK,CAAC;SAC7C;QAED,OAAO,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;IAED;;;OAGG;IACH,SAAS;QACL,IAAI,CAAC,MAAM,EAAE,CAAC;IAClB,CAAC;IAED;;;OAGG;IACH,KAAK;QACD,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAChB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;IAC9B,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,EAAsB;QACxC,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QAC9C,IAAI,CAAC,SAAS,EAAE,CAAC;QAEjB,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC;QAC/C,EAAE,CAAC,KAAK,GAAG,MAAM,YAAY,CAAC;QAE9B,sDAAsD;QACtD,wDAAwD;QACxD,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,eAAe,CAAC,EAAsB;QAClC,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;IAC3C,CAAC;IAED,WAAW,CAAC,OAA4B;QACpC,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC;IAED,aAAa,CAAC,MAAuB,EAAE,KAA4C,EAAE,KAA0B;QAC3G,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAC3D,CAAC;CACJ;AAjFD,oCAiFC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/signer.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/signer.d.ts deleted file mode 100644 index f6d1aa82..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/signer.d.ts +++ /dev/null @@ -1,131 +0,0 @@ -import type { Addressable, NameResolver } from "../address/index.js"; -import type { AuthorizationRequest, TypedDataDomain, TypedDataField } from "../hash/index.js"; -import type { Authorization, TransactionLike } from "../transaction/index.js"; -import type { ContractRunner } from "./contracts.js"; -import type { BlockTag, Provider, TransactionRequest, TransactionResponse } from "./provider.js"; -/** - * A Signer represents an account on the Ethereum Blockchain, and is most often - * backed by a private key represented by a mnemonic or residing on a Hardware Wallet. - * - * The API remains abstract though, so that it can deal with more advanced exotic - * Signing entities, such as Smart Contract Wallets or Virtual Wallets (where the - * private key may not be known). - */ -export interface Signer extends Addressable, ContractRunner, NameResolver { - /** - * The [[Provider]] attached to this Signer (if any). - */ - provider: null | Provider; - /** - * Returns a new instance of this Signer connected to //provider// or detached - * from any Provider if null. - */ - connect(provider: null | Provider): Signer; - /** - * Get the address of the Signer. - */ - getAddress(): Promise; - /** - * Gets the next nonce required for this Signer to send a transaction. - * - * @param blockTag - The blocktag to base the transaction count on, keep in mind - * many nodes do not honour this value and silently ignore it [default: ``"latest"``] - */ - getNonce(blockTag?: BlockTag): Promise; - /** - * Prepares a {@link TransactionRequest} for calling: - * - resolves ``to`` and ``from`` addresses - * - if ``from`` is specified , check that it matches this Signer - * - * @param tx - The call to prepare - */ - populateCall(tx: TransactionRequest): Promise>; - /** - * Prepares a {@link TransactionRequest} for sending to the network by - * populating any missing properties: - * - resolves ``to`` and ``from`` addresses - * - if ``from`` is specified , check that it matches this Signer - * - populates ``nonce`` via ``signer.getNonce("pending")`` - * - populates ``gasLimit`` via ``signer.estimateGas(tx)`` - * - populates ``chainId`` via ``signer.provider.getNetwork()`` - * - populates ``type`` and relevant fee data for that type (``gasPrice`` - * for legacy transactions, ``maxFeePerGas`` for EIP-1559, etc) - * - * @note Some Signer implementations may skip populating properties that - * are populated downstream; for example JsonRpcSigner defers to the - * node to populate the nonce and fee data. - * - * @param tx - The call to prepare - */ - populateTransaction(tx: TransactionRequest): Promise>; - /** - * Estimates the required gas required to execute //tx// on the Blockchain. This - * will be the expected amount a transaction will require as its ``gasLimit`` - * to successfully run all the necessary computations and store the needed state - * that the transaction intends. - * - * Keep in mind that this is **best efforts**, since the state of the Blockchain - * is in flux, which could affect transaction gas requirements. - * - * @throws UNPREDICTABLE_GAS_LIMIT A transaction that is believed by the node to likely - * fail will throw an error during gas estimation. This could indicate that it - * will actually fail or that the circumstances are simply too complex for the - * node to take into account. In these cases, a manually determined ``gasLimit`` - * will need to be made. - */ - estimateGas(tx: TransactionRequest): Promise; - /** - * Evaluates the //tx// by running it against the current Blockchain state. This - * cannot change state and has no cost in ether, as it is effectively simulating - * execution. - * - * This can be used to have the Blockchain perform computations based on its state - * (e.g. running a Contract's getters) or to simulate the effect of a transaction - * before actually performing an operation. - */ - call(tx: TransactionRequest): Promise; - /** - * Resolves an ENS Name to an address. - */ - resolveName(name: string): Promise; - /** - * Signs %%tx%%, returning the fully signed transaction. This does not - * populate any additional properties within the transaction. - */ - signTransaction(tx: TransactionRequest): Promise; - /** - * Sends %%tx%% to the Network. The ``signer.populateTransaction(tx)`` - * is called first to ensure all necessary properties for the - * transaction to be valid have been popualted first. - */ - sendTransaction(tx: TransactionRequest): Promise; - /** - * Signs an [[link-eip-191]] prefixed personal message. - * - * If the %%message%% is a string, it is signed as UTF-8 encoded bytes. It is **not** - * interpretted as a [[BytesLike]]; so the string ``"0x1234"`` is signed as six - * characters, **not** two bytes. - * - * To sign that example as two bytes, the Uint8Array should be used - * (i.e. ``new Uint8Array([ 0x12, 0x34 ])``). - */ - signMessage(message: string | Uint8Array): Promise; - /** - * Signs the [[link-eip-712]] typed data. - */ - signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise; - /** - * Prepares an [[AuthorizationRequest]] for authorization by - * populating any missing properties: - * - resolves ``address`` (if an Addressable or ENS name) - * - populates ``nonce`` via ``signer.getNonce("pending")`` - * - populates ``chainId`` via ``signer.provider.getNetwork()`` - */ - populateAuthorization(auth: AuthorizationRequest): Promise; - /** - * Signs an %%authorization%% to be used in [[link-eip-7702]] - * transactions. - */ - authorize(authorization: AuthorizationRequest): Promise; -} -//# sourceMappingURL=signer.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/signer.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/signer.d.ts.map deleted file mode 100644 index 41b74e7f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/signer.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../src.ts/providers/signer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,EACR,oBAAoB,EAAE,eAAe,EAAE,cAAc,EACxD,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEjG;;;;;;;GAOG;AACH,MAAM,WAAW,MAAO,SAAQ,WAAW,EAAE,cAAc,EAAE,YAAY;IAErE;;OAEG;IACH,QAAQ,EAAE,IAAI,GAAG,QAAQ,CAAC;IAE1B;;;OAGG;IACH,OAAO,CAAC,QAAQ,EAAE,IAAI,GAAG,QAAQ,GAAG,MAAM,CAAC;IAM3C;;OAEG;IACH,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAE9B;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAM/C;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IAEvE;;;;;;;;;;;;;;;;OAgBG;IACH,mBAAmB,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IAM9E;;;;;;;;;;;;;;OAcG;IACH,WAAW,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAErD;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE9C;;OAEG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;IAMlD;;;OAGG;IACH,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEzD;;;;OAIG;IACH,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEtE;;;;;;;;;OASG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE3D;;OAEG;IACH,aAAa,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAElI;;;;;;OAMG;IACH,qBAAqB,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAEjF;;;OAGG;IACH,SAAS,CAAC,aAAa,EAAE,oBAAoB,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CAC1E"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/signer.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/signer.js deleted file mode 100644 index c73406ac..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/signer.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=signer.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/signer.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/signer.js.map deleted file mode 100644 index 68d48a83..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/signer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signer.js","sourceRoot":"","sources":["../../src.ts/providers/signer.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-connection.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-connection.d.ts deleted file mode 100644 index b235e3b4..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-connection.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { Subscriber } from "./abstract-provider.js"; -import type { Provider } from "./provider.js"; -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export interface ConnectionRpcProvider extends Provider { - _subscribe(param: Array, processFunc: (result: any) => void): number; - _unsubscribe(filterId: number): void; -} -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export declare class BlockConnectionSubscriber implements Subscriber { - #private; - constructor(provider: ConnectionRpcProvider); - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; -} -//# sourceMappingURL=subscriber-connection.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-connection.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-connection.d.ts.map deleted file mode 100644 index a1d8c3e7..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-connection.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"subscriber-connection.d.ts","sourceRoot":"","sources":["../../src.ts/providers/subscriber-connection.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAIzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C;;;;GAIG;AACH,MAAM,WAAW,qBAAsB,SAAQ,QAAQ;IAEnD,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,GAAG,MAAM,CAAC;IAC1E,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACxC;AAED;;;;GAIG;AACH,qBAAa,yBAA0B,YAAW,UAAU;;gBAQ5C,QAAQ,EAAE,qBAAqB;IAO3C,KAAK,IAAI,IAAI;IAcb,IAAI,IAAI,IAAI;IAUZ,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI;IAKtC,MAAM,IAAI,IAAI;CAGjB"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-connection.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-connection.js deleted file mode 100644 index 931d2f29..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-connection.js +++ /dev/null @@ -1,56 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.BlockConnectionSubscriber = void 0; -const index_js_1 = require("../utils/index.js"); -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -class BlockConnectionSubscriber { - #provider; - #blockNumber; - #running; - #filterId; - constructor(provider) { - this.#provider = provider; - this.#blockNumber = -2; - this.#running = false; - this.#filterId = null; - } - start() { - if (this.#running) { - return; - } - this.#running = true; - this.#filterId = this.#provider._subscribe(["newHeads"], (result) => { - const blockNumber = (0, index_js_1.getNumber)(result.number); - const initial = (this.#blockNumber === -2) ? blockNumber : (this.#blockNumber + 1); - for (let b = initial; b <= blockNumber; b++) { - this.#provider.emit("block", b); - } - this.#blockNumber = blockNumber; - }); - } - stop() { - if (!this.#running) { - return; - } - this.#running = false; - if (this.#filterId != null) { - this.#provider._unsubscribe(this.#filterId); - this.#filterId = null; - } - } - pause(dropWhilePaused) { - if (dropWhilePaused) { - this.#blockNumber = -2; - } - this.stop(); - } - resume() { - this.start(); - } -} -exports.BlockConnectionSubscriber = BlockConnectionSubscriber; -//# sourceMappingURL=subscriber-connection.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-connection.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-connection.js.map deleted file mode 100644 index dffe2d17..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-connection.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"subscriber-connection.js","sourceRoot":"","sources":["../../src.ts/providers/subscriber-connection.ts"],"names":[],"mappings":";;;AACA,gDAA8C;AAmB9C;;;;GAIG;AACH,MAAa,yBAAyB;IAClC,SAAS,CAAwB;IACjC,YAAY,CAAS;IAErB,QAAQ,CAAU;IAElB,SAAS,CAAgB;IAEzB,YAAY,QAA+B;QACvC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IAC1B,CAAC;IAED,KAAK;QACD,IAAI,IAAI,CAAC,QAAQ,EAAE;YAAE,OAAO;SAAE;QAC9B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QAErB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAE,UAAU,CAAE,EAAE,CAAC,MAAW,EAAE,EAAE;YACvE,MAAM,WAAW,GAAG,IAAA,oBAAS,EAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAC7C,MAAM,OAAO,GAAG,CAAC,IAAI,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAA,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAA;YACjF,KAAK,IAAI,CAAC,GAAG,OAAO,EAAE,CAAC,IAAI,WAAW,EAAE,CAAC,EAAE,EAAE;gBACzC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;aACnC;YACD,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QACpC,CAAC,CAAC,CAAC;IACP,CAAC;IAED,IAAI;QACA,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAAE,OAAO;SAAE;QAC/B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QAEtB,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,EAAE;YACxB,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC5C,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;SACzB;IACL,CAAC;IAED,KAAK,CAAC,eAAyB;QAC3B,IAAI,eAAe,EAAE;YAAE,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;SAAE;QAChD,IAAI,CAAC,IAAI,EAAE,CAAC;IAChB,CAAC;IAED,MAAM;QACF,IAAI,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;CACJ;AA/CD,8DA+CC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-filterid.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-filterid.d.ts deleted file mode 100644 index 721d6284..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-filterid.d.ts +++ /dev/null @@ -1,64 +0,0 @@ -import type { AbstractProvider, Subscriber } from "./abstract-provider.js"; -import type { EventFilter } from "./provider.js"; -import type { JsonRpcApiProvider } from "./provider-jsonrpc.js"; -/** - * Some backends support subscribing to events using a Filter ID. - * - * When subscribing with this technique, the node issues a unique - * //Filter ID//. At this point the node dedicates resources to - * the filter, so that periodic calls to follow up on the //Filter ID// - * will receive any events since the last call. - * - * @_docloc: api/providers/abstract-provider - */ -export declare class FilterIdSubscriber implements Subscriber { - #private; - /** - * Creates a new **FilterIdSubscriber** which will used [[_subscribe]] - * and [[_emitResults]] to setup the subscription and provide the event - * to the %%provider%%. - */ - constructor(provider: JsonRpcApiProvider); - /** - * Sub-classes **must** override this to begin the subscription. - */ - _subscribe(provider: JsonRpcApiProvider): Promise; - /** - * Sub-classes **must** override this handle the events. - */ - _emitResults(provider: AbstractProvider, result: Array): Promise; - /** - * Sub-classes **must** override this handle recovery on errors. - */ - _recover(provider: AbstractProvider): Subscriber; - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; -} -/** - * A **FilterIdSubscriber** for receiving contract events. - * - * @_docloc: api/providers/abstract-provider - */ -export declare class FilterIdEventSubscriber extends FilterIdSubscriber { - #private; - /** - * Creates a new **FilterIdEventSubscriber** attached to %%provider%% - * listening for %%filter%%. - */ - constructor(provider: JsonRpcApiProvider, filter: EventFilter); - _recover(provider: AbstractProvider): Subscriber; - _subscribe(provider: JsonRpcApiProvider): Promise; - _emitResults(provider: JsonRpcApiProvider, results: Array): Promise; -} -/** - * A **FilterIdSubscriber** for receiving pending transactions events. - * - * @_docloc: api/providers/abstract-provider - */ -export declare class FilterIdPendingSubscriber extends FilterIdSubscriber { - _subscribe(provider: JsonRpcApiProvider): Promise; - _emitResults(provider: JsonRpcApiProvider, results: Array): Promise; -} -//# sourceMappingURL=subscriber-filterid.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-filterid.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-filterid.d.ts.map deleted file mode 100644 index d012b466..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-filterid.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"subscriber-filterid.d.ts","sourceRoot":"","sources":["../../src.ts/providers/subscriber-filterid.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAE3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAMhE;;;;;;;;;GASG;AACH,qBAAa,kBAAmB,YAAW,UAAU;;IAYjD;;;;OAIG;gBACS,QAAQ,EAAE,kBAAkB;IAaxC;;OAEG;IACH,UAAU,CAAC,QAAQ,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IAIzD;;OAEG;IACH,YAAY,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3E;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,GAAG,UAAU;IAwDhD,KAAK,IAAI,IAAI;IAOb,IAAI,IAAI,IAAI;IASZ,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI;IAKtC,MAAM,IAAI,IAAI;CACjB;AAED;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,kBAAkB;;IAG3D;;;OAGG;gBACS,QAAQ,EAAE,kBAAkB,EAAE,MAAM,EAAE,WAAW;IAK7D,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,GAAG,UAAU;IAI1C,UAAU,CAAC,QAAQ,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IAKzD,YAAY,CAAC,QAAQ,EAAE,kBAAkB,EAAE,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAKvF;AAED;;;;GAIG;AACH,qBAAa,yBAA0B,SAAQ,kBAAkB;IACvD,UAAU,CAAC,QAAQ,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IAIzD,YAAY,CAAC,QAAQ,EAAE,kBAAkB,EAAE,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAKvF"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-filterid.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-filterid.js deleted file mode 100644 index cd4590a3..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-filterid.js +++ /dev/null @@ -1,180 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FilterIdPendingSubscriber = exports.FilterIdEventSubscriber = exports.FilterIdSubscriber = void 0; -const index_js_1 = require("../utils/index.js"); -const subscriber_polling_js_1 = require("./subscriber-polling.js"); -function copy(obj) { - return JSON.parse(JSON.stringify(obj)); -} -/** - * Some backends support subscribing to events using a Filter ID. - * - * When subscribing with this technique, the node issues a unique - * //Filter ID//. At this point the node dedicates resources to - * the filter, so that periodic calls to follow up on the //Filter ID// - * will receive any events since the last call. - * - * @_docloc: api/providers/abstract-provider - */ -class FilterIdSubscriber { - #provider; - #filterIdPromise; - #poller; - #running; - #network; - #hault; - /** - * Creates a new **FilterIdSubscriber** which will used [[_subscribe]] - * and [[_emitResults]] to setup the subscription and provide the event - * to the %%provider%%. - */ - constructor(provider) { - this.#provider = provider; - this.#filterIdPromise = null; - this.#poller = this.#poll.bind(this); - this.#running = false; - this.#network = null; - this.#hault = false; - } - /** - * Sub-classes **must** override this to begin the subscription. - */ - _subscribe(provider) { - throw new Error("subclasses must override this"); - } - /** - * Sub-classes **must** override this handle the events. - */ - _emitResults(provider, result) { - throw new Error("subclasses must override this"); - } - /** - * Sub-classes **must** override this handle recovery on errors. - */ - _recover(provider) { - throw new Error("subclasses must override this"); - } - async #poll(blockNumber) { - try { - // Subscribe if necessary - if (this.#filterIdPromise == null) { - this.#filterIdPromise = this._subscribe(this.#provider); - } - // Get the Filter ID - let filterId = null; - try { - filterId = await this.#filterIdPromise; - } - catch (error) { - if (!(0, index_js_1.isError)(error, "UNSUPPORTED_OPERATION") || error.operation !== "eth_newFilter") { - throw error; - } - } - // The backend does not support Filter ID; downgrade to - // polling - if (filterId == null) { - this.#filterIdPromise = null; - this.#provider._recoverSubscriber(this, this._recover(this.#provider)); - return; - } - const network = await this.#provider.getNetwork(); - if (!this.#network) { - this.#network = network; - } - if (this.#network.chainId !== network.chainId) { - throw new Error("chaid changed"); - } - if (this.#hault) { - return; - } - const result = await this.#provider.send("eth_getFilterChanges", [filterId]); - await this._emitResults(this.#provider, result); - } - catch (error) { - console.log("@TODO", error); - } - this.#provider.once("block", this.#poller); - } - #teardown() { - const filterIdPromise = this.#filterIdPromise; - if (filterIdPromise) { - this.#filterIdPromise = null; - filterIdPromise.then((filterId) => { - if (this.#provider.destroyed) { - return; - } - this.#provider.send("eth_uninstallFilter", [filterId]); - }); - } - } - start() { - if (this.#running) { - return; - } - this.#running = true; - this.#poll(-2); - } - stop() { - if (!this.#running) { - return; - } - this.#running = false; - this.#hault = true; - this.#teardown(); - this.#provider.off("block", this.#poller); - } - pause(dropWhilePaused) { - if (dropWhilePaused) { - this.#teardown(); - } - this.#provider.off("block", this.#poller); - } - resume() { this.start(); } -} -exports.FilterIdSubscriber = FilterIdSubscriber; -/** - * A **FilterIdSubscriber** for receiving contract events. - * - * @_docloc: api/providers/abstract-provider - */ -class FilterIdEventSubscriber extends FilterIdSubscriber { - #event; - /** - * Creates a new **FilterIdEventSubscriber** attached to %%provider%% - * listening for %%filter%%. - */ - constructor(provider, filter) { - super(provider); - this.#event = copy(filter); - } - _recover(provider) { - return new subscriber_polling_js_1.PollingEventSubscriber(provider, this.#event); - } - async _subscribe(provider) { - const filterId = await provider.send("eth_newFilter", [this.#event]); - return filterId; - } - async _emitResults(provider, results) { - for (const result of results) { - provider.emit(this.#event, provider._wrapLog(result, provider._network)); - } - } -} -exports.FilterIdEventSubscriber = FilterIdEventSubscriber; -/** - * A **FilterIdSubscriber** for receiving pending transactions events. - * - * @_docloc: api/providers/abstract-provider - */ -class FilterIdPendingSubscriber extends FilterIdSubscriber { - async _subscribe(provider) { - return await provider.send("eth_newPendingTransactionFilter", []); - } - async _emitResults(provider, results) { - for (const result of results) { - provider.emit("pending", result); - } - } -} -exports.FilterIdPendingSubscriber = FilterIdPendingSubscriber; -//# sourceMappingURL=subscriber-filterid.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-filterid.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-filterid.js.map deleted file mode 100644 index f2b3e285..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-filterid.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"subscriber-filterid.js","sourceRoot":"","sources":["../../src.ts/providers/subscriber-filterid.ts"],"names":[],"mappings":";;;AAAA,gDAA4C;AAE5C,mEAAiE;AAOjE,SAAS,IAAI,CAAC,GAAQ;IAClB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED;;;;;;;;;GASG;AACH,MAAa,kBAAkB;IAC3B,SAAS,CAAqB;IAE9B,gBAAgB,CAAyB;IACzC,OAAO,CAA+B;IAEtC,QAAQ,CAAU;IAElB,QAAQ,CAAiB;IAEzB,MAAM,CAAU;IAEhB;;;;OAIG;IACH,YAAY,QAA4B;QACpC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAE1B,IAAI,CAAC,gBAAgB,GAAG,IA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C,YAAY,CAAC,QAA4B,EAAE,OAAmB;QAChE,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;YAC1B,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;SAC5E;IACL,CAAC;CACJ;AA1BD,0DA0BC;AAED;;;;GAIG;AACH,MAAa,yBAA0B,SAAQ,kBAAkB;IAC7D,KAAK,CAAC,UAAU,CAAC,QAA4B;QACzC,OAAO,MAAM,QAAQ,CAAC,IAAI,CAAC,iCAAiC,EAAE,EAAG,CAAC,CAAC;IACvE,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,QAA4B,EAAE,OAAmB;QAChE,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;YAC1B,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;SACpC;IACL,CAAC;CACJ;AAVD,8DAUC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-polling.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-polling.d.ts deleted file mode 100644 index e751ba48..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-polling.d.ts +++ /dev/null @@ -1,100 +0,0 @@ -import type { AbstractProvider, Subscriber } from "./abstract-provider.js"; -import type { EventFilter, OrphanFilter, ProviderEvent } from "./provider.js"; -/** - * Return the polling subscriber for common events. - * - * @_docloc: api/providers/abstract-provider - */ -export declare function getPollingSubscriber(provider: AbstractProvider, event: ProviderEvent): Subscriber; -/** - * A **PollingBlockSubscriber** polls at a regular interval for a change - * in the block number. - * - * @_docloc: api/providers/abstract-provider - */ -export declare class PollingBlockSubscriber implements Subscriber { - #private; - /** - * Create a new **PollingBlockSubscriber** attached to %%provider%%. - */ - constructor(provider: AbstractProvider); - /** - * The polling interval. - */ - get pollingInterval(): number; - set pollingInterval(value: number); - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; -} -/** - * An **OnBlockSubscriber** can be sub-classed, with a [[_poll]] - * implmentation which will be called on every new block. - * - * @_docloc: api/providers/abstract-provider - */ -export declare class OnBlockSubscriber implements Subscriber { - #private; - /** - * Create a new **OnBlockSubscriber** attached to %%provider%%. - */ - constructor(provider: AbstractProvider); - /** - * Called on every new block. - */ - _poll(blockNumber: number, provider: AbstractProvider): Promise; - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; -} -export declare class PollingBlockTagSubscriber extends OnBlockSubscriber { - #private; - constructor(provider: AbstractProvider, tag: string); - pause(dropWhilePaused?: boolean): void; - _poll(blockNumber: number, provider: AbstractProvider): Promise; -} -/** - * @_ignore: - * - * @_docloc: api/providers/abstract-provider - */ -export declare class PollingOrphanSubscriber extends OnBlockSubscriber { - #private; - constructor(provider: AbstractProvider, filter: OrphanFilter); - _poll(blockNumber: number, provider: AbstractProvider): Promise; -} -/** - * A **PollingTransactionSubscriber** will poll for a given transaction - * hash for its receipt. - * - * @_docloc: api/providers/abstract-provider - */ -export declare class PollingTransactionSubscriber extends OnBlockSubscriber { - #private; - /** - * Create a new **PollingTransactionSubscriber** attached to - * %%provider%%, listening for %%hash%%. - */ - constructor(provider: AbstractProvider, hash: string); - _poll(blockNumber: number, provider: AbstractProvider): Promise; -} -/** - * A **PollingEventSubscriber** will poll for a given filter for its logs. - * - * @_docloc: api/providers/abstract-provider - */ -export declare class PollingEventSubscriber implements Subscriber { - #private; - /** - * Create a new **PollingTransactionSubscriber** attached to - * %%provider%%, listening for %%filter%%. - */ - constructor(provider: AbstractProvider, filter: EventFilter); - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; -} -//# sourceMappingURL=subscriber-polling.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-polling.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-polling.d.ts.map deleted file mode 100644 index 193b2aae..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-polling.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"subscriber-polling.d.ts","sourceRoot":"","sources":["../../src.ts/providers/subscriber-polling.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAM9E;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,KAAK,EAAE,aAAa,GAAG,UAAU,CAOjG;AAID;;;;;GAKG;AACH,qBAAa,sBAAuB,YAAW,UAAU;;IAUrD;;OAEG;gBACS,QAAQ,EAAE,gBAAgB;IAQtC;;OAEG;IACH,IAAI,eAAe,IAAI,MAAM,CAA2B;IACxD,IAAI,eAAe,CAAC,KAAK,EAAE,MAAM,EAA6B;IAqC9D,KAAK,IAAI,IAAI;IAMb,IAAI,IAAI,IAAI;IAMZ,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI;IAKtC,MAAM,IAAI,IAAI;CAGjB;AAGD;;;;;GAKG;AACH,qBAAa,iBAAkB,YAAW,UAAU;;IAKhD;;OAEG;gBACS,QAAQ,EAAE,gBAAgB;IAQtC;;OAEG;IACG,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3E,KAAK,IAAI,IAAI;IAQb,IAAI,IAAI,IAAI;IAOZ,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI;IACtC,MAAM,IAAI,IAAI;CACjB;AAED,qBAAa,yBAA0B,SAAQ,iBAAiB;;gBAIhD,QAAQ,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM;IAMnD,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI;IAKhC,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;CAW9E;AAGD;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,iBAAiB;;gBAG9C,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,YAAY;IAKtD,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;CAI9E;AAED;;;;;GAKG;AACH,qBAAa,4BAA6B,SAAQ,iBAAiB;;IAG/D;;;OAGG;gBACS,QAAQ,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM;IAK9C,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;CAI9E;AAED;;;;GAIG;AACH,qBAAa,sBAAuB,YAAW,UAAU;;IAWrD;;;OAGG;gBACS,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,WAAW;IAqC3D,KAAK,IAAI,IAAI;IAYb,IAAI,IAAI,IAAI;IAOZ,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI;IAKtC,MAAM,IAAI,IAAI;CAGjB"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-polling.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-polling.js deleted file mode 100644 index 2a390d41..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-polling.js +++ /dev/null @@ -1,303 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.PollingEventSubscriber = exports.PollingTransactionSubscriber = exports.PollingOrphanSubscriber = exports.PollingBlockTagSubscriber = exports.OnBlockSubscriber = exports.PollingBlockSubscriber = exports.getPollingSubscriber = void 0; -const index_js_1 = require("../utils/index.js"); -function copy(obj) { - return JSON.parse(JSON.stringify(obj)); -} -/** - * Return the polling subscriber for common events. - * - * @_docloc: api/providers/abstract-provider - */ -function getPollingSubscriber(provider, event) { - if (event === "block") { - return new PollingBlockSubscriber(provider); - } - if ((0, index_js_1.isHexString)(event, 32)) { - return new PollingTransactionSubscriber(provider, event); - } - (0, index_js_1.assert)(false, "unsupported polling event", "UNSUPPORTED_OPERATION", { - operation: "getPollingSubscriber", info: { event } - }); -} -exports.getPollingSubscriber = getPollingSubscriber; -// @TODO: refactor this -/** - * A **PollingBlockSubscriber** polls at a regular interval for a change - * in the block number. - * - * @_docloc: api/providers/abstract-provider - */ -class PollingBlockSubscriber { - #provider; - #poller; - #interval; - // The most recent block we have scanned for events. The value -2 - // indicates we still need to fetch an initial block number - #blockNumber; - /** - * Create a new **PollingBlockSubscriber** attached to %%provider%%. - */ - constructor(provider) { - this.#provider = provider; - this.#poller = null; - this.#interval = 4000; - this.#blockNumber = -2; - } - /** - * The polling interval. - */ - get pollingInterval() { return this.#interval; } - set pollingInterval(value) { this.#interval = value; } - async #poll() { - try { - const blockNumber = await this.#provider.getBlockNumber(); - // Bootstrap poll to setup our initial block number - if (this.#blockNumber === -2) { - this.#blockNumber = blockNumber; - return; - } - // @TODO: Put a cap on the maximum number of events per loop? - if (blockNumber !== this.#blockNumber) { - for (let b = this.#blockNumber + 1; b <= blockNumber; b++) { - // We have been stopped - if (this.#poller == null) { - return; - } - await this.#provider.emit("block", b); - } - this.#blockNumber = blockNumber; - } - } - catch (error) { - // @TODO: Minor bump, add an "error" event to let subscribers - // know things went awry. - //console.log(error); - } - // We have been stopped - if (this.#poller == null) { - return; - } - this.#poller = this.#provider._setTimeout(this.#poll.bind(this), this.#interval); - } - start() { - if (this.#poller) { - return; - } - this.#poller = this.#provider._setTimeout(this.#poll.bind(this), this.#interval); - this.#poll(); - } - stop() { - if (!this.#poller) { - return; - } - this.#provider._clearTimeout(this.#poller); - this.#poller = null; - } - pause(dropWhilePaused) { - this.stop(); - if (dropWhilePaused) { - this.#blockNumber = -2; - } - } - resume() { - this.start(); - } -} -exports.PollingBlockSubscriber = PollingBlockSubscriber; -/** - * An **OnBlockSubscriber** can be sub-classed, with a [[_poll]] - * implmentation which will be called on every new block. - * - * @_docloc: api/providers/abstract-provider - */ -class OnBlockSubscriber { - #provider; - #poll; - #running; - /** - * Create a new **OnBlockSubscriber** attached to %%provider%%. - */ - constructor(provider) { - this.#provider = provider; - this.#running = false; - this.#poll = (blockNumber) => { - this._poll(blockNumber, this.#provider); - }; - } - /** - * Called on every new block. - */ - async _poll(blockNumber, provider) { - throw new Error("sub-classes must override this"); - } - start() { - if (this.#running) { - return; - } - this.#running = true; - this.#poll(-2); - this.#provider.on("block", this.#poll); - } - stop() { - if (!this.#running) { - return; - } - this.#running = false; - this.#provider.off("block", this.#poll); - } - pause(dropWhilePaused) { this.stop(); } - resume() { this.start(); } -} -exports.OnBlockSubscriber = OnBlockSubscriber; -class PollingBlockTagSubscriber extends OnBlockSubscriber { - #tag; - #lastBlock; - constructor(provider, tag) { - super(provider); - this.#tag = tag; - this.#lastBlock = -2; - } - pause(dropWhilePaused) { - if (dropWhilePaused) { - this.#lastBlock = -2; - } - super.pause(dropWhilePaused); - } - async _poll(blockNumber, provider) { - const block = await provider.getBlock(this.#tag); - if (block == null) { - return; - } - if (this.#lastBlock === -2) { - this.#lastBlock = block.number; - } - else if (block.number > this.#lastBlock) { - provider.emit(this.#tag, block.number); - this.#lastBlock = block.number; - } - } -} -exports.PollingBlockTagSubscriber = PollingBlockTagSubscriber; -/** - * @_ignore: - * - * @_docloc: api/providers/abstract-provider - */ -class PollingOrphanSubscriber extends OnBlockSubscriber { - #filter; - constructor(provider, filter) { - super(provider); - this.#filter = copy(filter); - } - async _poll(blockNumber, provider) { - throw new Error("@TODO"); - console.log(this.#filter); - } -} -exports.PollingOrphanSubscriber = PollingOrphanSubscriber; -/** - * A **PollingTransactionSubscriber** will poll for a given transaction - * hash for its receipt. - * - * @_docloc: api/providers/abstract-provider - */ -class PollingTransactionSubscriber extends OnBlockSubscriber { - #hash; - /** - * Create a new **PollingTransactionSubscriber** attached to - * %%provider%%, listening for %%hash%%. - */ - constructor(provider, hash) { - super(provider); - this.#hash = hash; - } - async _poll(blockNumber, provider) { - const tx = await provider.getTransactionReceipt(this.#hash); - if (tx) { - provider.emit(this.#hash, tx); - } - } -} -exports.PollingTransactionSubscriber = PollingTransactionSubscriber; -/** - * A **PollingEventSubscriber** will poll for a given filter for its logs. - * - * @_docloc: api/providers/abstract-provider - */ -class PollingEventSubscriber { - #provider; - #filter; - #poller; - #running; - // The most recent block we have scanned for events. The value -2 - // indicates we still need to fetch an initial block number - #blockNumber; - /** - * Create a new **PollingTransactionSubscriber** attached to - * %%provider%%, listening for %%filter%%. - */ - constructor(provider, filter) { - this.#provider = provider; - this.#filter = copy(filter); - this.#poller = this.#poll.bind(this); - this.#running = false; - this.#blockNumber = -2; - } - async #poll(blockNumber) { - // The initial block hasn't been determined yet - if (this.#blockNumber === -2) { - return; - } - const filter = copy(this.#filter); - filter.fromBlock = this.#blockNumber + 1; - filter.toBlock = blockNumber; - const logs = await this.#provider.getLogs(filter); - // No logs could just mean the node has not indexed them yet, - // so we keep a sliding window of 60 blocks to keep scanning - if (logs.length === 0) { - if (this.#blockNumber < blockNumber - 60) { - this.#blockNumber = blockNumber - 60; - } - return; - } - for (const log of logs) { - this.#provider.emit(this.#filter, log); - // Only advance the block number when logs were found to - // account for networks (like BNB and Polygon) which may - // sacrifice event consistency for block event speed - this.#blockNumber = log.blockNumber; - } - } - start() { - if (this.#running) { - return; - } - this.#running = true; - if (this.#blockNumber === -2) { - this.#provider.getBlockNumber().then((blockNumber) => { - this.#blockNumber = blockNumber; - }); - } - this.#provider.on("block", this.#poller); - } - stop() { - if (!this.#running) { - return; - } - this.#running = false; - this.#provider.off("block", this.#poller); - } - pause(dropWhilePaused) { - this.stop(); - if (dropWhilePaused) { - this.#blockNumber = -2; - } - } - resume() { - this.start(); - } -} -exports.PollingEventSubscriber = PollingEventSubscriber; -//# sourceMappingURL=subscriber-polling.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-polling.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-polling.js.map deleted file mode 100644 index a41a0c55..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/subscriber-polling.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"subscriber-polling.js","sourceRoot":"","sources":["../../src.ts/providers/subscriber-polling.ts"],"names":[],"mappings":";;;AAAA,gDAAwD;AAKxD,SAAS,IAAI,CAAC,GAAQ;IAClB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED;;;;GAIG;AACH,SAAgB,oBAAoB,CAAC,QAA0B,EAAE,KAAoB;IACjF,IAAI,KAAK,KAAK,OAAO,EAAE;QAAE,OAAO,IAAI,sBAAsB,CAAC,QAAQ,CAAC,CAAC;KAAE;IACvE,IAAI,IAAA,sBAAW,EAAC,KAAK,EAAE,EAAE,CAAC,EAAE;QAAE,OAAO,IAAI,4BAA4B,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;KAAE;IAEzF,IAAA,iBAAM,EAAC,KAAK,EAAE,2BAA2B,EAAE,uBAAuB,EAAE;QAChE,SAAS,EAAE,sBAAsB,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE;KACrD,CAAC,CAAC;AACP,CAAC;AAPD,oDAOC;AAED,uBAAuB;AAEvB;;;;;GAKG;AACH,MAAa,sBAAsB;IAC/B,SAAS,CAAmB;IAC5B,OAAO,CAAgB;IAEvB,SAAS,CAAS;IAElB,iEAAiE;IACjE,2DAA2D;IAC3D,YAAY,CAAS;IAErB;;OAEG;IACH,YAAY,QAA0B;QAClC,IAAI,CAAC,SAAS,GAAG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CAAC;YAEvC,wDAAwD;YACxD,wDAAwD;YACxD,oDAAoD;YACpD,IAAI,CAAC,YAAY,GAAG,GAAG,CAAC,WAAW,CAAC;SACvC;IACL,CAAC;IAED,KAAK;QACD,IAAI,IAAI,CAAC,QAAQ,EAAE;YAAE,OAAO;SAAE;QAC9B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QAErB,IAAI,IAAI,CAAC,YAAY,KAAK,CAAC,CAAC,EAAE;YAC1B,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE;gBACjD,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;YACpC,CAAC,CAAC,CAAC;SACN;QACD,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;IAED,IAAI;QACA,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAAE,OAAO;SAAE;QAC/B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QAEtB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9C,CAAC;IAED,KAAK,CAAC,eAAyB;QAC3B,IAAI,CAAC,IAAI,EAAE,CAAC;QACZ,IAAI,eAAe,EAAE;YAAE,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;SAAE;IACpD,CAAC;IAED,MAAM;QACF,IAAI,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;CACJ;AA/ED,wDA+EC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ws-browser.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ws-browser.d.ts deleted file mode 100644 index d9272042..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ws-browser.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const _WebSocket: any; -export { _WebSocket as WebSocket }; -//# sourceMappingURL=ws-browser.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ws-browser.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ws-browser.d.ts.map deleted file mode 100644 index f549c4b0..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ws-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ws-browser.d.ts","sourceRoot":"","sources":["../../src.ts/providers/ws-browser.ts"],"names":[],"mappings":"AAQA,QAAA,MAAM,UAAU,KAAwB,CAAC;AAEzC,OAAO,EAAE,UAAU,IAAI,SAAS,EAAE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ws-browser.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ws-browser.js deleted file mode 100644 index 44b43a07..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ws-browser.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.WebSocket = void 0; -function getGlobal() { - if (typeof self !== 'undefined') { - return self; - } - if (typeof window !== 'undefined') { - return window; - } - if (typeof global !== 'undefined') { - return global; - } - throw new Error('unable to locate global object'); -} -; -const _WebSocket = getGlobal().WebSocket; -exports.WebSocket = _WebSocket; -//# sourceMappingURL=ws-browser.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ws-browser.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ws-browser.js.map deleted file mode 100644 index a6800e42..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ws-browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ws-browser.js","sourceRoot":"","sources":["../../src.ts/providers/ws-browser.ts"],"names":[],"mappings":";;;AACA,SAAS,SAAS;IAChB,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;QAAE,OAAO,IAAI,CAAC;KAAE;IACjD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QAAE,OAAO,MAAM,CAAC;KAAE;IACrD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QAAE,OAAO,MAAM,CAAC;KAAE;IACrD,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;AACpD,CAAC;AAAA,CAAC;AAEF,MAAM,UAAU,GAAG,SAAS,EAAE,CAAC,SAAS,CAAC;AAElB,+BAAS"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ws.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ws.d.ts deleted file mode 100644 index 75d53b7d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ws.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { WebSocket } from "ws"; -//# sourceMappingURL=ws.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ws.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ws.d.ts.map deleted file mode 100644 index c424f8d8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ws.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ws.d.ts","sourceRoot":"","sources":["../../src.ts/providers/ws.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ws.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ws.js deleted file mode 100644 index c06b3580..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ws.js +++ /dev/null @@ -1,6 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.WebSocket = void 0; -var ws_1 = require("ws"); -Object.defineProperty(exports, "WebSocket", { enumerable: true, get: function () { return ws_1.WebSocket; } }); -//# sourceMappingURL=ws.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ws.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ws.js.map deleted file mode 100644 index 15568f15..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/providers/ws.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ws.js","sourceRoot":"","sources":["../../src.ts/providers/ws.ts"],"names":[],"mappings":";;;AAAA,yBAA+B;AAAtB,+FAAA,SAAS,OAAA"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/accesslist.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/accesslist.d.ts deleted file mode 100644 index e30ac1c4..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/accesslist.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { AccessList, AccessListish } from "./index.js"; -/** - * Returns a [[AccessList]] from any ethers-supported access-list structure. - */ -export declare function accessListify(value: AccessListish): AccessList; -//# sourceMappingURL=accesslist.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/accesslist.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/accesslist.d.ts.map deleted file mode 100644 index 6516681e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/accesslist.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"accesslist.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/accesslist.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAa5D;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,UAAU,CAuB9D"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/accesslist.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/accesslist.js deleted file mode 100644 index 77cf1718..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/accesslist.js +++ /dev/null @@ -1,41 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.accessListify = void 0; -const index_js_1 = require("../address/index.js"); -const index_js_2 = require("../utils/index.js"); -function accessSetify(addr, storageKeys) { - return { - address: (0, index_js_1.getAddress)(addr), - storageKeys: storageKeys.map((storageKey, index) => { - (0, index_js_2.assertArgument)((0, index_js_2.isHexString)(storageKey, 32), "invalid slot", `storageKeys[${index}]`, storageKey); - return storageKey.toLowerCase(); - }) - }; -} -/** - * Returns a [[AccessList]] from any ethers-supported access-list structure. - */ -function accessListify(value) { - if (Array.isArray(value)) { - return value.map((set, index) => { - if (Array.isArray(set)) { - (0, index_js_2.assertArgument)(set.length === 2, "invalid slot set", `value[${index}]`, set); - return accessSetify(set[0], set[1]); - } - (0, index_js_2.assertArgument)(set != null && typeof (set) === "object", "invalid address-slot set", "value", value); - return accessSetify(set.address, set.storageKeys); - }); - } - (0, index_js_2.assertArgument)(value != null && typeof (value) === "object", "invalid access list", "value", value); - const result = Object.keys(value).map((addr) => { - const storageKeys = value[addr].reduce((accum, storageKey) => { - accum[storageKey] = true; - return accum; - }, {}); - return accessSetify(addr, Object.keys(storageKeys).sort()); - }); - result.sort((a, b) => (a.address.localeCompare(b.address))); - return result; -} -exports.accessListify = accessListify; -//# sourceMappingURL=accesslist.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/accesslist.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/accesslist.js.map deleted file mode 100644 index 8047927d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/accesslist.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"acc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AC,KAAK,CAAC,KAAK,QAAQ,EAAE,qBAAqB,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IAEnG,MAAM,MAAM,GAA2D,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACnG,MAAM,WAAW,GAAyB,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE;YAC/E,KAAK,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;YACzB,OAAO,KAAK,CAAC;QACjB,CAAC,EAAwB,EAAG,CAAC,CAAC;QAC9B,OAAO,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,CAAC,CAAA;IAC9D,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC5D,OAAO,MAAM,CAAC;AAClB,CAAC;AAvBD,sCAuBC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/address.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/address.d.ts deleted file mode 100644 index 0b86944f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/address.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { SigningKey } from "../crypto/index.js"; -import type { SignatureLike } from "../crypto/index.js"; -import type { BytesLike } from "../utils/index.js"; -/** - * Returns the address for the %%key%%. - * - * The key may be any standard form of public key or a private key. - */ -export declare function computeAddress(key: string | SigningKey): string; -/** - * Returns the recovered address for the private key that was - * used to sign %%digest%% that resulted in %%signature%%. - */ -export declare function recoverAddress(digest: BytesLike, signature: SignatureLike): string; -//# sourceMappingURL=address.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/address.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/address.d.ts.map deleted file mode 100644 index 83e6f094..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/address.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/address.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,CAQ/D;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,GAAG,MAAM,CAElF"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/address.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/address.js deleted file mode 100644 index 429e457a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/address.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.recoverAddress = exports.computeAddress = void 0; -const index_js_1 = require("../address/index.js"); -const index_js_2 = require("../crypto/index.js"); -/** - * Returns the address for the %%key%%. - * - * The key may be any standard form of public key or a private key. - */ -function computeAddress(key) { - let pubkey; - if (typeof (key) === "string") { - pubkey = index_js_2.SigningKey.computePublicKey(key, false); - } - else { - pubkey = key.publicKey; - } - return (0, index_js_1.getAddress)((0, index_js_2.keccak256)("0x" + pubkey.substring(4)).substring(26)); -} -exports.computeAddress = computeAddress; -/** - * Returns the recovered address for the private key that was - * used to sign %%digest%% that resulted in %%signature%%. - */ -function recoverAddress(digest, signature) { - return computeAddress(index_js_2.SigningKey.recoverPublicKey(digest, signature)); -} -exports.recoverAddress = recoverAddress; -//# sourceMappingURL=address.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/address.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/address.js.map deleted file mode 100644 index 3cad7b02..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/address.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"address.js","sourceRoot":"","sources":["../../src.ts/transaction/address.ts"],"names":[],"mappings":";;;AAAA,kDAAiD;AACjD,iDAA2D;AAK3D;;;;GAIG;AACH,SAAgB,cAAc,CAAC,GAAwB;IACnD,IAAI,MAAc,CAAC;IACnB,IAAI,OAAM,CAAC,GAAG,CAAC,KAAK,QAAQ,EAAE;QAC1B,MAAM,GAAG,qBAAU,CAAC,gBAAgB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;KACpD;SAAM;QACH,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC;KAC1B;IACD,OAAO,IAAA,qBAAU,EAAC,IAAA,oBAAS,EAAC,IAAI,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;AAC3E,CAAC;AARD,wCAQC;AAED;;;GAGG;AACH,SAAgB,cAAc,CAAC,MAAiB,EAAE,SAAwB;IACtE,OAAO,cAAc,CAAC,qBAAU,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;AAC1E,CAAC;AAFD,wCAEC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/authorization.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/authorization.d.ts deleted file mode 100644 index c9cc207d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/authorization.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Authorization, AuthorizationLike } from "./index.js"; -export declare function authorizationify(auth: AuthorizationLike): Authorization; -//# sourceMappingURL=authorization.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/authorization.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/authorization.d.ts.map deleted file mode 100644 index 6d90d17f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/authorization.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"authorization.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/authorization.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEnE,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,iBAAiB,GAAG,aAAa,CAOvE"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/authorization.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/authorization.js deleted file mode 100644 index 7d6d331f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/authorization.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.authorizationify = void 0; -const index_js_1 = require("../address/index.js"); -const index_js_2 = require("../crypto/index.js"); -const index_js_3 = require("../utils/index.js"); -function authorizationify(auth) { - return { - address: (0, index_js_1.getAddress)(auth.address), - nonce: (0, index_js_3.getBigInt)((auth.nonce != null) ? auth.nonce : 0), - chainId: (0, index_js_3.getBigInt)((auth.chainId != null) ? auth.chainId : 0), - signature: index_js_2.Signature.from(auth.signature) - }; -} -exports.authorizationify = authorizationify; -//# sourceMappingURL=authorization.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/authorization.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/authorization.js.map deleted file mode 100644 index 6242ee0d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/authorization.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"authorization.js","sourceRoot":"","sources":["../../src.ts/transaction/authorization.ts"],"names":[],"mappings":";;;AAAA,kDAAiD;AACjD,iDAA+C;AAC/C,gDAA8C;AAI9C,SAAgB,gBAAgB,CAAC,IAAuB;IACpD,OAAO;QACH,OAAO,EAAE,IAAA,qBAAU,EAAC,IAAI,CAAC,OAAO,CAAC;QACjC,KAAK,EAAE,IAAA,oBAAS,EAAC,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAA,CAAC,CAAC,CAAC,CAAC;QACtD,OAAO,EAAE,IAAA,oBAAS,EAAC,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,CAAA,CAAC,CAAC,IAAI,CAAC,OAAO,CAAA,CAAC,CAAC,CAAC,CAAC;QAC3D,SAAS,EAAE,oBAAS,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC;KAC5C,CAAC;AACN,CAAC;AAPD,4CAOC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/index.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/index.d.ts deleted file mode 100644 index 0a12b228..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/index.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Each state-changing operation on Ethereum requires a transaction. - * - * @_section api/transaction:Transactions [about-transactions] - */ -import type { BigNumberish } from "../utils/maths.js"; -import type { Signature, SignatureLike } from "../crypto/index.js"; -/** - * A single [[AccessList]] entry of storage keys (slots) for an address. - */ -export type AccessListEntry = { - address: string; - storageKeys: Array; -}; -/** - * An ordered collection of [[AccessList]] entries. - */ -export type AccessList = Array; -/** - * Any ethers-supported access list structure. - */ -export type AccessListish = AccessList | Array<[string, Array]> | Record>; -export interface Authorization { - address: string; - nonce: bigint; - chainId: bigint; - signature: Signature; -} -export type AuthorizationLike = { - address: string; - nonce: BigNumberish; - chainId: BigNumberish; - signature: SignatureLike; -}; -export { accessListify } from "./accesslist.js"; -export { authorizationify } from "./authorization.js"; -export { computeAddress, recoverAddress } from "./address.js"; -export { Transaction } from "./transaction.js"; -export type { Blob, BlobLike, KzgLibrary, KzgLibraryLike, TransactionLike } from "./transaction.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/index.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/index.d.ts.map deleted file mode 100644 index c0bbe666..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnE;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC;AAE9E;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,eAAe,CAAC,CAAC;AAEhD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,GACV,KAAK,CAAC,CAAE,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAE,CAAC,GAChC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;AAG1D,MAAM,WAAW,aAAa;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,SAAS,CAAC;CACxB;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,YAAY,CAAC;IACpB,OAAO,EAAE,YAAY,CAAC;IACtB,SAAS,EAAE,aAAa,CAAA;CAC3B,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,YAAY,EACR,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,eAAe,EAC9D,MAAM,kBAAkB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/index.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/index.js deleted file mode 100644 index 73e24244..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/index.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -/** - * Each state-changing operation on Ethereum requires a transaction. - * - * @_section api/transaction:Transactions [about-transactions] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Transaction = exports.recoverAddress = exports.computeAddress = exports.authorizationify = exports.accessListify = void 0; -null; -var accesslist_js_1 = require("./accesslist.js"); -Object.defineProperty(exports, "accessListify", { enumerable: true, get: function () { return accesslist_js_1.accessListify; } }); -var authorization_js_1 = require("./authorization.js"); -Object.defineProperty(exports, "authorizationify", { enumerable: true, get: function () { return authorization_js_1.authorizationify; } }); -var address_js_1 = require("./address.js"); -Object.defineProperty(exports, "computeAddress", { enumerable: true, get: function () { return address_js_1.computeAddress; } }); -Object.defineProperty(exports, "recoverAddress", { enumerable: true, get: function () { return address_js_1.recoverAddress; } }); -var transaction_js_1 = require("./transaction.js"); -Object.defineProperty(exports, "Transaction", { enumerable: true, get: function () { return transaction_js_1.Transaction; } }); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/index.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/index.js.map deleted file mode 100644 index 07304888..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/transaction/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,IAAI,CAAC;AAqCL,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AACtB,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AACzB,2CAA8D;AAArD,4GAAA,cAAc,OAAA;AAAE,4GAAA,cAAc,OAAA;AACvC,mDAA+C;AAAtC,6GAAA,WAAW,OAAA"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/transaction.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/transaction.d.ts deleted file mode 100644 index 8102f77f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/transaction.d.ts +++ /dev/null @@ -1,430 +0,0 @@ -import { Signature } from "../crypto/index.js"; -import type { BigNumberish, BytesLike } from "../utils/index.js"; -import type { SignatureLike } from "../crypto/index.js"; -import type { AccessList, AccessListish, Authorization, AuthorizationLike } from "./index.js"; -declare const inspect: unique symbol; -/** - * Returns a BLOb proof as its cells for [[link-eip-7594]] BLOb. - * - * The default %%cellCount%% is 128. - */ -export declare function splitBlobCells(_proof: BytesLike, cellCount?: number): Array; -/** - * A **TransactionLike** is an object which is appropriate as a loose - * input for many operations which will populate missing properties of - * a transaction. - */ -export interface TransactionLike { - /** - * The type. - */ - type?: null | number; - /** - * The recipient address or ``null`` for an ``init`` transaction. - */ - to?: null | A; - /** - * The sender. - */ - from?: null | A; - /** - * The nonce. - */ - nonce?: null | number; - /** - * The maximum amount of gas that can be used. - */ - gasLimit?: null | BigNumberish; - /** - * The gas price for legacy and berlin transactions. - */ - gasPrice?: null | BigNumberish; - /** - * The maximum priority fee per gas for london transactions. - */ - maxPriorityFeePerGas?: null | BigNumberish; - /** - * The maximum total fee per gas for london transactions. - */ - maxFeePerGas?: null | BigNumberish; - /** - * The data. - */ - data?: null | string; - /** - * The value (in wei) to send. - */ - value?: null | BigNumberish; - /** - * The chain ID the transaction is valid on. - */ - chainId?: null | BigNumberish; - /** - * The transaction hash. - */ - hash?: null | string; - /** - * The signature provided by the sender. - */ - signature?: null | SignatureLike; - /** - * The access list for berlin and london transactions. - */ - accessList?: null | AccessListish; - /** - * The maximum fee per blob gas (see [[link-eip-4844]]). - */ - maxFeePerBlobGas?: null | BigNumberish; - /** - * The versioned hashes (see [[link-eip-4844]]). - */ - blobVersionedHashes?: null | Array; - /** - * The blobs (if any) attached to this transaction (see [[link-eip-4844]]). - */ - blobs?: null | Array; - /** - * An external library for computing the KZG commitments and - * proofs necessary for EIP-4844 transactions (see [[link-eip-4844]]). - * - * This is generally ``null``, unless you are creating BLOb - * transactions. - */ - kzg?: null | KzgLibraryLike; - /** - * The [[link-eip-7594]] BLOb Wrapper Version used for PeerDAS. - * - * For networks that use EIP-7594, this property is required to - * serialize the sidecar correctly. - */ - blobWrapperVersion?: null | number; - /** - * The [[link-eip-7702]] authorizations (if any). - */ - authorizationList?: null | Array; -} -/** - * A full-valid BLOb object for [[link-eip-4844]] transactions. - * - * The commitment and proof should have been computed using a - * KZG library. - */ -export interface Blob { - /** - * The blob data. - */ - data: string; - /** - * A EIP-4844 BLOb uses a string proof, while EIP-7594 use an - * array of strings representing the cells of the proof. - */ - proof: string; - /** - * The BLOb commitment. - */ - commitment: string; -} -/** - * A BLOb object that can be passed for [[link-eip-4844]] - * transactions. - * - * It may have had its commitment and proof already provided - * or rely on an attached [[KzgLibrary]] to compute them. - */ -export type BlobLike = BytesLike | { - data: BytesLike; - proof: BytesLike; - commitment: BytesLike; -}; -/** - * A KZG Library with the necessary functions to compute - * BLOb commitments and proofs. - */ -export interface KzgLibrary { - blobToKzgCommitment: (blob: Uint8Array) => Uint8Array; - computeBlobKzgProof: (blob: Uint8Array, commitment: Uint8Array) => Uint8Array; -} -/** - * A KZG Library with any of the various API configurations. - * As the library is still experimental and the API is not - * stable, depending on the version used the method names and - * signatures are still in flux. - * - * This allows any of the versions to be passed into Transaction - * while providing a stable external API. - */ -export type KzgLibraryLike = KzgLibrary | { - blobToKZGCommitment: (blob: string) => string; - computeBlobKZGProof: (blob: string, commitment: string) => string; -} | { - blobToKzgCommitment: (blob: string) => string | Uint8Array; - computeBlobProof: (blob: string, commitment: string) => string | Uint8Array; -}; -/** - * A **Transaction** describes an operation to be executed on - * Ethereum by an Externally Owned Account (EOA). It includes - * who (the [[to]] address), what (the [[data]]) and how much (the - * [[value]] in ether) the operation should entail. - * - * @example: - * tx = new Transaction() - * //_result: - * - * tx.data = "0x1234"; - * //_result: - */ -export declare class Transaction implements TransactionLike { - #private; - /** - * The transaction type. - * - * If null, the type will be automatically inferred based on - * explicit properties. - */ - get type(): null | number; - set type(value: null | number | string); - /** - * The name of the transaction type. - */ - get typeName(): null | string; - /** - * The ``to`` address for the transaction or ``null`` if the - * transaction is an ``init`` transaction. - */ - get to(): null | string; - set to(value: null | string); - /** - * The transaction nonce. - */ - get nonce(): number; - set nonce(value: BigNumberish); - /** - * The gas limit. - */ - get gasLimit(): bigint; - set gasLimit(value: BigNumberish); - /** - * The gas price. - * - * On legacy networks this defines the fee that will be paid. On - * EIP-1559 networks, this should be ``null``. - */ - get gasPrice(): null | bigint; - set gasPrice(value: null | BigNumberish); - /** - * The maximum priority fee per unit of gas to pay. On legacy - * networks this should be ``null``. - */ - get maxPriorityFeePerGas(): null | bigint; - set maxPriorityFeePerGas(value: null | BigNumberish); - /** - * The maximum total fee per unit of gas to pay. On legacy - * networks this should be ``null``. - */ - get maxFeePerGas(): null | bigint; - set maxFeePerGas(value: null | BigNumberish); - /** - * The transaction data. For ``init`` transactions this is the - * deployment code. - */ - get data(): string; - set data(value: BytesLike); - /** - * The amount of ether (in wei) to send in this transactions. - */ - get value(): bigint; - set value(value: BigNumberish); - /** - * The chain ID this transaction is valid on. - */ - get chainId(): bigint; - set chainId(value: BigNumberish); - /** - * If signed, the signature for this transaction. - */ - get signature(): null | Signature; - set signature(value: null | SignatureLike); - isValid(): boolean; - /** - * The access list. - * - * An access list permits discounted (but pre-paid) access to - * bytecode and state variable access within contract execution. - */ - get accessList(): null | AccessList; - set accessList(value: null | AccessListish); - get authorizationList(): null | Array; - set authorizationList(auths: null | Array); - /** - * The max fee per blob gas for Cancun transactions. - */ - get maxFeePerBlobGas(): null | bigint; - set maxFeePerBlobGas(value: null | BigNumberish); - /** - * The BLOb versioned hashes for Cancun transactions. - */ - get blobVersionedHashes(): null | Array; - set blobVersionedHashes(value: null | Array); - /** - * The BLObs for the Transaction, if any. - * - * If ``blobs`` is non-``null``, then the [[seriailized]] - * will return the network formatted sidecar, otherwise it - * will return the standard [[link-eip-2718]] payload. The - * [[unsignedSerialized]] is unaffected regardless. - * - * When setting ``blobs``, either fully valid [[Blob]] objects - * may be specified (i.e. correctly padded, with correct - * committments and proofs) or a raw [[BytesLike]] may - * be provided. - * - * If raw [[BytesLike]] are provided, the [[kzg]] property **must** - * be already set. The blob will be correctly padded and the - * [[KzgLibrary]] will be used to compute the committment and - * proof for the blob. - * - * A BLOb is a sequence of field elements, each of which must - * be within the BLS field modulo, so some additional processing - * may be required to encode arbitrary data to ensure each 32 byte - * field is within the valid range. - * - * Setting this automatically populates [[blobVersionedHashes]], - * overwriting any existing values. Setting this to ``null`` - * does **not** remove the [[blobVersionedHashes]], leaving them - * present. - */ - get blobs(): null | Array; - set blobs(_blobs: null | Array); - get kzg(): null | KzgLibrary; - set kzg(kzg: null | KzgLibraryLike); - get blobWrapperVersion(): null | number; - set blobWrapperVersion(value: null | number); - /** - * Creates a new Transaction with default values. - */ - constructor(); - /** - * The transaction hash, if signed. Otherwise, ``null``. - */ - get hash(): null | string; - /** - * The pre-image hash of this transaction. - * - * This is the digest that a [[Signer]] must sign to authorize - * this transaction. - */ - get unsignedHash(): string; - /** - * The sending address, if signed. Otherwise, ``null``. - */ - get from(): null | string; - /** - * The public key of the sender, if signed. Otherwise, ``null``. - */ - get fromPublicKey(): null | string; - /** - * Returns true if signed. - * - * This provides a Type Guard that properties requiring a signed - * transaction are non-null. - */ - isSigned(): this is (Transaction & { - type: number; - typeName: string; - from: string; - signature: Signature; - }); - /** - * The serialized transaction. - * - * This throws if the transaction is unsigned. For the pre-image, - * use [[unsignedSerialized]]. - */ - get serialized(): string; - /** - * The transaction pre-image. - * - * The hash of this is the digest which needs to be signed to - * authorize this transaction. - */ - get unsignedSerialized(): string; - /** - * Return the most "likely" type; currently the highest - * supported transaction type. - */ - inferType(): number; - /** - * Validates the explicit properties and returns a list of compatible - * transaction types. - */ - inferTypes(): Array; - /** - * Returns true if this transaction is a legacy transaction (i.e. - * ``type === 0``). - * - * This provides a Type Guard that the related properties are - * non-null. - */ - isLegacy(): this is (Transaction & { - type: 0; - gasPrice: bigint; - }); - /** - * Returns true if this transaction is berlin hardform transaction (i.e. - * ``type === 1``). - * - * This provides a Type Guard that the related properties are - * non-null. - */ - isBerlin(): this is (Transaction & { - type: 1; - gasPrice: bigint; - accessList: AccessList; - }); - /** - * Returns true if this transaction is london hardform transaction (i.e. - * ``type === 2``). - * - * This provides a Type Guard that the related properties are - * non-null. - */ - isLondon(): this is (Transaction & { - type: 2; - accessList: AccessList; - maxFeePerGas: bigint; - maxPriorityFeePerGas: bigint; - }); - /** - * Returns true if this transaction is an [[link-eip-4844]] BLOB - * transaction. - * - * This provides a Type Guard that the related properties are - * non-null. - */ - isCancun(): this is (Transaction & { - type: 3; - to: string; - accessList: AccessList; - maxFeePerGas: bigint; - maxPriorityFeePerGas: bigint; - maxFeePerBlobGas: bigint; - blobVersionedHashes: Array; - }); - /** - * Create a copy of this transaciton. - */ - clone(): Transaction; - /** - * Return a JSON-friendly object. - */ - toJSON(): any; - [inspect](): string; - toString(): string; - /** - * Create a **Transaction** from a serialized transaction or a - * Transaction-like object. - */ - static from(tx?: string | TransactionLike): Transaction; -} -export {}; -//# sourceMappingURL=transaction.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/transaction.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/transaction.d.ts.map deleted file mode 100644 index 733e2e1e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/transaction.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/transaction.ts"],"names":[],"mappings":"AAGA,OAAO,EACgB,SAAS,EAC/B,MAAM,oBAAoB,CAAC;AAU5B,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,KAAK,EACR,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAC9D,MAAM,YAAY,CAAC;AASpB,QAAA,MAAM,OAAO,eAA2C,CAAC;AAMzD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAYnF;AAKD;;;;GAIG;AACH,MAAM,WAAW,eAAe,CAAC,CAAC,GAAG,MAAM;IACvC;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAErB;;OAEG;IACH,EAAE,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC;IAEd;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,CA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Ae,CAAC,MAAM,CAAC,GAAG,WAAW;CA0DlE"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/transaction.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/transaction.js deleted file mode 100644 index e3c7394f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/transaction.js +++ /dev/null @@ -1,1293 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Transaction = exports.splitBlobCells = void 0; -const index_js_1 = require("../address/index.js"); -const addresses_js_1 = require("../constants/addresses.js"); -const index_js_2 = require("../crypto/index.js"); -const index_js_3 = require("../utils/index.js"); -const accesslist_js_1 = require("./accesslist.js"); -const authorization_js_1 = require("./authorization.js"); -const address_js_1 = require("./address.js"); -const BN_0 = BigInt(0); -const BN_2 = BigInt(2); -const BN_27 = BigInt(27); -const BN_28 = BigInt(28); -const BN_35 = BigInt(35); -const BN_MAX_UINT = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); -const inspect = Symbol.for("nodejs.util.inspect.custom"); -const BLOB_SIZE = 4096 * 32; -const CELL_COUNT = 128; -/** - * Returns a BLOb proof as its cells for [[link-eip-7594]] BLOb. - * - * The default %%cellCount%% is 128. - */ -function splitBlobCells(_proof, cellCount) { - if (cellCount == null) { - cellCount = CELL_COUNT; - } - const cellProofs = []; - const proof = (0, index_js_3.getBytes)(_proof); - const cellSize = proof.length / cellCount; - for (let i = 0; i < proof.length; i += cellSize) { - cellProofs.push((0, index_js_3.hexlify)(proof.subarray(i, i + cellSize))); - } - return cellProofs; -} -exports.splitBlobCells = splitBlobCells; -function getKzgLibrary(kzg) { - const blobToKzgCommitment = (blob) => { - if ("computeBlobProof" in kzg) { - // micro-ecc-signer; check for computeBlobProof since this API - // expects a string while the kzg-wasm below expects a Unit8Array - if ("blobToKzgCommitment" in kzg && typeof (kzg.blobToKzgCommitment) === "function") { - return (0, index_js_3.getBytes)(kzg.blobToKzgCommitment((0, index_js_3.hexlify)(blob))); - } - } - else if ("blobToKzgCommitment" in kzg && typeof (kzg.blobToKzgCommitment) === "function") { - // kzg-wasm <0.5.0; blobToKzgCommitment(Uint8Array) => Uint8Array - return (0, index_js_3.getBytes)(kzg.blobToKzgCommitment(blob)); - } - // kzg-wasm >= 0.5.0; blobToKZGCommitment(string) => string - if ("blobToKZGCommitment" in kzg && typeof (kzg.blobToKZGCommitment) === "function") { - return (0, index_js_3.getBytes)(kzg.blobToKZGCommitment((0, index_js_3.hexlify)(blob))); - } - (0, index_js_3.assertArgument)(false, "unsupported KZG library", "kzg", kzg); - }; - const computeBlobKzgProof = (blob, commitment) => { - // micro-ecc-signer - if ("computeBlobProof" in kzg && typeof (kzg.computeBlobProof) === "function") { - return (0, index_js_3.getBytes)(kzg.computeBlobProof((0, index_js_3.hexlify)(blob), (0, index_js_3.hexlify)(commitment))); - } - // kzg-wasm <0.5.0; computeBlobKzgProof(Uint8Array, Uint8Array) => Uint8Array - if ("computeBlobKzgProof" in kzg && typeof (kzg.computeBlobKzgProof) === "function") { - return kzg.computeBlobKzgProof(blob, commitment); - } - // kzg-wasm >= 0.5.0; computeBlobKZGProof(string, string) => string - if ("computeBlobKZGProof" in kzg && typeof (kzg.computeBlobKZGProof) === "function") { - return (0, index_js_3.getBytes)(kzg.computeBlobKZGProof((0, index_js_3.hexlify)(blob), (0, index_js_3.hexlify)(commitment))); - } - (0, index_js_3.assertArgument)(false, "unsupported KZG library", "kzg", kzg); - }; - return { blobToKzgCommitment, computeBlobKzgProof }; -} -function getVersionedHash(version, hash) { - let versioned = version.toString(16); - while (versioned.length < 2) { - versioned = "0" + versioned; - } - versioned += (0, index_js_2.sha256)(hash).substring(4); - return "0x" + versioned; -} -function handleAddress(value) { - if (value === "0x") { - return null; - } - return (0, index_js_1.getAddress)(value); -} -function handleAccessList(value, param) { - try { - return (0, accesslist_js_1.accessListify)(value); - } - catch (error) { - (0, index_js_3.assertArgument)(false, error.message, param, value); - } -} -function handleAuthorizationList(value, param) { - try { - if (!Array.isArray(value)) { - throw new Error("authorizationList: invalid array"); - } - const result = []; - for (let i = 0; i < value.length; i++) { - const auth = value[i]; - if (!Array.isArray(auth)) { - throw new Error(`authorization[${i}]: invalid array`); - } - if (auth.length !== 6) { - throw new Error(`authorization[${i}]: wrong length`); - } - if (!auth[1]) { - throw new Error(`authorization[${i}]: null address`); - } - result.push({ - address: handleAddress(auth[1]), - nonce: handleUint(auth[2], "nonce"), - chainId: handleUint(auth[0], "chainId"), - signature: index_js_2.Signature.from({ - yParity: handleNumber(auth[3], "yParity"), - r: (0, index_js_3.zeroPadValue)(auth[4], 32), - s: (0, index_js_3.zeroPadValue)(auth[5], 32) - }) - }); - } - return result; - } - catch (error) { - (0, index_js_3.assertArgument)(false, error.message, param, value); - } -} -function handleNumber(_value, param) { - if (_value === "0x") { - return 0; - } - return (0, index_js_3.getNumber)(_value, param); -} -function handleUint(_value, param) { - if (_value === "0x") { - return BN_0; - } - const value = (0, index_js_3.getBigInt)(_value, param); - (0, index_js_3.assertArgument)(value <= BN_MAX_UINT, "value exceeds uint size", param, value); - return value; -} -function formatNumber(_value, name) { - const value = (0, index_js_3.getBigInt)(_value, "value"); - const result = (0, index_js_3.toBeArray)(value); - (0, index_js_3.assertArgument)(result.length <= 32, `value too large`, `tx.${name}`, value); - return result; -} -function formatAccessList(value) { - return (0, accesslist_js_1.accessListify)(value).map((set) => [set.address, set.storageKeys]); -} -function formatAuthorizationList(value) { - return value.map((a) => { - return [ - formatNumber(a.chainId, "chainId"), - a.address, - formatNumber(a.nonce, "nonce"), - formatNumber(a.signature.yParity, "yParity"), - (0, index_js_3.toBeArray)(a.signature.r), - (0, index_js_3.toBeArray)(a.signature._s) - ]; - }); -} -function formatHashes(value, param) { - (0, index_js_3.assertArgument)(Array.isArray(value), `invalid ${param}`, "value", value); - for (let i = 0; i < value.length; i++) { - (0, index_js_3.assertArgument)((0, index_js_3.isHexString)(value[i], 32), "invalid ${ param } hash", `value[${i}]`, value[i]); - } - return value; -} -function _parseLegacy(data) { - const fields = (0, index_js_3.decodeRlp)(data); - (0, index_js_3.assertArgument)(Array.isArray(fields) && (fields.length === 9 || fields.length === 6), "invalid field count for legacy transaction", "data", data); - const tx = { - type: 0, - nonce: handleNumber(fields[0], "nonce"), - gasPrice: handleUint(fields[1], "gasPrice"), - gasLimit: handleUint(fields[2], "gasLimit"), - to: handleAddress(fields[3]), - value: handleUint(fields[4], "value"), - data: (0, index_js_3.hexlify)(fields[5]), - chainId: BN_0 - }; - // Legacy unsigned transaction - if (fields.length === 6) { - return tx; - } - const v = handleUint(fields[6], "v"); - const r = handleUint(fields[7], "r"); - const s = handleUint(fields[8], "s"); - if (r === BN_0 && s === BN_0) { - // EIP-155 unsigned transaction - tx.chainId = v; - } - else { - // Compute the EIP-155 chain ID (or 0 for legacy) - let chainId = (v - BN_35) / BN_2; - if (chainId < BN_0) { - chainId = BN_0; - } - tx.chainId = chainId; - // Signed Legacy Transaction - (0, index_js_3.assertArgument)(chainId !== BN_0 || (v === BN_27 || v === BN_28), "non-canonical legacy v", "v", fields[6]); - tx.signature = index_js_2.Signature.from({ - r: (0, index_js_3.zeroPadValue)(fields[7], 32), - s: (0, index_js_3.zeroPadValue)(fields[8], 32), - v - }); - //tx.hash = keccak256(data); - } - return tx; -} -function _serializeLegacy(tx, sig) { - const fields = [ - formatNumber(tx.nonce, "nonce"), - formatNumber(tx.gasPrice || 0, "gasPrice"), - formatNumber(tx.gasLimit, "gasLimit"), - (tx.to || "0x"), - formatNumber(tx.value, "value"), - tx.data, - ]; - let chainId = BN_0; - if (tx.chainId != BN_0) { - // A chainId was provided; if non-zero we'll use EIP-155 - chainId = (0, index_js_3.getBigInt)(tx.chainId, "tx.chainId"); - // We have a chainId in the tx and an EIP-155 v in the signature, - // make sure they agree with each other - (0, index_js_3.assertArgument)(!sig || sig.networkV == null || sig.legacyChainId === chainId, "tx.chainId/sig.v mismatch", "sig", sig); - } - else if (tx.signature) { - // No explicit chainId, but EIP-155 have a derived implicit chainId - const legacy = tx.signature.legacyChainId; - if (legacy != null) { - chainId = legacy; - } - } - // Requesting an unsigned transaction - if (!sig) { - // We have an EIP-155 transaction (chainId was specified and non-zero) - if (chainId !== BN_0) { - fields.push((0, index_js_3.toBeArray)(chainId)); - fields.push("0x"); - fields.push("0x"); - } - return (0, index_js_3.encodeRlp)(fields); - } - // @TODO: We should probably check that tx.signature, chainId, and sig - // match but that logic could break existing code, so schedule - // this for the next major bump. - // Compute the EIP-155 v - let v = BigInt(27 + sig.yParity); - if (chainId !== BN_0) { - v = index_js_2.Signature.getChainIdV(chainId, sig.v); - } - else if (BigInt(sig.v) !== v) { - (0, index_js_3.assertArgument)(false, "tx.chainId/sig.v mismatch", "sig", sig); - } - // Add the signature - fields.push((0, index_js_3.toBeArray)(v)); - fields.push((0, index_js_3.toBeArray)(sig.r)); - fields.push((0, index_js_3.toBeArray)(sig._s)); - return (0, index_js_3.encodeRlp)(fields); -} -function _parseEipSignature(tx, fields) { - let yParity; - try { - yParity = handleNumber(fields[0], "yParity"); - if (yParity !== 0 && yParity !== 1) { - throw new Error("bad yParity"); - } - } - catch (error) { - (0, index_js_3.assertArgument)(false, "invalid yParity", "yParity", fields[0]); - } - const r = (0, index_js_3.zeroPadValue)(fields[1], 32); - const s = (0, index_js_3.zeroPadValue)(fields[2], 32); - const signature = index_js_2.Signature.from({ r, s, yParity }); - tx.signature = signature; -} -function _parseEip1559(data) { - const fields = (0, index_js_3.decodeRlp)((0, index_js_3.getBytes)(data).slice(1)); - (0, index_js_3.assertArgument)(Array.isArray(fields) && (fields.length === 9 || fields.length === 12), "invalid field count for transaction type: 2", "data", (0, index_js_3.hexlify)(data)); - const tx = { - type: 2, - chainId: handleUint(fields[0], "chainId"), - nonce: handleNumber(fields[1], "nonce"), - maxPriorityFeePerGas: handleUint(fields[2], "maxPriorityFeePerGas"), - maxFeePerGas: handleUint(fields[3], "maxFeePerGas"), - gasPrice: null, - gasLimit: handleUint(fields[4], "gasLimit"), - to: handleAddress(fields[5]), - value: handleUint(fields[6], "value"), - data: (0, index_js_3.hexlify)(fields[7]), - accessList: handleAccessList(fields[8], "accessList"), - }; - // Unsigned EIP-1559 Transaction - if (fields.length === 9) { - return tx; - } - //tx.hash = keccak256(data); - _parseEipSignature(tx, fields.slice(9)); - return tx; -} -function _serializeEip1559(tx, sig) { - const fields = [ - formatNumber(tx.chainId, "chainId"), - formatNumber(tx.nonce, "nonce"), - formatNumber(tx.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"), - formatNumber(tx.maxFeePerGas || 0, "maxFeePerGas"), - formatNumber(tx.gasLimit, "gasLimit"), - (tx.to || "0x"), - formatNumber(tx.value, "value"), - tx.data, - formatAccessList(tx.accessList || []) - ]; - if (sig) { - fields.push(formatNumber(sig.yParity, "yParity")); - fields.push((0, index_js_3.toBeArray)(sig.r)); - fields.push((0, index_js_3.toBeArray)(sig.s)); - } - return (0, index_js_3.concat)(["0x02", (0, index_js_3.encodeRlp)(fields)]); -} -function _parseEip2930(data) { - const fields = (0, index_js_3.decodeRlp)((0, index_js_3.getBytes)(data).slice(1)); - (0, index_js_3.assertArgument)(Array.isArray(fields) && (fields.length === 8 || fields.length === 11), "invalid field count for transaction type: 1", "data", (0, index_js_3.hexlify)(data)); - const tx = { - type: 1, - chainId: handleUint(fields[0], "chainId"), - nonce: handleNumber(fields[1], "nonce"), - gasPrice: handleUint(fields[2], "gasPrice"), - gasLimit: handleUint(fields[3], "gasLimit"), - to: handleAddress(fields[4]), - value: handleUint(fields[5], "value"), - data: (0, index_js_3.hexlify)(fields[6]), - accessList: handleAccessList(fields[7], "accessList") - }; - // Unsigned EIP-2930 Transaction - if (fields.length === 8) { - return tx; - } - //tx.hash = keccak256(data); - _parseEipSignature(tx, fields.slice(8)); - return tx; -} -function _serializeEip2930(tx, sig) { - const fields = [ - formatNumber(tx.chainId, "chainId"), - formatNumber(tx.nonce, "nonce"), - formatNumber(tx.gasPrice || 0, "gasPrice"), - formatNumber(tx.gasLimit, "gasLimit"), - (tx.to || "0x"), - formatNumber(tx.value, "value"), - tx.data, - formatAccessList(tx.accessList || []) - ]; - if (sig) { - fields.push(formatNumber(sig.yParity, "recoveryParam")); - fields.push((0, index_js_3.toBeArray)(sig.r)); - fields.push((0, index_js_3.toBeArray)(sig.s)); - } - return (0, index_js_3.concat)(["0x01", (0, index_js_3.encodeRlp)(fields)]); -} -function _parseEip4844(data) { - let fields = (0, index_js_3.decodeRlp)((0, index_js_3.getBytes)(data).slice(1)); - let typeName = "3"; - let blobWrapperVersion = null; - let blobs = null; - // Parse the network format - if (fields.length === 4 && Array.isArray(fields[0])) { - // EIP-4844 format with sidecar - typeName = "3 (network format)"; - const fBlobs = fields[1], fCommits = fields[2], fProofs = fields[3]; - (0, index_js_3.assertArgument)(Array.isArray(fBlobs), "invalid network format: blobs not an array", "fields[1]", fBlobs); - (0, index_js_3.assertArgument)(Array.isArray(fCommits), "invalid network format: commitments not an array", "fields[2]", fCommits); - (0, index_js_3.assertArgument)(Array.isArray(fProofs), "invalid network format: proofs not an array", "fields[3]", fProofs); - (0, index_js_3.assertArgument)(fBlobs.length === fCommits.length, "invalid network format: blobs/commitments length mismatch", "fields", fields); - (0, index_js_3.assertArgument)(fBlobs.length === fProofs.length, "invalid network format: blobs/proofs length mismatch", "fields", fields); - blobs = []; - for (let i = 0; i < fields[1].length; i++) { - blobs.push({ - data: fBlobs[i], - commitment: fCommits[i], - proof: fProofs[i], - }); - } - fields = fields[0]; - } - else if (fields.length === 5 && Array.isArray(fields[0])) { - // EIP-7594 format with sidecar - typeName = "3 (EIP-7594 network format)"; - blobWrapperVersion = (0, index_js_3.getNumber)(fields[1]); - const fBlobs = fields[2], fCommits = fields[3], fProofs = fields[4]; - (0, index_js_3.assertArgument)(blobWrapperVersion === 1, `unsupported EIP-7594 network format version: ${blobWrapperVersion}`, "fields[1]", blobWrapperVersion); - (0, index_js_3.assertArgument)(Array.isArray(fBlobs), "invalid EIP-7594 network format: blobs not an array", "fields[2]", fBlobs); - (0, index_js_3.assertArgument)(Array.isArray(fCommits), "invalid EIP-7594 network format: commitments not an array", "fields[3]", fCommits); - (0, index_js_3.assertArgument)(Array.isArray(fProofs), "invalid EIP-7594 network format: proofs not an array", "fields[4]", fProofs); - (0, index_js_3.assertArgument)(fBlobs.length === fCommits.length, "invalid network format: blobs/commitments length mismatch", "fields", fields); - (0, index_js_3.assertArgument)(fBlobs.length * CELL_COUNT === fProofs.length, "invalid network format: blobs/proofs length mismatch", "fields", fields); - blobs = []; - for (let i = 0; i < fBlobs.length; i++) { - const proof = []; - for (let j = 0; j < CELL_COUNT; j++) { - proof.push(fProofs[(i * CELL_COUNT) + j]); - } - blobs.push({ - data: fBlobs[i], - commitment: fCommits[i], - proof: (0, index_js_3.concat)(proof) - }); - } - fields = fields[0]; - } - (0, index_js_3.assertArgument)(Array.isArray(fields) && (fields.length === 11 || fields.length === 14), `invalid field count for transaction type: ${typeName}`, "data", (0, index_js_3.hexlify)(data)); - const tx = { - type: 3, - chainId: handleUint(fields[0], "chainId"), - nonce: handleNumber(fields[1], "nonce"), - maxPriorityFeePerGas: handleUint(fields[2], "maxPriorityFeePerGas"), - maxFeePerGas: handleUint(fields[3], "maxFeePerGas"), - gasPrice: null, - gasLimit: handleUint(fields[4], "gasLimit"), - to: handleAddress(fields[5]), - value: handleUint(fields[6], "value"), - data: (0, index_js_3.hexlify)(fields[7]), - accessList: handleAccessList(fields[8], "accessList"), - maxFeePerBlobGas: handleUint(fields[9], "maxFeePerBlobGas"), - blobVersionedHashes: fields[10], - blobWrapperVersion - }; - if (blobs) { - tx.blobs = blobs; - } - (0, index_js_3.assertArgument)(tx.to != null, `invalid address for transaction type: ${typeName}`, "data", data); - (0, index_js_3.assertArgument)(Array.isArray(tx.blobVersionedHashes), "invalid blobVersionedHashes: must be an array", "data", data); - for (let i = 0; i < tx.blobVersionedHashes.length; i++) { - (0, index_js_3.assertArgument)((0, index_js_3.isHexString)(tx.blobVersionedHashes[i], 32), `invalid blobVersionedHash at index ${i}: must be length 32`, "data", data); - } - // Unsigned EIP-4844 Transaction - if (fields.length === 11) { - return tx; - } - // @TODO: Do we need to do this? This is only called internally - // and used to verify hashes; it might save time to not do this - //tx.hash = keccak256(concat([ "0x03", encodeRlp(fields) ])); - _parseEipSignature(tx, fields.slice(11)); - return tx; -} -function _serializeEip4844(tx, sig, blobs) { - const fields = [ - formatNumber(tx.chainId, "chainId"), - formatNumber(tx.nonce, "nonce"), - formatNumber(tx.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"), - formatNumber(tx.maxFeePerGas || 0, "maxFeePerGas"), - formatNumber(tx.gasLimit, "gasLimit"), - (tx.to || addresses_js_1.ZeroAddress), - formatNumber(tx.value, "value"), - tx.data, - formatAccessList(tx.accessList || []), - formatNumber(tx.maxFeePerBlobGas || 0, "maxFeePerBlobGas"), - formatHashes(tx.blobVersionedHashes || [], "blobVersionedHashes") - ]; - if (sig) { - fields.push(formatNumber(sig.yParity, "yParity")); - fields.push((0, index_js_3.toBeArray)(sig.r)); - fields.push((0, index_js_3.toBeArray)(sig.s)); - // We have blobs; return the network wrapped format - if (blobs) { - // Use EIP-7594 - if (tx.blobWrapperVersion != null) { - const wrapperVersion = (0, index_js_3.toBeArray)(tx.blobWrapperVersion); - const cellProofs = []; - for (const { proof } of blobs) { - const p = (0, index_js_3.getBytes)(proof); - const cellSize = p.length / CELL_COUNT; - for (let i = 0; i < p.length; i += cellSize) { - cellProofs.push(p.subarray(i, i + cellSize)); - } - } - return (0, index_js_3.concat)([ - "0x03", - (0, index_js_3.encodeRlp)([ - fields, - wrapperVersion, - blobs.map((b) => b.data), - blobs.map((b) => b.commitment), - cellProofs - ]) - ]); - } - // Fall back onto classic EIP-4844 behavior - return (0, index_js_3.concat)([ - "0x03", - (0, index_js_3.encodeRlp)([ - fields, - blobs.map((b) => b.data), - blobs.map((b) => b.commitment), - blobs.map((b) => b.proof), - ]) - ]); - } - } - return (0, index_js_3.concat)(["0x03", (0, index_js_3.encodeRlp)(fields)]); -} -function _parseEip7702(data) { - const fields = (0, index_js_3.decodeRlp)((0, index_js_3.getBytes)(data).slice(1)); - (0, index_js_3.assertArgument)(Array.isArray(fields) && (fields.length === 10 || fields.length === 13), "invalid field count for transaction type: 4", "data", (0, index_js_3.hexlify)(data)); - const tx = { - type: 4, - chainId: handleUint(fields[0], "chainId"), - nonce: handleNumber(fields[1], "nonce"), - maxPriorityFeePerGas: handleUint(fields[2], "maxPriorityFeePerGas"), - maxFeePerGas: handleUint(fields[3], "maxFeePerGas"), - gasPrice: null, - gasLimit: handleUint(fields[4], "gasLimit"), - to: handleAddress(fields[5]), - value: handleUint(fields[6], "value"), - data: (0, index_js_3.hexlify)(fields[7]), - accessList: handleAccessList(fields[8], "accessList"), - authorizationList: handleAuthorizationList(fields[9], "authorizationList"), - }; - // Unsigned EIP-7702 Transaction - if (fields.length === 10) { - return tx; - } - _parseEipSignature(tx, fields.slice(10)); - return tx; -} -function _serializeEip7702(tx, sig) { - const fields = [ - formatNumber(tx.chainId, "chainId"), - formatNumber(tx.nonce, "nonce"), - formatNumber(tx.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"), - formatNumber(tx.maxFeePerGas || 0, "maxFeePerGas"), - formatNumber(tx.gasLimit, "gasLimit"), - (tx.to || "0x"), - formatNumber(tx.value, "value"), - tx.data, - formatAccessList(tx.accessList || []), - formatAuthorizationList(tx.authorizationList || []) - ]; - if (sig) { - fields.push(formatNumber(sig.yParity, "yParity")); - fields.push((0, index_js_3.toBeArray)(sig.r)); - fields.push((0, index_js_3.toBeArray)(sig.s)); - } - return (0, index_js_3.concat)(["0x04", (0, index_js_3.encodeRlp)(fields)]); -} -/** - * A **Transaction** describes an operation to be executed on - * Ethereum by an Externally Owned Account (EOA). It includes - * who (the [[to]] address), what (the [[data]]) and how much (the - * [[value]] in ether) the operation should entail. - * - * @example: - * tx = new Transaction() - * //_result: - * - * tx.data = "0x1234"; - * //_result: - */ -class Transaction { - #type; - #to; - #data; - #nonce; - #gasLimit; - #gasPrice; - #maxPriorityFeePerGas; - #maxFeePerGas; - #value; - #chainId; - #sig; - #accessList; - #maxFeePerBlobGas; - #blobVersionedHashes; - #kzg; - #blobs; - #auths; - #blobWrapperVersion; - /** - * The transaction type. - * - * If null, the type will be automatically inferred based on - * explicit properties. - */ - get type() { return this.#type; } - set type(value) { - switch (value) { - case null: - this.#type = null; - break; - case 0: - case "legacy": - this.#type = 0; - break; - case 1: - case "berlin": - case "eip-2930": - this.#type = 1; - break; - case 2: - case "london": - case "eip-1559": - this.#type = 2; - break; - case 3: - case "cancun": - case "eip-4844": - this.#type = 3; - break; - case 4: - case "pectra": - case "eip-7702": - this.#type = 4; - break; - default: - (0, index_js_3.assertArgument)(false, "unsupported transaction type", "type", value); - } - } - /** - * The name of the transaction type. - */ - get typeName() { - switch (this.type) { - case 0: return "legacy"; - case 1: return "eip-2930"; - case 2: return "eip-1559"; - case 3: return "eip-4844"; - case 4: return "eip-7702"; - } - return null; - } - /** - * The ``to`` address for the transaction or ``null`` if the - * transaction is an ``init`` transaction. - */ - get to() { - const value = this.#to; - if (value == null && this.type === 3) { - return addresses_js_1.ZeroAddress; - } - return value; - } - set to(value) { - this.#to = (value == null) ? null : (0, index_js_1.getAddress)(value); - } - /** - * The transaction nonce. - */ - get nonce() { return this.#nonce; } - set nonce(value) { this.#nonce = (0, index_js_3.getNumber)(value, "value"); } - /** - * The gas limit. - */ - get gasLimit() { return this.#gasLimit; } - set gasLimit(value) { this.#gasLimit = (0, index_js_3.getBigInt)(value); } - /** - * The gas price. - * - * On legacy networks this defines the fee that will be paid. On - * EIP-1559 networks, this should be ``null``. - */ - get gasPrice() { - const value = this.#gasPrice; - if (value == null && (this.type === 0 || this.type === 1)) { - return BN_0; - } - return value; - } - set gasPrice(value) { - this.#gasPrice = (value == null) ? null : (0, index_js_3.getBigInt)(value, "gasPrice"); - } - /** - * The maximum priority fee per unit of gas to pay. On legacy - * networks this should be ``null``. - */ - get maxPriorityFeePerGas() { - const value = this.#maxPriorityFeePerGas; - if (value == null) { - if (this.type === 2 || this.type === 3) { - return BN_0; - } - return null; - } - return value; - } - set maxPriorityFeePerGas(value) { - this.#maxPriorityFeePerGas = (value == null) ? null : (0, index_js_3.getBigInt)(value, "maxPriorityFeePerGas"); - } - /** - * The maximum total fee per unit of gas to pay. On legacy - * networks this should be ``null``. - */ - get maxFeePerGas() { - const value = this.#maxFeePerGas; - if (value == null) { - if (this.type === 2 || this.type === 3) { - return BN_0; - } - return null; - } - return value; - } - set maxFeePerGas(value) { - this.#maxFeePerGas = (value == null) ? null : (0, index_js_3.getBigInt)(value, "maxFeePerGas"); - } - /** - * The transaction data. For ``init`` transactions this is the - * deployment code. - */ - get data() { return this.#data; } - set data(value) { this.#data = (0, index_js_3.hexlify)(value); } - /** - * The amount of ether (in wei) to send in this transactions. - */ - get value() { return this.#value; } - set value(value) { - this.#value = (0, index_js_3.getBigInt)(value, "value"); - } - /** - * The chain ID this transaction is valid on. - */ - get chainId() { return this.#chainId; } - set chainId(value) { this.#chainId = (0, index_js_3.getBigInt)(value); } - /** - * If signed, the signature for this transaction. - */ - get signature() { return this.#sig || null; } - set signature(value) { - this.#sig = (value == null) ? null : index_js_2.Signature.from(value); - } - isValid() { - const sig = this.signature; - if (sig && !sig.isValid()) { - return false; - } - const auths = this.authorizationList; - if (auths) { - for (const auth of auths) { - if (!auth.signature.isValid()) { - return false; - } - } - } - return true; - } - /** - * The access list. - * - * An access list permits discounted (but pre-paid) access to - * bytecode and state variable access within contract execution. - */ - get accessList() { - const value = this.#accessList || null; - if (value == null) { - if (this.type === 1 || this.type === 2 || this.type === 3) { - // @TODO: in v7, this should assign the value or become - // a live object itself, otherwise mutation is inconsistent - return []; - } - return null; - } - return value; - } - set accessList(value) { - this.#accessList = (value == null) ? null : (0, accesslist_js_1.accessListify)(value); - } - get authorizationList() { - const value = this.#auths || null; - if (value == null) { - if (this.type === 4) { - // @TODO: in v7, this should become a live object itself, - // otherwise mutation is inconsistent - return []; - } - } - return value; - } - set authorizationList(auths) { - this.#auths = (auths == null) ? null : auths.map((a) => (0, authorization_js_1.authorizationify)(a)); - } - /** - * The max fee per blob gas for Cancun transactions. - */ - get maxFeePerBlobGas() { - const value = this.#maxFeePerBlobGas; - if (value == null && this.type === 3) { - return BN_0; - } - return value; - } - set maxFeePerBlobGas(value) { - this.#maxFeePerBlobGas = (value == null) ? null : (0, index_js_3.getBigInt)(value, "maxFeePerBlobGas"); - } - /** - * The BLOb versioned hashes for Cancun transactions. - */ - get blobVersionedHashes() { - // @TODO: Mutation is inconsistent; if unset, the returned value - // cannot mutate the object, if set it can - let value = this.#blobVersionedHashes; - if (value == null && this.type === 3) { - return []; - } - return value; - } - set blobVersionedHashes(value) { - if (value != null) { - (0, index_js_3.assertArgument)(Array.isArray(value), "blobVersionedHashes must be an Array", "value", value); - value = value.slice(); - for (let i = 0; i < value.length; i++) { - (0, index_js_3.assertArgument)((0, index_js_3.isHexString)(value[i], 32), "invalid blobVersionedHash", `value[${i}]`, value[i]); - } - } - this.#blobVersionedHashes = value; - } - /** - * The BLObs for the Transaction, if any. - * - * If ``blobs`` is non-``null``, then the [[seriailized]] - * will return the network formatted sidecar, otherwise it - * will return the standard [[link-eip-2718]] payload. The - * [[unsignedSerialized]] is unaffected regardless. - * - * When setting ``blobs``, either fully valid [[Blob]] objects - * may be specified (i.e. correctly padded, with correct - * committments and proofs) or a raw [[BytesLike]] may - * be provided. - * - * If raw [[BytesLike]] are provided, the [[kzg]] property **must** - * be already set. The blob will be correctly padded and the - * [[KzgLibrary]] will be used to compute the committment and - * proof for the blob. - * - * A BLOb is a sequence of field elements, each of which must - * be within the BLS field modulo, so some additional processing - * may be required to encode arbitrary data to ensure each 32 byte - * field is within the valid range. - * - * Setting this automatically populates [[blobVersionedHashes]], - * overwriting any existing values. Setting this to ``null`` - * does **not** remove the [[blobVersionedHashes]], leaving them - * present. - */ - get blobs() { - if (this.#blobs == null) { - return null; - } - return this.#blobs.map((b) => Object.assign({}, b)); - } - set blobs(_blobs) { - if (_blobs == null) { - this.#blobs = null; - return; - } - const blobs = []; - const versionedHashes = []; - for (let i = 0; i < _blobs.length; i++) { - const blob = _blobs[i]; - if ((0, index_js_3.isBytesLike)(blob)) { - (0, index_js_3.assert)(this.#kzg, "adding a raw blob requires a KZG library", "UNSUPPORTED_OPERATION", { - operation: "set blobs()" - }); - let data = (0, index_js_3.getBytes)(blob); - (0, index_js_3.assertArgument)(data.length <= BLOB_SIZE, "blob is too large", `blobs[${i}]`, blob); - // Pad blob if necessary - if (data.length !== BLOB_SIZE) { - const padded = new Uint8Array(BLOB_SIZE); - padded.set(data); - data = padded; - } - const commit = this.#kzg.blobToKzgCommitment(data); - const proof = (0, index_js_3.hexlify)(this.#kzg.computeBlobKzgProof(data, commit)); - blobs.push({ - data: (0, index_js_3.hexlify)(data), - commitment: (0, index_js_3.hexlify)(commit), - proof - }); - versionedHashes.push(getVersionedHash(1, commit)); - } - else { - const data = (0, index_js_3.hexlify)(blob.data); - const commitment = (0, index_js_3.hexlify)(blob.commitment); - const proof = (0, index_js_3.hexlify)(blob.proof); - blobs.push({ data, commitment, proof }); - versionedHashes.push(getVersionedHash(1, commitment)); - } - } - this.#blobs = blobs; - this.#blobVersionedHashes = versionedHashes; - } - get kzg() { return this.#kzg; } - set kzg(kzg) { - if (kzg == null) { - this.#kzg = null; - } - else { - this.#kzg = getKzgLibrary(kzg); - } - } - get blobWrapperVersion() { - return this.#blobWrapperVersion; - } - set blobWrapperVersion(value) { - this.#blobWrapperVersion = value; - } - /** - * Creates a new Transaction with default values. - */ - constructor() { - this.#type = null; - this.#to = null; - this.#nonce = 0; - this.#gasLimit = BN_0; - this.#gasPrice = null; - this.#maxPriorityFeePerGas = null; - this.#maxFeePerGas = null; - this.#data = "0x"; - this.#value = BN_0; - this.#chainId = BN_0; - this.#sig = null; - this.#accessList = null; - this.#maxFeePerBlobGas = null; - this.#blobVersionedHashes = null; - this.#kzg = null; - this.#blobs = null; - this.#auths = null; - this.#blobWrapperVersion = null; - } - /** - * The transaction hash, if signed. Otherwise, ``null``. - */ - get hash() { - if (this.signature == null) { - return null; - } - return (0, index_js_2.keccak256)(this.#getSerialized(true, false)); - } - /** - * The pre-image hash of this transaction. - * - * This is the digest that a [[Signer]] must sign to authorize - * this transaction. - */ - get unsignedHash() { - return (0, index_js_2.keccak256)(this.unsignedSerialized); - } - /** - * The sending address, if signed. Otherwise, ``null``. - */ - get from() { - if (this.signature == null) { - return null; - } - return (0, address_js_1.recoverAddress)(this.unsignedHash, this.signature.getCanonical()); - } - /** - * The public key of the sender, if signed. Otherwise, ``null``. - */ - get fromPublicKey() { - if (this.signature == null) { - return null; - } - return index_js_2.SigningKey.recoverPublicKey(this.unsignedHash, this.signature.getCanonical()); - } - /** - * Returns true if signed. - * - * This provides a Type Guard that properties requiring a signed - * transaction are non-null. - */ - isSigned() { - return this.signature != null; - } - #getSerialized(signed, sidecar) { - (0, index_js_3.assert)(!signed || this.signature != null, "cannot serialize unsigned transaction; maybe you meant .unsignedSerialized", "UNSUPPORTED_OPERATION", { operation: ".serialized" }); - const sig = signed ? this.signature : null; - switch (this.inferType()) { - case 0: - return _serializeLegacy(this, sig); - case 1: - return _serializeEip2930(this, sig); - case 2: - return _serializeEip1559(this, sig); - case 3: - return _serializeEip4844(this, sig, sidecar ? this.blobs : null); - case 4: - return _serializeEip7702(this, sig); - } - (0, index_js_3.assert)(false, "unsupported transaction type", "UNSUPPORTED_OPERATION", { operation: ".serialized" }); - } - /** - * The serialized transaction. - * - * This throws if the transaction is unsigned. For the pre-image, - * use [[unsignedSerialized]]. - */ - get serialized() { - return this.#getSerialized(true, true); - } - /** - * The transaction pre-image. - * - * The hash of this is the digest which needs to be signed to - * authorize this transaction. - */ - get unsignedSerialized() { - return this.#getSerialized(false, false); - } - /** - * Return the most "likely" type; currently the highest - * supported transaction type. - */ - inferType() { - const types = this.inferTypes(); - // Prefer London (EIP-1559) over Cancun (BLOb) - if (types.indexOf(2) >= 0) { - return 2; - } - // Return the highest inferred type - return (types.pop()); - } - /** - * Validates the explicit properties and returns a list of compatible - * transaction types. - */ - inferTypes() { - // Checks that there are no conflicting properties set - const hasGasPrice = this.gasPrice != null; - const hasFee = (this.maxFeePerGas != null || this.maxPriorityFeePerGas != null); - const hasAccessList = (this.accessList != null); - const hasBlob = (this.#maxFeePerBlobGas != null || this.#blobVersionedHashes); - //if (hasGasPrice && hasFee) { - // throw new Error("transaction cannot have gasPrice and maxFeePerGas"); - //} - if (this.maxFeePerGas != null && this.maxPriorityFeePerGas != null) { - (0, index_js_3.assert)(this.maxFeePerGas >= this.maxPriorityFeePerGas, "priorityFee cannot be more than maxFee", "BAD_DATA", { value: this }); - } - //if (this.type === 2 && hasGasPrice) { - // throw new Error("eip-1559 transaction cannot have gasPrice"); - //} - (0, index_js_3.assert)(!hasFee || (this.type !== 0 && this.type !== 1), "transaction type cannot have maxFeePerGas or maxPriorityFeePerGas", "BAD_DATA", { value: this }); - (0, index_js_3.assert)(this.type !== 0 || !hasAccessList, "legacy transaction cannot have accessList", "BAD_DATA", { value: this }); - const types = []; - // Explicit type - if (this.type != null) { - types.push(this.type); - } - else { - if (this.authorizationList && this.authorizationList.length) { - types.push(4); - } - else if (hasFee) { - types.push(2); - } - else if (hasGasPrice) { - types.push(1); - if (!hasAccessList) { - types.push(0); - } - } - else if (hasAccessList) { - types.push(1); - types.push(2); - } - else if (hasBlob && this.to) { - types.push(3); - } - else { - types.push(0); - types.push(1); - types.push(2); - types.push(3); - } - } - types.sort(); - return types; - } - /** - * Returns true if this transaction is a legacy transaction (i.e. - * ``type === 0``). - * - * This provides a Type Guard that the related properties are - * non-null. - */ - isLegacy() { - return (this.type === 0); - } - /** - * Returns true if this transaction is berlin hardform transaction (i.e. - * ``type === 1``). - * - * This provides a Type Guard that the related properties are - * non-null. - */ - isBerlin() { - return (this.type === 1); - } - /** - * Returns true if this transaction is london hardform transaction (i.e. - * ``type === 2``). - * - * This provides a Type Guard that the related properties are - * non-null. - */ - isLondon() { - return (this.type === 2); - } - /** - * Returns true if this transaction is an [[link-eip-4844]] BLOB - * transaction. - * - * This provides a Type Guard that the related properties are - * non-null. - */ - isCancun() { - return (this.type === 3); - } - /** - * Create a copy of this transaciton. - */ - clone() { - return Transaction.from(this); - } - /** - * Return a JSON-friendly object. - */ - toJSON() { - const s = (v) => { - if (v == null) { - return null; - } - return v.toString(); - }; - return { - type: this.type, - to: this.to, - // from: this.from, - data: this.data, - nonce: this.nonce, - gasLimit: s(this.gasLimit), - gasPrice: s(this.gasPrice), - maxPriorityFeePerGas: s(this.maxPriorityFeePerGas), - maxFeePerGas: s(this.maxFeePerGas), - value: s(this.value), - chainId: s(this.chainId), - sig: this.signature ? this.signature.toJSON() : null, - accessList: this.accessList - }; - } - [inspect]() { - return this.toString(); - } - toString() { - const output = []; - const add = (key) => { - let value = this[key]; - if (typeof (value) === "string") { - value = JSON.stringify(value); - } - output.push(`${key}: ${value}`); - }; - if (this.type) { - add("type"); - } - add("to"); - add("data"); - add("nonce"); - add("gasLimit"); - add("value"); - if (this.chainId != null) { - add("chainId"); - } - if (this.signature) { - add("from"); - output.push(`signature: ${this.signature.toString()}`); - } - // @TODO: accessList - // @TODO: blobs (might make output huge; maybe just include a flag?) - const auths = this.authorizationList; - if (auths) { - const outputAuths = []; - for (const auth of auths) { - const o = []; - o.push(`address: ${JSON.stringify(auth.address)}`); - if (auth.nonce != null) { - o.push(`nonce: ${auth.nonce}`); - } - if (auth.chainId != null) { - o.push(`chainId: ${auth.chainId}`); - } - if (auth.signature) { - o.push(`signature: ${auth.signature.toString()}`); - } - outputAuths.push(`Authorization { ${o.join(", ")} }`); - } - output.push(`authorizations: [ ${outputAuths.join(", ")} ]`); - } - return `Transaction { ${output.join(", ")} }`; - } - /** - * Create a **Transaction** from a serialized transaction or a - * Transaction-like object. - */ - static from(tx) { - if (tx == null) { - return new Transaction(); - } - if (typeof (tx) === "string") { - const payload = (0, index_js_3.getBytes)(tx); - if (payload[0] >= 0x7f) { // @TODO: > vs >= ?? - return Transaction.from(_parseLegacy(payload)); - } - switch (payload[0]) { - case 1: return Transaction.from(_parseEip2930(payload)); - case 2: return Transaction.from(_parseEip1559(payload)); - case 3: return Transaction.from(_parseEip4844(payload)); - case 4: return Transaction.from(_parseEip7702(payload)); - } - (0, index_js_3.assert)(false, "unsupported transaction type", "UNSUPPORTED_OPERATION", { operation: "from" }); - } - const result = new Transaction(); - if (tx.type != null) { - result.type = tx.type; - } - if (tx.to != null) { - result.to = tx.to; - } - if (tx.nonce != null) { - result.nonce = tx.nonce; - } - if (tx.gasLimit != null) { - result.gasLimit = tx.gasLimit; - } - if (tx.gasPrice != null) { - result.gasPrice = tx.gasPrice; - } - if (tx.maxPriorityFeePerGas != null) { - result.maxPriorityFeePerGas = tx.maxPriorityFeePerGas; - } - if (tx.maxFeePerGas != null) { - result.maxFeePerGas = tx.maxFeePerGas; - } - if (tx.maxFeePerBlobGas != null) { - result.maxFeePerBlobGas = tx.maxFeePerBlobGas; - } - if (tx.data != null) { - result.data = tx.data; - } - if (tx.value != null) { - result.value = tx.value; - } - if (tx.chainId != null) { - result.chainId = tx.chainId; - } - if (tx.signature != null) { - result.signature = index_js_2.Signature.from(tx.signature); - } - if (tx.accessList != null) { - result.accessList = tx.accessList; - } - if (tx.authorizationList != null) { - result.authorizationList = tx.authorizationList; - } - // This will get overwritten by blobs, if present - if (tx.blobVersionedHashes != null) { - result.blobVersionedHashes = tx.blobVersionedHashes; - } - // Make sure we assign the kzg before assigning blobs, which - // require the library in the event raw blob data is provided. - if (tx.kzg != null) { - result.kzg = tx.kzg; - } - if (tx.blobWrapperVersion != null) { - result.blobWrapperVersion = tx.blobWrapperVersion; - } - if (tx.blobs != null) { - result.blobs = tx.blobs; - } - if (tx.hash != null) { - (0, index_js_3.assertArgument)(result.isSigned(), "unsigned transaction cannot define '.hash'", "tx", tx); - (0, index_js_3.assertArgument)(result.hash === tx.hash, "hash mismatch", "tx", tx); - } - if (tx.from != null) { - (0, index_js_3.assertArgument)(result.isSigned(), "unsigned transaction cannot define '.from'", "tx", tx); - (0, index_js_3.assertArgument)(result.from.toLowerCase() === (tx.from || "").toLowerCase(), "from mismatch", "tx", tx); - } - return result; - } -} -exports.Transaction = Transaction; -//# sourceMappingURL=transaction.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/transaction.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/transaction.js.map deleted file mode 100644 index 2508aebb..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/transaction/transaction.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../src.ts/transaction/transaction.ts"],"names":[],"mappings":";;;AACA,kDAAiD;AACjD,4DAAwD;AACxD,iDAE4B;AAC5B,gDAG2B;AAE3B,mDAAgD;AAChD,yDAAsD;AACtD,6CAA8C;AAS9C,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC,CAAA;AACxB,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC,CAAA;AACxB,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;AACzB,MAAM,WAAW,GAAG,MAAM,CAAC,oEAAoE,CAAC,CAAC;AAEjG,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAEzD,MAAM,SAAS,GAAG,IAAI,GAAG,EAAE,CAAC;AAC5B,MAAM,UAAU,GAAG,GAAG,CAAC;AAGvB;;;;GAIG;AACH,SAAgB,cAAc,CAAC,MAAiB,EAAE,SAAkB;IAChE,IAAI,SAAS,IAAI,IAAI,EAAE;QAAE,SAAS,GAAG,UAAU,CAAC;KAAE;IAElD,MAAM,UAAU,GAAkB,EAAG,CAAC;IAC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.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/base58.d.ts deleted file mode 100644 index 8b377936..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/base58.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * The [Base58 Encoding](link-base58) scheme allows a **numeric** value - * to be encoded as a compact string using a radix of 58 using only - * alpha-numeric characters. Confusingly similar characters are omitted - * (i.e. ``"l0O"``). - * - * Note that Base58 encodes a **numeric** value, not arbitrary bytes, - * since any zero-bytes on the left would get removed. To mitigate this - * issue most schemes that use Base58 choose specific high-order values - * to ensure non-zero prefixes. - * - * @_subsection: api/utils:Base58 Encoding [about-base58] - */ -import type { BytesLike } from "./index.js"; -/** - * Encode %%value%% as a Base58-encoded string. - */ -export declare function encodeBase58(_value: BytesLike): string; -/** - * Decode the Base58-encoded %%value%%. - */ -export declare function decodeBase58(value: string): bigint; -//# sourceMappingURL=base58.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/base58.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/base58.d.ts.map deleted file mode 100644 index a20c8167..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/base58.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base58.d.ts","sourceRoot":"","sources":["../../src.ts/utils/base58.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAsB5C;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAiBtD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOlD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/base58.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/base58.js deleted file mode 100644 index fa62d341..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/base58.js +++ /dev/null @@ -1,68 +0,0 @@ -"use strict"; -/** - * The [Base58 Encoding](link-base58) scheme allows a **numeric** value - * to be encoded as a compact string using a radix of 58 using only - * alpha-numeric characters. Confusingly similar characters are omitted - * (i.e. ``"l0O"``). - * - * Note that Base58 encodes a **numeric** value, not arbitrary bytes, - * since any zero-bytes on the left would get removed. To mitigate this - * issue most schemes that use Base58 choose specific high-order values - * to ensure non-zero prefixes. - * - * @_subsection: api/utils:Base58 Encoding [about-base58] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.decodeBase58 = exports.encodeBase58 = void 0; -const data_js_1 = require("./data.js"); -const errors_js_1 = require("./errors.js"); -const maths_js_1 = require("./maths.js"); -const Alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; -let Lookup = null; -function getAlpha(letter) { - if (Lookup == null) { - Lookup = {}; - for (let i = 0; i < Alphabet.length; i++) { - Lookup[Alphabet[i]] = BigInt(i); - } - } - const result = Lookup[letter]; - (0, errors_js_1.assertArgument)(result != null, `invalid base58 value`, "letter", letter); - return result; -} -const BN_0 = BigInt(0); -const BN_58 = BigInt(58); -/** - * Encode %%value%% as a Base58-encoded string. - */ -function encodeBase58(_value) { - const bytes = (0, data_js_1.getBytes)(_value); - let value = (0, maths_js_1.toBigInt)(bytes); - let result = ""; - while (value) { - result = Alphabet[Number(value % BN_58)] + result; - value /= BN_58; - } - // Account for leading padding zeros - for (let i = 0; i < bytes.length; i++) { - if (bytes[i]) { - break; - } - result = Alphabet[0] + result; - } - return result; -} -exports.encodeBase58 = encodeBase58; -/** - * Decode the Base58-encoded %%value%%. - */ -function decodeBase58(value) { - let result = BN_0; - for (let i = 0; i < value.length; i++) { - result *= BN_58; - result += getAlpha(value[i]); - } - return result; -} -exports.decodeBase58 = decodeBase58; -//# sourceMappingURL=base58.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/base58.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/base58.js.map deleted file mode 100644 index 2059bff7..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/base58.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base58.js","sourceRoot":"","sources":["../../src.ts/utils/base58.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAEH,uCAAqC;AACrC,2CAA6C;AAC7C,yCAAsC;AAKtC,MAAM,QAAQ,GAAG,4DAA4D,CAAC;AAC9E,IAAI,MAAM,GAAkC,IAAI,CAAC;AAEjD,SAAS,QAAQ,CAAC,MAAc;IAC5B,IAAI,MAAM,IAAI,IAAI,EAAE;QAChB,MAAM,GAAG,EAAG,CAAC;QACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACtC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;SACnC;KACJ;IACD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IAC9B,IAAA,0BAAc,EAAC,MAAM,IAAI,IAAI,EAAE,sBAAsB,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACzE,OAAO,MAAM,CAAC;AAClB,CAAC;AAGD,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;AAEzB;;GAEG;AACH,SAAgB,YAAY,CAAC,MAAiB;IAC1C,MAAM,KAAK,GAAG,IAAA,kBAAQ,EAAC,MAAM,CAAC,CAAC;IAE/B,IAAI,KAAK,GAAG,IAAA,mBAAQ,EAAC,KAAK,CAAC,CAAC;IAC5B,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,OAAO,KAAK,EAAE;QACV,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC;QAClD,KAAK,IAAI,KAAK,CAAC;KAClB;IAED,oCAAoC;IACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACnC,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE;YAAE,MAAM;SAAE;QACxB,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;KACjC;IAED,OAAO,MAAM,CAAC;AAClB,CAAC;AAjBD,oCAiBC;AAED;;GAEG;AACH,SAAgB,YAAY,CAAC,KAAa;IACtC,IAAI,MAAM,GAAG,IAAI,CAAC;IAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACnC,MAAM,IAAI,KAAK,CAAC;QAChB,MAAM,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;KAChC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC;AAPD,oCAOC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/base64-browser.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/base64-browser.d.ts deleted file mode 100644 index ea96c442..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/base64-browser.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { BytesLike } from "./data.js"; -export declare function decodeBase64(textData: string): Uint8Array; -export declare function encodeBase64(_data: BytesLike): string; -//# sourceMappingURL=base64-browser.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/base64-browser.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/base64-browser.d.ts.map deleted file mode 100644 index 0adb8e7b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/base64-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base64-browser.d.ts","sourceRoot":"","sources":["../../src.ts/utils/base64-browser.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAG3C,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAOzD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAOrD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/base64-browser.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/base64-browser.js deleted file mode 100644 index ecab4a50..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/base64-browser.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; -// utils/base64-browser -Object.defineProperty(exports, "__esModule", { value: true }); -exports.encodeBase64 = exports.decodeBase64 = void 0; -const data_js_1 = require("./data.js"); -function decodeBase64(textData) { - textData = atob(textData); - const data = new Uint8Array(textData.length); - for (let i = 0; i < textData.length; i++) { - data[i] = textData.charCodeAt(i); - } - return (0, data_js_1.getBytes)(data); -} -exports.decodeBase64 = decodeBase64; -function encodeBase64(_data) { - const data = (0, data_js_1.getBytes)(_data); - let textData = ""; - for (let i = 0; i < data.length; i++) { - textData += String.fromCharCode(data[i]); - } - return btoa(textData); -} -exports.encodeBase64 = encodeBase64; -//# sourceMappingURL=base64-browser.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/base64-browser.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/base64-browser.js.map deleted file mode 100644 index a5ae72a9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/base64-browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base64-browser.js","sourceRoot":"","sources":["../../src.ts/utils/base64-browser.ts"],"names":[],"mappings":";AACA,uBAAuB;;;AAEvB,uCAAqC;AAKrC,SAAgB,YAAY,CAAC,QAAgB;IACzC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1B,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,IAAI,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;KACpC;IACD,OAAO,IAAA,kBAAQ,EAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAPD,oCAOC;AAED,SAAgB,YAAY,CAAC,KAAgB;IACzC,MAAM,IAAI,GAAG,IAAA,kBAAQ,EAAC,KAAK,CAAC,CAAC;IAC7B,IAAI,QAAQ,GAAG,EAAE,CAAC;IAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAClC,QAAQ,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;KAC5C;IACD,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AAPD,oCAOC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/base64.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/base64.d.ts deleted file mode 100644 index 0cab5328..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/base64.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import type { BytesLike } from "./data.js"; -/** - * Decodes the base-64 encoded %%value%%. - * - * @example: - * // The decoded value is always binary data... - * result = decodeBase64("SGVsbG8gV29ybGQhIQ==") - * //_result: - * - * // ...use toUtf8String to convert it to a string. - * toUtf8String(result) - * //_result: - * - * // Decoding binary data - * decodeBase64("EjQ=") - * //_result: - */ -export declare function decodeBase64(value: string): Uint8Array; -/** - * Encodes %%data%% as a base-64 encoded string. - * - * @example: - * // Encoding binary data as a hexstring - * encodeBase64("0x1234") - * //_result: - * - * // Encoding binary data as a Uint8Array - * encodeBase64(new Uint8Array([ 0x12, 0x34 ])) - * //_result: - * - * // The input MUST be data... - * encodeBase64("Hello World!!") - * //_error: - * - * // ...use toUtf8Bytes for this. - * encodeBase64(toUtf8Bytes("Hello World!!")) - * //_result: - */ -export declare function encodeBase64(data: BytesLike): string; -//# sourceMappingURL=base64.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/base64.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/base64.d.ts.map deleted file mode 100644 index 90ad51c1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/base64.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base64.d.ts","sourceRoot":"","sources":["../../src.ts/utils/base64.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAG3C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAEtD;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAEpD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/base64.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/base64.js deleted file mode 100644 index bdef6a38..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/base64.js +++ /dev/null @@ -1,58 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.encodeBase64 = exports.decodeBase64 = void 0; -/** - * [Base64 encoding](link-wiki-base64) using 6-bit words to encode - * arbitrary bytes into a string using 65 printable symbols, the - * upper-case and lower-case alphabet, the digits ``0`` through ``9``, - * ``"+"`` and ``"/"`` with the ``"="`` used for padding. - * - * @_subsection: api/utils:Base64 Encoding [about-base64] - */ -const data_js_1 = require("./data.js"); -/** - * Decodes the base-64 encoded %%value%%. - * - * @example: - * // The decoded value is always binary data... - * result = decodeBase64("SGVsbG8gV29ybGQhIQ==") - * //_result: - * - * // ...use toUtf8String to convert it to a string. - * toUtf8String(result) - * //_result: - * - * // Decoding binary data - * decodeBase64("EjQ=") - * //_result: - */ -function decodeBase64(value) { - return (0, data_js_1.getBytesCopy)(Buffer.from(value, "base64")); -} -exports.decodeBase64 = decodeBase64; -; -/** - * Encodes %%data%% as a base-64 encoded string. - * - * @example: - * // Encoding binary data as a hexstring - * encodeBase64("0x1234") - * //_result: - * - * // Encoding binary data as a Uint8Array - * encodeBase64(new Uint8Array([ 0x12, 0x34 ])) - * //_result: - * - * // The input MUST be data... - * encodeBase64("Hello World!!") - * //_error: - * - * // ...use toUtf8Bytes for this. - * encodeBase64(toUtf8Bytes("Hello World!!")) - * //_result: - */ -function encodeBase64(data) { - return Buffer.from((0, data_js_1.getBytes)(data)).toString("base64"); -} -exports.encodeBase64 = encodeBase64; -//# sourceMappingURL=base64.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/base64.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/base64.js.map deleted file mode 100644 index b4197063..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/base64.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base64.js","sourceRoot":"","sources":["../../src.ts/utils/base64.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACH,uCAAmD;AAKnD;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,YAAY,CAAC,KAAa;IACtC,OAAO,IAAA,sBAAY,EAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;AACtD,CAAC;AAFD,oCAEC;AAAA,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,YAAY,CAAC,IAAe;IACxC,OAAO,MAAM,CAAC,IAAI,CAAC,IAAA,kBAAQ,EAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC1D,CAAC;AAFD,oCAEC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/data.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/data.d.ts deleted file mode 100644 index 59f4fc0e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/data.d.ts +++ /dev/null @@ -1,93 +0,0 @@ -/** - * A [[HexString]] whose length is even, which ensures it is a valid - * representation of binary data. - */ -export type DataHexString = string; -/** - * A string which is prefixed with ``0x`` and followed by any number - * of case-agnostic hexadecimal characters. - * - * It must match the regular expression ``/0x[0-9A-Fa-f]*\/``. - */ -export type HexString = string; -/** - * An object that can be used to represent binary data. - */ -export type BytesLike = DataHexString | Uint8Array; -/** - * Get a typed Uint8Array for %%value%%. If already a Uint8Array - * the original %%value%% is returned; if a copy is required use - * [[getBytesCopy]]. - * - * @see: getBytesCopy - */ -export declare function getBytes(value: BytesLike, name?: string): Uint8Array; -/** - * Get a typed Uint8Array for %%value%%, creating a copy if necessary - * to prevent any modifications of the returned value from being - * reflected elsewhere. - * - * @see: getBytes - */ -export declare function getBytesCopy(value: BytesLike, name?: string): Uint8Array; -/** - * Returns true if %%value%% is a valid [[HexString]]. - * - * If %%length%% is ``true`` or a //number//, it also checks that - * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//) - * bytes of data (e.g. ``0x1234`` is 2 bytes). - */ -export declare function isHexString(value: any, length?: number | boolean): value is `0x${string}`; -/** - * Returns true if %%value%% is a valid representation of arbitrary - * data (i.e. a valid [[DataHexString]] or a Uint8Array). - */ -export declare function isBytesLike(value: any): value is BytesLike; -/** - * Returns a [[DataHexString]] representation of %%data%%. - */ -export declare function hexlify(data: BytesLike): string; -/** - * Returns a [[DataHexString]] by concatenating all values - * within %%data%%. - */ -export declare function concat(datas: ReadonlyArray): string; -/** - * Returns the length of %%data%%, in bytes. - */ -export declare function dataLength(data: BytesLike): number; -/** - * Returns a [[DataHexString]] by slicing %%data%% from the %%start%% - * offset to the %%end%% offset. - * - * By default %%start%% is 0 and %%end%% is the length of %%data%%. - */ -export declare function dataSlice(data: BytesLike, start?: number, end?: number): string; -/** - * Return the [[DataHexString]] result by stripping all **leading** - ** zero bytes from %%data%%. - */ -export declare function stripZerosLeft(data: BytesLike): string; -/** - * Return the [[DataHexString]] of %%data%% padded on the **left** - * to %%length%% bytes. - * - * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is - * thrown. - * - * This pads data the same as **values** are in Solidity - * (e.g. ``uint128``). - */ -export declare function zeroPadValue(data: BytesLike, length: number): string; -/** - * Return the [[DataHexString]] of %%data%% padded on the **right** - * to %%length%% bytes. - * - * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is - * thrown. - * - * This pads data the same as **bytes** are in Solidity - * (e.g. ``bytes16``). - */ -export declare function zeroPadBytes(data: BytesLike, length: number): string; -//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/data.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/data.d.ts.map deleted file mode 100644 index 691a77fa..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/data.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../src.ts/utils/data.ts"],"names":[],"mappings":"AAQA;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CA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node_modules/ethers/lib.commonjs/utils/data.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/data.js deleted file mode 100644 index 1d26650e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/data.js +++ /dev/null @@ -1,185 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.zeroPadBytes = exports.zeroPadValue = exports.stripZerosLeft = exports.dataSlice = exports.dataLength = exports.concat = exports.hexlify = exports.isBytesLike = exports.isHexString = exports.getBytesCopy = exports.getBytes = void 0; -/** - * Some data helpers. - * - * - * @_subsection api/utils:Data Helpers [about-data] - */ -const errors_js_1 = require("./errors.js"); -function _getBytes(value, name, copy) { - if (value instanceof Uint8Array) { - if (copy) { - return new Uint8Array(value); - } - return value; - } - if (typeof (value) === "string" && (value.length % 2) === 0 && - value.match(/^0x[0-9a-f]*$/i)) { - const result = new Uint8Array((value.length - 2) / 2); - let offset = 2; - for (let i = 0; i < result.length; i++) { - result[i] = parseInt(value.substring(offset, offset + 2), 16); - offset += 2; - } - return result; - } - (0, errors_js_1.assertArgument)(false, "invalid BytesLike value", name || "value", value); -} -/** - * Get a typed Uint8Array for %%value%%. If already a Uint8Array - * the original %%value%% is returned; if a copy is required use - * [[getBytesCopy]]. - * - * @see: getBytesCopy - */ -function getBytes(value, name) { - return _getBytes(value, name, false); -} -exports.getBytes = getBytes; -/** - * Get a typed Uint8Array for %%value%%, creating a copy if necessary - * to prevent any modifications of the returned value from being - * reflected elsewhere. - * - * @see: getBytes - */ -function getBytesCopy(value, name) { - return _getBytes(value, name, true); -} -exports.getBytesCopy = getBytesCopy; -/** - * Returns true if %%value%% is a valid [[HexString]]. - * - * If %%length%% is ``true`` or a //number//, it also checks that - * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//) - * bytes of data (e.g. ``0x1234`` is 2 bytes). - */ -function isHexString(value, length) { - if (typeof (value) !== "string" || !value.match(/^0x[0-9A-Fa-f]*$/)) { - return false; - } - if (typeof (length) === "number" && value.length !== 2 + 2 * length) { - return false; - } - if (length === true && (value.length % 2) !== 0) { - return false; - } - return true; -} -exports.isHexString = isHexString; -/** - * Returns true if %%value%% is a valid representation of arbitrary - * data (i.e. a valid [[DataHexString]] or a Uint8Array). - */ -function isBytesLike(value) { - return (isHexString(value, true) || (value instanceof Uint8Array)); -} -exports.isBytesLike = isBytesLike; -const HexCharacters = "0123456789abcdef"; -/** - * Returns a [[DataHexString]] representation of %%data%%. - */ -function hexlify(data) { - const bytes = getBytes(data); - let result = "0x"; - for (let i = 0; i < bytes.length; i++) { - const v = bytes[i]; - result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f]; - } - return result; -} -exports.hexlify = hexlify; -/** - * Returns a [[DataHexString]] by concatenating all values - * within %%data%%. - */ -function concat(datas) { - return "0x" + datas.map((d) => hexlify(d).substring(2)).join(""); -} -exports.concat = concat; -/** - * Returns the length of %%data%%, in bytes. - */ -function dataLength(data) { - if (isHexString(data, true)) { - return (data.length - 2) / 2; - } - return getBytes(data).length; -} -exports.dataLength = dataLength; -/** - * Returns a [[DataHexString]] by slicing %%data%% from the %%start%% - * offset to the %%end%% offset. - * - * By default %%start%% is 0 and %%end%% is the length of %%data%%. - */ -function dataSlice(data, start, end) { - const bytes = getBytes(data); - if (end != null && end > bytes.length) { - (0, errors_js_1.assert)(false, "cannot slice beyond data bounds", "BUFFER_OVERRUN", { - buffer: bytes, length: bytes.length, offset: end - }); - } - return hexlify(bytes.slice((start == null) ? 0 : start, (end == null) ? bytes.length : end)); -} -exports.dataSlice = dataSlice; -/** - * Return the [[DataHexString]] result by stripping all **leading** - ** zero bytes from %%data%%. - */ -function stripZerosLeft(data) { - let bytes = hexlify(data).substring(2); - while (bytes.startsWith("00")) { - bytes = bytes.substring(2); - } - return "0x" + bytes; -} -exports.stripZerosLeft = stripZerosLeft; -function zeroPad(data, length, left) { - const bytes = getBytes(data); - (0, errors_js_1.assert)(length >= bytes.length, "padding exceeds data length", "BUFFER_OVERRUN", { - buffer: new Uint8Array(bytes), - length: length, - offset: length + 1 - }); - const result = new Uint8Array(length); - result.fill(0); - if (left) { - result.set(bytes, length - bytes.length); - } - else { - result.set(bytes, 0); - } - return hexlify(result); -} -/** - * Return the [[DataHexString]] of %%data%% padded on the **left** - * to %%length%% bytes. - * - * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is - * thrown. - * - * This pads data the same as **values** are in Solidity - * (e.g. ``uint128``). - */ -function zeroPadValue(data, length) { - return zeroPad(data, length, true); -} -exports.zeroPadValue = zeroPadValue; -/** - * Return the [[DataHexString]] of %%data%% padded on the **right** - * to %%length%% bytes. - * - * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is - * thrown. - * - * This pads data the same as **bytes** are in Solidity - * (e.g. ``bytes16``). - */ -function zeroPadBytes(data, length) { - return zeroPad(data, length, false); -} -exports.zeroPadBytes = zeroPadBytes; -//# sourceMappingURL=data.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/data.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/data.js.map deleted file mode 100644 index a535455c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/data.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"data.js","sourceRoot":"","sources":["../../src.ts/utils/data.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,2CAAqD;AAqBrD,SAAS,SAAS,CAAC,KAAgB,EAAE,IAAa,EAAE,IAAc;IAC9D,IAAI,KAAK,YAAY,UAAU,EAAE;QAC7B,IAAI,IAAI,EAAE;YAAE,OAAO,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC;SAAE;QAC3C,OAAO,KAAK,CAAC;KAChB;IAED,IAAI,OAAM,CAAC,KAAK,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC;QACxD,KAAK,CAAC,KAAK,CAAC,gBAAg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,EAAE;QAC5E,MAAM,EAAE,IAAI,UAAU,CAAC,KAAK,CAAC;QAC7B,MAAM,EAAE,MAAM;QACd,MAAM,EAAE,MAAM,GAAG,CAAC;KACrB,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;IACtC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACf,IAAI,IAAI,EAAE;QACN,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;KAC5C;SAAM;QACH,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;KACxB;IAED,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC;AAC3B,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,YAAY,CAAC,IAAe,EAAE,MAAc;IACxD,OAAO,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;AACvC,CAAC;AAFD,oCAEC;AAED;;;;;;;;;GASG;AACH,SAAgB,YAAY,CAAC,IAAe,EAAE,MAAc;IACxD,OAAO,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AACxC,CAAC;AAFD,oCAEC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/errors.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/errors.d.ts deleted file mode 100644 index a7bab0d6..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/errors.d.ts +++ /dev/null @@ -1,512 +0,0 @@ -/** - * All errors in ethers include properties to ensure they are both - * human-readable (i.e. ``.message``) and machine-readable (i.e. ``.code``). - * - * The [[isError]] function can be used to check the error ``code`` and - * provide a type guard for the properties present on that error interface. - * - * @_section: api/utils/errors:Errors [about-errors] - */ -import type { TransactionRequest, TransactionReceipt, TransactionResponse } from "../providers/index.js"; -import type { FetchRequest, FetchResponse } from "./fetch.js"; -/** - * An error may contain additional properties, but those must not - * conflict with any implicit properties. - */ -export type ErrorInfo = Omit & { - shortMessage?: string; -}; -/** - * All errors emitted by ethers have an **ErrorCode** to help - * identify and coalesce errors to simplify programmatic analysis. - * - * Each **ErrorCode** is the %%code%% proerty of a coresponding - * [[EthersError]]. - * - * **Generic Errors** - * - * **``"UNKNOWN_ERROR"``** - see [[UnknownError]] - * - * **``"NOT_IMPLEMENTED"``** - see [[NotImplementedError]] - * - * **``"UNSUPPORTED_OPERATION"``** - see [[UnsupportedOperationError]] - * - * **``"NETWORK_ERROR"``** - see [[NetworkError]] - * - * **``"SERVER_ERROR"``** - see [[ServerError]] - * - * **``"TIMEOUT"``** - see [[TimeoutError]] - * - * **``"BAD_DATA"``** - see [[BadDataError]] - * - * **``"CANCELLED"``** - see [[CancelledError]] - * - * **Operational Errors** - * - * **``"BUFFER_OVERRUN"``** - see [[BufferOverrunError]] - * - * **``"NUMERIC_FAULT"``** - see [[NumericFaultError]] - * - * **Argument Errors** - * - * **``"INVALID_ARGUMENT"``** - see [[InvalidArgumentError]] - * - * **``"MISSING_ARGUMENT"``** - see [[MissingArgumentError]] - * - * **``"UNEXPECTED_ARGUMENT"``** - see [[UnexpectedArgumentError]] - * - * **``"VALUE_MISMATCH"``** - //unused// - * - * **Blockchain Errors** - * - * **``"CALL_EXCEPTION"``** - see [[CallExceptionError]] - * - * **``"INSUFFICIENT_FUNDS"``** - see [[InsufficientFundsError]] - * - * **``"NONCE_EXPIRED"``** - see [[NonceExpiredError]] - * - * **``"REPLACEMENT_UNDERPRICED"``** - see [[ReplacementUnderpricedError]] - * - * **``"TRANSACTION_REPLACED"``** - see [[TransactionReplacedError]] - * - * **``"UNCONFIGURED_NAME"``** - see [[UnconfiguredNameError]] - * - * **``"OFFCHAIN_FAULT"``** - see [[OffchainFaultError]] - * - * **User Interaction Errors** - * - * **``"ACTION_REJECTED"``** - see [[ActionRejectedError]] - */ -export type ErrorCode = "UNKNOWN_ERROR" | "NOT_IMPLEMENTED" | "UNSUPPORTED_OPERATION" | "NETWORK_ERROR" | "SERVER_ERROR" | "TIMEOUT" | "BAD_DATA" | "CANCELLED" | "BUFFER_OVERRUN" | "NUMERIC_FAULT" | "INVALID_ARGUMENT" | "MISSING_ARGUMENT" | "UNEXPECTED_ARGUMENT" | "VALUE_MISMATCH" | "CALL_EXCEPTION" | "INSUFFICIENT_FUNDS" | "NONCE_EXPIRED" | "REPLACEMENT_UNDERPRICED" | "TRANSACTION_REPLACED" | "UNCONFIGURED_NAME" | "OFFCHAIN_FAULT" | "ACTION_REJECTED"; -/** - * All errors in Ethers include properties to assist in - * machine-readable errors. - */ -export interface EthersError extends Error { - /** - * The string error code. - */ - code: ErrorCode; - /** - * A short message describing the error, with minimal additional - * details. - */ - shortMessage: string; - /** - * Additional info regarding the error that may be useful. - * - * This is generally helpful mostly for human-based debugging. - */ - info?: Record; - /** - * Any related error. - */ - error?: Error; -} -/** - * This Error is a catch-all for when there is no way for Ethers to - * know what the underlying problem is. - */ -export interface UnknownError extends EthersError<"UNKNOWN_ERROR"> { - [key: string]: any; -} -/** - * This Error is mostly used as a stub for functionality that is - * intended for the future, but is currently not implemented. - */ -export interface NotImplementedError extends EthersError<"NOT_IMPLEMENTED"> { - /** - * The attempted operation. - */ - operation: string; -} -/** - * This Error indicates that the attempted operation is not supported. - * - * This could range from a specific JSON-RPC end-point not supporting - * a feature to a specific configuration of an object prohibiting the - * operation. - * - * For example, a [[Wallet]] with no connected [[Provider]] is unable - * to send a transaction. - */ -export interface UnsupportedOperationError extends EthersError<"UNSUPPORTED_OPERATION"> { - /** - * The attempted operation. - */ - operation: string; -} -/** - * This Error indicates a problem connecting to a network. - */ -export interface NetworkError extends EthersError<"NETWORK_ERROR"> { - /** - * The network event. - */ - event: string; -} -/** - * This Error indicates there was a problem fetching a resource from - * a server. - */ -export interface ServerError extends EthersError<"SERVER_ERROR"> { - /** - * The requested resource. - */ - request: FetchRequest | string; - /** - * The response received from the server, if available. - */ - response?: FetchResponse; -} -/** - * This Error indicates that the timeout duration has expired and - * that the operation has been implicitly cancelled. - * - * The side-effect of the operation may still occur, as this - * generally means a request has been sent and there has simply - * been no response to indicate whether it was processed or not. - */ -export interface TimeoutError extends EthersError<"TIMEOUT"> { - /** - * The attempted operation. - */ - operation: string; - /** - * The reason. - */ - reason: string; - /** - * The resource request, if available. - */ - request?: FetchRequest; -} -/** - * This Error indicates that a provided set of data cannot - * be correctly interpreted. - */ -export interface BadDataError extends EthersError<"BAD_DATA"> { - /** - * The data. - */ - value: any; -} -/** - * This Error indicates that the operation was cancelled by a - * programmatic call, for example to ``cancel()``. - */ -export interface CancelledError extends EthersError<"CANCELLED"> { -} -/** - * This Error indicates an attempt was made to read outside the bounds - * of protected data. - * - * Most operations in Ethers are protected by bounds checks, to mitigate - * exploits when parsing data. - */ -export interface BufferOverrunError extends EthersError<"BUFFER_OVERRUN"> { - /** - * The buffer that was overrun. - */ - buffer: Uint8Array; - /** - * The length of the buffer. - */ - length: number; - /** - * The offset that was requested. - */ - offset: number; -} -/** - * This Error indicates an operation which would result in incorrect - * arithmetic output has occurred. - * - * For example, trying to divide by zero or using a ``uint8`` to store - * a negative value. - */ -export interface NumericFaultError extends EthersError<"NUMERIC_FAULT"> { - /** - * The attempted operation. - */ - operation: string; - /** - * The fault reported. - */ - fault: string; - /** - * The value the operation was attempted against. - */ - value: any; -} -/** - * This Error indicates an incorrect type or value was passed to - * a function or method. - */ -export interface InvalidArgumentError extends EthersError<"INVALID_ARGUMENT"> { - /** - * The name of the argument. - */ - argument: string; - /** - * The value that was provided. - */ - value: any; - info?: Record; -} -/** - * This Error indicates there were too few arguments were provided. - */ -export interface MissingArgumentError extends EthersError<"MISSING_ARGUMENT"> { - /** - * The number of arguments received. - */ - count: number; - /** - * The number of arguments expected. - */ - expectedCount: number; -} -/** - * This Error indicates too many arguments were provided. - */ -export interface UnexpectedArgumentError extends EthersError<"UNEXPECTED_ARGUMENT"> { - /** - * The number of arguments received. - */ - count: number; - /** - * The number of arguments expected. - */ - expectedCount: number; -} -/** - * The action that resulted in the call exception. - */ -export type CallExceptionAction = "call" | "estimateGas" | "getTransactionResult" | "sendTransaction" | "unknown"; -/** - * The related transaction that caused the error. - */ -export type CallExceptionTransaction = { - to: null | string; - from?: string; - data: string; -}; -/** - * This **Error** indicates a transaction reverted. - */ -export interface CallExceptionError extends EthersError<"CALL_EXCEPTION"> { - /** - * The action being performed when the revert was encountered. - */ - action: CallExceptionAction; - /** - * The revert data returned. - */ - data: null | string; - /** - * A human-readable representation of data, if possible. - */ - reason: null | string; - /** - * The transaction that triggered the exception. - */ - transaction: CallExceptionTransaction; - /** - * The contract invocation details, if available. - */ - invocation: null | { - method: string; - signature: string; - args: Array; - }; - /** - * The built-in or custom revert error, if available - */ - revert: null | { - signature: string; - name: string; - args: Array; - }; - /** - * If the error occurred in a transaction that was mined - * (with a status of ``0``), this is the receipt. - */ - receipt?: TransactionReceipt; -} -/** - * The sending account has insufficient funds to cover the - * entire transaction cost. - */ -export interface InsufficientFundsError extends EthersError<"INSUFFICIENT_FUNDS"> { - /** - * The transaction. - */ - transaction: TransactionRequest; -} -/** - * The sending account has already used this nonce in a - * transaction that has been included. - */ -export interface NonceExpiredError extends EthersError<"NONCE_EXPIRED"> { - /** - * The transaction. - */ - transaction: TransactionRequest; -} -/** - * A CCIP-read exception, which cannot be recovered from or - * be further processed. - */ -export interface OffchainFaultError extends EthersError<"OFFCHAIN_FAULT"> { - /** - * The transaction. - */ - transaction?: TransactionRequest; - /** - * The reason the CCIP-read failed. - */ - reason: string; -} -/** - * An attempt was made to replace a transaction, but with an - * insufficient additional fee to afford evicting the old - * transaction from the memory pool. - */ -export interface ReplacementUnderpricedError extends EthersError<"REPLACEMENT_UNDERPRICED"> { - /** - * The transaction. - */ - transaction: TransactionRequest; -} -/** - * A pending transaction was replaced by another. - */ -export interface TransactionReplacedError extends EthersError<"TRANSACTION_REPLACED"> { - /** - * If the transaction was cancelled, such that the original - * effects of the transaction cannot be assured. - */ - cancelled: boolean; - /** - * The reason the transaction was replaced. - */ - reason: "repriced" | "cancelled" | "replaced"; - /** - * The hash of the replaced transaction. - */ - hash: string; - /** - * The transaction that replaced the transaction. - */ - replacement: TransactionResponse; - /** - * The receipt of the transaction that replace the transaction. - */ - receipt: TransactionReceipt; -} -/** - * This Error indicates an ENS name was used, but the name has not - * been configured. - * - * This could indicate an ENS name is unowned or that the current - * address being pointed to is the [[ZeroAddress]]. - */ -export interface UnconfiguredNameError extends EthersError<"UNCONFIGURED_NAME"> { - /** - * The ENS name that was requested - */ - value: string; -} -/** - * This Error indicates a request was rejected by the user. - * - * In most clients (such as MetaMask), when an operation requires user - * authorization (such as ``signer.sendTransaction``), the client - * presents a dialog box to the user. If the user denies the request - * this error is thrown. - */ -export interface ActionRejectedError extends EthersError<"ACTION_REJECTED"> { - /** - * The requested action. - */ - action: "requestAccess" | "sendTransaction" | "signMessage" | "signTransaction" | "signTypedData" | "unknown"; - /** - * The reason the action was rejected. - * - * If there is already a pending request, some clients may indicate - * there is already a ``"pending"`` action. This prevents an app - * from spamming the user. - */ - reason: "expired" | "rejected" | "pending"; -} -/** - * A conditional type that transforms the [[ErrorCode]] T into - * its EthersError type. - * - * @flatworm-skip-docs - */ -export type CodedEthersError = T extends "UNKNOWN_ERROR" ? UnknownError : T extends "NOT_IMPLEMENTED" ? NotImplementedError : T extends "UNSUPPORTED_OPERATION" ? UnsupportedOperationError : T extends "NETWORK_ERROR" ? NetworkError : T extends "SERVER_ERROR" ? ServerError : T extends "TIMEOUT" ? TimeoutError : T extends "BAD_DATA" ? BadDataError : T extends "CANCELLED" ? CancelledError : T extends "BUFFER_OVERRUN" ? BufferOverrunError : T extends "NUMERIC_FAULT" ? NumericFaultError : T extends "INVALID_ARGUMENT" ? InvalidArgumentError : T extends "MISSING_ARGUMENT" ? MissingArgumentError : T extends "UNEXPECTED_ARGUMENT" ? UnexpectedArgumentError : T extends "CALL_EXCEPTION" ? CallExceptionError : T extends "INSUFFICIENT_FUNDS" ? InsufficientFundsError : T extends "NONCE_EXPIRED" ? NonceExpiredError : T extends "OFFCHAIN_FAULT" ? OffchainFaultError : T extends "REPLACEMENT_UNDERPRICED" ? ReplacementUnderpricedError : T extends "TRANSACTION_REPLACED" ? TransactionReplacedError : T extends "UNCONFIGURED_NAME" ? UnconfiguredNameError : T extends "ACTION_REJECTED" ? ActionRejectedError : never; -/** - * Returns true if the %%error%% matches an error thrown by ethers - * that matches the error %%code%%. - * - * In TypeScript environments, this can be used to check that %%error%% - * matches an EthersError type, which means the expected properties will - * be set. - * - * @See [ErrorCodes](api:ErrorCode) - * @example - * try { - * // code.... - * } catch (e) { - * if (isError(e, "CALL_EXCEPTION")) { - * // The Type Guard has validated this object - * console.log(e.data); - * } - * } - */ -export declare function isError>(error: any, code: K): error is T; -/** - * Returns true if %%error%% is a [[CallExceptionError]. - */ -export declare function isCallException(error: any): error is CallExceptionError; -/** - * Returns a new Error configured to the format ethers emits errors, with - * the %%message%%, [[api:ErrorCode]] %%code%% and additional properties - * for the corresponding EthersError. - * - * Each error in ethers includes the version of ethers, a - * machine-readable [[ErrorCode]], and depending on %%code%%, additional - * required properties. The error message will also include the %%message%%, - * ethers version, %%code%% and all additional properties, serialized. - */ -export declare function makeError>(message: string, code: K, info?: ErrorInfo): T; -/** - * Throws an EthersError with %%message%%, %%code%% and additional error - * %%info%% when %%check%% is falsish.. - * - * @see [[api:makeError]] - */ -export declare function assert>(check: unknown, message: string, code: K, info?: ErrorInfo): asserts check; -/** - * A simple helper to simply ensuring provided arguments match expected - * constraints, throwing if not. - * - * In TypeScript environments, the %%check%% has been asserted true, so - * any further code does not need additional compile-time checks. - */ -export declare function assertArgument(check: unknown, message: string, name: string, value: unknown): asserts check; -export declare function assertArgumentCount(count: number, expectedCount: number, message?: string): void; -/** - * Throws if the normalization %%form%% is not supported. - */ -export declare function assertNormalize(form: string): void; -/** - * Many classes use file-scoped values to guard the constructor, - * making it effectively private. This facilitates that pattern - * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%, - * throwing if not, indicating the %%className%% if provided. - */ -export declare function assertPrivate(givenGuard: any, guard: any, className?: string): void; -//# sourceMappingURL=errors.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/errors.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/errors.d.ts.map deleted file mode 100644 index f16258be..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/errors.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src.ts/utils/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,OAAO,KAAK,EACR,kBAAkB,EAAE,kBAAkB,EAAE,mBAAmB,EAC9D,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE9D;;;GAGG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,cAAc,CAAC,GAAG;IAAE,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AA+C7G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AACH,MAAM,MAAM,SAAS,GAGjB,eAAe,GAAG,iBAAiB,GAAG,uBAAuB,GAC7D,eAAe,GAAG,cAAc,GAAG,SAAS,GAAG,UAAU,GACzD,WAAW,GAGX,gBAAgB,GAAI,eAAe,GAGnC,kBAAkB,GAAG,kBAAkB,GAAG,qBAAqB,GAC/D,gBAAgB,GAGhB,gBAAgB,GAAG,oBAAoB,GAAG,eAAe,GACzD,yBAAyB,GAAG,sBAAsB,GAClD,mBAAmB,GAAG,gBAAgB,GAGtC,iBAAiB,CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW,CAA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AEvJ;AAGD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,CAE3G;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAahG;AAuBD;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAIlD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAYnF"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/errors.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/errors.js deleted file mode 100644 index 8691b6aa..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/errors.js +++ /dev/null @@ -1,243 +0,0 @@ -"use strict"; -/** - * All errors in ethers include properties to ensure they are both - * human-readable (i.e. ``.message``) and machine-readable (i.e. ``.code``). - * - * The [[isError]] function can be used to check the error ``code`` and - * provide a type guard for the properties present on that error interface. - * - * @_section: api/utils/errors:Errors [about-errors] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.assertPrivate = exports.assertNormalize = exports.assertArgumentCount = exports.assertArgument = exports.assert = exports.makeError = exports.isCallException = exports.isError = void 0; -const _version_js_1 = require("../_version.js"); -const properties_js_1 = require("./properties.js"); -function stringify(value, seen) { - if (value == null) { - return "null"; - } - if (seen == null) { - seen = new Set(); - } - if (typeof (value) === "object") { - if (seen.has(value)) { - return "[Circular]"; - } - seen.add(value); - } - if (Array.isArray(value)) { - return "[ " + (value.map((v) => stringify(v, seen))).join(", ") + " ]"; - } - if (value instanceof Uint8Array) { - const HEX = "0123456789abcdef"; - let result = "0x"; - for (let i = 0; i < value.length; i++) { - result += HEX[value[i] >> 4]; - result += HEX[value[i] & 0xf]; - } - return result; - } - if (typeof (value) === "object" && typeof (value.toJSON) === "function") { - return stringify(value.toJSON(), seen); - } - switch (typeof (value)) { - case "boolean": - case "number": - case "symbol": - return value.toString(); - case "bigint": - return BigInt(value).toString(); - case "string": - return JSON.stringify(value); - case "object": { - const keys = Object.keys(value); - keys.sort(); - return "{ " + keys.map((k) => `${stringify(k, seen)}: ${stringify(value[k], seen)}`).join(", ") + " }"; - } - } - return `[ COULD NOT SERIALIZE ]`; -} -/** - * Returns true if the %%error%% matches an error thrown by ethers - * that matches the error %%code%%. - * - * In TypeScript environments, this can be used to check that %%error%% - * matches an EthersError type, which means the expected properties will - * be set. - * - * @See [ErrorCodes](api:ErrorCode) - * @example - * try { - * // code.... - * } catch (e) { - * if (isError(e, "CALL_EXCEPTION")) { - * // The Type Guard has validated this object - * console.log(e.data); - * } - * } - */ -function isError(error, code) { - return (error && error.code === code); -} -exports.isError = isError; -/** - * Returns true if %%error%% is a [[CallExceptionError]. - */ -function isCallException(error) { - return isError(error, "CALL_EXCEPTION"); -} -exports.isCallException = isCallException; -/** - * Returns a new Error configured to the format ethers emits errors, with - * the %%message%%, [[api:ErrorCode]] %%code%% and additional properties - * for the corresponding EthersError. - * - * Each error in ethers includes the version of ethers, a - * machine-readable [[ErrorCode]], and depending on %%code%%, additional - * required properties. The error message will also include the %%message%%, - * ethers version, %%code%% and all additional properties, serialized. - */ -function makeError(message, code, info) { - let shortMessage = message; - { - const details = []; - if (info) { - if ("message" in info || "code" in info || "name" in info) { - throw new Error(`value will overwrite populated values: ${stringify(info)}`); - } - for (const key in info) { - if (key === "shortMessage") { - continue; - } - const value = (info[key]); - // try { - details.push(key + "=" + stringify(value)); - // } catch (error: any) { - // console.log("MMM", error.message); - // details.push(key + "=[could not serialize object]"); - // } - } - } - details.push(`code=${code}`); - details.push(`version=${_version_js_1.version}`); - if (details.length) { - message += " (" + details.join(", ") + ")"; - } - } - let error; - switch (code) { - case "INVALID_ARGUMENT": - error = new TypeError(message); - break; - case "NUMERIC_FAULT": - case "BUFFER_OVERRUN": - error = new RangeError(message); - break; - default: - error = new Error(message); - } - (0, properties_js_1.defineProperties)(error, { code }); - if (info) { - Object.assign(error, info); - } - if (error.shortMessage == null) { - (0, properties_js_1.defineProperties)(error, { shortMessage }); - } - return error; -} -exports.makeError = makeError; -/** - * Throws an EthersError with %%message%%, %%code%% and additional error - * %%info%% when %%check%% is falsish.. - * - * @see [[api:makeError]] - */ -function assert(check, message, code, info) { - if (!check) { - throw makeError(message, code, info); - } -} -exports.assert = assert; -/** - * A simple helper to simply ensuring provided arguments match expected - * constraints, throwing if not. - * - * In TypeScript environments, the %%check%% has been asserted true, so - * any further code does not need additional compile-time checks. - */ -function assertArgument(check, message, name, value) { - assert(check, message, "INVALID_ARGUMENT", { argument: name, value: value }); -} -exports.assertArgument = assertArgument; -function assertArgumentCount(count, expectedCount, message) { - if (message == null) { - message = ""; - } - if (message) { - message = ": " + message; - } - assert(count >= expectedCount, "missing argument" + message, "MISSING_ARGUMENT", { - count: count, - expectedCount: expectedCount - }); - assert(count <= expectedCount, "too many arguments" + message, "UNEXPECTED_ARGUMENT", { - count: count, - expectedCount: expectedCount - }); -} -exports.assertArgumentCount = assertArgumentCount; -const _normalizeForms = ["NFD", "NFC", "NFKD", "NFKC"].reduce((accum, form) => { - try { - // General test for normalize - /* c8 ignore start */ - if ("test".normalize(form) !== "test") { - throw new Error("bad"); - } - ; - /* c8 ignore stop */ - if (form === "NFD") { - const check = String.fromCharCode(0xe9).normalize("NFD"); - const expected = String.fromCharCode(0x65, 0x0301); - /* c8 ignore start */ - if (check !== expected) { - throw new Error("broken"); - } - /* c8 ignore stop */ - } - accum.push(form); - } - catch (error) { } - return accum; -}, []); -/** - * Throws if the normalization %%form%% is not supported. - */ -function assertNormalize(form) { - assert(_normalizeForms.indexOf(form) >= 0, "platform missing String.prototype.normalize", "UNSUPPORTED_OPERATION", { - operation: "String.prototype.normalize", info: { form } - }); -} -exports.assertNormalize = assertNormalize; -/** - * Many classes use file-scoped values to guard the constructor, - * making it effectively private. This facilitates that pattern - * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%, - * throwing if not, indicating the %%className%% if provided. - */ -function assertPrivate(givenGuard, guard, className) { - if (className == null) { - className = ""; - } - if (givenGuard !== guard) { - let method = className, operation = "new"; - if (className) { - method += "."; - operation += " " + className; - } - assert(false, `private constructor; use ${method}from* methods`, "UNSUPPORTED_OPERATION", { - operation - }); - } -} -exports.assertPrivate = assertPrivate; -//# sourceMappingURL=errors.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/errors.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/errors.js.map deleted file mode 100644 index 2d88ca08..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/errors.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src.ts/utils/errors.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAEH,gDAAyC;AAEzC,mDAAmD;AAenD,SAAS,SAAS,CAAC,KAAU,EAAE,IAAe;IAC1C,IAAI,KAAK,IAAI,IAAI,EAAE;QAAE,OAAO,MAAM,CAAC;KAAE;IAErC,IAAI,IAAI,IAAI,IAAI,EAAE;QAAE,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC;KAAE;IACvC,IAAI,OAAM,CAAC,KAAK,CAAC,KAAK,QAAQ,EAAE;QAC5B,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YAAE,OAAO,YAAY,CAAC;SAAE;QAC7C,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;KACnB;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACtB,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC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;gBAAE,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAA;aAAE;YACrD,oBAAoB;SACvB;QAED,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KACpB;IAAC,OAAM,KAAK,EAAE,GAAG;IAElB,OAAO,KAAK,CAAC;AACjB,CAAC,EAAiB,EAAE,CAAC,CAAC;AAEtB;;GAEG;AACH,SAAgB,eAAe,CAAC,IAAY;IACxC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,6CAA6C,EAAE,uBAAuB,EAAE;QAC/G,SAAS,EAAE,4BAA4B,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE;KAC1D,CAAC,CAAC;AACP,CAAC;AAJD,0CAIC;AAED;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,UAAe,EAAE,KAAU,EAAE,SAAkB;IACzE,IAAI,SAAS,IAAI,IAAI,EAAE;QAAE,SAAS,GAAG,EAAE,CAAC;KAAE;IAC1C,IAAI,UAAU,KAAK,KAAK,EAAE;QACtB,IAAI,MAAM,GAAG,SAAS,EAAE,SAAS,GAAG,KAAK,CAAC;QAC1C,IAAI,SAAS,EAAE;YACX,MAAM,IAAI,GAAG,CAAC;YACd,SAAS,IAAI,GAAG,GAAG,SAAS,CAAC;SAChC;QACD,MAAM,CAAC,KAAK,EAAE,4BAA6B,MAAO,eAAe,EAAE,uBAAuB,EAAE;YACxF,SAAS;SACZ,CAAC,CAAC;KACN;AACL,CAAC;AAZD,sCAYC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/events.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/events.d.ts deleted file mode 100644 index 5da08892..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/events.d.ts +++ /dev/null @@ -1,77 +0,0 @@ -/** - * A callback function called when a an event is triggered. - */ -export type Listener = (...args: Array) => void; -/** - * An **EventEmitterable** behaves similar to an EventEmitter - * except provides async access to its methods. - * - * An EventEmitter implements the observer pattern. - */ -export interface EventEmitterable { - /** - * Registers a %%listener%% that is called whenever the - * %%event%% occurs until unregistered. - */ - on(event: T, listener: Listener): Promise; - /** - * Registers a %%listener%% that is called the next time - * %%event%% occurs. - */ - once(event: T, listener: Listener): Promise; - /** - * Triggers each listener for %%event%% with the %%args%%. - */ - emit(event: T, ...args: Array): Promise; - /** - * Resolves to the number of listeners for %%event%%. - */ - listenerCount(event?: T): Promise; - /** - * Resolves to the listeners for %%event%%. - */ - listeners(event?: T): Promise>; - /** - * Unregister the %%listener%% for %%event%%. If %%listener%% - * is unspecified, all listeners are unregistered. - */ - off(event: T, listener?: Listener): Promise; - /** - * Unregister all listeners for %%event%%. - */ - removeAllListeners(event?: T): Promise; - /** - * Alias for [[on]]. - */ - addListener(event: T, listener: Listener): Promise; - /** - * Alias for [[off]]. - */ - removeListener(event: T, listener: Listener): Promise; -} -/** - * When an [[EventEmitterable]] triggers a [[Listener]], the - * callback always ahas one additional argument passed, which is - * an **EventPayload**. - */ -export declare class EventPayload { - #private; - /** - * The event filter. - */ - readonly filter: T; - /** - * The **EventEmitterable**. - */ - readonly emitter: EventEmitterable; - /** - * Create a new **EventPayload** for %%emitter%% with - * the %%listener%% and for %%filter%%. - */ - constructor(emitter: EventEmitterable, listener: null | Listener, filter: T); - /** - * Unregister the triggered listener for future events. - */ - removeListener(): Promise; -} -//# sourceMappingURL=events.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/events.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/events.d.ts.map deleted file mode 100644 index 645e81ff..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/events.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src.ts/utils/events.ts"],"names":[],"mappings":"AASA;;GAEG;AACH,MAAM,MAAM,QAAQ,GAA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B;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAIvC;;;OAGG;gBACS,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,GAAG,QAAQ,EAAE,MAAM,EAAE,CAAC;IAK9E;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;CAIxC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/events.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/events.js deleted file mode 100644 index 00e1d912..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/events.js +++ /dev/null @@ -1,46 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.EventPayload = void 0; -/** - * Events allow for applications to use the observer pattern, which - * allows subscribing and publishing events, outside the normal - * execution paths. - * - * @_section api/utils/events:Events [about-events] - */ -const properties_js_1 = require("./properties.js"); -/** - * When an [[EventEmitterable]] triggers a [[Listener]], the - * callback always ahas one additional argument passed, which is - * an **EventPayload**. - */ -class EventPayload { - /** - * The event filter. - */ - filter; - /** - * The **EventEmitterable**. - */ - emitter; - #listener; - /** - * Create a new **EventPayload** for %%emitter%% with - * the %%listener%% and for %%filter%%. - */ - constructor(emitter, listener, filter) { - this.#listener = listener; - (0, properties_js_1.defineProperties)(this, { emitter, filter }); - } - /** - * Unregister the triggered listener for future events. - */ - async removeListener() { - if (this.#listener == null) { - return; - } - await this.emitter.off(this.filter, this.#listener); - } -} -exports.EventPayload = EventPayload; -//# sourceMappingURL=events.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/events.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/events.js.map deleted file mode 100644 index b7242bec..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/events.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src.ts/utils/events.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,mDAAmD;AA+DnD;;;;GAIG;AACH,MAAa,YAAY;IACrB;;OAEG;IACM,MAAM,CAAK;IAEpB;;OAEG;IACM,OAAO,CAAuB;IAE9B,SAAS,CAAkB;IAEpC;;;OAGG;IACH,YAAY,OAA4B,EAAE,QAAyB,EAAE,MAAS;QAC1E,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAA,gCAAgB,EAAoB,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IACnE,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,cAAc;QAChB,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,EAAE;YAAE,OAAO;SAAE;QACvC,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IACxD,CAAC;CACJ;AA7BD,oCA6BC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/fetch.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/fetch.d.ts deleted file mode 100644 index d1257928..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/fetch.d.ts +++ /dev/null @@ -1,363 +0,0 @@ -/** - * An environment's implementation of ``getUrl`` must return this type. - */ -export type GetUrlResponse = { - statusCode: number; - statusMessage: string; - headers: Record; - body: null | Uint8Array; -}; -/** - * This can be used to control how throttling is handled in - * [[FetchRequest-setThrottleParams]]. - */ -export type FetchThrottleParams = { - maxAttempts?: number; - slotInterval?: number; -}; -/** - * Called before any network request, allowing updated headers (e.g. Bearer tokens), etc. - */ -export type FetchPreflightFunc = (req: FetchRequest) => Promise; -/** - * Called on the response, allowing client-based throttling logic or post-processing. - */ -export type FetchProcessFunc = (req: FetchRequest, resp: FetchResponse) => Promise; -/** - * Called prior to each retry; return true to retry, false to abort. - */ -export type FetchRetryFunc = (req: FetchRequest, resp: FetchResponse, attempt: number) => Promise; -/** - * Called on Gateway URLs. - */ -export type FetchGatewayFunc = (url: string, signal?: FetchCancelSignal) => Promise; -/** - * Used to perform a fetch; use this to override the underlying network - * fetch layer. In NodeJS, the default uses the "http" and "https" libraries - * and in the browser ``fetch`` is used. If you wish to use Axios, this is - * how you would register it. - */ -export type FetchGetUrlFunc = (req: FetchRequest, signal?: FetchCancelSignal) => Promise; -/** - * @_ignore - */ -export declare class FetchCancelSignal { - #private; - constructor(request: FetchRequest); - addListener(listener: () => void): void; - get cancelled(): boolean; - checkSignal(): void; -} -/** - * Represents a request for a resource using a URI. - * - * By default, the supported schemes are ``HTTP``, ``HTTPS``, ``data:``, - * and ``IPFS:``. - * - * Additional schemes can be added globally using [[registerGateway]]. - * - * @example: - * req = new FetchRequest("https://www.ricmoo.com") - * resp = await req.send() - * resp.body.length - * //_result: - */ -export declare class FetchRequest implements Iterable<[key: string, value: string]> { - #private; - /** - * The fetch URL to request. - */ - get url(): string; - set url(url: string); - /** - * The fetch body, if any, to send as the request body. //(default: null)// - * - * When setting a body, the intrinsic ``Content-Type`` is automatically - * set and will be used if **not overridden** by setting a custom - * header. - * - * If %%body%% is null, the body is cleared (along with the - * intrinsic ``Content-Type``). - * - * If %%body%% is a string, the intrinsic ``Content-Type`` is set to - * ``text/plain``. - * - * If %%body%% is a Uint8Array, the intrinsic ``Content-Type`` is set to - * ``application/octet-stream``. - * - * If %%body%% is any other object, the intrinsic ``Content-Type`` is - * set to ``application/json``. - */ - get body(): null | Uint8Array; - set body(body: null | string | Readonly | Readonly); - /** - * Returns true if the request has a body. - */ - hasBody(): this is (FetchRequest & { - body: Uint8Array; - }); - /** - * The HTTP method to use when requesting the URI. If no method - * has been explicitly set, then ``GET`` is used if the body is - * null and ``POST`` otherwise. - */ - get method(): string; - set method(method: null | string); - /** - * The headers that will be used when requesting the URI. All - * keys are lower-case. - * - * This object is a copy, so any changes will **NOT** be reflected - * in the ``FetchRequest``. - * - * To set a header entry, use the ``setHeader`` method. - */ - get headers(): Record; - /** - * Get the header for %%key%%, ignoring case. - */ - getHeader(key: string): string; - /** - * Set the header for %%key%% to %%value%%. All values are coerced - * to a string. - */ - setHeader(key: string, value: string | number): void; - /** - * Clear all headers, resetting all intrinsic headers. - */ - clearHeaders(): void; - [Symbol.iterator](): Iterator<[key: string, value: string]>; - /** - * The value that will be sent for the ``Authorization`` header. - * - * To set the credentials, use the ``setCredentials`` method. - */ - get credentials(): null | string; - /** - * Sets an ``Authorization`` for %%username%% with %%password%%. - */ - setCredentials(username: string, password: string): void; - /** - * Enable and request gzip-encoded responses. The response will - * automatically be decompressed. //(default: true)// - */ - get allowGzip(): boolean; - set allowGzip(value: boolean); - /** - * Allow ``Authentication`` credentials to be sent over insecure - * channels. //(default: false)// - */ - get allowInsecureAuthentication(): boolean; - set allowInsecureAuthentication(value: boolean); - /** - * The timeout (in milliseconds) to wait for a complete response. - * //(default: 5 minutes)// - */ - get timeout(): number; - set timeout(timeout: number); - /** - * This function is called prior to each request, for example - * during a redirection or retry in case of server throttling. - * - * This offers an opportunity to populate headers or update - * content before sending a request. - */ - get preflightFunc(): null | FetchPreflightFunc; - set preflightFunc(preflight: null | FetchPreflightFunc); - /** - * This function is called after each response, offering an - * opportunity to provide client-level throttling or updating - * response data. - * - * Any error thrown in this causes the ``send()`` to throw. - * - * To schedule a retry attempt (assuming the maximum retry limit - * has not been reached), use [[response.throwThrottleError]]. - */ - get processFunc(): null | FetchProcessFunc; - set processFunc(process: null | FetchProcessFunc); - /** - * This function is called on each retry attempt. - */ - get retryFunc(): null | FetchRetryFunc; - set retryFunc(retry: null | FetchRetryFunc); - /** - * This function is called to fetch content from HTTP and - * HTTPS URLs and is platform specific (e.g. nodejs vs - * browsers). - * - * This is by default the currently registered global getUrl - * function, which can be changed using [[registerGetUrl]]. - * If this has been set, setting is to ``null`` will cause - * this FetchRequest (and any future clones) to revert back to - * using the currently registered global getUrl function. - * - * Setting this is generally not necessary, but may be useful - * for developers that wish to intercept requests or to - * configurege a proxy or other agent. - */ - get getUrlFunc(): FetchGetUrlFunc; - set getUrlFunc(value: null | FetchGetUrlFunc); - /** - * Create a new FetchRequest instance with default values. - * - * Once created, each property may be set before issuing a - * ``.send()`` to make the request. - */ - constructor(url: string); - toString(): string; - /** - * Update the throttle parameters used to determine maximum - * attempts and exponential-backoff properties. - */ - setThrottleParams(params: FetchThrottleParams): void; - /** - * Resolves to the response by sending the request. - */ - send(): Promise; - /** - * Cancels the inflight response, causing a ``CANCELLED`` - * error to be rejected from the [[send]]. - */ - cancel(): void; - /** - * Returns a new [[FetchRequest]] that represents the redirection - * to %%location%%. - */ - redirect(location: string): FetchRequest; - /** - * Create a new copy of this request. - */ - clone(): FetchRequest; - /** - * Locks all static configuration for gateways and FetchGetUrlFunc - * registration. - */ - static lockConfig(): void; - /** - * Get the current Gateway function for %%scheme%%. - */ - static getGateway(scheme: string): null | FetchGatewayFunc; - /** - * Use the %%func%% when fetching URIs using %%scheme%%. - * - * This method affects all requests globally. - * - * If [[lockConfig]] has been called, no change is made and this - * throws. - */ - static registerGateway(scheme: string, func: FetchGatewayFunc): void; - /** - * Use %%getUrl%% when fetching URIs over HTTP and HTTPS requests. - * - * This method affects all requests globally. - * - * If [[lockConfig]] has been called, no change is made and this - * throws. - */ - static registerGetUrl(getUrl: FetchGetUrlFunc): void; - /** - * Creates a getUrl function that fetches content from HTTP and - * HTTPS URLs. - * - * The available %%options%% are dependent on the platform - * implementation of the default getUrl function. - * - * This is not generally something that is needed, but is useful - * when trying to customize simple behaviour when fetching HTTP - * content. - */ - static createGetUrlFunc(options?: Record): FetchGetUrlFunc; - /** - * Creates a function that can "fetch" data URIs. - * - * Note that this is automatically done internally to support - * data URIs, so it is not necessary to register it. - * - * This is not generally something that is needed, but may - * be useful in a wrapper to perfom custom data URI functionality. - */ - static createDataGateway(): FetchGatewayFunc; - /** - * Creates a function that will fetch IPFS (unvalidated) from - * a custom gateway baseUrl. - * - * The default IPFS gateway used internally is - * ``"https:/\/gateway.ipfs.io/ipfs/"``. - */ - static createIpfsGatewayFunc(baseUrl: string): FetchGatewayFunc; -} -/** - * The response for a FetchRequest. - */ -export declare class FetchResponse implements Iterable<[key: string, value: string]> { - #private; - toString(): string; - /** - * The response status code. - */ - get statusCode(): number; - /** - * The response status message. - */ - get statusMessage(): string; - /** - * The response headers. All keys are lower-case. - */ - get headers(): Record; - /** - * The response body, or ``null`` if there was no body. - */ - get body(): null | Readonly; - /** - * The response body as a UTF-8 encoded string, or the empty - * string (i.e. ``""``) if there was no body. - * - * An error is thrown if the body is invalid UTF-8 data. - */ - get bodyText(): string; - /** - * The response body, decoded as JSON. - * - * An error is thrown if the body is invalid JSON-encoded data - * or if there was no body. - */ - get bodyJson(): any; - [Symbol.iterator](): Iterator<[key: string, value: string]>; - constructor(statusCode: number, statusMessage: string, headers: Readonly>, body: null | Uint8Array, request?: FetchRequest); - /** - * Return a Response with matching headers and body, but with - * an error status code (i.e. 599) and %%message%% with an - * optional %%error%%. - */ - makeServerError(message?: string, error?: Error): FetchResponse; - /** - * If called within a [request.processFunc](FetchRequest-processFunc) - * call, causes the request to retry as if throttled for %%stall%% - * milliseconds. - */ - throwThrottleError(message?: string, stall?: number): never; - /** - * Get the header value for %%key%%, ignoring case. - */ - getHeader(key: string): string; - /** - * Returns true if the response has a body. - */ - hasBody(): this is (FetchResponse & { - body: Uint8Array; - }); - /** - * The request made for this response. - */ - get request(): null | FetchRequest; - /** - * Returns true if this response was a success statusCode. - */ - ok(): boolean; - /** - * Throws a ``SERVER_ERROR`` if this response is not ok. - */ - assertOk(): void; -} -//# sourceMappingURL=fetch.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/fetch.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/fetch.d.ts.map deleted file mode 100644 index cfc7bf06..00000000 --- a/tools/mnemonic-test/node_modules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Aa,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,GAAG,UAAU,EAAE,OAAO,CAAC,EAAE,YAAY;IAajJ;;;;OAIG;IACH,eAAe,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,aAAa;IAc/D;;;;OAIG;IACH,kBAAkB,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK;IAc3D;;OAEG;IACH,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAI9B;;OAEG;IACH,OAAO,IAAI,IAAI,IAAI,CAAC,aAAa,GAAG;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,CAAC;IAIzD;;OAEG;IACH,IAAI,OAAO,IAAI,IAAI,GAAG,YAAY,CAA0B;IAE5D;;OAEG;IACH,EAAE,IAAI,OAAO;IAIb;;OAEG;IACH,QAAQ,IAAI,IAAI;CAsBnB"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/fetch.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/fetch.js deleted file mode 100644 index b961c3a1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/fetch.js +++ /dev/null @@ -1,858 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FetchResponse = exports.FetchRequest = exports.FetchCancelSignal = void 0; -/** - * Fetching content from the web is environment-specific, so Ethers - * provides an abstraction that each environment can implement to provide - * this service. - * - * On [Node.js](link-node), the ``http`` and ``https`` libs are used to - * create a request object, register event listeners and process data - * and populate the [[FetchResponse]]. - * - * In a browser, the [DOM fetch](link-js-fetch) is used, and the resulting - * ``Promise`` is waited on to retrieve the payload. - * - * The [[FetchRequest]] is responsible for handling many common situations, - * such as redirects, server throttling, authentication, etc. - * - * It also handles common gateways, such as IPFS and data URIs. - * - * @_section api/utils/fetching:Fetching Web Content [about-fetch] - */ -const base64_js_1 = require("./base64.js"); -const data_js_1 = require("./data.js"); -const errors_js_1 = require("./errors.js"); -const properties_js_1 = require("./properties.js"); -const utf8_js_1 = require("./utf8.js"); -const geturl_js_1 = require("./geturl.js"); -const MAX_ATTEMPTS = 12; -const SLOT_INTERVAL = 250; -// The global FetchGetUrlFunc implementation. -let defaultGetUrlFunc = (0, geturl_js_1.createGetUrl)(); -const reData = new RegExp("^data:([^;:]*)?(;base64)?,(.*)$", "i"); -const reIpfs = new RegExp("^ipfs:/\/(ipfs/)?(.*)$", "i"); -// If locked, new Gateways cannot be added -let locked = false; -// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs -async function dataGatewayFunc(url, signal) { - try { - const match = url.match(reData); - if (!match) { - throw new Error("invalid data"); - } - return new FetchResponse(200, "OK", { - "content-type": (match[1] || "text/plain"), - }, (match[2] ? (0, base64_js_1.decodeBase64)(match[3]) : unpercent(match[3]))); - } - catch (error) { - return new FetchResponse(599, "BAD REQUEST (invalid data: URI)", {}, null, new FetchRequest(url)); - } -} -/** - * Returns a [[FetchGatewayFunc]] for fetching content from a standard - * IPFS gateway hosted at %%baseUrl%%. - */ -function getIpfsGatewayFunc(baseUrl) { - async function gatewayIpfs(url, signal) { - try { - const match = url.match(reIpfs); - if (!match) { - throw new Error("invalid link"); - } - return new FetchRequest(`${baseUrl}${match[2]}`); - } - catch (error) { - return new FetchResponse(599, "BAD REQUEST (invalid IPFS URI)", {}, null, new FetchRequest(url)); - } - } - return gatewayIpfs; -} -const Gateways = { - "data": dataGatewayFunc, - "ipfs": getIpfsGatewayFunc("https:/\/gateway.ipfs.io/ipfs/") -}; -const fetchSignals = new WeakMap(); -/** - * @_ignore - */ -class FetchCancelSignal { - #listeners; - #cancelled; - constructor(request) { - this.#listeners = []; - this.#cancelled = false; - fetchSignals.set(request, () => { - if (this.#cancelled) { - return; - } - this.#cancelled = true; - for (const listener of this.#listeners) { - setTimeout(() => { listener(); }, 0); - } - this.#listeners = []; - }); - } - addListener(listener) { - (0, errors_js_1.assert)(!this.#cancelled, "singal already cancelled", "UNSUPPORTED_OPERATION", { - operation: "fetchCancelSignal.addCancelListener" - }); - this.#listeners.push(listener); - } - get cancelled() { return this.#cancelled; } - checkSignal() { - (0, errors_js_1.assert)(!this.cancelled, "cancelled", "CANCELLED", {}); - } -} -exports.FetchCancelSignal = FetchCancelSignal; -// Check the signal, throwing if it is cancelled -function checkSignal(signal) { - if (signal == null) { - throw new Error("missing signal; should not happen"); - } - signal.checkSignal(); - return signal; -} -/** - * Represents a request for a resource using a URI. - * - * By default, the supported schemes are ``HTTP``, ``HTTPS``, ``data:``, - * and ``IPFS:``. - * - * Additional schemes can be added globally using [[registerGateway]]. - * - * @example: - * req = new FetchRequest("https://www.ricmoo.com") - * resp = await req.send() - * resp.body.length - * //_result: - */ -class FetchRequest { - #allowInsecure; - #gzip; - #headers; - #method; - #timeout; - #url; - #body; - #bodyType; - #creds; - // Hooks - #preflight; - #process; - #retry; - #signal; - #throttle; - #getUrlFunc; - /** - * The fetch URL to request. - */ - get url() { return this.#url; } - set url(url) { - this.#url = String(url); - } - /** - * The fetch body, if any, to send as the request body. //(default: null)// - * - * When setting a body, the intrinsic ``Content-Type`` is automatically - * set and will be used if **not overridden** by setting a custom - * header. - * - * If %%body%% is null, the body is cleared (along with the - * intrinsic ``Content-Type``). - * - * If %%body%% is a string, the intrinsic ``Content-Type`` is set to - * ``text/plain``. - * - * If %%body%% is a Uint8Array, the intrinsic ``Content-Type`` is set to - * ``application/octet-stream``. - * - * If %%body%% is any other object, the intrinsic ``Content-Type`` is - * set to ``application/json``. - */ - get body() { - if (this.#body == null) { - return null; - } - return new Uint8Array(this.#body); - } - set body(body) { - if (body == null) { - this.#body = undefined; - this.#bodyType = undefined; - } - else if (typeof (body) === "string") { - this.#body = (0, utf8_js_1.toUtf8Bytes)(body); - this.#bodyType = "text/plain"; - } - else if (body instanceof Uint8Array) { - this.#body = body; - this.#bodyType = "application/octet-stream"; - } - else if (typeof (body) === "object") { - this.#body = (0, utf8_js_1.toUtf8Bytes)(JSON.stringify(body)); - this.#bodyType = "application/json"; - } - else { - throw new Error("invalid body"); - } - } - /** - * Returns true if the request has a body. - */ - hasBody() { - return (this.#body != null); - } - /** - * The HTTP method to use when requesting the URI. If no method - * has been explicitly set, then ``GET`` is used if the body is - * null and ``POST`` otherwise. - */ - get method() { - if (this.#method) { - return this.#method; - } - if (this.hasBody()) { - return "POST"; - } - return "GET"; - } - set method(method) { - if (method == null) { - method = ""; - } - this.#method = String(method).toUpperCase(); - } - /** - * The headers that will be used when requesting the URI. All - * keys are lower-case. - * - * This object is a copy, so any changes will **NOT** be reflected - * in the ``FetchRequest``. - * - * To set a header entry, use the ``setHeader`` method. - */ - get headers() { - const headers = Object.assign({}, this.#headers); - if (this.#creds) { - headers["authorization"] = `Basic ${(0, base64_js_1.encodeBase64)((0, utf8_js_1.toUtf8Bytes)(this.#creds))}`; - } - ; - if (this.allowGzip) { - headers["accept-encoding"] = "gzip"; - } - if (headers["content-type"] == null && this.#bodyType) { - headers["content-type"] = this.#bodyType; - } - if (this.body) { - headers["content-length"] = String(this.body.length); - } - return headers; - } - /** - * Get the header for %%key%%, ignoring case. - */ - getHeader(key) { - return this.headers[key.toLowerCase()]; - } - /** - * Set the header for %%key%% to %%value%%. All values are coerced - * to a string. - */ - setHeader(key, value) { - this.#headers[String(key).toLowerCase()] = String(value); - } - /** - * Clear all headers, resetting all intrinsic headers. - */ - clearHeaders() { - this.#headers = {}; - } - [Symbol.iterator]() { - const headers = this.headers; - const keys = Object.keys(headers); - let index = 0; - return { - next: () => { - if (index < keys.length) { - const key = keys[index++]; - return { - value: [key, headers[key]], done: false - }; - } - return { value: undefined, done: true }; - } - }; - } - /** - * The value that will be sent for the ``Authorization`` header. - * - * To set the credentials, use the ``setCredentials`` method. - */ - get credentials() { - return this.#creds || null; - } - /** - * Sets an ``Authorization`` for %%username%% with %%password%%. - */ - setCredentials(username, password) { - (0, errors_js_1.assertArgument)(!username.match(/:/), "invalid basic authentication username", "username", "[REDACTED]"); - this.#creds = `${username}:${password}`; - } - /** - * Enable and request gzip-encoded responses. The response will - * automatically be decompressed. //(default: true)// - */ - get allowGzip() { - return this.#gzip; - } - set allowGzip(value) { - this.#gzip = !!value; - } - /** - * Allow ``Authentication`` credentials to be sent over insecure - * channels. //(default: false)// - */ - get allowInsecureAuthentication() { - return !!this.#allowInsecure; - } - set allowInsecureAuthentication(value) { - this.#allowInsecure = !!value; - } - /** - * The timeout (in milliseconds) to wait for a complete response. - * //(default: 5 minutes)// - */ - get timeout() { return this.#timeout; } - set timeout(timeout) { - (0, errors_js_1.assertArgument)(timeout >= 0, "timeout must be non-zero", "timeout", timeout); - this.#timeout = timeout; - } - /** - * This function is called prior to each request, for example - * during a redirection or retry in case of server throttling. - * - * This offers an opportunity to populate headers or update - * content before sending a request. - */ - get preflightFunc() { - return this.#preflight || null; - } - set preflightFunc(preflight) { - this.#preflight = preflight; - } - /** - * This function is called after each response, offering an - * opportunity to provide client-level throttling or updating - * response data. - * - * Any error thrown in this causes the ``send()`` to throw. - * - * To schedule a retry attempt (assuming the maximum retry limit - * has not been reached), use [[response.throwThrottleError]]. - */ - get processFunc() { - return this.#process || null; - } - set processFunc(process) { - this.#process = process; - } - /** - * This function is called on each retry attempt. - */ - get retryFunc() { - return this.#retry || null; - } - set retryFunc(retry) { - this.#retry = retry; - } - /** - * This function is called to fetch content from HTTP and - * HTTPS URLs and is platform specific (e.g. nodejs vs - * browsers). - * - * This is by default the currently registered global getUrl - * function, which can be changed using [[registerGetUrl]]. - * If this has been set, setting is to ``null`` will cause - * this FetchRequest (and any future clones) to revert back to - * using the currently registered global getUrl function. - * - * Setting this is generally not necessary, but may be useful - * for developers that wish to intercept requests or to - * configurege a proxy or other agent. - */ - get getUrlFunc() { - return this.#getUrlFunc || defaultGetUrlFunc; - } - set getUrlFunc(value) { - this.#getUrlFunc = value; - } - /** - * Create a new FetchRequest instance with default values. - * - * Once created, each property may be set before issuing a - * ``.send()`` to make the request. - */ - constructor(url) { - this.#url = String(url); - this.#allowInsecure = false; - this.#gzip = true; - this.#headers = {}; - this.#method = ""; - this.#timeout = 300000; - this.#throttle = { - slotInterval: SLOT_INTERVAL, - maxAttempts: MAX_ATTEMPTS - }; - this.#getUrlFunc = null; - } - toString() { - return ``; - } - /** - * Update the throttle parameters used to determine maximum - * attempts and exponential-backoff properties. - */ - setThrottleParams(params) { - if (params.slotInterval != null) { - this.#throttle.slotInterval = params.slotInterval; - } - if (params.maxAttempts != null) { - this.#throttle.maxAttempts = params.maxAttempts; - } - } - async #send(attempt, expires, delay, _request, _response) { - if (attempt >= this.#throttle.maxAttempts) { - return _response.makeServerError("exceeded maximum retry limit"); - } - (0, errors_js_1.assert)(getTime() <= expires, "timeout", "TIMEOUT", { - operation: "request.send", reason: "timeout", request: _request - }); - if (delay > 0) { - await wait(delay); - } - let req = this.clone(); - const scheme = (req.url.split(":")[0] || "").toLowerCase(); - // Process any Gateways - if (scheme in Gateways) { - const result = await Gateways[scheme](req.url, checkSignal(_request.#signal)); - if (result instanceof FetchResponse) { - let response = result; - if (this.processFunc) { - checkSignal(_request.#signal); - try { - response = await this.processFunc(req, response); - } - catch (error) { - // Something went wrong during processing; throw a 5xx server error - if (error.throttle == null || typeof (error.stall) !== "number") { - response.makeServerError("error in post-processing function", error).assertOk(); - } - // Ignore throttling - } - } - return response; - } - req = result; - } - // We have a preflight function; update the request - if (this.preflightFunc) { - req = await this.preflightFunc(req); - } - const resp = await this.getUrlFunc(req, checkSignal(_request.#signal)); - let response = new FetchResponse(resp.statusCode, resp.statusMessage, resp.headers, resp.body, _request); - if (response.statusCode === 301 || response.statusCode === 302) { - // Redirect - try { - const location = response.headers.location || ""; - return req.redirect(location).#send(attempt + 1, expires, 0, _request, response); - } - catch (error) { } - // Things won't get any better on another attempt; abort - return response; - } - else if (response.statusCode === 429) { - // Throttle - if (this.retryFunc == null || (await this.retryFunc(req, response, attempt))) { - const retryAfter = response.headers["retry-after"]; - let delay = this.#throttle.slotInterval * Math.trunc(Math.random() * Math.pow(2, attempt)); - if (typeof (retryAfter) === "string" && retryAfter.match(/^[1-9][0-9]*$/)) { - delay = parseInt(retryAfter); - } - return req.clone().#send(attempt + 1, expires, delay, _request, response); - } - } - if (this.processFunc) { - checkSignal(_request.#signal); - try { - response = await this.processFunc(req, response); - } - catch (error) { - // Something went wrong during processing; throw a 5xx server error - if (error.throttle == null || typeof (error.stall) !== "number") { - response.makeServerError("error in post-processing function", error).assertOk(); - } - // Throttle - let delay = this.#throttle.slotInterval * Math.trunc(Math.random() * Math.pow(2, attempt)); - ; - if (error.stall >= 0) { - delay = error.stall; - } - return req.clone().#send(attempt + 1, expires, delay, _request, response); - } - } - return response; - } - /** - * Resolves to the response by sending the request. - */ - send() { - (0, errors_js_1.assert)(this.#signal == null, "request already sent", "UNSUPPORTED_OPERATION", { operation: "fetchRequest.send" }); - this.#signal = new FetchCancelSignal(this); - return this.#send(0, getTime() + this.timeout, 0, this, new FetchResponse(0, "", {}, null, this)); - } - /** - * Cancels the inflight response, causing a ``CANCELLED`` - * error to be rejected from the [[send]]. - */ - cancel() { - (0, errors_js_1.assert)(this.#signal != null, "request has not been sent", "UNSUPPORTED_OPERATION", { operation: "fetchRequest.cancel" }); - const signal = fetchSignals.get(this); - if (!signal) { - throw new Error("missing signal; should not happen"); - } - signal(); - } - /** - * Returns a new [[FetchRequest]] that represents the redirection - * to %%location%%. - */ - redirect(location) { - // Redirection; for now we only support absolute locations - const current = this.url.split(":")[0].toLowerCase(); - const target = location.split(":")[0].toLowerCase(); - // Don't allow redirecting: - // - non-GET requests - // - downgrading the security (e.g. https => http) - // - to non-HTTP (or non-HTTPS) protocols [this could be relaxed?] - (0, errors_js_1.assert)(this.method === "GET" && (current !== "https" || target !== "http") && location.match(/^https?:/), `unsupported redirect`, "UNSUPPORTED_OPERATION", { - operation: `redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(location)})` - }); - // Create a copy of this request, with a new URL - const req = new FetchRequest(location); - req.method = "GET"; - req.allowGzip = this.allowGzip; - req.timeout = this.timeout; - req.#headers = Object.assign({}, this.#headers); - if (this.#body) { - req.#body = new Uint8Array(this.#body); - } - req.#bodyType = this.#bodyType; - // Do not forward credentials unless on the same domain; only absolute - //req.allowInsecure = false; - // paths are currently supported; may want a way to specify to forward? - //setStore(req.#props, "creds", getStore(this.#pros, "creds")); - return req; - } - /** - * Create a new copy of this request. - */ - clone() { - const clone = new FetchRequest(this.url); - // Preserve "default method" (i.e. null) - clone.#method = this.#method; - // Preserve "default body" with type, copying the Uint8Array is present - if (this.#body) { - clone.#body = this.#body; - } - clone.#bodyType = this.#bodyType; - // Preserve "default headers" - clone.#headers = Object.assign({}, this.#headers); - // Credentials is readonly, so we copy internally - clone.#creds = this.#creds; - if (this.allowGzip) { - clone.allowGzip = true; - } - clone.timeout = this.timeout; - if (this.allowInsecureAuthentication) { - clone.allowInsecureAuthentication = true; - } - clone.#preflight = this.#preflight; - clone.#process = this.#process; - clone.#retry = this.#retry; - clone.#throttle = Object.assign({}, this.#throttle); - clone.#getUrlFunc = this.#getUrlFunc; - return clone; - } - /** - * Locks all static configuration for gateways and FetchGetUrlFunc - * registration. - */ - static lockConfig() { - locked = true; - } - /** - * Get the current Gateway function for %%scheme%%. - */ - static getGateway(scheme) { - return Gateways[scheme.toLowerCase()] || null; - } - /** - * Use the %%func%% when fetching URIs using %%scheme%%. - * - * This method affects all requests globally. - * - * If [[lockConfig]] has been called, no change is made and this - * throws. - */ - static registerGateway(scheme, func) { - scheme = scheme.toLowerCase(); - if (scheme === "http" || scheme === "https") { - throw new Error(`cannot intercept ${scheme}; use registerGetUrl`); - } - if (locked) { - throw new Error("gateways locked"); - } - Gateways[scheme] = func; - } - /** - * Use %%getUrl%% when fetching URIs over HTTP and HTTPS requests. - * - * This method affects all requests globally. - * - * If [[lockConfig]] has been called, no change is made and this - * throws. - */ - static registerGetUrl(getUrl) { - if (locked) { - throw new Error("gateways locked"); - } - defaultGetUrlFunc = getUrl; - } - /** - * Creates a getUrl function that fetches content from HTTP and - * HTTPS URLs. - * - * The available %%options%% are dependent on the platform - * implementation of the default getUrl function. - * - * This is not generally something that is needed, but is useful - * when trying to customize simple behaviour when fetching HTTP - * content. - */ - static createGetUrlFunc(options) { - return (0, geturl_js_1.createGetUrl)(options); - } - /** - * Creates a function that can "fetch" data URIs. - * - * Note that this is automatically done internally to support - * data URIs, so it is not necessary to register it. - * - * This is not generally something that is needed, but may - * be useful in a wrapper to perfom custom data URI functionality. - */ - static createDataGateway() { - return dataGatewayFunc; - } - /** - * Creates a function that will fetch IPFS (unvalidated) from - * a custom gateway baseUrl. - * - * The default IPFS gateway used internally is - * ``"https:/\/gateway.ipfs.io/ipfs/"``. - */ - static createIpfsGatewayFunc(baseUrl) { - return getIpfsGatewayFunc(baseUrl); - } -} -exports.FetchRequest = FetchRequest; -; -/** - * The response for a FetchRequest. - */ -class FetchResponse { - #statusCode; - #statusMessage; - #headers; - #body; - #request; - #error; - toString() { - return ``; - } - /** - * The response status code. - */ - get statusCode() { return this.#statusCode; } - /** - * The response status message. - */ - get statusMessage() { return this.#statusMessage; } - /** - * The response headers. All keys are lower-case. - */ - get headers() { return Object.assign({}, this.#headers); } - /** - * The response body, or ``null`` if there was no body. - */ - get body() { - return (this.#body == null) ? null : new Uint8Array(this.#body); - } - /** - * The response body as a UTF-8 encoded string, or the empty - * string (i.e. ``""``) if there was no body. - * - * An error is thrown if the body is invalid UTF-8 data. - */ - get bodyText() { - try { - return (this.#body == null) ? "" : (0, utf8_js_1.toUtf8String)(this.#body); - } - catch (error) { - (0, errors_js_1.assert)(false, "response body is not valid UTF-8 data", "UNSUPPORTED_OPERATION", { - operation: "bodyText", info: { response: this } - }); - } - } - /** - * The response body, decoded as JSON. - * - * An error is thrown if the body is invalid JSON-encoded data - * or if there was no body. - */ - get bodyJson() { - try { - return JSON.parse(this.bodyText); - } - catch (error) { - (0, errors_js_1.assert)(false, "response body is not valid JSON", "UNSUPPORTED_OPERATION", { - operation: "bodyJson", info: { response: this } - }); - } - } - [Symbol.iterator]() { - const headers = this.headers; - const keys = Object.keys(headers); - let index = 0; - return { - next: () => { - if (index < keys.length) { - const key = keys[index++]; - return { - value: [key, headers[key]], done: false - }; - } - return { value: undefined, done: true }; - } - }; - } - constructor(statusCode, statusMessage, headers, body, request) { - this.#statusCode = statusCode; - this.#statusMessage = statusMessage; - this.#headers = Object.keys(headers).reduce((accum, k) => { - accum[k.toLowerCase()] = String(headers[k]); - return accum; - }, {}); - this.#body = ((body == null) ? null : new Uint8Array(body)); - this.#request = (request || null); - this.#error = { message: "" }; - } - /** - * Return a Response with matching headers and body, but with - * an error status code (i.e. 599) and %%message%% with an - * optional %%error%%. - */ - makeServerError(message, error) { - let statusMessage; - if (!message) { - message = `${this.statusCode} ${this.statusMessage}`; - statusMessage = `CLIENT ESCALATED SERVER ERROR (${message})`; - } - else { - statusMessage = `CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${message})`; - } - const response = new FetchResponse(599, statusMessage, this.headers, this.body, this.#request || undefined); - response.#error = { message, error }; - return response; - } - /** - * If called within a [request.processFunc](FetchRequest-processFunc) - * call, causes the request to retry as if throttled for %%stall%% - * milliseconds. - */ - throwThrottleError(message, stall) { - if (stall == null) { - stall = -1; - } - else { - (0, errors_js_1.assertArgument)(Number.isInteger(stall) && stall >= 0, "invalid stall timeout", "stall", stall); - } - const error = new Error(message || "throttling requests"); - (0, properties_js_1.defineProperties)(error, { stall, throttle: true }); - throw error; - } - /** - * Get the header value for %%key%%, ignoring case. - */ - getHeader(key) { - return this.headers[key.toLowerCase()]; - } - /** - * Returns true if the response has a body. - */ - hasBody() { - return (this.#body != null); - } - /** - * The request made for this response. - */ - get request() { return this.#request; } - /** - * Returns true if this response was a success statusCode. - */ - ok() { - return (this.#error.message === "" && this.statusCode >= 200 && this.statusCode < 300); - } - /** - * Throws a ``SERVER_ERROR`` if this response is not ok. - */ - assertOk() { - if (this.ok()) { - return; - } - let { message, error } = this.#error; - if (message === "") { - message = `server response ${this.statusCode} ${this.statusMessage}`; - } - let requestUrl = null; - if (this.request) { - requestUrl = this.request.url; - } - let responseBody = null; - try { - if (this.#body) { - responseBody = (0, utf8_js_1.toUtf8String)(this.#body); - } - } - catch (e) { } - (0, errors_js_1.assert)(false, message, "SERVER_ERROR", { - request: (this.request || "unknown request"), response: this, error, - info: { - requestUrl, responseBody, - responseStatus: `${this.statusCode} ${this.statusMessage}` - } - }); - } -} -exports.FetchResponse = FetchResponse; -function getTime() { return (new Date()).getTime(); } -function unpercent(value) { - return (0, utf8_js_1.toUtf8Bytes)(value.replace(/%([0-9a-f][0-9a-f])/gi, (all, code) => { - return String.fromCharCode(parseInt(code, 16)); - })); -} -function wait(delay) { - return new Promise((resolve) => setTimeout(resolve, delay)); -} -//# sourceMappingURL=fetch.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/fetch.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/fetch.js.map deleted file mode 100644 index eaf87061..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/fetch.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../src.ts/utils/fetch.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,2CAAyD;AACzD,uCAAoC;AACpC,2CAAqD;AACrD,mDAAmD;AACnD,uCAAsD;AAEtD,2CAA2C;AAkD3C,MAAM,YAAY,GAAG,EAAE,CAAC;AACxB,MAAM,aAAa,GAAG,GAAG,CAAC;AAE1B,6CAA6C;AAC7C,IAAI,iBAAiB,GAAoB,IAAA,wBAAY,GAAE,CAAC;AAExD,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,iCAAiC,EAAE,GAAG,CAAC,CAAC;A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AI,YAAY,GAAkB,IAAI,CAAC;QACvC,IAAI;YACA,IAAI,IAAI,CAAC,KAAK,EAAE;gBAAE,YAAY,GAAG,IAAA,sBAAY,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aAAE;SAC/D;QAAC,OAAO,CAAC,EAAE,GAAG;QAEf,IAAA,kBAAM,EAAC,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE;YACnC,OAAO,EAAE,CAAC,IAAI,CAAC,OAAO,IAAI,iBAAiB,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK;YACnE,IAAI,EAAE;gBACF,UAAU,EAAE,YAAY;gBACxB,cAAc,EAAE,GAAI,IAAI,CAAC,UAAW,IAAK,IAAI,CAAC,aAAc,EAAE;aAAE;SACvE,CAAC,CAAC;IACP,CAAC;CACJ;AA1LD,sCA0LC;AAGD,SAAS,OAAO,KAAa,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;AAE7D,SAAS,SAAS,CAAC,KAAa;IAC5B,OAAO,IAAA,qBAAW,EAAC,KAAK,CAAC,OAAO,CAAC,uBAAuB,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;QACpE,OAAO,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC,CAAC;AACR,CAAC;AAED,SAAS,IAAI,CAAC,KAAa;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;AAChE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/fixednumber.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/fixednumber.d.ts deleted file mode 100644 index 20c8b837..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/fixednumber.d.ts +++ /dev/null @@ -1,252 +0,0 @@ -import type { BigNumberish, BytesLike, Numeric } from "./index.js"; -/** - * A description of a fixed-point arithmetic field. - * - * When specifying the fixed format, the values override the default of - * a ``fixed128x18``, which implies a signed 128-bit value with 18 - * decimals of precision. - * - * The alias ``fixed`` and ``ufixed`` can be used for ``fixed128x18`` and - * ``ufixed128x18`` respectively. - * - * When a fixed format string begins with a ``u``, it indicates the field - * is unsigned, so any negative values will overflow. The first number - * indicates the bit-width and the second number indicates the decimal - * precision. - * - * When a ``number`` is used for a fixed format, it indicates the number - * of decimal places, and the default width and signed-ness will be used. - * - * The bit-width must be byte aligned and the decimals can be at most 80. - */ -export type FixedFormat = number | string | { - signed?: boolean; - width?: number; - decimals?: number; -}; -/** - * A FixedNumber represents a value over its [[FixedFormat]] - * arithmetic field. - * - * A FixedNumber can be used to perform math, losslessly, on - * values which have decmial places. - * - * A FixedNumber has a fixed bit-width to store values in, and stores all - * values internally by multiplying the value by 10 raised to the power of - * %%decimals%%. - * - * If operations are performed that cause a value to grow too high (close to - * positive infinity) or too low (close to negative infinity), the value - * is said to //overflow//. - * - * For example, an 8-bit signed value, with 0 decimals may only be within - * the range ``-128`` to ``127``; so ``-128 - 1`` will overflow and become - * ``127``. Likewise, ``127 + 1`` will overflow and become ``-127``. - * - * Many operation have a normal and //unsafe// variant. The normal variant - * will throw a [[NumericFaultError]] on any overflow, while the //unsafe// - * variant will silently allow overflow, corrupting its value value. - * - * If operations are performed that cause a value to become too small - * (close to zero), the value loses precison and is said to //underflow//. - * - * For example, a value with 1 decimal place may store a number as small - * as ``0.1``, but the value of ``0.1 / 2`` is ``0.05``, which cannot fit - * into 1 decimal place, so underflow occurs which means precision is lost - * and the value becomes ``0``. - * - * Some operations have a normal and //signalling// variant. The normal - * variant will silently ignore underflow, while the //signalling// variant - * will thow a [[NumericFaultError]] on underflow. - */ -export declare class FixedNumber { - #private; - /** - * The specific fixed-point arithmetic field for this value. - */ - readonly format: string; - /** - * This is a property so console.log shows a human-meaningful value. - * - * @private - */ - readonly _value: string; - /** - * @private - */ - constructor(guard: any, value: bigint, format: any); - /** - * If true, negative values are permitted, otherwise only - * positive values and zero are allowed. - */ - get signed(): boolean; - /** - * The number of bits available to store the value. - */ - get width(): number; - /** - * The number of decimal places in the fixed-point arithment field. - */ - get decimals(): number; - /** - * The value as an integer, based on the smallest unit the - * [[decimals]] allow. - */ - get value(): bigint; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% added - * to %%other%%, ignoring overflow. - */ - addUnsafe(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% added - * to %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - add(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%other%% subtracted - * from %%this%%, ignoring overflow. - */ - subUnsafe(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%other%% subtracted - * from %%this%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - sub(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%, ignoring overflow and underflow (precision loss). - */ - mulUnsafe(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - mul(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs or if underflow (precision loss) occurs. - */ - mulSignal(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%, ignoring underflow (precision loss). A - * [[NumericFaultError]] is thrown if overflow occurs. - */ - divUnsafe(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%, ignoring underflow (precision loss). A - * [[NumericFaultError]] is thrown if overflow occurs. - */ - div(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%. A [[NumericFaultError]] is thrown if underflow - * (precision loss) occurs. - */ - divSignal(other: FixedNumber): FixedNumber; - /** - * Returns a comparison result between %%this%% and %%other%%. - * - * This is suitable for use in sorting, where ``-1`` implies %%this%% - * is smaller, ``1`` implies %%this%% is larger and ``0`` implies - * both are equal. - */ - cmp(other: FixedNumber): number; - /** - * Returns true if %%other%% is equal to %%this%%. - */ - eq(other: FixedNumber): boolean; - /** - * Returns true if %%other%% is less than to %%this%%. - */ - lt(other: FixedNumber): boolean; - /** - * Returns true if %%other%% is less than or equal to %%this%%. - */ - lte(other: FixedNumber): boolean; - /** - * Returns true if %%other%% is greater than to %%this%%. - */ - gt(other: FixedNumber): boolean; - /** - * Returns true if %%other%% is greater than or equal to %%this%%. - */ - gte(other: FixedNumber): boolean; - /** - * Returns a new [[FixedNumber]] which is the largest **integer** - * that is less than or equal to %%this%%. - * - * The decimal component of the result will always be ``0``. - */ - floor(): FixedNumber; - /** - * Returns a new [[FixedNumber]] which is the smallest **integer** - * that is greater than or equal to %%this%%. - * - * The decimal component of the result will always be ``0``. - */ - ceiling(): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the decimal component - * rounded up on ties at %%decimals%% places. - */ - round(decimals?: number): FixedNumber; - /** - * Returns true if %%this%% is equal to ``0``. - */ - isZero(): boolean; - /** - * Returns true if %%this%% is less than ``0``. - */ - isNegative(): boolean; - /** - * Returns the string representation of %%this%%. - */ - toString(): string; - /** - * Returns a float approximation. - * - * Due to IEEE 754 precission (or lack thereof), this function - * can only return an approximation and most values will contain - * rounding errors. - */ - toUnsafeFloat(): number; - /** - * Return a new [[FixedNumber]] with the same value but has had - * its field set to %%format%%. - * - * This will throw if the value cannot fit into %%format%%. - */ - toFormat(format: FixedFormat): FixedNumber; - /** - * Creates a new [[FixedNumber]] for %%value%% divided by - * %%decimal%% places with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% (once adjusted - * for %%decimals%%) cannot fit in %%format%%, either due to overflow - * or underflow (precision loss). - */ - static fromValue(_value: BigNumberish, _decimals?: Numeric, _format?: FixedFormat): FixedNumber; - /** - * Creates a new [[FixedNumber]] for %%value%% with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% cannot fit - * in %%format%%, either due to overflow or underflow (precision loss). - */ - static fromString(_value: string, _format?: FixedFormat): FixedNumber; - /** - * Creates a new [[FixedNumber]] with the big-endian representation - * %%value%% with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% cannot fit - * in %%format%% due to overflow. - */ - static fromBytes(_value: BytesLike, _format?: FixedFormat): FixedNumber; -} -//# sourceMappingURL=fixednumber.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/fixednumber.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/fixednumber.d.ts.map deleted file mode 100644 index b34cc64f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/fixednumber.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fixednumber.d.ts","sourceRoot":"","sources":["../../src.ts/utils/fixednumber.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AA2CnE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG;IACxC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;CACpB,CAAC;AAwGF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,qBAAa,WAAW;;IAEpB;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAUzB;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IA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O;IAEhC;;OAEG;IACF,GAAG,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO;IAEjC;;;;;OAKG;IACH,KAAK,IAAI,WAAW;IAOpB;;;;;OAKG;IACH,OAAO,IAAI,WAAW;IAOtB;;;OAGG;IACH,KAAK,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW;IAkBrC;;OAEG;IACH,MAAM,IAAI,OAAO;IAEjB;;OAEG;IACH,UAAU,IAAI,OAAO;IAErB;;OAEG;IACH,QAAQ,IAAI,MAAM;IAElB;;;;;;OAMG;IACH,aAAa,IAAI,MAAM;IAEvB;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW;IAI1C;;;;;;;OAOG;IACH,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,WAAW;IAqB/F;;;;;OAKG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,WAAW;IA0BrE;;;;;;OAMG;IACH,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,WAAW;CAU1E"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/fixednumber.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/fixednumber.js deleted file mode 100644 index 6f597947..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/fixednumber.js +++ /dev/null @@ -1,530 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FixedNumber = void 0; -/** - * The **FixedNumber** class permits using values with decimal places, - * using fixed-pont math. - * - * Fixed-point math is still based on integers under-the-hood, but uses an - * internal offset to store fractional components below, and each operation - * corrects for this after each operation. - * - * @_section: api/utils/fixed-point-math:Fixed-Point Maths [about-fixed-point-math] - */ -const data_js_1 = require("./data.js"); -const errors_js_1 = require("./errors.js"); -const maths_js_1 = require("./maths.js"); -const properties_js_1 = require("./properties.js"); -const BN_N1 = BigInt(-1); -const BN_0 = BigInt(0); -const BN_1 = BigInt(1); -const BN_5 = BigInt(5); -const _guard = {}; -// Constant to pull zeros from for multipliers -let Zeros = "0000"; -while (Zeros.length < 80) { - Zeros += Zeros; -} -// Returns a string "1" followed by decimal "0"s -function getTens(decimals) { - let result = Zeros; - while (result.length < decimals) { - result += result; - } - return BigInt("1" + result.substring(0, decimals)); -} -function checkValue(val, format, safeOp) { - const width = BigInt(format.width); - if (format.signed) { - const limit = (BN_1 << (width - BN_1)); - (0, errors_js_1.assert)(safeOp == null || (val >= -limit && val < limit), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - if (val > BN_0) { - val = (0, maths_js_1.fromTwos)((0, maths_js_1.mask)(val, width), width); - } - else { - val = -(0, maths_js_1.fromTwos)((0, maths_js_1.mask)(-val, width), width); - } - } - else { - const limit = (BN_1 << width); - (0, errors_js_1.assert)(safeOp == null || (val >= 0 && val < limit), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - val = (((val % limit) + limit) % limit) & (limit - BN_1); - } - return val; -} -function getFormat(value) { - if (typeof (value) === "number") { - value = `fixed128x${value}`; - } - let signed = true; - let width = 128; - let decimals = 18; - if (typeof (value) === "string") { - // Parse the format string - if (value === "fixed") { - // defaults... - } - else if (value === "ufixed") { - signed = false; - } - else { - const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/); - (0, errors_js_1.assertArgument)(match, "invalid fixed format", "format", value); - signed = (match[1] !== "u"); - width = parseInt(match[2]); - decimals = parseInt(match[3]); - } - } - else if (value) { - // Extract the values from the object - const v = value; - const check = (key, type, defaultValue) => { - if (v[key] == null) { - return defaultValue; - } - (0, errors_js_1.assertArgument)(typeof (v[key]) === type, "invalid fixed format (" + key + " not " + type + ")", "format." + key, v[key]); - return v[key]; - }; - signed = check("signed", "boolean", signed); - width = check("width", "number", width); - decimals = check("decimals", "number", decimals); - } - (0, errors_js_1.assertArgument)((width % 8) === 0, "invalid FixedNumber width (not byte aligned)", "format.width", width); - (0, errors_js_1.assertArgument)(decimals <= 80, "invalid FixedNumber decimals (too large)", "format.decimals", decimals); - const name = (signed ? "" : "u") + "fixed" + String(width) + "x" + String(decimals); - return { signed, width, decimals, name }; -} -function toString(val, decimals) { - let negative = ""; - if (val < BN_0) { - negative = "-"; - val *= BN_N1; - } - let str = val.toString(); - // No decimal point for whole values - if (decimals === 0) { - return (negative + str); - } - // Pad out to the whole component (including a whole digit) - while (str.length <= decimals) { - str = Zeros + str; - } - // Insert the decimal point - const index = str.length - decimals; - str = str.substring(0, index) + "." + str.substring(index); - // Trim the whole component (leaving at least one 0) - while (str[0] === "0" && str[1] !== ".") { - str = str.substring(1); - } - // Trim the decimal component (leaving at least one 0) - while (str[str.length - 1] === "0" && str[str.length - 2] !== ".") { - str = str.substring(0, str.length - 1); - } - return (negative + str); -} -/** - * A FixedNumber represents a value over its [[FixedFormat]] - * arithmetic field. - * - * A FixedNumber can be used to perform math, losslessly, on - * values which have decmial places. - * - * A FixedNumber has a fixed bit-width to store values in, and stores all - * values internally by multiplying the value by 10 raised to the power of - * %%decimals%%. - * - * If operations are performed that cause a value to grow too high (close to - * positive infinity) or too low (close to negative infinity), the value - * is said to //overflow//. - * - * For example, an 8-bit signed value, with 0 decimals may only be within - * the range ``-128`` to ``127``; so ``-128 - 1`` will overflow and become - * ``127``. Likewise, ``127 + 1`` will overflow and become ``-127``. - * - * Many operation have a normal and //unsafe// variant. The normal variant - * will throw a [[NumericFaultError]] on any overflow, while the //unsafe// - * variant will silently allow overflow, corrupting its value value. - * - * If operations are performed that cause a value to become too small - * (close to zero), the value loses precison and is said to //underflow//. - * - * For example, a value with 1 decimal place may store a number as small - * as ``0.1``, but the value of ``0.1 / 2`` is ``0.05``, which cannot fit - * into 1 decimal place, so underflow occurs which means precision is lost - * and the value becomes ``0``. - * - * Some operations have a normal and //signalling// variant. The normal - * variant will silently ignore underflow, while the //signalling// variant - * will thow a [[NumericFaultError]] on underflow. - */ -class FixedNumber { - /** - * The specific fixed-point arithmetic field for this value. - */ - format; - #format; - // The actual value (accounting for decimals) - #val; - // A base-10 value to multiple values by to maintain the magnitude - #tens; - /** - * This is a property so console.log shows a human-meaningful value. - * - * @private - */ - _value; - // Use this when changing this file to get some typing info, - // but then switch to any to mask the internal type - //constructor(guard: any, value: bigint, format: _FixedFormat) { - /** - * @private - */ - constructor(guard, value, format) { - (0, errors_js_1.assertPrivate)(guard, _guard, "FixedNumber"); - this.#val = value; - this.#format = format; - const _value = toString(value, format.decimals); - (0, properties_js_1.defineProperties)(this, { format: format.name, _value }); - this.#tens = getTens(format.decimals); - } - /** - * If true, negative values are permitted, otherwise only - * positive values and zero are allowed. - */ - get signed() { return this.#format.signed; } - /** - * The number of bits available to store the value. - */ - get width() { return this.#format.width; } - /** - * The number of decimal places in the fixed-point arithment field. - */ - get decimals() { return this.#format.decimals; } - /** - * The value as an integer, based on the smallest unit the - * [[decimals]] allow. - */ - get value() { return this.#val; } - #checkFormat(other) { - (0, errors_js_1.assertArgument)(this.format === other.format, "incompatible format; use fixedNumber.toFormat", "other", other); - } - #checkValue(val, safeOp) { - /* - const width = BigInt(this.width); - if (this.signed) { - const limit = (BN_1 << (width - BN_1)); - assert(safeOp == null || (val >= -limit && val < limit), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - - if (val > BN_0) { - val = fromTwos(mask(val, width), width); - } else { - val = -fromTwos(mask(-val, width), width); - } - - } else { - const masked = mask(val, width); - assert(safeOp == null || (val >= 0 && val === masked), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - val = masked; - } - */ - val = checkValue(val, this.#format, safeOp); - return new FixedNumber(_guard, val, this.#format); - } - #add(o, safeOp) { - this.#checkFormat(o); - return this.#checkValue(this.#val + o.#val, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% added - * to %%other%%, ignoring overflow. - */ - addUnsafe(other) { return this.#add(other); } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% added - * to %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - add(other) { return this.#add(other, "add"); } - #sub(o, safeOp) { - this.#checkFormat(o); - return this.#checkValue(this.#val - o.#val, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%other%% subtracted - * from %%this%%, ignoring overflow. - */ - subUnsafe(other) { return this.#sub(other); } - /** - * Returns a new [[FixedNumber]] with the result of %%other%% subtracted - * from %%this%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - sub(other) { return this.#sub(other, "sub"); } - #mul(o, safeOp) { - this.#checkFormat(o); - return this.#checkValue((this.#val * o.#val) / this.#tens, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%, ignoring overflow and underflow (precision loss). - */ - mulUnsafe(other) { return this.#mul(other); } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - mul(other) { return this.#mul(other, "mul"); } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs or if underflow (precision loss) occurs. - */ - mulSignal(other) { - this.#checkFormat(other); - const value = this.#val * other.#val; - (0, errors_js_1.assert)((value % this.#tens) === BN_0, "precision lost during signalling mul", "NUMERIC_FAULT", { - operation: "mulSignal", fault: "underflow", value: this - }); - return this.#checkValue(value / this.#tens, "mulSignal"); - } - #div(o, safeOp) { - (0, errors_js_1.assert)(o.#val !== BN_0, "division by zero", "NUMERIC_FAULT", { - operation: "div", fault: "divide-by-zero", value: this - }); - this.#checkFormat(o); - return this.#checkValue((this.#val * this.#tens) / o.#val, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%, ignoring underflow (precision loss). A - * [[NumericFaultError]] is thrown if overflow occurs. - */ - divUnsafe(other) { return this.#div(other); } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%, ignoring underflow (precision loss). A - * [[NumericFaultError]] is thrown if overflow occurs. - */ - div(other) { return this.#div(other, "div"); } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%. A [[NumericFaultError]] is thrown if underflow - * (precision loss) occurs. - */ - divSignal(other) { - (0, errors_js_1.assert)(other.#val !== BN_0, "division by zero", "NUMERIC_FAULT", { - operation: "div", fault: "divide-by-zero", value: this - }); - this.#checkFormat(other); - const value = (this.#val * this.#tens); - (0, errors_js_1.assert)((value % other.#val) === BN_0, "precision lost during signalling div", "NUMERIC_FAULT", { - operation: "divSignal", fault: "underflow", value: this - }); - return this.#checkValue(value / other.#val, "divSignal"); - } - /** - * Returns a comparison result between %%this%% and %%other%%. - * - * This is suitable for use in sorting, where ``-1`` implies %%this%% - * is smaller, ``1`` implies %%this%% is larger and ``0`` implies - * both are equal. - */ - cmp(other) { - let a = this.value, b = other.value; - // Coerce a and b to the same magnitude - const delta = this.decimals - other.decimals; - if (delta > 0) { - b *= getTens(delta); - } - else if (delta < 0) { - a *= getTens(-delta); - } - // Comnpare - if (a < b) { - return -1; - } - if (a > b) { - return 1; - } - return 0; - } - /** - * Returns true if %%other%% is equal to %%this%%. - */ - eq(other) { return this.cmp(other) === 0; } - /** - * Returns true if %%other%% is less than to %%this%%. - */ - lt(other) { return this.cmp(other) < 0; } - /** - * Returns true if %%other%% is less than or equal to %%this%%. - */ - lte(other) { return this.cmp(other) <= 0; } - /** - * Returns true if %%other%% is greater than to %%this%%. - */ - gt(other) { return this.cmp(other) > 0; } - /** - * Returns true if %%other%% is greater than or equal to %%this%%. - */ - gte(other) { return this.cmp(other) >= 0; } - /** - * Returns a new [[FixedNumber]] which is the largest **integer** - * that is less than or equal to %%this%%. - * - * The decimal component of the result will always be ``0``. - */ - floor() { - let val = this.#val; - if (this.#val < BN_0) { - val -= this.#tens - BN_1; - } - val = (this.#val / this.#tens) * this.#tens; - return this.#checkValue(val, "floor"); - } - /** - * Returns a new [[FixedNumber]] which is the smallest **integer** - * that is greater than or equal to %%this%%. - * - * The decimal component of the result will always be ``0``. - */ - ceiling() { - let val = this.#val; - if (this.#val > BN_0) { - val += this.#tens - BN_1; - } - val = (this.#val / this.#tens) * this.#tens; - return this.#checkValue(val, "ceiling"); - } - /** - * Returns a new [[FixedNumber]] with the decimal component - * rounded up on ties at %%decimals%% places. - */ - round(decimals) { - if (decimals == null) { - decimals = 0; - } - // Not enough precision to not already be rounded - if (decimals >= this.decimals) { - return this; - } - const delta = this.decimals - decimals; - const bump = BN_5 * getTens(delta - 1); - let value = this.value + bump; - const tens = getTens(delta); - value = (value / tens) * tens; - checkValue(value, this.#format, "round"); - return new FixedNumber(_guard, value, this.#format); - } - /** - * Returns true if %%this%% is equal to ``0``. - */ - isZero() { return (this.#val === BN_0); } - /** - * Returns true if %%this%% is less than ``0``. - */ - isNegative() { return (this.#val < BN_0); } - /** - * Returns the string representation of %%this%%. - */ - toString() { return this._value; } - /** - * Returns a float approximation. - * - * Due to IEEE 754 precission (or lack thereof), this function - * can only return an approximation and most values will contain - * rounding errors. - */ - toUnsafeFloat() { return parseFloat(this.toString()); } - /** - * Return a new [[FixedNumber]] with the same value but has had - * its field set to %%format%%. - * - * This will throw if the value cannot fit into %%format%%. - */ - toFormat(format) { - return FixedNumber.fromString(this.toString(), format); - } - /** - * Creates a new [[FixedNumber]] for %%value%% divided by - * %%decimal%% places with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% (once adjusted - * for %%decimals%%) cannot fit in %%format%%, either due to overflow - * or underflow (precision loss). - */ - static fromValue(_value, _decimals, _format) { - const decimals = (_decimals == null) ? 0 : (0, maths_js_1.getNumber)(_decimals); - const format = getFormat(_format); - let value = (0, maths_js_1.getBigInt)(_value, "value"); - const delta = decimals - format.decimals; - if (delta > 0) { - const tens = getTens(delta); - (0, errors_js_1.assert)((value % tens) === BN_0, "value loses precision for format", "NUMERIC_FAULT", { - operation: "fromValue", fault: "underflow", value: _value - }); - value /= tens; - } - else if (delta < 0) { - value *= getTens(-delta); - } - checkValue(value, format, "fromValue"); - return new FixedNumber(_guard, value, format); - } - /** - * Creates a new [[FixedNumber]] for %%value%% with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% cannot fit - * in %%format%%, either due to overflow or underflow (precision loss). - */ - static fromString(_value, _format) { - const match = _value.match(/^(-?)([0-9]*)\.?([0-9]*)$/); - (0, errors_js_1.assertArgument)(match && (match[2].length + match[3].length) > 0, "invalid FixedNumber string value", "value", _value); - const format = getFormat(_format); - let whole = (match[2] || "0"), decimal = (match[3] || ""); - // Pad out the decimals - while (decimal.length < format.decimals) { - decimal += Zeros; - } - // Check precision is safe - (0, errors_js_1.assert)(decimal.substring(format.decimals).match(/^0*$/), "too many decimals for format", "NUMERIC_FAULT", { - operation: "fromString", fault: "underflow", value: _value - }); - // Remove extra padding - decimal = decimal.substring(0, format.decimals); - const value = BigInt(match[1] + whole + decimal); - checkValue(value, format, "fromString"); - return new FixedNumber(_guard, value, format); - } - /** - * Creates a new [[FixedNumber]] with the big-endian representation - * %%value%% with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% cannot fit - * in %%format%% due to overflow. - */ - static fromBytes(_value, _format) { - let value = (0, maths_js_1.toBigInt)((0, data_js_1.getBytes)(_value, "value")); - const format = getFormat(_format); - if (format.signed) { - value = (0, maths_js_1.fromTwos)(value, format.width); - } - checkValue(value, format, "fromBytes"); - return new FixedNumber(_guard, value, format); - } -} -exports.FixedNumber = FixedNumber; -//const f1 = FixedNumber.fromString("12.56", "fixed16x2"); -//const f2 = FixedNumber.fromString("0.3", "fixed16x2"); -//console.log(f1.divSignal(f2)); -//const BUMP = FixedNumber.from("0.5"); -//# sourceMappingURL=fixednumber.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/fixednumber.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/fixednumber.js.map deleted file mode 100644 index c2397d42..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/fixednumber.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fixednumber.js","sourceRoot":"","sources":["../../src.ts/utils/fixednumber.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;GASG;AACH,uCAAqC;AACrC,2CAAoE;AACpE,yCAEoB;AACpB,mDAAmD;AAInD,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACzB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAEvB,MAAM,MAAM,GAAG,EAAG,CAAC;AAGnB,8CAA8C;AAC9C,IAAI,KAAK,GAAG,MAAM,CAAC;AACnB,OAAO,KAAK,CAAC,MAAM,GAAG,EAAE,EAAE;IAAE,KAAK,IAAI,KAAK,CAAC;CAAE;AAE7C,gDAAgD;AAChD,SAAS,OAAO,CAAC,QAAgB;IAC7B,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,OAAO,MAAM,CAAC,MAAM,GAAG,QAAQ,EAAE;QAAE,MAAM,IAAI,MAAM,CAAC;KAAE;IACtD,OAAO,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC;AACvD,CAAC;AAkDD,SAAS,UAAU,CAAC,GAAW,EAAE,MAAoB,EAAE,MAAe;IAClE,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACnC,IAAI,MAAM,CAAC,MAAM,EAAE;QACf,MAAM,KAAK,GAAG,CAAC,IAAI,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,CAA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CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,8BAA8B,EAAE,eAAe,EAAE;YACtG,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM;SAC7D,CAAC,CAAC;QAEH,uBAAuB;QACvB,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;QAEhD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,OAAO,CAAC,CAAA;QAEhD,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;QAExC,OAAO,IAAI,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IAClD,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,SAAS,CAAC,MAAiB,EAAE,OAAqB;QACrD,IAAI,KAAK,GAAG,IAAA,mBAAQ,EAAC,IAAA,kBAAQ,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QAChD,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;QAElC,IAAI,MAAM,CAAC,MAAM,EAAE;YAAE,KAAK,GAAG,IAAA,mBAAQ,EAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;SAAE;QAE7D,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;QAEvC,OAAO,IAAI,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IAClD,CAAC;CACJ;AA9ZD,kCA8ZC;AAED,0DAA0D;AAC1D,wDAAwD;AACxD,gCAAgC;AAChC,uCAAuC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/geturl-browser.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/geturl-browser.d.ts deleted file mode 100644 index 9b2cbe7b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/geturl-browser.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { FetchGetUrlFunc, FetchRequest, FetchCancelSignal, GetUrlResponse } from "./fetch.js"; -export declare function createGetUrl(options?: Record): FetchGetUrlFunc; -export declare function getUrl(req: FetchRequest, _signal?: FetchCancelSignal): Promise; -//# sourceMappingURL=geturl-browser.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/geturl-browser.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/geturl-browser.d.ts.map deleted file mode 100644 index 00bd40b7..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/geturl-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"geturl-browser.d.ts","sourceRoot":"","sources":["../../src.ts/utils/geturl-browser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACR,eAAe,EAAE,YAAY,EAAE,iBAAiB,EAAE,cAAc,EACnE,MAAM,YAAY,CAAC;AAEpB,wBAAgB,YAAY,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,eAAe,CAkE3E;AAKD,wBAAsB,MAAM,CAAC,GAAG,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,CAAC,CAEpG"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/geturl-browser.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/geturl-browser.js deleted file mode 100644 index b217b21f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/geturl-browser.js +++ /dev/null @@ -1,67 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getUrl = exports.createGetUrl = void 0; -const errors_js_1 = require("./errors.js"); -function createGetUrl(options) { - async function getUrl(req, _signal) { - (0, errors_js_1.assert)(_signal == null || !_signal.cancelled, "request cancelled before sending", "CANCELLED"); - const protocol = req.url.split(":")[0].toLowerCase(); - (0, errors_js_1.assert)(protocol === "http" || protocol === "https", `unsupported protocol ${protocol}`, "UNSUPPORTED_OPERATION", { - info: { protocol }, - operation: "request" - }); - (0, errors_js_1.assert)(protocol === "https" || !req.credentials || req.allowInsecureAuthentication, "insecure authorized connections unsupported", "UNSUPPORTED_OPERATION", { - operation: "request" - }); - let error = null; - const controller = new AbortController(); - const timer = setTimeout(() => { - error = (0, errors_js_1.makeError)("request timeout", "TIMEOUT"); - controller.abort(); - }, req.timeout); - if (_signal) { - _signal.addListener(() => { - error = (0, errors_js_1.makeError)("request cancelled", "CANCELLED"); - controller.abort(); - }); - } - const init = Object.assign({}, options, { - method: req.method, - headers: new Headers(Array.from(req)), - body: req.body || undefined, - signal: controller.signal - }); - let resp; - try { - resp = await fetch(req.url, init); - } - catch (_error) { - clearTimeout(timer); - if (error) { - throw error; - } - throw _error; - } - clearTimeout(timer); - const headers = {}; - resp.headers.forEach((value, key) => { - headers[key.toLowerCase()] = value; - }); - const respBody = await resp.arrayBuffer(); - const body = (respBody == null) ? null : new Uint8Array(respBody); - return { - statusCode: resp.status, - statusMessage: resp.statusText, - headers, body - }; - } - return getUrl; -} -exports.createGetUrl = createGetUrl; -// @TODO: remove in v7; provided for backwards compat -const defaultGetUrl = createGetUrl({}); -async function getUrl(req, _signal) { - return defaultGetUrl(req, _signal); -} -exports.getUrl = getUrl; -//# sourceMappingURL=geturl-browser.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/geturl-browser.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/geturl-browser.js.map deleted file mode 100644 index a0c23b43..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/geturl-browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"getur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AAM,aAAa,GAAoB,YAAY,CAAC,EAAG,CAAC,CAAC;AAElD,KAAK,UAAU,MAAM,CAAC,GAAiB,EAAE,OAA2B;IACvE,OAAO,aAAa,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AACvC,CAAC;AAFD,wBAEC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/geturl.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/geturl.d.ts deleted file mode 100644 index 8d0d9783..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/geturl.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { FetchGetUrlFunc, FetchRequest, FetchCancelSignal, GetUrlResponse } from "./fetch.js"; -/** - * @_ignore: - */ -export declare function createGetUrl(options?: Record): FetchGetUrlFunc; -/** - * @_ignore: - */ -export declare function getUrl(req: FetchRequest, signal?: FetchCancelSignal): Promise; -//# sourceMappingURL=geturl.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/geturl.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/geturl.d.ts.map deleted file mode 100644 index 6770ee5b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/geturl.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"geturl.d.ts","sourceRoot":"","sources":["../../src.ts/utils/geturl.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACR,eAAe,EAAE,YAAY,EAAE,iBAAiB,EAAE,cAAc,EACnE,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,eAAe,CAmH3E;AAKD;;GAEG;AACH,wBAAsB,MAAM,CAAC,GAAG,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,CAAC,CAEnG"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/geturl.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/geturl.js deleted file mode 100644 index 1347f093..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/geturl.js +++ /dev/null @@ -1,127 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getUrl = exports.createGetUrl = void 0; -const tslib_1 = require("tslib"); -const http_1 = tslib_1.__importDefault(require("http")); -const https_1 = tslib_1.__importDefault(require("https")); -const zlib_1 = require("zlib"); -const errors_js_1 = require("./errors.js"); -const data_js_1 = require("./data.js"); -/** - * @_ignore: - */ -function createGetUrl(options) { - async function getUrl(req, signal) { - // Make sure we weren't cancelled before sending - (0, errors_js_1.assert)(signal == null || !signal.cancelled, "request cancelled before sending", "CANCELLED"); - const protocol = req.url.split(":")[0].toLowerCase(); - (0, errors_js_1.assert)(protocol === "http" || protocol === "https", `unsupported protocol ${protocol}`, "UNSUPPORTED_OPERATION", { - info: { protocol }, - operation: "request" - }); - (0, errors_js_1.assert)(protocol === "https" || !req.credentials || req.allowInsecureAuthentication, "insecure authorized connections unsupported", "UNSUPPORTED_OPERATION", { - operation: "request" - }); - const method = req.method; - const headers = Object.assign({}, req.headers); - const reqOptions = { method, headers }; - if (options) { - if (options.agent) { - reqOptions.agent = options.agent; - } - } - // Create a Node-specific AbortController, if available - let abort = null; - try { - abort = new AbortController(); - reqOptions.abort = abort.signal; - } - catch (e) { - console.log(e); - } - const request = ((protocol === "http") ? http_1.default : https_1.default).request(req.url, reqOptions); - request.setTimeout(req.timeout); - const body = req.body; - if (body) { - request.write(Buffer.from(body)); - } - request.end(); - return new Promise((resolve, reject) => { - if (signal) { - signal.addListener(() => { - if (abort) { - abort.abort(); - } - reject((0, errors_js_1.makeError)("request cancelled", "CANCELLED")); - }); - } - request.on("timeout", () => { - reject((0, errors_js_1.makeError)("request timeout", "TIMEOUT")); - }); - request.once("response", (resp) => { - const statusCode = resp.statusCode || 0; - const statusMessage = resp.statusMessage || ""; - const headers = Object.keys(resp.headers || {}).reduce((accum, name) => { - let value = resp.headers[name] || ""; - if (Array.isArray(value)) { - value = value.join(", "); - } - accum[name] = value; - return accum; - }, {}); - let body = null; - //resp.setEncoding("utf8"); - resp.on("data", (chunk) => { - if (signal) { - try { - signal.checkSignal(); - } - catch (error) { - return reject(error); - } - } - if (body == null) { - body = chunk; - } - else { - const newBody = new Uint8Array(body.length + chunk.length); - newBody.set(body, 0); - newBody.set(chunk, body.length); - body = newBody; - } - }); - resp.on("end", () => { - try { - if (headers["content-encoding"] === "gzip" && body) { - body = (0, data_js_1.getBytes)((0, zlib_1.gunzipSync)(body)); - } - resolve({ statusCode, statusMessage, headers, body }); - } - catch (error) { - reject((0, errors_js_1.makeError)("bad response data", "SERVER_ERROR", { - request: req, info: { response: resp, error } - })); - } - }); - resp.on("error", (error) => { - //@TODO: Should this just return nornal response with a server error? - error.response = { statusCode, statusMessage, headers, body }; - reject(error); - }); - }); - request.on("error", (error) => { reject(error); }); - }); - } - return getUrl; -} -exports.createGetUrl = createGetUrl; -// @TODO: remove in v7; provided for backwards compat -const defaultGetUrl = createGetUrl({}); -/** - * @_ignore: - */ -async function getUrl(req, signal) { - return defaultGetUrl(req, signal); -} -exports.getUrl = getUrl; -//# sourceMappingURL=geturl.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/geturl.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/geturl.js.map deleted file mode 100644 index c4bce2bc..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/geturl.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"geturl.js","sourceRoot":"","sources":["../../src.ts/utils/geturl.ts"],"names":[],"mappings":";;;;AAAA,wDAAwB;AACxB,0DAA0B;AAC1B,+BAAkC;AAElC,2CAAgD;AAChD,uCAAqC;AAMrC;;G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AAC,CAAC,CAAC;yBACrC;wBAED,OAAO,CAAC,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;qBAEzD;oBAAC,OAAO,KAAK,EAAE;wBACZ,MAAM,CAAC,IAAA,qBAAS,EAAC,mBAAmB,EAAE,cAAc,EAAE;4BAClD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE;yBAChD,CAAC,CAAC,CAAC;qBACP;gBACL,CAAC,CAAC,CAAC;gBAEH,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;oBAC3B,qEAAqE;oBAC3D,KAAM,CAAC,QAAQ,GAAG,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;oBACrE,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;YAEH,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;IACP,CAAC;IAED,OAAO,MAAM,CAAC;AAClB,CAAC;AAnHD,oCAmHC;AAED,qDAAqD;AACrD,MAAM,aAAa,GAAoB,YAAY,CAAC,EAAG,CAAC,CAAC;AAEzD;;GAEG;AACI,KAAK,UAAU,MAAM,CAAC,GAAiB,EAAE,MAA0B;IACtE,OAAO,aAAa,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;AACtC,CAAC;AAFD,wBAEC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/index.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/index.d.ts deleted file mode 100644 index b6d51e0a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/index.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * There are many simple utilities required to interact with - * Ethereum and to simplify the library, without increasing - * the library dependencies for simple functions. - * - * @_section api/utils:Utilities [about-utils] - */ -export { decodeBase58, encodeBase58 } from "./base58.js"; -export { decodeBase64, encodeBase64 } from "./base64.js"; -export { getBytes, getBytesCopy, isHexString, isBytesLike, hexlify, concat, dataLength, dataSlice, stripZerosLeft, zeroPadValue, zeroPadBytes } from "./data.js"; -export { isCallException, isError, assert, assertArgument, assertArgumentCount, assertPrivate, assertNormalize, makeError } from "./errors.js"; -export { EventPayload } from "./events.js"; -export { FetchRequest, FetchResponse, FetchCancelSignal, } from "./fetch.js"; -export { FixedNumber } from "./fixednumber.js"; -export { fromTwos, toTwos, mask, getBigInt, getNumber, getUint, toBigInt, toNumber, toBeHex, toBeArray, toQuantity } from "./maths.js"; -export { resolveProperties, defineProperties } from "./properties.js"; -export { decodeRlp } from "./rlp-decode.js"; -export { encodeRlp } from "./rlp-encode.js"; -export { formatEther, parseEther, formatUnits, parseUnits } from "./units.js"; -export { toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, } from "./utf8.js"; -export { uuidV4 } from "./uuid.js"; -export type { BytesLike } from "./data.js"; -export type { ErrorCode, EthersError, UnknownError, NotImplementedError, UnsupportedOperationError, NetworkError, ServerError, TimeoutError, BadDataError, CancelledError, BufferOverrunError, NumericFaultError, InvalidArgumentError, MissingArgumentError, UnexpectedArgumentError, CallExceptionError, InsufficientFundsError, NonceExpiredError, OffchainFaultError, ReplacementUnderpricedError, TransactionReplacedError, UnconfiguredNameError, ActionRejectedError, CallExceptionAction, CallExceptionTransaction, CodedEthersError } from "./errors.js"; -export type { EventEmitterable, Listener } from "./events.js"; -export type { GetUrlResponse, FetchPreflightFunc, FetchProcessFunc, FetchRetryFunc, FetchGatewayFunc, FetchGetUrlFunc } from "./fetch.js"; -export type { FixedFormat } from "./fixednumber.js"; -export type { BigNumberish, Numeric } from "./maths.js"; -export type { RlpStructuredData, RlpStructuredDataish } from "./rlp.js"; -export type { Utf8ErrorFunc, UnicodeNormalizationForm, Utf8ErrorReason } from "./utf8.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/index.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/index.d.ts.map deleted file mode 100644 index 4290468f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EACH,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EACxF,cAAc,EAAE,YAAY,EAAE,YAAY,EAC7C,MAAM,WAAW,CAAC;AAEnB,OAAO,EACH,eAAe,EAAE,OAAO,EACxB,MAAM,EAAE,cAAc,EAAE,mBAAmB,EAAE,aAAa,EAAE,eAAe,EAAE,SAAS,EACzF,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EACH,YAAY,EAAE,aAAa,EAAE,iBAAiB,GACjD,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EACH,QAAQ,EAAE,MAAM,EAAE,IAAI,EACtB,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EACpF,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,iBAAiB,EAAE,gBAAgB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newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/index.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/index.js deleted file mode 100644 index 333cecfe..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/index.js +++ /dev/null @@ -1,78 +0,0 @@ -"use strict"; -/** - * There are many simple utilities required to interact with - * Ethereum and to simplify the library, without increasing - * the library dependencies for simple functions. - * - * @_section api/utils:Utilities [about-utils] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.toUtf8String = exports.toUtf8CodePoints = exports.toUtf8Bytes = exports.parseUnits = exports.formatUnits = exports.parseEther = exports.formatEther = exports.encodeRlp = exports.decodeRlp = exports.defineProperties = exports.resolveProperties = exports.toQuantity = exports.toBeArray = exports.toBeHex = exports.toNumber = exports.toBigInt = exports.getUint = exports.getNumber = exports.getBigInt = exports.mask = exports.toTwos = exports.fromTwos = exports.FixedNumber = exports.FetchCancelSignal = exports.FetchResponse = exports.FetchRequest = exports.EventPayload = exports.makeError = exports.assertNormalize = exports.assertPrivate = exports.assertArgumentCount = exports.assertArgument = exports.assert = exports.isError = exports.isCallException = exports.zeroPadBytes = exports.zeroPadValue = exports.stripZerosLeft = exports.dataSlice = exports.dataLength = exports.concat = exports.hexlify = exports.isBytesLike = exports.isHexString = exports.getBytesCopy = exports.getBytes = exports.encodeBase64 = exports.decodeBase64 = exports.encodeBase58 = exports.decodeBase58 = void 0; -exports.uuidV4 = exports.Utf8ErrorFuncs = void 0; -var base58_js_1 = require("./base58.js"); -Object.defineProperty(exports, "decodeBase58", { enumerable: true, get: function () { return base58_js_1.decodeBase58; } }); -Object.defineProperty(exports, "encodeBase58", { enumerable: true, get: function () { return base58_js_1.encodeBase58; } }); -var base64_js_1 = require("./base64.js"); -Object.defineProperty(exports, "decodeBase64", { enumerable: true, get: function () { return base64_js_1.decodeBase64; } }); -Object.defineProperty(exports, "encodeBase64", { enumerable: true, get: function () { return base64_js_1.encodeBase64; } }); -var data_js_1 = require("./data.js"); -Object.defineProperty(exports, "getBytes", { enumerable: true, get: function () { return data_js_1.getBytes; } }); -Object.defineProperty(exports, "getBytesCopy", { enumerable: true, get: function () { return data_js_1.getBytesCopy; } }); -Object.defineProperty(exports, "isHexString", { enumerable: true, get: function () { return data_js_1.isHexString; } }); -Object.defineProperty(exports, "isBytesLike", { enumerable: true, get: function () { return data_js_1.isBytesLike; } }); -Object.defineProperty(exports, "hexlify", { enumerable: true, get: function () { return data_js_1.hexlify; } }); -Object.defineProperty(exports, "concat", { enumerable: true, get: function () { return data_js_1.concat; } }); -Object.defineProperty(exports, "dataLength", { enumerable: true, get: function () { return data_js_1.dataLength; } }); -Object.defineProperty(exports, "dataSlice", { enumerable: true, get: function () { return data_js_1.dataSlice; } }); -Object.defineProperty(exports, "stripZerosLeft", { enumerable: true, get: function () { return data_js_1.stripZerosLeft; } }); -Object.defineProperty(exports, "zeroPadValue", { enumerable: true, get: function () { return data_js_1.zeroPadValue; } }); -Object.defineProperty(exports, "zeroPadBytes", { enumerable: true, get: function () { return data_js_1.zeroPadBytes; } }); -var errors_js_1 = require("./errors.js"); -Object.defineProperty(exports, "isCallException", { enumerable: true, get: function () { return errors_js_1.isCallException; } }); -Object.defineProperty(exports, "isError", { enumerable: true, get: function () { return errors_js_1.isError; } }); -Object.defineProperty(exports, "assert", { enumerable: true, get: function () { return errors_js_1.assert; } }); -Object.defineProperty(exports, "assertArgument", { enumerable: true, get: function () { return errors_js_1.assertArgument; } }); -Object.defineProperty(exports, "assertArgumentCount", { enumerable: true, get: function () { return errors_js_1.assertArgumentCount; } }); -Object.defineProperty(exports, "assertPrivate", { enumerable: true, get: function () { return errors_js_1.assertPrivate; } }); -Object.defineProperty(exports, "assertNormalize", { enumerable: true, get: function () { return errors_js_1.assertNormalize; } }); -Object.defineProperty(exports, "makeError", { enumerable: true, get: function () { return errors_js_1.makeError; } }); -var events_js_1 = require("./events.js"); -Object.defineProperty(exports, "EventPayload", { enumerable: true, get: function () { return events_js_1.EventPayload; } }); -var fetch_js_1 = require("./fetch.js"); -Object.defineProperty(exports, "FetchRequest", { enumerable: true, get: function () { return fetch_js_1.FetchRequest; } }); -Object.defineProperty(exports, "FetchResponse", { enumerable: true, get: function () { return fetch_js_1.FetchResponse; } }); -Object.defineProperty(exports, "FetchCancelSignal", { enumerable: true, get: function () { return fetch_js_1.FetchCancelSignal; } }); -var fixednumber_js_1 = require("./fixednumber.js"); -Object.defineProperty(exports, "FixedNumber", { enumerable: true, get: function () { return fixednumber_js_1.FixedNumber; } }); -var maths_js_1 = require("./maths.js"); -Object.defineProperty(exports, "fromTwos", { enumerable: true, get: function () { return maths_js_1.fromTwos; } }); -Object.defineProperty(exports, "toTwos", { enumerable: true, get: function () { return maths_js_1.toTwos; } }); -Object.defineProperty(exports, "mask", { enumerable: true, get: function () { return maths_js_1.mask; } }); -Object.defineProperty(exports, "getBigInt", { enumerable: true, get: function () { return maths_js_1.getBigInt; } }); -Object.defineProperty(exports, "getNumber", { enumerable: true, get: function () { return maths_js_1.getNumber; } }); -Object.defineProperty(exports, "getUint", { enumerable: true, get: function () { return maths_js_1.getUint; } }); -Object.defineProperty(exports, "toBigInt", { enumerable: true, get: function () { return maths_js_1.toBigInt; } }); -Object.defineProperty(exports, "toNumber", { enumerable: true, get: function () { return maths_js_1.toNumber; } }); -Object.defineProperty(exports, "toBeHex", { enumerable: true, get: function () { return maths_js_1.toBeHex; } }); -Object.defineProperty(exports, "toBeArray", { enumerable: true, get: function () { return maths_js_1.toBeArray; } }); -Object.defineProperty(exports, "toQuantity", { enumerable: true, get: function () { return maths_js_1.toQuantity; } }); -var properties_js_1 = require("./properties.js"); -Object.defineProperty(exports, "resolveProperties", { enumerable: true, get: function () { return properties_js_1.resolveProperties; } }); -Object.defineProperty(exports, "defineProperties", { enumerable: true, get: function () { return properties_js_1.defineProperties; } }); -var rlp_decode_js_1 = require("./rlp-decode.js"); -Object.defineProperty(exports, "decodeRlp", { enumerable: true, get: function () { return rlp_decode_js_1.decodeRlp; } }); -var rlp_encode_js_1 = require("./rlp-encode.js"); -Object.defineProperty(exports, "encodeRlp", { enumerable: true, get: function () { return rlp_encode_js_1.encodeRlp; } }); -var units_js_1 = require("./units.js"); -Object.defineProperty(exports, "formatEther", { enumerable: true, get: function () { return units_js_1.formatEther; } }); -Object.defineProperty(exports, "parseEther", { enumerable: true, get: function () { return units_js_1.parseEther; } }); -Object.defineProperty(exports, "formatUnits", { enumerable: true, get: function () { return units_js_1.formatUnits; } }); -Object.defineProperty(exports, "parseUnits", { enumerable: true, get: function () { return units_js_1.parseUnits; } }); -var utf8_js_1 = require("./utf8.js"); -Object.defineProperty(exports, "toUtf8Bytes", { enumerable: true, get: function () { return utf8_js_1.toUtf8Bytes; } }); -Object.defineProperty(exports, "toUtf8CodePoints", { enumerable: true, get: function () { return utf8_js_1.toUtf8CodePoints; } }); -Object.defineProperty(exports, "toUtf8String", { enumerable: true, get: function () { return utf8_js_1.toUtf8String; } }); -Object.defineProperty(exports, "Utf8ErrorFuncs", { enumerable: true, get: function () { return utf8_js_1.Utf8ErrorFuncs; } }); -var uuid_js_1 = require("./uuid.js"); -Object.defineProperty(exports, "uuidV4", { enumerable: true, get: function () { return uuid_js_1.uuidV4; } }); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/index.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/index.js.map deleted file mode 100644 index ff401aab..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/utils/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,yCAAyD;AAAhD,yGAAA,YAAY,OAAA;AAAE,yGAAA,YAAY,OAAA;AAEnC,yCAAyD;AAAhD,yGAAA,YAAY,OAAA;AAAE,yGAAA,YAAY,OAAA;AAEnC,qCAGmB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A,UAAU,OAAA;AAEzD,qCAMmB;AALf,sGAAA,WAAW,OAAA;AACX,2GAAA,gBAAgB,OAAA;AAChB,uGAAA,YAAY,OAAA;AAEZ,yGAAA,cAAc,OAAA;AAGlB,qCAAmC;AAA1B,iGAAA,MAAM,OAAA"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/maths.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/maths.d.ts deleted file mode 100644 index 24889a16..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/maths.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -import type { BytesLike } from "./data.js"; -/** - * Any type that can be used where a numeric value is needed. - */ -export type Numeric = number | bigint; -/** - * Any type that can be used where a big number is needed. - */ -export type BigNumberish = string | Numeric; -/** - * Convert %%value%% from a twos-compliment representation of %%width%% - * bits to its value. - * - * If the highest bit is ``1``, the result will be negative. - */ -export declare function fromTwos(_value: BigNumberish, _width: Numeric): bigint; -/** - * Convert %%value%% to a twos-compliment representation of - * %%width%% bits. - * - * The result will always be positive. - */ -export declare function toTwos(_value: BigNumberish, _width: Numeric): bigint; -/** - * Mask %%value%% with a bitmask of %%bits%% ones. - */ -export declare function mask(_value: BigNumberish, _bits: Numeric): bigint; -/** - * Gets a BigInt from %%value%%. If it is an invalid value for - * a BigInt, then an ArgumentError will be thrown for %%name%%. - */ -export declare function getBigInt(value: BigNumberish, name?: string): bigint; -/** - * Returns %%value%% as a bigint, validating it is valid as a bigint - * value and that it is positive. - */ -export declare function getUint(value: BigNumberish, name?: string): bigint; -export declare function toBigInt(value: BigNumberish | Uint8Array): bigint; -/** - * Gets a //number// from %%value%%. If it is an invalid value for - * a //number//, then an ArgumentError will be thrown for %%name%%. - */ -export declare function getNumber(value: BigNumberish, name?: string): number; -/** - * Converts %%value%% to a number. If %%value%% is a Uint8Array, it - * is treated as Big Endian data. Throws if the value is not safe. - */ -export declare function toNumber(value: BigNumberish | Uint8Array): number; -/** - * Converts %%value%% to a Big Endian hexstring, optionally padded to - * %%width%% bytes. - */ -export declare function toBeHex(_value: BigNumberish, _width?: Numeric): string; -/** - * Converts %%value%% to a Big Endian Uint8Array. - */ -export declare function toBeArray(_value: BigNumberish, _width?: Numeric): Uint8Array; -/** - * Returns a [[HexString]] for %%value%% safe to use as a //Quantity//. - * - * A //Quantity// does not have and leading 0 values unless the value is - * the literal value `0x0`. This is most commonly used for JSSON-RPC - * numeric values. - */ -export declare function toQuantity(value: BytesLike | BigNumberish): string; -//# sourceMappingURL=maths.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/maths.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/maths.d.ts.map deleted file mode 100644 index 4f05eb1b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/maths.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"maths.d.ts","sourceRoot":"","sources":["../../src.ts/utils/maths.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAEtC;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,CAAC;AAY5C;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,CAetE;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,CAoBpE;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAIjE;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAmBpE;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAMlE;AAQD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,UAAU,GAAG,MAAM,CAWjE;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAkBpE;AAGD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,UAAU,GAAG,MAAM,CAEjE;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,CA0BtE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,UAAU,CA8B5E;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,YAAY,GAAG,MAAM,CAKlE"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/maths.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/maths.js deleted file mode 100644 index bc55ef29..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/maths.js +++ /dev/null @@ -1,245 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.toQuantity = exports.toBeArray = exports.toBeHex = exports.toNumber = exports.getNumber = exports.toBigInt = exports.getUint = exports.getBigInt = exports.mask = exports.toTwos = exports.fromTwos = void 0; -/** - * Some mathematic operations. - * - * @_subsection: api/utils:Math Helpers [about-maths] - */ -const data_js_1 = require("./data.js"); -const errors_js_1 = require("./errors.js"); -const BN_0 = BigInt(0); -const BN_1 = BigInt(1); -//const BN_Max256 = (BN_1 << BigInt(256)) - BN_1; -// IEEE 754 support 53-bits of mantissa -const maxValue = 0x1fffffffffffff; -/** - * Convert %%value%% from a twos-compliment representation of %%width%% - * bits to its value. - * - * If the highest bit is ``1``, the result will be negative. - */ -function fromTwos(_value, _width) { - const value = getUint(_value, "value"); - const width = BigInt(getNumber(_width, "width")); - (0, errors_js_1.assert)((value >> width) === BN_0, "overflow", "NUMERIC_FAULT", { - operation: "fromTwos", fault: "overflow", value: _value - }); - // Top bit set; treat as a negative value - if (value >> (width - BN_1)) { - const mask = (BN_1 << width) - BN_1; - return -(((~value) & mask) + BN_1); - } - return value; -} -exports.fromTwos = fromTwos; -/** - * Convert %%value%% to a twos-compliment representation of - * %%width%% bits. - * - * The result will always be positive. - */ -function toTwos(_value, _width) { - let value = getBigInt(_value, "value"); - const width = BigInt(getNumber(_width, "width")); - const limit = (BN_1 << (width - BN_1)); - if (value < BN_0) { - value = -value; - (0, errors_js_1.assert)(value <= limit, "too low", "NUMERIC_FAULT", { - operation: "toTwos", fault: "overflow", value: _value - }); - const mask = (BN_1 << width) - BN_1; - return ((~value) & mask) + BN_1; - } - else { - (0, errors_js_1.assert)(value < limit, "too high", "NUMERIC_FAULT", { - operation: "toTwos", fault: "overflow", value: _value - }); - } - return value; -} -exports.toTwos = toTwos; -/** - * Mask %%value%% with a bitmask of %%bits%% ones. - */ -function mask(_value, _bits) { - const value = getUint(_value, "value"); - const bits = BigInt(getNumber(_bits, "bits")); - return value & ((BN_1 << bits) - BN_1); -} -exports.mask = mask; -/** - * Gets a BigInt from %%value%%. If it is an invalid value for - * a BigInt, then an ArgumentError will be thrown for %%name%%. - */ -function getBigInt(value, name) { - switch (typeof (value)) { - case "bigint": return value; - case "number": - (0, errors_js_1.assertArgument)(Number.isInteger(value), "underflow", name || "value", value); - (0, errors_js_1.assertArgument)(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); - return BigInt(value); - case "string": - try { - if (value === "") { - throw new Error("empty string"); - } - if (value[0] === "-" && value[1] !== "-") { - return -BigInt(value.substring(1)); - } - return BigInt(value); - } - catch (e) { - (0, errors_js_1.assertArgument)(false, `invalid BigNumberish string: ${e.message}`, name || "value", value); - } - } - (0, errors_js_1.assertArgument)(false, "invalid BigNumberish value", name || "value", value); -} -exports.getBigInt = getBigInt; -/** - * Returns %%value%% as a bigint, validating it is valid as a bigint - * value and that it is positive. - */ -function getUint(value, name) { - const result = getBigInt(value, name); - (0, errors_js_1.assert)(result >= BN_0, "unsigned value cannot be negative", "NUMERIC_FAULT", { - fault: "overflow", operation: "getUint", value - }); - return result; -} -exports.getUint = getUint; -const Nibbles = "0123456789abcdef"; -/* - * Converts %%value%% to a BigInt. If %%value%% is a Uint8Array, it - * is treated as Big Endian data. - */ -function toBigInt(value) { - if (value instanceof Uint8Array) { - let result = "0x0"; - for (const v of value) { - result += Nibbles[v >> 4]; - result += Nibbles[v & 0x0f]; - } - return BigInt(result); - } - return getBigInt(value); -} -exports.toBigInt = toBigInt; -/** - * Gets a //number// from %%value%%. If it is an invalid value for - * a //number//, then an ArgumentError will be thrown for %%name%%. - */ -function getNumber(value, name) { - switch (typeof (value)) { - case "bigint": - (0, errors_js_1.assertArgument)(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); - return Number(value); - case "number": - (0, errors_js_1.assertArgument)(Number.isInteger(value), "underflow", name || "value", value); - (0, errors_js_1.assertArgument)(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); - return value; - case "string": - try { - if (value === "") { - throw new Error("empty string"); - } - return getNumber(BigInt(value), name); - } - catch (e) { - (0, errors_js_1.assertArgument)(false, `invalid numeric string: ${e.message}`, name || "value", value); - } - } - (0, errors_js_1.assertArgument)(false, "invalid numeric value", name || "value", value); -} -exports.getNumber = getNumber; -/** - * Converts %%value%% to a number. If %%value%% is a Uint8Array, it - * is treated as Big Endian data. Throws if the value is not safe. - */ -function toNumber(value) { - return getNumber(toBigInt(value)); -} -exports.toNumber = toNumber; -/** - * Converts %%value%% to a Big Endian hexstring, optionally padded to - * %%width%% bytes. - */ -function toBeHex(_value, _width) { - const value = getUint(_value, "value"); - let result = value.toString(16); - if (_width == null) { - // Ensure the value is of even length - if (result.length % 2) { - result = "0" + result; - } - } - else { - const width = getNumber(_width, "width"); - // Special case when both value and width are 0 (see: #5025) - if (width === 0 && value === BN_0) { - return "0x"; - } - (0, errors_js_1.assert)(width * 2 >= result.length, `value exceeds width (${width} bytes)`, "NUMERIC_FAULT", { - operation: "toBeHex", - fault: "overflow", - value: _value - }); - // Pad the value to the required width - while (result.length < (width * 2)) { - result = "0" + result; - } - } - return "0x" + result; -} -exports.toBeHex = toBeHex; -/** - * Converts %%value%% to a Big Endian Uint8Array. - */ -function toBeArray(_value, _width) { - const value = getUint(_value, "value"); - if (value === BN_0) { - const width = (_width != null) ? getNumber(_width, "width") : 0; - return new Uint8Array(width); - } - let hex = value.toString(16); - if (hex.length % 2) { - hex = "0" + hex; - } - if (_width != null) { - const width = getNumber(_width, "width"); - while (hex.length < (width * 2)) { - hex = "00" + hex; - } - (0, errors_js_1.assert)((width * 2) === hex.length, `value exceeds width (${width} bytes)`, "NUMERIC_FAULT", { - operation: "toBeArray", - fault: "overflow", - value: _value - }); - } - const result = new Uint8Array(hex.length / 2); - for (let i = 0; i < result.length; i++) { - const offset = i * 2; - result[i] = parseInt(hex.substring(offset, offset + 2), 16); - } - return result; -} -exports.toBeArray = toBeArray; -/** - * Returns a [[HexString]] for %%value%% safe to use as a //Quantity//. - * - * A //Quantity// does not have and leading 0 values unless the value is - * the literal value `0x0`. This is most commonly used for JSSON-RPC - * numeric values. - */ -function toQuantity(value) { - let result = (0, data_js_1.hexlify)((0, data_js_1.isBytesLike)(value) ? value : toBeArray(value)).substring(2); - while (result.startsWith("0")) { - result = result.substring(1); - } - if (result === "") { - result = "0"; - } - return "0x" + result; -} -exports.toQuantity = toQuantity; -//# sourceMappingURL=maths.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/maths.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/maths.js.map deleted file mode 100644 index a71e6191..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/maths.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"maths.js","sourceRoot":"","sources":["../../src.ts/utils/maths.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,uCAAiD;AACjD,2CAAqD;AAerD,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAEvB,iDAAiD;AAGjD,uCAAuC;AACvC,MAAM,QAAQ,GAAG,gBAAgB,CAAC;AAElC;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,MAAoB,EAAE,MAAe;IAC1D,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAEjD,IAAA,kBAAM,EAAC,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,IAAI,EAAE,UAAU,EAAE,eAAe,EAAE;QAC3D,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM;KAC1D,CAAC,CAAC;IAEH,yCAAyC;IACzC,IAAI,KAAK,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,EAAE;QACzB,MAAM,IAAI,GAAG,CAAC,IAAI,IAAI,KAAK,CAAC,GAAG,IAAI,CAAC;QACpC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;KACtC;IAED,OAAO,KAAK,CAAC;AACjB,CAAC;AAfD,4BAeC;AAED;;;;;GAKG;AACH,SAAgB,MAAM,CAAC,MAAoB,EAAE,MAAe;IACxD,IAAI,KAAK,GAAG,SAAS,CAAC,MAAM,EAAE,OAAO,C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CAAC,CAAC,CAAC;IAC9C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACpC,MAAM,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC;QACrB,MAAM,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;KAC/D;IAED,OAAO,MAAM,CAAC;AAClB,CAAC;AA9BD,8BA8BC;AAED;;;;;;GAMG;AACH,SAAgB,UAAU,CAAC,KAA+B;IACtD,IAAI,MAAM,GAAG,IAAA,iBAAO,EAAC,IAAA,qBAAW,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAChF,OAAO,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QAAE,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;KAAE;IAChE,IAAI,MAAM,KAAK,EAAE,EAAE;QAAE,MAAM,GAAG,GAAG,CAAC;KAAE;IACpC,OAAO,IAAI,GAAG,MAAM,CAAC;AACzB,CAAC;AALD,gCAKC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/properties.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/properties.d.ts deleted file mode 100644 index 9f0daadf..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/properties.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Property helper functions. - * - * @_subsection api/utils:Properties [about-properties] - */ -/** - * Resolves to a new object that is a copy of %%value%%, but with all - * values resolved. - */ -export declare function resolveProperties(value: { - [P in keyof T]: T[P] | Promise; -}): Promise; -/** - * Assigns the %%values%% to %%target%% as read-only values. - * - * It %%types%% is specified, the values are checked. - */ -export declare function defineProperties(target: T, values: { - [K in keyof T]?: T[K]; -}, types?: { - [K in keyof T]?: string; -}): void; -//# sourceMappingURL=properties.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/properties.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/properties.d.ts.map deleted file mode 100644 index 1ea81956..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/properties.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../src.ts/utils/properties.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAwBH;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE;KAAI,CAAC,IAAI,MAAM,CAAC,GAAI,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAOvG;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EACjC,MAAM,EAAE,CAAC,EACT,MAAM,EAAE;KAAI,CAAC,IAAI,MAAM,CAAC,CAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CAAE,EACnC,KAAK,CAAC,EAAE;KAAI,CAAC,IAAI,MAAM,CAAC,CAAE,CAAC,EAAE,MAAM;CAAE,GAAG,IAAI,CAU5C"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/properties.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/properties.js deleted file mode 100644 index a862d344..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/properties.js +++ /dev/null @@ -1,59 +0,0 @@ -"use strict"; -/** - * Property helper functions. - * - * @_subsection api/utils:Properties [about-properties] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.defineProperties = exports.resolveProperties = void 0; -function checkType(value, type, name) { - const types = type.split("|").map(t => t.trim()); - for (let i = 0; i < types.length; i++) { - switch (type) { - case "any": - return; - case "bigint": - case "boolean": - case "number": - case "string": - if (typeof (value) === type) { - return; - } - } - } - const error = new Error(`invalid value for type ${type}`); - error.code = "INVALID_ARGUMENT"; - error.argument = `value.${name}`; - error.value = value; - throw error; -} -/** - * Resolves to a new object that is a copy of %%value%%, but with all - * values resolved. - */ -async function resolveProperties(value) { - const keys = Object.keys(value); - const results = await Promise.all(keys.map((k) => Promise.resolve(value[k]))); - return results.reduce((accum, v, index) => { - accum[keys[index]] = v; - return accum; - }, {}); -} -exports.resolveProperties = resolveProperties; -/** - * Assigns the %%values%% to %%target%% as read-only values. - * - * It %%types%% is specified, the values are checked. - */ -function defineProperties(target, values, types) { - for (let key in values) { - let value = values[key]; - const type = (types ? types[key] : null); - if (type) { - checkType(value, type, key); - } - Object.defineProperty(target, key, { enumerable: true, value, writable: false }); - } -} -exports.defineProperties = defineProperties; -//# sourceMappingURL=properties.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/properties.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/properties.js.map deleted file mode 100644 index 72fb7769..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/properties.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"properties.js","sourceRoot":"","sources":["../../src.ts/utils/properties.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,SAAS,SAAS,CAAC,KAAU,EAAE,IAAY,EAAE,IAAY;IACrD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IACjD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAC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AAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA,CAAC,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,IAAI,EAAE;YAAE,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;SAAE;QAE1C,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;KACpF;AACL,CAAC;AAbD,4CAaC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/rlp-decode.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/rlp-decode.d.ts deleted file mode 100644 index b77b08b9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/rlp-decode.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { BytesLike, RlpStructuredData } from "./index.js"; -/** - * Decodes %%data%% into the structured data it represents. - */ -export declare function decodeRlp(_data: BytesLike): RlpStructuredData; -//# sourceMappingURL=rlp-decode.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/rlp-decode.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/rlp-decode.d.ts.map deleted file mode 100644 index 458795aa..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/rlp-decode.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rlp-decode.d.ts","sourceRoot":"","sources":["../../src.ts/utils/rlp-decode.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAwF/D;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,iBAAiB,CAK7D"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/rlp-decode.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/rlp-decode.js deleted file mode 100644 index 9d3c3b75..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/rlp-decode.js +++ /dev/null @@ -1,83 +0,0 @@ -"use strict"; -//See: https://github.com/ethereum/wiki/wiki/RLP -Object.defineProperty(exports, "__esModule", { value: true }); -exports.decodeRlp = void 0; -const data_js_1 = require("./data.js"); -const errors_js_1 = require("./errors.js"); -const data_js_2 = require("./data.js"); -function hexlifyByte(value) { - let result = value.toString(16); - while (result.length < 2) { - result = "0" + result; - } - return "0x" + result; -} -function unarrayifyInteger(data, offset, length) { - let result = 0; - for (let i = 0; i < length; i++) { - result = (result * 256) + data[offset + i]; - } - return result; -} -function _decodeChildren(data, offset, childOffset, length) { - const result = []; - while (childOffset < offset + 1 + length) { - const decoded = _decode(data, childOffset); - result.push(decoded.result); - childOffset += decoded.consumed; - (0, errors_js_1.assert)(childOffset <= offset + 1 + length, "child data too short", "BUFFER_OVERRUN", { - buffer: data, length, offset - }); - } - return { consumed: (1 + length), result: result }; -} -// returns { consumed: number, result: Object } -function _decode(data, offset) { - (0, errors_js_1.assert)(data.length !== 0, "data too short", "BUFFER_OVERRUN", { - buffer: data, length: 0, offset: 1 - }); - const checkOffset = (offset) => { - (0, errors_js_1.assert)(offset <= data.length, "data short segment too short", "BUFFER_OVERRUN", { - buffer: data, length: data.length, offset - }); - }; - // Array with extra length prefix - if (data[offset] >= 0xf8) { - const lengthLength = data[offset] - 0xf7; - checkOffset(offset + 1 + lengthLength); - const length = unarrayifyInteger(data, offset + 1, lengthLength); - checkOffset(offset + 1 + lengthLength + length); - return _decodeChildren(data, offset, offset + 1 + lengthLength, lengthLength + length); - } - else if (data[offset] >= 0xc0) { - const length = data[offset] - 0xc0; - checkOffset(offset + 1 + length); - return _decodeChildren(data, offset, offset + 1, length); - } - else if (data[offset] >= 0xb8) { - const lengthLength = data[offset] - 0xb7; - checkOffset(offset + 1 + lengthLength); - const length = unarrayifyInteger(data, offset + 1, lengthLength); - checkOffset(offset + 1 + lengthLength + length); - const result = (0, data_js_1.hexlify)(data.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length)); - return { consumed: (1 + lengthLength + length), result: result }; - } - else if (data[offset] >= 0x80) { - const length = data[offset] - 0x80; - checkOffset(offset + 1 + length); - const result = (0, data_js_1.hexlify)(data.slice(offset + 1, offset + 1 + length)); - return { consumed: (1 + length), result: result }; - } - return { consumed: 1, result: hexlifyByte(data[offset]) }; -} -/** - * Decodes %%data%% into the structured data it represents. - */ -function decodeRlp(_data) { - const data = (0, data_js_2.getBytes)(_data, "data"); - const decoded = _decode(data, 0); - (0, errors_js_1.assertArgument)(decoded.consumed === data.length, "unexpected junk after rlp payload", "data", _data); - return decoded.result; -} -exports.decodeRlp = decodeRlp; -//# sourceMappingURL=rlp-decode.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/rlp-decode.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/rlp-decode.js.map deleted file mode 100644 index 213be5d8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/rlp-decode.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rlp-decode.js","sourceRoot":"","sources":["../../src.ts/utils/rlp-decode.ts"],"names":[],"mappings":";AAAA,gDAAgD;;;AAEhD,uCAAoC;AACpC,2CAAqD;AACrD,uCAAqC;AAKrC,SAAS,WAAW,CAAC,KAAa;IAC9B,IAAI,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAChC,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;QAAE,MAAM,GAAG,GAAG,GAAG,MAAM,CAAC;KAAE;IACpD,OAAO,IAAI,GAAG,MAAM,CAAC;AACzB,CAAC;AAED,SAAS,iBAAiB,CAAC,IAAgB,EAAE,MAAc,EAAE,MAAc;IACvE,IAAI,MAAM,GAAG,CAAC,CAAC;IAC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-encode.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/rlp-encode.d.ts deleted file mode 100644 index 089b1c3e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/rlp-encode.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { RlpStructuredDataish } from "./rlp.js"; -/** - * Encodes %%object%% as an RLP-encoded [[DataHexString]]. - */ -export declare function encodeRlp(object: RlpStructuredDataish): string; -//# sourceMappingURL=rlp-encode.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/rlp-encode.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/rlp-encode.d.ts.map deleted file mode 100644 index 319163b8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/rlp-encode.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rlp-encode.d.ts","sourceRoot":"","sources":["../../src.ts/utils/rlp-encode.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAiDrD;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAO9D"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/rlp-encode.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/rlp-encode.js deleted file mode 100644 index 77cf3c5e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/rlp-encode.js +++ /dev/null @@ -1,53 +0,0 @@ -"use strict"; -//See: https://github.com/ethereum/wiki/wiki/RLP -Object.defineProperty(exports, "__esModule", { value: true }); -exports.encodeRlp = void 0; -const data_js_1 = require("./data.js"); -function arrayifyInteger(value) { - const result = []; - while (value) { - result.unshift(value & 0xff); - value >>= 8; - } - return result; -} -function _encode(object) { - if (Array.isArray(object)) { - let payload = []; - object.forEach(function (child) { - payload = payload.concat(_encode(child)); - }); - if (payload.length <= 55) { - payload.unshift(0xc0 + payload.length); - return payload; - } - const length = arrayifyInteger(payload.length); - length.unshift(0xf7 + length.length); - return length.concat(payload); - } - const data = Array.prototype.slice.call((0, data_js_1.getBytes)(object, "object")); - if (data.length === 1 && data[0] <= 0x7f) { - return data; - } - else if (data.length <= 55) { - data.unshift(0x80 + data.length); - return data; - } - const length = arrayifyInteger(data.length); - length.unshift(0xb7 + length.length); - return length.concat(data); -} -const nibbles = "0123456789abcdef"; -/** - * Encodes %%object%% as an RLP-encoded [[DataHexString]]. - */ -function encodeRlp(object) { - let result = "0x"; - for (const v of _encode(object)) { - result += nibbles[v >> 4]; - result += nibbles[v & 0xf]; - } - return result; -} -exports.encodeRlp = encodeRlp; -//# sourceMappingURL=rlp-encode.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/rlp-encode.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/rlp-encode.js.map deleted file mode 100644 index 1bb8a3f7..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/rlp-encode.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rlp-encode.js","sourceRoot":"","sources":["../../src.ts/utils/rlp-encode.ts"],"names":[],"mappings":";AAAA,gDAAgD;;;AAEhD,uCAAqC;AAKrC,SAAS,eAAe,CAAC,KAAa;IAClC,MAAM,MAAM,GAAkB,EAAE,CAAC;IACjC,OAAO,KAAK,EAAE;QACV,MAAM,CAAC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;QAC7B,KAAK,KAAK,CAAC,CAAC;KACf;IACD,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,SAAS,OAAO,CAAC,MAAwC;IACrD,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QACvB,IAAI,OAAO,GAAkB,EAAE,CAAC;QAChC,MAAM,CAAC,OAAO,CAAC,UAAS,KAAK;YACzB,OAAO,GAA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MAAM,IAAI,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QAC1B,MAAM,IAAI,OAAO,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;KAC9B;IACD,OAAO,MAAM,CAAC;AAClB,CAAC;AAPD,8BAOC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/rlp.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/rlp.d.ts deleted file mode 100644 index bdc7e828..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/rlp.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * The [[link-rlp]] (RLP) encoding is used throughout Ethereum - * to serialize nested structures of Arrays and data. - * - * @_subsection api/utils:Recursive-Length Prefix [about-rlp] - */ -export { decodeRlp } from "./rlp-decode.js"; -export { encodeRlp } from "./rlp-encode.js"; -/** - * An RLP-encoded structure. - */ -export type RlpStructuredData = string | Array; -/** - * An RLP-encoded structure, which allows Uint8Array. - */ -export type RlpStructuredDataish = string | Uint8Array | Array; -//# sourceMappingURL=rlp.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/rlp.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/rlp.d.ts.map deleted file mode 100644 index 287f5705..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/rlp.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rlp.d.ts","sourceRoot":"","sources":["../../src.ts/utils/rlp.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,KAAK,CAAC,iBAAiB,CAAC,CAAC;AAElE;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,UAAU,GAAG,KAAK,CAAC,oBAAoB,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/rlp.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/rlp.js deleted file mode 100644 index 09526068..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/rlp.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -/** - * The [[link-rlp]] (RLP) encoding is used throughout Ethereum - * to serialize nested structures of Arrays and data. - * - * @_subsection api/utils:Recursive-Length Prefix [about-rlp] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.encodeRlp = exports.decodeRlp = void 0; -var rlp_decode_js_1 = require("./rlp-decode.js"); -Object.defineProperty(exports, "decodeRlp", { enumerable: true, get: function () { return rlp_decode_js_1.decodeRlp; } }); -var rlp_encode_js_1 = require("./rlp-encode.js"); -Object.defineProperty(exports, "encodeRlp", { enumerable: true, get: function () { return rlp_encode_js_1.encodeRlp; } }); -//# sourceMappingURL=rlp.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/rlp.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/rlp.js.map deleted file mode 100644 index 4e95eb34..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/rlp.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rlp.js","sourceRoot":"","sources":["../../src.ts/utils/rlp.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,iDAA4C;AAAnC,0GAAA,SAAS,OAAA;AAClB,iDAA4C;AAAnC,0GAAA,SAAS,OAAA"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/units.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/units.d.ts deleted file mode 100644 index 7f6ce177..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/units.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { BigNumberish, Numeric } from "../utils/index.js"; -/** - * Converts %%value%% into a //decimal string//, assuming %%unit%% decimal - * places. The %%unit%% may be the number of decimal places or the name of - * a unit (e.g. ``"gwei"`` for 9 decimal places). - * - */ -export declare function formatUnits(value: BigNumberish, unit?: string | Numeric): string; -/** - * Converts the //decimal string// %%value%% to a BigInt, assuming - * %%unit%% decimal places. The %%unit%% may the number of decimal places - * or the name of a unit (e.g. ``"gwei"`` for 9 decimal places). - */ -export declare function parseUnits(value: string, unit?: string | Numeric): bigint; -/** - * Converts %%value%% into a //decimal string// using 18 decimal places. - */ -export declare function formatEther(wei: BigNumberish): string; -/** - * Converts the //decimal string// %%ether%% to a BigInt, using 18 - * decimal places. - */ -export declare function parseEther(ether: string): bigint; -//# sourceMappingURL=units.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/units.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/units.d.ts.map deleted file mode 100644 index 4572b87d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/units.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"units.d.ts","sourceRoot":"","sources":["../../src.ts/utils/units.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAa/D;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAWhF;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAazE;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,YAAY,GAAG,MAAM,CAErD;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEhD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/units.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/units.js deleted file mode 100644 index fe2c8983..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/units.js +++ /dev/null @@ -1,90 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.parseEther = exports.formatEther = exports.parseUnits = exports.formatUnits = void 0; -/** - * Most interactions with Ethereum requires integer values, which use - * the smallest magnitude unit. - * - * For example, imagine dealing with dollars and cents. Since dollars - * are divisible, non-integer values are possible, such as ``$10.77``. - * By using the smallest indivisible unit (i.e. cents), the value can - * be kept as the integer ``1077``. - * - * When receiving decimal input from the user (as a decimal string), - * the value should be converted to an integer and when showing a user - * a value, the integer value should be converted to a decimal string. - * - * This creates a clear distinction, between values to be used by code - * (integers) and values used for display logic to users (decimals). - * - * The native unit in Ethereum, //ether// is divisible to 18 decimal places, - * where each individual unit is called a //wei//. - * - * @_subsection api/utils:Unit Conversion [about-units] - */ -const errors_js_1 = require("./errors.js"); -const fixednumber_js_1 = require("./fixednumber.js"); -const maths_js_1 = require("./maths.js"); -const names = [ - "wei", - "kwei", - "mwei", - "gwei", - "szabo", - "finney", - "ether", -]; -/** - * Converts %%value%% into a //decimal string//, assuming %%unit%% decimal - * places. The %%unit%% may be the number of decimal places or the name of - * a unit (e.g. ``"gwei"`` for 9 decimal places). - * - */ -function formatUnits(value, unit) { - let decimals = 18; - if (typeof (unit) === "string") { - const index = names.indexOf(unit); - (0, errors_js_1.assertArgument)(index >= 0, "invalid unit", "unit", unit); - decimals = 3 * index; - } - else if (unit != null) { - decimals = (0, maths_js_1.getNumber)(unit, "unit"); - } - return fixednumber_js_1.FixedNumber.fromValue(value, decimals, { decimals, width: 512 }).toString(); -} -exports.formatUnits = formatUnits; -/** - * Converts the //decimal string// %%value%% to a BigInt, assuming - * %%unit%% decimal places. The %%unit%% may the number of decimal places - * or the name of a unit (e.g. ``"gwei"`` for 9 decimal places). - */ -function parseUnits(value, unit) { - (0, errors_js_1.assertArgument)(typeof (value) === "string", "value must be a string", "value", value); - let decimals = 18; - if (typeof (unit) === "string") { - const index = names.indexOf(unit); - (0, errors_js_1.assertArgument)(index >= 0, "invalid unit", "unit", unit); - decimals = 3 * index; - } - else if (unit != null) { - decimals = (0, maths_js_1.getNumber)(unit, "unit"); - } - return fixednumber_js_1.FixedNumber.fromString(value, { decimals, width: 512 }).value; -} -exports.parseUnits = parseUnits; -/** - * Converts %%value%% into a //decimal string// using 18 decimal places. - */ -function formatEther(wei) { - return formatUnits(wei, 18); -} -exports.formatEther = formatEther; -/** - * Converts the //decimal string// %%ether%% to a BigInt, using 18 - * decimal places. - */ -function parseEther(ether) { - return parseUnits(ether, 18); -} -exports.parseEther = parseEther; -//# sourceMappingURL=units.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/units.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/units.js.map deleted file mode 100644 index 50ac6a31..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/units.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"units.js","sourceRoot":"","sources":["../../src.ts/utils/units.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,2CAA6C;AAC7C,qDAA+C;AAC/C,yCAAuC;AAKvC,MAAM,KAAK,GAAG;IACV,KAAK;IACL,MAAM;IACN,MAAM;IACN,MAAM;IACN,OAAO;IACP,QAAQ;IACR,OAAO;CACV,CAAC;AAEF;;;;;GAKG;AACH,SAAgB,WAAW,CAAC,KAAmB,EAAE,IAAuB;IACpE,IAAI,QAAQ,GAAG,EAAE,CAAC;IAClB,IAAI,OAAM,CAAC,IAAI,CAAC,KAAK,QAAQ,EAAE;QAC3B,MAAM,KAAK,G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,OAAO,WAAW,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;AAChC,CAAC;AAFD,kCAEC;AAED;;;GAGG;AACH,SAAgB,UAAU,CAAC,KAAa;IACpC,OAAO,UAAU,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACjC,CAAC;AAFD,gCAEC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/utf8.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/utf8.d.ts deleted file mode 100644 index 7bb87cc7..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/utf8.d.ts +++ /dev/null @@ -1,96 +0,0 @@ -import type { BytesLike } from "./index.js"; -/** - * The stanard normalization forms. - */ -export type UnicodeNormalizationForm = "NFC" | "NFD" | "NFKC" | "NFKD"; -/** - * When using the UTF-8 error API the following errors can be intercepted - * and processed as the %%reason%% passed to the [[Utf8ErrorFunc]]. - * - * **``"UNEXPECTED_CONTINUE"``** - a continuation byte was present where there - * was nothing to continue. - * - * **``"BAD_PREFIX"``** - an invalid (non-continuation) byte to start a - * UTF-8 codepoint was found. - * - * **``"OVERRUN"``** - the string is too short to process the expected - * codepoint length. - * - * **``"MISSING_CONTINUE"``** - a missing continuation byte was expected but - * not found. The %%offset%% indicates the index the continuation byte - * was expected at. - * - * **``"OUT_OF_RANGE"``** - the computed code point is outside the range - * for UTF-8. The %%badCodepoint%% indicates the computed codepoint, which was - * outside the valid UTF-8 range. - * - * **``"UTF16_SURROGATE"``** - the UTF-8 strings contained a UTF-16 surrogate - * pair. The %%badCodepoint%% is the computed codepoint, which was inside the - * UTF-16 surrogate range. - * - * **``"OVERLONG"``** - the string is an overlong representation. The - * %%badCodepoint%% indicates the computed codepoint, which has already - * been bounds checked. - * - * - * @returns string - */ -export type Utf8ErrorReason = "UNEXPECTED_CONTINUE" | "BAD_PREFIX" | "OVERRUN" | "MISSING_CONTINUE" | "OUT_OF_RANGE" | "UTF16_SURROGATE" | "OVERLONG"; -/** - * A callback that can be used with [[toUtf8String]] to analysis or - * recovery from invalid UTF-8 data. - * - * Parsing UTF-8 data is done through a simple Finite-State Machine (FSM) - * which calls the ``Utf8ErrorFunc`` if a fault is detected. - * - * The %%reason%% indicates where in the FSM execution the fault - * occurred and the %%offset%% indicates where the input failed. - * - * The %%bytes%% represents the raw UTF-8 data that was provided and - * %%output%% is the current array of UTF-8 code-points, which may - * be updated by the ``Utf8ErrorFunc``. - * - * The value of the %%badCodepoint%% depends on the %%reason%%. See - * [[Utf8ErrorReason]] for details. - * - * The function should return the number of bytes that should be skipped - * when control resumes to the FSM. - */ -export type Utf8ErrorFunc = (reason: Utf8ErrorReason, offset: number, bytes: Uint8Array, output: Array, badCodepoint?: number) => number; -/** - * A handful of popular, built-in UTF-8 error handling strategies. - * - * **``"error"``** - throws on ANY illegal UTF-8 sequence or - * non-canonical (overlong) codepoints (this is the default) - * - * **``"ignore"``** - silently drops any illegal UTF-8 sequence - * and accepts non-canonical (overlong) codepoints - * - * **``"replace"``** - replace any illegal UTF-8 sequence with the - * UTF-8 replacement character (i.e. ``"\\ufffd"``) and accepts - * non-canonical (overlong) codepoints - * - * @returns: Record<"error" | "ignore" | "replace", Utf8ErrorFunc> - */ -export declare const Utf8ErrorFuncs: Readonly>; -/** - * Returns the UTF-8 byte representation of %%str%%. - * - * If %%form%% is specified, the string is normalized. - */ -export declare function toUtf8Bytes(str: string, form?: UnicodeNormalizationForm): Uint8Array; -/** - * Returns the string represented by the UTF-8 data %%bytes%%. - * - * When %%onError%% function is specified, it is called on UTF-8 - * errors allowing recovery using the [[Utf8ErrorFunc]] API. - * (default: [error](Utf8ErrorFuncs)) - */ -export declare function toUtf8String(bytes: BytesLike, onError?: Utf8ErrorFunc): string; -/** - * Returns the UTF-8 code-points for %%str%%. - * - * If %%form%% is specified, the string is normalized. - */ -export declare function toUtf8CodePoints(str: string, form?: UnicodeNormalizationForm): Array; -//# sourceMappingURL=utf8.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/utf8.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/utf8.d.ts.map deleted file mode 100644 index 9349623c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/utf8.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utf8.d.ts","sourceRoot":"","sources":["../../src.ts/utils/utf8.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAK5C;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAEvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,MAAM,eAAe,GAAG,qBAAqB,GAAG,YAAY,GAAG,SAAS,GAC1E,kBAAkB,GAAG,cAAc,GAAG,iBAAiB,GAAG,UAAU,CAAC;AAGzE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;AA6CjJ;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,OAAO,GAAG,QAAQ,GAAG,SAAS,EAAE,aAAa,CAAC,CAIzF,CAAC;AAsGH;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,wBAAwB,GAAG,UAAU,CAyCpF;AAgBD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,MAAM,CAE9E;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,wBAAwB,GAAG,KAAK,CAAC,MAAM,CAAC,CAE5F"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/utf8.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/utf8.js deleted file mode 100644 index 7a29fb3f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/utf8.js +++ /dev/null @@ -1,227 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.toUtf8CodePoints = exports.toUtf8String = exports.toUtf8Bytes = exports.Utf8ErrorFuncs = void 0; -/** - * Using strings in Ethereum (or any security-basd system) requires - * additional care. These utilities attempt to mitigate some of the - * safety issues as well as provide the ability to recover and analyse - * strings. - * - * @_subsection api/utils:Strings and UTF-8 [about-strings] - */ -const data_js_1 = require("./data.js"); -const errors_js_1 = require("./errors.js"); -function errorFunc(reason, offset, bytes, output, badCodepoint) { - (0, errors_js_1.assertArgument)(false, `invalid codepoint at offset ${offset}; ${reason}`, "bytes", bytes); -} -function ignoreFunc(reason, offset, bytes, output, badCodepoint) { - // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes - if (reason === "BAD_PREFIX" || reason === "UNEXPECTED_CONTINUE") { - let i = 0; - for (let o = offset + 1; o < bytes.length; o++) { - if (bytes[o] >> 6 !== 0x02) { - break; - } - i++; - } - return i; - } - // This byte runs us past the end of the string, so just jump to the end - // (but the first byte was read already read and therefore skipped) - if (reason === "OVERRUN") { - return bytes.length - offset - 1; - } - // Nothing to skip - return 0; -} -function replaceFunc(reason, offset, bytes, output, badCodepoint) { - // Overlong representations are otherwise "valid" code points; just non-deistingtished - if (reason === "OVERLONG") { - (0, errors_js_1.assertArgument)(typeof (badCodepoint) === "number", "invalid bad code point for replacement", "badCodepoint", badCodepoint); - output.push(badCodepoint); - return 0; - } - // Put the replacement character into the output - output.push(0xfffd); - // Otherwise, process as if ignoring errors - return ignoreFunc(reason, offset, bytes, output, badCodepoint); -} -/** - * A handful of popular, built-in UTF-8 error handling strategies. - * - * **``"error"``** - throws on ANY illegal UTF-8 sequence or - * non-canonical (overlong) codepoints (this is the default) - * - * **``"ignore"``** - silently drops any illegal UTF-8 sequence - * and accepts non-canonical (overlong) codepoints - * - * **``"replace"``** - replace any illegal UTF-8 sequence with the - * UTF-8 replacement character (i.e. ``"\\ufffd"``) and accepts - * non-canonical (overlong) codepoints - * - * @returns: Record<"error" | "ignore" | "replace", Utf8ErrorFunc> - */ -exports.Utf8ErrorFuncs = Object.freeze({ - error: errorFunc, - ignore: ignoreFunc, - replace: replaceFunc -}); -// http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499 -function getUtf8CodePoints(_bytes, onError) { - if (onError == null) { - onError = exports.Utf8ErrorFuncs.error; - } - const bytes = (0, data_js_1.getBytes)(_bytes, "bytes"); - const result = []; - let i = 0; - // Invalid bytes are ignored - while (i < bytes.length) { - const c = bytes[i++]; - // 0xxx xxxx - if (c >> 7 === 0) { - result.push(c); - continue; - } - // Multibyte; how many bytes left for this character? - let extraLength = null; - let overlongMask = null; - // 110x xxxx 10xx xxxx - if ((c & 0xe0) === 0xc0) { - extraLength = 1; - overlongMask = 0x7f; - // 1110 xxxx 10xx xxxx 10xx xxxx - } - else if ((c & 0xf0) === 0xe0) { - extraLength = 2; - overlongMask = 0x7ff; - // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx - } - else if ((c & 0xf8) === 0xf0) { - extraLength = 3; - overlongMask = 0xffff; - } - else { - if ((c & 0xc0) === 0x80) { - i += onError("UNEXPECTED_CONTINUE", i - 1, bytes, result); - } - else { - i += onError("BAD_PREFIX", i - 1, bytes, result); - } - continue; - } - // Do we have enough bytes in our data? - if (i - 1 + extraLength >= bytes.length) { - i += onError("OVERRUN", i - 1, bytes, result); - continue; - } - // Remove the length prefix from the char - let res = c & ((1 << (8 - extraLength - 1)) - 1); - for (let j = 0; j < extraLength; j++) { - let nextChar = bytes[i]; - // Invalid continuation byte - if ((nextChar & 0xc0) != 0x80) { - i += onError("MISSING_CONTINUE", i, bytes, result); - res = null; - break; - } - ; - res = (res << 6) | (nextChar & 0x3f); - i++; - } - // See above loop for invalid continuation byte - if (res === null) { - continue; - } - // Maximum code point - if (res > 0x10ffff) { - i += onError("OUT_OF_RANGE", i - 1 - extraLength, bytes, result, res); - continue; - } - // Reserved for UTF-16 surrogate halves - if (res >= 0xd800 && res <= 0xdfff) { - i += onError("UTF16_SURROGATE", i - 1 - extraLength, bytes, result, res); - continue; - } - // Check for overlong sequences (more bytes than needed) - if (res <= overlongMask) { - i += onError("OVERLONG", i - 1 - extraLength, bytes, result, res); - continue; - } - result.push(res); - } - return result; -} -// http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array -/** - * Returns the UTF-8 byte representation of %%str%%. - * - * If %%form%% is specified, the string is normalized. - */ -function toUtf8Bytes(str, form) { - (0, errors_js_1.assertArgument)(typeof (str) === "string", "invalid string value", "str", str); - if (form != null) { - (0, errors_js_1.assertNormalize)(form); - str = str.normalize(form); - } - let result = []; - for (let i = 0; i < str.length; i++) { - const c = str.charCodeAt(i); - if (c < 0x80) { - result.push(c); - } - else if (c < 0x800) { - result.push((c >> 6) | 0xc0); - result.push((c & 0x3f) | 0x80); - } - else if ((c & 0xfc00) == 0xd800) { - i++; - const c2 = str.charCodeAt(i); - (0, errors_js_1.assertArgument)(i < str.length && ((c2 & 0xfc00) === 0xdc00), "invalid surrogate pair", "str", str); - // Surrogate Pair - const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff); - result.push((pair >> 18) | 0xf0); - result.push(((pair >> 12) & 0x3f) | 0x80); - result.push(((pair >> 6) & 0x3f) | 0x80); - result.push((pair & 0x3f) | 0x80); - } - else { - result.push((c >> 12) | 0xe0); - result.push(((c >> 6) & 0x3f) | 0x80); - result.push((c & 0x3f) | 0x80); - } - } - return new Uint8Array(result); -} -exports.toUtf8Bytes = toUtf8Bytes; -; -//export -function _toUtf8String(codePoints) { - return codePoints.map((codePoint) => { - if (codePoint <= 0xffff) { - return String.fromCharCode(codePoint); - } - codePoint -= 0x10000; - return String.fromCharCode((((codePoint >> 10) & 0x3ff) + 0xd800), ((codePoint & 0x3ff) + 0xdc00)); - }).join(""); -} -/** - * Returns the string represented by the UTF-8 data %%bytes%%. - * - * When %%onError%% function is specified, it is called on UTF-8 - * errors allowing recovery using the [[Utf8ErrorFunc]] API. - * (default: [error](Utf8ErrorFuncs)) - */ -function toUtf8String(bytes, onError) { - return _toUtf8String(getUtf8CodePoints(bytes, onError)); -} -exports.toUtf8String = toUtf8String; -/** - * Returns the UTF-8 code-points for %%str%%. - * - * If %%form%% is specified, the string is normalized. - */ -function toUtf8CodePoints(str, form) { - return getUtf8CodePoints(toUtf8Bytes(str, form)); -} -exports.toUtf8CodePoints = toUtf8CodePoints; -//# sourceMappingURL=utf8.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/utf8.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/utf8.js.map deleted file mode 100644 index 853fa50e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/utf8.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utf8.js","sourceRoot":"","sources":["../../src.ts/utils/utf8.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACH,uCAAqC;AACrC,2CAA8D;AAuE9D,SAAS,SAAS,CAAC,MAAuB,EAAE,MAAc,EAAE,KAAiB,EAAE,MAAqB,EAAE,YAAqB;IACvH,IAAA,0BAAc,EAAC,KAAK,EAAE,+BAAgC,MAAO,KAAM,MAAO,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AAClG,CAAC;AAED,SAAS,UAAU,CAAC,MAAuB,EAAE,MAAc,EAAE,KAAiB,EAAE,MAAqB,EAAE,YAAqB;IAExH,uGAAuG;IACvG,IAA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,CAAC,CAAC;AAClC,CAAC;AAzCD,kCAyCC;AAAA,CAAC;AAEF,SAAS;AACT,SAAS,aAAa,CAAC,UAAyB;IAC5C,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE;QAChC,IAAI,SAAS,IAAI,MAAM,EAAE;YACrB,OAAO,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;SACzC;QACD,SAAS,IAAI,OAAO,CAAC;QACrB,OAAO,MAAM,CAAC,YAAY,CACtB,CAAC,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,EACtC,CAAC,CAAC,SAAS,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,CACjC,CAAC;IACN,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAChB,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,YAAY,CAAC,KAAgB,EAAE,OAAuB;IAClE,OAAO,aAAa,CAAC,iBAAiB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;AAC5D,CAAC;AAFD,oCAEC;AAED;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,GAAW,EAAE,IAA+B;IACzE,OAAO,iBAAiB,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;AACrD,CAAC;AAFD,4CAEC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/uuid.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/uuid.d.ts deleted file mode 100644 index 7b746515..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/uuid.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { BytesLike } from "./index.js"; -/** - * Returns the version 4 [[link-uuid]] for the %%randomBytes%%. - * - * @see: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4) - */ -export declare function uuidV4(randomBytes: BytesLike): string; -//# sourceMappingURL=uuid.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/uuid.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/uuid.d.ts.map deleted file mode 100644 index f3cf307c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/uuid.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"uuid.d.ts","sourceRoot":"","sources":["../../src.ts/utils/uuid.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,WAAW,EAAE,SAAS,GAAG,MAAM,CAqBrD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/uuid.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/uuid.js deleted file mode 100644 index b02f3b6c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/uuid.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.uuidV4 = void 0; -/** - * Explain UUID and link to RFC here. - * - * @_subsection: api/utils:UUID [about-uuid] - */ -const data_js_1 = require("./data.js"); -/** - * Returns the version 4 [[link-uuid]] for the %%randomBytes%%. - * - * @see: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4) - */ -function uuidV4(randomBytes) { - const bytes = (0, data_js_1.getBytes)(randomBytes, "randomBytes"); - // Section: 4.1.3: - // - time_hi_and_version[12:16] = 0b0100 - bytes[6] = (bytes[6] & 0x0f) | 0x40; - // Section 4.4 - // - clock_seq_hi_and_reserved[6] = 0b0 - // - clock_seq_hi_and_reserved[7] = 0b1 - bytes[8] = (bytes[8] & 0x3f) | 0x80; - const value = (0, data_js_1.hexlify)(bytes); - return [ - value.substring(2, 10), - value.substring(10, 14), - value.substring(14, 18), - value.substring(18, 22), - value.substring(22, 34), - ].join("-"); -} -exports.uuidV4 = uuidV4; -//# sourceMappingURL=uuid.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/uuid.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/uuid.js.map deleted file mode 100644 index a2225bbe..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/utils/uuid.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"uuid.js","sourceRoot":"","sources":["../../src.ts/utils/uuid.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,uCAA8C;AAI9C;;;;GAIG;AACH,SAAgB,MAAM,CAAC,WAAsB;IACzC,MAAM,KAAK,GAAG,IAAA,kBAAQ,EAAC,WAAW,EAAE,aAAa,CAAC,CAAC;IAEnD,kBAAkB;IAClB,wCAAwC;IACxC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAEpC,cAAc;IACd,uCAAuC;IACvC,uCAAuC;IACvC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAEpC,MAAM,KAAK,GAAG,IAAA,iBAAO,EAAC,KAAK,CAAC,CAAC;IAE7B,OAAO;QACJ,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC;QACtB,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;QACvB,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;QACvB,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;QACvB,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;KACzB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAChB,CAAC;AArBD,wBAqBC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/base-wallet.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/base-wallet.d.ts deleted file mode 100644 index e47edb57..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/base-wallet.d.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { AbstractSigner } from "../providers/index.js"; -import type { SigningKey } from "../crypto/index.js"; -import type { AuthorizationRequest, TypedDataDomain, TypedDataField } from "../hash/index.js"; -import type { Provider, TransactionRequest } from "../providers/index.js"; -import type { Authorization } from "../transaction/index.js"; -/** - * The **BaseWallet** is a stream-lined implementation of a - * [[Signer]] that operates with a private key. - * - * It is preferred to use the [[Wallet]] class, as it offers - * additional functionality and simplifies loading a variety - * of JSON formats, Mnemonic Phrases, etc. - * - * This class may be of use for those attempting to implement - * a minimal Signer. - */ -export declare class BaseWallet extends AbstractSigner { - #private; - /** - * The wallet address. - */ - readonly address: string; - /** - * Creates a new BaseWallet for %%privateKey%%, optionally - * connected to %%provider%%. - * - * If %%provider%% is not specified, only offline methods can - * be used. - */ - constructor(privateKey: SigningKey, provider?: null | Provider); - /** - * The [[SigningKey]] used for signing payloads. - */ - get signingKey(): SigningKey; - /** - * The private key for this wallet. - */ - get privateKey(): string; - getAddress(): Promise; - connect(provider: null | Provider): BaseWallet; - signTransaction(tx: TransactionRequest): Promise; - signMessage(message: string | Uint8Array): Promise; - /** - * Returns the signature for %%message%% signed with this wallet. - */ - signMessageSync(message: string | Uint8Array): string; - /** - * Returns the Authorization for %%auth%%. - */ - authorizeSync(auth: AuthorizationRequest): Authorization; - /** - * Resolves to the Authorization for %%auth%%. - */ - authorize(auth: AuthorizationRequest): Promise; - signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise; -} -//# sourceMappingURL=base-wallet.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/base-wallet.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/base-wallet.d.ts.map deleted file mode 100644 index 556ddc8c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/base-wallet.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base-wallet.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/base-wallet.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAe,MAAM,uBAAuB,CAAC;AAMpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EACR,oBAAoB,EAAE,eAAe,EAAE,cAAc,EACxD,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,KAAK,EAAE,aAAa,EAAmB,MAAM,yBAAyB,CAAC;AAG9E;;;;;;;;;;GAUG;AACH,qBAAa,UAAW,SAAQ,cAAc;;IAC1C;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAG,MAAM,CAAC;IAI1B;;;;;;OAMG;gBACS,UAAU,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ;IAc9D;;OAEG;IACH,IAAI,UAAU,IAAI,UAAU,CAA6B;IAEzD;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAAuC;IAEzD,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC;IAEnC,OAAO,CAAC,QAAQ,EAAE,IAAI,GAAG,QAAQ,GAAG,UAAU;IAIxC,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IAyBxD,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;IAMhE;;OAEG;IACH,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM;IAIrD;;OAEG;IACH,aAAa,CAAC,IAAI,EAAE,oBAAoB,GAAG,aAAa;IAYxD;;OAEG;IACG,SAAS,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,aAAa,CAAC;IAO7D,aAAa,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;CAsB1I"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/base-wallet.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/base-wallet.js deleted file mode 100644 index 1fe987fc..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/base-wallet.js +++ /dev/null @@ -1,127 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.BaseWallet = void 0; -const index_js_1 = require("../address/index.js"); -const index_js_2 = require("../hash/index.js"); -const index_js_3 = require("../providers/index.js"); -const index_js_4 = require("../transaction/index.js"); -const index_js_5 = require("../utils/index.js"); -/** - * The **BaseWallet** is a stream-lined implementation of a - * [[Signer]] that operates with a private key. - * - * It is preferred to use the [[Wallet]] class, as it offers - * additional functionality and simplifies loading a variety - * of JSON formats, Mnemonic Phrases, etc. - * - * This class may be of use for those attempting to implement - * a minimal Signer. - */ -class BaseWallet extends index_js_3.AbstractSigner { - /** - * The wallet address. - */ - address; - #signingKey; - /** - * Creates a new BaseWallet for %%privateKey%%, optionally - * connected to %%provider%%. - * - * If %%provider%% is not specified, only offline methods can - * be used. - */ - constructor(privateKey, provider) { - super(provider); - (0, index_js_5.assertArgument)(privateKey && typeof (privateKey.sign) === "function", "invalid private key", "privateKey", "[ REDACTED ]"); - this.#signingKey = privateKey; - const address = (0, index_js_4.computeAddress)(this.signingKey.publicKey); - (0, index_js_5.defineProperties)(this, { address }); - } - // Store private values behind getters to reduce visibility - // in console.log - /** - * The [[SigningKey]] used for signing payloads. - */ - get signingKey() { return this.#signingKey; } - /** - * The private key for this wallet. - */ - get privateKey() { return this.signingKey.privateKey; } - async getAddress() { return this.address; } - connect(provider) { - return new BaseWallet(this.#signingKey, provider); - } - async signTransaction(tx) { - tx = (0, index_js_3.copyRequest)(tx); - // Replace any Addressable or ENS name with an address - const { to, from } = await (0, index_js_5.resolveProperties)({ - to: (tx.to ? (0, index_js_1.resolveAddress)(tx.to, this) : undefined), - from: (tx.from ? (0, index_js_1.resolveAddress)(tx.from, this) : undefined) - }); - if (to != null) { - tx.to = to; - } - if (from != null) { - tx.from = from; - } - if (tx.from != null) { - (0, index_js_5.assertArgument)((0, index_js_1.getAddress)((tx.from)) === this.address, "transaction from address mismatch", "tx.from", tx.from); - delete tx.from; - } - // Build the transaction - const btx = index_js_4.Transaction.from(tx); - btx.signature = this.signingKey.sign(btx.unsignedHash); - return btx.serialized; - } - async signMessage(message) { - return this.signMessageSync(message); - } - // @TODO: Add a secialized signTx and signTyped sync that enforces - // all parameters are known? - /** - * Returns the signature for %%message%% signed with this wallet. - */ - signMessageSync(message) { - return this.signingKey.sign((0, index_js_2.hashMessage)(message)).serialized; - } - /** - * Returns the Authorization for %%auth%%. - */ - authorizeSync(auth) { - (0, index_js_5.assertArgument)(typeof (auth.address) === "string", "invalid address for authorizeSync", "auth.address", auth); - const signature = this.signingKey.sign((0, index_js_2.hashAuthorization)(auth)); - return Object.assign({}, { - address: (0, index_js_1.getAddress)(auth.address), - nonce: (0, index_js_5.getBigInt)(auth.nonce || 0), - chainId: (0, index_js_5.getBigInt)(auth.chainId || 0), - }, { signature }); - } - /** - * Resolves to the Authorization for %%auth%%. - */ - async authorize(auth) { - auth = Object.assign({}, auth, { - address: await (0, index_js_1.resolveAddress)(auth.address, this) - }); - return this.authorizeSync(await this.populateAuthorization(auth)); - } - async signTypedData(domain, types, value) { - // Populate any ENS names - const populated = await index_js_2.TypedDataEncoder.resolveNames(domain, types, value, async (name) => { - // @TODO: this should use resolveName; addresses don't - // need a provider - (0, index_js_5.assert)(this.provider != null, "cannot resolve ENS names without a provider", "UNSUPPORTED_OPERATION", { - operation: "resolveName", - info: { name } - }); - const address = await this.provider.resolveName(name); - (0, index_js_5.assert)(address != null, "unconfigured ENS name", "UNCONFIGURED_NAME", { - value: name - }); - return address; - }); - return this.signingKey.sign(index_js_2.TypedDataEncoder.hash(populated.domain, types, populated.value)).serialized; - } -} -exports.BaseWallet = BaseWallet; -//# sourceMappingURL=base-wallet.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/base-wallet.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/base-wallet.js.map deleted file mode 100644 index e61bd8f5..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/base-wallet.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base-wallet.js","sourceRoot":"","sources":["../../src.ts/wallet/base-wallet.ts"],"names":[],"mappings":";;;AAAA,kDAAiE;AACjE,+CAE0B;AAC1B,oDAAoE;AACpE,sDAAsE;AACtE,gDAE2B;AAU3B;;;;;;;;;;GAUG;AACH,MAAa,UAAW,SAAQ,yBAAc;IAC1C;;OAEG;IACM,OAAO,CAAU;IAEjB,WAAW,CAAa;IAEjC;;;;;;OAMG;IACH,YAAY,UAAsB,EAAE,QAA0B;QAC1D,KAAK,CAAC,QAAQ,CAAC,CAAC;QAEhB,IAAA,yBAAc,EAAC,UAAU,IAAI,OAAM,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,UAAU,EAAE,qBAAqB,EAAE,YAAY,EAAE,cAAc,CAAC,CAAC;QAE1H,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAE9B,MAAM,OAAO,GAAG,IAAA,yBAAc,EAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;QAC1D,IAAA,2BAAgB,EAAa,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IACpD,CAAC;IAED,2DAA2D;IAC3D,iBAAiB;IAEjB;;O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,IAAI,EAAE;YAC5B,OAAO,EAAE,MAAM,IAAA,yBAAc,EAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC;SACpD,CAAC,CAAC;QACH,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC;IACtE,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,MAAuB,EAAE,KAA4C,EAAE,KAA0B;QAEjH,yBAAyB;QACzB,MAAM,SAAS,GAAG,MAAM,2BAAgB,CAAC,YAAY,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAY,EAAE,EAAE;YAC/F,sDAAsD;YACtD,yBAAyB;YAEzB,IAAA,iBAAM,EAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,EAAE,6CAA6C,EAAE,uBAAuB,EAAE;gBAClG,SAAS,EAAE,aAAa;gBACxB,IAAI,EAAE,EAAE,IAAI,EAAE;aACjB,CAAC,CAAC;YAEH,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YACtD,IAAA,iBAAM,EAAC,OAAO,IAAI,IAAI,EAAE,uBAAuB,EAAE,mBAAmB,EAAE;gBAClE,KAAK,EAAE,IAAI;aACd,CAAC,CAAC;YAEH,OAAO,OAAO,CAAC;QACnB,CAAC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,2BAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC;IAC5G,CAAC;CACJ;AAlID,gCAkIC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/hdwallet.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/hdwallet.d.ts deleted file mode 100644 index 770ddd7c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/hdwallet.d.ts +++ /dev/null @@ -1,248 +0,0 @@ -/** - * Explain HD Wallets.. - * - * @_subsection: api/wallet:HD Wallets [hd-wallets] - */ -import { SigningKey } from "../crypto/index.js"; -import { VoidSigner } from "../providers/index.js"; -import { BaseWallet } from "./base-wallet.js"; -import { Mnemonic } from "./mnemonic.js"; -import type { ProgressCallback } from "../crypto/index.js"; -import type { Provider } from "../providers/index.js"; -import type { BytesLike, Numeric } from "../utils/index.js"; -import type { Wordlist } from "../wordlists/index.js"; -/** - * The default derivation path for Ethereum HD Nodes. (i.e. ``"m/44'/60'/0'/0/0"``) - */ -export declare const defaultPath: string; -/** - * An **HDNodeWallet** is a [[Signer]] backed by the private key derived - * from an HD Node using the [[link-bip-32]] stantard. - * - * An HD Node forms a hierarchal structure with each HD Node having a - * private key and the ability to derive child HD Nodes, defined by - * a path indicating the index of each child. - */ -export declare class HDNodeWallet extends BaseWallet { - #private; - /** - * The compressed public key. - */ - readonly publicKey: string; - /** - * The fingerprint. - * - * A fingerprint allows quick qay to detect parent and child nodes, - * but developers should be prepared to deal with collisions as it - * is only 4 bytes. - */ - readonly fingerprint: string; - /** - * The parent fingerprint. - */ - readonly parentFingerprint: string; - /** - * The mnemonic used to create this HD Node, if available. - * - * Sources such as extended keys do not encode the mnemonic, in - * which case this will be ``null``. - */ - readonly mnemonic: null | Mnemonic; - /** - * The chaincode, which is effectively a public key used - * to derive children. - */ - readonly chainCode: string; - /** - * The derivation path of this wallet. - * - * Since extended keys do not provide full path details, this - * may be ``null``, if instantiated from a source that does not - * encode it. - */ - readonly path: null | string; - /** - * The child index of this wallet. Values over ``2 *\* 31`` indicate - * the node is hardened. - */ - readonly index: number; - /** - * The depth of this wallet, which is the number of components - * in its path. - */ - readonly depth: number; - /** - * @private - */ - constructor(guard: any, signingKey: SigningKey, parentFingerprint: string, chainCode: string, path: null | string, index: number, depth: number, mnemonic: null | Mnemonic, provider: null | Provider); - connect(provider: null | Provider): HDNodeWallet; - /** - * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with - * %%password%%. - * - * If %%progressCallback%% is specified, it will receive periodic - * updates as the encryption process progreses. - */ - encrypt(password: Uint8Array | string, progressCallback?: ProgressCallback): Promise; - /** - * Returns a [JSON Keystore Wallet](json-wallets) encryped with - * %%password%%. - * - * It is preferred to use the [async version](encrypt) instead, - * which allows a [[ProgressCallback]] to keep the user informed. - * - * This method will block the event loop (freezing all UI) until - * it is complete, which may be a non-trivial duration. - */ - encryptSync(password: Uint8Array | string): string; - /** - * The extended key. - * - * This key will begin with the prefix ``xpriv`` and can be used to - * reconstruct this HD Node to derive its children. - */ - get extendedKey(): string; - /** - * Returns true if this wallet has a path, providing a Type Guard - * that the path is non-null. - */ - hasPath(): this is { - path: string; - }; - /** - * Returns a neutered HD Node, which removes the private details - * of an HD Node. - * - * A neutered node has no private key, but can be used to derive - * child addresses and other public data about the HD Node. - */ - neuter(): HDNodeVoidWallet; - /** - * Return the child for %%index%%. - */ - deriveChild(_index: Numeric): HDNodeWallet; - /** - * Return the HDNode for %%path%% from this node. - */ - derivePath(path: string): HDNodeWallet; - /** - * Creates a new HD Node from %%extendedKey%%. - * - * If the %%extendedKey%% will either have a prefix or ``xpub`` or - * ``xpriv``, returning a neutered HD Node ([[HDNodeVoidWallet]]) - * or full HD Node ([[HDNodeWallet) respectively. - */ - static fromExtendedKey(extendedKey: string): HDNodeWallet | HDNodeVoidWallet; - /** - * Creates a new random HDNode. - */ - static createRandom(password?: string, path?: string, wordlist?: Wordlist): HDNodeWallet; - /** - * Create an HD Node from %%mnemonic%%. - */ - static fromMnemonic(mnemonic: Mnemonic, path?: string): HDNodeWallet; - /** - * Creates an HD Node from a mnemonic %%phrase%%. - */ - static fromPhrase(phrase: string, password?: string, path?: string, wordlist?: Wordlist): HDNodeWallet; - /** - * Creates an HD Node from a %%seed%%. - */ - static fromSeed(seed: BytesLike): HDNodeWallet; -} -/** - * A **HDNodeVoidWallet** cannot sign, but provides access to - * the children nodes of a [[link-bip-32]] HD wallet addresses. - * - * The can be created by using an extended ``xpub`` key to - * [[HDNodeWallet_fromExtendedKey]] or by - * [nuetering](HDNodeWallet-neuter) a [[HDNodeWallet]]. - */ -export declare class HDNodeVoidWallet extends VoidSigner { - /** - * The compressed public key. - */ - readonly publicKey: string; - /** - * The fingerprint. - * - * A fingerprint allows quick qay to detect parent and child nodes, - * but developers should be prepared to deal with collisions as it - * is only 4 bytes. - */ - readonly fingerprint: string; - /** - * The parent node fingerprint. - */ - readonly parentFingerprint: string; - /** - * The chaincode, which is effectively a public key used - * to derive children. - */ - readonly chainCode: string; - /** - * The derivation path of this wallet. - * - * Since extended keys do not provider full path details, this - * may be ``null``, if instantiated from a source that does not - * enocde it. - */ - readonly path: null | string; - /** - * The child index of this wallet. Values over ``2 *\* 31`` indicate - * the node is hardened. - */ - readonly index: number; - /** - * The depth of this wallet, which is the number of components - * in its path. - */ - readonly depth: number; - /** - * @private - */ - constructor(guard: any, address: string, publicKey: string, parentFingerprint: string, chainCode: string, path: null | string, index: number, depth: number, provider: null | Provider); - connect(provider: null | Provider): HDNodeVoidWallet; - /** - * The extended key. - * - * This key will begin with the prefix ``xpub`` and can be used to - * reconstruct this neutered key to derive its children addresses. - */ - get extendedKey(): string; - /** - * Returns true if this wallet has a path, providing a Type Guard - * that the path is non-null. - */ - hasPath(): this is { - path: string; - }; - /** - * Return the child for %%index%%. - */ - deriveChild(_index: Numeric): HDNodeVoidWallet; - /** - * Return the signer for %%path%% from this node. - */ - derivePath(path: string): HDNodeVoidWallet; -} -/** - * Returns the [[link-bip-32]] path for the account at %%index%%. - * - * This is the pattern used by wallets like Ledger. - * - * There is also an [alternate pattern](getIndexedAccountPath) used by - * some software. - */ -export declare function getAccountPath(_index: Numeric): string; -/** - * Returns the path using an alternative pattern for deriving accounts, - * at %%index%%. - * - * This derivation path uses the //index// component rather than the - * //account// component to derive sequential accounts. - * - * This is the pattern used by wallets like MetaMask. - */ -export declare function getIndexedAccountPath(_index: Numeric): string; -//# sourceMappingURL=hdwallet.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/hdwallet.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/hdwallet.d.ts.map deleted file mode 100644 index 8c2afd91..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/hdwallet.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hdwallet.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/hdwallet.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAuC,UAAU,EAAU,MAAM,oBAAoB,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAUnD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAKzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAItD;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,MAA2B,CAAC;AAsFtD;;;;;;;GAOG;AACH,qBAAa,YAAa,SAAQ,UAAU;;IACxC;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAG,MAAM,CAAC;IAE5B;;;;;;OAMG;IACH,QAAQ,CAAC,WAAW,EAAG,MAAM,CAAC;IAE9B;;OAEG;IACH,QAAQ,CAAC,iBAAiB,EAAG,MAAM,CAAC;IAEpC;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAG,IAAI,GAAG,QAAQ,CAAC;IAEpC;;;OAGG;IACH,QAAQ,CAAC,SAAS,EA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;IACH,IAAI,WAAW,IAAI,MAAM,CAiBxB;IAED;;;OAGG;IACH,OAAO,IAAI,IAAI,IAAI;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE;IAEnC;;OAEG;IACH,WAAW,CAAC,MAAM,EAAE,OAAO,GAAG,gBAAgB;IAqB9C;;OAEG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB;CAG7C;AAmBD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAItD;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAI7D"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/hdwallet.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/hdwallet.js deleted file mode 100644 index c18f5021..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/hdwallet.js +++ /dev/null @@ -1,506 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getIndexedAccountPath = exports.getAccountPath = exports.HDNodeVoidWallet = exports.HDNodeWallet = exports.defaultPath = void 0; -/** - * Explain HD Wallets.. - * - * @_subsection: api/wallet:HD Wallets [hd-wallets] - */ -const index_js_1 = require("../crypto/index.js"); -const index_js_2 = require("../providers/index.js"); -const index_js_3 = require("../transaction/index.js"); -const index_js_4 = require("../utils/index.js"); -const lang_en_js_1 = require("../wordlists/lang-en.js"); -const base_wallet_js_1 = require("./base-wallet.js"); -const mnemonic_js_1 = require("./mnemonic.js"); -const json_keystore_js_1 = require("./json-keystore.js"); -/** - * The default derivation path for Ethereum HD Nodes. (i.e. ``"m/44'/60'/0'/0/0"``) - */ -exports.defaultPath = "m/44'/60'/0'/0/0"; -// "Bitcoin seed" -const MasterSecret = new Uint8Array([66, 105, 116, 99, 111, 105, 110, 32, 115, 101, 101, 100]); -const HardenedBit = 0x80000000; -const N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); -const Nibbles = "0123456789abcdef"; -function zpad(value, length) { - let result = ""; - while (value) { - result = Nibbles[value % 16] + result; - value = Math.trunc(value / 16); - } - while (result.length < length * 2) { - result = "0" + result; - } - return "0x" + result; -} -function encodeBase58Check(_value) { - const value = (0, index_js_4.getBytes)(_value); - const check = (0, index_js_4.dataSlice)((0, index_js_1.sha256)((0, index_js_1.sha256)(value)), 0, 4); - const bytes = (0, index_js_4.concat)([value, check]); - return (0, index_js_4.encodeBase58)(bytes); -} -const _guard = {}; -function ser_I(index, chainCode, publicKey, privateKey) { - const data = new Uint8Array(37); - if (index & HardenedBit) { - (0, index_js_4.assert)(privateKey != null, "cannot derive child of neutered node", "UNSUPPORTED_OPERATION", { - operation: "deriveChild" - }); - // Data = 0x00 || ser_256(k_par) - data.set((0, index_js_4.getBytes)(privateKey), 1); - } - else { - // Data = ser_p(point(k_par)) - data.set((0, index_js_4.getBytes)(publicKey)); - } - // Data += ser_32(i) - for (let i = 24; i >= 0; i -= 8) { - data[33 + (i >> 3)] = ((index >> (24 - i)) & 0xff); - } - const I = (0, index_js_4.getBytes)((0, index_js_1.computeHmac)("sha512", chainCode, data)); - return { IL: I.slice(0, 32), IR: I.slice(32) }; -} -function derivePath(node, path) { - const components = path.split("/"); - (0, index_js_4.assertArgument)(components.length > 0, "invalid path", "path", path); - if (components[0] === "m") { - (0, index_js_4.assertArgument)(node.depth === 0, `cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${node.depth}`, "path", path); - components.shift(); - } - let result = node; - for (let i = 0; i < components.length; i++) { - const component = components[i]; - if (component.match(/^[0-9]+'$/)) { - const index = parseInt(component.substring(0, component.length - 1)); - (0, index_js_4.assertArgument)(index < HardenedBit, "invalid path index", `path[${i}]`, component); - result = result.deriveChild(HardenedBit + index); - } - else if (component.match(/^[0-9]+$/)) { - const index = parseInt(component); - (0, index_js_4.assertArgument)(index < HardenedBit, "invalid path index", `path[${i}]`, component); - result = result.deriveChild(index); - } - else { - (0, index_js_4.assertArgument)(false, "invalid path component", `path[${i}]`, component); - } - } - return result; -} -/** - * An **HDNodeWallet** is a [[Signer]] backed by the private key derived - * from an HD Node using the [[link-bip-32]] stantard. - * - * An HD Node forms a hierarchal structure with each HD Node having a - * private key and the ability to derive child HD Nodes, defined by - * a path indicating the index of each child. - */ -class HDNodeWallet extends base_wallet_js_1.BaseWallet { - /** - * The compressed public key. - */ - publicKey; - /** - * The fingerprint. - * - * A fingerprint allows quick qay to detect parent and child nodes, - * but developers should be prepared to deal with collisions as it - * is only 4 bytes. - */ - fingerprint; - /** - * The parent fingerprint. - */ - parentFingerprint; - /** - * The mnemonic used to create this HD Node, if available. - * - * Sources such as extended keys do not encode the mnemonic, in - * which case this will be ``null``. - */ - mnemonic; - /** - * The chaincode, which is effectively a public key used - * to derive children. - */ - chainCode; - /** - * The derivation path of this wallet. - * - * Since extended keys do not provide full path details, this - * may be ``null``, if instantiated from a source that does not - * encode it. - */ - path; - /** - * The child index of this wallet. Values over ``2 *\* 31`` indicate - * the node is hardened. - */ - index; - /** - * The depth of this wallet, which is the number of components - * in its path. - */ - depth; - /** - * @private - */ - constructor(guard, signingKey, parentFingerprint, chainCode, path, index, depth, mnemonic, provider) { - super(signingKey, provider); - (0, index_js_4.assertPrivate)(guard, _guard, "HDNodeWallet"); - (0, index_js_4.defineProperties)(this, { publicKey: signingKey.compressedPublicKey }); - const fingerprint = (0, index_js_4.dataSlice)((0, index_js_1.ripemd160)((0, index_js_1.sha256)(this.publicKey)), 0, 4); - (0, index_js_4.defineProperties)(this, { - parentFingerprint, fingerprint, - chainCode, path, index, depth - }); - (0, index_js_4.defineProperties)(this, { mnemonic }); - } - connect(provider) { - return new HDNodeWallet(_guard, this.signingKey, this.parentFingerprint, this.chainCode, this.path, this.index, this.depth, this.mnemonic, provider); - } - #account() { - const account = { address: this.address, privateKey: this.privateKey }; - const m = this.mnemonic; - if (this.path && m && m.wordlist.locale === "en" && m.password === "") { - account.mnemonic = { - path: this.path, - locale: "en", - entropy: m.entropy - }; - } - return account; - } - /** - * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with - * %%password%%. - * - * If %%progressCallback%% is specified, it will receive periodic - * updates as the encryption process progreses. - */ - async encrypt(password, progressCallback) { - return await (0, json_keystore_js_1.encryptKeystoreJson)(this.#account(), password, { progressCallback }); - } - /** - * Returns a [JSON Keystore Wallet](json-wallets) encryped with - * %%password%%. - * - * It is preferred to use the [async version](encrypt) instead, - * which allows a [[ProgressCallback]] to keep the user informed. - * - * This method will block the event loop (freezing all UI) until - * it is complete, which may be a non-trivial duration. - */ - encryptSync(password) { - return (0, json_keystore_js_1.encryptKeystoreJsonSync)(this.#account(), password); - } - /** - * The extended key. - * - * This key will begin with the prefix ``xpriv`` and can be used to - * reconstruct this HD Node to derive its children. - */ - get extendedKey() { - // We only support the mainnet values for now, but if anyone needs - // testnet values, let me know. I believe current sentiment is that - // we should always use mainnet, and use BIP-44 to derive the network - // - Mainnet: public=0x0488B21E, private=0x0488ADE4 - // - Testnet: public=0x043587CF, private=0x04358394 - (0, index_js_4.assert)(this.depth < 256, "Depth too deep", "UNSUPPORTED_OPERATION", { operation: "extendedKey" }); - return encodeBase58Check((0, index_js_4.concat)([ - "0x0488ADE4", zpad(this.depth, 1), this.parentFingerprint, - zpad(this.index, 4), this.chainCode, - (0, index_js_4.concat)(["0x00", this.privateKey]) - ])); - } - /** - * Returns true if this wallet has a path, providing a Type Guard - * that the path is non-null. - */ - hasPath() { return (this.path != null); } - /** - * Returns a neutered HD Node, which removes the private details - * of an HD Node. - * - * A neutered node has no private key, but can be used to derive - * child addresses and other public data about the HD Node. - */ - neuter() { - return new HDNodeVoidWallet(_guard, this.address, this.publicKey, this.parentFingerprint, this.chainCode, this.path, this.index, this.depth, this.provider); - } - /** - * Return the child for %%index%%. - */ - deriveChild(_index) { - const index = (0, index_js_4.getNumber)(_index, "index"); - (0, index_js_4.assertArgument)(index <= 0xffffffff, "invalid index", "index", index); - // Base path - let path = this.path; - if (path) { - path += "/" + (index & ~HardenedBit); - if (index & HardenedBit) { - path += "'"; - } - } - const { IR, IL } = ser_I(index, this.chainCode, this.publicKey, this.privateKey); - const ki = new index_js_1.SigningKey((0, index_js_4.toBeHex)(((0, index_js_4.toBigInt)(IL) + BigInt(this.privateKey)) % N, 32)); - return new HDNodeWallet(_guard, ki, this.fingerprint, (0, index_js_4.hexlify)(IR), path, index, this.depth + 1, this.mnemonic, this.provider); - } - /** - * Return the HDNode for %%path%% from this node. - */ - derivePath(path) { - return derivePath(this, path); - } - static #fromSeed(_seed, mnemonic) { - (0, index_js_4.assertArgument)((0, index_js_4.isBytesLike)(_seed), "invalid seed", "seed", "[REDACTED]"); - const seed = (0, index_js_4.getBytes)(_seed, "seed"); - (0, index_js_4.assertArgument)(seed.length >= 16 && seed.length <= 64, "invalid seed", "seed", "[REDACTED]"); - const I = (0, index_js_4.getBytes)((0, index_js_1.computeHmac)("sha512", MasterSecret, seed)); - const signingKey = new index_js_1.SigningKey((0, index_js_4.hexlify)(I.slice(0, 32))); - return new HDNodeWallet(_guard, signingKey, "0x00000000", (0, index_js_4.hexlify)(I.slice(32)), "m", 0, 0, mnemonic, null); - } - /** - * Creates a new HD Node from %%extendedKey%%. - * - * If the %%extendedKey%% will either have a prefix or ``xpub`` or - * ``xpriv``, returning a neutered HD Node ([[HDNodeVoidWallet]]) - * or full HD Node ([[HDNodeWallet) respectively. - */ - static fromExtendedKey(extendedKey) { - const bytes = (0, index_js_4.toBeArray)((0, index_js_4.decodeBase58)(extendedKey)); // @TODO: redact - (0, index_js_4.assertArgument)(bytes.length === 82 || encodeBase58Check(bytes.slice(0, 78)) === extendedKey, "invalid extended key", "extendedKey", "[ REDACTED ]"); - const depth = bytes[4]; - const parentFingerprint = (0, index_js_4.hexlify)(bytes.slice(5, 9)); - const index = parseInt((0, index_js_4.hexlify)(bytes.slice(9, 13)).substring(2), 16); - const chainCode = (0, index_js_4.hexlify)(bytes.slice(13, 45)); - const key = bytes.slice(45, 78); - switch ((0, index_js_4.hexlify)(bytes.slice(0, 4))) { - // Public Key - case "0x0488b21e": - case "0x043587cf": { - const publicKey = (0, index_js_4.hexlify)(key); - return new HDNodeVoidWallet(_guard, (0, index_js_3.computeAddress)(publicKey), publicKey, parentFingerprint, chainCode, null, index, depth, null); - } - // Private Key - case "0x0488ade4": - case "0x04358394 ": - if (key[0] !== 0) { - break; - } - return new HDNodeWallet(_guard, new index_js_1.SigningKey(key.slice(1)), parentFingerprint, chainCode, null, index, depth, null, null); - } - (0, index_js_4.assertArgument)(false, "invalid extended key prefix", "extendedKey", "[ REDACTED ]"); - } - /** - * Creates a new random HDNode. - */ - static createRandom(password, path, wordlist) { - if (password == null) { - password = ""; - } - if (path == null) { - path = exports.defaultPath; - } - if (wordlist == null) { - wordlist = lang_en_js_1.LangEn.wordlist(); - } - const mnemonic = mnemonic_js_1.Mnemonic.fromEntropy((0, index_js_1.randomBytes)(16), password, wordlist); - return HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path); - } - /** - * Create an HD Node from %%mnemonic%%. - */ - static fromMnemonic(mnemonic, path) { - if (!path) { - path = exports.defaultPath; - } - return HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path); - } - /** - * Creates an HD Node from a mnemonic %%phrase%%. - */ - static fromPhrase(phrase, password, path, wordlist) { - if (password == null) { - password = ""; - } - if (path == null) { - path = exports.defaultPath; - } - if (wordlist == null) { - wordlist = lang_en_js_1.LangEn.wordlist(); - } - const mnemonic = mnemonic_js_1.Mnemonic.fromPhrase(phrase, password, wordlist); - return HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path); - } - /** - * Creates an HD Node from a %%seed%%. - */ - static fromSeed(seed) { - return HDNodeWallet.#fromSeed(seed, null); - } -} -exports.HDNodeWallet = HDNodeWallet; -/** - * A **HDNodeVoidWallet** cannot sign, but provides access to - * the children nodes of a [[link-bip-32]] HD wallet addresses. - * - * The can be created by using an extended ``xpub`` key to - * [[HDNodeWallet_fromExtendedKey]] or by - * [nuetering](HDNodeWallet-neuter) a [[HDNodeWallet]]. - */ -class HDNodeVoidWallet extends index_js_2.VoidSigner { - /** - * The compressed public key. - */ - publicKey; - /** - * The fingerprint. - * - * A fingerprint allows quick qay to detect parent and child nodes, - * but developers should be prepared to deal with collisions as it - * is only 4 bytes. - */ - fingerprint; - /** - * The parent node fingerprint. - */ - parentFingerprint; - /** - * The chaincode, which is effectively a public key used - * to derive children. - */ - chainCode; - /** - * The derivation path of this wallet. - * - * Since extended keys do not provider full path details, this - * may be ``null``, if instantiated from a source that does not - * enocde it. - */ - path; - /** - * The child index of this wallet. Values over ``2 *\* 31`` indicate - * the node is hardened. - */ - index; - /** - * The depth of this wallet, which is the number of components - * in its path. - */ - depth; - /** - * @private - */ - constructor(guard, address, publicKey, parentFingerprint, chainCode, path, index, depth, provider) { - super(address, provider); - (0, index_js_4.assertPrivate)(guard, _guard, "HDNodeVoidWallet"); - (0, index_js_4.defineProperties)(this, { publicKey }); - const fingerprint = (0, index_js_4.dataSlice)((0, index_js_1.ripemd160)((0, index_js_1.sha256)(publicKey)), 0, 4); - (0, index_js_4.defineProperties)(this, { - publicKey, fingerprint, parentFingerprint, chainCode, path, index, depth - }); - } - connect(provider) { - return new HDNodeVoidWallet(_guard, this.address, this.publicKey, this.parentFingerprint, this.chainCode, this.path, this.index, this.depth, provider); - } - /** - * The extended key. - * - * This key will begin with the prefix ``xpub`` and can be used to - * reconstruct this neutered key to derive its children addresses. - */ - get extendedKey() { - // We only support the mainnet values for now, but if anyone needs - // testnet values, let me know. I believe current sentiment is that - // we should always use mainnet, and use BIP-44 to derive the network - // - Mainnet: public=0x0488B21E, private=0x0488ADE4 - // - Testnet: public=0x043587CF, private=0x04358394 - (0, index_js_4.assert)(this.depth < 256, "Depth too deep", "UNSUPPORTED_OPERATION", { operation: "extendedKey" }); - return encodeBase58Check((0, index_js_4.concat)([ - "0x0488B21E", - zpad(this.depth, 1), - this.parentFingerprint, - zpad(this.index, 4), - this.chainCode, - this.publicKey, - ])); - } - /** - * Returns true if this wallet has a path, providing a Type Guard - * that the path is non-null. - */ - hasPath() { return (this.path != null); } - /** - * Return the child for %%index%%. - */ - deriveChild(_index) { - const index = (0, index_js_4.getNumber)(_index, "index"); - (0, index_js_4.assertArgument)(index <= 0xffffffff, "invalid index", "index", index); - // Base path - let path = this.path; - if (path) { - path += "/" + (index & ~HardenedBit); - if (index & HardenedBit) { - path += "'"; - } - } - const { IR, IL } = ser_I(index, this.chainCode, this.publicKey, null); - const Ki = index_js_1.SigningKey.addPoints(IL, this.publicKey, true); - const address = (0, index_js_3.computeAddress)(Ki); - return new HDNodeVoidWallet(_guard, address, Ki, this.fingerprint, (0, index_js_4.hexlify)(IR), path, index, this.depth + 1, this.provider); - } - /** - * Return the signer for %%path%% from this node. - */ - derivePath(path) { - return derivePath(this, path); - } -} -exports.HDNodeVoidWallet = HDNodeVoidWallet; -/* -export class HDNodeWalletManager { - #root: HDNodeWallet; - - constructor(phrase: string, password?: null | string, path?: null | string, locale?: null | Wordlist) { - if (password == null) { password = ""; } - if (path == null) { path = "m/44'/60'/0'/0"; } - if (locale == null) { locale = LangEn.wordlist(); } - this.#root = HDNodeWallet.fromPhrase(phrase, password, path, locale); - } - - getSigner(index?: number): HDNodeWallet { - return this.#root.deriveChild((index == null) ? 0: index); - } -} -*/ -/** - * Returns the [[link-bip-32]] path for the account at %%index%%. - * - * This is the pattern used by wallets like Ledger. - * - * There is also an [alternate pattern](getIndexedAccountPath) used by - * some software. - */ -function getAccountPath(_index) { - const index = (0, index_js_4.getNumber)(_index, "index"); - (0, index_js_4.assertArgument)(index >= 0 && index < HardenedBit, "invalid account index", "index", index); - return `m/44'/60'/${index}'/0/0`; -} -exports.getAccountPath = getAccountPath; -/** - * Returns the path using an alternative pattern for deriving accounts, - * at %%index%%. - * - * This derivation path uses the //index// component rather than the - * //account// component to derive sequential accounts. - * - * This is the pattern used by wallets like MetaMask. - */ -function getIndexedAccountPath(_index) { - const index = (0, index_js_4.getNumber)(_index, "index"); - (0, index_js_4.assertArgument)(index >= 0 && index < HardenedBit, "invalid account index", "index", index); - return `m/44'/60'/0'/0/${index}`; -} -exports.getIndexedAccountPath = getIndexedAccountPath; -//# sourceMappingURL=hdwallet.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/hdwallet.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/hdwallet.js.map deleted file mode 100644 index 072a7dad..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/hdwallet.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hdwallet.js","sourceRoot":"","sources":["../../src.ts/wallet/hdwallet.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,iDAA6F;AAC7F,oDAAmD;AACnD,sDAAyD;AACzD,gDAK2B;AAC3B,wDAAiD;AAEjD,qDAA8C;AAC9C,+CAAyC;AACzC,yDAE4B;AAS5B;;GAEG;AACU,QAAA,WAAW,GAAW,kBAAkB,CAAC;AAGtD,iBAAiB;AACjB,MAAM,YAAY,GAAG,IAAI,UAAU,CAAC,CAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAE,CAAC,CAAC;AAEjG,MAAM,WAAW,GAAG,UAAU,CAAC;AAE/B,MAAM,CAAC,GAAG,MAAM,CAAC,oEAAoE,CAAC,CAAC;AAEvF,MAAM,OAAO,GAAG,kBAAkB,CAAC;AACnC,SAAS,IAAI,CAAC,KAAa,EAAE,MAAc;IACvC,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,OAAO,KAAK,EAAE;QACV,MAAM,GAAG,OAAO,CAAC,KAAK,GAAG,EAAE,CAAC,GAAG,M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BAAuB,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IAC3F,OAAO,kBAAmB,KAAK,EAAE,CAAC;AACtC,CAAC;AAJD,sDAIC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/index.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/index.d.ts deleted file mode 100644 index 8156435f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/index.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -/** - * When interacting with Ethereum, it is necessary to use a private - * key authenticate actions by signing a payload. - * - * Wallets are the simplest way to expose the concept of an - * //Externally Owner Account// (EOA) as it wraps a private key - * and supports high-level methods to sign common types of interaction - * and send transactions. - * - * The class most developers will want to use is [[Wallet]], which - * can load a private key directly or from any common wallet format. - * - * The [[HDNodeWallet]] can be used when it is necessary to access - * low-level details of how an HD wallets are derived, exported - * or imported. - * - * @_section: api/wallet:Wallets [about-wallets] - */ -export { BaseWallet } from "./base-wallet.js"; -export { defaultPath, getAccountPath, getIndexedAccountPath, HDNodeWallet, HDNodeVoidWallet, } from "./hdwallet.js"; -export { isCrowdsaleJson, decryptCrowdsaleJson } from "./json-crowdsale.js"; -export { isKeystoreJson, decryptKeystoreJsonSync, decryptKeystoreJson, encryptKeystoreJson, encryptKeystoreJsonSync } from "./json-keystore.js"; -export { Mnemonic } from "./mnemonic.js"; -export { Wallet } from "./wallet.js"; -export type { CrowdsaleAccount } from "./json-crowdsale.js"; -export type { KeystoreAccount, EncryptOptions } from "./json-keystore.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/index.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/index.d.ts.map deleted file mode 100644 index 707d088f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EACH,WAAW,EAEX,cAAc,EAAE,qBAAqB,EAErC,YAAY,EACZ,gBAAgB,GACnB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,OAAO,EACH,cAAc,EACd,uBAAuB,EAAE,mBAAmB,EAC5C,mBAAmB,EAAE,uBAAuB,EAC/C,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,YAAY,EACR,eAAe,EAAE,cAAc,EAClC,MAAM,oBAAoB,CAAA"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/index.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/index.js deleted file mode 100644 index 1cfe56c9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/index.js +++ /dev/null @@ -1,43 +0,0 @@ -"use strict"; -/** - * When interacting with Ethereum, it is necessary to use a private - * key authenticate actions by signing a payload. - * - * Wallets are the simplest way to expose the concept of an - * //Externally Owner Account// (EOA) as it wraps a private key - * and supports high-level methods to sign common types of interaction - * and send transactions. - * - * The class most developers will want to use is [[Wallet]], which - * can load a private key directly or from any common wallet format. - * - * The [[HDNodeWallet]] can be used when it is necessary to access - * low-level details of how an HD wallets are derived, exported - * or imported. - * - * @_section: api/wallet:Wallets [about-wallets] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Wallet = exports.Mnemonic = exports.encryptKeystoreJsonSync = exports.encryptKeystoreJson = exports.decryptKeystoreJson = exports.decryptKeystoreJsonSync = exports.isKeystoreJson = exports.decryptCrowdsaleJson = exports.isCrowdsaleJson = exports.HDNodeVoidWallet = exports.HDNodeWallet = exports.getIndexedAccountPath = exports.getAccountPath = exports.defaultPath = exports.BaseWallet = void 0; -var base_wallet_js_1 = require("./base-wallet.js"); -Object.defineProperty(exports, "BaseWallet", { enumerable: true, get: function () { return base_wallet_js_1.BaseWallet; } }); -var hdwallet_js_1 = require("./hdwallet.js"); -Object.defineProperty(exports, "defaultPath", { enumerable: true, get: function () { return hdwallet_js_1.defaultPath; } }); -Object.defineProperty(exports, "getAccountPath", { enumerable: true, get: function () { return hdwallet_js_1.getAccountPath; } }); -Object.defineProperty(exports, "getIndexedAccountPath", { enumerable: true, get: function () { return hdwallet_js_1.getIndexedAccountPath; } }); -Object.defineProperty(exports, "HDNodeWallet", { enumerable: true, get: function () { return hdwallet_js_1.HDNodeWallet; } }); -Object.defineProperty(exports, "HDNodeVoidWallet", { enumerable: true, get: function () { return hdwallet_js_1.HDNodeVoidWallet; } }); -var json_crowdsale_js_1 = require("./json-crowdsale.js"); -Object.defineProperty(exports, "isCrowdsaleJson", { enumerable: true, get: function () { return json_crowdsale_js_1.isCrowdsaleJson; } }); -Object.defineProperty(exports, "decryptCrowdsaleJson", { enumerable: true, get: function () { return json_crowdsale_js_1.decryptCrowdsaleJson; } }); -var json_keystore_js_1 = require("./json-keystore.js"); -Object.defineProperty(exports, "isKeystoreJson", { enumerable: true, get: function () { return json_keystore_js_1.isKeystoreJson; } }); -Object.defineProperty(exports, "decryptKeystoreJsonSync", { enumerable: true, get: function () { return json_keystore_js_1.decryptKeystoreJsonSync; } }); -Object.defineProperty(exports, "decryptKeystoreJson", { enumerable: true, get: function () { return json_keystore_js_1.decryptKeystoreJson; } }); -Object.defineProperty(exports, "encryptKeystoreJson", { enumerable: true, get: function () { return json_keystore_js_1.encryptKeystoreJson; } }); -Object.defineProperty(exports, "encryptKeystoreJsonSync", { enumerable: true, get: function () { return json_keystore_js_1.encryptKeystoreJsonSync; } }); -var mnemonic_js_1 = require("./mnemonic.js"); -Object.defineProperty(exports, "Mnemonic", { enumerable: true, get: function () { return mnemonic_js_1.Mnemonic; } }); -var wallet_js_1 = require("./wallet.js"); -Object.defineProperty(exports, "Wallet", { enumerable: true, get: function () { return wallet_js_1.Wallet; } }); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/index.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/index.js.map deleted file mode 100644 index b6c1d2e5..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/wallet/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AAEH,mDAA8C;AAArC,4GAAA,UAAU,OAAA;AAEnB,6CAOuB;AANnB,0GAAA,WAAW,OAAA;AAEX,6GAAA,cAAc,OAAA;AAAE,oHAAA,qBAAqB,OAAA;AAErC,2GAAA,YAAY,OAAA;AACZ,+GAAA,gBAAgB,OAAA;AAGpB,yDAA4E;AAAnE,oHAAA,eAAe,OAAA;AAAE,yHAAA,oBAAoB,OAAA;AAE9C,uDAI4B;AAHxB,kHAAA,cAAc,OAAA;AACd,2HAAA,uBAAuB,OAAA;AAAE,uHAAA,mBAAmB,OAAA;AAC5C,uHAAA,mBAAmB,OAAA;AAAE,2HAAA,uBAAuB,OAAA;AAGhD,6CAAyC;AAAhC,uGAAA,QAAQ,OAAA;AAEjB,yCAAqC;AAA5B,mGAAA,MAAM,OAAA"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/json-crowdsale.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/json-crowdsale.d.ts deleted file mode 100644 index 3d7f4a2b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/json-crowdsale.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @_subsection: api/wallet:JSON Wallets [json-wallets] - */ -/** - * The data stored within a JSON Crowdsale wallet is fairly - * minimal. - */ -export type CrowdsaleAccount = { - privateKey: string; - address: string; -}; -/** - * Returns true if %%json%% is a valid JSON Crowdsale wallet. - */ -export declare function isCrowdsaleJson(json: string): boolean; -/** - * Before Ethereum launched, it was necessary to create a wallet - * format for backers to use, which would be used to receive ether - * as a reward for contributing to the project. - * - * The [[link-crowdsale]] format is now obsolete, but it is still - * useful to support and the additional code is fairly trivial as - * all the primitives required are used through core portions of - * the library. - */ -export declare function decryptCrowdsaleJson(json: string, _password: string | Uint8Array): CrowdsaleAccount; -//# sourceMappingURL=json-crowdsale.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/json-crowdsale.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/json-crowdsale.d.ts.map deleted file mode 100644 index a569abcd..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/json-crowdsale.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"json-crowdsale.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/json-crowdsale.ts"],"names":[],"mappings":"AAAA;;GAEG;AAYH;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACnB,CAAA;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAMrD;AAID;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,UAAU,GAAG,gBAAgB,CA2BnG"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/json-crowdsale.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/json-crowdsale.js deleted file mode 100644 index 7dfa761a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/json-crowdsale.js +++ /dev/null @@ -1,60 +0,0 @@ -"use strict"; -/** - * @_subsection: api/wallet:JSON Wallets [json-wallets] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.decryptCrowdsaleJson = exports.isCrowdsaleJson = void 0; -const aes_js_1 = require("aes-js"); -const index_js_1 = require("../address/index.js"); -const index_js_2 = require("../crypto/index.js"); -const index_js_3 = require("../hash/index.js"); -const index_js_4 = require("../utils/index.js"); -const utils_js_1 = require("./utils.js"); -/** - * Returns true if %%json%% is a valid JSON Crowdsale wallet. - */ -function isCrowdsaleJson(json) { - try { - const data = JSON.parse(json); - if (data.encseed) { - return true; - } - } - catch (error) { } - return false; -} -exports.isCrowdsaleJson = isCrowdsaleJson; -// See: https://github.com/ethereum/pyethsaletool -/** - * Before Ethereum launched, it was necessary to create a wallet - * format for backers to use, which would be used to receive ether - * as a reward for contributing to the project. - * - * The [[link-crowdsale]] format is now obsolete, but it is still - * useful to support and the additional code is fairly trivial as - * all the primitives required are used through core portions of - * the library. - */ -function decryptCrowdsaleJson(json, _password) { - const data = JSON.parse(json); - const password = (0, utils_js_1.getPassword)(_password); - // Ethereum Address - const address = (0, index_js_1.getAddress)((0, utils_js_1.spelunk)(data, "ethaddr:string!")); - // Encrypted Seed - const encseed = (0, utils_js_1.looseArrayify)((0, utils_js_1.spelunk)(data, "encseed:string!")); - (0, index_js_4.assertArgument)(encseed && (encseed.length % 16) === 0, "invalid encseed", "json", json); - const key = (0, index_js_4.getBytes)((0, index_js_2.pbkdf2)(password, password, 2000, 32, "sha256")).slice(0, 16); - const iv = encseed.slice(0, 16); - const encryptedSeed = encseed.slice(16); - // Decrypt the seed - const aesCbc = new aes_js_1.CBC(key, iv); - const seed = (0, aes_js_1.pkcs7Strip)((0, index_js_4.getBytes)(aesCbc.decrypt(encryptedSeed))); - // This wallet format is weird... Convert the binary encoded hex to a string. - let seedHex = ""; - for (let i = 0; i < seed.length; i++) { - seedHex += String.fromCharCode(seed[i]); - } - return { address, privateKey: (0, index_js_3.id)(seedHex) }; -} -exports.decryptCrowdsaleJson = decryptCrowdsaleJson; -//# sourceMappingURL=json-crowdsale.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/json-crowdsale.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/json-crowdsale.js.map deleted file mode 100644 index b8c8d8b6..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/json-crowdsale.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"json-crowdsale.js","sourceRoot":"","sources":["../../src.ts/wallet/json-crowdsale.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,mCAAyC;AAEzC,kDAAiD;AACjD,iDAA4C;AAC5C,+CAAsC;AACtC,gDAA6D;AAE7D,yCAAiE;AAYjE;;GAEG;AACH,SAAgB,eAAe,CAAC,IAAY;IACxC,IAAI;QACA,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC9B,IAAI,IAAI,CAAC,OAAO,EAAE;YAAE,OAAO,IAAI,CAAC;SAAE;KACrC;IAAC,OAAO,KAAK,EAAE,GAAG;IACnB,OAAO,KAAK,CAAC;AACjB,CAAC;AAND,0CAMC;AAED,iDAAiD;AAEjD;;;;;;;;;GASG;AACH,SAAgB,oBAAoB,CAAC,IAAY,EAAE,SAA8B;IAC7E,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC9B,MAAM,QAAQ,GAAG,IAAA,sBAAW,EAAC,SAAS,CAAC,CAAC;IAExC,mBAAmB;IACnB,MAAM,OAAO,GAAG,IAAA,qBAAU,EAAC,IAAA,kBAAO,EAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAE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onjs/wallet/json-keystore.d.ts deleted file mode 100644 index c01076fe..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/json-keystore.d.ts +++ /dev/null @@ -1,89 +0,0 @@ -/** - * The JSON Wallet formats allow a simple way to store the private - * keys needed in Ethereum along with related information and allows - * for extensible forms of encryption. - * - * These utilities facilitate decrypting and encrypting the most common - * JSON Wallet formats. - * - * @_subsection: api/wallet:JSON Wallets [json-wallets] - */ -import type { ProgressCallback } from "../crypto/index.js"; -import type { BytesLike } from "../utils/index.js"; -/** - * The contents of a JSON Keystore Wallet. - */ -export type KeystoreAccount = { - address: string; - privateKey: string; - mnemonic?: { - path?: string; - locale?: string; - entropy: string; - }; -}; -/** - * The parameters to use when encrypting a JSON Keystore Wallet. - */ -export type EncryptOptions = { - progressCallback?: ProgressCallback; - iv?: BytesLike; - entropy?: BytesLike; - client?: string; - salt?: BytesLike; - uuid?: string; - scrypt?: { - N?: number; - r?: number; - p?: number; - }; -}; -/** - * Returns true if %%json%% is a valid JSON Keystore Wallet. - */ -export declare function isKeystoreJson(json: string): boolean; -/** - * Returns the account details for the JSON Keystore Wallet %%json%% - * using %%password%%. - * - * It is preferred to use the [async version](decryptKeystoreJson) - * instead, which allows a [[ProgressCallback]] to keep the user informed - * as to the decryption status. - * - * This method will block the event loop (freezing all UI) until decryption - * is complete, which can take quite some time, depending on the wallet - * paramters and platform. - */ -export declare function decryptKeystoreJsonSync(json: string, _password: string | Uint8Array): KeystoreAccount; -/** - * Resolves to the decrypted JSON Keystore Wallet %%json%% using the - * %%password%%. - * - * If provided, %%progress%% will be called periodically during the - * decrpytion to provide feedback, and if the function returns - * ``false`` will halt decryption. - * - * The %%progressCallback%% will **always** receive ``0`` before - * decryption begins and ``1`` when complete. - */ -export declare function decryptKeystoreJson(json: string, _password: string | Uint8Array, progress?: ProgressCallback): Promise; -/** - * Return the JSON Keystore Wallet for %%account%% encrypted with - * %%password%%. - * - * The %%options%% can be used to tune the password-based key - * derivation function parameters, explicitly set the random values - * used. Any provided [[ProgressCallback]] is ignord. - */ -export declare function encryptKeystoreJsonSync(account: KeystoreAccount, password: string | Uint8Array, options?: EncryptOptions): string; -/** - * Resolved to the JSON Keystore Wallet for %%account%% encrypted - * with %%password%%. - * - * The %%options%% can be used to tune the password-based key - * derivation function parameters, explicitly set the random values - * used and provide a [[ProgressCallback]] to receive periodic updates - * on the completion status.. - */ -export declare function encryptKeystoreJson(account: KeystoreAccount, password: string | Uint8Array, options?: EncryptOptions): Promise; -//# sourceMappingURL=json-keystore.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/json-keystore.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/json-keystore.d.ts.map deleted file mode 100644 index 2ce64555..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/json-keystore.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"json-keystore.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/json-keystore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAaH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAOnD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE;QACP,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KACnB,CAAA;CACJ,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC1B,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,EAAE,CAAC,EAAE,SAAS,CAAC;IACf,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE;QACL,CAAC,CAAC,EAAE,MAAM,CAAC;QACX,CAAC,CAAC,EAAE,MAAM,CAAC;QACX,CAAC,CAAC,EAAE,MAAM,CAAC;KACd,CAAA;CACH,CAAA;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAOpD;AA+GD;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,UAAU,GAAG,eAAe,CAiBrG;AAMD;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,UAAU,EAAE,QAAQ,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC,CAyB7I;AAsGD;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,GAAG,UAAU,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,MAAM,CAOjI;AAED;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,GAAG,UAAU,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAO5I"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/json-keystore.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/json-keystore.js deleted file mode 100644 index 582e7c73..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/json-keystore.js +++ /dev/null @@ -1,295 +0,0 @@ -"use strict"; -/** - * The JSON Wallet formats allow a simple way to store the private - * keys needed in Ethereum along with related information and allows - * for extensible forms of encryption. - * - * These utilities facilitate decrypting and encrypting the most common - * JSON Wallet formats. - * - * @_subsection: api/wallet:JSON Wallets [json-wallets] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.encryptKeystoreJson = exports.encryptKeystoreJsonSync = exports.decryptKeystoreJson = exports.decryptKeystoreJsonSync = exports.isKeystoreJson = void 0; -const aes_js_1 = require("aes-js"); -const index_js_1 = require("../address/index.js"); -const index_js_2 = require("../crypto/index.js"); -const index_js_3 = require("../transaction/index.js"); -const index_js_4 = require("../utils/index.js"); -const utils_js_1 = require("./utils.js"); -const _version_js_1 = require("../_version.js"); -const defaultPath = "m/44'/60'/0'/0/0"; -/** - * Returns true if %%json%% is a valid JSON Keystore Wallet. - */ -function isKeystoreJson(json) { - try { - const data = JSON.parse(json); - const version = ((data.version != null) ? parseInt(data.version) : 0); - if (version === 3) { - return true; - } - } - catch (error) { } - return false; -} -exports.isKeystoreJson = isKeystoreJson; -function decrypt(data, key, ciphertext) { - const cipher = (0, utils_js_1.spelunk)(data, "crypto.cipher:string"); - if (cipher === "aes-128-ctr") { - const iv = (0, utils_js_1.spelunk)(data, "crypto.cipherparams.iv:data!"); - const aesCtr = new aes_js_1.CTR(key, iv); - return (0, index_js_4.hexlify)(aesCtr.decrypt(ciphertext)); - } - (0, index_js_4.assert)(false, "unsupported cipher", "UNSUPPORTED_OPERATION", { - operation: "decrypt" - }); -} -function getAccount(data, _key) { - const key = (0, index_js_4.getBytes)(_key); - const ciphertext = (0, utils_js_1.spelunk)(data, "crypto.ciphertext:data!"); - const computedMAC = (0, index_js_4.hexlify)((0, index_js_2.keccak256)((0, index_js_4.concat)([key.slice(16, 32), ciphertext]))).substring(2); - (0, index_js_4.assertArgument)(computedMAC === (0, utils_js_1.spelunk)(data, "crypto.mac:string!").toLowerCase(), "incorrect password", "password", "[ REDACTED ]"); - const privateKey = decrypt(data, key.slice(0, 16), ciphertext); - const address = (0, index_js_3.computeAddress)(privateKey); - if (data.address) { - let check = data.address.toLowerCase(); - if (!check.startsWith("0x")) { - check = "0x" + check; - } - (0, index_js_4.assertArgument)((0, index_js_1.getAddress)(check) === address, "keystore address/privateKey mismatch", "address", data.address); - } - const account = { address, privateKey }; - // Version 0.1 x-ethers metadata must contain an encrypted mnemonic phrase - const version = (0, utils_js_1.spelunk)(data, "x-ethers.version:string"); - if (version === "0.1") { - const mnemonicKey = key.slice(32, 64); - const mnemonicCiphertext = (0, utils_js_1.spelunk)(data, "x-ethers.mnemonicCiphertext:data!"); - const mnemonicIv = (0, utils_js_1.spelunk)(data, "x-ethers.mnemonicCounter:data!"); - const mnemonicAesCtr = new aes_js_1.CTR(mnemonicKey, mnemonicIv); - account.mnemonic = { - path: ((0, utils_js_1.spelunk)(data, "x-ethers.path:string") || defaultPath), - locale: ((0, utils_js_1.spelunk)(data, "x-ethers.locale:string") || "en"), - entropy: (0, index_js_4.hexlify)((0, index_js_4.getBytes)(mnemonicAesCtr.decrypt(mnemonicCiphertext))) - }; - } - return account; -} -function getDecryptKdfParams(data) { - const kdf = (0, utils_js_1.spelunk)(data, "crypto.kdf:string"); - if (kdf && typeof (kdf) === "string") { - if (kdf.toLowerCase() === "scrypt") { - const salt = (0, utils_js_1.spelunk)(data, "crypto.kdfparams.salt:data!"); - const N = (0, utils_js_1.spelunk)(data, "crypto.kdfparams.n:int!"); - const r = (0, utils_js_1.spelunk)(data, "crypto.kdfparams.r:int!"); - const p = (0, utils_js_1.spelunk)(data, "crypto.kdfparams.p:int!"); - // Make sure N is a power of 2 - (0, index_js_4.assertArgument)(N > 0 && (N & (N - 1)) === 0, "invalid kdf.N", "kdf.N", N); - (0, index_js_4.assertArgument)(r > 0 && p > 0, "invalid kdf", "kdf", kdf); - const dkLen = (0, utils_js_1.spelunk)(data, "crypto.kdfparams.dklen:int!"); - (0, index_js_4.assertArgument)(dkLen === 32, "invalid kdf.dklen", "kdf.dflen", dkLen); - return { name: "scrypt", salt, N, r, p, dkLen: 64 }; - } - else if (kdf.toLowerCase() === "pbkdf2") { - const salt = (0, utils_js_1.spelunk)(data, "crypto.kdfparams.salt:data!"); - const prf = (0, utils_js_1.spelunk)(data, "crypto.kdfparams.prf:string!"); - const algorithm = prf.split("-").pop(); - (0, index_js_4.assertArgument)(algorithm === "sha256" || algorithm === "sha512", "invalid kdf.pdf", "kdf.pdf", prf); - const count = (0, utils_js_1.spelunk)(data, "crypto.kdfparams.c:int!"); - const dkLen = (0, utils_js_1.spelunk)(data, "crypto.kdfparams.dklen:int!"); - (0, index_js_4.assertArgument)(dkLen === 32, "invalid kdf.dklen", "kdf.dklen", dkLen); - return { name: "pbkdf2", salt, count, dkLen, algorithm }; - } - } - (0, index_js_4.assertArgument)(false, "unsupported key-derivation function", "kdf", kdf); -} -/** - * Returns the account details for the JSON Keystore Wallet %%json%% - * using %%password%%. - * - * It is preferred to use the [async version](decryptKeystoreJson) - * instead, which allows a [[ProgressCallback]] to keep the user informed - * as to the decryption status. - * - * This method will block the event loop (freezing all UI) until decryption - * is complete, which can take quite some time, depending on the wallet - * paramters and platform. - */ -function decryptKeystoreJsonSync(json, _password) { - const data = JSON.parse(json); - const password = (0, utils_js_1.getPassword)(_password); - const params = getDecryptKdfParams(data); - if (params.name === "pbkdf2") { - const { salt, count, dkLen, algorithm } = params; - const key = (0, index_js_2.pbkdf2)(password, salt, count, dkLen, algorithm); - return getAccount(data, key); - } - (0, index_js_4.assert)(params.name === "scrypt", "cannot be reached", "UNKNOWN_ERROR", { params }); - const { salt, N, r, p, dkLen } = params; - const key = (0, index_js_2.scryptSync)(password, salt, N, r, p, dkLen); - return getAccount(data, key); -} -exports.decryptKeystoreJsonSync = decryptKeystoreJsonSync; -function stall(duration) { - return new Promise((resolve) => { setTimeout(() => { resolve(); }, duration); }); -} -/** - * Resolves to the decrypted JSON Keystore Wallet %%json%% using the - * %%password%%. - * - * If provided, %%progress%% will be called periodically during the - * decrpytion to provide feedback, and if the function returns - * ``false`` will halt decryption. - * - * The %%progressCallback%% will **always** receive ``0`` before - * decryption begins and ``1`` when complete. - */ -async function decryptKeystoreJson(json, _password, progress) { - const data = JSON.parse(json); - const password = (0, utils_js_1.getPassword)(_password); - const params = getDecryptKdfParams(data); - if (params.name === "pbkdf2") { - if (progress) { - progress(0); - await stall(0); - } - const { salt, count, dkLen, algorithm } = params; - const key = (0, index_js_2.pbkdf2)(password, salt, count, dkLen, algorithm); - if (progress) { - progress(1); - await stall(0); - } - return getAccount(data, key); - } - (0, index_js_4.assert)(params.name === "scrypt", "cannot be reached", "UNKNOWN_ERROR", { params }); - const { salt, N, r, p, dkLen } = params; - const key = await (0, index_js_2.scrypt)(password, salt, N, r, p, dkLen, progress); - return getAccount(data, key); -} -exports.decryptKeystoreJson = decryptKeystoreJson; -function getEncryptKdfParams(options) { - // Check/generate the salt - const salt = (options.salt != null) ? (0, index_js_4.getBytes)(options.salt, "options.salt") : (0, index_js_2.randomBytes)(32); - // Override the scrypt password-based key derivation function parameters - let N = (1 << 17), r = 8, p = 1; - if (options.scrypt) { - if (options.scrypt.N) { - N = options.scrypt.N; - } - if (options.scrypt.r) { - r = options.scrypt.r; - } - if (options.scrypt.p) { - p = options.scrypt.p; - } - } - (0, index_js_4.assertArgument)(typeof (N) === "number" && N > 0 && Number.isSafeInteger(N) && (BigInt(N) & BigInt(N - 1)) === BigInt(0), "invalid scrypt N parameter", "options.N", N); - (0, index_js_4.assertArgument)(typeof (r) === "number" && r > 0 && Number.isSafeInteger(r), "invalid scrypt r parameter", "options.r", r); - (0, index_js_4.assertArgument)(typeof (p) === "number" && p > 0 && Number.isSafeInteger(p), "invalid scrypt p parameter", "options.p", p); - return { name: "scrypt", dkLen: 32, salt, N, r, p }; -} -function _encryptKeystore(key, kdf, account, options) { - const privateKey = (0, index_js_4.getBytes)(account.privateKey, "privateKey"); - // Override initialization vector - const iv = (options.iv != null) ? (0, index_js_4.getBytes)(options.iv, "options.iv") : (0, index_js_2.randomBytes)(16); - (0, index_js_4.assertArgument)(iv.length === 16, "invalid options.iv length", "options.iv", options.iv); - // Override the uuid - const uuidRandom = (options.uuid != null) ? (0, index_js_4.getBytes)(options.uuid, "options.uuid") : (0, index_js_2.randomBytes)(16); - (0, index_js_4.assertArgument)(uuidRandom.length === 16, "invalid options.uuid length", "options.uuid", options.iv); - // This will be used to encrypt the wallet (as per Web3 secret storage) - // - 32 bytes As normal for the Web3 secret storage (derivedKey, macPrefix) - // - 32 bytes AES key to encrypt mnemonic with (required here to be Ethers Wallet) - const derivedKey = key.slice(0, 16); - const macPrefix = key.slice(16, 32); - // Encrypt the private key - const aesCtr = new aes_js_1.CTR(derivedKey, iv); - const ciphertext = (0, index_js_4.getBytes)(aesCtr.encrypt(privateKey)); - // Compute the message authentication code, used to check the password - const mac = (0, index_js_2.keccak256)((0, index_js_4.concat)([macPrefix, ciphertext])); - // See: https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition - const data = { - address: account.address.substring(2).toLowerCase(), - id: (0, index_js_4.uuidV4)(uuidRandom), - version: 3, - Crypto: { - cipher: "aes-128-ctr", - cipherparams: { - iv: (0, index_js_4.hexlify)(iv).substring(2), - }, - ciphertext: (0, index_js_4.hexlify)(ciphertext).substring(2), - kdf: "scrypt", - kdfparams: { - salt: (0, index_js_4.hexlify)(kdf.salt).substring(2), - n: kdf.N, - dklen: 32, - p: kdf.p, - r: kdf.r - }, - mac: mac.substring(2) - } - }; - // If we have a mnemonic, encrypt it into the JSON wallet - if (account.mnemonic) { - const client = (options.client != null) ? options.client : `ethers/${_version_js_1.version}`; - const path = account.mnemonic.path || defaultPath; - const locale = account.mnemonic.locale || "en"; - const mnemonicKey = key.slice(32, 64); - const entropy = (0, index_js_4.getBytes)(account.mnemonic.entropy, "account.mnemonic.entropy"); - const mnemonicIv = (0, index_js_2.randomBytes)(16); - const mnemonicAesCtr = new aes_js_1.CTR(mnemonicKey, mnemonicIv); - const mnemonicCiphertext = (0, index_js_4.getBytes)(mnemonicAesCtr.encrypt(entropy)); - const now = new Date(); - const timestamp = (now.getUTCFullYear() + "-" + - (0, utils_js_1.zpad)(now.getUTCMonth() + 1, 2) + "-" + - (0, utils_js_1.zpad)(now.getUTCDate(), 2) + "T" + - (0, utils_js_1.zpad)(now.getUTCHours(), 2) + "-" + - (0, utils_js_1.zpad)(now.getUTCMinutes(), 2) + "-" + - (0, utils_js_1.zpad)(now.getUTCSeconds(), 2) + ".0Z"); - const gethFilename = ("UTC--" + timestamp + "--" + data.address); - data["x-ethers"] = { - client, gethFilename, path, locale, - mnemonicCounter: (0, index_js_4.hexlify)(mnemonicIv).substring(2), - mnemonicCiphertext: (0, index_js_4.hexlify)(mnemonicCiphertext).substring(2), - version: "0.1" - }; - } - return JSON.stringify(data); -} -/** - * Return the JSON Keystore Wallet for %%account%% encrypted with - * %%password%%. - * - * The %%options%% can be used to tune the password-based key - * derivation function parameters, explicitly set the random values - * used. Any provided [[ProgressCallback]] is ignord. - */ -function encryptKeystoreJsonSync(account, password, options) { - if (options == null) { - options = {}; - } - const passwordBytes = (0, utils_js_1.getPassword)(password); - const kdf = getEncryptKdfParams(options); - const key = (0, index_js_2.scryptSync)(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64); - return _encryptKeystore((0, index_js_4.getBytes)(key), kdf, account, options); -} -exports.encryptKeystoreJsonSync = encryptKeystoreJsonSync; -/** - * Resolved to the JSON Keystore Wallet for %%account%% encrypted - * with %%password%%. - * - * The %%options%% can be used to tune the password-based key - * derivation function parameters, explicitly set the random values - * used and provide a [[ProgressCallback]] to receive periodic updates - * on the completion status.. - */ -async function encryptKeystoreJson(account, password, options) { - if (options == null) { - options = {}; - } - const passwordBytes = (0, utils_js_1.getPassword)(password); - const kdf = getEncryptKdfParams(options); - const key = await (0, index_js_2.scrypt)(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64, options.progressCallback); - return _encryptKeystore((0, index_js_4.getBytes)(key), kdf, account, options); -} -exports.encryptKeystoreJson = encryptKeystoreJson; -//# sourceMappingURL=json-keystore.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/json-keystore.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/json-keystore.js.map deleted file mode 100644 index 494e1aee..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/json-keystore.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"json-keystore.js","sourceRoot":"","sources":["../../src.ts/wallet/json-keystore.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAEH,mCAA6B;AAE7B,kDAAiD;AACjD,iDAAwF;AACxF,sDAAyD;AACzD,gDAE2B;AAE3B,yCAAwD;AAKxD,gDAAyC;AAGzC,MAAM,WAAW,GAAG,kBAAkB,CAAC;AAgCvC;;GAEG;AACH,SAAgB,cAAc,CAAC,IAAY;IACvC,IAAI;QACA,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC9B,MAAM,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC,CAAC;QACrE,IAAI,OAAO,KAAK,CAAC,EAAE;YAAE,OAAO,IAAI,CAAC;SAAE;KACtC;IAAC,OAAO,KAAK,EAAE,GAAG;IACnB,OAAO,KAAK,CAAC;AACjB,CAAC;AAPD,wCAOC;AAED,SAAS,OAAO,CAAC,IAAS,EAAE,GAAe,EAAE,UAAsB;IAC/D,MAAM,MAAM,GAAG,IAAA,kBAAO,EAAS,IAAI,EAAE,sBAAsB,CAAC,CAAC;IAC7D,IAAI,MAAM,KAAK,aAAa,EAAE;QAC1B,MAAM,EAAE,GAAG,IAAA,kBAAO,EAAa,IAAI,EAAE,8BAA8B,CAAC,CAAA;QACpE,MAAM,MAAM,GAAG,IAAI,YAAG,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAChC,OAAO,IAAA,kBAAO,EAAC,MAAM,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E,EAAE,CAAC,CAAC;IACzE,OAAO,gBAAgB,CAAC,IAAA,mBAAQ,EAAC,GAAG,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAClE,CAAC;AAPD,0DAOC;AAED;;;;;;;;GAQG;AACI,KAAK,UAAU,mBAAmB,CAAC,OAAwB,EAAE,QAA6B,EAAE,OAAwB;IACvH,IAAI,OAAO,IAAI,IAAI,EAAE;QAAE,OAAO,GAAG,EAAG,CAAC;KAAE;IAEvC,MAAM,aAAa,GAAG,IAAA,sBAAW,EAAC,QAAQ,CAAC,CAAC;IAC5C,MAAM,GAAG,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACzC,MAAM,GAAG,GAAG,MAAM,IAAA,iBAAM,EAAC,aAAa,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACrG,OAAO,gBAAgB,CAAC,IAAA,mBAAQ,EAAC,GAAG,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAClE,CAAC;AAPD,kDAOC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/mnemonic.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/mnemonic.d.ts deleted file mode 100644 index b1601122..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/mnemonic.d.ts +++ /dev/null @@ -1,65 +0,0 @@ -import type { BytesLike } from "../utils/index.js"; -import type { Wordlist } from "../wordlists/index.js"; -/** - * A **Mnemonic** wraps all properties required to compute [[link-bip-39]] - * seeds and convert between phrases and entropy. - */ -export declare class Mnemonic { - /** - * The mnemonic phrase of 12, 15, 18, 21 or 24 words. - * - * Use the [[wordlist]] ``split`` method to get the individual words. - */ - readonly phrase: string; - /** - * The password used for this mnemonic. If no password is used this - * is the empty string (i.e. ``""``) as per the specification. - */ - readonly password: string; - /** - * The wordlist for this mnemonic. - */ - readonly wordlist: Wordlist; - /** - * The underlying entropy which the mnemonic encodes. - */ - readonly entropy: string; - /** - * @private - */ - constructor(guard: any, entropy: string, phrase: string, password?: null | string, wordlist?: null | Wordlist); - /** - * Returns the seed for the mnemonic. - */ - computeSeed(): string; - /** - * Creates a new Mnemonic for the %%phrase%%. - * - * The default %%password%% is the empty string and the default - * wordlist is the [English wordlists](LangEn). - */ - static fromPhrase(phrase: string, password?: null | string, wordlist?: null | Wordlist): Mnemonic; - /** - * Create a new **Mnemonic** from the %%entropy%%. - * - * The default %%password%% is the empty string and the default - * wordlist is the [English wordlists](LangEn). - */ - static fromEntropy(_entropy: BytesLike, password?: null | string, wordlist?: null | Wordlist): Mnemonic; - /** - * Returns the phrase for %%mnemonic%%. - */ - static entropyToPhrase(_entropy: BytesLike, wordlist?: null | Wordlist): string; - /** - * Returns the entropy for %%phrase%%. - */ - static phraseToEntropy(phrase: string, wordlist?: null | Wordlist): string; - /** - * Returns true if %%phrase%% is a valid [[link-bip-39]] phrase. - * - * This checks all the provided words belong to the %%wordlist%%, - * that the length is valid and the checksum is correct. - */ - static isValidMnemonic(phrase: string, wordlist?: null | Wordlist): boolean; -} -//# sourceMappingURL=mnemonic.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/mnemonic.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/mnemonic.d.ts.map deleted file mode 100644 index c7ba058f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/mnemonic.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mnemonic.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/mnemonic.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,QA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/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/mnemonic.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/mnemonic.js deleted file mode 100644 index cb487fbe..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/mnemonic.js +++ /dev/null @@ -1,169 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Mnemonic = void 0; -const index_js_1 = require("../crypto/index.js"); -const index_js_2 = require("../utils/index.js"); -const lang_en_js_1 = require("../wordlists/lang-en.js"); -// Returns a byte with the MSB bits set -function getUpperMask(bits) { - return ((1 << bits) - 1) << (8 - bits) & 0xff; -} -// Returns a byte with the LSB bits set -function getLowerMask(bits) { - return ((1 << bits) - 1) & 0xff; -} -function mnemonicToEntropy(mnemonic, wordlist) { - (0, index_js_2.assertNormalize)("NFKD"); - if (wordlist == null) { - wordlist = lang_en_js_1.LangEn.wordlist(); - } - const words = wordlist.split(mnemonic); - (0, index_js_2.assertArgument)((words.length % 3) === 0 && words.length >= 12 && words.length <= 24, "invalid mnemonic length", "mnemonic", "[ REDACTED ]"); - const entropy = new Uint8Array(Math.ceil(11 * words.length / 8)); - let offset = 0; - for (let i = 0; i < words.length; i++) { - let index = wordlist.getWordIndex(words[i].normalize("NFKD")); - (0, index_js_2.assertArgument)(index >= 0, `invalid mnemonic word at index ${i}`, "mnemonic", "[ REDACTED ]"); - for (let bit = 0; bit < 11; bit++) { - if (index & (1 << (10 - bit))) { - entropy[offset >> 3] |= (1 << (7 - (offset % 8))); - } - offset++; - } - } - const entropyBits = 32 * words.length / 3; - const checksumBits = words.length / 3; - const checksumMask = getUpperMask(checksumBits); - const checksum = (0, index_js_2.getBytes)((0, index_js_1.sha256)(entropy.slice(0, entropyBits / 8)))[0] & checksumMask; - (0, index_js_2.assertArgument)(checksum === (entropy[entropy.length - 1] & checksumMask), "invalid mnemonic checksum", "mnemonic", "[ REDACTED ]"); - return (0, index_js_2.hexlify)(entropy.slice(0, entropyBits / 8)); -} -function entropyToMnemonic(entropy, wordlist) { - (0, index_js_2.assertArgument)((entropy.length % 4) === 0 && entropy.length >= 16 && entropy.length <= 32, "invalid entropy size", "entropy", "[ REDACTED ]"); - if (wordlist == null) { - wordlist = lang_en_js_1.LangEn.wordlist(); - } - const indices = [0]; - let remainingBits = 11; - for (let i = 0; i < entropy.length; i++) { - // Consume the whole byte (with still more to go) - if (remainingBits > 8) { - indices[indices.length - 1] <<= 8; - indices[indices.length - 1] |= entropy[i]; - remainingBits -= 8; - // This byte will complete an 11-bit index - } - else { - indices[indices.length - 1] <<= remainingBits; - indices[indices.length - 1] |= entropy[i] >> (8 - remainingBits); - // Start the next word - indices.push(entropy[i] & getLowerMask(8 - remainingBits)); - remainingBits += 3; - } - } - // Compute the checksum bits - const checksumBits = entropy.length / 4; - const checksum = parseInt((0, index_js_1.sha256)(entropy).substring(2, 4), 16) & getUpperMask(checksumBits); - // Shift the checksum into the word indices - indices[indices.length - 1] <<= checksumBits; - indices[indices.length - 1] |= (checksum >> (8 - checksumBits)); - return wordlist.join(indices.map((index) => wordlist.getWord(index))); -} -const _guard = {}; -/** - * A **Mnemonic** wraps all properties required to compute [[link-bip-39]] - * seeds and convert between phrases and entropy. - */ -class Mnemonic { - /** - * The mnemonic phrase of 12, 15, 18, 21 or 24 words. - * - * Use the [[wordlist]] ``split`` method to get the individual words. - */ - phrase; - /** - * The password used for this mnemonic. If no password is used this - * is the empty string (i.e. ``""``) as per the specification. - */ - password; - /** - * The wordlist for this mnemonic. - */ - wordlist; - /** - * The underlying entropy which the mnemonic encodes. - */ - entropy; - /** - * @private - */ - constructor(guard, entropy, phrase, password, wordlist) { - if (password == null) { - password = ""; - } - if (wordlist == null) { - wordlist = lang_en_js_1.LangEn.wordlist(); - } - (0, index_js_2.assertPrivate)(guard, _guard, "Mnemonic"); - (0, index_js_2.defineProperties)(this, { phrase, password, wordlist, entropy }); - } - /** - * Returns the seed for the mnemonic. - */ - computeSeed() { - const salt = (0, index_js_2.toUtf8Bytes)("mnemonic" + this.password, "NFKD"); - return (0, index_js_1.pbkdf2)((0, index_js_2.toUtf8Bytes)(this.phrase, "NFKD"), salt, 2048, 64, "sha512"); - } - /** - * Creates a new Mnemonic for the %%phrase%%. - * - * The default %%password%% is the empty string and the default - * wordlist is the [English wordlists](LangEn). - */ - static fromPhrase(phrase, password, wordlist) { - // Normalize the case and space; throws if invalid - const entropy = mnemonicToEntropy(phrase, wordlist); - phrase = entropyToMnemonic((0, index_js_2.getBytes)(entropy), wordlist); - return new Mnemonic(_guard, entropy, phrase, password, wordlist); - } - /** - * Create a new **Mnemonic** from the %%entropy%%. - * - * The default %%password%% is the empty string and the default - * wordlist is the [English wordlists](LangEn). - */ - static fromEntropy(_entropy, password, wordlist) { - const entropy = (0, index_js_2.getBytes)(_entropy, "entropy"); - const phrase = entropyToMnemonic(entropy, wordlist); - return new Mnemonic(_guard, (0, index_js_2.hexlify)(entropy), phrase, password, wordlist); - } - /** - * Returns the phrase for %%mnemonic%%. - */ - static entropyToPhrase(_entropy, wordlist) { - const entropy = (0, index_js_2.getBytes)(_entropy, "entropy"); - return entropyToMnemonic(entropy, wordlist); - } - /** - * Returns the entropy for %%phrase%%. - */ - static phraseToEntropy(phrase, wordlist) { - return mnemonicToEntropy(phrase, wordlist); - } - /** - * Returns true if %%phrase%% is a valid [[link-bip-39]] phrase. - * - * This checks all the provided words belong to the %%wordlist%%, - * that the length is valid and the checksum is correct. - */ - static isValidMnemonic(phrase, wordlist) { - try { - mnemonicToEntropy(phrase, wordlist); - return true; - } - catch (error) { } - return false; - } -} -exports.Mnemonic = Mnemonic; -//# sourceMappingURL=mnemonic.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/mnemonic.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/mnemonic.js.map deleted file mode 100644 index c69453b2..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/mnemonic.js.map +++ /dev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;;;;OAKG;IACH,MAAM,CAAC,eAAe,CAAC,MAAc,EAAE,QAA0B;QAC7D,IAAI;YACA,iBAAiB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;YACpC,OAAO,IAAI,CAAC;SACf;QAAC,OAAO,KAAK,EAAE,GAAG;QACnB,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ;AA/FD,4BA+FC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/utils.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/utils.d.ts deleted file mode 100644 index 0d4baabe..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/utils.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @_ignore - */ -export declare function looseArrayify(hexString: string): Uint8Array; -export declare function zpad(value: String | number, length: number): String; -export declare function getPassword(password: string | Uint8Array): Uint8Array; -export declare function spelunk(object: any, _path: string): T; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/utils.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/utils.d.ts.map deleted file mode 100644 index ecd4e9ae..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,UAAU,CAK3D;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAInE;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,CAKrE;AAED,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC,CA8DxD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/utils.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/utils.js deleted file mode 100644 index fe4650e9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/utils.js +++ /dev/null @@ -1,149 +0,0 @@ -"use strict"; -/** - * @_ignore - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.spelunk = exports.getPassword = exports.zpad = exports.looseArrayify = void 0; -const index_js_1 = require("../utils/index.js"); -function looseArrayify(hexString) { - if (typeof (hexString) === "string" && !hexString.startsWith("0x")) { - hexString = "0x" + hexString; - } - return (0, index_js_1.getBytesCopy)(hexString); -} -exports.looseArrayify = looseArrayify; -function zpad(value, length) { - value = String(value); - while (value.length < length) { - value = '0' + value; - } - return value; -} -exports.zpad = zpad; -function getPassword(password) { - if (typeof (password) === 'string') { - return (0, index_js_1.toUtf8Bytes)(password, "NFKC"); - } - return (0, index_js_1.getBytesCopy)(password); -} -exports.getPassword = getPassword; -function spelunk(object, _path) { - const match = _path.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i); - (0, index_js_1.assertArgument)(match != null, "invalid path", "path", _path); - const path = match[1]; - const type = match[3]; - const reqd = (match[4] === "!"); - let cur = object; - for (const comp of path.toLowerCase().split('.')) { - // Search for a child object with a case-insensitive matching key - if (Array.isArray(cur)) { - if (!comp.match(/^[0-9]+$/)) { - break; - } - cur = cur[parseInt(comp)]; - } - else if (typeof (cur) === "object") { - let found = null; - for (const key in cur) { - if (key.toLowerCase() === comp) { - found = cur[key]; - break; - } - } - cur = found; - } - else { - cur = null; - } - if (cur == null) { - break; - } - } - (0, index_js_1.assertArgument)(!reqd || cur != null, "missing required value", "path", path); - if (type && cur != null) { - if (type === "int") { - if (typeof (cur) === "string" && cur.match(/^-?[0-9]+$/)) { - return parseInt(cur); - } - else if (Number.isSafeInteger(cur)) { - return cur; - } - } - if (type === "number") { - if (typeof (cur) === "string" && cur.match(/^-?[0-9.]*$/)) { - return parseFloat(cur); - } - } - if (type === "data") { - if (typeof (cur) === "string") { - return looseArrayify(cur); - } - } - if (type === "array" && Array.isArray(cur)) { - return cur; - } - if (type === typeof (cur)) { - return cur; - } - (0, index_js_1.assertArgument)(false, `wrong type found for ${type} `, "path", path); - } - return cur; -} -exports.spelunk = spelunk; -/* -export function follow(object: any, path: string): null | string { - let currentChild = object; - - for (const comp of path.toLowerCase().split('/')) { - - // Search for a child object with a case-insensitive matching key - let matchingChild = null; - for (const key in currentChild) { - if (key.toLowerCase() === comp) { - matchingChild = currentChild[key]; - break; - } - } - - if (matchingChild === null) { return null; } - - currentChild = matchingChild; - } - - return currentChild; -} - -// "path/to/something:type!" -export function followRequired(data: any, path: string): string { - const value = follow(data, path); - if (value != null) { return value; } - return logger.throwArgumentError("invalid value", `data:${ path }`, - JSON.stringify(data)); -} -*/ -// See: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4) -/* -export function uuidV4(randomBytes: BytesLike): string { - const bytes = getBytes(randomBytes, "randomBytes"); - - // Section: 4.1.3: - // - time_hi_and_version[12:16] = 0b0100 - bytes[6] = (bytes[6] & 0x0f) | 0x40; - - // Section 4.4 - // - clock_seq_hi_and_reserved[6] = 0b0 - // - clock_seq_hi_and_reserved[7] = 0b1 - bytes[8] = (bytes[8] & 0x3f) | 0x80; - - const value = hexlify(bytes); - - return [ - value.substring(2, 10), - value.substring(10, 14), - value.substring(14, 18), - value.substring(18, 22), - value.substring(22, 34), - ].join("-"); -} -*/ -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/utils.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/utils.js.map deleted file mode 100644 index 9ec2538b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version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AG,CAAC,KAAK,QAAQ,IAAI,GAAG,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE;gBACtD,OAAmB,UAAU,CAAC,GAAG,CAAC,CAAC;aACtC;SACJ;QAED,IAAI,IAAI,KAAK,MAAM,EAAE;YACjB,IAAI,OAAM,CAAC,GAAG,CAAC,KAAK,QAAQ,EAAE;gBAAE,OAAmB,aAAa,CAAC,GAAG,CAAC,CAAC;aAAE;SAC3E;QAED,IAAI,IAAI,KAAK,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAAE,OAAmB,GAAG,CAAC;SAAE;QACvE,IAAI,IAAI,KAAK,OAAM,CAAC,GAAG,CAAC,EAAE;YAAE,OAAO,GAAG,CAAC;SAAE;QAEzC,IAAA,yBAAc,EAAC,KAAK,EAAE,wBAAyB,IAAK,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;KAC1E;IAED,OAAO,GAAG,CAAC;AACf,CAAC;AA9DD,0BA8DC;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BE;AACF,0DAA0D;AAC1D;;;;;;;;;;;;;;;;;;;;;;;EAuBE"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/wallet.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/wallet.d.ts deleted file mode 100644 index 91fa6098..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/wallet.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { SigningKey } from "../crypto/index.js"; -import { BaseWallet } from "./base-wallet.js"; -import { HDNodeWallet } from "./hdwallet.js"; -import type { ProgressCallback } from "../crypto/index.js"; -import type { Provider } from "../providers/index.js"; -/** - * A **Wallet** manages a single private key which is used to sign - * transactions, messages and other common payloads. - * - * This class is generally the main entry point for developers - * that wish to use a private key directly, as it can create - * instances from a large variety of common sources, including - * raw private key, [[link-bip-39]] mnemonics and encrypte JSON - * wallets. - */ -export declare class Wallet extends BaseWallet { - #private; - /** - * Create a new wallet for the private %%key%%, optionally connected - * to %%provider%%. - */ - constructor(key: string | SigningKey, provider?: null | Provider); - connect(provider: null | Provider): Wallet; - /** - * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with - * %%password%%. - * - * If %%progressCallback%% is specified, it will receive periodic - * updates as the encryption process progreses. - */ - encrypt(password: Uint8Array | string, progressCallback?: ProgressCallback): Promise; - /** - * Returns a [JSON Keystore Wallet](json-wallets) encryped with - * %%password%%. - * - * It is preferred to use the [async version](encrypt) instead, - * which allows a [[ProgressCallback]] to keep the user informed. - * - * This method will block the event loop (freezing all UI) until - * it is complete, which may be a non-trivial duration. - */ - encryptSync(password: Uint8Array | string): string; - /** - * Creates (asynchronously) a **Wallet** by decrypting the %%json%% - * with %%password%%. - * - * If %%progress%% is provided, it is called periodically during - * decryption so that any UI can be updated. - */ - static fromEncryptedJson(json: string, password: Uint8Array | string, progress?: ProgressCallback): Promise; - /** - * Creates a **Wallet** by decrypting the %%json%% with %%password%%. - * - * The [[fromEncryptedJson]] method is preferred, as this method - * will lock up and freeze the UI during decryption, which may take - * some time. - */ - static fromEncryptedJsonSync(json: string, password: Uint8Array | string): HDNodeWallet | Wallet; - /** - * Creates a new random [[HDNodeWallet]] using the available - * [cryptographic random source](randomBytes). - * - * If there is no crytographic random source, this will throw. - */ - static createRandom(provider?: null | Provider): HDNodeWallet; - /** - * Creates a [[HDNodeWallet]] for %%phrase%%. - */ - static fromPhrase(phrase: string, provider?: Provider): HDNodeWallet; -} -//# sourceMappingURL=wallet.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/wallet.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/wallet.d.ts.map deleted file mode 100644 index afa4098d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/wallet.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wallet.d.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,QAAQ,GAAG,YAAY;CAKvE"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/wallet.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/wallet.js deleted file mode 100644 index 6e8300ac..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/wallet.js +++ /dev/null @@ -1,148 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Wallet = void 0; -const index_js_1 = require("../crypto/index.js"); -const index_js_2 = require("../utils/index.js"); -const base_wallet_js_1 = require("./base-wallet.js"); -const hdwallet_js_1 = require("./hdwallet.js"); -const json_crowdsale_js_1 = require("./json-crowdsale.js"); -const json_keystore_js_1 = require("./json-keystore.js"); -const mnemonic_js_1 = require("./mnemonic.js"); -function stall(duration) { - return new Promise((resolve) => { setTimeout(() => { resolve(); }, duration); }); -} -/** - * A **Wallet** manages a single private key which is used to sign - * transactions, messages and other common payloads. - * - * This class is generally the main entry point for developers - * that wish to use a private key directly, as it can create - * instances from a large variety of common sources, including - * raw private key, [[link-bip-39]] mnemonics and encrypte JSON - * wallets. - */ -class Wallet extends base_wallet_js_1.BaseWallet { - /** - * Create a new wallet for the private %%key%%, optionally connected - * to %%provider%%. - */ - constructor(key, provider) { - if (typeof (key) === "string" && !key.startsWith("0x")) { - key = "0x" + key; - } - let signingKey = (typeof (key) === "string") ? new index_js_1.SigningKey(key) : key; - super(signingKey, provider); - } - connect(provider) { - return new Wallet(this.signingKey, provider); - } - /** - * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with - * %%password%%. - * - * If %%progressCallback%% is specified, it will receive periodic - * updates as the encryption process progreses. - */ - async encrypt(password, progressCallback) { - const account = { address: this.address, privateKey: this.privateKey }; - return await (0, json_keystore_js_1.encryptKeystoreJson)(account, password, { progressCallback }); - } - /** - * Returns a [JSON Keystore Wallet](json-wallets) encryped with - * %%password%%. - * - * It is preferred to use the [async version](encrypt) instead, - * which allows a [[ProgressCallback]] to keep the user informed. - * - * This method will block the event loop (freezing all UI) until - * it is complete, which may be a non-trivial duration. - */ - encryptSync(password) { - const account = { address: this.address, privateKey: this.privateKey }; - return (0, json_keystore_js_1.encryptKeystoreJsonSync)(account, password); - } - static #fromAccount(account) { - (0, index_js_2.assertArgument)(account, "invalid JSON wallet", "json", "[ REDACTED ]"); - if ("mnemonic" in account && account.mnemonic && account.mnemonic.locale === "en") { - const mnemonic = mnemonic_js_1.Mnemonic.fromEntropy(account.mnemonic.entropy); - const wallet = hdwallet_js_1.HDNodeWallet.fromMnemonic(mnemonic, account.mnemonic.path); - if (wallet.address === account.address && wallet.privateKey === account.privateKey) { - return wallet; - } - console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key"); - } - const wallet = new Wallet(account.privateKey); - (0, index_js_2.assertArgument)(wallet.address === account.address, "address/privateKey mismatch", "json", "[ REDACTED ]"); - return wallet; - } - /** - * Creates (asynchronously) a **Wallet** by decrypting the %%json%% - * with %%password%%. - * - * If %%progress%% is provided, it is called periodically during - * decryption so that any UI can be updated. - */ - static async fromEncryptedJson(json, password, progress) { - let account = null; - if ((0, json_keystore_js_1.isKeystoreJson)(json)) { - account = await (0, json_keystore_js_1.decryptKeystoreJson)(json, password, progress); - } - else if ((0, json_crowdsale_js_1.isCrowdsaleJson)(json)) { - if (progress) { - progress(0); - await stall(0); - } - account = (0, json_crowdsale_js_1.decryptCrowdsaleJson)(json, password); - if (progress) { - progress(1); - await stall(0); - } - } - return Wallet.#fromAccount(account); - } - /** - * Creates a **Wallet** by decrypting the %%json%% with %%password%%. - * - * The [[fromEncryptedJson]] method is preferred, as this method - * will lock up and freeze the UI during decryption, which may take - * some time. - */ - static fromEncryptedJsonSync(json, password) { - let account = null; - if ((0, json_keystore_js_1.isKeystoreJson)(json)) { - account = (0, json_keystore_js_1.decryptKeystoreJsonSync)(json, password); - } - else if ((0, json_crowdsale_js_1.isCrowdsaleJson)(json)) { - account = (0, json_crowdsale_js_1.decryptCrowdsaleJson)(json, password); - } - else { - (0, index_js_2.assertArgument)(false, "invalid JSON wallet", "json", "[ REDACTED ]"); - } - return Wallet.#fromAccount(account); - } - /** - * Creates a new random [[HDNodeWallet]] using the available - * [cryptographic random source](randomBytes). - * - * If there is no crytographic random source, this will throw. - */ - static createRandom(provider) { - const wallet = hdwallet_js_1.HDNodeWallet.createRandom(); - if (provider) { - return wallet.connect(provider); - } - return wallet; - } - /** - * Creates a [[HDNodeWallet]] for %%phrase%%. - */ - static fromPhrase(phrase, provider) { - const wallet = hdwallet_js_1.HDNodeWallet.fromPhrase(phrase); - if (provider) { - return wallet.connect(provider); - } - return wallet; - } -} -exports.Wallet = Wallet; -//# sourceMappingURL=wallet.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/wallet.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/wallet.js.map deleted file mode 100644 index 88586f69..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wallet/wallet.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wallet.js","sourceRoot":"","sources":["../../src.ts/wallet/wallet.ts"],"names":[],"mappings":";;;AAAA,iDAAgD;AAChD,gDAAmD;AAEnD,qDAA8C;AAC9C,+CAA6C;AAC7C,2DAA6E;AAC7E,yDAI4B;AAC5B,+CAAyC;AASzC,SAAS,KAAK,CAAC,QAAgB;IAC3B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,GAAG,UAAU,CAAC,GAAG,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACrF,CAAC;AAED;;;;;;;;;GASG;AACH,MAAa,MAAO,SAAQ,2BAAU;IAElC;;;OAGG;IACH,YAAY,GAAwB,EAAE,QAA0B;QAC5D,IAAI,OAAM,CAAC,GAAG,CAAC,KAAK,QAAQ,IAAI,CAAC,GAAG,CAAC,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CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,qBAAqB,CAAC,IAAY,EAAE,QAA6B;QACpE,IAAI,OAAO,GAA8C,IAAI,CAAC;QAC9D,IAAI,IAAA,iCAAc,EAAC,IAAI,CAAC,EAAE;YACtB,OAAO,GAAG,IAAA,0CAAuB,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;SACrD;aAAM,IAAI,IAAA,mCAAe,EAAC,IAAI,CAAC,EAAE;YAC9B,OAAO,GAAG,IAAA,wCAAoB,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;SAClD;aAAM;YACH,IAAA,yBAAc,EAAC,KAAK,EAAE,qBAAqB,EAAE,MAAM,EAAE,cAAc,CAAC,CAAC;SACxE;QAED,OAAO,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IACxC,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,YAAY,CAAC,QAA0B;QAC1C,MAAM,MAAM,GAAG,0BAAY,CAAC,YAAY,EAAE,CAAC;QAC3C,IAAI,QAAQ,EAAE;YAAE,OAAO,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;SAAE;QAClD,OAAO,MAAM,CAAC;IAClB,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,MAAc,EAAE,QAAmB;QACjD,MAAM,MAAM,GAAG,0BAAY,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAC/C,IAAI,QAAQ,EAAE;YAAE,OAAO,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;SAAE;QAClD,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AAhID,wBAgIC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/bit-reader.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/bit-reader.d.ts deleted file mode 100644 index 1aa84953..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/bit-reader.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * @_ignore - */ -export declare function decodeBits(width: number, data: string): Array; -//# sourceMappingURL=bit-reader.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/bit-reader.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/bit-reader.d.ts.map deleted file mode 100644 index c088a746..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/bit-reader.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bit-reader.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/bit-reader.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CA6BrE"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/bit-reader.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/bit-reader.js deleted file mode 100644 index 706eaa9f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/bit-reader.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.decodeBits = void 0; -const Base64 = ")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_"; -/** - * @_ignore - */ -function decodeBits(width, data) { - const maxValue = (1 << width) - 1; - const result = []; - let accum = 0, bits = 0, flood = 0; - for (let i = 0; i < data.length; i++) { - // Accumulate 6 bits of data - accum = ((accum << 6) | Base64.indexOf(data[i])); - bits += 6; - // While we have enough for a word... - while (bits >= width) { - // ...read the word - const value = (accum >> (bits - width)); - accum &= (1 << (bits - width)) - 1; - bits -= width; - // A value of 0 indicates we exceeded maxValue, it - // floods over into the next value - if (value === 0) { - flood += maxValue; - } - else { - result.push(value + flood); - flood = 0; - } - } - } - return result; -} -exports.decodeBits = decodeBits; -//# sourceMappingURL=bit-reader.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/bit-reader.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/bit-reader.js.map deleted file mode 100644 index 12475f60..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/bit-reader.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bit-reader.js","sourceRoot":"","sources":["../../src.ts/wordlists/bit-reader.ts"],"names":[],"mappings":";;;AAAA,MAAM,MAAM,GAAG,kEAAkE,CAAC;AAElF;;GAEG;AACH,SAAgB,UAAU,CAAC,KAAa,EAAE,IAAY;IAClD,MAAM,QAAQ,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;IAClC,MAAM,MAAM,GAAkB,EAAG,CAAC;IAClC,IAAI,KAAK,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC;IACnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAElC,4BAA4B;QAC5B,KAAK,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACjD,IAAI,IAAI,CAAC,CAAC;QAEV,qCAAqC;QACrC,OAAO,IAAI,IAAI,KAAK,EAAE;YAClB,mBAAmB;YACnB,MAAM,KAAK,GAAG,CAAC,KAAK,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC;YACxC,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;YACnC,IAAI,IAAI,KAAK,CAAC;YAEd,kDAAkD;YAClD,kCAAkC;YAClC,IAAI,KAAK,KAAK,CAAC,EAAE;gBACb,KAAK,IAAI,QAAQ,CAAC;aACrB;iBAAM;gBACH,MAAM,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC;gBAC3B,KAAK,GAAG,CAAC,CAAC;aACb;SACJ;KACJ;IAED,OAAO,MAAM,CAAC;AAClB,CAAC;AA7BD,gCA6BC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/decode-owl.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/decode-owl.d.ts deleted file mode 100644 index 8822086b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/decode-owl.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * @_ignore - */ -export declare function decode(data: string, subs: string): Array; -/** - * @_ignore - */ -export declare function decodeOwl(data: string): Array; -//# sourceMappingURL=decode-owl.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/decode-owl.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/decode-owl.d.ts.map deleted file mode 100644 index aa692891..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/decode-owl.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decode-owl.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/decode-owl.ts"],"names":[],"mappings":"AAqBA;;GAEG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAsBhE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAMrD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/decode-owl.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/decode-owl.js deleted file mode 100644 index 9ee1c18b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/decode-owl.js +++ /dev/null @@ -1,60 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.decodeOwl = exports.decode = void 0; -const index_js_1 = require("../utils/index.js"); -const subsChrs = " !#$%&'()*+,-./<=>?@[]^_`{|}~"; -const Word = /^[a-z]*$/i; -function unfold(words, sep) { - let initial = 97; - return words.reduce((accum, word) => { - if (word === sep) { - initial++; - } - else if (word.match(Word)) { - accum.push(String.fromCharCode(initial) + word); - } - else { - initial = 97; - accum.push(word); - } - return accum; - }, []); -} -/** - * @_ignore - */ -function decode(data, subs) { - // Replace all the substitutions with their expanded form - for (let i = subsChrs.length - 1; i >= 0; i--) { - data = data.split(subsChrs[i]).join(subs.substring(2 * i, 2 * i + 2)); - } - // Get all tle clumps; each suffix, first-increment and second-increment - const clumps = []; - const leftover = data.replace(/(:|([0-9])|([A-Z][a-z]*))/g, (all, item, semi, word) => { - if (semi) { - for (let i = parseInt(semi); i >= 0; i--) { - clumps.push(";"); - } - } - else { - clumps.push(item.toLowerCase()); - } - return ""; - }); - /* c8 ignore start */ - if (leftover) { - throw new Error(`leftovers: ${JSON.stringify(leftover)}`); - } - /* c8 ignore stop */ - return unfold(unfold(clumps, ";"), ":"); -} -exports.decode = decode; -/** - * @_ignore - */ -function decodeOwl(data) { - (0, index_js_1.assertArgument)(data[0] === "0", "unsupported auwl data", "data", data); - return decode(data.substring(1 + 2 * subsChrs.length), data.substring(1, 1 + 2 * subsChrs.length)); -} -exports.decodeOwl = decodeOwl; -//# sourceMappingURL=decode-owl.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/decode-owl.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/decode-owl.js.map deleted file mode 100644 index f1373a00..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/decode-owl.js.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AE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;QAClF,IAAI,IAAI,EAAE;YACN,KAAK,IAAI,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;gBAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;aAAE;SAClE;aAAM;YACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;SACnC;QACD,OAAO,EAAE,CAAC;IACd,CAAC,CAAC,CAAC;IACH,qBAAqB;IACrB,IAAI,QAAQ,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,cAAe,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAE,EAAE,CAAC,CAAC;KAAE;IAC9E,oBAAoB;IAEpB,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;AAC5C,CAAC;AAtBD,wBAsBC;AAED;;GAEG;AACH,SAAgB,SAAS,CAAC,IAAY;IAClC,IAAA,yBAAc,EAAC,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,uBAAuB,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IAEvE,OAAO,MAAM,CACT,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,EACvC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;AACpD,CAAC;AAND,8BAMC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/decode-owla.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/decode-owla.d.ts deleted file mode 100644 index 479e6c54..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/decode-owla.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * @_ignore - */ -export declare function decodeOwlA(data: string, accents: string): Array; -//# sourceMappingURL=decode-owla.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/decode-owla.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/decode-owla.d.ts.map deleted file mode 100644 index bb3d5696..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/decode-owla.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decode-owla.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/decode-owla.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAwBvE"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/decode-owla.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/decode-owla.js deleted file mode 100644 index 59dab298..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/decode-owla.js +++ /dev/null @@ -1,32 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.decodeOwlA = void 0; -const index_js_1 = require("../utils/index.js"); -const bit_reader_js_1 = require("./bit-reader.js"); -const decode_owl_js_1 = require("./decode-owl.js"); -/** - * @_ignore - */ -function decodeOwlA(data, accents) { - let words = (0, decode_owl_js_1.decodeOwl)(data).join(","); - // Inject the accents - accents.split(/,/g).forEach((accent) => { - const match = accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/); - (0, index_js_1.assertArgument)(match !== null, "internal error parsing accents", "accents", accents); - let posOffset = 0; - const positions = (0, bit_reader_js_1.decodeBits)(parseInt(match[3]), match[4]); - const charCode = parseInt(match[2]); - const regex = new RegExp(`([${match[1]}])`, "g"); - words = words.replace(regex, (all, letter) => { - const rem = --positions[posOffset]; - if (rem === 0) { - letter = String.fromCharCode(letter.charCodeAt(0), charCode); - posOffset++; - } - return letter; - }); - }); - return words.split(","); -} -exports.decodeOwlA = decodeOwlA; -//# sourceMappingURL=decode-owla.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/decode-owla.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/decode-owla.js.map deleted file mode 100644 index 1eedcf60..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/decode-owla.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decode-owla.js","sourceRoot":"","sources":["../../src.ts/wordlists/decode-owla.ts"],"names":[],"mappings":";;;AAAA,gDAAmD;AAEnD,mDAA6C;AAC7C,mDAA4C;AAE5C;;GAEG;AACH,SAAgB,UAAU,CAAC,IAAY,EAAE,OAAe;IACpD,IAAI,KAAK,GAAG,IAAA,yBAAS,EAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAEtC,qBAAqB;IACrB,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;QAEnC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;QAC5D,IAAA,yBAAc,EAAC,KAAK,KAAK,IAAI,EAAE,gCAAgC,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;QAErF,IAAI,SAAS,GAAG,CAAC,CAAC;QAClB,MAAM,SAAS,GAAG,IAAA,0BAAU,EAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3D,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACpC,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,KAAM,KAAK,CAAC,CAAC,CAAE,IAAI,EAAE,GAAG,CAAC,CAAC;QACnD,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE;YACzC,MAAM,GAAG,GAAG,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;YACnC,IAAI,GAAG,KAAK,CAAC,EAAE;gBACX,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;gBAC7D,SAAS,EAAE,CAAC;aACf;YACD,OAAO,MAAM,CAAC;QAClB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC;AAxBD,gCAwBC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/generation/encode-latin.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/generation/encode-latin.d.ts deleted file mode 100644 index a646e824..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/generation/encode-latin.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -export declare class BitWriter { - #private; - readonly width: number; - constructor(width: number); - write(value: number): void; - get length(): number; - get data(): string; -} -export interface AccentSet { - accent: number; - follows: string; - positions: Array; - positionsLength: number; - positionData: string; - positionDataLength: number; -} -export declare function extractAccents(words: Array): { - accents: Array; - words: Array; -}; -export declare function encodeOwl(words: Array): { - subs: string; - data: string; -}; -//# sourceMappingURL=encode-latin.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/generation/encode-latin.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/generation/encode-latin.d.ts.map deleted file mode 100644 index 3aef4135..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/generation/encode-latin.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"encode-latin.d.ts","sourceRoot":"","sources":["../../../src.ts/wordlists/generation/encode-latin.ts"],"names":[],"mappings":"AAuIA,qBAAa,SAAS;;IAClB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;gBAKX,KAAK,EAAE,MAAM;IAMzB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAW1B,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,IAAI,IAAI,MAAM,CA4BjB;CACJ;AAED,MAAM,WAAW,SAAS;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;CAC9B;AAWD,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG;IAAE,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CAAE,CAyExG;AAGD,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CA4C9E"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/generation/encode-latin.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/generation/encode-latin.js deleted file mode 100644 index 9682678c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/generation/encode-latin.js +++ /dev/null @@ -1,351 +0,0 @@ -"use strict"; -// OWL Data Format -// -// The Official WordList data format exported by this encoder -// encodes sorted latin-1 words (letters only) based on the -// fact that sorted words have prefixes with substantial -// overlap. -// -// For example, the words: -// [ Another, Apple, Apricot, Bread ] -// could be folded once with a single special character, such -// as ":" to yield: -// [ nother, pple, pricot, :, read ]. -// The First letter has been removed, but can be inferred by -// starting at A and incrementing to the next letter when ":" -// is encountered. -// -// The fold operation can be repeated for large sets as even within -// each folded set, there is substantial overlap in prefix. With the -// second special symbol ";", we get: -// [ ; x 13, other, :, ple, ricot, :, ; x 18, ead ] -// which can be further compressed by using numbers instead of the -// special character: -// [ 13, other, :, ple, ricot, :, 18, ead ] -// and to keep all values within a single byte, we only allow a -// maximum value of 10 (using 0 through 9 to represent 1 through 10), -// we get: -// [ 9, 2, other, :, ple, ricot, :, 9, 7, ead ] -// and we use camel-case to imply the bounrary, giving the final string: -// "92Other:PleRicot:97Ead" -// -// Once the entire latin-1 set has been collapsed, we use the remaining -// printable characters (except " and \, which require 2 bytes to represent -// in string) to substitute for the most common 2-letter pairs of letters -// in the string. -// -// OWLA Accent Format -// -// OWLA first removes all accents, and encodes that data using the OWL -// data format and encodes the accents as a base-64 series of 6-bit -// packed bits representing the distance from one followed letter to the -// next. -// -// For example, the acute accent in a given language may follow either -// a or e, in which case the follow-set is "ae". Each letter in the entire -// set is indexed, so the set of words with the accents: -// "thisA/ppleDoe/sNotMa/tterToMe/" -// " 1^ 2^ 3^ 4^ 5^ 6^ " <-- follow-set members, ALL a's and e's -// which gives the positions: -// [ 0, 2, 3, 4, 6 ] -// which then reduce to the distances -// [ 0, 2, 1, 1, 2 ] -// each of which fit into a 2-bit value, so this can be encoded as the -// base-64 encoded string: -// 00 10 01 01 10 = 001001 1010xx -// -// The base-64 set used has all number replaced with their -// shifted-counterparts to prevent conflicting with the numbers used in -// the fold operation to indicate the number of ";". -Object.defineProperty(exports, "__esModule", { value: true }); -exports.encodeOwl = exports.extractAccents = exports.BitWriter = void 0; -const tslib_1 = require("tslib"); -const fs_1 = tslib_1.__importDefault(require("fs")); -const id_js_1 = require("../../hash/id.js"); -const decode_owl_js_1 = require("../decode-owl.js"); -const decode_owla_js_1 = require("../decode-owla.js"); -const subsChrs = " !#$%&'()*+,-./<=>?@[]^_`{|}~"; -const Word = /^[a-z'`]*$/i; -function fold(words, sep) { - const output = []; - let initial = 97; - for (const word of words) { - if (word.match(Word)) { - while (initial < word.charCodeAt(0)) { - initial++; - output.push(sep); - } - output.push(word.substring(1)); - } - else { - initial = 97; - output.push(word); - } - } - return output; -} -function camelcase(words) { - return words.map((word) => { - if (word.match(Word)) { - return word[0].toUpperCase() + word.substring(1); - } - else { - return word; - } - }).join(""); -} -//let cc = 0, ce = 0; -/* -function getChar(c: string): string { - //if (c === "e") { ce++; } - if (c >= 'a' && c <= 'z') { return c; } - if (c.charCodeAt(1)) { - throw new Error(`bad char: "${ c }"`); - } - //cc++; - return ""; - if (c.charCodeAt(0) === 768) { return "`"; } - if (c.charCodeAt(0) === 769) { return "'"; } - if (c.charCodeAt(0) === 771) { return "~"; } - throw new Error(`Unsupported character: ${ c } (${ c.charCodeAt(0) }, ${ c.charCodeAt(1) })`); -} -function mangle(text: string): { word: string, special: string } { - const result: Array = [ ]; - for (let i = 0; i < text.length; i++) { - const c = getChar(text[i]); - result.push(c); - } - - const word = result.join(""); - if (word[1] >= 'a' && word[1] <= 'z') { return { word, special: " " }; } - return { word: word[0] + word.substring(2), special: word[1] }; -} -*/ -/* - Store: [ accent ][ targets ][ rle data; base64-tail ] - ` ae 3, 100 = (63, 37), 15 - ~ n 63, 64 = (63, 1), 27 -*/ -const Base64 = ")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_"; -class BitWriter { - width; - #data; - #bitLength; - constructor(width) { - this.width = width; - this.#data = []; - this.#bitLength = 0; - } - write(value) { - const maxValue = ((1 << this.width) - 1); - while (value > maxValue) { - this.#data.push(0); - this.#bitLength += this.width; - value -= maxValue; - } - this.#data.push(value); - this.#bitLength += this.width; - } - get length() { - return 1 + Math.trunc((this.#bitLength + 5) / 6); - } - get data() { - let result = String(this.width); - let bits = 0; - let accum = 0; - const data = this.#data.slice(); - let bitMod = this.#bitLength % 6; - while (bitMod !== 0 && bitMod < 6) { - data.push(0); - bitMod += this.width; - } - for (const value of data) { - accum <<= this.width; - accum |= value; - bits += this.width; - if (bits < 6) { - continue; - } - result += Base64[accum >> (bits - 6)]; - bits -= 6; - accum &= ((1 << bits) - 1); - } - if (result.length !== this.length) { - throw new Error(`Hmm: ${this.length} ${result.length} ${result}`); - } - return result; - } -} -exports.BitWriter = BitWriter; -; -function sorted(text) { - const letters = text.split(""); - letters.sort(); - return letters.join(""); -} -// if (c.charCodeAt(0) === 768) { return "`"; } -// if (c.charCodeAt(0) === 769) { return "'"; } -// if (c.charCodeAt(0) === 771) { return "~"; } -function extractAccents(words) { - // Build a list that maps accents to the letters it can follow - const followsMap = new Map(); - for (const word of words) { - for (let i = 0; i < word.length; i++) { - const c = word[i]; - if (c >= 'a' && c <= 'z') { - continue; - } - // Make sure this positions and codepoint make sense - if (c.charCodeAt(1)) { - throw new Error(`unsupported codepoint: "${c}"`); - } - if (i === 0) { - throw new Error(`unmatched accent: ${c}`); - } - const ac = c.charCodeAt(0), lastLetter = word[i - 1]; - ; - const follows = (followsMap.get(ac) || ""); - if (follows.indexOf(lastLetter) === -1) { - followsMap.set(ac, sorted(follows + lastLetter)); - } - } - } - // Build the positions of each follow-set for those accents - const positionsMap = new Map(); - for (const [accent, follows] of followsMap) { - let count = 0; - for (const word of words) { - for (let i = 0; i < word.length; i++) { - const c = word[i], ac = c.charCodeAt(0); - if (follows.indexOf(c) >= 0) { - count++; - } - if (ac === accent) { - const pos = positionsMap.get(ac) || []; - pos.push(count); - positionsMap.set(ac, pos); - } - } - } - } - const accents = []; - for (const [accent, follows] of followsMap) { - let last = -1; - const positions = (positionsMap.get(accent) || []).map((value, index) => { - const delta = value - last; - last = value; - if (index === 0) { - return value; - } - return delta; - }); - // Find the best encoding of the position data - let positionData = ""; - for (let i = 2; i < 7; i++) { - const bitWriter = new BitWriter(i); - for (const p of positions) { - bitWriter.write(p); - } - if (positionData === "" || bitWriter.length < positionData.length) { - positionData = bitWriter.data; - } - } - const positionsLength = positions.length; - const positionDataLength = positionData.length; - accents.push({ accent, follows, positions, positionsLength, positionData, positionDataLength }); - } - words = words.map((word) => { - let result = ""; - for (let i = 0; i < word.length; i++) { - const c = word[i]; - if (c >= 'a' && c <= 'z') { - result += c; - } - } - return result; - }); - return { accents, words }; -} -exports.extractAccents = extractAccents; -// Encode Official WordList -function encodeOwl(words) { - // Fold the sorted words by indicating delta for the first 2 letters - let data = camelcase(fold(fold(words, ":"), ";")); - // Replace semicolons with counts (e.g. ";;;" with "3") - data = data.replace(/(;+)/g, (all, semis) => { - let result = ""; - while (semis.length) { - let count = semis.length; - if (count > 10) { - count = 10; - } - result += String(count - 1); - semis = semis.substring(count); - } - return result; - }); - // Finds the best option for a shortcut replacement using the - // unused ascii7 characters - function findBest() { - const tally = {}; - const l = 2; - for (let i = l; i < data.length; i++) { - const key = data.substring(i - l, i); - tally[key] = (tally[key] || 0) + 1; - } - const sorted = Object.keys(tally).map((text) => { - return { text, count: tally[text], save: (tally[text] * (text.length - 1)) }; - }); - sorted.sort((a, b) => (b.save - a.save)); - return sorted[0].text; - } - // Make substitutions - let subs = ""; - for (let i = 0; i < subsChrs.length; i++) { - const n = subsChrs[i], o = findBest(); - subs += o; - data = data.split(o).join(n); - } - return { data, subs }; -} -exports.encodeOwl = encodeOwl; -// Returns either: -// - OWL data for accent-free latin-1: { data, accentds: "" } -// - OWLA data for accented latin-1: { data, accents } -function encodeWords(_words) { - const { accents, words } = extractAccents(_words); - const { data, subs } = encodeOwl(words); - const accentData = accents.map(({ accent, follows, positionData }) => { - return `${follows}${accent}${positionData}`; - }).join(","); - return { - data: `0${subs}${data}`, - accents: accentData - }; -} -// CLI -const content = fs_1.default.readFileSync(process.argv[2]).toString(); -const words = content.split("\n").filter(Boolean); -const { data, accents } = encodeWords(words); -if (accents) { - const rec = (0, decode_owla_js_1.decodeOwlA)(data, accents); - console.log("DATA: ", JSON.stringify(data)); - console.log("ACCENTS: ", JSON.stringify(accents)); - console.log("LENGTH: ", data.length); - console.log("CHECKSUM: ", (0, id_js_1.id)(content)); - console.log("RATIO: ", Math.trunc(100 * data.length / content.length) + "%"); - if (rec.join("\n") !== words.join("\n")) { - throw new Error("no match!"); - } -} -else { - const rec = (0, decode_owl_js_1.decodeOwl)(data); - console.log("DATA: ", JSON.stringify(data)); - console.log("LENGTH: ", data.length); - console.log("CHECKSUM: ", (0, id_js_1.id)(content)); - console.log("RATIO: ", Math.trunc(100 * data.length / content.length) + "%"); - if (rec.join("\n") !== words.join("\n")) { - throw new Error("no match!"); - } -} -//# sourceMappingURL=encode-latin.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/generation/encode-latin.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/generation/encode-latin.js.map deleted file mode 100644 index 1eff9dd8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/generation/encode-latin.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"encode-latin.js","sourceRoot":"","sources":["../../../src.ts/wordlists/generation/encode-latin.ts"],"names":[],"mappings":";AACA,kBAAkB;AAClB,EAAE;AACF,6DAA6D;AAC7D,2DAA2D;AAC3D,wDAAwD;AACxD,WAAW;AACX,EAAE;AACF,0BAA0B;AAC1B,uCAAuC;AACvC,6DAA6D;AAC7D,mBAAmB;AACnB,uCAAuC;AACvC,4DAA4D;AAC5D,6DAA6D;AAC7D,kBAAkB;AAClB,EAAE;AACF,mEAAmE;AACnE,oEAAoE;AACpE,qCAAqC;AACrC,qDAAqD;AACrD,kEAAkE;AAClE,qBAAqB;AACrB,6CAA6C;AAC7C,+DAA+D;AAC/D,qEAAqE;AACrE,UAAU;AACV,iDAAiD;AACjD,wEAAwE;AACxE,6BAA6B;AAC7B,EAAE;AACF,uEAAuE;AACvE,2EAA2E;AAC3E,yEAAyE;AACzE,iBAAiB;AACjB,EAAE;AACF,qBAAqB;AACrB,EAA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,GAAG,CAAC,CAAC;IAChF,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC;KAAE;CAC7E"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/index.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/index.d.ts deleted file mode 100644 index 04a911c8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/index.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * A Wordlist is a set of 2048 words used to encode private keys - * (or other binary data) that is easier for humans to write down, - * transcribe and dictate. - * - * The [[link-bip-39]] standard includes several checksum bits, - * depending on the size of the mnemonic phrase. - * - * A mnemonic phrase may be 12, 15, 18, 21 or 24 words long. For - * most purposes 12 word mnemonics should be used, as including - * additional words increases the difficulty and potential for - * mistakes and does not offer any effective improvement on security. - * - * There are a variety of [[link-bip39-wordlists]] for different - * languages, but for maximal compatibility, the - * [English Wordlist](LangEn) is recommended. - * - * @_section: api/wordlists:Wordlists [about-wordlists] - */ -export { Wordlist } from "./wordlist.js"; -export { LangEn } from "./lang-en.js"; -export { WordlistOwl } from "./wordlist-owl.js"; -export { WordlistOwlA } from "./wordlist-owla.js"; -export { wordlists } from "./wordlists.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/index.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/index.d.ts.map deleted file mode 100644 index ecd1d4b6..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/index.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/index.js deleted file mode 100644 index 26e29cf5..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/index.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.wordlists = exports.WordlistOwlA = exports.WordlistOwl = exports.LangEn = exports.Wordlist = void 0; -/** - * A Wordlist is a set of 2048 words used to encode private keys - * (or other binary data) that is easier for humans to write down, - * transcribe and dictate. - * - * The [[link-bip-39]] standard includes several checksum bits, - * depending on the size of the mnemonic phrase. - * - * A mnemonic phrase may be 12, 15, 18, 21 or 24 words long. For - * most purposes 12 word mnemonics should be used, as including - * additional words increases the difficulty and potential for - * mistakes and does not offer any effective improvement on security. - * - * There are a variety of [[link-bip39-wordlists]] for different - * languages, but for maximal compatibility, the - * [English Wordlist](LangEn) is recommended. - * - * @_section: api/wordlists:Wordlists [about-wordlists] - */ -var wordlist_js_1 = require("./wordlist.js"); -Object.defineProperty(exports, "Wordlist", { enumerable: true, get: function () { return wordlist_js_1.Wordlist; } }); -var lang_en_js_1 = require("./lang-en.js"); -Object.defineProperty(exports, "LangEn", { enumerable: true, get: function () { return lang_en_js_1.LangEn; } }); -var wordlist_owl_js_1 = require("./wordlist-owl.js"); -Object.defineProperty(exports, "WordlistOwl", { enumerable: true, get: function () { return wordlist_owl_js_1.WordlistOwl; } }); -var wordlist_owla_js_1 = require("./wordlist-owla.js"); -Object.defineProperty(exports, "WordlistOwlA", { enumerable: true, get: function () { return wordlist_owla_js_1.WordlistOwlA; } }); -var wordlists_js_1 = require("./wordlists.js"); -Object.defineProperty(exports, "wordlists", { enumerable: true, get: function () { return wordlists_js_1.wordlists; } }); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/index.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/index.js.map deleted file mode 100644 index fe47560b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/wordlists/index.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,6CAAyC;AAAhC,uGAAA,QAAQ,OAAA;AACjB,2CAAsC;AAA7B,oGAAA,MAAM,OAAA;AAEf,qDAAgD;AAAvC,8GAAA,WAAW,OAAA;AACpB,uDAAkD;AAAzC,gHAAA,YAAY,OAAA;AAErB,+CAA2C;AAAlC,yGAAA,SAAS,OAAA"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-cz.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-cz.d.ts deleted file mode 100644 index c199d4fa..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-cz.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { WordlistOwl } from "./wordlist-owl.js"; -/** - * The [[link-bip39-cz]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export declare class LangCz extends WordlistOwl { - /** - * Creates a new instance of the Czech language Wordlist. - * - * Using the constructor should be unnecessary, instead use the - * [[wordlist]] singleton method. - * - * @_ignore: - */ - constructor(); - /** - * Returns a singleton instance of a ``LangCz``, creating it - * if this is the first time being called. - */ - static wordlist(): LangCz; -} -//# sourceMappingURL=lang-cz.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-cz.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-cz.d.ts.map deleted file mode 100644 index 975a36b5..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-cz.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-cz.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-cz.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAOhD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IAEnC;;;;;;;OAOG;;IAGH;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM;CAI5B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-cz.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-cz.js deleted file mode 100644 index 405c4564..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-cz.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.LangCz = void 0; -const wordlist_owl_js_1 = require("./wordlist-owl.js"); -const words = "0itatkastcenaovo$taouleraeki&chor*teci%enbalodaeladet'!Chn=0Di#%E%^1Resa2Rese3CeT'#0EjKohol0Pu)%0A&sDul#Ekdo)Ke)Ti#Ul|3}aOgan%0FaltI$@tPi,%TmaTronom0LasL{i#Ol0Tobus4Yl:B#}R'?TaUb_U/!U^U+Ur!Xer2A^v#Ambo,An#AtrEp)Ike)KoLohOnzOskevUn{#Usin#Z^Zy2Bl.Bn|})D _D#D'aF{Jar(Kv?LdokLvaN^NkrRzaTikVolZola3D+tL.T'#0Ukot:PartRev&3DrDu+J/JnLaLerLkemLn?N.Nn(N'#NtrumNzZ(2O&2Koliv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&jZemsko0ArohOr[Rd(Rz2GrKev:0Oh(OzeR!R*s-RusYt'&0HoTiv(0Iv 3R` 1Edn!I$ M=0Az!_Lidn Lon Otv Roj 0I%I)Ov 0Yv`]0Av IfR*s 1Al Oln Oz'#3D,v ElEn.L.N!:GonL/aL*nNaN^lNil#RanRhanyR|1ElkuHod0Ova0DroGe)%J%Lbl*dL{rhL _LmocLry[Nk'Ran^RzeS_#SkrzeSn?SpoduS)Ter.Ver#3B,%}rDeoh,D.D+LaN?S{Tal aZeZ #0Ezd0L`Us0Aj#AkAs>EvoHk(IvN'#Oup!1Uc|Uk0DaDiv(Doz&kD$voJ@skyJ&JskoLantL[L LnoSk'#Zid]Z'&0Ravo1Ab>A%tAhA)Ba}o+kH!StvaTu+0Ad T*p Tup0Ip4Bav Br!}|D!D,Fot H+d!H~Hod H,d Hub Jasn J{Jm=K]p Kon!L-!Maz!Mez Miz{Mys+tNe/!Nik!Nut P`!Pl! P,v Pu$ Raz R'n!Rv!Sl' SokoS)v Su~Syp!Tas Tes!Tr! Vi~Vol!Vrh_Zdob Zn!0AduBud }op DJ{Ji$ K+p!K*p Lep Mez Mot!Mys+tNe/!Nik!Pl! Poj Ps!Raz S)v Su~Taj Temn Tk~Ujm=Val Ve+tVin Vol!Vrt!Zvon 0Av RusuUd|Yt-1A+#ArmaAtn(IvoOb RojVihYm`]0L@.ManM.Pt!Z`uZdola2At Lt~Lubo#Ot' Ru[0MaMn?0Emn 0Lam!Oum!R!#Umav#0AtoEh#O[OmO$Ozvyk0Ap|ArAt-IjeIz{Ocn Odr!Rzl.Ut|0AkAl(Am@!Ovu0B,z Tav Ub-Ufa+0Lod Omal RavaR( Rud#Rvu1A^An C`]N (NoOv&Y/l Zav(1I/aR! 0B'.Br0Ed~EnkuEs_aOnR!Uk'odYk"; -const checksum = "0x25f44555f4af25b51a711136e1c7d6e50ce9f8917d39d6b1f076b2bb4d2fac1a"; -let wordlist = null; -/** - * The [[link-bip39-cz]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -class LangCz extends wordlist_owl_js_1.WordlistOwl { - /** - * Creates a new instance of the Czech language Wordlist. - * - * Using the constructor should be unnecessary, instead use the - * [[wordlist]] singleton method. - * - * @_ignore: - */ - constructor() { super("cz", words, checksum); } - /** - * Returns a singleton instance of a ``LangCz``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist == null) { - wordlist = new LangCz(); - } - return wordlist; - } -} -exports.LangCz = LangCz; -//# sourceMappingURL=lang-cz.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-cz.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-cz.js.map deleted file mode 100644 index e62fbe4f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-cz.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-cz.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-cz.ts"],"names":[],"mappings":";;;AAAA,uDAAgD;AAEhD,MAAM,KAAK,GAAG,q9NAAq9N,CAAC;AACp+N,MAAM,QAAQ,GAAG,oEAAoE,CAAC;AAEtF,IAAI,QAAQ,GAAkB,IAAI,CAAC;AAEnC;;;;GAIG;AACH,MAAa,MAAO,SAAQ,6BAAW;IAEnC;;;;;;;OAOG;IACH,gBAAgB,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IAE/C;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACX,IAAI,QAAQ,IAAI,IAAI,EAAE;YAAE,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;SAAE;QAClD,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ;AApBD,wBAoBC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-en.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-en.d.ts deleted file mode 100644 index 87a3234b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-en.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { WordlistOwl } from "./wordlist-owl.js"; -/** - * The [[link-bip39-en]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export declare class LangEn extends WordlistOwl { - /** - * Creates a new instance of the English language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langEn]] should suffice. - * - * @_ignore: - */ - constructor(); - /** - * Returns a singleton instance of a ``LangEn``, creating it - * if this is the first time being called. - */ - static wordlist(): LangEn; -} -//# sourceMappingURL=lang-en.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-en.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-en.d.ts.map deleted file mode 100644 index 1a3bf42a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-en.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-en.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-en.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAOhD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IAEnC;;;;;;;OAOG;;IAGH;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM;CAI5B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-en.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-en.js deleted file mode 100644 index 27cac27a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-en.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.LangEn = void 0; -const wordlist_owl_js_1 = require("./wordlist-owl.js"); -const words = "0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-EgSe0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'H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.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOgAyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NNGradeHoldOnP Set1BOng::Rd3Ar~ow9UUngU`:3BraRo9NeO"; -const checksum = "0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"; -let wordlist = null; -/** - * The [[link-bip39-en]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -class LangEn extends wordlist_owl_js_1.WordlistOwl { - /** - * Creates a new instance of the English language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langEn]] should suffice. - * - * @_ignore: - */ - constructor() { super("en", words, checksum); } - /** - * Returns a singleton instance of a ``LangEn``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist == null) { - wordlist = new LangEn(); - } - return wordlist; - } -} -exports.LangEn = LangEn; -//# sourceMappingURL=lang-en.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-en.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-en.js.map deleted file mode 100644 index 763d7744..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-en.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-en.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-en.ts"],"names":[],"mappings":";;;AAAA,uDAAgD;AAEhD,MAAM,KAAK,GAAG,u3LAAu3L,CAAC;AACt4L,MAAM,QAAQ,GAAG,oEAAoE,CAAC;AAEtF,IAAI,QAAQ,GAAkB,IAAI,CAAC;AAEnC;;;;GAIG;AACH,MAAa,MAAO,SAAQ,6BAAW;IAEnC;;;;;;;OAOG;IACH,gBAAgB,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IAE/C;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACX,IAAI,QAAQ,IAAI,IAAI,EAAE;YAAE,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;SAAE;QAClD,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ;AApBD,wBAoBC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-es.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-es.d.ts deleted file mode 100644 index 7e51683e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-es.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { WordlistOwlA } from "./wordlist-owla.js"; -/** - * The [[link-bip39-es]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export declare class LangEs extends WordlistOwlA { - /** - * Creates a new instance of the Spanish language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langEs]] should suffice. - * - * @_ignore: - */ - constructor(); - /** - * Returns a singleton instance of a ``LangEs``, creating it - * if this is the first time being called. - */ - static wordlist(): LangEs; -} -//# sourceMappingURL=lang-es.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-es.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-es.d.ts.map deleted file mode 100644 index 074d92d8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-es.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-es.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-es.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAQlD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,YAAY;IAEpC;;;;;;;OAOG;;IAGH;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM;CAI5B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-es.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-es.js deleted file mode 100644 index b48bd5e7..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-es.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.LangEs = void 0; -const wordlist_owla_js_1 = require("./wordlist-owla.js"); -const words = "0arertoiotadonoaRteirroenaNonaLsolocoiliaralaorrenadaChoN$n0A>Dom,EjaI!#Oga&O'Or#RazoR*Ue=U<0Ab Adem@CeLe%OmoRa!RozUn0DazD$GeLaM,#S,)T^0AlAnceA+EEl]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^DoE{G*I&In/e%LoMboM^Ptu[TaTi`:Ba&B!B$BleC GazG[&L/&L!oL*Lm.L.Ls/#LudLv Mb-c~Ndi-e Ng_Ni{dN}#PoQueRdin()nSt_TanU`Xof.3Cc~CoC_#C%DGu*IsL=LvaMa`M?l-d-Re'Rg*S#T?:Ba>BiqueB]BuCoC#JoL L>L,#Ll/.Ma'Mb^Ng}quePaPe)P@P.Qu?l(deRe(if(je%RotR+R%TuajeU+ZaZ.3At+|oC]CnicaJa&J!Ji&L/efo'MaM^Mp=NazNd!N!NisNRmi'Rnur(+rSisSo+StigoT!aX#Z3B$Bu+nEmpoEn{Er[EPoR(.TanT!eTu=Za5Al]B?=C Ci'DoG/&M N}#P PeQueRaxR!oRm,%RneoRoRpe&R_RS!Xi>2AbajoAc#rA!Afi>AgoAjeAmoAnceA#AumaAz EbolEguaEin%EnEp EsIbuIgoIpaIs)IunfoOfeoOmpaOn>OpaO)OzoU>Ue'Ufa2B!@BoEr#MbaM^NelNic(bin(ismoR'T^:0Ic 9C!a0B[l0I{dIrIv!; - join(words: Array): string; - /** - * Returns a singleton instance of a ``LangJa``, creating it - * if this is the first time being called. - */ - static wordlist(): LangJa; -} -//# sourceMappingURL=lang-ja.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-ja.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-ja.d.ts.map deleted file mode 100644 index a1ed9546..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-ja.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-ja.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-ja.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAkIzC;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IAEhC;;;;;;;OAOG;;IAGH,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAO9B,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAIlC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAKpC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM;IAIlC;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM;CAI5B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-ja.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-ja.js deleted file mode 100644 index 453d7d24..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-ja.js +++ /dev/null @@ -1,158 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.LangJa = void 0; -const index_js_1 = require("../hash/index.js"); -const index_js_2 = require("../utils/index.js"); -const wordlist_js_1 = require("./wordlist.js"); -const data = [ - // 4-kana words - "AQRASRAGBAGUAIRAHBAghAURAdBAdcAnoAMEAFBAFCBKFBQRBSFBCXBCDBCHBGFBEQBpBBpQBIkBHNBeOBgFBVCBhBBhNBmOBmRBiHBiFBUFBZDBvFBsXBkFBlcBjYBwDBMBBTBBTRBWBBWXXaQXaRXQWXSRXCFXYBXpHXOQXHRXhRXuRXmXXbRXlXXwDXTRXrCXWQXWGaBWaKcaYgasFadQalmaMBacAKaRKKBKKXKKjKQRKDRKCYKCRKIDKeVKHcKlXKjHKrYNAHNBWNaRNKcNIBNIONmXNsXNdXNnBNMBNRBNrXNWDNWMNFOQABQAHQBrQXBQXFQaRQKXQKDQKOQKFQNBQNDQQgQCXQCDQGBQGDQGdQYXQpBQpQQpHQLXQHuQgBQhBQhCQuFQmXQiDQUFQZDQsFQdRQkHQbRQlOQlmQPDQjDQwXQMBQMDQcFQTBQTHQrDDXQDNFDGBDGQDGRDpFDhFDmXDZXDbRDMYDRdDTRDrXSA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FiJFcfXNJDRcNJWMTBLJXC", - // 8-kana words - "BraFUtHBFSJFdbNBLJXVJQoYJNEBSJBEJfHSJHwXUJCJdAZJMGjaFVJXEJPNJBlEJfFiJFpFbFEJqIJBVJCrIBdHiJhOPFChvJVJZJNJWxGFNIFLueIBQJqUHEJfUFstOZJDrlXEASJRlXVJXSFwVJNJWD", - // 9-kana words - "QJEJNNJDQJEJIBSFQJEJxegBQJEJfHEPSJBmXEJFSJCDEJqXLXNJFQqXIcQsFNJFIFEJqXUJgFsJXIJBUJEJfHNFvJxEqXNJnXUJFQqD", - // 10-kana words - "IJBEJqXZJ" -]; -// Maps each character into its kana value (the index) -const mapping = "~~AzB~X~a~KN~Q~D~S~C~G~E~Y~p~L~I~O~eH~g~V~hxyumi~~U~~Z~~v~~s~~dkoblPjfnqwMcRTr~W~~~F~~~~~Jt"; -let _wordlist = null; -function hex(word) { - return (0, index_js_2.hexlify)((0, index_js_2.toUtf8Bytes)(word)); -} -const KiYoKu = "0xe3818de38284e3818f"; -const KyoKu = "0xe3818de38283e3818f"; -function toString(data) { - return (0, index_js_2.toUtf8String)(new Uint8Array(data)); -} -function loadWords() { - if (_wordlist !== null) { - return _wordlist; - } - const wordlist = []; - // Transforms for normalizing (sort is a not quite UTF-8) - const transform = {}; - // Delete the diacritic marks - transform[toString([227, 130, 154])] = false; - transform[toString([227, 130, 153])] = false; - // Some simple transforms that sort out most of the order - transform[toString([227, 130, 133])] = toString([227, 130, 134]); - transform[toString([227, 129, 163])] = toString([227, 129, 164]); - transform[toString([227, 130, 131])] = toString([227, 130, 132]); - transform[toString([227, 130, 135])] = toString([227, 130, 136]); - // Normalize words using the transform - function normalize(word) { - let result = ""; - for (let i = 0; i < word.length; i++) { - let kana = word[i]; - const target = transform[kana]; - if (target === false) { - continue; - } - if (target) { - kana = target; - } - result += kana; - } - return result; - } - // Sort how the Japanese list is sorted - function sortJapanese(a, b) { - a = normalize(a); - b = normalize(b); - if (a < b) { - return -1; - } - if (a > b) { - return 1; - } - return 0; - } - // Load all the words - for (let length = 3; length <= 9; length++) { - const d = data[length - 3]; - for (let offset = 0; offset < d.length; offset += length) { - const word = []; - for (let i = 0; i < length; i++) { - const k = mapping.indexOf(d[offset + i]); - word.push(227); - word.push((k & 0x40) ? 130 : 129); - word.push((k & 0x3f) + 128); - } - wordlist.push(toString(word)); - } - } - wordlist.sort(sortJapanese); - // For some reason kyoku and kiyoku are flipped in node (!!). - // The order SHOULD be: - // - kyoku - // - kiyoku - // This should ignore "if", but that doesn't work here?? - /* c8 ignore start */ - if (hex(wordlist[442]) === KiYoKu && hex(wordlist[443]) === KyoKu) { - const tmp = wordlist[442]; - wordlist[442] = wordlist[443]; - wordlist[443] = tmp; - } - /* c8 ignore stop */ - // Verify the computed list matches the official list - /* istanbul ignore if */ - const checksum = (0, index_js_1.id)(wordlist.join("\n") + "\n"); - /* c8 ignore start */ - if (checksum !== "0xcb36b09e6baa935787fd762ce65e80b0c6a8dabdfbc3a7f86ac0e2c4fd111600") { - throw new Error("BIP39 Wordlist for ja (Japanese) FAILED"); - } - /* c8 ignore stop */ - _wordlist = wordlist; - return wordlist; -} -let wordlist = null; -/** - * The [[link-bip39-ja]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -class LangJa extends wordlist_js_1.Wordlist { - /** - * Creates a new instance of the Japanese language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langJa]] should suffice. - * - * @_ignore: - */ - constructor() { super("ja"); } - getWord(index) { - const words = loadWords(); - (0, index_js_2.assertArgument)(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); - return words[index]; - } - getWordIndex(word) { - return loadWords().indexOf(word); - } - split(phrase) { - //logger.assertNormalize(); - return phrase.split(/(?:\u3000| )+/g); - } - join(words) { - return words.join("\u3000"); - } - /** - * Returns a singleton instance of a ``LangJa``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist == null) { - wordlist = new LangJa(); - } - return wordlist; - } -} -exports.LangJa = LangJa; -//# sourceMappingURL=lang-ja.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-ja.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-ja.js.map deleted file mode 100644 index 50fab4eb..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-ja.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-ja.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-ja.ts"],"names":[],"mappings":";;;AAAA,+CAAsC;AACtC,gDAE2B;AAE3B,+CAAyC;AAGzC,MAAM,IAAI,GAAG;IAET,eAAe;IACf,orEAAorE;IAEprE,eAAe;IACf,ssGAAssG;IAEtsG,eAAe;IACf,4uDAA4uD;IAE5uD,eAAe;IACf,olBAAolB;IAEplB,eAAe;IACf,4JAA4J;IAE5J,eAAe;IACf,0GAA0G;IAE1G,gBAAgB;IAChB,WAAW;CACd,CAAC;AAEF,sDAAsD;AACtD,MAAM,OAAO,GAAG,6FAA6F,CAAA;AAE7G,IAAI,SAAS,GAAyB,IAAI,CAAC;AAE3C,SAAS,GAAG,CAAC,IAAY;IACrB,OAAO,IAAA,kBAAO,EAAC,IAAA,sBAAW,EAAC,IAAI,CAAC,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,MAAM,GAAG,sBAAsB,CAAC;AACtC,MAAM,KAAK,GAAG,sBAAsB,CAAA;AAEpC,SAAS,QAAQ,CAAC,IAAmB;IACjC,OAAO,IAAA,uBAAY,EAAC,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;AAC9C,CAAC;AAED,SAAS,SAAS;IACd,IAAI,SAAS,KAAK,IAAI,EAAE;QAAE,OAAO,SAAS,CAAC;KAAE;IAE7C,MAAM,QAAQ,GAAkB,EAAE,CAAC;IAEnC,yDAAyD;IACzD,MAAM,SAAS,GAAwC,EAAE,CAAC;IAE1D,6BAA6B;IAC7B,SAAS,CAAC,QAAQ,CAAC,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IAAY;QACrB,OAAO,SAAS,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;IAED,KAAK,CAAC,MAAc;QAChB,2BAA2B;QAC3B,OAAO,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAC1C,CAAC;IAED,IAAI,CAAC,KAAoB;QACrB,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAChC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACX,IAAI,QAAQ,IAAI,IAAI,EAAE;YAAE,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;SAAE;QAClD,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ;AAxCD,wBAwCC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-ko.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-ko.d.ts deleted file mode 100644 index 4329e055..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-ko.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Wordlist } from "./wordlist.js"; -/** - * The [[link-bip39-ko]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export declare class LangKo extends Wordlist { - /** - * Creates a new instance of the Korean language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langKo]] should suffice. - * - * @_ignore: - */ - constructor(); - getWord(index: number): string; - getWordIndex(word: string): number; - /** - * Returns a singleton instance of a ``LangKo``, creating it - * if this is the first time being called. - */ - static wordlist(): LangKo; -} -//# sourceMappingURL=lang-ko.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-ko.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-ko.d.ts.map deleted file mode 100644 index 71fbbcdf..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-ko.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-ko.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-ko.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AA8DzC;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IAEhC;;;;;;;OAOG;;IAKH,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAO9B,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAIlC;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM;CAI5B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-ko.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-ko.js deleted file mode 100644 index 189787d7..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-ko.js +++ /dev/null @@ -1,93 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.LangKo = void 0; -const index_js_1 = require("../hash/index.js"); -const index_js_2 = require("../utils/index.js"); -const wordlist_js_1 = require("./wordlist.js"); -const data = [ - "OYAa", - "ATAZoATBl3ATCTrATCl8ATDloATGg3ATHT8ATJT8ATJl3ATLlvATLn4ATMT8ATMX8ATMboATMgoAToLbAToMTATrHgATvHnAT3AnAT3JbAT3MTAT8DbAT8JTAT8LmAT8MYAT8MbAT#LnAUHT8AUHZvAUJXrAUJX8AULnrAXJnvAXLUoAXLgvAXMn6AXRg3AXrMbAX3JTAX3QbAYLn3AZLgvAZrSUAZvAcAZ8AaAZ8AbAZ8AnAZ8HnAZ8LgAZ8MYAZ8MgAZ8OnAaAboAaDTrAaFTrAaJTrAaJboAaLVoAaMXvAaOl8AaSeoAbAUoAbAg8AbAl4AbGnrAbMT8AbMXrAbMn4AbQb8AbSV8AbvRlAb8AUAb8AnAb8HgAb8JTAb8NTAb8RbA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nLX4QYvFYHnMXrRUoJnGnvFnRlvFTJlQnoSTrBXHXrLYSUJgLfoMT8Se8DTrHbDb", - "AbDl8SToJU8An3RbAb8ST8DUSTrGnrAgoLbFU6Db8LTrMg8AaHT8Jb8ObDl8SToJU8Pb3RlvFYoJl" -]; -const codes = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*"; -function getHangul(code) { - if (code >= 40) { - code = code + 168 - 40; - } - else if (code >= 19) { - code = code + 97 - 19; - } - return (0, index_js_2.toUtf8String)(new Uint8Array([225, (code >> 6) + 132, (code & 0x3f) + 128])); -} -let _wordlist = null; -function loadWords() { - if (_wordlist != null) { - return _wordlist; - } - const wordlist = []; - data.forEach((data, length) => { - length += 4; - for (let i = 0; i < data.length; i += length) { - let word = ""; - for (let j = 0; j < length; j++) { - word += getHangul(codes.indexOf(data[i + j])); - } - wordlist.push(word); - } - }); - wordlist.sort(); - // Verify the computed list matches the official list - /* istanbul ignore if */ - const checksum = (0, index_js_1.id)(wordlist.join("\n") + "\n"); - /* c8 ignore start */ - if (checksum !== "0xf9eddeace9c5d3da9c93cf7d3cd38f6a13ed3affb933259ae865714e8a3ae71a") { - throw new Error("BIP39 Wordlist for ko (Korean) FAILED"); - } - /* c8 ignore stop */ - _wordlist = wordlist; - return wordlist; -} -let wordlist = null; -/** - * The [[link-bip39-ko]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -class LangKo extends wordlist_js_1.Wordlist { - /** - * Creates a new instance of the Korean language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langKo]] should suffice. - * - * @_ignore: - */ - constructor() { - super("ko"); - } - getWord(index) { - const words = loadWords(); - (0, index_js_2.assertArgument)(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); - return words[index]; - } - getWordIndex(word) { - return loadWords().indexOf(word); - } - /** - * Returns a singleton instance of a ``LangKo``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist == null) { - wordlist = new LangKo(); - } - return wordlist; - } -} -exports.LangKo = LangKo; -//# sourceMappingURL=lang-ko.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-ko.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-ko.js.map deleted file mode 100644 index 3a680309..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-ko.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-ko.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-ko.ts"],"names":[],"mappings":";;;AAAA,+CAAsC;AACtC,gDAAiE;AAEjE,+CAAyC;AAGzC,MAAM,IAAI,GAAG;IACT,MAAM;IACN,y5JAAy5J;IACz5J,8lIAA8lI;IAC9lI,i8BAAi8B;IACj8B,koCAAkoC;IACloC,yaAAya;IACza,gHAAgH;IAChH,+EAA+E;CAClF,CAAA;AAED,MAAM,KAAK,GAAG,wEAAwE,CAAA;AAEtF,SAAS,SAAS,CAAC,IAAY;IAC3B,IAAI,IAAI,IAAI,EAAE,EAAE;QACZ,IAAI,GAAG,IAAI,GAAG,GAAG,GAAG,EAAE,CAAC;KAC1B;SAAM,IAAI,IAAI,IAAI,EAAE,EAAE;QACnB,IAAI,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,CAAC;KACzB;IAED,OAAO,IAAA,uBAAY,EAAC,IAAI,UAAU,CAAC,CAAE,GAAG,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;AACxF,CAAC;AAED,IAAI,SAAS,GAAyB,IAAI,CAAC;AAE3C,SAAS,SAAS;IACd,IAAI,SAAS,IAAI,IAAI,EAAE;QAAE,OAAO,SAAS,CAAC;KAAE;IAE5C,MAAM,QAAQ,GAAkB,EAAG,CAAC;IAEpC,IAAI,CAAC,OAAO,CAAC,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AAK,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;IAED,YAAY,CAAC,IAAY;QACrB,OAAO,SAAS,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACX,IAAI,QAAQ,IAAI,IAAI,EAAE;YAAE,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;SAAE;QAClD,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ;AAjCD,wBAiCC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-pt.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-pt.d.ts deleted file mode 100644 index f218013c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-pt.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { WordlistOwl } from "./wordlist-owl.js"; -/** - * The [[link-bip39-pt]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export declare class LangPt extends WordlistOwl { - /** - * Creates a new instance of the Portuguese language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langPt]] should suffice. - * - * @_ignore: - */ - constructor(); - /** - * Returns a singleton instance of a ``LangPt``, creating it - * if this is the first time being called. - */ - static wordlist(): LangPt; -} -//# sourceMappingURL=lang-pt.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-pt.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-pt.d.ts.map deleted file mode 100644 index 68f390d5..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-pt.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-pt.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-pt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAOhD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IAEnC;;;;;;;OAOG;;IAGH;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM;CAI5B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-pt.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-pt.js deleted file mode 100644 index 4efe2fab..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-pt.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.LangPt = void 0; -const wordlist_owl_js_1 = require("./wordlist-owl.js"); -const words = "0arad!ototealirertainrasoent hoandoaR#riareha!aroele'oronul0Aca%AixoAl A%rDuz'El]Er$IsmoO$ Rum S-&T(i&TigoVo[=0F&.Il#P' S?S* So&/Sun$Tr&0Ac#Adu+Al/A[f E End(Er_EuIng'Ir?IvoOl{oRac Revi=RizU&Um0Di$rM-.R>o+TismoT|@Tu 0Ali An%Ar@Ent&Es,I?Is Ul,1Ila1Ar E=Ei%Ulejo:B BosaC&]uCh `C@GagemI+c>~/Se#S)n%Ta)Te=rTidaTomTuc Unil]3B(IjoIr^IsebolLd!eLezaLgaLisc Ndi$Ng&aNz(RimbauRl*d>_Sou_XigaZ(_3CoCu=En&Foc&Furc G|naLhe%Mest[Mo$rOlog@OmboOsf(aPol Rr-$Scoi$Sne$SpoSsex$TolaZ _2Ind#OcoOque 2A$BagemC#CejoChec]Ico.L^LetimL]LoMb{oNdeNecoNi)Rb~h>d>e&R+c]V*oXe?2AncoAsaAvezaEuIgaIl/Inc OaOchu+Onze O$Uxo2C]DismoF LeRacoScaS$Z*a:Bimb Rn{oRpe%R['>)zRv&/SacoScaSeb[S%loS~oT a)Tiv UleUs?U%l V&oV(na3BolaDil]G}]Lebr L~ Nou+N,N%ioRc Rr#R%'oRvejaTimV^2Aco)Al{aAm#Ap^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%nceRucaSc#SquisaS,aTisc 3AdaC#Ed!eGm-$Last+Lh#Lo.M-)Nc`NguimN]No%N.On{oPocaQue%ResRue)Sc S$laTg-$Rje)Tur Ud!eXof}eZ}&3C C~ DaD-$Di#Do,Du$rGm-$G[=Gun=IvaLe$LvagemM<&M-%N?N/rNsu&Nt#P #Rei>*g>+RvoTemb_T|3GiloLhue)Lic}eMetr@Mpat@M~ N&Nc(oNg~ NopseN$ni>-eRiTu#5B(fis)Rp[s>[&Rt'Sp'oS%n$:B`aBle%Bu^C/G `aLh(LoLvezMdioRef>j>+xaTuagemUr*oXativoXis)3Atr&C(Ci=Cl#Dio,IaIm Lef}eLh#Mp(oN-%N,rN.Rm&RnoRr-oSeSou+St#ToXtu+Xugo3A+G`aJoloMbr MidezNgi=N%'oRagemT~ 5Al]C]L( LiceM^Mil/N`Ntu+Pe%R>ci=RneioRqueRr!>$S.UcaUp{aX*a2Ab&/Acej Adu$rAfeg Aje$AmaAnc ApoAs{oAt?Av E*oEm(Epid EvoIagemIboIcicloId-%Ilog@Ind!eIploItur Iunf&Oc Ombe)OvaUnfoUque2B~ CquesaT` T|i&:7V 3Bigo0HaId!eIf|me3Olog@SoTigaUbu0A=InaUfru':C*aDi G o,I=,LaL-%Lid!eLo[sN)gemQu{oRe)Rr(Sc~ Sil]S,u+Z Zio3A=D Ge.Ic~ L{oLhiceLu=Nce=rNdav&N( Nt[Rb&Rd!eRe?Rg}h>m`/RnizRs R%n%SpaSti=T|i&3Adu$AgemAj Atu+Br?D{aDr @ElaGaG-%Gi G| L ejoNcoNhe)NilOle)R!>tudeSi.S$Tr&V{oZ*/5A=rArG&L<%LeibolL)gemLumo,Nt!e5L$Vuz`a::D[zRope3QueRe.Rife3Ng ::Ng#Rp 3BuL?9Mb Olog@5Mbi="; -const checksum = "0x2219000926df7b50d8aa0a3d495826b988287df4657fbd100e6fe596c8f737ac"; -let wordlist = null; -/** - * The [[link-bip39-pt]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -class LangPt extends wordlist_owl_js_1.WordlistOwl { - /** - * Creates a new instance of the Portuguese language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langPt]] should suffice. - * - * @_ignore: - */ - constructor() { super("pt", words, checksum); } - /** - * Returns a singleton instance of a ``LangPt``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist == null) { - wordlist = new LangPt(); - } - return wordlist; - } -} -exports.LangPt = LangPt; -//# sourceMappingURL=lang-pt.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-pt.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-pt.js.map deleted file mode 100644 index fcb26e44..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-pt.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-pt.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-pt.ts"],"names":[],"mappings":";;;AAAA,uDAAgD;AAEhD,MAAM,KAAK,GAAG,s0OAAs0O,CAAC;AACr1O,MAAM,QAAQ,GAAG,oEAAoE,CAAC;AAEtF,IAAI,QAAQ,GAAkB,IAAI,CAAC;AAEnC;;;;GAIG;AACH,MAAa,MAAO,SAAQ,6BAAW;IAEnC;;;;;;;OAOG;IACH,gBAAgB,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IAE/C;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACX,IAAI,QAAQ,IAAI,IAAI,EAAE;YAAE,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;SAAE;QAClD,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ;AApBD,wBAoBC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-zh.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-zh.d.ts deleted file mode 100644 index 5d0c14c7..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-zh.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { Wordlist } from "./wordlist.js"; -/** - * The [[link-bip39-zh_cn]] and [[link-bip39-zh_tw]] for - * [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export declare class LangZh extends Wordlist { - /** - * Creates a new instance of the Chinese language Wordlist for - * the %%dialect%%, either ``"cn"`` or ``"tw"`` for simplified - * or traditional, respectively. - * - * This should be unnecessary most of the time as the exported - * [[langZhCn]] and [[langZhTw]] should suffice. - * - * @_ignore: - */ - constructor(dialect: string); - getWord(index: number): string; - getWordIndex(word: string): number; - split(phrase: string): Array; - /** - * Returns a singleton instance of a ``LangZh`` for %%dialect%%, - * creating it if this is the first time being called. - * - * Use the %%dialect%% ``"cn"`` or ``"tw"`` for simplified or - * traditional, respectively. - */ - static wordlist(dialect: string): LangZh; -} -//# sourceMappingURL=lang-zh.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-zh.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-zh.d.ts.map deleted file mode 100644 index 7b96b48e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-zh.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-zh.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-zh.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AA2DzC;;;;;GAKG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IAEhC;;;;;;;;;OASG;gBACS,OAAO,EAAE,MAAM;IAE3B,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAO9B,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAIlC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAKpC;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;CAM3C"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-zh.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-zh.js deleted file mode 100644 index 44aded99..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-zh.js +++ /dev/null @@ -1,96 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.LangZh = void 0; -const index_js_1 = require("../hash/index.js"); -const index_js_2 = require("../utils/index.js"); -const wordlist_js_1 = require("./wordlist.js"); -const data = "}aE#4A=Yv&co#4N#6G=cJ&SM#66|/Z#4t&kn~46#4K~4q%b9=IR#7l,mB#7W_X2*dl}Uo~7s}Uf&Iw#9c&cw~6O&H6&wx&IG%v5=IQ~8a&Pv#47$PR&50%Ko&QM&3l#5f,D9#4L|/H&tQ;v0~6n]nN> 2), - 128 + codes.indexOf(data[i * 3 + 1]), - 128 + codes.indexOf(data[i * 3 + 2]), - ]; - if (locale === "zh_tw") { - const common = s % 4; - for (let i = common; i < 3; i++) { - bytes[i] = codes.indexOf(deltaData[deltaOffset++]) + ((i == 0) ? 228 : 128); - } - } - wordlist.push((0, index_js_2.toUtf8String)(new Uint8Array(bytes))); - } - // Verify the computed list matches the official list - const checksum = (0, index_js_1.id)(wordlist.join("\n") + "\n"); - /* c8 ignore start */ - if (checksum !== Checks[locale]) { - throw new Error(`BIP39 Wordlist for ${locale} (Chinese) FAILED`); - } - /* c8 ignore stop */ - _wordlist[locale] = wordlist; - return wordlist; -} -const wordlists = {}; -/** - * The [[link-bip39-zh_cn]] and [[link-bip39-zh_tw]] for - * [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -class LangZh extends wordlist_js_1.Wordlist { - /** - * Creates a new instance of the Chinese language Wordlist for - * the %%dialect%%, either ``"cn"`` or ``"tw"`` for simplified - * or traditional, respectively. - * - * This should be unnecessary most of the time as the exported - * [[langZhCn]] and [[langZhTw]] should suffice. - * - * @_ignore: - */ - constructor(dialect) { super("zh_" + dialect); } - getWord(index) { - const words = loadWords(this.locale); - (0, index_js_2.assertArgument)(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); - return words[index]; - } - getWordIndex(word) { - return loadWords(this.locale).indexOf(word); - } - split(phrase) { - phrase = phrase.replace(/(?:\u3000| )+/g, ""); - return phrase.split(""); - } - /** - * Returns a singleton instance of a ``LangZh`` for %%dialect%%, - * creating it if this is the first time being called. - * - * Use the %%dialect%% ``"cn"`` or ``"tw"`` for simplified or - * traditional, respectively. - */ - static wordlist(dialect) { - if (wordlists[dialect] == null) { - wordlists[dialect] = new LangZh(dialect); - } - return wordlists[dialect]; - } -} -exports.LangZh = LangZh; -//# sourceMappingURL=lang-zh.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-zh.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-zh.js.map deleted file mode 100644 index 9e71fde8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/lang-zh.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-zh.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-zh.ts"],"names":[],"mappings":";;;AAAA,+CAAsC;AACtC,gDAAiE;AAEjE,+CAAyC;AAGzC,MAAM,IAAI,GAAG,kgMAAkgM,CAAC;AAChhM,MAAM,SAAS,GAAG,6lDAA6lD,CAAC;AAGhnD,MAAM,SAAS,GAAyC;IACpD,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;CACd,CAAA;AAED,MAAM,MAAM,GAA2B;IACnC,KAAK,EAAE,oEAAoE;IAC3E,KAAK,EAAE,oEAAoE;CAC9E,CAAA;AAED,MAAM,KAAK,GAAG,kEAAkE,CAAC;AACjF,MAAM,KA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AAO,CAAC,CAAC;SAC5C;QACD,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;CACJ;AA3CD,wBA2CC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist-owl.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist-owl.d.ts deleted file mode 100644 index c4d1efc0..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist-owl.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { Wordlist } from "./wordlist.js"; -/** - * An OWL format Wordlist is an encoding method that exploits - * the general locality of alphabetically sorted words to - * achieve a simple but effective means of compression. - * - * This class is generally not useful to most developers as - * it is used mainly internally to keep Wordlists for languages - * based on ASCII-7 small. - * - * If necessary, there are tools within the ``generation/`` folder - * to create the necessary data. - */ -export declare class WordlistOwl extends Wordlist { - #private; - /** - * Creates a new Wordlist for %%locale%% using the OWL %%data%% - * and validated against the %%checksum%%. - */ - constructor(locale: string, data: string, checksum: string); - /** - * The OWL-encoded data. - */ - get _data(): string; - /** - * Decode all the words for the wordlist. - */ - _decodeWords(): Array; - getWord(index: number): string; - getWordIndex(word: string): number; -} -//# sourceMappingURL=wordlist-owl.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist-owl.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist-owl.d.ts.map deleted file mode 100644 index fe49ddf8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist-owl.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlist-owl.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist-owl.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;;;;;;;;;;GAWG;AACH,qBAAa,WAAY,SAAQ,QAAQ;;IAIrC;;;OAGG;gBACS,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAO1D;;OAEG;IACH,IAAI,KAAK,IAAI,MAAM,CAAuB;IAE1C;;OAEG;IACH,YAAY,IAAI,KAAK,CAAC,MAAM,CAAC;IAsB7B,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAM9B,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAGrC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist-owl.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist-owl.js deleted file mode 100644 index 12a83fda..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist-owl.js +++ /dev/null @@ -1,70 +0,0 @@ -"use strict"; -// Use the encode-latin.js script to create the necessary -// data files to be consumed by this class -Object.defineProperty(exports, "__esModule", { value: true }); -exports.WordlistOwl = void 0; -const index_js_1 = require("../hash/index.js"); -const index_js_2 = require("../utils/index.js"); -const decode_owl_js_1 = require("./decode-owl.js"); -const wordlist_js_1 = require("./wordlist.js"); -/** - * An OWL format Wordlist is an encoding method that exploits - * the general locality of alphabetically sorted words to - * achieve a simple but effective means of compression. - * - * This class is generally not useful to most developers as - * it is used mainly internally to keep Wordlists for languages - * based on ASCII-7 small. - * - * If necessary, there are tools within the ``generation/`` folder - * to create the necessary data. - */ -class WordlistOwl extends wordlist_js_1.Wordlist { - #data; - #checksum; - /** - * Creates a new Wordlist for %%locale%% using the OWL %%data%% - * and validated against the %%checksum%%. - */ - constructor(locale, data, checksum) { - super(locale); - this.#data = data; - this.#checksum = checksum; - this.#words = null; - } - /** - * The OWL-encoded data. - */ - get _data() { return this.#data; } - /** - * Decode all the words for the wordlist. - */ - _decodeWords() { - return (0, decode_owl_js_1.decodeOwl)(this.#data); - } - #words; - #loadWords() { - if (this.#words == null) { - const words = this._decodeWords(); - // Verify the computed list matches the official list - const checksum = (0, index_js_1.id)(words.join("\n") + "\n"); - /* c8 ignore start */ - if (checksum !== this.#checksum) { - throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`); - } - /* c8 ignore stop */ - this.#words = words; - } - return this.#words; - } - getWord(index) { - const words = this.#loadWords(); - (0, index_js_2.assertArgument)(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); - return words[index]; - } - getWordIndex(word) { - return this.#loadWords().indexOf(word); - } -} -exports.WordlistOwl = WordlistOwl; -//# sourceMappingURL=wordlist-owl.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist-owl.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist-owl.js.map deleted file mode 100644 index b9e9125b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist-owl.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlist-owl.js","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist-owl.ts"],"names":[],"mappings":";AACA,yDAAyD;AACzD,0CAA0C;;;AAE1C,+CAAsC;AACtC,gDAAmD;AAEnD,mDAA4C;AAC5C,+CAAyC;AAEzC;;;;;;;;;;;GAWG;AACH,MAAa,WAAY,SAAQ,sBAAQ;IACrC,KAAK,CAAS;IACd,SAAS,CAAS;IAElB;;;OAGG;IACH,YAAY,MAAc,EAAE,IAAY,EAAE,QAAgB;QACtD,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,IAAI,KAAK,KAAa,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAE1C;;OAEG;IACH,YAAY;QACR,OAAO,IAAA,yBAAS,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IAED,MAAM,CAAuB;IAC7B,UAAU;QACN,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,EAAE;YACrB,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;YAElC,qDAAqD;YACrD,MAAM,QAAQ,GAAG,IAAA,aAAE,EAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;YAC7C,qBAAqB;YACrB,IAAI,QAAQ,KAAK,IAAI,CAAC,SAAS,EAAE;gBAC7B,MAAM,IAAI,KAAK,CAAC,sBAAuB,IAAI,CAAC,MAAO,SAAS,CAAC,CAAC;aACjE;YACD,oBAAoB;YAEpB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;SACvB;QACD,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAED,OAAO,CAAC,KAAa;QACjB,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAChC,IAAA,yBAAc,EAAC,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,uBAAwB,KAAM,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;QACrG,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;IAED,YAAY,CAAC,IAAY;QACrB,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;CACJ;AAtDD,kCAsDC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist-owla.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist-owla.d.ts deleted file mode 100644 index c87022df..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist-owla.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { WordlistOwl } from "./wordlist-owl.js"; -/** - * An OWL-A format Wordlist extends the OWL format to add an - * overlay onto an OWL format Wordlist to support diacritic - * marks. - * - * This class is generally not useful to most developers as - * it is used mainly internally to keep Wordlists for languages - * based on latin-1 small. - * - * If necessary, there are tools within the ``generation/`` folder - * to create the necessary data. - */ -export declare class WordlistOwlA extends WordlistOwl { - #private; - /** - * Creates a new Wordlist for %%locale%% using the OWLA %%data%% - * and %%accent%% data and validated against the %%checksum%%. - */ - constructor(locale: string, data: string, accent: string, checksum: string); - /** - * The OWLA-encoded accent data. - */ - get _accent(): string; - /** - * Decode all the words for the wordlist. - */ - _decodeWords(): Array; -} -//# sourceMappingURL=wordlist-owla.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist-owla.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist-owla.d.ts.map deleted file mode 100644 index 97ed583b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist-owla.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlist-owla.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist-owla.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD;;;;;;;;;;;GAWG;AACH,qBAAa,YAAa,SAAQ,WAAW;;IAIzC;;;OAGG;gBACS,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAK1E;;OAEG;IACH,IAAI,OAAO,IAAI,MAAM,CAAyB;IAE9C;;OAEG;IACH,YAAY,IAAI,KAAK,CAAC,MAAM,CAAC;CAGhC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist-owla.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist-owla.js deleted file mode 100644 index 116d0ac9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist-owla.js +++ /dev/null @@ -1,40 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.WordlistOwlA = void 0; -const wordlist_owl_js_1 = require("./wordlist-owl.js"); -const decode_owla_js_1 = require("./decode-owla.js"); -/** - * An OWL-A format Wordlist extends the OWL format to add an - * overlay onto an OWL format Wordlist to support diacritic - * marks. - * - * This class is generally not useful to most developers as - * it is used mainly internally to keep Wordlists for languages - * based on latin-1 small. - * - * If necessary, there are tools within the ``generation/`` folder - * to create the necessary data. - */ -class WordlistOwlA extends wordlist_owl_js_1.WordlistOwl { - #accent; - /** - * Creates a new Wordlist for %%locale%% using the OWLA %%data%% - * and %%accent%% data and validated against the %%checksum%%. - */ - constructor(locale, data, accent, checksum) { - super(locale, data, checksum); - this.#accent = accent; - } - /** - * The OWLA-encoded accent data. - */ - get _accent() { return this.#accent; } - /** - * Decode all the words for the wordlist. - */ - _decodeWords() { - return (0, decode_owla_js_1.decodeOwlA)(this._data, this._accent); - } -} -exports.WordlistOwlA = WordlistOwlA; -//# sourceMappingURL=wordlist-owla.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist-owla.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist-owla.js.map deleted file mode 100644 index 8a030c4e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist-owla.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlist-owla.js","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist-owla.ts"],"names":[],"mappings":";;;AACA,uDAAgD;AAChD,qDAA8C;AAE9C;;;;;;;;;;;GAWG;AACH,MAAa,YAAa,SAAQ,6BAAW;IACzC,OAAO,CAAS;IAGhB;;;OAGG;IACH,YAAY,MAAc,EAAE,IAAY,EAAE,MAAc,EAAE,QAAgB;QACtE,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,IAAI,OAAO,KAAa,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAE9C;;OAEG;IACH,YAAY;QACR,OAAO,IAAA,2BAAU,EAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAChD,CAAC;CACJ;AAxBD,oCAwBC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist.d.ts deleted file mode 100644 index cb843f3e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -/** - * A Wordlist represents a collection of language-specific - * words used to encode and devoce [[link-bip-39]] encoded data - * by mapping words to 11-bit values and vice versa. - */ -export declare abstract class Wordlist { - locale: string; - /** - * Creates a new Wordlist instance. - * - * Sub-classes MUST call this if they provide their own constructor, - * passing in the locale string of the language. - * - * Generally there is no need to create instances of a Wordlist, - * since each language-specific Wordlist creates an instance and - * there is no state kept internally, so they are safe to share. - */ - constructor(locale: string); - /** - * Sub-classes may override this to provide a language-specific - * method for spliting %%phrase%% into individual words. - * - * By default, %%phrase%% is split using any sequences of - * white-space as defined by regular expressions (i.e. ``/\s+/``). - */ - split(phrase: string): Array; - /** - * Sub-classes may override this to provider a language-specific - * method for joining %%words%% into a phrase. - * - * By default, %%words%% are joined by a single space. - */ - join(words: Array): string; - /** - * Maps an 11-bit value into its coresponding word in the list. - * - * Sub-classes MUST override this. - */ - abstract getWord(index: number): string; - /** - * Maps a word to its corresponding 11-bit value. - * - * Sub-classes MUST override this. - */ - abstract getWordIndex(word: string): number; -} -//# sourceMappingURL=wordlist.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist.d.ts.map deleted file mode 100644 index 6ba6025d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlist.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,8BAAsB,QAAQ;IAC1B,MAAM,EAAG,MAAM,CAAC;IAEhB;;;;;;;;;OASG;gBACS,MAAM,EAAE,MAAM;IAI1B;;;;;;OAMG;IACH,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAIpC;;;;;OAKG;IACH,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM;IAIlC;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAEvC;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAC9C"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist.js deleted file mode 100644 index 0b598011..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist.js +++ /dev/null @@ -1,46 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Wordlist = void 0; -const index_js_1 = require("../utils/index.js"); -/** - * A Wordlist represents a collection of language-specific - * words used to encode and devoce [[link-bip-39]] encoded data - * by mapping words to 11-bit values and vice versa. - */ -class Wordlist { - locale; - /** - * Creates a new Wordlist instance. - * - * Sub-classes MUST call this if they provide their own constructor, - * passing in the locale string of the language. - * - * Generally there is no need to create instances of a Wordlist, - * since each language-specific Wordlist creates an instance and - * there is no state kept internally, so they are safe to share. - */ - constructor(locale) { - (0, index_js_1.defineProperties)(this, { locale }); - } - /** - * Sub-classes may override this to provide a language-specific - * method for spliting %%phrase%% into individual words. - * - * By default, %%phrase%% is split using any sequences of - * white-space as defined by regular expressions (i.e. ``/\s+/``). - */ - split(phrase) { - return phrase.toLowerCase().split(/\s+/g); - } - /** - * Sub-classes may override this to provider a language-specific - * method for joining %%words%% into a phrase. - * - * By default, %%words%% are joined by a single space. - */ - join(words) { - return words.join(" "); - } -} -exports.Wordlist = Wordlist; -//# sourceMappingURL=wordlist.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist.js.map deleted file mode 100644 index 069e9c15..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlist.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlist.js","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist.ts"],"names":[],"mappings":";;;AAAA,gDAAqD;AAErD;;;;GAIG;AACH,MAAsB,QAAQ;IAC1B,MAAM,CAAU;IAEhB;;;;;;;;;OASG;IACH,YAAY,MAAc;QACtB,IAAA,2BAAgB,EAAW,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IACjD,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,MAAc;QAChB,OAAO,MAAM,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IAC7C,CAAC;IAED;;;;;OAKG;IACH,IAAI,CAAC,KAAoB;QACrB,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;CAeJ;AAnDD,4BAmDC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists-browser.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists-browser.d.ts deleted file mode 100644 index d0dbd19c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists-browser.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Wordlist } from "./wordlist.js"; -export declare const wordlists: Record; -//# sourceMappingURL=wordlists-browser.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists-browser.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists-browser.d.ts.map deleted file mode 100644 index cebd601e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlists-browser.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlists-browser.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAE9C,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists-browser.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists-browser.js deleted file mode 100644 index 569f5ca1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists-browser.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.wordlists = void 0; -const lang_en_js_1 = require("./lang-en.js"); -exports.wordlists = { - en: lang_en_js_1.LangEn.wordlist(), -}; -//# sourceMappingURL=wordlists-browser.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists-browser.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists-browser.js.map deleted file mode 100644 index 074bd99d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists-browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlists-browser.js","sourceRoot":"","sources":["../../src.ts/wordlists/wordlists-browser.ts"],"names":[],"mappings":";;;AACA,6CAAsC;AAIzB,QAAA,SAAS,GAA6B;IACjD,EAAE,EAAE,mBAAM,CAAC,QAAQ,EAAE;CACtB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists-extra.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists-extra.d.ts deleted file mode 100644 index 7e15a233..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists-extra.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export { LangCz } from "./lang-cz.js"; -export { LangEs } from "./lang-es.js"; -export { LangFr } from "./lang-fr.js"; -export { LangJa } from "./lang-ja.js"; -export { LangKo } from "./lang-ko.js"; -export { LangIt } from "./lang-it.js"; -export { LangPt } from "./lang-pt.js"; -export { LangZh } from "./lang-zh.js"; -//# sourceMappingURL=wordlists-extra.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists-extra.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists-extra.d.ts.map deleted file mode 100644 index 6003081c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists-extra.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlists-extra.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlists-extra.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists-extra.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists-extra.js deleted file mode 100644 index 38dbc926..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists-extra.js +++ /dev/null @@ -1,20 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.LangZh = exports.LangPt = exports.LangIt = exports.LangKo = exports.LangJa = exports.LangFr = exports.LangEs = exports.LangCz = void 0; -var lang_cz_js_1 = require("./lang-cz.js"); -Object.defineProperty(exports, "LangCz", { enumerable: true, get: function () { return lang_cz_js_1.LangCz; } }); -var lang_es_js_1 = require("./lang-es.js"); -Object.defineProperty(exports, "LangEs", { enumerable: true, get: function () { return lang_es_js_1.LangEs; } }); -var lang_fr_js_1 = require("./lang-fr.js"); -Object.defineProperty(exports, "LangFr", { enumerable: true, get: function () { return lang_fr_js_1.LangFr; } }); -var lang_ja_js_1 = require("./lang-ja.js"); -Object.defineProperty(exports, "LangJa", { enumerable: true, get: function () { return lang_ja_js_1.LangJa; } }); -var lang_ko_js_1 = require("./lang-ko.js"); -Object.defineProperty(exports, "LangKo", { enumerable: true, get: function () { return lang_ko_js_1.LangKo; } }); -var lang_it_js_1 = require("./lang-it.js"); -Object.defineProperty(exports, "LangIt", { enumerable: true, get: function () { return lang_it_js_1.LangIt; } }); -var lang_pt_js_1 = require("./lang-pt.js"); -Object.defineProperty(exports, "LangPt", { enumerable: true, get: function () { return lang_pt_js_1.LangPt; } }); -var lang_zh_js_1 = require("./lang-zh.js"); -Object.defineProperty(exports, "LangZh", { enumerable: true, get: function () { return lang_zh_js_1.LangZh; } }); -//# sourceMappingURL=wordlists-extra.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists-extra.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists-extra.js.map deleted file mode 100644 index 470e3312..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists-extra.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlists-extra.js","sourceRoot":"","sources":["../../src.ts/wordlists/wordlists-extra.ts"],"names":[],"mappings":";;;AACA,2CAAsC;AAA7B,oGAAA,MAAM,OAAA;AACf,2CAAsC;AAA7B,oGAAA,MAAM,OAAA;AACf,2CAAsC;AAA7B,oGAAA,MAAM,OAAA;AACf,2CAAsC;AAA7B,oGAAA,MAAM,OAAA;AACf,2CAAsC;AAA7B,oGAAA,MAAM,OAAA;AACf,2CAAsC;AAA7B,oGAAA,MAAM,OAAA;AACf,2CAAsC;AAA7B,oGAAA,MAAM,OAAA;AACf,2CAAsC;AAA7B,oGAAA,MAAM,OAAA"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists.d.ts deleted file mode 100644 index ab8b0308..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { Wordlist } from "./wordlist.js"; -/** - * The available Wordlists by their - * [ISO 639-1 Language Code](link-wiki-iso639). - * - * (**i.e.** [cz](LangCz), [en](LangEn), [es](LangEs), [fr](LangFr), - * [ja](LangJa), [ko](LangKo), [it](LangIt), [pt](LangPt), - * [zh_cn](LangZh), [zh_tw](LangZh)) - * - * The dist files (in the ``/dist`` folder) have had all languages - * except English stripped out, which reduces the library size by - * about 80kb. If required, they are available by importing the - * included ``wordlists-extra.min.js`` file. - */ -export declare const wordlists: Record; -//# sourceMappingURL=wordlists.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists.d.ts.map deleted file mode 100644 index 6e459b7c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlists.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlists.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAW9C,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists.js b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists.js deleted file mode 100644 index 97235d88..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.wordlists = void 0; -const lang_cz_js_1 = require("./lang-cz.js"); -const lang_en_js_1 = require("./lang-en.js"); -const lang_es_js_1 = require("./lang-es.js"); -const lang_fr_js_1 = require("./lang-fr.js"); -const lang_ja_js_1 = require("./lang-ja.js"); -const lang_ko_js_1 = require("./lang-ko.js"); -const lang_it_js_1 = require("./lang-it.js"); -const lang_pt_js_1 = require("./lang-pt.js"); -const lang_zh_js_1 = require("./lang-zh.js"); -/** - * The available Wordlists by their - * [ISO 639-1 Language Code](link-wiki-iso639). - * - * (**i.e.** [cz](LangCz), [en](LangEn), [es](LangEs), [fr](LangFr), - * [ja](LangJa), [ko](LangKo), [it](LangIt), [pt](LangPt), - * [zh_cn](LangZh), [zh_tw](LangZh)) - * - * The dist files (in the ``/dist`` folder) have had all languages - * except English stripped out, which reduces the library size by - * about 80kb. If required, they are available by importing the - * included ``wordlists-extra.min.js`` file. - */ -exports.wordlists = { - cz: lang_cz_js_1.LangCz.wordlist(), - en: lang_en_js_1.LangEn.wordlist(), - es: lang_es_js_1.LangEs.wordlist(), - fr: lang_fr_js_1.LangFr.wordlist(), - it: lang_it_js_1.LangIt.wordlist(), - pt: lang_pt_js_1.LangPt.wordlist(), - ja: lang_ja_js_1.LangJa.wordlist(), - ko: lang_ko_js_1.LangKo.wordlist(), - zh_cn: lang_zh_js_1.LangZh.wordlist("cn"), - zh_tw: lang_zh_js_1.LangZh.wordlist("tw"), -}; -//# sourceMappingURL=wordlists.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists.js.map b/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists.js.map deleted file mode 100644 index 19507422..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.commonjs/wordlists/wordlists.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlists.js","sourceRoot":"","sources":["../../src.ts/wordlists/wordlists.ts"],"names":[],"mappings":";;;AACA,6CAAsC;AACtC,6CAAsC;AACtC,6CAAsC;AACtC,6CAAsC;AACtC,6CAAsC;AACtC,6CAAsC;AACtC,6CAAsC;AACtC,6CAAsC;AACtC,6CAAsC;AAItC;;;;;;;;;;;;GAYG;AACU,QAAA,SAAS,GAA6B;IACjD,EAAE,EAAE,mBAAM,CAAC,QAAQ,EAAE;IACrB,EAAE,EAAE,mBAAM,CAAC,QAAQ,EAAE;IACrB,EAAE,EAAE,mBAAM,CAAC,QAAQ,EAAE;IACrB,EAAE,EAAE,mBAAM,CAAC,QAAQ,EAAE;IACrB,EAAE,EAAE,mBAAM,CAAC,QAAQ,EAAE;IACrB,EAAE,EAAE,mBAAM,CAAC,QAAQ,EAAE;IACrB,EAAE,EAAE,mBAAM,CAAC,QAAQ,EAAE;IACrB,EAAE,EAAE,mBAAM,CAAC,QAAQ,EAAE;IACrB,KAAK,EAAE,mBAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC5B,KAAK,EAAE,mBAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;CAC7B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/README.md b/tools/mnemonic-test/node_modules/ethers/lib.esm/README.md deleted file mode 100644 index ce8d3ba5..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/README.md +++ /dev/null @@ -1,16 +0,0 @@ -ESM Files -========= - -The contents of this folder are for using `import` in ESM -projects. - - -Notes ------ - -The contents are generated via the `npm run build` target -using `tsc` and the `/tsconfig.esm.json` configuration. - -Do not modify the files in this folder. They are deleted on `build-clean`. - -To modify this `README.md`, see the `/output/post-build/lib.esm`. diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/_version.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/_version.d.ts deleted file mode 100644 index 37c501ab..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/_version.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * The current version of Ethers. - */ -export declare const version: string; -//# sourceMappingURL=_version.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/_version.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/_version.d.ts.map deleted file mode 100644 index a85eec00..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/_version.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_version.d.ts","sourceRoot":"","sources":["../src.ts/_version.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,MAAiB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/_version.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/_version.js deleted file mode 100644 index 868d7746..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/_version.js +++ /dev/null @@ -1,6 +0,0 @@ -/* Do NOT modify this file; see /src.ts/_admin/update-version.ts */ -/** - * The current version of Ethers. - */ -export const version = "6.16.0"; -//# sourceMappingURL=_version.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/_version.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/_version.js.map deleted file mode 100644 index f7dcaf76..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/_version.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_version.js","sourceRoot":"","sources":["../src.ts/_version.ts"],"names":[],"mappings":"AAAA,mEAAmE;AAEnE;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAW,QAAQ,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/abi-coder.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/abi-coder.d.ts deleted file mode 100644 index 1e5d552c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/abi-coder.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -/** - * When sending values to or receiving values from a [[Contract]], the - * data is generally encoded using the [ABI standard](link-solc-abi). - * - * The AbiCoder provides a utility to encode values to ABI data and - * decode values from ABI data. - * - * Most of the time, developers should favour the [[Contract]] class, - * which further abstracts a lot of the finer details of ABI data. - * - * @_section api/abi/abi-coder:ABI Encoding - */ -import { Result } from "./coders/abstract-coder.js"; -import { ParamType } from "./fragments.js"; -import type { BytesLike, CallExceptionAction, CallExceptionError } from "../utils/index.js"; -/** - * The **AbiCoder** is a low-level class responsible for encoding JavaScript - * values into binary data and decoding binary data into JavaScript values. - */ -export declare class AbiCoder { - #private; - /** - * Get the default values for the given %%types%%. - * - * For example, a ``uint`` is by default ``0`` and ``bool`` - * is by default ``false``. - */ - getDefaultValue(types: ReadonlyArray): Result; - /** - * Encode the %%values%% as the %%types%% into ABI data. - * - * @returns DataHexstring - */ - encode(types: ReadonlyArray, values: ReadonlyArray): string; - /** - * Decode the ABI %%data%% as the %%types%% into values. - * - * If %%loose%% decoding is enabled, then strict padding is - * not enforced. Some older versions of Solidity incorrectly - * padded event data emitted from ``external`` functions. - */ - decode(types: ReadonlyArray, data: BytesLike, loose?: boolean): Result; - static _setDefaultMaxInflation(value: number): void; - /** - * Returns the shared singleton instance of a default [[AbiCoder]]. - * - * On the first call, the instance is created internally. - */ - static defaultAbiCoder(): AbiCoder; - /** - * Returns an ethers-compatible [[CallExceptionError]] Error for the given - * result %%data%% for the [[CallExceptionAction]] %%action%% against - * the Transaction %%tx%%. - */ - static getBuiltinCallException(action: CallExceptionAction, tx: { - to?: null | string; - from?: null | string; - data?: string; - }, data: null | BytesLike): CallExceptionError; -} -//# sourceMappingURL=abi-coder.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/abi-coder.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/abi-coder.d.ts.map deleted file mode 100644 index 0a0c483e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/abi-coder.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abi-coder.d.ts","sourceRoot":"","sources":["../../src.ts/abi/abi-coder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,OAAO,EAAiB,MAAM,EAAU,MAAM,4BAA4B,CAAC;AAU3E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK3C,OAAO,KAAK,EACR,SAAS,EACT,mBAAmB,EAAE,kBAAkB,EAC1C,MAAM,mBAAmB,CAAC;AAuF3B;;;GAGG;AACH,qBAAa,QAAQ;;IA4CjB;;;;;OAKG;IACH,eAAe,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,MAAM;IAMjE;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG,MAAM;IAWpF;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM;IAM1F,MAAM,CAAC,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAKnD;;;;OAIG;IACH,MAAM,CAAC,eAAe,IAAI,QAAQ;IAOlC;;;;OAIG;IACH,MAAM,CAAC,uBAAuB,CAAC,MAAM,EAAE,mBAAmB,EAAE,EAAE,EAAE;QAAE,EAAE,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,IAAI,EAAE,IAAI,GAAG,SAAS,GAAG,kBAAkB;CAG3K"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/abi-coder.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/abi-coder.js deleted file mode 100644 index 0b528fe5..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/abi-coder.js +++ /dev/null @@ -1,206 +0,0 @@ -/** - * When sending values to or receiving values from a [[Contract]], the - * data is generally encoded using the [ABI standard](link-solc-abi). - * - * The AbiCoder provides a utility to encode values to ABI data and - * decode values from ABI data. - * - * Most of the time, developers should favour the [[Contract]] class, - * which further abstracts a lot of the finer details of ABI data. - * - * @_section api/abi/abi-coder:ABI Encoding - */ -// See: https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI -import { assertArgumentCount, assertArgument } from "../utils/index.js"; -import { Reader, Writer } from "./coders/abstract-coder.js"; -import { AddressCoder } from "./coders/address.js"; -import { ArrayCoder } from "./coders/array.js"; -import { BooleanCoder } from "./coders/boolean.js"; -import { BytesCoder } from "./coders/bytes.js"; -import { FixedBytesCoder } from "./coders/fixed-bytes.js"; -import { NullCoder } from "./coders/null.js"; -import { NumberCoder } from "./coders/number.js"; -import { StringCoder } from "./coders/string.js"; -import { TupleCoder } from "./coders/tuple.js"; -import { ParamType } from "./fragments.js"; -import { getAddress } from "../address/index.js"; -import { getBytes, hexlify, makeError } from "../utils/index.js"; -// https://docs.soliditylang.org/en/v0.8.17/control-structures.html -const PanicReasons = new Map(); -PanicReasons.set(0x00, "GENERIC_PANIC"); -PanicReasons.set(0x01, "ASSERT_FALSE"); -PanicReasons.set(0x11, "OVERFLOW"); -PanicReasons.set(0x12, "DIVIDE_BY_ZERO"); -PanicReasons.set(0x21, "ENUM_RANGE_ERROR"); -PanicReasons.set(0x22, "BAD_STORAGE_DATA"); -PanicReasons.set(0x31, "STACK_UNDERFLOW"); -PanicReasons.set(0x32, "ARRAY_RANGE_ERROR"); -PanicReasons.set(0x41, "OUT_OF_MEMORY"); -PanicReasons.set(0x51, "UNINITIALIZED_FUNCTION_CALL"); -const paramTypeBytes = new RegExp(/^bytes([0-9]*)$/); -const paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/); -let defaultCoder = null; -let defaultMaxInflation = 1024; -function getBuiltinCallException(action, tx, data, abiCoder) { - let message = "missing revert data"; - let reason = null; - const invocation = null; - let revert = null; - if (data) { - message = "execution reverted"; - const bytes = getBytes(data); - data = hexlify(data); - if (bytes.length === 0) { - message += " (no data present; likely require(false) occurred"; - reason = "require(false)"; - } - else if (bytes.length % 32 !== 4) { - message += " (could not decode reason; invalid data length)"; - } - else if (hexlify(bytes.slice(0, 4)) === "0x08c379a0") { - // Error(string) - try { - reason = abiCoder.decode(["string"], bytes.slice(4))[0]; - revert = { - signature: "Error(string)", - name: "Error", - args: [reason] - }; - message += `: ${JSON.stringify(reason)}`; - } - catch (error) { - message += " (could not decode reason; invalid string data)"; - } - } - else if (hexlify(bytes.slice(0, 4)) === "0x4e487b71") { - // Panic(uint256) - try { - const code = Number(abiCoder.decode(["uint256"], bytes.slice(4))[0]); - revert = { - signature: "Panic(uint256)", - name: "Panic", - args: [code] - }; - reason = `Panic due to ${PanicReasons.get(code) || "UNKNOWN"}(${code})`; - message += `: ${reason}`; - } - catch (error) { - message += " (could not decode panic code)"; - } - } - else { - message += " (unknown custom error)"; - } - } - const transaction = { - to: (tx.to ? getAddress(tx.to) : null), - data: (tx.data || "0x") - }; - if (tx.from) { - transaction.from = getAddress(tx.from); - } - return makeError(message, "CALL_EXCEPTION", { - action, data, reason, transaction, invocation, revert - }); -} -/** - * The **AbiCoder** is a low-level class responsible for encoding JavaScript - * values into binary data and decoding binary data into JavaScript values. - */ -export class AbiCoder { - #getCoder(param) { - if (param.isArray()) { - return new ArrayCoder(this.#getCoder(param.arrayChildren), param.arrayLength, param.name); - } - if (param.isTuple()) { - return new TupleCoder(param.components.map((c) => this.#getCoder(c)), param.name); - } - switch (param.baseType) { - case "address": - return new AddressCoder(param.name); - case "bool": - return new BooleanCoder(param.name); - case "string": - return new StringCoder(param.name); - case "bytes": - return new BytesCoder(param.name); - case "": - return new NullCoder(param.name); - } - // u?int[0-9]* - let match = param.type.match(paramTypeNumber); - if (match) { - let size = parseInt(match[2] || "256"); - assertArgument(size !== 0 && size <= 256 && (size % 8) === 0, "invalid " + match[1] + " bit length", "param", param); - return new NumberCoder(size / 8, (match[1] === "int"), param.name); - } - // bytes[0-9]+ - match = param.type.match(paramTypeBytes); - if (match) { - let size = parseInt(match[1]); - assertArgument(size !== 0 && size <= 32, "invalid bytes length", "param", param); - return new FixedBytesCoder(size, param.name); - } - assertArgument(false, "invalid type", "type", param.type); - } - /** - * Get the default values for the given %%types%%. - * - * For example, a ``uint`` is by default ``0`` and ``bool`` - * is by default ``false``. - */ - getDefaultValue(types) { - const coders = types.map((type) => this.#getCoder(ParamType.from(type))); - const coder = new TupleCoder(coders, "_"); - return coder.defaultValue(); - } - /** - * Encode the %%values%% as the %%types%% into ABI data. - * - * @returns DataHexstring - */ - encode(types, values) { - assertArgumentCount(values.length, types.length, "types/values length mismatch"); - const coders = types.map((type) => this.#getCoder(ParamType.from(type))); - const coder = (new TupleCoder(coders, "_")); - const writer = new Writer(); - coder.encode(writer, values); - return writer.data; - } - /** - * Decode the ABI %%data%% as the %%types%% into values. - * - * If %%loose%% decoding is enabled, then strict padding is - * not enforced. Some older versions of Solidity incorrectly - * padded event data emitted from ``external`` functions. - */ - decode(types, data, loose) { - const coders = types.map((type) => this.#getCoder(ParamType.from(type))); - const coder = new TupleCoder(coders, "_"); - return coder.decode(new Reader(data, loose, defaultMaxInflation)); - } - static _setDefaultMaxInflation(value) { - assertArgument(typeof (value) === "number" && Number.isInteger(value), "invalid defaultMaxInflation factor", "value", value); - defaultMaxInflation = value; - } - /** - * Returns the shared singleton instance of a default [[AbiCoder]]. - * - * On the first call, the instance is created internally. - */ - static defaultAbiCoder() { - if (defaultCoder == null) { - defaultCoder = new AbiCoder(); - } - return defaultCoder; - } - /** - * Returns an ethers-compatible [[CallExceptionError]] Error for the given - * result %%data%% for the [[CallExceptionAction]] %%action%% against - * the Transaction %%tx%%. - */ - static getBuiltinCallException(action, tx, data) { - return getBuiltinCallException(action, tx, data, AbiCoder.defaultAbiCoder()); - } -} -//# sourceMappingURL=abi-coder.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/abi-coder.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/abi-coder.js.map deleted file mode 100644 index db43966e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/abi-coder.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abi-coder.js","sourceRoot":"","sources":["../../src.ts/abi/abi-coder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,mEAAmE;AAEnE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExE,OAAO,EAAS,MAAM,EAAU,MAAM,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AAC;SACjC;QACD,OAAO,YAAY,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,uBAAuB,CAAC,MAA2B,EAAE,EAA+D,EAAE,IAAsB;QAC/I,OAAO,uBAAuB,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,CAAC,eAAe,EAAE,CAAC,CAAC;IACjF,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/bytes32.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/bytes32.d.ts deleted file mode 100644 index 73455cb5..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/bytes32.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * About bytes32 strings... - * - * @_docloc: api/utils:Bytes32 Strings - */ -import type { BytesLike } from "../utils/index.js"; -/** - * Encodes %%text%% as a Bytes32 string. - */ -export declare function encodeBytes32String(text: string): string; -/** - * Encodes the Bytes32-encoded %%bytes%% into a string. - */ -export declare function decodeBytes32String(_bytes: BytesLike): string; -//# sourceMappingURL=bytes32.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/bytes32.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/bytes32.d.ts.map deleted file mode 100644 index 1d56cd6f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/bytes32.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bytes32.d.ts","sourceRoot":"","sources":["../../src.ts/abi/bytes32.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAUxD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAa7D"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/bytes32.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/bytes32.js deleted file mode 100644 index 20d586bf..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/bytes32.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * About bytes32 strings... - * - * @_docloc: api/utils:Bytes32 Strings - */ -import { getBytes, toUtf8Bytes, toUtf8String, zeroPadBytes } from "../utils/index.js"; -/** - * Encodes %%text%% as a Bytes32 string. - */ -export function encodeBytes32String(text) { - // Get the bytes - const bytes = toUtf8Bytes(text); - // Check we have room for null-termination - if (bytes.length > 31) { - throw new Error("bytes32 string must be less than 32 bytes"); - } - // Zero-pad (implicitly null-terminates) - return zeroPadBytes(bytes, 32); -} -/** - * Encodes the Bytes32-encoded %%bytes%% into a string. - */ -export function decodeBytes32String(_bytes) { - const data = getBytes(_bytes, "bytes"); - // Must be 32 bytes with a null-termination - if (data.length !== 32) { - throw new Error("invalid bytes32 - not 32 bytes long"); - } - if (data[31] !== 0) { - throw new Error("invalid bytes32 string - no null terminator"); - } - // Find the null termination - let length = 31; - while (data[length - 1] === 0) { - length--; - } - // Determine the string value - return toUtf8String(data.slice(0, length)); -} -//# sourceMappingURL=bytes32.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/bytes32.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/bytes32.js.map deleted file mode 100644 index 98e8316f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/bytes32.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bytes32.js","sourceRoot":"","sources":["../../src.ts/abi/bytes32.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACH,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EACpD,MAAM,mBAAmB,CAAC;AAI3B;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAE5C,gBAAgB;IAChB,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IAEhC,0CAA0C;IAC1C,IAAI,KAAK,CAAC,MAAM,GAAG,EAAE,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;KAAE;IAExF,wCAAwC;IACxC,OAAO,YAAY,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACnC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAiB;IACjD,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEvC,2CAA2C;IAC3C,IAAI,IAAI,CAAC,MAAM,KAAK,EAAE,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;KAAE;IACnF,IAAI,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;KAAE;IAEvF,4BAA4B;IAC5B,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE;QAAE,MAAM,EAAE,CAAC;KAAE;IAE5C,6BAA6B;IAC7B,OAAO,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;AAC/C,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/abstract-coder.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/abstract-coder.d.ts deleted file mode 100644 index 6223aea0..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/abstract-coder.d.ts +++ /dev/null @@ -1,124 +0,0 @@ -import type { BigNumberish, BytesLike } from "../../utils/index.js"; -/** - * @_ignore: - */ -export declare const WordSize: number; -/** - * A [[Result]] is a sub-class of Array, which allows accessing any - * of its values either positionally by its index or, if keys are - * provided by its name. - * - * @_docloc: api/abi - */ -export declare class Result extends Array { - #private; - [K: string | number]: any; - /** - * @private - */ - constructor(...args: Array); - /** - * Returns the Result as a normal Array. If %%deep%%, any children - * which are Result objects are also converted to a normal Array. - * - * This will throw if there are any outstanding deferred - * errors. - */ - toArray(deep?: boolean): Array; - /** - * Returns the Result as an Object with each name-value pair. If - * %%deep%%, any children which are Result objects are also - * converted to an Object. - * - * This will throw if any value is unnamed, or if there are - * any outstanding deferred errors. - */ - toObject(deep?: boolean): Record; - /** - * @_ignore - */ - slice(start?: number | undefined, end?: number | undefined): Result; - /** - * @_ignore - */ - filter(callback: (el: any, index: number, array: Result) => boolean, thisArg?: any): Result; - /** - * @_ignore - */ - map(callback: (el: any, index: number, array: Result) => T, thisArg?: any): Array; - /** - * Returns the value for %%name%%. - * - * Since it is possible to have a key whose name conflicts with - * a method on a [[Result]] or its superclass Array, or any - * JavaScript keyword, this ensures all named values are still - * accessible by name. - */ - getValue(name: string): any; - /** - * Creates a new [[Result]] for %%items%% with each entry - * also accessible by its corresponding name in %%keys%%. - */ - static fromItems(items: Array, keys?: Array): Result; -} -/** - * Returns all errors found in a [[Result]]. - * - * Since certain errors encountered when creating a [[Result]] do - * not impact the ability to continue parsing data, they are - * deferred until they are actually accessed. Hence a faulty string - * in an Event that is never used does not impact the program flow. - * - * However, sometimes it may be useful to access, identify or - * validate correctness of a [[Result]]. - * - * @_docloc api/abi - */ -export declare function checkResultErrors(result: Result): Array<{ - path: Array; - error: Error; -}>; -/** - * @_ignore - */ -export declare abstract class Coder { - readonly name: string; - readonly type: string; - readonly localName: string; - readonly dynamic: boolean; - constructor(name: string, type: string, localName: string, dynamic: boolean); - _throwError(message: string, value: any): never; - abstract encode(writer: Writer, value: any): number; - abstract decode(reader: Reader): any; - abstract defaultValue(): any; -} -/** - * @_ignore - */ -export declare class Writer { - #private; - constructor(); - get data(): string; - get length(): number; - appendWriter(writer: Writer): number; - writeBytes(value: BytesLike): number; - writeValue(value: BigNumberish): number; - writeUpdatableValue(): (value: BigNumberish) => void; -} -/** - * @_ignore - */ -export declare class Reader { - #private; - readonly allowLoose: boolean; - constructor(data: BytesLike, allowLoose?: boolean, maxInflation?: number); - get data(): string; - get dataLength(): number; - get consumed(): number; - get bytes(): Uint8Array; - subReader(offset: number): Reader; - readBytes(length: number, loose?: boolean): Uint8Array; - readValue(): bigint; - readIndex(): number; -} -//# sourceMappingURL=abstract-coder.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/abstract-coder.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/abstract-coder.d.ts.map deleted file mode 100644 index 8ecc4d8a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/abstract-coder.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abstract-coder.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/abstract-coder.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,MAAW,CAAC;AA+CnC;;;;;;GAMG;AACH,qBAAa,MAAO,SAAQ,KAAK,CAAC,GAAG,CAAC;;IAMlC,CAAE,CAAC,EAAE,MAAM,GAAG,MAAM,GAAI,GAAG,CAAA;IAE3B;;OAEG;gBACS,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IA+F/B;;;;;;OAMG;IACH,OAAO,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC;IAYnC;;;;;;;OAOG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAY7C;;OAEG;IACH,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,CAAC,EAA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KAAK;IAI/C,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM;IACnD,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;IAEpC,QAAQ,CAAC,YAAY,IAAI,GAAG;CAC/B;AAED;;GAEG;AACH,qBAAa,MAAM;;;IAUf,IAAI,IAAI,IAAI,MAAM,CAEjB;IACD,IAAI,MAAM,IAAI,MAAM,CAA6B;IAQjD,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAKpC,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM;IAUpC,UAAU,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM;IAMvC,mBAAmB,IAAI,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI;CAQvD;AAED;;GAEG;AACH,qBAAa,MAAM;;IAKf,QAAQ,CAAC,UAAU,EAAG,OAAO,CAAC;gBASlB,IAAI,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,MAAM;IAWxE,IAAI,IAAI,IAAI,MAAM,CAAgC;IAClD,IAAI,UAAU,IAAI,MAAM,CAA8B;IACtD,IAAI,QAAQ,IAAI,MAAM,CAAyB;IAC/C,IAAI,KAAK,IAAI,UAAU,CAAuC;IAkC9D,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAOjC,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,UAAU;IAStD,SAAS,IAAI,MAAM;IAInB,SAAS,IAAI,MAAM;CAGtB"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/abstract-coder.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/abstract-coder.js deleted file mode 100644 index 8b58f03a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/abstract-coder.js +++ /dev/null @@ -1,466 +0,0 @@ -import { defineProperties, concat, getBytesCopy, getNumber, hexlify, toBeArray, toBigInt, toNumber, assert, assertArgument -/*, isError*/ - } from "../../utils/index.js"; -/** - * @_ignore: - */ -export const WordSize = 32; -const Padding = new Uint8Array(WordSize); -// Properties used to immediate pass through to the underlying object -// - `then` is used to detect if an object is a Promise for await -const passProperties = ["then"]; -const _guard = {}; -const resultNames = new WeakMap(); -function getNames(result) { - return resultNames.get(result); -} -function setNames(result, names) { - resultNames.set(result, names); -} -function throwError(name, error) { - const wrapped = new Error(`deferred error during ABI decoding triggered accessing ${name}`); - wrapped.error = error; - throw wrapped; -} -function toObject(names, items, deep) { - if (names.indexOf(null) >= 0) { - return items.map((item, index) => { - if (item instanceof Result) { - return toObject(getNames(item), item, deep); - } - return item; - }); - } - return names.reduce((accum, name, index) => { - let item = items.getValue(name); - if (!(name in accum)) { - if (deep && item instanceof Result) { - item = toObject(getNames(item), item, deep); - } - accum[name] = item; - } - return accum; - }, {}); -} -/** - * A [[Result]] is a sub-class of Array, which allows accessing any - * of its values either positionally by its index or, if keys are - * provided by its name. - * - * @_docloc: api/abi - */ -export class Result extends Array { - // No longer used; but cannot be removed as it will remove the - // #private field from the .d.ts which may break backwards - // compatibility - #names; - /** - * @private - */ - constructor(...args) { - // To properly sub-class Array so the other built-in - // functions work, the constructor has to behave fairly - // well. So, in the event we are created via fromItems() - // we build the read-only Result object we want, but on - // any other input, we use the default constructor - // constructor(guard: any, items: Array, keys?: Array); - const guard = args[0]; - let items = args[1]; - let names = (args[2] || []).slice(); - let wrap = true; - if (guard !== _guard) { - items = args; - names = []; - wrap = false; - } - // Can't just pass in ...items since an array of length 1 - // is a special case in the super. - super(items.length); - items.forEach((item, index) => { this[index] = item; }); - // Find all unique keys - const nameCounts = names.reduce((accum, name) => { - if (typeof (name) === "string") { - accum.set(name, (accum.get(name) || 0) + 1); - } - return accum; - }, (new Map())); - // Remove any key thats not unique - setNames(this, Object.freeze(items.map((item, index) => { - const name = names[index]; - if (name != null && nameCounts.get(name) === 1) { - return name; - } - return null; - }))); - // Dummy operations to prevent TypeScript from complaining - this.#names = []; - if (this.#names == null) { - void (this.#names); - } - if (!wrap) { - return; - } - // A wrapped Result is immutable - Object.freeze(this); - // Proxy indices and names so we can trap deferred errors - const proxy = new Proxy(this, { - get: (target, prop, receiver) => { - if (typeof (prop) === "string") { - // Index accessor - if (prop.match(/^[0-9]+$/)) { - const index = getNumber(prop, "%index"); - if (index < 0 || index >= this.length) { - throw new RangeError("out of result range"); - } - const item = target[index]; - if (item instanceof Error) { - throwError(`index ${index}`, item); - } - return item; - } - // Pass important checks (like `then` for Promise) through - if (passProperties.indexOf(prop) >= 0) { - return Reflect.get(target, prop, receiver); - } - const value = target[prop]; - if (value instanceof Function) { - // Make sure functions work with private variables - // See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy#no_private_property_forwarding - return function (...args) { - return value.apply((this === receiver) ? target : this, args); - }; - } - else if (!(prop in target)) { - // Possible name accessor - return target.getValue.apply((this === receiver) ? target : this, [prop]); - } - } - return Reflect.get(target, prop, receiver); - } - }); - setNames(proxy, getNames(this)); - return proxy; - } - /** - * Returns the Result as a normal Array. If %%deep%%, any children - * which are Result objects are also converted to a normal Array. - * - * This will throw if there are any outstanding deferred - * errors. - */ - toArray(deep) { - const result = []; - this.forEach((item, index) => { - if (item instanceof Error) { - throwError(`index ${index}`, item); - } - if (deep && item instanceof Result) { - item = item.toArray(deep); - } - result.push(item); - }); - return result; - } - /** - * Returns the Result as an Object with each name-value pair. If - * %%deep%%, any children which are Result objects are also - * converted to an Object. - * - * This will throw if any value is unnamed, or if there are - * any outstanding deferred errors. - */ - toObject(deep) { - const names = getNames(this); - return names.reduce((accum, name, index) => { - assert(name != null, `value at index ${index} unnamed`, "UNSUPPORTED_OPERATION", { - operation: "toObject()" - }); - return toObject(names, this, deep); - }, {}); - } - /** - * @_ignore - */ - slice(start, end) { - if (start == null) { - start = 0; - } - if (start < 0) { - start += this.length; - if (start < 0) { - start = 0; - } - } - if (end == null) { - end = this.length; - } - if (end < 0) { - end += this.length; - if (end < 0) { - end = 0; - } - } - if (end > this.length) { - end = this.length; - } - const _names = getNames(this); - const result = [], names = []; - for (let i = start; i < end; i++) { - result.push(this[i]); - names.push(_names[i]); - } - return new Result(_guard, result, names); - } - /** - * @_ignore - */ - filter(callback, thisArg) { - const _names = getNames(this); - const result = [], names = []; - for (let i = 0; i < this.length; i++) { - const item = this[i]; - if (item instanceof Error) { - throwError(`index ${i}`, item); - } - if (callback.call(thisArg, item, i, this)) { - result.push(item); - names.push(_names[i]); - } - } - return new Result(_guard, result, names); - } - /** - * @_ignore - */ - map(callback, thisArg) { - const result = []; - for (let i = 0; i < this.length; i++) { - const item = this[i]; - if (item instanceof Error) { - throwError(`index ${i}`, item); - } - result.push(callback.call(thisArg, item, i, this)); - } - return result; - } - /** - * Returns the value for %%name%%. - * - * Since it is possible to have a key whose name conflicts with - * a method on a [[Result]] or its superclass Array, or any - * JavaScript keyword, this ensures all named values are still - * accessible by name. - */ - getValue(name) { - const index = getNames(this).indexOf(name); - if (index === -1) { - return undefined; - } - const value = this[index]; - if (value instanceof Error) { - throwError(`property ${JSON.stringify(name)}`, value.error); - } - return value; - } - /** - * Creates a new [[Result]] for %%items%% with each entry - * also accessible by its corresponding name in %%keys%%. - */ - static fromItems(items, keys) { - return new Result(_guard, items, keys); - } -} -/** - * Returns all errors found in a [[Result]]. - * - * Since certain errors encountered when creating a [[Result]] do - * not impact the ability to continue parsing data, they are - * deferred until they are actually accessed. Hence a faulty string - * in an Event that is never used does not impact the program flow. - * - * However, sometimes it may be useful to access, identify or - * validate correctness of a [[Result]]. - * - * @_docloc api/abi - */ -export function checkResultErrors(result) { - // Find the first error (if any) - const errors = []; - const checkErrors = function (path, object) { - if (!Array.isArray(object)) { - return; - } - for (let key in object) { - const childPath = path.slice(); - childPath.push(key); - try { - checkErrors(childPath, object[key]); - } - catch (error) { - errors.push({ path: childPath, error: error }); - } - } - }; - checkErrors([], result); - return errors; -} -function getValue(value) { - let bytes = toBeArray(value); - assert(bytes.length <= WordSize, "value out-of-bounds", "BUFFER_OVERRUN", { buffer: bytes, length: WordSize, offset: bytes.length }); - if (bytes.length !== WordSize) { - bytes = getBytesCopy(concat([Padding.slice(bytes.length % WordSize), bytes])); - } - return bytes; -} -/** - * @_ignore - */ -export class Coder { - // The coder name: - // - address, uint256, tuple, array, etc. - name; - // The fully expanded type, including composite types: - // - address, uint256, tuple(address,bytes), uint256[3][4][], etc. - type; - // The localName bound in the signature, in this example it is "baz": - // - tuple(address foo, uint bar) baz - localName; - // Whether this type is dynamic: - // - Dynamic: bytes, string, address[], tuple(boolean[]), etc. - // - Not Dynamic: address, uint256, boolean[3], tuple(address, uint8) - dynamic; - constructor(name, type, localName, dynamic) { - defineProperties(this, { name, type, localName, dynamic }, { - name: "string", type: "string", localName: "string", dynamic: "boolean" - }); - } - _throwError(message, value) { - assertArgument(false, message, this.localName, value); - } -} -/** - * @_ignore - */ -export class Writer { - // An array of WordSize lengthed objects to concatenation - #data; - #dataLength; - constructor() { - this.#data = []; - this.#dataLength = 0; - } - get data() { - return concat(this.#data); - } - get length() { return this.#dataLength; } - #writeData(data) { - this.#data.push(data); - this.#dataLength += data.length; - return data.length; - } - appendWriter(writer) { - return this.#writeData(getBytesCopy(writer.data)); - } - // Arrayish item; pad on the right to *nearest* WordSize - writeBytes(value) { - let bytes = getBytesCopy(value); - const paddingOffset = bytes.length % WordSize; - if (paddingOffset) { - bytes = getBytesCopy(concat([bytes, Padding.slice(paddingOffset)])); - } - return this.#writeData(bytes); - } - // Numeric item; pad on the left *to* WordSize - writeValue(value) { - return this.#writeData(getValue(value)); - } - // Inserts a numeric place-holder, returning a callback that can - // be used to asjust the value later - writeUpdatableValue() { - const offset = this.#data.length; - this.#data.push(Padding); - this.#dataLength += WordSize; - return (value) => { - this.#data[offset] = getValue(value); - }; - } -} -/** - * @_ignore - */ -export class Reader { - // Allows incomplete unpadded data to be read; otherwise an error - // is raised if attempting to overrun the buffer. This is required - // to deal with an old Solidity bug, in which event data for - // external (not public thoguh) was tightly packed. - allowLoose; - #data; - #offset; - #bytesRead; - #parent; - #maxInflation; - constructor(data, allowLoose, maxInflation) { - defineProperties(this, { allowLoose: !!allowLoose }); - this.#data = getBytesCopy(data); - this.#bytesRead = 0; - this.#parent = null; - this.#maxInflation = (maxInflation != null) ? maxInflation : 1024; - this.#offset = 0; - } - get data() { return hexlify(this.#data); } - get dataLength() { return this.#data.length; } - get consumed() { return this.#offset; } - get bytes() { return new Uint8Array(this.#data); } - #incrementBytesRead(count) { - if (this.#parent) { - return this.#parent.#incrementBytesRead(count); - } - this.#bytesRead += count; - // Check for excessive inflation (see: #4537) - assert(this.#maxInflation < 1 || this.#bytesRead <= this.#maxInflation * this.dataLength, `compressed ABI data exceeds inflation ratio of ${this.#maxInflation} ( see: https:/\/github.com/ethers-io/ethers.js/issues/4537 )`, "BUFFER_OVERRUN", { - buffer: getBytesCopy(this.#data), offset: this.#offset, - length: count, info: { - bytesRead: this.#bytesRead, - dataLength: this.dataLength - } - }); - } - #peekBytes(offset, length, loose) { - let alignedLength = Math.ceil(length / WordSize) * WordSize; - if (this.#offset + alignedLength > this.#data.length) { - if (this.allowLoose && loose && this.#offset + length <= this.#data.length) { - alignedLength = length; - } - else { - assert(false, "data out-of-bounds", "BUFFER_OVERRUN", { - buffer: getBytesCopy(this.#data), - length: this.#data.length, - offset: this.#offset + alignedLength - }); - } - } - return this.#data.slice(this.#offset, this.#offset + alignedLength); - } - // Create a sub-reader with the same underlying data, but offset - subReader(offset) { - const reader = new Reader(this.#data.slice(this.#offset + offset), this.allowLoose, this.#maxInflation); - reader.#parent = this; - return reader; - } - // Read bytes - readBytes(length, loose) { - let bytes = this.#peekBytes(0, length, !!loose); - this.#incrementBytesRead(length); - this.#offset += bytes.length; - // @TODO: Make sure the length..end bytes are all 0? - return bytes.slice(0, length); - } - // Read a numeric values - readValue() { - return toBigInt(this.readBytes(WordSize)); - } - readIndex() { - return toNumber(this.readBytes(WordSize)); - } -} -//# sourceMappingURL=abstract-coder.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/abstract-coder.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/abstract-coder.js.map deleted file mode 100644 index c432560a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/abstract-coder.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abstract-coder.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/abstract-coder.ts"],"names":[],"mappings":"AACA,OAAO,EACH,gBAAgB,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,OAAO,EAC1D,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAC7B,MAAM,EAAE,cAAc;AACtB,aAAa;EAChB,MAAM,sBAAsB,CAAC;AAI9B;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAW,EAAE,CAAC;AACnC,MAAM,OAAO,GAAG,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAC;AAEzC,qEAAqE;AACrE,iEAAiE;AACjE,MAAM,cAAc,GAAG,CAAE,MAAM,CAAE,CAAC;AAElC,MAAM,MAAM,GAAG,EAAG,CAAC;AAEnB,MAAM,WAAW,GAAkD,IAAI,OAAO,EAAE,CAAC;AAEjF,SAAS,QAAQ,CAAC,MAAc;IAC5B,OAAO,WAAW,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC;AACpC,CAAC;AACD,SAAS,QAAQ,CAAC,MAAc,EAAE,KAAmC;IACjE,WAAW,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACnC,CAAC;AAED,SAAS,UAAU,CAAC,IAAY,EAAE,KAAY;IAC1C,MAAM,OAAO,GAAG,IAAI,KAAK,CAAC,0DAA2D,IAAK,EAAE,CAAC,CAAC;IACxF,OAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;IAC7B,MAAM,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b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/address.d.ts deleted file mode 100644 index 8befac03..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/address.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class AddressCoder extends Coder { - constructor(localName: string); - defaultValue(): string; - encode(writer: Writer, _value: string | Typed): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=address.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/address.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/address.d.ts.map deleted file mode 100644 index f86c8f18..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/address.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/address.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG1D;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;gBAEvB,SAAS,EAAE,MAAM;IAI7B,YAAY,IAAI,MAAM;IAItB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM;IAUtD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG9B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/address.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/address.js deleted file mode 100644 index 445029c9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/address.js +++ /dev/null @@ -1,29 +0,0 @@ -import { getAddress } from "../../address/index.js"; -import { toBeHex } from "../../utils/maths.js"; -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; -/** - * @_ignore - */ -export class AddressCoder extends Coder { - constructor(localName) { - super("address", "address", localName, false); - } - defaultValue() { - return "0x0000000000000000000000000000000000000000"; - } - encode(writer, _value) { - let value = Typed.dereference(_value, "string"); - try { - value = getAddress(value); - } - catch (error) { - return this._throwError(error.message, _value); - } - return writer.writeValue(value); - } - decode(reader) { - return getAddress(toBeHex(reader.readValue(), 20)); - } -} -//# sourceMappingURL=address.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/address.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/address.js.map deleted file mode 100644 index 4d5cae70..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/address.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"address.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAK5C;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK;IAEnC,YAAY,SAAiB;QACzB,KAAK,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IAClD,CAAC;IAED,YAAY;QACR,OAAO,4CAA4C,CAAC;IACxD,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,MAAsB;QACzC,IAAI,KAAK,GAAG,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAChD,IAAI;YACA,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;SAC7B;QAAC,OAAO,KAAU,EAAE;YACjB,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;SAClD;QACD,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;IAED,MAAM,CAAC,MAAc;QACjB,OAAO,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IACvD,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/anonymous.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/anonymous.d.ts deleted file mode 100644 index 554bf03f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/anonymous.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Coder } from "./abstract-coder.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * Clones the functionality of an existing Coder, but without a localName - * - * @_ignore - */ -export declare class AnonymousCoder extends Coder { - private coder; - constructor(coder: Coder); - defaultValue(): any; - encode(writer: Writer, value: any): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=anonymous.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/anonymous.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/anonymous.d.ts.map deleted file mode 100644 index f150f060..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/anonymous.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"anonymous.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/anonymous.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;;;GAIG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACrC,OAAO,CAAC,KAAK,CAAQ;gBAET,KAAK,EAAE,KAAK;IAKxB,YAAY,IAAI,GAAG;IAInB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM;IAI1C,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG9B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/anonymous.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/anonymous.js deleted file mode 100644 index b6d95326..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/anonymous.js +++ /dev/null @@ -1,23 +0,0 @@ -import { Coder } from "./abstract-coder.js"; -/** - * Clones the functionality of an existing Coder, but without a localName - * - * @_ignore - */ -export class AnonymousCoder extends Coder { - coder; - constructor(coder) { - super(coder.name, coder.type, "_", coder.dynamic); - this.coder = coder; - } - defaultValue() { - return this.coder.defaultValue(); - } - encode(writer, value) { - return this.coder.encode(writer, value); - } - decode(reader) { - return this.coder.decode(reader); - } -} -//# sourceMappingURL=anonymous.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/anonymous.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/anonymous.js.map deleted file mode 100644 index ac81d99b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/anonymous.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"anonymous.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/anonymous.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAI5C;;;;GAIG;AACH,MAAM,OAAO,cAAe,SAAQ,KAAK;IAC7B,KAAK,CAAQ;IAErB,YAAY,KAAY;QACpB,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QAClD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,YAAY;QACR,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;IACrC,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,KAAU;QAC7B,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC5C,CAAC;IAED,MAAM,CAAC,MAAc;QACjB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/array.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/array.d.ts deleted file mode 100644 index 954c4e17..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/array.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Typed } from "../typed.js"; -import { Coder, Result, Writer } from "./abstract-coder.js"; -import type { Reader } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare function pack(writer: Writer, coders: ReadonlyArray, values: Array | { - [name: string]: any; -}): number; -/** - * @_ignore - */ -export declare function unpack(reader: Reader, coders: ReadonlyArray): Result; -/** - * @_ignore - */ -export declare class ArrayCoder extends Coder { - readonly coder: Coder; - readonly length: number; - constructor(coder: Coder, length: number, localName: string); - defaultValue(): Array; - encode(writer: Writer, _value: Array | Typed): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=array.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/array.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/array.d.ts.map deleted file mode 100644 index c3a6d622..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/array.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/array.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAY,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD;;GAEG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG;IAAE,CAAE,IAAI,EAAE,MAAM,GAAI,GAAG,CAAA;CAAE,GAAG,MAAM,CA2DzH;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,MAAM,CAoD3E;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACjC,QAAQ,CAAC,KAAK,EAAG,KAAK,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;gBAEb,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAO3D,YAAY,IAAI,KAAK,CAAC,GAAG,CAAC;IAW1B,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,GAAG,MAAM;IAsB1D,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAkB9B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/array.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/array.js deleted file mode 100644 index 576f40f1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/array.js +++ /dev/null @@ -1,159 +0,0 @@ -import { defineProperties, isError, assert, assertArgument, assertArgumentCount } from "../../utils/index.js"; -import { Typed } from "../typed.js"; -import { Coder, Result, WordSize, Writer } from "./abstract-coder.js"; -import { AnonymousCoder } from "./anonymous.js"; -/** - * @_ignore - */ -export function pack(writer, coders, values) { - let arrayValues = []; - if (Array.isArray(values)) { - arrayValues = values; - } - else if (values && typeof (values) === "object") { - let unique = {}; - arrayValues = coders.map((coder) => { - const name = coder.localName; - assert(name, "cannot encode object for signature with missing names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values }); - assert(!unique[name], "cannot encode object for signature with duplicate names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values }); - unique[name] = true; - return values[name]; - }); - } - else { - assertArgument(false, "invalid tuple value", "tuple", values); - } - assertArgument(coders.length === arrayValues.length, "types/value length mismatch", "tuple", values); - let staticWriter = new Writer(); - let dynamicWriter = new Writer(); - let updateFuncs = []; - coders.forEach((coder, index) => { - let value = arrayValues[index]; - if (coder.dynamic) { - // Get current dynamic offset (for the future pointer) - let dynamicOffset = dynamicWriter.length; - // Encode the dynamic value into the dynamicWriter - coder.encode(dynamicWriter, value); - // Prepare to populate the correct offset once we are done - let updateFunc = staticWriter.writeUpdatableValue(); - updateFuncs.push((baseOffset) => { - updateFunc(baseOffset + dynamicOffset); - }); - } - else { - coder.encode(staticWriter, value); - } - }); - // Backfill all the dynamic offsets, now that we know the static length - updateFuncs.forEach((func) => { func(staticWriter.length); }); - let length = writer.appendWriter(staticWriter); - length += writer.appendWriter(dynamicWriter); - return length; -} -/** - * @_ignore - */ -export function unpack(reader, coders) { - let values = []; - let keys = []; - // A reader anchored to this base - let baseReader = reader.subReader(0); - coders.forEach((coder) => { - let value = null; - if (coder.dynamic) { - let offset = reader.readIndex(); - let offsetReader = baseReader.subReader(offset); - try { - value = coder.decode(offsetReader); - } - catch (error) { - // Cannot recover from this - if (isError(error, "BUFFER_OVERRUN")) { - throw error; - } - value = error; - value.baseType = coder.name; - value.name = coder.localName; - value.type = coder.type; - } - } - else { - try { - value = coder.decode(reader); - } - catch (error) { - // Cannot recover from this - if (isError(error, "BUFFER_OVERRUN")) { - throw error; - } - value = error; - value.baseType = coder.name; - value.name = coder.localName; - value.type = coder.type; - } - } - if (value == undefined) { - throw new Error("investigate"); - } - values.push(value); - keys.push(coder.localName || null); - }); - return Result.fromItems(values, keys); -} -/** - * @_ignore - */ -export class ArrayCoder extends Coder { - coder; - length; - constructor(coder, length, localName) { - const type = (coder.type + "[" + (length >= 0 ? length : "") + "]"); - const dynamic = (length === -1 || coder.dynamic); - super("array", type, localName, dynamic); - defineProperties(this, { coder, length }); - } - defaultValue() { - // Verifies the child coder is valid (even if the array is dynamic or 0-length) - const defaultChild = this.coder.defaultValue(); - const result = []; - for (let i = 0; i < this.length; i++) { - result.push(defaultChild); - } - return result; - } - encode(writer, _value) { - const value = Typed.dereference(_value, "array"); - if (!Array.isArray(value)) { - this._throwError("expected array value", value); - } - let count = this.length; - if (count === -1) { - count = value.length; - writer.writeValue(value.length); - } - assertArgumentCount(value.length, count, "coder array" + (this.localName ? (" " + this.localName) : "")); - let coders = []; - for (let i = 0; i < value.length; i++) { - coders.push(this.coder); - } - return pack(writer, coders, value); - } - decode(reader) { - let count = this.length; - if (count === -1) { - count = reader.readIndex(); - // Check that there is *roughly* enough data to ensure - // stray random data is not being read as a length. Each - // slot requires at least 32 bytes for their value (or 32 - // bytes as a link to the data). This could use a much - // tighter bound, but we are erroring on the side of safety. - assert(count * WordSize <= reader.dataLength, "insufficient data length", "BUFFER_OVERRUN", { buffer: reader.bytes, offset: count * WordSize, length: reader.dataLength }); - } - let coders = []; - for (let i = 0; i < count; i++) { - coders.push(new AnonymousCoder(this.coder)); - } - return unpack(reader, coders); - } -} -//# sourceMappingURL=array.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/array.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/array.js.map deleted file mode 100644 index 5cab086f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm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AsD;YACtD,4DAA4D;YAC5D,MAAM,CAAC,KAAK,GAAG,QAAQ,IAAI,MAAM,CAAC,UAAU,EAAE,0BAA0B,EACpE,gBAAgB,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,GAAG,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;SACxG;QACD,IAAI,MAAM,GAAiB,EAAE,CAAC;QAC9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE;YAAE,MAAM,CAAC,IAAI,CAAC,IAAI,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;SAAE;QAEhF,OAAO,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/boolean.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/boolean.d.ts deleted file mode 100644 index f073e37e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/boolean.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class BooleanCoder extends Coder { - constructor(localName: string); - defaultValue(): boolean; - encode(writer: Writer, _value: boolean | Typed): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=boolean.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/boolean.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/boolean.d.ts.map deleted file mode 100644 index b1b5811e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/boolean.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"boolean.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/boolean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;gBAEvB,SAAS,EAAE,MAAM;IAI7B,YAAY,IAAI,OAAO;IAIvB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM;IAKvD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG9B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/boolean.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/boolean.js deleted file mode 100644 index 3992319f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/boolean.js +++ /dev/null @@ -1,21 +0,0 @@ -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; -/** - * @_ignore - */ -export class BooleanCoder extends Coder { - constructor(localName) { - super("bool", "bool", localName, false); - } - defaultValue() { - return false; - } - encode(writer, _value) { - const value = Typed.dereference(_value, "bool"); - return writer.writeValue(value ? 1 : 0); - } - decode(reader) { - return !!reader.readValue(); - } -} -//# sourceMappingURL=boolean.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/boolean.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/boolean.js.map deleted file mode 100644 index 52b0ce29..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/boolean.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"boolean.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/boolean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAI5C;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK;IAEnC,YAAY,SAAiB;QACzB,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IAC5C,CAAC;IAED,YAAY;QACR,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,MAAuB;QAC1C,MAAM,KAAK,GAAG,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAChD,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3C,CAAC;IAED,MAAM,CAAC,MAAc;QACjB,OAAO,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;IAChC,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/bytes.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/bytes.d.ts deleted file mode 100644 index 1e554582..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/bytes.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Coder } from "./abstract-coder.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class DynamicBytesCoder extends Coder { - constructor(type: string, localName: string); - defaultValue(): string; - encode(writer: Writer, value: any): number; - decode(reader: Reader): any; -} -/** - * @_ignore - */ -export declare class BytesCoder extends DynamicBytesCoder { - constructor(localName: string); - decode(reader: Reader): any; -} -//# sourceMappingURL=bytes.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/bytes.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/bytes.d.ts.map deleted file mode 100644 index f1696167..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/bytes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bytes.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/bytes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG1D;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;gBAC5B,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAI3C,YAAY,IAAI,MAAM;IAItB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM;IAO1C,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG9B;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,iBAAiB;gBACjC,SAAS,EAAE,MAAM;IAI7B,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG9B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/bytes.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/bytes.js deleted file mode 100644 index 01aad879..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/bytes.js +++ /dev/null @@ -1,34 +0,0 @@ -import { getBytesCopy, hexlify } from "../../utils/index.js"; -import { Coder } from "./abstract-coder.js"; -/** - * @_ignore - */ -export class DynamicBytesCoder extends Coder { - constructor(type, localName) { - super(type, type, localName, true); - } - defaultValue() { - return "0x"; - } - encode(writer, value) { - value = getBytesCopy(value); - let length = writer.writeValue(value.length); - length += writer.writeBytes(value); - return length; - } - decode(reader) { - return reader.readBytes(reader.readIndex(), true); - } -} -/** - * @_ignore - */ -export class BytesCoder extends DynamicBytesCoder { - constructor(localName) { - super("bytes", localName); - } - decode(reader) { - return hexlify(super.decode(reader)); - } -} -//# sourceMappingURL=bytes.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/bytes.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/bytes.js.map deleted file mode 100644 index d3462ecf..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/bytes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bytes.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/bytes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAK5C;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IACxC,YAAY,IAAY,EAAE,SAAiB;QACxC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;IACtC,CAAC;IAED,YAAY;QACR,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,KAAU;QAC7B,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;QAC5B,IAAI,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC7C,MAAM,IAAI,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACnC,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,MAAM,CAAC,MAAc;QACjB,OAAO,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,IAAI,CAAC,CAAC;IACtD,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,iBAAiB;IAC7C,YAAY,SAAiB;QACzB,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM,CAAC,MAAc;QACjB,OAAO,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IACzC,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/fixed-bytes.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/fixed-bytes.d.ts deleted file mode 100644 index 5c485fef..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/fixed-bytes.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; -import type { BytesLike } from "../../utils/index.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class FixedBytesCoder extends Coder { - readonly size: number; - constructor(size: number, localName: string); - defaultValue(): string; - encode(writer: Writer, _value: BytesLike | Typed): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=fixed-bytes.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/fixed-bytes.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/fixed-bytes.d.ts.map deleted file mode 100644 index fcf0893d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/fixed-bytes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fixed-bytes.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/fixed-bytes.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG1D;;GAEG;AACH,qBAAa,eAAgB,SAAQ,KAAK;IACtC,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;gBAEX,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAM3C,YAAY,IAAI,MAAM;IAItB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,KAAK,GAAG,MAAM;IAMzD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG9B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/fixed-bytes.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/fixed-bytes.js deleted file mode 100644 index 08dd20b6..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/fixed-bytes.js +++ /dev/null @@ -1,28 +0,0 @@ -import { defineProperties, getBytesCopy, hexlify } from "../../utils/index.js"; -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; -/** - * @_ignore - */ -export class FixedBytesCoder extends Coder { - size; - constructor(size, localName) { - let name = "bytes" + String(size); - super(name, name, localName, false); - defineProperties(this, { size }, { size: "number" }); - } - defaultValue() { - return ("0x0000000000000000000000000000000000000000000000000000000000000000").substring(0, 2 + this.size * 2); - } - encode(writer, _value) { - let data = getBytesCopy(Typed.dereference(_value, this.type)); - if (data.length !== this.size) { - this._throwError("incorrect data length", _value); - } - return writer.writeBytes(data); - } - decode(reader) { - return hexlify(reader.readBytes(this.size)); - } -} -//# sourceMappingURL=fixed-bytes.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/fixed-bytes.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/fixed-bytes.js.map deleted file mode 100644 index bb22c492..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/fixed-bytes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fixed-bytes.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/fixed-bytes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/E,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAO5C;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,KAAK;IAC7B,IAAI,CAAU;IAEvB,YAAY,IAAY,EAAE,SAAiB;QACvC,IAAI,IAAI,GAAG,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;QAClC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;QACpC,gBAAgB,CAAkB,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED,YAAY;QACR,OAAO,CAAC,oEAAoE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;IAClH,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,MAAyB;QAC5C,IAAI,IAAI,GAAG,YAAY,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC9D,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,IAAI,EAAE;YAAE,IAAI,CAAC,WAAW,CAAC,uBAAuB,EAAE,MAAM,CAAC,CAAC;SAAE;QACrF,OAAO,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,MAAM,CAAC,MAAc;QACjB,OAAO,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAChD,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/null.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/null.d.ts deleted file mode 100644 index 5df5da34..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/null.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Coder } from "./abstract-coder.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class NullCoder extends Coder { - constructor(localName: string); - defaultValue(): null; - encode(writer: Writer, value: any): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=null.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/null.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/null.d.ts.map deleted file mode 100644 index 4c87b845..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/null.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"null.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/null.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAI1D;;GAEG;AACH,qBAAa,SAAU,SAAQ,KAAK;gBAEpB,SAAS,EAAE,MAAM;IAI7B,YAAY,IAAI,IAAI;IAIpB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM;IAK1C,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAI9B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/null.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/null.js deleted file mode 100644 index 5b7d867a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/null.js +++ /dev/null @@ -1,24 +0,0 @@ -import { Coder } from "./abstract-coder.js"; -const Empty = new Uint8Array([]); -/** - * @_ignore - */ -export class NullCoder extends Coder { - constructor(localName) { - super("null", "", localName, false); - } - defaultValue() { - return null; - } - encode(writer, value) { - if (value != null) { - this._throwError("not null", value); - } - return writer.writeBytes(Empty); - } - decode(reader) { - reader.readBytes(0); - return null; - } -} -//# sourceMappingURL=null.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/null.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/null.js.map deleted file mode 100644 index 6afd520c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/null.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"null.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/null.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAG5C,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,EAAG,CAAC,CAAC;AAElC;;GAEG;AACH,MAAM,OAAO,SAAU,SAAQ,KAAK;IAEhC,YAAY,SAAiB;QACzB,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IACxC,CAAC;IAED,YAAY;QACR,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,KAAU;QAC7B,IAAI,KAAK,IAAI,IAAI,EAAE;YAAE,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;SAAE;QAC3D,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;IAED,MAAM,CAAC,MAAc;QACjB,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QACpB,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/number.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/number.d.ts deleted file mode 100644 index 822cc6df..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/number.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; -import type { BigNumberish } from "../../utils/index.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class NumberCoder extends Coder { - readonly size: number; - readonly signed: boolean; - constructor(size: number, signed: boolean, localName: string); - defaultValue(): number; - encode(writer: Writer, _value: BigNumberish | Typed): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=number.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/number.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/number.d.ts.map deleted file mode 100644 index a02820f6..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/number.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/number.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAY,MAAM,qBAAqB,CAAC;AAEtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAO1D;;GAEG;AACH,qBAAa,WAAY,SAAQ,KAAK;IAClC,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAG,OAAO,CAAC;gBAEd,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM;IAO5D,YAAY,IAAI,MAAM;IAItB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,KAAK,GAAG,MAAM;IAkB5D,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAS9B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/number.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/number.js deleted file mode 100644 index 52f5a46b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/number.js +++ /dev/null @@ -1,45 +0,0 @@ -import { defineProperties, fromTwos, getBigInt, mask, toTwos } from "../../utils/index.js"; -import { Typed } from "../typed.js"; -import { Coder, WordSize } from "./abstract-coder.js"; -const BN_0 = BigInt(0); -const BN_1 = BigInt(1); -const BN_MAX_UINT256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); -/** - * @_ignore - */ -export class NumberCoder extends Coder { - size; - signed; - constructor(size, signed, localName) { - const name = ((signed ? "int" : "uint") + (size * 8)); - super(name, name, localName, false); - defineProperties(this, { size, signed }, { size: "number", signed: "boolean" }); - } - defaultValue() { - return 0; - } - encode(writer, _value) { - let value = getBigInt(Typed.dereference(_value, this.type)); - // Check bounds are safe for encoding - let maxUintValue = mask(BN_MAX_UINT256, WordSize * 8); - if (this.signed) { - let bounds = mask(maxUintValue, (this.size * 8) - 1); - if (value > bounds || value < -(bounds + BN_1)) { - this._throwError("value out-of-bounds", _value); - } - value = toTwos(value, 8 * WordSize); - } - else if (value < BN_0 || value > mask(maxUintValue, this.size * 8)) { - this._throwError("value out-of-bounds", _value); - } - return writer.writeValue(value); - } - decode(reader) { - let value = mask(reader.readValue(), this.size * 8); - if (this.signed) { - value = fromTwos(value, this.size * 8); - } - return value; - } -} -//# sourceMappingURL=number.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/number.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/number.js.map deleted file mode 100644 index 5ecd80d4..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/number.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"number.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/number.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,gBAAgB,EAAE,QAAQ,EA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,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YACrD,IAAI,KAAK,GAAG,MAAM,IAAI,KAAK,GAAG,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE;gBAC5C,IAAI,CAAC,WAAW,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;aACnD;YACD,KAAK,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC;SACvC;aAAM,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,GAAG,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,EAAE;YAClE,IAAI,CAAC,WAAW,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;SACnD;QAED,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;IAED,MAAM,CAAC,MAAc;QACjB,IAAI,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;QAEpD,IAAI,IAAI,CAAC,MAAM,EAAE;YACb,KAAK,GAAG,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;SAC1C;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/string.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/string.d.ts deleted file mode 100644 index 8e1c6359..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/string.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Typed } from "../typed.js"; -import { DynamicBytesCoder } from "./bytes.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class StringCoder extends DynamicBytesCoder { - constructor(localName: string); - defaultValue(): string; - encode(writer: Writer, _value: string | Typed): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=string.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/string.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/string.d.ts.map deleted file mode 100644 index 8141f2ea..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/string.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/string.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG1D;;GAEG;AACH,qBAAa,WAAY,SAAQ,iBAAiB;gBAElC,SAAS,EAAE,MAAM;IAI7B,YAAY,IAAI,MAAM;IAItB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM;IAItD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG9B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/string.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/string.js deleted file mode 100644 index cd8c4bd5..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/string.js +++ /dev/null @@ -1,21 +0,0 @@ -import { toUtf8Bytes, toUtf8String } from "../../utils/utf8.js"; -import { Typed } from "../typed.js"; -import { DynamicBytesCoder } from "./bytes.js"; -/** - * @_ignore - */ -export class StringCoder extends DynamicBytesCoder { - constructor(localName) { - super("string", localName); - } - defaultValue() { - return ""; - } - encode(writer, _value) { - return super.encode(writer, toUtf8Bytes(Typed.dereference(_value, "string"))); - } - decode(reader) { - return toUtf8String(super.decode(reader)); - } -} -//# sourceMappingURL=string.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/string.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/string.js.map deleted file mode 100644 index f0a168f9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/string.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"string.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/string.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEhE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAK/C;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,iBAAiB;IAE9C,YAAY,SAAiB;QACzB,KAAK,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IAC/B,CAAC;IAED,YAAY;QACR,OAAO,EAAE,CAAC;IACd,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,MAAsB;QACzC,OAAO,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IAClF,CAAC;IAED,MAAM,CAAC,MAAc;QACjB,OAAO,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9C,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/tuple.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/tuple.d.ts deleted file mode 100644 index fe3ec032..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/tuple.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class TupleCoder extends Coder { - readonly coders: ReadonlyArray; - constructor(coders: Array, localName: string); - defaultValue(): any; - encode(writer: Writer, _value: Array | { - [name: string]: any; - } | Typed): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=tuple.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/tuple.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/tuple.d.ts.map deleted file mode 100644 index a7a22ec0..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/tuple.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tuple.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/tuple.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAI5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACjC,QAAQ,CAAC,MAAM,EAAG,aAAa,CAAC,KAAK,CAAC,CAAC;gBAE3B,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,MAAM;IAanD,YAAY,IAAI,GAAG;IA+BnB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG;QAAE,CAAE,IAAI,EAAE,MAAM,GAAI,GAAG,CAAA;KAAE,GAAG,KAAK,GAAG,MAAM;IAKtF,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG9B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/tuple.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/tuple.js deleted file mode 100644 index 9215603f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/tuple.js +++ /dev/null @@ -1,63 +0,0 @@ -import { defineProperties } from "../../utils/properties.js"; -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; -import { pack, unpack } from "./array.js"; -/** - * @_ignore - */ -export class TupleCoder extends Coder { - coders; - constructor(coders, localName) { - let dynamic = false; - const types = []; - coders.forEach((coder) => { - if (coder.dynamic) { - dynamic = true; - } - types.push(coder.type); - }); - const type = ("tuple(" + types.join(",") + ")"); - super("tuple", type, localName, dynamic); - defineProperties(this, { coders: Object.freeze(coders.slice()) }); - } - defaultValue() { - const values = []; - this.coders.forEach((coder) => { - values.push(coder.defaultValue()); - }); - // We only output named properties for uniquely named coders - const uniqueNames = this.coders.reduce((accum, coder) => { - const name = coder.localName; - if (name) { - if (!accum[name]) { - accum[name] = 0; - } - accum[name]++; - } - return accum; - }, {}); - // Add named values - this.coders.forEach((coder, index) => { - let name = coder.localName; - if (!name || uniqueNames[name] !== 1) { - return; - } - if (name === "length") { - name = "_length"; - } - if (values[name] != null) { - return; - } - values[name] = values[index]; - }); - return Object.freeze(values); - } - encode(writer, _value) { - const value = Typed.dereference(_value, "tuple"); - return pack(writer, this.coders, value); - } - decode(reader) { - return unpack(reader, this.coders); - } -} -//# sourceMappingURL=tuple.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/tuple.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/tuple.js.map deleted file mode 100644 index a9be35f2..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/coders/tuple.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tuple.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/tuple.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE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G,CAAC,CAAC;iBAAE;gBACtC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;aACjB;YACD,OAAO,KAAK,CAAC;QACjB,CAAC,EAAgC,EAAG,CAAC,CAAC;QAEtC,mBAAmB;QACnB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAY,EAAE,KAAa,EAAE,EAAE;YAChD,IAAI,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC;YAC3B,IAAI,CAAC,IAAI,IAAI,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;gBAAE,OAAO;aAAE;YAEjD,IAAI,IAAI,KAAK,QAAQ,EAAE;gBAAE,IAAI,GAAG,SAAS,CAAC;aAAE;YAE5C,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE;gBAAE,OAAO;aAAE;YAErC,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,MAAsD;QACzE,MAAM,KAAK,GAAG,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACjD,OAAO,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC5C,CAAC;IAED,MAAM,CAAC,MAAc;QACjB,OAAO,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACvC,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/fragments.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/fragments.d.ts deleted file mode 100644 index cafb0a5a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/fragments.d.ts +++ /dev/null @@ -1,466 +0,0 @@ -/** - * A fragment is a single item from an ABI, which may represent any of: - * - * - [Functions](FunctionFragment) - * - [Events](EventFragment) - * - [Constructors](ConstructorFragment) - * - Custom [Errors](ErrorFragment) - * - [Fallback or Receive](FallbackFragment) functions - * - * @_subsection api/abi/abi-coder:Fragments [about-fragments] - */ -/** - * A Type description in a [JSON ABI format](link-solc-jsonabi). - */ -export interface JsonFragmentType { - /** - * The parameter name. - */ - readonly name?: string; - /** - * If the parameter is indexed. - */ - readonly indexed?: boolean; - /** - * The type of the parameter. - */ - readonly type?: string; - /** - * The internal Solidity type. - */ - readonly internalType?: string; - /** - * The components for a tuple. - */ - readonly components?: ReadonlyArray; -} -/** - * A fragment for a method, event or error in a [JSON ABI format](link-solc-jsonabi). - */ -export interface JsonFragment { - /** - * The name of the error, event, function, etc. - */ - readonly name?: string; - /** - * The type of the fragment (e.g. ``event``, ``"function"``, etc.) - */ - readonly type?: string; - /** - * If the event is anonymous. - */ - readonly anonymous?: boolean; - /** - * If the function is payable. - */ - readonly payable?: boolean; - /** - * If the function is constant. - */ - readonly constant?: boolean; - /** - * The mutability state of the function. - */ - readonly stateMutability?: string; - /** - * The input parameters. - */ - readonly inputs?: ReadonlyArray; - /** - * The output parameters. - */ - readonly outputs?: ReadonlyArray; - /** - * The gas limit to use when sending a transaction for this function. - */ - readonly gas?: string; -} -/** - * The format to serialize the output as. - * - * **``"sighash"``** - the bare formatting, used to compute the selector - * or topic hash; this format cannot be reversed (as it discards ``indexed``) - * so cannot by used to export an [[Interface]]. - * - * **``"minimal"``** - Human-Readable ABI with minimal spacing and without - * names, so it is compact, but will result in Result objects that cannot - * be accessed by name. - * - * **``"full"``** - Full Human-Readable ABI, with readable spacing and names - * intact; this is generally the recommended format. - * - * **``"json"``** - The [JSON ABI format](link-solc-jsonabi). - */ -export type FormatType = "sighash" | "minimal" | "full" | "json"; -/** - * When [walking](ParamType-walk) a [[ParamType]], this is called - * on each component. - */ -export type ParamTypeWalkFunc = (type: string, value: any) => any; -/** - * When [walking asynchronously](ParamType-walkAsync) a [[ParamType]], - * this is called on each component. - */ -export type ParamTypeWalkAsyncFunc = (type: string, value: any) => any | Promise; -/** - * Each input and output of a [[Fragment]] is an Array of **ParamType**. - */ -export declare class ParamType { - #private; - /** - * The local name of the parameter (or ``""`` if unbound) - */ - readonly name: string; - /** - * The fully qualified type (e.g. ``"address"``, ``"tuple(address)"``, - * ``"uint256[3][]"``) - */ - readonly type: string; - /** - * The base type (e.g. ``"address"``, ``"tuple"``, ``"array"``) - */ - readonly baseType: string; - /** - * True if the parameters is indexed. - * - * For non-indexable types this is ``null``. - */ - readonly indexed: null | boolean; - /** - * The components for the tuple. - * - * For non-tuple types this is ``null``. - */ - readonly components: null | ReadonlyArray; - /** - * The array length, or ``-1`` for dynamic-lengthed arrays. - * - * For non-array types this is ``null``. - */ - readonly arrayLength: null | number; - /** - * The type of each child in the array. - * - * For non-array types this is ``null``. - */ - readonly arrayChildren: null | ParamType; - /** - * @private - */ - constructor(guard: any, name: string, type: string, baseType: string, indexed: null | boolean, components: null | ReadonlyArray, arrayLength: null | number, arrayChildren: null | ParamType); - /** - * Return a string representation of this type. - * - * For example, - * - * ``sighash" => "(uint256,address)"`` - * - * ``"minimal" => "tuple(uint256,address) indexed"`` - * - * ``"full" => "tuple(uint256 foo, address bar) indexed baz"`` - */ - format(format?: FormatType): string; - /** - * Returns true if %%this%% is an Array type. - * - * This provides a type gaurd ensuring that [[arrayChildren]] - * and [[arrayLength]] are non-null. - */ - isArray(): this is (ParamType & { - arrayChildren: ParamType; - arrayLength: number; - }); - /** - * Returns true if %%this%% is a Tuple type. - * - * This provides a type gaurd ensuring that [[components]] - * is non-null. - */ - isTuple(): this is (ParamType & { - components: ReadonlyArray; - }); - /** - * Returns true if %%this%% is an Indexable type. - * - * This provides a type gaurd ensuring that [[indexed]] - * is non-null. - */ - isIndexable(): this is (ParamType & { - indexed: boolean; - }); - /** - * Walks the **ParamType** with %%value%%, calling %%process%% - * on each type, destructing the %%value%% recursively. - */ - walk(value: any, process: ParamTypeWalkFunc): any; - /** - * Walks the **ParamType** with %%value%%, asynchronously calling - * %%process%% on each type, destructing the %%value%% recursively. - * - * This can be used to resolve ENS names by walking and resolving each - * ``"address"`` type. - */ - walkAsync(value: any, process: ParamTypeWalkAsyncFunc): Promise; - /** - * Creates a new **ParamType** for %%obj%%. - * - * If %%allowIndexed%% then the ``indexed`` keyword is permitted, - * otherwise the ``indexed`` keyword will throw an error. - */ - static from(obj: any, allowIndexed?: boolean): ParamType; - /** - * Returns true if %%value%% is a **ParamType**. - */ - static isParamType(value: any): value is ParamType; -} -/** - * The type of a [[Fragment]]. - */ -export type FragmentType = "constructor" | "error" | "event" | "fallback" | "function" | "struct"; -/** - * An abstract class to represent An individual fragment from a parse ABI. - */ -export declare abstract class Fragment { - /** - * The type of the fragment. - */ - readonly type: FragmentType; - /** - * The inputs for the fragment. - */ - readonly inputs: ReadonlyArray; - /** - * @private - */ - constructor(guard: any, type: FragmentType, inputs: ReadonlyArray); - /** - * Returns a string representation of this fragment as %%format%%. - */ - abstract format(format?: FormatType): string; - /** - * Creates a new **Fragment** for %%obj%%, wich can be any supported - * ABI frgament type. - */ - static from(obj: any): Fragment; - /** - * Returns true if %%value%% is a [[ConstructorFragment]]. - */ - static isConstructor(value: any): value is ConstructorFragment; - /** - * Returns true if %%value%% is an [[ErrorFragment]]. - */ - static isError(value: any): value is ErrorFragment; - /** - * Returns true if %%value%% is an [[EventFragment]]. - */ - static isEvent(value: any): value is EventFragment; - /** - * Returns true if %%value%% is a [[FunctionFragment]]. - */ - static isFunction(value: any): value is FunctionFragment; - /** - * Returns true if %%value%% is a [[StructFragment]]. - */ - static isStruct(value: any): value is StructFragment; -} -/** - * An abstract class to represent An individual fragment - * which has a name from a parse ABI. - */ -export declare abstract class NamedFragment extends Fragment { - /** - * The name of the fragment. - */ - readonly name: string; - /** - * @private - */ - constructor(guard: any, type: FragmentType, name: string, inputs: ReadonlyArray); -} -/** - * A Fragment which represents a //Custom Error//. - */ -export declare class ErrorFragment extends NamedFragment { - /** - * @private - */ - constructor(guard: any, name: string, inputs: ReadonlyArray); - /** - * The Custom Error selector. - */ - get selector(): string; - /** - * Returns a string representation of this fragment as %%format%%. - */ - format(format?: FormatType): string; - /** - * Returns a new **ErrorFragment** for %%obj%%. - */ - static from(obj: any): ErrorFragment; - /** - * Returns ``true`` and provides a type guard if %%value%% is an - * **ErrorFragment**. - */ - static isFragment(value: any): value is ErrorFragment; -} -/** - * A Fragment which represents an Event. - */ -export declare class EventFragment extends NamedFragment { - /** - * Whether this event is anonymous. - */ - readonly anonymous: boolean; - /** - * @private - */ - constructor(guard: any, name: string, inputs: ReadonlyArray, anonymous: boolean); - /** - * The Event topic hash. - */ - get topicHash(): string; - /** - * Returns a string representation of this event as %%format%%. - */ - format(format?: FormatType): string; - /** - * Return the topic hash for an event with %%name%% and %%params%%. - */ - static getTopicHash(name: string, params?: Array): string; - /** - * Returns a new **EventFragment** for %%obj%%. - */ - static from(obj: any): EventFragment; - /** - * Returns ``true`` and provides a type guard if %%value%% is an - * **EventFragment**. - */ - static isFragment(value: any): value is EventFragment; -} -/** - * A Fragment which represents a constructor. - */ -export declare class ConstructorFragment extends Fragment { - /** - * Whether the constructor can receive an endowment. - */ - readonly payable: boolean; - /** - * The recommended gas limit for deployment or ``null``. - */ - readonly gas: null | bigint; - /** - * @private - */ - constructor(guard: any, type: FragmentType, inputs: ReadonlyArray, payable: boolean, gas: null | bigint); - /** - * Returns a string representation of this constructor as %%format%%. - */ - format(format?: FormatType): string; - /** - * Returns a new **ConstructorFragment** for %%obj%%. - */ - static from(obj: any): ConstructorFragment; - /** - * Returns ``true`` and provides a type guard if %%value%% is a - * **ConstructorFragment**. - */ - static isFragment(value: any): value is ConstructorFragment; -} -/** - * A Fragment which represents a method. - */ -export declare class FallbackFragment extends Fragment { - /** - * If the function can be sent value during invocation. - */ - readonly payable: boolean; - constructor(guard: any, inputs: ReadonlyArray, payable: boolean); - /** - * Returns a string representation of this fallback as %%format%%. - */ - format(format?: FormatType): string; - /** - * Returns a new **FallbackFragment** for %%obj%%. - */ - static from(obj: any): FallbackFragment; - /** - * Returns ``true`` and provides a type guard if %%value%% is a - * **FallbackFragment**. - */ - static isFragment(value: any): value is FallbackFragment; -} -/** - * A Fragment which represents a method. - */ -export declare class FunctionFragment extends NamedFragment { - /** - * If the function is constant (e.g. ``pure`` or ``view`` functions). - */ - readonly constant: boolean; - /** - * The returned types for the result of calling this function. - */ - readonly outputs: ReadonlyArray; - /** - * The state mutability (e.g. ``payable``, ``nonpayable``, ``view`` - * or ``pure``) - */ - readonly stateMutability: "payable" | "nonpayable" | "view" | "pure"; - /** - * If the function can be sent value during invocation. - */ - readonly payable: boolean; - /** - * The recommended gas limit to send when calling this function. - */ - readonly gas: null | bigint; - /** - * @private - */ - constructor(guard: any, name: string, stateMutability: "payable" | "nonpayable" | "view" | "pure", inputs: ReadonlyArray, outputs: ReadonlyArray, gas: null | bigint); - /** - * The Function selector. - */ - get selector(): string; - /** - * Returns a string representation of this function as %%format%%. - */ - format(format?: FormatType): string; - /** - * Return the selector for a function with %%name%% and %%params%%. - */ - static getSelector(name: string, params?: Array): string; - /** - * Returns a new **FunctionFragment** for %%obj%%. - */ - static from(obj: any): FunctionFragment; - /** - * Returns ``true`` and provides a type guard if %%value%% is a - * **FunctionFragment**. - */ - static isFragment(value: any): value is FunctionFragment; -} -/** - * A Fragment which represents a structure. - */ -export declare class StructFragment extends NamedFragment { - /** - * @private - */ - constructor(guard: any, name: string, inputs: ReadonlyArray); - /** - * Returns a string representation of this struct as %%format%%. - */ - format(): string; - /** - * Returns a new **StructFragment** for %%obj%%. - */ - static from(obj: any): StructFragment; - /** - * Returns ``true`` and provides a type guard if %%value%% is a - * **StructFragment**. - */ - static isFragment(value: any): value is FunctionFragment; -} -//# sourceMappingURL=fragments.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/fragments.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/fragments.d.ts.map deleted file mode 100644 index 8ff0a603..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/fragments.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fragments.d.ts","sourceRoot":"","sources":["../../src.ts/abi/fragments.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAQH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAE/B;;OAEG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;CACzD;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAE5B;;OAEG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAElC;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAElD;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAEnD;;OAEG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;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7D;;OAEG;IACH,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,gBAAgB;IAuDvC;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,gBAAgB;CAG3D;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,aAAa;IAE7C;;OAEG;gBACS,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC;IAKtE;;OAEG;IACH,MAAM,IAAI,MAAM;IAIhB;;OAEG;IACH,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,cAAc;IAmBrC;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,gBAAgB;CAG3D"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/fragments.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/fragments.js deleted file mode 100644 index 6c2323d4..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/fragments.js +++ /dev/null @@ -1,1319 +0,0 @@ -/** - * A fragment is a single item from an ABI, which may represent any of: - * - * - [Functions](FunctionFragment) - * - [Events](EventFragment) - * - [Constructors](ConstructorFragment) - * - Custom [Errors](ErrorFragment) - * - [Fallback or Receive](FallbackFragment) functions - * - * @_subsection api/abi/abi-coder:Fragments [about-fragments] - */ -import { defineProperties, getBigInt, getNumber, assert, assertPrivate, assertArgument } from "../utils/index.js"; -import { id } from "../hash/index.js"; -; -// [ "a", "b" ] => { "a": 1, "b": 1 } -function setify(items) { - const result = new Set(); - items.forEach((k) => result.add(k)); - return Object.freeze(result); -} -const _kwVisibDeploy = "external public payable override"; -const KwVisibDeploy = setify(_kwVisibDeploy.split(" ")); -// Visibility Keywords -const _kwVisib = "constant external internal payable private public pure view override"; -const KwVisib = setify(_kwVisib.split(" ")); -const _kwTypes = "constructor error event fallback function receive struct"; -const KwTypes = setify(_kwTypes.split(" ")); -const _kwModifiers = "calldata memory storage payable indexed"; -const KwModifiers = setify(_kwModifiers.split(" ")); -const _kwOther = "tuple returns"; -// All Keywords -const _keywords = [_kwTypes, _kwModifiers, _kwOther, _kwVisib].join(" "); -const Keywords = setify(_keywords.split(" ")); -// Single character tokens -const SimpleTokens = { - "(": "OPEN_PAREN", ")": "CLOSE_PAREN", - "[": "OPEN_BRACKET", "]": "CLOSE_BRACKET", - ",": "COMMA", "@": "AT" -}; -// Parser regexes to consume the next token -const regexWhitespacePrefix = new RegExp("^(\\s*)"); -const regexNumberPrefix = new RegExp("^([0-9]+)"); -const regexIdPrefix = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"); -// Parser regexs to check validity -const regexId = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"); -const regexType = new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$"); -class TokenString { - #offset; - #tokens; - get offset() { return this.#offset; } - get length() { return this.#tokens.length - this.#offset; } - constructor(tokens) { - this.#offset = 0; - this.#tokens = tokens.slice(); - } - clone() { return new TokenString(this.#tokens); } - reset() { this.#offset = 0; } - #subTokenString(from = 0, to = 0) { - return new TokenString(this.#tokens.slice(from, to).map((t) => { - return Object.freeze(Object.assign({}, t, { - match: (t.match - from), - linkBack: (t.linkBack - from), - linkNext: (t.linkNext - from), - })); - })); - } - // Pops and returns the value of the next token, if it is a keyword in allowed; throws if out of tokens - popKeyword(allowed) { - const top = this.peek(); - if (top.type !== "KEYWORD" || !allowed.has(top.text)) { - throw new Error(`expected keyword ${top.text}`); - } - return this.pop().text; - } - // Pops and returns the value of the next token if it is `type`; throws if out of tokens - popType(type) { - if (this.peek().type !== type) { - const top = this.peek(); - throw new Error(`expected ${type}; got ${top.type} ${JSON.stringify(top.text)}`); - } - return this.pop().text; - } - // Pops and returns a "(" TOKENS ")" - popParen() { - const top = this.peek(); - if (top.type !== "OPEN_PAREN") { - throw new Error("bad start"); - } - const result = this.#subTokenString(this.#offset + 1, top.match + 1); - this.#offset = top.match + 1; - return result; - } - // Pops and returns the items within "(" ITEM1 "," ITEM2 "," ... ")" - popParams() { - const top = this.peek(); - if (top.type !== "OPEN_PAREN") { - throw new Error("bad start"); - } - const result = []; - while (this.#offset < top.match - 1) { - const link = this.peek().linkNext; - result.push(this.#subTokenString(this.#offset + 1, link)); - this.#offset = link; - } - this.#offset = top.match + 1; - return result; - } - // Returns the top Token, throwing if out of tokens - peek() { - if (this.#offset >= this.#tokens.length) { - throw new Error("out-of-bounds"); - } - return this.#tokens[this.#offset]; - } - // Returns the next value, if it is a keyword in `allowed` - peekKeyword(allowed) { - const top = this.peekType("KEYWORD"); - return (top != null && allowed.has(top)) ? top : null; - } - // Returns the value of the next token if it is `type` - peekType(type) { - if (this.length === 0) { - return null; - } - const top = this.peek(); - return (top.type === type) ? top.text : null; - } - // Returns the next token; throws if out of tokens - pop() { - const result = this.peek(); - this.#offset++; - return result; - } - toString() { - const tokens = []; - for (let i = this.#offset; i < this.#tokens.length; i++) { - const token = this.#tokens[i]; - tokens.push(`${token.type}:${token.text}`); - } - return ``; - } -} -function lex(text) { - const tokens = []; - const throwError = (message) => { - const token = (offset < text.length) ? JSON.stringify(text[offset]) : "$EOI"; - throw new Error(`invalid token ${token} at ${offset}: ${message}`); - }; - let brackets = []; - let commas = []; - let offset = 0; - while (offset < text.length) { - // Strip off any leading whitespace - let cur = text.substring(offset); - let match = cur.match(regexWhitespacePrefix); - if (match) { - offset += match[1].length; - cur = text.substring(offset); - } - const token = { depth: brackets.length, linkBack: -1, linkNext: -1, match: -1, type: "", text: "", offset, value: -1 }; - tokens.push(token); - let type = (SimpleTokens[cur[0]] || ""); - if (type) { - token.type = type; - token.text = cur[0]; - offset++; - if (type === "OPEN_PAREN") { - brackets.push(tokens.length - 1); - commas.push(tokens.length - 1); - } - else if (type == "CLOSE_PAREN") { - if (brackets.length === 0) { - throwError("no matching open bracket"); - } - token.match = brackets.pop(); - (tokens[token.match]).match = tokens.length - 1; - token.depth--; - token.linkBack = commas.pop(); - (tokens[token.linkBack]).linkNext = tokens.length - 1; - } - else if (type === "COMMA") { - token.linkBack = commas.pop(); - (tokens[token.linkBack]).linkNext = tokens.length - 1; - commas.push(tokens.length - 1); - } - else if (type === "OPEN_BRACKET") { - token.type = "BRACKET"; - } - else if (type === "CLOSE_BRACKET") { - // Remove the CLOSE_BRACKET - let suffix = tokens.pop().text; - if (tokens.length > 0 && tokens[tokens.length - 1].type === "NUMBER") { - const value = tokens.pop().text; - suffix = value + suffix; - (tokens[tokens.length - 1]).value = getNumber(value); - } - if (tokens.length === 0 || tokens[tokens.length - 1].type !== "BRACKET") { - throw new Error("missing opening bracket"); - } - (tokens[tokens.length - 1]).text += suffix; - } - continue; - } - match = cur.match(regexIdPrefix); - if (match) { - token.text = match[1]; - offset += token.text.length; - if (Keywords.has(token.text)) { - token.type = "KEYWORD"; - continue; - } - if (token.text.match(regexType)) { - token.type = "TYPE"; - continue; - } - token.type = "ID"; - continue; - } - match = cur.match(regexNumberPrefix); - if (match) { - token.text = match[1]; - token.type = "NUMBER"; - offset += token.text.length; - continue; - } - throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset}`); - } - return new TokenString(tokens.map((t) => Object.freeze(t))); -} -// Check only one of `allowed` is in `set` -function allowSingle(set, allowed) { - let included = []; - for (const key in allowed.keys()) { - if (set.has(key)) { - included.push(key); - } - } - if (included.length > 1) { - throw new Error(`conflicting types: ${included.join(", ")}`); - } -} -// Functions to process a Solidity Signature TokenString from left-to-right for... -// ...the name with an optional type, returning the name -function consumeName(type, tokens) { - if (tokens.peekKeyword(KwTypes)) { - const keyword = tokens.pop().text; - if (keyword !== type) { - throw new Error(`expected ${type}, got ${keyword}`); - } - } - return tokens.popType("ID"); -} -// ...all keywords matching allowed, returning the keywords -function consumeKeywords(tokens, allowed) { - const keywords = new Set(); - while (true) { - const keyword = tokens.peekType("KEYWORD"); - if (keyword == null || (allowed && !allowed.has(keyword))) { - break; - } - tokens.pop(); - if (keywords.has(keyword)) { - throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`); - } - keywords.add(keyword); - } - return Object.freeze(keywords); -} -// ...all visibility keywords, returning the coalesced mutability -function consumeMutability(tokens) { - let modifiers = consumeKeywords(tokens, KwVisib); - // Detect conflicting modifiers - allowSingle(modifiers, setify("constant payable nonpayable".split(" "))); - allowSingle(modifiers, setify("pure view payable nonpayable".split(" "))); - // Process mutability states - if (modifiers.has("view")) { - return "view"; - } - if (modifiers.has("pure")) { - return "pure"; - } - if (modifiers.has("payable")) { - return "payable"; - } - if (modifiers.has("nonpayable")) { - return "nonpayable"; - } - // Process legacy `constant` last - if (modifiers.has("constant")) { - return "view"; - } - return "nonpayable"; -} -// ...a parameter list, returning the ParamType list -function consumeParams(tokens, allowIndexed) { - return tokens.popParams().map((t) => ParamType.from(t, allowIndexed)); -} -// ...a gas limit, returning a BigNumber or null if none -function consumeGas(tokens) { - if (tokens.peekType("AT")) { - tokens.pop(); - if (tokens.peekType("NUMBER")) { - return getBigInt(tokens.pop().text); - } - throw new Error("invalid gas"); - } - return null; -} -function consumeEoi(tokens) { - if (tokens.length) { - throw new Error(`unexpected tokens at offset ${tokens.offset}: ${tokens.toString()}`); - } -} -const regexArrayType = new RegExp(/^(.*)\[([0-9]*)\]$/); -function verifyBasicType(type) { - const match = type.match(regexType); - assertArgument(match, "invalid type", "type", type); - if (type === "uint") { - return "uint256"; - } - if (type === "int") { - return "int256"; - } - if (match[2]) { - // bytesXX - const length = parseInt(match[2]); - assertArgument(length !== 0 && length <= 32, "invalid bytes length", "type", type); - } - else if (match[3]) { - // intXX or uintXX - const size = parseInt(match[3]); - assertArgument(size !== 0 && size <= 256 && (size % 8) === 0, "invalid numeric width", "type", type); - } - return type; -} -// Make the Fragment constructors effectively private -const _guard = {}; -const internal = Symbol.for("_ethers_internal"); -const ParamTypeInternal = "_ParamTypeInternal"; -const ErrorFragmentInternal = "_ErrorInternal"; -const EventFragmentInternal = "_EventInternal"; -const ConstructorFragmentInternal = "_ConstructorInternal"; -const FallbackFragmentInternal = "_FallbackInternal"; -const FunctionFragmentInternal = "_FunctionInternal"; -const StructFragmentInternal = "_StructInternal"; -/** - * Each input and output of a [[Fragment]] is an Array of **ParamType**. - */ -export class ParamType { - /** - * The local name of the parameter (or ``""`` if unbound) - */ - name; - /** - * The fully qualified type (e.g. ``"address"``, ``"tuple(address)"``, - * ``"uint256[3][]"``) - */ - type; - /** - * The base type (e.g. ``"address"``, ``"tuple"``, ``"array"``) - */ - baseType; - /** - * True if the parameters is indexed. - * - * For non-indexable types this is ``null``. - */ - indexed; - /** - * The components for the tuple. - * - * For non-tuple types this is ``null``. - */ - components; - /** - * The array length, or ``-1`` for dynamic-lengthed arrays. - * - * For non-array types this is ``null``. - */ - arrayLength; - /** - * The type of each child in the array. - * - * For non-array types this is ``null``. - */ - arrayChildren; - /** - * @private - */ - constructor(guard, name, type, baseType, indexed, components, arrayLength, arrayChildren) { - assertPrivate(guard, _guard, "ParamType"); - Object.defineProperty(this, internal, { value: ParamTypeInternal }); - if (components) { - components = Object.freeze(components.slice()); - } - if (baseType === "array") { - if (arrayLength == null || arrayChildren == null) { - throw new Error(""); - } - } - else if (arrayLength != null || arrayChildren != null) { - throw new Error(""); - } - if (baseType === "tuple") { - if (components == null) { - throw new Error(""); - } - } - else if (components != null) { - throw new Error(""); - } - defineProperties(this, { - name, type, baseType, indexed, components, arrayLength, arrayChildren - }); - } - /** - * Return a string representation of this type. - * - * For example, - * - * ``sighash" => "(uint256,address)"`` - * - * ``"minimal" => "tuple(uint256,address) indexed"`` - * - * ``"full" => "tuple(uint256 foo, address bar) indexed baz"`` - */ - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - const name = this.name || ""; - if (this.isArray()) { - const result = JSON.parse(this.arrayChildren.format("json")); - result.name = name; - result.type += `[${(this.arrayLength < 0 ? "" : String(this.arrayLength))}]`; - return JSON.stringify(result); - } - const result = { - type: ((this.baseType === "tuple") ? "tuple" : this.type), - name - }; - if (typeof (this.indexed) === "boolean") { - result.indexed = this.indexed; - } - if (this.isTuple()) { - result.components = this.components.map((c) => JSON.parse(c.format(format))); - } - return JSON.stringify(result); - } - let result = ""; - // Array - if (this.isArray()) { - result += this.arrayChildren.format(format); - result += `[${(this.arrayLength < 0 ? "" : String(this.arrayLength))}]`; - } - else { - if (this.isTuple()) { - result += "(" + this.components.map((comp) => comp.format(format)).join((format === "full") ? ", " : ",") + ")"; - } - else { - result += this.type; - } - } - if (format !== "sighash") { - if (this.indexed === true) { - result += " indexed"; - } - if (format === "full" && this.name) { - result += " " + this.name; - } - } - return result; - } - /** - * Returns true if %%this%% is an Array type. - * - * This provides a type gaurd ensuring that [[arrayChildren]] - * and [[arrayLength]] are non-null. - */ - isArray() { - return (this.baseType === "array"); - } - /** - * Returns true if %%this%% is a Tuple type. - * - * This provides a type gaurd ensuring that [[components]] - * is non-null. - */ - isTuple() { - return (this.baseType === "tuple"); - } - /** - * Returns true if %%this%% is an Indexable type. - * - * This provides a type gaurd ensuring that [[indexed]] - * is non-null. - */ - isIndexable() { - return (this.indexed != null); - } - /** - * Walks the **ParamType** with %%value%%, calling %%process%% - * on each type, destructing the %%value%% recursively. - */ - walk(value, process) { - if (this.isArray()) { - if (!Array.isArray(value)) { - throw new Error("invalid array value"); - } - if (this.arrayLength !== -1 && value.length !== this.arrayLength) { - throw new Error("array is wrong length"); - } - const _this = this; - return value.map((v) => (_this.arrayChildren.walk(v, process))); - } - if (this.isTuple()) { - if (!Array.isArray(value)) { - throw new Error("invalid tuple value"); - } - if (value.length !== this.components.length) { - throw new Error("array is wrong length"); - } - const _this = this; - return value.map((v, i) => (_this.components[i].walk(v, process))); - } - return process(this.type, value); - } - #walkAsync(promises, value, process, setValue) { - if (this.isArray()) { - if (!Array.isArray(value)) { - throw new Error("invalid array value"); - } - if (this.arrayLength !== -1 && value.length !== this.arrayLength) { - throw new Error("array is wrong length"); - } - const childType = this.arrayChildren; - const result = value.slice(); - result.forEach((value, index) => { - childType.#walkAsync(promises, value, process, (value) => { - result[index] = value; - }); - }); - setValue(result); - return; - } - if (this.isTuple()) { - const components = this.components; - // Convert the object into an array - let result; - if (Array.isArray(value)) { - result = value.slice(); - } - else { - if (value == null || typeof (value) !== "object") { - throw new Error("invalid tuple value"); - } - result = components.map((param) => { - if (!param.name) { - throw new Error("cannot use object value with unnamed components"); - } - if (!(param.name in value)) { - throw new Error(`missing value for component ${param.name}`); - } - return value[param.name]; - }); - } - if (result.length !== this.components.length) { - throw new Error("array is wrong length"); - } - result.forEach((value, index) => { - components[index].#walkAsync(promises, value, process, (value) => { - result[index] = value; - }); - }); - setValue(result); - return; - } - const result = process(this.type, value); - if (result.then) { - promises.push((async function () { setValue(await result); })()); - } - else { - setValue(result); - } - } - /** - * Walks the **ParamType** with %%value%%, asynchronously calling - * %%process%% on each type, destructing the %%value%% recursively. - * - * This can be used to resolve ENS names by walking and resolving each - * ``"address"`` type. - */ - async walkAsync(value, process) { - const promises = []; - const result = [value]; - this.#walkAsync(promises, value, process, (value) => { - result[0] = value; - }); - if (promises.length) { - await Promise.all(promises); - } - return result[0]; - } - /** - * Creates a new **ParamType** for %%obj%%. - * - * If %%allowIndexed%% then the ``indexed`` keyword is permitted, - * otherwise the ``indexed`` keyword will throw an error. - */ - static from(obj, allowIndexed) { - if (ParamType.isParamType(obj)) { - return obj; - } - if (typeof (obj) === "string") { - try { - return ParamType.from(lex(obj), allowIndexed); - } - catch (error) { - assertArgument(false, "invalid param type", "obj", obj); - } - } - else if (obj instanceof TokenString) { - let type = "", baseType = ""; - let comps = null; - if (consumeKeywords(obj, setify(["tuple"])).has("tuple") || obj.peekType("OPEN_PAREN")) { - // Tuple - baseType = "tuple"; - comps = obj.popParams().map((t) => ParamType.from(t)); - type = `tuple(${comps.map((c) => c.format()).join(",")})`; - } - else { - // Normal - type = verifyBasicType(obj.popType("TYPE")); - baseType = type; - } - // Check for Array - let arrayChildren = null; - let arrayLength = null; - while (obj.length && obj.peekType("BRACKET")) { - const bracket = obj.pop(); //arrays[i]; - arrayChildren = new ParamType(_guard, "", type, baseType, null, comps, arrayLength, arrayChildren); - arrayLength = bracket.value; - type += bracket.text; - baseType = "array"; - comps = null; - } - let indexed = null; - const keywords = consumeKeywords(obj, KwModifiers); - if (keywords.has("indexed")) { - if (!allowIndexed) { - throw new Error(""); - } - indexed = true; - } - const name = (obj.peekType("ID") ? obj.pop().text : ""); - if (obj.length) { - throw new Error("leftover tokens"); - } - return new ParamType(_guard, name, type, baseType, indexed, comps, arrayLength, arrayChildren); - } - const name = obj.name; - assertArgument(!name || (typeof (name) === "string" && name.match(regexId)), "invalid name", "obj.name", name); - let indexed = obj.indexed; - if (indexed != null) { - assertArgument(allowIndexed, "parameter cannot be indexed", "obj.indexed", obj.indexed); - indexed = !!indexed; - } - let type = obj.type; - let arrayMatch = type.match(regexArrayType); - if (arrayMatch) { - const arrayLength = parseInt(arrayMatch[2] || "-1"); - const arrayChildren = ParamType.from({ - type: arrayMatch[1], - components: obj.components - }); - return new ParamType(_guard, name || "", type, "array", indexed, null, arrayLength, arrayChildren); - } - if (type === "tuple" || type.startsWith("tuple(" /* fix: ) */) || type.startsWith("(" /* fix: ) */)) { - const comps = (obj.components != null) ? obj.components.map((c) => ParamType.from(c)) : null; - const tuple = new ParamType(_guard, name || "", type, "tuple", indexed, comps, null, null); - // @TODO: use lexer to validate and normalize type - return tuple; - } - type = verifyBasicType(obj.type); - return new ParamType(_guard, name || "", type, type, indexed, null, null, null); - } - /** - * Returns true if %%value%% is a **ParamType**. - */ - static isParamType(value) { - return (value && value[internal] === ParamTypeInternal); - } -} -/** - * An abstract class to represent An individual fragment from a parse ABI. - */ -export class Fragment { - /** - * The type of the fragment. - */ - type; - /** - * The inputs for the fragment. - */ - inputs; - /** - * @private - */ - constructor(guard, type, inputs) { - assertPrivate(guard, _guard, "Fragment"); - inputs = Object.freeze(inputs.slice()); - defineProperties(this, { type, inputs }); - } - /** - * Creates a new **Fragment** for %%obj%%, wich can be any supported - * ABI frgament type. - */ - static from(obj) { - if (typeof (obj) === "string") { - // Try parsing JSON... - try { - Fragment.from(JSON.parse(obj)); - } - catch (e) { } - // ...otherwise, use the human-readable lexer - return Fragment.from(lex(obj)); - } - if (obj instanceof TokenString) { - // Human-readable ABI (already lexed) - const type = obj.peekKeyword(KwTypes); - switch (type) { - case "constructor": return ConstructorFragment.from(obj); - case "error": return ErrorFragment.from(obj); - case "event": return EventFragment.from(obj); - case "fallback": - case "receive": - return FallbackFragment.from(obj); - case "function": return FunctionFragment.from(obj); - case "struct": return StructFragment.from(obj); - } - } - else if (typeof (obj) === "object") { - // JSON ABI - switch (obj.type) { - case "constructor": return ConstructorFragment.from(obj); - case "error": return ErrorFragment.from(obj); - case "event": return EventFragment.from(obj); - case "fallback": - case "receive": - return FallbackFragment.from(obj); - case "function": return FunctionFragment.from(obj); - case "struct": return StructFragment.from(obj); - } - assert(false, `unsupported type: ${obj.type}`, "UNSUPPORTED_OPERATION", { - operation: "Fragment.from" - }); - } - assertArgument(false, "unsupported frgament object", "obj", obj); - } - /** - * Returns true if %%value%% is a [[ConstructorFragment]]. - */ - static isConstructor(value) { - return ConstructorFragment.isFragment(value); - } - /** - * Returns true if %%value%% is an [[ErrorFragment]]. - */ - static isError(value) { - return ErrorFragment.isFragment(value); - } - /** - * Returns true if %%value%% is an [[EventFragment]]. - */ - static isEvent(value) { - return EventFragment.isFragment(value); - } - /** - * Returns true if %%value%% is a [[FunctionFragment]]. - */ - static isFunction(value) { - return FunctionFragment.isFragment(value); - } - /** - * Returns true if %%value%% is a [[StructFragment]]. - */ - static isStruct(value) { - return StructFragment.isFragment(value); - } -} -/** - * An abstract class to represent An individual fragment - * which has a name from a parse ABI. - */ -export class NamedFragment extends Fragment { - /** - * The name of the fragment. - */ - name; - /** - * @private - */ - constructor(guard, type, name, inputs) { - super(guard, type, inputs); - assertArgument(typeof (name) === "string" && name.match(regexId), "invalid identifier", "name", name); - inputs = Object.freeze(inputs.slice()); - defineProperties(this, { name }); - } -} -function joinParams(format, params) { - return "(" + params.map((p) => p.format(format)).join((format === "full") ? ", " : ",") + ")"; -} -/** - * A Fragment which represents a //Custom Error//. - */ -export class ErrorFragment extends NamedFragment { - /** - * @private - */ - constructor(guard, name, inputs) { - super(guard, "error", name, inputs); - Object.defineProperty(this, internal, { value: ErrorFragmentInternal }); - } - /** - * The Custom Error selector. - */ - get selector() { - return id(this.format("sighash")).substring(0, 10); - } - /** - * Returns a string representation of this fragment as %%format%%. - */ - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - return JSON.stringify({ - type: "error", - name: this.name, - inputs: this.inputs.map((input) => JSON.parse(input.format(format))), - }); - } - const result = []; - if (format !== "sighash") { - result.push("error"); - } - result.push(this.name + joinParams(format, this.inputs)); - return result.join(" "); - } - /** - * Returns a new **ErrorFragment** for %%obj%%. - */ - static from(obj) { - if (ErrorFragment.isFragment(obj)) { - return obj; - } - if (typeof (obj) === "string") { - return ErrorFragment.from(lex(obj)); - } - else if (obj instanceof TokenString) { - const name = consumeName("error", obj); - const inputs = consumeParams(obj); - consumeEoi(obj); - return new ErrorFragment(_guard, name, inputs); - } - return new ErrorFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []); - } - /** - * Returns ``true`` and provides a type guard if %%value%% is an - * **ErrorFragment**. - */ - static isFragment(value) { - return (value && value[internal] === ErrorFragmentInternal); - } -} -/** - * A Fragment which represents an Event. - */ -export class EventFragment extends NamedFragment { - /** - * Whether this event is anonymous. - */ - anonymous; - /** - * @private - */ - constructor(guard, name, inputs, anonymous) { - super(guard, "event", name, inputs); - Object.defineProperty(this, internal, { value: EventFragmentInternal }); - defineProperties(this, { anonymous }); - } - /** - * The Event topic hash. - */ - get topicHash() { - return id(this.format("sighash")); - } - /** - * Returns a string representation of this event as %%format%%. - */ - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - return JSON.stringify({ - type: "event", - anonymous: this.anonymous, - name: this.name, - inputs: this.inputs.map((i) => JSON.parse(i.format(format))) - }); - } - const result = []; - if (format !== "sighash") { - result.push("event"); - } - result.push(this.name + joinParams(format, this.inputs)); - if (format !== "sighash" && this.anonymous) { - result.push("anonymous"); - } - return result.join(" "); - } - /** - * Return the topic hash for an event with %%name%% and %%params%%. - */ - static getTopicHash(name, params) { - params = (params || []).map((p) => ParamType.from(p)); - const fragment = new EventFragment(_guard, name, params, false); - return fragment.topicHash; - } - /** - * Returns a new **EventFragment** for %%obj%%. - */ - static from(obj) { - if (EventFragment.isFragment(obj)) { - return obj; - } - if (typeof (obj) === "string") { - try { - return EventFragment.from(lex(obj)); - } - catch (error) { - assertArgument(false, "invalid event fragment", "obj", obj); - } - } - else if (obj instanceof TokenString) { - const name = consumeName("event", obj); - const inputs = consumeParams(obj, true); - const anonymous = !!consumeKeywords(obj, setify(["anonymous"])).has("anonymous"); - consumeEoi(obj); - return new EventFragment(_guard, name, inputs, anonymous); - } - return new EventFragment(_guard, obj.name, obj.inputs ? obj.inputs.map((p) => ParamType.from(p, true)) : [], !!obj.anonymous); - } - /** - * Returns ``true`` and provides a type guard if %%value%% is an - * **EventFragment**. - */ - static isFragment(value) { - return (value && value[internal] === EventFragmentInternal); - } -} -/** - * A Fragment which represents a constructor. - */ -export class ConstructorFragment extends Fragment { - /** - * Whether the constructor can receive an endowment. - */ - payable; - /** - * The recommended gas limit for deployment or ``null``. - */ - gas; - /** - * @private - */ - constructor(guard, type, inputs, payable, gas) { - super(guard, type, inputs); - Object.defineProperty(this, internal, { value: ConstructorFragmentInternal }); - defineProperties(this, { payable, gas }); - } - /** - * Returns a string representation of this constructor as %%format%%. - */ - format(format) { - assert(format != null && format !== "sighash", "cannot format a constructor for sighash", "UNSUPPORTED_OPERATION", { operation: "format(sighash)" }); - if (format === "json") { - return JSON.stringify({ - type: "constructor", - stateMutability: (this.payable ? "payable" : "undefined"), - payable: this.payable, - gas: ((this.gas != null) ? this.gas : undefined), - inputs: this.inputs.map((i) => JSON.parse(i.format(format))) - }); - } - const result = [`constructor${joinParams(format, this.inputs)}`]; - if (this.payable) { - result.push("payable"); - } - if (this.gas != null) { - result.push(`@${this.gas.toString()}`); - } - return result.join(" "); - } - /** - * Returns a new **ConstructorFragment** for %%obj%%. - */ - static from(obj) { - if (ConstructorFragment.isFragment(obj)) { - return obj; - } - if (typeof (obj) === "string") { - try { - return ConstructorFragment.from(lex(obj)); - } - catch (error) { - assertArgument(false, "invalid constuctor fragment", "obj", obj); - } - } - else if (obj instanceof TokenString) { - consumeKeywords(obj, setify(["constructor"])); - const inputs = consumeParams(obj); - const payable = !!consumeKeywords(obj, KwVisibDeploy).has("payable"); - const gas = consumeGas(obj); - consumeEoi(obj); - return new ConstructorFragment(_guard, "constructor", inputs, payable, gas); - } - return new ConstructorFragment(_guard, "constructor", obj.inputs ? obj.inputs.map(ParamType.from) : [], !!obj.payable, (obj.gas != null) ? obj.gas : null); - } - /** - * Returns ``true`` and provides a type guard if %%value%% is a - * **ConstructorFragment**. - */ - static isFragment(value) { - return (value && value[internal] === ConstructorFragmentInternal); - } -} -/** - * A Fragment which represents a method. - */ -export class FallbackFragment extends Fragment { - /** - * If the function can be sent value during invocation. - */ - payable; - constructor(guard, inputs, payable) { - super(guard, "fallback", inputs); - Object.defineProperty(this, internal, { value: FallbackFragmentInternal }); - defineProperties(this, { payable }); - } - /** - * Returns a string representation of this fallback as %%format%%. - */ - format(format) { - const type = ((this.inputs.length === 0) ? "receive" : "fallback"); - if (format === "json") { - const stateMutability = (this.payable ? "payable" : "nonpayable"); - return JSON.stringify({ type, stateMutability }); - } - return `${type}()${this.payable ? " payable" : ""}`; - } - /** - * Returns a new **FallbackFragment** for %%obj%%. - */ - static from(obj) { - if (FallbackFragment.isFragment(obj)) { - return obj; - } - if (typeof (obj) === "string") { - try { - return FallbackFragment.from(lex(obj)); - } - catch (error) { - assertArgument(false, "invalid fallback fragment", "obj", obj); - } - } - else if (obj instanceof TokenString) { - const errorObj = obj.toString(); - const topIsValid = obj.peekKeyword(setify(["fallback", "receive"])); - assertArgument(topIsValid, "type must be fallback or receive", "obj", errorObj); - const type = obj.popKeyword(setify(["fallback", "receive"])); - // receive() - if (type === "receive") { - const inputs = consumeParams(obj); - assertArgument(inputs.length === 0, `receive cannot have arguments`, "obj.inputs", inputs); - consumeKeywords(obj, setify(["payable"])); - consumeEoi(obj); - return new FallbackFragment(_guard, [], true); - } - // fallback() [payable] - // fallback(bytes) [payable] returns (bytes) - let inputs = consumeParams(obj); - if (inputs.length) { - assertArgument(inputs.length === 1 && inputs[0].type === "bytes", "invalid fallback inputs", "obj.inputs", inputs.map((i) => i.format("minimal")).join(", ")); - } - else { - inputs = [ParamType.from("bytes")]; - } - const mutability = consumeMutability(obj); - assertArgument(mutability === "nonpayable" || mutability === "payable", "fallback cannot be constants", "obj.stateMutability", mutability); - if (consumeKeywords(obj, setify(["returns"])).has("returns")) { - const outputs = consumeParams(obj); - assertArgument(outputs.length === 1 && outputs[0].type === "bytes", "invalid fallback outputs", "obj.outputs", outputs.map((i) => i.format("minimal")).join(", ")); - } - consumeEoi(obj); - return new FallbackFragment(_guard, inputs, mutability === "payable"); - } - if (obj.type === "receive") { - return new FallbackFragment(_guard, [], true); - } - if (obj.type === "fallback") { - const inputs = [ParamType.from("bytes")]; - const payable = (obj.stateMutability === "payable"); - return new FallbackFragment(_guard, inputs, payable); - } - assertArgument(false, "invalid fallback description", "obj", obj); - } - /** - * Returns ``true`` and provides a type guard if %%value%% is a - * **FallbackFragment**. - */ - static isFragment(value) { - return (value && value[internal] === FallbackFragmentInternal); - } -} -/** - * A Fragment which represents a method. - */ -export class FunctionFragment extends NamedFragment { - /** - * If the function is constant (e.g. ``pure`` or ``view`` functions). - */ - constant; - /** - * The returned types for the result of calling this function. - */ - outputs; - /** - * The state mutability (e.g. ``payable``, ``nonpayable``, ``view`` - * or ``pure``) - */ - stateMutability; - /** - * If the function can be sent value during invocation. - */ - payable; - /** - * The recommended gas limit to send when calling this function. - */ - gas; - /** - * @private - */ - constructor(guard, name, stateMutability, inputs, outputs, gas) { - super(guard, "function", name, inputs); - Object.defineProperty(this, internal, { value: FunctionFragmentInternal }); - outputs = Object.freeze(outputs.slice()); - const constant = (stateMutability === "view" || stateMutability === "pure"); - const payable = (stateMutability === "payable"); - defineProperties(this, { constant, gas, outputs, payable, stateMutability }); - } - /** - * The Function selector. - */ - get selector() { - return id(this.format("sighash")).substring(0, 10); - } - /** - * Returns a string representation of this function as %%format%%. - */ - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - return JSON.stringify({ - type: "function", - name: this.name, - constant: this.constant, - stateMutability: ((this.stateMutability !== "nonpayable") ? this.stateMutability : undefined), - payable: this.payable, - gas: ((this.gas != null) ? this.gas : undefined), - inputs: this.inputs.map((i) => JSON.parse(i.format(format))), - outputs: this.outputs.map((o) => JSON.parse(o.format(format))), - }); - } - const result = []; - if (format !== "sighash") { - result.push("function"); - } - result.push(this.name + joinParams(format, this.inputs)); - if (format !== "sighash") { - if (this.stateMutability !== "nonpayable") { - result.push(this.stateMutability); - } - if (this.outputs && this.outputs.length) { - result.push("returns"); - result.push(joinParams(format, this.outputs)); - } - if (this.gas != null) { - result.push(`@${this.gas.toString()}`); - } - } - return result.join(" "); - } - /** - * Return the selector for a function with %%name%% and %%params%%. - */ - static getSelector(name, params) { - params = (params || []).map((p) => ParamType.from(p)); - const fragment = new FunctionFragment(_guard, name, "view", params, [], null); - return fragment.selector; - } - /** - * Returns a new **FunctionFragment** for %%obj%%. - */ - static from(obj) { - if (FunctionFragment.isFragment(obj)) { - return obj; - } - if (typeof (obj) === "string") { - try { - return FunctionFragment.from(lex(obj)); - } - catch (error) { - assertArgument(false, "invalid function fragment", "obj", obj); - } - } - else if (obj instanceof TokenString) { - const name = consumeName("function", obj); - const inputs = consumeParams(obj); - const mutability = consumeMutability(obj); - let outputs = []; - if (consumeKeywords(obj, setify(["returns"])).has("returns")) { - outputs = consumeParams(obj); - } - const gas = consumeGas(obj); - consumeEoi(obj); - return new FunctionFragment(_guard, name, mutability, inputs, outputs, gas); - } - let stateMutability = obj.stateMutability; - // Use legacy Solidity ABI logic if stateMutability is missing - if (stateMutability == null) { - stateMutability = "payable"; - if (typeof (obj.constant) === "boolean") { - stateMutability = "view"; - if (!obj.constant) { - stateMutability = "payable"; - if (typeof (obj.payable) === "boolean" && !obj.payable) { - stateMutability = "nonpayable"; - } - } - } - else if (typeof (obj.payable) === "boolean" && !obj.payable) { - stateMutability = "nonpayable"; - } - } - // @TODO: verifyState for stateMutability (e.g. throw if - // payable: false but stateMutability is "nonpayable") - return new FunctionFragment(_guard, obj.name, stateMutability, obj.inputs ? obj.inputs.map(ParamType.from) : [], obj.outputs ? obj.outputs.map(ParamType.from) : [], (obj.gas != null) ? obj.gas : null); - } - /** - * Returns ``true`` and provides a type guard if %%value%% is a - * **FunctionFragment**. - */ - static isFragment(value) { - return (value && value[internal] === FunctionFragmentInternal); - } -} -/** - * A Fragment which represents a structure. - */ -export class StructFragment extends NamedFragment { - /** - * @private - */ - constructor(guard, name, inputs) { - super(guard, "struct", name, inputs); - Object.defineProperty(this, internal, { value: StructFragmentInternal }); - } - /** - * Returns a string representation of this struct as %%format%%. - */ - format() { - throw new Error("@TODO"); - } - /** - * Returns a new **StructFragment** for %%obj%%. - */ - static from(obj) { - if (typeof (obj) === "string") { - try { - return StructFragment.from(lex(obj)); - } - catch (error) { - assertArgument(false, "invalid struct fragment", "obj", obj); - } - } - else if (obj instanceof TokenString) { - const name = consumeName("struct", obj); - const inputs = consumeParams(obj); - consumeEoi(obj); - return new StructFragment(_guard, name, inputs); - } - return new StructFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []); - } - // @TODO: fix this return type - /** - * Returns ``true`` and provides a type guard if %%value%% is a - * **StructFragment**. - */ - static isFragment(value) { - return (value && value[internal] === StructFragmentInternal); - } -} -//# sourceMappingURL=fragments.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/fragments.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/fragments.js.map deleted file mode 100644 index 8e68fdd4..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/fragments.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fragments.js","sourceRoot":"","sources":["../../src.ts/abi/fragments.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACH,gBAAgB,EAAE,SAAS,EAAE,SAAS,EACtC,MAAM,EAAE,aAAa,EAAE,cAAc,EACxC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAgFrC,CAAC;AAoBF,qCAAqC;AACrC,SAAS,MAAM,CAAC,KAAoB;IAChC,MAAM,MAAM,GAAgB,IAAI,GAAG,EAAE,CAAC;IACtC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACpC,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,cAAc,GAAG,kCAAkC,CAAC;AAC1D,MAAM,aAAa,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AAExD,sBAAsB;AACtB,MAAM,QAAQ,GAAG,sEAAsE,CAAC;AACxF,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AAE5C,MAAM,QAAQ,GAAG,0DAA0D,CAAC;AAC5E,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AAE5C,MAAM,YAAY,GAAG,yCAAyC,CAAC;AAC/D,MAAM,WAAW,GAAG,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AAEpD,MAAM,QA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M,CAAC,UAAU,CAAC,KAAU;QACxB,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,sBAAsB,CAAC,CAAC;IACjE,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/index.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/index.d.ts deleted file mode 100644 index 2bf39932..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/index.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * The Application Binary Interface (ABI) describes how method input - * parameters should be encoded, their results decoded, and how to - * decode events and errors. - * - * See [About ABIs](docs-abi) for more details how they are used. - * - * @_section api/abi:Application Binary Interface [about-abi] - * @_navTitle: ABI - */ -export { AbiCoder } from "./abi-coder.js"; -export { decodeBytes32String, encodeBytes32String } from "./bytes32.js"; -export { ConstructorFragment, ErrorFragment, EventFragment, FallbackFragment, Fragment, FunctionFragment, NamedFragment, ParamType, StructFragment, } from "./fragments.js"; -export { checkResultErrors, Indexed, Interface, ErrorDescription, LogDescription, TransactionDescription, Result } from "./interface.js"; -export { Typed } from "./typed.js"; -export type { JsonFragment, JsonFragmentType, FormatType, FragmentType, ParamTypeWalkAsyncFunc, ParamTypeWalkFunc } from "./fragments.js"; -export type { InterfaceAbi, } from "./interface.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/index.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/index.d.ts.map deleted file mode 100644 index 0d99c19b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/abi/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,EACH,mBAAmB,EAAE,aAAa,EAAE,aAAa,EAAE,gBAAgB,EACnE,QAAQ,EAAE,gBAAgB,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,GACvE,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACH,iBAAiB,EACjB,OAAO,EACP,SAAS,EACT,gBAAgB,EAAE,cAAc,EAAE,sBAAsB,EACxD,MAAM,EACT,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,YAAY,EACR,YAAY,EAAE,gBAAgB,EAC9B,UAAU,EAAE,YAAY,EAAE,sBAAsB,EAAE,iBAAiB,EACtE,MAAM,gBAAgB,CAAC;AAExB,YAAY,EACR,YAAY,GACf,MAAM,gBAAgB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/index.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/index.js deleted file mode 100644 index 312d4d10..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/index.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * The Application Binary Interface (ABI) describes how method input - * parameters should be encoded, their results decoded, and how to - * decode events and errors. - * - * See [About ABIs](docs-abi) for more details how they are used. - * - * @_section api/abi:Application Binary Interface [about-abi] - * @_navTitle: ABI - */ -////// -export { AbiCoder } from "./abi-coder.js"; -export { decodeBytes32String, encodeBytes32String } from "./bytes32.js"; -export { ConstructorFragment, ErrorFragment, EventFragment, FallbackFragment, Fragment, FunctionFragment, NamedFragment, ParamType, StructFragment, } from "./fragments.js"; -export { checkResultErrors, Indexed, Interface, ErrorDescription, LogDescription, TransactionDescription, Result } from "./interface.js"; -export { Typed } from "./typed.js"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/index.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/index.js.map deleted file mode 100644 index e4533c50..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/abi/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,MAAM;AACN,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,EACH,mBAAmB,EAAE,aAAa,EAAE,aAAa,EAAE,gBAAgB,EACnE,QAAQ,EAAE,gBAAgB,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,GACvE,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACH,iBAAiB,EACjB,OAAO,EACP,SAAS,EACT,gBAAgB,EAAE,cAAc,EAAE,sBAAsB,EACxD,MAAM,EACT,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/interface.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/interface.d.ts deleted file mode 100644 index afa4ebb2..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/interface.d.ts +++ /dev/null @@ -1,382 +0,0 @@ -/** - * The Interface class is a low-level class that accepts an - * ABI and provides all the necessary functionality to encode - * and decode paramaters to and results from methods, events - * and errors. - * - * It also provides several convenience methods to automatically - * search and find matching transactions and events to parse them. - * - * @_subsection api/abi:Interfaces [interfaces] - */ -import { AbiCoder } from "./abi-coder.js"; -import { checkResultErrors, Result } from "./coders/abstract-coder.js"; -import { ConstructorFragment, ErrorFragment, EventFragment, FallbackFragment, Fragment, FunctionFragment, ParamType } from "./fragments.js"; -import { Typed } from "./typed.js"; -import type { BigNumberish, BytesLike, CallExceptionError, CallExceptionTransaction } from "../utils/index.js"; -import type { JsonFragment } from "./fragments.js"; -export { checkResultErrors, Result }; -/** - * When using the [[Interface-parseLog]] to automatically match a Log to its event - * for parsing, a **LogDescription** is returned. - */ -export declare class LogDescription { - /** - * The matching fragment for the ``topic0``. - */ - readonly fragment: EventFragment; - /** - * The name of the Event. - */ - readonly name: string; - /** - * The full Event signature. - */ - readonly signature: string; - /** - * The topic hash for the Event. - */ - readonly topic: string; - /** - * The arguments passed into the Event with ``emit``. - */ - readonly args: Result; - /** - * @_ignore: - */ - constructor(fragment: EventFragment, topic: string, args: Result); -} -/** - * When using the [[Interface-parseTransaction]] to automatically match - * a transaction data to its function for parsing, - * a **TransactionDescription** is returned. - */ -export declare class TransactionDescription { - /** - * The matching fragment from the transaction ``data``. - */ - readonly fragment: FunctionFragment; - /** - * The name of the Function from the transaction ``data``. - */ - readonly name: string; - /** - * The arguments passed to the Function from the transaction ``data``. - */ - readonly args: Result; - /** - * The full Function signature from the transaction ``data``. - */ - readonly signature: string; - /** - * The selector for the Function from the transaction ``data``. - */ - readonly selector: string; - /** - * The ``value`` (in wei) from the transaction. - */ - readonly value: bigint; - /** - * @_ignore: - */ - constructor(fragment: FunctionFragment, selector: string, args: Result, value: bigint); -} -/** - * When using the [[Interface-parseError]] to automatically match an - * error for a call result for parsing, an **ErrorDescription** is returned. - */ -export declare class ErrorDescription { - /** - * The matching fragment. - */ - readonly fragment: ErrorFragment; - /** - * The name of the Error. - */ - readonly name: string; - /** - * The arguments passed to the Error with ``revert``. - */ - readonly args: Result; - /** - * The full Error signature. - */ - readonly signature: string; - /** - * The selector for the Error. - */ - readonly selector: string; - /** - * @_ignore: - */ - constructor(fragment: ErrorFragment, selector: string, args: Result); -} -/** - * An **Indexed** is used as a value when a value that does not - * fit within a topic (i.e. not a fixed-length, 32-byte type). It - * is the ``keccak256`` of the value, and used for types such as - * arrays, tuples, bytes and strings. - */ -export declare class Indexed { - /** - * The ``keccak256`` of the value logged. - */ - readonly hash: null | string; - /** - * @_ignore: - */ - readonly _isIndexed: boolean; - /** - * Returns ``true`` if %%value%% is an **Indexed**. - * - * This provides a Type Guard for property access. - */ - static isIndexed(value: any): value is Indexed; - /** - * @_ignore: - */ - constructor(hash: null | string); -} -/** - * An **InterfaceAbi** may be any supported ABI format. - * - * A string is expected to be a JSON string, which will be parsed - * using ``JSON.parse``. This means that the value **must** be a valid - * JSON string, with no stray commas, etc. - * - * An array may contain any combination of: - * - Human-Readable fragments - * - Parsed JSON fragment - * - [[Fragment]] instances - * - * A **Human-Readable Fragment** is a string which resembles a Solidity - * signature and is introduced in [this blog entry](link-ricmoo-humanreadableabi). - * For example, ``function balanceOf(address) view returns (uint)``. - * - * A **Parsed JSON Fragment** is a JavaScript Object desribed in the - * [Solidity documentation](link-solc-jsonabi). - */ -export type InterfaceAbi = string | ReadonlyArray; -/** - * An Interface abstracts many of the low-level details for - * encoding and decoding the data on the blockchain. - * - * An ABI provides information on how to encode data to send to - * a Contract, how to decode the results and events and how to - * interpret revert errors. - * - * The ABI can be specified by [any supported format](InterfaceAbi). - */ -export declare class Interface { - #private; - /** - * All the Contract ABI members (i.e. methods, events, errors, etc). - */ - readonly fragments: ReadonlyArray; - /** - * The Contract constructor. - */ - readonly deploy: ConstructorFragment; - /** - * The Fallback method, if any. - */ - readonly fallback: null | FallbackFragment; - /** - * If receiving ether is supported. - */ - readonly receive: boolean; - /** - * Create a new Interface for the %%fragments%%. - */ - constructor(fragments: InterfaceAbi); - /** - * Returns the entire Human-Readable ABI, as an array of - * signatures, optionally as %%minimal%% strings, which - * removes parameter names and unneceesary spaces. - */ - format(minimal?: boolean): Array; - /** - * Return the JSON-encoded ABI. This is the format Solidiy - * returns. - */ - formatJson(): string; - /** - * The ABI coder that will be used to encode and decode binary - * data. - */ - getAbiCoder(): AbiCoder; - /** - * Get the function name for %%key%%, which may be a function selector, - * function name or function signature that belongs to the ABI. - */ - getFunctionName(key: string): string; - /** - * Returns true if %%key%% (a function selector, function name or - * function signature) is present in the ABI. - * - * In the case of a function name, the name may be ambiguous, so - * accessing the [[FunctionFragment]] may require refinement. - */ - hasFunction(key: string): boolean; - /** - * Get the [[FunctionFragment]] for %%key%%, which may be a function - * selector, function name or function signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple functions match by name. - * - * If the %%key%% and %%values%% do not refine to a single function in - * the ABI, this will throw. - */ - getFunction(key: string, values?: Array): null | FunctionFragment; - /** - * Iterate over all functions, calling %%callback%%, sorted by their name. - */ - forEachFunction(callback: (func: FunctionFragment, index: number) => void): void; - /** - * Get the event name for %%key%%, which may be a topic hash, - * event name or event signature that belongs to the ABI. - */ - getEventName(key: string): string; - /** - * Returns true if %%key%% (an event topic hash, event name or - * event signature) is present in the ABI. - * - * In the case of an event name, the name may be ambiguous, so - * accessing the [[EventFragment]] may require refinement. - */ - hasEvent(key: string): boolean; - /** - * Get the [[EventFragment]] for %%key%%, which may be a topic hash, - * event name or event signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple events match by name. - * - * If the %%key%% and %%values%% do not refine to a single event in - * the ABI, this will throw. - */ - getEvent(key: string, values?: Array): null | EventFragment; - /** - * Iterate over all events, calling %%callback%%, sorted by their name. - */ - forEachEvent(callback: (func: EventFragment, index: number) => void): void; - /** - * Get the [[ErrorFragment]] for %%key%%, which may be an error - * selector, error name or error signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple errors match by name. - * - * If the %%key%% and %%values%% do not refine to a single error in - * the ABI, this will throw. - */ - getError(key: string, values?: Array): null | ErrorFragment; - /** - * Iterate over all errors, calling %%callback%%, sorted by their name. - */ - forEachError(callback: (func: ErrorFragment, index: number) => void): void; - _decodeParams(params: ReadonlyArray, data: BytesLike): Result; - _encodeParams(params: ReadonlyArray, values: ReadonlyArray): string; - /** - * Encodes a ``tx.data`` object for deploying the Contract with - * the %%values%% as the constructor arguments. - */ - encodeDeploy(values?: ReadonlyArray): string; - /** - * Decodes the result %%data%% (e.g. from an ``eth_call``) for the - * specified error (see [[getError]] for valid values for - * %%key%%). - * - * Most developers should prefer the [[parseCallResult]] method instead, - * which will automatically detect a ``CALL_EXCEPTION`` and throw the - * corresponding error. - */ - decodeErrorResult(fragment: ErrorFragment | string, data: BytesLike): Result; - /** - * Encodes the transaction revert data for a call result that - * reverted from the the Contract with the sepcified %%error%% - * (see [[getError]] for valid values for %%fragment%%) with the %%values%%. - * - * This is generally not used by most developers, unless trying to mock - * a result from a Contract. - */ - encodeErrorResult(fragment: ErrorFragment | string, values?: ReadonlyArray): string; - /** - * Decodes the %%data%% from a transaction ``tx.data`` for - * the function specified (see [[getFunction]] for valid values - * for %%fragment%%). - * - * Most developers should prefer the [[parseTransaction]] method - * instead, which will automatically detect the fragment. - */ - decodeFunctionData(fragment: FunctionFragment | string, data: BytesLike): Result; - /** - * Encodes the ``tx.data`` for a transaction that calls the function - * specified (see [[getFunction]] for valid values for %%fragment%%) with - * the %%values%%. - */ - encodeFunctionData(fragment: FunctionFragment | string, values?: ReadonlyArray): string; - /** - * Decodes the result %%data%% (e.g. from an ``eth_call``) for the - * specified function (see [[getFunction]] for valid values for - * %%key%%). - * - * Most developers should prefer the [[parseCallResult]] method instead, - * which will automatically detect a ``CALL_EXCEPTION`` and throw the - * corresponding error. - */ - decodeFunctionResult(fragment: FunctionFragment | string, data: BytesLike): Result; - makeError(_data: BytesLike, tx: CallExceptionTransaction): CallExceptionError; - /** - * Encodes the result data (e.g. from an ``eth_call``) for the - * specified function (see [[getFunction]] for valid values - * for %%fragment%%) with %%values%%. - * - * This is generally not used by most developers, unless trying to mock - * a result from a Contract. - */ - encodeFunctionResult(fragment: FunctionFragment | string, values?: ReadonlyArray): string; - encodeFilterTopics(fragment: EventFragment | string, values: ReadonlyArray): Array>; - encodeEventLog(fragment: EventFragment | string, values: ReadonlyArray): { - data: string; - topics: Array; - }; - decodeEventLog(fragment: EventFragment | string, data: BytesLike, topics?: ReadonlyArray): Result; - /** - * Parses a transaction, finding the matching function and extracts - * the parameter values along with other useful function details. - * - * If the matching function cannot be found, return null. - */ - parseTransaction(tx: { - data: string; - value?: BigNumberish; - }): null | TransactionDescription; - parseCallResult(data: BytesLike): Result; - /** - * Parses a receipt log, finding the matching event and extracts - * the parameter values along with other useful event details. - * - * If the matching event cannot be found, returns null. - */ - parseLog(log: { - topics: ReadonlyArray; - data: string; - }): null | LogDescription; - /** - * Parses a revert data, finding the matching error and extracts - * the parameter values along with other useful error details. - * - * If the matching error cannot be found, returns null. - */ - parseError(data: BytesLike): null | ErrorDescription; - /** - * Creates a new [[Interface]] from the ABI %%value%%. - * - * The %%value%% may be provided as an existing [[Interface]] object, - * a JSON-encoded ABI or any Human-Readable ABI format. - */ - static from(value: InterfaceAbi | Interface): Interface; -} -//# sourceMappingURL=interface.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/interface.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/interface.d.ts.map deleted file mode 100644 index d9367c1a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/interface.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src.ts/abi/interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAUH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EACH,mBAAmB,EAAE,aAAa,EAAE,aAAa,EAAE,gBAAgB,EACnE,QAAQ,EAAE,gBAAgB,EAAE,SAAS,EACxC,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAE/G,OAAO,KAAK,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C,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,MAAM;IAuEzG;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,YAAY,CAAA;KAAE,GAAG,IAAI,GAAG,sBAAsB;IAY3F,eAAe,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM;IAIxC;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE;QAAE,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,GAAG,IAAI,GAAG,cAAc;IAapF;;;;;OAKG;IACH,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,GAAG,gBAAgB;IAWpD;;;;;OAKG;IACH,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,GAAG,SAAS;CAoB1D"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/interface.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/interface.js deleted file mode 100644 index 81705b37..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/interface.js +++ /dev/null @@ -1,1101 +0,0 @@ -/** - * The Interface class is a low-level class that accepts an - * ABI and provides all the necessary functionality to encode - * and decode paramaters to and results from methods, events - * and errors. - * - * It also provides several convenience methods to automatically - * search and find matching transactions and events to parse them. - * - * @_subsection api/abi:Interfaces [interfaces] - */ -import { keccak256 } from "../crypto/index.js"; -import { id } from "../hash/index.js"; -import { concat, dataSlice, getBigInt, getBytes, getBytesCopy, hexlify, zeroPadBytes, zeroPadValue, isHexString, defineProperties, assertArgument, toBeHex, assert } from "../utils/index.js"; -import { AbiCoder } from "./abi-coder.js"; -import { checkResultErrors, Result } from "./coders/abstract-coder.js"; -import { ConstructorFragment, ErrorFragment, EventFragment, Fragment, FunctionFragment, ParamType } from "./fragments.js"; -import { Typed } from "./typed.js"; -export { checkResultErrors, Result }; -/** - * When using the [[Interface-parseLog]] to automatically match a Log to its event - * for parsing, a **LogDescription** is returned. - */ -export class LogDescription { - /** - * The matching fragment for the ``topic0``. - */ - fragment; - /** - * The name of the Event. - */ - name; - /** - * The full Event signature. - */ - signature; - /** - * The topic hash for the Event. - */ - topic; - /** - * The arguments passed into the Event with ``emit``. - */ - args; - /** - * @_ignore: - */ - constructor(fragment, topic, args) { - const name = fragment.name, signature = fragment.format(); - defineProperties(this, { - fragment, name, signature, topic, args - }); - } -} -/** - * When using the [[Interface-parseTransaction]] to automatically match - * a transaction data to its function for parsing, - * a **TransactionDescription** is returned. - */ -export class TransactionDescription { - /** - * The matching fragment from the transaction ``data``. - */ - fragment; - /** - * The name of the Function from the transaction ``data``. - */ - name; - /** - * The arguments passed to the Function from the transaction ``data``. - */ - args; - /** - * The full Function signature from the transaction ``data``. - */ - signature; - /** - * The selector for the Function from the transaction ``data``. - */ - selector; - /** - * The ``value`` (in wei) from the transaction. - */ - value; - /** - * @_ignore: - */ - constructor(fragment, selector, args, value) { - const name = fragment.name, signature = fragment.format(); - defineProperties(this, { - fragment, name, args, signature, selector, value - }); - } -} -/** - * When using the [[Interface-parseError]] to automatically match an - * error for a call result for parsing, an **ErrorDescription** is returned. - */ -export class ErrorDescription { - /** - * The matching fragment. - */ - fragment; - /** - * The name of the Error. - */ - name; - /** - * The arguments passed to the Error with ``revert``. - */ - args; - /** - * The full Error signature. - */ - signature; - /** - * The selector for the Error. - */ - selector; - /** - * @_ignore: - */ - constructor(fragment, selector, args) { - const name = fragment.name, signature = fragment.format(); - defineProperties(this, { - fragment, name, args, signature, selector - }); - } -} -/** - * An **Indexed** is used as a value when a value that does not - * fit within a topic (i.e. not a fixed-length, 32-byte type). It - * is the ``keccak256`` of the value, and used for types such as - * arrays, tuples, bytes and strings. - */ -export class Indexed { - /** - * The ``keccak256`` of the value logged. - */ - hash; - /** - * @_ignore: - */ - _isIndexed; - /** - * Returns ``true`` if %%value%% is an **Indexed**. - * - * This provides a Type Guard for property access. - */ - static isIndexed(value) { - return !!(value && value._isIndexed); - } - /** - * @_ignore: - */ - constructor(hash) { - defineProperties(this, { hash, _isIndexed: true }); - } -} -// https://docs.soliditylang.org/en/v0.8.13/control-structures.html?highlight=panic#panic-via-assert-and-error-via-require -const PanicReasons = { - "0": "generic panic", - "1": "assert(false)", - "17": "arithmetic overflow", - "18": "division or modulo by zero", - "33": "enum overflow", - "34": "invalid encoded storage byte array accessed", - "49": "out-of-bounds array access; popping on an empty array", - "50": "out-of-bounds access of an array or bytesN", - "65": "out of memory", - "81": "uninitialized function", -}; -const BuiltinErrors = { - "0x08c379a0": { - signature: "Error(string)", - name: "Error", - inputs: ["string"], - reason: (message) => { - return `reverted with reason string ${JSON.stringify(message)}`; - } - }, - "0x4e487b71": { - signature: "Panic(uint256)", - name: "Panic", - inputs: ["uint256"], - reason: (code) => { - let reason = "unknown panic code"; - if (code >= 0 && code <= 0xff && PanicReasons[code.toString()]) { - reason = PanicReasons[code.toString()]; - } - return `reverted with panic code 0x${code.toString(16)} (${reason})`; - } - } -}; -/** - * An Interface abstracts many of the low-level details for - * encoding and decoding the data on the blockchain. - * - * An ABI provides information on how to encode data to send to - * a Contract, how to decode the results and events and how to - * interpret revert errors. - * - * The ABI can be specified by [any supported format](InterfaceAbi). - */ -export class Interface { - /** - * All the Contract ABI members (i.e. methods, events, errors, etc). - */ - fragments; - /** - * The Contract constructor. - */ - deploy; - /** - * The Fallback method, if any. - */ - fallback; - /** - * If receiving ether is supported. - */ - receive; - #errors; - #events; - #functions; - // #structs: Map; - #abiCoder; - /** - * Create a new Interface for the %%fragments%%. - */ - constructor(fragments) { - let abi = []; - if (typeof (fragments) === "string") { - abi = JSON.parse(fragments); - } - else { - abi = fragments; - } - this.#functions = new Map(); - this.#errors = new Map(); - this.#events = new Map(); - // this.#structs = new Map(); - const frags = []; - for (const a of abi) { - try { - frags.push(Fragment.from(a)); - } - catch (error) { - console.log(`[Warning] Invalid Fragment ${JSON.stringify(a)}:`, error.message); - } - } - defineProperties(this, { - fragments: Object.freeze(frags) - }); - let fallback = null; - let receive = false; - this.#abiCoder = this.getAbiCoder(); - // Add all fragments by their signature - this.fragments.forEach((fragment, index) => { - let bucket; - switch (fragment.type) { - case "constructor": - if (this.deploy) { - console.log("duplicate definition - constructor"); - return; - } - //checkNames(fragment, "input", fragment.inputs); - defineProperties(this, { deploy: fragment }); - return; - case "fallback": - if (fragment.inputs.length === 0) { - receive = true; - } - else { - assertArgument(!fallback || fragment.payable !== fallback.payable, "conflicting fallback fragments", `fragments[${index}]`, fragment); - fallback = fragment; - receive = fallback.payable; - } - return; - case "function": - //checkNames(fragment, "input", fragment.inputs); - //checkNames(fragment, "output", (fragment).outputs); - bucket = this.#functions; - break; - case "event": - //checkNames(fragment, "input", fragment.inputs); - bucket = this.#events; - break; - case "error": - bucket = this.#errors; - break; - default: - return; - } - // Two identical entries; ignore it - const signature = fragment.format(); - if (bucket.has(signature)) { - return; - } - bucket.set(signature, fragment); - }); - // If we do not have a constructor add a default - if (!this.deploy) { - defineProperties(this, { - deploy: ConstructorFragment.from("constructor()") - }); - } - defineProperties(this, { fallback, receive }); - } - /** - * Returns the entire Human-Readable ABI, as an array of - * signatures, optionally as %%minimal%% strings, which - * removes parameter names and unneceesary spaces. - */ - format(minimal) { - const format = (minimal ? "minimal" : "full"); - const abi = this.fragments.map((f) => f.format(format)); - return abi; - } - /** - * Return the JSON-encoded ABI. This is the format Solidiy - * returns. - */ - formatJson() { - const abi = this.fragments.map((f) => f.format("json")); - // We need to re-bundle the JSON fragments a bit - return JSON.stringify(abi.map((j) => JSON.parse(j))); - } - /** - * The ABI coder that will be used to encode and decode binary - * data. - */ - getAbiCoder() { - return AbiCoder.defaultAbiCoder(); - } - // Find a function definition by any means necessary (unless it is ambiguous) - #getFunction(key, values, forceUnique) { - // Selector - if (isHexString(key)) { - const selector = key.toLowerCase(); - for (const fragment of this.#functions.values()) { - if (selector === fragment.selector) { - return fragment; - } - } - return null; - } - // It is a bare name, look up the function (will return null if ambiguous) - if (key.indexOf("(") === -1) { - const matching = []; - for (const [name, fragment] of this.#functions) { - if (name.split("(" /* fix:) */)[0] === key) { - matching.push(fragment); - } - } - if (values) { - const lastValue = (values.length > 0) ? values[values.length - 1] : null; - let valueLength = values.length; - let allowOptions = true; - if (Typed.isTyped(lastValue) && lastValue.type === "overrides") { - allowOptions = false; - valueLength--; - } - // Remove all matches that don't have a compatible length. The args - // may contain an overrides, so the match may have n or n - 1 parameters - for (let i = matching.length - 1; i >= 0; i--) { - const inputs = matching[i].inputs.length; - if (inputs !== valueLength && (!allowOptions || inputs !== valueLength - 1)) { - matching.splice(i, 1); - } - } - // Remove all matches that don't match the Typed signature - for (let i = matching.length - 1; i >= 0; i--) { - const inputs = matching[i].inputs; - for (let j = 0; j < values.length; j++) { - // Not a typed value - if (!Typed.isTyped(values[j])) { - continue; - } - // We are past the inputs - if (j >= inputs.length) { - if (values[j].type === "overrides") { - continue; - } - matching.splice(i, 1); - break; - } - // Make sure the value type matches the input type - if (values[j].type !== inputs[j].baseType) { - matching.splice(i, 1); - break; - } - } - } - } - // We found a single matching signature with an overrides, but the - // last value is something that cannot possibly be an options - if (matching.length === 1 && values && values.length !== matching[0].inputs.length) { - const lastArg = values[values.length - 1]; - if (lastArg == null || Array.isArray(lastArg) || typeof (lastArg) !== "object") { - matching.splice(0, 1); - } - } - if (matching.length === 0) { - return null; - } - if (matching.length > 1 && forceUnique) { - const matchStr = matching.map((m) => JSON.stringify(m.format())).join(", "); - assertArgument(false, `ambiguous function description (i.e. matches ${matchStr})`, "key", key); - } - return matching[0]; - } - // Normalize the signature and lookup the function - const result = this.#functions.get(FunctionFragment.from(key).format()); - if (result) { - return result; - } - return null; - } - /** - * Get the function name for %%key%%, which may be a function selector, - * function name or function signature that belongs to the ABI. - */ - getFunctionName(key) { - const fragment = this.#getFunction(key, null, false); - assertArgument(fragment, "no matching function", "key", key); - return fragment.name; - } - /** - * Returns true if %%key%% (a function selector, function name or - * function signature) is present in the ABI. - * - * In the case of a function name, the name may be ambiguous, so - * accessing the [[FunctionFragment]] may require refinement. - */ - hasFunction(key) { - return !!this.#getFunction(key, null, false); - } - /** - * Get the [[FunctionFragment]] for %%key%%, which may be a function - * selector, function name or function signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple functions match by name. - * - * If the %%key%% and %%values%% do not refine to a single function in - * the ABI, this will throw. - */ - getFunction(key, values) { - return this.#getFunction(key, values || null, true); - } - /** - * Iterate over all functions, calling %%callback%%, sorted by their name. - */ - forEachFunction(callback) { - const names = Array.from(this.#functions.keys()); - names.sort((a, b) => a.localeCompare(b)); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - callback((this.#functions.get(name)), i); - } - } - // Find an event definition by any means necessary (unless it is ambiguous) - #getEvent(key, values, forceUnique) { - // EventTopic - if (isHexString(key)) { - const eventTopic = key.toLowerCase(); - for (const fragment of this.#events.values()) { - if (eventTopic === fragment.topicHash) { - return fragment; - } - } - return null; - } - // It is a bare name, look up the function (will return null if ambiguous) - if (key.indexOf("(") === -1) { - const matching = []; - for (const [name, fragment] of this.#events) { - if (name.split("(" /* fix:) */)[0] === key) { - matching.push(fragment); - } - } - if (values) { - // Remove all matches that don't have a compatible length. - for (let i = matching.length - 1; i >= 0; i--) { - if (matching[i].inputs.length < values.length) { - matching.splice(i, 1); - } - } - // Remove all matches that don't match the Typed signature - for (let i = matching.length - 1; i >= 0; i--) { - const inputs = matching[i].inputs; - for (let j = 0; j < values.length; j++) { - // Not a typed value - if (!Typed.isTyped(values[j])) { - continue; - } - // Make sure the value type matches the input type - if (values[j].type !== inputs[j].baseType) { - matching.splice(i, 1); - break; - } - } - } - } - if (matching.length === 0) { - return null; - } - if (matching.length > 1 && forceUnique) { - const matchStr = matching.map((m) => JSON.stringify(m.format())).join(", "); - assertArgument(false, `ambiguous event description (i.e. matches ${matchStr})`, "key", key); - } - return matching[0]; - } - // Normalize the signature and lookup the function - const result = this.#events.get(EventFragment.from(key).format()); - if (result) { - return result; - } - return null; - } - /** - * Get the event name for %%key%%, which may be a topic hash, - * event name or event signature that belongs to the ABI. - */ - getEventName(key) { - const fragment = this.#getEvent(key, null, false); - assertArgument(fragment, "no matching event", "key", key); - return fragment.name; - } - /** - * Returns true if %%key%% (an event topic hash, event name or - * event signature) is present in the ABI. - * - * In the case of an event name, the name may be ambiguous, so - * accessing the [[EventFragment]] may require refinement. - */ - hasEvent(key) { - return !!this.#getEvent(key, null, false); - } - /** - * Get the [[EventFragment]] for %%key%%, which may be a topic hash, - * event name or event signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple events match by name. - * - * If the %%key%% and %%values%% do not refine to a single event in - * the ABI, this will throw. - */ - getEvent(key, values) { - return this.#getEvent(key, values || null, true); - } - /** - * Iterate over all events, calling %%callback%%, sorted by their name. - */ - forEachEvent(callback) { - const names = Array.from(this.#events.keys()); - names.sort((a, b) => a.localeCompare(b)); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - callback((this.#events.get(name)), i); - } - } - /** - * Get the [[ErrorFragment]] for %%key%%, which may be an error - * selector, error name or error signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple errors match by name. - * - * If the %%key%% and %%values%% do not refine to a single error in - * the ABI, this will throw. - */ - getError(key, values) { - if (isHexString(key)) { - const selector = key.toLowerCase(); - if (BuiltinErrors[selector]) { - return ErrorFragment.from(BuiltinErrors[selector].signature); - } - for (const fragment of this.#errors.values()) { - if (selector === fragment.selector) { - return fragment; - } - } - return null; - } - // It is a bare name, look up the function (will return null if ambiguous) - if (key.indexOf("(") === -1) { - const matching = []; - for (const [name, fragment] of this.#errors) { - if (name.split("(" /* fix:) */)[0] === key) { - matching.push(fragment); - } - } - if (matching.length === 0) { - if (key === "Error") { - return ErrorFragment.from("error Error(string)"); - } - if (key === "Panic") { - return ErrorFragment.from("error Panic(uint256)"); - } - return null; - } - else if (matching.length > 1) { - const matchStr = matching.map((m) => JSON.stringify(m.format())).join(", "); - assertArgument(false, `ambiguous error description (i.e. ${matchStr})`, "name", key); - } - return matching[0]; - } - // Normalize the signature and lookup the function - key = ErrorFragment.from(key).format(); - if (key === "Error(string)") { - return ErrorFragment.from("error Error(string)"); - } - if (key === "Panic(uint256)") { - return ErrorFragment.from("error Panic(uint256)"); - } - const result = this.#errors.get(key); - if (result) { - return result; - } - return null; - } - /** - * Iterate over all errors, calling %%callback%%, sorted by their name. - */ - forEachError(callback) { - const names = Array.from(this.#errors.keys()); - names.sort((a, b) => a.localeCompare(b)); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - callback((this.#errors.get(name)), i); - } - } - // Get the 4-byte selector used by Solidity to identify a function - /* -getSelector(fragment: ErrorFragment | FunctionFragment): string { - if (typeof(fragment) === "string") { - const matches: Array = [ ]; - - try { matches.push(this.getFunction(fragment)); } catch (error) { } - try { matches.push(this.getError(fragment)); } catch (_) { } - - if (matches.length === 0) { - logger.throwArgumentError("unknown fragment", "key", fragment); - } else if (matches.length > 1) { - logger.throwArgumentError("ambiguous fragment matches function and error", "key", fragment); - } - - fragment = matches[0]; - } - - return dataSlice(id(fragment.format()), 0, 4); -} - */ - // Get the 32-byte topic hash used by Solidity to identify an event - /* - getEventTopic(fragment: EventFragment): string { - //if (typeof(fragment) === "string") { fragment = this.getEvent(eventFragment); } - return id(fragment.format()); - } - */ - _decodeParams(params, data) { - return this.#abiCoder.decode(params, data); - } - _encodeParams(params, values) { - return this.#abiCoder.encode(params, values); - } - /** - * Encodes a ``tx.data`` object for deploying the Contract with - * the %%values%% as the constructor arguments. - */ - encodeDeploy(values) { - return this._encodeParams(this.deploy.inputs, values || []); - } - /** - * Decodes the result %%data%% (e.g. from an ``eth_call``) for the - * specified error (see [[getError]] for valid values for - * %%key%%). - * - * Most developers should prefer the [[parseCallResult]] method instead, - * which will automatically detect a ``CALL_EXCEPTION`` and throw the - * corresponding error. - */ - decodeErrorResult(fragment, data) { - if (typeof (fragment) === "string") { - const f = this.getError(fragment); - assertArgument(f, "unknown error", "fragment", fragment); - fragment = f; - } - assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match error ${fragment.name}.`, "data", data); - return this._decodeParams(fragment.inputs, dataSlice(data, 4)); - } - /** - * Encodes the transaction revert data for a call result that - * reverted from the the Contract with the sepcified %%error%% - * (see [[getError]] for valid values for %%fragment%%) with the %%values%%. - * - * This is generally not used by most developers, unless trying to mock - * a result from a Contract. - */ - encodeErrorResult(fragment, values) { - if (typeof (fragment) === "string") { - const f = this.getError(fragment); - assertArgument(f, "unknown error", "fragment", fragment); - fragment = f; - } - return concat([ - fragment.selector, - this._encodeParams(fragment.inputs, values || []) - ]); - } - /** - * Decodes the %%data%% from a transaction ``tx.data`` for - * the function specified (see [[getFunction]] for valid values - * for %%fragment%%). - * - * Most developers should prefer the [[parseTransaction]] method - * instead, which will automatically detect the fragment. - */ - decodeFunctionData(fragment, data) { - if (typeof (fragment) === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match function ${fragment.name}.`, "data", data); - return this._decodeParams(fragment.inputs, dataSlice(data, 4)); - } - /** - * Encodes the ``tx.data`` for a transaction that calls the function - * specified (see [[getFunction]] for valid values for %%fragment%%) with - * the %%values%%. - */ - encodeFunctionData(fragment, values) { - if (typeof (fragment) === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - return concat([ - fragment.selector, - this._encodeParams(fragment.inputs, values || []) - ]); - } - /** - * Decodes the result %%data%% (e.g. from an ``eth_call``) for the - * specified function (see [[getFunction]] for valid values for - * %%key%%). - * - * Most developers should prefer the [[parseCallResult]] method instead, - * which will automatically detect a ``CALL_EXCEPTION`` and throw the - * corresponding error. - */ - decodeFunctionResult(fragment, data) { - if (typeof (fragment) === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - let message = "invalid length for result data"; - const bytes = getBytesCopy(data); - if ((bytes.length % 32) === 0) { - try { - return this.#abiCoder.decode(fragment.outputs, bytes); - } - catch (error) { - message = "could not decode result data"; - } - } - // Call returned data with no error, but the data is junk - assert(false, message, "BAD_DATA", { - value: hexlify(bytes), - info: { method: fragment.name, signature: fragment.format() } - }); - } - makeError(_data, tx) { - const data = getBytes(_data, "data"); - const error = AbiCoder.getBuiltinCallException("call", tx, data); - // Not a built-in error; try finding a custom error - const customPrefix = "execution reverted (unknown custom error)"; - if (error.message.startsWith(customPrefix)) { - const selector = hexlify(data.slice(0, 4)); - const ef = this.getError(selector); - if (ef) { - try { - const args = this.#abiCoder.decode(ef.inputs, data.slice(4)); - error.revert = { - name: ef.name, signature: ef.format(), args - }; - error.reason = error.revert.signature; - error.message = `execution reverted: ${error.reason}`; - } - catch (e) { - error.message = `execution reverted (coult not decode custom error)`; - } - } - } - // Add the invocation, if available - const parsed = this.parseTransaction(tx); - if (parsed) { - error.invocation = { - method: parsed.name, - signature: parsed.signature, - args: parsed.args - }; - } - return error; - } - /** - * Encodes the result data (e.g. from an ``eth_call``) for the - * specified function (see [[getFunction]] for valid values - * for %%fragment%%) with %%values%%. - * - * This is generally not used by most developers, unless trying to mock - * a result from a Contract. - */ - encodeFunctionResult(fragment, values) { - if (typeof (fragment) === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - return hexlify(this.#abiCoder.encode(fragment.outputs, values || [])); - } - /* - spelunk(inputs: Array, values: ReadonlyArray, processfunc: (type: string, value: any) => Promise): Promise> { - const promises: Array> = [ ]; - const process = function(type: ParamType, value: any): any { - if (type.baseType === "array") { - return descend(type.child - } - if (type. === "address") { - } - }; - - const descend = function (inputs: Array, values: ReadonlyArray) { - if (inputs.length !== values.length) { throw new Error("length mismatch"); } - - }; - - const result: Array = [ ]; - values.forEach((value, index) => { - if (value == null) { - topics.push(null); - } else if (param.baseType === "array" || param.baseType === "tuple") { - logger.throwArgumentError("filtering with tuples or arrays not supported", ("contract." + param.name), value); - } else if (Array.isArray(value)) { - topics.push(value.map((value) => encodeTopic(param, value))); - } else { - topics.push(encodeTopic(param, value)); - } - }); - } - */ - // Create the filter for the event with search criteria (e.g. for eth_filterLog) - encodeFilterTopics(fragment, values) { - if (typeof (fragment) === "string") { - const f = this.getEvent(fragment); - assertArgument(f, "unknown event", "eventFragment", fragment); - fragment = f; - } - assert(values.length <= fragment.inputs.length, `too many arguments for ${fragment.format()}`, "UNEXPECTED_ARGUMENT", { count: values.length, expectedCount: fragment.inputs.length }); - const topics = []; - if (!fragment.anonymous) { - topics.push(fragment.topicHash); - } - // @TODO: Use the coders for this; to properly support tuples, etc. - const encodeTopic = (param, value) => { - if (param.type === "string") { - return id(value); - } - else if (param.type === "bytes") { - return keccak256(hexlify(value)); - } - if (param.type === "bool" && typeof (value) === "boolean") { - value = (value ? "0x01" : "0x00"); - } - else if (param.type.match(/^u?int/)) { - value = toBeHex(value); // @TODO: Should this toTwos?? - } - else if (param.type.match(/^bytes/)) { - value = zeroPadBytes(value, 32); - } - else if (param.type === "address") { - // Check addresses are valid - this.#abiCoder.encode(["address"], [value]); - } - return zeroPadValue(hexlify(value), 32); - }; - values.forEach((value, index) => { - const param = fragment.inputs[index]; - if (!param.indexed) { - assertArgument(value == null, "cannot filter non-indexed parameters; must be null", ("contract." + param.name), value); - return; - } - if (value == null) { - topics.push(null); - } - else if (param.baseType === "array" || param.baseType === "tuple") { - assertArgument(false, "filtering with tuples or arrays not supported", ("contract." + param.name), value); - } - else if (Array.isArray(value)) { - topics.push(value.map((value) => encodeTopic(param, value))); - } - else { - topics.push(encodeTopic(param, value)); - } - }); - // Trim off trailing nulls - while (topics.length && topics[topics.length - 1] === null) { - topics.pop(); - } - return topics; - } - encodeEventLog(fragment, values) { - if (typeof (fragment) === "string") { - const f = this.getEvent(fragment); - assertArgument(f, "unknown event", "eventFragment", fragment); - fragment = f; - } - const topics = []; - const dataTypes = []; - const dataValues = []; - if (!fragment.anonymous) { - topics.push(fragment.topicHash); - } - assertArgument(values.length === fragment.inputs.length, "event arguments/values mismatch", "values", values); - fragment.inputs.forEach((param, index) => { - const value = values[index]; - if (param.indexed) { - if (param.type === "string") { - topics.push(id(value)); - } - else if (param.type === "bytes") { - topics.push(keccak256(value)); - } - else if (param.baseType === "tuple" || param.baseType === "array") { - // @TODO - throw new Error("not implemented"); - } - else { - topics.push(this.#abiCoder.encode([param.type], [value])); - } - } - else { - dataTypes.push(param); - dataValues.push(value); - } - }); - return { - data: this.#abiCoder.encode(dataTypes, dataValues), - topics: topics - }; - } - // Decode a filter for the event and the search criteria - decodeEventLog(fragment, data, topics) { - if (typeof (fragment) === "string") { - const f = this.getEvent(fragment); - assertArgument(f, "unknown event", "eventFragment", fragment); - fragment = f; - } - if (topics != null && !fragment.anonymous) { - const eventTopic = fragment.topicHash; - assertArgument(isHexString(topics[0], 32) && topics[0].toLowerCase() === eventTopic, "fragment/topic mismatch", "topics[0]", topics[0]); - topics = topics.slice(1); - } - const indexed = []; - const nonIndexed = []; - const dynamic = []; - fragment.inputs.forEach((param, index) => { - if (param.indexed) { - if (param.type === "string" || param.type === "bytes" || param.baseType === "tuple" || param.baseType === "array") { - indexed.push(ParamType.from({ type: "bytes32", name: param.name })); - dynamic.push(true); - } - else { - indexed.push(param); - dynamic.push(false); - } - } - else { - nonIndexed.push(param); - dynamic.push(false); - } - }); - const resultIndexed = (topics != null) ? this.#abiCoder.decode(indexed, concat(topics)) : null; - const resultNonIndexed = this.#abiCoder.decode(nonIndexed, data, true); - //const result: (Array & { [ key: string ]: any }) = [ ]; - const values = []; - const keys = []; - let nonIndexedIndex = 0, indexedIndex = 0; - fragment.inputs.forEach((param, index) => { - let value = null; - if (param.indexed) { - if (resultIndexed == null) { - value = new Indexed(null); - } - else if (dynamic[index]) { - value = new Indexed(resultIndexed[indexedIndex++]); - } - else { - try { - value = resultIndexed[indexedIndex++]; - } - catch (error) { - value = error; - } - } - } - else { - try { - value = resultNonIndexed[nonIndexedIndex++]; - } - catch (error) { - value = error; - } - } - values.push(value); - keys.push(param.name || null); - }); - return Result.fromItems(values, keys); - } - /** - * Parses a transaction, finding the matching function and extracts - * the parameter values along with other useful function details. - * - * If the matching function cannot be found, return null. - */ - parseTransaction(tx) { - const data = getBytes(tx.data, "tx.data"); - const value = getBigInt((tx.value != null) ? tx.value : 0, "tx.value"); - const fragment = this.getFunction(hexlify(data.slice(0, 4))); - if (!fragment) { - return null; - } - const args = this.#abiCoder.decode(fragment.inputs, data.slice(4)); - return new TransactionDescription(fragment, fragment.selector, args, value); - } - parseCallResult(data) { - throw new Error("@TODO"); - } - /** - * Parses a receipt log, finding the matching event and extracts - * the parameter values along with other useful event details. - * - * If the matching event cannot be found, returns null. - */ - parseLog(log) { - const fragment = this.getEvent(log.topics[0]); - if (!fragment || fragment.anonymous) { - return null; - } - // @TODO: If anonymous, and the only method, and the input count matches, should we parse? - // Probably not, because just because it is the only event in the ABI does - // not mean we have the full ABI; maybe just a fragment? - return new LogDescription(fragment, fragment.topicHash, this.decodeEventLog(fragment, log.data, log.topics)); - } - /** - * Parses a revert data, finding the matching error and extracts - * the parameter values along with other useful error details. - * - * If the matching error cannot be found, returns null. - */ - parseError(data) { - const hexData = hexlify(data); - const fragment = this.getError(dataSlice(hexData, 0, 4)); - if (!fragment) { - return null; - } - const args = this.#abiCoder.decode(fragment.inputs, dataSlice(hexData, 4)); - return new ErrorDescription(fragment, fragment.selector, args); - } - /** - * Creates a new [[Interface]] from the ABI %%value%%. - * - * The %%value%% may be provided as an existing [[Interface]] object, - * a JSON-encoded ABI or any Human-Readable ABI format. - */ - static from(value) { - // Already an Interface, which is immutable - if (value instanceof Interface) { - return value; - } - // JSON - if (typeof (value) === "string") { - return new Interface(JSON.parse(value)); - } - // An Interface; possibly from another v6 instance - if (typeof (value.formatJson) === "function") { - return new Interface(value.formatJson()); - } - // A legacy Interface; from an older version - if (typeof (value.format) === "function") { - return new Interface(value.format("json")); - } - // Array of fragments - return new Interface(value); - } -} -//# sourceMappingURL=interface.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/interface.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/interface.js.map deleted file mode 100644 index b9181700..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/interface.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src.ts/abi/interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAA;AACrC,OAAO,EACH,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EACpD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAClE,cAAc,EAAE,OAAO,EAAE,MAAM,EAClC,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EACH,mBAAmB,EAAE,aAAa,EAAE,aAAa,EACjD,QAAQ,EAAE,gBAAgB,EAAE,SAAS,EACxC,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAOnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,CAAC;AAErC;;;GAGG;AACH,MAAM,OAAO,cAAc;IACvB;;OAEG;IACM,QAAQ,CAAiB;IAElC;;OAEG;IACM,IAAI,CAAU;IAEvB;;OAEG;IACM,SAAS,CAAU;IAE5B;;OAEG;IACM,KAAK,CAAU;IAExB;;OAEG;IACM,IAAI,CAAS;IAEtB;;OAEG;IACH,YAAY,QAAuB,EAAE,KA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GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAEzD,IAAI,CAAC,QAAQ,EAAE;YAAE,OAAO,IAAI,CAAC;SAAE;QAE/B,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;QAC3E,OAAO,IAAI,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IACnE,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,IAAI,CAAC,KAA+B;QACvC,2CAA2C;QAC3C,IAAI,KAAK,YAAY,SAAS,EAAE;YAAE,OAAO,KAAK,CAAC;SAAE;QAEjD,OAAO;QACP,IAAI,OAAM,CAAC,KAAK,CAAC,KAAK,QAAQ,EAAE;YAAE,OAAO,IAAI,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;SAAE;QAE5E,kDAAkD;QAClD,IAAI,OAAM,CAAO,KAAM,CAAC,UAAU,CAAC,KAAK,UAAU,EAAE;YAChD,OAAO,IAAI,SAAS,CAAO,KAAM,CAAC,UAAU,EAAE,CAAC,CAAC;SACnD;QAED,4CAA4C;QAC5C,IAAI,OAAM,CAAO,KAAM,CAAC,MAAM,CAAC,KAAK,UAAU,EAAE;YAC5C,OAAO,IAAI,SAAS,CAAO,KAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;SACrD;QAED,qBAAqB;QACrB,OAAO,IAAI,SAAS,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/typed.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/typed.d.ts deleted file mode 100644 index 8707a62f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/typed.d.ts +++ /dev/null @@ -1,570 +0,0 @@ -/** - * A Typed object allows a value to have its type explicitly - * specified. - * - * For example, in Solidity, the value ``45`` could represent a - * ``uint8`` or a ``uint256``. The value ``0x1234`` could represent - * a ``bytes2`` or ``bytes``. - * - * Since JavaScript has no meaningful way to explicitly inform any - * APIs which what the type is, this allows transparent interoperation - * with Soldity. - * - * @_subsection: api/abi:Typed Values - */ -import type { Addressable } from "../address/index.js"; -import type { BigNumberish, BytesLike } from "../utils/index.js"; -import type { Result } from "./coders/abstract-coder.js"; -/** - * @_ignore: - */ -export interface TypedNumber extends Typed { - value: number; - defaultValue(): number; - minValue(): number; - maxValue(): number; -} -/** - * A **Typed** that represents a numeric value. - */ -export interface TypedBigInt extends Typed { - /** - * The value. - */ - value: bigint; - /** - * The default value for all numeric types is ``0``. - */ - defaultValue(): bigint; - /** - * The minimum value for this type, accounting for bit-width and signed-ness. - */ - minValue(): bigint; - /** - * The minimum value for this type, accounting for bit-width. - */ - maxValue(): bigint; -} -/** - * A **Typed** that represents a binary sequence of data as bytes. - */ -export interface TypedData extends Typed { - /** - * The value. - */ - value: string; - /** - * The default value for this type. - */ - defaultValue(): string; -} -/** - * A **Typed** that represents a UTF-8 sequence of bytes. - */ -export interface TypedString extends Typed { - /** - * The value. - */ - value: string; - /** - * The default value for the string type is the empty string (i.e. ``""``). - */ - defaultValue(): string; -} -/** - * The **Typed** class to wrap values providing explicit type information. - */ -export declare class Typed { - #private; - /** - * The type, as a Solidity-compatible type. - */ - readonly type: string; - /** - * The actual value. - */ - readonly value: any; - /** - * @_ignore: - */ - readonly _typedSymbol: Symbol; - /** - * @_ignore: - */ - constructor(gaurd: any, type: string, value: any, options?: any); - /** - * Format the type as a Human-Readable type. - */ - format(): string; - /** - * The default value returned by this type. - */ - defaultValue(): string | number | bigint | Result; - /** - * The minimum value for numeric types. - */ - minValue(): string | number | bigint; - /** - * The maximum value for numeric types. - */ - maxValue(): string | number | bigint; - /** - * Returns ``true`` and provides a type guard is this is a [[TypedBigInt]]. - */ - isBigInt(): this is TypedBigInt; - /** - * Returns ``true`` and provides a type guard is this is a [[TypedData]]. - */ - isData(): this is TypedData; - /** - * Returns ``true`` and provides a type guard is this is a [[TypedString]]. - */ - isString(): this is TypedString; - /** - * Returns the tuple name, if this is a tuple. Throws otherwise. - */ - get tupleName(): null | string; - /** - * Returns the length of the array type or ``-1`` if it is dynamic. - * - * Throws if the type is not an array. - */ - get arrayLength(): null | number; - /** - * Returns a new **Typed** of %%type%% with the %%value%%. - */ - static from(type: string, value: any): Typed; - /** - * Return a new ``uint8`` type for %%v%%. - */ - static uint8(v: BigNumberish): Typed; - /** - * Return a new ``uint16`` type for %%v%%. - */ - static uint16(v: BigNumberish): Typed; - /** - * Return a new ``uint24`` type for %%v%%. - */ - static uint24(v: BigNumberish): Typed; - /** - * Return a new ``uint32`` type for %%v%%. - */ - static uint32(v: BigNumberish): Typed; - /** - * Return a new ``uint40`` type for %%v%%. - */ - static uint40(v: BigNumberish): Typed; - /** - * Return a new ``uint48`` type for %%v%%. - */ - static uint48(v: BigNumberish): Typed; - /** - * Return a new ``uint56`` type for %%v%%. - */ - static uint56(v: BigNumberish): Typed; - /** - * Return a new ``uint64`` type for %%v%%. - */ - static uint64(v: BigNumberish): Typed; - /** - * Return a new ``uint72`` type for %%v%%. - */ - static uint72(v: BigNumberish): Typed; - /** - * Return a new ``uint80`` type for %%v%%. - */ - static uint80(v: BigNumberish): Typed; - /** - * Return a new ``uint88`` type for %%v%%. - */ - static uint88(v: BigNumberish): Typed; - /** - * Return a new ``uint96`` type for %%v%%. - */ - static uint96(v: BigNumberish): Typed; - /** - * Return a new ``uint104`` type for %%v%%. - */ - static uint104(v: BigNumberish): Typed; - /** - * Return a new ``uint112`` type for %%v%%. - */ - static uint112(v: BigNumberish): Typed; - /** - * Return a new ``uint120`` type for %%v%%. - */ - static uint120(v: BigNumberish): Typed; - /** - * Return a new ``uint128`` type for %%v%%. - */ - static uint128(v: BigNumberish): Typed; - /** - * Return a new ``uint136`` type for %%v%%. - */ - static uint136(v: BigNumberish): Typed; - /** - * Return a new ``uint144`` type for %%v%%. - */ - static uint144(v: BigNumberish): Typed; - /** - * Return a new ``uint152`` type for %%v%%. - */ - static uint152(v: BigNumberish): Typed; - /** - * Return a new ``uint160`` type for %%v%%. - */ - static uint160(v: BigNumberish): Typed; - /** - * Return a new ``uint168`` type for %%v%%. - */ - static uint168(v: BigNumberish): Typed; - /** - * Return a new ``uint176`` type for %%v%%. - */ - static uint176(v: BigNumberish): Typed; - /** - * Return a new ``uint184`` type for %%v%%. - */ - static uint184(v: BigNumberish): Typed; - /** - * Return a new ``uint192`` type for %%v%%. - */ - static uint192(v: BigNumberish): Typed; - /** - * Return a new ``uint200`` type for %%v%%. - */ - static uint200(v: BigNumberish): Typed; - /** - * Return a new ``uint208`` type for %%v%%. - */ - static uint208(v: BigNumberish): Typed; - /** - * Return a new ``uint216`` type for %%v%%. - */ - static uint216(v: BigNumberish): Typed; - /** - * Return a new ``uint224`` type for %%v%%. - */ - static uint224(v: BigNumberish): Typed; - /** - * Return a new ``uint232`` type for %%v%%. - */ - static uint232(v: BigNumberish): Typed; - /** - * Return a new ``uint240`` type for %%v%%. - */ - static uint240(v: BigNumberish): Typed; - /** - * Return a new ``uint248`` type for %%v%%. - */ - static uint248(v: BigNumberish): Typed; - /** - * Return a new ``uint256`` type for %%v%%. - */ - static uint256(v: BigNumberish): Typed; - /** - * Return a new ``uint256`` type for %%v%%. - */ - static uint(v: BigNumberish): Typed; - /** - * Return a new ``int8`` type for %%v%%. - */ - static int8(v: BigNumberish): Typed; - /** - * Return a new ``int16`` type for %%v%%. - */ - static int16(v: BigNumberish): Typed; - /** - * Return a new ``int24`` type for %%v%%. - */ - static int24(v: BigNumberish): Typed; - /** - * Return a new ``int32`` type for %%v%%. - */ - static int32(v: BigNumberish): Typed; - /** - * Return a new ``int40`` type for %%v%%. - */ - static int40(v: BigNumberish): Typed; - /** - * Return a new ``int48`` type for %%v%%. - */ - static int48(v: BigNumberish): Typed; - /** - * Return a new ``int56`` type for %%v%%. - */ - static int56(v: BigNumberish): Typed; - /** - * Return a new ``int64`` type for %%v%%. - */ - static int64(v: BigNumberish): Typed; - /** - * Return a new ``int72`` type for %%v%%. - */ - static int72(v: BigNumberish): Typed; - /** - * Return a new ``int80`` type for %%v%%. - */ - static int80(v: BigNumberish): Typed; - /** - * Return a new ``int88`` type for %%v%%. - */ - static int88(v: BigNumberish): Typed; - /** - * Return a new ``int96`` type for %%v%%. - */ - static int96(v: BigNumberish): Typed; - /** - * Return a new ``int104`` type for %%v%%. - */ - static int104(v: BigNumberish): Typed; - /** - * Return a new ``int112`` type for %%v%%. - */ - static int112(v: BigNumberish): Typed; - /** - * Return a new ``int120`` type for %%v%%. - */ - static int120(v: BigNumberish): Typed; - /** - * Return a new ``int128`` type for %%v%%. - */ - static int128(v: BigNumberish): Typed; - /** - * Return a new ``int136`` type for %%v%%. - */ - static int136(v: BigNumberish): Typed; - /** - * Return a new ``int144`` type for %%v%%. - */ - static int144(v: BigNumberish): Typed; - /** - * Return a new ``int52`` type for %%v%%. - */ - static int152(v: BigNumberish): Typed; - /** - * Return a new ``int160`` type for %%v%%. - */ - static int160(v: BigNumberish): Typed; - /** - * Return a new ``int168`` type for %%v%%. - */ - static int168(v: BigNumberish): Typed; - /** - * Return a new ``int176`` type for %%v%%. - */ - static int176(v: BigNumberish): Typed; - /** - * Return a new ``int184`` type for %%v%%. - */ - static int184(v: BigNumberish): Typed; - /** - * Return a new ``int92`` type for %%v%%. - */ - static int192(v: BigNumberish): Typed; - /** - * Return a new ``int200`` type for %%v%%. - */ - static int200(v: BigNumberish): Typed; - /** - * Return a new ``int208`` type for %%v%%. - */ - static int208(v: BigNumberish): Typed; - /** - * Return a new ``int216`` type for %%v%%. - */ - static int216(v: BigNumberish): Typed; - /** - * Return a new ``int224`` type for %%v%%. - */ - static int224(v: BigNumberish): Typed; - /** - * Return a new ``int232`` type for %%v%%. - */ - static int232(v: BigNumberish): Typed; - /** - * Return a new ``int240`` type for %%v%%. - */ - static int240(v: BigNumberish): Typed; - /** - * Return a new ``int248`` type for %%v%%. - */ - static int248(v: BigNumberish): Typed; - /** - * Return a new ``int256`` type for %%v%%. - */ - static int256(v: BigNumberish): Typed; - /** - * Return a new ``int256`` type for %%v%%. - */ - static int(v: BigNumberish): Typed; - /** - * Return a new ``bytes1`` type for %%v%%. - */ - static bytes1(v: BytesLike): Typed; - /** - * Return a new ``bytes2`` type for %%v%%. - */ - static bytes2(v: BytesLike): Typed; - /** - * Return a new ``bytes3`` type for %%v%%. - */ - static bytes3(v: BytesLike): Typed; - /** - * Return a new ``bytes4`` type for %%v%%. - */ - static bytes4(v: BytesLike): Typed; - /** - * Return a new ``bytes5`` type for %%v%%. - */ - static bytes5(v: BytesLike): Typed; - /** - * Return a new ``bytes6`` type for %%v%%. - */ - static bytes6(v: BytesLike): Typed; - /** - * Return a new ``bytes7`` type for %%v%%. - */ - static bytes7(v: BytesLike): Typed; - /** - * Return a new ``bytes8`` type for %%v%%. - */ - static bytes8(v: BytesLike): Typed; - /** - * Return a new ``bytes9`` type for %%v%%. - */ - static bytes9(v: BytesLike): Typed; - /** - * Return a new ``bytes10`` type for %%v%%. - */ - static bytes10(v: BytesLike): Typed; - /** - * Return a new ``bytes11`` type for %%v%%. - */ - static bytes11(v: BytesLike): Typed; - /** - * Return a new ``bytes12`` type for %%v%%. - */ - static bytes12(v: BytesLike): Typed; - /** - * Return a new ``bytes13`` type for %%v%%. - */ - static bytes13(v: BytesLike): Typed; - /** - * Return a new ``bytes14`` type for %%v%%. - */ - static bytes14(v: BytesLike): Typed; - /** - * Return a new ``bytes15`` type for %%v%%. - */ - static bytes15(v: BytesLike): Typed; - /** - * Return a new ``bytes16`` type for %%v%%. - */ - static bytes16(v: BytesLike): Typed; - /** - * Return a new ``bytes17`` type for %%v%%. - */ - static bytes17(v: BytesLike): Typed; - /** - * Return a new ``bytes18`` type for %%v%%. - */ - static bytes18(v: BytesLike): Typed; - /** - * Return a new ``bytes19`` type for %%v%%. - */ - static bytes19(v: BytesLike): Typed; - /** - * Return a new ``bytes20`` type for %%v%%. - */ - static bytes20(v: BytesLike): Typed; - /** - * Return a new ``bytes21`` type for %%v%%. - */ - static bytes21(v: BytesLike): Typed; - /** - * Return a new ``bytes22`` type for %%v%%. - */ - static bytes22(v: BytesLike): Typed; - /** - * Return a new ``bytes23`` type for %%v%%. - */ - static bytes23(v: BytesLike): Typed; - /** - * Return a new ``bytes24`` type for %%v%%. - */ - static bytes24(v: BytesLike): Typed; - /** - * Return a new ``bytes25`` type for %%v%%. - */ - static bytes25(v: BytesLike): Typed; - /** - * Return a new ``bytes26`` type for %%v%%. - */ - static bytes26(v: BytesLike): Typed; - /** - * Return a new ``bytes27`` type for %%v%%. - */ - static bytes27(v: BytesLike): Typed; - /** - * Return a new ``bytes28`` type for %%v%%. - */ - static bytes28(v: BytesLike): Typed; - /** - * Return a new ``bytes29`` type for %%v%%. - */ - static bytes29(v: BytesLike): Typed; - /** - * Return a new ``bytes30`` type for %%v%%. - */ - static bytes30(v: BytesLike): Typed; - /** - * Return a new ``bytes31`` type for %%v%%. - */ - static bytes31(v: BytesLike): Typed; - /** - * Return a new ``bytes32`` type for %%v%%. - */ - static bytes32(v: BytesLike): Typed; - /** - * Return a new ``address`` type for %%v%%. - */ - static address(v: string | Addressable): Typed; - /** - * Return a new ``bool`` type for %%v%%. - */ - static bool(v: any): Typed; - /** - * Return a new ``bytes`` type for %%v%%. - */ - static bytes(v: BytesLike): Typed; - /** - * Return a new ``string`` type for %%v%%. - */ - static string(v: string): Typed; - /** - * Return a new ``array`` type for %%v%%, allowing %%dynamic%% length. - */ - static array(v: Array, dynamic?: null | boolean): Typed; - /** - * Return a new ``tuple`` type for %%v%%, with the optional %%name%%. - */ - static tuple(v: Array | Record, name?: string): Typed; - /** - * Return a new ``uint8`` type for %%v%%. - */ - static overrides(v: Record): Typed; - /** - * Returns true only if %%value%% is a [[Typed]] instance. - */ - static isTyped(value: any): value is Typed; - /** - * If the value is a [[Typed]] instance, validates the underlying value - * and returns it, otherwise returns value directly. - * - * This is useful for functions that with to accept either a [[Typed]] - * object or values. - */ - static dereference(value: Typed | T, type: string): T; -} -//# sourceMappingURL=typed.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/typed.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/typed.d.ts.map deleted file mode 100644 index d7d2b42a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/typed.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"typed.d.ts","sourceRoot":"","sources":["../../src.ts/abi/typed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEjE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAqBzD;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,KAAK;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,IAAI,MAAM,CAAC;IACvB,QAAQ,IAAI,MAAM,CAAC;IACnB,QAAQ,IAAI,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,KAAK;IACtC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,YAAY,IAAI,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,IAAI,MAAM,CAAC;IAEnB;;OAEG;IACH,QAAQ,IAAI,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,KAAK;IACpC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,YAAY,IAAI,MAAM,CAAC;CAC1B;AAED;;G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I,GAAG,OAAO,GAAG,KAAK;IAMpE;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,GAAG,KAAK,CAAC,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK;IAMvF;;OAEG;IACH,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,KAAK;IAI/C;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,KAAK;IAO1C;;;;;;OAMG;IACH,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC;CAS3D"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/typed.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/typed.js deleted file mode 100644 index 8089efbe..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/typed.js +++ /dev/null @@ -1,602 +0,0 @@ -/** - * A Typed object allows a value to have its type explicitly - * specified. - * - * For example, in Solidity, the value ``45`` could represent a - * ``uint8`` or a ``uint256``. The value ``0x1234`` could represent - * a ``bytes2`` or ``bytes``. - * - * Since JavaScript has no meaningful way to explicitly inform any - * APIs which what the type is, this allows transparent interoperation - * with Soldity. - * - * @_subsection: api/abi:Typed Values - */ -import { assertPrivate, defineProperties } from "../utils/index.js"; -const _gaurd = {}; -function n(value, width) { - let signed = false; - if (width < 0) { - signed = true; - width *= -1; - } - // @TODO: Check range is valid for value - return new Typed(_gaurd, `${signed ? "" : "u"}int${width}`, value, { signed, width }); -} -function b(value, size) { - // @TODO: Check range is valid for value - return new Typed(_gaurd, `bytes${(size) ? size : ""}`, value, { size }); -} -const _typedSymbol = Symbol.for("_ethers_typed"); -/** - * The **Typed** class to wrap values providing explicit type information. - */ -export class Typed { - /** - * The type, as a Solidity-compatible type. - */ - type; - /** - * The actual value. - */ - value; - #options; - /** - * @_ignore: - */ - _typedSymbol; - /** - * @_ignore: - */ - constructor(gaurd, type, value, options) { - if (options == null) { - options = null; - } - assertPrivate(_gaurd, gaurd, "Typed"); - defineProperties(this, { _typedSymbol, type, value }); - this.#options = options; - // Check the value is valid - this.format(); - } - /** - * Format the type as a Human-Readable type. - */ - format() { - if (this.type === "array") { - throw new Error(""); - } - else if (this.type === "dynamicArray") { - throw new Error(""); - } - else if (this.type === "tuple") { - return `tuple(${this.value.map((v) => v.format()).join(",")})`; - } - return this.type; - } - /** - * The default value returned by this type. - */ - defaultValue() { - return 0; - } - /** - * The minimum value for numeric types. - */ - minValue() { - return 0; - } - /** - * The maximum value for numeric types. - */ - maxValue() { - return 0; - } - /** - * Returns ``true`` and provides a type guard is this is a [[TypedBigInt]]. - */ - isBigInt() { - return !!(this.type.match(/^u?int[0-9]+$/)); - } - /** - * Returns ``true`` and provides a type guard is this is a [[TypedData]]. - */ - isData() { - return this.type.startsWith("bytes"); - } - /** - * Returns ``true`` and provides a type guard is this is a [[TypedString]]. - */ - isString() { - return (this.type === "string"); - } - /** - * Returns the tuple name, if this is a tuple. Throws otherwise. - */ - get tupleName() { - if (this.type !== "tuple") { - throw TypeError("not a tuple"); - } - return this.#options; - } - // Returns the length of this type as an array - // - `null` indicates the length is unforced, it could be dynamic - // - `-1` indicates the length is dynamic - // - any other value indicates it is a static array and is its length - /** - * Returns the length of the array type or ``-1`` if it is dynamic. - * - * Throws if the type is not an array. - */ - get arrayLength() { - if (this.type !== "array") { - throw TypeError("not an array"); - } - if (this.#options === true) { - return -1; - } - if (this.#options === false) { - return (this.value).length; - } - return null; - } - /** - * Returns a new **Typed** of %%type%% with the %%value%%. - */ - static from(type, value) { - return new Typed(_gaurd, type, value); - } - /** - * Return a new ``uint8`` type for %%v%%. - */ - static uint8(v) { return n(v, 8); } - /** - * Return a new ``uint16`` type for %%v%%. - */ - static uint16(v) { return n(v, 16); } - /** - * Return a new ``uint24`` type for %%v%%. - */ - static uint24(v) { return n(v, 24); } - /** - * Return a new ``uint32`` type for %%v%%. - */ - static uint32(v) { return n(v, 32); } - /** - * Return a new ``uint40`` type for %%v%%. - */ - static uint40(v) { return n(v, 40); } - /** - * Return a new ``uint48`` type for %%v%%. - */ - static uint48(v) { return n(v, 48); } - /** - * Return a new ``uint56`` type for %%v%%. - */ - static uint56(v) { return n(v, 56); } - /** - * Return a new ``uint64`` type for %%v%%. - */ - static uint64(v) { return n(v, 64); } - /** - * Return a new ``uint72`` type for %%v%%. - */ - static uint72(v) { return n(v, 72); } - /** - * Return a new ``uint80`` type for %%v%%. - */ - static uint80(v) { return n(v, 80); } - /** - * Return a new ``uint88`` type for %%v%%. - */ - static uint88(v) { return n(v, 88); } - /** - * Return a new ``uint96`` type for %%v%%. - */ - static uint96(v) { return n(v, 96); } - /** - * Return a new ``uint104`` type for %%v%%. - */ - static uint104(v) { return n(v, 104); } - /** - * Return a new ``uint112`` type for %%v%%. - */ - static uint112(v) { return n(v, 112); } - /** - * Return a new ``uint120`` type for %%v%%. - */ - static uint120(v) { return n(v, 120); } - /** - * Return a new ``uint128`` type for %%v%%. - */ - static uint128(v) { return n(v, 128); } - /** - * Return a new ``uint136`` type for %%v%%. - */ - static uint136(v) { return n(v, 136); } - /** - * Return a new ``uint144`` type for %%v%%. - */ - static uint144(v) { return n(v, 144); } - /** - * Return a new ``uint152`` type for %%v%%. - */ - static uint152(v) { return n(v, 152); } - /** - * Return a new ``uint160`` type for %%v%%. - */ - static uint160(v) { return n(v, 160); } - /** - * Return a new ``uint168`` type for %%v%%. - */ - static uint168(v) { return n(v, 168); } - /** - * Return a new ``uint176`` type for %%v%%. - */ - static uint176(v) { return n(v, 176); } - /** - * Return a new ``uint184`` type for %%v%%. - */ - static uint184(v) { return n(v, 184); } - /** - * Return a new ``uint192`` type for %%v%%. - */ - static uint192(v) { return n(v, 192); } - /** - * Return a new ``uint200`` type for %%v%%. - */ - static uint200(v) { return n(v, 200); } - /** - * Return a new ``uint208`` type for %%v%%. - */ - static uint208(v) { return n(v, 208); } - /** - * Return a new ``uint216`` type for %%v%%. - */ - static uint216(v) { return n(v, 216); } - /** - * Return a new ``uint224`` type for %%v%%. - */ - static uint224(v) { return n(v, 224); } - /** - * Return a new ``uint232`` type for %%v%%. - */ - static uint232(v) { return n(v, 232); } - /** - * Return a new ``uint240`` type for %%v%%. - */ - static uint240(v) { return n(v, 240); } - /** - * Return a new ``uint248`` type for %%v%%. - */ - static uint248(v) { return n(v, 248); } - /** - * Return a new ``uint256`` type for %%v%%. - */ - static uint256(v) { return n(v, 256); } - /** - * Return a new ``uint256`` type for %%v%%. - */ - static uint(v) { return n(v, 256); } - /** - * Return a new ``int8`` type for %%v%%. - */ - static int8(v) { return n(v, -8); } - /** - * Return a new ``int16`` type for %%v%%. - */ - static int16(v) { return n(v, -16); } - /** - * Return a new ``int24`` type for %%v%%. - */ - static int24(v) { return n(v, -24); } - /** - * Return a new ``int32`` type for %%v%%. - */ - static int32(v) { return n(v, -32); } - /** - * Return a new ``int40`` type for %%v%%. - */ - static int40(v) { return n(v, -40); } - /** - * Return a new ``int48`` type for %%v%%. - */ - static int48(v) { return n(v, -48); } - /** - * Return a new ``int56`` type for %%v%%. - */ - static int56(v) { return n(v, -56); } - /** - * Return a new ``int64`` type for %%v%%. - */ - static int64(v) { return n(v, -64); } - /** - * Return a new ``int72`` type for %%v%%. - */ - static int72(v) { return n(v, -72); } - /** - * Return a new ``int80`` type for %%v%%. - */ - static int80(v) { return n(v, -80); } - /** - * Return a new ``int88`` type for %%v%%. - */ - static int88(v) { return n(v, -88); } - /** - * Return a new ``int96`` type for %%v%%. - */ - static int96(v) { return n(v, -96); } - /** - * Return a new ``int104`` type for %%v%%. - */ - static int104(v) { return n(v, -104); } - /** - * Return a new ``int112`` type for %%v%%. - */ - static int112(v) { return n(v, -112); } - /** - * Return a new ``int120`` type for %%v%%. - */ - static int120(v) { return n(v, -120); } - /** - * Return a new ``int128`` type for %%v%%. - */ - static int128(v) { return n(v, -128); } - /** - * Return a new ``int136`` type for %%v%%. - */ - static int136(v) { return n(v, -136); } - /** - * Return a new ``int144`` type for %%v%%. - */ - static int144(v) { return n(v, -144); } - /** - * Return a new ``int52`` type for %%v%%. - */ - static int152(v) { return n(v, -152); } - /** - * Return a new ``int160`` type for %%v%%. - */ - static int160(v) { return n(v, -160); } - /** - * Return a new ``int168`` type for %%v%%. - */ - static int168(v) { return n(v, -168); } - /** - * Return a new ``int176`` type for %%v%%. - */ - static int176(v) { return n(v, -176); } - /** - * Return a new ``int184`` type for %%v%%. - */ - static int184(v) { return n(v, -184); } - /** - * Return a new ``int92`` type for %%v%%. - */ - static int192(v) { return n(v, -192); } - /** - * Return a new ``int200`` type for %%v%%. - */ - static int200(v) { return n(v, -200); } - /** - * Return a new ``int208`` type for %%v%%. - */ - static int208(v) { return n(v, -208); } - /** - * Return a new ``int216`` type for %%v%%. - */ - static int216(v) { return n(v, -216); } - /** - * Return a new ``int224`` type for %%v%%. - */ - static int224(v) { return n(v, -224); } - /** - * Return a new ``int232`` type for %%v%%. - */ - static int232(v) { return n(v, -232); } - /** - * Return a new ``int240`` type for %%v%%. - */ - static int240(v) { return n(v, -240); } - /** - * Return a new ``int248`` type for %%v%%. - */ - static int248(v) { return n(v, -248); } - /** - * Return a new ``int256`` type for %%v%%. - */ - static int256(v) { return n(v, -256); } - /** - * Return a new ``int256`` type for %%v%%. - */ - static int(v) { return n(v, -256); } - /** - * Return a new ``bytes1`` type for %%v%%. - */ - static bytes1(v) { return b(v, 1); } - /** - * Return a new ``bytes2`` type for %%v%%. - */ - static bytes2(v) { return b(v, 2); } - /** - * Return a new ``bytes3`` type for %%v%%. - */ - static bytes3(v) { return b(v, 3); } - /** - * Return a new ``bytes4`` type for %%v%%. - */ - static bytes4(v) { return b(v, 4); } - /** - * Return a new ``bytes5`` type for %%v%%. - */ - static bytes5(v) { return b(v, 5); } - /** - * Return a new ``bytes6`` type for %%v%%. - */ - static bytes6(v) { return b(v, 6); } - /** - * Return a new ``bytes7`` type for %%v%%. - */ - static bytes7(v) { return b(v, 7); } - /** - * Return a new ``bytes8`` type for %%v%%. - */ - static bytes8(v) { return b(v, 8); } - /** - * Return a new ``bytes9`` type for %%v%%. - */ - static bytes9(v) { return b(v, 9); } - /** - * Return a new ``bytes10`` type for %%v%%. - */ - static bytes10(v) { return b(v, 10); } - /** - * Return a new ``bytes11`` type for %%v%%. - */ - static bytes11(v) { return b(v, 11); } - /** - * Return a new ``bytes12`` type for %%v%%. - */ - static bytes12(v) { return b(v, 12); } - /** - * Return a new ``bytes13`` type for %%v%%. - */ - static bytes13(v) { return b(v, 13); } - /** - * Return a new ``bytes14`` type for %%v%%. - */ - static bytes14(v) { return b(v, 14); } - /** - * Return a new ``bytes15`` type for %%v%%. - */ - static bytes15(v) { return b(v, 15); } - /** - * Return a new ``bytes16`` type for %%v%%. - */ - static bytes16(v) { return b(v, 16); } - /** - * Return a new ``bytes17`` type for %%v%%. - */ - static bytes17(v) { return b(v, 17); } - /** - * Return a new ``bytes18`` type for %%v%%. - */ - static bytes18(v) { return b(v, 18); } - /** - * Return a new ``bytes19`` type for %%v%%. - */ - static bytes19(v) { return b(v, 19); } - /** - * Return a new ``bytes20`` type for %%v%%. - */ - static bytes20(v) { return b(v, 20); } - /** - * Return a new ``bytes21`` type for %%v%%. - */ - static bytes21(v) { return b(v, 21); } - /** - * Return a new ``bytes22`` type for %%v%%. - */ - static bytes22(v) { return b(v, 22); } - /** - * Return a new ``bytes23`` type for %%v%%. - */ - static bytes23(v) { return b(v, 23); } - /** - * Return a new ``bytes24`` type for %%v%%. - */ - static bytes24(v) { return b(v, 24); } - /** - * Return a new ``bytes25`` type for %%v%%. - */ - static bytes25(v) { return b(v, 25); } - /** - * Return a new ``bytes26`` type for %%v%%. - */ - static bytes26(v) { return b(v, 26); } - /** - * Return a new ``bytes27`` type for %%v%%. - */ - static bytes27(v) { return b(v, 27); } - /** - * Return a new ``bytes28`` type for %%v%%. - */ - static bytes28(v) { return b(v, 28); } - /** - * Return a new ``bytes29`` type for %%v%%. - */ - static bytes29(v) { return b(v, 29); } - /** - * Return a new ``bytes30`` type for %%v%%. - */ - static bytes30(v) { return b(v, 30); } - /** - * Return a new ``bytes31`` type for %%v%%. - */ - static bytes31(v) { return b(v, 31); } - /** - * Return a new ``bytes32`` type for %%v%%. - */ - static bytes32(v) { return b(v, 32); } - /** - * Return a new ``address`` type for %%v%%. - */ - static address(v) { return new Typed(_gaurd, "address", v); } - /** - * Return a new ``bool`` type for %%v%%. - */ - static bool(v) { return new Typed(_gaurd, "bool", !!v); } - /** - * Return a new ``bytes`` type for %%v%%. - */ - static bytes(v) { return new Typed(_gaurd, "bytes", v); } - /** - * Return a new ``string`` type for %%v%%. - */ - static string(v) { return new Typed(_gaurd, "string", v); } - /** - * Return a new ``array`` type for %%v%%, allowing %%dynamic%% length. - */ - static array(v, dynamic) { - throw new Error("not implemented yet"); - return new Typed(_gaurd, "array", v, dynamic); - } - /** - * Return a new ``tuple`` type for %%v%%, with the optional %%name%%. - */ - static tuple(v, name) { - throw new Error("not implemented yet"); - return new Typed(_gaurd, "tuple", v, name); - } - /** - * Return a new ``uint8`` type for %%v%%. - */ - static overrides(v) { - return new Typed(_gaurd, "overrides", Object.assign({}, v)); - } - /** - * Returns true only if %%value%% is a [[Typed]] instance. - */ - static isTyped(value) { - return (value - && typeof (value) === "object" - && "_typedSymbol" in value - && value._typedSymbol === _typedSymbol); - } - /** - * If the value is a [[Typed]] instance, validates the underlying value - * and returns it, otherwise returns value directly. - * - * This is useful for functions that with to accept either a [[Typed]] - * object or values. - */ - static dereference(value, type) { - if (Typed.isTyped(value)) { - if (value.type !== type) { - throw new Error(`invalid type: expecetd ${type}, got ${value.type}`); - } - return value.value; - } - return value; - } -} -//# sourceMappingURL=typed.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/typed.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/typed.js.map deleted file mode 100644 index a29f0b05..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/abi/typed.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"typed.js","sourceRoot":"","sources":["../../src.ts/abi/typed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAOpE,MAAM,MAAM,GAAG,EAAG,CAAC;AAEnB,SAAS,CAAC,CAAC,KAAmB,EAAE,KAAa;IACzC,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,IAAI,KAAK,GAAG,CAAC,EAAE;QACX,MAAM,GAAG,IAAI,CAAC;QACd,KAAK,IAAI,CAAC,CAAC,CAAC;KACf;IAED,wCAAwC;IACxC,OAAO,IAAI,KAAK,CAAC,MAAM,EAAE,GAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAA,CAAC,CAAC,GAAI,MAAO,KAAM,EAAE,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;AAC7F,CAAC;AAED,SAAS,CAAC,CAAC,KAAgB,EAAE,IAAa;IACtC,wCAAwC;IACxC,OAAO,IAAI,KAAK,CAAC,MAAM,EAAE,QAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA,CAAC,CAAC,EAAG,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;AAC7E,CAAC;AAoED,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AAEjD;;GAEG;AACH,MAAM,OAAO,KAAK;IAEd;;OAEG;IACM,IAAI,CAAU;IAEvB;;OAEG;IACM,KAAK,CAAO;IAEZ,QAAQ,CAAM;IAEvB;;OAEG;IACM,YAAY,CAAU;IAE/B;;OAEG;IACH,YAAY,KAAU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AO,CAAC,KAAK;eACN,OAAM,CAAC,KAAK,CAAC,KAAK,QAAQ;eAC1B,cAAc,IAAI,KAAK;eACvB,KAAK,CAAC,YAAY,KAAK,YAAY,CAAC,CAAC;IAChD,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,WAAW,CAAI,KAAgB,EAAE,IAAY;QAChD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YACtB,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,EAAE;gBACrB,MAAM,IAAI,KAAK,CAAC,0BAA2B,IAAK,SAAU,KAAK,CAAC,IAAK,EAAE,CAAC,CAAC;aAC5E;YACD,OAAO,KAAK,CAAC,KAAK,CAAC;SACtB;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/address/address.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/address/address.d.ts deleted file mode 100644 index 581be4fc..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/address/address.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Returns a normalized and checksumed address for %%address%%. - * This accepts non-checksum addresses, checksum addresses and - * [[getIcapAddress]] formats. - * - * The checksum in Ethereum uses the capitalization (upper-case - * vs lower-case) of the characters within an address to encode - * its checksum, which offers, on average, a checksum of 15-bits. - * - * If %%address%% contains both upper-case and lower-case, it is - * assumed to already be a checksum address and its checksum is - * validated, and if the address fails its expected checksum an - * error is thrown. - * - * If you wish the checksum of %%address%% to be ignore, it should - * be converted to lower-case (i.e. ``.toLowercase()``) before - * being passed in. This should be a very rare situation though, - * that you wish to bypass the safegaurds in place to protect - * against an address that has been incorrectly copied from another - * source. - * - * @example: - * // Adds the checksum (via upper-casing specific letters) - * getAddress("0x8ba1f109551bd432803012645ac136ddd64dba72") - * //_result: - * - * // Converts ICAP address and adds checksum - * getAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36"); - * //_result: - * - * // Throws an error if an address contains mixed case, - * // but the checksum fails - * getAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72") - * //_error: - */ -export declare function getAddress(address: string): string; -/** - * The [ICAP Address format](link-icap) format is an early checksum - * format which attempts to be compatible with the banking - * industry [IBAN format](link-wiki-iban) for bank accounts. - * - * It is no longer common or a recommended format. - * - * @example: - * getIcapAddress("0x8ba1f109551bd432803012645ac136ddd64dba72"); - * //_result: - * - * getIcapAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36"); - * //_result: - * - * // Throws an error if the ICAP checksum is wrong - * getIcapAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK37"); - * //_error: - */ -export declare function getIcapAddress(address: string): string; -//# sourceMappingURL=address.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/address/address.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/address/address.d.ts.map deleted file mode 100644 index 9dec1887..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/address/address.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src.ts/address/address.ts"],"names":[],"mappings":"AAmFA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CA6BlD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAKtD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/address/address.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/address/address.js deleted file mode 100644 index 9c570648..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/address/address.js +++ /dev/null @@ -1,156 +0,0 @@ -import { keccak256 } from "../crypto/index.js"; -import { getBytes, assertArgument } from "../utils/index.js"; -const BN_0 = BigInt(0); -const BN_36 = BigInt(36); -function getChecksumAddress(address) { - // if (!isHexString(address, 20)) { - // logger.throwArgumentError("invalid address", "address", address); - // } - address = address.toLowerCase(); - const chars = address.substring(2).split(""); - const expanded = new Uint8Array(40); - for (let i = 0; i < 40; i++) { - expanded[i] = chars[i].charCodeAt(0); - } - const hashed = getBytes(keccak256(expanded)); - for (let i = 0; i < 40; i += 2) { - if ((hashed[i >> 1] >> 4) >= 8) { - chars[i] = chars[i].toUpperCase(); - } - if ((hashed[i >> 1] & 0x0f) >= 8) { - chars[i + 1] = chars[i + 1].toUpperCase(); - } - } - return "0x" + chars.join(""); -} -// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number -// Create lookup table -const ibanLookup = {}; -for (let i = 0; i < 10; i++) { - ibanLookup[String(i)] = String(i); -} -for (let i = 0; i < 26; i++) { - ibanLookup[String.fromCharCode(65 + i)] = String(10 + i); -} -// How many decimal digits can we process? (for 64-bit float, this is 15) -// i.e. Math.floor(Math.log10(Number.MAX_SAFE_INTEGER)); -const safeDigits = 15; -function ibanChecksum(address) { - address = address.toUpperCase(); - address = address.substring(4) + address.substring(0, 2) + "00"; - let expanded = address.split("").map((c) => { return ibanLookup[c]; }).join(""); - // Javascript can handle integers safely up to 15 (decimal) digits - while (expanded.length >= safeDigits) { - let block = expanded.substring(0, safeDigits); - expanded = parseInt(block, 10) % 97 + expanded.substring(block.length); - } - let checksum = String(98 - (parseInt(expanded, 10) % 97)); - while (checksum.length < 2) { - checksum = "0" + checksum; - } - return checksum; -} -; -const Base36 = (function () { - ; - const result = {}; - for (let i = 0; i < 36; i++) { - const key = "0123456789abcdefghijklmnopqrstuvwxyz"[i]; - result[key] = BigInt(i); - } - return result; -})(); -function fromBase36(value) { - value = value.toLowerCase(); - let result = BN_0; - for (let i = 0; i < value.length; i++) { - result = result * BN_36 + Base36[value[i]]; - } - return result; -} -/** - * Returns a normalized and checksumed address for %%address%%. - * This accepts non-checksum addresses, checksum addresses and - * [[getIcapAddress]] formats. - * - * The checksum in Ethereum uses the capitalization (upper-case - * vs lower-case) of the characters within an address to encode - * its checksum, which offers, on average, a checksum of 15-bits. - * - * If %%address%% contains both upper-case and lower-case, it is - * assumed to already be a checksum address and its checksum is - * validated, and if the address fails its expected checksum an - * error is thrown. - * - * If you wish the checksum of %%address%% to be ignore, it should - * be converted to lower-case (i.e. ``.toLowercase()``) before - * being passed in. This should be a very rare situation though, - * that you wish to bypass the safegaurds in place to protect - * against an address that has been incorrectly copied from another - * source. - * - * @example: - * // Adds the checksum (via upper-casing specific letters) - * getAddress("0x8ba1f109551bd432803012645ac136ddd64dba72") - * //_result: - * - * // Converts ICAP address and adds checksum - * getAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36"); - * //_result: - * - * // Throws an error if an address contains mixed case, - * // but the checksum fails - * getAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72") - * //_error: - */ -export function getAddress(address) { - assertArgument(typeof (address) === "string", "invalid address", "address", address); - if (address.match(/^(0x)?[0-9a-fA-F]{40}$/)) { - // Missing the 0x prefix - if (!address.startsWith("0x")) { - address = "0x" + address; - } - const result = getChecksumAddress(address); - // It is a checksummed address with a bad checksum - assertArgument(!address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) || result === address, "bad address checksum", "address", address); - return result; - } - // Maybe ICAP? (we only support direct mode) - if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) { - // It is an ICAP address with a bad checksum - assertArgument(address.substring(2, 4) === ibanChecksum(address), "bad icap checksum", "address", address); - let result = fromBase36(address.substring(4)).toString(16); - while (result.length < 40) { - result = "0" + result; - } - return getChecksumAddress("0x" + result); - } - assertArgument(false, "invalid address", "address", address); -} -/** - * The [ICAP Address format](link-icap) format is an early checksum - * format which attempts to be compatible with the banking - * industry [IBAN format](link-wiki-iban) for bank accounts. - * - * It is no longer common or a recommended format. - * - * @example: - * getIcapAddress("0x8ba1f109551bd432803012645ac136ddd64dba72"); - * //_result: - * - * getIcapAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36"); - * //_result: - * - * // Throws an error if the ICAP checksum is wrong - * getIcapAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK37"); - * //_error: - */ -export function getIcapAddress(address) { - //let base36 = _base16To36(getAddress(address).substring(2)).toUpperCase(); - let base36 = BigInt(getAddress(address)).toString(36).toUpperCase(); - while (base36.length < 30) { - base36 = "0" + base36; - } - return "XE" + ibanChecksum("XE00" + base36) + base36; -} -//# sourceMappingURL=address.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/address/address.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/address/address.js.map deleted file mode 100644 index 52ad0099..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/address/address.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"address.js","sourceRoot":"","sources":["../../src.ts/address/address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAG7D,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;AAEzB,SAAS,kBAAkB,CAAC,OAAe;IAC3C,sCAAsC;IACtC,2EAA2E;IAC3E,OAAO;IAEH,OAAO,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAEhC,MAAM,KAAK,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAE7C,MAAM,QAAQ,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;IACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE;QACzB,QAAQ,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAA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AO,CAAC,CAAC;QAE3G,IAAI,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAC3D,OAAO,MAAM,CAAC,MAAM,GAAG,EAAE,EAAE;YAAE,MAAM,GAAG,GAAG,GAAG,MAAM,CAAC;SAAE;QACrD,OAAQ,kBAAkB,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;KAC7C;IAED,cAAc,CAAC,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;AACjE,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,cAAc,CAAC,OAAe;IAC1C,2EAA2E;IAC3E,IAAI,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IACpE,OAAO,MAAM,CAAC,MAAM,GAAG,EAAE,EAAE;QAAE,MAAM,GAAG,GAAG,GAAG,MAAM,CAAC;KAAE;IACrD,OAAO,IAAI,GAAG,YAAY,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,MAAM,CAAC;AACzD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/address/checks.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/address/checks.d.ts deleted file mode 100644 index 24e781f8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/address/checks.d.ts +++ /dev/null @@ -1,81 +0,0 @@ -import type { Addressable, AddressLike, NameResolver } from "./index.js"; -/** - * Returns true if %%value%% is an object which implements the - * [[Addressable]] interface. - * - * @example: - * // Wallets and AbstractSigner sub-classes - * isAddressable(Wallet.createRandom()) - * //_result: - * - * // Contracts - * contract = new Contract("dai.tokens.ethers.eth", [ ], provider) - * isAddressable(contract) - * //_result: - */ -export declare function isAddressable(value: any): value is Addressable; -/** - * Returns true if %%value%% is a valid address. - * - * @example: - * // Valid address - * isAddress("0x8ba1f109551bD432803012645Ac136ddd64DBA72") - * //_result: - * - * // Valid ICAP address - * isAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36") - * //_result: - * - * // Invalid checksum - * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBa72") - * //_result: - * - * // Invalid ICAP checksum - * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72") - * //_result: - * - * // Not an address (an ENS name requires a provided and an - * // asynchronous API to access) - * isAddress("ricmoo.eth") - * //_result: - */ -export declare function isAddress(value: any): value is string; -/** - * Resolves to an address for the %%target%%, which may be any - * supported address type, an [[Addressable]] or a Promise which - * resolves to an address. - * - * If an ENS name is provided, but that name has not been correctly - * configured a [[UnconfiguredNameError]] is thrown. - * - * @example: - * addr = "0x6B175474E89094C44Da98b954EedeAC495271d0F" - * - * // Addresses are return synchronously - * resolveAddress(addr, provider) - * //_result: - * - * // Address promises are resolved asynchronously - * resolveAddress(Promise.resolve(addr)) - * //_result: - * - * // ENS names are resolved asynchronously - * resolveAddress("dai.tokens.ethers.eth", provider) - * //_result: - * - * // Addressable objects are resolved asynchronously - * contract = new Contract(addr, [ ]) - * resolveAddress(contract, provider) - * //_result: - * - * // Unconfigured ENS names reject - * resolveAddress("nothing-here.ricmoo.eth", provider) - * //_error: - * - * // ENS names require a NameResolver object passed in - * // (notice the provider was omitted) - * resolveAddress("nothing-here.ricmoo.eth") - * //_error: - */ -export declare function resolveAddress(target: AddressLike, resolver?: null | NameResolver): string | Promise; -//# sourceMappingURL=checks.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/address/checks.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/address/checks.d.ts.map deleted file mode 100644 index e2e020d1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/address/checks.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"checks.d.ts","sourceRoot":"","sources":["../../src.ts/address/checks.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAGzE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,WAAW,CAE9D;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,MAAM,CAMrD;AAWD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,YAAY,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAkB5G"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/address/checks.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/address/checks.js deleted file mode 100644 index c7e7d437..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/address/checks.js +++ /dev/null @@ -1,114 +0,0 @@ -import { assert, assertArgument } from "../utils/index.js"; -import { getAddress } from "./address.js"; -/** - * Returns true if %%value%% is an object which implements the - * [[Addressable]] interface. - * - * @example: - * // Wallets and AbstractSigner sub-classes - * isAddressable(Wallet.createRandom()) - * //_result: - * - * // Contracts - * contract = new Contract("dai.tokens.ethers.eth", [ ], provider) - * isAddressable(contract) - * //_result: - */ -export function isAddressable(value) { - return (value && typeof (value.getAddress) === "function"); -} -/** - * Returns true if %%value%% is a valid address. - * - * @example: - * // Valid address - * isAddress("0x8ba1f109551bD432803012645Ac136ddd64DBA72") - * //_result: - * - * // Valid ICAP address - * isAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36") - * //_result: - * - * // Invalid checksum - * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBa72") - * //_result: - * - * // Invalid ICAP checksum - * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72") - * //_result: - * - * // Not an address (an ENS name requires a provided and an - * // asynchronous API to access) - * isAddress("ricmoo.eth") - * //_result: - */ -export function isAddress(value) { - try { - getAddress(value); - return true; - } - catch (error) { } - return false; -} -async function checkAddress(target, promise) { - const result = await promise; - if (result == null || result === "0x0000000000000000000000000000000000000000") { - assert(typeof (target) !== "string", "unconfigured name", "UNCONFIGURED_NAME", { value: target }); - assertArgument(false, "invalid AddressLike value; did not resolve to a value address", "target", target); - } - return getAddress(result); -} -/** - * Resolves to an address for the %%target%%, which may be any - * supported address type, an [[Addressable]] or a Promise which - * resolves to an address. - * - * If an ENS name is provided, but that name has not been correctly - * configured a [[UnconfiguredNameError]] is thrown. - * - * @example: - * addr = "0x6B175474E89094C44Da98b954EedeAC495271d0F" - * - * // Addresses are return synchronously - * resolveAddress(addr, provider) - * //_result: - * - * // Address promises are resolved asynchronously - * resolveAddress(Promise.resolve(addr)) - * //_result: - * - * // ENS names are resolved asynchronously - * resolveAddress("dai.tokens.ethers.eth", provider) - * //_result: - * - * // Addressable objects are resolved asynchronously - * contract = new Contract(addr, [ ]) - * resolveAddress(contract, provider) - * //_result: - * - * // Unconfigured ENS names reject - * resolveAddress("nothing-here.ricmoo.eth", provider) - * //_error: - * - * // ENS names require a NameResolver object passed in - * // (notice the provider was omitted) - * resolveAddress("nothing-here.ricmoo.eth") - * //_error: - */ -export function resolveAddress(target, resolver) { - if (typeof (target) === "string") { - if (target.match(/^0x[0-9a-f]{40}$/i)) { - return getAddress(target); - } - assert(resolver != null, "ENS resolution requires a provider", "UNSUPPORTED_OPERATION", { operation: "resolveName" }); - return checkAddress(target, resolver.resolveName(target)); - } - else if (isAddressable(target)) { - return checkAddress(target, target.getAddress()); - } - else if (target && typeof (target.then) === "function") { - return checkAddress(target, target); - } - assertArgument(false, "unsupported addressable value", "target", target); -} -//# sourceMappingURL=checks.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/address/checks.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/address/checks.js.map deleted file mode 100644 index 9a6e6ecf..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/address/checks.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"checks.js","sourceRoot":"","sources":["../../src.ts/address/checks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1C;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,aAAa,CAAC,KAAU;IACpC,OAAO,CAAC,KAAK,IAAI,OAAM,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,UAAU,CAAC,CAAC;AAC9D,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,SAAS,CAAC,KAAU;IAChC,IAAI;QACA,UAAU,CAAC,KAAK,CAAC,CAAC;QAClB,OAAO,IAAI,CAAC;KACf;IAAC,OAAO,KAAK,EAAE,GAAG;IACnB,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,KAAK,UAAU,YAAY,CAAC,MAAW,EAAE,OAA+B;IACpE,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC;IAC7B,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,KAAK,4CAA4C,EAAE;QAC3E,MAAM,CAAC,OAAM,CAAC,MAAM,CAAC,KAAK,QAAQ,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;QACjG,cAAc,CAAC,KAAK,EAAE,+DAA+D,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;KAC5G;IACD,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC;AAC9B,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,UAAU,cAAc,CAAC,MAAmB,EAAE,QAA8B;IAE9E,IAAI,OAAM,CAAC,MAAM,CAAC,KAAK,QAAQ,EAAE;QAC7B,IAAI,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,EAAE;YAAE,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC;SAAE;QAErE,MAAM,CAAC,QAAQ,IAAI,IAAI,EAAE,oCAAoC,EACzD,uBAAuB,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC,CAAC;QAE3D,OAAO,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;KAE7D;SAAM,IAAI,aAAa,CAAC,MAAM,CAAC,EAAE;QAC9B,OAAO,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;KAEpD;SAAM,IAAI,MAAM,IAAI,OAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,UAAU,EAAE;QACrD,OAAO,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACvC;IAED,cAAc,CAAC,KAAK,EAAE,+BAA+B,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAC7E,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/address/contract-address.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/address/contract-address.d.ts deleted file mode 100644 index 42b36f7f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/address/contract-address.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -import type { BigNumberish, BytesLike } from "../utils/index.js"; -/** - * Returns the address that would result from a ``CREATE`` for %%tx%%. - * - * This can be used to compute the address a contract will be - * deployed to by an EOA when sending a deployment transaction (i.e. - * when the ``to`` address is ``null``). - * - * This can also be used to compute the address a contract will be - * deployed to by a contract, by using the contract's address as the - * ``to`` and the contract's nonce. - * - * @example - * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72"; - * nonce = 5; - * - * getCreateAddress({ from, nonce }); - * //_result: - */ -export declare function getCreateAddress(tx: { - from: string; - nonce: BigNumberish; -}): string; -/** - * Returns the address that would result from a ``CREATE2`` operation - * with the given %%from%%, %%salt%% and %%initCodeHash%%. - * - * To compute the %%initCodeHash%% from a contract's init code, use - * the [[keccak256]] function. - * - * For a quick overview and example of ``CREATE2``, see [[link-ricmoo-wisps]]. - * - * @example - * // The address of the contract - * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72" - * - * // The salt - * salt = id("HelloWorld") - * - * // The hash of the initCode - * initCode = "0x6394198df16000526103ff60206004601c335afa6040516060f3"; - * initCodeHash = keccak256(initCode) - * - * getCreate2Address(from, salt, initCodeHash) - * //_result: - */ -export declare function getCreate2Address(_from: string, _salt: BytesLike, _initCodeHash: BytesLike): string; -//# sourceMappingURL=contract-address.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/address/contract-address.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/address/contract-address.d.ts.map deleted file mode 100644 index 624f8426..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/address/contract-address.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contract-address.d.ts","sourceRoot":"","sources":["../../src.ts/address/contract-address.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAKjE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,YAAY,CAAA;CAAE,GAAG,MAAM,CAclF;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,GAAG,MAAM,CAUnG"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/address/contract-address.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/address/contract-address.js deleted file mode 100644 index e0f85489..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/address/contract-address.js +++ /dev/null @@ -1,69 +0,0 @@ -import { keccak256 } from "../crypto/index.js"; -import { concat, dataSlice, getBigInt, getBytes, encodeRlp, assertArgument } from "../utils/index.js"; -import { getAddress } from "./address.js"; -// http://ethereum.stackexchange.com/questions/760/how-is-the-address-of-an-ethereum-contract-computed -/** - * Returns the address that would result from a ``CREATE`` for %%tx%%. - * - * This can be used to compute the address a contract will be - * deployed to by an EOA when sending a deployment transaction (i.e. - * when the ``to`` address is ``null``). - * - * This can also be used to compute the address a contract will be - * deployed to by a contract, by using the contract's address as the - * ``to`` and the contract's nonce. - * - * @example - * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72"; - * nonce = 5; - * - * getCreateAddress({ from, nonce }); - * //_result: - */ -export function getCreateAddress(tx) { - const from = getAddress(tx.from); - const nonce = getBigInt(tx.nonce, "tx.nonce"); - let nonceHex = nonce.toString(16); - if (nonceHex === "0") { - nonceHex = "0x"; - } - else if (nonceHex.length % 2) { - nonceHex = "0x0" + nonceHex; - } - else { - nonceHex = "0x" + nonceHex; - } - return getAddress(dataSlice(keccak256(encodeRlp([from, nonceHex])), 12)); -} -/** - * Returns the address that would result from a ``CREATE2`` operation - * with the given %%from%%, %%salt%% and %%initCodeHash%%. - * - * To compute the %%initCodeHash%% from a contract's init code, use - * the [[keccak256]] function. - * - * For a quick overview and example of ``CREATE2``, see [[link-ricmoo-wisps]]. - * - * @example - * // The address of the contract - * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72" - * - * // The salt - * salt = id("HelloWorld") - * - * // The hash of the initCode - * initCode = "0x6394198df16000526103ff60206004601c335afa6040516060f3"; - * initCodeHash = keccak256(initCode) - * - * getCreate2Address(from, salt, initCodeHash) - * //_result: - */ -export function getCreate2Address(_from, _salt, _initCodeHash) { - const from = getAddress(_from); - const salt = getBytes(_salt, "salt"); - const initCodeHash = getBytes(_initCodeHash, "initCodeHash"); - assertArgument(salt.length === 32, "salt must be 32 bytes", "salt", _salt); - assertArgument(initCodeHash.length === 32, "initCodeHash must be 32 bytes", "initCodeHash", _initCodeHash); - return getAddress(dataSlice(keccak256(concat(["0xff", from, salt, initCodeHash])), 12)); -} -//# sourceMappingURL=contract-address.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/address/contract-address.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/address/contract-address.js.map deleted file mode 100644 index 7a9c2838..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/address/contract-address.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contract-address.js","sourceRoot":"","sources":["../../src.ts/address/contract-address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EACH,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,cAAc,EACpE,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1C,sGAAsG;AAEtG;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAAyC;IACtE,MAAM,IAAI,GAAG,UAAU,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IACjC,MAAM,KAAK,GAAG,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;IAE9C,IAAI,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAClC,IAAI,QAAQ,KAAK,GAAG,EAAE;QAClB,QAAQ,GAAG,IAAI,CAAC;KACnB;SAAM,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;QAC5B,QAAQ,GAAG,KAAK,GAAG,QAAQ,CAAC;KAC/B;SAAM;QACH,QAAQ,GAAG,IAAI,GAAG,QAAQ,CAAC;KAC9B;IAED,OAAO,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,CAAE,IAAI,EAAE,QAAQ,CAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/E,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAa,EAAE,KAAgB,EAAE,aAAwB;IACvF,MAAM,IAAI,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IAC/B,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,MAAM,YAAY,GAAG,QAAQ,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;IAE7D,cAAc,CAAC,IAAI,CAAC,MAAM,KAAK,EAAE,EAAE,uBAAuB,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAE3E,cAAc,CAAC,YAAY,CAAC,MAAM,KAAK,EAAE,EAAE,+BAA+B,EAAE,cAAc,EAAE,aAAa,CAAC,CAAC;IAE3G,OAAO,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,CAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,CAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;AAC7F,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/address/index.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/address/index.d.ts deleted file mode 100644 index c813ab83..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/address/index.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Addresses are a fundamental part of interacting with Ethereum. They - * represent the global identity of Externally Owned Accounts (accounts - * backed by a private key) and contracts. - * - * The Ethereum Naming Service (ENS) provides an interconnected ecosystem - * of contracts, standards and libraries which enable looking up an - * address for an ENS name. - * - * These functions help convert between various formats, validate - * addresses and safely resolve ENS names. - * - * @_section: api/address:Addresses [about-addresses] - */ -/** - * An interface for objects which have an address, and can - * resolve it asyncronously. - * - * This allows objects such as [[Signer]] or [[Contract]] to - * be used most places an address can be, for example getting - * the [balance](Provider-getBalance). - */ -export interface Addressable { - /** - * Get the object address. - */ - getAddress(): Promise; -} -/** - * Anything that can be used to return or resolve an address. - */ -export type AddressLike = string | Promise | Addressable; -/** - * An interface for any object which can resolve an ENS name. - */ -export interface NameResolver { - /** - * Resolve to the address for the ENS %%name%%. - * - * Resolves to ``null`` if the name is unconfigued. Use - * [[resolveAddress]] (passing this object as %%resolver%%) to - * throw for names that are unconfigured. - */ - resolveName(name: string): Promise; -} -export { getAddress, getIcapAddress } from "./address.js"; -export { getCreateAddress, getCreate2Address } from "./contract-address.js"; -export { isAddressable, isAddress, resolveAddress } from "./checks.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/address/index.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/address/index.d.ts.map deleted file mode 100644 index 87b489ff..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/address/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/address/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IACxB;;OAEG;IACH,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB;;;;;;OAMG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;CACrD;AAED,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE1D,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG5E,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/address/index.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/address/index.js deleted file mode 100644 index 68e35995..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/address/index.js +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Addresses are a fundamental part of interacting with Ethereum. They - * represent the global identity of Externally Owned Accounts (accounts - * backed by a private key) and contracts. - * - * The Ethereum Naming Service (ENS) provides an interconnected ecosystem - * of contracts, standards and libraries which enable looking up an - * address for an ENS name. - * - * These functions help convert between various formats, validate - * addresses and safely resolve ENS names. - * - * @_section: api/address:Addresses [about-addresses] - */ -null; -export { getAddress, getIcapAddress } from "./address.js"; -export { getCreateAddress, getCreate2Address } from "./contract-address.js"; -export { isAddressable, isAddress, resolveAddress } from "./checks.js"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/address/index.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/address/index.js.map deleted file mode 100644 index f983b930..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/address/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/address/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,IAAI,CAAC;AAoCL,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE1D,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG5E,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/addresses.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/addresses.d.ts deleted file mode 100644 index a32d6be0..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/addresses.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * A constant for the zero address. - * - * (**i.e.** ``"0x0000000000000000000000000000000000000000"``) - */ -export declare const ZeroAddress: string; -//# sourceMappingURL=addresses.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/addresses.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/addresses.d.ts.map deleted file mode 100644 index 35a5c221..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/addresses.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"addresses.d.ts","sourceRoot":"","sources":["../../src.ts/constants/addresses.ts"],"names":[],"mappings":"AACA;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,MAAqD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/addresses.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/addresses.js deleted file mode 100644 index 45345cb6..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/addresses.js +++ /dev/null @@ -1,7 +0,0 @@ -/** - * A constant for the zero address. - * - * (**i.e.** ``"0x0000000000000000000000000000000000000000"``) - */ -export const ZeroAddress = "0x0000000000000000000000000000000000000000"; -//# sourceMappingURL=addresses.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/addresses.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/addresses.js.map deleted file mode 100644 index 9fb48ce8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/addresses.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"addresses.js","sourceRoot":"","sources":["../../src.ts/constants/addresses.ts"],"names":[],"mappings":"AACA;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAW,4CAA4C,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/hashes.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/hashes.d.ts deleted file mode 100644 index 784df715..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/hashes.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * A constant for the zero hash. - * - * (**i.e.** ``"0x0000000000000000000000000000000000000000000000000000000000000000"``) - */ -export declare const ZeroHash: string; -//# sourceMappingURL=hashes.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/hashes.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/hashes.d.ts.map deleted file mode 100644 index 23f5213c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/hashes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hashes.d.ts","sourceRoot":"","sources":["../../src.ts/constants/hashes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,MAA6E,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/hashes.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/hashes.js deleted file mode 100644 index 95bca98a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/hashes.js +++ /dev/null @@ -1,7 +0,0 @@ -/** - * A constant for the zero hash. - * - * (**i.e.** ``"0x0000000000000000000000000000000000000000000000000000000000000000"``) - */ -export const ZeroHash = "0x0000000000000000000000000000000000000000000000000000000000000000"; -//# sourceMappingURL=hashes.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/hashes.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/hashes.js.map deleted file mode 100644 index b198ca1b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/hashes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hashes.js","sourceRoot":"","sources":["../../src.ts/constants/hashes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAW,oEAAoE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/index.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/index.d.ts deleted file mode 100644 index fa4e9e7a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Some common constants useful for Ethereum. - * - * @_section: api/constants: Constants [about-constants] - */ -export { ZeroAddress } from "./addresses.js"; -export { ZeroHash } from "./hashes.js"; -export { N, WeiPerEther, MaxUint256, MinInt256, MaxInt256 } from "./numbers.js"; -export { EtherSymbol, MessagePrefix } from "./strings.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/index.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/index.d.ts.map deleted file mode 100644 index 4df7cd4c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/constants/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACH,CAAC,EACD,WAAW,EACX,UAAU,EACV,SAAS,EACT,SAAS,EACZ,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/index.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/index.js deleted file mode 100644 index 98941803..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/index.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Some common constants useful for Ethereum. - * - * @_section: api/constants: Constants [about-constants] - */ -export { ZeroAddress } from "./addresses.js"; -export { ZeroHash } from "./hashes.js"; -export { N, WeiPerEther, MaxUint256, MinInt256, MaxInt256 } from "./numbers.js"; -export { EtherSymbol, MessagePrefix } from "./strings.js"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/index.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/index.js.map deleted file mode 100644 index e5b985f1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/constants/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACH,CAAC,EACD,WAAW,EACX,UAAU,EACV,SAAS,EACT,SAAS,EACZ,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/numbers.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/numbers.d.ts deleted file mode 100644 index 7c84eaa6..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/numbers.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * A constant for the order N for the secp256k1 curve. - * - * (**i.e.** ``0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n``) - */ -export declare const N: bigint; -/** - * A constant for the number of wei in a single ether. - * - * (**i.e.** ``1000000000000000000n``) - */ -export declare const WeiPerEther: bigint; -/** - * A constant for the maximum value for a ``uint256``. - * - * (**i.e.** ``0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) - */ -export declare const MaxUint256: bigint; -/** - * A constant for the minimum value for an ``int256``. - * - * (**i.e.** ``-8000000000000000000000000000000000000000000000000000000000000000n``) - */ -export declare const MinInt256: bigint; -/** - * A constant for the maximum value for an ``int256``. - * - * (**i.e.** ``0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) - */ -export declare const MaxInt256: bigint; -//# sourceMappingURL=numbers.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/numbers.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/numbers.d.ts.map deleted file mode 100644 index 6391e1fd..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/numbers.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"numbers.d.ts","sourceRoot":"","sources":["../../src.ts/constants/numbers.ts"],"names":[],"mappings":"AACA;;;;GAIG;AACH,eAAO,MAAM,CAAC,EAAE,MAAqF,CAAC;AAEtG;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,MAAsC,CAAC;AAEjE;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,MAAqF,CAAC;AAE/G;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,MAAkG,CAAC;AAE3H;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,MAAqF,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/numbers.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/numbers.js deleted file mode 100644 index 753e9fb9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/numbers.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - * A constant for the order N for the secp256k1 curve. - * - * (**i.e.** ``0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n``) - */ -export const N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); -/** - * A constant for the number of wei in a single ether. - * - * (**i.e.** ``1000000000000000000n``) - */ -export const WeiPerEther = BigInt("1000000000000000000"); -/** - * A constant for the maximum value for a ``uint256``. - * - * (**i.e.** ``0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) - */ -export const MaxUint256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); -/** - * A constant for the minimum value for an ``int256``. - * - * (**i.e.** ``-8000000000000000000000000000000000000000000000000000000000000000n``) - */ -export const MinInt256 = BigInt("0x8000000000000000000000000000000000000000000000000000000000000000") * BigInt(-1); -/** - * A constant for the maximum value for an ``int256``. - * - * (**i.e.** ``0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) - */ -export const MaxInt256 = BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); -//# sourceMappingURL=numbers.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/numbers.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/numbers.js.map deleted file mode 100644 index 8e868180..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/numbers.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"numbers.js","sourceRoot":"","sources":["../../src.ts/constants/numbers.ts"],"names":[],"mappings":"AACA;;;;GAIG;AACH,MAAM,CAAC,MAAM,CAAC,GAAW,MAAM,CAAC,oEAAoE,CAAC,CAAC;AAEtG;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAW,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAEjE;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAW,MAAM,CAAC,oEAAoE,CAAC,CAAC;AAE/G;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAW,MAAM,CAAC,oEAAoE,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAE3H;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAW,MAAM,CAAC,oEAAoE,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/strings.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/strings.d.ts deleted file mode 100644 index 0ad1c868..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/strings.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * A constant for the ether symbol (normalized using NFKC). - * - * (**i.e.** ``"\\u039e"``) - */ -export declare const EtherSymbol: string; -/** - * A constant for the [[link-eip-191]] personal message prefix. - * - * (**i.e.** ``"\\x19Ethereum Signed Message:\\n"``) - */ -export declare const MessagePrefix: string; -//# sourceMappingURL=strings.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/strings.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/strings.d.ts.map deleted file mode 100644 index b911a56b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/strings.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../../src.ts/constants/strings.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,MAAiB,CAAC;AAG5C;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,MAAyC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/strings.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/strings.js deleted file mode 100644 index 921e0e49..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/strings.js +++ /dev/null @@ -1,14 +0,0 @@ -// NFKC (composed) // (decomposed) -/** - * A constant for the ether symbol (normalized using NFKC). - * - * (**i.e.** ``"\\u039e"``) - */ -export const EtherSymbol = "\u039e"; // "\uD835\uDF63"; -/** - * A constant for the [[link-eip-191]] personal message prefix. - * - * (**i.e.** ``"\\x19Ethereum Signed Message:\\n"``) - */ -export const MessagePrefix = "\x19Ethereum Signed Message:\n"; -//# sourceMappingURL=strings.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/strings.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/strings.js.map deleted file mode 100644 index f9c79a90..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/constants/strings.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"strings.js","sourceRoot":"","sources":["../../src.ts/constants/strings.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAE9C;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAW,QAAQ,CAAC,CAAE,kBAAkB;AAGhE;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAW,gCAAgC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/contract.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/contract.d.ts deleted file mode 100644 index 13031522..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/contract.d.ts +++ /dev/null @@ -1,168 +0,0 @@ -import { Interface } from "../abi/index.js"; -import { Log, TransactionResponse } from "../providers/provider.js"; -import { ContractTransactionResponse, EventLog } from "./wrappers.js"; -import type { EventFragment, FunctionFragment, InterfaceAbi, ParamType } from "../abi/index.js"; -import type { Addressable } from "../address/index.js"; -import type { EventEmitterable, Listener } from "../utils/index.js"; -import type { BlockTag, ContractRunner } from "../providers/index.js"; -import type { ContractEventName, ContractInterface, ContractMethod, ContractEvent, ContractTransaction, WrappedFallback } from "./types.js"; -/** - * @_ignore: - */ -export declare function copyOverrides(arg: any, allowed?: Array): Promise>; -/** - * @_ignore: - */ -export declare function resolveArgs(_runner: null | ContractRunner, inputs: ReadonlyArray, args: Array): Promise>; -declare const internal: unique symbol; -export declare class BaseContract implements Addressable, EventEmitterable { - /** - * The target to connect to. - * - * This can be an address, ENS name or any [[Addressable]], such as - * another contract. To get the resolved address, use the ``getAddress`` - * method. - */ - readonly target: string | Addressable; - /** - * The contract Interface. - */ - readonly interface: Interface; - /** - * The connected runner. This is generally a [[Provider]] or a - * [[Signer]], which dictates what operations are supported. - * - * For example, a **Contract** connected to a [[Provider]] may - * only execute read-only operations. - */ - readonly runner: null | ContractRunner; - /** - * All the Events available on this contract. - */ - readonly filters: Record; - /** - * @_ignore: - */ - readonly [internal]: any; - /** - * The fallback or receive function if any. - */ - readonly fallback: null | WrappedFallback; - /** - * Creates a new contract connected to %%target%% with the %%abi%% and - * optionally connected to a %%runner%% to perform operations on behalf - * of. - */ - constructor(target: string | Addressable, abi: Interface | InterfaceAbi, runner?: null | ContractRunner, _deployTx?: null | TransactionResponse); - /** - * Return a new Contract instance with the same target and ABI, but - * a different %%runner%%. - */ - connect(runner: null | ContractRunner): BaseContract; - /** - * Return a new Contract instance with the same ABI and runner, but - * a different %%target%%. - */ - attach(target: string | Addressable): BaseContract; - /** - * Return the resolved address of this Contract. - */ - getAddress(): Promise; - /** - * Return the deployed bytecode or null if no bytecode is found. - */ - getDeployedCode(): Promise; - /** - * Resolve to this Contract once the bytecode has been deployed, or - * resolve immediately if already deployed. - */ - waitForDeployment(): Promise; - /** - * Return the transaction used to deploy this contract. - * - * This is only available if this instance was returned from a - * [[ContractFactory]]. - */ - deploymentTransaction(): null | ContractTransactionResponse; - /** - * Return the function for a given name. This is useful when a contract - * method name conflicts with a JavaScript name such as ``prototype`` or - * when using a Contract programmatically. - */ - getFunction(key: string | FunctionFragment): T; - /** - * Return the event for a given name. This is useful when a contract - * event name conflicts with a JavaScript name such as ``prototype`` or - * when using a Contract programmatically. - */ - getEvent(key: string | EventFragment): ContractEvent; - /** - * @_ignore: - */ - queryTransaction(hash: string): Promise>; - /** - * Provide historic access to event data for %%event%% in the range - * %%fromBlock%% (default: ``0``) to %%toBlock%% (default: ``"latest"``) - * inclusive. - */ - queryFilter(event: ContractEventName, fromBlock?: BlockTag, toBlock?: BlockTag): Promise>; - /** - * Add an event %%listener%% for the %%event%%. - */ - on(event: ContractEventName, listener: Listener): Promise; - /** - * Add an event %%listener%% for the %%event%%, but remove the listener - * after it is fired once. - */ - once(event: ContractEventName, listener: Listener): Promise; - /** - * Emit an %%event%% calling all listeners with %%args%%. - * - * Resolves to ``true`` if any listeners were called. - */ - emit(event: ContractEventName, ...args: Array): Promise; - /** - * Resolves to the number of listeners of %%event%% or the total number - * of listeners if unspecified. - */ - listenerCount(event?: ContractEventName): Promise; - /** - * Resolves to the listeners subscribed to %%event%% or all listeners - * if unspecified. - */ - listeners(event?: ContractEventName): Promise>; - /** - * Remove the %%listener%% from the listeners for %%event%% or remove - * all listeners if unspecified. - */ - off(event: ContractEventName, listener?: Listener): Promise; - /** - * Remove all the listeners for %%event%% or remove all listeners if - * unspecified. - */ - removeAllListeners(event?: ContractEventName): Promise; - /** - * Alias for [on]. - */ - addListener(event: ContractEventName, listener: Listener): Promise; - /** - * Alias for [off]. - */ - removeListener(event: ContractEventName, listener: Listener): Promise; - /** - * Create a new Class for the %%abi%%. - */ - static buildClass(abi: Interface | InterfaceAbi): new (target: string, runner?: null | ContractRunner) => BaseContract & Omit; - /** - * Create a new BaseContract with a specified Interface. - */ - static from(target: string, abi: Interface | InterfaceAbi, runner?: null | ContractRunner): BaseContract & Omit; -} -declare const Contract_base: new (target: string | Addressable, abi: Interface | InterfaceAbi, runner?: ContractRunner | null | undefined) => BaseContract & Omit; -/** - * A [[BaseContract]] with no type guards on its methods or events. - */ -export declare class Contract extends Contract_base { -} -export {}; -//# sourceMappingURL=contract.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/contract.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/contract.d.ts.map deleted file mode 100644 index 57f47f54..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/contract.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src.ts/contract/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAS,MAAM,iBAAiB,CAAC;AAInD,OAAO,EAAe,GAAG,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAMjF,OAAO,EAEH,2BAA2B,EAC3B,QAAQ,EACX,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,YAAY,EAAE,SAAS,EAAU,MAAM,iBAAiB,CAAC;AACxG,OAAO,KAAK,EAAE,WAAW,EAAgB,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EACR,QAAQ,EAAE,cAAc,EAC3B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAER,iBAAiB,EACjB,iBAAiB,EAEjB,cAAc,EAEd,aAAa,EACb,mBAAmB,EAEnB,eAAe,EAClB,MAAM,YAAY,CAAC;AAwGpB;;GAEG;AACH,wBAAsB,aAAa,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC,CAkB9I;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,IAAI,GAAG,cAAc,EAAE,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAA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;;OAEG;IACG,cAAc,CAAC,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjF;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,iBAAiB,EAAE,GAAG,EAAE,SAAS,GAAG,YAAY,GAAG,KAAK,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,cAAc,KAAK,YAAY,GAAG,IAAI,CAAC,CAAC,EAAE,MAAM,YAAY,CAAC;IAS3K;;OAEG;IACH,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,iBAAiB,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,GAAG,YAAY,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,cAAc,GAAG,YAAY,GAAG,IAAI,CAAC,CAAC,EAAE,MAAM,YAAY,CAAC;CAKhK;;AAMD;;GAEG;AACH,qBAAa,QAAS,SAAQ,aAAe;CAAI"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/contract.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/contract.js deleted file mode 100644 index 655d639d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/contract.js +++ /dev/null @@ -1,953 +0,0 @@ -import { Interface, Typed } from "../abi/index.js"; -import { isAddressable, resolveAddress } from "../address/index.js"; -// import from provider.ts instead of index.ts to prevent circular dep -// from EtherscanProvider -import { copyRequest, Log } from "../providers/provider.js"; -import { defineProperties, getBigInt, isCallException, isHexString, resolveProperties, isError, makeError, assert, assertArgument } from "../utils/index.js"; -import { ContractEventPayload, ContractUnknownEventPayload, ContractTransactionResponse, EventLog, UndecodedEventLog } from "./wrappers.js"; -const BN_0 = BigInt(0); -function canCall(value) { - return (value && typeof (value.call) === "function"); -} -function canEstimate(value) { - return (value && typeof (value.estimateGas) === "function"); -} -function canResolve(value) { - return (value && typeof (value.resolveName) === "function"); -} -function canSend(value) { - return (value && typeof (value.sendTransaction) === "function"); -} -function getResolver(value) { - if (value != null) { - if (canResolve(value)) { - return value; - } - if (value.provider) { - return value.provider; - } - } - return undefined; -} -class PreparedTopicFilter { - #filter; - fragment; - constructor(contract, fragment, args) { - defineProperties(this, { fragment }); - if (fragment.inputs.length < args.length) { - throw new Error("too many arguments"); - } - // Recursively descend into args and resolve any addresses - const runner = getRunner(contract.runner, "resolveName"); - const resolver = canResolve(runner) ? runner : null; - this.#filter = (async function () { - const resolvedArgs = await Promise.all(fragment.inputs.map((param, index) => { - const arg = args[index]; - if (arg == null) { - return null; - } - return param.walkAsync(args[index], (type, value) => { - if (type === "address") { - if (Array.isArray(value)) { - return Promise.all(value.map((v) => resolveAddress(v, resolver))); - } - return resolveAddress(value, resolver); - } - return value; - }); - })); - return contract.interface.encodeFilterTopics(fragment, resolvedArgs); - })(); - } - getTopicFilter() { - return this.#filter; - } -} -// A = Arguments passed in as a tuple -// R = The result type of the call (i.e. if only one return type, -// the qualified type, otherwise Result) -// D = The type the default call will return (i.e. R for view/pure, -// TransactionResponse otherwise) -//export interface ContractMethod = Array, R = any, D extends R | ContractTransactionResponse = ContractTransactionResponse> { -function getRunner(value, feature) { - if (value == null) { - return null; - } - if (typeof (value[feature]) === "function") { - return value; - } - if (value.provider && typeof (value.provider[feature]) === "function") { - return value.provider; - } - return null; -} -function getProvider(value) { - if (value == null) { - return null; - } - return value.provider || null; -} -/** - * @_ignore: - */ -export async function copyOverrides(arg, allowed) { - // Make sure the overrides passed in are a valid overrides object - const _overrides = Typed.dereference(arg, "overrides"); - assertArgument(typeof (_overrides) === "object", "invalid overrides parameter", "overrides", arg); - // Create a shallow copy (we'll deep-ify anything needed during normalizing) - const overrides = copyRequest(_overrides); - assertArgument(overrides.to == null || (allowed || []).indexOf("to") >= 0, "cannot override to", "overrides.to", overrides.to); - assertArgument(overrides.data == null || (allowed || []).indexOf("data") >= 0, "cannot override data", "overrides.data", overrides.data); - // Resolve any from - if (overrides.from) { - overrides.from = overrides.from; - } - return overrides; -} -/** - * @_ignore: - */ -export async function resolveArgs(_runner, inputs, args) { - // Recursively descend into args and resolve any addresses - const runner = getRunner(_runner, "resolveName"); - const resolver = canResolve(runner) ? runner : null; - return await Promise.all(inputs.map((param, index) => { - return param.walkAsync(args[index], (type, value) => { - value = Typed.dereference(value, type); - if (type === "address") { - return resolveAddress(value, resolver); - } - return value; - }); - })); -} -function buildWrappedFallback(contract) { - const populateTransaction = async function (overrides) { - // If an overrides was passed in, copy it and normalize the values - const tx = (await copyOverrides(overrides, ["data"])); - tx.to = await contract.getAddress(); - if (tx.from) { - tx.from = await resolveAddress(tx.from, getResolver(contract.runner)); - } - const iface = contract.interface; - const noValue = (getBigInt((tx.value || BN_0), "overrides.value") === BN_0); - const noData = ((tx.data || "0x") === "0x"); - if (iface.fallback && !iface.fallback.payable && iface.receive && !noData && !noValue) { - assertArgument(false, "cannot send data to receive or send value to non-payable fallback", "overrides", overrides); - } - assertArgument(iface.fallback || noData, "cannot send data to receive-only contract", "overrides.data", tx.data); - // Only allow payable contracts to set non-zero value - const payable = iface.receive || (iface.fallback && iface.fallback.payable); - assertArgument(payable || noValue, "cannot send value to non-payable fallback", "overrides.value", tx.value); - // Only allow fallback contracts to set non-empty data - assertArgument(iface.fallback || noData, "cannot send data to receive-only contract", "overrides.data", tx.data); - return tx; - }; - const staticCall = async function (overrides) { - const runner = getRunner(contract.runner, "call"); - assert(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" }); - const tx = await populateTransaction(overrides); - try { - return await runner.call(tx); - } - catch (error) { - if (isCallException(error) && error.data) { - throw contract.interface.makeError(error.data, tx); - } - throw error; - } - }; - const send = async function (overrides) { - const runner = contract.runner; - assert(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" }); - const tx = await runner.sendTransaction(await populateTransaction(overrides)); - const provider = getProvider(contract.runner); - // @TODO: the provider can be null; make a custom dummy provider that will throw a - // meaningful error - return new ContractTransactionResponse(contract.interface, provider, tx); - }; - const estimateGas = async function (overrides) { - const runner = getRunner(contract.runner, "estimateGas"); - assert(canEstimate(runner), "contract runner does not support gas estimation", "UNSUPPORTED_OPERATION", { operation: "estimateGas" }); - return await runner.estimateGas(await populateTransaction(overrides)); - }; - const method = async (overrides) => { - return await send(overrides); - }; - defineProperties(method, { - _contract: contract, - estimateGas, - populateTransaction, - send, staticCall - }); - return method; -} -function buildWrappedMethod(contract, key) { - const getFragment = function (...args) { - const fragment = contract.interface.getFunction(key, args); - assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", { - operation: "fragment", - info: { key, args } - }); - return fragment; - }; - const populateTransaction = async function (...args) { - const fragment = getFragment(...args); - // If an overrides was passed in, copy it and normalize the values - let overrides = {}; - if (fragment.inputs.length + 1 === args.length) { - overrides = await copyOverrides(args.pop()); - if (overrides.from) { - overrides.from = await resolveAddress(overrides.from, getResolver(contract.runner)); - } - } - if (fragment.inputs.length !== args.length) { - throw new Error("internal error: fragment inputs doesn't match arguments; should not happen"); - } - const resolvedArgs = await resolveArgs(contract.runner, fragment.inputs, args); - return Object.assign({}, overrides, await resolveProperties({ - to: contract.getAddress(), - data: contract.interface.encodeFunctionData(fragment, resolvedArgs) - })); - }; - const staticCall = async function (...args) { - const result = await staticCallResult(...args); - if (result.length === 1) { - return result[0]; - } - return result; - }; - const send = async function (...args) { - const runner = contract.runner; - assert(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" }); - const tx = await runner.sendTransaction(await populateTransaction(...args)); - const provider = getProvider(contract.runner); - // @TODO: the provider can be null; make a custom dummy provider that will throw a - // meaningful error - return new ContractTransactionResponse(contract.interface, provider, tx); - }; - const estimateGas = async function (...args) { - const runner = getRunner(contract.runner, "estimateGas"); - assert(canEstimate(runner), "contract runner does not support gas estimation", "UNSUPPORTED_OPERATION", { operation: "estimateGas" }); - return await runner.estimateGas(await populateTransaction(...args)); - }; - const staticCallResult = async function (...args) { - const runner = getRunner(contract.runner, "call"); - assert(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" }); - const tx = await populateTransaction(...args); - let result = "0x"; - try { - result = await runner.call(tx); - } - catch (error) { - if (isCallException(error) && error.data) { - throw contract.interface.makeError(error.data, tx); - } - throw error; - } - const fragment = getFragment(...args); - return contract.interface.decodeFunctionResult(fragment, result); - }; - const method = async (...args) => { - const fragment = getFragment(...args); - if (fragment.constant) { - return await staticCall(...args); - } - return await send(...args); - }; - defineProperties(method, { - name: contract.interface.getFunctionName(key), - _contract: contract, _key: key, - getFragment, - estimateGas, - populateTransaction, - send, staticCall, staticCallResult, - }); - // Only works on non-ambiguous keys (refined fragment is always non-ambiguous) - Object.defineProperty(method, "fragment", { - configurable: false, - enumerable: true, - get: () => { - const fragment = contract.interface.getFunction(key); - assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", { - operation: "fragment", - info: { key } - }); - return fragment; - } - }); - return method; -} -function buildWrappedEvent(contract, key) { - const getFragment = function (...args) { - const fragment = contract.interface.getEvent(key, args); - assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", { - operation: "fragment", - info: { key, args } - }); - return fragment; - }; - const method = function (...args) { - return new PreparedTopicFilter(contract, getFragment(...args), args); - }; - defineProperties(method, { - name: contract.interface.getEventName(key), - _contract: contract, _key: key, - getFragment - }); - // Only works on non-ambiguous keys (refined fragment is always non-ambiguous) - Object.defineProperty(method, "fragment", { - configurable: false, - enumerable: true, - get: () => { - const fragment = contract.interface.getEvent(key); - assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", { - operation: "fragment", - info: { key } - }); - return fragment; - } - }); - return method; -} -// The combination of TypeScrype, Private Fields and Proxies makes -// the world go boom; so we hide variables with some trickery keeping -// a symbol attached to each BaseContract which its sub-class (even -// via a Proxy) can reach and use to look up its internal values. -const internal = Symbol.for("_ethersInternal_contract"); -const internalValues = new WeakMap(); -function setInternal(contract, values) { - internalValues.set(contract[internal], values); -} -function getInternal(contract) { - return internalValues.get(contract[internal]); -} -function isDeferred(value) { - return (value && typeof (value) === "object" && ("getTopicFilter" in value) && - (typeof (value.getTopicFilter) === "function") && value.fragment); -} -async function getSubInfo(contract, event) { - let topics; - let fragment = null; - // Convert named events to topicHash and get the fragment for - // events which need deconstructing. - if (Array.isArray(event)) { - const topicHashify = function (name) { - if (isHexString(name, 32)) { - return name; - } - const fragment = contract.interface.getEvent(name); - assertArgument(fragment, "unknown fragment", "name", name); - return fragment.topicHash; - }; - // Array of Topics and Names; e.g. `[ "0x1234...89ab", "Transfer(address)" ]` - topics = event.map((e) => { - if (e == null) { - return null; - } - if (Array.isArray(e)) { - return e.map(topicHashify); - } - return topicHashify(e); - }); - } - else if (event === "*") { - topics = [null]; - } - else if (typeof (event) === "string") { - if (isHexString(event, 32)) { - // Topic Hash - topics = [event]; - } - else { - // Name or Signature; e.g. `"Transfer", `"Transfer(address)"` - fragment = contract.interface.getEvent(event); - assertArgument(fragment, "unknown fragment", "event", event); - topics = [fragment.topicHash]; - } - } - else if (isDeferred(event)) { - // Deferred Topic Filter; e.g. `contract.filter.Transfer(from)` - topics = await event.getTopicFilter(); - } - else if ("fragment" in event) { - // ContractEvent; e.g. `contract.filter.Transfer` - fragment = event.fragment; - topics = [fragment.topicHash]; - } - else { - assertArgument(false, "unknown event name", "event", event); - } - // Normalize topics and sort TopicSets - topics = topics.map((t) => { - if (t == null) { - return null; - } - if (Array.isArray(t)) { - const items = Array.from(new Set(t.map((t) => t.toLowerCase())).values()); - if (items.length === 1) { - return items[0]; - } - items.sort(); - return items; - } - return t.toLowerCase(); - }); - const tag = topics.map((t) => { - if (t == null) { - return "null"; - } - if (Array.isArray(t)) { - return t.join("|"); - } - return t; - }).join("&"); - return { fragment, tag, topics }; -} -async function hasSub(contract, event) { - const { subs } = getInternal(contract); - return subs.get((await getSubInfo(contract, event)).tag) || null; -} -async function getSub(contract, operation, event) { - // Make sure our runner can actually subscribe to events - const provider = getProvider(contract.runner); - assert(provider, "contract runner does not support subscribing", "UNSUPPORTED_OPERATION", { operation }); - const { fragment, tag, topics } = await getSubInfo(contract, event); - const { addr, subs } = getInternal(contract); - let sub = subs.get(tag); - if (!sub) { - const address = (addr ? addr : contract); - const filter = { address, topics }; - const listener = (log) => { - let foundFragment = fragment; - if (foundFragment == null) { - try { - foundFragment = contract.interface.getEvent(log.topics[0]); - } - catch (error) { } - } - // If fragment is null, we do not deconstruct the args to emit - if (foundFragment) { - const _foundFragment = foundFragment; - const args = fragment ? contract.interface.decodeEventLog(fragment, log.data, log.topics) : []; - emit(contract, event, args, (listener) => { - return new ContractEventPayload(contract, listener, event, _foundFragment, log); - }); - } - else { - emit(contract, event, [], (listener) => { - return new ContractUnknownEventPayload(contract, listener, event, log); - }); - } - }; - let starting = []; - const start = () => { - if (starting.length) { - return; - } - starting.push(provider.on(filter, listener)); - }; - const stop = async () => { - if (starting.length == 0) { - return; - } - let started = starting; - starting = []; - await Promise.all(started); - provider.off(filter, listener); - }; - sub = { tag, listeners: [], start, stop }; - subs.set(tag, sub); - } - return sub; -} -// We use this to ensure one emit resolves before firing the next to -// ensure correct ordering (note this cannot throw and just adds the -// notice to the event queu using setTimeout). -let lastEmit = Promise.resolve(); -async function _emit(contract, event, args, payloadFunc) { - await lastEmit; - const sub = await hasSub(contract, event); - if (!sub) { - return false; - } - const count = sub.listeners.length; - sub.listeners = sub.listeners.filter(({ listener, once }) => { - const passArgs = Array.from(args); - if (payloadFunc) { - passArgs.push(payloadFunc(once ? null : listener)); - } - try { - listener.call(contract, ...passArgs); - } - catch (error) { } - return !once; - }); - if (sub.listeners.length === 0) { - sub.stop(); - getInternal(contract).subs.delete(sub.tag); - } - return (count > 0); -} -async function emit(contract, event, args, payloadFunc) { - try { - await lastEmit; - } - catch (error) { } - const resultPromise = _emit(contract, event, args, payloadFunc); - lastEmit = resultPromise; - return await resultPromise; -} -const passProperties = ["then"]; -export class BaseContract { - /** - * The target to connect to. - * - * This can be an address, ENS name or any [[Addressable]], such as - * another contract. To get the resolved address, use the ``getAddress`` - * method. - */ - target; - /** - * The contract Interface. - */ - interface; - /** - * The connected runner. This is generally a [[Provider]] or a - * [[Signer]], which dictates what operations are supported. - * - * For example, a **Contract** connected to a [[Provider]] may - * only execute read-only operations. - */ - runner; - /** - * All the Events available on this contract. - */ - filters; - /** - * @_ignore: - */ - [internal]; - /** - * The fallback or receive function if any. - */ - fallback; - /** - * Creates a new contract connected to %%target%% with the %%abi%% and - * optionally connected to a %%runner%% to perform operations on behalf - * of. - */ - constructor(target, abi, runner, _deployTx) { - assertArgument(typeof (target) === "string" || isAddressable(target), "invalid value for Contract target", "target", target); - if (runner == null) { - runner = null; - } - const iface = Interface.from(abi); - defineProperties(this, { target, runner, interface: iface }); - Object.defineProperty(this, internal, { value: {} }); - let addrPromise; - let addr = null; - let deployTx = null; - if (_deployTx) { - const provider = getProvider(runner); - // @TODO: the provider can be null; make a custom dummy provider that will throw a - // meaningful error - deployTx = new ContractTransactionResponse(this.interface, provider, _deployTx); - } - let subs = new Map(); - // Resolve the target as the address - if (typeof (target) === "string") { - if (isHexString(target)) { - addr = target; - addrPromise = Promise.resolve(target); - } - else { - const resolver = getRunner(runner, "resolveName"); - if (!canResolve(resolver)) { - throw makeError("contract runner does not support name resolution", "UNSUPPORTED_OPERATION", { - operation: "resolveName" - }); - } - addrPromise = resolver.resolveName(target).then((addr) => { - if (addr == null) { - throw makeError("an ENS name used for a contract target must be correctly configured", "UNCONFIGURED_NAME", { - value: target - }); - } - getInternal(this).addr = addr; - return addr; - }); - } - } - else { - addrPromise = target.getAddress().then((addr) => { - if (addr == null) { - throw new Error("TODO"); - } - getInternal(this).addr = addr; - return addr; - }); - } - // Set our private values - setInternal(this, { addrPromise, addr, deployTx, subs }); - // Add the event filters - const filters = new Proxy({}, { - get: (target, prop, receiver) => { - // Pass important checks (like `then` for Promise) through - if (typeof (prop) === "symbol" || passProperties.indexOf(prop) >= 0) { - return Reflect.get(target, prop, receiver); - } - try { - return this.getEvent(prop); - } - catch (error) { - if (!isError(error, "INVALID_ARGUMENT") || error.argument !== "key") { - throw error; - } - } - return undefined; - }, - has: (target, prop) => { - // Pass important checks (like `then` for Promise) through - if (passProperties.indexOf(prop) >= 0) { - return Reflect.has(target, prop); - } - return Reflect.has(target, prop) || this.interface.hasEvent(String(prop)); - } - }); - defineProperties(this, { filters }); - defineProperties(this, { - fallback: ((iface.receive || iface.fallback) ? (buildWrappedFallback(this)) : null) - }); - // Return a Proxy that will respond to functions - return new Proxy(this, { - get: (target, prop, receiver) => { - if (typeof (prop) === "symbol" || prop in target || passProperties.indexOf(prop) >= 0) { - return Reflect.get(target, prop, receiver); - } - // Undefined properties should return undefined - try { - return target.getFunction(prop); - } - catch (error) { - if (!isError(error, "INVALID_ARGUMENT") || error.argument !== "key") { - throw error; - } - } - return undefined; - }, - has: (target, prop) => { - if (typeof (prop) === "symbol" || prop in target || passProperties.indexOf(prop) >= 0) { - return Reflect.has(target, prop); - } - return target.interface.hasFunction(prop); - } - }); - } - /** - * Return a new Contract instance with the same target and ABI, but - * a different %%runner%%. - */ - connect(runner) { - return new BaseContract(this.target, this.interface, runner); - } - /** - * Return a new Contract instance with the same ABI and runner, but - * a different %%target%%. - */ - attach(target) { - return new BaseContract(target, this.interface, this.runner); - } - /** - * Return the resolved address of this Contract. - */ - async getAddress() { return await getInternal(this).addrPromise; } - /** - * Return the deployed bytecode or null if no bytecode is found. - */ - async getDeployedCode() { - const provider = getProvider(this.runner); - assert(provider, "runner does not support .provider", "UNSUPPORTED_OPERATION", { operation: "getDeployedCode" }); - const code = await provider.getCode(await this.getAddress()); - if (code === "0x") { - return null; - } - return code; - } - /** - * Resolve to this Contract once the bytecode has been deployed, or - * resolve immediately if already deployed. - */ - async waitForDeployment() { - // We have the deployment transaction; just use that (throws if deployment fails) - const deployTx = this.deploymentTransaction(); - if (deployTx) { - await deployTx.wait(); - return this; - } - // Check for code - const code = await this.getDeployedCode(); - if (code != null) { - return this; - } - // Make sure we can subscribe to a provider event - const provider = getProvider(this.runner); - assert(provider != null, "contract runner does not support .provider", "UNSUPPORTED_OPERATION", { operation: "waitForDeployment" }); - return new Promise((resolve, reject) => { - const checkCode = async () => { - try { - const code = await this.getDeployedCode(); - if (code != null) { - return resolve(this); - } - provider.once("block", checkCode); - } - catch (error) { - reject(error); - } - }; - checkCode(); - }); - } - /** - * Return the transaction used to deploy this contract. - * - * This is only available if this instance was returned from a - * [[ContractFactory]]. - */ - deploymentTransaction() { - return getInternal(this).deployTx; - } - /** - * Return the function for a given name. This is useful when a contract - * method name conflicts with a JavaScript name such as ``prototype`` or - * when using a Contract programmatically. - */ - getFunction(key) { - if (typeof (key) !== "string") { - key = key.format(); - } - const func = buildWrappedMethod(this, key); - return func; - } - /** - * Return the event for a given name. This is useful when a contract - * event name conflicts with a JavaScript name such as ``prototype`` or - * when using a Contract programmatically. - */ - getEvent(key) { - if (typeof (key) !== "string") { - key = key.format(); - } - return buildWrappedEvent(this, key); - } - /** - * @_ignore: - */ - async queryTransaction(hash) { - throw new Error("@TODO"); - } - /* - // @TODO: this is a non-backwards compatible change, but will be added - // in v7 and in a potential SmartContract class in an upcoming - // v6 release - async getTransactionReceipt(hash: string): Promise { - const provider = getProvider(this.runner); - assert(provider, "contract runner does not have a provider", - "UNSUPPORTED_OPERATION", { operation: "queryTransaction" }); - - const receipt = await provider.getTransactionReceipt(hash); - if (receipt == null) { return null; } - - return new ContractTransactionReceipt(this.interface, provider, receipt); - } - */ - /** - * Provide historic access to event data for %%event%% in the range - * %%fromBlock%% (default: ``0``) to %%toBlock%% (default: ``"latest"``) - * inclusive. - */ - async queryFilter(event, fromBlock, toBlock) { - if (fromBlock == null) { - fromBlock = 0; - } - if (toBlock == null) { - toBlock = "latest"; - } - const { addr, addrPromise } = getInternal(this); - const address = (addr ? addr : (await addrPromise)); - const { fragment, topics } = await getSubInfo(this, event); - const filter = { address, topics, fromBlock, toBlock }; - const provider = getProvider(this.runner); - assert(provider, "contract runner does not have a provider", "UNSUPPORTED_OPERATION", { operation: "queryFilter" }); - return (await provider.getLogs(filter)).map((log) => { - let foundFragment = fragment; - if (foundFragment == null) { - try { - foundFragment = this.interface.getEvent(log.topics[0]); - } - catch (error) { } - } - if (foundFragment) { - try { - return new EventLog(log, this.interface, foundFragment); - } - catch (error) { - return new UndecodedEventLog(log, error); - } - } - return new Log(log, provider); - }); - } - /** - * Add an event %%listener%% for the %%event%%. - */ - async on(event, listener) { - const sub = await getSub(this, "on", event); - sub.listeners.push({ listener, once: false }); - sub.start(); - return this; - } - /** - * Add an event %%listener%% for the %%event%%, but remove the listener - * after it is fired once. - */ - async once(event, listener) { - const sub = await getSub(this, "once", event); - sub.listeners.push({ listener, once: true }); - sub.start(); - return this; - } - /** - * Emit an %%event%% calling all listeners with %%args%%. - * - * Resolves to ``true`` if any listeners were called. - */ - async emit(event, ...args) { - return await emit(this, event, args, null); - } - /** - * Resolves to the number of listeners of %%event%% or the total number - * of listeners if unspecified. - */ - async listenerCount(event) { - if (event) { - const sub = await hasSub(this, event); - if (!sub) { - return 0; - } - return sub.listeners.length; - } - const { subs } = getInternal(this); - let total = 0; - for (const { listeners } of subs.values()) { - total += listeners.length; - } - return total; - } - /** - * Resolves to the listeners subscribed to %%event%% or all listeners - * if unspecified. - */ - async listeners(event) { - if (event) { - const sub = await hasSub(this, event); - if (!sub) { - return []; - } - return sub.listeners.map(({ listener }) => listener); - } - const { subs } = getInternal(this); - let result = []; - for (const { listeners } of subs.values()) { - result = result.concat(listeners.map(({ listener }) => listener)); - } - return result; - } - /** - * Remove the %%listener%% from the listeners for %%event%% or remove - * all listeners if unspecified. - */ - async off(event, listener) { - const sub = await hasSub(this, event); - if (!sub) { - return this; - } - if (listener) { - const index = sub.listeners.map(({ listener }) => listener).indexOf(listener); - if (index >= 0) { - sub.listeners.splice(index, 1); - } - } - if (listener == null || sub.listeners.length === 0) { - sub.stop(); - getInternal(this).subs.delete(sub.tag); - } - return this; - } - /** - * Remove all the listeners for %%event%% or remove all listeners if - * unspecified. - */ - async removeAllListeners(event) { - if (event) { - const sub = await hasSub(this, event); - if (!sub) { - return this; - } - sub.stop(); - getInternal(this).subs.delete(sub.tag); - } - else { - const { subs } = getInternal(this); - for (const { tag, stop } of subs.values()) { - stop(); - subs.delete(tag); - } - } - return this; - } - /** - * Alias for [on]. - */ - async addListener(event, listener) { - return await this.on(event, listener); - } - /** - * Alias for [off]. - */ - async removeListener(event, listener) { - return await this.off(event, listener); - } - /** - * Create a new Class for the %%abi%%. - */ - static buildClass(abi) { - class CustomContract extends BaseContract { - constructor(address, runner = null) { - super(address, abi, runner); - } - } - return CustomContract; - } - ; - /** - * Create a new BaseContract with a specified Interface. - */ - static from(target, abi, runner) { - if (runner == null) { - runner = null; - } - const contract = new this(target, abi, runner); - return contract; - } -} -function _ContractBase() { - return BaseContract; -} -/** - * A [[BaseContract]] with no type guards on its methods or events. - */ -export class Contract extends _ContractBase() { -} -//# sourceMappingURL=contract.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/contract.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/contract.js.map deleted file mode 100644 index fd9ebd8d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/contract.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contract.js","sourceRoot":"","sources":["../../src.ts/contract/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACpE,sEAAsE;AACtE,yBAAyB;AACzB,OAAO,EAAE,WAAW,EAAE,GAAG,EAAuB,MAAM,0BAA0B,CAAC;AACjF,OAAO,EACH,gBAAgB,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,iBAAiB,EAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,EAC7C,MAAM,m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AAC;IAC1C,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,cAAc,CAAC,KAAwB,EAAE,QAAkB;QAC7D,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC3C,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,UAAU,CAAwB,GAA6B;QAClE,MAAM,cAAe,SAAQ,YAAY;YACrC,YAAY,OAAe,EAAE,SAAgC,IAAI;gBAC7D,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;YAChC,CAAC;SACJ;QACD,OAAO,cAAqB,CAAC;IACjC,CAAC;IAAA,CAAC;IAEF;;OAEG;IACH,MAAM,CAAC,IAAI,CAAwB,MAAc,EAAE,GAA6B,EAAE,MAA8B;QAC5G,IAAI,MAAM,IAAI,IAAI,EAAE;YAAE,MAAM,GAAG,IAAI,CAAC;SAAE;QACtC,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,CAAE,CAAC;QAChD,OAAO,QAAe,CAAC;IAC3B,CAAC;CACJ;AAED,SAAS,aAAa;IAClB,OAAO,YAAmB,CAAC;AAC/B,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,aAAa,EAAE;CAAI"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/factory.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/factory.d.ts deleted file mode 100644 index e472eb93..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/factory.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { Interface } from "../abi/index.js"; -import { BaseContract } from "./contract.js"; -import type { InterfaceAbi } from "../abi/index.js"; -import type { Addressable } from "../address/index.js"; -import type { ContractRunner } from "../providers/index.js"; -import type { BytesLike } from "../utils/index.js"; -import type { ContractInterface, ContractMethodArgs, ContractDeployTransaction } from "./types.js"; -import type { ContractTransactionResponse } from "./wrappers.js"; -/** - * A **ContractFactory** is used to deploy a Contract to the blockchain. - */ -export declare class ContractFactory = Array, I = BaseContract> { - /** - * The Contract Interface. - */ - readonly interface: Interface; - /** - * The Contract deployment bytecode. Often called the initcode. - */ - readonly bytecode: string; - /** - * The ContractRunner to deploy the Contract as. - */ - readonly runner: null | ContractRunner; - /** - * Create a new **ContractFactory** with %%abi%% and %%bytecode%%, - * optionally connected to %%runner%%. - * - * The %%bytecode%% may be the ``bytecode`` property within the - * standard Solidity JSON output. - */ - constructor(abi: Interface | InterfaceAbi, bytecode: BytesLike | { - object: string; - }, runner?: null | ContractRunner); - attach(target: string | Addressable): BaseContract & Omit; - /** - * Resolves to the transaction to deploy the contract, passing %%args%% - * into the constructor. - */ - getDeployTransaction(...args: ContractMethodArgs): Promise; - /** - * Resolves to the Contract deployed by passing %%args%% into the - * constructor. - * - * This will resolve to the Contract before it has been deployed to the - * network, so the [[BaseContract-waitForDeployment]] should be used before - * sending any transactions to it. - */ - deploy(...args: ContractMethodArgs): Promise>; - /** - * Return a new **ContractFactory** with the same ABI and bytecode, - * but connected to %%runner%%. - */ - connect(runner: null | ContractRunner): ContractFactory; - /** - * Create a new **ContractFactory** from the standard Solidity JSON output. - */ - static fromSolidity = Array, I = ContractInterface>(output: any, runner?: ContractRunner): ContractFactory; -} -//# sourceMappingURL=factory.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/factory.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/factory.d.ts.map deleted file mode 100644 index dc031ea9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/factory.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src.ts/contract/factory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAO5C,OAAO,EAAE,YAAY,EAA8B,MAAM,eAAe,CAAC;AAE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AAC,CAAC,EAAE,MAAM,YAAY,CAAC,CAAC;IAY5J;;;OAGG;IACH,OAAO,CAAC,MAAM,EAAE,IAAI,GAAG,cAAc,GAAG,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC;IAI7D;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,CAAC,SAAS,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,iBAAiB,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,cAAc,GAAG,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC;CAgB7I"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/factory.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/factory.js deleted file mode 100644 index c9530e2d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/factory.js +++ /dev/null @@ -1,112 +0,0 @@ -import { Interface } from "../abi/index.js"; -import { getCreateAddress } from "../address/index.js"; -import { concat, defineProperties, getBytes, hexlify, assert, assertArgument } from "../utils/index.js"; -import { BaseContract, copyOverrides, resolveArgs } from "./contract.js"; -// A = Arguments to the constructor -// I = Interface of deployed contracts -/** - * A **ContractFactory** is used to deploy a Contract to the blockchain. - */ -export class ContractFactory { - /** - * The Contract Interface. - */ - interface; - /** - * The Contract deployment bytecode. Often called the initcode. - */ - bytecode; - /** - * The ContractRunner to deploy the Contract as. - */ - runner; - /** - * Create a new **ContractFactory** with %%abi%% and %%bytecode%%, - * optionally connected to %%runner%%. - * - * The %%bytecode%% may be the ``bytecode`` property within the - * standard Solidity JSON output. - */ - constructor(abi, bytecode, runner) { - const iface = Interface.from(abi); - // Dereference Solidity bytecode objects and allow a missing `0x`-prefix - if (bytecode instanceof Uint8Array) { - bytecode = hexlify(getBytes(bytecode)); - } - else { - if (typeof (bytecode) === "object") { - bytecode = bytecode.object; - } - if (!bytecode.startsWith("0x")) { - bytecode = "0x" + bytecode; - } - bytecode = hexlify(getBytes(bytecode)); - } - defineProperties(this, { - bytecode, interface: iface, runner: (runner || null) - }); - } - attach(target) { - return new BaseContract(target, this.interface, this.runner); - } - /** - * Resolves to the transaction to deploy the contract, passing %%args%% - * into the constructor. - */ - async getDeployTransaction(...args) { - let overrides = {}; - const fragment = this.interface.deploy; - if (fragment.inputs.length + 1 === args.length) { - overrides = await copyOverrides(args.pop()); - } - if (fragment.inputs.length !== args.length) { - throw new Error("incorrect number of arguments to constructor"); - } - const resolvedArgs = await resolveArgs(this.runner, fragment.inputs, args); - const data = concat([this.bytecode, this.interface.encodeDeploy(resolvedArgs)]); - return Object.assign({}, overrides, { data }); - } - /** - * Resolves to the Contract deployed by passing %%args%% into the - * constructor. - * - * This will resolve to the Contract before it has been deployed to the - * network, so the [[BaseContract-waitForDeployment]] should be used before - * sending any transactions to it. - */ - async deploy(...args) { - const tx = await this.getDeployTransaction(...args); - assert(this.runner && typeof (this.runner.sendTransaction) === "function", "factory runner does not support sending transactions", "UNSUPPORTED_OPERATION", { - operation: "sendTransaction" - }); - const sentTx = await this.runner.sendTransaction(tx); - const address = getCreateAddress(sentTx); - return new BaseContract(address, this.interface, this.runner, sentTx); - } - /** - * Return a new **ContractFactory** with the same ABI and bytecode, - * but connected to %%runner%%. - */ - connect(runner) { - return new ContractFactory(this.interface, this.bytecode, runner); - } - /** - * Create a new **ContractFactory** from the standard Solidity JSON output. - */ - static fromSolidity(output, runner) { - assertArgument(output != null, "bad compiler output", "output", output); - if (typeof (output) === "string") { - output = JSON.parse(output); - } - const abi = output.abi; - let bytecode = ""; - if (output.bytecode) { - bytecode = output.bytecode; - } - else if (output.evm && output.evm.bytecode) { - bytecode = output.evm.bytecode; - } - return new this(abi, bytecode, runner); - } -} -//# sourceMappingURL=factory.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/factory.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/factory.js.map deleted file mode 100644 index 003ba7bd..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/factory.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../src.ts/contract/factory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EACH,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,OAAO,EAC3C,MAAM,EAAE,cAAc,EACzB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAazE,mCAAmC;AACnC,sCAAsC;AAEtC;;GAEG;AACH,MAAM,OAAO,eAAe;IAExB;;OAEG;IACM,SAAS,CAAa;IAE/B;;OAEG;IACM,QAAQ,CAAU;IAE3B;;OAEG;IACM,MAAM,CAAyB;IAExC;;;;;;OAMG;IACH,YAAY,GAA6B,EAAE,QAAwC,EAAE,MAA8B;QAC/G,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAElC,wEAAwE;QACxE,IAAI,QAAQ,YAAY,UAAU,EAAE;YAChC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;SAC1C;aAAM;YACH,IAAI,OAAM,CAAC,QAAQ,CAAC,KAAK,QAAQ,EAAE;gBAAE,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC;aAAE;YAClE,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;gBAAE,QAAQ,GAAG,IAAI,GAAG,QAAQ,CAAC;aAAE;YAC/D,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;SAC1C;QAED,gBAAgB,CAAkB,IAAI,EAAE;YACpC,QAAQ,EAAE,SAAS,EAAE,KAAK,E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.esm/contract/index.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/index.d.ts deleted file mode 100644 index b7f2c818..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * A **Contract** object is a meta-class (a class whose definition is - * defined at runtime), which communicates with a deployed smart contract - * on the blockchain and provides a simple JavaScript interface to call - * methods, send transaction, query historic logs and listen for its events. - * - * @_section: api/contract:Contracts [about-contracts] - */ -export { BaseContract, Contract } from "./contract.js"; -export { ContractFactory } from "./factory.js"; -export { ContractEventPayload, ContractUnknownEventPayload, ContractTransactionReceipt, ContractTransactionResponse, EventLog, UndecodedEventLog } from "./wrappers.js"; -export type { BaseContractMethod, ConstantContractMethod, PostfixOverrides, ContractEvent, ContractEventArgs, ContractEventName, ContractDeployTransaction, ContractInterface, ContractMethod, ContractMethodArgs, ContractTransaction, DeferredTopicFilter, Overrides, WrappedFallback } from "./types.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/index.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/index.d.ts.map deleted file mode 100644 index aad3d029..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/contract/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACH,YAAY,EAAE,QAAQ,EACzB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACH,eAAe,EAClB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACH,oBAAoB,EAAE,2BAA2B,EACjD,0BAA0B,EAAE,2BAA2B,EACvD,QAAQ,EAAE,iBAAiB,EAC9B,MAAM,eAAe,CAAC;AAEvB,YAAY,EACR,kBAAkB,EAAE,sBAAsB,EAC1C,gBAAgB,EAChB,aAAa,EAAE,iBAAiB,EAAE,iBAAiB,EACnD,yBAAyB,EACzB,iBAAiB,EAAE,cAAc,EAAE,kBAAkB,EAAE,mBAAmB,EAC1E,mBAAmB,EAAE,SAAS,EAC9B,eAAe,EAClB,MAAM,YAAY,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/index.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/index.js deleted file mode 100644 index e7699343..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/index.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * A **Contract** object is a meta-class (a class whose definition is - * defined at runtime), which communicates with a deployed smart contract - * on the blockchain and provides a simple JavaScript interface to call - * methods, send transaction, query historic logs and listen for its events. - * - * @_section: api/contract:Contracts [about-contracts] - */ -export { BaseContract, Contract } from "./contract.js"; -export { ContractFactory } from "./factory.js"; -export { ContractEventPayload, ContractUnknownEventPayload, ContractTransactionReceipt, ContractTransactionResponse, EventLog, UndecodedEventLog } from "./wrappers.js"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/index.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/index.js.map deleted file mode 100644 index 93010046..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/contract/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACH,YAAY,EAAE,QAAQ,EACzB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACH,eAAe,EAClB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACH,oBAAoB,EAAE,2BAA2B,EACjD,0BAA0B,EAAE,2BAA2B,EACvD,QAAQ,EAAE,iBAAiB,EAC9B,MAAM,eAAe,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/types.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/types.d.ts deleted file mode 100644 index e844463f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/types.d.ts +++ /dev/null @@ -1,193 +0,0 @@ -import type { EventFragment, FunctionFragment, Result, Typed } from "../abi/index.js"; -import type { TransactionRequest, PreparedTransactionRequest, TopicFilter } from "../providers/index.js"; -import type { ContractTransactionResponse } from "./wrappers.js"; -/** - * The name for an event used for subscribing to Contract events. - * - * **``string``** - An event by name. The event must be non-ambiguous. - * The parameters will be dereferenced when passed into the listener. - * - * [[ContractEvent]] - A filter from the ``contract.filters``, which will - * pass only the EventPayload as a single parameter, which includes a - * ``.signature`` property that can be used to further filter the event. - * - * [[TopicFilter]] - A filter defined using the standard Ethereum API - * which provides the specific topic hash or topic hashes to watch for along - * with any additional values to filter by. This will only pass a single - * parameter to the listener, the EventPayload which will include additional - * details to refine by, such as the event name and signature. - * - * [[DeferredTopicFilter]] - A filter created by calling a [[ContractEvent]] - * with parameters, which will create a filter for a specific event - * signature and dereference each parameter when calling the listener. - */ -export type ContractEventName = string | ContractEvent | TopicFilter | DeferredTopicFilter; -/** - * A Contract with no method constraints. - */ -export interface ContractInterface { - [name: string]: BaseContractMethod; -} -/** - * When creating a filter using the ``contract.filters``, this is returned. - */ -export interface DeferredTopicFilter { - getTopicFilter(): Promise; - fragment: EventFragment; -} -/** - * When populating a transaction this type is returned. - */ -export interface ContractTransaction extends PreparedTransactionRequest { - /** - * The target address. - */ - to: string; - /** - * The transaction data. - */ - data: string; - /** - * The from address, if any. - */ - from?: string; -} -/** - * A deployment transaction for a contract. - */ -export interface ContractDeployTransaction extends Omit { -} -/** - * The overrides for a contract transaction. - */ -export interface Overrides extends Omit { -} -/** - * Arguments to a Contract method can always include an additional and - * optional overrides parameter. - * - * @_ignore: - */ -export type PostfixOverrides> = A | [...A, Overrides]; -/** - * Arguments to a Contract method can always include an additional and - * optional overrides parameter, and each parameter can optionally be - * [[Typed]]. - * - * @_ignore: - */ -export type ContractMethodArgs> = PostfixOverrides<{ - [I in keyof A]-?: A[I] | Typed; -}>; -/** - * A Contract method can be called directly, or used in various ways. - */ -export interface BaseContractMethod = Array, R = any, D extends R | ContractTransactionResponse = R | ContractTransactionResponse> { - (...args: ContractMethodArgs): Promise; - /** - * The name of the Contract method. - */ - name: string; - /** - * The fragment of the Contract method. This will throw on ambiguous - * method names. - */ - fragment: FunctionFragment; - /** - * Returns the fragment constrained by %%args%%. This can be used to - * resolve ambiguous method names. - */ - getFragment(...args: ContractMethodArgs): FunctionFragment; - /** - * Returns a populated transaction that can be used to perform the - * contract method with %%args%%. - */ - populateTransaction(...args: ContractMethodArgs): Promise; - /** - * Call the contract method with %%args%% and return the value. - * - * If the return value is a single type, it will be dereferenced and - * returned directly, otherwise the full Result will be returned. - */ - staticCall(...args: ContractMethodArgs): Promise; - /** - * Send a transaction for the contract method with %%args%%. - */ - send(...args: ContractMethodArgs): Promise; - /** - * Estimate the gas to send the contract method with %%args%%. - */ - estimateGas(...args: ContractMethodArgs): Promise; - /** - * Call the contract method with %%args%% and return the Result - * without any dereferencing. - */ - staticCallResult(...args: ContractMethodArgs): Promise; -} -/** - * A contract method on a Contract. - */ -export interface ContractMethod = Array, R = any, D extends R | ContractTransactionResponse = R | ContractTransactionResponse> extends BaseContractMethod { -} -/** - * A pure of view method on a Contract. - */ -export interface ConstantContractMethod, R = any> extends ContractMethod { -} -/** - * Each argument of an event is nullable (to indicate matching //any//. - * - * @_ignore: - */ -export type ContractEventArgs> = { - [I in keyof A]?: A[I] | Typed | null; -}; -export interface ContractEvent = Array> { - (...args: ContractEventArgs): DeferredTopicFilter; - /** - * The name of the Contract event. - */ - name: string; - /** - * The fragment of the Contract event. This will throw on ambiguous - * method names. - */ - fragment: EventFragment; - /** - * Returns the fragment constrained by %%args%%. This can be used to - * resolve ambiguous event names. - */ - getFragment(...args: ContractEventArgs): EventFragment; -} -/** - * A Fallback or Receive function on a Contract. - */ -export interface WrappedFallback { - (overrides?: Omit): Promise; - /** - * Returns a populated transaction that can be used to perform the - * fallback method. - * - * For non-receive fallback, ``data`` may be overridden. - */ - populateTransaction(overrides?: Omit): Promise; - /** - * Call the contract fallback and return the result. - * - * For non-receive fallback, ``data`` may be overridden. - */ - staticCall(overrides?: Omit): Promise; - /** - * Send a transaction to the contract fallback. - * - * For non-receive fallback, ``data`` may be overridden. - */ - send(overrides?: Omit): Promise; - /** - * Estimate the gas to send a transaction to the contract fallback. - * - * For non-receive fallback, ``data`` may be overridden. - */ - estimateGas(overrides?: Omit): Promise; -} -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/types.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/types.d.ts.map deleted file mode 100644 index 918f46cb..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src.ts/contract/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,aAAa,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,EACjD,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACR,kBAAkB,EAAE,0BAA0B,EAAE,WAAW,EAC9D,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAGjE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,aAAa,GAAG,WAAW,GAAG,mBAAmB,CAAC;AAE3F;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAC9B,CAAE,IAAI,EAAE,MAAM,GAAI,kBAAkB,CAAC;CACxC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;IACvC,QAAQ,EAAE,aAAa,CAAC;CAC3B;AAED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,CAAC,SAAS,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC;IAC5D,CAAC,GAAG,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,mBAAmB,CAAC;IAErD;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,QAAQ,EAAE,aAAa,CAAC;IAExB;;;OAGG;IACH,WAAW,CAAC,GAAG,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC;CAC7D;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAEnF;;;;;OAKG;IACH,mBAAmB,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAE9F;;;;OAIG;IACH,UAAU,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAExE;;;;OAIG;IACH,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAEvF;;;;OAIG;IACH,WAAW,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC5E"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/types.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/types.js deleted file mode 100644 index 14353c78..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/types.js +++ /dev/null @@ -1,5 +0,0 @@ -; -; -; -export {}; -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/types.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/types.js.map deleted file mode 100644 index bd845d6f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src.ts/contract/types.ts"],"names":[],"mappings":"AAqCC,CAAC;AAsC4E,CAAC;AA4H9E,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/wrappers.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/wrappers.d.ts deleted file mode 100644 index 90f9e1ea..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/wrappers.d.ts +++ /dev/null @@ -1,143 +0,0 @@ -import { Block, Log, TransactionReceipt, TransactionResponse } from "../providers/provider.js"; -import { EventPayload } from "../utils/index.js"; -import type { EventFragment, Interface, Result } from "../abi/index.js"; -import type { Listener } from "../utils/index.js"; -import type { Provider } from "../providers/index.js"; -import type { BaseContract } from "./contract.js"; -import type { ContractEventName } from "./types.js"; -/** - * An **EventLog** contains additional properties parsed from the [[Log]]. - */ -export declare class EventLog extends Log { - /** - * The Contract Interface. - */ - readonly interface: Interface; - /** - * The matching event. - */ - readonly fragment: EventFragment; - /** - * The parsed arguments passed to the event by ``emit``. - */ - readonly args: Result; - /** - * @_ignore: - */ - constructor(log: Log, iface: Interface, fragment: EventFragment); - /** - * The name of the event. - */ - get eventName(): string; - /** - * The signature of the event. - */ - get eventSignature(): string; -} -/** - * An **EventLog** contains additional properties parsed from the [[Log]]. - */ -export declare class UndecodedEventLog extends Log { - /** - * The error encounted when trying to decode the log. - */ - readonly error: Error; - /** - * @_ignore: - */ - constructor(log: Log, error: Error); -} -/** - * A **ContractTransactionReceipt** includes the parsed logs from a - * [[TransactionReceipt]]. - */ -export declare class ContractTransactionReceipt extends TransactionReceipt { - #private; - /** - * @_ignore: - */ - constructor(iface: Interface, provider: Provider, tx: TransactionReceipt); - /** - * The parsed logs for any [[Log]] which has a matching event in the - * Contract ABI. - */ - get logs(): Array; -} -/** - * A **ContractTransactionResponse** will return a - * [[ContractTransactionReceipt]] when waited on. - */ -export declare class ContractTransactionResponse extends TransactionResponse { - #private; - /** - * @_ignore: - */ - constructor(iface: Interface, provider: Provider, tx: TransactionResponse); - /** - * Resolves once this transaction has been mined and has - * %%confirms%% blocks including it (default: ``1``) with an - * optional %%timeout%%. - * - * This can resolve to ``null`` only if %%confirms%% is ``0`` - * and the transaction has not been mined, otherwise this will - * wait until enough confirmations have completed. - */ - wait(confirms?: number, timeout?: number): Promise; -} -/** - * A **ContractUnknownEventPayload** is included as the last parameter to - * Contract Events when the event does not match any events in the ABI. - */ -export declare class ContractUnknownEventPayload extends EventPayload { - /** - * The log with no matching events. - */ - readonly log: Log; - /** - * @_event: - */ - constructor(contract: BaseContract, listener: null | Listener, filter: ContractEventName, log: Log); - /** - * Resolves to the block the event occured in. - */ - getBlock(): Promise; - /** - * Resolves to the transaction the event occured in. - */ - getTransaction(): Promise; - /** - * Resolves to the transaction receipt the event occured in. - */ - getTransactionReceipt(): Promise; -} -/** - * A **ContractEventPayload** is included as the last parameter to - * Contract Events when the event is known. - */ -export declare class ContractEventPayload extends ContractUnknownEventPayload { - /** - * The matching event. - */ - readonly fragment: EventFragment; - /** - * The log, with parsed properties. - */ - readonly log: EventLog; - /** - * The parsed arguments passed to the event by ``emit``. - */ - readonly args: Result; - /** - * @_ignore: - */ - constructor(contract: BaseContract, listener: null | Listener, filter: ContractEventName, fragment: EventFragment, _log: Log); - /** - * The event name. - */ - get eventName(): string; - /** - * The event signature. - */ - get eventSignature(): string; -} -//# sourceMappingURL=wrappers.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/wrappers.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/wrappers.d.ts.map deleted file mode 100644 index d17e816c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/wrappers.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wrappers.d.ts","sourceRoot":"","sources":["../../src.ts/contract/wrappers.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,EAAE,GAAG,EAAE,kBAAkB,EAAE,mBAAmB,EACtD,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAoB,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EACR,QAAQ,EACX,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD;;GAEG;AACH,qBAAa,QAAS,SAAQ,GAAG;IAC7B;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAG,SAAS,CAAC;IAE/B;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAG,aAAa,CAAC;IAElC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;IAEvB;;OAEG;gBACS,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa;IAM/D;;OAEG;IACH,IAAI,SAAS,IAAI,MAAM,CAA+B;IAEtD;;OAEG;IACH,IAAI,cAAc,IAAI,MAAM,CAAmC;CAClE;AAED;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,GAAG;IAEtC;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAG,KAAK,CAAC;IAEvB;;OAEG;gBACS,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK;CAIrC;AAED;;;GAGG;AACH,qBAAa,0BAA2B,S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QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,GAAG;IAM5H;;OAEG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED;;OAEG;IACH,IAAI,cAAc,IAAI,MAAM,CAE3B;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/wrappers.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/wrappers.js deleted file mode 100644 index ca9c20ff..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/wrappers.js +++ /dev/null @@ -1,177 +0,0 @@ -// import from provider.ts instead of index.ts to prevent circular dep -// from EtherscanProvider -import { Log, TransactionReceipt, TransactionResponse } from "../providers/provider.js"; -import { defineProperties, EventPayload } from "../utils/index.js"; -/** - * An **EventLog** contains additional properties parsed from the [[Log]]. - */ -export class EventLog extends Log { - /** - * The Contract Interface. - */ - interface; - /** - * The matching event. - */ - fragment; - /** - * The parsed arguments passed to the event by ``emit``. - */ - args; - /** - * @_ignore: - */ - constructor(log, iface, fragment) { - super(log, log.provider); - const args = iface.decodeEventLog(fragment, log.data, log.topics); - defineProperties(this, { args, fragment, interface: iface }); - } - /** - * The name of the event. - */ - get eventName() { return this.fragment.name; } - /** - * The signature of the event. - */ - get eventSignature() { return this.fragment.format(); } -} -/** - * An **EventLog** contains additional properties parsed from the [[Log]]. - */ -export class UndecodedEventLog extends Log { - /** - * The error encounted when trying to decode the log. - */ - error; - /** - * @_ignore: - */ - constructor(log, error) { - super(log, log.provider); - defineProperties(this, { error }); - } -} -/** - * A **ContractTransactionReceipt** includes the parsed logs from a - * [[TransactionReceipt]]. - */ -export class ContractTransactionReceipt extends TransactionReceipt { - #iface; - /** - * @_ignore: - */ - constructor(iface, provider, tx) { - super(tx, provider); - this.#iface = iface; - } - /** - * The parsed logs for any [[Log]] which has a matching event in the - * Contract ABI. - */ - get logs() { - return super.logs.map((log) => { - const fragment = log.topics.length ? this.#iface.getEvent(log.topics[0]) : null; - if (fragment) { - try { - return new EventLog(log, this.#iface, fragment); - } - catch (error) { - return new UndecodedEventLog(log, error); - } - } - return log; - }); - } -} -/** - * A **ContractTransactionResponse** will return a - * [[ContractTransactionReceipt]] when waited on. - */ -export class ContractTransactionResponse extends TransactionResponse { - #iface; - /** - * @_ignore: - */ - constructor(iface, provider, tx) { - super(tx, provider); - this.#iface = iface; - } - /** - * Resolves once this transaction has been mined and has - * %%confirms%% blocks including it (default: ``1``) with an - * optional %%timeout%%. - * - * This can resolve to ``null`` only if %%confirms%% is ``0`` - * and the transaction has not been mined, otherwise this will - * wait until enough confirmations have completed. - */ - async wait(confirms, timeout) { - const receipt = await super.wait(confirms, timeout); - if (receipt == null) { - return null; - } - return new ContractTransactionReceipt(this.#iface, this.provider, receipt); - } -} -/** - * A **ContractUnknownEventPayload** is included as the last parameter to - * Contract Events when the event does not match any events in the ABI. - */ -export class ContractUnknownEventPayload extends EventPayload { - /** - * The log with no matching events. - */ - log; - /** - * @_event: - */ - constructor(contract, listener, filter, log) { - super(contract, listener, filter); - defineProperties(this, { log }); - } - /** - * Resolves to the block the event occured in. - */ - async getBlock() { - return await this.log.getBlock(); - } - /** - * Resolves to the transaction the event occured in. - */ - async getTransaction() { - return await this.log.getTransaction(); - } - /** - * Resolves to the transaction receipt the event occured in. - */ - async getTransactionReceipt() { - return await this.log.getTransactionReceipt(); - } -} -/** - * A **ContractEventPayload** is included as the last parameter to - * Contract Events when the event is known. - */ -export class ContractEventPayload extends ContractUnknownEventPayload { - /** - * @_ignore: - */ - constructor(contract, listener, filter, fragment, _log) { - super(contract, listener, filter, new EventLog(_log, contract.interface, fragment)); - const args = contract.interface.decodeEventLog(fragment, this.log.data, this.log.topics); - defineProperties(this, { args, fragment }); - } - /** - * The event name. - */ - get eventName() { - return this.fragment.name; - } - /** - * The event signature. - */ - get eventSignature() { - return this.fragment.format(); - } -} -//# sourceMappingURL=wrappers.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/wrappers.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/wrappers.js.map deleted file mode 100644 index 475b39d5..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/contract/wrappers.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wrappers.js","sourceRoot":"","sources":["../../src.ts/contract/wrappers.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,yBAAyB;AACzB,OAAO,EACI,GAAG,EAAE,kBAAkB,EAAE,mBAAmB,EACtD,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAWnE;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,GAAG;IAC7B;;OAEG;IACM,SAAS,CAAa;IAE/B;;OAEG;IACM,QAAQ,CAAiB;IAElC;;OAEG;IACM,IAAI,CAAU;IAEvB;;OAEG;IACH,YAAY,GAAQ,EAAE,KAAgB,EAAE,QAAuB;QAC3D,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;QACzB,MAAM,IAAI,GAAG,KAAK,CAAC,cAAc,CAAC,QAAQ,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;QAClE,gBAAgB,CAAW,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED;;OAEG;IACH,IAAI,SAAS,KAAa,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IAEtD;;OAEG;IACH,IAAI,cAAc,KAAa,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;CAClE;AAED;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,GAAG;IAEtC;;OAEG;IACM,KAAK,CAAS;IAEvB;;OAEG;IACH,YAAY,GAAQ,EAAE,KAAY;QAC9B,KAAK,CAAC,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AC,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACzF,gBAAgB,CAAuB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;OAEG;IACH,IAAI,SAAS;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,IAAI,cAAc;QACd,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;IAClC,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/crypto-browser.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/crypto-browser.d.ts deleted file mode 100644 index ba0bbf19..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/crypto-browser.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -declare global { - interface Window { - } - const window: Window; - const self: Window; -} -export interface CryptoHasher { - update(data: Uint8Array): CryptoHasher; - digest(): Uint8Array; -} -export declare function createHash(algo: string): CryptoHasher; -export declare function createHmac(_algo: string, key: Uint8Array): CryptoHasher; -export declare function pbkdf2Sync(password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, _algo: "sha256" | "sha512"): Uint8Array; -export declare function randomBytes(length: number): Uint8Array; -//# sourceMappingURL=crypto-browser.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/crypto-browser.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/crypto-browser.d.ts.map deleted file mode 100644 index b6950c78..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/crypto-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto-browser.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/crypto-browser.ts"],"names":[],"mappings":"AAUA,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;KAAI;IAEpB,MAAM,MAAM,EAAE,MAAM,CAAC;IACrB,MAAM,IAAI,EAAE,MAAM,CAAC;CACtB;AAcD,MAAM,WAAW,YAAY;IACzB,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,CAAC;IACvC,MAAM,IAAI,UAAU,CAAC;CACxB;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAMrD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,GAAG,YAAY,CAIvE;AAED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAI7I;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAStD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/crypto-browser.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/crypto-browser.js deleted file mode 100644 index 8d95b6fa..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/crypto-browser.js +++ /dev/null @@ -1,48 +0,0 @@ -/* Browser Crypto Shims */ -import { hmac } from "@noble/hashes/hmac"; -import { pbkdf2 } from "@noble/hashes/pbkdf2"; -import { sha256 } from "@noble/hashes/sha256"; -import { sha512 } from "@noble/hashes/sha512"; -import { assert, assertArgument } from "../utils/index.js"; -function getGlobal() { - if (typeof self !== 'undefined') { - return self; - } - if (typeof window !== 'undefined') { - return window; - } - if (typeof global !== 'undefined') { - return global; - } - throw new Error('unable to locate global object'); -} -; -const anyGlobal = getGlobal(); -const crypto = anyGlobal.crypto || anyGlobal.msCrypto; -export function createHash(algo) { - switch (algo) { - case "sha256": return sha256.create(); - case "sha512": return sha512.create(); - } - assertArgument(false, "invalid hashing algorithm name", "algorithm", algo); -} -export function createHmac(_algo, key) { - const algo = ({ sha256, sha512 }[_algo]); - assertArgument(algo != null, "invalid hmac algorithm", "algorithm", _algo); - return hmac.create(algo, key); -} -export function pbkdf2Sync(password, salt, iterations, keylen, _algo) { - const algo = ({ sha256, sha512 }[_algo]); - assertArgument(algo != null, "invalid pbkdf2 algorithm", "algorithm", _algo); - return pbkdf2(algo, password, salt, { c: iterations, dkLen: keylen }); -} -export function randomBytes(length) { - assert(crypto != null, "platform does not support secure random numbers", "UNSUPPORTED_OPERATION", { - operation: "randomBytes" - }); - assertArgument(Number.isInteger(length) && length > 0 && length <= 1024, "invalid length", "length", length); - const result = new Uint8Array(length); - crypto.getRandomValues(result); - return result; -} -//# sourceMappingURL=crypto-browser.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/crypto-browser.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/crypto-browser.js.map deleted file mode 100644 index 28134d2b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/crypto-browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto-browser.js","sourceRoot":"","sources":["../../src.ts/crypto/crypto-browser.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAE1B,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAW3D,SAAS,SAAS;IAChB,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;QAAE,OAAO,IAAI,CAAC;KAAE;IACjD,IAAI,OAAO,MAAM,KAAK,WA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CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;AAC1E,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,MAAc;IACtC,MAAM,CAAC,MAAM,IAAI,IAAI,EAAE,iDAAiD,EAAE,uBAAuB,EAAE;QAC/F,SAAS,EAAE,aAAa;KAAE,CAAC,CAAC;IAEhC,cAAc,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,IAAI,MAAM,IAAI,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAE7G,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;IACtC,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IAC/B,OAAO,MAAM,CAAC;AAClB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/crypto.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/crypto.d.ts deleted file mode 100644 index e9c555de..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/crypto.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { createHash, createHmac, pbkdf2Sync, randomBytes } from "crypto"; -//# sourceMappingURL=crypto.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/crypto.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/crypto.d.ts.map deleted file mode 100644 index c417228d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/crypto.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/crypto.ts"],"names":[],"mappings":"AACA,OAAO,EACH,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAClD,MAAM,QAAQ,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/crypto.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/crypto.js deleted file mode 100644 index 05475e30..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/crypto.js +++ /dev/null @@ -1,2 +0,0 @@ -export { createHash, createHmac, pbkdf2Sync, randomBytes } from "crypto"; -//# sourceMappingURL=crypto.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/crypto.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/crypto.js.map deleted file mode 100644 index 1ff179cf..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/crypto.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../src.ts/crypto/crypto.ts"],"names":[],"mappings":"AACA,OAAO,EACH,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAClD,MAAM,QAAQ,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/hmac.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/hmac.d.ts deleted file mode 100644 index 4c5e3227..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/hmac.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { BytesLike } from "../utils/index.js"; -/** - * Return the HMAC for %%data%% using the %%key%% key with the underlying - * %%algo%% used for compression. - * - * @example: - * key = id("some-secret") - * - * // Compute the HMAC - * computeHmac("sha256", key, "0x1337") - * //_result: - * - * // To compute the HMAC of UTF-8 data, the data must be - * // converted to UTF-8 bytes - * computeHmac("sha256", key, toUtf8Bytes("Hello World")) - * //_result: - * - */ -export declare function computeHmac(algorithm: "sha256" | "sha512", _key: BytesLike, _data: BytesLike): string; -export declare namespace computeHmac { - var _: (algorithm: "sha256" | "sha512", key: Uint8Array, data: Uint8Array) => BytesLike; - var lock: () => void; - var register: (func: (algorithm: "sha256" | "sha512", key: Uint8Array, data: Uint8Array) => BytesLike) => void; -} -//# sourceMappingURL=hmac.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/hmac.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/hmac.d.ts.map deleted file mode 100644 index aa56a49f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/hmac.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hmac.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/hmac.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAWnD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,QAAQ,GAAG,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,GAAG,MAAM,CAIrG;yBAJe,WAAW"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/hmac.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/hmac.js deleted file mode 100644 index 944c6651..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/hmac.js +++ /dev/null @@ -1,47 +0,0 @@ -/** - * An **HMAC** enables verification that a given key was used - * to authenticate a payload. - * - * See: [[link-wiki-hmac]] - * - * @_subsection: api/crypto:HMAC [about-hmac] - */ -import { createHmac } from "./crypto.js"; -import { getBytes, hexlify } from "../utils/index.js"; -let locked = false; -const _computeHmac = function (algorithm, key, data) { - return createHmac(algorithm, key).update(data).digest(); -}; -let __computeHmac = _computeHmac; -/** - * Return the HMAC for %%data%% using the %%key%% key with the underlying - * %%algo%% used for compression. - * - * @example: - * key = id("some-secret") - * - * // Compute the HMAC - * computeHmac("sha256", key, "0x1337") - * //_result: - * - * // To compute the HMAC of UTF-8 data, the data must be - * // converted to UTF-8 bytes - * computeHmac("sha256", key, toUtf8Bytes("Hello World")) - * //_result: - * - */ -export function computeHmac(algorithm, _key, _data) { - const key = getBytes(_key, "key"); - const data = getBytes(_data, "data"); - return hexlify(__computeHmac(algorithm, key, data)); -} -computeHmac._ = _computeHmac; -computeHmac.lock = function () { locked = true; }; -computeHmac.register = function (func) { - if (locked) { - throw new Error("computeHmac is locked"); - } - __computeHmac = func; -}; -Object.freeze(computeHmac); -//# sourceMappingURL=hmac.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/hmac.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/hmac.js.map deleted file mode 100644 index 6e0c8ea2..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/hmac.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hmac.js","sourceRoot":"","sources":["../../src.ts/crypto/hmac.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAKtD,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,MAAM,YAAY,GAAG,UAAS,SAA8B,EAAE,GAAe,EAAE,IAAgB;IAC3F,OAAO,UAAU,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;AAC5D,CAAC,CAAA;AAED,IAAI,aAAa,GAAG,YAAY,CAAC;AAEjC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,WAAW,CAAC,SAA8B,EAAE,IAAe,EAAE,KAAgB;IACzF,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAClC,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,OAAO,CAAC,aAAa,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;AACxD,CAAC;AACD,WAAW,CAAC,CAAC,GAAG,YAAY,CAAC;AAC7B,WAAW,CAAC,IAAI,GAAI,cAAa,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;AACjD,WAAW,CAAC,QAAQ,GAAG,UAAS,IAAsF;IAClH,IAAI,MAAM,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;KAAE;IACzD,aAAa,GAAG,IAAI,CAAC;AACzB,CAAC,CAAA;AACD,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/index.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/index.d.ts deleted file mode 100644 index 8d6bc562..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/index.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * A fundamental building block of Ethereum is the underlying - * cryptographic primitives. - * - * @_section: api/crypto:Cryptographic Functions [about-crypto] - */ -import { computeHmac } from "./hmac.js"; -import { keccak256 } from "./keccak.js"; -import { ripemd160 } from "./ripemd160.js"; -import { pbkdf2 } from "./pbkdf2.js"; -import { randomBytes } from "./random.js"; -import { scrypt, scryptSync } from "./scrypt.js"; -import { sha256, sha512 } from "./sha2.js"; -export { computeHmac, randomBytes, keccak256, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync }; -export { SigningKey } from "./signing-key.js"; -export { Signature } from "./signature.js"; -/** - * Once called, prevents any future change to the underlying cryptographic - * primitives using the ``.register`` feature for hooks. - */ -declare function lock(): void; -export { lock }; -export type { ProgressCallback } from "./scrypt.js"; -export type { SignatureLike } from "./signature.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/index.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/index.d.ts.map deleted file mode 100644 index 4f8d3c46..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EACH,WAAW,EAEX,WAAW,EAEX,SAAS,EACT,SAAS,EACT,MAAM,EAAE,MAAM,EAEd,MAAM,EACN,MAAM,EAAE,UAAU,EACrB,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C;;;GAGG;AACH,iBAAS,IAAI,IAAI,IAAI,CAWpB;AAED,OAAO,EAAE,IAAI,EAAE,CAAC;AAKhB,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/index.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/index.js deleted file mode 100644 index a8608024..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/index.js +++ /dev/null @@ -1,36 +0,0 @@ -/** - * A fundamental building block of Ethereum is the underlying - * cryptographic primitives. - * - * @_section: api/crypto:Cryptographic Functions [about-crypto] - */ -null; -// We import all these so we can export lock() -import { computeHmac } from "./hmac.js"; -import { keccak256 } from "./keccak.js"; -import { ripemd160 } from "./ripemd160.js"; -import { pbkdf2 } from "./pbkdf2.js"; -import { randomBytes } from "./random.js"; -import { scrypt, scryptSync } from "./scrypt.js"; -import { sha256, sha512 } from "./sha2.js"; -export { computeHmac, randomBytes, keccak256, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync }; -export { SigningKey } from "./signing-key.js"; -export { Signature } from "./signature.js"; -/** - * Once called, prevents any future change to the underlying cryptographic - * primitives using the ``.register`` feature for hooks. - */ -function lock() { - computeHmac.lock(); - keccak256.lock(); - pbkdf2.lock(); - randomBytes.lock(); - ripemd160.lock(); - scrypt.lock(); - scryptSync.lock(); - sha256.lock(); - sha512.lock(); - randomBytes.lock(); -} -export { lock }; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/index.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/index.js.map deleted file mode 100644 index 8723de8b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/crypto/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,IAAI,CAAA;AAEJ,8CAA8C;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EACH,WAAW,EAEX,WAAW,EAEX,SAAS,EACT,SAAS,EACT,MAAM,EAAE,MAAM,EAEd,MAAM,EACN,MAAM,EAAE,UAAU,EACrB,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C;;;GAGG;AACH,SAAS,IAAI;IACT,WAAW,CAAC,IAAI,EAAE,CAAC;IACnB,SAAS,CAAC,IAAI,EAAE,CAAC;IACjB,MAAM,CAAC,IAAI,EAAE,CAAC;IACd,WAAW,CAAC,IAAI,EAAE,CAAC;IACnB,SAAS,CAAC,IAAI,EAAE,CAAC;IACjB,MAAM,CAAC,IAAI,EAAE,CAAC;IACd,UAAU,CAAC,IAAI,EAAE,CAAC;IAClB,MAAM,CAAC,IAAI,EAAE,CAAC;IACd,MAAM,CAAC,IAAI,EAAE,CAAC;IACd,WAAW,CAAC,IAAI,EAAE,CAAC;AACvB,CAAC;AAED,OAAO,EAAE,IAAI,EAAE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/keccak.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/keccak.d.ts deleted file mode 100644 index 533f46dc..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/keccak.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Cryptographic hashing functions - * - * @_subsection: api/crypto:Hash Functions [about-crypto-hashing] - */ -import type { BytesLike } from "../utils/index.js"; -/** - * Compute the cryptographic KECCAK256 hash of %%data%%. - * - * The %%data%% **must** be a data representation, to compute the - * hash of UTF-8 data use the [[id]] function. - * - * @returns DataHexstring - * @example: - * keccak256("0x") - * //_result: - * - * keccak256("0x1337") - * //_result: - * - * keccak256(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - * // Strings are assumed to be DataHexString, otherwise it will - * // throw. To hash UTF-8 data, see the note above. - * keccak256("Hello World") - * //_error: - */ -export declare function keccak256(_data: BytesLike): string; -export declare namespace keccak256 { - var _: (data: Uint8Array) => Uint8Array; - var lock: () => void; - var register: (func: (data: Uint8Array) => BytesLike) => void; -} -//# sourceMappingURL=keccak.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/keccak.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/keccak.d.ts.map deleted file mode 100644 index a0064495..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/keccak.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"keccak.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/keccak.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAWnD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAGlD;yBAHe,SAAS"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/keccak.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/keccak.js deleted file mode 100644 index a5914c9d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/keccak.js +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Cryptographic hashing functions - * - * @_subsection: api/crypto:Hash Functions [about-crypto-hashing] - */ -import { keccak_256 } from "@noble/hashes/sha3"; -import { getBytes, hexlify } from "../utils/index.js"; -let locked = false; -const _keccak256 = function (data) { - return keccak_256(data); -}; -let __keccak256 = _keccak256; -/** - * Compute the cryptographic KECCAK256 hash of %%data%%. - * - * The %%data%% **must** be a data representation, to compute the - * hash of UTF-8 data use the [[id]] function. - * - * @returns DataHexstring - * @example: - * keccak256("0x") - * //_result: - * - * keccak256("0x1337") - * //_result: - * - * keccak256(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - * // Strings are assumed to be DataHexString, otherwise it will - * // throw. To hash UTF-8 data, see the note above. - * keccak256("Hello World") - * //_error: - */ -export function keccak256(_data) { - const data = getBytes(_data, "data"); - return hexlify(__keccak256(data)); -} -keccak256._ = _keccak256; -keccak256.lock = function () { locked = true; }; -keccak256.register = function (func) { - if (locked) { - throw new TypeError("keccak256 is locked"); - } - __keccak256 = func; -}; -Object.freeze(keccak256); -//# sourceMappingURL=keccak.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/keccak.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/keccak.js.map deleted file mode 100644 index 02837e9f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/keccak.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"keccak.js","sourceRoot":"","sources":["../../src.ts/crypto/keccak.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAKtD,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,MAAM,UAAU,GAAG,UAAS,IAAgB;IACxC,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC,CAAA;AAED,IAAI,WAAW,GAAoC,UAAU,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,SAAS,CAAC,KAAgB;IACtC,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;AACtC,CAAC;AACD,SAAS,CAAC,CAAC,GAAG,UAAU,CAAC;AACzB,SAAS,CAAC,IAAI,GAAG,cAAmB,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;AACpD,SAAS,CAAC,QAAQ,GAAG,UAAS,IAAqC;IAC/D,IAAI,MAAM,EAAE;QAAE,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAC;KAAE;IAC3D,WAAW,GAAG,IAAI,CAAC;AACvB,CAAC,CAAA;AACD,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/pbkdf2.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/pbkdf2.d.ts deleted file mode 100644 index 400e9744..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/pbkdf2.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * A **Password-Based Key-Derivation Function** is designed to create - * a sequence of bytes suitible as a **key** from a human-rememberable - * password. - * - * @_subsection: api/crypto:Passwords [about-pbkdf] - */ -import type { BytesLike } from "../utils/index.js"; -/** - * Return the [[link-pbkdf2]] for %%keylen%% bytes for %%password%% using - * the %%salt%% and using %%iterations%% of %%algo%%. - * - * This PBKDF is outdated and should not be used in new projects, but is - * required to decrypt older files. - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the PBKDF2 - * pbkdf2(passwordBytes, salt, 1024, 16, "sha256") - * //_result: - */ -export declare function pbkdf2(_password: BytesLike, _salt: BytesLike, iterations: number, keylen: number, algo: "sha256" | "sha512"): string; -export declare namespace pbkdf2 { - var _: (password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, algo: "sha256" | "sha512") => BytesLike; - var lock: () => void; - var register: (func: (password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, algo: "sha256" | "sha512") => BytesLike) => void; -} -//# sourceMappingURL=pbkdf2.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/pbkdf2.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/pbkdf2.d.ts.map deleted file mode 100644 index f869e13c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/pbkdf2.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pbkdf2.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/pbkdf2.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAWnD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,MAAM,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAIpI;yBAJe,MAAM"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/pbkdf2.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/pbkdf2.js deleted file mode 100644 index be6178e1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/pbkdf2.js +++ /dev/null @@ -1,49 +0,0 @@ -/** - * A **Password-Based Key-Derivation Function** is designed to create - * a sequence of bytes suitible as a **key** from a human-rememberable - * password. - * - * @_subsection: api/crypto:Passwords [about-pbkdf] - */ -import { pbkdf2Sync } from "./crypto.js"; -import { getBytes, hexlify } from "../utils/index.js"; -let locked = false; -const _pbkdf2 = function (password, salt, iterations, keylen, algo) { - return pbkdf2Sync(password, salt, iterations, keylen, algo); -}; -let __pbkdf2 = _pbkdf2; -/** - * Return the [[link-pbkdf2]] for %%keylen%% bytes for %%password%% using - * the %%salt%% and using %%iterations%% of %%algo%%. - * - * This PBKDF is outdated and should not be used in new projects, but is - * required to decrypt older files. - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the PBKDF2 - * pbkdf2(passwordBytes, salt, 1024, 16, "sha256") - * //_result: - */ -export function pbkdf2(_password, _salt, iterations, keylen, algo) { - const password = getBytes(_password, "password"); - const salt = getBytes(_salt, "salt"); - return hexlify(__pbkdf2(password, salt, iterations, keylen, algo)); -} -pbkdf2._ = _pbkdf2; -pbkdf2.lock = function () { locked = true; }; -pbkdf2.register = function (func) { - if (locked) { - throw new Error("pbkdf2 is locked"); - } - __pbkdf2 = func; -}; -Object.freeze(pbkdf2); -//# sourceMappingURL=pbkdf2.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/pbkdf2.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/pbkdf2.js.map deleted file mode 100644 index 59df8bca..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/pbkdf2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pbkdf2.js","sourceRoot":"","sources":["../../src.ts/crypto/pbkdf2.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAKtD,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,MAAM,OAAO,GAAG,UAAS,QAAoB,EAAE,IAAgB,EAAE,UAAkB,EAAE,MAAc,EAAE,IAAyB;IAC1H,OAAO,UAAU,CAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;AAChE,CAAC,CAAA;AAED,IAAI,QAAQ,GAAG,OAAO,CAAC;AAEvB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,MAAM,CAAC,SAAoB,EAAE,KAAgB,EAAE,UAAkB,EAAE,MAAc,EAAE,IAAyB;IACxH,MAAM,QAAQ,GAAG,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IACjD,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,OAAO,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;AACvE,CAAC;AACD,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC;AACnB,MAAM,CAAC,IAAI,GAAG,cAAmB,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;AACjD,MAAM,CAAC,QAAQ,GAAG,UAAS,IAA0H;IACjJ,IAAI,MAAM,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;KAAE;IACpD,QAAQ,GAAG,IAAI,CAAC;AACpB,CAAC,CAAA;AACD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/random.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/random.d.ts deleted file mode 100644 index fd937800..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/random.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Return %%length%% bytes of cryptographically secure random data. - * - * @example: - * randomBytes(8) - * //_result: - */ -export declare function randomBytes(length: number): Uint8Array; -export declare namespace randomBytes { - var _: (length: number) => Uint8Array; - var lock: () => void; - var register: (func: (length: number) => Uint8Array) => void; -} -//# sourceMappingURL=random.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/random.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/random.d.ts.map deleted file mode 100644 index a907fd7e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/random.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/random.ts"],"names":[],"mappings":"AAkBA;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAEtD;yBAFe,WAAW"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/random.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/random.js deleted file mode 100644 index 206a822f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/random.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * A **Cryptographically Secure Random Value** is one that has been - * generated with additional care take to prevent side-channels - * from allowing others to detect it and prevent others from through - * coincidence generate the same values. - * - * @_subsection: api/crypto:Random Values [about-crypto-random] - */ -import { randomBytes as crypto_random } from "./crypto.js"; -let locked = false; -const _randomBytes = function (length) { - return new Uint8Array(crypto_random(length)); -}; -let __randomBytes = _randomBytes; -/** - * Return %%length%% bytes of cryptographically secure random data. - * - * @example: - * randomBytes(8) - * //_result: - */ -export function randomBytes(length) { - return __randomBytes(length); -} -randomBytes._ = _randomBytes; -randomBytes.lock = function () { locked = true; }; -randomBytes.register = function (func) { - if (locked) { - throw new Error("randomBytes is locked"); - } - __randomBytes = func; -}; -Object.freeze(randomBytes); -//# sourceMappingURL=random.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/random.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/random.js.map deleted file mode 100644 index f857d174..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/random.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"random.js","sourceRoot":"","sources":["../../src.ts/crypto/random.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,WAAW,IAAI,aAAa,EAAE,MAAM,aAAa,CAAC;AAE3D,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,MAAM,YAAY,GAAG,UAAS,MAAc;IACxC,OAAO,IAAI,UAAU,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;AACjD,CAAC,CAAA;AAED,IAAI,aAAa,GAAG,YAAY,CAAC;AAEjC;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,MAAc;IACtC,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC;AAED,WAAW,CAAC,CAAC,GAAG,YAAY,CAAC;AAC7B,WAAW,CAAC,IAAI,GAAG,cAAmB,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;AACtD,WAAW,CAAC,QAAQ,GAAG,UAAS,IAAoC;IAChE,IAAI,MAAM,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;KAAE;IACzD,aAAa,GAAG,IAAI,CAAC;AACzB,CAAC,CAAA;AACD,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/ripemd160.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/ripemd160.d.ts deleted file mode 100644 index 27b7b4a1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/ripemd160.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { BytesLike } from "../utils/index.js"; -/** - * Compute the cryptographic RIPEMD-160 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * ripemd160("0x") - * //_result: - * - * ripemd160("0x1337") - * //_result: - * - * ripemd160(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - */ -export declare function ripemd160(_data: BytesLike): string; -export declare namespace ripemd160 { - var _: (data: Uint8Array) => Uint8Array; - var lock: () => void; - var register: (func: (data: Uint8Array) => BytesLike) => void; -} -//# sourceMappingURL=ripemd160.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/ripemd160.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/ripemd160.d.ts.map deleted file mode 100644 index 03f10806..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/ripemd160.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ripemd160.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ripemd160.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAWnD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAGlD;yBAHe,SAAS"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/ripemd160.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/ripemd160.js deleted file mode 100644 index b305569e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/ripemd160.js +++ /dev/null @@ -1,38 +0,0 @@ -import { ripemd160 as noble_ripemd160 } from "@noble/hashes/ripemd160"; -import { getBytes, hexlify } from "../utils/index.js"; -let locked = false; -const _ripemd160 = function (data) { - return noble_ripemd160(data); -}; -let __ripemd160 = _ripemd160; -/** - * Compute the cryptographic RIPEMD-160 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * ripemd160("0x") - * //_result: - * - * ripemd160("0x1337") - * //_result: - * - * ripemd160(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - */ -export function ripemd160(_data) { - const data = getBytes(_data, "data"); - return hexlify(__ripemd160(data)); -} -ripemd160._ = _ripemd160; -ripemd160.lock = function () { locked = true; }; -ripemd160.register = function (func) { - if (locked) { - throw new TypeError("ripemd160 is locked"); - } - __ripemd160 = func; -}; -Object.freeze(ripemd160); -//# sourceMappingURL=ripemd160.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/ripemd160.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/ripemd160.js.map deleted file mode 100644 index f9961fe3..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/ripemd160.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ripemd160.js","sourceRoot":"","sources":["../../src.ts/crypto/ripemd160.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAEvE,OAAO,EAAE,QAAQ,EAAG,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAKvD,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,MAAM,UAAU,GAAG,UAAS,IAAgB;IACxC,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC;AACjC,CAAC,CAAA;AAED,IAAI,WAAW,GAAoC,UAAU,CAAC;AAE9D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,SAAS,CAAC,KAAgB;IACtC,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;AACtC,CAAC;AACD,SAAS,CAAC,CAAC,GAAG,UAAU,CAAC;AACzB,SAAS,CAAC,IAAI,GAAG,cAAmB,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;AACpD,SAAS,CAAC,QAAQ,GAAG,UAAS,IAAqC;IAC/D,IAAI,MAAM,EAAE;QAAE,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAC;KAAE;IAC3D,WAAW,GAAG,IAAI,CAAC;AACvB,CAAC,CAAA;AACD,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/scrypt.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/scrypt.d.ts deleted file mode 100644 index b0e678f5..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/scrypt.d.ts +++ /dev/null @@ -1,82 +0,0 @@ -import type { BytesLike } from "../utils/index.js"; -/** - * A callback during long-running operations to update any - * UI or provide programatic access to the progress. - * - * The %%percent%% is a value between ``0`` and ``1``. - * - * @_docloc: api/crypto:Passwords - */ -export type ProgressCallback = (percent: number) => void; -/** - * The [[link-wiki-scrypt]] uses a memory and cpu hard method of - * derivation to increase the resource cost to brute-force a password - * for a given key. - * - * This means this algorithm is intentionally slow, and can be tuned to - * become slower. As computation and memory speed improve over time, - * increasing the difficulty maintains the cost of an attacker. - * - * For example, if a target time of 5 seconds is used, a legitimate user - * which knows their password requires only 5 seconds to unlock their - * account. A 6 character password has 68 billion possibilities, which - * would require an attacker to invest over 10,000 years of CPU time. This - * is of course a crude example (as password generally aren't random), - * but demonstrates to value of imposing large costs to decryption. - * - * For this reason, if building a UI which involved decrypting or - * encrypting datsa using scrypt, it is recommended to use a - * [[ProgressCallback]] (as event short periods can seem lik an eternity - * if the UI freezes). Including the phrase //"decrypting"// in the UI - * can also help, assuring the user their waiting is for a good reason. - * - * @_docloc: api/crypto:Passwords - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the scrypt - * scrypt(passwordBytes, salt, 1024, 8, 1, 16) - * //_result: - */ -export declare function scrypt(_passwd: BytesLike, _salt: BytesLike, N: number, r: number, p: number, dkLen: number, progress?: ProgressCallback): Promise; -export declare namespace scrypt { - var _: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number, onProgress?: ProgressCallback | undefined) => Promise; - var lock: () => void; - var register: (func: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number, progress?: ProgressCallback | undefined) => Promise) => void; -} -/** - * Provides a synchronous variant of [[scrypt]]. - * - * This will completely lock up and freeze the UI in a browser and will - * prevent any event loop from progressing. For this reason, it is - * preferred to use the [async variant](scrypt). - * - * @_docloc: api/crypto:Passwords - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the scrypt - * scryptSync(passwordBytes, salt, 1024, 8, 1, 16) - * //_result: - */ -export declare function scryptSync(_passwd: BytesLike, _salt: BytesLike, N: number, r: number, p: number, dkLen: number): string; -export declare namespace scryptSync { - var _: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number) => Uint8Array; - var lock: () => void; - var register: (func: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number) => BytesLike) => void; -} -//# sourceMappingURL=scrypt.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/scrypt.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/scrypt.d.ts.map deleted file mode 100644 index af193f1a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/scrypt.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"scrypt.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/scrypt.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;AAgBzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAsB,MAAM,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAI/J;yBAJqB,MAAM;;;;;AAa5B;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAIvH;yBAJe,UAAU"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/scrypt.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/scrypt.js deleted file mode 100644 index 61cad403..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/scrypt.js +++ /dev/null @@ -1,99 +0,0 @@ -import { scrypt as _nobleSync, scryptAsync as _nobleAsync } from "@noble/hashes/scrypt"; -import { getBytes, hexlify as H } from "../utils/index.js"; -let lockedSync = false, lockedAsync = false; -const _scryptAsync = async function (passwd, salt, N, r, p, dkLen, onProgress) { - return await _nobleAsync(passwd, salt, { N, r, p, dkLen, onProgress }); -}; -const _scryptSync = function (passwd, salt, N, r, p, dkLen) { - return _nobleSync(passwd, salt, { N, r, p, dkLen }); -}; -let __scryptAsync = _scryptAsync; -let __scryptSync = _scryptSync; -/** - * The [[link-wiki-scrypt]] uses a memory and cpu hard method of - * derivation to increase the resource cost to brute-force a password - * for a given key. - * - * This means this algorithm is intentionally slow, and can be tuned to - * become slower. As computation and memory speed improve over time, - * increasing the difficulty maintains the cost of an attacker. - * - * For example, if a target time of 5 seconds is used, a legitimate user - * which knows their password requires only 5 seconds to unlock their - * account. A 6 character password has 68 billion possibilities, which - * would require an attacker to invest over 10,000 years of CPU time. This - * is of course a crude example (as password generally aren't random), - * but demonstrates to value of imposing large costs to decryption. - * - * For this reason, if building a UI which involved decrypting or - * encrypting datsa using scrypt, it is recommended to use a - * [[ProgressCallback]] (as event short periods can seem lik an eternity - * if the UI freezes). Including the phrase //"decrypting"// in the UI - * can also help, assuring the user their waiting is for a good reason. - * - * @_docloc: api/crypto:Passwords - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the scrypt - * scrypt(passwordBytes, salt, 1024, 8, 1, 16) - * //_result: - */ -export async function scrypt(_passwd, _salt, N, r, p, dkLen, progress) { - const passwd = getBytes(_passwd, "passwd"); - const salt = getBytes(_salt, "salt"); - return H(await __scryptAsync(passwd, salt, N, r, p, dkLen, progress)); -} -scrypt._ = _scryptAsync; -scrypt.lock = function () { lockedAsync = true; }; -scrypt.register = function (func) { - if (lockedAsync) { - throw new Error("scrypt is locked"); - } - __scryptAsync = func; -}; -Object.freeze(scrypt); -/** - * Provides a synchronous variant of [[scrypt]]. - * - * This will completely lock up and freeze the UI in a browser and will - * prevent any event loop from progressing. For this reason, it is - * preferred to use the [async variant](scrypt). - * - * @_docloc: api/crypto:Passwords - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the scrypt - * scryptSync(passwordBytes, salt, 1024, 8, 1, 16) - * //_result: - */ -export function scryptSync(_passwd, _salt, N, r, p, dkLen) { - const passwd = getBytes(_passwd, "passwd"); - const salt = getBytes(_salt, "salt"); - return H(__scryptSync(passwd, salt, N, r, p, dkLen)); -} -scryptSync._ = _scryptSync; -scryptSync.lock = function () { lockedSync = true; }; -scryptSync.register = function (func) { - if (lockedSync) { - throw new Error("scryptSync is locked"); - } - __scryptSync = func; -}; -Object.freeze(scryptSync); -//# sourceMappingURL=scrypt.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/scrypt.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/scrypt.js.map deleted file mode 100644 index 49df708d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/scrypt.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"scrypt.js","sourceRoot":"","sources":["../../src.ts/crypto/scrypt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,WAAW,IAAI,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExF,OAAO,EAAE,QAAQ,EAAE,OAAO,IAAI,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAe3D,IAAI,UAAU,GAAG,KAAK,EAAE,WAAW,GAAG,KAAK,CAAC;AAE5C,MAAM,YAAY,GAAG,KAAK,WAAU,MAAkB,EAAE,IAAgB,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,KAAa,EAAE,UAA6B;IACnJ,OAAO,MAAM,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;AAC3E,CAAC,CAAA;AACD,MAAM,WAAW,GAAG,UAAS,MAAkB,EAAE,IAAgB,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,KAAa;IAC7G,OAAO,UAAU,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AACxD,CAAC,CAAA;AAED,IAAI,aAAa,GAAgJ,YAAY,CAAC;AAC9K,IAAI,YAAY,GAAwG,WAAW,CAAA;AAGnI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,OAAkB,EAAE,KAAgB,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,KAAa,EAAE,QAA2B;IAC1I,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,EAAE,QAAQ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5D,YAAY,GAAG,IAAI,CAAC;AACxB,CAAC,CAAA;AACD,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/sha2.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/sha2.d.ts deleted file mode 100644 index 348ccdc7..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/sha2.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -import type { BytesLike } from "../utils/index.js"; -/** - * Compute the cryptographic SHA2-256 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * sha256("0x") - * //_result: - * - * sha256("0x1337") - * //_result: - * - * sha256(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - */ -export declare function sha256(_data: BytesLike): string; -export declare namespace sha256 { - var _: (data: Uint8Array) => Uint8Array; - var lock: () => void; - var register: (func: (data: Uint8Array) => BytesLike) => void; -} -/** - * Compute the cryptographic SHA2-512 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * sha512("0x") - * //_result: - * - * sha512("0x1337") - * //_result: - * - * sha512(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - */ -export declare function sha512(_data: BytesLike): string; -export declare namespace sha512 { - var _: (data: Uint8Array) => Uint8Array; - var lock: () => void; - var register: (func: (data: Uint8Array) => BytesLike) => void; -} -//# sourceMappingURL=sha2.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/sha2.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/sha2.d.ts.map deleted file mode 100644 index 9e42678e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/sha2.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha2.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/sha2.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAiBnD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAG/C;yBAHe,MAAM;;;;;AAatB;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAG/C;yBAHe,MAAM"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/sha2.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/sha2.js deleted file mode 100644 index f84145b4..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/sha2.js +++ /dev/null @@ -1,71 +0,0 @@ -import { createHash } from "./crypto.js"; -import { getBytes, hexlify } from "../utils/index.js"; -const _sha256 = function (data) { - return createHash("sha256").update(data).digest(); -}; -const _sha512 = function (data) { - return createHash("sha512").update(data).digest(); -}; -let __sha256 = _sha256; -let __sha512 = _sha512; -let locked256 = false, locked512 = false; -/** - * Compute the cryptographic SHA2-256 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * sha256("0x") - * //_result: - * - * sha256("0x1337") - * //_result: - * - * sha256(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - */ -export function sha256(_data) { - const data = getBytes(_data, "data"); - return hexlify(__sha256(data)); -} -sha256._ = _sha256; -sha256.lock = function () { locked256 = true; }; -sha256.register = function (func) { - if (locked256) { - throw new Error("sha256 is locked"); - } - __sha256 = func; -}; -Object.freeze(sha256); -/** - * Compute the cryptographic SHA2-512 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * sha512("0x") - * //_result: - * - * sha512("0x1337") - * //_result: - * - * sha512(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - */ -export function sha512(_data) { - const data = getBytes(_data, "data"); - return hexlify(__sha512(data)); -} -sha512._ = _sha512; -sha512.lock = function () { locked512 = true; }; -sha512.register = function (func) { - if (locked512) { - throw new Error("sha512 is locked"); - } - __sha512 = func; -}; -Object.freeze(sha256); -//# sourceMappingURL=sha2.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/sha2.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/sha2.js.map deleted file mode 100644 index 674e5889..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/sha2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha2.js","sourceRoot":"","sources":["../../src.ts/crypto/sha2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAKtD,MAAM,OAAO,GAAG,UAAS,IAAgB;IACrC,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;AACtD,CAAC,CAAA;AAED,MAAM,OAAO,GAAG,UAAS,IAAgB;IACrC,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;AACtD,CAAC,CAAA;AAED,IAAI,QAAQ,GAAoC,OAAO,CAAC;AACxD,IAAI,QAAQ,GAAoC,OAAO,CAAC;AAExD,IAAI,SAAS,GAAG,KAAK,EAAE,SAAS,GAAG,KAAK,CAAC;AAGzC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,MAAM,CAAC,KAAgB;IACnC,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AACnC,CAAC;AACD,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC;AACnB,MAAM,CAAC,IAAI,GAAG,cAAmB,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;AACpD,MAAM,CAAC,QAAQ,GAAG,UAAS,IAAqC;IAC5D,IAAI,SAAS,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;KAAE;IACvD,QAAQ,GAAG,IAAI,CAAC;AACpB,CAAC,CAAA;AACD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAGtB;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,MAAM,CAAC,KAAgB;IACnC,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AACnC,CAAC;AACD,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC;AACnB,MAAM,CAAC,IAAI,GAAG,cAAmB,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;AACpD,MAAM,CAAC,QAAQ,GAAG,UAAS,IAAqC;IAC5D,IAAI,SAAS,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;KAAE;IACvD,QAAQ,GAAG,IAAI,CAAC;AACpB,CAAC,CAAA;AACD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/signature.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/signature.d.ts deleted file mode 100644 index ab39d2a8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/signature.d.ts +++ /dev/null @@ -1,183 +0,0 @@ -import type { BigNumberish, BytesLike } from "../utils/index.js"; -declare const inspect: unique symbol; -/** - * A SignatureLike - * - * @_docloc: api/crypto:Signing - */ -export type SignatureLike = Signature | string | { - r: string; - s: string; - v: BigNumberish; - yParity?: 0 | 1; - yParityAndS?: string; -} | { - r: string; - yParityAndS: string; - yParity?: 0 | 1; - s?: string; - v?: number; -} | { - r: string; - s: string; - yParity: 0 | 1; - v?: BigNumberish; - yParityAndS?: string; -}; -/** - * A Signature @TODO - * - * - * @_docloc: api/crypto:Signing - */ -export declare class Signature { - #private; - /** - * The ``r`` value for a signature. - * - * This represents the ``x`` coordinate of a "reference" or - * challenge point, from which the ``y`` can be computed. - */ - get r(): string; - set r(value: BytesLike); - /** - * The ``s`` value for a signature. - */ - get s(): string; - set s(_value: BytesLike); - /** - * Return the s value, unchecked for EIP-2 compliance. - * - * This should generally not be used and is for situations where - * a non-canonical S value might be relevant, such as Frontier blocks - * that were mined prior to EIP-2 or invalid Authorization List - * signatures. - */ - get _s(): string; - /** - * Returns true if the Signature is valid for [[link-eip-2]] signatures. - */ - isValid(): boolean; - /** - * The ``v`` value for a signature. - * - * Since a given ``x`` value for ``r`` has two possible values for - * its correspondin ``y``, the ``v`` indicates which of the two ``y`` - * values to use. - * - * It is normalized to the values ``27`` or ``28`` for legacy - * purposes. - */ - get v(): 27 | 28; - set v(value: BigNumberish); - /** - * The EIP-155 ``v`` for legacy transactions. For non-legacy - * transactions, this value is ``null``. - */ - get networkV(): null | bigint; - /** - * The chain ID for EIP-155 legacy transactions. For non-legacy - * transactions, this value is ``null``. - */ - get legacyChainId(): null | bigint; - /** - * The ``yParity`` for the signature. - * - * See ``v`` for more details on how this value is used. - */ - get yParity(): 0 | 1; - /** - * The [[link-eip-2098]] compact representation of the ``yParity`` - * and ``s`` compacted into a single ``bytes32``. - */ - get yParityAndS(): string; - /** - * The [[link-eip-2098]] compact representation. - */ - get compactSerialized(): string; - /** - * The serialized representation. - */ - get serialized(): string; - /** - * @private - */ - constructor(guard: any, r: string, s: string, v: 27 | 28); - /** - * Returns the canonical signature. - * - * This is only necessary when dealing with legacy transaction which - * did not enforce canonical S values (i.e. [[link-eip-2]]. Most - * developers should never require this. - */ - getCanonical(): Signature; - /** - * Returns a new identical [[Signature]]. - */ - clone(): Signature; - /** - * Returns a representation that is compatible with ``JSON.stringify``. - */ - toJSON(): any; - [inspect](): string; - toString(): string; - /** - * Compute the chain ID from the ``v`` in a legacy EIP-155 transactions. - * - * @example: - * Signature.getChainId(45) - * //_result: - * - * Signature.getChainId(46) - * //_result: - */ - static getChainId(v: BigNumberish): bigint; - /** - * Compute the ``v`` for a chain ID for a legacy EIP-155 transactions. - * - * Legacy transactions which use [[link-eip-155]] hijack the ``v`` - * property to include the chain ID. - * - * @example: - * Signature.getChainIdV(5, 27) - * //_result: - * - * Signature.getChainIdV(5, 28) - * //_result: - * - */ - static getChainIdV(chainId: BigNumberish, v: 27 | 28): bigint; - /** - * Compute the normalized legacy transaction ``v`` from a ``yParirty``, - * a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction. - * - * @example: - * // The values 0 and 1 imply v is actually yParity - * Signature.getNormalizedV(0) - * //_result: - * - * // Legacy non-EIP-1559 transaction (i.e. 27 or 28) - * Signature.getNormalizedV(27) - * //_result: - * - * // Legacy EIP-155 transaction (i.e. >= 35) - * Signature.getNormalizedV(46) - * //_result: - * - * // Invalid values throw - * Signature.getNormalizedV(5) - * //_error: - */ - static getNormalizedV(v: BigNumberish): 27 | 28; - /** - * Creates a new [[Signature]]. - * - * If no %%sig%% is provided, a new [[Signature]] is created - * with default values. - * - * If %%sig%% is a string, it is parsed. - */ - static from(sig?: SignatureLike): Signature; -} -export {}; -//# sourceMappingURL=signature.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/signature.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/signature.d.ts.map deleted file mode 100644 index 4ee80592..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/signature.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/signature.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACR,YAAY,EAAE,SAAS,EAC1B,MAAM,mBAAmB,CAA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jC;IAED;;;;OAIG;IACH,IAAI,OAAO,IAAI,CAAC,GAAG,CAAC,CAEnB;IAED;;;OAGG;IACH,IAAI,WAAW,IAAI,MAAM,CAKxB;IAED;;OAEG;IACH,IAAI,iBAAiB,IAAI,MAAM,CAE9B;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED;;OAEG;gBACS,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE;IAQxD;;;;;;OAMG;IACH,YAAY,IAAI,SAAS;IAczB;;OAEG;IACH,KAAK,IAAI,SAAS;IAMlB;;OAEG;IACH,MAAM,IAAI,GAAG;IASb,CAAC,OAAO,CAAC,IAAI,MAAM;IAInB,QAAQ,IAAI,MAAM;IAOlB;;;;;;;;;OASG;IACH,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE,YAAY,GAAG,MAAM;IAY1C;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,YAAY,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,MAAM;IAI7D;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,YAAY,GAAG,EAAE,GAAG,EAAE;IAY/C;;;;;;;OAOG;IACH,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,aAAa,GAAG,SAAS;CAqF9C"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/signature.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/signature.js deleted file mode 100644 index 42d4c92e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/signature.js +++ /dev/null @@ -1,346 +0,0 @@ -import { ZeroHash } from "../constants/index.js"; -import { concat, dataLength, getBigInt, getBytes, getNumber, hexlify, toBeArray, isHexString, zeroPadValue, assertArgument, assertPrivate } from "../utils/index.js"; -// Constants -const BN_0 = BigInt(0); -const BN_1 = BigInt(1); -const BN_2 = BigInt(2); -const BN_27 = BigInt(27); -const BN_28 = BigInt(28); -const BN_35 = BigInt(35); -const BN_N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); -const BN_N_2 = BN_N / BN_2; // Must be integer (floor) division; do NOT shifts -const inspect = Symbol.for("nodejs.util.inspect.custom"); -const _guard = {}; -function toUint256(value) { - return zeroPadValue(toBeArray(value), 32); -} -/** - * A Signature @TODO - * - * - * @_docloc: api/crypto:Signing - */ -export class Signature { - #r; - #s; - #v; - #networkV; - /** - * The ``r`` value for a signature. - * - * This represents the ``x`` coordinate of a "reference" or - * challenge point, from which the ``y`` can be computed. - */ - get r() { return this.#r; } - set r(value) { - assertArgument(dataLength(value) === 32, "invalid r", "value", value); - this.#r = hexlify(value); - } - /** - * The ``s`` value for a signature. - */ - get s() { - assertArgument(parseInt(this.#s.substring(0, 3)) < 8, "non-canonical s; use ._s", "s", this.#s); - return this.#s; - } - set s(_value) { - assertArgument(dataLength(_value) === 32, "invalid s", "value", _value); - this.#s = hexlify(_value); - } - /** - * Return the s value, unchecked for EIP-2 compliance. - * - * This should generally not be used and is for situations where - * a non-canonical S value might be relevant, such as Frontier blocks - * that were mined prior to EIP-2 or invalid Authorization List - * signatures. - */ - get _s() { return this.#s; } - /** - * Returns true if the Signature is valid for [[link-eip-2]] signatures. - */ - isValid() { - const s = BigInt(this.#s); - return (s <= BN_N_2); - } - /** - * The ``v`` value for a signature. - * - * Since a given ``x`` value for ``r`` has two possible values for - * its correspondin ``y``, the ``v`` indicates which of the two ``y`` - * values to use. - * - * It is normalized to the values ``27`` or ``28`` for legacy - * purposes. - */ - get v() { return this.#v; } - set v(value) { - const v = getNumber(value, "value"); - assertArgument(v === 27 || v === 28, "invalid v", "v", value); - this.#v = v; - } - /** - * The EIP-155 ``v`` for legacy transactions. For non-legacy - * transactions, this value is ``null``. - */ - get networkV() { return this.#networkV; } - /** - * The chain ID for EIP-155 legacy transactions. For non-legacy - * transactions, this value is ``null``. - */ - get legacyChainId() { - const v = this.networkV; - if (v == null) { - return null; - } - return Signature.getChainId(v); - } - /** - * The ``yParity`` for the signature. - * - * See ``v`` for more details on how this value is used. - */ - get yParity() { - return (this.v === 27) ? 0 : 1; - } - /** - * The [[link-eip-2098]] compact representation of the ``yParity`` - * and ``s`` compacted into a single ``bytes32``. - */ - get yParityAndS() { - // The EIP-2098 compact representation - const yParityAndS = getBytes(this.s); - if (this.yParity) { - yParityAndS[0] |= 0x80; - } - return hexlify(yParityAndS); - } - /** - * The [[link-eip-2098]] compact representation. - */ - get compactSerialized() { - return concat([this.r, this.yParityAndS]); - } - /** - * The serialized representation. - */ - get serialized() { - return concat([this.r, this.s, (this.yParity ? "0x1c" : "0x1b")]); - } - /** - * @private - */ - constructor(guard, r, s, v) { - assertPrivate(guard, _guard, "Signature"); - this.#r = r; - this.#s = s; - this.#v = v; - this.#networkV = null; - } - /** - * Returns the canonical signature. - * - * This is only necessary when dealing with legacy transaction which - * did not enforce canonical S values (i.e. [[link-eip-2]]. Most - * developers should never require this. - */ - getCanonical() { - if (this.isValid()) { - return this; - } - // Compute the canonical signature; s' = N - s, v = !v - const s = BN_N - BigInt(this._s); - const v = (55 - this.v); - const result = new Signature(_guard, this.r, toUint256(s), v); - // Populate the networkV if necessary - if (this.networkV) { - result.#networkV = this.networkV; - } - return result; - } - /** - * Returns a new identical [[Signature]]. - */ - clone() { - const clone = new Signature(_guard, this.r, this._s, this.v); - if (this.networkV) { - clone.#networkV = this.networkV; - } - return clone; - } - /** - * Returns a representation that is compatible with ``JSON.stringify``. - */ - toJSON() { - const networkV = this.networkV; - return { - _type: "signature", - networkV: ((networkV != null) ? networkV.toString() : null), - r: this.r, s: this._s, v: this.v, - }; - } - [inspect]() { - return this.toString(); - } - toString() { - if (this.isValid()) { - return `Signature { r: ${this.r}, s: ${this._s}, v: ${this.v} }`; - } - return `Signature { r: ${this.r}, s: ${this._s}, v: ${this.v}, valid: false }`; - } - /** - * Compute the chain ID from the ``v`` in a legacy EIP-155 transactions. - * - * @example: - * Signature.getChainId(45) - * //_result: - * - * Signature.getChainId(46) - * //_result: - */ - static getChainId(v) { - const bv = getBigInt(v, "v"); - // The v is not an EIP-155 v, so it is the unspecified chain ID - if ((bv == BN_27) || (bv == BN_28)) { - return BN_0; - } - // Bad value for an EIP-155 v - assertArgument(bv >= BN_35, "invalid EIP-155 v", "v", v); - return (bv - BN_35) / BN_2; - } - /** - * Compute the ``v`` for a chain ID for a legacy EIP-155 transactions. - * - * Legacy transactions which use [[link-eip-155]] hijack the ``v`` - * property to include the chain ID. - * - * @example: - * Signature.getChainIdV(5, 27) - * //_result: - * - * Signature.getChainIdV(5, 28) - * //_result: - * - */ - static getChainIdV(chainId, v) { - return (getBigInt(chainId) * BN_2) + BigInt(35 + v - 27); - } - /** - * Compute the normalized legacy transaction ``v`` from a ``yParirty``, - * a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction. - * - * @example: - * // The values 0 and 1 imply v is actually yParity - * Signature.getNormalizedV(0) - * //_result: - * - * // Legacy non-EIP-1559 transaction (i.e. 27 or 28) - * Signature.getNormalizedV(27) - * //_result: - * - * // Legacy EIP-155 transaction (i.e. >= 35) - * Signature.getNormalizedV(46) - * //_result: - * - * // Invalid values throw - * Signature.getNormalizedV(5) - * //_error: - */ - static getNormalizedV(v) { - const bv = getBigInt(v); - if (bv === BN_0 || bv === BN_27) { - return 27; - } - if (bv === BN_1 || bv === BN_28) { - return 28; - } - assertArgument(bv >= BN_35, "invalid v", "v", v); - // Otherwise, EIP-155 v means odd is 27 and even is 28 - return (bv & BN_1) ? 27 : 28; - } - /** - * Creates a new [[Signature]]. - * - * If no %%sig%% is provided, a new [[Signature]] is created - * with default values. - * - * If %%sig%% is a string, it is parsed. - */ - static from(sig) { - function assertError(check, message) { - assertArgument(check, message, "signature", sig); - } - ; - if (sig == null) { - return new Signature(_guard, ZeroHash, ZeroHash, 27); - } - if (typeof (sig) === "string") { - const bytes = getBytes(sig, "signature"); - if (bytes.length === 64) { - const r = hexlify(bytes.slice(0, 32)); - const s = bytes.slice(32, 64); - const v = (s[0] & 0x80) ? 28 : 27; - s[0] &= 0x7f; - return new Signature(_guard, r, hexlify(s), v); - } - if (bytes.length === 65) { - const r = hexlify(bytes.slice(0, 32)); - const s = hexlify(bytes.slice(32, 64)); - const v = Signature.getNormalizedV(bytes[64]); - return new Signature(_guard, r, s, v); - } - assertError(false, "invalid raw signature length"); - } - if (sig instanceof Signature) { - return sig.clone(); - } - // Get r - const _r = sig.r; - assertError(_r != null, "missing r"); - const r = toUint256(_r); - // Get s; by any means necessary (we check consistency below) - const s = (function (s, yParityAndS) { - if (s != null) { - return toUint256(s); - } - if (yParityAndS != null) { - assertError(isHexString(yParityAndS, 32), "invalid yParityAndS"); - const bytes = getBytes(yParityAndS); - bytes[0] &= 0x7f; - return hexlify(bytes); - } - assertError(false, "missing s"); - })(sig.s, sig.yParityAndS); - // Get v; by any means necessary (we check consistency below) - const { networkV, v } = (function (_v, yParityAndS, yParity) { - if (_v != null) { - const v = getBigInt(_v); - return { - networkV: ((v >= BN_35) ? v : undefined), - v: Signature.getNormalizedV(v) - }; - } - if (yParityAndS != null) { - assertError(isHexString(yParityAndS, 32), "invalid yParityAndS"); - return { v: ((getBytes(yParityAndS)[0] & 0x80) ? 28 : 27) }; - } - if (yParity != null) { - switch (getNumber(yParity, "sig.yParity")) { - case 0: return { v: 27 }; - case 1: return { v: 28 }; - } - assertError(false, "invalid yParity"); - } - assertError(false, "missing v"); - })(sig.v, sig.yParityAndS, sig.yParity); - const result = new Signature(_guard, r, s, v); - if (networkV) { - result.#networkV = networkV; - } - // If multiple of v, yParity, yParityAndS we given, check they match - assertError(sig.yParity == null || getNumber(sig.yParity, "sig.yParity") === result.yParity, "yParity mismatch"); - assertError(sig.yParityAndS == null || sig.yParityAndS === result.yParityAndS, "yParityAndS mismatch"); - return result; - } -} -//# sourceMappingURL=signature.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/signature.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/signature.js.map deleted file mode 100644 index 20a4130c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/signature.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signature.js","sourceRoot":"","sources":["../../src.ts/crypto/signature.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EACH,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAC3D,SAAS,EAAE,WAAW,EAAE,YAAY,EACpC,cAAc,EAAE,aAAa,EAChC,MAAM,mBAAmB,CAAC;AAO3B,YAAY;AACZ,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;AACzB,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;AACzB,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;AACzB,MAAM,IAAI,GAAG,MAAM,CAAC,oEAAoE,CAAC,CAAC;AAC1F,MAAM,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,kDAAkD;AAE9E,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAEzD,MAAM,MAAM,GAAG,EAAG,CAAC;AA6BnB,SAAS,SAAS,CAAC,KAAmB;IAClC,OAAO,YAAY,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;AAC9C,CAAC;AAED;;;;;GAKG;AACH,MAAM,OAAO,SAAS;I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E,CAAC;iBAC5B;gBACD,WAAW,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC;aACzC;YAED,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;QAExC,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAC9C,IAAI,QAAQ,EAAE;YAAE,MAAM,CAAC,SAAS,GAAI,QAAQ,CAAC;SAAE;QAE/C,oEAAoE;QACpE,WAAW,CAAC,GAAG,CAAC,OAAO,IAAI,IAAI,IAAI,SAAS,CAAC,GAAG,CAAC,OAAO,EAAE,aAAa,CAAC,KAAK,MAAM,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;QACjH,WAAW,CAAC,GAAG,CAAC,WAAW,IAAI,IAAI,IAAI,GAAG,CAAC,WAAW,KAAK,MAAM,CAAC,WAAW,EAAE,sBAAsB,CAAC,CAAC;QAEvG,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/signing-key.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/signing-key.d.ts deleted file mode 100644 index 0864d3b8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/signing-key.d.ts +++ /dev/null @@ -1,122 +0,0 @@ -/** - * Add details about signing here. - * - * @_subsection: api/crypto:Signing [about-signing] - */ -import { Signature } from "./signature.js"; -import type { BytesLike } from "../utils/index.js"; -import type { SignatureLike } from "./index.js"; -/** - * A **SigningKey** provides high-level access to the elliptic curve - * cryptography (ECC) operations and key management. - */ -export declare class SigningKey { - #private; - /** - * Creates a new **SigningKey** for %%privateKey%%. - */ - constructor(privateKey: BytesLike); - /** - * The private key. - */ - get privateKey(): string; - /** - * The uncompressed public key. - * - * This will always begin with the prefix ``0x04`` and be 132 - * characters long (the ``0x`` prefix and 130 hexadecimal nibbles). - */ - get publicKey(): string; - /** - * The compressed public key. - * - * This will always begin with either the prefix ``0x02`` or ``0x03`` - * and be 68 characters long (the ``0x`` prefix and 33 hexadecimal - * nibbles) - */ - get compressedPublicKey(): string; - /** - * Return the signature of the signed %%digest%%. - */ - sign(digest: BytesLike): Signature; - /** - * Returns the [[link-wiki-ecdh]] shared secret between this - * private key and the %%other%% key. - * - * The %%other%% key may be any type of key, a raw public key, - * a compressed/uncompressed pubic key or aprivate key. - * - * Best practice is usually to use a cryptographic hash on the - * returned value before using it as a symetric secret. - * - * @example: - * sign1 = new SigningKey(id("some-secret-1")) - * sign2 = new SigningKey(id("some-secret-2")) - * - * // Notice that privA.computeSharedSecret(pubB)... - * sign1.computeSharedSecret(sign2.publicKey) - * //_result: - * - * // ...is equal to privB.computeSharedSecret(pubA). - * sign2.computeSharedSecret(sign1.publicKey) - * //_result: - */ - computeSharedSecret(other: BytesLike): string; - /** - * Compute the public key for %%key%%, optionally %%compressed%%. - * - * The %%key%% may be any type of key, a raw public key, a - * compressed/uncompressed public key or private key. - * - * @example: - * sign = new SigningKey(id("some-secret")); - * - * // Compute the uncompressed public key for a private key - * SigningKey.computePublicKey(sign.privateKey) - * //_result: - * - * // Compute the compressed public key for a private key - * SigningKey.computePublicKey(sign.privateKey, true) - * //_result: - * - * // Compute the uncompressed public key - * SigningKey.computePublicKey(sign.publicKey, false); - * //_result: - * - * // Compute the Compressed a public key - * SigningKey.computePublicKey(sign.publicKey, true); - * //_result: - */ - static computePublicKey(key: BytesLike, compressed?: boolean): string; - /** - * Returns the public key for the private key which produced the - * %%signature%% for the given %%digest%%. - * - * @example: - * key = new SigningKey(id("some-secret")) - * digest = id("hello world") - * sig = key.sign(digest) - * - * // Notice the signer public key... - * key.publicKey - * //_result: - * - * // ...is equal to the recovered public key - * SigningKey.recoverPublicKey(digest, sig) - * //_result: - * - */ - static recoverPublicKey(digest: BytesLike, signature: SignatureLike): string; - /** - * Returns the point resulting from adding the ellipic curve points - * %%p0%% and %%p1%%. - * - * This is not a common function most developers should require, but - * can be useful for certain privacy-specific techniques. - * - * For example, it is used by [[HDNodeWallet]] to compute child - * addresses from parent public keys and chain codes. - */ - static addPoints(p0: BytesLike, p1: BytesLike, compressed?: boolean): string; -} -//# sourceMappingURL=signing-key.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/signing-key.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/signing-key.d.ts.map deleted file mode 100644 index 6ce11800..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/signing-key.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signing-key.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/signing-key.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD;;;GAGG;AACH,qBAAa,UAAU;;IAGnB;;OAEG;gBACS,UAAU,EAAE,SAAS;IAKjC;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAA6B;IAErD;;;;;OAKG;IACH,IAAI,SAAS,IAAI,MAAM,CAA0D;IAEjF;;;;;;OAMG;IACH,IAAI,mBAAmB,IAAI,MAAM,CAAgE;IAEjG;;OAEG;IACH,IAAI,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS;IAclC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM;IAK7C;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM;IAqBrE;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,GAAG,MAAM;IAc5E;;;;;;;;;OASG;IACH,MAAM,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM;CAK/E"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/signing-key.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/signing-key.js deleted file mode 100644 index 28baab54..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/signing-key.js +++ /dev/null @@ -1,166 +0,0 @@ -/** - * Add details about signing here. - * - * @_subsection: api/crypto:Signing [about-signing] - */ -import { secp256k1 } from "@noble/curves/secp256k1"; -import { concat, dataLength, getBytes, getBytesCopy, hexlify, toBeHex, assertArgument } from "../utils/index.js"; -import { Signature } from "./signature.js"; -/** - * A **SigningKey** provides high-level access to the elliptic curve - * cryptography (ECC) operations and key management. - */ -export class SigningKey { - #privateKey; - /** - * Creates a new **SigningKey** for %%privateKey%%. - */ - constructor(privateKey) { - assertArgument(dataLength(privateKey) === 32, "invalid private key", "privateKey", "[REDACTED]"); - this.#privateKey = hexlify(privateKey); - } - /** - * The private key. - */ - get privateKey() { return this.#privateKey; } - /** - * The uncompressed public key. - * - * This will always begin with the prefix ``0x04`` and be 132 - * characters long (the ``0x`` prefix and 130 hexadecimal nibbles). - */ - get publicKey() { return SigningKey.computePublicKey(this.#privateKey); } - /** - * The compressed public key. - * - * This will always begin with either the prefix ``0x02`` or ``0x03`` - * and be 68 characters long (the ``0x`` prefix and 33 hexadecimal - * nibbles) - */ - get compressedPublicKey() { return SigningKey.computePublicKey(this.#privateKey, true); } - /** - * Return the signature of the signed %%digest%%. - */ - sign(digest) { - assertArgument(dataLength(digest) === 32, "invalid digest length", "digest", digest); - const sig = secp256k1.sign(getBytesCopy(digest), getBytesCopy(this.#privateKey), { - lowS: true - }); - return Signature.from({ - r: toBeHex(sig.r, 32), - s: toBeHex(sig.s, 32), - v: (sig.recovery ? 0x1c : 0x1b) - }); - } - /** - * Returns the [[link-wiki-ecdh]] shared secret between this - * private key and the %%other%% key. - * - * The %%other%% key may be any type of key, a raw public key, - * a compressed/uncompressed pubic key or aprivate key. - * - * Best practice is usually to use a cryptographic hash on the - * returned value before using it as a symetric secret. - * - * @example: - * sign1 = new SigningKey(id("some-secret-1")) - * sign2 = new SigningKey(id("some-secret-2")) - * - * // Notice that privA.computeSharedSecret(pubB)... - * sign1.computeSharedSecret(sign2.publicKey) - * //_result: - * - * // ...is equal to privB.computeSharedSecret(pubA). - * sign2.computeSharedSecret(sign1.publicKey) - * //_result: - */ - computeSharedSecret(other) { - const pubKey = SigningKey.computePublicKey(other); - return hexlify(secp256k1.getSharedSecret(getBytesCopy(this.#privateKey), getBytes(pubKey), false)); - } - /** - * Compute the public key for %%key%%, optionally %%compressed%%. - * - * The %%key%% may be any type of key, a raw public key, a - * compressed/uncompressed public key or private key. - * - * @example: - * sign = new SigningKey(id("some-secret")); - * - * // Compute the uncompressed public key for a private key - * SigningKey.computePublicKey(sign.privateKey) - * //_result: - * - * // Compute the compressed public key for a private key - * SigningKey.computePublicKey(sign.privateKey, true) - * //_result: - * - * // Compute the uncompressed public key - * SigningKey.computePublicKey(sign.publicKey, false); - * //_result: - * - * // Compute the Compressed a public key - * SigningKey.computePublicKey(sign.publicKey, true); - * //_result: - */ - static computePublicKey(key, compressed) { - let bytes = getBytes(key, "key"); - // private key - if (bytes.length === 32) { - const pubKey = secp256k1.getPublicKey(bytes, !!compressed); - return hexlify(pubKey); - } - // raw public key; use uncompressed key with 0x04 prefix - if (bytes.length === 64) { - const pub = new Uint8Array(65); - pub[0] = 0x04; - pub.set(bytes, 1); - bytes = pub; - } - const point = secp256k1.ProjectivePoint.fromHex(bytes); - return hexlify(point.toRawBytes(compressed)); - } - /** - * Returns the public key for the private key which produced the - * %%signature%% for the given %%digest%%. - * - * @example: - * key = new SigningKey(id("some-secret")) - * digest = id("hello world") - * sig = key.sign(digest) - * - * // Notice the signer public key... - * key.publicKey - * //_result: - * - * // ...is equal to the recovered public key - * SigningKey.recoverPublicKey(digest, sig) - * //_result: - * - */ - static recoverPublicKey(digest, signature) { - assertArgument(dataLength(digest) === 32, "invalid digest length", "digest", digest); - const sig = Signature.from(signature); - let secpSig = secp256k1.Signature.fromCompact(getBytesCopy(concat([sig.r, sig.s]))); - secpSig = secpSig.addRecoveryBit(sig.yParity); - const pubKey = secpSig.recoverPublicKey(getBytesCopy(digest)); - assertArgument(pubKey != null, "invalid signature for digest", "signature", signature); - return "0x" + pubKey.toHex(false); - } - /** - * Returns the point resulting from adding the ellipic curve points - * %%p0%% and %%p1%%. - * - * This is not a common function most developers should require, but - * can be useful for certain privacy-specific techniques. - * - * For example, it is used by [[HDNodeWallet]] to compute child - * addresses from parent public keys and chain codes. - */ - static addPoints(p0, p1, compressed) { - const pub0 = secp256k1.ProjectivePoint.fromHex(SigningKey.computePublicKey(p0).substring(2)); - const pub1 = secp256k1.ProjectivePoint.fromHex(SigningKey.computePublicKey(p1).substring(2)); - return "0x" + pub0.add(pub1).toHex(!!compressed); - } -} -//# sourceMappingURL=signing-key.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/signing-key.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/signing-key.js.map deleted file mode 100644 index d6cf8890..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/crypto/signing-key.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signing-key.js","sourceRoot":"","sources":["../../src.ts/crypto/signing-key.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EACH,MAAM,EAAE,UA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m/ethers.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/ethers.d.ts deleted file mode 100644 index 11d3614e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/ethers.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -export { version } from "./_version.js"; -export { decodeBytes32String, encodeBytes32String, AbiCoder, ConstructorFragment, ErrorFragment, EventFragment, Fragment, FallbackFragment, FunctionFragment, NamedFragment, ParamType, StructFragment, checkResultErrors, ErrorDescription, Indexed, Interface, LogDescription, Result, TransactionDescription, Typed, } from "./abi/index.js"; -export { getAddress, getIcapAddress, getCreateAddress, getCreate2Address, isAddressable, isAddress, resolveAddress } from "./address/index.js"; -export { ZeroAddress, WeiPerEther, MaxUint256, MinInt256, MaxInt256, N, ZeroHash, EtherSymbol, MessagePrefix } from "./constants/index.js"; -export { BaseContract, Contract, ContractFactory, ContractEventPayload, ContractTransactionReceipt, ContractTransactionResponse, ContractUnknownEventPayload, EventLog, UndecodedEventLog } from "./contract/index.js"; -export { computeHmac, randomBytes, keccak256, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync, lock, Signature, SigningKey } from "./crypto/index.js"; -export { id, ensNormalize, isValidName, namehash, dnsEncode, hashAuthorization, verifyAuthorization, hashMessage, verifyMessage, solidityPacked, solidityPackedKeccak256, solidityPackedSha256, TypedDataEncoder, verifyTypedData } from "./hash/index.js"; -export { getDefaultProvider, Block, FeeData, Log, TransactionReceipt, TransactionResponse, AbstractSigner, NonceManager, VoidSigner, AbstractProvider, FallbackProvider, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, BrowserProvider, AlchemyProvider, AnkrProvider, BlockscoutProvider, ChainstackProvider, CloudflareProvider, EtherscanProvider, InfuraProvider, InfuraWebSocketProvider, PocketProvider, QuickNodeProvider, IpcSocketProvider, SocketProvider, WebSocketProvider, EnsResolver, Network, EnsPlugin, EtherscanPlugin, FeeDataNetworkPlugin, FetchUrlFeeDataNetworkPlugin, GasCostPlugin, NetworkPlugin, MulticoinProviderPlugin, SocketBlockSubscriber, SocketEventSubscriber, SocketPendingSubscriber, SocketSubscriber, UnmanagedSubscriber, copyRequest, showThrottleMessage } from "./providers/index.js"; -export { accessListify, authorizationify, computeAddress, recoverAddress, Transaction } from "./transaction/index.js"; -export { decodeBase58, encodeBase58, decodeBase64, encodeBase64, concat, dataLength, dataSlice, getBytes, getBytesCopy, hexlify, isHexString, isBytesLike, stripZerosLeft, zeroPadBytes, zeroPadValue, defineProperties, resolveProperties, assert, assertArgument, assertArgumentCount, assertNormalize, assertPrivate, makeError, isCallException, isError, EventPayload, FetchRequest, FetchResponse, FetchCancelSignal, FixedNumber, getBigInt, getNumber, getUint, toBeArray, toBigInt, toBeHex, toNumber, toQuantity, fromTwos, toTwos, mask, formatEther, parseEther, formatUnits, parseUnits, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, decodeRlp, encodeRlp, uuidV4, } from "./utils/index.js"; -export { Mnemonic, BaseWallet, HDNodeWallet, HDNodeVoidWallet, Wallet, defaultPath, getAccountPath, getIndexedAccountPath, isCrowdsaleJson, isKeystoreJson, decryptCrowdsaleJson, decryptKeystoreJsonSync, decryptKeystoreJson, encryptKeystoreJson, encryptKeystoreJsonSync, } from "./wallet/index.js"; -export { Wordlist, LangEn, WordlistOwl, WordlistOwlA, wordlists } from "./wordlists/index.js"; -export type { JsonFragment, JsonFragmentType, FormatType, FragmentType, InterfaceAbi, ParamTypeWalkFunc, ParamTypeWalkAsyncFunc } from "./abi/index.js"; -export type { Addressable, AddressLike, NameResolver } from "./address/index.js"; -export type { ConstantContractMethod, ContractEvent, ContractEventArgs, ContractEventName, ContractInterface, ContractMethod, ContractMethodArgs, ContractTransaction, DeferredTopicFilter, Overrides, BaseContractMethod, ContractDeployTransaction, PostfixOverrides, WrappedFallback } from "./contract/index.js"; -export type { ProgressCallback, SignatureLike } from "./crypto/index.js"; -export type { AuthorizationRequest, TypedDataDomain, TypedDataField } from "./hash/index.js"; -export type { Provider, Signer, CommunityResourcable, AbstractProviderOptions, BrowserProviderOptions, FallbackProviderOptions, AbstractProviderPlugin, BlockParams, BlockTag, BrowserDiscoverOptions, ContractRunner, DebugEventBrowserProvider, Eip1193Provider, Eip6963ProviderInfo, EventFilter, Filter, FilterByBlockHash, GasCostParameters, JsonRpcApiProviderOptions, JsonRpcError, JsonRpcPayload, JsonRpcResult, JsonRpcTransactionRequest, LogParams, MinedBlock, MinedTransactionResponse, Networkish, OrphanFilter, PerformActionFilter, PerformActionRequest, PerformActionTransaction, PreparedTransactionRequest, ProviderEvent, Subscriber, Subscription, TopicFilter, TransactionReceiptParams, TransactionRequest, TransactionResponseParams, WebSocketCreator, WebSocketLike } from "./providers/index.js"; -export type { AccessList, AccessListish, AccessListEntry, Authorization, AuthorizationLike, Blob, BlobLike, KzgLibrary, KzgLibraryLike, TransactionLike } from "./transaction/index.js"; -export type { BytesLike, BigNumberish, Numeric, ErrorCode, FixedFormat, Utf8ErrorFunc, UnicodeNormalizationForm, Utf8ErrorReason, RlpStructuredData, RlpStructuredDataish, GetUrlResponse, FetchPreflightFunc, FetchProcessFunc, FetchRetryFunc, FetchGatewayFunc, FetchGetUrlFunc, EthersError, UnknownError, NotImplementedError, UnsupportedOperationError, NetworkError, ServerError, TimeoutError, BadDataError, CancelledError, BufferOverrunError, NumericFaultError, InvalidArgumentError, MissingArgumentError, UnexpectedArgumentError, CallExceptionError, InsufficientFundsError, NonceExpiredError, OffchainFaultError, ReplacementUnderpricedError, TransactionReplacedError, UnconfiguredNameError, ActionRejectedError, CodedEthersError, CallExceptionAction, CallExceptionTransaction, EventEmitterable, Listener } from "./utils/index.js"; -export type { CrowdsaleAccount, KeystoreAccount, EncryptOptions } from "./wallet/index.js"; -//# sourceMappingURL=ethers.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/ethers.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/ethers.d.ts.map deleted file mode 100644 index d7cab7f1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/ethers.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ethers.d.ts","sourceRoot":"","sources":["../src.ts/ethers.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EACH,mBAAmB,EAAE,mBAAmB,EAExC,QAAQ,EACR,mBAAmB,EAAE,aAAa,EAAE,aAAa,EAAE,QAAQ,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAEzI,iBAAiB,EAAE,gBAAgB,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,sBAAsB,EACvG,KAAK,GACR,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACH,UAAU,EAAE,cAAc,EAC1B,gBAAgB,EAAE,iBAAiB,EACnC,aAAa,EAAE,SAAS,EAAE,cAAc,EAC3C,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACH,WAAW,EACX,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,EAChD,QAAQ,EACR,WAAW,EAAE,aAAa,EAC7B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACH,YAAY,EAAE,QAAQ,EACtB,eAAe,EACf,oBAAoB,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,QAAQ,EAAE,iBAAiB,EAC1I,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACH,WAAW,EACX,WAAW,EACX,SAAS,EACT,SAAS,EACT,MAAM,EAAE,MAAM,EACd,MAAM,EACN,MAAM,EAAE,UAAU,EAClB,IAAI,EACJ,SAAS,EAAE,UAAU,EACxB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACH,EAAE,EACF,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAC9C,iBAAiB,EAAE,mBAAmB,EACtC,WAAW,EAAE,aAAa,E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AC5E,mBAAmB,EACnB,gBAAgB,EAEhB,mBAAmB,EAAE,wBAAwB,EAC7C,gBAAgB,EAAE,QAAQ,EAC7B,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACR,gBAAgB,EAAE,eAAe,EAAE,cAAc,EACpD,MAAM,mBAAmB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/ethers.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/ethers.js deleted file mode 100644 index 630d3169..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/ethers.js +++ /dev/null @@ -1,16 +0,0 @@ -///////////////////////////// -// -export { version } from "./_version.js"; -export { decodeBytes32String, encodeBytes32String, AbiCoder, ConstructorFragment, ErrorFragment, EventFragment, Fragment, FallbackFragment, FunctionFragment, NamedFragment, ParamType, StructFragment, checkResultErrors, ErrorDescription, Indexed, Interface, LogDescription, Result, TransactionDescription, Typed, } from "./abi/index.js"; -export { getAddress, getIcapAddress, getCreateAddress, getCreate2Address, isAddressable, isAddress, resolveAddress } from "./address/index.js"; -export { ZeroAddress, WeiPerEther, MaxUint256, MinInt256, MaxInt256, N, ZeroHash, EtherSymbol, MessagePrefix } from "./constants/index.js"; -export { BaseContract, Contract, ContractFactory, ContractEventPayload, ContractTransactionReceipt, ContractTransactionResponse, ContractUnknownEventPayload, EventLog, UndecodedEventLog } from "./contract/index.js"; -export { computeHmac, randomBytes, keccak256, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync, lock, Signature, SigningKey } from "./crypto/index.js"; -export { id, ensNormalize, isValidName, namehash, dnsEncode, hashAuthorization, verifyAuthorization, hashMessage, verifyMessage, solidityPacked, solidityPackedKeccak256, solidityPackedSha256, TypedDataEncoder, verifyTypedData } from "./hash/index.js"; -export { getDefaultProvider, Block, FeeData, Log, TransactionReceipt, TransactionResponse, AbstractSigner, NonceManager, VoidSigner, AbstractProvider, FallbackProvider, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, BrowserProvider, AlchemyProvider, AnkrProvider, BlockscoutProvider, ChainstackProvider, CloudflareProvider, EtherscanProvider, InfuraProvider, InfuraWebSocketProvider, PocketProvider, QuickNodeProvider, IpcSocketProvider, SocketProvider, WebSocketProvider, EnsResolver, Network, EnsPlugin, EtherscanPlugin, FeeDataNetworkPlugin, FetchUrlFeeDataNetworkPlugin, GasCostPlugin, NetworkPlugin, MulticoinProviderPlugin, SocketBlockSubscriber, SocketEventSubscriber, SocketPendingSubscriber, SocketSubscriber, UnmanagedSubscriber, copyRequest, showThrottleMessage } from "./providers/index.js"; -export { accessListify, authorizationify, computeAddress, recoverAddress, Transaction } from "./transaction/index.js"; -export { decodeBase58, encodeBase58, decodeBase64, encodeBase64, concat, dataLength, dataSlice, getBytes, getBytesCopy, hexlify, isHexString, isBytesLike, stripZerosLeft, zeroPadBytes, zeroPadValue, defineProperties, resolveProperties, assert, assertArgument, assertArgumentCount, assertNormalize, assertPrivate, makeError, isCallException, isError, EventPayload, FetchRequest, FetchResponse, FetchCancelSignal, FixedNumber, getBigInt, getNumber, getUint, toBeArray, toBigInt, toBeHex, toNumber, toQuantity, fromTwos, toTwos, mask, formatEther, parseEther, formatUnits, parseUnits, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, decodeRlp, encodeRlp, uuidV4, } from "./utils/index.js"; -export { Mnemonic, BaseWallet, HDNodeWallet, HDNodeVoidWallet, Wallet, defaultPath, getAccountPath, getIndexedAccountPath, isCrowdsaleJson, isKeystoreJson, decryptCrowdsaleJson, decryptKeystoreJsonSync, decryptKeystoreJson, encryptKeystoreJson, encryptKeystoreJsonSync, } from "./wallet/index.js"; -export { Wordlist, LangEn, WordlistOwl, WordlistOwlA, wordlists } from "./wordlists/index.js"; -// dummy change; to pick-up ws security issue changes -//# sourceMappingURL=ethers.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/ethers.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/ethers.js.map deleted file mode 100644 index 199de075..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/ethers.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ethers.js","sourceRoot":"","sources":["../src.ts/ethers.ts"],"names":[],"mappings":"AAEA,6BAA6B;AAC7B,EAAE;AAEF,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EACH,mBAAmB,EAAE,mBAAmB,EAExC,QAAQ,EACR,mBAAmB,EAAE,aAAa,EAAE,aAAa,EAAE,QAAQ,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAEzI,iBAAiB,EAAE,gBAAgB,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,sBAAsB,EACvG,KAAK,GACR,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACH,UAAU,EAAE,cAAc,EAC1B,gBAAgB,EAAE,iBAAiB,EACnC,aAAa,EAAE,SAAS,EAAE,cAAc,EAC3C,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACH,WAAW,EACX,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,EAChD,QAAQ,EACR,WAAW,EAAE,aAAa,EAC7B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACH,YAAY,EAAE,QAAQ,EACtB,eAAe,EACf,oBAAoB,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,QAAQ,EAAE,iBAAiB,EAC1I,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACH,WAAW,EACX,WAAW,EACX,SAAS,EACT,SAAS,EACT,MAAM,EAAE,MAAM,EACd,MAAM,EACN,MAAM,EAAE,UAAU,EAClB,IAAI,EACJ,SAAS,EAAE,UAAU,EACxB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACH,EAAE,EACF,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAC9C,iBAAi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E,iBAAiB,EAC9C,WAAW,EACX,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EACjF,QAAQ,EAAE,MAAM,EAAE,IAAI,EACtB,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAChD,WAAW,EAAE,gBAAgB,EAAE,YAAY,EAC3C,cAAc,EACd,SAAS,EAAE,SAAS,EACpB,MAAM,GACT,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACH,QAAQ,EACR,UAAU,EAAE,YAAY,EAAE,gBAAgB,EAC1C,MAAM,EAEN,WAAW,EAEX,cAAc,EAAE,qBAAqB,EACrC,eAAe,EAAE,cAAc,EAE/B,oBAAoB,EAAE,uBAAuB,EAAE,mBAAmB,EAClE,mBAAmB,EAAE,uBAAuB,GAC/C,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACH,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EACzD,MAAM,sBAAsB,CAAC;AAsF9B,qDAAqD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/authorization.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/authorization.d.ts deleted file mode 100644 index 0d883a2f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/authorization.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { Addressable } from "../address/index.js"; -import type { SignatureLike } from "../crypto/index.js"; -import type { BigNumberish, Numeric } from "../utils/index.js"; -export interface AuthorizationRequest { - address: string | Addressable; - nonce?: Numeric; - chainId?: BigNumberish; -} -/** - * Computes the [[link-eip-7702]] authorization digest to sign. - */ -export declare function hashAuthorization(auth: AuthorizationRequest): string; -/** - * Return the address of the private key that produced - * the signature %%sig%% during signing for %%message%%. - */ -export declare function verifyAuthorization(auth: AuthorizationRequest, sig: SignatureLike): string; -//# sourceMappingURL=authorization.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/authorization.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/authorization.d.ts.map deleted file mode 100644 index e8899a24..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/authorization.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"authorization.d.ts","sourceRoot":"","sources":["../../src.ts/hash/authorization.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE/D,MAAM,WAAW,oBAAoB;IACjC,OAAO,EAAE,MAAM,GAAG,WAAW,CAAC;IAC9B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,YAAY,CAAC;CAC1B;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,oBAAoB,GAAG,MAAM,CASpE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,oBAAoB,EAAE,GAAG,EAAE,aAAa,GAAG,MAAM,CAE1F"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/authorization.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/authorization.js deleted file mode 100644 index 2eae6488..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/authorization.js +++ /dev/null @@ -1,25 +0,0 @@ -import { getAddress } from "../address/index.js"; -import { keccak256 } from "../crypto/index.js"; -import { recoverAddress } from "../transaction/index.js"; -import { assertArgument, concat, encodeRlp, toBeArray } from "../utils/index.js"; -/** - * Computes the [[link-eip-7702]] authorization digest to sign. - */ -export function hashAuthorization(auth) { - assertArgument(typeof (auth.address) === "string", "invalid address for hashAuthorization", "auth.address", auth); - return keccak256(concat([ - "0x05", encodeRlp([ - (auth.chainId != null) ? toBeArray(auth.chainId) : "0x", - getAddress(auth.address), - (auth.nonce != null) ? toBeArray(auth.nonce) : "0x", - ]) - ])); -} -/** - * Return the address of the private key that produced - * the signature %%sig%% during signing for %%message%%. - */ -export function verifyAuthorization(auth, sig) { - return recoverAddress(hashAuthorization(auth), sig); -} -//# sourceMappingURL=authorization.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/authorization.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/authorization.js.map deleted file mode 100644 index 1f40229f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/authorization.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"authorization.js","sourceRoot":"","sources":["../../src.ts/hash/authorization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EACH,cAAc,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAC/C,MAAM,mBAAmB,CAAC;AAY3B;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAA0B;IACxD,cAAc,CAAC,OAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,QAAQ,EAAE,uCAAuC,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;IACjH,OAAO,SAAS,CAAC,MAAM,CAAC;QACpB,MAAM,EAAE,SAAS,CAAC;YACd,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA,CAAC,CAAC,IAAI;YACtD,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC;YACxB,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA,CAAC,CAAC,IAAI;SACrD,CAAC;KACL,CAAC,CAAC,CAAC;AACR,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAA0B,EAAE,GAAkB;IAC9E,OAAO,cAAc,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;AACxD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/id.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/id.d.ts deleted file mode 100644 index 8d5e0579..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/id.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * A simple hashing function which operates on UTF-8 strings to - * compute an 32-byte identifier. - * - * This simply computes the [UTF-8 bytes](toUtf8Bytes) and computes - * the [[keccak256]]. - * - * @example: - * id("hello world") - * //_result: - */ -export declare function id(value: string): string; -//# sourceMappingURL=id.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/id.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/id.d.ts.map deleted file mode 100644 index 713788d8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/id.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../src.ts/hash/id.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,wBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAExC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/id.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/id.js deleted file mode 100644 index 1c0289fb..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/id.js +++ /dev/null @@ -1,17 +0,0 @@ -import { keccak256 } from "../crypto/index.js"; -import { toUtf8Bytes } from "../utils/index.js"; -/** - * A simple hashing function which operates on UTF-8 strings to - * compute an 32-byte identifier. - * - * This simply computes the [UTF-8 bytes](toUtf8Bytes) and computes - * the [[keccak256]]. - * - * @example: - * id("hello world") - * //_result: - */ -export function id(value) { - return keccak256(toUtf8Bytes(value)); -} -//# sourceMappingURL=id.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/id.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/id.js.map deleted file mode 100644 index 36737c51..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/id.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"id.js","sourceRoot":"","sources":["../../src.ts/hash/id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,EAAE,CAAC,KAAa;IAC5B,OAAO,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;AACzC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/index.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/index.d.ts deleted file mode 100644 index 5b216e52..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/index.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Utilities for common tasks involving hashing. Also see - * [cryptographic hashing](about-crypto-hashing). - * - * @_section: api/hashing:Hashing Utilities [about-hashing] - */ -export { hashAuthorization, verifyAuthorization } from "./authorization.js"; -export { id } from "./id.js"; -export { ensNormalize, isValidName, namehash, dnsEncode } from "./namehash.js"; -export { hashMessage, verifyMessage } from "./message.js"; -export { solidityPacked, solidityPackedKeccak256, solidityPackedSha256 } from "./solidity.js"; -export { TypedDataEncoder, verifyTypedData } from "./typed-data.js"; -export type { AuthorizationRequest } from "./authorization.js"; -export type { TypedDataDomain, TypedDataField } from "./typed-data.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/index.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/index.d.ts.map deleted file mode 100644 index 7fec7492..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/hash/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EACH,cAAc,EAAE,uBAAuB,EAAE,oBAAoB,EAChE,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEpE,YAAY,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/index.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/index.js deleted file mode 100644 index 9775b410..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/index.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Utilities for common tasks involving hashing. Also see - * [cryptographic hashing](about-crypto-hashing). - * - * @_section: api/hashing:Hashing Utilities [about-hashing] - */ -export { hashAuthorization, verifyAuthorization } from "./authorization.js"; -export { id } from "./id.js"; -export { ensNormalize, isValidName, namehash, dnsEncode } from "./namehash.js"; -export { hashMessage, verifyMessage } from "./message.js"; -export { solidityPacked, solidityPackedKeccak256, solidityPackedSha256 } from "./solidity.js"; -export { TypedDataEncoder, verifyTypedData } from "./typed-data.js"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/index.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/index.js.map deleted file mode 100644 index d3259590..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/hash/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EACH,cAAc,EAAE,uBAAuB,EAAE,oBAAoB,EAChE,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/message.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/message.d.ts deleted file mode 100644 index 9e088beb..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/message.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import type { SignatureLike } from "../crypto/index.js"; -/** - * Computes the [[link-eip-191]] personal-sign message digest to sign. - * - * This prefixes the message with [[MessagePrefix]] and the decimal length - * of %%message%% and computes the [[keccak256]] digest. - * - * If %%message%% is a string, it is converted to its UTF-8 bytes - * first. To compute the digest of a [[DataHexString]], it must be converted - * to [bytes](getBytes). - * - * @example: - * hashMessage("Hello World") - * //_result: - * - * // Hashes the SIX (6) string characters, i.e. - * // [ "0", "x", "4", "2", "4", "3" ] - * hashMessage("0x4243") - * //_result: - * - * // Hashes the TWO (2) bytes [ 0x42, 0x43 ]... - * hashMessage(getBytes("0x4243")) - * //_result: - * - * // ...which is equal to using data - * hashMessage(new Uint8Array([ 0x42, 0x43 ])) - * //_result: - * - */ -export declare function hashMessage(message: Uint8Array | string): string; -/** - * Return the address of the private key that produced - * the signature %%sig%% during signing for %%message%%. - */ -export declare function verifyMessage(message: Uint8Array | string, sig: SignatureLike): string; -//# sourceMappingURL=message.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/message.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/message.d.ts.map deleted file mode 100644 index d57b1223..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/message.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src.ts/hash/message.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,CAOhE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,EAAE,GAAG,EAAE,aAAa,GAAG,MAAM,CAGtF"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/message.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/message.js deleted file mode 100644 index 00c99949..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/message.js +++ /dev/null @@ -1,51 +0,0 @@ -import { keccak256 } from "../crypto/index.js"; -import { MessagePrefix } from "../constants/index.js"; -import { recoverAddress } from "../transaction/index.js"; -import { concat, toUtf8Bytes } from "../utils/index.js"; -/** - * Computes the [[link-eip-191]] personal-sign message digest to sign. - * - * This prefixes the message with [[MessagePrefix]] and the decimal length - * of %%message%% and computes the [[keccak256]] digest. - * - * If %%message%% is a string, it is converted to its UTF-8 bytes - * first. To compute the digest of a [[DataHexString]], it must be converted - * to [bytes](getBytes). - * - * @example: - * hashMessage("Hello World") - * //_result: - * - * // Hashes the SIX (6) string characters, i.e. - * // [ "0", "x", "4", "2", "4", "3" ] - * hashMessage("0x4243") - * //_result: - * - * // Hashes the TWO (2) bytes [ 0x42, 0x43 ]... - * hashMessage(getBytes("0x4243")) - * //_result: - * - * // ...which is equal to using data - * hashMessage(new Uint8Array([ 0x42, 0x43 ])) - * //_result: - * - */ -export function hashMessage(message) { - if (typeof (message) === "string") { - message = toUtf8Bytes(message); - } - return keccak256(concat([ - toUtf8Bytes(MessagePrefix), - toUtf8Bytes(String(message.length)), - message - ])); -} -/** - * Return the address of the private key that produced - * the signature %%sig%% during signing for %%message%%. - */ -export function verifyMessage(message, sig) { - const digest = hashMessage(message); - return recoverAddress(digest, sig); -} -//# sourceMappingURL=message.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/message.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/message.js.map deleted file mode 100644 index ff2ca461..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/message.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"message.js","sourceRoot":"","sources":["../../src.ts/hash/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGxD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,UAAU,WAAW,CAAC,OAA4B;IACpD,IAAI,OAAM,CAAC,OAAO,CAAC,KAAK,QAAQ,EAAE;QAAE,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;KAAE;IACrE,OAAO,SAAS,CAAC,MAAM,CAAC;QACpB,WAAW,CAAC,aAAa,CAAC;QAC1B,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACnC,OAAO;KACV,CAAC,CAAC,CAAC;AACR,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,OAA4B,EAAE,GAAkB;IAC1E,MAAM,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;IACpC,OAAO,cAAc,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AACvC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/namehash.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/namehash.d.ts deleted file mode 100644 index d29b9c11..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/namehash.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Returns the ENS %%name%% normalized. - */ -export declare function ensNormalize(name: string): string; -/** - * Returns ``true`` if %%name%% is a valid ENS name. - */ -export declare function isValidName(name: string): name is string; -/** - * Returns the [[link-namehash]] for %%name%%. - */ -export declare function namehash(name: string): string; -/** - * Returns the DNS encoded %%name%%. - * - * This is used for various parts of ENS name resolution, such - * as the wildcard resolution. - */ -export declare function dnsEncode(name: string, _maxLength?: number): string; -//# sourceMappingURL=namehash.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/namehash.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/namehash.d.ts.map deleted file mode 100644 index af0b8eae..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/namehash.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"namehash.d.ts","sourceRoot":"","sources":["../../src.ts/hash/namehash.ts"],"names":[],"mappings":"AAyCA;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOjD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,MAAM,CAKxD;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAa7C;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAanE"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/namehash.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/namehash.js deleted file mode 100644 index 0f4ac3b9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/namehash.js +++ /dev/null @@ -1,84 +0,0 @@ -import { keccak256 } from "../crypto/index.js"; -import { concat, hexlify, assertArgument, toUtf8Bytes } from "../utils/index.js"; -import { ens_normalize } from "@adraffy/ens-normalize"; -const Zeros = new Uint8Array(32); -Zeros.fill(0); -function checkComponent(comp) { - assertArgument(comp.length !== 0, "invalid ENS name; empty component", "comp", comp); - return comp; -} -function ensNameSplit(name) { - const bytes = toUtf8Bytes(ensNormalize(name)); - const comps = []; - if (name.length === 0) { - return comps; - } - let last = 0; - for (let i = 0; i < bytes.length; i++) { - const d = bytes[i]; - // A separator (i.e. "."); copy this component - if (d === 0x2e) { - comps.push(checkComponent(bytes.slice(last, i))); - last = i + 1; - } - } - // There was a stray separator at the end of the name - assertArgument(last < bytes.length, "invalid ENS name; empty component", "name", name); - comps.push(checkComponent(bytes.slice(last))); - return comps; -} -/** - * Returns the ENS %%name%% normalized. - */ -export function ensNormalize(name) { - try { - if (name.length === 0) { - throw new Error("empty label"); - } - return ens_normalize(name); - } - catch (error) { - assertArgument(false, `invalid ENS name (${error.message})`, "name", name); - } -} -/** - * Returns ``true`` if %%name%% is a valid ENS name. - */ -export function isValidName(name) { - try { - return (ensNameSplit(name).length !== 0); - } - catch (error) { } - return false; -} -/** - * Returns the [[link-namehash]] for %%name%%. - */ -export function namehash(name) { - assertArgument(typeof (name) === "string", "invalid ENS name; not a string", "name", name); - assertArgument(name.length, `invalid ENS name (empty label)`, "name", name); - let result = Zeros; - const comps = ensNameSplit(name); - while (comps.length) { - result = keccak256(concat([result, keccak256((comps.pop()))])); - } - return hexlify(result); -} -/** - * Returns the DNS encoded %%name%%. - * - * This is used for various parts of ENS name resolution, such - * as the wildcard resolution. - */ -export function dnsEncode(name, _maxLength) { - const length = (_maxLength != null) ? _maxLength : 63; - assertArgument(length <= 255, "DNS encoded label cannot exceed 255", "length", length); - return hexlify(concat(ensNameSplit(name).map((comp) => { - assertArgument(comp.length <= length, `label ${JSON.stringify(name)} exceeds ${length} bytes`, "name", name); - const bytes = new Uint8Array(comp.length + 1); - bytes.set(comp, 1); - bytes[0] = bytes.length - 1; - return bytes; - }))) + "00"; -} -//# sourceMappingURL=namehash.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/namehash.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/namehash.js.map deleted file mode 100644 index f720baac..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/namehash.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"namehash.js","sourceRoot":"","sources":["../../src.ts/hash/namehash.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EACH,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAC/C,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,aAAa,E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AAC;IAErD,cAAc,CAAC,MAAM,IAAI,GAAG,EAAE,qCAAqC,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAEvF,OAAO,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QAClD,cAAc,CAAC,IAAI,CAAC,MAAM,IAAI,MAAM,EAAE,SAAU,IAAI,CAAC,SAAS,CAAC,IAAI,CAAE,YAAa,MAAO,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QAEjH,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC9C,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QACnB,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;QAC5B,OAAO,KAAK,CAAC;IACjB,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;AAChB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/solidity.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/solidity.d.ts deleted file mode 100644 index 9b8035eb..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/solidity.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Computes the [[link-solc-packed]] representation of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPacked([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ -export declare function solidityPacked(types: ReadonlyArray, values: ReadonlyArray): string; -/** - * Computes the [[link-solc-packed]] [[keccak256]] hash of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPackedKeccak256([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ -export declare function solidityPackedKeccak256(types: ReadonlyArray, values: ReadonlyArray): string; -/** - * Computes the [[link-solc-packed]] [[sha256]] hash of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPackedSha256([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ -export declare function solidityPackedSha256(types: ReadonlyArray, values: ReadonlyArray): string; -//# sourceMappingURL=solidity.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/solidity.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/solidity.d.ts.map deleted file mode 100644 index 742707df..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/solidity.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"solidity.d.ts","sourceRoot":"","sources":["../../src.ts/hash/solidity.ts"],"names":[],"mappings":"AAyEA;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG,MAAM,CAQ/F;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG,MAAM,CAExG;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG,MAAM,CAErG"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/solidity.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/solidity.js deleted file mode 100644 index 8d20e54b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/solidity.js +++ /dev/null @@ -1,103 +0,0 @@ -import { getAddress } from "../address/index.js"; -import { keccak256 as _keccak256, sha256 as _sha256 } from "../crypto/index.js"; -import { concat, dataLength, getBytes, hexlify, toBeArray, toTwos, toUtf8Bytes, zeroPadBytes, zeroPadValue, assertArgument } from "../utils/index.js"; -const regexBytes = new RegExp("^bytes([0-9]+)$"); -const regexNumber = new RegExp("^(u?int)([0-9]*)$"); -const regexArray = new RegExp("^(.*)\\[([0-9]*)\\]$"); -function _pack(type, value, isArray) { - switch (type) { - case "address": - if (isArray) { - return getBytes(zeroPadValue(value, 32)); - } - return getBytes(getAddress(value)); - case "string": - return toUtf8Bytes(value); - case "bytes": - return getBytes(value); - case "bool": - value = (!!value ? "0x01" : "0x00"); - if (isArray) { - return getBytes(zeroPadValue(value, 32)); - } - return getBytes(value); - } - let match = type.match(regexNumber); - if (match) { - let signed = (match[1] === "int"); - let size = parseInt(match[2] || "256"); - assertArgument((!match[2] || match[2] === String(size)) && (size % 8 === 0) && size !== 0 && size <= 256, "invalid number type", "type", type); - if (isArray) { - size = 256; - } - if (signed) { - value = toTwos(value, size); - } - return getBytes(zeroPadValue(toBeArray(value), size / 8)); - } - match = type.match(regexBytes); - if (match) { - const size = parseInt(match[1]); - assertArgument(String(size) === match[1] && size !== 0 && size <= 32, "invalid bytes type", "type", type); - assertArgument(dataLength(value) === size, `invalid value for ${type}`, "value", value); - if (isArray) { - return getBytes(zeroPadBytes(value, 32)); - } - return value; - } - match = type.match(regexArray); - if (match && Array.isArray(value)) { - const baseType = match[1]; - const count = parseInt(match[2] || String(value.length)); - assertArgument(count === value.length, `invalid array length for ${type}`, "value", value); - const result = []; - value.forEach(function (value) { - result.push(_pack(baseType, value, true)); - }); - return getBytes(concat(result)); - } - assertArgument(false, "invalid type", "type", type); -} -// @TODO: Array Enum -/** - * Computes the [[link-solc-packed]] representation of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPacked([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ -export function solidityPacked(types, values) { - assertArgument(types.length === values.length, "wrong number of values; expected ${ types.length }", "values", values); - const tight = []; - types.forEach(function (type, index) { - tight.push(_pack(type, values[index])); - }); - return hexlify(concat(tight)); -} -/** - * Computes the [[link-solc-packed]] [[keccak256]] hash of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPackedKeccak256([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ -export function solidityPackedKeccak256(types, values) { - return _keccak256(solidityPacked(types, values)); -} -/** - * Computes the [[link-solc-packed]] [[sha256]] hash of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPackedSha256([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ -export function solidityPackedSha256(types, values) { - return _sha256(solidityPacked(types, values)); -} -//# sourceMappingURL=solidity.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/solidity.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/solidity.js.map deleted file mode 100644 index 8b315fde..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/solidity.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"solidity.js","sourceRoot":"","sources":["../../src.ts/hash/solidity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EACH,SAAS,IAAI,UAAU,EAAE,MAAM,IAAI,OAAO,EAC7C,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACH,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EACjG,cAAc,EACjB,MAAM,mBAAmB,CAAC;AAG3B,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,iBAAiB,CAAC,CAAC;AACjD,MAAM,WAAW,GAAG,IAAI,MAAM,CAAC,mBAAmB,CAAC,CAAC;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typed-data.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/typed-data.d.ts deleted file mode 100644 index 47c345b1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/typed-data.d.ts +++ /dev/null @@ -1,150 +0,0 @@ -import type { SignatureLike } from "../crypto/index.js"; -import type { BigNumberish, BytesLike } from "../utils/index.js"; -/** - * The domain for an [[link-eip-712]] payload. - */ -export interface TypedDataDomain { - /** - * The human-readable name of the signing domain. - */ - name?: null | string; - /** - * The major version of the signing domain. - */ - version?: null | string; - /** - * The chain ID of the signing domain. - */ - chainId?: null | BigNumberish; - /** - * The the address of the contract that will verify the signature. - */ - verifyingContract?: null | string; - /** - * A salt used for purposes decided by the specific domain. - */ - salt?: null | BytesLike; -} -/** - * A specific field of a structured [[link-eip-712]] type. - */ -export interface TypedDataField { - /** - * The field name. - */ - name: string; - /** - * The type of the field. - */ - type: string; -} -/** - * A **TypedDataEncode** prepares and encodes [[link-eip-712]] payloads - * for signed typed data. - * - * This is useful for those that wish to compute various components of a - * typed data hash, primary types, or sub-components, but generally the - * higher level [[Signer-signTypedData]] is more useful. - */ -export declare class TypedDataEncoder { - #private; - /** - * The primary type for the structured [[types]]. - * - * This is derived automatically from the [[types]], since no - * recursion is possible, once the DAG for the types is consturcted - * internally, the primary type must be the only remaining type with - * no parent nodes. - */ - readonly primaryType: string; - /** - * The types. - */ - get types(): Record>; - /** - * Create a new **TypedDataEncoder** for %%types%%. - * - * This performs all necessary checking that types are valid and - * do not violate the [[link-eip-712]] structural constraints as - * well as computes the [[primaryType]]. - */ - constructor(_types: Record>); - /** - * Returnthe encoder for the specific %%type%%. - */ - getEncoder(type: string): (value: any) => string; - /** - * Return the full type for %%name%%. - */ - encodeType(name: string): string; - /** - * Return the encoded %%value%% for the %%type%%. - */ - encodeData(type: string, value: any): string; - /** - * Returns the hash of %%value%% for the type of %%name%%. - */ - hashStruct(name: string, value: Record): string; - /** - * Return the fulled encoded %%value%% for the [[types]]. - */ - encode(value: Record): string; - /** - * Return the hash of the fully encoded %%value%% for the [[types]]. - */ - hash(value: Record): string; - /** - * @_ignore: - */ - _visit(type: string, value: any, callback: (type: string, data: any) => any): any; - /** - * Call %%calback%% for each value in %%value%%, passing the type and - * component within %%value%%. - * - * This is useful for replacing addresses or other transformation that - * may be desired on each component, based on its type. - */ - visit(value: Record, callback: (type: string, data: any) => any): any; - /** - * Create a new **TypedDataEncoder** for %%types%%. - */ - static from(types: Record>): TypedDataEncoder; - /** - * Return the primary type for %%types%%. - */ - static getPrimaryType(types: Record>): string; - /** - * Return the hashed struct for %%value%% using %%types%% and %%name%%. - */ - static hashStruct(name: string, types: Record>, value: Record): string; - /** - * Return the domain hash for %%domain%%. - */ - static hashDomain(domain: TypedDataDomain): string; - /** - * Return the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%. - */ - static encode(domain: TypedDataDomain, types: Record>, value: Record): string; - /** - * Return the hash of the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%. - */ - static hash(domain: TypedDataDomain, types: Record>, value: Record): string; - /** - * Resolves to the value from resolving all addresses in %%value%% for - * %%types%% and the %%domain%%. - */ - static resolveNames(domain: TypedDataDomain, types: Record>, value: Record, resolveName: (name: string) => Promise): Promise<{ - domain: TypedDataDomain; - value: any; - }>; - /** - * Returns the JSON-encoded payload expected by nodes which implement - * the JSON-RPC [[link-eip-712]] method. - */ - static getPayload(domain: TypedDataDomain, types: Record>, value: Record): any; -} -/** - * Compute the address used to sign the typed data for the %%signature%%. - */ -export declare function verifyTypedData(domain: TypedDataDomain, types: Record>, value: Record, signature: SignatureLike): string; -//# sourceMappingURL=typed-data.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/typed-data.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/typed-data.d.ts.map deleted file mode 100644 index dee91781..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/typed-data.d.ts.map +++ /dev/null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E,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM;IAQxH;;OAEG;IACH,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM;IAKtH;;;OAGG;WACU,YAAY,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,eAAe,CAAC;QAAC,KAAK,EAAE,GAAG,CAAA;KAAE,CAAC;IAiD9N;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG;CA0D5H;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,SAAS,EAAE,aAAa,GAAG,MAAM,CAEnK"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/typed-data.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/typed-data.js deleted file mode 100644 index d43c5c6e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/typed-data.js +++ /dev/null @@ -1,519 +0,0 @@ -//import { TypedDataDomain, TypedDataField } from "@ethersproject/providerabstract-signer"; -import { getAddress } from "../address/index.js"; -import { keccak256 } from "../crypto/index.js"; -import { recoverAddress } from "../transaction/index.js"; -import { concat, defineProperties, getBigInt, getBytes, hexlify, isHexString, mask, toBeHex, toQuantity, toTwos, zeroPadValue, assertArgument } from "../utils/index.js"; -import { id } from "./id.js"; -const padding = new Uint8Array(32); -padding.fill(0); -const BN__1 = BigInt(-1); -const BN_0 = BigInt(0); -const BN_1 = BigInt(1); -const BN_MAX_UINT256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); -; -; -function hexPadRight(value) { - const bytes = getBytes(value); - const padOffset = bytes.length % 32; - if (padOffset) { - return concat([bytes, padding.slice(padOffset)]); - } - return hexlify(bytes); -} -const hexTrue = toBeHex(BN_1, 32); -const hexFalse = toBeHex(BN_0, 32); -const domainFieldTypes = { - name: "string", - version: "string", - chainId: "uint256", - verifyingContract: "address", - salt: "bytes32" -}; -const domainFieldNames = [ - "name", "version", "chainId", "verifyingContract", "salt" -]; -function checkString(key) { - return function (value) { - assertArgument(typeof (value) === "string", `invalid domain value for ${JSON.stringify(key)}`, `domain.${key}`, value); - return value; - }; -} -const domainChecks = { - name: checkString("name"), - version: checkString("version"), - chainId: function (_value) { - const value = getBigInt(_value, "domain.chainId"); - assertArgument(value >= 0, "invalid chain ID", "domain.chainId", _value); - if (Number.isSafeInteger(value)) { - return Number(value); - } - return toQuantity(value); - }, - verifyingContract: function (value) { - try { - return getAddress(value).toLowerCase(); - } - catch (error) { } - assertArgument(false, `invalid domain value "verifyingContract"`, "domain.verifyingContract", value); - }, - salt: function (value) { - const bytes = getBytes(value, "domain.salt"); - assertArgument(bytes.length === 32, `invalid domain value "salt"`, "domain.salt", value); - return hexlify(bytes); - } -}; -function getBaseEncoder(type) { - // intXX and uintXX - { - const match = type.match(/^(u?)int(\d+)$/); - if (match) { - const signed = (match[1] === ""); - const width = parseInt(match[2]); - assertArgument(width % 8 === 0 && width !== 0 && width <= 256 && match[2] === String(width), "invalid numeric width", "type", type); - const boundsUpper = mask(BN_MAX_UINT256, signed ? (width - 1) : width); - const boundsLower = signed ? ((boundsUpper + BN_1) * BN__1) : BN_0; - return function (_value) { - const value = getBigInt(_value, "value"); - assertArgument(value >= boundsLower && value <= boundsUpper, `value out-of-bounds for ${type}`, "value", value); - return toBeHex(signed ? toTwos(value, 256) : value, 32); - }; - } - } - // bytesXX - { - const match = type.match(/^bytes(\d+)$/); - if (match) { - const width = parseInt(match[1]); - assertArgument(width !== 0 && width <= 32 && match[1] === String(width), "invalid bytes width", "type", type); - return function (value) { - const bytes = getBytes(value); - assertArgument(bytes.length === width, `invalid length for ${type}`, "value", value); - return hexPadRight(value); - }; - } - } - switch (type) { - case "address": return function (value) { - return zeroPadValue(getAddress(value), 32); - }; - case "bool": return function (value) { - return ((!value) ? hexFalse : hexTrue); - }; - case "bytes": return function (value) { - return keccak256(value); - }; - case "string": return function (value) { - return id(value); - }; - } - return null; -} -function encodeType(name, fields) { - return `${name}(${fields.map(({ name, type }) => (type + " " + name)).join(",")})`; -} -// foo[][3] => { base: "foo", index: "[][3]", array: { -// base: "foo", prefix: "foo[]", count: 3 } } -function splitArray(type) { - const match = type.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/); - if (match) { - return { - base: match[1], - index: (match[2] + match[4]), - array: { - base: match[1], - prefix: (match[1] + match[2]), - count: (match[5] ? parseInt(match[5]) : -1), - } - }; - } - return { base: type }; -} -/** - * A **TypedDataEncode** prepares and encodes [[link-eip-712]] payloads - * for signed typed data. - * - * This is useful for those that wish to compute various components of a - * typed data hash, primary types, or sub-components, but generally the - * higher level [[Signer-signTypedData]] is more useful. - */ -export class TypedDataEncoder { - /** - * The primary type for the structured [[types]]. - * - * This is derived automatically from the [[types]], since no - * recursion is possible, once the DAG for the types is consturcted - * internally, the primary type must be the only remaining type with - * no parent nodes. - */ - primaryType; - #types; - /** - * The types. - */ - get types() { - return JSON.parse(this.#types); - } - #fullTypes; - #encoderCache; - /** - * Create a new **TypedDataEncoder** for %%types%%. - * - * This performs all necessary checking that types are valid and - * do not violate the [[link-eip-712]] structural constraints as - * well as computes the [[primaryType]]. - */ - constructor(_types) { - this.#fullTypes = new Map(); - this.#encoderCache = new Map(); - // Link struct types to their direct child structs - const links = new Map(); - // Link structs to structs which contain them as a child - const parents = new Map(); - // Link all subtypes within a given struct - const subtypes = new Map(); - const types = {}; - Object.keys(_types).forEach((type) => { - types[type] = _types[type].map(({ name, type }) => { - // Normalize the base type (unless name conflict) - let { base, index } = splitArray(type); - if (base === "int" && !_types["int"]) { - base = "int256"; - } - if (base === "uint" && !_types["uint"]) { - base = "uint256"; - } - return { name, type: (base + (index || "")) }; - }); - links.set(type, new Set()); - parents.set(type, []); - subtypes.set(type, new Set()); - }); - this.#types = JSON.stringify(types); - for (const name in types) { - const uniqueNames = new Set(); - for (const field of types[name]) { - // Check each field has a unique name - assertArgument(!uniqueNames.has(field.name), `duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`, "types", _types); - uniqueNames.add(field.name); - // Get the base type (drop any array specifiers) - const baseType = splitArray(field.type).base; - assertArgument(baseType !== name, `circular type reference to ${JSON.stringify(baseType)}`, "types", _types); - // Is this a base encoding type? - const encoder = getBaseEncoder(baseType); - if (encoder) { - continue; - } - assertArgument(parents.has(baseType), `unknown type ${JSON.stringify(baseType)}`, "types", _types); - // Add linkage - parents.get(baseType).push(name); - links.get(name).add(baseType); - } - } - // Deduce the primary type - const primaryTypes = Array.from(parents.keys()).filter((n) => (parents.get(n).length === 0)); - assertArgument(primaryTypes.length !== 0, "missing primary type", "types", _types); - assertArgument(primaryTypes.length === 1, `ambiguous primary types or unused types: ${primaryTypes.map((t) => (JSON.stringify(t))).join(", ")}`, "types", _types); - defineProperties(this, { primaryType: primaryTypes[0] }); - // Check for circular type references - function checkCircular(type, found) { - assertArgument(!found.has(type), `circular type reference to ${JSON.stringify(type)}`, "types", _types); - found.add(type); - for (const child of links.get(type)) { - if (!parents.has(child)) { - continue; - } - // Recursively check children - checkCircular(child, found); - // Mark all ancestors as having this decendant - for (const subtype of found) { - subtypes.get(subtype).add(child); - } - } - found.delete(type); - } - checkCircular(this.primaryType, new Set()); - // Compute each fully describe type - for (const [name, set] of subtypes) { - const st = Array.from(set); - st.sort(); - this.#fullTypes.set(name, encodeType(name, types[name]) + st.map((t) => encodeType(t, types[t])).join("")); - } - } - /** - * Returnthe encoder for the specific %%type%%. - */ - getEncoder(type) { - let encoder = this.#encoderCache.get(type); - if (!encoder) { - encoder = this.#getEncoder(type); - this.#encoderCache.set(type, encoder); - } - return encoder; - } - #getEncoder(type) { - // Basic encoder type (address, bool, uint256, etc) - { - const encoder = getBaseEncoder(type); - if (encoder) { - return encoder; - } - } - // Array - const array = splitArray(type).array; - if (array) { - const subtype = array.prefix; - const subEncoder = this.getEncoder(subtype); - return (value) => { - assertArgument(array.count === -1 || array.count === value.length, `array length mismatch; expected length ${array.count}`, "value", value); - let result = value.map(subEncoder); - if (this.#fullTypes.has(subtype)) { - result = result.map(keccak256); - } - return keccak256(concat(result)); - }; - } - // Struct - const fields = this.types[type]; - if (fields) { - const encodedType = id(this.#fullTypes.get(type)); - return (value) => { - const values = fields.map(({ name, type }) => { - const result = this.getEncoder(type)(value[name]); - if (this.#fullTypes.has(type)) { - return keccak256(result); - } - return result; - }); - values.unshift(encodedType); - return concat(values); - }; - } - assertArgument(false, `unknown type: ${type}`, "type", type); - } - /** - * Return the full type for %%name%%. - */ - encodeType(name) { - const result = this.#fullTypes.get(name); - assertArgument(result, `unknown type: ${JSON.stringify(name)}`, "name", name); - return result; - } - /** - * Return the encoded %%value%% for the %%type%%. - */ - encodeData(type, value) { - return this.getEncoder(type)(value); - } - /** - * Returns the hash of %%value%% for the type of %%name%%. - */ - hashStruct(name, value) { - return keccak256(this.encodeData(name, value)); - } - /** - * Return the fulled encoded %%value%% for the [[types]]. - */ - encode(value) { - return this.encodeData(this.primaryType, value); - } - /** - * Return the hash of the fully encoded %%value%% for the [[types]]. - */ - hash(value) { - return this.hashStruct(this.primaryType, value); - } - /** - * @_ignore: - */ - _visit(type, value, callback) { - // Basic encoder type (address, bool, uint256, etc) - { - const encoder = getBaseEncoder(type); - if (encoder) { - return callback(type, value); - } - } - // Array - const array = splitArray(type).array; - if (array) { - assertArgument(array.count === -1 || array.count === value.length, `array length mismatch; expected length ${array.count}`, "value", value); - return value.map((v) => this._visit(array.prefix, v, callback)); - } - // Struct - const fields = this.types[type]; - if (fields) { - return fields.reduce((accum, { name, type }) => { - accum[name] = this._visit(type, value[name], callback); - return accum; - }, {}); - } - assertArgument(false, `unknown type: ${type}`, "type", type); - } - /** - * Call %%calback%% for each value in %%value%%, passing the type and - * component within %%value%%. - * - * This is useful for replacing addresses or other transformation that - * may be desired on each component, based on its type. - */ - visit(value, callback) { - return this._visit(this.primaryType, value, callback); - } - /** - * Create a new **TypedDataEncoder** for %%types%%. - */ - static from(types) { - return new TypedDataEncoder(types); - } - /** - * Return the primary type for %%types%%. - */ - static getPrimaryType(types) { - return TypedDataEncoder.from(types).primaryType; - } - /** - * Return the hashed struct for %%value%% using %%types%% and %%name%%. - */ - static hashStruct(name, types, value) { - return TypedDataEncoder.from(types).hashStruct(name, value); - } - /** - * Return the domain hash for %%domain%%. - */ - static hashDomain(domain) { - const domainFields = []; - for (const name in domain) { - if (domain[name] == null) { - continue; - } - const type = domainFieldTypes[name]; - assertArgument(type, `invalid typed-data domain key: ${JSON.stringify(name)}`, "domain", domain); - domainFields.push({ name, type }); - } - domainFields.sort((a, b) => { - return domainFieldNames.indexOf(a.name) - domainFieldNames.indexOf(b.name); - }); - return TypedDataEncoder.hashStruct("EIP712Domain", { EIP712Domain: domainFields }, domain); - } - /** - * Return the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%. - */ - static encode(domain, types, value) { - return concat([ - "0x1901", - TypedDataEncoder.hashDomain(domain), - TypedDataEncoder.from(types).hash(value) - ]); - } - /** - * Return the hash of the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%. - */ - static hash(domain, types, value) { - return keccak256(TypedDataEncoder.encode(domain, types, value)); - } - // Replaces all address types with ENS names with their looked up address - /** - * Resolves to the value from resolving all addresses in %%value%% for - * %%types%% and the %%domain%%. - */ - static async resolveNames(domain, types, value, resolveName) { - // Make a copy to isolate it from the object passed in - domain = Object.assign({}, domain); - // Allow passing null to ignore value - for (const key in domain) { - if (domain[key] == null) { - delete domain[key]; - } - } - // Look up all ENS names - const ensCache = {}; - // Do we need to look up the domain's verifyingContract? - if (domain.verifyingContract && !isHexString(domain.verifyingContract, 20)) { - ensCache[domain.verifyingContract] = "0x"; - } - // We are going to use the encoder to visit all the base values - const encoder = TypedDataEncoder.from(types); - // Get a list of all the addresses - encoder.visit(value, (type, value) => { - if (type === "address" && !isHexString(value, 20)) { - ensCache[value] = "0x"; - } - return value; - }); - // Lookup each name - for (const name in ensCache) { - ensCache[name] = await resolveName(name); - } - // Replace the domain verifyingContract if needed - if (domain.verifyingContract && ensCache[domain.verifyingContract]) { - domain.verifyingContract = ensCache[domain.verifyingContract]; - } - // Replace all ENS names with their address - value = encoder.visit(value, (type, value) => { - if (type === "address" && ensCache[value]) { - return ensCache[value]; - } - return value; - }); - return { domain, value }; - } - /** - * Returns the JSON-encoded payload expected by nodes which implement - * the JSON-RPC [[link-eip-712]] method. - */ - static getPayload(domain, types, value) { - // Validate the domain fields - TypedDataEncoder.hashDomain(domain); - // Derive the EIP712Domain Struct reference type - const domainValues = {}; - const domainTypes = []; - domainFieldNames.forEach((name) => { - const value = domain[name]; - if (value == null) { - return; - } - domainValues[name] = domainChecks[name](value); - domainTypes.push({ name, type: domainFieldTypes[name] }); - }); - const encoder = TypedDataEncoder.from(types); - // Get the normalized types - types = encoder.types; - const typesWithDomain = Object.assign({}, types); - assertArgument(typesWithDomain.EIP712Domain == null, "types must not contain EIP712Domain type", "types.EIP712Domain", types); - typesWithDomain.EIP712Domain = domainTypes; - // Validate the data structures and types - encoder.encode(value); - return { - types: typesWithDomain, - domain: domainValues, - primaryType: encoder.primaryType, - message: encoder.visit(value, (type, value) => { - // bytes - if (type.match(/^bytes(\d*)/)) { - return hexlify(getBytes(value)); - } - // uint or int - if (type.match(/^u?int/)) { - return getBigInt(value).toString(); - } - switch (type) { - case "address": - return value.toLowerCase(); - case "bool": - return !!value; - case "string": - assertArgument(typeof (value) === "string", "invalid string", "value", value); - return value; - } - assertArgument(false, "unsupported type", "type", type); - }) - }; - } -} -/** - * Compute the address used to sign the typed data for the %%signature%%. - */ -export function verifyTypedData(domain, types, value, signature) { - return recoverAddress(TypedDataEncoder.hash(domain, types, value), signature); -} -//# sourceMappingURL=typed-data.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/typed-data.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/typed-data.js.map deleted file mode 100644 index a7543c8d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/hash/typed-data.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"typed-data.js","sourceRoot":"","sources":["../../src.ts/hash/typed-data.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EACH,MAAM,EAAE,gBAAgB,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EACpH,cAAc,EACjB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAM7B,MAAM,OAAO,G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K,EAAE,KAAK,CAAC,EAAE,SAAS,CAAC,CAAC;AAClF,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/index.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/index.d.ts deleted file mode 100644 index 558c263f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/index.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * The Application Programming Interface (API) is the collection of - * functions, classes and types offered by the Ethers library. - * - * @_section: api:Application Programming Interface [about-api] - * @_navTitle: API - */ -import * as ethers from "./ethers.js"; -export { ethers }; -export * from "./ethers.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/index.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/index.d.ts.map deleted file mode 100644 index 2334d69a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src.ts/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,MAAM,EAAE,CAAC;AAElB,cAAc,aAAa,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/index.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/index.js deleted file mode 100644 index 12762d2e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/index.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * The Application Programming Interface (API) is the collection of - * functions, classes and types offered by the Ethers library. - * - * @_section: api:Application Programming Interface [about-api] - * @_navTitle: API - */ -import * as ethers from "./ethers.js"; -export { ethers }; -export * from "./ethers.js"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/index.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/index.js.map deleted file mode 100644 index 23974114..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src.ts/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,MAAM,EAAE,CAAC;AAElB,cAAc,aAAa,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/package.json b/tools/mnemonic-test/node_modules/ethers/lib.esm/package.json deleted file mode 100644 index 04a5cfd6..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "browser": { - "./crypto/crypto.js": "./crypto/crypto-browser.js", - "./providers/provider-ipcsocket.js": "./providers/provider-ipcsocket-browser.js", - "./providers/ws.js": "./providers/ws-browser.js", - "./utils/base64.js": "./utils/base64-browser.js", - "./utils/geturl.js": "./utils/geturl-browser.js", - "./wordlists/wordlists.js": "./wordlists/wordlists-browser.js" - }, - "sideEffects": false, - "type": "module" -} diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/abstract-provider.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/abstract-provider.d.ts deleted file mode 100644 index 50659206..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/abstract-provider.d.ts +++ /dev/null @@ -1,451 +0,0 @@ -/** - * The available providers should suffice for most developers purposes, - * but the [[AbstractProvider]] class has many features which enable - * sub-classing it for specific purposes. - * - * @_section: api/providers/abstract-provider: Subclassing Provider [abstract-provider] - */ -import { FetchRequest } from "../utils/index.js"; -import { EnsResolver } from "./ens-resolver.js"; -import { Network } from "./network.js"; -import { Block, FeeData, Log, TransactionReceipt, TransactionResponse } from "./provider.js"; -import type { AddressLike } from "../address/index.js"; -import type { BigNumberish } from "../utils/index.js"; -import type { Listener } from "../utils/index.js"; -import type { Networkish } from "./network.js"; -import type { BlockParams, LogParams, TransactionReceiptParams, TransactionResponseParams } from "./formatting.js"; -import type { BlockTag, EventFilter, Filter, FilterByBlockHash, OrphanFilter, PreparedTransactionRequest, Provider, ProviderEvent, TransactionRequest } from "./provider.js"; -/** - * The types of additional event values that can be emitted for the - * ``"debug"`` event. - */ -export type DebugEventAbstractProvider = { - action: "sendCcipReadFetchRequest"; - request: FetchRequest; - index: number; - urls: Array; -} | { - action: "receiveCcipReadFetchResult"; - request: FetchRequest; - result: any; -} | { - action: "receiveCcipReadFetchError"; - request: FetchRequest; - result: any; -} | { - action: "sendCcipReadCall"; - transaction: { - to: string; - data: string; - }; -} | { - action: "receiveCcipReadCallResult"; - transaction: { - to: string; - data: string; - }; - result: string; -} | { - action: "receiveCcipReadCallError"; - transaction: { - to: string; - data: string; - }; - error: Error; -}; -/** - * The value passed to the [[AbstractProvider-_getSubscriber]] method. - * - * Only developers sub-classing [[AbstractProvider[[ will care about this, - * if they are modifying a low-level feature of how subscriptions operate. - */ -export type Subscription = { - type: "block" | "close" | "debug" | "error" | "finalized" | "network" | "pending" | "safe"; - tag: string; -} | { - type: "transaction"; - tag: string; - hash: string; -} | { - type: "event"; - tag: string; - filter: EventFilter; -} | { - type: "orphan"; - tag: string; - filter: OrphanFilter; -}; -/** - * A **Subscriber** manages a subscription. - * - * Only developers sub-classing [[AbstractProvider[[ will care about this, - * if they are modifying a low-level feature of how subscriptions operate. - */ -export interface Subscriber { - /** - * Called initially when a subscriber is added the first time. - */ - start(): void; - /** - * Called when there are no more subscribers to the event. - */ - stop(): void; - /** - * Called when the subscription should pause. - * - * If %%dropWhilePaused%%, events that occur while paused should not - * be emitted [[resume]]. - */ - pause(dropWhilePaused?: boolean): void; - /** - * Resume a paused subscriber. - */ - resume(): void; - /** - * The frequency (in ms) to poll for events, if polling is used by - * the subscriber. - * - * For non-polling subscribers, this must return ``undefined``. - */ - pollingInterval?: number; -} -/** - * An **UnmanagedSubscriber** is useful for events which do not require - * any additional management, such as ``"debug"`` which only requires - * emit in synchronous event loop triggered calls. - */ -export declare class UnmanagedSubscriber implements Subscriber { - /** - * The name fof the event. - */ - name: string; - /** - * Create a new UnmanagedSubscriber with %%name%%. - */ - constructor(name: string); - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; -} -/** - * An **AbstractPlugin** is used to provide additional internal services - * to an [[AbstractProvider]] without adding backwards-incompatible changes - * to method signatures or other internal and complex logic. - */ -export interface AbstractProviderPlugin { - /** - * The reverse domain notation of the plugin. - */ - readonly name: string; - /** - * Creates a new instance of the plugin, connected to %%provider%%. - */ - connect(provider: AbstractProvider): AbstractProviderPlugin; -} -/** - * A normalized filter used for [[PerformActionRequest]] objects. - */ -export type PerformActionFilter = { - address?: string | Array; - topics?: Array>; - fromBlock?: BlockTag; - toBlock?: BlockTag; -} | { - address?: string | Array; - topics?: Array>; - blockHash?: string; -}; -/** - * A normalized transactions used for [[PerformActionRequest]] objects. - */ -export interface PerformActionTransaction extends PreparedTransactionRequest { - /** - * The ``to`` address of the transaction. - */ - to?: string; - /** - * The sender of the transaction. - */ - from?: string; -} -/** - * The [[AbstractProvider]] methods will normalize all values and pass this - * type to [[AbstractProvider-_perform]]. - */ -export type PerformActionRequest = { - method: "broadcastTransaction"; - signedTransaction: string; -} | { - method: "call"; - transaction: PerformActionTransaction; - blockTag: BlockTag; -} | { - method: "chainId"; -} | { - method: "estimateGas"; - transaction: PerformActionTransaction; -} | { - method: "getBalance"; - address: string; - blockTag: BlockTag; -} | { - method: "getBlock"; - blockTag: BlockTag; - includeTransactions: boolean; -} | { - method: "getBlock"; - blockHash: string; - includeTransactions: boolean; -} | { - method: "getBlockNumber"; -} | { - method: "getCode"; - address: string; - blockTag: BlockTag; -} | { - method: "getGasPrice"; -} | { - method: "getLogs"; - filter: PerformActionFilter; -} | { - method: "getPriorityFee"; -} | { - method: "getStorage"; - address: string; - position: bigint; - blockTag: BlockTag; -} | { - method: "getTransaction"; - hash: string; -} | { - method: "getTransactionCount"; - address: string; - blockTag: BlockTag; -} | { - method: "getTransactionReceipt"; - hash: string; -} | { - method: "getTransactionResult"; - hash: string; -}; -/** - * Options for configuring some internal aspects of an [[AbstractProvider]]. - * - * **``cacheTimeout``** - how long to cache a low-level ``_perform`` - * for, based on input parameters. This reduces the number of calls - * to getChainId and getBlockNumber, but may break test chains which - * can perform operations (internally) synchronously. Use ``-1`` to - * disable, ``0`` will only buffer within the same event loop and - * any other value is in ms. (default: ``250``) - */ -export type AbstractProviderOptions = { - cacheTimeout?: number; - pollingInterval?: number; -}; -/** - * An **AbstractProvider** provides a base class for other sub-classes to - * implement the [[Provider]] API by normalizing input arguments and - * formatting output results as well as tracking events for consistent - * behaviour on an eventually-consistent network. - */ -export declare class AbstractProvider implements Provider { - #private; - /** - * Create a new **AbstractProvider** connected to %%network%%, or - * use the various network detection capabilities to discover the - * [[Network]] if necessary. - */ - constructor(_network?: "any" | Networkish, options?: AbstractProviderOptions); - get pollingInterval(): number; - /** - * Returns ``this``, to allow an **AbstractProvider** to implement - * the [[ContractRunner]] interface. - */ - get provider(): this; - /** - * Returns all the registered plug-ins. - */ - get plugins(): Array; - /** - * Attach a new plug-in. - */ - attachPlugin(plugin: AbstractProviderPlugin): this; - /** - * Get a plugin by name. - */ - getPlugin(name: string): null | T; - /** - * Prevent any CCIP-read operation, regardless of whether requested - * in a [[call]] using ``enableCcipRead``. - */ - get disableCcipRead(): boolean; - set disableCcipRead(value: boolean); - /** - * Resolves to the data for executing the CCIP-read operations. - */ - ccipReadFetch(tx: PerformActionTransaction, calldata: string, urls: Array): Promise; - /** - * Provides the opportunity for a sub-class to wrap a block before - * returning it, to add additional properties or an alternate - * sub-class of [[Block]]. - */ - _wrapBlock(value: BlockParams, network: Network): Block; - /** - * Provides the opportunity for a sub-class to wrap a log before - * returning it, to add additional properties or an alternate - * sub-class of [[Log]]. - */ - _wrapLog(value: LogParams, network: Network): Log; - /** - * Provides the opportunity for a sub-class to wrap a transaction - * receipt before returning it, to add additional properties or an - * alternate sub-class of [[TransactionReceipt]]. - */ - _wrapTransactionReceipt(value: TransactionReceiptParams, network: Network): TransactionReceipt; - /** - * Provides the opportunity for a sub-class to wrap a transaction - * response before returning it, to add additional properties or an - * alternate sub-class of [[TransactionResponse]]. - */ - _wrapTransactionResponse(tx: TransactionResponseParams, network: Network): TransactionResponse; - /** - * Resolves to the Network, forcing a network detection using whatever - * technique the sub-class requires. - * - * Sub-classes **must** override this. - */ - _detectNetwork(): Promise; - /** - * Sub-classes should use this to perform all built-in operations. All - * methods sanitizes and normalizes the values passed into this. - * - * Sub-classes **must** override this. - */ - _perform(req: PerformActionRequest): Promise; - getBlockNumber(): Promise; - /** - * Returns or resolves to the address for %%address%%, resolving ENS - * names and [[Addressable]] objects and returning if already an - * address. - */ - _getAddress(address: AddressLike): string | Promise; - /** - * Returns or resolves to a valid block tag for %%blockTag%%, resolving - * negative values and returning if already a valid block tag. - */ - _getBlockTag(blockTag?: BlockTag): string | Promise; - /** - * Returns or resolves to a filter for %%filter%%, resolving any ENS - * names or [[Addressable]] object and returning if already a valid - * filter. - */ - _getFilter(filter: Filter | FilterByBlockHash): PerformActionFilter | Promise; - /** - * Returns or resolves to a transaction for %%request%%, resolving - * any ENS names or [[Addressable]] and returning if already a valid - * transaction. - */ - _getTransactionRequest(_request: TransactionRequest): PerformActionTransaction | Promise; - getNetwork(): Promise; - getFeeData(): Promise; - estimateGas(_tx: TransactionRequest): Promise; - call(_tx: TransactionRequest): Promise; - getBalance(address: AddressLike, blockTag?: BlockTag): Promise; - getTransactionCount(address: AddressLike, blockTag?: BlockTag): Promise; - getCode(address: AddressLike, blockTag?: BlockTag): Promise; - getStorage(address: AddressLike, _position: BigNumberish, blockTag?: BlockTag): Promise; - broadcastTransaction(signedTx: string): Promise; - getBlock(block: BlockTag | string, prefetchTxs?: boolean): Promise; - getTransaction(hash: string): Promise; - getTransactionReceipt(hash: string): Promise; - getTransactionResult(hash: string): Promise; - getLogs(_filter: Filter | FilterByBlockHash): Promise>; - _getProvider(chainId: number): AbstractProvider; - getResolver(name: string): Promise; - getAvatar(name: string): Promise; - resolveName(name: string): Promise; - lookupAddress(address: string): Promise; - waitForTransaction(hash: string, _confirms?: null | number, timeout?: null | number): Promise; - waitForBlock(blockTag?: BlockTag): Promise; - /** - * Clear a timer created using the [[_setTimeout]] method. - */ - _clearTimeout(timerId: number): void; - /** - * Create a timer that will execute %%func%% after at least %%timeout%% - * (in ms). If %%timeout%% is unspecified, then %%func%% will execute - * in the next event loop. - * - * [Pausing](AbstractProvider-paused) the provider will pause any - * associated timers. - */ - _setTimeout(_func: () => void, timeout?: number): number; - /** - * Perform %%func%% on each subscriber. - */ - _forEachSubscriber(func: (s: Subscriber) => void): void; - /** - * Sub-classes may override this to customize subscription - * implementations. - */ - _getSubscriber(sub: Subscription): Subscriber; - /** - * If a [[Subscriber]] fails and needs to replace itself, this - * method may be used. - * - * For example, this is used for providers when using the - * ``eth_getFilterChanges`` method, which can return null if state - * filters are not supported by the backend, allowing the Subscriber - * to swap in a [[PollingEventSubscriber]]. - */ - _recoverSubscriber(oldSub: Subscriber, newSub: Subscriber): void; - on(event: ProviderEvent, listener: Listener): Promise; - once(event: ProviderEvent, listener: Listener): Promise; - emit(event: ProviderEvent, ...args: Array): Promise; - listenerCount(event?: ProviderEvent): Promise; - listeners(event?: ProviderEvent): Promise>; - off(event: ProviderEvent, listener?: Listener): Promise; - removeAllListeners(event?: ProviderEvent): Promise; - addListener(event: ProviderEvent, listener: Listener): Promise; - removeListener(event: ProviderEvent, listener: Listener): Promise; - /** - * If this provider has been destroyed using the [[destroy]] method. - * - * Once destroyed, all resources are reclaimed, internal event loops - * and timers are cleaned up and no further requests may be sent to - * the provider. - */ - get destroyed(): boolean; - /** - * Sub-classes may use this to shutdown any sockets or release their - * resources and reject any pending requests. - * - * Sub-classes **must** call ``super.destroy()``. - */ - destroy(): void; - /** - * Whether the provider is currently paused. - * - * A paused provider will not emit any events, and generally should - * not make any requests to the network, but that is up to sub-classes - * to manage. - * - * Setting ``paused = true`` is identical to calling ``.pause(false)``, - * which will buffer any events that occur while paused until the - * provider is unpaused. - */ - get paused(): boolean; - set paused(pause: boolean); - /** - * Pause the provider. If %%dropWhilePaused%%, any events that occur - * while paused are dropped, otherwise all events will be emitted once - * the provider is unpaused. - */ - pause(dropWhilePaused?: boolean): void; - /** - * Resume the provider. - */ - resume(): void; -} -//# sourceMappingURL=abstract-provider.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/abstract-provider.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/abstract-provider.d.ts.map deleted file mode 100644 index 740581dc..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/abstract-provider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abstract-provider.d.ts","sourceRoot":"","sources":["../../src.ts/providers/abstract-provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAeH,OAAO,EAIH,YAAY,EAIf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIhD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAe,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAM1G,OAAO,KAAK,EAAe,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,EAAiB,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAEjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG/C,OAAO,KAAK,EACR,WAAW,EAAE,SAAS,EAAE,wBAAwB,EAChD,yBAAyB,EAC5B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EACR,QAAQ,EA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AC;IAW7D,IAAI,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAuBjE,aAAa,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;IAcrD,SAAS,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAa1D,GAAG,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAiB7D,kBAAkB,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAexD,WAAW,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAKpE,cAAc,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7E;;;;;;OAMG;IACH,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED;;;;;OAKG;IACH,OAAO,IAAI,IAAI;IAYf;;;;;;;;;;OAUG;IACH,IAAI,MAAM,IAAI,OAAO,CAAwC;IAC7D,IAAI,MAAM,CAAC,KAAK,EAAE,OAAO,EAQxB;IAED;;;;OAIG;IACH,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI;IAsBtC;;OAEG;IACH,MAAM,IAAI,IAAI;CAiBjB"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/abstract-provider.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/abstract-provider.js deleted file mode 100644 index 80d00148..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/abstract-provider.js +++ /dev/null @@ -1,1404 +0,0 @@ -/** - * The available providers should suffice for most developers purposes, - * but the [[AbstractProvider]] class has many features which enable - * sub-classing it for specific purposes. - * - * @_section: api/providers/abstract-provider: Subclassing Provider [abstract-provider] - */ -// @TODO -// Event coalescence -// When we register an event with an async value (e.g. address is a Signer -// or ENS name), we need to add it immeidately for the Event API, but also -// need time to resolve the address. Upon resolving the address, we need to -// migrate the listener to the static event. We also need to maintain a map -// of Signer/ENS name to address so we can sync respond to listenerCount. -import { getAddress, resolveAddress } from "../address/index.js"; -import { ZeroAddress } from "../constants/index.js"; -import { Contract } from "../contract/index.js"; -import { namehash } from "../hash/index.js"; -import { Transaction } from "../transaction/index.js"; -import { concat, dataLength, dataSlice, hexlify, isHexString, getBigInt, getBytes, getNumber, isCallException, isError, makeError, assert, assertArgument, FetchRequest, toBeArray, toQuantity, defineProperties, EventPayload, resolveProperties, toUtf8String } from "../utils/index.js"; -import { EnsResolver } from "./ens-resolver.js"; -import { formatBlock, formatLog, formatTransactionReceipt, formatTransactionResponse } from "./format.js"; -import { Network } from "./network.js"; -import { copyRequest, Block, FeeData, Log, TransactionReceipt, TransactionResponse } from "./provider.js"; -import { PollingBlockSubscriber, PollingBlockTagSubscriber, PollingEventSubscriber, PollingOrphanSubscriber, PollingTransactionSubscriber } from "./subscriber-polling.js"; -// Constants -const BN_2 = BigInt(2); -const MAX_CCIP_REDIRECTS = 10; -function isPromise(value) { - return (value && typeof (value.then) === "function"); -} -function getTag(prefix, value) { - return prefix + ":" + JSON.stringify(value, (k, v) => { - if (v == null) { - return "null"; - } - if (typeof (v) === "bigint") { - return `bigint:${v.toString()}`; - } - if (typeof (v) === "string") { - return v.toLowerCase(); - } - // Sort object keys - if (typeof (v) === "object" && !Array.isArray(v)) { - const keys = Object.keys(v); - keys.sort(); - return keys.reduce((accum, key) => { - accum[key] = v[key]; - return accum; - }, {}); - } - return v; - }); -} -/** - * An **UnmanagedSubscriber** is useful for events which do not require - * any additional management, such as ``"debug"`` which only requires - * emit in synchronous event loop triggered calls. - */ -export class UnmanagedSubscriber { - /** - * The name fof the event. - */ - name; - /** - * Create a new UnmanagedSubscriber with %%name%%. - */ - constructor(name) { defineProperties(this, { name }); } - start() { } - stop() { } - pause(dropWhilePaused) { } - resume() { } -} -function copy(value) { - return JSON.parse(JSON.stringify(value)); -} -function concisify(items) { - items = Array.from((new Set(items)).values()); - items.sort(); - return items; -} -async function getSubscription(_event, provider) { - if (_event == null) { - throw new Error("invalid event"); - } - // Normalize topic array info an EventFilter - if (Array.isArray(_event)) { - _event = { topics: _event }; - } - if (typeof (_event) === "string") { - switch (_event) { - case "block": - case "debug": - case "error": - case "finalized": - case "network": - case "pending": - case "safe": { - return { type: _event, tag: _event }; - } - } - } - if (isHexString(_event, 32)) { - const hash = _event.toLowerCase(); - return { type: "transaction", tag: getTag("tx", { hash }), hash }; - } - if (_event.orphan) { - const event = _event; - // @TODO: Should lowercase and whatnot things here instead of copy... - return { type: "orphan", tag: getTag("orphan", event), filter: copy(event) }; - } - if ((_event.address || _event.topics)) { - const event = _event; - const filter = { - topics: ((event.topics || []).map((t) => { - if (t == null) { - return null; - } - if (Array.isArray(t)) { - return concisify(t.map((t) => t.toLowerCase())); - } - return t.toLowerCase(); - })) - }; - if (event.address) { - const addresses = []; - const promises = []; - const addAddress = (addr) => { - if (isHexString(addr)) { - addresses.push(addr); - } - else { - promises.push((async () => { - addresses.push(await resolveAddress(addr, provider)); - })()); - } - }; - if (Array.isArray(event.address)) { - event.address.forEach(addAddress); - } - else { - addAddress(event.address); - } - if (promises.length) { - await Promise.all(promises); - } - filter.address = concisify(addresses.map((a) => a.toLowerCase())); - } - return { filter, tag: getTag("event", filter), type: "event" }; - } - assertArgument(false, "unknown ProviderEvent", "event", _event); -} -function getTime() { return (new Date()).getTime(); } -const defaultOptions = { - cacheTimeout: 250, - pollingInterval: 4000 -}; -/** - * An **AbstractProvider** provides a base class for other sub-classes to - * implement the [[Provider]] API by normalizing input arguments and - * formatting output results as well as tracking events for consistent - * behaviour on an eventually-consistent network. - */ -export class AbstractProvider { - #subs; - #plugins; - // null=unpaused, true=paused+dropWhilePaused, false=paused - #pausedState; - #destroyed; - #networkPromise; - #anyNetwork; - #performCache; - // The most recent block number if running an event or -1 if no "block" event - #lastBlockNumber; - #nextTimer; - #timers; - #disableCcipRead; - #options; - /** - * Create a new **AbstractProvider** connected to %%network%%, or - * use the various network detection capabilities to discover the - * [[Network]] if necessary. - */ - constructor(_network, options) { - this.#options = Object.assign({}, defaultOptions, options || {}); - if (_network === "any") { - this.#anyNetwork = true; - this.#networkPromise = null; - } - else if (_network) { - const network = Network.from(_network); - this.#anyNetwork = false; - this.#networkPromise = Promise.resolve(network); - setTimeout(() => { this.emit("network", network, null); }, 0); - } - else { - this.#anyNetwork = false; - this.#networkPromise = null; - } - this.#lastBlockNumber = -1; - this.#performCache = new Map(); - this.#subs = new Map(); - this.#plugins = new Map(); - this.#pausedState = null; - this.#destroyed = false; - this.#nextTimer = 1; - this.#timers = new Map(); - this.#disableCcipRead = false; - } - get pollingInterval() { return this.#options.pollingInterval; } - /** - * Returns ``this``, to allow an **AbstractProvider** to implement - * the [[ContractRunner]] interface. - */ - get provider() { return this; } - /** - * Returns all the registered plug-ins. - */ - get plugins() { - return Array.from(this.#plugins.values()); - } - /** - * Attach a new plug-in. - */ - attachPlugin(plugin) { - if (this.#plugins.get(plugin.name)) { - throw new Error(`cannot replace existing plugin: ${plugin.name} `); - } - this.#plugins.set(plugin.name, plugin.connect(this)); - return this; - } - /** - * Get a plugin by name. - */ - getPlugin(name) { - return (this.#plugins.get(name)) || null; - } - /** - * Prevent any CCIP-read operation, regardless of whether requested - * in a [[call]] using ``enableCcipRead``. - */ - get disableCcipRead() { return this.#disableCcipRead; } - set disableCcipRead(value) { this.#disableCcipRead = !!value; } - // Shares multiple identical requests made during the same 250ms - async #perform(req) { - const timeout = this.#options.cacheTimeout; - // Caching disabled - if (timeout < 0) { - return await this._perform(req); - } - // Create a tag - const tag = getTag(req.method, req); - let perform = this.#performCache.get(tag); - if (!perform) { - perform = this._perform(req); - this.#performCache.set(tag, perform); - setTimeout(() => { - if (this.#performCache.get(tag) === perform) { - this.#performCache.delete(tag); - } - }, timeout); - } - return await perform; - } - /** - * Resolves to the data for executing the CCIP-read operations. - */ - async ccipReadFetch(tx, calldata, urls) { - if (this.disableCcipRead || urls.length === 0 || tx.to == null) { - return null; - } - const sender = tx.to.toLowerCase(); - const data = calldata.toLowerCase(); - const errorMessages = []; - for (let i = 0; i < urls.length; i++) { - const url = urls[i]; - // URL expansion - const href = url.replace("{sender}", sender).replace("{data}", data); - // If no {data} is present, use POST; otherwise GET - //const json: string | null = (url.indexOf("{data}") >= 0) ? null: JSON.stringify({ data, sender }); - //const result = await fetchJson({ url: href, errorPassThrough: true }, json, (value, response) => { - // value.status = response.statusCode; - // return value; - //}); - const request = new FetchRequest(href); - if (url.indexOf("{data}") === -1) { - request.body = { data, sender }; - } - this.emit("debug", { action: "sendCcipReadFetchRequest", request, index: i, urls }); - let errorMessage = "unknown error"; - // Fetch the resource... - let resp; - try { - resp = await request.send(); - } - catch (error) { - // ...low-level fetch error (missing host, bad SSL, etc.), - // so try next URL - errorMessages.push(error.message); - this.emit("debug", { action: "receiveCcipReadFetchError", request, result: { error } }); - continue; - } - try { - const result = resp.bodyJson; - if (result.data) { - this.emit("debug", { action: "receiveCcipReadFetchResult", request, result }); - return result.data; - } - if (result.message) { - errorMessage = result.message; - } - this.emit("debug", { action: "receiveCcipReadFetchError", request, result }); - } - catch (error) { } - // 4xx indicates the result is not present; stop - assert(resp.statusCode < 400 || resp.statusCode >= 500, `response not found during CCIP fetch: ${errorMessage}`, "OFFCHAIN_FAULT", { reason: "404_MISSING_RESOURCE", transaction: tx, info: { url, errorMessage } }); - // 5xx indicates server issue; try the next url - errorMessages.push(errorMessage); - } - assert(false, `error encountered during CCIP fetch: ${errorMessages.map((m) => JSON.stringify(m)).join(", ")}`, "OFFCHAIN_FAULT", { - reason: "500_SERVER_ERROR", - transaction: tx, info: { urls, errorMessages } - }); - } - /** - * Provides the opportunity for a sub-class to wrap a block before - * returning it, to add additional properties or an alternate - * sub-class of [[Block]]. - */ - _wrapBlock(value, network) { - return new Block(formatBlock(value), this); - } - /** - * Provides the opportunity for a sub-class to wrap a log before - * returning it, to add additional properties or an alternate - * sub-class of [[Log]]. - */ - _wrapLog(value, network) { - return new Log(formatLog(value), this); - } - /** - * Provides the opportunity for a sub-class to wrap a transaction - * receipt before returning it, to add additional properties or an - * alternate sub-class of [[TransactionReceipt]]. - */ - _wrapTransactionReceipt(value, network) { - return new TransactionReceipt(formatTransactionReceipt(value), this); - } - /** - * Provides the opportunity for a sub-class to wrap a transaction - * response before returning it, to add additional properties or an - * alternate sub-class of [[TransactionResponse]]. - */ - _wrapTransactionResponse(tx, network) { - return new TransactionResponse(formatTransactionResponse(tx), this); - } - /** - * Resolves to the Network, forcing a network detection using whatever - * technique the sub-class requires. - * - * Sub-classes **must** override this. - */ - _detectNetwork() { - assert(false, "sub-classes must implement this", "UNSUPPORTED_OPERATION", { - operation: "_detectNetwork" - }); - } - /** - * Sub-classes should use this to perform all built-in operations. All - * methods sanitizes and normalizes the values passed into this. - * - * Sub-classes **must** override this. - */ - async _perform(req) { - assert(false, `unsupported method: ${req.method}`, "UNSUPPORTED_OPERATION", { - operation: req.method, - info: req - }); - } - // State - async getBlockNumber() { - const blockNumber = getNumber(await this.#perform({ method: "getBlockNumber" }), "%response"); - if (this.#lastBlockNumber >= 0) { - this.#lastBlockNumber = blockNumber; - } - return blockNumber; - } - /** - * Returns or resolves to the address for %%address%%, resolving ENS - * names and [[Addressable]] objects and returning if already an - * address. - */ - _getAddress(address) { - return resolveAddress(address, this); - } - /** - * Returns or resolves to a valid block tag for %%blockTag%%, resolving - * negative values and returning if already a valid block tag. - */ - _getBlockTag(blockTag) { - if (blockTag == null) { - return "latest"; - } - switch (blockTag) { - case "earliest": - return "0x0"; - case "finalized": - case "latest": - case "pending": - case "safe": - return blockTag; - } - if (isHexString(blockTag)) { - if (isHexString(blockTag, 32)) { - return blockTag; - } - return toQuantity(blockTag); - } - if (typeof (blockTag) === "bigint") { - blockTag = getNumber(blockTag, "blockTag"); - } - if (typeof (blockTag) === "number") { - if (blockTag >= 0) { - return toQuantity(blockTag); - } - if (this.#lastBlockNumber >= 0) { - return toQuantity(this.#lastBlockNumber + blockTag); - } - return this.getBlockNumber().then((b) => toQuantity(b + blockTag)); - } - assertArgument(false, "invalid blockTag", "blockTag", blockTag); - } - /** - * Returns or resolves to a filter for %%filter%%, resolving any ENS - * names or [[Addressable]] object and returning if already a valid - * filter. - */ - _getFilter(filter) { - // Create a canonical representation of the topics - const topics = (filter.topics || []).map((t) => { - if (t == null) { - return null; - } - if (Array.isArray(t)) { - return concisify(t.map((t) => t.toLowerCase())); - } - return t.toLowerCase(); - }); - const blockHash = ("blockHash" in filter) ? filter.blockHash : undefined; - const resolve = (_address, fromBlock, toBlock) => { - let address = undefined; - switch (_address.length) { - case 0: break; - case 1: - address = _address[0]; - break; - default: - _address.sort(); - address = _address; - } - if (blockHash) { - if (fromBlock != null || toBlock != null) { - throw new Error("invalid filter"); - } - } - const filter = {}; - if (address) { - filter.address = address; - } - if (topics.length) { - filter.topics = topics; - } - if (fromBlock) { - filter.fromBlock = fromBlock; - } - if (toBlock) { - filter.toBlock = toBlock; - } - if (blockHash) { - filter.blockHash = blockHash; - } - return filter; - }; - // Addresses could be async (ENS names or Addressables) - let address = []; - if (filter.address) { - if (Array.isArray(filter.address)) { - for (const addr of filter.address) { - address.push(this._getAddress(addr)); - } - } - else { - address.push(this._getAddress(filter.address)); - } - } - let fromBlock = undefined; - if ("fromBlock" in filter) { - fromBlock = this._getBlockTag(filter.fromBlock); - } - let toBlock = undefined; - if ("toBlock" in filter) { - toBlock = this._getBlockTag(filter.toBlock); - } - if (address.filter((a) => (typeof (a) !== "string")).length || - (fromBlock != null && typeof (fromBlock) !== "string") || - (toBlock != null && typeof (toBlock) !== "string")) { - return Promise.all([Promise.all(address), fromBlock, toBlock]).then((result) => { - return resolve(result[0], result[1], result[2]); - }); - } - return resolve(address, fromBlock, toBlock); - } - /** - * Returns or resolves to a transaction for %%request%%, resolving - * any ENS names or [[Addressable]] and returning if already a valid - * transaction. - */ - _getTransactionRequest(_request) { - const request = copyRequest(_request); - const promises = []; - ["to", "from"].forEach((key) => { - if (request[key] == null) { - return; - } - const addr = resolveAddress(request[key], this); - if (isPromise(addr)) { - promises.push((async function () { request[key] = await addr; })()); - } - else { - request[key] = addr; - } - }); - if (request.blockTag != null) { - const blockTag = this._getBlockTag(request.blockTag); - if (isPromise(blockTag)) { - promises.push((async function () { request.blockTag = await blockTag; })()); - } - else { - request.blockTag = blockTag; - } - } - if (promises.length) { - return (async function () { - await Promise.all(promises); - return request; - })(); - } - return request; - } - async getNetwork() { - // No explicit network was set and this is our first time - if (this.#networkPromise == null) { - // Detect the current network (shared with all calls) - const detectNetwork = (async () => { - try { - const network = await this._detectNetwork(); - this.emit("network", network, null); - return network; - } - catch (error) { - if (this.#networkPromise === detectNetwork) { - this.#networkPromise = null; - } - throw error; - } - })(); - this.#networkPromise = detectNetwork; - return (await detectNetwork).clone(); - } - const networkPromise = this.#networkPromise; - const [expected, actual] = await Promise.all([ - networkPromise, - this._detectNetwork() // The actual connected network - ]); - if (expected.chainId !== actual.chainId) { - if (this.#anyNetwork) { - // The "any" network can change, so notify listeners - this.emit("network", actual, expected); - // Update the network if something else hasn't already changed it - if (this.#networkPromise === networkPromise) { - this.#networkPromise = Promise.resolve(actual); - } - } - else { - // Otherwise, we do not allow changes to the underlying network - assert(false, `network changed: ${expected.chainId} => ${actual.chainId} `, "NETWORK_ERROR", { - event: "changed" - }); - } - } - return expected.clone(); - } - async getFeeData() { - const network = await this.getNetwork(); - const getFeeDataFunc = async () => { - const { _block, gasPrice, priorityFee } = await resolveProperties({ - _block: this.#getBlock("latest", false), - gasPrice: ((async () => { - try { - const value = await this.#perform({ method: "getGasPrice" }); - return getBigInt(value, "%response"); - } - catch (error) { } - return null; - })()), - priorityFee: ((async () => { - try { - const value = await this.#perform({ method: "getPriorityFee" }); - return getBigInt(value, "%response"); - } - catch (error) { } - return null; - })()) - }); - let maxFeePerGas = null; - let maxPriorityFeePerGas = null; - // These are the recommended EIP-1559 heuristics for fee data - const block = this._wrapBlock(_block, network); - if (block && block.baseFeePerGas) { - maxPriorityFeePerGas = (priorityFee != null) ? priorityFee : BigInt("1000000000"); - maxFeePerGas = (block.baseFeePerGas * BN_2) + maxPriorityFeePerGas; - } - return new FeeData(gasPrice, maxFeePerGas, maxPriorityFeePerGas); - }; - // Check for a FeeDataNetWorkPlugin - const plugin = network.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin"); - if (plugin) { - const req = new FetchRequest(plugin.url); - const feeData = await plugin.processFunc(getFeeDataFunc, this, req); - return new FeeData(feeData.gasPrice, feeData.maxFeePerGas, feeData.maxPriorityFeePerGas); - } - return await getFeeDataFunc(); - } - async estimateGas(_tx) { - let tx = this._getTransactionRequest(_tx); - if (isPromise(tx)) { - tx = await tx; - } - return getBigInt(await this.#perform({ - method: "estimateGas", transaction: tx - }), "%response"); - } - async #call(tx, blockTag, attempt) { - assert(attempt < MAX_CCIP_REDIRECTS, "CCIP read exceeded maximum redirections", "OFFCHAIN_FAULT", { - reason: "TOO_MANY_REDIRECTS", - transaction: Object.assign({}, tx, { blockTag, enableCcipRead: true }) - }); - // This came in as a PerformActionTransaction, so to/from are safe; we can cast - const transaction = copyRequest(tx); - try { - return hexlify(await this._perform({ method: "call", transaction, blockTag })); - } - catch (error) { - // CCIP Read OffchainLookup - if (!this.disableCcipRead && isCallException(error) && error.data && attempt >= 0 && blockTag === "latest" && transaction.to != null && dataSlice(error.data, 0, 4) === "0x556f1830") { - const data = error.data; - const txSender = await resolveAddress(transaction.to, this); - // Parse the CCIP Read Arguments - let ccipArgs; - try { - ccipArgs = parseOffchainLookup(dataSlice(error.data, 4)); - } - catch (error) { - assert(false, error.message, "OFFCHAIN_FAULT", { - reason: "BAD_DATA", transaction, info: { data } - }); - } - // Check the sender of the OffchainLookup matches the transaction - assert(ccipArgs.sender.toLowerCase() === txSender.toLowerCase(), "CCIP Read sender mismatch", "CALL_EXCEPTION", { - action: "call", - data, - reason: "OffchainLookup", - transaction: transaction, - invocation: null, - revert: { - signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)", - name: "OffchainLookup", - args: ccipArgs.errorArgs - } - }); - const ccipResult = await this.ccipReadFetch(transaction, ccipArgs.calldata, ccipArgs.urls); - assert(ccipResult != null, "CCIP Read failed to fetch data", "OFFCHAIN_FAULT", { - reason: "FETCH_FAILED", transaction, info: { data: error.data, errorArgs: ccipArgs.errorArgs } - }); - const tx = { - to: txSender, - data: concat([ccipArgs.selector, encodeBytes([ccipResult, ccipArgs.extraData])]) - }; - this.emit("debug", { action: "sendCcipReadCall", transaction: tx }); - try { - const result = await this.#call(tx, blockTag, attempt + 1); - this.emit("debug", { action: "receiveCcipReadCallResult", transaction: Object.assign({}, tx), result }); - return result; - } - catch (error) { - this.emit("debug", { action: "receiveCcipReadCallError", transaction: Object.assign({}, tx), error }); - throw error; - } - } - throw error; - } - } - async #checkNetwork(promise) { - const { value } = await resolveProperties({ - network: this.getNetwork(), - value: promise - }); - return value; - } - async call(_tx) { - const { tx, blockTag } = await resolveProperties({ - tx: this._getTransactionRequest(_tx), - blockTag: this._getBlockTag(_tx.blockTag) - }); - return await this.#checkNetwork(this.#call(tx, blockTag, _tx.enableCcipRead ? 0 : -1)); - } - // Account - async #getAccountValue(request, _address, _blockTag) { - let address = this._getAddress(_address); - let blockTag = this._getBlockTag(_blockTag); - if (typeof (address) !== "string" || typeof (blockTag) !== "string") { - [address, blockTag] = await Promise.all([address, blockTag]); - } - return await this.#checkNetwork(this.#perform(Object.assign(request, { address, blockTag }))); - } - async getBalance(address, blockTag) { - return getBigInt(await this.#getAccountValue({ method: "getBalance" }, address, blockTag), "%response"); - } - async getTransactionCount(address, blockTag) { - return getNumber(await this.#getAccountValue({ method: "getTransactionCount" }, address, blockTag), "%response"); - } - async getCode(address, blockTag) { - return hexlify(await this.#getAccountValue({ method: "getCode" }, address, blockTag)); - } - async getStorage(address, _position, blockTag) { - const position = getBigInt(_position, "position"); - return hexlify(await this.#getAccountValue({ method: "getStorage", position }, address, blockTag)); - } - // Write - async broadcastTransaction(signedTx) { - const { blockNumber, hash, network } = await resolveProperties({ - blockNumber: this.getBlockNumber(), - hash: this._perform({ - method: "broadcastTransaction", - signedTransaction: signedTx - }), - network: this.getNetwork() - }); - const tx = Transaction.from(signedTx); - if (tx.hash !== hash) { - throw new Error("@TODO: the returned hash did not match"); - } - return this._wrapTransactionResponse(tx, network).replaceableTransaction(blockNumber); - } - async #getBlock(block, includeTransactions) { - // @TODO: Add CustomBlockPlugin check - if (isHexString(block, 32)) { - return await this.#perform({ - method: "getBlock", blockHash: block, includeTransactions - }); - } - let blockTag = this._getBlockTag(block); - if (typeof (blockTag) !== "string") { - blockTag = await blockTag; - } - return await this.#perform({ - method: "getBlock", blockTag, includeTransactions - }); - } - // Queries - async getBlock(block, prefetchTxs) { - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#getBlock(block, !!prefetchTxs) - }); - if (params == null) { - return null; - } - return this._wrapBlock(params, network); - } - async getTransaction(hash) { - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#perform({ method: "getTransaction", hash }) - }); - if (params == null) { - return null; - } - return this._wrapTransactionResponse(params, network); - } - async getTransactionReceipt(hash) { - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#perform({ method: "getTransactionReceipt", hash }) - }); - if (params == null) { - return null; - } - // Some backends did not backfill the effectiveGasPrice into old transactions - // in the receipt, so we look it up manually and inject it. - if (params.gasPrice == null && params.effectiveGasPrice == null) { - const tx = await this.#perform({ method: "getTransaction", hash }); - if (tx == null) { - throw new Error("report this; could not find tx or effectiveGasPrice"); - } - params.effectiveGasPrice = tx.gasPrice; - } - return this._wrapTransactionReceipt(params, network); - } - async getTransactionResult(hash) { - const { result } = await resolveProperties({ - network: this.getNetwork(), - result: this.#perform({ method: "getTransactionResult", hash }) - }); - if (result == null) { - return null; - } - return hexlify(result); - } - // Bloom-filter Queries - async getLogs(_filter) { - let filter = this._getFilter(_filter); - if (isPromise(filter)) { - filter = await filter; - } - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#perform({ method: "getLogs", filter }) - }); - return params.map((p) => this._wrapLog(p, network)); - } - // ENS - _getProvider(chainId) { - assert(false, "provider cannot connect to target network", "UNSUPPORTED_OPERATION", { - operation: "_getProvider()" - }); - } - async getResolver(name) { - return await EnsResolver.fromName(this, name); - } - async getAvatar(name) { - const resolver = await this.getResolver(name); - if (resolver) { - return await resolver.getAvatar(); - } - return null; - } - async resolveName(name) { - const resolver = await this.getResolver(name); - if (resolver) { - return await resolver.getAddress(); - } - return null; - } - async lookupAddress(address) { - address = getAddress(address); - const node = namehash(address.substring(2).toLowerCase() + ".addr.reverse"); - try { - const ensAddr = await EnsResolver.getEnsAddress(this); - const ensContract = new Contract(ensAddr, [ - "function resolver(bytes32) view returns (address)" - ], this); - const resolver = await ensContract.resolver(node); - if (resolver == null || resolver === ZeroAddress) { - return null; - } - const resolverContract = new Contract(resolver, [ - "function name(bytes32) view returns (string)" - ], this); - const name = await resolverContract.name(node); - // Failed forward resolution - const check = await this.resolveName(name); - if (check !== address) { - return null; - } - return name; - } - catch (error) { - // No data was returned from the resolver - if (isError(error, "BAD_DATA") && error.value === "0x") { - return null; - } - // Something reerted - if (isError(error, "CALL_EXCEPTION")) { - return null; - } - throw error; - } - return null; - } - async waitForTransaction(hash, _confirms, timeout) { - const confirms = (_confirms != null) ? _confirms : 1; - if (confirms === 0) { - return this.getTransactionReceipt(hash); - } - return new Promise(async (resolve, reject) => { - let timer = null; - const listener = (async (blockNumber) => { - try { - const receipt = await this.getTransactionReceipt(hash); - if (receipt != null) { - if (blockNumber - receipt.blockNumber + 1 >= confirms) { - resolve(receipt); - //this.off("block", listener); - if (timer) { - clearTimeout(timer); - timer = null; - } - return; - } - } - } - catch (error) { - console.log("EEE", error); - } - this.once("block", listener); - }); - if (timeout != null) { - timer = setTimeout(() => { - if (timer == null) { - return; - } - timer = null; - this.off("block", listener); - reject(makeError("timeout", "TIMEOUT", { reason: "timeout" })); - }, timeout); - } - listener(await this.getBlockNumber()); - }); - } - async waitForBlock(blockTag) { - assert(false, "not implemented yet", "NOT_IMPLEMENTED", { - operation: "waitForBlock" - }); - } - /** - * Clear a timer created using the [[_setTimeout]] method. - */ - _clearTimeout(timerId) { - const timer = this.#timers.get(timerId); - if (!timer) { - return; - } - if (timer.timer) { - clearTimeout(timer.timer); - } - this.#timers.delete(timerId); - } - /** - * Create a timer that will execute %%func%% after at least %%timeout%% - * (in ms). If %%timeout%% is unspecified, then %%func%% will execute - * in the next event loop. - * - * [Pausing](AbstractProvider-paused) the provider will pause any - * associated timers. - */ - _setTimeout(_func, timeout) { - if (timeout == null) { - timeout = 0; - } - const timerId = this.#nextTimer++; - const func = () => { - this.#timers.delete(timerId); - _func(); - }; - if (this.paused) { - this.#timers.set(timerId, { timer: null, func, time: timeout }); - } - else { - const timer = setTimeout(func, timeout); - this.#timers.set(timerId, { timer, func, time: getTime() }); - } - return timerId; - } - /** - * Perform %%func%% on each subscriber. - */ - _forEachSubscriber(func) { - for (const sub of this.#subs.values()) { - func(sub.subscriber); - } - } - /** - * Sub-classes may override this to customize subscription - * implementations. - */ - _getSubscriber(sub) { - switch (sub.type) { - case "debug": - case "error": - case "network": - return new UnmanagedSubscriber(sub.type); - case "block": { - const subscriber = new PollingBlockSubscriber(this); - subscriber.pollingInterval = this.pollingInterval; - return subscriber; - } - case "safe": - case "finalized": - return new PollingBlockTagSubscriber(this, sub.type); - case "event": - return new PollingEventSubscriber(this, sub.filter); - case "transaction": - return new PollingTransactionSubscriber(this, sub.hash); - case "orphan": - return new PollingOrphanSubscriber(this, sub.filter); - } - throw new Error(`unsupported event: ${sub.type}`); - } - /** - * If a [[Subscriber]] fails and needs to replace itself, this - * method may be used. - * - * For example, this is used for providers when using the - * ``eth_getFilterChanges`` method, which can return null if state - * filters are not supported by the backend, allowing the Subscriber - * to swap in a [[PollingEventSubscriber]]. - */ - _recoverSubscriber(oldSub, newSub) { - for (const sub of this.#subs.values()) { - if (sub.subscriber === oldSub) { - if (sub.started) { - sub.subscriber.stop(); - } - sub.subscriber = newSub; - if (sub.started) { - newSub.start(); - } - if (this.#pausedState != null) { - newSub.pause(this.#pausedState); - } - break; - } - } - } - async #hasSub(event, emitArgs) { - let sub = await getSubscription(event, this); - // This is a log that is removing an existing log; we actually want - // to emit an orphan event for the removed log - if (sub.type === "event" && emitArgs && emitArgs.length > 0 && emitArgs[0].removed === true) { - sub = await getSubscription({ orphan: "drop-log", log: emitArgs[0] }, this); - } - return this.#subs.get(sub.tag) || null; - } - async #getSub(event) { - const subscription = await getSubscription(event, this); - // Prevent tampering with our tag in any subclass' _getSubscriber - const tag = subscription.tag; - let sub = this.#subs.get(tag); - if (!sub) { - const subscriber = this._getSubscriber(subscription); - const addressableMap = new WeakMap(); - const nameMap = new Map(); - sub = { subscriber, tag, addressableMap, nameMap, started: false, listeners: [] }; - this.#subs.set(tag, sub); - } - return sub; - } - async on(event, listener) { - const sub = await this.#getSub(event); - sub.listeners.push({ listener, once: false }); - if (!sub.started) { - sub.subscriber.start(); - sub.started = true; - if (this.#pausedState != null) { - sub.subscriber.pause(this.#pausedState); - } - } - return this; - } - async once(event, listener) { - const sub = await this.#getSub(event); - sub.listeners.push({ listener, once: true }); - if (!sub.started) { - sub.subscriber.start(); - sub.started = true; - if (this.#pausedState != null) { - sub.subscriber.pause(this.#pausedState); - } - } - return this; - } - async emit(event, ...args) { - const sub = await this.#hasSub(event, args); - // If there is not subscription or if a recent emit removed - // the last of them (which also deleted the sub) do nothing - if (!sub || sub.listeners.length === 0) { - return false; - } - ; - const count = sub.listeners.length; - sub.listeners = sub.listeners.filter(({ listener, once }) => { - const payload = new EventPayload(this, (once ? null : listener), event); - try { - listener.call(this, ...args, payload); - } - catch (error) { } - return !once; - }); - if (sub.listeners.length === 0) { - if (sub.started) { - sub.subscriber.stop(); - } - this.#subs.delete(sub.tag); - } - return (count > 0); - } - async listenerCount(event) { - if (event) { - const sub = await this.#hasSub(event); - if (!sub) { - return 0; - } - return sub.listeners.length; - } - let total = 0; - for (const { listeners } of this.#subs.values()) { - total += listeners.length; - } - return total; - } - async listeners(event) { - if (event) { - const sub = await this.#hasSub(event); - if (!sub) { - return []; - } - return sub.listeners.map(({ listener }) => listener); - } - let result = []; - for (const { listeners } of this.#subs.values()) { - result = result.concat(listeners.map(({ listener }) => listener)); - } - return result; - } - async off(event, listener) { - const sub = await this.#hasSub(event); - if (!sub) { - return this; - } - if (listener) { - const index = sub.listeners.map(({ listener }) => listener).indexOf(listener); - if (index >= 0) { - sub.listeners.splice(index, 1); - } - } - if (!listener || sub.listeners.length === 0) { - if (sub.started) { - sub.subscriber.stop(); - } - this.#subs.delete(sub.tag); - } - return this; - } - async removeAllListeners(event) { - if (event) { - const { tag, started, subscriber } = await this.#getSub(event); - if (started) { - subscriber.stop(); - } - this.#subs.delete(tag); - } - else { - for (const [tag, { started, subscriber }] of this.#subs) { - if (started) { - subscriber.stop(); - } - this.#subs.delete(tag); - } - } - return this; - } - // Alias for "on" - async addListener(event, listener) { - return await this.on(event, listener); - } - // Alias for "off" - async removeListener(event, listener) { - return this.off(event, listener); - } - /** - * If this provider has been destroyed using the [[destroy]] method. - * - * Once destroyed, all resources are reclaimed, internal event loops - * and timers are cleaned up and no further requests may be sent to - * the provider. - */ - get destroyed() { - return this.#destroyed; - } - /** - * Sub-classes may use this to shutdown any sockets or release their - * resources and reject any pending requests. - * - * Sub-classes **must** call ``super.destroy()``. - */ - destroy() { - // Stop all listeners - this.removeAllListeners(); - // Shut down all tiemrs - for (const timerId of this.#timers.keys()) { - this._clearTimeout(timerId); - } - this.#destroyed = true; - } - /** - * Whether the provider is currently paused. - * - * A paused provider will not emit any events, and generally should - * not make any requests to the network, but that is up to sub-classes - * to manage. - * - * Setting ``paused = true`` is identical to calling ``.pause(false)``, - * which will buffer any events that occur while paused until the - * provider is unpaused. - */ - get paused() { return (this.#pausedState != null); } - set paused(pause) { - if (!!pause === this.paused) { - return; - } - if (this.paused) { - this.resume(); - } - else { - this.pause(false); - } - } - /** - * Pause the provider. If %%dropWhilePaused%%, any events that occur - * while paused are dropped, otherwise all events will be emitted once - * the provider is unpaused. - */ - pause(dropWhilePaused) { - this.#lastBlockNumber = -1; - if (this.#pausedState != null) { - if (this.#pausedState == !!dropWhilePaused) { - return; - } - assert(false, "cannot change pause type; resume first", "UNSUPPORTED_OPERATION", { - operation: "pause" - }); - } - this._forEachSubscriber((s) => s.pause(dropWhilePaused)); - this.#pausedState = !!dropWhilePaused; - for (const timer of this.#timers.values()) { - // Clear the timer - if (timer.timer) { - clearTimeout(timer.timer); - } - // Remaining time needed for when we become unpaused - timer.time = getTime() - timer.time; - } - } - /** - * Resume the provider. - */ - resume() { - if (this.#pausedState == null) { - return; - } - this._forEachSubscriber((s) => s.resume()); - this.#pausedState = null; - for (const timer of this.#timers.values()) { - // Remaining time when we were paused - let timeout = timer.time; - if (timeout < 0) { - timeout = 0; - } - // Start time (in cause paused, so we con compute remaininf time) - timer.time = getTime(); - // Start the timer - setTimeout(timer.func, timeout); - } - } -} -function _parseString(result, start) { - try { - const bytes = _parseBytes(result, start); - if (bytes) { - return toUtf8String(bytes); - } - } - catch (error) { } - return null; -} -function _parseBytes(result, start) { - if (result === "0x") { - return null; - } - try { - const offset = getNumber(dataSlice(result, start, start + 32)); - const length = getNumber(dataSlice(result, offset, offset + 32)); - return dataSlice(result, offset + 32, offset + 32 + length); - } - catch (error) { } - return null; -} -function numPad(value) { - const result = toBeArray(value); - if (result.length > 32) { - throw new Error("internal; should not happen"); - } - const padded = new Uint8Array(32); - padded.set(result, 32 - result.length); - return padded; -} -function bytesPad(value) { - if ((value.length % 32) === 0) { - return value; - } - const result = new Uint8Array(Math.ceil(value.length / 32) * 32); - result.set(value); - return result; -} -const empty = new Uint8Array([]); -// ABI Encodes a series of (bytes, bytes, ...) -function encodeBytes(datas) { - const result = []; - let byteCount = 0; - // Add place-holders for pointers as we add items - for (let i = 0; i < datas.length; i++) { - result.push(empty); - byteCount += 32; - } - for (let i = 0; i < datas.length; i++) { - const data = getBytes(datas[i]); - // Update the bytes offset - result[i] = numPad(byteCount); - // The length and padded value of data - result.push(numPad(data.length)); - result.push(bytesPad(data)); - byteCount += 32 + Math.ceil(data.length / 32) * 32; - } - return concat(result); -} -const zeros = "0x0000000000000000000000000000000000000000000000000000000000000000"; -function parseOffchainLookup(data) { - const result = { - sender: "", urls: [], calldata: "", selector: "", extraData: "", errorArgs: [] - }; - assert(dataLength(data) >= 5 * 32, "insufficient OffchainLookup data", "OFFCHAIN_FAULT", { - reason: "insufficient OffchainLookup data" - }); - const sender = dataSlice(data, 0, 32); - assert(dataSlice(sender, 0, 12) === dataSlice(zeros, 0, 12), "corrupt OffchainLookup sender", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup sender" - }); - result.sender = dataSlice(sender, 12); - // Read the URLs from the response - try { - const urls = []; - const urlsOffset = getNumber(dataSlice(data, 32, 64)); - const urlsLength = getNumber(dataSlice(data, urlsOffset, urlsOffset + 32)); - const urlsData = dataSlice(data, urlsOffset + 32); - for (let u = 0; u < urlsLength; u++) { - const url = _parseString(urlsData, u * 32); - if (url == null) { - throw new Error("abort"); - } - urls.push(url); - } - result.urls = urls; - } - catch (error) { - assert(false, "corrupt OffchainLookup urls", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup urls" - }); - } - // Get the CCIP calldata to forward - try { - const calldata = _parseBytes(data, 64); - if (calldata == null) { - throw new Error("abort"); - } - result.calldata = calldata; - } - catch (error) { - assert(false, "corrupt OffchainLookup calldata", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup calldata" - }); - } - // Get the callbackSelector (bytes4) - assert(dataSlice(data, 100, 128) === dataSlice(zeros, 0, 28), "corrupt OffchainLookup callbaackSelector", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup callbaackSelector" - }); - result.selector = dataSlice(data, 96, 100); - // Get the extra data to send back to the contract as context - try { - const extraData = _parseBytes(data, 128); - if (extraData == null) { - throw new Error("abort"); - } - result.extraData = extraData; - } - catch (error) { - assert(false, "corrupt OffchainLookup extraData", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup extraData" - }); - } - result.errorArgs = "sender,urls,calldata,selector,extraData".split(/,/).map((k) => result[k]); - return result; -} -//# sourceMappingURL=abstract-provider.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/abstract-provider.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/abstract-provider.js.map deleted file mode 100644 index 3748e5a9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/abstract-provider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abstract-provider.js","sourceRoot":"","sources":["../../src.ts/providers/abstract-provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,QAAQ;AACR,oBAAoB;AACpB,4EAA4E;AAC5E,4EAA4E;AAC5E,6EAA6E;AAC7E,6EAA6E;AAC7E,2EAA2E;AAE3E,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EACH,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EACnD,SAAS,EAAE,QAAQ,EAAE,SAAS,EAC9B,eAAe,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,EAC3D,YAAY,EACZ,SAAS,EAAE,UAAU,EACrB,gBAAgB,EAAE,YAAY,EAAE,iBAAiB,EACj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AAE,GAAG,CAAC,KAAK,SAAS,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,0CAA0C,EAAE,gBAAgB,EAAE;QACxH,MAAM,EAAE,0CAA0C;KACrD,CAAC,CAAC;IACH,MAAM,CAAC,QAAQ,GAAG,SAAS,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC;IAE3C,6DAA6D;IAC7D,IAAI;QACA,MAAM,SAAS,GAAG,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACzC,IAAI,SAAS,IAAI,IAAI,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;SAAE;QACpD,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;KAChC;IAAC,OAAO,KAAK,EAAE;QACZ,MAAM,CAAC,KAAK,EAAE,kCAAkC,EAAE,gBAAgB,EAAE;YAChE,MAAM,EAAE,kCAAkC;SAC7C,CAAC,CAAC;KACN;IAED,MAAM,CAAC,SAAS,GAAG,yCAAyC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAO,MAAO,CAAC,CAAC,CAAC,CAAC,CAAA;IAEpG,OAAO,MAAM,CAAC;AAClB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/abstract-signer.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/abstract-signer.d.ts deleted file mode 100644 index 6bfe2688..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/abstract-signer.d.ts +++ /dev/null @@ -1,69 +0,0 @@ -import type { AuthorizationRequest, TypedDataDomain, TypedDataField } from "../hash/index.js"; -import type { Authorization, TransactionLike } from "../transaction/index.js"; -import type { BlockTag, Provider, TransactionRequest, TransactionResponse } from "./provider.js"; -import type { Signer } from "./signer.js"; -/** - * An **AbstractSigner** includes most of teh functionality required - * to get a [[Signer]] working as expected, but requires a few - * Signer-specific methods be overridden. - * - */ -export declare abstract class AbstractSigner

implements Signer { - /** - * The provider this signer is connected to. - */ - readonly provider: P; - /** - * Creates a new Signer connected to %%provider%%. - */ - constructor(provider?: P); - /** - * Resolves to the Signer address. - */ - abstract getAddress(): Promise; - /** - * Returns the signer connected to %%provider%%. - * - * This may throw, for example, a Signer connected over a Socket or - * to a specific instance of a node may not be transferrable. - */ - abstract connect(provider: null | Provider): Signer; - getNonce(blockTag?: BlockTag): Promise; - populateCall(tx: TransactionRequest): Promise>; - populateTransaction(tx: TransactionRequest): Promise>; - populateAuthorization(_auth: AuthorizationRequest): Promise; - estimateGas(tx: TransactionRequest): Promise; - call(tx: TransactionRequest): Promise; - resolveName(name: string): Promise; - sendTransaction(tx: TransactionRequest): Promise; - authorize(authorization: AuthorizationRequest): Promise; - abstract signTransaction(tx: TransactionRequest): Promise; - abstract signMessage(message: string | Uint8Array): Promise; - abstract signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise; -} -/** - * A **VoidSigner** is a class designed to allow an address to be used - * in any API which accepts a Signer, but for which there are no - * credentials available to perform any actual signing. - * - * This for example allow impersonating an account for the purpose of - * static calls or estimating gas, but does not allow sending transactions. - */ -export declare class VoidSigner extends AbstractSigner { - #private; - /** - * The signer address. - */ - readonly address: string; - /** - * Creates a new **VoidSigner** with %%address%% attached to - * %%provider%%. - */ - constructor(address: string, provider?: null | Provider); - getAddress(): Promise; - connect(provider: null | Provider): VoidSigner; - signTransaction(tx: TransactionRequest): Promise; - signMessage(message: string | Uint8Array): Promise; - signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise; -} -//# sourceMappingURL=abstract-signer.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/abstract-signer.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/abstract-signer.d.ts.map deleted file mode 100644 index 6d2c1c6f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/abstract-signer.d.ts.map +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AM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;CAG1I"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/abstract-signer.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/abstract-signer.js deleted file mode 100644 index 4b9efa41..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/abstract-signer.js +++ /dev/null @@ -1,244 +0,0 @@ -/** - * Generally the [[Wallet]] and [[JsonRpcSigner]] and their sub-classes - * are sufficient for most developers, but this is provided to - * fascilitate more complex Signers. - * - * @_section: api/providers/abstract-signer: Subclassing Signer [abstract-signer] - */ -import { resolveAddress } from "../address/index.js"; -import { Transaction } from "../transaction/index.js"; -import { defineProperties, getBigInt, resolveProperties, assert, assertArgument } from "../utils/index.js"; -import { copyRequest } from "./provider.js"; -function checkProvider(signer, operation) { - if (signer.provider) { - return signer.provider; - } - assert(false, "missing provider", "UNSUPPORTED_OPERATION", { operation }); -} -async function populate(signer, tx) { - let pop = copyRequest(tx); - if (pop.to != null) { - pop.to = resolveAddress(pop.to, signer); - } - if (pop.from != null) { - const from = pop.from; - pop.from = Promise.all([ - signer.getAddress(), - resolveAddress(from, signer) - ]).then(([address, from]) => { - assertArgument(address.toLowerCase() === from.toLowerCase(), "transaction from mismatch", "tx.from", from); - return address; - }); - } - else { - pop.from = signer.getAddress(); - } - return await resolveProperties(pop); -} -/** - * An **AbstractSigner** includes most of teh functionality required - * to get a [[Signer]] working as expected, but requires a few - * Signer-specific methods be overridden. - * - */ -export class AbstractSigner { - /** - * The provider this signer is connected to. - */ - provider; - /** - * Creates a new Signer connected to %%provider%%. - */ - constructor(provider) { - defineProperties(this, { provider: (provider || null) }); - } - async getNonce(blockTag) { - return checkProvider(this, "getTransactionCount").getTransactionCount(await this.getAddress(), blockTag); - } - async populateCall(tx) { - const pop = await populate(this, tx); - return pop; - } - async populateTransaction(tx) { - const provider = checkProvider(this, "populateTransaction"); - const pop = await populate(this, tx); - if (pop.nonce == null) { - pop.nonce = await this.getNonce("pending"); - } - if (pop.gasLimit == null) { - pop.gasLimit = await this.estimateGas(pop); - } - // Populate the chain ID - const network = await (this.provider).getNetwork(); - if (pop.chainId != null) { - const chainId = getBigInt(pop.chainId); - assertArgument(chainId === network.chainId, "transaction chainId mismatch", "tx.chainId", tx.chainId); - } - else { - pop.chainId = network.chainId; - } - // Do not allow mixing pre-eip-1559 and eip-1559 properties - const hasEip1559 = (pop.maxFeePerGas != null || pop.maxPriorityFeePerGas != null); - if (pop.gasPrice != null && (pop.type === 2 || hasEip1559)) { - assertArgument(false, "eip-1559 transaction do not support gasPrice", "tx", tx); - } - else if ((pop.type === 0 || pop.type === 1) && hasEip1559) { - assertArgument(false, "pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas", "tx", tx); - } - if ((pop.type === 2 || pop.type == null) && (pop.maxFeePerGas != null && pop.maxPriorityFeePerGas != null)) { - // Fully-formed EIP-1559 transaction (skip getFeeData) - pop.type = 2; - } - else if (pop.type === 0 || pop.type === 1) { - // Explicit Legacy or EIP-2930 transaction - // We need to get fee data to determine things - const feeData = await provider.getFeeData(); - assert(feeData.gasPrice != null, "network does not support gasPrice", "UNSUPPORTED_OPERATION", { - operation: "getGasPrice" - }); - // Populate missing gasPrice - if (pop.gasPrice == null) { - pop.gasPrice = feeData.gasPrice; - } - } - else { - // We need to get fee data to determine things - const feeData = await provider.getFeeData(); - if (pop.type == null) { - // We need to auto-detect the intended type of this transaction... - if (feeData.maxFeePerGas != null && feeData.maxPriorityFeePerGas != null) { - // The network supports EIP-1559! - // Upgrade transaction from null to eip-1559 - if (pop.authorizationList && pop.authorizationList.length) { - pop.type = 4; - } - else { - pop.type = 2; - } - if (pop.gasPrice != null) { - // Using legacy gasPrice property on an eip-1559 network, - // so use gasPrice as both fee properties - const gasPrice = pop.gasPrice; - delete pop.gasPrice; - pop.maxFeePerGas = gasPrice; - pop.maxPriorityFeePerGas = gasPrice; - } - else { - // Populate missing fee data - if (pop.maxFeePerGas == null) { - pop.maxFeePerGas = feeData.maxFeePerGas; - } - if (pop.maxPriorityFeePerGas == null) { - pop.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas; - } - } - } - else if (feeData.gasPrice != null) { - // Network doesn't support EIP-1559... - // ...but they are trying to use EIP-1559 properties - assert(!hasEip1559, "network does not support EIP-1559", "UNSUPPORTED_OPERATION", { - operation: "populateTransaction" - }); - // Populate missing fee data - if (pop.gasPrice == null) { - pop.gasPrice = feeData.gasPrice; - } - // Explicitly set untyped transaction to legacy - // @TODO: Maybe this shold allow type 1? - pop.type = 0; - } - else { - // getFeeData has failed us. - assert(false, "failed to get consistent fee data", "UNSUPPORTED_OPERATION", { - operation: "signer.getFeeData" - }); - } - } - else if (pop.type === 2 || pop.type === 3 || pop.type === 4) { - // Explicitly using EIP-1559 or EIP-4844 - // Populate missing fee data - if (pop.maxFeePerGas == null) { - pop.maxFeePerGas = feeData.maxFeePerGas; - } - if (pop.maxPriorityFeePerGas == null) { - pop.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas; - } - } - } - //@TOOD: Don't await all over the place; save them up for - // the end for better batching - return await resolveProperties(pop); - } - async populateAuthorization(_auth) { - const auth = Object.assign({}, _auth); - // Add a chain ID if not explicitly set to 0 - if (auth.chainId == null) { - auth.chainId = (await checkProvider(this, "getNetwork").getNetwork()).chainId; - } - // @TODO: Take chain ID into account when populating noce? - if (auth.nonce == null) { - auth.nonce = await this.getNonce(); - } - return auth; - } - async estimateGas(tx) { - return checkProvider(this, "estimateGas").estimateGas(await this.populateCall(tx)); - } - async call(tx) { - return checkProvider(this, "call").call(await this.populateCall(tx)); - } - async resolveName(name) { - const provider = checkProvider(this, "resolveName"); - return await provider.resolveName(name); - } - async sendTransaction(tx) { - const provider = checkProvider(this, "sendTransaction"); - const pop = await this.populateTransaction(tx); - delete pop.from; - const txObj = Transaction.from(pop); - return await provider.broadcastTransaction(await this.signTransaction(txObj)); - } - // @TODO: in v7 move this to be abstract - authorize(authorization) { - assert(false, "authorization not implemented for this signer", "UNSUPPORTED_OPERATION", { operation: "authorize" }); - } -} -/** - * A **VoidSigner** is a class designed to allow an address to be used - * in any API which accepts a Signer, but for which there are no - * credentials available to perform any actual signing. - * - * This for example allow impersonating an account for the purpose of - * static calls or estimating gas, but does not allow sending transactions. - */ -export class VoidSigner extends AbstractSigner { - /** - * The signer address. - */ - address; - /** - * Creates a new **VoidSigner** with %%address%% attached to - * %%provider%%. - */ - constructor(address, provider) { - super(provider); - defineProperties(this, { address }); - } - async getAddress() { return this.address; } - connect(provider) { - return new VoidSigner(this.address, provider); - } - #throwUnsupported(suffix, operation) { - assert(false, `VoidSigner cannot sign ${suffix}`, "UNSUPPORTED_OPERATION", { operation }); - } - async signTransaction(tx) { - this.#throwUnsupported("transactions", "signTransaction"); - } - async signMessage(message) { - this.#throwUnsupported("messages", "signMessage"); - } - async signTypedData(domain, types, value) { - this.#throwUnsupported("typed-data", "signTypedData"); - } -} -//# sourceMappingURL=abstract-signer.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/abstract-signer.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/abstract-signer.js.map deleted file mode 100644 index be991d0d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/abstract-signer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abstract-signer.js","sourceRoot":"","sources":["../../src.ts/providers/abstract-signer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EACH,gBAAgB,EAAE,SAAS,EAAE,iBAAiB,EAC9C,MAAM,EAAE,cAAc,EACzB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAY5C,SAAS,aAAa,CAAC,MAAsB,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C,QAAQ,CAAC,CAAC;QAChB,gBAAgB,CAAa,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IACpD,CAAC;IAED,KAAK,CAAC,UAAU,KAAsB,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAE5D,OAAO,CAAC,QAAyB;QAC7B,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAClD,CAAC;IAED,iBAAiB,CAAC,MAAc,EAAE,SAAiB;QAC/C,MAAM,CAAC,KAAK,EAAE,0BAA2B,MAAO,EAAE,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;IAChG,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,EAAsB;QACxC,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAC;IAC9D,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,OAA4B;QAC1C,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,MAAuB,EAAE,KAA4C,EAAE,KAA0B;QACjH,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;IAC1D,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/community.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/community.d.ts deleted file mode 100644 index db64d2db..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/community.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * There are many awesome community services that provide Ethereum - * nodes both for developers just starting out and for large-scale - * communities. - * - * @_section: api/providers/thirdparty: Community Providers [thirdparty] - */ -/** - * Providers which offer community credentials should extend this - * to notify any interested consumers whether community credentials - * are in-use. - */ -export interface CommunityResourcable { - /** - * Returns true if the instance is connected using the community - * credentials. - */ - isCommunityResource(): boolean; -} -/** - * Displays a warning in the console when the community resource is - * being used too heavily by the app, recommending the developer - * acquire their own credentials instead of using the community - * credentials. - * - * The notification will only occur once per service. - */ -export declare function showThrottleMessage(service: string): void; -//# sourceMappingURL=community.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/community.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/community.d.ts.map deleted file mode 100644 index ffecbb46..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/community.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"community.d.ts","sourceRoot":"","sources":["../../src.ts/providers/community.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACjC;;;OAGG;IACH,mBAAmB,IAAI,OAAO,CAAC;CAClC;AAKD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAgBzD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/community.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/community.js deleted file mode 100644 index 8d867583..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/community.js +++ /dev/null @@ -1,36 +0,0 @@ -/** - * There are many awesome community services that provide Ethereum - * nodes both for developers just starting out and for large-scale - * communities. - * - * @_section: api/providers/thirdparty: Community Providers [thirdparty] - */ -// Show the throttle message only once per service -const shown = new Set(); -/** - * Displays a warning in the console when the community resource is - * being used too heavily by the app, recommending the developer - * acquire their own credentials instead of using the community - * credentials. - * - * The notification will only occur once per service. - */ -export function showThrottleMessage(service) { - if (shown.has(service)) { - return; - } - shown.add(service); - console.log("========= NOTICE ========="); - console.log(`Request-Rate Exceeded for ${service} (this message will not be repeated)`); - console.log(""); - console.log("The default API keys for each service are provided as a highly-throttled,"); - console.log("community resource for low-traffic projects and early prototyping."); - console.log(""); - console.log("While your application will continue to function, we highly recommended"); - console.log("signing up for your own API keys to improve performance, increase your"); - console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."); - console.log(""); - console.log("For more details: https:/\/docs.ethers.org/api-keys/"); - console.log("=========================="); -} -//# sourceMappingURL=community.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/community.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/community.js.map deleted file mode 100644 index 0a67f481..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/community.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"community.js","sourceRoot":"","sources":["../../src.ts/providers/community.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAeH,kDAAkD;AAClD,MAAM,KAAK,GAAgB,IAAI,GAAG,EAAE,CAAC;AAErC;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAe;IAC/C,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;QAAE,OAAO;KAAE;IACnC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAEnB,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAA;IACzC,OAAO,CAAC,GAAG,CAAC,6BAA8B,OAAQ,sCAAsC,CAAC,CAAC;IAC1F,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,2EAA2E,CAAC,CAAC;IACzF,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;IAClF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,yEAAyE,CAAC,CAAC;IACvF,OAAO,CAAC,GAAG,CAAC,wEAAwE,CAAC,CAAC;IACtF,OAAO,CAAC,GAAG,CAAC,+EAA+E,CAAC,CAAC;IAC7F,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,sDAAsD,CAAC,CAAC;IACpE,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAC9C,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/contracts.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/contracts.d.ts deleted file mode 100644 index e5f1d42d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/contracts.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import type { Provider, TransactionRequest, TransactionResponse } from "./provider.js"; -/** - * A **ContractRunner** is a generic interface which defines an object - * capable of interacting with a Contract on the network. - * - * The more operations supported, the more utility it is capable of. - * - * The most common ContractRunners are [Providers](Provider) which enable - * read-only access and [Signers](Signer) which enable write-access. - */ -export interface ContractRunner { - /** - * The provider used for necessary state querying operations. - * - * This can also point to the **ContractRunner** itself, in the - * case of an [[AbstractProvider]]. - */ - provider: null | Provider; - /** - * Required to estimate gas. - */ - estimateGas?: (tx: TransactionRequest) => Promise; - /** - * Required for pure, view or static calls to contracts. - */ - call?: (tx: TransactionRequest) => Promise; - /** - * Required to support ENS names - */ - resolveName?: (name: string) => Promise; - /** - * Required for state mutating calls - */ - sendTransaction?: (tx: TransactionRequest) => Promise; -} -//# sourceMappingURL=contracts.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/contracts.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/contracts.d.ts.map deleted file mode 100644 index 078fdc87..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/contracts.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src.ts/providers/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,QAAQ,EAAE,kBAAkB,EAAE,mBAAmB,EACpD,MAAM,eAAe,CAAC;AAEvB;;;;;;;;GAQG;AACH,MAAM,WAAW,cAAc;IAC3B;;;;;OAKG;IACH,QAAQ,EAAE,IAAI,GAAG,QAAQ,CAAC;IAE1B;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAE1D;;OAEG;IACH,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnD;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;IAEvD;;OAEG;IACH,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC9E"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/contracts.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/contracts.js deleted file mode 100644 index 202a39eb..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/contracts.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=contracts.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/contracts.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/contracts.js.map deleted file mode 100644 index 42ac4de8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/contracts.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../src.ts/providers/contracts.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/default-provider.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/default-provider.d.ts deleted file mode 100644 index 73704c76..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/default-provider.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -import type { AbstractProvider } from "./abstract-provider.js"; -import type { Networkish } from "./network.js"; -import { WebSocketLike } from "./provider-websocket.js"; -/** - * Returns a default provider for %%network%%. - * - * If %%network%% is a [[WebSocketLike]] or string that begins with - * ``"ws:"`` or ``"wss:"``, a [[WebSocketProvider]] is returned backed - * by that WebSocket or URL. - * - * If %%network%% is a string that begins with ``"HTTP:"`` or ``"HTTPS:"``, - * a [[JsonRpcProvider]] is returned connected to that URL. - * - * Otherwise, a default provider is created backed by well-known public - * Web3 backends (such as [[link-infura]]) using community-provided API - * keys. - * - * The %%options%% allows specifying custom API keys per backend (setting - * an API key to ``"-"`` will omit that provider) and ``options.exclusive`` - * can be set to either a backend name or and array of backend names, which - * will whitelist **only** those backends. - * - * Current backend strings supported are: - * - ``"alchemy"`` - * - ``"ankr"`` - * - ``"cloudflare"`` - * - ``"chainstack"`` - * - ``"etherscan"`` - * - ``"infura"`` - * - ``"publicPolygon"`` - * - ``"quicknode"`` - * - * @example: - * // Connect to a local Geth node - * provider = getDefaultProvider("http://localhost:8545/"); - * - * // Connect to Ethereum mainnet with any current and future - * // third-party services available - * provider = getDefaultProvider("mainnet"); - * - * // Connect to Polygon, but only allow Etherscan and - * // INFURA and use "MY_API_KEY" in calls to Etherscan. - * provider = getDefaultProvider("matic", { - * etherscan: "MY_API_KEY", - * exclusive: [ "etherscan", "infura" ] - * }); - */ -export declare function getDefaultProvider(network?: string | Networkish | WebSocketLike, options?: any): AbstractProvider; -//# sourceMappingURL=default-provider.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/default-provider.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/default-provider.d.ts.map deleted file mode 100644 index 1cea7a66..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/default-provider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"default-provider.d.ts","sourceRoot":"","sources":["../../src.ts/providers/default-provider.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AASxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,aAAa,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,gBAAgB,CAgIjH"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/default-provider.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/default-provider.js deleted file mode 100644 index 9a15d7af..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/default-provider.js +++ /dev/null @@ -1,196 +0,0 @@ -import { assert } from "../utils/index.js"; -import { AnkrProvider } from "./provider-ankr.js"; -import { AlchemyProvider } from "./provider-alchemy.js"; -//import { BlockscoutProvider } from "./provider-blockscout.js"; -import { ChainstackProvider } from "./provider-chainstack.js"; -import { CloudflareProvider } from "./provider-cloudflare.js"; -import { EtherscanProvider } from "./provider-etherscan.js"; -import { InfuraProvider } from "./provider-infura.js"; -//import { PocketProvider } from "./provider-pocket.js"; -import { QuickNodeProvider } from "./provider-quicknode.js"; -import { FallbackProvider } from "./provider-fallback.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import { Network } from "./network.js"; -import { WebSocketProvider } from "./provider-websocket.js"; -function isWebSocketLike(value) { - return (value && typeof (value.send) === "function" && - typeof (value.close) === "function"); -} -const Testnets = "goerli kovan sepolia classicKotti optimism-goerli arbitrum-goerli matic-mumbai bnbt".split(" "); -/** - * Returns a default provider for %%network%%. - * - * If %%network%% is a [[WebSocketLike]] or string that begins with - * ``"ws:"`` or ``"wss:"``, a [[WebSocketProvider]] is returned backed - * by that WebSocket or URL. - * - * If %%network%% is a string that begins with ``"HTTP:"`` or ``"HTTPS:"``, - * a [[JsonRpcProvider]] is returned connected to that URL. - * - * Otherwise, a default provider is created backed by well-known public - * Web3 backends (such as [[link-infura]]) using community-provided API - * keys. - * - * The %%options%% allows specifying custom API keys per backend (setting - * an API key to ``"-"`` will omit that provider) and ``options.exclusive`` - * can be set to either a backend name or and array of backend names, which - * will whitelist **only** those backends. - * - * Current backend strings supported are: - * - ``"alchemy"`` - * - ``"ankr"`` - * - ``"cloudflare"`` - * - ``"chainstack"`` - * - ``"etherscan"`` - * - ``"infura"`` - * - ``"publicPolygon"`` - * - ``"quicknode"`` - * - * @example: - * // Connect to a local Geth node - * provider = getDefaultProvider("http://localhost:8545/"); - * - * // Connect to Ethereum mainnet with any current and future - * // third-party services available - * provider = getDefaultProvider("mainnet"); - * - * // Connect to Polygon, but only allow Etherscan and - * // INFURA and use "MY_API_KEY" in calls to Etherscan. - * provider = getDefaultProvider("matic", { - * etherscan: "MY_API_KEY", - * exclusive: [ "etherscan", "infura" ] - * }); - */ -export function getDefaultProvider(network, options) { - if (options == null) { - options = {}; - } - const allowService = (name) => { - if (options[name] === "-") { - return false; - } - if (typeof (options.exclusive) === "string") { - return (name === options.exclusive); - } - if (Array.isArray(options.exclusive)) { - return (options.exclusive.indexOf(name) !== -1); - } - return true; - }; - if (typeof (network) === "string" && network.match(/^https?:/)) { - return new JsonRpcProvider(network); - } - if (typeof (network) === "string" && network.match(/^wss?:/) || isWebSocketLike(network)) { - return new WebSocketProvider(network); - } - // Get the network and name, if possible - let staticNetwork = null; - try { - staticNetwork = Network.from(network); - } - catch (error) { } - const providers = []; - if (allowService("publicPolygon") && staticNetwork) { - if (staticNetwork.name === "matic") { - providers.push(new JsonRpcProvider("https:/\/polygon-rpc.com/", staticNetwork, { staticNetwork })); - } - else if (staticNetwork.name === "matic-amoy") { - providers.push(new JsonRpcProvider("https:/\/rpc-amoy.polygon.technology/", staticNetwork, { staticNetwork })); - } - } - if (allowService("alchemy")) { - try { - providers.push(new AlchemyProvider(network, options.alchemy)); - } - catch (error) { } - } - if (allowService("ankr") && options.ankr != null) { - try { - providers.push(new AnkrProvider(network, options.ankr)); - } - catch (error) { } - } - /* Temporarily remove until custom error issue is fixed - if (allowService("blockscout")) { - try { - providers.push(new BlockscoutProvider(network, options.blockscout)); - } catch (error) { } - } - */ - if (allowService("chainstack")) { - try { - providers.push(new ChainstackProvider(network, options.chainstack)); - } - catch (error) { } - } - if (allowService("cloudflare")) { - try { - providers.push(new CloudflareProvider(network)); - } - catch (error) { } - } - if (allowService("etherscan")) { - try { - providers.push(new EtherscanProvider(network, options.etherscan)); - } - catch (error) { } - } - if (allowService("infura")) { - try { - let projectId = options.infura; - let projectSecret = undefined; - if (typeof (projectId) === "object") { - projectSecret = projectId.projectSecret; - projectId = projectId.projectId; - } - providers.push(new InfuraProvider(network, projectId, projectSecret)); - } - catch (error) { } - } - /* - if (options.pocket !== "-") { - try { - let appId = options.pocket; - let secretKey: undefined | string = undefined; - let loadBalancer: undefined | boolean = undefined; - if (typeof(appId) === "object") { - loadBalancer = !!appId.loadBalancer; - secretKey = appId.secretKey; - appId = appId.appId; - } - providers.push(new PocketProvider(network, appId, secretKey, loadBalancer)); - } catch (error) { console.log(error); } - } - */ - if (allowService("quicknode")) { - try { - let token = options.quicknode; - providers.push(new QuickNodeProvider(network, token)); - } - catch (error) { } - } - assert(providers.length, "unsupported default network", "UNSUPPORTED_OPERATION", { - operation: "getDefaultProvider" - }); - // No need for a FallbackProvider - if (providers.length === 1) { - return providers[0]; - } - // We use the floor because public third-party providers can be unreliable, - // so a low number of providers with a large quorum will fail too often - let quorum = Math.floor(providers.length / 2); - if (quorum > 2) { - quorum = 2; - } - // Testnets don't need as strong a security gaurantee and speed is - // more useful during testing - if (staticNetwork && Testnets.indexOf(staticNetwork.name) !== -1) { - quorum = 1; - } - // Provided override qorum takes priority - if (options && options.quorum) { - quorum = options.quorum; - } - return new FallbackProvider(providers, undefined, { quorum }); -} -//# sourceMappingURL=default-provider.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/default-provider.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/default-provider.js.map deleted file mode 100644 index 03887cd9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/default-provider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"default-provider.js","sourceRoot":"","sources":["../../src.ts/providers/default-provider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,gEAAgE;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,wDAAwD;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAM5D,SAAS,eAAe,CAAC,KAAU;IAC/B,OAAO,CAAC,KAAK,IAAI,OAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,UAAU;QAC9C,OAAM,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,UAAU,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,QAAQ,GAAG,qFAAqF,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAElH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,QAAQ,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE;QAAE,MAAM,GAAG,CAAC,CAAC;KAAE;IAEjF,yCAAyC;IACzC,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE;QAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;KAAE;IAE3D,OAAO,IAAI,gBAAgB,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;AAClE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ens-resolver.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ens-resolver.d.ts deleted file mode 100644 index 8c3b37fe..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ens-resolver.d.ts +++ /dev/null @@ -1,147 +0,0 @@ -/** - * ENS is a service which allows easy-to-remember names to map to - * network addresses. - * - * @_section: api/providers/ens-resolver:ENS Resolver [about-ens-rsolver] - */ -import type { BytesLike } from "../utils/index.js"; -import type { AbstractProvider, AbstractProviderPlugin } from "./abstract-provider.js"; -import type { Provider } from "./provider.js"; -/** - * The type of data found during a steip during avatar resolution. - */ -export type AvatarLinkageType = "name" | "avatar" | "!avatar" | "url" | "data" | "ipfs" | "erc721" | "erc1155" | "!erc721-caip" | "!erc1155-caip" | "!owner" | "owner" | "!balance" | "balance" | "metadata-url-base" | "metadata-url-expanded" | "metadata-url" | "!metadata-url" | "!metadata" | "metadata" | "!imageUrl" | "imageUrl-ipfs" | "imageUrl" | "!imageUrl-ipfs"; -/** - * An individual record for each step during avatar resolution. - */ -export interface AvatarLinkage { - /** - * The type of linkage. - */ - type: AvatarLinkageType; - /** - * The linkage value. - */ - value: string; -} -/** - * When resolving an avatar for an ENS name, there are many - * steps involved, fetching metadata, validating results, et cetera. - * - * Some applications may wish to analyse this data, or use this data - * to diagnose promblems, so an **AvatarResult** provides details of - * each completed step during avatar resolution. - */ -export interface AvatarResult { - /** - * How the [[url]] was arrived at, resolving the many steps required - * for an avatar URL. - */ - linkage: Array; - /** - * The avatar URL or null if the avatar was not set, or there was - * an issue during validation (such as the address not owning the - * avatar or a metadata error). - */ - url: null | string; -} -/** - * A provider plugin super-class for processing multicoin address types. - */ -export declare abstract class MulticoinProviderPlugin implements AbstractProviderPlugin { - /** - * The name. - */ - readonly name: string; - /** - * Creates a new **MulticoinProviderPluing** for %%name%%. - */ - constructor(name: string); - connect(proivder: Provider): MulticoinProviderPlugin; - /** - * Returns ``true`` if %%coinType%% is supported by this plugin. - */ - supportsCoinType(coinType: number): boolean; - /** - * Resolves to the encoded %%address%% for %%coinType%%. - */ - encodeAddress(coinType: number, address: string): Promise; - /** - * Resolves to the decoded %%data%% for %%coinType%%. - */ - decodeAddress(coinType: number, data: BytesLike): Promise; -} -/** - * A **BasicMulticoinProviderPlugin** provides service for common - * coin types, which do not require additional libraries to encode or - * decode. - */ -export declare class BasicMulticoinProviderPlugin extends MulticoinProviderPlugin { - /** - * Creates a new **BasicMulticoinProviderPlugin**. - */ - constructor(); -} -/** - * A connected object to a resolved ENS name resolver, which can be - * used to query additional details. - */ -export declare class EnsResolver { - #private; - /** - * The connected provider. - */ - provider: AbstractProvider; - /** - * The address of the resolver. - */ - address: string; - /** - * The name this resolver was resolved against. - */ - name: string; - constructor(provider: AbstractProvider, address: string, name: string); - /** - * Resolves to true if the resolver supports wildcard resolution. - */ - supportsWildcard(): Promise; - /** - * Resolves to the address for %%coinType%% or null if the - * provided %%coinType%% has not been configured. - */ - getAddress(coinType?: number): Promise; - /** - * Resolves to the EIP-634 text record for %%key%%, or ``null`` - * if unconfigured. - */ - getText(key: string): Promise; - /** - * Rsolves to the content-hash or ``null`` if unconfigured. - */ - getContentHash(): Promise; - /** - * Resolves to the avatar url or ``null`` if the avatar is either - * unconfigured or incorrectly configured (e.g. references an NFT - * not owned by the address). - * - * If diagnosing issues with configurations, the [[_getAvatar]] - * method may be useful. - */ - getAvatar(): Promise; - /** - * When resolving an avatar, there are many steps involved, such - * fetching metadata and possibly validating ownership of an - * NFT. - * - * This method can be used to examine each step and the value it - * was working from. - */ - _getAvatar(): Promise; - static getEnsAddress(provider: Provider): Promise; - /** - * Resolve to the ENS resolver for %%name%% using %%provider%% or - * ``null`` if unconfigured. - */ - static fromName(provider: AbstractProvider, name: string): Promise; -} -//# sourceMappingURL=ens-resolver.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ens-resolver.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ens-resolver.d.ts.map deleted file mode 100644 index 5bbaa89f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ens-resolver.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ens-resolver.d.ts","sourceRoot":"","sources":["../../src.ts/providers/ens-resolver.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAeH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAEvF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAgB9C;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GACnF,QAAQ,GAAG,SAAS,GAAG,cAAc,GAAG,eAAe,GACvD,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,GAC3C,mBAAmB,GAAG,uBAAuB,GAAG,cAAc,GAAG,eAAe,GAChF,WAAW,GAAG,UAAU,GACxB,WAAW,GAAG,eAAe,GAAG,UAAU,GAAG,gBAAgB,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B;;OAEG;IACH,IAAI,EAAE,iBAAiB,CAAC;IAExB;;OAEG;IACH,KAAK,EA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IAMlD;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC;IA6B9C;;;;;;;OAOG;IACG,SAAS,IAAI,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC;IAKzC;;;;;;;OAOG;IACG,UAAU,IAAI,OAAO,CAAC,YAAY,CAAC;WAgK5B,aAAa,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;IAoC/D;;;OAGG;WACU,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,WAAW,CAAC;CA2B/F"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ens-resolver.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ens-resolver.js deleted file mode 100644 index 5c92bfe8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ens-resolver.js +++ /dev/null @@ -1,496 +0,0 @@ -/** - * ENS is a service which allows easy-to-remember names to map to - * network addresses. - * - * @_section: api/providers/ens-resolver:ENS Resolver [about-ens-rsolver] - */ -import { getAddress } from "../address/index.js"; -import { ZeroAddress } from "../constants/index.js"; -import { Contract } from "../contract/index.js"; -import { dnsEncode, namehash } from "../hash/index.js"; -import { hexlify, isHexString, toBeHex, defineProperties, encodeBase58, assert, assertArgument, isError, FetchRequest } from "../utils/index.js"; -// @TODO: This should use the fetch-data:ipfs gateway -// Trim off the ipfs:// prefix and return the default gateway URL -function getIpfsLink(link) { - if (link.match(/^ipfs:\/\/ipfs\//i)) { - link = link.substring(12); - } - else if (link.match(/^ipfs:\/\//i)) { - link = link.substring(7); - } - else { - assertArgument(false, "unsupported IPFS format", "link", link); - } - return `https:/\/gateway.ipfs.io/ipfs/${link}`; -} -; -; -/** - * A provider plugin super-class for processing multicoin address types. - */ -export class MulticoinProviderPlugin { - /** - * The name. - */ - name; - /** - * Creates a new **MulticoinProviderPluing** for %%name%%. - */ - constructor(name) { - defineProperties(this, { name }); - } - connect(proivder) { - return this; - } - /** - * Returns ``true`` if %%coinType%% is supported by this plugin. - */ - supportsCoinType(coinType) { - return false; - } - /** - * Resolves to the encoded %%address%% for %%coinType%%. - */ - async encodeAddress(coinType, address) { - throw new Error("unsupported coin"); - } - /** - * Resolves to the decoded %%data%% for %%coinType%%. - */ - async decodeAddress(coinType, data) { - throw new Error("unsupported coin"); - } -} -const BasicMulticoinPluginId = "org.ethers.plugins.provider.BasicMulticoin"; -/** - * A **BasicMulticoinProviderPlugin** provides service for common - * coin types, which do not require additional libraries to encode or - * decode. - */ -export class BasicMulticoinProviderPlugin extends MulticoinProviderPlugin { - /** - * Creates a new **BasicMulticoinProviderPlugin**. - */ - constructor() { - super(BasicMulticoinPluginId); - } -} -const matcherIpfs = new RegExp("^(ipfs):/\/(.*)$", "i"); -const matchers = [ - new RegExp("^(https):/\/(.*)$", "i"), - new RegExp("^(data):(.*)$", "i"), - matcherIpfs, - new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$", "i"), -]; -/** - * A connected object to a resolved ENS name resolver, which can be - * used to query additional details. - */ -export class EnsResolver { - /** - * The connected provider. - */ - provider; - /** - * The address of the resolver. - */ - address; - /** - * The name this resolver was resolved against. - */ - name; - // For EIP-2544 names, the ancestor that provided the resolver - #supports2544; - #resolver; - constructor(provider, address, name) { - defineProperties(this, { provider, address, name }); - this.#supports2544 = null; - this.#resolver = new Contract(address, [ - "function supportsInterface(bytes4) view returns (bool)", - "function resolve(bytes, bytes) view returns (bytes)", - "function addr(bytes32) view returns (address)", - "function addr(bytes32, uint) view returns (bytes)", - "function text(bytes32, string) view returns (string)", - "function contenthash(bytes32) view returns (bytes)", - ], provider); - } - /** - * Resolves to true if the resolver supports wildcard resolution. - */ - async supportsWildcard() { - if (this.#supports2544 == null) { - this.#supports2544 = (async () => { - try { - return await this.#resolver.supportsInterface("0x9061b923"); - } - catch (error) { - // Wildcard resolvers must understand supportsInterface - // and return true. - if (isError(error, "CALL_EXCEPTION")) { - return false; - } - // Let future attempts try again... - this.#supports2544 = null; - throw error; - } - })(); - } - return await this.#supports2544; - } - async #fetch(funcName, params) { - params = (params || []).slice(); - const iface = this.#resolver.interface; - // The first parameters is always the nodehash - params.unshift(namehash(this.name)); - let fragment = null; - if (await this.supportsWildcard()) { - fragment = iface.getFunction(funcName); - assert(fragment, "missing fragment", "UNKNOWN_ERROR", { - info: { funcName } - }); - params = [ - dnsEncode(this.name, 255), - iface.encodeFunctionData(fragment, params) - ]; - funcName = "resolve(bytes,bytes)"; - } - params.push({ - enableCcipRead: true - }); - try { - const result = await this.#resolver[funcName](...params); - if (fragment) { - return iface.decodeFunctionResult(fragment, result)[0]; - } - return result; - } - catch (error) { - if (!isError(error, "CALL_EXCEPTION")) { - throw error; - } - } - return null; - } - /** - * Resolves to the address for %%coinType%% or null if the - * provided %%coinType%% has not been configured. - */ - async getAddress(coinType) { - if (coinType == null) { - coinType = 60; - } - if (coinType === 60) { - try { - const result = await this.#fetch("addr(bytes32)"); - // No address - if (result == null || result === ZeroAddress) { - return null; - } - return result; - } - catch (error) { - if (isError(error, "CALL_EXCEPTION")) { - return null; - } - throw error; - } - } - // Try decoding its EVM canonical chain as an EVM chain address first - if (coinType >= 0 && coinType < 0x80000000) { - let ethCoinType = coinType + 0x80000000; - const data = await this.#fetch("addr(bytes32,uint)", [ethCoinType]); - if (isHexString(data, 20)) { - return getAddress(data); - } - } - let coinPlugin = null; - for (const plugin of this.provider.plugins) { - if (!(plugin instanceof MulticoinProviderPlugin)) { - continue; - } - if (plugin.supportsCoinType(coinType)) { - coinPlugin = plugin; - break; - } - } - if (coinPlugin == null) { - return null; - } - // keccak256("addr(bytes32,uint256") - const data = await this.#fetch("addr(bytes32,uint)", [coinType]); - // No address - if (data == null || data === "0x") { - return null; - } - // Compute the address - const address = await coinPlugin.decodeAddress(coinType, data); - if (address != null) { - return address; - } - assert(false, `invalid coin data`, "UNSUPPORTED_OPERATION", { - operation: `getAddress(${coinType})`, - info: { coinType, data } - }); - } - /** - * Resolves to the EIP-634 text record for %%key%%, or ``null`` - * if unconfigured. - */ - async getText(key) { - const data = await this.#fetch("text(bytes32,string)", [key]); - if (data == null || data === "0x") { - return null; - } - return data; - } - /** - * Rsolves to the content-hash or ``null`` if unconfigured. - */ - async getContentHash() { - // keccak256("contenthash()") - const data = await this.#fetch("contenthash(bytes32)"); - // No contenthash - if (data == null || data === "0x") { - return null; - } - // IPFS (CID: 1, Type: 70=DAG-PB, 72=libp2p-key) - const ipfs = data.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/); - if (ipfs) { - const scheme = (ipfs[1] === "e3010170") ? "ipfs" : "ipns"; - const length = parseInt(ipfs[4], 16); - if (ipfs[5].length === length * 2) { - return `${scheme}:/\/${encodeBase58("0x" + ipfs[2])}`; - } - } - // Swarm (CID: 1, Type: swarm-manifest; hash/length hard-coded to keccak256/32) - const swarm = data.match(/^0xe40101fa011b20([0-9a-f]*)$/); - if (swarm && swarm[1].length === 64) { - return `bzz:/\/${swarm[1]}`; - } - assert(false, `invalid or unsupported content hash data`, "UNSUPPORTED_OPERATION", { - operation: "getContentHash()", - info: { data } - }); - } - /** - * Resolves to the avatar url or ``null`` if the avatar is either - * unconfigured or incorrectly configured (e.g. references an NFT - * not owned by the address). - * - * If diagnosing issues with configurations, the [[_getAvatar]] - * method may be useful. - */ - async getAvatar() { - const avatar = await this._getAvatar(); - return avatar.url; - } - /** - * When resolving an avatar, there are many steps involved, such - * fetching metadata and possibly validating ownership of an - * NFT. - * - * This method can be used to examine each step and the value it - * was working from. - */ - async _getAvatar() { - const linkage = [{ type: "name", value: this.name }]; - try { - // test data for ricmoo.eth - //const avatar = "eip155:1/erc721:0x265385c7f4132228A0d54EB1A9e7460b91c0cC68/29233"; - const avatar = await this.getText("avatar"); - if (avatar == null) { - linkage.push({ type: "!avatar", value: "" }); - return { url: null, linkage }; - } - linkage.push({ type: "avatar", value: avatar }); - for (let i = 0; i < matchers.length; i++) { - const match = avatar.match(matchers[i]); - if (match == null) { - continue; - } - const scheme = match[1].toLowerCase(); - switch (scheme) { - case "https": - case "data": - linkage.push({ type: "url", value: avatar }); - return { linkage, url: avatar }; - case "ipfs": { - const url = getIpfsLink(avatar); - linkage.push({ type: "ipfs", value: avatar }); - linkage.push({ type: "url", value: url }); - return { linkage, url }; - } - case "erc721": - case "erc1155": { - // Depending on the ERC type, use tokenURI(uint256) or url(uint256) - const selector = (scheme === "erc721") ? "tokenURI(uint256)" : "uri(uint256)"; - linkage.push({ type: scheme, value: avatar }); - // The owner of this name - const owner = await this.getAddress(); - if (owner == null) { - linkage.push({ type: "!owner", value: "" }); - return { url: null, linkage }; - } - const comps = (match[2] || "").split("/"); - if (comps.length !== 2) { - linkage.push({ type: `!${scheme}caip`, value: (match[2] || "") }); - return { url: null, linkage }; - } - const tokenId = comps[1]; - const contract = new Contract(comps[0], [ - // ERC-721 - "function tokenURI(uint) view returns (string)", - "function ownerOf(uint) view returns (address)", - // ERC-1155 - "function uri(uint) view returns (string)", - "function balanceOf(address, uint256) view returns (uint)" - ], this.provider); - // Check that this account owns the token - if (scheme === "erc721") { - const tokenOwner = await contract.ownerOf(tokenId); - if (owner !== tokenOwner) { - linkage.push({ type: "!owner", value: tokenOwner }); - return { url: null, linkage }; - } - linkage.push({ type: "owner", value: tokenOwner }); - } - else if (scheme === "erc1155") { - const balance = await contract.balanceOf(owner, tokenId); - if (!balance) { - linkage.push({ type: "!balance", value: "0" }); - return { url: null, linkage }; - } - linkage.push({ type: "balance", value: balance.toString() }); - } - // Call the token contract for the metadata URL - let metadataUrl = await contract[selector](tokenId); - if (metadataUrl == null || metadataUrl === "0x") { - linkage.push({ type: "!metadata-url", value: "" }); - return { url: null, linkage }; - } - linkage.push({ type: "metadata-url-base", value: metadataUrl }); - // ERC-1155 allows a generic {id} in the URL - if (scheme === "erc1155") { - metadataUrl = metadataUrl.replace("{id}", toBeHex(tokenId, 32).substring(2)); - linkage.push({ type: "metadata-url-expanded", value: metadataUrl }); - } - // Transform IPFS metadata links - if (metadataUrl.match(/^ipfs:/i)) { - metadataUrl = getIpfsLink(metadataUrl); - } - linkage.push({ type: "metadata-url", value: metadataUrl }); - // Get the token metadata - let metadata = {}; - const response = await (new FetchRequest(metadataUrl)).send(); - response.assertOk(); - try { - metadata = response.bodyJson; - } - catch (error) { - try { - linkage.push({ type: "!metadata", value: response.bodyText }); - } - catch (error) { - const bytes = response.body; - if (bytes) { - linkage.push({ type: "!metadata", value: hexlify(bytes) }); - } - return { url: null, linkage }; - } - return { url: null, linkage }; - } - if (!metadata) { - linkage.push({ type: "!metadata", value: "" }); - return { url: null, linkage }; - } - linkage.push({ type: "metadata", value: JSON.stringify(metadata) }); - // Pull the image URL out - let imageUrl = metadata.image; - if (typeof (imageUrl) !== "string") { - linkage.push({ type: "!imageUrl", value: "" }); - return { url: null, linkage }; - } - if (imageUrl.match(/^(https:\/\/|data:)/i)) { - // Allow - } - else { - // Transform IPFS link to gateway - const ipfs = imageUrl.match(matcherIpfs); - if (ipfs == null) { - linkage.push({ type: "!imageUrl-ipfs", value: imageUrl }); - return { url: null, linkage }; - } - linkage.push({ type: "imageUrl-ipfs", value: imageUrl }); - imageUrl = getIpfsLink(imageUrl); - } - linkage.push({ type: "url", value: imageUrl }); - return { linkage, url: imageUrl }; - } - } - } - } - catch (error) { } - return { linkage, url: null }; - } - static async getEnsAddress(provider) { - const network = await provider.getNetwork(); - const ensPlugin = network.getPlugin("org.ethers.plugins.network.Ens"); - // No ENS... - assert(ensPlugin, "network does not support ENS", "UNSUPPORTED_OPERATION", { - operation: "getEnsAddress", info: { network } - }); - return ensPlugin.address; - } - static async #getResolver(provider, name) { - const ensAddr = await EnsResolver.getEnsAddress(provider); - try { - const contract = new Contract(ensAddr, [ - "function resolver(bytes32) view returns (address)" - ], provider); - const addr = await contract.resolver(namehash(name), { - enableCcipRead: true - }); - if (addr === ZeroAddress) { - return null; - } - return addr; - } - catch (error) { - // ENS registry cannot throw errors on resolver(bytes32), - // so probably a link error - throw error; - } - return null; - } - /** - * Resolve to the ENS resolver for %%name%% using %%provider%% or - * ``null`` if unconfigured. - */ - static async fromName(provider, name) { - let currentName = name; - while (true) { - if (currentName === "" || currentName === ".") { - return null; - } - // Optimization since the eth node cannot change and does - // not have a wildcard resolver - if (name !== "eth" && currentName === "eth") { - return null; - } - // Check the current node for a resolver - const addr = await EnsResolver.#getResolver(provider, currentName); - // Found a resolver! - if (addr != null) { - const resolver = new EnsResolver(provider, addr, name); - // Legacy resolver found, using EIP-2544 so it isn't safe to use - if (currentName !== name && !(await resolver.supportsWildcard())) { - return null; - } - return resolver; - } - // Get the parent node - currentName = currentName.split(".").slice(1).join("."); - } - } -} -//# sourceMappingURL=ens-resolver.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ens-resolver.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ens-resolver.js.map deleted file mode 100644 index aea50a84..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ens-resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ens-resolver.js","sourceRoot":"","sources":["../../src.ts/providers/ens-resolver.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EACH,OAAO,EAAE,WAAW,EAAE,OAAO,EAC7B,gBAAgB,EAAE,YAAY,EAC9B,MAAM,EAAE,cAAc,EAAE,OAAO,EAC/B,YAAY,EACf,MAAM,mBAAmB,CAAC;AAU3B,qDAAqD;AACrD,iEAAiE;AACjE,SAAS,WAAW,CAA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AED;;;OAGG;IACH,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,QAA0B,EAAE,IAAY;QAE1D,IAAI,WAAW,GAAG,IAAI,CAAC;QACvB,OAAO,IAAI,EAAE;YACT,IAAI,WAAW,KAAK,EAAE,IAAI,WAAW,KAAK,GAAG,EAAE;gBAAE,OAAO,IAAI,CAAC;aAAE;YAE/D,yDAAyD;YACzD,+BAA+B;YAC/B,IAAI,IAAI,KAAK,KAAK,IAAI,WAAW,KAAK,KAAK,EAAE;gBAAE,OAAO,IAAI,CAAC;aAAE;YAE7D,wCAAwC;YACxC,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC,YAAY,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;YAEnE,oBAAoB;YACpB,IAAI,IAAI,IAAI,IAAI,EAAE;gBACd,MAAM,QAAQ,GAAG,IAAI,WAAW,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;gBAEvD,gEAAgE;gBAChE,IAAI,WAAW,KAAK,IAAI,IAAI,CAAC,CAAC,MAAM,QAAQ,CAAC,gBAAgB,EAAE,CAAC,EAAE;oBAAE,OAAO,IAAI,CAAC;iBAAE;gBAElF,OAAO,QAAQ,CAAC;aACnB;YAED,sBAAsB;YACtB,WAAW,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SAC3D;IACL,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/format.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/format.d.ts deleted file mode 100644 index 0967704e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/format.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { BlockParams, LogParams, TransactionReceiptParams, TransactionResponseParams } from "./formatting.js"; -export type FormatFunc = (value: any) => any; -export declare function allowNull(format: FormatFunc, nullValue?: any): FormatFunc; -export declare function arrayOf(format: FormatFunc, allowNull?: boolean): FormatFunc; -export declare function object(format: Record, altNames?: Record>): FormatFunc; -export declare function formatBoolean(value: any): boolean; -export declare function formatData(value: string): string; -export declare function formatHash(value: any): string; -export declare function formatUint256(value: any): string; -export declare function formatLog(value: any): LogParams; -export declare function formatBlock(value: any): BlockParams; -export declare function formatReceiptLog(value: any): LogParams; -export declare function formatTransactionReceipt(value: any): TransactionReceiptParams; -export declare function formatTransactionResponse(value: any): TransactionResponseParams; -//# sourceMappingURL=format.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/format.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/format.d.ts.map deleted file mode 100644 index 00537f2b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/format.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src.ts/providers/format.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACR,WAAW,EAAE,SAAS,EACtB,wBAAwB,EAAE,yBAAyB,EACtD,MAAM,iBAAiB,CAAC;AAKzB,MAAM,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAC;AAE7C,wBAAgB,SAAS,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,GAAG,GAAG,UAAU,CAKzE;AAED,wBAAgB,OAAO,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,UAAU,CAM3E;AAKD,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,UAAU,CAwB/G;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAQjD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGhD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,CAG7C;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,CAKhD;AAgBD,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,SAAS,CAE/C;AA+BD,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,GAAG,WAAW,CAOnD;AAeD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,GAAG,GAAG,SAAS,CAEtD;AA4BD,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,GAAG,GAAG,wBAAwB,CAE7E;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,GAAG,GAAG,yBAAyB,CA0I/E"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/format.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/format.js deleted file mode 100644 index 957a7777..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/format.js +++ /dev/null @@ -1,297 +0,0 @@ -/** - * @_ignore - */ -import { getAddress, getCreateAddress } from "../address/index.js"; -import { Signature } from "../crypto/index.js"; -import { accessListify } from "../transaction/index.js"; -import { getBigInt, getNumber, hexlify, isHexString, zeroPadValue, assert, assertArgument } from "../utils/index.js"; -const BN_0 = BigInt(0); -export function allowNull(format, nullValue) { - return (function (value) { - if (value == null) { - return nullValue; - } - return format(value); - }); -} -export function arrayOf(format, allowNull) { - return ((array) => { - if (allowNull && array == null) { - return null; - } - if (!Array.isArray(array)) { - throw new Error("not an array"); - } - return array.map((i) => format(i)); - }); -} -// Requires an object which matches a fleet of other formatters -// Any FormatFunc may return `undefined` to have the value omitted -// from the result object. Calls preserve `this`. -export function object(format, altNames) { - return ((value) => { - const result = {}; - for (const key in format) { - let srcKey = key; - if (altNames && key in altNames && !(srcKey in value)) { - for (const altKey of altNames[key]) { - if (altKey in value) { - srcKey = altKey; - break; - } - } - } - try { - const nv = format[key](value[srcKey]); - if (nv !== undefined) { - result[key] = nv; - } - } - catch (error) { - const message = (error instanceof Error) ? error.message : "not-an-error"; - assert(false, `invalid value for value.${key} (${message})`, "BAD_DATA", { value }); - } - } - return result; - }); -} -export function formatBoolean(value) { - switch (value) { - case true: - case "true": - return true; - case false: - case "false": - return false; - } - assertArgument(false, `invalid boolean; ${JSON.stringify(value)}`, "value", value); -} -export function formatData(value) { - assertArgument(isHexString(value, true), "invalid data", "value", value); - return value; -} -export function formatHash(value) { - assertArgument(isHexString(value, 32), "invalid hash", "value", value); - return value; -} -export function formatUint256(value) { - if (!isHexString(value)) { - throw new Error("invalid uint256"); - } - return zeroPadValue(value, 32); -} -const _formatLog = object({ - address: getAddress, - blockHash: formatHash, - blockNumber: getNumber, - data: formatData, - index: getNumber, - removed: allowNull(formatBoolean, false), - topics: arrayOf(formatHash), - transactionHash: formatHash, - transactionIndex: getNumber, -}, { - index: ["logIndex"] -}); -export function formatLog(value) { - return _formatLog(value); -} -const _formatBlock = object({ - hash: allowNull(formatHash), - parentHash: formatHash, - parentBeaconBlockRoot: allowNull(formatHash, null), - number: getNumber, - timestamp: getNumber, - nonce: allowNull(formatData), - difficulty: getBigInt, - gasLimit: getBigInt, - gasUsed: getBigInt, - stateRoot: allowNull(formatHash, null), - receiptsRoot: allowNull(formatHash, null), - blobGasUsed: allowNull(getBigInt, null), - excessBlobGas: allowNull(getBigInt, null), - miner: allowNull(getAddress), - prevRandao: allowNull(formatHash, null), - extraData: formatData, - baseFeePerGas: allowNull(getBigInt) -}, { - prevRandao: ["mixHash"] -}); -export function formatBlock(value) { - const result = _formatBlock(value); - result.transactions = value.transactions.map((tx) => { - if (typeof (tx) === "string") { - return tx; - } - return formatTransactionResponse(tx); - }); - return result; -} -const _formatReceiptLog = object({ - transactionIndex: getNumber, - blockNumber: getNumber, - transactionHash: formatHash, - address: getAddress, - topics: arrayOf(formatHash), - data: formatData, - index: getNumber, - blockHash: formatHash, -}, { - index: ["logIndex"] -}); -export function formatReceiptLog(value) { - return _formatReceiptLog(value); -} -const _formatTransactionReceipt = object({ - to: allowNull(getAddress, null), - from: allowNull(getAddress, null), - contractAddress: allowNull(getAddress, null), - // should be allowNull(hash), but broken-EIP-658 support is handled in receipt - index: getNumber, - root: allowNull(hexlify), - gasUsed: getBigInt, - blobGasUsed: allowNull(getBigInt, null), - logsBloom: allowNull(formatData), - blockHash: formatHash, - hash: formatHash, - logs: arrayOf(formatReceiptLog), - blockNumber: getNumber, - //confirmations: allowNull(getNumber, null), - cumulativeGasUsed: getBigInt, - effectiveGasPrice: allowNull(getBigInt), - blobGasPrice: allowNull(getBigInt, null), - status: allowNull(getNumber), - type: allowNull(getNumber, 0) -}, { - effectiveGasPrice: ["gasPrice"], - hash: ["transactionHash"], - index: ["transactionIndex"], -}); -export function formatTransactionReceipt(value) { - return _formatTransactionReceipt(value); -} -export function formatTransactionResponse(value) { - // Some clients (TestRPC) do strange things like return 0x0 for the - // 0 address; correct this to be a real address - if (value.to && getBigInt(value.to) === BN_0) { - value.to = "0x0000000000000000000000000000000000000000"; - } - const result = object({ - hash: formatHash, - // Some nodes do not return this, usually test nodes (like Ganache) - index: allowNull(getNumber, undefined), - type: (value) => { - if (value === "0x" || value == null) { - return 0; - } - return getNumber(value); - }, - accessList: allowNull(accessListify, null), - blobVersionedHashes: allowNull(arrayOf(formatHash, true), null), - authorizationList: allowNull(arrayOf((v) => { - let sig; - if (v.signature) { - sig = v.signature; - } - else { - let yParity = v.yParity; - if (yParity === "0x1b") { - yParity = 0; - } - else if (yParity === "0x1c") { - yParity = 1; - } - sig = Object.assign({}, v, { yParity }); - } - return { - address: getAddress(v.address), - chainId: getBigInt(v.chainId), - nonce: getBigInt(v.nonce), - signature: Signature.from(sig) - }; - }, false), null), - blockHash: allowNull(formatHash, null), - blockNumber: allowNull(getNumber, null), - transactionIndex: allowNull(getNumber, null), - from: getAddress, - // either (gasPrice) or (maxPriorityFeePerGas + maxFeePerGas) must be set - gasPrice: allowNull(getBigInt), - maxPriorityFeePerGas: allowNull(getBigInt), - maxFeePerGas: allowNull(getBigInt), - maxFeePerBlobGas: allowNull(getBigInt, null), - gasLimit: getBigInt, - to: allowNull(getAddress, null), - value: getBigInt, - nonce: getNumber, - data: formatData, - creates: allowNull(getAddress, null), - chainId: allowNull(getBigInt, null) - }, { - data: ["input"], - gasLimit: ["gas"], - index: ["transactionIndex"] - })(value); - // If to and creates are empty, populate the creates from the value - if (result.to == null && result.creates == null) { - result.creates = getCreateAddress(result); - } - // @TODO: Check fee data - // Add an access list to supported transaction types - if ((value.type === 1 || value.type === 2) && value.accessList == null) { - result.accessList = []; - } - // Compute the signature - if (value.signature) { - result.signature = Signature.from(value.signature); - } - else { - result.signature = Signature.from(value); - } - // Some backends omit ChainId on legacy transactions, but we can compute it - if (result.chainId == null) { - const chainId = result.signature.legacyChainId; - if (chainId != null) { - result.chainId = chainId; - } - } - // @TODO: check chainID - /* - if (value.chainId != null) { - let chainId = value.chainId; - - if (isHexString(chainId)) { - chainId = BigNumber.from(chainId).toNumber(); - } - - result.chainId = chainId; - - } else { - let chainId = value.networkId; - - // geth-etc returns chainId - if (chainId == null && result.v == null) { - chainId = value.chainId; - } - - if (isHexString(chainId)) { - chainId = BigNumber.from(chainId).toNumber(); - } - - if (typeof(chainId) !== "number" && result.v != null) { - chainId = (result.v - 35) / 2; - if (chainId < 0) { chainId = 0; } - chainId = parseInt(chainId); - } - - if (typeof(chainId) !== "number") { chainId = 0; } - - result.chainId = chainId; - } - */ - // 0x0000... should actually be null - if (result.blockHash && getBigInt(result.blockHash) === BN_0) { - result.blockHash = null; - } - return result; -} -//# sourceMappingURL=format.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/format.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/format.js.map deleted file mode 100644 index 2a17b832..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/provid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C,UAAU,IAAI,IAAI,EAAE;QACpE,MAAM,CAAC,UAAU,GAAG,EAAG,CAAC;KAC3B;IAED,wBAAwB;IACxB,IAAI,KAAK,CAAC,SAAS,EAAE;QACjB,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;KACtD;SAAM;QACH,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KAC5C;IAED,2EAA2E;IAC3E,IAAI,MAAM,CAAC,OAAO,IAAI,IAAI,EAAE;QACxB,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC;QAC/C,IAAI,OAAO,IAAI,IAAI,EAAE;YAAE,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC;SAAE;KACrD;IAGD,uBAAuB;IACvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgCE;IAEF,oCAAoC;IACpC,IAAI,MAAM,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;QAC1D,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;KAC3B;IAED,OAAO,MAAM,CAAC;AAClB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/formatting.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/formatting.d.ts deleted file mode 100644 index e0b8c8f4..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/formatting.d.ts +++ /dev/null @@ -1,318 +0,0 @@ -/** - * About provider formatting? - * - * @_section: api/providers/formatting:Formatting [provider-formatting] - */ -import type { Signature } from "../crypto/index.js"; -import type { Authorization, AccessList } from "../transaction/index.js"; -/** - * a **BlockParams** encodes the minimal required properties for a - * formatted block. - */ -export interface BlockParams { - /** - * The block hash. - */ - hash?: null | string; - /** - * The block number. - */ - number: number; - /** - * The timestamp for this block, which is the number of seconds - * since epoch that this block was included. - */ - timestamp: number; - /** - * The hash of the previous block in the blockchain. The genesis block - * has the parentHash of the [[ZeroHash]]. - */ - parentHash: string; - /** - * The hash tree root of the parent beacon block for the given - * execution block. See [[link-eip-4788]]. - */ - parentBeaconBlockRoot?: null | string; - /** - * A random sequence provided during the mining process for - * proof-of-work networks. - */ - nonce: string; - /** - * For proof-of-work networks, the difficulty target is used to - * adjust the difficulty in mining to ensure an expected block rate. - */ - difficulty: bigint; - /** - * The maximum amount of gas a block can consume. - */ - gasLimit: bigint; - /** - * The amount of gas a block consumed. - */ - gasUsed: bigint; - /** - * The total amount of BLOb gas consumed by transactions within - * the block. See [[link-eip4844]. - */ - blobGasUsed?: null | bigint; - /** - * The running total of BLOb gas consumed in excess of the target - * prior to the block. See [[link-eip-4844]]. - */ - excessBlobGas?: null | bigint; - /** - * The miner (or author) of a block. - */ - miner: string; - /** - * The latest RANDAO mix of the post beacon state of - * the previous block. - */ - prevRandao?: null | string; - /** - * Additional data the miner choose to include. - */ - extraData: string; - /** - * The protocol-defined base fee per gas in an [[link-eip-1559]] - * block. - */ - baseFeePerGas: null | bigint; - /** - * The root hash for the global state after applying changes - * in this block. - */ - stateRoot?: null | string; - /** - * The hash of the transaction receipts trie. - */ - receiptsRoot?: null | string; - /** - * The list of transactions in the block. - */ - transactions: ReadonlyArray; -} -/** - * a **LogParams** encodes the minimal required properties for a - * formatted log. - */ -export interface LogParams { - /** - * The transaction hash for the transaxction the log occurred in. - */ - transactionHash: string; - /** - * The block hash of the block that included the transaction for this - * log. - */ - blockHash: string; - /** - * The block number of the block that included the transaction for this - * log. - */ - blockNumber: number; - /** - * Whether this log was removed due to the transaction it was included - * in being removed dur to an orphaned block. - */ - removed: boolean; - /** - * The address of the contract that emitted this log. - */ - address: string; - /** - * The data emitted with this log. - */ - data: string; - /** - * The topics emitted with this log. - */ - topics: ReadonlyArray; - /** - * The index of this log. - */ - index: number; - /** - * The transaction index of this log. - */ - transactionIndex: number; -} -/** - * a **TransactionReceiptParams** encodes the minimal required properties - * for a formatted transaction receipt. - */ -export interface TransactionReceiptParams { - /** - * The target of the transaction. If null, the transaction was trying - * to deploy a transaction with the ``data`` as the initi=code. - */ - to: null | string; - /** - * The sender of the transaction. - */ - from: string; - /** - * If the transaction was directly deploying a contract, the [[to]] - * will be null, the ``data`` will be initcode and if successful, this - * will be the address of the contract deployed. - */ - contractAddress: null | string; - /** - * The transaction hash. - */ - hash: string; - /** - * The transaction index. - */ - index: number; - /** - * The block hash of the block that included this transaction. - */ - blockHash: string; - /** - * The block number of the block that included this transaction. - */ - blockNumber: number; - /** - * The bloom filter for the logs emitted during execution of this - * transaction. - */ - logsBloom: string; - /** - * The logs emitted during the execution of this transaction. - */ - logs: ReadonlyArray; - /** - * The amount of gas consumed executing this transaction. - */ - gasUsed: bigint; - /** - * The amount of BLOb gas used. See [[link-eip-4844]]. - */ - blobGasUsed?: null | bigint; - /** - * The total amount of gas consumed during the entire block up to - * and including this transaction. - */ - cumulativeGasUsed: bigint; - /** - * The actual gas price per gas charged for this transaction. - */ - gasPrice?: null | bigint; - /** - * The actual BLOb gas price that was charged. See [[link-eip-4844]]. - */ - blobGasPrice?: null | bigint; - /** - * The actual gas price per gas charged for this transaction. - */ - effectiveGasPrice?: null | bigint; - /** - * The [[link-eip-2718]] envelope type. - */ - type: number; - /** - * The status of the transaction execution. If ``1`` then the - * the transaction returned success, if ``0`` then the transaction - * was reverted. For pre-byzantium blocks, this is usually null, but - * some nodes may have backfilled this data. - */ - status: null | number; - /** - * The root of this transaction in a pre-bazatium block. In - * post-byzantium blocks this is null. - */ - root: null | string; -} -/** - * a **TransactionResponseParams** encodes the minimal required properties - * for a formatted transaction response. - */ -export interface TransactionResponseParams { - /** - * The block number of the block that included this transaction. - */ - blockNumber: null | number; - /** - * The block hash of the block that included this transaction. - */ - blockHash: null | string; - /** - * The transaction hash. - */ - hash: string; - /** - * The transaction index. - */ - index: number; - /** - * The [[link-eip-2718]] transaction type. - */ - type: number; - /** - * The target of the transaction. If ``null``, the ``data`` is initcode - * and this transaction is a deployment transaction. - */ - to: null | string; - /** - * The sender of the transaction. - */ - from: string; - /** - * The nonce of the transaction, used for replay protection. - */ - nonce: number; - /** - * The maximum amount of gas this transaction is authorized to consume. - */ - gasLimit: bigint; - /** - * For legacy transactions, this is the gas price per gas to pay. - */ - gasPrice: bigint; - /** - * For [[link-eip-1559]] transactions, this is the maximum priority - * fee to allow a producer to claim. - */ - maxPriorityFeePerGas: null | bigint; - /** - * For [[link-eip-1559]] transactions, this is the maximum fee that - * will be paid. - */ - maxFeePerGas: null | bigint; - /** - * For [[link-eip-4844]] transactions, this is the maximum fee that - * will be paid per BLOb. - */ - maxFeePerBlobGas?: null | bigint; - /** - * The transaction data. - */ - data: string; - /** - * The transaction value (in wei). - */ - value: bigint; - /** - * The chain ID this transaction is valid on. - */ - chainId: bigint; - /** - * The signature of the transaction. - */ - signature: Signature; - /** - * The transaction access list. - */ - accessList: null | AccessList; - /** - * The [[link-eip-4844]] BLOb versioned hashes. - */ - blobVersionedHashes?: null | Array; - /** - * The [[link-eip-7702]] authorizations (if any). - */ - authorizationList: null | Array; -} -//# sourceMappingURL=formatting.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/formatting.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/formatting.d.ts.map deleted file mode 100644 index a28257d0..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/formatting.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../src.ts/providers/formatting.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAMzE;;;GAGG;AACH,MAAM,WAAW,WAAW;IACxB;;OAEG;IACH,IAAI,CAAC,EAAE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H,SAAS,EAAE,IAAI,GAAG,MAAM,CAAC;IAEzB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,EAAE,EAAE,IAAI,GAAG,MAAM,CAAC;IAElB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,oBAAoB,EAAE,IAAI,GAAG,MAAM,CAAC;IAEpC;;;OAGG;IACH,YAAY,EAAE,IAAI,GAAG,MAAM,CAAC;IAE5B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAEjC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,SAAS,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,UAAU,EAAE,IAAI,GAAG,UAAU,CAAC;IAE9B;;OAEG;IACH,mBAAmB,CAAC,EAAE,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IAE3C;;OAEG;IACH,iBAAiB,EAAE,IAAI,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC;CAClD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/formatting.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/formatting.js deleted file mode 100644 index 5c662d20..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/formatting.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * About provider formatting? - * - * @_section: api/providers/formatting:Formatting [provider-formatting] - */ -; -; -export {}; -//# sourceMappingURL=formatting.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/formatting.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/formatting.js.map deleted file mode 100644 index 571e1c6b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/formatting.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"formatting.js","sourceRoot":"","sources":["../../src.ts/providers/formatting.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAiHF,CAAC;AA0SD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/index.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/index.d.ts deleted file mode 100644 index 172c487a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/index.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * A **Provider** provides a connection to the blockchain, whch can be - * used to query its current state, simulate execution and send transactions - * to update the state. - * - * It is one of the most fundamental components of interacting with a - * blockchain application, and there are many ways to connect, such as over - * HTTP, WebSockets or injected providers such as [MetaMask](link-metamask). - * - * @_section: api/providers:Providers [about-providers] - */ -export { AbstractProvider, UnmanagedSubscriber } from "./abstract-provider.js"; -export { AbstractSigner, VoidSigner, } from "./abstract-signer.js"; -export { showThrottleMessage } from "./community.js"; -export { getDefaultProvider } from "./default-provider.js"; -export { EnsResolver, MulticoinProviderPlugin } from "./ens-resolver.js"; -export { Network } from "./network.js"; -export { NonceManager } from "./signer-noncemanager.js"; -export { NetworkPlugin, GasCostPlugin, EnsPlugin, FeeDataNetworkPlugin, FetchUrlFeeDataNetworkPlugin, } from "./plugins-network.js"; -export { Block, FeeData, Log, TransactionReceipt, TransactionResponse, copyRequest, } from "./provider.js"; -export { FallbackProvider } from "./provider-fallback.js"; -export { JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner } from "./provider-jsonrpc.js"; -export { BrowserProvider } from "./provider-browser.js"; -export { AlchemyProvider } from "./provider-alchemy.js"; -export { BlockscoutProvider } from "./provider-blockscout.js"; -export { AnkrProvider } from "./provider-ankr.js"; -export { CloudflareProvider } from "./provider-cloudflare.js"; -export { ChainstackProvider } from "./provider-chainstack.js"; -export { EtherscanProvider, EtherscanPlugin } from "./provider-etherscan.js"; -export { InfuraProvider, InfuraWebSocketProvider } from "./provider-infura.js"; -export { PocketProvider } from "./provider-pocket.js"; -export { QuickNodeProvider } from "./provider-quicknode.js"; -import { IpcSocketProvider } from "./provider-ipcsocket.js"; -export { IpcSocketProvider }; -export { SocketProvider } from "./provider-socket.js"; -export { WebSocketProvider } from "./provider-websocket.js"; -export { SocketSubscriber, SocketBlockSubscriber, SocketPendingSubscriber, SocketEventSubscriber } from "./provider-socket.js"; -export type { AbstractProviderOptions, Subscription, Subscriber, AbstractProviderPlugin, PerformActionFilter, PerformActionTransaction, PerformActionRequest, } from "./abstract-provider.js"; -export type { ContractRunner } from "./contracts.js"; -export type { BlockParams, LogParams, TransactionReceiptParams, TransactionResponseParams, } from "./formatting.js"; -export type { CommunityResourcable } from "./community.js"; -export type { Networkish } from "./network.js"; -export type { GasCostParameters } from "./plugins-network.js"; -export type { BlockTag, TransactionRequest, PreparedTransactionRequest, EventFilter, Filter, FilterByBlockHash, OrphanFilter, ProviderEvent, TopicFilter, Provider, MinedBlock, MinedTransactionResponse } from "./provider.js"; -export type { BrowserDiscoverOptions, BrowserProviderOptions, DebugEventBrowserProvider, Eip1193Provider, Eip6963ProviderInfo } from "./provider-browser.js"; -export type { FallbackProviderOptions } from "./provider-fallback.js"; -export type { JsonRpcPayload, JsonRpcResult, JsonRpcError, JsonRpcApiProviderOptions, JsonRpcTransactionRequest, } from "./provider-jsonrpc.js"; -export type { WebSocketCreator, WebSocketLike } from "./provider-websocket.js"; -export type { Signer } from "./signer.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/index.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/index.d.ts.map deleted file mode 100644 index 2d26abd9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/providers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EACH,gBAAgB,EAAE,mBAAmB,EACxC,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACH,cAAc,EACd,UAAU,GACb,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACH,mBAAmB,EACtB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EACH,WAAW,EACX,uBAAuB,EAC1B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EACH,aAAa,EACb,aAAa,EACb,SAAS,EACT,oBAAoB,EACpB,4BAA4B,GAC/B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACH,KAAK,EACL,OAAO,EACP,GAAG,EACH,kBAAkB,EAClB,mBAAmB,EAEnB,WAAW,GAEd,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAE1F,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9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EAAE,sBAAsB,EAAE,yBAAyB,EACzE,eAAe,EAAE,mBAAmB,EACvC,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEtE,YAAY,EACR,cAAc,EAAE,aAAa,EAAE,YAAY,EAC3C,yBAAyB,EACzB,yBAAyB,GAC5B,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACR,gBAAgB,EAAE,aAAa,EAClC,MAAM,yBAAyB,CAAC;AAEjC,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/index.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/index.js deleted file mode 100644 index e118c332..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * A **Provider** provides a connection to the blockchain, whch can be - * used to query its current state, simulate execution and send transactions - * to update the state. - * - * It is one of the most fundamental components of interacting with a - * blockchain application, and there are many ways to connect, such as over - * HTTP, WebSockets or injected providers such as [MetaMask](link-metamask). - * - * @_section: api/providers:Providers [about-providers] - */ -export { AbstractProvider, UnmanagedSubscriber } from "./abstract-provider.js"; -export { AbstractSigner, VoidSigner, } from "./abstract-signer.js"; -export { showThrottleMessage } from "./community.js"; -export { getDefaultProvider } from "./default-provider.js"; -export { EnsResolver, MulticoinProviderPlugin } from "./ens-resolver.js"; -export { Network } from "./network.js"; -export { NonceManager } from "./signer-noncemanager.js"; -export { NetworkPlugin, GasCostPlugin, EnsPlugin, FeeDataNetworkPlugin, FetchUrlFeeDataNetworkPlugin, } from "./plugins-network.js"; -export { Block, FeeData, Log, TransactionReceipt, TransactionResponse, copyRequest, -//resolveTransactionRequest, - } from "./provider.js"; -export { FallbackProvider } from "./provider-fallback.js"; -export { JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner } from "./provider-jsonrpc.js"; -export { BrowserProvider } from "./provider-browser.js"; -export { AlchemyProvider } from "./provider-alchemy.js"; -export { BlockscoutProvider } from "./provider-blockscout.js"; -export { AnkrProvider } from "./provider-ankr.js"; -export { CloudflareProvider } from "./provider-cloudflare.js"; -export { ChainstackProvider } from "./provider-chainstack.js"; -export { EtherscanProvider, EtherscanPlugin } from "./provider-etherscan.js"; -export { InfuraProvider, InfuraWebSocketProvider } from "./provider-infura.js"; -export { PocketProvider } from "./provider-pocket.js"; -export { QuickNodeProvider } from "./provider-quicknode.js"; -import { IpcSocketProvider } from "./provider-ipcsocket.js"; /*-browser*/ -export { IpcSocketProvider }; -export { SocketProvider } from "./provider-socket.js"; -export { WebSocketProvider } from "./provider-websocket.js"; -export { SocketSubscriber, SocketBlockSubscriber, SocketPendingSubscriber, SocketEventSubscriber } from "./provider-socket.js"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/index.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/index.js.map deleted file mode 100644 index 36b5c463..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/providers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EACH,gBAAgB,EAAE,mBAAmB,EACxC,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACH,cAAc,EACd,UAAU,GACb,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACH,mBAAmB,EACtB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EACH,WAAW,EACX,uBAAuB,EAC1B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EACH,aAAa,E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/lib.esm/providers/network.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/network.d.ts deleted file mode 100644 index 2355df44..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/network.d.ts +++ /dev/null @@ -1,99 +0,0 @@ -/** - * A **Network** encapsulates the various properties required to - * interact with a specific chain. - * - * @_subsection: api/providers:Networks [networks] - */ -import type { BigNumberish } from "../utils/index.js"; -import type { TransactionLike } from "../transaction/index.js"; -import type { NetworkPlugin } from "./plugins-network.js"; -/** - * A Networkish can be used to allude to a Network, by specifing: - * - a [[Network]] object - * - a well-known (or registered) network name - * - a well-known (or registered) chain ID - * - an object with sufficient details to describe a network - */ -export type Networkish = Network | number | bigint | string | { - name?: string; - chainId?: number; - ensAddress?: string; - ensNetwork?: number; -}; -/** - * A **Network** provides access to a chain's properties and allows - * for plug-ins to extend functionality. - */ -export declare class Network { - #private; - /** - * Creates a new **Network** for %%name%% and %%chainId%%. - */ - constructor(name: string, chainId: BigNumberish); - /** - * Returns a JSON-compatible representation of a Network. - */ - toJSON(): any; - /** - * The network common name. - * - * This is the canonical name, as networks migh have multiple - * names. - */ - get name(): string; - set name(value: string); - /** - * The network chain ID. - */ - get chainId(): bigint; - set chainId(value: BigNumberish); - /** - * Returns true if %%other%% matches this network. Any chain ID - * must match, and if no chain ID is present, the name must match. - * - * This method does not currently check for additional properties, - * such as ENS address or plug-in compatibility. - */ - matches(other: Networkish): boolean; - /** - * Returns the list of plugins currently attached to this Network. - */ - get plugins(): Array; - /** - * Attach a new %%plugin%% to this Network. The network name - * must be unique, excluding any fragment. - */ - attachPlugin(plugin: NetworkPlugin): this; - /** - * Return the plugin, if any, matching %%name%% exactly. Plugins - * with fragments will not be returned unless %%name%% includes - * a fragment. - */ - getPlugin(name: string): null | T; - /** - * Gets a list of all plugins that match %%name%%, with otr without - * a fragment. - */ - getPlugins(basename: string): Array; - /** - * Create a copy of this Network. - */ - clone(): Network; - /** - * Compute the intrinsic gas required for a transaction. - * - * A GasCostPlugin can be attached to override the default - * values. - */ - computeIntrinsicGas(tx: TransactionLike): number; - /** - * Returns a new Network for the %%network%% name or chainId. - */ - static from(network?: Networkish): Network; - /** - * Register %%nameOrChainId%% with a function which returns - * an instance of a Network representing that chain. - */ - static register(nameOrChainId: string | number | bigint, networkFunc: () => Network): void; -} -//# sourceMappingURL=network.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/network.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/network.d.ts.map deleted file mode 100644 index b849aebb..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/network.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../src.ts/providers/network.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAG1D;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG;IAC1D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;CACtB,CAAC;AA2BF;;;GAGG;AACH,qBAAa,OAAO;;IAMhB;;OAEG;gBACS,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY;IAM/C;;OAEG;IACH,MAAM,IAAI,GAAG;IAIb;;;;;OAKG;IACH,IAAI,IAAI,IAAI,MAAM,CAAuB;IACzC,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,EAA0B;IAEhD;;OAEG;IACH,IAAI,OAAO,IAAI,MAAM,CAA0B;IAC/C,IAAI,OAAO,CAAC,KAAK,EAAE,YAAY,EAAkD;IAEjF;;;;;;OAMG;IACH,OAAO,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO;IAiCnC;;OAEG;IACH,IAAI,OAAO,IAAI,KAAK,CAAC,aAAa,CAAC,CAElC;IAED;;;OAGG;IACH,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;IAQzC;;;;OAIG;IACH,SAAS,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,CAAC;IAI1E;;;OAGG;IACH,UAAU,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,EAAE,QAAQ,EAAE,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC;IAI/E;;OAEG;IACH,KAAK,IAAI,OAAO;IAQhB;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,EAAE,eAAe,GAAG,MAAM;IAyBhD;;OAEG;IACH,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO;IA+C1C;;;OAGG;IACH,MAAM,CAAC,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,WAAW,EAAE,MAAM,OAAO,GAAG,IAAI;CAQ7F"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/network.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/network.js deleted file mode 100644 index 83832a17..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/network.js +++ /dev/null @@ -1,365 +0,0 @@ -/** - * A **Network** encapsulates the various properties required to - * interact with a specific chain. - * - * @_subsection: api/providers:Networks [networks] - */ -import { accessListify } from "../transaction/index.js"; -import { getBigInt, assert, assertArgument } from "../utils/index.js"; -import { EnsPlugin, FetchUrlFeeDataNetworkPlugin, GasCostPlugin } from "./plugins-network.js"; -/* * * * -// Networks which operation against an L2 can use this plugin to -// specify how to access L1, for the purpose of resolving ENS, -// for example. -export class LayerOneConnectionPlugin extends NetworkPlugin { - readonly provider!: Provider; -// @TODO: Rename to ChainAccess and allow for connecting to any chain - constructor(provider: Provider) { - super("org.ethers.plugins.layer-one-connection"); - defineProperties(this, { provider }); - } - - clone(): LayerOneConnectionPlugin { - return new LayerOneConnectionPlugin(this.provider); - } -} -*/ -const Networks = new Map(); -/** - * A **Network** provides access to a chain's properties and allows - * for plug-ins to extend functionality. - */ -export class Network { - #name; - #chainId; - #plugins; - /** - * Creates a new **Network** for %%name%% and %%chainId%%. - */ - constructor(name, chainId) { - this.#name = name; - this.#chainId = getBigInt(chainId); - this.#plugins = new Map(); - } - /** - * Returns a JSON-compatible representation of a Network. - */ - toJSON() { - return { name: this.name, chainId: String(this.chainId) }; - } - /** - * The network common name. - * - * This is the canonical name, as networks migh have multiple - * names. - */ - get name() { return this.#name; } - set name(value) { this.#name = value; } - /** - * The network chain ID. - */ - get chainId() { return this.#chainId; } - set chainId(value) { this.#chainId = getBigInt(value, "chainId"); } - /** - * Returns true if %%other%% matches this network. Any chain ID - * must match, and if no chain ID is present, the name must match. - * - * This method does not currently check for additional properties, - * such as ENS address or plug-in compatibility. - */ - matches(other) { - if (other == null) { - return false; - } - if (typeof (other) === "string") { - try { - return (this.chainId === getBigInt(other)); - } - catch (error) { } - return (this.name === other); - } - if (typeof (other) === "number" || typeof (other) === "bigint") { - try { - return (this.chainId === getBigInt(other)); - } - catch (error) { } - return false; - } - if (typeof (other) === "object") { - if (other.chainId != null) { - try { - return (this.chainId === getBigInt(other.chainId)); - } - catch (error) { } - return false; - } - if (other.name != null) { - return (this.name === other.name); - } - return false; - } - return false; - } - /** - * Returns the list of plugins currently attached to this Network. - */ - get plugins() { - return Array.from(this.#plugins.values()); - } - /** - * Attach a new %%plugin%% to this Network. The network name - * must be unique, excluding any fragment. - */ - attachPlugin(plugin) { - if (this.#plugins.get(plugin.name)) { - throw new Error(`cannot replace existing plugin: ${plugin.name} `); - } - this.#plugins.set(plugin.name, plugin.clone()); - return this; - } - /** - * Return the plugin, if any, matching %%name%% exactly. Plugins - * with fragments will not be returned unless %%name%% includes - * a fragment. - */ - getPlugin(name) { - return (this.#plugins.get(name)) || null; - } - /** - * Gets a list of all plugins that match %%name%%, with otr without - * a fragment. - */ - getPlugins(basename) { - return (this.plugins.filter((p) => (p.name.split("#")[0] === basename))); - } - /** - * Create a copy of this Network. - */ - clone() { - const clone = new Network(this.name, this.chainId); - this.plugins.forEach((plugin) => { - clone.attachPlugin(plugin.clone()); - }); - return clone; - } - /** - * Compute the intrinsic gas required for a transaction. - * - * A GasCostPlugin can be attached to override the default - * values. - */ - computeIntrinsicGas(tx) { - const costs = this.getPlugin("org.ethers.plugins.network.GasCost") || (new GasCostPlugin()); - let gas = costs.txBase; - if (tx.to == null) { - gas += costs.txCreate; - } - if (tx.data) { - for (let i = 2; i < tx.data.length; i += 2) { - if (tx.data.substring(i, i + 2) === "00") { - gas += costs.txDataZero; - } - else { - gas += costs.txDataNonzero; - } - } - } - if (tx.accessList) { - const accessList = accessListify(tx.accessList); - for (const addr in accessList) { - gas += costs.txAccessListAddress + costs.txAccessListStorageKey * accessList[addr].storageKeys.length; - } - } - return gas; - } - /** - * Returns a new Network for the %%network%% name or chainId. - */ - static from(network) { - injectCommonNetworks(); - // Default network - if (network == null) { - return Network.from("mainnet"); - } - // Canonical name or chain ID - if (typeof (network) === "number") { - network = BigInt(network); - } - if (typeof (network) === "string" || typeof (network) === "bigint") { - const networkFunc = Networks.get(network); - if (networkFunc) { - return networkFunc(); - } - if (typeof (network) === "bigint") { - return new Network("unknown", network); - } - assertArgument(false, "unknown network", "network", network); - } - // Clonable with network-like abilities - if (typeof (network.clone) === "function") { - const clone = network.clone(); - //if (typeof(network.name) !== "string" || typeof(network.chainId) !== "number") { - //} - return clone; - } - // Networkish - if (typeof (network) === "object") { - assertArgument(typeof (network.name) === "string" && typeof (network.chainId) === "number", "invalid network object name or chainId", "network", network); - const custom = new Network((network.name), (network.chainId)); - if (network.ensAddress || network.ensNetwork != null) { - custom.attachPlugin(new EnsPlugin(network.ensAddress, network.ensNetwork)); - } - //if ((network).layerOneConnection) { - // custom.attachPlugin(new LayerOneConnectionPlugin((network).layerOneConnection)); - //} - return custom; - } - assertArgument(false, "invalid network", "network", network); - } - /** - * Register %%nameOrChainId%% with a function which returns - * an instance of a Network representing that chain. - */ - static register(nameOrChainId, networkFunc) { - if (typeof (nameOrChainId) === "number") { - nameOrChainId = BigInt(nameOrChainId); - } - const existing = Networks.get(nameOrChainId); - if (existing) { - assertArgument(false, `conflicting network for ${JSON.stringify(existing.name)}`, "nameOrChainId", nameOrChainId); - } - Networks.set(nameOrChainId, networkFunc); - } -} -// We don't want to bring in formatUnits because it is backed by -// FixedNumber and we want to keep Networks tiny. The values -// included by the Gas Stations are also IEEE 754 with lots of -// rounding issues and exceed the strict checks formatUnits has. -function parseUnits(_value, decimals) { - const value = String(_value); - if (!value.match(/^[0-9.]+$/)) { - throw new Error(`invalid gwei value: ${_value}`); - } - // Break into [ whole, fraction ] - const comps = value.split("."); - if (comps.length === 1) { - comps.push(""); - } - // More than 1 decimal point or too many fractional positions - if (comps.length !== 2) { - throw new Error(`invalid gwei value: ${_value}`); - } - // Pad the fraction to 9 decimalplaces - while (comps[1].length < decimals) { - comps[1] += "0"; - } - // Too many decimals and some non-zero ending, take the ceiling - if (comps[1].length > 9) { - let frac = BigInt(comps[1].substring(0, 9)); - if (!comps[1].substring(9).match(/^0+$/)) { - frac++; - } - comps[1] = frac.toString(); - } - return BigInt(comps[0] + comps[1]); -} -// Used by Polygon to use a gas station for fee data -function getGasStationPlugin(url) { - return new FetchUrlFeeDataNetworkPlugin(url, async (fetchFeeData, provider, request) => { - // Prevent Cloudflare from blocking our request in node.js - request.setHeader("User-Agent", "ethers"); - let response; - try { - const [_response, _feeData] = await Promise.all([ - request.send(), fetchFeeData() - ]); - response = _response; - const payload = response.bodyJson.standard; - const feeData = { - gasPrice: _feeData.gasPrice, - maxFeePerGas: parseUnits(payload.maxFee, 9), - maxPriorityFeePerGas: parseUnits(payload.maxPriorityFee, 9), - }; - return feeData; - } - catch (error) { - assert(false, `error encountered with polygon gas station (${JSON.stringify(request.url)})`, "SERVER_ERROR", { request, response, error }); - } - }); -} -// See: https://chainlist.org -let injected = false; -function injectCommonNetworks() { - if (injected) { - return; - } - injected = true; - /// Register popular Ethereum networks - function registerEth(name, chainId, options) { - const func = function () { - const network = new Network(name, chainId); - // We use 0 to disable ENS - if (options.ensNetwork != null) { - network.attachPlugin(new EnsPlugin(null, options.ensNetwork)); - } - network.attachPlugin(new GasCostPlugin()); - (options.plugins || []).forEach((plugin) => { - network.attachPlugin(plugin); - }); - return network; - }; - // Register the network by name and chain ID - Network.register(name, func); - Network.register(chainId, func); - if (options.altNames) { - options.altNames.forEach((name) => { - Network.register(name, func); - }); - } - } - registerEth("mainnet", 1, { ensNetwork: 1, altNames: ["homestead"] }); - registerEth("ropsten", 3, { ensNetwork: 3 }); - registerEth("rinkeby", 4, { ensNetwork: 4 }); - registerEth("goerli", 5, { ensNetwork: 5 }); - registerEth("kovan", 42, { ensNetwork: 42 }); - registerEth("sepolia", 11155111, { ensNetwork: 11155111 }); - registerEth("holesky", 17000, { ensNetwork: 17000 }); - registerEth("classic", 61, {}); - registerEth("classicKotti", 6, {}); - registerEth("arbitrum", 42161, { - ensNetwork: 1, - }); - registerEth("arbitrum-goerli", 421613, {}); - registerEth("arbitrum-sepolia", 421614, {}); - registerEth("base", 8453, { ensNetwork: 1 }); - registerEth("base-goerli", 84531, {}); - registerEth("base-sepolia", 84532, {}); - registerEth("bnb", 56, { ensNetwork: 1 }); - registerEth("bnbt", 97, {}); - registerEth("filecoin", 314, {}); - registerEth("filecoin-calibration", 314159, {}); - registerEth("linea", 59144, { ensNetwork: 1 }); - registerEth("linea-goerli", 59140, {}); - registerEth("linea-sepolia", 59141, {}); - registerEth("matic", 137, { - ensNetwork: 1, - plugins: [ - getGasStationPlugin("https:/\/gasstation.polygon.technology/v2") - ] - }); - registerEth("matic-amoy", 80002, {}); - registerEth("matic-mumbai", 80001, { - altNames: ["maticMumbai", "maticmum"], - plugins: [ - getGasStationPlugin("https:/\/gasstation-testnet.polygon.technology/v2") - ] - }); - registerEth("optimism", 10, { - ensNetwork: 1, - plugins: [] - }); - registerEth("optimism-goerli", 420, {}); - registerEth("optimism-sepolia", 11155420, {}); - registerEth("xdai", 100, { ensNetwork: 1 }); -} -//# sourceMappingURL=network.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/network.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/network.js.map deleted file mode 100644 index df71d952..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/network.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"network.js","sourceRoot":"","sources":["../../src.ts/providers/network.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEtE,OAAO,EACH,SAAS,EAAE,4BAA4B,EAAE,aAAa,EACzD,MAAM,sBAAsB,CAAC;AA0B9B;;;;;;;;;;;;;;;;EAgBE;AAGF,MAAM,QAAQ,GAAwC,IAAI,GAAG,EAAE,CAAC;AAGhE;;;GAGG;AACH,MAAM,OAAO,OAAO;IAChB,KAAK,CAAS;IACd,QAAQ,CAAS;IAEjB,QAAQ,CAA6B;IAErC;;OAEG;IACH,YAAY,IAAY,EAAE,OAAqB;QAC3C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;QACnC,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,EAAE,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,MAAM;QACF,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,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AAE;QACvC,OAAO,EAAE;YACL,mBAAmB,CAAC,mDAAmD,CAAC;SAC3E;KACJ,CAAC,CAAC;IAEH,WAAW,CAAC,UAAU,EAAE,EAAE,EAAE;QACxB,UAAU,EAAE,CAAC;QACb,OAAO,EAAE,EAAG;KACf,CAAC,CAAC;IACH,WAAW,CAAC,iBAAiB,EAAE,GAAG,EAAE,EAAG,CAAC,CAAC;IACzC,WAAW,CAAC,kBAAkB,EAAE,QAAQ,EAAE,EAAG,CAAC,CAAC;IAE/C,WAAW,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC;AAChD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/pagination.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/pagination.d.ts deleted file mode 100644 index a772a85c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/pagination.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface PaginationResult extends Array { - next(): Promise>; - totalResults: null | number; - done: boolean; -} -//# sourceMappingURL=pagination.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/pagination.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/pagination.d.ts.map deleted file mode 100644 index 083dedb3..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/pagination.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src.ts/providers/pagination.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB,CAAC,CAAC,CAAE,SAAQ,KAAK,CAAC,CAAC,CAAC;IACjD,IAAI,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;IAGrC,YAAY,EAAE,IAAI,GAAG,MAAM,CAAC;IAE5B,IAAI,EAAE,OAAO,CAAC;CACjB"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/pagination.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/pagination.js deleted file mode 100644 index dad94f2f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/pagination.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=pagination.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/pagination.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/pagination.js.map deleted file mode 100644 index d08e925c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/pagination.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../src.ts/providers/pagination.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/plugin-fallback.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/plugin-fallback.d.ts deleted file mode 100644 index 6c525ec2..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/plugin-fallback.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { AbstractProviderPlugin } from "./abstract-provider.js"; -import type { AbstractProvider, PerformActionRequest } from "./abstract-provider.js"; -export declare const PluginIdFallbackProvider = "org.ethers.plugins.provider.QualifiedPlugin"; -export declare class CheckQualifiedPlugin implements AbstractProviderPlugin { - name: string; - constructor(); - connect(provider: AbstractProvider): CheckQualifiedPlugin; - isQualified(action: PerformActionRequest, result: any): boolean; -} -export declare class PossiblyPrunedTransactionPlugin extends CheckQualifiedPlugin { - isQualified(action: PerformActionRequest, result: any): boolean; -} -//# sourceMappingURL=plugin-fallback.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/plugin-fallback.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/plugin-fallback.d.ts.map deleted file mode 100644 index 95867512..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/plugin-fallback.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"plugin-fallback.d.ts","sourceRoot":"","sources":["../../src.ts/providers/plugin-fallback.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAGhE,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAGrF,eAAO,MAAM,wBAAwB,gDAAgD,CAAC;AAEtF,qBAAa,oBAAqB,YAAW,sBAAsB;IACvD,IAAI,EAAE,MAAM,CAAC;;IAMrB,OAAO,CAAC,QAAQ,EAAE,gBAAgB,GAAG,oBAAoB;IAMzD,WAAW,CAAC,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO;CAGlE;AAED,qBAAa,+BAAgC,SAAQ,oBAAoB;IACrE,WAAW,CAAC,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO;CAMlE"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/plugin-fallback.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/plugin-fallback.js deleted file mode 100644 index 00f98628..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/plugin-fallback.js +++ /dev/null @@ -1,26 +0,0 @@ -import { defineProperties } from "../utils/index.js"; -export const PluginIdFallbackProvider = "org.ethers.plugins.provider.QualifiedPlugin"; -export class CheckQualifiedPlugin { - constructor() { - defineProperties(this, { name: PluginIdFallbackProvider }); - } - connect(provider) { - return this; - } - // Retruns true if this value should be considered qualified for - // inclusion in the quorum. - isQualified(action, result) { - return true; - } -} -export class PossiblyPrunedTransactionPlugin extends CheckQualifiedPlugin { - isQualified(action, result) { - if (action.method === "getTransaction" || action.method === "getTransactionReceipt") { - if (result == null) { - return false; - } - } - return super.isQualified(action, result); - } -} -//# sourceMappingURL=plugin-fallback.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/plugin-fallback.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/plugin-fallback.js.map deleted file mode 100644 index c3d606f6..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/plugin-fallback.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"plugin-fallback.js","sourceRoot":"","sources":["../../src.ts/providers/plugin-fallback.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAKrD,MAAM,CAAC,MAAM,wBAAwB,GAAG,6CAA6C,CAAC;AAEtF,MAAM,OAAO,oBAAoB;IAG7B;QACI,gBAAgB,CAAuB,IAAI,EAAE,EAAE,IAAI,EAAE,wBAAwB,EAAE,CAAC,CAAC;IACrF,CAAC;IAED,OAAO,CAAC,QAA0B;QAC9B,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,gEAAgE;IAChE,2BAA2B;IAC3B,WAAW,CAAC,MAA4B,EAAE,MAAW;QACjD,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,MAAM,OAAO,+BAAgC,SAAQ,oBAAoB;IACrE,WAAW,CAAC,MAA4B,EAAE,MAAW;QACjD,IAAI,MAAM,CAAC,MAAM,KAAK,gBAAgB,IAAI,MAAM,CAAC,MAAM,KAAK,uBAAuB,EAAE;YACjF,IAAI,MAAM,IAAI,IAAI,EAAE;gBAAE,OAAO,KAAK,CAAC;aAAE;SACxC;QACD,OAAO,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/plugins-network.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/plugins-network.d.ts deleted file mode 100644 index 73857820..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/plugins-network.d.ts +++ /dev/null @@ -1,170 +0,0 @@ -import type { FeeData, Provider } from "./provider.js"; -import type { FetchRequest } from "../utils/fetch.js"; -/** - * A **NetworkPlugin** provides additional functionality on a [[Network]]. - */ -export declare class NetworkPlugin { - /** - * The name of the plugin. - * - * It is recommended to use reverse-domain-notation, which permits - * unique names with a known authority as well as hierarchal entries. - */ - readonly name: string; - /** - * Creates a new **NetworkPlugin**. - */ - constructor(name: string); - /** - * Creates a copy of this plugin. - */ - clone(): NetworkPlugin; -} -/** - * The gas cost parameters for a [[GasCostPlugin]]. - */ -export type GasCostParameters = { - /** - * The transactions base fee. - */ - txBase?: number; - /** - * The fee for creating a new account. - */ - txCreate?: number; - /** - * The fee per zero-byte in the data. - */ - txDataZero?: number; - /** - * The fee per non-zero-byte in the data. - */ - txDataNonzero?: number; - /** - * The fee per storage key in the [[link-eip-2930]] access list. - */ - txAccessListStorageKey?: number; - /** - * The fee per address in the [[link-eip-2930]] access list. - */ - txAccessListAddress?: number; -}; -/** - * A **GasCostPlugin** allows a network to provide alternative values when - * computing the intrinsic gas required for a transaction. - */ -export declare class GasCostPlugin extends NetworkPlugin implements GasCostParameters { - /** - * The block number to treat these values as valid from. - * - * This allows a hardfork to have updated values included as well as - * mulutiple hardforks to be supported. - */ - readonly effectiveBlock: number; - /** - * The transactions base fee. - */ - readonly txBase: number; - /** - * The fee for creating a new account. - */ - readonly txCreate: number; - /** - * The fee per zero-byte in the data. - */ - readonly txDataZero: number; - /** - * The fee per non-zero-byte in the data. - */ - readonly txDataNonzero: number; - /** - * The fee per storage key in the [[link-eip-2930]] access list. - */ - readonly txAccessListStorageKey: number; - /** - * The fee per address in the [[link-eip-2930]] access list. - */ - readonly txAccessListAddress: number; - /** - * Creates a new GasCostPlugin from %%effectiveBlock%% until the - * latest block or another GasCostPlugin supercedes that block number, - * with the associated %%costs%%. - */ - constructor(effectiveBlock?: number, costs?: GasCostParameters); - clone(): GasCostPlugin; -} -/** - * An **EnsPlugin** allows a [[Network]] to specify the ENS Registry - * Contract address and the target network to use when using that - * contract. - * - * Various testnets have their own instance of the contract to use, but - * in general, the mainnet instance supports multi-chain addresses and - * should be used. - */ -export declare class EnsPlugin extends NetworkPlugin { - /** - * The ENS Registrty Contract address. - */ - readonly address: string; - /** - * The chain ID that the ENS contract lives on. - */ - readonly targetNetwork: number; - /** - * Creates a new **EnsPlugin** connected to %%address%% on the - * %%targetNetwork%%. The default ENS address and mainnet is used - * if unspecified. - */ - constructor(address?: null | string, targetNetwork?: null | number); - clone(): EnsPlugin; -} -/** - * A **FeeDataNetworkPlugin** allows a network to provide and alternate - * means to specify its fee data. - * - * For example, a network which does not support [[link-eip-1559]] may - * choose to use a Gas Station site to approximate the gas price. - */ -export declare class FeeDataNetworkPlugin extends NetworkPlugin { - #private; - /** - * The fee data function provided to the constructor. - */ - get feeDataFunc(): (provider: Provider) => Promise; - /** - * Creates a new **FeeDataNetworkPlugin**. - */ - constructor(feeDataFunc: (provider: Provider) => Promise); - /** - * Resolves to the fee data. - */ - getFeeData(provider: Provider): Promise; - clone(): FeeDataNetworkPlugin; -} -export declare class FetchUrlFeeDataNetworkPlugin extends NetworkPlugin { - #private; - /** - * The URL to initialize the FetchRequest with in %%processFunc%%. - */ - get url(): string; - /** - * The callback to use when computing the FeeData. - */ - get processFunc(): (f: () => Promise, p: Provider, r: FetchRequest) => Promise<{ - gasPrice?: null | bigint; - maxFeePerGas?: null | bigint; - maxPriorityFeePerGas?: null | bigint; - }>; - /** - * Creates a new **FetchUrlFeeDataNetworkPlugin** which will - * be used when computing the fee data for the network. - */ - constructor(url: string, processFunc: (f: () => Promise, p: Provider, r: FetchRequest) => Promise<{ - gasPrice?: null | bigint; - maxFeePerGas?: null | bigint; - maxPriorityFeePerGas?: null | bigint; - }>); - clone(): FetchUrlFeeDataNetworkPlugin; -} -//# sourceMappingURL=plugins-network.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/plugins-network.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/plugins-network.d.ts.map deleted file mode 100644 index 77938545..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/plugins-network.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"plugins-network.d.ts","sourceRoot":"","sources":["../../src.ts/providers/plugins-network.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAKtD;;GAEG;AACH,qBAAa,aAAa;IACtB;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;IAEvB;;OAEG;gBACS,IAAI,EAAE,MAAM;IAIxB;;OAEG;IACH,KAAK,IAAI,aAAa;CAOzB;AAGD;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC5B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAEhC;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAChC,CAAC;AAEF;;;GAGG;AACH,qBAAa,aAAc,SAAQ,aAAc,YAAW,iBAAiB;IACzE;;;;;OAKG;IACH,QAAQ,CAAC,cAAc,EAAG,MAAM,CAAC;IAEjC;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAEzB;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAG,MAAM,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAG,MAAM,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAG,MAAM,CAAC;IAEhC;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AAE,IAAI,GAAG,MAAM,CAAA;KAAE,CAAC,CAA8B;IAEvN;;;OAGG;gBACS,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,YAAY,KAAK,OAAO,CAAC;QAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QAAC,oBAAoB,CAAC,EAAE,IAAI,GAAG,MAAM,CAAA;KAAE,CAAC;IAO5M,KAAK,IAAI,4BAA4B;CACxC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/plugins-network.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/plugins-network.js deleted file mode 100644 index d3b04072..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/plugins-network.js +++ /dev/null @@ -1,208 +0,0 @@ -import { defineProperties } from "../utils/properties.js"; -import { assertArgument } from "../utils/index.js"; -const EnsAddress = "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"; -/** - * A **NetworkPlugin** provides additional functionality on a [[Network]]. - */ -export class NetworkPlugin { - /** - * The name of the plugin. - * - * It is recommended to use reverse-domain-notation, which permits - * unique names with a known authority as well as hierarchal entries. - */ - name; - /** - * Creates a new **NetworkPlugin**. - */ - constructor(name) { - defineProperties(this, { name }); - } - /** - * Creates a copy of this plugin. - */ - clone() { - return new NetworkPlugin(this.name); - } -} -/** - * A **GasCostPlugin** allows a network to provide alternative values when - * computing the intrinsic gas required for a transaction. - */ -export class GasCostPlugin extends NetworkPlugin { - /** - * The block number to treat these values as valid from. - * - * This allows a hardfork to have updated values included as well as - * mulutiple hardforks to be supported. - */ - effectiveBlock; - /** - * The transactions base fee. - */ - txBase; - /** - * The fee for creating a new account. - */ - txCreate; - /** - * The fee per zero-byte in the data. - */ - txDataZero; - /** - * The fee per non-zero-byte in the data. - */ - txDataNonzero; - /** - * The fee per storage key in the [[link-eip-2930]] access list. - */ - txAccessListStorageKey; - /** - * The fee per address in the [[link-eip-2930]] access list. - */ - txAccessListAddress; - /** - * Creates a new GasCostPlugin from %%effectiveBlock%% until the - * latest block or another GasCostPlugin supercedes that block number, - * with the associated %%costs%%. - */ - constructor(effectiveBlock, costs) { - if (effectiveBlock == null) { - effectiveBlock = 0; - } - super(`org.ethers.network.plugins.GasCost#${(effectiveBlock || 0)}`); - const props = { effectiveBlock }; - function set(name, nullish) { - let value = (costs || {})[name]; - if (value == null) { - value = nullish; - } - assertArgument(typeof (value) === "number", `invalud value for ${name}`, "costs", costs); - props[name] = value; - } - set("txBase", 21000); - set("txCreate", 32000); - set("txDataZero", 4); - set("txDataNonzero", 16); - set("txAccessListStorageKey", 1900); - set("txAccessListAddress", 2400); - defineProperties(this, props); - } - clone() { - return new GasCostPlugin(this.effectiveBlock, this); - } -} -/** - * An **EnsPlugin** allows a [[Network]] to specify the ENS Registry - * Contract address and the target network to use when using that - * contract. - * - * Various testnets have their own instance of the contract to use, but - * in general, the mainnet instance supports multi-chain addresses and - * should be used. - */ -export class EnsPlugin extends NetworkPlugin { - /** - * The ENS Registrty Contract address. - */ - address; - /** - * The chain ID that the ENS contract lives on. - */ - targetNetwork; - /** - * Creates a new **EnsPlugin** connected to %%address%% on the - * %%targetNetwork%%. The default ENS address and mainnet is used - * if unspecified. - */ - constructor(address, targetNetwork) { - super("org.ethers.plugins.network.Ens"); - defineProperties(this, { - address: (address || EnsAddress), - targetNetwork: ((targetNetwork == null) ? 1 : targetNetwork) - }); - } - clone() { - return new EnsPlugin(this.address, this.targetNetwork); - } -} -/** - * A **FeeDataNetworkPlugin** allows a network to provide and alternate - * means to specify its fee data. - * - * For example, a network which does not support [[link-eip-1559]] may - * choose to use a Gas Station site to approximate the gas price. - */ -export class FeeDataNetworkPlugin extends NetworkPlugin { - #feeDataFunc; - /** - * The fee data function provided to the constructor. - */ - get feeDataFunc() { - return this.#feeDataFunc; - } - /** - * Creates a new **FeeDataNetworkPlugin**. - */ - constructor(feeDataFunc) { - super("org.ethers.plugins.network.FeeData"); - this.#feeDataFunc = feeDataFunc; - } - /** - * Resolves to the fee data. - */ - async getFeeData(provider) { - return await this.#feeDataFunc(provider); - } - clone() { - return new FeeDataNetworkPlugin(this.#feeDataFunc); - } -} -export class FetchUrlFeeDataNetworkPlugin extends NetworkPlugin { - #url; - #processFunc; - /** - * The URL to initialize the FetchRequest with in %%processFunc%%. - */ - get url() { return this.#url; } - /** - * The callback to use when computing the FeeData. - */ - get processFunc() { return this.#processFunc; } - /** - * Creates a new **FetchUrlFeeDataNetworkPlugin** which will - * be used when computing the fee data for the network. - */ - constructor(url, processFunc) { - super("org.ethers.plugins.network.FetchUrlFeeDataPlugin"); - this.#url = url; - this.#processFunc = processFunc; - } - // We are immutable, so we can serve as our own clone - clone() { return this; } -} -/* -export class CustomBlockNetworkPlugin extends NetworkPlugin { - readonly #blockFunc: (provider: Provider, block: BlockParams) => Block; - readonly #blockWithTxsFunc: (provider: Provider, block: BlockParams) => Block; - - constructor(blockFunc: (provider: Provider, block: BlockParams) => Block, blockWithTxsFunc: (provider: Provider, block: BlockParams) => Block) { - super("org.ethers.network-plugins.custom-block"); - this.#blockFunc = blockFunc; - this.#blockWithTxsFunc = blockWithTxsFunc; - } - - async getBlock(provider: Provider, block: BlockParams): Promise> { - return await this.#blockFunc(provider, block); - } - - async getBlockions(provider: Provider, block: BlockParams): Promise> { - return await this.#blockWithTxsFunc(provider, block); - } - - clone(): CustomBlockNetworkPlugin { - return new CustomBlockNetworkPlugin(this.#blockFunc, this.#blockWithTxsFunc); - } -} -*/ -//# sourceMappingURL=plugins-network.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/plugins-network.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/plugins-network.js.map deleted file mode 100644 index c5468491..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/plugins-network.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"plugins-network.js","sourceRoot":"","sources":["../../src.ts/providers/plugins-network.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAMnD,MAAM,UAAU,GAAG,4CAA4C,CAAC;AAEhE;;GAEG;AACH,MAAM,OAAO,aAAa;IACtB;;;;;OAKG;IACM,IAAI,CAAU;IAEvB;;OAEG;IACH,YAAY,IAAY;QACpB,gBAAgB,CAAgB,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IACpD,CAAC;IAED;;OAEG;IACH,KAAK;QACD,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;CAKJ;AAsCD;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,aAAa;IAC5C;;;;;OAKG;IACM,cAAc,CAAU;IAEjC;;OAEG;IACM,MAAM,CAAU;IAEzB;;OAEG;IACM,QAAQ,CAAU;IAE3B;;OAEG;IACM,UAAU,CAAU;IAE7B;;OAEG;IACM,aAAa,CAAU;IAEhC;;OAEG;IACM,sBAAsB,CAAU;IAEzC;;OAEG;IACM,mBAAmB,CAAU;IAGtC;;;;OAIG;IACH,YAAY,cAAuB,EAAE,KAAyB;QAC1D,IAAI,cAAc,IAAI,IAAI,EAAE;YAAE,cAAc,GAAG,CAAC,CAAC;SAAE;QACnD,KAAK,CAAC,sCAAuC,CAAC,cAAc,IAAI,CAAC,CAAE,EAAE,CAAC,CAAC;QAEvE,MAAM,KAAK,GAA2B,EAAE,cAAc,EAAE,CAAC;QACzD,SAAS,GAAG,CAAC,IAA6B,EAAE,OAAe;YACvD,IAAI,KAAK,GAAG,CAAC,KAAK,IAAI,EAAG,CAAC,CAAC,IAAI,CAAC,CAAC;YACjC,IAAI,KAAK,IAAI,IAAI,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MG;AACH,MAAM,OAAO,oBAAqB,SAAQ,aAAa;IAC1C,YAAY,CAA2C;IAEhE;;OAEG;IACH,IAAI,WAAW;QACX,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,YAAY,WAAqD;QAC7D,KAAK,CAAC,oCAAoC,CAAC,CAAC;QAC5C,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IACpC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,UAAU,CAAC,QAAkB;QAC/B,OAAO,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC;IAED,KAAK;QACD,OAAO,IAAI,oBAAoB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACvD,CAAC;CACJ;AAED,MAAM,OAAO,4BAA6B,SAAQ,aAAa;IAClD,IAAI,CAAS;IACb,YAAY,CAAyK;IAE9L;;OAEG;IACH,IAAI,GAAG,KAAa,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAEvC;;OAEG;IACH,IAAI,WAAW,KAA6K,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IAEvN;;;OAGG;IACH,YAAY,GAAW,EAAE,WAAmL;QACxM,KAAK,CAAC,kDAAkD,CAAC,CAAC;QAC1D,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IACpC,CAAC;IAED,qDAAqD;IACrD,KAAK,KAAmC,OAAO,IAAI,CAAC,CAAC,CAAC;CACzD;AAED;;;;;;;;;;;;;;;;;;;;;;;EAuBE"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-alchemy.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-alchemy.d.ts deleted file mode 100644 index 0fe1a7d1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-alchemy.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * [[link-alchemy]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Arbitrum Sepolia Testnet (``arbitrum-sepolia``) - * - Base (``base``) - * - Base Goerlia Testnet (``base-goerli``) - * - Base Sepolia Testnet (``base-sepolia``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Optimism Sepolia Testnet (``optimism-sepolia``) - * - Polygon (``matic``) - * - Polygon Amoy Testnet (``matic-amoy``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:Alchemy [providers-alchemy] - */ -import { FetchRequest } from "../utils/index.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import type { AbstractProvider, PerformActionRequest } from "./abstract-provider.js"; -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; -/** - * The **AlchemyProvider** connects to the [[link-alchemy]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-alchemy-signup). - * - * @_docloc: api/providers/thirdparty - */ -export declare class AlchemyProvider extends JsonRpcProvider implements CommunityResourcable { - readonly apiKey: string; - constructor(_network?: Networkish, apiKey?: null | string); - _getProvider(chainId: number): AbstractProvider; - _perform(req: PerformActionRequest): Promise; - isCommunityResource(): boolean; - static getRequest(network: Network, apiKey?: string): FetchRequest; -} -//# sourceMappingURL=provider-alchemy.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-alchemy.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-alchemy.d.ts.map deleted file mode 100644 index 9cbe30b8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-alchemy.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-alchemy.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-alchemy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAEH,YAAY,EACf,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACrF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA2C/C;;;;;;;;;;GAUG;AACH,qBAAa,eAAgB,SAAQ,eAAgB,YAAW,oBAAoB;IAChF,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;gBAEb,QAAQ,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM;IAWzD,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB;IAOzC,QAAQ,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC;IAmCvD,mBAAmB,IAAI,OAAO;IAI9B,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,YAAY;CAerE"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-alchemy.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-alchemy.js deleted file mode 100644 index 83cfd17f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-alchemy.js +++ /dev/null @@ -1,147 +0,0 @@ -/** - * [[link-alchemy]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Arbitrum Sepolia Testnet (``arbitrum-sepolia``) - * - Base (``base``) - * - Base Goerlia Testnet (``base-goerli``) - * - Base Sepolia Testnet (``base-sepolia``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Optimism Sepolia Testnet (``optimism-sepolia``) - * - Polygon (``matic``) - * - Polygon Amoy Testnet (``matic-amoy``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:Alchemy [providers-alchemy] - */ -import { defineProperties, resolveProperties, assert, assertArgument, FetchRequest } from "../utils/index.js"; -import { showThrottleMessage } from "./community.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -const defaultApiKey = "_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC"; -function getHost(name) { - switch (name) { - case "mainnet": - return "eth-mainnet.g.alchemy.com"; - case "goerli": - return "eth-goerli.g.alchemy.com"; - case "sepolia": - return "eth-sepolia.g.alchemy.com"; - case "arbitrum": - return "arb-mainnet.g.alchemy.com"; - case "arbitrum-goerli": - return "arb-goerli.g.alchemy.com"; - case "arbitrum-sepolia": - return "arb-sepolia.g.alchemy.com"; - case "base": - return "base-mainnet.g.alchemy.com"; - case "base-goerli": - return "base-goerli.g.alchemy.com"; - case "base-sepolia": - return "base-sepolia.g.alchemy.com"; - case "matic": - return "polygon-mainnet.g.alchemy.com"; - case "matic-amoy": - return "polygon-amoy.g.alchemy.com"; - case "matic-mumbai": - return "polygon-mumbai.g.alchemy.com"; - case "optimism": - return "opt-mainnet.g.alchemy.com"; - case "optimism-goerli": - return "opt-goerli.g.alchemy.com"; - case "optimism-sepolia": - return "opt-sepolia.g.alchemy.com"; - } - assertArgument(false, "unsupported network", "network", name); -} -/** - * The **AlchemyProvider** connects to the [[link-alchemy]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-alchemy-signup). - * - * @_docloc: api/providers/thirdparty - */ -export class AlchemyProvider extends JsonRpcProvider { - apiKey; - constructor(_network, apiKey) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (apiKey == null) { - apiKey = defaultApiKey; - } - const request = AlchemyProvider.getRequest(network, apiKey); - super(request, network, { staticNetwork: network }); - defineProperties(this, { apiKey }); - } - _getProvider(chainId) { - try { - return new AlchemyProvider(chainId, this.apiKey); - } - catch (error) { } - return super._getProvider(chainId); - } - async _perform(req) { - // https://docs.alchemy.com/reference/trace-transaction - if (req.method === "getTransactionResult") { - const { trace, tx } = await resolveProperties({ - trace: this.send("trace_transaction", [req.hash]), - tx: this.getTransaction(req.hash) - }); - if (trace == null || tx == null) { - return null; - } - let data; - let error = false; - try { - data = trace[0].result.output; - error = (trace[0].error === "Reverted"); - } - catch (error) { } - if (data) { - assert(!error, "an error occurred during transaction executions", "CALL_EXCEPTION", { - action: "getTransactionResult", - data, - reason: null, - transaction: tx, - invocation: null, - revert: null // @TODO - }); - return data; - } - assert(false, "could not parse trace result", "BAD_DATA", { value: trace }); - } - return await super._perform(req); - } - isCommunityResource() { - return (this.apiKey === defaultApiKey); - } - static getRequest(network, apiKey) { - if (apiKey == null) { - apiKey = defaultApiKey; - } - const request = new FetchRequest(`https:/\/${getHost(network.name)}/v2/${apiKey}`); - request.allowGzip = true; - if (apiKey === defaultApiKey) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("alchemy"); - return true; - }; - } - return request; - } -} -//# sourceMappingURL=provider-alchemy.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-alchemy.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-alchemy.js.map deleted file mode 100644 index b9b137a4..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-alchemy.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-alchemy.js","sourceRoot":"","sources":["../../src.ts/providers/provider-alchemy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EACH,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,EAAE,cAAc,EAC3D,YAAY,EACf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAOxD,MAAM,aAAa,GAAG,kCAAkC,CAAA;AAExD,SAAS,OAAO,CAAC,IAAY;IACzB,QAAO,IAAI,EAAE;QACT,KAAK,SAAS;YACV,OAAO,2BAA2B,CAAC;QACvC,KAAK,QAAQ;YACT,OAAO,0BAA0B,CAAC;QACtC,KAAK,SAAS;YACV,OAAO,2BAA2B,CAAC;QAEvC,KAAK,UAAU;YACX,OAAO,2BAA2B,CAAC;QACvC,KAAK,iBAAiB;YAClB,OAAO,0BAA0B,CAAC;QACtC,KAAK,kBAAkB;YACnB,OAAO,2BAA2B,CAAC;QACvC,KAAK,MAAM;YACP,OAAO,4BAA4B,CAAC;QACxC,KAAK,aAAa;YACd,OAAO,2BAA2B,CAAC;QACvC,KAAK,cAAc;YACf,OAAO,4BAA4B,CAAC;QACxC,KAAK,OAAO;YACR,OAAO,+BAA+B,CAAC;QAC3C,KAAK,YAAY;YACb,OAAO,4BAA4B,CAAC;QACxC,KAAK,cAAc;YACf,OAAO,8BAA8B,CAAC;QAC1C,KAAK,UAAU;YACX,OAAO,2BAA2B,CAAC;QACvC,KAAK,iBAAiB;YAClB,OAAO,0BAA0B,CAAC;QACtC,KAAK,kBAAkB;YACnB,OAA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Aa,EAAE;YAC1B,OAAO,CAAC,SAAS,GAAG,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;gBACrD,mBAAmB,CAAC,SAAS,CAAC,CAAC;gBAC/B,OAAO,IAAI,CAAC;YAChB,CAAC,CAAA;SACJ;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ankr.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ankr.d.ts deleted file mode 100644 index 8791b0aa..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ankr.d.ts +++ /dev/null @@ -1,63 +0,0 @@ -/** - * [[link-ankr]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Arbitrum (``arbitrum``) - * - Base (``base``) - * - Base Goerlia Testnet (``base-goerli``) - * - Base Sepolia Testnet (``base-sepolia``) - * - BNB (``bnb``) - * - BNB Testnet (``bnbt``) - * - Filecoin (``filecoin``) - * - Filecoin Calibration Testnet (``filecoin-calibration``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Optimism Sepolia Testnet (``optimism-sepolia``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:Ankr [providers-ankr] - */ -import { FetchRequest } from "../utils/index.js"; -import { AbstractProvider } from "./abstract-provider.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; -import type { JsonRpcError, JsonRpcPayload } from "./provider-jsonrpc.js"; -/** - * The **AnkrProvider** connects to the [[link-ankr]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-ankr-signup). - */ -export declare class AnkrProvider extends JsonRpcProvider implements CommunityResourcable { - /** - * The API key for the Ankr connection. - */ - readonly apiKey: string; - /** - * Create a new **AnkrProvider**. - * - * By default connecting to ``mainnet`` with a highly throttled - * API key. - */ - constructor(_network?: Networkish, apiKey?: null | string); - _getProvider(chainId: number): AbstractProvider; - /** - * Returns a prepared request for connecting to %%network%% with - * %%apiKey%%. - */ - static getRequest(network: Network, apiKey?: null | string): FetchRequest; - getRpcError(payload: JsonRpcPayload, error: JsonRpcError): Error; - isCommunityResource(): boolean; -} -//# sourceMappingURL=provider-ankr.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ankr.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ankr.d.ts.map deleted file mode 100644 index 392d3d03..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ankr.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-ankr.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-ankr.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EACe,YAAY,EACjC,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AA8C1E;;;;;;;;GAQG;AACH,qBAAa,YAAa,SAAQ,eAAgB,YAAW,oBAAoB;IAE7E;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAEzB;;;;;OAKG;gBACS,QAAQ,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM;IAczD,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB;IAO/C;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY;IAgBzE,WAAW,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,GAAG,KAAK;IAUhE,mBAAmB,IAAI,OAAO;CAGjC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ankr.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ankr.js deleted file mode 100644 index 62ffec08..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ankr.js +++ /dev/null @@ -1,139 +0,0 @@ -/** - * [[link-ankr]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Arbitrum (``arbitrum``) - * - Base (``base``) - * - Base Goerlia Testnet (``base-goerli``) - * - Base Sepolia Testnet (``base-sepolia``) - * - BNB (``bnb``) - * - BNB Testnet (``bnbt``) - * - Filecoin (``filecoin``) - * - Filecoin Calibration Testnet (``filecoin-calibration``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Optimism Sepolia Testnet (``optimism-sepolia``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:Ankr [providers-ankr] - */ -import { defineProperties, FetchRequest, assertArgument } from "../utils/index.js"; -import { showThrottleMessage } from "./community.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -const defaultApiKey = "9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972"; -function getHost(name) { - switch (name) { - case "mainnet": - return "rpc.ankr.com/eth"; - case "goerli": - return "rpc.ankr.com/eth_goerli"; - case "sepolia": - return "rpc.ankr.com/eth_sepolia"; - case "arbitrum": - return "rpc.ankr.com/arbitrum"; - case "base": - return "rpc.ankr.com/base"; - case "base-goerli": - return "rpc.ankr.com/base_goerli"; - case "base-sepolia": - return "rpc.ankr.com/base_sepolia"; - case "bnb": - return "rpc.ankr.com/bsc"; - case "bnbt": - return "rpc.ankr.com/bsc_testnet_chapel"; - case "filecoin": - return "rpc.ankr.com/filecoin"; - case "filecoin-calibration": - return "rpc.ankr.com/filecoin_testnet"; - case "matic": - return "rpc.ankr.com/polygon"; - case "matic-mumbai": - return "rpc.ankr.com/polygon_mumbai"; - case "optimism": - return "rpc.ankr.com/optimism"; - case "optimism-goerli": - return "rpc.ankr.com/optimism_testnet"; - case "optimism-sepolia": - return "rpc.ankr.com/optimism_sepolia"; - } - assertArgument(false, "unsupported network", "network", name); -} -/** - * The **AnkrProvider** connects to the [[link-ankr]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-ankr-signup). - */ -export class AnkrProvider extends JsonRpcProvider { - /** - * The API key for the Ankr connection. - */ - apiKey; - /** - * Create a new **AnkrProvider**. - * - * By default connecting to ``mainnet`` with a highly throttled - * API key. - */ - constructor(_network, apiKey) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (apiKey == null) { - apiKey = defaultApiKey; - } - // Ankr does not support filterId, so we force polling - const options = { polling: true, staticNetwork: network }; - const request = AnkrProvider.getRequest(network, apiKey); - super(request, network, options); - defineProperties(this, { apiKey }); - } - _getProvider(chainId) { - try { - return new AnkrProvider(chainId, this.apiKey); - } - catch (error) { } - return super._getProvider(chainId); - } - /** - * Returns a prepared request for connecting to %%network%% with - * %%apiKey%%. - */ - static getRequest(network, apiKey) { - if (apiKey == null) { - apiKey = defaultApiKey; - } - const request = new FetchRequest(`https:/\/${getHost(network.name)}/${apiKey}`); - request.allowGzip = true; - if (apiKey === defaultApiKey) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("AnkrProvider"); - return true; - }; - } - return request; - } - getRpcError(payload, error) { - if (payload.method === "eth_sendRawTransaction") { - if (error && error.error && error.error.message === "INTERNAL_ERROR: could not replace existing tx") { - error.error.message = "replacement transaction underpriced"; - } - } - return super.getRpcError(payload, error); - } - isCommunityResource() { - return (this.apiKey === defaultApiKey); - } -} -//# sourceMappingURL=provider-ankr.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ankr.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ankr.js.map deleted file mode 100644 index 210caea2..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ankr.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-ankr.js","sourceRoot":"","sources":["../../src.ts/providers/provider-ankr.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EACH,gBAAgB,EAAE,YAAY,EAAE,cAAc,EACjD,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAOxD,MAAM,aAAa,GAAG,kEAAkE,CAAC;AAEzF,SAAS,OAAO,CAAC,IAAY;IACzB,QAAQ,IAAI,EAAE;QACV,KAAK,SAAS;YACV,OAAO,kBAAkB,CAAC;QAC9B,KAAK,QAAQ;YACT,OAAO,yBAAyB,CAAC;QACrC,KAAK,SAAS;YACV,OAAO,0BAA0B,CA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,CAAC,MAAM,KAAK,aAAa,CAAC,CAAC;IAC3C,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-blockscout.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-blockscout.d.ts deleted file mode 100644 index be8c395e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-blockscout.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -/** - * [[link-blockscout]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Sepolia Testnet (``sepolia``) - * - Holesky Testnet (``holesky``) - * - Ethereum Classic (``classic``) - * - Arbitrum (``arbitrum``) - * - Base (``base``) - * - Base Sepolia Testnet (``base-sepolia``) - * - Gnosis (``xdai``) - * - Optimism (``optimism``) - * - Optimism Sepolia Testnet (``optimism-sepolia``) - * - Polygon (``matic``) - * - * @_subsection: api/providers/thirdparty:Blockscout [providers-blockscout] - */ -import { FetchRequest } from "../utils/index.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import type { AbstractProvider, PerformActionRequest } from "./abstract-provider.js"; -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; -import type { JsonRpcPayload, JsonRpcError } from "./provider-jsonrpc.js"; -/** - * The **BlockscoutProvider** connects to the [[link-blockscout]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-blockscout). - */ -export declare class BlockscoutProvider extends JsonRpcProvider implements CommunityResourcable { - /** - * The API key. - */ - readonly apiKey: null | string; - /** - * Creates a new **BlockscoutProvider**. - */ - constructor(_network?: Networkish, apiKey?: null | string); - _getProvider(chainId: number): AbstractProvider; - isCommunityResource(): boolean; - getRpcRequest(req: PerformActionRequest): null | { - method: string; - args: Array; - }; - getRpcError(payload: JsonRpcPayload, _error: JsonRpcError): Error; - /** - * Returns a prepared request for connecting to %%network%% - * with %%apiKey%%. - */ - static getRequest(network: Network): FetchRequest; -} -//# sourceMappingURL=provider-blockscout.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-blockscout.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-blockscout.d.ts.map deleted file mode 100644 index 41eb14f6..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-blockscout.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-blockscout.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-blockscout.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAC+B,YAAY,EACjD,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACrF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAuC1E;;;;;;;;GAQG;AACH,qBAAa,kBAAmB,SAAQ,eAAgB,YAAW,oBAAoB;IACnF;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAG,IAAI,GAAG,MAAM,CAAC;IAEhC;;OAEG;gBACS,QAAQ,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM;IAYzD,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB;IAO/C,mBAAmB,IAAI,OAAO;IAI9B,aAAa,CAAC,GAAG,EAAE,oBAAoB,GAAG,IAAI,GAAG;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;KAAE;IAUrF,WAAW,CAAC,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,GAAG,KAAK;IAoCjE;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,YAAY;CAKpD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-blockscout.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-blockscout.js deleted file mode 100644 index cbf11901..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-blockscout.js +++ /dev/null @@ -1,141 +0,0 @@ -/** - * [[link-blockscout]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Sepolia Testnet (``sepolia``) - * - Holesky Testnet (``holesky``) - * - Ethereum Classic (``classic``) - * - Arbitrum (``arbitrum``) - * - Base (``base``) - * - Base Sepolia Testnet (``base-sepolia``) - * - Gnosis (``xdai``) - * - Optimism (``optimism``) - * - Optimism Sepolia Testnet (``optimism-sepolia``) - * - Polygon (``matic``) - * - * @_subsection: api/providers/thirdparty:Blockscout [providers-blockscout] - */ -import { assertArgument, defineProperties, FetchRequest, isHexString } from "../utils/index.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -function getUrl(name) { - switch (name) { - case "mainnet": - return "https:/\/eth.blockscout.com/api/eth-rpc"; - case "sepolia": - return "https:/\/eth-sepolia.blockscout.com/api/eth-rpc"; - case "holesky": - return "https:/\/eth-holesky.blockscout.com/api/eth-rpc"; - case "classic": - return "https:/\/etc.blockscout.com/api/eth-rpc"; - case "arbitrum": - return "https:/\/arbitrum.blockscout.com/api/eth-rpc"; - case "base": - return "https:/\/base.blockscout.com/api/eth-rpc"; - case "base-sepolia": - return "https:/\/base-sepolia.blockscout.com/api/eth-rpc"; - case "matic": - return "https:/\/polygon.blockscout.com/api/eth-rpc"; - case "optimism": - return "https:/\/optimism.blockscout.com/api/eth-rpc"; - case "optimism-sepolia": - return "https:/\/optimism-sepolia.blockscout.com/api/eth-rpc"; - case "xdai": - return "https:/\/gnosis.blockscout.com/api/eth-rpc"; - } - assertArgument(false, "unsupported network", "network", name); -} -/** - * The **BlockscoutProvider** connects to the [[link-blockscout]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-blockscout). - */ -export class BlockscoutProvider extends JsonRpcProvider { - /** - * The API key. - */ - apiKey; - /** - * Creates a new **BlockscoutProvider**. - */ - constructor(_network, apiKey) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (apiKey == null) { - apiKey = null; - } - const request = BlockscoutProvider.getRequest(network); - super(request, network, { staticNetwork: network }); - defineProperties(this, { apiKey }); - } - _getProvider(chainId) { - try { - return new BlockscoutProvider(chainId, this.apiKey); - } - catch (error) { } - return super._getProvider(chainId); - } - isCommunityResource() { - return (this.apiKey === null); - } - getRpcRequest(req) { - // Blockscout enforces the TAG argument for estimateGas - const resp = super.getRpcRequest(req); - if (resp && resp.method === "eth_estimateGas" && resp.args.length == 1) { - resp.args = resp.args.slice(); - resp.args.push("latest"); - } - return resp; - } - getRpcError(payload, _error) { - const error = _error ? _error.error : null; - // Blockscout currently drops the VM result and replaces it with a - // human-readable string, so we need to make it machine-readable. - if (error && error.code === -32015 && !isHexString(error.data || "", true)) { - const panicCodes = { - "assert(false)": "01", - "arithmetic underflow or overflow": "11", - "division or modulo by zero": "12", - "out-of-bounds array access; popping on an empty array": "31", - "out-of-bounds access of an array or bytesN": "32" - }; - let panicCode = ""; - if (error.message === "VM execution error.") { - // eth_call passes this message - panicCode = panicCodes[error.data] || ""; - } - else if (panicCodes[error.message || ""]) { - panicCode = panicCodes[error.message || ""]; - } - if (panicCode) { - error.message += ` (reverted: ${error.data})`; - error.data = "0x4e487b7100000000000000000000000000000000000000000000000000000000000000" + panicCode; - } - } - else if (error && error.code === -32000) { - if (error.message === "wrong transaction nonce") { - error.message += " (nonce too low)"; - } - } - return super.getRpcError(payload, _error); - } - /** - * Returns a prepared request for connecting to %%network%% - * with %%apiKey%%. - */ - static getRequest(network) { - const request = new FetchRequest(getUrl(network.name)); - request.allowGzip = true; - return request; - } -} -//# sourceMappingURL=provider-blockscout.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-blockscout.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-blockscout.js.map deleted file mode 100644 index 7ea66d1c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-blockscout.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-blockscout.js","sourceRoot":"","sources":["../../src.ts/providers/provider-blockscout.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EACH,cAAc,EAAE,gBAAgB,EAAE,YAAY,EAAE,WAAW,EAC9D,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAQxD,SAAS,MAAM,CAAC,IAAY;IACxB,QAAO,IAAI,EAAE;QACT,KAAK,SAAS;YACV,OAAO,yCAAyC,CAAC;QACrD,KAAK,SAAS;YACV,OAAO,iDAAiD,CAAC;QAC7D,KAAK,SAAS;YACV,OAAO,iDAAiD,CAAC;QAE7D,KAAK,SAAS;YACV,OAAO,yCAAyC,CAAC;QAErD,KAAK,UAAU;YACX,OAAO,8CAA8C,CAAC;QAE1D,KAAK,MAAM;YACP,OAAO,0CAA0C,CAAC;QACtD,KAAK,cAAc;YACf,OAAO,kDAAkD,CAAC;QAE9D,KAAK,OAAO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,GAAG,SAAS,CAAC;aACvG;SAEJ;aAAM,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,EAAE;YACvC,IAAI,KAAK,CAAC,OAAO,KAAK,yBAAyB,EAAE;gBAC7C,KAAK,CAAC,OAAO,IAAI,kBAAkB,CAAC;aACvC;SACJ;QAED,OAAO,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC9C,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAgB;QAC9B,MAAM,OAAO,GAAG,IAAI,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACvD,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;QACzB,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-browser.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-browser.d.ts deleted file mode 100644 index 02a5e778..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-browser.d.ts +++ /dev/null @@ -1,108 +0,0 @@ -import { JsonRpcApiPollingProvider } from "./provider-jsonrpc.js"; -import type { JsonRpcError, JsonRpcPayload, JsonRpcResult, JsonRpcSigner } from "./provider-jsonrpc.js"; -import type { Network, Networkish } from "./network.js"; -/** - * The interface to an [[link-eip-1193]] provider, which is a standard - * used by most injected providers, which the [[BrowserProvider]] accepts - * and exposes the API of. - */ -export interface Eip1193Provider { - /** - * See [[link-eip-1193]] for details on this method. - */ - request(request: { - method: string; - params?: Array | Record; - }): Promise; -} -/** - * The possible additional events dispatched when using the ``"debug"`` - * event on a [[BrowserProvider]]. - */ -export type DebugEventBrowserProvider = { - action: "sendEip1193Payload"; - payload: { - method: string; - params: Array; - }; -} | { - action: "receiveEip1193Result"; - result: any; -} | { - action: "receiveEip1193Error"; - error: Error; -}; -/** - * Provider info provided by the [[link-eip-6963]] discovery mechanism. - */ -export interface Eip6963ProviderInfo { - uuid: string; - name: string; - icon: string; - rdns: string; -} -export type BrowserProviderOptions = { - polling?: boolean; - staticNetwork?: null | boolean | Network; - cacheTimeout?: number; - pollingInterval?: number; - providerInfo?: Eip6963ProviderInfo; -}; -/** - * Specifies how [[link-eip-6963]] discovery should proceed. - * - * See: [[BrowserProvider-discover]] - */ -export interface BrowserDiscoverOptions { - /** - * Override provider detection with this provider. - */ - provider?: Eip1193Provider; - /** - * Duration to wait to detect providers. (default: 300ms) - */ - timeout?: number; - /** - * Return the first detected provider. Otherwise wait for %%timeout%% - * and allowing filtering before selecting the desired provider. - */ - anyProvider?: boolean; - /** - * Use the provided window context. Useful in non-standard - * environments or to hijack where a provider comes from. - */ - window?: any; - /** - * Explicitly choose which provider to used once scanning is complete. - */ - filter?: (found: Array) => null | BrowserProvider | Eip6963ProviderInfo; -} -/** - * A **BrowserProvider** is intended to wrap an injected provider which - * adheres to the [[link-eip-1193]] standard, which most (if not all) - * currently do. - */ -export declare class BrowserProvider extends JsonRpcApiPollingProvider { - #private; - /** - * Connect to the %%ethereum%% provider, optionally forcing the - * %%network%%. - */ - constructor(ethereum: Eip1193Provider, network?: Networkish, _options?: BrowserProviderOptions); - get providerInfo(): null | Eip6963ProviderInfo; - send(method: string, params: Array | Record): Promise; - _send(payload: JsonRpcPayload | Array): Promise>; - getRpcError(payload: JsonRpcPayload, error: JsonRpcError): Error; - /** - * Resolves to ``true`` if the provider manages the %%address%%. - */ - hasSigner(address: number | string): Promise; - getSigner(address?: number | string): Promise; - /** - * Discover and connect to a Provider in the Browser using the - * [[link-eip-6963]] discovery mechanism. If no providers are - * present, ``null`` is resolved. - */ - static discover(options?: BrowserDiscoverOptions): Promise; -} -//# sourceMappingURL=provider-browser.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-browser.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-browser.d.ts.map deleted file mode 100644 index 82554ebb..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-browser.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-browser.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,KAAK,EAER,YAAY,EAAE,cAAc,EAAE,aAAa,EAC3C,aAAa,EAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAExD;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC5B;;OAEG;IACH,OAAO,CAAC,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KAAE,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;CACjG;AAED;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACpC,MAAM,EAAE,oBAAoB,CAAC;IAC7B,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;KAAE,CAAA;CAClD,GAAG;IACA,MAAM,EAAE,sBAAsB,CAAC;IAC/B,MAAM,EAAE,GAAG,CAAA;CACd,GAAG;IACA,MAAM,EAAE,qBAAqB,CAAC;IAC9B,KAAK,EAAE,KAAK,CAAA;CACf,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CAChB;AAYD,MAAM,MAAM,sBAAsB,GAAG;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;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AAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAgBlE;;;;OAIG;WACU,QAAQ,CAAC,OAAO,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,GAAG,eAAe,CAAC;CAsG3F"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-browser.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-browser.js deleted file mode 100644 index ffac02d2..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-browser.js +++ /dev/null @@ -1,200 +0,0 @@ -import { assertArgument, makeError } from "../utils/index.js"; -import { JsonRpcApiPollingProvider } from "./provider-jsonrpc.js"; -; -/** - * A **BrowserProvider** is intended to wrap an injected provider which - * adheres to the [[link-eip-1193]] standard, which most (if not all) - * currently do. - */ -export class BrowserProvider extends JsonRpcApiPollingProvider { - #request; - #providerInfo; - /** - * Connect to the %%ethereum%% provider, optionally forcing the - * %%network%%. - */ - constructor(ethereum, network, _options) { - // Copy the options - const options = Object.assign({}, ((_options != null) ? _options : {}), { batchMaxCount: 1 }); - assertArgument(ethereum && ethereum.request, "invalid EIP-1193 provider", "ethereum", ethereum); - super(network, options); - this.#providerInfo = null; - if (_options && _options.providerInfo) { - this.#providerInfo = _options.providerInfo; - } - this.#request = async (method, params) => { - const payload = { method, params }; - this.emit("debug", { action: "sendEip1193Request", payload }); - try { - const result = await ethereum.request(payload); - this.emit("debug", { action: "receiveEip1193Result", result }); - return result; - } - catch (e) { - const error = new Error(e.message); - error.code = e.code; - error.data = e.data; - error.payload = payload; - this.emit("debug", { action: "receiveEip1193Error", error }); - throw error; - } - }; - } - get providerInfo() { - return this.#providerInfo; - } - async send(method, params) { - await this._start(); - return await super.send(method, params); - } - async _send(payload) { - assertArgument(!Array.isArray(payload), "EIP-1193 does not support batch request", "payload", payload); - try { - const result = await this.#request(payload.method, payload.params || []); - return [{ id: payload.id, result }]; - } - catch (e) { - return [{ - id: payload.id, - error: { code: e.code, data: e.data, message: e.message } - }]; - } - } - getRpcError(payload, error) { - error = JSON.parse(JSON.stringify(error)); - // EIP-1193 gives us some machine-readable error codes, so rewrite - // them into Ethers standard errors. - switch (error.error.code || -1) { - case 4001: - error.error.message = `ethers-user-denied: ${error.error.message}`; - break; - case 4200: - error.error.message = `ethers-unsupported: ${error.error.message}`; - break; - } - return super.getRpcError(payload, error); - } - /** - * Resolves to ``true`` if the provider manages the %%address%%. - */ - async hasSigner(address) { - if (address == null) { - address = 0; - } - const accounts = await this.send("eth_accounts", []); - if (typeof (address) === "number") { - return (accounts.length > address); - } - address = address.toLowerCase(); - return accounts.filter((a) => (a.toLowerCase() === address)).length !== 0; - } - async getSigner(address) { - if (address == null) { - address = 0; - } - if (!(await this.hasSigner(address))) { - try { - await this.#request("eth_requestAccounts", []); - } - catch (error) { - const payload = error.payload; - throw this.getRpcError(payload, { id: payload.id, error }); - } - } - return await super.getSigner(address); - } - /** - * Discover and connect to a Provider in the Browser using the - * [[link-eip-6963]] discovery mechanism. If no providers are - * present, ``null`` is resolved. - */ - static async discover(options) { - if (options == null) { - options = {}; - } - if (options.provider) { - return new BrowserProvider(options.provider); - } - const context = options.window ? options.window : - (typeof (window) !== "undefined") ? window : null; - if (context == null) { - return null; - } - const anyProvider = options.anyProvider; - if (anyProvider && context.ethereum) { - return new BrowserProvider(context.ethereum); - } - if (!("addEventListener" in context && "dispatchEvent" in context - && "removeEventListener" in context)) { - return null; - } - const timeout = options.timeout ? options.timeout : 300; - if (timeout === 0) { - return null; - } - return await (new Promise((resolve, reject) => { - let found = []; - const addProvider = (event) => { - found.push(event.detail); - if (anyProvider) { - finalize(); - } - }; - const finalize = () => { - clearTimeout(timer); - if (found.length) { - // If filtering is provided: - if (options && options.filter) { - // Call filter, with a copies of found provider infos - const filtered = options.filter(found.map(i => Object.assign({}, (i.info)))); - if (filtered == null) { - // No provider selected - resolve(null); - } - else if (filtered instanceof BrowserProvider) { - // Custom provider created - resolve(filtered); - } - else { - // Find the matching provider - let match = null; - if (filtered.uuid) { - const matches = found.filter(f => (filtered.uuid === f.info.uuid)); - // @TODO: What should happen if multiple values - // for the same UUID? - match = matches[0]; - } - if (match) { - const { provider, info } = match; - resolve(new BrowserProvider(provider, undefined, { - providerInfo: info - })); - } - else { - reject(makeError("filter returned unknown info", "UNSUPPORTED_OPERATION", { - value: filtered - })); - } - } - } - else { - // Pick the first found provider - const { provider, info } = found[0]; - resolve(new BrowserProvider(provider, undefined, { - providerInfo: info - })); - } - } - else { - // Nothing found - resolve(null); - } - context.removeEventListener("eip6963:announceProvider", addProvider); - }; - const timer = setTimeout(() => { finalize(); }, timeout); - context.addEventListener("eip6963:announceProvider", addProvider); - context.dispatchEvent(new Event("eip6963:requestProvider")); - })); - } -} -//# sourceMappingURL=provider-browser.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-browser.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-browser.js.map deleted file mode 100644 index 736cd5f5..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-browser.js","sourceRoot":"","sources":["../../src.ts/providers/provider-browser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAmBjE,CAAC;AAmFF;;;;GAIG;AACH,MAAM,OAAO,eAAgB,SAAQ,yBAAyB;IAC1D,QAAQ,CAA6E;IAErF,aAAa,CAA6B;IAE1C;;;OAGG;IACH,YAAY,QAAyB,EAAE,OAAoB,EAAE,QAAiC;QAE1F,mBAAmB;QACnB,MAAM,OAAO,GAA8B,MAAM,CAAC,MAAM,CAAC,EAAG,EAC1D,CAAC,CAAC,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC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AE,IAAI;iCACrB,CAAC,CAAC,CAAC;6BACP;iCAAM;gCACH,MAAM,CAAC,SAAS,CAAC,8BAA8B,EAAE,uBAAuB,EAAE;oCACtE,KAAK,EAAE,QAAQ;iCAClB,CAAC,CAAC,CAAC;6BACP;yBACJ;qBAEJ;yBAAM;wBAEH,gCAAgC;wBAChC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;wBACpC,OAAO,CAAC,IAAI,eAAe,CAAC,QAAQ,EAAE,SAAS,EAAE;4BAC7C,YAAY,EAAE,IAAI;yBACrB,CAAC,CAAC,CAAC;qBACP;iBAEJ;qBAAM;oBACH,gBAAgB;oBAChB,OAAO,CAAC,IAAI,CAAC,CAAC;iBACjB;gBAED,OAAO,CAAC,mBAAmB,CAAM,0BAA0B,EACzD,WAAW,CAAC,CAAC;YACnB,CAAC,CAAC;YAEF,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,GAAG,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;YAEzD,OAAO,CAAC,gBAAgB,CAAM,0BAA0B,EACtD,WAAW,CAAC,CAAC;YAEf,OAAO,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC,CAAC;QAChE,CAAC,CAAC,CAAC,CAAC;IACR,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-chainstack.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-chainstack.d.ts deleted file mode 100644 index dfc4f8ed..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-chainstack.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * [[link-chainstack]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Arbitrum (``arbitrum``) - * - BNB Smart Chain Mainnet (``bnb``) - * - Polygon (``matic``) - * - * @_subsection: api/providers/thirdparty:Chainstack [providers-chainstack] - */ -import { FetchRequest } from "../utils/index.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import type { AbstractProvider } from "./abstract-provider.js"; -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; -/** - * The **ChainstackProvider** connects to the [[link-chainstack]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-chainstack). - */ -export declare class ChainstackProvider extends JsonRpcProvider implements CommunityResourcable { - /** - * The API key for the Chainstack connection. - */ - readonly apiKey: string; - /** - * Creates a new **ChainstackProvider**. - */ - constructor(_network?: Networkish, apiKey?: null | string); - _getProvider(chainId: number): AbstractProvider; - isCommunityResource(): boolean; - /** - * Returns a prepared request for connecting to %%network%% - * with %%apiKey%% and %%projectSecret%%. - */ - static getRequest(network: Network, apiKey?: null | string): FetchRequest; -} -//# sourceMappingURL=provider-chainstack.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-chainstack.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-chainstack.d.ts.map deleted file mode 100644 index 54601b2d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-chainstack.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-chainstack.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-chainstack.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EACe,YAAY,EACjC,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA6B/C;;;;;;;;GAQG;AACH,qBAAa,kBAAmB,SAAQ,eAAgB,YAAW,oBAAoB;IACnF;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAEzB;;OAEG;gBACS,QAAQ,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM;IAYzD,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB;IAO/C,mBAAmB,IAAI,OAAO;IAI9B;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY;CAe5E"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-chainstack.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-chainstack.js deleted file mode 100644 index 02b1c2e4..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-chainstack.js +++ /dev/null @@ -1,98 +0,0 @@ -/** - * [[link-chainstack]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Arbitrum (``arbitrum``) - * - BNB Smart Chain Mainnet (``bnb``) - * - Polygon (``matic``) - * - * @_subsection: api/providers/thirdparty:Chainstack [providers-chainstack] - */ -import { defineProperties, FetchRequest, assertArgument } from "../utils/index.js"; -import { showThrottleMessage } from "./community.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -function getApiKey(name) { - switch (name) { - case "mainnet": return "39f1d67cedf8b7831010a665328c9197"; - case "arbitrum": return "0550c209db33c3abf4cc927e1e18cea1"; - case "bnb": return "98b5a77e531614387366f6fc5da097f8"; - case "matic": return "cd9d4d70377471aa7c142ec4a4205249"; - } - assertArgument(false, "unsupported network", "network", name); -} -function getHost(name) { - switch (name) { - case "mainnet": - return "ethereum-mainnet.core.chainstack.com"; - case "arbitrum": - return "arbitrum-mainnet.core.chainstack.com"; - case "bnb": - return "bsc-mainnet.core.chainstack.com"; - case "matic": - return "polygon-mainnet.core.chainstack.com"; - } - assertArgument(false, "unsupported network", "network", name); -} -/** - * The **ChainstackProvider** connects to the [[link-chainstack]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-chainstack). - */ -export class ChainstackProvider extends JsonRpcProvider { - /** - * The API key for the Chainstack connection. - */ - apiKey; - /** - * Creates a new **ChainstackProvider**. - */ - constructor(_network, apiKey) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (apiKey == null) { - apiKey = getApiKey(network.name); - } - const request = ChainstackProvider.getRequest(network, apiKey); - super(request, network, { staticNetwork: network }); - defineProperties(this, { apiKey }); - } - _getProvider(chainId) { - try { - return new ChainstackProvider(chainId, this.apiKey); - } - catch (error) { } - return super._getProvider(chainId); - } - isCommunityResource() { - return (this.apiKey === getApiKey(this._network.name)); - } - /** - * Returns a prepared request for connecting to %%network%% - * with %%apiKey%% and %%projectSecret%%. - */ - static getRequest(network, apiKey) { - if (apiKey == null) { - apiKey = getApiKey(network.name); - } - const request = new FetchRequest(`https:/\/${getHost(network.name)}/${apiKey}`); - request.allowGzip = true; - if (apiKey === getApiKey(network.name)) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("ChainstackProvider"); - return true; - }; - } - return request; - } -} -//# sourceMappingURL=provider-chainstack.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-chainstack.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-chainstack.js.map deleted file mode 100644 index a149d70f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-chainstack.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-chainstack.js","sourceRoot":"","sources":["../../src.ts/providers/provider-chainstack.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EACH,gBAAgB,EAAE,YAAY,EAAE,cAAc,EACjD,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAOxD,SAAS,SAAS,CAAC,IAAY;IAC3B,QAAQ,IAAI,EAAE;QACV,KAAK,SAAS,CAAC,CAAC,OAAO,kCAAkC,CAAC;QAC1D,KAAK,UAAU,CAAC,CAAC,OAAO,kCAAkC,CAAA;QAC1D,KAAK,KAAK,CAAC,CAAC,OAAO,kCAAkC,CAAC;QACtD,KAAK,OAAO,CAAC,CAAC,OAAO,kCAAkC,CAAC;KAC3D;IAED,cAAc,CAAC,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;AAClE,CAAC;AAED,SAAS,OAAO,CAAC,IAAY;IACzB,QAAO,IAAI,EAAE;QACT,KAAK,SAAS;YACV,OAAO,sCAAsC,CAAC;QAClD,KAAK,UAAU;YACX,OAAO,sCAAsC,CAAC;QAClD,KAAK,KAAK;YACN,OAAO,iCAAiC,CAAC;QAC7C,KAAK,OAAO;YACR,OAAO,qCAAqC,CAAC;KACpD;IAED,cAAc,CAAC,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;AAClE,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,OAAO,kBAAmB,SAAQ,eAAe;IACnD;;OAEG;IACM,MAAM,CAAU;IAEzB;;OAEG;IACH,YAAY,QAAqB,EAAE,MAAsB;QACrD,IAAI,QAAQ,IAAI,IAAI,EAAE;YAAE,QAAQ,GA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AE,OAAO,EAAE,EAAE;gBACrD,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;gBAC1C,OAAO,IAAI,CAAC;YAChB,CAAC,CAAC;SACL;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-cloudflare.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-cloudflare.d.ts deleted file mode 100644 index 869651f4..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-cloudflare.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * About Cloudflare - * - * @_subsection: api/providers/thirdparty:Cloudflare [providers-cloudflare] - */ -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import type { Networkish } from "./network.js"; -/** - * About Cloudflare... - */ -export declare class CloudflareProvider extends JsonRpcProvider { - constructor(_network?: Networkish); -} -//# sourceMappingURL=provider-cloudflare.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-cloudflare.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-cloudflare.d.ts.map deleted file mode 100644 index a7469a00..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-cloudflare.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-cloudflare.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-cloudflare.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,eAAe;gBACvC,QAAQ,CAAC,EAAE,UAAU;CAMpC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-cloudflare.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-cloudflare.js deleted file mode 100644 index 3ef2e319..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-cloudflare.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * About Cloudflare - * - * @_subsection: api/providers/thirdparty:Cloudflare [providers-cloudflare] - */ -import { assertArgument } from "../utils/index.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -/** - * About Cloudflare... - */ -export class CloudflareProvider extends JsonRpcProvider { - constructor(_network) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - assertArgument(network.name === "mainnet", "unsupported network", "network", _network); - super("https:/\/cloudflare-eth.com/", network, { staticNetwork: network }); - } -} -//# sourceMappingURL=provider-cloudflare.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-cloudflare.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-cloudflare.js.map deleted file mode 100644 index 5cb493b3..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-cloudflare.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-cloudflare.js","sourceRoot":"","sources":["../../src.ts/providers/provider-cloudflare.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAIxD;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,eAAe;IACnD,YAAY,QAAqB;QAC7B,IAAI,QAAQ,IAAI,IAAI,EAAE;YAAE,QAAQ,GAAG,SAAS,CAAC;SAAE;QAC/C,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvC,cAAc,CAAC,OAAO,CAAC,IAAI,KAAK,SAAS,EAAE,qBAAqB,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;QACvF,KAAK,CAAC,8BAA8B,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-etherscan.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-etherscan.d.ts deleted file mode 100644 index bb45e4fa..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-etherscan.d.ts +++ /dev/null @@ -1,152 +0,0 @@ -/** - * [[link-etherscan]] provides a third-party service for connecting to - * various blockchains over a combination of JSON-RPC and custom API - * endpoints. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Holesky Testnet (``holesky``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Base (``base``) - * - Base Sepolia Testnet (``base-sepolia``) - * - BNB Smart Chain Mainnet (``bnb``) - * - BNB Smart Chain Testnet (``bnbt``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - Polygon Amoy Testnet (``matic-amoy``) - * - * @_subsection api/providers/thirdparty:Etherscan [providers-etherscan] - */ -import { Contract } from "../contract/index.js"; -import { AbstractProvider } from "./abstract-provider.js"; -import { Network } from "./network.js"; -import { NetworkPlugin } from "./plugins-network.js"; -import { PerformActionRequest } from "./abstract-provider.js"; -import type { Networkish } from "./network.js"; -import type { TransactionRequest } from "./provider.js"; -/** - * When subscribing to the ``"debug"`` event on an Etherscan-based - * provider, the events receive a **DebugEventEtherscanProvider** - * payload. - * - * @_docloc: api/providers/thirdparty:Etherscan - */ -export type DebugEventEtherscanProvider = { - action: "sendRequest"; - id: number; - url: string; - payload: Record; -} | { - action: "receiveRequest"; - id: number; - result: any; -} | { - action: "receiveError"; - id: number; - error: any; -}; -/** - * A Network can include an **EtherscanPlugin** to provide - * a custom base URL. - * - * @_docloc: api/providers/thirdparty:Etherscan - */ -export declare class EtherscanPlugin extends NetworkPlugin { - /** - * The Etherscan API base URL. - */ - readonly baseUrl: string; - /** - * Creates a new **EtherscanProvider** which will use - * %%baseUrl%%. - */ - constructor(baseUrl: string); - clone(): EtherscanPlugin; -} -/** - * The **EtherscanBaseProvider** is the super-class of - * [[EtherscanProvider]], which should generally be used instead. - * - * Since the **EtherscanProvider** includes additional code for - * [[Contract]] access, in //rare cases// that contracts are not - * used, this class can reduce code size. - * - * @_docloc: api/providers/thirdparty:Etherscan - */ -export declare class EtherscanProvider extends AbstractProvider { - #private; - /** - * The connected network. - */ - readonly network: Network; - /** - * The API key or null if using the community provided bandwidth. - */ - readonly apiKey: null | string; - /** - * Creates a new **EtherscanBaseProvider**. - */ - constructor(_network?: Networkish, _apiKey?: string); - /** - * Returns the base URL. - * - * If an [[EtherscanPlugin]] is configured on the - * [[EtherscanBaseProvider_network]], returns the plugin's - * baseUrl. - * - * Deprecated; for Etherscan v2 the base is no longer a simply - * host, but instead a URL including a chainId parameter. Changing - * this to return a URL prefix could break some libraries, so it - * is left intact but will be removed in the future as it is unused. - */ - getBaseUrl(): string; - /** - * Returns the URL for the %%module%% and %%params%%. - */ - getUrl(module: string, params: Record): string; - /** - * Returns the URL for using POST requests. - */ - getPostUrl(): string; - /** - * Returns the parameters for using POST requests. - */ - getPostData(module: string, params: Record): Record; - detectNetwork(): Promise; - /** - * Resolves to the result of calling %%module%% with %%params%%. - * - * If %%post%%, the request is made as a POST request. - */ - fetch(module: string, params: Record, post?: boolean): Promise; - /** - * Returns %%transaction%% normalized for the Etherscan API. - */ - _getTransactionPostData(transaction: TransactionRequest): Record; - /** - * Throws the normalized Etherscan error. - */ - _checkError(req: PerformActionRequest, error: Error, transaction: any): never; - _detectNetwork(): Promise; - _perform(req: PerformActionRequest): Promise; - getNetwork(): Promise; - /** - * Resolves to the current price of ether. - * - * This returns ``0`` on any network other than ``mainnet``. - */ - getEtherPrice(): Promise; - /** - * Resolves to a [Contract]] for %%address%%, using the - * Etherscan API to retreive the Contract ABI. - */ - getContract(_address: string): Promise; - isCommunityResource(): boolean; -} -//# sourceMappingURL=provider-etherscan.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-etherscan.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-etherscan.d.ts.map deleted file mode 100644 index 4837002e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-etherscan.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-etherscan.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-etherscan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAWhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAmBxD;;;;;;GAMG;AACH,MAAM,MAAM,2BAA2B,GAAG;IACtC,MAAM,EAAE,aAAa,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC/B,GAAG;IACA,MAAM,EAAE,gBAAgB,CAAC;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,G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WAAW,CAAC,GAAG,EAAE,oBAAoB,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,GAAG,KAAK;IAgEvE,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;IAIlC,QAAQ,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC;IAsMjD,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;IAIpC;;;;OAIG;IACG,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;IAKtC;;;OAGG;IACG,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,QAAQ,CAAC;IAc7D,mBAAmB,IAAI,OAAO;CAGjC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-etherscan.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-etherscan.js deleted file mode 100644 index f84921de..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-etherscan.js +++ /dev/null @@ -1,598 +0,0 @@ -/** - * [[link-etherscan]] provides a third-party service for connecting to - * various blockchains over a combination of JSON-RPC and custom API - * endpoints. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Holesky Testnet (``holesky``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Base (``base``) - * - Base Sepolia Testnet (``base-sepolia``) - * - BNB Smart Chain Mainnet (``bnb``) - * - BNB Smart Chain Testnet (``bnbt``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - Polygon Amoy Testnet (``matic-amoy``) - * - * @_subsection api/providers/thirdparty:Etherscan [providers-etherscan] - */ -import { AbiCoder } from "../abi/index.js"; -import { Contract } from "../contract/index.js"; -import { accessListify, Transaction } from "../transaction/index.js"; -import { defineProperties, hexlify, toQuantity, FetchRequest, assert, assertArgument, isError, -// parseUnits, -toUtf8String } from "../utils/index.js"; -import { AbstractProvider } from "./abstract-provider.js"; -import { Network } from "./network.js"; -import { NetworkPlugin } from "./plugins-network.js"; -import { showThrottleMessage } from "./community.js"; -// See: https://docs.etherscan.io/supported-chains -const Supported = ("1 11155111 17000 560048 2741 11124 33111 33139 42170 " + - "42161 421614 43114 43113 8453 84532 80069 80094 199 1029 81457 " + - "168587773 56 97 42220 11142220 252 2523 100 999 737373 747474 " + - "59144 59141 5000 5003 43521 143 10143 1287 1284 1285 10 " + - "11155420 204 5611 80002 137 534352 534351 1329 1328 146 14601 " + - "988 2201 1923 1924 167013 167000 130 1301 480 4801 51 50 324 300").split(/ /g); -const THROTTLE = 2000; -function isPromise(value) { - return (value && typeof (value.then) === "function"); -} -const EtherscanPluginId = "org.ethers.plugins.provider.Etherscan"; -/** - * A Network can include an **EtherscanPlugin** to provide - * a custom base URL. - * - * @_docloc: api/providers/thirdparty:Etherscan - */ -export class EtherscanPlugin extends NetworkPlugin { - /** - * The Etherscan API base URL. - */ - baseUrl; - /** - * Creates a new **EtherscanProvider** which will use - * %%baseUrl%%. - */ - constructor(baseUrl) { - super(EtherscanPluginId); - defineProperties(this, { baseUrl }); - } - clone() { - return new EtherscanPlugin(this.baseUrl); - } -} -const skipKeys = ["enableCcipRead"]; -let nextId = 1; -/** - * The **EtherscanBaseProvider** is the super-class of - * [[EtherscanProvider]], which should generally be used instead. - * - * Since the **EtherscanProvider** includes additional code for - * [[Contract]] access, in //rare cases// that contracts are not - * used, this class can reduce code size. - * - * @_docloc: api/providers/thirdparty:Etherscan - */ -export class EtherscanProvider extends AbstractProvider { - /** - * The connected network. - */ - network; - /** - * The API key or null if using the community provided bandwidth. - */ - apiKey; - #plugin; - /** - * Creates a new **EtherscanBaseProvider**. - */ - constructor(_network, _apiKey) { - const apiKey = (_apiKey != null) ? _apiKey : null; - super(); - const network = Network.from(_network); - assertArgument(Supported.indexOf(`${network.chainId}`) >= 0, "unsupported network", "network", network); - this.#plugin = network.getPlugin(EtherscanPluginId); - defineProperties(this, { apiKey, network }); - } - /** - * Returns the base URL. - * - * If an [[EtherscanPlugin]] is configured on the - * [[EtherscanBaseProvider_network]], returns the plugin's - * baseUrl. - * - * Deprecated; for Etherscan v2 the base is no longer a simply - * host, but instead a URL including a chainId parameter. Changing - * this to return a URL prefix could break some libraries, so it - * is left intact but will be removed in the future as it is unused. - */ - getBaseUrl() { - if (this.#plugin) { - return this.#plugin.baseUrl; - } - switch (this.network.name) { - case "mainnet": - return "https:/\/api.etherscan.io"; - case "goerli": - return "https:/\/api-goerli.etherscan.io"; - case "sepolia": - return "https:/\/api-sepolia.etherscan.io"; - case "holesky": - return "https:/\/api-holesky.etherscan.io"; - case "arbitrum": - return "https:/\/api.arbiscan.io"; - case "arbitrum-goerli": - return "https:/\/api-goerli.arbiscan.io"; - case "base": - return "https:/\/api.basescan.org"; - case "base-sepolia": - return "https:/\/api-sepolia.basescan.org"; - case "bnb": - return "https:/\/api.bscscan.com"; - case "bnbt": - return "https:/\/api-testnet.bscscan.com"; - case "matic": - return "https:/\/api.polygonscan.com"; - case "matic-amoy": - return "https:/\/api-amoy.polygonscan.com"; - case "matic-mumbai": - return "https:/\/api-testnet.polygonscan.com"; - case "optimism": - return "https:/\/api-optimistic.etherscan.io"; - case "optimism-goerli": - return "https:/\/api-goerli-optimistic.etherscan.io"; - default: - } - assertArgument(false, "unsupported network", "network", this.network); - } - /** - * Returns the URL for the %%module%% and %%params%%. - */ - getUrl(module, params) { - let query = Object.keys(params).reduce((accum, key) => { - const value = params[key]; - if (value != null) { - accum += `&${key}=${value}`; - } - return accum; - }, ""); - if (this.apiKey) { - query += `&apikey=${this.apiKey}`; - } - return `https:/\/api.etherscan.io/v2/api?chainid=${this.network.chainId}&module=${module}${query}`; - } - /** - * Returns the URL for using POST requests. - */ - getPostUrl() { - return `https:/\/api.etherscan.io/v2/api?chainid=${this.network.chainId}`; - } - /** - * Returns the parameters for using POST requests. - */ - getPostData(module, params) { - params.module = module; - params.apikey = this.apiKey; - params.chainid = this.network.chainId; - return params; - } - async detectNetwork() { - return this.network; - } - /** - * Resolves to the result of calling %%module%% with %%params%%. - * - * If %%post%%, the request is made as a POST request. - */ - async fetch(module, params, post) { - const id = nextId++; - const url = (post ? this.getPostUrl() : this.getUrl(module, params)); - const payload = (post ? this.getPostData(module, params) : null); - this.emit("debug", { action: "sendRequest", id, url, payload: payload }); - const request = new FetchRequest(url); - request.setThrottleParams({ slotInterval: 1000 }); - request.retryFunc = (req, resp, attempt) => { - if (this.isCommunityResource()) { - showThrottleMessage("Etherscan"); - } - return Promise.resolve(true); - }; - request.processFunc = async (request, response) => { - const result = response.hasBody() ? JSON.parse(toUtf8String(response.body)) : {}; - const throttle = ((typeof (result.result) === "string") ? result.result : "").toLowerCase().indexOf("rate limit") >= 0; - if (module === "proxy") { - // This JSON response indicates we are being throttled - if (result && result.status == 0 && result.message == "NOTOK" && throttle) { - this.emit("debug", { action: "receiveError", id, reason: "proxy-NOTOK", error: result }); - response.throwThrottleError(result.result, THROTTLE); - } - } - else { - if (throttle) { - this.emit("debug", { action: "receiveError", id, reason: "null result", error: result.result }); - response.throwThrottleError(result.result, THROTTLE); - } - } - return response; - }; - if (payload) { - request.setHeader("content-type", "application/x-www-form-urlencoded; charset=UTF-8"); - request.body = Object.keys(payload).map((k) => `${k}=${payload[k]}`).join("&"); - } - const response = await request.send(); - try { - response.assertOk(); - } - catch (error) { - this.emit("debug", { action: "receiveError", id, error, reason: "assertOk" }); - assert(false, "response error", "SERVER_ERROR", { request, response }); - } - if (!response.hasBody()) { - this.emit("debug", { action: "receiveError", id, error: "missing body", reason: "null body" }); - assert(false, "missing response", "SERVER_ERROR", { request, response }); - } - const result = JSON.parse(toUtf8String(response.body)); - if (module === "proxy") { - if (result.jsonrpc != "2.0") { - this.emit("debug", { action: "receiveError", id, result, reason: "invalid JSON-RPC" }); - assert(false, "invalid JSON-RPC response (missing jsonrpc='2.0')", "SERVER_ERROR", { request, response, info: { result } }); - } - if (result.error) { - this.emit("debug", { action: "receiveError", id, result, reason: "JSON-RPC error" }); - assert(false, "error response", "SERVER_ERROR", { request, response, info: { result } }); - } - this.emit("debug", { action: "receiveRequest", id, result }); - return result.result; - } - else { - // getLogs, getHistory have weird success responses - if (result.status == 0 && (result.message === "No records found" || result.message === "No transactions found")) { - this.emit("debug", { action: "receiveRequest", id, result }); - return result.result; - } - if (result.status != 1 || (typeof (result.message) === "string" && !result.message.match(/^OK/))) { - this.emit("debug", { action: "receiveError", id, result }); - assert(false, "error response", "SERVER_ERROR", { request, response, info: { result } }); - } - this.emit("debug", { action: "receiveRequest", id, result }); - return result.result; - } - } - /** - * Returns %%transaction%% normalized for the Etherscan API. - */ - _getTransactionPostData(transaction) { - const result = {}; - for (let key in transaction) { - if (skipKeys.indexOf(key) >= 0) { - continue; - } - if (transaction[key] == null) { - continue; - } - let value = transaction[key]; - if (key === "type" && value === 0) { - continue; - } - if (key === "blockTag" && value === "latest") { - continue; - } - // Quantity-types require no leading zero, unless 0 - if ({ type: true, gasLimit: true, gasPrice: true, maxFeePerGs: true, maxPriorityFeePerGas: true, nonce: true, value: true }[key]) { - value = toQuantity(value); - } - else if (key === "accessList") { - value = "[" + accessListify(value).map((set) => { - return `{address:"${set.address}",storageKeys:["${set.storageKeys.join('","')}"]}`; - }).join(",") + "]"; - } - else if (key === "blobVersionedHashes") { - if (value.length === 0) { - continue; - } - // @TODO: update this once the API supports blobs - assert(false, "Etherscan API does not support blobVersionedHashes", "UNSUPPORTED_OPERATION", { - operation: "_getTransactionPostData", - info: { transaction } - }); - } - else { - value = hexlify(value); - } - result[key] = value; - } - return result; - } - /** - * Throws the normalized Etherscan error. - */ - _checkError(req, error, transaction) { - // Pull any message out if, possible - let message = ""; - if (isError(error, "SERVER_ERROR")) { - // Check for an error emitted by a proxy call - try { - message = error.info.result.error.message; - } - catch (e) { } - if (!message) { - try { - message = error.info.message; - } - catch (e) { } - } - } - if (req.method === "estimateGas") { - if (!message.match(/revert/i) && message.match(/insufficient funds/i)) { - assert(false, "insufficient funds", "INSUFFICIENT_FUNDS", { - transaction: req.transaction - }); - } - } - if (req.method === "call" || req.method === "estimateGas") { - if (message.match(/execution reverted/i)) { - let data = ""; - try { - data = error.info.result.error.data; - } - catch (error) { } - const e = AbiCoder.getBuiltinCallException(req.method, req.transaction, data); - e.info = { request: req, error }; - throw e; - } - } - if (message) { - if (req.method === "broadcastTransaction") { - const transaction = Transaction.from(req.signedTransaction); - if (message.match(/replacement/i) && message.match(/underpriced/i)) { - assert(false, "replacement fee too low", "REPLACEMENT_UNDERPRICED", { - transaction - }); - } - if (message.match(/insufficient funds/)) { - assert(false, "insufficient funds for intrinsic transaction cost", "INSUFFICIENT_FUNDS", { - transaction - }); - } - if (message.match(/same hash was already imported|transaction nonce is too low|nonce too low/)) { - assert(false, "nonce has already been used", "NONCE_EXPIRED", { - transaction - }); - } - } - } - // Something we could not process - throw error; - } - async _detectNetwork() { - return this.network; - } - async _perform(req) { - switch (req.method) { - case "chainId": - return this.network.chainId; - case "getBlockNumber": - return this.fetch("proxy", { action: "eth_blockNumber" }); - case "getGasPrice": - return this.fetch("proxy", { action: "eth_gasPrice" }); - case "getPriorityFee": - // This is temporary until Etherscan completes support - if (this.network.name === "mainnet") { - return "1000000000"; - } - else if (this.network.name === "optimism") { - return "1000000"; - } - else { - throw new Error("fallback onto the AbstractProvider default"); - } - /* Working with Etherscan to get this added: - try { - const test = await this.fetch("proxy", { - action: "eth_maxPriorityFeePerGas" - }); - console.log(test); - return test; - } catch (e) { - console.log("DEBUG", e); - throw e; - } - */ - /* This might be safe; but due to rounding neither myself - or Etherscan are necessarily comfortable with this. :) - try { - const result = await this.fetch("gastracker", { action: "gasoracle" }); - console.log(result); - const gasPrice = parseUnits(result.SafeGasPrice, "gwei"); - const baseFee = parseUnits(result.suggestBaseFee, "gwei"); - const priorityFee = gasPrice - baseFee; - if (priorityFee < 0) { throw new Error("negative priority fee; defer to abstract provider default"); } - return priorityFee; - } catch (error) { - console.log("DEBUG", error); - throw error; - } - */ - case "getBalance": - // Returns base-10 result - return this.fetch("account", { - action: "balance", - address: req.address, - tag: req.blockTag - }); - case "getTransactionCount": - return this.fetch("proxy", { - action: "eth_getTransactionCount", - address: req.address, - tag: req.blockTag - }); - case "getCode": - return this.fetch("proxy", { - action: "eth_getCode", - address: req.address, - tag: req.blockTag - }); - case "getStorage": - return this.fetch("proxy", { - action: "eth_getStorageAt", - address: req.address, - position: req.position, - tag: req.blockTag - }); - case "broadcastTransaction": - return this.fetch("proxy", { - action: "eth_sendRawTransaction", - hex: req.signedTransaction - }, true).catch((error) => { - return this._checkError(req, error, req.signedTransaction); - }); - case "getBlock": - if ("blockTag" in req) { - return this.fetch("proxy", { - action: "eth_getBlockByNumber", - tag: req.blockTag, - boolean: (req.includeTransactions ? "true" : "false") - }); - } - assert(false, "getBlock by blockHash not supported by Etherscan", "UNSUPPORTED_OPERATION", { - operation: "getBlock(blockHash)" - }); - case "getTransaction": - return this.fetch("proxy", { - action: "eth_getTransactionByHash", - txhash: req.hash - }); - case "getTransactionReceipt": - return this.fetch("proxy", { - action: "eth_getTransactionReceipt", - txhash: req.hash - }); - case "call": { - if (req.blockTag !== "latest") { - throw new Error("EtherscanProvider does not support blockTag for call"); - } - const postData = this._getTransactionPostData(req.transaction); - postData.module = "proxy"; - postData.action = "eth_call"; - try { - return await this.fetch("proxy", postData, true); - } - catch (error) { - return this._checkError(req, error, req.transaction); - } - } - case "estimateGas": { - const postData = this._getTransactionPostData(req.transaction); - postData.module = "proxy"; - postData.action = "eth_estimateGas"; - try { - return await this.fetch("proxy", postData, true); - } - catch (error) { - return this._checkError(req, error, req.transaction); - } - } - /* - case "getLogs": { - // Needs to complain if more than one address is passed in - const args: Record = { action: "getLogs" } - - if (params.filter.fromBlock) { - args.fromBlock = checkLogTag(params.filter.fromBlock); - } - - if (params.filter.toBlock) { - args.toBlock = checkLogTag(params.filter.toBlock); - } - - if (params.filter.address) { - args.address = params.filter.address; - } - - // @TODO: We can handle slightly more complicated logs using the logs API - if (params.filter.topics && params.filter.topics.length > 0) { - if (params.filter.topics.length > 1) { - logger.throwError("unsupported topic count", Logger.Errors.UNSUPPORTED_OPERATION, { topics: params.filter.topics }); - } - if (params.filter.topics.length === 1) { - const topic0 = params.filter.topics[0]; - if (typeof(topic0) !== "string" || topic0.length !== 66) { - logger.throwError("unsupported topic format", Logger.Errors.UNSUPPORTED_OPERATION, { topic0: topic0 }); - } - args.topic0 = topic0; - } - } - - const logs: Array = await this.fetch("logs", args); - - // Cache txHash => blockHash - let blocks: { [tag: string]: string } = {}; - - // Add any missing blockHash to the logs - for (let i = 0; i < logs.length; i++) { - const log = logs[i]; - if (log.blockHash != null) { continue; } - if (blocks[log.blockNumber] == null) { - const block = await this.getBlock(log.blockNumber); - if (block) { - blocks[log.blockNumber] = block.hash; - } - } - - log.blockHash = blocks[log.blockNumber]; - } - - return logs; - } - */ - default: - break; - } - return super._perform(req); - } - async getNetwork() { - return this.network; - } - /** - * Resolves to the current price of ether. - * - * This returns ``0`` on any network other than ``mainnet``. - */ - async getEtherPrice() { - if (this.network.name !== "mainnet") { - return 0.0; - } - return parseFloat((await this.fetch("stats", { action: "ethprice" })).ethusd); - } - /** - * Resolves to a [Contract]] for %%address%%, using the - * Etherscan API to retreive the Contract ABI. - */ - async getContract(_address) { - let address = this._getAddress(_address); - if (isPromise(address)) { - address = await address; - } - try { - const resp = await this.fetch("contract", { - action: "getabi", address - }); - const abi = JSON.parse(resp); - return new Contract(address, abi, this); - } - catch (error) { - return null; - } - } - isCommunityResource() { - return (this.apiKey == null); - } -} -//# sourceMappingURL=provider-etherscan.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-etherscan.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-etherscan.js.map deleted file mode 100644 index 8afce700..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-etherscan.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-etherscan.js","sourceRoot":"","sources":["../../src.ts/providers/provider-etherscan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EACH,gBAAgB,EAChB,OAAO,EAAE,UAAU,EACnB,YAAY,EACZ,MAAM,EAAE,cAAc,EAAE,OAAO;AACnC,iBAAiB;AACb,YAAY,EACd,MAAM,mBAAmB,CAAC;AAE5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAOrD,kDAAkD;AAClD,MAAM,SAAS,GAAG,CACd,uDAAuD;IACvD,iEAAiE;IACjE,gEAAgE;IAChE,0DAA0D;IAC1D,gEAAgE;IAChE,kEAAkE,CACrE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAEd,MAAM,QAAQ,GAAG,IAAI,CAAC;AAEtB,SAAS,SAAS,CAAU,KAAU;IAClC,OAAO,CAAC,KAAK,IAAI,OAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,UAAU,CAAC,CAAC;AACxD,CAAC;AAyBD,MAAM,iBAAiB,GAAG,uCAAuC,CAAC;AAElE;;;;;GAKG;AACH,MAAM,OAAO,eAAgB,SAAQ,aAAa;IAC9C;;OAEG;IACM,OAAO,CAAU;IAE1B;;;OAGG;IACH,YAAY,OAAe;QACvB,KAAK,CAAC,iBAAiB,CA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OAAO,IAAI,CAAC;SACf;IACL,CAAC;IAED,mBAAmB;QACf,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC;IACjC,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-fallback.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-fallback.d.ts deleted file mode 100644 index 39d79352..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-fallback.d.ts +++ /dev/null @@ -1,115 +0,0 @@ -import { AbstractProvider } from "./abstract-provider.js"; -import { Network } from "./network.js"; -import type { PerformActionRequest } from "./abstract-provider.js"; -import type { Networkish } from "./network.js"; -/** - * A configuration entry for how to use a [[Provider]]. - */ -export interface FallbackProviderConfig { - /** - * The provider. - */ - provider: AbstractProvider; - /** - * The amount of time to wait before kicking off the next provider. - * - * Any providers that have not responded can still respond and be - * counted, but this ensures new providers start. - */ - stallTimeout?: number; - /** - * The priority. Lower priority providers are dispatched first. - */ - priority?: number; - /** - * The amount of weight a provider is given against the quorum. - */ - weight?: number; -} -/** - * The statistics and state maintained for a [[Provider]]. - */ -export interface FallbackProviderState extends Required { - /** - * The most recent blockNumber this provider has reported (-2 if none). - */ - blockNumber: number; - /** - * The number of total requests ever sent to this provider. - */ - requests: number; - /** - * The number of responses that errored. - */ - errorResponses: number; - /** - * The number of responses that occured after the result resolved. - */ - lateResponses: number; - /** - * How many times syncing was required to catch up the expected block. - */ - outOfSync: number; - /** - * The number of requests which reported unsupported operation. - */ - unsupportedEvents: number; - /** - * A rolling average (5% current duration) for response time. - */ - rollingDuration: number; - /** - * The ratio of quorum-agreed results to total. - */ - score: number; -} -/** - * Additional options to configure a [[FallbackProvider]]. - */ -export type FallbackProviderOptions = { - quorum?: number; - eventQuorum?: number; - eventWorkers?: number; - cacheTimeout?: number; - pollingInterval?: number; -}; -/** - * A **FallbackProvider** manages several [[Providers]] providing - * resilience by switching between slow or misbehaving nodes, security - * by requiring multiple backends to aggree and performance by allowing - * faster backends to respond earlier. - * - */ -export declare class FallbackProvider extends AbstractProvider { - #private; - /** - * The number of backends that must agree on a value before it is - * accpeted. - */ - readonly quorum: number; - /** - * @_ignore: - */ - readonly eventQuorum: number; - /** - * @_ignore: - */ - readonly eventWorkers: number; - /** - * Creates a new **FallbackProvider** with %%providers%% connected to - * %%network%%. - * - * If a [[Provider]] is included in %%providers%%, defaults are used - * for the configuration. - */ - constructor(providers: Array, network?: Networkish, options?: FallbackProviderOptions); - get providerConfigs(): Array; - _detectNetwork(): Promise; - /** - * Transforms a %%req%% into the correct method call on %%provider%%. - */ - _translatePerform(provider: AbstractProvider, req: PerformActionRequest): Promise; - _perform(req: PerformActionRequest): Promise; - destroy(): Promise; -} -//# sourceMappingURL=provider-fallback.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-fallback.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-fallback.d.ts.map deleted file mode 100644 index 8aa88fa2..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-fallback.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-fallback.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-fallback.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AA6B9C;;GAEG;AACH,MAAM,WAAW,sBAAsB;IAEnC;;OAEG;IACH,QAAQ,EAAE,gBAAgB,CAAC;IAE3B;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IA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EAAE,gBAAgB,EAAE,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC;IA6QtF,QAAQ,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,CAAC,CAAC;IA8ExD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAMjC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-fallback.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-fallback.js deleted file mode 100644 index bf330fb7..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-fallback.js +++ /dev/null @@ -1,620 +0,0 @@ -/** - * A **FallbackProvider** provides resilience, security and performance - * in a way that is customizable and configurable. - * - * @_section: api/providers/fallback-provider:Fallback Provider [about-fallback-provider] - */ -import { assert, assertArgument, getBigInt, getNumber, isError } from "../utils/index.js"; -import { AbstractProvider } from "./abstract-provider.js"; -import { Network } from "./network.js"; -const BN_1 = BigInt("1"); -const BN_2 = BigInt("2"); -function shuffle(array) { - for (let i = array.length - 1; i > 0; i--) { - const j = Math.floor(Math.random() * (i + 1)); - const tmp = array[i]; - array[i] = array[j]; - array[j] = tmp; - } -} -function stall(duration) { - return new Promise((resolve) => { setTimeout(resolve, duration); }); -} -function getTime() { return (new Date()).getTime(); } -function stringify(value) { - return JSON.stringify(value, (key, value) => { - if (typeof (value) === "bigint") { - return { type: "bigint", value: value.toString() }; - } - return value; - }); -} -; -const defaultConfig = { stallTimeout: 400, priority: 1, weight: 1 }; -const defaultState = { - blockNumber: -2, requests: 0, lateResponses: 0, errorResponses: 0, - outOfSync: -1, unsupportedEvents: 0, rollingDuration: 0, score: 0, - _network: null, _updateNumber: null, _totalTime: 0, - _lastFatalError: null, _lastFatalErrorTimestamp: 0 -}; -async function waitForSync(config, blockNumber) { - while (config.blockNumber < 0 || config.blockNumber < blockNumber) { - if (!config._updateNumber) { - config._updateNumber = (async () => { - try { - const blockNumber = await config.provider.getBlockNumber(); - if (blockNumber > config.blockNumber) { - config.blockNumber = blockNumber; - } - } - catch (error) { - config.blockNumber = -2; - config._lastFatalError = error; - config._lastFatalErrorTimestamp = getTime(); - } - config._updateNumber = null; - })(); - } - await config._updateNumber; - config.outOfSync++; - if (config._lastFatalError) { - break; - } - } -} -function _normalize(value) { - if (value == null) { - return "null"; - } - if (Array.isArray(value)) { - return "[" + (value.map(_normalize)).join(",") + "]"; - } - if (typeof (value) === "object" && typeof (value.toJSON) === "function") { - return _normalize(value.toJSON()); - } - switch (typeof (value)) { - case "boolean": - case "symbol": - return value.toString(); - case "bigint": - case "number": - return BigInt(value).toString(); - case "string": - return JSON.stringify(value); - case "object": { - const keys = Object.keys(value); - keys.sort(); - return "{" + keys.map((k) => `${JSON.stringify(k)}:${_normalize(value[k])}`).join(",") + "}"; - } - } - console.log("Could not serialize", value); - throw new Error("Hmm..."); -} -function normalizeResult(method, value) { - if ("error" in value) { - const error = value.error; - let tag; - if (isError(error, "CALL_EXCEPTION")) { - tag = _normalize(Object.assign({}, error, { - shortMessage: undefined, reason: undefined, info: undefined - })); - } - else { - tag = _normalize(error); - } - return { tag, value: error }; - } - const result = value.result; - return { tag: _normalize(result), value: result }; -} -// This strategy picks the highest weight result, as long as the weight is -// equal to or greater than quorum -function checkQuorum(quorum, results) { - const tally = new Map(); - for (const { value, tag, weight } of results) { - const t = tally.get(tag) || { value, weight: 0 }; - t.weight += weight; - tally.set(tag, t); - } - let best = null; - for (const r of tally.values()) { - if (r.weight >= quorum && (!best || r.weight > best.weight)) { - best = r; - } - } - if (best) { - return best.value; - } - return undefined; -} -function getMedian(quorum, results) { - let resultWeight = 0; - const errorMap = new Map(); - let bestError = null; - const values = []; - for (const { value, tag, weight } of results) { - if (value instanceof Error) { - const e = errorMap.get(tag) || { value, weight: 0 }; - e.weight += weight; - errorMap.set(tag, e); - if (bestError == null || e.weight > bestError.weight) { - bestError = e; - } - } - else { - values.push(BigInt(value)); - resultWeight += weight; - } - } - if (resultWeight < quorum) { - // We have quorum for an error - if (bestError && bestError.weight >= quorum) { - return bestError.value; - } - // We do not have quorum for a result - return undefined; - } - // Get the sorted values - values.sort((a, b) => ((a < b) ? -1 : (b > a) ? 1 : 0)); - const mid = Math.floor(values.length / 2); - // Odd-length; take the middle value - if (values.length % 2) { - return values[mid]; - } - // Even length; take the ceiling of the mean of the center two values - return (values[mid - 1] + values[mid] + BN_1) / BN_2; -} -function getAnyResult(quorum, results) { - // If any value or error meets quorum, that is our preferred result - const result = checkQuorum(quorum, results); - if (result !== undefined) { - return result; - } - // Otherwise, do we have any result? - for (const r of results) { - if (r.value) { - return r.value; - } - } - // Nope! - return undefined; -} -function getFuzzyMode(quorum, results) { - if (quorum === 1) { - return getNumber(getMedian(quorum, results), "%internal"); - } - const tally = new Map(); - const add = (result, weight) => { - const t = tally.get(result) || { result, weight: 0 }; - t.weight += weight; - tally.set(result, t); - }; - for (const { weight, value } of results) { - const r = getNumber(value); - add(r - 1, weight); - add(r, weight); - add(r + 1, weight); - } - let bestWeight = 0; - let bestResult = undefined; - for (const { weight, result } of tally.values()) { - // Use this result, if this result meets quorum and has either: - // - a better weight - // - or equal weight, but the result is larger - if (weight >= quorum && (weight > bestWeight || (bestResult != null && weight === bestWeight && result > bestResult))) { - bestWeight = weight; - bestResult = result; - } - } - return bestResult; -} -/** - * A **FallbackProvider** manages several [[Providers]] providing - * resilience by switching between slow or misbehaving nodes, security - * by requiring multiple backends to aggree and performance by allowing - * faster backends to respond earlier. - * - */ -export class FallbackProvider extends AbstractProvider { - /** - * The number of backends that must agree on a value before it is - * accpeted. - */ - quorum; - /** - * @_ignore: - */ - eventQuorum; - /** - * @_ignore: - */ - eventWorkers; - #configs; - #height; - #initialSyncPromise; - /** - * Creates a new **FallbackProvider** with %%providers%% connected to - * %%network%%. - * - * If a [[Provider]] is included in %%providers%%, defaults are used - * for the configuration. - */ - constructor(providers, network, options) { - super(network, options); - this.#configs = providers.map((p) => { - if (p instanceof AbstractProvider) { - return Object.assign({ provider: p }, defaultConfig, defaultState); - } - else { - return Object.assign({}, defaultConfig, p, defaultState); - } - }); - this.#height = -2; - this.#initialSyncPromise = null; - if (options && options.quorum != null) { - this.quorum = options.quorum; - } - else { - this.quorum = Math.ceil(this.#configs.reduce((accum, config) => { - accum += config.weight; - return accum; - }, 0) / 2); - } - this.eventQuorum = 1; - this.eventWorkers = 1; - assertArgument(this.quorum <= this.#configs.reduce((a, c) => (a + c.weight), 0), "quorum exceed provider weight", "quorum", this.quorum); - } - get providerConfigs() { - return this.#configs.map((c) => { - const result = Object.assign({}, c); - for (const key in result) { - if (key[0] === "_") { - delete result[key]; - } - } - return result; - }); - } - async _detectNetwork() { - return Network.from(getBigInt(await this._perform({ method: "chainId" }))); - } - // @TODO: Add support to select providers to be the event subscriber - //_getSubscriber(sub: Subscription): Subscriber { - // throw new Error("@TODO"); - //} - /** - * Transforms a %%req%% into the correct method call on %%provider%%. - */ - async _translatePerform(provider, req) { - switch (req.method) { - case "broadcastTransaction": - return await provider.broadcastTransaction(req.signedTransaction); - case "call": - return await provider.call(Object.assign({}, req.transaction, { blockTag: req.blockTag })); - case "chainId": - return (await provider.getNetwork()).chainId; - case "estimateGas": - return await provider.estimateGas(req.transaction); - case "getBalance": - return await provider.getBalance(req.address, req.blockTag); - case "getBlock": { - const block = ("blockHash" in req) ? req.blockHash : req.blockTag; - return await provider.getBlock(block, req.includeTransactions); - } - case "getBlockNumber": - return await provider.getBlockNumber(); - case "getCode": - return await provider.getCode(req.address, req.blockTag); - case "getGasPrice": - return (await provider.getFeeData()).gasPrice; - case "getPriorityFee": - return (await provider.getFeeData()).maxPriorityFeePerGas; - case "getLogs": - return await provider.getLogs(req.filter); - case "getStorage": - return await provider.getStorage(req.address, req.position, req.blockTag); - case "getTransaction": - return await provider.getTransaction(req.hash); - case "getTransactionCount": - return await provider.getTransactionCount(req.address, req.blockTag); - case "getTransactionReceipt": - return await provider.getTransactionReceipt(req.hash); - case "getTransactionResult": - return await provider.getTransactionResult(req.hash); - } - } - // Grab the next (random) config that is not already part of - // the running set - #getNextConfig(running) { - // @TODO: Maybe do a check here to favour (heavily) providers that - // do not require waitForSync and disfavour providers that - // seem down-ish or are behaving slowly - const configs = Array.from(running).map((r) => r.config); - // Shuffle the states, sorted by priority - const allConfigs = this.#configs.slice(); - shuffle(allConfigs); - allConfigs.sort((a, b) => (a.priority - b.priority)); - for (const config of allConfigs) { - if (config._lastFatalError) { - continue; - } - if (configs.indexOf(config) === -1) { - return config; - } - } - return null; - } - // Adds a new runner (if available) to running. - #addRunner(running, req) { - const config = this.#getNextConfig(running); - // No runners available - if (config == null) { - return null; - } - // Create a new runner - const runner = { - config, result: null, didBump: false, - perform: null, staller: null - }; - const now = getTime(); - // Start performing this operation - runner.perform = (async () => { - try { - config.requests++; - const result = await this._translatePerform(config.provider, req); - runner.result = { result }; - } - catch (error) { - config.errorResponses++; - runner.result = { error }; - } - const dt = (getTime() - now); - config._totalTime += dt; - config.rollingDuration = 0.95 * config.rollingDuration + 0.05 * dt; - runner.perform = null; - })(); - // Start a staller; when this times out, it's time to force - // kicking off another runner because we are taking too long - runner.staller = (async () => { - await stall(config.stallTimeout); - runner.staller = null; - })(); - running.add(runner); - return runner; - } - // Initializes the blockNumber and network for each runner and - // blocks until initialized - async #initialSync() { - let initialSync = this.#initialSyncPromise; - if (!initialSync) { - const promises = []; - this.#configs.forEach((config) => { - promises.push((async () => { - await waitForSync(config, 0); - if (!config._lastFatalError) { - config._network = await config.provider.getNetwork(); - } - })()); - }); - this.#initialSyncPromise = initialSync = (async () => { - // Wait for all providers to have a block number and network - await Promise.all(promises); - // Check all the networks match - let chainId = null; - for (const config of this.#configs) { - if (config._lastFatalError) { - continue; - } - const network = (config._network); - if (chainId == null) { - chainId = network.chainId; - } - else if (network.chainId !== chainId) { - assert(false, "cannot mix providers on different networks", "UNSUPPORTED_OPERATION", { - operation: "new FallbackProvider" - }); - } - } - })(); - } - await initialSync; - } - async #checkQuorum(running, req) { - // Get all the result objects - const results = []; - for (const runner of running) { - if (runner.result != null) { - const { tag, value } = normalizeResult(req.method, runner.result); - results.push({ tag, value, weight: runner.config.weight }); - } - } - // Are there enough results to event meet quorum? - if (results.reduce((a, r) => (a + r.weight), 0) < this.quorum) { - return undefined; - } - switch (req.method) { - case "getBlockNumber": { - // We need to get the bootstrap block height - if (this.#height === -2) { - this.#height = Math.ceil(getNumber(getMedian(this.quorum, this.#configs.filter((c) => (!c._lastFatalError)).map((c) => ({ - value: c.blockNumber, - tag: getNumber(c.blockNumber).toString(), - weight: c.weight - }))))); - } - // Find the mode across all the providers, allowing for - // a little drift between block heights - const mode = getFuzzyMode(this.quorum, results); - if (mode === undefined) { - return undefined; - } - if (mode > this.#height) { - this.#height = mode; - } - return this.#height; - } - case "getGasPrice": - case "getPriorityFee": - case "estimateGas": - return getMedian(this.quorum, results); - case "getBlock": - // Pending blocks are in the mempool and already - // quite untrustworthy; just grab anything - if ("blockTag" in req && req.blockTag === "pending") { - return getAnyResult(this.quorum, results); - } - return checkQuorum(this.quorum, results); - case "call": - case "chainId": - case "getBalance": - case "getTransactionCount": - case "getCode": - case "getStorage": - case "getTransaction": - case "getTransactionReceipt": - case "getLogs": - return checkQuorum(this.quorum, results); - case "broadcastTransaction": - return getAnyResult(this.quorum, results); - } - assert(false, "unsupported method", "UNSUPPORTED_OPERATION", { - operation: `_perform(${stringify(req.method)})` - }); - } - async #waitForQuorum(running, req) { - if (running.size === 0) { - throw new Error("no runners?!"); - } - // Any promises that are interesting to watch for; an expired stall - // or a successful perform - const interesting = []; - let newRunners = 0; - for (const runner of running) { - // No responses, yet; keep an eye on it - if (runner.perform) { - interesting.push(runner.perform); - } - // Still stalling... - if (runner.staller) { - interesting.push(runner.staller); - continue; - } - // This runner has already triggered another runner - if (runner.didBump) { - continue; - } - // Got a response (result or error) or stalled; kick off another runner - runner.didBump = true; - newRunners++; - } - // Check if we have reached quorum on a result (or error) - const value = await this.#checkQuorum(running, req); - if (value !== undefined) { - if (value instanceof Error) { - throw value; - } - return value; - } - // Add any new runners, because a staller timed out or a result - // or error response came in. - for (let i = 0; i < newRunners; i++) { - this.#addRunner(running, req); - } - // All providers have returned, and we have no result - assert(interesting.length > 0, "quorum not met", "SERVER_ERROR", { - request: "%sub-requests", - info: { request: req, results: Array.from(running).map((r) => stringify(r.result)) } - }); - // Wait for someone to either complete its perform or stall out - await Promise.race(interesting); - // This is recursive, but at worst case the depth is 2x the - // number of providers (each has a perform and a staller) - return await this.#waitForQuorum(running, req); - } - async _perform(req) { - // Broadcasting a transaction is rare (ish) and already incurs - // a cost on the user, so spamming is safe-ish. Just send it to - // every backend. - if (req.method === "broadcastTransaction") { - // Once any broadcast provides a positive result, use it. No - // need to wait for anyone else - const results = this.#configs.map((c) => null); - const broadcasts = this.#configs.map(async ({ provider, weight }, index) => { - try { - const result = await provider._perform(req); - results[index] = Object.assign(normalizeResult(req.method, { result }), { weight }); - } - catch (error) { - results[index] = Object.assign(normalizeResult(req.method, { error }), { weight }); - } - }); - // As each promise finishes... - while (true) { - // Check for a valid broadcast result - const done = results.filter((r) => (r != null)); - for (const { value } of done) { - if (!(value instanceof Error)) { - return value; - } - } - // Check for a legit broadcast error (one which we cannot - // recover from; some nodes may return the following red - // herring events: - // - alredy seend (UNKNOWN_ERROR) - // - NONCE_EXPIRED - // - REPLACEMENT_UNDERPRICED - const result = checkQuorum(this.quorum, results.filter((r) => (r != null))); - if (isError(result, "INSUFFICIENT_FUNDS")) { - throw result; - } - // Kick off the next provider (if any) - const waiting = broadcasts.filter((b, i) => (results[i] == null)); - if (waiting.length === 0) { - break; - } - await Promise.race(waiting); - } - // Use standard quorum results; any result was returned above, - // so this will find any error that met quorum if any - const result = getAnyResult(this.quorum, results); - assert(result !== undefined, "problem multi-broadcasting", "SERVER_ERROR", { - request: "%sub-requests", - info: { request: req, results: results.map(stringify) } - }); - if (result instanceof Error) { - throw result; - } - return result; - } - await this.#initialSync(); - // Bootstrap enough runners to meet quorum - const running = new Set(); - let inflightQuorum = 0; - while (true) { - const runner = this.#addRunner(running, req); - if (runner == null) { - break; - } - inflightQuorum += runner.config.weight; - if (inflightQuorum >= this.quorum) { - break; - } - } - const result = await this.#waitForQuorum(running, req); - // Track requests sent to a provider that are still - // outstanding after quorum has been otherwise found - for (const runner of running) { - if (runner.perform && runner.result == null) { - runner.config.lateResponses++; - } - } - return result; - } - async destroy() { - for (const { provider } of this.#configs) { - provider.destroy(); - } - super.destroy(); - } -} -//# sourceMappingURL=provider-fallback.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-fallback.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-fallback.js.map deleted file mode 100644 index 80c770f6..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-fallback.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-fallback.js","sourceRoot":"","sources":["../../src.ts/providers/provider-fallback.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACH,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EACxD,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAKtC,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AACzB,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AAEzB,SAAS,OAAO,CAAU,KAAe;IACrC,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;QACvC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC9C,MAAM,GAAG,GAAG,KAAK,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,GAAG,CAAC,CAAC;YAC7C,IAAI,MAAM,IAAI,IAAI,EAAE;gBAAE,MAAM;aAAE;YAC9B,cAAc,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;YACvC,IAAI,cAAc,IAAI,IAAI,CAAC,MAAM,EAAE;gBAAE,MAAM;aAAE;SAChD;QAED,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAEvD,mDAAmD;QACnD,oDAAoD;QACpD,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;YAC1B,IAAI,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,MAAM,IAAI,IAAI,EAAE;gBACzC,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC;aACjC;SACJ;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,OAAO;QACT,KAAK,MAAM,EAAE,QAAQ,EAAE,IAAI,IAAI,CAAC,QAAQ,EAAE;YACtC,QAAQ,CAAC,OAAO,EAAE,CAAC;SACtB;QACD,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-infura.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-infura.d.ts deleted file mode 100644 index 6ee73ec1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-infura.d.ts +++ /dev/null @@ -1,101 +0,0 @@ -/** - * [[link-infura]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Arbitrum Sepolia Testnet (``arbitrum-sepolia``) - * - Base (``base``) - * - Base Goerlia Testnet (``base-goerli``) - * - Base Sepolia Testnet (``base-sepolia``) - * - BNB Smart Chain Mainnet (``bnb``) - * - BNB Smart Chain Testnet (``bnbt``) - * - Linea (``linea``) - * - Linea Goerli Testnet (``linea-goerli``) - * - Linea Sepolia Testnet (``linea-sepolia``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Optimism Sepolia Testnet (``optimism-sepolia``) - * - Polygon (``matic``) - * - Polygon Amoy Testnet (``matic-amoy``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:INFURA [providers-infura] - */ -import { FetchRequest } from "../utils/index.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import { WebSocketProvider } from "./provider-websocket.js"; -import type { AbstractProvider } from "./abstract-provider.js"; -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; -/** - * The **InfuraWebSocketProvider** connects to the [[link-infura]] - * WebSocket end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-infura-signup). - */ -export declare class InfuraWebSocketProvider extends WebSocketProvider implements CommunityResourcable { - /** - * The Project ID for the INFURA connection. - */ - readonly projectId: string; - /** - * The Project Secret. - * - * If null, no authenticated requests are made. This should not - * be used outside of private contexts. - */ - readonly projectSecret: null | string; - /** - * Creates a new **InfuraWebSocketProvider**. - */ - constructor(network?: Networkish, projectId?: string); - isCommunityResource(): boolean; -} -/** - * The **InfuraProvider** connects to the [[link-infura]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-infura-signup). - */ -export declare class InfuraProvider extends JsonRpcProvider implements CommunityResourcable { - /** - * The Project ID for the INFURA connection. - */ - readonly projectId: string; - /** - * The Project Secret. - * - * If null, no authenticated requests are made. This should not - * be used outside of private contexts. - */ - readonly projectSecret: null | string; - /** - * Creates a new **InfuraProvider**. - */ - constructor(_network?: Networkish, projectId?: null | string, projectSecret?: null | string); - _getProvider(chainId: number): AbstractProvider; - isCommunityResource(): boolean; - /** - * Creates a new **InfuraWebSocketProvider**. - */ - static getWebSocketProvider(network?: Networkish, projectId?: string): InfuraWebSocketProvider; - /** - * Returns a prepared request for connecting to %%network%% - * with %%projectId%% and %%projectSecret%%. - */ - static getRequest(network: Network, projectId?: null | string, projectSecret?: null | string): FetchRequest; -} -//# sourceMappingURL=provider-infura.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-infura.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-infura.d.ts.map deleted file mode 100644 index 69016b16..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-infura.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-infura.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-infura.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,EACe,YAAY,EACjC,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAsD/C;;;;;;;;GAQG;AACH,qBAAa,uBAAwB,SAAQ,iBAAkB,YAAW,oBAAoB;IAE1F;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAG,MAAM,CAAC;IAE5B;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAG,IAAI,GAAG,MAAM,CAAC;IAEvC;;OAEG;gBACS,OAAO,CAAC,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,MAAM;IAgBpD,mBAAmB,IAAI,OAAO;CAGjC;AAED;;;;;;;;GAQG;AACH,qBAAa,cAAe,SAAQ,eAAgB,YAAW,oBAAoB;IAC/E;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAG,MAAM,CAAC;IAE5B;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAG,IAAI,GAAG,MAAM,CAAC;IAEvC;;OAEG;gBACS,QAAQ,CAAC,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,EAAE,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM;IAY3F,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB;IAO/C,mBAAmB,IAAI,OAAO;IAI9B;;OAEG;IACH,MAAM,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,uBAAuB;IAI9F;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,EAAE,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY;CAiB9G"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-infura.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-infura.js deleted file mode 100644 index bce62816..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-infura.js +++ /dev/null @@ -1,201 +0,0 @@ -/** - * [[link-infura]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Arbitrum Sepolia Testnet (``arbitrum-sepolia``) - * - Base (``base``) - * - Base Goerlia Testnet (``base-goerli``) - * - Base Sepolia Testnet (``base-sepolia``) - * - BNB Smart Chain Mainnet (``bnb``) - * - BNB Smart Chain Testnet (``bnbt``) - * - Linea (``linea``) - * - Linea Goerli Testnet (``linea-goerli``) - * - Linea Sepolia Testnet (``linea-sepolia``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Optimism Sepolia Testnet (``optimism-sepolia``) - * - Polygon (``matic``) - * - Polygon Amoy Testnet (``matic-amoy``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:INFURA [providers-infura] - */ -import { defineProperties, FetchRequest, assert, assertArgument } from "../utils/index.js"; -import { showThrottleMessage } from "./community.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import { WebSocketProvider } from "./provider-websocket.js"; -const defaultProjectId = "84842078b09946638c03157f83405213"; -function getHost(name) { - switch (name) { - case "mainnet": - return "mainnet.infura.io"; - case "goerli": - return "goerli.infura.io"; - case "sepolia": - return "sepolia.infura.io"; - case "arbitrum": - return "arbitrum-mainnet.infura.io"; - case "arbitrum-goerli": - return "arbitrum-goerli.infura.io"; - case "arbitrum-sepolia": - return "arbitrum-sepolia.infura.io"; - case "base": - return "base-mainnet.infura.io"; - case "base-goerlia": // @TODO: Remove this typo in the future! - case "base-goerli": - return "base-goerli.infura.io"; - case "base-sepolia": - return "base-sepolia.infura.io"; - case "bnb": - return "bsc-mainnet.infura.io"; - case "bnbt": - return "bsc-testnet.infura.io"; - case "linea": - return "linea-mainnet.infura.io"; - case "linea-goerli": - return "linea-goerli.infura.io"; - case "linea-sepolia": - return "linea-sepolia.infura.io"; - case "matic": - return "polygon-mainnet.infura.io"; - case "matic-amoy": - return "polygon-amoy.infura.io"; - case "matic-mumbai": - return "polygon-mumbai.infura.io"; - case "optimism": - return "optimism-mainnet.infura.io"; - case "optimism-goerli": - return "optimism-goerli.infura.io"; - case "optimism-sepolia": - return "optimism-sepolia.infura.io"; - } - assertArgument(false, "unsupported network", "network", name); -} -/** - * The **InfuraWebSocketProvider** connects to the [[link-infura]] - * WebSocket end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-infura-signup). - */ -export class InfuraWebSocketProvider extends WebSocketProvider { - /** - * The Project ID for the INFURA connection. - */ - projectId; - /** - * The Project Secret. - * - * If null, no authenticated requests are made. This should not - * be used outside of private contexts. - */ - projectSecret; - /** - * Creates a new **InfuraWebSocketProvider**. - */ - constructor(network, projectId) { - const provider = new InfuraProvider(network, projectId); - const req = provider._getConnection(); - assert(!req.credentials, "INFURA WebSocket project secrets unsupported", "UNSUPPORTED_OPERATION", { operation: "InfuraProvider.getWebSocketProvider()" }); - const url = req.url.replace(/^http/i, "ws").replace("/v3/", "/ws/v3/"); - super(url, provider._network); - defineProperties(this, { - projectId: provider.projectId, - projectSecret: provider.projectSecret - }); - } - isCommunityResource() { - return (this.projectId === defaultProjectId); - } -} -/** - * The **InfuraProvider** connects to the [[link-infura]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-infura-signup). - */ -export class InfuraProvider extends JsonRpcProvider { - /** - * The Project ID for the INFURA connection. - */ - projectId; - /** - * The Project Secret. - * - * If null, no authenticated requests are made. This should not - * be used outside of private contexts. - */ - projectSecret; - /** - * Creates a new **InfuraProvider**. - */ - constructor(_network, projectId, projectSecret) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (projectId == null) { - projectId = defaultProjectId; - } - if (projectSecret == null) { - projectSecret = null; - } - const request = InfuraProvider.getRequest(network, projectId, projectSecret); - super(request, network, { staticNetwork: network }); - defineProperties(this, { projectId, projectSecret }); - } - _getProvider(chainId) { - try { - return new InfuraProvider(chainId, this.projectId, this.projectSecret); - } - catch (error) { } - return super._getProvider(chainId); - } - isCommunityResource() { - return (this.projectId === defaultProjectId); - } - /** - * Creates a new **InfuraWebSocketProvider**. - */ - static getWebSocketProvider(network, projectId) { - return new InfuraWebSocketProvider(network, projectId); - } - /** - * Returns a prepared request for connecting to %%network%% - * with %%projectId%% and %%projectSecret%%. - */ - static getRequest(network, projectId, projectSecret) { - if (projectId == null) { - projectId = defaultProjectId; - } - if (projectSecret == null) { - projectSecret = null; - } - const request = new FetchRequest(`https:/\/${getHost(network.name)}/v3/${projectId}`); - request.allowGzip = true; - if (projectSecret) { - request.setCredentials("", projectSecret); - } - if (projectId === defaultProjectId) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("InfuraProvider"); - return true; - }; - } - return request; - } -} -//# sourceMappingURL=provider-infura.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-infura.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-infura.js.map deleted file mode 100644 index 4f996cf7..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-infura.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-infura.js","sourceRoot":"","sources":["../../src.ts/providers/provider-infura.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,EACH,gBAAgB,EAAE,YAAY,EAAE,MAAM,EAAE,cAAc,EACzD,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAO5D,MAAM,gBAAgB,GAAG,kCAAkC,CAAC;AAE5D,SAAS,OAAO,CAAC,IAAY;IACzB,QAAO,IAAI,EAAE;Q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AAC,CAAC;gBACtC,OAAO,IAAI,CAAC;YAChB,CAAC,CAAC;SACL;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ipcsocket-browser.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ipcsocket-browser.d.ts deleted file mode 100644 index 6aae787d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ipcsocket-browser.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const IpcSocketProvider: undefined; -export { IpcSocketProvider }; -//# sourceMappingURL=provider-ipcsocket-browser.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ipcsocket-browser.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ipcsocket-browser.d.ts.map deleted file mode 100644 index e49cd58d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ipcsocket-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-ipcsocket-browser.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-ipcsocket-browser.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,iBAAiB,WAAY,CAAC;AAEpC,OAAO,EAAE,iBAAiB,EAAE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ipcsocket-browser.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ipcsocket-browser.js deleted file mode 100644 index d94074ea..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ipcsocket-browser.js +++ /dev/null @@ -1,3 +0,0 @@ -const IpcSocketProvider = undefined; -export { IpcSocketProvider }; -//# sourceMappingURL=provider-ipcsocket-browser.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ipcsocket-browser.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ipcsocket-browser.js.map deleted file mode 100644 index 1df6d95a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ipcsocket-browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-ipcsocket-browser.js","sourceRoot":"","sources":["../../src.ts/providers/provider-ipcsocket-browser.ts"],"names":[],"mappings":"AAAA,MAAM,iBAAiB,GAAG,SAAS,CAAC;AAEpC,OAAO,EAAE,iBAAiB,EAAE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ipcsocket.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ipcsocket.d.ts deleted file mode 100644 index 23d1f2f6..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ipcsocket.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/// -import { SocketProvider } from "./provider-socket.js"; -import type { Socket } from "net"; -import type { JsonRpcApiProviderOptions } from "./provider-jsonrpc.js"; -import type { Networkish } from "./network.js"; -/** - * An **IpcSocketProvider** connects over an IPC socket on the host - * which provides fast access to the node, but requires the node and - * the script run on the same machine. - */ -export declare class IpcSocketProvider extends SocketProvider { - #private; - /** - * The connected socket. - */ - get socket(): Socket; - constructor(path: string, network?: Networkish, options?: JsonRpcApiProviderOptions); - destroy(): void; - _write(message: string): Promise; -} -//# sourceMappingURL=provider-ipcsocket.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ipcsocket.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ipcsocket.d.ts.map deleted file mode 100644 index 876e470e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ipcsocket.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-ipcsocket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-ipcsocket.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAElC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAmB/C;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,cAAc;;IAGjD;;OAEG;IACH,IAAI,MAAM,IAAI,MAAM,CAAyB;gBAEjC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,yBAAyB;IA8BnF,OAAO,IAAI,IAAI;IAOT,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAI/C"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ipcsocket.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ipcsocket.js deleted file mode 100644 index f61a4579..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ipcsocket.js +++ /dev/null @@ -1,68 +0,0 @@ -import { connect } from "net"; -import { SocketProvider } from "./provider-socket.js"; -// @TODO: Is this sufficient? Is this robust? Will newlines occur between -// all payloads and only between payloads? -function splitBuffer(data) { - const messages = []; - let lastStart = 0; - while (true) { - const nl = data.indexOf(10, lastStart); - if (nl === -1) { - break; - } - messages.push(data.subarray(lastStart, nl).toString().trim()); - lastStart = nl + 1; - } - return { messages, remaining: data.subarray(lastStart) }; -} -/** - * An **IpcSocketProvider** connects over an IPC socket on the host - * which provides fast access to the node, but requires the node and - * the script run on the same machine. - */ -export class IpcSocketProvider extends SocketProvider { - #socket; - /** - * The connected socket. - */ - get socket() { return this.#socket; } - constructor(path, network, options) { - super(network, options); - this.#socket = connect(path); - this.socket.on("ready", async () => { - try { - await this._start(); - } - catch (error) { - console.log("failed to start IpcSocketProvider", error); - // @TODO: Now what? Restart? - } - }); - let response = Buffer.alloc(0); - this.socket.on("data", (data) => { - response = Buffer.concat([response, data]); - const { messages, remaining } = splitBuffer(response); - messages.forEach((message) => { - this._processMessage(message); - }); - response = remaining; - }); - this.socket.on("end", () => { - this.emit("close"); - this.socket.destroy(); - this.socket.end(); - }); - } - destroy() { - this.socket.destroy(); - this.socket.end(); - super.destroy(); - } - async _write(message) { - if (!message.endsWith("\n")) { - message += "\n"; - } - this.socket.write(message); - } -} -//# sourceMappingURL=provider-ipcsocket.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ipcsocket.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ipcsocket.js.map deleted file mode 100644 index e31be799..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-ipcsocket.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-ipcsocket.js","sourceRoot":"","sources":["../../src.ts/providers/provider-ipcsocket.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAQtD,yEAAyE;AACzE,0CAA0C;AAC1C,SAAS,WAAW,CAAC,IAAY;IAC7B,MAAM,QAAQ,GAAkB,EAAG,CAAC;IAEpC,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,OAAO,IAAI,EAAE;QACT,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;QACvC,IAAI,EAAE,KAAK,CAAC,CAAC,EAAE;YAAE,MAAM;SAAE;QACzB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;QAC9D,SAAS,GAAG,EAAE,GAAG,CAAC,CAAC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,EAAE,GAAG,EAAE;YACvB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACnB,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACtB,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;QACtB,CAAC,CAAC,CAAC;IACP,CAAC;IAED,OAAO;QACH,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACtB,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;QAElB,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,OAAe;QACxB,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;YAAE,OAAO,IAAI,IAAI,CAAC;SAAE;QACjD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-jsonrpc.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-jsonrpc.d.ts deleted file mode 100644 index cd837819..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-jsonrpc.d.ts +++ /dev/null @@ -1,361 +0,0 @@ -/** - * One of the most common ways to interact with the blockchain is - * by a node running a JSON-RPC interface which can be connected to, - * based on the transport, using: - * - * - HTTP or HTTPS - [[JsonRpcProvider]] - * - WebSocket - [[WebSocketProvider]] - * - IPC - [[IpcSocketProvider]] - * - * @_section: api/providers/jsonrpc:JSON-RPC Provider [about-jsonrpcProvider] - */ -import { FetchRequest } from "../utils/index.js"; -import { AbstractProvider } from "./abstract-provider.js"; -import { AbstractSigner } from "./abstract-signer.js"; -import { Network } from "./network.js"; -import type { TypedDataDomain, TypedDataField } from "../hash/index.js"; -import type { TransactionLike } from "../transaction/index.js"; -import type { PerformActionRequest, Subscriber, Subscription } from "./abstract-provider.js"; -import type { Networkish } from "./network.js"; -import type { Provider, TransactionRequest, TransactionResponse } from "./provider.js"; -import type { Signer } from "./signer.js"; -/** - * A JSON-RPC payload, which are sent to a JSON-RPC server. - */ -export type JsonRpcPayload = { - /** - * The JSON-RPC request ID. - */ - id: number; - /** - * The JSON-RPC request method. - */ - method: string; - /** - * The JSON-RPC request parameters. - */ - params: Array | Record; - /** - * A required constant in the JSON-RPC specification. - */ - jsonrpc: "2.0"; -}; -/** - * A JSON-RPC result, which are returned on success from a JSON-RPC server. - */ -export type JsonRpcResult = { - /** - * The response ID to match it to the relevant request. - */ - id: number; - /** - * The response result. - */ - result: any; -}; -/** - * A JSON-RPC error, which are returned on failure from a JSON-RPC server. - */ -export type JsonRpcError = { - /** - * The response ID to match it to the relevant request. - */ - id: number; - /** - * The response error. - */ - error: { - code: number; - message?: string; - data?: any; - }; -}; -/** - * When subscribing to the ``"debug"`` event, the [[Listener]] will - * receive this object as the first parameter. - */ -export type DebugEventJsonRpcApiProvider = { - action: "sendRpcPayload"; - payload: JsonRpcPayload | Array; -} | { - action: "receiveRpcResult"; - result: Array; -} | { - action: "receiveRpcError"; - error: Error; -}; -/** - * Options for configuring a [[JsonRpcApiProvider]]. Much of this - * is targetted towards sub-classes, which often will not expose - * any of these options to their consumers. - * - * **``polling``** - use the polling strategy is used immediately - * for events; otherwise, attempt to use filters and fall back onto - * polling (default: ``false``) - * - * **``staticNetwork``** - do not request chain ID on requests to - * validate the underlying chain has not changed (default: ``null``) - * - * This should **ONLY** be used if it is **certain** that the network - * cannot change, such as when using INFURA (since the URL dictates the - * network). If the network is assumed static and it does change, this - * can have tragic consequences. For example, this **CANNOT** be used - * with MetaMask, since the user can select a new network from the - * drop-down at any time. - * - * **``batchStallTime``** - how long (ms) to aggregate requests into a - * single batch. ``0`` indicates batching will only encompass the current - * event loop. If ``batchMaxCount = 1``, this is ignored. (default: ``10``) - * - * **``batchMaxSize``** - target maximum size (bytes) to allow per batch - * request (default: 1Mb) - * - * **``batchMaxCount``** - maximum number of requests to allow in a batch. - * If ``batchMaxCount = 1``, then batching is disabled. (default: ``100``) - * - * **``cacheTimeout``** - passed as [[AbstractProviderOptions]]. - */ -export type JsonRpcApiProviderOptions = { - polling?: boolean; - staticNetwork?: null | boolean | Network; - batchStallTime?: number; - batchMaxSize?: number; - batchMaxCount?: number; - cacheTimeout?: number; - pollingInterval?: number; -}; -/** - * A **JsonRpcTransactionRequest** is formatted as needed by the JSON-RPC - * Ethereum API specification. - */ -export interface JsonRpcTransactionRequest { - /** - * The sender address to use when signing. - */ - from?: string; - /** - * The target address. - */ - to?: string; - /** - * The transaction data. - */ - data?: string; - /** - * The chain ID the transaction is valid on. - */ - chainId?: string; - /** - * The [[link-eip-2718]] transaction type. - */ - type?: string; - /** - * The maximum amount of gas to allow a transaction to consume. - * - * In most other places in ethers, this is called ``gasLimit`` which - * differs from the JSON-RPC Ethereum API specification. - */ - gas?: string; - /** - * The gas price per wei for transactions prior to [[link-eip-1559]]. - */ - gasPrice?: string; - /** - * The maximum fee per gas for [[link-eip-1559]] transactions. - */ - maxFeePerGas?: string; - /** - * The maximum priority fee per gas for [[link-eip-1559]] transactions. - */ - maxPriorityFeePerGas?: string; - /** - * The nonce for the transaction. - */ - nonce?: string; - /** - * The transaction value (in wei). - */ - value?: string; - /** - * The transaction access list. - */ - accessList?: Array<{ - address: string; - storageKeys: Array; - }>; - /** - * The transaction authorization list. - */ - authorizationList?: Array<{ - address: string; - nonce: string; - chainId: string; - yParity: string; - r: string; - s: string; - }>; -} -export declare class JsonRpcSigner extends AbstractSigner { - address: string; - constructor(provider: JsonRpcApiProvider, address: string); - connect(provider: null | Provider): Signer; - getAddress(): Promise; - populateTransaction(tx: TransactionRequest): Promise>; - sendUncheckedTransaction(_tx: TransactionRequest): Promise; - sendTransaction(tx: TransactionRequest): Promise; - signTransaction(_tx: TransactionRequest): Promise; - signMessage(_message: string | Uint8Array): Promise; - signTypedData(domain: TypedDataDomain, types: Record>, _value: Record): Promise; - unlock(password: string): Promise; - _legacySignMessage(_message: string | Uint8Array): Promise; -} -/** - * The JsonRpcApiProvider is an abstract class and **MUST** be - * sub-classed. - * - * It provides the base for all JSON-RPC-based Provider interaction. - * - * Sub-classing Notes: - * - a sub-class MUST override _send - * - a sub-class MUST call the `_start()` method once connected - */ -export declare abstract class JsonRpcApiProvider extends AbstractProvider { - #private; - constructor(network?: Networkish, options?: JsonRpcApiProviderOptions); - /** - * Returns the value associated with the option %%key%%. - * - * Sub-classes can use this to inquire about configuration options. - */ - _getOption(key: K): JsonRpcApiProviderOptions[K]; - /** - * Gets the [[Network]] this provider has committed to. On each call, the network - * is detected, and if it has changed, the call will reject. - */ - get _network(): Network; - /** - * Sends a JSON-RPC %%payload%% (or a batch) to the underlying channel. - * - * Sub-classes **MUST** override this. - */ - abstract _send(payload: JsonRpcPayload | Array): Promise>; - /** - * Resolves to the non-normalized value by performing %%req%%. - * - * Sub-classes may override this to modify behavior of actions, - * and should generally call ``super._perform`` as a fallback. - */ - _perform(req: PerformActionRequest): Promise; - /** - * Sub-classes may override this; it detects the *actual* network that - * we are **currently** connected to. - * - * Keep in mind that [[send]] may only be used once [[ready]], otherwise the - * _send primitive must be used instead. - */ - _detectNetwork(): Promise; - /** - * Sub-classes **MUST** call this. Until [[_start]] has been called, no calls - * will be passed to [[_send]] from [[send]]. If it is overridden, then - * ``super._start()`` **MUST** be called. - * - * Calling it multiple times is safe and has no effect. - */ - _start(): void; - /** - * Resolves once the [[_start]] has been called. This can be used in - * sub-classes to defer sending data until the connection has been - * established. - */ - _waitUntilReady(): Promise; - /** - * Return a Subscriber that will manage the %%sub%%. - * - * Sub-classes may override this to modify the behavior of - * subscription management. - */ - _getSubscriber(sub: Subscription): Subscriber; - /** - * Returns true only if the [[_start]] has been called. - */ - get ready(): boolean; - /** - * Returns %%tx%% as a normalized JSON-RPC transaction request, - * which has all values hexlified and any numeric values converted - * to Quantity values. - */ - getRpcTransaction(tx: TransactionRequest): JsonRpcTransactionRequest; - /** - * Returns the request method and arguments required to perform - * %%req%%. - */ - getRpcRequest(req: PerformActionRequest): null | { - method: string; - args: Array; - }; - /** - * Returns an ethers-style Error for the given JSON-RPC error - * %%payload%%, coalescing the various strings and error shapes - * that different nodes return, coercing them into a machine-readable - * standardized error. - */ - getRpcError(payload: JsonRpcPayload, _error: JsonRpcError): Error; - /** - * Requests the %%method%% with %%params%% via the JSON-RPC protocol - * over the underlying channel. This can be used to call methods - * on the backend that do not have a high-level API within the Provider - * API. - * - * This method queues requests according to the batch constraints - * in the options, assigns the request a unique ID. - * - * **Do NOT override** this method in sub-classes; instead - * override [[_send]] or force the options values in the - * call to the constructor to modify this method's behavior. - */ - send(method: string, params: Array | Record): Promise; - /** - * Resolves to the [[Signer]] account for %%address%% managed by - * the client. - * - * If the %%address%% is a number, it is used as an index in the - * the accounts from [[listAccounts]]. - * - * This can only be used on clients which manage accounts (such as - * Geth with imported account or MetaMask). - * - * Throws if the account doesn't exist. - */ - getSigner(address?: number | string): Promise; - listAccounts(): Promise>; - destroy(): void; -} -/** - * @_ignore: - */ -export declare abstract class JsonRpcApiPollingProvider extends JsonRpcApiProvider { - #private; - constructor(network?: Networkish, options?: JsonRpcApiProviderOptions); - _getSubscriber(sub: Subscription): Subscriber; - /** - * The polling interval (default: 4000 ms) - */ - get pollingInterval(): number; - set pollingInterval(value: number); -} -/** - * The JsonRpcProvider is one of the most common Providers, - * which performs all operations over HTTP (or HTTPS) requests. - * - * Events are processed by polling the backend for the current block - * number; when it advances, all block-base events are then checked - * for updates. - */ -export declare class JsonRpcProvider extends JsonRpcApiPollingProvider { - #private; - constructor(url?: string | FetchRequest, network?: Networkish, options?: JsonRpcApiProviderOptions); - _getConnection(): FetchRequest; - send(method: string, params: Array | Record): Promise; - _send(payload: JsonRpcPayload | Array): Promise>; -} -//# sourceMappingURL=provider-jsonrpc.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-jsonrpc.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-jsonrpc.d.ts.map deleted file mode 100644 index 8a6f870a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-jsonrpc.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-jsonrpc.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-jsonrpc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAWH,OAAO,EAGH,YAAY,EACf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAuB,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAIvC,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC7F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACvF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AA6C1C;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IACzB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAEzC;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IACxB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IA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IxB,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IAS5E,KAAK,CAAC,OAAO,EAAE,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;CAa9F"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-jsonrpc.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-jsonrpc.js deleted file mode 100644 index 1ecc723b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-jsonrpc.js +++ /dev/null @@ -1,973 +0,0 @@ -/** - * One of the most common ways to interact with the blockchain is - * by a node running a JSON-RPC interface which can be connected to, - * based on the transport, using: - * - * - HTTP or HTTPS - [[JsonRpcProvider]] - * - WebSocket - [[WebSocketProvider]] - * - IPC - [[IpcSocketProvider]] - * - * @_section: api/providers/jsonrpc:JSON-RPC Provider [about-jsonrpcProvider] - */ -// @TODO: -// - Add the batching API -// https://playground.open-rpc.org/?schemaUrl=https://raw.githubusercontent.com/ethereum/eth1.0-apis/assembled-spec/openrpc.json&uiSchema%5BappBar%5D%5Bui:splitView%5D=true&uiSchema%5BappBar%5D%5Bui:input%5D=false&uiSchema%5BappBar%5D%5Bui:examplesDropdown%5D=false -import { AbiCoder } from "../abi/index.js"; -import { getAddress, resolveAddress } from "../address/index.js"; -import { TypedDataEncoder } from "../hash/index.js"; -import { accessListify, authorizationify } from "../transaction/index.js"; -import { defineProperties, getBigInt, hexlify, isHexString, toQuantity, toUtf8Bytes, isError, makeError, assert, assertArgument, FetchRequest, resolveProperties } from "../utils/index.js"; -import { AbstractProvider, UnmanagedSubscriber } from "./abstract-provider.js"; -import { AbstractSigner } from "./abstract-signer.js"; -import { Network } from "./network.js"; -import { FilterIdEventSubscriber, FilterIdPendingSubscriber } from "./subscriber-filterid.js"; -import { PollingEventSubscriber } from "./subscriber-polling.js"; -const Primitive = "bigint,boolean,function,number,string,symbol".split(/,/g); -//const Methods = "getAddress,then".split(/,/g); -function deepCopy(value) { - if (value == null || Primitive.indexOf(typeof (value)) >= 0) { - return value; - } - // Keep any Addressable - if (typeof (value.getAddress) === "function") { - return value; - } - if (Array.isArray(value)) { - return (value.map(deepCopy)); - } - if (typeof (value) === "object") { - return Object.keys(value).reduce((accum, key) => { - accum[key] = value[key]; - return accum; - }, {}); - } - throw new Error(`should not happen: ${value} (${typeof (value)})`); -} -function stall(duration) { - return new Promise((resolve) => { setTimeout(resolve, duration); }); -} -function getLowerCase(value) { - if (value) { - return value.toLowerCase(); - } - return value; -} -function isPollable(value) { - return (value && typeof (value.pollingInterval) === "number"); -} -const defaultOptions = { - polling: false, - staticNetwork: null, - batchStallTime: 10, - batchMaxSize: (1 << 20), - batchMaxCount: 100, - cacheTimeout: 250, - pollingInterval: 4000 -}; -// @TODO: Unchecked Signers -export class JsonRpcSigner extends AbstractSigner { - address; - constructor(provider, address) { - super(provider); - address = getAddress(address); - defineProperties(this, { address }); - } - connect(provider) { - assert(false, "cannot reconnect JsonRpcSigner", "UNSUPPORTED_OPERATION", { - operation: "signer.connect" - }); - } - async getAddress() { - return this.address; - } - // JSON-RPC will automatially fill in nonce, etc. so we just check from - async populateTransaction(tx) { - return await this.populateCall(tx); - } - // Returns just the hash of the transaction after sent, which is what - // the bare JSON-RPC API does; - async sendUncheckedTransaction(_tx) { - const tx = deepCopy(_tx); - const promises = []; - // Make sure the from matches the sender - if (tx.from) { - const _from = tx.from; - promises.push((async () => { - const from = await resolveAddress(_from, this.provider); - assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(), "from address mismatch", "transaction", _tx); - tx.from = from; - })()); - } - else { - tx.from = this.address; - } - // The JSON-RPC for eth_sendTransaction uses 90000 gas; if the user - // wishes to use this, it is easy to specify explicitly, otherwise - // we look it up for them. - if (tx.gasLimit == null) { - promises.push((async () => { - tx.gasLimit = await this.provider.estimateGas({ ...tx, from: this.address }); - })()); - } - // The address may be an ENS name or Addressable - if (tx.to != null) { - const _to = tx.to; - promises.push((async () => { - tx.to = await resolveAddress(_to, this.provider); - })()); - } - // Wait until all of our properties are filled in - if (promises.length) { - await Promise.all(promises); - } - const hexTx = this.provider.getRpcTransaction(tx); - return this.provider.send("eth_sendTransaction", [hexTx]); - } - async sendTransaction(tx) { - // This cannot be mined any earlier than any recent block - const blockNumber = await this.provider.getBlockNumber(); - // Send the transaction - const hash = await this.sendUncheckedTransaction(tx); - // Unfortunately, JSON-RPC only provides and opaque transaction hash - // for a response, and we need the actual transaction, so we poll - // for it; it should show up very quickly - return await (new Promise((resolve, reject) => { - const timeouts = [1000, 100]; - let invalids = 0; - const checkTx = async () => { - try { - // Try getting the transaction - const tx = await this.provider.getTransaction(hash); - if (tx != null) { - resolve(tx.replaceableTransaction(blockNumber)); - return; - } - } - catch (error) { - // If we were cancelled: stop polling. - // If the data is bad: the node returns bad transactions - // If the network changed: calling again will also fail - // If unsupported: likely destroyed - if (isError(error, "CANCELLED") || isError(error, "BAD_DATA") || - isError(error, "NETWORK_ERROR") || isError(error, "UNSUPPORTED_OPERATION")) { - if (error.info == null) { - error.info = {}; - } - error.info.sendTransactionHash = hash; - reject(error); - return; - } - // Stop-gap for misbehaving backends; see #4513 - if (isError(error, "INVALID_ARGUMENT")) { - invalids++; - if (error.info == null) { - error.info = {}; - } - error.info.sendTransactionHash = hash; - if (invalids > 10) { - reject(error); - return; - } - } - // Notify anyone that cares; but we will try again, since - // it is likely an intermittent service error - this.provider.emit("error", makeError("failed to fetch transation after sending (will try again)", "UNKNOWN_ERROR", { error })); - } - // Wait another 4 seconds - this.provider._setTimeout(() => { checkTx(); }, timeouts.pop() || 4000); - }; - checkTx(); - })); - } - async signTransaction(_tx) { - const tx = deepCopy(_tx); - // Make sure the from matches the sender - if (tx.from) { - const from = await resolveAddress(tx.from, this.provider); - assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(), "from address mismatch", "transaction", _tx); - tx.from = from; - } - else { - tx.from = this.address; - } - const hexTx = this.provider.getRpcTransaction(tx); - return await this.provider.send("eth_signTransaction", [hexTx]); - } - async signMessage(_message) { - const message = ((typeof (_message) === "string") ? toUtf8Bytes(_message) : _message); - return await this.provider.send("personal_sign", [ - hexlify(message), this.address.toLowerCase() - ]); - } - async signTypedData(domain, types, _value) { - const value = deepCopy(_value); - // Populate any ENS names (in-place) - const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (value) => { - const address = await resolveAddress(value); - assertArgument(address != null, "TypedData does not support null address", "value", value); - return address; - }); - return await this.provider.send("eth_signTypedData_v4", [ - this.address.toLowerCase(), - JSON.stringify(TypedDataEncoder.getPayload(populated.domain, types, populated.value)) - ]); - } - async unlock(password) { - return this.provider.send("personal_unlockAccount", [ - this.address.toLowerCase(), password, null - ]); - } - // https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign - async _legacySignMessage(_message) { - const message = ((typeof (_message) === "string") ? toUtf8Bytes(_message) : _message); - return await this.provider.send("eth_sign", [ - this.address.toLowerCase(), hexlify(message) - ]); - } -} -/** - * The JsonRpcApiProvider is an abstract class and **MUST** be - * sub-classed. - * - * It provides the base for all JSON-RPC-based Provider interaction. - * - * Sub-classing Notes: - * - a sub-class MUST override _send - * - a sub-class MUST call the `_start()` method once connected - */ -export class JsonRpcApiProvider extends AbstractProvider { - #options; - // The next ID to use for the JSON-RPC ID field - #nextId; - // Payloads are queued and triggered in batches using the drainTimer - #payloads; - #drainTimer; - #notReady; - #network; - #pendingDetectNetwork; - #scheduleDrain() { - if (this.#drainTimer) { - return; - } - // If we aren't using batching, no harm in sending it immediately - const stallTime = (this._getOption("batchMaxCount") === 1) ? 0 : this._getOption("batchStallTime"); - this.#drainTimer = setTimeout(() => { - this.#drainTimer = null; - const payloads = this.#payloads; - this.#payloads = []; - while (payloads.length) { - // Create payload batches that satisfy our batch constraints - const batch = [(payloads.shift())]; - while (payloads.length) { - if (batch.length === this.#options.batchMaxCount) { - break; - } - batch.push((payloads.shift())); - const bytes = JSON.stringify(batch.map((p) => p.payload)); - if (bytes.length > this.#options.batchMaxSize) { - payloads.unshift((batch.pop())); - break; - } - } - // Process the result to each payload - (async () => { - const payload = ((batch.length === 1) ? batch[0].payload : batch.map((p) => p.payload)); - this.emit("debug", { action: "sendRpcPayload", payload }); - try { - const result = await this._send(payload); - this.emit("debug", { action: "receiveRpcResult", result }); - // Process results in batch order - for (const { resolve, reject, payload } of batch) { - if (this.destroyed) { - reject(makeError("provider destroyed; cancelled request", "UNSUPPORTED_OPERATION", { operation: payload.method })); - continue; - } - // Find the matching result - const resp = result.filter((r) => (r.id === payload.id))[0]; - // No result; the node failed us in unexpected ways - if (resp == null) { - const error = makeError("missing response for request", "BAD_DATA", { - value: result, info: { payload } - }); - this.emit("error", error); - reject(error); - continue; - } - // The response is an error - if ("error" in resp) { - reject(this.getRpcError(payload, resp)); - continue; - } - // All good; send the result - resolve(resp.result); - } - } - catch (error) { - this.emit("debug", { action: "receiveRpcError", error }); - for (const { reject } of batch) { - // @TODO: augment the error with the payload - reject(error); - } - } - })(); - } - }, stallTime); - } - constructor(network, options) { - super(network, options); - this.#nextId = 1; - this.#options = Object.assign({}, defaultOptions, options || {}); - this.#payloads = []; - this.#drainTimer = null; - this.#network = null; - this.#pendingDetectNetwork = null; - { - let resolve = null; - const promise = new Promise((_resolve) => { - resolve = _resolve; - }); - this.#notReady = { promise, resolve }; - } - const staticNetwork = this._getOption("staticNetwork"); - if (typeof (staticNetwork) === "boolean") { - assertArgument(!staticNetwork || network !== "any", "staticNetwork cannot be used on special network 'any'", "options", options); - if (staticNetwork && network != null) { - this.#network = Network.from(network); - } - } - else if (staticNetwork) { - // Make sure any static network is compatbile with the provided netwrok - assertArgument(network == null || staticNetwork.matches(network), "staticNetwork MUST match network object", "options", options); - this.#network = staticNetwork; - } - } - /** - * Returns the value associated with the option %%key%%. - * - * Sub-classes can use this to inquire about configuration options. - */ - _getOption(key) { - return this.#options[key]; - } - /** - * Gets the [[Network]] this provider has committed to. On each call, the network - * is detected, and if it has changed, the call will reject. - */ - get _network() { - assert(this.#network, "network is not available yet", "NETWORK_ERROR"); - return this.#network; - } - /** - * Resolves to the non-normalized value by performing %%req%%. - * - * Sub-classes may override this to modify behavior of actions, - * and should generally call ``super._perform`` as a fallback. - */ - async _perform(req) { - // Legacy networks do not like the type field being passed along (which - // is fair), so we delete type if it is 0 and a non-EIP-1559 network - if (req.method === "call" || req.method === "estimateGas") { - let tx = req.transaction; - if (tx && tx.type != null && getBigInt(tx.type)) { - // If there are no EIP-1559 or newer properties, it might be pre-EIP-1559 - if (tx.maxFeePerGas == null && tx.maxPriorityFeePerGas == null) { - const feeData = await this.getFeeData(); - if (feeData.maxFeePerGas == null && feeData.maxPriorityFeePerGas == null) { - // Network doesn't know about EIP-1559 (and hence type) - req = Object.assign({}, req, { - transaction: Object.assign({}, tx, { type: undefined }) - }); - } - } - } - } - const request = this.getRpcRequest(req); - if (request != null) { - return await this.send(request.method, request.args); - } - return super._perform(req); - } - /** - * Sub-classes may override this; it detects the *actual* network that - * we are **currently** connected to. - * - * Keep in mind that [[send]] may only be used once [[ready]], otherwise the - * _send primitive must be used instead. - */ - async _detectNetwork() { - const network = this._getOption("staticNetwork"); - if (network) { - if (network === true) { - if (this.#network) { - return this.#network; - } - } - else { - return network; - } - } - if (this.#pendingDetectNetwork) { - return await this.#pendingDetectNetwork; - } - // If we are ready, use ``send``, which enabled requests to be batched - if (this.ready) { - this.#pendingDetectNetwork = (async () => { - try { - const result = Network.from(getBigInt(await this.send("eth_chainId", []))); - this.#pendingDetectNetwork = null; - return result; - } - catch (error) { - this.#pendingDetectNetwork = null; - throw error; - } - })(); - return await this.#pendingDetectNetwork; - } - // We are not ready yet; use the primitive _send - this.#pendingDetectNetwork = (async () => { - const payload = { - id: this.#nextId++, method: "eth_chainId", params: [], jsonrpc: "2.0" - }; - this.emit("debug", { action: "sendRpcPayload", payload }); - let result; - try { - result = (await this._send(payload))[0]; - this.#pendingDetectNetwork = null; - } - catch (error) { - this.#pendingDetectNetwork = null; - this.emit("debug", { action: "receiveRpcError", error }); - throw error; - } - this.emit("debug", { action: "receiveRpcResult", result }); - if ("result" in result) { - return Network.from(getBigInt(result.result)); - } - throw this.getRpcError(payload, result); - })(); - return await this.#pendingDetectNetwork; - } - /** - * Sub-classes **MUST** call this. Until [[_start]] has been called, no calls - * will be passed to [[_send]] from [[send]]. If it is overridden, then - * ``super._start()`` **MUST** be called. - * - * Calling it multiple times is safe and has no effect. - */ - _start() { - if (this.#notReady == null || this.#notReady.resolve == null) { - return; - } - this.#notReady.resolve(); - this.#notReady = null; - (async () => { - // Bootstrap the network - while (this.#network == null && !this.destroyed) { - try { - this.#network = await this._detectNetwork(); - } - catch (error) { - if (this.destroyed) { - break; - } - console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"); - this.emit("error", makeError("failed to bootstrap network detection", "NETWORK_ERROR", { event: "initial-network-discovery", info: { error } })); - await stall(1000); - } - } - // Start dispatching requests - this.#scheduleDrain(); - })(); - } - /** - * Resolves once the [[_start]] has been called. This can be used in - * sub-classes to defer sending data until the connection has been - * established. - */ - async _waitUntilReady() { - if (this.#notReady == null) { - return; - } - return await this.#notReady.promise; - } - /** - * Return a Subscriber that will manage the %%sub%%. - * - * Sub-classes may override this to modify the behavior of - * subscription management. - */ - _getSubscriber(sub) { - // Pending Filters aren't availble via polling - if (sub.type === "pending") { - return new FilterIdPendingSubscriber(this); - } - if (sub.type === "event") { - if (this._getOption("polling")) { - return new PollingEventSubscriber(this, sub.filter); - } - return new FilterIdEventSubscriber(this, sub.filter); - } - // Orphaned Logs are handled automatically, by the filter, since - // logs with removed are emitted by it - if (sub.type === "orphan" && sub.filter.orphan === "drop-log") { - return new UnmanagedSubscriber("orphan"); - } - return super._getSubscriber(sub); - } - /** - * Returns true only if the [[_start]] has been called. - */ - get ready() { return this.#notReady == null; } - /** - * Returns %%tx%% as a normalized JSON-RPC transaction request, - * which has all values hexlified and any numeric values converted - * to Quantity values. - */ - getRpcTransaction(tx) { - const result = {}; - // JSON-RPC now requires numeric values to be "quantity" values - ["chainId", "gasLimit", "gasPrice", "type", "maxFeePerGas", "maxPriorityFeePerGas", "nonce", "value"].forEach((key) => { - if (tx[key] == null) { - return; - } - let dstKey = key; - if (key === "gasLimit") { - dstKey = "gas"; - } - result[dstKey] = toQuantity(getBigInt(tx[key], `tx.${key}`)); - }); - // Make sure addresses and data are lowercase - ["from", "to", "data"].forEach((key) => { - if (tx[key] == null) { - return; - } - result[key] = hexlify(tx[key]); - }); - // Normalize the access list object - if (tx.accessList) { - result["accessList"] = accessListify(tx.accessList); - } - if (tx.blobVersionedHashes) { - // @TODO: Remove this case once EIP-4844 added to prepared tx - result["blobVersionedHashes"] = tx.blobVersionedHashes.map(h => h.toLowerCase()); - } - if (tx.authorizationList) { - result["authorizationList"] = tx.authorizationList.map((_a) => { - const a = authorizationify(_a); - return { - address: a.address, - nonce: toQuantity(a.nonce), - chainId: toQuantity(a.chainId), - yParity: toQuantity(a.signature.yParity), - r: toQuantity(a.signature.r), - s: toQuantity(a.signature.s), - }; - }); - } - // @TODO: blobs should probably also be copied over, optionally - // accounting for the kzg property to backfill blobVersionedHashes - // using the commitment. Or should that be left as an exercise to - // the caller? - return result; - } - /** - * Returns the request method and arguments required to perform - * %%req%%. - */ - getRpcRequest(req) { - switch (req.method) { - case "chainId": - return { method: "eth_chainId", args: [] }; - case "getBlockNumber": - return { method: "eth_blockNumber", args: [] }; - case "getGasPrice": - return { method: "eth_gasPrice", args: [] }; - case "getPriorityFee": - return { method: "eth_maxPriorityFeePerGas", args: [] }; - case "getBalance": - return { - method: "eth_getBalance", - args: [getLowerCase(req.address), req.blockTag] - }; - case "getTransactionCount": - return { - method: "eth_getTransactionCount", - args: [getLowerCase(req.address), req.blockTag] - }; - case "getCode": - return { - method: "eth_getCode", - args: [getLowerCase(req.address), req.blockTag] - }; - case "getStorage": - return { - method: "eth_getStorageAt", - args: [ - getLowerCase(req.address), - ("0x" + req.position.toString(16)), - req.blockTag - ] - }; - case "broadcastTransaction": - return { - method: "eth_sendRawTransaction", - args: [req.signedTransaction] - }; - case "getBlock": - if ("blockTag" in req) { - return { - method: "eth_getBlockByNumber", - args: [req.blockTag, !!req.includeTransactions] - }; - } - else if ("blockHash" in req) { - return { - method: "eth_getBlockByHash", - args: [req.blockHash, !!req.includeTransactions] - }; - } - break; - case "getTransaction": - return { - method: "eth_getTransactionByHash", - args: [req.hash] - }; - case "getTransactionReceipt": - return { - method: "eth_getTransactionReceipt", - args: [req.hash] - }; - case "call": - return { - method: "eth_call", - args: [this.getRpcTransaction(req.transaction), req.blockTag] - }; - case "estimateGas": { - return { - method: "eth_estimateGas", - args: [this.getRpcTransaction(req.transaction)] - }; - } - case "getLogs": - if (req.filter && req.filter.address != null) { - if (Array.isArray(req.filter.address)) { - req.filter.address = req.filter.address.map(getLowerCase); - } - else { - req.filter.address = getLowerCase(req.filter.address); - } - } - return { method: "eth_getLogs", args: [req.filter] }; - } - return null; - } - /** - * Returns an ethers-style Error for the given JSON-RPC error - * %%payload%%, coalescing the various strings and error shapes - * that different nodes return, coercing them into a machine-readable - * standardized error. - */ - getRpcError(payload, _error) { - const { method } = payload; - const { error } = _error; - if (method === "eth_estimateGas" && error.message) { - const msg = error.message; - if (!msg.match(/revert/i) && msg.match(/insufficient funds/i)) { - return makeError("insufficient funds", "INSUFFICIENT_FUNDS", { - transaction: (payload.params[0]), - info: { payload, error } - }); - } - else if (msg.match(/nonce/i) && msg.match(/too low/i)) { - return makeError("nonce has already been used", "NONCE_EXPIRED", { - transaction: (payload.params[0]), - info: { payload, error } - }); - } - } - if (method === "eth_call" || method === "eth_estimateGas") { - const result = spelunkData(error); - const e = AbiCoder.getBuiltinCallException((method === "eth_call") ? "call" : "estimateGas", (payload.params[0]), (result ? result.data : null)); - e.info = { error, payload }; - return e; - } - // Only estimateGas and call can return arbitrary contract-defined text, so now we - // we can process text safely. - const message = JSON.stringify(spelunkMessage(error)); - if (typeof (error.message) === "string" && error.message.match(/user denied|ethers-user-denied/i)) { - const actionMap = { - eth_sign: "signMessage", - personal_sign: "signMessage", - eth_signTypedData_v4: "signTypedData", - eth_signTransaction: "signTransaction", - eth_sendTransaction: "sendTransaction", - eth_requestAccounts: "requestAccess", - wallet_requestAccounts: "requestAccess", - }; - return makeError(`user rejected action`, "ACTION_REJECTED", { - action: (actionMap[method] || "unknown"), - reason: "rejected", - info: { payload, error } - }); - } - if (method === "eth_sendRawTransaction" || method === "eth_sendTransaction") { - const transaction = (payload.params[0]); - if (message.match(/insufficient funds|base fee exceeds gas limit/i)) { - return makeError("insufficient funds for intrinsic transaction cost", "INSUFFICIENT_FUNDS", { - transaction, info: { error } - }); - } - if (message.match(/nonce/i) && message.match(/too low/i)) { - return makeError("nonce has already been used", "NONCE_EXPIRED", { transaction, info: { error } }); - } - // "replacement transaction underpriced" - if (message.match(/replacement transaction/i) && message.match(/underpriced/i)) { - return makeError("replacement fee too low", "REPLACEMENT_UNDERPRICED", { transaction, info: { error } }); - } - if (message.match(/only replay-protected/i)) { - return makeError("legacy pre-eip-155 transactions not supported", "UNSUPPORTED_OPERATION", { - operation: method, info: { transaction, info: { error } } - }); - } - } - let unsupported = !!message.match(/the method .* does not exist/i); - if (!unsupported) { - if (error && error.details && error.details.startsWith("Unauthorized method:")) { - unsupported = true; - } - } - if (unsupported) { - return makeError("unsupported operation", "UNSUPPORTED_OPERATION", { - operation: payload.method, info: { error, payload } - }); - } - return makeError("could not coalesce error", "UNKNOWN_ERROR", { error, payload }); - } - /** - * Requests the %%method%% with %%params%% via the JSON-RPC protocol - * over the underlying channel. This can be used to call methods - * on the backend that do not have a high-level API within the Provider - * API. - * - * This method queues requests according to the batch constraints - * in the options, assigns the request a unique ID. - * - * **Do NOT override** this method in sub-classes; instead - * override [[_send]] or force the options values in the - * call to the constructor to modify this method's behavior. - */ - send(method, params) { - // @TODO: cache chainId?? purge on switch_networks - // We have been destroyed; no operations are supported anymore - if (this.destroyed) { - return Promise.reject(makeError("provider destroyed; cancelled request", "UNSUPPORTED_OPERATION", { operation: method })); - } - const id = this.#nextId++; - const promise = new Promise((resolve, reject) => { - this.#payloads.push({ - resolve, reject, - payload: { method, params, id, jsonrpc: "2.0" } - }); - }); - // If there is not a pending drainTimer, set one - this.#scheduleDrain(); - return promise; - } - /** - * Resolves to the [[Signer]] account for %%address%% managed by - * the client. - * - * If the %%address%% is a number, it is used as an index in the - * the accounts from [[listAccounts]]. - * - * This can only be used on clients which manage accounts (such as - * Geth with imported account or MetaMask). - * - * Throws if the account doesn't exist. - */ - async getSigner(address) { - if (address == null) { - address = 0; - } - const accountsPromise = this.send("eth_accounts", []); - // Account index - if (typeof (address) === "number") { - const accounts = (await accountsPromise); - if (address >= accounts.length) { - throw new Error("no such account"); - } - return new JsonRpcSigner(this, accounts[address]); - } - const { accounts } = await resolveProperties({ - network: this.getNetwork(), - accounts: accountsPromise - }); - // Account address - address = getAddress(address); - for (const account of accounts) { - if (getAddress(account) === address) { - return new JsonRpcSigner(this, address); - } - } - throw new Error("invalid account"); - } - async listAccounts() { - const accounts = await this.send("eth_accounts", []); - return accounts.map((a) => new JsonRpcSigner(this, a)); - } - destroy() { - // Stop processing requests - if (this.#drainTimer) { - clearTimeout(this.#drainTimer); - this.#drainTimer = null; - } - // Cancel all pending requests - for (const { payload, reject } of this.#payloads) { - reject(makeError("provider destroyed; cancelled request", "UNSUPPORTED_OPERATION", { operation: payload.method })); - } - this.#payloads = []; - // Parent clean-up - super.destroy(); - } -} -// @TODO: remove this in v7, it is not exported because this functionality -// is exposed in the JsonRpcApiProvider by setting polling to true. It should -// be safe to remove regardless, because it isn't reachable, but just in case. -/** - * @_ignore: - */ -export class JsonRpcApiPollingProvider extends JsonRpcApiProvider { - #pollingInterval; - constructor(network, options) { - super(network, options); - let pollingInterval = this._getOption("pollingInterval"); - if (pollingInterval == null) { - pollingInterval = defaultOptions.pollingInterval; - } - this.#pollingInterval = pollingInterval; - } - _getSubscriber(sub) { - const subscriber = super._getSubscriber(sub); - if (isPollable(subscriber)) { - subscriber.pollingInterval = this.#pollingInterval; - } - return subscriber; - } - /** - * The polling interval (default: 4000 ms) - */ - get pollingInterval() { return this.#pollingInterval; } - set pollingInterval(value) { - if (!Number.isInteger(value) || value < 0) { - throw new Error("invalid interval"); - } - this.#pollingInterval = value; - this._forEachSubscriber((sub) => { - if (isPollable(sub)) { - sub.pollingInterval = this.#pollingInterval; - } - }); - } -} -/** - * The JsonRpcProvider is one of the most common Providers, - * which performs all operations over HTTP (or HTTPS) requests. - * - * Events are processed by polling the backend for the current block - * number; when it advances, all block-base events are then checked - * for updates. - */ -export class JsonRpcProvider extends JsonRpcApiPollingProvider { - #connect; - constructor(url, network, options) { - if (url == null) { - url = "http:/\/localhost:8545"; - } - super(network, options); - if (typeof (url) === "string") { - this.#connect = new FetchRequest(url); - } - else { - this.#connect = url.clone(); - } - } - _getConnection() { - return this.#connect.clone(); - } - async send(method, params) { - // All requests are over HTTP, so we can just start handling requests - // We do this here rather than the constructor so that we don't send any - // requests to the network (i.e. eth_chainId) until we absolutely have to. - await this._start(); - return await super.send(method, params); - } - async _send(payload) { - // Configure a POST connection for the requested method - const request = this._getConnection(); - request.body = JSON.stringify(payload); - request.setHeader("content-type", "application/json"); - const response = await request.send(); - response.assertOk(); - let resp = response.bodyJson; - if (!Array.isArray(resp)) { - resp = [resp]; - } - return resp; - } -} -function spelunkData(value) { - if (value == null) { - return null; - } - // These *are* the droids we're looking for. - if (typeof (value.message) === "string" && value.message.match(/revert/i) && isHexString(value.data)) { - return { message: value.message, data: value.data }; - } - // Spelunk further... - if (typeof (value) === "object") { - for (const key in value) { - const result = spelunkData(value[key]); - if (result) { - return result; - } - } - return null; - } - // Might be a JSON string we can further descend... - if (typeof (value) === "string") { - try { - return spelunkData(JSON.parse(value)); - } - catch (error) { } - } - return null; -} -function _spelunkMessage(value, result) { - if (value == null) { - return; - } - // These *are* the droids we're looking for. - if (typeof (value.message) === "string") { - result.push(value.message); - } - // Spelunk further... - if (typeof (value) === "object") { - for (const key in value) { - _spelunkMessage(value[key], result); - } - } - // Might be a JSON string we can further descend... - if (typeof (value) === "string") { - try { - return _spelunkMessage(JSON.parse(value), result); - } - catch (error) { } - } -} -function spelunkMessage(value) { - const result = []; - _spelunkMessage(value, result); - return result; -} -//# sourceMappingURL=provider-jsonrpc.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-jsonrpc.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-jsonrpc.js.map deleted file mode 100644 index 7f223d14..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-jsonrpc.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-jsonrpc.js","sourceRoot":"","sources":["../../src.ts/providers/provider-jsonrpc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,SAAS;AACT,yBAAyB;AAEzB,yQAAyQ;AAEzQ,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EACH,gBAAgB,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,EAC1C,YAAY,EAAE,iBAAiB,EAClC,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACt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,CAAC,KAAK,CAAC,CAAC,CAAC;SACzC;QAAC,OAAO,KAAK,EAAE,GAAG;KACtB;IAED,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,eAAe,CAAC,KAAU,EAAE,MAAqB;IACtD,IAAI,KAAK,IAAI,IAAI,EAAE;QAAE,OAAO;KAAE;IAE9B,4CAA4C;IAC5C,IAAI,OAAM,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,QAAQ,EAAE;QACpC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;KAC9B;IAED,qBAAqB;IACrB,IAAI,OAAM,CAAC,KAAK,CAAC,KAAK,QAAQ,EAAE;QAC5B,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE;YACrB,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC;SACvC;KACJ;IAED,mDAAmD;IACnD,IAAI,OAAM,CAAC,KAAK,CAAC,KAAK,QAAQ,EAAE;QAC5B,IAAI;YACA,OAAO,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC;SACrD;QAAC,OAAO,KAAK,EAAE,GAAG;KACtB;AACL,CAAC;AAED,SAAS,cAAc,CAAC,KAAU;IAC9B,MAAM,MAAM,GAAkB,EAAG,CAAC;IAClC,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC/B,OAAO,MAAM,CAAC;AAClB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-pocket.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-pocket.d.ts deleted file mode 100644 index e0c4dc81..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-pocket.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -/** - * [[link-pocket]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Polygon (``matic``) - * - Arbitrum (``arbitrum``) - * - * @_subsection: api/providers/thirdparty:Pocket [providers-pocket] - */ -import { FetchRequest } from "../utils/index.js"; -import { AbstractProvider } from "./abstract-provider.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; -/** - * The **PocketProvider** connects to the [[link-pocket]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-pocket-signup). - */ -export declare class PocketProvider extends JsonRpcProvider implements CommunityResourcable { - /** - * The Application ID for the Pocket connection. - */ - readonly applicationId: string; - /** - * The Application Secret for making authenticated requests - * to the Pocket connection. - */ - readonly applicationSecret: null | string; - /** - * Create a new **PocketProvider**. - * - * By default connecting to ``mainnet`` with a highly throttled - * API key. - */ - constructor(_network?: Networkish, applicationId?: null | string, applicationSecret?: null | string); - _getProvider(chainId: number): AbstractProvider; - /** - * Returns a prepared request for connecting to %%network%% with - * %%applicationId%%. - */ - static getRequest(network: Network, applicationId?: null | string, applicationSecret?: null | string): FetchRequest; - isCommunityResource(): boolean; -} -//# sourceMappingURL=provider-pocket.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-pocket.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-pocket.d.ts.map deleted file mode 100644 index 1d989750..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-pocket.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-pocket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-pocket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EACe,YAAY,EACjC,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAqB/C;;;;;;;;GAQG;AACH,qBAAa,cAAe,SAAQ,eAAgB,YAAW,oBAAoB;IAE/E;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAG,MAAM,CAAC;IAEhC;;;OAGG;IACH,QAAQ,CAAC,iBAAiB,EAAG,IAAI,GAAG,MAAM,CAAC;IAE3C;;;;;OAKG;gBACS,QAAQ,CAAC,EAAE,UAAU,EAAE,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,EAAE,iBAAiB,CAAC,EAAE,IAAI,GAAG,MAAM;IAcnG,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB;IAO/C;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,EAAE,iBAAiB,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY;IAoBnH,mBAAmB,IAAI,OAAO;CAGjC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-pocket.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-pocket.js deleted file mode 100644 index af3e3289..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-pocket.js +++ /dev/null @@ -1,105 +0,0 @@ -/** - * [[link-pocket]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Polygon (``matic``) - * - Arbitrum (``arbitrum``) - * - * @_subsection: api/providers/thirdparty:Pocket [providers-pocket] - */ -import { defineProperties, FetchRequest, assertArgument } from "../utils/index.js"; -import { showThrottleMessage } from "./community.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -const defaultApplicationId = "62e1ad51b37b8e00394bda3b"; -function getHost(name) { - switch (name) { - case "mainnet": - return "eth-mainnet.gateway.pokt.network"; - case "goerli": - return "eth-goerli.gateway.pokt.network"; - case "matic": - return "poly-mainnet.gateway.pokt.network"; - case "matic-mumbai": - return "polygon-mumbai-rpc.gateway.pokt.network"; - } - assertArgument(false, "unsupported network", "network", name); -} -/** - * The **PocketProvider** connects to the [[link-pocket]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-pocket-signup). - */ -export class PocketProvider extends JsonRpcProvider { - /** - * The Application ID for the Pocket connection. - */ - applicationId; - /** - * The Application Secret for making authenticated requests - * to the Pocket connection. - */ - applicationSecret; - /** - * Create a new **PocketProvider**. - * - * By default connecting to ``mainnet`` with a highly throttled - * API key. - */ - constructor(_network, applicationId, applicationSecret) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (applicationId == null) { - applicationId = defaultApplicationId; - } - if (applicationSecret == null) { - applicationSecret = null; - } - const options = { staticNetwork: network }; - const request = PocketProvider.getRequest(network, applicationId, applicationSecret); - super(request, network, options); - defineProperties(this, { applicationId, applicationSecret }); - } - _getProvider(chainId) { - try { - return new PocketProvider(chainId, this.applicationId, this.applicationSecret); - } - catch (error) { } - return super._getProvider(chainId); - } - /** - * Returns a prepared request for connecting to %%network%% with - * %%applicationId%%. - */ - static getRequest(network, applicationId, applicationSecret) { - if (applicationId == null) { - applicationId = defaultApplicationId; - } - const request = new FetchRequest(`https:/\/${getHost(network.name)}/v1/lb/${applicationId}`); - request.allowGzip = true; - if (applicationSecret) { - request.setCredentials("", applicationSecret); - } - if (applicationId === defaultApplicationId) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("PocketProvider"); - return true; - }; - } - return request; - } - isCommunityResource() { - return (this.applicationId === defaultApplicationId); - } -} -//# sourceMappingURL=provider-pocket.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-pocket.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-pocket.js.map deleted file mode 100644 index d9c67985..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-pocket.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-pocket.js","sourceRoot":"","sources":["../../src.ts/providers/provider-pocket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EACH,gBAAgB,EAAE,YAAY,EAAE,cAAc,EACjD,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAKxD,MAAM,oBAAoB,GAAG,0BAA0B,CAAC;AAExD,SAAS,OAAO,CAAC,IAAY;IACzB,QAAQ,IAAI,EAAE;QACV,KAAK,SAAS;YACV,OAAQ,kCAAkC,CAAC;QAC/C,KAAK,QAAQ;YACT,OAAO,iCAAiC,CAAC;QAE7C,KAAK,OAAO;YACR,OAAO,mCAAmC,CAAC;QAC/C,KAAK,cAAc;YACf,OAAO,yCAAyC,CAAC;KACxD;IAED,cAAc,CAAC,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;AAClE,CAAC;AAGD;;;;;;;;GAQG;AACH,MAAM,OAAO,cAAe,SAAQ,eAAe;IAE/C;;OAEG;IACM,aAAa,CAAU;IAEhC;;;OAGG;IACM,iBAAiB,CAAiB;IAE3C;;;;;OAKG;IACH,YAAY,QAAqB,EAAE,aAA6B,EAAE,iBAAiC;QAC/F,IAAI,QAAQ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I,aAAa,KAAK,oBAAoB,EAAE;YACxC,OAAO,CAAC,SAAS,GAAG,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;gBACrD,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;gBACtC,OAAO,IAAI,CAAC;YAChB,CAAC,CAAC;SACL;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;IAED,mBAAmB;QACf,OAAO,CAAC,IAAI,CAAC,aAAa,KAAK,oBAAoB,CAAC,CAAC;IACzD,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-quicknode.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-quicknode.d.ts deleted file mode 100644 index 244ce2a9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-quicknode.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -/** - * [[link-quicknode]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Holesky Testnet (``holesky``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Arbitrum Sepolia Testnet (``arbitrum-sepolia``) - * - Base Mainnet (``base``); - * - Base Goerli Testnet (``base-goerli``); - * - Base Sepolia Testnet (``base-sepolia``); - * - BNB Smart Chain Mainnet (``bnb``) - * - BNB Smart Chain Testnet (``bnbt``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Optimism Sepolia Testnet (``optimism-sepolia``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:QuickNode [providers-quicknode] - */ -import { FetchRequest } from "../utils/index.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import type { AbstractProvider } from "./abstract-provider.js"; -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; -/** - * The **QuickNodeProvider** connects to the [[link-quicknode]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API token is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-quicknode). - */ -export declare class QuickNodeProvider extends JsonRpcProvider implements CommunityResourcable { - /** - * The API token. - */ - readonly token: string; - /** - * Creates a new **QuickNodeProvider**. - */ - constructor(_network?: Networkish, token?: null | string); - _getProvider(chainId: number): AbstractProvider; - isCommunityResource(): boolean; - /** - * Returns a new request prepared for %%network%% and the - * %%token%%. - */ - static getRequest(network: Network, token?: null | string): FetchRequest; -} -//# sourceMappingURL=provider-quicknode.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-quicknode.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-quicknode.d.ts.map deleted file mode 100644 index 1078f183..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-quicknode.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-quicknode.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-quicknode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EACe,YAAY,EACjC,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA+E/C;;;;;;;;GAQG;AACH,qBAAa,iBAAkB,SAAQ,eAAgB,YAAW,oBAAoB;IAClF;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAG,MAAM,CAAC;IAExB;;OAEG;gBACS,QAAQ,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM;IAWxD,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB;IAO/C,mBAAmB,IAAI,OAAO;IAI9B;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY;CAgB3E"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-quicknode.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-quicknode.js deleted file mode 100644 index 50c4bdea..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-quicknode.js +++ /dev/null @@ -1,159 +0,0 @@ -/** - * [[link-quicknode]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Holesky Testnet (``holesky``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Arbitrum Sepolia Testnet (``arbitrum-sepolia``) - * - Base Mainnet (``base``); - * - Base Goerli Testnet (``base-goerli``); - * - Base Sepolia Testnet (``base-sepolia``); - * - BNB Smart Chain Mainnet (``bnb``) - * - BNB Smart Chain Testnet (``bnbt``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Optimism Sepolia Testnet (``optimism-sepolia``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:QuickNode [providers-quicknode] - */ -import { defineProperties, FetchRequest, assertArgument } from "../utils/index.js"; -import { showThrottleMessage } from "./community.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -const defaultToken = "919b412a057b5e9c9b6dce193c5a60242d6efadb"; -function getHost(name) { - switch (name) { - case "mainnet": - return "ethers.quiknode.pro"; - case "goerli": - return "ethers.ethereum-goerli.quiknode.pro"; - case "sepolia": - return "ethers.ethereum-sepolia.quiknode.pro"; - case "holesky": - return "ethers.ethereum-holesky.quiknode.pro"; - case "arbitrum": - return "ethers.arbitrum-mainnet.quiknode.pro"; - case "arbitrum-goerli": - return "ethers.arbitrum-goerli.quiknode.pro"; - case "arbitrum-sepolia": - return "ethers.arbitrum-sepolia.quiknode.pro"; - case "base": - return "ethers.base-mainnet.quiknode.pro"; - case "base-goerli": - return "ethers.base-goerli.quiknode.pro"; - case "base-spolia": - return "ethers.base-sepolia.quiknode.pro"; - case "bnb": - return "ethers.bsc.quiknode.pro"; - case "bnbt": - return "ethers.bsc-testnet.quiknode.pro"; - case "matic": - return "ethers.matic.quiknode.pro"; - case "matic-mumbai": - return "ethers.matic-testnet.quiknode.pro"; - case "optimism": - return "ethers.optimism.quiknode.pro"; - case "optimism-goerli": - return "ethers.optimism-goerli.quiknode.pro"; - case "optimism-sepolia": - return "ethers.optimism-sepolia.quiknode.pro"; - case "xdai": - return "ethers.xdai.quiknode.pro"; - } - assertArgument(false, "unsupported network", "network", name); -} -/* -@TODO: - These networks are not currently present in the Network - default included networks. Research them and ensure they - are EVM compatible and work with ethers - - http://ethers.matic-amoy.quiknode.pro - - http://ethers.avalanche-mainnet.quiknode.pro - http://ethers.avalanche-testnet.quiknode.pro - http://ethers.blast-sepolia.quiknode.pro - http://ethers.celo-mainnet.quiknode.pro - http://ethers.fantom.quiknode.pro - http://ethers.imx-demo.quiknode.pro - http://ethers.imx-mainnet.quiknode.pro - http://ethers.imx-testnet.quiknode.pro - http://ethers.near-mainnet.quiknode.pro - http://ethers.near-testnet.quiknode.pro - http://ethers.nova-mainnet.quiknode.pro - http://ethers.scroll-mainnet.quiknode.pro - http://ethers.scroll-testnet.quiknode.pro - http://ethers.tron-mainnet.quiknode.pro - http://ethers.zkevm-mainnet.quiknode.pro - http://ethers.zkevm-testnet.quiknode.pro - http://ethers.zksync-mainnet.quiknode.pro - http://ethers.zksync-testnet.quiknode.pro -*/ -/** - * The **QuickNodeProvider** connects to the [[link-quicknode]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API token is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-quicknode). - */ -export class QuickNodeProvider extends JsonRpcProvider { - /** - * The API token. - */ - token; - /** - * Creates a new **QuickNodeProvider**. - */ - constructor(_network, token) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (token == null) { - token = defaultToken; - } - const request = QuickNodeProvider.getRequest(network, token); - super(request, network, { staticNetwork: network }); - defineProperties(this, { token }); - } - _getProvider(chainId) { - try { - return new QuickNodeProvider(chainId, this.token); - } - catch (error) { } - return super._getProvider(chainId); - } - isCommunityResource() { - return (this.token === defaultToken); - } - /** - * Returns a new request prepared for %%network%% and the - * %%token%%. - */ - static getRequest(network, token) { - if (token == null) { - token = defaultToken; - } - const request = new FetchRequest(`https:/\/${getHost(network.name)}/${token}`); - request.allowGzip = true; - //if (projectSecret) { request.setCredentials("", projectSecret); } - if (token === defaultToken) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("QuickNodeProvider"); - return true; - }; - } - return request; - } -} -//# sourceMappingURL=provider-quicknode.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-quicknode.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-quicknode.js.map deleted file mode 100644 index 213b61bb..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-quicknode.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-quicknode.js","sourceRoot":"","sources":["../../src.ts/providers/provider-quicknode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,O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,KAAK,YAAY,EAAE;YACxB,OAAO,CAAC,SAAS,GAAG,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;gBACrD,mBAAmB,CAAC,mBAAmB,CAAC,CAAC;gBACzC,OAAO,IAAI,CAAC;YAChB,CAAC,CAAC;SACL;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-socket.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-socket.d.ts deleted file mode 100644 index 41c58fc0..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-socket.d.ts +++ /dev/null @@ -1,113 +0,0 @@ -/** - * Generic long-lived socket provider. - * - * Sub-classing notes - * - a sub-class MUST call the `_start()` method once connected - * - a sub-class MUST override the `_write(string)` method - * - a sub-class MUST call `_processMessage(string)` for each message - * - * @_subsection: api/providers/abstract-provider:Socket Providers [about-socketProvider] - */ -import { JsonRpcApiProvider } from "./provider-jsonrpc.js"; -import type { Subscriber, Subscription } from "./abstract-provider.js"; -import type { EventFilter } from "./provider.js"; -import type { JsonRpcApiProviderOptions, JsonRpcError, JsonRpcPayload, JsonRpcResult } from "./provider-jsonrpc.js"; -import type { Networkish } from "./network.js"; -/** - * A **SocketSubscriber** uses a socket transport to handle events and - * should use [[_emit]] to manage the events. - */ -export declare class SocketSubscriber implements Subscriber { - #private; - /** - * The filter. - */ - get filter(): Array; - /** - * Creates a new **SocketSubscriber** attached to %%provider%% listening - * to %%filter%%. - */ - constructor(provider: SocketProvider, filter: Array); - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; - /** - * @_ignore: - */ - _handleMessage(message: any): void; - /** - * Sub-classes **must** override this to emit the events on the - * provider. - */ - _emit(provider: SocketProvider, message: any): Promise; -} -/** - * A **SocketBlockSubscriber** listens for ``newHeads`` events and emits - * ``"block"`` events. - */ -export declare class SocketBlockSubscriber extends SocketSubscriber { - /** - * @_ignore: - */ - constructor(provider: SocketProvider); - _emit(provider: SocketProvider, message: any): Promise; -} -/** - * A **SocketPendingSubscriber** listens for pending transacitons and emits - * ``"pending"`` events. - */ -export declare class SocketPendingSubscriber extends SocketSubscriber { - /** - * @_ignore: - */ - constructor(provider: SocketProvider); - _emit(provider: SocketProvider, message: any): Promise; -} -/** - * A **SocketEventSubscriber** listens for event logs. - */ -export declare class SocketEventSubscriber extends SocketSubscriber { - #private; - /** - * The filter. - */ - get logFilter(): EventFilter; - /** - * @_ignore: - */ - constructor(provider: SocketProvider, filter: EventFilter); - _emit(provider: SocketProvider, message: any): Promise; -} -/** - * A **SocketProvider** is backed by a long-lived connection over a - * socket, which can subscribe and receive real-time messages over - * its communication channel. - */ -export declare class SocketProvider extends JsonRpcApiProvider { - #private; - /** - * Creates a new **SocketProvider** connected to %%network%%. - * - * If unspecified, the network will be discovered. - */ - constructor(network?: Networkish, _options?: JsonRpcApiProviderOptions); - _getSubscriber(sub: Subscription): Subscriber; - /** - * Register a new subscriber. This is used internalled by Subscribers - * and generally is unecessary unless extending capabilities. - */ - _register(filterId: number | string, subscriber: SocketSubscriber): void; - _send(payload: JsonRpcPayload | Array): Promise>; - /** - * Sub-classes **must** call this with messages received over their - * transport to be processed and dispatched. - */ - _processMessage(message: string): Promise; - /** - * Sub-classes **must** override this to send %%message%% over their - * transport. - */ - _write(message: string): Promise; -} -//# sourceMappingURL=provider-socket.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-socket.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-socket.d.ts.map deleted file mode 100644 index 6748e7c2..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-socket.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-socket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-socket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GAS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,qBAAsB,SAAQ,gBAAgB;;IAGvD;;OAEG;IACH,IAAI,SAAS,IAAI,WAAW,CAAwC;IAEpE;;OAEG;gBACS,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW;IAKnD,KAAK,CAAC,QAAQ,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;CAGrE;AAED;;;;GAIG;AACH,qBAAa,cAAe,SAAQ,kBAAkB;;IAUlD;;;;OAIG;gBACS,OAAO,CAAC,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,yBAAyB;IAgCtE,cAAc,CAAC,GAAG,EAAE,YAAY,GAAG,UAAU;IAoB7C;;;OAGG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,UAAU,EAAE,gBAAgB,GAAG,IAAI;IAWlE,KAAK,CAAC,OAAO,EAAE,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,aAAa,GAAG,YAAY,CAAC,CAAC;IAmC1G;;;OAGG;IACG,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAuCrD;;;OAGG;IACG,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAG/C"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-socket.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-socket.js deleted file mode 100644 index 88bd7f58..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-socket.js +++ /dev/null @@ -1,301 +0,0 @@ -/** - * Generic long-lived socket provider. - * - * Sub-classing notes - * - a sub-class MUST call the `_start()` method once connected - * - a sub-class MUST override the `_write(string)` method - * - a sub-class MUST call `_processMessage(string)` for each message - * - * @_subsection: api/providers/abstract-provider:Socket Providers [about-socketProvider] - */ -import { UnmanagedSubscriber } from "./abstract-provider.js"; -import { assert, assertArgument, makeError } from "../utils/index.js"; -import { JsonRpcApiProvider } from "./provider-jsonrpc.js"; -/** - * A **SocketSubscriber** uses a socket transport to handle events and - * should use [[_emit]] to manage the events. - */ -export class SocketSubscriber { - #provider; - #filter; - /** - * The filter. - */ - get filter() { return JSON.parse(this.#filter); } - #filterId; - #paused; - #emitPromise; - /** - * Creates a new **SocketSubscriber** attached to %%provider%% listening - * to %%filter%%. - */ - constructor(provider, filter) { - this.#provider = provider; - this.#filter = JSON.stringify(filter); - this.#filterId = null; - this.#paused = null; - this.#emitPromise = null; - } - start() { - this.#filterId = this.#provider.send("eth_subscribe", this.filter).then((filterId) => { - ; - this.#provider._register(filterId, this); - return filterId; - }); - } - stop() { - (this.#filterId).then((filterId) => { - if (this.#provider.destroyed) { - return; - } - this.#provider.send("eth_unsubscribe", [filterId]); - }); - this.#filterId = null; - } - // @TODO: pause should trap the current blockNumber, unsub, and on resume use getLogs - // and resume - pause(dropWhilePaused) { - assert(dropWhilePaused, "preserve logs while paused not supported by SocketSubscriber yet", "UNSUPPORTED_OPERATION", { operation: "pause(false)" }); - this.#paused = !!dropWhilePaused; - } - resume() { - this.#paused = null; - } - /** - * @_ignore: - */ - _handleMessage(message) { - if (this.#filterId == null) { - return; - } - if (this.#paused === null) { - let emitPromise = this.#emitPromise; - if (emitPromise == null) { - emitPromise = this._emit(this.#provider, message); - } - else { - emitPromise = emitPromise.then(async () => { - await this._emit(this.#provider, message); - }); - } - this.#emitPromise = emitPromise.then(() => { - if (this.#emitPromise === emitPromise) { - this.#emitPromise = null; - } - }); - } - } - /** - * Sub-classes **must** override this to emit the events on the - * provider. - */ - async _emit(provider, message) { - throw new Error("sub-classes must implemente this; _emit"); - } -} -/** - * A **SocketBlockSubscriber** listens for ``newHeads`` events and emits - * ``"block"`` events. - */ -export class SocketBlockSubscriber extends SocketSubscriber { - /** - * @_ignore: - */ - constructor(provider) { - super(provider, ["newHeads"]); - } - async _emit(provider, message) { - provider.emit("block", parseInt(message.number)); - } -} -/** - * A **SocketPendingSubscriber** listens for pending transacitons and emits - * ``"pending"`` events. - */ -export class SocketPendingSubscriber extends SocketSubscriber { - /** - * @_ignore: - */ - constructor(provider) { - super(provider, ["newPendingTransactions"]); - } - async _emit(provider, message) { - provider.emit("pending", message); - } -} -/** - * A **SocketEventSubscriber** listens for event logs. - */ -export class SocketEventSubscriber extends SocketSubscriber { - #logFilter; - /** - * The filter. - */ - get logFilter() { return JSON.parse(this.#logFilter); } - /** - * @_ignore: - */ - constructor(provider, filter) { - super(provider, ["logs", filter]); - this.#logFilter = JSON.stringify(filter); - } - async _emit(provider, message) { - provider.emit(this.logFilter, provider._wrapLog(message, provider._network)); - } -} -/** - * A **SocketProvider** is backed by a long-lived connection over a - * socket, which can subscribe and receive real-time messages over - * its communication channel. - */ -export class SocketProvider extends JsonRpcApiProvider { - #callbacks; - // Maps each filterId to its subscriber - #subs; - // If any events come in before a subscriber has finished - // registering, queue them - #pending; - /** - * Creates a new **SocketProvider** connected to %%network%%. - * - * If unspecified, the network will be discovered. - */ - constructor(network, _options) { - // Copy the options - const options = Object.assign({}, (_options != null) ? _options : {}); - // Support for batches is generally not supported for - // connection-base providers; if this changes in the future - // the _send should be updated to reflect this - assertArgument(options.batchMaxCount == null || options.batchMaxCount === 1, "sockets-based providers do not support batches", "options.batchMaxCount", _options); - options.batchMaxCount = 1; - // Socket-based Providers (generally) cannot change their network, - // since they have a long-lived connection; but let people override - // this if they have just cause. - if (options.staticNetwork == null) { - options.staticNetwork = true; - } - super(network, options); - this.#callbacks = new Map(); - this.#subs = new Map(); - this.#pending = new Map(); - } - // This value is only valid after _start has been called - /* - get _network(): Network { - if (this.#network == null) { - throw new Error("this shouldn't happen"); - } - return this.#network.clone(); - } - */ - _getSubscriber(sub) { - switch (sub.type) { - case "close": - return new UnmanagedSubscriber("close"); - case "block": - return new SocketBlockSubscriber(this); - case "pending": - return new SocketPendingSubscriber(this); - case "event": - return new SocketEventSubscriber(this, sub.filter); - case "orphan": - // Handled auto-matically within AbstractProvider - // when the log.removed = true - if (sub.filter.orphan === "drop-log") { - return new UnmanagedSubscriber("drop-log"); - } - } - return super._getSubscriber(sub); - } - /** - * Register a new subscriber. This is used internalled by Subscribers - * and generally is unecessary unless extending capabilities. - */ - _register(filterId, subscriber) { - this.#subs.set(filterId, subscriber); - const pending = this.#pending.get(filterId); - if (pending) { - for (const message of pending) { - subscriber._handleMessage(message); - } - this.#pending.delete(filterId); - } - } - async _send(payload) { - // WebSocket provider doesn't accept batches - assertArgument(!Array.isArray(payload), "WebSocket does not support batch send", "payload", payload); - // @TODO: stringify payloads here and store to prevent mutations - // Prepare a promise to respond to - const promise = new Promise((resolve, reject) => { - this.#callbacks.set(payload.id, { payload, resolve, reject }); - }); - // Wait until the socket is connected before writing to it - await this._waitUntilReady(); - // Write the request to the socket - await this._write(JSON.stringify(payload)); - return [await promise]; - } - // Sub-classes must call this once they are connected - /* - async _start(): Promise { - if (this.#ready) { return; } - - for (const { payload } of this.#callbacks.values()) { - await this._write(JSON.stringify(payload)); - } - - this.#ready = (async function() { - await super._start(); - })(); - } - */ - /** - * Sub-classes **must** call this with messages received over their - * transport to be processed and dispatched. - */ - async _processMessage(message) { - const result = (JSON.parse(message)); - if (result && typeof (result) === "object" && "id" in result) { - const callback = this.#callbacks.get(result.id); - if (callback == null) { - this.emit("error", makeError("received result for unknown id", "UNKNOWN_ERROR", { - reasonCode: "UNKNOWN_ID", - result - })); - return; - } - this.#callbacks.delete(result.id); - callback.resolve(result); - } - else if (result && result.method === "eth_subscription") { - const filterId = result.params.subscription; - const subscriber = this.#subs.get(filterId); - if (subscriber) { - subscriber._handleMessage(result.params.result); - } - else { - let pending = this.#pending.get(filterId); - if (pending == null) { - pending = []; - this.#pending.set(filterId, pending); - } - pending.push(result.params.result); - } - } - else { - this.emit("error", makeError("received unexpected message", "UNKNOWN_ERROR", { - reasonCode: "UNEXPECTED_MESSAGE", - result - })); - return; - } - } - /** - * Sub-classes **must** override this to send %%message%% over their - * transport. - */ - async _write(message) { - throw new Error("sub-classes must override this"); - } -} -//# sourceMappingURL=provider-socket.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-socket.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-socket.js.map deleted file mode 100644 index f8ee02db..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-socket.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-socket.js","sourceRoot":"","sources":["../../src.ts/providers/provider-socket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAkB3D;;;GAGG;AACH,MAAM,OAAO,gBAAgB;IACzB,SAAS,CAAiB;IAE1B,OAAO,CAAS;IAEhB;;OAEG;IACH,IAAI,MAAM,KAAiB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAE7D,SAAS,CAAiC;IAC1C,OAAO,CAAiB;IAExB,YAAY,CAAuB;IAEnC;;;OAGG;IACH,YAAY,QAAwB,EAAE,MAAkB;QACpD,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACtC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;IAC7B,CAAC;IAED,KAAK;QACD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,MAAM,CAAC,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B;aAAM,IAAI,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,kBAAkB,EAAE;YACvD,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;YAC5C,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YAC5C,IAAI,UAAU,EAAE;gBACZ,UAAU,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;aACnD;iBAAM;gBACH,IAAI,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;gBAC1C,IAAI,OAAO,IAAI,IAAI,EAAE;oBACjB,OAAO,GAAG,EAAG,CAAC;oBACd,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;iBACxC;gBACD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;aACtC;SAEJ;aAAM;YACH,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,6BAA6B,EAAE,eAAe,EAAE;gBACzE,UAAU,EAAE,oBAAoB;gBAChC,MAAM;aACT,CAAC,CAAC,CAAC;YACJ,OAAO;SACV;IACL,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,MAAM,CAAC,OAAe;QACxB,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACtD,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-websocket.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-websocket.d.ts deleted file mode 100644 index b34c9842..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-websocket.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { SocketProvider } from "./provider-socket.js"; -import type { JsonRpcApiProviderOptions } from "./provider-jsonrpc.js"; -import type { Networkish } from "./network.js"; -/** - * A generic interface to a Websocket-like object. - */ -export interface WebSocketLike { - onopen: null | ((...args: Array) => any); - onmessage: null | ((...args: Array) => any); - onerror: null | ((...args: Array) => any); - readyState: number; - send(payload: any): void; - close(code?: number, reason?: string): void; -} -/** - * A function which can be used to re-create a WebSocket connection - * on disconnect. - */ -export type WebSocketCreator = () => WebSocketLike; -/** - * A JSON-RPC provider which is backed by a WebSocket. - * - * WebSockets are often preferred because they retain a live connection - * to a server, which permits more instant access to events. - * - * However, this incurs higher server infrasturture costs, so additional - * resources may be required to host your own WebSocket nodes and many - * third-party services charge additional fees for WebSocket endpoints. - */ -export declare class WebSocketProvider extends SocketProvider { - #private; - get websocket(): WebSocketLike; - constructor(url: string | WebSocketLike | WebSocketCreator, network?: Networkish, options?: JsonRpcApiProviderOptions); - _write(message: string): Promise; - destroy(): Promise; -} -//# sourceMappingURL=provider-websocket.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-websocket.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-websocket.d.ts.map deleted file mode 100644 index 886b1976..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-websocket.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-websocket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-websocket.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,yBAAyB,EAAC,MAAM,uBAAuB,CAAC;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B,MAAM,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;IAC9C,SAAS,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;IACjD,OAAO,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;IAE/C,UAAU,EAAE,MAAM,CAAC;IAEnB,IAAI,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI,CAAC;IACzB,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/C;AAED;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,aAAa,CAAC;AAEnD;;;;;;;;;GASG;AACH,qBAAa,iBAAkB,SAAQ,cAAc;;IAIjD,IAAI,SAAS,IAAI,aAAa,CAG7B;gBAEW,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,gBAAgB,EAAE,OAAO,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,yBAAyB;IA2C/G,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAItC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAOjC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-websocket.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-websocket.js deleted file mode 100644 index 2f4fb2e5..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-websocket.js +++ /dev/null @@ -1,76 +0,0 @@ -import { WebSocket as _WebSocket } from "./ws.js"; /*-browser*/ -import { SocketProvider } from "./provider-socket.js"; -/** - * A JSON-RPC provider which is backed by a WebSocket. - * - * WebSockets are often preferred because they retain a live connection - * to a server, which permits more instant access to events. - * - * However, this incurs higher server infrasturture costs, so additional - * resources may be required to host your own WebSocket nodes and many - * third-party services charge additional fees for WebSocket endpoints. - */ -export class WebSocketProvider extends SocketProvider { - #connect; - #websocket; - get websocket() { - if (this.#websocket == null) { - throw new Error("websocket closed"); - } - return this.#websocket; - } - constructor(url, network, options) { - super(network, options); - if (typeof (url) === "string") { - this.#connect = () => { return new _WebSocket(url); }; - this.#websocket = this.#connect(); - } - else if (typeof (url) === "function") { - this.#connect = url; - this.#websocket = url(); - } - else { - this.#connect = null; - this.#websocket = url; - } - this.websocket.onopen = async () => { - try { - await this._start(); - this.resume(); - } - catch (error) { - console.log("failed to start WebsocketProvider", error); - // @TODO: now what? Attempt reconnect? - } - }; - this.websocket.onmessage = (message) => { - this._processMessage(message.data); - }; - /* - this.websocket.onclose = (event) => { - // @TODO: What event.code should we reconnect on? - const reconnect = false; - if (reconnect) { - this.pause(true); - if (this.#connect) { - this.#websocket = this.#connect(); - this.#websocket.onopen = ... - // @TODO: this requires the super class to rebroadcast; move it there - } - this._reconnect(); - } - }; - */ - } - async _write(message) { - this.websocket.send(message); - } - async destroy() { - if (this.#websocket != null) { - this.#websocket.close(); - this.#websocket = null; - } - super.destroy(); - } -} -//# sourceMappingURL=provider-websocket.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-websocket.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-websocket.js.map deleted file mode 100644 index 42a83b53..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider-websocket.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-websocket.js","sourceRoot":"","sources":["../../src.ts/providers/provider-websocket.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,IAAI,UAAU,EAAE,MAAM,SAAS,CAAC,CAAC,YAAY;AAE/D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAyBtD;;;;;;;;;GASG;AACH,MAAM,OAAO,iBAAkB,SAAQ,cAAc;IACjD,QAAQ,CAA0B;IAElC,UAAU,CAAuB;IACjC,IAAI,SAAS;QACT,IAAI,IAAI,CAAC,UAAU,IAAI,IA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C,OAAO,CAAC,CAAC;IACjC,CAAC;IAED,KAAK,CAAC,OAAO;QACT,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,EAAE;YACzB,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;YACxB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;SAC1B;QACD,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider.d.ts deleted file mode 100644 index 6443dbc3..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider.d.ts +++ /dev/null @@ -1,1230 +0,0 @@ -import type { AddressLike, NameResolver } from "../address/index.js"; -import type { BigNumberish, EventEmitterable } from "../utils/index.js"; -import type { Signature } from "../crypto/index.js"; -import type { AccessList, AccessListish, Authorization, AuthorizationLike, BlobLike, KzgLibraryLike, TransactionLike } from "../transaction/index.js"; -import type { ContractRunner } from "./contracts.js"; -import type { Network } from "./network.js"; -/** - * A **BlockTag** specifies a specific block. - * - * **numeric value** - specifies the block height, where - * the genesis block is block 0; many operations accept a negative - * value which indicates the block number should be deducted from - * the most recent block. A numeric value may be a ``number``, ``bigint``, - * or a decimal of hex string. - * - * **blockhash** - specifies a specific block by its blockhash; this allows - * potentially orphaned blocks to be specifed, without ambiguity, but many - * backends do not support this for some operations. - */ -export type BlockTag = BigNumberish | string; -import { BlockParams, LogParams, TransactionReceiptParams, TransactionResponseParams } from "./formatting.js"; -/** - * A **FeeData** wraps all the fee-related values associated with - * the network. - */ -export declare class FeeData { - /** - * The gas price for legacy networks. - */ - readonly gasPrice: null | bigint; - /** - * The maximum fee to pay per gas. - * - * The base fee per gas is defined by the network and based on - * congestion, increasing the cost during times of heavy load - * and lowering when less busy. - * - * The actual fee per gas will be the base fee for the block - * and the priority fee, up to the max fee per gas. - * - * This will be ``null`` on legacy networks (i.e. [pre-EIP-1559](link-eip-1559)) - */ - readonly maxFeePerGas: null | bigint; - /** - * The additional amout to pay per gas to encourage a validator - * to include the transaction. - * - * The purpose of this is to compensate the validator for the - * adjusted risk for including a given transaction. - * - * This will be ``null`` on legacy networks (i.e. [pre-EIP-1559](link-eip-1559)) - */ - readonly maxPriorityFeePerGas: null | bigint; - /** - * Creates a new FeeData for %%gasPrice%%, %%maxFeePerGas%% and - * %%maxPriorityFeePerGas%%. - */ - constructor(gasPrice?: null | bigint, maxFeePerGas?: null | bigint, maxPriorityFeePerGas?: null | bigint); - /** - * Returns a JSON-friendly value. - */ - toJSON(): any; -} -/** - * A **TransactionRequest** is a transactions with potentially various - * properties not defined, or with less strict types for its values. - * - * This is used to pass to various operations, which will internally - * coerce any types and populate any necessary values. - */ -export interface TransactionRequest { - /** - * The transaction type. - */ - type?: null | number; - /** - * The target of the transaction. - */ - to?: null | AddressLike; - /** - * The sender of the transaction. - */ - from?: null | AddressLike; - /** - * The nonce of the transaction, used to prevent replay attacks. - */ - nonce?: null | number; - /** - * The maximum amount of gas to allow this transaction to consume. - */ - gasLimit?: null | BigNumberish; - /** - * The gas price to use for legacy transactions or transactions on - * legacy networks. - * - * Most of the time the ``max*FeePerGas`` is preferred. - */ - gasPrice?: null | BigNumberish; - /** - * The [[link-eip-1559]] maximum priority fee to pay per gas. - */ - maxPriorityFeePerGas?: null | BigNumberish; - /** - * The [[link-eip-1559]] maximum total fee to pay per gas. The actual - * value used is protocol enforced to be the block's base fee. - */ - maxFeePerGas?: null | BigNumberish; - /** - * The transaction data. - */ - data?: null | string; - /** - * The transaction value (in wei). - */ - value?: null | BigNumberish; - /** - * The chain ID for the network this transaction is valid on. - */ - chainId?: null | BigNumberish; - /** - * The [[link-eip-2930]] access list. Storage slots included in the access - * list are //warmed// by pre-loading them, so their initial cost to - * fetch is guaranteed, but then each additional access is cheaper. - */ - accessList?: null | AccessListish; - /** - * A custom object, which can be passed along for network-specific - * values. - */ - customData?: any; - /** - * When using ``call`` or ``estimateGas``, this allows a specific - * block to be queried. Many backends do not support this and when - * unsupported errors are silently squelched and ``"latest"`` is used. - */ - blockTag?: BlockTag; - /** - * When using ``call``, this enables CCIP-read, which permits the - * provider to be redirected to web-based content during execution, - * which is then further validated by the contract. - * - * There are potential security implications allowing CCIP-read, as - * it could be used to expose the IP address or user activity during - * the fetch to unexpected parties. - */ - enableCcipRead?: boolean; - /** - * The blob versioned hashes (see [[link-eip-4844]]). - */ - blobVersionedHashes?: null | Array; - /** - * The maximum fee per blob gas (see [[link-eip-4844]]). - */ - maxFeePerBlobGas?: null | BigNumberish; - /** - * Any blobs to include in the transaction (see [[link-eip-4844]]). - */ - blobs?: null | Array; - /** - * An external library for computing the KZG commitments and - * proofs necessary for EIP-4844 transactions (see [[link-eip-4844]]). - * - * This is generally ``null``, unless you are creating BLOb - * transactions. - */ - kzg?: null | KzgLibraryLike; - /** - * The [[link-eip-7594]] BLOb Wrapper Version used for PeerDAS. - * - * For networks that use EIP-7594, this property is required to - * serialize the sidecar correctly. - */ - blobWrapperVersion?: null | number; - /** - * The [[link-eip-7702]] authorizations (if any). - */ - authorizationList?: null | Array; -} -/** - * A **PreparedTransactionRequest** is identical to a [[TransactionRequest]] - * except all the property types are strictly enforced. - */ -export interface PreparedTransactionRequest { - /** - * The transaction type. - */ - type?: number; - /** - * The target of the transaction. - */ - to?: AddressLike; - /** - * The sender of the transaction. - */ - from?: AddressLike; - /** - * The nonce of the transaction, used to prevent replay attacks. - */ - nonce?: number; - /** - * The maximum amount of gas to allow this transaction to consume. - */ - gasLimit?: bigint; - /** - * The gas price to use for legacy transactions or transactions on - * legacy networks. - * - * Most of the time the ``max*FeePerGas`` is preferred. - */ - gasPrice?: bigint; - /** - * The [[link-eip-1559]] maximum priority fee to pay per gas. - */ - maxPriorityFeePerGas?: bigint; - /** - * The [[link-eip-1559]] maximum total fee to pay per gas. The actual - * value used is protocol enforced to be the block's base fee. - */ - maxFeePerGas?: bigint; - /** - * The transaction data. - */ - data?: string; - /** - * The transaction value (in wei). - */ - value?: bigint; - /** - * The chain ID for the network this transaction is valid on. - */ - chainId?: bigint; - /** - * The [[link-eip-2930]] access list. Storage slots included in the access - * list are //warmed// by pre-loading them, so their initial cost to - * fetch is guaranteed, but then each additional access is cheaper. - */ - accessList?: AccessList; - /** - * The [[link-eip-7702]] authorizations (if any). - */ - authorizationList?: Array; - /** - * A custom object, which can be passed along for network-specific - * values. - */ - customData?: any; - /** - * When using ``call`` or ``estimateGas``, this allows a specific - * block to be queried. Many backends do not support this and when - * unsupported errors are silently squelched and ``"latest"`` is used. - */ - blockTag?: BlockTag; - /** - * When using ``call``, this enables CCIP-read, which permits the - * provider to be redirected to web-based content during execution, - * which is then further validated by the contract. - * - * There are potential security implications allowing CCIP-read, as - * it could be used to expose the IP address or user activity during - * the fetch to unexpected parties. - */ - enableCcipRead?: boolean; -} -/** - * Returns a copy of %%req%% with all properties coerced to their strict - * types. - */ -export declare function copyRequest(req: TransactionRequest): PreparedTransactionRequest; -/** - * An Interface to indicate a [[Block]] has been included in the - * blockchain. This asserts a Type Guard that necessary properties - * are non-null. - * - * Before a block is included, it is a //pending// block. - */ -export interface MinedBlock extends Block { - /** - * The block number also known as the block height. - */ - readonly number: number; - /** - * The block hash. - */ - readonly hash: string; - /** - * The block timestamp, in seconds from epoch. - */ - readonly timestamp: number; - /** - * The block date, created from the [[timestamp]]. - */ - readonly date: Date; - /** - * The miner of the block, also known as the ``author`` or - * block ``producer``. - */ - readonly miner: string; -} -/** - * A **Block** represents the data associated with a full block on - * Ethereum. - */ -export declare class Block implements BlockParams, Iterable { - #private; - /** - * The provider connected to the block used to fetch additional details - * if necessary. - */ - readonly provider: Provider; - /** - * The block number, sometimes called the block height. This is a - * sequential number that is one higher than the parent block. - */ - readonly number: number; - /** - * The block hash. - * - * This hash includes all properties, so can be safely used to identify - * an exact set of block properties. - */ - readonly hash: null | string; - /** - * The timestamp for this block, which is the number of seconds since - * epoch that this block was included. - */ - readonly timestamp: number; - /** - * The block hash of the parent block. - */ - readonly parentHash: string; - /** - * The hash tree root of the parent beacon block for the given - * execution block. See [[link-eip-4788]]. - */ - parentBeaconBlockRoot: null | string; - /** - * The nonce. - * - * On legacy networks, this is the random number inserted which - * permitted the difficulty target to be reached. - */ - readonly nonce: string; - /** - * The difficulty target. - * - * On legacy networks, this is the proof-of-work target required - * for a block to meet the protocol rules to be included. - * - * On modern networks, this is a random number arrived at using - * randao. @TODO: Find links? - */ - readonly difficulty: bigint; - /** - * The total gas limit for this block. - */ - readonly gasLimit: bigint; - /** - * The total gas used in this block. - */ - readonly gasUsed: bigint; - /** - * The root hash for the global state after applying changes - * in this block. - */ - readonly stateRoot: null | string; - /** - * The hash of the transaction receipts trie. - */ - readonly receiptsRoot: null | string; - /** - * The total amount of blob gas consumed by the transactions - * within the block. See [[link-eip-4844]]. - */ - readonly blobGasUsed: null | bigint; - /** - * The running total of blob gas consumed in excess of the - * target, prior to the block. See [[link-eip-4844]]. - */ - readonly excessBlobGas: null | bigint; - /** - * The miner coinbase address, wihch receives any subsidies for - * including this block. - */ - readonly miner: string; - /** - * The latest RANDAO mix of the post beacon state of - * the previous block. - */ - readonly prevRandao: null | string; - /** - * Any extra data the validator wished to include. - */ - readonly extraData: string; - /** - * The base fee per gas that all transactions in this block were - * charged. - * - * This adjusts after each block, depending on how congested the network - * is. - */ - readonly baseFeePerGas: null | bigint; - /** - * Create a new **Block** object. - * - * This should generally not be necessary as the unless implementing a - * low-level library. - */ - constructor(block: BlockParams, provider: Provider); - /** - * Returns the list of transaction hashes, in the order - * they were executed within the block. - */ - get transactions(): ReadonlyArray; - /** - * Returns the complete transactions, in the order they - * were executed within the block. - * - * This is only available for blocks which prefetched - * transactions, by passing ``true`` to %%prefetchTxs%% - * into [[Provider-getBlock]]. - */ - get prefetchedTransactions(): Array; - /** - * Returns a JSON-friendly value. - */ - toJSON(): any; - [Symbol.iterator](): Iterator; - /** - * The number of transactions in this block. - */ - get length(): number; - /** - * The [[link-js-date]] this block was included at. - */ - get date(): null | Date; - /** - * Get the transaction at %%indexe%% within this block. - */ - getTransaction(indexOrHash: number | string): Promise; - /** - * If a **Block** was fetched with a request to include the transactions - * this will allow synchronous access to those transactions. - * - * If the transactions were not prefetched, this will throw. - */ - getPrefetchedTransaction(indexOrHash: number | string): TransactionResponse; - /** - * Returns true if this block been mined. This provides a type guard - * for all properties on a [[MinedBlock]]. - */ - isMined(): this is MinedBlock; - /** - * Returns true if this block is an [[link-eip-2930]] block. - */ - isLondon(): this is (Block & { - baseFeePerGas: bigint; - }); - /** - * @_ignore: - */ - orphanedEvent(): OrphanFilter; -} -/** - * A **Log** in Ethereum represents an event that has been included in a - * transaction using the ``LOG*`` opcodes, which are most commonly used by - * Solidity's emit for announcing events. - */ -export declare class Log implements LogParams { - /** - * The provider connected to the log used to fetch additional details - * if necessary. - */ - readonly provider: Provider; - /** - * The transaction hash of the transaction this log occurred in. Use the - * [[Log-getTransaction]] to get the [[TransactionResponse]]. - */ - readonly transactionHash: string; - /** - * The block hash of the block this log occurred in. Use the - * [[Log-getBlock]] to get the [[Block]]. - */ - readonly blockHash: string; - /** - * The block number of the block this log occurred in. It is preferred - * to use the [[Block-hash]] when fetching the related [[Block]], - * since in the case of an orphaned block, the block at that height may - * have changed. - */ - readonly blockNumber: number; - /** - * If the **Log** represents a block that was removed due to an orphaned - * block, this will be true. - * - * This can only happen within an orphan event listener. - */ - readonly removed: boolean; - /** - * The address of the contract that emitted this log. - */ - readonly address: string; - /** - * The data included in this log when it was emitted. - */ - readonly data: string; - /** - * The indexed topics included in this log when it was emitted. - * - * All topics are included in the bloom filters, so they can be - * efficiently filtered using the [[Provider-getLogs]] method. - */ - readonly topics: ReadonlyArray; - /** - * The index within the block this log occurred at. This is generally - * not useful to developers, but can be used with the various roots - * to proof inclusion within a block. - */ - readonly index: number; - /** - * The index within the transaction of this log. - */ - readonly transactionIndex: number; - /** - * @_ignore: - */ - constructor(log: LogParams, provider: Provider); - /** - * Returns a JSON-compatible object. - */ - toJSON(): any; - /** - * Returns the block that this log occurred in. - */ - getBlock(): Promise; - /** - * Returns the transaction that this log occurred in. - */ - getTransaction(): Promise; - /** - * Returns the transaction receipt fot the transaction that this - * log occurred in. - */ - getTransactionReceipt(): Promise; - /** - * @_ignore: - */ - removedEvent(): OrphanFilter; -} -/** - * A **TransactionReceipt** includes additional information about a - * transaction that is only available after it has been mined. - */ -export declare class TransactionReceipt implements TransactionReceiptParams, Iterable { - #private; - /** - * The provider connected to the log used to fetch additional details - * if necessary. - */ - readonly provider: Provider; - /** - * The address the transaction was sent to. - */ - readonly to: null | string; - /** - * The sender of the transaction. - */ - readonly from: string; - /** - * The address of the contract if the transaction was directly - * responsible for deploying one. - * - * This is non-null **only** if the ``to`` is empty and the ``data`` - * was successfully executed as initcode. - */ - readonly contractAddress: null | string; - /** - * The transaction hash. - */ - readonly hash: string; - /** - * The index of this transaction within the block transactions. - */ - readonly index: number; - /** - * The block hash of the [[Block]] this transaction was included in. - */ - readonly blockHash: string; - /** - * The block number of the [[Block]] this transaction was included in. - */ - readonly blockNumber: number; - /** - * The bloom filter bytes that represent all logs that occurred within - * this transaction. This is generally not useful for most developers, - * but can be used to validate the included logs. - */ - readonly logsBloom: string; - /** - * The actual amount of gas used by this transaction. - * - * When creating a transaction, the amount of gas that will be used can - * only be approximated, but the sender must pay the gas fee for the - * entire gas limit. After the transaction, the difference is refunded. - */ - readonly gasUsed: bigint; - /** - * The gas used for BLObs. See [[link-eip-4844]]. - */ - readonly blobGasUsed: null | bigint; - /** - * The amount of gas used by all transactions within the block for this - * and all transactions with a lower ``index``. - * - * This is generally not useful for developers but can be used to - * validate certain aspects of execution. - */ - readonly cumulativeGasUsed: bigint; - /** - * The actual gas price used during execution. - * - * Due to the complexity of [[link-eip-1559]] this value can only - * be caluclated after the transaction has been mined, snce the base - * fee is protocol-enforced. - */ - readonly gasPrice: bigint; - /** - * The price paid per BLOB in gas. See [[link-eip-4844]]. - */ - readonly blobGasPrice: null | bigint; - /** - * The [[link-eip-2718]] transaction type. - */ - readonly type: number; - /** - * The status of this transaction, indicating success (i.e. ``1``) or - * a revert (i.e. ``0``). - * - * This is available in post-byzantium blocks, but some backends may - * backfill this value. - */ - readonly status: null | number; - /** - * The root hash of this transaction. - * - * This is no present and was only included in pre-byzantium blocks, but - * could be used to validate certain parts of the receipt. - */ - readonly root: null | string; - /** - * @_ignore: - */ - constructor(tx: TransactionReceiptParams, provider: Provider); - /** - * The logs for this transaction. - */ - get logs(): ReadonlyArray; - /** - * Returns a JSON-compatible representation. - */ - toJSON(): any; - /** - * @_ignore: - */ - get length(): number; - [Symbol.iterator](): Iterator; - /** - * The total fee for this transaction, in wei. - */ - get fee(): bigint; - /** - * Resolves to the block this transaction occurred in. - */ - getBlock(): Promise; - /** - * Resolves to the transaction this transaction occurred in. - */ - getTransaction(): Promise; - /** - * Resolves to the return value of the execution of this transaction. - * - * Support for this feature is limited, as it requires an archive node - * with the ``debug_`` or ``trace_`` API enabled. - */ - getResult(): Promise; - /** - * Resolves to the number of confirmations this transaction has. - */ - confirmations(): Promise; - /** - * @_ignore: - */ - removedEvent(): OrphanFilter; - /** - * @_ignore: - */ - reorderedEvent(other?: TransactionResponse): OrphanFilter; -} -/** - * A **MinedTransactionResponse** is an interface representing a - * transaction which has been mined and allows for a type guard for its - * property values being defined. - */ -export interface MinedTransactionResponse extends TransactionResponse { - /** - * The block number this transaction occurred in. - */ - blockNumber: number; - /** - * The block hash this transaction occurred in. - */ - blockHash: string; - /** - * The date this transaction occurred on. - */ - date: Date; -} -/** - * A **TransactionResponse** includes all properties about a transaction - * that was sent to the network, which may or may not be included in a - * block. - * - * The [[TransactionResponse-isMined]] can be used to check if the - * transaction has been mined as well as type guard that the otherwise - * possibly ``null`` properties are defined. - */ -export declare class TransactionResponse implements TransactionLike, TransactionResponseParams { - #private; - /** - * The provider this is connected to, which will influence how its - * methods will resolve its async inspection methods. - */ - readonly provider: Provider; - /** - * The block number of the block that this transaction was included in. - * - * This is ``null`` for pending transactions. - */ - readonly blockNumber: null | number; - /** - * The blockHash of the block that this transaction was included in. - * - * This is ``null`` for pending transactions. - */ - readonly blockHash: null | string; - /** - * The index within the block that this transaction resides at. - */ - readonly index: number; - /** - * The transaction hash. - */ - readonly hash: string; - /** - * The [[link-eip-2718]] transaction envelope type. This is - * ``0`` for legacy transactions types. - */ - readonly type: number; - /** - * The receiver of this transaction. - * - * If ``null``, then the transaction is an initcode transaction. - * This means the result of executing the [[data]] will be deployed - * as a new contract on chain (assuming it does not revert) and the - * address may be computed using [[getCreateAddress]]. - */ - readonly to: null | string; - /** - * The sender of this transaction. It is implicitly computed - * from the transaction pre-image hash (as the digest) and the - * [[signature]] using ecrecover. - */ - readonly from: string; - /** - * The nonce, which is used to prevent replay attacks and offer - * a method to ensure transactions from a given sender are explicitly - * ordered. - * - * When sending a transaction, this must be equal to the number of - * transactions ever sent by [[from]]. - */ - readonly nonce: number; - /** - * The maximum units of gas this transaction can consume. If execution - * exceeds this, the entries transaction is reverted and the sender - * is charged for the full amount, despite not state changes being made. - */ - readonly gasLimit: bigint; - /** - * The gas price can have various values, depending on the network. - * - * In modern networks, for transactions that are included this is - * the //effective gas price// (the fee per gas that was actually - * charged), while for transactions that have not been included yet - * is the [[maxFeePerGas]]. - * - * For legacy transactions, or transactions on legacy networks, this - * is the fee that will be charged per unit of gas the transaction - * consumes. - */ - readonly gasPrice: bigint; - /** - * The maximum priority fee (per unit of gas) to allow a - * validator to charge the sender. This is inclusive of the - * [[maxFeeFeePerGas]]. - */ - readonly maxPriorityFeePerGas: null | bigint; - /** - * The maximum fee (per unit of gas) to allow this transaction - * to charge the sender. - */ - readonly maxFeePerGas: null | bigint; - /** - * The [[link-eip-4844]] max fee per BLOb gas. - */ - readonly maxFeePerBlobGas: null | bigint; - /** - * The data. - */ - readonly data: string; - /** - * The value, in wei. Use [[formatEther]] to format this value - * as ether. - */ - readonly value: bigint; - /** - * The chain ID. - */ - readonly chainId: bigint; - /** - * The signature. - */ - readonly signature: Signature; - /** - * The [[link-eip-2930]] access list for transaction types that - * support it, otherwise ``null``. - */ - readonly accessList: null | AccessList; - /** - * The [[link-eip-4844]] BLOb versioned hashes. - */ - readonly blobVersionedHashes: null | Array; - /** - * The [[link-eip-7702]] authorizations (if any). - */ - readonly authorizationList: null | Array; - /** - * @_ignore: - */ - constructor(tx: TransactionResponseParams, provider: Provider); - /** - * Returns a JSON-compatible representation of this transaction. - */ - toJSON(): any; - /** - * Resolves to the Block that this transaction was included in. - * - * This will return null if the transaction has not been included yet. - */ - getBlock(): Promise; - /** - * Resolves to this transaction being re-requested from the - * provider. This can be used if you have an unmined transaction - * and wish to get an up-to-date populated instance. - */ - getTransaction(): Promise; - /** - * Resolve to the number of confirmations this transaction has. - */ - confirmations(): Promise; - /** - * Resolves once this transaction has been mined and has - * %%confirms%% blocks including it (default: ``1``) with an - * optional %%timeout%%. - * - * This can resolve to ``null`` only if %%confirms%% is ``0`` - * and the transaction has not been mined, otherwise this will - * wait until enough confirmations have completed. - */ - wait(_confirms?: number, _timeout?: number): Promise; - /** - * Returns ``true`` if this transaction has been included. - * - * This is effective only as of the time the TransactionResponse - * was instantiated. To get up-to-date information, use - * [[getTransaction]]. - * - * This provides a Type Guard that this transaction will have - * non-null property values for properties that are null for - * unmined transactions. - */ - isMined(): this is MinedTransactionResponse; - /** - * Returns true if the transaction is a legacy (i.e. ``type == 0``) - * transaction. - * - * This provides a Type Guard that this transaction will have - * the ``null``-ness for hardfork-specific properties set correctly. - */ - isLegacy(): this is (TransactionResponse & { - accessList: null; - maxFeePerGas: null; - maxPriorityFeePerGas: null; - }); - /** - * Returns true if the transaction is a Berlin (i.e. ``type == 1``) - * transaction. See [[link-eip-2070]]. - * - * This provides a Type Guard that this transaction will have - * the ``null``-ness for hardfork-specific properties set correctly. - */ - isBerlin(): this is (TransactionResponse & { - accessList: AccessList; - maxFeePerGas: null; - maxPriorityFeePerGas: null; - }); - /** - * Returns true if the transaction is a London (i.e. ``type == 2``) - * transaction. See [[link-eip-1559]]. - * - * This provides a Type Guard that this transaction will have - * the ``null``-ness for hardfork-specific properties set correctly. - */ - isLondon(): this is (TransactionResponse & { - accessList: AccessList; - maxFeePerGas: bigint; - maxPriorityFeePerGas: bigint; - }); - /** - * Returns true if hte transaction is a Cancun (i.e. ``type == 3``) - * transaction. See [[link-eip-4844]]. - */ - isCancun(): this is (TransactionResponse & { - accessList: AccessList; - maxFeePerGas: bigint; - maxPriorityFeePerGas: bigint; - maxFeePerBlobGas: bigint; - blobVersionedHashes: Array; - }); - /** - * Returns a filter which can be used to listen for orphan events - * that evict this transaction. - */ - removedEvent(): OrphanFilter; - /** - * Returns a filter which can be used to listen for orphan events - * that re-order this event against %%other%%. - */ - reorderedEvent(other?: TransactionResponse): OrphanFilter; - /** - * Returns a new TransactionResponse instance which has the ability to - * detect (and throw an error) if the transaction is replaced, which - * will begin scanning at %%startBlock%%. - * - * This should generally not be used by developers and is intended - * primarily for internal use. Setting an incorrect %%startBlock%% can - * have devastating performance consequences if used incorrectly. - */ - replaceableTransaction(startBlock: number): TransactionResponse; -} -/** - * An Orphan Filter allows detecting when an orphan block has - * resulted in dropping a block or transaction or has resulted - * in transactions changing order. - * - * Not currently fully supported. - */ -export type OrphanFilter = { - orphan: "drop-block"; - hash: string; - number: number; -} | { - orphan: "drop-transaction"; - tx: { - hash: string; - blockHash: string; - blockNumber: number; - }; - other?: { - hash: string; - blockHash: string; - blockNumber: number; - }; -} | { - orphan: "reorder-transaction"; - tx: { - hash: string; - blockHash: string; - blockNumber: number; - }; - other?: { - hash: string; - blockHash: string; - blockNumber: number; - }; -} | { - orphan: "drop-log"; - log: { - transactionHash: string; - blockHash: string; - blockNumber: number; - address: string; - data: string; - topics: ReadonlyArray; - index: number; - }; -}; -/** - * A **TopicFilter** provides a struture to define bloom-filter - * queries. - * - * Each field that is ``null`` matches **any** value, a field that is - * a ``string`` must match exactly that value and ``array`` is - * effectively an ``OR``-ed set, where any one of those values must - * match. - */ -export type TopicFilter = Array>; -/** - * An **EventFilter** allows efficiently filtering logs (also known as - * events) using bloom filters included within blocks. - */ -export interface EventFilter { - address?: AddressLike | Array; - topics?: TopicFilter; -} -/** - * A **Filter** allows searching a specific range of blocks for mathcing - * logs. - */ -export interface Filter extends EventFilter { - /** - * The start block for the filter (inclusive). - */ - fromBlock?: BlockTag; - /** - * The end block for the filter (inclusive). - */ - toBlock?: BlockTag; -} -/** - * A **FilterByBlockHash** allows searching a specific block for mathcing - * logs. - */ -export interface FilterByBlockHash extends EventFilter { - /** - * The blockhash of the specific block for the filter. - */ - blockHash?: string; -} -/** - * A **ProviderEvent** provides the types of events that can be subscribed - * to on a [[Provider]]. - * - * Each provider may include additional possible events it supports, but - * the most commonly supported are: - * - * **``"block"``** - calls the listener with the current block number on each - * new block. - * - * **``"error"``** - calls the listener on each async error that occurs during - * the event loop, with the error. - * - * **``"debug"``** - calls the listener on debug events, which can be used to - * troubleshoot network errors, provider problems, etc. - * - * **``transaction hash``** - calls the listener on each block after the - * transaction has been mined; generally ``.once`` is more appropriate for - * this event. - * - * **``Array``** - calls the listener on each log that matches the filter. - * - * [[EventFilter]] - calls the listener with each matching log - */ -export type ProviderEvent = string | Array> | EventFilter | OrphanFilter; -/** - * A **Provider** is the primary method to interact with the read-only - * content on Ethereum. - * - * It allows access to details about accounts, blocks and transactions - * and the ability to query event logs and simulate contract execution. - * - * Account data includes the [balance](getBalance), - * [transaction count](getTransactionCount), [code](getCode) and - * [state trie storage](getStorage). - * - * Simulating execution can be used to [call](call), - * [estimate gas](estimateGas) and - * [get transaction results](getTransactionResult). - * - * The [[broadcastTransaction]] is the only method which allows updating - * the blockchain, but it is usually accessed by a [[Signer]], since a - * private key must be used to sign the transaction before it can be - * broadcast. - */ -export interface Provider extends ContractRunner, EventEmitterable, NameResolver { - /** - * The provider iteself. - * - * This is part of the necessary API for executing a contract, as - * it provides a common property on any [[ContractRunner]] that - * can be used to access the read-only portion of the runner. - */ - provider: this; - /** - * Shutdown any resources this provider is using. No additional - * calls should be made to this provider after calling this. - */ - destroy(): void; - /** - * Get the current block number. - */ - getBlockNumber(): Promise; - /** - * Get the connected [[Network]]. - */ - getNetwork(): Promise; - /** - * Get the best guess at the recommended [[FeeData]]. - */ - getFeeData(): Promise; - /** - * Get the account balance (in wei) of %%address%%. If %%blockTag%% - * is specified and the node supports archive access for that - * %%blockTag%%, the balance is as of that [[BlockTag]]. - * - * @note On nodes without archive access enabled, the %%blockTag%% may be - * **silently ignored** by the node, which may cause issues if relied on. - */ - getBalance(address: AddressLike, blockTag?: BlockTag): Promise; - /** - * Get the number of transactions ever sent for %%address%%, which - * is used as the ``nonce`` when sending a transaction. If - * %%blockTag%% is specified and the node supports archive access - * for that %%blockTag%%, the transaction count is as of that - * [[BlockTag]]. - * - * @note On nodes without archive access enabled, the %%blockTag%% may be - * **silently ignored** by the node, which may cause issues if relied on. - */ - getTransactionCount(address: AddressLike, blockTag?: BlockTag): Promise; - /** - * Get the bytecode for %%address%%. - * - * @note On nodes without archive access enabled, the %%blockTag%% may be - * **silently ignored** by the node, which may cause issues if relied on. - */ - getCode(address: AddressLike, blockTag?: BlockTag): Promise; - /** - * Get the storage slot value for %%address%% at slot %%position%%. - * - * @note On nodes without archive access enabled, the %%blockTag%% may be - * **silently ignored** by the node, which may cause issues if relied on. - */ - getStorage(address: AddressLike, position: BigNumberish, blockTag?: BlockTag): Promise; - /** - * Estimates the amount of gas required to execute %%tx%%. - */ - estimateGas(tx: TransactionRequest): Promise; - /** - * Simulate the execution of %%tx%%. If the call reverts, it will - * throw a [[CallExceptionError]] which includes the revert data. - */ - call(tx: TransactionRequest): Promise; - /** - * Broadcasts the %%signedTx%% to the network, adding it to the - * memory pool of any node for which the transaction meets the - * rebroadcast requirements. - */ - broadcastTransaction(signedTx: string): Promise; - /** - * Resolves to the block for %%blockHashOrBlockTag%%. - * - * If %%prefetchTxs%%, and the backend supports including transactions - * with block requests, all transactions will be included and the - * [[Block]] object will not need to make remote calls for getting - * transactions. - */ - getBlock(blockHashOrBlockTag: BlockTag | string, prefetchTxs?: boolean): Promise; - /** - * Resolves to the transaction for %%hash%%. - * - * If the transaction is unknown or on pruning nodes which - * discard old transactions this resolves to ``null``. - */ - getTransaction(hash: string): Promise; - /** - * Resolves to the transaction receipt for %%hash%%, if mined. - * - * If the transaction has not been mined, is unknown or on - * pruning nodes which discard old transactions this resolves to - * ``null``. - */ - getTransactionReceipt(hash: string): Promise; - /** - * Resolves to the result returned by the executions of %%hash%%. - * - * This is only supported on nodes with archive access and with - * the necessary debug APIs enabled. - */ - getTransactionResult(hash: string): Promise; - /** - * Resolves to the list of Logs that match %%filter%% - */ - getLogs(filter: Filter | FilterByBlockHash): Promise>; - /** - * Resolves to the address configured for the %%ensName%% or - * ``null`` if unconfigured. - */ - resolveName(ensName: string): Promise; - /** - * Resolves to the ENS name associated for the %%address%% or - * ``null`` if the //primary name// is not configured. - * - * Users must perform additional steps to configure a //primary name//, - * which is not currently common. - */ - lookupAddress(address: string): Promise; - /** - * Waits until the transaction %%hash%% is mined and has %%confirms%% - * confirmations. - */ - waitForTransaction(hash: string, confirms?: number, timeout?: number): Promise; - /** - * Resolves to the block at %%blockTag%% once it has been mined. - * - * This can be useful for waiting some number of blocks by using - * the ``currentBlockNumber + N``. - */ - waitForBlock(blockTag?: BlockTag): Promise; -} -//# sourceMappingURL=provider.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider.d.ts.map deleted file mode 100644 index fc135586..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,M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C,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,kBAAkB,CAAC,CAAC;IAExE;;;;;OAKG;IACH,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;IAM3D;;OAEG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IAMjE;;;OAGG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;IAErD;;;;;;OAMG;IACH,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;IAEvD;;;OAGG;IACH,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,kBAAkB,CAAC,CAAC;IAE1G;;;;;OAKG;IACH,YAAY,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;CACrD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider.js deleted file mode 100644 index 0bb3ebbb..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider.js +++ /dev/null @@ -1,1315 +0,0 @@ -//import { resolveAddress } from "@ethersproject/address"; -import { defineProperties, getBigInt, getNumber, hexlify, isBytesLike, resolveProperties, assert, assertArgument, isError, makeError } from "../utils/index.js"; -import { accessListify } from "../transaction/index.js"; -const BN_0 = BigInt(0); -// ----------------------- -function getValue(value) { - if (value == null) { - return null; - } - return value; -} -function toJson(value) { - if (value == null) { - return null; - } - return value.toString(); -} -// @TODO? implements Required -/** - * A **FeeData** wraps all the fee-related values associated with - * the network. - */ -export class FeeData { - /** - * The gas price for legacy networks. - */ - gasPrice; - /** - * The maximum fee to pay per gas. - * - * The base fee per gas is defined by the network and based on - * congestion, increasing the cost during times of heavy load - * and lowering when less busy. - * - * The actual fee per gas will be the base fee for the block - * and the priority fee, up to the max fee per gas. - * - * This will be ``null`` on legacy networks (i.e. [pre-EIP-1559](link-eip-1559)) - */ - maxFeePerGas; - /** - * The additional amout to pay per gas to encourage a validator - * to include the transaction. - * - * The purpose of this is to compensate the validator for the - * adjusted risk for including a given transaction. - * - * This will be ``null`` on legacy networks (i.e. [pre-EIP-1559](link-eip-1559)) - */ - maxPriorityFeePerGas; - /** - * Creates a new FeeData for %%gasPrice%%, %%maxFeePerGas%% and - * %%maxPriorityFeePerGas%%. - */ - constructor(gasPrice, maxFeePerGas, maxPriorityFeePerGas) { - defineProperties(this, { - gasPrice: getValue(gasPrice), - maxFeePerGas: getValue(maxFeePerGas), - maxPriorityFeePerGas: getValue(maxPriorityFeePerGas) - }); - } - /** - * Returns a JSON-friendly value. - */ - toJSON() { - const { gasPrice, maxFeePerGas, maxPriorityFeePerGas } = this; - return { - _type: "FeeData", - gasPrice: toJson(gasPrice), - maxFeePerGas: toJson(maxFeePerGas), - maxPriorityFeePerGas: toJson(maxPriorityFeePerGas), - }; - } -} -; -/** - * Returns a copy of %%req%% with all properties coerced to their strict - * types. - */ -export function copyRequest(req) { - const result = {}; - // These could be addresses, ENS names or Addressables - if (req.to) { - result.to = req.to; - } - if (req.from) { - result.from = req.from; - } - if (req.data) { - result.data = hexlify(req.data); - } - const bigIntKeys = "chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/); - for (const key of bigIntKeys) { - if (!(key in req) || req[key] == null) { - continue; - } - result[key] = getBigInt(req[key], `request.${key}`); - } - const numberKeys = "type,nonce".split(/,/); - for (const key of numberKeys) { - if (!(key in req) || req[key] == null) { - continue; - } - result[key] = getNumber(req[key], `request.${key}`); - } - if (req.accessList) { - result.accessList = accessListify(req.accessList); - } - if (req.authorizationList) { - result.authorizationList = req.authorizationList.slice(); - } - if ("blockTag" in req) { - result.blockTag = req.blockTag; - } - if ("enableCcipRead" in req) { - result.enableCcipRead = !!req.enableCcipRead; - } - if ("customData" in req) { - result.customData = req.customData; - } - if ("blobVersionedHashes" in req && req.blobVersionedHashes) { - result.blobVersionedHashes = req.blobVersionedHashes.slice(); - } - if ("kzg" in req) { - result.kzg = req.kzg; - } - if ("blobWrapperVersion" in req) { - result.blobWrapperVersion = req.blobWrapperVersion; - } - if ("blobs" in req && req.blobs) { - result.blobs = req.blobs.map((b) => { - if (isBytesLike(b)) { - return hexlify(b); - } - return Object.assign({}, b); - }); - } - return result; -} -/** - * A **Block** represents the data associated with a full block on - * Ethereum. - */ -export class Block { - /** - * The provider connected to the block used to fetch additional details - * if necessary. - */ - provider; - /** - * The block number, sometimes called the block height. This is a - * sequential number that is one higher than the parent block. - */ - number; - /** - * The block hash. - * - * This hash includes all properties, so can be safely used to identify - * an exact set of block properties. - */ - hash; - /** - * The timestamp for this block, which is the number of seconds since - * epoch that this block was included. - */ - timestamp; - /** - * The block hash of the parent block. - */ - parentHash; - /** - * The hash tree root of the parent beacon block for the given - * execution block. See [[link-eip-4788]]. - */ - parentBeaconBlockRoot; - /** - * The nonce. - * - * On legacy networks, this is the random number inserted which - * permitted the difficulty target to be reached. - */ - nonce; - /** - * The difficulty target. - * - * On legacy networks, this is the proof-of-work target required - * for a block to meet the protocol rules to be included. - * - * On modern networks, this is a random number arrived at using - * randao. @TODO: Find links? - */ - difficulty; - /** - * The total gas limit for this block. - */ - gasLimit; - /** - * The total gas used in this block. - */ - gasUsed; - /** - * The root hash for the global state after applying changes - * in this block. - */ - stateRoot; - /** - * The hash of the transaction receipts trie. - */ - receiptsRoot; - /** - * The total amount of blob gas consumed by the transactions - * within the block. See [[link-eip-4844]]. - */ - blobGasUsed; - /** - * The running total of blob gas consumed in excess of the - * target, prior to the block. See [[link-eip-4844]]. - */ - excessBlobGas; - /** - * The miner coinbase address, wihch receives any subsidies for - * including this block. - */ - miner; - /** - * The latest RANDAO mix of the post beacon state of - * the previous block. - */ - prevRandao; - /** - * Any extra data the validator wished to include. - */ - extraData; - /** - * The base fee per gas that all transactions in this block were - * charged. - * - * This adjusts after each block, depending on how congested the network - * is. - */ - baseFeePerGas; - #transactions; - /** - * Create a new **Block** object. - * - * This should generally not be necessary as the unless implementing a - * low-level library. - */ - constructor(block, provider) { - this.#transactions = block.transactions.map((tx) => { - if (typeof (tx) !== "string") { - return new TransactionResponse(tx, provider); - } - return tx; - }); - defineProperties(this, { - provider, - hash: getValue(block.hash), - number: block.number, - timestamp: block.timestamp, - parentHash: block.parentHash, - parentBeaconBlockRoot: block.parentBeaconBlockRoot, - nonce: block.nonce, - difficulty: block.difficulty, - gasLimit: block.gasLimit, - gasUsed: block.gasUsed, - blobGasUsed: block.blobGasUsed, - excessBlobGas: block.excessBlobGas, - miner: block.miner, - prevRandao: getValue(block.prevRandao), - extraData: block.extraData, - baseFeePerGas: getValue(block.baseFeePerGas), - stateRoot: block.stateRoot, - receiptsRoot: block.receiptsRoot, - }); - } - /** - * Returns the list of transaction hashes, in the order - * they were executed within the block. - */ - get transactions() { - return this.#transactions.map((tx) => { - if (typeof (tx) === "string") { - return tx; - } - return tx.hash; - }); - } - /** - * Returns the complete transactions, in the order they - * were executed within the block. - * - * This is only available for blocks which prefetched - * transactions, by passing ``true`` to %%prefetchTxs%% - * into [[Provider-getBlock]]. - */ - get prefetchedTransactions() { - const txs = this.#transactions.slice(); - // Doesn't matter... - if (txs.length === 0) { - return []; - } - // Make sure we prefetched the transactions - assert(typeof (txs[0]) === "object", "transactions were not prefetched with block request", "UNSUPPORTED_OPERATION", { - operation: "transactionResponses()" - }); - return txs; - } - /** - * Returns a JSON-friendly value. - */ - toJSON() { - const { baseFeePerGas, difficulty, extraData, gasLimit, gasUsed, hash, miner, prevRandao, nonce, number, parentHash, parentBeaconBlockRoot, stateRoot, receiptsRoot, timestamp, transactions } = this; - return { - _type: "Block", - baseFeePerGas: toJson(baseFeePerGas), - difficulty: toJson(difficulty), - extraData, - gasLimit: toJson(gasLimit), - gasUsed: toJson(gasUsed), - blobGasUsed: toJson(this.blobGasUsed), - excessBlobGas: toJson(this.excessBlobGas), - hash, miner, prevRandao, nonce, number, parentHash, timestamp, - parentBeaconBlockRoot, stateRoot, receiptsRoot, - transactions, - }; - } - [Symbol.iterator]() { - let index = 0; - const txs = this.transactions; - return { - next: () => { - if (index < this.length) { - return { - value: txs[index++], done: false - }; - } - return { value: undefined, done: true }; - } - }; - } - /** - * The number of transactions in this block. - */ - get length() { return this.#transactions.length; } - /** - * The [[link-js-date]] this block was included at. - */ - get date() { - if (this.timestamp == null) { - return null; - } - return new Date(this.timestamp * 1000); - } - /** - * Get the transaction at %%indexe%% within this block. - */ - async getTransaction(indexOrHash) { - // Find the internal value by its index or hash - let tx = undefined; - if (typeof (indexOrHash) === "number") { - tx = this.#transactions[indexOrHash]; - } - else { - const hash = indexOrHash.toLowerCase(); - for (const v of this.#transactions) { - if (typeof (v) === "string") { - if (v !== hash) { - continue; - } - tx = v; - break; - } - else { - if (v.hash !== hash) { - continue; - } - tx = v; - break; - } - } - } - if (tx == null) { - throw new Error("no such tx"); - } - if (typeof (tx) === "string") { - return (await this.provider.getTransaction(tx)); - } - else { - return tx; - } - } - /** - * If a **Block** was fetched with a request to include the transactions - * this will allow synchronous access to those transactions. - * - * If the transactions were not prefetched, this will throw. - */ - getPrefetchedTransaction(indexOrHash) { - const txs = this.prefetchedTransactions; - if (typeof (indexOrHash) === "number") { - return txs[indexOrHash]; - } - indexOrHash = indexOrHash.toLowerCase(); - for (const tx of txs) { - if (tx.hash === indexOrHash) { - return tx; - } - } - assertArgument(false, "no matching transaction", "indexOrHash", indexOrHash); - } - /** - * Returns true if this block been mined. This provides a type guard - * for all properties on a [[MinedBlock]]. - */ - isMined() { return !!this.hash; } - /** - * Returns true if this block is an [[link-eip-2930]] block. - */ - isLondon() { - return !!this.baseFeePerGas; - } - /** - * @_ignore: - */ - orphanedEvent() { - if (!this.isMined()) { - throw new Error(""); - } - return createOrphanedBlockFilter(this); - } -} -////////////////////// -// Log -/** - * A **Log** in Ethereum represents an event that has been included in a - * transaction using the ``LOG*`` opcodes, which are most commonly used by - * Solidity's emit for announcing events. - */ -export class Log { - /** - * The provider connected to the log used to fetch additional details - * if necessary. - */ - provider; - /** - * The transaction hash of the transaction this log occurred in. Use the - * [[Log-getTransaction]] to get the [[TransactionResponse]]. - */ - transactionHash; - /** - * The block hash of the block this log occurred in. Use the - * [[Log-getBlock]] to get the [[Block]]. - */ - blockHash; - /** - * The block number of the block this log occurred in. It is preferred - * to use the [[Block-hash]] when fetching the related [[Block]], - * since in the case of an orphaned block, the block at that height may - * have changed. - */ - blockNumber; - /** - * If the **Log** represents a block that was removed due to an orphaned - * block, this will be true. - * - * This can only happen within an orphan event listener. - */ - removed; - /** - * The address of the contract that emitted this log. - */ - address; - /** - * The data included in this log when it was emitted. - */ - data; - /** - * The indexed topics included in this log when it was emitted. - * - * All topics are included in the bloom filters, so they can be - * efficiently filtered using the [[Provider-getLogs]] method. - */ - topics; - /** - * The index within the block this log occurred at. This is generally - * not useful to developers, but can be used with the various roots - * to proof inclusion within a block. - */ - index; - /** - * The index within the transaction of this log. - */ - transactionIndex; - /** - * @_ignore: - */ - constructor(log, provider) { - this.provider = provider; - const topics = Object.freeze(log.topics.slice()); - defineProperties(this, { - transactionHash: log.transactionHash, - blockHash: log.blockHash, - blockNumber: log.blockNumber, - removed: log.removed, - address: log.address, - data: log.data, - topics, - index: log.index, - transactionIndex: log.transactionIndex, - }); - } - /** - * Returns a JSON-compatible object. - */ - toJSON() { - const { address, blockHash, blockNumber, data, index, removed, topics, transactionHash, transactionIndex } = this; - return { - _type: "log", - address, blockHash, blockNumber, data, index, - removed, topics, transactionHash, transactionIndex - }; - } - /** - * Returns the block that this log occurred in. - */ - async getBlock() { - const block = await this.provider.getBlock(this.blockHash); - assert(!!block, "failed to find transaction", "UNKNOWN_ERROR", {}); - return block; - } - /** - * Returns the transaction that this log occurred in. - */ - async getTransaction() { - const tx = await this.provider.getTransaction(this.transactionHash); - assert(!!tx, "failed to find transaction", "UNKNOWN_ERROR", {}); - return tx; - } - /** - * Returns the transaction receipt fot the transaction that this - * log occurred in. - */ - async getTransactionReceipt() { - const receipt = await this.provider.getTransactionReceipt(this.transactionHash); - assert(!!receipt, "failed to find transaction receipt", "UNKNOWN_ERROR", {}); - return receipt; - } - /** - * @_ignore: - */ - removedEvent() { - return createRemovedLogFilter(this); - } -} -////////////////////// -// Transaction Receipt -/* -export interface LegacyTransactionReceipt { - byzantium: false; - status: null; - root: string; -} - -export interface ByzantiumTransactionReceipt { - byzantium: true; - status: number; - root: null; -} -*/ -/** - * A **TransactionReceipt** includes additional information about a - * transaction that is only available after it has been mined. - */ -export class TransactionReceipt { - /** - * The provider connected to the log used to fetch additional details - * if necessary. - */ - provider; - /** - * The address the transaction was sent to. - */ - to; - /** - * The sender of the transaction. - */ - from; - /** - * The address of the contract if the transaction was directly - * responsible for deploying one. - * - * This is non-null **only** if the ``to`` is empty and the ``data`` - * was successfully executed as initcode. - */ - contractAddress; - /** - * The transaction hash. - */ - hash; - /** - * The index of this transaction within the block transactions. - */ - index; - /** - * The block hash of the [[Block]] this transaction was included in. - */ - blockHash; - /** - * The block number of the [[Block]] this transaction was included in. - */ - blockNumber; - /** - * The bloom filter bytes that represent all logs that occurred within - * this transaction. This is generally not useful for most developers, - * but can be used to validate the included logs. - */ - logsBloom; - /** - * The actual amount of gas used by this transaction. - * - * When creating a transaction, the amount of gas that will be used can - * only be approximated, but the sender must pay the gas fee for the - * entire gas limit. After the transaction, the difference is refunded. - */ - gasUsed; - /** - * The gas used for BLObs. See [[link-eip-4844]]. - */ - blobGasUsed; - /** - * The amount of gas used by all transactions within the block for this - * and all transactions with a lower ``index``. - * - * This is generally not useful for developers but can be used to - * validate certain aspects of execution. - */ - cumulativeGasUsed; - /** - * The actual gas price used during execution. - * - * Due to the complexity of [[link-eip-1559]] this value can only - * be caluclated after the transaction has been mined, snce the base - * fee is protocol-enforced. - */ - gasPrice; - /** - * The price paid per BLOB in gas. See [[link-eip-4844]]. - */ - blobGasPrice; - /** - * The [[link-eip-2718]] transaction type. - */ - type; - //readonly byzantium!: boolean; - /** - * The status of this transaction, indicating success (i.e. ``1``) or - * a revert (i.e. ``0``). - * - * This is available in post-byzantium blocks, but some backends may - * backfill this value. - */ - status; - /** - * The root hash of this transaction. - * - * This is no present and was only included in pre-byzantium blocks, but - * could be used to validate certain parts of the receipt. - */ - root; - #logs; - /** - * @_ignore: - */ - constructor(tx, provider) { - this.#logs = Object.freeze(tx.logs.map((log) => { - return new Log(log, provider); - })); - let gasPrice = BN_0; - if (tx.effectiveGasPrice != null) { - gasPrice = tx.effectiveGasPrice; - } - else if (tx.gasPrice != null) { - gasPrice = tx.gasPrice; - } - defineProperties(this, { - provider, - to: tx.to, - from: tx.from, - contractAddress: tx.contractAddress, - hash: tx.hash, - index: tx.index, - blockHash: tx.blockHash, - blockNumber: tx.blockNumber, - logsBloom: tx.logsBloom, - gasUsed: tx.gasUsed, - cumulativeGasUsed: tx.cumulativeGasUsed, - blobGasUsed: tx.blobGasUsed, - gasPrice, - blobGasPrice: tx.blobGasPrice, - type: tx.type, - //byzantium: tx.byzantium, - status: tx.status, - root: tx.root - }); - } - /** - * The logs for this transaction. - */ - get logs() { return this.#logs; } - /** - * Returns a JSON-compatible representation. - */ - toJSON() { - const { to, from, contractAddress, hash, index, blockHash, blockNumber, logsBloom, logs, //byzantium, - status, root } = this; - return { - _type: "TransactionReceipt", - blockHash, blockNumber, - //byzantium, - contractAddress, - cumulativeGasUsed: toJson(this.cumulativeGasUsed), - from, - gasPrice: toJson(this.gasPrice), - blobGasUsed: toJson(this.blobGasUsed), - blobGasPrice: toJson(this.blobGasPrice), - gasUsed: toJson(this.gasUsed), - hash, index, logs, logsBloom, root, status, to - }; - } - /** - * @_ignore: - */ - get length() { return this.logs.length; } - [Symbol.iterator]() { - let index = 0; - return { - next: () => { - if (index < this.length) { - return { value: this.logs[index++], done: false }; - } - return { value: undefined, done: true }; - } - }; - } - /** - * The total fee for this transaction, in wei. - */ - get fee() { - return this.gasUsed * this.gasPrice; - } - /** - * Resolves to the block this transaction occurred in. - */ - async getBlock() { - const block = await this.provider.getBlock(this.blockHash); - if (block == null) { - throw new Error("TODO"); - } - return block; - } - /** - * Resolves to the transaction this transaction occurred in. - */ - async getTransaction() { - const tx = await this.provider.getTransaction(this.hash); - if (tx == null) { - throw new Error("TODO"); - } - return tx; - } - /** - * Resolves to the return value of the execution of this transaction. - * - * Support for this feature is limited, as it requires an archive node - * with the ``debug_`` or ``trace_`` API enabled. - */ - async getResult() { - return (await this.provider.getTransactionResult(this.hash)); - } - /** - * Resolves to the number of confirmations this transaction has. - */ - async confirmations() { - return (await this.provider.getBlockNumber()) - this.blockNumber + 1; - } - /** - * @_ignore: - */ - removedEvent() { - return createRemovedTransactionFilter(this); - } - /** - * @_ignore: - */ - reorderedEvent(other) { - assert(!other || other.isMined(), "unmined 'other' transction cannot be orphaned", "UNSUPPORTED_OPERATION", { operation: "reorderedEvent(other)" }); - return createReorderedTransactionFilter(this, other); - } -} -/** - * A **TransactionResponse** includes all properties about a transaction - * that was sent to the network, which may or may not be included in a - * block. - * - * The [[TransactionResponse-isMined]] can be used to check if the - * transaction has been mined as well as type guard that the otherwise - * possibly ``null`` properties are defined. - */ -export class TransactionResponse { - /** - * The provider this is connected to, which will influence how its - * methods will resolve its async inspection methods. - */ - provider; - /** - * The block number of the block that this transaction was included in. - * - * This is ``null`` for pending transactions. - */ - blockNumber; - /** - * The blockHash of the block that this transaction was included in. - * - * This is ``null`` for pending transactions. - */ - blockHash; - /** - * The index within the block that this transaction resides at. - */ - index; - /** - * The transaction hash. - */ - hash; - /** - * The [[link-eip-2718]] transaction envelope type. This is - * ``0`` for legacy transactions types. - */ - type; - /** - * The receiver of this transaction. - * - * If ``null``, then the transaction is an initcode transaction. - * This means the result of executing the [[data]] will be deployed - * as a new contract on chain (assuming it does not revert) and the - * address may be computed using [[getCreateAddress]]. - */ - to; - /** - * The sender of this transaction. It is implicitly computed - * from the transaction pre-image hash (as the digest) and the - * [[signature]] using ecrecover. - */ - from; - /** - * The nonce, which is used to prevent replay attacks and offer - * a method to ensure transactions from a given sender are explicitly - * ordered. - * - * When sending a transaction, this must be equal to the number of - * transactions ever sent by [[from]]. - */ - nonce; - /** - * The maximum units of gas this transaction can consume. If execution - * exceeds this, the entries transaction is reverted and the sender - * is charged for the full amount, despite not state changes being made. - */ - gasLimit; - /** - * The gas price can have various values, depending on the network. - * - * In modern networks, for transactions that are included this is - * the //effective gas price// (the fee per gas that was actually - * charged), while for transactions that have not been included yet - * is the [[maxFeePerGas]]. - * - * For legacy transactions, or transactions on legacy networks, this - * is the fee that will be charged per unit of gas the transaction - * consumes. - */ - gasPrice; - /** - * The maximum priority fee (per unit of gas) to allow a - * validator to charge the sender. This is inclusive of the - * [[maxFeeFeePerGas]]. - */ - maxPriorityFeePerGas; - /** - * The maximum fee (per unit of gas) to allow this transaction - * to charge the sender. - */ - maxFeePerGas; - /** - * The [[link-eip-4844]] max fee per BLOb gas. - */ - maxFeePerBlobGas; - /** - * The data. - */ - data; - /** - * The value, in wei. Use [[formatEther]] to format this value - * as ether. - */ - value; - /** - * The chain ID. - */ - chainId; - /** - * The signature. - */ - signature; - /** - * The [[link-eip-2930]] access list for transaction types that - * support it, otherwise ``null``. - */ - accessList; - /** - * The [[link-eip-4844]] BLOb versioned hashes. - */ - blobVersionedHashes; - /** - * The [[link-eip-7702]] authorizations (if any). - */ - authorizationList; - #startBlock; - /** - * @_ignore: - */ - constructor(tx, provider) { - this.provider = provider; - this.blockNumber = (tx.blockNumber != null) ? tx.blockNumber : null; - this.blockHash = (tx.blockHash != null) ? tx.blockHash : null; - this.hash = tx.hash; - this.index = tx.index; - this.type = tx.type; - this.from = tx.from; - this.to = tx.to || null; - this.gasLimit = tx.gasLimit; - this.nonce = tx.nonce; - this.data = tx.data; - this.value = tx.value; - this.gasPrice = tx.gasPrice; - this.maxPriorityFeePerGas = (tx.maxPriorityFeePerGas != null) ? tx.maxPriorityFeePerGas : null; - this.maxFeePerGas = (tx.maxFeePerGas != null) ? tx.maxFeePerGas : null; - this.maxFeePerBlobGas = (tx.maxFeePerBlobGas != null) ? tx.maxFeePerBlobGas : null; - this.chainId = tx.chainId; - this.signature = tx.signature; - this.accessList = (tx.accessList != null) ? tx.accessList : null; - this.blobVersionedHashes = (tx.blobVersionedHashes != null) ? tx.blobVersionedHashes : null; - this.authorizationList = (tx.authorizationList != null) ? tx.authorizationList : null; - this.#startBlock = -1; - } - /** - * Returns a JSON-compatible representation of this transaction. - */ - toJSON() { - const { blockNumber, blockHash, index, hash, type, to, from, nonce, data, signature, accessList, blobVersionedHashes } = this; - return { - _type: "TransactionResponse", - accessList, blockNumber, blockHash, - blobVersionedHashes, - chainId: toJson(this.chainId), - data, from, - gasLimit: toJson(this.gasLimit), - gasPrice: toJson(this.gasPrice), - hash, - maxFeePerGas: toJson(this.maxFeePerGas), - maxPriorityFeePerGas: toJson(this.maxPriorityFeePerGas), - maxFeePerBlobGas: toJson(this.maxFeePerBlobGas), - nonce, signature, to, index, type, - value: toJson(this.value), - }; - } - /** - * Resolves to the Block that this transaction was included in. - * - * This will return null if the transaction has not been included yet. - */ - async getBlock() { - let blockNumber = this.blockNumber; - if (blockNumber == null) { - const tx = await this.getTransaction(); - if (tx) { - blockNumber = tx.blockNumber; - } - } - if (blockNumber == null) { - return null; - } - const block = this.provider.getBlock(blockNumber); - if (block == null) { - throw new Error("TODO"); - } - return block; - } - /** - * Resolves to this transaction being re-requested from the - * provider. This can be used if you have an unmined transaction - * and wish to get an up-to-date populated instance. - */ - async getTransaction() { - return this.provider.getTransaction(this.hash); - } - /** - * Resolve to the number of confirmations this transaction has. - */ - async confirmations() { - if (this.blockNumber == null) { - const { tx, blockNumber } = await resolveProperties({ - tx: this.getTransaction(), - blockNumber: this.provider.getBlockNumber() - }); - // Not mined yet... - if (tx == null || tx.blockNumber == null) { - return 0; - } - return blockNumber - tx.blockNumber + 1; - } - const blockNumber = await this.provider.getBlockNumber(); - return blockNumber - this.blockNumber + 1; - } - /** - * Resolves once this transaction has been mined and has - * %%confirms%% blocks including it (default: ``1``) with an - * optional %%timeout%%. - * - * This can resolve to ``null`` only if %%confirms%% is ``0`` - * and the transaction has not been mined, otherwise this will - * wait until enough confirmations have completed. - */ - async wait(_confirms, _timeout) { - const confirms = (_confirms == null) ? 1 : _confirms; - const timeout = (_timeout == null) ? 0 : _timeout; - let startBlock = this.#startBlock; - let nextScan = -1; - let stopScanning = (startBlock === -1) ? true : false; - const checkReplacement = async () => { - // Get the current transaction count for this sender - if (stopScanning) { - return null; - } - const { blockNumber, nonce } = await resolveProperties({ - blockNumber: this.provider.getBlockNumber(), - nonce: this.provider.getTransactionCount(this.from) - }); - // No transaction or our nonce has not been mined yet; but we - // can start scanning later when we do start - if (nonce < this.nonce) { - startBlock = blockNumber; - return; - } - // We were mined; no replacement - if (stopScanning) { - return null; - } - const mined = await this.getTransaction(); - if (mined && mined.blockNumber != null) { - return; - } - // We were replaced; start scanning for that transaction - // Starting to scan; look back a few extra blocks for safety - if (nextScan === -1) { - nextScan = startBlock - 3; - if (nextScan < this.#startBlock) { - nextScan = this.#startBlock; - } - } - while (nextScan <= blockNumber) { - // Get the next block to scan - if (stopScanning) { - return null; - } - const block = await this.provider.getBlock(nextScan, true); - // This should not happen; but we'll try again shortly - if (block == null) { - return; - } - // We were mined; no replacement - for (const hash of block) { - if (hash === this.hash) { - return; - } - } - // Search for the transaction that replaced us - for (let i = 0; i < block.length; i++) { - const tx = await block.getTransaction(i); - if (tx.from === this.from && tx.nonce === this.nonce) { - // Get the receipt - if (stopScanning) { - return null; - } - const receipt = await this.provider.getTransactionReceipt(tx.hash); - // This should not happen; but we'll try again shortly - if (receipt == null) { - return; - } - // We will retry this on the next block (this case could be optimized) - if ((blockNumber - receipt.blockNumber + 1) < confirms) { - return; - } - // The reason we were replaced - let reason = "replaced"; - if (tx.data === this.data && tx.to === this.to && tx.value === this.value) { - reason = "repriced"; - } - else if (tx.data === "0x" && tx.from === tx.to && tx.value === BN_0) { - reason = "cancelled"; - } - assert(false, "transaction was replaced", "TRANSACTION_REPLACED", { - cancelled: (reason === "replaced" || reason === "cancelled"), - reason, - replacement: tx.replaceableTransaction(startBlock), - hash: tx.hash, - receipt - }); - } - } - nextScan++; - } - return; - }; - const checkReceipt = (receipt) => { - if (receipt == null || receipt.status !== 0) { - return receipt; - } - assert(false, "transaction execution reverted", "CALL_EXCEPTION", { - action: "sendTransaction", - data: null, reason: null, invocation: null, revert: null, - transaction: { - to: receipt.to, - from: receipt.from, - data: "" // @TODO: in v7, split out sendTransaction properties - }, receipt - }); - }; - const receipt = await this.provider.getTransactionReceipt(this.hash); - if (confirms === 0) { - return checkReceipt(receipt); - } - if (receipt) { - if (confirms === 1 || (await receipt.confirmations()) >= confirms) { - return checkReceipt(receipt); - } - } - else { - // Check for a replacement; throws if a replacement was found - await checkReplacement(); - // Allow null only when the confirms is 0 - if (confirms === 0) { - return null; - } - } - const waiter = new Promise((resolve, reject) => { - // List of things to cancel when we have a result (one way or the other) - const cancellers = []; - const cancel = () => { cancellers.forEach((c) => c()); }; - // On cancel, stop scanning for replacements - cancellers.push(() => { stopScanning = true; }); - // Set up any timeout requested - if (timeout > 0) { - const timer = setTimeout(() => { - cancel(); - reject(makeError("wait for transaction timeout", "TIMEOUT")); - }, timeout); - cancellers.push(() => { clearTimeout(timer); }); - } - const txListener = async (receipt) => { - // Done; return it! - if ((await receipt.confirmations()) >= confirms) { - cancel(); - try { - resolve(checkReceipt(receipt)); - } - catch (error) { - reject(error); - } - } - }; - cancellers.push(() => { this.provider.off(this.hash, txListener); }); - this.provider.on(this.hash, txListener); - // We support replacement detection; start checking - if (startBlock >= 0) { - const replaceListener = async () => { - try { - // Check for a replacement; this throws only if one is found - await checkReplacement(); - } - catch (error) { - // We were replaced (with enough confirms); re-throw the error - if (isError(error, "TRANSACTION_REPLACED")) { - cancel(); - reject(error); - return; - } - } - // Rescheudle a check on the next block - if (!stopScanning) { - this.provider.once("block", replaceListener); - } - }; - cancellers.push(() => { this.provider.off("block", replaceListener); }); - this.provider.once("block", replaceListener); - } - }); - return await waiter; - } - /** - * Returns ``true`` if this transaction has been included. - * - * This is effective only as of the time the TransactionResponse - * was instantiated. To get up-to-date information, use - * [[getTransaction]]. - * - * This provides a Type Guard that this transaction will have - * non-null property values for properties that are null for - * unmined transactions. - */ - isMined() { - return (this.blockHash != null); - } - /** - * Returns true if the transaction is a legacy (i.e. ``type == 0``) - * transaction. - * - * This provides a Type Guard that this transaction will have - * the ``null``-ness for hardfork-specific properties set correctly. - */ - isLegacy() { - return (this.type === 0); - } - /** - * Returns true if the transaction is a Berlin (i.e. ``type == 1``) - * transaction. See [[link-eip-2070]]. - * - * This provides a Type Guard that this transaction will have - * the ``null``-ness for hardfork-specific properties set correctly. - */ - isBerlin() { - return (this.type === 1); - } - /** - * Returns true if the transaction is a London (i.e. ``type == 2``) - * transaction. See [[link-eip-1559]]. - * - * This provides a Type Guard that this transaction will have - * the ``null``-ness for hardfork-specific properties set correctly. - */ - isLondon() { - return (this.type === 2); - } - /** - * Returns true if hte transaction is a Cancun (i.e. ``type == 3``) - * transaction. See [[link-eip-4844]]. - */ - isCancun() { - return (this.type === 3); - } - /** - * Returns a filter which can be used to listen for orphan events - * that evict this transaction. - */ - removedEvent() { - assert(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); - return createRemovedTransactionFilter(this); - } - /** - * Returns a filter which can be used to listen for orphan events - * that re-order this event against %%other%%. - */ - reorderedEvent(other) { - assert(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); - assert(!other || other.isMined(), "unmined 'other' transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); - return createReorderedTransactionFilter(this, other); - } - /** - * Returns a new TransactionResponse instance which has the ability to - * detect (and throw an error) if the transaction is replaced, which - * will begin scanning at %%startBlock%%. - * - * This should generally not be used by developers and is intended - * primarily for internal use. Setting an incorrect %%startBlock%% can - * have devastating performance consequences if used incorrectly. - */ - replaceableTransaction(startBlock) { - assertArgument(Number.isInteger(startBlock) && startBlock >= 0, "invalid startBlock", "startBlock", startBlock); - const tx = new TransactionResponse(this, this.provider); - tx.#startBlock = startBlock; - return tx; - } -} -function createOrphanedBlockFilter(block) { - return { orphan: "drop-block", hash: block.hash, number: block.number }; -} -function createReorderedTransactionFilter(tx, other) { - return { orphan: "reorder-transaction", tx, other }; -} -function createRemovedTransactionFilter(tx) { - return { orphan: "drop-transaction", tx }; -} -function createRemovedLogFilter(log) { - return { orphan: "drop-log", log: { - transactionHash: log.transactionHash, - blockHash: log.blockHash, - blockNumber: log.blockNumber, - address: log.address, - data: log.data, - topics: Object.freeze(log.topics.slice()), - index: log.index - } }; -} -//# sourceMappingURL=provider.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider.js.map deleted file mode 100644 index 4a098aa3..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/provider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src.ts/providers/provider.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,OAAO,EACH,gBAAgB,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAC5D,iBAAiB,EACjB,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,SAAS,EAC7C,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAcxD,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAs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MAAM,EAAE,qBAAqB,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC;AACxD,CAAC;AAED,SAAS,8BAA8B,CAAC,EAA4D;IAChG,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,EAAE,EAAE,CAAC;AAC9C,CAAC;AAED,SAAS,sBAAsB,CAAC,GAAqJ;IACjL,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE;YAC9B,eAAe,EAAE,GAAG,CAAC,eAAe;YACpC,SAAS,EAAE,GAAG,CAAC,SAAS;YACxB,WAAW,EAAE,GAAG,CAAC,WAAW;YAC5B,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YACzC,KAAK,EAAE,GAAG,CAAC,KAAK;SACnB,EAAE,CAAC;AACR,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/signer-noncemanager.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/signer-noncemanager.d.ts deleted file mode 100644 index 4224b601..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/signer-noncemanager.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { AbstractSigner } from "./abstract-signer.js"; -import type { TypedDataDomain, TypedDataField } from "../hash/index.js"; -import type { BlockTag, Provider, TransactionRequest, TransactionResponse } from "./provider.js"; -import type { Signer } from "./signer.js"; -/** - * A **NonceManager** wraps another [[Signer]] and automatically manages - * the nonce, ensuring serialized and sequential nonces are used during - * transaction. - */ -export declare class NonceManager extends AbstractSigner { - #private; - /** - * The Signer being managed. - */ - signer: Signer; - /** - * Creates a new **NonceManager** to manage %%signer%%. - */ - constructor(signer: Signer); - getAddress(): Promise; - connect(provider: null | Provider): NonceManager; - getNonce(blockTag?: BlockTag): Promise; - /** - * Manually increment the nonce. This may be useful when managng - * offline transactions. - */ - increment(): void; - /** - * Resets the nonce, causing the **NonceManager** to reload the current - * nonce from the blockchain on the next transaction. - */ - reset(): void; - sendTransaction(tx: TransactionRequest): Promise; - signTransaction(tx: TransactionRequest): Promise; - signMessage(message: string | Uint8Array): Promise; - signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise; -} -//# sourceMappingURL=signer-noncemanager.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/signer-noncemanager.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/signer-noncemanager.d.ts.map deleted file mode 100644 index 7142ec44..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/signer-noncemanager.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signer-noncemanager.d.ts","sourceRoot":"","sources":["../../src.ts/providers/signer-noncemanager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAExE,OAAO,KAAK,EACR,QAAQ,EAAE,QAAQ,EAAE,kBAAkB,EAAE,mBAAmB,EAC9D,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAG1C;;;;GAIG;AACH,qBAAa,YAAa,SAAQ,cAAc;;IAC5C;;OAEG;IACH,MAAM,EAAG,MAAM,CAAC;IAKhB;;OAEG;gBACS,MAAM,EAAE,MAAM;IAQpB,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC;IAInC,OAAO,CAAC,QAAQ,EAAE,IAAI,GAAG,QAAQ,GAAG,YAAY;IAI1C,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;IAapD;;;OAGG;IACH,SAAS,IAAI,IAAI;IAIjB;;;OAGG;IACH,KAAK,IAAI,IAAI;IAKP,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAY3E,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IAIxD,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;IAI1D,aAAa,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;CAGpI"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/signer-noncemanager.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/signer-noncemanager.js deleted file mode 100644 index 710e8f4a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/signer-noncemanager.js +++ /dev/null @@ -1,74 +0,0 @@ -import { defineProperties } from "../utils/index.js"; -import { AbstractSigner } from "./abstract-signer.js"; -/** - * A **NonceManager** wraps another [[Signer]] and automatically manages - * the nonce, ensuring serialized and sequential nonces are used during - * transaction. - */ -export class NonceManager extends AbstractSigner { - /** - * The Signer being managed. - */ - signer; - #noncePromise; - #delta; - /** - * Creates a new **NonceManager** to manage %%signer%%. - */ - constructor(signer) { - super(signer.provider); - defineProperties(this, { signer }); - this.#noncePromise = null; - this.#delta = 0; - } - async getAddress() { - return this.signer.getAddress(); - } - connect(provider) { - return new NonceManager(this.signer.connect(provider)); - } - async getNonce(blockTag) { - if (blockTag === "pending") { - if (this.#noncePromise == null) { - this.#noncePromise = super.getNonce("pending"); - } - const delta = this.#delta; - return (await this.#noncePromise) + delta; - } - return super.getNonce(blockTag); - } - /** - * Manually increment the nonce. This may be useful when managng - * offline transactions. - */ - increment() { - this.#delta++; - } - /** - * Resets the nonce, causing the **NonceManager** to reload the current - * nonce from the blockchain on the next transaction. - */ - reset() { - this.#delta = 0; - this.#noncePromise = null; - } - async sendTransaction(tx) { - const noncePromise = this.getNonce("pending"); - this.increment(); - tx = await this.signer.populateTransaction(tx); - tx.nonce = await noncePromise; - // @TODO: Maybe handle interesting/recoverable errors? - // Like don't increment if the tx was certainly not sent - return await this.signer.sendTransaction(tx); - } - signTransaction(tx) { - return this.signer.signTransaction(tx); - } - signMessage(message) { - return this.signer.signMessage(message); - } - signTypedData(domain, types, value) { - return this.signer.signTypedData(domain, types, value); - } -} -//# sourceMappingURL=signer-noncemanager.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/signer-noncemanager.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/signer-noncemanager.js.map deleted file mode 100644 index c2d71528..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/signer-noncemanager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signer-noncemanager.js","sourceRoot":"","sources":["../../src.ts/providers/signer-noncemanager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAUtD;;;;GAIG;AACH,MAAM,OAAO,YAAa,SAAQ,cAAc;IAC5C;;OAEG;IACH,MAAM,CAAU;IAEhB,aAAa,CAAyB;IACtC,MAAM,CAAS;IAEf;;OAEG;IACH,YAAY,MAAc;QACtB,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACvB,gBAAgB,CAAe,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QAEjD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IACpB,CAAC;IAED,KAAK,CAAC,UAAU;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;IACpC,CAAC;IAED,O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AO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC;IAED,aAAa,CAAC,MAAuB,EAAE,KAA4C,EAAE,KAA0B;QAC3G,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAC3D,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/signer.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/signer.d.ts deleted file mode 100644 index f6d1aa82..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/signer.d.ts +++ /dev/null @@ -1,131 +0,0 @@ -import type { Addressable, NameResolver } from "../address/index.js"; -import type { AuthorizationRequest, TypedDataDomain, TypedDataField } from "../hash/index.js"; -import type { Authorization, TransactionLike } from "../transaction/index.js"; -import type { ContractRunner } from "./contracts.js"; -import type { BlockTag, Provider, TransactionRequest, TransactionResponse } from "./provider.js"; -/** - * A Signer represents an account on the Ethereum Blockchain, and is most often - * backed by a private key represented by a mnemonic or residing on a Hardware Wallet. - * - * The API remains abstract though, so that it can deal with more advanced exotic - * Signing entities, such as Smart Contract Wallets or Virtual Wallets (where the - * private key may not be known). - */ -export interface Signer extends Addressable, ContractRunner, NameResolver { - /** - * The [[Provider]] attached to this Signer (if any). - */ - provider: null | Provider; - /** - * Returns a new instance of this Signer connected to //provider// or detached - * from any Provider if null. - */ - connect(provider: null | Provider): Signer; - /** - * Get the address of the Signer. - */ - getAddress(): Promise; - /** - * Gets the next nonce required for this Signer to send a transaction. - * - * @param blockTag - The blocktag to base the transaction count on, keep in mind - * many nodes do not honour this value and silently ignore it [default: ``"latest"``] - */ - getNonce(blockTag?: BlockTag): Promise; - /** - * Prepares a {@link TransactionRequest} for calling: - * - resolves ``to`` and ``from`` addresses - * - if ``from`` is specified , check that it matches this Signer - * - * @param tx - The call to prepare - */ - populateCall(tx: TransactionRequest): Promise>; - /** - * Prepares a {@link TransactionRequest} for sending to the network by - * populating any missing properties: - * - resolves ``to`` and ``from`` addresses - * - if ``from`` is specified , check that it matches this Signer - * - populates ``nonce`` via ``signer.getNonce("pending")`` - * - populates ``gasLimit`` via ``signer.estimateGas(tx)`` - * - populates ``chainId`` via ``signer.provider.getNetwork()`` - * - populates ``type`` and relevant fee data for that type (``gasPrice`` - * for legacy transactions, ``maxFeePerGas`` for EIP-1559, etc) - * - * @note Some Signer implementations may skip populating properties that - * are populated downstream; for example JsonRpcSigner defers to the - * node to populate the nonce and fee data. - * - * @param tx - The call to prepare - */ - populateTransaction(tx: TransactionRequest): Promise>; - /** - * Estimates the required gas required to execute //tx// on the Blockchain. This - * will be the expected amount a transaction will require as its ``gasLimit`` - * to successfully run all the necessary computations and store the needed state - * that the transaction intends. - * - * Keep in mind that this is **best efforts**, since the state of the Blockchain - * is in flux, which could affect transaction gas requirements. - * - * @throws UNPREDICTABLE_GAS_LIMIT A transaction that is believed by the node to likely - * fail will throw an error during gas estimation. This could indicate that it - * will actually fail or that the circumstances are simply too complex for the - * node to take into account. In these cases, a manually determined ``gasLimit`` - * will need to be made. - */ - estimateGas(tx: TransactionRequest): Promise; - /** - * Evaluates the //tx// by running it against the current Blockchain state. This - * cannot change state and has no cost in ether, as it is effectively simulating - * execution. - * - * This can be used to have the Blockchain perform computations based on its state - * (e.g. running a Contract's getters) or to simulate the effect of a transaction - * before actually performing an operation. - */ - call(tx: TransactionRequest): Promise; - /** - * Resolves an ENS Name to an address. - */ - resolveName(name: string): Promise; - /** - * Signs %%tx%%, returning the fully signed transaction. This does not - * populate any additional properties within the transaction. - */ - signTransaction(tx: TransactionRequest): Promise; - /** - * Sends %%tx%% to the Network. The ``signer.populateTransaction(tx)`` - * is called first to ensure all necessary properties for the - * transaction to be valid have been popualted first. - */ - sendTransaction(tx: TransactionRequest): Promise; - /** - * Signs an [[link-eip-191]] prefixed personal message. - * - * If the %%message%% is a string, it is signed as UTF-8 encoded bytes. It is **not** - * interpretted as a [[BytesLike]]; so the string ``"0x1234"`` is signed as six - * characters, **not** two bytes. - * - * To sign that example as two bytes, the Uint8Array should be used - * (i.e. ``new Uint8Array([ 0x12, 0x34 ])``). - */ - signMessage(message: string | Uint8Array): Promise; - /** - * Signs the [[link-eip-712]] typed data. - */ - signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise; - /** - * Prepares an [[AuthorizationRequest]] for authorization by - * populating any missing properties: - * - resolves ``address`` (if an Addressable or ENS name) - * - populates ``nonce`` via ``signer.getNonce("pending")`` - * - populates ``chainId`` via ``signer.provider.getNetwork()`` - */ - populateAuthorization(auth: AuthorizationRequest): Promise; - /** - * Signs an %%authorization%% to be used in [[link-eip-7702]] - * transactions. - */ - authorize(authorization: AuthorizationRequest): Promise; -} -//# sourceMappingURL=signer.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/signer.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/signer.d.ts.map deleted file mode 100644 index 41b74e7f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/signer.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../src.ts/providers/signer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,EACR,oBAAoB,EAAE,eAAe,EAAE,cAAc,EACxD,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEjG;;;;;;;GAOG;AACH,MAAM,WAAW,MAAO,SAAQ,WAAW,E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AAK,CAAC,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAElI;;;;;;OAMG;IACH,qBAAqB,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAEjF;;;OAGG;IACH,SAAS,CAAC,aAAa,EAAE,oBAAoB,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CAC1E"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/signer.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/signer.js deleted file mode 100644 index 7c8f9901..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/signer.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=signer.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/signer.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/signer.js.map deleted file mode 100644 index 68d48a83..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/signer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signer.js","sourceRoot":"","sources":["../../src.ts/providers/signer.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-connection.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-connection.d.ts deleted file mode 100644 index b235e3b4..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-connection.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { Subscriber } from "./abstract-provider.js"; -import type { Provider } from "./provider.js"; -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export interface ConnectionRpcProvider extends Provider { - _subscribe(param: Array, processFunc: (result: any) => void): number; - _unsubscribe(filterId: number): void; -} -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export declare class BlockConnectionSubscriber implements Subscriber { - #private; - constructor(provider: ConnectionRpcProvider); - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; -} -//# sourceMappingURL=subscriber-connection.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-connection.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-connection.d.ts.map deleted file mode 100644 index a1d8c3e7..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-connection.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"subscriber-connection.d.ts","sourceRoot":"","sources":["../../src.ts/providers/subscriber-connection.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAIzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C;;;;GAIG;AACH,MAAM,WAAW,qBAAsB,SAAQ,QAAQ;IAEnD,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,GAAG,MAAM,CAAC;IAC1E,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACxC;AAED;;;;GAIG;AACH,qBAAa,yBAA0B,YAAW,UAAU;;gBAQ5C,QAAQ,EAAE,qBAAqB;IAO3C,KAAK,IAAI,IAAI;IAcb,IAAI,IAAI,IAAI;IAUZ,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI;IAKtC,MAAM,IAAI,IAAI;CAGjB"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-connection.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-connection.js deleted file mode 100644 index bd873833..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-connection.js +++ /dev/null @@ -1,52 +0,0 @@ -import { getNumber } from "../utils/index.js"; -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export class BlockConnectionSubscriber { - #provider; - #blockNumber; - #running; - #filterId; - constructor(provider) { - this.#provider = provider; - this.#blockNumber = -2; - this.#running = false; - this.#filterId = null; - } - start() { - if (this.#running) { - return; - } - this.#running = true; - this.#filterId = this.#provider._subscribe(["newHeads"], (result) => { - const blockNumber = getNumber(result.number); - const initial = (this.#blockNumber === -2) ? blockNumber : (this.#blockNumber + 1); - for (let b = initial; b <= blockNumber; b++) { - this.#provider.emit("block", b); - } - this.#blockNumber = blockNumber; - }); - } - stop() { - if (!this.#running) { - return; - } - this.#running = false; - if (this.#filterId != null) { - this.#provider._unsubscribe(this.#filterId); - this.#filterId = null; - } - } - pause(dropWhilePaused) { - if (dropWhilePaused) { - this.#blockNumber = -2; - } - this.stop(); - } - resume() { - this.start(); - } -} -//# sourceMappingURL=subscriber-connection.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-connection.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-connection.js.map deleted file mode 100644 index 21a64289..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-connection.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"subscriber-connection.js","sourceRoot":"","sources":["../../src.ts/providers/subscriber-connection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAmB9C;;;;GAIG;AACH,MAAM,OAAO,yBAAyB;IAClC,SAAS,CAAwB;IACjC,YAAY,CAAS;IAErB,QAAQ,CAAU;IAElB,SAAS,CAAgB;IAEzB,YAAY,QAA+B;QACvC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;QACvB,IAAI,CAAC,QAAQ,GAA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,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-filterid.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-filterid.d.ts deleted file mode 100644 index 721d6284..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-filterid.d.ts +++ /dev/null @@ -1,64 +0,0 @@ -import type { AbstractProvider, Subscriber } from "./abstract-provider.js"; -import type { EventFilter } from "./provider.js"; -import type { JsonRpcApiProvider } from "./provider-jsonrpc.js"; -/** - * Some backends support subscribing to events using a Filter ID. - * - * When subscribing with this technique, the node issues a unique - * //Filter ID//. At this point the node dedicates resources to - * the filter, so that periodic calls to follow up on the //Filter ID// - * will receive any events since the last call. - * - * @_docloc: api/providers/abstract-provider - */ -export declare class FilterIdSubscriber implements Subscriber { - #private; - /** - * Creates a new **FilterIdSubscriber** which will used [[_subscribe]] - * and [[_emitResults]] to setup the subscription and provide the event - * to the %%provider%%. - */ - constructor(provider: JsonRpcApiProvider); - /** - * Sub-classes **must** override this to begin the subscription. - */ - _subscribe(provider: JsonRpcApiProvider): Promise; - /** - * Sub-classes **must** override this handle the events. - */ - _emitResults(provider: AbstractProvider, result: Array): Promise; - /** - * Sub-classes **must** override this handle recovery on errors. - */ - _recover(provider: AbstractProvider): Subscriber; - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; -} -/** - * A **FilterIdSubscriber** for receiving contract events. - * - * @_docloc: api/providers/abstract-provider - */ -export declare class FilterIdEventSubscriber extends FilterIdSubscriber { - #private; - /** - * Creates a new **FilterIdEventSubscriber** attached to %%provider%% - * listening for %%filter%%. - */ - constructor(provider: JsonRpcApiProvider, filter: EventFilter); - _recover(provider: AbstractProvider): Subscriber; - _subscribe(provider: JsonRpcApiProvider): Promise; - _emitResults(provider: JsonRpcApiProvider, results: Array): Promise; -} -/** - * A **FilterIdSubscriber** for receiving pending transactions events. - * - * @_docloc: api/providers/abstract-provider - */ -export declare class FilterIdPendingSubscriber extends FilterIdSubscriber { - _subscribe(provider: JsonRpcApiProvider): Promise; - _emitResults(provider: JsonRpcApiProvider, results: Array): Promise; -} -//# sourceMappingURL=subscriber-filterid.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-filterid.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-filterid.d.ts.map deleted file mode 100644 index d012b466..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-filterid.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"subscriber-filterid.d.ts","sourceRoot":"","sources":["../../src.ts/providers/subscriber-filterid.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAE3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAMhE;;;;;;;;;GASG;AACH,qBAAa,kBAAmB,YAAW,UAAU;;IAYjD;;;;OAIG;gBACS,QAAQ,EAAE,kBAAkB;IAaxC;;OAEG;IACH,UAAU,CAAC,QAAQ,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IAIzD;;OAEG;IACH,YAAY,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3E;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,GAAG,UAAU;IAwDhD,KAAK,IAAI,IAAI;IAOb,IAAI,IAAI,IAAI;IASZ,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI;IAKtC,MAAM,IAAI,IAAI;CACjB;AAED;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,kBAAkB;;IAG3D;;;OAGG;gBACS,QAAQ,EAAE,kBAAkB,EAAE,MAAM,EAAE,WAAW;IAK7D,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,GAAG,UAAU;IAI1C,UAAU,CAAC,QAAQ,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IAKzD,YAAY,CAAC,QAAQ,EAAE,kBAAkB,EAAE,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAKvF;AAED;;;;GAIG;AACH,qBAAa,yBAA0B,SAAQ,kBAAkB;IACvD,UAAU,CAAC,QAAQ,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IAIzD,YAAY,CAAC,QAAQ,EAAE,kBAAkB,EAAE,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAKvF"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-filterid.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-filterid.js deleted file mode 100644 index 83bbc1d1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-filterid.js +++ /dev/null @@ -1,174 +0,0 @@ -import { isError } from "../utils/index.js"; -import { PollingEventSubscriber } from "./subscriber-polling.js"; -function copy(obj) { - return JSON.parse(JSON.stringify(obj)); -} -/** - * Some backends support subscribing to events using a Filter ID. - * - * When subscribing with this technique, the node issues a unique - * //Filter ID//. At this point the node dedicates resources to - * the filter, so that periodic calls to follow up on the //Filter ID// - * will receive any events since the last call. - * - * @_docloc: api/providers/abstract-provider - */ -export class FilterIdSubscriber { - #provider; - #filterIdPromise; - #poller; - #running; - #network; - #hault; - /** - * Creates a new **FilterIdSubscriber** which will used [[_subscribe]] - * and [[_emitResults]] to setup the subscription and provide the event - * to the %%provider%%. - */ - constructor(provider) { - this.#provider = provider; - this.#filterIdPromise = null; - this.#poller = this.#poll.bind(this); - this.#running = false; - this.#network = null; - this.#hault = false; - } - /** - * Sub-classes **must** override this to begin the subscription. - */ - _subscribe(provider) { - throw new Error("subclasses must override this"); - } - /** - * Sub-classes **must** override this handle the events. - */ - _emitResults(provider, result) { - throw new Error("subclasses must override this"); - } - /** - * Sub-classes **must** override this handle recovery on errors. - */ - _recover(provider) { - throw new Error("subclasses must override this"); - } - async #poll(blockNumber) { - try { - // Subscribe if necessary - if (this.#filterIdPromise == null) { - this.#filterIdPromise = this._subscribe(this.#provider); - } - // Get the Filter ID - let filterId = null; - try { - filterId = await this.#filterIdPromise; - } - catch (error) { - if (!isError(error, "UNSUPPORTED_OPERATION") || error.operation !== "eth_newFilter") { - throw error; - } - } - // The backend does not support Filter ID; downgrade to - // polling - if (filterId == null) { - this.#filterIdPromise = null; - this.#provider._recoverSubscriber(this, this._recover(this.#provider)); - return; - } - const network = await this.#provider.getNetwork(); - if (!this.#network) { - this.#network = network; - } - if (this.#network.chainId !== network.chainId) { - throw new Error("chaid changed"); - } - if (this.#hault) { - return; - } - const result = await this.#provider.send("eth_getFilterChanges", [filterId]); - await this._emitResults(this.#provider, result); - } - catch (error) { - console.log("@TODO", error); - } - this.#provider.once("block", this.#poller); - } - #teardown() { - const filterIdPromise = this.#filterIdPromise; - if (filterIdPromise) { - this.#filterIdPromise = null; - filterIdPromise.then((filterId) => { - if (this.#provider.destroyed) { - return; - } - this.#provider.send("eth_uninstallFilter", [filterId]); - }); - } - } - start() { - if (this.#running) { - return; - } - this.#running = true; - this.#poll(-2); - } - stop() { - if (!this.#running) { - return; - } - this.#running = false; - this.#hault = true; - this.#teardown(); - this.#provider.off("block", this.#poller); - } - pause(dropWhilePaused) { - if (dropWhilePaused) { - this.#teardown(); - } - this.#provider.off("block", this.#poller); - } - resume() { this.start(); } -} -/** - * A **FilterIdSubscriber** for receiving contract events. - * - * @_docloc: api/providers/abstract-provider - */ -export class FilterIdEventSubscriber extends FilterIdSubscriber { - #event; - /** - * Creates a new **FilterIdEventSubscriber** attached to %%provider%% - * listening for %%filter%%. - */ - constructor(provider, filter) { - super(provider); - this.#event = copy(filter); - } - _recover(provider) { - return new PollingEventSubscriber(provider, this.#event); - } - async _subscribe(provider) { - const filterId = await provider.send("eth_newFilter", [this.#event]); - return filterId; - } - async _emitResults(provider, results) { - for (const result of results) { - provider.emit(this.#event, provider._wrapLog(result, provider._network)); - } - } -} -/** - * A **FilterIdSubscriber** for receiving pending transactions events. - * - * @_docloc: api/providers/abstract-provider - */ -export class FilterIdPendingSubscriber extends FilterIdSubscriber { - async _subscribe(provider) { - return await provider.send("eth_newPendingTransactionFilter", []); - } - async _emitResults(provider, results) { - for (const result of results) { - provider.emit("pending", result); - } - } -} -//# sourceMappingURL=subscriber-filterid.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-filterid.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-filterid.js.map deleted file mode 100644 index 7e4b618e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-filterid.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"subscriber-filterid.js","sourceRoot":"","sources":["../../src.ts/providers/subscriber-filterid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAOjE,SAAS,IAAI,CAAC,GAAQ;IAClB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,OAAO,kBAAkB;IAC3B,SAAS,CAAqB;IAE9B,gBAAgB,CAAyB;IACzC,OAAO,CAA+B;IAEtC,QAAQ,CAAU;IAElB,QAAQ,CAAiB;IAEzB,MAAM,CAAU;IAEhB;;;;OAIG;IACH,YAAY,QAA4B;QACpC,IAAI,CAAC,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AAO,QAAQ,CAAC;IACpB,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,QAA4B,EAAE,OAAmB;QAChE,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;YAC1B,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;SAC5E;IACL,CAAC;CACJ;AAED;;;;GAIG;AACH,MAAM,OAAO,yBAA0B,SAAQ,kBAAkB;IAC7D,KAAK,CAAC,UAAU,CAAC,QAA4B;QACzC,OAAO,MAAM,QAAQ,CAAC,IAAI,CAAC,iCAAiC,EAAE,EAAG,CAAC,CAAC;IACvE,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,QAA4B,EAAE,OAAmB;QAChE,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;YAC1B,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;SACpC;IACL,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-polling.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-polling.d.ts deleted file mode 100644 index e751ba48..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-polling.d.ts +++ /dev/null @@ -1,100 +0,0 @@ -import type { AbstractProvider, Subscriber } from "./abstract-provider.js"; -import type { EventFilter, OrphanFilter, ProviderEvent } from "./provider.js"; -/** - * Return the polling subscriber for common events. - * - * @_docloc: api/providers/abstract-provider - */ -export declare function getPollingSubscriber(provider: AbstractProvider, event: ProviderEvent): Subscriber; -/** - * A **PollingBlockSubscriber** polls at a regular interval for a change - * in the block number. - * - * @_docloc: api/providers/abstract-provider - */ -export declare class PollingBlockSubscriber implements Subscriber { - #private; - /** - * Create a new **PollingBlockSubscriber** attached to %%provider%%. - */ - constructor(provider: AbstractProvider); - /** - * The polling interval. - */ - get pollingInterval(): number; - set pollingInterval(value: number); - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; -} -/** - * An **OnBlockSubscriber** can be sub-classed, with a [[_poll]] - * implmentation which will be called on every new block. - * - * @_docloc: api/providers/abstract-provider - */ -export declare class OnBlockSubscriber implements Subscriber { - #private; - /** - * Create a new **OnBlockSubscriber** attached to %%provider%%. - */ - constructor(provider: AbstractProvider); - /** - * Called on every new block. - */ - _poll(blockNumber: number, provider: AbstractProvider): Promise; - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; -} -export declare class PollingBlockTagSubscriber extends OnBlockSubscriber { - #private; - constructor(provider: AbstractProvider, tag: string); - pause(dropWhilePaused?: boolean): void; - _poll(blockNumber: number, provider: AbstractProvider): Promise; -} -/** - * @_ignore: - * - * @_docloc: api/providers/abstract-provider - */ -export declare class PollingOrphanSubscriber extends OnBlockSubscriber { - #private; - constructor(provider: AbstractProvider, filter: OrphanFilter); - _poll(blockNumber: number, provider: AbstractProvider): Promise; -} -/** - * A **PollingTransactionSubscriber** will poll for a given transaction - * hash for its receipt. - * - * @_docloc: api/providers/abstract-provider - */ -export declare class PollingTransactionSubscriber extends OnBlockSubscriber { - #private; - /** - * Create a new **PollingTransactionSubscriber** attached to - * %%provider%%, listening for %%hash%%. - */ - constructor(provider: AbstractProvider, hash: string); - _poll(blockNumber: number, provider: AbstractProvider): Promise; -} -/** - * A **PollingEventSubscriber** will poll for a given filter for its logs. - * - * @_docloc: api/providers/abstract-provider - */ -export declare class PollingEventSubscriber implements Subscriber { - #private; - /** - * Create a new **PollingTransactionSubscriber** attached to - * %%provider%%, listening for %%filter%%. - */ - constructor(provider: AbstractProvider, filter: EventFilter); - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; -} -//# sourceMappingURL=subscriber-polling.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-polling.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-polling.d.ts.map deleted file mode 100644 index 193b2aae..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-polling.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"subscriber-polling.d.ts","sourceRoot":"","sources":["../../src.ts/providers/subscriber-polling.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAM9E;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,KAAK,EAAE,aAAa,GAAG,UAAU,CAOjG;AAID;;;;;GAKG;AACH,qBAAa,sBAAuB,YAAW,UAAU;;IAUrD;;OAEG;gBACS,QAAQ,EAAE,gBAAgB;IAQtC;;OAEG;IACH,IAAI,eAAe,IAAI,MAAM,CAA2B;IACxD,IAAI,eAAe,CAAC,KAAK,EAAE,MAAM,EAA6B;IAqC9D,KAAK,IAAI,IAAI;IAMb,IAAI,IAAI,IAAI;IAMZ,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI;IAKtC,MAAM,IAAI,IAAI;CAGjB;AAGD;;;;;GAKG;AACH,qBAAa,iBAAkB,YAAW,UAAU;;IAKhD;;OAEG;gBACS,QAAQ,EAAE,gBAAgB;IAQtC;;OAEG;IACG,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3E,KAAK,IAAI,IAAI;IAQb,IAAI,IAAI,IAAI;IAOZ,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI;IACtC,MAAM,IAAI,IAAI;CACjB;AAED,qBAAa,yBAA0B,SAAQ,iBAAiB;;gBAIhD,QAAQ,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM;IAMnD,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI;IAKhC,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;CAW9E;AAGD;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,iBAAiB;;gBAG9C,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,YAAY;IAKtD,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;CAI9E;AAED;;;;;GAKG;AACH,qBAAa,4BAA6B,SAAQ,iBAAiB;;IAG/D;;;OAGG;gBACS,QAAQ,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM;IAK9C,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;CAI9E;AAED;;;;GAIG;AACH,qBAAa,sBAAuB,YAAW,UAAU;;IAWrD;;;OAGG;gBACS,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,WAAW;IAqC3D,KAAK,IAAI,IAAI;IAYb,IAAI,IAAI,IAAI;IAOZ,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI;IAKtC,MAAM,IAAI,IAAI;CAGjB"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-polling.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-polling.js deleted file mode 100644 index b091077a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-polling.js +++ /dev/null @@ -1,293 +0,0 @@ -import { assert, isHexString } from "../utils/index.js"; -function copy(obj) { - return JSON.parse(JSON.stringify(obj)); -} -/** - * Return the polling subscriber for common events. - * - * @_docloc: api/providers/abstract-provider - */ -export function getPollingSubscriber(provider, event) { - if (event === "block") { - return new PollingBlockSubscriber(provider); - } - if (isHexString(event, 32)) { - return new PollingTransactionSubscriber(provider, event); - } - assert(false, "unsupported polling event", "UNSUPPORTED_OPERATION", { - operation: "getPollingSubscriber", info: { event } - }); -} -// @TODO: refactor this -/** - * A **PollingBlockSubscriber** polls at a regular interval for a change - * in the block number. - * - * @_docloc: api/providers/abstract-provider - */ -export class PollingBlockSubscriber { - #provider; - #poller; - #interval; - // The most recent block we have scanned for events. The value -2 - // indicates we still need to fetch an initial block number - #blockNumber; - /** - * Create a new **PollingBlockSubscriber** attached to %%provider%%. - */ - constructor(provider) { - this.#provider = provider; - this.#poller = null; - this.#interval = 4000; - this.#blockNumber = -2; - } - /** - * The polling interval. - */ - get pollingInterval() { return this.#interval; } - set pollingInterval(value) { this.#interval = value; } - async #poll() { - try { - const blockNumber = await this.#provider.getBlockNumber(); - // Bootstrap poll to setup our initial block number - if (this.#blockNumber === -2) { - this.#blockNumber = blockNumber; - return; - } - // @TODO: Put a cap on the maximum number of events per loop? - if (blockNumber !== this.#blockNumber) { - for (let b = this.#blockNumber + 1; b <= blockNumber; b++) { - // We have been stopped - if (this.#poller == null) { - return; - } - await this.#provider.emit("block", b); - } - this.#blockNumber = blockNumber; - } - } - catch (error) { - // @TODO: Minor bump, add an "error" event to let subscribers - // know things went awry. - //console.log(error); - } - // We have been stopped - if (this.#poller == null) { - return; - } - this.#poller = this.#provider._setTimeout(this.#poll.bind(this), this.#interval); - } - start() { - if (this.#poller) { - return; - } - this.#poller = this.#provider._setTimeout(this.#poll.bind(this), this.#interval); - this.#poll(); - } - stop() { - if (!this.#poller) { - return; - } - this.#provider._clearTimeout(this.#poller); - this.#poller = null; - } - pause(dropWhilePaused) { - this.stop(); - if (dropWhilePaused) { - this.#blockNumber = -2; - } - } - resume() { - this.start(); - } -} -/** - * An **OnBlockSubscriber** can be sub-classed, with a [[_poll]] - * implmentation which will be called on every new block. - * - * @_docloc: api/providers/abstract-provider - */ -export class OnBlockSubscriber { - #provider; - #poll; - #running; - /** - * Create a new **OnBlockSubscriber** attached to %%provider%%. - */ - constructor(provider) { - this.#provider = provider; - this.#running = false; - this.#poll = (blockNumber) => { - this._poll(blockNumber, this.#provider); - }; - } - /** - * Called on every new block. - */ - async _poll(blockNumber, provider) { - throw new Error("sub-classes must override this"); - } - start() { - if (this.#running) { - return; - } - this.#running = true; - this.#poll(-2); - this.#provider.on("block", this.#poll); - } - stop() { - if (!this.#running) { - return; - } - this.#running = false; - this.#provider.off("block", this.#poll); - } - pause(dropWhilePaused) { this.stop(); } - resume() { this.start(); } -} -export class PollingBlockTagSubscriber extends OnBlockSubscriber { - #tag; - #lastBlock; - constructor(provider, tag) { - super(provider); - this.#tag = tag; - this.#lastBlock = -2; - } - pause(dropWhilePaused) { - if (dropWhilePaused) { - this.#lastBlock = -2; - } - super.pause(dropWhilePaused); - } - async _poll(blockNumber, provider) { - const block = await provider.getBlock(this.#tag); - if (block == null) { - return; - } - if (this.#lastBlock === -2) { - this.#lastBlock = block.number; - } - else if (block.number > this.#lastBlock) { - provider.emit(this.#tag, block.number); - this.#lastBlock = block.number; - } - } -} -/** - * @_ignore: - * - * @_docloc: api/providers/abstract-provider - */ -export class PollingOrphanSubscriber extends OnBlockSubscriber { - #filter; - constructor(provider, filter) { - super(provider); - this.#filter = copy(filter); - } - async _poll(blockNumber, provider) { - throw new Error("@TODO"); - console.log(this.#filter); - } -} -/** - * A **PollingTransactionSubscriber** will poll for a given transaction - * hash for its receipt. - * - * @_docloc: api/providers/abstract-provider - */ -export class PollingTransactionSubscriber extends OnBlockSubscriber { - #hash; - /** - * Create a new **PollingTransactionSubscriber** attached to - * %%provider%%, listening for %%hash%%. - */ - constructor(provider, hash) { - super(provider); - this.#hash = hash; - } - async _poll(blockNumber, provider) { - const tx = await provider.getTransactionReceipt(this.#hash); - if (tx) { - provider.emit(this.#hash, tx); - } - } -} -/** - * A **PollingEventSubscriber** will poll for a given filter for its logs. - * - * @_docloc: api/providers/abstract-provider - */ -export class PollingEventSubscriber { - #provider; - #filter; - #poller; - #running; - // The most recent block we have scanned for events. The value -2 - // indicates we still need to fetch an initial block number - #blockNumber; - /** - * Create a new **PollingTransactionSubscriber** attached to - * %%provider%%, listening for %%filter%%. - */ - constructor(provider, filter) { - this.#provider = provider; - this.#filter = copy(filter); - this.#poller = this.#poll.bind(this); - this.#running = false; - this.#blockNumber = -2; - } - async #poll(blockNumber) { - // The initial block hasn't been determined yet - if (this.#blockNumber === -2) { - return; - } - const filter = copy(this.#filter); - filter.fromBlock = this.#blockNumber + 1; - filter.toBlock = blockNumber; - const logs = await this.#provider.getLogs(filter); - // No logs could just mean the node has not indexed them yet, - // so we keep a sliding window of 60 blocks to keep scanning - if (logs.length === 0) { - if (this.#blockNumber < blockNumber - 60) { - this.#blockNumber = blockNumber - 60; - } - return; - } - for (const log of logs) { - this.#provider.emit(this.#filter, log); - // Only advance the block number when logs were found to - // account for networks (like BNB and Polygon) which may - // sacrifice event consistency for block event speed - this.#blockNumber = log.blockNumber; - } - } - start() { - if (this.#running) { - return; - } - this.#running = true; - if (this.#blockNumber === -2) { - this.#provider.getBlockNumber().then((blockNumber) => { - this.#blockNumber = blockNumber; - }); - } - this.#provider.on("block", this.#poller); - } - stop() { - if (!this.#running) { - return; - } - this.#running = false; - this.#provider.off("block", this.#poller); - } - pause(dropWhilePaused) { - this.stop(); - if (dropWhilePaused) { - this.#blockNumber = -2; - } - } - resume() { - this.start(); - } -} -//# sourceMappingURL=subscriber-polling.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-polling.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-polling.js.map deleted file mode 100644 index f7af02ea..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/subscriber-polling.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"subscriber-polling.js","sourceRoot":"","sources":["../../src.ts/providers/subscriber-polling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAA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,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;IAED,IAAI;QACA,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAAE,OAAO;SAAE;QAC/B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QAEtB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9C,CAAC;IAED,KAAK,CAAC,eAAyB;QAC3B,IAAI,CAAC,IAAI,EAAE,CAAC;QACZ,IAAI,eAAe,EAAE;YAAE,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;SAAE;IACpD,CAAC;IAED,MAAM;QACF,IAAI,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ws-browser.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ws-browser.d.ts deleted file mode 100644 index d9272042..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ws-browser.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const _WebSocket: any; -export { _WebSocket as WebSocket }; -//# sourceMappingURL=ws-browser.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ws-browser.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ws-browser.d.ts.map deleted file mode 100644 index f549c4b0..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ws-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ws-browser.d.ts","sourceRoot":"","sources":["../../src.ts/providers/ws-browser.ts"],"names":[],"mappings":"AAQA,QAAA,MAAM,UAAU,KAAwB,CAAC;AAEzC,OAAO,EAAE,UAAU,IAAI,SAAS,EAAE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ws-browser.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ws-browser.js deleted file mode 100644 index df9584d2..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ws-browser.js +++ /dev/null @@ -1,16 +0,0 @@ -function getGlobal() { - if (typeof self !== 'undefined') { - return self; - } - if (typeof window !== 'undefined') { - return window; - } - if (typeof global !== 'undefined') { - return global; - } - throw new Error('unable to locate global object'); -} -; -const _WebSocket = getGlobal().WebSocket; -export { _WebSocket as WebSocket }; -//# sourceMappingURL=ws-browser.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ws-browser.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ws-browser.js.map deleted file mode 100644 index e23187e8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ws-browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ws-browser.js","sourceRoot":"","sources":["../../src.ts/providers/ws-browser.ts"],"names":[],"mappings":"AACA,SAAS,SAAS;IAChB,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;QAAE,OAAO,IAAI,CAAC;KAAE;IACjD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QAAE,OAAO,MAAM,CAAC;KAAE;IACrD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QAAE,OAAO,MAAM,CAAC;KAAE;IACrD,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;AACpD,CAAC;AAAA,CAAC;AAEF,MAAM,UAAU,GAAG,SAAS,EAAE,CAAC,SAAS,CAAC;AAEzC,OAAO,EAAE,UAAU,IAAI,SAAS,EAAE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ws.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ws.d.ts deleted file mode 100644 index 75d53b7d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ws.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { WebSocket } from "ws"; -//# sourceMappingURL=ws.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ws.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ws.d.ts.map deleted file mode 100644 index c424f8d8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ws.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ws.d.ts","sourceRoot":"","sources":["../../src.ts/providers/ws.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ws.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ws.js deleted file mode 100644 index 3fcc8f78..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ws.js +++ /dev/null @@ -1,2 +0,0 @@ -export { WebSocket } from "ws"; -//# sourceMappingURL=ws.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ws.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ws.js.map deleted file mode 100644 index 717e091c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/providers/ws.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ws.js","sourceRoot":"","sources":["../../src.ts/providers/ws.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/accesslist.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/accesslist.d.ts deleted file mode 100644 index e30ac1c4..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/accesslist.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { AccessList, AccessListish } from "./index.js"; -/** - * Returns a [[AccessList]] from any ethers-supported access-list structure. - */ -export declare function accessListify(value: AccessListish): AccessList; -//# sourceMappingURL=accesslist.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/accesslist.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/accesslist.d.ts.map deleted file mode 100644 index 6516681e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/accesslist.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"accesslist.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/accesslist.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAa5D;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,UAAU,CAuB9D"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/accesslist.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/accesslist.js deleted file mode 100644 index 767b7e5b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/accesslist.js +++ /dev/null @@ -1,37 +0,0 @@ -import { getAddress } from "../address/index.js"; -import { assertArgument, isHexString } from "../utils/index.js"; -function accessSetify(addr, storageKeys) { - return { - address: getAddress(addr), - storageKeys: storageKeys.map((storageKey, index) => { - assertArgument(isHexString(storageKey, 32), "invalid slot", `storageKeys[${index}]`, storageKey); - return storageKey.toLowerCase(); - }) - }; -} -/** - * Returns a [[AccessList]] from any ethers-supported access-list structure. - */ -export function accessListify(value) { - if (Array.isArray(value)) { - return value.map((set, index) => { - if (Array.isArray(set)) { - assertArgument(set.length === 2, "invalid slot set", `value[${index}]`, set); - return accessSetify(set[0], set[1]); - } - assertArgument(set != null && typeof (set) === "object", "invalid address-slot set", "value", value); - return accessSetify(set.address, set.storageKeys); - }); - } - assertArgument(value != null && typeof (value) === "object", "invalid access list", "value", value); - const result = Object.keys(value).map((addr) => { - const storageKeys = value[addr].reduce((accum, storageKey) => { - accum[storageKey] = true; - return accum; - }, {}); - return accessSetify(addr, Object.keys(storageKeys).sort()); - }); - result.sort((a, b) => (a.address.localeCompare(b.address))); - return result; -} -//# sourceMappingURL=accesslist.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/accesslist.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/accesslist.js.map deleted file mode 100644 index a74e82dd..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/accesslist.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"accesslist.js","sourceRoot":"","sources":["../../src.ts/transaction/accesslist.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKhE,SAAS,YAAY,CAAC,IAAY,EAAE,WAA0B;IAC1D,OAAO;QACH,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC;QACzB,WAAW,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,EAAE;YAC/C,cAAc,CAAC,WAAW,CAAC,UAAU,EAAE,EAAE,CAAC,EAAE,cAAc,EAAE,eAAgB,KAAM,GAAG,EAAE,UAAU,CAAC,CAAC;YACnG,OAAO,UAAU,CAAC,WAAW,EAAE,CAAC;QACpC,CAAC,CAAC;KACL,CAAC;AACN,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,KAAoB;IAC9C,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACtB,OAA0F,KAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;YAChH,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;gBACpB,cAAc,CAAC,GAAG,CAA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.esm/transaction/address.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/address.d.ts deleted file mode 100644 index 0b86944f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/address.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { SigningKey } from "../crypto/index.js"; -import type { SignatureLike } from "../crypto/index.js"; -import type { BytesLike } from "../utils/index.js"; -/** - * Returns the address for the %%key%%. - * - * The key may be any standard form of public key or a private key. - */ -export declare function computeAddress(key: string | SigningKey): string; -/** - * Returns the recovered address for the private key that was - * used to sign %%digest%% that resulted in %%signature%%. - */ -export declare function recoverAddress(digest: BytesLike, signature: SignatureLike): string; -//# sourceMappingURL=address.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/address.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/address.d.ts.map deleted file mode 100644 index 83e6f094..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/address.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/address.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,CAQ/D;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,GAAG,MAAM,CAElF"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/address.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/address.js deleted file mode 100644 index 48ea3c7b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/address.js +++ /dev/null @@ -1,25 +0,0 @@ -import { getAddress } from "../address/index.js"; -import { keccak256, SigningKey } from "../crypto/index.js"; -/** - * Returns the address for the %%key%%. - * - * The key may be any standard form of public key or a private key. - */ -export function computeAddress(key) { - let pubkey; - if (typeof (key) === "string") { - pubkey = SigningKey.computePublicKey(key, false); - } - else { - pubkey = key.publicKey; - } - return getAddress(keccak256("0x" + pubkey.substring(4)).substring(26)); -} -/** - * Returns the recovered address for the private key that was - * used to sign %%digest%% that resulted in %%signature%%. - */ -export function recoverAddress(digest, signature) { - return computeAddress(SigningKey.recoverPublicKey(digest, signature)); -} -//# sourceMappingURL=address.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/address.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/address.js.map deleted file mode 100644 index 014d2da6..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/address.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"address.js","sourceRoot":"","sources":["../../src.ts/transaction/address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAK3D;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,GAAwB;IACnD,IAAI,MAAc,CAAC;IACnB,IAAI,OAAM,CAAC,GAAG,CAAC,KAAK,QAAQ,EAAE;QAC1B,MAAM,GAAG,UAAU,CAAC,gBAAgB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;KACpD;SAAM;QACH,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC;KAC1B;IACD,OAAO,UAAU,CAAC,SAAS,CAAC,IAAI,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;AAC3E,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,MAAiB,EAAE,SAAwB;IACtE,OAAO,cAAc,CAAC,UAAU,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;AAC1E,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/authorization.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/authorization.d.ts deleted file mode 100644 index c9cc207d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/authorization.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Authorization, AuthorizationLike } from "./index.js"; -export declare function authorizationify(auth: AuthorizationLike): Authorization; -//# sourceMappingURL=authorization.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/authorization.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/authorization.d.ts.map deleted file mode 100644 index 6d90d17f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/authorization.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"authorization.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/authorization.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEnE,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,iBAAiB,GAAG,aAAa,CAOvE"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/authorization.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/authorization.js deleted file mode 100644 index 55108e69..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/authorization.js +++ /dev/null @@ -1,12 +0,0 @@ -import { getAddress } from "../address/index.js"; -import { Signature } from "../crypto/index.js"; -import { getBigInt } from "../utils/index.js"; -export function authorizationify(auth) { - return { - address: getAddress(auth.address), - nonce: getBigInt((auth.nonce != null) ? auth.nonce : 0), - chainId: getBigInt((auth.chainId != null) ? auth.chainId : 0), - signature: Signature.from(auth.signature) - }; -} -//# sourceMappingURL=authorization.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/authorization.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/authorization.js.map deleted file mode 100644 index f14d5741..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/authorization.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"authorization.js","sourceRoot":"","sources":["../../src.ts/transaction/authorization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAI9C,MAAM,UAAU,gBAAgB,CAAC,IAAuB;IACpD,OAAO;QACH,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC;QACjC,KAAK,EAAE,SAAS,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAA,CAAC,CAAC,CAAC,CAAC;QACtD,OAAO,EAAE,SAAS,CAAC,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,CAAA,CAAC,CAAC,IAAI,CAAC,OAAO,CAAA,CAAC,CAAC,CAAC,CAAC;QAC3D,SAAS,EAAE,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC;KAC5C,CAAC;AACN,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/index.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/index.d.ts deleted file mode 100644 index 0a12b228..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/index.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Each state-changing operation on Ethereum requires a transaction. - * - * @_section api/transaction:Transactions [about-transactions] - */ -import type { BigNumberish } from "../utils/maths.js"; -import type { Signature, SignatureLike } from "../crypto/index.js"; -/** - * A single [[AccessList]] entry of storage keys (slots) for an address. - */ -export type AccessListEntry = { - address: string; - storageKeys: Array; -}; -/** - * An ordered collection of [[AccessList]] entries. - */ -export type AccessList = Array; -/** - * Any ethers-supported access list structure. - */ -export type AccessListish = AccessList | Array<[string, Array]> | Record>; -export interface Authorization { - address: string; - nonce: bigint; - chainId: bigint; - signature: Signature; -} -export type AuthorizationLike = { - address: string; - nonce: BigNumberish; - chainId: BigNumberish; - signature: SignatureLike; -}; -export { accessListify } from "./accesslist.js"; -export { authorizationify } from "./authorization.js"; -export { computeAddress, recoverAddress } from "./address.js"; -export { Transaction } from "./transaction.js"; -export type { Blob, BlobLike, KzgLibrary, KzgLibraryLike, TransactionLike } from "./transaction.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/index.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/index.d.ts.map deleted file mode 100644 index c0bbe666..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnE;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC;AAE9E;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,eAAe,CAAC,CAAC;AAEhD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,GACV,KAAK,CAAC,CAAE,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAE,CAAC,GAChC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;AAG1D,MAAM,WAAW,aAAa;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,SAAS,CAAC;CACxB;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,YAAY,CAAC;IACpB,OAAO,EAAE,YAAY,CAAC;IACtB,SAAS,EAAE,aAAa,CAAA;CAC3B,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,YAAY,EACR,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,eAAe,EAC9D,MAAM,kBAAkB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/index.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/index.js deleted file mode 100644 index 843480e4..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/index.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Each state-changing operation on Ethereum requires a transaction. - * - * @_section api/transaction:Transactions [about-transactions] - */ -null; -export { accessListify } from "./accesslist.js"; -export { authorizationify } from "./authorization.js"; -export { computeAddress, recoverAddress } from "./address.js"; -export { Transaction } from "./transaction.js"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/index.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/index.js.map deleted file mode 100644 index 4642a33f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/transaction/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,IAAI,CAAC;AAqCL,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/transaction.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/transaction.d.ts deleted file mode 100644 index 8102f77f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/transaction.d.ts +++ /dev/null @@ -1,430 +0,0 @@ -import { Signature } from "../crypto/index.js"; -import type { BigNumberish, BytesLike } from "../utils/index.js"; -import type { SignatureLike } from "../crypto/index.js"; -import type { AccessList, AccessListish, Authorization, AuthorizationLike } from "./index.js"; -declare const inspect: unique symbol; -/** - * Returns a BLOb proof as its cells for [[link-eip-7594]] BLOb. - * - * The default %%cellCount%% is 128. - */ -export declare function splitBlobCells(_proof: BytesLike, cellCount?: number): Array; -/** - * A **TransactionLike** is an object which is appropriate as a loose - * input for many operations which will populate missing properties of - * a transaction. - */ -export interface TransactionLike { - /** - * The type. - */ - type?: null | number; - /** - * The recipient address or ``null`` for an ``init`` transaction. - */ - to?: null | A; - /** - * The sender. - */ - from?: null | A; - /** - * The nonce. - */ - nonce?: null | number; - /** - * The maximum amount of gas that can be used. - */ - gasLimit?: null | BigNumberish; - /** - * The gas price for legacy and berlin transactions. - */ - gasPrice?: null | BigNumberish; - /** - * The maximum priority fee per gas for london transactions. - */ - maxPriorityFeePerGas?: null | BigNumberish; - /** - * The maximum total fee per gas for london transactions. - */ - maxFeePerGas?: null | BigNumberish; - /** - * The data. - */ - data?: null | string; - /** - * The value (in wei) to send. - */ - value?: null | BigNumberish; - /** - * The chain ID the transaction is valid on. - */ - chainId?: null | BigNumberish; - /** - * The transaction hash. - */ - hash?: null | string; - /** - * The signature provided by the sender. - */ - signature?: null | SignatureLike; - /** - * The access list for berlin and london transactions. - */ - accessList?: null | AccessListish; - /** - * The maximum fee per blob gas (see [[link-eip-4844]]). - */ - maxFeePerBlobGas?: null | BigNumberish; - /** - * The versioned hashes (see [[link-eip-4844]]). - */ - blobVersionedHashes?: null | Array; - /** - * The blobs (if any) attached to this transaction (see [[link-eip-4844]]). - */ - blobs?: null | Array; - /** - * An external library for computing the KZG commitments and - * proofs necessary for EIP-4844 transactions (see [[link-eip-4844]]). - * - * This is generally ``null``, unless you are creating BLOb - * transactions. - */ - kzg?: null | KzgLibraryLike; - /** - * The [[link-eip-7594]] BLOb Wrapper Version used for PeerDAS. - * - * For networks that use EIP-7594, this property is required to - * serialize the sidecar correctly. - */ - blobWrapperVersion?: null | number; - /** - * The [[link-eip-7702]] authorizations (if any). - */ - authorizationList?: null | Array; -} -/** - * A full-valid BLOb object for [[link-eip-4844]] transactions. - * - * The commitment and proof should have been computed using a - * KZG library. - */ -export interface Blob { - /** - * The blob data. - */ - data: string; - /** - * A EIP-4844 BLOb uses a string proof, while EIP-7594 use an - * array of strings representing the cells of the proof. - */ - proof: string; - /** - * The BLOb commitment. - */ - commitment: string; -} -/** - * A BLOb object that can be passed for [[link-eip-4844]] - * transactions. - * - * It may have had its commitment and proof already provided - * or rely on an attached [[KzgLibrary]] to compute them. - */ -export type BlobLike = BytesLike | { - data: BytesLike; - proof: BytesLike; - commitment: BytesLike; -}; -/** - * A KZG Library with the necessary functions to compute - * BLOb commitments and proofs. - */ -export interface KzgLibrary { - blobToKzgCommitment: (blob: Uint8Array) => Uint8Array; - computeBlobKzgProof: (blob: Uint8Array, commitment: Uint8Array) => Uint8Array; -} -/** - * A KZG Library with any of the various API configurations. - * As the library is still experimental and the API is not - * stable, depending on the version used the method names and - * signatures are still in flux. - * - * This allows any of the versions to be passed into Transaction - * while providing a stable external API. - */ -export type KzgLibraryLike = KzgLibrary | { - blobToKZGCommitment: (blob: string) => string; - computeBlobKZGProof: (blob: string, commitment: string) => string; -} | { - blobToKzgCommitment: (blob: string) => string | Uint8Array; - computeBlobProof: (blob: string, commitment: string) => string | Uint8Array; -}; -/** - * A **Transaction** describes an operation to be executed on - * Ethereum by an Externally Owned Account (EOA). It includes - * who (the [[to]] address), what (the [[data]]) and how much (the - * [[value]] in ether) the operation should entail. - * - * @example: - * tx = new Transaction() - * //_result: - * - * tx.data = "0x1234"; - * //_result: - */ -export declare class Transaction implements TransactionLike { - #private; - /** - * The transaction type. - * - * If null, the type will be automatically inferred based on - * explicit properties. - */ - get type(): null | number; - set type(value: null | number | string); - /** - * The name of the transaction type. - */ - get typeName(): null | string; - /** - * The ``to`` address for the transaction or ``null`` if the - * transaction is an ``init`` transaction. - */ - get to(): null | string; - set to(value: null | string); - /** - * The transaction nonce. - */ - get nonce(): number; - set nonce(value: BigNumberish); - /** - * The gas limit. - */ - get gasLimit(): bigint; - set gasLimit(value: BigNumberish); - /** - * The gas price. - * - * On legacy networks this defines the fee that will be paid. On - * EIP-1559 networks, this should be ``null``. - */ - get gasPrice(): null | bigint; - set gasPrice(value: null | BigNumberish); - /** - * The maximum priority fee per unit of gas to pay. On legacy - * networks this should be ``null``. - */ - get maxPriorityFeePerGas(): null | bigint; - set maxPriorityFeePerGas(value: null | BigNumberish); - /** - * The maximum total fee per unit of gas to pay. On legacy - * networks this should be ``null``. - */ - get maxFeePerGas(): null | bigint; - set maxFeePerGas(value: null | BigNumberish); - /** - * The transaction data. For ``init`` transactions this is the - * deployment code. - */ - get data(): string; - set data(value: BytesLike); - /** - * The amount of ether (in wei) to send in this transactions. - */ - get value(): bigint; - set value(value: BigNumberish); - /** - * The chain ID this transaction is valid on. - */ - get chainId(): bigint; - set chainId(value: BigNumberish); - /** - * If signed, the signature for this transaction. - */ - get signature(): null | Signature; - set signature(value: null | SignatureLike); - isValid(): boolean; - /** - * The access list. - * - * An access list permits discounted (but pre-paid) access to - * bytecode and state variable access within contract execution. - */ - get accessList(): null | AccessList; - set accessList(value: null | AccessListish); - get authorizationList(): null | Array; - set authorizationList(auths: null | Array); - /** - * The max fee per blob gas for Cancun transactions. - */ - get maxFeePerBlobGas(): null | bigint; - set maxFeePerBlobGas(value: null | BigNumberish); - /** - * The BLOb versioned hashes for Cancun transactions. - */ - get blobVersionedHashes(): null | Array; - set blobVersionedHashes(value: null | Array); - /** - * The BLObs for the Transaction, if any. - * - * If ``blobs`` is non-``null``, then the [[seriailized]] - * will return the network formatted sidecar, otherwise it - * will return the standard [[link-eip-2718]] payload. The - * [[unsignedSerialized]] is unaffected regardless. - * - * When setting ``blobs``, either fully valid [[Blob]] objects - * may be specified (i.e. correctly padded, with correct - * committments and proofs) or a raw [[BytesLike]] may - * be provided. - * - * If raw [[BytesLike]] are provided, the [[kzg]] property **must** - * be already set. The blob will be correctly padded and the - * [[KzgLibrary]] will be used to compute the committment and - * proof for the blob. - * - * A BLOb is a sequence of field elements, each of which must - * be within the BLS field modulo, so some additional processing - * may be required to encode arbitrary data to ensure each 32 byte - * field is within the valid range. - * - * Setting this automatically populates [[blobVersionedHashes]], - * overwriting any existing values. Setting this to ``null`` - * does **not** remove the [[blobVersionedHashes]], leaving them - * present. - */ - get blobs(): null | Array; - set blobs(_blobs: null | Array); - get kzg(): null | KzgLibrary; - set kzg(kzg: null | KzgLibraryLike); - get blobWrapperVersion(): null | number; - set blobWrapperVersion(value: null | number); - /** - * Creates a new Transaction with default values. - */ - constructor(); - /** - * The transaction hash, if signed. Otherwise, ``null``. - */ - get hash(): null | string; - /** - * The pre-image hash of this transaction. - * - * This is the digest that a [[Signer]] must sign to authorize - * this transaction. - */ - get unsignedHash(): string; - /** - * The sending address, if signed. Otherwise, ``null``. - */ - get from(): null | string; - /** - * The public key of the sender, if signed. Otherwise, ``null``. - */ - get fromPublicKey(): null | string; - /** - * Returns true if signed. - * - * This provides a Type Guard that properties requiring a signed - * transaction are non-null. - */ - isSigned(): this is (Transaction & { - type: number; - typeName: string; - from: string; - signature: Signature; - }); - /** - * The serialized transaction. - * - * This throws if the transaction is unsigned. For the pre-image, - * use [[unsignedSerialized]]. - */ - get serialized(): string; - /** - * The transaction pre-image. - * - * The hash of this is the digest which needs to be signed to - * authorize this transaction. - */ - get unsignedSerialized(): string; - /** - * Return the most "likely" type; currently the highest - * supported transaction type. - */ - inferType(): number; - /** - * Validates the explicit properties and returns a list of compatible - * transaction types. - */ - inferTypes(): Array; - /** - * Returns true if this transaction is a legacy transaction (i.e. - * ``type === 0``). - * - * This provides a Type Guard that the related properties are - * non-null. - */ - isLegacy(): this is (Transaction & { - type: 0; - gasPrice: bigint; - }); - /** - * Returns true if this transaction is berlin hardform transaction (i.e. - * ``type === 1``). - * - * This provides a Type Guard that the related properties are - * non-null. - */ - isBerlin(): this is (Transaction & { - type: 1; - gasPrice: bigint; - accessList: AccessList; - }); - /** - * Returns true if this transaction is london hardform transaction (i.e. - * ``type === 2``). - * - * This provides a Type Guard that the related properties are - * non-null. - */ - isLondon(): this is (Transaction & { - type: 2; - accessList: AccessList; - maxFeePerGas: bigint; - maxPriorityFeePerGas: bigint; - }); - /** - * Returns true if this transaction is an [[link-eip-4844]] BLOB - * transaction. - * - * This provides a Type Guard that the related properties are - * non-null. - */ - isCancun(): this is (Transaction & { - type: 3; - to: string; - accessList: AccessList; - maxFeePerGas: bigint; - maxPriorityFeePerGas: bigint; - maxFeePerBlobGas: bigint; - blobVersionedHashes: Array; - }); - /** - * Create a copy of this transaciton. - */ - clone(): Transaction; - /** - * Return a JSON-friendly object. - */ - toJSON(): any; - [inspect](): string; - toString(): string; - /** - * Create a **Transaction** from a serialized transaction or a - * Transaction-like object. - */ - static from(tx?: string | TransactionLike): Transaction; -} -export {}; -//# sourceMappingURL=transaction.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/transaction.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/transaction.d.ts.map deleted file mode 100644 index 733e2e1e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/transaction.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/transaction.ts"],"names":[],"mappings":"AAGA,OAAO,EACgB,SAAS,EAC/B,MAAM,oBAAoB,CAAC;AAU5B,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,KAAK,EACR,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAC9D,MAAM,YAAY,CAAC;AASpB,QAAA,MAAM,OAAO,eAA2C,CAAC;AAMzD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAYnF;AAKD;;;;GAIG;AACH,MAAM,WAAW,eAAe,CAAC,CAAC,GAAG,MAAM;IACvC;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAErB;;OAEG;IACH,EAAE,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC;IAEd;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,EAAE,IAAI,GAAG,YAAY,CAAC;IAE/B;;OAEG;IACH,QAAQ,CA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KAAK,CAAC,MAAM,CAAC;IAuD3B;;;;;;OAMG;IACH,QAAQ,IAAI,IAAI,IAAI,CAAC,WAAW,GAAG;QAAE,IAAI,EAAE,CAAC,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAIjE;;;;;;OAMG;IACH,QAAQ,IAAI,IAAI,IAAI,CAAC,WAAW,GAAG;QAAE,IAAI,EAAE,CAAC,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,UAAU,CAAA;KAAE,CAAC;IAIzF;;;;;;OAMG;IACH,QAAQ,IAAI,IAAI,IAAI,CAAC,WAAW,GAAG;QAAE,IAAI,EAAE,CAAC,CAAC;QAAC,UAAU,EAAE,UAAU,CAAC;QAAC,YAAY,EAAE,MAAM,CAAC;QAAC,oBAAoB,EAAE,MAAM,CAAA;KAAE,CAAC;IAI3H;;;;;;OAMG;IACH,QAAQ,IAAI,IAAI,IAAI,CAAC,WAAW,GAAG;QAAE,IAAI,EAAE,CAAC,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,UAAU,CAAC;QAAC,YAAY,EAAE,MAAM,CAAC;QAAC,oBAAoB,EAAE,MAAM,CAAC;QAAC,gBAAgB,EAAE,MAAM,CAAC;QAAC,mBAAmB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;KAAE,CAAC;IAIrM;;OAEG;IACH,KAAK,IAAI,WAAW;IAIpB;;OAEG;IACH,MAAM,IAAI,GAAG;IAuBb,CAAC,OAAO,CAAC,IAAI,MAAM;IAInB,QAAQ,IAAI,MAAM;IA2ClB;;;OAGG;IACH,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,GAAG,WAAW;CA0DlE"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/transaction.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/transaction.js deleted file mode 100644 index 9e761386..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/transaction.js +++ /dev/null @@ -1,1288 +0,0 @@ -import { getAddress } from "../address/index.js"; -import { ZeroAddress } from "../constants/addresses.js"; -import { keccak256, sha256, Signature, SigningKey } from "../crypto/index.js"; -import { concat, decodeRlp, encodeRlp, getBytes, getBigInt, getNumber, hexlify, assert, assertArgument, isBytesLike, isHexString, toBeArray, zeroPadValue } from "../utils/index.js"; -import { accessListify } from "./accesslist.js"; -import { authorizationify } from "./authorization.js"; -import { recoverAddress } from "./address.js"; -const BN_0 = BigInt(0); -const BN_2 = BigInt(2); -const BN_27 = BigInt(27); -const BN_28 = BigInt(28); -const BN_35 = BigInt(35); -const BN_MAX_UINT = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); -const inspect = Symbol.for("nodejs.util.inspect.custom"); -const BLOB_SIZE = 4096 * 32; -const CELL_COUNT = 128; -/** - * Returns a BLOb proof as its cells for [[link-eip-7594]] BLOb. - * - * The default %%cellCount%% is 128. - */ -export function splitBlobCells(_proof, cellCount) { - if (cellCount == null) { - cellCount = CELL_COUNT; - } - const cellProofs = []; - const proof = getBytes(_proof); - const cellSize = proof.length / cellCount; - for (let i = 0; i < proof.length; i += cellSize) { - cellProofs.push(hexlify(proof.subarray(i, i + cellSize))); - } - return cellProofs; -} -function getKzgLibrary(kzg) { - const blobToKzgCommitment = (blob) => { - if ("computeBlobProof" in kzg) { - // micro-ecc-signer; check for computeBlobProof since this API - // expects a string while the kzg-wasm below expects a Unit8Array - if ("blobToKzgCommitment" in kzg && typeof (kzg.blobToKzgCommitment) === "function") { - return getBytes(kzg.blobToKzgCommitment(hexlify(blob))); - } - } - else if ("blobToKzgCommitment" in kzg && typeof (kzg.blobToKzgCommitment) === "function") { - // kzg-wasm <0.5.0; blobToKzgCommitment(Uint8Array) => Uint8Array - return getBytes(kzg.blobToKzgCommitment(blob)); - } - // kzg-wasm >= 0.5.0; blobToKZGCommitment(string) => string - if ("blobToKZGCommitment" in kzg && typeof (kzg.blobToKZGCommitment) === "function") { - return getBytes(kzg.blobToKZGCommitment(hexlify(blob))); - } - assertArgument(false, "unsupported KZG library", "kzg", kzg); - }; - const computeBlobKzgProof = (blob, commitment) => { - // micro-ecc-signer - if ("computeBlobProof" in kzg && typeof (kzg.computeBlobProof) === "function") { - return getBytes(kzg.computeBlobProof(hexlify(blob), hexlify(commitment))); - } - // kzg-wasm <0.5.0; computeBlobKzgProof(Uint8Array, Uint8Array) => Uint8Array - if ("computeBlobKzgProof" in kzg && typeof (kzg.computeBlobKzgProof) === "function") { - return kzg.computeBlobKzgProof(blob, commitment); - } - // kzg-wasm >= 0.5.0; computeBlobKZGProof(string, string) => string - if ("computeBlobKZGProof" in kzg && typeof (kzg.computeBlobKZGProof) === "function") { - return getBytes(kzg.computeBlobKZGProof(hexlify(blob), hexlify(commitment))); - } - assertArgument(false, "unsupported KZG library", "kzg", kzg); - }; - return { blobToKzgCommitment, computeBlobKzgProof }; -} -function getVersionedHash(version, hash) { - let versioned = version.toString(16); - while (versioned.length < 2) { - versioned = "0" + versioned; - } - versioned += sha256(hash).substring(4); - return "0x" + versioned; -} -function handleAddress(value) { - if (value === "0x") { - return null; - } - return getAddress(value); -} -function handleAccessList(value, param) { - try { - return accessListify(value); - } - catch (error) { - assertArgument(false, error.message, param, value); - } -} -function handleAuthorizationList(value, param) { - try { - if (!Array.isArray(value)) { - throw new Error("authorizationList: invalid array"); - } - const result = []; - for (let i = 0; i < value.length; i++) { - const auth = value[i]; - if (!Array.isArray(auth)) { - throw new Error(`authorization[${i}]: invalid array`); - } - if (auth.length !== 6) { - throw new Error(`authorization[${i}]: wrong length`); - } - if (!auth[1]) { - throw new Error(`authorization[${i}]: null address`); - } - result.push({ - address: handleAddress(auth[1]), - nonce: handleUint(auth[2], "nonce"), - chainId: handleUint(auth[0], "chainId"), - signature: Signature.from({ - yParity: handleNumber(auth[3], "yParity"), - r: zeroPadValue(auth[4], 32), - s: zeroPadValue(auth[5], 32) - }) - }); - } - return result; - } - catch (error) { - assertArgument(false, error.message, param, value); - } -} -function handleNumber(_value, param) { - if (_value === "0x") { - return 0; - } - return getNumber(_value, param); -} -function handleUint(_value, param) { - if (_value === "0x") { - return BN_0; - } - const value = getBigInt(_value, param); - assertArgument(value <= BN_MAX_UINT, "value exceeds uint size", param, value); - return value; -} -function formatNumber(_value, name) { - const value = getBigInt(_value, "value"); - const result = toBeArray(value); - assertArgument(result.length <= 32, `value too large`, `tx.${name}`, value); - return result; -} -function formatAccessList(value) { - return accessListify(value).map((set) => [set.address, set.storageKeys]); -} -function formatAuthorizationList(value) { - return value.map((a) => { - return [ - formatNumber(a.chainId, "chainId"), - a.address, - formatNumber(a.nonce, "nonce"), - formatNumber(a.signature.yParity, "yParity"), - toBeArray(a.signature.r), - toBeArray(a.signature._s) - ]; - }); -} -function formatHashes(value, param) { - assertArgument(Array.isArray(value), `invalid ${param}`, "value", value); - for (let i = 0; i < value.length; i++) { - assertArgument(isHexString(value[i], 32), "invalid ${ param } hash", `value[${i}]`, value[i]); - } - return value; -} -function _parseLegacy(data) { - const fields = decodeRlp(data); - assertArgument(Array.isArray(fields) && (fields.length === 9 || fields.length === 6), "invalid field count for legacy transaction", "data", data); - const tx = { - type: 0, - nonce: handleNumber(fields[0], "nonce"), - gasPrice: handleUint(fields[1], "gasPrice"), - gasLimit: handleUint(fields[2], "gasLimit"), - to: handleAddress(fields[3]), - value: handleUint(fields[4], "value"), - data: hexlify(fields[5]), - chainId: BN_0 - }; - // Legacy unsigned transaction - if (fields.length === 6) { - return tx; - } - const v = handleUint(fields[6], "v"); - const r = handleUint(fields[7], "r"); - const s = handleUint(fields[8], "s"); - if (r === BN_0 && s === BN_0) { - // EIP-155 unsigned transaction - tx.chainId = v; - } - else { - // Compute the EIP-155 chain ID (or 0 for legacy) - let chainId = (v - BN_35) / BN_2; - if (chainId < BN_0) { - chainId = BN_0; - } - tx.chainId = chainId; - // Signed Legacy Transaction - assertArgument(chainId !== BN_0 || (v === BN_27 || v === BN_28), "non-canonical legacy v", "v", fields[6]); - tx.signature = Signature.from({ - r: zeroPadValue(fields[7], 32), - s: zeroPadValue(fields[8], 32), - v - }); - //tx.hash = keccak256(data); - } - return tx; -} -function _serializeLegacy(tx, sig) { - const fields = [ - formatNumber(tx.nonce, "nonce"), - formatNumber(tx.gasPrice || 0, "gasPrice"), - formatNumber(tx.gasLimit, "gasLimit"), - (tx.to || "0x"), - formatNumber(tx.value, "value"), - tx.data, - ]; - let chainId = BN_0; - if (tx.chainId != BN_0) { - // A chainId was provided; if non-zero we'll use EIP-155 - chainId = getBigInt(tx.chainId, "tx.chainId"); - // We have a chainId in the tx and an EIP-155 v in the signature, - // make sure they agree with each other - assertArgument(!sig || sig.networkV == null || sig.legacyChainId === chainId, "tx.chainId/sig.v mismatch", "sig", sig); - } - else if (tx.signature) { - // No explicit chainId, but EIP-155 have a derived implicit chainId - const legacy = tx.signature.legacyChainId; - if (legacy != null) { - chainId = legacy; - } - } - // Requesting an unsigned transaction - if (!sig) { - // We have an EIP-155 transaction (chainId was specified and non-zero) - if (chainId !== BN_0) { - fields.push(toBeArray(chainId)); - fields.push("0x"); - fields.push("0x"); - } - return encodeRlp(fields); - } - // @TODO: We should probably check that tx.signature, chainId, and sig - // match but that logic could break existing code, so schedule - // this for the next major bump. - // Compute the EIP-155 v - let v = BigInt(27 + sig.yParity); - if (chainId !== BN_0) { - v = Signature.getChainIdV(chainId, sig.v); - } - else if (BigInt(sig.v) !== v) { - assertArgument(false, "tx.chainId/sig.v mismatch", "sig", sig); - } - // Add the signature - fields.push(toBeArray(v)); - fields.push(toBeArray(sig.r)); - fields.push(toBeArray(sig._s)); - return encodeRlp(fields); -} -function _parseEipSignature(tx, fields) { - let yParity; - try { - yParity = handleNumber(fields[0], "yParity"); - if (yParity !== 0 && yParity !== 1) { - throw new Error("bad yParity"); - } - } - catch (error) { - assertArgument(false, "invalid yParity", "yParity", fields[0]); - } - const r = zeroPadValue(fields[1], 32); - const s = zeroPadValue(fields[2], 32); - const signature = Signature.from({ r, s, yParity }); - tx.signature = signature; -} -function _parseEip1559(data) { - const fields = decodeRlp(getBytes(data).slice(1)); - assertArgument(Array.isArray(fields) && (fields.length === 9 || fields.length === 12), "invalid field count for transaction type: 2", "data", hexlify(data)); - const tx = { - type: 2, - chainId: handleUint(fields[0], "chainId"), - nonce: handleNumber(fields[1], "nonce"), - maxPriorityFeePerGas: handleUint(fields[2], "maxPriorityFeePerGas"), - maxFeePerGas: handleUint(fields[3], "maxFeePerGas"), - gasPrice: null, - gasLimit: handleUint(fields[4], "gasLimit"), - to: handleAddress(fields[5]), - value: handleUint(fields[6], "value"), - data: hexlify(fields[7]), - accessList: handleAccessList(fields[8], "accessList"), - }; - // Unsigned EIP-1559 Transaction - if (fields.length === 9) { - return tx; - } - //tx.hash = keccak256(data); - _parseEipSignature(tx, fields.slice(9)); - return tx; -} -function _serializeEip1559(tx, sig) { - const fields = [ - formatNumber(tx.chainId, "chainId"), - formatNumber(tx.nonce, "nonce"), - formatNumber(tx.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"), - formatNumber(tx.maxFeePerGas || 0, "maxFeePerGas"), - formatNumber(tx.gasLimit, "gasLimit"), - (tx.to || "0x"), - formatNumber(tx.value, "value"), - tx.data, - formatAccessList(tx.accessList || []) - ]; - if (sig) { - fields.push(formatNumber(sig.yParity, "yParity")); - fields.push(toBeArray(sig.r)); - fields.push(toBeArray(sig.s)); - } - return concat(["0x02", encodeRlp(fields)]); -} -function _parseEip2930(data) { - const fields = decodeRlp(getBytes(data).slice(1)); - assertArgument(Array.isArray(fields) && (fields.length === 8 || fields.length === 11), "invalid field count for transaction type: 1", "data", hexlify(data)); - const tx = { - type: 1, - chainId: handleUint(fields[0], "chainId"), - nonce: handleNumber(fields[1], "nonce"), - gasPrice: handleUint(fields[2], "gasPrice"), - gasLimit: handleUint(fields[3], "gasLimit"), - to: handleAddress(fields[4]), - value: handleUint(fields[5], "value"), - data: hexlify(fields[6]), - accessList: handleAccessList(fields[7], "accessList") - }; - // Unsigned EIP-2930 Transaction - if (fields.length === 8) { - return tx; - } - //tx.hash = keccak256(data); - _parseEipSignature(tx, fields.slice(8)); - return tx; -} -function _serializeEip2930(tx, sig) { - const fields = [ - formatNumber(tx.chainId, "chainId"), - formatNumber(tx.nonce, "nonce"), - formatNumber(tx.gasPrice || 0, "gasPrice"), - formatNumber(tx.gasLimit, "gasLimit"), - (tx.to || "0x"), - formatNumber(tx.value, "value"), - tx.data, - formatAccessList(tx.accessList || []) - ]; - if (sig) { - fields.push(formatNumber(sig.yParity, "recoveryParam")); - fields.push(toBeArray(sig.r)); - fields.push(toBeArray(sig.s)); - } - return concat(["0x01", encodeRlp(fields)]); -} -function _parseEip4844(data) { - let fields = decodeRlp(getBytes(data).slice(1)); - let typeName = "3"; - let blobWrapperVersion = null; - let blobs = null; - // Parse the network format - if (fields.length === 4 && Array.isArray(fields[0])) { - // EIP-4844 format with sidecar - typeName = "3 (network format)"; - const fBlobs = fields[1], fCommits = fields[2], fProofs = fields[3]; - assertArgument(Array.isArray(fBlobs), "invalid network format: blobs not an array", "fields[1]", fBlobs); - assertArgument(Array.isArray(fCommits), "invalid network format: commitments not an array", "fields[2]", fCommits); - assertArgument(Array.isArray(fProofs), "invalid network format: proofs not an array", "fields[3]", fProofs); - assertArgument(fBlobs.length === fCommits.length, "invalid network format: blobs/commitments length mismatch", "fields", fields); - assertArgument(fBlobs.length === fProofs.length, "invalid network format: blobs/proofs length mismatch", "fields", fields); - blobs = []; - for (let i = 0; i < fields[1].length; i++) { - blobs.push({ - data: fBlobs[i], - commitment: fCommits[i], - proof: fProofs[i], - }); - } - fields = fields[0]; - } - else if (fields.length === 5 && Array.isArray(fields[0])) { - // EIP-7594 format with sidecar - typeName = "3 (EIP-7594 network format)"; - blobWrapperVersion = getNumber(fields[1]); - const fBlobs = fields[2], fCommits = fields[3], fProofs = fields[4]; - assertArgument(blobWrapperVersion === 1, `unsupported EIP-7594 network format version: ${blobWrapperVersion}`, "fields[1]", blobWrapperVersion); - assertArgument(Array.isArray(fBlobs), "invalid EIP-7594 network format: blobs not an array", "fields[2]", fBlobs); - assertArgument(Array.isArray(fCommits), "invalid EIP-7594 network format: commitments not an array", "fields[3]", fCommits); - assertArgument(Array.isArray(fProofs), "invalid EIP-7594 network format: proofs not an array", "fields[4]", fProofs); - assertArgument(fBlobs.length === fCommits.length, "invalid network format: blobs/commitments length mismatch", "fields", fields); - assertArgument(fBlobs.length * CELL_COUNT === fProofs.length, "invalid network format: blobs/proofs length mismatch", "fields", fields); - blobs = []; - for (let i = 0; i < fBlobs.length; i++) { - const proof = []; - for (let j = 0; j < CELL_COUNT; j++) { - proof.push(fProofs[(i * CELL_COUNT) + j]); - } - blobs.push({ - data: fBlobs[i], - commitment: fCommits[i], - proof: concat(proof) - }); - } - fields = fields[0]; - } - assertArgument(Array.isArray(fields) && (fields.length === 11 || fields.length === 14), `invalid field count for transaction type: ${typeName}`, "data", hexlify(data)); - const tx = { - type: 3, - chainId: handleUint(fields[0], "chainId"), - nonce: handleNumber(fields[1], "nonce"), - maxPriorityFeePerGas: handleUint(fields[2], "maxPriorityFeePerGas"), - maxFeePerGas: handleUint(fields[3], "maxFeePerGas"), - gasPrice: null, - gasLimit: handleUint(fields[4], "gasLimit"), - to: handleAddress(fields[5]), - value: handleUint(fields[6], "value"), - data: hexlify(fields[7]), - accessList: handleAccessList(fields[8], "accessList"), - maxFeePerBlobGas: handleUint(fields[9], "maxFeePerBlobGas"), - blobVersionedHashes: fields[10], - blobWrapperVersion - }; - if (blobs) { - tx.blobs = blobs; - } - assertArgument(tx.to != null, `invalid address for transaction type: ${typeName}`, "data", data); - assertArgument(Array.isArray(tx.blobVersionedHashes), "invalid blobVersionedHashes: must be an array", "data", data); - for (let i = 0; i < tx.blobVersionedHashes.length; i++) { - assertArgument(isHexString(tx.blobVersionedHashes[i], 32), `invalid blobVersionedHash at index ${i}: must be length 32`, "data", data); - } - // Unsigned EIP-4844 Transaction - if (fields.length === 11) { - return tx; - } - // @TODO: Do we need to do this? This is only called internally - // and used to verify hashes; it might save time to not do this - //tx.hash = keccak256(concat([ "0x03", encodeRlp(fields) ])); - _parseEipSignature(tx, fields.slice(11)); - return tx; -} -function _serializeEip4844(tx, sig, blobs) { - const fields = [ - formatNumber(tx.chainId, "chainId"), - formatNumber(tx.nonce, "nonce"), - formatNumber(tx.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"), - formatNumber(tx.maxFeePerGas || 0, "maxFeePerGas"), - formatNumber(tx.gasLimit, "gasLimit"), - (tx.to || ZeroAddress), - formatNumber(tx.value, "value"), - tx.data, - formatAccessList(tx.accessList || []), - formatNumber(tx.maxFeePerBlobGas || 0, "maxFeePerBlobGas"), - formatHashes(tx.blobVersionedHashes || [], "blobVersionedHashes") - ]; - if (sig) { - fields.push(formatNumber(sig.yParity, "yParity")); - fields.push(toBeArray(sig.r)); - fields.push(toBeArray(sig.s)); - // We have blobs; return the network wrapped format - if (blobs) { - // Use EIP-7594 - if (tx.blobWrapperVersion != null) { - const wrapperVersion = toBeArray(tx.blobWrapperVersion); - const cellProofs = []; - for (const { proof } of blobs) { - const p = getBytes(proof); - const cellSize = p.length / CELL_COUNT; - for (let i = 0; i < p.length; i += cellSize) { - cellProofs.push(p.subarray(i, i + cellSize)); - } - } - return concat([ - "0x03", - encodeRlp([ - fields, - wrapperVersion, - blobs.map((b) => b.data), - blobs.map((b) => b.commitment), - cellProofs - ]) - ]); - } - // Fall back onto classic EIP-4844 behavior - return concat([ - "0x03", - encodeRlp([ - fields, - blobs.map((b) => b.data), - blobs.map((b) => b.commitment), - blobs.map((b) => b.proof), - ]) - ]); - } - } - return concat(["0x03", encodeRlp(fields)]); -} -function _parseEip7702(data) { - const fields = decodeRlp(getBytes(data).slice(1)); - assertArgument(Array.isArray(fields) && (fields.length === 10 || fields.length === 13), "invalid field count for transaction type: 4", "data", hexlify(data)); - const tx = { - type: 4, - chainId: handleUint(fields[0], "chainId"), - nonce: handleNumber(fields[1], "nonce"), - maxPriorityFeePerGas: handleUint(fields[2], "maxPriorityFeePerGas"), - maxFeePerGas: handleUint(fields[3], "maxFeePerGas"), - gasPrice: null, - gasLimit: handleUint(fields[4], "gasLimit"), - to: handleAddress(fields[5]), - value: handleUint(fields[6], "value"), - data: hexlify(fields[7]), - accessList: handleAccessList(fields[8], "accessList"), - authorizationList: handleAuthorizationList(fields[9], "authorizationList"), - }; - // Unsigned EIP-7702 Transaction - if (fields.length === 10) { - return tx; - } - _parseEipSignature(tx, fields.slice(10)); - return tx; -} -function _serializeEip7702(tx, sig) { - const fields = [ - formatNumber(tx.chainId, "chainId"), - formatNumber(tx.nonce, "nonce"), - formatNumber(tx.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"), - formatNumber(tx.maxFeePerGas || 0, "maxFeePerGas"), - formatNumber(tx.gasLimit, "gasLimit"), - (tx.to || "0x"), - formatNumber(tx.value, "value"), - tx.data, - formatAccessList(tx.accessList || []), - formatAuthorizationList(tx.authorizationList || []) - ]; - if (sig) { - fields.push(formatNumber(sig.yParity, "yParity")); - fields.push(toBeArray(sig.r)); - fields.push(toBeArray(sig.s)); - } - return concat(["0x04", encodeRlp(fields)]); -} -/** - * A **Transaction** describes an operation to be executed on - * Ethereum by an Externally Owned Account (EOA). It includes - * who (the [[to]] address), what (the [[data]]) and how much (the - * [[value]] in ether) the operation should entail. - * - * @example: - * tx = new Transaction() - * //_result: - * - * tx.data = "0x1234"; - * //_result: - */ -export class Transaction { - #type; - #to; - #data; - #nonce; - #gasLimit; - #gasPrice; - #maxPriorityFeePerGas; - #maxFeePerGas; - #value; - #chainId; - #sig; - #accessList; - #maxFeePerBlobGas; - #blobVersionedHashes; - #kzg; - #blobs; - #auths; - #blobWrapperVersion; - /** - * The transaction type. - * - * If null, the type will be automatically inferred based on - * explicit properties. - */ - get type() { return this.#type; } - set type(value) { - switch (value) { - case null: - this.#type = null; - break; - case 0: - case "legacy": - this.#type = 0; - break; - case 1: - case "berlin": - case "eip-2930": - this.#type = 1; - break; - case 2: - case "london": - case "eip-1559": - this.#type = 2; - break; - case 3: - case "cancun": - case "eip-4844": - this.#type = 3; - break; - case 4: - case "pectra": - case "eip-7702": - this.#type = 4; - break; - default: - assertArgument(false, "unsupported transaction type", "type", value); - } - } - /** - * The name of the transaction type. - */ - get typeName() { - switch (this.type) { - case 0: return "legacy"; - case 1: return "eip-2930"; - case 2: return "eip-1559"; - case 3: return "eip-4844"; - case 4: return "eip-7702"; - } - return null; - } - /** - * The ``to`` address for the transaction or ``null`` if the - * transaction is an ``init`` transaction. - */ - get to() { - const value = this.#to; - if (value == null && this.type === 3) { - return ZeroAddress; - } - return value; - } - set to(value) { - this.#to = (value == null) ? null : getAddress(value); - } - /** - * The transaction nonce. - */ - get nonce() { return this.#nonce; } - set nonce(value) { this.#nonce = getNumber(value, "value"); } - /** - * The gas limit. - */ - get gasLimit() { return this.#gasLimit; } - set gasLimit(value) { this.#gasLimit = getBigInt(value); } - /** - * The gas price. - * - * On legacy networks this defines the fee that will be paid. On - * EIP-1559 networks, this should be ``null``. - */ - get gasPrice() { - const value = this.#gasPrice; - if (value == null && (this.type === 0 || this.type === 1)) { - return BN_0; - } - return value; - } - set gasPrice(value) { - this.#gasPrice = (value == null) ? null : getBigInt(value, "gasPrice"); - } - /** - * The maximum priority fee per unit of gas to pay. On legacy - * networks this should be ``null``. - */ - get maxPriorityFeePerGas() { - const value = this.#maxPriorityFeePerGas; - if (value == null) { - if (this.type === 2 || this.type === 3) { - return BN_0; - } - return null; - } - return value; - } - set maxPriorityFeePerGas(value) { - this.#maxPriorityFeePerGas = (value == null) ? null : getBigInt(value, "maxPriorityFeePerGas"); - } - /** - * The maximum total fee per unit of gas to pay. On legacy - * networks this should be ``null``. - */ - get maxFeePerGas() { - const value = this.#maxFeePerGas; - if (value == null) { - if (this.type === 2 || this.type === 3) { - return BN_0; - } - return null; - } - return value; - } - set maxFeePerGas(value) { - this.#maxFeePerGas = (value == null) ? null : getBigInt(value, "maxFeePerGas"); - } - /** - * The transaction data. For ``init`` transactions this is the - * deployment code. - */ - get data() { return this.#data; } - set data(value) { this.#data = hexlify(value); } - /** - * The amount of ether (in wei) to send in this transactions. - */ - get value() { return this.#value; } - set value(value) { - this.#value = getBigInt(value, "value"); - } - /** - * The chain ID this transaction is valid on. - */ - get chainId() { return this.#chainId; } - set chainId(value) { this.#chainId = getBigInt(value); } - /** - * If signed, the signature for this transaction. - */ - get signature() { return this.#sig || null; } - set signature(value) { - this.#sig = (value == null) ? null : Signature.from(value); - } - isValid() { - const sig = this.signature; - if (sig && !sig.isValid()) { - return false; - } - const auths = this.authorizationList; - if (auths) { - for (const auth of auths) { - if (!auth.signature.isValid()) { - return false; - } - } - } - return true; - } - /** - * The access list. - * - * An access list permits discounted (but pre-paid) access to - * bytecode and state variable access within contract execution. - */ - get accessList() { - const value = this.#accessList || null; - if (value == null) { - if (this.type === 1 || this.type === 2 || this.type === 3) { - // @TODO: in v7, this should assign the value or become - // a live object itself, otherwise mutation is inconsistent - return []; - } - return null; - } - return value; - } - set accessList(value) { - this.#accessList = (value == null) ? null : accessListify(value); - } - get authorizationList() { - const value = this.#auths || null; - if (value == null) { - if (this.type === 4) { - // @TODO: in v7, this should become a live object itself, - // otherwise mutation is inconsistent - return []; - } - } - return value; - } - set authorizationList(auths) { - this.#auths = (auths == null) ? null : auths.map((a) => authorizationify(a)); - } - /** - * The max fee per blob gas for Cancun transactions. - */ - get maxFeePerBlobGas() { - const value = this.#maxFeePerBlobGas; - if (value == null && this.type === 3) { - return BN_0; - } - return value; - } - set maxFeePerBlobGas(value) { - this.#maxFeePerBlobGas = (value == null) ? null : getBigInt(value, "maxFeePerBlobGas"); - } - /** - * The BLOb versioned hashes for Cancun transactions. - */ - get blobVersionedHashes() { - // @TODO: Mutation is inconsistent; if unset, the returned value - // cannot mutate the object, if set it can - let value = this.#blobVersionedHashes; - if (value == null && this.type === 3) { - return []; - } - return value; - } - set blobVersionedHashes(value) { - if (value != null) { - assertArgument(Array.isArray(value), "blobVersionedHashes must be an Array", "value", value); - value = value.slice(); - for (let i = 0; i < value.length; i++) { - assertArgument(isHexString(value[i], 32), "invalid blobVersionedHash", `value[${i}]`, value[i]); - } - } - this.#blobVersionedHashes = value; - } - /** - * The BLObs for the Transaction, if any. - * - * If ``blobs`` is non-``null``, then the [[seriailized]] - * will return the network formatted sidecar, otherwise it - * will return the standard [[link-eip-2718]] payload. The - * [[unsignedSerialized]] is unaffected regardless. - * - * When setting ``blobs``, either fully valid [[Blob]] objects - * may be specified (i.e. correctly padded, with correct - * committments and proofs) or a raw [[BytesLike]] may - * be provided. - * - * If raw [[BytesLike]] are provided, the [[kzg]] property **must** - * be already set. The blob will be correctly padded and the - * [[KzgLibrary]] will be used to compute the committment and - * proof for the blob. - * - * A BLOb is a sequence of field elements, each of which must - * be within the BLS field modulo, so some additional processing - * may be required to encode arbitrary data to ensure each 32 byte - * field is within the valid range. - * - * Setting this automatically populates [[blobVersionedHashes]], - * overwriting any existing values. Setting this to ``null`` - * does **not** remove the [[blobVersionedHashes]], leaving them - * present. - */ - get blobs() { - if (this.#blobs == null) { - return null; - } - return this.#blobs.map((b) => Object.assign({}, b)); - } - set blobs(_blobs) { - if (_blobs == null) { - this.#blobs = null; - return; - } - const blobs = []; - const versionedHashes = []; - for (let i = 0; i < _blobs.length; i++) { - const blob = _blobs[i]; - if (isBytesLike(blob)) { - assert(this.#kzg, "adding a raw blob requires a KZG library", "UNSUPPORTED_OPERATION", { - operation: "set blobs()" - }); - let data = getBytes(blob); - assertArgument(data.length <= BLOB_SIZE, "blob is too large", `blobs[${i}]`, blob); - // Pad blob if necessary - if (data.length !== BLOB_SIZE) { - const padded = new Uint8Array(BLOB_SIZE); - padded.set(data); - data = padded; - } - const commit = this.#kzg.blobToKzgCommitment(data); - const proof = hexlify(this.#kzg.computeBlobKzgProof(data, commit)); - blobs.push({ - data: hexlify(data), - commitment: hexlify(commit), - proof - }); - versionedHashes.push(getVersionedHash(1, commit)); - } - else { - const data = hexlify(blob.data); - const commitment = hexlify(blob.commitment); - const proof = hexlify(blob.proof); - blobs.push({ data, commitment, proof }); - versionedHashes.push(getVersionedHash(1, commitment)); - } - } - this.#blobs = blobs; - this.#blobVersionedHashes = versionedHashes; - } - get kzg() { return this.#kzg; } - set kzg(kzg) { - if (kzg == null) { - this.#kzg = null; - } - else { - this.#kzg = getKzgLibrary(kzg); - } - } - get blobWrapperVersion() { - return this.#blobWrapperVersion; - } - set blobWrapperVersion(value) { - this.#blobWrapperVersion = value; - } - /** - * Creates a new Transaction with default values. - */ - constructor() { - this.#type = null; - this.#to = null; - this.#nonce = 0; - this.#gasLimit = BN_0; - this.#gasPrice = null; - this.#maxPriorityFeePerGas = null; - this.#maxFeePerGas = null; - this.#data = "0x"; - this.#value = BN_0; - this.#chainId = BN_0; - this.#sig = null; - this.#accessList = null; - this.#maxFeePerBlobGas = null; - this.#blobVersionedHashes = null; - this.#kzg = null; - this.#blobs = null; - this.#auths = null; - this.#blobWrapperVersion = null; - } - /** - * The transaction hash, if signed. Otherwise, ``null``. - */ - get hash() { - if (this.signature == null) { - return null; - } - return keccak256(this.#getSerialized(true, false)); - } - /** - * The pre-image hash of this transaction. - * - * This is the digest that a [[Signer]] must sign to authorize - * this transaction. - */ - get unsignedHash() { - return keccak256(this.unsignedSerialized); - } - /** - * The sending address, if signed. Otherwise, ``null``. - */ - get from() { - if (this.signature == null) { - return null; - } - return recoverAddress(this.unsignedHash, this.signature.getCanonical()); - } - /** - * The public key of the sender, if signed. Otherwise, ``null``. - */ - get fromPublicKey() { - if (this.signature == null) { - return null; - } - return SigningKey.recoverPublicKey(this.unsignedHash, this.signature.getCanonical()); - } - /** - * Returns true if signed. - * - * This provides a Type Guard that properties requiring a signed - * transaction are non-null. - */ - isSigned() { - return this.signature != null; - } - #getSerialized(signed, sidecar) { - assert(!signed || this.signature != null, "cannot serialize unsigned transaction; maybe you meant .unsignedSerialized", "UNSUPPORTED_OPERATION", { operation: ".serialized" }); - const sig = signed ? this.signature : null; - switch (this.inferType()) { - case 0: - return _serializeLegacy(this, sig); - case 1: - return _serializeEip2930(this, sig); - case 2: - return _serializeEip1559(this, sig); - case 3: - return _serializeEip4844(this, sig, sidecar ? this.blobs : null); - case 4: - return _serializeEip7702(this, sig); - } - assert(false, "unsupported transaction type", "UNSUPPORTED_OPERATION", { operation: ".serialized" }); - } - /** - * The serialized transaction. - * - * This throws if the transaction is unsigned. For the pre-image, - * use [[unsignedSerialized]]. - */ - get serialized() { - return this.#getSerialized(true, true); - } - /** - * The transaction pre-image. - * - * The hash of this is the digest which needs to be signed to - * authorize this transaction. - */ - get unsignedSerialized() { - return this.#getSerialized(false, false); - } - /** - * Return the most "likely" type; currently the highest - * supported transaction type. - */ - inferType() { - const types = this.inferTypes(); - // Prefer London (EIP-1559) over Cancun (BLOb) - if (types.indexOf(2) >= 0) { - return 2; - } - // Return the highest inferred type - return (types.pop()); - } - /** - * Validates the explicit properties and returns a list of compatible - * transaction types. - */ - inferTypes() { - // Checks that there are no conflicting properties set - const hasGasPrice = this.gasPrice != null; - const hasFee = (this.maxFeePerGas != null || this.maxPriorityFeePerGas != null); - const hasAccessList = (this.accessList != null); - const hasBlob = (this.#maxFeePerBlobGas != null || this.#blobVersionedHashes); - //if (hasGasPrice && hasFee) { - // throw new Error("transaction cannot have gasPrice and maxFeePerGas"); - //} - if (this.maxFeePerGas != null && this.maxPriorityFeePerGas != null) { - assert(this.maxFeePerGas >= this.maxPriorityFeePerGas, "priorityFee cannot be more than maxFee", "BAD_DATA", { value: this }); - } - //if (this.type === 2 && hasGasPrice) { - // throw new Error("eip-1559 transaction cannot have gasPrice"); - //} - assert(!hasFee || (this.type !== 0 && this.type !== 1), "transaction type cannot have maxFeePerGas or maxPriorityFeePerGas", "BAD_DATA", { value: this }); - assert(this.type !== 0 || !hasAccessList, "legacy transaction cannot have accessList", "BAD_DATA", { value: this }); - const types = []; - // Explicit type - if (this.type != null) { - types.push(this.type); - } - else { - if (this.authorizationList && this.authorizationList.length) { - types.push(4); - } - else if (hasFee) { - types.push(2); - } - else if (hasGasPrice) { - types.push(1); - if (!hasAccessList) { - types.push(0); - } - } - else if (hasAccessList) { - types.push(1); - types.push(2); - } - else if (hasBlob && this.to) { - types.push(3); - } - else { - types.push(0); - types.push(1); - types.push(2); - types.push(3); - } - } - types.sort(); - return types; - } - /** - * Returns true if this transaction is a legacy transaction (i.e. - * ``type === 0``). - * - * This provides a Type Guard that the related properties are - * non-null. - */ - isLegacy() { - return (this.type === 0); - } - /** - * Returns true if this transaction is berlin hardform transaction (i.e. - * ``type === 1``). - * - * This provides a Type Guard that the related properties are - * non-null. - */ - isBerlin() { - return (this.type === 1); - } - /** - * Returns true if this transaction is london hardform transaction (i.e. - * ``type === 2``). - * - * This provides a Type Guard that the related properties are - * non-null. - */ - isLondon() { - return (this.type === 2); - } - /** - * Returns true if this transaction is an [[link-eip-4844]] BLOB - * transaction. - * - * This provides a Type Guard that the related properties are - * non-null. - */ - isCancun() { - return (this.type === 3); - } - /** - * Create a copy of this transaciton. - */ - clone() { - return Transaction.from(this); - } - /** - * Return a JSON-friendly object. - */ - toJSON() { - const s = (v) => { - if (v == null) { - return null; - } - return v.toString(); - }; - return { - type: this.type, - to: this.to, - // from: this.from, - data: this.data, - nonce: this.nonce, - gasLimit: s(this.gasLimit), - gasPrice: s(this.gasPrice), - maxPriorityFeePerGas: s(this.maxPriorityFeePerGas), - maxFeePerGas: s(this.maxFeePerGas), - value: s(this.value), - chainId: s(this.chainId), - sig: this.signature ? this.signature.toJSON() : null, - accessList: this.accessList - }; - } - [inspect]() { - return this.toString(); - } - toString() { - const output = []; - const add = (key) => { - let value = this[key]; - if (typeof (value) === "string") { - value = JSON.stringify(value); - } - output.push(`${key}: ${value}`); - }; - if (this.type) { - add("type"); - } - add("to"); - add("data"); - add("nonce"); - add("gasLimit"); - add("value"); - if (this.chainId != null) { - add("chainId"); - } - if (this.signature) { - add("from"); - output.push(`signature: ${this.signature.toString()}`); - } - // @TODO: accessList - // @TODO: blobs (might make output huge; maybe just include a flag?) - const auths = this.authorizationList; - if (auths) { - const outputAuths = []; - for (const auth of auths) { - const o = []; - o.push(`address: ${JSON.stringify(auth.address)}`); - if (auth.nonce != null) { - o.push(`nonce: ${auth.nonce}`); - } - if (auth.chainId != null) { - o.push(`chainId: ${auth.chainId}`); - } - if (auth.signature) { - o.push(`signature: ${auth.signature.toString()}`); - } - outputAuths.push(`Authorization { ${o.join(", ")} }`); - } - output.push(`authorizations: [ ${outputAuths.join(", ")} ]`); - } - return `Transaction { ${output.join(", ")} }`; - } - /** - * Create a **Transaction** from a serialized transaction or a - * Transaction-like object. - */ - static from(tx) { - if (tx == null) { - return new Transaction(); - } - if (typeof (tx) === "string") { - const payload = getBytes(tx); - if (payload[0] >= 0x7f) { // @TODO: > vs >= ?? - return Transaction.from(_parseLegacy(payload)); - } - switch (payload[0]) { - case 1: return Transaction.from(_parseEip2930(payload)); - case 2: return Transaction.from(_parseEip1559(payload)); - case 3: return Transaction.from(_parseEip4844(payload)); - case 4: return Transaction.from(_parseEip7702(payload)); - } - assert(false, "unsupported transaction type", "UNSUPPORTED_OPERATION", { operation: "from" }); - } - const result = new Transaction(); - if (tx.type != null) { - result.type = tx.type; - } - if (tx.to != null) { - result.to = tx.to; - } - if (tx.nonce != null) { - result.nonce = tx.nonce; - } - if (tx.gasLimit != null) { - result.gasLimit = tx.gasLimit; - } - if (tx.gasPrice != null) { - result.gasPrice = tx.gasPrice; - } - if (tx.maxPriorityFeePerGas != null) { - result.maxPriorityFeePerGas = tx.maxPriorityFeePerGas; - } - if (tx.maxFeePerGas != null) { - result.maxFeePerGas = tx.maxFeePerGas; - } - if (tx.maxFeePerBlobGas != null) { - result.maxFeePerBlobGas = tx.maxFeePerBlobGas; - } - if (tx.data != null) { - result.data = tx.data; - } - if (tx.value != null) { - result.value = tx.value; - } - if (tx.chainId != null) { - result.chainId = tx.chainId; - } - if (tx.signature != null) { - result.signature = Signature.from(tx.signature); - } - if (tx.accessList != null) { - result.accessList = tx.accessList; - } - if (tx.authorizationList != null) { - result.authorizationList = tx.authorizationList; - } - // This will get overwritten by blobs, if present - if (tx.blobVersionedHashes != null) { - result.blobVersionedHashes = tx.blobVersionedHashes; - } - // Make sure we assign the kzg before assigning blobs, which - // require the library in the event raw blob data is provided. - if (tx.kzg != null) { - result.kzg = tx.kzg; - } - if (tx.blobWrapperVersion != null) { - result.blobWrapperVersion = tx.blobWrapperVersion; - } - if (tx.blobs != null) { - result.blobs = tx.blobs; - } - if (tx.hash != null) { - assertArgument(result.isSigned(), "unsigned transaction cannot define '.hash'", "tx", tx); - assertArgument(result.hash === tx.hash, "hash mismatch", "tx", tx); - } - if (tx.from != null) { - assertArgument(result.isSigned(), "unsigned transaction cannot define '.from'", "tx", tx); - assertArgument(result.from.toLowerCase() === (tx.from || "").toLowerCase(), "from mismatch", "tx", tx); - } - return result; - } -} -//# sourceMappingURL=transaction.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/transaction.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/transaction.js.map deleted file mode 100644 index c6b6f266..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/transaction/transaction.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../src.ts/transaction/transaction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EACH,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAC3C,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACH,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EACrE,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY,EAC5E,M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AG,GAAG,EAAE,CAAC,GAAG,CAAC;SAAE;QAC5C,IAAI,EAAE,CAAC,kBAAkB,IAAI,IAAI,EAAE;YAAE,MAAM,CAAC,kBAAkB,GAAG,EAAE,CAAC,kBAAkB,CAAC;SAAE;QACzF,IAAI,EAAE,CAAC,KAAK,IAAI,IAAI,EAAE;YAAE,MAAM,CAAC,KAAK,GAAG,EAAE,CAAC,KAAK,CAAC;SAAE;QAElD,IAAI,EAAE,CAAC,IAAI,IAAI,IAAI,EAAE;YACjB,cAAc,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,4CAA4C,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;YAC1F,cAAc,CAAC,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;SACtE;QAED,IAAI,EAAE,CAAC,IAAI,IAAI,IAAI,EAAE;YACjB,cAAc,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,4CAA4C,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;YAC1F,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;SAC1G;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base58.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base58.d.ts deleted file mode 100644 index 8b377936..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base58.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * The [Base58 Encoding](link-base58) scheme allows a **numeric** value - * to be encoded as a compact string using a radix of 58 using only - * alpha-numeric characters. Confusingly similar characters are omitted - * (i.e. ``"l0O"``). - * - * Note that Base58 encodes a **numeric** value, not arbitrary bytes, - * since any zero-bytes on the left would get removed. To mitigate this - * issue most schemes that use Base58 choose specific high-order values - * to ensure non-zero prefixes. - * - * @_subsection: api/utils:Base58 Encoding [about-base58] - */ -import type { BytesLike } from "./index.js"; -/** - * Encode %%value%% as a Base58-encoded string. - */ -export declare function encodeBase58(_value: BytesLike): string; -/** - * Decode the Base58-encoded %%value%%. - */ -export declare function decodeBase58(value: string): bigint; -//# sourceMappingURL=base58.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base58.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base58.d.ts.map deleted file mode 100644 index a20c8167..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base58.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base58.d.ts","sourceRoot":"","sources":["../../src.ts/utils/base58.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAsB5C;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAiBtD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOlD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base58.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base58.js deleted file mode 100644 index 6e8f27cb..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base58.js +++ /dev/null @@ -1,63 +0,0 @@ -/** - * The [Base58 Encoding](link-base58) scheme allows a **numeric** value - * to be encoded as a compact string using a radix of 58 using only - * alpha-numeric characters. Confusingly similar characters are omitted - * (i.e. ``"l0O"``). - * - * Note that Base58 encodes a **numeric** value, not arbitrary bytes, - * since any zero-bytes on the left would get removed. To mitigate this - * issue most schemes that use Base58 choose specific high-order values - * to ensure non-zero prefixes. - * - * @_subsection: api/utils:Base58 Encoding [about-base58] - */ -import { getBytes } from "./data.js"; -import { assertArgument } from "./errors.js"; -import { toBigInt } from "./maths.js"; -const Alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; -let Lookup = null; -function getAlpha(letter) { - if (Lookup == null) { - Lookup = {}; - for (let i = 0; i < Alphabet.length; i++) { - Lookup[Alphabet[i]] = BigInt(i); - } - } - const result = Lookup[letter]; - assertArgument(result != null, `invalid base58 value`, "letter", letter); - return result; -} -const BN_0 = BigInt(0); -const BN_58 = BigInt(58); -/** - * Encode %%value%% as a Base58-encoded string. - */ -export function encodeBase58(_value) { - const bytes = getBytes(_value); - let value = toBigInt(bytes); - let result = ""; - while (value) { - result = Alphabet[Number(value % BN_58)] + result; - value /= BN_58; - } - // Account for leading padding zeros - for (let i = 0; i < bytes.length; i++) { - if (bytes[i]) { - break; - } - result = Alphabet[0] + result; - } - return result; -} -/** - * Decode the Base58-encoded %%value%%. - */ -export function decodeBase58(value) { - let result = BN_0; - for (let i = 0; i < value.length; i++) { - result *= BN_58; - result += getAlpha(value[i]); - } - return result; -} -//# sourceMappingURL=base58.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base58.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base58.js.map deleted file mode 100644 index 942d56a7..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base58.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base58.js","sourceRoot":"","sources":["../../src.ts/utils/base58.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAKtC,MAAM,QAAQ,GAAG,4DAA4D,CAAC;AAC9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AAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,KAAa;IACtC,IAAI,MAAM,GAAG,IAAI,CAAC;IAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACnC,MAAM,IAAI,KAAK,CAAC;QAChB,MAAM,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;KAChC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base64-browser.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base64-browser.d.ts deleted file mode 100644 index ea96c442..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base64-browser.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { BytesLike } from "./data.js"; -export declare function decodeBase64(textData: string): Uint8Array; -export declare function encodeBase64(_data: BytesLike): string; -//# sourceMappingURL=base64-browser.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base64-browser.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base64-browser.d.ts.map deleted file mode 100644 index 0adb8e7b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base64-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base64-browser.d.ts","sourceRoot":"","sources":["../../src.ts/utils/base64-browser.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAG3C,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAOzD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAOrD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base64-browser.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base64-browser.js deleted file mode 100644 index b9b98a35..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base64-browser.js +++ /dev/null @@ -1,19 +0,0 @@ -// utils/base64-browser -import { getBytes } from "./data.js"; -export function decodeBase64(textData) { - textData = atob(textData); - const data = new Uint8Array(textData.length); - for (let i = 0; i < textData.length; i++) { - data[i] = textData.charCodeAt(i); - } - return getBytes(data); -} -export function encodeBase64(_data) { - const data = getBytes(_data); - let textData = ""; - for (let i = 0; i < data.length; i++) { - textData += String.fromCharCode(data[i]); - } - return btoa(textData); -} -//# sourceMappingURL=base64-browser.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base64-browser.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base64-browser.js.map deleted file mode 100644 index 5ece25ed..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base64-browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base64-browser.js","sourceRoot":"","sources":["../../src.ts/utils/base64-browser.ts"],"names":[],"mappings":"AACA,uBAAuB;AAEvB,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAKrC,MAAM,UAAU,YAAY,CAAC,QAAgB;IACzC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1B,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,IAAI,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;KACpC;IACD,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAgB;IACzC,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC7B,IAAI,QAAQ,GAAG,EAAE,CAAC;IAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAClC,QAAQ,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;KAC5C;IACD,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base64.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base64.d.ts deleted file mode 100644 index 0cab5328..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base64.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import type { BytesLike } from "./data.js"; -/** - * Decodes the base-64 encoded %%value%%. - * - * @example: - * // The decoded value is always binary data... - * result = decodeBase64("SGVsbG8gV29ybGQhIQ==") - * //_result: - * - * // ...use toUtf8String to convert it to a string. - * toUtf8String(result) - * //_result: - * - * // Decoding binary data - * decodeBase64("EjQ=") - * //_result: - */ -export declare function decodeBase64(value: string): Uint8Array; -/** - * Encodes %%data%% as a base-64 encoded string. - * - * @example: - * // Encoding binary data as a hexstring - * encodeBase64("0x1234") - * //_result: - * - * // Encoding binary data as a Uint8Array - * encodeBase64(new Uint8Array([ 0x12, 0x34 ])) - * //_result: - * - * // The input MUST be data... - * encodeBase64("Hello World!!") - * //_error: - * - * // ...use toUtf8Bytes for this. - * encodeBase64(toUtf8Bytes("Hello World!!")) - * //_result: - */ -export declare function encodeBase64(data: BytesLike): string; -//# sourceMappingURL=base64.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base64.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base64.d.ts.map deleted file mode 100644 index 90ad51c1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base64.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base64.d.ts","sourceRoot":"","sources":["../../src.ts/utils/base64.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAG3C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAEtD;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAEpD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base64.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base64.js deleted file mode 100644 index 8ac4416b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base64.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - * [Base64 encoding](link-wiki-base64) using 6-bit words to encode - * arbitrary bytes into a string using 65 printable symbols, the - * upper-case and lower-case alphabet, the digits ``0`` through ``9``, - * ``"+"`` and ``"/"`` with the ``"="`` used for padding. - * - * @_subsection: api/utils:Base64 Encoding [about-base64] - */ -import { getBytes, getBytesCopy } from "./data.js"; -/** - * Decodes the base-64 encoded %%value%%. - * - * @example: - * // The decoded value is always binary data... - * result = decodeBase64("SGVsbG8gV29ybGQhIQ==") - * //_result: - * - * // ...use toUtf8String to convert it to a string. - * toUtf8String(result) - * //_result: - * - * // Decoding binary data - * decodeBase64("EjQ=") - * //_result: - */ -export function decodeBase64(value) { - return getBytesCopy(Buffer.from(value, "base64")); -} -; -/** - * Encodes %%data%% as a base-64 encoded string. - * - * @example: - * // Encoding binary data as a hexstring - * encodeBase64("0x1234") - * //_result: - * - * // Encoding binary data as a Uint8Array - * encodeBase64(new Uint8Array([ 0x12, 0x34 ])) - * //_result: - * - * // The input MUST be data... - * encodeBase64("Hello World!!") - * //_error: - * - * // ...use toUtf8Bytes for this. - * encodeBase64(toUtf8Bytes("Hello World!!")) - * //_result: - */ -export function encodeBase64(data) { - return Buffer.from(getBytes(data)).toString("base64"); -} -//# sourceMappingURL=base64.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base64.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base64.js.map deleted file mode 100644 index e24e6606..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/base64.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base64.js","sourceRoot":"","sources":["../../src.ts/utils/base64.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAKnD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,YAAY,CAAC,KAAa;IACtC,OAAO,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;AACtD,CAAC;AAAA,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,YAAY,CAAC,IAAe;IACxC,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC1D,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/data.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/data.d.ts deleted file mode 100644 index 59f4fc0e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/data.d.ts +++ /dev/null @@ -1,93 +0,0 @@ -/** - * A [[HexString]] whose length is even, which ensures it is a valid - * representation of binary data. - */ -export type DataHexString = string; -/** - * A string which is prefixed with ``0x`` and followed by any number - * of case-agnostic hexadecimal characters. - * - * It must match the regular expression ``/0x[0-9A-Fa-f]*\/``. - */ -export type HexString = string; -/** - * An object that can be used to represent binary data. - */ -export type BytesLike = DataHexString | Uint8Array; -/** - * Get a typed Uint8Array for %%value%%. If already a Uint8Array - * the original %%value%% is returned; if a copy is required use - * [[getBytesCopy]]. - * - * @see: getBytesCopy - */ -export declare function getBytes(value: BytesLike, name?: string): Uint8Array; -/** - * Get a typed Uint8Array for %%value%%, creating a copy if necessary - * to prevent any modifications of the returned value from being - * reflected elsewhere. - * - * @see: getBytes - */ -export declare function getBytesCopy(value: BytesLike, name?: string): Uint8Array; -/** - * Returns true if %%value%% is a valid [[HexString]]. - * - * If %%length%% is ``true`` or a //number//, it also checks that - * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//) - * bytes of data (e.g. ``0x1234`` is 2 bytes). - */ -export declare function isHexString(value: any, length?: number | boolean): value is `0x${string}`; -/** - * Returns true if %%value%% is a valid representation of arbitrary - * data (i.e. a valid [[DataHexString]] or a Uint8Array). - */ -export declare function isBytesLike(value: any): value is BytesLike; -/** - * Returns a [[DataHexString]] representation of %%data%%. - */ -export declare function hexlify(data: BytesLike): string; -/** - * Returns a [[DataHexString]] by concatenating all values - * within %%data%%. - */ -export declare function concat(datas: ReadonlyArray): string; -/** - * Returns the length of %%data%%, in bytes. - */ -export declare function dataLength(data: BytesLike): number; -/** - * Returns a [[DataHexString]] by slicing %%data%% from the %%start%% - * offset to the %%end%% offset. - * - * By default %%start%% is 0 and %%end%% is the length of %%data%%. - */ -export declare function dataSlice(data: BytesLike, start?: number, end?: number): string; -/** - * Return the [[DataHexString]] result by stripping all **leading** - ** zero bytes from %%data%%. - */ -export declare function stripZerosLeft(data: BytesLike): string; -/** - * Return the [[DataHexString]] of %%data%% padded on the **left** - * to %%length%% bytes. - * - * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is - * thrown. - * - * This pads data the same as **values** are in Solidity - * (e.g. ``uint128``). - */ -export declare function zeroPadValue(data: BytesLike, length: number): string; -/** - * Return the [[DataHexString]] of %%data%% padded on the **right** - * to %%length%% bytes. - * - * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is - * thrown. - * - * This pads data the same as **bytes** are in Solidity - * (e.g. ``bytes16``). - */ -export declare function zeroPadBytes(data: BytesLike, length: number): string; -//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/data.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/data.d.ts.map deleted file mode 100644 index 691a77fa..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/data.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../src.ts/utils/data.ts"],"names":[],"mappings":"AAQA;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,UAAU,CAAC;AAsBnD;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,CAEpE;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,CAExE;AAGD;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,IAAI,KAAM,MAAO,EAAE,CAS3F;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,SAAS,CAE1D;AAID;;GAEG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAS/C;AAED;;;GAGG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,GAAG,MAAM,CAE9D;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAGlD;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAQ/E;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAItD;AAqBD;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpE"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/data.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/data.js deleted file mode 100644 index ffc4569d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/data.js +++ /dev/null @@ -1,171 +0,0 @@ -/** - * Some data helpers. - * - * - * @_subsection api/utils:Data Helpers [about-data] - */ -import { assert, assertArgument } from "./errors.js"; -function _getBytes(value, name, copy) { - if (value instanceof Uint8Array) { - if (copy) { - return new Uint8Array(value); - } - return value; - } - if (typeof (value) === "string" && (value.length % 2) === 0 && - value.match(/^0x[0-9a-f]*$/i)) { - const result = new Uint8Array((value.length - 2) / 2); - let offset = 2; - for (let i = 0; i < result.length; i++) { - result[i] = parseInt(value.substring(offset, offset + 2), 16); - offset += 2; - } - return result; - } - assertArgument(false, "invalid BytesLike value", name || "value", value); -} -/** - * Get a typed Uint8Array for %%value%%. If already a Uint8Array - * the original %%value%% is returned; if a copy is required use - * [[getBytesCopy]]. - * - * @see: getBytesCopy - */ -export function getBytes(value, name) { - return _getBytes(value, name, false); -} -/** - * Get a typed Uint8Array for %%value%%, creating a copy if necessary - * to prevent any modifications of the returned value from being - * reflected elsewhere. - * - * @see: getBytes - */ -export function getBytesCopy(value, name) { - return _getBytes(value, name, true); -} -/** - * Returns true if %%value%% is a valid [[HexString]]. - * - * If %%length%% is ``true`` or a //number//, it also checks that - * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//) - * bytes of data (e.g. ``0x1234`` is 2 bytes). - */ -export function isHexString(value, length) { - if (typeof (value) !== "string" || !value.match(/^0x[0-9A-Fa-f]*$/)) { - return false; - } - if (typeof (length) === "number" && value.length !== 2 + 2 * length) { - return false; - } - if (length === true && (value.length % 2) !== 0) { - return false; - } - return true; -} -/** - * Returns true if %%value%% is a valid representation of arbitrary - * data (i.e. a valid [[DataHexString]] or a Uint8Array). - */ -export function isBytesLike(value) { - return (isHexString(value, true) || (value instanceof Uint8Array)); -} -const HexCharacters = "0123456789abcdef"; -/** - * Returns a [[DataHexString]] representation of %%data%%. - */ -export function hexlify(data) { - const bytes = getBytes(data); - let result = "0x"; - for (let i = 0; i < bytes.length; i++) { - const v = bytes[i]; - result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f]; - } - return result; -} -/** - * Returns a [[DataHexString]] by concatenating all values - * within %%data%%. - */ -export function concat(datas) { - return "0x" + datas.map((d) => hexlify(d).substring(2)).join(""); -} -/** - * Returns the length of %%data%%, in bytes. - */ -export function dataLength(data) { - if (isHexString(data, true)) { - return (data.length - 2) / 2; - } - return getBytes(data).length; -} -/** - * Returns a [[DataHexString]] by slicing %%data%% from the %%start%% - * offset to the %%end%% offset. - * - * By default %%start%% is 0 and %%end%% is the length of %%data%%. - */ -export function dataSlice(data, start, end) { - const bytes = getBytes(data); - if (end != null && end > bytes.length) { - assert(false, "cannot slice beyond data bounds", "BUFFER_OVERRUN", { - buffer: bytes, length: bytes.length, offset: end - }); - } - return hexlify(bytes.slice((start == null) ? 0 : start, (end == null) ? bytes.length : end)); -} -/** - * Return the [[DataHexString]] result by stripping all **leading** - ** zero bytes from %%data%%. - */ -export function stripZerosLeft(data) { - let bytes = hexlify(data).substring(2); - while (bytes.startsWith("00")) { - bytes = bytes.substring(2); - } - return "0x" + bytes; -} -function zeroPad(data, length, left) { - const bytes = getBytes(data); - assert(length >= bytes.length, "padding exceeds data length", "BUFFER_OVERRUN", { - buffer: new Uint8Array(bytes), - length: length, - offset: length + 1 - }); - const result = new Uint8Array(length); - result.fill(0); - if (left) { - result.set(bytes, length - bytes.length); - } - else { - result.set(bytes, 0); - } - return hexlify(result); -} -/** - * Return the [[DataHexString]] of %%data%% padded on the **left** - * to %%length%% bytes. - * - * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is - * thrown. - * - * This pads data the same as **values** are in Solidity - * (e.g. ``uint128``). - */ -export function zeroPadValue(data, length) { - return zeroPad(data, length, true); -} -/** - * Return the [[DataHexString]] of %%data%% padded on the **right** - * to %%length%% bytes. - * - * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is - * thrown. - * - * This pads data the same as **bytes** are in Solidity - * (e.g. ``bytes16``). - */ -export function zeroPadBytes(data, length) { - return zeroPad(data, length, false); -} -//# sourceMappingURL=data.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/data.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/data.js.map deleted file mode 100644 index 18139220..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/data.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"data.js","sourceRoot":"","sources":["../../src.ts/utils/data.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE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QAAE,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;KAAE;IAC9D,OAAO,IAAI,GAAG,KAAK,CAAC;AACxB,CAAC;AAED,SAAS,OAAO,CAAC,IAAe,EAAE,MAAc,EAAE,IAAa;IAC3D,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC7B,MAAM,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,EAAE,6BAA6B,EAAE,gBAAgB,EAAE;QAC5E,MAAM,EAAE,IAAI,UAAU,CAAC,KAAK,CAAC;QAC7B,MAAM,EAAE,MAAM;QACd,MAAM,EAAE,MAAM,GAAG,CAAC;KACrB,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;IACtC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACf,IAAI,IAAI,EAAE;QACN,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;KAC5C;SAAM;QACH,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;KACxB;IAED,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC;AAC3B,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,YAAY,CAAC,IAAe,EAAE,MAAc;IACxD,OAAO,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;AACvC,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,YAAY,CAAC,IAAe,EAAE,MAAc;IACxD,OAAO,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AACxC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/errors.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/errors.d.ts deleted file mode 100644 index a7bab0d6..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/errors.d.ts +++ /dev/null @@ -1,512 +0,0 @@ -/** - * All errors in ethers include properties to ensure they are both - * human-readable (i.e. ``.message``) and machine-readable (i.e. ``.code``). - * - * The [[isError]] function can be used to check the error ``code`` and - * provide a type guard for the properties present on that error interface. - * - * @_section: api/utils/errors:Errors [about-errors] - */ -import type { TransactionRequest, TransactionReceipt, TransactionResponse } from "../providers/index.js"; -import type { FetchRequest, FetchResponse } from "./fetch.js"; -/** - * An error may contain additional properties, but those must not - * conflict with any implicit properties. - */ -export type ErrorInfo = Omit & { - shortMessage?: string; -}; -/** - * All errors emitted by ethers have an **ErrorCode** to help - * identify and coalesce errors to simplify programmatic analysis. - * - * Each **ErrorCode** is the %%code%% proerty of a coresponding - * [[EthersError]]. - * - * **Generic Errors** - * - * **``"UNKNOWN_ERROR"``** - see [[UnknownError]] - * - * **``"NOT_IMPLEMENTED"``** - see [[NotImplementedError]] - * - * **``"UNSUPPORTED_OPERATION"``** - see [[UnsupportedOperationError]] - * - * **``"NETWORK_ERROR"``** - see [[NetworkError]] - * - * **``"SERVER_ERROR"``** - see [[ServerError]] - * - * **``"TIMEOUT"``** - see [[TimeoutError]] - * - * **``"BAD_DATA"``** - see [[BadDataError]] - * - * **``"CANCELLED"``** - see [[CancelledError]] - * - * **Operational Errors** - * - * **``"BUFFER_OVERRUN"``** - see [[BufferOverrunError]] - * - * **``"NUMERIC_FAULT"``** - see [[NumericFaultError]] - * - * **Argument Errors** - * - * **``"INVALID_ARGUMENT"``** - see [[InvalidArgumentError]] - * - * **``"MISSING_ARGUMENT"``** - see [[MissingArgumentError]] - * - * **``"UNEXPECTED_ARGUMENT"``** - see [[UnexpectedArgumentError]] - * - * **``"VALUE_MISMATCH"``** - //unused// - * - * **Blockchain Errors** - * - * **``"CALL_EXCEPTION"``** - see [[CallExceptionError]] - * - * **``"INSUFFICIENT_FUNDS"``** - see [[InsufficientFundsError]] - * - * **``"NONCE_EXPIRED"``** - see [[NonceExpiredError]] - * - * **``"REPLACEMENT_UNDERPRICED"``** - see [[ReplacementUnderpricedError]] - * - * **``"TRANSACTION_REPLACED"``** - see [[TransactionReplacedError]] - * - * **``"UNCONFIGURED_NAME"``** - see [[UnconfiguredNameError]] - * - * **``"OFFCHAIN_FAULT"``** - see [[OffchainFaultError]] - * - * **User Interaction Errors** - * - * **``"ACTION_REJECTED"``** - see [[ActionRejectedError]] - */ -export type ErrorCode = "UNKNOWN_ERROR" | "NOT_IMPLEMENTED" | "UNSUPPORTED_OPERATION" | "NETWORK_ERROR" | "SERVER_ERROR" | "TIMEOUT" | "BAD_DATA" | "CANCELLED" | "BUFFER_OVERRUN" | "NUMERIC_FAULT" | "INVALID_ARGUMENT" | "MISSING_ARGUMENT" | "UNEXPECTED_ARGUMENT" | "VALUE_MISMATCH" | "CALL_EXCEPTION" | "INSUFFICIENT_FUNDS" | "NONCE_EXPIRED" | "REPLACEMENT_UNDERPRICED" | "TRANSACTION_REPLACED" | "UNCONFIGURED_NAME" | "OFFCHAIN_FAULT" | "ACTION_REJECTED"; -/** - * All errors in Ethers include properties to assist in - * machine-readable errors. - */ -export interface EthersError extends Error { - /** - * The string error code. - */ - code: ErrorCode; - /** - * A short message describing the error, with minimal additional - * details. - */ - shortMessage: string; - /** - * Additional info regarding the error that may be useful. - * - * This is generally helpful mostly for human-based debugging. - */ - info?: Record; - /** - * Any related error. - */ - error?: Error; -} -/** - * This Error is a catch-all for when there is no way for Ethers to - * know what the underlying problem is. - */ -export interface UnknownError extends EthersError<"UNKNOWN_ERROR"> { - [key: string]: any; -} -/** - * This Error is mostly used as a stub for functionality that is - * intended for the future, but is currently not implemented. - */ -export interface NotImplementedError extends EthersError<"NOT_IMPLEMENTED"> { - /** - * The attempted operation. - */ - operation: string; -} -/** - * This Error indicates that the attempted operation is not supported. - * - * This could range from a specific JSON-RPC end-point not supporting - * a feature to a specific configuration of an object prohibiting the - * operation. - * - * For example, a [[Wallet]] with no connected [[Provider]] is unable - * to send a transaction. - */ -export interface UnsupportedOperationError extends EthersError<"UNSUPPORTED_OPERATION"> { - /** - * The attempted operation. - */ - operation: string; -} -/** - * This Error indicates a problem connecting to a network. - */ -export interface NetworkError extends EthersError<"NETWORK_ERROR"> { - /** - * The network event. - */ - event: string; -} -/** - * This Error indicates there was a problem fetching a resource from - * a server. - */ -export interface ServerError extends EthersError<"SERVER_ERROR"> { - /** - * The requested resource. - */ - request: FetchRequest | string; - /** - * The response received from the server, if available. - */ - response?: FetchResponse; -} -/** - * This Error indicates that the timeout duration has expired and - * that the operation has been implicitly cancelled. - * - * The side-effect of the operation may still occur, as this - * generally means a request has been sent and there has simply - * been no response to indicate whether it was processed or not. - */ -export interface TimeoutError extends EthersError<"TIMEOUT"> { - /** - * The attempted operation. - */ - operation: string; - /** - * The reason. - */ - reason: string; - /** - * The resource request, if available. - */ - request?: FetchRequest; -} -/** - * This Error indicates that a provided set of data cannot - * be correctly interpreted. - */ -export interface BadDataError extends EthersError<"BAD_DATA"> { - /** - * The data. - */ - value: any; -} -/** - * This Error indicates that the operation was cancelled by a - * programmatic call, for example to ``cancel()``. - */ -export interface CancelledError extends EthersError<"CANCELLED"> { -} -/** - * This Error indicates an attempt was made to read outside the bounds - * of protected data. - * - * Most operations in Ethers are protected by bounds checks, to mitigate - * exploits when parsing data. - */ -export interface BufferOverrunError extends EthersError<"BUFFER_OVERRUN"> { - /** - * The buffer that was overrun. - */ - buffer: Uint8Array; - /** - * The length of the buffer. - */ - length: number; - /** - * The offset that was requested. - */ - offset: number; -} -/** - * This Error indicates an operation which would result in incorrect - * arithmetic output has occurred. - * - * For example, trying to divide by zero or using a ``uint8`` to store - * a negative value. - */ -export interface NumericFaultError extends EthersError<"NUMERIC_FAULT"> { - /** - * The attempted operation. - */ - operation: string; - /** - * The fault reported. - */ - fault: string; - /** - * The value the operation was attempted against. - */ - value: any; -} -/** - * This Error indicates an incorrect type or value was passed to - * a function or method. - */ -export interface InvalidArgumentError extends EthersError<"INVALID_ARGUMENT"> { - /** - * The name of the argument. - */ - argument: string; - /** - * The value that was provided. - */ - value: any; - info?: Record; -} -/** - * This Error indicates there were too few arguments were provided. - */ -export interface MissingArgumentError extends EthersError<"MISSING_ARGUMENT"> { - /** - * The number of arguments received. - */ - count: number; - /** - * The number of arguments expected. - */ - expectedCount: number; -} -/** - * This Error indicates too many arguments were provided. - */ -export interface UnexpectedArgumentError extends EthersError<"UNEXPECTED_ARGUMENT"> { - /** - * The number of arguments received. - */ - count: number; - /** - * The number of arguments expected. - */ - expectedCount: number; -} -/** - * The action that resulted in the call exception. - */ -export type CallExceptionAction = "call" | "estimateGas" | "getTransactionResult" | "sendTransaction" | "unknown"; -/** - * The related transaction that caused the error. - */ -export type CallExceptionTransaction = { - to: null | string; - from?: string; - data: string; -}; -/** - * This **Error** indicates a transaction reverted. - */ -export interface CallExceptionError extends EthersError<"CALL_EXCEPTION"> { - /** - * The action being performed when the revert was encountered. - */ - action: CallExceptionAction; - /** - * The revert data returned. - */ - data: null | string; - /** - * A human-readable representation of data, if possible. - */ - reason: null | string; - /** - * The transaction that triggered the exception. - */ - transaction: CallExceptionTransaction; - /** - * The contract invocation details, if available. - */ - invocation: null | { - method: string; - signature: string; - args: Array; - }; - /** - * The built-in or custom revert error, if available - */ - revert: null | { - signature: string; - name: string; - args: Array; - }; - /** - * If the error occurred in a transaction that was mined - * (with a status of ``0``), this is the receipt. - */ - receipt?: TransactionReceipt; -} -/** - * The sending account has insufficient funds to cover the - * entire transaction cost. - */ -export interface InsufficientFundsError extends EthersError<"INSUFFICIENT_FUNDS"> { - /** - * The transaction. - */ - transaction: TransactionRequest; -} -/** - * The sending account has already used this nonce in a - * transaction that has been included. - */ -export interface NonceExpiredError extends EthersError<"NONCE_EXPIRED"> { - /** - * The transaction. - */ - transaction: TransactionRequest; -} -/** - * A CCIP-read exception, which cannot be recovered from or - * be further processed. - */ -export interface OffchainFaultError extends EthersError<"OFFCHAIN_FAULT"> { - /** - * The transaction. - */ - transaction?: TransactionRequest; - /** - * The reason the CCIP-read failed. - */ - reason: string; -} -/** - * An attempt was made to replace a transaction, but with an - * insufficient additional fee to afford evicting the old - * transaction from the memory pool. - */ -export interface ReplacementUnderpricedError extends EthersError<"REPLACEMENT_UNDERPRICED"> { - /** - * The transaction. - */ - transaction: TransactionRequest; -} -/** - * A pending transaction was replaced by another. - */ -export interface TransactionReplacedError extends EthersError<"TRANSACTION_REPLACED"> { - /** - * If the transaction was cancelled, such that the original - * effects of the transaction cannot be assured. - */ - cancelled: boolean; - /** - * The reason the transaction was replaced. - */ - reason: "repriced" | "cancelled" | "replaced"; - /** - * The hash of the replaced transaction. - */ - hash: string; - /** - * The transaction that replaced the transaction. - */ - replacement: TransactionResponse; - /** - * The receipt of the transaction that replace the transaction. - */ - receipt: TransactionReceipt; -} -/** - * This Error indicates an ENS name was used, but the name has not - * been configured. - * - * This could indicate an ENS name is unowned or that the current - * address being pointed to is the [[ZeroAddress]]. - */ -export interface UnconfiguredNameError extends EthersError<"UNCONFIGURED_NAME"> { - /** - * The ENS name that was requested - */ - value: string; -} -/** - * This Error indicates a request was rejected by the user. - * - * In most clients (such as MetaMask), when an operation requires user - * authorization (such as ``signer.sendTransaction``), the client - * presents a dialog box to the user. If the user denies the request - * this error is thrown. - */ -export interface ActionRejectedError extends EthersError<"ACTION_REJECTED"> { - /** - * The requested action. - */ - action: "requestAccess" | "sendTransaction" | "signMessage" | "signTransaction" | "signTypedData" | "unknown"; - /** - * The reason the action was rejected. - * - * If there is already a pending request, some clients may indicate - * there is already a ``"pending"`` action. This prevents an app - * from spamming the user. - */ - reason: "expired" | "rejected" | "pending"; -} -/** - * A conditional type that transforms the [[ErrorCode]] T into - * its EthersError type. - * - * @flatworm-skip-docs - */ -export type CodedEthersError = T extends "UNKNOWN_ERROR" ? UnknownError : T extends "NOT_IMPLEMENTED" ? NotImplementedError : T extends "UNSUPPORTED_OPERATION" ? UnsupportedOperationError : T extends "NETWORK_ERROR" ? NetworkError : T extends "SERVER_ERROR" ? ServerError : T extends "TIMEOUT" ? TimeoutError : T extends "BAD_DATA" ? BadDataError : T extends "CANCELLED" ? CancelledError : T extends "BUFFER_OVERRUN" ? BufferOverrunError : T extends "NUMERIC_FAULT" ? NumericFaultError : T extends "INVALID_ARGUMENT" ? InvalidArgumentError : T extends "MISSING_ARGUMENT" ? MissingArgumentError : T extends "UNEXPECTED_ARGUMENT" ? UnexpectedArgumentError : T extends "CALL_EXCEPTION" ? CallExceptionError : T extends "INSUFFICIENT_FUNDS" ? InsufficientFundsError : T extends "NONCE_EXPIRED" ? NonceExpiredError : T extends "OFFCHAIN_FAULT" ? OffchainFaultError : T extends "REPLACEMENT_UNDERPRICED" ? ReplacementUnderpricedError : T extends "TRANSACTION_REPLACED" ? TransactionReplacedError : T extends "UNCONFIGURED_NAME" ? UnconfiguredNameError : T extends "ACTION_REJECTED" ? ActionRejectedError : never; -/** - * Returns true if the %%error%% matches an error thrown by ethers - * that matches the error %%code%%. - * - * In TypeScript environments, this can be used to check that %%error%% - * matches an EthersError type, which means the expected properties will - * be set. - * - * @See [ErrorCodes](api:ErrorCode) - * @example - * try { - * // code.... - * } catch (e) { - * if (isError(e, "CALL_EXCEPTION")) { - * // The Type Guard has validated this object - * console.log(e.data); - * } - * } - */ -export declare function isError>(error: any, code: K): error is T; -/** - * Returns true if %%error%% is a [[CallExceptionError]. - */ -export declare function isCallException(error: any): error is CallExceptionError; -/** - * Returns a new Error configured to the format ethers emits errors, with - * the %%message%%, [[api:ErrorCode]] %%code%% and additional properties - * for the corresponding EthersError. - * - * Each error in ethers includes the version of ethers, a - * machine-readable [[ErrorCode]], and depending on %%code%%, additional - * required properties. The error message will also include the %%message%%, - * ethers version, %%code%% and all additional properties, serialized. - */ -export declare function makeError>(message: string, code: K, info?: ErrorInfo): T; -/** - * Throws an EthersError with %%message%%, %%code%% and additional error - * %%info%% when %%check%% is falsish.. - * - * @see [[api:makeError]] - */ -export declare function assert>(check: unknown, message: string, code: K, info?: ErrorInfo): asserts check; -/** - * A simple helper to simply ensuring provided arguments match expected - * constraints, throwing if not. - * - * In TypeScript environments, the %%check%% has been asserted true, so - * any further code does not need additional compile-time checks. - */ -export declare function assertArgument(check: unknown, message: string, name: string, value: unknown): asserts check; -export declare function assertArgumentCount(count: number, expectedCount: number, message?: string): void; -/** - * Throws if the normalization %%form%% is not supported. - */ -export declare function assertNormalize(form: string): void; -/** - * Many classes use file-scoped values to guard the constructor, - * making it effectively private. This facilitates that pattern - * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%, - * throwing if not, indicating the %%className%% if provided. - */ -export declare function assertPrivate(givenGuard: any, guard: any, className?: string): void; -//# sourceMappingURL=errors.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/errors.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/errors.d.ts.map deleted file mode 100644 index f16258be..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/errors.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src.ts/utils/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,OAAO,KAAK,EACR,kBAAkB,EAAE,kBAAkB,EAAE,mBAAmB,EAC9D,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE9D;;;GAGG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,cAAc,CAAC,GAAG;IAAE,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AA+C7G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AACH,MAAM,MAAM,SAAS,GAGjB,eAAe,GAAG,iBAAiB,GAAG,uBAAuB,GAC7D,eAAe,GAAG,cAAc,GAAG,SAAS,G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,GAAG,CAAC,CAkD9H;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,SAAS,EAAE,CAAC,SAAS,gBAAgB,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAEvJ;AAGD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,CAE3G;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAahG;AAuBD;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAIlD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAYnF"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/errors.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/errors.js deleted file mode 100644 index b40e1014..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/errors.js +++ /dev/null @@ -1,232 +0,0 @@ -/** - * All errors in ethers include properties to ensure they are both - * human-readable (i.e. ``.message``) and machine-readable (i.e. ``.code``). - * - * The [[isError]] function can be used to check the error ``code`` and - * provide a type guard for the properties present on that error interface. - * - * @_section: api/utils/errors:Errors [about-errors] - */ -import { version } from "../_version.js"; -import { defineProperties } from "./properties.js"; -function stringify(value, seen) { - if (value == null) { - return "null"; - } - if (seen == null) { - seen = new Set(); - } - if (typeof (value) === "object") { - if (seen.has(value)) { - return "[Circular]"; - } - seen.add(value); - } - if (Array.isArray(value)) { - return "[ " + (value.map((v) => stringify(v, seen))).join(", ") + " ]"; - } - if (value instanceof Uint8Array) { - const HEX = "0123456789abcdef"; - let result = "0x"; - for (let i = 0; i < value.length; i++) { - result += HEX[value[i] >> 4]; - result += HEX[value[i] & 0xf]; - } - return result; - } - if (typeof (value) === "object" && typeof (value.toJSON) === "function") { - return stringify(value.toJSON(), seen); - } - switch (typeof (value)) { - case "boolean": - case "number": - case "symbol": - return value.toString(); - case "bigint": - return BigInt(value).toString(); - case "string": - return JSON.stringify(value); - case "object": { - const keys = Object.keys(value); - keys.sort(); - return "{ " + keys.map((k) => `${stringify(k, seen)}: ${stringify(value[k], seen)}`).join(", ") + " }"; - } - } - return `[ COULD NOT SERIALIZE ]`; -} -/** - * Returns true if the %%error%% matches an error thrown by ethers - * that matches the error %%code%%. - * - * In TypeScript environments, this can be used to check that %%error%% - * matches an EthersError type, which means the expected properties will - * be set. - * - * @See [ErrorCodes](api:ErrorCode) - * @example - * try { - * // code.... - * } catch (e) { - * if (isError(e, "CALL_EXCEPTION")) { - * // The Type Guard has validated this object - * console.log(e.data); - * } - * } - */ -export function isError(error, code) { - return (error && error.code === code); -} -/** - * Returns true if %%error%% is a [[CallExceptionError]. - */ -export function isCallException(error) { - return isError(error, "CALL_EXCEPTION"); -} -/** - * Returns a new Error configured to the format ethers emits errors, with - * the %%message%%, [[api:ErrorCode]] %%code%% and additional properties - * for the corresponding EthersError. - * - * Each error in ethers includes the version of ethers, a - * machine-readable [[ErrorCode]], and depending on %%code%%, additional - * required properties. The error message will also include the %%message%%, - * ethers version, %%code%% and all additional properties, serialized. - */ -export function makeError(message, code, info) { - let shortMessage = message; - { - const details = []; - if (info) { - if ("message" in info || "code" in info || "name" in info) { - throw new Error(`value will overwrite populated values: ${stringify(info)}`); - } - for (const key in info) { - if (key === "shortMessage") { - continue; - } - const value = (info[key]); - // try { - details.push(key + "=" + stringify(value)); - // } catch (error: any) { - // console.log("MMM", error.message); - // details.push(key + "=[could not serialize object]"); - // } - } - } - details.push(`code=${code}`); - details.push(`version=${version}`); - if (details.length) { - message += " (" + details.join(", ") + ")"; - } - } - let error; - switch (code) { - case "INVALID_ARGUMENT": - error = new TypeError(message); - break; - case "NUMERIC_FAULT": - case "BUFFER_OVERRUN": - error = new RangeError(message); - break; - default: - error = new Error(message); - } - defineProperties(error, { code }); - if (info) { - Object.assign(error, info); - } - if (error.shortMessage == null) { - defineProperties(error, { shortMessage }); - } - return error; -} -/** - * Throws an EthersError with %%message%%, %%code%% and additional error - * %%info%% when %%check%% is falsish.. - * - * @see [[api:makeError]] - */ -export function assert(check, message, code, info) { - if (!check) { - throw makeError(message, code, info); - } -} -/** - * A simple helper to simply ensuring provided arguments match expected - * constraints, throwing if not. - * - * In TypeScript environments, the %%check%% has been asserted true, so - * any further code does not need additional compile-time checks. - */ -export function assertArgument(check, message, name, value) { - assert(check, message, "INVALID_ARGUMENT", { argument: name, value: value }); -} -export function assertArgumentCount(count, expectedCount, message) { - if (message == null) { - message = ""; - } - if (message) { - message = ": " + message; - } - assert(count >= expectedCount, "missing argument" + message, "MISSING_ARGUMENT", { - count: count, - expectedCount: expectedCount - }); - assert(count <= expectedCount, "too many arguments" + message, "UNEXPECTED_ARGUMENT", { - count: count, - expectedCount: expectedCount - }); -} -const _normalizeForms = ["NFD", "NFC", "NFKD", "NFKC"].reduce((accum, form) => { - try { - // General test for normalize - /* c8 ignore start */ - if ("test".normalize(form) !== "test") { - throw new Error("bad"); - } - ; - /* c8 ignore stop */ - if (form === "NFD") { - const check = String.fromCharCode(0xe9).normalize("NFD"); - const expected = String.fromCharCode(0x65, 0x0301); - /* c8 ignore start */ - if (check !== expected) { - throw new Error("broken"); - } - /* c8 ignore stop */ - } - accum.push(form); - } - catch (error) { } - return accum; -}, []); -/** - * Throws if the normalization %%form%% is not supported. - */ -export function assertNormalize(form) { - assert(_normalizeForms.indexOf(form) >= 0, "platform missing String.prototype.normalize", "UNSUPPORTED_OPERATION", { - operation: "String.prototype.normalize", info: { form } - }); -} -/** - * Many classes use file-scoped values to guard the constructor, - * making it effectively private. This facilitates that pattern - * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%, - * throwing if not, indicating the %%className%% if provided. - */ -export function assertPrivate(givenGuard, guard, className) { - if (className == null) { - className = ""; - } - if (givenGuard !== guard) { - let method = className, operation = "new"; - if (className) { - method += "."; - operation += " " + className; - } - assert(false, `private constructor; use ${method}from* methods`, "UNSUPPORTED_OPERATION", { - operation - }); - } -} -//# sourceMappingURL=errors.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/errors.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/errors.js.map deleted file mode 100644 index d2a3f79a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/errors.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src.ts/utils/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAenD,SAAS,SAAS,CAAC,KAAU,EAAE,IAAe;IAC1C,IAAI,KAAK,IAAI,IAAI,EAAE;QAAE,OAAO,MAAM,CAAC;KAAE;IAErC,IAAI,IAAI,IAAI,IAAI,EAAE;QAAE,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC;KAAE;IACvC,IAAI,OAAM,CAAC,KAAK,CAAC,KAAK,QAAQ,EAAE;QAC5B,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YAAE,OAAO,YAAY,CAAC;SAAE;QAC7C,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;KACnB;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACtB,OAAO,IAAI,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C,CAAA;aAAE;YACrD,oBAAoB;SACvB;QAED,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KACpB;IAAC,OAAM,KAAK,EAAE,GAAG;IAElB,OAAO,KAAK,CAAC;AACjB,CAAC,EAAiB,EAAE,CAAC,CAAC;AAEtB;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY;IACxC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,6CAA6C,EAAE,uBAAuB,EAAE;QAC/G,SAAS,EAAE,4BAA4B,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE;KAC1D,CAAC,CAAC;AACP,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,UAAe,EAAE,KAAU,EAAE,SAAkB;IACzE,IAAI,SAAS,IAAI,IAAI,EAAE;QAAE,SAAS,GAAG,EAAE,CAAC;KAAE;IAC1C,IAAI,UAAU,KAAK,KAAK,EAAE;QACtB,IAAI,MAAM,GAAG,SAAS,EAAE,SAAS,GAAG,KAAK,CAAC;QAC1C,IAAI,SAAS,EAAE;YACX,MAAM,IAAI,GAAG,CAAC;YACd,SAAS,IAAI,GAAG,GAAG,SAAS,CAAC;SAChC;QACD,MAAM,CAAC,KAAK,EAAE,4BAA6B,MAAO,eAAe,EAAE,uBAAuB,EAAE;YACxF,SAAS;SACZ,CAAC,CAAC;KACN;AACL,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/events.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/events.d.ts deleted file mode 100644 index 5da08892..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/events.d.ts +++ /dev/null @@ -1,77 +0,0 @@ -/** - * A callback function called when a an event is triggered. - */ -export type Listener = (...args: Array) => void; -/** - * An **EventEmitterable** behaves similar to an EventEmitter - * except provides async access to its methods. - * - * An EventEmitter implements the observer pattern. - */ -export interface EventEmitterable { - /** - * Registers a %%listener%% that is called whenever the - * %%event%% occurs until unregistered. - */ - on(event: T, listener: Listener): Promise; - /** - * Registers a %%listener%% that is called the next time - * %%event%% occurs. - */ - once(event: T, listener: Listener): Promise; - /** - * Triggers each listener for %%event%% with the %%args%%. - */ - emit(event: T, ...args: Array): Promise; - /** - * Resolves to the number of listeners for %%event%%. - */ - listenerCount(event?: T): Promise; - /** - * Resolves to the listeners for %%event%%. - */ - listeners(event?: T): Promise>; - /** - * Unregister the %%listener%% for %%event%%. If %%listener%% - * is unspecified, all listeners are unregistered. - */ - off(event: T, listener?: Listener): Promise; - /** - * Unregister all listeners for %%event%%. - */ - removeAllListeners(event?: T): Promise; - /** - * Alias for [[on]]. - */ - addListener(event: T, listener: Listener): Promise; - /** - * Alias for [[off]]. - */ - removeListener(event: T, listener: Listener): Promise; -} -/** - * When an [[EventEmitterable]] triggers a [[Listener]], the - * callback always ahas one additional argument passed, which is - * an **EventPayload**. - */ -export declare class EventPayload { - #private; - /** - * The event filter. - */ - readonly filter: T; - /** - * The **EventEmitterable**. - */ - readonly emitter: EventEmitterable; - /** - * Create a new **EventPayload** for %%emitter%% with - * the %%listener%% and for %%filter%%. - */ - constructor(emitter: EventEmitterable, listener: null | Listener, filter: T); - /** - * Unregister the triggered listener for future events. - */ - removeListener(): Promise; -} -//# sourceMappingURL=events.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/events.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/events.d.ts.map deleted file mode 100644 index 645e81ff..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/events.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src.ts/utils/events.ts"],"names":[],"mappings":"AASA;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;AAErD;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IvC;;;OAGG;gBACS,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,GAAG,QAAQ,EAAE,MAAM,EAAE,CAAC;IAK9E;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;CAIxC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/events.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/events.js deleted file mode 100644 index 41ca7272..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/events.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Events allow for applications to use the observer pattern, which - * allows subscribing and publishing events, outside the normal - * execution paths. - * - * @_section api/utils/events:Events [about-events] - */ -import { defineProperties } from "./properties.js"; -/** - * When an [[EventEmitterable]] triggers a [[Listener]], the - * callback always ahas one additional argument passed, which is - * an **EventPayload**. - */ -export class EventPayload { - /** - * The event filter. - */ - filter; - /** - * The **EventEmitterable**. - */ - emitter; - #listener; - /** - * Create a new **EventPayload** for %%emitter%% with - * the %%listener%% and for %%filter%%. - */ - constructor(emitter, listener, filter) { - this.#listener = listener; - defineProperties(this, { emitter, filter }); - } - /** - * Unregister the triggered listener for future events. - */ - async removeListener() { - if (this.#listener == null) { - return; - } - await this.emitter.off(this.filter, this.#listener); - } -} -//# sourceMappingURL=events.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/events.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/events.js.map deleted file mode 100644 index fc78d150..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/events.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src.ts/utils/events.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AA+DnD;;;;GAIG;AACH,MAAM,OAAO,YAAY;IACrB;;OAEG;IACM,MAAM,CAAK;IAEpB;;OAEG;IACM,OAAO,CAAuB;IAE9B,SAAS,CAAkB;IAEpC;;;OAGG;IACH,YAAY,OAA4B,EAAE,QAAyB,EAAE,MAAS;QAC1E,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,gBAAgB,CAAoB,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IACnE,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,cAAc;QAChB,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,EAAE;YAAE,OAAO;SAAE;QACvC,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IACxD,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/fetch.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/fetch.d.ts deleted file mode 100644 index d1257928..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/fetch.d.ts +++ /dev/null @@ -1,363 +0,0 @@ -/** - * An environment's implementation of ``getUrl`` must return this type. - */ -export type GetUrlResponse = { - statusCode: number; - statusMessage: string; - headers: Record; - body: null | Uint8Array; -}; -/** - * This can be used to control how throttling is handled in - * [[FetchRequest-setThrottleParams]]. - */ -export type FetchThrottleParams = { - maxAttempts?: number; - slotInterval?: number; -}; -/** - * Called before any network request, allowing updated headers (e.g. Bearer tokens), etc. - */ -export type FetchPreflightFunc = (req: FetchRequest) => Promise; -/** - * Called on the response, allowing client-based throttling logic or post-processing. - */ -export type FetchProcessFunc = (req: FetchRequest, resp: FetchResponse) => Promise; -/** - * Called prior to each retry; return true to retry, false to abort. - */ -export type FetchRetryFunc = (req: FetchRequest, resp: FetchResponse, attempt: number) => Promise; -/** - * Called on Gateway URLs. - */ -export type FetchGatewayFunc = (url: string, signal?: FetchCancelSignal) => Promise; -/** - * Used to perform a fetch; use this to override the underlying network - * fetch layer. In NodeJS, the default uses the "http" and "https" libraries - * and in the browser ``fetch`` is used. If you wish to use Axios, this is - * how you would register it. - */ -export type FetchGetUrlFunc = (req: FetchRequest, signal?: FetchCancelSignal) => Promise; -/** - * @_ignore - */ -export declare class FetchCancelSignal { - #private; - constructor(request: FetchRequest); - addListener(listener: () => void): void; - get cancelled(): boolean; - checkSignal(): void; -} -/** - * Represents a request for a resource using a URI. - * - * By default, the supported schemes are ``HTTP``, ``HTTPS``, ``data:``, - * and ``IPFS:``. - * - * Additional schemes can be added globally using [[registerGateway]]. - * - * @example: - * req = new FetchRequest("https://www.ricmoo.com") - * resp = await req.send() - * resp.body.length - * //_result: - */ -export declare class FetchRequest implements Iterable<[key: string, value: string]> { - #private; - /** - * The fetch URL to request. - */ - get url(): string; - set url(url: string); - /** - * The fetch body, if any, to send as the request body. //(default: null)// - * - * When setting a body, the intrinsic ``Content-Type`` is automatically - * set and will be used if **not overridden** by setting a custom - * header. - * - * If %%body%% is null, the body is cleared (along with the - * intrinsic ``Content-Type``). - * - * If %%body%% is a string, the intrinsic ``Content-Type`` is set to - * ``text/plain``. - * - * If %%body%% is a Uint8Array, the intrinsic ``Content-Type`` is set to - * ``application/octet-stream``. - * - * If %%body%% is any other object, the intrinsic ``Content-Type`` is - * set to ``application/json``. - */ - get body(): null | Uint8Array; - set body(body: null | string | Readonly | Readonly); - /** - * Returns true if the request has a body. - */ - hasBody(): this is (FetchRequest & { - body: Uint8Array; - }); - /** - * The HTTP method to use when requesting the URI. If no method - * has been explicitly set, then ``GET`` is used if the body is - * null and ``POST`` otherwise. - */ - get method(): string; - set method(method: null | string); - /** - * The headers that will be used when requesting the URI. All - * keys are lower-case. - * - * This object is a copy, so any changes will **NOT** be reflected - * in the ``FetchRequest``. - * - * To set a header entry, use the ``setHeader`` method. - */ - get headers(): Record; - /** - * Get the header for %%key%%, ignoring case. - */ - getHeader(key: string): string; - /** - * Set the header for %%key%% to %%value%%. All values are coerced - * to a string. - */ - setHeader(key: string, value: string | number): void; - /** - * Clear all headers, resetting all intrinsic headers. - */ - clearHeaders(): void; - [Symbol.iterator](): Iterator<[key: string, value: string]>; - /** - * The value that will be sent for the ``Authorization`` header. - * - * To set the credentials, use the ``setCredentials`` method. - */ - get credentials(): null | string; - /** - * Sets an ``Authorization`` for %%username%% with %%password%%. - */ - setCredentials(username: string, password: string): void; - /** - * Enable and request gzip-encoded responses. The response will - * automatically be decompressed. //(default: true)// - */ - get allowGzip(): boolean; - set allowGzip(value: boolean); - /** - * Allow ``Authentication`` credentials to be sent over insecure - * channels. //(default: false)// - */ - get allowInsecureAuthentication(): boolean; - set allowInsecureAuthentication(value: boolean); - /** - * The timeout (in milliseconds) to wait for a complete response. - * //(default: 5 minutes)// - */ - get timeout(): number; - set timeout(timeout: number); - /** - * This function is called prior to each request, for example - * during a redirection or retry in case of server throttling. - * - * This offers an opportunity to populate headers or update - * content before sending a request. - */ - get preflightFunc(): null | FetchPreflightFunc; - set preflightFunc(preflight: null | FetchPreflightFunc); - /** - * This function is called after each response, offering an - * opportunity to provide client-level throttling or updating - * response data. - * - * Any error thrown in this causes the ``send()`` to throw. - * - * To schedule a retry attempt (assuming the maximum retry limit - * has not been reached), use [[response.throwThrottleError]]. - */ - get processFunc(): null | FetchProcessFunc; - set processFunc(process: null | FetchProcessFunc); - /** - * This function is called on each retry attempt. - */ - get retryFunc(): null | FetchRetryFunc; - set retryFunc(retry: null | FetchRetryFunc); - /** - * This function is called to fetch content from HTTP and - * HTTPS URLs and is platform specific (e.g. nodejs vs - * browsers). - * - * This is by default the currently registered global getUrl - * function, which can be changed using [[registerGetUrl]]. - * If this has been set, setting is to ``null`` will cause - * this FetchRequest (and any future clones) to revert back to - * using the currently registered global getUrl function. - * - * Setting this is generally not necessary, but may be useful - * for developers that wish to intercept requests or to - * configurege a proxy or other agent. - */ - get getUrlFunc(): FetchGetUrlFunc; - set getUrlFunc(value: null | FetchGetUrlFunc); - /** - * Create a new FetchRequest instance with default values. - * - * Once created, each property may be set before issuing a - * ``.send()`` to make the request. - */ - constructor(url: string); - toString(): string; - /** - * Update the throttle parameters used to determine maximum - * attempts and exponential-backoff properties. - */ - setThrottleParams(params: FetchThrottleParams): void; - /** - * Resolves to the response by sending the request. - */ - send(): Promise; - /** - * Cancels the inflight response, causing a ``CANCELLED`` - * error to be rejected from the [[send]]. - */ - cancel(): void; - /** - * Returns a new [[FetchRequest]] that represents the redirection - * to %%location%%. - */ - redirect(location: string): FetchRequest; - /** - * Create a new copy of this request. - */ - clone(): FetchRequest; - /** - * Locks all static configuration for gateways and FetchGetUrlFunc - * registration. - */ - static lockConfig(): void; - /** - * Get the current Gateway function for %%scheme%%. - */ - static getGateway(scheme: string): null | FetchGatewayFunc; - /** - * Use the %%func%% when fetching URIs using %%scheme%%. - * - * This method affects all requests globally. - * - * If [[lockConfig]] has been called, no change is made and this - * throws. - */ - static registerGateway(scheme: string, func: FetchGatewayFunc): void; - /** - * Use %%getUrl%% when fetching URIs over HTTP and HTTPS requests. - * - * This method affects all requests globally. - * - * If [[lockConfig]] has been called, no change is made and this - * throws. - */ - static registerGetUrl(getUrl: FetchGetUrlFunc): void; - /** - * Creates a getUrl function that fetches content from HTTP and - * HTTPS URLs. - * - * The available %%options%% are dependent on the platform - * implementation of the default getUrl function. - * - * This is not generally something that is needed, but is useful - * when trying to customize simple behaviour when fetching HTTP - * content. - */ - static createGetUrlFunc(options?: Record): FetchGetUrlFunc; - /** - * Creates a function that can "fetch" data URIs. - * - * Note that this is automatically done internally to support - * data URIs, so it is not necessary to register it. - * - * This is not generally something that is needed, but may - * be useful in a wrapper to perfom custom data URI functionality. - */ - static createDataGateway(): FetchGatewayFunc; - /** - * Creates a function that will fetch IPFS (unvalidated) from - * a custom gateway baseUrl. - * - * The default IPFS gateway used internally is - * ``"https:/\/gateway.ipfs.io/ipfs/"``. - */ - static createIpfsGatewayFunc(baseUrl: string): FetchGatewayFunc; -} -/** - * The response for a FetchRequest. - */ -export declare class FetchResponse implements Iterable<[key: string, value: string]> { - #private; - toString(): string; - /** - * The response status code. - */ - get statusCode(): number; - /** - * The response status message. - */ - get statusMessage(): string; - /** - * The response headers. All keys are lower-case. - */ - get headers(): Record; - /** - * The response body, or ``null`` if there was no body. - */ - get body(): null | Readonly; - /** - * The response body as a UTF-8 encoded string, or the empty - * string (i.e. ``""``) if there was no body. - * - * An error is thrown if the body is invalid UTF-8 data. - */ - get bodyText(): string; - /** - * The response body, decoded as JSON. - * - * An error is thrown if the body is invalid JSON-encoded data - * or if there was no body. - */ - get bodyJson(): any; - [Symbol.iterator](): Iterator<[key: string, value: string]>; - constructor(statusCode: number, statusMessage: string, headers: Readonly>, body: null | Uint8Array, request?: FetchRequest); - /** - * Return a Response with matching headers and body, but with - * an error status code (i.e. 599) and %%message%% with an - * optional %%error%%. - */ - makeServerError(message?: string, error?: Error): FetchResponse; - /** - * If called within a [request.processFunc](FetchRequest-processFunc) - * call, causes the request to retry as if throttled for %%stall%% - * milliseconds. - */ - throwThrottleError(message?: string, stall?: number): never; - /** - * Get the header value for %%key%%, ignoring case. - */ - getHeader(key: string): string; - /** - * Returns true if the response has a body. - */ - hasBody(): this is (FetchResponse & { - body: Uint8Array; - }); - /** - * The request made for this response. - */ - get request(): null | FetchRequest; - /** - * Returns true if this response was a success statusCode. - */ - ok(): boolean; - /** - * Throws a ``SERVER_ERROR`` if this response is not ok. - */ - assertOk(): void; -} -//# sourceMappingURL=fetch.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/fetch.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/fetch.d.ts.map deleted file mode 100644 index cfc7bf06..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/fetch.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src.ts/utils/fetch.ts"],"names":[],"mappings":"AA2BA;;GAEG;AACH,MAAM,MAAM,cAAc,G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;IACH,eAAe,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,aAAa;IAc/D;;;;OAIG;IACH,kBAAkB,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK;IAc3D;;OAEG;IACH,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAI9B;;OAEG;IACH,OAAO,IAAI,IAAI,IAAI,CAAC,aAAa,GAAG;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,CAAC;IAIzD;;OAEG;IACH,IAAI,OAAO,IAAI,IAAI,GAAG,YAAY,CAA0B;IAE5D;;OAEG;IACH,EAAE,IAAI,OAAO;IAIb;;OAEG;IACH,QAAQ,IAAI,IAAI;CAsBnB"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/fetch.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/fetch.js deleted file mode 100644 index 650ef5d3..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/fetch.js +++ /dev/null @@ -1,852 +0,0 @@ -/** - * Fetching content from the web is environment-specific, so Ethers - * provides an abstraction that each environment can implement to provide - * this service. - * - * On [Node.js](link-node), the ``http`` and ``https`` libs are used to - * create a request object, register event listeners and process data - * and populate the [[FetchResponse]]. - * - * In a browser, the [DOM fetch](link-js-fetch) is used, and the resulting - * ``Promise`` is waited on to retrieve the payload. - * - * The [[FetchRequest]] is responsible for handling many common situations, - * such as redirects, server throttling, authentication, etc. - * - * It also handles common gateways, such as IPFS and data URIs. - * - * @_section api/utils/fetching:Fetching Web Content [about-fetch] - */ -import { decodeBase64, encodeBase64 } from "./base64.js"; -import { hexlify } from "./data.js"; -import { assert, assertArgument } from "./errors.js"; -import { defineProperties } from "./properties.js"; -import { toUtf8Bytes, toUtf8String } from "./utf8.js"; -import { createGetUrl } from "./geturl.js"; -const MAX_ATTEMPTS = 12; -const SLOT_INTERVAL = 250; -// The global FetchGetUrlFunc implementation. -let defaultGetUrlFunc = createGetUrl(); -const reData = new RegExp("^data:([^;:]*)?(;base64)?,(.*)$", "i"); -const reIpfs = new RegExp("^ipfs:/\/(ipfs/)?(.*)$", "i"); -// If locked, new Gateways cannot be added -let locked = false; -// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs -async function dataGatewayFunc(url, signal) { - try { - const match = url.match(reData); - if (!match) { - throw new Error("invalid data"); - } - return new FetchResponse(200, "OK", { - "content-type": (match[1] || "text/plain"), - }, (match[2] ? decodeBase64(match[3]) : unpercent(match[3]))); - } - catch (error) { - return new FetchResponse(599, "BAD REQUEST (invalid data: URI)", {}, null, new FetchRequest(url)); - } -} -/** - * Returns a [[FetchGatewayFunc]] for fetching content from a standard - * IPFS gateway hosted at %%baseUrl%%. - */ -function getIpfsGatewayFunc(baseUrl) { - async function gatewayIpfs(url, signal) { - try { - const match = url.match(reIpfs); - if (!match) { - throw new Error("invalid link"); - } - return new FetchRequest(`${baseUrl}${match[2]}`); - } - catch (error) { - return new FetchResponse(599, "BAD REQUEST (invalid IPFS URI)", {}, null, new FetchRequest(url)); - } - } - return gatewayIpfs; -} -const Gateways = { - "data": dataGatewayFunc, - "ipfs": getIpfsGatewayFunc("https:/\/gateway.ipfs.io/ipfs/") -}; -const fetchSignals = new WeakMap(); -/** - * @_ignore - */ -export class FetchCancelSignal { - #listeners; - #cancelled; - constructor(request) { - this.#listeners = []; - this.#cancelled = false; - fetchSignals.set(request, () => { - if (this.#cancelled) { - return; - } - this.#cancelled = true; - for (const listener of this.#listeners) { - setTimeout(() => { listener(); }, 0); - } - this.#listeners = []; - }); - } - addListener(listener) { - assert(!this.#cancelled, "singal already cancelled", "UNSUPPORTED_OPERATION", { - operation: "fetchCancelSignal.addCancelListener" - }); - this.#listeners.push(listener); - } - get cancelled() { return this.#cancelled; } - checkSignal() { - assert(!this.cancelled, "cancelled", "CANCELLED", {}); - } -} -// Check the signal, throwing if it is cancelled -function checkSignal(signal) { - if (signal == null) { - throw new Error("missing signal; should not happen"); - } - signal.checkSignal(); - return signal; -} -/** - * Represents a request for a resource using a URI. - * - * By default, the supported schemes are ``HTTP``, ``HTTPS``, ``data:``, - * and ``IPFS:``. - * - * Additional schemes can be added globally using [[registerGateway]]. - * - * @example: - * req = new FetchRequest("https://www.ricmoo.com") - * resp = await req.send() - * resp.body.length - * //_result: - */ -export class FetchRequest { - #allowInsecure; - #gzip; - #headers; - #method; - #timeout; - #url; - #body; - #bodyType; - #creds; - // Hooks - #preflight; - #process; - #retry; - #signal; - #throttle; - #getUrlFunc; - /** - * The fetch URL to request. - */ - get url() { return this.#url; } - set url(url) { - this.#url = String(url); - } - /** - * The fetch body, if any, to send as the request body. //(default: null)// - * - * When setting a body, the intrinsic ``Content-Type`` is automatically - * set and will be used if **not overridden** by setting a custom - * header. - * - * If %%body%% is null, the body is cleared (along with the - * intrinsic ``Content-Type``). - * - * If %%body%% is a string, the intrinsic ``Content-Type`` is set to - * ``text/plain``. - * - * If %%body%% is a Uint8Array, the intrinsic ``Content-Type`` is set to - * ``application/octet-stream``. - * - * If %%body%% is any other object, the intrinsic ``Content-Type`` is - * set to ``application/json``. - */ - get body() { - if (this.#body == null) { - return null; - } - return new Uint8Array(this.#body); - } - set body(body) { - if (body == null) { - this.#body = undefined; - this.#bodyType = undefined; - } - else if (typeof (body) === "string") { - this.#body = toUtf8Bytes(body); - this.#bodyType = "text/plain"; - } - else if (body instanceof Uint8Array) { - this.#body = body; - this.#bodyType = "application/octet-stream"; - } - else if (typeof (body) === "object") { - this.#body = toUtf8Bytes(JSON.stringify(body)); - this.#bodyType = "application/json"; - } - else { - throw new Error("invalid body"); - } - } - /** - * Returns true if the request has a body. - */ - hasBody() { - return (this.#body != null); - } - /** - * The HTTP method to use when requesting the URI. If no method - * has been explicitly set, then ``GET`` is used if the body is - * null and ``POST`` otherwise. - */ - get method() { - if (this.#method) { - return this.#method; - } - if (this.hasBody()) { - return "POST"; - } - return "GET"; - } - set method(method) { - if (method == null) { - method = ""; - } - this.#method = String(method).toUpperCase(); - } - /** - * The headers that will be used when requesting the URI. All - * keys are lower-case. - * - * This object is a copy, so any changes will **NOT** be reflected - * in the ``FetchRequest``. - * - * To set a header entry, use the ``setHeader`` method. - */ - get headers() { - const headers = Object.assign({}, this.#headers); - if (this.#creds) { - headers["authorization"] = `Basic ${encodeBase64(toUtf8Bytes(this.#creds))}`; - } - ; - if (this.allowGzip) { - headers["accept-encoding"] = "gzip"; - } - if (headers["content-type"] == null && this.#bodyType) { - headers["content-type"] = this.#bodyType; - } - if (this.body) { - headers["content-length"] = String(this.body.length); - } - return headers; - } - /** - * Get the header for %%key%%, ignoring case. - */ - getHeader(key) { - return this.headers[key.toLowerCase()]; - } - /** - * Set the header for %%key%% to %%value%%. All values are coerced - * to a string. - */ - setHeader(key, value) { - this.#headers[String(key).toLowerCase()] = String(value); - } - /** - * Clear all headers, resetting all intrinsic headers. - */ - clearHeaders() { - this.#headers = {}; - } - [Symbol.iterator]() { - const headers = this.headers; - const keys = Object.keys(headers); - let index = 0; - return { - next: () => { - if (index < keys.length) { - const key = keys[index++]; - return { - value: [key, headers[key]], done: false - }; - } - return { value: undefined, done: true }; - } - }; - } - /** - * The value that will be sent for the ``Authorization`` header. - * - * To set the credentials, use the ``setCredentials`` method. - */ - get credentials() { - return this.#creds || null; - } - /** - * Sets an ``Authorization`` for %%username%% with %%password%%. - */ - setCredentials(username, password) { - assertArgument(!username.match(/:/), "invalid basic authentication username", "username", "[REDACTED]"); - this.#creds = `${username}:${password}`; - } - /** - * Enable and request gzip-encoded responses. The response will - * automatically be decompressed. //(default: true)// - */ - get allowGzip() { - return this.#gzip; - } - set allowGzip(value) { - this.#gzip = !!value; - } - /** - * Allow ``Authentication`` credentials to be sent over insecure - * channels. //(default: false)// - */ - get allowInsecureAuthentication() { - return !!this.#allowInsecure; - } - set allowInsecureAuthentication(value) { - this.#allowInsecure = !!value; - } - /** - * The timeout (in milliseconds) to wait for a complete response. - * //(default: 5 minutes)// - */ - get timeout() { return this.#timeout; } - set timeout(timeout) { - assertArgument(timeout >= 0, "timeout must be non-zero", "timeout", timeout); - this.#timeout = timeout; - } - /** - * This function is called prior to each request, for example - * during a redirection or retry in case of server throttling. - * - * This offers an opportunity to populate headers or update - * content before sending a request. - */ - get preflightFunc() { - return this.#preflight || null; - } - set preflightFunc(preflight) { - this.#preflight = preflight; - } - /** - * This function is called after each response, offering an - * opportunity to provide client-level throttling or updating - * response data. - * - * Any error thrown in this causes the ``send()`` to throw. - * - * To schedule a retry attempt (assuming the maximum retry limit - * has not been reached), use [[response.throwThrottleError]]. - */ - get processFunc() { - return this.#process || null; - } - set processFunc(process) { - this.#process = process; - } - /** - * This function is called on each retry attempt. - */ - get retryFunc() { - return this.#retry || null; - } - set retryFunc(retry) { - this.#retry = retry; - } - /** - * This function is called to fetch content from HTTP and - * HTTPS URLs and is platform specific (e.g. nodejs vs - * browsers). - * - * This is by default the currently registered global getUrl - * function, which can be changed using [[registerGetUrl]]. - * If this has been set, setting is to ``null`` will cause - * this FetchRequest (and any future clones) to revert back to - * using the currently registered global getUrl function. - * - * Setting this is generally not necessary, but may be useful - * for developers that wish to intercept requests or to - * configurege a proxy or other agent. - */ - get getUrlFunc() { - return this.#getUrlFunc || defaultGetUrlFunc; - } - set getUrlFunc(value) { - this.#getUrlFunc = value; - } - /** - * Create a new FetchRequest instance with default values. - * - * Once created, each property may be set before issuing a - * ``.send()`` to make the request. - */ - constructor(url) { - this.#url = String(url); - this.#allowInsecure = false; - this.#gzip = true; - this.#headers = {}; - this.#method = ""; - this.#timeout = 300000; - this.#throttle = { - slotInterval: SLOT_INTERVAL, - maxAttempts: MAX_ATTEMPTS - }; - this.#getUrlFunc = null; - } - toString() { - return ``; - } - /** - * Update the throttle parameters used to determine maximum - * attempts and exponential-backoff properties. - */ - setThrottleParams(params) { - if (params.slotInterval != null) { - this.#throttle.slotInterval = params.slotInterval; - } - if (params.maxAttempts != null) { - this.#throttle.maxAttempts = params.maxAttempts; - } - } - async #send(attempt, expires, delay, _request, _response) { - if (attempt >= this.#throttle.maxAttempts) { - return _response.makeServerError("exceeded maximum retry limit"); - } - assert(getTime() <= expires, "timeout", "TIMEOUT", { - operation: "request.send", reason: "timeout", request: _request - }); - if (delay > 0) { - await wait(delay); - } - let req = this.clone(); - const scheme = (req.url.split(":")[0] || "").toLowerCase(); - // Process any Gateways - if (scheme in Gateways) { - const result = await Gateways[scheme](req.url, checkSignal(_request.#signal)); - if (result instanceof FetchResponse) { - let response = result; - if (this.processFunc) { - checkSignal(_request.#signal); - try { - response = await this.processFunc(req, response); - } - catch (error) { - // Something went wrong during processing; throw a 5xx server error - if (error.throttle == null || typeof (error.stall) !== "number") { - response.makeServerError("error in post-processing function", error).assertOk(); - } - // Ignore throttling - } - } - return response; - } - req = result; - } - // We have a preflight function; update the request - if (this.preflightFunc) { - req = await this.preflightFunc(req); - } - const resp = await this.getUrlFunc(req, checkSignal(_request.#signal)); - let response = new FetchResponse(resp.statusCode, resp.statusMessage, resp.headers, resp.body, _request); - if (response.statusCode === 301 || response.statusCode === 302) { - // Redirect - try { - const location = response.headers.location || ""; - return req.redirect(location).#send(attempt + 1, expires, 0, _request, response); - } - catch (error) { } - // Things won't get any better on another attempt; abort - return response; - } - else if (response.statusCode === 429) { - // Throttle - if (this.retryFunc == null || (await this.retryFunc(req, response, attempt))) { - const retryAfter = response.headers["retry-after"]; - let delay = this.#throttle.slotInterval * Math.trunc(Math.random() * Math.pow(2, attempt)); - if (typeof (retryAfter) === "string" && retryAfter.match(/^[1-9][0-9]*$/)) { - delay = parseInt(retryAfter); - } - return req.clone().#send(attempt + 1, expires, delay, _request, response); - } - } - if (this.processFunc) { - checkSignal(_request.#signal); - try { - response = await this.processFunc(req, response); - } - catch (error) { - // Something went wrong during processing; throw a 5xx server error - if (error.throttle == null || typeof (error.stall) !== "number") { - response.makeServerError("error in post-processing function", error).assertOk(); - } - // Throttle - let delay = this.#throttle.slotInterval * Math.trunc(Math.random() * Math.pow(2, attempt)); - ; - if (error.stall >= 0) { - delay = error.stall; - } - return req.clone().#send(attempt + 1, expires, delay, _request, response); - } - } - return response; - } - /** - * Resolves to the response by sending the request. - */ - send() { - assert(this.#signal == null, "request already sent", "UNSUPPORTED_OPERATION", { operation: "fetchRequest.send" }); - this.#signal = new FetchCancelSignal(this); - return this.#send(0, getTime() + this.timeout, 0, this, new FetchResponse(0, "", {}, null, this)); - } - /** - * Cancels the inflight response, causing a ``CANCELLED`` - * error to be rejected from the [[send]]. - */ - cancel() { - assert(this.#signal != null, "request has not been sent", "UNSUPPORTED_OPERATION", { operation: "fetchRequest.cancel" }); - const signal = fetchSignals.get(this); - if (!signal) { - throw new Error("missing signal; should not happen"); - } - signal(); - } - /** - * Returns a new [[FetchRequest]] that represents the redirection - * to %%location%%. - */ - redirect(location) { - // Redirection; for now we only support absolute locations - const current = this.url.split(":")[0].toLowerCase(); - const target = location.split(":")[0].toLowerCase(); - // Don't allow redirecting: - // - non-GET requests - // - downgrading the security (e.g. https => http) - // - to non-HTTP (or non-HTTPS) protocols [this could be relaxed?] - assert(this.method === "GET" && (current !== "https" || target !== "http") && location.match(/^https?:/), `unsupported redirect`, "UNSUPPORTED_OPERATION", { - operation: `redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(location)})` - }); - // Create a copy of this request, with a new URL - const req = new FetchRequest(location); - req.method = "GET"; - req.allowGzip = this.allowGzip; - req.timeout = this.timeout; - req.#headers = Object.assign({}, this.#headers); - if (this.#body) { - req.#body = new Uint8Array(this.#body); - } - req.#bodyType = this.#bodyType; - // Do not forward credentials unless on the same domain; only absolute - //req.allowInsecure = false; - // paths are currently supported; may want a way to specify to forward? - //setStore(req.#props, "creds", getStore(this.#pros, "creds")); - return req; - } - /** - * Create a new copy of this request. - */ - clone() { - const clone = new FetchRequest(this.url); - // Preserve "default method" (i.e. null) - clone.#method = this.#method; - // Preserve "default body" with type, copying the Uint8Array is present - if (this.#body) { - clone.#body = this.#body; - } - clone.#bodyType = this.#bodyType; - // Preserve "default headers" - clone.#headers = Object.assign({}, this.#headers); - // Credentials is readonly, so we copy internally - clone.#creds = this.#creds; - if (this.allowGzip) { - clone.allowGzip = true; - } - clone.timeout = this.timeout; - if (this.allowInsecureAuthentication) { - clone.allowInsecureAuthentication = true; - } - clone.#preflight = this.#preflight; - clone.#process = this.#process; - clone.#retry = this.#retry; - clone.#throttle = Object.assign({}, this.#throttle); - clone.#getUrlFunc = this.#getUrlFunc; - return clone; - } - /** - * Locks all static configuration for gateways and FetchGetUrlFunc - * registration. - */ - static lockConfig() { - locked = true; - } - /** - * Get the current Gateway function for %%scheme%%. - */ - static getGateway(scheme) { - return Gateways[scheme.toLowerCase()] || null; - } - /** - * Use the %%func%% when fetching URIs using %%scheme%%. - * - * This method affects all requests globally. - * - * If [[lockConfig]] has been called, no change is made and this - * throws. - */ - static registerGateway(scheme, func) { - scheme = scheme.toLowerCase(); - if (scheme === "http" || scheme === "https") { - throw new Error(`cannot intercept ${scheme}; use registerGetUrl`); - } - if (locked) { - throw new Error("gateways locked"); - } - Gateways[scheme] = func; - } - /** - * Use %%getUrl%% when fetching URIs over HTTP and HTTPS requests. - * - * This method affects all requests globally. - * - * If [[lockConfig]] has been called, no change is made and this - * throws. - */ - static registerGetUrl(getUrl) { - if (locked) { - throw new Error("gateways locked"); - } - defaultGetUrlFunc = getUrl; - } - /** - * Creates a getUrl function that fetches content from HTTP and - * HTTPS URLs. - * - * The available %%options%% are dependent on the platform - * implementation of the default getUrl function. - * - * This is not generally something that is needed, but is useful - * when trying to customize simple behaviour when fetching HTTP - * content. - */ - static createGetUrlFunc(options) { - return createGetUrl(options); - } - /** - * Creates a function that can "fetch" data URIs. - * - * Note that this is automatically done internally to support - * data URIs, so it is not necessary to register it. - * - * This is not generally something that is needed, but may - * be useful in a wrapper to perfom custom data URI functionality. - */ - static createDataGateway() { - return dataGatewayFunc; - } - /** - * Creates a function that will fetch IPFS (unvalidated) from - * a custom gateway baseUrl. - * - * The default IPFS gateway used internally is - * ``"https:/\/gateway.ipfs.io/ipfs/"``. - */ - static createIpfsGatewayFunc(baseUrl) { - return getIpfsGatewayFunc(baseUrl); - } -} -; -/** - * The response for a FetchRequest. - */ -export class FetchResponse { - #statusCode; - #statusMessage; - #headers; - #body; - #request; - #error; - toString() { - return ``; - } - /** - * The response status code. - */ - get statusCode() { return this.#statusCode; } - /** - * The response status message. - */ - get statusMessage() { return this.#statusMessage; } - /** - * The response headers. All keys are lower-case. - */ - get headers() { return Object.assign({}, this.#headers); } - /** - * The response body, or ``null`` if there was no body. - */ - get body() { - return (this.#body == null) ? null : new Uint8Array(this.#body); - } - /** - * The response body as a UTF-8 encoded string, or the empty - * string (i.e. ``""``) if there was no body. - * - * An error is thrown if the body is invalid UTF-8 data. - */ - get bodyText() { - try { - return (this.#body == null) ? "" : toUtf8String(this.#body); - } - catch (error) { - assert(false, "response body is not valid UTF-8 data", "UNSUPPORTED_OPERATION", { - operation: "bodyText", info: { response: this } - }); - } - } - /** - * The response body, decoded as JSON. - * - * An error is thrown if the body is invalid JSON-encoded data - * or if there was no body. - */ - get bodyJson() { - try { - return JSON.parse(this.bodyText); - } - catch (error) { - assert(false, "response body is not valid JSON", "UNSUPPORTED_OPERATION", { - operation: "bodyJson", info: { response: this } - }); - } - } - [Symbol.iterator]() { - const headers = this.headers; - const keys = Object.keys(headers); - let index = 0; - return { - next: () => { - if (index < keys.length) { - const key = keys[index++]; - return { - value: [key, headers[key]], done: false - }; - } - return { value: undefined, done: true }; - } - }; - } - constructor(statusCode, statusMessage, headers, body, request) { - this.#statusCode = statusCode; - this.#statusMessage = statusMessage; - this.#headers = Object.keys(headers).reduce((accum, k) => { - accum[k.toLowerCase()] = String(headers[k]); - return accum; - }, {}); - this.#body = ((body == null) ? null : new Uint8Array(body)); - this.#request = (request || null); - this.#error = { message: "" }; - } - /** - * Return a Response with matching headers and body, but with - * an error status code (i.e. 599) and %%message%% with an - * optional %%error%%. - */ - makeServerError(message, error) { - let statusMessage; - if (!message) { - message = `${this.statusCode} ${this.statusMessage}`; - statusMessage = `CLIENT ESCALATED SERVER ERROR (${message})`; - } - else { - statusMessage = `CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${message})`; - } - const response = new FetchResponse(599, statusMessage, this.headers, this.body, this.#request || undefined); - response.#error = { message, error }; - return response; - } - /** - * If called within a [request.processFunc](FetchRequest-processFunc) - * call, causes the request to retry as if throttled for %%stall%% - * milliseconds. - */ - throwThrottleError(message, stall) { - if (stall == null) { - stall = -1; - } - else { - assertArgument(Number.isInteger(stall) && stall >= 0, "invalid stall timeout", "stall", stall); - } - const error = new Error(message || "throttling requests"); - defineProperties(error, { stall, throttle: true }); - throw error; - } - /** - * Get the header value for %%key%%, ignoring case. - */ - getHeader(key) { - return this.headers[key.toLowerCase()]; - } - /** - * Returns true if the response has a body. - */ - hasBody() { - return (this.#body != null); - } - /** - * The request made for this response. - */ - get request() { return this.#request; } - /** - * Returns true if this response was a success statusCode. - */ - ok() { - return (this.#error.message === "" && this.statusCode >= 200 && this.statusCode < 300); - } - /** - * Throws a ``SERVER_ERROR`` if this response is not ok. - */ - assertOk() { - if (this.ok()) { - return; - } - let { message, error } = this.#error; - if (message === "") { - message = `server response ${this.statusCode} ${this.statusMessage}`; - } - let requestUrl = null; - if (this.request) { - requestUrl = this.request.url; - } - let responseBody = null; - try { - if (this.#body) { - responseBody = toUtf8String(this.#body); - } - } - catch (e) { } - assert(false, message, "SERVER_ERROR", { - request: (this.request || "unknown request"), response: this, error, - info: { - requestUrl, responseBody, - responseStatus: `${this.statusCode} ${this.statusMessage}` - } - }); - } -} -function getTime() { return (new Date()).getTime(); } -function unpercent(value) { - return toUtf8Bytes(value.replace(/%([0-9a-f][0-9a-f])/gi, (all, code) => { - return String.fromCharCode(parseInt(code, 16)); - })); -} -function wait(delay) { - return new Promise((resolve) => setTimeout(resolve, delay)); -} -//# sourceMappingURL=fetch.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/fetch.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/fetch.js.map deleted file mode 100644 index 061d8100..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/fetch.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../src.ts/utils/fetch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAkD3C,MAAM,YAAY,GAAG,EAAE,CAAC;AACxB,MAAM,aAAa,GAAG,GAAG,CAAC;AAE1B,6CAA6C;AAC7C,IAAI,iBAAiB,GAAoB,YAAY,EAAE,CAAC;AAExD,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,iCAAiC,EAAE,GAAG,CAAC,CAAC;AAClE,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,wBAAwB,EAAE,GAAG,CAAC,CAAC;AAEzD,0CAA0C;AAC1C,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,6EAA6E;AAC7E,KAAK,UAAU,eAAe,CAAC,GAAW,EAAE,MAA0B;IAClE,IAAI;QACA,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAChC,IAAI,CAAC,KAAK,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAC;SAAE;QAChD,OAAO,IAAI,aAAa,CAAC,GAAG,EAAE,I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,EAAE,CAAC,CAAC,CAAC;AAE7D,SAAS,SAAS,CAAC,KAAa;IAC5B,OAAO,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,uBAAuB,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;QACpE,OAAO,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC,CAAC;AACR,CAAC;AAED,SAAS,IAAI,CAAC,KAAa;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;AAChE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/fixednumber.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/fixednumber.d.ts deleted file mode 100644 index 20c8b837..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/fixednumber.d.ts +++ /dev/null @@ -1,252 +0,0 @@ -import type { BigNumberish, BytesLike, Numeric } from "./index.js"; -/** - * A description of a fixed-point arithmetic field. - * - * When specifying the fixed format, the values override the default of - * a ``fixed128x18``, which implies a signed 128-bit value with 18 - * decimals of precision. - * - * The alias ``fixed`` and ``ufixed`` can be used for ``fixed128x18`` and - * ``ufixed128x18`` respectively. - * - * When a fixed format string begins with a ``u``, it indicates the field - * is unsigned, so any negative values will overflow. The first number - * indicates the bit-width and the second number indicates the decimal - * precision. - * - * When a ``number`` is used for a fixed format, it indicates the number - * of decimal places, and the default width and signed-ness will be used. - * - * The bit-width must be byte aligned and the decimals can be at most 80. - */ -export type FixedFormat = number | string | { - signed?: boolean; - width?: number; - decimals?: number; -}; -/** - * A FixedNumber represents a value over its [[FixedFormat]] - * arithmetic field. - * - * A FixedNumber can be used to perform math, losslessly, on - * values which have decmial places. - * - * A FixedNumber has a fixed bit-width to store values in, and stores all - * values internally by multiplying the value by 10 raised to the power of - * %%decimals%%. - * - * If operations are performed that cause a value to grow too high (close to - * positive infinity) or too low (close to negative infinity), the value - * is said to //overflow//. - * - * For example, an 8-bit signed value, with 0 decimals may only be within - * the range ``-128`` to ``127``; so ``-128 - 1`` will overflow and become - * ``127``. Likewise, ``127 + 1`` will overflow and become ``-127``. - * - * Many operation have a normal and //unsafe// variant. The normal variant - * will throw a [[NumericFaultError]] on any overflow, while the //unsafe// - * variant will silently allow overflow, corrupting its value value. - * - * If operations are performed that cause a value to become too small - * (close to zero), the value loses precison and is said to //underflow//. - * - * For example, a value with 1 decimal place may store a number as small - * as ``0.1``, but the value of ``0.1 / 2`` is ``0.05``, which cannot fit - * into 1 decimal place, so underflow occurs which means precision is lost - * and the value becomes ``0``. - * - * Some operations have a normal and //signalling// variant. The normal - * variant will silently ignore underflow, while the //signalling// variant - * will thow a [[NumericFaultError]] on underflow. - */ -export declare class FixedNumber { - #private; - /** - * The specific fixed-point arithmetic field for this value. - */ - readonly format: string; - /** - * This is a property so console.log shows a human-meaningful value. - * - * @private - */ - readonly _value: string; - /** - * @private - */ - constructor(guard: any, value: bigint, format: any); - /** - * If true, negative values are permitted, otherwise only - * positive values and zero are allowed. - */ - get signed(): boolean; - /** - * The number of bits available to store the value. - */ - get width(): number; - /** - * The number of decimal places in the fixed-point arithment field. - */ - get decimals(): number; - /** - * The value as an integer, based on the smallest unit the - * [[decimals]] allow. - */ - get value(): bigint; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% added - * to %%other%%, ignoring overflow. - */ - addUnsafe(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% added - * to %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - add(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%other%% subtracted - * from %%this%%, ignoring overflow. - */ - subUnsafe(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%other%% subtracted - * from %%this%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - sub(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%, ignoring overflow and underflow (precision loss). - */ - mulUnsafe(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - mul(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs or if underflow (precision loss) occurs. - */ - mulSignal(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%, ignoring underflow (precision loss). A - * [[NumericFaultError]] is thrown if overflow occurs. - */ - divUnsafe(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%, ignoring underflow (precision loss). A - * [[NumericFaultError]] is thrown if overflow occurs. - */ - div(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%. A [[NumericFaultError]] is thrown if underflow - * (precision loss) occurs. - */ - divSignal(other: FixedNumber): FixedNumber; - /** - * Returns a comparison result between %%this%% and %%other%%. - * - * This is suitable for use in sorting, where ``-1`` implies %%this%% - * is smaller, ``1`` implies %%this%% is larger and ``0`` implies - * both are equal. - */ - cmp(other: FixedNumber): number; - /** - * Returns true if %%other%% is equal to %%this%%. - */ - eq(other: FixedNumber): boolean; - /** - * Returns true if %%other%% is less than to %%this%%. - */ - lt(other: FixedNumber): boolean; - /** - * Returns true if %%other%% is less than or equal to %%this%%. - */ - lte(other: FixedNumber): boolean; - /** - * Returns true if %%other%% is greater than to %%this%%. - */ - gt(other: FixedNumber): boolean; - /** - * Returns true if %%other%% is greater than or equal to %%this%%. - */ - gte(other: FixedNumber): boolean; - /** - * Returns a new [[FixedNumber]] which is the largest **integer** - * that is less than or equal to %%this%%. - * - * The decimal component of the result will always be ``0``. - */ - floor(): FixedNumber; - /** - * Returns a new [[FixedNumber]] which is the smallest **integer** - * that is greater than or equal to %%this%%. - * - * The decimal component of the result will always be ``0``. - */ - ceiling(): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the decimal component - * rounded up on ties at %%decimals%% places. - */ - round(decimals?: number): FixedNumber; - /** - * Returns true if %%this%% is equal to ``0``. - */ - isZero(): boolean; - /** - * Returns true if %%this%% is less than ``0``. - */ - isNegative(): boolean; - /** - * Returns the string representation of %%this%%. - */ - toString(): string; - /** - * Returns a float approximation. - * - * Due to IEEE 754 precission (or lack thereof), this function - * can only return an approximation and most values will contain - * rounding errors. - */ - toUnsafeFloat(): number; - /** - * Return a new [[FixedNumber]] with the same value but has had - * its field set to %%format%%. - * - * This will throw if the value cannot fit into %%format%%. - */ - toFormat(format: FixedFormat): FixedNumber; - /** - * Creates a new [[FixedNumber]] for %%value%% divided by - * %%decimal%% places with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% (once adjusted - * for %%decimals%%) cannot fit in %%format%%, either due to overflow - * or underflow (precision loss). - */ - static fromValue(_value: BigNumberish, _decimals?: Numeric, _format?: FixedFormat): FixedNumber; - /** - * Creates a new [[FixedNumber]] for %%value%% with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% cannot fit - * in %%format%%, either due to overflow or underflow (precision loss). - */ - static fromString(_value: string, _format?: FixedFormat): FixedNumber; - /** - * Creates a new [[FixedNumber]] with the big-endian representation - * %%value%% with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% cannot fit - * in %%format%% due to overflow. - */ - static fromBytes(_value: BytesLike, _format?: FixedFormat): FixedNumber; -} -//# sourceMappingURL=fixednumber.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/fixednumber.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/fixednumber.d.ts.map deleted file mode 100644 index b34cc64f..00000000 --- a/tools/mnemonic-test/node_modules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AU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,WAAW;IA0BrE;;;;;;OAMG;IACH,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,WAAW;CAU1E"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/fixednumber.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/fixednumber.js deleted file mode 100644 index bfb391d9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/fixednumber.js +++ /dev/null @@ -1,526 +0,0 @@ -/** - * The **FixedNumber** class permits using values with decimal places, - * using fixed-pont math. - * - * Fixed-point math is still based on integers under-the-hood, but uses an - * internal offset to store fractional components below, and each operation - * corrects for this after each operation. - * - * @_section: api/utils/fixed-point-math:Fixed-Point Maths [about-fixed-point-math] - */ -import { getBytes } from "./data.js"; -import { assert, assertArgument, assertPrivate } from "./errors.js"; -import { getBigInt, getNumber, fromTwos, mask, toBigInt } from "./maths.js"; -import { defineProperties } from "./properties.js"; -const BN_N1 = BigInt(-1); -const BN_0 = BigInt(0); -const BN_1 = BigInt(1); -const BN_5 = BigInt(5); -const _guard = {}; -// Constant to pull zeros from for multipliers -let Zeros = "0000"; -while (Zeros.length < 80) { - Zeros += Zeros; -} -// Returns a string "1" followed by decimal "0"s -function getTens(decimals) { - let result = Zeros; - while (result.length < decimals) { - result += result; - } - return BigInt("1" + result.substring(0, decimals)); -} -function checkValue(val, format, safeOp) { - const width = BigInt(format.width); - if (format.signed) { - const limit = (BN_1 << (width - BN_1)); - assert(safeOp == null || (val >= -limit && val < limit), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - if (val > BN_0) { - val = fromTwos(mask(val, width), width); - } - else { - val = -fromTwos(mask(-val, width), width); - } - } - else { - const limit = (BN_1 << width); - assert(safeOp == null || (val >= 0 && val < limit), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - val = (((val % limit) + limit) % limit) & (limit - BN_1); - } - return val; -} -function getFormat(value) { - if (typeof (value) === "number") { - value = `fixed128x${value}`; - } - let signed = true; - let width = 128; - let decimals = 18; - if (typeof (value) === "string") { - // Parse the format string - if (value === "fixed") { - // defaults... - } - else if (value === "ufixed") { - signed = false; - } - else { - const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/); - assertArgument(match, "invalid fixed format", "format", value); - signed = (match[1] !== "u"); - width = parseInt(match[2]); - decimals = parseInt(match[3]); - } - } - else if (value) { - // Extract the values from the object - const v = value; - const check = (key, type, defaultValue) => { - if (v[key] == null) { - return defaultValue; - } - assertArgument(typeof (v[key]) === type, "invalid fixed format (" + key + " not " + type + ")", "format." + key, v[key]); - return v[key]; - }; - signed = check("signed", "boolean", signed); - width = check("width", "number", width); - decimals = check("decimals", "number", decimals); - } - assertArgument((width % 8) === 0, "invalid FixedNumber width (not byte aligned)", "format.width", width); - assertArgument(decimals <= 80, "invalid FixedNumber decimals (too large)", "format.decimals", decimals); - const name = (signed ? "" : "u") + "fixed" + String(width) + "x" + String(decimals); - return { signed, width, decimals, name }; -} -function toString(val, decimals) { - let negative = ""; - if (val < BN_0) { - negative = "-"; - val *= BN_N1; - } - let str = val.toString(); - // No decimal point for whole values - if (decimals === 0) { - return (negative + str); - } - // Pad out to the whole component (including a whole digit) - while (str.length <= decimals) { - str = Zeros + str; - } - // Insert the decimal point - const index = str.length - decimals; - str = str.substring(0, index) + "." + str.substring(index); - // Trim the whole component (leaving at least one 0) - while (str[0] === "0" && str[1] !== ".") { - str = str.substring(1); - } - // Trim the decimal component (leaving at least one 0) - while (str[str.length - 1] === "0" && str[str.length - 2] !== ".") { - str = str.substring(0, str.length - 1); - } - return (negative + str); -} -/** - * A FixedNumber represents a value over its [[FixedFormat]] - * arithmetic field. - * - * A FixedNumber can be used to perform math, losslessly, on - * values which have decmial places. - * - * A FixedNumber has a fixed bit-width to store values in, and stores all - * values internally by multiplying the value by 10 raised to the power of - * %%decimals%%. - * - * If operations are performed that cause a value to grow too high (close to - * positive infinity) or too low (close to negative infinity), the value - * is said to //overflow//. - * - * For example, an 8-bit signed value, with 0 decimals may only be within - * the range ``-128`` to ``127``; so ``-128 - 1`` will overflow and become - * ``127``. Likewise, ``127 + 1`` will overflow and become ``-127``. - * - * Many operation have a normal and //unsafe// variant. The normal variant - * will throw a [[NumericFaultError]] on any overflow, while the //unsafe// - * variant will silently allow overflow, corrupting its value value. - * - * If operations are performed that cause a value to become too small - * (close to zero), the value loses precison and is said to //underflow//. - * - * For example, a value with 1 decimal place may store a number as small - * as ``0.1``, but the value of ``0.1 / 2`` is ``0.05``, which cannot fit - * into 1 decimal place, so underflow occurs which means precision is lost - * and the value becomes ``0``. - * - * Some operations have a normal and //signalling// variant. The normal - * variant will silently ignore underflow, while the //signalling// variant - * will thow a [[NumericFaultError]] on underflow. - */ -export class FixedNumber { - /** - * The specific fixed-point arithmetic field for this value. - */ - format; - #format; - // The actual value (accounting for decimals) - #val; - // A base-10 value to multiple values by to maintain the magnitude - #tens; - /** - * This is a property so console.log shows a human-meaningful value. - * - * @private - */ - _value; - // Use this when changing this file to get some typing info, - // but then switch to any to mask the internal type - //constructor(guard: any, value: bigint, format: _FixedFormat) { - /** - * @private - */ - constructor(guard, value, format) { - assertPrivate(guard, _guard, "FixedNumber"); - this.#val = value; - this.#format = format; - const _value = toString(value, format.decimals); - defineProperties(this, { format: format.name, _value }); - this.#tens = getTens(format.decimals); - } - /** - * If true, negative values are permitted, otherwise only - * positive values and zero are allowed. - */ - get signed() { return this.#format.signed; } - /** - * The number of bits available to store the value. - */ - get width() { return this.#format.width; } - /** - * The number of decimal places in the fixed-point arithment field. - */ - get decimals() { return this.#format.decimals; } - /** - * The value as an integer, based on the smallest unit the - * [[decimals]] allow. - */ - get value() { return this.#val; } - #checkFormat(other) { - assertArgument(this.format === other.format, "incompatible format; use fixedNumber.toFormat", "other", other); - } - #checkValue(val, safeOp) { - /* - const width = BigInt(this.width); - if (this.signed) { - const limit = (BN_1 << (width - BN_1)); - assert(safeOp == null || (val >= -limit && val < limit), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - - if (val > BN_0) { - val = fromTwos(mask(val, width), width); - } else { - val = -fromTwos(mask(-val, width), width); - } - - } else { - const masked = mask(val, width); - assert(safeOp == null || (val >= 0 && val === masked), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - val = masked; - } - */ - val = checkValue(val, this.#format, safeOp); - return new FixedNumber(_guard, val, this.#format); - } - #add(o, safeOp) { - this.#checkFormat(o); - return this.#checkValue(this.#val + o.#val, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% added - * to %%other%%, ignoring overflow. - */ - addUnsafe(other) { return this.#add(other); } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% added - * to %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - add(other) { return this.#add(other, "add"); } - #sub(o, safeOp) { - this.#checkFormat(o); - return this.#checkValue(this.#val - o.#val, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%other%% subtracted - * from %%this%%, ignoring overflow. - */ - subUnsafe(other) { return this.#sub(other); } - /** - * Returns a new [[FixedNumber]] with the result of %%other%% subtracted - * from %%this%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - sub(other) { return this.#sub(other, "sub"); } - #mul(o, safeOp) { - this.#checkFormat(o); - return this.#checkValue((this.#val * o.#val) / this.#tens, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%, ignoring overflow and underflow (precision loss). - */ - mulUnsafe(other) { return this.#mul(other); } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - mul(other) { return this.#mul(other, "mul"); } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs or if underflow (precision loss) occurs. - */ - mulSignal(other) { - this.#checkFormat(other); - const value = this.#val * other.#val; - assert((value % this.#tens) === BN_0, "precision lost during signalling mul", "NUMERIC_FAULT", { - operation: "mulSignal", fault: "underflow", value: this - }); - return this.#checkValue(value / this.#tens, "mulSignal"); - } - #div(o, safeOp) { - assert(o.#val !== BN_0, "division by zero", "NUMERIC_FAULT", { - operation: "div", fault: "divide-by-zero", value: this - }); - this.#checkFormat(o); - return this.#checkValue((this.#val * this.#tens) / o.#val, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%, ignoring underflow (precision loss). A - * [[NumericFaultError]] is thrown if overflow occurs. - */ - divUnsafe(other) { return this.#div(other); } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%, ignoring underflow (precision loss). A - * [[NumericFaultError]] is thrown if overflow occurs. - */ - div(other) { return this.#div(other, "div"); } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%. A [[NumericFaultError]] is thrown if underflow - * (precision loss) occurs. - */ - divSignal(other) { - assert(other.#val !== BN_0, "division by zero", "NUMERIC_FAULT", { - operation: "div", fault: "divide-by-zero", value: this - }); - this.#checkFormat(other); - const value = (this.#val * this.#tens); - assert((value % other.#val) === BN_0, "precision lost during signalling div", "NUMERIC_FAULT", { - operation: "divSignal", fault: "underflow", value: this - }); - return this.#checkValue(value / other.#val, "divSignal"); - } - /** - * Returns a comparison result between %%this%% and %%other%%. - * - * This is suitable for use in sorting, where ``-1`` implies %%this%% - * is smaller, ``1`` implies %%this%% is larger and ``0`` implies - * both are equal. - */ - cmp(other) { - let a = this.value, b = other.value; - // Coerce a and b to the same magnitude - const delta = this.decimals - other.decimals; - if (delta > 0) { - b *= getTens(delta); - } - else if (delta < 0) { - a *= getTens(-delta); - } - // Comnpare - if (a < b) { - return -1; - } - if (a > b) { - return 1; - } - return 0; - } - /** - * Returns true if %%other%% is equal to %%this%%. - */ - eq(other) { return this.cmp(other) === 0; } - /** - * Returns true if %%other%% is less than to %%this%%. - */ - lt(other) { return this.cmp(other) < 0; } - /** - * Returns true if %%other%% is less than or equal to %%this%%. - */ - lte(other) { return this.cmp(other) <= 0; } - /** - * Returns true if %%other%% is greater than to %%this%%. - */ - gt(other) { return this.cmp(other) > 0; } - /** - * Returns true if %%other%% is greater than or equal to %%this%%. - */ - gte(other) { return this.cmp(other) >= 0; } - /** - * Returns a new [[FixedNumber]] which is the largest **integer** - * that is less than or equal to %%this%%. - * - * The decimal component of the result will always be ``0``. - */ - floor() { - let val = this.#val; - if (this.#val < BN_0) { - val -= this.#tens - BN_1; - } - val = (this.#val / this.#tens) * this.#tens; - return this.#checkValue(val, "floor"); - } - /** - * Returns a new [[FixedNumber]] which is the smallest **integer** - * that is greater than or equal to %%this%%. - * - * The decimal component of the result will always be ``0``. - */ - ceiling() { - let val = this.#val; - if (this.#val > BN_0) { - val += this.#tens - BN_1; - } - val = (this.#val / this.#tens) * this.#tens; - return this.#checkValue(val, "ceiling"); - } - /** - * Returns a new [[FixedNumber]] with the decimal component - * rounded up on ties at %%decimals%% places. - */ - round(decimals) { - if (decimals == null) { - decimals = 0; - } - // Not enough precision to not already be rounded - if (decimals >= this.decimals) { - return this; - } - const delta = this.decimals - decimals; - const bump = BN_5 * getTens(delta - 1); - let value = this.value + bump; - const tens = getTens(delta); - value = (value / tens) * tens; - checkValue(value, this.#format, "round"); - return new FixedNumber(_guard, value, this.#format); - } - /** - * Returns true if %%this%% is equal to ``0``. - */ - isZero() { return (this.#val === BN_0); } - /** - * Returns true if %%this%% is less than ``0``. - */ - isNegative() { return (this.#val < BN_0); } - /** - * Returns the string representation of %%this%%. - */ - toString() { return this._value; } - /** - * Returns a float approximation. - * - * Due to IEEE 754 precission (or lack thereof), this function - * can only return an approximation and most values will contain - * rounding errors. - */ - toUnsafeFloat() { return parseFloat(this.toString()); } - /** - * Return a new [[FixedNumber]] with the same value but has had - * its field set to %%format%%. - * - * This will throw if the value cannot fit into %%format%%. - */ - toFormat(format) { - return FixedNumber.fromString(this.toString(), format); - } - /** - * Creates a new [[FixedNumber]] for %%value%% divided by - * %%decimal%% places with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% (once adjusted - * for %%decimals%%) cannot fit in %%format%%, either due to overflow - * or underflow (precision loss). - */ - static fromValue(_value, _decimals, _format) { - const decimals = (_decimals == null) ? 0 : getNumber(_decimals); - const format = getFormat(_format); - let value = getBigInt(_value, "value"); - const delta = decimals - format.decimals; - if (delta > 0) { - const tens = getTens(delta); - assert((value % tens) === BN_0, "value loses precision for format", "NUMERIC_FAULT", { - operation: "fromValue", fault: "underflow", value: _value - }); - value /= tens; - } - else if (delta < 0) { - value *= getTens(-delta); - } - checkValue(value, format, "fromValue"); - return new FixedNumber(_guard, value, format); - } - /** - * Creates a new [[FixedNumber]] for %%value%% with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% cannot fit - * in %%format%%, either due to overflow or underflow (precision loss). - */ - static fromString(_value, _format) { - const match = _value.match(/^(-?)([0-9]*)\.?([0-9]*)$/); - assertArgument(match && (match[2].length + match[3].length) > 0, "invalid FixedNumber string value", "value", _value); - const format = getFormat(_format); - let whole = (match[2] || "0"), decimal = (match[3] || ""); - // Pad out the decimals - while (decimal.length < format.decimals) { - decimal += Zeros; - } - // Check precision is safe - assert(decimal.substring(format.decimals).match(/^0*$/), "too many decimals for format", "NUMERIC_FAULT", { - operation: "fromString", fault: "underflow", value: _value - }); - // Remove extra padding - decimal = decimal.substring(0, format.decimals); - const value = BigInt(match[1] + whole + decimal); - checkValue(value, format, "fromString"); - return new FixedNumber(_guard, value, format); - } - /** - * Creates a new [[FixedNumber]] with the big-endian representation - * %%value%% with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% cannot fit - * in %%format%% due to overflow. - */ - static fromBytes(_value, _format) { - let value = toBigInt(getBytes(_value, "value")); - const format = getFormat(_format); - if (format.signed) { - value = fromTwos(value, format.width); - } - checkValue(value, format, "fromBytes"); - return new FixedNumber(_guard, value, format); - } -} -//const f1 = FixedNumber.fromString("12.56", "fixed16x2"); -//const f2 = FixedNumber.fromString("0.3", "fixed16x2"); -//console.log(f1.divSignal(f2)); -//const BUMP = FixedNumber.from("0.5"); -//# sourceMappingURL=fixednumber.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/fixednumber.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/fixednumber.js.map deleted file mode 100644 index b70aeeff..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/fixednumber.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fixednumber.js","sourceRoot":"","sources":["../../src.ts/utils/fixednumber.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACpE,OAAO,EACH,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EACjD,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAInD,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACzB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAEvB,MAAM,MAAM,GAAG,EAAG,CAAC;AAGnB,8CAA8C;AAC9C,IAAI,KAAK,GAAG,MAAM,CAAC;AACnB,OAAO,KAAK,CAAC,MAAM,GAAG,EAAE,EAAE;IAAE,KAAK,IAAI,KAAK,CAAC;CAAE;AAE7C,gDAAgD;AAChD,SAAS,OAAO,CAAC,QAAgB;IAC7B,IAAI,MAAM,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O,IAAI,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IAClD,CAAC;CACJ;AAED,0DAA0D;AAC1D,wDAAwD;AACxD,gCAAgC;AAChC,uCAAuC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/geturl-browser.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/geturl-browser.d.ts deleted file mode 100644 index 9b2cbe7b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/geturl-browser.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { FetchGetUrlFunc, FetchRequest, FetchCancelSignal, GetUrlResponse } from "./fetch.js"; -export declare function createGetUrl(options?: Record): FetchGetUrlFunc; -export declare function getUrl(req: FetchRequest, _signal?: FetchCancelSignal): Promise; -//# sourceMappingURL=geturl-browser.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/geturl-browser.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/geturl-browser.d.ts.map deleted file mode 100644 index 00bd40b7..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/geturl-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"geturl-browser.d.ts","sourceRoot":"","sources":["../../src.ts/utils/geturl-browser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACR,eAAe,EAAE,YAAY,EAAE,iBAAiB,EAAE,cAAc,EACnE,MAAM,YAAY,CAAC;AAEpB,wBAAgB,YAAY,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,eAAe,CAkE3E;AAKD,wBAAsB,MAAM,CAAC,GAAG,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,CAAC,CAEpG"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/geturl-browser.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/geturl-browser.js deleted file mode 100644 index 8e171883..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/geturl-browser.js +++ /dev/null @@ -1,62 +0,0 @@ -import { assert, makeError } from "./errors.js"; -export function createGetUrl(options) { - async function getUrl(req, _signal) { - assert(_signal == null || !_signal.cancelled, "request cancelled before sending", "CANCELLED"); - const protocol = req.url.split(":")[0].toLowerCase(); - assert(protocol === "http" || protocol === "https", `unsupported protocol ${protocol}`, "UNSUPPORTED_OPERATION", { - info: { protocol }, - operation: "request" - }); - assert(protocol === "https" || !req.credentials || req.allowInsecureAuthentication, "insecure authorized connections unsupported", "UNSUPPORTED_OPERATION", { - operation: "request" - }); - let error = null; - const controller = new AbortController(); - const timer = setTimeout(() => { - error = makeError("request timeout", "TIMEOUT"); - controller.abort(); - }, req.timeout); - if (_signal) { - _signal.addListener(() => { - error = makeError("request cancelled", "CANCELLED"); - controller.abort(); - }); - } - const init = Object.assign({}, options, { - method: req.method, - headers: new Headers(Array.from(req)), - body: req.body || undefined, - signal: controller.signal - }); - let resp; - try { - resp = await fetch(req.url, init); - } - catch (_error) { - clearTimeout(timer); - if (error) { - throw error; - } - throw _error; - } - clearTimeout(timer); - const headers = {}; - resp.headers.forEach((value, key) => { - headers[key.toLowerCase()] = value; - }); - const respBody = await resp.arrayBuffer(); - const body = (respBody == null) ? null : new Uint8Array(respBody); - return { - statusCode: resp.status, - statusMessage: resp.statusText, - headers, body - }; - } - return getUrl; -} -// @TODO: remove in v7; provided for backwards compat -const defaultGetUrl = createGetUrl({}); -export async function getUrl(req, _signal) { - return defaultGetUrl(req, _signal); -} -//# sourceMappingURL=geturl-browser.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/geturl-browser.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/geturl-browser.js.map deleted file mode 100644 index ec61708f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm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;IAED,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,qDAAqD;AACrD,MAAM,aAAa,GAAoB,YAAY,CAAC,EAAG,CAAC,CAAC;AAEzD,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,GAAiB,EAAE,OAA2B;IACvE,OAAO,aAAa,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AACvC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/geturl.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/geturl.d.ts deleted file mode 100644 index 8d0d9783..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/geturl.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { FetchGetUrlFunc, FetchRequest, FetchCancelSignal, GetUrlResponse } from "./fetch.js"; -/** - * @_ignore: - */ -export declare function createGetUrl(options?: Record): FetchGetUrlFunc; -/** - * @_ignore: - */ -export declare function getUrl(req: FetchRequest, signal?: FetchCancelSignal): Promise; -//# sourceMappingURL=geturl.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/geturl.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/geturl.d.ts.map deleted file mode 100644 index 6770ee5b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/geturl.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"geturl.d.ts","sourceRoot":"","sources":["../../src.ts/utils/geturl.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACR,eAAe,EAAE,YAAY,EAAE,iBAAiB,EAAE,cAAc,EACnE,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,eAAe,CAmH3E;AAKD;;GAEG;AACH,wBAAsB,MAAM,CAAC,GAAG,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,CAAC,CAEnG"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/geturl.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/geturl.js deleted file mode 100644 index e109aeca..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/geturl.js +++ /dev/null @@ -1,121 +0,0 @@ -import http from "http"; -import https from "https"; -import { gunzipSync } from "zlib"; -import { assert, makeError } from "./errors.js"; -import { getBytes } from "./data.js"; -/** - * @_ignore: - */ -export function createGetUrl(options) { - async function getUrl(req, signal) { - // Make sure we weren't cancelled before sending - assert(signal == null || !signal.cancelled, "request cancelled before sending", "CANCELLED"); - const protocol = req.url.split(":")[0].toLowerCase(); - assert(protocol === "http" || protocol === "https", `unsupported protocol ${protocol}`, "UNSUPPORTED_OPERATION", { - info: { protocol }, - operation: "request" - }); - assert(protocol === "https" || !req.credentials || req.allowInsecureAuthentication, "insecure authorized connections unsupported", "UNSUPPORTED_OPERATION", { - operation: "request" - }); - const method = req.method; - const headers = Object.assign({}, req.headers); - const reqOptions = { method, headers }; - if (options) { - if (options.agent) { - reqOptions.agent = options.agent; - } - } - // Create a Node-specific AbortController, if available - let abort = null; - try { - abort = new AbortController(); - reqOptions.abort = abort.signal; - } - catch (e) { - console.log(e); - } - const request = ((protocol === "http") ? http : https).request(req.url, reqOptions); - request.setTimeout(req.timeout); - const body = req.body; - if (body) { - request.write(Buffer.from(body)); - } - request.end(); - return new Promise((resolve, reject) => { - if (signal) { - signal.addListener(() => { - if (abort) { - abort.abort(); - } - reject(makeError("request cancelled", "CANCELLED")); - }); - } - request.on("timeout", () => { - reject(makeError("request timeout", "TIMEOUT")); - }); - request.once("response", (resp) => { - const statusCode = resp.statusCode || 0; - const statusMessage = resp.statusMessage || ""; - const headers = Object.keys(resp.headers || {}).reduce((accum, name) => { - let value = resp.headers[name] || ""; - if (Array.isArray(value)) { - value = value.join(", "); - } - accum[name] = value; - return accum; - }, {}); - let body = null; - //resp.setEncoding("utf8"); - resp.on("data", (chunk) => { - if (signal) { - try { - signal.checkSignal(); - } - catch (error) { - return reject(error); - } - } - if (body == null) { - body = chunk; - } - else { - const newBody = new Uint8Array(body.length + chunk.length); - newBody.set(body, 0); - newBody.set(chunk, body.length); - body = newBody; - } - }); - resp.on("end", () => { - try { - if (headers["content-encoding"] === "gzip" && body) { - body = getBytes(gunzipSync(body)); - } - resolve({ statusCode, statusMessage, headers, body }); - } - catch (error) { - reject(makeError("bad response data", "SERVER_ERROR", { - request: req, info: { response: resp, error } - })); - } - }); - resp.on("error", (error) => { - //@TODO: Should this just return nornal response with a server error? - error.response = { statusCode, statusMessage, headers, body }; - reject(error); - }); - }); - request.on("error", (error) => { reject(error); }); - }); - } - return getUrl; -} -// @TODO: remove in v7; provided for backwards compat -const defaultGetUrl = createGetUrl({}); -/** - * @_ignore: - */ -export async function getUrl(req, signal) { - return defaultGetUrl(req, signal); -} -//# sourceMappingURL=geturl.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/geturl.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/geturl.js.map deleted file mode 100644 index 28d961f6..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/geturl.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"geturl.js","sourceRoot":"","sources":["../../src.ts/utils/geturl.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAMrC;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,OAA6B;IAEtD,KAAK,UAAU,MAAM,CAAC,GAAiB,EAAE,MA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K,EAAE;wBACZ,MAAM,CAAC,SAAS,CAAC,mBAAmB,EAAE,cAAc,EAAE;4BAClD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE;yBAChD,CAAC,CAAC,CAAC;qBACP;gBACL,CAAC,CAAC,CAAC;gBAEH,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;oBAC3B,qEAAqE;oBAC3D,KAAM,CAAC,QAAQ,GAAG,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;oBACrE,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;YAEH,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;IACP,CAAC;IAED,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,qDAAqD;AACrD,MAAM,aAAa,GAAoB,YAAY,CAAC,EAAG,CAAC,CAAC;AAEzD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,GAAiB,EAAE,MAA0B;IACtE,OAAO,aAAa,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;AACtC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/index.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/index.d.ts deleted file mode 100644 index b6d51e0a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/index.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * There are many simple utilities required to interact with - * Ethereum and to simplify the library, without increasing - * the library dependencies for simple functions. - * - * @_section api/utils:Utilities [about-utils] - */ -export { decodeBase58, encodeBase58 } from "./base58.js"; -export { decodeBase64, encodeBase64 } from "./base64.js"; -export { getBytes, getBytesCopy, isHexString, isBytesLike, hexlify, concat, dataLength, dataSlice, stripZerosLeft, zeroPadValue, zeroPadBytes } from "./data.js"; -export { isCallException, isError, assert, assertArgument, assertArgumentCount, assertPrivate, assertNormalize, makeError } from "./errors.js"; -export { EventPayload } from "./events.js"; -export { FetchRequest, FetchResponse, FetchCancelSignal, } from "./fetch.js"; -export { FixedNumber } from "./fixednumber.js"; -export { fromTwos, toTwos, mask, getBigInt, getNumber, getUint, toBigInt, toNumber, toBeHex, toBeArray, toQuantity } from "./maths.js"; -export { resolveProperties, defineProperties } from "./properties.js"; -export { decodeRlp } from "./rlp-decode.js"; -export { encodeRlp } from "./rlp-encode.js"; -export { formatEther, parseEther, formatUnits, parseUnits } from "./units.js"; -export { toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, } from "./utf8.js"; -export { uuidV4 } from "./uuid.js"; -export type { BytesLike } from "./data.js"; -export type { ErrorCode, EthersError, UnknownError, NotImplementedError, UnsupportedOperationError, NetworkError, ServerError, TimeoutError, BadDataError, CancelledError, BufferOverrunError, NumericFaultError, InvalidArgumentError, MissingArgumentError, UnexpectedArgumentError, CallExceptionError, InsufficientFundsError, NonceExpiredError, OffchainFaultError, ReplacementUnderpricedError, TransactionReplacedError, UnconfiguredNameError, ActionRejectedError, CallExceptionAction, CallExceptionTransaction, CodedEthersError } from "./errors.js"; -export type { EventEmitterable, Listener } from "./events.js"; -export type { GetUrlResponse, FetchPreflightFunc, FetchProcessFunc, FetchRetryFunc, FetchGatewayFunc, FetchGetUrlFunc } from "./fetch.js"; -export type { FixedFormat } from "./fixednumber.js"; -export type { BigNumberish, Numeric } from "./maths.js"; -export type { RlpStructuredData, RlpStructuredDataish } from "./rlp.js"; -export type { Utf8ErrorFunc, UnicodeNormalizationForm, Utf8ErrorReason } from "./utf8.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/index.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/index.d.ts.map deleted file mode 100644 index 4290468f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EACH,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EACxF,cAAc,EAAE,YAAY,EAAE,YAAY,EAC7C,MAAM,WAAW,CAAC;AAEnB,OAAO,EACH,eAAe,EAAE,OAAO,EACxB,MAAM,EAAE,cAAc,EAAE,mBAAmB,EAAE,aAAa,EAAE,eAAe,EAAE,SAAS,EACzF,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EACH,YAAY,EAAE,aAAa,EAAE,iBAAiB,GACjD,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EACH,QAAQ,EAAE,MAAM,EAAE,IAAI,EACtB,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EACpF,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AAErE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE9E,OAAO,EACH,WAAW,EACX,gBAAgB,EAChB,YAAY,EAEZ,cAAc,GACjB,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAKnC,YAAY,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,YAAY,EAKR,SAAS,EAET,WAAW,EAAE,YAAY,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,YAAY,EACvF,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAC3E,iBAAiB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,uBAAuB,EACtF,kBAAkB,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,kBAAkB,EACjF,2BAA2B,EAAE,wBAAwB,EAAE,qBAAqB,EAC5E,mBAAmB,EAEnB,mBAAmB,EAAE,wBAAwB,EAE7C,gBAAgB,EACnB,MAAM,aAAa,CAAA;AAEpB,YAAY,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE9D,YAAY,EACR,cAAc,EACd,kBAAkB,EAAE,gBAAgB,EAAE,cAAc,EACpD,gBAAgB,EAAE,eAAe,EACpC,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAEnD,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAExD,YAAY,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAExE,YAAY,EACR,aAAa,EACb,wBAAwB,EACxB,eAAe,EAClB,MAAM,WAAW,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/index.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/index.js deleted file mode 100644 index 080819f8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/index.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * There are many simple utilities required to interact with - * Ethereum and to simplify the library, without increasing - * the library dependencies for simple functions. - * - * @_section api/utils:Utilities [about-utils] - */ -export { decodeBase58, encodeBase58 } from "./base58.js"; -export { decodeBase64, encodeBase64 } from "./base64.js"; -export { getBytes, getBytesCopy, isHexString, isBytesLike, hexlify, concat, dataLength, dataSlice, stripZerosLeft, zeroPadValue, zeroPadBytes } from "./data.js"; -export { isCallException, isError, assert, assertArgument, assertArgumentCount, assertPrivate, assertNormalize, makeError } from "./errors.js"; -export { EventPayload } from "./events.js"; -export { FetchRequest, FetchResponse, FetchCancelSignal, } from "./fetch.js"; -export { FixedNumber } from "./fixednumber.js"; -export { fromTwos, toTwos, mask, getBigInt, getNumber, getUint, toBigInt, toNumber, toBeHex, toBeArray, toQuantity } from "./maths.js"; -export { resolveProperties, defineProperties } from "./properties.js"; -export { decodeRlp } from "./rlp-decode.js"; -export { encodeRlp } from "./rlp-encode.js"; -export { formatEther, parseEther, formatUnits, parseUnits } from "./units.js"; -export { toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, } from "./utf8.js"; -export { uuidV4 } from "./uuid.js"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/index.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/index.js.map deleted file mode 100644 index 3046ebd7..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EACH,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EACxF,cAAc,EAAE,YAAY,EAAE,YAAY,EAC7C,MAAM,WAAW,CAAC;AAEnB,OAAO,EACH,eAAe,EAAE,OAAO,EACxB,MAAM,EAAE,cAAc,EAAE,mBAAmB,EAAE,aAAa,EAAE,eAAe,EAAE,SAAS,EACzF,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EACH,YAAY,EAAE,aAAa,EAAE,iBAAiB,GACjD,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EACH,QAAQ,EAAE,MAAM,EAAE,IAAI,EACtB,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EACpF,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AAErE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE9E,OAAO,EACH,WAAW,EACX,gBAAgB,EAChB,YAAY,EAEZ,cAAc,GACjB,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/maths.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/maths.d.ts deleted file mode 100644 index 24889a16..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/maths.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -import type { BytesLike } from "./data.js"; -/** - * Any type that can be used where a numeric value is needed. - */ -export type Numeric = number | bigint; -/** - * Any type that can be used where a big number is needed. - */ -export type BigNumberish = string | Numeric; -/** - * Convert %%value%% from a twos-compliment representation of %%width%% - * bits to its value. - * - * If the highest bit is ``1``, the result will be negative. - */ -export declare function fromTwos(_value: BigNumberish, _width: Numeric): bigint; -/** - * Convert %%value%% to a twos-compliment representation of - * %%width%% bits. - * - * The result will always be positive. - */ -export declare function toTwos(_value: BigNumberish, _width: Numeric): bigint; -/** - * Mask %%value%% with a bitmask of %%bits%% ones. - */ -export declare function mask(_value: BigNumberish, _bits: Numeric): bigint; -/** - * Gets a BigInt from %%value%%. If it is an invalid value for - * a BigInt, then an ArgumentError will be thrown for %%name%%. - */ -export declare function getBigInt(value: BigNumberish, name?: string): bigint; -/** - * Returns %%value%% as a bigint, validating it is valid as a bigint - * value and that it is positive. - */ -export declare function getUint(value: BigNumberish, name?: string): bigint; -export declare function toBigInt(value: BigNumberish | Uint8Array): bigint; -/** - * Gets a //number// from %%value%%. If it is an invalid value for - * a //number//, then an ArgumentError will be thrown for %%name%%. - */ -export declare function getNumber(value: BigNumberish, name?: string): number; -/** - * Converts %%value%% to a number. If %%value%% is a Uint8Array, it - * is treated as Big Endian data. Throws if the value is not safe. - */ -export declare function toNumber(value: BigNumberish | Uint8Array): number; -/** - * Converts %%value%% to a Big Endian hexstring, optionally padded to - * %%width%% bytes. - */ -export declare function toBeHex(_value: BigNumberish, _width?: Numeric): string; -/** - * Converts %%value%% to a Big Endian Uint8Array. - */ -export declare function toBeArray(_value: BigNumberish, _width?: Numeric): Uint8Array; -/** - * Returns a [[HexString]] for %%value%% safe to use as a //Quantity//. - * - * A //Quantity// does not have and leading 0 values unless the value is - * the literal value `0x0`. This is most commonly used for JSSON-RPC - * numeric values. - */ -export declare function toQuantity(value: BytesLike | BigNumberish): string; -//# sourceMappingURL=maths.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/maths.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/maths.d.ts.map deleted file mode 100644 index 4f05eb1b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/maths.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"maths.d.ts","sourceRoot":"","sources":["../../src.ts/utils/maths.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAEtC;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,CAAC;AAY5C;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,CAetE;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,CAoBpE;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAIjE;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAmBpE;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAMlE;AAQD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,UAAU,GAAG,MAAM,CAWjE;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAkBpE;AAGD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,UAAU,GAAG,MAAM,CAEjE;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,CA0BtE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,UAAU,CA8B5E;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,YAAY,GAAG,MAAM,CAKlE"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/maths.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/maths.js deleted file mode 100644 index 040c7cac..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/maths.js +++ /dev/null @@ -1,231 +0,0 @@ -/** - * Some mathematic operations. - * - * @_subsection: api/utils:Math Helpers [about-maths] - */ -import { hexlify, isBytesLike } from "./data.js"; -import { assert, assertArgument } from "./errors.js"; -const BN_0 = BigInt(0); -const BN_1 = BigInt(1); -//const BN_Max256 = (BN_1 << BigInt(256)) - BN_1; -// IEEE 754 support 53-bits of mantissa -const maxValue = 0x1fffffffffffff; -/** - * Convert %%value%% from a twos-compliment representation of %%width%% - * bits to its value. - * - * If the highest bit is ``1``, the result will be negative. - */ -export function fromTwos(_value, _width) { - const value = getUint(_value, "value"); - const width = BigInt(getNumber(_width, "width")); - assert((value >> width) === BN_0, "overflow", "NUMERIC_FAULT", { - operation: "fromTwos", fault: "overflow", value: _value - }); - // Top bit set; treat as a negative value - if (value >> (width - BN_1)) { - const mask = (BN_1 << width) - BN_1; - return -(((~value) & mask) + BN_1); - } - return value; -} -/** - * Convert %%value%% to a twos-compliment representation of - * %%width%% bits. - * - * The result will always be positive. - */ -export function toTwos(_value, _width) { - let value = getBigInt(_value, "value"); - const width = BigInt(getNumber(_width, "width")); - const limit = (BN_1 << (width - BN_1)); - if (value < BN_0) { - value = -value; - assert(value <= limit, "too low", "NUMERIC_FAULT", { - operation: "toTwos", fault: "overflow", value: _value - }); - const mask = (BN_1 << width) - BN_1; - return ((~value) & mask) + BN_1; - } - else { - assert(value < limit, "too high", "NUMERIC_FAULT", { - operation: "toTwos", fault: "overflow", value: _value - }); - } - return value; -} -/** - * Mask %%value%% with a bitmask of %%bits%% ones. - */ -export function mask(_value, _bits) { - const value = getUint(_value, "value"); - const bits = BigInt(getNumber(_bits, "bits")); - return value & ((BN_1 << bits) - BN_1); -} -/** - * Gets a BigInt from %%value%%. If it is an invalid value for - * a BigInt, then an ArgumentError will be thrown for %%name%%. - */ -export function getBigInt(value, name) { - switch (typeof (value)) { - case "bigint": return value; - case "number": - assertArgument(Number.isInteger(value), "underflow", name || "value", value); - assertArgument(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); - return BigInt(value); - case "string": - try { - if (value === "") { - throw new Error("empty string"); - } - if (value[0] === "-" && value[1] !== "-") { - return -BigInt(value.substring(1)); - } - return BigInt(value); - } - catch (e) { - assertArgument(false, `invalid BigNumberish string: ${e.message}`, name || "value", value); - } - } - assertArgument(false, "invalid BigNumberish value", name || "value", value); -} -/** - * Returns %%value%% as a bigint, validating it is valid as a bigint - * value and that it is positive. - */ -export function getUint(value, name) { - const result = getBigInt(value, name); - assert(result >= BN_0, "unsigned value cannot be negative", "NUMERIC_FAULT", { - fault: "overflow", operation: "getUint", value - }); - return result; -} -const Nibbles = "0123456789abcdef"; -/* - * Converts %%value%% to a BigInt. If %%value%% is a Uint8Array, it - * is treated as Big Endian data. - */ -export function toBigInt(value) { - if (value instanceof Uint8Array) { - let result = "0x0"; - for (const v of value) { - result += Nibbles[v >> 4]; - result += Nibbles[v & 0x0f]; - } - return BigInt(result); - } - return getBigInt(value); -} -/** - * Gets a //number// from %%value%%. If it is an invalid value for - * a //number//, then an ArgumentError will be thrown for %%name%%. - */ -export function getNumber(value, name) { - switch (typeof (value)) { - case "bigint": - assertArgument(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); - return Number(value); - case "number": - assertArgument(Number.isInteger(value), "underflow", name || "value", value); - assertArgument(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); - return value; - case "string": - try { - if (value === "") { - throw new Error("empty string"); - } - return getNumber(BigInt(value), name); - } - catch (e) { - assertArgument(false, `invalid numeric string: ${e.message}`, name || "value", value); - } - } - assertArgument(false, "invalid numeric value", name || "value", value); -} -/** - * Converts %%value%% to a number. If %%value%% is a Uint8Array, it - * is treated as Big Endian data. Throws if the value is not safe. - */ -export function toNumber(value) { - return getNumber(toBigInt(value)); -} -/** - * Converts %%value%% to a Big Endian hexstring, optionally padded to - * %%width%% bytes. - */ -export function toBeHex(_value, _width) { - const value = getUint(_value, "value"); - let result = value.toString(16); - if (_width == null) { - // Ensure the value is of even length - if (result.length % 2) { - result = "0" + result; - } - } - else { - const width = getNumber(_width, "width"); - // Special case when both value and width are 0 (see: #5025) - if (width === 0 && value === BN_0) { - return "0x"; - } - assert(width * 2 >= result.length, `value exceeds width (${width} bytes)`, "NUMERIC_FAULT", { - operation: "toBeHex", - fault: "overflow", - value: _value - }); - // Pad the value to the required width - while (result.length < (width * 2)) { - result = "0" + result; - } - } - return "0x" + result; -} -/** - * Converts %%value%% to a Big Endian Uint8Array. - */ -export function toBeArray(_value, _width) { - const value = getUint(_value, "value"); - if (value === BN_0) { - const width = (_width != null) ? getNumber(_width, "width") : 0; - return new Uint8Array(width); - } - let hex = value.toString(16); - if (hex.length % 2) { - hex = "0" + hex; - } - if (_width != null) { - const width = getNumber(_width, "width"); - while (hex.length < (width * 2)) { - hex = "00" + hex; - } - assert((width * 2) === hex.length, `value exceeds width (${width} bytes)`, "NUMERIC_FAULT", { - operation: "toBeArray", - fault: "overflow", - value: _value - }); - } - const result = new Uint8Array(hex.length / 2); - for (let i = 0; i < result.length; i++) { - const offset = i * 2; - result[i] = parseInt(hex.substring(offset, offset + 2), 16); - } - return result; -} -/** - * Returns a [[HexString]] for %%value%% safe to use as a //Quantity//. - * - * A //Quantity// does not have and leading 0 values unless the value is - * the literal value `0x0`. This is most commonly used for JSSON-RPC - * numeric values. - */ -export function toQuantity(value) { - let result = hexlify(isBytesLike(value) ? value : toBeArray(value)).substring(2); - while (result.startsWith("0")) { - result = result.substring(1); - } - if (result === "") { - result = "0"; - } - return "0x" + result; -} -//# sourceMappingURL=maths.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/maths.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/maths.js.map deleted file mode 100644 index 33ec8d76..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/maths.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"maths.js","sourceRoot":"","sources":["../../src.ts/utils/maths.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAerD,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAEvB,iDAAiD;AAGjD,uCAAuC;AACvC,MAAM,QAAQ,GAAG,gBAAgB,CAAC;AAElC;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,MAAoB,EAAE,MAAe;IAC1D,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAEjD,MAAM,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,IAAI,EAAE,UAAU,EAAE,eAAe,EAAE;QAC3D,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM;KAC1D,CAAC,CAAC;IAEH,yCAAyC;IACzC,IAAI,KAAK,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,EAAE;QACzB,MAAM,IAAI,GAA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,KAAK,EAAE,UAAU;YACjB,KAAK,EAAE,MAAM;SAChB,CAAC,CAAC;KACN;IAED,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC9C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACpC,MAAM,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC;QACrB,MAAM,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;KAC/D;IAED,OAAO,MAAM,CAAC;AAClB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,KAA+B;IACtD,IAAI,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAChF,OAAO,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QAAE,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;KAAE;IAChE,IAAI,MAAM,KAAK,EAAE,EAAE;QAAE,MAAM,GAAG,GAAG,CAAC;KAAE;IACpC,OAAO,IAAI,GAAG,MAAM,CAAC;AACzB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/properties.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/properties.d.ts deleted file mode 100644 index 9f0daadf..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/properties.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Property helper functions. - * - * @_subsection api/utils:Properties [about-properties] - */ -/** - * Resolves to a new object that is a copy of %%value%%, but with all - * values resolved. - */ -export declare function resolveProperties(value: { - [P in keyof T]: T[P] | Promise; -}): Promise; -/** - * Assigns the %%values%% to %%target%% as read-only values. - * - * It %%types%% is specified, the values are checked. - */ -export declare function defineProperties(target: T, values: { - [K in keyof T]?: T[K]; -}, types?: { - [K in keyof T]?: string; -}): void; -//# sourceMappingURL=properties.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/properties.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/properties.d.ts.map deleted file mode 100644 index 1ea81956..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/properties.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../src.ts/utils/properties.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAwBH;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE;KAAI,CAAC,IAAI,MAAM,CAAC,GAAI,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAOvG;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EACjC,MAAM,EAAE,CAAC,EACT,MAAM,EAAE;KAAI,CAAC,IAAI,MAAM,CAAC,CAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CAAE,EACnC,KAAK,CAAC,EAAE;KAAI,CAAC,IAAI,MAAM,CAAC,CAAE,CAAC,EAAE,MAAM;CAAE,GAAG,IAAI,CAU5C"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/properties.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/properties.js deleted file mode 100644 index 2f91ac3e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/properties.js +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Property helper functions. - * - * @_subsection api/utils:Properties [about-properties] - */ -function checkType(value, type, name) { - const types = type.split("|").map(t => t.trim()); - for (let i = 0; i < types.length; i++) { - switch (type) { - case "any": - return; - case "bigint": - case "boolean": - case "number": - case "string": - if (typeof (value) === type) { - return; - } - } - } - const error = new Error(`invalid value for type ${type}`); - error.code = "INVALID_ARGUMENT"; - error.argument = `value.${name}`; - error.value = value; - throw error; -} -/** - * Resolves to a new object that is a copy of %%value%%, but with all - * values resolved. - */ -export async function resolveProperties(value) { - const keys = Object.keys(value); - const results = await Promise.all(keys.map((k) => Promise.resolve(value[k]))); - return results.reduce((accum, v, index) => { - accum[keys[index]] = v; - return accum; - }, {}); -} -/** - * Assigns the %%values%% to %%target%% as read-only values. - * - * It %%types%% is specified, the values are checked. - */ -export function defineProperties(target, values, types) { - for (let key in values) { - let value = values[key]; - const type = (types ? types[key] : null); - if (type) { - checkType(value, type, key); - } - Object.defineProperty(target, key, { enumerable: true, value, writable: false }); - } -} -//# sourceMappingURL=properties.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/properties.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/properties.js.map deleted file mode 100644 index 59a7f65c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/properties.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"properties.js","sourceRoot":"","sources":["../../src.ts/utils/properties.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,SAAS,SAAS,CAAC,KAAU,EAAE,IAAY,EAAE,IAAY;IACrD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IACjD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACnC,QAAQ,IAAI,EAAE;YACV,KAAK,KAA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,CAAA,CAAC,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,IAAI,EAAE;YAAE,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;SAAE;QAE1C,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;KACpF;AACL,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp-decode.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp-decode.d.ts deleted file mode 100644 index b77b08b9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp-decode.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { BytesLike, RlpStructuredData } from "./index.js"; -/** - * Decodes %%data%% into the structured data it represents. - */ -export declare function decodeRlp(_data: BytesLike): RlpStructuredData; -//# sourceMappingURL=rlp-decode.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp-decode.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp-decode.d.ts.map deleted file mode 100644 index 458795aa..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp-decode.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rlp-decode.d.ts","sourceRoot":"","sources":["../../src.ts/utils/rlp-decode.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAwF/D;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,iBAAiB,CAK7D"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp-decode.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp-decode.js deleted file mode 100644 index c483ce3b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp-decode.js +++ /dev/null @@ -1,79 +0,0 @@ -//See: https://github.com/ethereum/wiki/wiki/RLP -import { hexlify } from "./data.js"; -import { assert, assertArgument } from "./errors.js"; -import { getBytes } from "./data.js"; -function hexlifyByte(value) { - let result = value.toString(16); - while (result.length < 2) { - result = "0" + result; - } - return "0x" + result; -} -function unarrayifyInteger(data, offset, length) { - let result = 0; - for (let i = 0; i < length; i++) { - result = (result * 256) + data[offset + i]; - } - return result; -} -function _decodeChildren(data, offset, childOffset, length) { - const result = []; - while (childOffset < offset + 1 + length) { - const decoded = _decode(data, childOffset); - result.push(decoded.result); - childOffset += decoded.consumed; - assert(childOffset <= offset + 1 + length, "child data too short", "BUFFER_OVERRUN", { - buffer: data, length, offset - }); - } - return { consumed: (1 + length), result: result }; -} -// returns { consumed: number, result: Object } -function _decode(data, offset) { - assert(data.length !== 0, "data too short", "BUFFER_OVERRUN", { - buffer: data, length: 0, offset: 1 - }); - const checkOffset = (offset) => { - assert(offset <= data.length, "data short segment too short", "BUFFER_OVERRUN", { - buffer: data, length: data.length, offset - }); - }; - // Array with extra length prefix - if (data[offset] >= 0xf8) { - const lengthLength = data[offset] - 0xf7; - checkOffset(offset + 1 + lengthLength); - const length = unarrayifyInteger(data, offset + 1, lengthLength); - checkOffset(offset + 1 + lengthLength + length); - return _decodeChildren(data, offset, offset + 1 + lengthLength, lengthLength + length); - } - else if (data[offset] >= 0xc0) { - const length = data[offset] - 0xc0; - checkOffset(offset + 1 + length); - return _decodeChildren(data, offset, offset + 1, length); - } - else if (data[offset] >= 0xb8) { - const lengthLength = data[offset] - 0xb7; - checkOffset(offset + 1 + lengthLength); - const length = unarrayifyInteger(data, offset + 1, lengthLength); - checkOffset(offset + 1 + lengthLength + length); - const result = hexlify(data.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length)); - return { consumed: (1 + lengthLength + length), result: result }; - } - else if (data[offset] >= 0x80) { - const length = data[offset] - 0x80; - checkOffset(offset + 1 + length); - const result = hexlify(data.slice(offset + 1, offset + 1 + length)); - return { consumed: (1 + length), result: result }; - } - return { consumed: 1, result: hexlifyByte(data[offset]) }; -} -/** - * Decodes %%data%% into the structured data it represents. - */ -export function decodeRlp(_data) { - const data = getBytes(_data, "data"); - const decoded = _decode(data, 0); - assertArgument(decoded.consumed === data.length, "unexpected junk after rlp payload", "data", _data); - return decoded.result; -} -//# sourceMappingURL=rlp-decode.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp-decode.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp-decode.js.map deleted file mode 100644 index fa129b9a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp-decode.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rlp-decode.js","sourceRoot":"","sources":["../../src.ts/utils/rlp-decode.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAEhD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAKrC,SAAS,WAAW,CAAC,KAAa;IAC9B,IAAI,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAChC,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;QAAE,MAAM,GAAG,GAAG,GAAG,MAAM,CAAC;KAAE;IACpD,OAAO,IAAI,GAAG,MAAM,CAAC;AACzB,CAAC;AAED,SAAS,iBAAiB,CAAC,IAAgB,EAAE,MAAc,EAAE,MAAc;IACvE,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;QAC7B,MAAM,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,GA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QAAQ,EAAE,CAAC,CAAC,GAAG,YAAY,GAAG,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAA;KAEnE;SAAM,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE;QAC7B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;QACnC,WAAW,CAAC,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC;QAEjC,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;QACpE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAA;KACpD;IAED,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;AAC9D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,KAAgB;IACtC,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACjC,cAAc,CAAC,OAAO,CAAC,QAAQ,KAAK,IAAI,CAAC,MAAM,EAAE,mCAAmC,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IACrG,OAAO,OAAO,CAAC,MAAM,CAAC;AAC1B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp-encode.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp-encode.d.ts deleted file mode 100644 index 089b1c3e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp-encode.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { RlpStructuredDataish } from "./rlp.js"; -/** - * Encodes %%object%% as an RLP-encoded [[DataHexString]]. - */ -export declare function encodeRlp(object: RlpStructuredDataish): string; -//# sourceMappingURL=rlp-encode.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp-encode.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp-encode.d.ts.map deleted file mode 100644 index 319163b8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp-encode.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rlp-encode.d.ts","sourceRoot":"","sources":["../../src.ts/utils/rlp-encode.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAiDrD;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAO9D"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp-encode.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp-encode.js deleted file mode 100644 index 7d6d797d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp-encode.js +++ /dev/null @@ -1,49 +0,0 @@ -//See: https://github.com/ethereum/wiki/wiki/RLP -import { getBytes } from "./data.js"; -function arrayifyInteger(value) { - const result = []; - while (value) { - result.unshift(value & 0xff); - value >>= 8; - } - return result; -} -function _encode(object) { - if (Array.isArray(object)) { - let payload = []; - object.forEach(function (child) { - payload = payload.concat(_encode(child)); - }); - if (payload.length <= 55) { - payload.unshift(0xc0 + payload.length); - return payload; - } - const length = arrayifyInteger(payload.length); - length.unshift(0xf7 + length.length); - return length.concat(payload); - } - const data = Array.prototype.slice.call(getBytes(object, "object")); - if (data.length === 1 && data[0] <= 0x7f) { - return data; - } - else if (data.length <= 55) { - data.unshift(0x80 + data.length); - return data; - } - const length = arrayifyInteger(data.length); - length.unshift(0xb7 + length.length); - return length.concat(data); -} -const nibbles = "0123456789abcdef"; -/** - * Encodes %%object%% as an RLP-encoded [[DataHexString]]. - */ -export function encodeRlp(object) { - let result = "0x"; - for (const v of _encode(object)) { - result += nibbles[v >> 4]; - result += nibbles[v & 0xf]; - } - return result; -} -//# sourceMappingURL=rlp-encode.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp-encode.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp-encode.js.map deleted file mode 100644 index 3dd6434c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp-encode.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rlp-encode.js","sourceRoot":"","sources":["../../src.ts/utils/rlp-encode.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAEhD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAKrC,SAAS,eAAe,CAAC,KAAa;IAClC,MAAM,MAAM,GAAkB,EAAE,CAAC;IACjC,OAAO,KAAK,EAAE;QACV,MAAM,CAAC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;QAC7B,KAAK,KAAK,CAAC,CAAC;KACf;IACD,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,SAAS,OAAO,CAAC,MAAwC;IACrD,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QACvB,IAAI,OAAO,GAAkB,EAAE,CAAC;QAChC,MAAM,CAAC,OAAO,CAAC,UAAS,KAAK;YACzB,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;QAEH,IAAI,OAAO,CAAC,MAAM,IAAI,EAAE,EAAE;YACtB,OAAO,CAAC,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;YACtC,OAAO,OAAO,CAAC;SAClB;QAED,MAAM,MAAM,GAAG,eAAe,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC/C,MAAM,CAAC,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;QAErC,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;KAEjC;IAED,MAAM,IAAI,GAAkB,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;IAEnF,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE;QACtC,OAAO,IAAI,CAAC;KAEf;SAAM,IAAI,IAAI,CAAC,MAAM,IAAI,EAAE,EAAE;QAC1B,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;QACjC,OAAO,IAAI,CAAC;KACf;IAED,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5C,MAAM,CAAC,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IAErC,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC;AAED,MAAM,OAAO,GAAG,kBAAkB,CAAC;AAEnC;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,MAA4B;IAClD,IAAI,MAAM,GAAG,IAAI,CAAC;IAClB,KAAK,MAAM,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE;QAC7B,MAAM,IAAI,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QAC1B,MAAM,IAAI,OAAO,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;KAC9B;IACD,OAAO,MAAM,CAAC;AAClB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp.d.ts deleted file mode 100644 index bdc7e828..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * The [[link-rlp]] (RLP) encoding is used throughout Ethereum - * to serialize nested structures of Arrays and data. - * - * @_subsection api/utils:Recursive-Length Prefix [about-rlp] - */ -export { decodeRlp } from "./rlp-decode.js"; -export { encodeRlp } from "./rlp-encode.js"; -/** - * An RLP-encoded structure. - */ -export type RlpStructuredData = string | Array; -/** - * An RLP-encoded structure, which allows Uint8Array. - */ -export type RlpStructuredDataish = string | Uint8Array | Array; -//# sourceMappingURL=rlp.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp.d.ts.map deleted file mode 100644 index 287f5705..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rlp.d.ts","sourceRoot":"","sources":["../../src.ts/utils/rlp.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,KAAK,CAAC,iBAAiB,CAAC,CAAC;AAElE;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,UAAU,GAAG,KAAK,CAAC,oBAAoB,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp.js deleted file mode 100644 index cffd9f60..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * The [[link-rlp]] (RLP) encoding is used throughout Ethereum - * to serialize nested structures of Arrays and data. - * - * @_subsection api/utils:Recursive-Length Prefix [about-rlp] - */ -export { decodeRlp } from "./rlp-decode.js"; -export { encodeRlp } from "./rlp-encode.js"; -//# sourceMappingURL=rlp.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp.js.map deleted file mode 100644 index 6ad8eda8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/rlp.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rlp.js","sourceRoot":"","sources":["../../src.ts/utils/rlp.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/units.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/units.d.ts deleted file mode 100644 index 7f6ce177..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/units.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { BigNumberish, Numeric } from "../utils/index.js"; -/** - * Converts %%value%% into a //decimal string//, assuming %%unit%% decimal - * places. The %%unit%% may be the number of decimal places or the name of - * a unit (e.g. ``"gwei"`` for 9 decimal places). - * - */ -export declare function formatUnits(value: BigNumberish, unit?: string | Numeric): string; -/** - * Converts the //decimal string// %%value%% to a BigInt, assuming - * %%unit%% decimal places. The %%unit%% may the number of decimal places - * or the name of a unit (e.g. ``"gwei"`` for 9 decimal places). - */ -export declare function parseUnits(value: string, unit?: string | Numeric): bigint; -/** - * Converts %%value%% into a //decimal string// using 18 decimal places. - */ -export declare function formatEther(wei: BigNumberish): string; -/** - * Converts the //decimal string// %%ether%% to a BigInt, using 18 - * decimal places. - */ -export declare function parseEther(ether: string): bigint; -//# sourceMappingURL=units.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/units.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/units.d.ts.map deleted file mode 100644 index 4572b87d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/units.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"units.d.ts","sourceRoot":"","sources":["../../src.ts/utils/units.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAa/D;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAWhF;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAazE;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,YAAY,GAAG,MAAM,CAErD;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEhD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/units.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/units.js deleted file mode 100644 index f6ca574d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/units.js +++ /dev/null @@ -1,83 +0,0 @@ -/** - * Most interactions with Ethereum requires integer values, which use - * the smallest magnitude unit. - * - * For example, imagine dealing with dollars and cents. Since dollars - * are divisible, non-integer values are possible, such as ``$10.77``. - * By using the smallest indivisible unit (i.e. cents), the value can - * be kept as the integer ``1077``. - * - * When receiving decimal input from the user (as a decimal string), - * the value should be converted to an integer and when showing a user - * a value, the integer value should be converted to a decimal string. - * - * This creates a clear distinction, between values to be used by code - * (integers) and values used for display logic to users (decimals). - * - * The native unit in Ethereum, //ether// is divisible to 18 decimal places, - * where each individual unit is called a //wei//. - * - * @_subsection api/utils:Unit Conversion [about-units] - */ -import { assertArgument } from "./errors.js"; -import { FixedNumber } from "./fixednumber.js"; -import { getNumber } from "./maths.js"; -const names = [ - "wei", - "kwei", - "mwei", - "gwei", - "szabo", - "finney", - "ether", -]; -/** - * Converts %%value%% into a //decimal string//, assuming %%unit%% decimal - * places. The %%unit%% may be the number of decimal places or the name of - * a unit (e.g. ``"gwei"`` for 9 decimal places). - * - */ -export function formatUnits(value, unit) { - let decimals = 18; - if (typeof (unit) === "string") { - const index = names.indexOf(unit); - assertArgument(index >= 0, "invalid unit", "unit", unit); - decimals = 3 * index; - } - else if (unit != null) { - decimals = getNumber(unit, "unit"); - } - return FixedNumber.fromValue(value, decimals, { decimals, width: 512 }).toString(); -} -/** - * Converts the //decimal string// %%value%% to a BigInt, assuming - * %%unit%% decimal places. The %%unit%% may the number of decimal places - * or the name of a unit (e.g. ``"gwei"`` for 9 decimal places). - */ -export function parseUnits(value, unit) { - assertArgument(typeof (value) === "string", "value must be a string", "value", value); - let decimals = 18; - if (typeof (unit) === "string") { - const index = names.indexOf(unit); - assertArgument(index >= 0, "invalid unit", "unit", unit); - decimals = 3 * index; - } - else if (unit != null) { - decimals = getNumber(unit, "unit"); - } - return FixedNumber.fromString(value, { decimals, width: 512 }).value; -} -/** - * Converts %%value%% into a //decimal string// using 18 decimal places. - */ -export function formatEther(wei) { - return formatUnits(wei, 18); -} -/** - * Converts the //decimal string// %%ether%% to a BigInt, using 18 - * decimal places. - */ -export function parseEther(ether) { - return parseUnits(ether, 18); -} -//# sourceMappingURL=units.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/units.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/units.js.map deleted file mode 100644 index 3b4fcfcb..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/units.js.map +++ /dev/null @@ -1 +0,0 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,EAAE;QAC3B,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAClC,cAAc,CAAC,KAAK,IAAI,CAAC,EAAE,cAAc,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QACzD,QAAQ,GAAG,CAAC,GAAG,KAAK,CAAC;KACxB;SAAM,IAAI,IAAI,IAAI,IAAI,EAAE;QACrB,QAAQ,GAAG,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;KACtC;IAED,OAAO,WAAW,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC;AACzE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,GAAiB;IACzC,OAAO,WAAW,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;AAChC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,KAAa;IACpC,OAAO,UAAU,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACjC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/utf8.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/utf8.d.ts deleted file mode 100644 index 7bb87cc7..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/utf8.d.ts +++ /dev/null @@ -1,96 +0,0 @@ -import type { BytesLike } from "./index.js"; -/** - * The stanard normalization forms. - */ -export type UnicodeNormalizationForm = "NFC" | "NFD" | "NFKC" | "NFKD"; -/** - * When using the UTF-8 error API the following errors can be intercepted - * and processed as the %%reason%% passed to the [[Utf8ErrorFunc]]. - * - * **``"UNEXPECTED_CONTINUE"``** - a continuation byte was present where there - * was nothing to continue. - * - * **``"BAD_PREFIX"``** - an invalid (non-continuation) byte to start a - * UTF-8 codepoint was found. - * - * **``"OVERRUN"``** - the string is too short to process the expected - * codepoint length. - * - * **``"MISSING_CONTINUE"``** - a missing continuation byte was expected but - * not found. The %%offset%% indicates the index the continuation byte - * was expected at. - * - * **``"OUT_OF_RANGE"``** - the computed code point is outside the range - * for UTF-8. The %%badCodepoint%% indicates the computed codepoint, which was - * outside the valid UTF-8 range. - * - * **``"UTF16_SURROGATE"``** - the UTF-8 strings contained a UTF-16 surrogate - * pair. The %%badCodepoint%% is the computed codepoint, which was inside the - * UTF-16 surrogate range. - * - * **``"OVERLONG"``** - the string is an overlong representation. The - * %%badCodepoint%% indicates the computed codepoint, which has already - * been bounds checked. - * - * - * @returns string - */ -export type Utf8ErrorReason = "UNEXPECTED_CONTINUE" | "BAD_PREFIX" | "OVERRUN" | "MISSING_CONTINUE" | "OUT_OF_RANGE" | "UTF16_SURROGATE" | "OVERLONG"; -/** - * A callback that can be used with [[toUtf8String]] to analysis or - * recovery from invalid UTF-8 data. - * - * Parsing UTF-8 data is done through a simple Finite-State Machine (FSM) - * which calls the ``Utf8ErrorFunc`` if a fault is detected. - * - * The %%reason%% indicates where in the FSM execution the fault - * occurred and the %%offset%% indicates where the input failed. - * - * The %%bytes%% represents the raw UTF-8 data that was provided and - * %%output%% is the current array of UTF-8 code-points, which may - * be updated by the ``Utf8ErrorFunc``. - * - * The value of the %%badCodepoint%% depends on the %%reason%%. See - * [[Utf8ErrorReason]] for details. - * - * The function should return the number of bytes that should be skipped - * when control resumes to the FSM. - */ -export type Utf8ErrorFunc = (reason: Utf8ErrorReason, offset: number, bytes: Uint8Array, output: Array, badCodepoint?: number) => number; -/** - * A handful of popular, built-in UTF-8 error handling strategies. - * - * **``"error"``** - throws on ANY illegal UTF-8 sequence or - * non-canonical (overlong) codepoints (this is the default) - * - * **``"ignore"``** - silently drops any illegal UTF-8 sequence - * and accepts non-canonical (overlong) codepoints - * - * **``"replace"``** - replace any illegal UTF-8 sequence with the - * UTF-8 replacement character (i.e. ``"\\ufffd"``) and accepts - * non-canonical (overlong) codepoints - * - * @returns: Record<"error" | "ignore" | "replace", Utf8ErrorFunc> - */ -export declare const Utf8ErrorFuncs: Readonly>; -/** - * Returns the UTF-8 byte representation of %%str%%. - * - * If %%form%% is specified, the string is normalized. - */ -export declare function toUtf8Bytes(str: string, form?: UnicodeNormalizationForm): Uint8Array; -/** - * Returns the string represented by the UTF-8 data %%bytes%%. - * - * When %%onError%% function is specified, it is called on UTF-8 - * errors allowing recovery using the [[Utf8ErrorFunc]] API. - * (default: [error](Utf8ErrorFuncs)) - */ -export declare function toUtf8String(bytes: BytesLike, onError?: Utf8ErrorFunc): string; -/** - * Returns the UTF-8 code-points for %%str%%. - * - * If %%form%% is specified, the string is normalized. - */ -export declare function toUtf8CodePoints(str: string, form?: UnicodeNormalizationForm): Array; -//# sourceMappingURL=utf8.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/utf8.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/utf8.d.ts.map deleted file mode 100644 index 9349623c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/utf8.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utf8.d.ts","sourceRoot":"","sources":["../../src.ts/utils/utf8.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAK5C;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAEvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,MAAM,eAAe,GAAG,qBAAqB,GAAG,YAAY,GAAG,SAAS,GAC1E,kBAAkB,GAAG,cAAc,GAAG,iBAAiB,GAAG,UAAU,CAAC;AAGzE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;AA6CjJ;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,OAAO,GAAG,QAAQ,GAAG,SAAS,EAAE,aAAa,CAAC,CAIzF,CAAC;AAsGH;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,wBAAwB,GAAG,UAAU,CAyCpF;AAgBD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,MAAM,CAE9E;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,wBAAwB,GAAG,KAAK,CAAC,MAAM,CAAC,CAE5F"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/utf8.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/utf8.js deleted file mode 100644 index 9c540486..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/utf8.js +++ /dev/null @@ -1,221 +0,0 @@ -/** - * Using strings in Ethereum (or any security-basd system) requires - * additional care. These utilities attempt to mitigate some of the - * safety issues as well as provide the ability to recover and analyse - * strings. - * - * @_subsection api/utils:Strings and UTF-8 [about-strings] - */ -import { getBytes } from "./data.js"; -import { assertArgument, assertNormalize } from "./errors.js"; -function errorFunc(reason, offset, bytes, output, badCodepoint) { - assertArgument(false, `invalid codepoint at offset ${offset}; ${reason}`, "bytes", bytes); -} -function ignoreFunc(reason, offset, bytes, output, badCodepoint) { - // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes - if (reason === "BAD_PREFIX" || reason === "UNEXPECTED_CONTINUE") { - let i = 0; - for (let o = offset + 1; o < bytes.length; o++) { - if (bytes[o] >> 6 !== 0x02) { - break; - } - i++; - } - return i; - } - // This byte runs us past the end of the string, so just jump to the end - // (but the first byte was read already read and therefore skipped) - if (reason === "OVERRUN") { - return bytes.length - offset - 1; - } - // Nothing to skip - return 0; -} -function replaceFunc(reason, offset, bytes, output, badCodepoint) { - // Overlong representations are otherwise "valid" code points; just non-deistingtished - if (reason === "OVERLONG") { - assertArgument(typeof (badCodepoint) === "number", "invalid bad code point for replacement", "badCodepoint", badCodepoint); - output.push(badCodepoint); - return 0; - } - // Put the replacement character into the output - output.push(0xfffd); - // Otherwise, process as if ignoring errors - return ignoreFunc(reason, offset, bytes, output, badCodepoint); -} -/** - * A handful of popular, built-in UTF-8 error handling strategies. - * - * **``"error"``** - throws on ANY illegal UTF-8 sequence or - * non-canonical (overlong) codepoints (this is the default) - * - * **``"ignore"``** - silently drops any illegal UTF-8 sequence - * and accepts non-canonical (overlong) codepoints - * - * **``"replace"``** - replace any illegal UTF-8 sequence with the - * UTF-8 replacement character (i.e. ``"\\ufffd"``) and accepts - * non-canonical (overlong) codepoints - * - * @returns: Record<"error" | "ignore" | "replace", Utf8ErrorFunc> - */ -export const Utf8ErrorFuncs = Object.freeze({ - error: errorFunc, - ignore: ignoreFunc, - replace: replaceFunc -}); -// http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499 -function getUtf8CodePoints(_bytes, onError) { - if (onError == null) { - onError = Utf8ErrorFuncs.error; - } - const bytes = getBytes(_bytes, "bytes"); - const result = []; - let i = 0; - // Invalid bytes are ignored - while (i < bytes.length) { - const c = bytes[i++]; - // 0xxx xxxx - if (c >> 7 === 0) { - result.push(c); - continue; - } - // Multibyte; how many bytes left for this character? - let extraLength = null; - let overlongMask = null; - // 110x xxxx 10xx xxxx - if ((c & 0xe0) === 0xc0) { - extraLength = 1; - overlongMask = 0x7f; - // 1110 xxxx 10xx xxxx 10xx xxxx - } - else if ((c & 0xf0) === 0xe0) { - extraLength = 2; - overlongMask = 0x7ff; - // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx - } - else if ((c & 0xf8) === 0xf0) { - extraLength = 3; - overlongMask = 0xffff; - } - else { - if ((c & 0xc0) === 0x80) { - i += onError("UNEXPECTED_CONTINUE", i - 1, bytes, result); - } - else { - i += onError("BAD_PREFIX", i - 1, bytes, result); - } - continue; - } - // Do we have enough bytes in our data? - if (i - 1 + extraLength >= bytes.length) { - i += onError("OVERRUN", i - 1, bytes, result); - continue; - } - // Remove the length prefix from the char - let res = c & ((1 << (8 - extraLength - 1)) - 1); - for (let j = 0; j < extraLength; j++) { - let nextChar = bytes[i]; - // Invalid continuation byte - if ((nextChar & 0xc0) != 0x80) { - i += onError("MISSING_CONTINUE", i, bytes, result); - res = null; - break; - } - ; - res = (res << 6) | (nextChar & 0x3f); - i++; - } - // See above loop for invalid continuation byte - if (res === null) { - continue; - } - // Maximum code point - if (res > 0x10ffff) { - i += onError("OUT_OF_RANGE", i - 1 - extraLength, bytes, result, res); - continue; - } - // Reserved for UTF-16 surrogate halves - if (res >= 0xd800 && res <= 0xdfff) { - i += onError("UTF16_SURROGATE", i - 1 - extraLength, bytes, result, res); - continue; - } - // Check for overlong sequences (more bytes than needed) - if (res <= overlongMask) { - i += onError("OVERLONG", i - 1 - extraLength, bytes, result, res); - continue; - } - result.push(res); - } - return result; -} -// http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array -/** - * Returns the UTF-8 byte representation of %%str%%. - * - * If %%form%% is specified, the string is normalized. - */ -export function toUtf8Bytes(str, form) { - assertArgument(typeof (str) === "string", "invalid string value", "str", str); - if (form != null) { - assertNormalize(form); - str = str.normalize(form); - } - let result = []; - for (let i = 0; i < str.length; i++) { - const c = str.charCodeAt(i); - if (c < 0x80) { - result.push(c); - } - else if (c < 0x800) { - result.push((c >> 6) | 0xc0); - result.push((c & 0x3f) | 0x80); - } - else if ((c & 0xfc00) == 0xd800) { - i++; - const c2 = str.charCodeAt(i); - assertArgument(i < str.length && ((c2 & 0xfc00) === 0xdc00), "invalid surrogate pair", "str", str); - // Surrogate Pair - const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff); - result.push((pair >> 18) | 0xf0); - result.push(((pair >> 12) & 0x3f) | 0x80); - result.push(((pair >> 6) & 0x3f) | 0x80); - result.push((pair & 0x3f) | 0x80); - } - else { - result.push((c >> 12) | 0xe0); - result.push(((c >> 6) & 0x3f) | 0x80); - result.push((c & 0x3f) | 0x80); - } - } - return new Uint8Array(result); -} -; -//export -function _toUtf8String(codePoints) { - return codePoints.map((codePoint) => { - if (codePoint <= 0xffff) { - return String.fromCharCode(codePoint); - } - codePoint -= 0x10000; - return String.fromCharCode((((codePoint >> 10) & 0x3ff) + 0xd800), ((codePoint & 0x3ff) + 0xdc00)); - }).join(""); -} -/** - * Returns the string represented by the UTF-8 data %%bytes%%. - * - * When %%onError%% function is specified, it is called on UTF-8 - * errors allowing recovery using the [[Utf8ErrorFunc]] API. - * (default: [error](Utf8ErrorFuncs)) - */ -export function toUtf8String(bytes, onError) { - return _toUtf8String(getUtf8CodePoints(bytes, onError)); -} -/** - * Returns the UTF-8 code-points for %%str%%. - * - * If %%form%% is specified, the string is normalized. - */ -export function toUtf8CodePoints(str, form) { - return getUtf8CodePoints(toUtf8Bytes(str, form)); -} -//# sourceMappingURL=utf8.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/utf8.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/utf8.js.map deleted file mode 100644 index 03143fcc..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/utf8.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utf8.js","sourceRoot":"","sources":["../../src.ts/utils/utf8.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAuE9D,SAAS,SAAS,CAAC,MAAuB,EAAE,MAAc,EAAE,KAAiB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AC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;YACtC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;SAClC;KACJ;IAED,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;AAClC,CAAC;AAAA,CAAC;AAEF,SAAS;AACT,SAAS,aAAa,CAAC,UAAyB;IAC5C,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE;QAChC,IAAI,SAAS,IAAI,MAAM,EAAE;YACrB,OAAO,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;SACzC;QACD,SAAS,IAAI,OAAO,CAAC;QACrB,OAAO,MAAM,CAAC,YAAY,CACtB,CAAC,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,EACtC,CAAC,CAAC,SAAS,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,CACjC,CAAC;IACN,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAChB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,KAAgB,EAAE,OAAuB;IAClE,OAAO,aAAa,CAAC,iBAAiB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;AAC5D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAW,EAAE,IAA+B;IACzE,OAAO,iBAAiB,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;AACrD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/uuid.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/uuid.d.ts deleted file mode 100644 index 7b746515..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/uuid.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { BytesLike } from "./index.js"; -/** - * Returns the version 4 [[link-uuid]] for the %%randomBytes%%. - * - * @see: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4) - */ -export declare function uuidV4(randomBytes: BytesLike): string; -//# sourceMappingURL=uuid.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/uuid.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/uuid.d.ts.map deleted file mode 100644 index f3cf307c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/uuid.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"uuid.d.ts","sourceRoot":"","sources":["../../src.ts/utils/uuid.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,WAAW,EAAE,SAAS,GAAG,MAAM,CAqBrD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/uuid.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/uuid.js deleted file mode 100644 index a6a45955..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/uuid.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Explain UUID and link to RFC here. - * - * @_subsection: api/utils:UUID [about-uuid] - */ -import { getBytes, hexlify } from "./data.js"; -/** - * Returns the version 4 [[link-uuid]] for the %%randomBytes%%. - * - * @see: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4) - */ -export function uuidV4(randomBytes) { - const bytes = getBytes(randomBytes, "randomBytes"); - // Section: 4.1.3: - // - time_hi_and_version[12:16] = 0b0100 - bytes[6] = (bytes[6] & 0x0f) | 0x40; - // Section 4.4 - // - clock_seq_hi_and_reserved[6] = 0b0 - // - clock_seq_hi_and_reserved[7] = 0b1 - bytes[8] = (bytes[8] & 0x3f) | 0x80; - const value = hexlify(bytes); - return [ - value.substring(2, 10), - value.substring(10, 14), - value.substring(14, 18), - value.substring(18, 22), - value.substring(22, 34), - ].join("-"); -} -//# sourceMappingURL=uuid.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/uuid.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/uuid.js.map deleted file mode 100644 index cd02033b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/utils/uuid.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"uuid.js","sourceRoot":"","sources":["../../src.ts/utils/uuid.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAI9C;;;;GAIG;AACH,MAAM,UAAU,MAAM,CAAC,WAAsB;IACzC,MAAM,KAAK,GAAG,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;IAEnD,kBAAkB;IAClB,wCAAwC;IACxC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAEpC,cAAc;IACd,uCAAuC;IACvC,uCAAuC;IACvC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAEpC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAE7B,OAAO;QACJ,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC;QACtB,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;QACvB,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;QACvB,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;QACvB,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;KACzB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAChB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/base-wallet.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/base-wallet.d.ts deleted file mode 100644 index e47edb57..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/base-wallet.d.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { AbstractSigner } from "../providers/index.js"; -import type { SigningKey } from "../crypto/index.js"; -import type { AuthorizationRequest, TypedDataDomain, TypedDataField } from "../hash/index.js"; -import type { Provider, TransactionRequest } from "../providers/index.js"; -import type { Authorization } from "../transaction/index.js"; -/** - * The **BaseWallet** is a stream-lined implementation of a - * [[Signer]] that operates with a private key. - * - * It is preferred to use the [[Wallet]] class, as it offers - * additional functionality and simplifies loading a variety - * of JSON formats, Mnemonic Phrases, etc. - * - * This class may be of use for those attempting to implement - * a minimal Signer. - */ -export declare class BaseWallet extends AbstractSigner { - #private; - /** - * The wallet address. - */ - readonly address: string; - /** - * Creates a new BaseWallet for %%privateKey%%, optionally - * connected to %%provider%%. - * - * If %%provider%% is not specified, only offline methods can - * be used. - */ - constructor(privateKey: SigningKey, provider?: null | Provider); - /** - * The [[SigningKey]] used for signing payloads. - */ - get signingKey(): SigningKey; - /** - * The private key for this wallet. - */ - get privateKey(): string; - getAddress(): Promise; - connect(provider: null | Provider): BaseWallet; - signTransaction(tx: TransactionRequest): Promise; - signMessage(message: string | Uint8Array): Promise; - /** - * Returns the signature for %%message%% signed with this wallet. - */ - signMessageSync(message: string | Uint8Array): string; - /** - * Returns the Authorization for %%auth%%. - */ - authorizeSync(auth: AuthorizationRequest): Authorization; - /** - * Resolves to the Authorization for %%auth%%. - */ - authorize(auth: AuthorizationRequest): Promise; - signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise; -} -//# sourceMappingURL=base-wallet.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/base-wallet.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/base-wallet.d.ts.map deleted file mode 100644 index 556ddc8c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/base-wallet.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base-wallet.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/base-wallet.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAe,MAAM,uBAAuB,CAAC;AAMpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EACR,oBAAoB,EAAE,eAAe,EAAE,cAAc,EACxD,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,KAAK,EAAE,aAAa,EAAmB,MAAM,yBAAyB,CAAC;AAG9E;;;;;;;;;;GAUG;AACH,qBAAa,UAAW,SAAQ,cAAc;;IAC1C;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAG,MAAM,CAAC;IAI1B;;;;;;OAMG;gBACS,UAAU,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ;IAc9D;;OAEG;IACH,IAAI,UAAU,IAAI,UAAU,CAA6B;IAEzD;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAAuC;IAEzD,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC;IAEnC,OAAO,CAAC,QAAQ,EAAE,IAAI,GAAG,QAAQ,GAAG,UAAU;IAIxC,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IAyBxD,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;IAMhE;;OAEG;IACH,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM;IAIrD;;OAEG;IACH,aAAa,CAAC,IAAI,EAAE,oBAAoB,GAAG,aAAa;IAYxD;;OAEG;IACG,SAAS,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,aAAa,CAAC;IAO7D,aAAa,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;CAsB1I"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/base-wallet.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/base-wallet.js deleted file mode 100644 index 8218c2ad..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/base-wallet.js +++ /dev/null @@ -1,123 +0,0 @@ -import { getAddress, resolveAddress } from "../address/index.js"; -import { hashAuthorization, hashMessage, TypedDataEncoder } from "../hash/index.js"; -import { AbstractSigner, copyRequest } from "../providers/index.js"; -import { computeAddress, Transaction } from "../transaction/index.js"; -import { defineProperties, getBigInt, resolveProperties, assert, assertArgument } from "../utils/index.js"; -/** - * The **BaseWallet** is a stream-lined implementation of a - * [[Signer]] that operates with a private key. - * - * It is preferred to use the [[Wallet]] class, as it offers - * additional functionality and simplifies loading a variety - * of JSON formats, Mnemonic Phrases, etc. - * - * This class may be of use for those attempting to implement - * a minimal Signer. - */ -export class BaseWallet extends AbstractSigner { - /** - * The wallet address. - */ - address; - #signingKey; - /** - * Creates a new BaseWallet for %%privateKey%%, optionally - * connected to %%provider%%. - * - * If %%provider%% is not specified, only offline methods can - * be used. - */ - constructor(privateKey, provider) { - super(provider); - assertArgument(privateKey && typeof (privateKey.sign) === "function", "invalid private key", "privateKey", "[ REDACTED ]"); - this.#signingKey = privateKey; - const address = computeAddress(this.signingKey.publicKey); - defineProperties(this, { address }); - } - // Store private values behind getters to reduce visibility - // in console.log - /** - * The [[SigningKey]] used for signing payloads. - */ - get signingKey() { return this.#signingKey; } - /** - * The private key for this wallet. - */ - get privateKey() { return this.signingKey.privateKey; } - async getAddress() { return this.address; } - connect(provider) { - return new BaseWallet(this.#signingKey, provider); - } - async signTransaction(tx) { - tx = copyRequest(tx); - // Replace any Addressable or ENS name with an address - const { to, from } = await resolveProperties({ - to: (tx.to ? resolveAddress(tx.to, this) : undefined), - from: (tx.from ? resolveAddress(tx.from, this) : undefined) - }); - if (to != null) { - tx.to = to; - } - if (from != null) { - tx.from = from; - } - if (tx.from != null) { - assertArgument(getAddress((tx.from)) === this.address, "transaction from address mismatch", "tx.from", tx.from); - delete tx.from; - } - // Build the transaction - const btx = Transaction.from(tx); - btx.signature = this.signingKey.sign(btx.unsignedHash); - return btx.serialized; - } - async signMessage(message) { - return this.signMessageSync(message); - } - // @TODO: Add a secialized signTx and signTyped sync that enforces - // all parameters are known? - /** - * Returns the signature for %%message%% signed with this wallet. - */ - signMessageSync(message) { - return this.signingKey.sign(hashMessage(message)).serialized; - } - /** - * Returns the Authorization for %%auth%%. - */ - authorizeSync(auth) { - assertArgument(typeof (auth.address) === "string", "invalid address for authorizeSync", "auth.address", auth); - const signature = this.signingKey.sign(hashAuthorization(auth)); - return Object.assign({}, { - address: getAddress(auth.address), - nonce: getBigInt(auth.nonce || 0), - chainId: getBigInt(auth.chainId || 0), - }, { signature }); - } - /** - * Resolves to the Authorization for %%auth%%. - */ - async authorize(auth) { - auth = Object.assign({}, auth, { - address: await resolveAddress(auth.address, this) - }); - return this.authorizeSync(await this.populateAuthorization(auth)); - } - async signTypedData(domain, types, value) { - // Populate any ENS names - const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (name) => { - // @TODO: this should use resolveName; addresses don't - // need a provider - assert(this.provider != null, "cannot resolve ENS names without a provider", "UNSUPPORTED_OPERATION", { - operation: "resolveName", - info: { name } - }); - const address = await this.provider.resolveName(name); - assert(address != null, "unconfigured ENS name", "UNCONFIGURED_NAME", { - value: name - }); - return address; - }); - return this.signingKey.sign(TypedDataEncoder.hash(populated.domain, types, populated.value)).serialized; - } -} -//# sourceMappingURL=base-wallet.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/base-wallet.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/base-wallet.js.map deleted file mode 100644 index e8f1c8b5..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/base-wallet.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base-wallet.js","sourceRoot":"","sources":["../../src.ts/wallet/base-wallet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EACH,iBAAiB,EAAE,WAAW,EAAE,gBAAgB,EACnD,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EACH,gBAAgB,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,EAAE,cAAc,EACzE,MAAM,mBAAmB,CAAC;AAU3B;;;;;;;;;;GAUG;AACH,MAAM,OAAO,UAAW,SAAQ,cAAc;IAC1C;;OAEG;IACM,OAAO,CAAU;IAEjB,WAAW,CAAa;IAEjC;;;;;;OAMG;IACH,YAAY,UAAsB,EAAE,QAA0B;QAC1D,KAAK,CAAC,QAAQ,CAAC,CAAC;QAEhB,cAAc,CAAC,UAAU,IAAI,OAAM,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,UAAU,EAAE,qBAAqB,EAAE,YAAY,EAAE,cAAc,CAAC,CAAC;QAE1H,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAE9B,MAAM,OAAO,GAAG,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;QAC1D,gBAAgB,CAAa,IAAI,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E,IAAI,EAAE;YAC5B,OAAO,EAAE,MAAM,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC;SACpD,CAAC,CAAC;QACH,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC;IACtE,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,MAAuB,EAAE,KAA4C,EAAE,KAA0B;QAEjH,yBAAyB;QACzB,MAAM,SAAS,GAAG,MAAM,gBAAgB,CAAC,YAAY,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAY,EAAE,EAAE;YAC/F,sDAAsD;YACtD,yBAAyB;YAEzB,MAAM,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,EAAE,6CAA6C,EAAE,uBAAuB,EAAE;gBAClG,SAAS,EAAE,aAAa;gBACxB,IAAI,EAAE,EAAE,IAAI,EAAE;aACjB,CAAC,CAAC;YAEH,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YACtD,MAAM,CAAC,OAAO,IAAI,IAAI,EAAE,uBAAuB,EAAE,mBAAmB,EAAE;gBAClE,KAAK,EAAE,IAAI;aACd,CAAC,CAAC;YAEH,OAAO,OAAO,CAAC;QACnB,CAAC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC;IAC5G,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/hdwallet.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/hdwallet.d.ts deleted file mode 100644 index 770ddd7c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/hdwallet.d.ts +++ /dev/null @@ -1,248 +0,0 @@ -/** - * Explain HD Wallets.. - * - * @_subsection: api/wallet:HD Wallets [hd-wallets] - */ -import { SigningKey } from "../crypto/index.js"; -import { VoidSigner } from "../providers/index.js"; -import { BaseWallet } from "./base-wallet.js"; -import { Mnemonic } from "./mnemonic.js"; -import type { ProgressCallback } from "../crypto/index.js"; -import type { Provider } from "../providers/index.js"; -import type { BytesLike, Numeric } from "../utils/index.js"; -import type { Wordlist } from "../wordlists/index.js"; -/** - * The default derivation path for Ethereum HD Nodes. (i.e. ``"m/44'/60'/0'/0/0"``) - */ -export declare const defaultPath: string; -/** - * An **HDNodeWallet** is a [[Signer]] backed by the private key derived - * from an HD Node using the [[link-bip-32]] stantard. - * - * An HD Node forms a hierarchal structure with each HD Node having a - * private key and the ability to derive child HD Nodes, defined by - * a path indicating the index of each child. - */ -export declare class HDNodeWallet extends BaseWallet { - #private; - /** - * The compressed public key. - */ - readonly publicKey: string; - /** - * The fingerprint. - * - * A fingerprint allows quick qay to detect parent and child nodes, - * but developers should be prepared to deal with collisions as it - * is only 4 bytes. - */ - readonly fingerprint: string; - /** - * The parent fingerprint. - */ - readonly parentFingerprint: string; - /** - * The mnemonic used to create this HD Node, if available. - * - * Sources such as extended keys do not encode the mnemonic, in - * which case this will be ``null``. - */ - readonly mnemonic: null | Mnemonic; - /** - * The chaincode, which is effectively a public key used - * to derive children. - */ - readonly chainCode: string; - /** - * The derivation path of this wallet. - * - * Since extended keys do not provide full path details, this - * may be ``null``, if instantiated from a source that does not - * encode it. - */ - readonly path: null | string; - /** - * The child index of this wallet. Values over ``2 *\* 31`` indicate - * the node is hardened. - */ - readonly index: number; - /** - * The depth of this wallet, which is the number of components - * in its path. - */ - readonly depth: number; - /** - * @private - */ - constructor(guard: any, signingKey: SigningKey, parentFingerprint: string, chainCode: string, path: null | string, index: number, depth: number, mnemonic: null | Mnemonic, provider: null | Provider); - connect(provider: null | Provider): HDNodeWallet; - /** - * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with - * %%password%%. - * - * If %%progressCallback%% is specified, it will receive periodic - * updates as the encryption process progreses. - */ - encrypt(password: Uint8Array | string, progressCallback?: ProgressCallback): Promise; - /** - * Returns a [JSON Keystore Wallet](json-wallets) encryped with - * %%password%%. - * - * It is preferred to use the [async version](encrypt) instead, - * which allows a [[ProgressCallback]] to keep the user informed. - * - * This method will block the event loop (freezing all UI) until - * it is complete, which may be a non-trivial duration. - */ - encryptSync(password: Uint8Array | string): string; - /** - * The extended key. - * - * This key will begin with the prefix ``xpriv`` and can be used to - * reconstruct this HD Node to derive its children. - */ - get extendedKey(): string; - /** - * Returns true if this wallet has a path, providing a Type Guard - * that the path is non-null. - */ - hasPath(): this is { - path: string; - }; - /** - * Returns a neutered HD Node, which removes the private details - * of an HD Node. - * - * A neutered node has no private key, but can be used to derive - * child addresses and other public data about the HD Node. - */ - neuter(): HDNodeVoidWallet; - /** - * Return the child for %%index%%. - */ - deriveChild(_index: Numeric): HDNodeWallet; - /** - * Return the HDNode for %%path%% from this node. - */ - derivePath(path: string): HDNodeWallet; - /** - * Creates a new HD Node from %%extendedKey%%. - * - * If the %%extendedKey%% will either have a prefix or ``xpub`` or - * ``xpriv``, returning a neutered HD Node ([[HDNodeVoidWallet]]) - * or full HD Node ([[HDNodeWallet) respectively. - */ - static fromExtendedKey(extendedKey: string): HDNodeWallet | HDNodeVoidWallet; - /** - * Creates a new random HDNode. - */ - static createRandom(password?: string, path?: string, wordlist?: Wordlist): HDNodeWallet; - /** - * Create an HD Node from %%mnemonic%%. - */ - static fromMnemonic(mnemonic: Mnemonic, path?: string): HDNodeWallet; - /** - * Creates an HD Node from a mnemonic %%phrase%%. - */ - static fromPhrase(phrase: string, password?: string, path?: string, wordlist?: Wordlist): HDNodeWallet; - /** - * Creates an HD Node from a %%seed%%. - */ - static fromSeed(seed: BytesLike): HDNodeWallet; -} -/** - * A **HDNodeVoidWallet** cannot sign, but provides access to - * the children nodes of a [[link-bip-32]] HD wallet addresses. - * - * The can be created by using an extended ``xpub`` key to - * [[HDNodeWallet_fromExtendedKey]] or by - * [nuetering](HDNodeWallet-neuter) a [[HDNodeWallet]]. - */ -export declare class HDNodeVoidWallet extends VoidSigner { - /** - * The compressed public key. - */ - readonly publicKey: string; - /** - * The fingerprint. - * - * A fingerprint allows quick qay to detect parent and child nodes, - * but developers should be prepared to deal with collisions as it - * is only 4 bytes. - */ - readonly fingerprint: string; - /** - * The parent node fingerprint. - */ - readonly parentFingerprint: string; - /** - * The chaincode, which is effectively a public key used - * to derive children. - */ - readonly chainCode: string; - /** - * The derivation path of this wallet. - * - * Since extended keys do not provider full path details, this - * may be ``null``, if instantiated from a source that does not - * enocde it. - */ - readonly path: null | string; - /** - * The child index of this wallet. Values over ``2 *\* 31`` indicate - * the node is hardened. - */ - readonly index: number; - /** - * The depth of this wallet, which is the number of components - * in its path. - */ - readonly depth: number; - /** - * @private - */ - constructor(guard: any, address: string, publicKey: string, parentFingerprint: string, chainCode: string, path: null | string, index: number, depth: number, provider: null | Provider); - connect(provider: null | Provider): HDNodeVoidWallet; - /** - * The extended key. - * - * This key will begin with the prefix ``xpub`` and can be used to - * reconstruct this neutered key to derive its children addresses. - */ - get extendedKey(): string; - /** - * Returns true if this wallet has a path, providing a Type Guard - * that the path is non-null. - */ - hasPath(): this is { - path: string; - }; - /** - * Return the child for %%index%%. - */ - deriveChild(_index: Numeric): HDNodeVoidWallet; - /** - * Return the signer for %%path%% from this node. - */ - derivePath(path: string): HDNodeVoidWallet; -} -/** - * Returns the [[link-bip-32]] path for the account at %%index%%. - * - * This is the pattern used by wallets like Ledger. - * - * There is also an [alternate pattern](getIndexedAccountPath) used by - * some software. - */ -export declare function getAccountPath(_index: Numeric): string; -/** - * Returns the path using an alternative pattern for deriving accounts, - * at %%index%%. - * - * This derivation path uses the //index// component rather than the - * //account// component to derive sequential accounts. - * - * This is the pattern used by wallets like MetaMask. - */ -export declare function getIndexedAccountPath(_index: Numeric): string; -//# sourceMappingURL=hdwallet.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/hdwallet.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/hdwallet.d.ts.map deleted file mode 100644 index 8c2afd91..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/hdwallet.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hdwallet.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/hdwallet.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAuC,UAAU,EAAU,MAAM,oBAAoB,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAUnD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAKzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAItD;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,MAA2B,CAAC;AAsFtD;;;;;;;GAOG;AACH,qBAAa,YAAa,SAAQ,UAAU;;IACxC;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAG,MAAM,CAAC;IAE5B;;;;;;OAMG;IACH,QAAQ,CAAC,WAAW,EAAG,MAAM,CAAC;IAE9B;;OAEG;IACH,QAAQ,CAAC,iBAAiB,EAAG,MAAM,CAAC;IAEpC;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAG,IAAI,GAAG,QAAQ,CAAC;IAEpC;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAG,MAAM,CAAC;IAE5B;;;;;;OAMG;IACH,QAAQ,CA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G;IACH,OAAO,IAAI,IAAI,IAAI;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE;IAEnC;;OAEG;IACH,WAAW,CAAC,MAAM,EAAE,OAAO,GAAG,gBAAgB;IAqB9C;;OAEG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB;CAG7C;AAmBD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAItD;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAI7D"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/hdwallet.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/hdwallet.js deleted file mode 100644 index ff5d4503..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/hdwallet.js +++ /dev/null @@ -1,499 +0,0 @@ -/** - * Explain HD Wallets.. - * - * @_subsection: api/wallet:HD Wallets [hd-wallets] - */ -import { computeHmac, randomBytes, ripemd160, SigningKey, sha256 } from "../crypto/index.js"; -import { VoidSigner } from "../providers/index.js"; -import { computeAddress } from "../transaction/index.js"; -import { concat, dataSlice, decodeBase58, defineProperties, encodeBase58, getBytes, hexlify, isBytesLike, getNumber, toBeArray, toBigInt, toBeHex, assertPrivate, assert, assertArgument } from "../utils/index.js"; -import { LangEn } from "../wordlists/lang-en.js"; -import { BaseWallet } from "./base-wallet.js"; -import { Mnemonic } from "./mnemonic.js"; -import { encryptKeystoreJson, encryptKeystoreJsonSync, } from "./json-keystore.js"; -/** - * The default derivation path for Ethereum HD Nodes. (i.e. ``"m/44'/60'/0'/0/0"``) - */ -export const defaultPath = "m/44'/60'/0'/0/0"; -// "Bitcoin seed" -const MasterSecret = new Uint8Array([66, 105, 116, 99, 111, 105, 110, 32, 115, 101, 101, 100]); -const HardenedBit = 0x80000000; -const N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); -const Nibbles = "0123456789abcdef"; -function zpad(value, length) { - let result = ""; - while (value) { - result = Nibbles[value % 16] + result; - value = Math.trunc(value / 16); - } - while (result.length < length * 2) { - result = "0" + result; - } - return "0x" + result; -} -function encodeBase58Check(_value) { - const value = getBytes(_value); - const check = dataSlice(sha256(sha256(value)), 0, 4); - const bytes = concat([value, check]); - return encodeBase58(bytes); -} -const _guard = {}; -function ser_I(index, chainCode, publicKey, privateKey) { - const data = new Uint8Array(37); - if (index & HardenedBit) { - assert(privateKey != null, "cannot derive child of neutered node", "UNSUPPORTED_OPERATION", { - operation: "deriveChild" - }); - // Data = 0x00 || ser_256(k_par) - data.set(getBytes(privateKey), 1); - } - else { - // Data = ser_p(point(k_par)) - data.set(getBytes(publicKey)); - } - // Data += ser_32(i) - for (let i = 24; i >= 0; i -= 8) { - data[33 + (i >> 3)] = ((index >> (24 - i)) & 0xff); - } - const I = getBytes(computeHmac("sha512", chainCode, data)); - return { IL: I.slice(0, 32), IR: I.slice(32) }; -} -function derivePath(node, path) { - const components = path.split("/"); - assertArgument(components.length > 0, "invalid path", "path", path); - if (components[0] === "m") { - assertArgument(node.depth === 0, `cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${node.depth}`, "path", path); - components.shift(); - } - let result = node; - for (let i = 0; i < components.length; i++) { - const component = components[i]; - if (component.match(/^[0-9]+'$/)) { - const index = parseInt(component.substring(0, component.length - 1)); - assertArgument(index < HardenedBit, "invalid path index", `path[${i}]`, component); - result = result.deriveChild(HardenedBit + index); - } - else if (component.match(/^[0-9]+$/)) { - const index = parseInt(component); - assertArgument(index < HardenedBit, "invalid path index", `path[${i}]`, component); - result = result.deriveChild(index); - } - else { - assertArgument(false, "invalid path component", `path[${i}]`, component); - } - } - return result; -} -/** - * An **HDNodeWallet** is a [[Signer]] backed by the private key derived - * from an HD Node using the [[link-bip-32]] stantard. - * - * An HD Node forms a hierarchal structure with each HD Node having a - * private key and the ability to derive child HD Nodes, defined by - * a path indicating the index of each child. - */ -export class HDNodeWallet extends BaseWallet { - /** - * The compressed public key. - */ - publicKey; - /** - * The fingerprint. - * - * A fingerprint allows quick qay to detect parent and child nodes, - * but developers should be prepared to deal with collisions as it - * is only 4 bytes. - */ - fingerprint; - /** - * The parent fingerprint. - */ - parentFingerprint; - /** - * The mnemonic used to create this HD Node, if available. - * - * Sources such as extended keys do not encode the mnemonic, in - * which case this will be ``null``. - */ - mnemonic; - /** - * The chaincode, which is effectively a public key used - * to derive children. - */ - chainCode; - /** - * The derivation path of this wallet. - * - * Since extended keys do not provide full path details, this - * may be ``null``, if instantiated from a source that does not - * encode it. - */ - path; - /** - * The child index of this wallet. Values over ``2 *\* 31`` indicate - * the node is hardened. - */ - index; - /** - * The depth of this wallet, which is the number of components - * in its path. - */ - depth; - /** - * @private - */ - constructor(guard, signingKey, parentFingerprint, chainCode, path, index, depth, mnemonic, provider) { - super(signingKey, provider); - assertPrivate(guard, _guard, "HDNodeWallet"); - defineProperties(this, { publicKey: signingKey.compressedPublicKey }); - const fingerprint = dataSlice(ripemd160(sha256(this.publicKey)), 0, 4); - defineProperties(this, { - parentFingerprint, fingerprint, - chainCode, path, index, depth - }); - defineProperties(this, { mnemonic }); - } - connect(provider) { - return new HDNodeWallet(_guard, this.signingKey, this.parentFingerprint, this.chainCode, this.path, this.index, this.depth, this.mnemonic, provider); - } - #account() { - const account = { address: this.address, privateKey: this.privateKey }; - const m = this.mnemonic; - if (this.path && m && m.wordlist.locale === "en" && m.password === "") { - account.mnemonic = { - path: this.path, - locale: "en", - entropy: m.entropy - }; - } - return account; - } - /** - * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with - * %%password%%. - * - * If %%progressCallback%% is specified, it will receive periodic - * updates as the encryption process progreses. - */ - async encrypt(password, progressCallback) { - return await encryptKeystoreJson(this.#account(), password, { progressCallback }); - } - /** - * Returns a [JSON Keystore Wallet](json-wallets) encryped with - * %%password%%. - * - * It is preferred to use the [async version](encrypt) instead, - * which allows a [[ProgressCallback]] to keep the user informed. - * - * This method will block the event loop (freezing all UI) until - * it is complete, which may be a non-trivial duration. - */ - encryptSync(password) { - return encryptKeystoreJsonSync(this.#account(), password); - } - /** - * The extended key. - * - * This key will begin with the prefix ``xpriv`` and can be used to - * reconstruct this HD Node to derive its children. - */ - get extendedKey() { - // We only support the mainnet values for now, but if anyone needs - // testnet values, let me know. I believe current sentiment is that - // we should always use mainnet, and use BIP-44 to derive the network - // - Mainnet: public=0x0488B21E, private=0x0488ADE4 - // - Testnet: public=0x043587CF, private=0x04358394 - assert(this.depth < 256, "Depth too deep", "UNSUPPORTED_OPERATION", { operation: "extendedKey" }); - return encodeBase58Check(concat([ - "0x0488ADE4", zpad(this.depth, 1), this.parentFingerprint, - zpad(this.index, 4), this.chainCode, - concat(["0x00", this.privateKey]) - ])); - } - /** - * Returns true if this wallet has a path, providing a Type Guard - * that the path is non-null. - */ - hasPath() { return (this.path != null); } - /** - * Returns a neutered HD Node, which removes the private details - * of an HD Node. - * - * A neutered node has no private key, but can be used to derive - * child addresses and other public data about the HD Node. - */ - neuter() { - return new HDNodeVoidWallet(_guard, this.address, this.publicKey, this.parentFingerprint, this.chainCode, this.path, this.index, this.depth, this.provider); - } - /** - * Return the child for %%index%%. - */ - deriveChild(_index) { - const index = getNumber(_index, "index"); - assertArgument(index <= 0xffffffff, "invalid index", "index", index); - // Base path - let path = this.path; - if (path) { - path += "/" + (index & ~HardenedBit); - if (index & HardenedBit) { - path += "'"; - } - } - const { IR, IL } = ser_I(index, this.chainCode, this.publicKey, this.privateKey); - const ki = new SigningKey(toBeHex((toBigInt(IL) + BigInt(this.privateKey)) % N, 32)); - return new HDNodeWallet(_guard, ki, this.fingerprint, hexlify(IR), path, index, this.depth + 1, this.mnemonic, this.provider); - } - /** - * Return the HDNode for %%path%% from this node. - */ - derivePath(path) { - return derivePath(this, path); - } - static #fromSeed(_seed, mnemonic) { - assertArgument(isBytesLike(_seed), "invalid seed", "seed", "[REDACTED]"); - const seed = getBytes(_seed, "seed"); - assertArgument(seed.length >= 16 && seed.length <= 64, "invalid seed", "seed", "[REDACTED]"); - const I = getBytes(computeHmac("sha512", MasterSecret, seed)); - const signingKey = new SigningKey(hexlify(I.slice(0, 32))); - return new HDNodeWallet(_guard, signingKey, "0x00000000", hexlify(I.slice(32)), "m", 0, 0, mnemonic, null); - } - /** - * Creates a new HD Node from %%extendedKey%%. - * - * If the %%extendedKey%% will either have a prefix or ``xpub`` or - * ``xpriv``, returning a neutered HD Node ([[HDNodeVoidWallet]]) - * or full HD Node ([[HDNodeWallet) respectively. - */ - static fromExtendedKey(extendedKey) { - const bytes = toBeArray(decodeBase58(extendedKey)); // @TODO: redact - assertArgument(bytes.length === 82 || encodeBase58Check(bytes.slice(0, 78)) === extendedKey, "invalid extended key", "extendedKey", "[ REDACTED ]"); - const depth = bytes[4]; - const parentFingerprint = hexlify(bytes.slice(5, 9)); - const index = parseInt(hexlify(bytes.slice(9, 13)).substring(2), 16); - const chainCode = hexlify(bytes.slice(13, 45)); - const key = bytes.slice(45, 78); - switch (hexlify(bytes.slice(0, 4))) { - // Public Key - case "0x0488b21e": - case "0x043587cf": { - const publicKey = hexlify(key); - return new HDNodeVoidWallet(_guard, computeAddress(publicKey), publicKey, parentFingerprint, chainCode, null, index, depth, null); - } - // Private Key - case "0x0488ade4": - case "0x04358394 ": - if (key[0] !== 0) { - break; - } - return new HDNodeWallet(_guard, new SigningKey(key.slice(1)), parentFingerprint, chainCode, null, index, depth, null, null); - } - assertArgument(false, "invalid extended key prefix", "extendedKey", "[ REDACTED ]"); - } - /** - * Creates a new random HDNode. - */ - static createRandom(password, path, wordlist) { - if (password == null) { - password = ""; - } - if (path == null) { - path = defaultPath; - } - if (wordlist == null) { - wordlist = LangEn.wordlist(); - } - const mnemonic = Mnemonic.fromEntropy(randomBytes(16), password, wordlist); - return HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path); - } - /** - * Create an HD Node from %%mnemonic%%. - */ - static fromMnemonic(mnemonic, path) { - if (!path) { - path = defaultPath; - } - return HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path); - } - /** - * Creates an HD Node from a mnemonic %%phrase%%. - */ - static fromPhrase(phrase, password, path, wordlist) { - if (password == null) { - password = ""; - } - if (path == null) { - path = defaultPath; - } - if (wordlist == null) { - wordlist = LangEn.wordlist(); - } - const mnemonic = Mnemonic.fromPhrase(phrase, password, wordlist); - return HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path); - } - /** - * Creates an HD Node from a %%seed%%. - */ - static fromSeed(seed) { - return HDNodeWallet.#fromSeed(seed, null); - } -} -/** - * A **HDNodeVoidWallet** cannot sign, but provides access to - * the children nodes of a [[link-bip-32]] HD wallet addresses. - * - * The can be created by using an extended ``xpub`` key to - * [[HDNodeWallet_fromExtendedKey]] or by - * [nuetering](HDNodeWallet-neuter) a [[HDNodeWallet]]. - */ -export class HDNodeVoidWallet extends VoidSigner { - /** - * The compressed public key. - */ - publicKey; - /** - * The fingerprint. - * - * A fingerprint allows quick qay to detect parent and child nodes, - * but developers should be prepared to deal with collisions as it - * is only 4 bytes. - */ - fingerprint; - /** - * The parent node fingerprint. - */ - parentFingerprint; - /** - * The chaincode, which is effectively a public key used - * to derive children. - */ - chainCode; - /** - * The derivation path of this wallet. - * - * Since extended keys do not provider full path details, this - * may be ``null``, if instantiated from a source that does not - * enocde it. - */ - path; - /** - * The child index of this wallet. Values over ``2 *\* 31`` indicate - * the node is hardened. - */ - index; - /** - * The depth of this wallet, which is the number of components - * in its path. - */ - depth; - /** - * @private - */ - constructor(guard, address, publicKey, parentFingerprint, chainCode, path, index, depth, provider) { - super(address, provider); - assertPrivate(guard, _guard, "HDNodeVoidWallet"); - defineProperties(this, { publicKey }); - const fingerprint = dataSlice(ripemd160(sha256(publicKey)), 0, 4); - defineProperties(this, { - publicKey, fingerprint, parentFingerprint, chainCode, path, index, depth - }); - } - connect(provider) { - return new HDNodeVoidWallet(_guard, this.address, this.publicKey, this.parentFingerprint, this.chainCode, this.path, this.index, this.depth, provider); - } - /** - * The extended key. - * - * This key will begin with the prefix ``xpub`` and can be used to - * reconstruct this neutered key to derive its children addresses. - */ - get extendedKey() { - // We only support the mainnet values for now, but if anyone needs - // testnet values, let me know. I believe current sentiment is that - // we should always use mainnet, and use BIP-44 to derive the network - // - Mainnet: public=0x0488B21E, private=0x0488ADE4 - // - Testnet: public=0x043587CF, private=0x04358394 - assert(this.depth < 256, "Depth too deep", "UNSUPPORTED_OPERATION", { operation: "extendedKey" }); - return encodeBase58Check(concat([ - "0x0488B21E", - zpad(this.depth, 1), - this.parentFingerprint, - zpad(this.index, 4), - this.chainCode, - this.publicKey, - ])); - } - /** - * Returns true if this wallet has a path, providing a Type Guard - * that the path is non-null. - */ - hasPath() { return (this.path != null); } - /** - * Return the child for %%index%%. - */ - deriveChild(_index) { - const index = getNumber(_index, "index"); - assertArgument(index <= 0xffffffff, "invalid index", "index", index); - // Base path - let path = this.path; - if (path) { - path += "/" + (index & ~HardenedBit); - if (index & HardenedBit) { - path += "'"; - } - } - const { IR, IL } = ser_I(index, this.chainCode, this.publicKey, null); - const Ki = SigningKey.addPoints(IL, this.publicKey, true); - const address = computeAddress(Ki); - return new HDNodeVoidWallet(_guard, address, Ki, this.fingerprint, hexlify(IR), path, index, this.depth + 1, this.provider); - } - /** - * Return the signer for %%path%% from this node. - */ - derivePath(path) { - return derivePath(this, path); - } -} -/* -export class HDNodeWalletManager { - #root: HDNodeWallet; - - constructor(phrase: string, password?: null | string, path?: null | string, locale?: null | Wordlist) { - if (password == null) { password = ""; } - if (path == null) { path = "m/44'/60'/0'/0"; } - if (locale == null) { locale = LangEn.wordlist(); } - this.#root = HDNodeWallet.fromPhrase(phrase, password, path, locale); - } - - getSigner(index?: number): HDNodeWallet { - return this.#root.deriveChild((index == null) ? 0: index); - } -} -*/ -/** - * Returns the [[link-bip-32]] path for the account at %%index%%. - * - * This is the pattern used by wallets like Ledger. - * - * There is also an [alternate pattern](getIndexedAccountPath) used by - * some software. - */ -export function getAccountPath(_index) { - const index = getNumber(_index, "index"); - assertArgument(index >= 0 && index < HardenedBit, "invalid account index", "index", index); - return `m/44'/60'/${index}'/0/0`; -} -/** - * Returns the path using an alternative pattern for deriving accounts, - * at %%index%%. - * - * This derivation path uses the //index// component rather than the - * //account// component to derive sequential accounts. - * - * This is the pattern used by wallets like MetaMask. - */ -export function getIndexedAccountPath(_index) { - const index = getNumber(_index, "index"); - assertArgument(index >= 0 && index < HardenedBit, "invalid account index", "index", index); - return `m/44'/60'/0'/0/${index}`; -} -//# sourceMappingURL=hdwallet.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/hdwallet.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/hdwallet.js.map deleted file mode 100644 index 92d13d46..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/hdwallet.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hdwallet.js","sourceRoot":"","sources":["../../src.ts/wallet/hdwallet.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EACH,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAC/D,QAAQ,EAAE,OAAO,EAAE,WAAW,EAC9B,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EACvC,aAAa,EAAE,MAAM,EAAE,cAAc,EACxC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC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;;;GAQG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAAe;IACjD,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,cAAc,CAAC,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,WAAW,EAAE,uBAAuB,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IAC3F,OAAO,kBAAmB,KAAK,EAAE,CAAC;AACtC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/index.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/index.d.ts deleted file mode 100644 index 8156435f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/index.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -/** - * When interacting with Ethereum, it is necessary to use a private - * key authenticate actions by signing a payload. - * - * Wallets are the simplest way to expose the concept of an - * //Externally Owner Account// (EOA) as it wraps a private key - * and supports high-level methods to sign common types of interaction - * and send transactions. - * - * The class most developers will want to use is [[Wallet]], which - * can load a private key directly or from any common wallet format. - * - * The [[HDNodeWallet]] can be used when it is necessary to access - * low-level details of how an HD wallets are derived, exported - * or imported. - * - * @_section: api/wallet:Wallets [about-wallets] - */ -export { BaseWallet } from "./base-wallet.js"; -export { defaultPath, getAccountPath, getIndexedAccountPath, HDNodeWallet, HDNodeVoidWallet, } from "./hdwallet.js"; -export { isCrowdsaleJson, decryptCrowdsaleJson } from "./json-crowdsale.js"; -export { isKeystoreJson, decryptKeystoreJsonSync, decryptKeystoreJson, encryptKeystoreJson, encryptKeystoreJsonSync } from "./json-keystore.js"; -export { Mnemonic } from "./mnemonic.js"; -export { Wallet } from "./wallet.js"; -export type { CrowdsaleAccount } from "./json-crowdsale.js"; -export type { KeystoreAccount, EncryptOptions } from "./json-keystore.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/index.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/index.d.ts.map deleted file mode 100644 index 707d088f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EACH,WAAW,EAEX,cAAc,EAAE,qBAAqB,EAErC,YAAY,EACZ,gBAAgB,GACnB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,OAAO,EACH,cAAc,EACd,uBAAuB,EAAE,mBAAmB,EAC5C,mBAAmB,EAAE,uBAAuB,EAC/C,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,YAAY,EACR,eAAe,EAAE,cAAc,EAClC,MAAM,oBAAoB,CAAA"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/index.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/index.js deleted file mode 100644 index bc9d7f4a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/index.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * When interacting with Ethereum, it is necessary to use a private - * key authenticate actions by signing a payload. - * - * Wallets are the simplest way to expose the concept of an - * //Externally Owner Account// (EOA) as it wraps a private key - * and supports high-level methods to sign common types of interaction - * and send transactions. - * - * The class most developers will want to use is [[Wallet]], which - * can load a private key directly or from any common wallet format. - * - * The [[HDNodeWallet]] can be used when it is necessary to access - * low-level details of how an HD wallets are derived, exported - * or imported. - * - * @_section: api/wallet:Wallets [about-wallets] - */ -export { BaseWallet } from "./base-wallet.js"; -export { defaultPath, getAccountPath, getIndexedAccountPath, HDNodeWallet, HDNodeVoidWallet, } from "./hdwallet.js"; -export { isCrowdsaleJson, decryptCrowdsaleJson } from "./json-crowdsale.js"; -export { isKeystoreJson, decryptKeystoreJsonSync, decryptKeystoreJson, encryptKeystoreJson, encryptKeystoreJsonSync } from "./json-keystore.js"; -export { Mnemonic } from "./mnemonic.js"; -export { Wallet } from "./wallet.js"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/index.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/index.js.map deleted file mode 100644 index f3137924..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/wallet/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EACH,WAAW,EAEX,cAAc,EAAE,qBAAqB,EAErC,YAAY,EACZ,gBAAgB,GACnB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,OAAO,EACH,cAAc,EACd,uBAAuB,EAAE,mBAAmB,EAC5C,mBAAmB,EAAE,uBAAuB,EAC/C,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/json-crowdsale.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/json-crowdsale.d.ts deleted file mode 100644 index 3d7f4a2b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/json-crowdsale.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @_subsection: api/wallet:JSON Wallets [json-wallets] - */ -/** - * The data stored within a JSON Crowdsale wallet is fairly - * minimal. - */ -export type CrowdsaleAccount = { - privateKey: string; - address: string; -}; -/** - * Returns true if %%json%% is a valid JSON Crowdsale wallet. - */ -export declare function isCrowdsaleJson(json: string): boolean; -/** - * Before Ethereum launched, it was necessary to create a wallet - * format for backers to use, which would be used to receive ether - * as a reward for contributing to the project. - * - * The [[link-crowdsale]] format is now obsolete, but it is still - * useful to support and the additional code is fairly trivial as - * all the primitives required are used through core portions of - * the library. - */ -export declare function decryptCrowdsaleJson(json: string, _password: string | Uint8Array): CrowdsaleAccount; -//# sourceMappingURL=json-crowdsale.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/json-crowdsale.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/json-crowdsale.d.ts.map deleted file mode 100644 index a569abcd..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/json-crowdsale.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"json-crowdsale.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/json-crowdsale.ts"],"names":[],"mappings":"AAAA;;GAEG;AAYH;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACnB,CAAA;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAMrD;AAID;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,UAAU,GAAG,gBAAgB,CA2BnG"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/json-crowdsale.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/json-crowdsale.js deleted file mode 100644 index a9121188..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/json-crowdsale.js +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @_subsection: api/wallet:JSON Wallets [json-wallets] - */ -import { CBC, pkcs7Strip } from "aes-js"; -import { getAddress } from "../address/index.js"; -import { pbkdf2 } from "../crypto/index.js"; -import { id } from "../hash/index.js"; -import { getBytes, assertArgument } from "../utils/index.js"; -import { getPassword, looseArrayify, spelunk } from "./utils.js"; -/** - * Returns true if %%json%% is a valid JSON Crowdsale wallet. - */ -export function isCrowdsaleJson(json) { - try { - const data = JSON.parse(json); - if (data.encseed) { - return true; - } - } - catch (error) { } - return false; -} -// See: https://github.com/ethereum/pyethsaletool -/** - * Before Ethereum launched, it was necessary to create a wallet - * format for backers to use, which would be used to receive ether - * as a reward for contributing to the project. - * - * The [[link-crowdsale]] format is now obsolete, but it is still - * useful to support and the additional code is fairly trivial as - * all the primitives required are used through core portions of - * the library. - */ -export function decryptCrowdsaleJson(json, _password) { - const data = JSON.parse(json); - const password = getPassword(_password); - // Ethereum Address - const address = getAddress(spelunk(data, "ethaddr:string!")); - // Encrypted Seed - const encseed = looseArrayify(spelunk(data, "encseed:string!")); - assertArgument(encseed && (encseed.length % 16) === 0, "invalid encseed", "json", json); - const key = getBytes(pbkdf2(password, password, 2000, 32, "sha256")).slice(0, 16); - const iv = encseed.slice(0, 16); - const encryptedSeed = encseed.slice(16); - // Decrypt the seed - const aesCbc = new CBC(key, iv); - const seed = pkcs7Strip(getBytes(aesCbc.decrypt(encryptedSeed))); - // This wallet format is weird... Convert the binary encoded hex to a string. - let seedHex = ""; - for (let i = 0; i < seed.length; i++) { - seedHex += String.fromCharCode(seed[i]); - } - return { address, privateKey: id(seedHex) }; -} -//# sourceMappingURL=json-crowdsale.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/json-crowdsale.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/json-crowdsale.js.map deleted file mode 100644 index 2281cca9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/json-crowdsale.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"json-crowdsale.js","sourceRoot":"","sources":["../../src.ts/wallet/json-crowdsale.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAYjE;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY;IACxC,IAAI;QACA,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC9B,IAAI,IAAI,CAAC,OAAO,EAAE;YAAE,OAAO,IAAI,CAAC;SAAE;KACrC;IAAC,OAAO,KAAK,EAAE,GAAG;IACnB,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,iDAAiD;AAEjD;;;;;;;;;GASG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAY,EAAE,SAA8B;IAC7E,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC9B,MAAM,QAAQ,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;IAExC,mBAAmB;IACnB,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAE7D,iBAAiB;IACjB,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAChE,cAAc,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,EAAE,CAAC,KAAK,CAAC,EAAE,iBAAiB,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IAExF,MAAM,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAElF,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAChC,MAAM,aAAa,GAAG,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAExC,mBAAmB;IACnB,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAChC,MAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAEjE,6EAA6E;IAC7E,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAClC,OAAO,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;KAC3C;IAED,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;AAChD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/json-keystore.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/json-keystore.d.ts deleted file mode 100644 index c01076fe..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/json-keystore.d.ts +++ /dev/null @@ -1,89 +0,0 @@ -/** - * The JSON Wallet formats allow a simple way to store the private - * keys needed in Ethereum along with related information and allows - * for extensible forms of encryption. - * - * These utilities facilitate decrypting and encrypting the most common - * JSON Wallet formats. - * - * @_subsection: api/wallet:JSON Wallets [json-wallets] - */ -import type { ProgressCallback } from "../crypto/index.js"; -import type { BytesLike } from "../utils/index.js"; -/** - * The contents of a JSON Keystore Wallet. - */ -export type KeystoreAccount = { - address: string; - privateKey: string; - mnemonic?: { - path?: string; - locale?: string; - entropy: string; - }; -}; -/** - * The parameters to use when encrypting a JSON Keystore Wallet. - */ -export type EncryptOptions = { - progressCallback?: ProgressCallback; - iv?: BytesLike; - entropy?: BytesLike; - client?: string; - salt?: BytesLike; - uuid?: string; - scrypt?: { - N?: number; - r?: number; - p?: number; - }; -}; -/** - * Returns true if %%json%% is a valid JSON Keystore Wallet. - */ -export declare function isKeystoreJson(json: string): boolean; -/** - * Returns the account details for the JSON Keystore Wallet %%json%% - * using %%password%%. - * - * It is preferred to use the [async version](decryptKeystoreJson) - * instead, which allows a [[ProgressCallback]] to keep the user informed - * as to the decryption status. - * - * This method will block the event loop (freezing all UI) until decryption - * is complete, which can take quite some time, depending on the wallet - * paramters and platform. - */ -export declare function decryptKeystoreJsonSync(json: string, _password: string | Uint8Array): KeystoreAccount; -/** - * Resolves to the decrypted JSON Keystore Wallet %%json%% using the - * %%password%%. - * - * If provided, %%progress%% will be called periodically during the - * decrpytion to provide feedback, and if the function returns - * ``false`` will halt decryption. - * - * The %%progressCallback%% will **always** receive ``0`` before - * decryption begins and ``1`` when complete. - */ -export declare function decryptKeystoreJson(json: string, _password: string | Uint8Array, progress?: ProgressCallback): Promise; -/** - * Return the JSON Keystore Wallet for %%account%% encrypted with - * %%password%%. - * - * The %%options%% can be used to tune the password-based key - * derivation function parameters, explicitly set the random values - * used. Any provided [[ProgressCallback]] is ignord. - */ -export declare function encryptKeystoreJsonSync(account: KeystoreAccount, password: string | Uint8Array, options?: EncryptOptions): string; -/** - * Resolved to the JSON Keystore Wallet for %%account%% encrypted - * with %%password%%. - * - * The %%options%% can be used to tune the password-based key - * derivation function parameters, explicitly set the random values - * used and provide a [[ProgressCallback]] to receive periodic updates - * on the completion status.. - */ -export declare function encryptKeystoreJson(account: KeystoreAccount, password: string | Uint8Array, options?: EncryptOptions): Promise; -//# sourceMappingURL=json-keystore.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/json-keystore.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/json-keystore.d.ts.map deleted file mode 100644 index 2ce64555..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/json-keystore.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"json-keystore.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/json-keystore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAaH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAOnD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE;QACP,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KACnB,CAAA;CACJ,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC1B,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,EAAE,CAAC,EAAE,SAAS,CAAC;IACf,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE;QACL,CAAC,CAAC,EAAE,MAAM,CAAC;QACX,CAAC,CAAC,EAAE,MAAM,CAAC;QACX,CAAC,CAAC,EAAE,MAAM,CAAC;KACd,CAAA;CACH,CAAA;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAOpD;AA+GD;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,UAAU,GAAG,eAAe,CAiBrG;AAMD;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,UAAU,EAAE,QAAQ,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC,CAyB7I;AAsGD;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,GAAG,UAAU,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,MAAM,CAOjI;AAED;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,GAAG,UAAU,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAO5I"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/json-keystore.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/json-keystore.js deleted file mode 100644 index 1b706ff7..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/json-keystore.js +++ /dev/null @@ -1,287 +0,0 @@ -/** - * The JSON Wallet formats allow a simple way to store the private - * keys needed in Ethereum along with related information and allows - * for extensible forms of encryption. - * - * These utilities facilitate decrypting and encrypting the most common - * JSON Wallet formats. - * - * @_subsection: api/wallet:JSON Wallets [json-wallets] - */ -import { CTR } from "aes-js"; -import { getAddress } from "../address/index.js"; -import { keccak256, pbkdf2, randomBytes, scrypt, scryptSync } from "../crypto/index.js"; -import { computeAddress } from "../transaction/index.js"; -import { concat, getBytes, hexlify, uuidV4, assert, assertArgument } from "../utils/index.js"; -import { getPassword, spelunk, zpad } from "./utils.js"; -import { version } from "../_version.js"; -const defaultPath = "m/44'/60'/0'/0/0"; -/** - * Returns true if %%json%% is a valid JSON Keystore Wallet. - */ -export function isKeystoreJson(json) { - try { - const data = JSON.parse(json); - const version = ((data.version != null) ? parseInt(data.version) : 0); - if (version === 3) { - return true; - } - } - catch (error) { } - return false; -} -function decrypt(data, key, ciphertext) { - const cipher = spelunk(data, "crypto.cipher:string"); - if (cipher === "aes-128-ctr") { - const iv = spelunk(data, "crypto.cipherparams.iv:data!"); - const aesCtr = new CTR(key, iv); - return hexlify(aesCtr.decrypt(ciphertext)); - } - assert(false, "unsupported cipher", "UNSUPPORTED_OPERATION", { - operation: "decrypt" - }); -} -function getAccount(data, _key) { - const key = getBytes(_key); - const ciphertext = spelunk(data, "crypto.ciphertext:data!"); - const computedMAC = hexlify(keccak256(concat([key.slice(16, 32), ciphertext]))).substring(2); - assertArgument(computedMAC === spelunk(data, "crypto.mac:string!").toLowerCase(), "incorrect password", "password", "[ REDACTED ]"); - const privateKey = decrypt(data, key.slice(0, 16), ciphertext); - const address = computeAddress(privateKey); - if (data.address) { - let check = data.address.toLowerCase(); - if (!check.startsWith("0x")) { - check = "0x" + check; - } - assertArgument(getAddress(check) === address, "keystore address/privateKey mismatch", "address", data.address); - } - const account = { address, privateKey }; - // Version 0.1 x-ethers metadata must contain an encrypted mnemonic phrase - const version = spelunk(data, "x-ethers.version:string"); - if (version === "0.1") { - const mnemonicKey = key.slice(32, 64); - const mnemonicCiphertext = spelunk(data, "x-ethers.mnemonicCiphertext:data!"); - const mnemonicIv = spelunk(data, "x-ethers.mnemonicCounter:data!"); - const mnemonicAesCtr = new CTR(mnemonicKey, mnemonicIv); - account.mnemonic = { - path: (spelunk(data, "x-ethers.path:string") || defaultPath), - locale: (spelunk(data, "x-ethers.locale:string") || "en"), - entropy: hexlify(getBytes(mnemonicAesCtr.decrypt(mnemonicCiphertext))) - }; - } - return account; -} -function getDecryptKdfParams(data) { - const kdf = spelunk(data, "crypto.kdf:string"); - if (kdf && typeof (kdf) === "string") { - if (kdf.toLowerCase() === "scrypt") { - const salt = spelunk(data, "crypto.kdfparams.salt:data!"); - const N = spelunk(data, "crypto.kdfparams.n:int!"); - const r = spelunk(data, "crypto.kdfparams.r:int!"); - const p = spelunk(data, "crypto.kdfparams.p:int!"); - // Make sure N is a power of 2 - assertArgument(N > 0 && (N & (N - 1)) === 0, "invalid kdf.N", "kdf.N", N); - assertArgument(r > 0 && p > 0, "invalid kdf", "kdf", kdf); - const dkLen = spelunk(data, "crypto.kdfparams.dklen:int!"); - assertArgument(dkLen === 32, "invalid kdf.dklen", "kdf.dflen", dkLen); - return { name: "scrypt", salt, N, r, p, dkLen: 64 }; - } - else if (kdf.toLowerCase() === "pbkdf2") { - const salt = spelunk(data, "crypto.kdfparams.salt:data!"); - const prf = spelunk(data, "crypto.kdfparams.prf:string!"); - const algorithm = prf.split("-").pop(); - assertArgument(algorithm === "sha256" || algorithm === "sha512", "invalid kdf.pdf", "kdf.pdf", prf); - const count = spelunk(data, "crypto.kdfparams.c:int!"); - const dkLen = spelunk(data, "crypto.kdfparams.dklen:int!"); - assertArgument(dkLen === 32, "invalid kdf.dklen", "kdf.dklen", dkLen); - return { name: "pbkdf2", salt, count, dkLen, algorithm }; - } - } - assertArgument(false, "unsupported key-derivation function", "kdf", kdf); -} -/** - * Returns the account details for the JSON Keystore Wallet %%json%% - * using %%password%%. - * - * It is preferred to use the [async version](decryptKeystoreJson) - * instead, which allows a [[ProgressCallback]] to keep the user informed - * as to the decryption status. - * - * This method will block the event loop (freezing all UI) until decryption - * is complete, which can take quite some time, depending on the wallet - * paramters and platform. - */ -export function decryptKeystoreJsonSync(json, _password) { - const data = JSON.parse(json); - const password = getPassword(_password); - const params = getDecryptKdfParams(data); - if (params.name === "pbkdf2") { - const { salt, count, dkLen, algorithm } = params; - const key = pbkdf2(password, salt, count, dkLen, algorithm); - return getAccount(data, key); - } - assert(params.name === "scrypt", "cannot be reached", "UNKNOWN_ERROR", { params }); - const { salt, N, r, p, dkLen } = params; - const key = scryptSync(password, salt, N, r, p, dkLen); - return getAccount(data, key); -} -function stall(duration) { - return new Promise((resolve) => { setTimeout(() => { resolve(); }, duration); }); -} -/** - * Resolves to the decrypted JSON Keystore Wallet %%json%% using the - * %%password%%. - * - * If provided, %%progress%% will be called periodically during the - * decrpytion to provide feedback, and if the function returns - * ``false`` will halt decryption. - * - * The %%progressCallback%% will **always** receive ``0`` before - * decryption begins and ``1`` when complete. - */ -export async function decryptKeystoreJson(json, _password, progress) { - const data = JSON.parse(json); - const password = getPassword(_password); - const params = getDecryptKdfParams(data); - if (params.name === "pbkdf2") { - if (progress) { - progress(0); - await stall(0); - } - const { salt, count, dkLen, algorithm } = params; - const key = pbkdf2(password, salt, count, dkLen, algorithm); - if (progress) { - progress(1); - await stall(0); - } - return getAccount(data, key); - } - assert(params.name === "scrypt", "cannot be reached", "UNKNOWN_ERROR", { params }); - const { salt, N, r, p, dkLen } = params; - const key = await scrypt(password, salt, N, r, p, dkLen, progress); - return getAccount(data, key); -} -function getEncryptKdfParams(options) { - // Check/generate the salt - const salt = (options.salt != null) ? getBytes(options.salt, "options.salt") : randomBytes(32); - // Override the scrypt password-based key derivation function parameters - let N = (1 << 17), r = 8, p = 1; - if (options.scrypt) { - if (options.scrypt.N) { - N = options.scrypt.N; - } - if (options.scrypt.r) { - r = options.scrypt.r; - } - if (options.scrypt.p) { - p = options.scrypt.p; - } - } - assertArgument(typeof (N) === "number" && N > 0 && Number.isSafeInteger(N) && (BigInt(N) & BigInt(N - 1)) === BigInt(0), "invalid scrypt N parameter", "options.N", N); - assertArgument(typeof (r) === "number" && r > 0 && Number.isSafeInteger(r), "invalid scrypt r parameter", "options.r", r); - assertArgument(typeof (p) === "number" && p > 0 && Number.isSafeInteger(p), "invalid scrypt p parameter", "options.p", p); - return { name: "scrypt", dkLen: 32, salt, N, r, p }; -} -function _encryptKeystore(key, kdf, account, options) { - const privateKey = getBytes(account.privateKey, "privateKey"); - // Override initialization vector - const iv = (options.iv != null) ? getBytes(options.iv, "options.iv") : randomBytes(16); - assertArgument(iv.length === 16, "invalid options.iv length", "options.iv", options.iv); - // Override the uuid - const uuidRandom = (options.uuid != null) ? getBytes(options.uuid, "options.uuid") : randomBytes(16); - assertArgument(uuidRandom.length === 16, "invalid options.uuid length", "options.uuid", options.iv); - // This will be used to encrypt the wallet (as per Web3 secret storage) - // - 32 bytes As normal for the Web3 secret storage (derivedKey, macPrefix) - // - 32 bytes AES key to encrypt mnemonic with (required here to be Ethers Wallet) - const derivedKey = key.slice(0, 16); - const macPrefix = key.slice(16, 32); - // Encrypt the private key - const aesCtr = new CTR(derivedKey, iv); - const ciphertext = getBytes(aesCtr.encrypt(privateKey)); - // Compute the message authentication code, used to check the password - const mac = keccak256(concat([macPrefix, ciphertext])); - // See: https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition - const data = { - address: account.address.substring(2).toLowerCase(), - id: uuidV4(uuidRandom), - version: 3, - Crypto: { - cipher: "aes-128-ctr", - cipherparams: { - iv: hexlify(iv).substring(2), - }, - ciphertext: hexlify(ciphertext).substring(2), - kdf: "scrypt", - kdfparams: { - salt: hexlify(kdf.salt).substring(2), - n: kdf.N, - dklen: 32, - p: kdf.p, - r: kdf.r - }, - mac: mac.substring(2) - } - }; - // If we have a mnemonic, encrypt it into the JSON wallet - if (account.mnemonic) { - const client = (options.client != null) ? options.client : `ethers/${version}`; - const path = account.mnemonic.path || defaultPath; - const locale = account.mnemonic.locale || "en"; - const mnemonicKey = key.slice(32, 64); - const entropy = getBytes(account.mnemonic.entropy, "account.mnemonic.entropy"); - const mnemonicIv = randomBytes(16); - const mnemonicAesCtr = new CTR(mnemonicKey, mnemonicIv); - const mnemonicCiphertext = getBytes(mnemonicAesCtr.encrypt(entropy)); - const now = new Date(); - const timestamp = (now.getUTCFullYear() + "-" + - zpad(now.getUTCMonth() + 1, 2) + "-" + - zpad(now.getUTCDate(), 2) + "T" + - zpad(now.getUTCHours(), 2) + "-" + - zpad(now.getUTCMinutes(), 2) + "-" + - zpad(now.getUTCSeconds(), 2) + ".0Z"); - const gethFilename = ("UTC--" + timestamp + "--" + data.address); - data["x-ethers"] = { - client, gethFilename, path, locale, - mnemonicCounter: hexlify(mnemonicIv).substring(2), - mnemonicCiphertext: hexlify(mnemonicCiphertext).substring(2), - version: "0.1" - }; - } - return JSON.stringify(data); -} -/** - * Return the JSON Keystore Wallet for %%account%% encrypted with - * %%password%%. - * - * The %%options%% can be used to tune the password-based key - * derivation function parameters, explicitly set the random values - * used. Any provided [[ProgressCallback]] is ignord. - */ -export function encryptKeystoreJsonSync(account, password, options) { - if (options == null) { - options = {}; - } - const passwordBytes = getPassword(password); - const kdf = getEncryptKdfParams(options); - const key = scryptSync(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64); - return _encryptKeystore(getBytes(key), kdf, account, options); -} -/** - * Resolved to the JSON Keystore Wallet for %%account%% encrypted - * with %%password%%. - * - * The %%options%% can be used to tune the password-based key - * derivation function parameters, explicitly set the random values - * used and provide a [[ProgressCallback]] to receive periodic updates - * on the completion status.. - */ -export async function encryptKeystoreJson(account, password, options) { - if (options == null) { - options = {}; - } - const passwordBytes = getPassword(password); - const kdf = getEncryptKdfParams(options); - const key = await scrypt(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64, options.progressCallback); - return _encryptKeystore(getBytes(key), kdf, account, options); -} -//# sourceMappingURL=json-keystore.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/json-keystore.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/json-keystore.js.map deleted file mode 100644 index 0738084c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/json-keystore.js.map +++ /dev/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IAC5C,MAAM,GAAG,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACzC,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,aAAa,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACrG,OAAO,gBAAgB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAClE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/mnemonic.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/mnemonic.d.ts deleted file mode 100644 index b1601122..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/mnemonic.d.ts +++ /dev/null @@ -1,65 +0,0 @@ -import type { BytesLike } from "../utils/index.js"; -import type { Wordlist } from "../wordlists/index.js"; -/** - * A **Mnemonic** wraps all properties required to compute [[link-bip-39]] - * seeds and convert between phrases and entropy. - */ -export declare class Mnemonic { - /** - * The mnemonic phrase of 12, 15, 18, 21 or 24 words. - * - * Use the [[wordlist]] ``split`` method to get the individual words. - */ - readonly phrase: string; - /** - * The password used for this mnemonic. If no password is used this - * is the empty string (i.e. ``""``) as per the specification. - */ - readonly password: string; - /** - * The wordlist for this mnemonic. - */ - readonly wordlist: Wordlist; - /** - * The underlying entropy which the mnemonic encodes. - */ - readonly entropy: string; - /** - * @private - */ - constructor(guard: any, entropy: string, phrase: string, password?: null | string, wordlist?: null | Wordlist); - /** - * Returns the seed for the mnemonic. - */ - computeSeed(): string; - /** - * Creates a new Mnemonic for the %%phrase%%. - * - * The default %%password%% is the empty string and the default - * wordlist is the [English wordlists](LangEn). - */ - static fromPhrase(phrase: string, password?: null | string, wordlist?: null | Wordlist): Mnemonic; - /** - * Create a new **Mnemonic** from the %%entropy%%. - * - * The default %%password%% is the empty string and the default - * wordlist is the [English wordlists](LangEn). - */ - static fromEntropy(_entropy: BytesLike, password?: null | string, wordlist?: null | Wordlist): Mnemonic; - /** - * Returns the phrase for %%mnemonic%%. - */ - static entropyToPhrase(_entropy: BytesLike, wordlist?: null | Wordlist): string; - /** - * Returns the entropy for %%phrase%%. - */ - static phraseToEntropy(phrase: string, wordlist?: null | Wordlist): string; - /** - * Returns true if %%phrase%% is a valid [[link-bip-39]] phrase. - * - * This checks all the provided words belong to the %%wordlist%%, - * that the length is valid and the checksum is correct. - */ - static isValidMnemonic(phrase: string, wordlist?: null | Wordlist): boolean; -} -//# sourceMappingURL=mnemonic.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/mnemonic.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/mnemonic.d.ts.map deleted file mode 100644 index c7ba058f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/mnemonic.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mnemonic.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/mnemonic.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAgGtD;;;GAGG;AACH,qBAAa,QAAQ;IACjB;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAEzB;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAG,MAAM,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAG,QAAQ,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAG,MAAM,CAAC;IAE1B;;OAEG;gBACS,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,MAAM,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ;IAO7G;;OAEG;IACH,WAAW,IAAI,MAAM;IAKrB;;;;;OAKG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,MAAM,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,GAAG,QAAQ;IAOjG;;;;;OAKG;IACH,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,MAAM,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,GAAG,QAAQ;IAMvG;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,GAAG,MAAM;IAK/E;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,GAAG,MAAM;IAI1E;;;;;OAKG;IACH,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,GAAG,OAAO;CAO9E"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/mnemonic.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/mnemonic.js deleted file mode 100644 index 95d69d35..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/mnemonic.js +++ /dev/null @@ -1,165 +0,0 @@ -import { pbkdf2, sha256 } from "../crypto/index.js"; -import { defineProperties, getBytes, hexlify, assertNormalize, assertPrivate, assertArgument, toUtf8Bytes } from "../utils/index.js"; -import { LangEn } from "../wordlists/lang-en.js"; -// Returns a byte with the MSB bits set -function getUpperMask(bits) { - return ((1 << bits) - 1) << (8 - bits) & 0xff; -} -// Returns a byte with the LSB bits set -function getLowerMask(bits) { - return ((1 << bits) - 1) & 0xff; -} -function mnemonicToEntropy(mnemonic, wordlist) { - assertNormalize("NFKD"); - if (wordlist == null) { - wordlist = LangEn.wordlist(); - } - const words = wordlist.split(mnemonic); - assertArgument((words.length % 3) === 0 && words.length >= 12 && words.length <= 24, "invalid mnemonic length", "mnemonic", "[ REDACTED ]"); - const entropy = new Uint8Array(Math.ceil(11 * words.length / 8)); - let offset = 0; - for (let i = 0; i < words.length; i++) { - let index = wordlist.getWordIndex(words[i].normalize("NFKD")); - assertArgument(index >= 0, `invalid mnemonic word at index ${i}`, "mnemonic", "[ REDACTED ]"); - for (let bit = 0; bit < 11; bit++) { - if (index & (1 << (10 - bit))) { - entropy[offset >> 3] |= (1 << (7 - (offset % 8))); - } - offset++; - } - } - const entropyBits = 32 * words.length / 3; - const checksumBits = words.length / 3; - const checksumMask = getUpperMask(checksumBits); - const checksum = getBytes(sha256(entropy.slice(0, entropyBits / 8)))[0] & checksumMask; - assertArgument(checksum === (entropy[entropy.length - 1] & checksumMask), "invalid mnemonic checksum", "mnemonic", "[ REDACTED ]"); - return hexlify(entropy.slice(0, entropyBits / 8)); -} -function entropyToMnemonic(entropy, wordlist) { - assertArgument((entropy.length % 4) === 0 && entropy.length >= 16 && entropy.length <= 32, "invalid entropy size", "entropy", "[ REDACTED ]"); - if (wordlist == null) { - wordlist = LangEn.wordlist(); - } - const indices = [0]; - let remainingBits = 11; - for (let i = 0; i < entropy.length; i++) { - // Consume the whole byte (with still more to go) - if (remainingBits > 8) { - indices[indices.length - 1] <<= 8; - indices[indices.length - 1] |= entropy[i]; - remainingBits -= 8; - // This byte will complete an 11-bit index - } - else { - indices[indices.length - 1] <<= remainingBits; - indices[indices.length - 1] |= entropy[i] >> (8 - remainingBits); - // Start the next word - indices.push(entropy[i] & getLowerMask(8 - remainingBits)); - remainingBits += 3; - } - } - // Compute the checksum bits - const checksumBits = entropy.length / 4; - const checksum = parseInt(sha256(entropy).substring(2, 4), 16) & getUpperMask(checksumBits); - // Shift the checksum into the word indices - indices[indices.length - 1] <<= checksumBits; - indices[indices.length - 1] |= (checksum >> (8 - checksumBits)); - return wordlist.join(indices.map((index) => wordlist.getWord(index))); -} -const _guard = {}; -/** - * A **Mnemonic** wraps all properties required to compute [[link-bip-39]] - * seeds and convert between phrases and entropy. - */ -export class Mnemonic { - /** - * The mnemonic phrase of 12, 15, 18, 21 or 24 words. - * - * Use the [[wordlist]] ``split`` method to get the individual words. - */ - phrase; - /** - * The password used for this mnemonic. If no password is used this - * is the empty string (i.e. ``""``) as per the specification. - */ - password; - /** - * The wordlist for this mnemonic. - */ - wordlist; - /** - * The underlying entropy which the mnemonic encodes. - */ - entropy; - /** - * @private - */ - constructor(guard, entropy, phrase, password, wordlist) { - if (password == null) { - password = ""; - } - if (wordlist == null) { - wordlist = LangEn.wordlist(); - } - assertPrivate(guard, _guard, "Mnemonic"); - defineProperties(this, { phrase, password, wordlist, entropy }); - } - /** - * Returns the seed for the mnemonic. - */ - computeSeed() { - const salt = toUtf8Bytes("mnemonic" + this.password, "NFKD"); - return pbkdf2(toUtf8Bytes(this.phrase, "NFKD"), salt, 2048, 64, "sha512"); - } - /** - * Creates a new Mnemonic for the %%phrase%%. - * - * The default %%password%% is the empty string and the default - * wordlist is the [English wordlists](LangEn). - */ - static fromPhrase(phrase, password, wordlist) { - // Normalize the case and space; throws if invalid - const entropy = mnemonicToEntropy(phrase, wordlist); - phrase = entropyToMnemonic(getBytes(entropy), wordlist); - return new Mnemonic(_guard, entropy, phrase, password, wordlist); - } - /** - * Create a new **Mnemonic** from the %%entropy%%. - * - * The default %%password%% is the empty string and the default - * wordlist is the [English wordlists](LangEn). - */ - static fromEntropy(_entropy, password, wordlist) { - const entropy = getBytes(_entropy, "entropy"); - const phrase = entropyToMnemonic(entropy, wordlist); - return new Mnemonic(_guard, hexlify(entropy), phrase, password, wordlist); - } - /** - * Returns the phrase for %%mnemonic%%. - */ - static entropyToPhrase(_entropy, wordlist) { - const entropy = getBytes(_entropy, "entropy"); - return entropyToMnemonic(entropy, wordlist); - } - /** - * Returns the entropy for %%phrase%%. - */ - static phraseToEntropy(phrase, wordlist) { - return mnemonicToEntropy(phrase, wordlist); - } - /** - * Returns true if %%phrase%% is a valid [[link-bip-39]] phrase. - * - * This checks all the provided words belong to the %%wordlist%%, - * that the length is valid and the checksum is correct. - */ - static isValidMnemonic(phrase, wordlist) { - try { - mnemonicToEntropy(phrase, wordlist); - return true; - } - catch (error) { } - return false; - } -} -//# sourceMappingURL=mnemonic.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/mnemonic.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/mnemonic.js.map deleted file mode 100644 index 020c5d3a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/mnemonic.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mnemonic.js","sourceRoot":"","sources":["../../src.ts/wallet/mnemonic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EACH,gBAAgB,EAAE,QAAQ,EAAE,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EACnG,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAMjD,uCAAuC;AACvC,SAAS,YAAY,CAAC,IAAY;IAC/B,OAAO,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;AACjD,CAAC;AAED,uCAAuC;AACvC,SAAS,YAAY,CAAC,IAAY;IAC/B,OAAO,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;AACnC,CAAC;AAGD,SAAS,iBAAiB,CAAC,QAAgB,EAAE,QA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AM,OAAO,GAAG,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;QAC9C,MAAM,MAAM,GAAG,iBAAiB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACpD,OAAO,IAAI,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC9E,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,QAAmB,EAAE,QAA0B;QAClE,MAAM,OAAO,GAAG,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;QAC9C,OAAO,iBAAiB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAChD,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,MAAc,EAAE,QAA0B;QAC7D,OAAO,iBAAiB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,eAAe,CAAC,MAAc,EAAE,QAA0B;QAC7D,IAAI;YACA,iBAAiB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;YACpC,OAAO,IAAI,CAAC;SACf;QAAC,OAAO,KAAK,EAAE,GAAG;QACnB,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/utils.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/utils.d.ts deleted file mode 100644 index 0d4baabe..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/utils.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @_ignore - */ -export declare function looseArrayify(hexString: string): Uint8Array; -export declare function zpad(value: String | number, length: number): String; -export declare function getPassword(password: string | Uint8Array): Uint8Array; -export declare function spelunk(object: any, _path: string): T; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/utils.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/utils.d.ts.map deleted file mode 100644 index ecd4e9ae..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,UAAU,CAK3D;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAInE;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,CAKrE;AAED,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC,CA8DxD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/utils.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/utils.js deleted file mode 100644 index 29bac53d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/utils.js +++ /dev/null @@ -1,142 +0,0 @@ -/** - * @_ignore - */ -import { getBytesCopy, assertArgument, toUtf8Bytes } from "../utils/index.js"; -export function looseArrayify(hexString) { - if (typeof (hexString) === "string" && !hexString.startsWith("0x")) { - hexString = "0x" + hexString; - } - return getBytesCopy(hexString); -} -export function zpad(value, length) { - value = String(value); - while (value.length < length) { - value = '0' + value; - } - return value; -} -export function getPassword(password) { - if (typeof (password) === 'string') { - return toUtf8Bytes(password, "NFKC"); - } - return getBytesCopy(password); -} -export function spelunk(object, _path) { - const match = _path.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i); - assertArgument(match != null, "invalid path", "path", _path); - const path = match[1]; - const type = match[3]; - const reqd = (match[4] === "!"); - let cur = object; - for (const comp of path.toLowerCase().split('.')) { - // Search for a child object with a case-insensitive matching key - if (Array.isArray(cur)) { - if (!comp.match(/^[0-9]+$/)) { - break; - } - cur = cur[parseInt(comp)]; - } - else if (typeof (cur) === "object") { - let found = null; - for (const key in cur) { - if (key.toLowerCase() === comp) { - found = cur[key]; - break; - } - } - cur = found; - } - else { - cur = null; - } - if (cur == null) { - break; - } - } - assertArgument(!reqd || cur != null, "missing required value", "path", path); - if (type && cur != null) { - if (type === "int") { - if (typeof (cur) === "string" && cur.match(/^-?[0-9]+$/)) { - return parseInt(cur); - } - else if (Number.isSafeInteger(cur)) { - return cur; - } - } - if (type === "number") { - if (typeof (cur) === "string" && cur.match(/^-?[0-9.]*$/)) { - return parseFloat(cur); - } - } - if (type === "data") { - if (typeof (cur) === "string") { - return looseArrayify(cur); - } - } - if (type === "array" && Array.isArray(cur)) { - return cur; - } - if (type === typeof (cur)) { - return cur; - } - assertArgument(false, `wrong type found for ${type} `, "path", path); - } - return cur; -} -/* -export function follow(object: any, path: string): null | string { - let currentChild = object; - - for (const comp of path.toLowerCase().split('/')) { - - // Search for a child object with a case-insensitive matching key - let matchingChild = null; - for (const key in currentChild) { - if (key.toLowerCase() === comp) { - matchingChild = currentChild[key]; - break; - } - } - - if (matchingChild === null) { return null; } - - currentChild = matchingChild; - } - - return currentChild; -} - -// "path/to/something:type!" -export function followRequired(data: any, path: string): string { - const value = follow(data, path); - if (value != null) { return value; } - return logger.throwArgumentError("invalid value", `data:${ path }`, - JSON.stringify(data)); -} -*/ -// See: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4) -/* -export function uuidV4(randomBytes: BytesLike): string { - const bytes = getBytes(randomBytes, "randomBytes"); - - // Section: 4.1.3: - // - time_hi_and_version[12:16] = 0b0100 - bytes[6] = (bytes[6] & 0x0f) | 0x40; - - // Section 4.4 - // - clock_seq_hi_and_reserved[6] = 0b0 - // - clock_seq_hi_and_reserved[7] = 0b1 - bytes[8] = (bytes[8] & 0x3f) | 0x80; - - const value = hexlify(bytes); - - return [ - value.substring(2, 10), - value.substring(10, 14), - value.substring(14, 18), - value.substring(18, 22), - value.substring(22, 34), - ].join("-"); -} -*/ -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/utils.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/utils.js.map deleted file mode 100644 index a97d58f4..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src.ts/wallet/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACH,YAAY,EAAE,cAAc,EAAE,WAAW,EAC5C,MAAM,mBAAmB,CAAC;AAE3B,MAAM,UAAU,aAAa,CAAC,SAAiB;IAC3C,IAAI,OAAM,CAAC,SAAS,CAAC,KAAK,QAAQ,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;QAC/D,SAAS,GAAG,IAAI,GAAG,SAAS,CAAC;KAChC;IACD,OAAO,YAAY,CAAC,SAAS,CAAC,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,KAAsB,EAAE,MAAc;IACvD,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IACtB,OAAO,KAAK,CAAC,MAAM,GAAG,MAAM,EAAE;QAAE,KAAK,GAAG,GAAG,GAAG,KAAK,CAAC;KAAE;IACtD,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,QAA6B;IACrD,IAAI,OAAM,CAAC,QAAQ,CAAC,KAAK,QAAQ,EAAE;QAC/B,OAAO,WAAW,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;KACxC;IACD,OAAO,YAAY,CAAC,QAAQ,CAAC,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,OAAO,CAAI,MAAW,EAAE,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,IAAI,IAAI,EAAE;QACrB,IAAI,IAAI,KAAK,KAAK,EAAE;YAChB,IAAI,OAAM,CAAC,GAAG,CAAC,KAAK,QAAQ,IAAI,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE;gBACrD,OAAmB,QAAQ,CAAC,GAAG,CAAC,CAAC;aACpC;iBAAM,IAAI,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE;gBAClC,OAAO,GAAG,CAAC;aACd;SACJ;QAED,IAAI,IAAI,KAAK,QAAQ,EAAE;YACnB,IAAI,OAAM,CAAC,GAAG,CAAC,KAAK,QAAQ,IAAI,GAAG,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE;gBACtD,OAAmB,UAAU,CAAC,GAAG,CAAC,CAAC;aACtC;SACJ;QAED,IAAI,IAAI,KAAK,MAAM,EAAE;YACjB,IAAI,OAAM,CAAC,GAAG,CAAC,KAAK,QAAQ,EAAE;gBAAE,OAAmB,aAAa,CAAC,GAAG,CAAC,CAAC;aAAE;SAC3E;QAED,IAAI,IAAI,KAAK,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAAE,OAAmB,GAAG,CAAC;SAAE;QACvE,IAAI,IAAI,KAAK,OAAM,CAAC,GAAG,CAAC,EAAE;YAAE,OAAO,GAAG,CAAC;SAAE;QAEzC,cAAc,CAAC,KAAK,EAAE,wBAAyB,IAAK,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;KAC1E;IAED,OAAO,GAAG,CAAC;AACf,CAAC;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BE;AACF,0DAA0D;AAC1D;;;;;;;;;;;;;;;;;;;;;;;EAuBE"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/wallet.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/wallet.d.ts deleted file mode 100644 index 91fa6098..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/wallet.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { SigningKey } from "../crypto/index.js"; -import { BaseWallet } from "./base-wallet.js"; -import { HDNodeWallet } from "./hdwallet.js"; -import type { ProgressCallback } from "../crypto/index.js"; -import type { Provider } from "../providers/index.js"; -/** - * A **Wallet** manages a single private key which is used to sign - * transactions, messages and other common payloads. - * - * This class is generally the main entry point for developers - * that wish to use a private key directly, as it can create - * instances from a large variety of common sources, including - * raw private key, [[link-bip-39]] mnemonics and encrypte JSON - * wallets. - */ -export declare class Wallet extends BaseWallet { - #private; - /** - * Create a new wallet for the private %%key%%, optionally connected - * to %%provider%%. - */ - constructor(key: string | SigningKey, provider?: null | Provider); - connect(provider: null | Provider): Wallet; - /** - * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with - * %%password%%. - * - * If %%progressCallback%% is specified, it will receive periodic - * updates as the encryption process progreses. - */ - encrypt(password: Uint8Array | string, progressCallback?: ProgressCallback): Promise; - /** - * Returns a [JSON Keystore Wallet](json-wallets) encryped with - * %%password%%. - * - * It is preferred to use the [async version](encrypt) instead, - * which allows a [[ProgressCallback]] to keep the user informed. - * - * This method will block the event loop (freezing all UI) until - * it is complete, which may be a non-trivial duration. - */ - encryptSync(password: Uint8Array | string): string; - /** - * Creates (asynchronously) a **Wallet** by decrypting the %%json%% - * with %%password%%. - * - * If %%progress%% is provided, it is called periodically during - * decryption so that any UI can be updated. - */ - static fromEncryptedJson(json: string, password: Uint8Array | string, progress?: ProgressCallback): Promise; - /** - * Creates a **Wallet** by decrypting the %%json%% with %%password%%. - * - * The [[fromEncryptedJson]] method is preferred, as this method - * will lock up and freeze the UI during decryption, which may take - * some time. - */ - static fromEncryptedJsonSync(json: string, password: Uint8Array | string): HDNodeWallet | Wallet; - /** - * Creates a new random [[HDNodeWallet]] using the available - * [cryptographic random source](randomBytes). - * - * If there is no crytographic random source, this will throw. - */ - static createRandom(provider?: null | Provider): HDNodeWallet; - /** - * Creates a [[HDNodeWallet]] for %%phrase%%. - */ - static fromPhrase(phrase: string, provider?: Provider): HDNodeWallet; -} -//# sourceMappingURL=wallet.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/wallet.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/wallet.d.ts.map deleted file mode 100644 index afa4098d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/wallet.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAS7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAUtD;;;;;;;;;GASG;AACH,qBAAa,MAAO,SAAQ,UAAU;;IAElC;;;OAGG;gBACS,GAAG,EAAE,MAAM,GAAG,UAAU,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ;IAShE,OAAO,CAAC,QAAQ,EAAE,IAAI,GAAG,QAAQ,GAAG,MAAM;IAI1C;;;;;;OAMG;IACG,OAAO,CAAC,QAAQ,EAAE,UAAU,GAAG,MAAM,EAAE,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC;IAKlG;;;;;;;;;OASG;IACH,WAAW,CAAC,QAAQ,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM;IAyBlD;;;;;;OAMG;WACU,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,GAAG,MAAM,EAAE,QAAQ,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,YAAY,GAAG,MAAM,CAAC;IAexI;;;;;;OAMG;IACH,MAAM,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,GAAG,MAAM,GAAG,YAAY,GAAG,MAAM;IAahG;;;;;OAKG;IACH,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,GAAG,YAAY;IAM7D;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,YAAY;CAKvE"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/wallet.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/wallet.js deleted file mode 100644 index 4f4808d7..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/wallet.js +++ /dev/null @@ -1,144 +0,0 @@ -import { SigningKey } from "../crypto/index.js"; -import { assertArgument } from "../utils/index.js"; -import { BaseWallet } from "./base-wallet.js"; -import { HDNodeWallet } from "./hdwallet.js"; -import { decryptCrowdsaleJson, isCrowdsaleJson } from "./json-crowdsale.js"; -import { decryptKeystoreJson, decryptKeystoreJsonSync, encryptKeystoreJson, encryptKeystoreJsonSync, isKeystoreJson } from "./json-keystore.js"; -import { Mnemonic } from "./mnemonic.js"; -function stall(duration) { - return new Promise((resolve) => { setTimeout(() => { resolve(); }, duration); }); -} -/** - * A **Wallet** manages a single private key which is used to sign - * transactions, messages and other common payloads. - * - * This class is generally the main entry point for developers - * that wish to use a private key directly, as it can create - * instances from a large variety of common sources, including - * raw private key, [[link-bip-39]] mnemonics and encrypte JSON - * wallets. - */ -export class Wallet extends BaseWallet { - /** - * Create a new wallet for the private %%key%%, optionally connected - * to %%provider%%. - */ - constructor(key, provider) { - if (typeof (key) === "string" && !key.startsWith("0x")) { - key = "0x" + key; - } - let signingKey = (typeof (key) === "string") ? new SigningKey(key) : key; - super(signingKey, provider); - } - connect(provider) { - return new Wallet(this.signingKey, provider); - } - /** - * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with - * %%password%%. - * - * If %%progressCallback%% is specified, it will receive periodic - * updates as the encryption process progreses. - */ - async encrypt(password, progressCallback) { - const account = { address: this.address, privateKey: this.privateKey }; - return await encryptKeystoreJson(account, password, { progressCallback }); - } - /** - * Returns a [JSON Keystore Wallet](json-wallets) encryped with - * %%password%%. - * - * It is preferred to use the [async version](encrypt) instead, - * which allows a [[ProgressCallback]] to keep the user informed. - * - * This method will block the event loop (freezing all UI) until - * it is complete, which may be a non-trivial duration. - */ - encryptSync(password) { - const account = { address: this.address, privateKey: this.privateKey }; - return encryptKeystoreJsonSync(account, password); - } - static #fromAccount(account) { - assertArgument(account, "invalid JSON wallet", "json", "[ REDACTED ]"); - if ("mnemonic" in account && account.mnemonic && account.mnemonic.locale === "en") { - const mnemonic = Mnemonic.fromEntropy(account.mnemonic.entropy); - const wallet = HDNodeWallet.fromMnemonic(mnemonic, account.mnemonic.path); - if (wallet.address === account.address && wallet.privateKey === account.privateKey) { - return wallet; - } - console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key"); - } - const wallet = new Wallet(account.privateKey); - assertArgument(wallet.address === account.address, "address/privateKey mismatch", "json", "[ REDACTED ]"); - return wallet; - } - /** - * Creates (asynchronously) a **Wallet** by decrypting the %%json%% - * with %%password%%. - * - * If %%progress%% is provided, it is called periodically during - * decryption so that any UI can be updated. - */ - static async fromEncryptedJson(json, password, progress) { - let account = null; - if (isKeystoreJson(json)) { - account = await decryptKeystoreJson(json, password, progress); - } - else if (isCrowdsaleJson(json)) { - if (progress) { - progress(0); - await stall(0); - } - account = decryptCrowdsaleJson(json, password); - if (progress) { - progress(1); - await stall(0); - } - } - return Wallet.#fromAccount(account); - } - /** - * Creates a **Wallet** by decrypting the %%json%% with %%password%%. - * - * The [[fromEncryptedJson]] method is preferred, as this method - * will lock up and freeze the UI during decryption, which may take - * some time. - */ - static fromEncryptedJsonSync(json, password) { - let account = null; - if (isKeystoreJson(json)) { - account = decryptKeystoreJsonSync(json, password); - } - else if (isCrowdsaleJson(json)) { - account = decryptCrowdsaleJson(json, password); - } - else { - assertArgument(false, "invalid JSON wallet", "json", "[ REDACTED ]"); - } - return Wallet.#fromAccount(account); - } - /** - * Creates a new random [[HDNodeWallet]] using the available - * [cryptographic random source](randomBytes). - * - * If there is no crytographic random source, this will throw. - */ - static createRandom(provider) { - const wallet = HDNodeWallet.createRandom(); - if (provider) { - return wallet.connect(provider); - } - return wallet; - } - /** - * Creates a [[HDNodeWallet]] for %%phrase%%. - */ - static fromPhrase(phrase, provider) { - const wallet = HDNodeWallet.fromPhrase(phrase); - if (provider) { - return wallet.connect(provider); - } - return wallet; - } -} -//# sourceMappingURL=wallet.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/wallet.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/wallet.js.map deleted file mode 100644 index 60312a88..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wallet/wallet.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wallet.js","sourceRoot":"","sources":["../../src.ts/wallet/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAG,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EACH,mBAAmB,EAAE,uBAAuB,EAC5C,mBAAmB,EAAE,uBAAuB,EAC5C,cAAc,EACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AASzC,SAAS,KAAK,CAAC,QAAgB;IAC3B,OAAO,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,MAAM,CAAC;IAClB,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/bit-reader.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/bit-reader.d.ts deleted file mode 100644 index 1aa84953..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/bit-reader.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * @_ignore - */ -export declare function decodeBits(width: number, data: string): Array; -//# sourceMappingURL=bit-reader.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/bit-reader.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/bit-reader.d.ts.map deleted file mode 100644 index c088a746..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/bit-reader.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bit-reader.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/bit-reader.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CA6BrE"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/bit-reader.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/bit-reader.js deleted file mode 100644 index bf530314..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/bit-reader.js +++ /dev/null @@ -1,32 +0,0 @@ -const Base64 = ")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_"; -/** - * @_ignore - */ -export function decodeBits(width, data) { - const maxValue = (1 << width) - 1; - const result = []; - let accum = 0, bits = 0, flood = 0; - for (let i = 0; i < data.length; i++) { - // Accumulate 6 bits of data - accum = ((accum << 6) | Base64.indexOf(data[i])); - bits += 6; - // While we have enough for a word... - while (bits >= width) { - // ...read the word - const value = (accum >> (bits - width)); - accum &= (1 << (bits - width)) - 1; - bits -= width; - // A value of 0 indicates we exceeded maxValue, it - // floods over into the next value - if (value === 0) { - flood += maxValue; - } - else { - result.push(value + flood); - flood = 0; - } - } - } - return result; -} -//# sourceMappingURL=bit-reader.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/bit-reader.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/bit-reader.js.map deleted file mode 100644 index 79f3e876..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/bit-reader.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bit-reader.js","sourceRoot":"","sources":["../../src.ts/wordlists/bit-reader.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GAAG,kEAAkE,CAAC;AAElF;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,KAAa,EAAE,IAAY;IAClD,MAAM,QAAQ,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;IAClC,MAAM,MAAM,GAAkB,EAAG,CAAC;IAClC,IAAI,KAAK,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC;IACnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAElC,4BAA4B;QAC5B,KAAK,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACjD,IAAI,IAAI,CAAC,CAAC;QAEV,qCAAqC;QACrC,OAAO,IAAI,IAAI,KAAK,EAAE;YAClB,mBAAmB;YACnB,MAAM,KAAK,GAAG,CAAC,KAAK,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC;YACxC,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;YACnC,IAAI,IAAI,KAAK,CAAC;YAEd,kDAAkD;YAClD,kCAAkC;YAClC,IAAI,KAAK,KAAK,CAAC,EAAE;gBACb,KAAK,IAAI,QAAQ,CAAC;aACrB;iBAAM;gBACH,MAAM,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC;gBAC3B,KAAK,GAAG,CAAC,CAAC;aACb;SACJ;KACJ;IAED,OAAO,MAAM,CAAC;AAClB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/decode-owl.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/decode-owl.d.ts deleted file mode 100644 index 8822086b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/decode-owl.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * @_ignore - */ -export declare function decode(data: string, subs: string): Array; -/** - * @_ignore - */ -export declare function decodeOwl(data: string): Array; -//# sourceMappingURL=decode-owl.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/decode-owl.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/decode-owl.d.ts.map deleted file mode 100644 index aa692891..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/decode-owl.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decode-owl.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/decode-owl.ts"],"names":[],"mappings":"AAqBA;;GAEG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAsBhE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAMrD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/decode-owl.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/decode-owl.js deleted file mode 100644 index fe636fde..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/decode-owl.js +++ /dev/null @@ -1,55 +0,0 @@ -import { assertArgument } from "../utils/index.js"; -const subsChrs = " !#$%&'()*+,-./<=>?@[]^_`{|}~"; -const Word = /^[a-z]*$/i; -function unfold(words, sep) { - let initial = 97; - return words.reduce((accum, word) => { - if (word === sep) { - initial++; - } - else if (word.match(Word)) { - accum.push(String.fromCharCode(initial) + word); - } - else { - initial = 97; - accum.push(word); - } - return accum; - }, []); -} -/** - * @_ignore - */ -export function decode(data, subs) { - // Replace all the substitutions with their expanded form - for (let i = subsChrs.length - 1; i >= 0; i--) { - data = data.split(subsChrs[i]).join(subs.substring(2 * i, 2 * i + 2)); - } - // Get all tle clumps; each suffix, first-increment and second-increment - const clumps = []; - const leftover = data.replace(/(:|([0-9])|([A-Z][a-z]*))/g, (all, item, semi, word) => { - if (semi) { - for (let i = parseInt(semi); i >= 0; i--) { - clumps.push(";"); - } - } - else { - clumps.push(item.toLowerCase()); - } - return ""; - }); - /* c8 ignore start */ - if (leftover) { - throw new Error(`leftovers: ${JSON.stringify(leftover)}`); - } - /* c8 ignore stop */ - return unfold(unfold(clumps, ";"), ":"); -} -/** - * @_ignore - */ -export function decodeOwl(data) { - assertArgument(data[0] === "0", "unsupported auwl data", "data", data); - return decode(data.substring(1 + 2 * subsChrs.length), data.substring(1, 1 + 2 * subsChrs.length)); -} -//# sourceMappingURL=decode-owl.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/decode-owl.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/decode-owl.js.map deleted file mode 100644 index e5c66d76..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/decode-owl.js.map +++ /dev/null @@ -1 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EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;QAClF,IAAI,IAAI,EAAE;YACN,KAAK,IAAI,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;gBAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;aAAE;SAClE;aAAM;YACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;SACnC;QACD,OAAO,EAAE,CAAC;IACd,CAAC,CAAC,CAAC;IACH,qBAAqB;IACrB,IAAI,QAAQ,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,cAAe,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAE,EAAE,CAAC,CAAC;KAAE;IAC9E,oBAAoB;IAEpB,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;AAC5C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,IAAY;IAClC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,uBAAuB,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IAEvE,OAAO,MAAM,CACT,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,EACvC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;AACpD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/decode-owla.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/decode-owla.d.ts deleted file mode 100644 index 479e6c54..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/decode-owla.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * @_ignore - */ -export declare function decodeOwlA(data: string, accents: string): Array; -//# sourceMappingURL=decode-owla.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/decode-owla.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/decode-owla.d.ts.map deleted file mode 100644 index bb3d5696..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/decode-owla.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decode-owla.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/decode-owla.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAwBvE"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/decode-owla.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/decode-owla.js deleted file mode 100644 index 0bae6acf..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/decode-owla.js +++ /dev/null @@ -1,28 +0,0 @@ -import { assertArgument } from "../utils/index.js"; -import { decodeBits } from "./bit-reader.js"; -import { decodeOwl } from "./decode-owl.js"; -/** - * @_ignore - */ -export function decodeOwlA(data, accents) { - let words = decodeOwl(data).join(","); - // Inject the accents - accents.split(/,/g).forEach((accent) => { - const match = accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/); - assertArgument(match !== null, "internal error parsing accents", "accents", accents); - let posOffset = 0; - const positions = decodeBits(parseInt(match[3]), match[4]); - const charCode = parseInt(match[2]); - const regex = new RegExp(`([${match[1]}])`, "g"); - words = words.replace(regex, (all, letter) => { - const rem = --positions[posOffset]; - if (rem === 0) { - letter = String.fromCharCode(letter.charCodeAt(0), charCode); - posOffset++; - } - return letter; - }); - }); - return words.split(","); -} -//# sourceMappingURL=decode-owla.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/decode-owla.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/decode-owla.js.map deleted file mode 100644 index 98fc88b1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/decode-owla.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decode-owla.js","sourceRoot":"","sources":["../../src.ts/wordlists/decode-owla.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,OAAe;IACpD,IAAI,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAEtC,qBAAqB;IACrB,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;QAEnC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;QAC5D,cAAc,CAAC,KAAK,KAAK,IAAI,EAAE,gCAAgC,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;QAErF,IAAI,SAAS,GAAG,CAAC,CAAC;QAClB,MAAM,SAAS,GAAG,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3D,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACpC,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,KAAM,KAAK,CAAC,CAAC,CAAE,IAAI,EAAE,GAAG,CAAC,CAAC;QACnD,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE;YACzC,MAAM,GAAG,GAAG,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;YACnC,IAAI,GAAG,KAAK,CAAC,EAAE;gBACX,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;gBAC7D,SAAS,EAAE,CAAC;aACf;YACD,OAAO,MAAM,CAAC;QAClB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/generation/encode-latin.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/generation/encode-latin.d.ts deleted file mode 100644 index a646e824..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/generation/encode-latin.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -export declare class BitWriter { - #private; - readonly width: number; - constructor(width: number); - write(value: number): void; - get length(): number; - get data(): string; -} -export interface AccentSet { - accent: number; - follows: string; - positions: Array; - positionsLength: number; - positionData: string; - positionDataLength: number; -} -export declare function extractAccents(words: Array): { - accents: Array; - words: Array; -}; -export declare function encodeOwl(words: Array): { - subs: string; - data: string; -}; -//# sourceMappingURL=encode-latin.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/generation/encode-latin.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/generation/encode-latin.d.ts.map deleted file mode 100644 index 3aef4135..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/generation/encode-latin.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"encode-latin.d.ts","sourceRoot":"","sources":["../../../src.ts/wordlists/generation/encode-latin.ts"],"names":[],"mappings":"AAuIA,qBAAa,SAAS;;IAClB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;gBAKX,KAAK,EAAE,MAAM;IAMzB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAW1B,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,IAAI,IAAI,MAAM,CA4BjB;CACJ;AAED,MAAM,WAAW,SAAS;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;CAC9B;AAWD,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG;IAAE,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CAAE,CAyExG;AAGD,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CA4C9E"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/generation/encode-latin.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/generation/encode-latin.js deleted file mode 100644 index 9f3b945e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/generation/encode-latin.js +++ /dev/null @@ -1,344 +0,0 @@ -// OWL Data Format -// -// The Official WordList data format exported by this encoder -// encodes sorted latin-1 words (letters only) based on the -// fact that sorted words have prefixes with substantial -// overlap. -// -// For example, the words: -// [ Another, Apple, Apricot, Bread ] -// could be folded once with a single special character, such -// as ":" to yield: -// [ nother, pple, pricot, :, read ]. -// The First letter has been removed, but can be inferred by -// starting at A and incrementing to the next letter when ":" -// is encountered. -// -// The fold operation can be repeated for large sets as even within -// each folded set, there is substantial overlap in prefix. With the -// second special symbol ";", we get: -// [ ; x 13, other, :, ple, ricot, :, ; x 18, ead ] -// which can be further compressed by using numbers instead of the -// special character: -// [ 13, other, :, ple, ricot, :, 18, ead ] -// and to keep all values within a single byte, we only allow a -// maximum value of 10 (using 0 through 9 to represent 1 through 10), -// we get: -// [ 9, 2, other, :, ple, ricot, :, 9, 7, ead ] -// and we use camel-case to imply the bounrary, giving the final string: -// "92Other:PleRicot:97Ead" -// -// Once the entire latin-1 set has been collapsed, we use the remaining -// printable characters (except " and \, which require 2 bytes to represent -// in string) to substitute for the most common 2-letter pairs of letters -// in the string. -// -// OWLA Accent Format -// -// OWLA first removes all accents, and encodes that data using the OWL -// data format and encodes the accents as a base-64 series of 6-bit -// packed bits representing the distance from one followed letter to the -// next. -// -// For example, the acute accent in a given language may follow either -// a or e, in which case the follow-set is "ae". Each letter in the entire -// set is indexed, so the set of words with the accents: -// "thisA/ppleDoe/sNotMa/tterToMe/" -// " 1^ 2^ 3^ 4^ 5^ 6^ " <-- follow-set members, ALL a's and e's -// which gives the positions: -// [ 0, 2, 3, 4, 6 ] -// which then reduce to the distances -// [ 0, 2, 1, 1, 2 ] -// each of which fit into a 2-bit value, so this can be encoded as the -// base-64 encoded string: -// 00 10 01 01 10 = 001001 1010xx -// -// The base-64 set used has all number replaced with their -// shifted-counterparts to prevent conflicting with the numbers used in -// the fold operation to indicate the number of ";". -import fs from "fs"; -import { id } from "../../hash/id.js"; -import { decodeOwl } from "../decode-owl.js"; -import { decodeOwlA } from "../decode-owla.js"; -const subsChrs = " !#$%&'()*+,-./<=>?@[]^_`{|}~"; -const Word = /^[a-z'`]*$/i; -function fold(words, sep) { - const output = []; - let initial = 97; - for (const word of words) { - if (word.match(Word)) { - while (initial < word.charCodeAt(0)) { - initial++; - output.push(sep); - } - output.push(word.substring(1)); - } - else { - initial = 97; - output.push(word); - } - } - return output; -} -function camelcase(words) { - return words.map((word) => { - if (word.match(Word)) { - return word[0].toUpperCase() + word.substring(1); - } - else { - return word; - } - }).join(""); -} -//let cc = 0, ce = 0; -/* -function getChar(c: string): string { - //if (c === "e") { ce++; } - if (c >= 'a' && c <= 'z') { return c; } - if (c.charCodeAt(1)) { - throw new Error(`bad char: "${ c }"`); - } - //cc++; - return ""; - if (c.charCodeAt(0) === 768) { return "`"; } - if (c.charCodeAt(0) === 769) { return "'"; } - if (c.charCodeAt(0) === 771) { return "~"; } - throw new Error(`Unsupported character: ${ c } (${ c.charCodeAt(0) }, ${ c.charCodeAt(1) })`); -} -function mangle(text: string): { word: string, special: string } { - const result: Array = [ ]; - for (let i = 0; i < text.length; i++) { - const c = getChar(text[i]); - result.push(c); - } - - const word = result.join(""); - if (word[1] >= 'a' && word[1] <= 'z') { return { word, special: " " }; } - return { word: word[0] + word.substring(2), special: word[1] }; -} -*/ -/* - Store: [ accent ][ targets ][ rle data; base64-tail ] - ` ae 3, 100 = (63, 37), 15 - ~ n 63, 64 = (63, 1), 27 -*/ -const Base64 = ")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_"; -export class BitWriter { - width; - #data; - #bitLength; - constructor(width) { - this.width = width; - this.#data = []; - this.#bitLength = 0; - } - write(value) { - const maxValue = ((1 << this.width) - 1); - while (value > maxValue) { - this.#data.push(0); - this.#bitLength += this.width; - value -= maxValue; - } - this.#data.push(value); - this.#bitLength += this.width; - } - get length() { - return 1 + Math.trunc((this.#bitLength + 5) / 6); - } - get data() { - let result = String(this.width); - let bits = 0; - let accum = 0; - const data = this.#data.slice(); - let bitMod = this.#bitLength % 6; - while (bitMod !== 0 && bitMod < 6) { - data.push(0); - bitMod += this.width; - } - for (const value of data) { - accum <<= this.width; - accum |= value; - bits += this.width; - if (bits < 6) { - continue; - } - result += Base64[accum >> (bits - 6)]; - bits -= 6; - accum &= ((1 << bits) - 1); - } - if (result.length !== this.length) { - throw new Error(`Hmm: ${this.length} ${result.length} ${result}`); - } - return result; - } -} -; -function sorted(text) { - const letters = text.split(""); - letters.sort(); - return letters.join(""); -} -// if (c.charCodeAt(0) === 768) { return "`"; } -// if (c.charCodeAt(0) === 769) { return "'"; } -// if (c.charCodeAt(0) === 771) { return "~"; } -export function extractAccents(words) { - // Build a list that maps accents to the letters it can follow - const followsMap = new Map(); - for (const word of words) { - for (let i = 0; i < word.length; i++) { - const c = word[i]; - if (c >= 'a' && c <= 'z') { - continue; - } - // Make sure this positions and codepoint make sense - if (c.charCodeAt(1)) { - throw new Error(`unsupported codepoint: "${c}"`); - } - if (i === 0) { - throw new Error(`unmatched accent: ${c}`); - } - const ac = c.charCodeAt(0), lastLetter = word[i - 1]; - ; - const follows = (followsMap.get(ac) || ""); - if (follows.indexOf(lastLetter) === -1) { - followsMap.set(ac, sorted(follows + lastLetter)); - } - } - } - // Build the positions of each follow-set for those accents - const positionsMap = new Map(); - for (const [accent, follows] of followsMap) { - let count = 0; - for (const word of words) { - for (let i = 0; i < word.length; i++) { - const c = word[i], ac = c.charCodeAt(0); - if (follows.indexOf(c) >= 0) { - count++; - } - if (ac === accent) { - const pos = positionsMap.get(ac) || []; - pos.push(count); - positionsMap.set(ac, pos); - } - } - } - } - const accents = []; - for (const [accent, follows] of followsMap) { - let last = -1; - const positions = (positionsMap.get(accent) || []).map((value, index) => { - const delta = value - last; - last = value; - if (index === 0) { - return value; - } - return delta; - }); - // Find the best encoding of the position data - let positionData = ""; - for (let i = 2; i < 7; i++) { - const bitWriter = new BitWriter(i); - for (const p of positions) { - bitWriter.write(p); - } - if (positionData === "" || bitWriter.length < positionData.length) { - positionData = bitWriter.data; - } - } - const positionsLength = positions.length; - const positionDataLength = positionData.length; - accents.push({ accent, follows, positions, positionsLength, positionData, positionDataLength }); - } - words = words.map((word) => { - let result = ""; - for (let i = 0; i < word.length; i++) { - const c = word[i]; - if (c >= 'a' && c <= 'z') { - result += c; - } - } - return result; - }); - return { accents, words }; -} -// Encode Official WordList -export function encodeOwl(words) { - // Fold the sorted words by indicating delta for the first 2 letters - let data = camelcase(fold(fold(words, ":"), ";")); - // Replace semicolons with counts (e.g. ";;;" with "3") - data = data.replace(/(;+)/g, (all, semis) => { - let result = ""; - while (semis.length) { - let count = semis.length; - if (count > 10) { - count = 10; - } - result += String(count - 1); - semis = semis.substring(count); - } - return result; - }); - // Finds the best option for a shortcut replacement using the - // unused ascii7 characters - function findBest() { - const tally = {}; - const l = 2; - for (let i = l; i < data.length; i++) { - const key = data.substring(i - l, i); - tally[key] = (tally[key] || 0) + 1; - } - const sorted = Object.keys(tally).map((text) => { - return { text, count: tally[text], save: (tally[text] * (text.length - 1)) }; - }); - sorted.sort((a, b) => (b.save - a.save)); - return sorted[0].text; - } - // Make substitutions - let subs = ""; - for (let i = 0; i < subsChrs.length; i++) { - const n = subsChrs[i], o = findBest(); - subs += o; - data = data.split(o).join(n); - } - return { data, subs }; -} -// Returns either: -// - OWL data for accent-free latin-1: { data, accentds: "" } -// - OWLA data for accented latin-1: { data, accents } -function encodeWords(_words) { - const { accents, words } = extractAccents(_words); - const { data, subs } = encodeOwl(words); - const accentData = accents.map(({ accent, follows, positionData }) => { - return `${follows}${accent}${positionData}`; - }).join(","); - return { - data: `0${subs}${data}`, - accents: accentData - }; -} -// CLI -const content = fs.readFileSync(process.argv[2]).toString(); -const words = content.split("\n").filter(Boolean); -const { data, accents } = encodeWords(words); -if (accents) { - const rec = decodeOwlA(data, accents); - console.log("DATA: ", JSON.stringify(data)); - console.log("ACCENTS: ", JSON.stringify(accents)); - console.log("LENGTH: ", data.length); - console.log("CHECKSUM: ", id(content)); - console.log("RATIO: ", Math.trunc(100 * data.length / content.length) + "%"); - if (rec.join("\n") !== words.join("\n")) { - throw new Error("no match!"); - } -} -else { - const rec = decodeOwl(data); - console.log("DATA: ", JSON.stringify(data)); - console.log("LENGTH: ", data.length); - console.log("CHECKSUM: ", id(content)); - console.log("RATIO: ", Math.trunc(100 * data.length / content.length) + "%"); - if (rec.join("\n") !== words.join("\n")) { - throw new Error("no match!"); - } -} -//# sourceMappingURL=encode-latin.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/generation/encode-latin.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/generation/encode-latin.js.map deleted file mode 100644 index a9b4842d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/generation/encode-latin.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"encode-latin.js","sourceRoot":"","sources":["../../../src.ts/wordlists/generation/encode-latin.ts"],"names":[],"mappings":"AACA,kBAAkB;AAClB,EAAE;AACF,6DAA6D;AAC7D,2DAA2D;AAC3D,wDAAwD;AACxD,WAAW;AACX,EAAE;AACF,0BAA0B;AAC1B,uCAAuC;AACvC,6DAA6D;AAC7D,mBAAmB;AACnB,uCAAuC;AACvC,4DAA4D;AAC5D,6DAA6D;AAC7D,kBAAkB;AAClB,EAAE;AACF,mEAAmE;AACnE,oEAAoE;AACpE,qCAAqC;AACrC,qDAAqD;AACrD,kEAAkE;AAClE,qBAAqB;AACrB,6CAA6C;AAC7C,+DAA+D;AAC/D,qEAAqE;AACrE,UAAU;AACV,iDAAiD;AACjD,wEAAwE;AACxE,6BAA6B;AAC7B,EAAE;AACF,uEAAuE;AACvE,2EAA2E;AAC3E,yEAAyE;AACzE,iBAAiB;AACjB,EAAE;AACF,qBAAqB;AACrB,EAAE;AACF,sEAAsE;AACtE,mEAAmE;AACnE,wEAAwE;AACxE,QAAQ;AACR,EAAE;AACF,sEAAsE;AACtE,0EAA0E;AAC1E,wDAAwD;AACxD,qCAAqC;AACrC,6EAA6E;AAC7E,6BAA6B;AAC7B,sBAAsB;AACtB,qCAAqC;AACrC,sBAAsB;AACtB,sEAAsE;AACtE,0BAA0B;AAC1B,qCAAqC;AACrC,EAAE;AACF,0DAA0D;AAC1D,uEAAuE;AACvE,oDAAoD;AAEpD,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,OAAO,EAAE,EAAE,EAAE,MAA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C,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;IACnD,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACvC,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IACvC,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC;IAChF,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC;KAAE;CAC7E;KAAM;IACH,MAAM,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IAC5B,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAChD,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACvC,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IACvC,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC;IAChF,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC;KAAE;CAC7E"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/index.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/index.d.ts deleted file mode 100644 index 04a911c8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/index.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * A Wordlist is a set of 2048 words used to encode private keys - * (or other binary data) that is easier for humans to write down, - * transcribe and dictate. - * - * The [[link-bip-39]] standard includes several checksum bits, - * depending on the size of the mnemonic phrase. - * - * A mnemonic phrase may be 12, 15, 18, 21 or 24 words long. For - * most purposes 12 word mnemonics should be used, as including - * additional words increases the difficulty and potential for - * mistakes and does not offer any effective improvement on security. - * - * There are a variety of [[link-bip39-wordlists]] for different - * languages, but for maximal compatibility, the - * [English Wordlist](LangEn) is recommended. - * - * @_section: api/wordlists:Wordlists [about-wordlists] - */ -export { Wordlist } from "./wordlist.js"; -export { LangEn } from "./lang-en.js"; -export { WordlistOwl } from "./wordlist-owl.js"; -export { WordlistOwlA } from "./wordlist-owla.js"; -export { wordlists } from "./wordlists.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/index.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/index.d.ts.map deleted file mode 100644 index ecd1d4b6..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/index.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/index.js deleted file mode 100644 index e3571e6f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/index.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * A Wordlist is a set of 2048 words used to encode private keys - * (or other binary data) that is easier for humans to write down, - * transcribe and dictate. - * - * The [[link-bip-39]] standard includes several checksum bits, - * depending on the size of the mnemonic phrase. - * - * A mnemonic phrase may be 12, 15, 18, 21 or 24 words long. For - * most purposes 12 word mnemonics should be used, as including - * additional words increases the difficulty and potential for - * mistakes and does not offer any effective improvement on security. - * - * There are a variety of [[link-bip39-wordlists]] for different - * languages, but for maximal compatibility, the - * [English Wordlist](LangEn) is recommended. - * - * @_section: api/wordlists:Wordlists [about-wordlists] - */ -export { Wordlist } from "./wordlist.js"; -export { LangEn } from "./lang-en.js"; -export { WordlistOwl } from "./wordlist-owl.js"; -export { WordlistOwlA } from "./wordlist-owla.js"; -export { wordlists } from "./wordlists.js"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/index.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/index.js.map deleted file mode 100644 index 6865131a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/wordlists/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-cz.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-cz.d.ts deleted file mode 100644 index c199d4fa..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-cz.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { WordlistOwl } from "./wordlist-owl.js"; -/** - * The [[link-bip39-cz]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export declare class LangCz extends WordlistOwl { - /** - * Creates a new instance of the Czech language Wordlist. - * - * Using the constructor should be unnecessary, instead use the - * [[wordlist]] singleton method. - * - * @_ignore: - */ - constructor(); - /** - * Returns a singleton instance of a ``LangCz``, creating it - * if this is the first time being called. - */ - static wordlist(): LangCz; -} -//# sourceMappingURL=lang-cz.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-cz.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-cz.d.ts.map deleted file mode 100644 index 975a36b5..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-cz.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-cz.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-cz.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAOhD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IAEnC;;;;;;;OAOG;;IAGH;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM;CAI5B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-cz.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-cz.js deleted file mode 100644 index ed473dbd..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-cz.js +++ /dev/null @@ -1,31 +0,0 @@ -import { WordlistOwl } from "./wordlist-owl.js"; -const words = "0itatkastcenaovo$taouleraeki&chor*teci%enbalodaeladet'!Chn=0Di#%E%^1Resa2Rese3CeT'#0EjKohol0Pu)%0A&sDul#Ekdo)Ke)Ti#Ul|3}aOgan%0FaltI$@tPi,%TmaTronom0LasL{i#Ol0Tobus4Yl:B#}R'?TaUb_U/!U^U+Ur!Xer2A^v#Ambo,An#AtrEp)Ike)KoLohOnzOskevUn{#Usin#Z^Zy2Bl.Bn|})D _D#D'aF{Jar(Kv?LdokLvaN^NkrRzaTikVolZola3D+tL.T'#0Ukot:PartRev&3DrDu+J/JnLaLerLkemLn?N.Nn(N'#NtrumNzZ(2O&2KolivUv!4It_N(0Dn(Ke)KrPot0Ak~AlIkRkot2Kli$a:L-oRe[T_Tum1E,1B!a}'#Cib_Fic Fla%KlKr{Mokr!PreseRbyS#T-tiv3Kob,zKt|O^P]mSkSp+jV`]Vo/2AhaOuhoUhopis1Es0BroByt-C@t}ut DnesH+dHo^H,JemJn?Kl`KolaKtAzeDolObn(OgerieOzdSn(T Z(2B@}'noD-HaH'#S SnoT(0Oj?Or>2Nam :9O]gOnomie0EktronIpsa0AilIseO%P!ie2Izo^O/aOpejOs2EjEn%K<)Kymo0Ike)0FR&S]Zky3StOhOup(T!Ub.U/o)0AtO)Yz0IsOjivoOut0Bl.Boj}DinyDl!Dno)D|Jn(KejLin#L#LubMo+N [No,%RalR^RizontRkoRliv>RmonRn.RoskopR$voSpo^St.T'(U[UfUp!Us#V<2Ad[An?Av(Az^Bo+kD.D]D(N-Ob#Oma^OtOu^Oz@St#Ub(Yz!2B@(B~D[KotMrS aSto)0Ozd2Bn(D,ntGie&M&Sterik:2Yl#3Ned2O&0Uze0Un a0F-%Fla%KasoOva%Sp-%Tern{Vali^Ve$N)rRmarkRoSanSnoT#VD+Dn!_HlanKotL@L oMn(NomP?S{erV Zd>Zero3NakNdyNo/Sk,Sto)Trn?Zva3En|1Gurt5R):Bar{B_Bin{}&D{Did]HanJakJu)KaoKtusLam a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n(IvoOb RojVihYm`]0L@.ManM.Pt!Z`uZdola2At Lt~Lubo#Ot' Ru[0MaMn?0Emn 0Lam!Oum!R!#Umav#0AtoEh#O[OmO$Ozvyk0Ap|ArAt-IjeIz{Ocn Odr!Rzl.Ut|0AkAl(Am@!Ovu0B,z Tav Ub-Ufa+0Lod Omal RavaR( Rud#Rvu1A^An C`]N (NoOv&Y/l Zav(1I/aR! 0B'.Br0Ed~EnkuEs_aOnR!Uk'odYk"; -const checksum = "0x25f44555f4af25b51a711136e1c7d6e50ce9f8917d39d6b1f076b2bb4d2fac1a"; -let wordlist = null; -/** - * The [[link-bip39-cz]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export class LangCz extends WordlistOwl { - /** - * Creates a new instance of the Czech language Wordlist. - * - * Using the constructor should be unnecessary, instead use the - * [[wordlist]] singleton method. - * - * @_ignore: - */ - constructor() { super("cz", words, checksum); } - /** - * Returns a singleton instance of a ``LangCz``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist == null) { - wordlist = new LangCz(); - } - return wordlist; - } -} -//# sourceMappingURL=lang-cz.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-cz.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-cz.js.map deleted file mode 100644 index b05fe8ae..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-cz.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-cz.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-cz.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,KAAK,GAAG,q9NAAq9N,CAAC;AACp+N,MAAM,QAAQ,GAAG,oEAAoE,CAAC;AAEtF,IAAI,QAAQ,GAAkB,IAAI,CAAC;AAEnC;;;;GAIG;AACH,MAAM,OAAO,MAAO,SAAQ,WAAW;IAEnC;;;;;;;OAOG;IACH,gBAAgB,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IAE/C;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACX,IAAI,QAAQ,IAAI,IAAI,EAAE;YAAE,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;SAAE;QAClD,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-en.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-en.d.ts deleted file mode 100644 index 87a3234b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-en.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { WordlistOwl } from "./wordlist-owl.js"; -/** - * The [[link-bip39-en]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export declare class LangEn extends WordlistOwl { - /** - * Creates a new instance of the English language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langEn]] should suffice. - * - * @_ignore: - */ - constructor(); - /** - * Returns a singleton instance of a ``LangEn``, creating it - * if this is the first time being called. - */ - static wordlist(): LangEn; -} -//# sourceMappingURL=lang-en.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-en.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-en.d.ts.map deleted file mode 100644 index 1a3bf42a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-en.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-en.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-en.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAOhD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IAEnC;;;;;;;OAOG;;IAGH;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM;CAI5B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-en.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-en.js deleted file mode 100644 index 142bea39..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-en.js +++ /dev/null @@ -1,31 +0,0 @@ -import { WordlistOwl } from "./wordlist-owl.js"; -const words = "0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2C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K0EyJe@Li+Scu*S =Ta(Vious0CurEAyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOgAyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NNGradeHoldOnP Set1BOng::Rd3Ar~ow9UUngU`:3BraRo9NeO"; -const checksum = "0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"; -let wordlist = null; -/** - * The [[link-bip39-en]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export class LangEn extends WordlistOwl { - /** - * Creates a new instance of the English language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langEn]] should suffice. - * - * @_ignore: - */ - constructor() { super("en", words, checksum); } - /** - * Returns a singleton instance of a ``LangEn``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist == null) { - wordlist = new LangEn(); - } - return wordlist; - } -} -//# sourceMappingURL=lang-en.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-en.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-en.js.map deleted file mode 100644 index 6703337b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-en.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-en.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-en.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,KAAK,GAAG,u3LAAu3L,CAAC;AACt4L,MAAM,QAAQ,GAAG,oEAAoE,CAAC;AAEtF,IAAI,QAAQ,GAAkB,IAAI,CAAC;AAEnC;;;;GAIG;AACH,MAAM,OAAO,MAAO,SAAQ,WAAW;IAEnC;;;;;;;OAOG;IACH,gBAAgB,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IAE/C;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACX,IAAI,QAAQ,IAAI,IAAI,EAAE;YAAE,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;SAAE;QAClD,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-es.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-es.d.ts deleted file mode 100644 index 7e51683e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-es.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { WordlistOwlA } from "./wordlist-owla.js"; -/** - * The [[link-bip39-es]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export declare class LangEs extends WordlistOwlA { - /** - * Creates a new instance of the Spanish language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langEs]] should suffice. - * - * @_ignore: - */ - constructor(); - /** - * Returns a singleton instance of a ``LangEs``, creating it - * if this is the first time being called. - */ - static wordlist(): LangEs; -} -//# sourceMappingURL=lang-es.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-es.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-es.d.ts.map deleted file mode 100644 index 074d92d8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-es.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-es.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-es.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAQlD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,YAAY;IAEpC;;;;;;;OAOG;;IAGH;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM;CAI5B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-es.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-es.js deleted file mode 100644 index 3160c40f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-es.js +++ /dev/null @@ -1,32 +0,0 @@ -import { WordlistOwlA } from "./wordlist-owla.js"; -const words = "0arertoiotadonoaRteirroenaNonaLsolocoiliaralaorrenadaChoN$n0A>Dom,EjaI!#Oga&O'Or#RazoR*Ue=U<0Ab Adem@CeLe%OmoRa!RozUn0DazD$GeLaM,#S,)T^0AlAnceA+EEl]`E`EstruzI.I<2ErU{U'0Af[nArO)Uc Uf_Ul:BaB^|eH@IleJ Lanz/c.LdeMbuN>Nd-oRb(>RnizR+Scu]S#nSu[Tal]T!@T*Tu%UlZ 3BeBid/=S SoSt@3|oEnNgo2An>OqueUsa2ABi`BoCaCi`DaDegaIn//!oLsaMb-{dNi#N}saiRdeRr SqueTeTinVe{Zal2AvoAzoEchaEveIl=In>IsaOcaOmaOnceO)UjaUs>U#2CeoCleE'EyFan{F.HoIt_L#Rbuj(l(+Sc TacaZ.:Bal=BezaBi`B[CaoDav!D,aErFeI{ImanJaJ.LLam Lc$L&Li{dLleLm/^LvoMaMb$Mel=Mi'Mp}c!Nd?Nel-gu+Nic-#N-.ObaOsPazPi%nPo)Pt Puch((b.RcelRe%Rg(i'RneRpe%R+R%SaS>S!oSpaS#rT^ceT_U{lUsaZo3Bol]D!D+Ld/eb_LoAmpuAnc]ApaAr]I>Is)IvoOqueOzaUle%Up 0Cl.EgoE=EnEr#F[G +M->NeN%P_sR>Rue]SneTaU{d2Am^AnA+AseAveI,)ImaInica2B_Cc~|i'Ci`CoDigoDoF_G!He)JinJoL/ch/eg$Lg Lin/l LmoLum`Mba)M!Mi{Mo&Mpr-deNej}g-oc!Nsej}t PaPi(az.Rba%RchoR&nR.(r!S!SmosS%2AneoAt!E Ec!Ei&EmaIaIm,Ip%IsisOmoOnicaOque%U&Uz2Ad+Ar#At+BoBr*| aEl=En#Er{Es%EvaId Lebr/p/#Mb_Mpl*N-e%O%P.Pul( R$Se'Sf[zVaVi'5BleCeL^Ming}N Ra&Rm*RAu%EchaOrO%U*UjoU^2B@CaGa%G.L$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queR[foR)S SeoS~SoS%TaT$Tr@UsaU%VoYa<3A#nCa&C!a|oDalD*G IneL L{'Le/ig+LlejoLoLuc--s N.OnOrPi'Que'R(ch(d!Rez(f?Ri>Rl(mizEgun%Em$EnsaE|!oD^Eb=Er%Es#Lg/*Lm.LpoLrNd*N%P #Pet*PoN{PaP!oSaScaSt+T 5BiB^DoE{G*I&In/e%LoMboM^Ptu[TaTi`:Ba&B!B$BleC GazG[&L/&L!oL*Lm.L.Ls/#LudLv Mb-c~Ndi-e Ng_Ni{dN}#PoQueRdin()nSt_TanU`Xof.3Cc~CoC_#C%DGu*IsL=LvaMa`M?l-d-Re'Rg*S#T?:Ba>BiqueB]BuCoC#JoL L>L,#Ll/.Ma'Mb^Ng}quePaPe)P@P.Qu?l(deRe(if(je%RotR+R%TuajeU+ZaZ.3At+|oC]CnicaJa&J!Ji&L/efo'MaM^Mp=NazNd!N!NisNRmi'Rnur(+rSisSo+StigoT!aX#Z3B$Bu+nEmpoEn{Er[EPoR(.TanT!eTu=Za5Al]B?=C Ci'DoG/&M N}#P PeQueRaxR!oRm,%RneoRoRpe&R_RS!Xi>2AbajoAc#rA!Afi>AgoAjeAmoAnceA#AumaAz EbolEguaEin%EnEp EsIbuIgoIpaIs)IunfoOfeoOmpaOn>OpaO)OzoU>Ue'Ufa2B!@BoEr#MbaM^NelNic(bin(ismoR'T^:0Ic 9C!a0B[l0I{dIrIv!; - join(words: Array): string; - /** - * Returns a singleton instance of a ``LangJa``, creating it - * if this is the first time being called. - */ - static wordlist(): LangJa; -} -//# sourceMappingURL=lang-ja.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-ja.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-ja.d.ts.map deleted file mode 100644 index a1ed9546..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-ja.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-ja.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-ja.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAkIzC;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IAEhC;;;;;;;OAOG;;IAGH,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAO9B,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAIlC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAKpC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM;IAIlC;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM;CAI5B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-ja.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-ja.js deleted file mode 100644 index 7ad4aea3..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-ja.js +++ /dev/null @@ -1,154 +0,0 @@ -import { id } from "../hash/index.js"; -import { hexlify, assertArgument, toUtf8Bytes, toUtf8String } from "../utils/index.js"; -import { Wordlist } from "./wordlist.js"; -const data = [ - // 4-kana words - "AQRASRAGBAGUAIRAHBAghAURAdBAdcAnoAMEAFBAFCBKFBQRBSFBCXBCDBCHBGFBEQBpBBpQBIkBHNBeOBgFBVCBhBBhNBmOBmRBiHBiFBUFBZDBvFBsXBkFBlcBjYBwDBMBBTBBTRBWBBWXXaQXaRXQWXSRXCFXYBXpHXOQXHRXhRXuRXmXXbRXlXXwDXTRXrCXWQXWGaBWaKcaYgasFadQalmaMBacAKaRKKBKKXKKjKQRKDRKCYKCRKIDKeVKHcKlXKjHKrYNAHNBWNaRNKcNIBNIONmXNsXNdXNnBNMBNRBNrXNWDNWMNFOQABQAHQBrQXBQXFQaRQKXQKDQKOQKFQNBQNDQQgQC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FcqDVJwXUJVJFZJchIgJCCxOEJqXxOwXUJyDJBVRuscisciJBiJBieUtqXiJFDJkiFsJXQUGEZJcUJFsJXZtXIrXZDZJDrZJFNJDZJFstXvJFQqXvJFCJEsJXQJqkhkNGBbDJdTRbYJMEBlDwXUJMEFiJFcfXNJDRcNJWMTBLJXC", - // 8-kana words - "BraFUtHBFSJFdbNBLJXVJQoYJNEBSJBEJfHSJHwXUJCJdAZJMGjaFVJXEJPNJBlEJfFiJFpFbFEJqIJBVJCrIBdHiJhOPFChvJVJZJNJWxGFNIFLueIBQJqUHEJfUFstOZJDrlXEASJRlXVJXSFwVJNJWD", - // 9-kana words - "QJEJNNJDQJEJIBSFQJEJxegBQJEJfHEPSJBmXEJFSJCDEJqXLXNJFQqXIcQsFNJFIFEJqXUJgFsJXIJBUJEJfHNFvJxEqXNJnXUJFQqD", - // 10-kana words - "IJBEJqXZJ" -]; -// Maps each character into its kana value (the index) -const mapping = "~~AzB~X~a~KN~Q~D~S~C~G~E~Y~p~L~I~O~eH~g~V~hxyumi~~U~~Z~~v~~s~~dkoblPjfnqwMcRTr~W~~~F~~~~~Jt"; -let _wordlist = null; -function hex(word) { - return hexlify(toUtf8Bytes(word)); -} -const KiYoKu = "0xe3818de38284e3818f"; -const KyoKu = "0xe3818de38283e3818f"; -function toString(data) { - return toUtf8String(new Uint8Array(data)); -} -function loadWords() { - if (_wordlist !== null) { - return _wordlist; - } - const wordlist = []; - // Transforms for normalizing (sort is a not quite UTF-8) - const transform = {}; - // Delete the diacritic marks - transform[toString([227, 130, 154])] = false; - transform[toString([227, 130, 153])] = false; - // Some simple transforms that sort out most of the order - transform[toString([227, 130, 133])] = toString([227, 130, 134]); - transform[toString([227, 129, 163])] = toString([227, 129, 164]); - transform[toString([227, 130, 131])] = toString([227, 130, 132]); - transform[toString([227, 130, 135])] = toString([227, 130, 136]); - // Normalize words using the transform - function normalize(word) { - let result = ""; - for (let i = 0; i < word.length; i++) { - let kana = word[i]; - const target = transform[kana]; - if (target === false) { - continue; - } - if (target) { - kana = target; - } - result += kana; - } - return result; - } - // Sort how the Japanese list is sorted - function sortJapanese(a, b) { - a = normalize(a); - b = normalize(b); - if (a < b) { - return -1; - } - if (a > b) { - return 1; - } - return 0; - } - // Load all the words - for (let length = 3; length <= 9; length++) { - const d = data[length - 3]; - for (let offset = 0; offset < d.length; offset += length) { - const word = []; - for (let i = 0; i < length; i++) { - const k = mapping.indexOf(d[offset + i]); - word.push(227); - word.push((k & 0x40) ? 130 : 129); - word.push((k & 0x3f) + 128); - } - wordlist.push(toString(word)); - } - } - wordlist.sort(sortJapanese); - // For some reason kyoku and kiyoku are flipped in node (!!). - // The order SHOULD be: - // - kyoku - // - kiyoku - // This should ignore "if", but that doesn't work here?? - /* c8 ignore start */ - if (hex(wordlist[442]) === KiYoKu && hex(wordlist[443]) === KyoKu) { - const tmp = wordlist[442]; - wordlist[442] = wordlist[443]; - wordlist[443] = tmp; - } - /* c8 ignore stop */ - // Verify the computed list matches the official list - /* istanbul ignore if */ - const checksum = id(wordlist.join("\n") + "\n"); - /* c8 ignore start */ - if (checksum !== "0xcb36b09e6baa935787fd762ce65e80b0c6a8dabdfbc3a7f86ac0e2c4fd111600") { - throw new Error("BIP39 Wordlist for ja (Japanese) FAILED"); - } - /* c8 ignore stop */ - _wordlist = wordlist; - return wordlist; -} -let wordlist = null; -/** - * The [[link-bip39-ja]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export class LangJa extends Wordlist { - /** - * Creates a new instance of the Japanese language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langJa]] should suffice. - * - * @_ignore: - */ - constructor() { super("ja"); } - getWord(index) { - const words = loadWords(); - assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); - return words[index]; - } - getWordIndex(word) { - return loadWords().indexOf(word); - } - split(phrase) { - //logger.assertNormalize(); - return phrase.split(/(?:\u3000| )+/g); - } - join(words) { - return words.join("\u3000"); - } - /** - * Returns a singleton instance of a ``LangJa``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist == null) { - wordlist = new LangJa(); - } - return wordlist; - } -} -//# sourceMappingURL=lang-ja.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-ja.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-ja.js.map deleted file mode 100644 index f72046b7..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-ja.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-ja.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-ja.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EACH,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,YAAY,EACrD,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGzC,MAAM,IAAI,GAAG;IAET,eAAe;IACf,orEAAorE;IAEprE,eAAe;IACf,ssGAAssG;IAEtsG,eAAe;IACf,4uDAA4uD;IAE5uD,eAAe;IACf,olBAAolB;IAEplB,eAAe;IACf,4JAA4J;IAE5J,eAAe;IACf,0GAA0G;IAE1G,gBAAgB;IAChB,WAAW;CACd,CAAC;AAEF,sDAAsD;AACtD,MAAM,OAAO,GAAG,6FAA6F,CAAA;AAE7G,IAAI,SAAS,GAAyB,IAAI,CAAC;AAE3C,SAAS,GAAG,CAAC,IAAY;IACrB,OAAO,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,MAAM,GAAG,sBAAsB,CAAC;AACtC,MAAM,KAAK,GAAG,sBAAsB,CAAA;AAEpC,SAAS,QAAQ,CAAC,IAAmB;IACjC,OAAO,YAAY,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;AAC9C,CAAC;AAED,SAAS,SAAS;IACd,IAAI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AAK,IAAI,CAAC,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,EAC7C,uBAAwB,KAAM,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;QACtD,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;IAED,YAAY,CAAC,IAAY;QACrB,OAAO,SAAS,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;IAED,KAAK,CAAC,MAAc;QAChB,2BAA2B;QAC3B,OAAO,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAC1C,CAAC;IAED,IAAI,CAAC,KAAoB;QACrB,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAChC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACX,IAAI,QAAQ,IAAI,IAAI,EAAE;YAAE,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;SAAE;QAClD,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-ko.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-ko.d.ts deleted file mode 100644 index 4329e055..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-ko.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Wordlist } from "./wordlist.js"; -/** - * The [[link-bip39-ko]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export declare class LangKo extends Wordlist { - /** - * Creates a new instance of the Korean language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langKo]] should suffice. - * - * @_ignore: - */ - constructor(); - getWord(index: number): string; - getWordIndex(word: string): number; - /** - * Returns a singleton instance of a ``LangKo``, creating it - * if this is the first time being called. - */ - static wordlist(): LangKo; -} -//# sourceMappingURL=lang-ko.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-ko.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-ko.d.ts.map deleted file mode 100644 index 71fbbcdf..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-ko.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-ko.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-ko.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AA8DzC;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IAEhC;;;;;;;OAOG;;IAKH,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAO9B,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAIlC;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM;CAI5B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-ko.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-ko.js deleted file mode 100644 index d575f874..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-ko.js +++ /dev/null @@ -1,89 +0,0 @@ -import { id } from "../hash/index.js"; -import { assertArgument, toUtf8String } from "../utils/index.js"; -import { Wordlist } from "./wordlist.js"; -const data = [ - "OYAa", - "ATAZoATBl3ATCTrATCl8ATDloATGg3ATHT8ATJT8ATJl3ATLlvATLn4ATMT8ATMX8ATMboATMgoAToLbAToMTATrHgATvHnAT3AnAT3JbAT3MTAT8DbAT8JTAT8LmAT8MYAT8MbAT#LnAUHT8AUHZvAUJXrAUJX8AULnrAXJnvAXLUoAXLgvAXMn6AXRg3AXrMbAX3JTAX3QbAYLn3AZLgvAZrSUAZvAcAZ8AaAZ8AbAZ8AnAZ8HnAZ8LgAZ8MYAZ8MgAZ8OnAaAboAaDTrAaFTrAaJTrAaJboAaLVoAaMXvAaOl8AaSeoAb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LTrSTvLTHXMnSb3RYLnMnSgOg6ATFg", - "HUDlGnrQXrJTrHgLnrAcJYMb8DULc8LTvFgGnCk3Mg8JbAnLX4QYvFYHnMXrRUoJnGnvFnRlvFTJlQnoSTrBXHXrLYSUJgLfoMT8Se8DTrHbDb", - "AbDl8SToJU8An3RbAb8ST8DUSTrGnrAgoLbFU6Db8LTrMg8AaHT8Jb8ObDl8SToJU8Pb3RlvFYoJl" -]; -const codes = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*"; -function getHangul(code) { - if (code >= 40) { - code = code + 168 - 40; - } - else if (code >= 19) { - code = code + 97 - 19; - } - return toUtf8String(new Uint8Array([225, (code >> 6) + 132, (code & 0x3f) + 128])); -} -let _wordlist = null; -function loadWords() { - if (_wordlist != null) { - return _wordlist; - } - const wordlist = []; - data.forEach((data, length) => { - length += 4; - for (let i = 0; i < data.length; i += length) { - let word = ""; - for (let j = 0; j < length; j++) { - word += getHangul(codes.indexOf(data[i + j])); - } - wordlist.push(word); - } - }); - wordlist.sort(); - // Verify the computed list matches the official list - /* istanbul ignore if */ - const checksum = id(wordlist.join("\n") + "\n"); - /* c8 ignore start */ - if (checksum !== "0xf9eddeace9c5d3da9c93cf7d3cd38f6a13ed3affb933259ae865714e8a3ae71a") { - throw new Error("BIP39 Wordlist for ko (Korean) FAILED"); - } - /* c8 ignore stop */ - _wordlist = wordlist; - return wordlist; -} -let wordlist = null; -/** - * The [[link-bip39-ko]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export class LangKo extends Wordlist { - /** - * Creates a new instance of the Korean language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langKo]] should suffice. - * - * @_ignore: - */ - constructor() { - super("ko"); - } - getWord(index) { - const words = loadWords(); - assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); - return words[index]; - } - getWordIndex(word) { - return loadWords().indexOf(word); - } - /** - * Returns a singleton instance of a ``LangKo``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist == null) { - wordlist = new LangKo(); - } - return wordlist; - } -} -//# sourceMappingURL=lang-ko.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-ko.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-ko.js.map deleted file mode 100644 index bee4337b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-ko.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-ko.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-ko.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGzC,MAAM,IAAI,GAAG;IACT,MAAM;IACN,y5JAAy5J;IACz5J,8lIAA8lI;IAC9lI,i8BAAi8B;IACj8B,koCAAkoC;IACloC,yaAAya;IACza,gHAAgH;IAChH,+EAA+E;CAClF,CAAA;AAED,MAAM,KAAK,GAAG,wEAAwE,CAAA;AAEtF,SAAS,SAAS,CAAC,IAAY;IAC3B,IAAI,IAAI,IAAI,EAAE,EAAE;QACZ,IAAI,GAAG,IAAI,GAAG,GAAG,GAAG,EAAE,CAAC;KAC1B;SAAM,IAAI,IAAI,IAAI,EAAE,EAAE;QACnB,IAAI,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,CAAC;KACzB;IAED,OAAO,YAAY,CAAC,IAAI,UAAU,CAAC,CAAE,GAAG,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;AACxF,CAAC;AAED,IAAI,SAAS,GAAyB,IAAI,CAAC;AAE3C,SAAS,SAAS;I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,IAAI,CAAC,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,EAC7C,uBAAwB,KAAM,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;QACtD,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;IAED,YAAY,CAAC,IAAY;QACrB,OAAO,SAAS,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACX,IAAI,QAAQ,IAAI,IAAI,EAAE;YAAE,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;SAAE;QAClD,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-pt.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-pt.d.ts deleted file mode 100644 index f218013c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-pt.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { WordlistOwl } from "./wordlist-owl.js"; -/** - * The [[link-bip39-pt]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export declare class LangPt extends WordlistOwl { - /** - * Creates a new instance of the Portuguese language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langPt]] should suffice. - * - * @_ignore: - */ - constructor(); - /** - * Returns a singleton instance of a ``LangPt``, creating it - * if this is the first time being called. - */ - static wordlist(): LangPt; -} -//# sourceMappingURL=lang-pt.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-pt.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-pt.d.ts.map deleted file mode 100644 index 68f390d5..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-pt.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-pt.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-pt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAOhD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IAEnC;;;;;;;OAOG;;IAGH;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM;CAI5B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-pt.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-pt.js deleted file mode 100644 index a76cc595..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-pt.js +++ /dev/null @@ -1,31 +0,0 @@ -import { WordlistOwl } from "./wordlist-owl.js"; -const words = "0arad!ototealirertainrasoent hoandoaR#riareha!aroele'oronul0Aca%AixoAl A%rDuz'El]Er$IsmoO$ Rum S-&T(i&TigoVo[=0F&.Il#P' S?S* So&/Sun$Tr&0Ac#Adu+Al/A[f E End(Er_EuIng'Ir?IvoOl{oRac Revi=RizU&Um0Di$rM-.R>o+TismoT|@Tu 0Ali An%Ar@Ent&Es,I?Is Ul,1Ila1Ar E=Ei%Ulejo:B BosaC&]uCh `C@GagemI+c>~/Se#S)n%Ta)Te=rTidaTomTuc Unil]3B(IjoIr^IsebolLd!eLezaLgaLisc Ndi$Ng&aNz(RimbauRl*d>_Sou_XigaZ(_3CoCu=En&Foc&Furc G|naLhe%Mest[Mo$rOlog@OmboOsf(aPol Rr-$Scoi$Sne$SpoSsex$TolaZ _2Ind#OcoOque 2A$BagemC#CejoChec]Ico.L^LetimL]LoMb{oNdeNecoNi)Rb~h>d>e&R+c]V*oXe?2AncoAsaAvezaEuIgaIl/Inc OaOchu+Onze O$Uxo2C]DismoF LeRacoScaS$Z*a:Bimb Rn{oRpe%R['>)zRv&/SacoScaSeb[S%loS~oT a)Tiv UleUs?U%l V&oV(na3BolaDil]G}]Lebr L~ Nou+N,N%ioRc Rr#R%'oR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D+G^I$r&IxeLeLicplexoRsi<>%nceRucaSc#SquisaS,aTisc 3AdaC#Ed!eGm-$Last+Lh#Lo.M-)Nc`NguimN]No%N.On{oPocaQue%ResRue)Sc S$laTg-$Rje)Tur Ud!eXof}eZ}&3C C~ DaD-$Di#Do,Du$rGm-$G[=Gun=IvaLe$LvagemM<&M-%N?N/rNsu&Nt#P #Rei>*g>+RvoTemb_T|3GiloLhue)Lic}eMetr@Mpat@M~ N&Nc(oNg~ NopseN$ni>-eRiTu#5B(fis)Rp[s>[&Rt'Sp'oS%n$:B`aBle%Bu^C/G `aLh(LoLvezMdioRef>j>+xaTuagemUr*oXativoXis)3Atr&C(Ci=Cl#Dio,IaIm Lef}eLh#Mp(oN-%N,rN.Rm&RnoRr-oSeSou+St#ToXtu+Xugo3A+G`aJoloMbr MidezNgi=N%'oRagemT~ 5Al]C]L( LiceM^Mil/N`Ntu+Pe%R>ci=RneioRqueRr!>$S.UcaUp{aX*a2Ab&/Acej Adu$rAfeg Aje$AmaAnc ApoAs{oAt?Av E*oEm(Epid EvoIagemIboIcicloId-%Ilog@Ind!eIploItur Iunf&Oc Ombe)OvaUnfoUque2B~ CquesaT` T|i&:7V 3Bigo0HaId!eIf|me3Olog@SoTigaUbu0A=InaUfru':C*aDi G o,I=,LaL-%Lid!eLo[sN)gemQu{oRe)Rr(Sc~ Sil]S,u+Z Zio3A=D Ge.Ic~ L{oLhiceLu=Nce=rNdav&N( Nt[Rb&Rd!eRe?Rg}h>m`/RnizRs R%n%SpaSti=T|i&3Adu$AgemAj Atu+Br?D{aDr @ElaGaG-%Gi G| L ejoNcoNhe)NilOle)R!>tudeSi.S$Tr&V{oZ*/5A=rArG&L<%LeibolL)gemLumo,Nt!e5L$Vuz`a::D[zRope3QueRe.Rife3Ng ::Ng#Rp 3BuL?9Mb Olog@5Mbi="; -const checksum = "0x2219000926df7b50d8aa0a3d495826b988287df4657fbd100e6fe596c8f737ac"; -let wordlist = null; -/** - * The [[link-bip39-pt]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export class LangPt extends WordlistOwl { - /** - * Creates a new instance of the Portuguese language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langPt]] should suffice. - * - * @_ignore: - */ - constructor() { super("pt", words, checksum); } - /** - * Returns a singleton instance of a ``LangPt``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist == null) { - wordlist = new LangPt(); - } - return wordlist; - } -} -//# sourceMappingURL=lang-pt.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-pt.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-pt.js.map deleted file mode 100644 index c77ff409..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-pt.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-pt.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-pt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,KAAK,GAAG,s0OAAs0O,CAAC;AACr1O,MAAM,QAAQ,GAAG,oEAAoE,CAAC;AAEtF,IAAI,QAAQ,GAAkB,IAAI,CAAC;AAEnC;;;;GAIG;AACH,MAAM,OAAO,MAAO,SAAQ,WAAW;IAEnC;;;;;;;OAOG;IACH,gBAAgB,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IAE/C;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACX,IAAI,QAAQ,IAAI,IAAI,EAAE;YAAE,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;SAAE;QAClD,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-zh.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-zh.d.ts deleted file mode 100644 index 5d0c14c7..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-zh.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { Wordlist } from "./wordlist.js"; -/** - * The [[link-bip39-zh_cn]] and [[link-bip39-zh_tw]] for - * [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export declare class LangZh extends Wordlist { - /** - * Creates a new instance of the Chinese language Wordlist for - * the %%dialect%%, either ``"cn"`` or ``"tw"`` for simplified - * or traditional, respectively. - * - * This should be unnecessary most of the time as the exported - * [[langZhCn]] and [[langZhTw]] should suffice. - * - * @_ignore: - */ - constructor(dialect: string); - getWord(index: number): string; - getWordIndex(word: string): number; - split(phrase: string): Array; - /** - * Returns a singleton instance of a ``LangZh`` for %%dialect%%, - * creating it if this is the first time being called. - * - * Use the %%dialect%% ``"cn"`` or ``"tw"`` for simplified or - * traditional, respectively. - */ - static wordlist(dialect: string): LangZh; -} -//# sourceMappingURL=lang-zh.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-zh.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-zh.d.ts.map deleted file mode 100644 index 7b96b48e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-zh.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-zh.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-zh.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AA2DzC;;;;;GAKG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IAEhC;;;;;;;;;OASG;gBACS,OAAO,EAAE,MAAM;IAE3B,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAO9B,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAIlC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAKpC;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;CAM3C"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-zh.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-zh.js deleted file mode 100644 index cabbca27..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-zh.js +++ /dev/null @@ -1,92 +0,0 @@ -import { id } from "../hash/index.js"; -import { assertArgument, toUtf8String } from "../utils/index.js"; -import { Wordlist } from "./wordlist.js"; -const data = "}aE#4A=Yv&co#4N#6G=cJ&SM#66|/Z#4t&kn~46#4K~4q%b9=IR#7l,mB#7W_X2*dl}Uo~7s}Uf&Iw#9c&cw~6O&H6&wx&IG%v5=IQ~8a&Pv#47$PR&50%Ko&QM&3l#5f,D9#4L|/H&tQ;v0~6n]nN> 2), - 128 + codes.indexOf(data[i * 3 + 1]), - 128 + codes.indexOf(data[i * 3 + 2]), - ]; - if (locale === "zh_tw") { - const common = s % 4; - for (let i = common; i < 3; i++) { - bytes[i] = codes.indexOf(deltaData[deltaOffset++]) + ((i == 0) ? 228 : 128); - } - } - wordlist.push(toUtf8String(new Uint8Array(bytes))); - } - // Verify the computed list matches the official list - const checksum = id(wordlist.join("\n") + "\n"); - /* c8 ignore start */ - if (checksum !== Checks[locale]) { - throw new Error(`BIP39 Wordlist for ${locale} (Chinese) FAILED`); - } - /* c8 ignore stop */ - _wordlist[locale] = wordlist; - return wordlist; -} -const wordlists = {}; -/** - * The [[link-bip39-zh_cn]] and [[link-bip39-zh_tw]] for - * [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export class LangZh extends Wordlist { - /** - * Creates a new instance of the Chinese language Wordlist for - * the %%dialect%%, either ``"cn"`` or ``"tw"`` for simplified - * or traditional, respectively. - * - * This should be unnecessary most of the time as the exported - * [[langZhCn]] and [[langZhTw]] should suffice. - * - * @_ignore: - */ - constructor(dialect) { super("zh_" + dialect); } - getWord(index) { - const words = loadWords(this.locale); - assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); - return words[index]; - } - getWordIndex(word) { - return loadWords(this.locale).indexOf(word); - } - split(phrase) { - phrase = phrase.replace(/(?:\u3000| )+/g, ""); - return phrase.split(""); - } - /** - * Returns a singleton instance of a ``LangZh`` for %%dialect%%, - * creating it if this is the first time being called. - * - * Use the %%dialect%% ``"cn"`` or ``"tw"`` for simplified or - * traditional, respectively. - */ - static wordlist(dialect) { - if (wordlists[dialect] == null) { - wordlists[dialect] = new LangZh(dialect); - } - return wordlists[dialect]; - } -} -//# sourceMappingURL=lang-zh.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-zh.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-zh.js.map deleted file mode 100644 index 22ba9a07..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/lang-zh.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-zh.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-zh.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGzC,MAAM,IAAI,GAAG,kgMAAkgM,CAAC;AAChhM,MAAM,SAAS,GAAG,6lDAA6lD,CAAC;AAGhnD,MAAM,SAAS,GAAyC;IACpD,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;CACd,CAAA;AAED,MAAM,MAAM,GAA2B;IACnC,KAAK,EAAE,oEAAoE;IAC3E,KAAK,EAAE,oEAAoE;CAC9E,CAAA;AAED,MAAM,KAAK,GAAG,kEAAkE,CAAC;AACjF,MAAM,KAAK,GAAG,4BAA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AAO,SAAS,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist-owl.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist-owl.d.ts deleted file mode 100644 index c4d1efc0..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist-owl.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { Wordlist } from "./wordlist.js"; -/** - * An OWL format Wordlist is an encoding method that exploits - * the general locality of alphabetically sorted words to - * achieve a simple but effective means of compression. - * - * This class is generally not useful to most developers as - * it is used mainly internally to keep Wordlists for languages - * based on ASCII-7 small. - * - * If necessary, there are tools within the ``generation/`` folder - * to create the necessary data. - */ -export declare class WordlistOwl extends Wordlist { - #private; - /** - * Creates a new Wordlist for %%locale%% using the OWL %%data%% - * and validated against the %%checksum%%. - */ - constructor(locale: string, data: string, checksum: string); - /** - * The OWL-encoded data. - */ - get _data(): string; - /** - * Decode all the words for the wordlist. - */ - _decodeWords(): Array; - getWord(index: number): string; - getWordIndex(word: string): number; -} -//# sourceMappingURL=wordlist-owl.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist-owl.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist-owl.d.ts.map deleted file mode 100644 index fe49ddf8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist-owl.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlist-owl.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist-owl.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;;;;;;;;;;GAWG;AACH,qBAAa,WAAY,SAAQ,QAAQ;;IAIrC;;;OAGG;gBACS,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAO1D;;OAEG;IACH,IAAI,KAAK,IAAI,MAAM,CAAuB;IAE1C;;OAEG;IACH,YAAY,IAAI,KAAK,CAAC,MAAM,CAAC;IAsB7B,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAM9B,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAGrC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist-owl.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist-owl.js deleted file mode 100644 index eb3e6be0..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist-owl.js +++ /dev/null @@ -1,66 +0,0 @@ -// Use the encode-latin.js script to create the necessary -// data files to be consumed by this class -import { id } from "../hash/index.js"; -import { assertArgument } from "../utils/index.js"; -import { decodeOwl } from "./decode-owl.js"; -import { Wordlist } from "./wordlist.js"; -/** - * An OWL format Wordlist is an encoding method that exploits - * the general locality of alphabetically sorted words to - * achieve a simple but effective means of compression. - * - * This class is generally not useful to most developers as - * it is used mainly internally to keep Wordlists for languages - * based on ASCII-7 small. - * - * If necessary, there are tools within the ``generation/`` folder - * to create the necessary data. - */ -export class WordlistOwl extends Wordlist { - #data; - #checksum; - /** - * Creates a new Wordlist for %%locale%% using the OWL %%data%% - * and validated against the %%checksum%%. - */ - constructor(locale, data, checksum) { - super(locale); - this.#data = data; - this.#checksum = checksum; - this.#words = null; - } - /** - * The OWL-encoded data. - */ - get _data() { return this.#data; } - /** - * Decode all the words for the wordlist. - */ - _decodeWords() { - return decodeOwl(this.#data); - } - #words; - #loadWords() { - if (this.#words == null) { - const words = this._decodeWords(); - // Verify the computed list matches the official list - const checksum = id(words.join("\n") + "\n"); - /* c8 ignore start */ - if (checksum !== this.#checksum) { - throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`); - } - /* c8 ignore stop */ - this.#words = words; - } - return this.#words; - } - getWord(index) { - const words = this.#loadWords(); - assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); - return words[index]; - } - getWordIndex(word) { - return this.#loadWords().indexOf(word); - } -} -//# sourceMappingURL=wordlist-owl.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist-owl.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist-owl.js.map deleted file mode 100644 index a7bda021..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist-owl.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlist-owl.js","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist-owl.ts"],"names":[],"mappings":"AACA,yDAAyD;AACzD,0CAA0C;AAE1C,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,WAAY,SAAQ,QAAQ;IACrC,KAAK,CAAS;IACd,SAAS,CAAS;IAElB;;;OAGG;IACH,YAAY,MAAc,EAAE,IAAY,EAAE,QAAgB;QACtD,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,IAAI,KAAK,KAAa,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAE1C;;OAEG;IACH,YAAY;QACR,OAAO,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IAED,MAAM,CAAuB;IAC7B,UAAU;QACN,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,EAAE;YACrB,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;YAElC,qDAAqD;YACrD,MAAM,QAAQ,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;YAC7C,qBAAqB;YACrB,IAAI,QAAQ,KAAK,IAAI,CAAC,SAAS,EAAE;gBAC7B,MAAM,IAAI,KAAK,CAAC,sBAAuB,IAAI,CAAC,MAAO,SAAS,CAAC,CAAC;aACjE;YACD,oBAAoB;YAEpB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;SACvB;QACD,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAED,OAAO,CAAC,KAAa;QACjB,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAChC,cAAc,CAAC,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,uBAAwB,KAAM,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;QACrG,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;IAED,YAAY,CAAC,IAAY;QACrB,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist-owla.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist-owla.d.ts deleted file mode 100644 index c87022df..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist-owla.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { WordlistOwl } from "./wordlist-owl.js"; -/** - * An OWL-A format Wordlist extends the OWL format to add an - * overlay onto an OWL format Wordlist to support diacritic - * marks. - * - * This class is generally not useful to most developers as - * it is used mainly internally to keep Wordlists for languages - * based on latin-1 small. - * - * If necessary, there are tools within the ``generation/`` folder - * to create the necessary data. - */ -export declare class WordlistOwlA extends WordlistOwl { - #private; - /** - * Creates a new Wordlist for %%locale%% using the OWLA %%data%% - * and %%accent%% data and validated against the %%checksum%%. - */ - constructor(locale: string, data: string, accent: string, checksum: string); - /** - * The OWLA-encoded accent data. - */ - get _accent(): string; - /** - * Decode all the words for the wordlist. - */ - _decodeWords(): Array; -} -//# sourceMappingURL=wordlist-owla.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist-owla.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist-owla.d.ts.map deleted file mode 100644 index 97ed583b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist-owla.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlist-owla.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist-owla.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD;;;;;;;;;;;GAWG;AACH,qBAAa,YAAa,SAAQ,WAAW;;IAIzC;;;OAGG;gBACS,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAK1E;;OAEG;IACH,IAAI,OAAO,IAAI,MAAM,CAAyB;IAE9C;;OAEG;IACH,YAAY,IAAI,KAAK,CAAC,MAAM,CAAC;CAGhC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist-owla.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist-owla.js deleted file mode 100644 index 9764a698..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist-owla.js +++ /dev/null @@ -1,36 +0,0 @@ -import { WordlistOwl } from "./wordlist-owl.js"; -import { decodeOwlA } from "./decode-owla.js"; -/** - * An OWL-A format Wordlist extends the OWL format to add an - * overlay onto an OWL format Wordlist to support diacritic - * marks. - * - * This class is generally not useful to most developers as - * it is used mainly internally to keep Wordlists for languages - * based on latin-1 small. - * - * If necessary, there are tools within the ``generation/`` folder - * to create the necessary data. - */ -export class WordlistOwlA extends WordlistOwl { - #accent; - /** - * Creates a new Wordlist for %%locale%% using the OWLA %%data%% - * and %%accent%% data and validated against the %%checksum%%. - */ - constructor(locale, data, accent, checksum) { - super(locale, data, checksum); - this.#accent = accent; - } - /** - * The OWLA-encoded accent data. - */ - get _accent() { return this.#accent; } - /** - * Decode all the words for the wordlist. - */ - _decodeWords() { - return decodeOwlA(this._data, this._accent); - } -} -//# sourceMappingURL=wordlist-owla.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist-owla.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist-owla.js.map deleted file mode 100644 index 58c7bd67..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist-owla.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlist-owla.js","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist-owla.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,YAAa,SAAQ,WAAW;IACzC,OAAO,CAAS;IAGhB;;;OAGG;IACH,YAAY,MAAc,EAAE,IAAY,EAAE,MAAc,EAAE,QAAgB;QACtE,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,IAAI,OAAO,KAAa,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAE9C;;OAEG;IACH,YAAY;QACR,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAChD,CAAC;CACJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist.d.ts deleted file mode 100644 index cb843f3e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -/** - * A Wordlist represents a collection of language-specific - * words used to encode and devoce [[link-bip-39]] encoded data - * by mapping words to 11-bit values and vice versa. - */ -export declare abstract class Wordlist { - locale: string; - /** - * Creates a new Wordlist instance. - * - * Sub-classes MUST call this if they provide their own constructor, - * passing in the locale string of the language. - * - * Generally there is no need to create instances of a Wordlist, - * since each language-specific Wordlist creates an instance and - * there is no state kept internally, so they are safe to share. - */ - constructor(locale: string); - /** - * Sub-classes may override this to provide a language-specific - * method for spliting %%phrase%% into individual words. - * - * By default, %%phrase%% is split using any sequences of - * white-space as defined by regular expressions (i.e. ``/\s+/``). - */ - split(phrase: string): Array; - /** - * Sub-classes may override this to provider a language-specific - * method for joining %%words%% into a phrase. - * - * By default, %%words%% are joined by a single space. - */ - join(words: Array): string; - /** - * Maps an 11-bit value into its coresponding word in the list. - * - * Sub-classes MUST override this. - */ - abstract getWord(index: number): string; - /** - * Maps a word to its corresponding 11-bit value. - * - * Sub-classes MUST override this. - */ - abstract getWordIndex(word: string): number; -} -//# sourceMappingURL=wordlist.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist.d.ts.map deleted file mode 100644 index 6ba6025d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlist.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,8BAAsB,QAAQ;IAC1B,MAAM,EAAG,MAAM,CAAC;IAEhB;;;;;;;;;OASG;gBACS,MAAM,EAAE,MAAM;IAI1B;;;;;;OAMG;IACH,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAIpC;;;;;OAKG;IACH,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM;IAIlC;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAEvC;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAC9C"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist.js deleted file mode 100644 index 6327a49d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist.js +++ /dev/null @@ -1,42 +0,0 @@ -import { defineProperties } from "../utils/index.js"; -/** - * A Wordlist represents a collection of language-specific - * words used to encode and devoce [[link-bip-39]] encoded data - * by mapping words to 11-bit values and vice versa. - */ -export class Wordlist { - locale; - /** - * Creates a new Wordlist instance. - * - * Sub-classes MUST call this if they provide their own constructor, - * passing in the locale string of the language. - * - * Generally there is no need to create instances of a Wordlist, - * since each language-specific Wordlist creates an instance and - * there is no state kept internally, so they are safe to share. - */ - constructor(locale) { - defineProperties(this, { locale }); - } - /** - * Sub-classes may override this to provide a language-specific - * method for spliting %%phrase%% into individual words. - * - * By default, %%phrase%% is split using any sequences of - * white-space as defined by regular expressions (i.e. ``/\s+/``). - */ - split(phrase) { - return phrase.toLowerCase().split(/\s+/g); - } - /** - * Sub-classes may override this to provider a language-specific - * method for joining %%words%% into a phrase. - * - * By default, %%words%% are joined by a single space. - */ - join(words) { - return words.join(" "); - } -} -//# sourceMappingURL=wordlist.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist.js.map deleted file mode 100644 index 9ee157a9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlist.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlist.js","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;GAIG;AACH,MAAM,OAAgB,QAAQ;IAC1B,MAAM,CAAU;IAEhB;;;;;;;;;OASG;IACH,YAAY,MAAc;QACtB,gBAAgB,CAAW,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IACjD,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,MAAc;QAChB,OAAO,MAAM,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IAC7C,CAAC;IAED;;;;;OAKG;IACH,IAAI,CAAC,KAAoB;QACrB,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;CAeJ"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists-browser.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists-browser.d.ts deleted file mode 100644 index d0dbd19c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists-browser.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Wordlist } from "./wordlist.js"; -export declare const wordlists: Record; -//# sourceMappingURL=wordlists-browser.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists-browser.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists-browser.d.ts.map deleted file mode 100644 index cebd601e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlists-browser.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlists-browser.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAE9C,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists-browser.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists-browser.js deleted file mode 100644 index 9129fa29..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists-browser.js +++ /dev/null @@ -1,5 +0,0 @@ -import { LangEn } from "./lang-en.js"; -export const wordlists = { - en: LangEn.wordlist(), -}; -//# sourceMappingURL=wordlists-browser.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists-browser.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists-browser.js.map deleted file mode 100644 index c9491931..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists-browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlists-browser.js","sourceRoot":"","sources":["../../src.ts/wordlists/wordlists-browser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAItC,MAAM,CAAC,MAAM,SAAS,GAA6B;IACjD,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE;CACtB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists-extra.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists-extra.d.ts deleted file mode 100644 index 7e15a233..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists-extra.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export { LangCz } from "./lang-cz.js"; -export { LangEs } from "./lang-es.js"; -export { LangFr } from "./lang-fr.js"; -export { LangJa } from "./lang-ja.js"; -export { LangKo } from "./lang-ko.js"; -export { LangIt } from "./lang-it.js"; -export { LangPt } from "./lang-pt.js"; -export { LangZh } from "./lang-zh.js"; -//# sourceMappingURL=wordlists-extra.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists-extra.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists-extra.d.ts.map deleted file mode 100644 index 6003081c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists-extra.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlists-extra.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlists-extra.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists-extra.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists-extra.js deleted file mode 100644 index 47e509eb..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists-extra.js +++ /dev/null @@ -1,9 +0,0 @@ -export { LangCz } from "./lang-cz.js"; -export { LangEs } from "./lang-es.js"; -export { LangFr } from "./lang-fr.js"; -export { LangJa } from "./lang-ja.js"; -export { LangKo } from "./lang-ko.js"; -export { LangIt } from "./lang-it.js"; -export { LangPt } from "./lang-pt.js"; -export { LangZh } from "./lang-zh.js"; -//# sourceMappingURL=wordlists-extra.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists-extra.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists-extra.js.map deleted file mode 100644 index 9d9e4e52..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists-extra.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlists-extra.js","sourceRoot":"","sources":["../../src.ts/wordlists/wordlists-extra.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists.d.ts b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists.d.ts deleted file mode 100644 index ab8b0308..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { Wordlist } from "./wordlist.js"; -/** - * The available Wordlists by their - * [ISO 639-1 Language Code](link-wiki-iso639). - * - * (**i.e.** [cz](LangCz), [en](LangEn), [es](LangEs), [fr](LangFr), - * [ja](LangJa), [ko](LangKo), [it](LangIt), [pt](LangPt), - * [zh_cn](LangZh), [zh_tw](LangZh)) - * - * The dist files (in the ``/dist`` folder) have had all languages - * except English stripped out, which reduces the library size by - * about 80kb. If required, they are available by importing the - * included ``wordlists-extra.min.js`` file. - */ -export declare const wordlists: Record; -//# sourceMappingURL=wordlists.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists.d.ts.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists.d.ts.map deleted file mode 100644 index 6e459b7c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlists.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlists.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAW9C,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists.js b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists.js deleted file mode 100644 index 45fd2d71..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists.js +++ /dev/null @@ -1,35 +0,0 @@ -import { LangCz } from "./lang-cz.js"; -import { LangEn } from "./lang-en.js"; -import { LangEs } from "./lang-es.js"; -import { LangFr } from "./lang-fr.js"; -import { LangJa } from "./lang-ja.js"; -import { LangKo } from "./lang-ko.js"; -import { LangIt } from "./lang-it.js"; -import { LangPt } from "./lang-pt.js"; -import { LangZh } from "./lang-zh.js"; -/** - * The available Wordlists by their - * [ISO 639-1 Language Code](link-wiki-iso639). - * - * (**i.e.** [cz](LangCz), [en](LangEn), [es](LangEs), [fr](LangFr), - * [ja](LangJa), [ko](LangKo), [it](LangIt), [pt](LangPt), - * [zh_cn](LangZh), [zh_tw](LangZh)) - * - * The dist files (in the ``/dist`` folder) have had all languages - * except English stripped out, which reduces the library size by - * about 80kb. If required, they are available by importing the - * included ``wordlists-extra.min.js`` file. - */ -export const wordlists = { - cz: LangCz.wordlist(), - en: LangEn.wordlist(), - es: LangEs.wordlist(), - fr: LangFr.wordlist(), - it: LangIt.wordlist(), - pt: LangPt.wordlist(), - ja: LangJa.wordlist(), - ko: LangKo.wordlist(), - zh_cn: LangZh.wordlist("cn"), - zh_tw: LangZh.wordlist("tw"), -}; -//# sourceMappingURL=wordlists.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists.js.map b/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists.js.map deleted file mode 100644 index bc54711c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/lib.esm/wordlists/wordlists.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlists.js","sourceRoot":"","sources":["../../src.ts/wordlists/wordlists.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAItC;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,SAAS,GAA6B;IACjD,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE;IACrB,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE;IACrB,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE;IACrB,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE;IACrB,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE;IACrB,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE;IACrB,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE;IACrB,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE;IACrB,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;CAC7B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/LICENSE b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/LICENSE deleted file mode 100644 index 9297a046..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2022 Paul Miller (https://paulmillr.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the “Software”), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/README.md b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/README.md deleted file mode 100644 index dfeaf769..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/README.md +++ /dev/null @@ -1,1074 +0,0 @@ -# noble-curves - -Audited & minimal JS implementation of elliptic curve cryptography. - -- 🔒 [**Audited**](#security) by an independent security firm -- 🔻 Tree-shaking-friendly: use only what's necessary, other code won't be included -- 🏎 Ultra-fast, hand-optimized for caveats of JS engines -- 🔍 Unique tests ensure correctness: property-based, cross-library and Wycheproof vectors, fuzzing -- ➰ Short Weierstrass, Edwards, Montgomery curves -- ✍️ ECDSA, EdDSA, Schnorr, BLS signature schemes, ECDH key agreement -- 🔖 SUF-CMA and SBS (non-repudiation) for ed25519, ed448 and others -- #️⃣ hash-to-curve for encoding or hashing an arbitrary string to an elliptic curve point -- 🧜‍♂️ Poseidon ZK-friendly hash - -### This library belongs to _noble_ crypto - -> **noble-crypto** — high-security, easily auditable set of contained cryptographic libraries and tools. - -- No dependencies, protection against supply chain attacks -- Auditable TypeScript / JS code -- Supported on all major platforms -- Releases are signed with PGP keys and built transparently with NPM provenance -- Check out [homepage](https://paulmillr.com/noble/) & all libraries: - [ciphers](https://github.com/paulmillr/noble-ciphers), - [curves](https://github.com/paulmillr/noble-curves), - [hashes](https://github.com/paulmillr/noble-hashes), - 4kb [secp256k1](https://github.com/paulmillr/noble-secp256k1) / - [ed25519](https://github.com/paulmillr/noble-ed25519) - -## Usage - -> npm install @noble/curves - -We support all major platforms and runtimes. -For [Deno](https://deno.land), ensure to use [npm specifier](https://deno.land/manual@v1.28.0/node/npm_specifiers). -For React Native, you may need a [polyfill for crypto.getRandomValues](https://github.com/LinusU/react-native-get-random-values). -If you don't like NPM, a standalone [noble-curves.js](https://github.com/paulmillr/noble-curves/releases) is also available. - -- [Implementations](#implementations) - - [ECDSA signature scheme](#ecdsa-signature-scheme) - - [ECDSA public key recovery & extra entropy](#ecdsa-public-key-recovery--extra-entropy) - - [ECDH (Elliptic Curve Diffie-Hellman)](#ecdh-elliptic-curve-diffie-hellman) - - [Schnorr signatures over secp256k1, BIP340](#schnorr-signatures-over-secp256k1-bip340) - - [ed25519, X25519, ristretto255](#ed25519-x25519-ristretto255) - - [ed448, X448, decaf448](#ed448-x448-decaf448) - - [bls12-381](#bls12-381) - - [All available imports](#all-available-imports) - - [Accessing a curve's variables](#accessing-a-curves-variables) -- [Abstract API](#abstract-api) - - [abstract/weierstrass: Short Weierstrass curve](#abstractweierstrass-short-weierstrass-curve) - - [abstract/edwards: Twisted Edwards curve](#abstractedwards-twisted-edwards-curve) - - [abstract/montgomery: Montgomery curve](#abstractmontgomery-montgomery-curve) - - [abstract/bls: Barreto-Lynn-Scott curves](#abstractbls-barreto-lynn-scott-curves) - - [abstract/hash-to-curve: Hashing strings to curve points](#abstracthash-to-curve-hashing-strings-to-curve-points) - - [abstract/poseidon: Poseidon hash](#abstractposeidon-poseidon-hash) - - [abstract/modular: Modular arithmetics utilities](#abstractmodular-modular-arithmetics-utilities) - - [Creating private keys from hashes](#creating-private-keys-from-hashes) - - [abstract/utils: Useful utilities](#abstractutils-useful-utilities) -- [Security](#security) -- [Speed](#speed) -- [Contributing & testing](#contributing--testing) -- [Upgrading](#upgrading) -- [Resources](#resources) - - [Demos](#demos) - - [Projects using curves](#projects-using-curves) -- [License](#license) - -### Implementations - -Implementations are utilizing [noble-hashes](https://github.com/paulmillr/noble-hashes). -[Abstract API](#abstract-api) doesn't depend on them: you can use a different hashing library. - -#### ECDSA signature scheme - -Generic example that works for all curves, shown for secp256k1: - -```ts -// import * from '@noble/curves'; // Error: use sub-imports, to ensure small app size -import { secp256k1 } from '@noble/curves/secp256k1'; // ESM and Common.js -// import { secp256k1 } from 'npm:@noble/curves@1.2.0/secp256k1'; // Deno -const priv = secp256k1.utils.randomPrivateKey(); -const pub = secp256k1.getPublicKey(priv); -const msg = new Uint8Array(32).fill(1); // message hash (not message) in ecdsa -const sig = secp256k1.sign(msg, priv); // `{prehash: true}` option is available -const isValid = secp256k1.verify(sig, msg, pub) === true; - -// hex strings are also supported besides Uint8Arrays: -const privHex = '46c930bc7bb4db7f55da20798697421b98c4175a52c630294d75a84b9c126236'; -const pub2 = secp256k1.getPublicKey(privHex); -``` - -#### ECDSA public key recovery & extra entropy - -```ts -sig.recoverPublicKey(msg).toRawBytes(); // === pub; // public key recovery - -// extraEntropy https://moderncrypto.org/mail-archive/curves/2017/000925.html -const sigImprovedSecurity = secp256k1.sign(msg, priv, { extraEntropy: true }); -``` - -#### ECDH (Elliptic Curve Diffie-Hellman) - -```ts -// 1. The output includes parity byte. Strip it using shared.slice(1) -// 2. The output is not hashed. More secure way is sha256(shared) or hkdf(shared) -const someonesPub = secp256k1.getPublicKey(secp256k1.utils.randomPrivateKey()); -const shared = secp256k1.getSharedSecret(priv, someonesPub); -``` - -#### Schnorr signatures over secp256k1 (BIP340) - -```ts -import { schnorr } from '@noble/curves/secp256k1'; -const priv = schnorr.utils.randomPrivateKey(); -const pub = schnorr.getPublicKey(priv); -const msg = new TextEncoder().encode('hello'); -const sig = schnorr.sign(msg, priv); -const isValid = schnorr.verify(sig, msg, pub); -``` - -#### ed25519, X25519, ristretto255 - -```ts -import { ed25519 } from '@noble/curves/ed25519'; -const priv = ed25519.utils.randomPrivateKey(); -const pub = ed25519.getPublicKey(priv); -const msg = new TextEncoder().encode('hello'); -const sig = ed25519.sign(msg, priv); -ed25519.verify(sig, msg, pub); // Default mode: follows ZIP215 -ed25519.verify(sig, msg, pub, { zip215: false }); // RFC8032 / FIPS 186-5 -``` - -Default `verify` behavior follows [ZIP215](https://zips.z.cash/zip-0215) and -[can be used in consensus-critical applications](https://hdevalence.ca/blog/2020-10-04-its-25519am). -It has SUF-CMA (strong unforgeability under chosen message attacks). -`zip215: false` option switches verification criteria to strict -[RFC8032](https://www.rfc-editor.org/rfc/rfc8032) / [FIPS 186-5](https://csrc.nist.gov/publications/detail/fips/186/5/final) -and additionally provides non-repudiation with SBS [(Strongly Binding Signatures)](https://eprint.iacr.org/2020/1244). - -X25519 follows [RFC7748](https://www.rfc-editor.org/rfc/rfc7748). - -```ts -// Variants from RFC8032: with context, prehashed -import { ed25519ctx, ed25519ph } from '@noble/curves/ed25519'; - -// ECDH using curve25519 aka x25519 -import { x25519 } from '@noble/curves/ed25519'; -const priv = 'a546e36bf0527c9d3b16154b82465edd62144c0ac1fc5a18506a2244ba449ac4'; -const pub = 'e6db6867583030db3594c1a424b15f7c726624ec26b3353b10a903a6d0ab1c4c'; -x25519.getSharedSecret(priv, pub) === x25519.scalarMult(priv, pub); // aliases -x25519.getPublicKey(priv) === x25519.scalarMultBase(priv); -x25519.getPublicKey(x25519.utils.randomPrivateKey()); - -// ed25519 => x25519 conversion -import { edwardsToMontgomeryPub, edwardsToMontgomeryPriv } from '@noble/curves/ed25519'; -edwardsToMontgomeryPub(ed25519.getPublicKey(ed25519.utils.randomPrivateKey())); -edwardsToMontgomeryPriv(ed25519.utils.randomPrivateKey()); -``` - -ristretto255 follows [irtf draft](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-ristretto255-decaf448). - -```ts -// hash-to-curve, ristretto255 -import { utf8ToBytes } from '@noble/hashes/utils'; -import { sha512 } from '@noble/hashes/sha512'; -import { - hashToCurve, - encodeToCurve, - RistrettoPoint, - hashToRistretto255, -} from '@noble/curves/ed25519'; - -const msg = utf8ToBytes('Ristretto is traditionally a short shot of espresso coffee'); -hashToCurve(msg); - -const rp = RistrettoPoint.fromHex( - '6a493210f7499cd17fecb510ae0cea23a110e8d5b901f8acadd3095c73a3b919' -); -RistrettoPoint.BASE.multiply(2n).add(rp).subtract(RistrettoPoint.BASE).toRawBytes(); -RistrettoPoint.ZERO.equals(dp) === false; -// pre-hashed hash-to-curve -RistrettoPoint.hashToCurve(sha512(msg)); -// full hash-to-curve including domain separation tag -hashToRistretto255(msg, { DST: 'ristretto255_XMD:SHA-512_R255MAP_RO_' }); -``` - -#### ed448, X448, decaf448 - -```ts -import { ed448 } from '@noble/curves/ed448'; -const priv = ed448.utils.randomPrivateKey(); -const pub = ed448.getPublicKey(priv); -const msg = new TextEncoder().encode('whatsup'); -const sig = ed448.sign(msg, priv); -ed448.verify(sig, msg, pub); - -// Variants from RFC8032: prehashed -import { ed448ph } from '@noble/curves/ed448'; -``` - -ECDH using Curve448 aka X448, follows [RFC7748](https://www.rfc-editor.org/rfc/rfc7748). - -```ts -import { x448 } from '@noble/curves/ed448'; -x448.getSharedSecret(priv, pub) === x448.scalarMult(priv, pub); // aliases -x448.getPublicKey(priv) === x448.scalarMultBase(priv); - -// ed448 => x448 conversion -import { edwardsToMontgomeryPub } from '@noble/curves/ed448'; -edwardsToMontgomeryPub(ed448.getPublicKey(ed448.utils.randomPrivateKey())); -``` - -decaf448 follows [irtf draft](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-ristretto255-decaf448). - -```ts -import { utf8ToBytes } from '@noble/hashes/utils'; -import { shake256 } from '@noble/hashes/sha3'; -import { hashToCurve, encodeToCurve, DecafPoint, hashToDecaf448 } from '@noble/curves/ed448'; - -const msg = utf8ToBytes('Ristretto is traditionally a short shot of espresso coffee'); -hashToCurve(msg); - -const dp = DecafPoint.fromHex( - 'c898eb4f87f97c564c6fd61fc7e49689314a1f818ec85eeb3bd5514ac816d38778f69ef347a89fca817e66defdedce178c7cc709b2116e75' -); -DecafPoint.BASE.multiply(2n).add(dp).subtract(DecafPoint.BASE).toRawBytes(); -DecafPoint.ZERO.equals(dp) === false; -// pre-hashed hash-to-curve -DecafPoint.hashToCurve(shake256(msg, { dkLen: 112 })); -// full hash-to-curve including domain separation tag -hashToDecaf448(msg, { DST: 'decaf448_XOF:SHAKE256_D448MAP_RO_' }); -``` - -Same RFC7748 / RFC8032 / IRTF draft are followed. - -#### bls12-381 - -See [abstract/bls](#abstractbls-barreto-lynn-scott-curves). - -#### All available imports - -```typescript -import { secp256k1, schnorr } from '@noble/curves/secp256k1'; -import { ed25519, ed25519ph, ed25519ctx, x25519, RistrettoPoint } from '@noble/curves/ed25519'; -import { ed448, ed448ph, ed448ctx, x448 } from '@noble/curves/ed448'; -import { p256 } from '@noble/curves/p256'; -import { p384 } from '@noble/curves/p384'; -import { p521 } from '@noble/curves/p521'; -import { pallas, vesta } from '@noble/curves/pasta'; -import { bls12_381 } from '@noble/curves/bls12-381'; -import { bn254 } from '@noble/curves/bn254'; // also known as alt_bn128 -import { jubjub } from '@noble/curves/jubjub'; -import { bytesToHex, hexToBytes, concatBytes, utf8ToBytes } from '@noble/curves/abstract/utils'; -``` - -#### Accessing a curve's variables - -```ts -import { secp256k1 } from '@noble/curves/secp256k1'; -// Every curve has `CURVE` object that contains its parameters, field, and others -console.log(secp256k1.CURVE.p); // field modulus -console.log(secp256k1.CURVE.n); // curve order -console.log(secp256k1.CURVE.a, secp256k1.CURVE.b); // equation params -console.log(secp256k1.CURVE.Gx, secp256k1.CURVE.Gy); // base point coordinates -``` - -## Abstract API - -Abstract API allows to define custom curves. All arithmetics is done with JS -bigints over finite fields, which is defined from `modular` sub-module. For -scalar multiplication, we use -[precomputed tables with w-ary non-adjacent form (wNAF)](https://paulmillr.com/posts/noble-secp256k1-fast-ecc/). -Precomputes are enabled for weierstrass and edwards BASE points of a curve. You -could precompute any other point (e.g. for ECDH) using `utils.precompute()` -method: check out examples. - -### abstract/weierstrass: Short Weierstrass curve - -```ts -import { weierstrass } from '@noble/curves/abstract/weierstrass'; -import { Field } from '@noble/curves/abstract/modular'; // finite field for mod arithmetics -import { sha256 } from '@noble/hashes/sha256'; // 3rd-party sha256() of type utils.CHash -import { hmac } from '@noble/hashes/hmac'; // 3rd-party hmac() that will accept sha256() -import { concatBytes, randomBytes } from '@noble/hashes/utils'; // 3rd-party utilities -const secq256k1 = weierstrass({ - // secq256k1: cycle of secp256k1 with Fp/N flipped. - // https://personaelabs.org/posts/spartan-ecdsa - // https://zcash.github.io/halo2/background/curves.html#cycles-of-curves - a: 0n, - b: 7n, - Fp: Field(2n ** 256n - 432420386565659656852420866394968145599n), - n: 2n ** 256n - 2n ** 32n - 2n ** 9n - 2n ** 8n - 2n ** 7n - 2n ** 6n - 2n ** 4n - 1n, - Gx: 55066263022277343669578718895168534326250603453777594175500187360389116729240n, - Gy: 32670510020758816978083085130507043184471273380659243275938904335757337482424n, - hash: sha256, - hmac: (key: Uint8Array, ...msgs: Uint8Array[]) => hmac(sha256, key, concatBytes(...msgs)), - randomBytes, -}); - -// Replace weierstrass() with weierstrassPoints() if you don't need ECDSA, hash, hmac, randomBytes -``` - -Short Weierstrass curve's formula is `y² = x³ + ax + b`. `weierstrass` -expects arguments `a`, `b`, field `Fp`, curve order `n`, cofactor `h` -and coordinates `Gx`, `Gy` of generator point. - -**`k` generation** is done deterministically, following -[RFC6979](https://www.rfc-editor.org/rfc/rfc6979). For this you will need -`hmac` & `hash`, which in our implementations is provided by noble-hashes. If -you're using different hashing library, make sure to wrap it in the following interface: - -```ts -type CHash = { - (message: Uint8Array): Uint8Array; - blockLen: number; - outputLen: number; - create(): any; -}; -``` - -**Message hash** is expected instead of message itself: - -- `sign(msgHash, privKey)` is default behavior, assuming you pre-hash msg with sha2, or other hash -- `sign(msg, privKey, {prehash: true})` option can be used if you want to pass the message itself - -**Weierstrass points:** - -1. Exported as `ProjectivePoint` -2. Represented in projective (homogeneous) coordinates: (x, y, z) ∋ (x=x/z, y=y/z) -3. Use complete exception-free formulas for addition and doubling -4. Can be decoded/encoded from/to Uint8Array / hex strings using - `ProjectivePoint.fromHex` and `ProjectivePoint#toRawBytes()` -5. Have `assertValidity()` which checks for being on-curve -6. Have `toAffine()` and `x` / `y` getters which convert to 2d xy affine coordinates - -```ts -// `weierstrassPoints()` returns `CURVE` and `ProjectivePoint` -// `weierstrass()` returns `CurveFn` -type SignOpts = { lowS?: boolean; prehash?: boolean; extraEntropy: boolean | Uint8Array }; -type CurveFn = { - CURVE: ReturnType; - getPublicKey: (privateKey: PrivKey, isCompressed?: boolean) => Uint8Array; - getSharedSecret: (privateA: PrivKey, publicB: Hex, isCompressed?: boolean) => Uint8Array; - sign: (msgHash: Hex, privKey: PrivKey, opts?: SignOpts) => SignatureType; - verify: ( - signature: Hex | SignatureType, - msgHash: Hex, - publicKey: Hex, - opts?: { lowS?: boolean; prehash?: boolean } - ) => boolean; - ProjectivePoint: ProjectivePointConstructor; - Signature: SignatureConstructor; - utils: { - normPrivateKeyToScalar: (key: PrivKey) => bigint; - isValidPrivateKey(key: PrivKey): boolean; - randomPrivateKey: () => Uint8Array; - precompute: (windowSize?: number, point?: ProjPointType) => ProjPointType; - }; -}; - -// T is usually bigint, but can be something else like complex numbers in BLS curves -interface ProjPointType extends Group> { - readonly px: T; - readonly py: T; - readonly pz: T; - get x(): bigint; - get y(): bigint; - multiply(scalar: bigint): ProjPointType; - multiplyUnsafe(scalar: bigint): ProjPointType; - multiplyAndAddUnsafe(Q: ProjPointType, a: bigint, b: bigint): ProjPointType | undefined; - toAffine(iz?: T): AffinePoint; - isTorsionFree(): boolean; - clearCofactor(): ProjPointType; - assertValidity(): void; - hasEvenY(): boolean; - toRawBytes(isCompressed?: boolean): Uint8Array; - toHex(isCompressed?: boolean): string; -} -// Static methods for 3d XYZ points -interface ProjConstructor extends GroupConstructor> { - new (x: T, y: T, z: T): ProjPointType; - fromAffine(p: AffinePoint): ProjPointType; - fromHex(hex: Hex): ProjPointType; - fromPrivateKey(privateKey: PrivKey): ProjPointType; -} -``` - -**ECDSA signatures** are represented by `Signature` instances and can be -described by the interface: - -```ts -interface SignatureType { - readonly r: bigint; - readonly s: bigint; - readonly recovery?: number; - assertValidity(): void; - addRecoveryBit(recovery: number): SignatureType; - hasHighS(): boolean; - normalizeS(): SignatureType; - recoverPublicKey(msgHash: Hex): ProjPointType; - toCompactRawBytes(): Uint8Array; - toCompactHex(): string; - // DER-encoded - toDERRawBytes(): Uint8Array; - toDERHex(): string; -} -type SignatureConstructor = { - new (r: bigint, s: bigint): SignatureType; - fromCompact(hex: Hex): SignatureType; - fromDER(hex: Hex): SignatureType; -}; -``` - -More examples: - -```typescript -// All curves expose same generic interface. -const priv = secq256k1.utils.randomPrivateKey(); -secq256k1.getPublicKey(priv); // Convert private key to public. -const sig = secq256k1.sign(msg, priv); // Sign msg with private key. -const sig2 = secq256k1.sign(msg, priv, { prehash: true }); // hash(msg) -secq256k1.verify(sig, msg, priv); // Verify if sig is correct. - -const Point = secq256k1.ProjectivePoint; -const point = Point.BASE; // Elliptic curve Point class and BASE point static var. -point.add(point).equals(point.double()); // add(), equals(), double() methods -point.subtract(point).equals(Point.ZERO); // subtract() method, ZERO static var -point.negate(); // Flips point over x/y coordinate. -point.multiply(31415n); // Multiplication of Point by scalar. - -point.assertValidity(); // Checks for being on-curve -point.toAffine(); // Converts to 2d affine xy coordinates - -secq256k1.CURVE.n; -secq256k1.CURVE.p; -secq256k1.CURVE.Fp.mod(); -secq256k1.CURVE.hash(); - -// precomputes -const fast = secq256k1.utils.precompute(8, Point.fromHex(someonesPubKey)); -fast.multiply(privKey); // much faster ECDH now -``` - -### abstract/edwards: Twisted Edwards curve - -```ts -import { twistedEdwards } from '@noble/curves/abstract/edwards'; -import { Field } from '@noble/curves/abstract/modular'; -import { sha512 } from '@noble/hashes/sha512'; -import { randomBytes } from '@noble/hashes/utils'; - -const Fp = Field(2n ** 255n - 19n); -const ed25519 = twistedEdwards({ - a: Fp.create(-1n), - d: Fp.div(-121665n, 121666n), // -121665n/121666n mod p - Fp: Fp, - n: 2n ** 252n + 27742317777372353535851937790883648493n, - h: 8n, - Gx: 15112221349535400772501151409588531511454012693041857206046113283949847762202n, - Gy: 46316835694926478169428394003475163141307993866256225615783033603165251855960n, - hash: sha512, - randomBytes, - adjustScalarBytes(bytes) { - // optional; but mandatory in ed25519 - bytes[0] &= 248; - bytes[31] &= 127; - bytes[31] |= 64; - return bytes; - }, -} as const); -``` - -Twisted Edwards curve's formula is `ax² + y² = 1 + dx²y²`. You must specify `a`, `d`, field `Fp`, order `n`, cofactor `h` -and coordinates `Gx`, `Gy` of generator point. - -For EdDSA signatures, `hash` param required. `adjustScalarBytes` which instructs how to change private scalars could be specified. - -**Edwards points:** - -1. Exported as `ExtendedPoint` -2. Represented in extended coordinates: (x, y, z, t) ∋ (x=x/z, y=y/z) -3. Use complete exception-free formulas for addition and doubling -4. Can be decoded/encoded from/to Uint8Array / hex strings using `ExtendedPoint.fromHex` and `ExtendedPoint#toRawBytes()` -5. Have `assertValidity()` which checks for being on-curve -6. Have `toAffine()` and `x` / `y` getters which convert to 2d xy affine coordinates -7. Have `isTorsionFree()`, `clearCofactor()` and `isSmallOrder()` utilities to handle torsions - -```ts -// `twistedEdwards()` returns `CurveFn` of following type: -type CurveFn = { - CURVE: ReturnType; - getPublicKey: (privateKey: Hex) => Uint8Array; - sign: (message: Hex, privateKey: Hex, context?: Hex) => Uint8Array; - verify: (sig: SigType, message: Hex, publicKey: Hex, context?: Hex) => boolean; - ExtendedPoint: ExtPointConstructor; - utils: { - randomPrivateKey: () => Uint8Array; - getExtendedPublicKey: (key: PrivKey) => { - head: Uint8Array; - prefix: Uint8Array; - scalar: bigint; - point: PointType; - pointBytes: Uint8Array; - }; - }; -}; - -interface ExtPointType extends Group { - readonly ex: bigint; - readonly ey: bigint; - readonly ez: bigint; - readonly et: bigint; - get x(): bigint; - get y(): bigint; - assertValidity(): void; - multiply(scalar: bigint): ExtPointType; - multiplyUnsafe(scalar: bigint): ExtPointType; - isSmallOrder(): boolean; - isTorsionFree(): boolean; - clearCofactor(): ExtPointType; - toAffine(iz?: bigint): AffinePoint; - toRawBytes(isCompressed?: boolean): Uint8Array; - toHex(isCompressed?: boolean): string; -} -// Static methods of Extended Point with coordinates in X, Y, Z, T -interface ExtPointConstructor extends GroupConstructor { - new (x: bigint, y: bigint, z: bigint, t: bigint): ExtPointType; - fromAffine(p: AffinePoint): ExtPointType; - fromHex(hex: Hex): ExtPointType; - fromPrivateKey(privateKey: Hex): ExtPointType; -} -``` - -### abstract/montgomery: Montgomery curve - -```typescript -import { montgomery } from '@noble/curves/abstract/montgomery'; -import { Field } from '@noble/curves/abstract/modular'; - -const x25519 = montgomery({ - a: 486662n, - Gu: 9n, - Fp: Field(2n ** 255n - 19n), - montgomeryBits: 255, - nByteLength: 32, - // Optional param - adjustScalarBytes(bytes) { - bytes[0] &= 248; - bytes[31] &= 127; - bytes[31] |= 64; - return bytes; - }, -}); -``` - -The module contains methods for x-only ECDH on Curve25519 / Curve448 from RFC7748. -Proper Elliptic Curve Points are not implemented yet. - -You must specify curve params `Fp`, `a`, `Gu` coordinate of u, `montgomeryBits` and `nByteLength`. - -### abstract/bls: Barreto-Lynn-Scott curves - -The module abstracts BLS (Barreto-Lynn-Scott) pairing-friendly elliptic curve construction. -They allow to construct [zk-SNARKs](https://z.cash/technology/zksnarks/) and -use aggregated, batch-verifiable -[threshold signatures](https://medium.com/snigirev.stepan/bls-signatures-better-than-schnorr-5a7fe30ea716), -using Boneh-Lynn-Shacham signature scheme. - -The module doesn't expose `CURVE` property: use `G1.CURVE`, `G2.CURVE` instead. - -Main methods and properties are: - -- `getPublicKey(privateKey)` -- `sign(message, privateKey)` -- `verify(signature, message, publicKey)` -- `aggregatePublicKeys(publicKeys)` -- `aggregateSignatures(signatures)` -- `G1` and `G2` curves containing `CURVE` and `ProjectivePoint` -- `Signature` property with `fromHex`, `toHex` methods -- `fields` containing `Fp`, `Fp2`, `Fp6`, `Fp12`, `Fr` - -Right now we only implement BLS12-381 (compatible with ETH and others), -but in theory defining BLS12-377, BLS24 should be straightforward. An example: - -```ts -import { bls12_381 as bls } from '@noble/curves/bls12-381'; -const privateKey = '67d53f170b908cabb9eb326c3c337762d59289a8fec79f7bc9254b584b73265c'; -const message = '64726e3da8'; -const publicKey = bls.getPublicKey(privateKey); -const signature = bls.sign(message, privateKey); -const isValid = bls.verify(signature, message, publicKey); -console.log({ publicKey, signature, isValid }); - -// Sign 1 msg with 3 keys -const privateKeys = [ - '18f020b98eb798752a50ed0563b079c125b0db5dd0b1060d1c1b47d4a193e1e4', - 'ed69a8c50cf8c9836be3b67c7eeff416612d45ba39a5c099d48fa668bf558c9c', - '16ae669f3be7a2121e17d0c68c05a8f3d6bef21ec0f2315f1d7aec12484e4cf5', -]; -const messages = ['d2', '0d98', '05caf3']; -const publicKeys = privateKeys.map(bls.getPublicKey); -const signatures2 = privateKeys.map((p) => bls.sign(message, p)); -const aggPubKey2 = bls.aggregatePublicKeys(publicKeys); -const aggSignature2 = bls.aggregateSignatures(signatures2); -const isValid2 = bls.verify(aggSignature2, message, aggPubKey2); -console.log({ signatures2, aggSignature2, isValid2 }); - -// Sign 3 msgs with 3 keys -const signatures3 = privateKeys.map((p, i) => bls.sign(messages[i], p)); -const aggSignature3 = bls.aggregateSignatures(signatures3); -const isValid3 = bls.verifyBatch(aggSignature3, messages, publicKeys); -console.log({ publicKeys, signatures3, aggSignature3, isValid3 }); - -// Pairings, with and without final exponentiation -// bls.pairing(PointG1, PointG2); -// bls.pairing(PointG1, PointG2, false); -// bls.fields.Fp12.finalExponentiate(bls.fields.Fp12.mul(eGS, ePHm)); - -// Others -// bls.G1.ProjectivePoint.BASE, bls.G2.ProjectivePoint.BASE -// bls.fields.Fp, bls.fields.Fp2, bls.fields.Fp12, bls.fields.Fr - -// hash-to-curve examples can be seen below -``` - -Full types: - -```ts -getPublicKey: (privateKey: PrivKey) => Uint8Array; -sign: { - (message: Hex, privateKey: PrivKey): Uint8Array; - (message: ProjPointType, privateKey: PrivKey): ProjPointType; -}; -verify: ( - signature: Hex | ProjPointType, - message: Hex | ProjPointType, - publicKey: Hex | ProjPointType -) => boolean; -verifyBatch: ( - signature: Hex | ProjPointType, - messages: (Hex | ProjPointType)[], - publicKeys: (Hex | ProjPointType)[] -) => boolean; -aggregatePublicKeys: { - (publicKeys: Hex[]): Uint8Array; - (publicKeys: ProjPointType[]): ProjPointType; -}; -aggregateSignatures: { - (signatures: Hex[]): Uint8Array; - (signatures: ProjPointType[]): ProjPointType; -}; -millerLoop: (ell: [Fp2, Fp2, Fp2][], g1: [Fp, Fp]) => Fp12; -pairing: (P: ProjPointType, Q: ProjPointType, withFinalExponent?: boolean) => Fp12; -G1: CurvePointsRes & ReturnType>; -G2: CurvePointsRes & ReturnType>; -Signature: SignatureCoder; -params: { - x: bigint; - r: bigint; - G1b: bigint; - G2b: Fp2; -}; -fields: { - Fp: IField; - Fp2: IField; - Fp6: IField; - Fp12: IField; - Fr: IField; -}; -utils: { - randomPrivateKey: () => Uint8Array; - calcPairingPrecomputes: (p: AffinePoint) => [Fp2, Fp2, Fp2][]; -}; -``` - -### abstract/hash-to-curve: Hashing strings to curve points - -The module allows to hash arbitrary strings to elliptic curve points. Implements [RFC 9380](https://www.rfc-editor.org/rfc/rfc9380). - -Every curve has exported `hashToCurve` and `encodeToCurve` methods. You should always prefer `hashToCurve` for security: - -```ts -import { hashToCurve, encodeToCurve } from '@noble/curves/secp256k1'; -import { randomBytes } from '@noble/hashes/utils'; -hashToCurve('0102abcd'); -console.log(hashToCurve(randomBytes())); -console.log(encodeToCurve(randomBytes())); - -import { bls12_381 } from '@noble/curves/bls12-381'; -bls12_381.G1.hashToCurve(randomBytes(), { DST: 'another' }); -bls12_381.G2.hashToCurve(randomBytes(), { DST: 'custom' }); -``` - -Low-level methods from the spec: - -```ts -// produces a uniformly random byte string using a cryptographic hash function H that outputs b bits. -function expand_message_xmd( - msg: Uint8Array, - DST: Uint8Array, - lenInBytes: number, - H: CHash // For CHash see abstract/weierstrass docs section -): Uint8Array; -// produces a uniformly random byte string using an extendable-output function (XOF) H. -function expand_message_xof( - msg: Uint8Array, - DST: Uint8Array, - lenInBytes: number, - k: number, - H: CHash -): Uint8Array; -// Hashes arbitrary-length byte strings to a list of one or more elements of a finite field F -function hash_to_field(msg: Uint8Array, count: number, options: Opts): bigint[][]; - -/** - * * `DST` is a domain separation tag, defined in section 2.2.5 - * * `p` characteristic of F, where F is a finite field of characteristic p and order q = p^m - * * `m` is extension degree (1 for prime fields) - * * `k` is the target security target in bits (e.g. 128), from section 5.1 - * * `expand` is `xmd` (SHA2, SHA3, BLAKE) or `xof` (SHAKE, BLAKE-XOF) - * * `hash` conforming to `utils.CHash` interface, with `outputLen` / `blockLen` props - */ -type UnicodeOrBytes = string | Uint8Array; -type Opts = { - DST: UnicodeOrBytes; - p: bigint; - m: number; - k: number; - expand?: 'xmd' | 'xof'; - hash: CHash; -}; -``` - -### abstract/poseidon: Poseidon hash - -Implements [Poseidon](https://www.poseidon-hash.info) ZK-friendly hash. - -There are many poseidon variants with different constants. -We don't provide them: you should construct them manually. -Check out [micro-starknet](https://github.com/paulmillr/micro-starknet) package for a proper example. - -```ts -import { poseidon } from '@noble/curves/abstract/poseidon'; - -type PoseidonOpts = { - Fp: Field; - t: number; - roundsFull: number; - roundsPartial: number; - sboxPower?: number; - reversePartialPowIdx?: boolean; - mds: bigint[][]; - roundConstants: bigint[][]; -}; -const instance = poseidon(opts: PoseidonOpts); -``` - -### abstract/modular: Modular arithmetics utilities - -```ts -import * as mod from '@noble/curves/abstract/modular'; -const fp = mod.Field(2n ** 255n - 19n); // Finite field over 2^255-19 -fp.mul(591n, 932n); // multiplication -fp.pow(481n, 11024858120n); // exponentiation -fp.div(5n, 17n); // division: 5/17 mod 2^255-19 == 5 * invert(17) -fp.sqrt(21n); // square root - -// Generic non-FP utils are also available -mod.mod(21n, 10n); // 21 mod 10 == 1n; fixed version of 21 % 10 -mod.invert(17n, 10n); // invert(17) mod 10; modular multiplicative inverse -mod.invertBatch([1n, 2n, 4n], 21n); // => [1n, 11n, 16n] in one inversion -``` - -Field operations are not constant-time: they are using JS bigints, see [security](#security). -The fact is mostly irrelevant, but the important method to keep in mind is `pow`, -which may leak exponent bits, when used naïvely. - -`mod.Field` is always **field over prime**. Non-prime fields aren't supported for now. -We don't test for prime-ness for speed and because algorithms are probabilistic anyway. -Initializing a non-prime field could make your app suspectible to -DoS (infilite loop) on Tonelli-Shanks square root calculation. - -Unlike `mod.invert`, `mod.invertBatch` won't throw on `0`: make sure to throw an error yourself. - -#### Creating private keys from hashes - -You can't simply make a 32-byte private key from a 32-byte hash. -Doing so will make the key [biased](https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/). - -To make the bias negligible, we follow [FIPS 186-5 A.2](https://csrc.nist.gov/publications/detail/fips/186/5/final) -and [RFC 9380](https://www.rfc-editor.org/rfc/rfc9380#section-5.2). -This means, for 32-byte key, we would need 48-byte hash to get 2^-128 bias, which matches curve security level. - -`hashToPrivateScalar()` that hashes to **private key** was created for this purpose. -Use [abstract/hash-to-curve](#abstracthash-to-curve-hashing-strings-to-curve-points) -if you need to hash to **public key**. - -```ts -import { p256 } from '@noble/curves/p256'; -import { sha256 } from '@noble/hashes/sha256'; -import { hkdf } from '@noble/hashes/hkdf'; -const someKey = new Uint8Array(32).fill(2); // Needs to actually be random, not .fill(2) -const derived = hkdf(sha256, someKey, undefined, 'application', 48); // 48 bytes for 32-byte priv -const validPrivateKey = mod.hashToPrivateScalar(derived, p256.CURVE.n); -``` - -### abstract/utils: Useful utilities - -```ts -import * as utils from '@noble/curves/abstract/utils'; - -utils.bytesToHex(Uint8Array.from([0xde, 0xad, 0xbe, 0xef])); -utils.hexToBytes('deadbeef'); -utils.numberToHexUnpadded(123n); -utils.hexToNumber(); - -utils.bytesToNumberBE(Uint8Array.from([0xde, 0xad, 0xbe, 0xef])); -utils.bytesToNumberLE(Uint8Array.from([0xde, 0xad, 0xbe, 0xef])); -utils.numberToBytesBE(123n, 32); -utils.numberToBytesLE(123n, 64); - -utils.concatBytes(Uint8Array.from([0xde, 0xad]), Uint8Array.from([0xbe, 0xef])); -utils.nLength(255n); -utils.equalBytes(Uint8Array.from([0xde]), Uint8Array.from([0xde])); -``` - -## Security - -1. The library has been independently audited: - -- in Feb 2023 by [Trail of Bits](https://www.trailofbits.com): - [PDF](https://github.com/trailofbits/publications/blob/master/reviews/2023-01-ryanshea-noblecurveslibrary-securityreview.pdf). - The audit has been funded by [Ryan Shea](https://www.shea.io). - Audit scope was abstract modules `curve`, `hash-to-curve`, `modular`, `poseidon`, `utils`, `weierstrass`, - and top-level modules `_shortw_utils` and `secp256k1`. - See [changes since v0.7.3 audit](https://github.com/paulmillr/noble-curves/compare/0.7.3..main). - -2. The library has been fuzzed by [Guido Vranken's cryptofuzz](https://github.com/guidovranken/cryptofuzz). - You can run the fuzzer by yourself to check it. -3. [Timing attack](https://en.wikipedia.org/wiki/Timing_attack) considerations: - _JIT-compiler_ and _Garbage Collector_ make "constant time" extremely hard to - achieve in a scripting language. Which means _any other JS library can't have - constant-timeness_. Even statically typed Rust, a language without GC, - [makes it harder to achieve constant-time](https://www.chosenplaintext.ca/open-source/rust-timing-shield/security) - for some cases. If your goal is absolute security, don't use any JS lib — including bindings to native ones. - Use low-level libraries & languages. Nonetheless we're targetting algorithmic constant time. - -We consider infrastructure attacks like rogue NPM modules very important; -that's why it's crucial to minimize the amount of 3rd-party dependencies & native bindings. -If your app uses 500 dependencies, any dep could get hacked and you'll be -downloading malware with every `npm install`. Our goal is to minimize this attack vector. -As for devDependencies used by the library: - -- `@scure` base, bip32, bip39 (used in tests), micro-bmark (benchmark), micro-should (testing) - are developed by us and follow the same practices such as: minimal library size, auditability, - signed releases -- prettier (linter), fast-check (property-based testing), typescript versions - are locked and rarely updated. Every update is checked with `npm-diff`. - The packages are big, which makes it hard to audit their source code thoroughly and fully. -- They are only used if you clone the git repo and want to add some feature to it. End-users won't use them. - -As for key generation, we're deferring to built-in -[crypto.getRandomValues](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues) -which is considered cryptographically secure (CSPRNG). - -## Speed - -Benchmark results on Apple M2 with node v20: - -``` -secp256k1 -init x 68 ops/sec @ 14ms/op -getPublicKey x 6,750 ops/sec @ 148μs/op -sign x 5,206 ops/sec @ 192μs/op -verify x 880 ops/sec @ 1ms/op -getSharedSecret x 536 ops/sec @ 1ms/op -recoverPublicKey x 852 ops/sec @ 1ms/op -schnorr.sign x 685 ops/sec @ 1ms/op -schnorr.verify x 908 ops/sec @ 1ms/op - -p256 -init x 38 ops/sec @ 26ms/op -getPublicKey x 6,530 ops/sec @ 153μs/op -sign x 5,074 ops/sec @ 197μs/op -verify x 626 ops/sec @ 1ms/op - -p384 -init x 17 ops/sec @ 57ms/op -getPublicKey x 2,883 ops/sec @ 346μs/op -sign x 2,358 ops/sec @ 424μs/op -verify x 245 ops/sec @ 4ms/op - -p521 -init x 9 ops/sec @ 109ms/op -getPublicKey x 1,516 ops/sec @ 659μs/op -sign x 1,271 ops/sec @ 786μs/op -verify x 123 ops/sec @ 8ms/op - -ed25519 -init x 54 ops/sec @ 18ms/op -getPublicKey x 10,269 ops/sec @ 97μs/op -sign x 5,110 ops/sec @ 195μs/op -verify x 1,049 ops/sec @ 952μs/op - -ed448 -init x 19 ops/sec @ 51ms/op -getPublicKey x 3,775 ops/sec @ 264μs/op -sign x 1,771 ops/sec @ 564μs/op -verify x 351 ops/sec @ 2ms/op - -ecdh -├─x25519 x 1,466 ops/sec @ 682μs/op -├─secp256k1 x 539 ops/sec @ 1ms/op -├─p256 x 511 ops/sec @ 1ms/op -├─p384 x 199 ops/sec @ 5ms/op -├─p521 x 103 ops/sec @ 9ms/op -└─x448 x 548 ops/sec @ 1ms/op - -bls12-381 -init x 36 ops/sec @ 27ms/op -getPublicKey 1-bit x 973 ops/sec @ 1ms/op -getPublicKey x 970 ops/sec @ 1ms/op -sign x 55 ops/sec @ 17ms/op -verify x 39 ops/sec @ 25ms/op -pairing x 106 ops/sec @ 9ms/op -aggregatePublicKeys/8 x 129 ops/sec @ 7ms/op -aggregatePublicKeys/32 x 34 ops/sec @ 28ms/op -aggregatePublicKeys/128 x 8 ops/sec @ 112ms/op -aggregatePublicKeys/512 x 2 ops/sec @ 446ms/op -aggregatePublicKeys/2048 x 0 ops/sec @ 1778ms/op -aggregateSignatures/8 x 50 ops/sec @ 19ms/op -aggregateSignatures/32 x 13 ops/sec @ 74ms/op -aggregateSignatures/128 x 3 ops/sec @ 296ms/op -aggregateSignatures/512 x 0 ops/sec @ 1180ms/op -aggregateSignatures/2048 x 0 ops/sec @ 4715ms/op - -hash-to-curve -hash_to_field x 91,600 ops/sec @ 10μs/op -secp256k1 x 2,373 ops/sec @ 421μs/op -p256 x 4,310 ops/sec @ 231μs/op -p384 x 1,664 ops/sec @ 600μs/op -p521 x 807 ops/sec @ 1ms/op -ed25519 x 3,088 ops/sec @ 323μs/op -ed448 x 1,247 ops/sec @ 801μs/op -``` - -## Contributing & testing - -1. Clone the repository -2. `npm install` to install build dependencies like TypeScript -3. `npm run build` to compile TypeScript code -4. `npm run test` will execute all main tests - -## Upgrading - -Previously, the library was split into single-feature packages -[noble-secp256k1](https://github.com/paulmillr/noble-secp256k1), -[noble-ed25519](https://github.com/paulmillr/noble-ed25519) and -[noble-bls12-381](https://github.com/paulmillr/noble-bls12-381). - -Curves continue their original work. The single-feature packages changed their -direction towards providing minimal 4kb implementations of cryptography, -which means they have less features. - -Upgrading from noble-secp256k1 2.0 or noble-ed25519 2.0: no changes, libraries are compatible. - -Upgrading from noble-secp256k1 1.7: - -- `getPublicKey` - - now produce 33-byte compressed signatures by default - - to use old behavior, which produced 65-byte uncompressed keys, set - argument `isCompressed` to `false`: `getPublicKey(priv, false)` -- `sign` - - is now sync; use `signAsync` for async version - - now returns `Signature` instance with `{ r, s, recovery }` properties - - `canonical` option was renamed to `lowS` - - `recovered` option has been removed because recovery bit is always returned now - - `der` option has been removed. There are 2 options: - 1. Use compact encoding: `fromCompact`, `toCompactRawBytes`, `toCompactHex`. - Compact encoding is simply a concatenation of 32-byte r and 32-byte s. - 2. If you must use DER encoding, switch to noble-curves (see above). -- `verify` - - `strict` option was renamed to `lowS` -- `getSharedSecret` - - now produce 33-byte compressed signatures by default - - to use old behavior, which produced 65-byte uncompressed keys, set - argument `isCompressed` to `false`: `getSharedSecret(a, b, false)` -- `recoverPublicKey(msg, sig, rec)` was changed to `sig.recoverPublicKey(msg)` -- `number` type for private keys have been removed: use `bigint` instead -- `Point` (2d xy) has been changed to `ProjectivePoint` (3d xyz) -- `utils` were split into `utils` (same api as in noble-curves) and - `etc` (`hmacSha256Sync` and others) - -Upgrading from [@noble/ed25519](https://github.com/paulmillr/noble-ed25519) 1.7: - -- Methods are now sync by default -- `bigint` is no longer allowed in `getPublicKey`, `sign`, `verify`. Reason: ed25519 is LE, can lead to bugs -- `Point` (2d xy) has been changed to `ExtendedPoint` (xyzt) -- `Signature` was removed: just use raw bytes or hex now -- `utils` were split into `utils` (same api as in noble-curves) and - `etc` (`sha512Sync` and others) -- `getSharedSecret` was moved to `x25519` module -- `toX25519` has been moved to `edwardsToMontgomeryPub` and `edwardsToMontgomeryPriv` methods - -Upgrading from [@noble/bls12-381](https://github.com/paulmillr/noble-bls12-381): - -- Methods and classes were renamed: - - PointG1 -> G1.Point, PointG2 -> G2.Point - - PointG2.fromSignature -> Signature.decode, PointG2.toSignature -> Signature.encode -- Fp2 ORDER was corrected - -## Resources - -- [Learning fast elliptic-curve cryptography](https://paulmillr.com/posts/noble-secp256k1-fast-ecc/) -- EdDSA - - [A Deep dive into Ed25519 Signatures](https://cendyne.dev/posts/2022-03-06-ed25519-signatures.html) - - [Ed25519 Deep Dive Addendum](https://cendyne.dev/posts/2022-09-11-ed25519-deep-dive-addendum.html) - - [It’s 255:19AM. Do you know what your validation criteria are?](https://hdevalence.ca/blog/2020-10-04-its-25519am) - - [Taming the many EdDSAs](https://csrc.nist.gov/csrc/media/Presentations/2023/crclub-2023-03-08/images-media/20230308-crypto-club-slides--taming-the-many-EdDSAs.pdf) - that describes concepts of Strong UnForgeability under Chosen Message Attacks and Strongly Binding Signatures - - [Cofactor Explained: Clearing Elliptic Curves’ dirty little secret](https://loup-vaillant.fr/tutorials/cofactor) - - [Surrounded by Elligators](https://loup-vaillant.fr/articles/implementing-elligator) -- Pairings and BLS - - [BLS signatures for busy people](https://gist.github.com/paulmillr/18b802ad219b1aee34d773d08ec26ca2) - - [BLS12-381 for the rest of us](https://hackmd.io/@benjaminion/bls12-381) - - [Key concepts of pairings](https://medium.com/@alonmuroch_65570/bls-signatures-part-2-key-concepts-of-pairings-27a8a9533d0c) - - Pairing over bls12-381: - [fields](https://research.nccgroup.com/2020/07/06/pairing-over-bls12-381-part-1-fields/), - [curves](https://research.nccgroup.com/2020/07/13/pairing-over-bls12-381-part-2-curves/), - [pairings](https://research.nccgroup.com/2020/08/13/pairing-over-bls12-381-part-3-pairing/) - - [Estimating the bit security of pairing-friendly curves](https://research.nccgroup.com/2022/02/03/estimating-the-bit-security-of-pairing-friendly-curves/) - -### Demos - -- [Elliptic Curve Calculator](https://paulmillr.com/noble): add / multiply points, sign messages -- [BLS threshold signatures](https://genthresh.com) - -### Projects using curves - -- HDkey libraries: [scure-bip32](https://github.com/paulmillr/scure-bip32), [bip32](https://github.com/bitcoinjs/bip32) -- Social networks: [nostr](https://github.com/nbd-wtf/nostr-tools), [bluesky](https://github.com/bluesky-social/atproto) -- Ethereum libraries: - - [ethereum-cryptography](https://github.com/ethereum/js-ethereum-cryptography) - - [micro-eth-signer](https://github.com/paulmillr/micro-eth-signer), - [ethers](https://github.com/ethers-io/ethers.js) (old noble), - [viem.sh](https://viem.sh), - [@ethereumjs](https://github.com/ethereumjs/ethereumjs-monorepo) - - [metamask's eth-sig-util](https://github.com/MetaMask/eth-sig-util) - - [gridplus lattice sdk](https://github.com/GridPlus/lattice-eth2-utils) -- Bitcoin libraries: - - [scure-btc-signer](https://github.com/paulmillr/scure-btc-signer) - - [tapscript](https://github.com/cmdruid/tapscript) -- Solana libraries: [micro-sol-signer](https://github.com/paulmillr/micro-sol-signer), [solana-web3.js](https://github.com/solana-labs/solana-web3.js) -- Other web3 stuff: - - [scure-starknet](https://github.com/paulmillr/scure-starknet) - - [aztec](https://github.com/AztecProtocol/aztec-packages) - - [polkadot.js](https://github.com/polkadot-js/common), [drand-client](https://github.com/drand/drand-client), [moneroj](https://github.com/beritani/moneroj), [tronlib](https://github.com/CoinSpace/tronlib) -- [protonmail](https://github.com/ProtonMail/WebClients) (old noble for now) -- [did-jwt](https://github.com/decentralized-identity/did-jwt), [hpke-js](https://github.com/dajiaji/hpke-js), - [js-libp2p-noise](https://github.com/ChainSafe/js-libp2p-noise) -- [ed25519-keygen](https://github.com/paulmillr/ed25519-keygen) SSH, PGP, TOR key generation -- [secp256k1 compatibility layer](https://github.com/ethereum/js-ethereum-cryptography/blob/2.0.0/src/secp256k1-compat.ts) - for users who want to switch from secp256k1-node or tiny-secp256k1. Allows to see which methods map to corresponding noble code. -- [BLS BBS signatures](https://github.com/Wind4Greg/BBS-Draft-Checks) following [draft-irtf-cfrg-bbs-signatures-latest](https://identity.foundation/bbs-signature/draft-irtf-cfrg-bbs-signatures.html) -- [KZG trusted setup ceremony](https://github.com/dsrvlabs/czg-keremony) -- See [full list of projects on GitHub](https://github.com/paulmillr/noble-curves/network/dependents). - -## License - -The MIT License (MIT) - -Copyright (c) 2022 Paul Miller [(https://paulmillr.com)](https://paulmillr.com) - -See LICENSE file. diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/_shortw_utils.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/_shortw_utils.d.ts deleted file mode 100644 index 3eb43a81..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/_shortw_utils.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { randomBytes } from '@noble/hashes/utils'; -import { CurveType } from './abstract/weierstrass.js'; -import { CHash } from './abstract/utils.js'; -export declare function getHash(hash: CHash): { - hash: CHash; - hmac: (key: Uint8Array, ...msgs: Uint8Array[]) => Uint8Array; - randomBytes: typeof randomBytes; -}; -type CurveDef = Readonly>; -export declare function createCurve(curveDef: CurveDef, defHash: CHash): Readonly<{ - create: (hash: CHash) => import("./abstract/weierstrass.js").CurveFn; - CURVE: Readonly<{ - readonly nBitLength: number; - readonly nByteLength: number; - readonly Fp: import("./abstract/modular.js").IField; - readonly n: bigint; - readonly h: bigint; - readonly hEff?: bigint | undefined; - readonly Gx: bigint; - readonly Gy: bigint; - readonly allowInfinityPoint?: boolean | undefined; - readonly a: bigint; - readonly b: bigint; - readonly allowedPrivateKeyLengths?: readonly number[] | undefined; - readonly wrapPrivateKey?: boolean | undefined; - readonly endo?: { - beta: bigint; - splitScalar: (k: bigint) => { - k1neg: boolean; - k1: bigint; - k2neg: boolean; - k2: bigint; - }; - } | undefined; - readonly isTorsionFree?: ((c: import("./abstract/weierstrass.js").ProjConstructor, point: import("./abstract/weierstrass.js").ProjPointType) => boolean) | undefined; - readonly clearCofactor?: ((c: import("./abstract/weierstrass.js").ProjConstructor, point: import("./abstract/weierstrass.js").ProjPointType) => import("./abstract/weierstrass.js").ProjPointType) | undefined; - readonly hash: CHash; - readonly hmac: (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array; - readonly randomBytes: (bytesLength?: number | undefined) => Uint8Array; - lowS: boolean; - readonly bits2int?: ((bytes: Uint8Array) => bigint) | undefined; - readonly bits2int_modN?: ((bytes: Uint8Array) => bigint) | undefined; - readonly p: bigint; - }>; - getPublicKey: (privateKey: import("./abstract/utils.js").PrivKey, isCompressed?: boolean | undefined) => Uint8Array; - getSharedSecret: (privateA: import("./abstract/utils.js").PrivKey, publicB: import("./abstract/utils.js").Hex, isCompressed?: boolean | undefined) => Uint8Array; - sign: (msgHash: import("./abstract/utils.js").Hex, privKey: import("./abstract/utils.js").PrivKey, opts?: import("./abstract/weierstrass.js").SignOpts | undefined) => import("./abstract/weierstrass.js").RecoveredSignatureType; - verify: (signature: import("./abstract/utils.js").Hex | { - r: bigint; - s: bigint; - }, msgHash: import("./abstract/utils.js").Hex, publicKey: import("./abstract/utils.js").Hex, opts?: import("./abstract/weierstrass.js").VerOpts | undefined) => boolean; - ProjectivePoint: import("./abstract/weierstrass.js").ProjConstructor; - Signature: import("./abstract/weierstrass.js").SignatureConstructor; - utils: { - normPrivateKeyToScalar: (key: import("./abstract/utils.js").PrivKey) => bigint; - isValidPrivateKey(privateKey: import("./abstract/utils.js").PrivKey): boolean; - randomPrivateKey: () => Uint8Array; - precompute: (windowSize?: number | undefined, point?: import("./abstract/weierstrass.js").ProjPointType | undefined) => import("./abstract/weierstrass.js").ProjPointType; - }; -}>; -export {}; -//# sourceMappingURL=_shortw_utils.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/_shortw_utils.d.ts.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/_shortw_utils.d.ts.map deleted file mode 100644 index 974f8daf..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/_shortw_utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_shortw_utils.d.ts","sourceRoot":"","sources":["src/_shortw_utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAe,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAG5C,wBAAgB,OAAO,CAAC,IAAI,EAAE,KAAK;;gBAGnB,UAAU,WAAW,UAAU,EAAE;;EAGhD;AAED,KAAK,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC;AAC3E,wBAAgB,WAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK;mBACtC,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAE5B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/_shortw_utils.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/_shortw_utils.js deleted file mode 100644 index 555de44e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/_shortw_utils.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createCurve = exports.getHash = void 0; -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const hmac_1 = require("@noble/hashes/hmac"); -const utils_1 = require("@noble/hashes/utils"); -const weierstrass_js_1 = require("./abstract/weierstrass.js"); -// connects noble-curves to noble-hashes -function getHash(hash) { - return { - hash, - hmac: (key, ...msgs) => (0, hmac_1.hmac)(hash, key, (0, utils_1.concatBytes)(...msgs)), - randomBytes: utils_1.randomBytes, - }; -} -exports.getHash = getHash; -function createCurve(curveDef, defHash) { - const create = (hash) => (0, weierstrass_js_1.weierstrass)({ ...curveDef, ...getHash(hash) }); - return Object.freeze({ ...create(defHash), create }); -} -exports.createCurve = createCurve; -//# sourceMappingURL=_shortw_utils.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/_shortw_utils.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/_shortw_utils.js.map deleted file mode 100644 index 318dfda2..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/_shortw_utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_shortw_utils.js","sourceRoot":"","sources":["src/_shortw_utils.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,6CAA0C;AAC1C,+CAA+D;AAC/D,8DAAmE;AAGnE,wCAAwC;AACxC,SAAgB,OAAO,CAAC,IAAW;IACjC,OAAO;QACL,IAAI;QACJ,IAAI,EAAE,CAAC,GAAe,EAAE,GAAG,IAAkB,EAAE,EAAE,CAAC,IAAA,WAAI,EAAC,IAAI,EAAE,GAAG,EAAE,IAAA,mBAAW,EAAC,GAAG,IAAI,CAAC,CAAC;QACvF,WAAW,EAAX,mBAAW;KACZ,CAAC;AACJ,CAAC;AAND,0BAMC;AAGD,SAAgB,WAAW,CAAC,QAAkB,EAAE,OAAc;IAC5D,MAAM,MAAM,GAAG,CAAC,IAAW,EAAE,EAAE,CAAC,IAAA,4BAAW,EAAC,EAAE,GAAG,QAAQ,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC/E,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;AACvD,CAAC;AAHD,kCAGC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/bls.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/bls.d.ts deleted file mode 100644 index f6f14ac2..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/bls.d.ts +++ /dev/null @@ -1,103 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -/** - * BLS (Barreto-Lynn-Scott) family of pairing-friendly curves. - * Implements BLS (Boneh-Lynn-Shacham) signatures. - * Consists of two curves: G1 and G2: - * - G1 is a subgroup of (x, y) E(Fq) over y² = x³ + 4. - * - G2 is a subgroup of ((x₁, x₂+i), (y₁, y₂+i)) E(Fq²) over y² = x³ + 4(1 + i) where i is √-1 - * - Gt, created by bilinear (ate) pairing e(G1, G2), consists of p-th roots of unity in - * Fq^k where k is embedding degree. Only degree 12 is currently supported, 24 is not. - * Pairing is used to aggregate and verify signatures. - * We are using Fp for private keys (shorter) and Fp₂ for signatures (longer). - * Some projects may prefer to swap this relation, it is not supported for now. - */ -import { AffinePoint } from './curve.js'; -import { IField } from './modular.js'; -import { Hex, PrivKey, CHash } from './utils.js'; -import * as htf from './hash-to-curve.js'; -import { CurvePointsType, ProjPointType as ProjPointType, CurvePointsRes } from './weierstrass.js'; -type Fp = bigint; -export type SignatureCoder = { - fromHex(hex: Hex): ProjPointType; - toRawBytes(point: ProjPointType): Uint8Array; - toHex(point: ProjPointType): string; -}; -export type CurveType = { - G1: Omit, 'n'> & { - mapToCurve: htf.MapToCurve; - htfDefaults: htf.Opts; - }; - G2: Omit, 'n'> & { - Signature: SignatureCoder; - mapToCurve: htf.MapToCurve; - htfDefaults: htf.Opts; - }; - fields: { - Fp: IField; - Fr: IField; - Fp2: IField & { - reim: (num: Fp2) => { - re: bigint; - im: bigint; - }; - multiplyByB: (num: Fp2) => Fp2; - frobeniusMap(num: Fp2, power: number): Fp2; - }; - Fp6: IField; - Fp12: IField & { - frobeniusMap(num: Fp12, power: number): Fp12; - multiplyBy014(num: Fp12, o0: Fp2, o1: Fp2, o4: Fp2): Fp12; - conjugate(num: Fp12): Fp12; - finalExponentiate(num: Fp12): Fp12; - }; - }; - params: { - x: bigint; - r: bigint; - }; - htfDefaults: htf.Opts; - hash: CHash; - randomBytes: (bytesLength?: number) => Uint8Array; -}; -export type CurveFn = { - getPublicKey: (privateKey: PrivKey) => Uint8Array; - sign: { - (message: Hex, privateKey: PrivKey): Uint8Array; - (message: ProjPointType, privateKey: PrivKey): ProjPointType; - }; - verify: (signature: Hex | ProjPointType, message: Hex | ProjPointType, publicKey: Hex | ProjPointType) => boolean; - verifyBatch: (signature: Hex | ProjPointType, messages: (Hex | ProjPointType)[], publicKeys: (Hex | ProjPointType)[]) => boolean; - aggregatePublicKeys: { - (publicKeys: Hex[]): Uint8Array; - (publicKeys: ProjPointType[]): ProjPointType; - }; - aggregateSignatures: { - (signatures: Hex[]): Uint8Array; - (signatures: ProjPointType[]): ProjPointType; - }; - millerLoop: (ell: [Fp2, Fp2, Fp2][], g1: [Fp, Fp]) => Fp12; - pairing: (P: ProjPointType, Q: ProjPointType, withFinalExponent?: boolean) => Fp12; - G1: CurvePointsRes & ReturnType>; - G2: CurvePointsRes & ReturnType>; - Signature: SignatureCoder; - params: { - x: bigint; - r: bigint; - G1b: bigint; - G2b: Fp2; - }; - fields: { - Fp: IField; - Fp2: IField; - Fp6: IField; - Fp12: IField; - Fr: IField; - }; - utils: { - randomPrivateKey: () => Uint8Array; - calcPairingPrecomputes: (p: AffinePoint) => [Fp2, Fp2, Fp2][]; - }; -}; -export declare function bls(CURVE: CurveType): CurveFn; -export {}; -//# sourceMappingURL=bls.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/bls.d.ts.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/bls.d.ts.map deleted file mode 100644 index 7f110e32..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/bls.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bls.d.ts","sourceRoot":"","sources":["../src/abstract/bls.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,MAAM,EAAoC,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAA+B,MAAM,YAAY,CAAC;AAC9E,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EACL,eAAe,EACf,aAAa,IAAI,aAAa,EAC9B,cAAc,EAEf,MAAM,kBAAkB,CAAC;AAE1B,KAAK,EAAE,GAAG,MAAM,CAAC;AAKjB,MAAM,MAAM,cAAc,CAAC,GAAG,IAAI;IAChC,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;IACtC,UAAU,CAAC,KAAK,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC;IAClD,KAAK,CAAC,KAAK,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,SAAS,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,IAAI;IAC1C,EAAE,EAAE,IAAI,CA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ACnC,sBAAsB,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;KACpE,CAAC;CACH,CAAC;AAEF,wBAAgB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAChC,KAAK,EAAE,SAAS,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,GACnC,OAAO,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAqR7B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/bls.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/bls.js deleted file mode 100644 index a8bcfc56..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/bls.js +++ /dev/null @@ -1,239 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.bls = void 0; -const modular_js_1 = require("./modular.js"); -const utils_js_1 = require("./utils.js"); -const htf = require("./hash-to-curve.js"); -const weierstrass_js_1 = require("./weierstrass.js"); -// prettier-ignore -const _2n = BigInt(2), _3n = BigInt(3); -function bls(CURVE) { - // Fields are specific for curve, so for now we'll need to pass them with opts - const { Fp, Fr, Fp2, Fp6, Fp12 } = CURVE.fields; - const BLS_X_LEN = (0, utils_js_1.bitLen)(CURVE.params.x); - // Pre-compute coefficients for sparse multiplication - // Point addition and point double calculations is reused for coefficients - function calcPairingPrecomputes(p) { - const { x, y } = p; - // prettier-ignore - const Qx = x, Qy = y, Qz = Fp2.ONE; - // prettier-ignore - let Rx = Qx, Ry = Qy, Rz = Qz; - let ell_coeff = []; - for (let i = BLS_X_LEN - 2; i >= 0; i--) { - // Double - let t0 = Fp2.sqr(Ry); // Ry² - let t1 = Fp2.sqr(Rz); // Rz² - let t2 = Fp2.multiplyByB(Fp2.mul(t1, _3n)); // 3 * T1 * B - let t3 = Fp2.mul(t2, _3n); // 3 * T2 - let t4 = Fp2.sub(Fp2.sub(Fp2.sqr(Fp2.add(Ry, Rz)), t1), t0); // (Ry + Rz)² - T1 - T0 - ell_coeff.push([ - Fp2.sub(t2, t0), - Fp2.mul(Fp2.sqr(Rx), _3n), - Fp2.neg(t4), // -T4 - ]); - Rx = Fp2.div(Fp2.mul(Fp2.mul(Fp2.sub(t0, t3), Rx), Ry), _2n); // ((T0 - T3) * Rx * Ry) / 2 - Ry = Fp2.sub(Fp2.sqr(Fp2.div(Fp2.add(t0, t3), _2n)), Fp2.mul(Fp2.sqr(t2), _3n)); // ((T0 + T3) / 2)² - 3 * T2² - Rz = Fp2.mul(t0, t4); // T0 * T4 - if ((0, utils_js_1.bitGet)(CURVE.params.x, i)) { - // Addition - let t0 = Fp2.sub(Ry, Fp2.mul(Qy, Rz)); // Ry - Qy * Rz - let t1 = Fp2.sub(Rx, Fp2.mul(Qx, Rz)); // Rx - Qx * Rz - ell_coeff.push([ - Fp2.sub(Fp2.mul(t0, Qx), Fp2.mul(t1, Qy)), - Fp2.neg(t0), - t1, // T1 - ]); - let t2 = Fp2.sqr(t1); // T1² - let t3 = Fp2.mul(t2, t1); // T2 * T1 - let t4 = Fp2.mul(t2, Rx); // T2 * Rx - let t5 = Fp2.add(Fp2.sub(t3, Fp2.mul(t4, _2n)), Fp2.mul(Fp2.sqr(t0), Rz)); // T3 - 2 * T4 + T0² * Rz - Rx = Fp2.mul(t1, t5); // T1 * T5 - Ry = Fp2.sub(Fp2.mul(Fp2.sub(t4, t5), t0), Fp2.mul(t3, Ry)); // (T4 - T5) * T0 - T3 * Ry - Rz = Fp2.mul(Rz, t3); // Rz * T3 - } - } - return ell_coeff; - } - function millerLoop(ell, g1) { - const { x } = CURVE.params; - const Px = g1[0]; - const Py = g1[1]; - let f12 = Fp12.ONE; - for (let j = 0, i = BLS_X_LEN - 2; i >= 0; i--, j++) { - const E = ell[j]; - f12 = Fp12.multiplyBy014(f12, E[0], Fp2.mul(E[1], Px), Fp2.mul(E[2], Py)); - if ((0, utils_js_1.bitGet)(x, i)) { - j += 1; - const F = ell[j]; - f12 = Fp12.multiplyBy014(f12, F[0], Fp2.mul(F[1], Px), Fp2.mul(F[2], Py)); - } - if (i !== 0) - f12 = Fp12.sqr(f12); - } - return Fp12.conjugate(f12); - } - const utils = { - randomPrivateKey: () => { - const length = (0, modular_js_1.getMinHashLength)(Fr.ORDER); - return (0, modular_js_1.mapHashToField)(CURVE.randomBytes(length), Fr.ORDER); - }, - calcPairingPrecomputes, - }; - // Point on G1 curve: (x, y) - const G1_ = (0, weierstrass_js_1.weierstrassPoints)({ n: Fr.ORDER, ...CURVE.G1 }); - const G1 = Object.assign(G1_, htf.createHasher(G1_.ProjectivePoint, CURVE.G1.mapToCurve, { - ...CURVE.htfDefaults, - ...CURVE.G1.htfDefaults, - })); - function pairingPrecomputes(point) { - const p = point; - if (p._PPRECOMPUTES) - return p._PPRECOMPUTES; - p._PPRECOMPUTES = calcPairingPrecomputes(point.toAffine()); - return p._PPRECOMPUTES; - } - // TODO: export - // function clearPairingPrecomputes(point: G2) { - // const p = point as G2 & withPairingPrecomputes; - // p._PPRECOMPUTES = undefined; - // } - // Point on G2 curve (complex numbers): (x₁, x₂+i), (y₁, y₂+i) - const G2_ = (0, weierstrass_js_1.weierstrassPoints)({ n: Fr.ORDER, ...CURVE.G2 }); - const G2 = Object.assign(G2_, htf.createHasher(G2_.ProjectivePoint, CURVE.G2.mapToCurve, { - ...CURVE.htfDefaults, - ...CURVE.G2.htfDefaults, - })); - const { Signature } = CURVE.G2; - // Calculates bilinear pairing - function pairing(Q, P, withFinalExponent = true) { - if (Q.equals(G1.ProjectivePoint.ZERO) || P.equals(G2.ProjectivePoint.ZERO)) - throw new Error('pairing is not available for ZERO point'); - Q.assertValidity(); - P.assertValidity(); - // Performance: 9ms for millerLoop and ~14ms for exp. - const Qa = Q.toAffine(); - const looped = millerLoop(pairingPrecomputes(P), [Qa.x, Qa.y]); - return withFinalExponent ? Fp12.finalExponentiate(looped) : looped; - } - function normP1(point) { - return point instanceof G1.ProjectivePoint ? point : G1.ProjectivePoint.fromHex(point); - } - function normP2(point) { - return point instanceof G2.ProjectivePoint ? point : Signature.fromHex(point); - } - function normP2Hash(point, htfOpts) { - return point instanceof G2.ProjectivePoint - ? point - : G2.hashToCurve((0, utils_js_1.ensureBytes)('point', point), htfOpts); - } - // Multiplies generator by private key. - // P = pk x G - function getPublicKey(privateKey) { - return G1.ProjectivePoint.fromPrivateKey(privateKey).toRawBytes(true); - } - function sign(message, privateKey, htfOpts) { - const msgPoint = normP2Hash(message, htfOpts); - msgPoint.assertValidity(); - const sigPoint = msgPoint.multiply(G1.normPrivateKeyToScalar(privateKey)); - if (message instanceof G2.ProjectivePoint) - return sigPoint; - return Signature.toRawBytes(sigPoint); - } - // Checks if pairing of public key & hash is equal to pairing of generator & signature. - // e(P, H(m)) == e(G, S) - function verify(signature, message, publicKey, htfOpts) { - const P = normP1(publicKey); - const Hm = normP2Hash(message, htfOpts); - const G = G1.ProjectivePoint.BASE; - const S = normP2(signature); - // Instead of doing 2 exponentiations, we use property of billinear maps - // and do one exp after multiplying 2 points. - const ePHm = pairing(P.negate(), Hm, false); - const eGS = pairing(G, S, false); - const exp = Fp12.finalExponentiate(Fp12.mul(eGS, ePHm)); - return Fp12.eql(exp, Fp12.ONE); - } - function aggregatePublicKeys(publicKeys) { - if (!publicKeys.length) - throw new Error('Expected non-empty array'); - const agg = publicKeys.map(normP1).reduce((sum, p) => sum.add(p), G1.ProjectivePoint.ZERO); - const aggAffine = agg; //.toAffine(); - if (publicKeys[0] instanceof G1.ProjectivePoint) { - aggAffine.assertValidity(); - return aggAffine; - } - // toRawBytes ensures point validity - return aggAffine.toRawBytes(true); - } - function aggregateSignatures(signatures) { - if (!signatures.length) - throw new Error('Expected non-empty array'); - const agg = signatures.map(normP2).reduce((sum, s) => sum.add(s), G2.ProjectivePoint.ZERO); - const aggAffine = agg; //.toAffine(); - if (signatures[0] instanceof G2.ProjectivePoint) { - aggAffine.assertValidity(); - return aggAffine; - } - return Signature.toRawBytes(aggAffine); - } - // https://ethresear.ch/t/fast-verification-of-multiple-bls-signatures/5407 - // e(G, S) = e(G, SUM(n)(Si)) = MUL(n)(e(G, Si)) - function verifyBatch(signature, messages, publicKeys, htfOpts) { - // @ts-ignore - // console.log('verifyBatch', bytesToHex(signature as any), messages, publicKeys.map(bytesToHex)); - if (!messages.length) - throw new Error('Expected non-empty messages array'); - if (publicKeys.length !== messages.length) - throw new Error('Pubkey count should equal msg count'); - const sig = normP2(signature); - const nMessages = messages.map((i) => normP2Hash(i, htfOpts)); - const nPublicKeys = publicKeys.map(normP1); - try { - const paired = []; - for (const message of new Set(nMessages)) { - const groupPublicKey = nMessages.reduce((groupPublicKey, subMessage, i) => subMessage === message ? groupPublicKey.add(nPublicKeys[i]) : groupPublicKey, G1.ProjectivePoint.ZERO); - // const msg = message instanceof PointG2 ? message : await PointG2.hashToCurve(message); - // Possible to batch pairing for same msg with different groupPublicKey here - paired.push(pairing(groupPublicKey, message, false)); - } - paired.push(pairing(G1.ProjectivePoint.BASE.negate(), sig, false)); - const product = paired.reduce((a, b) => Fp12.mul(a, b), Fp12.ONE); - const exp = Fp12.finalExponentiate(product); - return Fp12.eql(exp, Fp12.ONE); - } - catch { - return false; - } - } - G1.ProjectivePoint.BASE._setWindowSize(4); - return { - getPublicKey, - sign, - verify, - verifyBatch, - aggregatePublicKeys, - aggregateSignatures, - millerLoop, - pairing, - G1, - G2, - Signature, - fields: { - Fr, - Fp, - Fp2, - Fp6, - Fp12, - }, - params: { - x: CURVE.params.x, - r: CURVE.params.r, - G1b: CURVE.G1.b, - G2b: CURVE.G2.b, - }, - utils, - }; -} -exports.bls = bls; -//# sourceMappingURL=bls.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/bls.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/bls.js.map deleted file mode 100644 index 520ab306..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/bls.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bls.js","sourceRoot":"","sources":["../src/abstract/bls.ts"],"names":[],"mappings":";;;AAcA,6CAAwE;AACxE,yCAA8E;AAC9E,0CAA0C;AAC1C,qDAK0B;AAI1B,kBAAkB;AAClB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AA2FvC,SAAgB,GAAG,CACjB,KAAoC;IAEpC,8EAA8E;IAC9E,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC;IAChD,MAAM,SAAS,GAAG,IAAA,iBAAM,EAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAEzC,qDAAqD;IACrD,0EAA0E;IAC1E,SAAS,sBAAsB,CAAC,CAAmB;QACjD,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;QACnB,kBAAkB;QAClB,MAAM,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,GAAG,CAAC,GAAG,CAAC;QACnC,kBAAkB;QAClB,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC;QAC9B,IAAI,SAAS,GAAsB,EAAE,CAAC;QACtC,KAAK,IAAI,CAAC,GAAG,SAAS,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;YACvC,SAAS;YACT,IAAI,EAAE,GAAG,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM;YAC5B,IAAI,EAAE,GAAG,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM;YA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E;YACN,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;YACjB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;YACjB,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;YACf,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;SAChB;QACD,KAAK;KACN,CAAC;AACJ,CAAC;AAvRD,kBAuRC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/curve.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/curve.d.ts deleted file mode 100644 index 9caf29cc..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/curve.d.ts +++ /dev/null @@ -1,70 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { IField } from './modular.js'; -export type AffinePoint = { - x: T; - y: T; -} & { - z?: never; - t?: never; -}; -export interface Group> { - double(): T; - negate(): T; - add(other: T): T; - subtract(other: T): T; - equals(other: T): boolean; - multiply(scalar: bigint): T; -} -export type GroupConstructor = { - BASE: T; - ZERO: T; -}; -export type Mapper = (i: T[]) => T[]; -export declare function wNAF>(c: GroupConstructor, bits: number): { - constTimeNegate: (condition: boolean, item: T) => T; - unsafeLadder(elm: T, n: bigint): T; - /** - * Creates a wNAF precomputation window. Used for caching. - * Default window size is set by `utils.precompute()` and is equal to 8. - * Number of precomputed points depends on the curve size: - * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where: - * - 𝑊 is the window size - * - 𝑛 is the bitlength of the curve order. - * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224. - * @returns precomputed point tables flattened to a single array - */ - precomputeWindow(elm: T, W: number): Group[]; - /** - * Implements ec multiplication using precomputed tables and w-ary non-adjacent form. - * @param W window size - * @param precomputes precomputed tables - * @param n scalar (we don't check here, but should be less than curve order) - * @returns real and fake (for const-time) points - */ - wNAF(W: number, precomputes: T[], n: bigint): { - p: T; - f: T; - }; - wNAFCached(P: T, precomputesMap: Map, n: bigint, transform: Mapper): { - p: T; - f: T; - }; -}; -export type BasicCurve = { - Fp: IField; - n: bigint; - nBitLength?: number; - nByteLength?: number; - h: bigint; - hEff?: bigint; - Gx: T; - Gy: T; - allowInfinityPoint?: boolean; -}; -export declare function validateBasic(curve: BasicCurve & T): Readonly<{ - readonly nBitLength: number; - readonly nByteLength: number; -} & BasicCurve & T & { - p: bigint; -}>; -//# sourceMappingURL=curve.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/curve.d.ts.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/curve.d.ts.map deleted file mode 100644 index fc52e87b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/curve.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"curve.d.ts","sourceRoot":"","sources":["../src/abstract/curve.ts"],"names":[],"mappings":"AAAA,sEAAsE;AAEtE,OAAO,EAAE,MAAM,EAA0B,MAAM,cAAc,CAAC;AAK9D,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;IAC3B,CAAC,EAAE,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,CAAC;CACN,GAAG;IAAE,CAAC,CAAC,EAAE,KAAK,CAAC;IAAC,CAAC,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAE7B,MAAM,WAAW,KAAK,CAAC,CAAC,SAAS,KAAK,CAAC,CAAC,CAAC;IACvC,MAAM,IAAI,CAAC,CAAC;IACZ,MAAM,IAAI,CAAC,CAAC;IACZ,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC;IACjB,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC;IACtB,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM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C;;;;;GAqB7D"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/curve.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/curve.js deleted file mode 100644 index 5a005bcd..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/curve.js +++ /dev/null @@ -1,161 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.validateBasic = exports.wNAF = void 0; -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -// Abelian group utilities -const modular_js_1 = require("./modular.js"); -const utils_js_1 = require("./utils.js"); -const _0n = BigInt(0); -const _1n = BigInt(1); -// Elliptic curve multiplication of Point by scalar. Fragile. -// Scalars should always be less than curve order: this should be checked inside of a curve itself. -// Creates precomputation tables for fast multiplication: -// - private scalar is split by fixed size windows of W bits -// - every window point is collected from window's table & added to accumulator -// - since windows are different, same point inside tables won't be accessed more than once per calc -// - each multiplication is 'Math.ceil(CURVE_ORDER / 𝑊) + 1' point additions (fixed for any scalar) -// - +1 window is neccessary for wNAF -// - wNAF reduces table size: 2x less memory + 2x faster generation, but 10% slower multiplication -// TODO: Research returning 2d JS array of windows, instead of a single window. This would allow -// windows to be in different memory locations -function wNAF(c, bits) { - const constTimeNegate = (condition, item) => { - const neg = item.negate(); - return condition ? neg : item; - }; - const opts = (W) => { - const windows = Math.ceil(bits / W) + 1; // +1, because - const windowSize = 2 ** (W - 1); // -1 because we skip zero - return { windows, windowSize }; - }; - return { - constTimeNegate, - // non-const time multiplication ladder - unsafeLadder(elm, n) { - let p = c.ZERO; - let d = elm; - while (n > _0n) { - if (n & _1n) - p = p.add(d); - d = d.double(); - n >>= _1n; - } - return p; - }, - /** - * Creates a wNAF precomputation window. Used for caching. - * Default window size is set by `utils.precompute()` and is equal to 8. - * Number of precomputed points depends on the curve size: - * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where: - * - 𝑊 is the window size - * - 𝑛 is the bitlength of the curve order. - * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224. - * @returns precomputed point tables flattened to a single array - */ - precomputeWindow(elm, W) { - const { windows, windowSize } = opts(W); - const points = []; - let p = elm; - let base = p; - for (let window = 0; window < windows; window++) { - base = p; - points.push(base); - // =1, because we skip zero - for (let i = 1; i < windowSize; i++) { - base = base.add(p); - points.push(base); - } - p = base.double(); - } - return points; - }, - /** - * Implements ec multiplication using precomputed tables and w-ary non-adjacent form. - * @param W window size - * @param precomputes precomputed tables - * @param n scalar (we don't check here, but should be less than curve order) - * @returns real and fake (for const-time) points - */ - wNAF(W, precomputes, n) { - // TODO: maybe check that scalar is less than group order? wNAF behavious is undefined otherwise - // But need to carefully remove other checks before wNAF. ORDER == bits here - const { windows, windowSize } = opts(W); - let p = c.ZERO; - let f = c.BASE; - const mask = BigInt(2 ** W - 1); // Create mask with W ones: 0b1111 for W=4 etc. - const maxNumber = 2 ** W; - const shiftBy = BigInt(W); - for (let window = 0; window < windows; window++) { - const offset = window * windowSize; - // Extract W bits. - let wbits = Number(n & mask); - // Shift number by W bits. - n >>= shiftBy; - // If the bits are bigger than max size, we'll split those. - // +224 => 256 - 32 - if (wbits > windowSize) { - wbits -= maxNumber; - n += _1n; - } - // This code was first written with assumption that 'f' and 'p' will never be infinity point: - // since each addition is multiplied by 2 ** W, it cannot cancel each other. However, - // there is negate now: it is possible that negated element from low value - // would be the same as high element, which will create carry into next window. - // It's not obvious how this can fail, but still worth investigating later. - // Check if we're onto Zero point. - // Add random point inside current window to f. - const offset1 = offset; - const offset2 = offset + Math.abs(wbits) - 1; // -1 because we skip zero - const cond1 = window % 2 !== 0; - const cond2 = wbits < 0; - if (wbits === 0) { - // The most important part for const-time getPublicKey - f = f.add(constTimeNegate(cond1, precomputes[offset1])); - } - else { - p = p.add(constTimeNegate(cond2, precomputes[offset2])); - } - } - // JIT-compiler should not eliminate f here, since it will later be used in normalizeZ() - // Even if the variable is still unused, there are some checks which will - // throw an exception, so compiler needs to prove they won't happen, which is hard. - // At this point there is a way to F be infinity-point even if p is not, - // which makes it less const-time: around 1 bigint multiply. - return { p, f }; - }, - wNAFCached(P, precomputesMap, n, transform) { - // @ts-ignore - const W = P._WINDOW_SIZE || 1; - // Calculate precomputes on a first run, reuse them after - let comp = precomputesMap.get(P); - if (!comp) { - comp = this.precomputeWindow(P, W); - if (W !== 1) { - precomputesMap.set(P, transform(comp)); - } - } - return this.wNAF(W, comp, n); - }, - }; -} -exports.wNAF = wNAF; -function validateBasic(curve) { - (0, modular_js_1.validateField)(curve.Fp); - (0, utils_js_1.validateObject)(curve, { - n: 'bigint', - h: 'bigint', - Gx: 'field', - Gy: 'field', - }, { - nBitLength: 'isSafeInteger', - nByteLength: 'isSafeInteger', - }); - // Set defaults - return Object.freeze({ - ...(0, modular_js_1.nLength)(curve.n, curve.nBitLength), - ...curve, - ...{ p: curve.Fp.ORDER }, - }); -} -exports.validateBasic = validateBasic; -//# sourceMappingURL=curve.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/curve.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/curve.js.map deleted file mode 100644 index dd6ca4b3..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/curve.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"curve.js","sourceRoot":"","sources":["../src/abstract/curve.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,0BAA0B;AAC1B,6CAA8D;AAC9D,yCAA4C;AAC5C,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAsBtB,6DAA6D;AAC7D,mGAAmG;AACnG,yDAAyD;AACzD,4DAA4D;AAC5D,+EAA+E;AAC/E,oGAAoG;AACpG,oGAAoG;AACpG,qCAAqC;AACrC,kGAAkG;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1C,IAAI,CAAC,KAAK,CAAC,EAAE;oBACX,cAAc,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;iBACxC;aACF;YACD,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC/B,CAAC;KACF,CAAC;AACJ,CAAC;AA/HD,oBA+HC;AAgBD,SAAgB,aAAa,CAAQ,KAAyB;IAC5D,IAAA,0BAAa,EAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACxB,IAAA,yBAAc,EACZ,KAAK,EACL;QACE,CAAC,EAAE,QAAQ;QACX,CAAC,EAAE,QAAQ;QACX,EAAE,EAAE,OAAO;QACX,EAAE,EAAE,OAAO;KACZ,EACD;QACE,UAAU,EAAE,eAAe;QAC3B,WAAW,EAAE,eAAe;KAC7B,CACF,CAAC;IACF,eAAe;IACf,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,GAAG,IAAA,oBAAO,EAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC;QACrC,GAAG,KAAK;QACR,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE;KAChB,CAAC,CAAC;AACd,CAAC;AArBD,sCAqBC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/edwards.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/edwards.d.ts deleted file mode 100644 index 9c43c661..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/edwards.d.ts +++ /dev/null @@ -1,89 +0,0 @@ -import * as ut from './utils.js'; -import { FHash, Hex } from './utils.js'; -import { Group, GroupConstructor, BasicCurve, AffinePoint } from './curve.js'; -export type CurveType = BasicCurve & { - a: bigint; - d: bigint; - hash: FHash; - randomBytes: (bytesLength?: number) => Uint8Array; - adjustScalarBytes?: (bytes: Uint8Array) => Uint8Array; - domain?: (data: Uint8Array, ctx: Uint8Array, phflag: boolean) => Uint8Array; - uvRatio?: (u: bigint, v: bigint) => { - isValid: boolean; - value: bigint; - }; - prehash?: FHash; - mapToCurve?: (scalar: bigint[]) => AffinePoint; -}; -declare function validateOpts(curve: CurveType): Readonly<{ - readonly nBitLength: number; - readonly nByteLength: number; - readonly Fp: import("./modular.js").IField; - readonly n: bigint; - readonly h: bigint; - readonly hEff?: bigint | undefined; - readonly Gx: bigint; - readonly Gy: bigint; - readonly allowInfinityPoint?: boolean | undefined; - readonly a: bigint; - readonly d: bigint; - readonly hash: ut.FHash; - readonly randomBytes: (bytesLength?: number | undefined) => Uint8Array; - readonly adjustScalarBytes?: ((bytes: Uint8Array) => Uint8Array) | undefined; - readonly domain?: ((data: Uint8Array, ctx: Uint8Array, phflag: boolean) => Uint8Array) | undefined; - readonly uvRatio?: ((u: bigint, v: bigint) => { - isValid: boolean; - value: bigint; - }) | undefined; - readonly prehash?: ut.FHash | undefined; - readonly mapToCurve?: ((scalar: bigint[]) => AffinePoint) | undefined; - readonly p: bigint; -}>; -export interface ExtPointType extends Group { - readonly ex: bigint; - readonly ey: bigint; - readonly ez: bigint; - readonly et: bigint; - get x(): bigint; - get y(): bigint; - assertValidity(): void; - multiply(scalar: bigint): ExtPointType; - multiplyUnsafe(scalar: bigint): ExtPointType; - isSmallOrder(): boolean; - isTorsionFree(): boolean; - clearCofactor(): ExtPointType; - toAffine(iz?: bigint): AffinePoint; - toRawBytes(isCompressed?: boolean): Uint8Array; - toHex(isCompressed?: boolean): string; -} -export interface ExtPointConstructor extends GroupConstructor { - new (x: bigint, y: bigint, z: bigint, t: bigint): ExtPointType; - fromAffine(p: AffinePoint): ExtPointType; - fromHex(hex: Hex): ExtPointType; - fromPrivateKey(privateKey: Hex): ExtPointType; -} -export type CurveFn = { - CURVE: ReturnType; - getPublicKey: (privateKey: Hex) => Uint8Array; - sign: (message: Hex, privateKey: Hex, options?: { - context?: Hex; - }) => Uint8Array; - verify: (sig: Hex, message: Hex, publicKey: Hex, options?: { - context?: Hex; - zip215: boolean; - }) => boolean; - ExtendedPoint: ExtPointConstructor; - utils: { - randomPrivateKey: () => Uint8Array; - getExtendedPublicKey: (key: Hex) => { - head: Uint8Array; - prefix: Uint8Array; - scalar: bigint; - point: ExtPointType; - pointBytes: Uint8Array; - }; - }; -}; -export declare function twistedEdwards(curveDef: CurveType): CurveFn; -export {}; -//# sourceMappingURL=edwards.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/edwards.d.ts.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/edwards.d.ts.map deleted file mode 100644 index a32123f7..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/edwards.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"edwards.d.ts","sourceRoot":"","sources":["../src/abstract/edwards.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAe,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAQ,UAAU,EAAiB,WAAW,EAAE,MAAM,YAAY,CAAC;AAOnG,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC,GAAG;IAC3C,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,KAAK,CAAC;IACZ,WAAW,EAAE,CAAC,WAAW,CAAC,EAAE,MAAM,KAAK,UAAU,CAAC;IAClD,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,UAAU,CAAC;IACtD,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,KAAK,UAAU,CAAC;IAC5E,OAAO,CAAC,EAAE,CAAC,CAA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AM,GAAG,YAAY,CAAC;IAC/D,UAAU,CAAC,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,YAAY,CAAC;IACjD,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,YAAY,CAAC;IAChC,cAAc,CAAC,UAAU,EAAE,GAAG,GAAG,YAAY,CAAC;CAC/C;AAED,MAAM,MAAM,OAAO,GAAG;IACpB,KAAK,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;IACvC,YAAY,EAAE,CAAC,UAAU,EAAE,GAAG,KAAK,UAAU,CAAC;IAC9C,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,GAAG,CAAA;KAAE,KAAK,UAAU,CAAC;IACjF,MAAM,EAAE,CACN,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,GAAG,EACZ,SAAS,EAAE,GAAG,EACd,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,GAAG,CAAC;QAAC,MAAM,EAAE,OAAO,CAAA;KAAE,KACzC,OAAO,CAAC;IACb,aAAa,EAAE,mBAAmB,CAAC;IACnC,KAAK,EAAE;QACL,gBAAgB,EAAE,MAAM,UAAU,CAAC;QACnC,oBAAoB,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK;YAClC,IAAI,EAAE,UAAU,CAAC;YACjB,MAAM,EAAE,UAAU,CAAC;YACnB,MAAM,EAAE,MAAM,CAAC;YACf,KAAK,EAAE,YAAY,CAAC;YACpB,UAAU,EAAE,UAAU,CAAC;SACxB,CAAC;KACH,CAAC;CACH,CAAC;AAGF,wBAAgB,cAAc,CAAC,QAAQ,EAAE,SAAS,GAAG,OAAO,CA8Z3D"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/edwards.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/edwards.js deleted file mode 100644 index 6dd4151a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/edwards.js +++ /dev/null @@ -1,429 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.twistedEdwards = void 0; -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -// Twisted Edwards curve. The formula is: ax² + y² = 1 + dx²y² -const modular_js_1 = require("./modular.js"); -const ut = require("./utils.js"); -const utils_js_1 = require("./utils.js"); -const curve_js_1 = require("./curve.js"); -// Be friendly to bad ECMAScript parsers by not using bigint literals -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _8n = BigInt(8); -// verification rule is either zip215 or rfc8032 / nist186-5. Consult fromHex: -const VERIFY_DEFAULT = { zip215: true }; -function validateOpts(curve) { - const opts = (0, curve_js_1.validateBasic)(curve); - ut.validateObject(curve, { - hash: 'function', - a: 'bigint', - d: 'bigint', - randomBytes: 'function', - }, { - adjustScalarBytes: 'function', - domain: 'function', - uvRatio: 'function', - mapToCurve: 'function', - }); - // Set defaults - return Object.freeze({ ...opts }); -} -// It is not generic twisted curve for now, but ed25519/ed448 generic implementation -function twistedEdwards(curveDef) { - const CURVE = validateOpts(curveDef); - const { Fp, n: CURVE_ORDER, prehash: prehash, hash: cHash, randomBytes, nByteLength, h: cofactor, } = CURVE; - const MASK = _2n << (BigInt(nByteLength * 8) - _1n); - const modP = Fp.create; // Function overrides - // sqrt(u/v) - const uvRatio = CURVE.uvRatio || - ((u, v) => { - try { - return { isValid: true, value: Fp.sqrt(u * Fp.inv(v)) }; - } - catch (e) { - return { isValid: false, value: _0n }; - } - }); - const adjustScalarBytes = CURVE.adjustScalarBytes || ((bytes) => bytes); // NOOP - const domain = CURVE.domain || - ((data, ctx, phflag) => { - if (ctx.length || phflag) - throw new Error('Contexts/pre-hash are not supported'); - return data; - }); // NOOP - const inBig = (n) => typeof n === 'bigint' && _0n < n; // n in [1..] - const inRange = (n, max) => inBig(n) && inBig(max) && n < max; // n in [1..max-1] - const in0MaskRange = (n) => n === _0n || inRange(n, MASK); // n in [0..MASK-1] - function assertInRange(n, max) { - // n in [1..max-1] - if (inRange(n, max)) - return n; - throw new Error(`Expected valid scalar < ${max}, got ${typeof n} ${n}`); - } - function assertGE0(n) { - // n in [0..CURVE_ORDER-1] - return n === _0n ? n : assertInRange(n, CURVE_ORDER); // GE = prime subgroup, not full group - } - const pointPrecomputes = new Map(); - function isPoint(other) { - if (!(other instanceof Point)) - throw new Error('ExtendedPoint expected'); - } - // Extended Point works in extended coordinates: (x, y, z, t) ∋ (x=x/z, y=y/z, t=xy). - // https://en.wikipedia.org/wiki/Twisted_Edwards_curve#Extended_coordinates - class Point { - constructor(ex, ey, ez, et) { - this.ex = ex; - this.ey = ey; - this.ez = ez; - this.et = et; - if (!in0MaskRange(ex)) - throw new Error('x required'); - if (!in0MaskRange(ey)) - throw new Error('y required'); - if (!in0MaskRange(ez)) - throw new Error('z required'); - if (!in0MaskRange(et)) - throw new Error('t required'); - } - get x() { - return this.toAffine().x; - } - get y() { - return this.toAffine().y; - } - static fromAffine(p) { - if (p instanceof Point) - throw new Error('extended point not allowed'); - const { x, y } = p || {}; - if (!in0MaskRange(x) || !in0MaskRange(y)) - throw new Error('invalid affine point'); - return new Point(x, y, _1n, modP(x * y)); - } - static normalizeZ(points) { - const toInv = Fp.invertBatch(points.map((p) => p.ez)); - return points.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine); - } - // "Private method", don't use it directly - _setWindowSize(windowSize) { - this._WINDOW_SIZE = windowSize; - pointPrecomputes.delete(this); - } - // Not required for fromHex(), which always creates valid points. - // Could be useful for fromAffine(). - assertValidity() { - const { a, d } = CURVE; - if (this.is0()) - throw new Error('bad point: ZERO'); // TODO: optimize, with vars below? - // Equation in affine coordinates: ax² + y² = 1 + dx²y² - // Equation in projective coordinates (X/Z, Y/Z, Z): (aX² + Y²)Z² = Z⁴ + dX²Y² - const { ex: X, ey: Y, ez: Z, et: T } = this; - const X2 = modP(X * X); // X² - const Y2 = modP(Y * Y); // Y² - const Z2 = modP(Z * Z); // Z² - const Z4 = modP(Z2 * Z2); // Z⁴ - const aX2 = modP(X2 * a); // aX² - const left = modP(Z2 * modP(aX2 + Y2)); // (aX² + Y²)Z² - const right = modP(Z4 + modP(d * modP(X2 * Y2))); // Z⁴ + dX²Y² - if (left !== right) - throw new Error('bad point: equation left != right (1)'); - // In Extended coordinates we also have T, which is x*y=T/Z: check X*Y == Z*T - const XY = modP(X * Y); - const ZT = modP(Z * T); - if (XY !== ZT) - throw new Error('bad point: equation left != right (2)'); - } - // Compare one point to another. - equals(other) { - isPoint(other); - const { ex: X1, ey: Y1, ez: Z1 } = this; - const { ex: X2, ey: Y2, ez: Z2 } = other; - const X1Z2 = modP(X1 * Z2); - const X2Z1 = modP(X2 * Z1); - const Y1Z2 = modP(Y1 * Z2); - const Y2Z1 = modP(Y2 * Z1); - return X1Z2 === X2Z1 && Y1Z2 === Y2Z1; - } - is0() { - return this.equals(Point.ZERO); - } - negate() { - // Flips point sign to a negative one (-x, y in affine coords) - return new Point(modP(-this.ex), this.ey, this.ez, modP(-this.et)); - } - // Fast algo for doubling Extended Point. - // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-dbl-2008-hwcd - // Cost: 4M + 4S + 1*a + 6add + 1*2. - double() { - const { a } = CURVE; - const { ex: X1, ey: Y1, ez: Z1 } = this; - const A = modP(X1 * X1); // A = X12 - const B = modP(Y1 * Y1); // B = Y12 - const C = modP(_2n * modP(Z1 * Z1)); // C = 2*Z12 - const D = modP(a * A); // D = a*A - const x1y1 = X1 + Y1; - const E = modP(modP(x1y1 * x1y1) - A - B); // E = (X1+Y1)2-A-B - const G = D + B; // G = D+B - const F = G - C; // F = G-C - const H = D - B; // H = D-B - const X3 = modP(E * F); // X3 = E*F - const Y3 = modP(G * H); // Y3 = G*H - const T3 = modP(E * H); // T3 = E*H - const Z3 = modP(F * G); // Z3 = F*G - return new Point(X3, Y3, Z3, T3); - } - // Fast algo for adding 2 Extended Points. - // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-add-2008-hwcd - // Cost: 9M + 1*a + 1*d + 7add. - add(other) { - isPoint(other); - const { a, d } = CURVE; - const { ex: X1, ey: Y1, ez: Z1, et: T1 } = this; - const { ex: X2, ey: Y2, ez: Z2, et: T2 } = other; - // Faster algo for adding 2 Extended Points when curve's a=-1. - // http://hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html#addition-add-2008-hwcd-4 - // Cost: 8M + 8add + 2*2. - // Note: It does not check whether the `other` point is valid. - if (a === BigInt(-1)) { - const A = modP((Y1 - X1) * (Y2 + X2)); - const B = modP((Y1 + X1) * (Y2 - X2)); - const F = modP(B - A); - if (F === _0n) - return this.double(); // Same point. Tests say it doesn't affect timing - const C = modP(Z1 * _2n * T2); - const D = modP(T1 * _2n * Z2); - const E = D + C; - const G = B + A; - const H = D - C; - const X3 = modP(E * F); - const Y3 = modP(G * H); - const T3 = modP(E * H); - const Z3 = modP(F * G); - return new Point(X3, Y3, Z3, T3); - } - const A = modP(X1 * X2); // A = X1*X2 - const B = modP(Y1 * Y2); // B = Y1*Y2 - const C = modP(T1 * d * T2); // C = T1*d*T2 - const D = modP(Z1 * Z2); // D = Z1*Z2 - const E = modP((X1 + Y1) * (X2 + Y2) - A - B); // E = (X1+Y1)*(X2+Y2)-A-B - const F = D - C; // F = D-C - const G = D + C; // G = D+C - const H = modP(B - a * A); // H = B-a*A - const X3 = modP(E * F); // X3 = E*F - const Y3 = modP(G * H); // Y3 = G*H - const T3 = modP(E * H); // T3 = E*H - const Z3 = modP(F * G); // Z3 = F*G - return new Point(X3, Y3, Z3, T3); - } - subtract(other) { - return this.add(other.negate()); - } - wNAF(n) { - return wnaf.wNAFCached(this, pointPrecomputes, n, Point.normalizeZ); - } - // Constant-time multiplication. - multiply(scalar) { - const { p, f } = this.wNAF(assertInRange(scalar, CURVE_ORDER)); - return Point.normalizeZ([p, f])[0]; - } - // Non-constant-time multiplication. Uses double-and-add algorithm. - // It's faster, but should only be used when you don't care about - // an exposed private key e.g. sig verification. - // Does NOT allow scalars higher than CURVE.n. - multiplyUnsafe(scalar) { - let n = assertGE0(scalar); // 0 <= scalar < CURVE.n - if (n === _0n) - return I; - if (this.equals(I) || n === _1n) - return this; - if (this.equals(G)) - return this.wNAF(n).p; - return wnaf.unsafeLadder(this, n); - } - // Checks if point is of small order. - // If you add something to small order point, you will have "dirty" - // point with torsion component. - // Multiplies point by cofactor and checks if the result is 0. - isSmallOrder() { - return this.multiplyUnsafe(cofactor).is0(); - } - // Multiplies point by curve order and checks if the result is 0. - // Returns `false` is the point is dirty. - isTorsionFree() { - return wnaf.unsafeLadder(this, CURVE_ORDER).is0(); - } - // Converts Extended point to default (x, y) coordinates. - // Can accept precomputed Z^-1 - for example, from invertBatch. - toAffine(iz) { - const { ex: x, ey: y, ez: z } = this; - const is0 = this.is0(); - if (iz == null) - iz = is0 ? _8n : Fp.inv(z); // 8 was chosen arbitrarily - const ax = modP(x * iz); - const ay = modP(y * iz); - const zz = modP(z * iz); - if (is0) - return { x: _0n, y: _1n }; - if (zz !== _1n) - throw new Error('invZ was invalid'); - return { x: ax, y: ay }; - } - clearCofactor() { - const { h: cofactor } = CURVE; - if (cofactor === _1n) - return this; - return this.multiplyUnsafe(cofactor); - } - // Converts hash string or Uint8Array to Point. - // Uses algo from RFC8032 5.1.3. - static fromHex(hex, zip215 = false) { - const { d, a } = CURVE; - const len = Fp.BYTES; - hex = (0, utils_js_1.ensureBytes)('pointHex', hex, len); // copy hex to a new array - const normed = hex.slice(); // copy again, we'll manipulate it - const lastByte = hex[len - 1]; // select last byte - normed[len - 1] = lastByte & ~0x80; // clear last bit - const y = ut.bytesToNumberLE(normed); - if (y === _0n) { - // y=0 is allowed - } - else { - // RFC8032 prohibits >= p, but ZIP215 doesn't - if (zip215) - assertInRange(y, MASK); // zip215=true [1..P-1] (2^255-19-1 for ed25519) - else - assertInRange(y, Fp.ORDER); // zip215=false [1..MASK-1] (2^256-1 for ed25519) - } - // Ed25519: x² = (y²-1)/(dy²+1) mod p. Ed448: x² = (y²-1)/(dy²-1) mod p. Generic case: - // ax²+y²=1+dx²y² => y²-1=dx²y²-ax² => y²-1=x²(dy²-a) => x²=(y²-1)/(dy²-a) - const y2 = modP(y * y); // denominator is always non-0 mod p. - const u = modP(y2 - _1n); // u = y² - 1 - const v = modP(d * y2 - a); // v = d y² + 1. - let { isValid, value: x } = uvRatio(u, v); // √(u/v) - if (!isValid) - throw new Error('Point.fromHex: invalid y coordinate'); - const isXOdd = (x & _1n) === _1n; // There are 2 square roots. Use x_0 bit to select proper - const isLastByteOdd = (lastByte & 0x80) !== 0; // x_0, last bit - if (!zip215 && x === _0n && isLastByteOdd) - // if x=0 and x_0 = 1, fail - throw new Error('Point.fromHex: x=0 and x_0=1'); - if (isLastByteOdd !== isXOdd) - x = modP(-x); // if x_0 != x mod 2, set x = p-x - return Point.fromAffine({ x, y }); - } - static fromPrivateKey(privKey) { - return getExtendedPublicKey(privKey).point; - } - toRawBytes() { - const { x, y } = this.toAffine(); - const bytes = ut.numberToBytesLE(y, Fp.BYTES); // each y has 2 x values (x, -y) - bytes[bytes.length - 1] |= x & _1n ? 0x80 : 0; // when compressing, it's enough to store y - return bytes; // and use the last byte to encode sign of x - } - toHex() { - return ut.bytesToHex(this.toRawBytes()); // Same as toRawBytes, but returns string. - } - } - Point.BASE = new Point(CURVE.Gx, CURVE.Gy, _1n, modP(CURVE.Gx * CURVE.Gy)); - Point.ZERO = new Point(_0n, _1n, _1n, _0n); // 0, 1, 1, 0 - const { BASE: G, ZERO: I } = Point; - const wnaf = (0, curve_js_1.wNAF)(Point, nByteLength * 8); - function modN(a) { - return (0, modular_js_1.mod)(a, CURVE_ORDER); - } - // Little-endian SHA512 with modulo n - function modN_LE(hash) { - return modN(ut.bytesToNumberLE(hash)); - } - /** Convenience method that creates public key and other stuff. RFC8032 5.1.5 */ - function getExtendedPublicKey(key) { - const len = nByteLength; - key = (0, utils_js_1.ensureBytes)('private key', key, len); - // Hash private key with curve's hash function to produce uniformingly random input - // Check byte lengths: ensure(64, h(ensure(32, key))) - const hashed = (0, utils_js_1.ensureBytes)('hashed private key', cHash(key), 2 * len); - const head = adjustScalarBytes(hashed.slice(0, len)); // clear first half bits, produce FE - const prefix = hashed.slice(len, 2 * len); // second half is called key prefix (5.1.6) - const scalar = modN_LE(head); // The actual private scalar - const point = G.multiply(scalar); // Point on Edwards curve aka public key - const pointBytes = point.toRawBytes(); // Uint8Array representation - return { head, prefix, scalar, point, pointBytes }; - } - // Calculates EdDSA pub key. RFC8032 5.1.5. Privkey is hashed. Use first half with 3 bits cleared - function getPublicKey(privKey) { - return getExtendedPublicKey(privKey).pointBytes; - } - // int('LE', SHA512(dom2(F, C) || msgs)) mod N - function hashDomainToScalar(context = new Uint8Array(), ...msgs) { - const msg = ut.concatBytes(...msgs); - return modN_LE(cHash(domain(msg, (0, utils_js_1.ensureBytes)('context', context), !!prehash))); - } - /** Signs message with privateKey. RFC8032 5.1.6 */ - function sign(msg, privKey, options = {}) { - msg = (0, utils_js_1.ensureBytes)('message', msg); - if (prehash) - msg = prehash(msg); // for ed25519ph etc. - const { prefix, scalar, pointBytes } = getExtendedPublicKey(privKey); - const r = hashDomainToScalar(options.context, prefix, msg); // r = dom2(F, C) || prefix || PH(M) - const R = G.multiply(r).toRawBytes(); // R = rG - const k = hashDomainToScalar(options.context, R, pointBytes, msg); // R || A || PH(M) - const s = modN(r + k * scalar); // S = (r + k * s) mod L - assertGE0(s); // 0 <= s < l - const res = ut.concatBytes(R, ut.numberToBytesLE(s, Fp.BYTES)); - return (0, utils_js_1.ensureBytes)('result', res, nByteLength * 2); // 64-byte signature - } - const verifyOpts = VERIFY_DEFAULT; - function verify(sig, msg, publicKey, options = verifyOpts) { - const { context, zip215 } = options; - const len = Fp.BYTES; // Verifies EdDSA signature against message and public key. RFC8032 5.1.7. - sig = (0, utils_js_1.ensureBytes)('signature', sig, 2 * len); // An extended group equation is checked. - msg = (0, utils_js_1.ensureBytes)('message', msg); - if (prehash) - msg = prehash(msg); // for ed25519ph, etc - const s = ut.bytesToNumberLE(sig.slice(len, 2 * len)); - // zip215: true is good for consensus-critical apps and allows points < 2^256 - // zip215: false follows RFC8032 / NIST186-5 and restricts points to CURVE.p - let A, R, SB; - try { - A = Point.fromHex(publicKey, zip215); - R = Point.fromHex(sig.slice(0, len), zip215); - SB = G.multiplyUnsafe(s); // 0 <= s < l is done inside - } - catch (error) { - return false; - } - if (!zip215 && A.isSmallOrder()) - return false; - const k = hashDomainToScalar(context, R.toRawBytes(), A.toRawBytes(), msg); - const RkA = R.add(A.multiplyUnsafe(k)); - // [8][S]B = [8]R + [8][k]A' - return RkA.subtract(SB).clearCofactor().equals(Point.ZERO); - } - G._setWindowSize(8); // Enable precomputes. Slows down first publicKey computation by 20ms. - const utils = { - getExtendedPublicKey, - // ed25519 private keys are uniform 32b. No need to check for modulo bias, like in secp256k1. - randomPrivateKey: () => randomBytes(Fp.BYTES), - /** - * We're doing scalar multiplication (used in getPublicKey etc) with precomputed BASE_POINT - * values. This slows down first getPublicKey() by milliseconds (see Speed section), - * but allows to speed-up subsequent getPublicKey() calls up to 20x. - * @param windowSize 2, 4, 8, 16 - */ - precompute(windowSize = 8, point = Point.BASE) { - point._setWindowSize(windowSize); - point.multiply(BigInt(3)); - return point; - }, - }; - return { - CURVE, - getPublicKey, - sign, - verify, - ExtendedPoint: Point, - utils, - }; -} -exports.twistedEdwards = twistedEdwards; -//# sourceMappingURL=edwards.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/edwards.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/edwards.js.map deleted file mode 100644 index 73ac6d5a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/edwards.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"edwards.js","sourceRoot":"","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--git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/hash-to-curve.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/hash-to-curve.d.ts deleted file mode 100644 index 5720293e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/hash-to-curve.d.ts +++ /dev/null @@ -1,57 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import type { Group, GroupConstructor, AffinePoint } from './curve.js'; -import { IField } from './modular.js'; -import { CHash } from './utils.js'; -/** - * * `DST` is a domain separation tag, defined in section 2.2.5 - * * `p` characteristic of F, where F is a finite field of characteristic p and order q = p^m - * * `m` is extension degree (1 for prime fields) - * * `k` is the target security target in bits (e.g. 128), from section 5.1 - * * `expand` is `xmd` (SHA2, SHA3, BLAKE) or `xof` (SHAKE, BLAKE-XOF) - * * `hash` conforming to `utils.CHash` interface, with `outputLen` / `blockLen` props - */ -type UnicodeOrBytes = string | Uint8Array; -export type Opts = { - DST: UnicodeOrBytes; - p: bigint; - m: number; - k: number; - expand: 'xmd' | 'xof'; - hash: CHash; -}; -export declare function expand_message_xmd(msg: Uint8Array, DST: Uint8Array, lenInBytes: number, H: CHash): Uint8Array; -export declare function expand_message_xof(msg: Uint8Array, DST: Uint8Array, lenInBytes: number, k: number, H: CHash): Uint8Array; -/** - * Hashes arbitrary-length byte strings to a list of one or more elements of a finite field F - * https://www.rfc-editor.org/rfc/rfc9380#section-5.2 - * @param msg a byte string containing the message to hash - * @param count the number of elements of F to output - * @param options `{DST: string, p: bigint, m: number, k: number, expand: 'xmd' | 'xof', hash: H}`, see above - * @returns [u_0, ..., u_(count - 1)], a list of field elements. - */ -export declare function hash_to_field(msg: Uint8Array, count: number, options: Opts): bigint[][]; -export declare function isogenyMap>(field: F, map: [T[], T[], T[], T[]]): (x: T, y: T) => { - x: T; - y: T; -}; -export interface H2CPoint extends Group> { - add(rhs: H2CPoint): H2CPoint; - toAffine(iz?: bigint): AffinePoint; - clearCofactor(): H2CPoint; - assertValidity(): void; -} -export interface H2CPointConstructor extends GroupConstructor> { - fromAffine(ap: AffinePoint): H2CPoint; -} -export type MapToCurve = (scalar: bigint[]) => AffinePoint; -export type htfBasicOpts = { - DST: UnicodeOrBytes; -}; -export declare function createHasher(Point: H2CPointConstructor, mapToCurve: MapToCurve, def: Opts & { - encodeDST?: UnicodeOrBytes; -}): { - hashToCurve(msg: Uint8Array, options?: htfBasicOpts): H2CPoint; - encodeToCurve(msg: Uint8Array, options?: htfBasicOpts): H2CPoint; -}; -export {}; -//# sourceMappingURL=hash-to-curve.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/hash-to-curve.d.ts.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/hash-to-curve.d.ts.map deleted file mode 100644 index e74c0d7f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/hash-to-curve.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hash-to-curve.d.ts","sourceRoot":"","sources":["../src/abstract/hash-to-curve.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,OAAO,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,EAAO,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAmB,KAAK,EAA4C,MAAM,YAAY,CAAC;AAE9F;;;;;;;GAOG;AACH,KAAK,cAAc,GAAG,MAAM,GAAG,UAAU,CAAC;AAC1C,MAAM,MAAM,IAAI,GAAG;IACjB,GAAG,EAAE,cAAc,CAAC;IACpB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,MAAM,EAAE,KAAK,GAAG,KAAK,CAAC;IACtB,IAAI,EAAE,KAAK,CAAC;CACb,CAAC;AA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U,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC;AAIjE,MAAM,MAAM,YAAY,GAAG;IAAE,GAAG,EAAE,cAAc,CAAA;CAAE,CAAC;AAEnD,wBAAgB,YAAY,CAAC,CAAC,EAC5B,KAAK,EAAE,mBAAmB,CAAC,CAAC,CAAC,EAC7B,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,EACzB,GAAG,EAAE,IAAI,GAAG;IAAE,SAAS,CAAC,EAAE,cAAc,CAAA;CAAE;qBAMvB,UAAU,YAAY,YAAY;uBAWhC,UAAU,YAAY,YAAY;EAOxD"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/hash-to-curve.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/hash-to-curve.js deleted file mode 100644 index aaab7c5e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/hash-to-curve.js +++ /dev/null @@ -1,181 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createHasher = exports.isogenyMap = exports.hash_to_field = exports.expand_message_xof = exports.expand_message_xmd = void 0; -const modular_js_1 = require("./modular.js"); -const utils_js_1 = require("./utils.js"); -function validateDST(dst) { - if (dst instanceof Uint8Array) - return dst; - if (typeof dst === 'string') - return (0, utils_js_1.utf8ToBytes)(dst); - throw new Error('DST must be Uint8Array or string'); -} -// Octet Stream to Integer. "spec" implementation of os2ip is 2.5x slower vs bytesToNumberBE. -const os2ip = utils_js_1.bytesToNumberBE; -// Integer to Octet Stream (numberToBytesBE) -function i2osp(value, length) { - if (value < 0 || value >= 1 << (8 * length)) { - throw new Error(`bad I2OSP call: value=${value} length=${length}`); - } - const res = Array.from({ length }).fill(0); - for (let i = length - 1; i >= 0; i--) { - res[i] = value & 0xff; - value >>>= 8; - } - return new Uint8Array(res); -} -function strxor(a, b) { - const arr = new Uint8Array(a.length); - for (let i = 0; i < a.length; i++) { - arr[i] = a[i] ^ b[i]; - } - return arr; -} -function isBytes(item) { - if (!(item instanceof Uint8Array)) - throw new Error('Uint8Array expected'); -} -function isNum(item) { - if (!Number.isSafeInteger(item)) - throw new Error('number expected'); -} -// Produces a uniformly random byte string using a cryptographic hash function H that outputs b bits -// https://www.rfc-editor.org/rfc/rfc9380#section-5.3.1 -function expand_message_xmd(msg, DST, lenInBytes, H) { - isBytes(msg); - isBytes(DST); - isNum(lenInBytes); - // https://www.rfc-editor.org/rfc/rfc9380#section-5.3.3 - if (DST.length > 255) - DST = H((0, utils_js_1.concatBytes)((0, utils_js_1.utf8ToBytes)('H2C-OVERSIZE-DST-'), DST)); - const { outputLen: b_in_bytes, blockLen: r_in_bytes } = H; - const ell = Math.ceil(lenInBytes / b_in_bytes); - if (ell > 255) - throw new Error('Invalid xmd length'); - const DST_prime = (0, utils_js_1.concatBytes)(DST, i2osp(DST.length, 1)); - const Z_pad = i2osp(0, r_in_bytes); - const l_i_b_str = i2osp(lenInBytes, 2); // len_in_bytes_str - const b = new Array(ell); - const b_0 = H((0, utils_js_1.concatBytes)(Z_pad, msg, l_i_b_str, i2osp(0, 1), DST_prime)); - b[0] = H((0, utils_js_1.concatBytes)(b_0, i2osp(1, 1), DST_prime)); - for (let i = 1; i <= ell; i++) { - const args = [strxor(b_0, b[i - 1]), i2osp(i + 1, 1), DST_prime]; - b[i] = H((0, utils_js_1.concatBytes)(...args)); - } - const pseudo_random_bytes = (0, utils_js_1.concatBytes)(...b); - return pseudo_random_bytes.slice(0, lenInBytes); -} -exports.expand_message_xmd = expand_message_xmd; -// Produces a uniformly random byte string using an extendable-output function (XOF) H. -// 1. The collision resistance of H MUST be at least k bits. -// 2. H MUST be an XOF that has been proved indifferentiable from -// a random oracle under a reasonable cryptographic assumption. -// https://www.rfc-editor.org/rfc/rfc9380#section-5.3.2 -function expand_message_xof(msg, DST, lenInBytes, k, H) { - isBytes(msg); - isBytes(DST); - isNum(lenInBytes); - // https://www.rfc-editor.org/rfc/rfc9380#section-5.3.3 - // DST = H('H2C-OVERSIZE-DST-' || a_very_long_DST, Math.ceil((lenInBytes * k) / 8)); - if (DST.length > 255) { - const dkLen = Math.ceil((2 * k) / 8); - DST = H.create({ dkLen }).update((0, utils_js_1.utf8ToBytes)('H2C-OVERSIZE-DST-')).update(DST).digest(); - } - if (lenInBytes > 65535 || DST.length > 255) - throw new Error('expand_message_xof: invalid lenInBytes'); - return (H.create({ dkLen: lenInBytes }) - .update(msg) - .update(i2osp(lenInBytes, 2)) - // 2. DST_prime = DST || I2OSP(len(DST), 1) - .update(DST) - .update(i2osp(DST.length, 1)) - .digest()); -} -exports.expand_message_xof = expand_message_xof; -/** - * Hashes arbitrary-length byte strings to a list of one or more elements of a finite field F - * https://www.rfc-editor.org/rfc/rfc9380#section-5.2 - * @param msg a byte string containing the message to hash - * @param count the number of elements of F to output - * @param options `{DST: string, p: bigint, m: number, k: number, expand: 'xmd' | 'xof', hash: H}`, see above - * @returns [u_0, ..., u_(count - 1)], a list of field elements. - */ -function hash_to_field(msg, count, options) { - (0, utils_js_1.validateObject)(options, { - DST: 'stringOrUint8Array', - p: 'bigint', - m: 'isSafeInteger', - k: 'isSafeInteger', - hash: 'hash', - }); - const { p, k, m, hash, expand, DST: _DST } = options; - isBytes(msg); - isNum(count); - const DST = validateDST(_DST); - const log2p = p.toString(2).length; - const L = Math.ceil((log2p + k) / 8); // section 5.1 of ietf draft link above - const len_in_bytes = count * m * L; - let prb; // pseudo_random_bytes - if (expand === 'xmd') { - prb = expand_message_xmd(msg, DST, len_in_bytes, hash); - } - else if (expand === 'xof') { - prb = expand_message_xof(msg, DST, len_in_bytes, k, hash); - } - else if (expand === '_internal_pass') { - // for internal tests only - prb = msg; - } - else { - throw new Error('expand must be "xmd" or "xof"'); - } - const u = new Array(count); - for (let i = 0; i < count; i++) { - const e = new Array(m); - for (let j = 0; j < m; j++) { - const elm_offset = L * (j + i * m); - const tv = prb.subarray(elm_offset, elm_offset + L); - e[j] = (0, modular_js_1.mod)(os2ip(tv), p); - } - u[i] = e; - } - return u; -} -exports.hash_to_field = hash_to_field; -function isogenyMap(field, map) { - // Make same order as in spec - const COEFF = map.map((i) => Array.from(i).reverse()); - return (x, y) => { - const [xNum, xDen, yNum, yDen] = COEFF.map((val) => val.reduce((acc, i) => field.add(field.mul(acc, x), i))); - x = field.div(xNum, xDen); // xNum / xDen - y = field.mul(y, field.div(yNum, yDen)); // y * (yNum / yDev) - return { x, y }; - }; -} -exports.isogenyMap = isogenyMap; -function createHasher(Point, mapToCurve, def) { - if (typeof mapToCurve !== 'function') - throw new Error('mapToCurve() must be defined'); - return { - // Encodes byte string to elliptic curve. - // hash_to_curve from https://www.rfc-editor.org/rfc/rfc9380#section-3 - hashToCurve(msg, options) { - const u = hash_to_field(msg, 2, { ...def, DST: def.DST, ...options }); - const u0 = Point.fromAffine(mapToCurve(u[0])); - const u1 = Point.fromAffine(mapToCurve(u[1])); - const P = u0.add(u1).clearCofactor(); - P.assertValidity(); - return P; - }, - // Encodes byte string to elliptic curve. - // encode_to_curve from https://www.rfc-editor.org/rfc/rfc9380#section-3 - encodeToCurve(msg, options) { - const u = hash_to_field(msg, 1, { ...def, DST: def.encodeDST, ...options }); - const P = Point.fromAffine(mapToCurve(u[0])).clearCofactor(); - P.assertValidity(); - return P; - }, - }; -} -exports.createHasher = createHasher; -//# sourceMappingURL=hash-to-curve.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/hash-to-curve.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/hash-to-curve.js.map deleted file mode 100644 index d59745d6..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/hash-to-curve.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hash-to-curve.js","sourceRoot":"","sources":["../src/abstract/hash-to-curve.ts"],"names":[],"mappings":";;;AAEA,6CAA2C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AAG,aAAa,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,OAAO,EAAU,CAAC,CAAC;YAC9E,MAAM,EAAE,GAAG,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC9C,MAAM,EAAE,GAAG,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC9C,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,aAAa,EAAE,CAAC;YACrC,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,OAAO,CAAC,CAAC;QACX,CAAC;QAED,yCAAyC;QACzC,wEAAwE;QACxE,aAAa,CAAC,GAAe,EAAE,OAAsB;YACnD,MAAM,CAAC,GAAG,aAAa,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,SAAS,EAAE,GAAG,OAAO,EAAU,CAAC,CAAC;YACpF,MAAM,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC;YAC7D,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,OAAO,CAAC,CAAC;QACX,CAAC;KACF,CAAC;AACJ,CAAC;AA3BD,oCA2BC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/modular.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/modular.d.ts deleted file mode 100644 index 42d49266..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/modular.d.ts +++ /dev/null @@ -1,123 +0,0 @@ -export declare function mod(a: bigint, b: bigint): bigint; -/** - * Efficiently raise num to power and do modular division. - * Unsafe in some contexts: uses ladder, so can expose bigint bits. - * @example - * pow(2n, 6n, 11n) // 64n % 11n == 9n - */ -export declare function pow(num: bigint, power: bigint, modulo: bigint): bigint; -export declare function pow2(x: bigint, power: bigint, modulo: bigint): bigint; -export declare function invert(number: bigint, modulo: bigint): bigint; -/** - * Tonelli-Shanks square root search algorithm. - * 1. https://eprint.iacr.org/2012/685.pdf (page 12) - * 2. Square Roots from 1; 24, 51, 10 to Dan Shanks - * Will start an infinite loop if field order P is not prime. - * @param P field order - * @returns function that takes field Fp (created from P) and number n - */ -export declare function tonelliShanks(P: bigint): (Fp: IField, n: T) => T; -export declare function FpSqrt(P: bigint): (Fp: IField, n: T) => T; -export declare const isNegativeLE: (num: bigint, modulo: bigint) => boolean; -export interface IField { - ORDER: bigint; - BYTES: number; - BITS: number; - MASK: bigint; - ZERO: T; - ONE: T; - create: (num: T) => T; - isValid: (num: T) => boolean; - is0: (num: T) => boolean; - neg(num: T): T; - inv(num: T): T; - sqrt(num: T): T; - sqr(num: T): T; - eql(lhs: T, rhs: T): boolean; - add(lhs: T, rhs: T): T; - sub(lhs: T, rhs: T): T; - mul(lhs: T, rhs: T | bigint): T; - pow(lhs: T, power: bigint): T; - div(lhs: T, rhs: T | bigint): T; - addN(lhs: T, rhs: T): T; - subN(lhs: T, rhs: T): T; - mulN(lhs: T, rhs: T | bigint): T; - sqrN(num: T): T; - isOdd?(num: T): boolean; - pow(lhs: T, power: bigint): T; - invertBatch: (lst: T[]) => T[]; - toBytes(num: T): Uint8Array; - fromBytes(bytes: Uint8Array): T; - cmov(a: T, b: T, c: boolean): T; -} -export declare function validateField(field: IField): IField; -/** - * Same as `pow` but for Fp: non-constant-time. - * Unsafe in some contexts: uses ladder, so can expose bigint bits. - */ -export declare function FpPow(f: IField, num: T, power: bigint): T; -/** - * Efficiently invert an array of Field elements. - * `inv(0)` will return `undefined` here: make sure to throw an error. - */ -export declare function FpInvertBatch(f: IField, nums: T[]): T[]; -export declare function FpDiv(f: IField, lhs: T, rhs: T | bigint): T; -export declare function FpIsSquare(f: IField): (x: T) => boolean; -export declare function nLength(n: bigint, nBitLength?: number): { - nBitLength: number; - nByteLength: number; -}; -type FpField = IField & Required, 'isOdd'>>; -/** - * Initializes a finite field over prime. **Non-primes are not supported.** - * Do not init in loop: slow. Very fragile: always run a benchmark on a change. - * Major performance optimizations: - * * a) denormalized operations like mulN instead of mul - * * b) same object shape: never add or remove keys - * * c) Object.freeze - * @param ORDER prime positive bigint - * @param bitLen how many bits the field consumes - * @param isLE (def: false) if encoding / decoding should be in little-endian - * @param redef optional faster redefinitions of sqrt and other methods - */ -export declare function Field(ORDER: bigint, bitLen?: number, isLE?: boolean, redef?: Partial>): Readonly; -export declare function FpSqrtOdd(Fp: IField, elm: T): T; -export declare function FpSqrtEven(Fp: IField, elm: T): T; -/** - * "Constant-time" private key generation utility. - * Same as mapKeyToField, but accepts less bytes (40 instead of 48 for 32-byte field). - * Which makes it slightly more biased, less secure. - * @deprecated use mapKeyToField instead - */ -export declare function hashToPrivateScalar(hash: string | Uint8Array, groupOrder: bigint, isLE?: boolean): bigint; -/** - * Returns total number of bytes consumed by the field element. - * For example, 32 bytes for usual 256-bit weierstrass curve. - * @param fieldOrder number of field elements, usually CURVE.n - * @returns byte length of field - */ -export declare function getFieldBytesLength(fieldOrder: bigint): number; -/** - * Returns minimal amount of bytes that can be safely reduced - * by field order. - * Should be 2^-128 for 128-bit curve such as P256. - * @param fieldOrder number of field elements, usually CURVE.n - * @returns byte length of target hash - */ -export declare function getMinHashLength(fieldOrder: bigint): number; -/** - * "Constant-time" private key generation utility. - * Can take (n + n/2) or more bytes of uniform input e.g. from CSPRNG or KDF - * and convert them into private scalar, with the modulo bias being negligible. - * Needs at least 48 bytes of input for 32-byte private key. - * https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/ - * FIPS 186-5, A.2 https://csrc.nist.gov/publications/detail/fips/186/5/final - * RFC 9380, https://www.rfc-editor.org/rfc/rfc9380#section-5 - * @param hash hash output from SHA3 or a similar function - * @param groupOrder size of subgroup - (e.g. secp256k1.CURVE.n) - * @param isLE interpret hash bytes as LE num - * @returns valid private scalar - */ -export declare function mapHashToField(key: Uint8Array, fieldOrder: bigint, isLE?: boolean): Uint8Array; -export {}; -//# sourceMappingURL=modular.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/modular.d.ts.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/modular.d.ts.map deleted file mode 100644 index 5f1521eb..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/modular.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"modular.d.ts","sourceRoot":"","sources":["../src/abstract/modular.ts"],"names":[],"mappings":"AAmBA,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAGhD;AACD;;;;;GAKG;AAEH,wBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAUtE;AAGD,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAOrE;AAGD,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAsB7D;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,iCAsDtC;AAED,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,iCA2D/B;AAGD,eAAO,MAAM,YAAY,QAAS,MAAM,UAAU,MAAM,YAAqC,CAAC;AAG9F,MAAM,WAAW,MAAM,CAAC,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI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K,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;AACxE;;;;;;;;;;;GAWG;AACH,wBAAgB,KAAK,CACnB,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,MAAM,EACf,IAAI,UAAQ,EACZ,KAAK,GAAE,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAM,GAClC,QAAQ,CAAC,OAAO,CAAC,CAkDnB;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,KAIjD;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,KAIlD;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,GAAG,UAAU,EACzB,UAAU,EAAE,MAAM,EAClB,IAAI,UAAQ,GACX,MAAM,CAQR;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAI9D;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAG3D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,UAAQ,GAAG,UAAU,CAW5F"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/modular.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/modular.js deleted file mode 100644 index 8da4be4e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/modular.js +++ /dev/null @@ -1,439 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.mapHashToField = exports.getMinHashLength = exports.getFieldBytesLength = exports.hashToPrivateScalar = exports.FpSqrtEven = exports.FpSqrtOdd = exports.Field = exports.nLength = exports.FpIsSquare = exports.FpDiv = exports.FpInvertBatch = exports.FpPow = exports.validateField = exports.isNegativeLE = exports.FpSqrt = exports.tonelliShanks = exports.invert = exports.pow2 = exports.pow = exports.mod = void 0; -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -// Utilities for modular arithmetics and finite fields -const utils_js_1 = require("./utils.js"); -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3); -// prettier-ignore -const _4n = BigInt(4), _5n = BigInt(5), _8n = BigInt(8); -// prettier-ignore -const _9n = BigInt(9), _16n = BigInt(16); -// Calculates a modulo b -function mod(a, b) { - const result = a % b; - return result >= _0n ? result : b + result; -} -exports.mod = mod; -/** - * Efficiently raise num to power and do modular division. - * Unsafe in some contexts: uses ladder, so can expose bigint bits. - * @example - * pow(2n, 6n, 11n) // 64n % 11n == 9n - */ -// TODO: use field version && remove -function pow(num, power, modulo) { - if (modulo <= _0n || power < _0n) - throw new Error('Expected power/modulo > 0'); - if (modulo === _1n) - return _0n; - let res = _1n; - while (power > _0n) { - if (power & _1n) - res = (res * num) % modulo; - num = (num * num) % modulo; - power >>= _1n; - } - return res; -} -exports.pow = pow; -// Does x ^ (2 ^ power) mod p. pow2(30, 4) == 30 ^ (2 ^ 4) -function pow2(x, power, modulo) { - let res = x; - while (power-- > _0n) { - res *= res; - res %= modulo; - } - return res; -} -exports.pow2 = pow2; -// Inverses number over modulo -function invert(number, modulo) { - if (number === _0n || modulo <= _0n) { - throw new Error(`invert: expected positive integers, got n=${number} mod=${modulo}`); - } - // Euclidean GCD https://brilliant.org/wiki/extended-euclidean-algorithm/ - // Fermat's little theorem "CT-like" version inv(n) = n^(m-2) mod m is 30x slower. - let a = mod(number, modulo); - let b = modulo; - // prettier-ignore - let x = _0n, y = _1n, u = _1n, v = _0n; - while (a !== _0n) { - // JIT applies optimization if those two lines follow each other - const q = b / a; - const r = b % a; - const m = x - u * q; - const n = y - v * q; - // prettier-ignore - b = a, a = r, x = u, y = v, u = m, v = n; - } - const gcd = b; - if (gcd !== _1n) - throw new Error('invert: does not exist'); - return mod(x, modulo); -} -exports.invert = invert; -/** - * Tonelli-Shanks square root search algorithm. - * 1. https://eprint.iacr.org/2012/685.pdf (page 12) - * 2. Square Roots from 1; 24, 51, 10 to Dan Shanks - * Will start an infinite loop if field order P is not prime. - * @param P field order - * @returns function that takes field Fp (created from P) and number n - */ -function tonelliShanks(P) { - // Legendre constant: used to calculate Legendre symbol (a | p), - // which denotes the value of a^((p-1)/2) (mod p). - // (a | p) ≡ 1 if a is a square (mod p) - // (a | p) ≡ -1 if a is not a square (mod p) - // (a | p) ≡ 0 if a ≡ 0 (mod p) - const legendreC = (P - _1n) / _2n; - let Q, S, Z; - // Step 1: By factoring out powers of 2 from p - 1, - // find q and s such that p - 1 = q*(2^s) with q odd - for (Q = P - _1n, S = 0; Q % _2n === _0n; Q /= _2n, S++) - ; - // Step 2: Select a non-square z such that (z | p) ≡ -1 and set c ≡ zq - for (Z = _2n; Z < P && pow(Z, legendreC, P) !== P - _1n; Z++) - ; - // Fast-path - if (S === 1) { - const p1div4 = (P + _1n) / _4n; - return function tonelliFast(Fp, n) { - const root = Fp.pow(n, p1div4); - if (!Fp.eql(Fp.sqr(root), n)) - throw new Error('Cannot find square root'); - return root; - }; - } - // Slow-path - const Q1div2 = (Q + _1n) / _2n; - return function tonelliSlow(Fp, n) { - // Step 0: Check that n is indeed a square: (n | p) should not be ≡ -1 - if (Fp.pow(n, legendreC) === Fp.neg(Fp.ONE)) - throw new Error('Cannot find square root'); - let r = S; - // TODO: will fail at Fp2/etc - let g = Fp.pow(Fp.mul(Fp.ONE, Z), Q); // will update both x and b - let x = Fp.pow(n, Q1div2); // first guess at the square root - let b = Fp.pow(n, Q); // first guess at the fudge factor - while (!Fp.eql(b, Fp.ONE)) { - if (Fp.eql(b, Fp.ZERO)) - return Fp.ZERO; // https://en.wikipedia.org/wiki/Tonelli%E2%80%93Shanks_algorithm (4. If t = 0, return r = 0) - // Find m such b^(2^m)==1 - let m = 1; - for (let t2 = Fp.sqr(b); m < r; m++) { - if (Fp.eql(t2, Fp.ONE)) - break; - t2 = Fp.sqr(t2); // t2 *= t2 - } - // NOTE: r-m-1 can be bigger than 32, need to convert to bigint before shift, otherwise there will be overflow - const ge = Fp.pow(g, _1n << BigInt(r - m - 1)); // ge = 2^(r-m-1) - g = Fp.sqr(ge); // g = ge * ge - x = Fp.mul(x, ge); // x *= ge - b = Fp.mul(b, g); // b *= g - r = m; - } - return x; - }; -} -exports.tonelliShanks = tonelliShanks; -function FpSqrt(P) { - // NOTE: different algorithms can give different roots, it is up to user to decide which one they want. - // For example there is FpSqrtOdd/FpSqrtEven to choice root based on oddness (used for hash-to-curve). - // P ≡ 3 (mod 4) - // √n = n^((P+1)/4) - if (P % _4n === _3n) { - // Not all roots possible! - // const ORDER = - // 0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaabn; - // const NUM = 72057594037927816n; - const p1div4 = (P + _1n) / _4n; - return function sqrt3mod4(Fp, n) { - const root = Fp.pow(n, p1div4); - // Throw if root**2 != n - if (!Fp.eql(Fp.sqr(root), n)) - throw new Error('Cannot find square root'); - return root; - }; - } - // Atkin algorithm for q ≡ 5 (mod 8), https://eprint.iacr.org/2012/685.pdf (page 10) - if (P % _8n === _5n) { - const c1 = (P - _5n) / _8n; - return function sqrt5mod8(Fp, n) { - const n2 = Fp.mul(n, _2n); - const v = Fp.pow(n2, c1); - const nv = Fp.mul(n, v); - const i = Fp.mul(Fp.mul(nv, _2n), v); - const root = Fp.mul(nv, Fp.sub(i, Fp.ONE)); - if (!Fp.eql(Fp.sqr(root), n)) - throw new Error('Cannot find square root'); - return root; - }; - } - // P ≡ 9 (mod 16) - if (P % _16n === _9n) { - // NOTE: tonelli is too slow for bls-Fp2 calculations even on start - // Means we cannot use sqrt for constants at all! - // - // const c1 = Fp.sqrt(Fp.negate(Fp.ONE)); // 1. c1 = sqrt(-1) in F, i.e., (c1^2) == -1 in F - // const c2 = Fp.sqrt(c1); // 2. c2 = sqrt(c1) in F, i.e., (c2^2) == c1 in F - // const c3 = Fp.sqrt(Fp.negate(c1)); // 3. c3 = sqrt(-c1) in F, i.e., (c3^2) == -c1 in F - // const c4 = (P + _7n) / _16n; // 4. c4 = (q + 7) / 16 # Integer arithmetic - // sqrt = (x) => { - // let tv1 = Fp.pow(x, c4); // 1. tv1 = x^c4 - // let tv2 = Fp.mul(c1, tv1); // 2. tv2 = c1 * tv1 - // const tv3 = Fp.mul(c2, tv1); // 3. tv3 = c2 * tv1 - // let tv4 = Fp.mul(c3, tv1); // 4. tv4 = c3 * tv1 - // const e1 = Fp.equals(Fp.square(tv2), x); // 5. e1 = (tv2^2) == x - // const e2 = Fp.equals(Fp.square(tv3), x); // 6. e2 = (tv3^2) == x - // tv1 = Fp.cmov(tv1, tv2, e1); // 7. tv1 = CMOV(tv1, tv2, e1) # Select tv2 if (tv2^2) == x - // tv2 = Fp.cmov(tv4, tv3, e2); // 8. tv2 = CMOV(tv4, tv3, e2) # Select tv3 if (tv3^2) == x - // const e3 = Fp.equals(Fp.square(tv2), x); // 9. e3 = (tv2^2) == x - // return Fp.cmov(tv1, tv2, e3); // 10. z = CMOV(tv1, tv2, e3) # Select the sqrt from tv1 and tv2 - // } - } - // Other cases: Tonelli-Shanks algorithm - return tonelliShanks(P); -} -exports.FpSqrt = FpSqrt; -// Little-endian check for first LE bit (last BE bit); -const isNegativeLE = (num, modulo) => (mod(num, modulo) & _1n) === _1n; -exports.isNegativeLE = isNegativeLE; -// prettier-ignore -const FIELD_FIELDS = [ - 'create', 'isValid', 'is0', 'neg', 'inv', 'sqrt', 'sqr', - 'eql', 'add', 'sub', 'mul', 'pow', 'div', - 'addN', 'subN', 'mulN', 'sqrN' -]; -function validateField(field) { - const initial = { - ORDER: 'bigint', - MASK: 'bigint', - BYTES: 'isSafeInteger', - BITS: 'isSafeInteger', - }; - const opts = FIELD_FIELDS.reduce((map, val) => { - map[val] = 'function'; - return map; - }, initial); - return (0, utils_js_1.validateObject)(field, opts); -} -exports.validateField = validateField; -// Generic field functions -/** - * Same as `pow` but for Fp: non-constant-time. - * Unsafe in some contexts: uses ladder, so can expose bigint bits. - */ -function FpPow(f, num, power) { - // Should have same speed as pow for bigints - // TODO: benchmark! - if (power < _0n) - throw new Error('Expected power > 0'); - if (power === _0n) - return f.ONE; - if (power === _1n) - return num; - let p = f.ONE; - let d = num; - while (power > _0n) { - if (power & _1n) - p = f.mul(p, d); - d = f.sqr(d); - power >>= _1n; - } - return p; -} -exports.FpPow = FpPow; -/** - * Efficiently invert an array of Field elements. - * `inv(0)` will return `undefined` here: make sure to throw an error. - */ -function FpInvertBatch(f, nums) { - const tmp = new Array(nums.length); - // Walk from first to last, multiply them by each other MOD p - const lastMultiplied = nums.reduce((acc, num, i) => { - if (f.is0(num)) - return acc; - tmp[i] = acc; - return f.mul(acc, num); - }, f.ONE); - // Invert last element - const inverted = f.inv(lastMultiplied); - // Walk from last to first, multiply them by inverted each other MOD p - nums.reduceRight((acc, num, i) => { - if (f.is0(num)) - return acc; - tmp[i] = f.mul(acc, tmp[i]); - return f.mul(acc, num); - }, inverted); - return tmp; -} -exports.FpInvertBatch = FpInvertBatch; -function FpDiv(f, lhs, rhs) { - return f.mul(lhs, typeof rhs === 'bigint' ? invert(rhs, f.ORDER) : f.inv(rhs)); -} -exports.FpDiv = FpDiv; -// This function returns True whenever the value x is a square in the field F. -function FpIsSquare(f) { - const legendreConst = (f.ORDER - _1n) / _2n; // Integer arithmetic - return (x) => { - const p = f.pow(x, legendreConst); - return f.eql(p, f.ZERO) || f.eql(p, f.ONE); - }; -} -exports.FpIsSquare = FpIsSquare; -// CURVE.n lengths -function nLength(n, nBitLength) { - // Bit size, byte size of CURVE.n - const _nBitLength = nBitLength !== undefined ? nBitLength : n.toString(2).length; - const nByteLength = Math.ceil(_nBitLength / 8); - return { nBitLength: _nBitLength, nByteLength }; -} -exports.nLength = nLength; -/** - * Initializes a finite field over prime. **Non-primes are not supported.** - * Do not init in loop: slow. Very fragile: always run a benchmark on a change. - * Major performance optimizations: - * * a) denormalized operations like mulN instead of mul - * * b) same object shape: never add or remove keys - * * c) Object.freeze - * @param ORDER prime positive bigint - * @param bitLen how many bits the field consumes - * @param isLE (def: false) if encoding / decoding should be in little-endian - * @param redef optional faster redefinitions of sqrt and other methods - */ -function Field(ORDER, bitLen, isLE = false, redef = {}) { - if (ORDER <= _0n) - throw new Error(`Expected Field ORDER > 0, got ${ORDER}`); - const { nBitLength: BITS, nByteLength: BYTES } = nLength(ORDER, bitLen); - if (BYTES > 2048) - throw new Error('Field lengths over 2048 bytes are not supported'); - const sqrtP = FpSqrt(ORDER); - const f = Object.freeze({ - ORDER, - BITS, - BYTES, - MASK: (0, utils_js_1.bitMask)(BITS), - ZERO: _0n, - ONE: _1n, - create: (num) => mod(num, ORDER), - isValid: (num) => { - if (typeof num !== 'bigint') - throw new Error(`Invalid field element: expected bigint, got ${typeof num}`); - return _0n <= num && num < ORDER; // 0 is valid element, but it's not invertible - }, - is0: (num) => num === _0n, - isOdd: (num) => (num & _1n) === _1n, - neg: (num) => mod(-num, ORDER), - eql: (lhs, rhs) => lhs === rhs, - sqr: (num) => mod(num * num, ORDER), - add: (lhs, rhs) => mod(lhs + rhs, ORDER), - sub: (lhs, rhs) => mod(lhs - rhs, ORDER), - mul: (lhs, rhs) => mod(lhs * rhs, ORDER), - pow: (num, power) => FpPow(f, num, power), - div: (lhs, rhs) => mod(lhs * invert(rhs, ORDER), ORDER), - // Same as above, but doesn't normalize - sqrN: (num) => num * num, - addN: (lhs, rhs) => lhs + rhs, - subN: (lhs, rhs) => lhs - rhs, - mulN: (lhs, rhs) => lhs * rhs, - inv: (num) => invert(num, ORDER), - sqrt: redef.sqrt || ((n) => sqrtP(f, n)), - invertBatch: (lst) => FpInvertBatch(f, lst), - // TODO: do we really need constant cmov? - // We don't have const-time bigints anyway, so probably will be not very useful - cmov: (a, b, c) => (c ? b : a), - toBytes: (num) => (isLE ? (0, utils_js_1.numberToBytesLE)(num, BYTES) : (0, utils_js_1.numberToBytesBE)(num, BYTES)), - fromBytes: (bytes) => { - if (bytes.length !== BYTES) - throw new Error(`Fp.fromBytes: expected ${BYTES}, got ${bytes.length}`); - return isLE ? (0, utils_js_1.bytesToNumberLE)(bytes) : (0, utils_js_1.bytesToNumberBE)(bytes); - }, - }); - return Object.freeze(f); -} -exports.Field = Field; -function FpSqrtOdd(Fp, elm) { - if (!Fp.isOdd) - throw new Error(`Field doesn't have isOdd`); - const root = Fp.sqrt(elm); - return Fp.isOdd(root) ? root : Fp.neg(root); -} -exports.FpSqrtOdd = FpSqrtOdd; -function FpSqrtEven(Fp, elm) { - if (!Fp.isOdd) - throw new Error(`Field doesn't have isOdd`); - const root = Fp.sqrt(elm); - return Fp.isOdd(root) ? Fp.neg(root) : root; -} -exports.FpSqrtEven = FpSqrtEven; -/** - * "Constant-time" private key generation utility. - * Same as mapKeyToField, but accepts less bytes (40 instead of 48 for 32-byte field). - * Which makes it slightly more biased, less secure. - * @deprecated use mapKeyToField instead - */ -function hashToPrivateScalar(hash, groupOrder, isLE = false) { - hash = (0, utils_js_1.ensureBytes)('privateHash', hash); - const hashLen = hash.length; - const minLen = nLength(groupOrder).nByteLength + 8; - if (minLen < 24 || hashLen < minLen || hashLen > 1024) - throw new Error(`hashToPrivateScalar: expected ${minLen}-1024 bytes of input, got ${hashLen}`); - const num = isLE ? (0, utils_js_1.bytesToNumberLE)(hash) : (0, utils_js_1.bytesToNumberBE)(hash); - return mod(num, groupOrder - _1n) + _1n; -} -exports.hashToPrivateScalar = hashToPrivateScalar; -/** - * Returns total number of bytes consumed by the field element. - * For example, 32 bytes for usual 256-bit weierstrass curve. - * @param fieldOrder number of field elements, usually CURVE.n - * @returns byte length of field - */ -function getFieldBytesLength(fieldOrder) { - if (typeof fieldOrder !== 'bigint') - throw new Error('field order must be bigint'); - const bitLength = fieldOrder.toString(2).length; - return Math.ceil(bitLength / 8); -} -exports.getFieldBytesLength = getFieldBytesLength; -/** - * Returns minimal amount of bytes that can be safely reduced - * by field order. - * Should be 2^-128 for 128-bit curve such as P256. - * @param fieldOrder number of field elements, usually CURVE.n - * @returns byte length of target hash - */ -function getMinHashLength(fieldOrder) { - const length = getFieldBytesLength(fieldOrder); - return length + Math.ceil(length / 2); -} -exports.getMinHashLength = getMinHashLength; -/** - * "Constant-time" private key generation utility. - * Can take (n + n/2) or more bytes of uniform input e.g. from CSPRNG or KDF - * and convert them into private scalar, with the modulo bias being negligible. - * Needs at least 48 bytes of input for 32-byte private key. - * https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/ - * FIPS 186-5, A.2 https://csrc.nist.gov/publications/detail/fips/186/5/final - * RFC 9380, https://www.rfc-editor.org/rfc/rfc9380#section-5 - * @param hash hash output from SHA3 or a similar function - * @param groupOrder size of subgroup - (e.g. secp256k1.CURVE.n) - * @param isLE interpret hash bytes as LE num - * @returns valid private scalar - */ -function mapHashToField(key, fieldOrder, isLE = false) { - const len = key.length; - const fieldLen = getFieldBytesLength(fieldOrder); - const minLen = getMinHashLength(fieldOrder); - // No small numbers: need to understand bias story. No huge numbers: easier to detect JS timings. - if (len < 16 || len < minLen || len > 1024) - throw new Error(`expected ${minLen}-1024 bytes of input, got ${len}`); - const num = isLE ? (0, utils_js_1.bytesToNumberBE)(key) : (0, utils_js_1.bytesToNumberLE)(key); - // `mod(x, 11)` can sometimes produce 0. `mod(x, 10) + 1` is the same, but no 0 - const reduced = mod(num, fieldOrder - _1n) + _1n; - return isLE ? (0, utils_js_1.numberToBytesLE)(reduced, fieldLen) : (0, utils_js_1.numberToBytesBE)(reduced, fieldLen); -} -exports.mapHashToField = mapHashToField; -//# sourceMappingURL=modular.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/modular.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/modular.js.map deleted file mode 100644 index 451c0e5b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/modular.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"modular.js","sourceRoot":"","sources":["../src/abstract/modular.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,sDAAsD;AACtD,yCAQoB;AACpB,kBAAkB;AAClB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACzE,kBAAkB;AAClB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACxD,kBAAkB;AAClB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;AAEzC,wBAAwB;AACxB,SAAgB,GAAG,CAAC,CAAS,EAAE,CAAS;IACtC,MAAM,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC;IACrB,OAAO,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;AAC7C,CAAC;AAHD,kBAGC;AACD;;;;;GAKG;AACH,oCAAoC;AACpC,SAAgB,GAAG,CAAC,GAAW,EAAE,KAAa,EAAE,MAAc;IAC5D,IAAI,MAAM,IAAI,GAAG,IAAI,KAAK,GAAG,GAAG;QAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;I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AAe,EAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAA,0BAAe,EAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AACxF,CAAC;AAXD,wCAWC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/montgomery.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/montgomery.d.ts deleted file mode 100644 index 69e2bc45..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/montgomery.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -type Hex = string | Uint8Array; -export type CurveType = { - P: bigint; - nByteLength: number; - adjustScalarBytes?: (bytes: Uint8Array) => Uint8Array; - domain?: (data: Uint8Array, ctx: Uint8Array, phflag: boolean) => Uint8Array; - a: bigint; - montgomeryBits: number; - powPminus2?: (x: bigint) => bigint; - xyToU?: (x: bigint, y: bigint) => bigint; - Gu: bigint; - randomBytes?: (bytesLength?: number) => Uint8Array; -}; -export type CurveFn = { - scalarMult: (scalar: Hex, u: Hex) => Uint8Array; - scalarMultBase: (scalar: Hex) => Uint8Array; - getSharedSecret: (privateKeyA: Hex, publicKeyB: Hex) => Uint8Array; - getPublicKey: (privateKey: Hex) => Uint8Array; - utils: { - randomPrivateKey: () => Uint8Array; - }; - GuBytes: Uint8Array; -}; -export declare function montgomery(curveDef: CurveType): CurveFn; -export {}; -//# sourceMappingURL=montgomery.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/montgomery.d.ts.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/montgomery.d.ts.map deleted file mode 100644 index a0d1c0b9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/montgomery.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"montgomery.d.ts","sourceRoot":"","sources":["../src/abstract/montgomery.ts"],"names":[],"mappings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onic-test/node_modules/ethers/node_modules/@noble/curves/abstract/montgomery.js deleted file mode 100644 index b43e43b5..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/montgomery.js +++ /dev/null @@ -1,161 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.montgomery = void 0; -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const modular_js_1 = require("./modular.js"); -const utils_js_1 = require("./utils.js"); -const _0n = BigInt(0); -const _1n = BigInt(1); -function validateOpts(curve) { - (0, utils_js_1.validateObject)(curve, { - a: 'bigint', - }, { - montgomeryBits: 'isSafeInteger', - nByteLength: 'isSafeInteger', - adjustScalarBytes: 'function', - domain: 'function', - powPminus2: 'function', - Gu: 'bigint', - }); - // Set defaults - return Object.freeze({ ...curve }); -} -// NOTE: not really montgomery curve, just bunch of very specific methods for X25519/X448 (RFC 7748, https://www.rfc-editor.org/rfc/rfc7748) -// Uses only one coordinate instead of two -function montgomery(curveDef) { - const CURVE = validateOpts(curveDef); - const { P } = CURVE; - const modP = (n) => (0, modular_js_1.mod)(n, P); - const montgomeryBits = CURVE.montgomeryBits; - const montgomeryBytes = Math.ceil(montgomeryBits / 8); - const fieldLen = CURVE.nByteLength; - const adjustScalarBytes = CURVE.adjustScalarBytes || ((bytes) => bytes); - const powPminus2 = CURVE.powPminus2 || ((x) => (0, modular_js_1.pow)(x, P - BigInt(2), P)); - // cswap from RFC7748. But it is not from RFC7748! - /* - cswap(swap, x_2, x_3): - dummy = mask(swap) AND (x_2 XOR x_3) - x_2 = x_2 XOR dummy - x_3 = x_3 XOR dummy - Return (x_2, x_3) - Where mask(swap) is the all-1 or all-0 word of the same length as x_2 - and x_3, computed, e.g., as mask(swap) = 0 - swap. - */ - function cswap(swap, x_2, x_3) { - const dummy = modP(swap * (x_2 - x_3)); - x_2 = modP(x_2 - dummy); - x_3 = modP(x_3 + dummy); - return [x_2, x_3]; - } - // Accepts 0 as well - function assertFieldElement(n) { - if (typeof n === 'bigint' && _0n <= n && n < P) - return n; - throw new Error('Expected valid scalar 0 < scalar < CURVE.P'); - } - // x25519 from 4 - // The constant a24 is (486662 - 2) / 4 = 121665 for curve25519/X25519 - const a24 = (CURVE.a - BigInt(2)) / BigInt(4); - /** - * - * @param pointU u coordinate (x) on Montgomery Curve 25519 - * @param scalar by which the point would be multiplied - * @returns new Point on Montgomery curve - */ - function montgomeryLadder(pointU, scalar) { - const u = assertFieldElement(pointU); - // Section 5: Implementations MUST accept non-canonical values and process them as - // if they had been reduced modulo the field prime. - const k = assertFieldElement(scalar); - const x_1 = u; - let x_2 = _1n; - let z_2 = _0n; - let x_3 = u; - let z_3 = _1n; - let swap = _0n; - let sw; - for (let t = BigInt(montgomeryBits - 1); t >= _0n; t--) { - const k_t = (k >> t) & _1n; - swap ^= k_t; - sw = cswap(swap, x_2, x_3); - x_2 = sw[0]; - x_3 = sw[1]; - sw = cswap(swap, z_2, z_3); - z_2 = sw[0]; - z_3 = sw[1]; - swap = k_t; - const A = x_2 + z_2; - const AA = modP(A * A); - const B = x_2 - z_2; - const BB = modP(B * B); - const E = AA - BB; - const C = x_3 + z_3; - const D = x_3 - z_3; - const DA = modP(D * A); - const CB = modP(C * B); - const dacb = DA + CB; - const da_cb = DA - CB; - x_3 = modP(dacb * dacb); - z_3 = modP(x_1 * modP(da_cb * da_cb)); - x_2 = modP(AA * BB); - z_2 = modP(E * (AA + modP(a24 * E))); - } - // (x_2, x_3) = cswap(swap, x_2, x_3) - sw = cswap(swap, x_2, x_3); - x_2 = sw[0]; - x_3 = sw[1]; - // (z_2, z_3) = cswap(swap, z_2, z_3) - sw = cswap(swap, z_2, z_3); - z_2 = sw[0]; - z_3 = sw[1]; - // z_2^(p - 2) - const z2 = powPminus2(z_2); - // Return x_2 * (z_2^(p - 2)) - return modP(x_2 * z2); - } - function encodeUCoordinate(u) { - return (0, utils_js_1.numberToBytesLE)(modP(u), montgomeryBytes); - } - function decodeUCoordinate(uEnc) { - // Section 5: When receiving such an array, implementations of X25519 - // MUST mask the most significant bit in the final byte. - // This is very ugly way, but it works because fieldLen-1 is outside of bounds for X448, so this becomes NOOP - // fieldLen - scalaryBytes = 1 for X448 and = 0 for X25519 - const u = (0, utils_js_1.ensureBytes)('u coordinate', uEnc, montgomeryBytes); - // u[fieldLen-1] crashes QuickJS (TypeError: out-of-bound numeric index) - if (fieldLen === montgomeryBytes) - u[fieldLen - 1] &= 127; // 0b0111_1111 - return (0, utils_js_1.bytesToNumberLE)(u); - } - function decodeScalar(n) { - const bytes = (0, utils_js_1.ensureBytes)('scalar', n); - if (bytes.length !== montgomeryBytes && bytes.length !== fieldLen) - throw new Error(`Expected ${montgomeryBytes} or ${fieldLen} bytes, got ${bytes.length}`); - return (0, utils_js_1.bytesToNumberLE)(adjustScalarBytes(bytes)); - } - function scalarMult(scalar, u) { - const pointU = decodeUCoordinate(u); - const _scalar = decodeScalar(scalar); - const pu = montgomeryLadder(pointU, _scalar); - // The result was not contributory - // https://cr.yp.to/ecdh.html#validate - if (pu === _0n) - throw new Error('Invalid private or public key received'); - return encodeUCoordinate(pu); - } - // Computes public key from private. By doing scalar multiplication of base point. - const GuBytes = encodeUCoordinate(CURVE.Gu); - function scalarMultBase(scalar) { - return scalarMult(scalar, GuBytes); - } - return { - scalarMult, - scalarMultBase, - getSharedSecret: (privateKey, publicKey) => scalarMult(privateKey, publicKey), - getPublicKey: (privateKey) => scalarMultBase(privateKey), - utils: { randomPrivateKey: () => CURVE.randomBytes(CURVE.nByteLength) }, - GuBytes: GuBytes, - }; -} -exports.montgomery = montgomery; -//# sourceMappingURL=montgomery.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/montgomery.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/montgomery.js.map deleted file mode 100644 index 1aa0c9eb..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/montgomery.js.map +++ /dev/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C;QACzE,KAAK,EAAE,EAAE,gBAAgB,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,WAAY,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE;QACxE,OAAO,EAAE,OAAO;KACjB,CAAC;AACJ,CAAC;AA1ID,gCA0IC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/poseidon.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/poseidon.d.ts deleted file mode 100644 index 2f9ab819..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/poseidon.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { IField } from './modular.js'; -export type PoseidonOpts = { - Fp: IField; - t: number; - roundsFull: number; - roundsPartial: number; - sboxPower?: number; - reversePartialPowIdx?: boolean; - mds: bigint[][]; - roundConstants: bigint[][]; -}; -export declare function validateOpts(opts: PoseidonOpts): Readonly<{ - rounds: number; - sboxFn: (n: bigint) => bigint; - roundConstants: bigint[][]; - mds: bigint[][]; - Fp: IField; - t: number; - roundsFull: number; - roundsPartial: number; - sboxPower?: number | undefined; - reversePartialPowIdx?: boolean | undefined; -}>; -export declare function splitConstants(rc: bigint[], t: number): bigint[][]; -export declare function poseidon(opts: PoseidonOpts): { - (values: bigint[]): bigint[]; - roundConstants: bigint[][]; -}; -//# sourceMappingURL=poseidon.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/poseidon.d.ts.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/poseidon.d.ts.map deleted file mode 100644 index 8c0593d2..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/poseidon.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"poseidon.d.ts","sourceRoot":"","sources":["../src/abstract/poseidon.ts"],"names":[],"mappings":"AAAA,sEAAsE;AAEtE,OAAO,EAAE,MAAM,EAAwB,MAAM,cAAc,CAAC;AAG5D,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACnB,CAAC,EAAE,MAAM,CAAC;IACV,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC;IAChB,cAAc,EAAE,MAAM,EAAE,EAAE,CAAC;CAC5B,CAAC;AAEF,wBAAgB,YAAY,CAAC,IAAI,EAAE,YAAY;;gBA0C5B,MAAM;;;;;;;;;GAMxB;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,cAarD;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,YAAY;aAcU,MAAM,EAAE;;EAsB5D"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/poseidon.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/poseidon.js deleted file mode 100644 index c10f971a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/poseidon.js +++ /dev/null @@ -1,114 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.poseidon = exports.splitConstants = exports.validateOpts = void 0; -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -// Poseidon Hash: https://eprint.iacr.org/2019/458.pdf, https://www.poseidon-hash.info -const modular_js_1 = require("./modular.js"); -function validateOpts(opts) { - const { Fp, mds, reversePartialPowIdx: rev, roundConstants: rc } = opts; - const { roundsFull, roundsPartial, sboxPower, t } = opts; - (0, modular_js_1.validateField)(Fp); - for (const i of ['t', 'roundsFull', 'roundsPartial']) { - if (typeof opts[i] !== 'number' || !Number.isSafeInteger(opts[i])) - throw new Error(`Poseidon: invalid param ${i}=${opts[i]} (${typeof opts[i]})`); - } - // MDS is TxT matrix - if (!Array.isArray(mds) || mds.length !== t) - throw new Error('Poseidon: wrong MDS matrix'); - const _mds = mds.map((mdsRow) => { - if (!Array.isArray(mdsRow) || mdsRow.length !== t) - throw new Error(`Poseidon MDS matrix row: ${mdsRow}`); - return mdsRow.map((i) => { - if (typeof i !== 'bigint') - throw new Error(`Poseidon MDS matrix value=${i}`); - return Fp.create(i); - }); - }); - if (rev !== undefined && typeof rev !== 'boolean') - throw new Error(`Poseidon: invalid param reversePartialPowIdx=${rev}`); - if (roundsFull % 2 !== 0) - throw new Error(`Poseidon roundsFull is not even: ${roundsFull}`); - const rounds = roundsFull + roundsPartial; - if (!Array.isArray(rc) || rc.length !== rounds) - throw new Error('Poseidon: wrong round constants'); - const roundConstants = rc.map((rc) => { - if (!Array.isArray(rc) || rc.length !== t) - throw new Error(`Poseidon wrong round constants: ${rc}`); - return rc.map((i) => { - if (typeof i !== 'bigint' || !Fp.isValid(i)) - throw new Error(`Poseidon wrong round constant=${i}`); - return Fp.create(i); - }); - }); - if (!sboxPower || ![3, 5, 7].includes(sboxPower)) - throw new Error(`Poseidon wrong sboxPower=${sboxPower}`); - const _sboxPower = BigInt(sboxPower); - let sboxFn = (n) => (0, modular_js_1.FpPow)(Fp, n, _sboxPower); - // Unwrapped sbox power for common cases (195->142μs) - if (sboxPower === 3) - sboxFn = (n) => Fp.mul(Fp.sqrN(n), n); - else if (sboxPower === 5) - sboxFn = (n) => Fp.mul(Fp.sqrN(Fp.sqrN(n)), n); - return Object.freeze({ ...opts, rounds, sboxFn, roundConstants, mds: _mds }); -} -exports.validateOpts = validateOpts; -function splitConstants(rc, t) { - if (typeof t !== 'number') - throw new Error('poseidonSplitConstants: wrong t'); - if (!Array.isArray(rc) || rc.length % t) - throw new Error('poseidonSplitConstants: wrong rc'); - const res = []; - let tmp = []; - for (let i = 0; i < rc.length; i++) { - tmp.push(rc[i]); - if (tmp.length === t) { - res.push(tmp); - tmp = []; - } - } - return res; -} -exports.splitConstants = splitConstants; -function poseidon(opts) { - const _opts = validateOpts(opts); - const { Fp, mds, roundConstants, rounds, roundsPartial, sboxFn, t } = _opts; - const halfRoundsFull = _opts.roundsFull / 2; - const partialIdx = _opts.reversePartialPowIdx ? t - 1 : 0; - const poseidonRound = (values, isFull, idx) => { - values = values.map((i, j) => Fp.add(i, roundConstants[idx][j])); - if (isFull) - values = values.map((i) => sboxFn(i)); - else - values[partialIdx] = sboxFn(values[partialIdx]); - // Matrix multiplication - values = mds.map((i) => i.reduce((acc, i, j) => Fp.add(acc, Fp.mulN(i, values[j])), Fp.ZERO)); - return values; - }; - const poseidonHash = function poseidonHash(values) { - if (!Array.isArray(values) || values.length !== t) - throw new Error(`Poseidon: wrong values (expected array of bigints with length ${t})`); - values = values.map((i) => { - if (typeof i !== 'bigint') - throw new Error(`Poseidon: wrong value=${i} (${typeof i})`); - return Fp.create(i); - }); - let round = 0; - // Apply r_f/2 full rounds. - for (let i = 0; i < halfRoundsFull; i++) - values = poseidonRound(values, true, round++); - // Apply r_p partial rounds. - for (let i = 0; i < roundsPartial; i++) - values = poseidonRound(values, false, round++); - // Apply r_f/2 full rounds. - for (let i = 0; i < halfRoundsFull; i++) - values = poseidonRound(values, true, round++); - if (round !== rounds) - throw new Error(`Poseidon: wrong number of rounds: last round=${round}, total=${rounds}`); - return values; - }; - // For verification in tests - poseidonHash.roundConstants = roundConstants; - return poseidonHash; -} -exports.poseidon = poseidon; -//# sourceMappingURL=poseidon.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/poseidon.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/poseidon.js.map deleted file mode 100644 index 923cc06e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/poseidon.js.map +++ /dev/null @@ -1 +0,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B,MAAM,IAAI,KAAK,CAAC,gDAAgD,KAAK,WAAW,MAAM,EAAE,CAAC,CAAC;QAC5F,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;IACF,4BAA4B;IAC5B,YAAY,CAAC,cAAc,GAAG,cAAc,CAAC;IAC7C,OAAO,YAAY,CAAC;AACtB,CAAC;AApCD,4BAoCC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/utils.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/utils.d.ts deleted file mode 100644 index f3fa2530..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/utils.d.ts +++ /dev/null @@ -1,92 +0,0 @@ -export type Hex = Uint8Array | string; -export type PrivKey = Hex | bigint; -export type CHash = { - (message: Uint8Array | string): Uint8Array; - blockLen: number; - outputLen: number; - create(opts?: { - dkLen?: number; - }): any; -}; -export type FHash = (message: Uint8Array | string) => Uint8Array; -/** - * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123' - */ -export declare function bytesToHex(bytes: Uint8Array): string; -export declare function numberToHexUnpadded(num: number | bigint): string; -export declare function hexToNumber(hex: string): bigint; -/** - * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23]) - */ -export declare function hexToBytes(hex: string): Uint8Array; -export declare function bytesToNumberBE(bytes: Uint8Array): bigint; -export declare function bytesToNumberLE(bytes: Uint8Array): bigint; -export declare function numberToBytesBE(n: number | bigint, len: number): Uint8Array; -export declare function numberToBytesLE(n: number | bigint, len: number): Uint8Array; -export declare function numberToVarBytesBE(n: number | bigint): Uint8Array; -/** - * Takes hex string or Uint8Array, converts to Uint8Array. - * Validates output length. - * Will throw error for other types. - * @param title descriptive title for an error e.g. 'private key' - * @param hex hex string or Uint8Array - * @param expectedLength optional, will compare to result array's length - * @returns - */ -export declare function ensureBytes(title: string, hex: Hex, expectedLength?: number): Uint8Array; -/** - * Copies several Uint8Arrays into one. - */ -export declare function concatBytes(...arrays: Uint8Array[]): Uint8Array; -export declare function equalBytes(b1: Uint8Array, b2: Uint8Array): boolean; -/** - * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99]) - */ -export declare function utf8ToBytes(str: string): Uint8Array; -/** - * Calculates amount of bits in a bigint. - * Same as `n.toString(2).length` - */ -export declare function bitLen(n: bigint): number; -/** - * Gets single bit at position. - * NOTE: first bit position is 0 (same as arrays) - * Same as `!!+Array.from(n.toString(2)).reverse()[pos]` - */ -export declare function bitGet(n: bigint, pos: number): bigint; -/** - * Sets single bit at position. - */ -export declare const bitSet: (n: bigint, pos: number, value: boolean) => bigint; -/** - * Calculate mask for N bits. Not using ** operator with bigints because of old engines. - * Same as BigInt(`0b${Array(i).fill('1').join('')}`) - */ -export declare const bitMask: (n: number) => bigint; -type Pred = (v: Uint8Array) => T | undefined; -/** - * Minimal HMAC-DRBG from NIST 800-90 for RFC6979 sigs. - * @returns function that will call DRBG until 2nd arg returns something meaningful - * @example - * const drbg = createHmacDRBG(32, 32, hmac); - * drbg(seed, bytesToKey); // bytesToKey must return Key or undefined - */ -export declare function createHmacDrbg(hashLen: number, qByteLen: number, hmacFn: (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array): (seed: Uint8Array, predicate: Pred) => T; -declare const validatorFns: { - readonly bigint: (val: any) => boolean; - readonly function: (val: any) => boolean; - readonly boolean: (val: any) => boolean; - readonly string: (val: any) => boolean; - readonly stringOrUint8Array: (val: any) => boolean; - readonly isSafeInteger: (val: any) => boolean; - readonly array: (val: any) => boolean; - readonly field: (val: any, object: any) => any; - readonly hash: (val: any) => boolean; -}; -type Validator = keyof typeof validatorFns; -type ValMap> = { - [K in keyof T]?: Validator; -}; -export declare function validateObject>(object: T, validators: ValMap, optValidators?: ValMap): T; -export {}; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/utils.d.ts.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/utils.d.ts.map deleted file mode 100644 index bc747ed2..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/abstract/utils.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,GAAG,GAAG,UAAU,GAAG,MAAM,CAAC;AACtC,MAAM,MAAM,OAAO,GAAG,GAAG,GAAG,MAAM,CAAC;AACnC,MAAM,MAAM,KAAK,GAAG;IAClB,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,GAAG,UAAU,CAAC;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,GAAG,CAAC;CACxC,CAAC;AACF,MAAM,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,KAAK,UAAU,CAAC;AAKjE;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAQpD;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAGhE;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAI/C;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAalD;AAGD,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAEzD;AACD,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAGzD;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,UAAU,CAE3E;AACD,wBAAgB,eAAe,C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GAAG;6BACD,GAAG;4BACJ,GAAG;2BACJ,GAAG;uCACS,GAAG;kCACR,GAAG;0BACX,GAAG;0BACH,GAAG,UAAU,GAAG;yBACjB,GAAG;CACP,CAAC;AACX,KAAK,SAAS,GAAG,MAAM,OAAO,YAAY,CAAC;AAC3C,KAAK,MAAM,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,SAAS;CAAE,CAAC;AAG5E,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1D,MAAM,EAAE,CAAC,EACT,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,EACrB,aAAa,GAAE,MAAM,CAAC,CAAC,CAAM,KAkB9B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/utils.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/utils.js deleted file mode 100644 index 8a801baa..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/utils.js +++ /dev/null @@ -1,288 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.validateObject = exports.createHmacDrbg = exports.bitMask = exports.bitSet = exports.bitGet = exports.bitLen = exports.utf8ToBytes = exports.equalBytes = exports.concatBytes = exports.ensureBytes = exports.numberToVarBytesBE = exports.numberToBytesLE = exports.numberToBytesBE = exports.bytesToNumberLE = exports.bytesToNumberBE = exports.hexToBytes = exports.hexToNumber = exports.numberToHexUnpadded = exports.bytesToHex = void 0; -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -// 100 lines of code in the file are duplicated from noble-hashes (utils). -// This is OK: `abstract` directory does not use noble-hashes. -// User may opt-in into using different hashing library. This way, noble-hashes -// won't be included into their bundle. -const _0n = BigInt(0); -const _1n = BigInt(1); -const _2n = BigInt(2); -const u8a = (a) => a instanceof Uint8Array; -const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0')); -/** - * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123' - */ -function bytesToHex(bytes) { - if (!u8a(bytes)) - throw new Error('Uint8Array expected'); - // pre-caching improves the speed 6x - let hex = ''; - for (let i = 0; i < bytes.length; i++) { - hex += hexes[bytes[i]]; - } - return hex; -} -exports.bytesToHex = bytesToHex; -function numberToHexUnpadded(num) { - const hex = num.toString(16); - return hex.length & 1 ? `0${hex}` : hex; -} -exports.numberToHexUnpadded = numberToHexUnpadded; -function hexToNumber(hex) { - if (typeof hex !== 'string') - throw new Error('hex string expected, got ' + typeof hex); - // Big Endian - return BigInt(hex === '' ? '0' : `0x${hex}`); -} -exports.hexToNumber = hexToNumber; -/** - * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23]) - */ -function hexToBytes(hex) { - if (typeof hex !== 'string') - throw new Error('hex string expected, got ' + typeof hex); - const len = hex.length; - if (len % 2) - throw new Error('padded hex string expected, got unpadded hex of length ' + len); - const array = new Uint8Array(len / 2); - for (let i = 0; i < array.length; i++) { - const j = i * 2; - const hexByte = hex.slice(j, j + 2); - const byte = Number.parseInt(hexByte, 16); - if (Number.isNaN(byte) || byte < 0) - throw new Error('Invalid byte sequence'); - array[i] = byte; - } - return array; -} -exports.hexToBytes = hexToBytes; -// BE: Big Endian, LE: Little Endian -function bytesToNumberBE(bytes) { - return hexToNumber(bytesToHex(bytes)); -} -exports.bytesToNumberBE = bytesToNumberBE; -function bytesToNumberLE(bytes) { - if (!u8a(bytes)) - throw new Error('Uint8Array expected'); - return hexToNumber(bytesToHex(Uint8Array.from(bytes).reverse())); -} -exports.bytesToNumberLE = bytesToNumberLE; -function numberToBytesBE(n, len) { - return hexToBytes(n.toString(16).padStart(len * 2, '0')); -} -exports.numberToBytesBE = numberToBytesBE; -function numberToBytesLE(n, len) { - return numberToBytesBE(n, len).reverse(); -} -exports.numberToBytesLE = numberToBytesLE; -// Unpadded, rarely used -function numberToVarBytesBE(n) { - return hexToBytes(numberToHexUnpadded(n)); -} -exports.numberToVarBytesBE = numberToVarBytesBE; -/** - * Takes hex string or Uint8Array, converts to Uint8Array. - * Validates output length. - * Will throw error for other types. - * @param title descriptive title for an error e.g. 'private key' - * @param hex hex string or Uint8Array - * @param expectedLength optional, will compare to result array's length - * @returns - */ -function ensureBytes(title, hex, expectedLength) { - let res; - if (typeof hex === 'string') { - try { - res = hexToBytes(hex); - } - catch (e) { - throw new Error(`${title} must be valid hex string, got "${hex}". Cause: ${e}`); - } - } - else if (u8a(hex)) { - // Uint8Array.from() instead of hash.slice() because node.js Buffer - // is instance of Uint8Array, and its slice() creates **mutable** copy - res = Uint8Array.from(hex); - } - else { - throw new Error(`${title} must be hex string or Uint8Array`); - } - const len = res.length; - if (typeof expectedLength === 'number' && len !== expectedLength) - throw new Error(`${title} expected ${expectedLength} bytes, got ${len}`); - return res; -} -exports.ensureBytes = ensureBytes; -/** - * Copies several Uint8Arrays into one. - */ -function concatBytes(...arrays) { - const r = new Uint8Array(arrays.reduce((sum, a) => sum + a.length, 0)); - let pad = 0; // walk through each item, ensure they have proper type - arrays.forEach((a) => { - if (!u8a(a)) - throw new Error('Uint8Array expected'); - r.set(a, pad); - pad += a.length; - }); - return r; -} -exports.concatBytes = concatBytes; -function equalBytes(b1, b2) { - // We don't care about timing attacks here - if (b1.length !== b2.length) - return false; - for (let i = 0; i < b1.length; i++) - if (b1[i] !== b2[i]) - return false; - return true; -} -exports.equalBytes = equalBytes; -/** - * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99]) - */ -function utf8ToBytes(str) { - if (typeof str !== 'string') - throw new Error(`utf8ToBytes expected string, got ${typeof str}`); - return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809 -} -exports.utf8ToBytes = utf8ToBytes; -// Bit operations -/** - * Calculates amount of bits in a bigint. - * Same as `n.toString(2).length` - */ -function bitLen(n) { - let len; - for (len = 0; n > _0n; n >>= _1n, len += 1) - ; - return len; -} -exports.bitLen = bitLen; -/** - * Gets single bit at position. - * NOTE: first bit position is 0 (same as arrays) - * Same as `!!+Array.from(n.toString(2)).reverse()[pos]` - */ -function bitGet(n, pos) { - return (n >> BigInt(pos)) & _1n; -} -exports.bitGet = bitGet; -/** - * Sets single bit at position. - */ -const bitSet = (n, pos, value) => { - return n | ((value ? _1n : _0n) << BigInt(pos)); -}; -exports.bitSet = bitSet; -/** - * Calculate mask for N bits. Not using ** operator with bigints because of old engines. - * Same as BigInt(`0b${Array(i).fill('1').join('')}`) - */ -const bitMask = (n) => (_2n << BigInt(n - 1)) - _1n; -exports.bitMask = bitMask; -// DRBG -const u8n = (data) => new Uint8Array(data); // creates Uint8Array -const u8fr = (arr) => Uint8Array.from(arr); // another shortcut -/** - * Minimal HMAC-DRBG from NIST 800-90 for RFC6979 sigs. - * @returns function that will call DRBG until 2nd arg returns something meaningful - * @example - * const drbg = createHmacDRBG(32, 32, hmac); - * drbg(seed, bytesToKey); // bytesToKey must return Key or undefined - */ -function createHmacDrbg(hashLen, qByteLen, hmacFn) { - if (typeof hashLen !== 'number' || hashLen < 2) - throw new Error('hashLen must be a number'); - if (typeof qByteLen !== 'number' || qByteLen < 2) - throw new Error('qByteLen must be a number'); - if (typeof hmacFn !== 'function') - throw new Error('hmacFn must be a function'); - // Step B, Step C: set hashLen to 8*ceil(hlen/8) - let v = u8n(hashLen); // Minimal non-full-spec HMAC-DRBG from NIST 800-90 for RFC6979 sigs. - let k = u8n(hashLen); // Steps B and C of RFC6979 3.2: set hashLen, in our case always same - let i = 0; // Iterations counter, will throw when over 1000 - const reset = () => { - v.fill(1); - k.fill(0); - i = 0; - }; - const h = (...b) => hmacFn(k, v, ...b); // hmac(k)(v, ...values) - const reseed = (seed = u8n()) => { - // HMAC-DRBG reseed() function. Steps D-G - k = h(u8fr([0x00]), seed); // k = hmac(k || v || 0x00 || seed) - v = h(); // v = hmac(k || v) - if (seed.length === 0) - return; - k = h(u8fr([0x01]), seed); // k = hmac(k || v || 0x01 || seed) - v = h(); // v = hmac(k || v) - }; - const gen = () => { - // HMAC-DRBG generate() function - if (i++ >= 1000) - throw new Error('drbg: tried 1000 values'); - let len = 0; - const out = []; - while (len < qByteLen) { - v = h(); - const sl = v.slice(); - out.push(sl); - len += v.length; - } - return concatBytes(...out); - }; - const genUntil = (seed, pred) => { - reset(); - reseed(seed); // Steps D-G - let res = undefined; // Step H: grind until k is in [1..n-1] - while (!(res = pred(gen()))) - reseed(); - reset(); - return res; - }; - return genUntil; -} -exports.createHmacDrbg = createHmacDrbg; -// Validating curves and fields -const validatorFns = { - bigint: (val) => typeof val === 'bigint', - function: (val) => typeof val === 'function', - boolean: (val) => typeof val === 'boolean', - string: (val) => typeof val === 'string', - stringOrUint8Array: (val) => typeof val === 'string' || val instanceof Uint8Array, - isSafeInteger: (val) => Number.isSafeInteger(val), - array: (val) => Array.isArray(val), - field: (val, object) => object.Fp.isValid(val), - hash: (val) => typeof val === 'function' && Number.isSafeInteger(val.outputLen), -}; -// type Record = { [P in K]: T; } -function validateObject(object, validators, optValidators = {}) { - const checkField = (fieldName, type, isOptional) => { - const checkVal = validatorFns[type]; - if (typeof checkVal !== 'function') - throw new Error(`Invalid validator "${type}", expected function`); - const val = object[fieldName]; - if (isOptional && val === undefined) - return; - if (!checkVal(val, object)) { - throw new Error(`Invalid param ${String(fieldName)}=${val} (${typeof val}), expected ${type}`); - } - }; - for (const [fieldName, type] of Object.entries(validators)) - checkField(fieldName, type, false); - for (const [fieldName, type] of Object.entries(optValidators)) - checkField(fieldName, type, true); - return object; -} -exports.validateObject = validateObject; -// validate type tests -// const o: { a: number; b: number; c: number } = { a: 1, b: 5, c: 6 }; -// const z0 = validateObject(o, { a: 'isSafeInteger' }, { c: 'bigint' }); // Ok! -// // Should fail type-check -// const z1 = validateObject(o, { a: 'tmp' }, { c: 'zz' }); -// const z2 = validateObject(o, { a: 'isSafeInteger' }, { c: 'zz' }); -// const z3 = validateObject(o, { test: 'boolean', z: 'bug' }); -// const z4 = validateObject(o, { a: 'boolean', z: 'bug' }); -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/utils.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/utils.js.map deleted file mode 100644 index 56f36c89..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/abstract/utils.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,0EAA0E;AAC1E,8DAA8D;AAC9D,+EAA+E;AAC/E,uCAAuC;AACvC,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,CAAC,CAAM,EAAmB,EAAE,CAAC,CAAC,YAAY,UAAU,CAAC;AAWjE,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACjE,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAChC,CAAC;AACF;;GAEG;AACH,SAAgB,UAAU,CAAC,KAAiB;IAC1C,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;IACxD,oCAAoC;IACpC,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,M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ools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/weierstrass.d.ts deleted file mode 100644 index 9de89e22..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/weierstrass.d.ts +++ /dev/null @@ -1,241 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import * as mod from './modular.js'; -import * as ut from './utils.js'; -import { CHash, Hex, PrivKey } from './utils.js'; -import { Group, GroupConstructor, BasicCurve, AffinePoint } from './curve.js'; -export type { AffinePoint }; -type HmacFnSync = (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array; -type EndomorphismOpts = { - beta: bigint; - splitScalar: (k: bigint) => { - k1neg: boolean; - k1: bigint; - k2neg: boolean; - k2: bigint; - }; -}; -export type BasicWCurve = BasicCurve & { - a: T; - b: T; - allowedPrivateKeyLengths?: readonly number[]; - wrapPrivateKey?: boolean; - endo?: EndomorphismOpts; - isTorsionFree?: (c: ProjConstructor, point: ProjPointType) => boolean; - clearCofactor?: (c: ProjConstructor, point: ProjPointType) => ProjPointType; -}; -type Entropy = Hex | true; -export type SignOpts = { - lowS?: boolean; - extraEntropy?: Entropy; - prehash?: boolean; -}; -export type VerOpts = { - lowS?: boolean; - prehash?: boolean; -}; -/** - * ### Design rationale for types - * - * * Interaction between classes from different curves should fail: - * `k256.Point.BASE.add(p256.Point.BASE)` - * * For this purpose we want to use `instanceof` operator, which is fast and works during runtime - * * Different calls of `curve()` would return different classes - - * `curve(params) !== curve(params)`: if somebody decided to monkey-patch their curve, - * it won't affect others - * - * TypeScript can't infer types for classes created inside a function. Classes is one instance of nominative types in TypeScript and interfaces only check for shape, so it's hard to create unique type for every function call. - * - * We can use generic types via some param, like curve opts, but that would: - * 1. Enable interaction between `curve(params)` and `curve(params)` (curves of same params) - * which is hard to debug. - * 2. Params can be generic and we can't enforce them to be constant value: - * if somebody creates curve from non-constant params, - * it would be allowed to interact with other curves with non-constant params - * - * TODO: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html#unique-symbol - */ -export interface ProjPointType extends Group> { - readonly px: T; - readonly py: T; - readonly pz: T; - get x(): T; - get y(): T; - multiply(scalar: bigint): ProjPointType; - toAffine(iz?: T): AffinePoint; - isTorsionFree(): boolean; - clearCofactor(): ProjPointType; - assertValidity(): void; - hasEvenY(): boolean; - toRawBytes(isCompressed?: boolean): Uint8Array; - toHex(isCompressed?: boolean): string; - multiplyUnsafe(scalar: bigint): ProjPointType; - multiplyAndAddUnsafe(Q: ProjPointType, a: bigint, b: bigint): ProjPointType | undefined; - _setWindowSize(windowSize: number): void; -} -export interface ProjConstructor extends GroupConstructor> { - new (x: T, y: T, z: T): ProjPointType; - fromAffine(p: AffinePoint): ProjPointType; - fromHex(hex: Hex): ProjPointType; - fromPrivateKey(privateKey: PrivKey): ProjPointType; - normalizeZ(points: ProjPointType[]): ProjPointType[]; -} -export type CurvePointsType = BasicWCurve & { - fromBytes?: (bytes: Uint8Array) => AffinePoint; - toBytes?: (c: ProjConstructor, point: ProjPointType, isCompressed: boolean) => Uint8Array; -}; -export type CurvePointsRes = { - ProjectivePoint: ProjConstructor; - normPrivateKeyToScalar: (key: PrivKey) => bigint; - weierstrassEquation: (x: T) => T; - isWithinCurveOrder: (num: bigint) => boolean; -}; -export declare const DER: { - Err: { - new (m?: string): { - name: string; - message: string; - stack?: string | undefined; - }; - }; - _parseInt(data: Uint8Array): { - d: bigint; - l: Uint8Array; - }; - toSig(hex: string | Uint8Array): { - r: bigint; - s: bigint; - }; - hexFromSig(sig: { - r: bigint; - s: bigint; - }): string; -}; -export declare function weierstrassPoints(opts: CurvePointsType): { - CURVE: Readonly<{ - readonly nBitLength: number; - readonly nByteLength: number; - readonly Fp: mod.IField; - readonly n: bigint; - readonly h: bigint; - readonly hEff?: bigint | undefined; - readonly Gx: T; - readonly Gy: T; - readonly allowInfinityPoint?: boolean | undefined; - readonly a: T; - readonly b: T; - readonly allowedPrivateKeyLengths?: readonly number[] | undefined; - readonly wrapPrivateKey?: boolean | undefined; - readonly endo?: EndomorphismOpts | undefined; - readonly isTorsionFree?: ((c: ProjConstructor, point: ProjPointType) => boolean) | undefined; - readonly clearCofactor?: ((c: ProjConstructor, point: ProjPointType) => ProjPointType) | undefined; - readonly fromBytes?: ((bytes: Uint8Array) => AffinePoint) | undefined; - readonly toBytes?: ((c: ProjConstructor, point: ProjPointType, isCompressed: boolean) => Uint8Array) | undefined; - readonly p: bigint; - }>; - ProjectivePoint: ProjConstructor; - normPrivateKeyToScalar: (key: PrivKey) => bigint; - weierstrassEquation: (x: T) => T; - isWithinCurveOrder: (num: bigint) => boolean; -}; -export interface SignatureType { - readonly r: bigint; - readonly s: bigint; - readonly recovery?: number; - assertValidity(): void; - addRecoveryBit(recovery: number): RecoveredSignatureType; - hasHighS(): boolean; - normalizeS(): SignatureType; - recoverPublicKey(msgHash: Hex): ProjPointType; - toCompactRawBytes(): Uint8Array; - toCompactHex(): string; - toDERRawBytes(isCompressed?: boolean): Uint8Array; - toDERHex(isCompressed?: boolean): string; -} -export type RecoveredSignatureType = SignatureType & { - readonly recovery: number; -}; -export type SignatureConstructor = { - new (r: bigint, s: bigint): SignatureType; - fromCompact(hex: Hex): SignatureType; - fromDER(hex: Hex): SignatureType; -}; -type SignatureLike = { - r: bigint; - s: bigint; -}; -export type PubKey = Hex | ProjPointType; -export type CurveType = BasicWCurve & { - hash: CHash; - hmac: HmacFnSync; - randomBytes: (bytesLength?: number) => Uint8Array; - lowS?: boolean; - bits2int?: (bytes: Uint8Array) => bigint; - bits2int_modN?: (bytes: Uint8Array) => bigint; -}; -declare function validateOpts(curve: CurveType): Readonly<{ - readonly nBitLength: number; - readonly nByteLength: number; - readonly Fp: mod.IField; - readonly n: bigint; - readonly h: bigint; - readonly hEff?: bigint | undefined; - readonly Gx: bigint; - readonly Gy: bigint; - readonly allowInfinityPoint?: boolean | undefined; - readonly a: bigint; - readonly b: bigint; - readonly allowedPrivateKeyLengths?: readonly number[] | undefined; - readonly wrapPrivateKey?: boolean | undefined; - readonly endo?: EndomorphismOpts | undefined; - readonly isTorsionFree?: ((c: ProjConstructor, point: ProjPointType) => boolean) | undefined; - readonly clearCofactor?: ((c: ProjConstructor, point: ProjPointType) => ProjPointType) | undefined; - readonly hash: ut.CHash; - readonly hmac: HmacFnSync; - readonly randomBytes: (bytesLength?: number | undefined) => Uint8Array; - lowS: boolean; - readonly bits2int?: ((bytes: Uint8Array) => bigint) | undefined; - readonly bits2int_modN?: ((bytes: Uint8Array) => bigint) | undefined; - readonly p: bigint; -}>; -export type CurveFn = { - CURVE: ReturnType; - getPublicKey: (privateKey: PrivKey, isCompressed?: boolean) => Uint8Array; - getSharedSecret: (privateA: PrivKey, publicB: Hex, isCompressed?: boolean) => Uint8Array; - sign: (msgHash: Hex, privKey: PrivKey, opts?: SignOpts) => RecoveredSignatureType; - verify: (signature: Hex | SignatureLike, msgHash: Hex, publicKey: Hex, opts?: VerOpts) => boolean; - ProjectivePoint: ProjConstructor; - Signature: SignatureConstructor; - utils: { - normPrivateKeyToScalar: (key: PrivKey) => bigint; - isValidPrivateKey(privateKey: PrivKey): boolean; - randomPrivateKey: () => Uint8Array; - precompute: (windowSize?: number, point?: ProjPointType) => ProjPointType; - }; -}; -export declare function weierstrass(curveDef: CurveType): CurveFn; -/** - * Implementation of the Shallue and van de Woestijne method for any weierstrass curve. - * TODO: check if there is a way to merge this with uvRatio in Edwards; move to modular. - * b = True and y = sqrt(u / v) if (u / v) is square in F, and - * b = False and y = sqrt(Z * (u / v)) otherwise. - * @param Fp - * @param Z - * @returns - */ -export declare function SWUFpSqrtRatio(Fp: mod.IField, Z: T): (u: T, v: T) => { - isValid: boolean; - value: T; -}; -/** - * Simplified Shallue-van de Woestijne-Ulas Method - * https://www.rfc-editor.org/rfc/rfc9380#section-6.6.2 - */ -export declare function mapToCurveSimpleSWU(Fp: mod.IField, opts: { - A: T; - B: T; - Z: T; -}): (u: T) => { - x: T; - y: T; -}; -//# sourceMappingURL=weierstrass.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/weierstrass.d.ts.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/weierstrass.d.ts.map deleted file mode 100644 index 3d15e495..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/weierstrass.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"weierstrass.d.ts","sourceRoot":"","sources":["../src/abstract/weierstrass.ts"],"names":[],"mappings":"AAAA,sEAAsE;AAEtE,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAe,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAQ,UAAU,EAAiB,WAAW,EAAE,MAAM,YAAY,CAAC;AAEnG,YAAY,EAAE,WAAW,EAAE,CAAC;AAC5B,KAAK,UAAU,GAAG,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,QAAQ,EAAE,UAAU,EAAE,KAAK,UAAU,CAAC;AAC7E,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;CACxF,CAAC;AACF,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,GAAG;IAE3C,CAAC,EAAE,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,CAAC;IAGL,wBAAwB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,IAAI,CAAC,EAAE,gBAA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AAC,EACjB,IAAI,EAAE;IACJ,CAAC,EAAE,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,CAAC;CACN,OASU,CAAC;OAAQ,CAAC;OAAK,CAAC;EA8B5B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/weierstrass.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/weierstrass.js deleted file mode 100644 index b07585b5..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/weierstrass.js +++ /dev/null @@ -1,1063 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.mapToCurveSimpleSWU = exports.SWUFpSqrtRatio = exports.weierstrass = exports.weierstrassPoints = exports.DER = void 0; -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -// Short Weierstrass curve. The formula is: y² = x³ + ax + b -const mod = require("./modular.js"); -const ut = require("./utils.js"); -const utils_js_1 = require("./utils.js"); -const curve_js_1 = require("./curve.js"); -function validatePointOpts(curve) { - const opts = (0, curve_js_1.validateBasic)(curve); - ut.validateObject(opts, { - a: 'field', - b: 'field', - }, { - allowedPrivateKeyLengths: 'array', - wrapPrivateKey: 'boolean', - isTorsionFree: 'function', - clearCofactor: 'function', - allowInfinityPoint: 'boolean', - fromBytes: 'function', - toBytes: 'function', - }); - const { endo, Fp, a } = opts; - if (endo) { - if (!Fp.eql(a, Fp.ZERO)) { - throw new Error('Endomorphism can only be defined for Koblitz curves that have a=0'); - } - if (typeof endo !== 'object' || - typeof endo.beta !== 'bigint' || - typeof endo.splitScalar !== 'function') { - throw new Error('Expected endomorphism with beta: bigint and splitScalar: function'); - } - } - return Object.freeze({ ...opts }); -} -// ASN.1 DER encoding utilities -const { bytesToNumberBE: b2n, hexToBytes: h2b } = ut; -exports.DER = { - // asn.1 DER encoding utils - Err: class DERErr extends Error { - constructor(m = '') { - super(m); - } - }, - _parseInt(data) { - const { Err: E } = exports.DER; - if (data.length < 2 || data[0] !== 0x02) - throw new E('Invalid signature integer tag'); - const len = data[1]; - const res = data.subarray(2, len + 2); - if (!len || res.length !== len) - throw new E('Invalid signature integer: wrong length'); - // https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag, - // since we always use positive integers here. It must always be empty: - // - add zero byte if exists - // - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding) - if (res[0] & 0b10000000) - throw new E('Invalid signature integer: negative'); - if (res[0] === 0x00 && !(res[1] & 0b10000000)) - throw new E('Invalid signature integer: unnecessary leading zero'); - return { d: b2n(res), l: data.subarray(len + 2) }; // d is data, l is left - }, - toSig(hex) { - // parse DER signature - const { Err: E } = exports.DER; - const data = typeof hex === 'string' ? h2b(hex) : hex; - if (!(data instanceof Uint8Array)) - throw new Error('ui8a expected'); - let l = data.length; - if (l < 2 || data[0] != 0x30) - throw new E('Invalid signature tag'); - if (data[1] !== l - 2) - throw new E('Invalid signature: incorrect length'); - const { d: r, l: sBytes } = exports.DER._parseInt(data.subarray(2)); - const { d: s, l: rBytesLeft } = exports.DER._parseInt(sBytes); - if (rBytesLeft.length) - throw new E('Invalid signature: left bytes after parsing'); - return { r, s }; - }, - hexFromSig(sig) { - // Add leading zero if first byte has negative bit enabled. More details in '_parseInt' - const slice = (s) => (Number.parseInt(s[0], 16) & 0b1000 ? '00' + s : s); - const h = (num) => { - const hex = num.toString(16); - return hex.length & 1 ? `0${hex}` : hex; - }; - const s = slice(h(sig.s)); - const r = slice(h(sig.r)); - const shl = s.length / 2; - const rhl = r.length / 2; - const sl = h(shl); - const rl = h(rhl); - return `30${h(rhl + shl + 4)}02${rl}${r}02${sl}${s}`; - }, -}; -// Be friendly to bad ECMAScript parsers by not using bigint literals -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = BigInt(4); -function weierstrassPoints(opts) { - const CURVE = validatePointOpts(opts); - const { Fp } = CURVE; // All curves has same field / group length as for now, but they can differ - const toBytes = CURVE.toBytes || - ((_c, point, _isCompressed) => { - const a = point.toAffine(); - return ut.concatBytes(Uint8Array.from([0x04]), Fp.toBytes(a.x), Fp.toBytes(a.y)); - }); - const fromBytes = CURVE.fromBytes || - ((bytes) => { - // const head = bytes[0]; - const tail = bytes.subarray(1); - // if (head !== 0x04) throw new Error('Only non-compressed encoding is supported'); - const x = Fp.fromBytes(tail.subarray(0, Fp.BYTES)); - const y = Fp.fromBytes(tail.subarray(Fp.BYTES, 2 * Fp.BYTES)); - return { x, y }; - }); - /** - * y² = x³ + ax + b: Short weierstrass curve formula - * @returns y² - */ - function weierstrassEquation(x) { - const { a, b } = CURVE; - const x2 = Fp.sqr(x); // x * x - const x3 = Fp.mul(x2, x); // x2 * x - return Fp.add(Fp.add(x3, Fp.mul(x, a)), b); // x3 + a * x + b - } - // Validate whether the passed curve params are valid. - // We check if curve equation works for generator point. - // `assertValidity()` won't work: `isTorsionFree()` is not available at this point in bls12-381. - // ProjectivePoint class has not been initialized yet. - if (!Fp.eql(Fp.sqr(CURVE.Gy), weierstrassEquation(CURVE.Gx))) - throw new Error('bad generator point: equation left != right'); - // Valid group elements reside in range 1..n-1 - function isWithinCurveOrder(num) { - return typeof num === 'bigint' && _0n < num && num < CURVE.n; - } - function assertGE(num) { - if (!isWithinCurveOrder(num)) - throw new Error('Expected valid bigint: 0 < bigint < curve.n'); - } - // Validates if priv key is valid and converts it to bigint. - // Supports options allowedPrivateKeyLengths and wrapPrivateKey. - function normPrivateKeyToScalar(key) { - const { allowedPrivateKeyLengths: lengths, nByteLength, wrapPrivateKey, n } = CURVE; - if (lengths && typeof key !== 'bigint') { - if (key instanceof Uint8Array) - key = ut.bytesToHex(key); - // Normalize to hex string, pad. E.g. P521 would norm 130-132 char hex to 132-char bytes - if (typeof key !== 'string' || !lengths.includes(key.length)) - throw new Error('Invalid key'); - key = key.padStart(nByteLength * 2, '0'); - } - let num; - try { - num = - typeof key === 'bigint' - ? key - : ut.bytesToNumberBE((0, utils_js_1.ensureBytes)('private key', key, nByteLength)); - } - catch (error) { - throw new Error(`private key must be ${nByteLength} bytes, hex or bigint, not ${typeof key}`); - } - if (wrapPrivateKey) - num = mod.mod(num, n); // disabled by default, enabled for BLS - assertGE(num); // num in range [1..N-1] - return num; - } - const pointPrecomputes = new Map(); - function assertPrjPoint(other) { - if (!(other instanceof Point)) - throw new Error('ProjectivePoint expected'); - } - /** - * Projective Point works in 3d / projective (homogeneous) coordinates: (x, y, z) ∋ (x=x/z, y=y/z) - * Default Point works in 2d / affine coordinates: (x, y) - * We're doing calculations in projective, because its operations don't require costly inversion. - */ - class Point { - constructor(px, py, pz) { - this.px = px; - this.py = py; - this.pz = pz; - if (px == null || !Fp.isValid(px)) - throw new Error('x required'); - if (py == null || !Fp.isValid(py)) - throw new Error('y required'); - if (pz == null || !Fp.isValid(pz)) - throw new Error('z required'); - } - // Does not validate if the point is on-curve. - // Use fromHex instead, or call assertValidity() later. - static fromAffine(p) { - const { x, y } = p || {}; - if (!p || !Fp.isValid(x) || !Fp.isValid(y)) - throw new Error('invalid affine point'); - if (p instanceof Point) - throw new Error('projective point not allowed'); - const is0 = (i) => Fp.eql(i, Fp.ZERO); - // fromAffine(x:0, y:0) would produce (x:0, y:0, z:1), but we need (x:0, y:1, z:0) - if (is0(x) && is0(y)) - return Point.ZERO; - return new Point(x, y, Fp.ONE); - } - get x() { - return this.toAffine().x; - } - get y() { - return this.toAffine().y; - } - /** - * Takes a bunch of Projective Points but executes only one - * inversion on all of them. Inversion is very slow operation, - * so this improves performance massively. - * Optimization: converts a list of projective points to a list of identical points with Z=1. - */ - static normalizeZ(points) { - const toInv = Fp.invertBatch(points.map((p) => p.pz)); - return points.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine); - } - /** - * Converts hash string or Uint8Array to Point. - * @param hex short/long ECDSA hex - */ - static fromHex(hex) { - const P = Point.fromAffine(fromBytes((0, utils_js_1.ensureBytes)('pointHex', hex))); - P.assertValidity(); - return P; - } - // Multiplies generator point by privateKey. - static fromPrivateKey(privateKey) { - return Point.BASE.multiply(normPrivateKeyToScalar(privateKey)); - } - // "Private method", don't use it directly - _setWindowSize(windowSize) { - this._WINDOW_SIZE = windowSize; - pointPrecomputes.delete(this); - } - // A point on curve is valid if it conforms to equation. - assertValidity() { - if (this.is0()) { - // (0, 1, 0) aka ZERO is invalid in most contexts. - // In BLS, ZERO can be serialized, so we allow it. - // (0, 0, 0) is wrong representation of ZERO and is always invalid. - if (CURVE.allowInfinityPoint && !Fp.is0(this.py)) - return; - throw new Error('bad point: ZERO'); - } - // Some 3rd-party test vectors require different wording between here & `fromCompressedHex` - const { x, y } = this.toAffine(); - // Check if x, y are valid field elements - if (!Fp.isValid(x) || !Fp.isValid(y)) - throw new Error('bad point: x or y not FE'); - const left = Fp.sqr(y); // y² - const right = weierstrassEquation(x); // x³ + ax + b - if (!Fp.eql(left, right)) - throw new Error('bad point: equation left != right'); - if (!this.isTorsionFree()) - throw new Error('bad point: not in prime-order subgroup'); - } - hasEvenY() { - const { y } = this.toAffine(); - if (Fp.isOdd) - return !Fp.isOdd(y); - throw new Error("Field doesn't support isOdd"); - } - /** - * Compare one point to another. - */ - equals(other) { - assertPrjPoint(other); - const { px: X1, py: Y1, pz: Z1 } = this; - const { px: X2, py: Y2, pz: Z2 } = other; - const U1 = Fp.eql(Fp.mul(X1, Z2), Fp.mul(X2, Z1)); - const U2 = Fp.eql(Fp.mul(Y1, Z2), Fp.mul(Y2, Z1)); - return U1 && U2; - } - /** - * Flips point to one corresponding to (x, -y) in Affine coordinates. - */ - negate() { - return new Point(this.px, Fp.neg(this.py), this.pz); - } - // Renes-Costello-Batina exception-free doubling formula. - // There is 30% faster Jacobian formula, but it is not complete. - // https://eprint.iacr.org/2015/1060, algorithm 3 - // Cost: 8M + 3S + 3*a + 2*b3 + 15add. - double() { - const { a, b } = CURVE; - const b3 = Fp.mul(b, _3n); - const { px: X1, py: Y1, pz: Z1 } = this; - let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore - let t0 = Fp.mul(X1, X1); // step 1 - let t1 = Fp.mul(Y1, Y1); - let t2 = Fp.mul(Z1, Z1); - let t3 = Fp.mul(X1, Y1); - t3 = Fp.add(t3, t3); // step 5 - Z3 = Fp.mul(X1, Z1); - Z3 = Fp.add(Z3, Z3); - X3 = Fp.mul(a, Z3); - Y3 = Fp.mul(b3, t2); - Y3 = Fp.add(X3, Y3); // step 10 - X3 = Fp.sub(t1, Y3); - Y3 = Fp.add(t1, Y3); - Y3 = Fp.mul(X3, Y3); - X3 = Fp.mul(t3, X3); - Z3 = Fp.mul(b3, Z3); // step 15 - t2 = Fp.mul(a, t2); - t3 = Fp.sub(t0, t2); - t3 = Fp.mul(a, t3); - t3 = Fp.add(t3, Z3); - Z3 = Fp.add(t0, t0); // step 20 - t0 = Fp.add(Z3, t0); - t0 = Fp.add(t0, t2); - t0 = Fp.mul(t0, t3); - Y3 = Fp.add(Y3, t0); - t2 = Fp.mul(Y1, Z1); // step 25 - t2 = Fp.add(t2, t2); - t0 = Fp.mul(t2, t3); - X3 = Fp.sub(X3, t0); - Z3 = Fp.mul(t2, t1); - Z3 = Fp.add(Z3, Z3); // step 30 - Z3 = Fp.add(Z3, Z3); - return new Point(X3, Y3, Z3); - } - // Renes-Costello-Batina exception-free addition formula. - // There is 30% faster Jacobian formula, but it is not complete. - // https://eprint.iacr.org/2015/1060, algorithm 1 - // Cost: 12M + 0S + 3*a + 3*b3 + 23add. - add(other) { - assertPrjPoint(other); - const { px: X1, py: Y1, pz: Z1 } = this; - const { px: X2, py: Y2, pz: Z2 } = other; - let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore - const a = CURVE.a; - const b3 = Fp.mul(CURVE.b, _3n); - let t0 = Fp.mul(X1, X2); // step 1 - let t1 = Fp.mul(Y1, Y2); - let t2 = Fp.mul(Z1, Z2); - let t3 = Fp.add(X1, Y1); - let t4 = Fp.add(X2, Y2); // step 5 - t3 = Fp.mul(t3, t4); - t4 = Fp.add(t0, t1); - t3 = Fp.sub(t3, t4); - t4 = Fp.add(X1, Z1); - let t5 = Fp.add(X2, Z2); // step 10 - t4 = Fp.mul(t4, t5); - t5 = Fp.add(t0, t2); - t4 = Fp.sub(t4, t5); - t5 = Fp.add(Y1, Z1); - X3 = Fp.add(Y2, Z2); // step 15 - t5 = Fp.mul(t5, X3); - X3 = Fp.add(t1, t2); - t5 = Fp.sub(t5, X3); - Z3 = Fp.mul(a, t4); - X3 = Fp.mul(b3, t2); // step 20 - Z3 = Fp.add(X3, Z3); - X3 = Fp.sub(t1, Z3); - Z3 = Fp.add(t1, Z3); - Y3 = Fp.mul(X3, Z3); - t1 = Fp.add(t0, t0); // step 25 - t1 = Fp.add(t1, t0); - t2 = Fp.mul(a, t2); - t4 = Fp.mul(b3, t4); - t1 = Fp.add(t1, t2); - t2 = Fp.sub(t0, t2); // step 30 - t2 = Fp.mul(a, t2); - t4 = Fp.add(t4, t2); - t0 = Fp.mul(t1, t4); - Y3 = Fp.add(Y3, t0); - t0 = Fp.mul(t5, t4); // step 35 - X3 = Fp.mul(t3, X3); - X3 = Fp.sub(X3, t0); - t0 = Fp.mul(t3, t1); - Z3 = Fp.mul(t5, Z3); - Z3 = Fp.add(Z3, t0); // step 40 - return new Point(X3, Y3, Z3); - } - subtract(other) { - return this.add(other.negate()); - } - is0() { - return this.equals(Point.ZERO); - } - wNAF(n) { - return wnaf.wNAFCached(this, pointPrecomputes, n, (comp) => { - const toInv = Fp.invertBatch(comp.map((p) => p.pz)); - return comp.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine); - }); - } - /** - * Non-constant-time multiplication. Uses double-and-add algorithm. - * It's faster, but should only be used when you don't care about - * an exposed private key e.g. sig verification, which works over *public* keys. - */ - multiplyUnsafe(n) { - const I = Point.ZERO; - if (n === _0n) - return I; - assertGE(n); // Will throw on 0 - if (n === _1n) - return this; - const { endo } = CURVE; - if (!endo) - return wnaf.unsafeLadder(this, n); - // Apply endomorphism - let { k1neg, k1, k2neg, k2 } = endo.splitScalar(n); - let k1p = I; - let k2p = I; - let d = this; - while (k1 > _0n || k2 > _0n) { - if (k1 & _1n) - k1p = k1p.add(d); - if (k2 & _1n) - k2p = k2p.add(d); - d = d.double(); - k1 >>= _1n; - k2 >>= _1n; - } - if (k1neg) - k1p = k1p.negate(); - if (k2neg) - k2p = k2p.negate(); - k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz); - return k1p.add(k2p); - } - /** - * Constant time multiplication. - * Uses wNAF method. Windowed method may be 10% faster, - * but takes 2x longer to generate and consumes 2x memory. - * Uses precomputes when available. - * Uses endomorphism for Koblitz curves. - * @param scalar by which the point would be multiplied - * @returns New point - */ - multiply(scalar) { - assertGE(scalar); - let n = scalar; - let point, fake; // Fake point is used to const-time mult - const { endo } = CURVE; - if (endo) { - const { k1neg, k1, k2neg, k2 } = endo.splitScalar(n); - let { p: k1p, f: f1p } = this.wNAF(k1); - let { p: k2p, f: f2p } = this.wNAF(k2); - k1p = wnaf.constTimeNegate(k1neg, k1p); - k2p = wnaf.constTimeNegate(k2neg, k2p); - k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz); - point = k1p.add(k2p); - fake = f1p.add(f2p); - } - else { - const { p, f } = this.wNAF(n); - point = p; - fake = f; - } - // Normalize `z` for both points, but return only real one - return Point.normalizeZ([point, fake])[0]; - } - /** - * Efficiently calculate `aP + bQ`. Unsafe, can expose private key, if used incorrectly. - * Not using Strauss-Shamir trick: precomputation tables are faster. - * The trick could be useful if both P and Q are not G (not in our case). - * @returns non-zero affine point - */ - multiplyAndAddUnsafe(Q, a, b) { - const G = Point.BASE; // No Strauss-Shamir trick: we have 10% faster G precomputes - const mul = (P, a // Select faster multiply() method - ) => (a === _0n || a === _1n || !P.equals(G) ? P.multiplyUnsafe(a) : P.multiply(a)); - const sum = mul(this, a).add(mul(Q, b)); - return sum.is0() ? undefined : sum; - } - // Converts Projective point to affine (x, y) coordinates. - // Can accept precomputed Z^-1 - for example, from invertBatch. - // (x, y, z) ∋ (x=x/z, y=y/z) - toAffine(iz) { - const { px: x, py: y, pz: z } = this; - const is0 = this.is0(); - // If invZ was 0, we return zero point. However we still want to execute - // all operations, so we replace invZ with a random number, 1. - if (iz == null) - iz = is0 ? Fp.ONE : Fp.inv(z); - const ax = Fp.mul(x, iz); - const ay = Fp.mul(y, iz); - const zz = Fp.mul(z, iz); - if (is0) - return { x: Fp.ZERO, y: Fp.ZERO }; - if (!Fp.eql(zz, Fp.ONE)) - throw new Error('invZ was invalid'); - return { x: ax, y: ay }; - } - isTorsionFree() { - const { h: cofactor, isTorsionFree } = CURVE; - if (cofactor === _1n) - return true; // No subgroups, always torsion-free - if (isTorsionFree) - return isTorsionFree(Point, this); - throw new Error('isTorsionFree() has not been declared for the elliptic curve'); - } - clearCofactor() { - const { h: cofactor, clearCofactor } = CURVE; - if (cofactor === _1n) - return this; // Fast-path - if (clearCofactor) - return clearCofactor(Point, this); - return this.multiplyUnsafe(CURVE.h); - } - toRawBytes(isCompressed = true) { - this.assertValidity(); - return toBytes(Point, this, isCompressed); - } - toHex(isCompressed = true) { - return ut.bytesToHex(this.toRawBytes(isCompressed)); - } - } - Point.BASE = new Point(CURVE.Gx, CURVE.Gy, Fp.ONE); - Point.ZERO = new Point(Fp.ZERO, Fp.ONE, Fp.ZERO); - const _bits = CURVE.nBitLength; - const wnaf = (0, curve_js_1.wNAF)(Point, CURVE.endo ? Math.ceil(_bits / 2) : _bits); - // Validate if generator point is on curve - return { - CURVE, - ProjectivePoint: Point, - normPrivateKeyToScalar, - weierstrassEquation, - isWithinCurveOrder, - }; -} -exports.weierstrassPoints = weierstrassPoints; -function validateOpts(curve) { - const opts = (0, curve_js_1.validateBasic)(curve); - ut.validateObject(opts, { - hash: 'hash', - hmac: 'function', - randomBytes: 'function', - }, { - bits2int: 'function', - bits2int_modN: 'function', - lowS: 'boolean', - }); - return Object.freeze({ lowS: true, ...opts }); -} -function weierstrass(curveDef) { - const CURVE = validateOpts(curveDef); - const { Fp, n: CURVE_ORDER } = CURVE; - const compressedLen = Fp.BYTES + 1; // e.g. 33 for 32 - const uncompressedLen = 2 * Fp.BYTES + 1; // e.g. 65 for 32 - function isValidFieldElement(num) { - return _0n < num && num < Fp.ORDER; // 0 is banned since it's not invertible FE - } - function modN(a) { - return mod.mod(a, CURVE_ORDER); - } - function invN(a) { - return mod.invert(a, CURVE_ORDER); - } - const { ProjectivePoint: Point, normPrivateKeyToScalar, weierstrassEquation, isWithinCurveOrder, } = weierstrassPoints({ - ...CURVE, - toBytes(_c, point, isCompressed) { - const a = point.toAffine(); - const x = Fp.toBytes(a.x); - const cat = ut.concatBytes; - if (isCompressed) { - return cat(Uint8Array.from([point.hasEvenY() ? 0x02 : 0x03]), x); - } - else { - return cat(Uint8Array.from([0x04]), x, Fp.toBytes(a.y)); - } - }, - fromBytes(bytes) { - const len = bytes.length; - const head = bytes[0]; - const tail = bytes.subarray(1); - // this.assertValidity() is done inside of fromHex - if (len === compressedLen && (head === 0x02 || head === 0x03)) { - const x = ut.bytesToNumberBE(tail); - if (!isValidFieldElement(x)) - throw new Error('Point is not on curve'); - const y2 = weierstrassEquation(x); // y² = x³ + ax + b - let y = Fp.sqrt(y2); // y = y² ^ (p+1)/4 - const isYOdd = (y & _1n) === _1n; - // ECDSA - const isHeadOdd = (head & 1) === 1; - if (isHeadOdd !== isYOdd) - y = Fp.neg(y); - return { x, y }; - } - else if (len === uncompressedLen && head === 0x04) { - const x = Fp.fromBytes(tail.subarray(0, Fp.BYTES)); - const y = Fp.fromBytes(tail.subarray(Fp.BYTES, 2 * Fp.BYTES)); - return { x, y }; - } - else { - throw new Error(`Point of length ${len} was invalid. Expected ${compressedLen} compressed bytes or ${uncompressedLen} uncompressed bytes`); - } - }, - }); - const numToNByteStr = (num) => ut.bytesToHex(ut.numberToBytesBE(num, CURVE.nByteLength)); - function isBiggerThanHalfOrder(number) { - const HALF = CURVE_ORDER >> _1n; - return number > HALF; - } - function normalizeS(s) { - return isBiggerThanHalfOrder(s) ? modN(-s) : s; - } - // slice bytes num - const slcNum = (b, from, to) => ut.bytesToNumberBE(b.slice(from, to)); - /** - * ECDSA signature with its (r, s) properties. Supports DER & compact representations. - */ - class Signature { - constructor(r, s, recovery) { - this.r = r; - this.s = s; - this.recovery = recovery; - this.assertValidity(); - } - // pair (bytes of r, bytes of s) - static fromCompact(hex) { - const l = CURVE.nByteLength; - hex = (0, utils_js_1.ensureBytes)('compactSignature', hex, l * 2); - return new Signature(slcNum(hex, 0, l), slcNum(hex, l, 2 * l)); - } - // DER encoded ECDSA signature - // https://bitcoin.stackexchange.com/questions/57644/what-are-the-parts-of-a-bitcoin-transaction-input-script - static fromDER(hex) { - const { r, s } = exports.DER.toSig((0, utils_js_1.ensureBytes)('DER', hex)); - return new Signature(r, s); - } - assertValidity() { - // can use assertGE here - if (!isWithinCurveOrder(this.r)) - throw new Error('r must be 0 < r < CURVE.n'); - if (!isWithinCurveOrder(this.s)) - throw new Error('s must be 0 < s < CURVE.n'); - } - addRecoveryBit(recovery) { - return new Signature(this.r, this.s, recovery); - } - recoverPublicKey(msgHash) { - const { r, s, recovery: rec } = this; - const h = bits2int_modN((0, utils_js_1.ensureBytes)('msgHash', msgHash)); // Truncate hash - if (rec == null || ![0, 1, 2, 3].includes(rec)) - throw new Error('recovery id invalid'); - const radj = rec === 2 || rec === 3 ? r + CURVE.n : r; - if (radj >= Fp.ORDER) - throw new Error('recovery id 2 or 3 invalid'); - const prefix = (rec & 1) === 0 ? '02' : '03'; - const R = Point.fromHex(prefix + numToNByteStr(radj)); - const ir = invN(radj); // r^-1 - const u1 = modN(-h * ir); // -hr^-1 - const u2 = modN(s * ir); // sr^-1 - const Q = Point.BASE.multiplyAndAddUnsafe(R, u1, u2); // (sr^-1)R-(hr^-1)G = -(hr^-1)G + (sr^-1) - if (!Q) - throw new Error('point at infinify'); // unsafe is fine: no priv data leaked - Q.assertValidity(); - return Q; - } - // Signatures should be low-s, to prevent malleability. - hasHighS() { - return isBiggerThanHalfOrder(this.s); - } - normalizeS() { - return this.hasHighS() ? new Signature(this.r, modN(-this.s), this.recovery) : this; - } - // DER-encoded - toDERRawBytes() { - return ut.hexToBytes(this.toDERHex()); - } - toDERHex() { - return exports.DER.hexFromSig({ r: this.r, s: this.s }); - } - // padded bytes of r, then padded bytes of s - toCompactRawBytes() { - return ut.hexToBytes(this.toCompactHex()); - } - toCompactHex() { - return numToNByteStr(this.r) + numToNByteStr(this.s); - } - } - const utils = { - isValidPrivateKey(privateKey) { - try { - normPrivateKeyToScalar(privateKey); - return true; - } - catch (error) { - return false; - } - }, - normPrivateKeyToScalar: normPrivateKeyToScalar, - /** - * Produces cryptographically secure private key from random of size - * (groupLen + ceil(groupLen / 2)) with modulo bias being negligible. - */ - randomPrivateKey: () => { - const length = mod.getMinHashLength(CURVE.n); - return mod.mapHashToField(CURVE.randomBytes(length), CURVE.n); - }, - /** - * Creates precompute table for an arbitrary EC point. Makes point "cached". - * Allows to massively speed-up `point.multiply(scalar)`. - * @returns cached point - * @example - * const fast = utils.precompute(8, ProjectivePoint.fromHex(someonesPubKey)); - * fast.multiply(privKey); // much faster ECDH now - */ - precompute(windowSize = 8, point = Point.BASE) { - point._setWindowSize(windowSize); - point.multiply(BigInt(3)); // 3 is arbitrary, just need any number here - return point; - }, - }; - /** - * Computes public key for a private key. Checks for validity of the private key. - * @param privateKey private key - * @param isCompressed whether to return compact (default), or full key - * @returns Public key, full when isCompressed=false; short when isCompressed=true - */ - function getPublicKey(privateKey, isCompressed = true) { - return Point.fromPrivateKey(privateKey).toRawBytes(isCompressed); - } - /** - * Quick and dirty check for item being public key. Does not validate hex, or being on-curve. - */ - function isProbPub(item) { - const arr = item instanceof Uint8Array; - const str = typeof item === 'string'; - const len = (arr || str) && item.length; - if (arr) - return len === compressedLen || len === uncompressedLen; - if (str) - return len === 2 * compressedLen || len === 2 * uncompressedLen; - if (item instanceof Point) - return true; - return false; - } - /** - * ECDH (Elliptic Curve Diffie Hellman). - * Computes shared public key from private key and public key. - * Checks: 1) private key validity 2) shared key is on-curve. - * Does NOT hash the result. - * @param privateA private key - * @param publicB different public key - * @param isCompressed whether to return compact (default), or full key - * @returns shared public key - */ - function getSharedSecret(privateA, publicB, isCompressed = true) { - if (isProbPub(privateA)) - throw new Error('first arg must be private key'); - if (!isProbPub(publicB)) - throw new Error('second arg must be public key'); - const b = Point.fromHex(publicB); // check for being on-curve - return b.multiply(normPrivateKeyToScalar(privateA)).toRawBytes(isCompressed); - } - // RFC6979: ensure ECDSA msg is X bytes and < N. RFC suggests optional truncating via bits2octets. - // FIPS 186-4 4.6 suggests the leftmost min(nBitLen, outLen) bits, which matches bits2int. - // bits2int can produce res>N, we can do mod(res, N) since the bitLen is the same. - // int2octets can't be used; pads small msgs with 0: unacceptatble for trunc as per RFC vectors - const bits2int = CURVE.bits2int || - function (bytes) { - // For curves with nBitLength % 8 !== 0: bits2octets(bits2octets(m)) !== bits2octets(m) - // for some cases, since bytes.length * 8 is not actual bitLength. - const num = ut.bytesToNumberBE(bytes); // check for == u8 done here - const delta = bytes.length * 8 - CURVE.nBitLength; // truncate to nBitLength leftmost bits - return delta > 0 ? num >> BigInt(delta) : num; - }; - const bits2int_modN = CURVE.bits2int_modN || - function (bytes) { - return modN(bits2int(bytes)); // can't use bytesToNumberBE here - }; - // NOTE: pads output with zero as per spec - const ORDER_MASK = ut.bitMask(CURVE.nBitLength); - /** - * Converts to bytes. Checks if num in `[0..ORDER_MASK-1]` e.g.: `[0..2^256-1]`. - */ - function int2octets(num) { - if (typeof num !== 'bigint') - throw new Error('bigint expected'); - if (!(_0n <= num && num < ORDER_MASK)) - throw new Error(`bigint expected < 2^${CURVE.nBitLength}`); - // works with order, can have different size than numToField! - return ut.numberToBytesBE(num, CURVE.nByteLength); - } - // Steps A, D of RFC6979 3.2 - // Creates RFC6979 seed; converts msg/privKey to numbers. - // Used only in sign, not in verify. - // NOTE: we cannot assume here that msgHash has same amount of bytes as curve order, this will be wrong at least for P521. - // Also it can be bigger for P224 + SHA256 - function prepSig(msgHash, privateKey, opts = defaultSigOpts) { - if (['recovered', 'canonical'].some((k) => k in opts)) - throw new Error('sign() legacy options not supported'); - const { hash, randomBytes } = CURVE; - let { lowS, prehash, extraEntropy: ent } = opts; // generates low-s sigs by default - if (lowS == null) - lowS = true; // RFC6979 3.2: we skip step A, because we already provide hash - msgHash = (0, utils_js_1.ensureBytes)('msgHash', msgHash); - if (prehash) - msgHash = (0, utils_js_1.ensureBytes)('prehashed msgHash', hash(msgHash)); - // We can't later call bits2octets, since nested bits2int is broken for curves - // with nBitLength % 8 !== 0. Because of that, we unwrap it here as int2octets call. - // const bits2octets = (bits) => int2octets(bits2int_modN(bits)) - const h1int = bits2int_modN(msgHash); - const d = normPrivateKeyToScalar(privateKey); // validate private key, convert to bigint - const seedArgs = [int2octets(d), int2octets(h1int)]; - // extraEntropy. RFC6979 3.6: additional k' (optional). - if (ent != null) { - // K = HMAC_K(V || 0x00 || int2octets(x) || bits2octets(h1) || k') - const e = ent === true ? randomBytes(Fp.BYTES) : ent; // generate random bytes OR pass as-is - seedArgs.push((0, utils_js_1.ensureBytes)('extraEntropy', e)); // check for being bytes - } - const seed = ut.concatBytes(...seedArgs); // Step D of RFC6979 3.2 - const m = h1int; // NOTE: no need to call bits2int second time here, it is inside truncateHash! - // Converts signature params into point w r/s, checks result for validity. - function k2sig(kBytes) { - // RFC 6979 Section 3.2, step 3: k = bits2int(T) - const k = bits2int(kBytes); // Cannot use fields methods, since it is group element - if (!isWithinCurveOrder(k)) - return; // Important: all mod() calls here must be done over N - const ik = invN(k); // k^-1 mod n - const q = Point.BASE.multiply(k).toAffine(); // q = Gk - const r = modN(q.x); // r = q.x mod n - if (r === _0n) - return; - // Can use scalar blinding b^-1(bm + bdr) where b ∈ [1,q−1] according to - // https://tches.iacr.org/index.php/TCHES/article/view/7337/6509. We've decided against it: - // a) dependency on CSPRNG b) 15% slowdown c) doesn't really help since bigints are not CT - const s = modN(ik * modN(m + r * d)); // Not using blinding here - if (s === _0n) - return; - let recovery = (q.x === r ? 0 : 2) | Number(q.y & _1n); // recovery bit (2 or 3, when q.x > n) - let normS = s; - if (lowS && isBiggerThanHalfOrder(s)) { - normS = normalizeS(s); // if lowS was passed, ensure s is always - recovery ^= 1; // // in the bottom half of N - } - return new Signature(r, normS, recovery); // use normS, not s - } - return { seed, k2sig }; - } - const defaultSigOpts = { lowS: CURVE.lowS, prehash: false }; - const defaultVerOpts = { lowS: CURVE.lowS, prehash: false }; - /** - * Signs message hash with a private key. - * ``` - * sign(m, d, k) where - * (x, y) = G × k - * r = x mod n - * s = (m + dr)/k mod n - * ``` - * @param msgHash NOT message. msg needs to be hashed to `msgHash`, or use `prehash`. - * @param privKey private key - * @param opts lowS for non-malleable sigs. extraEntropy for mixing randomness into k. prehash will hash first arg. - * @returns signature with recovery param - */ - function sign(msgHash, privKey, opts = defaultSigOpts) { - const { seed, k2sig } = prepSig(msgHash, privKey, opts); // Steps A, D of RFC6979 3.2. - const C = CURVE; - const drbg = ut.createHmacDrbg(C.hash.outputLen, C.nByteLength, C.hmac); - return drbg(seed, k2sig); // Steps B, C, D, E, F, G - } - // Enable precomputes. Slows down first publicKey computation by 20ms. - Point.BASE._setWindowSize(8); - // utils.precompute(8, ProjectivePoint.BASE) - /** - * Verifies a signature against message hash and public key. - * Rejects lowS signatures by default: to override, - * specify option `{lowS: false}`. Implements section 4.1.4 from https://www.secg.org/sec1-v2.pdf: - * - * ``` - * verify(r, s, h, P) where - * U1 = hs^-1 mod n - * U2 = rs^-1 mod n - * R = U1⋅G - U2⋅P - * mod(R.x, n) == r - * ``` - */ - function verify(signature, msgHash, publicKey, opts = defaultVerOpts) { - const sg = signature; - msgHash = (0, utils_js_1.ensureBytes)('msgHash', msgHash); - publicKey = (0, utils_js_1.ensureBytes)('publicKey', publicKey); - if ('strict' in opts) - throw new Error('options.strict was renamed to lowS'); - const { lowS, prehash } = opts; - let _sig = undefined; - let P; - try { - if (typeof sg === 'string' || sg instanceof Uint8Array) { - // Signature can be represented in 2 ways: compact (2*nByteLength) & DER (variable-length). - // Since DER can also be 2*nByteLength bytes, we check for it first. - try { - _sig = Signature.fromDER(sg); - } - catch (derError) { - if (!(derError instanceof exports.DER.Err)) - throw derError; - _sig = Signature.fromCompact(sg); - } - } - else if (typeof sg === 'object' && typeof sg.r === 'bigint' && typeof sg.s === 'bigint') { - const { r, s } = sg; - _sig = new Signature(r, s); - } - else { - throw new Error('PARSE'); - } - P = Point.fromHex(publicKey); - } - catch (error) { - if (error.message === 'PARSE') - throw new Error(`signature must be Signature instance, Uint8Array or hex string`); - return false; - } - if (lowS && _sig.hasHighS()) - return false; - if (prehash) - msgHash = CURVE.hash(msgHash); - const { r, s } = _sig; - const h = bits2int_modN(msgHash); // Cannot use fields methods, since it is group element - const is = invN(s); // s^-1 - const u1 = modN(h * is); // u1 = hs^-1 mod n - const u2 = modN(r * is); // u2 = rs^-1 mod n - const R = Point.BASE.multiplyAndAddUnsafe(P, u1, u2)?.toAffine(); // R = u1⋅G + u2⋅P - if (!R) - return false; - const v = modN(R.x); - return v === r; - } - return { - CURVE, - getPublicKey, - getSharedSecret, - sign, - verify, - ProjectivePoint: Point, - Signature, - utils, - }; -} -exports.weierstrass = weierstrass; -/** - * Implementation of the Shallue and van de Woestijne method for any weierstrass curve. - * TODO: check if there is a way to merge this with uvRatio in Edwards; move to modular. - * b = True and y = sqrt(u / v) if (u / v) is square in F, and - * b = False and y = sqrt(Z * (u / v)) otherwise. - * @param Fp - * @param Z - * @returns - */ -function SWUFpSqrtRatio(Fp, Z) { - // Generic implementation - const q = Fp.ORDER; - let l = _0n; - for (let o = q - _1n; o % _2n === _0n; o /= _2n) - l += _1n; - const c1 = l; // 1. c1, the largest integer such that 2^c1 divides q - 1. - // We need 2n ** c1 and 2n ** (c1-1). We can't use **; but we can use <<. - // 2n ** c1 == 2n << (c1-1) - const _2n_pow_c1_1 = _2n << (c1 - _1n - _1n); - const _2n_pow_c1 = _2n_pow_c1_1 * _2n; - const c2 = (q - _1n) / _2n_pow_c1; // 2. c2 = (q - 1) / (2^c1) # Integer arithmetic - const c3 = (c2 - _1n) / _2n; // 3. c3 = (c2 - 1) / 2 # Integer arithmetic - const c4 = _2n_pow_c1 - _1n; // 4. c4 = 2^c1 - 1 # Integer arithmetic - const c5 = _2n_pow_c1_1; // 5. c5 = 2^(c1 - 1) # Integer arithmetic - const c6 = Fp.pow(Z, c2); // 6. c6 = Z^c2 - const c7 = Fp.pow(Z, (c2 + _1n) / _2n); // 7. c7 = Z^((c2 + 1) / 2) - let sqrtRatio = (u, v) => { - let tv1 = c6; // 1. tv1 = c6 - let tv2 = Fp.pow(v, c4); // 2. tv2 = v^c4 - let tv3 = Fp.sqr(tv2); // 3. tv3 = tv2^2 - tv3 = Fp.mul(tv3, v); // 4. tv3 = tv3 * v - let tv5 = Fp.mul(u, tv3); // 5. tv5 = u * tv3 - tv5 = Fp.pow(tv5, c3); // 6. tv5 = tv5^c3 - tv5 = Fp.mul(tv5, tv2); // 7. tv5 = tv5 * tv2 - tv2 = Fp.mul(tv5, v); // 8. tv2 = tv5 * v - tv3 = Fp.mul(tv5, u); // 9. tv3 = tv5 * u - let tv4 = Fp.mul(tv3, tv2); // 10. tv4 = tv3 * tv2 - tv5 = Fp.pow(tv4, c5); // 11. tv5 = tv4^c5 - let isQR = Fp.eql(tv5, Fp.ONE); // 12. isQR = tv5 == 1 - tv2 = Fp.mul(tv3, c7); // 13. tv2 = tv3 * c7 - tv5 = Fp.mul(tv4, tv1); // 14. tv5 = tv4 * tv1 - tv3 = Fp.cmov(tv2, tv3, isQR); // 15. tv3 = CMOV(tv2, tv3, isQR) - tv4 = Fp.cmov(tv5, tv4, isQR); // 16. tv4 = CMOV(tv5, tv4, isQR) - // 17. for i in (c1, c1 - 1, ..., 2): - for (let i = c1; i > _1n; i--) { - let tv5 = i - _2n; // 18. tv5 = i - 2 - tv5 = _2n << (tv5 - _1n); // 19. tv5 = 2^tv5 - let tvv5 = Fp.pow(tv4, tv5); // 20. tv5 = tv4^tv5 - const e1 = Fp.eql(tvv5, Fp.ONE); // 21. e1 = tv5 == 1 - tv2 = Fp.mul(tv3, tv1); // 22. tv2 = tv3 * tv1 - tv1 = Fp.mul(tv1, tv1); // 23. tv1 = tv1 * tv1 - tvv5 = Fp.mul(tv4, tv1); // 24. tv5 = tv4 * tv1 - tv3 = Fp.cmov(tv2, tv3, e1); // 25. tv3 = CMOV(tv2, tv3, e1) - tv4 = Fp.cmov(tvv5, tv4, e1); // 26. tv4 = CMOV(tv5, tv4, e1) - } - return { isValid: isQR, value: tv3 }; - }; - if (Fp.ORDER % _4n === _3n) { - // sqrt_ratio_3mod4(u, v) - const c1 = (Fp.ORDER - _3n) / _4n; // 1. c1 = (q - 3) / 4 # Integer arithmetic - const c2 = Fp.sqrt(Fp.neg(Z)); // 2. c2 = sqrt(-Z) - sqrtRatio = (u, v) => { - let tv1 = Fp.sqr(v); // 1. tv1 = v^2 - const tv2 = Fp.mul(u, v); // 2. tv2 = u * v - tv1 = Fp.mul(tv1, tv2); // 3. tv1 = tv1 * tv2 - let y1 = Fp.pow(tv1, c1); // 4. y1 = tv1^c1 - y1 = Fp.mul(y1, tv2); // 5. y1 = y1 * tv2 - const y2 = Fp.mul(y1, c2); // 6. y2 = y1 * c2 - const tv3 = Fp.mul(Fp.sqr(y1), v); // 7. tv3 = y1^2; 8. tv3 = tv3 * v - const isQR = Fp.eql(tv3, u); // 9. isQR = tv3 == u - let y = Fp.cmov(y2, y1, isQR); // 10. y = CMOV(y2, y1, isQR) - return { isValid: isQR, value: y }; // 11. return (isQR, y) isQR ? y : y*c2 - }; - } - // No curves uses that - // if (Fp.ORDER % _8n === _5n) // sqrt_ratio_5mod8 - return sqrtRatio; -} -exports.SWUFpSqrtRatio = SWUFpSqrtRatio; -/** - * Simplified Shallue-van de Woestijne-Ulas Method - * https://www.rfc-editor.org/rfc/rfc9380#section-6.6.2 - */ -function mapToCurveSimpleSWU(Fp, opts) { - mod.validateField(Fp); - if (!Fp.isValid(opts.A) || !Fp.isValid(opts.B) || !Fp.isValid(opts.Z)) - throw new Error('mapToCurveSimpleSWU: invalid opts'); - const sqrtRatio = SWUFpSqrtRatio(Fp, opts.Z); - if (!Fp.isOdd) - throw new Error('Fp.isOdd is not implemented!'); - // Input: u, an element of F. - // Output: (x, y), a point on E. - return (u) => { - // prettier-ignore - let tv1, tv2, tv3, tv4, tv5, tv6, x, y; - tv1 = Fp.sqr(u); // 1. tv1 = u^2 - tv1 = Fp.mul(tv1, opts.Z); // 2. tv1 = Z * tv1 - tv2 = Fp.sqr(tv1); // 3. tv2 = tv1^2 - tv2 = Fp.add(tv2, tv1); // 4. tv2 = tv2 + tv1 - tv3 = Fp.add(tv2, Fp.ONE); // 5. tv3 = tv2 + 1 - tv3 = Fp.mul(tv3, opts.B); // 6. tv3 = B * tv3 - tv4 = Fp.cmov(opts.Z, Fp.neg(tv2), !Fp.eql(tv2, Fp.ZERO)); // 7. tv4 = CMOV(Z, -tv2, tv2 != 0) - tv4 = Fp.mul(tv4, opts.A); // 8. tv4 = A * tv4 - tv2 = Fp.sqr(tv3); // 9. tv2 = tv3^2 - tv6 = Fp.sqr(tv4); // 10. tv6 = tv4^2 - tv5 = Fp.mul(tv6, opts.A); // 11. tv5 = A * tv6 - tv2 = Fp.add(tv2, tv5); // 12. tv2 = tv2 + tv5 - tv2 = Fp.mul(tv2, tv3); // 13. tv2 = tv2 * tv3 - tv6 = Fp.mul(tv6, tv4); // 14. tv6 = tv6 * tv4 - tv5 = Fp.mul(tv6, opts.B); // 15. tv5 = B * tv6 - tv2 = Fp.add(tv2, tv5); // 16. tv2 = tv2 + tv5 - x = Fp.mul(tv1, tv3); // 17. x = tv1 * tv3 - const { isValid, value } = sqrtRatio(tv2, tv6); // 18. (is_gx1_square, y1) = sqrt_ratio(tv2, tv6) - y = Fp.mul(tv1, u); // 19. y = tv1 * u -> Z * u^3 * y1 - y = Fp.mul(y, value); // 20. y = y * y1 - x = Fp.cmov(x, tv3, isValid); // 21. x = CMOV(x, tv3, is_gx1_square) - y = Fp.cmov(y, value, isValid); // 22. y = CMOV(y, y1, is_gx1_square) - const e1 = Fp.isOdd(u) === Fp.isOdd(y); // 23. e1 = sgn0(u) == sgn0(y) - y = Fp.cmov(Fp.neg(y), y, e1); // 24. y = CMOV(-y, y, e1) - x = Fp.div(x, tv4); // 25. x = x / tv4 - return { x, y }; - }; -} -exports.mapToCurveSimpleSWU = mapToCurveSimpleSWU; -//# sourceMappingURL=weierstrass.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/weierstrass.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/weierstrass.js.map deleted file mode 100644 index 696074dd..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/abstract/weierstrass.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"weierstrass.js","sourceRoot":"","sources":["../src/abstract/weierstrass.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,4DAA4D;AAC5D,oCAAoC;AACpC,iCAAiC;AACjC,yCAA8D;AAC9D,yCAAmG;AAqFnG,SAAS,iBAAiB,CAAI,KAAyB;IACrD,MAAM,IAAI,GAAG,IAAA,wBAAa,EAAC,KAAK,CAAC,CAAC;IAClC,EAAE,CAAC,cAAc,CACf,IAAI,EACJ;QACE,CAAC,EAAE,OAAO;QACV,CAAC,EAAE,OAAO;KACX,EACD;QACE,wBAAwB,EAAE,OAAO;QACjC,cAAc,EAAE,SAAS;QACzB,aAAa,EAAE,UAAU;QACzB,aAAa,EAAE,UAAU;QACzB,kBAAkB,EAAE,SAAS;QAC7B,SAAS,EAAE,UAAU;QACrB,OAAO,EAAE,UAAU;KACpB,CACF,CAAC;IACF,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG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AG,EAAE,GAAG,CAAC,CAAC,CAAC,sBAAsB;QAC5C,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,iDAAiD;QACjG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,qCAAqC;QACzD,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,mBAAmB;QACzC,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,wCAAwC;QACtE,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,uCAAuC;QACvE,MAAM,EAAE,GAAG,EAAE,CAAC,KAAM,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,KAAM,CAAC,CAAC,CAAC,CAAC,CAAC,+BAA+B;QACzE,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,4BAA4B;QAC3D,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,oBAAoB;QACxC,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;IAClB,CAAC,CAAC;AACJ,CAAC;AA7CD,kDA6CC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/bls12-381.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/bls12-381.d.ts deleted file mode 100644 index 0e711140..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/bls12-381.d.ts +++ /dev/null @@ -1,68 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { CurveFn } from './abstract/bls.js'; -import * as mod from './abstract/modular.js'; -declare const Fp: Readonly & Required, "isOdd">>>; -type Fp = bigint; -type BigintTuple = [bigint, bigint]; -type Fp2 = { - c0: bigint; - c1: bigint; -}; -type Fp2Utils = { - fromBigTuple: (tuple: BigintTuple | bigint[]) => Fp2; - reim: (num: Fp2) => { - re: bigint; - im: bigint; - }; - mulByNonresidue: (num: Fp2) => Fp2; - multiplyByB: (num: Fp2) => Fp2; - frobeniusMap(num: Fp2, power: number): Fp2; -}; -declare const Fp2: mod.IField & Fp2Utils; -type BigintSix = [bigint, bigint, bigint, bigint, bigint, bigint]; -type Fp6 = { - c0: Fp2; - c1: Fp2; - c2: Fp2; -}; -type Fp6Utils = { - fromBigSix: (tuple: BigintSix) => Fp6; - mulByNonresidue: (num: Fp6) => Fp6; - frobeniusMap(num: Fp6, power: number): Fp6; - multiplyBy1(num: Fp6, b1: Fp2): Fp6; - multiplyBy01(num: Fp6, b0: Fp2, b1: Fp2): Fp6; - multiplyByFp2(lhs: Fp6, rhs: Fp2): Fp6; -}; -declare const Fp6: mod.IField & Fp6Utils; -type Fp12 = { - c0: Fp6; - c1: Fp6; -}; -type BigintTwelve = [ - bigint, - bigint, - bigint, - bigint, - bigint, - bigint, - bigint, - bigint, - bigint, - bigint, - bigint, - bigint -]; -type Fp12Utils = { - fromBigTwelve: (t: BigintTwelve) => Fp12; - frobeniusMap(num: Fp12, power: number): Fp12; - multiplyBy014(num: Fp12, o0: Fp2, o1: Fp2, o4: Fp2): Fp12; - multiplyByFp2(lhs: Fp12, rhs: Fp2): Fp12; - conjugate(num: Fp12): Fp12; - finalExponentiate(num: Fp12): Fp12; - _cyclotomicSquare(num: Fp12): Fp12; - _cyclotomicExp(num: Fp12, n: bigint): Fp12; -}; -declare const Fp12: mod.IField & Fp12Utils; -export declare const bls12_381: CurveFn; -export {}; -//# sourceMappingURL=bls12-381.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/bls12-381.d.ts.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/bls12-381.d.ts.map deleted file mode 100644 index 01475da1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/bls12-381.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bls12-381.d.ts","sourceRoot":"","sources":["src/bls12-381.ts"],"names":[],"mappings":"AAAA,sEAAsE;AA+BtE,OAAO,EAAO,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAiC7C,QAAA,MAAM,EAAE,4EAAoB,CAAC;AAC7B,KAAK,EAAE,GAAG,MAAM,CAAC;AAMjB,KAAK,WAAW,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACpC,KAAK,GAAG,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AA0BtC,KAAK,QAAQ,GAAG;IACd,YAAY,EAAE,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,EAAE,KAAK,GAAG,CAAC;IACrD,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/C,eAAe,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,CAAC;IACnC,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,CAAC;IAC/B,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC;CAC5C,CAAC;AAQF,QAAA,MAAM,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,QA0G5B,CAAC;AA8CF,KAAK,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC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AAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,GAAG,IAAI,CAAC;IAC1D,aAAa,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,IAAI,CAAC;IACzC,SAAS,CAAC,GAAG,EAAE,IAAI,GAAG,IAAI,CAAC;IAC3B,iBAAiB,CAAC,GAAG,EAAE,IAAI,GAAG,IAAI,CAAC;IACnC,iBAAiB,CAAC,GAAG,EAAE,IAAI,GAAG,IAAI,CAAC;IACnC,cAAc,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5C,CAAC;AAEF,QAAA,MAAM,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,SA6I9B,CAAC;AAkWF,eAAO,MAAM,SAAS,EAAE,OAAO,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,CA2ShD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/bls12-381.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/bls12-381.js deleted file mode 100644 index 06766d44..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/bls12-381.js +++ /dev/null @@ -1,1175 +0,0 @@ -"use strict"; -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.bls12_381 = void 0; -// bls12-381 pairing-friendly Barreto-Lynn-Scott elliptic curve construction allows to: -// - Construct zk-SNARKs at the 128-bit security -// - Use threshold signatures, which allows a user to sign lots of messages with one signature and -// verify them swiftly in a batch, using Boneh-Lynn-Shacham signature scheme. -// -// The library uses G1 for public keys and G2 for signatures. Support for G1 signatures is planned. -// Compatible with Algorand, Chia, Dfinity, Ethereum, FIL, Zcash. Matches specs -// [pairing-curves-11](https://tools.ietf.org/html/draft-irtf-cfrg-pairing-friendly-curves-11), -// [bls-sigs-04](https:/cfrg-hash-to/tools.ietf.org/html/draft-irtf-cfrg-bls-signature-04), -// [hash-to-curve-12](https://tools.ietf.org/html/draft-irtf--curve-12). -// -// ### Summary -// 1. BLS Relies on Bilinear Pairing (expensive) -// 2. Private Keys: 32 bytes -// 3. Public Keys: 48 bytes: 381 bit affine x coordinate, encoded into 48 big-endian bytes. -// 4. Signatures: 96 bytes: two 381 bit integers (affine x coordinate), encoded into two 48 big-endian byte arrays. -// - The signature is a point on the G2 subgroup, which is defined over a finite field -// with elements twice as big as the G1 curve (G2 is over Fp2 rather than Fp. Fp2 is analogous to the complex numbers). -// 5. The 12 stands for the Embedding degree. -// -// ### Formulas -// - `P = pk x G` - public keys -// - `S = pk x H(m)` - signing -// - `e(P, H(m)) == e(G, S)` - verification using pairings -// - `e(G, S) = e(G, SUM(n)(Si)) = MUL(n)(e(G, Si))` - signature aggregation -// Filecoin uses little endian byte arrays for private keys - -// so ensure to reverse byte order if you'll use it with FIL. -const sha256_1 = require("@noble/hashes/sha256"); -const utils_1 = require("@noble/hashes/utils"); -const bls_js_1 = require("./abstract/bls.js"); -const mod = require("./abstract/modular.js"); -const utils_js_1 = require("./abstract/utils.js"); -// Types -const weierstrass_js_1 = require("./abstract/weierstrass.js"); -const hash_to_curve_js_1 = require("./abstract/hash-to-curve.js"); -// Be friendly to bad ECMAScript parsers by not using bigint literals -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = BigInt(4); -// prettier-ignore -const _8n = BigInt(8), _16n = BigInt(16); -// CURVE FIELDS -// Finite field over p. -const Fp_raw = BigInt('0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab'); -const Fp = mod.Field(Fp_raw); -// Finite field over r. -// This particular field is not used anywhere in bls12-381, but it is still useful. -const Fr = mod.Field(BigInt('0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001')); -const Fp2Add = ({ c0, c1 }, { c0: r0, c1: r1 }) => ({ - c0: Fp.add(c0, r0), - c1: Fp.add(c1, r1), -}); -const Fp2Subtract = ({ c0, c1 }, { c0: r0, c1: r1 }) => ({ - c0: Fp.sub(c0, r0), - c1: Fp.sub(c1, r1), -}); -const Fp2Multiply = ({ c0, c1 }, rhs) => { - if (typeof rhs === 'bigint') - return { c0: Fp.mul(c0, rhs), c1: Fp.mul(c1, rhs) }; - // (a+bi)(c+di) = (ac−bd) + (ad+bc)i - const { c0: r0, c1: r1 } = rhs; - let t1 = Fp.mul(c0, r0); // c0 * o0 - let t2 = Fp.mul(c1, r1); // c1 * o1 - // (T1 - T2) + ((c0 + c1) * (r0 + r1) - (T1 + T2))*i - const o0 = Fp.sub(t1, t2); - const o1 = Fp.sub(Fp.mul(Fp.add(c0, c1), Fp.add(r0, r1)), Fp.add(t1, t2)); - return { c0: o0, c1: o1 }; -}; -const Fp2Square = ({ c0, c1 }) => { - const a = Fp.add(c0, c1); - const b = Fp.sub(c0, c1); - const c = Fp.add(c0, c0); - return { c0: Fp.mul(a, b), c1: Fp.mul(c, c1) }; -}; -// G2 is the order-q subgroup of E2(Fp²) : y² = x³+4(1+√−1), -// where Fp2 is Fp[√−1]/(x2+1). #E2(Fp2 ) = h2q, where -// G² - 1 -// h2q -// NOTE: ORDER was wrong! -const FP2_ORDER = Fp_raw * Fp_raw; -const Fp2 = { - ORDER: FP2_ORDER, - BITS: (0, utils_js_1.bitLen)(FP2_ORDER), - BYTES: Math.ceil((0, utils_js_1.bitLen)(FP2_ORDER) / 8), - MASK: (0, utils_js_1.bitMask)((0, utils_js_1.bitLen)(FP2_ORDER)), - ZERO: { c0: Fp.ZERO, c1: Fp.ZERO }, - ONE: { c0: Fp.ONE, c1: Fp.ZERO }, - create: (num) => num, - isValid: ({ c0, c1 }) => typeof c0 === 'bigint' && typeof c1 === 'bigint', - is0: ({ c0, c1 }) => Fp.is0(c0) && Fp.is0(c1), - eql: ({ c0, c1 }, { c0: r0, c1: r1 }) => Fp.eql(c0, r0) && Fp.eql(c1, r1), - neg: ({ c0, c1 }) => ({ c0: Fp.neg(c0), c1: Fp.neg(c1) }), - pow: (num, power) => mod.FpPow(Fp2, num, power), - invertBatch: (nums) => mod.FpInvertBatch(Fp2, nums), - // Normalized - add: Fp2Add, - sub: Fp2Subtract, - mul: Fp2Multiply, - sqr: Fp2Square, - // NonNormalized stuff - addN: Fp2Add, - subN: Fp2Subtract, - mulN: Fp2Multiply, - sqrN: Fp2Square, - // Why inversion for bigint inside Fp instead of Fp2? it is even used in that context? - div: (lhs, rhs) => Fp2.mul(lhs, typeof rhs === 'bigint' ? Fp.inv(Fp.create(rhs)) : Fp2.inv(rhs)), - inv: ({ c0: a, c1: b }) => { - // We wish to find the multiplicative inverse of a nonzero - // element a + bu in Fp2. We leverage an identity - // - // (a + bu)(a - bu) = a² + b² - // - // which holds because u² = -1. This can be rewritten as - // - // (a + bu)(a - bu)/(a² + b²) = 1 - // - // because a² + b² = 0 has no nonzero solutions for (a, b). - // This gives that (a - bu)/(a² + b²) is the inverse - // of (a + bu). Importantly, this can be computing using - // only a single inversion in Fp. - const factor = Fp.inv(Fp.create(a * a + b * b)); - return { c0: Fp.mul(factor, Fp.create(a)), c1: Fp.mul(factor, Fp.create(-b)) }; - }, - sqrt: (num) => { - if (Fp2.eql(num, Fp2.ZERO)) - return Fp2.ZERO; // Algo doesn't handles this case - // TODO: Optimize this line. It's extremely slow. - // Speeding this up would boost aggregateSignatures. - // https://eprint.iacr.org/2012/685.pdf applicable? - // https://github.com/zkcrypto/bls12_381/blob/080eaa74ec0e394377caa1ba302c8c121df08b07/src/fp2.rs#L250 - // https://github.com/supranational/blst/blob/aae0c7d70b799ac269ff5edf29d8191dbd357876/src/exp2.c#L1 - // Inspired by https://github.com/dalek-cryptography/curve25519-dalek/blob/17698df9d4c834204f83a3574143abacb4fc81a5/src/field.rs#L99 - const candidateSqrt = Fp2.pow(num, (Fp2.ORDER + _8n) / _16n); - const check = Fp2.div(Fp2.sqr(candidateSqrt), num); // candidateSqrt.square().div(this); - const R = FP2_ROOTS_OF_UNITY; - const divisor = [R[0], R[2], R[4], R[6]].find((r) => Fp2.eql(r, check)); - if (!divisor) - throw new Error('No root'); - const index = R.indexOf(divisor); - const root = R[index / 2]; - if (!root) - throw new Error('Invalid root'); - const x1 = Fp2.div(candidateSqrt, root); - const x2 = Fp2.neg(x1); - const { re: re1, im: im1 } = Fp2.reim(x1); - const { re: re2, im: im2 } = Fp2.reim(x2); - if (im1 > im2 || (im1 === im2 && re1 > re2)) - return x1; - return x2; - }, - // Same as sgn0_m_eq_2 in RFC 9380 - isOdd: (x) => { - const { re: x0, im: x1 } = Fp2.reim(x); - const sign_0 = x0 % _2n; - const zero_0 = x0 === _0n; - const sign_1 = x1 % _2n; - return BigInt(sign_0 || (zero_0 && sign_1)) == _1n; - }, - // Bytes util - fromBytes(b) { - if (b.length !== Fp2.BYTES) - throw new Error(`fromBytes wrong length=${b.length}`); - return { c0: Fp.fromBytes(b.subarray(0, Fp.BYTES)), c1: Fp.fromBytes(b.subarray(Fp.BYTES)) }; - }, - toBytes: ({ c0, c1 }) => (0, utils_js_1.concatBytes)(Fp.toBytes(c0), Fp.toBytes(c1)), - cmov: ({ c0, c1 }, { c0: r0, c1: r1 }, c) => ({ - c0: Fp.cmov(c0, r0, c), - c1: Fp.cmov(c1, r1, c), - }), - // Specific utils - // toString() { - // return `Fp2(${this.c0} + ${this.c1}×i)`; - // } - reim: ({ c0, c1 }) => ({ re: c0, im: c1 }), - // multiply by u + 1 - mulByNonresidue: ({ c0, c1 }) => ({ c0: Fp.sub(c0, c1), c1: Fp.add(c0, c1) }), - multiplyByB: ({ c0, c1 }) => { - let t0 = Fp.mul(c0, _4n); // 4 * c0 - let t1 = Fp.mul(c1, _4n); // 4 * c1 - // (T0-T1) + (T0+T1)*i - return { c0: Fp.sub(t0, t1), c1: Fp.add(t0, t1) }; - }, - fromBigTuple: (tuple) => { - if (tuple.length !== 2) - throw new Error('Invalid tuple'); - const fps = tuple.map((n) => Fp.create(n)); - return { c0: fps[0], c1: fps[1] }; - }, - frobeniusMap: ({ c0, c1 }, power) => ({ - c0, - c1: Fp.mul(c1, FP2_FROBENIUS_COEFFICIENTS[power % 2]), - }), -}; -// Finite extension field over irreducible polynominal. -// Fp(u) / (u² - β) where β = -1 -const FP2_FROBENIUS_COEFFICIENTS = [ - BigInt('0x1'), - BigInt('0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaaa'), -].map((item) => Fp.create(item)); -// For Fp2 roots of unity. -const rv1 = BigInt('0x6af0e0437ff400b6831e36d6bd17ffe48395dabc2d3435e77f76e17009241c5ee67992f72ec05f4c81084fbede3cc09'); -// const ev1 = -// BigInt('0x699be3b8c6870965e5bf892ad5d2cc7b0e85a117402dfd83b7f4a947e02d978498255a2aaec0ac627b5afbdf1bf1c90'); -// const ev2 = -// BigInt('0x8157cd83046453f5dd0972b6e3949e4288020b5b8a9cc99ca07e27089a2ce2436d965026adad3ef7baba37f2183e9b5'); -// const ev3 = -// BigInt('0xab1c2ffdd6c253ca155231eb3e71ba044fd562f6f72bc5bad5ec46a0b7a3b0247cf08ce6c6317f40edbc653a72dee17'); -// const ev4 = -// BigInt('0xaa404866706722864480885d68ad0ccac1967c7544b447873cc37e0181271e006df72162a3d3e0287bf597fbf7f8fc1'); -// Eighth roots of unity, used for computing square roots in Fp2. -// To verify or re-calculate: -// Array(8).fill(new Fp2([1n, 1n])).map((fp2, k) => fp2.pow(Fp2.ORDER * BigInt(k) / 8n)) -const FP2_ROOTS_OF_UNITY = [ - [_1n, _0n], - [rv1, -rv1], - [_0n, _1n], - [rv1, rv1], - [-_1n, _0n], - [-rv1, rv1], - [_0n, -_1n], - [-rv1, -rv1], -].map((pair) => Fp2.fromBigTuple(pair)); -const Fp6Add = ({ c0, c1, c2 }, { c0: r0, c1: r1, c2: r2 }) => ({ - c0: Fp2.add(c0, r0), - c1: Fp2.add(c1, r1), - c2: Fp2.add(c2, r2), -}); -const Fp6Subtract = ({ c0, c1, c2 }, { c0: r0, c1: r1, c2: r2 }) => ({ - c0: Fp2.sub(c0, r0), - c1: Fp2.sub(c1, r1), - c2: Fp2.sub(c2, r2), -}); -const Fp6Multiply = ({ c0, c1, c2 }, rhs) => { - if (typeof rhs === 'bigint') { - return { - c0: Fp2.mul(c0, rhs), - c1: Fp2.mul(c1, rhs), - c2: Fp2.mul(c2, rhs), - }; - } - const { c0: r0, c1: r1, c2: r2 } = rhs; - const t0 = Fp2.mul(c0, r0); // c0 * o0 - const t1 = Fp2.mul(c1, r1); // c1 * o1 - const t2 = Fp2.mul(c2, r2); // c2 * o2 - return { - // t0 + (c1 + c2) * (r1 * r2) - (T1 + T2) * (u + 1) - c0: Fp2.add(t0, Fp2.mulByNonresidue(Fp2.sub(Fp2.mul(Fp2.add(c1, c2), Fp2.add(r1, r2)), Fp2.add(t1, t2)))), - // (c0 + c1) * (r0 + r1) - (T0 + T1) + T2 * (u + 1) - c1: Fp2.add(Fp2.sub(Fp2.mul(Fp2.add(c0, c1), Fp2.add(r0, r1)), Fp2.add(t0, t1)), Fp2.mulByNonresidue(t2)), - // T1 + (c0 + c2) * (r0 + r2) - T0 + T2 - c2: Fp2.sub(Fp2.add(t1, Fp2.mul(Fp2.add(c0, c2), Fp2.add(r0, r2))), Fp2.add(t0, t2)), - }; -}; -const Fp6Square = ({ c0, c1, c2 }) => { - let t0 = Fp2.sqr(c0); // c0² - let t1 = Fp2.mul(Fp2.mul(c0, c1), _2n); // 2 * c0 * c1 - let t3 = Fp2.mul(Fp2.mul(c1, c2), _2n); // 2 * c1 * c2 - let t4 = Fp2.sqr(c2); // c2² - return { - c0: Fp2.add(Fp2.mulByNonresidue(t3), t0), - c1: Fp2.add(Fp2.mulByNonresidue(t4), t1), - // T1 + (c0 - c1 + c2)² + T3 - T0 - T4 - c2: Fp2.sub(Fp2.sub(Fp2.add(Fp2.add(t1, Fp2.sqr(Fp2.add(Fp2.sub(c0, c1), c2))), t3), t0), t4), - }; -}; -const Fp6 = { - ORDER: Fp2.ORDER, - BITS: 3 * Fp2.BITS, - BYTES: 3 * Fp2.BYTES, - MASK: (0, utils_js_1.bitMask)(3 * Fp2.BITS), - ZERO: { c0: Fp2.ZERO, c1: Fp2.ZERO, c2: Fp2.ZERO }, - ONE: { c0: Fp2.ONE, c1: Fp2.ZERO, c2: Fp2.ZERO }, - create: (num) => num, - isValid: ({ c0, c1, c2 }) => Fp2.isValid(c0) && Fp2.isValid(c1) && Fp2.isValid(c2), - is0: ({ c0, c1, c2 }) => Fp2.is0(c0) && Fp2.is0(c1) && Fp2.is0(c2), - neg: ({ c0, c1, c2 }) => ({ c0: Fp2.neg(c0), c1: Fp2.neg(c1), c2: Fp2.neg(c2) }), - eql: ({ c0, c1, c2 }, { c0: r0, c1: r1, c2: r2 }) => Fp2.eql(c0, r0) && Fp2.eql(c1, r1) && Fp2.eql(c2, r2), - sqrt: () => { - throw new Error('Not implemented'); - }, - // Do we need division by bigint at all? Should be done via order: - div: (lhs, rhs) => Fp6.mul(lhs, typeof rhs === 'bigint' ? Fp.inv(Fp.create(rhs)) : Fp6.inv(rhs)), - pow: (num, power) => mod.FpPow(Fp6, num, power), - invertBatch: (nums) => mod.FpInvertBatch(Fp6, nums), - // Normalized - add: Fp6Add, - sub: Fp6Subtract, - mul: Fp6Multiply, - sqr: Fp6Square, - // NonNormalized stuff - addN: Fp6Add, - subN: Fp6Subtract, - mulN: Fp6Multiply, - sqrN: Fp6Square, - inv: ({ c0, c1, c2 }) => { - let t0 = Fp2.sub(Fp2.sqr(c0), Fp2.mulByNonresidue(Fp2.mul(c2, c1))); // c0² - c2 * c1 * (u + 1) - let t1 = Fp2.sub(Fp2.mulByNonresidue(Fp2.sqr(c2)), Fp2.mul(c0, c1)); // c2² * (u + 1) - c0 * c1 - let t2 = Fp2.sub(Fp2.sqr(c1), Fp2.mul(c0, c2)); // c1² - c0 * c2 - // 1/(((c2 * T1 + c1 * T2) * v) + c0 * T0) - let t4 = Fp2.inv(Fp2.add(Fp2.mulByNonresidue(Fp2.add(Fp2.mul(c2, t1), Fp2.mul(c1, t2))), Fp2.mul(c0, t0))); - return { c0: Fp2.mul(t4, t0), c1: Fp2.mul(t4, t1), c2: Fp2.mul(t4, t2) }; - }, - // Bytes utils - fromBytes: (b) => { - if (b.length !== Fp6.BYTES) - throw new Error(`fromBytes wrong length=${b.length}`); - return { - c0: Fp2.fromBytes(b.subarray(0, Fp2.BYTES)), - c1: Fp2.fromBytes(b.subarray(Fp2.BYTES, 2 * Fp2.BYTES)), - c2: Fp2.fromBytes(b.subarray(2 * Fp2.BYTES)), - }; - }, - toBytes: ({ c0, c1, c2 }) => (0, utils_js_1.concatBytes)(Fp2.toBytes(c0), Fp2.toBytes(c1), Fp2.toBytes(c2)), - cmov: ({ c0, c1, c2 }, { c0: r0, c1: r1, c2: r2 }, c) => ({ - c0: Fp2.cmov(c0, r0, c), - c1: Fp2.cmov(c1, r1, c), - c2: Fp2.cmov(c2, r2, c), - }), - // Utils - // fromTriple(triple: [Fp2, Fp2, Fp2]) { - // return new Fp6(...triple); - // } - // toString() { - // return `Fp6(${this.c0} + ${this.c1} * v, ${this.c2} * v^2)`; - // } - fromBigSix: (t) => { - if (!Array.isArray(t) || t.length !== 6) - throw new Error('Invalid Fp6 usage'); - return { - c0: Fp2.fromBigTuple(t.slice(0, 2)), - c1: Fp2.fromBigTuple(t.slice(2, 4)), - c2: Fp2.fromBigTuple(t.slice(4, 6)), - }; - }, - frobeniusMap: ({ c0, c1, c2 }, power) => ({ - c0: Fp2.frobeniusMap(c0, power), - c1: Fp2.mul(Fp2.frobeniusMap(c1, power), FP6_FROBENIUS_COEFFICIENTS_1[power % 6]), - c2: Fp2.mul(Fp2.frobeniusMap(c2, power), FP6_FROBENIUS_COEFFICIENTS_2[power % 6]), - }), - mulByNonresidue: ({ c0, c1, c2 }) => ({ c0: Fp2.mulByNonresidue(c2), c1: c0, c2: c1 }), - // Sparse multiplication - multiplyBy1: ({ c0, c1, c2 }, b1) => ({ - c0: Fp2.mulByNonresidue(Fp2.mul(c2, b1)), - c1: Fp2.mul(c0, b1), - c2: Fp2.mul(c1, b1), - }), - // Sparse multiplication - multiplyBy01({ c0, c1, c2 }, b0, b1) { - let t0 = Fp2.mul(c0, b0); // c0 * b0 - let t1 = Fp2.mul(c1, b1); // c1 * b1 - return { - // ((c1 + c2) * b1 - T1) * (u + 1) + T0 - c0: Fp2.add(Fp2.mulByNonresidue(Fp2.sub(Fp2.mul(Fp2.add(c1, c2), b1), t1)), t0), - // (b0 + b1) * (c0 + c1) - T0 - T1 - c1: Fp2.sub(Fp2.sub(Fp2.mul(Fp2.add(b0, b1), Fp2.add(c0, c1)), t0), t1), - // (c0 + c2) * b0 - T0 + T1 - c2: Fp2.add(Fp2.sub(Fp2.mul(Fp2.add(c0, c2), b0), t0), t1), - }; - }, - multiplyByFp2: ({ c0, c1, c2 }, rhs) => ({ - c0: Fp2.mul(c0, rhs), - c1: Fp2.mul(c1, rhs), - c2: Fp2.mul(c2, rhs), - }), -}; -const FP6_FROBENIUS_COEFFICIENTS_1 = [ - [BigInt('0x1'), BigInt('0x0')], - [ - BigInt('0x0'), - BigInt('0x1a0111ea397fe699ec02408663d4de85aa0d857d89759ad4897d29650fb85f9b409427eb4f49fffd8bfd00000000aaac'), - ], - [ - BigInt('0x00000000000000005f19672fdf76ce51ba69c6076a0f77eaddb3a93be6f89688de17d813620a00022e01fffffffefffe'), - BigInt('0x0'), - ], - [BigInt('0x0'), BigInt('0x1')], - [ - BigInt('0x1a0111ea397fe699ec02408663d4de85aa0d857d89759ad4897d29650fb85f9b409427eb4f49fffd8bfd00000000aaac'), - BigInt('0x0'), - ], - [ - BigInt('0x0'), - BigInt('0x00000000000000005f19672fdf76ce51ba69c6076a0f77eaddb3a93be6f89688de17d813620a00022e01fffffffefffe'), - ], -].map((pair) => Fp2.fromBigTuple(pair)); -const FP6_FROBENIUS_COEFFICIENTS_2 = [ - [BigInt('0x1'), BigInt('0x0')], - [ - BigInt('0x1a0111ea397fe699ec02408663d4de85aa0d857d89759ad4897d29650fb85f9b409427eb4f49fffd8bfd00000000aaad'), - BigInt('0x0'), - ], - [ - BigInt('0x1a0111ea397fe699ec02408663d4de85aa0d857d89759ad4897d29650fb85f9b409427eb4f49fffd8bfd00000000aaac'), - BigInt('0x0'), - ], - [ - BigInt('0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaaa'), - BigInt('0x0'), - ], - [ - BigInt('0x00000000000000005f19672fdf76ce51ba69c6076a0f77eaddb3a93be6f89688de17d813620a00022e01fffffffefffe'), - BigInt('0x0'), - ], - [ - BigInt('0x00000000000000005f19672fdf76ce51ba69c6076a0f77eaddb3a93be6f89688de17d813620a00022e01fffffffeffff'), - BigInt('0x0'), - ], -].map((pair) => Fp2.fromBigTuple(pair)); -// The BLS parameter x for BLS12-381 -const BLS_X = BigInt('0xd201000000010000'); -const BLS_X_LEN = (0, utils_js_1.bitLen)(BLS_X); -const Fp12Add = ({ c0, c1 }, { c0: r0, c1: r1 }) => ({ - c0: Fp6.add(c0, r0), - c1: Fp6.add(c1, r1), -}); -const Fp12Subtract = ({ c0, c1 }, { c0: r0, c1: r1 }) => ({ - c0: Fp6.sub(c0, r0), - c1: Fp6.sub(c1, r1), -}); -const Fp12Multiply = ({ c0, c1 }, rhs) => { - if (typeof rhs === 'bigint') - return { c0: Fp6.mul(c0, rhs), c1: Fp6.mul(c1, rhs) }; - let { c0: r0, c1: r1 } = rhs; - let t1 = Fp6.mul(c0, r0); // c0 * r0 - let t2 = Fp6.mul(c1, r1); // c1 * r1 - return { - c0: Fp6.add(t1, Fp6.mulByNonresidue(t2)), - // (c0 + c1) * (r0 + r1) - (T1 + T2) - c1: Fp6.sub(Fp6.mul(Fp6.add(c0, c1), Fp6.add(r0, r1)), Fp6.add(t1, t2)), - }; -}; -const Fp12Square = ({ c0, c1 }) => { - let ab = Fp6.mul(c0, c1); // c0 * c1 - return { - // (c1 * v + c0) * (c0 + c1) - AB - AB * v - c0: Fp6.sub(Fp6.sub(Fp6.mul(Fp6.add(Fp6.mulByNonresidue(c1), c0), Fp6.add(c0, c1)), ab), Fp6.mulByNonresidue(ab)), - c1: Fp6.add(ab, ab), - }; // AB + AB -}; -function Fp4Square(a, b) { - const a2 = Fp2.sqr(a); - const b2 = Fp2.sqr(b); - return { - first: Fp2.add(Fp2.mulByNonresidue(b2), a2), - second: Fp2.sub(Fp2.sub(Fp2.sqr(Fp2.add(a, b)), a2), b2), // (a + b)² - a² - b² - }; -} -const Fp12 = { - ORDER: Fp2.ORDER, - BITS: 2 * Fp2.BITS, - BYTES: 2 * Fp2.BYTES, - MASK: (0, utils_js_1.bitMask)(2 * Fp2.BITS), - ZERO: { c0: Fp6.ZERO, c1: Fp6.ZERO }, - ONE: { c0: Fp6.ONE, c1: Fp6.ZERO }, - create: (num) => num, - isValid: ({ c0, c1 }) => Fp6.isValid(c0) && Fp6.isValid(c1), - is0: ({ c0, c1 }) => Fp6.is0(c0) && Fp6.is0(c1), - neg: ({ c0, c1 }) => ({ c0: Fp6.neg(c0), c1: Fp6.neg(c1) }), - eql: ({ c0, c1 }, { c0: r0, c1: r1 }) => Fp6.eql(c0, r0) && Fp6.eql(c1, r1), - sqrt: () => { - throw new Error('Not implemented'); - }, - inv: ({ c0, c1 }) => { - let t = Fp6.inv(Fp6.sub(Fp6.sqr(c0), Fp6.mulByNonresidue(Fp6.sqr(c1)))); // 1 / (c0² - c1² * v) - return { c0: Fp6.mul(c0, t), c1: Fp6.neg(Fp6.mul(c1, t)) }; // ((C0 * T) * T) + (-C1 * T) * w - }, - div: (lhs, rhs) => Fp12.mul(lhs, typeof rhs === 'bigint' ? Fp.inv(Fp.create(rhs)) : Fp12.inv(rhs)), - pow: (num, power) => mod.FpPow(Fp12, num, power), - invertBatch: (nums) => mod.FpInvertBatch(Fp12, nums), - // Normalized - add: Fp12Add, - sub: Fp12Subtract, - mul: Fp12Multiply, - sqr: Fp12Square, - // NonNormalized stuff - addN: Fp12Add, - subN: Fp12Subtract, - mulN: Fp12Multiply, - sqrN: Fp12Square, - // Bytes utils - fromBytes: (b) => { - if (b.length !== Fp12.BYTES) - throw new Error(`fromBytes wrong length=${b.length}`); - return { - c0: Fp6.fromBytes(b.subarray(0, Fp6.BYTES)), - c1: Fp6.fromBytes(b.subarray(Fp6.BYTES)), - }; - }, - toBytes: ({ c0, c1 }) => (0, utils_js_1.concatBytes)(Fp6.toBytes(c0), Fp6.toBytes(c1)), - cmov: ({ c0, c1 }, { c0: r0, c1: r1 }, c) => ({ - c0: Fp6.cmov(c0, r0, c), - c1: Fp6.cmov(c1, r1, c), - }), - // Utils - // toString() { - // return `Fp12(${this.c0} + ${this.c1} * w)`; - // }, - // fromTuple(c: [Fp6, Fp6]) { - // return new Fp12(...c); - // } - fromBigTwelve: (t) => ({ - c0: Fp6.fromBigSix(t.slice(0, 6)), - c1: Fp6.fromBigSix(t.slice(6, 12)), - }), - // Raises to q**i -th power - frobeniusMap(lhs, power) { - const r0 = Fp6.frobeniusMap(lhs.c0, power); - const { c0, c1, c2 } = Fp6.frobeniusMap(lhs.c1, power); - const coeff = FP12_FROBENIUS_COEFFICIENTS[power % 12]; - return { - c0: r0, - c1: Fp6.create({ - c0: Fp2.mul(c0, coeff), - c1: Fp2.mul(c1, coeff), - c2: Fp2.mul(c2, coeff), - }), - }; - }, - // Sparse multiplication - multiplyBy014: ({ c0, c1 }, o0, o1, o4) => { - let t0 = Fp6.multiplyBy01(c0, o0, o1); - let t1 = Fp6.multiplyBy1(c1, o4); - return { - c0: Fp6.add(Fp6.mulByNonresidue(t1), t0), - // (c1 + c0) * [o0, o1+o4] - T0 - T1 - c1: Fp6.sub(Fp6.sub(Fp6.multiplyBy01(Fp6.add(c1, c0), o0, Fp2.add(o1, o4)), t0), t1), - }; - }, - multiplyByFp2: ({ c0, c1 }, rhs) => ({ - c0: Fp6.multiplyByFp2(c0, rhs), - c1: Fp6.multiplyByFp2(c1, rhs), - }), - conjugate: ({ c0, c1 }) => ({ c0, c1: Fp6.neg(c1) }), - // A cyclotomic group is a subgroup of Fp^n defined by - // GΦₙ(p) = {α ∈ Fpⁿ : α^Φₙ(p) = 1} - // The result of any pairing is in a cyclotomic subgroup - // https://eprint.iacr.org/2009/565.pdf - _cyclotomicSquare: ({ c0, c1 }) => { - const { c0: c0c0, c1: c0c1, c2: c0c2 } = c0; - const { c0: c1c0, c1: c1c1, c2: c1c2 } = c1; - const { first: t3, second: t4 } = Fp4Square(c0c0, c1c1); - const { first: t5, second: t6 } = Fp4Square(c1c0, c0c2); - const { first: t7, second: t8 } = Fp4Square(c0c1, c1c2); - let t9 = Fp2.mulByNonresidue(t8); // T8 * (u + 1) - return { - c0: Fp6.create({ - c0: Fp2.add(Fp2.mul(Fp2.sub(t3, c0c0), _2n), t3), - c1: Fp2.add(Fp2.mul(Fp2.sub(t5, c0c1), _2n), t5), - c2: Fp2.add(Fp2.mul(Fp2.sub(t7, c0c2), _2n), t7), - }), - c1: Fp6.create({ - c0: Fp2.add(Fp2.mul(Fp2.add(t9, c1c0), _2n), t9), - c1: Fp2.add(Fp2.mul(Fp2.add(t4, c1c1), _2n), t4), - c2: Fp2.add(Fp2.mul(Fp2.add(t6, c1c2), _2n), t6), - }), - }; // 2 * (T6 + c1c2) + T6 - }, - _cyclotomicExp(num, n) { - let z = Fp12.ONE; - for (let i = BLS_X_LEN - 1; i >= 0; i--) { - z = Fp12._cyclotomicSquare(z); - if ((0, utils_js_1.bitGet)(n, i)) - z = Fp12.mul(z, num); - } - return z; - }, - // https://eprint.iacr.org/2010/354.pdf - // https://eprint.iacr.org/2009/565.pdf - finalExponentiate: (num) => { - const x = BLS_X; - // this^(q⁶) / this - const t0 = Fp12.div(Fp12.frobeniusMap(num, 6), num); - // t0^(q²) * t0 - const t1 = Fp12.mul(Fp12.frobeniusMap(t0, 2), t0); - const t2 = Fp12.conjugate(Fp12._cyclotomicExp(t1, x)); - const t3 = Fp12.mul(Fp12.conjugate(Fp12._cyclotomicSquare(t1)), t2); - const t4 = Fp12.conjugate(Fp12._cyclotomicExp(t3, x)); - const t5 = Fp12.conjugate(Fp12._cyclotomicExp(t4, x)); - const t6 = Fp12.mul(Fp12.conjugate(Fp12._cyclotomicExp(t5, x)), Fp12._cyclotomicSquare(t2)); - const t7 = Fp12.conjugate(Fp12._cyclotomicExp(t6, x)); - const t2_t5_pow_q2 = Fp12.frobeniusMap(Fp12.mul(t2, t5), 2); - const t4_t1_pow_q3 = Fp12.frobeniusMap(Fp12.mul(t4, t1), 3); - const t6_t1c_pow_q1 = Fp12.frobeniusMap(Fp12.mul(t6, Fp12.conjugate(t1)), 1); - const t7_t3c_t1 = Fp12.mul(Fp12.mul(t7, Fp12.conjugate(t3)), t1); - // (t2 * t5)^(q²) * (t4 * t1)^(q³) * (t6 * t1.conj)^(q^1) * t7 * t3.conj * t1 - return Fp12.mul(Fp12.mul(Fp12.mul(t2_t5_pow_q2, t4_t1_pow_q3), t6_t1c_pow_q1), t7_t3c_t1); - }, -}; -const FP12_FROBENIUS_COEFFICIENTS = [ - [BigInt('0x1'), BigInt('0x0')], - [ - BigInt('0x1904d3bf02bb0667c231beb4202c0d1f0fd603fd3cbd5f4f7b2443d784bab9c4f67ea53d63e7813d8d0775ed92235fb8'), - BigInt('0x00fc3e2b36c4e03288e9e902231f9fb854a14787b6c7b36fec0c8ec971f63c5f282d5ac14d6c7ec22cf78a126ddc4af3'), - ], - [ - BigInt('0x00000000000000005f19672fdf76ce51ba69c6076a0f77eaddb3a93be6f89688de17d813620a00022e01fffffffeffff'), - BigInt('0x0'), - ], - [ - BigInt('0x135203e60180a68ee2e9c448d77a2cd91c3dedd930b1cf60ef396489f61eb45e304466cf3e67fa0af1ee7b04121bdea2'), - BigInt('0x06af0e0437ff400b6831e36d6bd17ffe48395dabc2d3435e77f76e17009241c5ee67992f72ec05f4c81084fbede3cc09'), - ], - [ - BigInt('0x00000000000000005f19672fdf76ce51ba69c6076a0f77eaddb3a93be6f89688de17d813620a00022e01fffffffefffe'), - BigInt('0x0'), - ], - [ - BigInt('0x144e4211384586c16bd3ad4afa99cc9170df3560e77982d0db45f3536814f0bd5871c1908bd478cd1ee605167ff82995'), - BigInt('0x05b2cfd9013a5fd8df47fa6b48b1e045f39816240c0b8fee8beadf4d8e9c0566c63a3e6e257f87329b18fae980078116'), - ], - [ - BigInt('0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaaa'), - BigInt('0x0'), - ], - [ - BigInt('0x00fc3e2b36c4e03288e9e902231f9fb854a14787b6c7b36fec0c8ec971f63c5f282d5ac14d6c7ec22cf78a126ddc4af3'), - BigInt('0x1904d3bf02bb0667c231beb4202c0d1f0fd603fd3cbd5f4f7b2443d784bab9c4f67ea53d63e7813d8d0775ed92235fb8'), - ], - [ - BigInt('0x1a0111ea397fe699ec02408663d4de85aa0d857d89759ad4897d29650fb85f9b409427eb4f49fffd8bfd00000000aaac'), - BigInt('0x0'), - ], - [ - BigInt('0x06af0e0437ff400b6831e36d6bd17ffe48395dabc2d3435e77f76e17009241c5ee67992f72ec05f4c81084fbede3cc09'), - BigInt('0x135203e60180a68ee2e9c448d77a2cd91c3dedd930b1cf60ef396489f61eb45e304466cf3e67fa0af1ee7b04121bdea2'), - ], - [ - BigInt('0x1a0111ea397fe699ec02408663d4de85aa0d857d89759ad4897d29650fb85f9b409427eb4f49fffd8bfd00000000aaad'), - BigInt('0x0'), - ], - [ - BigInt('0x05b2cfd9013a5fd8df47fa6b48b1e045f39816240c0b8fee8beadf4d8e9c0566c63a3e6e257f87329b18fae980078116'), - BigInt('0x144e4211384586c16bd3ad4afa99cc9170df3560e77982d0db45f3536814f0bd5871c1908bd478cd1ee605167ff82995'), - ], -].map((n) => Fp2.fromBigTuple(n)); -// END OF CURVE FIELDS -// HashToCurve -// 3-isogeny map from E' to E https://www.rfc-editor.org/rfc/rfc9380#appendix-E.3 -const isogenyMapG2 = (0, hash_to_curve_js_1.isogenyMap)(Fp2, [ - // xNum - [ - [ - '0x5c759507e8e333ebb5b7a9a47d7ed8532c52d39fd3a042a88b58423c50ae15d5c2638e343d9c71c6238aaaaaaaa97d6', - '0x5c759507e8e333ebb5b7a9a47d7ed8532c52d39fd3a042a88b58423c50ae15d5c2638e343d9c71c6238aaaaaaaa97d6', - ], - [ - '0x0', - '0x11560bf17baa99bc32126fced787c88f984f87adf7ae0c7f9a208c6b4f20a4181472aaa9cb8d555526a9ffffffffc71a', - ], - [ - '0x11560bf17baa99bc32126fced787c88f984f87adf7ae0c7f9a208c6b4f20a4181472aaa9cb8d555526a9ffffffffc71e', - '0x8ab05f8bdd54cde190937e76bc3e447cc27c3d6fbd7063fcd104635a790520c0a395554e5c6aaaa9354ffffffffe38d', - ], - [ - '0x171d6541fa38ccfaed6dea691f5fb614cb14b4e7f4e810aa22d6108f142b85757098e38d0f671c7188e2aaaaaaaa5ed1', - '0x0', - ], - ], - // xDen - [ - [ - '0x0', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaa63', - ], - [ - '0xc', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaa9f', - ], - ['0x1', '0x0'], // LAST 1 - ], - // yNum - [ - [ - '0x1530477c7ab4113b59a4c18b076d11930f7da5d4a07f649bf54439d87d27e500fc8c25ebf8c92f6812cfc71c71c6d706', - '0x1530477c7ab4113b59a4c18b076d11930f7da5d4a07f649bf54439d87d27e500fc8c25ebf8c92f6812cfc71c71c6d706', - ], - [ - '0x0', - '0x5c759507e8e333ebb5b7a9a47d7ed8532c52d39fd3a042a88b58423c50ae15d5c2638e343d9c71c6238aaaaaaaa97be', - ], - [ - '0x11560bf17baa99bc32126fced787c88f984f87adf7ae0c7f9a208c6b4f20a4181472aaa9cb8d555526a9ffffffffc71c', - '0x8ab05f8bdd54cde190937e76bc3e447cc27c3d6fbd7063fcd104635a790520c0a395554e5c6aaaa9354ffffffffe38f', - ], - [ - '0x124c9ad43b6cf79bfbf7043de3811ad0761b0f37a1e26286b0e977c69aa274524e79097a56dc4bd9e1b371c71c718b10', - '0x0', - ], - ], - // yDen - [ - [ - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffa8fb', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffa8fb', - ], - [ - '0x0', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffa9d3', - ], - [ - '0x12', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaa99', - ], - ['0x1', '0x0'], // LAST 1 - ], -].map((i) => i.map((pair) => Fp2.fromBigTuple(pair.map(BigInt))))); -// 11-isogeny map from E' to E -const isogenyMapG1 = (0, hash_to_curve_js_1.isogenyMap)(Fp, [ - // xNum - [ - '0x11a05f2b1e833340b809101dd99815856b303e88a2d7005ff2627b56cdb4e2c85610c2d5f2e62d6eaeac1662734649b7', - '0x17294ed3e943ab2f0588bab22147a81c7c17e75b2f6a8417f565e33c70d1e86b4838f2a6f318c356e834eef1b3cb83bb', - '0xd54005db97678ec1d1048c5d10a9a1bce032473295983e56878e501ec68e25c958c3e3d2a09729fe0179f9dac9edcb0', - '0x1778e7166fcc6db74e0609d307e55412d7f5e4656a8dbf25f1b33289f1b330835336e25ce3107193c5b388641d9b6861', - '0xe99726a3199f4436642b4b3e4118e5499db995a1257fb3f086eeb65982fac18985a286f301e77c451154ce9ac8895d9', - '0x1630c3250d7313ff01d1201bf7a74ab5db3cb17dd952799b9ed3ab9097e68f90a0870d2dcae73d19cd13c1c66f652983', - '0xd6ed6553fe44d296a3726c38ae652bfb11586264f0f8ce19008e218f9c86b2a8da25128c1052ecaddd7f225a139ed84', - '0x17b81e7701abdbe2e8743884d1117e53356de5ab275b4db1a682c62ef0f2753339b7c8f8c8f475af9ccb5618e3f0c88e', - '0x80d3cf1f9a78fc47b90b33563be990dc43b756ce79f5574a2c596c928c5d1de4fa295f296b74e956d71986a8497e317', - '0x169b1f8e1bcfa7c42e0c37515d138f22dd2ecb803a0c5c99676314baf4bb1b7fa3190b2edc0327797f241067be390c9e', - '0x10321da079ce07e272d8ec09d2565b0dfa7dccdde6787f96d50af36003b14866f69b771f8c285decca67df3f1605fb7b', - '0x6e08c248e260e70bd1e962381edee3d31d79d7e22c837bc23c0bf1bc24c6b68c24b1b80b64d391fa9c8ba2e8ba2d229', - ], - // xDen - [ - '0x8ca8d548cff19ae18b2e62f4bd3fa6f01d5ef4ba35b48ba9c9588617fc8ac62b558d681be343df8993cf9fa40d21b1c', - '0x12561a5deb559c4348b4711298e536367041e8ca0cf0800c0126c2588c48bf5713daa8846cb026e9e5c8276ec82b3bff', - '0xb2962fe57a3225e8137e629bff2991f6f89416f5a718cd1fca64e00b11aceacd6a3d0967c94fedcfcc239ba5cb83e19', - '0x3425581a58ae2fec83aafef7c40eb545b08243f16b1655154cca8abc28d6fd04976d5243eecf5c4130de8938dc62cd8', - '0x13a8e162022914a80a6f1d5f43e7a07dffdfc759a12062bb8d6b44e833b306da9bd29ba81f35781d539d395b3532a21e', - '0xe7355f8e4e667b955390f7f0506c6e9395735e9ce9cad4d0a43bcef24b8982f7400d24bc4228f11c02df9a29f6304a5', - '0x772caacf16936190f3e0c63e0596721570f5799af53a1894e2e073062aede9cea73b3538f0de06cec2574496ee84a3a', - '0x14a7ac2a9d64a8b230b3f5b074cf01996e7f63c21bca68a81996e1cdf9822c580fa5b9489d11e2d311f7d99bbdcc5a5e', - '0xa10ecf6ada54f825e920b3dafc7a3cce07f8d1d7161366b74100da67f39883503826692abba43704776ec3a79a1d641', - '0x95fc13ab9e92ad4476d6e3eb3a56680f682b4ee96f7d03776df533978f31c1593174e4b4b7865002d6384d168ecdd0a', - '0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001', // LAST 1 - ], - // yNum - [ - '0x90d97c81ba24ee0259d1f094980dcfa11ad138e48a869522b52af6c956543d3cd0c7aee9b3ba3c2be9845719707bb33', - '0x134996a104ee5811d51036d776fb46831223e96c254f383d0f906343eb67ad34d6c56711962fa8bfe097e75a2e41c696', - '0xcc786baa966e66f4a384c86a3b49942552e2d658a31ce2c344be4b91400da7d26d521628b00523b8dfe240c72de1f6', - '0x1f86376e8981c217898751ad8746757d42aa7b90eeb791c09e4a3ec03251cf9de405aba9ec61deca6355c77b0e5f4cb', - '0x8cc03fdefe0ff135caf4fe2a21529c4195536fbe3ce50b879833fd221351adc2ee7f8dc099040a841b6daecf2e8fedb', - '0x16603fca40634b6a2211e11db8f0a6a074a7d0d4afadb7bd76505c3d3ad5544e203f6326c95a807299b23ab13633a5f0', - '0x4ab0b9bcfac1bbcb2c977d027796b3ce75bb8ca2be184cb5231413c4d634f3747a87ac2460f415ec961f8855fe9d6f2', - '0x987c8d5333ab86fde9926bd2ca6c674170a05bfe3bdd81ffd038da6c26c842642f64550fedfe935a15e4ca31870fb29', - '0x9fc4018bd96684be88c9e221e4da1bb8f3abd16679dc26c1e8b6e6a1f20cabe69d65201c78607a360370e577bdba587', - '0xe1bba7a1186bdb5223abde7ada14a23c42a0ca7915af6fe06985e7ed1e4d43b9b3f7055dd4eba6f2bafaaebca731c30', - '0x19713e47937cd1be0dfd0b8f1d43fb93cd2fcbcb6caf493fd1183e416389e61031bf3a5cce3fbafce813711ad011c132', - '0x18b46a908f36f6deb918c143fed2edcc523559b8aaf0c2462e6bfe7f911f643249d9cdf41b44d606ce07c8a4d0074d8e', - '0xb182cac101b9399d155096004f53f447aa7b12a3426b08ec02710e807b4633f06c851c1919211f20d4c04f00b971ef8', - '0x245a394ad1eca9b72fc00ae7be315dc757b3b080d4c158013e6632d3c40659cc6cf90ad1c232a6442d9d3f5db980133', - '0x5c129645e44cf1102a159f748c4a3fc5e673d81d7e86568d9ab0f5d396a7ce46ba1049b6579afb7866b1e715475224b', - '0x15e6be4e990f03ce4ea50b3b42df2eb5cb181d8f84965a3957add4fa95af01b2b665027efec01c7704b456be69c8b604', - ], - // yDen - [ - '0x16112c4c3a9c98b252181140fad0eae9601a6de578980be6eec3232b5be72e7a07f3688ef60c206d01479253b03663c1', - '0x1962d75c2381201e1a0cbd6c43c348b885c84ff731c4d59ca4a10356f453e01f78a4260763529e3532f6102c2e49a03d', - '0x58df3306640da276faaae7d6e8eb15778c4855551ae7f310c35a5dd279cd2eca6757cd636f96f891e2538b53dbf67f2', - '0x16b7d288798e5395f20d23bf89edb4d1d115c5dbddbcd30e123da489e726af41727364f2c28297ada8d26d98445f5416', - '0xbe0e079545f43e4b00cc912f8228ddcc6d19c9f0f69bbb0542eda0fc9dec916a20b15dc0fd2ededda39142311a5001d', - '0x8d9e5297186db2d9fb266eaac783182b70152c65550d881c5ecd87b6f0f5a6449f38db9dfa9cce202c6477faaf9b7ac', - '0x166007c08a99db2fc3ba8734ace9824b5eecfdfa8d0cf8ef5dd365bc400a0051d5fa9c01a58b1fb93d1a1399126a775c', - '0x16a3ef08be3ea7ea03bcddfabba6ff6ee5a4375efa1f4fd7feb34fd206357132b920f5b00801dee460ee415a15812ed9', - '0x1866c8ed336c61231a1be54fd1d74cc4f9fb0ce4c6af5920abc5750c4bf39b4852cfe2f7bb9248836b233d9d55535d4a', - '0x167a55cda70a6e1cea820597d94a84903216f763e13d87bb5308592e7ea7d4fbc7385ea3d529b35e346ef48bb8913f55', - '0x4d2f259eea405bd48f010a01ad2911d9c6dd039bb61a6290e591b36e636a5c871a5c29f4f83060400f8b49cba8f6aa8', - '0xaccbb67481d033ff5852c1e48c50c477f94ff8aefce42d28c0f9a88cea7913516f968986f7ebbea9684b529e2561092', - '0xad6b9514c767fe3c3613144b45f1496543346d98adf02267d5ceef9a00d9b8693000763e3b90ac11e99b138573345cc', - '0x2660400eb2e4f3b628bdd0d53cd76f2bf565b94e72927c1cb748df27942480e420517bd8714cc80d1fadc1326ed06f7', - '0xe0fa1d816ddc03e6b24255e0d7819c171c40f65e273b853324efcd6356caa205ca2f570f13497804415473a1d634b8f', - '0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001', // LAST 1 - ], -].map((i) => i.map((j) => BigInt(j)))); -// SWU Map - Fp2 to G2': y² = x³ + 240i * x + 1012 + 1012i -const G2_SWU = (0, weierstrass_js_1.mapToCurveSimpleSWU)(Fp2, { - A: Fp2.create({ c0: Fp.create(_0n), c1: Fp.create(BigInt(240)) }), - B: Fp2.create({ c0: Fp.create(BigInt(1012)), c1: Fp.create(BigInt(1012)) }), - Z: Fp2.create({ c0: Fp.create(BigInt(-2)), c1: Fp.create(BigInt(-1)) }), // Z: -(2 + I) -}); -// Optimized SWU Map - Fp to G1 -const G1_SWU = (0, weierstrass_js_1.mapToCurveSimpleSWU)(Fp, { - A: Fp.create(BigInt('0x144698a3b8e9433d693a02c96d4982b0ea985383ee66a8d8e8981aefd881ac98936f8da0e0f97f5cf428082d584c1d')), - B: Fp.create(BigInt('0x12e2908d11688030018b12e8753eee3b2016c1f0f24f4070a0b9c14fcef35ef55a23215a316ceaa5d1cc48e98e172be0')), - Z: Fp.create(BigInt(11)), -}); -// Endomorphisms (for fast cofactor clearing) -// Ψ(P) endomorphism -const ut_root = Fp6.create({ c0: Fp2.ZERO, c1: Fp2.ONE, c2: Fp2.ZERO }); -const wsq = Fp12.create({ c0: ut_root, c1: Fp6.ZERO }); -const wcu = Fp12.create({ c0: Fp6.ZERO, c1: ut_root }); -const [wsq_inv, wcu_inv] = Fp12.invertBatch([wsq, wcu]); -function psi(x, y) { - // Untwist Fp2->Fp12 && frobenius(1) && twist back - const x2 = Fp12.mul(Fp12.frobeniusMap(Fp12.multiplyByFp2(wsq_inv, x), 1), wsq).c0.c0; - const y2 = Fp12.mul(Fp12.frobeniusMap(Fp12.multiplyByFp2(wcu_inv, y), 1), wcu).c0.c0; - return [x2, y2]; -} -// Ψ endomorphism -function G2psi(c, P) { - const affine = P.toAffine(); - const p = psi(affine.x, affine.y); - return new c(p[0], p[1], Fp2.ONE); -} -// Ψ²(P) endomorphism -// 1 / F2(2)^((p-1)/3) in GF(p²) -const PSI2_C1 = BigInt('0x1a0111ea397fe699ec02408663d4de85aa0d857d89759ad4897d29650fb85f9b409427eb4f49fffd8bfd00000000aaac'); -function psi2(x, y) { - return [Fp2.mul(x, PSI2_C1), Fp2.neg(y)]; -} -function G2psi2(c, P) { - const affine = P.toAffine(); - const p = psi2(affine.x, affine.y); - return new c(p[0], p[1], Fp2.ONE); -} -// Default hash_to_field options are for hash to G2. -// -// Parameter definitions are in section 5.3 of the spec unless otherwise noted. -// Parameter values come from section 8.8.2 of the spec. -// https://www.rfc-editor.org/rfc/rfc9380#section-8.8.2 -// -// Base field F is GF(p^m) -// p = 0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab -// m = 2 (or 1 for G1 see section 8.8.1) -// k = 128 -const htfDefaults = Object.freeze({ - // DST: a domain separation tag - // defined in section 2.2.5 - // Use utils.getDSTLabel(), utils.setDSTLabel(value) - DST: 'BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_NUL_', - encodeDST: 'BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_NUL_', - // p: the characteristic of F - // where F is a finite field of characteristic p and order q = p^m - p: Fp.ORDER, - // m: the extension degree of F, m >= 1 - // where F is a finite field of characteristic p and order q = p^m - m: 2, - // k: the target security level for the suite in bits - // defined in section 5.1 - k: 128, - // option to use a message that has already been processed by - // expand_message_xmd - expand: 'xmd', - // Hash functions for: expand_message_xmd is appropriate for use with a - // wide range of hash functions, including SHA-2, SHA-3, BLAKE2, and others. - // BBS+ uses blake2: https://github.com/hyperledger/aries-framework-go/issues/2247 - hash: sha256_1.sha256, -}); -// Encoding utils -// Point on G1 curve: (x, y) -const C_BIT_POS = Fp.BITS; // C_bit, compression bit for serialization flag -const I_BIT_POS = Fp.BITS + 1; // I_bit, point-at-infinity bit for serialization flag -const S_BIT_POS = Fp.BITS + 2; // S_bit, sign bit for serialization flag -// Compressed point of infinity -const COMPRESSED_ZERO = Fp.toBytes((0, utils_js_1.bitSet)((0, utils_js_1.bitSet)(_0n, I_BIT_POS, true), S_BIT_POS, true)); // set compressed & point-at-infinity bits -function signatureG2ToRawBytes(point) { - // NOTE: by some reasons it was missed in bls12-381, looks like bug - point.assertValidity(); - const len = Fp.BYTES; - if (point.equals(exports.bls12_381.G2.ProjectivePoint.ZERO)) - return (0, utils_js_1.concatBytes)(COMPRESSED_ZERO, (0, utils_js_1.numberToBytesBE)(_0n, len)); - const { x, y } = point.toAffine(); - const { re: x0, im: x1 } = Fp2.reim(x); - const { re: y0, im: y1 } = Fp2.reim(y); - const tmp = y1 > _0n ? y1 * _2n : y0 * _2n; - const aflag1 = Boolean((tmp / Fp.ORDER) & _1n); - const z1 = (0, utils_js_1.bitSet)((0, utils_js_1.bitSet)(x1, 381, aflag1), S_BIT_POS, true); - const z2 = x0; - return (0, utils_js_1.concatBytes)((0, utils_js_1.numberToBytesBE)(z1, len), (0, utils_js_1.numberToBytesBE)(z2, len)); -} -// To verify curve parameters, see pairing-friendly-curves spec: -// https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-pairing-friendly-curves-11 -// Basic math is done over finite fields over p. -// More complicated math is done over polynominal extension fields. -// To simplify calculations in Fp12, we construct extension tower: -// Fp₁₂ = Fp₆² => Fp₂³ -// Fp(u) / (u² - β) where β = -1 -// Fp₂(v) / (v³ - ξ) where ξ = u + 1 -// Fp₆(w) / (w² - γ) where γ = v -// Here goes constants && point encoding format -exports.bls12_381 = (0, bls_js_1.bls)({ - // Fields - fields: { - Fp, - Fp2, - Fp6, - Fp12, - Fr, - }, - // G1 is the order-q subgroup of E1(Fp) : y² = x³ + 4, #E1(Fp) = h1q, where - // characteristic; z + (z⁴ - z² + 1)(z - 1)²/3 - G1: { - Fp, - // cofactor; (z - 1)²/3 - h: BigInt('0x396c8c005555e1568c00aaab0000aaab'), - // generator's coordinates - // x = 3685416753713387016781088315183077757961620795782546409894578378688607592378376318836054947676345821548104185464507 - // y = 1339506544944476473020471379941921221584933875938349620426543736416511423956333506472724655353366534992391756441569 - Gx: BigInt('0x17f1d3a73197d7942695638c4fa9ac0fc3688c4f9774b905a14e3a3f171bac586c55e83ff97a1aeffb3af00adb22c6bb'), - Gy: BigInt('0x08b3f481e3aaa0f1a09e30ed741d8ae4fcf5e095d5d00af600db18cb2c04b3edd03cc744a2888ae40caa232946c5e7e1'), - a: Fp.ZERO, - b: _4n, - htfDefaults: { ...htfDefaults, m: 1 }, - wrapPrivateKey: true, - allowInfinityPoint: true, - // Checks is the point resides in prime-order subgroup. - // point.isTorsionFree() should return true for valid points - // It returns false for shitty points. - // https://eprint.iacr.org/2021/1130.pdf - isTorsionFree: (c, point) => { - // φ endomorphism - const cubicRootOfUnityModP = BigInt('0x5f19672fdf76ce51ba69c6076a0f77eaddb3a93be6f89688de17d813620a00022e01fffffffefffe'); - const phi = new c(Fp.mul(point.px, cubicRootOfUnityModP), point.py, point.pz); - // todo: unroll - const xP = point.multiplyUnsafe(exports.bls12_381.params.x).negate(); // [x]P - const u2P = xP.multiplyUnsafe(exports.bls12_381.params.x); // [u2]P - return u2P.equals(phi); - // https://eprint.iacr.org/2019/814.pdf - // (z² − 1)/3 - // const c1 = BigInt('0x396c8c005555e1560000000055555555'); - // const P = this; - // const S = P.sigma(); - // const Q = S.double(); - // const S2 = S.sigma(); - // // [(z² − 1)/3](2σ(P) − P − σ²(P)) − σ²(P) = O - // const left = Q.subtract(P).subtract(S2).multiplyUnsafe(c1); - // const C = left.subtract(S2); - // return C.isZero(); - }, - // Clear cofactor of G1 - // https://eprint.iacr.org/2019/403 - clearCofactor: (_c, point) => { - // return this.multiplyUnsafe(CURVE.h); - return point.multiplyUnsafe(exports.bls12_381.params.x).add(point); // x*P + P - }, - mapToCurve: (scalars) => { - const { x, y } = G1_SWU(Fp.create(scalars[0])); - return isogenyMapG1(x, y); - }, - fromBytes: (bytes) => { - bytes = bytes.slice(); - if (bytes.length === 48) { - // TODO: Fp.bytes - const P = Fp.ORDER; - const compressedValue = (0, utils_js_1.bytesToNumberBE)(bytes); - const bflag = (0, utils_js_1.bitGet)(compressedValue, I_BIT_POS); - // Zero - if (bflag === _1n) - return { x: _0n, y: _0n }; - const x = Fp.create(compressedValue & Fp.MASK); - const right = Fp.add(Fp.pow(x, _3n), Fp.create(exports.bls12_381.params.G1b)); // y² = x³ + b - let y = Fp.sqrt(right); - if (!y) - throw new Error('Invalid compressed G1 point'); - const aflag = (0, utils_js_1.bitGet)(compressedValue, C_BIT_POS); - if ((y * _2n) / P !== aflag) - y = Fp.neg(y); - return { x: Fp.create(x), y: Fp.create(y) }; - } - else if (bytes.length === 96) { - // Check if the infinity flag is set - if ((bytes[0] & (1 << 6)) !== 0) - return exports.bls12_381.G1.ProjectivePoint.ZERO.toAffine(); - const x = (0, utils_js_1.bytesToNumberBE)(bytes.subarray(0, Fp.BYTES)); - const y = (0, utils_js_1.bytesToNumberBE)(bytes.subarray(Fp.BYTES)); - return { x: Fp.create(x), y: Fp.create(y) }; - } - else { - throw new Error('Invalid point G1, expected 48/96 bytes'); - } - }, - toBytes: (c, point, isCompressed) => { - const isZero = point.equals(c.ZERO); - const { x, y } = point.toAffine(); - if (isCompressed) { - if (isZero) - return COMPRESSED_ZERO.slice(); - const P = Fp.ORDER; - let num; - num = (0, utils_js_1.bitSet)(x, C_BIT_POS, Boolean((y * _2n) / P)); // set aflag - num = (0, utils_js_1.bitSet)(num, S_BIT_POS, true); - return (0, utils_js_1.numberToBytesBE)(num, Fp.BYTES); - } - else { - if (isZero) { - // 2x PUBLIC_KEY_LENGTH - const x = (0, utils_js_1.concatBytes)(new Uint8Array([0x40]), new Uint8Array(2 * Fp.BYTES - 1)); - return x; - } - else { - return (0, utils_js_1.concatBytes)((0, utils_js_1.numberToBytesBE)(x, Fp.BYTES), (0, utils_js_1.numberToBytesBE)(y, Fp.BYTES)); - } - } - }, - }, - // G2 is the order-q subgroup of E2(Fp²) : y² = x³+4(1+√−1), - // where Fp2 is Fp[√−1]/(x2+1). #E2(Fp2 ) = h2q, where - // G² - 1 - // h2q - G2: { - Fp: Fp2, - // cofactor - h: BigInt('0x5d543a95414e7f1091d50792876a202cd91de4547085abaa68a205b2e5a7ddfa628f1cb4d9e82ef21537e293a6691ae1616ec6e786f0c70cf1c38e31c7238e5'), - Gx: Fp2.fromBigTuple([ - BigInt('0x024aa2b2f08f0a91260805272dc51051c6e47ad4fa403b02b4510b647ae3d1770bac0326a805bbefd48056c8c121bdb8'), - BigInt('0x13e02b6052719f607dacd3a088274f65596bd0d09920b61ab5da61bbdc7f5049334cf11213945d57e5ac7d055d042b7e'), - ]), - // y = - // 927553665492332455747201965776037880757740193453592970025027978793976877002675564980949289727957565575433344219582, - // 1985150602287291935568054521177171638300868978215655730859378665066344726373823718423869104263333984641494340347905 - Gy: Fp2.fromBigTuple([ - BigInt('0x0ce5d527727d6e118cc9cdc6da2e351aadfd9baa8cbdd3a76d429a695160d12c923ac9cc3baca289e193548608b82801'), - BigInt('0x0606c4a02ea734cc32acd2b02bc28b99cb3e287e85a763af267492ab572e99ab3f370d275cec1da1aaa9075ff05f79be'), - ]), - a: Fp2.ZERO, - b: Fp2.fromBigTuple([_4n, _4n]), - hEff: BigInt('0xbc69f08f2ee75b3584c6a0ea91b352888e2a8e9145ad7689986ff031508ffe1329c2f178731db956d82bf015d1212b02ec0ec69d7477c1ae954cbc06689f6a359894c0adebbf6b4e8020005aaa95551'), - htfDefaults: { ...htfDefaults }, - wrapPrivateKey: true, - allowInfinityPoint: true, - mapToCurve: (scalars) => { - const { x, y } = G2_SWU(Fp2.fromBigTuple(scalars)); - return isogenyMapG2(x, y); - }, - // Checks is the point resides in prime-order subgroup. - // point.isTorsionFree() should return true for valid points - // It returns false for shitty points. - // https://eprint.iacr.org/2021/1130.pdf - isTorsionFree: (c, P) => { - return P.multiplyUnsafe(exports.bls12_381.params.x).negate().equals(G2psi(c, P)); // ψ(P) == [u](P) - // Older version: https://eprint.iacr.org/2019/814.pdf - // Ψ²(P) => Ψ³(P) => [z]Ψ³(P) where z = -x => [z]Ψ³(P) - Ψ²(P) + P == O - // return P.psi2().psi().mulNegX().subtract(psi2).add(P).isZero(); - }, - // Maps the point into the prime-order subgroup G2. - // clear_cofactor_bls12381_g2 from cfrg-hash-to-curve-11 - // https://eprint.iacr.org/2017/419.pdf - // prettier-ignore - clearCofactor: (c, P) => { - const x = exports.bls12_381.params.x; - let t1 = P.multiplyUnsafe(x).negate(); // [-x]P - let t2 = G2psi(c, P); // Ψ(P) - let t3 = P.double(); // 2P - t3 = G2psi2(c, t3); // Ψ²(2P) - t3 = t3.subtract(t2); // Ψ²(2P) - Ψ(P) - t2 = t1.add(t2); // [-x]P + Ψ(P) - t2 = t2.multiplyUnsafe(x).negate(); // [x²]P - [x]Ψ(P) - t3 = t3.add(t2); // Ψ²(2P) - Ψ(P) + [x²]P - [x]Ψ(P) - t3 = t3.subtract(t1); // Ψ²(2P) - Ψ(P) + [x²]P - [x]Ψ(P) + [x]P - const Q = t3.subtract(P); // Ψ²(2P) - Ψ(P) + [x²]P - [x]Ψ(P) + [x]P - 1P - return Q; // [x²-x-1]P + [x-1]Ψ(P) + Ψ²(2P) - }, - fromBytes: (bytes) => { - bytes = bytes.slice(); - const m_byte = bytes[0] & 0xe0; - if (m_byte === 0x20 || m_byte === 0x60 || m_byte === 0xe0) { - throw new Error('Invalid encoding flag: ' + m_byte); - } - const bitC = m_byte & 0x80; // compression bit - const bitI = m_byte & 0x40; // point at infinity bit - const bitS = m_byte & 0x20; // sign bit - const L = Fp.BYTES; - const slc = (b, from, to) => (0, utils_js_1.bytesToNumberBE)(b.slice(from, to)); - if (bytes.length === 96 && bitC) { - const b = exports.bls12_381.params.G2b; - const P = Fp.ORDER; - bytes[0] = bytes[0] & 0x1f; // clear flags - if (bitI) { - // check that all bytes are 0 - if (bytes.reduce((p, c) => (p !== 0 ? c + 1 : c), 0) > 0) { - throw new Error('Invalid compressed G2 point'); - } - return { x: Fp2.ZERO, y: Fp2.ZERO }; - } - const x_1 = slc(bytes, 0, L); - const x_0 = slc(bytes, L, 2 * L); - const x = Fp2.create({ c0: Fp.create(x_0), c1: Fp.create(x_1) }); - const right = Fp2.add(Fp2.pow(x, _3n), b); // y² = x³ + 4 * (u+1) = x³ + b - let y = Fp2.sqrt(right); - const Y_bit = y.c1 === _0n ? (y.c0 * _2n) / P : (y.c1 * _2n) / P ? _1n : _0n; - y = bitS > 0 && Y_bit > 0 ? y : Fp2.neg(y); - return { x, y }; - } - else if (bytes.length === 192 && !bitC) { - // Check if the infinity flag is set - if ((bytes[0] & (1 << 6)) !== 0) { - return { x: Fp2.ZERO, y: Fp2.ZERO }; - } - const x1 = slc(bytes, 0, L); - const x0 = slc(bytes, L, 2 * L); - const y1 = slc(bytes, 2 * L, 3 * L); - const y0 = slc(bytes, 3 * L, 4 * L); - return { x: Fp2.fromBigTuple([x0, x1]), y: Fp2.fromBigTuple([y0, y1]) }; - } - else { - throw new Error('Invalid point G2, expected 96/192 bytes'); - } - }, - toBytes: (c, point, isCompressed) => { - const { BYTES: len, ORDER: P } = Fp; - const isZero = point.equals(c.ZERO); - const { x, y } = point.toAffine(); - if (isCompressed) { - if (isZero) - return (0, utils_js_1.concatBytes)(COMPRESSED_ZERO, (0, utils_js_1.numberToBytesBE)(_0n, len)); - const flag = Boolean(y.c1 === _0n ? (y.c0 * _2n) / P : (y.c1 * _2n) / P); - // set compressed & sign bits (looks like different offsets than for G1/Fp?) - let x_1 = (0, utils_js_1.bitSet)(x.c1, C_BIT_POS, flag); - x_1 = (0, utils_js_1.bitSet)(x_1, S_BIT_POS, true); - return (0, utils_js_1.concatBytes)((0, utils_js_1.numberToBytesBE)(x_1, len), (0, utils_js_1.numberToBytesBE)(x.c0, len)); - } - else { - if (isZero) - return (0, utils_js_1.concatBytes)(new Uint8Array([0x40]), new Uint8Array(4 * len - 1)); // bytes[0] |= 1 << 6; - const { re: x0, im: x1 } = Fp2.reim(x); - const { re: y0, im: y1 } = Fp2.reim(y); - return (0, utils_js_1.concatBytes)((0, utils_js_1.numberToBytesBE)(x1, len), (0, utils_js_1.numberToBytesBE)(x0, len), (0, utils_js_1.numberToBytesBE)(y1, len), (0, utils_js_1.numberToBytesBE)(y0, len)); - } - }, - Signature: { - // TODO: Optimize, it's very slow because of sqrt. - fromHex(hex) { - hex = (0, utils_js_1.ensureBytes)('signatureHex', hex); - const P = Fp.ORDER; - const half = hex.length / 2; - if (half !== 48 && half !== 96) - throw new Error('Invalid compressed signature length, must be 96 or 192'); - const z1 = (0, utils_js_1.bytesToNumberBE)(hex.slice(0, half)); - const z2 = (0, utils_js_1.bytesToNumberBE)(hex.slice(half)); - // Indicates the infinity point - const bflag1 = (0, utils_js_1.bitGet)(z1, I_BIT_POS); - if (bflag1 === _1n) - return exports.bls12_381.G2.ProjectivePoint.ZERO; - const x1 = Fp.create(z1 & Fp.MASK); - const x2 = Fp.create(z2); - const x = Fp2.create({ c0: x2, c1: x1 }); - const y2 = Fp2.add(Fp2.pow(x, _3n), exports.bls12_381.params.G2b); // y² = x³ + 4 - // The slow part - let y = Fp2.sqrt(y2); - if (!y) - throw new Error('Failed to find a square root'); - // Choose the y whose leftmost bit of the imaginary part is equal to the a_flag1 - // If y1 happens to be zero, then use the bit of y0 - const { re: y0, im: y1 } = Fp2.reim(y); - const aflag1 = (0, utils_js_1.bitGet)(z1, 381); - const isGreater = y1 > _0n && (y1 * _2n) / P !== aflag1; - const isZero = y1 === _0n && (y0 * _2n) / P !== aflag1; - if (isGreater || isZero) - y = Fp2.neg(y); - const point = exports.bls12_381.G2.ProjectivePoint.fromAffine({ x, y }); - point.assertValidity(); - return point; - }, - toRawBytes(point) { - return signatureG2ToRawBytes(point); - }, - toHex(point) { - return (0, utils_js_1.bytesToHex)(signatureG2ToRawBytes(point)); - }, - }, - }, - params: { - x: BLS_X, - r: Fr.ORDER, // order; z⁴ − z² + 1; CURVE.n from other curves - }, - htfDefaults, - hash: sha256_1.sha256, - randomBytes: utils_1.randomBytes, -}); -//# sourceMappingURL=bls12-381.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/bls12-381.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/bls12-381.js.map deleted file mode 100644 index fbed95ae..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/bls12-381.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bls12-381.js","sourceRoot":"","sources":["src/bls12-381.ts"],"names":[],"mappings":";AAAA,sEAAsE;;;AAEtE,uFAAuF;AACvF,gDAAgD;AAChD,kGAAkG;AAClG,+EAA+E;AAC/E,EAAE;AACF,mGAAmG;AACnG,+EAA+E;AAC/E,+FAA+F;AAC/F,2FAA2F;AAC3F,wEAAwE;AACxE,EAAE;AACF,cAAc;AACd,gDAAgD;AAChD,4BAA4B;AAC5B,2FAA2F;AAC3F,mHAAmH;AACnH,0FAA0F;AAC1F,2HAA2H;AAC3H,6CAA6C;AAC7C,EAAE;AACF,eAAe;AACf,+BAA+B;AAC/B,8BAA8B;AAC9B,0DAA0D;AAC1D,4EAA4E;AAC5E,6DAA6D;AAC7D,6DAA6D;AAC7D,iDAA8C;AAC9C,+CAAkD;AAClD,8CAAiD;AACjD,6CAA6C;AAC7C,kDAW6B;AAC7B,QAAQ;AACR,8DAKmC;AACnC,kEAAyD;AAEzD,qEAAqE;AACrE,kBAAkB;AAClB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CA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KAAyB;gBAC7B,OAAO,IAAA,qBAAU,EAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAAC;YAClD,CAAC;SACF;KACF;IACD,MAAM,EAAE;QACN,CAAC,EAAE,KAAK;QACR,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,gDAAgD;KAC9D;IACD,WAAW;IACX,IAAI,EAAE,eAAM;IACZ,WAAW,EAAX,mBAAW;CACZ,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/bn254.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/bn254.d.ts deleted file mode 100644 index fd7064ad..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/bn254.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * bn254 pairing-friendly curve. - * Previously known as alt_bn_128, when it had 128-bit security. - * Recent research shown it's weaker, the naming has been adjusted to its prime bit count. - * https://github.com/zcash/zcash/issues/2502 - */ -export declare const bn254: import("./abstract/weierstrass.js").CurveFn; -//# sourceMappingURL=bn254.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/bn254.d.ts.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/bn254.d.ts.map deleted file mode 100644 index 572db18a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/bn254.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bn254.d.ts","sourceRoot":"","sources":["src/bn254.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,eAAO,MAAM,KAAK,6CAShB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/bn254.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/bn254.js deleted file mode 100644 index 8b1c4b74..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/bn254.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.bn254 = void 0; -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const sha256_1 = require("@noble/hashes/sha256"); -const weierstrass_js_1 = require("./abstract/weierstrass.js"); -const _shortw_utils_js_1 = require("./_shortw_utils.js"); -const modular_js_1 = require("./abstract/modular.js"); -/** - * bn254 pairing-friendly curve. - * Previously known as alt_bn_128, when it had 128-bit security. - * Recent research shown it's weaker, the naming has been adjusted to its prime bit count. - * https://github.com/zcash/zcash/issues/2502 - */ -exports.bn254 = (0, weierstrass_js_1.weierstrass)({ - a: BigInt(0), - b: BigInt(3), - Fp: (0, modular_js_1.Field)(BigInt('0x30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47')), - n: BigInt('0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001'), - Gx: BigInt(1), - Gy: BigInt(2), - h: BigInt(1), - ...(0, _shortw_utils_js_1.getHash)(sha256_1.sha256), -}); -//# sourceMappingURL=bn254.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/bn254.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/bn254.js.map deleted file mode 100644 index a54fb586..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/bn254.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bn254.js","sourceRoot":"","sources":["src/bn254.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,iDAA8C;AAC9C,8DAAwD;AACxD,yDAA6C;AAC7C,sDAA8C;AAC9C;;;;;GAKG;AACU,QAAA,KAAK,GAAG,IAAA,4BAAW,EAAC;IAC/B,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,EAAE,EAAE,IAAA,kBAAK,EAAC,MAAM,CAAC,oEAAoE,CAAC,CAAC;IACvF,CAAC,EAAE,MAAM,CAAC,oEAAoE,CAAC;IAC/E,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;IACb,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;IACb,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,GAAG,IAAA,0BAAO,EAAC,eAAM,CAAC;CACnB,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/ed25519.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/ed25519.d.ts deleted file mode 100644 index 08b1e89c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/ed25519.d.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { ExtPointType } from './abstract/edwards.js'; -import { Hex } from './abstract/utils.js'; -import { htfBasicOpts } from './abstract/hash-to-curve.js'; -import { AffinePoint } from './abstract/curve.js'; -export declare const ED25519_TORSION_SUBGROUP: string[]; -export declare const ed25519: import("./abstract/edwards.js").CurveFn; -export declare const ed25519ctx: import("./abstract/edwards.js").CurveFn; -export declare const ed25519ph: import("./abstract/edwards.js").CurveFn; -export declare const x25519: import("./abstract/montgomery.js").CurveFn; -/** - * Converts ed25519 public key to x25519 public key. Uses formula: - * * `(u, v) = ((1+y)/(1-y), sqrt(-486664)*u/x)` - * * `(x, y) = (sqrt(-486664)*u/v, (u-1)/(u+1))` - * @example - * const someonesPub = ed25519.getPublicKey(ed25519.utils.randomPrivateKey()); - * const aPriv = x25519.utils.randomPrivateKey(); - * x25519.getSharedSecret(aPriv, edwardsToMontgomeryPub(someonesPub)) - */ -export declare function edwardsToMontgomeryPub(edwardsPub: Hex): Uint8Array; -export declare const edwardsToMontgomery: typeof edwardsToMontgomeryPub; -/** - * Converts ed25519 secret key to x25519 secret key. - * @example - * const someonesPub = x25519.getPublicKey(x25519.utils.randomPrivateKey()); - * const aPriv = ed25519.utils.randomPrivateKey(); - * x25519.getSharedSecret(edwardsToMontgomeryPriv(aPriv), someonesPub) - */ -export declare function edwardsToMontgomeryPriv(edwardsPriv: Uint8Array): Uint8Array; -export declare const hashToCurve: (msg: Uint8Array, options?: htfBasicOpts | undefined) => import("./abstract/hash-to-curve.js").H2CPoint; -export declare const encodeToCurve: (msg: Uint8Array, options?: htfBasicOpts | undefined) => import("./abstract/hash-to-curve.js").H2CPoint; -type ExtendedPoint = ExtPointType; -/** - * Each ed25519/ExtendedPoint has 8 different equivalent points. This can be - * a source of bugs for protocols like ring signatures. Ristretto was created to solve this. - * Ristretto point operates in X:Y:Z:T extended coordinates like ExtendedPoint, - * but it should work in its own namespace: do not combine those two. - * https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-ristretto255-decaf448 - */ -declare class RistPoint { - private readonly ep; - static BASE: RistPoint; - static ZERO: RistPoint; - constructor(ep: ExtendedPoint); - static fromAffine(ap: AffinePoint): RistPoint; - /** - * Takes uniform output of 64-byte hash function like sha512 and converts it to `RistrettoPoint`. - * The hash-to-group operation applies Elligator twice and adds the results. - * **Note:** this is one-way map, there is no conversion from point to hash. - * https://ristretto.group/formulas/elligator.html - * @param hex 64-byte output of a hash function - */ - static hashToCurve(hex: Hex): RistPoint; - /** - * Converts ristretto-encoded string to ristretto point. - * https://ristretto.group/formulas/decoding.html - * @param hex Ristretto-encoded 32 bytes. Not every 32-byte string is valid ristretto encoding - */ - static fromHex(hex: Hex): RistPoint; - /** - * Encodes ristretto point to Uint8Array. - * https://ristretto.group/formulas/encoding.html - */ - toRawBytes(): Uint8Array; - toHex(): string; - toString(): string; - equals(other: RistPoint): boolean; - add(other: RistPoint): RistPoint; - subtract(other: RistPoint): RistPoint; - multiply(scalar: bigint): RistPoint; - multiplyUnsafe(scalar: bigint): RistPoint; -} -export declare const RistrettoPoint: typeof RistPoint; -export declare const hashToRistretto255: (msg: Uint8Array, options: htfBasicOpts) => RistPoint; -export declare const hash_to_ristretto255: (msg: Uint8Array, options: htfBasicOpts) => RistPoint; -export {}; -//# sourceMappingURL=ed25519.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/ed25519.d.ts.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/ed25519.d.ts.map deleted file mode 100644 index 973b4620..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/ed25519.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed25519.d.ts","sourceRoot":"","sources":["src/ed25519.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAkB,MAAM,uBAAuB,CAAC;AAGrE,OAAO,EAKL,GAAG,EAEJ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAgB,YAAY,EAAsB,MAAM,6BAA6B,CAAC;AAC7F,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAwElD,eAAO,MAAM,wBAAwB,UASpC,CAAC;AA6BF,eAAO,MAAM,OAAO,yCAAkD,CAAC;AAYvE,eAAO,MAAM,UAAU,yCAGrB,CAAC;AACH,eAAO,MAAM,SAAS,yCAIpB,CAAC;AAEH,eAAO,MAAM,MAAM,4CAeZ,CAAC;AAER;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,GAAG,GAAG,UAAU,CAIlE;AACD,eAAO,MAAM,mBAAmB,+BAAyB,CAAC;AAE1D;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,UAAU,GAAG,UAAU,CAG3E;AA0FD,eAAO,MAAM,WAAW,iHAA4C,CAAC;AACrE,eAAO,MAAM,aAAa,iHAA8C,CAAC;AA+BzE,KAAK,aAAa,GAAG,YAAY,CAAC;AA0BlC;;;;;;GAMG;AACH,cAAM,SAAS;IAKD,OAAO,CAAC,QAAQ,CAAC,EAAE;IAJ/B,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC;IACvB,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC;gBAGM,EAAE,EAAE,aAAa;IAE9C,MAAM,CAAC,UAAU,CAAC,EAAE,EAAE,WAAW,CAAC,MAAM,CAAC;IAIzC;;;;;;OAMG;IACH,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,GAAG,SAAS;IASvC;;;;OAIG;IACH,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,SAAS;IA2BnC;;;OAGG;IACH,UAAU,IAAI,UAAU;IA4BxB,KAAK,IAAI,MAAM;IAIf,QAAQ,IAAI,MAAM;IAKlB,MAAM,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO;IAWjC,GAAG,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS;IAKhC,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS;IAKrC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS;IAInC,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS;CAG1C;AACD,eAAO,MAAM,cAAc,kBAIvB,CAAC;AAGL,eAAO,MAAM,kBAAkB,QAAS,UAAU,WAAW,YAAY,cAMxE,CAAC;AACF,eAAO,MAAM,oBAAoB,QAPO,UAAU,WAAW,YAAY,cAOnB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/ed25519.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/ed25519.js deleted file mode 100644 index 78554de0..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/ed25519.js +++ /dev/null @@ -1,439 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.hash_to_ristretto255 = exports.hashToRistretto255 = exports.RistrettoPoint = exports.encodeToCurve = exports.hashToCurve = exports.edwardsToMontgomeryPriv = exports.edwardsToMontgomery = exports.edwardsToMontgomeryPub = exports.x25519 = exports.ed25519ph = exports.ed25519ctx = exports.ed25519 = exports.ED25519_TORSION_SUBGROUP = void 0; -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const sha512_1 = require("@noble/hashes/sha512"); -const utils_1 = require("@noble/hashes/utils"); -const edwards_js_1 = require("./abstract/edwards.js"); -const montgomery_js_1 = require("./abstract/montgomery.js"); -const modular_js_1 = require("./abstract/modular.js"); -const utils_js_1 = require("./abstract/utils.js"); -const hash_to_curve_js_1 = require("./abstract/hash-to-curve.js"); -/** - * ed25519 Twisted Edwards curve with following addons: - * - X25519 ECDH - * - Ristretto cofactor elimination - * - Elligator hash-to-group / point indistinguishability - */ -const ED25519_P = BigInt('57896044618658097711785492504343953926634992332820282019728792003956564819949'); -// √(-1) aka √(a) aka 2^((p-1)/4) -const ED25519_SQRT_M1 = BigInt('19681161376707505956807079304988542015446066515923890162744021073123829784752'); -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _5n = BigInt(5); -// prettier-ignore -const _10n = BigInt(10), _20n = BigInt(20), _40n = BigInt(40), _80n = BigInt(80); -function ed25519_pow_2_252_3(x) { - const P = ED25519_P; - const x2 = (x * x) % P; - const b2 = (x2 * x) % P; // x^3, 11 - const b4 = ((0, modular_js_1.pow2)(b2, _2n, P) * b2) % P; // x^15, 1111 - const b5 = ((0, modular_js_1.pow2)(b4, _1n, P) * x) % P; // x^31 - const b10 = ((0, modular_js_1.pow2)(b5, _5n, P) * b5) % P; - const b20 = ((0, modular_js_1.pow2)(b10, _10n, P) * b10) % P; - const b40 = ((0, modular_js_1.pow2)(b20, _20n, P) * b20) % P; - const b80 = ((0, modular_js_1.pow2)(b40, _40n, P) * b40) % P; - const b160 = ((0, modular_js_1.pow2)(b80, _80n, P) * b80) % P; - const b240 = ((0, modular_js_1.pow2)(b160, _80n, P) * b80) % P; - const b250 = ((0, modular_js_1.pow2)(b240, _10n, P) * b10) % P; - const pow_p_5_8 = ((0, modular_js_1.pow2)(b250, _2n, P) * x) % P; - // ^ To pow to (p+3)/8, multiply it by x. - return { pow_p_5_8, b2 }; -} -function adjustScalarBytes(bytes) { - // Section 5: For X25519, in order to decode 32 random bytes as an integer scalar, - // set the three least significant bits of the first byte - bytes[0] &= 248; // 0b1111_1000 - // and the most significant bit of the last to zero, - bytes[31] &= 127; // 0b0111_1111 - // set the second most significant bit of the last byte to 1 - bytes[31] |= 64; // 0b0100_0000 - return bytes; -} -// sqrt(u/v) -function uvRatio(u, v) { - const P = ED25519_P; - const v3 = (0, modular_js_1.mod)(v * v * v, P); // v³ - const v7 = (0, modular_js_1.mod)(v3 * v3 * v, P); // v⁷ - // (p+3)/8 and (p-5)/8 - const pow = ed25519_pow_2_252_3(u * v7).pow_p_5_8; - let x = (0, modular_js_1.mod)(u * v3 * pow, P); // (uv³)(uv⁷)^(p-5)/8 - const vx2 = (0, modular_js_1.mod)(v * x * x, P); // vx² - const root1 = x; // First root candidate - const root2 = (0, modular_js_1.mod)(x * ED25519_SQRT_M1, P); // Second root candidate - const useRoot1 = vx2 === u; // If vx² = u (mod p), x is a square root - const useRoot2 = vx2 === (0, modular_js_1.mod)(-u, P); // If vx² = -u, set x <-- x * 2^((p-1)/4) - const noRoot = vx2 === (0, modular_js_1.mod)(-u * ED25519_SQRT_M1, P); // There is no valid root, vx² = -u√(-1) - if (useRoot1) - x = root1; - if (useRoot2 || noRoot) - x = root2; // We return root2 anyway, for const-time - if ((0, modular_js_1.isNegativeLE)(x, P)) - x = (0, modular_js_1.mod)(-x, P); - return { isValid: useRoot1 || useRoot2, value: x }; -} -// Just in case -exports.ED25519_TORSION_SUBGROUP = [ - '0100000000000000000000000000000000000000000000000000000000000000', - 'c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a', - '0000000000000000000000000000000000000000000000000000000000000080', - '26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05', - 'ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f', - '26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85', - '0000000000000000000000000000000000000000000000000000000000000000', - 'c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa', -]; -const Fp = (0, modular_js_1.Field)(ED25519_P, undefined, true); -const ed25519Defaults = { - // Param: a - a: BigInt(-1), - // d is equal to -121665/121666 over finite field. - // Negative number is P - number, and division is invert(number, P) - d: BigInt('37095705934669439343138083508754565189542113879843219016388785533085940283555'), - // Finite field 𝔽p over which we'll do calculations; 2n**255n - 19n - Fp, - // Subgroup order: how many points curve has - // 2n**252n + 27742317777372353535851937790883648493n; - n: BigInt('7237005577332262213973186563042994240857116359379907606001950938285454250989'), - // Cofactor - h: BigInt(8), - // Base point (x, y) aka generator point - Gx: BigInt('15112221349535400772501151409588531511454012693041857206046113283949847762202'), - Gy: BigInt('46316835694926478169428394003475163141307993866256225615783033603165251855960'), - hash: sha512_1.sha512, - randomBytes: utils_1.randomBytes, - adjustScalarBytes, - // dom2 - // Ratio of u to v. Allows us to combine inversion and square root. Uses algo from RFC8032 5.1.3. - // Constant-time, u/√v - uvRatio, -}; -exports.ed25519 = (0, edwards_js_1.twistedEdwards)(ed25519Defaults); -function ed25519_domain(data, ctx, phflag) { - if (ctx.length > 255) - throw new Error('Context is too big'); - return (0, utils_1.concatBytes)((0, utils_1.utf8ToBytes)('SigEd25519 no Ed25519 collisions'), new Uint8Array([phflag ? 1 : 0, ctx.length]), ctx, data); -} -exports.ed25519ctx = (0, edwards_js_1.twistedEdwards)({ - ...ed25519Defaults, - domain: ed25519_domain, -}); -exports.ed25519ph = (0, edwards_js_1.twistedEdwards)({ - ...ed25519Defaults, - domain: ed25519_domain, - prehash: sha512_1.sha512, -}); -exports.x25519 = (() => (0, montgomery_js_1.montgomery)({ - P: ED25519_P, - a: BigInt(486662), - montgomeryBits: 255, - nByteLength: 32, - Gu: BigInt(9), - powPminus2: (x) => { - const P = ED25519_P; - // x^(p-2) aka x^(2^255-21) - const { pow_p_5_8, b2 } = ed25519_pow_2_252_3(x); - return (0, modular_js_1.mod)((0, modular_js_1.pow2)(pow_p_5_8, BigInt(3), P) * b2, P); - }, - adjustScalarBytes, - randomBytes: utils_1.randomBytes, -}))(); -/** - * Converts ed25519 public key to x25519 public key. Uses formula: - * * `(u, v) = ((1+y)/(1-y), sqrt(-486664)*u/x)` - * * `(x, y) = (sqrt(-486664)*u/v, (u-1)/(u+1))` - * @example - * const someonesPub = ed25519.getPublicKey(ed25519.utils.randomPrivateKey()); - * const aPriv = x25519.utils.randomPrivateKey(); - * x25519.getSharedSecret(aPriv, edwardsToMontgomeryPub(someonesPub)) - */ -function edwardsToMontgomeryPub(edwardsPub) { - const { y } = exports.ed25519.ExtendedPoint.fromHex(edwardsPub); - const _1n = BigInt(1); - return Fp.toBytes(Fp.create((_1n + y) * Fp.inv(_1n - y))); -} -exports.edwardsToMontgomeryPub = edwardsToMontgomeryPub; -exports.edwardsToMontgomery = edwardsToMontgomeryPub; // deprecated -/** - * Converts ed25519 secret key to x25519 secret key. - * @example - * const someonesPub = x25519.getPublicKey(x25519.utils.randomPrivateKey()); - * const aPriv = ed25519.utils.randomPrivateKey(); - * x25519.getSharedSecret(edwardsToMontgomeryPriv(aPriv), someonesPub) - */ -function edwardsToMontgomeryPriv(edwardsPriv) { - const hashed = ed25519Defaults.hash(edwardsPriv.subarray(0, 32)); - return ed25519Defaults.adjustScalarBytes(hashed).subarray(0, 32); -} -exports.edwardsToMontgomeryPriv = edwardsToMontgomeryPriv; -// Hash To Curve Elligator2 Map (NOTE: different from ristretto255 elligator) -// NOTE: very important part is usage of FpSqrtEven for ELL2_C1_EDWARDS, since -// SageMath returns different root first and everything falls apart -const ELL2_C1 = (Fp.ORDER + BigInt(3)) / BigInt(8); // 1. c1 = (q + 3) / 8 # Integer arithmetic -const ELL2_C2 = Fp.pow(_2n, ELL2_C1); // 2. c2 = 2^c1 -const ELL2_C3 = Fp.sqrt(Fp.neg(Fp.ONE)); // 3. c3 = sqrt(-1) -const ELL2_C4 = (Fp.ORDER - BigInt(5)) / BigInt(8); // 4. c4 = (q - 5) / 8 # Integer arithmetic -const ELL2_J = BigInt(486662); -// prettier-ignore -function map_to_curve_elligator2_curve25519(u) { - let tv1 = Fp.sqr(u); // 1. tv1 = u^2 - tv1 = Fp.mul(tv1, _2n); // 2. tv1 = 2 * tv1 - let xd = Fp.add(tv1, Fp.ONE); // 3. xd = tv1 + 1 # Nonzero: -1 is square (mod p), tv1 is not - let x1n = Fp.neg(ELL2_J); // 4. x1n = -J # x1 = x1n / xd = -J / (1 + 2 * u^2) - let tv2 = Fp.sqr(xd); // 5. tv2 = xd^2 - let gxd = Fp.mul(tv2, xd); // 6. gxd = tv2 * xd # gxd = xd^3 - let gx1 = Fp.mul(tv1, ELL2_J); // 7. gx1 = J * tv1 # x1n + J * xd - gx1 = Fp.mul(gx1, x1n); // 8. gx1 = gx1 * x1n # x1n^2 + J * x1n * xd - gx1 = Fp.add(gx1, tv2); // 9. gx1 = gx1 + tv2 # x1n^2 + J * x1n * xd + xd^2 - gx1 = Fp.mul(gx1, x1n); // 10. gx1 = gx1 * x1n # x1n^3 + J * x1n^2 * xd + x1n * xd^2 - let tv3 = Fp.sqr(gxd); // 11. tv3 = gxd^2 - tv2 = Fp.sqr(tv3); // 12. tv2 = tv3^2 # gxd^4 - tv3 = Fp.mul(tv3, gxd); // 13. tv3 = tv3 * gxd # gxd^3 - tv3 = Fp.mul(tv3, gx1); // 14. tv3 = tv3 * gx1 # gx1 * gxd^3 - tv2 = Fp.mul(tv2, tv3); // 15. tv2 = tv2 * tv3 # gx1 * gxd^7 - let y11 = Fp.pow(tv2, ELL2_C4); // 16. y11 = tv2^c4 # (gx1 * gxd^7)^((p - 5) / 8) - y11 = Fp.mul(y11, tv3); // 17. y11 = y11 * tv3 # gx1*gxd^3*(gx1*gxd^7)^((p-5)/8) - let y12 = Fp.mul(y11, ELL2_C3); // 18. y12 = y11 * c3 - tv2 = Fp.sqr(y11); // 19. tv2 = y11^2 - tv2 = Fp.mul(tv2, gxd); // 20. tv2 = tv2 * gxd - let e1 = Fp.eql(tv2, gx1); // 21. e1 = tv2 == gx1 - let y1 = Fp.cmov(y12, y11, e1); // 22. y1 = CMOV(y12, y11, e1) # If g(x1) is square, this is its sqrt - let x2n = Fp.mul(x1n, tv1); // 23. x2n = x1n * tv1 # x2 = x2n / xd = 2 * u^2 * x1n / xd - let y21 = Fp.mul(y11, u); // 24. y21 = y11 * u - y21 = Fp.mul(y21, ELL2_C2); // 25. y21 = y21 * c2 - let y22 = Fp.mul(y21, ELL2_C3); // 26. y22 = y21 * c3 - let gx2 = Fp.mul(gx1, tv1); // 27. gx2 = gx1 * tv1 # g(x2) = gx2 / gxd = 2 * u^2 * g(x1) - tv2 = Fp.sqr(y21); // 28. tv2 = y21^2 - tv2 = Fp.mul(tv2, gxd); // 29. tv2 = tv2 * gxd - let e2 = Fp.eql(tv2, gx2); // 30. e2 = tv2 == gx2 - let y2 = Fp.cmov(y22, y21, e2); // 31. y2 = CMOV(y22, y21, e2) # If g(x2) is square, this is its sqrt - tv2 = Fp.sqr(y1); // 32. tv2 = y1^2 - tv2 = Fp.mul(tv2, gxd); // 33. tv2 = tv2 * gxd - let e3 = Fp.eql(tv2, gx1); // 34. e3 = tv2 == gx1 - let xn = Fp.cmov(x2n, x1n, e3); // 35. xn = CMOV(x2n, x1n, e3) # If e3, x = x1, else x = x2 - let y = Fp.cmov(y2, y1, e3); // 36. y = CMOV(y2, y1, e3) # If e3, y = y1, else y = y2 - let e4 = Fp.isOdd(y); // 37. e4 = sgn0(y) == 1 # Fix sign of y - y = Fp.cmov(y, Fp.neg(y), e3 !== e4); // 38. y = CMOV(y, -y, e3 XOR e4) - return { xMn: xn, xMd: xd, yMn: y, yMd: _1n }; // 39. return (xn, xd, y, 1) -} -const ELL2_C1_EDWARDS = (0, modular_js_1.FpSqrtEven)(Fp, Fp.neg(BigInt(486664))); // sgn0(c1) MUST equal 0 -function map_to_curve_elligator2_edwards25519(u) { - const { xMn, xMd, yMn, yMd } = map_to_curve_elligator2_curve25519(u); // 1. (xMn, xMd, yMn, yMd) = - // map_to_curve_elligator2_curve25519(u) - let xn = Fp.mul(xMn, yMd); // 2. xn = xMn * yMd - xn = Fp.mul(xn, ELL2_C1_EDWARDS); // 3. xn = xn * c1 - let xd = Fp.mul(xMd, yMn); // 4. xd = xMd * yMn # xn / xd = c1 * xM / yM - let yn = Fp.sub(xMn, xMd); // 5. yn = xMn - xMd - let yd = Fp.add(xMn, xMd); // 6. yd = xMn + xMd # (n / d - 1) / (n / d + 1) = (n - d) / (n + d) - let tv1 = Fp.mul(xd, yd); // 7. tv1 = xd * yd - let e = Fp.eql(tv1, Fp.ZERO); // 8. e = tv1 == 0 - xn = Fp.cmov(xn, Fp.ZERO, e); // 9. xn = CMOV(xn, 0, e) - xd = Fp.cmov(xd, Fp.ONE, e); // 10. xd = CMOV(xd, 1, e) - yn = Fp.cmov(yn, Fp.ONE, e); // 11. yn = CMOV(yn, 1, e) - yd = Fp.cmov(yd, Fp.ONE, e); // 12. yd = CMOV(yd, 1, e) - const inv = Fp.invertBatch([xd, yd]); // batch division - return { x: Fp.mul(xn, inv[0]), y: Fp.mul(yn, inv[1]) }; // 13. return (xn, xd, yn, yd) -} -const htf = /* @__PURE__ */ (() => (0, hash_to_curve_js_1.createHasher)(exports.ed25519.ExtendedPoint, (scalars) => map_to_curve_elligator2_edwards25519(scalars[0]), { - DST: 'edwards25519_XMD:SHA-512_ELL2_RO_', - encodeDST: 'edwards25519_XMD:SHA-512_ELL2_NU_', - p: Fp.ORDER, - m: 1, - k: 128, - expand: 'xmd', - hash: sha512_1.sha512, -}))(); -exports.hashToCurve = (() => htf.hashToCurve)(); -exports.encodeToCurve = (() => htf.encodeToCurve)(); -function assertRstPoint(other) { - if (!(other instanceof RistPoint)) - throw new Error('RistrettoPoint expected'); -} -// √(-1) aka √(a) aka 2^((p-1)/4) -const SQRT_M1 = ED25519_SQRT_M1; -// √(ad - 1) -const SQRT_AD_MINUS_ONE = BigInt('25063068953384623474111414158702152701244531502492656460079210482610430750235'); -// 1 / √(a-d) -const INVSQRT_A_MINUS_D = BigInt('54469307008909316920995813868745141605393597292927456921205312896311721017578'); -// 1-d² -const ONE_MINUS_D_SQ = BigInt('1159843021668779879193775521855586647937357759715417654439879720876111806838'); -// (d-1)² -const D_MINUS_ONE_SQ = BigInt('40440834346308536858101042469323190826248399146238708352240133220865137265952'); -// Calculates 1/√(number) -const invertSqrt = (number) => uvRatio(_1n, number); -const MAX_255B = BigInt('0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'); -const bytes255ToNumberLE = (bytes) => exports.ed25519.CURVE.Fp.create((0, utils_js_1.bytesToNumberLE)(bytes) & MAX_255B); -// Computes Elligator map for Ristretto -// https://ristretto.group/formulas/elligator.html -function calcElligatorRistrettoMap(r0) { - const { d } = exports.ed25519.CURVE; - const P = exports.ed25519.CURVE.Fp.ORDER; - const mod = exports.ed25519.CURVE.Fp.create; - const r = mod(SQRT_M1 * r0 * r0); // 1 - const Ns = mod((r + _1n) * ONE_MINUS_D_SQ); // 2 - let c = BigInt(-1); // 3 - const D = mod((c - d * r) * mod(r + d)); // 4 - let { isValid: Ns_D_is_sq, value: s } = uvRatio(Ns, D); // 5 - let s_ = mod(s * r0); // 6 - if (!(0, modular_js_1.isNegativeLE)(s_, P)) - s_ = mod(-s_); - if (!Ns_D_is_sq) - s = s_; // 7 - if (!Ns_D_is_sq) - c = r; // 8 - const Nt = mod(c * (r - _1n) * D_MINUS_ONE_SQ - D); // 9 - const s2 = s * s; - const W0 = mod((s + s) * D); // 10 - const W1 = mod(Nt * SQRT_AD_MINUS_ONE); // 11 - const W2 = mod(_1n - s2); // 12 - const W3 = mod(_1n + s2); // 13 - return new exports.ed25519.ExtendedPoint(mod(W0 * W3), mod(W2 * W1), mod(W1 * W3), mod(W0 * W2)); -} -/** - * Each ed25519/ExtendedPoint has 8 different equivalent points. This can be - * a source of bugs for protocols like ring signatures. Ristretto was created to solve this. - * Ristretto point operates in X:Y:Z:T extended coordinates like ExtendedPoint, - * but it should work in its own namespace: do not combine those two. - * https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-ristretto255-decaf448 - */ -class RistPoint { - // Private property to discourage combining ExtendedPoint + RistrettoPoint - // Always use Ristretto encoding/decoding instead. - constructor(ep) { - this.ep = ep; - } - static fromAffine(ap) { - return new RistPoint(exports.ed25519.ExtendedPoint.fromAffine(ap)); - } - /** - * Takes uniform output of 64-byte hash function like sha512 and converts it to `RistrettoPoint`. - * The hash-to-group operation applies Elligator twice and adds the results. - * **Note:** this is one-way map, there is no conversion from point to hash. - * https://ristretto.group/formulas/elligator.html - * @param hex 64-byte output of a hash function - */ - static hashToCurve(hex) { - hex = (0, utils_js_1.ensureBytes)('ristrettoHash', hex, 64); - const r1 = bytes255ToNumberLE(hex.slice(0, 32)); - const R1 = calcElligatorRistrettoMap(r1); - const r2 = bytes255ToNumberLE(hex.slice(32, 64)); - const R2 = calcElligatorRistrettoMap(r2); - return new RistPoint(R1.add(R2)); - } - /** - * Converts ristretto-encoded string to ristretto point. - * https://ristretto.group/formulas/decoding.html - * @param hex Ristretto-encoded 32 bytes. Not every 32-byte string is valid ristretto encoding - */ - static fromHex(hex) { - hex = (0, utils_js_1.ensureBytes)('ristrettoHex', hex, 32); - const { a, d } = exports.ed25519.CURVE; - const P = exports.ed25519.CURVE.Fp.ORDER; - const mod = exports.ed25519.CURVE.Fp.create; - const emsg = 'RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint'; - const s = bytes255ToNumberLE(hex); - // 1. Check that s_bytes is the canonical encoding of a field element, or else abort. - // 3. Check that s is non-negative, or else abort - if (!(0, utils_js_1.equalBytes)((0, utils_js_1.numberToBytesLE)(s, 32), hex) || (0, modular_js_1.isNegativeLE)(s, P)) - throw new Error(emsg); - const s2 = mod(s * s); - const u1 = mod(_1n + a * s2); // 4 (a is -1) - const u2 = mod(_1n - a * s2); // 5 - const u1_2 = mod(u1 * u1); - const u2_2 = mod(u2 * u2); - const v = mod(a * d * u1_2 - u2_2); // 6 - const { isValid, value: I } = invertSqrt(mod(v * u2_2)); // 7 - const Dx = mod(I * u2); // 8 - const Dy = mod(I * Dx * v); // 9 - let x = mod((s + s) * Dx); // 10 - if ((0, modular_js_1.isNegativeLE)(x, P)) - x = mod(-x); // 10 - const y = mod(u1 * Dy); // 11 - const t = mod(x * y); // 12 - if (!isValid || (0, modular_js_1.isNegativeLE)(t, P) || y === _0n) - throw new Error(emsg); - return new RistPoint(new exports.ed25519.ExtendedPoint(x, y, _1n, t)); - } - /** - * Encodes ristretto point to Uint8Array. - * https://ristretto.group/formulas/encoding.html - */ - toRawBytes() { - let { ex: x, ey: y, ez: z, et: t } = this.ep; - const P = exports.ed25519.CURVE.Fp.ORDER; - const mod = exports.ed25519.CURVE.Fp.create; - const u1 = mod(mod(z + y) * mod(z - y)); // 1 - const u2 = mod(x * y); // 2 - // Square root always exists - const u2sq = mod(u2 * u2); - const { value: invsqrt } = invertSqrt(mod(u1 * u2sq)); // 3 - const D1 = mod(invsqrt * u1); // 4 - const D2 = mod(invsqrt * u2); // 5 - const zInv = mod(D1 * D2 * t); // 6 - let D; // 7 - if ((0, modular_js_1.isNegativeLE)(t * zInv, P)) { - let _x = mod(y * SQRT_M1); - let _y = mod(x * SQRT_M1); - x = _x; - y = _y; - D = mod(D1 * INVSQRT_A_MINUS_D); - } - else { - D = D2; // 8 - } - if ((0, modular_js_1.isNegativeLE)(x * zInv, P)) - y = mod(-y); // 9 - let s = mod((z - y) * D); // 10 (check footer's note, no sqrt(-a)) - if ((0, modular_js_1.isNegativeLE)(s, P)) - s = mod(-s); - return (0, utils_js_1.numberToBytesLE)(s, 32); // 11 - } - toHex() { - return (0, utils_js_1.bytesToHex)(this.toRawBytes()); - } - toString() { - return this.toHex(); - } - // Compare one point to another. - equals(other) { - assertRstPoint(other); - const { ex: X1, ey: Y1 } = this.ep; - const { ex: X2, ey: Y2 } = other.ep; - const mod = exports.ed25519.CURVE.Fp.create; - // (x1 * y2 == y1 * x2) | (y1 * y2 == x1 * x2) - const one = mod(X1 * Y2) === mod(Y1 * X2); - const two = mod(Y1 * Y2) === mod(X1 * X2); - return one || two; - } - add(other) { - assertRstPoint(other); - return new RistPoint(this.ep.add(other.ep)); - } - subtract(other) { - assertRstPoint(other); - return new RistPoint(this.ep.subtract(other.ep)); - } - multiply(scalar) { - return new RistPoint(this.ep.multiply(scalar)); - } - multiplyUnsafe(scalar) { - return new RistPoint(this.ep.multiplyUnsafe(scalar)); - } -} -exports.RistrettoPoint = (() => { - if (!RistPoint.BASE) - RistPoint.BASE = new RistPoint(exports.ed25519.ExtendedPoint.BASE); - if (!RistPoint.ZERO) - RistPoint.ZERO = new RistPoint(exports.ed25519.ExtendedPoint.ZERO); - return RistPoint; -})(); -// Hashing to ristretto255. https://www.rfc-editor.org/rfc/rfc9380#appendix-B -const hashToRistretto255 = (msg, options) => { - const d = options.DST; - const DST = typeof d === 'string' ? (0, utils_1.utf8ToBytes)(d) : d; - const uniform_bytes = (0, hash_to_curve_js_1.expand_message_xmd)(msg, DST, 64, sha512_1.sha512); - const P = RistPoint.hashToCurve(uniform_bytes); - return P; -}; -exports.hashToRistretto255 = hashToRistretto255; -exports.hash_to_ristretto255 = exports.hashToRistretto255; // legacy -//# sourceMappingURL=ed25519.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/ed25519.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/ed25519.js.map deleted file mode 100644 index af44c8d8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/ed25519.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed25519.js","sourceRoot":"","sources":["src/ed25519.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,iDAA8C;AAC9C,+CAA4E;AAC5E,sDAAqE;AACrE,4DAAsD;AACtD,sDAAmF;AACnF,kDAO6B;AAC7B,kEAA6F;AAG7F;;;;;GAKG;AAEH,MAAM,SAAS,GAAG,MAAM,CACtB,+EAA+E,CAChF,CAAC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I,CAAC,CAAC;IAChF,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC,EAAE,CAAC;AAEL,6EAA6E;AACtE,MAAM,kBAAkB,GAAG,CAAC,GAAe,EAAE,OAAqB,EAAE,EAAE;IAC3E,MAAM,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IACtB,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAA,mBAAW,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACvD,MAAM,aAAa,GAAG,IAAA,qCAAkB,EAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,eAAM,CAAC,CAAC;IAC/D,MAAM,CAAC,GAAG,SAAS,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;IAC/C,OAAO,CAAC,CAAC;AACX,CAAC,CAAC;AANW,QAAA,kBAAkB,sBAM7B;AACW,QAAA,oBAAoB,GAAG,0BAAkB,CAAC,CAAC,SAAS"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/ed448.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/ed448.d.ts deleted file mode 100644 index 3523c71d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/ed448.d.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { ExtPointType } from './abstract/edwards.js'; -import { htfBasicOpts } from './abstract/hash-to-curve.js'; -import { Hex } from './abstract/utils.js'; -import { AffinePoint } from './abstract/curve.js'; -export declare const ed448: import("./abstract/edwards.js").CurveFn; -export declare const ed448ph: import("./abstract/edwards.js").CurveFn; -export declare const x448: import("./abstract/montgomery.js").CurveFn; -/** - * Converts edwards448 public key to x448 public key. Uses formula: - * * `(u, v) = ((y-1)/(y+1), sqrt(156324)*u/x)` - * * `(x, y) = (sqrt(156324)*u/v, (1+u)/(1-u))` - * @example - * const aPub = ed448.getPublicKey(utils.randomPrivateKey()); - * x448.getSharedSecret(edwardsToMontgomery(aPub), edwardsToMontgomery(someonesPub)) - */ -export declare function edwardsToMontgomeryPub(edwardsPub: string | Uint8Array): Uint8Array; -export declare const edwardsToMontgomery: typeof edwardsToMontgomeryPub; -export declare const hashToCurve: (msg: Uint8Array, options?: htfBasicOpts | undefined) => import("./abstract/hash-to-curve.js").H2CPoint; -export declare const encodeToCurve: (msg: Uint8Array, options?: htfBasicOpts | undefined) => import("./abstract/hash-to-curve.js").H2CPoint; -type ExtendedPoint = ExtPointType; -/** - * Each ed448/ExtendedPoint has 4 different equivalent points. This can be - * a source of bugs for protocols like ring signatures. Decaf was created to solve this. - * Decaf point operates in X:Y:Z:T extended coordinates like ExtendedPoint, - * but it should work in its own namespace: do not combine those two. - * https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-ristretto255-decaf448 - */ -declare class DcfPoint { - private readonly ep; - static BASE: DcfPoint; - static ZERO: DcfPoint; - constructor(ep: ExtendedPoint); - static fromAffine(ap: AffinePoint): DcfPoint; - /** - * Takes uniform output of 112-byte hash function like shake256 and converts it to `DecafPoint`. - * The hash-to-group operation applies Elligator twice and adds the results. - * **Note:** this is one-way map, there is no conversion from point to hash. - * https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-ristretto255-decaf448-07#name-element-derivation-2 - * @param hex 112-byte output of a hash function - */ - static hashToCurve(hex: Hex): DcfPoint; - /** - * Converts decaf-encoded string to decaf point. - * https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-ristretto255-decaf448-07#name-decode-2 - * @param hex Decaf-encoded 56 bytes. Not every 56-byte string is valid decaf encoding - */ - static fromHex(hex: Hex): DcfPoint; - /** - * Encodes decaf point to Uint8Array. - * https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-ristretto255-decaf448-07#name-encode-2 - */ - toRawBytes(): Uint8Array; - toHex(): string; - toString(): string; - equals(other: DcfPoint): boolean; - add(other: DcfPoint): DcfPoint; - subtract(other: DcfPoint): DcfPoint; - multiply(scalar: bigint): DcfPoint; - multiplyUnsafe(scalar: bigint): DcfPoint; -} -export declare const DecafPoint: typeof DcfPoint; -export declare const hashToDecaf448: (msg: Uint8Array, options: htfBasicOpts) => DcfPoint; -export declare const hash_to_decaf448: (msg: Uint8Array, options: htfBasicOpts) => DcfPoint; -export {}; -//# sourceMappingURL=ed448.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/ed448.d.ts.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/ed448.d.ts.map deleted file mode 100644 index caf0ca03..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/ed448.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed448.d.ts","sourceRoot":"","sources":["src/ed448.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAkB,MAAM,uBAAuB,CAAC;AAGrE,OAAO,EAAgB,YAAY,EAAsB,MAAM,6BAA6B,CAAC;AAC7F,OAAO,EAKL,GAAG,EAEJ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAqHlD,eAAO,MAAM,KAAK,yCAA4C,CAAC;AAE/D,eAAO,MAAM,OAAO,yCAAyE,CAAC;AAE9F,eAAO,MAAM,IAAI,4CAeV,CAAC;AAER;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,CAIlF;AACD,eAAO,MAAM,mBAAmB,+BAAyB,CAAC;AA2F1D,eAAO,MAAM,WAAW,iHAA4C,CAAC;AACrE,eAAO,MAAM,aAAa,iHAA8C,CAAC;AA2BzE,KAAK,aAAa,GAAG,YAAY,CAAC;AAiClC;;;;;;GAMG;AACH,cAAM,QAAQ;IAKA,OAAO,CAAC,QAAQ,CAAC,EAAE;IAJ/B,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC;IACtB,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC;gBAGO,EAAE,EAAE,aAAa;IAE9C,MAAM,CAAC,UAAU,CAAC,EAAE,EAAE,WAAW,CAAC,MAAM,CAAC;IAIzC;;;;;;OAMG;IACH,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,GAAG,QAAQ;IAStC;;;;OAIG;IACH,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,QAAQ;IA8BlC;;;OAGG;IACH,UAAU,IAAI,UAAU;IAoBxB,KAAK,IAAI,MAAM;IAIf,QAAQ,IAAI,MAAM;IAMlB,MAAM,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO;IAShC,GAAG,CAAC,KAAK,EAAE,QAAQ,GAAG,QAAQ;IAK9B,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,QAAQ;IAKnC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ;IAIlC,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ;CAGzC;AACD,eAAO,MAAM,UAAU,iBAMnB,CAAC;AAGL,eAAO,MAAM,cAAc,QAAS,UAAU,WAAW,YAAY,aAMpE,CAAC;AACF,eAAO,MAAM,gBAAgB,QAPO,UAAU,WAAW,YAAY,aAOvB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/ed448.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/ed448.js deleted file mode 100644 index 3eafbd55..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/ed448.js +++ /dev/null @@ -1,397 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.hash_to_decaf448 = exports.hashToDecaf448 = exports.DecafPoint = exports.encodeToCurve = exports.hashToCurve = exports.edwardsToMontgomery = exports.edwardsToMontgomeryPub = exports.x448 = exports.ed448ph = exports.ed448 = void 0; -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const sha3_1 = require("@noble/hashes/sha3"); -const utils_1 = require("@noble/hashes/utils"); -const edwards_js_1 = require("./abstract/edwards.js"); -const modular_js_1 = require("./abstract/modular.js"); -const montgomery_js_1 = require("./abstract/montgomery.js"); -const hash_to_curve_js_1 = require("./abstract/hash-to-curve.js"); -const utils_js_1 = require("./abstract/utils.js"); -/** - * Edwards448 (not Ed448-Goldilocks) curve with following addons: - * - X448 ECDH - * - Decaf cofactor elimination - * - Elligator hash-to-group / point indistinguishability - * Conforms to RFC 8032 https://www.rfc-editor.org/rfc/rfc8032.html#section-5.2 - */ -const shake256_114 = (0, utils_1.wrapConstructor)(() => sha3_1.shake256.create({ dkLen: 114 })); -const shake256_64 = (0, utils_1.wrapConstructor)(() => sha3_1.shake256.create({ dkLen: 64 })); -const ed448P = BigInt('726838724295606890549323807888004534353641360687318060281490199180612328166730772686396383698676545930088884461843637361053498018365439'); -// prettier-ignore -const _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = BigInt(4), _11n = BigInt(11); -// prettier-ignore -const _22n = BigInt(22), _44n = BigInt(44), _88n = BigInt(88), _223n = BigInt(223); -// powPminus3div4 calculates z = x^k mod p, where k = (p-3)/4. -// Used for efficient square root calculation. -// ((P-3)/4).toString(2) would produce bits [223x 1, 0, 222x 1] -function ed448_pow_Pminus3div4(x) { - const P = ed448P; - const b2 = (x * x * x) % P; - const b3 = (b2 * b2 * x) % P; - const b6 = ((0, modular_js_1.pow2)(b3, _3n, P) * b3) % P; - const b9 = ((0, modular_js_1.pow2)(b6, _3n, P) * b3) % P; - const b11 = ((0, modular_js_1.pow2)(b9, _2n, P) * b2) % P; - const b22 = ((0, modular_js_1.pow2)(b11, _11n, P) * b11) % P; - const b44 = ((0, modular_js_1.pow2)(b22, _22n, P) * b22) % P; - const b88 = ((0, modular_js_1.pow2)(b44, _44n, P) * b44) % P; - const b176 = ((0, modular_js_1.pow2)(b88, _88n, P) * b88) % P; - const b220 = ((0, modular_js_1.pow2)(b176, _44n, P) * b44) % P; - const b222 = ((0, modular_js_1.pow2)(b220, _2n, P) * b2) % P; - const b223 = ((0, modular_js_1.pow2)(b222, _1n, P) * x) % P; - return ((0, modular_js_1.pow2)(b223, _223n, P) * b222) % P; -} -function adjustScalarBytes(bytes) { - // Section 5: Likewise, for X448, set the two least significant bits of the first byte to 0, and the most - // significant bit of the last byte to 1. - bytes[0] &= 252; // 0b11111100 - // and the most significant bit of the last byte to 1. - bytes[55] |= 128; // 0b10000000 - // NOTE: is is NOOP for 56 bytes scalars (X25519/X448) - bytes[56] = 0; // Byte outside of group (456 buts vs 448 bits) - return bytes; -} -// Constant-time ratio of u to v. Allows to combine inversion and square root u/√v. -// Uses algo from RFC8032 5.1.3. -function uvRatio(u, v) { - const P = ed448P; - // https://www.rfc-editor.org/rfc/rfc8032#section-5.2.3 - // To compute the square root of (u/v), the first step is to compute the - // candidate root x = (u/v)^((p+1)/4). This can be done using the - // following trick, to use a single modular powering for both the - // inversion of v and the square root: - // x = (u/v)^((p+1)/4) = u³v(u⁵v³)^((p-3)/4) (mod p) - const u2v = (0, modular_js_1.mod)(u * u * v, P); // u²v - const u3v = (0, modular_js_1.mod)(u2v * u, P); // u³v - const u5v3 = (0, modular_js_1.mod)(u3v * u2v * v, P); // u⁵v³ - const root = ed448_pow_Pminus3div4(u5v3); - const x = (0, modular_js_1.mod)(u3v * root, P); - // Verify that root is exists - const x2 = (0, modular_js_1.mod)(x * x, P); // x² - // If vx² = u, the recovered x-coordinate is x. Otherwise, no - // square root exists, and the decoding fails. - return { isValid: (0, modular_js_1.mod)(x2 * v, P) === u, value: x }; -} -const Fp = (0, modular_js_1.Field)(ed448P, 456, true); -const ED448_DEF = { - // Param: a - a: BigInt(1), - // -39081. Negative number is P - number - d: BigInt('726838724295606890549323807888004534353641360687318060281490199180612328166730772686396383698676545930088884461843637361053498018326358'), - // Finite field 𝔽p over which we'll do calculations; 2n**448n - 2n**224n - 1n - Fp, - // Subgroup order: how many points curve has; - // 2n**446n - 13818066809895115352007386748515426880336692474882178609894547503885n - n: BigInt('181709681073901722637330951972001133588410340171829515070372549795146003961539585716195755291692375963310293709091662304773755859649779'), - nBitLength: 456, - // Cofactor - h: BigInt(4), - // Base point (x, y) aka generator point - Gx: BigInt('224580040295924300187604334099896036246789641632564134246125461686950415467406032909029192869357953282578032075146446173674602635247710'), - Gy: BigInt('298819210078481492676017930443930673437544040154080242095928241372331506189835876003536878655418784733982303233503462500531545062832660'), - // SHAKE256(dom4(phflag,context)||x, 114) - hash: shake256_114, - randomBytes: utils_1.randomBytes, - adjustScalarBytes, - // dom4 - domain: (data, ctx, phflag) => { - if (ctx.length > 255) - throw new Error(`Context is too big: ${ctx.length}`); - return (0, utils_1.concatBytes)((0, utils_1.utf8ToBytes)('SigEd448'), new Uint8Array([phflag ? 1 : 0, ctx.length]), ctx, data); - }, - uvRatio, -}; -exports.ed448 = (0, edwards_js_1.twistedEdwards)(ED448_DEF); -// NOTE: there is no ed448ctx, since ed448 supports ctx by default -exports.ed448ph = (0, edwards_js_1.twistedEdwards)({ ...ED448_DEF, prehash: shake256_64 }); -exports.x448 = (() => (0, montgomery_js_1.montgomery)({ - a: BigInt(156326), - montgomeryBits: 448, - nByteLength: 57, - P: ed448P, - Gu: BigInt(5), - powPminus2: (x) => { - const P = ed448P; - const Pminus3div4 = ed448_pow_Pminus3div4(x); - const Pminus3 = (0, modular_js_1.pow2)(Pminus3div4, BigInt(2), P); - return (0, modular_js_1.mod)(Pminus3 * x, P); // Pminus3 * x = Pminus2 - }, - adjustScalarBytes, - randomBytes: utils_1.randomBytes, -}))(); -/** - * Converts edwards448 public key to x448 public key. Uses formula: - * * `(u, v) = ((y-1)/(y+1), sqrt(156324)*u/x)` - * * `(x, y) = (sqrt(156324)*u/v, (1+u)/(1-u))` - * @example - * const aPub = ed448.getPublicKey(utils.randomPrivateKey()); - * x448.getSharedSecret(edwardsToMontgomery(aPub), edwardsToMontgomery(someonesPub)) - */ -function edwardsToMontgomeryPub(edwardsPub) { - const { y } = exports.ed448.ExtendedPoint.fromHex(edwardsPub); - const _1n = BigInt(1); - return Fp.toBytes(Fp.create((y - _1n) * Fp.inv(y + _1n))); -} -exports.edwardsToMontgomeryPub = edwardsToMontgomeryPub; -exports.edwardsToMontgomery = edwardsToMontgomeryPub; // deprecated -// Hash To Curve Elligator2 Map -const ELL2_C1 = (Fp.ORDER - BigInt(3)) / BigInt(4); // 1. c1 = (q - 3) / 4 # Integer arithmetic -const ELL2_J = BigInt(156326); -function map_to_curve_elligator2_curve448(u) { - let tv1 = Fp.sqr(u); // 1. tv1 = u^2 - let e1 = Fp.eql(tv1, Fp.ONE); // 2. e1 = tv1 == 1 - tv1 = Fp.cmov(tv1, Fp.ZERO, e1); // 3. tv1 = CMOV(tv1, 0, e1) # If Z * u^2 == -1, set tv1 = 0 - let xd = Fp.sub(Fp.ONE, tv1); // 4. xd = 1 - tv1 - let x1n = Fp.neg(ELL2_J); // 5. x1n = -J - let tv2 = Fp.sqr(xd); // 6. tv2 = xd^2 - let gxd = Fp.mul(tv2, xd); // 7. gxd = tv2 * xd # gxd = xd^3 - let gx1 = Fp.mul(tv1, Fp.neg(ELL2_J)); // 8. gx1 = -J * tv1 # x1n + J * xd - gx1 = Fp.mul(gx1, x1n); // 9. gx1 = gx1 * x1n # x1n^2 + J * x1n * xd - gx1 = Fp.add(gx1, tv2); // 10. gx1 = gx1 + tv2 # x1n^2 + J * x1n * xd + xd^2 - gx1 = Fp.mul(gx1, x1n); // 11. gx1 = gx1 * x1n # x1n^3 + J * x1n^2 * xd + x1n * xd^2 - let tv3 = Fp.sqr(gxd); // 12. tv3 = gxd^2 - tv2 = Fp.mul(gx1, gxd); // 13. tv2 = gx1 * gxd # gx1 * gxd - tv3 = Fp.mul(tv3, tv2); // 14. tv3 = tv3 * tv2 # gx1 * gxd^3 - let y1 = Fp.pow(tv3, ELL2_C1); // 15. y1 = tv3^c1 # (gx1 * gxd^3)^((p - 3) / 4) - y1 = Fp.mul(y1, tv2); // 16. y1 = y1 * tv2 # gx1 * gxd * (gx1 * gxd^3)^((p - 3) / 4) - let x2n = Fp.mul(x1n, Fp.neg(tv1)); // 17. x2n = -tv1 * x1n # x2 = x2n / xd = -1 * u^2 * x1n / xd - let y2 = Fp.mul(y1, u); // 18. y2 = y1 * u - y2 = Fp.cmov(y2, Fp.ZERO, e1); // 19. y2 = CMOV(y2, 0, e1) - tv2 = Fp.sqr(y1); // 20. tv2 = y1^2 - tv2 = Fp.mul(tv2, gxd); // 21. tv2 = tv2 * gxd - let e2 = Fp.eql(tv2, gx1); // 22. e2 = tv2 == gx1 - let xn = Fp.cmov(x2n, x1n, e2); // 23. xn = CMOV(x2n, x1n, e2) # If e2, x = x1, else x = x2 - let y = Fp.cmov(y2, y1, e2); // 24. y = CMOV(y2, y1, e2) # If e2, y = y1, else y = y2 - let e3 = Fp.isOdd(y); // 25. e3 = sgn0(y) == 1 # Fix sign of y - y = Fp.cmov(y, Fp.neg(y), e2 !== e3); // 26. y = CMOV(y, -y, e2 XOR e3) - return { xn, xd, yn: y, yd: Fp.ONE }; // 27. return (xn, xd, y, 1) -} -function map_to_curve_elligator2_edwards448(u) { - let { xn, xd, yn, yd } = map_to_curve_elligator2_curve448(u); // 1. (xn, xd, yn, yd) = map_to_curve_elligator2_curve448(u) - let xn2 = Fp.sqr(xn); // 2. xn2 = xn^2 - let xd2 = Fp.sqr(xd); // 3. xd2 = xd^2 - let xd4 = Fp.sqr(xd2); // 4. xd4 = xd2^2 - let yn2 = Fp.sqr(yn); // 5. yn2 = yn^2 - let yd2 = Fp.sqr(yd); // 6. yd2 = yd^2 - let xEn = Fp.sub(xn2, xd2); // 7. xEn = xn2 - xd2 - let tv2 = Fp.sub(xEn, xd2); // 8. tv2 = xEn - xd2 - xEn = Fp.mul(xEn, xd2); // 9. xEn = xEn * xd2 - xEn = Fp.mul(xEn, yd); // 10. xEn = xEn * yd - xEn = Fp.mul(xEn, yn); // 11. xEn = xEn * yn - xEn = Fp.mul(xEn, _4n); // 12. xEn = xEn * 4 - tv2 = Fp.mul(tv2, xn2); // 13. tv2 = tv2 * xn2 - tv2 = Fp.mul(tv2, yd2); // 14. tv2 = tv2 * yd2 - let tv3 = Fp.mul(yn2, _4n); // 15. tv3 = 4 * yn2 - let tv1 = Fp.add(tv3, yd2); // 16. tv1 = tv3 + yd2 - tv1 = Fp.mul(tv1, xd4); // 17. tv1 = tv1 * xd4 - let xEd = Fp.add(tv1, tv2); // 18. xEd = tv1 + tv2 - tv2 = Fp.mul(tv2, xn); // 19. tv2 = tv2 * xn - let tv4 = Fp.mul(xn, xd4); // 20. tv4 = xn * xd4 - let yEn = Fp.sub(tv3, yd2); // 21. yEn = tv3 - yd2 - yEn = Fp.mul(yEn, tv4); // 22. yEn = yEn * tv4 - yEn = Fp.sub(yEn, tv2); // 23. yEn = yEn - tv2 - tv1 = Fp.add(xn2, xd2); // 24. tv1 = xn2 + xd2 - tv1 = Fp.mul(tv1, xd2); // 25. tv1 = tv1 * xd2 - tv1 = Fp.mul(tv1, xd); // 26. tv1 = tv1 * xd - tv1 = Fp.mul(tv1, yn2); // 27. tv1 = tv1 * yn2 - tv1 = Fp.mul(tv1, BigInt(-2)); // 28. tv1 = -2 * tv1 - let yEd = Fp.add(tv2, tv1); // 29. yEd = tv2 + tv1 - tv4 = Fp.mul(tv4, yd2); // 30. tv4 = tv4 * yd2 - yEd = Fp.add(yEd, tv4); // 31. yEd = yEd + tv4 - tv1 = Fp.mul(xEd, yEd); // 32. tv1 = xEd * yEd - let e = Fp.eql(tv1, Fp.ZERO); // 33. e = tv1 == 0 - xEn = Fp.cmov(xEn, Fp.ZERO, e); // 34. xEn = CMOV(xEn, 0, e) - xEd = Fp.cmov(xEd, Fp.ONE, e); // 35. xEd = CMOV(xEd, 1, e) - yEn = Fp.cmov(yEn, Fp.ONE, e); // 36. yEn = CMOV(yEn, 1, e) - yEd = Fp.cmov(yEd, Fp.ONE, e); // 37. yEd = CMOV(yEd, 1, e) - const inv = Fp.invertBatch([xEd, yEd]); // batch division - return { x: Fp.mul(xEn, inv[0]), y: Fp.mul(yEn, inv[1]) }; // 38. return (xEn, xEd, yEn, yEd) -} -const htf = /* @__PURE__ */ (() => (0, hash_to_curve_js_1.createHasher)(exports.ed448.ExtendedPoint, (scalars) => map_to_curve_elligator2_edwards448(scalars[0]), { - DST: 'edwards448_XOF:SHAKE256_ELL2_RO_', - encodeDST: 'edwards448_XOF:SHAKE256_ELL2_NU_', - p: Fp.ORDER, - m: 1, - k: 224, - expand: 'xof', - hash: sha3_1.shake256, -}))(); -exports.hashToCurve = (() => htf.hashToCurve)(); -exports.encodeToCurve = (() => htf.encodeToCurve)(); -function assertDcfPoint(other) { - if (!(other instanceof DcfPoint)) - throw new Error('DecafPoint expected'); -} -// 1-d -const ONE_MINUS_D = BigInt('39082'); -// 1-2d -const ONE_MINUS_TWO_D = BigInt('78163'); -// √(-d) -const SQRT_MINUS_D = BigInt('98944233647732219769177004876929019128417576295529901074099889598043702116001257856802131563896515373927712232092845883226922417596214'); -// 1 / √(-d) -const INVSQRT_MINUS_D = BigInt('315019913931389607337177038330951043522456072897266928557328499619017160722351061360252776265186336876723201881398623946864393857820716'); -// Calculates 1/√(number) -const invertSqrt = (number) => uvRatio(_1n, number); -const MAX_448B = BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'); -const bytes448ToNumberLE = (bytes) => exports.ed448.CURVE.Fp.create((0, utils_js_1.bytesToNumberLE)(bytes) & MAX_448B); -// Computes Elligator map for Decaf -// https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-ristretto255-decaf448-07#name-element-derivation-2 -function calcElligatorDecafMap(r0) { - const { d } = exports.ed448.CURVE; - const P = exports.ed448.CURVE.Fp.ORDER; - const mod = exports.ed448.CURVE.Fp.create; - const r = mod(-(r0 * r0)); // 1 - const u0 = mod(d * (r - _1n)); // 2 - const u1 = mod((u0 + _1n) * (u0 - r)); // 3 - const { isValid: was_square, value: v } = uvRatio(ONE_MINUS_TWO_D, mod((r + _1n) * u1)); // 4 - let v_prime = v; // 5 - if (!was_square) - v_prime = mod(r0 * v); - let sgn = _1n; // 6 - if (!was_square) - sgn = mod(-_1n); - const s = mod(v_prime * (r + _1n)); // 7 - let s_abs = s; - if ((0, modular_js_1.isNegativeLE)(s, P)) - s_abs = mod(-s); - const s2 = s * s; - const W0 = mod(s_abs * _2n); // 8 - const W1 = mod(s2 + _1n); // 9 - const W2 = mod(s2 - _1n); // 10 - const W3 = mod(v_prime * s * (r - _1n) * ONE_MINUS_TWO_D + sgn); // 11 - return new exports.ed448.ExtendedPoint(mod(W0 * W3), mod(W2 * W1), mod(W1 * W3), mod(W0 * W2)); -} -/** - * Each ed448/ExtendedPoint has 4 different equivalent points. This can be - * a source of bugs for protocols like ring signatures. Decaf was created to solve this. - * Decaf point operates in X:Y:Z:T extended coordinates like ExtendedPoint, - * but it should work in its own namespace: do not combine those two. - * https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-ristretto255-decaf448 - */ -class DcfPoint { - // Private property to discourage combining ExtendedPoint + DecafPoint - // Always use Decaf encoding/decoding instead. - constructor(ep) { - this.ep = ep; - } - static fromAffine(ap) { - return new DcfPoint(exports.ed448.ExtendedPoint.fromAffine(ap)); - } - /** - * Takes uniform output of 112-byte hash function like shake256 and converts it to `DecafPoint`. - * The hash-to-group operation applies Elligator twice and adds the results. - * **Note:** this is one-way map, there is no conversion from point to hash. - * https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-ristretto255-decaf448-07#name-element-derivation-2 - * @param hex 112-byte output of a hash function - */ - static hashToCurve(hex) { - hex = (0, utils_js_1.ensureBytes)('decafHash', hex, 112); - const r1 = bytes448ToNumberLE(hex.slice(0, 56)); - const R1 = calcElligatorDecafMap(r1); - const r2 = bytes448ToNumberLE(hex.slice(56, 112)); - const R2 = calcElligatorDecafMap(r2); - return new DcfPoint(R1.add(R2)); - } - /** - * Converts decaf-encoded string to decaf point. - * https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-ristretto255-decaf448-07#name-decode-2 - * @param hex Decaf-encoded 56 bytes. Not every 56-byte string is valid decaf encoding - */ - static fromHex(hex) { - hex = (0, utils_js_1.ensureBytes)('decafHex', hex, 56); - const { d } = exports.ed448.CURVE; - const P = exports.ed448.CURVE.Fp.ORDER; - const mod = exports.ed448.CURVE.Fp.create; - const emsg = 'DecafPoint.fromHex: the hex is not valid encoding of DecafPoint'; - const s = bytes448ToNumberLE(hex); - // 1. Check that s_bytes is the canonical encoding of a field element, or else abort. - // 2. Check that s is non-negative, or else abort - if (!(0, utils_js_1.equalBytes)((0, utils_js_1.numberToBytesLE)(s, 56), hex) || (0, modular_js_1.isNegativeLE)(s, P)) - throw new Error(emsg); - const s2 = mod(s * s); // 1 - const u1 = mod(_1n + s2); // 2 - const u1sq = mod(u1 * u1); - const u2 = mod(u1sq - _4n * d * s2); // 3 - const { isValid, value: invsqrt } = invertSqrt(mod(u2 * u1sq)); // 4 - let u3 = mod((s + s) * invsqrt * u1 * SQRT_MINUS_D); // 5 - if ((0, modular_js_1.isNegativeLE)(u3, P)) - u3 = mod(-u3); - const x = mod(u3 * invsqrt * u2 * INVSQRT_MINUS_D); // 6 - const y = mod((_1n - s2) * invsqrt * u1); // 7 - const t = mod(x * y); // 8 - if (!isValid) - throw new Error(emsg); - return new DcfPoint(new exports.ed448.ExtendedPoint(x, y, _1n, t)); - } - /** - * Encodes decaf point to Uint8Array. - * https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-ristretto255-decaf448-07#name-encode-2 - */ - toRawBytes() { - let { ex: x, ey: _y, ez: z, et: t } = this.ep; - const P = exports.ed448.CURVE.Fp.ORDER; - const mod = exports.ed448.CURVE.Fp.create; - const u1 = mod(mod(x + t) * mod(x - t)); // 1 - const x2 = mod(x * x); - const { value: invsqrt } = invertSqrt(mod(u1 * ONE_MINUS_D * x2)); // 2 - let ratio = mod(invsqrt * u1 * SQRT_MINUS_D); // 3 - if ((0, modular_js_1.isNegativeLE)(ratio, P)) - ratio = mod(-ratio); - const u2 = mod(INVSQRT_MINUS_D * ratio * z - t); // 4 - let s = mod(ONE_MINUS_D * invsqrt * x * u2); // 5 - if ((0, modular_js_1.isNegativeLE)(s, P)) - s = mod(-s); - return (0, utils_js_1.numberToBytesLE)(s, 56); - } - toHex() { - return (0, utils_js_1.bytesToHex)(this.toRawBytes()); - } - toString() { - return this.toHex(); - } - // Compare one point to another. - // https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-ristretto255-decaf448-07#name-equals-2 - equals(other) { - assertDcfPoint(other); - const { ex: X1, ey: Y1 } = this.ep; - const { ex: X2, ey: Y2 } = other.ep; - const mod = exports.ed448.CURVE.Fp.create; - // (x1 * y2 == y1 * x2) - return mod(X1 * Y2) === mod(Y1 * X2); - } - add(other) { - assertDcfPoint(other); - return new DcfPoint(this.ep.add(other.ep)); - } - subtract(other) { - assertDcfPoint(other); - return new DcfPoint(this.ep.subtract(other.ep)); - } - multiply(scalar) { - return new DcfPoint(this.ep.multiply(scalar)); - } - multiplyUnsafe(scalar) { - return new DcfPoint(this.ep.multiplyUnsafe(scalar)); - } -} -exports.DecafPoint = (() => { - // decaf448 base point is ed448 base x 2 - // https://github.com/dalek-cryptography/curve25519-dalek/blob/59837c6ecff02b77b9d5ff84dbc239d0cf33ef90/vendor/ristretto.sage#L699 - if (!DcfPoint.BASE) - DcfPoint.BASE = new DcfPoint(exports.ed448.ExtendedPoint.BASE).multiply(_2n); - if (!DcfPoint.ZERO) - DcfPoint.ZERO = new DcfPoint(exports.ed448.ExtendedPoint.ZERO); - return DcfPoint; -})(); -// Hashing to decaf448. https://www.rfc-editor.org/rfc/rfc9380#appendix-C -const hashToDecaf448 = (msg, options) => { - const d = options.DST; - const DST = typeof d === 'string' ? (0, utils_1.utf8ToBytes)(d) : d; - const uniform_bytes = (0, hash_to_curve_js_1.expand_message_xof)(msg, DST, 112, 224, sha3_1.shake256); - const P = DcfPoint.hashToCurve(uniform_bytes); - return P; -}; -exports.hashToDecaf448 = hashToDecaf448; -exports.hash_to_decaf448 = exports.hashToDecaf448; // legacy -//# sourceMappingURL=ed448.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/ed448.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/ed448.js.map deleted file mode 100644 index 7a939a41..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/ed448.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed448.js","sourceRoot":"","sources":["src/ed448.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,6CAA8C;AAC9C,+CAA6F;AAC7F,sDAAqE;AACrE,sDAAuE;AACvE,4DAAsD;AACtD,kEAA6F;AAC7F,kDAO6B;AAG7B;;;;;;GAMG;AAEH,MAAM,YAAY,GAAG,IAAA,uBAAe,EAAC,GAAG,EAAE,CAAC,eAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;AAC5E,MAAM,WAAW,GAAG,IAAA,uBAAe,EAAC,GAAG,EAAE,CAAC,eAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;AAC1E,MAAM,MAAM,GAAG,MAAM,CACnB,yIAAyI,CAC1I,CAAC;AAEF,kBAAkB;AAClB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;AAC5F,kBAAkB;AAClB,MAAM,IAAI,GAAG,MAAM,CAAC,EAAE,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,EAAE,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,EAAE,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC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G,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,eAAQ,CAAC,CAAC;IACvE,MAAM,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;IAC9C,OAAO,CAAC,CAAC;AACX,CAAC,CAAC;AANW,QAAA,cAAc,kBAMzB;AACW,QAAA,gBAAgB,GAAG,sBAAc,CAAC,CAAC,SAAS"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/_shortw_utils.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/_shortw_utils.js deleted file mode 100644 index cc93e458..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/_shortw_utils.js +++ /dev/null @@ -1,17 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { hmac } from '@noble/hashes/hmac'; -import { concatBytes, randomBytes } from '@noble/hashes/utils'; -import { weierstrass } from './abstract/weierstrass.js'; -// connects noble-curves to noble-hashes -export function getHash(hash) { - return { - hash, - hmac: (key, ...msgs) => hmac(hash, key, concatBytes(...msgs)), - randomBytes, - }; -} -export function createCurve(curveDef, defHash) { - const create = (hash) => weierstrass({ ...curveDef, ...getHash(hash) }); - return Object.freeze({ ...create(defHash), create }); -} -//# sourceMappingURL=_shortw_utils.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/_shortw_utils.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/_shortw_utils.js.map deleted file mode 100644 index 656ee45f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/_shortw_utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_shortw_utils.js","sourceRoot":"","sources":["../src/_shortw_utils.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAa,MAAM,2BAA2B,CAAC;AAGnE,wCAAwC;AACxC,MAAM,UAAU,OAAO,CAAC,IAAW;IACjC,OAAO;QACL,IAAI;QACJ,IAAI,EAAE,CAAC,GAAe,EAAE,GAAG,IAAkB,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,WAAW,CAAC,GAAG,IAAI,CAAC,CAAC;QACvF,WAAW;KACZ,CAAC;AACJ,CAAC;AAGD,MAAM,UAAU,WAAW,CAAC,QAAkB,EAAE,OAAc;IAC5D,MAAM,MAAM,GAAG,CAAC,IAAW,EAAE,EAAE,CAAC,WAAW,CAAC,EAAE,GAAG,QAAQ,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC/E,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;AACvD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/bls.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/bls.js deleted file mode 100644 index 290d6519..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/bls.js +++ /dev/null @@ -1,235 +0,0 @@ -import { getMinHashLength, mapHashToField } from './modular.js'; -import { bitLen, bitGet, ensureBytes } from './utils.js'; -import * as htf from './hash-to-curve.js'; -import { weierstrassPoints, } from './weierstrass.js'; -// prettier-ignore -const _2n = BigInt(2), _3n = BigInt(3); -export function bls(CURVE) { - // Fields are specific for curve, so for now we'll need to pass them with opts - const { Fp, Fr, Fp2, Fp6, Fp12 } = CURVE.fields; - const BLS_X_LEN = bitLen(CURVE.params.x); - // Pre-compute coefficients for sparse multiplication - // Point addition and point double calculations is reused for coefficients - function calcPairingPrecomputes(p) { - const { x, y } = p; - // prettier-ignore - const Qx = x, Qy = y, Qz = Fp2.ONE; - // prettier-ignore - let Rx = Qx, Ry = Qy, Rz = Qz; - let ell_coeff = []; - for (let i = BLS_X_LEN - 2; i >= 0; i--) { - // Double - let t0 = Fp2.sqr(Ry); // Ry² - let t1 = Fp2.sqr(Rz); // Rz² - let t2 = Fp2.multiplyByB(Fp2.mul(t1, _3n)); // 3 * T1 * B - let t3 = Fp2.mul(t2, _3n); // 3 * T2 - let t4 = Fp2.sub(Fp2.sub(Fp2.sqr(Fp2.add(Ry, Rz)), t1), t0); // (Ry + Rz)² - T1 - T0 - ell_coeff.push([ - Fp2.sub(t2, t0), - Fp2.mul(Fp2.sqr(Rx), _3n), - Fp2.neg(t4), // -T4 - ]); - Rx = Fp2.div(Fp2.mul(Fp2.mul(Fp2.sub(t0, t3), Rx), Ry), _2n); // ((T0 - T3) * Rx * Ry) / 2 - Ry = Fp2.sub(Fp2.sqr(Fp2.div(Fp2.add(t0, t3), _2n)), Fp2.mul(Fp2.sqr(t2), _3n)); // ((T0 + T3) / 2)² - 3 * T2² - Rz = Fp2.mul(t0, t4); // T0 * T4 - if (bitGet(CURVE.params.x, i)) { - // Addition - let t0 = Fp2.sub(Ry, Fp2.mul(Qy, Rz)); // Ry - Qy * Rz - let t1 = Fp2.sub(Rx, Fp2.mul(Qx, Rz)); // Rx - Qx * Rz - ell_coeff.push([ - Fp2.sub(Fp2.mul(t0, Qx), Fp2.mul(t1, Qy)), - Fp2.neg(t0), - t1, // T1 - ]); - let t2 = Fp2.sqr(t1); // T1² - let t3 = Fp2.mul(t2, t1); // T2 * T1 - let t4 = Fp2.mul(t2, Rx); // T2 * Rx - let t5 = Fp2.add(Fp2.sub(t3, Fp2.mul(t4, _2n)), Fp2.mul(Fp2.sqr(t0), Rz)); // T3 - 2 * T4 + T0² * Rz - Rx = Fp2.mul(t1, t5); // T1 * T5 - Ry = Fp2.sub(Fp2.mul(Fp2.sub(t4, t5), t0), Fp2.mul(t3, Ry)); // (T4 - T5) * T0 - T3 * Ry - Rz = Fp2.mul(Rz, t3); // Rz * T3 - } - } - return ell_coeff; - } - function millerLoop(ell, g1) { - const { x } = CURVE.params; - const Px = g1[0]; - const Py = g1[1]; - let f12 = Fp12.ONE; - for (let j = 0, i = BLS_X_LEN - 2; i >= 0; i--, j++) { - const E = ell[j]; - f12 = Fp12.multiplyBy014(f12, E[0], Fp2.mul(E[1], Px), Fp2.mul(E[2], Py)); - if (bitGet(x, i)) { - j += 1; - const F = ell[j]; - f12 = Fp12.multiplyBy014(f12, F[0], Fp2.mul(F[1], Px), Fp2.mul(F[2], Py)); - } - if (i !== 0) - f12 = Fp12.sqr(f12); - } - return Fp12.conjugate(f12); - } - const utils = { - randomPrivateKey: () => { - const length = getMinHashLength(Fr.ORDER); - return mapHashToField(CURVE.randomBytes(length), Fr.ORDER); - }, - calcPairingPrecomputes, - }; - // Point on G1 curve: (x, y) - const G1_ = weierstrassPoints({ n: Fr.ORDER, ...CURVE.G1 }); - const G1 = Object.assign(G1_, htf.createHasher(G1_.ProjectivePoint, CURVE.G1.mapToCurve, { - ...CURVE.htfDefaults, - ...CURVE.G1.htfDefaults, - })); - function pairingPrecomputes(point) { - const p = point; - if (p._PPRECOMPUTES) - return p._PPRECOMPUTES; - p._PPRECOMPUTES = calcPairingPrecomputes(point.toAffine()); - return p._PPRECOMPUTES; - } - // TODO: export - // function clearPairingPrecomputes(point: G2) { - // const p = point as G2 & withPairingPrecomputes; - // p._PPRECOMPUTES = undefined; - // } - // Point on G2 curve (complex numbers): (x₁, x₂+i), (y₁, y₂+i) - const G2_ = weierstrassPoints({ n: Fr.ORDER, ...CURVE.G2 }); - const G2 = Object.assign(G2_, htf.createHasher(G2_.ProjectivePoint, CURVE.G2.mapToCurve, { - ...CURVE.htfDefaults, - ...CURVE.G2.htfDefaults, - })); - const { Signature } = CURVE.G2; - // Calculates bilinear pairing - function pairing(Q, P, withFinalExponent = true) { - if (Q.equals(G1.ProjectivePoint.ZERO) || P.equals(G2.ProjectivePoint.ZERO)) - throw new Error('pairing is not available for ZERO point'); - Q.assertValidity(); - P.assertValidity(); - // Performance: 9ms for millerLoop and ~14ms for exp. - const Qa = Q.toAffine(); - const looped = millerLoop(pairingPrecomputes(P), [Qa.x, Qa.y]); - return withFinalExponent ? Fp12.finalExponentiate(looped) : looped; - } - function normP1(point) { - return point instanceof G1.ProjectivePoint ? point : G1.ProjectivePoint.fromHex(point); - } - function normP2(point) { - return point instanceof G2.ProjectivePoint ? point : Signature.fromHex(point); - } - function normP2Hash(point, htfOpts) { - return point instanceof G2.ProjectivePoint - ? point - : G2.hashToCurve(ensureBytes('point', point), htfOpts); - } - // Multiplies generator by private key. - // P = pk x G - function getPublicKey(privateKey) { - return G1.ProjectivePoint.fromPrivateKey(privateKey).toRawBytes(true); - } - function sign(message, privateKey, htfOpts) { - const msgPoint = normP2Hash(message, htfOpts); - msgPoint.assertValidity(); - const sigPoint = msgPoint.multiply(G1.normPrivateKeyToScalar(privateKey)); - if (message instanceof G2.ProjectivePoint) - return sigPoint; - return Signature.toRawBytes(sigPoint); - } - // Checks if pairing of public key & hash is equal to pairing of generator & signature. - // e(P, H(m)) == e(G, S) - function verify(signature, message, publicKey, htfOpts) { - const P = normP1(publicKey); - const Hm = normP2Hash(message, htfOpts); - const G = G1.ProjectivePoint.BASE; - const S = normP2(signature); - // Instead of doing 2 exponentiations, we use property of billinear maps - // and do one exp after multiplying 2 points. - const ePHm = pairing(P.negate(), Hm, false); - const eGS = pairing(G, S, false); - const exp = Fp12.finalExponentiate(Fp12.mul(eGS, ePHm)); - return Fp12.eql(exp, Fp12.ONE); - } - function aggregatePublicKeys(publicKeys) { - if (!publicKeys.length) - throw new Error('Expected non-empty array'); - const agg = publicKeys.map(normP1).reduce((sum, p) => sum.add(p), G1.ProjectivePoint.ZERO); - const aggAffine = agg; //.toAffine(); - if (publicKeys[0] instanceof G1.ProjectivePoint) { - aggAffine.assertValidity(); - return aggAffine; - } - // toRawBytes ensures point validity - return aggAffine.toRawBytes(true); - } - function aggregateSignatures(signatures) { - if (!signatures.length) - throw new Error('Expected non-empty array'); - const agg = signatures.map(normP2).reduce((sum, s) => sum.add(s), G2.ProjectivePoint.ZERO); - const aggAffine = agg; //.toAffine(); - if (signatures[0] instanceof G2.ProjectivePoint) { - aggAffine.assertValidity(); - return aggAffine; - } - return Signature.toRawBytes(aggAffine); - } - // https://ethresear.ch/t/fast-verification-of-multiple-bls-signatures/5407 - // e(G, S) = e(G, SUM(n)(Si)) = MUL(n)(e(G, Si)) - function verifyBatch(signature, messages, publicKeys, htfOpts) { - // @ts-ignore - // console.log('verifyBatch', bytesToHex(signature as any), messages, publicKeys.map(bytesToHex)); - if (!messages.length) - throw new Error('Expected non-empty messages array'); - if (publicKeys.length !== messages.length) - throw new Error('Pubkey count should equal msg count'); - const sig = normP2(signature); - const nMessages = messages.map((i) => normP2Hash(i, htfOpts)); - const nPublicKeys = publicKeys.map(normP1); - try { - const paired = []; - for (const message of new Set(nMessages)) { - const groupPublicKey = nMessages.reduce((groupPublicKey, subMessage, i) => subMessage === message ? groupPublicKey.add(nPublicKeys[i]) : groupPublicKey, G1.ProjectivePoint.ZERO); - // const msg = message instanceof PointG2 ? message : await PointG2.hashToCurve(message); - // Possible to batch pairing for same msg with different groupPublicKey here - paired.push(pairing(groupPublicKey, message, false)); - } - paired.push(pairing(G1.ProjectivePoint.BASE.negate(), sig, false)); - const product = paired.reduce((a, b) => Fp12.mul(a, b), Fp12.ONE); - const exp = Fp12.finalExponentiate(product); - return Fp12.eql(exp, Fp12.ONE); - } - catch { - return false; - } - } - G1.ProjectivePoint.BASE._setWindowSize(4); - return { - getPublicKey, - sign, - verify, - verifyBatch, - aggregatePublicKeys, - aggregateSignatures, - millerLoop, - pairing, - G1, - G2, - Signature, - fields: { - Fr, - Fp, - Fp2, - Fp6, - Fp12, - }, - params: { - x: CURVE.params.x, - r: CURVE.params.r, - G1b: CURVE.G1.b, - G2b: CURVE.G2.b, - }, - utils, - }; -} -//# sourceMappingURL=bls.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/bls.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/bls.js.map deleted file mode 100644 index 5c3b5d10..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/bls.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bls.js","sourceRoot":"","sources":["../../src/abstract/bls.ts"],"names":[],"mappings":"AAcA,OAAO,EAAU,gBAAgB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAAuB,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9E,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAIL,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAI1B,kBAAkB;AAClB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AA2FvC,MAAM,UAAU,GAAG,CACjB,KAAoC;IAEpC,8EAA8E;IAC9E,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC;IAChD,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAEzC,qDAAqD;IACrD,0EAA0E;IAC1E,SAAS,sBAAsB,CAAC,CAAmB;QACjD,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;QACnB,kBAAkB;QAClB,MAAM,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,GAAG,CAAC,GAAG,CAAC;QACnC,kBAAkB;QAClB,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,G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,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IAE1C,OAAO;QACL,YAAY;QACZ,IAAI;QACJ,MAAM;QACN,WAAW;QACX,mBAAmB;QACnB,mBAAmB;QACnB,UAAU;QACV,OAAO;QACP,EAAE;QACF,EAAE;QACF,SAAS;QACT,MAAM,EAAE;YACN,EAAE;YACF,EAAE;YACF,GAAG;YACH,GAAG;YACH,IAAI;SACL;QACD,MAAM,EAAE;YACN,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;YACjB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;YACjB,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;YACf,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;SAChB;QACD,KAAK;KACN,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/curve.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/curve.js deleted file mode 100644 index 3454763e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/curve.js +++ /dev/null @@ -1,156 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -// Abelian group utilities -import { validateField, nLength } from './modular.js'; -import { validateObject } from './utils.js'; -const _0n = BigInt(0); -const _1n = BigInt(1); -// Elliptic curve multiplication of Point by scalar. Fragile. -// Scalars should always be less than curve order: this should be checked inside of a curve itself. -// Creates precomputation tables for fast multiplication: -// - private scalar is split by fixed size windows of W bits -// - every window point is collected from window's table & added to accumulator -// - since windows are different, same point inside tables won't be accessed more than once per calc -// - each multiplication is 'Math.ceil(CURVE_ORDER / 𝑊) + 1' point additions (fixed for any scalar) -// - +1 window is neccessary for wNAF -// - wNAF reduces table size: 2x less memory + 2x faster generation, but 10% slower multiplication -// TODO: Research returning 2d JS array of windows, instead of a single window. This would allow -// windows to be in different memory locations -export function wNAF(c, bits) { - const constTimeNegate = (condition, item) => { - const neg = item.negate(); - return condition ? neg : item; - }; - const opts = (W) => { - const windows = Math.ceil(bits / W) + 1; // +1, because - const windowSize = 2 ** (W - 1); // -1 because we skip zero - return { windows, windowSize }; - }; - return { - constTimeNegate, - // non-const time multiplication ladder - unsafeLadder(elm, n) { - let p = c.ZERO; - let d = elm; - while (n > _0n) { - if (n & _1n) - p = p.add(d); - d = d.double(); - n >>= _1n; - } - return p; - }, - /** - * Creates a wNAF precomputation window. Used for caching. - * Default window size is set by `utils.precompute()` and is equal to 8. - * Number of precomputed points depends on the curve size: - * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where: - * - 𝑊 is the window size - * - 𝑛 is the bitlength of the curve order. - * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224. - * @returns precomputed point tables flattened to a single array - */ - precomputeWindow(elm, W) { - const { windows, windowSize } = opts(W); - const points = []; - let p = elm; - let base = p; - for (let window = 0; window < windows; window++) { - base = p; - points.push(base); - // =1, because we skip zero - for (let i = 1; i < windowSize; i++) { - base = base.add(p); - points.push(base); - } - p = base.double(); - } - return points; - }, - /** - * Implements ec multiplication using precomputed tables and w-ary non-adjacent form. - * @param W window size - * @param precomputes precomputed tables - * @param n scalar (we don't check here, but should be less than curve order) - * @returns real and fake (for const-time) points - */ - wNAF(W, precomputes, n) { - // TODO: maybe check that scalar is less than group order? wNAF behavious is undefined otherwise - // But need to carefully remove other checks before wNAF. ORDER == bits here - const { windows, windowSize } = opts(W); - let p = c.ZERO; - let f = c.BASE; - const mask = BigInt(2 ** W - 1); // Create mask with W ones: 0b1111 for W=4 etc. - const maxNumber = 2 ** W; - const shiftBy = BigInt(W); - for (let window = 0; window < windows; window++) { - const offset = window * windowSize; - // Extract W bits. - let wbits = Number(n & mask); - // Shift number by W bits. - n >>= shiftBy; - // If the bits are bigger than max size, we'll split those. - // +224 => 256 - 32 - if (wbits > windowSize) { - wbits -= maxNumber; - n += _1n; - } - // This code was first written with assumption that 'f' and 'p' will never be infinity point: - // since each addition is multiplied by 2 ** W, it cannot cancel each other. However, - // there is negate now: it is possible that negated element from low value - // would be the same as high element, which will create carry into next window. - // It's not obvious how this can fail, but still worth investigating later. - // Check if we're onto Zero point. - // Add random point inside current window to f. - const offset1 = offset; - const offset2 = offset + Math.abs(wbits) - 1; // -1 because we skip zero - const cond1 = window % 2 !== 0; - const cond2 = wbits < 0; - if (wbits === 0) { - // The most important part for const-time getPublicKey - f = f.add(constTimeNegate(cond1, precomputes[offset1])); - } - else { - p = p.add(constTimeNegate(cond2, precomputes[offset2])); - } - } - // JIT-compiler should not eliminate f here, since it will later be used in normalizeZ() - // Even if the variable is still unused, there are some checks which will - // throw an exception, so compiler needs to prove they won't happen, which is hard. - // At this point there is a way to F be infinity-point even if p is not, - // which makes it less const-time: around 1 bigint multiply. - return { p, f }; - }, - wNAFCached(P, precomputesMap, n, transform) { - // @ts-ignore - const W = P._WINDOW_SIZE || 1; - // Calculate precomputes on a first run, reuse them after - let comp = precomputesMap.get(P); - if (!comp) { - comp = this.precomputeWindow(P, W); - if (W !== 1) { - precomputesMap.set(P, transform(comp)); - } - } - return this.wNAF(W, comp, n); - }, - }; -} -export function validateBasic(curve) { - validateField(curve.Fp); - validateObject(curve, { - n: 'bigint', - h: 'bigint', - Gx: 'field', - Gy: 'field', - }, { - nBitLength: 'isSafeInteger', - nByteLength: 'isSafeInteger', - }); - // Set defaults - return Object.freeze({ - ...nLength(curve.n, curve.nBitLength), - ...curve, - ...{ p: curve.Fp.ORDER }, - }); -} -//# sourceMappingURL=curve.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/curve.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/curve.js.map deleted file mode 100644 index f0fbc7d3..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/curve.js.map +++ /d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} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/edwards.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/edwards.js deleted file mode 100644 index de5123ae..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/edwards.js +++ /dev/null @@ -1,425 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -// Twisted Edwards curve. The formula is: ax² + y² = 1 + dx²y² -import { mod } from './modular.js'; -import * as ut from './utils.js'; -import { ensureBytes } from './utils.js'; -import { wNAF, validateBasic } from './curve.js'; -// Be friendly to bad ECMAScript parsers by not using bigint literals -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _8n = BigInt(8); -// verification rule is either zip215 or rfc8032 / nist186-5. Consult fromHex: -const VERIFY_DEFAULT = { zip215: true }; -function validateOpts(curve) { - const opts = validateBasic(curve); - ut.validateObject(curve, { - hash: 'function', - a: 'bigint', - d: 'bigint', - randomBytes: 'function', - }, { - adjustScalarBytes: 'function', - domain: 'function', - uvRatio: 'function', - mapToCurve: 'function', - }); - // Set defaults - return Object.freeze({ ...opts }); -} -// It is not generic twisted curve for now, but ed25519/ed448 generic implementation -export function twistedEdwards(curveDef) { - const CURVE = validateOpts(curveDef); - const { Fp, n: CURVE_ORDER, prehash: prehash, hash: cHash, randomBytes, nByteLength, h: cofactor, } = CURVE; - const MASK = _2n << (BigInt(nByteLength * 8) - _1n); - const modP = Fp.create; // Function overrides - // sqrt(u/v) - const uvRatio = CURVE.uvRatio || - ((u, v) => { - try { - return { isValid: true, value: Fp.sqrt(u * Fp.inv(v)) }; - } - catch (e) { - return { isValid: false, value: _0n }; - } - }); - const adjustScalarBytes = CURVE.adjustScalarBytes || ((bytes) => bytes); // NOOP - const domain = CURVE.domain || - ((data, ctx, phflag) => { - if (ctx.length || phflag) - throw new Error('Contexts/pre-hash are not supported'); - return data; - }); // NOOP - const inBig = (n) => typeof n === 'bigint' && _0n < n; // n in [1..] - const inRange = (n, max) => inBig(n) && inBig(max) && n < max; // n in [1..max-1] - const in0MaskRange = (n) => n === _0n || inRange(n, MASK); // n in [0..MASK-1] - function assertInRange(n, max) { - // n in [1..max-1] - if (inRange(n, max)) - return n; - throw new Error(`Expected valid scalar < ${max}, got ${typeof n} ${n}`); - } - function assertGE0(n) { - // n in [0..CURVE_ORDER-1] - return n === _0n ? n : assertInRange(n, CURVE_ORDER); // GE = prime subgroup, not full group - } - const pointPrecomputes = new Map(); - function isPoint(other) { - if (!(other instanceof Point)) - throw new Error('ExtendedPoint expected'); - } - // Extended Point works in extended coordinates: (x, y, z, t) ∋ (x=x/z, y=y/z, t=xy). - // https://en.wikipedia.org/wiki/Twisted_Edwards_curve#Extended_coordinates - class Point { - constructor(ex, ey, ez, et) { - this.ex = ex; - this.ey = ey; - this.ez = ez; - this.et = et; - if (!in0MaskRange(ex)) - throw new Error('x required'); - if (!in0MaskRange(ey)) - throw new Error('y required'); - if (!in0MaskRange(ez)) - throw new Error('z required'); - if (!in0MaskRange(et)) - throw new Error('t required'); - } - get x() { - return this.toAffine().x; - } - get y() { - return this.toAffine().y; - } - static fromAffine(p) { - if (p instanceof Point) - throw new Error('extended point not allowed'); - const { x, y } = p || {}; - if (!in0MaskRange(x) || !in0MaskRange(y)) - throw new Error('invalid affine point'); - return new Point(x, y, _1n, modP(x * y)); - } - static normalizeZ(points) { - const toInv = Fp.invertBatch(points.map((p) => p.ez)); - return points.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine); - } - // "Private method", don't use it directly - _setWindowSize(windowSize) { - this._WINDOW_SIZE = windowSize; - pointPrecomputes.delete(this); - } - // Not required for fromHex(), which always creates valid points. - // Could be useful for fromAffine(). - assertValidity() { - const { a, d } = CURVE; - if (this.is0()) - throw new Error('bad point: ZERO'); // TODO: optimize, with vars below? - // Equation in affine coordinates: ax² + y² = 1 + dx²y² - // Equation in projective coordinates (X/Z, Y/Z, Z): (aX² + Y²)Z² = Z⁴ + dX²Y² - const { ex: X, ey: Y, ez: Z, et: T } = this; - const X2 = modP(X * X); // X² - const Y2 = modP(Y * Y); // Y² - const Z2 = modP(Z * Z); // Z² - const Z4 = modP(Z2 * Z2); // Z⁴ - const aX2 = modP(X2 * a); // aX² - const left = modP(Z2 * modP(aX2 + Y2)); // (aX² + Y²)Z² - const right = modP(Z4 + modP(d * modP(X2 * Y2))); // Z⁴ + dX²Y² - if (left !== right) - throw new Error('bad point: equation left != right (1)'); - // In Extended coordinates we also have T, which is x*y=T/Z: check X*Y == Z*T - const XY = modP(X * Y); - const ZT = modP(Z * T); - if (XY !== ZT) - throw new Error('bad point: equation left != right (2)'); - } - // Compare one point to another. - equals(other) { - isPoint(other); - const { ex: X1, ey: Y1, ez: Z1 } = this; - const { ex: X2, ey: Y2, ez: Z2 } = other; - const X1Z2 = modP(X1 * Z2); - const X2Z1 = modP(X2 * Z1); - const Y1Z2 = modP(Y1 * Z2); - const Y2Z1 = modP(Y2 * Z1); - return X1Z2 === X2Z1 && Y1Z2 === Y2Z1; - } - is0() { - return this.equals(Point.ZERO); - } - negate() { - // Flips point sign to a negative one (-x, y in affine coords) - return new Point(modP(-this.ex), this.ey, this.ez, modP(-this.et)); - } - // Fast algo for doubling Extended Point. - // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-dbl-2008-hwcd - // Cost: 4M + 4S + 1*a + 6add + 1*2. - double() { - const { a } = CURVE; - const { ex: X1, ey: Y1, ez: Z1 } = this; - const A = modP(X1 * X1); // A = X12 - const B = modP(Y1 * Y1); // B = Y12 - const C = modP(_2n * modP(Z1 * Z1)); // C = 2*Z12 - const D = modP(a * A); // D = a*A - const x1y1 = X1 + Y1; - const E = modP(modP(x1y1 * x1y1) - A - B); // E = (X1+Y1)2-A-B - const G = D + B; // G = D+B - const F = G - C; // F = G-C - const H = D - B; // H = D-B - const X3 = modP(E * F); // X3 = E*F - const Y3 = modP(G * H); // Y3 = G*H - const T3 = modP(E * H); // T3 = E*H - const Z3 = modP(F * G); // Z3 = F*G - return new Point(X3, Y3, Z3, T3); - } - // Fast algo for adding 2 Extended Points. - // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-add-2008-hwcd - // Cost: 9M + 1*a + 1*d + 7add. - add(other) { - isPoint(other); - const { a, d } = CURVE; - const { ex: X1, ey: Y1, ez: Z1, et: T1 } = this; - const { ex: X2, ey: Y2, ez: Z2, et: T2 } = other; - // Faster algo for adding 2 Extended Points when curve's a=-1. - // http://hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html#addition-add-2008-hwcd-4 - // Cost: 8M + 8add + 2*2. - // Note: It does not check whether the `other` point is valid. - if (a === BigInt(-1)) { - const A = modP((Y1 - X1) * (Y2 + X2)); - const B = modP((Y1 + X1) * (Y2 - X2)); - const F = modP(B - A); - if (F === _0n) - return this.double(); // Same point. Tests say it doesn't affect timing - const C = modP(Z1 * _2n * T2); - const D = modP(T1 * _2n * Z2); - const E = D + C; - const G = B + A; - const H = D - C; - const X3 = modP(E * F); - const Y3 = modP(G * H); - const T3 = modP(E * H); - const Z3 = modP(F * G); - return new Point(X3, Y3, Z3, T3); - } - const A = modP(X1 * X2); // A = X1*X2 - const B = modP(Y1 * Y2); // B = Y1*Y2 - const C = modP(T1 * d * T2); // C = T1*d*T2 - const D = modP(Z1 * Z2); // D = Z1*Z2 - const E = modP((X1 + Y1) * (X2 + Y2) - A - B); // E = (X1+Y1)*(X2+Y2)-A-B - const F = D - C; // F = D-C - const G = D + C; // G = D+C - const H = modP(B - a * A); // H = B-a*A - const X3 = modP(E * F); // X3 = E*F - const Y3 = modP(G * H); // Y3 = G*H - const T3 = modP(E * H); // T3 = E*H - const Z3 = modP(F * G); // Z3 = F*G - return new Point(X3, Y3, Z3, T3); - } - subtract(other) { - return this.add(other.negate()); - } - wNAF(n) { - return wnaf.wNAFCached(this, pointPrecomputes, n, Point.normalizeZ); - } - // Constant-time multiplication. - multiply(scalar) { - const { p, f } = this.wNAF(assertInRange(scalar, CURVE_ORDER)); - return Point.normalizeZ([p, f])[0]; - } - // Non-constant-time multiplication. Uses double-and-add algorithm. - // It's faster, but should only be used when you don't care about - // an exposed private key e.g. sig verification. - // Does NOT allow scalars higher than CURVE.n. - multiplyUnsafe(scalar) { - let n = assertGE0(scalar); // 0 <= scalar < CURVE.n - if (n === _0n) - return I; - if (this.equals(I) || n === _1n) - return this; - if (this.equals(G)) - return this.wNAF(n).p; - return wnaf.unsafeLadder(this, n); - } - // Checks if point is of small order. - // If you add something to small order point, you will have "dirty" - // point with torsion component. - // Multiplies point by cofactor and checks if the result is 0. - isSmallOrder() { - return this.multiplyUnsafe(cofactor).is0(); - } - // Multiplies point by curve order and checks if the result is 0. - // Returns `false` is the point is dirty. - isTorsionFree() { - return wnaf.unsafeLadder(this, CURVE_ORDER).is0(); - } - // Converts Extended point to default (x, y) coordinates. - // Can accept precomputed Z^-1 - for example, from invertBatch. - toAffine(iz) { - const { ex: x, ey: y, ez: z } = this; - const is0 = this.is0(); - if (iz == null) - iz = is0 ? _8n : Fp.inv(z); // 8 was chosen arbitrarily - const ax = modP(x * iz); - const ay = modP(y * iz); - const zz = modP(z * iz); - if (is0) - return { x: _0n, y: _1n }; - if (zz !== _1n) - throw new Error('invZ was invalid'); - return { x: ax, y: ay }; - } - clearCofactor() { - const { h: cofactor } = CURVE; - if (cofactor === _1n) - return this; - return this.multiplyUnsafe(cofactor); - } - // Converts hash string or Uint8Array to Point. - // Uses algo from RFC8032 5.1.3. - static fromHex(hex, zip215 = false) { - const { d, a } = CURVE; - const len = Fp.BYTES; - hex = ensureBytes('pointHex', hex, len); // copy hex to a new array - const normed = hex.slice(); // copy again, we'll manipulate it - const lastByte = hex[len - 1]; // select last byte - normed[len - 1] = lastByte & ~0x80; // clear last bit - const y = ut.bytesToNumberLE(normed); - if (y === _0n) { - // y=0 is allowed - } - else { - // RFC8032 prohibits >= p, but ZIP215 doesn't - if (zip215) - assertInRange(y, MASK); // zip215=true [1..P-1] (2^255-19-1 for ed25519) - else - assertInRange(y, Fp.ORDER); // zip215=false [1..MASK-1] (2^256-1 for ed25519) - } - // Ed25519: x² = (y²-1)/(dy²+1) mod p. Ed448: x² = (y²-1)/(dy²-1) mod p. Generic case: - // ax²+y²=1+dx²y² => y²-1=dx²y²-ax² => y²-1=x²(dy²-a) => x²=(y²-1)/(dy²-a) - const y2 = modP(y * y); // denominator is always non-0 mod p. - const u = modP(y2 - _1n); // u = y² - 1 - const v = modP(d * y2 - a); // v = d y² + 1. - let { isValid, value: x } = uvRatio(u, v); // √(u/v) - if (!isValid) - throw new Error('Point.fromHex: invalid y coordinate'); - const isXOdd = (x & _1n) === _1n; // There are 2 square roots. Use x_0 bit to select proper - const isLastByteOdd = (lastByte & 0x80) !== 0; // x_0, last bit - if (!zip215 && x === _0n && isLastByteOdd) - // if x=0 and x_0 = 1, fail - throw new Error('Point.fromHex: x=0 and x_0=1'); - if (isLastByteOdd !== isXOdd) - x = modP(-x); // if x_0 != x mod 2, set x = p-x - return Point.fromAffine({ x, y }); - } - static fromPrivateKey(privKey) { - return getExtendedPublicKey(privKey).point; - } - toRawBytes() { - const { x, y } = this.toAffine(); - const bytes = ut.numberToBytesLE(y, Fp.BYTES); // each y has 2 x values (x, -y) - bytes[bytes.length - 1] |= x & _1n ? 0x80 : 0; // when compressing, it's enough to store y - return bytes; // and use the last byte to encode sign of x - } - toHex() { - return ut.bytesToHex(this.toRawBytes()); // Same as toRawBytes, but returns string. - } - } - Point.BASE = new Point(CURVE.Gx, CURVE.Gy, _1n, modP(CURVE.Gx * CURVE.Gy)); - Point.ZERO = new Point(_0n, _1n, _1n, _0n); // 0, 1, 1, 0 - const { BASE: G, ZERO: I } = Point; - const wnaf = wNAF(Point, nByteLength * 8); - function modN(a) { - return mod(a, CURVE_ORDER); - } - // Little-endian SHA512 with modulo n - function modN_LE(hash) { - return modN(ut.bytesToNumberLE(hash)); - } - /** Convenience method that creates public key and other stuff. RFC8032 5.1.5 */ - function getExtendedPublicKey(key) { - const len = nByteLength; - key = ensureBytes('private key', key, len); - // Hash private key with curve's hash function to produce uniformingly random input - // Check byte lengths: ensure(64, h(ensure(32, key))) - const hashed = ensureBytes('hashed private key', cHash(key), 2 * len); - const head = adjustScalarBytes(hashed.slice(0, len)); // clear first half bits, produce FE - const prefix = hashed.slice(len, 2 * len); // second half is called key prefix (5.1.6) - const scalar = modN_LE(head); // The actual private scalar - const point = G.multiply(scalar); // Point on Edwards curve aka public key - const pointBytes = point.toRawBytes(); // Uint8Array representation - return { head, prefix, scalar, point, pointBytes }; - } - // Calculates EdDSA pub key. RFC8032 5.1.5. Privkey is hashed. Use first half with 3 bits cleared - function getPublicKey(privKey) { - return getExtendedPublicKey(privKey).pointBytes; - } - // int('LE', SHA512(dom2(F, C) || msgs)) mod N - function hashDomainToScalar(context = new Uint8Array(), ...msgs) { - const msg = ut.concatBytes(...msgs); - return modN_LE(cHash(domain(msg, ensureBytes('context', context), !!prehash))); - } - /** Signs message with privateKey. RFC8032 5.1.6 */ - function sign(msg, privKey, options = {}) { - msg = ensureBytes('message', msg); - if (prehash) - msg = prehash(msg); // for ed25519ph etc. - const { prefix, scalar, pointBytes } = getExtendedPublicKey(privKey); - const r = hashDomainToScalar(options.context, prefix, msg); // r = dom2(F, C) || prefix || PH(M) - const R = G.multiply(r).toRawBytes(); // R = rG - const k = hashDomainToScalar(options.context, R, pointBytes, msg); // R || A || PH(M) - const s = modN(r + k * scalar); // S = (r + k * s) mod L - assertGE0(s); // 0 <= s < l - const res = ut.concatBytes(R, ut.numberToBytesLE(s, Fp.BYTES)); - return ensureBytes('result', res, nByteLength * 2); // 64-byte signature - } - const verifyOpts = VERIFY_DEFAULT; - function verify(sig, msg, publicKey, options = verifyOpts) { - const { context, zip215 } = options; - const len = Fp.BYTES; // Verifies EdDSA signature against message and public key. RFC8032 5.1.7. - sig = ensureBytes('signature', sig, 2 * len); // An extended group equation is checked. - msg = ensureBytes('message', msg); - if (prehash) - msg = prehash(msg); // for ed25519ph, etc - const s = ut.bytesToNumberLE(sig.slice(len, 2 * len)); - // zip215: true is good for consensus-critical apps and allows points < 2^256 - // zip215: false follows RFC8032 / NIST186-5 and restricts points to CURVE.p - let A, R, SB; - try { - A = Point.fromHex(publicKey, zip215); - R = Point.fromHex(sig.slice(0, len), zip215); - SB = G.multiplyUnsafe(s); // 0 <= s < l is done inside - } - catch (error) { - return false; - } - if (!zip215 && A.isSmallOrder()) - return false; - const k = hashDomainToScalar(context, R.toRawBytes(), A.toRawBytes(), msg); - const RkA = R.add(A.multiplyUnsafe(k)); - // [8][S]B = [8]R + [8][k]A' - return RkA.subtract(SB).clearCofactor().equals(Point.ZERO); - } - G._setWindowSize(8); // Enable precomputes. Slows down first publicKey computation by 20ms. - const utils = { - getExtendedPublicKey, - // ed25519 private keys are uniform 32b. No need to check for modulo bias, like in secp256k1. - randomPrivateKey: () => randomBytes(Fp.BYTES), - /** - * We're doing scalar multiplication (used in getPublicKey etc) with precomputed BASE_POINT - * values. This slows down first getPublicKey() by milliseconds (see Speed section), - * but allows to speed-up subsequent getPublicKey() calls up to 20x. - * @param windowSize 2, 4, 8, 16 - */ - precompute(windowSize = 8, point = Point.BASE) { - point._setWindowSize(windowSize); - point.multiply(BigInt(3)); - return point; - }, - }; - return { - CURVE, - getPublicKey, - sign, - verify, - ExtendedPoint: Point, - utils, - }; -} -//# sourceMappingURL=edwards.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/edwards.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/edwards.js.map deleted file mode 100644 index dda68a80..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/edwards.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"edwards.js","sourceRoot":"","sources":["../../src/abstract/edwards.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,8DAA8D;AAC9D,OA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ers/node_modules/@noble/curves/esm/abstract/hash-to-curve.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/hash-to-curve.js deleted file mode 100644 index 36a25b44..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/hash-to-curve.js +++ /dev/null @@ -1,173 +0,0 @@ -import { mod } from './modular.js'; -import { bytesToNumberBE, concatBytes, utf8ToBytes, validateObject } from './utils.js'; -function validateDST(dst) { - if (dst instanceof Uint8Array) - return dst; - if (typeof dst === 'string') - return utf8ToBytes(dst); - throw new Error('DST must be Uint8Array or string'); -} -// Octet Stream to Integer. "spec" implementation of os2ip is 2.5x slower vs bytesToNumberBE. -const os2ip = bytesToNumberBE; -// Integer to Octet Stream (numberToBytesBE) -function i2osp(value, length) { - if (value < 0 || value >= 1 << (8 * length)) { - throw new Error(`bad I2OSP call: value=${value} length=${length}`); - } - const res = Array.from({ length }).fill(0); - for (let i = length - 1; i >= 0; i--) { - res[i] = value & 0xff; - value >>>= 8; - } - return new Uint8Array(res); -} -function strxor(a, b) { - const arr = new Uint8Array(a.length); - for (let i = 0; i < a.length; i++) { - arr[i] = a[i] ^ b[i]; - } - return arr; -} -function isBytes(item) { - if (!(item instanceof Uint8Array)) - throw new Error('Uint8Array expected'); -} -function isNum(item) { - if (!Number.isSafeInteger(item)) - throw new Error('number expected'); -} -// Produces a uniformly random byte string using a cryptographic hash function H that outputs b bits -// https://www.rfc-editor.org/rfc/rfc9380#section-5.3.1 -export function expand_message_xmd(msg, DST, lenInBytes, H) { - isBytes(msg); - isBytes(DST); - isNum(lenInBytes); - // https://www.rfc-editor.org/rfc/rfc9380#section-5.3.3 - if (DST.length > 255) - DST = H(concatBytes(utf8ToBytes('H2C-OVERSIZE-DST-'), DST)); - const { outputLen: b_in_bytes, blockLen: r_in_bytes } = H; - const ell = Math.ceil(lenInBytes / b_in_bytes); - if (ell > 255) - throw new Error('Invalid xmd length'); - const DST_prime = concatBytes(DST, i2osp(DST.length, 1)); - const Z_pad = i2osp(0, r_in_bytes); - const l_i_b_str = i2osp(lenInBytes, 2); // len_in_bytes_str - const b = new Array(ell); - const b_0 = H(concatBytes(Z_pad, msg, l_i_b_str, i2osp(0, 1), DST_prime)); - b[0] = H(concatBytes(b_0, i2osp(1, 1), DST_prime)); - for (let i = 1; i <= ell; i++) { - const args = [strxor(b_0, b[i - 1]), i2osp(i + 1, 1), DST_prime]; - b[i] = H(concatBytes(...args)); - } - const pseudo_random_bytes = concatBytes(...b); - return pseudo_random_bytes.slice(0, lenInBytes); -} -// Produces a uniformly random byte string using an extendable-output function (XOF) H. -// 1. The collision resistance of H MUST be at least k bits. -// 2. H MUST be an XOF that has been proved indifferentiable from -// a random oracle under a reasonable cryptographic assumption. -// https://www.rfc-editor.org/rfc/rfc9380#section-5.3.2 -export function expand_message_xof(msg, DST, lenInBytes, k, H) { - isBytes(msg); - isBytes(DST); - isNum(lenInBytes); - // https://www.rfc-editor.org/rfc/rfc9380#section-5.3.3 - // DST = H('H2C-OVERSIZE-DST-' || a_very_long_DST, Math.ceil((lenInBytes * k) / 8)); - if (DST.length > 255) { - const dkLen = Math.ceil((2 * k) / 8); - DST = H.create({ dkLen }).update(utf8ToBytes('H2C-OVERSIZE-DST-')).update(DST).digest(); - } - if (lenInBytes > 65535 || DST.length > 255) - throw new Error('expand_message_xof: invalid lenInBytes'); - return (H.create({ dkLen: lenInBytes }) - .update(msg) - .update(i2osp(lenInBytes, 2)) - // 2. DST_prime = DST || I2OSP(len(DST), 1) - .update(DST) - .update(i2osp(DST.length, 1)) - .digest()); -} -/** - * Hashes arbitrary-length byte strings to a list of one or more elements of a finite field F - * https://www.rfc-editor.org/rfc/rfc9380#section-5.2 - * @param msg a byte string containing the message to hash - * @param count the number of elements of F to output - * @param options `{DST: string, p: bigint, m: number, k: number, expand: 'xmd' | 'xof', hash: H}`, see above - * @returns [u_0, ..., u_(count - 1)], a list of field elements. - */ -export function hash_to_field(msg, count, options) { - validateObject(options, { - DST: 'stringOrUint8Array', - p: 'bigint', - m: 'isSafeInteger', - k: 'isSafeInteger', - hash: 'hash', - }); - const { p, k, m, hash, expand, DST: _DST } = options; - isBytes(msg); - isNum(count); - const DST = validateDST(_DST); - const log2p = p.toString(2).length; - const L = Math.ceil((log2p + k) / 8); // section 5.1 of ietf draft link above - const len_in_bytes = count * m * L; - let prb; // pseudo_random_bytes - if (expand === 'xmd') { - prb = expand_message_xmd(msg, DST, len_in_bytes, hash); - } - else if (expand === 'xof') { - prb = expand_message_xof(msg, DST, len_in_bytes, k, hash); - } - else if (expand === '_internal_pass') { - // for internal tests only - prb = msg; - } - else { - throw new Error('expand must be "xmd" or "xof"'); - } - const u = new Array(count); - for (let i = 0; i < count; i++) { - const e = new Array(m); - for (let j = 0; j < m; j++) { - const elm_offset = L * (j + i * m); - const tv = prb.subarray(elm_offset, elm_offset + L); - e[j] = mod(os2ip(tv), p); - } - u[i] = e; - } - return u; -} -export function isogenyMap(field, map) { - // Make same order as in spec - const COEFF = map.map((i) => Array.from(i).reverse()); - return (x, y) => { - const [xNum, xDen, yNum, yDen] = COEFF.map((val) => val.reduce((acc, i) => field.add(field.mul(acc, x), i))); - x = field.div(xNum, xDen); // xNum / xDen - y = field.mul(y, field.div(yNum, yDen)); // y * (yNum / yDev) - return { x, y }; - }; -} -export function createHasher(Point, mapToCurve, def) { - if (typeof mapToCurve !== 'function') - throw new Error('mapToCurve() must be defined'); - return { - // Encodes byte string to elliptic curve. - // hash_to_curve from https://www.rfc-editor.org/rfc/rfc9380#section-3 - hashToCurve(msg, options) { - const u = hash_to_field(msg, 2, { ...def, DST: def.DST, ...options }); - const u0 = Point.fromAffine(mapToCurve(u[0])); - const u1 = Point.fromAffine(mapToCurve(u[1])); - const P = u0.add(u1).clearCofactor(); - P.assertValidity(); - return P; - }, - // Encodes byte string to elliptic curve. - // encode_to_curve from https://www.rfc-editor.org/rfc/rfc9380#section-3 - encodeToCurve(msg, options) { - const u = hash_to_field(msg, 1, { ...def, DST: def.encodeDST, ...options }); - const P = Point.fromAffine(mapToCurve(u[0])).clearCofactor(); - P.assertValidity(); - return P; - }, - }; -} -//# sourceMappingURL=hash-to-curve.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/hash-to-curve.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/hash-to-curve.js.map deleted file mode 100644 index faee1402..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/hash-to-curve.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hash-to-curve.js","sourceRoot":"","sources":["../../src/abstract/hash-to-curve.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAS,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAoB9F,SAAS,WAAW,CAAC,GAAmB;IACtC,IAAI,GAAG,YAAY,UAAU;QAAE,OAAO,GAAG,CAAC;IAC1C,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC;IACrD,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;AACtD,CAAC;AAED,6FAA6F;AAC7F,MAAM,KAAK,GAAG,eAAe,CAAC;AAE9B,4CAA4C;AAC5C,SAAS,KAAK,CAAC,KAAa,EAAE,MAAc;IAC1C,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,EAAE;QAC3C,MAAM,IAAI,KAAK,CAAC,yBAAyB,KAAK,WAAW,MAAM,EAAE,CAAC,CAAC;KACpE;IACD,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAa,CAAC;IACvD,KAAK,IAAI,CAAC,GAA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,CAAC,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC;YAC7D,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,OAAO,CAAC,CAAC;QACX,CAAC;KACF,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/modular.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/modular.js deleted file mode 100644 index ec835a32..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/modular.js +++ /dev/null @@ -1,416 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -// Utilities for modular arithmetics and finite fields -import { bitMask, numberToBytesBE, numberToBytesLE, bytesToNumberBE, bytesToNumberLE, ensureBytes, validateObject, } from './utils.js'; -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3); -// prettier-ignore -const _4n = BigInt(4), _5n = BigInt(5), _8n = BigInt(8); -// prettier-ignore -const _9n = BigInt(9), _16n = BigInt(16); -// Calculates a modulo b -export function mod(a, b) { - const result = a % b; - return result >= _0n ? result : b + result; -} -/** - * Efficiently raise num to power and do modular division. - * Unsafe in some contexts: uses ladder, so can expose bigint bits. - * @example - * pow(2n, 6n, 11n) // 64n % 11n == 9n - */ -// TODO: use field version && remove -export function pow(num, power, modulo) { - if (modulo <= _0n || power < _0n) - throw new Error('Expected power/modulo > 0'); - if (modulo === _1n) - return _0n; - let res = _1n; - while (power > _0n) { - if (power & _1n) - res = (res * num) % modulo; - num = (num * num) % modulo; - power >>= _1n; - } - return res; -} -// Does x ^ (2 ^ power) mod p. pow2(30, 4) == 30 ^ (2 ^ 4) -export function pow2(x, power, modulo) { - let res = x; - while (power-- > _0n) { - res *= res; - res %= modulo; - } - return res; -} -// Inverses number over modulo -export function invert(number, modulo) { - if (number === _0n || modulo <= _0n) { - throw new Error(`invert: expected positive integers, got n=${number} mod=${modulo}`); - } - // Euclidean GCD https://brilliant.org/wiki/extended-euclidean-algorithm/ - // Fermat's little theorem "CT-like" version inv(n) = n^(m-2) mod m is 30x slower. - let a = mod(number, modulo); - let b = modulo; - // prettier-ignore - let x = _0n, y = _1n, u = _1n, v = _0n; - while (a !== _0n) { - // JIT applies optimization if those two lines follow each other - const q = b / a; - const r = b % a; - const m = x - u * q; - const n = y - v * q; - // prettier-ignore - b = a, a = r, x = u, y = v, u = m, v = n; - } - const gcd = b; - if (gcd !== _1n) - throw new Error('invert: does not exist'); - return mod(x, modulo); -} -/** - * Tonelli-Shanks square root search algorithm. - * 1. https://eprint.iacr.org/2012/685.pdf (page 12) - * 2. Square Roots from 1; 24, 51, 10 to Dan Shanks - * Will start an infinite loop if field order P is not prime. - * @param P field order - * @returns function that takes field Fp (created from P) and number n - */ -export function tonelliShanks(P) { - // Legendre constant: used to calculate Legendre symbol (a | p), - // which denotes the value of a^((p-1)/2) (mod p). - // (a | p) ≡ 1 if a is a square (mod p) - // (a | p) ≡ -1 if a is not a square (mod p) - // (a | p) ≡ 0 if a ≡ 0 (mod p) - const legendreC = (P - _1n) / _2n; - let Q, S, Z; - // Step 1: By factoring out powers of 2 from p - 1, - // find q and s such that p - 1 = q*(2^s) with q odd - for (Q = P - _1n, S = 0; Q % _2n === _0n; Q /= _2n, S++) - ; - // Step 2: Select a non-square z such that (z | p) ≡ -1 and set c ≡ zq - for (Z = _2n; Z < P && pow(Z, legendreC, P) !== P - _1n; Z++) - ; - // Fast-path - if (S === 1) { - const p1div4 = (P + _1n) / _4n; - return function tonelliFast(Fp, n) { - const root = Fp.pow(n, p1div4); - if (!Fp.eql(Fp.sqr(root), n)) - throw new Error('Cannot find square root'); - return root; - }; - } - // Slow-path - const Q1div2 = (Q + _1n) / _2n; - return function tonelliSlow(Fp, n) { - // Step 0: Check that n is indeed a square: (n | p) should not be ≡ -1 - if (Fp.pow(n, legendreC) === Fp.neg(Fp.ONE)) - throw new Error('Cannot find square root'); - let r = S; - // TODO: will fail at Fp2/etc - let g = Fp.pow(Fp.mul(Fp.ONE, Z), Q); // will update both x and b - let x = Fp.pow(n, Q1div2); // first guess at the square root - let b = Fp.pow(n, Q); // first guess at the fudge factor - while (!Fp.eql(b, Fp.ONE)) { - if (Fp.eql(b, Fp.ZERO)) - return Fp.ZERO; // https://en.wikipedia.org/wiki/Tonelli%E2%80%93Shanks_algorithm (4. If t = 0, return r = 0) - // Find m such b^(2^m)==1 - let m = 1; - for (let t2 = Fp.sqr(b); m < r; m++) { - if (Fp.eql(t2, Fp.ONE)) - break; - t2 = Fp.sqr(t2); // t2 *= t2 - } - // NOTE: r-m-1 can be bigger than 32, need to convert to bigint before shift, otherwise there will be overflow - const ge = Fp.pow(g, _1n << BigInt(r - m - 1)); // ge = 2^(r-m-1) - g = Fp.sqr(ge); // g = ge * ge - x = Fp.mul(x, ge); // x *= ge - b = Fp.mul(b, g); // b *= g - r = m; - } - return x; - }; -} -export function FpSqrt(P) { - // NOTE: different algorithms can give different roots, it is up to user to decide which one they want. - // For example there is FpSqrtOdd/FpSqrtEven to choice root based on oddness (used for hash-to-curve). - // P ≡ 3 (mod 4) - // √n = n^((P+1)/4) - if (P % _4n === _3n) { - // Not all roots possible! - // const ORDER = - // 0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaabn; - // const NUM = 72057594037927816n; - const p1div4 = (P + _1n) / _4n; - return function sqrt3mod4(Fp, n) { - const root = Fp.pow(n, p1div4); - // Throw if root**2 != n - if (!Fp.eql(Fp.sqr(root), n)) - throw new Error('Cannot find square root'); - return root; - }; - } - // Atkin algorithm for q ≡ 5 (mod 8), https://eprint.iacr.org/2012/685.pdf (page 10) - if (P % _8n === _5n) { - const c1 = (P - _5n) / _8n; - return function sqrt5mod8(Fp, n) { - const n2 = Fp.mul(n, _2n); - const v = Fp.pow(n2, c1); - const nv = Fp.mul(n, v); - const i = Fp.mul(Fp.mul(nv, _2n), v); - const root = Fp.mul(nv, Fp.sub(i, Fp.ONE)); - if (!Fp.eql(Fp.sqr(root), n)) - throw new Error('Cannot find square root'); - return root; - }; - } - // P ≡ 9 (mod 16) - if (P % _16n === _9n) { - // NOTE: tonelli is too slow for bls-Fp2 calculations even on start - // Means we cannot use sqrt for constants at all! - // - // const c1 = Fp.sqrt(Fp.negate(Fp.ONE)); // 1. c1 = sqrt(-1) in F, i.e., (c1^2) == -1 in F - // const c2 = Fp.sqrt(c1); // 2. c2 = sqrt(c1) in F, i.e., (c2^2) == c1 in F - // const c3 = Fp.sqrt(Fp.negate(c1)); // 3. c3 = sqrt(-c1) in F, i.e., (c3^2) == -c1 in F - // const c4 = (P + _7n) / _16n; // 4. c4 = (q + 7) / 16 # Integer arithmetic - // sqrt = (x) => { - // let tv1 = Fp.pow(x, c4); // 1. tv1 = x^c4 - // let tv2 = Fp.mul(c1, tv1); // 2. tv2 = c1 * tv1 - // const tv3 = Fp.mul(c2, tv1); // 3. tv3 = c2 * tv1 - // let tv4 = Fp.mul(c3, tv1); // 4. tv4 = c3 * tv1 - // const e1 = Fp.equals(Fp.square(tv2), x); // 5. e1 = (tv2^2) == x - // const e2 = Fp.equals(Fp.square(tv3), x); // 6. e2 = (tv3^2) == x - // tv1 = Fp.cmov(tv1, tv2, e1); // 7. tv1 = CMOV(tv1, tv2, e1) # Select tv2 if (tv2^2) == x - // tv2 = Fp.cmov(tv4, tv3, e2); // 8. tv2 = CMOV(tv4, tv3, e2) # Select tv3 if (tv3^2) == x - // const e3 = Fp.equals(Fp.square(tv2), x); // 9. e3 = (tv2^2) == x - // return Fp.cmov(tv1, tv2, e3); // 10. z = CMOV(tv1, tv2, e3) # Select the sqrt from tv1 and tv2 - // } - } - // Other cases: Tonelli-Shanks algorithm - return tonelliShanks(P); -} -// Little-endian check for first LE bit (last BE bit); -export const isNegativeLE = (num, modulo) => (mod(num, modulo) & _1n) === _1n; -// prettier-ignore -const FIELD_FIELDS = [ - 'create', 'isValid', 'is0', 'neg', 'inv', 'sqrt', 'sqr', - 'eql', 'add', 'sub', 'mul', 'pow', 'div', - 'addN', 'subN', 'mulN', 'sqrN' -]; -export function validateField(field) { - const initial = { - ORDER: 'bigint', - MASK: 'bigint', - BYTES: 'isSafeInteger', - BITS: 'isSafeInteger', - }; - const opts = FIELD_FIELDS.reduce((map, val) => { - map[val] = 'function'; - return map; - }, initial); - return validateObject(field, opts); -} -// Generic field functions -/** - * Same as `pow` but for Fp: non-constant-time. - * Unsafe in some contexts: uses ladder, so can expose bigint bits. - */ -export function FpPow(f, num, power) { - // Should have same speed as pow for bigints - // TODO: benchmark! - if (power < _0n) - throw new Error('Expected power > 0'); - if (power === _0n) - return f.ONE; - if (power === _1n) - return num; - let p = f.ONE; - let d = num; - while (power > _0n) { - if (power & _1n) - p = f.mul(p, d); - d = f.sqr(d); - power >>= _1n; - } - return p; -} -/** - * Efficiently invert an array of Field elements. - * `inv(0)` will return `undefined` here: make sure to throw an error. - */ -export function FpInvertBatch(f, nums) { - const tmp = new Array(nums.length); - // Walk from first to last, multiply them by each other MOD p - const lastMultiplied = nums.reduce((acc, num, i) => { - if (f.is0(num)) - return acc; - tmp[i] = acc; - return f.mul(acc, num); - }, f.ONE); - // Invert last element - const inverted = f.inv(lastMultiplied); - // Walk from last to first, multiply them by inverted each other MOD p - nums.reduceRight((acc, num, i) => { - if (f.is0(num)) - return acc; - tmp[i] = f.mul(acc, tmp[i]); - return f.mul(acc, num); - }, inverted); - return tmp; -} -export function FpDiv(f, lhs, rhs) { - return f.mul(lhs, typeof rhs === 'bigint' ? invert(rhs, f.ORDER) : f.inv(rhs)); -} -// This function returns True whenever the value x is a square in the field F. -export function FpIsSquare(f) { - const legendreConst = (f.ORDER - _1n) / _2n; // Integer arithmetic - return (x) => { - const p = f.pow(x, legendreConst); - return f.eql(p, f.ZERO) || f.eql(p, f.ONE); - }; -} -// CURVE.n lengths -export function nLength(n, nBitLength) { - // Bit size, byte size of CURVE.n - const _nBitLength = nBitLength !== undefined ? nBitLength : n.toString(2).length; - const nByteLength = Math.ceil(_nBitLength / 8); - return { nBitLength: _nBitLength, nByteLength }; -} -/** - * Initializes a finite field over prime. **Non-primes are not supported.** - * Do not init in loop: slow. Very fragile: always run a benchmark on a change. - * Major performance optimizations: - * * a) denormalized operations like mulN instead of mul - * * b) same object shape: never add or remove keys - * * c) Object.freeze - * @param ORDER prime positive bigint - * @param bitLen how many bits the field consumes - * @param isLE (def: false) if encoding / decoding should be in little-endian - * @param redef optional faster redefinitions of sqrt and other methods - */ -export function Field(ORDER, bitLen, isLE = false, redef = {}) { - if (ORDER <= _0n) - throw new Error(`Expected Field ORDER > 0, got ${ORDER}`); - const { nBitLength: BITS, nByteLength: BYTES } = nLength(ORDER, bitLen); - if (BYTES > 2048) - throw new Error('Field lengths over 2048 bytes are not supported'); - const sqrtP = FpSqrt(ORDER); - const f = Object.freeze({ - ORDER, - BITS, - BYTES, - MASK: bitMask(BITS), - ZERO: _0n, - ONE: _1n, - create: (num) => mod(num, ORDER), - isValid: (num) => { - if (typeof num !== 'bigint') - throw new Error(`Invalid field element: expected bigint, got ${typeof num}`); - return _0n <= num && num < ORDER; // 0 is valid element, but it's not invertible - }, - is0: (num) => num === _0n, - isOdd: (num) => (num & _1n) === _1n, - neg: (num) => mod(-num, ORDER), - eql: (lhs, rhs) => lhs === rhs, - sqr: (num) => mod(num * num, ORDER), - add: (lhs, rhs) => mod(lhs + rhs, ORDER), - sub: (lhs, rhs) => mod(lhs - rhs, ORDER), - mul: (lhs, rhs) => mod(lhs * rhs, ORDER), - pow: (num, power) => FpPow(f, num, power), - div: (lhs, rhs) => mod(lhs * invert(rhs, ORDER), ORDER), - // Same as above, but doesn't normalize - sqrN: (num) => num * num, - addN: (lhs, rhs) => lhs + rhs, - subN: (lhs, rhs) => lhs - rhs, - mulN: (lhs, rhs) => lhs * rhs, - inv: (num) => invert(num, ORDER), - sqrt: redef.sqrt || ((n) => sqrtP(f, n)), - invertBatch: (lst) => FpInvertBatch(f, lst), - // TODO: do we really need constant cmov? - // We don't have const-time bigints anyway, so probably will be not very useful - cmov: (a, b, c) => (c ? b : a), - toBytes: (num) => (isLE ? numberToBytesLE(num, BYTES) : numberToBytesBE(num, BYTES)), - fromBytes: (bytes) => { - if (bytes.length !== BYTES) - throw new Error(`Fp.fromBytes: expected ${BYTES}, got ${bytes.length}`); - return isLE ? bytesToNumberLE(bytes) : bytesToNumberBE(bytes); - }, - }); - return Object.freeze(f); -} -export function FpSqrtOdd(Fp, elm) { - if (!Fp.isOdd) - throw new Error(`Field doesn't have isOdd`); - const root = Fp.sqrt(elm); - return Fp.isOdd(root) ? root : Fp.neg(root); -} -export function FpSqrtEven(Fp, elm) { - if (!Fp.isOdd) - throw new Error(`Field doesn't have isOdd`); - const root = Fp.sqrt(elm); - return Fp.isOdd(root) ? Fp.neg(root) : root; -} -/** - * "Constant-time" private key generation utility. - * Same as mapKeyToField, but accepts less bytes (40 instead of 48 for 32-byte field). - * Which makes it slightly more biased, less secure. - * @deprecated use mapKeyToField instead - */ -export function hashToPrivateScalar(hash, groupOrder, isLE = false) { - hash = ensureBytes('privateHash', hash); - const hashLen = hash.length; - const minLen = nLength(groupOrder).nByteLength + 8; - if (minLen < 24 || hashLen < minLen || hashLen > 1024) - throw new Error(`hashToPrivateScalar: expected ${minLen}-1024 bytes of input, got ${hashLen}`); - const num = isLE ? bytesToNumberLE(hash) : bytesToNumberBE(hash); - return mod(num, groupOrder - _1n) + _1n; -} -/** - * Returns total number of bytes consumed by the field element. - * For example, 32 bytes for usual 256-bit weierstrass curve. - * @param fieldOrder number of field elements, usually CURVE.n - * @returns byte length of field - */ -export function getFieldBytesLength(fieldOrder) { - if (typeof fieldOrder !== 'bigint') - throw new Error('field order must be bigint'); - const bitLength = fieldOrder.toString(2).length; - return Math.ceil(bitLength / 8); -} -/** - * Returns minimal amount of bytes that can be safely reduced - * by field order. - * Should be 2^-128 for 128-bit curve such as P256. - * @param fieldOrder number of field elements, usually CURVE.n - * @returns byte length of target hash - */ -export function getMinHashLength(fieldOrder) { - const length = getFieldBytesLength(fieldOrder); - return length + Math.ceil(length / 2); -} -/** - * "Constant-time" private key generation utility. - * Can take (n + n/2) or more bytes of uniform input e.g. from CSPRNG or KDF - * and convert them into private scalar, with the modulo bias being negligible. - * Needs at least 48 bytes of input for 32-byte private key. - * https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/ - * FIPS 186-5, A.2 https://csrc.nist.gov/publications/detail/fips/186/5/final - * RFC 9380, https://www.rfc-editor.org/rfc/rfc9380#section-5 - * @param hash hash output from SHA3 or a similar function - * @param groupOrder size of subgroup - (e.g. secp256k1.CURVE.n) - * @param isLE interpret hash bytes as LE num - * @returns valid private scalar - */ -export function mapHashToField(key, fieldOrder, isLE = false) { - const len = key.length; - const fieldLen = getFieldBytesLength(fieldOrder); - const minLen = getMinHashLength(fieldOrder); - // No small numbers: need to understand bias story. No huge numbers: easier to detect JS timings. - if (len < 16 || len < minLen || len > 1024) - throw new Error(`expected ${minLen}-1024 bytes of input, got ${len}`); - const num = isLE ? bytesToNumberBE(key) : bytesToNumberLE(key); - // `mod(x, 11)` can sometimes produce 0. `mod(x, 10) + 1` is the same, but no 0 - const reduced = mod(num, fieldOrder - _1n) + _1n; - return isLE ? numberToBytesLE(reduced, fieldLen) : numberToBytesBE(reduced, fieldLen); -} -//# sourceMappingURL=modular.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/modular.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/modular.js.map deleted file mode 100644 index 0da524f4..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/modular.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"modular.js","sourceRoot":"","sources":["../../src/abstract/modular.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,sDAAsD;AACtD,OAAO,EACL,OAAO,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C;AACxC,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,cAAc,CAAC,GAAe,EAAE,UAAkB,EAAE,IAAI,GAAG,KAAK;IAC9E,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC;IACvB,MAAM,QAAQ,GAAG,mBAAmB,CAAC,UAAU,CAAC,CAAC;IACjD,MAAM,MAAM,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC;IAC5C,iGAAiG;IACjG,IAAI,GAAG,GAAG,EAAE,IAAI,GAAG,GAAG,MAAM,IAAI,GAAG,GAAG,IAAI;QACxC,MAAM,IAAI,KAAK,CAAC,YAAY,MAAM,6BAA6B,GAAG,EAAE,CAAC,CAAC;IACxE,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;IAC/D,+EAA+E;IAC/E,MAAM,OAAO,GAAG,GAAG,CAAC,GAAG,EAAE,UAAU,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;IACjD,OAAO,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AACxF,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/montgomery.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/montgomery.js deleted file mode 100644 index 19a8b6eb..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/montgomery.js +++ /dev/null @@ -1,157 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { mod, pow } from './modular.js'; -import { bytesToNumberLE, ensureBytes, numberToBytesLE, validateObject } from './utils.js'; -const _0n = BigInt(0); -const _1n = BigInt(1); -function validateOpts(curve) { - validateObject(curve, { - a: 'bigint', - }, { - montgomeryBits: 'isSafeInteger', - nByteLength: 'isSafeInteger', - adjustScalarBytes: 'function', - domain: 'function', - powPminus2: 'function', - Gu: 'bigint', - }); - // Set defaults - return Object.freeze({ ...curve }); -} -// NOTE: not really montgomery curve, just bunch of very specific methods for X25519/X448 (RFC 7748, https://www.rfc-editor.org/rfc/rfc7748) -// Uses only one coordinate instead of two -export function montgomery(curveDef) { - const CURVE = validateOpts(curveDef); - const { P } = CURVE; - const modP = (n) => mod(n, P); - const montgomeryBits = CURVE.montgomeryBits; - const montgomeryBytes = Math.ceil(montgomeryBits / 8); - const fieldLen = CURVE.nByteLength; - const adjustScalarBytes = CURVE.adjustScalarBytes || ((bytes) => bytes); - const powPminus2 = CURVE.powPminus2 || ((x) => pow(x, P - BigInt(2), P)); - // cswap from RFC7748. But it is not from RFC7748! - /* - cswap(swap, x_2, x_3): - dummy = mask(swap) AND (x_2 XOR x_3) - x_2 = x_2 XOR dummy - x_3 = x_3 XOR dummy - Return (x_2, x_3) - Where mask(swap) is the all-1 or all-0 word of the same length as x_2 - and x_3, computed, e.g., as mask(swap) = 0 - swap. - */ - function cswap(swap, x_2, x_3) { - const dummy = modP(swap * (x_2 - x_3)); - x_2 = modP(x_2 - dummy); - x_3 = modP(x_3 + dummy); - return [x_2, x_3]; - } - // Accepts 0 as well - function assertFieldElement(n) { - if (typeof n === 'bigint' && _0n <= n && n < P) - return n; - throw new Error('Expected valid scalar 0 < scalar < CURVE.P'); - } - // x25519 from 4 - // The constant a24 is (486662 - 2) / 4 = 121665 for curve25519/X25519 - const a24 = (CURVE.a - BigInt(2)) / BigInt(4); - /** - * - * @param pointU u coordinate (x) on Montgomery Curve 25519 - * @param scalar by which the point would be multiplied - * @returns new Point on Montgomery curve - */ - function montgomeryLadder(pointU, scalar) { - const u = assertFieldElement(pointU); - // Section 5: Implementations MUST accept non-canonical values and process them as - // if they had been reduced modulo the field prime. - const k = assertFieldElement(scalar); - const x_1 = u; - let x_2 = _1n; - let z_2 = _0n; - let x_3 = u; - let z_3 = _1n; - let swap = _0n; - let sw; - for (let t = BigInt(montgomeryBits - 1); t >= _0n; t--) { - const k_t = (k >> t) & _1n; - swap ^= k_t; - sw = cswap(swap, x_2, x_3); - x_2 = sw[0]; - x_3 = sw[1]; - sw = cswap(swap, z_2, z_3); - z_2 = sw[0]; - z_3 = sw[1]; - swap = k_t; - const A = x_2 + z_2; - const AA = modP(A * A); - const B = x_2 - z_2; - const BB = modP(B * B); - const E = AA - BB; - const C = x_3 + z_3; - const D = x_3 - z_3; - const DA = modP(D * A); - const CB = modP(C * B); - const dacb = DA + CB; - const da_cb = DA - CB; - x_3 = modP(dacb * dacb); - z_3 = modP(x_1 * modP(da_cb * da_cb)); - x_2 = modP(AA * BB); - z_2 = modP(E * (AA + modP(a24 * E))); - } - // (x_2, x_3) = cswap(swap, x_2, x_3) - sw = cswap(swap, x_2, x_3); - x_2 = sw[0]; - x_3 = sw[1]; - // (z_2, z_3) = cswap(swap, z_2, z_3) - sw = cswap(swap, z_2, z_3); - z_2 = sw[0]; - z_3 = sw[1]; - // z_2^(p - 2) - const z2 = powPminus2(z_2); - // Return x_2 * (z_2^(p - 2)) - return modP(x_2 * z2); - } - function encodeUCoordinate(u) { - return numberToBytesLE(modP(u), montgomeryBytes); - } - function decodeUCoordinate(uEnc) { - // Section 5: When receiving such an array, implementations of X25519 - // MUST mask the most significant bit in the final byte. - // This is very ugly way, but it works because fieldLen-1 is outside of bounds for X448, so this becomes NOOP - // fieldLen - scalaryBytes = 1 for X448 and = 0 for X25519 - const u = ensureBytes('u coordinate', uEnc, montgomeryBytes); - // u[fieldLen-1] crashes QuickJS (TypeError: out-of-bound numeric index) - if (fieldLen === montgomeryBytes) - u[fieldLen - 1] &= 127; // 0b0111_1111 - return bytesToNumberLE(u); - } - function decodeScalar(n) { - const bytes = ensureBytes('scalar', n); - if (bytes.length !== montgomeryBytes && bytes.length !== fieldLen) - throw new Error(`Expected ${montgomeryBytes} or ${fieldLen} bytes, got ${bytes.length}`); - return bytesToNumberLE(adjustScalarBytes(bytes)); - } - function scalarMult(scalar, u) { - const pointU = decodeUCoordinate(u); - const _scalar = decodeScalar(scalar); - const pu = montgomeryLadder(pointU, _scalar); - // The result was not contributory - // https://cr.yp.to/ecdh.html#validate - if (pu === _0n) - throw new Error('Invalid private or public key received'); - return encodeUCoordinate(pu); - } - // Computes public key from private. By doing scalar multiplication of base point. - const GuBytes = encodeUCoordinate(CURVE.Gu); - function scalarMultBase(scalar) { - return scalarMult(scalar, GuBytes); - } - return { - scalarMult, - scalarMultBase, - getSharedSecret: (privateKey, publicKey) => scalarMult(privateKey, publicKey), - getPublicKey: (privateKey) => scalarMultBase(privateKey), - utils: { randomPrivateKey: () => CURVE.randomBytes(CURVE.nByteLength) }, - GuBytes: GuBytes, - }; -} -//# sourceMappingURL=montgomery.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/montgomery.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/montgomery.js.map deleted file mode 100644 index 6bc1a061..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/montgomery.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"montgomery.js","sourceRoot":"","sources":["../../src/abstract/montgomery.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE3F,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAwBtB,SAAS,YAAY,CAAC,KAAgB;IACpC,cAAc,CACZ,KAAK,EACL;QACE,CAAC,EAAE,QAAQ;KACZ,EACD;QACE,cAAc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eAAe,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;IACnD,CAAC;IACD,SAAS,UAAU,CAAC,MAAW,EAAE,CAAM;QACrC,MAAM,MAAM,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC;QACpC,MAAM,OAAO,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;QACrC,MAAM,EAAE,GAAG,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC7C,kCAAkC;QAClC,sCAAsC;QACtC,IAAI,EAAE,KAAK,GAAG;YAAE,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;QAC1E,OAAO,iBAAiB,CAAC,EAAE,CAAC,CAAC;IAC/B,CAAC;IACD,kFAAkF;IAClF,MAAM,OAAO,GAAG,iBAAiB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC5C,SAAS,cAAc,CAAC,MAAW;QACjC,OAAO,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,CAAC;IAED,OAAO;QACL,UAAU;QACV,cAAc;QACd,eAAe,EAAE,CAAC,UAAe,EAAE,SAAc,EAAE,EAAE,CAAC,UAAU,CAAC,UAAU,EAAE,SAAS,CAAC;QACvF,YAAY,EAAE,CAAC,UAAe,EAAc,EAAE,CAAC,cAAc,CAAC,UAAU,CAAC;QACzE,KAAK,EAAE,EAAE,gBAAgB,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,WAAY,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE;QACxE,OAAO,EAAE,OAAO;KACjB,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/poseidon.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/poseidon.js deleted file mode 100644 index 79f69f51..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/poseidon.js +++ /dev/null @@ -1,108 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -// Poseidon Hash: https://eprint.iacr.org/2019/458.pdf, https://www.poseidon-hash.info -import { FpPow, validateField } from './modular.js'; -export function validateOpts(opts) { - const { Fp, mds, reversePartialPowIdx: rev, roundConstants: rc } = opts; - const { roundsFull, roundsPartial, sboxPower, t } = opts; - validateField(Fp); - for (const i of ['t', 'roundsFull', 'roundsPartial']) { - if (typeof opts[i] !== 'number' || !Number.isSafeInteger(opts[i])) - throw new Error(`Poseidon: invalid param ${i}=${opts[i]} (${typeof opts[i]})`); - } - // MDS is TxT matrix - if (!Array.isArray(mds) || mds.length !== t) - throw new Error('Poseidon: wrong MDS matrix'); - const _mds = mds.map((mdsRow) => { - if (!Array.isArray(mdsRow) || mdsRow.length !== t) - throw new Error(`Poseidon MDS matrix row: ${mdsRow}`); - return mdsRow.map((i) => { - if (typeof i !== 'bigint') - throw new Error(`Poseidon MDS matrix value=${i}`); - return Fp.create(i); - }); - }); - if (rev !== undefined && typeof rev !== 'boolean') - throw new Error(`Poseidon: invalid param reversePartialPowIdx=${rev}`); - if (roundsFull % 2 !== 0) - throw new Error(`Poseidon roundsFull is not even: ${roundsFull}`); - const rounds = roundsFull + roundsPartial; - if (!Array.isArray(rc) || rc.length !== rounds) - throw new Error('Poseidon: wrong round constants'); - const roundConstants = rc.map((rc) => { - if (!Array.isArray(rc) || rc.length !== t) - throw new Error(`Poseidon wrong round constants: ${rc}`); - return rc.map((i) => { - if (typeof i !== 'bigint' || !Fp.isValid(i)) - throw new Error(`Poseidon wrong round constant=${i}`); - return Fp.create(i); - }); - }); - if (!sboxPower || ![3, 5, 7].includes(sboxPower)) - throw new Error(`Poseidon wrong sboxPower=${sboxPower}`); - const _sboxPower = BigInt(sboxPower); - let sboxFn = (n) => FpPow(Fp, n, _sboxPower); - // Unwrapped sbox power for common cases (195->142μs) - if (sboxPower === 3) - sboxFn = (n) => Fp.mul(Fp.sqrN(n), n); - else if (sboxPower === 5) - sboxFn = (n) => Fp.mul(Fp.sqrN(Fp.sqrN(n)), n); - return Object.freeze({ ...opts, rounds, sboxFn, roundConstants, mds: _mds }); -} -export function splitConstants(rc, t) { - if (typeof t !== 'number') - throw new Error('poseidonSplitConstants: wrong t'); - if (!Array.isArray(rc) || rc.length % t) - throw new Error('poseidonSplitConstants: wrong rc'); - const res = []; - let tmp = []; - for (let i = 0; i < rc.length; i++) { - tmp.push(rc[i]); - if (tmp.length === t) { - res.push(tmp); - tmp = []; - } - } - return res; -} -export function poseidon(opts) { - const _opts = validateOpts(opts); - const { Fp, mds, roundConstants, rounds, roundsPartial, sboxFn, t } = _opts; - const halfRoundsFull = _opts.roundsFull / 2; - const partialIdx = _opts.reversePartialPowIdx ? t - 1 : 0; - const poseidonRound = (values, isFull, idx) => { - values = values.map((i, j) => Fp.add(i, roundConstants[idx][j])); - if (isFull) - values = values.map((i) => sboxFn(i)); - else - values[partialIdx] = sboxFn(values[partialIdx]); - // Matrix multiplication - values = mds.map((i) => i.reduce((acc, i, j) => Fp.add(acc, Fp.mulN(i, values[j])), Fp.ZERO)); - return values; - }; - const poseidonHash = function poseidonHash(values) { - if (!Array.isArray(values) || values.length !== t) - throw new Error(`Poseidon: wrong values (expected array of bigints with length ${t})`); - values = values.map((i) => { - if (typeof i !== 'bigint') - throw new Error(`Poseidon: wrong value=${i} (${typeof i})`); - return Fp.create(i); - }); - let round = 0; - // Apply r_f/2 full rounds. - for (let i = 0; i < halfRoundsFull; i++) - values = poseidonRound(values, true, round++); - // Apply r_p partial rounds. - for (let i = 0; i < roundsPartial; i++) - values = poseidonRound(values, false, round++); - // Apply r_f/2 full rounds. - for (let i = 0; i < halfRoundsFull; i++) - values = poseidonRound(values, true, round++); - if (round !== rounds) - throw new Error(`Poseidon: wrong number of rounds: last round=${round}, total=${rounds}`); - return values; - }; - // For verification in tests - poseidonHash.roundConstants = roundConstants; - return poseidonHash; -} -//# sourceMappingURL=poseidon.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/poseidon.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/poseidon.js.map deleted file mode 100644 index 28338290..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/poseidon.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"poseidon.js","sourceRoot":"","sources":["../../src/abstract/poseidon.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,sFAAsF;AACtF,OAAO,EAAU,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAc5D,MAAM,UAAU,YAAY,CAAC,IAAkB;IAC7C,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,oBAAoB,EAAE,GAAG,EAAE,cAAc,EAAE,EAAE,EAAE,GAAG,IAAI,CAAC;IACxE,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC;IAEzD,aAAa,CAAC,EAAE,CAAC,CAAC;IAClB,KAAK,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,YAAY,EAAE,eAAe,CAAU,EAAE;QAC7D,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAC/D,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,OAAO,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;KAClF;IAED,oBAAoB;IACpB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;IAC3F,MAAM,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QAC9B,IAAI,CAAC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K,EAAE,CAAC,CAAC;QACvF,2BAA2B;QAC3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,cAAc,EAAE,CAAC,EAAE;YAAE,MAAM,GAAG,aAAa,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QAEvF,IAAI,KAAK,KAAK,MAAM;YAClB,MAAM,IAAI,KAAK,CAAC,gDAAgD,KAAK,WAAW,MAAM,EAAE,CAAC,CAAC;QAC5F,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;IACF,4BAA4B;IAC5B,YAAY,CAAC,cAAc,GAAG,cAAc,CAAC;IAC7C,OAAO,YAAY,CAAC;AACtB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/utils.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/utils.js deleted file mode 100644 index f4204055..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/utils.js +++ /dev/null @@ -1,266 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -// 100 lines of code in the file are duplicated from noble-hashes (utils). -// This is OK: `abstract` directory does not use noble-hashes. -// User may opt-in into using different hashing library. This way, noble-hashes -// won't be included into their bundle. -const _0n = BigInt(0); -const _1n = BigInt(1); -const _2n = BigInt(2); -const u8a = (a) => a instanceof Uint8Array; -const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0')); -/** - * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123' - */ -export function bytesToHex(bytes) { - if (!u8a(bytes)) - throw new Error('Uint8Array expected'); - // pre-caching improves the speed 6x - let hex = ''; - for (let i = 0; i < bytes.length; i++) { - hex += hexes[bytes[i]]; - } - return hex; -} -export function numberToHexUnpadded(num) { - const hex = num.toString(16); - return hex.length & 1 ? `0${hex}` : hex; -} -export function hexToNumber(hex) { - if (typeof hex !== 'string') - throw new Error('hex string expected, got ' + typeof hex); - // Big Endian - return BigInt(hex === '' ? '0' : `0x${hex}`); -} -/** - * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23]) - */ -export function hexToBytes(hex) { - if (typeof hex !== 'string') - throw new Error('hex string expected, got ' + typeof hex); - const len = hex.length; - if (len % 2) - throw new Error('padded hex string expected, got unpadded hex of length ' + len); - const array = new Uint8Array(len / 2); - for (let i = 0; i < array.length; i++) { - const j = i * 2; - const hexByte = hex.slice(j, j + 2); - const byte = Number.parseInt(hexByte, 16); - if (Number.isNaN(byte) || byte < 0) - throw new Error('Invalid byte sequence'); - array[i] = byte; - } - return array; -} -// BE: Big Endian, LE: Little Endian -export function bytesToNumberBE(bytes) { - return hexToNumber(bytesToHex(bytes)); -} -export function bytesToNumberLE(bytes) { - if (!u8a(bytes)) - throw new Error('Uint8Array expected'); - return hexToNumber(bytesToHex(Uint8Array.from(bytes).reverse())); -} -export function numberToBytesBE(n, len) { - return hexToBytes(n.toString(16).padStart(len * 2, '0')); -} -export function numberToBytesLE(n, len) { - return numberToBytesBE(n, len).reverse(); -} -// Unpadded, rarely used -export function numberToVarBytesBE(n) { - return hexToBytes(numberToHexUnpadded(n)); -} -/** - * Takes hex string or Uint8Array, converts to Uint8Array. - * Validates output length. - * Will throw error for other types. - * @param title descriptive title for an error e.g. 'private key' - * @param hex hex string or Uint8Array - * @param expectedLength optional, will compare to result array's length - * @returns - */ -export function ensureBytes(title, hex, expectedLength) { - let res; - if (typeof hex === 'string') { - try { - res = hexToBytes(hex); - } - catch (e) { - throw new Error(`${title} must be valid hex string, got "${hex}". Cause: ${e}`); - } - } - else if (u8a(hex)) { - // Uint8Array.from() instead of hash.slice() because node.js Buffer - // is instance of Uint8Array, and its slice() creates **mutable** copy - res = Uint8Array.from(hex); - } - else { - throw new Error(`${title} must be hex string or Uint8Array`); - } - const len = res.length; - if (typeof expectedLength === 'number' && len !== expectedLength) - throw new Error(`${title} expected ${expectedLength} bytes, got ${len}`); - return res; -} -/** - * Copies several Uint8Arrays into one. - */ -export function concatBytes(...arrays) { - const r = new Uint8Array(arrays.reduce((sum, a) => sum + a.length, 0)); - let pad = 0; // walk through each item, ensure they have proper type - arrays.forEach((a) => { - if (!u8a(a)) - throw new Error('Uint8Array expected'); - r.set(a, pad); - pad += a.length; - }); - return r; -} -export function equalBytes(b1, b2) { - // We don't care about timing attacks here - if (b1.length !== b2.length) - return false; - for (let i = 0; i < b1.length; i++) - if (b1[i] !== b2[i]) - return false; - return true; -} -/** - * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99]) - */ -export function utf8ToBytes(str) { - if (typeof str !== 'string') - throw new Error(`utf8ToBytes expected string, got ${typeof str}`); - return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809 -} -// Bit operations -/** - * Calculates amount of bits in a bigint. - * Same as `n.toString(2).length` - */ -export function bitLen(n) { - let len; - for (len = 0; n > _0n; n >>= _1n, len += 1) - ; - return len; -} -/** - * Gets single bit at position. - * NOTE: first bit position is 0 (same as arrays) - * Same as `!!+Array.from(n.toString(2)).reverse()[pos]` - */ -export function bitGet(n, pos) { - return (n >> BigInt(pos)) & _1n; -} -/** - * Sets single bit at position. - */ -export const bitSet = (n, pos, value) => { - return n | ((value ? _1n : _0n) << BigInt(pos)); -}; -/** - * Calculate mask for N bits. Not using ** operator with bigints because of old engines. - * Same as BigInt(`0b${Array(i).fill('1').join('')}`) - */ -export const bitMask = (n) => (_2n << BigInt(n - 1)) - _1n; -// DRBG -const u8n = (data) => new Uint8Array(data); // creates Uint8Array -const u8fr = (arr) => Uint8Array.from(arr); // another shortcut -/** - * Minimal HMAC-DRBG from NIST 800-90 for RFC6979 sigs. - * @returns function that will call DRBG until 2nd arg returns something meaningful - * @example - * const drbg = createHmacDRBG(32, 32, hmac); - * drbg(seed, bytesToKey); // bytesToKey must return Key or undefined - */ -export function createHmacDrbg(hashLen, qByteLen, hmacFn) { - if (typeof hashLen !== 'number' || hashLen < 2) - throw new Error('hashLen must be a number'); - if (typeof qByteLen !== 'number' || qByteLen < 2) - throw new Error('qByteLen must be a number'); - if (typeof hmacFn !== 'function') - throw new Error('hmacFn must be a function'); - // Step B, Step C: set hashLen to 8*ceil(hlen/8) - let v = u8n(hashLen); // Minimal non-full-spec HMAC-DRBG from NIST 800-90 for RFC6979 sigs. - let k = u8n(hashLen); // Steps B and C of RFC6979 3.2: set hashLen, in our case always same - let i = 0; // Iterations counter, will throw when over 1000 - const reset = () => { - v.fill(1); - k.fill(0); - i = 0; - }; - const h = (...b) => hmacFn(k, v, ...b); // hmac(k)(v, ...values) - const reseed = (seed = u8n()) => { - // HMAC-DRBG reseed() function. Steps D-G - k = h(u8fr([0x00]), seed); // k = hmac(k || v || 0x00 || seed) - v = h(); // v = hmac(k || v) - if (seed.length === 0) - return; - k = h(u8fr([0x01]), seed); // k = hmac(k || v || 0x01 || seed) - v = h(); // v = hmac(k || v) - }; - const gen = () => { - // HMAC-DRBG generate() function - if (i++ >= 1000) - throw new Error('drbg: tried 1000 values'); - let len = 0; - const out = []; - while (len < qByteLen) { - v = h(); - const sl = v.slice(); - out.push(sl); - len += v.length; - } - return concatBytes(...out); - }; - const genUntil = (seed, pred) => { - reset(); - reseed(seed); // Steps D-G - let res = undefined; // Step H: grind until k is in [1..n-1] - while (!(res = pred(gen()))) - reseed(); - reset(); - return res; - }; - return genUntil; -} -// Validating curves and fields -const validatorFns = { - bigint: (val) => typeof val === 'bigint', - function: (val) => typeof val === 'function', - boolean: (val) => typeof val === 'boolean', - string: (val) => typeof val === 'string', - stringOrUint8Array: (val) => typeof val === 'string' || val instanceof Uint8Array, - isSafeInteger: (val) => Number.isSafeInteger(val), - array: (val) => Array.isArray(val), - field: (val, object) => object.Fp.isValid(val), - hash: (val) => typeof val === 'function' && Number.isSafeInteger(val.outputLen), -}; -// type Record = { [P in K]: T; } -export function validateObject(object, validators, optValidators = {}) { - const checkField = (fieldName, type, isOptional) => { - const checkVal = validatorFns[type]; - if (typeof checkVal !== 'function') - throw new Error(`Invalid validator "${type}", expected function`); - const val = object[fieldName]; - if (isOptional && val === undefined) - return; - if (!checkVal(val, object)) { - throw new Error(`Invalid param ${String(fieldName)}=${val} (${typeof val}), expected ${type}`); - } - }; - for (const [fieldName, type] of Object.entries(validators)) - checkField(fieldName, type, false); - for (const [fieldName, type] of Object.entries(optValidators)) - checkField(fieldName, type, true); - return object; -} -// validate type tests -// const o: { a: number; b: number; c: number } = { a: 1, b: 5, c: 6 }; -// const z0 = validateObject(o, { a: 'isSafeInteger' }, { c: 'bigint' }); // Ok! -// // Should fail type-check -// const z1 = validateObject(o, { a: 'tmp' }, { c: 'zz' }); -// const z2 = validateObject(o, { a: 'isSafeInteger' }, { c: 'zz' }); -// const z3 = validateObject(o, { test: 'boolean', z: 'bug' }); -// const z4 = validateObject(o, { a: 'boolean', z: 'bug' }); -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/utils.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/utils.js.map deleted file mode 100644 index f86d0570..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/abstract/utils.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,0EAA0E;AAC1E,8DAA8D;AAC9D,+EAA+E;AAC/E,uCAAuC;AACvC,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,CAAC,CAAM,EAAmB,EAAE,CAAC,CAAC,YAAY,UAAU,CAAC;AAWjE,MAAM,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a,CAAC;QAAE,UAAU,CAAC,SAAS,EAAE,IAAK,EAAE,IAAI,CAAC,CAAC;IAClG,OAAO,MAAM,CAAC;AAChB,CAAC;AACD,sBAAsB;AACtB,uEAAuE;AACvE,gFAAgF;AAChF,4BAA4B;AAC5B,2DAA2D;AAC3D,qEAAqE;AACrE,+DAA+D;AAC/D,4DAA4D"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/weierstrass.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/weierstrass.js deleted file mode 100644 index 5a665875..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/weierstrass.js +++ /dev/null @@ -1,1056 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -// Short Weierstrass curve. The formula is: y² = x³ + ax + b -import * as mod from './modular.js'; -import * as ut from './utils.js'; -import { ensureBytes } from './utils.js'; -import { wNAF, validateBasic } from './curve.js'; -function validatePointOpts(curve) { - const opts = validateBasic(curve); - ut.validateObject(opts, { - a: 'field', - b: 'field', - }, { - allowedPrivateKeyLengths: 'array', - wrapPrivateKey: 'boolean', - isTorsionFree: 'function', - clearCofactor: 'function', - allowInfinityPoint: 'boolean', - fromBytes: 'function', - toBytes: 'function', - }); - const { endo, Fp, a } = opts; - if (endo) { - if (!Fp.eql(a, Fp.ZERO)) { - throw new Error('Endomorphism can only be defined for Koblitz curves that have a=0'); - } - if (typeof endo !== 'object' || - typeof endo.beta !== 'bigint' || - typeof endo.splitScalar !== 'function') { - throw new Error('Expected endomorphism with beta: bigint and splitScalar: function'); - } - } - return Object.freeze({ ...opts }); -} -// ASN.1 DER encoding utilities -const { bytesToNumberBE: b2n, hexToBytes: h2b } = ut; -export const DER = { - // asn.1 DER encoding utils - Err: class DERErr extends Error { - constructor(m = '') { - super(m); - } - }, - _parseInt(data) { - const { Err: E } = DER; - if (data.length < 2 || data[0] !== 0x02) - throw new E('Invalid signature integer tag'); - const len = data[1]; - const res = data.subarray(2, len + 2); - if (!len || res.length !== len) - throw new E('Invalid signature integer: wrong length'); - // https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag, - // since we always use positive integers here. It must always be empty: - // - add zero byte if exists - // - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding) - if (res[0] & 0b10000000) - throw new E('Invalid signature integer: negative'); - if (res[0] === 0x00 && !(res[1] & 0b10000000)) - throw new E('Invalid signature integer: unnecessary leading zero'); - return { d: b2n(res), l: data.subarray(len + 2) }; // d is data, l is left - }, - toSig(hex) { - // parse DER signature - const { Err: E } = DER; - const data = typeof hex === 'string' ? h2b(hex) : hex; - if (!(data instanceof Uint8Array)) - throw new Error('ui8a expected'); - let l = data.length; - if (l < 2 || data[0] != 0x30) - throw new E('Invalid signature tag'); - if (data[1] !== l - 2) - throw new E('Invalid signature: incorrect length'); - const { d: r, l: sBytes } = DER._parseInt(data.subarray(2)); - const { d: s, l: rBytesLeft } = DER._parseInt(sBytes); - if (rBytesLeft.length) - throw new E('Invalid signature: left bytes after parsing'); - return { r, s }; - }, - hexFromSig(sig) { - // Add leading zero if first byte has negative bit enabled. More details in '_parseInt' - const slice = (s) => (Number.parseInt(s[0], 16) & 0b1000 ? '00' + s : s); - const h = (num) => { - const hex = num.toString(16); - return hex.length & 1 ? `0${hex}` : hex; - }; - const s = slice(h(sig.s)); - const r = slice(h(sig.r)); - const shl = s.length / 2; - const rhl = r.length / 2; - const sl = h(shl); - const rl = h(rhl); - return `30${h(rhl + shl + 4)}02${rl}${r}02${sl}${s}`; - }, -}; -// Be friendly to bad ECMAScript parsers by not using bigint literals -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = BigInt(4); -export function weierstrassPoints(opts) { - const CURVE = validatePointOpts(opts); - const { Fp } = CURVE; // All curves has same field / group length as for now, but they can differ - const toBytes = CURVE.toBytes || - ((_c, point, _isCompressed) => { - const a = point.toAffine(); - return ut.concatBytes(Uint8Array.from([0x04]), Fp.toBytes(a.x), Fp.toBytes(a.y)); - }); - const fromBytes = CURVE.fromBytes || - ((bytes) => { - // const head = bytes[0]; - const tail = bytes.subarray(1); - // if (head !== 0x04) throw new Error('Only non-compressed encoding is supported'); - const x = Fp.fromBytes(tail.subarray(0, Fp.BYTES)); - const y = Fp.fromBytes(tail.subarray(Fp.BYTES, 2 * Fp.BYTES)); - return { x, y }; - }); - /** - * y² = x³ + ax + b: Short weierstrass curve formula - * @returns y² - */ - function weierstrassEquation(x) { - const { a, b } = CURVE; - const x2 = Fp.sqr(x); // x * x - const x3 = Fp.mul(x2, x); // x2 * x - return Fp.add(Fp.add(x3, Fp.mul(x, a)), b); // x3 + a * x + b - } - // Validate whether the passed curve params are valid. - // We check if curve equation works for generator point. - // `assertValidity()` won't work: `isTorsionFree()` is not available at this point in bls12-381. - // ProjectivePoint class has not been initialized yet. - if (!Fp.eql(Fp.sqr(CURVE.Gy), weierstrassEquation(CURVE.Gx))) - throw new Error('bad generator point: equation left != right'); - // Valid group elements reside in range 1..n-1 - function isWithinCurveOrder(num) { - return typeof num === 'bigint' && _0n < num && num < CURVE.n; - } - function assertGE(num) { - if (!isWithinCurveOrder(num)) - throw new Error('Expected valid bigint: 0 < bigint < curve.n'); - } - // Validates if priv key is valid and converts it to bigint. - // Supports options allowedPrivateKeyLengths and wrapPrivateKey. - function normPrivateKeyToScalar(key) { - const { allowedPrivateKeyLengths: lengths, nByteLength, wrapPrivateKey, n } = CURVE; - if (lengths && typeof key !== 'bigint') { - if (key instanceof Uint8Array) - key = ut.bytesToHex(key); - // Normalize to hex string, pad. E.g. P521 would norm 130-132 char hex to 132-char bytes - if (typeof key !== 'string' || !lengths.includes(key.length)) - throw new Error('Invalid key'); - key = key.padStart(nByteLength * 2, '0'); - } - let num; - try { - num = - typeof key === 'bigint' - ? key - : ut.bytesToNumberBE(ensureBytes('private key', key, nByteLength)); - } - catch (error) { - throw new Error(`private key must be ${nByteLength} bytes, hex or bigint, not ${typeof key}`); - } - if (wrapPrivateKey) - num = mod.mod(num, n); // disabled by default, enabled for BLS - assertGE(num); // num in range [1..N-1] - return num; - } - const pointPrecomputes = new Map(); - function assertPrjPoint(other) { - if (!(other instanceof Point)) - throw new Error('ProjectivePoint expected'); - } - /** - * Projective Point works in 3d / projective (homogeneous) coordinates: (x, y, z) ∋ (x=x/z, y=y/z) - * Default Point works in 2d / affine coordinates: (x, y) - * We're doing calculations in projective, because its operations don't require costly inversion. - */ - class Point { - constructor(px, py, pz) { - this.px = px; - this.py = py; - this.pz = pz; - if (px == null || !Fp.isValid(px)) - throw new Error('x required'); - if (py == null || !Fp.isValid(py)) - throw new Error('y required'); - if (pz == null || !Fp.isValid(pz)) - throw new Error('z required'); - } - // Does not validate if the point is on-curve. - // Use fromHex instead, or call assertValidity() later. - static fromAffine(p) { - const { x, y } = p || {}; - if (!p || !Fp.isValid(x) || !Fp.isValid(y)) - throw new Error('invalid affine point'); - if (p instanceof Point) - throw new Error('projective point not allowed'); - const is0 = (i) => Fp.eql(i, Fp.ZERO); - // fromAffine(x:0, y:0) would produce (x:0, y:0, z:1), but we need (x:0, y:1, z:0) - if (is0(x) && is0(y)) - return Point.ZERO; - return new Point(x, y, Fp.ONE); - } - get x() { - return this.toAffine().x; - } - get y() { - return this.toAffine().y; - } - /** - * Takes a bunch of Projective Points but executes only one - * inversion on all of them. Inversion is very slow operation, - * so this improves performance massively. - * Optimization: converts a list of projective points to a list of identical points with Z=1. - */ - static normalizeZ(points) { - const toInv = Fp.invertBatch(points.map((p) => p.pz)); - return points.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine); - } - /** - * Converts hash string or Uint8Array to Point. - * @param hex short/long ECDSA hex - */ - static fromHex(hex) { - const P = Point.fromAffine(fromBytes(ensureBytes('pointHex', hex))); - P.assertValidity(); - return P; - } - // Multiplies generator point by privateKey. - static fromPrivateKey(privateKey) { - return Point.BASE.multiply(normPrivateKeyToScalar(privateKey)); - } - // "Private method", don't use it directly - _setWindowSize(windowSize) { - this._WINDOW_SIZE = windowSize; - pointPrecomputes.delete(this); - } - // A point on curve is valid if it conforms to equation. - assertValidity() { - if (this.is0()) { - // (0, 1, 0) aka ZERO is invalid in most contexts. - // In BLS, ZERO can be serialized, so we allow it. - // (0, 0, 0) is wrong representation of ZERO and is always invalid. - if (CURVE.allowInfinityPoint && !Fp.is0(this.py)) - return; - throw new Error('bad point: ZERO'); - } - // Some 3rd-party test vectors require different wording between here & `fromCompressedHex` - const { x, y } = this.toAffine(); - // Check if x, y are valid field elements - if (!Fp.isValid(x) || !Fp.isValid(y)) - throw new Error('bad point: x or y not FE'); - const left = Fp.sqr(y); // y² - const right = weierstrassEquation(x); // x³ + ax + b - if (!Fp.eql(left, right)) - throw new Error('bad point: equation left != right'); - if (!this.isTorsionFree()) - throw new Error('bad point: not in prime-order subgroup'); - } - hasEvenY() { - const { y } = this.toAffine(); - if (Fp.isOdd) - return !Fp.isOdd(y); - throw new Error("Field doesn't support isOdd"); - } - /** - * Compare one point to another. - */ - equals(other) { - assertPrjPoint(other); - const { px: X1, py: Y1, pz: Z1 } = this; - const { px: X2, py: Y2, pz: Z2 } = other; - const U1 = Fp.eql(Fp.mul(X1, Z2), Fp.mul(X2, Z1)); - const U2 = Fp.eql(Fp.mul(Y1, Z2), Fp.mul(Y2, Z1)); - return U1 && U2; - } - /** - * Flips point to one corresponding to (x, -y) in Affine coordinates. - */ - negate() { - return new Point(this.px, Fp.neg(this.py), this.pz); - } - // Renes-Costello-Batina exception-free doubling formula. - // There is 30% faster Jacobian formula, but it is not complete. - // https://eprint.iacr.org/2015/1060, algorithm 3 - // Cost: 8M + 3S + 3*a + 2*b3 + 15add. - double() { - const { a, b } = CURVE; - const b3 = Fp.mul(b, _3n); - const { px: X1, py: Y1, pz: Z1 } = this; - let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore - let t0 = Fp.mul(X1, X1); // step 1 - let t1 = Fp.mul(Y1, Y1); - let t2 = Fp.mul(Z1, Z1); - let t3 = Fp.mul(X1, Y1); - t3 = Fp.add(t3, t3); // step 5 - Z3 = Fp.mul(X1, Z1); - Z3 = Fp.add(Z3, Z3); - X3 = Fp.mul(a, Z3); - Y3 = Fp.mul(b3, t2); - Y3 = Fp.add(X3, Y3); // step 10 - X3 = Fp.sub(t1, Y3); - Y3 = Fp.add(t1, Y3); - Y3 = Fp.mul(X3, Y3); - X3 = Fp.mul(t3, X3); - Z3 = Fp.mul(b3, Z3); // step 15 - t2 = Fp.mul(a, t2); - t3 = Fp.sub(t0, t2); - t3 = Fp.mul(a, t3); - t3 = Fp.add(t3, Z3); - Z3 = Fp.add(t0, t0); // step 20 - t0 = Fp.add(Z3, t0); - t0 = Fp.add(t0, t2); - t0 = Fp.mul(t0, t3); - Y3 = Fp.add(Y3, t0); - t2 = Fp.mul(Y1, Z1); // step 25 - t2 = Fp.add(t2, t2); - t0 = Fp.mul(t2, t3); - X3 = Fp.sub(X3, t0); - Z3 = Fp.mul(t2, t1); - Z3 = Fp.add(Z3, Z3); // step 30 - Z3 = Fp.add(Z3, Z3); - return new Point(X3, Y3, Z3); - } - // Renes-Costello-Batina exception-free addition formula. - // There is 30% faster Jacobian formula, but it is not complete. - // https://eprint.iacr.org/2015/1060, algorithm 1 - // Cost: 12M + 0S + 3*a + 3*b3 + 23add. - add(other) { - assertPrjPoint(other); - const { px: X1, py: Y1, pz: Z1 } = this; - const { px: X2, py: Y2, pz: Z2 } = other; - let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore - const a = CURVE.a; - const b3 = Fp.mul(CURVE.b, _3n); - let t0 = Fp.mul(X1, X2); // step 1 - let t1 = Fp.mul(Y1, Y2); - let t2 = Fp.mul(Z1, Z2); - let t3 = Fp.add(X1, Y1); - let t4 = Fp.add(X2, Y2); // step 5 - t3 = Fp.mul(t3, t4); - t4 = Fp.add(t0, t1); - t3 = Fp.sub(t3, t4); - t4 = Fp.add(X1, Z1); - let t5 = Fp.add(X2, Z2); // step 10 - t4 = Fp.mul(t4, t5); - t5 = Fp.add(t0, t2); - t4 = Fp.sub(t4, t5); - t5 = Fp.add(Y1, Z1); - X3 = Fp.add(Y2, Z2); // step 15 - t5 = Fp.mul(t5, X3); - X3 = Fp.add(t1, t2); - t5 = Fp.sub(t5, X3); - Z3 = Fp.mul(a, t4); - X3 = Fp.mul(b3, t2); // step 20 - Z3 = Fp.add(X3, Z3); - X3 = Fp.sub(t1, Z3); - Z3 = Fp.add(t1, Z3); - Y3 = Fp.mul(X3, Z3); - t1 = Fp.add(t0, t0); // step 25 - t1 = Fp.add(t1, t0); - t2 = Fp.mul(a, t2); - t4 = Fp.mul(b3, t4); - t1 = Fp.add(t1, t2); - t2 = Fp.sub(t0, t2); // step 30 - t2 = Fp.mul(a, t2); - t4 = Fp.add(t4, t2); - t0 = Fp.mul(t1, t4); - Y3 = Fp.add(Y3, t0); - t0 = Fp.mul(t5, t4); // step 35 - X3 = Fp.mul(t3, X3); - X3 = Fp.sub(X3, t0); - t0 = Fp.mul(t3, t1); - Z3 = Fp.mul(t5, Z3); - Z3 = Fp.add(Z3, t0); // step 40 - return new Point(X3, Y3, Z3); - } - subtract(other) { - return this.add(other.negate()); - } - is0() { - return this.equals(Point.ZERO); - } - wNAF(n) { - return wnaf.wNAFCached(this, pointPrecomputes, n, (comp) => { - const toInv = Fp.invertBatch(comp.map((p) => p.pz)); - return comp.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine); - }); - } - /** - * Non-constant-time multiplication. Uses double-and-add algorithm. - * It's faster, but should only be used when you don't care about - * an exposed private key e.g. sig verification, which works over *public* keys. - */ - multiplyUnsafe(n) { - const I = Point.ZERO; - if (n === _0n) - return I; - assertGE(n); // Will throw on 0 - if (n === _1n) - return this; - const { endo } = CURVE; - if (!endo) - return wnaf.unsafeLadder(this, n); - // Apply endomorphism - let { k1neg, k1, k2neg, k2 } = endo.splitScalar(n); - let k1p = I; - let k2p = I; - let d = this; - while (k1 > _0n || k2 > _0n) { - if (k1 & _1n) - k1p = k1p.add(d); - if (k2 & _1n) - k2p = k2p.add(d); - d = d.double(); - k1 >>= _1n; - k2 >>= _1n; - } - if (k1neg) - k1p = k1p.negate(); - if (k2neg) - k2p = k2p.negate(); - k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz); - return k1p.add(k2p); - } - /** - * Constant time multiplication. - * Uses wNAF method. Windowed method may be 10% faster, - * but takes 2x longer to generate and consumes 2x memory. - * Uses precomputes when available. - * Uses endomorphism for Koblitz curves. - * @param scalar by which the point would be multiplied - * @returns New point - */ - multiply(scalar) { - assertGE(scalar); - let n = scalar; - let point, fake; // Fake point is used to const-time mult - const { endo } = CURVE; - if (endo) { - const { k1neg, k1, k2neg, k2 } = endo.splitScalar(n); - let { p: k1p, f: f1p } = this.wNAF(k1); - let { p: k2p, f: f2p } = this.wNAF(k2); - k1p = wnaf.constTimeNegate(k1neg, k1p); - k2p = wnaf.constTimeNegate(k2neg, k2p); - k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz); - point = k1p.add(k2p); - fake = f1p.add(f2p); - } - else { - const { p, f } = this.wNAF(n); - point = p; - fake = f; - } - // Normalize `z` for both points, but return only real one - return Point.normalizeZ([point, fake])[0]; - } - /** - * Efficiently calculate `aP + bQ`. Unsafe, can expose private key, if used incorrectly. - * Not using Strauss-Shamir trick: precomputation tables are faster. - * The trick could be useful if both P and Q are not G (not in our case). - * @returns non-zero affine point - */ - multiplyAndAddUnsafe(Q, a, b) { - const G = Point.BASE; // No Strauss-Shamir trick: we have 10% faster G precomputes - const mul = (P, a // Select faster multiply() method - ) => (a === _0n || a === _1n || !P.equals(G) ? P.multiplyUnsafe(a) : P.multiply(a)); - const sum = mul(this, a).add(mul(Q, b)); - return sum.is0() ? undefined : sum; - } - // Converts Projective point to affine (x, y) coordinates. - // Can accept precomputed Z^-1 - for example, from invertBatch. - // (x, y, z) ∋ (x=x/z, y=y/z) - toAffine(iz) { - const { px: x, py: y, pz: z } = this; - const is0 = this.is0(); - // If invZ was 0, we return zero point. However we still want to execute - // all operations, so we replace invZ with a random number, 1. - if (iz == null) - iz = is0 ? Fp.ONE : Fp.inv(z); - const ax = Fp.mul(x, iz); - const ay = Fp.mul(y, iz); - const zz = Fp.mul(z, iz); - if (is0) - return { x: Fp.ZERO, y: Fp.ZERO }; - if (!Fp.eql(zz, Fp.ONE)) - throw new Error('invZ was invalid'); - return { x: ax, y: ay }; - } - isTorsionFree() { - const { h: cofactor, isTorsionFree } = CURVE; - if (cofactor === _1n) - return true; // No subgroups, always torsion-free - if (isTorsionFree) - return isTorsionFree(Point, this); - throw new Error('isTorsionFree() has not been declared for the elliptic curve'); - } - clearCofactor() { - const { h: cofactor, clearCofactor } = CURVE; - if (cofactor === _1n) - return this; // Fast-path - if (clearCofactor) - return clearCofactor(Point, this); - return this.multiplyUnsafe(CURVE.h); - } - toRawBytes(isCompressed = true) { - this.assertValidity(); - return toBytes(Point, this, isCompressed); - } - toHex(isCompressed = true) { - return ut.bytesToHex(this.toRawBytes(isCompressed)); - } - } - Point.BASE = new Point(CURVE.Gx, CURVE.Gy, Fp.ONE); - Point.ZERO = new Point(Fp.ZERO, Fp.ONE, Fp.ZERO); - const _bits = CURVE.nBitLength; - const wnaf = wNAF(Point, CURVE.endo ? Math.ceil(_bits / 2) : _bits); - // Validate if generator point is on curve - return { - CURVE, - ProjectivePoint: Point, - normPrivateKeyToScalar, - weierstrassEquation, - isWithinCurveOrder, - }; -} -function validateOpts(curve) { - const opts = validateBasic(curve); - ut.validateObject(opts, { - hash: 'hash', - hmac: 'function', - randomBytes: 'function', - }, { - bits2int: 'function', - bits2int_modN: 'function', - lowS: 'boolean', - }); - return Object.freeze({ lowS: true, ...opts }); -} -export function weierstrass(curveDef) { - const CURVE = validateOpts(curveDef); - const { Fp, n: CURVE_ORDER } = CURVE; - const compressedLen = Fp.BYTES + 1; // e.g. 33 for 32 - const uncompressedLen = 2 * Fp.BYTES + 1; // e.g. 65 for 32 - function isValidFieldElement(num) { - return _0n < num && num < Fp.ORDER; // 0 is banned since it's not invertible FE - } - function modN(a) { - return mod.mod(a, CURVE_ORDER); - } - function invN(a) { - return mod.invert(a, CURVE_ORDER); - } - const { ProjectivePoint: Point, normPrivateKeyToScalar, weierstrassEquation, isWithinCurveOrder, } = weierstrassPoints({ - ...CURVE, - toBytes(_c, point, isCompressed) { - const a = point.toAffine(); - const x = Fp.toBytes(a.x); - const cat = ut.concatBytes; - if (isCompressed) { - return cat(Uint8Array.from([point.hasEvenY() ? 0x02 : 0x03]), x); - } - else { - return cat(Uint8Array.from([0x04]), x, Fp.toBytes(a.y)); - } - }, - fromBytes(bytes) { - const len = bytes.length; - const head = bytes[0]; - const tail = bytes.subarray(1); - // this.assertValidity() is done inside of fromHex - if (len === compressedLen && (head === 0x02 || head === 0x03)) { - const x = ut.bytesToNumberBE(tail); - if (!isValidFieldElement(x)) - throw new Error('Point is not on curve'); - const y2 = weierstrassEquation(x); // y² = x³ + ax + b - let y = Fp.sqrt(y2); // y = y² ^ (p+1)/4 - const isYOdd = (y & _1n) === _1n; - // ECDSA - const isHeadOdd = (head & 1) === 1; - if (isHeadOdd !== isYOdd) - y = Fp.neg(y); - return { x, y }; - } - else if (len === uncompressedLen && head === 0x04) { - const x = Fp.fromBytes(tail.subarray(0, Fp.BYTES)); - const y = Fp.fromBytes(tail.subarray(Fp.BYTES, 2 * Fp.BYTES)); - return { x, y }; - } - else { - throw new Error(`Point of length ${len} was invalid. Expected ${compressedLen} compressed bytes or ${uncompressedLen} uncompressed bytes`); - } - }, - }); - const numToNByteStr = (num) => ut.bytesToHex(ut.numberToBytesBE(num, CURVE.nByteLength)); - function isBiggerThanHalfOrder(number) { - const HALF = CURVE_ORDER >> _1n; - return number > HALF; - } - function normalizeS(s) { - return isBiggerThanHalfOrder(s) ? modN(-s) : s; - } - // slice bytes num - const slcNum = (b, from, to) => ut.bytesToNumberBE(b.slice(from, to)); - /** - * ECDSA signature with its (r, s) properties. Supports DER & compact representations. - */ - class Signature { - constructor(r, s, recovery) { - this.r = r; - this.s = s; - this.recovery = recovery; - this.assertValidity(); - } - // pair (bytes of r, bytes of s) - static fromCompact(hex) { - const l = CURVE.nByteLength; - hex = ensureBytes('compactSignature', hex, l * 2); - return new Signature(slcNum(hex, 0, l), slcNum(hex, l, 2 * l)); - } - // DER encoded ECDSA signature - // https://bitcoin.stackexchange.com/questions/57644/what-are-the-parts-of-a-bitcoin-transaction-input-script - static fromDER(hex) { - const { r, s } = DER.toSig(ensureBytes('DER', hex)); - return new Signature(r, s); - } - assertValidity() { - // can use assertGE here - if (!isWithinCurveOrder(this.r)) - throw new Error('r must be 0 < r < CURVE.n'); - if (!isWithinCurveOrder(this.s)) - throw new Error('s must be 0 < s < CURVE.n'); - } - addRecoveryBit(recovery) { - return new Signature(this.r, this.s, recovery); - } - recoverPublicKey(msgHash) { - const { r, s, recovery: rec } = this; - const h = bits2int_modN(ensureBytes('msgHash', msgHash)); // Truncate hash - if (rec == null || ![0, 1, 2, 3].includes(rec)) - throw new Error('recovery id invalid'); - const radj = rec === 2 || rec === 3 ? r + CURVE.n : r; - if (radj >= Fp.ORDER) - throw new Error('recovery id 2 or 3 invalid'); - const prefix = (rec & 1) === 0 ? '02' : '03'; - const R = Point.fromHex(prefix + numToNByteStr(radj)); - const ir = invN(radj); // r^-1 - const u1 = modN(-h * ir); // -hr^-1 - const u2 = modN(s * ir); // sr^-1 - const Q = Point.BASE.multiplyAndAddUnsafe(R, u1, u2); // (sr^-1)R-(hr^-1)G = -(hr^-1)G + (sr^-1) - if (!Q) - throw new Error('point at infinify'); // unsafe is fine: no priv data leaked - Q.assertValidity(); - return Q; - } - // Signatures should be low-s, to prevent malleability. - hasHighS() { - return isBiggerThanHalfOrder(this.s); - } - normalizeS() { - return this.hasHighS() ? new Signature(this.r, modN(-this.s), this.recovery) : this; - } - // DER-encoded - toDERRawBytes() { - return ut.hexToBytes(this.toDERHex()); - } - toDERHex() { - return DER.hexFromSig({ r: this.r, s: this.s }); - } - // padded bytes of r, then padded bytes of s - toCompactRawBytes() { - return ut.hexToBytes(this.toCompactHex()); - } - toCompactHex() { - return numToNByteStr(this.r) + numToNByteStr(this.s); - } - } - const utils = { - isValidPrivateKey(privateKey) { - try { - normPrivateKeyToScalar(privateKey); - return true; - } - catch (error) { - return false; - } - }, - normPrivateKeyToScalar: normPrivateKeyToScalar, - /** - * Produces cryptographically secure private key from random of size - * (groupLen + ceil(groupLen / 2)) with modulo bias being negligible. - */ - randomPrivateKey: () => { - const length = mod.getMinHashLength(CURVE.n); - return mod.mapHashToField(CURVE.randomBytes(length), CURVE.n); - }, - /** - * Creates precompute table for an arbitrary EC point. Makes point "cached". - * Allows to massively speed-up `point.multiply(scalar)`. - * @returns cached point - * @example - * const fast = utils.precompute(8, ProjectivePoint.fromHex(someonesPubKey)); - * fast.multiply(privKey); // much faster ECDH now - */ - precompute(windowSize = 8, point = Point.BASE) { - point._setWindowSize(windowSize); - point.multiply(BigInt(3)); // 3 is arbitrary, just need any number here - return point; - }, - }; - /** - * Computes public key for a private key. Checks for validity of the private key. - * @param privateKey private key - * @param isCompressed whether to return compact (default), or full key - * @returns Public key, full when isCompressed=false; short when isCompressed=true - */ - function getPublicKey(privateKey, isCompressed = true) { - return Point.fromPrivateKey(privateKey).toRawBytes(isCompressed); - } - /** - * Quick and dirty check for item being public key. Does not validate hex, or being on-curve. - */ - function isProbPub(item) { - const arr = item instanceof Uint8Array; - const str = typeof item === 'string'; - const len = (arr || str) && item.length; - if (arr) - return len === compressedLen || len === uncompressedLen; - if (str) - return len === 2 * compressedLen || len === 2 * uncompressedLen; - if (item instanceof Point) - return true; - return false; - } - /** - * ECDH (Elliptic Curve Diffie Hellman). - * Computes shared public key from private key and public key. - * Checks: 1) private key validity 2) shared key is on-curve. - * Does NOT hash the result. - * @param privateA private key - * @param publicB different public key - * @param isCompressed whether to return compact (default), or full key - * @returns shared public key - */ - function getSharedSecret(privateA, publicB, isCompressed = true) { - if (isProbPub(privateA)) - throw new Error('first arg must be private key'); - if (!isProbPub(publicB)) - throw new Error('second arg must be public key'); - const b = Point.fromHex(publicB); // check for being on-curve - return b.multiply(normPrivateKeyToScalar(privateA)).toRawBytes(isCompressed); - } - // RFC6979: ensure ECDSA msg is X bytes and < N. RFC suggests optional truncating via bits2octets. - // FIPS 186-4 4.6 suggests the leftmost min(nBitLen, outLen) bits, which matches bits2int. - // bits2int can produce res>N, we can do mod(res, N) since the bitLen is the same. - // int2octets can't be used; pads small msgs with 0: unacceptatble for trunc as per RFC vectors - const bits2int = CURVE.bits2int || - function (bytes) { - // For curves with nBitLength % 8 !== 0: bits2octets(bits2octets(m)) !== bits2octets(m) - // for some cases, since bytes.length * 8 is not actual bitLength. - const num = ut.bytesToNumberBE(bytes); // check for == u8 done here - const delta = bytes.length * 8 - CURVE.nBitLength; // truncate to nBitLength leftmost bits - return delta > 0 ? num >> BigInt(delta) : num; - }; - const bits2int_modN = CURVE.bits2int_modN || - function (bytes) { - return modN(bits2int(bytes)); // can't use bytesToNumberBE here - }; - // NOTE: pads output with zero as per spec - const ORDER_MASK = ut.bitMask(CURVE.nBitLength); - /** - * Converts to bytes. Checks if num in `[0..ORDER_MASK-1]` e.g.: `[0..2^256-1]`. - */ - function int2octets(num) { - if (typeof num !== 'bigint') - throw new Error('bigint expected'); - if (!(_0n <= num && num < ORDER_MASK)) - throw new Error(`bigint expected < 2^${CURVE.nBitLength}`); - // works with order, can have different size than numToField! - return ut.numberToBytesBE(num, CURVE.nByteLength); - } - // Steps A, D of RFC6979 3.2 - // Creates RFC6979 seed; converts msg/privKey to numbers. - // Used only in sign, not in verify. - // NOTE: we cannot assume here that msgHash has same amount of bytes as curve order, this will be wrong at least for P521. - // Also it can be bigger for P224 + SHA256 - function prepSig(msgHash, privateKey, opts = defaultSigOpts) { - if (['recovered', 'canonical'].some((k) => k in opts)) - throw new Error('sign() legacy options not supported'); - const { hash, randomBytes } = CURVE; - let { lowS, prehash, extraEntropy: ent } = opts; // generates low-s sigs by default - if (lowS == null) - lowS = true; // RFC6979 3.2: we skip step A, because we already provide hash - msgHash = ensureBytes('msgHash', msgHash); - if (prehash) - msgHash = ensureBytes('prehashed msgHash', hash(msgHash)); - // We can't later call bits2octets, since nested bits2int is broken for curves - // with nBitLength % 8 !== 0. Because of that, we unwrap it here as int2octets call. - // const bits2octets = (bits) => int2octets(bits2int_modN(bits)) - const h1int = bits2int_modN(msgHash); - const d = normPrivateKeyToScalar(privateKey); // validate private key, convert to bigint - const seedArgs = [int2octets(d), int2octets(h1int)]; - // extraEntropy. RFC6979 3.6: additional k' (optional). - if (ent != null) { - // K = HMAC_K(V || 0x00 || int2octets(x) || bits2octets(h1) || k') - const e = ent === true ? randomBytes(Fp.BYTES) : ent; // generate random bytes OR pass as-is - seedArgs.push(ensureBytes('extraEntropy', e)); // check for being bytes - } - const seed = ut.concatBytes(...seedArgs); // Step D of RFC6979 3.2 - const m = h1int; // NOTE: no need to call bits2int second time here, it is inside truncateHash! - // Converts signature params into point w r/s, checks result for validity. - function k2sig(kBytes) { - // RFC 6979 Section 3.2, step 3: k = bits2int(T) - const k = bits2int(kBytes); // Cannot use fields methods, since it is group element - if (!isWithinCurveOrder(k)) - return; // Important: all mod() calls here must be done over N - const ik = invN(k); // k^-1 mod n - const q = Point.BASE.multiply(k).toAffine(); // q = Gk - const r = modN(q.x); // r = q.x mod n - if (r === _0n) - return; - // Can use scalar blinding b^-1(bm + bdr) where b ∈ [1,q−1] according to - // https://tches.iacr.org/index.php/TCHES/article/view/7337/6509. We've decided against it: - // a) dependency on CSPRNG b) 15% slowdown c) doesn't really help since bigints are not CT - const s = modN(ik * modN(m + r * d)); // Not using blinding here - if (s === _0n) - return; - let recovery = (q.x === r ? 0 : 2) | Number(q.y & _1n); // recovery bit (2 or 3, when q.x > n) - let normS = s; - if (lowS && isBiggerThanHalfOrder(s)) { - normS = normalizeS(s); // if lowS was passed, ensure s is always - recovery ^= 1; // // in the bottom half of N - } - return new Signature(r, normS, recovery); // use normS, not s - } - return { seed, k2sig }; - } - const defaultSigOpts = { lowS: CURVE.lowS, prehash: false }; - const defaultVerOpts = { lowS: CURVE.lowS, prehash: false }; - /** - * Signs message hash with a private key. - * ``` - * sign(m, d, k) where - * (x, y) = G × k - * r = x mod n - * s = (m + dr)/k mod n - * ``` - * @param msgHash NOT message. msg needs to be hashed to `msgHash`, or use `prehash`. - * @param privKey private key - * @param opts lowS for non-malleable sigs. extraEntropy for mixing randomness into k. prehash will hash first arg. - * @returns signature with recovery param - */ - function sign(msgHash, privKey, opts = defaultSigOpts) { - const { seed, k2sig } = prepSig(msgHash, privKey, opts); // Steps A, D of RFC6979 3.2. - const C = CURVE; - const drbg = ut.createHmacDrbg(C.hash.outputLen, C.nByteLength, C.hmac); - return drbg(seed, k2sig); // Steps B, C, D, E, F, G - } - // Enable precomputes. Slows down first publicKey computation by 20ms. - Point.BASE._setWindowSize(8); - // utils.precompute(8, ProjectivePoint.BASE) - /** - * Verifies a signature against message hash and public key. - * Rejects lowS signatures by default: to override, - * specify option `{lowS: false}`. Implements section 4.1.4 from https://www.secg.org/sec1-v2.pdf: - * - * ``` - * verify(r, s, h, P) where - * U1 = hs^-1 mod n - * U2 = rs^-1 mod n - * R = U1⋅G - U2⋅P - * mod(R.x, n) == r - * ``` - */ - function verify(signature, msgHash, publicKey, opts = defaultVerOpts) { - const sg = signature; - msgHash = ensureBytes('msgHash', msgHash); - publicKey = ensureBytes('publicKey', publicKey); - if ('strict' in opts) - throw new Error('options.strict was renamed to lowS'); - const { lowS, prehash } = opts; - let _sig = undefined; - let P; - try { - if (typeof sg === 'string' || sg instanceof Uint8Array) { - // Signature can be represented in 2 ways: compact (2*nByteLength) & DER (variable-length). - // Since DER can also be 2*nByteLength bytes, we check for it first. - try { - _sig = Signature.fromDER(sg); - } - catch (derError) { - if (!(derError instanceof DER.Err)) - throw derError; - _sig = Signature.fromCompact(sg); - } - } - else if (typeof sg === 'object' && typeof sg.r === 'bigint' && typeof sg.s === 'bigint') { - const { r, s } = sg; - _sig = new Signature(r, s); - } - else { - throw new Error('PARSE'); - } - P = Point.fromHex(publicKey); - } - catch (error) { - if (error.message === 'PARSE') - throw new Error(`signature must be Signature instance, Uint8Array or hex string`); - return false; - } - if (lowS && _sig.hasHighS()) - return false; - if (prehash) - msgHash = CURVE.hash(msgHash); - const { r, s } = _sig; - const h = bits2int_modN(msgHash); // Cannot use fields methods, since it is group element - const is = invN(s); // s^-1 - const u1 = modN(h * is); // u1 = hs^-1 mod n - const u2 = modN(r * is); // u2 = rs^-1 mod n - const R = Point.BASE.multiplyAndAddUnsafe(P, u1, u2)?.toAffine(); // R = u1⋅G + u2⋅P - if (!R) - return false; - const v = modN(R.x); - return v === r; - } - return { - CURVE, - getPublicKey, - getSharedSecret, - sign, - verify, - ProjectivePoint: Point, - Signature, - utils, - }; -} -/** - * Implementation of the Shallue and van de Woestijne method for any weierstrass curve. - * TODO: check if there is a way to merge this with uvRatio in Edwards; move to modular. - * b = True and y = sqrt(u / v) if (u / v) is square in F, and - * b = False and y = sqrt(Z * (u / v)) otherwise. - * @param Fp - * @param Z - * @returns - */ -export function SWUFpSqrtRatio(Fp, Z) { - // Generic implementation - const q = Fp.ORDER; - let l = _0n; - for (let o = q - _1n; o % _2n === _0n; o /= _2n) - l += _1n; - const c1 = l; // 1. c1, the largest integer such that 2^c1 divides q - 1. - // We need 2n ** c1 and 2n ** (c1-1). We can't use **; but we can use <<. - // 2n ** c1 == 2n << (c1-1) - const _2n_pow_c1_1 = _2n << (c1 - _1n - _1n); - const _2n_pow_c1 = _2n_pow_c1_1 * _2n; - const c2 = (q - _1n) / _2n_pow_c1; // 2. c2 = (q - 1) / (2^c1) # Integer arithmetic - const c3 = (c2 - _1n) / _2n; // 3. c3 = (c2 - 1) / 2 # Integer arithmetic - const c4 = _2n_pow_c1 - _1n; // 4. c4 = 2^c1 - 1 # Integer arithmetic - const c5 = _2n_pow_c1_1; // 5. c5 = 2^(c1 - 1) # Integer arithmetic - const c6 = Fp.pow(Z, c2); // 6. c6 = Z^c2 - const c7 = Fp.pow(Z, (c2 + _1n) / _2n); // 7. c7 = Z^((c2 + 1) / 2) - let sqrtRatio = (u, v) => { - let tv1 = c6; // 1. tv1 = c6 - let tv2 = Fp.pow(v, c4); // 2. tv2 = v^c4 - let tv3 = Fp.sqr(tv2); // 3. tv3 = tv2^2 - tv3 = Fp.mul(tv3, v); // 4. tv3 = tv3 * v - let tv5 = Fp.mul(u, tv3); // 5. tv5 = u * tv3 - tv5 = Fp.pow(tv5, c3); // 6. tv5 = tv5^c3 - tv5 = Fp.mul(tv5, tv2); // 7. tv5 = tv5 * tv2 - tv2 = Fp.mul(tv5, v); // 8. tv2 = tv5 * v - tv3 = Fp.mul(tv5, u); // 9. tv3 = tv5 * u - let tv4 = Fp.mul(tv3, tv2); // 10. tv4 = tv3 * tv2 - tv5 = Fp.pow(tv4, c5); // 11. tv5 = tv4^c5 - let isQR = Fp.eql(tv5, Fp.ONE); // 12. isQR = tv5 == 1 - tv2 = Fp.mul(tv3, c7); // 13. tv2 = tv3 * c7 - tv5 = Fp.mul(tv4, tv1); // 14. tv5 = tv4 * tv1 - tv3 = Fp.cmov(tv2, tv3, isQR); // 15. tv3 = CMOV(tv2, tv3, isQR) - tv4 = Fp.cmov(tv5, tv4, isQR); // 16. tv4 = CMOV(tv5, tv4, isQR) - // 17. for i in (c1, c1 - 1, ..., 2): - for (let i = c1; i > _1n; i--) { - let tv5 = i - _2n; // 18. tv5 = i - 2 - tv5 = _2n << (tv5 - _1n); // 19. tv5 = 2^tv5 - let tvv5 = Fp.pow(tv4, tv5); // 20. tv5 = tv4^tv5 - const e1 = Fp.eql(tvv5, Fp.ONE); // 21. e1 = tv5 == 1 - tv2 = Fp.mul(tv3, tv1); // 22. tv2 = tv3 * tv1 - tv1 = Fp.mul(tv1, tv1); // 23. tv1 = tv1 * tv1 - tvv5 = Fp.mul(tv4, tv1); // 24. tv5 = tv4 * tv1 - tv3 = Fp.cmov(tv2, tv3, e1); // 25. tv3 = CMOV(tv2, tv3, e1) - tv4 = Fp.cmov(tvv5, tv4, e1); // 26. tv4 = CMOV(tv5, tv4, e1) - } - return { isValid: isQR, value: tv3 }; - }; - if (Fp.ORDER % _4n === _3n) { - // sqrt_ratio_3mod4(u, v) - const c1 = (Fp.ORDER - _3n) / _4n; // 1. c1 = (q - 3) / 4 # Integer arithmetic - const c2 = Fp.sqrt(Fp.neg(Z)); // 2. c2 = sqrt(-Z) - sqrtRatio = (u, v) => { - let tv1 = Fp.sqr(v); // 1. tv1 = v^2 - const tv2 = Fp.mul(u, v); // 2. tv2 = u * v - tv1 = Fp.mul(tv1, tv2); // 3. tv1 = tv1 * tv2 - let y1 = Fp.pow(tv1, c1); // 4. y1 = tv1^c1 - y1 = Fp.mul(y1, tv2); // 5. y1 = y1 * tv2 - const y2 = Fp.mul(y1, c2); // 6. y2 = y1 * c2 - const tv3 = Fp.mul(Fp.sqr(y1), v); // 7. tv3 = y1^2; 8. tv3 = tv3 * v - const isQR = Fp.eql(tv3, u); // 9. isQR = tv3 == u - let y = Fp.cmov(y2, y1, isQR); // 10. y = CMOV(y2, y1, isQR) - return { isValid: isQR, value: y }; // 11. return (isQR, y) isQR ? y : y*c2 - }; - } - // No curves uses that - // if (Fp.ORDER % _8n === _5n) // sqrt_ratio_5mod8 - return sqrtRatio; -} -/** - * Simplified Shallue-van de Woestijne-Ulas Method - * https://www.rfc-editor.org/rfc/rfc9380#section-6.6.2 - */ -export function mapToCurveSimpleSWU(Fp, opts) { - mod.validateField(Fp); - if (!Fp.isValid(opts.A) || !Fp.isValid(opts.B) || !Fp.isValid(opts.Z)) - throw new Error('mapToCurveSimpleSWU: invalid opts'); - const sqrtRatio = SWUFpSqrtRatio(Fp, opts.Z); - if (!Fp.isOdd) - throw new Error('Fp.isOdd is not implemented!'); - // Input: u, an element of F. - // Output: (x, y), a point on E. - return (u) => { - // prettier-ignore - let tv1, tv2, tv3, tv4, tv5, tv6, x, y; - tv1 = Fp.sqr(u); // 1. tv1 = u^2 - tv1 = Fp.mul(tv1, opts.Z); // 2. tv1 = Z * tv1 - tv2 = Fp.sqr(tv1); // 3. tv2 = tv1^2 - tv2 = Fp.add(tv2, tv1); // 4. tv2 = tv2 + tv1 - tv3 = Fp.add(tv2, Fp.ONE); // 5. tv3 = tv2 + 1 - tv3 = Fp.mul(tv3, opts.B); // 6. tv3 = B * tv3 - tv4 = Fp.cmov(opts.Z, Fp.neg(tv2), !Fp.eql(tv2, Fp.ZERO)); // 7. tv4 = CMOV(Z, -tv2, tv2 != 0) - tv4 = Fp.mul(tv4, opts.A); // 8. tv4 = A * tv4 - tv2 = Fp.sqr(tv3); // 9. tv2 = tv3^2 - tv6 = Fp.sqr(tv4); // 10. tv6 = tv4^2 - tv5 = Fp.mul(tv6, opts.A); // 11. tv5 = A * tv6 - tv2 = Fp.add(tv2, tv5); // 12. tv2 = tv2 + tv5 - tv2 = Fp.mul(tv2, tv3); // 13. tv2 = tv2 * tv3 - tv6 = Fp.mul(tv6, tv4); // 14. tv6 = tv6 * tv4 - tv5 = Fp.mul(tv6, opts.B); // 15. tv5 = B * tv6 - tv2 = Fp.add(tv2, tv5); // 16. tv2 = tv2 + tv5 - x = Fp.mul(tv1, tv3); // 17. x = tv1 * tv3 - const { isValid, value } = sqrtRatio(tv2, tv6); // 18. (is_gx1_square, y1) = sqrt_ratio(tv2, tv6) - y = Fp.mul(tv1, u); // 19. y = tv1 * u -> Z * u^3 * y1 - y = Fp.mul(y, value); // 20. y = y * y1 - x = Fp.cmov(x, tv3, isValid); // 21. x = CMOV(x, tv3, is_gx1_square) - y = Fp.cmov(y, value, isValid); // 22. y = CMOV(y, y1, is_gx1_square) - const e1 = Fp.isOdd(u) === Fp.isOdd(y); // 23. e1 = sgn0(u) == sgn0(y) - y = Fp.cmov(Fp.neg(y), y, e1); // 24. y = CMOV(-y, y, e1) - x = Fp.div(x, tv4); // 25. x = x / tv4 - return { x, y }; - }; -} -//# sourceMappingURL=weierstrass.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/weierstrass.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/weierstrass.js.map deleted file mode 100644 index 457ede45..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/abstract/weierstrass.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"weierstrass.js","sourceRoot":"","sources":["../../src/abstract/weierstrass.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,4DAA4D;AAC5D,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAuB,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EAA2B,IAAI,EAAc,aAAa,EAAe,MAAM,YAAY,CAAC;AAqFnG,SAAS,iBAAiB,CAAI,KAAyB;IACrD,MAAM,IAAI,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IAClC,EAAE,CAAC,cAAc,CACf,IAAI,EACJ;QACE,CAAC,EAAE,OAAO;QACV,CAAC,EAAE,OAAO;KACX,EACD;QACE,wBAAwB,EAAE,OAAO;QACjC,cAAc,EAAE,SAAS;QACzB,aAAa,EAAE,UAAU;QACzB,aAAa,EAAE,UAAU;QACzB,kBAAkB,EAAE,SAAS;QAC7B,SAAS,EAAE,UAAU;QACrB,OAAO,EAAE,UAAU;KACpB,CACF,CAAC;IACF,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC;IAC7B,IAAI,IAAI,EAAE;QACR,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE;YACvB,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAC;SACtF;QACD,IACE,OAAO,IAAI,KAAK,QAA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AAC,mBAAmB;QACzC,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,wCAAwC;QACtE,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,uCAAuC;QACvE,MAAM,EAAE,GAAG,EAAE,CAAC,KAAM,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,KAAM,CAAC,CAAC,CAAC,CAAC,CAAC,+BAA+B;QACzE,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,4BAA4B;QAC3D,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,oBAAoB;QACxC,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;IAClB,CAAC,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/bls12-381.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/bls12-381.js deleted file mode 100644 index 885c8250..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/bls12-381.js +++ /dev/null @@ -1,1172 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -// bls12-381 pairing-friendly Barreto-Lynn-Scott elliptic curve construction allows to: -// - Construct zk-SNARKs at the 128-bit security -// - Use threshold signatures, which allows a user to sign lots of messages with one signature and -// verify them swiftly in a batch, using Boneh-Lynn-Shacham signature scheme. -// -// The library uses G1 for public keys and G2 for signatures. Support for G1 signatures is planned. -// Compatible with Algorand, Chia, Dfinity, Ethereum, FIL, Zcash. Matches specs -// [pairing-curves-11](https://tools.ietf.org/html/draft-irtf-cfrg-pairing-friendly-curves-11), -// [bls-sigs-04](https:/cfrg-hash-to/tools.ietf.org/html/draft-irtf-cfrg-bls-signature-04), -// [hash-to-curve-12](https://tools.ietf.org/html/draft-irtf--curve-12). -// -// ### Summary -// 1. BLS Relies on Bilinear Pairing (expensive) -// 2. Private Keys: 32 bytes -// 3. Public Keys: 48 bytes: 381 bit affine x coordinate, encoded into 48 big-endian bytes. -// 4. Signatures: 96 bytes: two 381 bit integers (affine x coordinate), encoded into two 48 big-endian byte arrays. -// - The signature is a point on the G2 subgroup, which is defined over a finite field -// with elements twice as big as the G1 curve (G2 is over Fp2 rather than Fp. Fp2 is analogous to the complex numbers). -// 5. The 12 stands for the Embedding degree. -// -// ### Formulas -// - `P = pk x G` - public keys -// - `S = pk x H(m)` - signing -// - `e(P, H(m)) == e(G, S)` - verification using pairings -// - `e(G, S) = e(G, SUM(n)(Si)) = MUL(n)(e(G, Si))` - signature aggregation -// Filecoin uses little endian byte arrays for private keys - -// so ensure to reverse byte order if you'll use it with FIL. -import { sha256 } from '@noble/hashes/sha256'; -import { randomBytes } from '@noble/hashes/utils'; -import { bls } from './abstract/bls.js'; -import * as mod from './abstract/modular.js'; -import { concatBytes as concatB, ensureBytes, numberToBytesBE, bytesToNumberBE, bitLen, bitSet, bitGet, bitMask, bytesToHex, } from './abstract/utils.js'; -// Types -import { mapToCurveSimpleSWU, } from './abstract/weierstrass.js'; -import { isogenyMap } from './abstract/hash-to-curve.js'; -// Be friendly to bad ECMAScript parsers by not using bigint literals -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = BigInt(4); -// prettier-ignore -const _8n = BigInt(8), _16n = BigInt(16); -// CURVE FIELDS -// Finite field over p. -const Fp_raw = BigInt('0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab'); -const Fp = mod.Field(Fp_raw); -// Finite field over r. -// This particular field is not used anywhere in bls12-381, but it is still useful. -const Fr = mod.Field(BigInt('0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001')); -const Fp2Add = ({ c0, c1 }, { c0: r0, c1: r1 }) => ({ - c0: Fp.add(c0, r0), - c1: Fp.add(c1, r1), -}); -const Fp2Subtract = ({ c0, c1 }, { c0: r0, c1: r1 }) => ({ - c0: Fp.sub(c0, r0), - c1: Fp.sub(c1, r1), -}); -const Fp2Multiply = ({ c0, c1 }, rhs) => { - if (typeof rhs === 'bigint') - return { c0: Fp.mul(c0, rhs), c1: Fp.mul(c1, rhs) }; - // (a+bi)(c+di) = (ac−bd) + (ad+bc)i - const { c0: r0, c1: r1 } = rhs; - let t1 = Fp.mul(c0, r0); // c0 * o0 - let t2 = Fp.mul(c1, r1); // c1 * o1 - // (T1 - T2) + ((c0 + c1) * (r0 + r1) - (T1 + T2))*i - const o0 = Fp.sub(t1, t2); - const o1 = Fp.sub(Fp.mul(Fp.add(c0, c1), Fp.add(r0, r1)), Fp.add(t1, t2)); - return { c0: o0, c1: o1 }; -}; -const Fp2Square = ({ c0, c1 }) => { - const a = Fp.add(c0, c1); - const b = Fp.sub(c0, c1); - const c = Fp.add(c0, c0); - return { c0: Fp.mul(a, b), c1: Fp.mul(c, c1) }; -}; -// G2 is the order-q subgroup of E2(Fp²) : y² = x³+4(1+√−1), -// where Fp2 is Fp[√−1]/(x2+1). #E2(Fp2 ) = h2q, where -// G² - 1 -// h2q -// NOTE: ORDER was wrong! -const FP2_ORDER = Fp_raw * Fp_raw; -const Fp2 = { - ORDER: FP2_ORDER, - BITS: bitLen(FP2_ORDER), - BYTES: Math.ceil(bitLen(FP2_ORDER) / 8), - MASK: bitMask(bitLen(FP2_ORDER)), - ZERO: { c0: Fp.ZERO, c1: Fp.ZERO }, - ONE: { c0: Fp.ONE, c1: Fp.ZERO }, - create: (num) => num, - isValid: ({ c0, c1 }) => typeof c0 === 'bigint' && typeof c1 === 'bigint', - is0: ({ c0, c1 }) => Fp.is0(c0) && Fp.is0(c1), - eql: ({ c0, c1 }, { c0: r0, c1: r1 }) => Fp.eql(c0, r0) && Fp.eql(c1, r1), - neg: ({ c0, c1 }) => ({ c0: Fp.neg(c0), c1: Fp.neg(c1) }), - pow: (num, power) => mod.FpPow(Fp2, num, power), - invertBatch: (nums) => mod.FpInvertBatch(Fp2, nums), - // Normalized - add: Fp2Add, - sub: Fp2Subtract, - mul: Fp2Multiply, - sqr: Fp2Square, - // NonNormalized stuff - addN: Fp2Add, - subN: Fp2Subtract, - mulN: Fp2Multiply, - sqrN: Fp2Square, - // Why inversion for bigint inside Fp instead of Fp2? it is even used in that context? - div: (lhs, rhs) => Fp2.mul(lhs, typeof rhs === 'bigint' ? Fp.inv(Fp.create(rhs)) : Fp2.inv(rhs)), - inv: ({ c0: a, c1: b }) => { - // We wish to find the multiplicative inverse of a nonzero - // element a + bu in Fp2. We leverage an identity - // - // (a + bu)(a - bu) = a² + b² - // - // which holds because u² = -1. This can be rewritten as - // - // (a + bu)(a - bu)/(a² + b²) = 1 - // - // because a² + b² = 0 has no nonzero solutions for (a, b). - // This gives that (a - bu)/(a² + b²) is the inverse - // of (a + bu). Importantly, this can be computing using - // only a single inversion in Fp. - const factor = Fp.inv(Fp.create(a * a + b * b)); - return { c0: Fp.mul(factor, Fp.create(a)), c1: Fp.mul(factor, Fp.create(-b)) }; - }, - sqrt: (num) => { - if (Fp2.eql(num, Fp2.ZERO)) - return Fp2.ZERO; // Algo doesn't handles this case - // TODO: Optimize this line. It's extremely slow. - // Speeding this up would boost aggregateSignatures. - // https://eprint.iacr.org/2012/685.pdf applicable? - // https://github.com/zkcrypto/bls12_381/blob/080eaa74ec0e394377caa1ba302c8c121df08b07/src/fp2.rs#L250 - // https://github.com/supranational/blst/blob/aae0c7d70b799ac269ff5edf29d8191dbd357876/src/exp2.c#L1 - // Inspired by https://github.com/dalek-cryptography/curve25519-dalek/blob/17698df9d4c834204f83a3574143abacb4fc81a5/src/field.rs#L99 - const candidateSqrt = Fp2.pow(num, (Fp2.ORDER + _8n) / _16n); - const check = Fp2.div(Fp2.sqr(candidateSqrt), num); // candidateSqrt.square().div(this); - const R = FP2_ROOTS_OF_UNITY; - const divisor = [R[0], R[2], R[4], R[6]].find((r) => Fp2.eql(r, check)); - if (!divisor) - throw new Error('No root'); - const index = R.indexOf(divisor); - const root = R[index / 2]; - if (!root) - throw new Error('Invalid root'); - const x1 = Fp2.div(candidateSqrt, root); - const x2 = Fp2.neg(x1); - const { re: re1, im: im1 } = Fp2.reim(x1); - const { re: re2, im: im2 } = Fp2.reim(x2); - if (im1 > im2 || (im1 === im2 && re1 > re2)) - return x1; - return x2; - }, - // Same as sgn0_m_eq_2 in RFC 9380 - isOdd: (x) => { - const { re: x0, im: x1 } = Fp2.reim(x); - const sign_0 = x0 % _2n; - const zero_0 = x0 === _0n; - const sign_1 = x1 % _2n; - return BigInt(sign_0 || (zero_0 && sign_1)) == _1n; - }, - // Bytes util - fromBytes(b) { - if (b.length !== Fp2.BYTES) - throw new Error(`fromBytes wrong length=${b.length}`); - return { c0: Fp.fromBytes(b.subarray(0, Fp.BYTES)), c1: Fp.fromBytes(b.subarray(Fp.BYTES)) }; - }, - toBytes: ({ c0, c1 }) => concatB(Fp.toBytes(c0), Fp.toBytes(c1)), - cmov: ({ c0, c1 }, { c0: r0, c1: r1 }, c) => ({ - c0: Fp.cmov(c0, r0, c), - c1: Fp.cmov(c1, r1, c), - }), - // Specific utils - // toString() { - // return `Fp2(${this.c0} + ${this.c1}×i)`; - // } - reim: ({ c0, c1 }) => ({ re: c0, im: c1 }), - // multiply by u + 1 - mulByNonresidue: ({ c0, c1 }) => ({ c0: Fp.sub(c0, c1), c1: Fp.add(c0, c1) }), - multiplyByB: ({ c0, c1 }) => { - let t0 = Fp.mul(c0, _4n); // 4 * c0 - let t1 = Fp.mul(c1, _4n); // 4 * c1 - // (T0-T1) + (T0+T1)*i - return { c0: Fp.sub(t0, t1), c1: Fp.add(t0, t1) }; - }, - fromBigTuple: (tuple) => { - if (tuple.length !== 2) - throw new Error('Invalid tuple'); - const fps = tuple.map((n) => Fp.create(n)); - return { c0: fps[0], c1: fps[1] }; - }, - frobeniusMap: ({ c0, c1 }, power) => ({ - c0, - c1: Fp.mul(c1, FP2_FROBENIUS_COEFFICIENTS[power % 2]), - }), -}; -// Finite extension field over irreducible polynominal. -// Fp(u) / (u² - β) where β = -1 -const FP2_FROBENIUS_COEFFICIENTS = [ - BigInt('0x1'), - BigInt('0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaaa'), -].map((item) => Fp.create(item)); -// For Fp2 roots of unity. -const rv1 = BigInt('0x6af0e0437ff400b6831e36d6bd17ffe48395dabc2d3435e77f76e17009241c5ee67992f72ec05f4c81084fbede3cc09'); -// const ev1 = -// BigInt('0x699be3b8c6870965e5bf892ad5d2cc7b0e85a117402dfd83b7f4a947e02d978498255a2aaec0ac627b5afbdf1bf1c90'); -// const ev2 = -// BigInt('0x8157cd83046453f5dd0972b6e3949e4288020b5b8a9cc99ca07e27089a2ce2436d965026adad3ef7baba37f2183e9b5'); -// const ev3 = -// BigInt('0xab1c2ffdd6c253ca155231eb3e71ba044fd562f6f72bc5bad5ec46a0b7a3b0247cf08ce6c6317f40edbc653a72dee17'); -// const ev4 = -// BigInt('0xaa404866706722864480885d68ad0ccac1967c7544b447873cc37e0181271e006df72162a3d3e0287bf597fbf7f8fc1'); -// Eighth roots of unity, used for computing square roots in Fp2. -// To verify or re-calculate: -// Array(8).fill(new Fp2([1n, 1n])).map((fp2, k) => fp2.pow(Fp2.ORDER * BigInt(k) / 8n)) -const FP2_ROOTS_OF_UNITY = [ - [_1n, _0n], - [rv1, -rv1], - [_0n, _1n], - [rv1, rv1], - [-_1n, _0n], - [-rv1, rv1], - [_0n, -_1n], - [-rv1, -rv1], -].map((pair) => Fp2.fromBigTuple(pair)); -const Fp6Add = ({ c0, c1, c2 }, { c0: r0, c1: r1, c2: r2 }) => ({ - c0: Fp2.add(c0, r0), - c1: Fp2.add(c1, r1), - c2: Fp2.add(c2, r2), -}); -const Fp6Subtract = ({ c0, c1, c2 }, { c0: r0, c1: r1, c2: r2 }) => ({ - c0: Fp2.sub(c0, r0), - c1: Fp2.sub(c1, r1), - c2: Fp2.sub(c2, r2), -}); -const Fp6Multiply = ({ c0, c1, c2 }, rhs) => { - if (typeof rhs === 'bigint') { - return { - c0: Fp2.mul(c0, rhs), - c1: Fp2.mul(c1, rhs), - c2: Fp2.mul(c2, rhs), - }; - } - const { c0: r0, c1: r1, c2: r2 } = rhs; - const t0 = Fp2.mul(c0, r0); // c0 * o0 - const t1 = Fp2.mul(c1, r1); // c1 * o1 - const t2 = Fp2.mul(c2, r2); // c2 * o2 - return { - // t0 + (c1 + c2) * (r1 * r2) - (T1 + T2) * (u + 1) - c0: Fp2.add(t0, Fp2.mulByNonresidue(Fp2.sub(Fp2.mul(Fp2.add(c1, c2), Fp2.add(r1, r2)), Fp2.add(t1, t2)))), - // (c0 + c1) * (r0 + r1) - (T0 + T1) + T2 * (u + 1) - c1: Fp2.add(Fp2.sub(Fp2.mul(Fp2.add(c0, c1), Fp2.add(r0, r1)), Fp2.add(t0, t1)), Fp2.mulByNonresidue(t2)), - // T1 + (c0 + c2) * (r0 + r2) - T0 + T2 - c2: Fp2.sub(Fp2.add(t1, Fp2.mul(Fp2.add(c0, c2), Fp2.add(r0, r2))), Fp2.add(t0, t2)), - }; -}; -const Fp6Square = ({ c0, c1, c2 }) => { - let t0 = Fp2.sqr(c0); // c0² - let t1 = Fp2.mul(Fp2.mul(c0, c1), _2n); // 2 * c0 * c1 - let t3 = Fp2.mul(Fp2.mul(c1, c2), _2n); // 2 * c1 * c2 - let t4 = Fp2.sqr(c2); // c2² - return { - c0: Fp2.add(Fp2.mulByNonresidue(t3), t0), - c1: Fp2.add(Fp2.mulByNonresidue(t4), t1), - // T1 + (c0 - c1 + c2)² + T3 - T0 - T4 - c2: Fp2.sub(Fp2.sub(Fp2.add(Fp2.add(t1, Fp2.sqr(Fp2.add(Fp2.sub(c0, c1), c2))), t3), t0), t4), - }; -}; -const Fp6 = { - ORDER: Fp2.ORDER, - BITS: 3 * Fp2.BITS, - BYTES: 3 * Fp2.BYTES, - MASK: bitMask(3 * Fp2.BITS), - ZERO: { c0: Fp2.ZERO, c1: Fp2.ZERO, c2: Fp2.ZERO }, - ONE: { c0: Fp2.ONE, c1: Fp2.ZERO, c2: Fp2.ZERO }, - create: (num) => num, - isValid: ({ c0, c1, c2 }) => Fp2.isValid(c0) && Fp2.isValid(c1) && Fp2.isValid(c2), - is0: ({ c0, c1, c2 }) => Fp2.is0(c0) && Fp2.is0(c1) && Fp2.is0(c2), - neg: ({ c0, c1, c2 }) => ({ c0: Fp2.neg(c0), c1: Fp2.neg(c1), c2: Fp2.neg(c2) }), - eql: ({ c0, c1, c2 }, { c0: r0, c1: r1, c2: r2 }) => Fp2.eql(c0, r0) && Fp2.eql(c1, r1) && Fp2.eql(c2, r2), - sqrt: () => { - throw new Error('Not implemented'); - }, - // Do we need division by bigint at all? Should be done via order: - div: (lhs, rhs) => Fp6.mul(lhs, typeof rhs === 'bigint' ? Fp.inv(Fp.create(rhs)) : Fp6.inv(rhs)), - pow: (num, power) => mod.FpPow(Fp6, num, power), - invertBatch: (nums) => mod.FpInvertBatch(Fp6, nums), - // Normalized - add: Fp6Add, - sub: Fp6Subtract, - mul: Fp6Multiply, - sqr: Fp6Square, - // NonNormalized stuff - addN: Fp6Add, - subN: Fp6Subtract, - mulN: Fp6Multiply, - sqrN: Fp6Square, - inv: ({ c0, c1, c2 }) => { - let t0 = Fp2.sub(Fp2.sqr(c0), Fp2.mulByNonresidue(Fp2.mul(c2, c1))); // c0² - c2 * c1 * (u + 1) - let t1 = Fp2.sub(Fp2.mulByNonresidue(Fp2.sqr(c2)), Fp2.mul(c0, c1)); // c2² * (u + 1) - c0 * c1 - let t2 = Fp2.sub(Fp2.sqr(c1), Fp2.mul(c0, c2)); // c1² - c0 * c2 - // 1/(((c2 * T1 + c1 * T2) * v) + c0 * T0) - let t4 = Fp2.inv(Fp2.add(Fp2.mulByNonresidue(Fp2.add(Fp2.mul(c2, t1), Fp2.mul(c1, t2))), Fp2.mul(c0, t0))); - return { c0: Fp2.mul(t4, t0), c1: Fp2.mul(t4, t1), c2: Fp2.mul(t4, t2) }; - }, - // Bytes utils - fromBytes: (b) => { - if (b.length !== Fp6.BYTES) - throw new Error(`fromBytes wrong length=${b.length}`); - return { - c0: Fp2.fromBytes(b.subarray(0, Fp2.BYTES)), - c1: Fp2.fromBytes(b.subarray(Fp2.BYTES, 2 * Fp2.BYTES)), - c2: Fp2.fromBytes(b.subarray(2 * Fp2.BYTES)), - }; - }, - toBytes: ({ c0, c1, c2 }) => concatB(Fp2.toBytes(c0), Fp2.toBytes(c1), Fp2.toBytes(c2)), - cmov: ({ c0, c1, c2 }, { c0: r0, c1: r1, c2: r2 }, c) => ({ - c0: Fp2.cmov(c0, r0, c), - c1: Fp2.cmov(c1, r1, c), - c2: Fp2.cmov(c2, r2, c), - }), - // Utils - // fromTriple(triple: [Fp2, Fp2, Fp2]) { - // return new Fp6(...triple); - // } - // toString() { - // return `Fp6(${this.c0} + ${this.c1} * v, ${this.c2} * v^2)`; - // } - fromBigSix: (t) => { - if (!Array.isArray(t) || t.length !== 6) - throw new Error('Invalid Fp6 usage'); - return { - c0: Fp2.fromBigTuple(t.slice(0, 2)), - c1: Fp2.fromBigTuple(t.slice(2, 4)), - c2: Fp2.fromBigTuple(t.slice(4, 6)), - }; - }, - frobeniusMap: ({ c0, c1, c2 }, power) => ({ - c0: Fp2.frobeniusMap(c0, power), - c1: Fp2.mul(Fp2.frobeniusMap(c1, power), FP6_FROBENIUS_COEFFICIENTS_1[power % 6]), - c2: Fp2.mul(Fp2.frobeniusMap(c2, power), FP6_FROBENIUS_COEFFICIENTS_2[power % 6]), - }), - mulByNonresidue: ({ c0, c1, c2 }) => ({ c0: Fp2.mulByNonresidue(c2), c1: c0, c2: c1 }), - // Sparse multiplication - multiplyBy1: ({ c0, c1, c2 }, b1) => ({ - c0: Fp2.mulByNonresidue(Fp2.mul(c2, b1)), - c1: Fp2.mul(c0, b1), - c2: Fp2.mul(c1, b1), - }), - // Sparse multiplication - multiplyBy01({ c0, c1, c2 }, b0, b1) { - let t0 = Fp2.mul(c0, b0); // c0 * b0 - let t1 = Fp2.mul(c1, b1); // c1 * b1 - return { - // ((c1 + c2) * b1 - T1) * (u + 1) + T0 - c0: Fp2.add(Fp2.mulByNonresidue(Fp2.sub(Fp2.mul(Fp2.add(c1, c2), b1), t1)), t0), - // (b0 + b1) * (c0 + c1) - T0 - T1 - c1: Fp2.sub(Fp2.sub(Fp2.mul(Fp2.add(b0, b1), Fp2.add(c0, c1)), t0), t1), - // (c0 + c2) * b0 - T0 + T1 - c2: Fp2.add(Fp2.sub(Fp2.mul(Fp2.add(c0, c2), b0), t0), t1), - }; - }, - multiplyByFp2: ({ c0, c1, c2 }, rhs) => ({ - c0: Fp2.mul(c0, rhs), - c1: Fp2.mul(c1, rhs), - c2: Fp2.mul(c2, rhs), - }), -}; -const FP6_FROBENIUS_COEFFICIENTS_1 = [ - [BigInt('0x1'), BigInt('0x0')], - [ - BigInt('0x0'), - BigInt('0x1a0111ea397fe699ec02408663d4de85aa0d857d89759ad4897d29650fb85f9b409427eb4f49fffd8bfd00000000aaac'), - ], - [ - BigInt('0x00000000000000005f19672fdf76ce51ba69c6076a0f77eaddb3a93be6f89688de17d813620a00022e01fffffffefffe'), - BigInt('0x0'), - ], - [BigInt('0x0'), BigInt('0x1')], - [ - BigInt('0x1a0111ea397fe699ec02408663d4de85aa0d857d89759ad4897d29650fb85f9b409427eb4f49fffd8bfd00000000aaac'), - BigInt('0x0'), - ], - [ - BigInt('0x0'), - BigInt('0x00000000000000005f19672fdf76ce51ba69c6076a0f77eaddb3a93be6f89688de17d813620a00022e01fffffffefffe'), - ], -].map((pair) => Fp2.fromBigTuple(pair)); -const FP6_FROBENIUS_COEFFICIENTS_2 = [ - [BigInt('0x1'), BigInt('0x0')], - [ - BigInt('0x1a0111ea397fe699ec02408663d4de85aa0d857d89759ad4897d29650fb85f9b409427eb4f49fffd8bfd00000000aaad'), - BigInt('0x0'), - ], - [ - BigInt('0x1a0111ea397fe699ec02408663d4de85aa0d857d89759ad4897d29650fb85f9b409427eb4f49fffd8bfd00000000aaac'), - BigInt('0x0'), - ], - [ - BigInt('0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaaa'), - BigInt('0x0'), - ], - [ - BigInt('0x00000000000000005f19672fdf76ce51ba69c6076a0f77eaddb3a93be6f89688de17d813620a00022e01fffffffefffe'), - BigInt('0x0'), - ], - [ - BigInt('0x00000000000000005f19672fdf76ce51ba69c6076a0f77eaddb3a93be6f89688de17d813620a00022e01fffffffeffff'), - BigInt('0x0'), - ], -].map((pair) => Fp2.fromBigTuple(pair)); -// The BLS parameter x for BLS12-381 -const BLS_X = BigInt('0xd201000000010000'); -const BLS_X_LEN = bitLen(BLS_X); -const Fp12Add = ({ c0, c1 }, { c0: r0, c1: r1 }) => ({ - c0: Fp6.add(c0, r0), - c1: Fp6.add(c1, r1), -}); -const Fp12Subtract = ({ c0, c1 }, { c0: r0, c1: r1 }) => ({ - c0: Fp6.sub(c0, r0), - c1: Fp6.sub(c1, r1), -}); -const Fp12Multiply = ({ c0, c1 }, rhs) => { - if (typeof rhs === 'bigint') - return { c0: Fp6.mul(c0, rhs), c1: Fp6.mul(c1, rhs) }; - let { c0: r0, c1: r1 } = rhs; - let t1 = Fp6.mul(c0, r0); // c0 * r0 - let t2 = Fp6.mul(c1, r1); // c1 * r1 - return { - c0: Fp6.add(t1, Fp6.mulByNonresidue(t2)), - // (c0 + c1) * (r0 + r1) - (T1 + T2) - c1: Fp6.sub(Fp6.mul(Fp6.add(c0, c1), Fp6.add(r0, r1)), Fp6.add(t1, t2)), - }; -}; -const Fp12Square = ({ c0, c1 }) => { - let ab = Fp6.mul(c0, c1); // c0 * c1 - return { - // (c1 * v + c0) * (c0 + c1) - AB - AB * v - c0: Fp6.sub(Fp6.sub(Fp6.mul(Fp6.add(Fp6.mulByNonresidue(c1), c0), Fp6.add(c0, c1)), ab), Fp6.mulByNonresidue(ab)), - c1: Fp6.add(ab, ab), - }; // AB + AB -}; -function Fp4Square(a, b) { - const a2 = Fp2.sqr(a); - const b2 = Fp2.sqr(b); - return { - first: Fp2.add(Fp2.mulByNonresidue(b2), a2), - second: Fp2.sub(Fp2.sub(Fp2.sqr(Fp2.add(a, b)), a2), b2), // (a + b)² - a² - b² - }; -} -const Fp12 = { - ORDER: Fp2.ORDER, - BITS: 2 * Fp2.BITS, - BYTES: 2 * Fp2.BYTES, - MASK: bitMask(2 * Fp2.BITS), - ZERO: { c0: Fp6.ZERO, c1: Fp6.ZERO }, - ONE: { c0: Fp6.ONE, c1: Fp6.ZERO }, - create: (num) => num, - isValid: ({ c0, c1 }) => Fp6.isValid(c0) && Fp6.isValid(c1), - is0: ({ c0, c1 }) => Fp6.is0(c0) && Fp6.is0(c1), - neg: ({ c0, c1 }) => ({ c0: Fp6.neg(c0), c1: Fp6.neg(c1) }), - eql: ({ c0, c1 }, { c0: r0, c1: r1 }) => Fp6.eql(c0, r0) && Fp6.eql(c1, r1), - sqrt: () => { - throw new Error('Not implemented'); - }, - inv: ({ c0, c1 }) => { - let t = Fp6.inv(Fp6.sub(Fp6.sqr(c0), Fp6.mulByNonresidue(Fp6.sqr(c1)))); // 1 / (c0² - c1² * v) - return { c0: Fp6.mul(c0, t), c1: Fp6.neg(Fp6.mul(c1, t)) }; // ((C0 * T) * T) + (-C1 * T) * w - }, - div: (lhs, rhs) => Fp12.mul(lhs, typeof rhs === 'bigint' ? Fp.inv(Fp.create(rhs)) : Fp12.inv(rhs)), - pow: (num, power) => mod.FpPow(Fp12, num, power), - invertBatch: (nums) => mod.FpInvertBatch(Fp12, nums), - // Normalized - add: Fp12Add, - sub: Fp12Subtract, - mul: Fp12Multiply, - sqr: Fp12Square, - // NonNormalized stuff - addN: Fp12Add, - subN: Fp12Subtract, - mulN: Fp12Multiply, - sqrN: Fp12Square, - // Bytes utils - fromBytes: (b) => { - if (b.length !== Fp12.BYTES) - throw new Error(`fromBytes wrong length=${b.length}`); - return { - c0: Fp6.fromBytes(b.subarray(0, Fp6.BYTES)), - c1: Fp6.fromBytes(b.subarray(Fp6.BYTES)), - }; - }, - toBytes: ({ c0, c1 }) => concatB(Fp6.toBytes(c0), Fp6.toBytes(c1)), - cmov: ({ c0, c1 }, { c0: r0, c1: r1 }, c) => ({ - c0: Fp6.cmov(c0, r0, c), - c1: Fp6.cmov(c1, r1, c), - }), - // Utils - // toString() { - // return `Fp12(${this.c0} + ${this.c1} * w)`; - // }, - // fromTuple(c: [Fp6, Fp6]) { - // return new Fp12(...c); - // } - fromBigTwelve: (t) => ({ - c0: Fp6.fromBigSix(t.slice(0, 6)), - c1: Fp6.fromBigSix(t.slice(6, 12)), - }), - // Raises to q**i -th power - frobeniusMap(lhs, power) { - const r0 = Fp6.frobeniusMap(lhs.c0, power); - const { c0, c1, c2 } = Fp6.frobeniusMap(lhs.c1, power); - const coeff = FP12_FROBENIUS_COEFFICIENTS[power % 12]; - return { - c0: r0, - c1: Fp6.create({ - c0: Fp2.mul(c0, coeff), - c1: Fp2.mul(c1, coeff), - c2: Fp2.mul(c2, coeff), - }), - }; - }, - // Sparse multiplication - multiplyBy014: ({ c0, c1 }, o0, o1, o4) => { - let t0 = Fp6.multiplyBy01(c0, o0, o1); - let t1 = Fp6.multiplyBy1(c1, o4); - return { - c0: Fp6.add(Fp6.mulByNonresidue(t1), t0), - // (c1 + c0) * [o0, o1+o4] - T0 - T1 - c1: Fp6.sub(Fp6.sub(Fp6.multiplyBy01(Fp6.add(c1, c0), o0, Fp2.add(o1, o4)), t0), t1), - }; - }, - multiplyByFp2: ({ c0, c1 }, rhs) => ({ - c0: Fp6.multiplyByFp2(c0, rhs), - c1: Fp6.multiplyByFp2(c1, rhs), - }), - conjugate: ({ c0, c1 }) => ({ c0, c1: Fp6.neg(c1) }), - // A cyclotomic group is a subgroup of Fp^n defined by - // GΦₙ(p) = {α ∈ Fpⁿ : α^Φₙ(p) = 1} - // The result of any pairing is in a cyclotomic subgroup - // https://eprint.iacr.org/2009/565.pdf - _cyclotomicSquare: ({ c0, c1 }) => { - const { c0: c0c0, c1: c0c1, c2: c0c2 } = c0; - const { c0: c1c0, c1: c1c1, c2: c1c2 } = c1; - const { first: t3, second: t4 } = Fp4Square(c0c0, c1c1); - const { first: t5, second: t6 } = Fp4Square(c1c0, c0c2); - const { first: t7, second: t8 } = Fp4Square(c0c1, c1c2); - let t9 = Fp2.mulByNonresidue(t8); // T8 * (u + 1) - return { - c0: Fp6.create({ - c0: Fp2.add(Fp2.mul(Fp2.sub(t3, c0c0), _2n), t3), - c1: Fp2.add(Fp2.mul(Fp2.sub(t5, c0c1), _2n), t5), - c2: Fp2.add(Fp2.mul(Fp2.sub(t7, c0c2), _2n), t7), - }), - c1: Fp6.create({ - c0: Fp2.add(Fp2.mul(Fp2.add(t9, c1c0), _2n), t9), - c1: Fp2.add(Fp2.mul(Fp2.add(t4, c1c1), _2n), t4), - c2: Fp2.add(Fp2.mul(Fp2.add(t6, c1c2), _2n), t6), - }), - }; // 2 * (T6 + c1c2) + T6 - }, - _cyclotomicExp(num, n) { - let z = Fp12.ONE; - for (let i = BLS_X_LEN - 1; i >= 0; i--) { - z = Fp12._cyclotomicSquare(z); - if (bitGet(n, i)) - z = Fp12.mul(z, num); - } - return z; - }, - // https://eprint.iacr.org/2010/354.pdf - // https://eprint.iacr.org/2009/565.pdf - finalExponentiate: (num) => { - const x = BLS_X; - // this^(q⁶) / this - const t0 = Fp12.div(Fp12.frobeniusMap(num, 6), num); - // t0^(q²) * t0 - const t1 = Fp12.mul(Fp12.frobeniusMap(t0, 2), t0); - const t2 = Fp12.conjugate(Fp12._cyclotomicExp(t1, x)); - const t3 = Fp12.mul(Fp12.conjugate(Fp12._cyclotomicSquare(t1)), t2); - const t4 = Fp12.conjugate(Fp12._cyclotomicExp(t3, x)); - const t5 = Fp12.conjugate(Fp12._cyclotomicExp(t4, x)); - const t6 = Fp12.mul(Fp12.conjugate(Fp12._cyclotomicExp(t5, x)), Fp12._cyclotomicSquare(t2)); - const t7 = Fp12.conjugate(Fp12._cyclotomicExp(t6, x)); - const t2_t5_pow_q2 = Fp12.frobeniusMap(Fp12.mul(t2, t5), 2); - const t4_t1_pow_q3 = Fp12.frobeniusMap(Fp12.mul(t4, t1), 3); - const t6_t1c_pow_q1 = Fp12.frobeniusMap(Fp12.mul(t6, Fp12.conjugate(t1)), 1); - const t7_t3c_t1 = Fp12.mul(Fp12.mul(t7, Fp12.conjugate(t3)), t1); - // (t2 * t5)^(q²) * (t4 * t1)^(q³) * (t6 * t1.conj)^(q^1) * t7 * t3.conj * t1 - return Fp12.mul(Fp12.mul(Fp12.mul(t2_t5_pow_q2, t4_t1_pow_q3), t6_t1c_pow_q1), t7_t3c_t1); - }, -}; -const FP12_FROBENIUS_COEFFICIENTS = [ - [BigInt('0x1'), BigInt('0x0')], - [ - BigInt('0x1904d3bf02bb0667c231beb4202c0d1f0fd603fd3cbd5f4f7b2443d784bab9c4f67ea53d63e7813d8d0775ed92235fb8'), - BigInt('0x00fc3e2b36c4e03288e9e902231f9fb854a14787b6c7b36fec0c8ec971f63c5f282d5ac14d6c7ec22cf78a126ddc4af3'), - ], - [ - BigInt('0x00000000000000005f19672fdf76ce51ba69c6076a0f77eaddb3a93be6f89688de17d813620a00022e01fffffffeffff'), - BigInt('0x0'), - ], - [ - BigInt('0x135203e60180a68ee2e9c448d77a2cd91c3dedd930b1cf60ef396489f61eb45e304466cf3e67fa0af1ee7b04121bdea2'), - BigInt('0x06af0e0437ff400b6831e36d6bd17ffe48395dabc2d3435e77f76e17009241c5ee67992f72ec05f4c81084fbede3cc09'), - ], - [ - BigInt('0x00000000000000005f19672fdf76ce51ba69c6076a0f77eaddb3a93be6f89688de17d813620a00022e01fffffffefffe'), - BigInt('0x0'), - ], - [ - BigInt('0x144e4211384586c16bd3ad4afa99cc9170df3560e77982d0db45f3536814f0bd5871c1908bd478cd1ee605167ff82995'), - BigInt('0x05b2cfd9013a5fd8df47fa6b48b1e045f39816240c0b8fee8beadf4d8e9c0566c63a3e6e257f87329b18fae980078116'), - ], - [ - BigInt('0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaaa'), - BigInt('0x0'), - ], - [ - BigInt('0x00fc3e2b36c4e03288e9e902231f9fb854a14787b6c7b36fec0c8ec971f63c5f282d5ac14d6c7ec22cf78a126ddc4af3'), - BigInt('0x1904d3bf02bb0667c231beb4202c0d1f0fd603fd3cbd5f4f7b2443d784bab9c4f67ea53d63e7813d8d0775ed92235fb8'), - ], - [ - BigInt('0x1a0111ea397fe699ec02408663d4de85aa0d857d89759ad4897d29650fb85f9b409427eb4f49fffd8bfd00000000aaac'), - BigInt('0x0'), - ], - [ - BigInt('0x06af0e0437ff400b6831e36d6bd17ffe48395dabc2d3435e77f76e17009241c5ee67992f72ec05f4c81084fbede3cc09'), - BigInt('0x135203e60180a68ee2e9c448d77a2cd91c3dedd930b1cf60ef396489f61eb45e304466cf3e67fa0af1ee7b04121bdea2'), - ], - [ - BigInt('0x1a0111ea397fe699ec02408663d4de85aa0d857d89759ad4897d29650fb85f9b409427eb4f49fffd8bfd00000000aaad'), - BigInt('0x0'), - ], - [ - BigInt('0x05b2cfd9013a5fd8df47fa6b48b1e045f39816240c0b8fee8beadf4d8e9c0566c63a3e6e257f87329b18fae980078116'), - BigInt('0x144e4211384586c16bd3ad4afa99cc9170df3560e77982d0db45f3536814f0bd5871c1908bd478cd1ee605167ff82995'), - ], -].map((n) => Fp2.fromBigTuple(n)); -// END OF CURVE FIELDS -// HashToCurve -// 3-isogeny map from E' to E https://www.rfc-editor.org/rfc/rfc9380#appendix-E.3 -const isogenyMapG2 = isogenyMap(Fp2, [ - // xNum - [ - [ - '0x5c759507e8e333ebb5b7a9a47d7ed8532c52d39fd3a042a88b58423c50ae15d5c2638e343d9c71c6238aaaaaaaa97d6', - '0x5c759507e8e333ebb5b7a9a47d7ed8532c52d39fd3a042a88b58423c50ae15d5c2638e343d9c71c6238aaaaaaaa97d6', - ], - [ - '0x0', - '0x11560bf17baa99bc32126fced787c88f984f87adf7ae0c7f9a208c6b4f20a4181472aaa9cb8d555526a9ffffffffc71a', - ], - [ - '0x11560bf17baa99bc32126fced787c88f984f87adf7ae0c7f9a208c6b4f20a4181472aaa9cb8d555526a9ffffffffc71e', - '0x8ab05f8bdd54cde190937e76bc3e447cc27c3d6fbd7063fcd104635a790520c0a395554e5c6aaaa9354ffffffffe38d', - ], - [ - '0x171d6541fa38ccfaed6dea691f5fb614cb14b4e7f4e810aa22d6108f142b85757098e38d0f671c7188e2aaaaaaaa5ed1', - '0x0', - ], - ], - // xDen - [ - [ - '0x0', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaa63', - ], - [ - '0xc', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaa9f', - ], - ['0x1', '0x0'], // LAST 1 - ], - // yNum - [ - [ - '0x1530477c7ab4113b59a4c18b076d11930f7da5d4a07f649bf54439d87d27e500fc8c25ebf8c92f6812cfc71c71c6d706', - '0x1530477c7ab4113b59a4c18b076d11930f7da5d4a07f649bf54439d87d27e500fc8c25ebf8c92f6812cfc71c71c6d706', - ], - [ - '0x0', - '0x5c759507e8e333ebb5b7a9a47d7ed8532c52d39fd3a042a88b58423c50ae15d5c2638e343d9c71c6238aaaaaaaa97be', - ], - [ - '0x11560bf17baa99bc32126fced787c88f984f87adf7ae0c7f9a208c6b4f20a4181472aaa9cb8d555526a9ffffffffc71c', - '0x8ab05f8bdd54cde190937e76bc3e447cc27c3d6fbd7063fcd104635a790520c0a395554e5c6aaaa9354ffffffffe38f', - ], - [ - '0x124c9ad43b6cf79bfbf7043de3811ad0761b0f37a1e26286b0e977c69aa274524e79097a56dc4bd9e1b371c71c718b10', - '0x0', - ], - ], - // yDen - [ - [ - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffa8fb', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffa8fb', - ], - [ - '0x0', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffa9d3', - ], - [ - '0x12', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaa99', - ], - ['0x1', '0x0'], // LAST 1 - ], -].map((i) => i.map((pair) => Fp2.fromBigTuple(pair.map(BigInt))))); -// 11-isogeny map from E' to E -const isogenyMapG1 = isogenyMap(Fp, [ - // xNum - [ - '0x11a05f2b1e833340b809101dd99815856b303e88a2d7005ff2627b56cdb4e2c85610c2d5f2e62d6eaeac1662734649b7', - '0x17294ed3e943ab2f0588bab22147a81c7c17e75b2f6a8417f565e33c70d1e86b4838f2a6f318c356e834eef1b3cb83bb', - '0xd54005db97678ec1d1048c5d10a9a1bce032473295983e56878e501ec68e25c958c3e3d2a09729fe0179f9dac9edcb0', - '0x1778e7166fcc6db74e0609d307e55412d7f5e4656a8dbf25f1b33289f1b330835336e25ce3107193c5b388641d9b6861', - '0xe99726a3199f4436642b4b3e4118e5499db995a1257fb3f086eeb65982fac18985a286f301e77c451154ce9ac8895d9', - '0x1630c3250d7313ff01d1201bf7a74ab5db3cb17dd952799b9ed3ab9097e68f90a0870d2dcae73d19cd13c1c66f652983', - '0xd6ed6553fe44d296a3726c38ae652bfb11586264f0f8ce19008e218f9c86b2a8da25128c1052ecaddd7f225a139ed84', - '0x17b81e7701abdbe2e8743884d1117e53356de5ab275b4db1a682c62ef0f2753339b7c8f8c8f475af9ccb5618e3f0c88e', - '0x80d3cf1f9a78fc47b90b33563be990dc43b756ce79f5574a2c596c928c5d1de4fa295f296b74e956d71986a8497e317', - '0x169b1f8e1bcfa7c42e0c37515d138f22dd2ecb803a0c5c99676314baf4bb1b7fa3190b2edc0327797f241067be390c9e', - '0x10321da079ce07e272d8ec09d2565b0dfa7dccdde6787f96d50af36003b14866f69b771f8c285decca67df3f1605fb7b', - '0x6e08c248e260e70bd1e962381edee3d31d79d7e22c837bc23c0bf1bc24c6b68c24b1b80b64d391fa9c8ba2e8ba2d229', - ], - // xDen - [ - '0x8ca8d548cff19ae18b2e62f4bd3fa6f01d5ef4ba35b48ba9c9588617fc8ac62b558d681be343df8993cf9fa40d21b1c', - '0x12561a5deb559c4348b4711298e536367041e8ca0cf0800c0126c2588c48bf5713daa8846cb026e9e5c8276ec82b3bff', - '0xb2962fe57a3225e8137e629bff2991f6f89416f5a718cd1fca64e00b11aceacd6a3d0967c94fedcfcc239ba5cb83e19', - '0x3425581a58ae2fec83aafef7c40eb545b08243f16b1655154cca8abc28d6fd04976d5243eecf5c4130de8938dc62cd8', - '0x13a8e162022914a80a6f1d5f43e7a07dffdfc759a12062bb8d6b44e833b306da9bd29ba81f35781d539d395b3532a21e', - '0xe7355f8e4e667b955390f7f0506c6e9395735e9ce9cad4d0a43bcef24b8982f7400d24bc4228f11c02df9a29f6304a5', - '0x772caacf16936190f3e0c63e0596721570f5799af53a1894e2e073062aede9cea73b3538f0de06cec2574496ee84a3a', - '0x14a7ac2a9d64a8b230b3f5b074cf01996e7f63c21bca68a81996e1cdf9822c580fa5b9489d11e2d311f7d99bbdcc5a5e', - '0xa10ecf6ada54f825e920b3dafc7a3cce07f8d1d7161366b74100da67f39883503826692abba43704776ec3a79a1d641', - '0x95fc13ab9e92ad4476d6e3eb3a56680f682b4ee96f7d03776df533978f31c1593174e4b4b7865002d6384d168ecdd0a', - '0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001', // LAST 1 - ], - // yNum - [ - '0x90d97c81ba24ee0259d1f094980dcfa11ad138e48a869522b52af6c956543d3cd0c7aee9b3ba3c2be9845719707bb33', - '0x134996a104ee5811d51036d776fb46831223e96c254f383d0f906343eb67ad34d6c56711962fa8bfe097e75a2e41c696', - '0xcc786baa966e66f4a384c86a3b49942552e2d658a31ce2c344be4b91400da7d26d521628b00523b8dfe240c72de1f6', - '0x1f86376e8981c217898751ad8746757d42aa7b90eeb791c09e4a3ec03251cf9de405aba9ec61deca6355c77b0e5f4cb', - '0x8cc03fdefe0ff135caf4fe2a21529c4195536fbe3ce50b879833fd221351adc2ee7f8dc099040a841b6daecf2e8fedb', - '0x16603fca40634b6a2211e11db8f0a6a074a7d0d4afadb7bd76505c3d3ad5544e203f6326c95a807299b23ab13633a5f0', - '0x4ab0b9bcfac1bbcb2c977d027796b3ce75bb8ca2be184cb5231413c4d634f3747a87ac2460f415ec961f8855fe9d6f2', - '0x987c8d5333ab86fde9926bd2ca6c674170a05bfe3bdd81ffd038da6c26c842642f64550fedfe935a15e4ca31870fb29', - '0x9fc4018bd96684be88c9e221e4da1bb8f3abd16679dc26c1e8b6e6a1f20cabe69d65201c78607a360370e577bdba587', - '0xe1bba7a1186bdb5223abde7ada14a23c42a0ca7915af6fe06985e7ed1e4d43b9b3f7055dd4eba6f2bafaaebca731c30', - '0x19713e47937cd1be0dfd0b8f1d43fb93cd2fcbcb6caf493fd1183e416389e61031bf3a5cce3fbafce813711ad011c132', - '0x18b46a908f36f6deb918c143fed2edcc523559b8aaf0c2462e6bfe7f911f643249d9cdf41b44d606ce07c8a4d0074d8e', - '0xb182cac101b9399d155096004f53f447aa7b12a3426b08ec02710e807b4633f06c851c1919211f20d4c04f00b971ef8', - '0x245a394ad1eca9b72fc00ae7be315dc757b3b080d4c158013e6632d3c40659cc6cf90ad1c232a6442d9d3f5db980133', - '0x5c129645e44cf1102a159f748c4a3fc5e673d81d7e86568d9ab0f5d396a7ce46ba1049b6579afb7866b1e715475224b', - '0x15e6be4e990f03ce4ea50b3b42df2eb5cb181d8f84965a3957add4fa95af01b2b665027efec01c7704b456be69c8b604', - ], - // yDen - [ - '0x16112c4c3a9c98b252181140fad0eae9601a6de578980be6eec3232b5be72e7a07f3688ef60c206d01479253b03663c1', - '0x1962d75c2381201e1a0cbd6c43c348b885c84ff731c4d59ca4a10356f453e01f78a4260763529e3532f6102c2e49a03d', - '0x58df3306640da276faaae7d6e8eb15778c4855551ae7f310c35a5dd279cd2eca6757cd636f96f891e2538b53dbf67f2', - '0x16b7d288798e5395f20d23bf89edb4d1d115c5dbddbcd30e123da489e726af41727364f2c28297ada8d26d98445f5416', - '0xbe0e079545f43e4b00cc912f8228ddcc6d19c9f0f69bbb0542eda0fc9dec916a20b15dc0fd2ededda39142311a5001d', - '0x8d9e5297186db2d9fb266eaac783182b70152c65550d881c5ecd87b6f0f5a6449f38db9dfa9cce202c6477faaf9b7ac', - '0x166007c08a99db2fc3ba8734ace9824b5eecfdfa8d0cf8ef5dd365bc400a0051d5fa9c01a58b1fb93d1a1399126a775c', - '0x16a3ef08be3ea7ea03bcddfabba6ff6ee5a4375efa1f4fd7feb34fd206357132b920f5b00801dee460ee415a15812ed9', - '0x1866c8ed336c61231a1be54fd1d74cc4f9fb0ce4c6af5920abc5750c4bf39b4852cfe2f7bb9248836b233d9d55535d4a', - '0x167a55cda70a6e1cea820597d94a84903216f763e13d87bb5308592e7ea7d4fbc7385ea3d529b35e346ef48bb8913f55', - '0x4d2f259eea405bd48f010a01ad2911d9c6dd039bb61a6290e591b36e636a5c871a5c29f4f83060400f8b49cba8f6aa8', - '0xaccbb67481d033ff5852c1e48c50c477f94ff8aefce42d28c0f9a88cea7913516f968986f7ebbea9684b529e2561092', - '0xad6b9514c767fe3c3613144b45f1496543346d98adf02267d5ceef9a00d9b8693000763e3b90ac11e99b138573345cc', - '0x2660400eb2e4f3b628bdd0d53cd76f2bf565b94e72927c1cb748df27942480e420517bd8714cc80d1fadc1326ed06f7', - '0xe0fa1d816ddc03e6b24255e0d7819c171c40f65e273b853324efcd6356caa205ca2f570f13497804415473a1d634b8f', - '0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001', // LAST 1 - ], -].map((i) => i.map((j) => BigInt(j)))); -// SWU Map - Fp2 to G2': y² = x³ + 240i * x + 1012 + 1012i -const G2_SWU = mapToCurveSimpleSWU(Fp2, { - A: Fp2.create({ c0: Fp.create(_0n), c1: Fp.create(BigInt(240)) }), - B: Fp2.create({ c0: Fp.create(BigInt(1012)), c1: Fp.create(BigInt(1012)) }), - Z: Fp2.create({ c0: Fp.create(BigInt(-2)), c1: Fp.create(BigInt(-1)) }), // Z: -(2 + I) -}); -// Optimized SWU Map - Fp to G1 -const G1_SWU = mapToCurveSimpleSWU(Fp, { - A: Fp.create(BigInt('0x144698a3b8e9433d693a02c96d4982b0ea985383ee66a8d8e8981aefd881ac98936f8da0e0f97f5cf428082d584c1d')), - B: Fp.create(BigInt('0x12e2908d11688030018b12e8753eee3b2016c1f0f24f4070a0b9c14fcef35ef55a23215a316ceaa5d1cc48e98e172be0')), - Z: Fp.create(BigInt(11)), -}); -// Endomorphisms (for fast cofactor clearing) -// Ψ(P) endomorphism -const ut_root = Fp6.create({ c0: Fp2.ZERO, c1: Fp2.ONE, c2: Fp2.ZERO }); -const wsq = Fp12.create({ c0: ut_root, c1: Fp6.ZERO }); -const wcu = Fp12.create({ c0: Fp6.ZERO, c1: ut_root }); -const [wsq_inv, wcu_inv] = Fp12.invertBatch([wsq, wcu]); -function psi(x, y) { - // Untwist Fp2->Fp12 && frobenius(1) && twist back - const x2 = Fp12.mul(Fp12.frobeniusMap(Fp12.multiplyByFp2(wsq_inv, x), 1), wsq).c0.c0; - const y2 = Fp12.mul(Fp12.frobeniusMap(Fp12.multiplyByFp2(wcu_inv, y), 1), wcu).c0.c0; - return [x2, y2]; -} -// Ψ endomorphism -function G2psi(c, P) { - const affine = P.toAffine(); - const p = psi(affine.x, affine.y); - return new c(p[0], p[1], Fp2.ONE); -} -// Ψ²(P) endomorphism -// 1 / F2(2)^((p-1)/3) in GF(p²) -const PSI2_C1 = BigInt('0x1a0111ea397fe699ec02408663d4de85aa0d857d89759ad4897d29650fb85f9b409427eb4f49fffd8bfd00000000aaac'); -function psi2(x, y) { - return [Fp2.mul(x, PSI2_C1), Fp2.neg(y)]; -} -function G2psi2(c, P) { - const affine = P.toAffine(); - const p = psi2(affine.x, affine.y); - return new c(p[0], p[1], Fp2.ONE); -} -// Default hash_to_field options are for hash to G2. -// -// Parameter definitions are in section 5.3 of the spec unless otherwise noted. -// Parameter values come from section 8.8.2 of the spec. -// https://www.rfc-editor.org/rfc/rfc9380#section-8.8.2 -// -// Base field F is GF(p^m) -// p = 0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab -// m = 2 (or 1 for G1 see section 8.8.1) -// k = 128 -const htfDefaults = Object.freeze({ - // DST: a domain separation tag - // defined in section 2.2.5 - // Use utils.getDSTLabel(), utils.setDSTLabel(value) - DST: 'BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_NUL_', - encodeDST: 'BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_NUL_', - // p: the characteristic of F - // where F is a finite field of characteristic p and order q = p^m - p: Fp.ORDER, - // m: the extension degree of F, m >= 1 - // where F is a finite field of characteristic p and order q = p^m - m: 2, - // k: the target security level for the suite in bits - // defined in section 5.1 - k: 128, - // option to use a message that has already been processed by - // expand_message_xmd - expand: 'xmd', - // Hash functions for: expand_message_xmd is appropriate for use with a - // wide range of hash functions, including SHA-2, SHA-3, BLAKE2, and others. - // BBS+ uses blake2: https://github.com/hyperledger/aries-framework-go/issues/2247 - hash: sha256, -}); -// Encoding utils -// Point on G1 curve: (x, y) -const C_BIT_POS = Fp.BITS; // C_bit, compression bit for serialization flag -const I_BIT_POS = Fp.BITS + 1; // I_bit, point-at-infinity bit for serialization flag -const S_BIT_POS = Fp.BITS + 2; // S_bit, sign bit for serialization flag -// Compressed point of infinity -const COMPRESSED_ZERO = Fp.toBytes(bitSet(bitSet(_0n, I_BIT_POS, true), S_BIT_POS, true)); // set compressed & point-at-infinity bits -function signatureG2ToRawBytes(point) { - // NOTE: by some reasons it was missed in bls12-381, looks like bug - point.assertValidity(); - const len = Fp.BYTES; - if (point.equals(bls12_381.G2.ProjectivePoint.ZERO)) - return concatB(COMPRESSED_ZERO, numberToBytesBE(_0n, len)); - const { x, y } = point.toAffine(); - const { re: x0, im: x1 } = Fp2.reim(x); - const { re: y0, im: y1 } = Fp2.reim(y); - const tmp = y1 > _0n ? y1 * _2n : y0 * _2n; - const aflag1 = Boolean((tmp / Fp.ORDER) & _1n); - const z1 = bitSet(bitSet(x1, 381, aflag1), S_BIT_POS, true); - const z2 = x0; - return concatB(numberToBytesBE(z1, len), numberToBytesBE(z2, len)); -} -// To verify curve parameters, see pairing-friendly-curves spec: -// https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-pairing-friendly-curves-11 -// Basic math is done over finite fields over p. -// More complicated math is done over polynominal extension fields. -// To simplify calculations in Fp12, we construct extension tower: -// Fp₁₂ = Fp₆² => Fp₂³ -// Fp(u) / (u² - β) where β = -1 -// Fp₂(v) / (v³ - ξ) where ξ = u + 1 -// Fp₆(w) / (w² - γ) where γ = v -// Here goes constants && point encoding format -export const bls12_381 = bls({ - // Fields - fields: { - Fp, - Fp2, - Fp6, - Fp12, - Fr, - }, - // G1 is the order-q subgroup of E1(Fp) : y² = x³ + 4, #E1(Fp) = h1q, where - // characteristic; z + (z⁴ - z² + 1)(z - 1)²/3 - G1: { - Fp, - // cofactor; (z - 1)²/3 - h: BigInt('0x396c8c005555e1568c00aaab0000aaab'), - // generator's coordinates - // x = 3685416753713387016781088315183077757961620795782546409894578378688607592378376318836054947676345821548104185464507 - // y = 1339506544944476473020471379941921221584933875938349620426543736416511423956333506472724655353366534992391756441569 - Gx: BigInt('0x17f1d3a73197d7942695638c4fa9ac0fc3688c4f9774b905a14e3a3f171bac586c55e83ff97a1aeffb3af00adb22c6bb'), - Gy: BigInt('0x08b3f481e3aaa0f1a09e30ed741d8ae4fcf5e095d5d00af600db18cb2c04b3edd03cc744a2888ae40caa232946c5e7e1'), - a: Fp.ZERO, - b: _4n, - htfDefaults: { ...htfDefaults, m: 1 }, - wrapPrivateKey: true, - allowInfinityPoint: true, - // Checks is the point resides in prime-order subgroup. - // point.isTorsionFree() should return true for valid points - // It returns false for shitty points. - // https://eprint.iacr.org/2021/1130.pdf - isTorsionFree: (c, point) => { - // φ endomorphism - const cubicRootOfUnityModP = BigInt('0x5f19672fdf76ce51ba69c6076a0f77eaddb3a93be6f89688de17d813620a00022e01fffffffefffe'); - const phi = new c(Fp.mul(point.px, cubicRootOfUnityModP), point.py, point.pz); - // todo: unroll - const xP = point.multiplyUnsafe(bls12_381.params.x).negate(); // [x]P - const u2P = xP.multiplyUnsafe(bls12_381.params.x); // [u2]P - return u2P.equals(phi); - // https://eprint.iacr.org/2019/814.pdf - // (z² − 1)/3 - // const c1 = BigInt('0x396c8c005555e1560000000055555555'); - // const P = this; - // const S = P.sigma(); - // const Q = S.double(); - // const S2 = S.sigma(); - // // [(z² − 1)/3](2σ(P) − P − σ²(P)) − σ²(P) = O - // const left = Q.subtract(P).subtract(S2).multiplyUnsafe(c1); - // const C = left.subtract(S2); - // return C.isZero(); - }, - // Clear cofactor of G1 - // https://eprint.iacr.org/2019/403 - clearCofactor: (_c, point) => { - // return this.multiplyUnsafe(CURVE.h); - return point.multiplyUnsafe(bls12_381.params.x).add(point); // x*P + P - }, - mapToCurve: (scalars) => { - const { x, y } = G1_SWU(Fp.create(scalars[0])); - return isogenyMapG1(x, y); - }, - fromBytes: (bytes) => { - bytes = bytes.slice(); - if (bytes.length === 48) { - // TODO: Fp.bytes - const P = Fp.ORDER; - const compressedValue = bytesToNumberBE(bytes); - const bflag = bitGet(compressedValue, I_BIT_POS); - // Zero - if (bflag === _1n) - return { x: _0n, y: _0n }; - const x = Fp.create(compressedValue & Fp.MASK); - const right = Fp.add(Fp.pow(x, _3n), Fp.create(bls12_381.params.G1b)); // y² = x³ + b - let y = Fp.sqrt(right); - if (!y) - throw new Error('Invalid compressed G1 point'); - const aflag = bitGet(compressedValue, C_BIT_POS); - if ((y * _2n) / P !== aflag) - y = Fp.neg(y); - return { x: Fp.create(x), y: Fp.create(y) }; - } - else if (bytes.length === 96) { - // Check if the infinity flag is set - if ((bytes[0] & (1 << 6)) !== 0) - return bls12_381.G1.ProjectivePoint.ZERO.toAffine(); - const x = bytesToNumberBE(bytes.subarray(0, Fp.BYTES)); - const y = bytesToNumberBE(bytes.subarray(Fp.BYTES)); - return { x: Fp.create(x), y: Fp.create(y) }; - } - else { - throw new Error('Invalid point G1, expected 48/96 bytes'); - } - }, - toBytes: (c, point, isCompressed) => { - const isZero = point.equals(c.ZERO); - const { x, y } = point.toAffine(); - if (isCompressed) { - if (isZero) - return COMPRESSED_ZERO.slice(); - const P = Fp.ORDER; - let num; - num = bitSet(x, C_BIT_POS, Boolean((y * _2n) / P)); // set aflag - num = bitSet(num, S_BIT_POS, true); - return numberToBytesBE(num, Fp.BYTES); - } - else { - if (isZero) { - // 2x PUBLIC_KEY_LENGTH - const x = concatB(new Uint8Array([0x40]), new Uint8Array(2 * Fp.BYTES - 1)); - return x; - } - else { - return concatB(numberToBytesBE(x, Fp.BYTES), numberToBytesBE(y, Fp.BYTES)); - } - } - }, - }, - // G2 is the order-q subgroup of E2(Fp²) : y² = x³+4(1+√−1), - // where Fp2 is Fp[√−1]/(x2+1). #E2(Fp2 ) = h2q, where - // G² - 1 - // h2q - G2: { - Fp: Fp2, - // cofactor - h: BigInt('0x5d543a95414e7f1091d50792876a202cd91de4547085abaa68a205b2e5a7ddfa628f1cb4d9e82ef21537e293a6691ae1616ec6e786f0c70cf1c38e31c7238e5'), - Gx: Fp2.fromBigTuple([ - BigInt('0x024aa2b2f08f0a91260805272dc51051c6e47ad4fa403b02b4510b647ae3d1770bac0326a805bbefd48056c8c121bdb8'), - BigInt('0x13e02b6052719f607dacd3a088274f65596bd0d09920b61ab5da61bbdc7f5049334cf11213945d57e5ac7d055d042b7e'), - ]), - // y = - // 927553665492332455747201965776037880757740193453592970025027978793976877002675564980949289727957565575433344219582, - // 1985150602287291935568054521177171638300868978215655730859378665066344726373823718423869104263333984641494340347905 - Gy: Fp2.fromBigTuple([ - BigInt('0x0ce5d527727d6e118cc9cdc6da2e351aadfd9baa8cbdd3a76d429a695160d12c923ac9cc3baca289e193548608b82801'), - BigInt('0x0606c4a02ea734cc32acd2b02bc28b99cb3e287e85a763af267492ab572e99ab3f370d275cec1da1aaa9075ff05f79be'), - ]), - a: Fp2.ZERO, - b: Fp2.fromBigTuple([_4n, _4n]), - hEff: BigInt('0xbc69f08f2ee75b3584c6a0ea91b352888e2a8e9145ad7689986ff031508ffe1329c2f178731db956d82bf015d1212b02ec0ec69d7477c1ae954cbc06689f6a359894c0adebbf6b4e8020005aaa95551'), - htfDefaults: { ...htfDefaults }, - wrapPrivateKey: true, - allowInfinityPoint: true, - mapToCurve: (scalars) => { - const { x, y } = G2_SWU(Fp2.fromBigTuple(scalars)); - return isogenyMapG2(x, y); - }, - // Checks is the point resides in prime-order subgroup. - // point.isTorsionFree() should return true for valid points - // It returns false for shitty points. - // https://eprint.iacr.org/2021/1130.pdf - isTorsionFree: (c, P) => { - return P.multiplyUnsafe(bls12_381.params.x).negate().equals(G2psi(c, P)); // ψ(P) == [u](P) - // Older version: https://eprint.iacr.org/2019/814.pdf - // Ψ²(P) => Ψ³(P) => [z]Ψ³(P) where z = -x => [z]Ψ³(P) - Ψ²(P) + P == O - // return P.psi2().psi().mulNegX().subtract(psi2).add(P).isZero(); - }, - // Maps the point into the prime-order subgroup G2. - // clear_cofactor_bls12381_g2 from cfrg-hash-to-curve-11 - // https://eprint.iacr.org/2017/419.pdf - // prettier-ignore - clearCofactor: (c, P) => { - const x = bls12_381.params.x; - let t1 = P.multiplyUnsafe(x).negate(); // [-x]P - let t2 = G2psi(c, P); // Ψ(P) - let t3 = P.double(); // 2P - t3 = G2psi2(c, t3); // Ψ²(2P) - t3 = t3.subtract(t2); // Ψ²(2P) - Ψ(P) - t2 = t1.add(t2); // [-x]P + Ψ(P) - t2 = t2.multiplyUnsafe(x).negate(); // [x²]P - [x]Ψ(P) - t3 = t3.add(t2); // Ψ²(2P) - Ψ(P) + [x²]P - [x]Ψ(P) - t3 = t3.subtract(t1); // Ψ²(2P) - Ψ(P) + [x²]P - [x]Ψ(P) + [x]P - const Q = t3.subtract(P); // Ψ²(2P) - Ψ(P) + [x²]P - [x]Ψ(P) + [x]P - 1P - return Q; // [x²-x-1]P + [x-1]Ψ(P) + Ψ²(2P) - }, - fromBytes: (bytes) => { - bytes = bytes.slice(); - const m_byte = bytes[0] & 0xe0; - if (m_byte === 0x20 || m_byte === 0x60 || m_byte === 0xe0) { - throw new Error('Invalid encoding flag: ' + m_byte); - } - const bitC = m_byte & 0x80; // compression bit - const bitI = m_byte & 0x40; // point at infinity bit - const bitS = m_byte & 0x20; // sign bit - const L = Fp.BYTES; - const slc = (b, from, to) => bytesToNumberBE(b.slice(from, to)); - if (bytes.length === 96 && bitC) { - const b = bls12_381.params.G2b; - const P = Fp.ORDER; - bytes[0] = bytes[0] & 0x1f; // clear flags - if (bitI) { - // check that all bytes are 0 - if (bytes.reduce((p, c) => (p !== 0 ? c + 1 : c), 0) > 0) { - throw new Error('Invalid compressed G2 point'); - } - return { x: Fp2.ZERO, y: Fp2.ZERO }; - } - const x_1 = slc(bytes, 0, L); - const x_0 = slc(bytes, L, 2 * L); - const x = Fp2.create({ c0: Fp.create(x_0), c1: Fp.create(x_1) }); - const right = Fp2.add(Fp2.pow(x, _3n), b); // y² = x³ + 4 * (u+1) = x³ + b - let y = Fp2.sqrt(right); - const Y_bit = y.c1 === _0n ? (y.c0 * _2n) / P : (y.c1 * _2n) / P ? _1n : _0n; - y = bitS > 0 && Y_bit > 0 ? y : Fp2.neg(y); - return { x, y }; - } - else if (bytes.length === 192 && !bitC) { - // Check if the infinity flag is set - if ((bytes[0] & (1 << 6)) !== 0) { - return { x: Fp2.ZERO, y: Fp2.ZERO }; - } - const x1 = slc(bytes, 0, L); - const x0 = slc(bytes, L, 2 * L); - const y1 = slc(bytes, 2 * L, 3 * L); - const y0 = slc(bytes, 3 * L, 4 * L); - return { x: Fp2.fromBigTuple([x0, x1]), y: Fp2.fromBigTuple([y0, y1]) }; - } - else { - throw new Error('Invalid point G2, expected 96/192 bytes'); - } - }, - toBytes: (c, point, isCompressed) => { - const { BYTES: len, ORDER: P } = Fp; - const isZero = point.equals(c.ZERO); - const { x, y } = point.toAffine(); - if (isCompressed) { - if (isZero) - return concatB(COMPRESSED_ZERO, numberToBytesBE(_0n, len)); - const flag = Boolean(y.c1 === _0n ? (y.c0 * _2n) / P : (y.c1 * _2n) / P); - // set compressed & sign bits (looks like different offsets than for G1/Fp?) - let x_1 = bitSet(x.c1, C_BIT_POS, flag); - x_1 = bitSet(x_1, S_BIT_POS, true); - return concatB(numberToBytesBE(x_1, len), numberToBytesBE(x.c0, len)); - } - else { - if (isZero) - return concatB(new Uint8Array([0x40]), new Uint8Array(4 * len - 1)); // bytes[0] |= 1 << 6; - const { re: x0, im: x1 } = Fp2.reim(x); - const { re: y0, im: y1 } = Fp2.reim(y); - return concatB(numberToBytesBE(x1, len), numberToBytesBE(x0, len), numberToBytesBE(y1, len), numberToBytesBE(y0, len)); - } - }, - Signature: { - // TODO: Optimize, it's very slow because of sqrt. - fromHex(hex) { - hex = ensureBytes('signatureHex', hex); - const P = Fp.ORDER; - const half = hex.length / 2; - if (half !== 48 && half !== 96) - throw new Error('Invalid compressed signature length, must be 96 or 192'); - const z1 = bytesToNumberBE(hex.slice(0, half)); - const z2 = bytesToNumberBE(hex.slice(half)); - // Indicates the infinity point - const bflag1 = bitGet(z1, I_BIT_POS); - if (bflag1 === _1n) - return bls12_381.G2.ProjectivePoint.ZERO; - const x1 = Fp.create(z1 & Fp.MASK); - const x2 = Fp.create(z2); - const x = Fp2.create({ c0: x2, c1: x1 }); - const y2 = Fp2.add(Fp2.pow(x, _3n), bls12_381.params.G2b); // y² = x³ + 4 - // The slow part - let y = Fp2.sqrt(y2); - if (!y) - throw new Error('Failed to find a square root'); - // Choose the y whose leftmost bit of the imaginary part is equal to the a_flag1 - // If y1 happens to be zero, then use the bit of y0 - const { re: y0, im: y1 } = Fp2.reim(y); - const aflag1 = bitGet(z1, 381); - const isGreater = y1 > _0n && (y1 * _2n) / P !== aflag1; - const isZero = y1 === _0n && (y0 * _2n) / P !== aflag1; - if (isGreater || isZero) - y = Fp2.neg(y); - const point = bls12_381.G2.ProjectivePoint.fromAffine({ x, y }); - point.assertValidity(); - return point; - }, - toRawBytes(point) { - return signatureG2ToRawBytes(point); - }, - toHex(point) { - return bytesToHex(signatureG2ToRawBytes(point)); - }, - }, - }, - params: { - x: BLS_X, - r: Fr.ORDER, // order; z⁴ − z² + 1; CURVE.n from other curves - }, - htfDefaults, - hash: sha256, - randomBytes, -}); -//# sourceMappingURL=bls12-381.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/bls12-381.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/bls12-381.js.map deleted file mode 100644 index ed20a5dc..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/bls12-381.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bls12-381.js","sourceRoot":"","sources":["../src/bls12-381.ts"],"names":[],"mappings":"AAAA,sEAAsE;AAEtE,uFAAuF;AACvF,gDAAgD;AAChD,kGAAkG;AAClG,+EAA+E;AAC/E,EAAE;AACF,mGAAmG;AACnG,+EAA+E;AAC/E,+FAA+F;AAC/F,2FAA2F;AAC3F,wEAAwE;AACxE,EAAE;AACF,cAAc;AACd,gDAAgD;AAChD,4BAA4B;AAC5B,2FAA2F;AAC3F,mHAAmH;AACnH,0FAA0F;AAC1F,2HAA2H;AAC3H,6CAA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AAC;gBACvD,IAAI,SAAS,IAAI,MAAM;oBAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBACxC,MAAM,KAAK,GAAG,SAAS,CAAC,EAAE,CAAC,eAAe,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;gBAChE,KAAK,CAAC,cAAc,EAAE,CAAC;gBACvB,OAAO,KAAK,CAAC;YACf,CAAC;YACD,UAAU,CAAC,KAAyB;gBAClC,OAAO,qBAAqB,CAAC,KAAK,CAAC,CAAC;YACtC,CAAC;YACD,KAAK,CAAC,KAAyB;gBAC7B,OAAO,UAAU,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAAC;YAClD,CAAC;SACF;KACF;IACD,MAAM,EAAE;QACN,CAAC,EAAE,KAAK;QACR,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,gDAAgD;KAC9D;IACD,WAAW;IACX,IAAI,EAAE,MAAM;IACZ,WAAW;CACZ,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/bn254.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/bn254.js deleted file mode 100644 index 6b4f7c67..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/bn254.js +++ /dev/null @@ -1,22 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { sha256 } from '@noble/hashes/sha256'; -import { weierstrass } from './abstract/weierstrass.js'; -import { getHash } from './_shortw_utils.js'; -import { Field } from './abstract/modular.js'; -/** - * bn254 pairing-friendly curve. - * Previously known as alt_bn_128, when it had 128-bit security. - * Recent research shown it's weaker, the naming has been adjusted to its prime bit count. - * https://github.com/zcash/zcash/issues/2502 - */ -export const bn254 = weierstrass({ - a: BigInt(0), - b: BigInt(3), - Fp: Field(BigInt('0x30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47')), - n: BigInt('0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001'), - Gx: BigInt(1), - Gy: BigInt(2), - h: BigInt(1), - ...getHash(sha256), -}); -//# sourceMappingURL=bn254.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/bn254.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/bn254.js.map deleted file mode 100644 index e0ec0235..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/bn254.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bn254.js","sourceRoot":"","sources":["../src/bn254.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,WAAW,CAAC;IAC/B,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC,oEAAoE,CAAC,CAAC;IACvF,CAAC,EAAE,MAAM,CAAC,oEAAoE,CAAC;IAC/E,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;IACb,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;IACb,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,GAAG,OAAO,CAAC,MAAM,CAAC;CACnB,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/ed25519.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/ed25519.js deleted file mode 100644 index ad84785b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/ed25519.js +++ /dev/null @@ -1,433 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { sha512 } from '@noble/hashes/sha512'; -import { concatBytes, randomBytes, utf8ToBytes } from '@noble/hashes/utils'; -import { twistedEdwards } from './abstract/edwards.js'; -import { montgomery } from './abstract/montgomery.js'; -import { Field, FpSqrtEven, isNegativeLE, mod, pow2 } from './abstract/modular.js'; -import { bytesToHex, bytesToNumberLE, ensureBytes, equalBytes, numberToBytesLE, } from './abstract/utils.js'; -import { createHasher, expand_message_xmd } from './abstract/hash-to-curve.js'; -/** - * ed25519 Twisted Edwards curve with following addons: - * - X25519 ECDH - * - Ristretto cofactor elimination - * - Elligator hash-to-group / point indistinguishability - */ -const ED25519_P = BigInt('57896044618658097711785492504343953926634992332820282019728792003956564819949'); -// √(-1) aka √(a) aka 2^((p-1)/4) -const ED25519_SQRT_M1 = BigInt('19681161376707505956807079304988542015446066515923890162744021073123829784752'); -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _5n = BigInt(5); -// prettier-ignore -const _10n = BigInt(10), _20n = BigInt(20), _40n = BigInt(40), _80n = BigInt(80); -function ed25519_pow_2_252_3(x) { - const P = ED25519_P; - const x2 = (x * x) % P; - const b2 = (x2 * x) % P; // x^3, 11 - const b4 = (pow2(b2, _2n, P) * b2) % P; // x^15, 1111 - const b5 = (pow2(b4, _1n, P) * x) % P; // x^31 - const b10 = (pow2(b5, _5n, P) * b5) % P; - const b20 = (pow2(b10, _10n, P) * b10) % P; - const b40 = (pow2(b20, _20n, P) * b20) % P; - const b80 = (pow2(b40, _40n, P) * b40) % P; - const b160 = (pow2(b80, _80n, P) * b80) % P; - const b240 = (pow2(b160, _80n, P) * b80) % P; - const b250 = (pow2(b240, _10n, P) * b10) % P; - const pow_p_5_8 = (pow2(b250, _2n, P) * x) % P; - // ^ To pow to (p+3)/8, multiply it by x. - return { pow_p_5_8, b2 }; -} -function adjustScalarBytes(bytes) { - // Section 5: For X25519, in order to decode 32 random bytes as an integer scalar, - // set the three least significant bits of the first byte - bytes[0] &= 248; // 0b1111_1000 - // and the most significant bit of the last to zero, - bytes[31] &= 127; // 0b0111_1111 - // set the second most significant bit of the last byte to 1 - bytes[31] |= 64; // 0b0100_0000 - return bytes; -} -// sqrt(u/v) -function uvRatio(u, v) { - const P = ED25519_P; - const v3 = mod(v * v * v, P); // v³ - const v7 = mod(v3 * v3 * v, P); // v⁷ - // (p+3)/8 and (p-5)/8 - const pow = ed25519_pow_2_252_3(u * v7).pow_p_5_8; - let x = mod(u * v3 * pow, P); // (uv³)(uv⁷)^(p-5)/8 - const vx2 = mod(v * x * x, P); // vx² - const root1 = x; // First root candidate - const root2 = mod(x * ED25519_SQRT_M1, P); // Second root candidate - const useRoot1 = vx2 === u; // If vx² = u (mod p), x is a square root - const useRoot2 = vx2 === mod(-u, P); // If vx² = -u, set x <-- x * 2^((p-1)/4) - const noRoot = vx2 === mod(-u * ED25519_SQRT_M1, P); // There is no valid root, vx² = -u√(-1) - if (useRoot1) - x = root1; - if (useRoot2 || noRoot) - x = root2; // We return root2 anyway, for const-time - if (isNegativeLE(x, P)) - x = mod(-x, P); - return { isValid: useRoot1 || useRoot2, value: x }; -} -// Just in case -export const ED25519_TORSION_SUBGROUP = [ - '0100000000000000000000000000000000000000000000000000000000000000', - 'c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a', - '0000000000000000000000000000000000000000000000000000000000000080', - '26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05', - 'ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f', - '26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85', - '0000000000000000000000000000000000000000000000000000000000000000', - 'c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa', -]; -const Fp = Field(ED25519_P, undefined, true); -const ed25519Defaults = { - // Param: a - a: BigInt(-1), - // d is equal to -121665/121666 over finite field. - // Negative number is P - number, and division is invert(number, P) - d: BigInt('37095705934669439343138083508754565189542113879843219016388785533085940283555'), - // Finite field 𝔽p over which we'll do calculations; 2n**255n - 19n - Fp, - // Subgroup order: how many points curve has - // 2n**252n + 27742317777372353535851937790883648493n; - n: BigInt('7237005577332262213973186563042994240857116359379907606001950938285454250989'), - // Cofactor - h: BigInt(8), - // Base point (x, y) aka generator point - Gx: BigInt('15112221349535400772501151409588531511454012693041857206046113283949847762202'), - Gy: BigInt('46316835694926478169428394003475163141307993866256225615783033603165251855960'), - hash: sha512, - randomBytes, - adjustScalarBytes, - // dom2 - // Ratio of u to v. Allows us to combine inversion and square root. Uses algo from RFC8032 5.1.3. - // Constant-time, u/√v - uvRatio, -}; -export const ed25519 = /* @__PURE__ */ twistedEdwards(ed25519Defaults); -function ed25519_domain(data, ctx, phflag) { - if (ctx.length > 255) - throw new Error('Context is too big'); - return concatBytes(utf8ToBytes('SigEd25519 no Ed25519 collisions'), new Uint8Array([phflag ? 1 : 0, ctx.length]), ctx, data); -} -export const ed25519ctx = /* @__PURE__ */ twistedEdwards({ - ...ed25519Defaults, - domain: ed25519_domain, -}); -export const ed25519ph = /* @__PURE__ */ twistedEdwards({ - ...ed25519Defaults, - domain: ed25519_domain, - prehash: sha512, -}); -export const x25519 = /* @__PURE__ */ (() => montgomery({ - P: ED25519_P, - a: BigInt(486662), - montgomeryBits: 255, - nByteLength: 32, - Gu: BigInt(9), - powPminus2: (x) => { - const P = ED25519_P; - // x^(p-2) aka x^(2^255-21) - const { pow_p_5_8, b2 } = ed25519_pow_2_252_3(x); - return mod(pow2(pow_p_5_8, BigInt(3), P) * b2, P); - }, - adjustScalarBytes, - randomBytes, -}))(); -/** - * Converts ed25519 public key to x25519 public key. Uses formula: - * * `(u, v) = ((1+y)/(1-y), sqrt(-486664)*u/x)` - * * `(x, y) = (sqrt(-486664)*u/v, (u-1)/(u+1))` - * @example - * const someonesPub = ed25519.getPublicKey(ed25519.utils.randomPrivateKey()); - * const aPriv = x25519.utils.randomPrivateKey(); - * x25519.getSharedSecret(aPriv, edwardsToMontgomeryPub(someonesPub)) - */ -export function edwardsToMontgomeryPub(edwardsPub) { - const { y } = ed25519.ExtendedPoint.fromHex(edwardsPub); - const _1n = BigInt(1); - return Fp.toBytes(Fp.create((_1n + y) * Fp.inv(_1n - y))); -} -export const edwardsToMontgomery = edwardsToMontgomeryPub; // deprecated -/** - * Converts ed25519 secret key to x25519 secret key. - * @example - * const someonesPub = x25519.getPublicKey(x25519.utils.randomPrivateKey()); - * const aPriv = ed25519.utils.randomPrivateKey(); - * x25519.getSharedSecret(edwardsToMontgomeryPriv(aPriv), someonesPub) - */ -export function edwardsToMontgomeryPriv(edwardsPriv) { - const hashed = ed25519Defaults.hash(edwardsPriv.subarray(0, 32)); - return ed25519Defaults.adjustScalarBytes(hashed).subarray(0, 32); -} -// Hash To Curve Elligator2 Map (NOTE: different from ristretto255 elligator) -// NOTE: very important part is usage of FpSqrtEven for ELL2_C1_EDWARDS, since -// SageMath returns different root first and everything falls apart -const ELL2_C1 = (Fp.ORDER + BigInt(3)) / BigInt(8); // 1. c1 = (q + 3) / 8 # Integer arithmetic -const ELL2_C2 = Fp.pow(_2n, ELL2_C1); // 2. c2 = 2^c1 -const ELL2_C3 = Fp.sqrt(Fp.neg(Fp.ONE)); // 3. c3 = sqrt(-1) -const ELL2_C4 = (Fp.ORDER - BigInt(5)) / BigInt(8); // 4. c4 = (q - 5) / 8 # Integer arithmetic -const ELL2_J = BigInt(486662); -// prettier-ignore -function map_to_curve_elligator2_curve25519(u) { - let tv1 = Fp.sqr(u); // 1. tv1 = u^2 - tv1 = Fp.mul(tv1, _2n); // 2. tv1 = 2 * tv1 - let xd = Fp.add(tv1, Fp.ONE); // 3. xd = tv1 + 1 # Nonzero: -1 is square (mod p), tv1 is not - let x1n = Fp.neg(ELL2_J); // 4. x1n = -J # x1 = x1n / xd = -J / (1 + 2 * u^2) - let tv2 = Fp.sqr(xd); // 5. tv2 = xd^2 - let gxd = Fp.mul(tv2, xd); // 6. gxd = tv2 * xd # gxd = xd^3 - let gx1 = Fp.mul(tv1, ELL2_J); // 7. gx1 = J * tv1 # x1n + J * xd - gx1 = Fp.mul(gx1, x1n); // 8. gx1 = gx1 * x1n # x1n^2 + J * x1n * xd - gx1 = Fp.add(gx1, tv2); // 9. gx1 = gx1 + tv2 # x1n^2 + J * x1n * xd + xd^2 - gx1 = Fp.mul(gx1, x1n); // 10. gx1 = gx1 * x1n # x1n^3 + J * x1n^2 * xd + x1n * xd^2 - let tv3 = Fp.sqr(gxd); // 11. tv3 = gxd^2 - tv2 = Fp.sqr(tv3); // 12. tv2 = tv3^2 # gxd^4 - tv3 = Fp.mul(tv3, gxd); // 13. tv3 = tv3 * gxd # gxd^3 - tv3 = Fp.mul(tv3, gx1); // 14. tv3 = tv3 * gx1 # gx1 * gxd^3 - tv2 = Fp.mul(tv2, tv3); // 15. tv2 = tv2 * tv3 # gx1 * gxd^7 - let y11 = Fp.pow(tv2, ELL2_C4); // 16. y11 = tv2^c4 # (gx1 * gxd^7)^((p - 5) / 8) - y11 = Fp.mul(y11, tv3); // 17. y11 = y11 * tv3 # gx1*gxd^3*(gx1*gxd^7)^((p-5)/8) - let y12 = Fp.mul(y11, ELL2_C3); // 18. y12 = y11 * c3 - tv2 = Fp.sqr(y11); // 19. tv2 = y11^2 - tv2 = Fp.mul(tv2, gxd); // 20. tv2 = tv2 * gxd - let e1 = Fp.eql(tv2, gx1); // 21. e1 = tv2 == gx1 - let y1 = Fp.cmov(y12, y11, e1); // 22. y1 = CMOV(y12, y11, e1) # If g(x1) is square, this is its sqrt - let x2n = Fp.mul(x1n, tv1); // 23. x2n = x1n * tv1 # x2 = x2n / xd = 2 * u^2 * x1n / xd - let y21 = Fp.mul(y11, u); // 24. y21 = y11 * u - y21 = Fp.mul(y21, ELL2_C2); // 25. y21 = y21 * c2 - let y22 = Fp.mul(y21, ELL2_C3); // 26. y22 = y21 * c3 - let gx2 = Fp.mul(gx1, tv1); // 27. gx2 = gx1 * tv1 # g(x2) = gx2 / gxd = 2 * u^2 * g(x1) - tv2 = Fp.sqr(y21); // 28. tv2 = y21^2 - tv2 = Fp.mul(tv2, gxd); // 29. tv2 = tv2 * gxd - let e2 = Fp.eql(tv2, gx2); // 30. e2 = tv2 == gx2 - let y2 = Fp.cmov(y22, y21, e2); // 31. y2 = CMOV(y22, y21, e2) # If g(x2) is square, this is its sqrt - tv2 = Fp.sqr(y1); // 32. tv2 = y1^2 - tv2 = Fp.mul(tv2, gxd); // 33. tv2 = tv2 * gxd - let e3 = Fp.eql(tv2, gx1); // 34. e3 = tv2 == gx1 - let xn = Fp.cmov(x2n, x1n, e3); // 35. xn = CMOV(x2n, x1n, e3) # If e3, x = x1, else x = x2 - let y = Fp.cmov(y2, y1, e3); // 36. y = CMOV(y2, y1, e3) # If e3, y = y1, else y = y2 - let e4 = Fp.isOdd(y); // 37. e4 = sgn0(y) == 1 # Fix sign of y - y = Fp.cmov(y, Fp.neg(y), e3 !== e4); // 38. y = CMOV(y, -y, e3 XOR e4) - return { xMn: xn, xMd: xd, yMn: y, yMd: _1n }; // 39. return (xn, xd, y, 1) -} -const ELL2_C1_EDWARDS = FpSqrtEven(Fp, Fp.neg(BigInt(486664))); // sgn0(c1) MUST equal 0 -function map_to_curve_elligator2_edwards25519(u) { - const { xMn, xMd, yMn, yMd } = map_to_curve_elligator2_curve25519(u); // 1. (xMn, xMd, yMn, yMd) = - // map_to_curve_elligator2_curve25519(u) - let xn = Fp.mul(xMn, yMd); // 2. xn = xMn * yMd - xn = Fp.mul(xn, ELL2_C1_EDWARDS); // 3. xn = xn * c1 - let xd = Fp.mul(xMd, yMn); // 4. xd = xMd * yMn # xn / xd = c1 * xM / yM - let yn = Fp.sub(xMn, xMd); // 5. yn = xMn - xMd - let yd = Fp.add(xMn, xMd); // 6. yd = xMn + xMd # (n / d - 1) / (n / d + 1) = (n - d) / (n + d) - let tv1 = Fp.mul(xd, yd); // 7. tv1 = xd * yd - let e = Fp.eql(tv1, Fp.ZERO); // 8. e = tv1 == 0 - xn = Fp.cmov(xn, Fp.ZERO, e); // 9. xn = CMOV(xn, 0, e) - xd = Fp.cmov(xd, Fp.ONE, e); // 10. xd = CMOV(xd, 1, e) - yn = Fp.cmov(yn, Fp.ONE, e); // 11. yn = CMOV(yn, 1, e) - yd = Fp.cmov(yd, Fp.ONE, e); // 12. yd = CMOV(yd, 1, e) - const inv = Fp.invertBatch([xd, yd]); // batch division - return { x: Fp.mul(xn, inv[0]), y: Fp.mul(yn, inv[1]) }; // 13. return (xn, xd, yn, yd) -} -const htf = /* @__PURE__ */ (() => createHasher(ed25519.ExtendedPoint, (scalars) => map_to_curve_elligator2_edwards25519(scalars[0]), { - DST: 'edwards25519_XMD:SHA-512_ELL2_RO_', - encodeDST: 'edwards25519_XMD:SHA-512_ELL2_NU_', - p: Fp.ORDER, - m: 1, - k: 128, - expand: 'xmd', - hash: sha512, -}))(); -export const hashToCurve = /* @__PURE__ */ (() => htf.hashToCurve)(); -export const encodeToCurve = /* @__PURE__ */ (() => htf.encodeToCurve)(); -function assertRstPoint(other) { - if (!(other instanceof RistPoint)) - throw new Error('RistrettoPoint expected'); -} -// √(-1) aka √(a) aka 2^((p-1)/4) -const SQRT_M1 = ED25519_SQRT_M1; -// √(ad - 1) -const SQRT_AD_MINUS_ONE = BigInt('25063068953384623474111414158702152701244531502492656460079210482610430750235'); -// 1 / √(a-d) -const INVSQRT_A_MINUS_D = BigInt('54469307008909316920995813868745141605393597292927456921205312896311721017578'); -// 1-d² -const ONE_MINUS_D_SQ = BigInt('1159843021668779879193775521855586647937357759715417654439879720876111806838'); -// (d-1)² -const D_MINUS_ONE_SQ = BigInt('40440834346308536858101042469323190826248399146238708352240133220865137265952'); -// Calculates 1/√(number) -const invertSqrt = (number) => uvRatio(_1n, number); -const MAX_255B = BigInt('0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'); -const bytes255ToNumberLE = (bytes) => ed25519.CURVE.Fp.create(bytesToNumberLE(bytes) & MAX_255B); -// Computes Elligator map for Ristretto -// https://ristretto.group/formulas/elligator.html -function calcElligatorRistrettoMap(r0) { - const { d } = ed25519.CURVE; - const P = ed25519.CURVE.Fp.ORDER; - const mod = ed25519.CURVE.Fp.create; - const r = mod(SQRT_M1 * r0 * r0); // 1 - const Ns = mod((r + _1n) * ONE_MINUS_D_SQ); // 2 - let c = BigInt(-1); // 3 - const D = mod((c - d * r) * mod(r + d)); // 4 - let { isValid: Ns_D_is_sq, value: s } = uvRatio(Ns, D); // 5 - let s_ = mod(s * r0); // 6 - if (!isNegativeLE(s_, P)) - s_ = mod(-s_); - if (!Ns_D_is_sq) - s = s_; // 7 - if (!Ns_D_is_sq) - c = r; // 8 - const Nt = mod(c * (r - _1n) * D_MINUS_ONE_SQ - D); // 9 - const s2 = s * s; - const W0 = mod((s + s) * D); // 10 - const W1 = mod(Nt * SQRT_AD_MINUS_ONE); // 11 - const W2 = mod(_1n - s2); // 12 - const W3 = mod(_1n + s2); // 13 - return new ed25519.ExtendedPoint(mod(W0 * W3), mod(W2 * W1), mod(W1 * W3), mod(W0 * W2)); -} -/** - * Each ed25519/ExtendedPoint has 8 different equivalent points. This can be - * a source of bugs for protocols like ring signatures. Ristretto was created to solve this. - * Ristretto point operates in X:Y:Z:T extended coordinates like ExtendedPoint, - * but it should work in its own namespace: do not combine those two. - * https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-ristretto255-decaf448 - */ -class RistPoint { - // Private property to discourage combining ExtendedPoint + RistrettoPoint - // Always use Ristretto encoding/decoding instead. - constructor(ep) { - this.ep = ep; - } - static fromAffine(ap) { - return new RistPoint(ed25519.ExtendedPoint.fromAffine(ap)); - } - /** - * Takes uniform output of 64-byte hash function like sha512 and converts it to `RistrettoPoint`. - * The hash-to-group operation applies Elligator twice and adds the results. - * **Note:** this is one-way map, there is no conversion from point to hash. - * https://ristretto.group/formulas/elligator.html - * @param hex 64-byte output of a hash function - */ - static hashToCurve(hex) { - hex = ensureBytes('ristrettoHash', hex, 64); - const r1 = bytes255ToNumberLE(hex.slice(0, 32)); - const R1 = calcElligatorRistrettoMap(r1); - const r2 = bytes255ToNumberLE(hex.slice(32, 64)); - const R2 = calcElligatorRistrettoMap(r2); - return new RistPoint(R1.add(R2)); - } - /** - * Converts ristretto-encoded string to ristretto point. - * https://ristretto.group/formulas/decoding.html - * @param hex Ristretto-encoded 32 bytes. Not every 32-byte string is valid ristretto encoding - */ - static fromHex(hex) { - hex = ensureBytes('ristrettoHex', hex, 32); - const { a, d } = ed25519.CURVE; - const P = ed25519.CURVE.Fp.ORDER; - const mod = ed25519.CURVE.Fp.create; - const emsg = 'RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint'; - const s = bytes255ToNumberLE(hex); - // 1. Check that s_bytes is the canonical encoding of a field element, or else abort. - // 3. Check that s is non-negative, or else abort - if (!equalBytes(numberToBytesLE(s, 32), hex) || isNegativeLE(s, P)) - throw new Error(emsg); - const s2 = mod(s * s); - const u1 = mod(_1n + a * s2); // 4 (a is -1) - const u2 = mod(_1n - a * s2); // 5 - const u1_2 = mod(u1 * u1); - const u2_2 = mod(u2 * u2); - const v = mod(a * d * u1_2 - u2_2); // 6 - const { isValid, value: I } = invertSqrt(mod(v * u2_2)); // 7 - const Dx = mod(I * u2); // 8 - const Dy = mod(I * Dx * v); // 9 - let x = mod((s + s) * Dx); // 10 - if (isNegativeLE(x, P)) - x = mod(-x); // 10 - const y = mod(u1 * Dy); // 11 - const t = mod(x * y); // 12 - if (!isValid || isNegativeLE(t, P) || y === _0n) - throw new Error(emsg); - return new RistPoint(new ed25519.ExtendedPoint(x, y, _1n, t)); - } - /** - * Encodes ristretto point to Uint8Array. - * https://ristretto.group/formulas/encoding.html - */ - toRawBytes() { - let { ex: x, ey: y, ez: z, et: t } = this.ep; - const P = ed25519.CURVE.Fp.ORDER; - const mod = ed25519.CURVE.Fp.create; - const u1 = mod(mod(z + y) * mod(z - y)); // 1 - const u2 = mod(x * y); // 2 - // Square root always exists - const u2sq = mod(u2 * u2); - const { value: invsqrt } = invertSqrt(mod(u1 * u2sq)); // 3 - const D1 = mod(invsqrt * u1); // 4 - const D2 = mod(invsqrt * u2); // 5 - const zInv = mod(D1 * D2 * t); // 6 - let D; // 7 - if (isNegativeLE(t * zInv, P)) { - let _x = mod(y * SQRT_M1); - let _y = mod(x * SQRT_M1); - x = _x; - y = _y; - D = mod(D1 * INVSQRT_A_MINUS_D); - } - else { - D = D2; // 8 - } - if (isNegativeLE(x * zInv, P)) - y = mod(-y); // 9 - let s = mod((z - y) * D); // 10 (check footer's note, no sqrt(-a)) - if (isNegativeLE(s, P)) - s = mod(-s); - return numberToBytesLE(s, 32); // 11 - } - toHex() { - return bytesToHex(this.toRawBytes()); - } - toString() { - return this.toHex(); - } - // Compare one point to another. - equals(other) { - assertRstPoint(other); - const { ex: X1, ey: Y1 } = this.ep; - const { ex: X2, ey: Y2 } = other.ep; - const mod = ed25519.CURVE.Fp.create; - // (x1 * y2 == y1 * x2) | (y1 * y2 == x1 * x2) - const one = mod(X1 * Y2) === mod(Y1 * X2); - const two = mod(Y1 * Y2) === mod(X1 * X2); - return one || two; - } - add(other) { - assertRstPoint(other); - return new RistPoint(this.ep.add(other.ep)); - } - subtract(other) { - assertRstPoint(other); - return new RistPoint(this.ep.subtract(other.ep)); - } - multiply(scalar) { - return new RistPoint(this.ep.multiply(scalar)); - } - multiplyUnsafe(scalar) { - return new RistPoint(this.ep.multiplyUnsafe(scalar)); - } -} -export const RistrettoPoint = /* @__PURE__ */ (() => { - if (!RistPoint.BASE) - RistPoint.BASE = new RistPoint(ed25519.ExtendedPoint.BASE); - if (!RistPoint.ZERO) - RistPoint.ZERO = new RistPoint(ed25519.ExtendedPoint.ZERO); - return RistPoint; -})(); -// Hashing to ristretto255. https://www.rfc-editor.org/rfc/rfc9380#appendix-B -export const hashToRistretto255 = (msg, options) => { - const d = options.DST; - const DST = typeof d === 'string' ? utf8ToBytes(d) : d; - const uniform_bytes = expand_message_xmd(msg, DST, 64, sha512); - const P = RistPoint.hashToCurve(uniform_bytes); - return P; -}; -export const hash_to_ristretto255 = hashToRistretto255; // legacy -//# sourceMappingURL=ed25519.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/ed25519.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/ed25519.js.map deleted file mode 100644 index 19410d9a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/ed25519.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed25519.js","sourceRoot":"","sources":["../src/ed25519.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAgB,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AACnF,OAAO,EACL,UAAU,EACV,eAAe,EACf,WAAW,EACX,UAAU,EAEV,eAAe,GAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAgB,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAG7F;;;;;GAKG;AAEH,MAAM,SAAS,GAAG,MAAM,CACtB,+EAA+E,CAChF,CAAC;AACF,iCAAiC;AACjC,MAAM,eAAe,GAAG,MAAM,CAC5B,+EAA+E,CAChF,CAAC;AAEF,kBAAkB;AAClB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAA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M,aAAa,GAAG,kBAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;IAC/D,MAAM,CAAC,GAAG,SAAS,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;IAC/C,OAAO,CAAC,CAAC;AACX,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,oBAAoB,GAAG,kBAAkB,CAAC,CAAC,SAAS"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/ed448.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/ed448.js deleted file mode 100644 index b5823712..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/ed448.js +++ /dev/null @@ -1,392 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { shake256 } from '@noble/hashes/sha3'; -import { concatBytes, randomBytes, utf8ToBytes, wrapConstructor } from '@noble/hashes/utils'; -import { twistedEdwards } from './abstract/edwards.js'; -import { mod, pow2, Field, isNegativeLE } from './abstract/modular.js'; -import { montgomery } from './abstract/montgomery.js'; -import { createHasher, expand_message_xof } from './abstract/hash-to-curve.js'; -import { bytesToHex, bytesToNumberLE, ensureBytes, equalBytes, numberToBytesLE, } from './abstract/utils.js'; -/** - * Edwards448 (not Ed448-Goldilocks) curve with following addons: - * - X448 ECDH - * - Decaf cofactor elimination - * - Elligator hash-to-group / point indistinguishability - * Conforms to RFC 8032 https://www.rfc-editor.org/rfc/rfc8032.html#section-5.2 - */ -const shake256_114 = wrapConstructor(() => shake256.create({ dkLen: 114 })); -const shake256_64 = wrapConstructor(() => shake256.create({ dkLen: 64 })); -const ed448P = BigInt('726838724295606890549323807888004534353641360687318060281490199180612328166730772686396383698676545930088884461843637361053498018365439'); -// prettier-ignore -const _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = BigInt(4), _11n = BigInt(11); -// prettier-ignore -const _22n = BigInt(22), _44n = BigInt(44), _88n = BigInt(88), _223n = BigInt(223); -// powPminus3div4 calculates z = x^k mod p, where k = (p-3)/4. -// Used for efficient square root calculation. -// ((P-3)/4).toString(2) would produce bits [223x 1, 0, 222x 1] -function ed448_pow_Pminus3div4(x) { - const P = ed448P; - const b2 = (x * x * x) % P; - const b3 = (b2 * b2 * x) % P; - const b6 = (pow2(b3, _3n, P) * b3) % P; - const b9 = (pow2(b6, _3n, P) * b3) % P; - const b11 = (pow2(b9, _2n, P) * b2) % P; - const b22 = (pow2(b11, _11n, P) * b11) % P; - const b44 = (pow2(b22, _22n, P) * b22) % P; - const b88 = (pow2(b44, _44n, P) * b44) % P; - const b176 = (pow2(b88, _88n, P) * b88) % P; - const b220 = (pow2(b176, _44n, P) * b44) % P; - const b222 = (pow2(b220, _2n, P) * b2) % P; - const b223 = (pow2(b222, _1n, P) * x) % P; - return (pow2(b223, _223n, P) * b222) % P; -} -function adjustScalarBytes(bytes) { - // Section 5: Likewise, for X448, set the two least significant bits of the first byte to 0, and the most - // significant bit of the last byte to 1. - bytes[0] &= 252; // 0b11111100 - // and the most significant bit of the last byte to 1. - bytes[55] |= 128; // 0b10000000 - // NOTE: is is NOOP for 56 bytes scalars (X25519/X448) - bytes[56] = 0; // Byte outside of group (456 buts vs 448 bits) - return bytes; -} -// Constant-time ratio of u to v. Allows to combine inversion and square root u/√v. -// Uses algo from RFC8032 5.1.3. -function uvRatio(u, v) { - const P = ed448P; - // https://www.rfc-editor.org/rfc/rfc8032#section-5.2.3 - // To compute the square root of (u/v), the first step is to compute the - // candidate root x = (u/v)^((p+1)/4). This can be done using the - // following trick, to use a single modular powering for both the - // inversion of v and the square root: - // x = (u/v)^((p+1)/4) = u³v(u⁵v³)^((p-3)/4) (mod p) - const u2v = mod(u * u * v, P); // u²v - const u3v = mod(u2v * u, P); // u³v - const u5v3 = mod(u3v * u2v * v, P); // u⁵v³ - const root = ed448_pow_Pminus3div4(u5v3); - const x = mod(u3v * root, P); - // Verify that root is exists - const x2 = mod(x * x, P); // x² - // If vx² = u, the recovered x-coordinate is x. Otherwise, no - // square root exists, and the decoding fails. - return { isValid: mod(x2 * v, P) === u, value: x }; -} -const Fp = Field(ed448P, 456, true); -const ED448_DEF = { - // Param: a - a: BigInt(1), - // -39081. Negative number is P - number - d: BigInt('726838724295606890549323807888004534353641360687318060281490199180612328166730772686396383698676545930088884461843637361053498018326358'), - // Finite field 𝔽p over which we'll do calculations; 2n**448n - 2n**224n - 1n - Fp, - // Subgroup order: how many points curve has; - // 2n**446n - 13818066809895115352007386748515426880336692474882178609894547503885n - n: BigInt('181709681073901722637330951972001133588410340171829515070372549795146003961539585716195755291692375963310293709091662304773755859649779'), - nBitLength: 456, - // Cofactor - h: BigInt(4), - // Base point (x, y) aka generator point - Gx: BigInt('224580040295924300187604334099896036246789641632564134246125461686950415467406032909029192869357953282578032075146446173674602635247710'), - Gy: BigInt('298819210078481492676017930443930673437544040154080242095928241372331506189835876003536878655418784733982303233503462500531545062832660'), - // SHAKE256(dom4(phflag,context)||x, 114) - hash: shake256_114, - randomBytes, - adjustScalarBytes, - // dom4 - domain: (data, ctx, phflag) => { - if (ctx.length > 255) - throw new Error(`Context is too big: ${ctx.length}`); - return concatBytes(utf8ToBytes('SigEd448'), new Uint8Array([phflag ? 1 : 0, ctx.length]), ctx, data); - }, - uvRatio, -}; -export const ed448 = /* @__PURE__ */ twistedEdwards(ED448_DEF); -// NOTE: there is no ed448ctx, since ed448 supports ctx by default -export const ed448ph = /* @__PURE__ */ twistedEdwards({ ...ED448_DEF, prehash: shake256_64 }); -export const x448 = /* @__PURE__ */ (() => montgomery({ - a: BigInt(156326), - montgomeryBits: 448, - nByteLength: 57, - P: ed448P, - Gu: BigInt(5), - powPminus2: (x) => { - const P = ed448P; - const Pminus3div4 = ed448_pow_Pminus3div4(x); - const Pminus3 = pow2(Pminus3div4, BigInt(2), P); - return mod(Pminus3 * x, P); // Pminus3 * x = Pminus2 - }, - adjustScalarBytes, - randomBytes, -}))(); -/** - * Converts edwards448 public key to x448 public key. Uses formula: - * * `(u, v) = ((y-1)/(y+1), sqrt(156324)*u/x)` - * * `(x, y) = (sqrt(156324)*u/v, (1+u)/(1-u))` - * @example - * const aPub = ed448.getPublicKey(utils.randomPrivateKey()); - * x448.getSharedSecret(edwardsToMontgomery(aPub), edwardsToMontgomery(someonesPub)) - */ -export function edwardsToMontgomeryPub(edwardsPub) { - const { y } = ed448.ExtendedPoint.fromHex(edwardsPub); - const _1n = BigInt(1); - return Fp.toBytes(Fp.create((y - _1n) * Fp.inv(y + _1n))); -} -export const edwardsToMontgomery = edwardsToMontgomeryPub; // deprecated -// Hash To Curve Elligator2 Map -const ELL2_C1 = (Fp.ORDER - BigInt(3)) / BigInt(4); // 1. c1 = (q - 3) / 4 # Integer arithmetic -const ELL2_J = BigInt(156326); -function map_to_curve_elligator2_curve448(u) { - let tv1 = Fp.sqr(u); // 1. tv1 = u^2 - let e1 = Fp.eql(tv1, Fp.ONE); // 2. e1 = tv1 == 1 - tv1 = Fp.cmov(tv1, Fp.ZERO, e1); // 3. tv1 = CMOV(tv1, 0, e1) # If Z * u^2 == -1, set tv1 = 0 - let xd = Fp.sub(Fp.ONE, tv1); // 4. xd = 1 - tv1 - let x1n = Fp.neg(ELL2_J); // 5. x1n = -J - let tv2 = Fp.sqr(xd); // 6. tv2 = xd^2 - let gxd = Fp.mul(tv2, xd); // 7. gxd = tv2 * xd # gxd = xd^3 - let gx1 = Fp.mul(tv1, Fp.neg(ELL2_J)); // 8. gx1 = -J * tv1 # x1n + J * xd - gx1 = Fp.mul(gx1, x1n); // 9. gx1 = gx1 * x1n # x1n^2 + J * x1n * xd - gx1 = Fp.add(gx1, tv2); // 10. gx1 = gx1 + tv2 # x1n^2 + J * x1n * xd + xd^2 - gx1 = Fp.mul(gx1, x1n); // 11. gx1 = gx1 * x1n # x1n^3 + J * x1n^2 * xd + x1n * xd^2 - let tv3 = Fp.sqr(gxd); // 12. tv3 = gxd^2 - tv2 = Fp.mul(gx1, gxd); // 13. tv2 = gx1 * gxd # gx1 * gxd - tv3 = Fp.mul(tv3, tv2); // 14. tv3 = tv3 * tv2 # gx1 * gxd^3 - let y1 = Fp.pow(tv3, ELL2_C1); // 15. y1 = tv3^c1 # (gx1 * gxd^3)^((p - 3) / 4) - y1 = Fp.mul(y1, tv2); // 16. y1 = y1 * tv2 # gx1 * gxd * (gx1 * gxd^3)^((p - 3) / 4) - let x2n = Fp.mul(x1n, Fp.neg(tv1)); // 17. x2n = -tv1 * x1n # x2 = x2n / xd = -1 * u^2 * x1n / xd - let y2 = Fp.mul(y1, u); // 18. y2 = y1 * u - y2 = Fp.cmov(y2, Fp.ZERO, e1); // 19. y2 = CMOV(y2, 0, e1) - tv2 = Fp.sqr(y1); // 20. tv2 = y1^2 - tv2 = Fp.mul(tv2, gxd); // 21. tv2 = tv2 * gxd - let e2 = Fp.eql(tv2, gx1); // 22. e2 = tv2 == gx1 - let xn = Fp.cmov(x2n, x1n, e2); // 23. xn = CMOV(x2n, x1n, e2) # If e2, x = x1, else x = x2 - let y = Fp.cmov(y2, y1, e2); // 24. y = CMOV(y2, y1, e2) # If e2, y = y1, else y = y2 - let e3 = Fp.isOdd(y); // 25. e3 = sgn0(y) == 1 # Fix sign of y - y = Fp.cmov(y, Fp.neg(y), e2 !== e3); // 26. y = CMOV(y, -y, e2 XOR e3) - return { xn, xd, yn: y, yd: Fp.ONE }; // 27. return (xn, xd, y, 1) -} -function map_to_curve_elligator2_edwards448(u) { - let { xn, xd, yn, yd } = map_to_curve_elligator2_curve448(u); // 1. (xn, xd, yn, yd) = map_to_curve_elligator2_curve448(u) - let xn2 = Fp.sqr(xn); // 2. xn2 = xn^2 - let xd2 = Fp.sqr(xd); // 3. xd2 = xd^2 - let xd4 = Fp.sqr(xd2); // 4. xd4 = xd2^2 - let yn2 = Fp.sqr(yn); // 5. yn2 = yn^2 - let yd2 = Fp.sqr(yd); // 6. yd2 = yd^2 - let xEn = Fp.sub(xn2, xd2); // 7. xEn = xn2 - xd2 - let tv2 = Fp.sub(xEn, xd2); // 8. tv2 = xEn - xd2 - xEn = Fp.mul(xEn, xd2); // 9. xEn = xEn * xd2 - xEn = Fp.mul(xEn, yd); // 10. xEn = xEn * yd - xEn = Fp.mul(xEn, yn); // 11. xEn = xEn * yn - xEn = Fp.mul(xEn, _4n); // 12. xEn = xEn * 4 - tv2 = Fp.mul(tv2, xn2); // 13. tv2 = tv2 * xn2 - tv2 = Fp.mul(tv2, yd2); // 14. tv2 = tv2 * yd2 - let tv3 = Fp.mul(yn2, _4n); // 15. tv3 = 4 * yn2 - let tv1 = Fp.add(tv3, yd2); // 16. tv1 = tv3 + yd2 - tv1 = Fp.mul(tv1, xd4); // 17. tv1 = tv1 * xd4 - let xEd = Fp.add(tv1, tv2); // 18. xEd = tv1 + tv2 - tv2 = Fp.mul(tv2, xn); // 19. tv2 = tv2 * xn - let tv4 = Fp.mul(xn, xd4); // 20. tv4 = xn * xd4 - let yEn = Fp.sub(tv3, yd2); // 21. yEn = tv3 - yd2 - yEn = Fp.mul(yEn, tv4); // 22. yEn = yEn * tv4 - yEn = Fp.sub(yEn, tv2); // 23. yEn = yEn - tv2 - tv1 = Fp.add(xn2, xd2); // 24. tv1 = xn2 + xd2 - tv1 = Fp.mul(tv1, xd2); // 25. tv1 = tv1 * xd2 - tv1 = Fp.mul(tv1, xd); // 26. tv1 = tv1 * xd - tv1 = Fp.mul(tv1, yn2); // 27. tv1 = tv1 * yn2 - tv1 = Fp.mul(tv1, BigInt(-2)); // 28. tv1 = -2 * tv1 - let yEd = Fp.add(tv2, tv1); // 29. yEd = tv2 + tv1 - tv4 = Fp.mul(tv4, yd2); // 30. tv4 = tv4 * yd2 - yEd = Fp.add(yEd, tv4); // 31. yEd = yEd + tv4 - tv1 = Fp.mul(xEd, yEd); // 32. tv1 = xEd * yEd - let e = Fp.eql(tv1, Fp.ZERO); // 33. e = tv1 == 0 - xEn = Fp.cmov(xEn, Fp.ZERO, e); // 34. xEn = CMOV(xEn, 0, e) - xEd = Fp.cmov(xEd, Fp.ONE, e); // 35. xEd = CMOV(xEd, 1, e) - yEn = Fp.cmov(yEn, Fp.ONE, e); // 36. yEn = CMOV(yEn, 1, e) - yEd = Fp.cmov(yEd, Fp.ONE, e); // 37. yEd = CMOV(yEd, 1, e) - const inv = Fp.invertBatch([xEd, yEd]); // batch division - return { x: Fp.mul(xEn, inv[0]), y: Fp.mul(yEn, inv[1]) }; // 38. return (xEn, xEd, yEn, yEd) -} -const htf = /* @__PURE__ */ (() => createHasher(ed448.ExtendedPoint, (scalars) => map_to_curve_elligator2_edwards448(scalars[0]), { - DST: 'edwards448_XOF:SHAKE256_ELL2_RO_', - encodeDST: 'edwards448_XOF:SHAKE256_ELL2_NU_', - p: Fp.ORDER, - m: 1, - k: 224, - expand: 'xof', - hash: shake256, -}))(); -export const hashToCurve = /* @__PURE__ */ (() => htf.hashToCurve)(); -export const encodeToCurve = /* @__PURE__ */ (() => htf.encodeToCurve)(); -function assertDcfPoint(other) { - if (!(other instanceof DcfPoint)) - throw new Error('DecafPoint expected'); -} -// 1-d -const ONE_MINUS_D = BigInt('39082'); -// 1-2d -const ONE_MINUS_TWO_D = BigInt('78163'); -// √(-d) -const SQRT_MINUS_D = BigInt('98944233647732219769177004876929019128417576295529901074099889598043702116001257856802131563896515373927712232092845883226922417596214'); -// 1 / √(-d) -const INVSQRT_MINUS_D = BigInt('315019913931389607337177038330951043522456072897266928557328499619017160722351061360252776265186336876723201881398623946864393857820716'); -// Calculates 1/√(number) -const invertSqrt = (number) => uvRatio(_1n, number); -const MAX_448B = BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'); -const bytes448ToNumberLE = (bytes) => ed448.CURVE.Fp.create(bytesToNumberLE(bytes) & MAX_448B); -// Computes Elligator map for Decaf -// https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-ristretto255-decaf448-07#name-element-derivation-2 -function calcElligatorDecafMap(r0) { - const { d } = ed448.CURVE; - const P = ed448.CURVE.Fp.ORDER; - const mod = ed448.CURVE.Fp.create; - const r = mod(-(r0 * r0)); // 1 - const u0 = mod(d * (r - _1n)); // 2 - const u1 = mod((u0 + _1n) * (u0 - r)); // 3 - const { isValid: was_square, value: v } = uvRatio(ONE_MINUS_TWO_D, mod((r + _1n) * u1)); // 4 - let v_prime = v; // 5 - if (!was_square) - v_prime = mod(r0 * v); - let sgn = _1n; // 6 - if (!was_square) - sgn = mod(-_1n); - const s = mod(v_prime * (r + _1n)); // 7 - let s_abs = s; - if (isNegativeLE(s, P)) - s_abs = mod(-s); - const s2 = s * s; - const W0 = mod(s_abs * _2n); // 8 - const W1 = mod(s2 + _1n); // 9 - const W2 = mod(s2 - _1n); // 10 - const W3 = mod(v_prime * s * (r - _1n) * ONE_MINUS_TWO_D + sgn); // 11 - return new ed448.ExtendedPoint(mod(W0 * W3), mod(W2 * W1), mod(W1 * W3), mod(W0 * W2)); -} -/** - * Each ed448/ExtendedPoint has 4 different equivalent points. This can be - * a source of bugs for protocols like ring signatures. Decaf was created to solve this. - * Decaf point operates in X:Y:Z:T extended coordinates like ExtendedPoint, - * but it should work in its own namespace: do not combine those two. - * https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-ristretto255-decaf448 - */ -class DcfPoint { - // Private property to discourage combining ExtendedPoint + DecafPoint - // Always use Decaf encoding/decoding instead. - constructor(ep) { - this.ep = ep; - } - static fromAffine(ap) { - return new DcfPoint(ed448.ExtendedPoint.fromAffine(ap)); - } - /** - * Takes uniform output of 112-byte hash function like shake256 and converts it to `DecafPoint`. - * The hash-to-group operation applies Elligator twice and adds the results. - * **Note:** this is one-way map, there is no conversion from point to hash. - * https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-ristretto255-decaf448-07#name-element-derivation-2 - * @param hex 112-byte output of a hash function - */ - static hashToCurve(hex) { - hex = ensureBytes('decafHash', hex, 112); - const r1 = bytes448ToNumberLE(hex.slice(0, 56)); - const R1 = calcElligatorDecafMap(r1); - const r2 = bytes448ToNumberLE(hex.slice(56, 112)); - const R2 = calcElligatorDecafMap(r2); - return new DcfPoint(R1.add(R2)); - } - /** - * Converts decaf-encoded string to decaf point. - * https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-ristretto255-decaf448-07#name-decode-2 - * @param hex Decaf-encoded 56 bytes. Not every 56-byte string is valid decaf encoding - */ - static fromHex(hex) { - hex = ensureBytes('decafHex', hex, 56); - const { d } = ed448.CURVE; - const P = ed448.CURVE.Fp.ORDER; - const mod = ed448.CURVE.Fp.create; - const emsg = 'DecafPoint.fromHex: the hex is not valid encoding of DecafPoint'; - const s = bytes448ToNumberLE(hex); - // 1. Check that s_bytes is the canonical encoding of a field element, or else abort. - // 2. Check that s is non-negative, or else abort - if (!equalBytes(numberToBytesLE(s, 56), hex) || isNegativeLE(s, P)) - throw new Error(emsg); - const s2 = mod(s * s); // 1 - const u1 = mod(_1n + s2); // 2 - const u1sq = mod(u1 * u1); - const u2 = mod(u1sq - _4n * d * s2); // 3 - const { isValid, value: invsqrt } = invertSqrt(mod(u2 * u1sq)); // 4 - let u3 = mod((s + s) * invsqrt * u1 * SQRT_MINUS_D); // 5 - if (isNegativeLE(u3, P)) - u3 = mod(-u3); - const x = mod(u3 * invsqrt * u2 * INVSQRT_MINUS_D); // 6 - const y = mod((_1n - s2) * invsqrt * u1); // 7 - const t = mod(x * y); // 8 - if (!isValid) - throw new Error(emsg); - return new DcfPoint(new ed448.ExtendedPoint(x, y, _1n, t)); - } - /** - * Encodes decaf point to Uint8Array. - * https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-ristretto255-decaf448-07#name-encode-2 - */ - toRawBytes() { - let { ex: x, ey: _y, ez: z, et: t } = this.ep; - const P = ed448.CURVE.Fp.ORDER; - const mod = ed448.CURVE.Fp.create; - const u1 = mod(mod(x + t) * mod(x - t)); // 1 - const x2 = mod(x * x); - const { value: invsqrt } = invertSqrt(mod(u1 * ONE_MINUS_D * x2)); // 2 - let ratio = mod(invsqrt * u1 * SQRT_MINUS_D); // 3 - if (isNegativeLE(ratio, P)) - ratio = mod(-ratio); - const u2 = mod(INVSQRT_MINUS_D * ratio * z - t); // 4 - let s = mod(ONE_MINUS_D * invsqrt * x * u2); // 5 - if (isNegativeLE(s, P)) - s = mod(-s); - return numberToBytesLE(s, 56); - } - toHex() { - return bytesToHex(this.toRawBytes()); - } - toString() { - return this.toHex(); - } - // Compare one point to another. - // https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-ristretto255-decaf448-07#name-equals-2 - equals(other) { - assertDcfPoint(other); - const { ex: X1, ey: Y1 } = this.ep; - const { ex: X2, ey: Y2 } = other.ep; - const mod = ed448.CURVE.Fp.create; - // (x1 * y2 == y1 * x2) - return mod(X1 * Y2) === mod(Y1 * X2); - } - add(other) { - assertDcfPoint(other); - return new DcfPoint(this.ep.add(other.ep)); - } - subtract(other) { - assertDcfPoint(other); - return new DcfPoint(this.ep.subtract(other.ep)); - } - multiply(scalar) { - return new DcfPoint(this.ep.multiply(scalar)); - } - multiplyUnsafe(scalar) { - return new DcfPoint(this.ep.multiplyUnsafe(scalar)); - } -} -export const DecafPoint = /* @__PURE__ */ (() => { - // decaf448 base point is ed448 base x 2 - // https://github.com/dalek-cryptography/curve25519-dalek/blob/59837c6ecff02b77b9d5ff84dbc239d0cf33ef90/vendor/ristretto.sage#L699 - if (!DcfPoint.BASE) - DcfPoint.BASE = new DcfPoint(ed448.ExtendedPoint.BASE).multiply(_2n); - if (!DcfPoint.ZERO) - DcfPoint.ZERO = new DcfPoint(ed448.ExtendedPoint.ZERO); - return DcfPoint; -})(); -// Hashing to decaf448. https://www.rfc-editor.org/rfc/rfc9380#appendix-C -export const hashToDecaf448 = (msg, options) => { - const d = options.DST; - const DST = typeof d === 'string' ? utf8ToBytes(d) : d; - const uniform_bytes = expand_message_xof(msg, DST, 112, 224, shake256); - const P = DcfPoint.hashToCurve(uniform_bytes); - return P; -}; -export const hash_to_decaf448 = hashToDecaf448; // legacy -//# sourceMappingURL=ed448.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/ed448.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/ed448.js.map deleted file mode 100644 index 833317b6..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/ed448.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed448.js","sourceRoot":"","sources":["../src/ed448.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC7F,OAAO,EAAgB,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,YAAY,EAAgB,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAC7F,OAAO,EACL,UAAU,EACV,eAAe,EACf,WAAW,EACX,UAAU,EAEV,eAAe,GAChB,MAAM,qBAAqB,CAAC;AAG7B;;;;;;GAMG;AAEH,MAAM,YAAY,GAAG,eAAe,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;AAC5E,MAAM,WAAW,GAAG,eAAe,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;AAC1E,MAAM,MAAM,GAAG,MAAM,CACnB,yIAAyI,CAC1I,CAAC;AAEF,kBAAkB;AAClB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,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C;IACtB,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACvD,MAAM,aAAa,GAAG,kBAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;IACvE,MAAM,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;IAC9C,OAAO,CAAC,CAAC;AACX,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,gBAAgB,GAAG,cAAc,CAAC,CAAC,SAAS"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/index.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/index.js deleted file mode 100644 index ac4f2231..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/index.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -throw new Error('Incorrect usage. Import submodules instead'); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/index.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/index.js.map deleted file mode 100644 index b5117dcd..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/jubjub.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/jubjub.js deleted file mode 100644 index 1f2cc8ed..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/jubjub.js +++ /dev/null @@ -1,54 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { sha512 } from '@noble/hashes/sha512'; -import { concatBytes, randomBytes, utf8ToBytes } from '@noble/hashes/utils'; -import { twistedEdwards } from './abstract/edwards.js'; -import { blake2s } from '@noble/hashes/blake2s'; -import { Field } from './abstract/modular.js'; -/** - * jubjub Twisted Edwards curve. - * https://neuromancer.sk/std/other/JubJub - * jubjub does not use EdDSA, so `hash`/sha512 params are passed because interface expects them. - */ -export const jubjub = /* @__PURE__ */ twistedEdwards({ - // Params: a, d - a: BigInt('0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000000'), - d: BigInt('0x2a9318e74bfa2b48f5fd9207e6bd7fd4292d7f6d37579d2601065fd6d6343eb1'), - // Finite field 𝔽p over which we'll do calculations - // Same value as bls12-381 Fr (not Fp) - Fp: Field(BigInt('0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001')), - // Subgroup order: how many points curve has - n: BigInt('0xe7db4ea6533afa906673b0101343b00a6682093ccc81082d0970e5ed6f72cb7'), - // Cofactor - h: BigInt(8), - // Base point (x, y) aka generator point - Gx: BigInt('0x11dafe5d23e1218086a365b99fbf3d3be72f6afd7d1f72623e6b071492d1122b'), - Gy: BigInt('0x1d523cf1ddab1a1793132e78c866c0c33e26ba5cc220fed7cc3f870e59d292aa'), - hash: sha512, - randomBytes, -}); -const GH_FIRST_BLOCK = utf8ToBytes('096b36a5804bfacef1691e173c366a47ff5ba84a44f26ddd7e8d9f79d5b42df0'); -// Returns point at JubJub curve which is prime order and not zero -export function groupHash(tag, personalization) { - const h = blake2s.create({ personalization, dkLen: 32 }); - h.update(GH_FIRST_BLOCK); - h.update(tag); - // NOTE: returns ExtendedPoint, in case it will be multiplied later - let p = jubjub.ExtendedPoint.fromHex(h.digest()); - // NOTE: cannot replace with isSmallOrder, returns Point*8 - p = p.multiply(jubjub.CURVE.h); - if (p.equals(jubjub.ExtendedPoint.ZERO)) - throw new Error('Point has small order'); - return p; -} -export function findGroupHash(m, personalization) { - const tag = concatBytes(m, new Uint8Array([0])); - for (let i = 0; i < 256; i++) { - tag[tag.length - 1] = i; - try { - return groupHash(tag, personalization); - } - catch (e) { } - } - throw new Error('findGroupHash tag overflow'); -} -//# sourceMappingURL=jubjub.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/jubjub.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/jubjub.js.map deleted file mode 100644 index e89b5c48..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/jubjub.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"jubjub.js","sourceRoot":"","sources":["../src/jubjub.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE9C;;;;GAIG;AAEH,MAAM,CAAC,MAAM,MAAM,GAAG,eAAe,CAAC,cAAc,CAAC;IACnD,eAAe;IACf,CAAC,EAAE,MAAM,CAAC,oEAAoE,CAAC;IAC/E,CAAC,EAAE,MAAM,CAAC,oEAAoE,CAAC;IAC/E,oDAAoD;IACpD,sCAAsC;IACtC,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC,oEAAoE,CAAC,CAAC;IACvF,4CAA4C;IAC5C,CAAC,EAAE,MAAM,CAAC,mEAAmE,CAAC;IAC9E,WAAW;IACX,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,wCAAwC;IACxC,EAAE,EAAE,MAAM,CAAC,oEAAoE,CAAC;IAChF,E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AAC,CAAC;AAChD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/p256.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/p256.js deleted file mode 100644 index 5e2e89e1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/p256.js +++ /dev/null @@ -1,42 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { createCurve } from './_shortw_utils.js'; -import { sha256 } from '@noble/hashes/sha256'; -import { Field } from './abstract/modular.js'; -import { mapToCurveSimpleSWU } from './abstract/weierstrass.js'; -import { createHasher } from './abstract/hash-to-curve.js'; -// NIST secp256r1 aka p256 -// https://www.secg.org/sec2-v2.pdf, https://neuromancer.sk/std/nist/P-256 -const Fp = Field(BigInt('0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff')); -const CURVE_A = Fp.create(BigInt('-3')); -const CURVE_B = BigInt('0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b'); -// prettier-ignore -export const p256 = createCurve({ - a: CURVE_A, - b: CURVE_B, - Fp, - // Curve order, total count of valid points in the field - n: BigInt('0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551'), - // Base (generator) point (x, y) - Gx: BigInt('0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296'), - Gy: BigInt('0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5'), - h: BigInt(1), - lowS: false, -}, sha256); -export const secp256r1 = p256; -const mapSWU = /* @__PURE__ */ (() => mapToCurveSimpleSWU(Fp, { - A: CURVE_A, - B: CURVE_B, - Z: Fp.create(BigInt('-10')), -}))(); -const htf = /* @__PURE__ */ (() => createHasher(secp256r1.ProjectivePoint, (scalars) => mapSWU(scalars[0]), { - DST: 'P256_XMD:SHA-256_SSWU_RO_', - encodeDST: 'P256_XMD:SHA-256_SSWU_NU_', - p: Fp.ORDER, - m: 1, - k: 128, - expand: 'xmd', - hash: sha256, -}))(); -export const hashToCurve = /* @__PURE__ */ (() => htf.hashToCurve)(); -export const encodeToCurve = /* @__PURE__ */ (() => htf.encodeToCurve)(); -//# sourceMappingURL=p256.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/p256.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/p256.js.map deleted file mode 100644 index 1efec390..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/p256.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"p256.js","sourceRoot":"","sources":["../src/p256.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,0BAA0B;AAC1B,0EAA0E;AAE1E,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,oEAAoE,CAAC,CAAC,CAAC;AAC/F,MAAM,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AACxC,MAAM,OAAO,GAAG,MAAM,CAAC,oEAAoE,CAAC,CAAC;AAE7F,kBAAkB;AAClB,MAAM,CAAC,MAAM,IAAI,GAAG,WAAW,CAAC;IAC9B,CAAC,EAAE,OAAO;IACV,CAAC,EAAE,OAAO;IACV,EAAE;IACF,wDAAwD;IACxD,CAAC,EAAE,MAAM,CAAC,oEAAoE,CAAC;IAC/E,gCAAgC;IAChC,EAAE,EAAE,MAAM,CAAC,oEAAoE,CAAC;IAChF,EAAE,EAAE,MAAM,CAAC,oEAAoE,CAAC;IAChF,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,IAAI,EAAE,KAAK;CACH,EAAE,MAAM,CAAC,CAAC;AACpB,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,CAAC;AAE9B,MAAM,MAAM,GAAG,eAAe,CAAC,CAAC,GAAG,EAAE,CACnC,mBAAmB,CAAC,EAAE,EAAE;IACtB,CAAC,EAAE,OAAO;IACV,CAAC,EAAE,OAAO;IACV,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;CAC5B,CAAC,CAAC,EAAE,CAAC;AAER,MAAM,GAAG,GAAG,eAAe,CAAC,CAAC,GAAG,EAAE,CAChC,YAAY,CAAC,SAAS,CAAC,eAAe,EAAE,CAAC,OAAiB,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE;IACjF,GAAG,EAAE,2BAA2B;IAChC,SAAS,EAAE,2BAA2B;IACtC,CAAC,EAAE,EAAE,CAAC,KAAK;IACX,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,GAAG;IACN,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,MAAM;CACb,CAAC,CAAC,EAAE,CAAC;AACR,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;AACrE,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/p384.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/p384.js deleted file mode 100644 index 21d9308b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/p384.js +++ /dev/null @@ -1,46 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { createCurve } from './_shortw_utils.js'; -import { sha384 } from '@noble/hashes/sha512'; -import { Field } from './abstract/modular.js'; -import { mapToCurveSimpleSWU } from './abstract/weierstrass.js'; -import { createHasher } from './abstract/hash-to-curve.js'; -// NIST secp384r1 aka p384 -// https://www.secg.org/sec2-v2.pdf, https://neuromancer.sk/std/nist/P-384 -// Field over which we'll do calculations. -// prettier-ignore -const P = BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff'); -const Fp = Field(P); -const CURVE_A = Fp.create(BigInt('-3')); -// prettier-ignore -const CURVE_B = BigInt('0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef'); -// prettier-ignore -export const p384 = createCurve({ - a: CURVE_A, - b: CURVE_B, - Fp, - // Curve order, total count of valid points in the field. - n: BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973'), - // Base (generator) point (x, y) - Gx: BigInt('0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7'), - Gy: BigInt('0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f'), - h: BigInt(1), - lowS: false, -}, sha384); -export const secp384r1 = p384; -const mapSWU = /* @__PURE__ */ (() => mapToCurveSimpleSWU(Fp, { - A: CURVE_A, - B: CURVE_B, - Z: Fp.create(BigInt('-12')), -}))(); -const htf = /* @__PURE__ */ (() => createHasher(secp384r1.ProjectivePoint, (scalars) => mapSWU(scalars[0]), { - DST: 'P384_XMD:SHA-384_SSWU_RO_', - encodeDST: 'P384_XMD:SHA-384_SSWU_NU_', - p: Fp.ORDER, - m: 1, - k: 192, - expand: 'xmd', - hash: sha384, -}))(); -export const hashToCurve = /* @__PURE__ */ (() => htf.hashToCurve)(); -export const encodeToCurve = /* @__PURE__ */ (() => htf.encodeToCurve)(); -//# sourceMappingURL=p384.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/p384.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/p384.js.map deleted file mode 100644 index bf8b8eda..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/p384.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"p384.js","sourceRoot":"","sources":["../src/p384.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,0BAA0B;AAC1B,0EAA0E;AAE1E,0CAA0C;AAC1C,kBAAkB;AAClB,MAAM,CAAC,GAAG,MAAM,CAAC,oGAAoG,CAAC,CAAC;AACvH,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AACpB,MAAM,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AACxC,kBAAkB;AAClB,MAAM,OAAO,GAAG,MAAM,CAAC,oGAAoG,CAAC,CAAC;AAE7H,kBAAkB;AAClB,MAAM,CAAC,MAAM,IAAI,GAAG,WAAW,CAAC;IAC9B,CAAC,EAAE,OAAO;IACV,CAAC,EAAE,OAAO;IACV,EAAE;IACF,yDAAyD;IACzD,CAAC,EAAE,MAAM,CAAC,oGAAoG,CAAC;IAC/G,gCAAgC;IAChC,EAAE,EAAE,MAAM,CAAC,oGAAoG,CAAC;IAChH,EAAE,EAAE,MAAM,CAAC,oGAAoG,CAAC;IAChH,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,IAAI,EAAE,KAAK;CACH,EAAE,MAAM,CAAC,CAAC;AACpB,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,CAAC;AAE9B,MAAM,MAAM,GAAG,eAAe,CAAC,CAAC,GAAG,EAAE,CACnC,mBAAmB,CAAC,EAAE,EAAE;IACtB,CAAC,EAAE,OAAO;IACV,CAAC,EAAE,OAAO;IACV,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;CAC5B,CAAC,CAAC,EAAE,CAAC;AAER,MAAM,GAAG,GAAG,eAAe,CAAC,CAAC,GAAG,EAAE,CAChC,YAAY,CAAC,SAAS,CAAC,eAAe,EAAE,CAAC,OAAiB,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE;IACjF,GAAG,EAAE,2BAA2B;IAChC,SAAS,EAAE,2BAA2B;IACtC,CAAC,EAAE,EAAE,CAAC,KAAK;IACX,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,GAAG;IACN,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,MAAM;CACb,CAAC,CAAC,EAAE,CAAC;AACR,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;AACrE,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/p521.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/p521.js deleted file mode 100644 index 0131155b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/p521.js +++ /dev/null @@ -1,53 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { createCurve } from './_shortw_utils.js'; -import { sha512 } from '@noble/hashes/sha512'; -import { Field } from './abstract/modular.js'; -import { mapToCurveSimpleSWU } from './abstract/weierstrass.js'; -import { createHasher } from './abstract/hash-to-curve.js'; -// NIST secp521r1 aka p521 -// Note that it's 521, which differs from 512 of its hash function. -// https://www.secg.org/sec2-v2.pdf, https://neuromancer.sk/std/nist/P-521 -// Field over which we'll do calculations. -// prettier-ignore -const P = BigInt('0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'); -const Fp = Field(P); -const CURVE = { - a: Fp.create(BigInt('-3')), - b: BigInt('0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00'), - Fp, - n: BigInt('0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409'), - Gx: BigInt('0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66'), - Gy: BigInt('0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650'), - h: BigInt(1), -}; -// prettier-ignore -export const p521 = createCurve({ - a: CURVE.a, - b: CURVE.b, - Fp, - // Curve order, total count of valid points in the field - n: CURVE.n, - Gx: CURVE.Gx, - Gy: CURVE.Gy, - h: CURVE.h, - lowS: false, - allowedPrivateKeyLengths: [130, 131, 132] // P521 keys are variable-length. Normalize to 132b -}, sha512); -export const secp521r1 = p521; -const mapSWU = /* @__PURE__ */ (() => mapToCurveSimpleSWU(Fp, { - A: CURVE.a, - B: CURVE.b, - Z: Fp.create(BigInt('-4')), -}))(); -const htf = /* @__PURE__ */ (() => createHasher(secp521r1.ProjectivePoint, (scalars) => mapSWU(scalars[0]), { - DST: 'P521_XMD:SHA-512_SSWU_RO_', - encodeDST: 'P521_XMD:SHA-512_SSWU_NU_', - p: Fp.ORDER, - m: 1, - k: 256, - expand: 'xmd', - hash: sha512, -}))(); -export const hashToCurve = /* @__PURE__ */ (() => htf.hashToCurve)(); -export const encodeToCurve = /* @__PURE__ */ (() => htf.encodeToCurve)(); -//# sourceMappingURL=p521.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/p521.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/p521.js.map deleted file mode 100644 index cd24eb59..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/p521.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"p521.js","sourceRoot":"","sources":["../src/p521.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,0BAA0B;AAC1B,mEAAmE;AACnE,0EAA0E;AAE1E,0CAA0C;AAC1C,kBAAkB;AAClB,MAAM,CAAC,GAAG,MAAM,CAAC,uIAAuI,CAAC,CAAC;AAC1J,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AAEpB,MAAM,KAAK,GAAG;IACZ,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC,EAAE,MAAM,CACP,wIAAwI,CACzI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E,GAAG;IACN,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,MAAM;CACb,CAAC,CAAC,EAAE,CAAC;AACR,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;AACrE,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/package.json b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/package.json deleted file mode 100644 index 7f1fc33d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "type": "module", - "sideEffects": false -} diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/pasta.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/pasta.js deleted file mode 100644 index fa5ca528..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/pasta.js +++ /dev/null @@ -1,30 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { sha256 } from '@noble/hashes/sha256'; -import { weierstrass } from './abstract/weierstrass.js'; -import { getHash } from './_shortw_utils.js'; -import * as mod from './abstract/modular.js'; -export const p = BigInt('0x40000000000000000000000000000000224698fc094cf91b992d30ed00000001'); -export const q = BigInt('0x40000000000000000000000000000000224698fc0994a8dd8c46eb2100000001'); -// https://neuromancer.sk/std/other/Pallas -export const pallas = weierstrass({ - a: BigInt(0), - b: BigInt(5), - Fp: mod.Field(p), - n: q, - Gx: mod.mod(BigInt(-1), p), - Gy: BigInt(2), - h: BigInt(1), - ...getHash(sha256), -}); -// https://neuromancer.sk/std/other/Vesta -export const vesta = weierstrass({ - a: BigInt(0), - b: BigInt(5), - Fp: mod.Field(q), - n: p, - Gx: mod.mod(BigInt(-1), q), - Gy: BigInt(2), - h: BigInt(1), - ...getHash(sha256), -}); -//# sourceMappingURL=pasta.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/pasta.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/pasta.js.map deleted file mode 100644 index 4942dd2e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/pasta.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pasta.js","sourceRoot":"","sources":["../src/pasta.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAE7C,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,oEAAoE,CAAC,CAAC;AAC9F,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,oEAAoE,CAAC,CAAC;AAE9F,0CAA0C;AAC1C,MAAM,CAAC,MAAM,MAAM,GAAG,WAAW,CAAC;IAChC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,EAAE,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;IAChB,CAAC,EAAE,CAAC;IACJ,EAAE,EAAE,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAC1B,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;IACb,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,GAAG,OAAO,CAAC,MAAM,CAAC;CACnB,CAAC,CAAC;AACH,yCAAyC;AACzC,MAAM,CAAC,MAAM,KAAK,GAAG,WAAW,CAAC;IAC/B,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,EAAE,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;IAChB,CAAC,EAAE,CAAC;IACJ,EAAE,EAAE,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAC1B,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;IACb,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,GAAG,OAAO,CAAC,MAAM,CAAC;CACnB,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/secp256k1.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/secp256k1.js deleted file mode 100644 index eb36ebc7..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/secp256k1.js +++ /dev/null @@ -1,254 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { sha256 } from '@noble/hashes/sha256'; -import { randomBytes } from '@noble/hashes/utils'; -import { Field, mod, pow2 } from './abstract/modular.js'; -import { mapToCurveSimpleSWU } from './abstract/weierstrass.js'; -import { bytesToNumberBE, concatBytes, ensureBytes, numberToBytesBE } from './abstract/utils.js'; -import { createHasher, isogenyMap } from './abstract/hash-to-curve.js'; -import { createCurve } from './_shortw_utils.js'; -const secp256k1P = BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f'); -const secp256k1N = BigInt('0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141'); -const _1n = BigInt(1); -const _2n = BigInt(2); -const divNearest = (a, b) => (a + b / _2n) / b; -/** - * √n = n^((p+1)/4) for fields p = 3 mod 4. We unwrap the loop and multiply bit-by-bit. - * (P+1n/4n).toString(2) would produce bits [223x 1, 0, 22x 1, 4x 0, 11, 00] - */ -function sqrtMod(y) { - const P = secp256k1P; - // prettier-ignore - const _3n = BigInt(3), _6n = BigInt(6), _11n = BigInt(11), _22n = BigInt(22); - // prettier-ignore - const _23n = BigInt(23), _44n = BigInt(44), _88n = BigInt(88); - const b2 = (y * y * y) % P; // x^3, 11 - const b3 = (b2 * b2 * y) % P; // x^7 - const b6 = (pow2(b3, _3n, P) * b3) % P; - const b9 = (pow2(b6, _3n, P) * b3) % P; - const b11 = (pow2(b9, _2n, P) * b2) % P; - const b22 = (pow2(b11, _11n, P) * b11) % P; - const b44 = (pow2(b22, _22n, P) * b22) % P; - const b88 = (pow2(b44, _44n, P) * b44) % P; - const b176 = (pow2(b88, _88n, P) * b88) % P; - const b220 = (pow2(b176, _44n, P) * b44) % P; - const b223 = (pow2(b220, _3n, P) * b3) % P; - const t1 = (pow2(b223, _23n, P) * b22) % P; - const t2 = (pow2(t1, _6n, P) * b2) % P; - const root = pow2(t2, _2n, P); - if (!Fp.eql(Fp.sqr(root), y)) - throw new Error('Cannot find square root'); - return root; -} -const Fp = Field(secp256k1P, undefined, undefined, { sqrt: sqrtMod }); -export const secp256k1 = createCurve({ - a: BigInt(0), - b: BigInt(7), - Fp, - n: secp256k1N, - // Base point (x, y) aka generator point - Gx: BigInt('55066263022277343669578718895168534326250603453777594175500187360389116729240'), - Gy: BigInt('32670510020758816978083085130507043184471273380659243275938904335757337482424'), - h: BigInt(1), - lowS: true, - /** - * secp256k1 belongs to Koblitz curves: it has efficiently computable endomorphism. - * Endomorphism uses 2x less RAM, speeds up precomputation by 2x and ECDH / key recovery by 20%. - * For precomputed wNAF it trades off 1/2 init time & 1/3 ram for 20% perf hit. - * Explanation: https://gist.github.com/paulmillr/eb670806793e84df628a7c434a873066 - */ - endo: { - beta: BigInt('0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee'), - splitScalar: (k) => { - const n = secp256k1N; - const a1 = BigInt('0x3086d221a7d46bcde86c90e49284eb15'); - const b1 = -_1n * BigInt('0xe4437ed6010e88286f547fa90abfe4c3'); - const a2 = BigInt('0x114ca50f7a8e2f3f657c1108d9d44cfd8'); - const b2 = a1; - const POW_2_128 = BigInt('0x100000000000000000000000000000000'); // (2n**128n).toString(16) - const c1 = divNearest(b2 * k, n); - const c2 = divNearest(-b1 * k, n); - let k1 = mod(k - c1 * a1 - c2 * a2, n); - let k2 = mod(-c1 * b1 - c2 * b2, n); - const k1neg = k1 > POW_2_128; - const k2neg = k2 > POW_2_128; - if (k1neg) - k1 = n - k1; - if (k2neg) - k2 = n - k2; - if (k1 > POW_2_128 || k2 > POW_2_128) { - throw new Error('splitScalar: Endomorphism failed, k=' + k); - } - return { k1neg, k1, k2neg, k2 }; - }, - }, -}, sha256); -// Schnorr signatures are superior to ECDSA from above. Below is Schnorr-specific BIP0340 code. -// https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki -const _0n = BigInt(0); -const fe = (x) => typeof x === 'bigint' && _0n < x && x < secp256k1P; -const ge = (x) => typeof x === 'bigint' && _0n < x && x < secp256k1N; -/** An object mapping tags to their tagged hash prefix of [SHA256(tag) | SHA256(tag)] */ -const TAGGED_HASH_PREFIXES = {}; -function taggedHash(tag, ...messages) { - let tagP = TAGGED_HASH_PREFIXES[tag]; - if (tagP === undefined) { - const tagH = sha256(Uint8Array.from(tag, (c) => c.charCodeAt(0))); - tagP = concatBytes(tagH, tagH); - TAGGED_HASH_PREFIXES[tag] = tagP; - } - return sha256(concatBytes(tagP, ...messages)); -} -// ECDSA compact points are 33-byte. Schnorr is 32: we strip first byte 0x02 or 0x03 -const pointToBytes = (point) => point.toRawBytes(true).slice(1); -const numTo32b = (n) => numberToBytesBE(n, 32); -const modP = (x) => mod(x, secp256k1P); -const modN = (x) => mod(x, secp256k1N); -const Point = secp256k1.ProjectivePoint; -const GmulAdd = (Q, a, b) => Point.BASE.multiplyAndAddUnsafe(Q, a, b); -// Calculate point, scalar and bytes -function schnorrGetExtPubKey(priv) { - let d_ = secp256k1.utils.normPrivateKeyToScalar(priv); // same method executed in fromPrivateKey - let p = Point.fromPrivateKey(d_); // P = d'⋅G; 0 < d' < n check is done inside - const scalar = p.hasEvenY() ? d_ : modN(-d_); - return { scalar: scalar, bytes: pointToBytes(p) }; -} -/** - * lift_x from BIP340. Convert 32-byte x coordinate to elliptic curve point. - * @returns valid point checked for being on-curve - */ -function lift_x(x) { - if (!fe(x)) - throw new Error('bad x: need 0 < x < p'); // Fail if x ≥ p. - const xx = modP(x * x); - const c = modP(xx * x + BigInt(7)); // Let c = x³ + 7 mod p. - let y = sqrtMod(c); // Let y = c^(p+1)/4 mod p. - if (y % _2n !== _0n) - y = modP(-y); // Return the unique point P such that x(P) = x and - const p = new Point(x, y, _1n); // y(P) = y if y mod 2 = 0 or y(P) = p-y otherwise. - p.assertValidity(); - return p; -} -/** - * Create tagged hash, convert it to bigint, reduce modulo-n. - */ -function challenge(...args) { - return modN(bytesToNumberBE(taggedHash('BIP0340/challenge', ...args))); -} -/** - * Schnorr public key is just `x` coordinate of Point as per BIP340. - */ -function schnorrGetPublicKey(privateKey) { - return schnorrGetExtPubKey(privateKey).bytes; // d'=int(sk). Fail if d'=0 or d'≥n. Ret bytes(d'⋅G) -} -/** - * Creates Schnorr signature as per BIP340. Verifies itself before returning anything. - * auxRand is optional and is not the sole source of k generation: bad CSPRNG won't be dangerous. - */ -function schnorrSign(message, privateKey, auxRand = randomBytes(32)) { - const m = ensureBytes('message', message); - const { bytes: px, scalar: d } = schnorrGetExtPubKey(privateKey); // checks for isWithinCurveOrder - const a = ensureBytes('auxRand', auxRand, 32); // Auxiliary random data a: a 32-byte array - const t = numTo32b(d ^ bytesToNumberBE(taggedHash('BIP0340/aux', a))); // Let t be the byte-wise xor of bytes(d) and hash/aux(a) - const rand = taggedHash('BIP0340/nonce', t, px, m); // Let rand = hash/nonce(t || bytes(P) || m) - const k_ = modN(bytesToNumberBE(rand)); // Let k' = int(rand) mod n - if (k_ === _0n) - throw new Error('sign failed: k is zero'); // Fail if k' = 0. - const { bytes: rx, scalar: k } = schnorrGetExtPubKey(k_); // Let R = k'⋅G. - const e = challenge(rx, px, m); // Let e = int(hash/challenge(bytes(R) || bytes(P) || m)) mod n. - const sig = new Uint8Array(64); // Let sig = bytes(R) || bytes((k + ed) mod n). - sig.set(rx, 0); - sig.set(numTo32b(modN(k + e * d)), 32); - // If Verify(bytes(P), m, sig) (see below) returns failure, abort - if (!schnorrVerify(sig, m, px)) - throw new Error('sign: Invalid signature produced'); - return sig; -} -/** - * Verifies Schnorr signature. - * Will swallow errors & return false except for initial type validation of arguments. - */ -function schnorrVerify(signature, message, publicKey) { - const sig = ensureBytes('signature', signature, 64); - const m = ensureBytes('message', message); - const pub = ensureBytes('publicKey', publicKey, 32); - try { - const P = lift_x(bytesToNumberBE(pub)); // P = lift_x(int(pk)); fail if that fails - const r = bytesToNumberBE(sig.subarray(0, 32)); // Let r = int(sig[0:32]); fail if r ≥ p. - if (!fe(r)) - return false; - const s = bytesToNumberBE(sig.subarray(32, 64)); // Let s = int(sig[32:64]); fail if s ≥ n. - if (!ge(s)) - return false; - const e = challenge(numTo32b(r), pointToBytes(P), m); // int(challenge(bytes(r)||bytes(P)||m))%n - const R = GmulAdd(P, s, modN(-e)); // R = s⋅G - e⋅P - if (!R || !R.hasEvenY() || R.toAffine().x !== r) - return false; // -eP == (n-e)P - return true; // Fail if is_infinite(R) / not has_even_y(R) / x(R) ≠ r. - } - catch (error) { - return false; - } -} -export const schnorr = /* @__PURE__ */ (() => ({ - getPublicKey: schnorrGetPublicKey, - sign: schnorrSign, - verify: schnorrVerify, - utils: { - randomPrivateKey: secp256k1.utils.randomPrivateKey, - lift_x, - pointToBytes, - numberToBytesBE, - bytesToNumberBE, - taggedHash, - mod, - }, -}))(); -const isoMap = /* @__PURE__ */ (() => isogenyMap(Fp, [ - // xNum - [ - '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7', - '0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581', - '0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262', - '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c', - ], - // xDen - [ - '0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b', - '0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14', - '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1 - ], - // yNum - [ - '0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c', - '0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3', - '0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931', - '0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84', - ], - // yDen - [ - '0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b', - '0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573', - '0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f', - '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1 - ], -].map((i) => i.map((j) => BigInt(j)))))(); -const mapSWU = /* @__PURE__ */ (() => mapToCurveSimpleSWU(Fp, { - A: BigInt('0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533'), - B: BigInt('1771'), - Z: Fp.create(BigInt('-11')), -}))(); -const htf = /* @__PURE__ */ (() => createHasher(secp256k1.ProjectivePoint, (scalars) => { - const { x, y } = mapSWU(Fp.create(scalars[0])); - return isoMap(x, y); -}, { - DST: 'secp256k1_XMD:SHA-256_SSWU_RO_', - encodeDST: 'secp256k1_XMD:SHA-256_SSWU_NU_', - p: Fp.ORDER, - m: 1, - k: 128, - expand: 'xmd', - hash: sha256, -}))(); -export const hashToCurve = /* @__PURE__ */ (() => htf.hashToCurve)(); -export const encodeToCurve = /* @__PURE__ */ (() => htf.encodeToCurve)(); -//# sourceMappingURL=secp256k1.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/secp256k1.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/secp256k1.js.map deleted file mode 100644 index 692678a2..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/esm/secp256k1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"secp256k1.js","sourceRoot":"","sources":["../src/secp256k1.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAA8B,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAE5F,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACjG,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,UAAU,GAAG,MAAM,CAAC,oEAAoE,CAAC,CAAC;AAChG,MAAM,UAAU,GAAG,MAAM,CAAC,oEAAoE,CAAC,CAAC;AAChG,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,UAAU,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;AAE/D;;;GAGG;AACH,SAAS,OAAO,CAAC,CAA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,CAAC,KAAK;IACX,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,GAAG;IACN,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,MAAM;CACb,CACF,CAAC,EAAE,CAAC;AACP,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;AACrE,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/index.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/index.d.ts deleted file mode 100644 index f36479a7..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/index.d.ts.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/index.d.ts.map deleted file mode 100644 index 4e8c5816..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/index.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/index.js deleted file mode 100644 index ac4f2231..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/index.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -throw new Error('Incorrect usage. Import submodules instead'); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/index.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/index.js.map deleted file mode 100644 index 292b53a2..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";AAAA,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/jubjub.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/jubjub.d.ts deleted file mode 100644 index 7d2c398a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/jubjub.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * jubjub Twisted Edwards curve. - * https://neuromancer.sk/std/other/JubJub - * jubjub does not use EdDSA, so `hash`/sha512 params are passed because interface expects them. - */ -export declare const jubjub: import("./abstract/edwards.js").CurveFn; -export declare function groupHash(tag: Uint8Array, personalization: Uint8Array): import("./abstract/edwards.js").ExtPointType; -export declare function findGroupHash(m: Uint8Array, personalization: Uint8Array): import("./abstract/edwards.js").ExtPointType; -//# sourceMappingURL=jubjub.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/jubjub.d.ts.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/jubjub.d.ts.map deleted file mode 100644 index e79099df..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/jubjub.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"jubjub.d.ts","sourceRoot":"","sources":["src/jubjub.ts"],"names":[],"mappings":"AAOA;;;;GAIG;AAEH,eAAO,MAAM,MAAM,yCAgBR,CAAC;AAOZ,wBAAgB,SAAS,CAAC,GAAG,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,gDAUrE;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,gDASvE"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/jubjub.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/jubjub.js deleted file mode 100644 index 60c83296..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/jubjub.js +++ /dev/null @@ -1,59 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.findGroupHash = exports.groupHash = exports.jubjub = void 0; -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const sha512_1 = require("@noble/hashes/sha512"); -const utils_1 = require("@noble/hashes/utils"); -const edwards_js_1 = require("./abstract/edwards.js"); -const blake2s_1 = require("@noble/hashes/blake2s"); -const modular_js_1 = require("./abstract/modular.js"); -/** - * jubjub Twisted Edwards curve. - * https://neuromancer.sk/std/other/JubJub - * jubjub does not use EdDSA, so `hash`/sha512 params are passed because interface expects them. - */ -exports.jubjub = (0, edwards_js_1.twistedEdwards)({ - // Params: a, d - a: BigInt('0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000000'), - d: BigInt('0x2a9318e74bfa2b48f5fd9207e6bd7fd4292d7f6d37579d2601065fd6d6343eb1'), - // Finite field 𝔽p over which we'll do calculations - // Same value as bls12-381 Fr (not Fp) - Fp: (0, modular_js_1.Field)(BigInt('0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001')), - // Subgroup order: how many points curve has - n: BigInt('0xe7db4ea6533afa906673b0101343b00a6682093ccc81082d0970e5ed6f72cb7'), - // Cofactor - h: BigInt(8), - // Base point (x, y) aka generator point - Gx: BigInt('0x11dafe5d23e1218086a365b99fbf3d3be72f6afd7d1f72623e6b071492d1122b'), - Gy: BigInt('0x1d523cf1ddab1a1793132e78c866c0c33e26ba5cc220fed7cc3f870e59d292aa'), - hash: sha512_1.sha512, - randomBytes: utils_1.randomBytes, -}); -const GH_FIRST_BLOCK = (0, utils_1.utf8ToBytes)('096b36a5804bfacef1691e173c366a47ff5ba84a44f26ddd7e8d9f79d5b42df0'); -// Returns point at JubJub curve which is prime order and not zero -function groupHash(tag, personalization) { - const h = blake2s_1.blake2s.create({ personalization, dkLen: 32 }); - h.update(GH_FIRST_BLOCK); - h.update(tag); - // NOTE: returns ExtendedPoint, in case it will be multiplied later - let p = exports.jubjub.ExtendedPoint.fromHex(h.digest()); - // NOTE: cannot replace with isSmallOrder, returns Point*8 - p = p.multiply(exports.jubjub.CURVE.h); - if (p.equals(exports.jubjub.ExtendedPoint.ZERO)) - throw new Error('Point has small order'); - return p; -} -exports.groupHash = groupHash; -function findGroupHash(m, personalization) { - const tag = (0, utils_1.concatBytes)(m, new Uint8Array([0])); - for (let i = 0; i < 256; i++) { - tag[tag.length - 1] = i; - try { - return groupHash(tag, personalization); - } - catch (e) { } - } - throw new Error('findGroupHash tag overflow'); -} -exports.findGroupHash = findGroupHash; -//# sourceMappingURL=jubjub.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/jubjub.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/jubjub.js.map deleted file mode 100644 index 3cd9787c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/jubjub.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"jubjub.js","sourceRoot":"","sources":["src/jubjub.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,iDAA8C;AAC9C,+CAA4E;AAC5E,sDAAuD;AACvD,mDAAgD;AAChD,sDAA8C;AAE9C;;;;GAIG;AAEU,QAAA,MAAM,GAAmB,IAAA,2BAAc,EAAC;IACnD,eAAe;IACf,CAAC,EAAE,MAAM,CAAC,oEAAoE,CAAC;IAC/E,CAAC,EAAE,MAAM,CAAC,oEAAoE,CAAC;IAC/E,oDAAoD;IACpD,sCAAsC;IACtC,EAAE,EAAE,IAAA,kBAAK,EAAC,MAAM,CAAC,oEAAoE,CAAC,CAAC;I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,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;QACxB,IAAI;YACF,OAAO,SAAS,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;SACxC;QAAC,OAAO,CAAC,EAAE,GAAE;KACf;IACD,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;AAChD,CAAC;AATD,sCASC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p256.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p256.d.ts deleted file mode 100644 index cf8c0d6e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p256.d.ts +++ /dev/null @@ -1,105 +0,0 @@ -export declare const p256: Readonly<{ - create: (hash: import("./abstract/utils.js").CHash) => import("./abstract/weierstrass.js").CurveFn; - CURVE: Readonly<{ - readonly nBitLength: number; - readonly nByteLength: number; - readonly Fp: import("./abstract/modular.js").IField; - readonly n: bigint; - readonly h: bigint; - readonly hEff?: bigint | undefined; - readonly Gx: bigint; - readonly Gy: bigint; - readonly allowInfinityPoint?: boolean | undefined; - readonly a: bigint; - readonly b: bigint; - readonly allowedPrivateKeyLengths?: readonly number[] | undefined; - readonly wrapPrivateKey?: boolean | undefined; - readonly endo?: { - beta: bigint; - splitScalar: (k: bigint) => { - k1neg: boolean; - k1: bigint; - k2neg: boolean; - k2: bigint; - }; - } | undefined; - readonly isTorsionFree?: ((c: import("./abstract/weierstrass.js").ProjConstructor, point: import("./abstract/weierstrass.js").ProjPointType) => boolean) | undefined; - readonly clearCofactor?: ((c: import("./abstract/weierstrass.js").ProjConstructor, point: import("./abstract/weierstrass.js").ProjPointType) => import("./abstract/weierstrass.js").ProjPointType) | undefined; - readonly hash: import("./abstract/utils.js").CHash; - readonly hmac: (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array; - readonly randomBytes: (bytesLength?: number | undefined) => Uint8Array; - lowS: boolean; - readonly bits2int?: ((bytes: Uint8Array) => bigint) | undefined; - readonly bits2int_modN?: ((bytes: Uint8Array) => bigint) | undefined; - readonly p: bigint; - }>; - getPublicKey: (privateKey: import("./abstract/utils.js").PrivKey, isCompressed?: boolean | undefined) => Uint8Array; - getSharedSecret: (privateA: import("./abstract/utils.js").PrivKey, publicB: import("./abstract/utils.js").Hex, isCompressed?: boolean | undefined) => Uint8Array; - sign: (msgHash: import("./abstract/utils.js").Hex, privKey: import("./abstract/utils.js").PrivKey, opts?: import("./abstract/weierstrass.js").SignOpts | undefined) => import("./abstract/weierstrass.js").RecoveredSignatureType; - verify: (signature: import("./abstract/utils.js").Hex | { - r: bigint; - s: bigint; - }, msgHash: import("./abstract/utils.js").Hex, publicKey: import("./abstract/utils.js").Hex, opts?: import("./abstract/weierstrass.js").VerOpts | undefined) => boolean; - ProjectivePoint: import("./abstract/weierstrass.js").ProjConstructor; - Signature: import("./abstract/weierstrass.js").SignatureConstructor; - utils: { - normPrivateKeyToScalar: (key: import("./abstract/utils.js").PrivKey) => bigint; - isValidPrivateKey(privateKey: import("./abstract/utils.js").PrivKey): boolean; - randomPrivateKey: () => Uint8Array; - precompute: (windowSize?: number | undefined, point?: import("./abstract/weierstrass.js").ProjPointType | undefined) => import("./abstract/weierstrass.js").ProjPointType; - }; -}>; -export declare const secp256r1: Readonly<{ - create: (hash: import("./abstract/utils.js").CHash) => import("./abstract/weierstrass.js").CurveFn; - CURVE: Readonly<{ - readonly nBitLength: number; - readonly nByteLength: number; - readonly Fp: import("./abstract/modular.js").IField; - readonly n: bigint; - readonly h: bigint; - readonly hEff?: bigint | undefined; - readonly Gx: bigint; - readonly Gy: bigint; - readonly allowInfinityPoint?: boolean | undefined; - readonly a: bigint; - readonly b: bigint; - readonly allowedPrivateKeyLengths?: readonly number[] | undefined; - readonly wrapPrivateKey?: boolean | undefined; - readonly endo?: { - beta: bigint; - splitScalar: (k: bigint) => { - k1neg: boolean; - k1: bigint; - k2neg: boolean; - k2: bigint; - }; - } | undefined; - readonly isTorsionFree?: ((c: import("./abstract/weierstrass.js").ProjConstructor, point: import("./abstract/weierstrass.js").ProjPointType) => boolean) | undefined; - readonly clearCofactor?: ((c: import("./abstract/weierstrass.js").ProjConstructor, point: import("./abstract/weierstrass.js").ProjPointType) => import("./abstract/weierstrass.js").ProjPointType) | undefined; - readonly hash: import("./abstract/utils.js").CHash; - readonly hmac: (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array; - readonly randomBytes: (bytesLength?: number | undefined) => Uint8Array; - lowS: boolean; - readonly bits2int?: ((bytes: Uint8Array) => bigint) | undefined; - readonly bits2int_modN?: ((bytes: Uint8Array) => bigint) | undefined; - readonly p: bigint; - }>; - getPublicKey: (privateKey: import("./abstract/utils.js").PrivKey, isCompressed?: boolean | undefined) => Uint8Array; - getSharedSecret: (privateA: import("./abstract/utils.js").PrivKey, publicB: import("./abstract/utils.js").Hex, isCompressed?: boolean | undefined) => Uint8Array; - sign: (msgHash: import("./abstract/utils.js").Hex, privKey: import("./abstract/utils.js").PrivKey, opts?: import("./abstract/weierstrass.js").SignOpts | undefined) => import("./abstract/weierstrass.js").RecoveredSignatureType; - verify: (signature: import("./abstract/utils.js").Hex | { - r: bigint; - s: bigint; - }, msgHash: import("./abstract/utils.js").Hex, publicKey: import("./abstract/utils.js").Hex, opts?: import("./abstract/weierstrass.js").VerOpts | undefined) => boolean; - ProjectivePoint: import("./abstract/weierstrass.js").ProjConstructor; - Signature: import("./abstract/weierstrass.js").SignatureConstructor; - utils: { - normPrivateKeyToScalar: (key: import("./abstract/utils.js").PrivKey) => bigint; - isValidPrivateKey(privateKey: import("./abstract/utils.js").PrivKey): boolean; - randomPrivateKey: () => Uint8Array; - precompute: (windowSize?: number | undefined, point?: import("./abstract/weierstrass.js").ProjPointType | undefined) => import("./abstract/weierstrass.js").ProjPointType; - }; -}>; -export declare const hashToCurve: (msg: Uint8Array, options?: import("./abstract/hash-to-curve.js").htfBasicOpts | undefined) => import("./abstract/hash-to-curve.js").H2CPoint; -export declare const encodeToCurve: (msg: Uint8Array, options?: import("./abstract/hash-to-curve.js").htfBasicOpts | undefined) => import("./abstract/hash-to-curve.js").H2CPoint; -//# sourceMappingURL=p256.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p256.d.ts.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p256.d.ts.map deleted file mode 100644 index d16f8128..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p256.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"p256.d.ts","sourceRoot":"","sources":["src/p256.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWE,CAAC;AACpB,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAO,CAAC;AAmB9B,eAAO,MAAM,WAAW,uJAA4C,CAAC;AACrE,eAAO,MAAM,aAAa,uJAA8C,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p256.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p256.js deleted file mode 100644 index 1e7e8094..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p256.js +++ /dev/null @@ -1,45 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.encodeToCurve = exports.hashToCurve = exports.secp256r1 = exports.p256 = void 0; -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const _shortw_utils_js_1 = require("./_shortw_utils.js"); -const sha256_1 = require("@noble/hashes/sha256"); -const modular_js_1 = require("./abstract/modular.js"); -const weierstrass_js_1 = require("./abstract/weierstrass.js"); -const hash_to_curve_js_1 = require("./abstract/hash-to-curve.js"); -// NIST secp256r1 aka p256 -// https://www.secg.org/sec2-v2.pdf, https://neuromancer.sk/std/nist/P-256 -const Fp = (0, modular_js_1.Field)(BigInt('0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff')); -const CURVE_A = Fp.create(BigInt('-3')); -const CURVE_B = BigInt('0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b'); -// prettier-ignore -exports.p256 = (0, _shortw_utils_js_1.createCurve)({ - a: CURVE_A, - b: CURVE_B, - Fp, - // Curve order, total count of valid points in the field - n: BigInt('0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551'), - // Base (generator) point (x, y) - Gx: BigInt('0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296'), - Gy: BigInt('0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5'), - h: BigInt(1), - lowS: false, -}, sha256_1.sha256); -exports.secp256r1 = exports.p256; -const mapSWU = /* @__PURE__ */ (() => (0, weierstrass_js_1.mapToCurveSimpleSWU)(Fp, { - A: CURVE_A, - B: CURVE_B, - Z: Fp.create(BigInt('-10')), -}))(); -const htf = /* @__PURE__ */ (() => (0, hash_to_curve_js_1.createHasher)(exports.secp256r1.ProjectivePoint, (scalars) => mapSWU(scalars[0]), { - DST: 'P256_XMD:SHA-256_SSWU_RO_', - encodeDST: 'P256_XMD:SHA-256_SSWU_NU_', - p: Fp.ORDER, - m: 1, - k: 128, - expand: 'xmd', - hash: sha256_1.sha256, -}))(); -exports.hashToCurve = (() => htf.hashToCurve)(); -exports.encodeToCurve = (() => htf.encodeToCurve)(); -//# sourceMappingURL=p256.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p256.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p256.js.map deleted file mode 100644 index 0459df9c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p256.js.map +++ /dev/null @@ -1 +0,0 @@ -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C,EAAE;IACjF,GAAG,EAAE,2BAA2B;IAChC,SAAS,EAAE,2BAA2B;IACtC,CAAC,EAAE,EAAE,CAAC,KAAK;IACX,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,GAAG;IACN,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,eAAM;CACb,CAAC,CAAC,EAAE,CAAC;AACK,QAAA,WAAW,GAAmB,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;AACxD,QAAA,aAAa,GAAmB,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p384.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p384.d.ts deleted file mode 100644 index 0be42541..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p384.d.ts +++ /dev/null @@ -1,105 +0,0 @@ -export declare const p384: Readonly<{ - create: (hash: import("./abstract/utils.js").CHash) => import("./abstract/weierstrass.js").CurveFn; - CURVE: Readonly<{ - readonly nBitLength: number; - readonly nByteLength: number; - readonly Fp: import("./abstract/modular.js").IField; - readonly n: bigint; - readonly h: bigint; - readonly hEff?: bigint | undefined; - readonly Gx: bigint; - readonly Gy: bigint; - readonly allowInfinityPoint?: boolean | undefined; - readonly a: bigint; - readonly b: bigint; - readonly allowedPrivateKeyLengths?: readonly number[] | undefined; - readonly wrapPrivateKey?: boolean | undefined; - readonly endo?: { - beta: bigint; - splitScalar: (k: bigint) => { - k1neg: boolean; - k1: bigint; - k2neg: boolean; - k2: bigint; - }; - } | undefined; - readonly isTorsionFree?: ((c: import("./abstract/weierstrass.js").ProjConstructor, point: import("./abstract/weierstrass.js").ProjPointType) => boolean) | undefined; - readonly clearCofactor?: ((c: import("./abstract/weierstrass.js").ProjConstructor, point: import("./abstract/weierstrass.js").ProjPointType) => import("./abstract/weierstrass.js").ProjPointType) | undefined; - readonly hash: import("./abstract/utils.js").CHash; - readonly hmac: (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array; - readonly randomBytes: (bytesLength?: number | undefined) => Uint8Array; - lowS: boolean; - readonly bits2int?: ((bytes: Uint8Array) => bigint) | undefined; - readonly bits2int_modN?: ((bytes: Uint8Array) => bigint) | undefined; - readonly p: bigint; - }>; - getPublicKey: (privateKey: import("./abstract/utils.js").PrivKey, isCompressed?: boolean | undefined) => Uint8Array; - getSharedSecret: (privateA: import("./abstract/utils.js").PrivKey, publicB: import("./abstract/utils.js").Hex, isCompressed?: boolean | undefined) => Uint8Array; - sign: (msgHash: import("./abstract/utils.js").Hex, privKey: import("./abstract/utils.js").PrivKey, opts?: import("./abstract/weierstrass.js").SignOpts | undefined) => import("./abstract/weierstrass.js").RecoveredSignatureType; - verify: (signature: import("./abstract/utils.js").Hex | { - r: bigint; - s: bigint; - }, msgHash: import("./abstract/utils.js").Hex, publicKey: import("./abstract/utils.js").Hex, opts?: import("./abstract/weierstrass.js").VerOpts | undefined) => boolean; - ProjectivePoint: import("./abstract/weierstrass.js").ProjConstructor; - Signature: import("./abstract/weierstrass.js").SignatureConstructor; - utils: { - normPrivateKeyToScalar: (key: import("./abstract/utils.js").PrivKey) => bigint; - isValidPrivateKey(privateKey: import("./abstract/utils.js").PrivKey): boolean; - randomPrivateKey: () => Uint8Array; - precompute: (windowSize?: number | undefined, point?: import("./abstract/weierstrass.js").ProjPointType | undefined) => import("./abstract/weierstrass.js").ProjPointType; - }; -}>; -export declare const secp384r1: Readonly<{ - create: (hash: import("./abstract/utils.js").CHash) => import("./abstract/weierstrass.js").CurveFn; - CURVE: Readonly<{ - readonly nBitLength: number; - readonly nByteLength: number; - readonly Fp: import("./abstract/modular.js").IField; - readonly n: bigint; - readonly h: bigint; - readonly hEff?: bigint | undefined; - readonly Gx: bigint; - readonly Gy: bigint; - readonly allowInfinityPoint?: boolean | undefined; - readonly a: bigint; - readonly b: bigint; - readonly allowedPrivateKeyLengths?: readonly number[] | undefined; - readonly wrapPrivateKey?: boolean | undefined; - readonly endo?: { - beta: bigint; - splitScalar: (k: bigint) => { - k1neg: boolean; - k1: bigint; - k2neg: boolean; - k2: bigint; - }; - } | undefined; - readonly isTorsionFree?: ((c: import("./abstract/weierstrass.js").ProjConstructor, point: import("./abstract/weierstrass.js").ProjPointType) => boolean) | undefined; - readonly clearCofactor?: ((c: import("./abstract/weierstrass.js").ProjConstructor, point: import("./abstract/weierstrass.js").ProjPointType) => import("./abstract/weierstrass.js").ProjPointType) | undefined; - readonly hash: import("./abstract/utils.js").CHash; - readonly hmac: (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array; - readonly randomBytes: (bytesLength?: number | undefined) => Uint8Array; - lowS: boolean; - readonly bits2int?: ((bytes: Uint8Array) => bigint) | undefined; - readonly bits2int_modN?: ((bytes: Uint8Array) => bigint) | undefined; - readonly p: bigint; - }>; - getPublicKey: (privateKey: import("./abstract/utils.js").PrivKey, isCompressed?: boolean | undefined) => Uint8Array; - getSharedSecret: (privateA: import("./abstract/utils.js").PrivKey, publicB: import("./abstract/utils.js").Hex, isCompressed?: boolean | undefined) => Uint8Array; - sign: (msgHash: import("./abstract/utils.js").Hex, privKey: import("./abstract/utils.js").PrivKey, opts?: import("./abstract/weierstrass.js").SignOpts | undefined) => import("./abstract/weierstrass.js").RecoveredSignatureType; - verify: (signature: import("./abstract/utils.js").Hex | { - r: bigint; - s: bigint; - }, msgHash: import("./abstract/utils.js").Hex, publicKey: import("./abstract/utils.js").Hex, opts?: import("./abstract/weierstrass.js").VerOpts | undefined) => boolean; - ProjectivePoint: import("./abstract/weierstrass.js").ProjConstructor; - Signature: import("./abstract/weierstrass.js").SignatureConstructor; - utils: { - normPrivateKeyToScalar: (key: import("./abstract/utils.js").PrivKey) => bigint; - isValidPrivateKey(privateKey: import("./abstract/utils.js").PrivKey): boolean; - randomPrivateKey: () => Uint8Array; - precompute: (windowSize?: number | undefined, point?: import("./abstract/weierstrass.js").ProjPointType | undefined) => import("./abstract/weierstrass.js").ProjPointType; - }; -}>; -export declare const hashToCurve: (msg: Uint8Array, options?: import("./abstract/hash-to-curve.js").htfBasicOpts | undefined) => import("./abstract/hash-to-curve.js").H2CPoint; -export declare const encodeToCurve: (msg: Uint8Array, options?: import("./abstract/hash-to-curve.js").htfBasicOpts | undefined) => import("./abstract/hash-to-curve.js").H2CPoint; -//# sourceMappingURL=p384.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p384.d.ts.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p384.d.ts.map deleted file mode 100644 index 547746d3..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p384.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"p384.d.ts","sourceRoot":"","sources":["src/p384.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWE,CAAC;AACpB,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAO,CAAC;AAmB9B,eAAO,MAAM,WAAW,uJAA4C,CAAC;AACrE,eAAO,MAAM,aAAa,uJAA8C,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p384.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p384.js deleted file mode 100644 index d3a472bd..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p384.js +++ /dev/null @@ -1,49 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.encodeToCurve = exports.hashToCurve = exports.secp384r1 = exports.p384 = void 0; -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const _shortw_utils_js_1 = require("./_shortw_utils.js"); -const sha512_1 = require("@noble/hashes/sha512"); -const modular_js_1 = require("./abstract/modular.js"); -const weierstrass_js_1 = require("./abstract/weierstrass.js"); -const hash_to_curve_js_1 = require("./abstract/hash-to-curve.js"); -// NIST secp384r1 aka p384 -// https://www.secg.org/sec2-v2.pdf, https://neuromancer.sk/std/nist/P-384 -// Field over which we'll do calculations. -// prettier-ignore -const P = BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff'); -const Fp = (0, modular_js_1.Field)(P); -const CURVE_A = Fp.create(BigInt('-3')); -// prettier-ignore -const CURVE_B = BigInt('0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef'); -// prettier-ignore -exports.p384 = (0, _shortw_utils_js_1.createCurve)({ - a: CURVE_A, - b: CURVE_B, - Fp, - // Curve order, total count of valid points in the field. - n: BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973'), - // Base (generator) point (x, y) - Gx: BigInt('0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7'), - Gy: BigInt('0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f'), - h: BigInt(1), - lowS: false, -}, sha512_1.sha384); -exports.secp384r1 = exports.p384; -const mapSWU = /* @__PURE__ */ (() => (0, weierstrass_js_1.mapToCurveSimpleSWU)(Fp, { - A: CURVE_A, - B: CURVE_B, - Z: Fp.create(BigInt('-12')), -}))(); -const htf = /* @__PURE__ */ (() => (0, hash_to_curve_js_1.createHasher)(exports.secp384r1.ProjectivePoint, (scalars) => mapSWU(scalars[0]), { - DST: 'P384_XMD:SHA-384_SSWU_RO_', - encodeDST: 'P384_XMD:SHA-384_SSWU_NU_', - p: Fp.ORDER, - m: 1, - k: 192, - expand: 'xmd', - hash: sha512_1.sha384, -}))(); -exports.hashToCurve = (() => htf.hashToCurve)(); -exports.encodeToCurve = (() => htf.encodeToCurve)(); -//# sourceMappingURL=p384.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p384.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p384.js.map deleted file mode 100644 index 6816f0d2..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p384.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"p384.js","sourceRoot":"","sources":["src/p384.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,yDAAiD;AACjD,iDAA8C;AAC9C,sDAA8C;AAC9C,8DAAgE;AAChE,kEAA2D;AAE3D,0BAA0B;AAC1B,0EAA0E;AAE1E,0CAA0C;AAC1C,kBAAkB;AAClB,MAAM,CAAC,GAAG,MAAM,CAAC,oGAAoG,CAAC,CAAC;AACvH,MAAM,EAAE,GAAG,IAAA,kBAAK,EAAC,CAAC,CAAC,CAAC;AACpB,MAAM,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AACxC,kBAAkB;AAClB,MAAM,OAAO,GAAG,MAAM,CAAC,oGAAoG,CAAC,CAAC;AAE7H,kBAAkB;AACL,QAAA,IAAI,GAAG,IAAA,8BAAW,EAAC;IAC9B,CAAC,EAAE,OAAO;IACV,CAAC,EAAE,OAAO;IACV,EAAE;IACF,yDAAyD;IACzD,CAAC,EAAE,MAAM,CAAC,oGAAoG,CAAC;IAC/G,gCAAgC;IAChC,EAAE,EAAE,MAAM,CAAC,oGAAoG,CAAC;IAChH,EAAE,EAAE,MAAM,CAAC,oGAAoG,CAAC;IAChH,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,IAAI,EAAE,KAAK;CACH,EAAE,eAAM,CAAC,CAAC;AACP,QAAA,SAAS,GAAG,YAAI,CAAC;AAE9B,MAAM,MAAM,GAAG,eAAe,CAAC,CAAC,GAAG,EAAE,CACnC,IAAA,oCAAmB,EAAC,EAAE,EAAE;IACtB,CAAC,EAAE,OAAO;IACV,CAAC,EAAE,OAAO;IACV,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;CAC5B,CAAC,CAAC,EAAE,CAAC;AAER,MAAM,GAAG,GAAG,eAAe,CAAC,CAAC,GAAG,EAAE,CAChC,IAAA,+BAAY,EAAC,iBAAS,CAAC,eAAe,EAAE,CAAC,OAAiB,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE;IACjF,GAAG,EAAE,2BAA2B;IAChC,SAAS,EAAE,2BAA2B;IACtC,CAAC,EAAE,EAAE,CAAC,KAAK;IACX,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,GAAG;IACN,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,eAAM;CACb,CAAC,CAAC,EAAE,CAAC;AACK,QAAA,WAAW,GAAmB,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;AACxD,QAAA,aAAa,GAAmB,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p521.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p521.d.ts deleted file mode 100644 index 47cca466..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p521.d.ts +++ /dev/null @@ -1,105 +0,0 @@ -export declare const p521: Readonly<{ - create: (hash: import("./abstract/utils.js").CHash) => import("./abstract/weierstrass.js").CurveFn; - CURVE: Readonly<{ - readonly nBitLength: number; - readonly nByteLength: number; - readonly Fp: import("./abstract/modular.js").IField; - readonly n: bigint; - readonly h: bigint; - readonly hEff?: bigint | undefined; - readonly Gx: bigint; - readonly Gy: bigint; - readonly allowInfinityPoint?: boolean | undefined; - readonly a: bigint; - readonly b: bigint; - readonly allowedPrivateKeyLengths?: readonly number[] | undefined; - readonly wrapPrivateKey?: boolean | undefined; - readonly endo?: { - beta: bigint; - splitScalar: (k: bigint) => { - k1neg: boolean; - k1: bigint; - k2neg: boolean; - k2: bigint; - }; - } | undefined; - readonly isTorsionFree?: ((c: import("./abstract/weierstrass.js").ProjConstructor, point: import("./abstract/weierstrass.js").ProjPointType) => boolean) | undefined; - readonly clearCofactor?: ((c: import("./abstract/weierstrass.js").ProjConstructor, point: import("./abstract/weierstrass.js").ProjPointType) => import("./abstract/weierstrass.js").ProjPointType) | undefined; - readonly hash: import("./abstract/utils.js").CHash; - readonly hmac: (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array; - readonly randomBytes: (bytesLength?: number | undefined) => Uint8Array; - lowS: boolean; - readonly bits2int?: ((bytes: Uint8Array) => bigint) | undefined; - readonly bits2int_modN?: ((bytes: Uint8Array) => bigint) | undefined; - readonly p: bigint; - }>; - getPublicKey: (privateKey: import("./abstract/utils.js").PrivKey, isCompressed?: boolean | undefined) => Uint8Array; - getSharedSecret: (privateA: import("./abstract/utils.js").PrivKey, publicB: import("./abstract/utils.js").Hex, isCompressed?: boolean | undefined) => Uint8Array; - sign: (msgHash: import("./abstract/utils.js").Hex, privKey: import("./abstract/utils.js").PrivKey, opts?: import("./abstract/weierstrass.js").SignOpts | undefined) => import("./abstract/weierstrass.js").RecoveredSignatureType; - verify: (signature: import("./abstract/utils.js").Hex | { - r: bigint; - s: bigint; - }, msgHash: import("./abstract/utils.js").Hex, publicKey: import("./abstract/utils.js").Hex, opts?: import("./abstract/weierstrass.js").VerOpts | undefined) => boolean; - ProjectivePoint: import("./abstract/weierstrass.js").ProjConstructor; - Signature: import("./abstract/weierstrass.js").SignatureConstructor; - utils: { - normPrivateKeyToScalar: (key: import("./abstract/utils.js").PrivKey) => bigint; - isValidPrivateKey(privateKey: import("./abstract/utils.js").PrivKey): boolean; - randomPrivateKey: () => Uint8Array; - precompute: (windowSize?: number | undefined, point?: import("./abstract/weierstrass.js").ProjPointType | undefined) => import("./abstract/weierstrass.js").ProjPointType; - }; -}>; -export declare const secp521r1: Readonly<{ - create: (hash: import("./abstract/utils.js").CHash) => import("./abstract/weierstrass.js").CurveFn; - CURVE: Readonly<{ - readonly nBitLength: number; - readonly nByteLength: number; - readonly Fp: import("./abstract/modular.js").IField; - readonly n: bigint; - readonly h: bigint; - readonly hEff?: bigint | undefined; - readonly Gx: bigint; - readonly Gy: bigint; - readonly allowInfinityPoint?: boolean | undefined; - readonly a: bigint; - readonly b: bigint; - readonly allowedPrivateKeyLengths?: readonly number[] | undefined; - readonly wrapPrivateKey?: boolean | undefined; - readonly endo?: { - beta: bigint; - splitScalar: (k: bigint) => { - k1neg: boolean; - k1: bigint; - k2neg: boolean; - k2: bigint; - }; - } | undefined; - readonly isTorsionFree?: ((c: import("./abstract/weierstrass.js").ProjConstructor, point: import("./abstract/weierstrass.js").ProjPointType) => boolean) | undefined; - readonly clearCofactor?: ((c: import("./abstract/weierstrass.js").ProjConstructor, point: import("./abstract/weierstrass.js").ProjPointType) => import("./abstract/weierstrass.js").ProjPointType) | undefined; - readonly hash: import("./abstract/utils.js").CHash; - readonly hmac: (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array; - readonly randomBytes: (bytesLength?: number | undefined) => Uint8Array; - lowS: boolean; - readonly bits2int?: ((bytes: Uint8Array) => bigint) | undefined; - readonly bits2int_modN?: ((bytes: Uint8Array) => bigint) | undefined; - readonly p: bigint; - }>; - getPublicKey: (privateKey: import("./abstract/utils.js").PrivKey, isCompressed?: boolean | undefined) => Uint8Array; - getSharedSecret: (privateA: import("./abstract/utils.js").PrivKey, publicB: import("./abstract/utils.js").Hex, isCompressed?: boolean | undefined) => Uint8Array; - sign: (msgHash: import("./abstract/utils.js").Hex, privKey: import("./abstract/utils.js").PrivKey, opts?: import("./abstract/weierstrass.js").SignOpts | undefined) => import("./abstract/weierstrass.js").RecoveredSignatureType; - verify: (signature: import("./abstract/utils.js").Hex | { - r: bigint; - s: bigint; - }, msgHash: import("./abstract/utils.js").Hex, publicKey: import("./abstract/utils.js").Hex, opts?: import("./abstract/weierstrass.js").VerOpts | undefined) => boolean; - ProjectivePoint: import("./abstract/weierstrass.js").ProjConstructor; - Signature: import("./abstract/weierstrass.js").SignatureConstructor; - utils: { - normPrivateKeyToScalar: (key: import("./abstract/utils.js").PrivKey) => bigint; - isValidPrivateKey(privateKey: import("./abstract/utils.js").PrivKey): boolean; - randomPrivateKey: () => Uint8Array; - precompute: (windowSize?: number | undefined, point?: import("./abstract/weierstrass.js").ProjPointType | undefined) => import("./abstract/weierstrass.js").ProjPointType; - }; -}>; -export declare const hashToCurve: (msg: Uint8Array, options?: import("./abstract/hash-to-curve.js").htfBasicOpts | undefined) => import("./abstract/hash-to-curve.js").H2CPoint; -export declare const encodeToCurve: (msg: Uint8Array, options?: import("./abstract/hash-to-curve.js").htfBasicOpts | undefined) => import("./abstract/hash-to-curve.js").H2CPoint; -//# sourceMappingURL=p521.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p521.d.ts.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p521.d.ts.map deleted file mode 100644 index 1c3cdaa2..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p521.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"p521.d.ts","sourceRoot":"","sources":["src/p521.ts"],"names":[],"mappings":"AAmCA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWE,CAAC;AACpB,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAO,CAAC;AAmB9B,eAAO,MAAM,WAAW,uJAA4C,CAAC;AACrE,eAAO,MAAM,aAAa,uJAA8C,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p521.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p521.js deleted file mode 100644 index c1c0e22a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p521.js +++ /dev/null @@ -1,56 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.encodeToCurve = exports.hashToCurve = exports.secp521r1 = exports.p521 = void 0; -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const _shortw_utils_js_1 = require("./_shortw_utils.js"); -const sha512_1 = require("@noble/hashes/sha512"); -const modular_js_1 = require("./abstract/modular.js"); -const weierstrass_js_1 = require("./abstract/weierstrass.js"); -const hash_to_curve_js_1 = require("./abstract/hash-to-curve.js"); -// NIST secp521r1 aka p521 -// Note that it's 521, which differs from 512 of its hash function. -// https://www.secg.org/sec2-v2.pdf, https://neuromancer.sk/std/nist/P-521 -// Field over which we'll do calculations. -// prettier-ignore -const P = BigInt('0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'); -const Fp = (0, modular_js_1.Field)(P); -const CURVE = { - a: Fp.create(BigInt('-3')), - b: BigInt('0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00'), - Fp, - n: BigInt('0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409'), - Gx: BigInt('0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66'), - Gy: BigInt('0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650'), - h: BigInt(1), -}; -// prettier-ignore -exports.p521 = (0, _shortw_utils_js_1.createCurve)({ - a: CURVE.a, - b: CURVE.b, - Fp, - // Curve order, total count of valid points in the field - n: CURVE.n, - Gx: CURVE.Gx, - Gy: CURVE.Gy, - h: CURVE.h, - lowS: false, - allowedPrivateKeyLengths: [130, 131, 132] // P521 keys are variable-length. Normalize to 132b -}, sha512_1.sha512); -exports.secp521r1 = exports.p521; -const mapSWU = /* @__PURE__ */ (() => (0, weierstrass_js_1.mapToCurveSimpleSWU)(Fp, { - A: CURVE.a, - B: CURVE.b, - Z: Fp.create(BigInt('-4')), -}))(); -const htf = /* @__PURE__ */ (() => (0, hash_to_curve_js_1.createHasher)(exports.secp521r1.ProjectivePoint, (scalars) => mapSWU(scalars[0]), { - DST: 'P521_XMD:SHA-512_SSWU_RO_', - encodeDST: 'P521_XMD:SHA-512_SSWU_NU_', - p: Fp.ORDER, - m: 1, - k: 256, - expand: 'xmd', - hash: sha512_1.sha512, -}))(); -exports.hashToCurve = (() => htf.hashToCurve)(); -exports.encodeToCurve = (() => htf.encodeToCurve)(); -//# sourceMappingURL=p521.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p521.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p521.js.map deleted file mode 100644 index f79e5f0f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/p521.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"p521.js","sourceRoot":"","sources":["src/p521.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,yDAAiD;AACjD,iDAA8C;AAC9C,sDAA8C;AAC9C,8DAAgE;AAChE,kEAA2D;AAE3D,0BAA0B;AAC1B,mEAAmE;AACnE,0EAA0E;AAE1E,0CAA0C;AAC1C,kBAAkB;AAClB,MAAM,CAAC,GAAG,MAAM,CAAC,uIAAuI,CAAC,CAAC;AAC1J,MAAM,EAAE,GAAG,IAA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CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE;IACjF,GAAG,EAAE,2BAA2B;IAChC,SAAS,EAAE,2BAA2B;IACtC,CAAC,EAAE,EAAE,CAAC,KAAK;IACX,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,GAAG;IACN,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,eAAM;CACb,CAAC,CAAC,EAAE,CAAC;AACK,QAAA,WAAW,GAAmB,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;AACxD,QAAA,aAAa,GAAmB,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/package.json b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/package.json deleted file mode 100644 index 38cf3da7..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/package.json +++ /dev/null @@ -1,181 +0,0 @@ -{ - "name": "@noble/curves", - "version": "1.2.0", - "description": "Audited & minimal JS implementation of elliptic curve cryptography", - "files": [ - "abstract", - "esm", - "src", - "*.js", - "*.js.map", - "*.d.ts", - "*.d.ts.map" - ], - "scripts": { - "bench": "cd benchmark; node secp256k1.js; node curves.js; node ecdh.js; node hash-to-curve.js; node modular.js; node bls.js; node ristretto255.js; node decaf448.js", - "build": "tsc && tsc -p tsconfig.esm.json", - "build:release": "rollup -c rollup.config.js", - "build:clean": "rm *.{js,d.ts,d.ts.map,js.map} esm/*.{js,d.ts,d.ts.map,js.map} 2> /dev/null", - "lint": "prettier --check 'src/**/*.{js,ts}' 'test/*.js'", - "format": "prettier --write 'src/**/*.{js,ts}' 'test/*.js'", - "test": "node test/index.test.js" - }, - "author": "Paul Miller (https://paulmillr.com)", - "homepage": "https://paulmillr.com/noble/", - "repository": { - "type": "git", - "url": "https://github.com/paulmillr/noble-curves.git" - }, - "license": "MIT", - "dependencies": { - "@noble/hashes": "1.3.2" - }, - "devDependencies": { - "fast-check": "3.0.0", - "micro-bmark": "0.3.1", - "micro-should": "0.4.0", - "prettier": "2.8.4", - "typescript": "5.0.2" - }, - "sideEffects": false, - "main": "index.js", - "exports": { - ".": { - "types": "./index.d.ts", - "import": "./esm/index.js", - "default": "./index.js" - }, - "./abstract/edwards": { - "types": "./abstract/edwards.d.ts", - "import": "./esm/abstract/edwards.js", - "default": "./abstract/edwards.js" - }, - "./abstract/modular": { - "types": "./abstract/modular.d.ts", - "import": "./esm/abstract/modular.js", - "default": "./abstract/modular.js" - }, - "./abstract/montgomery": { - "types": "./abstract/montgomery.d.ts", - "import": "./esm/abstract/montgomery.js", - "default": "./abstract/montgomery.js" - }, - "./abstract/weierstrass": { - "types": "./abstract/weierstrass.d.ts", - "import": "./esm/abstract/weierstrass.js", - "default": "./abstract/weierstrass.js" - }, - "./abstract/bls": { - "types": "./abstract/bls.d.ts", - "import": "./esm/abstract/bls.js", - "default": "./abstract/bls.js" - }, - "./abstract/hash-to-curve": { - "types": "./abstract/hash-to-curve.d.ts", - "import": "./esm/abstract/hash-to-curve.js", - "default": "./abstract/hash-to-curve.js" - }, - "./abstract/curve": { - "types": "./abstract/curve.d.ts", - "import": "./esm/abstract/curve.js", - "default": "./abstract/curve.js" - }, - "./abstract/utils": { - "types": "./abstract/utils.d.ts", - "import": "./esm/abstract/utils.js", - "default": "./abstract/utils.js" - }, - "./abstract/poseidon": { - "types": "./abstract/poseidon.d.ts", - "import": "./esm/abstract/poseidon.js", - "default": "./abstract/poseidon.js" - }, - "./_shortw_utils": { - "types": "./_shortw_utils.d.ts", - "import": "./esm/_shortw_utils.js", - "default": "./_shortw_utils.js" - }, - "./bls12-381": { - "types": "./bls12-381.d.ts", - "import": "./esm/bls12-381.js", - "default": "./bls12-381.js" - }, - "./bn254": { - "types": "./bn254.d.ts", - "import": "./esm/bn254.js", - "default": "./bn254.js" - }, - "./ed25519": { - "types": "./ed25519.d.ts", - "import": "./esm/ed25519.js", - "default": "./ed25519.js" - }, - "./ed448": { - "types": "./ed448.d.ts", - "import": "./esm/ed448.js", - "default": "./ed448.js" - }, - "./index": { - "types": "./index.d.ts", - "import": "./esm/index.js", - "default": "./index.js" - }, - "./jubjub": { - "types": "./jubjub.d.ts", - "import": "./esm/jubjub.js", - "default": "./jubjub.js" - }, - "./p256": { - "types": "./p256.d.ts", - "import": "./esm/p256.js", - "default": "./p256.js" - }, - "./p384": { - "types": "./p384.d.ts", - "import": "./esm/p384.js", - "default": "./p384.js" - }, - "./p521": { - "types": "./p521.d.ts", - "import": "./esm/p521.js", - "default": "./p521.js" - }, - "./pasta": { - "types": "./pasta.d.ts", - "import": "./esm/pasta.js", - "default": "./pasta.js" - }, - "./secp256k1": { - "types": "./secp256k1.d.ts", - "import": "./esm/secp256k1.js", - "default": "./secp256k1.js" - } - }, - "keywords": [ - "elliptic", - "curve", - "cryptography", - "weierstrass", - "montgomery", - "edwards", - "p256", - "p384", - "p521", - "secp256r1", - "secp256k1", - "ed25519", - "ed448", - "x25519", - "ed25519", - "bls12-381", - "bn254", - "pasta", - "bls", - "noble", - "ecc", - "ecdsa", - "eddsa", - "schnorr" - ], - "funding": "https://paulmillr.com/funding/" -} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/pasta.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/pasta.d.ts deleted file mode 100644 index 9e1f4ed4..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/pasta.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export declare const p: bigint; -export declare const q: bigint; -export declare const pallas: import("./abstract/weierstrass.js").CurveFn; -export declare const vesta: import("./abstract/weierstrass.js").CurveFn; -//# sourceMappingURL=pasta.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/pasta.d.ts.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/pasta.d.ts.map deleted file mode 100644 index d4e6dd52..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/pasta.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pasta.d.ts","sourceRoot":"","sources":["src/pasta.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,CAAC,QAA+E,CAAC;AAC9F,eAAO,MAAM,CAAC,QAA+E,CAAC;AAG9F,eAAO,MAAM,MAAM,6CASjB,CAAC;AAEH,eAAO,MAAM,KAAK,6CAShB,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/pasta.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/pasta.js deleted file mode 100644 index c3bee21d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/pasta.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.vesta = exports.pallas = exports.q = exports.p = void 0; -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const sha256_1 = require("@noble/hashes/sha256"); -const weierstrass_js_1 = require("./abstract/weierstrass.js"); -const _shortw_utils_js_1 = require("./_shortw_utils.js"); -const mod = require("./abstract/modular.js"); -exports.p = BigInt('0x40000000000000000000000000000000224698fc094cf91b992d30ed00000001'); -exports.q = BigInt('0x40000000000000000000000000000000224698fc0994a8dd8c46eb2100000001'); -// https://neuromancer.sk/std/other/Pallas -exports.pallas = (0, weierstrass_js_1.weierstrass)({ - a: BigInt(0), - b: BigInt(5), - Fp: mod.Field(exports.p), - n: exports.q, - Gx: mod.mod(BigInt(-1), exports.p), - Gy: BigInt(2), - h: BigInt(1), - ...(0, _shortw_utils_js_1.getHash)(sha256_1.sha256), -}); -// https://neuromancer.sk/std/other/Vesta -exports.vesta = (0, weierstrass_js_1.weierstrass)({ - a: BigInt(0), - b: BigInt(5), - Fp: mod.Field(exports.q), - n: exports.p, - Gx: mod.mod(BigInt(-1), exports.q), - Gy: BigInt(2), - h: BigInt(1), - ...(0, _shortw_utils_js_1.getHash)(sha256_1.sha256), -}); -//# sourceMappingURL=pasta.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/pasta.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/pasta.js.map deleted file mode 100644 index 5ea530cc..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/pasta.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pasta.js","sourceRoot":"","sources":["src/pasta.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,iDAA8C;AAC9C,8DAAwD;AACxD,yDAA6C;AAC7C,6CAA6C;AAEhC,QAAA,CAAC,GAAG,MAAM,CAAC,oEAAoE,CAAC,CAAC;AACjF,QAAA,CAAC,GAAG,MAAM,CAAC,oEAAoE,CAAC,CAAC;AAE9F,0CAA0C;AAC7B,QAAA,MAAM,GAAG,IAAA,4BAAW,EAAC;IAChC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,EAAE,EAAE,GAAG,CAAC,KAAK,CAAC,SAAC,CAAC;IAChB,CAAC,EAAE,SAAC;IACJ,EAAE,EAAE,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,SAAC,CAAC;IAC1B,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;IACb,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,GAAG,IAAA,0BAAO,EAAC,eAAM,CAAC;CACnB,CAAC,CAAC;AACH,yCAAyC;AAC5B,QAAA,KAAK,GAAG,IAAA,4BAAW,EAAC;IAC/B,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,EAAE,EAAE,GAAG,CAAC,KAAK,CAAC,SAAC,CAAC;IAChB,CAAC,EAAE,SAAC;IACJ,EAAE,EAAE,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,SAAC,CAAC;IAC1B,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;IACb,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,GAAG,IAAA,0BAAO,EAAC,eAAM,CAAC;CACnB,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/secp256k1.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/secp256k1.d.ts deleted file mode 100644 index b94df777..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/secp256k1.d.ts +++ /dev/null @@ -1,93 +0,0 @@ -import { mod } from './abstract/modular.js'; -import { ProjPointType as PointType } from './abstract/weierstrass.js'; -import type { Hex, PrivKey } from './abstract/utils.js'; -import { bytesToNumberBE, numberToBytesBE } from './abstract/utils.js'; -export declare const secp256k1: Readonly<{ - create: (hash: import("./abstract/utils.js").CHash) => import("./abstract/weierstrass.js").CurveFn; - CURVE: Readonly<{ - readonly nBitLength: number; - readonly nByteLength: number; - readonly Fp: import("./abstract/modular.js").IField; - readonly n: bigint; - readonly h: bigint; - readonly hEff?: bigint | undefined; - readonly Gx: bigint; - readonly Gy: bigint; - readonly allowInfinityPoint?: boolean | undefined; - readonly a: bigint; - readonly b: bigint; - readonly allowedPrivateKeyLengths?: readonly number[] | undefined; - readonly wrapPrivateKey?: boolean | undefined; - readonly endo?: { - beta: bigint; - splitScalar: (k: bigint) => { - k1neg: boolean; - k1: bigint; - k2neg: boolean; - k2: bigint; - }; - } | undefined; - readonly isTorsionFree?: ((c: import("./abstract/weierstrass.js").ProjConstructor, point: PointType) => boolean) | undefined; - readonly clearCofactor?: ((c: import("./abstract/weierstrass.js").ProjConstructor, point: PointType) => PointType) | undefined; - readonly hash: import("./abstract/utils.js").CHash; - readonly hmac: (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array; - readonly randomBytes: (bytesLength?: number | undefined) => Uint8Array; - lowS: boolean; - readonly bits2int?: ((bytes: Uint8Array) => bigint) | undefined; - readonly bits2int_modN?: ((bytes: Uint8Array) => bigint) | undefined; - readonly p: bigint; - }>; - getPublicKey: (privateKey: PrivKey, isCompressed?: boolean | undefined) => Uint8Array; - getSharedSecret: (privateA: PrivKey, publicB: Hex, isCompressed?: boolean | undefined) => Uint8Array; - sign: (msgHash: Hex, privKey: PrivKey, opts?: import("./abstract/weierstrass.js").SignOpts | undefined) => import("./abstract/weierstrass.js").RecoveredSignatureType; - verify: (signature: Hex | { - r: bigint; - s: bigint; - }, msgHash: Hex, publicKey: Hex, opts?: import("./abstract/weierstrass.js").VerOpts | undefined) => boolean; - ProjectivePoint: import("./abstract/weierstrass.js").ProjConstructor; - Signature: import("./abstract/weierstrass.js").SignatureConstructor; - utils: { - normPrivateKeyToScalar: (key: PrivKey) => bigint; - isValidPrivateKey(privateKey: PrivKey): boolean; - randomPrivateKey: () => Uint8Array; - precompute: (windowSize?: number | undefined, point?: PointType | undefined) => PointType; - }; -}>; -declare function taggedHash(tag: string, ...messages: Uint8Array[]): Uint8Array; -/** - * lift_x from BIP340. Convert 32-byte x coordinate to elliptic curve point. - * @returns valid point checked for being on-curve - */ -declare function lift_x(x: bigint): PointType; -/** - * Schnorr public key is just `x` coordinate of Point as per BIP340. - */ -declare function schnorrGetPublicKey(privateKey: Hex): Uint8Array; -/** - * Creates Schnorr signature as per BIP340. Verifies itself before returning anything. - * auxRand is optional and is not the sole source of k generation: bad CSPRNG won't be dangerous. - */ -declare function schnorrSign(message: Hex, privateKey: PrivKey, auxRand?: Hex): Uint8Array; -/** - * Verifies Schnorr signature. - * Will swallow errors & return false except for initial type validation of arguments. - */ -declare function schnorrVerify(signature: Hex, message: Hex, publicKey: Hex): boolean; -export declare const schnorr: { - getPublicKey: typeof schnorrGetPublicKey; - sign: typeof schnorrSign; - verify: typeof schnorrVerify; - utils: { - randomPrivateKey: () => Uint8Array; - lift_x: typeof lift_x; - pointToBytes: (point: PointType) => Uint8Array; - numberToBytesBE: typeof numberToBytesBE; - bytesToNumberBE: typeof bytesToNumberBE; - taggedHash: typeof taggedHash; - mod: typeof mod; - }; -}; -export declare const hashToCurve: (msg: Uint8Array, options?: import("./abstract/hash-to-curve.js").htfBasicOpts | undefined) => import("./abstract/hash-to-curve.js").H2CPoint; -export declare const encodeToCurve: (msg: Uint8Array, options?: import("./abstract/hash-to-curve.js").htfBasicOpts | undefined) => import("./abstract/hash-to-curve.js").H2CPoint; -export {}; -//# sourceMappingURL=secp256k1.d.ts.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/secp256k1.d.ts.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/secp256k1.d.ts.map deleted file mode 100644 index c6ddafc7..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/secp256k1.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"secp256k1.d.ts","sourceRoot":"","sources":["src/secp256k1.ts"],"names":[],"mappings":"AAGA,OAAO,EAAS,GAAG,EAAQ,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,aAAa,IAAI,SAAS,EAAuB,MAAM,2BAA2B,CAAC;AAC5F,OAAO,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,eAAe,EAA4B,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAwCjG,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CrB,CAAC;AASF,iBAAS,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,UAAU,EAAE,GAAG,UAAU,CAQtE;AAkBD;;;GAGG;AACH,iBAAS,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,CAS5C;AAQD;;GAEG;AACH,iBAAS,mBAAmB,CAAC,UAAU,EAAE,GAAG,GAAG,UAAU,CAExD;AAED;;;GAGG;AACH,iBAAS,WAAW,CAClB,OAAO,EAAE,GAAG,EACZ,UAAU,EAAE,OAAO,EACnB,OAAO,GAAE,GAAqB,GAC7B,UAAU,CAgBZ;AAED;;;GAGG;AACH,iBAAS,aAAa,CAAC,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,GAAG,OAAO,CAiB5E;AAED,eAAO,MAAM,OAAO;;;;;;;8BA5FS,UAAU,MAAM,CAAC;;;;;;CAyGzC,CAAC;AA0DN,eAAO,MAAM,WAAW,uJAA4C,CAAC;AACrE,eAAO,MAAM,aAAa,uJAA8C,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/secp256k1.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/secp256k1.js deleted file mode 100644 index 463edccb..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/secp256k1.js +++ /dev/null @@ -1,257 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.encodeToCurve = exports.hashToCurve = exports.schnorr = exports.secp256k1 = void 0; -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -const sha256_1 = require("@noble/hashes/sha256"); -const utils_1 = require("@noble/hashes/utils"); -const modular_js_1 = require("./abstract/modular.js"); -const weierstrass_js_1 = require("./abstract/weierstrass.js"); -const utils_js_1 = require("./abstract/utils.js"); -const hash_to_curve_js_1 = require("./abstract/hash-to-curve.js"); -const _shortw_utils_js_1 = require("./_shortw_utils.js"); -const secp256k1P = BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f'); -const secp256k1N = BigInt('0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141'); -const _1n = BigInt(1); -const _2n = BigInt(2); -const divNearest = (a, b) => (a + b / _2n) / b; -/** - * √n = n^((p+1)/4) for fields p = 3 mod 4. We unwrap the loop and multiply bit-by-bit. - * (P+1n/4n).toString(2) would produce bits [223x 1, 0, 22x 1, 4x 0, 11, 00] - */ -function sqrtMod(y) { - const P = secp256k1P; - // prettier-ignore - const _3n = BigInt(3), _6n = BigInt(6), _11n = BigInt(11), _22n = BigInt(22); - // prettier-ignore - const _23n = BigInt(23), _44n = BigInt(44), _88n = BigInt(88); - const b2 = (y * y * y) % P; // x^3, 11 - const b3 = (b2 * b2 * y) % P; // x^7 - const b6 = ((0, modular_js_1.pow2)(b3, _3n, P) * b3) % P; - const b9 = ((0, modular_js_1.pow2)(b6, _3n, P) * b3) % P; - const b11 = ((0, modular_js_1.pow2)(b9, _2n, P) * b2) % P; - const b22 = ((0, modular_js_1.pow2)(b11, _11n, P) * b11) % P; - const b44 = ((0, modular_js_1.pow2)(b22, _22n, P) * b22) % P; - const b88 = ((0, modular_js_1.pow2)(b44, _44n, P) * b44) % P; - const b176 = ((0, modular_js_1.pow2)(b88, _88n, P) * b88) % P; - const b220 = ((0, modular_js_1.pow2)(b176, _44n, P) * b44) % P; - const b223 = ((0, modular_js_1.pow2)(b220, _3n, P) * b3) % P; - const t1 = ((0, modular_js_1.pow2)(b223, _23n, P) * b22) % P; - const t2 = ((0, modular_js_1.pow2)(t1, _6n, P) * b2) % P; - const root = (0, modular_js_1.pow2)(t2, _2n, P); - if (!Fp.eql(Fp.sqr(root), y)) - throw new Error('Cannot find square root'); - return root; -} -const Fp = (0, modular_js_1.Field)(secp256k1P, undefined, undefined, { sqrt: sqrtMod }); -exports.secp256k1 = (0, _shortw_utils_js_1.createCurve)({ - a: BigInt(0), - b: BigInt(7), - Fp, - n: secp256k1N, - // Base point (x, y) aka generator point - Gx: BigInt('55066263022277343669578718895168534326250603453777594175500187360389116729240'), - Gy: BigInt('32670510020758816978083085130507043184471273380659243275938904335757337482424'), - h: BigInt(1), - lowS: true, - /** - * secp256k1 belongs to Koblitz curves: it has efficiently computable endomorphism. - * Endomorphism uses 2x less RAM, speeds up precomputation by 2x and ECDH / key recovery by 20%. - * For precomputed wNAF it trades off 1/2 init time & 1/3 ram for 20% perf hit. - * Explanation: https://gist.github.com/paulmillr/eb670806793e84df628a7c434a873066 - */ - endo: { - beta: BigInt('0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee'), - splitScalar: (k) => { - const n = secp256k1N; - const a1 = BigInt('0x3086d221a7d46bcde86c90e49284eb15'); - const b1 = -_1n * BigInt('0xe4437ed6010e88286f547fa90abfe4c3'); - const a2 = BigInt('0x114ca50f7a8e2f3f657c1108d9d44cfd8'); - const b2 = a1; - const POW_2_128 = BigInt('0x100000000000000000000000000000000'); // (2n**128n).toString(16) - const c1 = divNearest(b2 * k, n); - const c2 = divNearest(-b1 * k, n); - let k1 = (0, modular_js_1.mod)(k - c1 * a1 - c2 * a2, n); - let k2 = (0, modular_js_1.mod)(-c1 * b1 - c2 * b2, n); - const k1neg = k1 > POW_2_128; - const k2neg = k2 > POW_2_128; - if (k1neg) - k1 = n - k1; - if (k2neg) - k2 = n - k2; - if (k1 > POW_2_128 || k2 > POW_2_128) { - throw new Error('splitScalar: Endomorphism failed, k=' + k); - } - return { k1neg, k1, k2neg, k2 }; - }, - }, -}, sha256_1.sha256); -// Schnorr signatures are superior to ECDSA from above. Below is Schnorr-specific BIP0340 code. -// https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki -const _0n = BigInt(0); -const fe = (x) => typeof x === 'bigint' && _0n < x && x < secp256k1P; -const ge = (x) => typeof x === 'bigint' && _0n < x && x < secp256k1N; -/** An object mapping tags to their tagged hash prefix of [SHA256(tag) | SHA256(tag)] */ -const TAGGED_HASH_PREFIXES = {}; -function taggedHash(tag, ...messages) { - let tagP = TAGGED_HASH_PREFIXES[tag]; - if (tagP === undefined) { - const tagH = (0, sha256_1.sha256)(Uint8Array.from(tag, (c) => c.charCodeAt(0))); - tagP = (0, utils_js_1.concatBytes)(tagH, tagH); - TAGGED_HASH_PREFIXES[tag] = tagP; - } - return (0, sha256_1.sha256)((0, utils_js_1.concatBytes)(tagP, ...messages)); -} -// ECDSA compact points are 33-byte. Schnorr is 32: we strip first byte 0x02 or 0x03 -const pointToBytes = (point) => point.toRawBytes(true).slice(1); -const numTo32b = (n) => (0, utils_js_1.numberToBytesBE)(n, 32); -const modP = (x) => (0, modular_js_1.mod)(x, secp256k1P); -const modN = (x) => (0, modular_js_1.mod)(x, secp256k1N); -const Point = exports.secp256k1.ProjectivePoint; -const GmulAdd = (Q, a, b) => Point.BASE.multiplyAndAddUnsafe(Q, a, b); -// Calculate point, scalar and bytes -function schnorrGetExtPubKey(priv) { - let d_ = exports.secp256k1.utils.normPrivateKeyToScalar(priv); // same method executed in fromPrivateKey - let p = Point.fromPrivateKey(d_); // P = d'⋅G; 0 < d' < n check is done inside - const scalar = p.hasEvenY() ? d_ : modN(-d_); - return { scalar: scalar, bytes: pointToBytes(p) }; -} -/** - * lift_x from BIP340. Convert 32-byte x coordinate to elliptic curve point. - * @returns valid point checked for being on-curve - */ -function lift_x(x) { - if (!fe(x)) - throw new Error('bad x: need 0 < x < p'); // Fail if x ≥ p. - const xx = modP(x * x); - const c = modP(xx * x + BigInt(7)); // Let c = x³ + 7 mod p. - let y = sqrtMod(c); // Let y = c^(p+1)/4 mod p. - if (y % _2n !== _0n) - y = modP(-y); // Return the unique point P such that x(P) = x and - const p = new Point(x, y, _1n); // y(P) = y if y mod 2 = 0 or y(P) = p-y otherwise. - p.assertValidity(); - return p; -} -/** - * Create tagged hash, convert it to bigint, reduce modulo-n. - */ -function challenge(...args) { - return modN((0, utils_js_1.bytesToNumberBE)(taggedHash('BIP0340/challenge', ...args))); -} -/** - * Schnorr public key is just `x` coordinate of Point as per BIP340. - */ -function schnorrGetPublicKey(privateKey) { - return schnorrGetExtPubKey(privateKey).bytes; // d'=int(sk). Fail if d'=0 or d'≥n. Ret bytes(d'⋅G) -} -/** - * Creates Schnorr signature as per BIP340. Verifies itself before returning anything. - * auxRand is optional and is not the sole source of k generation: bad CSPRNG won't be dangerous. - */ -function schnorrSign(message, privateKey, auxRand = (0, utils_1.randomBytes)(32)) { - const m = (0, utils_js_1.ensureBytes)('message', message); - const { bytes: px, scalar: d } = schnorrGetExtPubKey(privateKey); // checks for isWithinCurveOrder - const a = (0, utils_js_1.ensureBytes)('auxRand', auxRand, 32); // Auxiliary random data a: a 32-byte array - const t = numTo32b(d ^ (0, utils_js_1.bytesToNumberBE)(taggedHash('BIP0340/aux', a))); // Let t be the byte-wise xor of bytes(d) and hash/aux(a) - const rand = taggedHash('BIP0340/nonce', t, px, m); // Let rand = hash/nonce(t || bytes(P) || m) - const k_ = modN((0, utils_js_1.bytesToNumberBE)(rand)); // Let k' = int(rand) mod n - if (k_ === _0n) - throw new Error('sign failed: k is zero'); // Fail if k' = 0. - const { bytes: rx, scalar: k } = schnorrGetExtPubKey(k_); // Let R = k'⋅G. - const e = challenge(rx, px, m); // Let e = int(hash/challenge(bytes(R) || bytes(P) || m)) mod n. - const sig = new Uint8Array(64); // Let sig = bytes(R) || bytes((k + ed) mod n). - sig.set(rx, 0); - sig.set(numTo32b(modN(k + e * d)), 32); - // If Verify(bytes(P), m, sig) (see below) returns failure, abort - if (!schnorrVerify(sig, m, px)) - throw new Error('sign: Invalid signature produced'); - return sig; -} -/** - * Verifies Schnorr signature. - * Will swallow errors & return false except for initial type validation of arguments. - */ -function schnorrVerify(signature, message, publicKey) { - const sig = (0, utils_js_1.ensureBytes)('signature', signature, 64); - const m = (0, utils_js_1.ensureBytes)('message', message); - const pub = (0, utils_js_1.ensureBytes)('publicKey', publicKey, 32); - try { - const P = lift_x((0, utils_js_1.bytesToNumberBE)(pub)); // P = lift_x(int(pk)); fail if that fails - const r = (0, utils_js_1.bytesToNumberBE)(sig.subarray(0, 32)); // Let r = int(sig[0:32]); fail if r ≥ p. - if (!fe(r)) - return false; - const s = (0, utils_js_1.bytesToNumberBE)(sig.subarray(32, 64)); // Let s = int(sig[32:64]); fail if s ≥ n. - if (!ge(s)) - return false; - const e = challenge(numTo32b(r), pointToBytes(P), m); // int(challenge(bytes(r)||bytes(P)||m))%n - const R = GmulAdd(P, s, modN(-e)); // R = s⋅G - e⋅P - if (!R || !R.hasEvenY() || R.toAffine().x !== r) - return false; // -eP == (n-e)P - return true; // Fail if is_infinite(R) / not has_even_y(R) / x(R) ≠ r. - } - catch (error) { - return false; - } -} -exports.schnorr = (() => ({ - getPublicKey: schnorrGetPublicKey, - sign: schnorrSign, - verify: schnorrVerify, - utils: { - randomPrivateKey: exports.secp256k1.utils.randomPrivateKey, - lift_x, - pointToBytes, - numberToBytesBE: utils_js_1.numberToBytesBE, - bytesToNumberBE: utils_js_1.bytesToNumberBE, - taggedHash, - mod: modular_js_1.mod, - }, -}))(); -const isoMap = /* @__PURE__ */ (() => (0, hash_to_curve_js_1.isogenyMap)(Fp, [ - // xNum - [ - '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7', - '0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581', - '0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262', - '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c', - ], - // xDen - [ - '0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b', - '0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14', - '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1 - ], - // yNum - [ - '0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c', - '0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3', - '0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931', - '0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84', - ], - // yDen - [ - '0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b', - '0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573', - '0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f', - '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1 - ], -].map((i) => i.map((j) => BigInt(j)))))(); -const mapSWU = /* @__PURE__ */ (() => (0, weierstrass_js_1.mapToCurveSimpleSWU)(Fp, { - A: BigInt('0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533'), - B: BigInt('1771'), - Z: Fp.create(BigInt('-11')), -}))(); -const htf = /* @__PURE__ */ (() => (0, hash_to_curve_js_1.createHasher)(exports.secp256k1.ProjectivePoint, (scalars) => { - const { x, y } = mapSWU(Fp.create(scalars[0])); - return isoMap(x, y); -}, { - DST: 'secp256k1_XMD:SHA-256_SSWU_RO_', - encodeDST: 'secp256k1_XMD:SHA-256_SSWU_NU_', - p: Fp.ORDER, - m: 1, - k: 128, - expand: 'xmd', - hash: sha256_1.sha256, -}))(); -exports.hashToCurve = (() => htf.hashToCurve)(); -exports.encodeToCurve = (() => htf.encodeToCurve)(); -//# sourceMappingURL=secp256k1.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/secp256k1.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/secp256k1.js.map deleted file mode 100644 index 4d76de26..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/secp256k1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"secp256k1.js","sourceRoot":"","sources":["src/secp256k1.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,iDAA8C;AAC9C,+CAAkD;AAClD,sDAAyD;AACzD,8DAA4F;AAE5F,kDAAiG;AACjG,kEAAuE;AACvE,yDAAiD;AAEjD,MAAM,UAAU,GAAG,MAAM,CAAC,oEAAoE,CAAC,CAAC;AA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,EAAC,EAAE,EAAE;IACtB,CAAC,EAAE,MAAM,CAAC,oEAAoE,CAAC;IAC/E,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC;IACjB,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;CAC5B,CAAC,CAAC,EAAE,CAAC;AACR,MAAM,GAAG,GAAG,eAAe,CAAC,CAAC,GAAG,EAAE,CAChC,IAAA,+BAAY,EACV,iBAAS,CAAC,eAAe,EACzB,CAAC,OAAiB,EAAE,EAAE;IACpB,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/C,OAAO,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACtB,CAAC,EACD;IACE,GAAG,EAAE,gCAAgC;IACrC,SAAS,EAAE,gCAAgC;IAC3C,CAAC,EAAE,EAAE,CAAC,KAAK;IACX,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,GAAG;IACN,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,eAAM;CACb,CACF,CAAC,EAAE,CAAC;AACM,QAAA,WAAW,GAAmB,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;AACxD,QAAA,aAAa,GAAmB,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/_shortw_utils.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/_shortw_utils.ts deleted file mode 100644 index 3ae5ca43..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/_shortw_utils.ts +++ /dev/null @@ -1,20 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { hmac } from '@noble/hashes/hmac'; -import { concatBytes, randomBytes } from '@noble/hashes/utils'; -import { weierstrass, CurveType } from './abstract/weierstrass.js'; -import { CHash } from './abstract/utils.js'; - -// connects noble-curves to noble-hashes -export function getHash(hash: CHash) { - return { - hash, - hmac: (key: Uint8Array, ...msgs: Uint8Array[]) => hmac(hash, key, concatBytes(...msgs)), - randomBytes, - }; -} -// Same API as @noble/hashes, with ability to create curve with custom hash -type CurveDef = Readonly>; -export function createCurve(curveDef: CurveDef, defHash: CHash) { - const create = (hash: CHash) => weierstrass({ ...curveDef, ...getHash(hash) }); - return Object.freeze({ ...create(defHash), create }); -} diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/abstract/bls.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/abstract/bls.ts deleted file mode 100644 index ba4b6b05..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/abstract/bls.ts +++ /dev/null @@ -1,398 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -/** - * BLS (Barreto-Lynn-Scott) family of pairing-friendly curves. - * Implements BLS (Boneh-Lynn-Shacham) signatures. - * Consists of two curves: G1 and G2: - * - G1 is a subgroup of (x, y) E(Fq) over y² = x³ + 4. - * - G2 is a subgroup of ((x₁, x₂+i), (y₁, y₂+i)) E(Fq²) over y² = x³ + 4(1 + i) where i is √-1 - * - Gt, created by bilinear (ate) pairing e(G1, G2), consists of p-th roots of unity in - * Fq^k where k is embedding degree. Only degree 12 is currently supported, 24 is not. - * Pairing is used to aggregate and verify signatures. - * We are using Fp for private keys (shorter) and Fp₂ for signatures (longer). - * Some projects may prefer to swap this relation, it is not supported for now. - */ -import { AffinePoint } from './curve.js'; -import { IField, getMinHashLength, mapHashToField } from './modular.js'; -import { Hex, PrivKey, CHash, bitLen, bitGet, ensureBytes } from './utils.js'; -import * as htf from './hash-to-curve.js'; -import { - CurvePointsType, - ProjPointType as ProjPointType, - CurvePointsRes, - weierstrassPoints, -} from './weierstrass.js'; - -type Fp = bigint; // Can be different field? - -// prettier-ignore -const _2n = BigInt(2), _3n = BigInt(3); - -export type SignatureCoder = { - fromHex(hex: Hex): ProjPointType; - toRawBytes(point: ProjPointType): Uint8Array; - toHex(point: ProjPointType): string; -}; - -export type CurveType = { - G1: Omit, 'n'> & { - mapToCurve: htf.MapToCurve; - htfDefaults: htf.Opts; - }; - G2: Omit, 'n'> & { - Signature: SignatureCoder; - mapToCurve: htf.MapToCurve; - htfDefaults: htf.Opts; - }; - fields: { - Fp: IField; - Fr: IField; - Fp2: IField & { - reim: (num: Fp2) => { re: bigint; im: bigint }; - multiplyByB: (num: Fp2) => Fp2; - frobeniusMap(num: Fp2, power: number): Fp2; - }; - Fp6: IField; - Fp12: IField & { - frobeniusMap(num: Fp12, power: number): Fp12; - multiplyBy014(num: Fp12, o0: Fp2, o1: Fp2, o4: Fp2): Fp12; - conjugate(num: Fp12): Fp12; - finalExponentiate(num: Fp12): Fp12; - }; - }; - params: { - x: bigint; - r: bigint; - }; - htfDefaults: htf.Opts; - hash: CHash; // Because we need outputLen for DRBG - randomBytes: (bytesLength?: number) => Uint8Array; -}; - -export type CurveFn = { - getPublicKey: (privateKey: PrivKey) => Uint8Array; - sign: { - (message: Hex, privateKey: PrivKey): Uint8Array; - (message: ProjPointType, privateKey: PrivKey): ProjPointType; - }; - verify: ( - signature: Hex | ProjPointType, - message: Hex | ProjPointType, - publicKey: Hex | ProjPointType - ) => boolean; - verifyBatch: ( - signature: Hex | ProjPointType, - messages: (Hex | ProjPointType)[], - publicKeys: (Hex | ProjPointType)[] - ) => boolean; - aggregatePublicKeys: { - (publicKeys: Hex[]): Uint8Array; - (publicKeys: ProjPointType[]): ProjPointType; - }; - aggregateSignatures: { - (signatures: Hex[]): Uint8Array; - (signatures: ProjPointType[]): ProjPointType; - }; - millerLoop: (ell: [Fp2, Fp2, Fp2][], g1: [Fp, Fp]) => Fp12; - pairing: (P: ProjPointType, Q: ProjPointType, withFinalExponent?: boolean) => Fp12; - G1: CurvePointsRes & ReturnType>; - G2: CurvePointsRes & ReturnType>; - Signature: SignatureCoder; - params: { - x: bigint; - r: bigint; - G1b: bigint; - G2b: Fp2; - }; - fields: { - Fp: IField; - Fp2: IField; - Fp6: IField; - Fp12: IField; - Fr: IField; - }; - utils: { - randomPrivateKey: () => Uint8Array; - calcPairingPrecomputes: (p: AffinePoint) => [Fp2, Fp2, Fp2][]; - }; -}; - -export function bls( - CURVE: CurveType -): CurveFn { - // Fields are specific for curve, so for now we'll need to pass them with opts - const { Fp, Fr, Fp2, Fp6, Fp12 } = CURVE.fields; - const BLS_X_LEN = bitLen(CURVE.params.x); - - // Pre-compute coefficients for sparse multiplication - // Point addition and point double calculations is reused for coefficients - function calcPairingPrecomputes(p: AffinePoint) { - const { x, y } = p; - // prettier-ignore - const Qx = x, Qy = y, Qz = Fp2.ONE; - // prettier-ignore - let Rx = Qx, Ry = Qy, Rz = Qz; - let ell_coeff: [Fp2, Fp2, Fp2][] = []; - for (let i = BLS_X_LEN - 2; i >= 0; i--) { - // Double - let t0 = Fp2.sqr(Ry); // Ry² - let t1 = Fp2.sqr(Rz); // Rz² - let t2 = Fp2.multiplyByB(Fp2.mul(t1, _3n)); // 3 * T1 * B - let t3 = Fp2.mul(t2, _3n); // 3 * T2 - let t4 = Fp2.sub(Fp2.sub(Fp2.sqr(Fp2.add(Ry, Rz)), t1), t0); // (Ry + Rz)² - T1 - T0 - ell_coeff.push([ - Fp2.sub(t2, t0), // T2 - T0 - Fp2.mul(Fp2.sqr(Rx), _3n), // 3 * Rx² - Fp2.neg(t4), // -T4 - ]); - Rx = Fp2.div(Fp2.mul(Fp2.mul(Fp2.sub(t0, t3), Rx), Ry), _2n); // ((T0 - T3) * Rx * Ry) / 2 - Ry = Fp2.sub(Fp2.sqr(Fp2.div(Fp2.add(t0, t3), _2n)), Fp2.mul(Fp2.sqr(t2), _3n)); // ((T0 + T3) / 2)² - 3 * T2² - Rz = Fp2.mul(t0, t4); // T0 * T4 - if (bitGet(CURVE.params.x, i)) { - // Addition - let t0 = Fp2.sub(Ry, Fp2.mul(Qy, Rz)); // Ry - Qy * Rz - let t1 = Fp2.sub(Rx, Fp2.mul(Qx, Rz)); // Rx - Qx * Rz - ell_coeff.push([ - Fp2.sub(Fp2.mul(t0, Qx), Fp2.mul(t1, Qy)), // T0 * Qx - T1 * Qy - Fp2.neg(t0), // -T0 - t1, // T1 - ]); - let t2 = Fp2.sqr(t1); // T1² - let t3 = Fp2.mul(t2, t1); // T2 * T1 - let t4 = Fp2.mul(t2, Rx); // T2 * Rx - let t5 = Fp2.add(Fp2.sub(t3, Fp2.mul(t4, _2n)), Fp2.mul(Fp2.sqr(t0), Rz)); // T3 - 2 * T4 + T0² * Rz - Rx = Fp2.mul(t1, t5); // T1 * T5 - Ry = Fp2.sub(Fp2.mul(Fp2.sub(t4, t5), t0), Fp2.mul(t3, Ry)); // (T4 - T5) * T0 - T3 * Ry - Rz = Fp2.mul(Rz, t3); // Rz * T3 - } - } - return ell_coeff; - } - - function millerLoop(ell: [Fp2, Fp2, Fp2][], g1: [Fp, Fp]): Fp12 { - const { x } = CURVE.params; - const Px = g1[0]; - const Py = g1[1]; - let f12 = Fp12.ONE; - for (let j = 0, i = BLS_X_LEN - 2; i >= 0; i--, j++) { - const E = ell[j]; - f12 = Fp12.multiplyBy014(f12, E[0], Fp2.mul(E[1], Px), Fp2.mul(E[2], Py)); - if (bitGet(x, i)) { - j += 1; - const F = ell[j]; - f12 = Fp12.multiplyBy014(f12, F[0], Fp2.mul(F[1], Px), Fp2.mul(F[2], Py)); - } - if (i !== 0) f12 = Fp12.sqr(f12); - } - return Fp12.conjugate(f12); - } - - const utils = { - randomPrivateKey: (): Uint8Array => { - const length = getMinHashLength(Fr.ORDER); - return mapHashToField(CURVE.randomBytes(length), Fr.ORDER); - }, - calcPairingPrecomputes, - }; - - // Point on G1 curve: (x, y) - const G1_ = weierstrassPoints({ n: Fr.ORDER, ...CURVE.G1 }); - const G1 = Object.assign( - G1_, - htf.createHasher(G1_.ProjectivePoint, CURVE.G1.mapToCurve, { - ...CURVE.htfDefaults, - ...CURVE.G1.htfDefaults, - }) - ); - - // Sparse multiplication against precomputed coefficients - // TODO: replace with weakmap? - type withPairingPrecomputes = { _PPRECOMPUTES: [Fp2, Fp2, Fp2][] | undefined }; - function pairingPrecomputes(point: G2): [Fp2, Fp2, Fp2][] { - const p = point as G2 & withPairingPrecomputes; - if (p._PPRECOMPUTES) return p._PPRECOMPUTES; - p._PPRECOMPUTES = calcPairingPrecomputes(point.toAffine()); - return p._PPRECOMPUTES; - } - - // TODO: export - // function clearPairingPrecomputes(point: G2) { - // const p = point as G2 & withPairingPrecomputes; - // p._PPRECOMPUTES = undefined; - // } - - // Point on G2 curve (complex numbers): (x₁, x₂+i), (y₁, y₂+i) - const G2_ = weierstrassPoints({ n: Fr.ORDER, ...CURVE.G2 }); - const G2 = Object.assign( - G2_, - htf.createHasher(G2_.ProjectivePoint as htf.H2CPointConstructor, CURVE.G2.mapToCurve, { - ...CURVE.htfDefaults, - ...CURVE.G2.htfDefaults, - }) - ); - - const { Signature } = CURVE.G2; - - // Calculates bilinear pairing - function pairing(Q: G1, P: G2, withFinalExponent: boolean = true): Fp12 { - if (Q.equals(G1.ProjectivePoint.ZERO) || P.equals(G2.ProjectivePoint.ZERO)) - throw new Error('pairing is not available for ZERO point'); - Q.assertValidity(); - P.assertValidity(); - // Performance: 9ms for millerLoop and ~14ms for exp. - const Qa = Q.toAffine(); - const looped = millerLoop(pairingPrecomputes(P), [Qa.x, Qa.y]); - return withFinalExponent ? Fp12.finalExponentiate(looped) : looped; - } - type G1 = typeof G1.ProjectivePoint.BASE; - type G2 = typeof G2.ProjectivePoint.BASE; - - type G1Hex = Hex | G1; - type G2Hex = Hex | G2; - function normP1(point: G1Hex): G1 { - return point instanceof G1.ProjectivePoint ? (point as G1) : G1.ProjectivePoint.fromHex(point); - } - function normP2(point: G2Hex): G2 { - return point instanceof G2.ProjectivePoint ? point : Signature.fromHex(point); - } - function normP2Hash(point: G2Hex, htfOpts?: htf.htfBasicOpts): G2 { - return point instanceof G2.ProjectivePoint - ? point - : (G2.hashToCurve(ensureBytes('point', point), htfOpts) as G2); - } - - // Multiplies generator by private key. - // P = pk x G - function getPublicKey(privateKey: PrivKey): Uint8Array { - return G1.ProjectivePoint.fromPrivateKey(privateKey).toRawBytes(true); - } - - // Executes `hashToCurve` on the message and then multiplies the result by private key. - // S = pk x H(m) - function sign(message: Hex, privateKey: PrivKey, htfOpts?: htf.htfBasicOpts): Uint8Array; - function sign(message: G2, privateKey: PrivKey, htfOpts?: htf.htfBasicOpts): G2; - function sign(message: G2Hex, privateKey: PrivKey, htfOpts?: htf.htfBasicOpts): Uint8Array | G2 { - const msgPoint = normP2Hash(message, htfOpts); - msgPoint.assertValidity(); - const sigPoint = msgPoint.multiply(G1.normPrivateKeyToScalar(privateKey)); - if (message instanceof G2.ProjectivePoint) return sigPoint; - return Signature.toRawBytes(sigPoint); - } - - // Checks if pairing of public key & hash is equal to pairing of generator & signature. - // e(P, H(m)) == e(G, S) - function verify( - signature: G2Hex, - message: G2Hex, - publicKey: G1Hex, - htfOpts?: htf.htfBasicOpts - ): boolean { - const P = normP1(publicKey); - const Hm = normP2Hash(message, htfOpts); - const G = G1.ProjectivePoint.BASE; - const S = normP2(signature); - // Instead of doing 2 exponentiations, we use property of billinear maps - // and do one exp after multiplying 2 points. - const ePHm = pairing(P.negate(), Hm, false); - const eGS = pairing(G, S, false); - const exp = Fp12.finalExponentiate(Fp12.mul(eGS, ePHm)); - return Fp12.eql(exp, Fp12.ONE); - } - - // Adds a bunch of public key points together. - // pk1 + pk2 + pk3 = pkA - function aggregatePublicKeys(publicKeys: Hex[]): Uint8Array; - function aggregatePublicKeys(publicKeys: G1[]): G1; - function aggregatePublicKeys(publicKeys: G1Hex[]): Uint8Array | G1 { - if (!publicKeys.length) throw new Error('Expected non-empty array'); - const agg = publicKeys.map(normP1).reduce((sum, p) => sum.add(p), G1.ProjectivePoint.ZERO); - const aggAffine = agg; //.toAffine(); - if (publicKeys[0] instanceof G1.ProjectivePoint) { - aggAffine.assertValidity(); - return aggAffine; - } - // toRawBytes ensures point validity - return aggAffine.toRawBytes(true); - } - - // Adds a bunch of signature points together. - function aggregateSignatures(signatures: Hex[]): Uint8Array; - function aggregateSignatures(signatures: G2[]): G2; - function aggregateSignatures(signatures: G2Hex[]): Uint8Array | G2 { - if (!signatures.length) throw new Error('Expected non-empty array'); - const agg = signatures.map(normP2).reduce((sum, s) => sum.add(s), G2.ProjectivePoint.ZERO); - const aggAffine = agg; //.toAffine(); - if (signatures[0] instanceof G2.ProjectivePoint) { - aggAffine.assertValidity(); - return aggAffine; - } - return Signature.toRawBytes(aggAffine); - } - - // https://ethresear.ch/t/fast-verification-of-multiple-bls-signatures/5407 - // e(G, S) = e(G, SUM(n)(Si)) = MUL(n)(e(G, Si)) - function verifyBatch( - signature: G2Hex, - messages: G2Hex[], - publicKeys: G1Hex[], - htfOpts?: htf.htfBasicOpts - ): boolean { - // @ts-ignore - // console.log('verifyBatch', bytesToHex(signature as any), messages, publicKeys.map(bytesToHex)); - - if (!messages.length) throw new Error('Expected non-empty messages array'); - if (publicKeys.length !== messages.length) - throw new Error('Pubkey count should equal msg count'); - const sig = normP2(signature); - const nMessages = messages.map((i) => normP2Hash(i, htfOpts)); - const nPublicKeys = publicKeys.map(normP1); - try { - const paired = []; - for (const message of new Set(nMessages)) { - const groupPublicKey = nMessages.reduce( - (groupPublicKey, subMessage, i) => - subMessage === message ? groupPublicKey.add(nPublicKeys[i]) : groupPublicKey, - G1.ProjectivePoint.ZERO - ); - // const msg = message instanceof PointG2 ? message : await PointG2.hashToCurve(message); - // Possible to batch pairing for same msg with different groupPublicKey here - paired.push(pairing(groupPublicKey, message, false)); - } - paired.push(pairing(G1.ProjectivePoint.BASE.negate(), sig, false)); - const product = paired.reduce((a, b) => Fp12.mul(a, b), Fp12.ONE); - const exp = Fp12.finalExponentiate(product); - return Fp12.eql(exp, Fp12.ONE); - } catch { - return false; - } - } - - G1.ProjectivePoint.BASE._setWindowSize(4); - - return { - getPublicKey, - sign, - verify, - verifyBatch, - aggregatePublicKeys, - aggregateSignatures, - millerLoop, - pairing, - G1, - G2, - Signature, - fields: { - Fr, - Fp, - Fp2, - Fp6, - Fp12, - }, - params: { - x: CURVE.params.x, - r: CURVE.params.r, - G1b: CURVE.G1.b, - G2b: CURVE.G2.b, - }, - utils, - }; -} diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/abstract/curve.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/abstract/curve.ts deleted file mode 100644 index 2876377b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/abstract/curve.ts +++ /dev/null @@ -1,203 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -// Abelian group utilities -import { IField, validateField, nLength } from './modular.js'; -import { validateObject } from './utils.js'; -const _0n = BigInt(0); -const _1n = BigInt(1); - -export type AffinePoint = { - x: T; - y: T; -} & { z?: never; t?: never }; - -export interface Group> { - double(): T; - negate(): T; - add(other: T): T; - subtract(other: T): T; - equals(other: T): boolean; - multiply(scalar: bigint): T; -} - -export type GroupConstructor = { - BASE: T; - ZERO: T; -}; -export type Mapper = (i: T[]) => T[]; - -// Elliptic curve multiplication of Point by scalar. Fragile. -// Scalars should always be less than curve order: this should be checked inside of a curve itself. -// Creates precomputation tables for fast multiplication: -// - private scalar is split by fixed size windows of W bits -// - every window point is collected from window's table & added to accumulator -// - since windows are different, same point inside tables won't be accessed more than once per calc -// - each multiplication is 'Math.ceil(CURVE_ORDER / 𝑊) + 1' point additions (fixed for any scalar) -// - +1 window is neccessary for wNAF -// - wNAF reduces table size: 2x less memory + 2x faster generation, but 10% slower multiplication -// TODO: Research returning 2d JS array of windows, instead of a single window. This would allow -// windows to be in different memory locations -export function wNAF>(c: GroupConstructor, bits: number) { - const constTimeNegate = (condition: boolean, item: T): T => { - const neg = item.negate(); - return condition ? neg : item; - }; - const opts = (W: number) => { - const windows = Math.ceil(bits / W) + 1; // +1, because - const windowSize = 2 ** (W - 1); // -1 because we skip zero - return { windows, windowSize }; - }; - return { - constTimeNegate, - // non-const time multiplication ladder - unsafeLadder(elm: T, n: bigint) { - let p = c.ZERO; - let d: T = elm; - while (n > _0n) { - if (n & _1n) p = p.add(d); - d = d.double(); - n >>= _1n; - } - return p; - }, - - /** - * Creates a wNAF precomputation window. Used for caching. - * Default window size is set by `utils.precompute()` and is equal to 8. - * Number of precomputed points depends on the curve size: - * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where: - * - 𝑊 is the window size - * - 𝑛 is the bitlength of the curve order. - * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224. - * @returns precomputed point tables flattened to a single array - */ - precomputeWindow(elm: T, W: number): Group[] { - const { windows, windowSize } = opts(W); - const points: T[] = []; - let p: T = elm; - let base = p; - for (let window = 0; window < windows; window++) { - base = p; - points.push(base); - // =1, because we skip zero - for (let i = 1; i < windowSize; i++) { - base = base.add(p); - points.push(base); - } - p = base.double(); - } - return points; - }, - - /** - * Implements ec multiplication using precomputed tables and w-ary non-adjacent form. - * @param W window size - * @param precomputes precomputed tables - * @param n scalar (we don't check here, but should be less than curve order) - * @returns real and fake (for const-time) points - */ - wNAF(W: number, precomputes: T[], n: bigint): { p: T; f: T } { - // TODO: maybe check that scalar is less than group order? wNAF behavious is undefined otherwise - // But need to carefully remove other checks before wNAF. ORDER == bits here - const { windows, windowSize } = opts(W); - - let p = c.ZERO; - let f = c.BASE; - - const mask = BigInt(2 ** W - 1); // Create mask with W ones: 0b1111 for W=4 etc. - const maxNumber = 2 ** W; - const shiftBy = BigInt(W); - - for (let window = 0; window < windows; window++) { - const offset = window * windowSize; - // Extract W bits. - let wbits = Number(n & mask); - - // Shift number by W bits. - n >>= shiftBy; - - // If the bits are bigger than max size, we'll split those. - // +224 => 256 - 32 - if (wbits > windowSize) { - wbits -= maxNumber; - n += _1n; - } - - // This code was first written with assumption that 'f' and 'p' will never be infinity point: - // since each addition is multiplied by 2 ** W, it cannot cancel each other. However, - // there is negate now: it is possible that negated element from low value - // would be the same as high element, which will create carry into next window. - // It's not obvious how this can fail, but still worth investigating later. - - // Check if we're onto Zero point. - // Add random point inside current window to f. - const offset1 = offset; - const offset2 = offset + Math.abs(wbits) - 1; // -1 because we skip zero - const cond1 = window % 2 !== 0; - const cond2 = wbits < 0; - if (wbits === 0) { - // The most important part for const-time getPublicKey - f = f.add(constTimeNegate(cond1, precomputes[offset1])); - } else { - p = p.add(constTimeNegate(cond2, precomputes[offset2])); - } - } - // JIT-compiler should not eliminate f here, since it will later be used in normalizeZ() - // Even if the variable is still unused, there are some checks which will - // throw an exception, so compiler needs to prove they won't happen, which is hard. - // At this point there is a way to F be infinity-point even if p is not, - // which makes it less const-time: around 1 bigint multiply. - return { p, f }; - }, - - wNAFCached(P: T, precomputesMap: Map, n: bigint, transform: Mapper): { p: T; f: T } { - // @ts-ignore - const W: number = P._WINDOW_SIZE || 1; - // Calculate precomputes on a first run, reuse them after - let comp = precomputesMap.get(P); - if (!comp) { - comp = this.precomputeWindow(P, W) as T[]; - if (W !== 1) { - precomputesMap.set(P, transform(comp)); - } - } - return this.wNAF(W, comp, n); - }, - }; -} - -// Generic BasicCurve interface: works even for polynomial fields (BLS): P, n, h would be ok. -// Though generator can be different (Fp2 / Fp6 for BLS). -export type BasicCurve = { - Fp: IField; // Field over which we'll do calculations (Fp) - n: bigint; // Curve order, total count of valid points in the field - nBitLength?: number; // bit length of curve order - nByteLength?: number; // byte length of curve order - h: bigint; // cofactor. we can assign default=1, but users will just ignore it w/o validation - hEff?: bigint; // Number to multiply to clear cofactor - Gx: T; // base point X coordinate - Gy: T; // base point Y coordinate - allowInfinityPoint?: boolean; // bls12-381 requires it. ZERO point is valid, but invalid pubkey -}; - -export function validateBasic(curve: BasicCurve & T) { - validateField(curve.Fp); - validateObject( - curve, - { - n: 'bigint', - h: 'bigint', - Gx: 'field', - Gy: 'field', - }, - { - nBitLength: 'isSafeInteger', - nByteLength: 'isSafeInteger', - } - ); - // Set defaults - return Object.freeze({ - ...nLength(curve.n, curve.nBitLength), - ...curve, - ...{ p: curve.Fp.ORDER }, - } as const); -} diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/abstract/edwards.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/abstract/edwards.ts deleted file mode 100644 index 9124f66a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/abstract/edwards.ts +++ /dev/null @@ -1,513 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -// Twisted Edwards curve. The formula is: ax² + y² = 1 + dx²y² -import { mod } from './modular.js'; -import * as ut from './utils.js'; -import { ensureBytes, FHash, Hex } from './utils.js'; -import { Group, GroupConstructor, wNAF, BasicCurve, validateBasic, AffinePoint } from './curve.js'; - -// Be friendly to bad ECMAScript parsers by not using bigint literals -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _8n = BigInt(8); - -// Edwards curves must declare params a & d. -export type CurveType = BasicCurve & { - a: bigint; // curve param a - d: bigint; // curve param d - hash: FHash; // Hashing - randomBytes: (bytesLength?: number) => Uint8Array; // CSPRNG - adjustScalarBytes?: (bytes: Uint8Array) => Uint8Array; // clears bits to get valid field elemtn - domain?: (data: Uint8Array, ctx: Uint8Array, phflag: boolean) => Uint8Array; // Used for hashing - uvRatio?: (u: bigint, v: bigint) => { isValid: boolean; value: bigint }; // Ratio √(u/v) - prehash?: FHash; // RFC 8032 pre-hashing of messages to sign() / verify() - mapToCurve?: (scalar: bigint[]) => AffinePoint; // for hash-to-curve standard -}; - -// verification rule is either zip215 or rfc8032 / nist186-5. Consult fromHex: -const VERIFY_DEFAULT = { zip215: true }; - -function validateOpts(curve: CurveType) { - const opts = validateBasic(curve); - ut.validateObject( - curve, - { - hash: 'function', - a: 'bigint', - d: 'bigint', - randomBytes: 'function', - }, - { - adjustScalarBytes: 'function', - domain: 'function', - uvRatio: 'function', - mapToCurve: 'function', - } - ); - // Set defaults - return Object.freeze({ ...opts } as const); -} - -// Instance of Extended Point with coordinates in X, Y, Z, T -export interface ExtPointType extends Group { - readonly ex: bigint; - readonly ey: bigint; - readonly ez: bigint; - readonly et: bigint; - get x(): bigint; - get y(): bigint; - assertValidity(): void; - multiply(scalar: bigint): ExtPointType; - multiplyUnsafe(scalar: bigint): ExtPointType; - isSmallOrder(): boolean; - isTorsionFree(): boolean; - clearCofactor(): ExtPointType; - toAffine(iz?: bigint): AffinePoint; - toRawBytes(isCompressed?: boolean): Uint8Array; - toHex(isCompressed?: boolean): string; -} -// Static methods of Extended Point with coordinates in X, Y, Z, T -export interface ExtPointConstructor extends GroupConstructor { - new (x: bigint, y: bigint, z: bigint, t: bigint): ExtPointType; - fromAffine(p: AffinePoint): ExtPointType; - fromHex(hex: Hex): ExtPointType; - fromPrivateKey(privateKey: Hex): ExtPointType; -} - -export type CurveFn = { - CURVE: ReturnType; - getPublicKey: (privateKey: Hex) => Uint8Array; - sign: (message: Hex, privateKey: Hex, options?: { context?: Hex }) => Uint8Array; - verify: ( - sig: Hex, - message: Hex, - publicKey: Hex, - options?: { context?: Hex; zip215: boolean } - ) => boolean; - ExtendedPoint: ExtPointConstructor; - utils: { - randomPrivateKey: () => Uint8Array; - getExtendedPublicKey: (key: Hex) => { - head: Uint8Array; - prefix: Uint8Array; - scalar: bigint; - point: ExtPointType; - pointBytes: Uint8Array; - }; - }; -}; - -// It is not generic twisted curve for now, but ed25519/ed448 generic implementation -export function twistedEdwards(curveDef: CurveType): CurveFn { - const CURVE = validateOpts(curveDef) as ReturnType; - const { - Fp, - n: CURVE_ORDER, - prehash: prehash, - hash: cHash, - randomBytes, - nByteLength, - h: cofactor, - } = CURVE; - const MASK = _2n << (BigInt(nByteLength * 8) - _1n); - const modP = Fp.create; // Function overrides - - // sqrt(u/v) - const uvRatio = - CURVE.uvRatio || - ((u: bigint, v: bigint) => { - try { - return { isValid: true, value: Fp.sqrt(u * Fp.inv(v)) }; - } catch (e) { - return { isValid: false, value: _0n }; - } - }); - const adjustScalarBytes = CURVE.adjustScalarBytes || ((bytes: Uint8Array) => bytes); // NOOP - const domain = - CURVE.domain || - ((data: Uint8Array, ctx: Uint8Array, phflag: boolean) => { - if (ctx.length || phflag) throw new Error('Contexts/pre-hash are not supported'); - return data; - }); // NOOP - const inBig = (n: bigint) => typeof n === 'bigint' && _0n < n; // n in [1..] - const inRange = (n: bigint, max: bigint) => inBig(n) && inBig(max) && n < max; // n in [1..max-1] - const in0MaskRange = (n: bigint) => n === _0n || inRange(n, MASK); // n in [0..MASK-1] - function assertInRange(n: bigint, max: bigint) { - // n in [1..max-1] - if (inRange(n, max)) return n; - throw new Error(`Expected valid scalar < ${max}, got ${typeof n} ${n}`); - } - function assertGE0(n: bigint) { - // n in [0..CURVE_ORDER-1] - return n === _0n ? n : assertInRange(n, CURVE_ORDER); // GE = prime subgroup, not full group - } - const pointPrecomputes = new Map(); - function isPoint(other: unknown) { - if (!(other instanceof Point)) throw new Error('ExtendedPoint expected'); - } - // Extended Point works in extended coordinates: (x, y, z, t) ∋ (x=x/z, y=y/z, t=xy). - // https://en.wikipedia.org/wiki/Twisted_Edwards_curve#Extended_coordinates - class Point implements ExtPointType { - static readonly BASE = new Point(CURVE.Gx, CURVE.Gy, _1n, modP(CURVE.Gx * CURVE.Gy)); - static readonly ZERO = new Point(_0n, _1n, _1n, _0n); // 0, 1, 1, 0 - - constructor( - readonly ex: bigint, - readonly ey: bigint, - readonly ez: bigint, - readonly et: bigint - ) { - if (!in0MaskRange(ex)) throw new Error('x required'); - if (!in0MaskRange(ey)) throw new Error('y required'); - if (!in0MaskRange(ez)) throw new Error('z required'); - if (!in0MaskRange(et)) throw new Error('t required'); - } - - get x(): bigint { - return this.toAffine().x; - } - get y(): bigint { - return this.toAffine().y; - } - - static fromAffine(p: AffinePoint): Point { - if (p instanceof Point) throw new Error('extended point not allowed'); - const { x, y } = p || {}; - if (!in0MaskRange(x) || !in0MaskRange(y)) throw new Error('invalid affine point'); - return new Point(x, y, _1n, modP(x * y)); - } - static normalizeZ(points: Point[]): Point[] { - const toInv = Fp.invertBatch(points.map((p) => p.ez)); - return points.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine); - } - - // We calculate precomputes for elliptic curve point multiplication - // using windowed method. This specifies window size and - // stores precomputed values. Usually only base point would be precomputed. - _WINDOW_SIZE?: number; - - // "Private method", don't use it directly - _setWindowSize(windowSize: number) { - this._WINDOW_SIZE = windowSize; - pointPrecomputes.delete(this); - } - // Not required for fromHex(), which always creates valid points. - // Could be useful for fromAffine(). - assertValidity(): void { - const { a, d } = CURVE; - if (this.is0()) throw new Error('bad point: ZERO'); // TODO: optimize, with vars below? - // Equation in affine coordinates: ax² + y² = 1 + dx²y² - // Equation in projective coordinates (X/Z, Y/Z, Z): (aX² + Y²)Z² = Z⁴ + dX²Y² - const { ex: X, ey: Y, ez: Z, et: T } = this; - const X2 = modP(X * X); // X² - const Y2 = modP(Y * Y); // Y² - const Z2 = modP(Z * Z); // Z² - const Z4 = modP(Z2 * Z2); // Z⁴ - const aX2 = modP(X2 * a); // aX² - const left = modP(Z2 * modP(aX2 + Y2)); // (aX² + Y²)Z² - const right = modP(Z4 + modP(d * modP(X2 * Y2))); // Z⁴ + dX²Y² - if (left !== right) throw new Error('bad point: equation left != right (1)'); - // In Extended coordinates we also have T, which is x*y=T/Z: check X*Y == Z*T - const XY = modP(X * Y); - const ZT = modP(Z * T); - if (XY !== ZT) throw new Error('bad point: equation left != right (2)'); - } - - // Compare one point to another. - equals(other: Point): boolean { - isPoint(other); - const { ex: X1, ey: Y1, ez: Z1 } = this; - const { ex: X2, ey: Y2, ez: Z2 } = other; - const X1Z2 = modP(X1 * Z2); - const X2Z1 = modP(X2 * Z1); - const Y1Z2 = modP(Y1 * Z2); - const Y2Z1 = modP(Y2 * Z1); - return X1Z2 === X2Z1 && Y1Z2 === Y2Z1; - } - - protected is0(): boolean { - return this.equals(Point.ZERO); - } - - negate(): Point { - // Flips point sign to a negative one (-x, y in affine coords) - return new Point(modP(-this.ex), this.ey, this.ez, modP(-this.et)); - } - - // Fast algo for doubling Extended Point. - // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-dbl-2008-hwcd - // Cost: 4M + 4S + 1*a + 6add + 1*2. - double(): Point { - const { a } = CURVE; - const { ex: X1, ey: Y1, ez: Z1 } = this; - const A = modP(X1 * X1); // A = X12 - const B = modP(Y1 * Y1); // B = Y12 - const C = modP(_2n * modP(Z1 * Z1)); // C = 2*Z12 - const D = modP(a * A); // D = a*A - const x1y1 = X1 + Y1; - const E = modP(modP(x1y1 * x1y1) - A - B); // E = (X1+Y1)2-A-B - const G = D + B; // G = D+B - const F = G - C; // F = G-C - const H = D - B; // H = D-B - const X3 = modP(E * F); // X3 = E*F - const Y3 = modP(G * H); // Y3 = G*H - const T3 = modP(E * H); // T3 = E*H - const Z3 = modP(F * G); // Z3 = F*G - return new Point(X3, Y3, Z3, T3); - } - - // Fast algo for adding 2 Extended Points. - // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-add-2008-hwcd - // Cost: 9M + 1*a + 1*d + 7add. - add(other: Point) { - isPoint(other); - const { a, d } = CURVE; - const { ex: X1, ey: Y1, ez: Z1, et: T1 } = this; - const { ex: X2, ey: Y2, ez: Z2, et: T2 } = other; - // Faster algo for adding 2 Extended Points when curve's a=-1. - // http://hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html#addition-add-2008-hwcd-4 - // Cost: 8M + 8add + 2*2. - // Note: It does not check whether the `other` point is valid. - if (a === BigInt(-1)) { - const A = modP((Y1 - X1) * (Y2 + X2)); - const B = modP((Y1 + X1) * (Y2 - X2)); - const F = modP(B - A); - if (F === _0n) return this.double(); // Same point. Tests say it doesn't affect timing - const C = modP(Z1 * _2n * T2); - const D = modP(T1 * _2n * Z2); - const E = D + C; - const G = B + A; - const H = D - C; - const X3 = modP(E * F); - const Y3 = modP(G * H); - const T3 = modP(E * H); - const Z3 = modP(F * G); - return new Point(X3, Y3, Z3, T3); - } - const A = modP(X1 * X2); // A = X1*X2 - const B = modP(Y1 * Y2); // B = Y1*Y2 - const C = modP(T1 * d * T2); // C = T1*d*T2 - const D = modP(Z1 * Z2); // D = Z1*Z2 - const E = modP((X1 + Y1) * (X2 + Y2) - A - B); // E = (X1+Y1)*(X2+Y2)-A-B - const F = D - C; // F = D-C - const G = D + C; // G = D+C - const H = modP(B - a * A); // H = B-a*A - const X3 = modP(E * F); // X3 = E*F - const Y3 = modP(G * H); // Y3 = G*H - const T3 = modP(E * H); // T3 = E*H - const Z3 = modP(F * G); // Z3 = F*G - - return new Point(X3, Y3, Z3, T3); - } - - subtract(other: Point): Point { - return this.add(other.negate()); - } - - private wNAF(n: bigint): { p: Point; f: Point } { - return wnaf.wNAFCached(this, pointPrecomputes, n, Point.normalizeZ); - } - - // Constant-time multiplication. - multiply(scalar: bigint): Point { - const { p, f } = this.wNAF(assertInRange(scalar, CURVE_ORDER)); - return Point.normalizeZ([p, f])[0]; - } - - // Non-constant-time multiplication. Uses double-and-add algorithm. - // It's faster, but should only be used when you don't care about - // an exposed private key e.g. sig verification. - // Does NOT allow scalars higher than CURVE.n. - multiplyUnsafe(scalar: bigint): Point { - let n = assertGE0(scalar); // 0 <= scalar < CURVE.n - if (n === _0n) return I; - if (this.equals(I) || n === _1n) return this; - if (this.equals(G)) return this.wNAF(n).p; - return wnaf.unsafeLadder(this, n); - } - - // Checks if point is of small order. - // If you add something to small order point, you will have "dirty" - // point with torsion component. - // Multiplies point by cofactor and checks if the result is 0. - isSmallOrder(): boolean { - return this.multiplyUnsafe(cofactor).is0(); - } - - // Multiplies point by curve order and checks if the result is 0. - // Returns `false` is the point is dirty. - isTorsionFree(): boolean { - return wnaf.unsafeLadder(this, CURVE_ORDER).is0(); - } - - // Converts Extended point to default (x, y) coordinates. - // Can accept precomputed Z^-1 - for example, from invertBatch. - toAffine(iz?: bigint): AffinePoint { - const { ex: x, ey: y, ez: z } = this; - const is0 = this.is0(); - if (iz == null) iz = is0 ? _8n : (Fp.inv(z) as bigint); // 8 was chosen arbitrarily - const ax = modP(x * iz); - const ay = modP(y * iz); - const zz = modP(z * iz); - if (is0) return { x: _0n, y: _1n }; - if (zz !== _1n) throw new Error('invZ was invalid'); - return { x: ax, y: ay }; - } - - clearCofactor(): Point { - const { h: cofactor } = CURVE; - if (cofactor === _1n) return this; - return this.multiplyUnsafe(cofactor); - } - - // Converts hash string or Uint8Array to Point. - // Uses algo from RFC8032 5.1.3. - static fromHex(hex: Hex, zip215 = false): Point { - const { d, a } = CURVE; - const len = Fp.BYTES; - hex = ensureBytes('pointHex', hex, len); // copy hex to a new array - const normed = hex.slice(); // copy again, we'll manipulate it - const lastByte = hex[len - 1]; // select last byte - normed[len - 1] = lastByte & ~0x80; // clear last bit - const y = ut.bytesToNumberLE(normed); - if (y === _0n) { - // y=0 is allowed - } else { - // RFC8032 prohibits >= p, but ZIP215 doesn't - if (zip215) assertInRange(y, MASK); // zip215=true [1..P-1] (2^255-19-1 for ed25519) - else assertInRange(y, Fp.ORDER); // zip215=false [1..MASK-1] (2^256-1 for ed25519) - } - - // Ed25519: x² = (y²-1)/(dy²+1) mod p. Ed448: x² = (y²-1)/(dy²-1) mod p. Generic case: - // ax²+y²=1+dx²y² => y²-1=dx²y²-ax² => y²-1=x²(dy²-a) => x²=(y²-1)/(dy²-a) - const y2 = modP(y * y); // denominator is always non-0 mod p. - const u = modP(y2 - _1n); // u = y² - 1 - const v = modP(d * y2 - a); // v = d y² + 1. - let { isValid, value: x } = uvRatio(u, v); // √(u/v) - if (!isValid) throw new Error('Point.fromHex: invalid y coordinate'); - const isXOdd = (x & _1n) === _1n; // There are 2 square roots. Use x_0 bit to select proper - const isLastByteOdd = (lastByte & 0x80) !== 0; // x_0, last bit - if (!zip215 && x === _0n && isLastByteOdd) - // if x=0 and x_0 = 1, fail - throw new Error('Point.fromHex: x=0 and x_0=1'); - if (isLastByteOdd !== isXOdd) x = modP(-x); // if x_0 != x mod 2, set x = p-x - return Point.fromAffine({ x, y }); - } - static fromPrivateKey(privKey: Hex) { - return getExtendedPublicKey(privKey).point; - } - toRawBytes(): Uint8Array { - const { x, y } = this.toAffine(); - const bytes = ut.numberToBytesLE(y, Fp.BYTES); // each y has 2 x values (x, -y) - bytes[bytes.length - 1] |= x & _1n ? 0x80 : 0; // when compressing, it's enough to store y - return bytes; // and use the last byte to encode sign of x - } - toHex(): string { - return ut.bytesToHex(this.toRawBytes()); // Same as toRawBytes, but returns string. - } - } - const { BASE: G, ZERO: I } = Point; - const wnaf = wNAF(Point, nByteLength * 8); - - function modN(a: bigint) { - return mod(a, CURVE_ORDER); - } - // Little-endian SHA512 with modulo n - function modN_LE(hash: Uint8Array): bigint { - return modN(ut.bytesToNumberLE(hash)); - } - - /** Convenience method that creates public key and other stuff. RFC8032 5.1.5 */ - function getExtendedPublicKey(key: Hex) { - const len = nByteLength; - key = ensureBytes('private key', key, len); - // Hash private key with curve's hash function to produce uniformingly random input - // Check byte lengths: ensure(64, h(ensure(32, key))) - const hashed = ensureBytes('hashed private key', cHash(key), 2 * len); - const head = adjustScalarBytes(hashed.slice(0, len)); // clear first half bits, produce FE - const prefix = hashed.slice(len, 2 * len); // second half is called key prefix (5.1.6) - const scalar = modN_LE(head); // The actual private scalar - const point = G.multiply(scalar); // Point on Edwards curve aka public key - const pointBytes = point.toRawBytes(); // Uint8Array representation - return { head, prefix, scalar, point, pointBytes }; - } - - // Calculates EdDSA pub key. RFC8032 5.1.5. Privkey is hashed. Use first half with 3 bits cleared - function getPublicKey(privKey: Hex): Uint8Array { - return getExtendedPublicKey(privKey).pointBytes; - } - - // int('LE', SHA512(dom2(F, C) || msgs)) mod N - function hashDomainToScalar(context: Hex = new Uint8Array(), ...msgs: Uint8Array[]) { - const msg = ut.concatBytes(...msgs); - return modN_LE(cHash(domain(msg, ensureBytes('context', context), !!prehash))); - } - - /** Signs message with privateKey. RFC8032 5.1.6 */ - function sign(msg: Hex, privKey: Hex, options: { context?: Hex } = {}): Uint8Array { - msg = ensureBytes('message', msg); - if (prehash) msg = prehash(msg); // for ed25519ph etc. - const { prefix, scalar, pointBytes } = getExtendedPublicKey(privKey); - const r = hashDomainToScalar(options.context, prefix, msg); // r = dom2(F, C) || prefix || PH(M) - const R = G.multiply(r).toRawBytes(); // R = rG - const k = hashDomainToScalar(options.context, R, pointBytes, msg); // R || A || PH(M) - const s = modN(r + k * scalar); // S = (r + k * s) mod L - assertGE0(s); // 0 <= s < l - const res = ut.concatBytes(R, ut.numberToBytesLE(s, Fp.BYTES)); - return ensureBytes('result', res, nByteLength * 2); // 64-byte signature - } - - const verifyOpts: { context?: Hex; zip215?: boolean } = VERIFY_DEFAULT; - function verify(sig: Hex, msg: Hex, publicKey: Hex, options = verifyOpts): boolean { - const { context, zip215 } = options; - const len = Fp.BYTES; // Verifies EdDSA signature against message and public key. RFC8032 5.1.7. - sig = ensureBytes('signature', sig, 2 * len); // An extended group equation is checked. - msg = ensureBytes('message', msg); - if (prehash) msg = prehash(msg); // for ed25519ph, etc - - const s = ut.bytesToNumberLE(sig.slice(len, 2 * len)); - // zip215: true is good for consensus-critical apps and allows points < 2^256 - // zip215: false follows RFC8032 / NIST186-5 and restricts points to CURVE.p - let A, R, SB; - try { - A = Point.fromHex(publicKey, zip215); - R = Point.fromHex(sig.slice(0, len), zip215); - SB = G.multiplyUnsafe(s); // 0 <= s < l is done inside - } catch (error) { - return false; - } - if (!zip215 && A.isSmallOrder()) return false; - - const k = hashDomainToScalar(context, R.toRawBytes(), A.toRawBytes(), msg); - const RkA = R.add(A.multiplyUnsafe(k)); - // [8][S]B = [8]R + [8][k]A' - return RkA.subtract(SB).clearCofactor().equals(Point.ZERO); - } - - G._setWindowSize(8); // Enable precomputes. Slows down first publicKey computation by 20ms. - - const utils = { - getExtendedPublicKey, - // ed25519 private keys are uniform 32b. No need to check for modulo bias, like in secp256k1. - randomPrivateKey: (): Uint8Array => randomBytes(Fp.BYTES), - - /** - * We're doing scalar multiplication (used in getPublicKey etc) with precomputed BASE_POINT - * values. This slows down first getPublicKey() by milliseconds (see Speed section), - * but allows to speed-up subsequent getPublicKey() calls up to 20x. - * @param windowSize 2, 4, 8, 16 - */ - precompute(windowSize = 8, point = Point.BASE): typeof Point.BASE { - point._setWindowSize(windowSize); - point.multiply(BigInt(3)); - return point; - }, - }; - - return { - CURVE, - getPublicKey, - sign, - verify, - ExtendedPoint: Point, - utils, - }; -} diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/abstract/hash-to-curve.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/abstract/hash-to-curve.ts deleted file mode 100644 index 64d7db4a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/abstract/hash-to-curve.ts +++ /dev/null @@ -1,229 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import type { Group, GroupConstructor, AffinePoint } from './curve.js'; -import { mod, IField } from './modular.js'; -import { bytesToNumberBE, CHash, concatBytes, utf8ToBytes, validateObject } from './utils.js'; - -/** - * * `DST` is a domain separation tag, defined in section 2.2.5 - * * `p` characteristic of F, where F is a finite field of characteristic p and order q = p^m - * * `m` is extension degree (1 for prime fields) - * * `k` is the target security target in bits (e.g. 128), from section 5.1 - * * `expand` is `xmd` (SHA2, SHA3, BLAKE) or `xof` (SHAKE, BLAKE-XOF) - * * `hash` conforming to `utils.CHash` interface, with `outputLen` / `blockLen` props - */ -type UnicodeOrBytes = string | Uint8Array; -export type Opts = { - DST: UnicodeOrBytes; - p: bigint; - m: number; - k: number; - expand: 'xmd' | 'xof'; - hash: CHash; -}; - -function validateDST(dst: UnicodeOrBytes): Uint8Array { - if (dst instanceof Uint8Array) return dst; - if (typeof dst === 'string') return utf8ToBytes(dst); - throw new Error('DST must be Uint8Array or string'); -} - -// Octet Stream to Integer. "spec" implementation of os2ip is 2.5x slower vs bytesToNumberBE. -const os2ip = bytesToNumberBE; - -// Integer to Octet Stream (numberToBytesBE) -function i2osp(value: number, length: number): Uint8Array { - if (value < 0 || value >= 1 << (8 * length)) { - throw new Error(`bad I2OSP call: value=${value} length=${length}`); - } - const res = Array.from({ length }).fill(0) as number[]; - for (let i = length - 1; i >= 0; i--) { - res[i] = value & 0xff; - value >>>= 8; - } - return new Uint8Array(res); -} - -function strxor(a: Uint8Array, b: Uint8Array): Uint8Array { - const arr = new Uint8Array(a.length); - for (let i = 0; i < a.length; i++) { - arr[i] = a[i] ^ b[i]; - } - return arr; -} - -function isBytes(item: unknown): void { - if (!(item instanceof Uint8Array)) throw new Error('Uint8Array expected'); -} -function isNum(item: unknown): void { - if (!Number.isSafeInteger(item)) throw new Error('number expected'); -} - -// Produces a uniformly random byte string using a cryptographic hash function H that outputs b bits -// https://www.rfc-editor.org/rfc/rfc9380#section-5.3.1 -export function expand_message_xmd( - msg: Uint8Array, - DST: Uint8Array, - lenInBytes: number, - H: CHash -): Uint8Array { - isBytes(msg); - isBytes(DST); - isNum(lenInBytes); - // https://www.rfc-editor.org/rfc/rfc9380#section-5.3.3 - if (DST.length > 255) DST = H(concatBytes(utf8ToBytes('H2C-OVERSIZE-DST-'), DST)); - const { outputLen: b_in_bytes, blockLen: r_in_bytes } = H; - const ell = Math.ceil(lenInBytes / b_in_bytes); - if (ell > 255) throw new Error('Invalid xmd length'); - const DST_prime = concatBytes(DST, i2osp(DST.length, 1)); - const Z_pad = i2osp(0, r_in_bytes); - const l_i_b_str = i2osp(lenInBytes, 2); // len_in_bytes_str - const b = new Array(ell); - const b_0 = H(concatBytes(Z_pad, msg, l_i_b_str, i2osp(0, 1), DST_prime)); - b[0] = H(concatBytes(b_0, i2osp(1, 1), DST_prime)); - for (let i = 1; i <= ell; i++) { - const args = [strxor(b_0, b[i - 1]), i2osp(i + 1, 1), DST_prime]; - b[i] = H(concatBytes(...args)); - } - const pseudo_random_bytes = concatBytes(...b); - return pseudo_random_bytes.slice(0, lenInBytes); -} - -// Produces a uniformly random byte string using an extendable-output function (XOF) H. -// 1. The collision resistance of H MUST be at least k bits. -// 2. H MUST be an XOF that has been proved indifferentiable from -// a random oracle under a reasonable cryptographic assumption. -// https://www.rfc-editor.org/rfc/rfc9380#section-5.3.2 -export function expand_message_xof( - msg: Uint8Array, - DST: Uint8Array, - lenInBytes: number, - k: number, - H: CHash -): Uint8Array { - isBytes(msg); - isBytes(DST); - isNum(lenInBytes); - // https://www.rfc-editor.org/rfc/rfc9380#section-5.3.3 - // DST = H('H2C-OVERSIZE-DST-' || a_very_long_DST, Math.ceil((lenInBytes * k) / 8)); - if (DST.length > 255) { - const dkLen = Math.ceil((2 * k) / 8); - DST = H.create({ dkLen }).update(utf8ToBytes('H2C-OVERSIZE-DST-')).update(DST).digest(); - } - if (lenInBytes > 65535 || DST.length > 255) - throw new Error('expand_message_xof: invalid lenInBytes'); - return ( - H.create({ dkLen: lenInBytes }) - .update(msg) - .update(i2osp(lenInBytes, 2)) - // 2. DST_prime = DST || I2OSP(len(DST), 1) - .update(DST) - .update(i2osp(DST.length, 1)) - .digest() - ); -} - -/** - * Hashes arbitrary-length byte strings to a list of one or more elements of a finite field F - * https://www.rfc-editor.org/rfc/rfc9380#section-5.2 - * @param msg a byte string containing the message to hash - * @param count the number of elements of F to output - * @param options `{DST: string, p: bigint, m: number, k: number, expand: 'xmd' | 'xof', hash: H}`, see above - * @returns [u_0, ..., u_(count - 1)], a list of field elements. - */ -export function hash_to_field(msg: Uint8Array, count: number, options: Opts): bigint[][] { - validateObject(options, { - DST: 'stringOrUint8Array', - p: 'bigint', - m: 'isSafeInteger', - k: 'isSafeInteger', - hash: 'hash', - }); - const { p, k, m, hash, expand, DST: _DST } = options; - isBytes(msg); - isNum(count); - const DST = validateDST(_DST); - const log2p = p.toString(2).length; - const L = Math.ceil((log2p + k) / 8); // section 5.1 of ietf draft link above - const len_in_bytes = count * m * L; - let prb; // pseudo_random_bytes - if (expand === 'xmd') { - prb = expand_message_xmd(msg, DST, len_in_bytes, hash); - } else if (expand === 'xof') { - prb = expand_message_xof(msg, DST, len_in_bytes, k, hash); - } else if (expand === '_internal_pass') { - // for internal tests only - prb = msg; - } else { - throw new Error('expand must be "xmd" or "xof"'); - } - const u = new Array(count); - for (let i = 0; i < count; i++) { - const e = new Array(m); - for (let j = 0; j < m; j++) { - const elm_offset = L * (j + i * m); - const tv = prb.subarray(elm_offset, elm_offset + L); - e[j] = mod(os2ip(tv), p); - } - u[i] = e; - } - return u; -} - -export function isogenyMap>(field: F, map: [T[], T[], T[], T[]]) { - // Make same order as in spec - const COEFF = map.map((i) => Array.from(i).reverse()); - return (x: T, y: T) => { - const [xNum, xDen, yNum, yDen] = COEFF.map((val) => - val.reduce((acc, i) => field.add(field.mul(acc, x), i)) - ); - x = field.div(xNum, xDen); // xNum / xDen - y = field.mul(y, field.div(yNum, yDen)); // y * (yNum / yDev) - return { x, y }; - }; -} - -export interface H2CPoint extends Group> { - add(rhs: H2CPoint): H2CPoint; - toAffine(iz?: bigint): AffinePoint; - clearCofactor(): H2CPoint; - assertValidity(): void; -} - -export interface H2CPointConstructor extends GroupConstructor> { - fromAffine(ap: AffinePoint): H2CPoint; -} - -export type MapToCurve = (scalar: bigint[]) => AffinePoint; - -// Separated from initialization opts, so users won't accidentally change per-curve parameters -// (changing DST is ok!) -export type htfBasicOpts = { DST: UnicodeOrBytes }; - -export function createHasher( - Point: H2CPointConstructor, - mapToCurve: MapToCurve, - def: Opts & { encodeDST?: UnicodeOrBytes } -) { - if (typeof mapToCurve !== 'function') throw new Error('mapToCurve() must be defined'); - return { - // Encodes byte string to elliptic curve. - // hash_to_curve from https://www.rfc-editor.org/rfc/rfc9380#section-3 - hashToCurve(msg: Uint8Array, options?: htfBasicOpts) { - const u = hash_to_field(msg, 2, { ...def, DST: def.DST, ...options } as Opts); - const u0 = Point.fromAffine(mapToCurve(u[0])); - const u1 = Point.fromAffine(mapToCurve(u[1])); - const P = u0.add(u1).clearCofactor(); - P.assertValidity(); - return P; - }, - - // Encodes byte string to elliptic curve. - // encode_to_curve from https://www.rfc-editor.org/rfc/rfc9380#section-3 - encodeToCurve(msg: Uint8Array, options?: htfBasicOpts) { - const u = hash_to_field(msg, 1, { ...def, DST: def.encodeDST, ...options } as Opts); - const P = Point.fromAffine(mapToCurve(u[0])).clearCofactor(); - P.assertValidity(); - return P; - }, - }; -} diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/abstract/modular.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/abstract/modular.ts deleted file mode 100644 index ddafcd9a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/abstract/modular.ts +++ /dev/null @@ -1,484 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -// Utilities for modular arithmetics and finite fields -import { - bitMask, - numberToBytesBE, - numberToBytesLE, - bytesToNumberBE, - bytesToNumberLE, - ensureBytes, - validateObject, -} from './utils.js'; -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3); -// prettier-ignore -const _4n = BigInt(4), _5n = BigInt(5), _8n = BigInt(8); -// prettier-ignore -const _9n = BigInt(9), _16n = BigInt(16); - -// Calculates a modulo b -export function mod(a: bigint, b: bigint): bigint { - const result = a % b; - return result >= _0n ? result : b + result; -} -/** - * Efficiently raise num to power and do modular division. - * Unsafe in some contexts: uses ladder, so can expose bigint bits. - * @example - * pow(2n, 6n, 11n) // 64n % 11n == 9n - */ -// TODO: use field version && remove -export function pow(num: bigint, power: bigint, modulo: bigint): bigint { - if (modulo <= _0n || power < _0n) throw new Error('Expected power/modulo > 0'); - if (modulo === _1n) return _0n; - let res = _1n; - while (power > _0n) { - if (power & _1n) res = (res * num) % modulo; - num = (num * num) % modulo; - power >>= _1n; - } - return res; -} - -// Does x ^ (2 ^ power) mod p. pow2(30, 4) == 30 ^ (2 ^ 4) -export function pow2(x: bigint, power: bigint, modulo: bigint): bigint { - let res = x; - while (power-- > _0n) { - res *= res; - res %= modulo; - } - return res; -} - -// Inverses number over modulo -export function invert(number: bigint, modulo: bigint): bigint { - if (number === _0n || modulo <= _0n) { - throw new Error(`invert: expected positive integers, got n=${number} mod=${modulo}`); - } - // Euclidean GCD https://brilliant.org/wiki/extended-euclidean-algorithm/ - // Fermat's little theorem "CT-like" version inv(n) = n^(m-2) mod m is 30x slower. - let a = mod(number, modulo); - let b = modulo; - // prettier-ignore - let x = _0n, y = _1n, u = _1n, v = _0n; - while (a !== _0n) { - // JIT applies optimization if those two lines follow each other - const q = b / a; - const r = b % a; - const m = x - u * q; - const n = y - v * q; - // prettier-ignore - b = a, a = r, x = u, y = v, u = m, v = n; - } - const gcd = b; - if (gcd !== _1n) throw new Error('invert: does not exist'); - return mod(x, modulo); -} - -/** - * Tonelli-Shanks square root search algorithm. - * 1. https://eprint.iacr.org/2012/685.pdf (page 12) - * 2. Square Roots from 1; 24, 51, 10 to Dan Shanks - * Will start an infinite loop if field order P is not prime. - * @param P field order - * @returns function that takes field Fp (created from P) and number n - */ -export function tonelliShanks(P: bigint) { - // Legendre constant: used to calculate Legendre symbol (a | p), - // which denotes the value of a^((p-1)/2) (mod p). - // (a | p) ≡ 1 if a is a square (mod p) - // (a | p) ≡ -1 if a is not a square (mod p) - // (a | p) ≡ 0 if a ≡ 0 (mod p) - const legendreC = (P - _1n) / _2n; - - let Q: bigint, S: number, Z: bigint; - // Step 1: By factoring out powers of 2 from p - 1, - // find q and s such that p - 1 = q*(2^s) with q odd - for (Q = P - _1n, S = 0; Q % _2n === _0n; Q /= _2n, S++); - - // Step 2: Select a non-square z such that (z | p) ≡ -1 and set c ≡ zq - for (Z = _2n; Z < P && pow(Z, legendreC, P) !== P - _1n; Z++); - - // Fast-path - if (S === 1) { - const p1div4 = (P + _1n) / _4n; - return function tonelliFast(Fp: IField, n: T) { - const root = Fp.pow(n, p1div4); - if (!Fp.eql(Fp.sqr(root), n)) throw new Error('Cannot find square root'); - return root; - }; - } - - // Slow-path - const Q1div2 = (Q + _1n) / _2n; - return function tonelliSlow(Fp: IField, n: T): T { - // Step 0: Check that n is indeed a square: (n | p) should not be ≡ -1 - if (Fp.pow(n, legendreC) === Fp.neg(Fp.ONE)) throw new Error('Cannot find square root'); - let r = S; - // TODO: will fail at Fp2/etc - let g = Fp.pow(Fp.mul(Fp.ONE, Z), Q); // will update both x and b - let x = Fp.pow(n, Q1div2); // first guess at the square root - let b = Fp.pow(n, Q); // first guess at the fudge factor - - while (!Fp.eql(b, Fp.ONE)) { - if (Fp.eql(b, Fp.ZERO)) return Fp.ZERO; // https://en.wikipedia.org/wiki/Tonelli%E2%80%93Shanks_algorithm (4. If t = 0, return r = 0) - // Find m such b^(2^m)==1 - let m = 1; - for (let t2 = Fp.sqr(b); m < r; m++) { - if (Fp.eql(t2, Fp.ONE)) break; - t2 = Fp.sqr(t2); // t2 *= t2 - } - // NOTE: r-m-1 can be bigger than 32, need to convert to bigint before shift, otherwise there will be overflow - const ge = Fp.pow(g, _1n << BigInt(r - m - 1)); // ge = 2^(r-m-1) - g = Fp.sqr(ge); // g = ge * ge - x = Fp.mul(x, ge); // x *= ge - b = Fp.mul(b, g); // b *= g - r = m; - } - return x; - }; -} - -export function FpSqrt(P: bigint) { - // NOTE: different algorithms can give different roots, it is up to user to decide which one they want. - // For example there is FpSqrtOdd/FpSqrtEven to choice root based on oddness (used for hash-to-curve). - - // P ≡ 3 (mod 4) - // √n = n^((P+1)/4) - if (P % _4n === _3n) { - // Not all roots possible! - // const ORDER = - // 0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaabn; - // const NUM = 72057594037927816n; - const p1div4 = (P + _1n) / _4n; - return function sqrt3mod4(Fp: IField, n: T) { - const root = Fp.pow(n, p1div4); - // Throw if root**2 != n - if (!Fp.eql(Fp.sqr(root), n)) throw new Error('Cannot find square root'); - return root; - }; - } - - // Atkin algorithm for q ≡ 5 (mod 8), https://eprint.iacr.org/2012/685.pdf (page 10) - if (P % _8n === _5n) { - const c1 = (P - _5n) / _8n; - return function sqrt5mod8(Fp: IField, n: T) { - const n2 = Fp.mul(n, _2n); - const v = Fp.pow(n2, c1); - const nv = Fp.mul(n, v); - const i = Fp.mul(Fp.mul(nv, _2n), v); - const root = Fp.mul(nv, Fp.sub(i, Fp.ONE)); - if (!Fp.eql(Fp.sqr(root), n)) throw new Error('Cannot find square root'); - return root; - }; - } - - // P ≡ 9 (mod 16) - if (P % _16n === _9n) { - // NOTE: tonelli is too slow for bls-Fp2 calculations even on start - // Means we cannot use sqrt for constants at all! - // - // const c1 = Fp.sqrt(Fp.negate(Fp.ONE)); // 1. c1 = sqrt(-1) in F, i.e., (c1^2) == -1 in F - // const c2 = Fp.sqrt(c1); // 2. c2 = sqrt(c1) in F, i.e., (c2^2) == c1 in F - // const c3 = Fp.sqrt(Fp.negate(c1)); // 3. c3 = sqrt(-c1) in F, i.e., (c3^2) == -c1 in F - // const c4 = (P + _7n) / _16n; // 4. c4 = (q + 7) / 16 # Integer arithmetic - // sqrt = (x) => { - // let tv1 = Fp.pow(x, c4); // 1. tv1 = x^c4 - // let tv2 = Fp.mul(c1, tv1); // 2. tv2 = c1 * tv1 - // const tv3 = Fp.mul(c2, tv1); // 3. tv3 = c2 * tv1 - // let tv4 = Fp.mul(c3, tv1); // 4. tv4 = c3 * tv1 - // const e1 = Fp.equals(Fp.square(tv2), x); // 5. e1 = (tv2^2) == x - // const e2 = Fp.equals(Fp.square(tv3), x); // 6. e2 = (tv3^2) == x - // tv1 = Fp.cmov(tv1, tv2, e1); // 7. tv1 = CMOV(tv1, tv2, e1) # Select tv2 if (tv2^2) == x - // tv2 = Fp.cmov(tv4, tv3, e2); // 8. tv2 = CMOV(tv4, tv3, e2) # Select tv3 if (tv3^2) == x - // const e3 = Fp.equals(Fp.square(tv2), x); // 9. e3 = (tv2^2) == x - // return Fp.cmov(tv1, tv2, e3); // 10. z = CMOV(tv1, tv2, e3) # Select the sqrt from tv1 and tv2 - // } - } - - // Other cases: Tonelli-Shanks algorithm - return tonelliShanks(P); -} - -// Little-endian check for first LE bit (last BE bit); -export const isNegativeLE = (num: bigint, modulo: bigint) => (mod(num, modulo) & _1n) === _1n; - -// Field is not always over prime: for example, Fp2 has ORDER(q)=p^m -export interface IField { - ORDER: bigint; - BYTES: number; - BITS: number; - MASK: bigint; - ZERO: T; - ONE: T; - // 1-arg - create: (num: T) => T; - isValid: (num: T) => boolean; - is0: (num: T) => boolean; - neg(num: T): T; - inv(num: T): T; - sqrt(num: T): T; - sqr(num: T): T; - // 2-args - eql(lhs: T, rhs: T): boolean; - add(lhs: T, rhs: T): T; - sub(lhs: T, rhs: T): T; - mul(lhs: T, rhs: T | bigint): T; - pow(lhs: T, power: bigint): T; - div(lhs: T, rhs: T | bigint): T; - // N for NonNormalized (for now) - addN(lhs: T, rhs: T): T; - subN(lhs: T, rhs: T): T; - mulN(lhs: T, rhs: T | bigint): T; - sqrN(num: T): T; - - // Optional - // Should be same as sgn0 function in - // [RFC9380](https://www.rfc-editor.org/rfc/rfc9380#section-4.1). - // NOTE: sgn0 is 'negative in LE', which is same as odd. And negative in LE is kinda strange definition anyway. - isOdd?(num: T): boolean; // Odd instead of even since we have it for Fp2 - // legendre?(num: T): T; - pow(lhs: T, power: bigint): T; - invertBatch: (lst: T[]) => T[]; - toBytes(num: T): Uint8Array; - fromBytes(bytes: Uint8Array): T; - // If c is False, CMOV returns a, otherwise it returns b. - cmov(a: T, b: T, c: boolean): T; -} -// prettier-ignore -const FIELD_FIELDS = [ - 'create', 'isValid', 'is0', 'neg', 'inv', 'sqrt', 'sqr', - 'eql', 'add', 'sub', 'mul', 'pow', 'div', - 'addN', 'subN', 'mulN', 'sqrN' -] as const; -export function validateField(field: IField) { - const initial = { - ORDER: 'bigint', - MASK: 'bigint', - BYTES: 'isSafeInteger', - BITS: 'isSafeInteger', - } as Record; - const opts = FIELD_FIELDS.reduce((map, val: string) => { - map[val] = 'function'; - return map; - }, initial); - return validateObject(field, opts); -} - -// Generic field functions - -/** - * Same as `pow` but for Fp: non-constant-time. - * Unsafe in some contexts: uses ladder, so can expose bigint bits. - */ -export function FpPow(f: IField, num: T, power: bigint): T { - // Should have same speed as pow for bigints - // TODO: benchmark! - if (power < _0n) throw new Error('Expected power > 0'); - if (power === _0n) return f.ONE; - if (power === _1n) return num; - let p = f.ONE; - let d = num; - while (power > _0n) { - if (power & _1n) p = f.mul(p, d); - d = f.sqr(d); - power >>= _1n; - } - return p; -} - -/** - * Efficiently invert an array of Field elements. - * `inv(0)` will return `undefined` here: make sure to throw an error. - */ -export function FpInvertBatch(f: IField, nums: T[]): T[] { - const tmp = new Array(nums.length); - // Walk from first to last, multiply them by each other MOD p - const lastMultiplied = nums.reduce((acc, num, i) => { - if (f.is0(num)) return acc; - tmp[i] = acc; - return f.mul(acc, num); - }, f.ONE); - // Invert last element - const inverted = f.inv(lastMultiplied); - // Walk from last to first, multiply them by inverted each other MOD p - nums.reduceRight((acc, num, i) => { - if (f.is0(num)) return acc; - tmp[i] = f.mul(acc, tmp[i]); - return f.mul(acc, num); - }, inverted); - return tmp; -} - -export function FpDiv(f: IField, lhs: T, rhs: T | bigint): T { - return f.mul(lhs, typeof rhs === 'bigint' ? invert(rhs, f.ORDER) : f.inv(rhs)); -} - -// This function returns True whenever the value x is a square in the field F. -export function FpIsSquare(f: IField) { - const legendreConst = (f.ORDER - _1n) / _2n; // Integer arithmetic - return (x: T): boolean => { - const p = f.pow(x, legendreConst); - return f.eql(p, f.ZERO) || f.eql(p, f.ONE); - }; -} - -// CURVE.n lengths -export function nLength(n: bigint, nBitLength?: number) { - // Bit size, byte size of CURVE.n - const _nBitLength = nBitLength !== undefined ? nBitLength : n.toString(2).length; - const nByteLength = Math.ceil(_nBitLength / 8); - return { nBitLength: _nBitLength, nByteLength }; -} - -type FpField = IField & Required, 'isOdd'>>; -/** - * Initializes a finite field over prime. **Non-primes are not supported.** - * Do not init in loop: slow. Very fragile: always run a benchmark on a change. - * Major performance optimizations: - * * a) denormalized operations like mulN instead of mul - * * b) same object shape: never add or remove keys - * * c) Object.freeze - * @param ORDER prime positive bigint - * @param bitLen how many bits the field consumes - * @param isLE (def: false) if encoding / decoding should be in little-endian - * @param redef optional faster redefinitions of sqrt and other methods - */ -export function Field( - ORDER: bigint, - bitLen?: number, - isLE = false, - redef: Partial> = {} -): Readonly { - if (ORDER <= _0n) throw new Error(`Expected Field ORDER > 0, got ${ORDER}`); - const { nBitLength: BITS, nByteLength: BYTES } = nLength(ORDER, bitLen); - if (BYTES > 2048) throw new Error('Field lengths over 2048 bytes are not supported'); - const sqrtP = FpSqrt(ORDER); - const f: Readonly = Object.freeze({ - ORDER, - BITS, - BYTES, - MASK: bitMask(BITS), - ZERO: _0n, - ONE: _1n, - create: (num) => mod(num, ORDER), - isValid: (num) => { - if (typeof num !== 'bigint') - throw new Error(`Invalid field element: expected bigint, got ${typeof num}`); - return _0n <= num && num < ORDER; // 0 is valid element, but it's not invertible - }, - is0: (num) => num === _0n, - isOdd: (num) => (num & _1n) === _1n, - neg: (num) => mod(-num, ORDER), - eql: (lhs, rhs) => lhs === rhs, - - sqr: (num) => mod(num * num, ORDER), - add: (lhs, rhs) => mod(lhs + rhs, ORDER), - sub: (lhs, rhs) => mod(lhs - rhs, ORDER), - mul: (lhs, rhs) => mod(lhs * rhs, ORDER), - pow: (num, power) => FpPow(f, num, power), - div: (lhs, rhs) => mod(lhs * invert(rhs, ORDER), ORDER), - - // Same as above, but doesn't normalize - sqrN: (num) => num * num, - addN: (lhs, rhs) => lhs + rhs, - subN: (lhs, rhs) => lhs - rhs, - mulN: (lhs, rhs) => lhs * rhs, - - inv: (num) => invert(num, ORDER), - sqrt: redef.sqrt || ((n) => sqrtP(f, n)), - invertBatch: (lst) => FpInvertBatch(f, lst), - // TODO: do we really need constant cmov? - // We don't have const-time bigints anyway, so probably will be not very useful - cmov: (a, b, c) => (c ? b : a), - toBytes: (num) => (isLE ? numberToBytesLE(num, BYTES) : numberToBytesBE(num, BYTES)), - fromBytes: (bytes) => { - if (bytes.length !== BYTES) - throw new Error(`Fp.fromBytes: expected ${BYTES}, got ${bytes.length}`); - return isLE ? bytesToNumberLE(bytes) : bytesToNumberBE(bytes); - }, - } as FpField); - return Object.freeze(f); -} - -export function FpSqrtOdd(Fp: IField, elm: T) { - if (!Fp.isOdd) throw new Error(`Field doesn't have isOdd`); - const root = Fp.sqrt(elm); - return Fp.isOdd(root) ? root : Fp.neg(root); -} - -export function FpSqrtEven(Fp: IField, elm: T) { - if (!Fp.isOdd) throw new Error(`Field doesn't have isOdd`); - const root = Fp.sqrt(elm); - return Fp.isOdd(root) ? Fp.neg(root) : root; -} - -/** - * "Constant-time" private key generation utility. - * Same as mapKeyToField, but accepts less bytes (40 instead of 48 for 32-byte field). - * Which makes it slightly more biased, less secure. - * @deprecated use mapKeyToField instead - */ -export function hashToPrivateScalar( - hash: string | Uint8Array, - groupOrder: bigint, - isLE = false -): bigint { - hash = ensureBytes('privateHash', hash); - const hashLen = hash.length; - const minLen = nLength(groupOrder).nByteLength + 8; - if (minLen < 24 || hashLen < minLen || hashLen > 1024) - throw new Error(`hashToPrivateScalar: expected ${minLen}-1024 bytes of input, got ${hashLen}`); - const num = isLE ? bytesToNumberLE(hash) : bytesToNumberBE(hash); - return mod(num, groupOrder - _1n) + _1n; -} - -/** - * Returns total number of bytes consumed by the field element. - * For example, 32 bytes for usual 256-bit weierstrass curve. - * @param fieldOrder number of field elements, usually CURVE.n - * @returns byte length of field - */ -export function getFieldBytesLength(fieldOrder: bigint): number { - if (typeof fieldOrder !== 'bigint') throw new Error('field order must be bigint'); - const bitLength = fieldOrder.toString(2).length; - return Math.ceil(bitLength / 8); -} - -/** - * Returns minimal amount of bytes that can be safely reduced - * by field order. - * Should be 2^-128 for 128-bit curve such as P256. - * @param fieldOrder number of field elements, usually CURVE.n - * @returns byte length of target hash - */ -export function getMinHashLength(fieldOrder: bigint): number { - const length = getFieldBytesLength(fieldOrder); - return length + Math.ceil(length / 2); -} - -/** - * "Constant-time" private key generation utility. - * Can take (n + n/2) or more bytes of uniform input e.g. from CSPRNG or KDF - * and convert them into private scalar, with the modulo bias being negligible. - * Needs at least 48 bytes of input for 32-byte private key. - * https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/ - * FIPS 186-5, A.2 https://csrc.nist.gov/publications/detail/fips/186/5/final - * RFC 9380, https://www.rfc-editor.org/rfc/rfc9380#section-5 - * @param hash hash output from SHA3 or a similar function - * @param groupOrder size of subgroup - (e.g. secp256k1.CURVE.n) - * @param isLE interpret hash bytes as LE num - * @returns valid private scalar - */ -export function mapHashToField(key: Uint8Array, fieldOrder: bigint, isLE = false): Uint8Array { - const len = key.length; - const fieldLen = getFieldBytesLength(fieldOrder); - const minLen = getMinHashLength(fieldOrder); - // No small numbers: need to understand bias story. No huge numbers: easier to detect JS timings. - if (len < 16 || len < minLen || len > 1024) - throw new Error(`expected ${minLen}-1024 bytes of input, got ${len}`); - const num = isLE ? bytesToNumberBE(key) : bytesToNumberLE(key); - // `mod(x, 11)` can sometimes produce 0. `mod(x, 10) + 1` is the same, but no 0 - const reduced = mod(num, fieldOrder - _1n) + _1n; - return isLE ? numberToBytesLE(reduced, fieldLen) : numberToBytesBE(reduced, fieldLen); -} diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/abstract/montgomery.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/abstract/montgomery.ts deleted file mode 100644 index 64d1b531..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/abstract/montgomery.ts +++ /dev/null @@ -1,189 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { mod, pow } from './modular.js'; -import { bytesToNumberLE, ensureBytes, numberToBytesLE, validateObject } from './utils.js'; - -const _0n = BigInt(0); -const _1n = BigInt(1); -type Hex = string | Uint8Array; - -export type CurveType = { - P: bigint; // finite field prime - nByteLength: number; - adjustScalarBytes?: (bytes: Uint8Array) => Uint8Array; - domain?: (data: Uint8Array, ctx: Uint8Array, phflag: boolean) => Uint8Array; - a: bigint; - montgomeryBits: number; - powPminus2?: (x: bigint) => bigint; - xyToU?: (x: bigint, y: bigint) => bigint; - Gu: bigint; - randomBytes?: (bytesLength?: number) => Uint8Array; -}; -export type CurveFn = { - scalarMult: (scalar: Hex, u: Hex) => Uint8Array; - scalarMultBase: (scalar: Hex) => Uint8Array; - getSharedSecret: (privateKeyA: Hex, publicKeyB: Hex) => Uint8Array; - getPublicKey: (privateKey: Hex) => Uint8Array; - utils: { randomPrivateKey: () => Uint8Array }; - GuBytes: Uint8Array; -}; - -function validateOpts(curve: CurveType) { - validateObject( - curve, - { - a: 'bigint', - }, - { - montgomeryBits: 'isSafeInteger', - nByteLength: 'isSafeInteger', - adjustScalarBytes: 'function', - domain: 'function', - powPminus2: 'function', - Gu: 'bigint', - } - ); - // Set defaults - return Object.freeze({ ...curve } as const); -} - -// NOTE: not really montgomery curve, just bunch of very specific methods for X25519/X448 (RFC 7748, https://www.rfc-editor.org/rfc/rfc7748) -// Uses only one coordinate instead of two -export function montgomery(curveDef: CurveType): CurveFn { - const CURVE = validateOpts(curveDef); - const { P } = CURVE; - const modP = (n: bigint) => mod(n, P); - const montgomeryBits = CURVE.montgomeryBits; - const montgomeryBytes = Math.ceil(montgomeryBits / 8); - const fieldLen = CURVE.nByteLength; - const adjustScalarBytes = CURVE.adjustScalarBytes || ((bytes: Uint8Array) => bytes); - const powPminus2 = CURVE.powPminus2 || ((x: bigint) => pow(x, P - BigInt(2), P)); - - // cswap from RFC7748. But it is not from RFC7748! - /* - cswap(swap, x_2, x_3): - dummy = mask(swap) AND (x_2 XOR x_3) - x_2 = x_2 XOR dummy - x_3 = x_3 XOR dummy - Return (x_2, x_3) - Where mask(swap) is the all-1 or all-0 word of the same length as x_2 - and x_3, computed, e.g., as mask(swap) = 0 - swap. - */ - function cswap(swap: bigint, x_2: bigint, x_3: bigint): [bigint, bigint] { - const dummy = modP(swap * (x_2 - x_3)); - x_2 = modP(x_2 - dummy); - x_3 = modP(x_3 + dummy); - return [x_2, x_3]; - } - - // Accepts 0 as well - function assertFieldElement(n: bigint): bigint { - if (typeof n === 'bigint' && _0n <= n && n < P) return n; - throw new Error('Expected valid scalar 0 < scalar < CURVE.P'); - } - - // x25519 from 4 - // The constant a24 is (486662 - 2) / 4 = 121665 for curve25519/X25519 - const a24 = (CURVE.a - BigInt(2)) / BigInt(4); - /** - * - * @param pointU u coordinate (x) on Montgomery Curve 25519 - * @param scalar by which the point would be multiplied - * @returns new Point on Montgomery curve - */ - function montgomeryLadder(pointU: bigint, scalar: bigint): bigint { - const u = assertFieldElement(pointU); - // Section 5: Implementations MUST accept non-canonical values and process them as - // if they had been reduced modulo the field prime. - const k = assertFieldElement(scalar); - const x_1 = u; - let x_2 = _1n; - let z_2 = _0n; - let x_3 = u; - let z_3 = _1n; - let swap = _0n; - let sw: [bigint, bigint]; - for (let t = BigInt(montgomeryBits - 1); t >= _0n; t--) { - const k_t = (k >> t) & _1n; - swap ^= k_t; - sw = cswap(swap, x_2, x_3); - x_2 = sw[0]; - x_3 = sw[1]; - sw = cswap(swap, z_2, z_3); - z_2 = sw[0]; - z_3 = sw[1]; - swap = k_t; - - const A = x_2 + z_2; - const AA = modP(A * A); - const B = x_2 - z_2; - const BB = modP(B * B); - const E = AA - BB; - const C = x_3 + z_3; - const D = x_3 - z_3; - const DA = modP(D * A); - const CB = modP(C * B); - const dacb = DA + CB; - const da_cb = DA - CB; - x_3 = modP(dacb * dacb); - z_3 = modP(x_1 * modP(da_cb * da_cb)); - x_2 = modP(AA * BB); - z_2 = modP(E * (AA + modP(a24 * E))); - } - // (x_2, x_3) = cswap(swap, x_2, x_3) - sw = cswap(swap, x_2, x_3); - x_2 = sw[0]; - x_3 = sw[1]; - // (z_2, z_3) = cswap(swap, z_2, z_3) - sw = cswap(swap, z_2, z_3); - z_2 = sw[0]; - z_3 = sw[1]; - // z_2^(p - 2) - const z2 = powPminus2(z_2); - // Return x_2 * (z_2^(p - 2)) - return modP(x_2 * z2); - } - - function encodeUCoordinate(u: bigint): Uint8Array { - return numberToBytesLE(modP(u), montgomeryBytes); - } - - function decodeUCoordinate(uEnc: Hex): bigint { - // Section 5: When receiving such an array, implementations of X25519 - // MUST mask the most significant bit in the final byte. - // This is very ugly way, but it works because fieldLen-1 is outside of bounds for X448, so this becomes NOOP - // fieldLen - scalaryBytes = 1 for X448 and = 0 for X25519 - const u = ensureBytes('u coordinate', uEnc, montgomeryBytes); - // u[fieldLen-1] crashes QuickJS (TypeError: out-of-bound numeric index) - if (fieldLen === montgomeryBytes) u[fieldLen - 1] &= 127; // 0b0111_1111 - return bytesToNumberLE(u); - } - function decodeScalar(n: Hex): bigint { - const bytes = ensureBytes('scalar', n); - if (bytes.length !== montgomeryBytes && bytes.length !== fieldLen) - throw new Error(`Expected ${montgomeryBytes} or ${fieldLen} bytes, got ${bytes.length}`); - return bytesToNumberLE(adjustScalarBytes(bytes)); - } - function scalarMult(scalar: Hex, u: Hex): Uint8Array { - const pointU = decodeUCoordinate(u); - const _scalar = decodeScalar(scalar); - const pu = montgomeryLadder(pointU, _scalar); - // The result was not contributory - // https://cr.yp.to/ecdh.html#validate - if (pu === _0n) throw new Error('Invalid private or public key received'); - return encodeUCoordinate(pu); - } - // Computes public key from private. By doing scalar multiplication of base point. - const GuBytes = encodeUCoordinate(CURVE.Gu); - function scalarMultBase(scalar: Hex): Uint8Array { - return scalarMult(scalar, GuBytes); - } - - return { - scalarMult, - scalarMultBase, - getSharedSecret: (privateKey: Hex, publicKey: Hex) => scalarMult(privateKey, publicKey), - getPublicKey: (privateKey: Hex): Uint8Array => scalarMultBase(privateKey), - utils: { randomPrivateKey: () => CURVE.randomBytes!(CURVE.nByteLength) }, - GuBytes: GuBytes, - }; -} diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/abstract/poseidon.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/abstract/poseidon.ts deleted file mode 100644 index a2a218a2..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/abstract/poseidon.ts +++ /dev/null @@ -1,118 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -// Poseidon Hash: https://eprint.iacr.org/2019/458.pdf, https://www.poseidon-hash.info -import { IField, FpPow, validateField } from './modular.js'; -// We don't provide any constants, since different implementations use different constants. -// For reference constants see './test/poseidon.test.js'. -export type PoseidonOpts = { - Fp: IField; - t: number; - roundsFull: number; - roundsPartial: number; - sboxPower?: number; - reversePartialPowIdx?: boolean; // Hack for stark - mds: bigint[][]; - roundConstants: bigint[][]; -}; - -export function validateOpts(opts: PoseidonOpts) { - const { Fp, mds, reversePartialPowIdx: rev, roundConstants: rc } = opts; - const { roundsFull, roundsPartial, sboxPower, t } = opts; - - validateField(Fp); - for (const i of ['t', 'roundsFull', 'roundsPartial'] as const) { - if (typeof opts[i] !== 'number' || !Number.isSafeInteger(opts[i])) - throw new Error(`Poseidon: invalid param ${i}=${opts[i]} (${typeof opts[i]})`); - } - - // MDS is TxT matrix - if (!Array.isArray(mds) || mds.length !== t) throw new Error('Poseidon: wrong MDS matrix'); - const _mds = mds.map((mdsRow) => { - if (!Array.isArray(mdsRow) || mdsRow.length !== t) - throw new Error(`Poseidon MDS matrix row: ${mdsRow}`); - return mdsRow.map((i) => { - if (typeof i !== 'bigint') throw new Error(`Poseidon MDS matrix value=${i}`); - return Fp.create(i); - }); - }); - - if (rev !== undefined && typeof rev !== 'boolean') - throw new Error(`Poseidon: invalid param reversePartialPowIdx=${rev}`); - - if (roundsFull % 2 !== 0) throw new Error(`Poseidon roundsFull is not even: ${roundsFull}`); - const rounds = roundsFull + roundsPartial; - - if (!Array.isArray(rc) || rc.length !== rounds) - throw new Error('Poseidon: wrong round constants'); - const roundConstants = rc.map((rc) => { - if (!Array.isArray(rc) || rc.length !== t) - throw new Error(`Poseidon wrong round constants: ${rc}`); - return rc.map((i) => { - if (typeof i !== 'bigint' || !Fp.isValid(i)) - throw new Error(`Poseidon wrong round constant=${i}`); - return Fp.create(i); - }); - }); - - if (!sboxPower || ![3, 5, 7].includes(sboxPower)) - throw new Error(`Poseidon wrong sboxPower=${sboxPower}`); - const _sboxPower = BigInt(sboxPower); - let sboxFn = (n: bigint) => FpPow(Fp, n, _sboxPower); - // Unwrapped sbox power for common cases (195->142μs) - if (sboxPower === 3) sboxFn = (n: bigint) => Fp.mul(Fp.sqrN(n), n); - else if (sboxPower === 5) sboxFn = (n: bigint) => Fp.mul(Fp.sqrN(Fp.sqrN(n)), n); - - return Object.freeze({ ...opts, rounds, sboxFn, roundConstants, mds: _mds }); -} - -export function splitConstants(rc: bigint[], t: number) { - if (typeof t !== 'number') throw new Error('poseidonSplitConstants: wrong t'); - if (!Array.isArray(rc) || rc.length % t) throw new Error('poseidonSplitConstants: wrong rc'); - const res = []; - let tmp = []; - for (let i = 0; i < rc.length; i++) { - tmp.push(rc[i]); - if (tmp.length === t) { - res.push(tmp); - tmp = []; - } - } - return res; -} - -export function poseidon(opts: PoseidonOpts) { - const _opts = validateOpts(opts); - const { Fp, mds, roundConstants, rounds, roundsPartial, sboxFn, t } = _opts; - const halfRoundsFull = _opts.roundsFull / 2; - const partialIdx = _opts.reversePartialPowIdx ? t - 1 : 0; - const poseidonRound = (values: bigint[], isFull: boolean, idx: number) => { - values = values.map((i, j) => Fp.add(i, roundConstants[idx][j])); - - if (isFull) values = values.map((i) => sboxFn(i)); - else values[partialIdx] = sboxFn(values[partialIdx]); - // Matrix multiplication - values = mds.map((i) => i.reduce((acc, i, j) => Fp.add(acc, Fp.mulN(i, values[j])), Fp.ZERO)); - return values; - }; - const poseidonHash = function poseidonHash(values: bigint[]) { - if (!Array.isArray(values) || values.length !== t) - throw new Error(`Poseidon: wrong values (expected array of bigints with length ${t})`); - values = values.map((i) => { - if (typeof i !== 'bigint') throw new Error(`Poseidon: wrong value=${i} (${typeof i})`); - return Fp.create(i); - }); - let round = 0; - // Apply r_f/2 full rounds. - for (let i = 0; i < halfRoundsFull; i++) values = poseidonRound(values, true, round++); - // Apply r_p partial rounds. - for (let i = 0; i < roundsPartial; i++) values = poseidonRound(values, false, round++); - // Apply r_f/2 full rounds. - for (let i = 0; i < halfRoundsFull; i++) values = poseidonRound(values, true, round++); - - if (round !== rounds) - throw new Error(`Poseidon: wrong number of rounds: last round=${round}, total=${rounds}`); - return values; - }; - // For verification in tests - poseidonHash.roundConstants = roundConstants; - return poseidonHash; -} diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/abstract/utils.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/abstract/utils.ts deleted file mode 100644 index ff5b0c49..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/abstract/utils.ts +++ /dev/null @@ -1,290 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -// 100 lines of code in the file are duplicated from noble-hashes (utils). -// This is OK: `abstract` directory does not use noble-hashes. -// User may opt-in into using different hashing library. This way, noble-hashes -// won't be included into their bundle. -const _0n = BigInt(0); -const _1n = BigInt(1); -const _2n = BigInt(2); -const u8a = (a: any): a is Uint8Array => a instanceof Uint8Array; -export type Hex = Uint8Array | string; // hex strings are accepted for simplicity -export type PrivKey = Hex | bigint; // bigints are accepted to ease learning curve -export type CHash = { - (message: Uint8Array | string): Uint8Array; - blockLen: number; - outputLen: number; - create(opts?: { dkLen?: number }): any; // For shake -}; -export type FHash = (message: Uint8Array | string) => Uint8Array; - -const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => - i.toString(16).padStart(2, '0') -); -/** - * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123' - */ -export function bytesToHex(bytes: Uint8Array): string { - if (!u8a(bytes)) throw new Error('Uint8Array expected'); - // pre-caching improves the speed 6x - let hex = ''; - for (let i = 0; i < bytes.length; i++) { - hex += hexes[bytes[i]]; - } - return hex; -} - -export function numberToHexUnpadded(num: number | bigint): string { - const hex = num.toString(16); - return hex.length & 1 ? `0${hex}` : hex; -} - -export function hexToNumber(hex: string): bigint { - if (typeof hex !== 'string') throw new Error('hex string expected, got ' + typeof hex); - // Big Endian - return BigInt(hex === '' ? '0' : `0x${hex}`); -} - -/** - * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23]) - */ -export function hexToBytes(hex: string): Uint8Array { - if (typeof hex !== 'string') throw new Error('hex string expected, got ' + typeof hex); - const len = hex.length; - if (len % 2) throw new Error('padded hex string expected, got unpadded hex of length ' + len); - const array = new Uint8Array(len / 2); - for (let i = 0; i < array.length; i++) { - const j = i * 2; - const hexByte = hex.slice(j, j + 2); - const byte = Number.parseInt(hexByte, 16); - if (Number.isNaN(byte) || byte < 0) throw new Error('Invalid byte sequence'); - array[i] = byte; - } - return array; -} - -// BE: Big Endian, LE: Little Endian -export function bytesToNumberBE(bytes: Uint8Array): bigint { - return hexToNumber(bytesToHex(bytes)); -} -export function bytesToNumberLE(bytes: Uint8Array): bigint { - if (!u8a(bytes)) throw new Error('Uint8Array expected'); - return hexToNumber(bytesToHex(Uint8Array.from(bytes).reverse())); -} - -export function numberToBytesBE(n: number | bigint, len: number): Uint8Array { - return hexToBytes(n.toString(16).padStart(len * 2, '0')); -} -export function numberToBytesLE(n: number | bigint, len: number): Uint8Array { - return numberToBytesBE(n, len).reverse(); -} -// Unpadded, rarely used -export function numberToVarBytesBE(n: number | bigint): Uint8Array { - return hexToBytes(numberToHexUnpadded(n)); -} - -/** - * Takes hex string or Uint8Array, converts to Uint8Array. - * Validates output length. - * Will throw error for other types. - * @param title descriptive title for an error e.g. 'private key' - * @param hex hex string or Uint8Array - * @param expectedLength optional, will compare to result array's length - * @returns - */ -export function ensureBytes(title: string, hex: Hex, expectedLength?: number): Uint8Array { - let res: Uint8Array; - if (typeof hex === 'string') { - try { - res = hexToBytes(hex); - } catch (e) { - throw new Error(`${title} must be valid hex string, got "${hex}". Cause: ${e}`); - } - } else if (u8a(hex)) { - // Uint8Array.from() instead of hash.slice() because node.js Buffer - // is instance of Uint8Array, and its slice() creates **mutable** copy - res = Uint8Array.from(hex); - } else { - throw new Error(`${title} must be hex string or Uint8Array`); - } - const len = res.length; - if (typeof expectedLength === 'number' && len !== expectedLength) - throw new Error(`${title} expected ${expectedLength} bytes, got ${len}`); - return res; -} - -/** - * Copies several Uint8Arrays into one. - */ -export function concatBytes(...arrays: Uint8Array[]): Uint8Array { - const r = new Uint8Array(arrays.reduce((sum, a) => sum + a.length, 0)); - let pad = 0; // walk through each item, ensure they have proper type - arrays.forEach((a) => { - if (!u8a(a)) throw new Error('Uint8Array expected'); - r.set(a, pad); - pad += a.length; - }); - return r; -} - -export function equalBytes(b1: Uint8Array, b2: Uint8Array) { - // We don't care about timing attacks here - if (b1.length !== b2.length) return false; - for (let i = 0; i < b1.length; i++) if (b1[i] !== b2[i]) return false; - return true; -} - -// Global symbols in both browsers and Node.js since v11 -// See https://github.com/microsoft/TypeScript/issues/31535 -declare const TextEncoder: any; - -/** - * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99]) - */ -export function utf8ToBytes(str: string): Uint8Array { - if (typeof str !== 'string') throw new Error(`utf8ToBytes expected string, got ${typeof str}`); - return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809 -} - -// Bit operations - -/** - * Calculates amount of bits in a bigint. - * Same as `n.toString(2).length` - */ -export function bitLen(n: bigint) { - let len; - for (len = 0; n > _0n; n >>= _1n, len += 1); - return len; -} - -/** - * Gets single bit at position. - * NOTE: first bit position is 0 (same as arrays) - * Same as `!!+Array.from(n.toString(2)).reverse()[pos]` - */ -export function bitGet(n: bigint, pos: number) { - return (n >> BigInt(pos)) & _1n; -} - -/** - * Sets single bit at position. - */ -export const bitSet = (n: bigint, pos: number, value: boolean) => { - return n | ((value ? _1n : _0n) << BigInt(pos)); -}; - -/** - * Calculate mask for N bits. Not using ** operator with bigints because of old engines. - * Same as BigInt(`0b${Array(i).fill('1').join('')}`) - */ -export const bitMask = (n: number) => (_2n << BigInt(n - 1)) - _1n; - -// DRBG - -const u8n = (data?: any) => new Uint8Array(data); // creates Uint8Array -const u8fr = (arr: any) => Uint8Array.from(arr); // another shortcut -type Pred = (v: Uint8Array) => T | undefined; -/** - * Minimal HMAC-DRBG from NIST 800-90 for RFC6979 sigs. - * @returns function that will call DRBG until 2nd arg returns something meaningful - * @example - * const drbg = createHmacDRBG(32, 32, hmac); - * drbg(seed, bytesToKey); // bytesToKey must return Key or undefined - */ -export function createHmacDrbg( - hashLen: number, - qByteLen: number, - hmacFn: (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array -): (seed: Uint8Array, predicate: Pred) => T { - if (typeof hashLen !== 'number' || hashLen < 2) throw new Error('hashLen must be a number'); - if (typeof qByteLen !== 'number' || qByteLen < 2) throw new Error('qByteLen must be a number'); - if (typeof hmacFn !== 'function') throw new Error('hmacFn must be a function'); - // Step B, Step C: set hashLen to 8*ceil(hlen/8) - let v = u8n(hashLen); // Minimal non-full-spec HMAC-DRBG from NIST 800-90 for RFC6979 sigs. - let k = u8n(hashLen); // Steps B and C of RFC6979 3.2: set hashLen, in our case always same - let i = 0; // Iterations counter, will throw when over 1000 - const reset = () => { - v.fill(1); - k.fill(0); - i = 0; - }; - const h = (...b: Uint8Array[]) => hmacFn(k, v, ...b); // hmac(k)(v, ...values) - const reseed = (seed = u8n()) => { - // HMAC-DRBG reseed() function. Steps D-G - k = h(u8fr([0x00]), seed); // k = hmac(k || v || 0x00 || seed) - v = h(); // v = hmac(k || v) - if (seed.length === 0) return; - k = h(u8fr([0x01]), seed); // k = hmac(k || v || 0x01 || seed) - v = h(); // v = hmac(k || v) - }; - const gen = () => { - // HMAC-DRBG generate() function - if (i++ >= 1000) throw new Error('drbg: tried 1000 values'); - let len = 0; - const out: Uint8Array[] = []; - while (len < qByteLen) { - v = h(); - const sl = v.slice(); - out.push(sl); - len += v.length; - } - return concatBytes(...out); - }; - const genUntil = (seed: Uint8Array, pred: Pred): T => { - reset(); - reseed(seed); // Steps D-G - let res: T | undefined = undefined; // Step H: grind until k is in [1..n-1] - while (!(res = pred(gen()))) reseed(); - reset(); - return res; - }; - return genUntil; -} - -// Validating curves and fields - -const validatorFns = { - bigint: (val: any) => typeof val === 'bigint', - function: (val: any) => typeof val === 'function', - boolean: (val: any) => typeof val === 'boolean', - string: (val: any) => typeof val === 'string', - stringOrUint8Array: (val: any) => typeof val === 'string' || val instanceof Uint8Array, - isSafeInteger: (val: any) => Number.isSafeInteger(val), - array: (val: any) => Array.isArray(val), - field: (val: any, object: any) => (object as any).Fp.isValid(val), - hash: (val: any) => typeof val === 'function' && Number.isSafeInteger(val.outputLen), -} as const; -type Validator = keyof typeof validatorFns; -type ValMap> = { [K in keyof T]?: Validator }; -// type Record = { [P in K]: T; } - -export function validateObject>( - object: T, - validators: ValMap, - optValidators: ValMap = {} -) { - const checkField = (fieldName: keyof T, type: Validator, isOptional: boolean) => { - const checkVal = validatorFns[type]; - if (typeof checkVal !== 'function') - throw new Error(`Invalid validator "${type}", expected function`); - - const val = object[fieldName as keyof typeof object]; - if (isOptional && val === undefined) return; - if (!checkVal(val, object)) { - throw new Error( - `Invalid param ${String(fieldName)}=${val} (${typeof val}), expected ${type}` - ); - } - }; - for (const [fieldName, type] of Object.entries(validators)) checkField(fieldName, type!, false); - for (const [fieldName, type] of Object.entries(optValidators)) checkField(fieldName, type!, true); - return object; -} -// validate type tests -// const o: { a: number; b: number; c: number } = { a: 1, b: 5, c: 6 }; -// const z0 = validateObject(o, { a: 'isSafeInteger' }, { c: 'bigint' }); // Ok! -// // Should fail type-check -// const z1 = validateObject(o, { a: 'tmp' }, { c: 'zz' }); -// const z2 = validateObject(o, { a: 'isSafeInteger' }, { c: 'zz' }); -// const z3 = validateObject(o, { test: 'boolean', z: 'bug' }); -// const z4 = validateObject(o, { a: 'boolean', z: 'bug' }); diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/abstract/weierstrass.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/abstract/weierstrass.ts deleted file mode 100644 index 82e7d424..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/abstract/weierstrass.ts +++ /dev/null @@ -1,1222 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -// Short Weierstrass curve. The formula is: y² = x³ + ax + b -import * as mod from './modular.js'; -import * as ut from './utils.js'; -import { CHash, Hex, PrivKey, ensureBytes } from './utils.js'; -import { Group, GroupConstructor, wNAF, BasicCurve, validateBasic, AffinePoint } from './curve.js'; - -export type { AffinePoint }; -type HmacFnSync = (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array; -type EndomorphismOpts = { - beta: bigint; - splitScalar: (k: bigint) => { k1neg: boolean; k1: bigint; k2neg: boolean; k2: bigint }; -}; -export type BasicWCurve = BasicCurve & { - // Params: a, b - a: T; - b: T; - - // Optional params - allowedPrivateKeyLengths?: readonly number[]; // for P521 - wrapPrivateKey?: boolean; // bls12-381 requires mod(n) instead of rejecting keys >= n - endo?: EndomorphismOpts; // Endomorphism options for Koblitz curves - // When a cofactor != 1, there can be an effective methods to: - // 1. Determine whether a point is torsion-free - isTorsionFree?: (c: ProjConstructor, point: ProjPointType) => boolean; - // 2. Clear torsion component - clearCofactor?: (c: ProjConstructor, point: ProjPointType) => ProjPointType; -}; - -type Entropy = Hex | true; -export type SignOpts = { lowS?: boolean; extraEntropy?: Entropy; prehash?: boolean }; -export type VerOpts = { lowS?: boolean; prehash?: boolean }; - -/** - * ### Design rationale for types - * - * * Interaction between classes from different curves should fail: - * `k256.Point.BASE.add(p256.Point.BASE)` - * * For this purpose we want to use `instanceof` operator, which is fast and works during runtime - * * Different calls of `curve()` would return different classes - - * `curve(params) !== curve(params)`: if somebody decided to monkey-patch their curve, - * it won't affect others - * - * TypeScript can't infer types for classes created inside a function. Classes is one instance of nominative types in TypeScript and interfaces only check for shape, so it's hard to create unique type for every function call. - * - * We can use generic types via some param, like curve opts, but that would: - * 1. Enable interaction between `curve(params)` and `curve(params)` (curves of same params) - * which is hard to debug. - * 2. Params can be generic and we can't enforce them to be constant value: - * if somebody creates curve from non-constant params, - * it would be allowed to interact with other curves with non-constant params - * - * TODO: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html#unique-symbol - */ - -// Instance for 3d XYZ points -export interface ProjPointType extends Group> { - readonly px: T; - readonly py: T; - readonly pz: T; - get x(): T; - get y(): T; - multiply(scalar: bigint): ProjPointType; - toAffine(iz?: T): AffinePoint; - isTorsionFree(): boolean; - clearCofactor(): ProjPointType; - assertValidity(): void; - hasEvenY(): boolean; - toRawBytes(isCompressed?: boolean): Uint8Array; - toHex(isCompressed?: boolean): string; - - multiplyUnsafe(scalar: bigint): ProjPointType; - multiplyAndAddUnsafe(Q: ProjPointType, a: bigint, b: bigint): ProjPointType | undefined; - _setWindowSize(windowSize: number): void; -} -// Static methods for 3d XYZ points -export interface ProjConstructor extends GroupConstructor> { - new (x: T, y: T, z: T): ProjPointType; - fromAffine(p: AffinePoint): ProjPointType; - fromHex(hex: Hex): ProjPointType; - fromPrivateKey(privateKey: PrivKey): ProjPointType; - normalizeZ(points: ProjPointType[]): ProjPointType[]; -} - -export type CurvePointsType = BasicWCurve & { - // Bytes - fromBytes?: (bytes: Uint8Array) => AffinePoint; - toBytes?: (c: ProjConstructor, point: ProjPointType, isCompressed: boolean) => Uint8Array; -}; - -function validatePointOpts(curve: CurvePointsType) { - const opts = validateBasic(curve); - ut.validateObject( - opts, - { - a: 'field', - b: 'field', - }, - { - allowedPrivateKeyLengths: 'array', - wrapPrivateKey: 'boolean', - isTorsionFree: 'function', - clearCofactor: 'function', - allowInfinityPoint: 'boolean', - fromBytes: 'function', - toBytes: 'function', - } - ); - const { endo, Fp, a } = opts; - if (endo) { - if (!Fp.eql(a, Fp.ZERO)) { - throw new Error('Endomorphism can only be defined for Koblitz curves that have a=0'); - } - if ( - typeof endo !== 'object' || - typeof endo.beta !== 'bigint' || - typeof endo.splitScalar !== 'function' - ) { - throw new Error('Expected endomorphism with beta: bigint and splitScalar: function'); - } - } - return Object.freeze({ ...opts } as const); -} - -export type CurvePointsRes = { - ProjectivePoint: ProjConstructor; - normPrivateKeyToScalar: (key: PrivKey) => bigint; - weierstrassEquation: (x: T) => T; - isWithinCurveOrder: (num: bigint) => boolean; -}; - -// ASN.1 DER encoding utilities -const { bytesToNumberBE: b2n, hexToBytes: h2b } = ut; -export const DER = { - // asn.1 DER encoding utils - Err: class DERErr extends Error { - constructor(m = '') { - super(m); - } - }, - _parseInt(data: Uint8Array): { d: bigint; l: Uint8Array } { - const { Err: E } = DER; - if (data.length < 2 || data[0] !== 0x02) throw new E('Invalid signature integer tag'); - const len = data[1]; - const res = data.subarray(2, len + 2); - if (!len || res.length !== len) throw new E('Invalid signature integer: wrong length'); - // https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag, - // since we always use positive integers here. It must always be empty: - // - add zero byte if exists - // - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding) - if (res[0] & 0b10000000) throw new E('Invalid signature integer: negative'); - if (res[0] === 0x00 && !(res[1] & 0b10000000)) - throw new E('Invalid signature integer: unnecessary leading zero'); - return { d: b2n(res), l: data.subarray(len + 2) }; // d is data, l is left - }, - toSig(hex: string | Uint8Array): { r: bigint; s: bigint } { - // parse DER signature - const { Err: E } = DER; - const data = typeof hex === 'string' ? h2b(hex) : hex; - if (!(data instanceof Uint8Array)) throw new Error('ui8a expected'); - let l = data.length; - if (l < 2 || data[0] != 0x30) throw new E('Invalid signature tag'); - if (data[1] !== l - 2) throw new E('Invalid signature: incorrect length'); - const { d: r, l: sBytes } = DER._parseInt(data.subarray(2)); - const { d: s, l: rBytesLeft } = DER._parseInt(sBytes); - if (rBytesLeft.length) throw new E('Invalid signature: left bytes after parsing'); - return { r, s }; - }, - hexFromSig(sig: { r: bigint; s: bigint }): string { - // Add leading zero if first byte has negative bit enabled. More details in '_parseInt' - const slice = (s: string): string => (Number.parseInt(s[0], 16) & 0b1000 ? '00' + s : s); - const h = (num: number | bigint) => { - const hex = num.toString(16); - return hex.length & 1 ? `0${hex}` : hex; - }; - const s = slice(h(sig.s)); - const r = slice(h(sig.r)); - const shl = s.length / 2; - const rhl = r.length / 2; - const sl = h(shl); - const rl = h(rhl); - return `30${h(rhl + shl + 4)}02${rl}${r}02${sl}${s}`; - }, -}; - -// Be friendly to bad ECMAScript parsers by not using bigint literals -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = BigInt(4); - -export function weierstrassPoints(opts: CurvePointsType) { - const CURVE = validatePointOpts(opts); - const { Fp } = CURVE; // All curves has same field / group length as for now, but they can differ - - const toBytes = - CURVE.toBytes || - ((_c: ProjConstructor, point: ProjPointType, _isCompressed: boolean) => { - const a = point.toAffine(); - return ut.concatBytes(Uint8Array.from([0x04]), Fp.toBytes(a.x), Fp.toBytes(a.y)); - }); - const fromBytes = - CURVE.fromBytes || - ((bytes: Uint8Array) => { - // const head = bytes[0]; - const tail = bytes.subarray(1); - // if (head !== 0x04) throw new Error('Only non-compressed encoding is supported'); - const x = Fp.fromBytes(tail.subarray(0, Fp.BYTES)); - const y = Fp.fromBytes(tail.subarray(Fp.BYTES, 2 * Fp.BYTES)); - return { x, y }; - }); - - /** - * y² = x³ + ax + b: Short weierstrass curve formula - * @returns y² - */ - function weierstrassEquation(x: T): T { - const { a, b } = CURVE; - const x2 = Fp.sqr(x); // x * x - const x3 = Fp.mul(x2, x); // x2 * x - return Fp.add(Fp.add(x3, Fp.mul(x, a)), b); // x3 + a * x + b - } - // Validate whether the passed curve params are valid. - // We check if curve equation works for generator point. - // `assertValidity()` won't work: `isTorsionFree()` is not available at this point in bls12-381. - // ProjectivePoint class has not been initialized yet. - if (!Fp.eql(Fp.sqr(CURVE.Gy), weierstrassEquation(CURVE.Gx))) - throw new Error('bad generator point: equation left != right'); - - // Valid group elements reside in range 1..n-1 - function isWithinCurveOrder(num: bigint): boolean { - return typeof num === 'bigint' && _0n < num && num < CURVE.n; - } - function assertGE(num: bigint) { - if (!isWithinCurveOrder(num)) throw new Error('Expected valid bigint: 0 < bigint < curve.n'); - } - // Validates if priv key is valid and converts it to bigint. - // Supports options allowedPrivateKeyLengths and wrapPrivateKey. - function normPrivateKeyToScalar(key: PrivKey): bigint { - const { allowedPrivateKeyLengths: lengths, nByteLength, wrapPrivateKey, n } = CURVE; - if (lengths && typeof key !== 'bigint') { - if (key instanceof Uint8Array) key = ut.bytesToHex(key); - // Normalize to hex string, pad. E.g. P521 would norm 130-132 char hex to 132-char bytes - if (typeof key !== 'string' || !lengths.includes(key.length)) throw new Error('Invalid key'); - key = key.padStart(nByteLength * 2, '0'); - } - let num: bigint; - try { - num = - typeof key === 'bigint' - ? key - : ut.bytesToNumberBE(ensureBytes('private key', key, nByteLength)); - } catch (error) { - throw new Error(`private key must be ${nByteLength} bytes, hex or bigint, not ${typeof key}`); - } - if (wrapPrivateKey) num = mod.mod(num, n); // disabled by default, enabled for BLS - assertGE(num); // num in range [1..N-1] - return num; - } - - const pointPrecomputes = new Map(); - function assertPrjPoint(other: unknown) { - if (!(other instanceof Point)) throw new Error('ProjectivePoint expected'); - } - /** - * Projective Point works in 3d / projective (homogeneous) coordinates: (x, y, z) ∋ (x=x/z, y=y/z) - * Default Point works in 2d / affine coordinates: (x, y) - * We're doing calculations in projective, because its operations don't require costly inversion. - */ - class Point implements ProjPointType { - static readonly BASE = new Point(CURVE.Gx, CURVE.Gy, Fp.ONE); - static readonly ZERO = new Point(Fp.ZERO, Fp.ONE, Fp.ZERO); - - constructor(readonly px: T, readonly py: T, readonly pz: T) { - if (px == null || !Fp.isValid(px)) throw new Error('x required'); - if (py == null || !Fp.isValid(py)) throw new Error('y required'); - if (pz == null || !Fp.isValid(pz)) throw new Error('z required'); - } - - // Does not validate if the point is on-curve. - // Use fromHex instead, or call assertValidity() later. - static fromAffine(p: AffinePoint): Point { - const { x, y } = p || {}; - if (!p || !Fp.isValid(x) || !Fp.isValid(y)) throw new Error('invalid affine point'); - if (p instanceof Point) throw new Error('projective point not allowed'); - const is0 = (i: T) => Fp.eql(i, Fp.ZERO); - // fromAffine(x:0, y:0) would produce (x:0, y:0, z:1), but we need (x:0, y:1, z:0) - if (is0(x) && is0(y)) return Point.ZERO; - return new Point(x, y, Fp.ONE); - } - - get x(): T { - return this.toAffine().x; - } - get y(): T { - return this.toAffine().y; - } - - /** - * Takes a bunch of Projective Points but executes only one - * inversion on all of them. Inversion is very slow operation, - * so this improves performance massively. - * Optimization: converts a list of projective points to a list of identical points with Z=1. - */ - static normalizeZ(points: Point[]): Point[] { - const toInv = Fp.invertBatch(points.map((p) => p.pz)); - return points.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine); - } - - /** - * Converts hash string or Uint8Array to Point. - * @param hex short/long ECDSA hex - */ - static fromHex(hex: Hex): Point { - const P = Point.fromAffine(fromBytes(ensureBytes('pointHex', hex))); - P.assertValidity(); - return P; - } - - // Multiplies generator point by privateKey. - static fromPrivateKey(privateKey: PrivKey) { - return Point.BASE.multiply(normPrivateKeyToScalar(privateKey)); - } - - // We calculate precomputes for elliptic curve point multiplication - // using windowed method. This specifies window size and - // stores precomputed values. Usually only base point would be precomputed. - _WINDOW_SIZE?: number; - - // "Private method", don't use it directly - _setWindowSize(windowSize: number) { - this._WINDOW_SIZE = windowSize; - pointPrecomputes.delete(this); - } - - // A point on curve is valid if it conforms to equation. - assertValidity(): void { - if (this.is0()) { - // (0, 1, 0) aka ZERO is invalid in most contexts. - // In BLS, ZERO can be serialized, so we allow it. - // (0, 0, 0) is wrong representation of ZERO and is always invalid. - if (CURVE.allowInfinityPoint && !Fp.is0(this.py)) return; - throw new Error('bad point: ZERO'); - } - // Some 3rd-party test vectors require different wording between here & `fromCompressedHex` - const { x, y } = this.toAffine(); - // Check if x, y are valid field elements - if (!Fp.isValid(x) || !Fp.isValid(y)) throw new Error('bad point: x or y not FE'); - const left = Fp.sqr(y); // y² - const right = weierstrassEquation(x); // x³ + ax + b - if (!Fp.eql(left, right)) throw new Error('bad point: equation left != right'); - if (!this.isTorsionFree()) throw new Error('bad point: not in prime-order subgroup'); - } - hasEvenY(): boolean { - const { y } = this.toAffine(); - if (Fp.isOdd) return !Fp.isOdd(y); - throw new Error("Field doesn't support isOdd"); - } - - /** - * Compare one point to another. - */ - equals(other: Point): boolean { - assertPrjPoint(other); - const { px: X1, py: Y1, pz: Z1 } = this; - const { px: X2, py: Y2, pz: Z2 } = other; - const U1 = Fp.eql(Fp.mul(X1, Z2), Fp.mul(X2, Z1)); - const U2 = Fp.eql(Fp.mul(Y1, Z2), Fp.mul(Y2, Z1)); - return U1 && U2; - } - - /** - * Flips point to one corresponding to (x, -y) in Affine coordinates. - */ - negate(): Point { - return new Point(this.px, Fp.neg(this.py), this.pz); - } - - // Renes-Costello-Batina exception-free doubling formula. - // There is 30% faster Jacobian formula, but it is not complete. - // https://eprint.iacr.org/2015/1060, algorithm 3 - // Cost: 8M + 3S + 3*a + 2*b3 + 15add. - double() { - const { a, b } = CURVE; - const b3 = Fp.mul(b, _3n); - const { px: X1, py: Y1, pz: Z1 } = this; - let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore - let t0 = Fp.mul(X1, X1); // step 1 - let t1 = Fp.mul(Y1, Y1); - let t2 = Fp.mul(Z1, Z1); - let t3 = Fp.mul(X1, Y1); - t3 = Fp.add(t3, t3); // step 5 - Z3 = Fp.mul(X1, Z1); - Z3 = Fp.add(Z3, Z3); - X3 = Fp.mul(a, Z3); - Y3 = Fp.mul(b3, t2); - Y3 = Fp.add(X3, Y3); // step 10 - X3 = Fp.sub(t1, Y3); - Y3 = Fp.add(t1, Y3); - Y3 = Fp.mul(X3, Y3); - X3 = Fp.mul(t3, X3); - Z3 = Fp.mul(b3, Z3); // step 15 - t2 = Fp.mul(a, t2); - t3 = Fp.sub(t0, t2); - t3 = Fp.mul(a, t3); - t3 = Fp.add(t3, Z3); - Z3 = Fp.add(t0, t0); // step 20 - t0 = Fp.add(Z3, t0); - t0 = Fp.add(t0, t2); - t0 = Fp.mul(t0, t3); - Y3 = Fp.add(Y3, t0); - t2 = Fp.mul(Y1, Z1); // step 25 - t2 = Fp.add(t2, t2); - t0 = Fp.mul(t2, t3); - X3 = Fp.sub(X3, t0); - Z3 = Fp.mul(t2, t1); - Z3 = Fp.add(Z3, Z3); // step 30 - Z3 = Fp.add(Z3, Z3); - return new Point(X3, Y3, Z3); - } - - // Renes-Costello-Batina exception-free addition formula. - // There is 30% faster Jacobian formula, but it is not complete. - // https://eprint.iacr.org/2015/1060, algorithm 1 - // Cost: 12M + 0S + 3*a + 3*b3 + 23add. - add(other: Point): Point { - assertPrjPoint(other); - const { px: X1, py: Y1, pz: Z1 } = this; - const { px: X2, py: Y2, pz: Z2 } = other; - let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore - const a = CURVE.a; - const b3 = Fp.mul(CURVE.b, _3n); - let t0 = Fp.mul(X1, X2); // step 1 - let t1 = Fp.mul(Y1, Y2); - let t2 = Fp.mul(Z1, Z2); - let t3 = Fp.add(X1, Y1); - let t4 = Fp.add(X2, Y2); // step 5 - t3 = Fp.mul(t3, t4); - t4 = Fp.add(t0, t1); - t3 = Fp.sub(t3, t4); - t4 = Fp.add(X1, Z1); - let t5 = Fp.add(X2, Z2); // step 10 - t4 = Fp.mul(t4, t5); - t5 = Fp.add(t0, t2); - t4 = Fp.sub(t4, t5); - t5 = Fp.add(Y1, Z1); - X3 = Fp.add(Y2, Z2); // step 15 - t5 = Fp.mul(t5, X3); - X3 = Fp.add(t1, t2); - t5 = Fp.sub(t5, X3); - Z3 = Fp.mul(a, t4); - X3 = Fp.mul(b3, t2); // step 20 - Z3 = Fp.add(X3, Z3); - X3 = Fp.sub(t1, Z3); - Z3 = Fp.add(t1, Z3); - Y3 = Fp.mul(X3, Z3); - t1 = Fp.add(t0, t0); // step 25 - t1 = Fp.add(t1, t0); - t2 = Fp.mul(a, t2); - t4 = Fp.mul(b3, t4); - t1 = Fp.add(t1, t2); - t2 = Fp.sub(t0, t2); // step 30 - t2 = Fp.mul(a, t2); - t4 = Fp.add(t4, t2); - t0 = Fp.mul(t1, t4); - Y3 = Fp.add(Y3, t0); - t0 = Fp.mul(t5, t4); // step 35 - X3 = Fp.mul(t3, X3); - X3 = Fp.sub(X3, t0); - t0 = Fp.mul(t3, t1); - Z3 = Fp.mul(t5, Z3); - Z3 = Fp.add(Z3, t0); // step 40 - return new Point(X3, Y3, Z3); - } - - subtract(other: Point) { - return this.add(other.negate()); - } - - private is0() { - return this.equals(Point.ZERO); - } - private wNAF(n: bigint): { p: Point; f: Point } { - return wnaf.wNAFCached(this, pointPrecomputes, n, (comp: Point[]) => { - const toInv = Fp.invertBatch(comp.map((p) => p.pz)); - return comp.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine); - }); - } - - /** - * Non-constant-time multiplication. Uses double-and-add algorithm. - * It's faster, but should only be used when you don't care about - * an exposed private key e.g. sig verification, which works over *public* keys. - */ - multiplyUnsafe(n: bigint): Point { - const I = Point.ZERO; - if (n === _0n) return I; - assertGE(n); // Will throw on 0 - if (n === _1n) return this; - const { endo } = CURVE; - if (!endo) return wnaf.unsafeLadder(this, n); - - // Apply endomorphism - let { k1neg, k1, k2neg, k2 } = endo.splitScalar(n); - let k1p = I; - let k2p = I; - let d: Point = this; - while (k1 > _0n || k2 > _0n) { - if (k1 & _1n) k1p = k1p.add(d); - if (k2 & _1n) k2p = k2p.add(d); - d = d.double(); - k1 >>= _1n; - k2 >>= _1n; - } - if (k1neg) k1p = k1p.negate(); - if (k2neg) k2p = k2p.negate(); - k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz); - return k1p.add(k2p); - } - - /** - * Constant time multiplication. - * Uses wNAF method. Windowed method may be 10% faster, - * but takes 2x longer to generate and consumes 2x memory. - * Uses precomputes when available. - * Uses endomorphism for Koblitz curves. - * @param scalar by which the point would be multiplied - * @returns New point - */ - multiply(scalar: bigint): Point { - assertGE(scalar); - let n = scalar; - let point: Point, fake: Point; // Fake point is used to const-time mult - const { endo } = CURVE; - if (endo) { - const { k1neg, k1, k2neg, k2 } = endo.splitScalar(n); - let { p: k1p, f: f1p } = this.wNAF(k1); - let { p: k2p, f: f2p } = this.wNAF(k2); - k1p = wnaf.constTimeNegate(k1neg, k1p); - k2p = wnaf.constTimeNegate(k2neg, k2p); - k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz); - point = k1p.add(k2p); - fake = f1p.add(f2p); - } else { - const { p, f } = this.wNAF(n); - point = p; - fake = f; - } - // Normalize `z` for both points, but return only real one - return Point.normalizeZ([point, fake])[0]; - } - - /** - * Efficiently calculate `aP + bQ`. Unsafe, can expose private key, if used incorrectly. - * Not using Strauss-Shamir trick: precomputation tables are faster. - * The trick could be useful if both P and Q are not G (not in our case). - * @returns non-zero affine point - */ - multiplyAndAddUnsafe(Q: Point, a: bigint, b: bigint): Point | undefined { - const G = Point.BASE; // No Strauss-Shamir trick: we have 10% faster G precomputes - const mul = ( - P: Point, - a: bigint // Select faster multiply() method - ) => (a === _0n || a === _1n || !P.equals(G) ? P.multiplyUnsafe(a) : P.multiply(a)); - const sum = mul(this, a).add(mul(Q, b)); - return sum.is0() ? undefined : sum; - } - - // Converts Projective point to affine (x, y) coordinates. - // Can accept precomputed Z^-1 - for example, from invertBatch. - // (x, y, z) ∋ (x=x/z, y=y/z) - toAffine(iz?: T): AffinePoint { - const { px: x, py: y, pz: z } = this; - const is0 = this.is0(); - // If invZ was 0, we return zero point. However we still want to execute - // all operations, so we replace invZ with a random number, 1. - if (iz == null) iz = is0 ? Fp.ONE : Fp.inv(z); - const ax = Fp.mul(x, iz); - const ay = Fp.mul(y, iz); - const zz = Fp.mul(z, iz); - if (is0) return { x: Fp.ZERO, y: Fp.ZERO }; - if (!Fp.eql(zz, Fp.ONE)) throw new Error('invZ was invalid'); - return { x: ax, y: ay }; - } - isTorsionFree(): boolean { - const { h: cofactor, isTorsionFree } = CURVE; - if (cofactor === _1n) return true; // No subgroups, always torsion-free - if (isTorsionFree) return isTorsionFree(Point, this); - throw new Error('isTorsionFree() has not been declared for the elliptic curve'); - } - clearCofactor(): Point { - const { h: cofactor, clearCofactor } = CURVE; - if (cofactor === _1n) return this; // Fast-path - if (clearCofactor) return clearCofactor(Point, this) as Point; - return this.multiplyUnsafe(CURVE.h); - } - - toRawBytes(isCompressed = true): Uint8Array { - this.assertValidity(); - return toBytes(Point, this, isCompressed); - } - - toHex(isCompressed = true): string { - return ut.bytesToHex(this.toRawBytes(isCompressed)); - } - } - const _bits = CURVE.nBitLength; - const wnaf = wNAF(Point, CURVE.endo ? Math.ceil(_bits / 2) : _bits); - // Validate if generator point is on curve - return { - CURVE, - ProjectivePoint: Point as ProjConstructor, - normPrivateKeyToScalar, - weierstrassEquation, - isWithinCurveOrder, - }; -} - -// Instance -export interface SignatureType { - readonly r: bigint; - readonly s: bigint; - readonly recovery?: number; - assertValidity(): void; - addRecoveryBit(recovery: number): RecoveredSignatureType; - hasHighS(): boolean; - normalizeS(): SignatureType; - recoverPublicKey(msgHash: Hex): ProjPointType; - toCompactRawBytes(): Uint8Array; - toCompactHex(): string; - // DER-encoded - toDERRawBytes(isCompressed?: boolean): Uint8Array; - toDERHex(isCompressed?: boolean): string; -} -export type RecoveredSignatureType = SignatureType & { - readonly recovery: number; -}; -// Static methods -export type SignatureConstructor = { - new (r: bigint, s: bigint): SignatureType; - fromCompact(hex: Hex): SignatureType; - fromDER(hex: Hex): SignatureType; -}; -type SignatureLike = { r: bigint; s: bigint }; - -export type PubKey = Hex | ProjPointType; - -export type CurveType = BasicWCurve & { - hash: CHash; // CHash not FHash because we need outputLen for DRBG - hmac: HmacFnSync; - randomBytes: (bytesLength?: number) => Uint8Array; - lowS?: boolean; - bits2int?: (bytes: Uint8Array) => bigint; - bits2int_modN?: (bytes: Uint8Array) => bigint; -}; - -function validateOpts(curve: CurveType) { - const opts = validateBasic(curve); - ut.validateObject( - opts, - { - hash: 'hash', - hmac: 'function', - randomBytes: 'function', - }, - { - bits2int: 'function', - bits2int_modN: 'function', - lowS: 'boolean', - } - ); - return Object.freeze({ lowS: true, ...opts } as const); -} - -export type CurveFn = { - CURVE: ReturnType; - getPublicKey: (privateKey: PrivKey, isCompressed?: boolean) => Uint8Array; - getSharedSecret: (privateA: PrivKey, publicB: Hex, isCompressed?: boolean) => Uint8Array; - sign: (msgHash: Hex, privKey: PrivKey, opts?: SignOpts) => RecoveredSignatureType; - verify: (signature: Hex | SignatureLike, msgHash: Hex, publicKey: Hex, opts?: VerOpts) => boolean; - ProjectivePoint: ProjConstructor; - Signature: SignatureConstructor; - utils: { - normPrivateKeyToScalar: (key: PrivKey) => bigint; - isValidPrivateKey(privateKey: PrivKey): boolean; - randomPrivateKey: () => Uint8Array; - precompute: (windowSize?: number, point?: ProjPointType) => ProjPointType; - }; -}; - -export function weierstrass(curveDef: CurveType): CurveFn { - const CURVE = validateOpts(curveDef) as ReturnType; - const { Fp, n: CURVE_ORDER } = CURVE; - const compressedLen = Fp.BYTES + 1; // e.g. 33 for 32 - const uncompressedLen = 2 * Fp.BYTES + 1; // e.g. 65 for 32 - - function isValidFieldElement(num: bigint): boolean { - return _0n < num && num < Fp.ORDER; // 0 is banned since it's not invertible FE - } - function modN(a: bigint) { - return mod.mod(a, CURVE_ORDER); - } - function invN(a: bigint) { - return mod.invert(a, CURVE_ORDER); - } - - const { - ProjectivePoint: Point, - normPrivateKeyToScalar, - weierstrassEquation, - isWithinCurveOrder, - } = weierstrassPoints({ - ...CURVE, - toBytes(_c, point, isCompressed: boolean): Uint8Array { - const a = point.toAffine(); - const x = Fp.toBytes(a.x); - const cat = ut.concatBytes; - if (isCompressed) { - return cat(Uint8Array.from([point.hasEvenY() ? 0x02 : 0x03]), x); - } else { - return cat(Uint8Array.from([0x04]), x, Fp.toBytes(a.y)); - } - }, - fromBytes(bytes: Uint8Array) { - const len = bytes.length; - const head = bytes[0]; - const tail = bytes.subarray(1); - // this.assertValidity() is done inside of fromHex - if (len === compressedLen && (head === 0x02 || head === 0x03)) { - const x = ut.bytesToNumberBE(tail); - if (!isValidFieldElement(x)) throw new Error('Point is not on curve'); - const y2 = weierstrassEquation(x); // y² = x³ + ax + b - let y = Fp.sqrt(y2); // y = y² ^ (p+1)/4 - const isYOdd = (y & _1n) === _1n; - // ECDSA - const isHeadOdd = (head & 1) === 1; - if (isHeadOdd !== isYOdd) y = Fp.neg(y); - return { x, y }; - } else if (len === uncompressedLen && head === 0x04) { - const x = Fp.fromBytes(tail.subarray(0, Fp.BYTES)); - const y = Fp.fromBytes(tail.subarray(Fp.BYTES, 2 * Fp.BYTES)); - return { x, y }; - } else { - throw new Error( - `Point of length ${len} was invalid. Expected ${compressedLen} compressed bytes or ${uncompressedLen} uncompressed bytes` - ); - } - }, - }); - const numToNByteStr = (num: bigint): string => - ut.bytesToHex(ut.numberToBytesBE(num, CURVE.nByteLength)); - - function isBiggerThanHalfOrder(number: bigint) { - const HALF = CURVE_ORDER >> _1n; - return number > HALF; - } - - function normalizeS(s: bigint) { - return isBiggerThanHalfOrder(s) ? modN(-s) : s; - } - // slice bytes num - const slcNum = (b: Uint8Array, from: number, to: number) => ut.bytesToNumberBE(b.slice(from, to)); - - /** - * ECDSA signature with its (r, s) properties. Supports DER & compact representations. - */ - class Signature implements SignatureType { - constructor(readonly r: bigint, readonly s: bigint, readonly recovery?: number) { - this.assertValidity(); - } - - // pair (bytes of r, bytes of s) - static fromCompact(hex: Hex) { - const l = CURVE.nByteLength; - hex = ensureBytes('compactSignature', hex, l * 2); - return new Signature(slcNum(hex, 0, l), slcNum(hex, l, 2 * l)); - } - - // DER encoded ECDSA signature - // https://bitcoin.stackexchange.com/questions/57644/what-are-the-parts-of-a-bitcoin-transaction-input-script - static fromDER(hex: Hex) { - const { r, s } = DER.toSig(ensureBytes('DER', hex)); - return new Signature(r, s); - } - - assertValidity(): void { - // can use assertGE here - if (!isWithinCurveOrder(this.r)) throw new Error('r must be 0 < r < CURVE.n'); - if (!isWithinCurveOrder(this.s)) throw new Error('s must be 0 < s < CURVE.n'); - } - - addRecoveryBit(recovery: number): RecoveredSignature { - return new Signature(this.r, this.s, recovery) as RecoveredSignature; - } - - recoverPublicKey(msgHash: Hex): typeof Point.BASE { - const { r, s, recovery: rec } = this; - const h = bits2int_modN(ensureBytes('msgHash', msgHash)); // Truncate hash - if (rec == null || ![0, 1, 2, 3].includes(rec)) throw new Error('recovery id invalid'); - const radj = rec === 2 || rec === 3 ? r + CURVE.n : r; - if (radj >= Fp.ORDER) throw new Error('recovery id 2 or 3 invalid'); - const prefix = (rec & 1) === 0 ? '02' : '03'; - const R = Point.fromHex(prefix + numToNByteStr(radj)); - const ir = invN(radj); // r^-1 - const u1 = modN(-h * ir); // -hr^-1 - const u2 = modN(s * ir); // sr^-1 - const Q = Point.BASE.multiplyAndAddUnsafe(R, u1, u2); // (sr^-1)R-(hr^-1)G = -(hr^-1)G + (sr^-1) - if (!Q) throw new Error('point at infinify'); // unsafe is fine: no priv data leaked - Q.assertValidity(); - return Q; - } - - // Signatures should be low-s, to prevent malleability. - hasHighS(): boolean { - return isBiggerThanHalfOrder(this.s); - } - - normalizeS() { - return this.hasHighS() ? new Signature(this.r, modN(-this.s), this.recovery) : this; - } - - // DER-encoded - toDERRawBytes() { - return ut.hexToBytes(this.toDERHex()); - } - toDERHex() { - return DER.hexFromSig({ r: this.r, s: this.s }); - } - - // padded bytes of r, then padded bytes of s - toCompactRawBytes() { - return ut.hexToBytes(this.toCompactHex()); - } - toCompactHex() { - return numToNByteStr(this.r) + numToNByteStr(this.s); - } - } - type RecoveredSignature = Signature & { recovery: number }; - - const utils = { - isValidPrivateKey(privateKey: PrivKey) { - try { - normPrivateKeyToScalar(privateKey); - return true; - } catch (error) { - return false; - } - }, - normPrivateKeyToScalar: normPrivateKeyToScalar, - - /** - * Produces cryptographically secure private key from random of size - * (groupLen + ceil(groupLen / 2)) with modulo bias being negligible. - */ - randomPrivateKey: (): Uint8Array => { - const length = mod.getMinHashLength(CURVE.n); - return mod.mapHashToField(CURVE.randomBytes(length), CURVE.n); - }, - - /** - * Creates precompute table for an arbitrary EC point. Makes point "cached". - * Allows to massively speed-up `point.multiply(scalar)`. - * @returns cached point - * @example - * const fast = utils.precompute(8, ProjectivePoint.fromHex(someonesPubKey)); - * fast.multiply(privKey); // much faster ECDH now - */ - precompute(windowSize = 8, point = Point.BASE): typeof Point.BASE { - point._setWindowSize(windowSize); - point.multiply(BigInt(3)); // 3 is arbitrary, just need any number here - return point; - }, - }; - - /** - * Computes public key for a private key. Checks for validity of the private key. - * @param privateKey private key - * @param isCompressed whether to return compact (default), or full key - * @returns Public key, full when isCompressed=false; short when isCompressed=true - */ - function getPublicKey(privateKey: PrivKey, isCompressed = true): Uint8Array { - return Point.fromPrivateKey(privateKey).toRawBytes(isCompressed); - } - - /** - * Quick and dirty check for item being public key. Does not validate hex, or being on-curve. - */ - function isProbPub(item: PrivKey | PubKey): boolean { - const arr = item instanceof Uint8Array; - const str = typeof item === 'string'; - const len = (arr || str) && (item as Hex).length; - if (arr) return len === compressedLen || len === uncompressedLen; - if (str) return len === 2 * compressedLen || len === 2 * uncompressedLen; - if (item instanceof Point) return true; - return false; - } - - /** - * ECDH (Elliptic Curve Diffie Hellman). - * Computes shared public key from private key and public key. - * Checks: 1) private key validity 2) shared key is on-curve. - * Does NOT hash the result. - * @param privateA private key - * @param publicB different public key - * @param isCompressed whether to return compact (default), or full key - * @returns shared public key - */ - function getSharedSecret(privateA: PrivKey, publicB: Hex, isCompressed = true): Uint8Array { - if (isProbPub(privateA)) throw new Error('first arg must be private key'); - if (!isProbPub(publicB)) throw new Error('second arg must be public key'); - const b = Point.fromHex(publicB); // check for being on-curve - return b.multiply(normPrivateKeyToScalar(privateA)).toRawBytes(isCompressed); - } - - // RFC6979: ensure ECDSA msg is X bytes and < N. RFC suggests optional truncating via bits2octets. - // FIPS 186-4 4.6 suggests the leftmost min(nBitLen, outLen) bits, which matches bits2int. - // bits2int can produce res>N, we can do mod(res, N) since the bitLen is the same. - // int2octets can't be used; pads small msgs with 0: unacceptatble for trunc as per RFC vectors - const bits2int = - CURVE.bits2int || - function (bytes: Uint8Array): bigint { - // For curves with nBitLength % 8 !== 0: bits2octets(bits2octets(m)) !== bits2octets(m) - // for some cases, since bytes.length * 8 is not actual bitLength. - const num = ut.bytesToNumberBE(bytes); // check for == u8 done here - const delta = bytes.length * 8 - CURVE.nBitLength; // truncate to nBitLength leftmost bits - return delta > 0 ? num >> BigInt(delta) : num; - }; - const bits2int_modN = - CURVE.bits2int_modN || - function (bytes: Uint8Array): bigint { - return modN(bits2int(bytes)); // can't use bytesToNumberBE here - }; - // NOTE: pads output with zero as per spec - const ORDER_MASK = ut.bitMask(CURVE.nBitLength); - /** - * Converts to bytes. Checks if num in `[0..ORDER_MASK-1]` e.g.: `[0..2^256-1]`. - */ - function int2octets(num: bigint): Uint8Array { - if (typeof num !== 'bigint') throw new Error('bigint expected'); - if (!(_0n <= num && num < ORDER_MASK)) - throw new Error(`bigint expected < 2^${CURVE.nBitLength}`); - // works with order, can have different size than numToField! - return ut.numberToBytesBE(num, CURVE.nByteLength); - } - - // Steps A, D of RFC6979 3.2 - // Creates RFC6979 seed; converts msg/privKey to numbers. - // Used only in sign, not in verify. - // NOTE: we cannot assume here that msgHash has same amount of bytes as curve order, this will be wrong at least for P521. - // Also it can be bigger for P224 + SHA256 - function prepSig(msgHash: Hex, privateKey: PrivKey, opts = defaultSigOpts) { - if (['recovered', 'canonical'].some((k) => k in opts)) - throw new Error('sign() legacy options not supported'); - const { hash, randomBytes } = CURVE; - let { lowS, prehash, extraEntropy: ent } = opts; // generates low-s sigs by default - if (lowS == null) lowS = true; // RFC6979 3.2: we skip step A, because we already provide hash - msgHash = ensureBytes('msgHash', msgHash); - if (prehash) msgHash = ensureBytes('prehashed msgHash', hash(msgHash)); - - // We can't later call bits2octets, since nested bits2int is broken for curves - // with nBitLength % 8 !== 0. Because of that, we unwrap it here as int2octets call. - // const bits2octets = (bits) => int2octets(bits2int_modN(bits)) - const h1int = bits2int_modN(msgHash); - const d = normPrivateKeyToScalar(privateKey); // validate private key, convert to bigint - const seedArgs = [int2octets(d), int2octets(h1int)]; - // extraEntropy. RFC6979 3.6: additional k' (optional). - if (ent != null) { - // K = HMAC_K(V || 0x00 || int2octets(x) || bits2octets(h1) || k') - const e = ent === true ? randomBytes(Fp.BYTES) : ent; // generate random bytes OR pass as-is - seedArgs.push(ensureBytes('extraEntropy', e)); // check for being bytes - } - const seed = ut.concatBytes(...seedArgs); // Step D of RFC6979 3.2 - const m = h1int; // NOTE: no need to call bits2int second time here, it is inside truncateHash! - // Converts signature params into point w r/s, checks result for validity. - function k2sig(kBytes: Uint8Array): RecoveredSignature | undefined { - // RFC 6979 Section 3.2, step 3: k = bits2int(T) - const k = bits2int(kBytes); // Cannot use fields methods, since it is group element - if (!isWithinCurveOrder(k)) return; // Important: all mod() calls here must be done over N - const ik = invN(k); // k^-1 mod n - const q = Point.BASE.multiply(k).toAffine(); // q = Gk - const r = modN(q.x); // r = q.x mod n - if (r === _0n) return; - // Can use scalar blinding b^-1(bm + bdr) where b ∈ [1,q−1] according to - // https://tches.iacr.org/index.php/TCHES/article/view/7337/6509. We've decided against it: - // a) dependency on CSPRNG b) 15% slowdown c) doesn't really help since bigints are not CT - const s = modN(ik * modN(m + r * d)); // Not using blinding here - if (s === _0n) return; - let recovery = (q.x === r ? 0 : 2) | Number(q.y & _1n); // recovery bit (2 or 3, when q.x > n) - let normS = s; - if (lowS && isBiggerThanHalfOrder(s)) { - normS = normalizeS(s); // if lowS was passed, ensure s is always - recovery ^= 1; // // in the bottom half of N - } - return new Signature(r, normS, recovery) as RecoveredSignature; // use normS, not s - } - return { seed, k2sig }; - } - const defaultSigOpts: SignOpts = { lowS: CURVE.lowS, prehash: false }; - const defaultVerOpts: VerOpts = { lowS: CURVE.lowS, prehash: false }; - - /** - * Signs message hash with a private key. - * ``` - * sign(m, d, k) where - * (x, y) = G × k - * r = x mod n - * s = (m + dr)/k mod n - * ``` - * @param msgHash NOT message. msg needs to be hashed to `msgHash`, or use `prehash`. - * @param privKey private key - * @param opts lowS for non-malleable sigs. extraEntropy for mixing randomness into k. prehash will hash first arg. - * @returns signature with recovery param - */ - function sign(msgHash: Hex, privKey: PrivKey, opts = defaultSigOpts): RecoveredSignature { - const { seed, k2sig } = prepSig(msgHash, privKey, opts); // Steps A, D of RFC6979 3.2. - const C = CURVE; - const drbg = ut.createHmacDrbg(C.hash.outputLen, C.nByteLength, C.hmac); - return drbg(seed, k2sig); // Steps B, C, D, E, F, G - } - - // Enable precomputes. Slows down first publicKey computation by 20ms. - Point.BASE._setWindowSize(8); - // utils.precompute(8, ProjectivePoint.BASE) - - /** - * Verifies a signature against message hash and public key. - * Rejects lowS signatures by default: to override, - * specify option `{lowS: false}`. Implements section 4.1.4 from https://www.secg.org/sec1-v2.pdf: - * - * ``` - * verify(r, s, h, P) where - * U1 = hs^-1 mod n - * U2 = rs^-1 mod n - * R = U1⋅G - U2⋅P - * mod(R.x, n) == r - * ``` - */ - function verify( - signature: Hex | SignatureLike, - msgHash: Hex, - publicKey: Hex, - opts = defaultVerOpts - ): boolean { - const sg = signature; - msgHash = ensureBytes('msgHash', msgHash); - publicKey = ensureBytes('publicKey', publicKey); - if ('strict' in opts) throw new Error('options.strict was renamed to lowS'); - const { lowS, prehash } = opts; - - let _sig: Signature | undefined = undefined; - let P: ProjPointType; - try { - if (typeof sg === 'string' || sg instanceof Uint8Array) { - // Signature can be represented in 2 ways: compact (2*nByteLength) & DER (variable-length). - // Since DER can also be 2*nByteLength bytes, we check for it first. - try { - _sig = Signature.fromDER(sg); - } catch (derError) { - if (!(derError instanceof DER.Err)) throw derError; - _sig = Signature.fromCompact(sg); - } - } else if (typeof sg === 'object' && typeof sg.r === 'bigint' && typeof sg.s === 'bigint') { - const { r, s } = sg; - _sig = new Signature(r, s); - } else { - throw new Error('PARSE'); - } - P = Point.fromHex(publicKey); - } catch (error) { - if ((error as Error).message === 'PARSE') - throw new Error(`signature must be Signature instance, Uint8Array or hex string`); - return false; - } - if (lowS && _sig.hasHighS()) return false; - if (prehash) msgHash = CURVE.hash(msgHash); - const { r, s } = _sig; - const h = bits2int_modN(msgHash); // Cannot use fields methods, since it is group element - const is = invN(s); // s^-1 - const u1 = modN(h * is); // u1 = hs^-1 mod n - const u2 = modN(r * is); // u2 = rs^-1 mod n - const R = Point.BASE.multiplyAndAddUnsafe(P, u1, u2)?.toAffine(); // R = u1⋅G + u2⋅P - if (!R) return false; - const v = modN(R.x); - return v === r; - } - return { - CURVE, - getPublicKey, - getSharedSecret, - sign, - verify, - ProjectivePoint: Point, - Signature, - utils, - }; -} - -/** - * Implementation of the Shallue and van de Woestijne method for any weierstrass curve. - * TODO: check if there is a way to merge this with uvRatio in Edwards; move to modular. - * b = True and y = sqrt(u / v) if (u / v) is square in F, and - * b = False and y = sqrt(Z * (u / v)) otherwise. - * @param Fp - * @param Z - * @returns - */ -export function SWUFpSqrtRatio(Fp: mod.IField, Z: T) { - // Generic implementation - const q = Fp.ORDER; - let l = _0n; - for (let o = q - _1n; o % _2n === _0n; o /= _2n) l += _1n; - const c1 = l; // 1. c1, the largest integer such that 2^c1 divides q - 1. - // We need 2n ** c1 and 2n ** (c1-1). We can't use **; but we can use <<. - // 2n ** c1 == 2n << (c1-1) - const _2n_pow_c1_1 = _2n << (c1 - _1n - _1n); - const _2n_pow_c1 = _2n_pow_c1_1 * _2n; - const c2 = (q - _1n) / _2n_pow_c1; // 2. c2 = (q - 1) / (2^c1) # Integer arithmetic - const c3 = (c2 - _1n) / _2n; // 3. c3 = (c2 - 1) / 2 # Integer arithmetic - const c4 = _2n_pow_c1 - _1n; // 4. c4 = 2^c1 - 1 # Integer arithmetic - const c5 = _2n_pow_c1_1; // 5. c5 = 2^(c1 - 1) # Integer arithmetic - const c6 = Fp.pow(Z, c2); // 6. c6 = Z^c2 - const c7 = Fp.pow(Z, (c2 + _1n) / _2n); // 7. c7 = Z^((c2 + 1) / 2) - let sqrtRatio = (u: T, v: T): { isValid: boolean; value: T } => { - let tv1 = c6; // 1. tv1 = c6 - let tv2 = Fp.pow(v, c4); // 2. tv2 = v^c4 - let tv3 = Fp.sqr(tv2); // 3. tv3 = tv2^2 - tv3 = Fp.mul(tv3, v); // 4. tv3 = tv3 * v - let tv5 = Fp.mul(u, tv3); // 5. tv5 = u * tv3 - tv5 = Fp.pow(tv5, c3); // 6. tv5 = tv5^c3 - tv5 = Fp.mul(tv5, tv2); // 7. tv5 = tv5 * tv2 - tv2 = Fp.mul(tv5, v); // 8. tv2 = tv5 * v - tv3 = Fp.mul(tv5, u); // 9. tv3 = tv5 * u - let tv4 = Fp.mul(tv3, tv2); // 10. tv4 = tv3 * tv2 - tv5 = Fp.pow(tv4, c5); // 11. tv5 = tv4^c5 - let isQR = Fp.eql(tv5, Fp.ONE); // 12. isQR = tv5 == 1 - tv2 = Fp.mul(tv3, c7); // 13. tv2 = tv3 * c7 - tv5 = Fp.mul(tv4, tv1); // 14. tv5 = tv4 * tv1 - tv3 = Fp.cmov(tv2, tv3, isQR); // 15. tv3 = CMOV(tv2, tv3, isQR) - tv4 = Fp.cmov(tv5, tv4, isQR); // 16. tv4 = CMOV(tv5, tv4, isQR) - // 17. for i in (c1, c1 - 1, ..., 2): - for (let i = c1; i > _1n; i--) { - let tv5 = i - _2n; // 18. tv5 = i - 2 - tv5 = _2n << (tv5 - _1n); // 19. tv5 = 2^tv5 - let tvv5 = Fp.pow(tv4, tv5); // 20. tv5 = tv4^tv5 - const e1 = Fp.eql(tvv5, Fp.ONE); // 21. e1 = tv5 == 1 - tv2 = Fp.mul(tv3, tv1); // 22. tv2 = tv3 * tv1 - tv1 = Fp.mul(tv1, tv1); // 23. tv1 = tv1 * tv1 - tvv5 = Fp.mul(tv4, tv1); // 24. tv5 = tv4 * tv1 - tv3 = Fp.cmov(tv2, tv3, e1); // 25. tv3 = CMOV(tv2, tv3, e1) - tv4 = Fp.cmov(tvv5, tv4, e1); // 26. tv4 = CMOV(tv5, tv4, e1) - } - return { isValid: isQR, value: tv3 }; - }; - if (Fp.ORDER % _4n === _3n) { - // sqrt_ratio_3mod4(u, v) - const c1 = (Fp.ORDER - _3n) / _4n; // 1. c1 = (q - 3) / 4 # Integer arithmetic - const c2 = Fp.sqrt(Fp.neg(Z)); // 2. c2 = sqrt(-Z) - sqrtRatio = (u: T, v: T) => { - let tv1 = Fp.sqr(v); // 1. tv1 = v^2 - const tv2 = Fp.mul(u, v); // 2. tv2 = u * v - tv1 = Fp.mul(tv1, tv2); // 3. tv1 = tv1 * tv2 - let y1 = Fp.pow(tv1, c1); // 4. y1 = tv1^c1 - y1 = Fp.mul(y1, tv2); // 5. y1 = y1 * tv2 - const y2 = Fp.mul(y1, c2); // 6. y2 = y1 * c2 - const tv3 = Fp.mul(Fp.sqr(y1), v); // 7. tv3 = y1^2; 8. tv3 = tv3 * v - const isQR = Fp.eql(tv3, u); // 9. isQR = tv3 == u - let y = Fp.cmov(y2, y1, isQR); // 10. y = CMOV(y2, y1, isQR) - return { isValid: isQR, value: y }; // 11. return (isQR, y) isQR ? y : y*c2 - }; - } - // No curves uses that - // if (Fp.ORDER % _8n === _5n) // sqrt_ratio_5mod8 - return sqrtRatio; -} -/** - * Simplified Shallue-van de Woestijne-Ulas Method - * https://www.rfc-editor.org/rfc/rfc9380#section-6.6.2 - */ -export function mapToCurveSimpleSWU( - Fp: mod.IField, - opts: { - A: T; - B: T; - Z: T; - } -) { - mod.validateField(Fp); - if (!Fp.isValid(opts.A) || !Fp.isValid(opts.B) || !Fp.isValid(opts.Z)) - throw new Error('mapToCurveSimpleSWU: invalid opts'); - const sqrtRatio = SWUFpSqrtRatio(Fp, opts.Z); - if (!Fp.isOdd) throw new Error('Fp.isOdd is not implemented!'); - // Input: u, an element of F. - // Output: (x, y), a point on E. - return (u: T): { x: T; y: T } => { - // prettier-ignore - let tv1, tv2, tv3, tv4, tv5, tv6, x, y; - tv1 = Fp.sqr(u); // 1. tv1 = u^2 - tv1 = Fp.mul(tv1, opts.Z); // 2. tv1 = Z * tv1 - tv2 = Fp.sqr(tv1); // 3. tv2 = tv1^2 - tv2 = Fp.add(tv2, tv1); // 4. tv2 = tv2 + tv1 - tv3 = Fp.add(tv2, Fp.ONE); // 5. tv3 = tv2 + 1 - tv3 = Fp.mul(tv3, opts.B); // 6. tv3 = B * tv3 - tv4 = Fp.cmov(opts.Z, Fp.neg(tv2), !Fp.eql(tv2, Fp.ZERO)); // 7. tv4 = CMOV(Z, -tv2, tv2 != 0) - tv4 = Fp.mul(tv4, opts.A); // 8. tv4 = A * tv4 - tv2 = Fp.sqr(tv3); // 9. tv2 = tv3^2 - tv6 = Fp.sqr(tv4); // 10. tv6 = tv4^2 - tv5 = Fp.mul(tv6, opts.A); // 11. tv5 = A * tv6 - tv2 = Fp.add(tv2, tv5); // 12. tv2 = tv2 + tv5 - tv2 = Fp.mul(tv2, tv3); // 13. tv2 = tv2 * tv3 - tv6 = Fp.mul(tv6, tv4); // 14. tv6 = tv6 * tv4 - tv5 = Fp.mul(tv6, opts.B); // 15. tv5 = B * tv6 - tv2 = Fp.add(tv2, tv5); // 16. tv2 = tv2 + tv5 - x = Fp.mul(tv1, tv3); // 17. x = tv1 * tv3 - const { isValid, value } = sqrtRatio(tv2, tv6); // 18. (is_gx1_square, y1) = sqrt_ratio(tv2, tv6) - y = Fp.mul(tv1, u); // 19. y = tv1 * u -> Z * u^3 * y1 - y = Fp.mul(y, value); // 20. y = y * y1 - x = Fp.cmov(x, tv3, isValid); // 21. x = CMOV(x, tv3, is_gx1_square) - y = Fp.cmov(y, value, isValid); // 22. y = CMOV(y, y1, is_gx1_square) - const e1 = Fp.isOdd!(u) === Fp.isOdd!(y); // 23. e1 = sgn0(u) == sgn0(y) - y = Fp.cmov(Fp.neg(y), y, e1); // 24. y = CMOV(-y, y, e1) - x = Fp.div(x, tv4); // 25. x = x / tv4 - return { x, y }; - }; -} diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/bls12-381.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/bls12-381.ts deleted file mode 100644 index a98d72bd..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/bls12-381.ts +++ /dev/null @@ -1,1350 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ - -// bls12-381 pairing-friendly Barreto-Lynn-Scott elliptic curve construction allows to: -// - Construct zk-SNARKs at the 128-bit security -// - Use threshold signatures, which allows a user to sign lots of messages with one signature and -// verify them swiftly in a batch, using Boneh-Lynn-Shacham signature scheme. -// -// The library uses G1 for public keys and G2 for signatures. Support for G1 signatures is planned. -// Compatible with Algorand, Chia, Dfinity, Ethereum, FIL, Zcash. Matches specs -// [pairing-curves-11](https://tools.ietf.org/html/draft-irtf-cfrg-pairing-friendly-curves-11), -// [bls-sigs-04](https:/cfrg-hash-to/tools.ietf.org/html/draft-irtf-cfrg-bls-signature-04), -// [hash-to-curve-12](https://tools.ietf.org/html/draft-irtf--curve-12). -// -// ### Summary -// 1. BLS Relies on Bilinear Pairing (expensive) -// 2. Private Keys: 32 bytes -// 3. Public Keys: 48 bytes: 381 bit affine x coordinate, encoded into 48 big-endian bytes. -// 4. Signatures: 96 bytes: two 381 bit integers (affine x coordinate), encoded into two 48 big-endian byte arrays. -// - The signature is a point on the G2 subgroup, which is defined over a finite field -// with elements twice as big as the G1 curve (G2 is over Fp2 rather than Fp. Fp2 is analogous to the complex numbers). -// 5. The 12 stands for the Embedding degree. -// -// ### Formulas -// - `P = pk x G` - public keys -// - `S = pk x H(m)` - signing -// - `e(P, H(m)) == e(G, S)` - verification using pairings -// - `e(G, S) = e(G, SUM(n)(Si)) = MUL(n)(e(G, Si))` - signature aggregation -// Filecoin uses little endian byte arrays for private keys - -// so ensure to reverse byte order if you'll use it with FIL. -import { sha256 } from '@noble/hashes/sha256'; -import { randomBytes } from '@noble/hashes/utils'; -import { bls, CurveFn } from './abstract/bls.js'; -import * as mod from './abstract/modular.js'; -import { - concatBytes as concatB, - ensureBytes, - numberToBytesBE, - bytesToNumberBE, - bitLen, - bitSet, - bitGet, - Hex, - bitMask, - bytesToHex, -} from './abstract/utils.js'; -// Types -import { - ProjPointType, - ProjConstructor, - mapToCurveSimpleSWU, - AffinePoint, -} from './abstract/weierstrass.js'; -import { isogenyMap } from './abstract/hash-to-curve.js'; - -// Be friendly to bad ECMAScript parsers by not using bigint literals -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = BigInt(4); -// prettier-ignore -const _8n = BigInt(8), _16n = BigInt(16); - -// CURVE FIELDS -// Finite field over p. -const Fp_raw = BigInt( - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab' -); -const Fp = mod.Field(Fp_raw); -type Fp = bigint; -// Finite field over r. -// This particular field is not used anywhere in bls12-381, but it is still useful. -const Fr = mod.Field(BigInt('0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001')); - -// Fp₂ over complex plane -type BigintTuple = [bigint, bigint]; -type Fp2 = { c0: bigint; c1: bigint }; -const Fp2Add = ({ c0, c1 }: Fp2, { c0: r0, c1: r1 }: Fp2) => ({ - c0: Fp.add(c0, r0), - c1: Fp.add(c1, r1), -}); -const Fp2Subtract = ({ c0, c1 }: Fp2, { c0: r0, c1: r1 }: Fp2) => ({ - c0: Fp.sub(c0, r0), - c1: Fp.sub(c1, r1), -}); -const Fp2Multiply = ({ c0, c1 }: Fp2, rhs: Fp2) => { - if (typeof rhs === 'bigint') return { c0: Fp.mul(c0, rhs), c1: Fp.mul(c1, rhs) }; - // (a+bi)(c+di) = (ac−bd) + (ad+bc)i - const { c0: r0, c1: r1 } = rhs; - let t1 = Fp.mul(c0, r0); // c0 * o0 - let t2 = Fp.mul(c1, r1); // c1 * o1 - // (T1 - T2) + ((c0 + c1) * (r0 + r1) - (T1 + T2))*i - const o0 = Fp.sub(t1, t2); - const o1 = Fp.sub(Fp.mul(Fp.add(c0, c1), Fp.add(r0, r1)), Fp.add(t1, t2)); - return { c0: o0, c1: o1 }; -}; -const Fp2Square = ({ c0, c1 }: Fp2) => { - const a = Fp.add(c0, c1); - const b = Fp.sub(c0, c1); - const c = Fp.add(c0, c0); - return { c0: Fp.mul(a, b), c1: Fp.mul(c, c1) }; -}; -type Fp2Utils = { - fromBigTuple: (tuple: BigintTuple | bigint[]) => Fp2; - reim: (num: Fp2) => { re: bigint; im: bigint }; - mulByNonresidue: (num: Fp2) => Fp2; - multiplyByB: (num: Fp2) => Fp2; - frobeniusMap(num: Fp2, power: number): Fp2; -}; -// G2 is the order-q subgroup of E2(Fp²) : y² = x³+4(1+√−1), -// where Fp2 is Fp[√−1]/(x2+1). #E2(Fp2 ) = h2q, where -// G² - 1 -// h2q -// NOTE: ORDER was wrong! -const FP2_ORDER = Fp_raw * Fp_raw; - -const Fp2: mod.IField & Fp2Utils = { - ORDER: FP2_ORDER, - BITS: bitLen(FP2_ORDER), - BYTES: Math.ceil(bitLen(FP2_ORDER) / 8), - MASK: bitMask(bitLen(FP2_ORDER)), - ZERO: { c0: Fp.ZERO, c1: Fp.ZERO }, - ONE: { c0: Fp.ONE, c1: Fp.ZERO }, - create: (num) => num, - isValid: ({ c0, c1 }) => typeof c0 === 'bigint' && typeof c1 === 'bigint', - is0: ({ c0, c1 }) => Fp.is0(c0) && Fp.is0(c1), - eql: ({ c0, c1 }: Fp2, { c0: r0, c1: r1 }: Fp2) => Fp.eql(c0, r0) && Fp.eql(c1, r1), - neg: ({ c0, c1 }) => ({ c0: Fp.neg(c0), c1: Fp.neg(c1) }), - pow: (num, power) => mod.FpPow(Fp2, num, power), - invertBatch: (nums) => mod.FpInvertBatch(Fp2, nums), - // Normalized - add: Fp2Add, - sub: Fp2Subtract, - mul: Fp2Multiply, - sqr: Fp2Square, - // NonNormalized stuff - addN: Fp2Add, - subN: Fp2Subtract, - mulN: Fp2Multiply, - sqrN: Fp2Square, - // Why inversion for bigint inside Fp instead of Fp2? it is even used in that context? - div: (lhs, rhs) => Fp2.mul(lhs, typeof rhs === 'bigint' ? Fp.inv(Fp.create(rhs)) : Fp2.inv(rhs)), - inv: ({ c0: a, c1: b }) => { - // We wish to find the multiplicative inverse of a nonzero - // element a + bu in Fp2. We leverage an identity - // - // (a + bu)(a - bu) = a² + b² - // - // which holds because u² = -1. This can be rewritten as - // - // (a + bu)(a - bu)/(a² + b²) = 1 - // - // because a² + b² = 0 has no nonzero solutions for (a, b). - // This gives that (a - bu)/(a² + b²) is the inverse - // of (a + bu). Importantly, this can be computing using - // only a single inversion in Fp. - const factor = Fp.inv(Fp.create(a * a + b * b)); - return { c0: Fp.mul(factor, Fp.create(a)), c1: Fp.mul(factor, Fp.create(-b)) }; - }, - sqrt: (num) => { - if (Fp2.eql(num, Fp2.ZERO)) return Fp2.ZERO; // Algo doesn't handles this case - // TODO: Optimize this line. It's extremely slow. - // Speeding this up would boost aggregateSignatures. - // https://eprint.iacr.org/2012/685.pdf applicable? - // https://github.com/zkcrypto/bls12_381/blob/080eaa74ec0e394377caa1ba302c8c121df08b07/src/fp2.rs#L250 - // https://github.com/supranational/blst/blob/aae0c7d70b799ac269ff5edf29d8191dbd357876/src/exp2.c#L1 - // Inspired by https://github.com/dalek-cryptography/curve25519-dalek/blob/17698df9d4c834204f83a3574143abacb4fc81a5/src/field.rs#L99 - const candidateSqrt = Fp2.pow(num, (Fp2.ORDER + _8n) / _16n); - const check = Fp2.div(Fp2.sqr(candidateSqrt), num); // candidateSqrt.square().div(this); - const R = FP2_ROOTS_OF_UNITY; - const divisor = [R[0], R[2], R[4], R[6]].find((r) => Fp2.eql(r, check)); - if (!divisor) throw new Error('No root'); - const index = R.indexOf(divisor); - const root = R[index / 2]; - if (!root) throw new Error('Invalid root'); - const x1 = Fp2.div(candidateSqrt, root); - const x2 = Fp2.neg(x1); - const { re: re1, im: im1 } = Fp2.reim(x1); - const { re: re2, im: im2 } = Fp2.reim(x2); - if (im1 > im2 || (im1 === im2 && re1 > re2)) return x1; - return x2; - }, - // Same as sgn0_m_eq_2 in RFC 9380 - isOdd: (x: Fp2) => { - const { re: x0, im: x1 } = Fp2.reim(x); - const sign_0 = x0 % _2n; - const zero_0 = x0 === _0n; - const sign_1 = x1 % _2n; - return BigInt(sign_0 || (zero_0 && sign_1)) == _1n; - }, - // Bytes util - fromBytes(b: Uint8Array): Fp2 { - if (b.length !== Fp2.BYTES) throw new Error(`fromBytes wrong length=${b.length}`); - return { c0: Fp.fromBytes(b.subarray(0, Fp.BYTES)), c1: Fp.fromBytes(b.subarray(Fp.BYTES)) }; - }, - toBytes: ({ c0, c1 }) => concatB(Fp.toBytes(c0), Fp.toBytes(c1)), - cmov: ({ c0, c1 }, { c0: r0, c1: r1 }, c) => ({ - c0: Fp.cmov(c0, r0, c), - c1: Fp.cmov(c1, r1, c), - }), - // Specific utils - // toString() { - // return `Fp2(${this.c0} + ${this.c1}×i)`; - // } - reim: ({ c0, c1 }) => ({ re: c0, im: c1 }), - // multiply by u + 1 - mulByNonresidue: ({ c0, c1 }) => ({ c0: Fp.sub(c0, c1), c1: Fp.add(c0, c1) }), - multiplyByB: ({ c0, c1 }) => { - let t0 = Fp.mul(c0, _4n); // 4 * c0 - let t1 = Fp.mul(c1, _4n); // 4 * c1 - // (T0-T1) + (T0+T1)*i - return { c0: Fp.sub(t0, t1), c1: Fp.add(t0, t1) }; - }, - fromBigTuple: (tuple: BigintTuple | bigint[]) => { - if (tuple.length !== 2) throw new Error('Invalid tuple'); - const fps = tuple.map((n) => Fp.create(n)) as [Fp, Fp]; - return { c0: fps[0], c1: fps[1] }; - }, - frobeniusMap: ({ c0, c1 }, power: number): Fp2 => ({ - c0, - c1: Fp.mul(c1, FP2_FROBENIUS_COEFFICIENTS[power % 2]), - }), -}; -// Finite extension field over irreducible polynominal. -// Fp(u) / (u² - β) where β = -1 -const FP2_FROBENIUS_COEFFICIENTS = [ - BigInt('0x1'), - BigInt( - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaaa' - ), -].map((item) => Fp.create(item)); - -// For Fp2 roots of unity. -const rv1 = BigInt( - '0x6af0e0437ff400b6831e36d6bd17ffe48395dabc2d3435e77f76e17009241c5ee67992f72ec05f4c81084fbede3cc09' -); -// const ev1 = -// BigInt('0x699be3b8c6870965e5bf892ad5d2cc7b0e85a117402dfd83b7f4a947e02d978498255a2aaec0ac627b5afbdf1bf1c90'); -// const ev2 = -// BigInt('0x8157cd83046453f5dd0972b6e3949e4288020b5b8a9cc99ca07e27089a2ce2436d965026adad3ef7baba37f2183e9b5'); -// const ev3 = -// BigInt('0xab1c2ffdd6c253ca155231eb3e71ba044fd562f6f72bc5bad5ec46a0b7a3b0247cf08ce6c6317f40edbc653a72dee17'); -// const ev4 = -// BigInt('0xaa404866706722864480885d68ad0ccac1967c7544b447873cc37e0181271e006df72162a3d3e0287bf597fbf7f8fc1'); - -// Eighth roots of unity, used for computing square roots in Fp2. -// To verify or re-calculate: -// Array(8).fill(new Fp2([1n, 1n])).map((fp2, k) => fp2.pow(Fp2.ORDER * BigInt(k) / 8n)) -const FP2_ROOTS_OF_UNITY = [ - [_1n, _0n], - [rv1, -rv1], - [_0n, _1n], - [rv1, rv1], - [-_1n, _0n], - [-rv1, rv1], - [_0n, -_1n], - [-rv1, -rv1], -].map((pair) => Fp2.fromBigTuple(pair)); -// eta values, used for computing sqrt(g(X1(t))) -// const FP2_ETAs = [ -// [ev1, ev2], -// [-ev2, ev1], -// [ev3, ev4], -// [-ev4, ev3], -// ].map((pair) => Fp2.fromBigTuple(pair)); - -// Finite extension field over irreducible polynominal. -// Fp2(v) / (v³ - ξ) where ξ = u + 1 -type BigintSix = [bigint, bigint, bigint, bigint, bigint, bigint]; -type Fp6 = { c0: Fp2; c1: Fp2; c2: Fp2 }; -const Fp6Add = ({ c0, c1, c2 }: Fp6, { c0: r0, c1: r1, c2: r2 }: Fp6) => ({ - c0: Fp2.add(c0, r0), - c1: Fp2.add(c1, r1), - c2: Fp2.add(c2, r2), -}); -const Fp6Subtract = ({ c0, c1, c2 }: Fp6, { c0: r0, c1: r1, c2: r2 }: Fp6) => ({ - c0: Fp2.sub(c0, r0), - c1: Fp2.sub(c1, r1), - c2: Fp2.sub(c2, r2), -}); -const Fp6Multiply = ({ c0, c1, c2 }: Fp6, rhs: Fp6 | bigint) => { - if (typeof rhs === 'bigint') { - return { - c0: Fp2.mul(c0, rhs), - c1: Fp2.mul(c1, rhs), - c2: Fp2.mul(c2, rhs), - }; - } - const { c0: r0, c1: r1, c2: r2 } = rhs; - const t0 = Fp2.mul(c0, r0); // c0 * o0 - const t1 = Fp2.mul(c1, r1); // c1 * o1 - const t2 = Fp2.mul(c2, r2); // c2 * o2 - return { - // t0 + (c1 + c2) * (r1 * r2) - (T1 + T2) * (u + 1) - c0: Fp2.add( - t0, - Fp2.mulByNonresidue(Fp2.sub(Fp2.mul(Fp2.add(c1, c2), Fp2.add(r1, r2)), Fp2.add(t1, t2))) - ), - // (c0 + c1) * (r0 + r1) - (T0 + T1) + T2 * (u + 1) - c1: Fp2.add( - Fp2.sub(Fp2.mul(Fp2.add(c0, c1), Fp2.add(r0, r1)), Fp2.add(t0, t1)), - Fp2.mulByNonresidue(t2) - ), - // T1 + (c0 + c2) * (r0 + r2) - T0 + T2 - c2: Fp2.sub(Fp2.add(t1, Fp2.mul(Fp2.add(c0, c2), Fp2.add(r0, r2))), Fp2.add(t0, t2)), - }; -}; -const Fp6Square = ({ c0, c1, c2 }: Fp6) => { - let t0 = Fp2.sqr(c0); // c0² - let t1 = Fp2.mul(Fp2.mul(c0, c1), _2n); // 2 * c0 * c1 - let t3 = Fp2.mul(Fp2.mul(c1, c2), _2n); // 2 * c1 * c2 - let t4 = Fp2.sqr(c2); // c2² - return { - c0: Fp2.add(Fp2.mulByNonresidue(t3), t0), // T3 * (u + 1) + T0 - c1: Fp2.add(Fp2.mulByNonresidue(t4), t1), // T4 * (u + 1) + T1 - // T1 + (c0 - c1 + c2)² + T3 - T0 - T4 - c2: Fp2.sub(Fp2.sub(Fp2.add(Fp2.add(t1, Fp2.sqr(Fp2.add(Fp2.sub(c0, c1), c2))), t3), t0), t4), - }; -}; -type Fp6Utils = { - fromBigSix: (tuple: BigintSix) => Fp6; - mulByNonresidue: (num: Fp6) => Fp6; - frobeniusMap(num: Fp6, power: number): Fp6; - multiplyBy1(num: Fp6, b1: Fp2): Fp6; - multiplyBy01(num: Fp6, b0: Fp2, b1: Fp2): Fp6; - multiplyByFp2(lhs: Fp6, rhs: Fp2): Fp6; -}; - -const Fp6: mod.IField & Fp6Utils = { - ORDER: Fp2.ORDER, // TODO: unused, but need to verify - BITS: 3 * Fp2.BITS, - BYTES: 3 * Fp2.BYTES, - MASK: bitMask(3 * Fp2.BITS), - ZERO: { c0: Fp2.ZERO, c1: Fp2.ZERO, c2: Fp2.ZERO }, - ONE: { c0: Fp2.ONE, c1: Fp2.ZERO, c2: Fp2.ZERO }, - create: (num) => num, - isValid: ({ c0, c1, c2 }) => Fp2.isValid(c0) && Fp2.isValid(c1) && Fp2.isValid(c2), - is0: ({ c0, c1, c2 }) => Fp2.is0(c0) && Fp2.is0(c1) && Fp2.is0(c2), - neg: ({ c0, c1, c2 }) => ({ c0: Fp2.neg(c0), c1: Fp2.neg(c1), c2: Fp2.neg(c2) }), - eql: ({ c0, c1, c2 }, { c0: r0, c1: r1, c2: r2 }) => - Fp2.eql(c0, r0) && Fp2.eql(c1, r1) && Fp2.eql(c2, r2), - sqrt: () => { - throw new Error('Not implemented'); - }, - // Do we need division by bigint at all? Should be done via order: - div: (lhs, rhs) => Fp6.mul(lhs, typeof rhs === 'bigint' ? Fp.inv(Fp.create(rhs)) : Fp6.inv(rhs)), - pow: (num, power) => mod.FpPow(Fp6, num, power), - invertBatch: (nums) => mod.FpInvertBatch(Fp6, nums), - // Normalized - add: Fp6Add, - sub: Fp6Subtract, - mul: Fp6Multiply, - sqr: Fp6Square, - // NonNormalized stuff - addN: Fp6Add, - subN: Fp6Subtract, - mulN: Fp6Multiply, - sqrN: Fp6Square, - - inv: ({ c0, c1, c2 }) => { - let t0 = Fp2.sub(Fp2.sqr(c0), Fp2.mulByNonresidue(Fp2.mul(c2, c1))); // c0² - c2 * c1 * (u + 1) - let t1 = Fp2.sub(Fp2.mulByNonresidue(Fp2.sqr(c2)), Fp2.mul(c0, c1)); // c2² * (u + 1) - c0 * c1 - let t2 = Fp2.sub(Fp2.sqr(c1), Fp2.mul(c0, c2)); // c1² - c0 * c2 - // 1/(((c2 * T1 + c1 * T2) * v) + c0 * T0) - let t4 = Fp2.inv( - Fp2.add(Fp2.mulByNonresidue(Fp2.add(Fp2.mul(c2, t1), Fp2.mul(c1, t2))), Fp2.mul(c0, t0)) - ); - return { c0: Fp2.mul(t4, t0), c1: Fp2.mul(t4, t1), c2: Fp2.mul(t4, t2) }; - }, - // Bytes utils - fromBytes: (b: Uint8Array): Fp6 => { - if (b.length !== Fp6.BYTES) throw new Error(`fromBytes wrong length=${b.length}`); - return { - c0: Fp2.fromBytes(b.subarray(0, Fp2.BYTES)), - c1: Fp2.fromBytes(b.subarray(Fp2.BYTES, 2 * Fp2.BYTES)), - c2: Fp2.fromBytes(b.subarray(2 * Fp2.BYTES)), - }; - }, - toBytes: ({ c0, c1, c2 }): Uint8Array => - concatB(Fp2.toBytes(c0), Fp2.toBytes(c1), Fp2.toBytes(c2)), - cmov: ({ c0, c1, c2 }: Fp6, { c0: r0, c1: r1, c2: r2 }: Fp6, c) => ({ - c0: Fp2.cmov(c0, r0, c), - c1: Fp2.cmov(c1, r1, c), - c2: Fp2.cmov(c2, r2, c), - }), - // Utils - // fromTriple(triple: [Fp2, Fp2, Fp2]) { - // return new Fp6(...triple); - // } - // toString() { - // return `Fp6(${this.c0} + ${this.c1} * v, ${this.c2} * v^2)`; - // } - fromBigSix: (t: BigintSix): Fp6 => { - if (!Array.isArray(t) || t.length !== 6) throw new Error('Invalid Fp6 usage'); - return { - c0: Fp2.fromBigTuple(t.slice(0, 2)), - c1: Fp2.fromBigTuple(t.slice(2, 4)), - c2: Fp2.fromBigTuple(t.slice(4, 6)), - }; - }, - frobeniusMap: ({ c0, c1, c2 }, power: number) => ({ - c0: Fp2.frobeniusMap(c0, power), - c1: Fp2.mul(Fp2.frobeniusMap(c1, power), FP6_FROBENIUS_COEFFICIENTS_1[power % 6]), - c2: Fp2.mul(Fp2.frobeniusMap(c2, power), FP6_FROBENIUS_COEFFICIENTS_2[power % 6]), - }), - mulByNonresidue: ({ c0, c1, c2 }) => ({ c0: Fp2.mulByNonresidue(c2), c1: c0, c2: c1 }), - - // Sparse multiplication - multiplyBy1: ({ c0, c1, c2 }, b1: Fp2): Fp6 => ({ - c0: Fp2.mulByNonresidue(Fp2.mul(c2, b1)), - c1: Fp2.mul(c0, b1), - c2: Fp2.mul(c1, b1), - }), - // Sparse multiplication - multiplyBy01({ c0, c1, c2 }, b0: Fp2, b1: Fp2): Fp6 { - let t0 = Fp2.mul(c0, b0); // c0 * b0 - let t1 = Fp2.mul(c1, b1); // c1 * b1 - return { - // ((c1 + c2) * b1 - T1) * (u + 1) + T0 - c0: Fp2.add(Fp2.mulByNonresidue(Fp2.sub(Fp2.mul(Fp2.add(c1, c2), b1), t1)), t0), - // (b0 + b1) * (c0 + c1) - T0 - T1 - c1: Fp2.sub(Fp2.sub(Fp2.mul(Fp2.add(b0, b1), Fp2.add(c0, c1)), t0), t1), - // (c0 + c2) * b0 - T0 + T1 - c2: Fp2.add(Fp2.sub(Fp2.mul(Fp2.add(c0, c2), b0), t0), t1), - }; - }, - - multiplyByFp2: ({ c0, c1, c2 }, rhs: Fp2): Fp6 => ({ - c0: Fp2.mul(c0, rhs), - c1: Fp2.mul(c1, rhs), - c2: Fp2.mul(c2, rhs), - }), -}; - -const FP6_FROBENIUS_COEFFICIENTS_1 = [ - [BigInt('0x1'), BigInt('0x0')], - [ - BigInt('0x0'), - BigInt( - '0x1a0111ea397fe699ec02408663d4de85aa0d857d89759ad4897d29650fb85f9b409427eb4f49fffd8bfd00000000aaac' - ), - ], - [ - BigInt( - '0x00000000000000005f19672fdf76ce51ba69c6076a0f77eaddb3a93be6f89688de17d813620a00022e01fffffffefffe' - ), - BigInt('0x0'), - ], - [BigInt('0x0'), BigInt('0x1')], - [ - BigInt( - '0x1a0111ea397fe699ec02408663d4de85aa0d857d89759ad4897d29650fb85f9b409427eb4f49fffd8bfd00000000aaac' - ), - BigInt('0x0'), - ], - [ - BigInt('0x0'), - BigInt( - '0x00000000000000005f19672fdf76ce51ba69c6076a0f77eaddb3a93be6f89688de17d813620a00022e01fffffffefffe' - ), - ], -].map((pair) => Fp2.fromBigTuple(pair)); -const FP6_FROBENIUS_COEFFICIENTS_2 = [ - [BigInt('0x1'), BigInt('0x0')], - [ - BigInt( - '0x1a0111ea397fe699ec02408663d4de85aa0d857d89759ad4897d29650fb85f9b409427eb4f49fffd8bfd00000000aaad' - ), - BigInt('0x0'), - ], - [ - BigInt( - '0x1a0111ea397fe699ec02408663d4de85aa0d857d89759ad4897d29650fb85f9b409427eb4f49fffd8bfd00000000aaac' - ), - BigInt('0x0'), - ], - [ - BigInt( - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaaa' - ), - BigInt('0x0'), - ], - [ - BigInt( - '0x00000000000000005f19672fdf76ce51ba69c6076a0f77eaddb3a93be6f89688de17d813620a00022e01fffffffefffe' - ), - BigInt('0x0'), - ], - [ - BigInt( - '0x00000000000000005f19672fdf76ce51ba69c6076a0f77eaddb3a93be6f89688de17d813620a00022e01fffffffeffff' - ), - BigInt('0x0'), - ], -].map((pair) => Fp2.fromBigTuple(pair)); - -// Finite extension field over irreducible polynominal. -// Fp₁₂ = Fp₆² => Fp₂³ -// Fp₆(w) / (w² - γ) where γ = v -type Fp12 = { c0: Fp6; c1: Fp6 }; -// The BLS parameter x for BLS12-381 -const BLS_X = BigInt('0xd201000000010000'); -const BLS_X_LEN = bitLen(BLS_X); - -// prettier-ignore -type BigintTwelve = [ - bigint, bigint, bigint, bigint, bigint, bigint, - bigint, bigint, bigint, bigint, bigint, bigint - ]; -const Fp12Add = ({ c0, c1 }: Fp12, { c0: r0, c1: r1 }: Fp12) => ({ - c0: Fp6.add(c0, r0), - c1: Fp6.add(c1, r1), -}); -const Fp12Subtract = ({ c0, c1 }: Fp12, { c0: r0, c1: r1 }: Fp12) => ({ - c0: Fp6.sub(c0, r0), - c1: Fp6.sub(c1, r1), -}); -const Fp12Multiply = ({ c0, c1 }: Fp12, rhs: Fp12 | bigint) => { - if (typeof rhs === 'bigint') return { c0: Fp6.mul(c0, rhs), c1: Fp6.mul(c1, rhs) }; - let { c0: r0, c1: r1 } = rhs; - let t1 = Fp6.mul(c0, r0); // c0 * r0 - let t2 = Fp6.mul(c1, r1); // c1 * r1 - return { - c0: Fp6.add(t1, Fp6.mulByNonresidue(t2)), // T1 + T2 * v - // (c0 + c1) * (r0 + r1) - (T1 + T2) - c1: Fp6.sub(Fp6.mul(Fp6.add(c0, c1), Fp6.add(r0, r1)), Fp6.add(t1, t2)), - }; -}; -const Fp12Square = ({ c0, c1 }: Fp12) => { - let ab = Fp6.mul(c0, c1); // c0 * c1 - return { - // (c1 * v + c0) * (c0 + c1) - AB - AB * v - c0: Fp6.sub( - Fp6.sub(Fp6.mul(Fp6.add(Fp6.mulByNonresidue(c1), c0), Fp6.add(c0, c1)), ab), - Fp6.mulByNonresidue(ab) - ), - c1: Fp6.add(ab, ab), - }; // AB + AB -}; -function Fp4Square(a: Fp2, b: Fp2): { first: Fp2; second: Fp2 } { - const a2 = Fp2.sqr(a); - const b2 = Fp2.sqr(b); - return { - first: Fp2.add(Fp2.mulByNonresidue(b2), a2), // b² * Nonresidue + a² - second: Fp2.sub(Fp2.sub(Fp2.sqr(Fp2.add(a, b)), a2), b2), // (a + b)² - a² - b² - }; -} -type Fp12Utils = { - fromBigTwelve: (t: BigintTwelve) => Fp12; - frobeniusMap(num: Fp12, power: number): Fp12; - multiplyBy014(num: Fp12, o0: Fp2, o1: Fp2, o4: Fp2): Fp12; - multiplyByFp2(lhs: Fp12, rhs: Fp2): Fp12; - conjugate(num: Fp12): Fp12; - finalExponentiate(num: Fp12): Fp12; - _cyclotomicSquare(num: Fp12): Fp12; - _cyclotomicExp(num: Fp12, n: bigint): Fp12; -}; - -const Fp12: mod.IField & Fp12Utils = { - ORDER: Fp2.ORDER, // TODO: unused, but need to verify - BITS: 2 * Fp2.BITS, - BYTES: 2 * Fp2.BYTES, - MASK: bitMask(2 * Fp2.BITS), - ZERO: { c0: Fp6.ZERO, c1: Fp6.ZERO }, - ONE: { c0: Fp6.ONE, c1: Fp6.ZERO }, - create: (num) => num, - isValid: ({ c0, c1 }) => Fp6.isValid(c0) && Fp6.isValid(c1), - is0: ({ c0, c1 }) => Fp6.is0(c0) && Fp6.is0(c1), - neg: ({ c0, c1 }) => ({ c0: Fp6.neg(c0), c1: Fp6.neg(c1) }), - eql: ({ c0, c1 }, { c0: r0, c1: r1 }) => Fp6.eql(c0, r0) && Fp6.eql(c1, r1), - sqrt: () => { - throw new Error('Not implemented'); - }, - inv: ({ c0, c1 }) => { - let t = Fp6.inv(Fp6.sub(Fp6.sqr(c0), Fp6.mulByNonresidue(Fp6.sqr(c1)))); // 1 / (c0² - c1² * v) - return { c0: Fp6.mul(c0, t), c1: Fp6.neg(Fp6.mul(c1, t)) }; // ((C0 * T) * T) + (-C1 * T) * w - }, - div: (lhs, rhs) => - Fp12.mul(lhs, typeof rhs === 'bigint' ? Fp.inv(Fp.create(rhs)) : Fp12.inv(rhs)), - pow: (num, power) => mod.FpPow(Fp12, num, power), - invertBatch: (nums) => mod.FpInvertBatch(Fp12, nums), - // Normalized - add: Fp12Add, - sub: Fp12Subtract, - mul: Fp12Multiply, - sqr: Fp12Square, - // NonNormalized stuff - addN: Fp12Add, - subN: Fp12Subtract, - mulN: Fp12Multiply, - sqrN: Fp12Square, - - // Bytes utils - fromBytes: (b: Uint8Array): Fp12 => { - if (b.length !== Fp12.BYTES) throw new Error(`fromBytes wrong length=${b.length}`); - return { - c0: Fp6.fromBytes(b.subarray(0, Fp6.BYTES)), - c1: Fp6.fromBytes(b.subarray(Fp6.BYTES)), - }; - }, - toBytes: ({ c0, c1 }): Uint8Array => concatB(Fp6.toBytes(c0), Fp6.toBytes(c1)), - cmov: ({ c0, c1 }, { c0: r0, c1: r1 }, c) => ({ - c0: Fp6.cmov(c0, r0, c), - c1: Fp6.cmov(c1, r1, c), - }), - // Utils - // toString() { - // return `Fp12(${this.c0} + ${this.c1} * w)`; - // }, - // fromTuple(c: [Fp6, Fp6]) { - // return new Fp12(...c); - // } - fromBigTwelve: (t: BigintTwelve): Fp12 => ({ - c0: Fp6.fromBigSix(t.slice(0, 6) as BigintSix), - c1: Fp6.fromBigSix(t.slice(6, 12) as BigintSix), - }), - // Raises to q**i -th power - frobeniusMap(lhs, power: number) { - const r0 = Fp6.frobeniusMap(lhs.c0, power); - const { c0, c1, c2 } = Fp6.frobeniusMap(lhs.c1, power); - const coeff = FP12_FROBENIUS_COEFFICIENTS[power % 12]; - return { - c0: r0, - c1: Fp6.create({ - c0: Fp2.mul(c0, coeff), - c1: Fp2.mul(c1, coeff), - c2: Fp2.mul(c2, coeff), - }), - }; - }, - // Sparse multiplication - multiplyBy014: ({ c0, c1 }, o0: Fp2, o1: Fp2, o4: Fp2) => { - let t0 = Fp6.multiplyBy01(c0, o0, o1); - let t1 = Fp6.multiplyBy1(c1, o4); - return { - c0: Fp6.add(Fp6.mulByNonresidue(t1), t0), // T1 * v + T0 - // (c1 + c0) * [o0, o1+o4] - T0 - T1 - c1: Fp6.sub(Fp6.sub(Fp6.multiplyBy01(Fp6.add(c1, c0), o0, Fp2.add(o1, o4)), t0), t1), - }; - }, - multiplyByFp2: ({ c0, c1 }, rhs: Fp2): Fp12 => ({ - c0: Fp6.multiplyByFp2(c0, rhs), - c1: Fp6.multiplyByFp2(c1, rhs), - }), - conjugate: ({ c0, c1 }): Fp12 => ({ c0, c1: Fp6.neg(c1) }), - - // A cyclotomic group is a subgroup of Fp^n defined by - // GΦₙ(p) = {α ∈ Fpⁿ : α^Φₙ(p) = 1} - // The result of any pairing is in a cyclotomic subgroup - // https://eprint.iacr.org/2009/565.pdf - _cyclotomicSquare: ({ c0, c1 }): Fp12 => { - const { c0: c0c0, c1: c0c1, c2: c0c2 } = c0; - const { c0: c1c0, c1: c1c1, c2: c1c2 } = c1; - const { first: t3, second: t4 } = Fp4Square(c0c0, c1c1); - const { first: t5, second: t6 } = Fp4Square(c1c0, c0c2); - const { first: t7, second: t8 } = Fp4Square(c0c1, c1c2); - let t9 = Fp2.mulByNonresidue(t8); // T8 * (u + 1) - return { - c0: Fp6.create({ - c0: Fp2.add(Fp2.mul(Fp2.sub(t3, c0c0), _2n), t3), // 2 * (T3 - c0c0) + T3 - c1: Fp2.add(Fp2.mul(Fp2.sub(t5, c0c1), _2n), t5), // 2 * (T5 - c0c1) + T5 - c2: Fp2.add(Fp2.mul(Fp2.sub(t7, c0c2), _2n), t7), - }), // 2 * (T7 - c0c2) + T7 - c1: Fp6.create({ - c0: Fp2.add(Fp2.mul(Fp2.add(t9, c1c0), _2n), t9), // 2 * (T9 + c1c0) + T9 - c1: Fp2.add(Fp2.mul(Fp2.add(t4, c1c1), _2n), t4), // 2 * (T4 + c1c1) + T4 - c2: Fp2.add(Fp2.mul(Fp2.add(t6, c1c2), _2n), t6), - }), - }; // 2 * (T6 + c1c2) + T6 - }, - _cyclotomicExp(num, n) { - let z = Fp12.ONE; - for (let i = BLS_X_LEN - 1; i >= 0; i--) { - z = Fp12._cyclotomicSquare(z); - if (bitGet(n, i)) z = Fp12.mul(z, num); - } - return z; - }, - // https://eprint.iacr.org/2010/354.pdf - // https://eprint.iacr.org/2009/565.pdf - finalExponentiate: (num) => { - const x = BLS_X; - // this^(q⁶) / this - const t0 = Fp12.div(Fp12.frobeniusMap(num, 6), num); - // t0^(q²) * t0 - const t1 = Fp12.mul(Fp12.frobeniusMap(t0, 2), t0); - const t2 = Fp12.conjugate(Fp12._cyclotomicExp(t1, x)); - const t3 = Fp12.mul(Fp12.conjugate(Fp12._cyclotomicSquare(t1)), t2); - const t4 = Fp12.conjugate(Fp12._cyclotomicExp(t3, x)); - const t5 = Fp12.conjugate(Fp12._cyclotomicExp(t4, x)); - const t6 = Fp12.mul(Fp12.conjugate(Fp12._cyclotomicExp(t5, x)), Fp12._cyclotomicSquare(t2)); - const t7 = Fp12.conjugate(Fp12._cyclotomicExp(t6, x)); - const t2_t5_pow_q2 = Fp12.frobeniusMap(Fp12.mul(t2, t5), 2); - const t4_t1_pow_q3 = Fp12.frobeniusMap(Fp12.mul(t4, t1), 3); - const t6_t1c_pow_q1 = Fp12.frobeniusMap(Fp12.mul(t6, Fp12.conjugate(t1)), 1); - const t7_t3c_t1 = Fp12.mul(Fp12.mul(t7, Fp12.conjugate(t3)), t1); - // (t2 * t5)^(q²) * (t4 * t1)^(q³) * (t6 * t1.conj)^(q^1) * t7 * t3.conj * t1 - return Fp12.mul(Fp12.mul(Fp12.mul(t2_t5_pow_q2, t4_t1_pow_q3), t6_t1c_pow_q1), t7_t3c_t1); - }, -}; -const FP12_FROBENIUS_COEFFICIENTS = [ - [BigInt('0x1'), BigInt('0x0')], - [ - BigInt( - '0x1904d3bf02bb0667c231beb4202c0d1f0fd603fd3cbd5f4f7b2443d784bab9c4f67ea53d63e7813d8d0775ed92235fb8' - ), - BigInt( - '0x00fc3e2b36c4e03288e9e902231f9fb854a14787b6c7b36fec0c8ec971f63c5f282d5ac14d6c7ec22cf78a126ddc4af3' - ), - ], - [ - BigInt( - '0x00000000000000005f19672fdf76ce51ba69c6076a0f77eaddb3a93be6f89688de17d813620a00022e01fffffffeffff' - ), - BigInt('0x0'), - ], - [ - BigInt( - '0x135203e60180a68ee2e9c448d77a2cd91c3dedd930b1cf60ef396489f61eb45e304466cf3e67fa0af1ee7b04121bdea2' - ), - BigInt( - '0x06af0e0437ff400b6831e36d6bd17ffe48395dabc2d3435e77f76e17009241c5ee67992f72ec05f4c81084fbede3cc09' - ), - ], - [ - BigInt( - '0x00000000000000005f19672fdf76ce51ba69c6076a0f77eaddb3a93be6f89688de17d813620a00022e01fffffffefffe' - ), - BigInt('0x0'), - ], - [ - BigInt( - '0x144e4211384586c16bd3ad4afa99cc9170df3560e77982d0db45f3536814f0bd5871c1908bd478cd1ee605167ff82995' - ), - BigInt( - '0x05b2cfd9013a5fd8df47fa6b48b1e045f39816240c0b8fee8beadf4d8e9c0566c63a3e6e257f87329b18fae980078116' - ), - ], - [ - BigInt( - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaaa' - ), - BigInt('0x0'), - ], - [ - BigInt( - '0x00fc3e2b36c4e03288e9e902231f9fb854a14787b6c7b36fec0c8ec971f63c5f282d5ac14d6c7ec22cf78a126ddc4af3' - ), - BigInt( - '0x1904d3bf02bb0667c231beb4202c0d1f0fd603fd3cbd5f4f7b2443d784bab9c4f67ea53d63e7813d8d0775ed92235fb8' - ), - ], - [ - BigInt( - '0x1a0111ea397fe699ec02408663d4de85aa0d857d89759ad4897d29650fb85f9b409427eb4f49fffd8bfd00000000aaac' - ), - BigInt('0x0'), - ], - [ - BigInt( - '0x06af0e0437ff400b6831e36d6bd17ffe48395dabc2d3435e77f76e17009241c5ee67992f72ec05f4c81084fbede3cc09' - ), - BigInt( - '0x135203e60180a68ee2e9c448d77a2cd91c3dedd930b1cf60ef396489f61eb45e304466cf3e67fa0af1ee7b04121bdea2' - ), - ], - [ - BigInt( - '0x1a0111ea397fe699ec02408663d4de85aa0d857d89759ad4897d29650fb85f9b409427eb4f49fffd8bfd00000000aaad' - ), - BigInt('0x0'), - ], - [ - BigInt( - '0x05b2cfd9013a5fd8df47fa6b48b1e045f39816240c0b8fee8beadf4d8e9c0566c63a3e6e257f87329b18fae980078116' - ), - BigInt( - '0x144e4211384586c16bd3ad4afa99cc9170df3560e77982d0db45f3536814f0bd5871c1908bd478cd1ee605167ff82995' - ), - ], -].map((n) => Fp2.fromBigTuple(n)); -// END OF CURVE FIELDS - -// HashToCurve - -// 3-isogeny map from E' to E https://www.rfc-editor.org/rfc/rfc9380#appendix-E.3 -const isogenyMapG2 = isogenyMap( - Fp2, - [ - // xNum - [ - [ - '0x5c759507e8e333ebb5b7a9a47d7ed8532c52d39fd3a042a88b58423c50ae15d5c2638e343d9c71c6238aaaaaaaa97d6', - '0x5c759507e8e333ebb5b7a9a47d7ed8532c52d39fd3a042a88b58423c50ae15d5c2638e343d9c71c6238aaaaaaaa97d6', - ], - [ - '0x0', - '0x11560bf17baa99bc32126fced787c88f984f87adf7ae0c7f9a208c6b4f20a4181472aaa9cb8d555526a9ffffffffc71a', - ], - [ - '0x11560bf17baa99bc32126fced787c88f984f87adf7ae0c7f9a208c6b4f20a4181472aaa9cb8d555526a9ffffffffc71e', - '0x8ab05f8bdd54cde190937e76bc3e447cc27c3d6fbd7063fcd104635a790520c0a395554e5c6aaaa9354ffffffffe38d', - ], - [ - '0x171d6541fa38ccfaed6dea691f5fb614cb14b4e7f4e810aa22d6108f142b85757098e38d0f671c7188e2aaaaaaaa5ed1', - '0x0', - ], - ], - // xDen - [ - [ - '0x0', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaa63', - ], - [ - '0xc', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaa9f', - ], - ['0x1', '0x0'], // LAST 1 - ], - // yNum - [ - [ - '0x1530477c7ab4113b59a4c18b076d11930f7da5d4a07f649bf54439d87d27e500fc8c25ebf8c92f6812cfc71c71c6d706', - '0x1530477c7ab4113b59a4c18b076d11930f7da5d4a07f649bf54439d87d27e500fc8c25ebf8c92f6812cfc71c71c6d706', - ], - [ - '0x0', - '0x5c759507e8e333ebb5b7a9a47d7ed8532c52d39fd3a042a88b58423c50ae15d5c2638e343d9c71c6238aaaaaaaa97be', - ], - [ - '0x11560bf17baa99bc32126fced787c88f984f87adf7ae0c7f9a208c6b4f20a4181472aaa9cb8d555526a9ffffffffc71c', - '0x8ab05f8bdd54cde190937e76bc3e447cc27c3d6fbd7063fcd104635a790520c0a395554e5c6aaaa9354ffffffffe38f', - ], - [ - '0x124c9ad43b6cf79bfbf7043de3811ad0761b0f37a1e26286b0e977c69aa274524e79097a56dc4bd9e1b371c71c718b10', - '0x0', - ], - ], - // yDen - [ - [ - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffa8fb', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffa8fb', - ], - [ - '0x0', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffa9d3', - ], - [ - '0x12', - '0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaa99', - ], - ['0x1', '0x0'], // LAST 1 - ], - ].map((i) => i.map((pair) => Fp2.fromBigTuple(pair.map(BigInt)))) as [Fp2[], Fp2[], Fp2[], Fp2[]] -); -// 11-isogeny map from E' to E -const isogenyMapG1 = isogenyMap( - Fp, - [ - // xNum - [ - '0x11a05f2b1e833340b809101dd99815856b303e88a2d7005ff2627b56cdb4e2c85610c2d5f2e62d6eaeac1662734649b7', - '0x17294ed3e943ab2f0588bab22147a81c7c17e75b2f6a8417f565e33c70d1e86b4838f2a6f318c356e834eef1b3cb83bb', - '0xd54005db97678ec1d1048c5d10a9a1bce032473295983e56878e501ec68e25c958c3e3d2a09729fe0179f9dac9edcb0', - '0x1778e7166fcc6db74e0609d307e55412d7f5e4656a8dbf25f1b33289f1b330835336e25ce3107193c5b388641d9b6861', - '0xe99726a3199f4436642b4b3e4118e5499db995a1257fb3f086eeb65982fac18985a286f301e77c451154ce9ac8895d9', - '0x1630c3250d7313ff01d1201bf7a74ab5db3cb17dd952799b9ed3ab9097e68f90a0870d2dcae73d19cd13c1c66f652983', - '0xd6ed6553fe44d296a3726c38ae652bfb11586264f0f8ce19008e218f9c86b2a8da25128c1052ecaddd7f225a139ed84', - '0x17b81e7701abdbe2e8743884d1117e53356de5ab275b4db1a682c62ef0f2753339b7c8f8c8f475af9ccb5618e3f0c88e', - '0x80d3cf1f9a78fc47b90b33563be990dc43b756ce79f5574a2c596c928c5d1de4fa295f296b74e956d71986a8497e317', - '0x169b1f8e1bcfa7c42e0c37515d138f22dd2ecb803a0c5c99676314baf4bb1b7fa3190b2edc0327797f241067be390c9e', - '0x10321da079ce07e272d8ec09d2565b0dfa7dccdde6787f96d50af36003b14866f69b771f8c285decca67df3f1605fb7b', - '0x6e08c248e260e70bd1e962381edee3d31d79d7e22c837bc23c0bf1bc24c6b68c24b1b80b64d391fa9c8ba2e8ba2d229', - ], - // xDen - [ - '0x8ca8d548cff19ae18b2e62f4bd3fa6f01d5ef4ba35b48ba9c9588617fc8ac62b558d681be343df8993cf9fa40d21b1c', - '0x12561a5deb559c4348b4711298e536367041e8ca0cf0800c0126c2588c48bf5713daa8846cb026e9e5c8276ec82b3bff', - '0xb2962fe57a3225e8137e629bff2991f6f89416f5a718cd1fca64e00b11aceacd6a3d0967c94fedcfcc239ba5cb83e19', - '0x3425581a58ae2fec83aafef7c40eb545b08243f16b1655154cca8abc28d6fd04976d5243eecf5c4130de8938dc62cd8', - '0x13a8e162022914a80a6f1d5f43e7a07dffdfc759a12062bb8d6b44e833b306da9bd29ba81f35781d539d395b3532a21e', - '0xe7355f8e4e667b955390f7f0506c6e9395735e9ce9cad4d0a43bcef24b8982f7400d24bc4228f11c02df9a29f6304a5', - '0x772caacf16936190f3e0c63e0596721570f5799af53a1894e2e073062aede9cea73b3538f0de06cec2574496ee84a3a', - '0x14a7ac2a9d64a8b230b3f5b074cf01996e7f63c21bca68a81996e1cdf9822c580fa5b9489d11e2d311f7d99bbdcc5a5e', - '0xa10ecf6ada54f825e920b3dafc7a3cce07f8d1d7161366b74100da67f39883503826692abba43704776ec3a79a1d641', - '0x95fc13ab9e92ad4476d6e3eb3a56680f682b4ee96f7d03776df533978f31c1593174e4b4b7865002d6384d168ecdd0a', - '0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001', // LAST 1 - ], - // yNum - [ - '0x90d97c81ba24ee0259d1f094980dcfa11ad138e48a869522b52af6c956543d3cd0c7aee9b3ba3c2be9845719707bb33', - '0x134996a104ee5811d51036d776fb46831223e96c254f383d0f906343eb67ad34d6c56711962fa8bfe097e75a2e41c696', - '0xcc786baa966e66f4a384c86a3b49942552e2d658a31ce2c344be4b91400da7d26d521628b00523b8dfe240c72de1f6', - '0x1f86376e8981c217898751ad8746757d42aa7b90eeb791c09e4a3ec03251cf9de405aba9ec61deca6355c77b0e5f4cb', - '0x8cc03fdefe0ff135caf4fe2a21529c4195536fbe3ce50b879833fd221351adc2ee7f8dc099040a841b6daecf2e8fedb', - '0x16603fca40634b6a2211e11db8f0a6a074a7d0d4afadb7bd76505c3d3ad5544e203f6326c95a807299b23ab13633a5f0', - '0x4ab0b9bcfac1bbcb2c977d027796b3ce75bb8ca2be184cb5231413c4d634f3747a87ac2460f415ec961f8855fe9d6f2', - '0x987c8d5333ab86fde9926bd2ca6c674170a05bfe3bdd81ffd038da6c26c842642f64550fedfe935a15e4ca31870fb29', - '0x9fc4018bd96684be88c9e221e4da1bb8f3abd16679dc26c1e8b6e6a1f20cabe69d65201c78607a360370e577bdba587', - '0xe1bba7a1186bdb5223abde7ada14a23c42a0ca7915af6fe06985e7ed1e4d43b9b3f7055dd4eba6f2bafaaebca731c30', - '0x19713e47937cd1be0dfd0b8f1d43fb93cd2fcbcb6caf493fd1183e416389e61031bf3a5cce3fbafce813711ad011c132', - '0x18b46a908f36f6deb918c143fed2edcc523559b8aaf0c2462e6bfe7f911f643249d9cdf41b44d606ce07c8a4d0074d8e', - '0xb182cac101b9399d155096004f53f447aa7b12a3426b08ec02710e807b4633f06c851c1919211f20d4c04f00b971ef8', - '0x245a394ad1eca9b72fc00ae7be315dc757b3b080d4c158013e6632d3c40659cc6cf90ad1c232a6442d9d3f5db980133', - '0x5c129645e44cf1102a159f748c4a3fc5e673d81d7e86568d9ab0f5d396a7ce46ba1049b6579afb7866b1e715475224b', - '0x15e6be4e990f03ce4ea50b3b42df2eb5cb181d8f84965a3957add4fa95af01b2b665027efec01c7704b456be69c8b604', - ], - // yDen - [ - '0x16112c4c3a9c98b252181140fad0eae9601a6de578980be6eec3232b5be72e7a07f3688ef60c206d01479253b03663c1', - '0x1962d75c2381201e1a0cbd6c43c348b885c84ff731c4d59ca4a10356f453e01f78a4260763529e3532f6102c2e49a03d', - '0x58df3306640da276faaae7d6e8eb15778c4855551ae7f310c35a5dd279cd2eca6757cd636f96f891e2538b53dbf67f2', - '0x16b7d288798e5395f20d23bf89edb4d1d115c5dbddbcd30e123da489e726af41727364f2c28297ada8d26d98445f5416', - '0xbe0e079545f43e4b00cc912f8228ddcc6d19c9f0f69bbb0542eda0fc9dec916a20b15dc0fd2ededda39142311a5001d', - '0x8d9e5297186db2d9fb266eaac783182b70152c65550d881c5ecd87b6f0f5a6449f38db9dfa9cce202c6477faaf9b7ac', - '0x166007c08a99db2fc3ba8734ace9824b5eecfdfa8d0cf8ef5dd365bc400a0051d5fa9c01a58b1fb93d1a1399126a775c', - '0x16a3ef08be3ea7ea03bcddfabba6ff6ee5a4375efa1f4fd7feb34fd206357132b920f5b00801dee460ee415a15812ed9', - '0x1866c8ed336c61231a1be54fd1d74cc4f9fb0ce4c6af5920abc5750c4bf39b4852cfe2f7bb9248836b233d9d55535d4a', - '0x167a55cda70a6e1cea820597d94a84903216f763e13d87bb5308592e7ea7d4fbc7385ea3d529b35e346ef48bb8913f55', - '0x4d2f259eea405bd48f010a01ad2911d9c6dd039bb61a6290e591b36e636a5c871a5c29f4f83060400f8b49cba8f6aa8', - '0xaccbb67481d033ff5852c1e48c50c477f94ff8aefce42d28c0f9a88cea7913516f968986f7ebbea9684b529e2561092', - '0xad6b9514c767fe3c3613144b45f1496543346d98adf02267d5ceef9a00d9b8693000763e3b90ac11e99b138573345cc', - '0x2660400eb2e4f3b628bdd0d53cd76f2bf565b94e72927c1cb748df27942480e420517bd8714cc80d1fadc1326ed06f7', - '0xe0fa1d816ddc03e6b24255e0d7819c171c40f65e273b853324efcd6356caa205ca2f570f13497804415473a1d634b8f', - '0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001', // LAST 1 - ], - ].map((i) => i.map((j) => BigInt(j))) as [Fp[], Fp[], Fp[], Fp[]] -); - -// SWU Map - Fp2 to G2': y² = x³ + 240i * x + 1012 + 1012i -const G2_SWU = mapToCurveSimpleSWU(Fp2, { - A: Fp2.create({ c0: Fp.create(_0n), c1: Fp.create(BigInt(240)) }), // A' = 240 * I - B: Fp2.create({ c0: Fp.create(BigInt(1012)), c1: Fp.create(BigInt(1012)) }), // B' = 1012 * (1 + I) - Z: Fp2.create({ c0: Fp.create(BigInt(-2)), c1: Fp.create(BigInt(-1)) }), // Z: -(2 + I) -}); -// Optimized SWU Map - Fp to G1 -const G1_SWU = mapToCurveSimpleSWU(Fp, { - A: Fp.create( - BigInt( - '0x144698a3b8e9433d693a02c96d4982b0ea985383ee66a8d8e8981aefd881ac98936f8da0e0f97f5cf428082d584c1d' - ) - ), - B: Fp.create( - BigInt( - '0x12e2908d11688030018b12e8753eee3b2016c1f0f24f4070a0b9c14fcef35ef55a23215a316ceaa5d1cc48e98e172be0' - ) - ), - Z: Fp.create(BigInt(11)), -}); - -// Endomorphisms (for fast cofactor clearing) -// Ψ(P) endomorphism -const ut_root = Fp6.create({ c0: Fp2.ZERO, c1: Fp2.ONE, c2: Fp2.ZERO }); -const wsq = Fp12.create({ c0: ut_root, c1: Fp6.ZERO }); -const wcu = Fp12.create({ c0: Fp6.ZERO, c1: ut_root }); -const [wsq_inv, wcu_inv] = Fp12.invertBatch([wsq, wcu]); -function psi(x: Fp2, y: Fp2): [Fp2, Fp2] { - // Untwist Fp2->Fp12 && frobenius(1) && twist back - const x2 = Fp12.mul(Fp12.frobeniusMap(Fp12.multiplyByFp2(wsq_inv, x), 1), wsq).c0.c0; - const y2 = Fp12.mul(Fp12.frobeniusMap(Fp12.multiplyByFp2(wcu_inv, y), 1), wcu).c0.c0; - return [x2, y2]; -} -// Ψ endomorphism -function G2psi(c: ProjConstructor, P: ProjPointType) { - const affine = P.toAffine(); - const p = psi(affine.x, affine.y); - return new c(p[0], p[1], Fp2.ONE); -} -// Ψ²(P) endomorphism -// 1 / F2(2)^((p-1)/3) in GF(p²) -const PSI2_C1 = BigInt( - '0x1a0111ea397fe699ec02408663d4de85aa0d857d89759ad4897d29650fb85f9b409427eb4f49fffd8bfd00000000aaac' -); - -function psi2(x: Fp2, y: Fp2): [Fp2, Fp2] { - return [Fp2.mul(x, PSI2_C1), Fp2.neg(y)]; -} -function G2psi2(c: ProjConstructor, P: ProjPointType) { - const affine = P.toAffine(); - const p = psi2(affine.x, affine.y); - return new c(p[0], p[1], Fp2.ONE); -} - -// Default hash_to_field options are for hash to G2. -// -// Parameter definitions are in section 5.3 of the spec unless otherwise noted. -// Parameter values come from section 8.8.2 of the spec. -// https://www.rfc-editor.org/rfc/rfc9380#section-8.8.2 -// -// Base field F is GF(p^m) -// p = 0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab -// m = 2 (or 1 for G1 see section 8.8.1) -// k = 128 -const htfDefaults = Object.freeze({ - // DST: a domain separation tag - // defined in section 2.2.5 - // Use utils.getDSTLabel(), utils.setDSTLabel(value) - DST: 'BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_NUL_', - encodeDST: 'BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_NUL_', - // p: the characteristic of F - // where F is a finite field of characteristic p and order q = p^m - p: Fp.ORDER, - // m: the extension degree of F, m >= 1 - // where F is a finite field of characteristic p and order q = p^m - m: 2, - // k: the target security level for the suite in bits - // defined in section 5.1 - k: 128, - // option to use a message that has already been processed by - // expand_message_xmd - expand: 'xmd', - // Hash functions for: expand_message_xmd is appropriate for use with a - // wide range of hash functions, including SHA-2, SHA-3, BLAKE2, and others. - // BBS+ uses blake2: https://github.com/hyperledger/aries-framework-go/issues/2247 - hash: sha256, -} as const); - -// Encoding utils -// Point on G1 curve: (x, y) -const C_BIT_POS = Fp.BITS; // C_bit, compression bit for serialization flag -const I_BIT_POS = Fp.BITS + 1; // I_bit, point-at-infinity bit for serialization flag -const S_BIT_POS = Fp.BITS + 2; // S_bit, sign bit for serialization flag -// Compressed point of infinity -const COMPRESSED_ZERO = Fp.toBytes(bitSet(bitSet(_0n, I_BIT_POS, true), S_BIT_POS, true)); // set compressed & point-at-infinity bits - -function signatureG2ToRawBytes(point: ProjPointType) { - // NOTE: by some reasons it was missed in bls12-381, looks like bug - point.assertValidity(); - const len = Fp.BYTES; - if (point.equals(bls12_381.G2.ProjectivePoint.ZERO)) - return concatB(COMPRESSED_ZERO, numberToBytesBE(_0n, len)); - const { x, y } = point.toAffine(); - const { re: x0, im: x1 } = Fp2.reim(x); - const { re: y0, im: y1 } = Fp2.reim(y); - const tmp = y1 > _0n ? y1 * _2n : y0 * _2n; - const aflag1 = Boolean((tmp / Fp.ORDER) & _1n); - const z1 = bitSet(bitSet(x1, 381, aflag1), S_BIT_POS, true); - const z2 = x0; - return concatB(numberToBytesBE(z1, len), numberToBytesBE(z2, len)); -} - -// To verify curve parameters, see pairing-friendly-curves spec: -// https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-pairing-friendly-curves-11 -// Basic math is done over finite fields over p. -// More complicated math is done over polynominal extension fields. -// To simplify calculations in Fp12, we construct extension tower: -// Fp₁₂ = Fp₆² => Fp₂³ -// Fp(u) / (u² - β) where β = -1 -// Fp₂(v) / (v³ - ξ) where ξ = u + 1 -// Fp₆(w) / (w² - γ) where γ = v -// Here goes constants && point encoding format -export const bls12_381: CurveFn = bls({ - // Fields - fields: { - Fp, - Fp2, - Fp6, - Fp12, - Fr, - }, - // G1 is the order-q subgroup of E1(Fp) : y² = x³ + 4, #E1(Fp) = h1q, where - // characteristic; z + (z⁴ - z² + 1)(z - 1)²/3 - G1: { - Fp, - // cofactor; (z - 1)²/3 - h: BigInt('0x396c8c005555e1568c00aaab0000aaab'), - // generator's coordinates - // x = 3685416753713387016781088315183077757961620795782546409894578378688607592378376318836054947676345821548104185464507 - // y = 1339506544944476473020471379941921221584933875938349620426543736416511423956333506472724655353366534992391756441569 - Gx: BigInt( - '0x17f1d3a73197d7942695638c4fa9ac0fc3688c4f9774b905a14e3a3f171bac586c55e83ff97a1aeffb3af00adb22c6bb' - ), - Gy: BigInt( - '0x08b3f481e3aaa0f1a09e30ed741d8ae4fcf5e095d5d00af600db18cb2c04b3edd03cc744a2888ae40caa232946c5e7e1' - ), - a: Fp.ZERO, - b: _4n, - htfDefaults: { ...htfDefaults, m: 1 }, - wrapPrivateKey: true, - allowInfinityPoint: true, - // Checks is the point resides in prime-order subgroup. - // point.isTorsionFree() should return true for valid points - // It returns false for shitty points. - // https://eprint.iacr.org/2021/1130.pdf - isTorsionFree: (c, point): boolean => { - // φ endomorphism - const cubicRootOfUnityModP = BigInt( - '0x5f19672fdf76ce51ba69c6076a0f77eaddb3a93be6f89688de17d813620a00022e01fffffffefffe' - ); - const phi = new c(Fp.mul(point.px, cubicRootOfUnityModP), point.py, point.pz); - - // todo: unroll - const xP = point.multiplyUnsafe(bls12_381.params.x).negate(); // [x]P - const u2P = xP.multiplyUnsafe(bls12_381.params.x); // [u2]P - return u2P.equals(phi); - - // https://eprint.iacr.org/2019/814.pdf - // (z² − 1)/3 - // const c1 = BigInt('0x396c8c005555e1560000000055555555'); - // const P = this; - // const S = P.sigma(); - // const Q = S.double(); - // const S2 = S.sigma(); - // // [(z² − 1)/3](2σ(P) − P − σ²(P)) − σ²(P) = O - // const left = Q.subtract(P).subtract(S2).multiplyUnsafe(c1); - // const C = left.subtract(S2); - // return C.isZero(); - }, - // Clear cofactor of G1 - // https://eprint.iacr.org/2019/403 - clearCofactor: (_c, point) => { - // return this.multiplyUnsafe(CURVE.h); - return point.multiplyUnsafe(bls12_381.params.x).add(point); // x*P + P - }, - mapToCurve: (scalars: bigint[]) => { - const { x, y } = G1_SWU(Fp.create(scalars[0])); - return isogenyMapG1(x, y); - }, - fromBytes: (bytes: Uint8Array): AffinePoint => { - bytes = bytes.slice(); - if (bytes.length === 48) { - // TODO: Fp.bytes - const P = Fp.ORDER; - const compressedValue = bytesToNumberBE(bytes); - const bflag = bitGet(compressedValue, I_BIT_POS); - // Zero - if (bflag === _1n) return { x: _0n, y: _0n }; - const x = Fp.create(compressedValue & Fp.MASK); - const right = Fp.add(Fp.pow(x, _3n), Fp.create(bls12_381.params.G1b)); // y² = x³ + b - let y = Fp.sqrt(right); - if (!y) throw new Error('Invalid compressed G1 point'); - const aflag = bitGet(compressedValue, C_BIT_POS); - if ((y * _2n) / P !== aflag) y = Fp.neg(y); - return { x: Fp.create(x), y: Fp.create(y) }; - } else if (bytes.length === 96) { - // Check if the infinity flag is set - if ((bytes[0] & (1 << 6)) !== 0) return bls12_381.G1.ProjectivePoint.ZERO.toAffine(); - const x = bytesToNumberBE(bytes.subarray(0, Fp.BYTES)); - const y = bytesToNumberBE(bytes.subarray(Fp.BYTES)); - return { x: Fp.create(x), y: Fp.create(y) }; - } else { - throw new Error('Invalid point G1, expected 48/96 bytes'); - } - }, - toBytes: (c, point, isCompressed) => { - const isZero = point.equals(c.ZERO); - const { x, y } = point.toAffine(); - if (isCompressed) { - if (isZero) return COMPRESSED_ZERO.slice(); - const P = Fp.ORDER; - let num; - num = bitSet(x, C_BIT_POS, Boolean((y * _2n) / P)); // set aflag - num = bitSet(num, S_BIT_POS, true); - return numberToBytesBE(num, Fp.BYTES); - } else { - if (isZero) { - // 2x PUBLIC_KEY_LENGTH - const x = concatB(new Uint8Array([0x40]), new Uint8Array(2 * Fp.BYTES - 1)); - return x; - } else { - return concatB(numberToBytesBE(x, Fp.BYTES), numberToBytesBE(y, Fp.BYTES)); - } - } - }, - }, - // G2 is the order-q subgroup of E2(Fp²) : y² = x³+4(1+√−1), - // where Fp2 is Fp[√−1]/(x2+1). #E2(Fp2 ) = h2q, where - // G² - 1 - // h2q - G2: { - Fp: Fp2, - // cofactor - h: BigInt( - '0x5d543a95414e7f1091d50792876a202cd91de4547085abaa68a205b2e5a7ddfa628f1cb4d9e82ef21537e293a6691ae1616ec6e786f0c70cf1c38e31c7238e5' - ), - Gx: Fp2.fromBigTuple([ - BigInt( - '0x024aa2b2f08f0a91260805272dc51051c6e47ad4fa403b02b4510b647ae3d1770bac0326a805bbefd48056c8c121bdb8' - ), - BigInt( - '0x13e02b6052719f607dacd3a088274f65596bd0d09920b61ab5da61bbdc7f5049334cf11213945d57e5ac7d055d042b7e' - ), - ]), - // y = - // 927553665492332455747201965776037880757740193453592970025027978793976877002675564980949289727957565575433344219582, - // 1985150602287291935568054521177171638300868978215655730859378665066344726373823718423869104263333984641494340347905 - Gy: Fp2.fromBigTuple([ - BigInt( - '0x0ce5d527727d6e118cc9cdc6da2e351aadfd9baa8cbdd3a76d429a695160d12c923ac9cc3baca289e193548608b82801' - ), - BigInt( - '0x0606c4a02ea734cc32acd2b02bc28b99cb3e287e85a763af267492ab572e99ab3f370d275cec1da1aaa9075ff05f79be' - ), - ]), - a: Fp2.ZERO, - b: Fp2.fromBigTuple([_4n, _4n]), - hEff: BigInt( - '0xbc69f08f2ee75b3584c6a0ea91b352888e2a8e9145ad7689986ff031508ffe1329c2f178731db956d82bf015d1212b02ec0ec69d7477c1ae954cbc06689f6a359894c0adebbf6b4e8020005aaa95551' - ), - htfDefaults: { ...htfDefaults }, - wrapPrivateKey: true, - allowInfinityPoint: true, - mapToCurve: (scalars: bigint[]) => { - const { x, y } = G2_SWU(Fp2.fromBigTuple(scalars)); - return isogenyMapG2(x, y); - }, - // Checks is the point resides in prime-order subgroup. - // point.isTorsionFree() should return true for valid points - // It returns false for shitty points. - // https://eprint.iacr.org/2021/1130.pdf - isTorsionFree: (c, P): boolean => { - return P.multiplyUnsafe(bls12_381.params.x).negate().equals(G2psi(c, P)); // ψ(P) == [u](P) - // Older version: https://eprint.iacr.org/2019/814.pdf - // Ψ²(P) => Ψ³(P) => [z]Ψ³(P) where z = -x => [z]Ψ³(P) - Ψ²(P) + P == O - // return P.psi2().psi().mulNegX().subtract(psi2).add(P).isZero(); - }, - // Maps the point into the prime-order subgroup G2. - // clear_cofactor_bls12381_g2 from cfrg-hash-to-curve-11 - // https://eprint.iacr.org/2017/419.pdf - // prettier-ignore - clearCofactor: (c, P) => { - const x = bls12_381.params.x; - let t1 = P.multiplyUnsafe(x).negate(); // [-x]P - let t2 = G2psi(c, P); // Ψ(P) - let t3 = P.double(); // 2P - t3 = G2psi2(c, t3); // Ψ²(2P) - t3 = t3.subtract(t2); // Ψ²(2P) - Ψ(P) - t2 = t1.add(t2); // [-x]P + Ψ(P) - t2 = t2.multiplyUnsafe(x).negate(); // [x²]P - [x]Ψ(P) - t3 = t3.add(t2); // Ψ²(2P) - Ψ(P) + [x²]P - [x]Ψ(P) - t3 = t3.subtract(t1); // Ψ²(2P) - Ψ(P) + [x²]P - [x]Ψ(P) + [x]P - const Q = t3.subtract(P); // Ψ²(2P) - Ψ(P) + [x²]P - [x]Ψ(P) + [x]P - 1P - return Q; // [x²-x-1]P + [x-1]Ψ(P) + Ψ²(2P) - }, - fromBytes: (bytes: Uint8Array): AffinePoint => { - bytes = bytes.slice(); - const m_byte = bytes[0] & 0xe0; - if (m_byte === 0x20 || m_byte === 0x60 || m_byte === 0xe0) { - throw new Error('Invalid encoding flag: ' + m_byte); - } - const bitC = m_byte & 0x80; // compression bit - const bitI = m_byte & 0x40; // point at infinity bit - const bitS = m_byte & 0x20; // sign bit - const L = Fp.BYTES; - const slc = (b: Uint8Array, from: number, to?: number) => bytesToNumberBE(b.slice(from, to)); - if (bytes.length === 96 && bitC) { - const b = bls12_381.params.G2b; - const P = Fp.ORDER; - - bytes[0] = bytes[0] & 0x1f; // clear flags - if (bitI) { - // check that all bytes are 0 - if (bytes.reduce((p, c) => (p !== 0 ? c + 1 : c), 0) > 0) { - throw new Error('Invalid compressed G2 point'); - } - return { x: Fp2.ZERO, y: Fp2.ZERO }; - } - const x_1 = slc(bytes, 0, L); - const x_0 = slc(bytes, L, 2 * L); - const x = Fp2.create({ c0: Fp.create(x_0), c1: Fp.create(x_1) }); - const right = Fp2.add(Fp2.pow(x, _3n), b); // y² = x³ + 4 * (u+1) = x³ + b - let y = Fp2.sqrt(right); - const Y_bit = y.c1 === _0n ? (y.c0 * _2n) / P : (y.c1 * _2n) / P ? _1n : _0n; - y = bitS > 0 && Y_bit > 0 ? y : Fp2.neg(y); - return { x, y }; - } else if (bytes.length === 192 && !bitC) { - // Check if the infinity flag is set - if ((bytes[0] & (1 << 6)) !== 0) { - return { x: Fp2.ZERO, y: Fp2.ZERO }; - } - const x1 = slc(bytes, 0, L); - const x0 = slc(bytes, L, 2 * L); - const y1 = slc(bytes, 2 * L, 3 * L); - const y0 = slc(bytes, 3 * L, 4 * L); - return { x: Fp2.fromBigTuple([x0, x1]), y: Fp2.fromBigTuple([y0, y1]) }; - } else { - throw new Error('Invalid point G2, expected 96/192 bytes'); - } - }, - toBytes: (c, point, isCompressed) => { - const { BYTES: len, ORDER: P } = Fp; - const isZero = point.equals(c.ZERO); - const { x, y } = point.toAffine(); - if (isCompressed) { - if (isZero) return concatB(COMPRESSED_ZERO, numberToBytesBE(_0n, len)); - const flag = Boolean(y.c1 === _0n ? (y.c0 * _2n) / P : (y.c1 * _2n) / P); - // set compressed & sign bits (looks like different offsets than for G1/Fp?) - let x_1 = bitSet(x.c1, C_BIT_POS, flag); - x_1 = bitSet(x_1, S_BIT_POS, true); - return concatB(numberToBytesBE(x_1, len), numberToBytesBE(x.c0, len)); - } else { - if (isZero) return concatB(new Uint8Array([0x40]), new Uint8Array(4 * len - 1)); // bytes[0] |= 1 << 6; - const { re: x0, im: x1 } = Fp2.reim(x); - const { re: y0, im: y1 } = Fp2.reim(y); - return concatB( - numberToBytesBE(x1, len), - numberToBytesBE(x0, len), - numberToBytesBE(y1, len), - numberToBytesBE(y0, len) - ); - } - }, - Signature: { - // TODO: Optimize, it's very slow because of sqrt. - fromHex(hex: Hex): ProjPointType { - hex = ensureBytes('signatureHex', hex); - const P = Fp.ORDER; - const half = hex.length / 2; - if (half !== 48 && half !== 96) - throw new Error('Invalid compressed signature length, must be 96 or 192'); - const z1 = bytesToNumberBE(hex.slice(0, half)); - const z2 = bytesToNumberBE(hex.slice(half)); - // Indicates the infinity point - const bflag1 = bitGet(z1, I_BIT_POS); - if (bflag1 === _1n) return bls12_381.G2.ProjectivePoint.ZERO; - - const x1 = Fp.create(z1 & Fp.MASK); - const x2 = Fp.create(z2); - const x = Fp2.create({ c0: x2, c1: x1 }); - const y2 = Fp2.add(Fp2.pow(x, _3n), bls12_381.params.G2b); // y² = x³ + 4 - // The slow part - let y = Fp2.sqrt(y2); - if (!y) throw new Error('Failed to find a square root'); - - // Choose the y whose leftmost bit of the imaginary part is equal to the a_flag1 - // If y1 happens to be zero, then use the bit of y0 - const { re: y0, im: y1 } = Fp2.reim(y); - const aflag1 = bitGet(z1, 381); - const isGreater = y1 > _0n && (y1 * _2n) / P !== aflag1; - const isZero = y1 === _0n && (y0 * _2n) / P !== aflag1; - if (isGreater || isZero) y = Fp2.neg(y); - const point = bls12_381.G2.ProjectivePoint.fromAffine({ x, y }); - point.assertValidity(); - return point; - }, - toRawBytes(point: ProjPointType) { - return signatureG2ToRawBytes(point); - }, - toHex(point: ProjPointType) { - return bytesToHex(signatureG2ToRawBytes(point)); - }, - }, - }, - params: { - x: BLS_X, // The BLS parameter x for BLS12-381 - r: Fr.ORDER, // order; z⁴ − z² + 1; CURVE.n from other curves - }, - htfDefaults, - hash: sha256, - randomBytes, -}); diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/bn254.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/bn254.ts deleted file mode 100644 index 64ccfe0c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/bn254.ts +++ /dev/null @@ -1,21 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { sha256 } from '@noble/hashes/sha256'; -import { weierstrass } from './abstract/weierstrass.js'; -import { getHash } from './_shortw_utils.js'; -import { Field } from './abstract/modular.js'; -/** - * bn254 pairing-friendly curve. - * Previously known as alt_bn_128, when it had 128-bit security. - * Recent research shown it's weaker, the naming has been adjusted to its prime bit count. - * https://github.com/zcash/zcash/issues/2502 - */ -export const bn254 = weierstrass({ - a: BigInt(0), - b: BigInt(3), - Fp: Field(BigInt('0x30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47')), - n: BigInt('0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001'), - Gx: BigInt(1), - Gy: BigInt(2), - h: BigInt(1), - ...getHash(sha256), -}); diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/ed25519.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/ed25519.ts deleted file mode 100644 index 896f4eea..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/ed25519.ts +++ /dev/null @@ -1,489 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { sha512 } from '@noble/hashes/sha512'; -import { concatBytes, randomBytes, utf8ToBytes } from '@noble/hashes/utils'; -import { ExtPointType, twistedEdwards } from './abstract/edwards.js'; -import { montgomery } from './abstract/montgomery.js'; -import { Field, FpSqrtEven, isNegativeLE, mod, pow2 } from './abstract/modular.js'; -import { - bytesToHex, - bytesToNumberLE, - ensureBytes, - equalBytes, - Hex, - numberToBytesLE, -} from './abstract/utils.js'; -import { createHasher, htfBasicOpts, expand_message_xmd } from './abstract/hash-to-curve.js'; -import { AffinePoint } from './abstract/curve.js'; - -/** - * ed25519 Twisted Edwards curve with following addons: - * - X25519 ECDH - * - Ristretto cofactor elimination - * - Elligator hash-to-group / point indistinguishability - */ - -const ED25519_P = BigInt( - '57896044618658097711785492504343953926634992332820282019728792003956564819949' -); -// √(-1) aka √(a) aka 2^((p-1)/4) -const ED25519_SQRT_M1 = BigInt( - '19681161376707505956807079304988542015446066515923890162744021073123829784752' -); - -// prettier-ignore -const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _5n = BigInt(5); -// prettier-ignore -const _10n = BigInt(10), _20n = BigInt(20), _40n = BigInt(40), _80n = BigInt(80); - -function ed25519_pow_2_252_3(x: bigint) { - const P = ED25519_P; - const x2 = (x * x) % P; - const b2 = (x2 * x) % P; // x^3, 11 - const b4 = (pow2(b2, _2n, P) * b2) % P; // x^15, 1111 - const b5 = (pow2(b4, _1n, P) * x) % P; // x^31 - const b10 = (pow2(b5, _5n, P) * b5) % P; - const b20 = (pow2(b10, _10n, P) * b10) % P; - const b40 = (pow2(b20, _20n, P) * b20) % P; - const b80 = (pow2(b40, _40n, P) * b40) % P; - const b160 = (pow2(b80, _80n, P) * b80) % P; - const b240 = (pow2(b160, _80n, P) * b80) % P; - const b250 = (pow2(b240, _10n, P) * b10) % P; - const pow_p_5_8 = (pow2(b250, _2n, P) * x) % P; - // ^ To pow to (p+3)/8, multiply it by x. - return { pow_p_5_8, b2 }; -} - -function adjustScalarBytes(bytes: Uint8Array): Uint8Array { - // Section 5: For X25519, in order to decode 32 random bytes as an integer scalar, - // set the three least significant bits of the first byte - bytes[0] &= 248; // 0b1111_1000 - // and the most significant bit of the last to zero, - bytes[31] &= 127; // 0b0111_1111 - // set the second most significant bit of the last byte to 1 - bytes[31] |= 64; // 0b0100_0000 - return bytes; -} - -// sqrt(u/v) -function uvRatio(u: bigint, v: bigint): { isValid: boolean; value: bigint } { - const P = ED25519_P; - const v3 = mod(v * v * v, P); // v³ - const v7 = mod(v3 * v3 * v, P); // v⁷ - // (p+3)/8 and (p-5)/8 - const pow = ed25519_pow_2_252_3(u * v7).pow_p_5_8; - let x = mod(u * v3 * pow, P); // (uv³)(uv⁷)^(p-5)/8 - const vx2 = mod(v * x * x, P); // vx² - const root1 = x; // First root candidate - const root2 = mod(x * ED25519_SQRT_M1, P); // Second root candidate - const useRoot1 = vx2 === u; // If vx² = u (mod p), x is a square root - const useRoot2 = vx2 === mod(-u, P); // If vx² = -u, set x <-- x * 2^((p-1)/4) - const noRoot = vx2 === mod(-u * ED25519_SQRT_M1, P); // There is no valid root, vx² = -u√(-1) - if (useRoot1) x = root1; - if (useRoot2 || noRoot) x = root2; // We return root2 anyway, for const-time - if (isNegativeLE(x, P)) x = mod(-x, P); - return { isValid: useRoot1 || useRoot2, value: x }; -} - -// Just in case -export const ED25519_TORSION_SUBGROUP = [ - '0100000000000000000000000000000000000000000000000000000000000000', - 'c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a', - '0000000000000000000000000000000000000000000000000000000000000080', - '26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05', - 'ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f', - '26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85', - '0000000000000000000000000000000000000000000000000000000000000000', - 'c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa', -]; - -const Fp = Field(ED25519_P, undefined, true); - -const ed25519Defaults = { - // Param: a - a: BigInt(-1), // Fp.create(-1) is proper; our way still works and is faster - // d is equal to -121665/121666 over finite field. - // Negative number is P - number, and division is invert(number, P) - d: BigInt('37095705934669439343138083508754565189542113879843219016388785533085940283555'), - // Finite field 𝔽p over which we'll do calculations; 2n**255n - 19n - Fp, - // Subgroup order: how many points curve has - // 2n**252n + 27742317777372353535851937790883648493n; - n: BigInt('7237005577332262213973186563042994240857116359379907606001950938285454250989'), - // Cofactor - h: BigInt(8), - // Base point (x, y) aka generator point - Gx: BigInt('15112221349535400772501151409588531511454012693041857206046113283949847762202'), - Gy: BigInt('46316835694926478169428394003475163141307993866256225615783033603165251855960'), - hash: sha512, - randomBytes, - adjustScalarBytes, - // dom2 - // Ratio of u to v. Allows us to combine inversion and square root. Uses algo from RFC8032 5.1.3. - // Constant-time, u/√v - uvRatio, -} as const; - -export const ed25519 = /* @__PURE__ */ twistedEdwards(ed25519Defaults); - -function ed25519_domain(data: Uint8Array, ctx: Uint8Array, phflag: boolean) { - if (ctx.length > 255) throw new Error('Context is too big'); - return concatBytes( - utf8ToBytes('SigEd25519 no Ed25519 collisions'), - new Uint8Array([phflag ? 1 : 0, ctx.length]), - ctx, - data - ); -} - -export const ed25519ctx = /* @__PURE__ */ twistedEdwards({ - ...ed25519Defaults, - domain: ed25519_domain, -}); -export const ed25519ph = /* @__PURE__ */ twistedEdwards({ - ...ed25519Defaults, - domain: ed25519_domain, - prehash: sha512, -}); - -export const x25519 = /* @__PURE__ */ (() => - montgomery({ - P: ED25519_P, - a: BigInt(486662), - montgomeryBits: 255, // n is 253 bits - nByteLength: 32, - Gu: BigInt(9), - powPminus2: (x: bigint): bigint => { - const P = ED25519_P; - // x^(p-2) aka x^(2^255-21) - const { pow_p_5_8, b2 } = ed25519_pow_2_252_3(x); - return mod(pow2(pow_p_5_8, BigInt(3), P) * b2, P); - }, - adjustScalarBytes, - randomBytes, - }))(); - -/** - * Converts ed25519 public key to x25519 public key. Uses formula: - * * `(u, v) = ((1+y)/(1-y), sqrt(-486664)*u/x)` - * * `(x, y) = (sqrt(-486664)*u/v, (u-1)/(u+1))` - * @example - * const someonesPub = ed25519.getPublicKey(ed25519.utils.randomPrivateKey()); - * const aPriv = x25519.utils.randomPrivateKey(); - * x25519.getSharedSecret(aPriv, edwardsToMontgomeryPub(someonesPub)) - */ -export function edwardsToMontgomeryPub(edwardsPub: Hex): Uint8Array { - const { y } = ed25519.ExtendedPoint.fromHex(edwardsPub); - const _1n = BigInt(1); - return Fp.toBytes(Fp.create((_1n + y) * Fp.inv(_1n - y))); -} -export const edwardsToMontgomery = edwardsToMontgomeryPub; // deprecated - -/** - * Converts ed25519 secret key to x25519 secret key. - * @example - * const someonesPub = x25519.getPublicKey(x25519.utils.randomPrivateKey()); - * const aPriv = ed25519.utils.randomPrivateKey(); - * x25519.getSharedSecret(edwardsToMontgomeryPriv(aPriv), someonesPub) - */ -export function edwardsToMontgomeryPriv(edwardsPriv: Uint8Array): Uint8Array { - const hashed = ed25519Defaults.hash(edwardsPriv.subarray(0, 32)); - return ed25519Defaults.adjustScalarBytes(hashed).subarray(0, 32); -} - -// Hash To Curve Elligator2 Map (NOTE: different from ristretto255 elligator) -// NOTE: very important part is usage of FpSqrtEven for ELL2_C1_EDWARDS, since -// SageMath returns different root first and everything falls apart - -const ELL2_C1 = (Fp.ORDER + BigInt(3)) / BigInt(8); // 1. c1 = (q + 3) / 8 # Integer arithmetic - -const ELL2_C2 = Fp.pow(_2n, ELL2_C1); // 2. c2 = 2^c1 -const ELL2_C3 = Fp.sqrt(Fp.neg(Fp.ONE)); // 3. c3 = sqrt(-1) -const ELL2_C4 = (Fp.ORDER - BigInt(5)) / BigInt(8); // 4. c4 = (q - 5) / 8 # Integer arithmetic -const ELL2_J = BigInt(486662); - -// prettier-ignore -function map_to_curve_elligator2_curve25519(u: bigint) { - let tv1 = Fp.sqr(u); // 1. tv1 = u^2 - tv1 = Fp.mul(tv1, _2n); // 2. tv1 = 2 * tv1 - let xd = Fp.add(tv1, Fp.ONE); // 3. xd = tv1 + 1 # Nonzero: -1 is square (mod p), tv1 is not - let x1n = Fp.neg(ELL2_J); // 4. x1n = -J # x1 = x1n / xd = -J / (1 + 2 * u^2) - let tv2 = Fp.sqr(xd); // 5. tv2 = xd^2 - let gxd = Fp.mul(tv2, xd); // 6. gxd = tv2 * xd # gxd = xd^3 - let gx1 = Fp.mul(tv1, ELL2_J); // 7. gx1 = J * tv1 # x1n + J * xd - gx1 = Fp.mul(gx1, x1n); // 8. gx1 = gx1 * x1n # x1n^2 + J * x1n * xd - gx1 = Fp.add(gx1, tv2); // 9. gx1 = gx1 + tv2 # x1n^2 + J * x1n * xd + xd^2 - gx1 = Fp.mul(gx1, x1n); // 10. gx1 = gx1 * x1n # x1n^3 + J * x1n^2 * xd + x1n * xd^2 - let tv3 = Fp.sqr(gxd); // 11. tv3 = gxd^2 - tv2 = Fp.sqr(tv3); // 12. tv2 = tv3^2 # gxd^4 - tv3 = Fp.mul(tv3, gxd); // 13. tv3 = tv3 * gxd # gxd^3 - tv3 = Fp.mul(tv3, gx1); // 14. tv3 = tv3 * gx1 # gx1 * gxd^3 - tv2 = Fp.mul(tv2, tv3); // 15. tv2 = tv2 * tv3 # gx1 * gxd^7 - let y11 = Fp.pow(tv2, ELL2_C4); // 16. y11 = tv2^c4 # (gx1 * gxd^7)^((p - 5) / 8) - y11 = Fp.mul(y11, tv3); // 17. y11 = y11 * tv3 # gx1*gxd^3*(gx1*gxd^7)^((p-5)/8) - let y12 = Fp.mul(y11, ELL2_C3); // 18. y12 = y11 * c3 - tv2 = Fp.sqr(y11); // 19. tv2 = y11^2 - tv2 = Fp.mul(tv2, gxd); // 20. tv2 = tv2 * gxd - let e1 = Fp.eql(tv2, gx1); // 21. e1 = tv2 == gx1 - let y1 = Fp.cmov(y12, y11, e1); // 22. y1 = CMOV(y12, y11, e1) # If g(x1) is square, this is its sqrt - let x2n = Fp.mul(x1n, tv1); // 23. x2n = x1n * tv1 # x2 = x2n / xd = 2 * u^2 * x1n / xd - let y21 = Fp.mul(y11, u); // 24. y21 = y11 * u - y21 = Fp.mul(y21, ELL2_C2); // 25. y21 = y21 * c2 - let y22 = Fp.mul(y21, ELL2_C3); // 26. y22 = y21 * c3 - let gx2 = Fp.mul(gx1, tv1); // 27. gx2 = gx1 * tv1 # g(x2) = gx2 / gxd = 2 * u^2 * g(x1) - tv2 = Fp.sqr(y21); // 28. tv2 = y21^2 - tv2 = Fp.mul(tv2, gxd); // 29. tv2 = tv2 * gxd - let e2 = Fp.eql(tv2, gx2); // 30. e2 = tv2 == gx2 - let y2 = Fp.cmov(y22, y21, e2); // 31. y2 = CMOV(y22, y21, e2) # If g(x2) is square, this is its sqrt - tv2 = Fp.sqr(y1); // 32. tv2 = y1^2 - tv2 = Fp.mul(tv2, gxd); // 33. tv2 = tv2 * gxd - let e3 = Fp.eql(tv2, gx1); // 34. e3 = tv2 == gx1 - let xn = Fp.cmov(x2n, x1n, e3); // 35. xn = CMOV(x2n, x1n, e3) # If e3, x = x1, else x = x2 - let y = Fp.cmov(y2, y1, e3); // 36. y = CMOV(y2, y1, e3) # If e3, y = y1, else y = y2 - let e4 = Fp.isOdd(y); // 37. e4 = sgn0(y) == 1 # Fix sign of y - y = Fp.cmov(y, Fp.neg(y), e3 !== e4); // 38. y = CMOV(y, -y, e3 XOR e4) - return { xMn: xn, xMd: xd, yMn: y, yMd: _1n }; // 39. return (xn, xd, y, 1) -} - -const ELL2_C1_EDWARDS = FpSqrtEven(Fp, Fp.neg(BigInt(486664))); // sgn0(c1) MUST equal 0 -function map_to_curve_elligator2_edwards25519(u: bigint) { - const { xMn, xMd, yMn, yMd } = map_to_curve_elligator2_curve25519(u); // 1. (xMn, xMd, yMn, yMd) = - // map_to_curve_elligator2_curve25519(u) - let xn = Fp.mul(xMn, yMd); // 2. xn = xMn * yMd - xn = Fp.mul(xn, ELL2_C1_EDWARDS); // 3. xn = xn * c1 - let xd = Fp.mul(xMd, yMn); // 4. xd = xMd * yMn # xn / xd = c1 * xM / yM - let yn = Fp.sub(xMn, xMd); // 5. yn = xMn - xMd - let yd = Fp.add(xMn, xMd); // 6. yd = xMn + xMd # (n / d - 1) / (n / d + 1) = (n - d) / (n + d) - let tv1 = Fp.mul(xd, yd); // 7. tv1 = xd * yd - let e = Fp.eql(tv1, Fp.ZERO); // 8. e = tv1 == 0 - xn = Fp.cmov(xn, Fp.ZERO, e); // 9. xn = CMOV(xn, 0, e) - xd = Fp.cmov(xd, Fp.ONE, e); // 10. xd = CMOV(xd, 1, e) - yn = Fp.cmov(yn, Fp.ONE, e); // 11. yn = CMOV(yn, 1, e) - yd = Fp.cmov(yd, Fp.ONE, e); // 12. yd = CMOV(yd, 1, e) - - const inv = Fp.invertBatch([xd, yd]); // batch division - return { x: Fp.mul(xn, inv[0]), y: Fp.mul(yn, inv[1]) }; // 13. return (xn, xd, yn, yd) -} - -const htf = /* @__PURE__ */ (() => - createHasher( - ed25519.ExtendedPoint, - (scalars: bigint[]) => map_to_curve_elligator2_edwards25519(scalars[0]), - { - DST: 'edwards25519_XMD:SHA-512_ELL2_RO_', - encodeDST: 'edwards25519_XMD:SHA-512_ELL2_NU_', - p: Fp.ORDER, - m: 1, - k: 128, - expand: 'xmd', - hash: sha512, - } - ))(); -export const hashToCurve = /* @__PURE__ */ (() => htf.hashToCurve)(); -export const encodeToCurve = /* @__PURE__ */ (() => htf.encodeToCurve)(); - -function assertRstPoint(other: unknown) { - if (!(other instanceof RistPoint)) throw new Error('RistrettoPoint expected'); -} - -// √(-1) aka √(a) aka 2^((p-1)/4) -const SQRT_M1 = ED25519_SQRT_M1; -// √(ad - 1) -const SQRT_AD_MINUS_ONE = BigInt( - '25063068953384623474111414158702152701244531502492656460079210482610430750235' -); -// 1 / √(a-d) -const INVSQRT_A_MINUS_D = BigInt( - '54469307008909316920995813868745141605393597292927456921205312896311721017578' -); -// 1-d² -const ONE_MINUS_D_SQ = BigInt( - '1159843021668779879193775521855586647937357759715417654439879720876111806838' -); -// (d-1)² -const D_MINUS_ONE_SQ = BigInt( - '40440834346308536858101042469323190826248399146238708352240133220865137265952' -); -// Calculates 1/√(number) -const invertSqrt = (number: bigint) => uvRatio(_1n, number); - -const MAX_255B = BigInt('0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'); -const bytes255ToNumberLE = (bytes: Uint8Array) => - ed25519.CURVE.Fp.create(bytesToNumberLE(bytes) & MAX_255B); - -type ExtendedPoint = ExtPointType; - -// Computes Elligator map for Ristretto -// https://ristretto.group/formulas/elligator.html -function calcElligatorRistrettoMap(r0: bigint): ExtendedPoint { - const { d } = ed25519.CURVE; - const P = ed25519.CURVE.Fp.ORDER; - const mod = ed25519.CURVE.Fp.create; - const r = mod(SQRT_M1 * r0 * r0); // 1 - const Ns = mod((r + _1n) * ONE_MINUS_D_SQ); // 2 - let c = BigInt(-1); // 3 - const D = mod((c - d * r) * mod(r + d)); // 4 - let { isValid: Ns_D_is_sq, value: s } = uvRatio(Ns, D); // 5 - let s_ = mod(s * r0); // 6 - if (!isNegativeLE(s_, P)) s_ = mod(-s_); - if (!Ns_D_is_sq) s = s_; // 7 - if (!Ns_D_is_sq) c = r; // 8 - const Nt = mod(c * (r - _1n) * D_MINUS_ONE_SQ - D); // 9 - const s2 = s * s; - const W0 = mod((s + s) * D); // 10 - const W1 = mod(Nt * SQRT_AD_MINUS_ONE); // 11 - const W2 = mod(_1n - s2); // 12 - const W3 = mod(_1n + s2); // 13 - return new ed25519.ExtendedPoint(mod(W0 * W3), mod(W2 * W1), mod(W1 * W3), mod(W0 * W2)); -} - -/** - * Each ed25519/ExtendedPoint has 8 different equivalent points. This can be - * a source of bugs for protocols like ring signatures. Ristretto was created to solve this. - * Ristretto point operates in X:Y:Z:T extended coordinates like ExtendedPoint, - * but it should work in its own namespace: do not combine those two. - * https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-ristretto255-decaf448 - */ -class RistPoint { - static BASE: RistPoint; - static ZERO: RistPoint; - // Private property to discourage combining ExtendedPoint + RistrettoPoint - // Always use Ristretto encoding/decoding instead. - constructor(private readonly ep: ExtendedPoint) {} - - static fromAffine(ap: AffinePoint) { - return new RistPoint(ed25519.ExtendedPoint.fromAffine(ap)); - } - - /** - * Takes uniform output of 64-byte hash function like sha512 and converts it to `RistrettoPoint`. - * The hash-to-group operation applies Elligator twice and adds the results. - * **Note:** this is one-way map, there is no conversion from point to hash. - * https://ristretto.group/formulas/elligator.html - * @param hex 64-byte output of a hash function - */ - static hashToCurve(hex: Hex): RistPoint { - hex = ensureBytes('ristrettoHash', hex, 64); - const r1 = bytes255ToNumberLE(hex.slice(0, 32)); - const R1 = calcElligatorRistrettoMap(r1); - const r2 = bytes255ToNumberLE(hex.slice(32, 64)); - const R2 = calcElligatorRistrettoMap(r2); - return new RistPoint(R1.add(R2)); - } - - /** - * Converts ristretto-encoded string to ristretto point. - * https://ristretto.group/formulas/decoding.html - * @param hex Ristretto-encoded 32 bytes. Not every 32-byte string is valid ristretto encoding - */ - static fromHex(hex: Hex): RistPoint { - hex = ensureBytes('ristrettoHex', hex, 32); - const { a, d } = ed25519.CURVE; - const P = ed25519.CURVE.Fp.ORDER; - const mod = ed25519.CURVE.Fp.create; - const emsg = 'RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint'; - const s = bytes255ToNumberLE(hex); - // 1. Check that s_bytes is the canonical encoding of a field element, or else abort. - // 3. Check that s is non-negative, or else abort - if (!equalBytes(numberToBytesLE(s, 32), hex) || isNegativeLE(s, P)) throw new Error(emsg); - const s2 = mod(s * s); - const u1 = mod(_1n + a * s2); // 4 (a is -1) - const u2 = mod(_1n - a * s2); // 5 - const u1_2 = mod(u1 * u1); - const u2_2 = mod(u2 * u2); - const v = mod(a * d * u1_2 - u2_2); // 6 - const { isValid, value: I } = invertSqrt(mod(v * u2_2)); // 7 - const Dx = mod(I * u2); // 8 - const Dy = mod(I * Dx * v); // 9 - let x = mod((s + s) * Dx); // 10 - if (isNegativeLE(x, P)) x = mod(-x); // 10 - const y = mod(u1 * Dy); // 11 - const t = mod(x * y); // 12 - if (!isValid || isNegativeLE(t, P) || y === _0n) throw new Error(emsg); - return new RistPoint(new ed25519.ExtendedPoint(x, y, _1n, t)); - } - - /** - * Encodes ristretto point to Uint8Array. - * https://ristretto.group/formulas/encoding.html - */ - toRawBytes(): Uint8Array { - let { ex: x, ey: y, ez: z, et: t } = this.ep; - const P = ed25519.CURVE.Fp.ORDER; - const mod = ed25519.CURVE.Fp.create; - const u1 = mod(mod(z + y) * mod(z - y)); // 1 - const u2 = mod(x * y); // 2 - // Square root always exists - const u2sq = mod(u2 * u2); - const { value: invsqrt } = invertSqrt(mod(u1 * u2sq)); // 3 - const D1 = mod(invsqrt * u1); // 4 - const D2 = mod(invsqrt * u2); // 5 - const zInv = mod(D1 * D2 * t); // 6 - let D: bigint; // 7 - if (isNegativeLE(t * zInv, P)) { - let _x = mod(y * SQRT_M1); - let _y = mod(x * SQRT_M1); - x = _x; - y = _y; - D = mod(D1 * INVSQRT_A_MINUS_D); - } else { - D = D2; // 8 - } - if (isNegativeLE(x * zInv, P)) y = mod(-y); // 9 - let s = mod((z - y) * D); // 10 (check footer's note, no sqrt(-a)) - if (isNegativeLE(s, P)) s = mod(-s); - return numberToBytesLE(s, 32); // 11 - } - - toHex(): string { - return bytesToHex(this.toRawBytes()); - } - - toString(): string { - return this.toHex(); - } - - // Compare one point to another. - equals(other: RistPoint): boolean { - assertRstPoint(other); - const { ex: X1, ey: Y1 } = this.ep; - const { ex: X2, ey: Y2 } = other.ep; - const mod = ed25519.CURVE.Fp.create; - // (x1 * y2 == y1 * x2) | (y1 * y2 == x1 * x2) - const one = mod(X1 * Y2) === mod(Y1 * X2); - const two = mod(Y1 * Y2) === mod(X1 * X2); - return one || two; - } - - add(other: RistPoint): RistPoint { - assertRstPoint(other); - return new RistPoint(this.ep.add(other.ep)); - } - - subtract(other: RistPoint): RistPoint { - assertRstPoint(other); - return new RistPoint(this.ep.subtract(other.ep)); - } - - multiply(scalar: bigint): RistPoint { - return new RistPoint(this.ep.multiply(scalar)); - } - - multiplyUnsafe(scalar: bigint): RistPoint { - return new RistPoint(this.ep.multiplyUnsafe(scalar)); - } -} -export const RistrettoPoint = /* @__PURE__ */ (() => { - if (!RistPoint.BASE) RistPoint.BASE = new RistPoint(ed25519.ExtendedPoint.BASE); - if (!RistPoint.ZERO) RistPoint.ZERO = new RistPoint(ed25519.ExtendedPoint.ZERO); - return RistPoint; -})(); - -// Hashing to ristretto255. https://www.rfc-editor.org/rfc/rfc9380#appendix-B -export const hashToRistretto255 = (msg: Uint8Array, options: htfBasicOpts) => { - const d = options.DST; - const DST = typeof d === 'string' ? utf8ToBytes(d) : d; - const uniform_bytes = expand_message_xmd(msg, DST, 64, sha512); - const P = RistPoint.hashToCurve(uniform_bytes); - return P; -}; -export const hash_to_ristretto255 = hashToRistretto255; // legacy diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/ed448.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/ed448.ts deleted file mode 100644 index 0e5477a5..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/ed448.ts +++ /dev/null @@ -1,465 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { shake256 } from '@noble/hashes/sha3'; -import { concatBytes, randomBytes, utf8ToBytes, wrapConstructor } from '@noble/hashes/utils'; -import { ExtPointType, twistedEdwards } from './abstract/edwards.js'; -import { mod, pow2, Field, isNegativeLE } from './abstract/modular.js'; -import { montgomery } from './abstract/montgomery.js'; -import { createHasher, htfBasicOpts, expand_message_xof } from './abstract/hash-to-curve.js'; -import { - bytesToHex, - bytesToNumberLE, - ensureBytes, - equalBytes, - Hex, - numberToBytesLE, -} from './abstract/utils.js'; -import { AffinePoint } from './abstract/curve.js'; - -/** - * Edwards448 (not Ed448-Goldilocks) curve with following addons: - * - X448 ECDH - * - Decaf cofactor elimination - * - Elligator hash-to-group / point indistinguishability - * Conforms to RFC 8032 https://www.rfc-editor.org/rfc/rfc8032.html#section-5.2 - */ - -const shake256_114 = wrapConstructor(() => shake256.create({ dkLen: 114 })); -const shake256_64 = wrapConstructor(() => shake256.create({ dkLen: 64 })); -const ed448P = BigInt( - '726838724295606890549323807888004534353641360687318060281490199180612328166730772686396383698676545930088884461843637361053498018365439' -); - -// prettier-ignore -const _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = BigInt(4), _11n = BigInt(11); -// prettier-ignore -const _22n = BigInt(22), _44n = BigInt(44), _88n = BigInt(88), _223n = BigInt(223); - -// powPminus3div4 calculates z = x^k mod p, where k = (p-3)/4. -// Used for efficient square root calculation. -// ((P-3)/4).toString(2) would produce bits [223x 1, 0, 222x 1] -function ed448_pow_Pminus3div4(x: bigint): bigint { - const P = ed448P; - const b2 = (x * x * x) % P; - const b3 = (b2 * b2 * x) % P; - const b6 = (pow2(b3, _3n, P) * b3) % P; - const b9 = (pow2(b6, _3n, P) * b3) % P; - const b11 = (pow2(b9, _2n, P) * b2) % P; - const b22 = (pow2(b11, _11n, P) * b11) % P; - const b44 = (pow2(b22, _22n, P) * b22) % P; - const b88 = (pow2(b44, _44n, P) * b44) % P; - const b176 = (pow2(b88, _88n, P) * b88) % P; - const b220 = (pow2(b176, _44n, P) * b44) % P; - const b222 = (pow2(b220, _2n, P) * b2) % P; - const b223 = (pow2(b222, _1n, P) * x) % P; - return (pow2(b223, _223n, P) * b222) % P; -} - -function adjustScalarBytes(bytes: Uint8Array): Uint8Array { - // Section 5: Likewise, for X448, set the two least significant bits of the first byte to 0, and the most - // significant bit of the last byte to 1. - bytes[0] &= 252; // 0b11111100 - // and the most significant bit of the last byte to 1. - bytes[55] |= 128; // 0b10000000 - // NOTE: is is NOOP for 56 bytes scalars (X25519/X448) - bytes[56] = 0; // Byte outside of group (456 buts vs 448 bits) - return bytes; -} - -// Constant-time ratio of u to v. Allows to combine inversion and square root u/√v. -// Uses algo from RFC8032 5.1.3. -function uvRatio(u: bigint, v: bigint): { isValid: boolean; value: bigint } { - const P = ed448P; - // https://www.rfc-editor.org/rfc/rfc8032#section-5.2.3 - // To compute the square root of (u/v), the first step is to compute the - // candidate root x = (u/v)^((p+1)/4). This can be done using the - // following trick, to use a single modular powering for both the - // inversion of v and the square root: - // x = (u/v)^((p+1)/4) = u³v(u⁵v³)^((p-3)/4) (mod p) - const u2v = mod(u * u * v, P); // u²v - const u3v = mod(u2v * u, P); // u³v - const u5v3 = mod(u3v * u2v * v, P); // u⁵v³ - const root = ed448_pow_Pminus3div4(u5v3); - const x = mod(u3v * root, P); - // Verify that root is exists - const x2 = mod(x * x, P); // x² - // If vx² = u, the recovered x-coordinate is x. Otherwise, no - // square root exists, and the decoding fails. - return { isValid: mod(x2 * v, P) === u, value: x }; -} - -const Fp = Field(ed448P, 456, true); - -const ED448_DEF = { - // Param: a - a: BigInt(1), - // -39081. Negative number is P - number - d: BigInt( - '726838724295606890549323807888004534353641360687318060281490199180612328166730772686396383698676545930088884461843637361053498018326358' - ), - // Finite field 𝔽p over which we'll do calculations; 2n**448n - 2n**224n - 1n - Fp, - // Subgroup order: how many points curve has; - // 2n**446n - 13818066809895115352007386748515426880336692474882178609894547503885n - n: BigInt( - '181709681073901722637330951972001133588410340171829515070372549795146003961539585716195755291692375963310293709091662304773755859649779' - ), - nBitLength: 456, - // Cofactor - h: BigInt(4), - // Base point (x, y) aka generator point - Gx: BigInt( - '224580040295924300187604334099896036246789641632564134246125461686950415467406032909029192869357953282578032075146446173674602635247710' - ), - Gy: BigInt( - '298819210078481492676017930443930673437544040154080242095928241372331506189835876003536878655418784733982303233503462500531545062832660' - ), - // SHAKE256(dom4(phflag,context)||x, 114) - hash: shake256_114, - randomBytes, - adjustScalarBytes, - // dom4 - domain: (data: Uint8Array, ctx: Uint8Array, phflag: boolean) => { - if (ctx.length > 255) throw new Error(`Context is too big: ${ctx.length}`); - return concatBytes( - utf8ToBytes('SigEd448'), - new Uint8Array([phflag ? 1 : 0, ctx.length]), - ctx, - data - ); - }, - uvRatio, -} as const; - -export const ed448 = /* @__PURE__ */ twistedEdwards(ED448_DEF); -// NOTE: there is no ed448ctx, since ed448 supports ctx by default -export const ed448ph = /* @__PURE__ */ twistedEdwards({ ...ED448_DEF, prehash: shake256_64 }); - -export const x448 = /* @__PURE__ */ (() => - montgomery({ - a: BigInt(156326), - montgomeryBits: 448, - nByteLength: 57, - P: ed448P, - Gu: BigInt(5), - powPminus2: (x: bigint): bigint => { - const P = ed448P; - const Pminus3div4 = ed448_pow_Pminus3div4(x); - const Pminus3 = pow2(Pminus3div4, BigInt(2), P); - return mod(Pminus3 * x, P); // Pminus3 * x = Pminus2 - }, - adjustScalarBytes, - randomBytes, - }))(); - -/** - * Converts edwards448 public key to x448 public key. Uses formula: - * * `(u, v) = ((y-1)/(y+1), sqrt(156324)*u/x)` - * * `(x, y) = (sqrt(156324)*u/v, (1+u)/(1-u))` - * @example - * const aPub = ed448.getPublicKey(utils.randomPrivateKey()); - * x448.getSharedSecret(edwardsToMontgomery(aPub), edwardsToMontgomery(someonesPub)) - */ -export function edwardsToMontgomeryPub(edwardsPub: string | Uint8Array): Uint8Array { - const { y } = ed448.ExtendedPoint.fromHex(edwardsPub); - const _1n = BigInt(1); - return Fp.toBytes(Fp.create((y - _1n) * Fp.inv(y + _1n))); -} -export const edwardsToMontgomery = edwardsToMontgomeryPub; // deprecated - -// Hash To Curve Elligator2 Map -const ELL2_C1 = (Fp.ORDER - BigInt(3)) / BigInt(4); // 1. c1 = (q - 3) / 4 # Integer arithmetic -const ELL2_J = BigInt(156326); -function map_to_curve_elligator2_curve448(u: bigint) { - let tv1 = Fp.sqr(u); // 1. tv1 = u^2 - let e1 = Fp.eql(tv1, Fp.ONE); // 2. e1 = tv1 == 1 - tv1 = Fp.cmov(tv1, Fp.ZERO, e1); // 3. tv1 = CMOV(tv1, 0, e1) # If Z * u^2 == -1, set tv1 = 0 - let xd = Fp.sub(Fp.ONE, tv1); // 4. xd = 1 - tv1 - let x1n = Fp.neg(ELL2_J); // 5. x1n = -J - let tv2 = Fp.sqr(xd); // 6. tv2 = xd^2 - let gxd = Fp.mul(tv2, xd); // 7. gxd = tv2 * xd # gxd = xd^3 - let gx1 = Fp.mul(tv1, Fp.neg(ELL2_J)); // 8. gx1 = -J * tv1 # x1n + J * xd - gx1 = Fp.mul(gx1, x1n); // 9. gx1 = gx1 * x1n # x1n^2 + J * x1n * xd - gx1 = Fp.add(gx1, tv2); // 10. gx1 = gx1 + tv2 # x1n^2 + J * x1n * xd + xd^2 - gx1 = Fp.mul(gx1, x1n); // 11. gx1 = gx1 * x1n # x1n^3 + J * x1n^2 * xd + x1n * xd^2 - let tv3 = Fp.sqr(gxd); // 12. tv3 = gxd^2 - tv2 = Fp.mul(gx1, gxd); // 13. tv2 = gx1 * gxd # gx1 * gxd - tv3 = Fp.mul(tv3, tv2); // 14. tv3 = tv3 * tv2 # gx1 * gxd^3 - let y1 = Fp.pow(tv3, ELL2_C1); // 15. y1 = tv3^c1 # (gx1 * gxd^3)^((p - 3) / 4) - y1 = Fp.mul(y1, tv2); // 16. y1 = y1 * tv2 # gx1 * gxd * (gx1 * gxd^3)^((p - 3) / 4) - let x2n = Fp.mul(x1n, Fp.neg(tv1)); // 17. x2n = -tv1 * x1n # x2 = x2n / xd = -1 * u^2 * x1n / xd - let y2 = Fp.mul(y1, u); // 18. y2 = y1 * u - y2 = Fp.cmov(y2, Fp.ZERO, e1); // 19. y2 = CMOV(y2, 0, e1) - tv2 = Fp.sqr(y1); // 20. tv2 = y1^2 - tv2 = Fp.mul(tv2, gxd); // 21. tv2 = tv2 * gxd - let e2 = Fp.eql(tv2, gx1); // 22. e2 = tv2 == gx1 - let xn = Fp.cmov(x2n, x1n, e2); // 23. xn = CMOV(x2n, x1n, e2) # If e2, x = x1, else x = x2 - let y = Fp.cmov(y2, y1, e2); // 24. y = CMOV(y2, y1, e2) # If e2, y = y1, else y = y2 - let e3 = Fp.isOdd(y); // 25. e3 = sgn0(y) == 1 # Fix sign of y - y = Fp.cmov(y, Fp.neg(y), e2 !== e3); // 26. y = CMOV(y, -y, e2 XOR e3) - return { xn, xd, yn: y, yd: Fp.ONE }; // 27. return (xn, xd, y, 1) -} -function map_to_curve_elligator2_edwards448(u: bigint) { - let { xn, xd, yn, yd } = map_to_curve_elligator2_curve448(u); // 1. (xn, xd, yn, yd) = map_to_curve_elligator2_curve448(u) - let xn2 = Fp.sqr(xn); // 2. xn2 = xn^2 - let xd2 = Fp.sqr(xd); // 3. xd2 = xd^2 - let xd4 = Fp.sqr(xd2); // 4. xd4 = xd2^2 - let yn2 = Fp.sqr(yn); // 5. yn2 = yn^2 - let yd2 = Fp.sqr(yd); // 6. yd2 = yd^2 - let xEn = Fp.sub(xn2, xd2); // 7. xEn = xn2 - xd2 - let tv2 = Fp.sub(xEn, xd2); // 8. tv2 = xEn - xd2 - xEn = Fp.mul(xEn, xd2); // 9. xEn = xEn * xd2 - xEn = Fp.mul(xEn, yd); // 10. xEn = xEn * yd - xEn = Fp.mul(xEn, yn); // 11. xEn = xEn * yn - xEn = Fp.mul(xEn, _4n); // 12. xEn = xEn * 4 - tv2 = Fp.mul(tv2, xn2); // 13. tv2 = tv2 * xn2 - tv2 = Fp.mul(tv2, yd2); // 14. tv2 = tv2 * yd2 - let tv3 = Fp.mul(yn2, _4n); // 15. tv3 = 4 * yn2 - let tv1 = Fp.add(tv3, yd2); // 16. tv1 = tv3 + yd2 - tv1 = Fp.mul(tv1, xd4); // 17. tv1 = tv1 * xd4 - let xEd = Fp.add(tv1, tv2); // 18. xEd = tv1 + tv2 - tv2 = Fp.mul(tv2, xn); // 19. tv2 = tv2 * xn - let tv4 = Fp.mul(xn, xd4); // 20. tv4 = xn * xd4 - let yEn = Fp.sub(tv3, yd2); // 21. yEn = tv3 - yd2 - yEn = Fp.mul(yEn, tv4); // 22. yEn = yEn * tv4 - yEn = Fp.sub(yEn, tv2); // 23. yEn = yEn - tv2 - tv1 = Fp.add(xn2, xd2); // 24. tv1 = xn2 + xd2 - tv1 = Fp.mul(tv1, xd2); // 25. tv1 = tv1 * xd2 - tv1 = Fp.mul(tv1, xd); // 26. tv1 = tv1 * xd - tv1 = Fp.mul(tv1, yn2); // 27. tv1 = tv1 * yn2 - tv1 = Fp.mul(tv1, BigInt(-2)); // 28. tv1 = -2 * tv1 - let yEd = Fp.add(tv2, tv1); // 29. yEd = tv2 + tv1 - tv4 = Fp.mul(tv4, yd2); // 30. tv4 = tv4 * yd2 - yEd = Fp.add(yEd, tv4); // 31. yEd = yEd + tv4 - tv1 = Fp.mul(xEd, yEd); // 32. tv1 = xEd * yEd - let e = Fp.eql(tv1, Fp.ZERO); // 33. e = tv1 == 0 - xEn = Fp.cmov(xEn, Fp.ZERO, e); // 34. xEn = CMOV(xEn, 0, e) - xEd = Fp.cmov(xEd, Fp.ONE, e); // 35. xEd = CMOV(xEd, 1, e) - yEn = Fp.cmov(yEn, Fp.ONE, e); // 36. yEn = CMOV(yEn, 1, e) - yEd = Fp.cmov(yEd, Fp.ONE, e); // 37. yEd = CMOV(yEd, 1, e) - - const inv = Fp.invertBatch([xEd, yEd]); // batch division - return { x: Fp.mul(xEn, inv[0]), y: Fp.mul(yEn, inv[1]) }; // 38. return (xEn, xEd, yEn, yEd) -} - -const htf = /* @__PURE__ */ (() => - createHasher( - ed448.ExtendedPoint, - (scalars: bigint[]) => map_to_curve_elligator2_edwards448(scalars[0]), - { - DST: 'edwards448_XOF:SHAKE256_ELL2_RO_', - encodeDST: 'edwards448_XOF:SHAKE256_ELL2_NU_', - p: Fp.ORDER, - m: 1, - k: 224, - expand: 'xof', - hash: shake256, - } - ))(); -export const hashToCurve = /* @__PURE__ */ (() => htf.hashToCurve)(); -export const encodeToCurve = /* @__PURE__ */ (() => htf.encodeToCurve)(); - -function assertDcfPoint(other: unknown) { - if (!(other instanceof DcfPoint)) throw new Error('DecafPoint expected'); -} - -// 1-d -const ONE_MINUS_D = BigInt('39082'); -// 1-2d -const ONE_MINUS_TWO_D = BigInt('78163'); -// √(-d) -const SQRT_MINUS_D = BigInt( - '98944233647732219769177004876929019128417576295529901074099889598043702116001257856802131563896515373927712232092845883226922417596214' -); -// 1 / √(-d) -const INVSQRT_MINUS_D = BigInt( - '315019913931389607337177038330951043522456072897266928557328499619017160722351061360252776265186336876723201881398623946864393857820716' -); -// Calculates 1/√(number) -const invertSqrt = (number: bigint) => uvRatio(_1n, number); - -const MAX_448B = BigInt( - '0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff' -); -const bytes448ToNumberLE = (bytes: Uint8Array) => - ed448.CURVE.Fp.create(bytesToNumberLE(bytes) & MAX_448B); - -type ExtendedPoint = ExtPointType; - -// Computes Elligator map for Decaf -// https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-ristretto255-decaf448-07#name-element-derivation-2 -function calcElligatorDecafMap(r0: bigint): ExtendedPoint { - const { d } = ed448.CURVE; - const P = ed448.CURVE.Fp.ORDER; - const mod = ed448.CURVE.Fp.create; - - const r = mod(-(r0 * r0)); // 1 - const u0 = mod(d * (r - _1n)); // 2 - const u1 = mod((u0 + _1n) * (u0 - r)); // 3 - - const { isValid: was_square, value: v } = uvRatio(ONE_MINUS_TWO_D, mod((r + _1n) * u1)); // 4 - - let v_prime = v; // 5 - if (!was_square) v_prime = mod(r0 * v); - - let sgn = _1n; // 6 - if (!was_square) sgn = mod(-_1n); - - const s = mod(v_prime * (r + _1n)); // 7 - let s_abs = s; - if (isNegativeLE(s, P)) s_abs = mod(-s); - - const s2 = s * s; - const W0 = mod(s_abs * _2n); // 8 - const W1 = mod(s2 + _1n); // 9 - const W2 = mod(s2 - _1n); // 10 - const W3 = mod(v_prime * s * (r - _1n) * ONE_MINUS_TWO_D + sgn); // 11 - return new ed448.ExtendedPoint(mod(W0 * W3), mod(W2 * W1), mod(W1 * W3), mod(W0 * W2)); -} - -/** - * Each ed448/ExtendedPoint has 4 different equivalent points. This can be - * a source of bugs for protocols like ring signatures. Decaf was created to solve this. - * Decaf point operates in X:Y:Z:T extended coordinates like ExtendedPoint, - * but it should work in its own namespace: do not combine those two. - * https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-ristretto255-decaf448 - */ -class DcfPoint { - static BASE: DcfPoint; - static ZERO: DcfPoint; - // Private property to discourage combining ExtendedPoint + DecafPoint - // Always use Decaf encoding/decoding instead. - constructor(private readonly ep: ExtendedPoint) {} - - static fromAffine(ap: AffinePoint) { - return new DcfPoint(ed448.ExtendedPoint.fromAffine(ap)); - } - - /** - * Takes uniform output of 112-byte hash function like shake256 and converts it to `DecafPoint`. - * The hash-to-group operation applies Elligator twice and adds the results. - * **Note:** this is one-way map, there is no conversion from point to hash. - * https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-ristretto255-decaf448-07#name-element-derivation-2 - * @param hex 112-byte output of a hash function - */ - static hashToCurve(hex: Hex): DcfPoint { - hex = ensureBytes('decafHash', hex, 112); - const r1 = bytes448ToNumberLE(hex.slice(0, 56)); - const R1 = calcElligatorDecafMap(r1); - const r2 = bytes448ToNumberLE(hex.slice(56, 112)); - const R2 = calcElligatorDecafMap(r2); - return new DcfPoint(R1.add(R2)); - } - - /** - * Converts decaf-encoded string to decaf point. - * https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-ristretto255-decaf448-07#name-decode-2 - * @param hex Decaf-encoded 56 bytes. Not every 56-byte string is valid decaf encoding - */ - static fromHex(hex: Hex): DcfPoint { - hex = ensureBytes('decafHex', hex, 56); - const { d } = ed448.CURVE; - const P = ed448.CURVE.Fp.ORDER; - const mod = ed448.CURVE.Fp.create; - const emsg = 'DecafPoint.fromHex: the hex is not valid encoding of DecafPoint'; - const s = bytes448ToNumberLE(hex); - - // 1. Check that s_bytes is the canonical encoding of a field element, or else abort. - // 2. Check that s is non-negative, or else abort - if (!equalBytes(numberToBytesLE(s, 56), hex) || isNegativeLE(s, P)) throw new Error(emsg); - - const s2 = mod(s * s); // 1 - const u1 = mod(_1n + s2); // 2 - const u1sq = mod(u1 * u1); - const u2 = mod(u1sq - _4n * d * s2); // 3 - - const { isValid, value: invsqrt } = invertSqrt(mod(u2 * u1sq)); // 4 - - let u3 = mod((s + s) * invsqrt * u1 * SQRT_MINUS_D); // 5 - if (isNegativeLE(u3, P)) u3 = mod(-u3); - - const x = mod(u3 * invsqrt * u2 * INVSQRT_MINUS_D); // 6 - const y = mod((_1n - s2) * invsqrt * u1); // 7 - const t = mod(x * y); // 8 - - if (!isValid) throw new Error(emsg); - return new DcfPoint(new ed448.ExtendedPoint(x, y, _1n, t)); - } - - /** - * Encodes decaf point to Uint8Array. - * https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-ristretto255-decaf448-07#name-encode-2 - */ - toRawBytes(): Uint8Array { - let { ex: x, ey: _y, ez: z, et: t } = this.ep; - const P = ed448.CURVE.Fp.ORDER; - const mod = ed448.CURVE.Fp.create; - - const u1 = mod(mod(x + t) * mod(x - t)); // 1 - const x2 = mod(x * x); - const { value: invsqrt } = invertSqrt(mod(u1 * ONE_MINUS_D * x2)); // 2 - - let ratio = mod(invsqrt * u1 * SQRT_MINUS_D); // 3 - if (isNegativeLE(ratio, P)) ratio = mod(-ratio); - - const u2 = mod(INVSQRT_MINUS_D * ratio * z - t); // 4 - - let s = mod(ONE_MINUS_D * invsqrt * x * u2); // 5 - if (isNegativeLE(s, P)) s = mod(-s); - - return numberToBytesLE(s, 56); - } - - toHex(): string { - return bytesToHex(this.toRawBytes()); - } - - toString(): string { - return this.toHex(); - } - - // Compare one point to another. - // https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-ristretto255-decaf448-07#name-equals-2 - equals(other: DcfPoint): boolean { - assertDcfPoint(other); - const { ex: X1, ey: Y1 } = this.ep; - const { ex: X2, ey: Y2 } = other.ep; - const mod = ed448.CURVE.Fp.create; - // (x1 * y2 == y1 * x2) - return mod(X1 * Y2) === mod(Y1 * X2); - } - - add(other: DcfPoint): DcfPoint { - assertDcfPoint(other); - return new DcfPoint(this.ep.add(other.ep)); - } - - subtract(other: DcfPoint): DcfPoint { - assertDcfPoint(other); - return new DcfPoint(this.ep.subtract(other.ep)); - } - - multiply(scalar: bigint): DcfPoint { - return new DcfPoint(this.ep.multiply(scalar)); - } - - multiplyUnsafe(scalar: bigint): DcfPoint { - return new DcfPoint(this.ep.multiplyUnsafe(scalar)); - } -} -export const DecafPoint = /* @__PURE__ */ (() => { - // decaf448 base point is ed448 base x 2 - // https://github.com/dalek-cryptography/curve25519-dalek/blob/59837c6ecff02b77b9d5ff84dbc239d0cf33ef90/vendor/ristretto.sage#L699 - if (!DcfPoint.BASE) DcfPoint.BASE = new DcfPoint(ed448.ExtendedPoint.BASE).multiply(_2n); - if (!DcfPoint.ZERO) DcfPoint.ZERO = new DcfPoint(ed448.ExtendedPoint.ZERO); - return DcfPoint; -})(); - -// Hashing to decaf448. https://www.rfc-editor.org/rfc/rfc9380#appendix-C -export const hashToDecaf448 = (msg: Uint8Array, options: htfBasicOpts) => { - const d = options.DST; - const DST = typeof d === 'string' ? utf8ToBytes(d) : d; - const uniform_bytes = expand_message_xof(msg, DST, 112, 224, shake256); - const P = DcfPoint.hashToCurve(uniform_bytes); - return P; -}; -export const hash_to_decaf448 = hashToDecaf448; // legacy diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/index.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/index.ts deleted file mode 100644 index 0ffab527..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -throw new Error('Incorrect usage. Import submodules instead'); diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/jubjub.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/jubjub.ts deleted file mode 100644 index a600d3a2..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/jubjub.ts +++ /dev/null @@ -1,58 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { sha512 } from '@noble/hashes/sha512'; -import { concatBytes, randomBytes, utf8ToBytes } from '@noble/hashes/utils'; -import { twistedEdwards } from './abstract/edwards.js'; -import { blake2s } from '@noble/hashes/blake2s'; -import { Field } from './abstract/modular.js'; - -/** - * jubjub Twisted Edwards curve. - * https://neuromancer.sk/std/other/JubJub - * jubjub does not use EdDSA, so `hash`/sha512 params are passed because interface expects them. - */ - -export const jubjub = /* @__PURE__ */ twistedEdwards({ - // Params: a, d - a: BigInt('0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000000'), - d: BigInt('0x2a9318e74bfa2b48f5fd9207e6bd7fd4292d7f6d37579d2601065fd6d6343eb1'), - // Finite field 𝔽p over which we'll do calculations - // Same value as bls12-381 Fr (not Fp) - Fp: Field(BigInt('0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001')), - // Subgroup order: how many points curve has - n: BigInt('0xe7db4ea6533afa906673b0101343b00a6682093ccc81082d0970e5ed6f72cb7'), - // Cofactor - h: BigInt(8), - // Base point (x, y) aka generator point - Gx: BigInt('0x11dafe5d23e1218086a365b99fbf3d3be72f6afd7d1f72623e6b071492d1122b'), - Gy: BigInt('0x1d523cf1ddab1a1793132e78c866c0c33e26ba5cc220fed7cc3f870e59d292aa'), - hash: sha512, - randomBytes, -} as const); - -const GH_FIRST_BLOCK = utf8ToBytes( - '096b36a5804bfacef1691e173c366a47ff5ba84a44f26ddd7e8d9f79d5b42df0' -); - -// Returns point at JubJub curve which is prime order and not zero -export function groupHash(tag: Uint8Array, personalization: Uint8Array) { - const h = blake2s.create({ personalization, dkLen: 32 }); - h.update(GH_FIRST_BLOCK); - h.update(tag); - // NOTE: returns ExtendedPoint, in case it will be multiplied later - let p = jubjub.ExtendedPoint.fromHex(h.digest()); - // NOTE: cannot replace with isSmallOrder, returns Point*8 - p = p.multiply(jubjub.CURVE.h); - if (p.equals(jubjub.ExtendedPoint.ZERO)) throw new Error('Point has small order'); - return p; -} - -export function findGroupHash(m: Uint8Array, personalization: Uint8Array) { - const tag = concatBytes(m, new Uint8Array([0])); - for (let i = 0; i < 256; i++) { - tag[tag.length - 1] = i; - try { - return groupHash(tag, personalization); - } catch (e) {} - } - throw new Error('findGroupHash tag overflow'); -} diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/p256.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/p256.ts deleted file mode 100644 index 164c4706..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/p256.ts +++ /dev/null @@ -1,48 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { createCurve } from './_shortw_utils.js'; -import { sha256 } from '@noble/hashes/sha256'; -import { Field } from './abstract/modular.js'; -import { mapToCurveSimpleSWU } from './abstract/weierstrass.js'; -import { createHasher } from './abstract/hash-to-curve.js'; - -// NIST secp256r1 aka p256 -// https://www.secg.org/sec2-v2.pdf, https://neuromancer.sk/std/nist/P-256 - -const Fp = Field(BigInt('0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff')); -const CURVE_A = Fp.create(BigInt('-3')); -const CURVE_B = BigInt('0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b'); - -// prettier-ignore -export const p256 = createCurve({ - a: CURVE_A, // Equation params: a, b - b: CURVE_B, - Fp, // Field: 2n**224n * (2n**32n-1n) + 2n**192n + 2n**96n-1n - // Curve order, total count of valid points in the field - n: BigInt('0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551'), - // Base (generator) point (x, y) - Gx: BigInt('0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296'), - Gy: BigInt('0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5'), - h: BigInt(1), - lowS: false, -} as const, sha256); -export const secp256r1 = p256; - -const mapSWU = /* @__PURE__ */ (() => - mapToCurveSimpleSWU(Fp, { - A: CURVE_A, - B: CURVE_B, - Z: Fp.create(BigInt('-10')), - }))(); - -const htf = /* @__PURE__ */ (() => - createHasher(secp256r1.ProjectivePoint, (scalars: bigint[]) => mapSWU(scalars[0]), { - DST: 'P256_XMD:SHA-256_SSWU_RO_', - encodeDST: 'P256_XMD:SHA-256_SSWU_NU_', - p: Fp.ORDER, - m: 1, - k: 128, - expand: 'xmd', - hash: sha256, - }))(); -export const hashToCurve = /* @__PURE__ */ (() => htf.hashToCurve)(); -export const encodeToCurve = /* @__PURE__ */ (() => htf.encodeToCurve)(); diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/p384.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/p384.ts deleted file mode 100644 index 436de9bc..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/p384.ts +++ /dev/null @@ -1,52 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { createCurve } from './_shortw_utils.js'; -import { sha384 } from '@noble/hashes/sha512'; -import { Field } from './abstract/modular.js'; -import { mapToCurveSimpleSWU } from './abstract/weierstrass.js'; -import { createHasher } from './abstract/hash-to-curve.js'; - -// NIST secp384r1 aka p384 -// https://www.secg.org/sec2-v2.pdf, https://neuromancer.sk/std/nist/P-384 - -// Field over which we'll do calculations. -// prettier-ignore -const P = BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff'); -const Fp = Field(P); -const CURVE_A = Fp.create(BigInt('-3')); -// prettier-ignore -const CURVE_B = BigInt('0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef'); - -// prettier-ignore -export const p384 = createCurve({ - a: CURVE_A, // Equation params: a, b - b: CURVE_B, - Fp, // Field: 2n**384n - 2n**128n - 2n**96n + 2n**32n - 1n - // Curve order, total count of valid points in the field. - n: BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973'), - // Base (generator) point (x, y) - Gx: BigInt('0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7'), - Gy: BigInt('0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f'), - h: BigInt(1), - lowS: false, -} as const, sha384); -export const secp384r1 = p384; - -const mapSWU = /* @__PURE__ */ (() => - mapToCurveSimpleSWU(Fp, { - A: CURVE_A, - B: CURVE_B, - Z: Fp.create(BigInt('-12')), - }))(); - -const htf = /* @__PURE__ */ (() => - createHasher(secp384r1.ProjectivePoint, (scalars: bigint[]) => mapSWU(scalars[0]), { - DST: 'P384_XMD:SHA-384_SSWU_RO_', - encodeDST: 'P384_XMD:SHA-384_SSWU_NU_', - p: Fp.ORDER, - m: 1, - k: 192, - expand: 'xmd', - hash: sha384, - }))(); -export const hashToCurve = /* @__PURE__ */ (() => htf.hashToCurve)(); -export const encodeToCurve = /* @__PURE__ */ (() => htf.encodeToCurve)(); diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/p521.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/p521.ts deleted file mode 100644 index cc9fbbcb..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/p521.ts +++ /dev/null @@ -1,68 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { createCurve } from './_shortw_utils.js'; -import { sha512 } from '@noble/hashes/sha512'; -import { Field } from './abstract/modular.js'; -import { mapToCurveSimpleSWU } from './abstract/weierstrass.js'; -import { createHasher } from './abstract/hash-to-curve.js'; - -// NIST secp521r1 aka p521 -// Note that it's 521, which differs from 512 of its hash function. -// https://www.secg.org/sec2-v2.pdf, https://neuromancer.sk/std/nist/P-521 - -// Field over which we'll do calculations. -// prettier-ignore -const P = BigInt('0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'); -const Fp = Field(P); - -const CURVE = { - a: Fp.create(BigInt('-3')), - b: BigInt( - '0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00' - ), - Fp, - n: BigInt( - '0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409' - ), - Gx: BigInt( - '0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66' - ), - Gy: BigInt( - '0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650' - ), - h: BigInt(1), -}; - -// prettier-ignore -export const p521 = createCurve({ - a: CURVE.a, // Equation params: a, b - b: CURVE.b, - Fp, // Field: 2n**521n - 1n - // Curve order, total count of valid points in the field - n: CURVE.n, - Gx: CURVE.Gx, // Base point (x, y) aka generator point - Gy: CURVE.Gy, - h: CURVE.h, - lowS: false, - allowedPrivateKeyLengths: [130, 131, 132] // P521 keys are variable-length. Normalize to 132b -} as const, sha512); -export const secp521r1 = p521; - -const mapSWU = /* @__PURE__ */ (() => - mapToCurveSimpleSWU(Fp, { - A: CURVE.a, - B: CURVE.b, - Z: Fp.create(BigInt('-4')), - }))(); - -const htf = /* @__PURE__ */ (() => - createHasher(secp521r1.ProjectivePoint, (scalars: bigint[]) => mapSWU(scalars[0]), { - DST: 'P521_XMD:SHA-512_SSWU_RO_', - encodeDST: 'P521_XMD:SHA-512_SSWU_NU_', - p: Fp.ORDER, - m: 1, - k: 256, - expand: 'xmd', - hash: sha512, - }))(); -export const hashToCurve = /* @__PURE__ */ (() => htf.hashToCurve)(); -export const encodeToCurve = /* @__PURE__ */ (() => htf.encodeToCurve)(); diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/pasta.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/pasta.ts deleted file mode 100644 index faed89e9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/pasta.ts +++ /dev/null @@ -1,31 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { sha256 } from '@noble/hashes/sha256'; -import { weierstrass } from './abstract/weierstrass.js'; -import { getHash } from './_shortw_utils.js'; -import * as mod from './abstract/modular.js'; - -export const p = BigInt('0x40000000000000000000000000000000224698fc094cf91b992d30ed00000001'); -export const q = BigInt('0x40000000000000000000000000000000224698fc0994a8dd8c46eb2100000001'); - -// https://neuromancer.sk/std/other/Pallas -export const pallas = weierstrass({ - a: BigInt(0), - b: BigInt(5), - Fp: mod.Field(p), - n: q, - Gx: mod.mod(BigInt(-1), p), - Gy: BigInt(2), - h: BigInt(1), - ...getHash(sha256), -}); -// https://neuromancer.sk/std/other/Vesta -export const vesta = weierstrass({ - a: BigInt(0), - b: BigInt(5), - Fp: mod.Field(q), - n: p, - Gx: mod.mod(BigInt(-1), q), - Gy: BigInt(2), - h: BigInt(1), - ...getHash(sha256), -}); diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/secp256k1.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/secp256k1.ts deleted file mode 100644 index 7119222d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/curves/src/secp256k1.ts +++ /dev/null @@ -1,274 +0,0 @@ -/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -import { sha256 } from '@noble/hashes/sha256'; -import { randomBytes } from '@noble/hashes/utils'; -import { Field, mod, pow2 } from './abstract/modular.js'; -import { ProjPointType as PointType, mapToCurveSimpleSWU } from './abstract/weierstrass.js'; -import type { Hex, PrivKey } from './abstract/utils.js'; -import { bytesToNumberBE, concatBytes, ensureBytes, numberToBytesBE } from './abstract/utils.js'; -import { createHasher, isogenyMap } from './abstract/hash-to-curve.js'; -import { createCurve } from './_shortw_utils.js'; - -const secp256k1P = BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f'); -const secp256k1N = BigInt('0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141'); -const _1n = BigInt(1); -const _2n = BigInt(2); -const divNearest = (a: bigint, b: bigint) => (a + b / _2n) / b; - -/** - * √n = n^((p+1)/4) for fields p = 3 mod 4. We unwrap the loop and multiply bit-by-bit. - * (P+1n/4n).toString(2) would produce bits [223x 1, 0, 22x 1, 4x 0, 11, 00] - */ -function sqrtMod(y: bigint): bigint { - const P = secp256k1P; - // prettier-ignore - const _3n = BigInt(3), _6n = BigInt(6), _11n = BigInt(11), _22n = BigInt(22); - // prettier-ignore - const _23n = BigInt(23), _44n = BigInt(44), _88n = BigInt(88); - const b2 = (y * y * y) % P; // x^3, 11 - const b3 = (b2 * b2 * y) % P; // x^7 - const b6 = (pow2(b3, _3n, P) * b3) % P; - const b9 = (pow2(b6, _3n, P) * b3) % P; - const b11 = (pow2(b9, _2n, P) * b2) % P; - const b22 = (pow2(b11, _11n, P) * b11) % P; - const b44 = (pow2(b22, _22n, P) * b22) % P; - const b88 = (pow2(b44, _44n, P) * b44) % P; - const b176 = (pow2(b88, _88n, P) * b88) % P; - const b220 = (pow2(b176, _44n, P) * b44) % P; - const b223 = (pow2(b220, _3n, P) * b3) % P; - const t1 = (pow2(b223, _23n, P) * b22) % P; - const t2 = (pow2(t1, _6n, P) * b2) % P; - const root = pow2(t2, _2n, P); - if (!Fp.eql(Fp.sqr(root), y)) throw new Error('Cannot find square root'); - return root; -} - -const Fp = Field(secp256k1P, undefined, undefined, { sqrt: sqrtMod }); - -export const secp256k1 = createCurve( - { - a: BigInt(0), // equation params: a, b - b: BigInt(7), // Seem to be rigid: bitcointalk.org/index.php?topic=289795.msg3183975#msg3183975 - Fp, // Field's prime: 2n**256n - 2n**32n - 2n**9n - 2n**8n - 2n**7n - 2n**6n - 2n**4n - 1n - n: secp256k1N, // Curve order, total count of valid points in the field - // Base point (x, y) aka generator point - Gx: BigInt('55066263022277343669578718895168534326250603453777594175500187360389116729240'), - Gy: BigInt('32670510020758816978083085130507043184471273380659243275938904335757337482424'), - h: BigInt(1), // Cofactor - lowS: true, // Allow only low-S signatures by default in sign() and verify() - /** - * secp256k1 belongs to Koblitz curves: it has efficiently computable endomorphism. - * Endomorphism uses 2x less RAM, speeds up precomputation by 2x and ECDH / key recovery by 20%. - * For precomputed wNAF it trades off 1/2 init time & 1/3 ram for 20% perf hit. - * Explanation: https://gist.github.com/paulmillr/eb670806793e84df628a7c434a873066 - */ - endo: { - beta: BigInt('0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee'), - splitScalar: (k: bigint) => { - const n = secp256k1N; - const a1 = BigInt('0x3086d221a7d46bcde86c90e49284eb15'); - const b1 = -_1n * BigInt('0xe4437ed6010e88286f547fa90abfe4c3'); - const a2 = BigInt('0x114ca50f7a8e2f3f657c1108d9d44cfd8'); - const b2 = a1; - const POW_2_128 = BigInt('0x100000000000000000000000000000000'); // (2n**128n).toString(16) - - const c1 = divNearest(b2 * k, n); - const c2 = divNearest(-b1 * k, n); - let k1 = mod(k - c1 * a1 - c2 * a2, n); - let k2 = mod(-c1 * b1 - c2 * b2, n); - const k1neg = k1 > POW_2_128; - const k2neg = k2 > POW_2_128; - if (k1neg) k1 = n - k1; - if (k2neg) k2 = n - k2; - if (k1 > POW_2_128 || k2 > POW_2_128) { - throw new Error('splitScalar: Endomorphism failed, k=' + k); - } - return { k1neg, k1, k2neg, k2 }; - }, - }, - }, - sha256 -); - -// Schnorr signatures are superior to ECDSA from above. Below is Schnorr-specific BIP0340 code. -// https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki -const _0n = BigInt(0); -const fe = (x: bigint) => typeof x === 'bigint' && _0n < x && x < secp256k1P; -const ge = (x: bigint) => typeof x === 'bigint' && _0n < x && x < secp256k1N; -/** An object mapping tags to their tagged hash prefix of [SHA256(tag) | SHA256(tag)] */ -const TAGGED_HASH_PREFIXES: { [tag: string]: Uint8Array } = {}; -function taggedHash(tag: string, ...messages: Uint8Array[]): Uint8Array { - let tagP = TAGGED_HASH_PREFIXES[tag]; - if (tagP === undefined) { - const tagH = sha256(Uint8Array.from(tag, (c) => c.charCodeAt(0))); - tagP = concatBytes(tagH, tagH); - TAGGED_HASH_PREFIXES[tag] = tagP; - } - return sha256(concatBytes(tagP, ...messages)); -} - -// ECDSA compact points are 33-byte. Schnorr is 32: we strip first byte 0x02 or 0x03 -const pointToBytes = (point: PointType) => point.toRawBytes(true).slice(1); -const numTo32b = (n: bigint) => numberToBytesBE(n, 32); -const modP = (x: bigint) => mod(x, secp256k1P); -const modN = (x: bigint) => mod(x, secp256k1N); -const Point = secp256k1.ProjectivePoint; -const GmulAdd = (Q: PointType, a: bigint, b: bigint) => - Point.BASE.multiplyAndAddUnsafe(Q, a, b); - -// Calculate point, scalar and bytes -function schnorrGetExtPubKey(priv: PrivKey) { - let d_ = secp256k1.utils.normPrivateKeyToScalar(priv); // same method executed in fromPrivateKey - let p = Point.fromPrivateKey(d_); // P = d'⋅G; 0 < d' < n check is done inside - const scalar = p.hasEvenY() ? d_ : modN(-d_); - return { scalar: scalar, bytes: pointToBytes(p) }; -} -/** - * lift_x from BIP340. Convert 32-byte x coordinate to elliptic curve point. - * @returns valid point checked for being on-curve - */ -function lift_x(x: bigint): PointType { - if (!fe(x)) throw new Error('bad x: need 0 < x < p'); // Fail if x ≥ p. - const xx = modP(x * x); - const c = modP(xx * x + BigInt(7)); // Let c = x³ + 7 mod p. - let y = sqrtMod(c); // Let y = c^(p+1)/4 mod p. - if (y % _2n !== _0n) y = modP(-y); // Return the unique point P such that x(P) = x and - const p = new Point(x, y, _1n); // y(P) = y if y mod 2 = 0 or y(P) = p-y otherwise. - p.assertValidity(); - return p; -} -/** - * Create tagged hash, convert it to bigint, reduce modulo-n. - */ -function challenge(...args: Uint8Array[]): bigint { - return modN(bytesToNumberBE(taggedHash('BIP0340/challenge', ...args))); -} - -/** - * Schnorr public key is just `x` coordinate of Point as per BIP340. - */ -function schnorrGetPublicKey(privateKey: Hex): Uint8Array { - return schnorrGetExtPubKey(privateKey).bytes; // d'=int(sk). Fail if d'=0 or d'≥n. Ret bytes(d'⋅G) -} - -/** - * Creates Schnorr signature as per BIP340. Verifies itself before returning anything. - * auxRand is optional and is not the sole source of k generation: bad CSPRNG won't be dangerous. - */ -function schnorrSign( - message: Hex, - privateKey: PrivKey, - auxRand: Hex = randomBytes(32) -): Uint8Array { - const m = ensureBytes('message', message); - const { bytes: px, scalar: d } = schnorrGetExtPubKey(privateKey); // checks for isWithinCurveOrder - const a = ensureBytes('auxRand', auxRand, 32); // Auxiliary random data a: a 32-byte array - const t = numTo32b(d ^ bytesToNumberBE(taggedHash('BIP0340/aux', a))); // Let t be the byte-wise xor of bytes(d) and hash/aux(a) - const rand = taggedHash('BIP0340/nonce', t, px, m); // Let rand = hash/nonce(t || bytes(P) || m) - const k_ = modN(bytesToNumberBE(rand)); // Let k' = int(rand) mod n - if (k_ === _0n) throw new Error('sign failed: k is zero'); // Fail if k' = 0. - const { bytes: rx, scalar: k } = schnorrGetExtPubKey(k_); // Let R = k'⋅G. - const e = challenge(rx, px, m); // Let e = int(hash/challenge(bytes(R) || bytes(P) || m)) mod n. - const sig = new Uint8Array(64); // Let sig = bytes(R) || bytes((k + ed) mod n). - sig.set(rx, 0); - sig.set(numTo32b(modN(k + e * d)), 32); - // If Verify(bytes(P), m, sig) (see below) returns failure, abort - if (!schnorrVerify(sig, m, px)) throw new Error('sign: Invalid signature produced'); - return sig; -} - -/** - * Verifies Schnorr signature. - * Will swallow errors & return false except for initial type validation of arguments. - */ -function schnorrVerify(signature: Hex, message: Hex, publicKey: Hex): boolean { - const sig = ensureBytes('signature', signature, 64); - const m = ensureBytes('message', message); - const pub = ensureBytes('publicKey', publicKey, 32); - try { - const P = lift_x(bytesToNumberBE(pub)); // P = lift_x(int(pk)); fail if that fails - const r = bytesToNumberBE(sig.subarray(0, 32)); // Let r = int(sig[0:32]); fail if r ≥ p. - if (!fe(r)) return false; - const s = bytesToNumberBE(sig.subarray(32, 64)); // Let s = int(sig[32:64]); fail if s ≥ n. - if (!ge(s)) return false; - const e = challenge(numTo32b(r), pointToBytes(P), m); // int(challenge(bytes(r)||bytes(P)||m))%n - const R = GmulAdd(P, s, modN(-e)); // R = s⋅G - e⋅P - if (!R || !R.hasEvenY() || R.toAffine().x !== r) return false; // -eP == (n-e)P - return true; // Fail if is_infinite(R) / not has_even_y(R) / x(R) ≠ r. - } catch (error) { - return false; - } -} - -export const schnorr = /* @__PURE__ */ (() => ({ - getPublicKey: schnorrGetPublicKey, - sign: schnorrSign, - verify: schnorrVerify, - utils: { - randomPrivateKey: secp256k1.utils.randomPrivateKey, - lift_x, - pointToBytes, - numberToBytesBE, - bytesToNumberBE, - taggedHash, - mod, - }, -}))(); - -const isoMap = /* @__PURE__ */ (() => - isogenyMap( - Fp, - [ - // xNum - [ - '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7', - '0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581', - '0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262', - '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c', - ], - // xDen - [ - '0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b', - '0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14', - '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1 - ], - // yNum - [ - '0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c', - '0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3', - '0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931', - '0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84', - ], - // yDen - [ - '0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b', - '0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573', - '0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f', - '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1 - ], - ].map((i) => i.map((j) => BigInt(j))) as [bigint[], bigint[], bigint[], bigint[]] - ))(); -const mapSWU = /* @__PURE__ */ (() => - mapToCurveSimpleSWU(Fp, { - A: BigInt('0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533'), - B: BigInt('1771'), - Z: Fp.create(BigInt('-11')), - }))(); -const htf = /* @__PURE__ */ (() => - createHasher( - secp256k1.ProjectivePoint, - (scalars: bigint[]) => { - const { x, y } = mapSWU(Fp.create(scalars[0])); - return isoMap(x, y); - }, - { - DST: 'secp256k1_XMD:SHA-256_SSWU_RO_', - encodeDST: 'secp256k1_XMD:SHA-256_SSWU_NU_', - p: Fp.ORDER, - m: 1, - k: 128, - expand: 'xmd', - hash: sha256, - } - ))(); -export const hashToCurve = /* @__PURE__ */ (() => htf.hashToCurve)(); -export const encodeToCurve = /* @__PURE__ */ (() => htf.encodeToCurve)(); diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/LICENSE b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/LICENSE deleted file mode 100644 index 9297a046..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2022 Paul Miller (https://paulmillr.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the “Software”), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/README.md b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/README.md deleted file mode 100644 index 6f71600a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/README.md +++ /dev/null @@ -1,534 +0,0 @@ -# noble-hashes - -Audited & minimal JS implementation of SHA2, SHA3, RIPEMD, BLAKE2/3, HMAC, HKDF, PBKDF2 & Scrypt. - -- 🔒 [**Audited**](#security) by an independent security firm -- 🔻 Tree-shaking-friendly: use only what's necessary, other code won't be included -- 🏎 Ultra-fast, hand-optimized for caveats of JS engines -- 🔍 Unique tests ensure correctness: chained tests, sliding window tests, DoS tests, fuzzing -- 🔁 No unrolled loops: makes it easier to verify and reduces source code size up to 5x -- 🐢 Scrypt supports `N: 2**22`, while other implementations are limited to `2**20` -- 🦘 SHA3 supports Keccak, TupleHash, KangarooTwelve and MarsupilamiFourteen -- 🪶 Just 3.4k lines / 17KB gzipped. SHA256-only is 240 lines / 3KB gzipped - -The library's initial development was funded by [Ethereum Foundation](https://ethereum.org/). - -### This library belongs to _noble_ crypto - -> **noble-crypto** — high-security, easily auditable set of contained cryptographic libraries and tools. - -- No dependencies, protection against supply chain attacks -- Auditable TypeScript / JS code -- Supported on all major platforms -- Releases are signed with PGP keys and built transparently with NPM provenance -- Check out [homepage](https://paulmillr.com/noble/) & all libraries: - [ciphers](https://github.com/paulmillr/noble-ciphers), - [curves](https://github.com/paulmillr/noble-curves), - [hashes](https://github.com/paulmillr/noble-hashes), - 4kb [secp256k1](https://github.com/paulmillr/noble-secp256k1) / - [ed25519](https://github.com/paulmillr/noble-ed25519) - -## Usage - -> npm install @noble/hashes - -We support all major platforms and runtimes. -For [Deno](https://deno.land), ensure to use [npm specifier](https://deno.land/manual@v1.28.0/node/npm_specifiers). -For React Native, you may need a [polyfill for getRandomValues](https://github.com/LinusU/react-native-get-random-values). -If you don't like NPM, a standalone [noble-hashes.js](https://github.com/paulmillr/noble-hashes/releases) is also available. - -```js -// import * from '@noble/hashes'; // Error: use sub-imports, to ensure small app size -import { sha256 } from '@noble/hashes/sha256'; // ECMAScript modules (ESM) and Common.js -// import { sha256 } from 'npm:@noble/hashes@1.3.0/sha256'; // Deno -console.log(sha256(new Uint8Array([1, 2, 3]))); // Uint8Array(32) [3, 144, 88, 198, 242...] -// you could also pass strings that will be UTF8-encoded to Uint8Array -console.log(sha256('abc')); // == sha256(new TextEncoder().encode('abc')) - -// sha384 is here, because it uses same internals as sha512 -import { sha512, sha512_256, sha384 } from '@noble/hashes/sha512'; -// prettier-ignore -import { - sha3_224, sha3_256, sha3_384, sha3_512, - keccak_224, keccak_256, keccak_384, keccak_512, - shake128, shake256 -} from '@noble/hashes/sha3'; -// prettier-ignore -import { - cshake128, cshake256, kmac128, kmac256, - k12, m14, - tuplehash256, parallelhash256, keccakprg -} from '@noble/hashes/sha3-addons'; -import { ripemd160 } from '@noble/hashes/ripemd160'; -import { blake3 } from '@noble/hashes/blake3'; -import { blake2b } from '@noble/hashes/blake2b'; -import { blake2s } from '@noble/hashes/blake2s'; -import { hmac } from '@noble/hashes/hmac'; -import { hkdf } from '@noble/hashes/hkdf'; -import { pbkdf2, pbkdf2Async } from '@noble/hashes/pbkdf2'; -import { scrypt, scryptAsync } from '@noble/hashes/scrypt'; - -import { sha1 } from '@noble/hashes/sha1'; // legacy - -// small utility method that converts bytes to hex -import { bytesToHex as toHex } from '@noble/hashes/utils'; -console.log(toHex(sha256('abc'))); // ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad -``` - -## API - -All hash functions: - -- can be called directly, with `Uint8Array`. -- return `Uint8Array` -- can receive `string`, which is automatically converted to `Uint8Array` - via utf8 encoding **(not hex)** -- support hashing 4GB of data per update on 64-bit systems (unlimited with streaming) - -```ts -function hash(message: Uint8Array | string): Uint8Array; -hash(new Uint8Array([1, 3])); -hash('string') == hash(new TextEncoder().encode('string')); -``` - -All hash functions can be constructed via `hash.create()` method: - -- the result is `Hash` subclass instance, which has `update()` and `digest()` methods -- `digest()` finalizes the hash and makes it no longer usable - -```ts -hash - .create() - .update(new Uint8Array([1, 3])) - .digest(); -``` - -_Some_ hash functions can also receive `options` object, which can be either passed as a: - -- second argument to hash function: `blake3('abc', { key: 'd', dkLen: 32 })` -- first argument to class initializer: `blake3.create({ context: 'e', dkLen: 32 })` - -## Modules - -- [SHA2 (sha256, sha384, sha512, sha512_256)](#sha2-sha256-sha384-sha512-sha512_256) -- [SHA3 (FIPS, SHAKE, Keccak)](#sha3-fips-shake-keccak) -- [SHA3 Addons (cSHAKE, KMAC, KangarooTwelve, MarsupilamiFourteen)](#sha3-addons-cshake-kmac-tuplehash-parallelhash-kangarootwelve-marsupilamifourteen) -- [RIPEMD-160](#ripemd-160) -- [BLAKE2b, BLAKE2s](#blake2b-blake2s) -- [BLAKE3](#blake3) -- [SHA1 (legacy)](#sha1-legacy) -- [HMAC](#hmac) -- [HKDF](#hkdf) -- [PBKDF2](#pbkdf2) -- [Scrypt](#scrypt) -- [ESKDF](#eskdf) -- [utils](#utils) - -##### SHA2 (sha256, sha384, sha512, sha512_256) - -```typescript -import { sha256 } from '@noble/hashes/sha256'; -const h1a = sha256('abc'); -const h1b = sha256 - .create() - .update(Uint8Array.from([1, 2, 3])) - .digest(); -``` - -```typescript -import { sha512 } from '@noble/hashes/sha512'; -const h2a = sha512('abc'); -const h2b = sha512 - .create() - .update(Uint8Array.from([1, 2, 3])) - .digest(); - -// SHA512/256 variant -import { sha512_256 } from '@noble/hashes/sha512'; -const h3a = sha512_256('abc'); -const h3b = sha512_256 - .create() - .update(Uint8Array.from([1, 2, 3])) - .digest(); - -// SHA384 -import { sha384 } from '@noble/hashes/sha512'; -const h4a = sha384('abc'); -const h4b = sha384 - .create() - .update(Uint8Array.from([1, 2, 3])) - .digest(); -``` - -See [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and -[the paper on SHA512/256](https://eprint.iacr.org/2010/548.pdf). - -##### SHA3 (FIPS, SHAKE, Keccak) - -```typescript -import { - sha3_224, - sha3_256, - sha3_384, - sha3_512, - keccak_224, - keccak_256, - keccak_384, - keccak_512, - shake128, - shake256, -} from '@noble/hashes/sha3'; -const h5a = sha3_256('abc'); -const h5b = sha3_256 - .create() - .update(Uint8Array.from([1, 2, 3])) - .digest(); -const h6a = keccak_256('abc'); -const h7a = shake128('abc', { dkLen: 512 }); -const h7b = shake256('abc', { dkLen: 512 }); -``` - -See [FIPS PUB 202](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf), -[Website](https://keccak.team/keccak.html). - -Check out [the differences between SHA-3 and Keccak](https://crypto.stackexchange.com/questions/15727/what-are-the-key-differences-between-the-draft-sha-3-standard-and-the-keccak-sub) - -##### SHA3 Addons (cSHAKE, KMAC, TupleHash, ParallelHash, KangarooTwelve, MarsupilamiFourteen) - -```typescript -import { - cshake128, - cshake256, - kmac128, - kmac256, - k12, - m14, - tuplehash128, - tuplehash256, - parallelhash128, - parallelhash256, - keccakprg, -} from '@noble/hashes/sha3-addons'; -const h7c = cshake128('abc', { personalization: 'def' }); -const h7d = cshake256('abc', { personalization: 'def' }); -const h7e = kmac128('key', 'message'); -const h7f = kmac256('key', 'message'); -const h7h = k12('abc'); -const h7g = m14('abc'); -const h7i = tuplehash128(['ab', 'c']); // tuplehash(['ab', 'c']) !== tuplehash(['a', 'bc']) !== tuplehash(['abc']) -// Same as k12/blake3, but without reduced number of rounds. Doesn't speedup anything due lack of SIMD and threading, -// added for compatibility. -const h7j = parallelhash128('abc', { blockLen: 8 }); -// pseudo-random generator, first argument is capacity. XKCP recommends 254 bits capacity for 128-bit security strength. -// * with a capacity of 254 bits. -const p = keccakprg(254); -p.feed('test'); -const rand1b = p.fetch(1); -``` - -- Full [NIST SP 800-185](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-185.pdf): - cSHAKE, KMAC, TupleHash, ParallelHash + XOF variants -- 🦘 K12 ([KangarooTwelve Paper](https://keccak.team/files/KangarooTwelve.pdf), - [RFC Draft](https://www.ietf.org/archive/id/draft-irtf-cfrg-kangarootwelve-06.txt)) - and M14 aka MarsupilamiFourteen are basically parallel versions of Keccak with - reduced number of rounds (same as Blake3 and ParallelHash). -- [KeccakPRG](https://keccak.team/files/CSF-0.1.pdf): Pseudo-random generator based on Keccak - -##### RIPEMD-160 - -```typescript -import { ripemd160 } from '@noble/hashes/ripemd160'; -// function ripemd160(data: Uint8Array): Uint8Array; -const hash8 = ripemd160('abc'); -const hash9 = ripemd160() - .create() - .update(Uint8Array.from([1, 2, 3])) - .digest(); -``` - -See [RFC 2286](https://datatracker.ietf.org/doc/html/rfc2286), -[Website](https://homes.esat.kuleuven.be/~bosselae/ripemd160.html) - -##### BLAKE2b, BLAKE2s - -```typescript -import { blake2b } from '@noble/hashes/blake2b'; -import { blake2s } from '@noble/hashes/blake2s'; -const h10a = blake2s('abc'); -const b2params = { key: new Uint8Array([1]), personalization: t, salt: t, dkLen: 32 }; -const h10b = blake2s('abc', b2params); -const h10c = blake2s - .create(b2params) - .update(Uint8Array.from([1, 2, 3])) - .digest(); -``` - -See [RFC 7693](https://datatracker.ietf.org/doc/html/rfc7693), [Website](https://www.blake2.net). - -##### BLAKE3 - -```typescript -import { blake3 } from '@noble/hashes/blake3'; -// All params are optional -const h11 = blake3('abc', { dkLen: 256, key: 'def', context: 'fji' }); -``` - -##### SHA1 (legacy) - -SHA1 was cryptographically broken, however, it was not broken for cases like HMAC. - -See [RFC4226 B.2](https://datatracker.ietf.org/doc/html/rfc4226#appendix-B.2). - -Don't use it for a new protocol. - -```typescript -import { sha1 } from '@noble/hashes/sha1'; -const h12 = sha1('def'); -``` - -##### HMAC - -```typescript -import { hmac } from '@noble/hashes/hmac'; -import { sha256 } from '@noble/hashes/sha256'; -const mac1 = hmac(sha256, 'key', 'message'); -const mac2 = hmac.create(sha256, Uint8Array.from([1, 2, 3])).update(Uint8Array.from([4, 5, 6])).digest(); -``` - -Matches [RFC 2104](https://datatracker.ietf.org/doc/html/rfc2104). - -##### HKDF - -```typescript -import { hkdf } from '@noble/hashes/hkdf'; -import { sha256 } from '@noble/hashes/sha256'; -import { randomBytes } from '@noble/hashes/utils'; -const inputKey = randomBytes(32); -const salt = randomBytes(32); -const info = 'abc'; -const dkLen = 32; -const hk1 = hkdf(sha256, inputKey, salt, info, dkLen); - -// == same as -import * as hkdf from '@noble/hashes/hkdf'; -import { sha256 } from '@noble/hashes/sha256'; -const prk = hkdf.extract(sha256, inputKey, salt); -const hk2 = hkdf.expand(sha256, prk, info, dkLen); -``` - -Matches [RFC 5869](https://datatracker.ietf.org/doc/html/rfc5869). - -##### PBKDF2 - -```typescript -import { pbkdf2, pbkdf2Async } from '@noble/hashes/pbkdf2'; -import { sha256 } from '@noble/hashes/sha256'; -const pbkey1 = pbkdf2(sha256, 'password', 'salt', { c: 32, dkLen: 32 }); -const pbkey2 = await pbkdf2Async(sha256, 'password', 'salt', { c: 32, dkLen: 32 }); -const pbkey3 = await pbkdf2Async(sha256, Uint8Array.from([1, 2, 3]), Uint8Array.from([4, 5, 6]), { - c: 32, - dkLen: 32, -}); -``` - -Matches [RFC 2898](https://datatracker.ietf.org/doc/html/rfc2898). - -##### Scrypt - -```typescript -import { scrypt, scryptAsync } from '@noble/hashes/scrypt'; -const scr1 = scrypt('password', 'salt', { N: 2 ** 16, r: 8, p: 1, dkLen: 32 }); -const scr2 = await scryptAsync('password', 'salt', { N: 2 ** 16, r: 8, p: 1, dkLen: 32 }); -const scr3 = await scryptAsync(Uint8Array.from([1, 2, 3]), Uint8Array.from([4, 5, 6]), { - N: 2 ** 22, - r: 8, - p: 1, - dkLen: 32, - onProgress(percentage) { - console.log('progress', percentage); - }, - maxmem: 2 ** 32 + 128 * 8 * 1, // N * r * p * 128 + (128*r*p) -}); -``` - -Conforms to [RFC 7914](https://datatracker.ietf.org/doc/html/rfc7914), -[Website](https://www.tarsnap.com/scrypt.html) - -- `N, r, p` are work factors. To understand them, see [the blog post](https://blog.filippo.io/the-scrypt-parameters/). -- `dkLen` is the length of output bytes -- It is common to use N from `2**10` to `2**22` and `{r: 8, p: 1, dkLen: 32}` -- `onProgress` can be used with async version of the function to report progress to a user. - -Memory usage of scrypt is calculated with the formula `N * r * p * 128 + (128 * r * p)`, -which means `{N: 2 ** 22, r: 8, p: 1}` will use 4GB + 1KB of memory. To prevent -DoS, we limit scrypt to `1GB + 1KB` of RAM used, which corresponds to -`{N: 2 ** 20, r: 8, p: 1}`. If you want to use higher values, increase -`maxmem` using the formula above. - -_Note:_ noble supports `2**22` (4GB RAM) which is the highest amount amongst JS -libs. Many other implementations don't support it. We cannot support `2**23`, -because there is a limitation in JS engines that makes allocating -arrays bigger than 4GB impossible, but we're looking into other possible solutions. - -##### Argon2 - -Experimental Argon2 RFC 9106 implementation. It may be removed at any time. - -```ts -import { argon2d, argon2i, argon2id } from '@noble/hashes/argon2'; -const result = argon2id('password', 'salt', { t: 2, m: 65536, p: 1 }); -``` - -##### ESKDF - -A tiny stretched KDF for various applications like AES key-gen. Takes >= 2 seconds to execute. - -Takes following params: - -- `username` - username, email, or identifier, min: 8 characters, should have enough entropy -- `password` - min: 8 characters, should have enough entropy - -Produces ESKDF instance that has `deriveChildKey(protocol, accountId[, options])` function. - -- `protocol` - 3-15 character protocol name -- `accountId` - numeric identifier of account -- `options` - `keyLength: 32` with specified key length (default is 32), - or `modulus: 2n ** 221n - 17n` with specified modulus. It will fetch modulus + 64 bits of - data, execute modular division. The result will have negligible bias as per FIPS 186 B.4.1. - Can be used to generate, for example, elliptic curve keys. - -Takes username and password, then takes protocol name and account id. - -```typescript -import { eskdf } from '@noble/hashes/eskdf'; -const kdf = await eskdf('example@university', 'beginning-new-example'); -console.log(kdf.fingerprint); -const key1 = kdf.deriveChildKey('aes', 0); -const key2 = kdf.deriveChildKey('aes', 0, { keyLength: 16 }); -const ecc1 = kdf.deriveChildKey('ecc', 0, { modulus: 2n ** 252n - 27742317777372353535851937790883648493n }) -kdf.expire(); -``` - -##### utils - -```typescript -import { bytesToHex as toHex, randomBytes } from '@noble/hashes/utils'; -console.log(toHex(randomBytes(32))); -``` - -- `bytesToHex` will convert `Uint8Array` to a hex string -- `randomBytes(bytes)` will produce cryptographically secure random `Uint8Array` of length `bytes` - -## Security - -Noble is production-ready. - -1. The library has been audited in Jan 2022 by an independent security firm - cure53: [PDF](https://cure53.de/pentest-report_hashing-libs.pdf). - No vulnerabilities have been found. The audit has been funded by - [Ethereum Foundation](https://ethereum.org/en/) with help of [Nomic Labs](https://nomiclabs.io). - Modules `blake3`, `sha3-addons`, `sha1` and `argon2` have not been audited. - See [changes since audit](https://github.com/paulmillr/noble-hashes/compare/1.0.0..main). -2. The library has been fuzzed by [Guido Vranken's cryptofuzz](https://github.com/guidovranken/cryptofuzz). - You can run the fuzzer by yourself to check it. -3. [Timing attack](https://en.wikipedia.org/wiki/Timing_attack) considerations: - _JIT-compiler_ and _Garbage Collector_ make "constant time" extremely hard to - achieve in a scripting language. Which means _any other JS library can't have constant-timeness_. - Even statically typed Rust, a language without GC, - [makes it harder to achieve constant-time](https://www.chosenplaintext.ca/open-source/rust-timing-shield/security) - for some cases. If your goal is absolute security, don't use any JS lib — including - bindings to native ones. Use low-level libraries & languages. Nonetheless we're - targetting algorithmic constant time. -4. Memory dump considerations: the library shares state buffers between hash - function calls. The buffers are zeroed-out after each call. However, if an attacker - can read application memory, you are doomed in any case: - - At some point, input will be a string and strings are immutable in JS: - there is no way to overwrite them with zeros. For example: deriving - key from `scrypt(password, salt)` where password and salt are strings - - Input from a file will stay in file buffers - - Input / output will be re-used multiple times in application which means - it could stay in memory - - `await anything()` will always write all internal variables (including numbers) - to memory. With async functions / Promises there are no guarantees when the code - chunk would be executed. Which means attacker can have plenty of time to read data from memory - - There is no way to guarantee anything about zeroing sensitive data without - complex tests-suite which will dump process memory and verify that there is - no sensitive data left. For JS it means testing all browsers (incl. mobile), - which is complex. And of course it will be useless without using the same - test-suite in the actual application that consumes the library - -We consider infrastructure attacks like rogue NPM modules very important; that's -why it's crucial to minimize the amount of 3rd-party dependencies & native bindings. -If your app uses 500 dependencies, any dep could get hacked and you'll be downloading -malware with every `npm install`. Our goal is to minimize this attack vector. - -## Speed - -Benchmarks measured on Apple M1 with macOS 12. -Note that PBKDF2 and Scrypt are tested with extremely high work factor. -To run benchmarks, execute `npm run bench:install` and then `npm run bench` - -``` -SHA256 32B x 1,219,512 ops/sec @ 820ns/op ± 2.58% (min: 625ns, max: 4ms) -SHA384 32B x 512,032 ops/sec @ 1μs/op -SHA512 32B x 509,943 ops/sec @ 1μs/op -SHA3-256, keccak256, shake256 32B x 199,600 ops/sec @ 5μs/op -Kangaroo12 32B x 336,360 ops/sec @ 2μs/op -Marsupilami14 32B x 298,418 ops/sec @ 3μs/op -BLAKE2b 32B x 379,794 ops/sec @ 2μs/op -BLAKE2s 32B x 515,995 ops/sec @ 1μs/op ± 1.07% (min: 1μs, max: 4ms) -BLAKE3 32B x 588,235 ops/sec @ 1μs/op ± 1.36% (min: 1μs, max: 5ms) -RIPEMD160 32B x 1,140,250 ops/sec @ 877ns/op ± 3.12% (min: 708ns, max: 6ms) -HMAC-SHA256 32B x 377,358 ops/sec @ 2μs/op - -HKDF-SHA256 32B x 108,377 ops/sec @ 9μs/op -PBKDF2-HMAC-SHA256 262144 x 3 ops/sec @ 326ms/op -PBKDF2-HMAC-SHA512 262144 x 1 ops/sec @ 970ms/op -Scrypt r: 8, p: 1, n: 262144 x 1 ops/sec @ 616ms/op -``` - -Compare to native node.js implementation that uses C bindings instead of pure-js code: - -``` -SHA256 32B node x 1,302,083 ops/sec @ 768ns/op ± 10.54% (min: 416ns, max: 7ms) -SHA384 32B node x 975,609 ops/sec @ 1μs/op ± 11.32% (min: 625ns, max: 8ms) -SHA512 32B node x 983,284 ops/sec @ 1μs/op ± 11.24% (min: 625ns, max: 8ms) -SHA3-256 32B node x 910,746 ops/sec @ 1μs/op ± 12.19% (min: 666ns, max: 10ms) -keccak, k12, m14 are not implemented -BLAKE2b 32B node x 967,117 ops/sec @ 1μs/op ± 11.26% (min: 625ns, max: 9ms) -BLAKE2s 32B node x 1,055,966 ops/sec @ 947ns/op ± 11.07% (min: 583ns, max: 7ms) -BLAKE3 is not implemented -RIPEMD160 32B node x 1,002,004 ops/sec @ 998ns/op ± 10.66% (min: 625ns, max: 7ms) -HMAC-SHA256 32B node x 919,963 ops/sec @ 1μs/op ± 6.13% (min: 833ns, max: 5ms) -HKDF-SHA256 32 node x 369,276 ops/sec @ 2μs/op ± 13.59% (min: 1μs, max: 9ms) -PBKDF2-HMAC-SHA256 262144 node x 25 ops/sec @ 39ms/op -PBKDF2-HMAC-SHA512 262144 node x 7 ops/sec @ 132ms/op -Scrypt r: 8, p: 1, n: 262144 node x 1 ops/sec @ 523ms/op -``` - -It is possible to [make this library 4x+ faster](./benchmark/README.md) by -_doing code generation of full loop unrolls_. We've decided against it. Reasons: - -- the library must be auditable, with minimum amount of code, and zero dependencies -- most method invocations with the lib are going to be something like hashing 32b to 64kb of data -- hashing big inputs is 10x faster with low-level languages, which means you should probably pick 'em instead - -The current performance is good enough when compared to other projects; SHA256 takes only 900 nanoseconds to run. - -## Contributing & testing - -1. Clone the repository -2. `npm install` to install build dependencies like TypeScript -3. `npm run build` to compile TypeScript code -4. `npm run test` will execute all main tests. See [our approach to testing](./test/README.md) -5. `npm run test:dos` will test against DoS; by measuring function complexity. **Takes ~20 minutes** -6. `npm run test:big` will execute hashing on 4GB inputs, - scrypt with 1024 different `N, r, p` combinations, etc. **Takes several hours**. Using 8-32+ core CPU helps. - -## License - -The MIT License (MIT) - -Copyright (c) 2022 Paul Miller [(https://paulmillr.com)](https://paulmillr.com) - -See LICENSE file. diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_assert.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_assert.d.ts deleted file mode 100644 index 32a720bb..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_assert.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -declare function number(n: number): void; -declare function bool(b: boolean): void; -declare function bytes(b: Uint8Array | undefined, ...lengths: number[]): void; -type Hash = { - (data: Uint8Array): Uint8Array; - blockLen: number; - outputLen: number; - create: any; -}; -declare function hash(hash: Hash): void; -declare function exists(instance: any, checkFinished?: boolean): void; -declare function output(out: any, instance: any): void; -export { number, bool, bytes, hash, exists, output }; -declare const assert: { - number: typeof number; - bool: typeof bool; - bytes: typeof bytes; - hash: typeof hash; - exists: typeof exists; - output: typeof output; -}; -export default assert; diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_assert.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_assert.js deleted file mode 100644 index 920cdd99..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_assert.js +++ /dev/null @@ -1,45 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.output = exports.exists = exports.hash = exports.bytes = exports.bool = exports.number = void 0; -function number(n) { - if (!Number.isSafeInteger(n) || n < 0) - throw new Error(`Wrong positive integer: ${n}`); -} -exports.number = number; -function bool(b) { - if (typeof b !== 'boolean') - throw new Error(`Expected boolean, not ${b}`); -} -exports.bool = bool; -function bytes(b, ...lengths) { - if (!(b instanceof Uint8Array)) - throw new Error('Expected Uint8Array'); - if (lengths.length > 0 && !lengths.includes(b.length)) - throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`); -} -exports.bytes = bytes; -function hash(hash) { - if (typeof hash !== 'function' || typeof hash.create !== 'function') - throw new Error('Hash should be wrapped by utils.wrapConstructor'); - number(hash.outputLen); - number(hash.blockLen); -} -exports.hash = hash; -function exists(instance, checkFinished = true) { - if (instance.destroyed) - throw new Error('Hash instance has been destroyed'); - if (checkFinished && instance.finished) - throw new Error('Hash#digest() has already been called'); -} -exports.exists = exists; -function output(out, instance) { - bytes(out); - const min = instance.outputLen; - if (out.length < min) { - throw new Error(`digestInto() expects output buffer of length at least ${min}`); - } -} -exports.output = output; -const assert = { number, bool, bytes, hash, exists, output }; -exports.default = assert; -//# sourceMappingURL=_assert.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_assert.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_assert.js.map deleted file mode 100644 index f3cc5159..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_assert.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_assert.js","sourceRoot":"","sources":["src/_assert.ts"],"names":[],"mappings":";;;AAAA,SAAS,MAAM,CAAC,CAAS;IACvB,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,EAAE,CAAC,CAAC;AACzF,CAAC;AAqCQ,wBAAM;AAnCf,SAAS,IAAI,CAAC,CAAU;IACtB,IAAI,OAAO,CAAC,KAAK,SAAS;QAAE,MAAM,IAAI,K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ACjF;AACH,CAAC;AAE2C,wBAAM;AAElD,MAAM,MAAM,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAC7D,kBAAe,MAAM,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_blake2.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_blake2.d.ts deleted file mode 100644 index 352b978a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_blake2.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { Hash, Input } from './utils.js'; -export declare const SIGMA: Uint8Array; -export type BlakeOpts = { - dkLen?: number; - key?: Input; - salt?: Input; - personalization?: Input; -}; -export declare abstract class BLAKE2> extends Hash { - readonly blockLen: number; - outputLen: number; - protected abstract compress(msg: Uint32Array, offset: number, isLast: boolean): void; - protected abstract get(): number[]; - protected abstract set(...args: number[]): void; - abstract destroy(): void; - protected buffer: Uint8Array; - protected buffer32: Uint32Array; - protected length: number; - protected pos: number; - protected finished: boolean; - protected destroyed: boolean; - constructor(blockLen: number, outputLen: number, opts: BlakeOpts | undefined, keyLen: number, saltLen: number, persLen: number); - update(data: Input): this; - digestInto(out: Uint8Array): void; - digest(): Uint8Array; - _cloneInto(to?: T): T; -} diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_blake2.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_blake2.js deleted file mode 100644 index 9a5a45d8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_blake2.js +++ /dev/null @@ -1,112 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.BLAKE2 = exports.SIGMA = void 0; -const _assert_js_1 = require("./_assert.js"); -const utils_js_1 = require("./utils.js"); -// Blake is based on ChaCha permutation. -// For BLAKE2b, the two extra permutations for rounds 10 and 11 are SIGMA[10..11] = SIGMA[0..1]. -// prettier-ignore -exports.SIGMA = new Uint8Array([ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3, - 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4, - 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8, - 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13, - 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9, - 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11, - 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10, - 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5, - 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3, -]); -class BLAKE2 extends utils_js_1.Hash { - constructor(blockLen, outputLen, opts = {}, keyLen, saltLen, persLen) { - super(); - this.blockLen = blockLen; - this.outputLen = outputLen; - this.length = 0; - this.pos = 0; - this.finished = false; - this.destroyed = false; - (0, _assert_js_1.number)(blockLen); - (0, _assert_js_1.number)(outputLen); - (0, _assert_js_1.number)(keyLen); - if (outputLen < 0 || outputLen > keyLen) - throw new Error('outputLen bigger than keyLen'); - if (opts.key !== undefined && (opts.key.length < 1 || opts.key.length > keyLen)) - throw new Error(`key must be up 1..${keyLen} byte long or undefined`); - if (opts.salt !== undefined && opts.salt.length !== saltLen) - throw new Error(`salt must be ${saltLen} byte long or undefined`); - if (opts.personalization !== undefined && opts.personalization.length !== persLen) - throw new Error(`personalization must be ${persLen} byte long or undefined`); - this.buffer32 = (0, utils_js_1.u32)((this.buffer = new Uint8Array(blockLen))); - } - update(data) { - (0, _assert_js_1.exists)(this); - // Main difference with other hashes: there is flag for last block, - // so we cannot process current block before we know that there - // is the next one. This significantly complicates logic and reduces ability - // to do zero-copy processing - const { blockLen, buffer, buffer32 } = this; - data = (0, utils_js_1.toBytes)(data); - const len = data.length; - const offset = data.byteOffset; - const buf = data.buffer; - for (let pos = 0; pos < len;) { - // If buffer is full and we still have input (don't process last block, same as blake2s) - if (this.pos === blockLen) { - this.compress(buffer32, 0, false); - this.pos = 0; - } - const take = Math.min(blockLen - this.pos, len - pos); - const dataOffset = offset + pos; - // full block && aligned to 4 bytes && not last in input - if (take === blockLen && !(dataOffset % 4) && pos + take < len) { - const data32 = new Uint32Array(buf, dataOffset, Math.floor((len - pos) / 4)); - for (let pos32 = 0; pos + blockLen < len; pos32 += buffer32.length, pos += blockLen) { - this.length += blockLen; - this.compress(data32, pos32, false); - } - continue; - } - buffer.set(data.subarray(pos, pos + take), this.pos); - this.pos += take; - this.length += take; - pos += take; - } - return this; - } - digestInto(out) { - (0, _assert_js_1.exists)(this); - (0, _assert_js_1.output)(out, this); - const { pos, buffer32 } = this; - this.finished = true; - // Padding - this.buffer.subarray(pos).fill(0); - this.compress(buffer32, 0, true); - const out32 = (0, utils_js_1.u32)(out); - this.get().forEach((v, i) => (out32[i] = v)); - } - digest() { - const { buffer, outputLen } = this; - this.digestInto(buffer); - const res = buffer.slice(0, outputLen); - this.destroy(); - return res; - } - _cloneInto(to) { - const { buffer, length, finished, destroyed, outputLen, pos } = this; - to || (to = new this.constructor({ dkLen: outputLen })); - to.set(...this.get()); - to.length = length; - to.finished = finished; - to.destroyed = destroyed; - to.outputLen = outputLen; - to.buffer.set(buffer); - to.pos = pos; - return to; - } -} -exports.BLAKE2 = BLAKE2; -//# sourceMappingURL=_blake2.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_blake2.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_blake2.js.map deleted file mode 100644 index 85cf0b6d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_blake2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_blake2.js","sourceRoot":"","sources":["src/_blake2.ts"],"names":[],"mappings":";;;AAAA,6CAAsD;AACtD,yCAAuD;AAEvD,wCAAwC;AAExC,gGAAgG;AAChG,kBAAkB;AACL,QAAA,KAAK,GAAmB,IAAI,UAAU,CAAC;IAClD,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;IACpD,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;IACpD,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;IACpD,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;IACpD,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,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AAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC/C,CAAC;IACD,MAAM;QACJ,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;QACnC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACxB,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;QACvC,IAAI,CAAC,OAAO,EAAE,CAAC;QACf,OAAO,GAAG,CAAC;IACb,CAAC;IACD,UAAU,CAAC,EAAM;QACf,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;QACrE,EAAE,KAAF,EAAE,GAAK,IAAK,IAAI,CAAC,WAAmB,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAM,EAAC;QAChE,EAAE,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QACtB,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC;QACnB,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACvB,EAAE,CAAC,SAAS,GAAG,SAAS,CAAC;QACzB,EAAE,CAAC,SAAS,GAAG,SAAS,CAAC;QACzB,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACtB,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC;QACb,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;AAlGD,wBAkGC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_sha2.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_sha2.d.ts deleted file mode 100644 index 883788fd..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_sha2.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Hash, Input } from './utils.js'; -export declare abstract class SHA2> extends Hash { - readonly blockLen: number; - outputLen: number; - readonly padOffset: number; - readonly isLE: boolean; - protected abstract process(buf: DataView, offset: number): void; - protected abstract get(): number[]; - protected abstract set(...args: number[]): void; - abstract destroy(): void; - protected abstract roundClean(): void; - protected buffer: Uint8Array; - protected view: DataView; - protected finished: boolean; - protected length: number; - protected pos: number; - protected destroyed: boolean; - constructor(blockLen: number, outputLen: number, padOffset: number, isLE: boolean); - update(data: Input): this; - digestInto(out: Uint8Array): void; - digest(): Uint8Array; - _cloneInto(to?: T): T; -} diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_sha2.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_sha2.js deleted file mode 100644 index 7a45349e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_sha2.js +++ /dev/null @@ -1,118 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.SHA2 = void 0; -const _assert_js_1 = require("./_assert.js"); -const utils_js_1 = require("./utils.js"); -// Polyfill for Safari 14 -function setBigUint64(view, byteOffset, value, isLE) { - if (typeof view.setBigUint64 === 'function') - return view.setBigUint64(byteOffset, value, isLE); - const _32n = BigInt(32); - const _u32_max = BigInt(0xffffffff); - const wh = Number((value >> _32n) & _u32_max); - const wl = Number(value & _u32_max); - const h = isLE ? 4 : 0; - const l = isLE ? 0 : 4; - view.setUint32(byteOffset + h, wh, isLE); - view.setUint32(byteOffset + l, wl, isLE); -} -// Base SHA2 class (RFC 6234) -class SHA2 extends utils_js_1.Hash { - constructor(blockLen, outputLen, padOffset, isLE) { - super(); - this.blockLen = blockLen; - this.outputLen = outputLen; - this.padOffset = padOffset; - this.isLE = isLE; - this.finished = false; - this.length = 0; - this.pos = 0; - this.destroyed = false; - this.buffer = new Uint8Array(blockLen); - this.view = (0, utils_js_1.createView)(this.buffer); - } - update(data) { - (0, _assert_js_1.exists)(this); - const { view, buffer, blockLen } = this; - data = (0, utils_js_1.toBytes)(data); - const len = data.length; - for (let pos = 0; pos < len;) { - const take = Math.min(blockLen - this.pos, len - pos); - // Fast path: we have at least one block in input, cast it to view and process - if (take === blockLen) { - const dataView = (0, utils_js_1.createView)(data); - for (; blockLen <= len - pos; pos += blockLen) - this.process(dataView, pos); - continue; - } - buffer.set(data.subarray(pos, pos + take), this.pos); - this.pos += take; - pos += take; - if (this.pos === blockLen) { - this.process(view, 0); - this.pos = 0; - } - } - this.length += data.length; - this.roundClean(); - return this; - } - digestInto(out) { - (0, _assert_js_1.exists)(this); - (0, _assert_js_1.output)(out, this); - this.finished = true; - // Padding - // We can avoid allocation of buffer for padding completely if it - // was previously not allocated here. But it won't change performance. - const { buffer, view, blockLen, isLE } = this; - let { pos } = this; - // append the bit '1' to the message - buffer[pos++] = 0b10000000; - this.buffer.subarray(pos).fill(0); - // we have less than padOffset left in buffer, so we cannot put length in current block, need process it and pad again - if (this.padOffset > blockLen - pos) { - this.process(view, 0); - pos = 0; - } - // Pad until full block byte with zeros - for (let i = pos; i < blockLen; i++) - buffer[i] = 0; - // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that - // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen. - // So we just write lowest 64 bits of that value. - setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE); - this.process(view, 0); - const oview = (0, utils_js_1.createView)(out); - const len = this.outputLen; - // NOTE: we do division by 4 later, which should be fused in single op with modulo by JIT - if (len % 4) - throw new Error('_sha2: outputLen should be aligned to 32bit'); - const outLen = len / 4; - const state = this.get(); - if (outLen > state.length) - throw new Error('_sha2: outputLen bigger than state'); - for (let i = 0; i < outLen; i++) - oview.setUint32(4 * i, state[i], isLE); - } - digest() { - const { buffer, outputLen } = this; - this.digestInto(buffer); - const res = buffer.slice(0, outputLen); - this.destroy(); - return res; - } - _cloneInto(to) { - to || (to = new this.constructor()); - to.set(...this.get()); - const { blockLen, buffer, length, finished, destroyed, pos } = this; - to.length = length; - to.pos = pos; - to.finished = finished; - to.destroyed = destroyed; - if (length % blockLen) - to.buffer.set(buffer); - return to; - } -} -exports.SHA2 = SHA2; -//# sourceMappingURL=_sha2.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_sha2.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_sha2.js.map deleted file mode 100644 index 9c9c8eb3..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_sha2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_sha2.js","sourceRoot":"","sources":["src/_sha2.ts"],"names":[],"mappings":";;;AAAA,6CAA8C;AAC9C,yCAA8D;AAE9D,yBAAyB;AACzB,SAAS,YAAY,CAAC,IAAc,EAAE,UAAkB,EAAE,KAAa,EAAE,IAAa;IACpF,IAAI,OAAO,IAAI,CAAC,YAAY,KAAK,UAAU;QAAE,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IAC/F,MAAM,IAAI,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;IACxB,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;IACpC,MAAM,EAAE,GAAG,MAAM,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC;IAC9C,MAAM,EAAE,GAAG,MAAM,CAAC,KAAK,GAAG,QAAQ,CAAC,CAAC;IACpC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACvB,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACvB,IAAI,CAAC,SAAS,CAAC,UAAU,GAAG,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;IACzC,IAAI,CAAC,SAAS,CAAC,UAAU,GAAG,CAAC,EAAE,EAAE,EAAE,IAAI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,IAAK,IAAI,CAAC,WAAmB,EAAO,EAAC;QAC5C,EAAE,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QACtB,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;QACpE,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC;QACnB,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC;QACb,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACvB,EAAE,CAAC,SAAS,GAAG,SAAS,CAAC;QACzB,IAAI,MAAM,GAAG,QAAQ;YAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC7C,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;AApGD,oBAoGC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_u64.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_u64.d.ts deleted file mode 100644 index 59fd1c28..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_u64.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -declare function fromBig(n: bigint, le?: boolean): { - h: number; - l: number; -}; -declare function split(lst: bigint[], le?: boolean): Uint32Array[]; -declare const toBig: (h: number, l: number) => bigint; -declare const shrSH: (h: number, _l: number, s: number) => number; -declare const shrSL: (h: number, l: number, s: number) => number; -declare const rotrSH: (h: number, l: number, s: number) => number; -declare const rotrSL: (h: number, l: number, s: number) => number; -declare const rotrBH: (h: number, l: number, s: number) => number; -declare const rotrBL: (h: number, l: number, s: number) => number; -declare const rotr32H: (_h: number, l: number) => number; -declare const rotr32L: (h: number, _l: number) => number; -declare const rotlSH: (h: number, l: number, s: number) => number; -declare const rotlSL: (h: number, l: number, s: number) => number; -declare const rotlBH: (h: number, l: number, s: number) => number; -declare const rotlBL: (h: number, l: number, s: number) => number; -declare function add(Ah: number, Al: number, Bh: number, Bl: number): { - h: number; - l: number; -}; -declare const add3L: (Al: number, Bl: number, Cl: number) => number; -declare const add3H: (low: number, Ah: number, Bh: number, Ch: number) => number; -declare const add4L: (Al: number, Bl: number, Cl: number, Dl: number) => number; -declare const add4H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number) => number; -declare const add5L: (Al: number, Bl: number, Cl: number, Dl: number, El: number) => number; -declare const add5H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number, Eh: number) => number; -export { fromBig, split, toBig, shrSH, shrSL, rotrSH, rotrSL, rotrBH, rotrBL, rotr32H, rotr32L, rotlSH, rotlSL, rotlBH, rotlBL, add, add3L, add3H, add4L, add4H, add5H, add5L, }; -declare const u64: { - fromBig: typeof fromBig; - split: typeof split; - toBig: (h: number, l: number) => bigint; - shrSH: (h: number, _l: number, s: number) => number; - shrSL: (h: number, l: number, s: number) => number; - rotrSH: (h: number, l: number, s: number) => number; - rotrSL: (h: number, l: number, s: number) => number; - rotrBH: (h: number, l: number, s: number) => number; - rotrBL: (h: number, l: number, s: number) => number; - rotr32H: (_h: number, l: number) => number; - rotr32L: (h: number, _l: number) => number; - rotlSH: (h: number, l: number, s: number) => number; - rotlSL: (h: number, l: number, s: number) => number; - rotlBH: (h: number, l: number, s: number) => number; - rotlBL: (h: number, l: number, s: number) => number; - add: typeof add; - add3L: (Al: number, Bl: number, Cl: number) => number; - add3H: (low: number, Ah: number, Bh: number, Ch: number) => number; - add4L: (Al: number, Bl: number, Cl: number, Dl: number) => number; - add4H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number) => number; - add5H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number, Eh: number) => number; - add5L: (Al: number, Bl: number, Cl: number, Dl: number, El: number) => number; -}; -export default u64; diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_u64.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_u64.js deleted file mode 100644 index c5080f0e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_u64.js +++ /dev/null @@ -1,85 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.add5L = exports.add5H = exports.add4H = exports.add4L = exports.add3H = exports.add3L = exports.add = exports.rotlBL = exports.rotlBH = exports.rotlSL = exports.rotlSH = exports.rotr32L = exports.rotr32H = exports.rotrBL = exports.rotrBH = exports.rotrSL = exports.rotrSH = exports.shrSL = exports.shrSH = exports.toBig = exports.split = exports.fromBig = void 0; -const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1); -const _32n = /* @__PURE__ */ BigInt(32); -// We are not using BigUint64Array, because they are extremely slow as per 2022 -function fromBig(n, le = false) { - if (le) - return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) }; - return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 }; -} -exports.fromBig = fromBig; -function split(lst, le = false) { - let Ah = new Uint32Array(lst.length); - let Al = new Uint32Array(lst.length); - for (let i = 0; i < lst.length; i++) { - const { h, l } = fromBig(lst[i], le); - [Ah[i], Al[i]] = [h, l]; - } - return [Ah, Al]; -} -exports.split = split; -const toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0); -exports.toBig = toBig; -// for Shift in [0, 32) -const shrSH = (h, _l, s) => h >>> s; -exports.shrSH = shrSH; -const shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); -exports.shrSL = shrSL; -// Right rotate for Shift in [1, 32) -const rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s)); -exports.rotrSH = rotrSH; -const rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); -exports.rotrSL = rotrSL; -// Right rotate for Shift in (32, 64), NOTE: 32 is special case. -const rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32)); -exports.rotrBH = rotrBH; -const rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s)); -exports.rotrBL = rotrBL; -// Right rotate for shift===32 (just swaps l&h) -const rotr32H = (_h, l) => l; -exports.rotr32H = rotr32H; -const rotr32L = (h, _l) => h; -exports.rotr32L = rotr32L; -// Left rotate for Shift in [1, 32) -const rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s)); -exports.rotlSH = rotlSH; -const rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s)); -exports.rotlSL = rotlSL; -// Left rotate for Shift in (32, 64), NOTE: 32 is special case. -const rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s)); -exports.rotlBH = rotlBH; -const rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s)); -exports.rotlBL = rotlBL; -// JS uses 32-bit signed integers for bitwise operations which means we cannot -// simple take carry out of low bit sum by shift, we need to use division. -function add(Ah, Al, Bh, Bl) { - const l = (Al >>> 0) + (Bl >>> 0); - return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 }; -} -exports.add = add; -// Addition with more than 2 elements -const add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); -exports.add3L = add3L; -const add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0; -exports.add3H = add3H; -const add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); -exports.add4L = add4L; -const add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0; -exports.add4H = add4H; -const add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); -exports.add5L = add5L; -const add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0; -exports.add5H = add5H; -// prettier-ignore -const u64 = { - fromBig, split, toBig, - shrSH, shrSL, - rotrSH, rotrSL, rotrBH, rotrBL, - rotr32H, rotr32L, - rotlSH, rotlSL, rotlBH, rotlBL, - add, add3L, add3H, add4L, add4H, add5H, add5L, -}; -exports.default = u64; -//# sourceMappingURL=_u64.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_u64.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_u64.js.map deleted file mode 100644 index 6116a39a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/_u64.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_u64.js","sourceRoot":"","sources":["src/_u64.ts"],"names":[],"mappings":";;;AAAA,MAAM,UAAU,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;AACvD,MAAM,IAAI,GAAG,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAExC,+EAA+E;AAC/E,SAAS,OAAO,CAAC,CAAS,EAAE,EAAE,GAAG,KAAK;IACpC,IAAI,EAAE;QAAE,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,UAAU,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,UAAU,CAAC,EAAE,CAAC;IAClF,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;AACpF,CAAC;AAqDC,0BAAO;AAnDT,SAAS,KAAK,CAAC,GAAa,EAAE,EAAE,GAAG,KAAK;IACtC,IAAI,EAAE,GAAG,IAAI,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACrC,IAAI,EAAE,GAAG,IAAI,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,C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M;IAC9B,OAAO,EAAE,OAAO;IAChB,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAC9B,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;CAC9C,CAAC;AACF,kBAAe,GAAG,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/argon2.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/argon2.d.ts deleted file mode 100644 index 15b64865..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/argon2.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Input } from './utils.js'; -export type ArgonOpts = { - t: number; - m: number; - p: number; - version?: number; - key?: Input; - personalization?: Input; - dkLen?: number; - asyncTick?: number; - maxmem?: number; - onProgress?: (progress: number) => void; -}; -export declare const argon2d: (password: Input, salt: Input, opts: ArgonOpts) => Uint8Array; -export declare const argon2i: (password: Input, salt: Input, opts: ArgonOpts) => Uint8Array; -export declare const argon2id: (password: Input, salt: Input, opts: ArgonOpts) => Uint8Array; diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/argon2.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/argon2.js deleted file mode 100644 index 2754f8c6..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/argon2.js +++ /dev/null @@ -1,303 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.argon2id = exports.argon2i = exports.argon2d = void 0; -const _assert_js_1 = require("./_assert.js"); -const utils_js_1 = require("./utils.js"); -const blake2b_js_1 = require("./blake2b.js"); -const _u64_js_1 = require("./_u64.js"); -const ARGON2_SYNC_POINTS = 4; -const toBytesOptional = (buf) => (buf !== undefined ? (0, utils_js_1.toBytes)(buf) : new Uint8Array([])); -function mul(a, b) { - const aL = a & 0xffff; - const aH = a >>> 16; - const bL = b & 0xffff; - const bH = b >>> 16; - const ll = Math.imul(aL, bL); - const hl = Math.imul(aH, bL); - const lh = Math.imul(aL, bH); - const hh = Math.imul(aH, bH); - const BUF = ((ll >>> 16) + (hl & 0xffff) + lh) | 0; - const h = ((hl >>> 16) + (BUF >>> 16) + hh) | 0; - return { h, l: (BUF << 16) | (ll & 0xffff) }; -} -function relPos(areaSize, relativePos) { - // areaSize - 1 - ((areaSize * ((relativePos ** 2) >>> 32)) >>> 32) - return areaSize - 1 - mul(areaSize, mul(relativePos, relativePos).h).h; -} -function mul2(a, b) { - // 2 * a * b (via shifts) - const { h, l } = mul(a, b); - return { h: ((h << 1) | (l >>> 31)) & 4294967295, l: (l << 1) & 4294967295 }; -} -function blamka(Ah, Al, Bh, Bl) { - const { h: Ch, l: Cl } = mul2(Al, Bl); - // A + B + (2 * A * B) - const Rll = (0, _u64_js_1.add3L)(Al, Bl, Cl); - return { h: (0, _u64_js_1.add3H)(Rll, Ah, Bh, Ch), l: Rll | 0 }; -} -// Temporary block buffer -const BUF = new Uint32Array(256); -function G(a, b, c, d) { - let Al = BUF[2 * a], Ah = BUF[2 * a + 1]; // prettier-ignore - let Bl = BUF[2 * b], Bh = BUF[2 * b + 1]; // prettier-ignore - let Cl = BUF[2 * c], Ch = BUF[2 * c + 1]; // prettier-ignore - let Dl = BUF[2 * d], Dh = BUF[2 * d + 1]; // prettier-ignore - ({ h: Ah, l: Al } = blamka(Ah, Al, Bh, Bl)); - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: (0, _u64_js_1.rotr32H)(Dh, Dl), Dl: (0, _u64_js_1.rotr32L)(Dh, Dl) }); - ({ h: Ch, l: Cl } = blamka(Ch, Cl, Dh, Dl)); - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: (0, _u64_js_1.rotrSH)(Bh, Bl, 24), Bl: (0, _u64_js_1.rotrSL)(Bh, Bl, 24) }); - ({ h: Ah, l: Al } = blamka(Ah, Al, Bh, Bl)); - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: (0, _u64_js_1.rotrSH)(Dh, Dl, 16), Dl: (0, _u64_js_1.rotrSL)(Dh, Dl, 16) }); - ({ h: Ch, l: Cl } = blamka(Ch, Cl, Dh, Dl)); - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: (0, _u64_js_1.rotrBH)(Bh, Bl, 63), Bl: (0, _u64_js_1.rotrBL)(Bh, Bl, 63) }); - (BUF[2 * a] = Al), (BUF[2 * a + 1] = Ah); - (BUF[2 * b] = Bl), (BUF[2 * b + 1] = Bh); - (BUF[2 * c] = Cl), (BUF[2 * c + 1] = Ch); - (BUF[2 * d] = Dl), (BUF[2 * d + 1] = Dh); -} -// prettier-ignore -function P(v00, v01, v02, v03, v04, v05, v06, v07, v08, v09, v10, v11, v12, v13, v14, v15) { - G(v00, v04, v08, v12); - G(v01, v05, v09, v13); - G(v02, v06, v10, v14); - G(v03, v07, v11, v15); - G(v00, v05, v10, v15); - G(v01, v06, v11, v12); - G(v02, v07, v08, v13); - G(v03, v04, v09, v14); -} -function block(x, xPos, yPos, outPos, needXor) { - for (let i = 0; i < 256; i++) - BUF[i] = x[xPos + i] ^ x[yPos + i]; - // columns - for (let i = 0; i < 128; i += 16) { - // prettier-ignore - P(i, i + 1, i + 2, i + 3, i + 4, i + 5, i + 6, i + 7, i + 8, i + 9, i + 10, i + 11, i + 12, i + 13, i + 14, i + 15); - } - // rows - for (let i = 0; i < 16; i += 2) { - // prettier-ignore - P(i, i + 1, i + 16, i + 17, i + 32, i + 33, i + 48, i + 49, i + 64, i + 65, i + 80, i + 81, i + 96, i + 97, i + 112, i + 113); - } - if (needXor) - for (let i = 0; i < 256; i++) - x[outPos + i] ^= BUF[i] ^ x[xPos + i] ^ x[yPos + i]; - else - for (let i = 0; i < 256; i++) - x[outPos + i] = BUF[i] ^ x[xPos + i] ^ x[yPos + i]; -} -// Variable-Length Hash Function H' -function Hp(A, dkLen) { - const A8 = (0, utils_js_1.u8)(A); - const T = new Uint32Array(1); - const T8 = (0, utils_js_1.u8)(T); - T[0] = dkLen; - // Fast path - if (dkLen <= 64) - return blake2b_js_1.blake2b.create({ dkLen }).update(T8).update(A8).digest(); - const out = new Uint8Array(dkLen); - let V = blake2b_js_1.blake2b.create({}).update(T8).update(A8).digest(); - let pos = 0; - // First block - out.set(V.subarray(0, 32)); - pos += 32; - // Rest blocks - for (; dkLen - pos > 64; pos += 32) - out.set((V = (0, blake2b_js_1.blake2b)(V)).subarray(0, 32), pos); - // Last block - out.set((0, blake2b_js_1.blake2b)(V, { dkLen: dkLen - pos }), pos); - return (0, utils_js_1.u32)(out); -} -function indexAlpha(r, s, laneLen, segmentLen, index, randL, sameLane = false) { - let area; - if (0 == r) { - if (0 == s) - area = index - 1; - else if (sameLane) - area = s * segmentLen + index - 1; - else - area = s * segmentLen + (index == 0 ? -1 : 0); - } - else if (sameLane) - area = laneLen - segmentLen + index - 1; - else - area = laneLen - segmentLen + (index == 0 ? -1 : 0); - const startPos = r !== 0 && s !== ARGON2_SYNC_POINTS - 1 ? (s + 1) * segmentLen : 0; - const rel = relPos(area, randL); - // NOTE: check about overflows here - // absPos = (startPos + relPos) % laneLength; - return (startPos + rel) % laneLen; -} -function argon2Init(type, password, salt, opts) { - password = (0, utils_js_1.toBytes)(password); - salt = (0, utils_js_1.toBytes)(salt); - let { p, dkLen, m, t, version, key, personalization, maxmem, onProgress } = { - ...opts, - version: opts.version || 0x13, - dkLen: opts.dkLen || 32, - maxmem: 2 ** 32, - }; - // Validation - (0, _assert_js_1.number)(p); - (0, _assert_js_1.number)(dkLen); - (0, _assert_js_1.number)(m); - (0, _assert_js_1.number)(t); - (0, _assert_js_1.number)(version); - if (dkLen < 4 || dkLen >= 2 ** 32) - throw new Error('Argon2: dkLen should be at least 4 bytes'); - if (p < 1 || p >= 2 ** 32) - throw new Error('Argon2: p (parallelism) should be at least 1'); - if (t < 1 || t >= 2 ** 32) - throw new Error('Argon2: t (iterations) should be at least 1'); - if (m < 8 * p) - throw new Error(`Argon2: memory should be at least 8*p bytes`); - if (version !== 16 && version !== 19) - throw new Error(`Argon2: unknown version=${version}`); - password = (0, utils_js_1.toBytes)(password); - if (password.length < 0 || password.length >= 2 ** 32) - throw new Error('Argon2: password should be less than 4 GB'); - salt = (0, utils_js_1.toBytes)(salt); - if (salt.length < 8) - throw new Error('Argon2: salt should be at least 8 bytes'); - key = toBytesOptional(key); - personalization = toBytesOptional(personalization); - if (onProgress !== undefined && typeof onProgress !== 'function') - throw new Error('progressCb should be function'); - // Params - const lanes = p; - // m' = 4 * p * floor (m / 4p) - const mP = 4 * p * Math.floor(m / (ARGON2_SYNC_POINTS * p)); - //q = m' / p columns - const laneLen = Math.floor(mP / p); - const segmentLen = Math.floor(laneLen / ARGON2_SYNC_POINTS); - // H0 - const h = blake2b_js_1.blake2b.create({}); - const BUF = new Uint32Array(1); - const BUF8 = (0, utils_js_1.u8)(BUF); - for (const i of [p, dkLen, m, t, version, type]) { - if (i < 0 || i >= 2 ** 32) - throw new Error(`Argon2: wrong parameter=${i}, expected uint32`); - BUF[0] = i; - h.update(BUF8); - } - for (let i of [password, salt, key, personalization]) { - BUF[0] = i.length; - h.update(BUF8).update(i); - } - const H0 = new Uint32Array(18); - const H0_8 = (0, utils_js_1.u8)(H0); - h.digestInto(H0_8); - // 256 u32 = 1024 (BLOCK_SIZE) - const memUsed = mP * 256; - if (memUsed < 0 || memUsed >= 2 ** 32 || memUsed > maxmem) { - throw new Error(`Argon2: wrong params (memUsed=${memUsed} maxmem=${maxmem}), should be less than 2**32`); - } - const B = new Uint32Array(memUsed); - // Fill first blocks - for (let l = 0; l < p; l++) { - const i = 256 * laneLen * l; - // B[i][0] = H'^(1024)(H_0 || LE32(0) || LE32(i)) - H0[17] = l; - H0[16] = 0; - B.set(Hp(H0, 1024), i); - // B[i][1] = H'^(1024)(H_0 || LE32(1) || LE32(i)) - H0[16] = 1; - B.set(Hp(H0, 1024), i + 256); - } - let perBlock = () => { }; - if (onProgress) { - const totalBlock = t * ARGON2_SYNC_POINTS * p * segmentLen; - // Invoke callback if progress changes from 10.01 to 10.02 - // Allows to draw smooth progress bar on up to 8K screen - const callbackPer = Math.max(Math.floor(totalBlock / 10000), 1); - let blockCnt = 0; - perBlock = () => { - blockCnt++; - if (onProgress && (!(blockCnt % callbackPer) || blockCnt === totalBlock)) - onProgress(blockCnt / totalBlock); - }; - } - return { type, mP, p, t, version, B, laneLen, lanes, segmentLen, dkLen, perBlock }; -} -function argon2Output(B, p, laneLen, dkLen) { - const B_final = new Uint32Array(256); - for (let l = 0; l < p; l++) - for (let j = 0; j < 256; j++) - B_final[j] ^= B[256 * (laneLen * l + laneLen - 1) + j]; - return (0, utils_js_1.u8)(Hp(B_final, dkLen)); -} -function processBlock(B, address, l, r, s, index, laneLen, segmentLen, lanes, offset, prev, dataIndependent, needXor) { - if (offset % laneLen) - prev = offset - 1; - let randL, randH; - if (dataIndependent) { - if (index % 128 === 0) { - address[256 + 12]++; - block(address, 256, 2 * 256, 0, false); - block(address, 0, 2 * 256, 0, false); - } - randL = address[2 * (index % 128)]; - randH = address[2 * (index % 128) + 1]; - } - else { - const T = 256 * prev; - randL = B[T]; - randH = B[T + 1]; - } - // address block - const refLane = r === 0 && s === 0 ? l : randH % lanes; - const refPos = indexAlpha(r, s, laneLen, segmentLen, index, randL, refLane == l); - const refBlock = laneLen * refLane + refPos; - // B[i][j] = G(B[i][j-1], B[l][z]) - block(B, 256 * prev, 256 * refBlock, offset * 256, needXor); -} -function argon2(type, password, salt, opts) { - const { mP, p, t, version, B, laneLen, lanes, segmentLen, dkLen, perBlock } = argon2Init(type, password, salt, opts); - // Pre-loop setup - // [address, input, zero_block] format so we can pass single U32 to block function - const address = new Uint32Array(3 * 256); - address[256 + 6] = mP; - address[256 + 8] = t; - address[256 + 10] = type; - for (let r = 0; r < t; r++) { - const needXor = r !== 0 && version === 0x13; - address[256 + 0] = r; - for (let s = 0; s < ARGON2_SYNC_POINTS; s++) { - address[256 + 4] = s; - const dataIndependent = type == 1 /* Types.Argon2i */ || (type == 2 /* Types.Argon2id */ && r === 0 && s < 2); - for (let l = 0; l < p; l++) { - address[256 + 2] = l; - address[256 + 12] = 0; - let startPos = 0; - if (r === 0 && s === 0) { - startPos = 2; - if (dataIndependent) { - address[256 + 12]++; - block(address, 256, 2 * 256, 0, false); - block(address, 0, 2 * 256, 0, false); - } - } - // current block postion - let offset = l * laneLen + s * segmentLen + startPos; - // previous block position - let prev = offset % laneLen ? offset - 1 : offset + laneLen - 1; - for (let index = startPos; index < segmentLen; index++, offset++, prev++) { - perBlock(); - processBlock(B, address, l, r, s, index, laneLen, segmentLen, lanes, offset, prev, dataIndependent, needXor); - } - } - } - } - return argon2Output(B, p, laneLen, dkLen); -} -const argon2d = (password, salt, opts) => argon2(0 /* Types.Argond2d */, password, salt, opts); -exports.argon2d = argon2d; -const argon2i = (password, salt, opts) => argon2(1 /* Types.Argon2i */, password, salt, opts); -exports.argon2i = argon2i; -const argon2id = (password, salt, opts) => argon2(2 /* Types.Argon2id */, password, salt, opts); -exports.argon2id = argon2id; -//# sourceMappingURL=argon2.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/argon2.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/argon2.js.map deleted file mode 100644 index a88b2520..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/argon2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"argon2.js","sourceRoot":"","sources":["src/argon2.ts"],"names":[],"mappings":";;;AAAA,6CAAsD;AACtD,yCAAqD;AACrD,6CAAuC;AACvC,uCAA2F;AAS3F,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAE7B,MAAM,eAAe,GAAG,CAAC,GAAW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AM,QAAQ,GAAG,CAAC,QAAe,EAAE,IAAW,EAAE,IAAe,EAAE,EAAE,CACxE,MAAM,yBAAiB,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AADlC,QAAA,QAAQ,YAC0B"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/blake2b.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/blake2b.d.ts deleted file mode 100644 index 7a78c6b8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/blake2b.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { BLAKE2, BlakeOpts } from './_blake2.js'; -declare class BLAKE2b extends BLAKE2 { - private v0l; - private v0h; - private v1l; - private v1h; - private v2l; - private v2h; - private v3l; - private v3h; - private v4l; - private v4h; - private v5l; - private v5h; - private v6l; - private v6h; - private v7l; - private v7h; - constructor(opts?: BlakeOpts); - protected get(): [ - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number - ]; - protected set(v0l: number, v0h: number, v1l: number, v1h: number, v2l: number, v2h: number, v3l: number, v3h: number, v4l: number, v4h: number, v5l: number, v5h: number, v6l: number, v6h: number, v7l: number, v7h: number): void; - protected compress(msg: Uint32Array, offset: number, isLast: boolean): void; - destroy(): void; -} -/** - * BLAKE2b - optimized for 64-bit platforms. JS doesn't have uint64, so it's slower than BLAKE2s. - * @param msg - message that would be hashed - * @param opts - dkLen, key, salt, personalization - */ -export declare const blake2b: { - (msg: import("./utils.js").Input, opts?: BlakeOpts | undefined): Uint8Array; - outputLen: number; - blockLen: number; - create(opts: BlakeOpts): import("./utils.js").Hash; -}; -export {}; diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/blake2b.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/blake2b.js deleted file mode 100644 index 9d41df59..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/blake2b.js +++ /dev/null @@ -1,192 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.blake2b = void 0; -const _blake2_js_1 = require("./_blake2.js"); -const _u64_js_1 = require("./_u64.js"); -const utils_js_1 = require("./utils.js"); -// Same as SHA-512 but LE -// prettier-ignore -const IV = /* @__PURE__ */ new Uint32Array([ - 0xf3bcc908, 0x6a09e667, 0x84caa73b, 0xbb67ae85, 0xfe94f82b, 0x3c6ef372, 0x5f1d36f1, 0xa54ff53a, - 0xade682d1, 0x510e527f, 0x2b3e6c1f, 0x9b05688c, 0xfb41bd6b, 0x1f83d9ab, 0x137e2179, 0x5be0cd19 -]); -// Temporary buffer -const BUF = /* @__PURE__ */ new Uint32Array(32); -// Mixing function G splitted in two halfs -function G1(a, b, c, d, msg, x) { - // NOTE: V is LE here - const Xl = msg[x], Xh = msg[x + 1]; // prettier-ignore - let Al = BUF[2 * a], Ah = BUF[2 * a + 1]; // prettier-ignore - let Bl = BUF[2 * b], Bh = BUF[2 * b + 1]; // prettier-ignore - let Cl = BUF[2 * c], Ch = BUF[2 * c + 1]; // prettier-ignore - let Dl = BUF[2 * d], Dh = BUF[2 * d + 1]; // prettier-ignore - // v[a] = (v[a] + v[b] + x) | 0; - let ll = _u64_js_1.default.add3L(Al, Bl, Xl); - Ah = _u64_js_1.default.add3H(ll, Ah, Bh, Xh); - Al = ll | 0; - // v[d] = rotr(v[d] ^ v[a], 32) - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: _u64_js_1.default.rotr32H(Dh, Dl), Dl: _u64_js_1.default.rotr32L(Dh, Dl) }); - // v[c] = (v[c] + v[d]) | 0; - ({ h: Ch, l: Cl } = _u64_js_1.default.add(Ch, Cl, Dh, Dl)); - // v[b] = rotr(v[b] ^ v[c], 24) - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: _u64_js_1.default.rotrSH(Bh, Bl, 24), Bl: _u64_js_1.default.rotrSL(Bh, Bl, 24) }); - (BUF[2 * a] = Al), (BUF[2 * a + 1] = Ah); - (BUF[2 * b] = Bl), (BUF[2 * b + 1] = Bh); - (BUF[2 * c] = Cl), (BUF[2 * c + 1] = Ch); - (BUF[2 * d] = Dl), (BUF[2 * d + 1] = Dh); -} -function G2(a, b, c, d, msg, x) { - // NOTE: V is LE here - const Xl = msg[x], Xh = msg[x + 1]; // prettier-ignore - let Al = BUF[2 * a], Ah = BUF[2 * a + 1]; // prettier-ignore - let Bl = BUF[2 * b], Bh = BUF[2 * b + 1]; // prettier-ignore - let Cl = BUF[2 * c], Ch = BUF[2 * c + 1]; // prettier-ignore - let Dl = BUF[2 * d], Dh = BUF[2 * d + 1]; // prettier-ignore - // v[a] = (v[a] + v[b] + x) | 0; - let ll = _u64_js_1.default.add3L(Al, Bl, Xl); - Ah = _u64_js_1.default.add3H(ll, Ah, Bh, Xh); - Al = ll | 0; - // v[d] = rotr(v[d] ^ v[a], 16) - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: _u64_js_1.default.rotrSH(Dh, Dl, 16), Dl: _u64_js_1.default.rotrSL(Dh, Dl, 16) }); - // v[c] = (v[c] + v[d]) | 0; - ({ h: Ch, l: Cl } = _u64_js_1.default.add(Ch, Cl, Dh, Dl)); - // v[b] = rotr(v[b] ^ v[c], 63) - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: _u64_js_1.default.rotrBH(Bh, Bl, 63), Bl: _u64_js_1.default.rotrBL(Bh, Bl, 63) }); - (BUF[2 * a] = Al), (BUF[2 * a + 1] = Ah); - (BUF[2 * b] = Bl), (BUF[2 * b + 1] = Bh); - (BUF[2 * c] = Cl), (BUF[2 * c + 1] = Ch); - (BUF[2 * d] = Dl), (BUF[2 * d + 1] = Dh); -} -class BLAKE2b extends _blake2_js_1.BLAKE2 { - constructor(opts = {}) { - super(128, opts.dkLen === undefined ? 64 : opts.dkLen, opts, 64, 16, 16); - // Same as SHA-512, but LE - this.v0l = IV[0] | 0; - this.v0h = IV[1] | 0; - this.v1l = IV[2] | 0; - this.v1h = IV[3] | 0; - this.v2l = IV[4] | 0; - this.v2h = IV[5] | 0; - this.v3l = IV[6] | 0; - this.v3h = IV[7] | 0; - this.v4l = IV[8] | 0; - this.v4h = IV[9] | 0; - this.v5l = IV[10] | 0; - this.v5h = IV[11] | 0; - this.v6l = IV[12] | 0; - this.v6h = IV[13] | 0; - this.v7l = IV[14] | 0; - this.v7h = IV[15] | 0; - const keyLength = opts.key ? opts.key.length : 0; - this.v0l ^= this.outputLen | (keyLength << 8) | (0x01 << 16) | (0x01 << 24); - if (opts.salt) { - const salt = (0, utils_js_1.u32)((0, utils_js_1.toBytes)(opts.salt)); - this.v4l ^= salt[0]; - this.v4h ^= salt[1]; - this.v5l ^= salt[2]; - this.v5h ^= salt[3]; - } - if (opts.personalization) { - const pers = (0, utils_js_1.u32)((0, utils_js_1.toBytes)(opts.personalization)); - this.v6l ^= pers[0]; - this.v6h ^= pers[1]; - this.v7l ^= pers[2]; - this.v7h ^= pers[3]; - } - if (opts.key) { - // Pad to blockLen and update - const tmp = new Uint8Array(this.blockLen); - tmp.set((0, utils_js_1.toBytes)(opts.key)); - this.update(tmp); - } - } - // prettier-ignore - get() { - let { v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h } = this; - return [v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h]; - } - // prettier-ignore - set(v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h) { - this.v0l = v0l | 0; - this.v0h = v0h | 0; - this.v1l = v1l | 0; - this.v1h = v1h | 0; - this.v2l = v2l | 0; - this.v2h = v2h | 0; - this.v3l = v3l | 0; - this.v3h = v3h | 0; - this.v4l = v4l | 0; - this.v4h = v4h | 0; - this.v5l = v5l | 0; - this.v5h = v5h | 0; - this.v6l = v6l | 0; - this.v6h = v6h | 0; - this.v7l = v7l | 0; - this.v7h = v7h | 0; - } - compress(msg, offset, isLast) { - this.get().forEach((v, i) => (BUF[i] = v)); // First half from state. - BUF.set(IV, 16); // Second half from IV. - let { h, l } = _u64_js_1.default.fromBig(BigInt(this.length)); - BUF[24] = IV[8] ^ l; // Low word of the offset. - BUF[25] = IV[9] ^ h; // High word. - // Invert all bits for last block - if (isLast) { - BUF[28] = ~BUF[28]; - BUF[29] = ~BUF[29]; - } - let j = 0; - const s = _blake2_js_1.SIGMA; - for (let i = 0; i < 12; i++) { - G1(0, 4, 8, 12, msg, offset + 2 * s[j++]); - G2(0, 4, 8, 12, msg, offset + 2 * s[j++]); - G1(1, 5, 9, 13, msg, offset + 2 * s[j++]); - G2(1, 5, 9, 13, msg, offset + 2 * s[j++]); - G1(2, 6, 10, 14, msg, offset + 2 * s[j++]); - G2(2, 6, 10, 14, msg, offset + 2 * s[j++]); - G1(3, 7, 11, 15, msg, offset + 2 * s[j++]); - G2(3, 7, 11, 15, msg, offset + 2 * s[j++]); - G1(0, 5, 10, 15, msg, offset + 2 * s[j++]); - G2(0, 5, 10, 15, msg, offset + 2 * s[j++]); - G1(1, 6, 11, 12, msg, offset + 2 * s[j++]); - G2(1, 6, 11, 12, msg, offset + 2 * s[j++]); - G1(2, 7, 8, 13, msg, offset + 2 * s[j++]); - G2(2, 7, 8, 13, msg, offset + 2 * s[j++]); - G1(3, 4, 9, 14, msg, offset + 2 * s[j++]); - G2(3, 4, 9, 14, msg, offset + 2 * s[j++]); - } - this.v0l ^= BUF[0] ^ BUF[16]; - this.v0h ^= BUF[1] ^ BUF[17]; - this.v1l ^= BUF[2] ^ BUF[18]; - this.v1h ^= BUF[3] ^ BUF[19]; - this.v2l ^= BUF[4] ^ BUF[20]; - this.v2h ^= BUF[5] ^ BUF[21]; - this.v3l ^= BUF[6] ^ BUF[22]; - this.v3h ^= BUF[7] ^ BUF[23]; - this.v4l ^= BUF[8] ^ BUF[24]; - this.v4h ^= BUF[9] ^ BUF[25]; - this.v5l ^= BUF[10] ^ BUF[26]; - this.v5h ^= BUF[11] ^ BUF[27]; - this.v6l ^= BUF[12] ^ BUF[28]; - this.v6h ^= BUF[13] ^ BUF[29]; - this.v7l ^= BUF[14] ^ BUF[30]; - this.v7h ^= BUF[15] ^ BUF[31]; - BUF.fill(0); - } - destroy() { - this.destroyed = true; - this.buffer32.fill(0); - this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - } -} -/** - * BLAKE2b - optimized for 64-bit platforms. JS doesn't have uint64, so it's slower than BLAKE2s. - * @param msg - message that would be hashed - * @param opts - dkLen, key, salt, personalization - */ -exports.blake2b = (0, utils_js_1.wrapConstructorWithOpts)((opts) => new BLAKE2b(opts)); -//# sourceMappingURL=blake2b.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/blake2b.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/blake2b.js.map deleted file mode 100644 index 4e936fb4..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/blake2b.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blake2b.js","sourceRoot":"","sources":["src/blake2b.ts"],"names":[],"mappings":";;;AAAA,6CAAwD;AACxD,uCAA4B;AAC5B,yCAAmE;AAEnE,yBAAyB;AACzB,kBAAkB;AAClB,MAAM,EAAE,GAAG,eAAe,CAAC,IAAI,WAAW,CAAC;IACzC,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IAC9F,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,U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/ethers/node_modules/@noble/hashes/blake2s.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/blake2s.d.ts deleted file mode 100644 index d9dd59b0..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/blake2s.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { BLAKE2, BlakeOpts } from './_blake2.js'; -export declare const IV: Uint32Array; -export declare function compress(s: Uint8Array, offset: number, msg: Uint32Array, rounds: number, v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, v9: number, v10: number, v11: number, v12: number, v13: number, v14: number, v15: number): { - v0: number; - v1: number; - v2: number; - v3: number; - v4: number; - v5: number; - v6: number; - v7: number; - v8: number; - v9: number; - v10: number; - v11: number; - v12: number; - v13: number; - v14: number; - v15: number; -}; -declare class BLAKE2s extends BLAKE2 { - private v0; - private v1; - private v2; - private v3; - private v4; - private v5; - private v6; - private v7; - constructor(opts?: BlakeOpts); - protected get(): [number, number, number, number, number, number, number, number]; - protected set(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number): void; - protected compress(msg: Uint32Array, offset: number, isLast: boolean): void; - destroy(): void; -} -/** - * BLAKE2s - optimized for 32-bit platforms. JS doesn't have uint64, so it's faster than BLAKE2b. - * @param msg - message that would be hashed - * @param opts - dkLen, key, salt, personalization - */ -export declare const blake2s: { - (msg: import("./utils.js").Input, opts?: BlakeOpts | undefined): Uint8Array; - outputLen: number; - blockLen: number; - create(opts: BlakeOpts): import("./utils.js").Hash; -}; -export {}; diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/blake2s.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/blake2s.js deleted file mode 100644 index ace75136..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/blake2s.js +++ /dev/null @@ -1,122 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.blake2s = exports.compress = exports.IV = void 0; -const _blake2_js_1 = require("./_blake2.js"); -const _u64_js_1 = require("./_u64.js"); -const utils_js_1 = require("./utils.js"); -// Initial state: -// first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19) -// same as SHA-256 -// prettier-ignore -exports.IV = new Uint32Array([0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19]); -// Mixing function G splitted in two halfs -function G1(a, b, c, d, x) { - a = (a + b + x) | 0; - d = (0, utils_js_1.rotr)(d ^ a, 16); - c = (c + d) | 0; - b = (0, utils_js_1.rotr)(b ^ c, 12); - return { a, b, c, d }; -} -function G2(a, b, c, d, x) { - a = (a + b + x) | 0; - d = (0, utils_js_1.rotr)(d ^ a, 8); - c = (c + d) | 0; - b = (0, utils_js_1.rotr)(b ^ c, 7); - return { a, b, c, d }; -} -// prettier-ignore -function compress(s, offset, msg, rounds, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) { - let j = 0; - for (let i = 0; i < rounds; i++) { - ({ a: v0, b: v4, c: v8, d: v12 } = G1(v0, v4, v8, v12, msg[offset + s[j++]])); - ({ a: v0, b: v4, c: v8, d: v12 } = G2(v0, v4, v8, v12, msg[offset + s[j++]])); - ({ a: v1, b: v5, c: v9, d: v13 } = G1(v1, v5, v9, v13, msg[offset + s[j++]])); - ({ a: v1, b: v5, c: v9, d: v13 } = G2(v1, v5, v9, v13, msg[offset + s[j++]])); - ({ a: v2, b: v6, c: v10, d: v14 } = G1(v2, v6, v10, v14, msg[offset + s[j++]])); - ({ a: v2, b: v6, c: v10, d: v14 } = G2(v2, v6, v10, v14, msg[offset + s[j++]])); - ({ a: v3, b: v7, c: v11, d: v15 } = G1(v3, v7, v11, v15, msg[offset + s[j++]])); - ({ a: v3, b: v7, c: v11, d: v15 } = G2(v3, v7, v11, v15, msg[offset + s[j++]])); - ({ a: v0, b: v5, c: v10, d: v15 } = G1(v0, v5, v10, v15, msg[offset + s[j++]])); - ({ a: v0, b: v5, c: v10, d: v15 } = G2(v0, v5, v10, v15, msg[offset + s[j++]])); - ({ a: v1, b: v6, c: v11, d: v12 } = G1(v1, v6, v11, v12, msg[offset + s[j++]])); - ({ a: v1, b: v6, c: v11, d: v12 } = G2(v1, v6, v11, v12, msg[offset + s[j++]])); - ({ a: v2, b: v7, c: v8, d: v13 } = G1(v2, v7, v8, v13, msg[offset + s[j++]])); - ({ a: v2, b: v7, c: v8, d: v13 } = G2(v2, v7, v8, v13, msg[offset + s[j++]])); - ({ a: v3, b: v4, c: v9, d: v14 } = G1(v3, v4, v9, v14, msg[offset + s[j++]])); - ({ a: v3, b: v4, c: v9, d: v14 } = G2(v3, v4, v9, v14, msg[offset + s[j++]])); - } - return { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 }; -} -exports.compress = compress; -class BLAKE2s extends _blake2_js_1.BLAKE2 { - constructor(opts = {}) { - super(64, opts.dkLen === undefined ? 32 : opts.dkLen, opts, 32, 8, 8); - // Internal state, same as SHA-256 - this.v0 = exports.IV[0] | 0; - this.v1 = exports.IV[1] | 0; - this.v2 = exports.IV[2] | 0; - this.v3 = exports.IV[3] | 0; - this.v4 = exports.IV[4] | 0; - this.v5 = exports.IV[5] | 0; - this.v6 = exports.IV[6] | 0; - this.v7 = exports.IV[7] | 0; - const keyLength = opts.key ? opts.key.length : 0; - this.v0 ^= this.outputLen | (keyLength << 8) | (0x01 << 16) | (0x01 << 24); - if (opts.salt) { - const salt = (0, utils_js_1.u32)((0, utils_js_1.toBytes)(opts.salt)); - this.v4 ^= salt[0]; - this.v5 ^= salt[1]; - } - if (opts.personalization) { - const pers = (0, utils_js_1.u32)((0, utils_js_1.toBytes)(opts.personalization)); - this.v6 ^= pers[0]; - this.v7 ^= pers[1]; - } - if (opts.key) { - // Pad to blockLen and update - const tmp = new Uint8Array(this.blockLen); - tmp.set((0, utils_js_1.toBytes)(opts.key)); - this.update(tmp); - } - } - get() { - const { v0, v1, v2, v3, v4, v5, v6, v7 } = this; - return [v0, v1, v2, v3, v4, v5, v6, v7]; - } - // prettier-ignore - set(v0, v1, v2, v3, v4, v5, v6, v7) { - this.v0 = v0 | 0; - this.v1 = v1 | 0; - this.v2 = v2 | 0; - this.v3 = v3 | 0; - this.v4 = v4 | 0; - this.v5 = v5 | 0; - this.v6 = v6 | 0; - this.v7 = v7 | 0; - } - compress(msg, offset, isLast) { - const { h, l } = (0, _u64_js_1.fromBig)(BigInt(this.length)); - // prettier-ignore - const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = compress(_blake2_js_1.SIGMA, offset, msg, 10, this.v0, this.v1, this.v2, this.v3, this.v4, this.v5, this.v6, this.v7, exports.IV[0], exports.IV[1], exports.IV[2], exports.IV[3], l ^ exports.IV[4], h ^ exports.IV[5], isLast ? ~exports.IV[6] : exports.IV[6], exports.IV[7]); - this.v0 ^= v0 ^ v8; - this.v1 ^= v1 ^ v9; - this.v2 ^= v2 ^ v10; - this.v3 ^= v3 ^ v11; - this.v4 ^= v4 ^ v12; - this.v5 ^= v5 ^ v13; - this.v6 ^= v6 ^ v14; - this.v7 ^= v7 ^ v15; - } - destroy() { - this.destroyed = true; - this.buffer32.fill(0); - this.set(0, 0, 0, 0, 0, 0, 0, 0); - } -} -/** - * BLAKE2s - optimized for 32-bit platforms. JS doesn't have uint64, so it's faster than BLAKE2b. - * @param msg - message that would be hashed - * @param opts - dkLen, key, salt, personalization - */ -exports.blake2s = (0, utils_js_1.wrapConstructorWithOpts)((opts) => new BLAKE2s(opts)); -//# sourceMappingURL=blake2s.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/blake2s.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/blake2s.js.map deleted file mode 100644 index ac692b3d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/blake2s.js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AAI,CAAC,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC;QACpB,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC;QACpB,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC;QACpB,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC;QACpB,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC;QACpB,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC;IACtB,CAAC;IACD,OAAO;QACL,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACtB,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACnC,CAAC;CACF;AAED;;;;GAIG;AACU,QAAA,OAAO,GAAmB,IAAA,kCAAuB,EAC5D,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAC5B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/blake3.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/blake3.d.ts deleted file mode 100644 index 13894cf6..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/blake3.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { BLAKE2 } from './_blake2.js'; -import { Input, HashXOF } from './utils.js'; -export type Blake3Opts = { - dkLen?: number; - key?: Input; - context?: Input; -}; -declare class BLAKE3 extends BLAKE2 implements HashXOF { - private IV; - private flags; - private state; - private chunkPos; - private chunksDone; - private stack; - private posOut; - private bufferOut32; - private bufferOut; - private chunkOut; - private enableXOF; - constructor(opts?: Blake3Opts, flags?: number); - protected get(): never[]; - protected set(): void; - private b2Compress; - protected compress(buf: Uint32Array, bufPos?: number, isLast?: boolean): void; - _cloneInto(to?: BLAKE3): BLAKE3; - destroy(): void; - private b2CompressOut; - protected finish(): void; - private writeInto; - xofInto(out: Uint8Array): Uint8Array; - xof(bytes: number): Uint8Array; - digestInto(out: Uint8Array): Uint8Array; - digest(): Uint8Array; -} -/** - * BLAKE3 hash function. - * @param msg - message that would be hashed - * @param opts - dkLen, key, context - */ -export declare const blake3: { - (msg: Input, opts?: Blake3Opts | undefined): Uint8Array; - outputLen: number; - blockLen: number; - create(opts: Blake3Opts): HashXOF; -}; -export {}; diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/blake3.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/blake3.js deleted file mode 100644 index 3c339f54..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/blake3.js +++ /dev/null @@ -1,229 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.blake3 = void 0; -const _assert_js_1 = require("./_assert.js"); -const _u64_js_1 = require("./_u64.js"); -const _blake2_js_1 = require("./_blake2.js"); -const blake2s_js_1 = require("./blake2s.js"); -const utils_js_1 = require("./utils.js"); -const SIGMA = /* @__PURE__ */ (() => { - const Id = Array.from({ length: 16 }, (_, i) => i); - const permute = (arr) => [2, 6, 3, 10, 7, 0, 4, 13, 1, 11, 12, 5, 9, 14, 15, 8].map((i) => arr[i]); - const res = []; - for (let i = 0, v = Id; i < 7; i++, v = permute(v)) - res.push(...v); - return Uint8Array.from(res); -})(); -// Why is this so slow? It should be 6x faster than blake2b. -// - There is only 30% reduction in number of rounds from blake2s -// - This function uses tree mode to achive parallelisation via SIMD and threading, -// however in JS we don't have threads and SIMD, so we get only overhead from tree structure -// - It is possible to speed it up via Web Workers, hovewer it will make code singnificantly more -// complicated, which we are trying to avoid, since this library is intended to be used -// for cryptographic purposes. Also, parallelization happens only on chunk level (1024 bytes), -// which won't really benefit small inputs. -class BLAKE3 extends _blake2_js_1.BLAKE2 { - constructor(opts = {}, flags = 0) { - super(64, opts.dkLen === undefined ? 32 : opts.dkLen, {}, Number.MAX_SAFE_INTEGER, 0, 0); - this.flags = 0 | 0; - this.chunkPos = 0; // Position of current block in chunk - this.chunksDone = 0; // How many chunks we already have - this.stack = []; - // Output - this.posOut = 0; - this.bufferOut32 = new Uint32Array(16); - this.chunkOut = 0; // index of output chunk - this.enableXOF = true; - this.outputLen = opts.dkLen === undefined ? 32 : opts.dkLen; - (0, _assert_js_1.number)(this.outputLen); - if (opts.key !== undefined && opts.context !== undefined) - throw new Error('Blake3: only key or context can be specified at same time'); - else if (opts.key !== undefined) { - const key = (0, utils_js_1.toBytes)(opts.key).slice(); - if (key.length !== 32) - throw new Error('Blake3: key should be 32 byte'); - this.IV = (0, utils_js_1.u32)(key); - this.flags = flags | 16 /* Flags.KEYED_HASH */; - } - else if (opts.context !== undefined) { - const context_key = new BLAKE3({ dkLen: 32 }, 32 /* Flags.DERIVE_KEY_CONTEXT */) - .update(opts.context) - .digest(); - this.IV = (0, utils_js_1.u32)(context_key); - this.flags = flags | 64 /* Flags.DERIVE_KEY_MATERIAL */; - } - else { - this.IV = blake2s_js_1.IV.slice(); - this.flags = flags; - } - this.state = this.IV.slice(); - this.bufferOut = (0, utils_js_1.u8)(this.bufferOut32); - } - // Unused - get() { - return []; - } - set() { } - b2Compress(counter, flags, buf, bufPos = 0) { - const { state: s, pos } = this; - const { h, l } = (0, _u64_js_1.fromBig)(BigInt(counter), true); - // prettier-ignore - const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = (0, blake2s_js_1.compress)(SIGMA, bufPos, buf, 7, s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], blake2s_js_1.IV[0], blake2s_js_1.IV[1], blake2s_js_1.IV[2], blake2s_js_1.IV[3], h, l, pos, flags); - s[0] = v0 ^ v8; - s[1] = v1 ^ v9; - s[2] = v2 ^ v10; - s[3] = v3 ^ v11; - s[4] = v4 ^ v12; - s[5] = v5 ^ v13; - s[6] = v6 ^ v14; - s[7] = v7 ^ v15; - } - compress(buf, bufPos = 0, isLast = false) { - // Compress last block - let flags = this.flags; - if (!this.chunkPos) - flags |= 1 /* Flags.CHUNK_START */; - if (this.chunkPos === 15 || isLast) - flags |= 2 /* Flags.CHUNK_END */; - if (!isLast) - this.pos = this.blockLen; - this.b2Compress(this.chunksDone, flags, buf, bufPos); - this.chunkPos += 1; - // If current block is last in chunk (16 blocks), then compress chunks - if (this.chunkPos === 16 || isLast) { - let chunk = this.state; - this.state = this.IV.slice(); - // If not the last one, compress only when there are trailing zeros in chunk counter - // chunks used as binary tree where current stack is path. Zero means current leaf is finished and can be compressed. - // 1 (001) - leaf not finished (just push current chunk to stack) - // 2 (010) - leaf finished at depth=1 (merge with last elm on stack and push back) - // 3 (011) - last leaf not finished - // 4 (100) - leafs finished at depth=1 and depth=2 - for (let last, chunks = this.chunksDone + 1; isLast || !(chunks & 1); chunks >>= 1) { - if (!(last = this.stack.pop())) - break; - this.buffer32.set(last, 0); - this.buffer32.set(chunk, 8); - this.pos = this.blockLen; - this.b2Compress(0, this.flags | 4 /* Flags.PARENT */, this.buffer32, 0); - chunk = this.state; - this.state = this.IV.slice(); - } - this.chunksDone++; - this.chunkPos = 0; - this.stack.push(chunk); - } - this.pos = 0; - } - _cloneInto(to) { - to = super._cloneInto(to); - const { IV, flags, state, chunkPos, posOut, chunkOut, stack, chunksDone } = this; - to.state.set(state.slice()); - to.stack = stack.map((i) => Uint32Array.from(i)); - to.IV.set(IV); - to.flags = flags; - to.chunkPos = chunkPos; - to.chunksDone = chunksDone; - to.posOut = posOut; - to.chunkOut = chunkOut; - to.enableXOF = this.enableXOF; - to.bufferOut32.set(this.bufferOut32); - return to; - } - destroy() { - this.destroyed = true; - this.state.fill(0); - this.buffer32.fill(0); - this.IV.fill(0); - this.bufferOut32.fill(0); - for (let i of this.stack) - i.fill(0); - } - // Same as b2Compress, but doesn't modify state and returns 16 u32 array (instead of 8) - b2CompressOut() { - const { state: s, pos, flags, buffer32, bufferOut32: out32 } = this; - const { h, l } = (0, _u64_js_1.fromBig)(BigInt(this.chunkOut++)); - // prettier-ignore - const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = (0, blake2s_js_1.compress)(SIGMA, 0, buffer32, 7, s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], blake2s_js_1.IV[0], blake2s_js_1.IV[1], blake2s_js_1.IV[2], blake2s_js_1.IV[3], l, h, pos, flags); - out32[0] = v0 ^ v8; - out32[1] = v1 ^ v9; - out32[2] = v2 ^ v10; - out32[3] = v3 ^ v11; - out32[4] = v4 ^ v12; - out32[5] = v5 ^ v13; - out32[6] = v6 ^ v14; - out32[7] = v7 ^ v15; - out32[8] = s[0] ^ v8; - out32[9] = s[1] ^ v9; - out32[10] = s[2] ^ v10; - out32[11] = s[3] ^ v11; - out32[12] = s[4] ^ v12; - out32[13] = s[5] ^ v13; - out32[14] = s[6] ^ v14; - out32[15] = s[7] ^ v15; - this.posOut = 0; - } - finish() { - if (this.finished) - return; - this.finished = true; - // Padding - this.buffer.fill(0, this.pos); - // Process last chunk - let flags = this.flags | 8 /* Flags.ROOT */; - if (this.stack.length) { - flags |= 4 /* Flags.PARENT */; - this.compress(this.buffer32, 0, true); - this.chunksDone = 0; - this.pos = this.blockLen; - } - else { - flags |= (!this.chunkPos ? 1 /* Flags.CHUNK_START */ : 0) | 2 /* Flags.CHUNK_END */; - } - this.flags = flags; - this.b2CompressOut(); - } - writeInto(out) { - (0, _assert_js_1.exists)(this, false); - (0, _assert_js_1.bytes)(out); - this.finish(); - const { blockLen, bufferOut } = this; - for (let pos = 0, len = out.length; pos < len;) { - if (this.posOut >= blockLen) - this.b2CompressOut(); - const take = Math.min(blockLen - this.posOut, len - pos); - out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); - this.posOut += take; - pos += take; - } - return out; - } - xofInto(out) { - if (!this.enableXOF) - throw new Error('XOF is not possible after digest call'); - return this.writeInto(out); - } - xof(bytes) { - (0, _assert_js_1.number)(bytes); - return this.xofInto(new Uint8Array(bytes)); - } - digestInto(out) { - (0, _assert_js_1.output)(out, this); - if (this.finished) - throw new Error('digest() was already called'); - this.enableXOF = false; - this.writeInto(out); - this.destroy(); - return out; - } - digest() { - return this.digestInto(new Uint8Array(this.outputLen)); - } -} -/** - * BLAKE3 hash function. - * @param msg - message that would be hashed - * @param opts - dkLen, key, context - */ -exports.blake3 = (0, utils_js_1.wrapXOFConstructorWithOpts)((opts) => new BLAKE3(opts)); -//# sourceMappingURL=blake3.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/blake3.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/blake3.js.map deleted file mode 100644 index 7ed8fd69..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/blake3.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blake3.js","sourceRoot":"","sources":["src/blake3.ts"],"names":[],"mappings":";;;AAAA,6CAA6D;AAC7D,uCAAoC;AACpC,6CAAsC;AACtC,6CAA4C;AAC5C,yCAA0F;AAe1F,MAAM,KAAK,GAAe,eAAe,CAAC,CAAC,GAAG,EAAE;IAC9C,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IACnD,MAAM,OAAO,GAAG,CAAC,GAAa,EAAE,EAAE,CAChC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CA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,SAAS,CAAC,GAAG,CAAC,CAAC;QACpB,IAAI,CAAC,OAAO,EAAE,CAAC;QACf,OAAO,GAAG,CAAC;IACb,CAAC;IACD,MAAM;QACJ,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IACzD,CAAC;CACF;AAED;;;;GAIG;AACU,QAAA,MAAM,GAAmB,IAAA,qCAA0B,EAC9D,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAC3B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/crypto.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/crypto.d.ts deleted file mode 100644 index cebbcd1c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/crypto.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const crypto: any; diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/crypto.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/crypto.js deleted file mode 100644 index 8226391f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/crypto.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.crypto = void 0; -exports.crypto = typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined; -//# sourceMappingURL=crypto.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/crypto.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/crypto.js.map deleted file mode 100644 index 9f794e2a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/crypto.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto.js","sourceRoot":"","sources":["src/crypto.ts"],"names":[],"mappings":";;;AAGa,QAAA,MAAM,GACjB,OAAO,UAAU,KAAK,QAAQ,IAAI,QAAQ,IAAI,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/cryptoNode.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/cryptoNode.d.ts deleted file mode 100644 index cebbcd1c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/cryptoNode.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const crypto: any; diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/cryptoNode.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/cryptoNode.js deleted file mode 100644 index a88676d1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/cryptoNode.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.crypto = void 0; -// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+. -// See utils.ts for details. -// The file will throw on node.js 14 and earlier. -// @ts-ignore -const nc = require("node:crypto"); -exports.crypto = nc && typeof nc === 'object' && 'webcrypto' in nc ? nc.webcrypto : undefined; -//# sourceMappingURL=cryptoNode.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/cryptoNode.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/cryptoNode.js.map deleted file mode 100644 index 9287d276..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/cryptoNode.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cryptoNode.js","sourceRoot":"","sources":["src/cryptoNode.ts"],"names":[],"mappings":";;;AAAA,oFAAoF;AACpF,4BAA4B;AAC5B,iDAAiD;AACjD,aAAa;AACb,kCAAkC;AACrB,QAAA,MAAM,GACjB,EAAE,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,WAAW,IAAI,EAAE,CAAC,CAAC,CAAE,EAAE,CAAC,SAAiB,CAAC,CAAC,CAAC,SAAS,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/eskdf.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/eskdf.d.ts deleted file mode 100644 index f0fc54d2..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/eskdf.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -export declare function scrypt(password: string, salt: string): Uint8Array; -export declare function pbkdf2(password: string, salt: string): Uint8Array; -/** - * Derives main seed. Takes a lot of time. Prefer `eskdf` method instead. - */ -export declare function deriveMainSeed(username: string, password: string): Uint8Array; -type AccountID = number | string; -type OptsLength = { - keyLength: number; -}; -type OptsMod = { - modulus: bigint; -}; -type KeyOpts = undefined | OptsLength | OptsMod; -type ESKDF = Promise Uint8Array; - /** - * Deletes the main seed from eskdf instance - */ - expire: () => void; - /** - * Account fingerprint - */ - fingerprint: string; -}>>; -/** - * ESKDF - * @param username - username, email, or identifier, min: 8 characters, should have enough entropy - * @param password - password, min: 8 characters, should have enough entropy - * @example - * const kdf = await eskdf('example-university', 'beginning-new-example'); - * const key = kdf.deriveChildKey('aes', 0); - * console.log(kdf.fingerprint); - * kdf.expire(); - */ -export declare function eskdf(username: string, password: string): ESKDF; -export {}; diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/eskdf.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/eskdf.js deleted file mode 100644 index bc622b6a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/eskdf.js +++ /dev/null @@ -1,162 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.eskdf = exports.deriveMainSeed = exports.pbkdf2 = exports.scrypt = void 0; -const _assert_js_1 = require("./_assert.js"); -const hkdf_js_1 = require("./hkdf.js"); -const sha256_js_1 = require("./sha256.js"); -const pbkdf2_js_1 = require("./pbkdf2.js"); -const scrypt_js_1 = require("./scrypt.js"); -const utils_js_1 = require("./utils.js"); -// A tiny KDF for various applications like AES key-gen. -// Uses HKDF in a non-standard way, so it's not "KDF-secure", only "PRF-secure". -// Which is good enough: assume sha2-256 retained preimage resistance. -const SCRYPT_FACTOR = 2 ** 19; -const PBKDF2_FACTOR = 2 ** 17; -// Scrypt KDF -function scrypt(password, salt) { - return (0, scrypt_js_1.scrypt)(password, salt, { N: SCRYPT_FACTOR, r: 8, p: 1, dkLen: 32 }); -} -exports.scrypt = scrypt; -// PBKDF2-HMAC-SHA256 -function pbkdf2(password, salt) { - return (0, pbkdf2_js_1.pbkdf2)(sha256_js_1.sha256, password, salt, { c: PBKDF2_FACTOR, dkLen: 32 }); -} -exports.pbkdf2 = pbkdf2; -// Combines two 32-byte byte arrays -function xor32(a, b) { - (0, _assert_js_1.bytes)(a, 32); - (0, _assert_js_1.bytes)(b, 32); - const arr = new Uint8Array(32); - for (let i = 0; i < 32; i++) { - arr[i] = a[i] ^ b[i]; - } - return arr; -} -function strHasLength(str, min, max) { - return typeof str === 'string' && str.length >= min && str.length <= max; -} -/** - * Derives main seed. Takes a lot of time. Prefer `eskdf` method instead. - */ -function deriveMainSeed(username, password) { - if (!strHasLength(username, 8, 255)) - throw new Error('invalid username'); - if (!strHasLength(password, 8, 255)) - throw new Error('invalid password'); - const scr = scrypt(password + '\u{1}', username + '\u{1}'); - const pbk = pbkdf2(password + '\u{2}', username + '\u{2}'); - const res = xor32(scr, pbk); - scr.fill(0); - pbk.fill(0); - return res; -} -exports.deriveMainSeed = deriveMainSeed; -/** - * Converts protocol & accountId pair to HKDF salt & info params. - */ -function getSaltInfo(protocol, accountId = 0) { - // Note that length here also repeats two lines below - // We do an additional length check here to reduce the scope of DoS attacks - if (!(strHasLength(protocol, 3, 15) && /^[a-z0-9]{3,15}$/.test(protocol))) { - throw new Error('invalid protocol'); - } - // Allow string account ids for some protocols - const allowsStr = /^password\d{0,3}|ssh|tor|file$/.test(protocol); - let salt; // Extract salt. Default is undefined. - if (typeof accountId === 'string') { - if (!allowsStr) - throw new Error('accountId must be a number'); - if (!strHasLength(accountId, 1, 255)) - throw new Error('accountId must be valid string'); - salt = (0, utils_js_1.toBytes)(accountId); - } - else if (Number.isSafeInteger(accountId)) { - if (accountId < 0 || accountId > 2 ** 32 - 1) - throw new Error('invalid accountId'); - // Convert to Big Endian Uint32 - salt = new Uint8Array(4); - (0, utils_js_1.createView)(salt).setUint32(0, accountId, false); - } - else { - throw new Error(`accountId must be a number${allowsStr ? ' or string' : ''}`); - } - const info = (0, utils_js_1.toBytes)(protocol); - return { salt, info }; -} -function countBytes(num) { - if (typeof num !== 'bigint' || num <= BigInt(128)) - throw new Error('invalid number'); - return Math.ceil(num.toString(2).length / 8); -} -/** - * Parses keyLength and modulus options to extract length of result key. - * If modulus is used, adds 64 bits to it as per FIPS 186 B.4.1 to combat modulo bias. - */ -function getKeyLength(options) { - if (!options || typeof options !== 'object') - return 32; - const hasLen = 'keyLength' in options; - const hasMod = 'modulus' in options; - if (hasLen && hasMod) - throw new Error('cannot combine keyLength and modulus options'); - if (!hasLen && !hasMod) - throw new Error('must have either keyLength or modulus option'); - // FIPS 186 B.4.1 requires at least 64 more bits - const l = hasMod ? countBytes(options.modulus) + 8 : options.keyLength; - if (!(typeof l === 'number' && l >= 16 && l <= 8192)) - throw new Error('invalid keyLength'); - return l; -} -/** - * Converts key to bigint and divides it by modulus. Big Endian. - * Implements FIPS 186 B.4.1, which removes 0 and modulo bias from output. - */ -function modReduceKey(key, modulus) { - const _1 = BigInt(1); - const num = BigInt('0x' + (0, utils_js_1.bytesToHex)(key)); // check for ui8a, then bytesToNumber() - const res = (num % (modulus - _1)) + _1; // Remove 0 from output - if (res < _1) - throw new Error('expected positive number'); // Guard against bad values - const len = key.length - 8; // FIPS requires 64 more bits = 8 bytes - const hex = res.toString(16).padStart(len * 2, '0'); // numberToHex() - const bytes = (0, utils_js_1.hexToBytes)(hex); - if (bytes.length !== len) - throw new Error('invalid length of result key'); - return bytes; -} -/** - * ESKDF - * @param username - username, email, or identifier, min: 8 characters, should have enough entropy - * @param password - password, min: 8 characters, should have enough entropy - * @example - * const kdf = await eskdf('example-university', 'beginning-new-example'); - * const key = kdf.deriveChildKey('aes', 0); - * console.log(kdf.fingerprint); - * kdf.expire(); - */ -async function eskdf(username, password) { - // We are using closure + object instead of class because - // we want to make `seed` non-accessible for any external function. - let seed = deriveMainSeed(username, password); - function deriveCK(protocol, accountId = 0, options) { - (0, _assert_js_1.bytes)(seed, 32); - const { salt, info } = getSaltInfo(protocol, accountId); // validate protocol & accountId - const keyLength = getKeyLength(options); // validate options - const key = (0, hkdf_js_1.hkdf)(sha256_js_1.sha256, seed, salt, info, keyLength); - // Modulus has already been validated - return options && 'modulus' in options ? modReduceKey(key, options.modulus) : key; - } - function expire() { - if (seed) - seed.fill(1); - seed = undefined; - } - // prettier-ignore - const fingerprint = Array.from(deriveCK('fingerprint', 0)) - .slice(0, 6) - .map((char) => char.toString(16).padStart(2, '0').toUpperCase()) - .join(':'); - return Object.freeze({ deriveChildKey: deriveCK, expire, fingerprint }); -} -exports.eskdf = eskdf; -//# sourceMappingURL=eskdf.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/eskdf.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/eskdf.js.map deleted file mode 100644 index 70c49e9f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/eskdf.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"eskdf.js","sourceRoot":"","sources":["src/eskdf.ts"],"names":[],"mappings":";;;AAAA,6CAAoD;AACpD,uCAAiC;AACjC,2CAAqC;AACrC,2CAAgD;AAChD,2CAAgD;AAChD,yCAAyE;AAEzE,wDAAwD;AACxD,gFAAgF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C,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;SAC/D,IAAI,CAAC,GAAG,CAAC,CAAC;IACb,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC;AAC1E,CAAC;AAvBD,sBAuBC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/_assert.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/_assert.js deleted file mode 100644 index 4259cea0..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/_assert.js +++ /dev/null @@ -1,37 +0,0 @@ -function number(n) { - if (!Number.isSafeInteger(n) || n < 0) - throw new Error(`Wrong positive integer: ${n}`); -} -function bool(b) { - if (typeof b !== 'boolean') - throw new Error(`Expected boolean, not ${b}`); -} -function bytes(b, ...lengths) { - if (!(b instanceof Uint8Array)) - throw new Error('Expected Uint8Array'); - if (lengths.length > 0 && !lengths.includes(b.length)) - throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`); -} -function hash(hash) { - if (typeof hash !== 'function' || typeof hash.create !== 'function') - throw new Error('Hash should be wrapped by utils.wrapConstructor'); - number(hash.outputLen); - number(hash.blockLen); -} -function exists(instance, checkFinished = true) { - if (instance.destroyed) - throw new Error('Hash instance has been destroyed'); - if (checkFinished && instance.finished) - throw new Error('Hash#digest() has already been called'); -} -function output(out, instance) { - bytes(out); - const min = instance.outputLen; - if (out.length < min) { - throw new Error(`digestInto() expects output buffer of length at least ${min}`); - } -} -export { number, bool, bytes, hash, exists, output }; -const assert = { number, bool, bytes, hash, exists, output }; -export default assert; -//# sourceMappingURL=_assert.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/_assert.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/_assert.js.map deleted file mode 100644 index d8f294f7..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/_assert.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_assert.js","sourceRoot":"","sources":["../src/_assert.ts"],"names":[],"mappings":"AAAA,SAAS,MAAM,CAAC,CAAS;IACvB,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,EAAE,CAAC,CAAC;AACzF,CAAC;AAED,SAAS,IAAI,CAAC,CAAU;IACtB,IAAI,OAAO,CAAC,KAAK,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,EAAE,CAAC,CAAC;AAC5E,CAAC;AAED,SAAS,KAAK,CAAC,CAAyB,EAAE,GAAG,OAAiB;IAC5D,IAAI,CAAC,CAAC,CAAC,YAAY,UAAU,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;IACvE,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC;QACnD,MAAM,IAAI,KAAK,CAAC,iCAAiC,OAAO,mBAAmB,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;AAC3F,CAAC;AAQD,SAAS,IAAI,CAAC,IAAU;IACtB,IAAI,OAAO,IAAI,KAAK,UAAU,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,UAAU;QACjE,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;IACrE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACvB,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACxB,CAAC;AAED,SAAS,MAAM,CAAC,QAAa,EAAE,aAAa,GAAG,IAAI;IACjD,IAAI,QAAQ,CAAC,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IAC5E,IAAI,aAAa,IAAI,QAAQ,CAAC,QAAQ;QAAE,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;AACnG,CAAC;AACD,SAAS,MAAM,CAAC,GAAQ,EAAE,QAAa;IACrC,KAAK,CAAC,GAAG,CAAC,CAAC;IACX,MAAM,GAAG,GAAG,QAAQ,CAAC,SAAS,CAAC;IAC/B,IAAI,GAAG,CAAC,MAAM,GAAG,GAAG,EAAE;QACpB,MAAM,IAAI,KAAK,CAAC,yDAAyD,GAAG,EAAE,CAAC,CAAC;KACjF;AACH,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAErD,MAAM,MAAM,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAC7D,eAAe,MAAM,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/_blake2.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/_blake2.js deleted file mode 100644 index 948e01b9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/_blake2.js +++ /dev/null @@ -1,108 +0,0 @@ -import { number, exists, output } from './_assert.js'; -import { Hash, toBytes, u32 } from './utils.js'; -// Blake is based on ChaCha permutation. -// For BLAKE2b, the two extra permutations for rounds 10 and 11 are SIGMA[10..11] = SIGMA[0..1]. -// prettier-ignore -export const SIGMA = /* @__PURE__ */ new Uint8Array([ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3, - 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4, - 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8, - 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13, - 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9, - 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11, - 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10, - 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5, - 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3, -]); -export class BLAKE2 extends Hash { - constructor(blockLen, outputLen, opts = {}, keyLen, saltLen, persLen) { - super(); - this.blockLen = blockLen; - this.outputLen = outputLen; - this.length = 0; - this.pos = 0; - this.finished = false; - this.destroyed = false; - number(blockLen); - number(outputLen); - number(keyLen); - if (outputLen < 0 || outputLen > keyLen) - throw new Error('outputLen bigger than keyLen'); - if (opts.key !== undefined && (opts.key.length < 1 || opts.key.length > keyLen)) - throw new Error(`key must be up 1..${keyLen} byte long or undefined`); - if (opts.salt !== undefined && opts.salt.length !== saltLen) - throw new Error(`salt must be ${saltLen} byte long or undefined`); - if (opts.personalization !== undefined && opts.personalization.length !== persLen) - throw new Error(`personalization must be ${persLen} byte long or undefined`); - this.buffer32 = u32((this.buffer = new Uint8Array(blockLen))); - } - update(data) { - exists(this); - // Main difference with other hashes: there is flag for last block, - // so we cannot process current block before we know that there - // is the next one. This significantly complicates logic and reduces ability - // to do zero-copy processing - const { blockLen, buffer, buffer32 } = this; - data = toBytes(data); - const len = data.length; - const offset = data.byteOffset; - const buf = data.buffer; - for (let pos = 0; pos < len;) { - // If buffer is full and we still have input (don't process last block, same as blake2s) - if (this.pos === blockLen) { - this.compress(buffer32, 0, false); - this.pos = 0; - } - const take = Math.min(blockLen - this.pos, len - pos); - const dataOffset = offset + pos; - // full block && aligned to 4 bytes && not last in input - if (take === blockLen && !(dataOffset % 4) && pos + take < len) { - const data32 = new Uint32Array(buf, dataOffset, Math.floor((len - pos) / 4)); - for (let pos32 = 0; pos + blockLen < len; pos32 += buffer32.length, pos += blockLen) { - this.length += blockLen; - this.compress(data32, pos32, false); - } - continue; - } - buffer.set(data.subarray(pos, pos + take), this.pos); - this.pos += take; - this.length += take; - pos += take; - } - return this; - } - digestInto(out) { - exists(this); - output(out, this); - const { pos, buffer32 } = this; - this.finished = true; - // Padding - this.buffer.subarray(pos).fill(0); - this.compress(buffer32, 0, true); - const out32 = u32(out); - this.get().forEach((v, i) => (out32[i] = v)); - } - digest() { - const { buffer, outputLen } = this; - this.digestInto(buffer); - const res = buffer.slice(0, outputLen); - this.destroy(); - return res; - } - _cloneInto(to) { - const { buffer, length, finished, destroyed, outputLen, pos } = this; - to || (to = new this.constructor({ dkLen: outputLen })); - to.set(...this.get()); - to.length = length; - to.finished = finished; - to.destroyed = destroyed; - to.outputLen = outputLen; - to.buffer.set(buffer); - to.pos = pos; - return to; - } -} -//# sourceMappingURL=_blake2.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/_blake2.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/_blake2.js.map deleted file mode 100644 index 4222d074..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/_blake2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_blake2.js","sourceRoot":"","sources":["../src/_blake2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,IAAI,EAAS,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEvD,wCAAwC;AAExC,gGA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,UAAU,CAAC,EAAM;QACf,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;QACrE,EAAE,KAAF,EAAE,GAAK,IAAK,IAAI,CAAC,WAAmB,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAM,EAAC;QAChE,EAAE,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QACtB,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC;QACnB,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACvB,EAAE,CAAC,SAAS,GAAG,SAAS,CAAC;QACzB,EAAE,CAAC,SAAS,GAAG,SAAS,CAAC;QACzB,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACtB,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC;QACb,OAAO,EAAE,CAAC;IACZ,CAAC;CACF"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/_sha2.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/_sha2.js deleted file mode 100644 index cd26ea45..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/_sha2.js +++ /dev/null @@ -1,114 +0,0 @@ -import { exists, output } from './_assert.js'; -import { Hash, createView, toBytes } from './utils.js'; -// Polyfill for Safari 14 -function setBigUint64(view, byteOffset, value, isLE) { - if (typeof view.setBigUint64 === 'function') - return view.setBigUint64(byteOffset, value, isLE); - const _32n = BigInt(32); - const _u32_max = BigInt(0xffffffff); - const wh = Number((value >> _32n) & _u32_max); - const wl = Number(value & _u32_max); - const h = isLE ? 4 : 0; - const l = isLE ? 0 : 4; - view.setUint32(byteOffset + h, wh, isLE); - view.setUint32(byteOffset + l, wl, isLE); -} -// Base SHA2 class (RFC 6234) -export class SHA2 extends Hash { - constructor(blockLen, outputLen, padOffset, isLE) { - super(); - this.blockLen = blockLen; - this.outputLen = outputLen; - this.padOffset = padOffset; - this.isLE = isLE; - this.finished = false; - this.length = 0; - this.pos = 0; - this.destroyed = false; - this.buffer = new Uint8Array(blockLen); - this.view = createView(this.buffer); - } - update(data) { - exists(this); - const { view, buffer, blockLen } = this; - data = toBytes(data); - const len = data.length; - for (let pos = 0; pos < len;) { - const take = Math.min(blockLen - this.pos, len - pos); - // Fast path: we have at least one block in input, cast it to view and process - if (take === blockLen) { - const dataView = createView(data); - for (; blockLen <= len - pos; pos += blockLen) - this.process(dataView, pos); - continue; - } - buffer.set(data.subarray(pos, pos + take), this.pos); - this.pos += take; - pos += take; - if (this.pos === blockLen) { - this.process(view, 0); - this.pos = 0; - } - } - this.length += data.length; - this.roundClean(); - return this; - } - digestInto(out) { - exists(this); - output(out, this); - this.finished = true; - // Padding - // We can avoid allocation of buffer for padding completely if it - // was previously not allocated here. But it won't change performance. - const { buffer, view, blockLen, isLE } = this; - let { pos } = this; - // append the bit '1' to the message - buffer[pos++] = 0b10000000; - this.buffer.subarray(pos).fill(0); - // we have less than padOffset left in buffer, so we cannot put length in current block, need process it and pad again - if (this.padOffset > blockLen - pos) { - this.process(view, 0); - pos = 0; - } - // Pad until full block byte with zeros - for (let i = pos; i < blockLen; i++) - buffer[i] = 0; - // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that - // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen. - // So we just write lowest 64 bits of that value. - setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE); - this.process(view, 0); - const oview = createView(out); - const len = this.outputLen; - // NOTE: we do division by 4 later, which should be fused in single op with modulo by JIT - if (len % 4) - throw new Error('_sha2: outputLen should be aligned to 32bit'); - const outLen = len / 4; - const state = this.get(); - if (outLen > state.length) - throw new Error('_sha2: outputLen bigger than state'); - for (let i = 0; i < outLen; i++) - oview.setUint32(4 * i, state[i], isLE); - } - digest() { - const { buffer, outputLen } = this; - this.digestInto(buffer); - const res = buffer.slice(0, outputLen); - this.destroy(); - return res; - } - _cloneInto(to) { - to || (to = new this.constructor()); - to.set(...this.get()); - const { blockLen, buffer, length, finished, destroyed, pos } = this; - to.length = length; - to.pos = pos; - to.finished = finished; - to.destroyed = destroyed; - if (length % blockLen) - to.buffer.set(buffer); - return to; - } -} -//# sourceMappingURL=_sha2.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/_sha2.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/_sha2.js.map deleted file mode 100644 index 1675e441..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/_sha2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_sha2.js","sourceRoot":"","sources":["../src/_sha2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,UAAU,EAAS,OAAO,EAAE,MAAM,YAAY,CAAC;AAE9D,yBAAyB;AACzB,SAAS,YAAY,CAAC,IAAc,EAAE,UAAkB,EAAE,KAAa,EAAE,IAAa;IACpF,IAAI,OAAO,IAAI,CAAC,YAAY,KAAK,UAAU;QAAE,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IAC/F,MAAM,IAAI,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;IACxB,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;IACpC,MAAM,EAAE,GAAG,MAAM,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC;IAC9C,MAAM,EAAE,GAAG,MAAM,CAAC,KAAK,GAAG,QAAQ,CAAC,CAAC;IACpC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACvB,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M,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;QACvC,IAAI,CAAC,OAAO,EAAE,CAAC;QACf,OAAO,GAAG,CAAC;IACb,CAAC;IACD,UAAU,CAAC,EAAM;QACf,EAAE,KAAF,EAAE,GAAK,IAAK,IAAI,CAAC,WAAmB,EAAO,EAAC;QAC5C,EAAE,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QACtB,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;QACpE,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC;QACnB,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC;QACb,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACvB,EAAE,CAAC,SAAS,GAAG,SAAS,CAAC;QACzB,IAAI,MAAM,GAAG,QAAQ;YAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC7C,OAAO,EAAE,CAAC;IACZ,CAAC;CACF"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/_u64.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/_u64.js deleted file mode 100644 index 66cce47e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/_u64.js +++ /dev/null @@ -1,62 +0,0 @@ -const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1); -const _32n = /* @__PURE__ */ BigInt(32); -// We are not using BigUint64Array, because they are extremely slow as per 2022 -function fromBig(n, le = false) { - if (le) - return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) }; - return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 }; -} -function split(lst, le = false) { - let Ah = new Uint32Array(lst.length); - let Al = new Uint32Array(lst.length); - for (let i = 0; i < lst.length; i++) { - const { h, l } = fromBig(lst[i], le); - [Ah[i], Al[i]] = [h, l]; - } - return [Ah, Al]; -} -const toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0); -// for Shift in [0, 32) -const shrSH = (h, _l, s) => h >>> s; -const shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); -// Right rotate for Shift in [1, 32) -const rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s)); -const rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); -// Right rotate for Shift in (32, 64), NOTE: 32 is special case. -const rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32)); -const rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s)); -// Right rotate for shift===32 (just swaps l&h) -const rotr32H = (_h, l) => l; -const rotr32L = (h, _l) => h; -// Left rotate for Shift in [1, 32) -const rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s)); -const rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s)); -// Left rotate for Shift in (32, 64), NOTE: 32 is special case. -const rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s)); -const rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s)); -// JS uses 32-bit signed integers for bitwise operations which means we cannot -// simple take carry out of low bit sum by shift, we need to use division. -function add(Ah, Al, Bh, Bl) { - const l = (Al >>> 0) + (Bl >>> 0); - return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 }; -} -// Addition with more than 2 elements -const add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); -const add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0; -const add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); -const add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0; -const add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); -const add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0; -// prettier-ignore -export { fromBig, split, toBig, shrSH, shrSL, rotrSH, rotrSL, rotrBH, rotrBL, rotr32H, rotr32L, rotlSH, rotlSL, rotlBH, rotlBL, add, add3L, add3H, add4L, add4H, add5H, add5L, }; -// prettier-ignore -const u64 = { - fromBig, split, toBig, - shrSH, shrSL, - rotrSH, rotrSL, rotrBH, rotrBL, - rotr32H, rotr32L, - rotlSH, rotlSL, rotlBH, rotlBL, - add, add3L, add3H, add4L, add4H, add5H, add5L, -}; -export default u64; -//# sourceMappingURL=_u64.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/_u64.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/_u64.js.map deleted file mode 100644 index b2339ed7..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/_u64.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_u64.js","sourceRoot":"","sources":["../src/_u64.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;AACvD,MAAM,IAAI,GAAG,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAExC,+EAA+E;AAC/E,SAAS,OAAO,CAAC,CAAS,EAAE,EAAE,GAAG,KAAK;IACpC,IAAI,EAAE;QAAE,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,UAAU,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,UAAU,CAAC,EAAE,CAAC;IAClF,OAAO,E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AAE,MAAM,EAAE,MAAM,EAC9B,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAC9B,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,GAC9C,CAAC;AACF,kBAAkB;AAClB,MAAM,GAAG,GAAG;IACV,OAAO,EAAE,KAAK,EAAE,KAAK;IACrB,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAC9B,OAAO,EAAE,OAAO;IAChB,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAC9B,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;CAC9C,CAAC;AACF,eAAe,GAAG,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/argon2.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/argon2.js deleted file mode 100644 index 1e5a6b08..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/argon2.js +++ /dev/null @@ -1,297 +0,0 @@ -import { number as assertNumber } from './_assert.js'; -import { toBytes, u8, u32 } from './utils.js'; -import { blake2b } from './blake2b.js'; -import { add3H, add3L, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL } from './_u64.js'; -const ARGON2_SYNC_POINTS = 4; -const toBytesOptional = (buf) => (buf !== undefined ? toBytes(buf) : new Uint8Array([])); -function mul(a, b) { - const aL = a & 0xffff; - const aH = a >>> 16; - const bL = b & 0xffff; - const bH = b >>> 16; - const ll = Math.imul(aL, bL); - const hl = Math.imul(aH, bL); - const lh = Math.imul(aL, bH); - const hh = Math.imul(aH, bH); - const BUF = ((ll >>> 16) + (hl & 0xffff) + lh) | 0; - const h = ((hl >>> 16) + (BUF >>> 16) + hh) | 0; - return { h, l: (BUF << 16) | (ll & 0xffff) }; -} -function relPos(areaSize, relativePos) { - // areaSize - 1 - ((areaSize * ((relativePos ** 2) >>> 32)) >>> 32) - return areaSize - 1 - mul(areaSize, mul(relativePos, relativePos).h).h; -} -function mul2(a, b) { - // 2 * a * b (via shifts) - const { h, l } = mul(a, b); - return { h: ((h << 1) | (l >>> 31)) & 4294967295, l: (l << 1) & 4294967295 }; -} -function blamka(Ah, Al, Bh, Bl) { - const { h: Ch, l: Cl } = mul2(Al, Bl); - // A + B + (2 * A * B) - const Rll = add3L(Al, Bl, Cl); - return { h: add3H(Rll, Ah, Bh, Ch), l: Rll | 0 }; -} -// Temporary block buffer -const BUF = new Uint32Array(256); -function G(a, b, c, d) { - let Al = BUF[2 * a], Ah = BUF[2 * a + 1]; // prettier-ignore - let Bl = BUF[2 * b], Bh = BUF[2 * b + 1]; // prettier-ignore - let Cl = BUF[2 * c], Ch = BUF[2 * c + 1]; // prettier-ignore - let Dl = BUF[2 * d], Dh = BUF[2 * d + 1]; // prettier-ignore - ({ h: Ah, l: Al } = blamka(Ah, Al, Bh, Bl)); - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: rotr32H(Dh, Dl), Dl: rotr32L(Dh, Dl) }); - ({ h: Ch, l: Cl } = blamka(Ch, Cl, Dh, Dl)); - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: rotrSH(Bh, Bl, 24), Bl: rotrSL(Bh, Bl, 24) }); - ({ h: Ah, l: Al } = blamka(Ah, Al, Bh, Bl)); - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: rotrSH(Dh, Dl, 16), Dl: rotrSL(Dh, Dl, 16) }); - ({ h: Ch, l: Cl } = blamka(Ch, Cl, Dh, Dl)); - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: rotrBH(Bh, Bl, 63), Bl: rotrBL(Bh, Bl, 63) }); - (BUF[2 * a] = Al), (BUF[2 * a + 1] = Ah); - (BUF[2 * b] = Bl), (BUF[2 * b + 1] = Bh); - (BUF[2 * c] = Cl), (BUF[2 * c + 1] = Ch); - (BUF[2 * d] = Dl), (BUF[2 * d + 1] = Dh); -} -// prettier-ignore -function P(v00, v01, v02, v03, v04, v05, v06, v07, v08, v09, v10, v11, v12, v13, v14, v15) { - G(v00, v04, v08, v12); - G(v01, v05, v09, v13); - G(v02, v06, v10, v14); - G(v03, v07, v11, v15); - G(v00, v05, v10, v15); - G(v01, v06, v11, v12); - G(v02, v07, v08, v13); - G(v03, v04, v09, v14); -} -function block(x, xPos, yPos, outPos, needXor) { - for (let i = 0; i < 256; i++) - BUF[i] = x[xPos + i] ^ x[yPos + i]; - // columns - for (let i = 0; i < 128; i += 16) { - // prettier-ignore - P(i, i + 1, i + 2, i + 3, i + 4, i + 5, i + 6, i + 7, i + 8, i + 9, i + 10, i + 11, i + 12, i + 13, i + 14, i + 15); - } - // rows - for (let i = 0; i < 16; i += 2) { - // prettier-ignore - P(i, i + 1, i + 16, i + 17, i + 32, i + 33, i + 48, i + 49, i + 64, i + 65, i + 80, i + 81, i + 96, i + 97, i + 112, i + 113); - } - if (needXor) - for (let i = 0; i < 256; i++) - x[outPos + i] ^= BUF[i] ^ x[xPos + i] ^ x[yPos + i]; - else - for (let i = 0; i < 256; i++) - x[outPos + i] = BUF[i] ^ x[xPos + i] ^ x[yPos + i]; -} -// Variable-Length Hash Function H' -function Hp(A, dkLen) { - const A8 = u8(A); - const T = new Uint32Array(1); - const T8 = u8(T); - T[0] = dkLen; - // Fast path - if (dkLen <= 64) - return blake2b.create({ dkLen }).update(T8).update(A8).digest(); - const out = new Uint8Array(dkLen); - let V = blake2b.create({}).update(T8).update(A8).digest(); - let pos = 0; - // First block - out.set(V.subarray(0, 32)); - pos += 32; - // Rest blocks - for (; dkLen - pos > 64; pos += 32) - out.set((V = blake2b(V)).subarray(0, 32), pos); - // Last block - out.set(blake2b(V, { dkLen: dkLen - pos }), pos); - return u32(out); -} -function indexAlpha(r, s, laneLen, segmentLen, index, randL, sameLane = false) { - let area; - if (0 == r) { - if (0 == s) - area = index - 1; - else if (sameLane) - area = s * segmentLen + index - 1; - else - area = s * segmentLen + (index == 0 ? -1 : 0); - } - else if (sameLane) - area = laneLen - segmentLen + index - 1; - else - area = laneLen - segmentLen + (index == 0 ? -1 : 0); - const startPos = r !== 0 && s !== ARGON2_SYNC_POINTS - 1 ? (s + 1) * segmentLen : 0; - const rel = relPos(area, randL); - // NOTE: check about overflows here - // absPos = (startPos + relPos) % laneLength; - return (startPos + rel) % laneLen; -} -function argon2Init(type, password, salt, opts) { - password = toBytes(password); - salt = toBytes(salt); - let { p, dkLen, m, t, version, key, personalization, maxmem, onProgress } = { - ...opts, - version: opts.version || 0x13, - dkLen: opts.dkLen || 32, - maxmem: 2 ** 32, - }; - // Validation - assertNumber(p); - assertNumber(dkLen); - assertNumber(m); - assertNumber(t); - assertNumber(version); - if (dkLen < 4 || dkLen >= 2 ** 32) - throw new Error('Argon2: dkLen should be at least 4 bytes'); - if (p < 1 || p >= 2 ** 32) - throw new Error('Argon2: p (parallelism) should be at least 1'); - if (t < 1 || t >= 2 ** 32) - throw new Error('Argon2: t (iterations) should be at least 1'); - if (m < 8 * p) - throw new Error(`Argon2: memory should be at least 8*p bytes`); - if (version !== 16 && version !== 19) - throw new Error(`Argon2: unknown version=${version}`); - password = toBytes(password); - if (password.length < 0 || password.length >= 2 ** 32) - throw new Error('Argon2: password should be less than 4 GB'); - salt = toBytes(salt); - if (salt.length < 8) - throw new Error('Argon2: salt should be at least 8 bytes'); - key = toBytesOptional(key); - personalization = toBytesOptional(personalization); - if (onProgress !== undefined && typeof onProgress !== 'function') - throw new Error('progressCb should be function'); - // Params - const lanes = p; - // m' = 4 * p * floor (m / 4p) - const mP = 4 * p * Math.floor(m / (ARGON2_SYNC_POINTS * p)); - //q = m' / p columns - const laneLen = Math.floor(mP / p); - const segmentLen = Math.floor(laneLen / ARGON2_SYNC_POINTS); - // H0 - const h = blake2b.create({}); - const BUF = new Uint32Array(1); - const BUF8 = u8(BUF); - for (const i of [p, dkLen, m, t, version, type]) { - if (i < 0 || i >= 2 ** 32) - throw new Error(`Argon2: wrong parameter=${i}, expected uint32`); - BUF[0] = i; - h.update(BUF8); - } - for (let i of [password, salt, key, personalization]) { - BUF[0] = i.length; - h.update(BUF8).update(i); - } - const H0 = new Uint32Array(18); - const H0_8 = u8(H0); - h.digestInto(H0_8); - // 256 u32 = 1024 (BLOCK_SIZE) - const memUsed = mP * 256; - if (memUsed < 0 || memUsed >= 2 ** 32 || memUsed > maxmem) { - throw new Error(`Argon2: wrong params (memUsed=${memUsed} maxmem=${maxmem}), should be less than 2**32`); - } - const B = new Uint32Array(memUsed); - // Fill first blocks - for (let l = 0; l < p; l++) { - const i = 256 * laneLen * l; - // B[i][0] = H'^(1024)(H_0 || LE32(0) || LE32(i)) - H0[17] = l; - H0[16] = 0; - B.set(Hp(H0, 1024), i); - // B[i][1] = H'^(1024)(H_0 || LE32(1) || LE32(i)) - H0[16] = 1; - B.set(Hp(H0, 1024), i + 256); - } - let perBlock = () => { }; - if (onProgress) { - const totalBlock = t * ARGON2_SYNC_POINTS * p * segmentLen; - // Invoke callback if progress changes from 10.01 to 10.02 - // Allows to draw smooth progress bar on up to 8K screen - const callbackPer = Math.max(Math.floor(totalBlock / 10000), 1); - let blockCnt = 0; - perBlock = () => { - blockCnt++; - if (onProgress && (!(blockCnt % callbackPer) || blockCnt === totalBlock)) - onProgress(blockCnt / totalBlock); - }; - } - return { type, mP, p, t, version, B, laneLen, lanes, segmentLen, dkLen, perBlock }; -} -function argon2Output(B, p, laneLen, dkLen) { - const B_final = new Uint32Array(256); - for (let l = 0; l < p; l++) - for (let j = 0; j < 256; j++) - B_final[j] ^= B[256 * (laneLen * l + laneLen - 1) + j]; - return u8(Hp(B_final, dkLen)); -} -function processBlock(B, address, l, r, s, index, laneLen, segmentLen, lanes, offset, prev, dataIndependent, needXor) { - if (offset % laneLen) - prev = offset - 1; - let randL, randH; - if (dataIndependent) { - if (index % 128 === 0) { - address[256 + 12]++; - block(address, 256, 2 * 256, 0, false); - block(address, 0, 2 * 256, 0, false); - } - randL = address[2 * (index % 128)]; - randH = address[2 * (index % 128) + 1]; - } - else { - const T = 256 * prev; - randL = B[T]; - randH = B[T + 1]; - } - // address block - const refLane = r === 0 && s === 0 ? l : randH % lanes; - const refPos = indexAlpha(r, s, laneLen, segmentLen, index, randL, refLane == l); - const refBlock = laneLen * refLane + refPos; - // B[i][j] = G(B[i][j-1], B[l][z]) - block(B, 256 * prev, 256 * refBlock, offset * 256, needXor); -} -function argon2(type, password, salt, opts) { - const { mP, p, t, version, B, laneLen, lanes, segmentLen, dkLen, perBlock } = argon2Init(type, password, salt, opts); - // Pre-loop setup - // [address, input, zero_block] format so we can pass single U32 to block function - const address = new Uint32Array(3 * 256); - address[256 + 6] = mP; - address[256 + 8] = t; - address[256 + 10] = type; - for (let r = 0; r < t; r++) { - const needXor = r !== 0 && version === 0x13; - address[256 + 0] = r; - for (let s = 0; s < ARGON2_SYNC_POINTS; s++) { - address[256 + 4] = s; - const dataIndependent = type == 1 /* Types.Argon2i */ || (type == 2 /* Types.Argon2id */ && r === 0 && s < 2); - for (let l = 0; l < p; l++) { - address[256 + 2] = l; - address[256 + 12] = 0; - let startPos = 0; - if (r === 0 && s === 0) { - startPos = 2; - if (dataIndependent) { - address[256 + 12]++; - block(address, 256, 2 * 256, 0, false); - block(address, 0, 2 * 256, 0, false); - } - } - // current block postion - let offset = l * laneLen + s * segmentLen + startPos; - // previous block position - let prev = offset % laneLen ? offset - 1 : offset + laneLen - 1; - for (let index = startPos; index < segmentLen; index++, offset++, prev++) { - perBlock(); - processBlock(B, address, l, r, s, index, laneLen, segmentLen, lanes, offset, prev, dataIndependent, needXor); - } - } - } - } - return argon2Output(B, p, laneLen, dkLen); -} -export const argon2d = (password, salt, opts) => argon2(0 /* Types.Argond2d */, password, salt, opts); -export const argon2i = (password, salt, opts) => argon2(1 /* Types.Argon2i */, password, salt, opts); -export const argon2id = (password, salt, opts) => argon2(2 /* Types.Argon2id */, password, salt, opts); -//# sourceMappingURL=argon2.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/argon2.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/argon2.js.map deleted file mode 100644 index 267eb62f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/argon2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"argon2.js","sourceRoot":"","sources":["../src/argon2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAS,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAS3F,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAE7B,MAAM,eAAe,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC;AAEjG,SAAS,GAAG,CAAC,CAAS,EAAE,CAAS;IAC/B,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC;IACtB,MAAM,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC;IACpB,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC;IACtB,MAAM,EAAE,GAAG,CAAC,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E,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE;oBACxE,QAAQ,EAAE,CAAC;oBACX,YAAY,CACV,CAAC,EACD,OAAO,EACP,CAAC,EACD,CAAC,EACD,CAAC,EACD,KAAK,EACL,OAAO,EACP,UAAU,EACV,KAAK,EACL,MAAM,EACN,IAAI,EACJ,eAAe,EACf,OAAO,CACR,CAAC;iBACH;aACF;SACF;KACF;IACD,OAAO,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,QAAe,EAAE,IAAW,EAAE,IAAe,EAAE,EAAE,CACvE,MAAM,yBAAiB,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAC/C,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,QAAe,EAAE,IAAW,EAAE,IAAe,EAAE,EAAE,CACvE,MAAM,wBAAgB,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAC9C,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,QAAe,EAAE,IAAW,EAAE,IAAe,EAAE,EAAE,CACxE,MAAM,yBAAiB,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/blake2b.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/blake2b.js deleted file mode 100644 index 29cecc5a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/blake2b.js +++ /dev/null @@ -1,189 +0,0 @@ -import { BLAKE2, SIGMA } from './_blake2.js'; -import u64 from './_u64.js'; -import { toBytes, u32, wrapConstructorWithOpts } from './utils.js'; -// Same as SHA-512 but LE -// prettier-ignore -const IV = /* @__PURE__ */ new Uint32Array([ - 0xf3bcc908, 0x6a09e667, 0x84caa73b, 0xbb67ae85, 0xfe94f82b, 0x3c6ef372, 0x5f1d36f1, 0xa54ff53a, - 0xade682d1, 0x510e527f, 0x2b3e6c1f, 0x9b05688c, 0xfb41bd6b, 0x1f83d9ab, 0x137e2179, 0x5be0cd19 -]); -// Temporary buffer -const BUF = /* @__PURE__ */ new Uint32Array(32); -// Mixing function G splitted in two halfs -function G1(a, b, c, d, msg, x) { - // NOTE: V is LE here - const Xl = msg[x], Xh = msg[x + 1]; // prettier-ignore - let Al = BUF[2 * a], Ah = BUF[2 * a + 1]; // prettier-ignore - let Bl = BUF[2 * b], Bh = BUF[2 * b + 1]; // prettier-ignore - let Cl = BUF[2 * c], Ch = BUF[2 * c + 1]; // prettier-ignore - let Dl = BUF[2 * d], Dh = BUF[2 * d + 1]; // prettier-ignore - // v[a] = (v[a] + v[b] + x) | 0; - let ll = u64.add3L(Al, Bl, Xl); - Ah = u64.add3H(ll, Ah, Bh, Xh); - Al = ll | 0; - // v[d] = rotr(v[d] ^ v[a], 32) - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: u64.rotr32H(Dh, Dl), Dl: u64.rotr32L(Dh, Dl) }); - // v[c] = (v[c] + v[d]) | 0; - ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); - // v[b] = rotr(v[b] ^ v[c], 24) - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: u64.rotrSH(Bh, Bl, 24), Bl: u64.rotrSL(Bh, Bl, 24) }); - (BUF[2 * a] = Al), (BUF[2 * a + 1] = Ah); - (BUF[2 * b] = Bl), (BUF[2 * b + 1] = Bh); - (BUF[2 * c] = Cl), (BUF[2 * c + 1] = Ch); - (BUF[2 * d] = Dl), (BUF[2 * d + 1] = Dh); -} -function G2(a, b, c, d, msg, x) { - // NOTE: V is LE here - const Xl = msg[x], Xh = msg[x + 1]; // prettier-ignore - let Al = BUF[2 * a], Ah = BUF[2 * a + 1]; // prettier-ignore - let Bl = BUF[2 * b], Bh = BUF[2 * b + 1]; // prettier-ignore - let Cl = BUF[2 * c], Ch = BUF[2 * c + 1]; // prettier-ignore - let Dl = BUF[2 * d], Dh = BUF[2 * d + 1]; // prettier-ignore - // v[a] = (v[a] + v[b] + x) | 0; - let ll = u64.add3L(Al, Bl, Xl); - Ah = u64.add3H(ll, Ah, Bh, Xh); - Al = ll | 0; - // v[d] = rotr(v[d] ^ v[a], 16) - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: u64.rotrSH(Dh, Dl, 16), Dl: u64.rotrSL(Dh, Dl, 16) }); - // v[c] = (v[c] + v[d]) | 0; - ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); - // v[b] = rotr(v[b] ^ v[c], 63) - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: u64.rotrBH(Bh, Bl, 63), Bl: u64.rotrBL(Bh, Bl, 63) }); - (BUF[2 * a] = Al), (BUF[2 * a + 1] = Ah); - (BUF[2 * b] = Bl), (BUF[2 * b + 1] = Bh); - (BUF[2 * c] = Cl), (BUF[2 * c + 1] = Ch); - (BUF[2 * d] = Dl), (BUF[2 * d + 1] = Dh); -} -class BLAKE2b extends BLAKE2 { - constructor(opts = {}) { - super(128, opts.dkLen === undefined ? 64 : opts.dkLen, opts, 64, 16, 16); - // Same as SHA-512, but LE - this.v0l = IV[0] | 0; - this.v0h = IV[1] | 0; - this.v1l = IV[2] | 0; - this.v1h = IV[3] | 0; - this.v2l = IV[4] | 0; - this.v2h = IV[5] | 0; - this.v3l = IV[6] | 0; - this.v3h = IV[7] | 0; - this.v4l = IV[8] | 0; - this.v4h = IV[9] | 0; - this.v5l = IV[10] | 0; - this.v5h = IV[11] | 0; - this.v6l = IV[12] | 0; - this.v6h = IV[13] | 0; - this.v7l = IV[14] | 0; - this.v7h = IV[15] | 0; - const keyLength = opts.key ? opts.key.length : 0; - this.v0l ^= this.outputLen | (keyLength << 8) | (0x01 << 16) | (0x01 << 24); - if (opts.salt) { - const salt = u32(toBytes(opts.salt)); - this.v4l ^= salt[0]; - this.v4h ^= salt[1]; - this.v5l ^= salt[2]; - this.v5h ^= salt[3]; - } - if (opts.personalization) { - const pers = u32(toBytes(opts.personalization)); - this.v6l ^= pers[0]; - this.v6h ^= pers[1]; - this.v7l ^= pers[2]; - this.v7h ^= pers[3]; - } - if (opts.key) { - // Pad to blockLen and update - const tmp = new Uint8Array(this.blockLen); - tmp.set(toBytes(opts.key)); - this.update(tmp); - } - } - // prettier-ignore - get() { - let { v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h } = this; - return [v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h]; - } - // prettier-ignore - set(v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h) { - this.v0l = v0l | 0; - this.v0h = v0h | 0; - this.v1l = v1l | 0; - this.v1h = v1h | 0; - this.v2l = v2l | 0; - this.v2h = v2h | 0; - this.v3l = v3l | 0; - this.v3h = v3h | 0; - this.v4l = v4l | 0; - this.v4h = v4h | 0; - this.v5l = v5l | 0; - this.v5h = v5h | 0; - this.v6l = v6l | 0; - this.v6h = v6h | 0; - this.v7l = v7l | 0; - this.v7h = v7h | 0; - } - compress(msg, offset, isLast) { - this.get().forEach((v, i) => (BUF[i] = v)); // First half from state. - BUF.set(IV, 16); // Second half from IV. - let { h, l } = u64.fromBig(BigInt(this.length)); - BUF[24] = IV[8] ^ l; // Low word of the offset. - BUF[25] = IV[9] ^ h; // High word. - // Invert all bits for last block - if (isLast) { - BUF[28] = ~BUF[28]; - BUF[29] = ~BUF[29]; - } - let j = 0; - const s = SIGMA; - for (let i = 0; i < 12; i++) { - G1(0, 4, 8, 12, msg, offset + 2 * s[j++]); - G2(0, 4, 8, 12, msg, offset + 2 * s[j++]); - G1(1, 5, 9, 13, msg, offset + 2 * s[j++]); - G2(1, 5, 9, 13, msg, offset + 2 * s[j++]); - G1(2, 6, 10, 14, msg, offset + 2 * s[j++]); - G2(2, 6, 10, 14, msg, offset + 2 * s[j++]); - G1(3, 7, 11, 15, msg, offset + 2 * s[j++]); - G2(3, 7, 11, 15, msg, offset + 2 * s[j++]); - G1(0, 5, 10, 15, msg, offset + 2 * s[j++]); - G2(0, 5, 10, 15, msg, offset + 2 * s[j++]); - G1(1, 6, 11, 12, msg, offset + 2 * s[j++]); - G2(1, 6, 11, 12, msg, offset + 2 * s[j++]); - G1(2, 7, 8, 13, msg, offset + 2 * s[j++]); - G2(2, 7, 8, 13, msg, offset + 2 * s[j++]); - G1(3, 4, 9, 14, msg, offset + 2 * s[j++]); - G2(3, 4, 9, 14, msg, offset + 2 * s[j++]); - } - this.v0l ^= BUF[0] ^ BUF[16]; - this.v0h ^= BUF[1] ^ BUF[17]; - this.v1l ^= BUF[2] ^ BUF[18]; - this.v1h ^= BUF[3] ^ BUF[19]; - this.v2l ^= BUF[4] ^ BUF[20]; - this.v2h ^= BUF[5] ^ BUF[21]; - this.v3l ^= BUF[6] ^ BUF[22]; - this.v3h ^= BUF[7] ^ BUF[23]; - this.v4l ^= BUF[8] ^ BUF[24]; - this.v4h ^= BUF[9] ^ BUF[25]; - this.v5l ^= BUF[10] ^ BUF[26]; - this.v5h ^= BUF[11] ^ BUF[27]; - this.v6l ^= BUF[12] ^ BUF[28]; - this.v6h ^= BUF[13] ^ BUF[29]; - this.v7l ^= BUF[14] ^ BUF[30]; - this.v7h ^= BUF[15] ^ BUF[31]; - BUF.fill(0); - } - destroy() { - this.destroyed = true; - this.buffer32.fill(0); - this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - } -} -/** - * BLAKE2b - optimized for 64-bit platforms. JS doesn't have uint64, so it's slower than BLAKE2s. - * @param msg - message that would be hashed - * @param opts - dkLen, key, salt, personalization - */ -export const blake2b = /* @__PURE__ */ wrapConstructorWithOpts((opts) => new BLAKE2b(opts)); -//# sourceMappingURL=blake2b.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/blake2b.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/blake2b.js.map deleted file mode 100644 index a4487867..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/blake2b.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blake2b.js","sourceRoot":"","sources":["../src/blake2b.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAa,KAAK,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,GAAG,MAAM,WAAW,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAEnE,yBAAyB;AACzB,kBAAkB;AAClB,MAAM,EAAE,GAAG,eAAe,CAAC,IAAI,WAAW,CAAC;IACzC,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IAC9F,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;CAC/F,CAAC,CAAC;AACH,mBAAmB;AACnB,MAAM,GAAG,GAAG,eAAe,CAAC,IAAI,WAAW,CAAC,EAAE,CAAC,CAAC;AAEhD,0CAA0C;AAC1C,SAAS,EAAE,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,GAAgB,EAAE,CAAS;IACjF,qBAAqB;IACrB,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,kBAAkB;IACtD,IAAI,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,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC;QAC9B,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC;QAC9B,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC;QAC9B,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACd,CAAC;IACD,OAAO;QACL,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACtB,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3D,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC,uBAAuB,CAC5D,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAC5B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/blake2s.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/blake2s.js deleted file mode 100644 index 5c649914..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/blake2s.js +++ /dev/null @@ -1,118 +0,0 @@ -import { BLAKE2, SIGMA } from './_blake2.js'; -import { fromBig } from './_u64.js'; -import { rotr, toBytes, wrapConstructorWithOpts, u32 } from './utils.js'; -// Initial state: -// first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19) -// same as SHA-256 -// prettier-ignore -export const IV = /* @__PURE__ */ new Uint32Array([0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19]); -// Mixing function G splitted in two halfs -function G1(a, b, c, d, x) { - a = (a + b + x) | 0; - d = rotr(d ^ a, 16); - c = (c + d) | 0; - b = rotr(b ^ c, 12); - return { a, b, c, d }; -} -function G2(a, b, c, d, x) { - a = (a + b + x) | 0; - d = rotr(d ^ a, 8); - c = (c + d) | 0; - b = rotr(b ^ c, 7); - return { a, b, c, d }; -} -// prettier-ignore -export function compress(s, offset, msg, rounds, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) { - let j = 0; - for (let i = 0; i < rounds; i++) { - ({ a: v0, b: v4, c: v8, d: v12 } = G1(v0, v4, v8, v12, msg[offset + s[j++]])); - ({ a: v0, b: v4, c: v8, d: v12 } = G2(v0, v4, v8, v12, msg[offset + s[j++]])); - ({ a: v1, b: v5, c: v9, d: v13 } = G1(v1, v5, v9, v13, msg[offset + s[j++]])); - ({ a: v1, b: v5, c: v9, d: v13 } = G2(v1, v5, v9, v13, msg[offset + s[j++]])); - ({ a: v2, b: v6, c: v10, d: v14 } = G1(v2, v6, v10, v14, msg[offset + s[j++]])); - ({ a: v2, b: v6, c: v10, d: v14 } = G2(v2, v6, v10, v14, msg[offset + s[j++]])); - ({ a: v3, b: v7, c: v11, d: v15 } = G1(v3, v7, v11, v15, msg[offset + s[j++]])); - ({ a: v3, b: v7, c: v11, d: v15 } = G2(v3, v7, v11, v15, msg[offset + s[j++]])); - ({ a: v0, b: v5, c: v10, d: v15 } = G1(v0, v5, v10, v15, msg[offset + s[j++]])); - ({ a: v0, b: v5, c: v10, d: v15 } = G2(v0, v5, v10, v15, msg[offset + s[j++]])); - ({ a: v1, b: v6, c: v11, d: v12 } = G1(v1, v6, v11, v12, msg[offset + s[j++]])); - ({ a: v1, b: v6, c: v11, d: v12 } = G2(v1, v6, v11, v12, msg[offset + s[j++]])); - ({ a: v2, b: v7, c: v8, d: v13 } = G1(v2, v7, v8, v13, msg[offset + s[j++]])); - ({ a: v2, b: v7, c: v8, d: v13 } = G2(v2, v7, v8, v13, msg[offset + s[j++]])); - ({ a: v3, b: v4, c: v9, d: v14 } = G1(v3, v4, v9, v14, msg[offset + s[j++]])); - ({ a: v3, b: v4, c: v9, d: v14 } = G2(v3, v4, v9, v14, msg[offset + s[j++]])); - } - return { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 }; -} -class BLAKE2s extends BLAKE2 { - constructor(opts = {}) { - super(64, opts.dkLen === undefined ? 32 : opts.dkLen, opts, 32, 8, 8); - // Internal state, same as SHA-256 - this.v0 = IV[0] | 0; - this.v1 = IV[1] | 0; - this.v2 = IV[2] | 0; - this.v3 = IV[3] | 0; - this.v4 = IV[4] | 0; - this.v5 = IV[5] | 0; - this.v6 = IV[6] | 0; - this.v7 = IV[7] | 0; - const keyLength = opts.key ? opts.key.length : 0; - this.v0 ^= this.outputLen | (keyLength << 8) | (0x01 << 16) | (0x01 << 24); - if (opts.salt) { - const salt = u32(toBytes(opts.salt)); - this.v4 ^= salt[0]; - this.v5 ^= salt[1]; - } - if (opts.personalization) { - const pers = u32(toBytes(opts.personalization)); - this.v6 ^= pers[0]; - this.v7 ^= pers[1]; - } - if (opts.key) { - // Pad to blockLen and update - const tmp = new Uint8Array(this.blockLen); - tmp.set(toBytes(opts.key)); - this.update(tmp); - } - } - get() { - const { v0, v1, v2, v3, v4, v5, v6, v7 } = this; - return [v0, v1, v2, v3, v4, v5, v6, v7]; - } - // prettier-ignore - set(v0, v1, v2, v3, v4, v5, v6, v7) { - this.v0 = v0 | 0; - this.v1 = v1 | 0; - this.v2 = v2 | 0; - this.v3 = v3 | 0; - this.v4 = v4 | 0; - this.v5 = v5 | 0; - this.v6 = v6 | 0; - this.v7 = v7 | 0; - } - compress(msg, offset, isLast) { - const { h, l } = fromBig(BigInt(this.length)); - // prettier-ignore - const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = compress(SIGMA, offset, msg, 10, this.v0, this.v1, this.v2, this.v3, this.v4, this.v5, this.v6, this.v7, IV[0], IV[1], IV[2], IV[3], l ^ IV[4], h ^ IV[5], isLast ? ~IV[6] : IV[6], IV[7]); - this.v0 ^= v0 ^ v8; - this.v1 ^= v1 ^ v9; - this.v2 ^= v2 ^ v10; - this.v3 ^= v3 ^ v11; - this.v4 ^= v4 ^ v12; - this.v5 ^= v5 ^ v13; - this.v6 ^= v6 ^ v14; - this.v7 ^= v7 ^ v15; - } - destroy() { - this.destroyed = true; - this.buffer32.fill(0); - this.set(0, 0, 0, 0, 0, 0, 0, 0); - } -} -/** - * BLAKE2s - optimized for 32-bit platforms. JS doesn't have uint64, so it's faster than BLAKE2b. - * @param msg - message that would be hashed - * @param opts - dkLen, key, salt, personalization - */ -export const blake2s = /* @__PURE__ */ wrapConstructorWithOpts((opts) => new BLAKE2s(opts)); -//# sourceMappingURL=blake2s.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/blake2s.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/blake2s.js.map deleted file mode 100644 index 44cce786..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/blake2s.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blake2s.js","sourceRoot":"","sources":["../src/blake2s.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAa,KAAK,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,uBAAuB,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEzE,iBAAiB;AACjB,yFAAyF;AACzF,kBAAkB;AAClB,kBAAkB;AAClB,MAAM,CAAC,MAAM,EAAE,GAAG,eAAe,CAAA,IAAI,W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AAG,CAAC;IACtB,CAAC;IACD,OAAO;QACL,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACtB,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACnC,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC,uBAAuB,CAC5D,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAC5B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/blake3.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/blake3.js deleted file mode 100644 index af92963d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/blake3.js +++ /dev/null @@ -1,226 +0,0 @@ -import { bytes, exists, number, output } from './_assert.js'; -import { fromBig } from './_u64.js'; -import { BLAKE2 } from './_blake2.js'; -import { compress, IV } from './blake2s.js'; -import { u8, u32, toBytes, wrapXOFConstructorWithOpts } from './utils.js'; -const SIGMA = /* @__PURE__ */ (() => { - const Id = Array.from({ length: 16 }, (_, i) => i); - const permute = (arr) => [2, 6, 3, 10, 7, 0, 4, 13, 1, 11, 12, 5, 9, 14, 15, 8].map((i) => arr[i]); - const res = []; - for (let i = 0, v = Id; i < 7; i++, v = permute(v)) - res.push(...v); - return Uint8Array.from(res); -})(); -// Why is this so slow? It should be 6x faster than blake2b. -// - There is only 30% reduction in number of rounds from blake2s -// - This function uses tree mode to achive parallelisation via SIMD and threading, -// however in JS we don't have threads and SIMD, so we get only overhead from tree structure -// - It is possible to speed it up via Web Workers, hovewer it will make code singnificantly more -// complicated, which we are trying to avoid, since this library is intended to be used -// for cryptographic purposes. Also, parallelization happens only on chunk level (1024 bytes), -// which won't really benefit small inputs. -class BLAKE3 extends BLAKE2 { - constructor(opts = {}, flags = 0) { - super(64, opts.dkLen === undefined ? 32 : opts.dkLen, {}, Number.MAX_SAFE_INTEGER, 0, 0); - this.flags = 0 | 0; - this.chunkPos = 0; // Position of current block in chunk - this.chunksDone = 0; // How many chunks we already have - this.stack = []; - // Output - this.posOut = 0; - this.bufferOut32 = new Uint32Array(16); - this.chunkOut = 0; // index of output chunk - this.enableXOF = true; - this.outputLen = opts.dkLen === undefined ? 32 : opts.dkLen; - number(this.outputLen); - if (opts.key !== undefined && opts.context !== undefined) - throw new Error('Blake3: only key or context can be specified at same time'); - else if (opts.key !== undefined) { - const key = toBytes(opts.key).slice(); - if (key.length !== 32) - throw new Error('Blake3: key should be 32 byte'); - this.IV = u32(key); - this.flags = flags | 16 /* Flags.KEYED_HASH */; - } - else if (opts.context !== undefined) { - const context_key = new BLAKE3({ dkLen: 32 }, 32 /* Flags.DERIVE_KEY_CONTEXT */) - .update(opts.context) - .digest(); - this.IV = u32(context_key); - this.flags = flags | 64 /* Flags.DERIVE_KEY_MATERIAL */; - } - else { - this.IV = IV.slice(); - this.flags = flags; - } - this.state = this.IV.slice(); - this.bufferOut = u8(this.bufferOut32); - } - // Unused - get() { - return []; - } - set() { } - b2Compress(counter, flags, buf, bufPos = 0) { - const { state: s, pos } = this; - const { h, l } = fromBig(BigInt(counter), true); - // prettier-ignore - const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = compress(SIGMA, bufPos, buf, 7, s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], IV[0], IV[1], IV[2], IV[3], h, l, pos, flags); - s[0] = v0 ^ v8; - s[1] = v1 ^ v9; - s[2] = v2 ^ v10; - s[3] = v3 ^ v11; - s[4] = v4 ^ v12; - s[5] = v5 ^ v13; - s[6] = v6 ^ v14; - s[7] = v7 ^ v15; - } - compress(buf, bufPos = 0, isLast = false) { - // Compress last block - let flags = this.flags; - if (!this.chunkPos) - flags |= 1 /* Flags.CHUNK_START */; - if (this.chunkPos === 15 || isLast) - flags |= 2 /* Flags.CHUNK_END */; - if (!isLast) - this.pos = this.blockLen; - this.b2Compress(this.chunksDone, flags, buf, bufPos); - this.chunkPos += 1; - // If current block is last in chunk (16 blocks), then compress chunks - if (this.chunkPos === 16 || isLast) { - let chunk = this.state; - this.state = this.IV.slice(); - // If not the last one, compress only when there are trailing zeros in chunk counter - // chunks used as binary tree where current stack is path. Zero means current leaf is finished and can be compressed. - // 1 (001) - leaf not finished (just push current chunk to stack) - // 2 (010) - leaf finished at depth=1 (merge with last elm on stack and push back) - // 3 (011) - last leaf not finished - // 4 (100) - leafs finished at depth=1 and depth=2 - for (let last, chunks = this.chunksDone + 1; isLast || !(chunks & 1); chunks >>= 1) { - if (!(last = this.stack.pop())) - break; - this.buffer32.set(last, 0); - this.buffer32.set(chunk, 8); - this.pos = this.blockLen; - this.b2Compress(0, this.flags | 4 /* Flags.PARENT */, this.buffer32, 0); - chunk = this.state; - this.state = this.IV.slice(); - } - this.chunksDone++; - this.chunkPos = 0; - this.stack.push(chunk); - } - this.pos = 0; - } - _cloneInto(to) { - to = super._cloneInto(to); - const { IV, flags, state, chunkPos, posOut, chunkOut, stack, chunksDone } = this; - to.state.set(state.slice()); - to.stack = stack.map((i) => Uint32Array.from(i)); - to.IV.set(IV); - to.flags = flags; - to.chunkPos = chunkPos; - to.chunksDone = chunksDone; - to.posOut = posOut; - to.chunkOut = chunkOut; - to.enableXOF = this.enableXOF; - to.bufferOut32.set(this.bufferOut32); - return to; - } - destroy() { - this.destroyed = true; - this.state.fill(0); - this.buffer32.fill(0); - this.IV.fill(0); - this.bufferOut32.fill(0); - for (let i of this.stack) - i.fill(0); - } - // Same as b2Compress, but doesn't modify state and returns 16 u32 array (instead of 8) - b2CompressOut() { - const { state: s, pos, flags, buffer32, bufferOut32: out32 } = this; - const { h, l } = fromBig(BigInt(this.chunkOut++)); - // prettier-ignore - const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = compress(SIGMA, 0, buffer32, 7, s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], IV[0], IV[1], IV[2], IV[3], l, h, pos, flags); - out32[0] = v0 ^ v8; - out32[1] = v1 ^ v9; - out32[2] = v2 ^ v10; - out32[3] = v3 ^ v11; - out32[4] = v4 ^ v12; - out32[5] = v5 ^ v13; - out32[6] = v6 ^ v14; - out32[7] = v7 ^ v15; - out32[8] = s[0] ^ v8; - out32[9] = s[1] ^ v9; - out32[10] = s[2] ^ v10; - out32[11] = s[3] ^ v11; - out32[12] = s[4] ^ v12; - out32[13] = s[5] ^ v13; - out32[14] = s[6] ^ v14; - out32[15] = s[7] ^ v15; - this.posOut = 0; - } - finish() { - if (this.finished) - return; - this.finished = true; - // Padding - this.buffer.fill(0, this.pos); - // Process last chunk - let flags = this.flags | 8 /* Flags.ROOT */; - if (this.stack.length) { - flags |= 4 /* Flags.PARENT */; - this.compress(this.buffer32, 0, true); - this.chunksDone = 0; - this.pos = this.blockLen; - } - else { - flags |= (!this.chunkPos ? 1 /* Flags.CHUNK_START */ : 0) | 2 /* Flags.CHUNK_END */; - } - this.flags = flags; - this.b2CompressOut(); - } - writeInto(out) { - exists(this, false); - bytes(out); - this.finish(); - const { blockLen, bufferOut } = this; - for (let pos = 0, len = out.length; pos < len;) { - if (this.posOut >= blockLen) - this.b2CompressOut(); - const take = Math.min(blockLen - this.posOut, len - pos); - out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); - this.posOut += take; - pos += take; - } - return out; - } - xofInto(out) { - if (!this.enableXOF) - throw new Error('XOF is not possible after digest call'); - return this.writeInto(out); - } - xof(bytes) { - number(bytes); - return this.xofInto(new Uint8Array(bytes)); - } - digestInto(out) { - output(out, this); - if (this.finished) - throw new Error('digest() was already called'); - this.enableXOF = false; - this.writeInto(out); - this.destroy(); - return out; - } - digest() { - return this.digestInto(new Uint8Array(this.outputLen)); - } -} -/** - * BLAKE3 hash function. - * @param msg - message that would be hashed - * @param opts - dkLen, key, context - */ -export const blake3 = /* @__PURE__ */ wrapXOFConstructorWithOpts((opts) => new BLAKE3(opts)); -//# sourceMappingURL=blake3.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/blake3.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/blake3.js.map deleted file mode 100644 index 50f489b8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/blake3.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blake3.js","sourceRoot":"","sources":["../src/blake3.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAS,EAAE,EAAE,GAAG,EAAE,OAAO,EAAW,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAe1F,MAAM,KAAK,GAAe,eAAe,CAAC,CAAC,GAAG,EAAE;IAC9C,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IACnD,MAAM,OAAO,GAAG,CAAC,GAAa,EAAE,EAAE,CAChC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,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,OAAO,GAAG,CAAC;IACb,CAAC;IACD,MAAM;QACJ,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IACzD,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,eAAe,CAAC,0BAA0B,CAC9D,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAC3B,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/crypto.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/crypto.js deleted file mode 100644 index 8d499a08..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/crypto.js +++ /dev/null @@ -1,2 +0,0 @@ -export const crypto = typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined; -//# sourceMappingURL=crypto.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/crypto.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/crypto.js.map deleted file mode 100644 index 4b4fd3da..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/crypto.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../src/crypto.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,MAAM,GACjB,OAAO,UAAU,KAAK,QAAQ,IAAI,QAAQ,IAAI,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/cryptoNode.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/cryptoNode.js deleted file mode 100644 index 241f1da4..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/cryptoNode.js +++ /dev/null @@ -1,7 +0,0 @@ -// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+. -// See utils.ts for details. -// The file will throw on node.js 14 and earlier. -// @ts-ignore -import * as nc from 'node:crypto'; -export const crypto = nc && typeof nc === 'object' && 'webcrypto' in nc ? nc.webcrypto : undefined; -//# sourceMappingURL=cryptoNode.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/cryptoNode.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/cryptoNode.js.map deleted file mode 100644 index f7ab75e0..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/cryptoNode.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cryptoNode.js","sourceRoot":"","sources":["../src/cryptoNode.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,4BAA4B;AAC5B,iDAAiD;AACjD,aAAa;AACb,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,MAAM,CAAC,MAAM,MAAM,GACjB,EAAE,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,WAAW,IAAI,EAAE,CAAC,CAAC,CAAE,EAAE,CAAC,SAAiB,CAAC,CAAC,CAAC,SAAS,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/eskdf.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/eskdf.js deleted file mode 100644 index 13253eba..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/eskdf.js +++ /dev/null @@ -1,155 +0,0 @@ -import { bytes as assertBytes } from './_assert.js'; -import { hkdf } from './hkdf.js'; -import { sha256 } from './sha256.js'; -import { pbkdf2 as _pbkdf2 } from './pbkdf2.js'; -import { scrypt as _scrypt } from './scrypt.js'; -import { bytesToHex, createView, hexToBytes, toBytes } from './utils.js'; -// A tiny KDF for various applications like AES key-gen. -// Uses HKDF in a non-standard way, so it's not "KDF-secure", only "PRF-secure". -// Which is good enough: assume sha2-256 retained preimage resistance. -const SCRYPT_FACTOR = 2 ** 19; -const PBKDF2_FACTOR = 2 ** 17; -// Scrypt KDF -export function scrypt(password, salt) { - return _scrypt(password, salt, { N: SCRYPT_FACTOR, r: 8, p: 1, dkLen: 32 }); -} -// PBKDF2-HMAC-SHA256 -export function pbkdf2(password, salt) { - return _pbkdf2(sha256, password, salt, { c: PBKDF2_FACTOR, dkLen: 32 }); -} -// Combines two 32-byte byte arrays -function xor32(a, b) { - assertBytes(a, 32); - assertBytes(b, 32); - const arr = new Uint8Array(32); - for (let i = 0; i < 32; i++) { - arr[i] = a[i] ^ b[i]; - } - return arr; -} -function strHasLength(str, min, max) { - return typeof str === 'string' && str.length >= min && str.length <= max; -} -/** - * Derives main seed. Takes a lot of time. Prefer `eskdf` method instead. - */ -export function deriveMainSeed(username, password) { - if (!strHasLength(username, 8, 255)) - throw new Error('invalid username'); - if (!strHasLength(password, 8, 255)) - throw new Error('invalid password'); - const scr = scrypt(password + '\u{1}', username + '\u{1}'); - const pbk = pbkdf2(password + '\u{2}', username + '\u{2}'); - const res = xor32(scr, pbk); - scr.fill(0); - pbk.fill(0); - return res; -} -/** - * Converts protocol & accountId pair to HKDF salt & info params. - */ -function getSaltInfo(protocol, accountId = 0) { - // Note that length here also repeats two lines below - // We do an additional length check here to reduce the scope of DoS attacks - if (!(strHasLength(protocol, 3, 15) && /^[a-z0-9]{3,15}$/.test(protocol))) { - throw new Error('invalid protocol'); - } - // Allow string account ids for some protocols - const allowsStr = /^password\d{0,3}|ssh|tor|file$/.test(protocol); - let salt; // Extract salt. Default is undefined. - if (typeof accountId === 'string') { - if (!allowsStr) - throw new Error('accountId must be a number'); - if (!strHasLength(accountId, 1, 255)) - throw new Error('accountId must be valid string'); - salt = toBytes(accountId); - } - else if (Number.isSafeInteger(accountId)) { - if (accountId < 0 || accountId > 2 ** 32 - 1) - throw new Error('invalid accountId'); - // Convert to Big Endian Uint32 - salt = new Uint8Array(4); - createView(salt).setUint32(0, accountId, false); - } - else { - throw new Error(`accountId must be a number${allowsStr ? ' or string' : ''}`); - } - const info = toBytes(protocol); - return { salt, info }; -} -function countBytes(num) { - if (typeof num !== 'bigint' || num <= BigInt(128)) - throw new Error('invalid number'); - return Math.ceil(num.toString(2).length / 8); -} -/** - * Parses keyLength and modulus options to extract length of result key. - * If modulus is used, adds 64 bits to it as per FIPS 186 B.4.1 to combat modulo bias. - */ -function getKeyLength(options) { - if (!options || typeof options !== 'object') - return 32; - const hasLen = 'keyLength' in options; - const hasMod = 'modulus' in options; - if (hasLen && hasMod) - throw new Error('cannot combine keyLength and modulus options'); - if (!hasLen && !hasMod) - throw new Error('must have either keyLength or modulus option'); - // FIPS 186 B.4.1 requires at least 64 more bits - const l = hasMod ? countBytes(options.modulus) + 8 : options.keyLength; - if (!(typeof l === 'number' && l >= 16 && l <= 8192)) - throw new Error('invalid keyLength'); - return l; -} -/** - * Converts key to bigint and divides it by modulus. Big Endian. - * Implements FIPS 186 B.4.1, which removes 0 and modulo bias from output. - */ -function modReduceKey(key, modulus) { - const _1 = BigInt(1); - const num = BigInt('0x' + bytesToHex(key)); // check for ui8a, then bytesToNumber() - const res = (num % (modulus - _1)) + _1; // Remove 0 from output - if (res < _1) - throw new Error('expected positive number'); // Guard against bad values - const len = key.length - 8; // FIPS requires 64 more bits = 8 bytes - const hex = res.toString(16).padStart(len * 2, '0'); // numberToHex() - const bytes = hexToBytes(hex); - if (bytes.length !== len) - throw new Error('invalid length of result key'); - return bytes; -} -/** - * ESKDF - * @param username - username, email, or identifier, min: 8 characters, should have enough entropy - * @param password - password, min: 8 characters, should have enough entropy - * @example - * const kdf = await eskdf('example-university', 'beginning-new-example'); - * const key = kdf.deriveChildKey('aes', 0); - * console.log(kdf.fingerprint); - * kdf.expire(); - */ -export async function eskdf(username, password) { - // We are using closure + object instead of class because - // we want to make `seed` non-accessible for any external function. - let seed = deriveMainSeed(username, password); - function deriveCK(protocol, accountId = 0, options) { - assertBytes(seed, 32); - const { salt, info } = getSaltInfo(protocol, accountId); // validate protocol & accountId - const keyLength = getKeyLength(options); // validate options - const key = hkdf(sha256, seed, salt, info, keyLength); - // Modulus has already been validated - return options && 'modulus' in options ? modReduceKey(key, options.modulus) : key; - } - function expire() { - if (seed) - seed.fill(1); - seed = undefined; - } - // prettier-ignore - const fingerprint = Array.from(deriveCK('fingerprint', 0)) - .slice(0, 6) - .map((char) => char.toString(16).padStart(2, '0').toUpperCase()) - .join(':'); - return Object.freeze({ deriveChildKey: deriveCK, expire, fingerprint }); -} -//# sourceMappingURL=eskdf.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/eskdf.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/eskdf.js.map deleted file mode 100644 index f53eebeb..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/eskdf.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"eskdf.js","sourceRoot":"","sources":["../src/eskdf.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAEzE,wDAAwD;AACxD,gFAAgF;AAChF,sEAAsE;AAEtE,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE,CAAC;AAC9B,MAAM,aAAa,GAAG,CAAC,I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E,CAAC,CAAC;AAC1E,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/hkdf.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/hkdf.js deleted file mode 100644 index 8fbdac86..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/hkdf.js +++ /dev/null @@ -1,72 +0,0 @@ -import { hash as assertHash, number as assertNumber } from './_assert.js'; -import { toBytes } from './utils.js'; -import { hmac } from './hmac.js'; -// HKDF (RFC 5869) -// https://soatok.blog/2021/11/17/understanding-hkdf/ -/** - * HKDF-Extract(IKM, salt) -> PRK - * Arguments position differs from spec (IKM is first one, since it is not optional) - * @param hash - * @param ikm - * @param salt - * @returns - */ -export function extract(hash, ikm, salt) { - assertHash(hash); - // NOTE: some libraries treat zero-length array as 'not provided'; - // we don't, since we have undefined as 'not provided' - // https://github.com/RustCrypto/KDFs/issues/15 - if (salt === undefined) - salt = new Uint8Array(hash.outputLen); // if not provided, it is set to a string of HashLen zeros - return hmac(hash, toBytes(salt), toBytes(ikm)); -} -// HKDF-Expand(PRK, info, L) -> OKM -const HKDF_COUNTER = /* @__PURE__ */ new Uint8Array([0]); -const EMPTY_BUFFER = /* @__PURE__ */ new Uint8Array(); -/** - * HKDF-expand from the spec. - * @param prk - a pseudorandom key of at least HashLen octets (usually, the output from the extract step) - * @param info - optional context and application specific information (can be a zero-length string) - * @param length - length of output keying material in octets - */ -export function expand(hash, prk, info, length = 32) { - assertHash(hash); - assertNumber(length); - if (length > 255 * hash.outputLen) - throw new Error('Length should be <= 255*HashLen'); - const blocks = Math.ceil(length / hash.outputLen); - if (info === undefined) - info = EMPTY_BUFFER; - // first L(ength) octets of T - const okm = new Uint8Array(blocks * hash.outputLen); - // Re-use HMAC instance between blocks - const HMAC = hmac.create(hash, prk); - const HMACTmp = HMAC._cloneInto(); - const T = new Uint8Array(HMAC.outputLen); - for (let counter = 0; counter < blocks; counter++) { - HKDF_COUNTER[0] = counter + 1; - // T(0) = empty string (zero length) - // T(N) = HMAC-Hash(PRK, T(N-1) | info | N) - HMACTmp.update(counter === 0 ? EMPTY_BUFFER : T) - .update(info) - .update(HKDF_COUNTER) - .digestInto(T); - okm.set(T, hash.outputLen * counter); - HMAC._cloneInto(HMACTmp); - } - HMAC.destroy(); - HMACTmp.destroy(); - T.fill(0); - HKDF_COUNTER.fill(0); - return okm.slice(0, length); -} -/** - * HKDF (RFC 5869): extract + expand in one step. - * @param hash - hash function that would be used (e.g. sha256) - * @param ikm - input keying material, the initial key - * @param salt - optional salt value (a non-secret random value) - * @param info - optional context and application specific information - * @param length - length of output keying material in octets - */ -export const hkdf = (hash, ikm, salt, info, length) => expand(hash, extract(hash, ikm, salt), info, length); -//# sourceMappingURL=hkdf.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/hkdf.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/hkdf.js.map deleted file mode 100644 index 868bdb5b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/hkdf.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hkdf.js","sourceRoot":"","sources":["../src/hkdf.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,EAAgB,OAAO,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,kBAAkB;AAClB,qDAAqD;AAErD;;;;;;;GAOG;AACH,MAAM,UAAU,OAAO,CAAC,IAAW,EAAE,GAAU,EAAE,IAAY;IAC3D,UAAU,CAAC,IAAI,CAAC,CAAC;IACjB,kEAAkE;IAClE,sDAAsD;IACtD,+CAA+C;IAC/C,IAAI,IAAI,KAAK,SAAS;QAAE,IAAI,GAAG,IAAI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C;QACpC,2CAA2C;QAC3C,OAAO,CAAC,MAAM,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;aAC7C,MAAM,CAAC,IAAI,CAAC;aACZ,MAAM,CAAC,YAAY,CAAC;aACpB,UAAU,CAAC,CAAC,CAAC,CAAC;QACjB,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,CAAC;QACrC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;KAC1B;IACD,IAAI,CAAC,OAAO,EAAE,CAAC;IACf,OAAO,CAAC,OAAO,EAAE,CAAC;IAClB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACV,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACrB,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AAC9B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAClB,IAAW,EACX,GAAU,EACV,IAAuB,EACvB,IAAuB,EACvB,MAAc,EACd,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/hmac.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/hmac.js deleted file mode 100644 index 520f7769..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/hmac.js +++ /dev/null @@ -1,77 +0,0 @@ -import { hash as assertHash, bytes as assertBytes, exists as assertExists } from './_assert.js'; -import { Hash, toBytes } from './utils.js'; -// HMAC (RFC 2104) -export class HMAC extends Hash { - constructor(hash, _key) { - super(); - this.finished = false; - this.destroyed = false; - assertHash(hash); - const key = toBytes(_key); - this.iHash = hash.create(); - if (typeof this.iHash.update !== 'function') - throw new Error('Expected instance of class which extends utils.Hash'); - this.blockLen = this.iHash.blockLen; - this.outputLen = this.iHash.outputLen; - const blockLen = this.blockLen; - const pad = new Uint8Array(blockLen); - // blockLen can be bigger than outputLen - pad.set(key.length > blockLen ? hash.create().update(key).digest() : key); - for (let i = 0; i < pad.length; i++) - pad[i] ^= 0x36; - this.iHash.update(pad); - // By doing update (processing of first block) of outer hash here we can re-use it between multiple calls via clone - this.oHash = hash.create(); - // Undo internal XOR && apply outer XOR - for (let i = 0; i < pad.length; i++) - pad[i] ^= 0x36 ^ 0x5c; - this.oHash.update(pad); - pad.fill(0); - } - update(buf) { - assertExists(this); - this.iHash.update(buf); - return this; - } - digestInto(out) { - assertExists(this); - assertBytes(out, this.outputLen); - this.finished = true; - this.iHash.digestInto(out); - this.oHash.update(out); - this.oHash.digestInto(out); - this.destroy(); - } - digest() { - const out = new Uint8Array(this.oHash.outputLen); - this.digestInto(out); - return out; - } - _cloneInto(to) { - // Create new instance without calling constructor since key already in state and we don't know it. - to || (to = Object.create(Object.getPrototypeOf(this), {})); - const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this; - to = to; - to.finished = finished; - to.destroyed = destroyed; - to.blockLen = blockLen; - to.outputLen = outputLen; - to.oHash = oHash._cloneInto(to.oHash); - to.iHash = iHash._cloneInto(to.iHash); - return to; - } - destroy() { - this.destroyed = true; - this.oHash.destroy(); - this.iHash.destroy(); - } -} -/** - * HMAC: RFC2104 message authentication code. - * @param hash - function that would be used e.g. sha256 - * @param key - message key - * @param message - message data - */ -export const hmac = (hash, key, message) => new HMAC(hash, key).update(message).digest(); -hmac.create = (hash, key) => new HMAC(hash, key); -//# sourceMappingURL=hmac.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/hmac.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/hmac.js.map deleted file mode 100644 index e04539dc..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/hmac.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hmac.js","sourceRoot":"","sources":["../src/hmac.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,cAAc,CAAC;AAChG,OAAO,EAAE,IAAI,EAAgB,OAAO,EAAE,MAAM,YAAY,CAAC;AACzD,kBAAkB;AAClB,MAAM,OAAO,IAAwB,SAAQ,IAAa;IAQxD,YAAY,IAAW,EAAE,IAAW;QAClC,KAAK,EAAE,CAAC;QAJF,aAAQ,GAAG,KAAK,CAAC;QACjB,cAAS,GAAG,KAAK,CAAC;QAIxB,UAAU,CAAC,IAAI,CAAC,CAAC;QACjB,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QAC1B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,EAAO,CAAC;QAChC,IAAI,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,UAAU;YACzC,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;QACzE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;QACpC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;QACtC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC/B,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAC;QACrC,wCAAwC;QACxC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QAC1E,KAAK,IAAI,CAAC,GA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noble/hashes/esm/index.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/index.js deleted file mode 100644 index 2299d7f9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/index.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -throw new Error('noble-hashes have no entry-point: consult README for usage'); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/index.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/index.js.map deleted file mode 100644 index 90172aa2..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/package.json b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/package.json deleted file mode 100644 index f42e46b1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "module", - "sideEffects": false, - "browser": { - "node:crypto": false - }, - "node": { - "./crypto": "./esm/cryptoNode.js" - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/pbkdf2.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/pbkdf2.js deleted file mode 100644 index 3f0c11f8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/pbkdf2.js +++ /dev/null @@ -1,86 +0,0 @@ -import { hash as assertHash, number as assertNumber } from './_assert.js'; -import { hmac } from './hmac.js'; -import { createView, toBytes, checkOpts, asyncLoop } from './utils.js'; -// Common prologue and epilogue for sync/async functions -function pbkdf2Init(hash, _password, _salt, _opts) { - assertHash(hash); - const opts = checkOpts({ dkLen: 32, asyncTick: 10 }, _opts); - const { c, dkLen, asyncTick } = opts; - assertNumber(c); - assertNumber(dkLen); - assertNumber(asyncTick); - if (c < 1) - throw new Error('PBKDF2: iterations (c) should be >= 1'); - const password = toBytes(_password); - const salt = toBytes(_salt); - // DK = PBKDF2(PRF, Password, Salt, c, dkLen); - const DK = new Uint8Array(dkLen); - // U1 = PRF(Password, Salt + INT_32_BE(i)) - const PRF = hmac.create(hash, password); - const PRFSalt = PRF._cloneInto().update(salt); - return { c, dkLen, asyncTick, DK, PRF, PRFSalt }; -} -function pbkdf2Output(PRF, PRFSalt, DK, prfW, u) { - PRF.destroy(); - PRFSalt.destroy(); - if (prfW) - prfW.destroy(); - u.fill(0); - return DK; -} -/** - * PBKDF2-HMAC: RFC 2898 key derivation function - * @param hash - hash function that would be used e.g. sha256 - * @param password - password from which a derived key is generated - * @param salt - cryptographic salt - * @param opts - {c, dkLen} where c is work factor and dkLen is output message size - */ -export function pbkdf2(hash, password, salt, opts) { - const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts); - let prfW; // Working copy - const arr = new Uint8Array(4); - const view = createView(arr); - const u = new Uint8Array(PRF.outputLen); - // DK = T1 + T2 + ⋯ + Tdklen/hlen - for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { - // Ti = F(Password, Salt, c, i) - const Ti = DK.subarray(pos, pos + PRF.outputLen); - view.setInt32(0, ti, false); - // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc - // U1 = PRF(Password, Salt + INT_32_BE(i)) - (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); - Ti.set(u.subarray(0, Ti.length)); - for (let ui = 1; ui < c; ui++) { - // Uc = PRF(Password, Uc−1) - PRF._cloneInto(prfW).update(u).digestInto(u); - for (let i = 0; i < Ti.length; i++) - Ti[i] ^= u[i]; - } - } - return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); -} -export async function pbkdf2Async(hash, password, salt, opts) { - const { c, dkLen, asyncTick, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts); - let prfW; // Working copy - const arr = new Uint8Array(4); - const view = createView(arr); - const u = new Uint8Array(PRF.outputLen); - // DK = T1 + T2 + ⋯ + Tdklen/hlen - for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { - // Ti = F(Password, Salt, c, i) - const Ti = DK.subarray(pos, pos + PRF.outputLen); - view.setInt32(0, ti, false); - // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc - // U1 = PRF(Password, Salt + INT_32_BE(i)) - (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); - Ti.set(u.subarray(0, Ti.length)); - await asyncLoop(c - 1, asyncTick, () => { - // Uc = PRF(Password, Uc−1) - PRF._cloneInto(prfW).update(u).digestInto(u); - for (let i = 0; i < Ti.length; i++) - Ti[i] ^= u[i]; - }); - } - return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); -} -//# sourceMappingURL=pbkdf2.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/pbkdf2.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/pbkdf2.js.map deleted file mode 100644 index b4049346..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/pbkdf2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pbkdf2.js","sourceRoot":"","sources":["../src/pbkdf2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAsB,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAQ3F,wDAA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OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAC5D,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;QACjC,MAAM,SAAS,CAAC,CAAC,GAAG,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE;YACrC,2BAA2B;YAC3B,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YAC7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE;gBAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;KACJ;IACD,OAAO,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACjD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/ripemd160.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/ripemd160.js deleted file mode 100644 index 1e239583..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/ripemd160.js +++ /dev/null @@ -1,104 +0,0 @@ -import { SHA2 } from './_sha2.js'; -import { wrapConstructor } from './utils.js'; -// https://homes.esat.kuleuven.be/~bosselae/ripemd160.html -// https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf -const Rho = /* @__PURE__ */ new Uint8Array([7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8]); -const Id = /* @__PURE__ */ Uint8Array.from({ length: 16 }, (_, i) => i); -const Pi = /* @__PURE__ */ Id.map((i) => (9 * i + 5) % 16); -let idxL = [Id]; -let idxR = [Pi]; -for (let i = 0; i < 4; i++) - for (let j of [idxL, idxR]) - j.push(j[i].map((k) => Rho[k])); -const shifts = /* @__PURE__ */ [ - [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8], - [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7], - [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9], - [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6], - [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5], -].map((i) => new Uint8Array(i)); -const shiftsL = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts[i][j])); -const shiftsR = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts[i][j])); -const Kl = /* @__PURE__ */ new Uint32Array([ - 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e, -]); -const Kr = /* @__PURE__ */ new Uint32Array([ - 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000, -]); -// The rotate left (circular left shift) operation for uint32 -const rotl = (word, shift) => (word << shift) | (word >>> (32 - shift)); -// It's called f() in spec. -function f(group, x, y, z) { - if (group === 0) - return x ^ y ^ z; - else if (group === 1) - return (x & y) | (~x & z); - else if (group === 2) - return (x | ~y) ^ z; - else if (group === 3) - return (x & z) | (y & ~z); - else - return x ^ (y | ~z); -} -// Temporary buffer, not used to store anything between runs -const BUF = /* @__PURE__ */ new Uint32Array(16); -export class RIPEMD160 extends SHA2 { - constructor() { - super(64, 20, 8, true); - this.h0 = 0x67452301 | 0; - this.h1 = 0xefcdab89 | 0; - this.h2 = 0x98badcfe | 0; - this.h3 = 0x10325476 | 0; - this.h4 = 0xc3d2e1f0 | 0; - } - get() { - const { h0, h1, h2, h3, h4 } = this; - return [h0, h1, h2, h3, h4]; - } - set(h0, h1, h2, h3, h4) { - this.h0 = h0 | 0; - this.h1 = h1 | 0; - this.h2 = h2 | 0; - this.h3 = h3 | 0; - this.h4 = h4 | 0; - } - process(view, offset) { - for (let i = 0; i < 16; i++, offset += 4) - BUF[i] = view.getUint32(offset, true); - // prettier-ignore - let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el; - // Instead of iterating 0 to 80, we split it into 5 groups - // And use the groups in constants, functions, etc. Much simpler - for (let group = 0; group < 5; group++) { - const rGroup = 4 - group; - const hbl = Kl[group], hbr = Kr[group]; // prettier-ignore - const rl = idxL[group], rr = idxR[group]; // prettier-ignore - const sl = shiftsL[group], sr = shiftsR[group]; // prettier-ignore - for (let i = 0; i < 16; i++) { - const tl = (rotl(al + f(group, bl, cl, dl) + BUF[rl[i]] + hbl, sl[i]) + el) | 0; - al = el, el = dl, dl = rotl(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore - } - // 2 loops are 10% faster - for (let i = 0; i < 16; i++) { - const tr = (rotl(ar + f(rGroup, br, cr, dr) + BUF[rr[i]] + hbr, sr[i]) + er) | 0; - ar = er, er = dr, dr = rotl(cr, 10) | 0, cr = br, br = tr; // prettier-ignore - } - } - // Add the compressed chunk to the current hash value - this.set((this.h1 + cl + dr) | 0, (this.h2 + dl + er) | 0, (this.h3 + el + ar) | 0, (this.h4 + al + br) | 0, (this.h0 + bl + cr) | 0); - } - roundClean() { - BUF.fill(0); - } - destroy() { - this.destroyed = true; - this.buffer.fill(0); - this.set(0, 0, 0, 0, 0); - } -} -/** - * RIPEMD-160 - a hash function from 1990s. - * @param message - msg that would be hashed - */ -export const ripemd160 = /* @__PURE__ */ wrapConstructor(() => new RIPEMD160()); -//# sourceMappingURL=ripemd160.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/ripemd160.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/ripemd160.js.map deleted file mode 100644 index 7964756e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/ripemd160.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ripemd160.js","sourceRoot":"","sources":["../src/ripemd160.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,0DAA0D;AAC1D,6EAA6E;AAC7E,MAAM,GAAG,GAAG,eAAe,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;AACnG,MAAM,EAAE,GAAG,eAAe,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;AACxE,MAAM,EAAE,GAAG,eAAe,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;AAC3D,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC,CAAC;AAChB,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC,CAAC;AAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;IAAE,KAAK,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC;QAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC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AAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EACvB,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CACxB,CAAC;IACJ,CAAC;IACS,UAAU;QAClB,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACd,CAAC;IACD,OAAO;QACL,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1B,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CAAC,eAAe,CAAC,GAAG,EAAE,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/scrypt.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/scrypt.js deleted file mode 100644 index 37012f56..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/scrypt.js +++ /dev/null @@ -1,218 +0,0 @@ -import { number as assertNumber } from './_assert.js'; -import { sha256 } from './sha256.js'; -import { pbkdf2 } from './pbkdf2.js'; -import { asyncLoop, checkOpts, u32 } from './utils.js'; -// RFC 7914 Scrypt KDF -// Left rotate for uint32 -const rotl = (a, b) => (a << b) | (a >>> (32 - b)); -// The main Scrypt loop: uses Salsa extensively. -// Six versions of the function were tried, this is the fastest one. -// prettier-ignore -function XorAndSalsa(prev, pi, input, ii, out, oi) { - // Based on https://cr.yp.to/salsa20.html - // Xor blocks - let y00 = prev[pi++] ^ input[ii++], y01 = prev[pi++] ^ input[ii++]; - let y02 = prev[pi++] ^ input[ii++], y03 = prev[pi++] ^ input[ii++]; - let y04 = prev[pi++] ^ input[ii++], y05 = prev[pi++] ^ input[ii++]; - let y06 = prev[pi++] ^ input[ii++], y07 = prev[pi++] ^ input[ii++]; - let y08 = prev[pi++] ^ input[ii++], y09 = prev[pi++] ^ input[ii++]; - let y10 = prev[pi++] ^ input[ii++], y11 = prev[pi++] ^ input[ii++]; - let y12 = prev[pi++] ^ input[ii++], y13 = prev[pi++] ^ input[ii++]; - let y14 = prev[pi++] ^ input[ii++], y15 = prev[pi++] ^ input[ii++]; - // Save state to temporary variables (salsa) - let x00 = y00, x01 = y01, x02 = y02, x03 = y03, x04 = y04, x05 = y05, x06 = y06, x07 = y07, x08 = y08, x09 = y09, x10 = y10, x11 = y11, x12 = y12, x13 = y13, x14 = y14, x15 = y15; - // Main loop (salsa) - for (let i = 0; i < 8; i += 2) { - x04 ^= rotl(x00 + x12 | 0, 7); - x08 ^= rotl(x04 + x00 | 0, 9); - x12 ^= rotl(x08 + x04 | 0, 13); - x00 ^= rotl(x12 + x08 | 0, 18); - x09 ^= rotl(x05 + x01 | 0, 7); - x13 ^= rotl(x09 + x05 | 0, 9); - x01 ^= rotl(x13 + x09 | 0, 13); - x05 ^= rotl(x01 + x13 | 0, 18); - x14 ^= rotl(x10 + x06 | 0, 7); - x02 ^= rotl(x14 + x10 | 0, 9); - x06 ^= rotl(x02 + x14 | 0, 13); - x10 ^= rotl(x06 + x02 | 0, 18); - x03 ^= rotl(x15 + x11 | 0, 7); - x07 ^= rotl(x03 + x15 | 0, 9); - x11 ^= rotl(x07 + x03 | 0, 13); - x15 ^= rotl(x11 + x07 | 0, 18); - x01 ^= rotl(x00 + x03 | 0, 7); - x02 ^= rotl(x01 + x00 | 0, 9); - x03 ^= rotl(x02 + x01 | 0, 13); - x00 ^= rotl(x03 + x02 | 0, 18); - x06 ^= rotl(x05 + x04 | 0, 7); - x07 ^= rotl(x06 + x05 | 0, 9); - x04 ^= rotl(x07 + x06 | 0, 13); - x05 ^= rotl(x04 + x07 | 0, 18); - x11 ^= rotl(x10 + x09 | 0, 7); - x08 ^= rotl(x11 + x10 | 0, 9); - x09 ^= rotl(x08 + x11 | 0, 13); - x10 ^= rotl(x09 + x08 | 0, 18); - x12 ^= rotl(x15 + x14 | 0, 7); - x13 ^= rotl(x12 + x15 | 0, 9); - x14 ^= rotl(x13 + x12 | 0, 13); - x15 ^= rotl(x14 + x13 | 0, 18); - } - // Write output (salsa) - out[oi++] = (y00 + x00) | 0; - out[oi++] = (y01 + x01) | 0; - out[oi++] = (y02 + x02) | 0; - out[oi++] = (y03 + x03) | 0; - out[oi++] = (y04 + x04) | 0; - out[oi++] = (y05 + x05) | 0; - out[oi++] = (y06 + x06) | 0; - out[oi++] = (y07 + x07) | 0; - out[oi++] = (y08 + x08) | 0; - out[oi++] = (y09 + x09) | 0; - out[oi++] = (y10 + x10) | 0; - out[oi++] = (y11 + x11) | 0; - out[oi++] = (y12 + x12) | 0; - out[oi++] = (y13 + x13) | 0; - out[oi++] = (y14 + x14) | 0; - out[oi++] = (y15 + x15) | 0; -} -function BlockMix(input, ii, out, oi, r) { - // The block B is r 128-byte chunks (which is equivalent of 2r 64-byte chunks) - let head = oi + 0; - let tail = oi + 16 * r; - for (let i = 0; i < 16; i++) - out[tail + i] = input[ii + (2 * r - 1) * 16 + i]; // X ← B[2r−1] - for (let i = 0; i < r; i++, head += 16, ii += 16) { - // We write odd & even Yi at same time. Even: 0bXXXXX0 Odd: 0bXXXXX1 - XorAndSalsa(out, tail, input, ii, out, head); // head[i] = Salsa(blockIn[2*i] ^ tail[i-1]) - if (i > 0) - tail += 16; // First iteration overwrites tmp value in tail - XorAndSalsa(out, head, input, (ii += 16), out, tail); // tail[i] = Salsa(blockIn[2*i+1] ^ head[i]) - } -} -// Common prologue and epilogue for sync/async functions -function scryptInit(password, salt, _opts) { - // Maxmem - 1GB+1KB by default - const opts = checkOpts({ - dkLen: 32, - asyncTick: 10, - maxmem: 1024 ** 3 + 1024, - }, _opts); - const { N, r, p, dkLen, asyncTick, maxmem, onProgress } = opts; - assertNumber(N); - assertNumber(r); - assertNumber(p); - assertNumber(dkLen); - assertNumber(asyncTick); - assertNumber(maxmem); - if (onProgress !== undefined && typeof onProgress !== 'function') - throw new Error('progressCb should be function'); - const blockSize = 128 * r; - const blockSize32 = blockSize / 4; - if (N <= 1 || (N & (N - 1)) !== 0 || N >= 2 ** (blockSize / 8) || N > 2 ** 32) { - // NOTE: we limit N to be less than 2**32 because of 32 bit variant of Integrify function - // There is no JS engines that allows alocate more than 4GB per single Uint8Array for now, but can change in future. - throw new Error('Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32'); - } - if (p < 0 || p > ((2 ** 32 - 1) * 32) / blockSize) { - throw new Error('Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)'); - } - if (dkLen < 0 || dkLen > (2 ** 32 - 1) * 32) { - throw new Error('Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32'); - } - const memUsed = blockSize * (N + p); - if (memUsed > maxmem) { - throw new Error(`Scrypt: parameters too large, ${memUsed} (128 * r * (N + p)) > ${maxmem} (maxmem)`); - } - // [B0...Bp−1] ← PBKDF2HMAC-SHA256(Passphrase, Salt, 1, blockSize*ParallelizationFactor) - // Since it has only one iteration there is no reason to use async variant - const B = pbkdf2(sha256, password, salt, { c: 1, dkLen: blockSize * p }); - const B32 = u32(B); - // Re-used between parallel iterations. Array(iterations) of B - const V = u32(new Uint8Array(blockSize * N)); - const tmp = u32(new Uint8Array(blockSize)); - let blockMixCb = () => { }; - if (onProgress) { - const totalBlockMix = 2 * N * p; - // Invoke callback if progress changes from 10.01 to 10.02 - // Allows to draw smooth progress bar on up to 8K screen - const callbackPer = Math.max(Math.floor(totalBlockMix / 10000), 1); - let blockMixCnt = 0; - blockMixCb = () => { - blockMixCnt++; - if (onProgress && (!(blockMixCnt % callbackPer) || blockMixCnt === totalBlockMix)) - onProgress(blockMixCnt / totalBlockMix); - }; - } - return { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick }; -} -function scryptOutput(password, dkLen, B, V, tmp) { - const res = pbkdf2(sha256, password, B, { c: 1, dkLen }); - B.fill(0); - V.fill(0); - tmp.fill(0); - return res; -} -/** - * Scrypt KDF from RFC 7914. - * @param password - pass - * @param salt - salt - * @param opts - parameters - * - `N` is cpu/mem work factor (power of 2 e.g. 2**18) - * - `r` is block size (8 is common), fine-tunes sequential memory read size and performance - * - `p` is parallelization factor (1 is common) - * - `dkLen` is output key length in bytes e.g. 32. - * - `asyncTick` - (default: 10) max time in ms for which async function can block execution - * - `maxmem` - (default: `1024 ** 3 + 1024` aka 1GB+1KB). A limit that the app could use for scrypt - * - `onProgress` - callback function that would be executed for progress report - * @returns Derived key - */ -export function scrypt(password, salt, opts) { - const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb } = scryptInit(password, salt, opts); - for (let pi = 0; pi < p; pi++) { - const Pi = blockSize32 * pi; - for (let i = 0; i < blockSize32; i++) - V[i] = B32[Pi + i]; // V[0] = B[i] - for (let i = 0, pos = 0; i < N - 1; i++) { - BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]); - blockMixCb(); - } - BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element - blockMixCb(); - for (let i = 0; i < N; i++) { - // First u32 of the last 64-byte block (u32 is LE) - const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations - for (let k = 0; k < blockSize32; k++) - tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j] - BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) - blockMixCb(); - } - } - return scryptOutput(password, dkLen, B, V, tmp); -} -/** - * Scrypt KDF from RFC 7914. - */ -export async function scryptAsync(password, salt, opts) { - const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick } = scryptInit(password, salt, opts); - for (let pi = 0; pi < p; pi++) { - const Pi = blockSize32 * pi; - for (let i = 0; i < blockSize32; i++) - V[i] = B32[Pi + i]; // V[0] = B[i] - let pos = 0; - await asyncLoop(N - 1, asyncTick, () => { - BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]); - blockMixCb(); - }); - BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element - blockMixCb(); - await asyncLoop(N, asyncTick, () => { - // First u32 of the last 64-byte block (u32 is LE) - const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations - for (let k = 0; k < blockSize32; k++) - tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j] - BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) - blockMixCb(); - }); - } - return scryptOutput(password, dkLen, B, V, tmp); -} -//# sourceMappingURL=scrypt.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/scrypt.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/scrypt.js.map deleted file mode 100644 index 0fa6c1f1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/scrypt.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"scrypt.js","sourceRoot":"","sources":["../src/scrypt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAS,GAAG,EAAE,MAAM,YAAY,CAAC;AAE9D,sBAAsB;AAEtB,yBAAyB;AACzB,MAAM,IAAI,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;AAEnE,gDAAgD;AACh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CAAC,CAAC,CAAC,CAAC,yBAAyB;YACvD,UAAU,EAAE,CAAC;QACf,CAAC,CAAC,CAAC;KACJ;IACD,OAAO,YAAY,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;AAClD,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/sha1.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/sha1.js deleted file mode 100644 index 563bff57..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/sha1.js +++ /dev/null @@ -1,87 +0,0 @@ -import { SHA2 } from './_sha2.js'; -import { wrapConstructor } from './utils.js'; -// SHA1 was cryptographically broken. -// It is still widely used in legacy apps. Don't use it for a new protocol. -// RFC 3174 -const rotl = (word, shift) => (word << shift) | ((word >>> (32 - shift)) >>> 0); -// Choice: a ? b : c -const Chi = (a, b, c) => (a & b) ^ (~a & c); -// Majority function, true if any two inpust is true -const Maj = (a, b, c) => (a & b) ^ (a & c) ^ (b & c); -// Initial state -const IV = /* @__PURE__ */ new Uint32Array([ - 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0, -]); -// Temporary buffer, not used to store anything between runs -// Named this way because it matches specification. -const SHA1_W = /* @__PURE__ */ new Uint32Array(80); -class SHA1 extends SHA2 { - constructor() { - super(64, 20, 8, false); - this.A = IV[0] | 0; - this.B = IV[1] | 0; - this.C = IV[2] | 0; - this.D = IV[3] | 0; - this.E = IV[4] | 0; - } - get() { - const { A, B, C, D, E } = this; - return [A, B, C, D, E]; - } - set(A, B, C, D, E) { - this.A = A | 0; - this.B = B | 0; - this.C = C | 0; - this.D = D | 0; - this.E = E | 0; - } - process(view, offset) { - for (let i = 0; i < 16; i++, offset += 4) - SHA1_W[i] = view.getUint32(offset, false); - for (let i = 16; i < 80; i++) - SHA1_W[i] = rotl(SHA1_W[i - 3] ^ SHA1_W[i - 8] ^ SHA1_W[i - 14] ^ SHA1_W[i - 16], 1); - // Compression function main loop, 80 rounds - let { A, B, C, D, E } = this; - for (let i = 0; i < 80; i++) { - let F, K; - if (i < 20) { - F = Chi(B, C, D); - K = 0x5a827999; - } - else if (i < 40) { - F = B ^ C ^ D; - K = 0x6ed9eba1; - } - else if (i < 60) { - F = Maj(B, C, D); - K = 0x8f1bbcdc; - } - else { - F = B ^ C ^ D; - K = 0xca62c1d6; - } - const T = (rotl(A, 5) + F + E + K + SHA1_W[i]) | 0; - E = D; - D = C; - C = rotl(B, 30); - B = A; - A = T; - } - // Add the compressed chunk to the current hash value - A = (A + this.A) | 0; - B = (B + this.B) | 0; - C = (C + this.C) | 0; - D = (D + this.D) | 0; - E = (E + this.E) | 0; - this.set(A, B, C, D, E); - } - roundClean() { - SHA1_W.fill(0); - } - destroy() { - this.set(0, 0, 0, 0, 0); - this.buffer.fill(0); - } -} -export const sha1 = /* @__PURE__ */ wrapConstructor(() => new SHA1()); -//# sourceMappingURL=sha1.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/sha1.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/sha1.js.map deleted file mode 100644 index 55249dec..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/sha1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha1.js","sourceRoot":"","sources":["../src/sha1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,qCAAqC;AACrC,2EAA2E;AAE3E,WAAW;AACX,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,KAAa,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,EAAE,GAAG,KAAK,CAAC,CAA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AE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1B,CAAC;IACS,UAAU;QAClB,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC;IACD,OAAO;QACL,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACxB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACtB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,IAAI,GAAG,eAAe,CAAC,eAAe,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/sha256.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/sha256.js deleted file mode 100644 index e92203c8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/sha256.js +++ /dev/null @@ -1,126 +0,0 @@ -import { SHA2 } from './_sha2.js'; -import { rotr, wrapConstructor } from './utils.js'; -// SHA2-256 need to try 2^128 hashes to execute birthday attack. -// BTC network is doing 2^67 hashes/sec as per early 2023. -// Choice: a ? b : c -const Chi = (a, b, c) => (a & b) ^ (~a & c); -// Majority function, true if any two inpust is true -const Maj = (a, b, c) => (a & b) ^ (a & c) ^ (b & c); -// Round constants: -// first 32 bits of the fractional parts of the cube roots of the first 64 primes 2..311) -// prettier-ignore -const SHA256_K = /* @__PURE__ */ new Uint32Array([ - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 -]); -// Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19): -// prettier-ignore -const IV = /* @__PURE__ */ new Uint32Array([ - 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 -]); -// Temporary buffer, not used to store anything between runs -// Named this way because it matches specification. -const SHA256_W = /* @__PURE__ */ new Uint32Array(64); -class SHA256 extends SHA2 { - constructor() { - super(64, 32, 8, false); - // We cannot use array here since array allows indexing by variable - // which means optimizer/compiler cannot use registers. - this.A = IV[0] | 0; - this.B = IV[1] | 0; - this.C = IV[2] | 0; - this.D = IV[3] | 0; - this.E = IV[4] | 0; - this.F = IV[5] | 0; - this.G = IV[6] | 0; - this.H = IV[7] | 0; - } - get() { - const { A, B, C, D, E, F, G, H } = this; - return [A, B, C, D, E, F, G, H]; - } - // prettier-ignore - set(A, B, C, D, E, F, G, H) { - this.A = A | 0; - this.B = B | 0; - this.C = C | 0; - this.D = D | 0; - this.E = E | 0; - this.F = F | 0; - this.G = G | 0; - this.H = H | 0; - } - process(view, offset) { - // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array - for (let i = 0; i < 16; i++, offset += 4) - SHA256_W[i] = view.getUint32(offset, false); - for (let i = 16; i < 64; i++) { - const W15 = SHA256_W[i - 15]; - const W2 = SHA256_W[i - 2]; - const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3); - const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10); - SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0; - } - // Compression function main loop, 64 rounds - let { A, B, C, D, E, F, G, H } = this; - for (let i = 0; i < 64; i++) { - const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25); - const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; - const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22); - const T2 = (sigma0 + Maj(A, B, C)) | 0; - H = G; - G = F; - F = E; - E = (D + T1) | 0; - D = C; - C = B; - B = A; - A = (T1 + T2) | 0; - } - // Add the compressed chunk to the current hash value - A = (A + this.A) | 0; - B = (B + this.B) | 0; - C = (C + this.C) | 0; - D = (D + this.D) | 0; - E = (E + this.E) | 0; - F = (F + this.F) | 0; - G = (G + this.G) | 0; - H = (H + this.H) | 0; - this.set(A, B, C, D, E, F, G, H); - } - roundClean() { - SHA256_W.fill(0); - } - destroy() { - this.set(0, 0, 0, 0, 0, 0, 0, 0); - this.buffer.fill(0); - } -} -// Constants from https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf -class SHA224 extends SHA256 { - constructor() { - super(); - this.A = 0xc1059ed8 | 0; - this.B = 0x367cd507 | 0; - this.C = 0x3070dd17 | 0; - this.D = 0xf70e5939 | 0; - this.E = 0xffc00b31 | 0; - this.F = 0x68581511 | 0; - this.G = 0x64f98fa7 | 0; - this.H = 0xbefa4fa4 | 0; - this.outputLen = 28; - } -} -/** - * SHA2-256 hash function - * @param message - data that would be hashed - */ -export const sha256 = /* @__PURE__ */ wrapConstructor(() => new SHA256()); -export const sha224 = /* @__PURE__ */ wrapConstructor(() => new SHA224()); -//# sourceMappingURL=sha256.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/sha256.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/sha256.js.map deleted file mode 100644 index 0236fa86..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/sha256.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha256.js","sourceRoot":"","sources":["../src/sha256.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEnD,gEAAgE;AAChE,0DAA0D;AAE1D,oBAAoB;AACpB,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AACpE,oDAAoD;AACpD,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAE7E,mBAAmB;AACnB,yFAAyF;AACzF,kBAAkB;AAClB,MAAM,QAAQ,GAAG,eAAe,CAAA,IAAI,WAAW,CAAC;IAC9C,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IAC9F,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IAC9F,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAA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at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/sha3-addons.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/sha3-addons.js deleted file mode 100644 index 449b3a38..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/sha3-addons.js +++ /dev/null @@ -1,347 +0,0 @@ -import { number as assertNumber } from './_assert.js'; -import { toBytes, wrapConstructorWithOpts, u32 } from './utils.js'; -import { Keccak } from './sha3.js'; -// cSHAKE && KMAC (NIST SP800-185) -function leftEncode(n) { - const res = [n & 0xff]; - n >>= 8; - for (; n > 0; n >>= 8) - res.unshift(n & 0xff); - res.unshift(res.length); - return new Uint8Array(res); -} -function rightEncode(n) { - const res = [n & 0xff]; - n >>= 8; - for (; n > 0; n >>= 8) - res.unshift(n & 0xff); - res.push(res.length); - return new Uint8Array(res); -} -function chooseLen(opts, outputLen) { - return opts.dkLen === undefined ? outputLen : opts.dkLen; -} -const toBytesOptional = (buf) => (buf !== undefined ? toBytes(buf) : new Uint8Array([])); -// NOTE: second modulo is necessary since we don't need to add padding if current element takes whole block -const getPadding = (len, block) => new Uint8Array((block - (len % block)) % block); -// Personalization -function cshakePers(hash, opts = {}) { - if (!opts || (!opts.personalization && !opts.NISTfn)) - return hash; - // Encode and pad inplace to avoid unneccesary memory copies/slices (so we don't need to zero them later) - // bytepad(encode_string(N) || encode_string(S), 168) - const blockLenBytes = leftEncode(hash.blockLen); - const fn = toBytesOptional(opts.NISTfn); - const fnLen = leftEncode(8 * fn.length); // length in bits - const pers = toBytesOptional(opts.personalization); - const persLen = leftEncode(8 * pers.length); // length in bits - if (!fn.length && !pers.length) - return hash; - hash.suffix = 0x04; - hash.update(blockLenBytes).update(fnLen).update(fn).update(persLen).update(pers); - let totalLen = blockLenBytes.length + fnLen.length + fn.length + persLen.length + pers.length; - hash.update(getPadding(totalLen, hash.blockLen)); - return hash; -} -const gencShake = (suffix, blockLen, outputLen) => wrapConstructorWithOpts((opts = {}) => cshakePers(new Keccak(blockLen, suffix, chooseLen(opts, outputLen), true), opts)); -export const cshake128 = /* @__PURE__ */ (() => gencShake(0x1f, 168, 128 / 8))(); -export const cshake256 = /* @__PURE__ */ (() => gencShake(0x1f, 136, 256 / 8))(); -class KMAC extends Keccak { - constructor(blockLen, outputLen, enableXOF, key, opts = {}) { - super(blockLen, 0x1f, outputLen, enableXOF); - cshakePers(this, { NISTfn: 'KMAC', personalization: opts.personalization }); - key = toBytes(key); - // 1. newX = bytepad(encode_string(K), 168) || X || right_encode(L). - const blockLenBytes = leftEncode(this.blockLen); - const keyLen = leftEncode(8 * key.length); - this.update(blockLenBytes).update(keyLen).update(key); - const totalLen = blockLenBytes.length + keyLen.length + key.length; - this.update(getPadding(totalLen, this.blockLen)); - } - finish() { - if (!this.finished) - this.update(rightEncode(this.enableXOF ? 0 : this.outputLen * 8)); // outputLen in bits - super.finish(); - } - _cloneInto(to) { - // Create new instance without calling constructor since key already in state and we don't know it. - // Force "to" to be instance of KMAC instead of Sha3. - if (!to) { - to = Object.create(Object.getPrototypeOf(this), {}); - to.state = this.state.slice(); - to.blockLen = this.blockLen; - to.state32 = u32(to.state); - } - return super._cloneInto(to); - } - clone() { - return this._cloneInto(); - } -} -function genKmac(blockLen, outputLen, xof = false) { - const kmac = (key, message, opts) => kmac.create(key, opts).update(message).digest(); - kmac.create = (key, opts = {}) => new KMAC(blockLen, chooseLen(opts, outputLen), xof, key, opts); - return kmac; -} -export const kmac128 = /* @__PURE__ */ (() => genKmac(168, 128 / 8))(); -export const kmac256 = /* @__PURE__ */ (() => genKmac(136, 256 / 8))(); -export const kmac128xof = /* @__PURE__ */ (() => genKmac(168, 128 / 8, true))(); -export const kmac256xof = /* @__PURE__ */ (() => genKmac(136, 256 / 8, true))(); -// TupleHash -// Usage: tuple(['ab', 'cd']) != tuple(['a', 'bcd']) -class TupleHash extends Keccak { - constructor(blockLen, outputLen, enableXOF, opts = {}) { - super(blockLen, 0x1f, outputLen, enableXOF); - cshakePers(this, { NISTfn: 'TupleHash', personalization: opts.personalization }); - // Change update after cshake processed - this.update = (data) => { - data = toBytes(data); - super.update(leftEncode(data.length * 8)); - super.update(data); - return this; - }; - } - finish() { - if (!this.finished) - super.update(rightEncode(this.enableXOF ? 0 : this.outputLen * 8)); // outputLen in bits - super.finish(); - } - _cloneInto(to) { - to || (to = new TupleHash(this.blockLen, this.outputLen, this.enableXOF)); - return super._cloneInto(to); - } - clone() { - return this._cloneInto(); - } -} -function genTuple(blockLen, outputLen, xof = false) { - const tuple = (messages, opts) => { - const h = tuple.create(opts); - for (const msg of messages) - h.update(msg); - return h.digest(); - }; - tuple.create = (opts = {}) => new TupleHash(blockLen, chooseLen(opts, outputLen), xof, opts); - return tuple; -} -export const tuplehash128 = /* @__PURE__ */ (() => genTuple(168, 128 / 8))(); -export const tuplehash256 = /* @__PURE__ */ (() => genTuple(136, 256 / 8))(); -export const tuplehash128xof = /* @__PURE__ */ (() => genTuple(168, 128 / 8, true))(); -export const tuplehash256xof = /* @__PURE__ */ (() => genTuple(136, 256 / 8, true))(); -class ParallelHash extends Keccak { - constructor(blockLen, outputLen, leafCons, enableXOF, opts = {}) { - super(blockLen, 0x1f, outputLen, enableXOF); - this.leafCons = leafCons; - this.chunkPos = 0; // Position of current block in chunk - this.chunksDone = 0; // How many chunks we already have - cshakePers(this, { NISTfn: 'ParallelHash', personalization: opts.personalization }); - let { blockLen: B } = opts; - B || (B = 8); - assertNumber(B); - this.chunkLen = B; - super.update(leftEncode(B)); - // Change update after cshake processed - this.update = (data) => { - data = toBytes(data); - const { chunkLen, leafCons } = this; - for (let pos = 0, len = data.length; pos < len;) { - if (this.chunkPos == chunkLen || !this.leafHash) { - if (this.leafHash) { - super.update(this.leafHash.digest()); - this.chunksDone++; - } - this.leafHash = leafCons(); - this.chunkPos = 0; - } - const take = Math.min(chunkLen - this.chunkPos, len - pos); - this.leafHash.update(data.subarray(pos, pos + take)); - this.chunkPos += take; - pos += take; - } - return this; - }; - } - finish() { - if (this.finished) - return; - if (this.leafHash) { - super.update(this.leafHash.digest()); - this.chunksDone++; - } - super.update(rightEncode(this.chunksDone)); - super.update(rightEncode(this.enableXOF ? 0 : this.outputLen * 8)); // outputLen in bits - super.finish(); - } - _cloneInto(to) { - to || (to = new ParallelHash(this.blockLen, this.outputLen, this.leafCons, this.enableXOF)); - if (this.leafHash) - to.leafHash = this.leafHash._cloneInto(to.leafHash); - to.chunkPos = this.chunkPos; - to.chunkLen = this.chunkLen; - to.chunksDone = this.chunksDone; - return super._cloneInto(to); - } - destroy() { - super.destroy.call(this); - if (this.leafHash) - this.leafHash.destroy(); - } - clone() { - return this._cloneInto(); - } -} -function genPrl(blockLen, outputLen, leaf, xof = false) { - const parallel = (message, opts) => parallel.create(opts).update(message).digest(); - parallel.create = (opts = {}) => new ParallelHash(blockLen, chooseLen(opts, outputLen), () => leaf.create({ dkLen: 2 * outputLen }), xof, opts); - return parallel; -} -export const parallelhash128 = /* @__PURE__ */ (() => genPrl(168, 128 / 8, cshake128))(); -export const parallelhash256 = /* @__PURE__ */ (() => genPrl(136, 256 / 8, cshake256))(); -export const parallelhash128xof = /* @__PURE__ */ (() => genPrl(168, 128 / 8, cshake128, true))(); -export const parallelhash256xof = /* @__PURE__ */ (() => genPrl(136, 256 / 8, cshake256, true))(); -// Kangaroo -// Same as NIST rightEncode, but returns [0] for zero string -function rightEncodeK12(n) { - const res = []; - for (; n > 0; n >>= 8) - res.unshift(n & 0xff); - res.push(res.length); - return new Uint8Array(res); -} -const EMPTY = new Uint8Array([]); -class KangarooTwelve extends Keccak { - constructor(blockLen, leafLen, outputLen, rounds, opts) { - super(blockLen, 0x07, outputLen, true, rounds); - this.leafLen = leafLen; - this.chunkLen = 8192; - this.chunkPos = 0; // Position of current block in chunk - this.chunksDone = 0; // How many chunks we already have - const { personalization } = opts; - this.personalization = toBytesOptional(personalization); - } - update(data) { - data = toBytes(data); - const { chunkLen, blockLen, leafLen, rounds } = this; - for (let pos = 0, len = data.length; pos < len;) { - if (this.chunkPos == chunkLen) { - if (this.leafHash) - super.update(this.leafHash.digest()); - else { - this.suffix = 0x06; // Its safe to change suffix here since its used only in digest() - super.update(new Uint8Array([3, 0, 0, 0, 0, 0, 0, 0])); - } - this.leafHash = new Keccak(blockLen, 0x0b, leafLen, false, rounds); - this.chunksDone++; - this.chunkPos = 0; - } - const take = Math.min(chunkLen - this.chunkPos, len - pos); - const chunk = data.subarray(pos, pos + take); - if (this.leafHash) - this.leafHash.update(chunk); - else - super.update(chunk); - this.chunkPos += take; - pos += take; - } - return this; - } - finish() { - if (this.finished) - return; - const { personalization } = this; - this.update(personalization).update(rightEncodeK12(personalization.length)); - // Leaf hash - if (this.leafHash) { - super.update(this.leafHash.digest()); - super.update(rightEncodeK12(this.chunksDone)); - super.update(new Uint8Array([0xff, 0xff])); - } - super.finish.call(this); - } - destroy() { - super.destroy.call(this); - if (this.leafHash) - this.leafHash.destroy(); - // We cannot zero personalization buffer since it is user provided and we don't want to mutate user input - this.personalization = EMPTY; - } - _cloneInto(to) { - const { blockLen, leafLen, leafHash, outputLen, rounds } = this; - to || (to = new KangarooTwelve(blockLen, leafLen, outputLen, rounds, {})); - super._cloneInto(to); - if (leafHash) - to.leafHash = leafHash._cloneInto(to.leafHash); - to.personalization.set(this.personalization); - to.leafLen = this.leafLen; - to.chunkPos = this.chunkPos; - to.chunksDone = this.chunksDone; - return to; - } - clone() { - return this._cloneInto(); - } -} -// Default to 32 bytes, so it can be used without opts -export const k12 = /* @__PURE__ */ (() => wrapConstructorWithOpts((opts = {}) => new KangarooTwelve(168, 32, chooseLen(opts, 32), 12, opts)))(); -// MarsupilamiFourteen -export const m14 = /* @__PURE__ */ (() => wrapConstructorWithOpts((opts = {}) => new KangarooTwelve(136, 64, chooseLen(opts, 64), 14, opts)))(); -// https://keccak.team/files/CSF-0.1.pdf -// + https://github.com/XKCP/XKCP/tree/master/lib/high/Keccak/PRG -class KeccakPRG extends Keccak { - constructor(capacity) { - assertNumber(capacity); - // Rho should be full bytes - if (capacity < 0 || capacity > 1600 - 10 || (1600 - capacity - 2) % 8) - throw new Error('KeccakPRG: Invalid capacity'); - // blockLen = rho in bytes - super((1600 - capacity - 2) / 8, 0, 0, true); - this.rate = 1600 - capacity; - this.posOut = Math.floor((this.rate + 7) / 8); - } - keccak() { - // Duplex padding - this.state[this.pos] ^= 0x01; - this.state[this.blockLen] ^= 0x02; // Rho is full bytes - super.keccak(); - this.pos = 0; - this.posOut = 0; - } - update(data) { - super.update(data); - this.posOut = this.blockLen; - return this; - } - feed(data) { - return this.update(data); - } - finish() { } - digestInto(_out) { - throw new Error('KeccakPRG: digest is not allowed, please use .fetch instead.'); - } - fetch(bytes) { - return this.xof(bytes); - } - // Ensure irreversibility (even if state leaked previous outputs cannot be computed) - forget() { - if (this.rate < 1600 / 2 + 1) - throw new Error('KeccakPRG: rate too low to use forget'); - this.keccak(); - for (let i = 0; i < this.blockLen; i++) - this.state[i] = 0; - this.pos = this.blockLen; - this.keccak(); - this.posOut = this.blockLen; - } - _cloneInto(to) { - const { rate } = this; - to || (to = new KeccakPRG(1600 - rate)); - super._cloneInto(to); - to.rate = rate; - return to; - } - clone() { - return this._cloneInto(); - } -} -export const keccakprg = (capacity = 254) => new KeccakPRG(capacity); -//# sourceMappingURL=sha3-addons.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/sha3-addons.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/sha3-addons.js.map deleted file mode 100644 index 7600a9a9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/sha3-addons.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha3-addons.js","sourceRoot":"","sources":["../src/sha3-addons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAS,OAAO,EAAE,uBAAuB,EAAE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GAAG,IAAI,CAAC,EAAC;QAClC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;QACrB,EAAE,CAAC,IAAI,GAAG,IAAI,CAAC;QACf,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,KAAK;QACH,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;IAC3B,CAAC;CACF;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,QAAQ,GAAG,GAAG,EAAE,EAAE,CAAC,IAAI,SAAS,CAAC,QAAQ,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/sha3.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/sha3.js deleted file mode 100644 index 0879d36f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/sha3.js +++ /dev/null @@ -1,208 +0,0 @@ -import { bytes, exists, number, output } from './_assert.js'; -import { rotlBH, rotlBL, rotlSH, rotlSL, split } from './_u64.js'; -import { Hash, u32, toBytes, wrapConstructor, wrapXOFConstructorWithOpts, } from './utils.js'; -// SHA3 (keccak) is based on a new design: basically, the internal state is bigger than output size. -// It's called a sponge function. -// Various per round constants calculations -const [SHA3_PI, SHA3_ROTL, _SHA3_IOTA] = [[], [], []]; -const _0n = /* @__PURE__ */ BigInt(0); -const _1n = /* @__PURE__ */ BigInt(1); -const _2n = /* @__PURE__ */ BigInt(2); -const _7n = /* @__PURE__ */ BigInt(7); -const _256n = /* @__PURE__ */ BigInt(256); -const _0x71n = /* @__PURE__ */ BigInt(0x71); -for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) { - // Pi - [x, y] = [y, (2 * x + 3 * y) % 5]; - SHA3_PI.push(2 * (5 * y + x)); - // Rotational - SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64); - // Iota - let t = _0n; - for (let j = 0; j < 7; j++) { - R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n; - if (R & _2n) - t ^= _1n << ((_1n << /* @__PURE__ */ BigInt(j)) - _1n); - } - _SHA3_IOTA.push(t); -} -const [SHA3_IOTA_H, SHA3_IOTA_L] = /* @__PURE__ */ split(_SHA3_IOTA, true); -// Left rotation (without 0, 32, 64) -const rotlH = (h, l, s) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s)); -const rotlL = (h, l, s) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s)); -// Same as keccakf1600, but allows to skip some rounds -export function keccakP(s, rounds = 24) { - const B = new Uint32Array(5 * 2); - // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js) - for (let round = 24 - rounds; round < 24; round++) { - // Theta θ - for (let x = 0; x < 10; x++) - B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40]; - for (let x = 0; x < 10; x += 2) { - const idx1 = (x + 8) % 10; - const idx0 = (x + 2) % 10; - const B0 = B[idx0]; - const B1 = B[idx0 + 1]; - const Th = rotlH(B0, B1, 1) ^ B[idx1]; - const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1]; - for (let y = 0; y < 50; y += 10) { - s[x + y] ^= Th; - s[x + y + 1] ^= Tl; - } - } - // Rho (ρ) and Pi (π) - let curH = s[2]; - let curL = s[3]; - for (let t = 0; t < 24; t++) { - const shift = SHA3_ROTL[t]; - const Th = rotlH(curH, curL, shift); - const Tl = rotlL(curH, curL, shift); - const PI = SHA3_PI[t]; - curH = s[PI]; - curL = s[PI + 1]; - s[PI] = Th; - s[PI + 1] = Tl; - } - // Chi (χ) - for (let y = 0; y < 50; y += 10) { - for (let x = 0; x < 10; x++) - B[x] = s[y + x]; - for (let x = 0; x < 10; x++) - s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10]; - } - // Iota (ι) - s[0] ^= SHA3_IOTA_H[round]; - s[1] ^= SHA3_IOTA_L[round]; - } - B.fill(0); -} -export class Keccak extends Hash { - // NOTE: we accept arguments in bytes instead of bits here. - constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) { - super(); - this.blockLen = blockLen; - this.suffix = suffix; - this.outputLen = outputLen; - this.enableXOF = enableXOF; - this.rounds = rounds; - this.pos = 0; - this.posOut = 0; - this.finished = false; - this.destroyed = false; - // Can be passed from user as dkLen - number(outputLen); - // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes - if (0 >= this.blockLen || this.blockLen >= 200) - throw new Error('Sha3 supports only keccak-f1600 function'); - this.state = new Uint8Array(200); - this.state32 = u32(this.state); - } - keccak() { - keccakP(this.state32, this.rounds); - this.posOut = 0; - this.pos = 0; - } - update(data) { - exists(this); - const { blockLen, state } = this; - data = toBytes(data); - const len = data.length; - for (let pos = 0; pos < len;) { - const take = Math.min(blockLen - this.pos, len - pos); - for (let i = 0; i < take; i++) - state[this.pos++] ^= data[pos++]; - if (this.pos === blockLen) - this.keccak(); - } - return this; - } - finish() { - if (this.finished) - return; - this.finished = true; - const { state, suffix, pos, blockLen } = this; - // Do the padding - state[pos] ^= suffix; - if ((suffix & 0x80) !== 0 && pos === blockLen - 1) - this.keccak(); - state[blockLen - 1] ^= 0x80; - this.keccak(); - } - writeInto(out) { - exists(this, false); - bytes(out); - this.finish(); - const bufferOut = this.state; - const { blockLen } = this; - for (let pos = 0, len = out.length; pos < len;) { - if (this.posOut >= blockLen) - this.keccak(); - const take = Math.min(blockLen - this.posOut, len - pos); - out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); - this.posOut += take; - pos += take; - } - return out; - } - xofInto(out) { - // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF - if (!this.enableXOF) - throw new Error('XOF is not possible for this instance'); - return this.writeInto(out); - } - xof(bytes) { - number(bytes); - return this.xofInto(new Uint8Array(bytes)); - } - digestInto(out) { - output(out, this); - if (this.finished) - throw new Error('digest() was already called'); - this.writeInto(out); - this.destroy(); - return out; - } - digest() { - return this.digestInto(new Uint8Array(this.outputLen)); - } - destroy() { - this.destroyed = true; - this.state.fill(0); - } - _cloneInto(to) { - const { blockLen, suffix, outputLen, rounds, enableXOF } = this; - to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds)); - to.state32.set(this.state32); - to.pos = this.pos; - to.posOut = this.posOut; - to.finished = this.finished; - to.rounds = rounds; - // Suffix can change in cSHAKE - to.suffix = suffix; - to.outputLen = outputLen; - to.enableXOF = enableXOF; - to.destroyed = this.destroyed; - return to; - } -} -const gen = (suffix, blockLen, outputLen) => wrapConstructor(() => new Keccak(blockLen, suffix, outputLen)); -export const sha3_224 = /* @__PURE__ */ gen(0x06, 144, 224 / 8); -/** - * SHA3-256 hash function - * @param message - that would be hashed - */ -export const sha3_256 = /* @__PURE__ */ gen(0x06, 136, 256 / 8); -export const sha3_384 = /* @__PURE__ */ gen(0x06, 104, 384 / 8); -export const sha3_512 = /* @__PURE__ */ gen(0x06, 72, 512 / 8); -export const keccak_224 = /* @__PURE__ */ gen(0x01, 144, 224 / 8); -/** - * keccak-256 hash function. Different from SHA3-256. - * @param message - that would be hashed - */ -export const keccak_256 = /* @__PURE__ */ gen(0x01, 136, 256 / 8); -export const keccak_384 = /* @__PURE__ */ gen(0x01, 104, 384 / 8); -export const keccak_512 = /* @__PURE__ */ gen(0x01, 72, 512 / 8); -const genShake = (suffix, blockLen, outputLen) => wrapXOFConstructorWithOpts((opts = {}) => new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true)); -export const shake128 = /* @__PURE__ */ genShake(0x1f, 168, 128 / 8); -export const shake256 = /* @__PURE__ */ genShake(0x1f, 136, 256 / 8); -//# sourceMappingURL=sha3.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/sha3.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/sha3.js.map deleted file mode 100644 index 32d5b164..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/sha3.js.map +++ /dev/null @@ -1 +0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,MAAc,EAAE,QAAgB,EAAE,SAAiB,EAAE,EAAE,CACvE,0BAA0B,CACxB,CAAC,OAAkB,EAAE,EAAE,EAAE,CACvB,IAAI,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CACxF,CAAC;AAEJ,MAAM,CAAC,MAAM,QAAQ,GAAG,eAAe,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC;AACrE,MAAM,CAAC,MAAM,QAAQ,GAAG,eAAe,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/sha512.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/sha512.js deleted file mode 100644 index f938b6d0..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/sha512.js +++ /dev/null @@ -1,231 +0,0 @@ -import { SHA2 } from './_sha2.js'; -import u64 from './_u64.js'; -import { wrapConstructor } from './utils.js'; -// Round contants (first 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409): -// prettier-ignore -const [SHA512_Kh, SHA512_Kl] = /* @__PURE__ */ (() => u64.split([ - '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc', - '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118', - '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2', - '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694', - '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65', - '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5', - '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4', - '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70', - '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df', - '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b', - '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30', - '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8', - '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8', - '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3', - '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec', - '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b', - '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178', - '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b', - '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c', - '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817' -].map(n => BigInt(n))))(); -// Temporary buffer, not used to store anything between runs -const SHA512_W_H = /* @__PURE__ */ new Uint32Array(80); -const SHA512_W_L = /* @__PURE__ */ new Uint32Array(80); -export class SHA512 extends SHA2 { - constructor() { - super(128, 64, 16, false); - // We cannot use array here since array allows indexing by variable which means optimizer/compiler cannot use registers. - // Also looks cleaner and easier to verify with spec. - // Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19): - // h -- high 32 bits, l -- low 32 bits - this.Ah = 0x6a09e667 | 0; - this.Al = 0xf3bcc908 | 0; - this.Bh = 0xbb67ae85 | 0; - this.Bl = 0x84caa73b | 0; - this.Ch = 0x3c6ef372 | 0; - this.Cl = 0xfe94f82b | 0; - this.Dh = 0xa54ff53a | 0; - this.Dl = 0x5f1d36f1 | 0; - this.Eh = 0x510e527f | 0; - this.El = 0xade682d1 | 0; - this.Fh = 0x9b05688c | 0; - this.Fl = 0x2b3e6c1f | 0; - this.Gh = 0x1f83d9ab | 0; - this.Gl = 0xfb41bd6b | 0; - this.Hh = 0x5be0cd19 | 0; - this.Hl = 0x137e2179 | 0; - } - // prettier-ignore - get() { - const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; - return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl]; - } - // prettier-ignore - set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) { - this.Ah = Ah | 0; - this.Al = Al | 0; - this.Bh = Bh | 0; - this.Bl = Bl | 0; - this.Ch = Ch | 0; - this.Cl = Cl | 0; - this.Dh = Dh | 0; - this.Dl = Dl | 0; - this.Eh = Eh | 0; - this.El = El | 0; - this.Fh = Fh | 0; - this.Fl = Fl | 0; - this.Gh = Gh | 0; - this.Gl = Gl | 0; - this.Hh = Hh | 0; - this.Hl = Hl | 0; - } - process(view, offset) { - // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array - for (let i = 0; i < 16; i++, offset += 4) { - SHA512_W_H[i] = view.getUint32(offset); - SHA512_W_L[i] = view.getUint32((offset += 4)); - } - for (let i = 16; i < 80; i++) { - // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7) - const W15h = SHA512_W_H[i - 15] | 0; - const W15l = SHA512_W_L[i - 15] | 0; - const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7); - const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7); - // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6) - const W2h = SHA512_W_H[i - 2] | 0; - const W2l = SHA512_W_L[i - 2] | 0; - const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6); - const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6); - // SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16]; - const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]); - const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]); - SHA512_W_H[i] = SUMh | 0; - SHA512_W_L[i] = SUMl | 0; - } - let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; - // Compression function main loop, 80 rounds - for (let i = 0; i < 80; i++) { - // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41) - const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41); - const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41); - //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; - const CHIh = (Eh & Fh) ^ (~Eh & Gh); - const CHIl = (El & Fl) ^ (~El & Gl); - // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i] - // prettier-ignore - const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]); - const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]); - const T1l = T1ll | 0; - // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39) - const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39); - const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39); - const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch); - const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl); - Hh = Gh | 0; - Hl = Gl | 0; - Gh = Fh | 0; - Gl = Fl | 0; - Fh = Eh | 0; - Fl = El | 0; - ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0)); - Dh = Ch | 0; - Dl = Cl | 0; - Ch = Bh | 0; - Cl = Bl | 0; - Bh = Ah | 0; - Bl = Al | 0; - const All = u64.add3L(T1l, sigma0l, MAJl); - Ah = u64.add3H(All, T1h, sigma0h, MAJh); - Al = All | 0; - } - // Add the compressed chunk to the current hash value - ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0)); - ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0)); - ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0)); - ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0)); - ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0)); - ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0)); - ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0)); - ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0)); - this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl); - } - roundClean() { - SHA512_W_H.fill(0); - SHA512_W_L.fill(0); - } - destroy() { - this.buffer.fill(0); - this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - } -} -class SHA512_224 extends SHA512 { - constructor() { - super(); - // h -- high 32 bits, l -- low 32 bits - this.Ah = 0x8c3d37c8 | 0; - this.Al = 0x19544da2 | 0; - this.Bh = 0x73e19966 | 0; - this.Bl = 0x89dcd4d6 | 0; - this.Ch = 0x1dfab7ae | 0; - this.Cl = 0x32ff9c82 | 0; - this.Dh = 0x679dd514 | 0; - this.Dl = 0x582f9fcf | 0; - this.Eh = 0x0f6d2b69 | 0; - this.El = 0x7bd44da8 | 0; - this.Fh = 0x77e36f73 | 0; - this.Fl = 0x04c48942 | 0; - this.Gh = 0x3f9d85a8 | 0; - this.Gl = 0x6a1d36c8 | 0; - this.Hh = 0x1112e6ad | 0; - this.Hl = 0x91d692a1 | 0; - this.outputLen = 28; - } -} -class SHA512_256 extends SHA512 { - constructor() { - super(); - // h -- high 32 bits, l -- low 32 bits - this.Ah = 0x22312194 | 0; - this.Al = 0xfc2bf72c | 0; - this.Bh = 0x9f555fa3 | 0; - this.Bl = 0xc84c64c2 | 0; - this.Ch = 0x2393b86b | 0; - this.Cl = 0x6f53b151 | 0; - this.Dh = 0x96387719 | 0; - this.Dl = 0x5940eabd | 0; - this.Eh = 0x96283ee2 | 0; - this.El = 0xa88effe3 | 0; - this.Fh = 0xbe5e1e25 | 0; - this.Fl = 0x53863992 | 0; - this.Gh = 0x2b0199fc | 0; - this.Gl = 0x2c85b8aa | 0; - this.Hh = 0x0eb72ddc | 0; - this.Hl = 0x81c52ca2 | 0; - this.outputLen = 32; - } -} -class SHA384 extends SHA512 { - constructor() { - super(); - // h -- high 32 bits, l -- low 32 bits - this.Ah = 0xcbbb9d5d | 0; - this.Al = 0xc1059ed8 | 0; - this.Bh = 0x629a292a | 0; - this.Bl = 0x367cd507 | 0; - this.Ch = 0x9159015a | 0; - this.Cl = 0x3070dd17 | 0; - this.Dh = 0x152fecd8 | 0; - this.Dl = 0xf70e5939 | 0; - this.Eh = 0x67332667 | 0; - this.El = 0xffc00b31 | 0; - this.Fh = 0x8eb44a87 | 0; - this.Fl = 0x68581511 | 0; - this.Gh = 0xdb0c2e0d | 0; - this.Gl = 0x64f98fa7 | 0; - this.Hh = 0x47b5481d | 0; - this.Hl = 0xbefa4fa4 | 0; - this.outputLen = 48; - } -} -export const sha512 = /* @__PURE__ */ wrapConstructor(() => new SHA512()); -export const sha512_224 = /* @__PURE__ */ wrapConstructor(() => new SHA512_224()); -export const sha512_256 = /* @__PURE__ */ wrapConstructor(() => new SHA512_256()); -export const sha384 = /* @__PURE__ */ wrapConstructor(() => new SHA384()); -//# sourceMappingURL=sha512.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/sha512.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/sha512.js.map deleted file mode 100644 index 4c9e3e68..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/sha512.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha512.js","sourceRoot":"","sources":["../src/sha512.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,GAAG,MAAM,WAAW,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,0GAA0G;AAC1G,kBA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AAG,UAAU,GAAG,CAAC,CAAC;QACpB,OAAE,GAAG,UAAU,GAAG,CAAC,CAAC;QACpB,OAAE,GAAG,UAAU,GAAG,CAAC,CAAC;QACpB,OAAE,GAAG,UAAU,GAAG,CAAC,CAAC;QACpB,OAAE,GAAG,UAAU,GAAG,CAAC,CAAC;QACpB,OAAE,GAAG,UAAU,GAAG,CAAC,CAAC;QACpB,OAAE,GAAG,UAAU,GAAG,CAAC,CAAC;QACpB,OAAE,GAAG,UAAU,GAAG,CAAC,CAAC;QACpB,OAAE,GAAG,UAAU,GAAG,CAAC,CAAC;QACpB,OAAE,GAAG,UAAU,GAAG,CAAC,CAAC;QACpB,OAAE,GAAG,UAAU,GAAG,CAAC,CAAC;QACpB,OAAE,GAAG,UAAU,GAAG,CAAC,CAAC;QACpB,OAAE,GAAG,UAAU,GAAG,CAAC,CAAC;QAIlB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;IACtB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,MAAM,GAAG,eAAe,CAAC,eAAe,CAAC,GAAG,EAAE,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC;AAC1E,MAAM,CAAC,MAAM,UAAU,GAAG,eAAe,CAAC,eAAe,CAAC,GAAG,EAAE,CAAC,IAAI,UAAU,EAAE,CAAC,CAAC;AAClF,MAAM,CAAC,MAAM,UAAU,GAAG,eAAe,CAAC,eAAe,CAAC,GAAG,EAAE,CAAC,IAAI,UAAU,EAAE,CAAC,CAAC;AAClF,MAAM,CAAC,MAAM,MAAM,GAAG,eAAe,CAAC,eAAe,CAAC,GAAG,EAAE,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/utils.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/utils.js deleted file mode 100644 index 80c09498..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/utils.js +++ /dev/null @@ -1,154 +0,0 @@ -/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+. -// node.js versions earlier than v19 don't declare it in global scope. -// For node.js, package.json#exports field mapping rewrites import -// from `crypto` to `cryptoNode`, which imports native module. -// Makes the utils un-importable in browsers without a bundler. -// Once node.js 18 is deprecated, we can just drop the import. -import { crypto } from '@noble/hashes/crypto'; -const u8a = (a) => a instanceof Uint8Array; -// Cast array to different type -export const u8 = (arr) => new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength); -export const u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); -// Cast array to view -export const createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength); -// The rotate right (circular right shift) operation for uint32 -export const rotr = (word, shift) => (word << (32 - shift)) | (word >>> shift); -// big-endian hardware is rare. Just in case someone still decides to run hashes: -// early-throw an error because we don't support BE yet. -export const isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44; -if (!isLE) - throw new Error('Non little-endian hardware is not supported'); -const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0')); -/** - * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123' - */ -export function bytesToHex(bytes) { - if (!u8a(bytes)) - throw new Error('Uint8Array expected'); - // pre-caching improves the speed 6x - let hex = ''; - for (let i = 0; i < bytes.length; i++) { - hex += hexes[bytes[i]]; - } - return hex; -} -/** - * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23]) - */ -export function hexToBytes(hex) { - if (typeof hex !== 'string') - throw new Error('hex string expected, got ' + typeof hex); - const len = hex.length; - if (len % 2) - throw new Error('padded hex string expected, got unpadded hex of length ' + len); - const array = new Uint8Array(len / 2); - for (let i = 0; i < array.length; i++) { - const j = i * 2; - const hexByte = hex.slice(j, j + 2); - const byte = Number.parseInt(hexByte, 16); - if (Number.isNaN(byte) || byte < 0) - throw new Error('Invalid byte sequence'); - array[i] = byte; - } - return array; -} -// There is no setImmediate in browser and setTimeout is slow. -// call of async fn will return Promise, which will be fullfiled only on -// next scheduler queue processing step and this is exactly what we need. -export const nextTick = async () => { }; -// Returns control to thread each 'tick' ms to avoid blocking -export async function asyncLoop(iters, tick, cb) { - let ts = Date.now(); - for (let i = 0; i < iters; i++) { - cb(i); - // Date.now() is not monotonic, so in case if clock goes backwards we return return control too - const diff = Date.now() - ts; - if (diff >= 0 && diff < tick) - continue; - await nextTick(); - ts += diff; - } -} -/** - * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99]) - */ -export function utf8ToBytes(str) { - if (typeof str !== 'string') - throw new Error(`utf8ToBytes expected string, got ${typeof str}`); - return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809 -} -/** - * Normalizes (non-hex) string or Uint8Array to Uint8Array. - * Warning: when Uint8Array is passed, it would NOT get copied. - * Keep in mind for future mutable operations. - */ -export function toBytes(data) { - if (typeof data === 'string') - data = utf8ToBytes(data); - if (!u8a(data)) - throw new Error(`expected Uint8Array, got ${typeof data}`); - return data; -} -/** - * Copies several Uint8Arrays into one. - */ -export function concatBytes(...arrays) { - const r = new Uint8Array(arrays.reduce((sum, a) => sum + a.length, 0)); - let pad = 0; // walk through each item, ensure they have proper type - arrays.forEach((a) => { - if (!u8a(a)) - throw new Error('Uint8Array expected'); - r.set(a, pad); - pad += a.length; - }); - return r; -} -// For runtime check if class implements interface -export class Hash { - // Safe version that clones internal state - clone() { - return this._cloneInto(); - } -} -const toStr = {}.toString; -export function checkOpts(defaults, opts) { - if (opts !== undefined && toStr.call(opts) !== '[object Object]') - throw new Error('Options should be object or undefined'); - const merged = Object.assign(defaults, opts); - return merged; -} -export function wrapConstructor(hashCons) { - const hashC = (msg) => hashCons().update(toBytes(msg)).digest(); - const tmp = hashCons(); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = () => hashCons(); - return hashC; -} -export function wrapConstructorWithOpts(hashCons) { - const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest(); - const tmp = hashCons({}); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = (opts) => hashCons(opts); - return hashC; -} -export function wrapXOFConstructorWithOpts(hashCons) { - const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest(); - const tmp = hashCons({}); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = (opts) => hashCons(opts); - return hashC; -} -/** - * Secure PRNG. Uses `crypto.getRandomValues`, which defers to OS. - */ -export function randomBytes(bytesLength = 32) { - if (crypto && typeof crypto.getRandomValues === 'function') { - return crypto.getRandomValues(new Uint8Array(bytesLength)); - } - throw new Error('crypto.getRandomValues must be defined'); -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/utils.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/utils.js.map deleted file mode 100644 index 19d87a90..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/esm/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,sEAAsE;AAEtE,oFAAoF;AACpF,sEAAsE;AACtE,kEAAkE;AAClE,8DAA8D;AAC9D,+DAA+D;AAC/D,8DAA8D;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAM9C,MAAM,GAAG,GAAG,CAAC,CAAM,EAAmB,EAAE,CAAC,CAAC,YAAY,UAAU,CAAC;AACjE,+BAA+B;AAC/B,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAe,EAAE,EAAE,CAAC,IAAI,UAAU,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,UAAU,E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UAAU,EAAE;QAC1D,OAAO,MAAM,CAAC,eAAe,CAAC,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC;KAC5D;IACD,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;AAC5D,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/hkdf.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/hkdf.d.ts deleted file mode 100644 index e1d683bc..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/hkdf.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { CHash, Input } from './utils.js'; -/** - * HKDF-Extract(IKM, salt) -> PRK - * Arguments position differs from spec (IKM is first one, since it is not optional) - * @param hash - * @param ikm - * @param salt - * @returns - */ -export declare function extract(hash: CHash, ikm: Input, salt?: Input): Uint8Array; -/** - * HKDF-expand from the spec. - * @param prk - a pseudorandom key of at least HashLen octets (usually, the output from the extract step) - * @param info - optional context and application specific information (can be a zero-length string) - * @param length - length of output keying material in octets - */ -export declare function expand(hash: CHash, prk: Input, info?: Input, length?: number): Uint8Array; -/** - * HKDF (RFC 5869): extract + expand in one step. - * @param hash - hash function that would be used (e.g. sha256) - * @param ikm - input keying material, the initial key - * @param salt - optional salt value (a non-secret random value) - * @param info - optional context and application specific information - * @param length - length of output keying material in octets - */ -export declare const hkdf: (hash: CHash, ikm: Input, salt: Input | undefined, info: Input | undefined, length: number) => Uint8Array; diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/hkdf.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/hkdf.js deleted file mode 100644 index 021b68ec..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/hkdf.js +++ /dev/null @@ -1,78 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.hkdf = exports.expand = exports.extract = void 0; -const _assert_js_1 = require("./_assert.js"); -const utils_js_1 = require("./utils.js"); -const hmac_js_1 = require("./hmac.js"); -// HKDF (RFC 5869) -// https://soatok.blog/2021/11/17/understanding-hkdf/ -/** - * HKDF-Extract(IKM, salt) -> PRK - * Arguments position differs from spec (IKM is first one, since it is not optional) - * @param hash - * @param ikm - * @param salt - * @returns - */ -function extract(hash, ikm, salt) { - (0, _assert_js_1.hash)(hash); - // NOTE: some libraries treat zero-length array as 'not provided'; - // we don't, since we have undefined as 'not provided' - // https://github.com/RustCrypto/KDFs/issues/15 - if (salt === undefined) - salt = new Uint8Array(hash.outputLen); // if not provided, it is set to a string of HashLen zeros - return (0, hmac_js_1.hmac)(hash, (0, utils_js_1.toBytes)(salt), (0, utils_js_1.toBytes)(ikm)); -} -exports.extract = extract; -// HKDF-Expand(PRK, info, L) -> OKM -const HKDF_COUNTER = /* @__PURE__ */ new Uint8Array([0]); -const EMPTY_BUFFER = /* @__PURE__ */ new Uint8Array(); -/** - * HKDF-expand from the spec. - * @param prk - a pseudorandom key of at least HashLen octets (usually, the output from the extract step) - * @param info - optional context and application specific information (can be a zero-length string) - * @param length - length of output keying material in octets - */ -function expand(hash, prk, info, length = 32) { - (0, _assert_js_1.hash)(hash); - (0, _assert_js_1.number)(length); - if (length > 255 * hash.outputLen) - throw new Error('Length should be <= 255*HashLen'); - const blocks = Math.ceil(length / hash.outputLen); - if (info === undefined) - info = EMPTY_BUFFER; - // first L(ength) octets of T - const okm = new Uint8Array(blocks * hash.outputLen); - // Re-use HMAC instance between blocks - const HMAC = hmac_js_1.hmac.create(hash, prk); - const HMACTmp = HMAC._cloneInto(); - const T = new Uint8Array(HMAC.outputLen); - for (let counter = 0; counter < blocks; counter++) { - HKDF_COUNTER[0] = counter + 1; - // T(0) = empty string (zero length) - // T(N) = HMAC-Hash(PRK, T(N-1) | info | N) - HMACTmp.update(counter === 0 ? EMPTY_BUFFER : T) - .update(info) - .update(HKDF_COUNTER) - .digestInto(T); - okm.set(T, hash.outputLen * counter); - HMAC._cloneInto(HMACTmp); - } - HMAC.destroy(); - HMACTmp.destroy(); - T.fill(0); - HKDF_COUNTER.fill(0); - return okm.slice(0, length); -} -exports.expand = expand; -/** - * HKDF (RFC 5869): extract + expand in one step. - * @param hash - hash function that would be used (e.g. sha256) - * @param ikm - input keying material, the initial key - * @param salt - optional salt value (a non-secret random value) - * @param info - optional context and application specific information - * @param length - length of output keying material in octets - */ -const hkdf = (hash, ikm, salt, info, length) => expand(hash, extract(hash, ikm, salt), info, length); -exports.hkdf = hkdf; -//# sourceMappingURL=hkdf.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/hkdf.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/hkdf.js.map deleted file mode 100644 index 7790e7ca..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/hkdf.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hkdf.js","sourceRoot":"","sources":["src/hkdf.ts"],"names":[],"mappings":";;;AAAA,6CAA0E;AAC1E,yCAAmD;AACnD,uCAAiC;AAEjC,kBAAkB;AAClB,qDAAqD;AAErD;;;;;;;GAOG;AACH,SAAgB,OAAO,CAAC,IAAW,EAAE,GAAU,EAAE,IAAY;IAC3D,IAAA,iBAAU,EAAC,IAAI,CAAC,CAAC;IACjB,kEAAkE;IAClE,sDAAsD;IACtD,+CAA+C;IAC/C,IAAI,IAAI,KAAK,SAAS;QAAE,IAAI,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,0DAA0D;IACzH,OAAO,IAAA,cAAI,EAAC,IAAI,EAAE,IAAA,kBAAO,EAAC,IAAI,CAAC,EAAE,IAAA,kBAAO,EAAC,GAAG,CAAC,CAAC,CAAC;AACjD,CAAC;AAPD,0BAOC;AAED,mCAAmC;AACnC,MAAM,YAAY,GAAG,eAAe,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACzD,M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AAC,SAAS,GAAG,OAAO,CAAC,CAAC;QACrC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;KAC1B;IACD,IAAI,CAAC,OAAO,EAAE,CAAC;IACf,OAAO,CAAC,OAAO,EAAE,CAAC;IAClB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACV,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACrB,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AAC9B,CAAC;AA5BD,wBA4BC;AAED;;;;;;;GAOG;AACI,MAAM,IAAI,GAAG,CAClB,IAAW,EACX,GAAU,EACV,IAAuB,EACvB,IAAuB,EACvB,MAAc,EACd,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAN7C,QAAA,IAAI,QAMyC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/hmac.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/hmac.d.ts deleted file mode 100644 index 63db656c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/hmac.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Hash, CHash, Input } from './utils.js'; -export declare class HMAC> extends Hash> { - oHash: T; - iHash: T; - blockLen: number; - outputLen: number; - private finished; - private destroyed; - constructor(hash: CHash, _key: Input); - update(buf: Input): this; - digestInto(out: Uint8Array): void; - digest(): Uint8Array; - _cloneInto(to?: HMAC): HMAC; - destroy(): void; -} -/** - * HMAC: RFC2104 message authentication code. - * @param hash - function that would be used e.g. sha256 - * @param key - message key - * @param message - message data - */ -export declare const hmac: { - (hash: CHash, key: Input, message: Input): Uint8Array; - create(hash: CHash, key: Input): HMAC; -}; diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/hmac.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/hmac.js deleted file mode 100644 index 0fc2d02e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/hmac.js +++ /dev/null @@ -1,82 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.hmac = exports.HMAC = void 0; -const _assert_js_1 = require("./_assert.js"); -const utils_js_1 = require("./utils.js"); -// HMAC (RFC 2104) -class HMAC extends utils_js_1.Hash { - constructor(hash, _key) { - super(); - this.finished = false; - this.destroyed = false; - (0, _assert_js_1.hash)(hash); - const key = (0, utils_js_1.toBytes)(_key); - this.iHash = hash.create(); - if (typeof this.iHash.update !== 'function') - throw new Error('Expected instance of class which extends utils.Hash'); - this.blockLen = this.iHash.blockLen; - this.outputLen = this.iHash.outputLen; - const blockLen = this.blockLen; - const pad = new Uint8Array(blockLen); - // blockLen can be bigger than outputLen - pad.set(key.length > blockLen ? hash.create().update(key).digest() : key); - for (let i = 0; i < pad.length; i++) - pad[i] ^= 0x36; - this.iHash.update(pad); - // By doing update (processing of first block) of outer hash here we can re-use it between multiple calls via clone - this.oHash = hash.create(); - // Undo internal XOR && apply outer XOR - for (let i = 0; i < pad.length; i++) - pad[i] ^= 0x36 ^ 0x5c; - this.oHash.update(pad); - pad.fill(0); - } - update(buf) { - (0, _assert_js_1.exists)(this); - this.iHash.update(buf); - return this; - } - digestInto(out) { - (0, _assert_js_1.exists)(this); - (0, _assert_js_1.bytes)(out, this.outputLen); - this.finished = true; - this.iHash.digestInto(out); - this.oHash.update(out); - this.oHash.digestInto(out); - this.destroy(); - } - digest() { - const out = new Uint8Array(this.oHash.outputLen); - this.digestInto(out); - return out; - } - _cloneInto(to) { - // Create new instance without calling constructor since key already in state and we don't know it. - to || (to = Object.create(Object.getPrototypeOf(this), {})); - const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this; - to = to; - to.finished = finished; - to.destroyed = destroyed; - to.blockLen = blockLen; - to.outputLen = outputLen; - to.oHash = oHash._cloneInto(to.oHash); - to.iHash = iHash._cloneInto(to.iHash); - return to; - } - destroy() { - this.destroyed = true; - this.oHash.destroy(); - this.iHash.destroy(); - } -} -exports.HMAC = HMAC; -/** - * HMAC: RFC2104 message authentication code. - * @param hash - function that would be used e.g. sha256 - * @param key - message key - * @param message - message data - */ -const hmac = (hash, key, message) => new HMAC(hash, key).update(message).digest(); -exports.hmac = hmac; -exports.hmac.create = (hash, key) => new HMAC(hash, key); -//# sourceMappingURL=hmac.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/hmac.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/hmac.js.map deleted file mode 100644 index 798c5fa1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/hmac.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hmac.js","sourceRoot":"","sources":["src/hmac.ts"],"names":[],"mappings":";;;AAAA,6CAAgG;AAChG,yCAAyD;AACzD,kBAAkB;AAClB,MAAa,IAAwB,SAAQ,eAAa;IAQxD,YAAY,IAAW,EAAE,IAAW;QAClC,KAAK,EAAE,CAAC;QAJF,aAAQ,GAAG,KAAK,CAAC;QACjB,cAAS,GAAG,KAAK,CAAC;QAIxB,IAAA,iBAAU,EAAC,IAAI,CAAC,CAAC;QACjB,MAAM,GAAG,GAAG,IAAA,kBAAO,EAAC,IAAI,CAAC,CAAC;QAC1B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,EAAO,CAAC;QAChC,IAAI,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,UAAU;YACzC,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;QACzE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;QACpC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;QACtC,MAAM,QAAQ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KG;AACI,MAAM,IAAI,GAAG,CAAC,IAAW,EAAE,GAAU,EAAE,OAAc,EAAc,EAAE,CAC1E,IAAI,IAAI,CAAM,IAAI,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC;AADvC,QAAA,IAAI,QACmC;AACpD,YAAI,CAAC,MAAM,GAAG,CAAC,IAAW,EAAE,GAAU,EAAE,EAAE,CAAC,IAAI,IAAI,CAAM,IAAI,EAAE,GAAG,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/index.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/index.d.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/index.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/index.js deleted file mode 100644 index 2299d7f9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/index.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -throw new Error('noble-hashes have no entry-point: consult README for usage'); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/index.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/index.js.map deleted file mode 100644 index b71bae62..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";AAAA,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/package.json b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/package.json deleted file mode 100644 index 9a668d3d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/package.json +++ /dev/null @@ -1,174 +0,0 @@ -{ - "name": "@noble/hashes", - "version": "1.3.2", - "description": "Audited & minimal 0-dependency JS implementation of SHA2, SHA3, RIPEMD, BLAKE2/3, HMAC, HKDF, PBKDF2, Scrypt", - "files": [ - "/*.js", - "/*.d.ts", - "/*.js.map", - "esm", - "src/*.ts" - ], - "scripts": { - "bench": "node benchmark/index.js noble", - "bench:all": "node benchmark/index.js", - "bench:install": "cd benchmark && npm install && cd ../../", - "build": "npm run build:clean; tsc && tsc -p tsconfig.esm.json", - "build:release": "cd build; npm i; npm run build", - "build:clean": "rm *.{js,d.ts,js.map} esm/*.{js,js.map} 2> /dev/null", - "lint": "prettier --check 'src/**/*.{js,ts}' 'test/**/*.{js,ts}'", - "format": "prettier --write 'src/**/*.{js,ts}' 'test/**/*.{js,ts}'", - "test": "node test/index.js", - "test:dos": "node test/slow-dos.test.js", - "test:big": "node test/slow-big.test.js" - }, - "author": "Paul Miller (https://paulmillr.com)", - "homepage": "https://paulmillr.com/noble/", - "repository": { - "type": "git", - "url": "https://github.com/paulmillr/noble-hashes.git" - }, - "license": "MIT", - "sideEffects": false, - "browser": { - "node:crypto": false, - "./crypto": "./crypto.js" - }, - "devDependencies": { - "micro-bmark": "0.3.1", - "micro-should": "0.4.0", - "prettier": "2.8.4", - "typescript": "5.0.2" - }, - "engines": { - "node": ">= 16" - }, - "exports": { - ".": { - "types": "./index.d.ts", - "import": "./esm/index.js", - "default": "./index.js" - }, - "./crypto": { - "types": "./crypto.d.ts", - "node": { - "import": "./esm/cryptoNode.js", - "default": "./cryptoNode.js" - }, - "import": "./esm/crypto.js", - "default": "./crypto.js" - }, - "./_assert": { - "types": "./_assert.d.ts", - "import": "./esm/_assert.js", - "default": "./_assert.js" - }, - "./_sha2": { - "types": "./_sha2.d.ts", - "import": "./esm/_sha2.js", - "default": "./_sha2.js" - }, - "./argon2": { - "types": "./argon2.d.ts", - "import": "./esm/argon2.js", - "default": "./argon2.js" - }, - "./blake2b": { - "types": "./blake2b.d.ts", - "import": "./esm/blake2b.js", - "default": "./blake2b.js" - }, - "./blake2s": { - "types": "./blake2s.d.ts", - "import": "./esm/blake2s.js", - "default": "./blake2s.js" - }, - "./blake3": { - "types": "./blake3.d.ts", - "import": "./esm/blake3.js", - "default": "./blake3.js" - }, - "./eskdf": { - "types": "./eskdf.d.ts", - "import": "./esm/eskdf.js", - "default": "./eskdf.js" - }, - "./hkdf": { - "types": "./hkdf.d.ts", - "import": "./esm/hkdf.js", - "default": "./hkdf.js" - }, - "./hmac": { - "types": "./hmac.d.ts", - "import": "./esm/hmac.js", - "default": "./hmac.js" - }, - "./pbkdf2": { - "types": "./pbkdf2.d.ts", - "import": "./esm/pbkdf2.js", - "default": "./pbkdf2.js" - }, - "./ripemd160": { - "types": "./ripemd160.d.ts", - "import": "./esm/ripemd160.js", - "default": "./ripemd160.js" - }, - "./scrypt": { - "types": "./scrypt.d.ts", - "import": "./esm/scrypt.js", - "default": "./scrypt.js" - }, - "./sha1": { - "types": "./sha1.d.ts", - "import": "./esm/sha1.js", - "default": "./sha1.js" - }, - "./sha3-addons": { - "types": "./sha3-addons.d.ts", - "import": "./esm/sha3-addons.js", - "default": "./sha3-addons.js" - }, - "./sha3": { - "types": "./sha3.d.ts", - "import": "./esm/sha3.js", - "default": "./sha3.js" - }, - "./sha256": { - "types": "./sha256.d.ts", - "import": "./esm/sha256.js", - "default": "./sha256.js" - }, - "./sha512": { - "types": "./sha512.d.ts", - "import": "./esm/sha512.js", - "default": "./sha512.js" - }, - "./utils": { - "types": "./utils.d.ts", - "import": "./esm/utils.js", - "default": "./utils.js" - } - }, - "keywords": [ - "sha", - "sha2", - "sha3", - "sha256", - "sha512", - "keccak", - "kangarootwelve", - "ripemd160", - "blake2", - "blake3", - "hmac", - "hkdf", - "pbkdf2", - "scrypt", - "kdf", - "hash", - "cryptography", - "security", - "noble" - ], - "funding": "https://paulmillr.com/funding/" -} diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/pbkdf2.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/pbkdf2.d.ts deleted file mode 100644 index 42f691ce..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/pbkdf2.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { CHash, Input } from './utils.js'; -export type Pbkdf2Opt = { - c: number; - dkLen?: number; - asyncTick?: number; -}; -/** - * PBKDF2-HMAC: RFC 2898 key derivation function - * @param hash - hash function that would be used e.g. sha256 - * @param password - password from which a derived key is generated - * @param salt - cryptographic salt - * @param opts - {c, dkLen} where c is work factor and dkLen is output message size - */ -export declare function pbkdf2(hash: CHash, password: Input, salt: Input, opts: Pbkdf2Opt): Uint8Array; -export declare function pbkdf2Async(hash: CHash, password: Input, salt: Input, opts: Pbkdf2Opt): Promise; diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/pbkdf2.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/pbkdf2.js deleted file mode 100644 index a6671788..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/pbkdf2.js +++ /dev/null @@ -1,91 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.pbkdf2Async = exports.pbkdf2 = void 0; -const _assert_js_1 = require("./_assert.js"); -const hmac_js_1 = require("./hmac.js"); -const utils_js_1 = require("./utils.js"); -// Common prologue and epilogue for sync/async functions -function pbkdf2Init(hash, _password, _salt, _opts) { - (0, _assert_js_1.hash)(hash); - const opts = (0, utils_js_1.checkOpts)({ dkLen: 32, asyncTick: 10 }, _opts); - const { c, dkLen, asyncTick } = opts; - (0, _assert_js_1.number)(c); - (0, _assert_js_1.number)(dkLen); - (0, _assert_js_1.number)(asyncTick); - if (c < 1) - throw new Error('PBKDF2: iterations (c) should be >= 1'); - const password = (0, utils_js_1.toBytes)(_password); - const salt = (0, utils_js_1.toBytes)(_salt); - // DK = PBKDF2(PRF, Password, Salt, c, dkLen); - const DK = new Uint8Array(dkLen); - // U1 = PRF(Password, Salt + INT_32_BE(i)) - const PRF = hmac_js_1.hmac.create(hash, password); - const PRFSalt = PRF._cloneInto().update(salt); - return { c, dkLen, asyncTick, DK, PRF, PRFSalt }; -} -function pbkdf2Output(PRF, PRFSalt, DK, prfW, u) { - PRF.destroy(); - PRFSalt.destroy(); - if (prfW) - prfW.destroy(); - u.fill(0); - return DK; -} -/** - * PBKDF2-HMAC: RFC 2898 key derivation function - * @param hash - hash function that would be used e.g. sha256 - * @param password - password from which a derived key is generated - * @param salt - cryptographic salt - * @param opts - {c, dkLen} where c is work factor and dkLen is output message size - */ -function pbkdf2(hash, password, salt, opts) { - const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts); - let prfW; // Working copy - const arr = new Uint8Array(4); - const view = (0, utils_js_1.createView)(arr); - const u = new Uint8Array(PRF.outputLen); - // DK = T1 + T2 + ⋯ + Tdklen/hlen - for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { - // Ti = F(Password, Salt, c, i) - const Ti = DK.subarray(pos, pos + PRF.outputLen); - view.setInt32(0, ti, false); - // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc - // U1 = PRF(Password, Salt + INT_32_BE(i)) - (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); - Ti.set(u.subarray(0, Ti.length)); - for (let ui = 1; ui < c; ui++) { - // Uc = PRF(Password, Uc−1) - PRF._cloneInto(prfW).update(u).digestInto(u); - for (let i = 0; i < Ti.length; i++) - Ti[i] ^= u[i]; - } - } - return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); -} -exports.pbkdf2 = pbkdf2; -async function pbkdf2Async(hash, password, salt, opts) { - const { c, dkLen, asyncTick, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts); - let prfW; // Working copy - const arr = new Uint8Array(4); - const view = (0, utils_js_1.createView)(arr); - const u = new Uint8Array(PRF.outputLen); - // DK = T1 + T2 + ⋯ + Tdklen/hlen - for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { - // Ti = F(Password, Salt, c, i) - const Ti = DK.subarray(pos, pos + PRF.outputLen); - view.setInt32(0, ti, false); - // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc - // U1 = PRF(Password, Salt + INT_32_BE(i)) - (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); - Ti.set(u.subarray(0, Ti.length)); - await (0, utils_js_1.asyncLoop)(c - 1, asyncTick, () => { - // Uc = PRF(Password, Uc−1) - PRF._cloneInto(prfW).update(u).digestInto(u); - for (let i = 0; i < Ti.length; i++) - Ti[i] ^= u[i]; - }); - } - return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); -} -exports.pbkdf2Async = pbkdf2Async; -//# sourceMappingURL=pbkdf2.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/pbkdf2.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/pbkdf2.js.map deleted file mode 100644 index a8f30b0f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/pbkdf2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pbkdf2.js","sourceRoot":"","sources":["src/pbkdf2.ts"],"names":[],"mappings":";;;AAAA,6CAA0E;AAC1E,uCAAiC;AACjC,yCAA2F;AAQ3F,wDAAwD;AACxD,SAAS,UAAU,CAAC,IAAW,EAAE,SAAgB,EAAE,KAAY,EAAE,KAAgB;IAC/E,IAAA,iBAAU,EAAC,IAAI,CAAC,CAAC;IACjB,MAAM,IAAI,GAAG,IAAA,oBAAS,EAAC,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;IAC5D,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;IACrC,IAAA,mBA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EAAE,SAAS,EAAE,GAAG,EAAE;YACrC,2BAA2B;YAC3B,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YAC7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE;gBAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;KACJ;IACD,OAAO,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACjD,CAAC;AAtBD,kCAsBC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/ripemd160.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/ripemd160.d.ts deleted file mode 100644 index 92e662f9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/ripemd160.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { SHA2 } from './_sha2.js'; -export declare class RIPEMD160 extends SHA2 { - private h0; - private h1; - private h2; - private h3; - private h4; - constructor(); - protected get(): [number, number, number, number, number]; - protected set(h0: number, h1: number, h2: number, h3: number, h4: number): void; - protected process(view: DataView, offset: number): void; - protected roundClean(): void; - destroy(): void; -} -/** - * RIPEMD-160 - a hash function from 1990s. - * @param message - msg that would be hashed - */ -export declare const ripemd160: { - (msg: import("./utils.js").Input): Uint8Array; - outputLen: number; - blockLen: number; - create(): import("./utils.js").Hash; -}; diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/ripemd160.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/ripemd160.js deleted file mode 100644 index 7d6e057b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/ripemd160.js +++ /dev/null @@ -1,108 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ripemd160 = exports.RIPEMD160 = void 0; -const _sha2_js_1 = require("./_sha2.js"); -const utils_js_1 = require("./utils.js"); -// https://homes.esat.kuleuven.be/~bosselae/ripemd160.html -// https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf -const Rho = /* @__PURE__ */ new Uint8Array([7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8]); -const Id = /* @__PURE__ */ Uint8Array.from({ length: 16 }, (_, i) => i); -const Pi = /* @__PURE__ */ Id.map((i) => (9 * i + 5) % 16); -let idxL = [Id]; -let idxR = [Pi]; -for (let i = 0; i < 4; i++) - for (let j of [idxL, idxR]) - j.push(j[i].map((k) => Rho[k])); -const shifts = /* @__PURE__ */ [ - [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8], - [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7], - [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9], - [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6], - [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5], -].map((i) => new Uint8Array(i)); -const shiftsL = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts[i][j])); -const shiftsR = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts[i][j])); -const Kl = /* @__PURE__ */ new Uint32Array([ - 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e, -]); -const Kr = /* @__PURE__ */ new Uint32Array([ - 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000, -]); -// The rotate left (circular left shift) operation for uint32 -const rotl = (word, shift) => (word << shift) | (word >>> (32 - shift)); -// It's called f() in spec. -function f(group, x, y, z) { - if (group === 0) - return x ^ y ^ z; - else if (group === 1) - return (x & y) | (~x & z); - else if (group === 2) - return (x | ~y) ^ z; - else if (group === 3) - return (x & z) | (y & ~z); - else - return x ^ (y | ~z); -} -// Temporary buffer, not used to store anything between runs -const BUF = /* @__PURE__ */ new Uint32Array(16); -class RIPEMD160 extends _sha2_js_1.SHA2 { - constructor() { - super(64, 20, 8, true); - this.h0 = 0x67452301 | 0; - this.h1 = 0xefcdab89 | 0; - this.h2 = 0x98badcfe | 0; - this.h3 = 0x10325476 | 0; - this.h4 = 0xc3d2e1f0 | 0; - } - get() { - const { h0, h1, h2, h3, h4 } = this; - return [h0, h1, h2, h3, h4]; - } - set(h0, h1, h2, h3, h4) { - this.h0 = h0 | 0; - this.h1 = h1 | 0; - this.h2 = h2 | 0; - this.h3 = h3 | 0; - this.h4 = h4 | 0; - } - process(view, offset) { - for (let i = 0; i < 16; i++, offset += 4) - BUF[i] = view.getUint32(offset, true); - // prettier-ignore - let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el; - // Instead of iterating 0 to 80, we split it into 5 groups - // And use the groups in constants, functions, etc. Much simpler - for (let group = 0; group < 5; group++) { - const rGroup = 4 - group; - const hbl = Kl[group], hbr = Kr[group]; // prettier-ignore - const rl = idxL[group], rr = idxR[group]; // prettier-ignore - const sl = shiftsL[group], sr = shiftsR[group]; // prettier-ignore - for (let i = 0; i < 16; i++) { - const tl = (rotl(al + f(group, bl, cl, dl) + BUF[rl[i]] + hbl, sl[i]) + el) | 0; - al = el, el = dl, dl = rotl(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore - } - // 2 loops are 10% faster - for (let i = 0; i < 16; i++) { - const tr = (rotl(ar + f(rGroup, br, cr, dr) + BUF[rr[i]] + hbr, sr[i]) + er) | 0; - ar = er, er = dr, dr = rotl(cr, 10) | 0, cr = br, br = tr; // prettier-ignore - } - } - // Add the compressed chunk to the current hash value - this.set((this.h1 + cl + dr) | 0, (this.h2 + dl + er) | 0, (this.h3 + el + ar) | 0, (this.h4 + al + br) | 0, (this.h0 + bl + cr) | 0); - } - roundClean() { - BUF.fill(0); - } - destroy() { - this.destroyed = true; - this.buffer.fill(0); - this.set(0, 0, 0, 0, 0); - } -} -exports.RIPEMD160 = RIPEMD160; -/** - * RIPEMD-160 - a hash function from 1990s. - * @param message - msg that would be hashed - */ -exports.ripemd160 = (0, utils_js_1.wrapConstructor)(() => new RIPEMD160()); -//# sourceMappingURL=ripemd160.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/ripemd160.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/ripemd160.js.map deleted file mode 100644 index 396a5170..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/ripemd160.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ripemd160.js","sourceRoot":"","sources":["src/ripemd160.ts"],"names":[],"mappings":";;;AAAA,yCAAkC;AAClC,yCAA6C;AAE7C,0DAA0D;AAC1D,6EAA6E;AAC7E,MAAM,GAAG,GAAG,eAAe,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;AACnG,MAAM,EAAE,GAAG,eAAe,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;AACxE,MAAM,EAAE,GAAG,eAAe,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAA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AAE,GAAG,EAAE,CAAC,CAAC,kBAAkB;aAC9E;SACF;QACD,qDAAqD;QACrD,IAAI,CAAC,GAAG,CACN,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EACvB,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EACvB,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EACvB,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EACvB,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CACxB,CAAC;IACJ,CAAC;IACS,UAAU;QAClB,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACd,CAAC;IACD,OAAO;QACL,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1B,CAAC;CACF;AAhED,8BAgEC;AAED;;;GAGG;AACU,QAAA,SAAS,GAAmB,IAAA,0BAAe,EAAC,GAAG,EAAE,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/scrypt.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/scrypt.d.ts deleted file mode 100644 index 82485b3d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/scrypt.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Input } from './utils.js'; -export type ScryptOpts = { - N: number; - r: number; - p: number; - dkLen?: number; - asyncTick?: number; - maxmem?: number; - onProgress?: (progress: number) => void; -}; -/** - * Scrypt KDF from RFC 7914. - * @param password - pass - * @param salt - salt - * @param opts - parameters - * - `N` is cpu/mem work factor (power of 2 e.g. 2**18) - * - `r` is block size (8 is common), fine-tunes sequential memory read size and performance - * - `p` is parallelization factor (1 is common) - * - `dkLen` is output key length in bytes e.g. 32. - * - `asyncTick` - (default: 10) max time in ms for which async function can block execution - * - `maxmem` - (default: `1024 ** 3 + 1024` aka 1GB+1KB). A limit that the app could use for scrypt - * - `onProgress` - callback function that would be executed for progress report - * @returns Derived key - */ -export declare function scrypt(password: Input, salt: Input, opts: ScryptOpts): Uint8Array; -/** - * Scrypt KDF from RFC 7914. - */ -export declare function scryptAsync(password: Input, salt: Input, opts: ScryptOpts): Promise; diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/scrypt.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/scrypt.js deleted file mode 100644 index 2f118db2..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/scrypt.js +++ /dev/null @@ -1,223 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.scryptAsync = exports.scrypt = void 0; -const _assert_js_1 = require("./_assert.js"); -const sha256_js_1 = require("./sha256.js"); -const pbkdf2_js_1 = require("./pbkdf2.js"); -const utils_js_1 = require("./utils.js"); -// RFC 7914 Scrypt KDF -// Left rotate for uint32 -const rotl = (a, b) => (a << b) | (a >>> (32 - b)); -// The main Scrypt loop: uses Salsa extensively. -// Six versions of the function were tried, this is the fastest one. -// prettier-ignore -function XorAndSalsa(prev, pi, input, ii, out, oi) { - // Based on https://cr.yp.to/salsa20.html - // Xor blocks - let y00 = prev[pi++] ^ input[ii++], y01 = prev[pi++] ^ input[ii++]; - let y02 = prev[pi++] ^ input[ii++], y03 = prev[pi++] ^ input[ii++]; - let y04 = prev[pi++] ^ input[ii++], y05 = prev[pi++] ^ input[ii++]; - let y06 = prev[pi++] ^ input[ii++], y07 = prev[pi++] ^ input[ii++]; - let y08 = prev[pi++] ^ input[ii++], y09 = prev[pi++] ^ input[ii++]; - let y10 = prev[pi++] ^ input[ii++], y11 = prev[pi++] ^ input[ii++]; - let y12 = prev[pi++] ^ input[ii++], y13 = prev[pi++] ^ input[ii++]; - let y14 = prev[pi++] ^ input[ii++], y15 = prev[pi++] ^ input[ii++]; - // Save state to temporary variables (salsa) - let x00 = y00, x01 = y01, x02 = y02, x03 = y03, x04 = y04, x05 = y05, x06 = y06, x07 = y07, x08 = y08, x09 = y09, x10 = y10, x11 = y11, x12 = y12, x13 = y13, x14 = y14, x15 = y15; - // Main loop (salsa) - for (let i = 0; i < 8; i += 2) { - x04 ^= rotl(x00 + x12 | 0, 7); - x08 ^= rotl(x04 + x00 | 0, 9); - x12 ^= rotl(x08 + x04 | 0, 13); - x00 ^= rotl(x12 + x08 | 0, 18); - x09 ^= rotl(x05 + x01 | 0, 7); - x13 ^= rotl(x09 + x05 | 0, 9); - x01 ^= rotl(x13 + x09 | 0, 13); - x05 ^= rotl(x01 + x13 | 0, 18); - x14 ^= rotl(x10 + x06 | 0, 7); - x02 ^= rotl(x14 + x10 | 0, 9); - x06 ^= rotl(x02 + x14 | 0, 13); - x10 ^= rotl(x06 + x02 | 0, 18); - x03 ^= rotl(x15 + x11 | 0, 7); - x07 ^= rotl(x03 + x15 | 0, 9); - x11 ^= rotl(x07 + x03 | 0, 13); - x15 ^= rotl(x11 + x07 | 0, 18); - x01 ^= rotl(x00 + x03 | 0, 7); - x02 ^= rotl(x01 + x00 | 0, 9); - x03 ^= rotl(x02 + x01 | 0, 13); - x00 ^= rotl(x03 + x02 | 0, 18); - x06 ^= rotl(x05 + x04 | 0, 7); - x07 ^= rotl(x06 + x05 | 0, 9); - x04 ^= rotl(x07 + x06 | 0, 13); - x05 ^= rotl(x04 + x07 | 0, 18); - x11 ^= rotl(x10 + x09 | 0, 7); - x08 ^= rotl(x11 + x10 | 0, 9); - x09 ^= rotl(x08 + x11 | 0, 13); - x10 ^= rotl(x09 + x08 | 0, 18); - x12 ^= rotl(x15 + x14 | 0, 7); - x13 ^= rotl(x12 + x15 | 0, 9); - x14 ^= rotl(x13 + x12 | 0, 13); - x15 ^= rotl(x14 + x13 | 0, 18); - } - // Write output (salsa) - out[oi++] = (y00 + x00) | 0; - out[oi++] = (y01 + x01) | 0; - out[oi++] = (y02 + x02) | 0; - out[oi++] = (y03 + x03) | 0; - out[oi++] = (y04 + x04) | 0; - out[oi++] = (y05 + x05) | 0; - out[oi++] = (y06 + x06) | 0; - out[oi++] = (y07 + x07) | 0; - out[oi++] = (y08 + x08) | 0; - out[oi++] = (y09 + x09) | 0; - out[oi++] = (y10 + x10) | 0; - out[oi++] = (y11 + x11) | 0; - out[oi++] = (y12 + x12) | 0; - out[oi++] = (y13 + x13) | 0; - out[oi++] = (y14 + x14) | 0; - out[oi++] = (y15 + x15) | 0; -} -function BlockMix(input, ii, out, oi, r) { - // The block B is r 128-byte chunks (which is equivalent of 2r 64-byte chunks) - let head = oi + 0; - let tail = oi + 16 * r; - for (let i = 0; i < 16; i++) - out[tail + i] = input[ii + (2 * r - 1) * 16 + i]; // X ← B[2r−1] - for (let i = 0; i < r; i++, head += 16, ii += 16) { - // We write odd & even Yi at same time. Even: 0bXXXXX0 Odd: 0bXXXXX1 - XorAndSalsa(out, tail, input, ii, out, head); // head[i] = Salsa(blockIn[2*i] ^ tail[i-1]) - if (i > 0) - tail += 16; // First iteration overwrites tmp value in tail - XorAndSalsa(out, head, input, (ii += 16), out, tail); // tail[i] = Salsa(blockIn[2*i+1] ^ head[i]) - } -} -// Common prologue and epilogue for sync/async functions -function scryptInit(password, salt, _opts) { - // Maxmem - 1GB+1KB by default - const opts = (0, utils_js_1.checkOpts)({ - dkLen: 32, - asyncTick: 10, - maxmem: 1024 ** 3 + 1024, - }, _opts); - const { N, r, p, dkLen, asyncTick, maxmem, onProgress } = opts; - (0, _assert_js_1.number)(N); - (0, _assert_js_1.number)(r); - (0, _assert_js_1.number)(p); - (0, _assert_js_1.number)(dkLen); - (0, _assert_js_1.number)(asyncTick); - (0, _assert_js_1.number)(maxmem); - if (onProgress !== undefined && typeof onProgress !== 'function') - throw new Error('progressCb should be function'); - const blockSize = 128 * r; - const blockSize32 = blockSize / 4; - if (N <= 1 || (N & (N - 1)) !== 0 || N >= 2 ** (blockSize / 8) || N > 2 ** 32) { - // NOTE: we limit N to be less than 2**32 because of 32 bit variant of Integrify function - // There is no JS engines that allows alocate more than 4GB per single Uint8Array for now, but can change in future. - throw new Error('Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32'); - } - if (p < 0 || p > ((2 ** 32 - 1) * 32) / blockSize) { - throw new Error('Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)'); - } - if (dkLen < 0 || dkLen > (2 ** 32 - 1) * 32) { - throw new Error('Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32'); - } - const memUsed = blockSize * (N + p); - if (memUsed > maxmem) { - throw new Error(`Scrypt: parameters too large, ${memUsed} (128 * r * (N + p)) > ${maxmem} (maxmem)`); - } - // [B0...Bp−1] ← PBKDF2HMAC-SHA256(Passphrase, Salt, 1, blockSize*ParallelizationFactor) - // Since it has only one iteration there is no reason to use async variant - const B = (0, pbkdf2_js_1.pbkdf2)(sha256_js_1.sha256, password, salt, { c: 1, dkLen: blockSize * p }); - const B32 = (0, utils_js_1.u32)(B); - // Re-used between parallel iterations. Array(iterations) of B - const V = (0, utils_js_1.u32)(new Uint8Array(blockSize * N)); - const tmp = (0, utils_js_1.u32)(new Uint8Array(blockSize)); - let blockMixCb = () => { }; - if (onProgress) { - const totalBlockMix = 2 * N * p; - // Invoke callback if progress changes from 10.01 to 10.02 - // Allows to draw smooth progress bar on up to 8K screen - const callbackPer = Math.max(Math.floor(totalBlockMix / 10000), 1); - let blockMixCnt = 0; - blockMixCb = () => { - blockMixCnt++; - if (onProgress && (!(blockMixCnt % callbackPer) || blockMixCnt === totalBlockMix)) - onProgress(blockMixCnt / totalBlockMix); - }; - } - return { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick }; -} -function scryptOutput(password, dkLen, B, V, tmp) { - const res = (0, pbkdf2_js_1.pbkdf2)(sha256_js_1.sha256, password, B, { c: 1, dkLen }); - B.fill(0); - V.fill(0); - tmp.fill(0); - return res; -} -/** - * Scrypt KDF from RFC 7914. - * @param password - pass - * @param salt - salt - * @param opts - parameters - * - `N` is cpu/mem work factor (power of 2 e.g. 2**18) - * - `r` is block size (8 is common), fine-tunes sequential memory read size and performance - * - `p` is parallelization factor (1 is common) - * - `dkLen` is output key length in bytes e.g. 32. - * - `asyncTick` - (default: 10) max time in ms for which async function can block execution - * - `maxmem` - (default: `1024 ** 3 + 1024` aka 1GB+1KB). A limit that the app could use for scrypt - * - `onProgress` - callback function that would be executed for progress report - * @returns Derived key - */ -function scrypt(password, salt, opts) { - const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb } = scryptInit(password, salt, opts); - for (let pi = 0; pi < p; pi++) { - const Pi = blockSize32 * pi; - for (let i = 0; i < blockSize32; i++) - V[i] = B32[Pi + i]; // V[0] = B[i] - for (let i = 0, pos = 0; i < N - 1; i++) { - BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]); - blockMixCb(); - } - BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element - blockMixCb(); - for (let i = 0; i < N; i++) { - // First u32 of the last 64-byte block (u32 is LE) - const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations - for (let k = 0; k < blockSize32; k++) - tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j] - BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) - blockMixCb(); - } - } - return scryptOutput(password, dkLen, B, V, tmp); -} -exports.scrypt = scrypt; -/** - * Scrypt KDF from RFC 7914. - */ -async function scryptAsync(password, salt, opts) { - const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick } = scryptInit(password, salt, opts); - for (let pi = 0; pi < p; pi++) { - const Pi = blockSize32 * pi; - for (let i = 0; i < blockSize32; i++) - V[i] = B32[Pi + i]; // V[0] = B[i] - let pos = 0; - await (0, utils_js_1.asyncLoop)(N - 1, asyncTick, () => { - BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]); - blockMixCb(); - }); - BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element - blockMixCb(); - await (0, utils_js_1.asyncLoop)(N, asyncTick, () => { - // First u32 of the last 64-byte block (u32 is LE) - const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations - for (let k = 0; k < blockSize32; k++) - tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j] - BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) - blockMixCb(); - }); - } - return scryptOutput(password, dkLen, B, V, tmp); -} -exports.scryptAsync = scryptAsync; -//# sourceMappingURL=scrypt.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/scrypt.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/scrypt.js.map deleted file mode 100644 index 873dc15e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/scrypt.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"scrypt.js","sourceRoot":"","sources":["src/scrypt.ts"],"names":[],"mappings":";;;AAAA,6CAAsD;AACtD,2CAAqC;AACrC,2CAAqC;AACrC,yCAA8D;AAE9D,sBAAsB;AAEtB,yBAAyB;AACzB,MAAM,IAAI,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;AAEnE,gDAAgD;AAChD,oEAAoE;AACpE,kBAAkB;AA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iB;YACtG,QAAQ,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,yBAAyB;YACvD,UAAU,EAAE,CAAC;QACf,CAAC,CAAC,CAAC;KACJ;IACD,OAAO,YAAY,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;AAClD,CAAC;AAzBD,kCAyBC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha1.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha1.d.ts deleted file mode 100644 index d9cb132e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha1.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { SHA2 } from './_sha2.js'; -declare class SHA1 extends SHA2 { - private A; - private B; - private C; - private D; - private E; - constructor(); - protected get(): [number, number, number, number, number]; - protected set(A: number, B: number, C: number, D: number, E: number): void; - protected process(view: DataView, offset: number): void; - protected roundClean(): void; - destroy(): void; -} -export declare const sha1: { - (msg: import("./utils.js").Input): Uint8Array; - outputLen: number; - blockLen: number; - create(): import("./utils.js").Hash; -}; -export {}; diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha1.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha1.js deleted file mode 100644 index 10c69531..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha1.js +++ /dev/null @@ -1,90 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.sha1 = void 0; -const _sha2_js_1 = require("./_sha2.js"); -const utils_js_1 = require("./utils.js"); -// SHA1 was cryptographically broken. -// It is still widely used in legacy apps. Don't use it for a new protocol. -// RFC 3174 -const rotl = (word, shift) => (word << shift) | ((word >>> (32 - shift)) >>> 0); -// Choice: a ? b : c -const Chi = (a, b, c) => (a & b) ^ (~a & c); -// Majority function, true if any two inpust is true -const Maj = (a, b, c) => (a & b) ^ (a & c) ^ (b & c); -// Initial state -const IV = /* @__PURE__ */ new Uint32Array([ - 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0, -]); -// Temporary buffer, not used to store anything between runs -// Named this way because it matches specification. -const SHA1_W = /* @__PURE__ */ new Uint32Array(80); -class SHA1 extends _sha2_js_1.SHA2 { - constructor() { - super(64, 20, 8, false); - this.A = IV[0] | 0; - this.B = IV[1] | 0; - this.C = IV[2] | 0; - this.D = IV[3] | 0; - this.E = IV[4] | 0; - } - get() { - const { A, B, C, D, E } = this; - return [A, B, C, D, E]; - } - set(A, B, C, D, E) { - this.A = A | 0; - this.B = B | 0; - this.C = C | 0; - this.D = D | 0; - this.E = E | 0; - } - process(view, offset) { - for (let i = 0; i < 16; i++, offset += 4) - SHA1_W[i] = view.getUint32(offset, false); - for (let i = 16; i < 80; i++) - SHA1_W[i] = rotl(SHA1_W[i - 3] ^ SHA1_W[i - 8] ^ SHA1_W[i - 14] ^ SHA1_W[i - 16], 1); - // Compression function main loop, 80 rounds - let { A, B, C, D, E } = this; - for (let i = 0; i < 80; i++) { - let F, K; - if (i < 20) { - F = Chi(B, C, D); - K = 0x5a827999; - } - else if (i < 40) { - F = B ^ C ^ D; - K = 0x6ed9eba1; - } - else if (i < 60) { - F = Maj(B, C, D); - K = 0x8f1bbcdc; - } - else { - F = B ^ C ^ D; - K = 0xca62c1d6; - } - const T = (rotl(A, 5) + F + E + K + SHA1_W[i]) | 0; - E = D; - D = C; - C = rotl(B, 30); - B = A; - A = T; - } - // Add the compressed chunk to the current hash value - A = (A + this.A) | 0; - B = (B + this.B) | 0; - C = (C + this.C) | 0; - D = (D + this.D) | 0; - E = (E + this.E) | 0; - this.set(A, B, C, D, E); - } - roundClean() { - SHA1_W.fill(0); - } - destroy() { - this.set(0, 0, 0, 0, 0); - this.buffer.fill(0); - } -} -exports.sha1 = (0, utils_js_1.wrapConstructor)(() => new SHA1()); -//# sourceMappingURL=sha1.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha1.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha1.js.map deleted file mode 100644 index 4b0ccbdf..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha1.js","sourceRoot":"","sources":["src/sha1.ts"],"names":[],"mappings":";;;AAAA,yCAAkC;AAClC,yCAA6C;AAE7C,qCAAqC;AACrC,2EAA2E;AAE3E,WAAW;AACX,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,KAAa,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,EAAE,GAAG,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AAChG,oBAAoB;AACpB,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AACpE,oDAAoD;AACpD,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAE7E,gBAAgB;AAChB,MAAM,EAAE,GAAG,eAAe,CAAC,IAAI,WAAW,CAAC;IACzC,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;CAC3D,CAAC,CAAC;AAEH,4DAA4D;AAC5D,mDAAmD;AACnD,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,WAAW,CAAC,EAAE,CAAC,CAAC;AACnD,MAAM,IAAK,SAAQ,e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,GAAG,IAAI,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAChB,CAAC,GAAG,CAAC,CAAC;YACN,CAAC,GAAG,CAAC,CAAC;SACP;QACD,qDAAqD;QACrD,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACrB,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACrB,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACrB,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACrB,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1B,CAAC;IACS,UAAU;QAClB,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC;IACD,OAAO;QACL,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACxB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACtB,CAAC;CACF;AAEY,QAAA,IAAI,GAAmB,IAAA,0BAAe,EAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha256.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha256.d.ts deleted file mode 100644 index 3e1491d2..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha256.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { SHA2 } from './_sha2.js'; -declare class SHA256 extends SHA2 { - A: number; - B: number; - C: number; - D: number; - E: number; - F: number; - G: number; - H: number; - constructor(); - protected get(): [number, number, number, number, number, number, number, number]; - protected set(A: number, B: number, C: number, D: number, E: number, F: number, G: number, H: number): void; - protected process(view: DataView, offset: number): void; - protected roundClean(): void; - destroy(): void; -} -/** - * SHA2-256 hash function - * @param message - data that would be hashed - */ -export declare const sha256: { - (msg: import("./utils.js").Input): Uint8Array; - outputLen: number; - blockLen: number; - create(): import("./utils.js").Hash; -}; -export declare const sha224: { - (msg: import("./utils.js").Input): Uint8Array; - outputLen: number; - blockLen: number; - create(): import("./utils.js").Hash; -}; -export {}; diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha256.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha256.js deleted file mode 100644 index 24fe5743..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha256.js +++ /dev/null @@ -1,129 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.sha224 = exports.sha256 = void 0; -const _sha2_js_1 = require("./_sha2.js"); -const utils_js_1 = require("./utils.js"); -// SHA2-256 need to try 2^128 hashes to execute birthday attack. -// BTC network is doing 2^67 hashes/sec as per early 2023. -// Choice: a ? b : c -const Chi = (a, b, c) => (a & b) ^ (~a & c); -// Majority function, true if any two inpust is true -const Maj = (a, b, c) => (a & b) ^ (a & c) ^ (b & c); -// Round constants: -// first 32 bits of the fractional parts of the cube roots of the first 64 primes 2..311) -// prettier-ignore -const SHA256_K = /* @__PURE__ */ new Uint32Array([ - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 -]); -// Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19): -// prettier-ignore -const IV = /* @__PURE__ */ new Uint32Array([ - 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 -]); -// Temporary buffer, not used to store anything between runs -// Named this way because it matches specification. -const SHA256_W = /* @__PURE__ */ new Uint32Array(64); -class SHA256 extends _sha2_js_1.SHA2 { - constructor() { - super(64, 32, 8, false); - // We cannot use array here since array allows indexing by variable - // which means optimizer/compiler cannot use registers. - this.A = IV[0] | 0; - this.B = IV[1] | 0; - this.C = IV[2] | 0; - this.D = IV[3] | 0; - this.E = IV[4] | 0; - this.F = IV[5] | 0; - this.G = IV[6] | 0; - this.H = IV[7] | 0; - } - get() { - const { A, B, C, D, E, F, G, H } = this; - return [A, B, C, D, E, F, G, H]; - } - // prettier-ignore - set(A, B, C, D, E, F, G, H) { - this.A = A | 0; - this.B = B | 0; - this.C = C | 0; - this.D = D | 0; - this.E = E | 0; - this.F = F | 0; - this.G = G | 0; - this.H = H | 0; - } - process(view, offset) { - // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array - for (let i = 0; i < 16; i++, offset += 4) - SHA256_W[i] = view.getUint32(offset, false); - for (let i = 16; i < 64; i++) { - const W15 = SHA256_W[i - 15]; - const W2 = SHA256_W[i - 2]; - const s0 = (0, utils_js_1.rotr)(W15, 7) ^ (0, utils_js_1.rotr)(W15, 18) ^ (W15 >>> 3); - const s1 = (0, utils_js_1.rotr)(W2, 17) ^ (0, utils_js_1.rotr)(W2, 19) ^ (W2 >>> 10); - SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0; - } - // Compression function main loop, 64 rounds - let { A, B, C, D, E, F, G, H } = this; - for (let i = 0; i < 64; i++) { - const sigma1 = (0, utils_js_1.rotr)(E, 6) ^ (0, utils_js_1.rotr)(E, 11) ^ (0, utils_js_1.rotr)(E, 25); - const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; - const sigma0 = (0, utils_js_1.rotr)(A, 2) ^ (0, utils_js_1.rotr)(A, 13) ^ (0, utils_js_1.rotr)(A, 22); - const T2 = (sigma0 + Maj(A, B, C)) | 0; - H = G; - G = F; - F = E; - E = (D + T1) | 0; - D = C; - C = B; - B = A; - A = (T1 + T2) | 0; - } - // Add the compressed chunk to the current hash value - A = (A + this.A) | 0; - B = (B + this.B) | 0; - C = (C + this.C) | 0; - D = (D + this.D) | 0; - E = (E + this.E) | 0; - F = (F + this.F) | 0; - G = (G + this.G) | 0; - H = (H + this.H) | 0; - this.set(A, B, C, D, E, F, G, H); - } - roundClean() { - SHA256_W.fill(0); - } - destroy() { - this.set(0, 0, 0, 0, 0, 0, 0, 0); - this.buffer.fill(0); - } -} -// Constants from https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf -class SHA224 extends SHA256 { - constructor() { - super(); - this.A = 0xc1059ed8 | 0; - this.B = 0x367cd507 | 0; - this.C = 0x3070dd17 | 0; - this.D = 0xf70e5939 | 0; - this.E = 0xffc00b31 | 0; - this.F = 0x68581511 | 0; - this.G = 0x64f98fa7 | 0; - this.H = 0xbefa4fa4 | 0; - this.outputLen = 28; - } -} -/** - * SHA2-256 hash function - * @param message - data that would be hashed - */ -exports.sha256 = (0, utils_js_1.wrapConstructor)(() => new SHA256()); -exports.sha224 = (0, utils_js_1.wrapConstructor)(() => new SHA224()); -//# sourceMappingURL=sha256.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha256.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha256.js.map deleted file mode 100644 index a2fd853f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha256.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha256.js","sourceRoot":"","sources":["src/sha256.ts"],"names":[],"mappings":";;;AAAA,yCAAkC;AAClC,yCAAmD;AAEnD,gEAAgE;AAChE,0DAA0D;AAE1D,oBAAoB;AACpB,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AACpE,oDAAoD;AACpD,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAE7E,mBAAmB;AACnB,yFAAyF;AACzF,kBAAkB;AAClB,MAAM,QAAQ,GAAG,eAAe,CAAA,IAAI,WAAW,CAAC;IAC9C,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IAC9F,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAA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D,QAAA,MAAM,GAAmB,IAAA,0BAAe,EAAC,GAAG,EAAE,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha3-addons.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha3-addons.d.ts deleted file mode 100644 index cf7c3a0d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha3-addons.d.ts +++ /dev/null @@ -1,138 +0,0 @@ -import { Input, Hash, HashXOF } from './utils.js'; -import { Keccak, ShakeOpts } from './sha3.js'; -export type cShakeOpts = ShakeOpts & { - personalization?: Input; - NISTfn?: Input; -}; -export declare const cshake128: { - (msg: Input, opts?: cShakeOpts | undefined): Uint8Array; - outputLen: number; - blockLen: number; - create(opts: cShakeOpts): Hash; -}; -export declare const cshake256: { - (msg: Input, opts?: cShakeOpts | undefined): Uint8Array; - outputLen: number; - blockLen: number; - create(opts: cShakeOpts): Hash; -}; -declare class KMAC extends Keccak implements HashXOF { - constructor(blockLen: number, outputLen: number, enableXOF: boolean, key: Input, opts?: cShakeOpts); - protected finish(): void; - _cloneInto(to?: KMAC): KMAC; - clone(): KMAC; -} -export declare const kmac128: { - (key: Input, message: Input, opts?: cShakeOpts): Uint8Array; - create(key: Input, opts?: cShakeOpts): KMAC; -}; -export declare const kmac256: { - (key: Input, message: Input, opts?: cShakeOpts): Uint8Array; - create(key: Input, opts?: cShakeOpts): KMAC; -}; -export declare const kmac128xof: { - (key: Input, message: Input, opts?: cShakeOpts): Uint8Array; - create(key: Input, opts?: cShakeOpts): KMAC; -}; -export declare const kmac256xof: { - (key: Input, message: Input, opts?: cShakeOpts): Uint8Array; - create(key: Input, opts?: cShakeOpts): KMAC; -}; -declare class TupleHash extends Keccak implements HashXOF { - constructor(blockLen: number, outputLen: number, enableXOF: boolean, opts?: cShakeOpts); - protected finish(): void; - _cloneInto(to?: TupleHash): TupleHash; - clone(): TupleHash; -} -export declare const tuplehash128: { - (messages: Input[], opts?: cShakeOpts): Uint8Array; - create(opts?: cShakeOpts): TupleHash; -}; -export declare const tuplehash256: { - (messages: Input[], opts?: cShakeOpts): Uint8Array; - create(opts?: cShakeOpts): TupleHash; -}; -export declare const tuplehash128xof: { - (messages: Input[], opts?: cShakeOpts): Uint8Array; - create(opts?: cShakeOpts): TupleHash; -}; -export declare const tuplehash256xof: { - (messages: Input[], opts?: cShakeOpts): Uint8Array; - create(opts?: cShakeOpts): TupleHash; -}; -type ParallelOpts = cShakeOpts & { - blockLen?: number; -}; -declare class ParallelHash extends Keccak implements HashXOF { - protected leafCons: () => Hash; - private leafHash?; - private chunkPos; - private chunksDone; - private chunkLen; - constructor(blockLen: number, outputLen: number, leafCons: () => Hash, enableXOF: boolean, opts?: ParallelOpts); - protected finish(): void; - _cloneInto(to?: ParallelHash): ParallelHash; - destroy(): void; - clone(): ParallelHash; -} -export declare const parallelhash128: { - (message: Input, opts?: ParallelOpts): Uint8Array; - create(opts?: ParallelOpts): ParallelHash; -}; -export declare const parallelhash256: { - (message: Input, opts?: ParallelOpts): Uint8Array; - create(opts?: ParallelOpts): ParallelHash; -}; -export declare const parallelhash128xof: { - (message: Input, opts?: ParallelOpts): Uint8Array; - create(opts?: ParallelOpts): ParallelHash; -}; -export declare const parallelhash256xof: { - (message: Input, opts?: ParallelOpts): Uint8Array; - create(opts?: ParallelOpts): ParallelHash; -}; -export type KangarooOpts = { - dkLen?: number; - personalization?: Input; -}; -declare class KangarooTwelve extends Keccak implements HashXOF { - protected leafLen: number; - readonly chunkLen = 8192; - private leafHash?; - private personalization; - private chunkPos; - private chunksDone; - constructor(blockLen: number, leafLen: number, outputLen: number, rounds: number, opts: KangarooOpts); - update(data: Input): this; - protected finish(): void; - destroy(): void; - _cloneInto(to?: KangarooTwelve): KangarooTwelve; - clone(): KangarooTwelve; -} -export declare const k12: { - (msg: Input, opts?: KangarooOpts | undefined): Uint8Array; - outputLen: number; - blockLen: number; - create(opts: KangarooOpts): Hash; -}; -export declare const m14: { - (msg: Input, opts?: KangarooOpts | undefined): Uint8Array; - outputLen: number; - blockLen: number; - create(opts: KangarooOpts): Hash; -}; -declare class KeccakPRG extends Keccak { - protected rate: number; - constructor(capacity: number); - keccak(): void; - update(data: Input): this; - feed(data: Input): this; - protected finish(): void; - digestInto(_out: Uint8Array): Uint8Array; - fetch(bytes: number): Uint8Array; - forget(): void; - _cloneInto(to?: KeccakPRG): KeccakPRG; - clone(): KeccakPRG; -} -export declare const keccakprg: (capacity?: number) => KeccakPRG; -export {}; diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha3-addons.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha3-addons.js deleted file mode 100644 index e5317b15..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha3-addons.js +++ /dev/null @@ -1,351 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.keccakprg = exports.m14 = exports.k12 = exports.parallelhash256xof = exports.parallelhash128xof = exports.parallelhash256 = exports.parallelhash128 = exports.tuplehash256xof = exports.tuplehash128xof = exports.tuplehash256 = exports.tuplehash128 = exports.kmac256xof = exports.kmac128xof = exports.kmac256 = exports.kmac128 = exports.cshake256 = exports.cshake128 = void 0; -const _assert_js_1 = require("./_assert.js"); -const utils_js_1 = require("./utils.js"); -const sha3_js_1 = require("./sha3.js"); -// cSHAKE && KMAC (NIST SP800-185) -function leftEncode(n) { - const res = [n & 0xff]; - n >>= 8; - for (; n > 0; n >>= 8) - res.unshift(n & 0xff); - res.unshift(res.length); - return new Uint8Array(res); -} -function rightEncode(n) { - const res = [n & 0xff]; - n >>= 8; - for (; n > 0; n >>= 8) - res.unshift(n & 0xff); - res.push(res.length); - return new Uint8Array(res); -} -function chooseLen(opts, outputLen) { - return opts.dkLen === undefined ? outputLen : opts.dkLen; -} -const toBytesOptional = (buf) => (buf !== undefined ? (0, utils_js_1.toBytes)(buf) : new Uint8Array([])); -// NOTE: second modulo is necessary since we don't need to add padding if current element takes whole block -const getPadding = (len, block) => new Uint8Array((block - (len % block)) % block); -// Personalization -function cshakePers(hash, opts = {}) { - if (!opts || (!opts.personalization && !opts.NISTfn)) - return hash; - // Encode and pad inplace to avoid unneccesary memory copies/slices (so we don't need to zero them later) - // bytepad(encode_string(N) || encode_string(S), 168) - const blockLenBytes = leftEncode(hash.blockLen); - const fn = toBytesOptional(opts.NISTfn); - const fnLen = leftEncode(8 * fn.length); // length in bits - const pers = toBytesOptional(opts.personalization); - const persLen = leftEncode(8 * pers.length); // length in bits - if (!fn.length && !pers.length) - return hash; - hash.suffix = 0x04; - hash.update(blockLenBytes).update(fnLen).update(fn).update(persLen).update(pers); - let totalLen = blockLenBytes.length + fnLen.length + fn.length + persLen.length + pers.length; - hash.update(getPadding(totalLen, hash.blockLen)); - return hash; -} -const gencShake = (suffix, blockLen, outputLen) => (0, utils_js_1.wrapConstructorWithOpts)((opts = {}) => cshakePers(new sha3_js_1.Keccak(blockLen, suffix, chooseLen(opts, outputLen), true), opts)); -exports.cshake128 = (() => gencShake(0x1f, 168, 128 / 8))(); -exports.cshake256 = (() => gencShake(0x1f, 136, 256 / 8))(); -class KMAC extends sha3_js_1.Keccak { - constructor(blockLen, outputLen, enableXOF, key, opts = {}) { - super(blockLen, 0x1f, outputLen, enableXOF); - cshakePers(this, { NISTfn: 'KMAC', personalization: opts.personalization }); - key = (0, utils_js_1.toBytes)(key); - // 1. newX = bytepad(encode_string(K), 168) || X || right_encode(L). - const blockLenBytes = leftEncode(this.blockLen); - const keyLen = leftEncode(8 * key.length); - this.update(blockLenBytes).update(keyLen).update(key); - const totalLen = blockLenBytes.length + keyLen.length + key.length; - this.update(getPadding(totalLen, this.blockLen)); - } - finish() { - if (!this.finished) - this.update(rightEncode(this.enableXOF ? 0 : this.outputLen * 8)); // outputLen in bits - super.finish(); - } - _cloneInto(to) { - // Create new instance without calling constructor since key already in state and we don't know it. - // Force "to" to be instance of KMAC instead of Sha3. - if (!to) { - to = Object.create(Object.getPrototypeOf(this), {}); - to.state = this.state.slice(); - to.blockLen = this.blockLen; - to.state32 = (0, utils_js_1.u32)(to.state); - } - return super._cloneInto(to); - } - clone() { - return this._cloneInto(); - } -} -function genKmac(blockLen, outputLen, xof = false) { - const kmac = (key, message, opts) => kmac.create(key, opts).update(message).digest(); - kmac.create = (key, opts = {}) => new KMAC(blockLen, chooseLen(opts, outputLen), xof, key, opts); - return kmac; -} -exports.kmac128 = (() => genKmac(168, 128 / 8))(); -exports.kmac256 = (() => genKmac(136, 256 / 8))(); -exports.kmac128xof = (() => genKmac(168, 128 / 8, true))(); -exports.kmac256xof = (() => genKmac(136, 256 / 8, true))(); -// TupleHash -// Usage: tuple(['ab', 'cd']) != tuple(['a', 'bcd']) -class TupleHash extends sha3_js_1.Keccak { - constructor(blockLen, outputLen, enableXOF, opts = {}) { - super(blockLen, 0x1f, outputLen, enableXOF); - cshakePers(this, { NISTfn: 'TupleHash', personalization: opts.personalization }); - // Change update after cshake processed - this.update = (data) => { - data = (0, utils_js_1.toBytes)(data); - super.update(leftEncode(data.length * 8)); - super.update(data); - return this; - }; - } - finish() { - if (!this.finished) - super.update(rightEncode(this.enableXOF ? 0 : this.outputLen * 8)); // outputLen in bits - super.finish(); - } - _cloneInto(to) { - to || (to = new TupleHash(this.blockLen, this.outputLen, this.enableXOF)); - return super._cloneInto(to); - } - clone() { - return this._cloneInto(); - } -} -function genTuple(blockLen, outputLen, xof = false) { - const tuple = (messages, opts) => { - const h = tuple.create(opts); - for (const msg of messages) - h.update(msg); - return h.digest(); - }; - tuple.create = (opts = {}) => new TupleHash(blockLen, chooseLen(opts, outputLen), xof, opts); - return tuple; -} -exports.tuplehash128 = (() => genTuple(168, 128 / 8))(); -exports.tuplehash256 = (() => genTuple(136, 256 / 8))(); -exports.tuplehash128xof = (() => genTuple(168, 128 / 8, true))(); -exports.tuplehash256xof = (() => genTuple(136, 256 / 8, true))(); -class ParallelHash extends sha3_js_1.Keccak { - constructor(blockLen, outputLen, leafCons, enableXOF, opts = {}) { - super(blockLen, 0x1f, outputLen, enableXOF); - this.leafCons = leafCons; - this.chunkPos = 0; // Position of current block in chunk - this.chunksDone = 0; // How many chunks we already have - cshakePers(this, { NISTfn: 'ParallelHash', personalization: opts.personalization }); - let { blockLen: B } = opts; - B || (B = 8); - (0, _assert_js_1.number)(B); - this.chunkLen = B; - super.update(leftEncode(B)); - // Change update after cshake processed - this.update = (data) => { - data = (0, utils_js_1.toBytes)(data); - const { chunkLen, leafCons } = this; - for (let pos = 0, len = data.length; pos < len;) { - if (this.chunkPos == chunkLen || !this.leafHash) { - if (this.leafHash) { - super.update(this.leafHash.digest()); - this.chunksDone++; - } - this.leafHash = leafCons(); - this.chunkPos = 0; - } - const take = Math.min(chunkLen - this.chunkPos, len - pos); - this.leafHash.update(data.subarray(pos, pos + take)); - this.chunkPos += take; - pos += take; - } - return this; - }; - } - finish() { - if (this.finished) - return; - if (this.leafHash) { - super.update(this.leafHash.digest()); - this.chunksDone++; - } - super.update(rightEncode(this.chunksDone)); - super.update(rightEncode(this.enableXOF ? 0 : this.outputLen * 8)); // outputLen in bits - super.finish(); - } - _cloneInto(to) { - to || (to = new ParallelHash(this.blockLen, this.outputLen, this.leafCons, this.enableXOF)); - if (this.leafHash) - to.leafHash = this.leafHash._cloneInto(to.leafHash); - to.chunkPos = this.chunkPos; - to.chunkLen = this.chunkLen; - to.chunksDone = this.chunksDone; - return super._cloneInto(to); - } - destroy() { - super.destroy.call(this); - if (this.leafHash) - this.leafHash.destroy(); - } - clone() { - return this._cloneInto(); - } -} -function genPrl(blockLen, outputLen, leaf, xof = false) { - const parallel = (message, opts) => parallel.create(opts).update(message).digest(); - parallel.create = (opts = {}) => new ParallelHash(blockLen, chooseLen(opts, outputLen), () => leaf.create({ dkLen: 2 * outputLen }), xof, opts); - return parallel; -} -exports.parallelhash128 = (() => genPrl(168, 128 / 8, exports.cshake128))(); -exports.parallelhash256 = (() => genPrl(136, 256 / 8, exports.cshake256))(); -exports.parallelhash128xof = (() => genPrl(168, 128 / 8, exports.cshake128, true))(); -exports.parallelhash256xof = (() => genPrl(136, 256 / 8, exports.cshake256, true))(); -// Kangaroo -// Same as NIST rightEncode, but returns [0] for zero string -function rightEncodeK12(n) { - const res = []; - for (; n > 0; n >>= 8) - res.unshift(n & 0xff); - res.push(res.length); - return new Uint8Array(res); -} -const EMPTY = new Uint8Array([]); -class KangarooTwelve extends sha3_js_1.Keccak { - constructor(blockLen, leafLen, outputLen, rounds, opts) { - super(blockLen, 0x07, outputLen, true, rounds); - this.leafLen = leafLen; - this.chunkLen = 8192; - this.chunkPos = 0; // Position of current block in chunk - this.chunksDone = 0; // How many chunks we already have - const { personalization } = opts; - this.personalization = toBytesOptional(personalization); - } - update(data) { - data = (0, utils_js_1.toBytes)(data); - const { chunkLen, blockLen, leafLen, rounds } = this; - for (let pos = 0, len = data.length; pos < len;) { - if (this.chunkPos == chunkLen) { - if (this.leafHash) - super.update(this.leafHash.digest()); - else { - this.suffix = 0x06; // Its safe to change suffix here since its used only in digest() - super.update(new Uint8Array([3, 0, 0, 0, 0, 0, 0, 0])); - } - this.leafHash = new sha3_js_1.Keccak(blockLen, 0x0b, leafLen, false, rounds); - this.chunksDone++; - this.chunkPos = 0; - } - const take = Math.min(chunkLen - this.chunkPos, len - pos); - const chunk = data.subarray(pos, pos + take); - if (this.leafHash) - this.leafHash.update(chunk); - else - super.update(chunk); - this.chunkPos += take; - pos += take; - } - return this; - } - finish() { - if (this.finished) - return; - const { personalization } = this; - this.update(personalization).update(rightEncodeK12(personalization.length)); - // Leaf hash - if (this.leafHash) { - super.update(this.leafHash.digest()); - super.update(rightEncodeK12(this.chunksDone)); - super.update(new Uint8Array([0xff, 0xff])); - } - super.finish.call(this); - } - destroy() { - super.destroy.call(this); - if (this.leafHash) - this.leafHash.destroy(); - // We cannot zero personalization buffer since it is user provided and we don't want to mutate user input - this.personalization = EMPTY; - } - _cloneInto(to) { - const { blockLen, leafLen, leafHash, outputLen, rounds } = this; - to || (to = new KangarooTwelve(blockLen, leafLen, outputLen, rounds, {})); - super._cloneInto(to); - if (leafHash) - to.leafHash = leafHash._cloneInto(to.leafHash); - to.personalization.set(this.personalization); - to.leafLen = this.leafLen; - to.chunkPos = this.chunkPos; - to.chunksDone = this.chunksDone; - return to; - } - clone() { - return this._cloneInto(); - } -} -// Default to 32 bytes, so it can be used without opts -exports.k12 = (() => (0, utils_js_1.wrapConstructorWithOpts)((opts = {}) => new KangarooTwelve(168, 32, chooseLen(opts, 32), 12, opts)))(); -// MarsupilamiFourteen -exports.m14 = (() => (0, utils_js_1.wrapConstructorWithOpts)((opts = {}) => new KangarooTwelve(136, 64, chooseLen(opts, 64), 14, opts)))(); -// https://keccak.team/files/CSF-0.1.pdf -// + https://github.com/XKCP/XKCP/tree/master/lib/high/Keccak/PRG -class KeccakPRG extends sha3_js_1.Keccak { - constructor(capacity) { - (0, _assert_js_1.number)(capacity); - // Rho should be full bytes - if (capacity < 0 || capacity > 1600 - 10 || (1600 - capacity - 2) % 8) - throw new Error('KeccakPRG: Invalid capacity'); - // blockLen = rho in bytes - super((1600 - capacity - 2) / 8, 0, 0, true); - this.rate = 1600 - capacity; - this.posOut = Math.floor((this.rate + 7) / 8); - } - keccak() { - // Duplex padding - this.state[this.pos] ^= 0x01; - this.state[this.blockLen] ^= 0x02; // Rho is full bytes - super.keccak(); - this.pos = 0; - this.posOut = 0; - } - update(data) { - super.update(data); - this.posOut = this.blockLen; - return this; - } - feed(data) { - return this.update(data); - } - finish() { } - digestInto(_out) { - throw new Error('KeccakPRG: digest is not allowed, please use .fetch instead.'); - } - fetch(bytes) { - return this.xof(bytes); - } - // Ensure irreversibility (even if state leaked previous outputs cannot be computed) - forget() { - if (this.rate < 1600 / 2 + 1) - throw new Error('KeccakPRG: rate too low to use forget'); - this.keccak(); - for (let i = 0; i < this.blockLen; i++) - this.state[i] = 0; - this.pos = this.blockLen; - this.keccak(); - this.posOut = this.blockLen; - } - _cloneInto(to) { - const { rate } = this; - to || (to = new KeccakPRG(1600 - rate)); - super._cloneInto(to); - to.rate = rate; - return to; - } - clone() { - return this._cloneInto(); - } -} -const keccakprg = (capacity = 254) => new KeccakPRG(capacity); -exports.keccakprg = keccakprg; -//# sourceMappingURL=sha3-addons.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha3-addons.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha3-addons.js.map deleted file mode 100644 index 7232b4f0..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha3-addons.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha3-addons.js","sourceRoot":"","sources":["src/sha3-addons.ts"],"names":[],"mappings":";;;AAAA,6CAAsD;AACtD,yCAAyF;AACzF,uCAA8C;AAC9C,kCAAkC;AAClC,SAAS,UAAU,CAAC,CAAS;IAC3B,MAAM,GAAG,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IACvB,CAAC,KAAK,CAAC,CAAC;IACR,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC;QAAE,GAAG,CAAC,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAC7C,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACxB,OAAO,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC;AAC7B,CAAC;AAED,SAAS,WAAW,CAAC,CAAS;IAC5B,MAAM,GAAG,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IACvB,CAAC,KAAK,CAAC,CAAC;IACR,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC;QAAE,GAAG,CAAC,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAC7C,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACrB,OAAO,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AC;QACd,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC;IAC9B,CAAC;IACD,UAAU,CAAC,EAAc;QACvB,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;QACtB,EAAE,KAAF,EAAE,GAAK,IAAI,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,EAAC;QAClC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;QACrB,EAAE,CAAC,IAAI,GAAG,IAAI,CAAC;QACf,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,KAAK;QACH,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;IAC3B,CAAC;CACF;AAEM,MAAM,SAAS,GAAG,CAAC,QAAQ,GAAG,GAAG,EAAE,EAAE,CAAC,IAAI,SAAS,CAAC,QAAQ,CAAC,CAAC;AAAxD,QAAA,SAAS,aAA+C"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha3.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha3.d.ts deleted file mode 100644 index 2107cf64..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha3.d.ts +++ /dev/null @@ -1,97 +0,0 @@ -import { Hash, Input, HashXOF } from './utils.js'; -export declare function keccakP(s: Uint32Array, rounds?: number): void; -export declare class Keccak extends Hash implements HashXOF { - blockLen: number; - suffix: number; - outputLen: number; - protected enableXOF: boolean; - protected rounds: number; - protected state: Uint8Array; - protected pos: number; - protected posOut: number; - protected finished: boolean; - protected state32: Uint32Array; - protected destroyed: boolean; - constructor(blockLen: number, suffix: number, outputLen: number, enableXOF?: boolean, rounds?: number); - protected keccak(): void; - update(data: Input): this; - protected finish(): void; - protected writeInto(out: Uint8Array): Uint8Array; - xofInto(out: Uint8Array): Uint8Array; - xof(bytes: number): Uint8Array; - digestInto(out: Uint8Array): Uint8Array; - digest(): Uint8Array; - destroy(): void; - _cloneInto(to?: Keccak): Keccak; -} -export declare const sha3_224: { - (msg: Input): Uint8Array; - outputLen: number; - blockLen: number; - create(): Hash; -}; -/** - * SHA3-256 hash function - * @param message - that would be hashed - */ -export declare const sha3_256: { - (msg: Input): Uint8Array; - outputLen: number; - blockLen: number; - create(): Hash; -}; -export declare const sha3_384: { - (msg: Input): Uint8Array; - outputLen: number; - blockLen: number; - create(): Hash; -}; -export declare const sha3_512: { - (msg: Input): Uint8Array; - outputLen: number; - blockLen: number; - create(): Hash; -}; -export declare const keccak_224: { - (msg: Input): Uint8Array; - outputLen: number; - blockLen: number; - create(): Hash; -}; -/** - * keccak-256 hash function. Different from SHA3-256. - * @param message - that would be hashed - */ -export declare const keccak_256: { - (msg: Input): Uint8Array; - outputLen: number; - blockLen: number; - create(): Hash; -}; -export declare const keccak_384: { - (msg: Input): Uint8Array; - outputLen: number; - blockLen: number; - create(): Hash; -}; -export declare const keccak_512: { - (msg: Input): Uint8Array; - outputLen: number; - blockLen: number; - create(): Hash; -}; -export type ShakeOpts = { - dkLen?: number; -}; -export declare const shake128: { - (msg: Input, opts?: ShakeOpts | undefined): Uint8Array; - outputLen: number; - blockLen: number; - create(opts: ShakeOpts): HashXOF>; -}; -export declare const shake256: { - (msg: Input, opts?: ShakeOpts | undefined): Uint8Array; - outputLen: number; - blockLen: number; - create(opts: ShakeOpts): HashXOF>; -}; diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha3.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha3.js deleted file mode 100644 index e1b75307..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha3.js +++ /dev/null @@ -1,213 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.shake256 = exports.shake128 = exports.keccak_512 = exports.keccak_384 = exports.keccak_256 = exports.keccak_224 = exports.sha3_512 = exports.sha3_384 = exports.sha3_256 = exports.sha3_224 = exports.Keccak = exports.keccakP = void 0; -const _assert_js_1 = require("./_assert.js"); -const _u64_js_1 = require("./_u64.js"); -const utils_js_1 = require("./utils.js"); -// SHA3 (keccak) is based on a new design: basically, the internal state is bigger than output size. -// It's called a sponge function. -// Various per round constants calculations -const [SHA3_PI, SHA3_ROTL, _SHA3_IOTA] = [[], [], []]; -const _0n = /* @__PURE__ */ BigInt(0); -const _1n = /* @__PURE__ */ BigInt(1); -const _2n = /* @__PURE__ */ BigInt(2); -const _7n = /* @__PURE__ */ BigInt(7); -const _256n = /* @__PURE__ */ BigInt(256); -const _0x71n = /* @__PURE__ */ BigInt(0x71); -for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) { - // Pi - [x, y] = [y, (2 * x + 3 * y) % 5]; - SHA3_PI.push(2 * (5 * y + x)); - // Rotational - SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64); - // Iota - let t = _0n; - for (let j = 0; j < 7; j++) { - R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n; - if (R & _2n) - t ^= _1n << ((_1n << /* @__PURE__ */ BigInt(j)) - _1n); - } - _SHA3_IOTA.push(t); -} -const [SHA3_IOTA_H, SHA3_IOTA_L] = /* @__PURE__ */ (0, _u64_js_1.split)(_SHA3_IOTA, true); -// Left rotation (without 0, 32, 64) -const rotlH = (h, l, s) => (s > 32 ? (0, _u64_js_1.rotlBH)(h, l, s) : (0, _u64_js_1.rotlSH)(h, l, s)); -const rotlL = (h, l, s) => (s > 32 ? (0, _u64_js_1.rotlBL)(h, l, s) : (0, _u64_js_1.rotlSL)(h, l, s)); -// Same as keccakf1600, but allows to skip some rounds -function keccakP(s, rounds = 24) { - const B = new Uint32Array(5 * 2); - // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js) - for (let round = 24 - rounds; round < 24; round++) { - // Theta θ - for (let x = 0; x < 10; x++) - B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40]; - for (let x = 0; x < 10; x += 2) { - const idx1 = (x + 8) % 10; - const idx0 = (x + 2) % 10; - const B0 = B[idx0]; - const B1 = B[idx0 + 1]; - const Th = rotlH(B0, B1, 1) ^ B[idx1]; - const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1]; - for (let y = 0; y < 50; y += 10) { - s[x + y] ^= Th; - s[x + y + 1] ^= Tl; - } - } - // Rho (ρ) and Pi (π) - let curH = s[2]; - let curL = s[3]; - for (let t = 0; t < 24; t++) { - const shift = SHA3_ROTL[t]; - const Th = rotlH(curH, curL, shift); - const Tl = rotlL(curH, curL, shift); - const PI = SHA3_PI[t]; - curH = s[PI]; - curL = s[PI + 1]; - s[PI] = Th; - s[PI + 1] = Tl; - } - // Chi (χ) - for (let y = 0; y < 50; y += 10) { - for (let x = 0; x < 10; x++) - B[x] = s[y + x]; - for (let x = 0; x < 10; x++) - s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10]; - } - // Iota (ι) - s[0] ^= SHA3_IOTA_H[round]; - s[1] ^= SHA3_IOTA_L[round]; - } - B.fill(0); -} -exports.keccakP = keccakP; -class Keccak extends utils_js_1.Hash { - // NOTE: we accept arguments in bytes instead of bits here. - constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) { - super(); - this.blockLen = blockLen; - this.suffix = suffix; - this.outputLen = outputLen; - this.enableXOF = enableXOF; - this.rounds = rounds; - this.pos = 0; - this.posOut = 0; - this.finished = false; - this.destroyed = false; - // Can be passed from user as dkLen - (0, _assert_js_1.number)(outputLen); - // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes - if (0 >= this.blockLen || this.blockLen >= 200) - throw new Error('Sha3 supports only keccak-f1600 function'); - this.state = new Uint8Array(200); - this.state32 = (0, utils_js_1.u32)(this.state); - } - keccak() { - keccakP(this.state32, this.rounds); - this.posOut = 0; - this.pos = 0; - } - update(data) { - (0, _assert_js_1.exists)(this); - const { blockLen, state } = this; - data = (0, utils_js_1.toBytes)(data); - const len = data.length; - for (let pos = 0; pos < len;) { - const take = Math.min(blockLen - this.pos, len - pos); - for (let i = 0; i < take; i++) - state[this.pos++] ^= data[pos++]; - if (this.pos === blockLen) - this.keccak(); - } - return this; - } - finish() { - if (this.finished) - return; - this.finished = true; - const { state, suffix, pos, blockLen } = this; - // Do the padding - state[pos] ^= suffix; - if ((suffix & 0x80) !== 0 && pos === blockLen - 1) - this.keccak(); - state[blockLen - 1] ^= 0x80; - this.keccak(); - } - writeInto(out) { - (0, _assert_js_1.exists)(this, false); - (0, _assert_js_1.bytes)(out); - this.finish(); - const bufferOut = this.state; - const { blockLen } = this; - for (let pos = 0, len = out.length; pos < len;) { - if (this.posOut >= blockLen) - this.keccak(); - const take = Math.min(blockLen - this.posOut, len - pos); - out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); - this.posOut += take; - pos += take; - } - return out; - } - xofInto(out) { - // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF - if (!this.enableXOF) - throw new Error('XOF is not possible for this instance'); - return this.writeInto(out); - } - xof(bytes) { - (0, _assert_js_1.number)(bytes); - return this.xofInto(new Uint8Array(bytes)); - } - digestInto(out) { - (0, _assert_js_1.output)(out, this); - if (this.finished) - throw new Error('digest() was already called'); - this.writeInto(out); - this.destroy(); - return out; - } - digest() { - return this.digestInto(new Uint8Array(this.outputLen)); - } - destroy() { - this.destroyed = true; - this.state.fill(0); - } - _cloneInto(to) { - const { blockLen, suffix, outputLen, rounds, enableXOF } = this; - to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds)); - to.state32.set(this.state32); - to.pos = this.pos; - to.posOut = this.posOut; - to.finished = this.finished; - to.rounds = rounds; - // Suffix can change in cSHAKE - to.suffix = suffix; - to.outputLen = outputLen; - to.enableXOF = enableXOF; - to.destroyed = this.destroyed; - return to; - } -} -exports.Keccak = Keccak; -const gen = (suffix, blockLen, outputLen) => (0, utils_js_1.wrapConstructor)(() => new Keccak(blockLen, suffix, outputLen)); -exports.sha3_224 = gen(0x06, 144, 224 / 8); -/** - * SHA3-256 hash function - * @param message - that would be hashed - */ -exports.sha3_256 = gen(0x06, 136, 256 / 8); -exports.sha3_384 = gen(0x06, 104, 384 / 8); -exports.sha3_512 = gen(0x06, 72, 512 / 8); -exports.keccak_224 = gen(0x01, 144, 224 / 8); -/** - * keccak-256 hash function. Different from SHA3-256. - * @param message - that would be hashed - */ -exports.keccak_256 = gen(0x01, 136, 256 / 8); -exports.keccak_384 = gen(0x01, 104, 384 / 8); -exports.keccak_512 = gen(0x01, 72, 512 / 8); -const genShake = (suffix, blockLen, outputLen) => (0, utils_js_1.wrapXOFConstructorWithOpts)((opts = {}) => new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true)); -exports.shake128 = genShake(0x1f, 168, 128 / 8); -exports.shake256 = genShake(0x1f, 136, 256 / 8); -//# sourceMappingURL=sha3.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha3.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha3.js.map deleted file mode 100644 index fd689501..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha3.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha3.js","sourceRoot":"","sources":["src/sha3.ts"],"names":[],"mappings":";;;AAAA,6CAA6D;AAC7D,uCAAkE;AAClE,yCAQoB;AAEpB,oGAAoG;AACpG,iCAAiC;AAEjC,2CAA2C;AAC3C,MAAM,CAAC,OAAO,EAAE,SAAS,EAAE,UAAU,CAAC,GAAmC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;AACtF,MAAM,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACtC,MAAM,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACtC,MAAM,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACtC,MAAM,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,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CAAC;AAClD,QAAA,UAAU,GAAmB,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC;AAClE;;;GAGG;AACU,QAAA,UAAU,GAAmB,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC;AACrD,QAAA,UAAU,GAAmB,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC;AACrD,QAAA,UAAU,GAAmB,GAAG,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC;AAIjE,MAAM,QAAQ,GAAG,CAAC,MAAc,EAAE,QAAgB,EAAE,SAAiB,EAAE,EAAE,CACvE,IAAA,qCAA0B,EACxB,CAAC,OAAkB,EAAE,EAAE,EAAE,CACvB,IAAI,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CACxF,CAAC;AAES,QAAA,QAAQ,GAAmB,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC;AACxD,QAAA,QAAQ,GAAmB,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha512.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha512.d.ts deleted file mode 100644 index b8ba9b08..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha512.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { SHA2 } from './_sha2.js'; -export declare class SHA512 extends SHA2 { - Ah: number; - Al: number; - Bh: number; - Bl: number; - Ch: number; - Cl: number; - Dh: number; - Dl: number; - Eh: number; - El: number; - Fh: number; - Fl: number; - Gh: number; - Gl: number; - Hh: number; - Hl: number; - constructor(); - protected get(): [ - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number, - number - ]; - protected set(Ah: number, Al: number, Bh: number, Bl: number, Ch: number, Cl: number, Dh: number, Dl: number, Eh: number, El: number, Fh: number, Fl: number, Gh: number, Gl: number, Hh: number, Hl: number): void; - protected process(view: DataView, offset: number): void; - protected roundClean(): void; - destroy(): void; -} -export declare const sha512: { - (msg: import("./utils.js").Input): Uint8Array; - outputLen: number; - blockLen: number; - create(): import("./utils.js").Hash; -}; -export declare const sha512_224: { - (msg: import("./utils.js").Input): Uint8Array; - outputLen: number; - blockLen: number; - create(): import("./utils.js").Hash; -}; -export declare const sha512_256: { - (msg: import("./utils.js").Input): Uint8Array; - outputLen: number; - blockLen: number; - create(): import("./utils.js").Hash; -}; -export declare const sha384: { - (msg: import("./utils.js").Input): Uint8Array; - outputLen: number; - blockLen: number; - create(): import("./utils.js").Hash; -}; diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha512.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha512.js deleted file mode 100644 index 1d3482a9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha512.js +++ /dev/null @@ -1,235 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.sha384 = exports.sha512_256 = exports.sha512_224 = exports.sha512 = exports.SHA512 = void 0; -const _sha2_js_1 = require("./_sha2.js"); -const _u64_js_1 = require("./_u64.js"); -const utils_js_1 = require("./utils.js"); -// Round contants (first 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409): -// prettier-ignore -const [SHA512_Kh, SHA512_Kl] = /* @__PURE__ */ (() => _u64_js_1.default.split([ - '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc', - '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118', - '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2', - '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694', - '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65', - '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5', - '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4', - '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70', - '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df', - '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b', - '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30', - '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8', - '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8', - '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3', - '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec', - '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b', - '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178', - '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b', - '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c', - '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817' -].map(n => BigInt(n))))(); -// Temporary buffer, not used to store anything between runs -const SHA512_W_H = /* @__PURE__ */ new Uint32Array(80); -const SHA512_W_L = /* @__PURE__ */ new Uint32Array(80); -class SHA512 extends _sha2_js_1.SHA2 { - constructor() { - super(128, 64, 16, false); - // We cannot use array here since array allows indexing by variable which means optimizer/compiler cannot use registers. - // Also looks cleaner and easier to verify with spec. - // Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19): - // h -- high 32 bits, l -- low 32 bits - this.Ah = 0x6a09e667 | 0; - this.Al = 0xf3bcc908 | 0; - this.Bh = 0xbb67ae85 | 0; - this.Bl = 0x84caa73b | 0; - this.Ch = 0x3c6ef372 | 0; - this.Cl = 0xfe94f82b | 0; - this.Dh = 0xa54ff53a | 0; - this.Dl = 0x5f1d36f1 | 0; - this.Eh = 0x510e527f | 0; - this.El = 0xade682d1 | 0; - this.Fh = 0x9b05688c | 0; - this.Fl = 0x2b3e6c1f | 0; - this.Gh = 0x1f83d9ab | 0; - this.Gl = 0xfb41bd6b | 0; - this.Hh = 0x5be0cd19 | 0; - this.Hl = 0x137e2179 | 0; - } - // prettier-ignore - get() { - const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; - return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl]; - } - // prettier-ignore - set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) { - this.Ah = Ah | 0; - this.Al = Al | 0; - this.Bh = Bh | 0; - this.Bl = Bl | 0; - this.Ch = Ch | 0; - this.Cl = Cl | 0; - this.Dh = Dh | 0; - this.Dl = Dl | 0; - this.Eh = Eh | 0; - this.El = El | 0; - this.Fh = Fh | 0; - this.Fl = Fl | 0; - this.Gh = Gh | 0; - this.Gl = Gl | 0; - this.Hh = Hh | 0; - this.Hl = Hl | 0; - } - process(view, offset) { - // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array - for (let i = 0; i < 16; i++, offset += 4) { - SHA512_W_H[i] = view.getUint32(offset); - SHA512_W_L[i] = view.getUint32((offset += 4)); - } - for (let i = 16; i < 80; i++) { - // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7) - const W15h = SHA512_W_H[i - 15] | 0; - const W15l = SHA512_W_L[i - 15] | 0; - const s0h = _u64_js_1.default.rotrSH(W15h, W15l, 1) ^ _u64_js_1.default.rotrSH(W15h, W15l, 8) ^ _u64_js_1.default.shrSH(W15h, W15l, 7); - const s0l = _u64_js_1.default.rotrSL(W15h, W15l, 1) ^ _u64_js_1.default.rotrSL(W15h, W15l, 8) ^ _u64_js_1.default.shrSL(W15h, W15l, 7); - // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6) - const W2h = SHA512_W_H[i - 2] | 0; - const W2l = SHA512_W_L[i - 2] | 0; - const s1h = _u64_js_1.default.rotrSH(W2h, W2l, 19) ^ _u64_js_1.default.rotrBH(W2h, W2l, 61) ^ _u64_js_1.default.shrSH(W2h, W2l, 6); - const s1l = _u64_js_1.default.rotrSL(W2h, W2l, 19) ^ _u64_js_1.default.rotrBL(W2h, W2l, 61) ^ _u64_js_1.default.shrSL(W2h, W2l, 6); - // SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16]; - const SUMl = _u64_js_1.default.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]); - const SUMh = _u64_js_1.default.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]); - SHA512_W_H[i] = SUMh | 0; - SHA512_W_L[i] = SUMl | 0; - } - let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; - // Compression function main loop, 80 rounds - for (let i = 0; i < 80; i++) { - // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41) - const sigma1h = _u64_js_1.default.rotrSH(Eh, El, 14) ^ _u64_js_1.default.rotrSH(Eh, El, 18) ^ _u64_js_1.default.rotrBH(Eh, El, 41); - const sigma1l = _u64_js_1.default.rotrSL(Eh, El, 14) ^ _u64_js_1.default.rotrSL(Eh, El, 18) ^ _u64_js_1.default.rotrBL(Eh, El, 41); - //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; - const CHIh = (Eh & Fh) ^ (~Eh & Gh); - const CHIl = (El & Fl) ^ (~El & Gl); - // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i] - // prettier-ignore - const T1ll = _u64_js_1.default.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]); - const T1h = _u64_js_1.default.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]); - const T1l = T1ll | 0; - // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39) - const sigma0h = _u64_js_1.default.rotrSH(Ah, Al, 28) ^ _u64_js_1.default.rotrBH(Ah, Al, 34) ^ _u64_js_1.default.rotrBH(Ah, Al, 39); - const sigma0l = _u64_js_1.default.rotrSL(Ah, Al, 28) ^ _u64_js_1.default.rotrBL(Ah, Al, 34) ^ _u64_js_1.default.rotrBL(Ah, Al, 39); - const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch); - const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl); - Hh = Gh | 0; - Hl = Gl | 0; - Gh = Fh | 0; - Gl = Fl | 0; - Fh = Eh | 0; - Fl = El | 0; - ({ h: Eh, l: El } = _u64_js_1.default.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0)); - Dh = Ch | 0; - Dl = Cl | 0; - Ch = Bh | 0; - Cl = Bl | 0; - Bh = Ah | 0; - Bl = Al | 0; - const All = _u64_js_1.default.add3L(T1l, sigma0l, MAJl); - Ah = _u64_js_1.default.add3H(All, T1h, sigma0h, MAJh); - Al = All | 0; - } - // Add the compressed chunk to the current hash value - ({ h: Ah, l: Al } = _u64_js_1.default.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0)); - ({ h: Bh, l: Bl } = _u64_js_1.default.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0)); - ({ h: Ch, l: Cl } = _u64_js_1.default.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0)); - ({ h: Dh, l: Dl } = _u64_js_1.default.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0)); - ({ h: Eh, l: El } = _u64_js_1.default.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0)); - ({ h: Fh, l: Fl } = _u64_js_1.default.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0)); - ({ h: Gh, l: Gl } = _u64_js_1.default.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0)); - ({ h: Hh, l: Hl } = _u64_js_1.default.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0)); - this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl); - } - roundClean() { - SHA512_W_H.fill(0); - SHA512_W_L.fill(0); - } - destroy() { - this.buffer.fill(0); - this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - } -} -exports.SHA512 = SHA512; -class SHA512_224 extends SHA512 { - constructor() { - super(); - // h -- high 32 bits, l -- low 32 bits - this.Ah = 0x8c3d37c8 | 0; - this.Al = 0x19544da2 | 0; - this.Bh = 0x73e19966 | 0; - this.Bl = 0x89dcd4d6 | 0; - this.Ch = 0x1dfab7ae | 0; - this.Cl = 0x32ff9c82 | 0; - this.Dh = 0x679dd514 | 0; - this.Dl = 0x582f9fcf | 0; - this.Eh = 0x0f6d2b69 | 0; - this.El = 0x7bd44da8 | 0; - this.Fh = 0x77e36f73 | 0; - this.Fl = 0x04c48942 | 0; - this.Gh = 0x3f9d85a8 | 0; - this.Gl = 0x6a1d36c8 | 0; - this.Hh = 0x1112e6ad | 0; - this.Hl = 0x91d692a1 | 0; - this.outputLen = 28; - } -} -class SHA512_256 extends SHA512 { - constructor() { - super(); - // h -- high 32 bits, l -- low 32 bits - this.Ah = 0x22312194 | 0; - this.Al = 0xfc2bf72c | 0; - this.Bh = 0x9f555fa3 | 0; - this.Bl = 0xc84c64c2 | 0; - this.Ch = 0x2393b86b | 0; - this.Cl = 0x6f53b151 | 0; - this.Dh = 0x96387719 | 0; - this.Dl = 0x5940eabd | 0; - this.Eh = 0x96283ee2 | 0; - this.El = 0xa88effe3 | 0; - this.Fh = 0xbe5e1e25 | 0; - this.Fl = 0x53863992 | 0; - this.Gh = 0x2b0199fc | 0; - this.Gl = 0x2c85b8aa | 0; - this.Hh = 0x0eb72ddc | 0; - this.Hl = 0x81c52ca2 | 0; - this.outputLen = 32; - } -} -class SHA384 extends SHA512 { - constructor() { - super(); - // h -- high 32 bits, l -- low 32 bits - this.Ah = 0xcbbb9d5d | 0; - this.Al = 0xc1059ed8 | 0; - this.Bh = 0x629a292a | 0; - this.Bl = 0x367cd507 | 0; - this.Ch = 0x9159015a | 0; - this.Cl = 0x3070dd17 | 0; - this.Dh = 0x152fecd8 | 0; - this.Dl = 0xf70e5939 | 0; - this.Eh = 0x67332667 | 0; - this.El = 0xffc00b31 | 0; - this.Fh = 0x8eb44a87 | 0; - this.Fl = 0x68581511 | 0; - this.Gh = 0xdb0c2e0d | 0; - this.Gl = 0x64f98fa7 | 0; - this.Hh = 0x47b5481d | 0; - this.Hl = 0xbefa4fa4 | 0; - this.outputLen = 48; - } -} -exports.sha512 = (0, utils_js_1.wrapConstructor)(() => new SHA512()); -exports.sha512_224 = (0, utils_js_1.wrapConstructor)(() => new SHA512_224()); -exports.sha512_256 = (0, utils_js_1.wrapConstructor)(() => new SHA512_256()); -exports.sha384 = (0, utils_js_1.wrapConstructor)(() => new SHA384()); -//# sourceMappingURL=sha512.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha512.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha512.js.map deleted file mode 100644 index 700a8e78..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/sha512.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha512.js","sourceRoot":"","sources":["src/sha512.ts"],"names":[],"mappings":";;;AAAA,yCAAkC;AAClC,uCAA4B;AAC5B,yCAA6C;AAE7C,0GAA0G;AAC1G,kBAAkB;AAClB,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,GAAG,eAAe,CAAC,CAAC,GAAG,EAAE,CAAC,iBAAG,CAAC,KAAK,CAAC;IAC9D,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB;IACtF,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB;IACtF,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB;IACtF,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB;IACtF,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB;IACtF,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB;IACtF,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB;IACtF,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB;IACtF,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB;IACtF,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB;IACtF,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,oBAA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D,QAAA,UAAU,GAAmB,IAAA,0BAAe,EAAC,GAAG,EAAE,CAAC,IAAI,UAAU,EAAE,CAAC,CAAC;AACrE,QAAA,UAAU,GAAmB,IAAA,0BAAe,EAAC,GAAG,EAAE,CAAC,IAAI,UAAU,EAAE,CAAC,CAAC;AACrE,QAAA,MAAM,GAAmB,IAAA,0BAAe,EAAC,GAAG,EAAE,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/_assert.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/_assert.ts deleted file mode 100644 index 11d28ea6..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/_assert.ts +++ /dev/null @@ -1,43 +0,0 @@ -function number(n: number) { - if (!Number.isSafeInteger(n) || n < 0) throw new Error(`Wrong positive integer: ${n}`); -} - -function bool(b: boolean) { - if (typeof b !== 'boolean') throw new Error(`Expected boolean, not ${b}`); -} - -function bytes(b: Uint8Array | undefined, ...lengths: number[]) { - if (!(b instanceof Uint8Array)) throw new Error('Expected Uint8Array'); - if (lengths.length > 0 && !lengths.includes(b.length)) - throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`); -} - -type Hash = { - (data: Uint8Array): Uint8Array; - blockLen: number; - outputLen: number; - create: any; -}; -function hash(hash: Hash) { - if (typeof hash !== 'function' || typeof hash.create !== 'function') - throw new Error('Hash should be wrapped by utils.wrapConstructor'); - number(hash.outputLen); - number(hash.blockLen); -} - -function exists(instance: any, checkFinished = true) { - if (instance.destroyed) throw new Error('Hash instance has been destroyed'); - if (checkFinished && instance.finished) throw new Error('Hash#digest() has already been called'); -} -function output(out: any, instance: any) { - bytes(out); - const min = instance.outputLen; - if (out.length < min) { - throw new Error(`digestInto() expects output buffer of length at least ${min}`); - } -} - -export { number, bool, bytes, hash, exists, output }; - -const assert = { number, bool, bytes, hash, exists, output }; -export default assert; diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/_blake2.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/_blake2.ts deleted file mode 100644 index 6aa4a742..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/_blake2.ts +++ /dev/null @@ -1,128 +0,0 @@ -import { number, exists, output } from './_assert.js'; -import { Hash, Input, toBytes, u32 } from './utils.js'; - -// Blake is based on ChaCha permutation. - -// For BLAKE2b, the two extra permutations for rounds 10 and 11 are SIGMA[10..11] = SIGMA[0..1]. -// prettier-ignore -export const SIGMA = /* @__PURE__ */ new Uint8Array([ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3, - 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4, - 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8, - 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13, - 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9, - 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11, - 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10, - 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5, - 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3, -]); - -export type BlakeOpts = { - dkLen?: number; - key?: Input; - salt?: Input; - personalization?: Input; -}; - -export abstract class BLAKE2> extends Hash { - protected abstract compress(msg: Uint32Array, offset: number, isLast: boolean): void; - protected abstract get(): number[]; - protected abstract set(...args: number[]): void; - abstract destroy(): void; - protected buffer: Uint8Array; - protected buffer32: Uint32Array; - protected length: number = 0; - protected pos: number = 0; - protected finished = false; - protected destroyed = false; - - constructor( - readonly blockLen: number, - public outputLen: number, - opts: BlakeOpts = {}, - keyLen: number, - saltLen: number, - persLen: number - ) { - super(); - number(blockLen); - number(outputLen); - number(keyLen); - if (outputLen < 0 || outputLen > keyLen) throw new Error('outputLen bigger than keyLen'); - if (opts.key !== undefined && (opts.key.length < 1 || opts.key.length > keyLen)) - throw new Error(`key must be up 1..${keyLen} byte long or undefined`); - if (opts.salt !== undefined && opts.salt.length !== saltLen) - throw new Error(`salt must be ${saltLen} byte long or undefined`); - if (opts.personalization !== undefined && opts.personalization.length !== persLen) - throw new Error(`personalization must be ${persLen} byte long or undefined`); - this.buffer32 = u32((this.buffer = new Uint8Array(blockLen))); - } - update(data: Input) { - exists(this); - // Main difference with other hashes: there is flag for last block, - // so we cannot process current block before we know that there - // is the next one. This significantly complicates logic and reduces ability - // to do zero-copy processing - const { blockLen, buffer, buffer32 } = this; - data = toBytes(data); - const len = data.length; - const offset = data.byteOffset; - const buf = data.buffer; - for (let pos = 0; pos < len; ) { - // If buffer is full and we still have input (don't process last block, same as blake2s) - if (this.pos === blockLen) { - this.compress(buffer32, 0, false); - this.pos = 0; - } - const take = Math.min(blockLen - this.pos, len - pos); - const dataOffset = offset + pos; - // full block && aligned to 4 bytes && not last in input - if (take === blockLen && !(dataOffset % 4) && pos + take < len) { - const data32 = new Uint32Array(buf, dataOffset, Math.floor((len - pos) / 4)); - for (let pos32 = 0; pos + blockLen < len; pos32 += buffer32.length, pos += blockLen) { - this.length += blockLen; - this.compress(data32, pos32, false); - } - continue; - } - buffer.set(data.subarray(pos, pos + take), this.pos); - this.pos += take; - this.length += take; - pos += take; - } - return this; - } - digestInto(out: Uint8Array) { - exists(this); - output(out, this); - const { pos, buffer32 } = this; - this.finished = true; - // Padding - this.buffer.subarray(pos).fill(0); - this.compress(buffer32, 0, true); - const out32 = u32(out); - this.get().forEach((v, i) => (out32[i] = v)); - } - digest() { - const { buffer, outputLen } = this; - this.digestInto(buffer); - const res = buffer.slice(0, outputLen); - this.destroy(); - return res; - } - _cloneInto(to?: T): T { - const { buffer, length, finished, destroyed, outputLen, pos } = this; - to ||= new (this.constructor as any)({ dkLen: outputLen }) as T; - to.set(...this.get()); - to.length = length; - to.finished = finished; - to.destroyed = destroyed; - to.outputLen = outputLen; - to.buffer.set(buffer); - to.pos = pos; - return to; - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/_sha2.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/_sha2.ts deleted file mode 100644 index bd991036..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/_sha2.ts +++ /dev/null @@ -1,118 +0,0 @@ -import { exists, output } from './_assert.js'; -import { Hash, createView, Input, toBytes } from './utils.js'; - -// Polyfill for Safari 14 -function setBigUint64(view: DataView, byteOffset: number, value: bigint, isLE: boolean): void { - if (typeof view.setBigUint64 === 'function') return view.setBigUint64(byteOffset, value, isLE); - const _32n = BigInt(32); - const _u32_max = BigInt(0xffffffff); - const wh = Number((value >> _32n) & _u32_max); - const wl = Number(value & _u32_max); - const h = isLE ? 4 : 0; - const l = isLE ? 0 : 4; - view.setUint32(byteOffset + h, wh, isLE); - view.setUint32(byteOffset + l, wl, isLE); -} - -// Base SHA2 class (RFC 6234) -export abstract class SHA2> extends Hash { - protected abstract process(buf: DataView, offset: number): void; - protected abstract get(): number[]; - protected abstract set(...args: number[]): void; - abstract destroy(): void; - protected abstract roundClean(): void; - // For partial updates less than block size - protected buffer: Uint8Array; - protected view: DataView; - protected finished = false; - protected length = 0; - protected pos = 0; - protected destroyed = false; - - constructor( - readonly blockLen: number, - public outputLen: number, - readonly padOffset: number, - readonly isLE: boolean - ) { - super(); - this.buffer = new Uint8Array(blockLen); - this.view = createView(this.buffer); - } - update(data: Input): this { - exists(this); - const { view, buffer, blockLen } = this; - data = toBytes(data); - const len = data.length; - for (let pos = 0; pos < len; ) { - const take = Math.min(blockLen - this.pos, len - pos); - // Fast path: we have at least one block in input, cast it to view and process - if (take === blockLen) { - const dataView = createView(data); - for (; blockLen <= len - pos; pos += blockLen) this.process(dataView, pos); - continue; - } - buffer.set(data.subarray(pos, pos + take), this.pos); - this.pos += take; - pos += take; - if (this.pos === blockLen) { - this.process(view, 0); - this.pos = 0; - } - } - this.length += data.length; - this.roundClean(); - return this; - } - digestInto(out: Uint8Array) { - exists(this); - output(out, this); - this.finished = true; - // Padding - // We can avoid allocation of buffer for padding completely if it - // was previously not allocated here. But it won't change performance. - const { buffer, view, blockLen, isLE } = this; - let { pos } = this; - // append the bit '1' to the message - buffer[pos++] = 0b10000000; - this.buffer.subarray(pos).fill(0); - // we have less than padOffset left in buffer, so we cannot put length in current block, need process it and pad again - if (this.padOffset > blockLen - pos) { - this.process(view, 0); - pos = 0; - } - // Pad until full block byte with zeros - for (let i = pos; i < blockLen; i++) buffer[i] = 0; - // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that - // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen. - // So we just write lowest 64 bits of that value. - setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE); - this.process(view, 0); - const oview = createView(out); - const len = this.outputLen; - // NOTE: we do division by 4 later, which should be fused in single op with modulo by JIT - if (len % 4) throw new Error('_sha2: outputLen should be aligned to 32bit'); - const outLen = len / 4; - const state = this.get(); - if (outLen > state.length) throw new Error('_sha2: outputLen bigger than state'); - for (let i = 0; i < outLen; i++) oview.setUint32(4 * i, state[i], isLE); - } - digest() { - const { buffer, outputLen } = this; - this.digestInto(buffer); - const res = buffer.slice(0, outputLen); - this.destroy(); - return res; - } - _cloneInto(to?: T): T { - to ||= new (this.constructor as any)() as T; - to.set(...this.get()); - const { blockLen, buffer, length, finished, destroyed, pos } = this; - to.length = length; - to.pos = pos; - to.finished = finished; - to.destroyed = destroyed; - if (length % blockLen) to.buffer.set(buffer); - return to; - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/_u64.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/_u64.ts deleted file mode 100644 index efc55b45..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/_u64.ts +++ /dev/null @@ -1,77 +0,0 @@ -const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1); -const _32n = /* @__PURE__ */ BigInt(32); - -// We are not using BigUint64Array, because they are extremely slow as per 2022 -function fromBig(n: bigint, le = false) { - if (le) return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) }; - return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 }; -} - -function split(lst: bigint[], le = false) { - let Ah = new Uint32Array(lst.length); - let Al = new Uint32Array(lst.length); - for (let i = 0; i < lst.length; i++) { - const { h, l } = fromBig(lst[i], le); - [Ah[i], Al[i]] = [h, l]; - } - return [Ah, Al]; -} - -const toBig = (h: number, l: number) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0); -// for Shift in [0, 32) -const shrSH = (h: number, _l: number, s: number) => h >>> s; -const shrSL = (h: number, l: number, s: number) => (h << (32 - s)) | (l >>> s); -// Right rotate for Shift in [1, 32) -const rotrSH = (h: number, l: number, s: number) => (h >>> s) | (l << (32 - s)); -const rotrSL = (h: number, l: number, s: number) => (h << (32 - s)) | (l >>> s); -// Right rotate for Shift in (32, 64), NOTE: 32 is special case. -const rotrBH = (h: number, l: number, s: number) => (h << (64 - s)) | (l >>> (s - 32)); -const rotrBL = (h: number, l: number, s: number) => (h >>> (s - 32)) | (l << (64 - s)); -// Right rotate for shift===32 (just swaps l&h) -const rotr32H = (_h: number, l: number) => l; -const rotr32L = (h: number, _l: number) => h; -// Left rotate for Shift in [1, 32) -const rotlSH = (h: number, l: number, s: number) => (h << s) | (l >>> (32 - s)); -const rotlSL = (h: number, l: number, s: number) => (l << s) | (h >>> (32 - s)); -// Left rotate for Shift in (32, 64), NOTE: 32 is special case. -const rotlBH = (h: number, l: number, s: number) => (l << (s - 32)) | (h >>> (64 - s)); -const rotlBL = (h: number, l: number, s: number) => (h << (s - 32)) | (l >>> (64 - s)); - -// JS uses 32-bit signed integers for bitwise operations which means we cannot -// simple take carry out of low bit sum by shift, we need to use division. -function add(Ah: number, Al: number, Bh: number, Bl: number) { - const l = (Al >>> 0) + (Bl >>> 0); - return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 }; -} -// Addition with more than 2 elements -const add3L = (Al: number, Bl: number, Cl: number) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); -const add3H = (low: number, Ah: number, Bh: number, Ch: number) => - (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0; -const add4L = (Al: number, Bl: number, Cl: number, Dl: number) => - (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); -const add4H = (low: number, Ah: number, Bh: number, Ch: number, Dh: number) => - (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0; -const add5L = (Al: number, Bl: number, Cl: number, Dl: number, El: number) => - (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); -const add5H = (low: number, Ah: number, Bh: number, Ch: number, Dh: number, Eh: number) => - (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0; - -// prettier-ignore -export { - fromBig, split, toBig, - shrSH, shrSL, - rotrSH, rotrSL, rotrBH, rotrBL, - rotr32H, rotr32L, - rotlSH, rotlSL, rotlBH, rotlBL, - add, add3L, add3H, add4L, add4H, add5H, add5L, -}; -// prettier-ignore -const u64 = { - fromBig, split, toBig, - shrSH, shrSL, - rotrSH, rotrSL, rotrBH, rotrBL, - rotr32H, rotr32L, - rotlSH, rotlSL, rotlBH, rotlBL, - add, add3L, add3H, add4L, add4H, add5H, add5L, -}; -export default u64; diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/argon2.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/argon2.ts deleted file mode 100644 index d727b0f8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/argon2.ts +++ /dev/null @@ -1,374 +0,0 @@ -import { number as assertNumber } from './_assert.js'; -import { Input, toBytes, u8, u32 } from './utils.js'; -import { blake2b } from './blake2b.js'; -import { add3H, add3L, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL } from './_u64.js'; - -// Experimental Argon2 RFC 9106 implementation. It may be removed at any time. -const enum Types { - Argond2d = 0, - Argon2i = 1, - Argon2id = 2, -} - -const ARGON2_SYNC_POINTS = 4; - -const toBytesOptional = (buf?: Input) => (buf !== undefined ? toBytes(buf) : new Uint8Array([])); - -function mul(a: number, b: number) { - const aL = a & 0xffff; - const aH = a >>> 16; - const bL = b & 0xffff; - const bH = b >>> 16; - const ll = Math.imul(aL, bL); - const hl = Math.imul(aH, bL); - const lh = Math.imul(aL, bH); - const hh = Math.imul(aH, bH); - const BUF = ((ll >>> 16) + (hl & 0xffff) + lh) | 0; - const h = ((hl >>> 16) + (BUF >>> 16) + hh) | 0; - return { h, l: (BUF << 16) | (ll & 0xffff) }; -} - -function relPos(areaSize: number, relativePos: number) { - // areaSize - 1 - ((areaSize * ((relativePos ** 2) >>> 32)) >>> 32) - return areaSize - 1 - mul(areaSize, mul(relativePos, relativePos).h).h; -} - -function mul2(a: number, b: number) { - // 2 * a * b (via shifts) - const { h, l } = mul(a, b); - return { h: ((h << 1) | (l >>> 31)) & 0xffff_ffff, l: (l << 1) & 0xffff_ffff }; -} - -function blamka(Ah: number, Al: number, Bh: number, Bl: number) { - const { h: Ch, l: Cl } = mul2(Al, Bl); - // A + B + (2 * A * B) - const Rll = add3L(Al, Bl, Cl); - return { h: add3H(Rll, Ah, Bh, Ch), l: Rll | 0 }; -} - -// Temporary block buffer -const BUF = new Uint32Array(256); - -function G(a: number, b: number, c: number, d: number) { - let Al = BUF[2*a], Ah = BUF[2*a + 1]; // prettier-ignore - let Bl = BUF[2*b], Bh = BUF[2*b + 1]; // prettier-ignore - let Cl = BUF[2*c], Ch = BUF[2*c + 1]; // prettier-ignore - let Dl = BUF[2*d], Dh = BUF[2*d + 1]; // prettier-ignore - - ({ h: Ah, l: Al } = blamka(Ah, Al, Bh, Bl)); - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: rotr32H(Dh, Dl), Dl: rotr32L(Dh, Dl) }); - - ({ h: Ch, l: Cl } = blamka(Ch, Cl, Dh, Dl)); - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: rotrSH(Bh, Bl, 24), Bl: rotrSL(Bh, Bl, 24) }); - - ({ h: Ah, l: Al } = blamka(Ah, Al, Bh, Bl)); - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: rotrSH(Dh, Dl, 16), Dl: rotrSL(Dh, Dl, 16) }); - - ({ h: Ch, l: Cl } = blamka(Ch, Cl, Dh, Dl)); - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: rotrBH(Bh, Bl, 63), Bl: rotrBL(Bh, Bl, 63) }); - - (BUF[2 * a] = Al), (BUF[2 * a + 1] = Ah); - (BUF[2 * b] = Bl), (BUF[2 * b + 1] = Bh); - (BUF[2 * c] = Cl), (BUF[2 * c + 1] = Ch); - (BUF[2 * d] = Dl), (BUF[2 * d + 1] = Dh); -} - -// prettier-ignore -function P( - v00: number, v01: number, v02: number, v03: number, v04: number, v05: number, v06: number, v07: number, - v08: number, v09: number, v10: number, v11: number, v12: number, v13: number, v14: number, v15: number, -) { - G(v00, v04, v08, v12); - G(v01, v05, v09, v13); - G(v02, v06, v10, v14); - G(v03, v07, v11, v15); - G(v00, v05, v10, v15); - G(v01, v06, v11, v12); - G(v02, v07, v08, v13); - G(v03, v04, v09, v14); -} - -function block(x: Uint32Array, xPos: number, yPos: number, outPos: number, needXor: boolean) { - for (let i = 0; i < 256; i++) BUF[i] = x[xPos + i] ^ x[yPos + i]; - - // columns - for (let i = 0; i < 128; i += 16) { - // prettier-ignore - P( - i, i + 1, i + 2, i + 3, i + 4, i + 5, i + 6, i + 7, - i + 8, i + 9, i + 10, i + 11, i + 12, i + 13, i + 14, i + 15 - ); - } - // rows - for (let i = 0; i < 16; i += 2) { - // prettier-ignore - P( - i, i + 1, i + 16, i + 17, i + 32, i + 33, i + 48, i + 49, - i + 64, i + 65, i + 80, i + 81, i + 96, i + 97, i + 112, i + 113 - ); - } - - if (needXor) for (let i = 0; i < 256; i++) x[outPos + i] ^= BUF[i] ^ x[xPos + i] ^ x[yPos + i]; - else for (let i = 0; i < 256; i++) x[outPos + i] = BUF[i] ^ x[xPos + i] ^ x[yPos + i]; -} - -// Variable-Length Hash Function H' -function Hp(A: Uint32Array, dkLen: number) { - const A8 = u8(A); - const T = new Uint32Array(1); - const T8 = u8(T); - T[0] = dkLen; - // Fast path - if (dkLen <= 64) return blake2b.create({ dkLen }).update(T8).update(A8).digest(); - const out = new Uint8Array(dkLen); - let V = blake2b.create({}).update(T8).update(A8).digest(); - let pos = 0; - // First block - out.set(V.subarray(0, 32)); - pos += 32; - // Rest blocks - for (; dkLen - pos > 64; pos += 32) out.set((V = blake2b(V)).subarray(0, 32), pos); - // Last block - out.set(blake2b(V, { dkLen: dkLen - pos }), pos); - return u32(out); -} - -function indexAlpha( - r: number, - s: number, - laneLen: number, - segmentLen: number, - index: number, - randL: number, - sameLane: boolean = false -) { - let area; - if (0 == r) { - if (0 == s) area = index - 1; - else if (sameLane) area = s * segmentLen + index - 1; - else area = s * segmentLen + (index == 0 ? -1 : 0); - } else if (sameLane) area = laneLen - segmentLen + index - 1; - else area = laneLen - segmentLen + (index == 0 ? -1 : 0); - const startPos = r !== 0 && s !== ARGON2_SYNC_POINTS - 1 ? (s + 1) * segmentLen : 0; - const rel = relPos(area, randL); - // NOTE: check about overflows here - // absPos = (startPos + relPos) % laneLength; - return (startPos + rel) % laneLen; -} - -// RFC 9106 -export type ArgonOpts = { - t: number; // Time cost, iterations count - m: number; // Memory cost (in KB) - p: number; // Parallelization parameter - version?: number; // Default: 0x13 (19) - key?: Input; // Optional key - personalization?: Input; // Optional arbitrary extra data - dkLen?: number; // Desired number of returned bytes - asyncTick?: number; // Maximum time in ms for which async function can block execution - maxmem?: number; - onProgress?: (progress: number) => void; -}; - -function argon2Init(type: Types, password: Input, salt: Input, opts: ArgonOpts) { - password = toBytes(password); - salt = toBytes(salt); - let { p, dkLen, m, t, version, key, personalization, maxmem, onProgress } = { - ...opts, - version: opts.version || 0x13, - dkLen: opts.dkLen || 32, - maxmem: 2 ** 32, - }; - // Validation - assertNumber(p); - assertNumber(dkLen); - assertNumber(m); - assertNumber(t); - assertNumber(version); - if (dkLen < 4 || dkLen >= 2 ** 32) throw new Error('Argon2: dkLen should be at least 4 bytes'); - if (p < 1 || p >= 2 ** 32) throw new Error('Argon2: p (parallelism) should be at least 1'); - if (t < 1 || t >= 2 ** 32) throw new Error('Argon2: t (iterations) should be at least 1'); - if (m < 8 * p) throw new Error(`Argon2: memory should be at least 8*p bytes`); - if (version !== 16 && version !== 19) throw new Error(`Argon2: unknown version=${version}`); - password = toBytes(password); - if (password.length < 0 || password.length >= 2 ** 32) - throw new Error('Argon2: password should be less than 4 GB'); - salt = toBytes(salt); - if (salt.length < 8) throw new Error('Argon2: salt should be at least 8 bytes'); - key = toBytesOptional(key); - personalization = toBytesOptional(personalization); - if (onProgress !== undefined && typeof onProgress !== 'function') - throw new Error('progressCb should be function'); - // Params - const lanes = p; - // m' = 4 * p * floor (m / 4p) - const mP = 4 * p * Math.floor(m / (ARGON2_SYNC_POINTS * p)); - //q = m' / p columns - const laneLen = Math.floor(mP / p); - const segmentLen = Math.floor(laneLen / ARGON2_SYNC_POINTS); - // H0 - const h = blake2b.create({}); - const BUF = new Uint32Array(1); - const BUF8 = u8(BUF); - for (const i of [p, dkLen, m, t, version, type]) { - if (i < 0 || i >= 2 ** 32) throw new Error(`Argon2: wrong parameter=${i}, expected uint32`); - BUF[0] = i; - h.update(BUF8); - } - for (let i of [password, salt, key, personalization]) { - BUF[0] = i.length; - h.update(BUF8).update(i); - } - const H0 = new Uint32Array(18); - const H0_8 = u8(H0); - h.digestInto(H0_8); - - // 256 u32 = 1024 (BLOCK_SIZE) - const memUsed = mP * 256; - if (memUsed < 0 || memUsed >= 2 ** 32 || memUsed > maxmem) { - throw new Error( - `Argon2: wrong params (memUsed=${memUsed} maxmem=${maxmem}), should be less than 2**32` - ); - } - const B = new Uint32Array(memUsed); - // Fill first blocks - for (let l = 0; l < p; l++) { - const i = 256 * laneLen * l; - // B[i][0] = H'^(1024)(H_0 || LE32(0) || LE32(i)) - H0[17] = l; - H0[16] = 0; - B.set(Hp(H0, 1024), i); - // B[i][1] = H'^(1024)(H_0 || LE32(1) || LE32(i)) - H0[16] = 1; - B.set(Hp(H0, 1024), i + 256); - } - let perBlock = () => {}; - if (onProgress) { - const totalBlock = t * ARGON2_SYNC_POINTS * p * segmentLen; - // Invoke callback if progress changes from 10.01 to 10.02 - // Allows to draw smooth progress bar on up to 8K screen - const callbackPer = Math.max(Math.floor(totalBlock / 10000), 1); - let blockCnt = 0; - perBlock = () => { - blockCnt++; - if (onProgress && (!(blockCnt % callbackPer) || blockCnt === totalBlock)) - onProgress(blockCnt / totalBlock); - }; - } - return { type, mP, p, t, version, B, laneLen, lanes, segmentLen, dkLen, perBlock }; -} - -function argon2Output(B: Uint32Array, p: number, laneLen: number, dkLen: number) { - const B_final = new Uint32Array(256); - for (let l = 0; l < p; l++) - for (let j = 0; j < 256; j++) B_final[j] ^= B[256 * (laneLen * l + laneLen - 1) + j]; - return u8(Hp(B_final, dkLen)); -} - -function processBlock( - B: Uint32Array, - address: Uint32Array, - l: number, - r: number, - s: number, - index: number, - laneLen: number, - segmentLen: number, - lanes: number, - offset: number, - prev: number, - dataIndependent: boolean, - needXor: boolean -) { - if (offset % laneLen) prev = offset - 1; - let randL, randH; - if (dataIndependent) { - if (index % 128 === 0) { - address[256 + 12]++; - block(address, 256, 2 * 256, 0, false); - block(address, 0, 2 * 256, 0, false); - } - randL = address[2 * (index % 128)]; - randH = address[2 * (index % 128) + 1]; - } else { - const T = 256 * prev; - randL = B[T]; - randH = B[T + 1]; - } - // address block - const refLane = r === 0 && s === 0 ? l : randH % lanes; - const refPos = indexAlpha(r, s, laneLen, segmentLen, index, randL, refLane == l); - const refBlock = laneLen * refLane + refPos; - // B[i][j] = G(B[i][j-1], B[l][z]) - block(B, 256 * prev, 256 * refBlock, offset * 256, needXor); -} - -function argon2(type: Types, password: Input, salt: Input, opts: ArgonOpts) { - const { mP, p, t, version, B, laneLen, lanes, segmentLen, dkLen, perBlock } = argon2Init( - type, - password, - salt, - opts - ); - // Pre-loop setup - // [address, input, zero_block] format so we can pass single U32 to block function - const address = new Uint32Array(3 * 256); - address[256 + 6] = mP; - address[256 + 8] = t; - address[256 + 10] = type; - for (let r = 0; r < t; r++) { - const needXor = r !== 0 && version === 0x13; - address[256 + 0] = r; - for (let s = 0; s < ARGON2_SYNC_POINTS; s++) { - address[256 + 4] = s; - const dataIndependent = type == Types.Argon2i || (type == Types.Argon2id && r === 0 && s < 2); - for (let l = 0; l < p; l++) { - address[256 + 2] = l; - address[256 + 12] = 0; - let startPos = 0; - if (r === 0 && s === 0) { - startPos = 2; - if (dataIndependent) { - address[256 + 12]++; - block(address, 256, 2 * 256, 0, false); - block(address, 0, 2 * 256, 0, false); - } - } - // current block postion - let offset = l * laneLen + s * segmentLen + startPos; - // previous block position - let prev = offset % laneLen ? offset - 1 : offset + laneLen - 1; - for (let index = startPos; index < segmentLen; index++, offset++, prev++) { - perBlock(); - processBlock( - B, - address, - l, - r, - s, - index, - laneLen, - segmentLen, - lanes, - offset, - prev, - dataIndependent, - needXor - ); - } - } - } - } - return argon2Output(B, p, laneLen, dkLen); -} - -export const argon2d = (password: Input, salt: Input, opts: ArgonOpts) => - argon2(Types.Argond2d, password, salt, opts); -export const argon2i = (password: Input, salt: Input, opts: ArgonOpts) => - argon2(Types.Argon2i, password, salt, opts); -export const argon2id = (password: Input, salt: Input, opts: ArgonOpts) => - argon2(Types.Argon2id, password, salt, opts); diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/blake2b.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/blake2b.ts deleted file mode 100644 index 57847424..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/blake2b.ts +++ /dev/null @@ -1,205 +0,0 @@ -import { BLAKE2, BlakeOpts, SIGMA } from './_blake2.js'; -import u64 from './_u64.js'; -import { toBytes, u32, wrapConstructorWithOpts } from './utils.js'; - -// Same as SHA-512 but LE -// prettier-ignore -const IV = /* @__PURE__ */ new Uint32Array([ - 0xf3bcc908, 0x6a09e667, 0x84caa73b, 0xbb67ae85, 0xfe94f82b, 0x3c6ef372, 0x5f1d36f1, 0xa54ff53a, - 0xade682d1, 0x510e527f, 0x2b3e6c1f, 0x9b05688c, 0xfb41bd6b, 0x1f83d9ab, 0x137e2179, 0x5be0cd19 -]); -// Temporary buffer -const BUF = /* @__PURE__ */ new Uint32Array(32); - -// Mixing function G splitted in two halfs -function G1(a: number, b: number, c: number, d: number, msg: Uint32Array, x: number) { - // NOTE: V is LE here - const Xl = msg[x], Xh = msg[x + 1]; // prettier-ignore - let Al = BUF[2 * a], Ah = BUF[2 * a + 1]; // prettier-ignore - let Bl = BUF[2 * b], Bh = BUF[2 * b + 1]; // prettier-ignore - let Cl = BUF[2 * c], Ch = BUF[2 * c + 1]; // prettier-ignore - let Dl = BUF[2 * d], Dh = BUF[2 * d + 1]; // prettier-ignore - // v[a] = (v[a] + v[b] + x) | 0; - let ll = u64.add3L(Al, Bl, Xl); - Ah = u64.add3H(ll, Ah, Bh, Xh); - Al = ll | 0; - // v[d] = rotr(v[d] ^ v[a], 32) - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: u64.rotr32H(Dh, Dl), Dl: u64.rotr32L(Dh, Dl) }); - // v[c] = (v[c] + v[d]) | 0; - ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); - // v[b] = rotr(v[b] ^ v[c], 24) - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: u64.rotrSH(Bh, Bl, 24), Bl: u64.rotrSL(Bh, Bl, 24) }); - (BUF[2 * a] = Al), (BUF[2 * a + 1] = Ah); - (BUF[2 * b] = Bl), (BUF[2 * b + 1] = Bh); - (BUF[2 * c] = Cl), (BUF[2 * c + 1] = Ch); - (BUF[2 * d] = Dl), (BUF[2 * d + 1] = Dh); -} - -function G2(a: number, b: number, c: number, d: number, msg: Uint32Array, x: number) { - // NOTE: V is LE here - const Xl = msg[x], Xh = msg[x + 1]; // prettier-ignore - let Al = BUF[2 * a], Ah = BUF[2 * a + 1]; // prettier-ignore - let Bl = BUF[2 * b], Bh = BUF[2 * b + 1]; // prettier-ignore - let Cl = BUF[2 * c], Ch = BUF[2 * c + 1]; // prettier-ignore - let Dl = BUF[2 * d], Dh = BUF[2 * d + 1]; // prettier-ignore - // v[a] = (v[a] + v[b] + x) | 0; - let ll = u64.add3L(Al, Bl, Xl); - Ah = u64.add3H(ll, Ah, Bh, Xh); - Al = ll | 0; - // v[d] = rotr(v[d] ^ v[a], 16) - ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); - ({ Dh, Dl } = { Dh: u64.rotrSH(Dh, Dl, 16), Dl: u64.rotrSL(Dh, Dl, 16) }); - // v[c] = (v[c] + v[d]) | 0; - ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); - // v[b] = rotr(v[b] ^ v[c], 63) - ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); - ({ Bh, Bl } = { Bh: u64.rotrBH(Bh, Bl, 63), Bl: u64.rotrBL(Bh, Bl, 63) }); - (BUF[2 * a] = Al), (BUF[2 * a + 1] = Ah); - (BUF[2 * b] = Bl), (BUF[2 * b + 1] = Bh); - (BUF[2 * c] = Cl), (BUF[2 * c + 1] = Ch); - (BUF[2 * d] = Dl), (BUF[2 * d + 1] = Dh); -} - -class BLAKE2b extends BLAKE2 { - // Same as SHA-512, but LE - private v0l = IV[0] | 0; - private v0h = IV[1] | 0; - private v1l = IV[2] | 0; - private v1h = IV[3] | 0; - private v2l = IV[4] | 0; - private v2h = IV[5] | 0; - private v3l = IV[6] | 0; - private v3h = IV[7] | 0; - private v4l = IV[8] | 0; - private v4h = IV[9] | 0; - private v5l = IV[10] | 0; - private v5h = IV[11] | 0; - private v6l = IV[12] | 0; - private v6h = IV[13] | 0; - private v7l = IV[14] | 0; - private v7h = IV[15] | 0; - - constructor(opts: BlakeOpts = {}) { - super(128, opts.dkLen === undefined ? 64 : opts.dkLen, opts, 64, 16, 16); - const keyLength = opts.key ? opts.key.length : 0; - this.v0l ^= this.outputLen | (keyLength << 8) | (0x01 << 16) | (0x01 << 24); - if (opts.salt) { - const salt = u32(toBytes(opts.salt)); - this.v4l ^= salt[0]; - this.v4h ^= salt[1]; - this.v5l ^= salt[2]; - this.v5h ^= salt[3]; - } - if (opts.personalization) { - const pers = u32(toBytes(opts.personalization)); - this.v6l ^= pers[0]; - this.v6h ^= pers[1]; - this.v7l ^= pers[2]; - this.v7h ^= pers[3]; - } - if (opts.key) { - // Pad to blockLen and update - const tmp = new Uint8Array(this.blockLen); - tmp.set(toBytes(opts.key)); - this.update(tmp); - } - } - // prettier-ignore - protected get(): [ - number, number, number, number, number, number, number, number, - number, number, number, number, number, number, number, number - ] { - let {v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h} = this; - return [v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h]; - } - // prettier-ignore - protected set( - v0l: number, v0h: number, v1l: number, v1h: number, - v2l: number, v2h: number, v3l: number, v3h: number, - v4l: number, v4h: number, v5l: number, v5h: number, - v6l: number, v6h: number, v7l: number, v7h: number - ) { - this.v0l = v0l | 0; - this.v0h = v0h | 0; - this.v1l = v1l | 0; - this.v1h = v1h | 0; - this.v2l = v2l | 0; - this.v2h = v2h | 0; - this.v3l = v3l | 0; - this.v3h = v3h | 0; - this.v4l = v4l | 0; - this.v4h = v4h | 0; - this.v5l = v5l | 0; - this.v5h = v5h | 0; - this.v6l = v6l | 0; - this.v6h = v6h | 0; - this.v7l = v7l | 0; - this.v7h = v7h | 0; - } - protected compress(msg: Uint32Array, offset: number, isLast: boolean) { - this.get().forEach((v, i) => (BUF[i] = v)); // First half from state. - BUF.set(IV, 16); // Second half from IV. - let { h, l } = u64.fromBig(BigInt(this.length)); - BUF[24] = IV[8] ^ l; // Low word of the offset. - BUF[25] = IV[9] ^ h; // High word. - // Invert all bits for last block - if (isLast) { - BUF[28] = ~BUF[28]; - BUF[29] = ~BUF[29]; - } - let j = 0; - const s = SIGMA; - for (let i = 0; i < 12; i++) { - G1(0, 4, 8, 12, msg, offset + 2 * s[j++]); - G2(0, 4, 8, 12, msg, offset + 2 * s[j++]); - G1(1, 5, 9, 13, msg, offset + 2 * s[j++]); - G2(1, 5, 9, 13, msg, offset + 2 * s[j++]); - G1(2, 6, 10, 14, msg, offset + 2 * s[j++]); - G2(2, 6, 10, 14, msg, offset + 2 * s[j++]); - G1(3, 7, 11, 15, msg, offset + 2 * s[j++]); - G2(3, 7, 11, 15, msg, offset + 2 * s[j++]); - - G1(0, 5, 10, 15, msg, offset + 2 * s[j++]); - G2(0, 5, 10, 15, msg, offset + 2 * s[j++]); - G1(1, 6, 11, 12, msg, offset + 2 * s[j++]); - G2(1, 6, 11, 12, msg, offset + 2 * s[j++]); - G1(2, 7, 8, 13, msg, offset + 2 * s[j++]); - G2(2, 7, 8, 13, msg, offset + 2 * s[j++]); - G1(3, 4, 9, 14, msg, offset + 2 * s[j++]); - G2(3, 4, 9, 14, msg, offset + 2 * s[j++]); - } - this.v0l ^= BUF[0] ^ BUF[16]; - this.v0h ^= BUF[1] ^ BUF[17]; - this.v1l ^= BUF[2] ^ BUF[18]; - this.v1h ^= BUF[3] ^ BUF[19]; - this.v2l ^= BUF[4] ^ BUF[20]; - this.v2h ^= BUF[5] ^ BUF[21]; - this.v3l ^= BUF[6] ^ BUF[22]; - this.v3h ^= BUF[7] ^ BUF[23]; - this.v4l ^= BUF[8] ^ BUF[24]; - this.v4h ^= BUF[9] ^ BUF[25]; - this.v5l ^= BUF[10] ^ BUF[26]; - this.v5h ^= BUF[11] ^ BUF[27]; - this.v6l ^= BUF[12] ^ BUF[28]; - this.v6h ^= BUF[13] ^ BUF[29]; - this.v7l ^= BUF[14] ^ BUF[30]; - this.v7h ^= BUF[15] ^ BUF[31]; - BUF.fill(0); - } - destroy() { - this.destroyed = true; - this.buffer32.fill(0); - this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - } -} - -/** - * BLAKE2b - optimized for 64-bit platforms. JS doesn't have uint64, so it's slower than BLAKE2s. - * @param msg - message that would be hashed - * @param opts - dkLen, key, salt, personalization - */ -export const blake2b = /* @__PURE__ */ wrapConstructorWithOpts( - (opts) => new BLAKE2b(opts) -); diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/blake2s.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/blake2s.ts deleted file mode 100644 index a6098861..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/blake2s.ts +++ /dev/null @@ -1,136 +0,0 @@ -import { BLAKE2, BlakeOpts, SIGMA } from './_blake2.js'; -import { fromBig } from './_u64.js'; -import { rotr, toBytes, wrapConstructorWithOpts, u32 } from './utils.js'; - -// Initial state: -// first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19) -// same as SHA-256 -// prettier-ignore -export const IV = /* @__PURE__ */new Uint32Array([0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19]); - -// Mixing function G splitted in two halfs -function G1(a: number, b: number, c: number, d: number, x: number) { - a = (a + b + x) | 0; - d = rotr(d ^ a, 16); - c = (c + d) | 0; - b = rotr(b ^ c, 12); - return { a, b, c, d }; -} - -function G2(a: number, b: number, c: number, d: number, x: number) { - a = (a + b + x) | 0; - d = rotr(d ^ a, 8); - c = (c + d) | 0; - b = rotr(b ^ c, 7); - return { a, b, c, d }; -} -// prettier-ignore -export function compress(s: Uint8Array, offset: number, msg: Uint32Array, rounds: number, - v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, - v8: number, v9: number, v10: number, v11: number, v12: number, v13: number, v14: number, v15: number, -) { - let j = 0; - for (let i = 0; i < rounds; i++) { - ({ a: v0, b: v4, c: v8, d: v12 } = G1(v0, v4, v8, v12, msg[offset + s[j++]])); - ({ a: v0, b: v4, c: v8, d: v12 } = G2(v0, v4, v8, v12, msg[offset + s[j++]])); - ({ a: v1, b: v5, c: v9, d: v13 } = G1(v1, v5, v9, v13, msg[offset + s[j++]])); - ({ a: v1, b: v5, c: v9, d: v13 } = G2(v1, v5, v9, v13, msg[offset + s[j++]])); - ({ a: v2, b: v6, c: v10, d: v14 } = G1(v2, v6, v10, v14, msg[offset + s[j++]])); - ({ a: v2, b: v6, c: v10, d: v14 } = G2(v2, v6, v10, v14, msg[offset + s[j++]])); - ({ a: v3, b: v7, c: v11, d: v15 } = G1(v3, v7, v11, v15, msg[offset + s[j++]])); - ({ a: v3, b: v7, c: v11, d: v15 } = G2(v3, v7, v11, v15, msg[offset + s[j++]])); - - ({ a: v0, b: v5, c: v10, d: v15 } = G1(v0, v5, v10, v15, msg[offset + s[j++]])); - ({ a: v0, b: v5, c: v10, d: v15 } = G2(v0, v5, v10, v15, msg[offset + s[j++]])); - ({ a: v1, b: v6, c: v11, d: v12 } = G1(v1, v6, v11, v12, msg[offset + s[j++]])); - ({ a: v1, b: v6, c: v11, d: v12 } = G2(v1, v6, v11, v12, msg[offset + s[j++]])); - ({ a: v2, b: v7, c: v8, d: v13 } = G1(v2, v7, v8, v13, msg[offset + s[j++]])); - ({ a: v2, b: v7, c: v8, d: v13 } = G2(v2, v7, v8, v13, msg[offset + s[j++]])); - ({ a: v3, b: v4, c: v9, d: v14 } = G1(v3, v4, v9, v14, msg[offset + s[j++]])); - ({ a: v3, b: v4, c: v9, d: v14 } = G2(v3, v4, v9, v14, msg[offset + s[j++]])); - } - return { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 }; -} - -class BLAKE2s extends BLAKE2 { - // Internal state, same as SHA-256 - private v0 = IV[0] | 0; - private v1 = IV[1] | 0; - private v2 = IV[2] | 0; - private v3 = IV[3] | 0; - private v4 = IV[4] | 0; - private v5 = IV[5] | 0; - private v6 = IV[6] | 0; - private v7 = IV[7] | 0; - - constructor(opts: BlakeOpts = {}) { - super(64, opts.dkLen === undefined ? 32 : opts.dkLen, opts, 32, 8, 8); - const keyLength = opts.key ? opts.key.length : 0; - this.v0 ^= this.outputLen | (keyLength << 8) | (0x01 << 16) | (0x01 << 24); - if (opts.salt) { - const salt = u32(toBytes(opts.salt)); - this.v4 ^= salt[0]; - this.v5 ^= salt[1]; - } - if (opts.personalization) { - const pers = u32(toBytes(opts.personalization)); - this.v6 ^= pers[0]; - this.v7 ^= pers[1]; - } - if (opts.key) { - // Pad to blockLen and update - const tmp = new Uint8Array(this.blockLen); - tmp.set(toBytes(opts.key)); - this.update(tmp); - } - } - protected get(): [number, number, number, number, number, number, number, number] { - const { v0, v1, v2, v3, v4, v5, v6, v7 } = this; - return [v0, v1, v2, v3, v4, v5, v6, v7]; - } - // prettier-ignore - protected set( - v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number - ) { - this.v0 = v0 | 0; - this.v1 = v1 | 0; - this.v2 = v2 | 0; - this.v3 = v3 | 0; - this.v4 = v4 | 0; - this.v5 = v5 | 0; - this.v6 = v6 | 0; - this.v7 = v7 | 0; - } - protected compress(msg: Uint32Array, offset: number, isLast: boolean) { - const { h, l } = fromBig(BigInt(this.length)); - // prettier-ignore - const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = - compress( - SIGMA, offset, msg, 10, - this.v0, this.v1, this.v2, this.v3, this.v4, this.v5, this.v6, this.v7, - IV[0], IV[1], IV[2], IV[3], l ^ IV[4], h ^ IV[5], isLast ? ~IV[6] : IV[6], IV[7] - ); - this.v0 ^= v0 ^ v8; - this.v1 ^= v1 ^ v9; - this.v2 ^= v2 ^ v10; - this.v3 ^= v3 ^ v11; - this.v4 ^= v4 ^ v12; - this.v5 ^= v5 ^ v13; - this.v6 ^= v6 ^ v14; - this.v7 ^= v7 ^ v15; - } - destroy() { - this.destroyed = true; - this.buffer32.fill(0); - this.set(0, 0, 0, 0, 0, 0, 0, 0); - } -} - -/** - * BLAKE2s - optimized for 32-bit platforms. JS doesn't have uint64, so it's faster than BLAKE2b. - * @param msg - message that would be hashed - * @param opts - dkLen, key, salt, personalization - */ -export const blake2s = /* @__PURE__ */ wrapConstructorWithOpts( - (opts) => new BLAKE2s(opts) -); diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/blake3.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/blake3.ts deleted file mode 100644 index 01d7d544..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/blake3.ts +++ /dev/null @@ -1,250 +0,0 @@ -import { bytes, exists, number, output } from './_assert.js'; -import { fromBig } from './_u64.js'; -import { BLAKE2 } from './_blake2.js'; -import { compress, IV } from './blake2s.js'; -import { Input, u8, u32, toBytes, HashXOF, wrapXOFConstructorWithOpts } from './utils.js'; - -// Blake3 is single-option Blake2 with reduced security (round count). - -// Flag bitset -const enum Flags { - CHUNK_START = 1 << 0, - CHUNK_END = 1 << 1, - PARENT = 1 << 2, - ROOT = 1 << 3, - KEYED_HASH = 1 << 4, - DERIVE_KEY_CONTEXT = 1 << 5, - DERIVE_KEY_MATERIAL = 1 << 6, -} - -const SIGMA: Uint8Array = /* @__PURE__ */ (() => { - const Id = Array.from({ length: 16 }, (_, i) => i); - const permute = (arr: number[]) => - [2, 6, 3, 10, 7, 0, 4, 13, 1, 11, 12, 5, 9, 14, 15, 8].map((i) => arr[i]); - const res: number[] = []; - for (let i = 0, v = Id; i < 7; i++, v = permute(v)) res.push(...v); - return Uint8Array.from(res); -})(); - -// - key: is 256-bit key -// - context: string should be hardcoded, globally unique, and application - specific. -// A good default format for the context string is "[application] [commit timestamp] [purpose]" -// - Only one of 'key' (keyed mode) or 'context' (derive key mode) can be used at same time -export type Blake3Opts = { dkLen?: number; key?: Input; context?: Input }; - -// Why is this so slow? It should be 6x faster than blake2b. -// - There is only 30% reduction in number of rounds from blake2s -// - This function uses tree mode to achive parallelisation via SIMD and threading, -// however in JS we don't have threads and SIMD, so we get only overhead from tree structure -// - It is possible to speed it up via Web Workers, hovewer it will make code singnificantly more -// complicated, which we are trying to avoid, since this library is intended to be used -// for cryptographic purposes. Also, parallelization happens only on chunk level (1024 bytes), -// which won't really benefit small inputs. -class BLAKE3 extends BLAKE2 implements HashXOF { - private IV: Uint32Array; - private flags = 0 | 0; - private state: Uint32Array; - private chunkPos = 0; // Position of current block in chunk - private chunksDone = 0; // How many chunks we already have - private stack: Uint32Array[] = []; - // Output - private posOut = 0; - private bufferOut32 = new Uint32Array(16); - private bufferOut: Uint8Array; - private chunkOut = 0; // index of output chunk - private enableXOF = true; - - constructor(opts: Blake3Opts = {}, flags = 0) { - super(64, opts.dkLen === undefined ? 32 : opts.dkLen, {}, Number.MAX_SAFE_INTEGER, 0, 0); - this.outputLen = opts.dkLen === undefined ? 32 : opts.dkLen; - number(this.outputLen); - if (opts.key !== undefined && opts.context !== undefined) - throw new Error('Blake3: only key or context can be specified at same time'); - else if (opts.key !== undefined) { - const key = toBytes(opts.key).slice(); - if (key.length !== 32) throw new Error('Blake3: key should be 32 byte'); - this.IV = u32(key); - this.flags = flags | Flags.KEYED_HASH; - } else if (opts.context !== undefined) { - const context_key = new BLAKE3({ dkLen: 32 }, Flags.DERIVE_KEY_CONTEXT) - .update(opts.context) - .digest(); - this.IV = u32(context_key); - this.flags = flags | Flags.DERIVE_KEY_MATERIAL; - } else { - this.IV = IV.slice(); - this.flags = flags; - } - this.state = this.IV.slice(); - this.bufferOut = u8(this.bufferOut32); - } - // Unused - protected get() { - return []; - } - protected set() {} - private b2Compress(counter: number, flags: number, buf: Uint32Array, bufPos: number = 0) { - const { state: s, pos } = this; - const { h, l } = fromBig(BigInt(counter), true); - // prettier-ignore - const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = - compress( - SIGMA, bufPos, buf, 7, - s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], - IV[0], IV[1], IV[2], IV[3], h, l, pos, flags - ); - s[0] = v0 ^ v8; - s[1] = v1 ^ v9; - s[2] = v2 ^ v10; - s[3] = v3 ^ v11; - s[4] = v4 ^ v12; - s[5] = v5 ^ v13; - s[6] = v6 ^ v14; - s[7] = v7 ^ v15; - } - protected compress(buf: Uint32Array, bufPos: number = 0, isLast: boolean = false) { - // Compress last block - let flags = this.flags; - if (!this.chunkPos) flags |= Flags.CHUNK_START; - if (this.chunkPos === 15 || isLast) flags |= Flags.CHUNK_END; - if (!isLast) this.pos = this.blockLen; - this.b2Compress(this.chunksDone, flags, buf, bufPos); - this.chunkPos += 1; - // If current block is last in chunk (16 blocks), then compress chunks - if (this.chunkPos === 16 || isLast) { - let chunk = this.state; - this.state = this.IV.slice(); - // If not the last one, compress only when there are trailing zeros in chunk counter - // chunks used as binary tree where current stack is path. Zero means current leaf is finished and can be compressed. - // 1 (001) - leaf not finished (just push current chunk to stack) - // 2 (010) - leaf finished at depth=1 (merge with last elm on stack and push back) - // 3 (011) - last leaf not finished - // 4 (100) - leafs finished at depth=1 and depth=2 - for (let last, chunks = this.chunksDone + 1; isLast || !(chunks & 1); chunks >>= 1) { - if (!(last = this.stack.pop())) break; - this.buffer32.set(last, 0); - this.buffer32.set(chunk, 8); - this.pos = this.blockLen; - this.b2Compress(0, this.flags | Flags.PARENT, this.buffer32, 0); - chunk = this.state; - this.state = this.IV.slice(); - } - this.chunksDone++; - this.chunkPos = 0; - this.stack.push(chunk); - } - this.pos = 0; - } - _cloneInto(to?: BLAKE3): BLAKE3 { - to = super._cloneInto(to) as BLAKE3; - const { IV, flags, state, chunkPos, posOut, chunkOut, stack, chunksDone } = this; - to.state.set(state.slice()); - to.stack = stack.map((i) => Uint32Array.from(i)); - to.IV.set(IV); - to.flags = flags; - to.chunkPos = chunkPos; - to.chunksDone = chunksDone; - to.posOut = posOut; - to.chunkOut = chunkOut; - to.enableXOF = this.enableXOF; - to.bufferOut32.set(this.bufferOut32); - return to; - } - destroy() { - this.destroyed = true; - this.state.fill(0); - this.buffer32.fill(0); - this.IV.fill(0); - this.bufferOut32.fill(0); - for (let i of this.stack) i.fill(0); - } - // Same as b2Compress, but doesn't modify state and returns 16 u32 array (instead of 8) - private b2CompressOut() { - const { state: s, pos, flags, buffer32, bufferOut32: out32 } = this; - const { h, l } = fromBig(BigInt(this.chunkOut++)); - // prettier-ignore - const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = - compress( - SIGMA, 0, buffer32, 7, - s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], - IV[0], IV[1], IV[2], IV[3], l, h, pos, flags - ); - out32[0] = v0 ^ v8; - out32[1] = v1 ^ v9; - out32[2] = v2 ^ v10; - out32[3] = v3 ^ v11; - out32[4] = v4 ^ v12; - out32[5] = v5 ^ v13; - out32[6] = v6 ^ v14; - out32[7] = v7 ^ v15; - out32[8] = s[0] ^ v8; - out32[9] = s[1] ^ v9; - out32[10] = s[2] ^ v10; - out32[11] = s[3] ^ v11; - out32[12] = s[4] ^ v12; - out32[13] = s[5] ^ v13; - out32[14] = s[6] ^ v14; - out32[15] = s[7] ^ v15; - this.posOut = 0; - } - protected finish() { - if (this.finished) return; - this.finished = true; - // Padding - this.buffer.fill(0, this.pos); - // Process last chunk - let flags = this.flags | Flags.ROOT; - if (this.stack.length) { - flags |= Flags.PARENT; - this.compress(this.buffer32, 0, true); - this.chunksDone = 0; - this.pos = this.blockLen; - } else { - flags |= (!this.chunkPos ? Flags.CHUNK_START : 0) | Flags.CHUNK_END; - } - this.flags = flags; - this.b2CompressOut(); - } - private writeInto(out: Uint8Array) { - exists(this, false); - bytes(out); - this.finish(); - const { blockLen, bufferOut } = this; - for (let pos = 0, len = out.length; pos < len; ) { - if (this.posOut >= blockLen) this.b2CompressOut(); - const take = Math.min(blockLen - this.posOut, len - pos); - out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); - this.posOut += take; - pos += take; - } - return out; - } - xofInto(out: Uint8Array): Uint8Array { - if (!this.enableXOF) throw new Error('XOF is not possible after digest call'); - return this.writeInto(out); - } - xof(bytes: number): Uint8Array { - number(bytes); - return this.xofInto(new Uint8Array(bytes)); - } - digestInto(out: Uint8Array) { - output(out, this); - if (this.finished) throw new Error('digest() was already called'); - this.enableXOF = false; - this.writeInto(out); - this.destroy(); - return out; - } - digest() { - return this.digestInto(new Uint8Array(this.outputLen)); - } -} - -/** - * BLAKE3 hash function. - * @param msg - message that would be hashed - * @param opts - dkLen, key, context - */ -export const blake3 = /* @__PURE__ */ wrapXOFConstructorWithOpts( - (opts) => new BLAKE3(opts) -); diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/crypto.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/crypto.ts deleted file mode 100644 index eaea6bef..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/crypto.ts +++ /dev/null @@ -1,5 +0,0 @@ -// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+. -// See utils.ts for details. -declare const globalThis: Record | undefined; -export const crypto = - typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined; diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/cryptoNode.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/cryptoNode.ts deleted file mode 100644 index 6fdba9ec..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/cryptoNode.ts +++ /dev/null @@ -1,7 +0,0 @@ -// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+. -// See utils.ts for details. -// The file will throw on node.js 14 and earlier. -// @ts-ignore -import * as nc from 'node:crypto'; -export const crypto = - nc && typeof nc === 'object' && 'webcrypto' in nc ? (nc.webcrypto as any) : undefined; diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/eskdf.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/eskdf.ts deleted file mode 100644 index b4c224b1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/eskdf.ts +++ /dev/null @@ -1,183 +0,0 @@ -import { bytes as assertBytes } from './_assert.js'; -import { hkdf } from './hkdf.js'; -import { sha256 } from './sha256.js'; -import { pbkdf2 as _pbkdf2 } from './pbkdf2.js'; -import { scrypt as _scrypt } from './scrypt.js'; -import { bytesToHex, createView, hexToBytes, toBytes } from './utils.js'; - -// A tiny KDF for various applications like AES key-gen. -// Uses HKDF in a non-standard way, so it's not "KDF-secure", only "PRF-secure". -// Which is good enough: assume sha2-256 retained preimage resistance. - -const SCRYPT_FACTOR = 2 ** 19; -const PBKDF2_FACTOR = 2 ** 17; - -// Scrypt KDF -export function scrypt(password: string, salt: string): Uint8Array { - return _scrypt(password, salt, { N: SCRYPT_FACTOR, r: 8, p: 1, dkLen: 32 }); -} - -// PBKDF2-HMAC-SHA256 -export function pbkdf2(password: string, salt: string): Uint8Array { - return _pbkdf2(sha256, password, salt, { c: PBKDF2_FACTOR, dkLen: 32 }); -} - -// Combines two 32-byte byte arrays -function xor32(a: Uint8Array, b: Uint8Array): Uint8Array { - assertBytes(a, 32); - assertBytes(b, 32); - const arr = new Uint8Array(32); - for (let i = 0; i < 32; i++) { - arr[i] = a[i] ^ b[i]; - } - return arr; -} - -function strHasLength(str: string, min: number, max: number): boolean { - return typeof str === 'string' && str.length >= min && str.length <= max; -} - -/** - * Derives main seed. Takes a lot of time. Prefer `eskdf` method instead. - */ -export function deriveMainSeed(username: string, password: string): Uint8Array { - if (!strHasLength(username, 8, 255)) throw new Error('invalid username'); - if (!strHasLength(password, 8, 255)) throw new Error('invalid password'); - const scr = scrypt(password + '\u{1}', username + '\u{1}'); - const pbk = pbkdf2(password + '\u{2}', username + '\u{2}'); - const res = xor32(scr, pbk); - scr.fill(0); - pbk.fill(0); - return res; -} - -type AccountID = number | string; - -/** - * Converts protocol & accountId pair to HKDF salt & info params. - */ -function getSaltInfo(protocol: string, accountId: AccountID = 0) { - // Note that length here also repeats two lines below - // We do an additional length check here to reduce the scope of DoS attacks - if (!(strHasLength(protocol, 3, 15) && /^[a-z0-9]{3,15}$/.test(protocol))) { - throw new Error('invalid protocol'); - } - - // Allow string account ids for some protocols - const allowsStr = /^password\d{0,3}|ssh|tor|file$/.test(protocol); - let salt: Uint8Array; // Extract salt. Default is undefined. - if (typeof accountId === 'string') { - if (!allowsStr) throw new Error('accountId must be a number'); - if (!strHasLength(accountId, 1, 255)) throw new Error('accountId must be valid string'); - salt = toBytes(accountId); - } else if (Number.isSafeInteger(accountId)) { - if (accountId < 0 || accountId > 2 ** 32 - 1) throw new Error('invalid accountId'); - // Convert to Big Endian Uint32 - salt = new Uint8Array(4); - createView(salt).setUint32(0, accountId, false); - } else { - throw new Error(`accountId must be a number${allowsStr ? ' or string' : ''}`); - } - const info = toBytes(protocol); - return { salt, info }; -} - -type OptsLength = { keyLength: number }; -type OptsMod = { modulus: bigint }; -type KeyOpts = undefined | OptsLength | OptsMod; - -function countBytes(num: bigint): number { - if (typeof num !== 'bigint' || num <= BigInt(128)) throw new Error('invalid number'); - return Math.ceil(num.toString(2).length / 8); -} - -/** - * Parses keyLength and modulus options to extract length of result key. - * If modulus is used, adds 64 bits to it as per FIPS 186 B.4.1 to combat modulo bias. - */ -function getKeyLength(options: KeyOpts): number { - if (!options || typeof options !== 'object') return 32; - const hasLen = 'keyLength' in options; - const hasMod = 'modulus' in options; - if (hasLen && hasMod) throw new Error('cannot combine keyLength and modulus options'); - if (!hasLen && !hasMod) throw new Error('must have either keyLength or modulus option'); - // FIPS 186 B.4.1 requires at least 64 more bits - const l = hasMod ? countBytes(options.modulus) + 8 : options.keyLength; - if (!(typeof l === 'number' && l >= 16 && l <= 8192)) throw new Error('invalid keyLength'); - return l; -} - -/** - * Converts key to bigint and divides it by modulus. Big Endian. - * Implements FIPS 186 B.4.1, which removes 0 and modulo bias from output. - */ -function modReduceKey(key: Uint8Array, modulus: bigint): Uint8Array { - const _1 = BigInt(1); - const num = BigInt('0x' + bytesToHex(key)); // check for ui8a, then bytesToNumber() - const res = (num % (modulus - _1)) + _1; // Remove 0 from output - if (res < _1) throw new Error('expected positive number'); // Guard against bad values - const len = key.length - 8; // FIPS requires 64 more bits = 8 bytes - const hex = res.toString(16).padStart(len * 2, '0'); // numberToHex() - const bytes = hexToBytes(hex); - if (bytes.length !== len) throw new Error('invalid length of result key'); - return bytes; -} - -// We are not using classes because constructor cannot be async -type ESKDF = Promise< - Readonly<{ - /** - * Derives a child key. Child key will not be associated with any - * other child key because of properties of underlying KDF. - * - * @param protocol - 3-15 character protocol name - * @param accountId - numeric identifier of account - * @param options - `keyLength: 64` or `modulus: 41920438n` - * @example deriveChildKey('aes', 0) - */ - deriveChildKey: (protocol: string, accountId: AccountID, options?: KeyOpts) => Uint8Array; - /** - * Deletes the main seed from eskdf instance - */ - expire: () => void; - /** - * Account fingerprint - */ - fingerprint: string; - }> ->; - -/** - * ESKDF - * @param username - username, email, or identifier, min: 8 characters, should have enough entropy - * @param password - password, min: 8 characters, should have enough entropy - * @example - * const kdf = await eskdf('example-university', 'beginning-new-example'); - * const key = kdf.deriveChildKey('aes', 0); - * console.log(kdf.fingerprint); - * kdf.expire(); - */ -export async function eskdf(username: string, password: string): ESKDF { - // We are using closure + object instead of class because - // we want to make `seed` non-accessible for any external function. - let seed: Uint8Array | undefined = deriveMainSeed(username, password); - - function deriveCK(protocol: string, accountId: AccountID = 0, options?: KeyOpts): Uint8Array { - assertBytes(seed, 32); - const { salt, info } = getSaltInfo(protocol, accountId); // validate protocol & accountId - const keyLength = getKeyLength(options); // validate options - const key = hkdf(sha256, seed!, salt, info, keyLength); - // Modulus has already been validated - return options && 'modulus' in options ? modReduceKey(key, options.modulus) : key; - } - function expire() { - if (seed) seed.fill(1); - seed = undefined; - } - // prettier-ignore - const fingerprint = Array.from(deriveCK('fingerprint', 0)) - .slice(0, 6) - .map((char) => char.toString(16).padStart(2, '0').toUpperCase()) - .join(':'); - return Object.freeze({ deriveChildKey: deriveCK, expire, fingerprint }); -} diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/hkdf.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/hkdf.ts deleted file mode 100644 index 6d880d1a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/hkdf.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { hash as assertHash, number as assertNumber } from './_assert.js'; -import { CHash, Input, toBytes } from './utils.js'; -import { hmac } from './hmac.js'; - -// HKDF (RFC 5869) -// https://soatok.blog/2021/11/17/understanding-hkdf/ - -/** - * HKDF-Extract(IKM, salt) -> PRK - * Arguments position differs from spec (IKM is first one, since it is not optional) - * @param hash - * @param ikm - * @param salt - * @returns - */ -export function extract(hash: CHash, ikm: Input, salt?: Input) { - assertHash(hash); - // NOTE: some libraries treat zero-length array as 'not provided'; - // we don't, since we have undefined as 'not provided' - // https://github.com/RustCrypto/KDFs/issues/15 - if (salt === undefined) salt = new Uint8Array(hash.outputLen); // if not provided, it is set to a string of HashLen zeros - return hmac(hash, toBytes(salt), toBytes(ikm)); -} - -// HKDF-Expand(PRK, info, L) -> OKM -const HKDF_COUNTER = /* @__PURE__ */ new Uint8Array([0]); -const EMPTY_BUFFER = /* @__PURE__ */ new Uint8Array(); - -/** - * HKDF-expand from the spec. - * @param prk - a pseudorandom key of at least HashLen octets (usually, the output from the extract step) - * @param info - optional context and application specific information (can be a zero-length string) - * @param length - length of output keying material in octets - */ -export function expand(hash: CHash, prk: Input, info?: Input, length: number = 32) { - assertHash(hash); - assertNumber(length); - if (length > 255 * hash.outputLen) throw new Error('Length should be <= 255*HashLen'); - const blocks = Math.ceil(length / hash.outputLen); - if (info === undefined) info = EMPTY_BUFFER; - // first L(ength) octets of T - const okm = new Uint8Array(blocks * hash.outputLen); - // Re-use HMAC instance between blocks - const HMAC = hmac.create(hash, prk); - const HMACTmp = HMAC._cloneInto(); - const T = new Uint8Array(HMAC.outputLen); - for (let counter = 0; counter < blocks; counter++) { - HKDF_COUNTER[0] = counter + 1; - // T(0) = empty string (zero length) - // T(N) = HMAC-Hash(PRK, T(N-1) | info | N) - HMACTmp.update(counter === 0 ? EMPTY_BUFFER : T) - .update(info) - .update(HKDF_COUNTER) - .digestInto(T); - okm.set(T, hash.outputLen * counter); - HMAC._cloneInto(HMACTmp); - } - HMAC.destroy(); - HMACTmp.destroy(); - T.fill(0); - HKDF_COUNTER.fill(0); - return okm.slice(0, length); -} - -/** - * HKDF (RFC 5869): extract + expand in one step. - * @param hash - hash function that would be used (e.g. sha256) - * @param ikm - input keying material, the initial key - * @param salt - optional salt value (a non-secret random value) - * @param info - optional context and application specific information - * @param length - length of output keying material in octets - */ -export const hkdf = ( - hash: CHash, - ikm: Input, - salt: Input | undefined, - info: Input | undefined, - length: number -) => expand(hash, extract(hash, ikm, salt), info, length); diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/hmac.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/hmac.ts deleted file mode 100644 index bebf4b38..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/hmac.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { hash as assertHash, bytes as assertBytes, exists as assertExists } from './_assert.js'; -import { Hash, CHash, Input, toBytes } from './utils.js'; -// HMAC (RFC 2104) -export class HMAC> extends Hash> { - oHash: T; - iHash: T; - blockLen: number; - outputLen: number; - private finished = false; - private destroyed = false; - - constructor(hash: CHash, _key: Input) { - super(); - assertHash(hash); - const key = toBytes(_key); - this.iHash = hash.create() as T; - if (typeof this.iHash.update !== 'function') - throw new Error('Expected instance of class which extends utils.Hash'); - this.blockLen = this.iHash.blockLen; - this.outputLen = this.iHash.outputLen; - const blockLen = this.blockLen; - const pad = new Uint8Array(blockLen); - // blockLen can be bigger than outputLen - pad.set(key.length > blockLen ? hash.create().update(key).digest() : key); - for (let i = 0; i < pad.length; i++) pad[i] ^= 0x36; - this.iHash.update(pad); - // By doing update (processing of first block) of outer hash here we can re-use it between multiple calls via clone - this.oHash = hash.create() as T; - // Undo internal XOR && apply outer XOR - for (let i = 0; i < pad.length; i++) pad[i] ^= 0x36 ^ 0x5c; - this.oHash.update(pad); - pad.fill(0); - } - update(buf: Input) { - assertExists(this); - this.iHash.update(buf); - return this; - } - digestInto(out: Uint8Array) { - assertExists(this); - assertBytes(out, this.outputLen); - this.finished = true; - this.iHash.digestInto(out); - this.oHash.update(out); - this.oHash.digestInto(out); - this.destroy(); - } - digest() { - const out = new Uint8Array(this.oHash.outputLen); - this.digestInto(out); - return out; - } - _cloneInto(to?: HMAC): HMAC { - // Create new instance without calling constructor since key already in state and we don't know it. - to ||= Object.create(Object.getPrototypeOf(this), {}); - const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this; - to = to as this; - to.finished = finished; - to.destroyed = destroyed; - to.blockLen = blockLen; - to.outputLen = outputLen; - to.oHash = oHash._cloneInto(to.oHash); - to.iHash = iHash._cloneInto(to.iHash); - return to; - } - destroy() { - this.destroyed = true; - this.oHash.destroy(); - this.iHash.destroy(); - } -} - -/** - * HMAC: RFC2104 message authentication code. - * @param hash - function that would be used e.g. sha256 - * @param key - message key - * @param message - message data - */ -export const hmac = (hash: CHash, key: Input, message: Input): Uint8Array => - new HMAC(hash, key).update(message).digest(); -hmac.create = (hash: CHash, key: Input) => new HMAC(hash, key); diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/index.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/index.ts deleted file mode 100644 index 1505776d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -throw new Error('noble-hashes have no entry-point: consult README for usage'); diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/pbkdf2.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/pbkdf2.ts deleted file mode 100644 index b5f7e6aa..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/pbkdf2.ts +++ /dev/null @@ -1,97 +0,0 @@ -import { hash as assertHash, number as assertNumber } from './_assert.js'; -import { hmac } from './hmac.js'; -import { Hash, CHash, Input, createView, toBytes, checkOpts, asyncLoop } from './utils.js'; - -// PBKDF (RFC 2898) -export type Pbkdf2Opt = { - c: number; // Iterations - dkLen?: number; // Desired key length in bytes (Intended output length in octets of the derived key - asyncTick?: number; // Maximum time in ms for which async function can block execution -}; -// Common prologue and epilogue for sync/async functions -function pbkdf2Init(hash: CHash, _password: Input, _salt: Input, _opts: Pbkdf2Opt) { - assertHash(hash); - const opts = checkOpts({ dkLen: 32, asyncTick: 10 }, _opts); - const { c, dkLen, asyncTick } = opts; - assertNumber(c); - assertNumber(dkLen); - assertNumber(asyncTick); - if (c < 1) throw new Error('PBKDF2: iterations (c) should be >= 1'); - const password = toBytes(_password); - const salt = toBytes(_salt); - // DK = PBKDF2(PRF, Password, Salt, c, dkLen); - const DK = new Uint8Array(dkLen); - // U1 = PRF(Password, Salt + INT_32_BE(i)) - const PRF = hmac.create(hash, password); - const PRFSalt = PRF._cloneInto().update(salt); - return { c, dkLen, asyncTick, DK, PRF, PRFSalt }; -} - -function pbkdf2Output>( - PRF: Hash, - PRFSalt: Hash, - DK: Uint8Array, - prfW: Hash, - u: Uint8Array -) { - PRF.destroy(); - PRFSalt.destroy(); - if (prfW) prfW.destroy(); - u.fill(0); - return DK; -} - -/** - * PBKDF2-HMAC: RFC 2898 key derivation function - * @param hash - hash function that would be used e.g. sha256 - * @param password - password from which a derived key is generated - * @param salt - cryptographic salt - * @param opts - {c, dkLen} where c is work factor and dkLen is output message size - */ -export function pbkdf2(hash: CHash, password: Input, salt: Input, opts: Pbkdf2Opt) { - const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts); - let prfW: any; // Working copy - const arr = new Uint8Array(4); - const view = createView(arr); - const u = new Uint8Array(PRF.outputLen); - // DK = T1 + T2 + ⋯ + Tdklen/hlen - for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { - // Ti = F(Password, Salt, c, i) - const Ti = DK.subarray(pos, pos + PRF.outputLen); - view.setInt32(0, ti, false); - // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc - // U1 = PRF(Password, Salt + INT_32_BE(i)) - (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); - Ti.set(u.subarray(0, Ti.length)); - for (let ui = 1; ui < c; ui++) { - // Uc = PRF(Password, Uc−1) - PRF._cloneInto(prfW).update(u).digestInto(u); - for (let i = 0; i < Ti.length; i++) Ti[i] ^= u[i]; - } - } - return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); -} - -export async function pbkdf2Async(hash: CHash, password: Input, salt: Input, opts: Pbkdf2Opt) { - const { c, dkLen, asyncTick, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts); - let prfW: any; // Working copy - const arr = new Uint8Array(4); - const view = createView(arr); - const u = new Uint8Array(PRF.outputLen); - // DK = T1 + T2 + ⋯ + Tdklen/hlen - for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { - // Ti = F(Password, Salt, c, i) - const Ti = DK.subarray(pos, pos + PRF.outputLen); - view.setInt32(0, ti, false); - // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc - // U1 = PRF(Password, Salt + INT_32_BE(i)) - (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); - Ti.set(u.subarray(0, Ti.length)); - await asyncLoop(c - 1, asyncTick, () => { - // Uc = PRF(Password, Uc−1) - PRF._cloneInto(prfW).update(u).digestInto(u); - for (let i = 0; i < Ti.length; i++) Ti[i] ^= u[i]; - }); - } - return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); -} diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/ripemd160.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/ripemd160.ts deleted file mode 100644 index 5f323807..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/ripemd160.ts +++ /dev/null @@ -1,110 +0,0 @@ -import { SHA2 } from './_sha2.js'; -import { wrapConstructor } from './utils.js'; - -// https://homes.esat.kuleuven.be/~bosselae/ripemd160.html -// https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf -const Rho = /* @__PURE__ */ new Uint8Array([7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8]); -const Id = /* @__PURE__ */ Uint8Array.from({ length: 16 }, (_, i) => i); -const Pi = /* @__PURE__ */ Id.map((i) => (9 * i + 5) % 16); -let idxL = [Id]; -let idxR = [Pi]; -for (let i = 0; i < 4; i++) for (let j of [idxL, idxR]) j.push(j[i].map((k) => Rho[k])); - -const shifts = /* @__PURE__ */ [ - [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8], - [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7], - [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9], - [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6], - [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5], -].map((i) => new Uint8Array(i)); -const shiftsL = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts[i][j])); -const shiftsR = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts[i][j])); -const Kl = /* @__PURE__ */ new Uint32Array([ - 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e, -]); -const Kr = /* @__PURE__ */ new Uint32Array([ - 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000, -]); -// The rotate left (circular left shift) operation for uint32 -const rotl = (word: number, shift: number) => (word << shift) | (word >>> (32 - shift)); -// It's called f() in spec. -function f(group: number, x: number, y: number, z: number): number { - if (group === 0) return x ^ y ^ z; - else if (group === 1) return (x & y) | (~x & z); - else if (group === 2) return (x | ~y) ^ z; - else if (group === 3) return (x & z) | (y & ~z); - else return x ^ (y | ~z); -} -// Temporary buffer, not used to store anything between runs -const BUF = /* @__PURE__ */ new Uint32Array(16); -export class RIPEMD160 extends SHA2 { - private h0 = 0x67452301 | 0; - private h1 = 0xefcdab89 | 0; - private h2 = 0x98badcfe | 0; - private h3 = 0x10325476 | 0; - private h4 = 0xc3d2e1f0 | 0; - - constructor() { - super(64, 20, 8, true); - } - protected get(): [number, number, number, number, number] { - const { h0, h1, h2, h3, h4 } = this; - return [h0, h1, h2, h3, h4]; - } - protected set(h0: number, h1: number, h2: number, h3: number, h4: number) { - this.h0 = h0 | 0; - this.h1 = h1 | 0; - this.h2 = h2 | 0; - this.h3 = h3 | 0; - this.h4 = h4 | 0; - } - protected process(view: DataView, offset: number): void { - for (let i = 0; i < 16; i++, offset += 4) BUF[i] = view.getUint32(offset, true); - // prettier-ignore - let al = this.h0 | 0, ar = al, - bl = this.h1 | 0, br = bl, - cl = this.h2 | 0, cr = cl, - dl = this.h3 | 0, dr = dl, - el = this.h4 | 0, er = el; - - // Instead of iterating 0 to 80, we split it into 5 groups - // And use the groups in constants, functions, etc. Much simpler - for (let group = 0; group < 5; group++) { - const rGroup = 4 - group; - const hbl = Kl[group], hbr = Kr[group]; // prettier-ignore - const rl = idxL[group], rr = idxR[group]; // prettier-ignore - const sl = shiftsL[group], sr = shiftsR[group]; // prettier-ignore - for (let i = 0; i < 16; i++) { - const tl = (rotl(al + f(group, bl, cl, dl) + BUF[rl[i]] + hbl, sl[i]) + el) | 0; - al = el, el = dl, dl = rotl(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore - } - // 2 loops are 10% faster - for (let i = 0; i < 16; i++) { - const tr = (rotl(ar + f(rGroup, br, cr, dr) + BUF[rr[i]] + hbr, sr[i]) + er) | 0; - ar = er, er = dr, dr = rotl(cr, 10) | 0, cr = br, br = tr; // prettier-ignore - } - } - // Add the compressed chunk to the current hash value - this.set( - (this.h1 + cl + dr) | 0, - (this.h2 + dl + er) | 0, - (this.h3 + el + ar) | 0, - (this.h4 + al + br) | 0, - (this.h0 + bl + cr) | 0 - ); - } - protected roundClean() { - BUF.fill(0); - } - destroy() { - this.destroyed = true; - this.buffer.fill(0); - this.set(0, 0, 0, 0, 0); - } -} - -/** - * RIPEMD-160 - a hash function from 1990s. - * @param message - msg that would be hashed - */ -export const ripemd160 = /* @__PURE__ */ wrapConstructor(() => new RIPEMD160()); diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/scrypt.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/scrypt.ts deleted file mode 100644 index 85b68d8b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/scrypt.ts +++ /dev/null @@ -1,240 +0,0 @@ -import { number as assertNumber } from './_assert.js'; -import { sha256 } from './sha256.js'; -import { pbkdf2 } from './pbkdf2.js'; -import { asyncLoop, checkOpts, Input, u32 } from './utils.js'; - -// RFC 7914 Scrypt KDF - -// Left rotate for uint32 -const rotl = (a: number, b: number) => (a << b) | (a >>> (32 - b)); - -// The main Scrypt loop: uses Salsa extensively. -// Six versions of the function were tried, this is the fastest one. -// prettier-ignore -function XorAndSalsa( - prev: Uint32Array, - pi: number, - input: Uint32Array, - ii: number, - out: Uint32Array, - oi: number -) { - // Based on https://cr.yp.to/salsa20.html - // Xor blocks - let y00 = prev[pi++] ^ input[ii++], y01 = prev[pi++] ^ input[ii++]; - let y02 = prev[pi++] ^ input[ii++], y03 = prev[pi++] ^ input[ii++]; - let y04 = prev[pi++] ^ input[ii++], y05 = prev[pi++] ^ input[ii++]; - let y06 = prev[pi++] ^ input[ii++], y07 = prev[pi++] ^ input[ii++]; - let y08 = prev[pi++] ^ input[ii++], y09 = prev[pi++] ^ input[ii++]; - let y10 = prev[pi++] ^ input[ii++], y11 = prev[pi++] ^ input[ii++]; - let y12 = prev[pi++] ^ input[ii++], y13 = prev[pi++] ^ input[ii++]; - let y14 = prev[pi++] ^ input[ii++], y15 = prev[pi++] ^ input[ii++]; - // Save state to temporary variables (salsa) - let x00 = y00, x01 = y01, x02 = y02, x03 = y03, - x04 = y04, x05 = y05, x06 = y06, x07 = y07, - x08 = y08, x09 = y09, x10 = y10, x11 = y11, - x12 = y12, x13 = y13, x14 = y14, x15 = y15; - // Main loop (salsa) - for (let i = 0; i < 8; i += 2) { - x04 ^= rotl(x00 + x12 | 0, 7); x08 ^= rotl(x04 + x00 | 0, 9); - x12 ^= rotl(x08 + x04 | 0, 13); x00 ^= rotl(x12 + x08 | 0, 18); - x09 ^= rotl(x05 + x01 | 0, 7); x13 ^= rotl(x09 + x05 | 0, 9); - x01 ^= rotl(x13 + x09 | 0, 13); x05 ^= rotl(x01 + x13 | 0, 18); - x14 ^= rotl(x10 + x06 | 0, 7); x02 ^= rotl(x14 + x10 | 0, 9); - x06 ^= rotl(x02 + x14 | 0, 13); x10 ^= rotl(x06 + x02 | 0, 18); - x03 ^= rotl(x15 + x11 | 0, 7); x07 ^= rotl(x03 + x15 | 0, 9); - x11 ^= rotl(x07 + x03 | 0, 13); x15 ^= rotl(x11 + x07 | 0, 18); - x01 ^= rotl(x00 + x03 | 0, 7); x02 ^= rotl(x01 + x00 | 0, 9); - x03 ^= rotl(x02 + x01 | 0, 13); x00 ^= rotl(x03 + x02 | 0, 18); - x06 ^= rotl(x05 + x04 | 0, 7); x07 ^= rotl(x06 + x05 | 0, 9); - x04 ^= rotl(x07 + x06 | 0, 13); x05 ^= rotl(x04 + x07 | 0, 18); - x11 ^= rotl(x10 + x09 | 0, 7); x08 ^= rotl(x11 + x10 | 0, 9); - x09 ^= rotl(x08 + x11 | 0, 13); x10 ^= rotl(x09 + x08 | 0, 18); - x12 ^= rotl(x15 + x14 | 0, 7); x13 ^= rotl(x12 + x15 | 0, 9); - x14 ^= rotl(x13 + x12 | 0, 13); x15 ^= rotl(x14 + x13 | 0, 18); - } - // Write output (salsa) - out[oi++] = (y00 + x00) | 0; out[oi++] = (y01 + x01) | 0; - out[oi++] = (y02 + x02) | 0; out[oi++] = (y03 + x03) | 0; - out[oi++] = (y04 + x04) | 0; out[oi++] = (y05 + x05) | 0; - out[oi++] = (y06 + x06) | 0; out[oi++] = (y07 + x07) | 0; - out[oi++] = (y08 + x08) | 0; out[oi++] = (y09 + x09) | 0; - out[oi++] = (y10 + x10) | 0; out[oi++] = (y11 + x11) | 0; - out[oi++] = (y12 + x12) | 0; out[oi++] = (y13 + x13) | 0; - out[oi++] = (y14 + x14) | 0; out[oi++] = (y15 + x15) | 0; -} - -function BlockMix(input: Uint32Array, ii: number, out: Uint32Array, oi: number, r: number) { - // The block B is r 128-byte chunks (which is equivalent of 2r 64-byte chunks) - let head = oi + 0; - let tail = oi + 16 * r; - for (let i = 0; i < 16; i++) out[tail + i] = input[ii + (2 * r - 1) * 16 + i]; // X ← B[2r−1] - for (let i = 0; i < r; i++, head += 16, ii += 16) { - // We write odd & even Yi at same time. Even: 0bXXXXX0 Odd: 0bXXXXX1 - XorAndSalsa(out, tail, input, ii, out, head); // head[i] = Salsa(blockIn[2*i] ^ tail[i-1]) - if (i > 0) tail += 16; // First iteration overwrites tmp value in tail - XorAndSalsa(out, head, input, (ii += 16), out, tail); // tail[i] = Salsa(blockIn[2*i+1] ^ head[i]) - } -} - -export type ScryptOpts = { - N: number; // cost factor - r: number; // block size - p: number; // parallelization - dkLen?: number; // key length - asyncTick?: number; // block execution max time - maxmem?: number; - onProgress?: (progress: number) => void; -}; - -// Common prologue and epilogue for sync/async functions -function scryptInit(password: Input, salt: Input, _opts?: ScryptOpts) { - // Maxmem - 1GB+1KB by default - const opts = checkOpts( - { - dkLen: 32, - asyncTick: 10, - maxmem: 1024 ** 3 + 1024, - }, - _opts - ); - const { N, r, p, dkLen, asyncTick, maxmem, onProgress } = opts; - assertNumber(N); - assertNumber(r); - assertNumber(p); - assertNumber(dkLen); - assertNumber(asyncTick); - assertNumber(maxmem); - if (onProgress !== undefined && typeof onProgress !== 'function') - throw new Error('progressCb should be function'); - const blockSize = 128 * r; - const blockSize32 = blockSize / 4; - if (N <= 1 || (N & (N - 1)) !== 0 || N >= 2 ** (blockSize / 8) || N > 2 ** 32) { - // NOTE: we limit N to be less than 2**32 because of 32 bit variant of Integrify function - // There is no JS engines that allows alocate more than 4GB per single Uint8Array for now, but can change in future. - throw new Error( - 'Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32' - ); - } - if (p < 0 || p > ((2 ** 32 - 1) * 32) / blockSize) { - throw new Error( - 'Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)' - ); - } - if (dkLen < 0 || dkLen > (2 ** 32 - 1) * 32) { - throw new Error( - 'Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32' - ); - } - const memUsed = blockSize * (N + p); - if (memUsed > maxmem) { - throw new Error( - `Scrypt: parameters too large, ${memUsed} (128 * r * (N + p)) > ${maxmem} (maxmem)` - ); - } - // [B0...Bp−1] ← PBKDF2HMAC-SHA256(Passphrase, Salt, 1, blockSize*ParallelizationFactor) - // Since it has only one iteration there is no reason to use async variant - const B = pbkdf2(sha256, password, salt, { c: 1, dkLen: blockSize * p }); - const B32 = u32(B); - // Re-used between parallel iterations. Array(iterations) of B - const V = u32(new Uint8Array(blockSize * N)); - const tmp = u32(new Uint8Array(blockSize)); - let blockMixCb = () => {}; - if (onProgress) { - const totalBlockMix = 2 * N * p; - // Invoke callback if progress changes from 10.01 to 10.02 - // Allows to draw smooth progress bar on up to 8K screen - const callbackPer = Math.max(Math.floor(totalBlockMix / 10000), 1); - let blockMixCnt = 0; - blockMixCb = () => { - blockMixCnt++; - if (onProgress && (!(blockMixCnt % callbackPer) || blockMixCnt === totalBlockMix)) - onProgress(blockMixCnt / totalBlockMix); - }; - } - return { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick }; -} - -function scryptOutput( - password: Input, - dkLen: number, - B: Uint8Array, - V: Uint32Array, - tmp: Uint32Array -) { - const res = pbkdf2(sha256, password, B, { c: 1, dkLen }); - B.fill(0); - V.fill(0); - tmp.fill(0); - return res; -} - -/** - * Scrypt KDF from RFC 7914. - * @param password - pass - * @param salt - salt - * @param opts - parameters - * - `N` is cpu/mem work factor (power of 2 e.g. 2**18) - * - `r` is block size (8 is common), fine-tunes sequential memory read size and performance - * - `p` is parallelization factor (1 is common) - * - `dkLen` is output key length in bytes e.g. 32. - * - `asyncTick` - (default: 10) max time in ms for which async function can block execution - * - `maxmem` - (default: `1024 ** 3 + 1024` aka 1GB+1KB). A limit that the app could use for scrypt - * - `onProgress` - callback function that would be executed for progress report - * @returns Derived key - */ -export function scrypt(password: Input, salt: Input, opts: ScryptOpts) { - const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb } = scryptInit( - password, - salt, - opts - ); - for (let pi = 0; pi < p; pi++) { - const Pi = blockSize32 * pi; - for (let i = 0; i < blockSize32; i++) V[i] = B32[Pi + i]; // V[0] = B[i] - for (let i = 0, pos = 0; i < N - 1; i++) { - BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]); - blockMixCb(); - } - BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element - blockMixCb(); - for (let i = 0; i < N; i++) { - // First u32 of the last 64-byte block (u32 is LE) - const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations - for (let k = 0; k < blockSize32; k++) tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j] - BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) - blockMixCb(); - } - } - return scryptOutput(password, dkLen, B, V, tmp); -} - -/** - * Scrypt KDF from RFC 7914. - */ -export async function scryptAsync(password: Input, salt: Input, opts: ScryptOpts) { - const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick } = scryptInit( - password, - salt, - opts - ); - for (let pi = 0; pi < p; pi++) { - const Pi = blockSize32 * pi; - for (let i = 0; i < blockSize32; i++) V[i] = B32[Pi + i]; // V[0] = B[i] - let pos = 0; - await asyncLoop(N - 1, asyncTick, () => { - BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]); - blockMixCb(); - }); - BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element - blockMixCb(); - await asyncLoop(N, asyncTick, () => { - // First u32 of the last 64-byte block (u32 is LE) - const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations - for (let k = 0; k < blockSize32; k++) tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j] - BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) - blockMixCb(); - }); - } - return scryptOutput(password, dkLen, B, V, tmp); -} diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/sha1.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/sha1.ts deleted file mode 100644 index 1fec2249..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/sha1.ts +++ /dev/null @@ -1,88 +0,0 @@ -import { SHA2 } from './_sha2.js'; -import { wrapConstructor } from './utils.js'; - -// SHA1 was cryptographically broken. -// It is still widely used in legacy apps. Don't use it for a new protocol. - -// RFC 3174 -const rotl = (word: number, shift: number) => (word << shift) | ((word >>> (32 - shift)) >>> 0); -// Choice: a ? b : c -const Chi = (a: number, b: number, c: number) => (a & b) ^ (~a & c); -// Majority function, true if any two inpust is true -const Maj = (a: number, b: number, c: number) => (a & b) ^ (a & c) ^ (b & c); - -// Initial state -const IV = /* @__PURE__ */ new Uint32Array([ - 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0, -]); - -// Temporary buffer, not used to store anything between runs -// Named this way because it matches specification. -const SHA1_W = /* @__PURE__ */ new Uint32Array(80); -class SHA1 extends SHA2 { - private A = IV[0] | 0; - private B = IV[1] | 0; - private C = IV[2] | 0; - private D = IV[3] | 0; - private E = IV[4] | 0; - - constructor() { - super(64, 20, 8, false); - } - protected get(): [number, number, number, number, number] { - const { A, B, C, D, E } = this; - return [A, B, C, D, E]; - } - protected set(A: number, B: number, C: number, D: number, E: number) { - this.A = A | 0; - this.B = B | 0; - this.C = C | 0; - this.D = D | 0; - this.E = E | 0; - } - protected process(view: DataView, offset: number): void { - for (let i = 0; i < 16; i++, offset += 4) SHA1_W[i] = view.getUint32(offset, false); - for (let i = 16; i < 80; i++) - SHA1_W[i] = rotl(SHA1_W[i - 3] ^ SHA1_W[i - 8] ^ SHA1_W[i - 14] ^ SHA1_W[i - 16], 1); - // Compression function main loop, 80 rounds - let { A, B, C, D, E } = this; - for (let i = 0; i < 80; i++) { - let F, K; - if (i < 20) { - F = Chi(B, C, D); - K = 0x5a827999; - } else if (i < 40) { - F = B ^ C ^ D; - K = 0x6ed9eba1; - } else if (i < 60) { - F = Maj(B, C, D); - K = 0x8f1bbcdc; - } else { - F = B ^ C ^ D; - K = 0xca62c1d6; - } - const T = (rotl(A, 5) + F + E + K + SHA1_W[i]) | 0; - E = D; - D = C; - C = rotl(B, 30); - B = A; - A = T; - } - // Add the compressed chunk to the current hash value - A = (A + this.A) | 0; - B = (B + this.B) | 0; - C = (C + this.C) | 0; - D = (D + this.D) | 0; - E = (E + this.E) | 0; - this.set(A, B, C, D, E); - } - protected roundClean() { - SHA1_W.fill(0); - } - destroy() { - this.set(0, 0, 0, 0, 0); - this.buffer.fill(0); - } -} - -export const sha1 = /* @__PURE__ */ wrapConstructor(() => new SHA1()); diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/sha256.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/sha256.ts deleted file mode 100644 index 6f88b9a2..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/sha256.ts +++ /dev/null @@ -1,133 +0,0 @@ -import { SHA2 } from './_sha2.js'; -import { rotr, wrapConstructor } from './utils.js'; - -// SHA2-256 need to try 2^128 hashes to execute birthday attack. -// BTC network is doing 2^67 hashes/sec as per early 2023. - -// Choice: a ? b : c -const Chi = (a: number, b: number, c: number) => (a & b) ^ (~a & c); -// Majority function, true if any two inpust is true -const Maj = (a: number, b: number, c: number) => (a & b) ^ (a & c) ^ (b & c); - -// Round constants: -// first 32 bits of the fractional parts of the cube roots of the first 64 primes 2..311) -// prettier-ignore -const SHA256_K = /* @__PURE__ */new Uint32Array([ - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 -]); - -// Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19): -// prettier-ignore -const IV = /* @__PURE__ */new Uint32Array([ - 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 -]); - -// Temporary buffer, not used to store anything between runs -// Named this way because it matches specification. -const SHA256_W = /* @__PURE__ */ new Uint32Array(64); -class SHA256 extends SHA2 { - // We cannot use array here since array allows indexing by variable - // which means optimizer/compiler cannot use registers. - A = IV[0] | 0; - B = IV[1] | 0; - C = IV[2] | 0; - D = IV[3] | 0; - E = IV[4] | 0; - F = IV[5] | 0; - G = IV[6] | 0; - H = IV[7] | 0; - - constructor() { - super(64, 32, 8, false); - } - protected get(): [number, number, number, number, number, number, number, number] { - const { A, B, C, D, E, F, G, H } = this; - return [A, B, C, D, E, F, G, H]; - } - // prettier-ignore - protected set( - A: number, B: number, C: number, D: number, E: number, F: number, G: number, H: number - ) { - this.A = A | 0; - this.B = B | 0; - this.C = C | 0; - this.D = D | 0; - this.E = E | 0; - this.F = F | 0; - this.G = G | 0; - this.H = H | 0; - } - protected process(view: DataView, offset: number): void { - // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array - for (let i = 0; i < 16; i++, offset += 4) SHA256_W[i] = view.getUint32(offset, false); - for (let i = 16; i < 64; i++) { - const W15 = SHA256_W[i - 15]; - const W2 = SHA256_W[i - 2]; - const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3); - const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10); - SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0; - } - // Compression function main loop, 64 rounds - let { A, B, C, D, E, F, G, H } = this; - for (let i = 0; i < 64; i++) { - const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25); - const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; - const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22); - const T2 = (sigma0 + Maj(A, B, C)) | 0; - H = G; - G = F; - F = E; - E = (D + T1) | 0; - D = C; - C = B; - B = A; - A = (T1 + T2) | 0; - } - // Add the compressed chunk to the current hash value - A = (A + this.A) | 0; - B = (B + this.B) | 0; - C = (C + this.C) | 0; - D = (D + this.D) | 0; - E = (E + this.E) | 0; - F = (F + this.F) | 0; - G = (G + this.G) | 0; - H = (H + this.H) | 0; - this.set(A, B, C, D, E, F, G, H); - } - protected roundClean() { - SHA256_W.fill(0); - } - destroy() { - this.set(0, 0, 0, 0, 0, 0, 0, 0); - this.buffer.fill(0); - } -} -// Constants from https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf -class SHA224 extends SHA256 { - A = 0xc1059ed8 | 0; - B = 0x367cd507 | 0; - C = 0x3070dd17 | 0; - D = 0xf70e5939 | 0; - E = 0xffc00b31 | 0; - F = 0x68581511 | 0; - G = 0x64f98fa7 | 0; - H = 0xbefa4fa4 | 0; - constructor() { - super(); - this.outputLen = 28; - } -} - -/** - * SHA2-256 hash function - * @param message - data that would be hashed - */ -export const sha256 = /* @__PURE__ */ wrapConstructor(() => new SHA256()); -export const sha224 = /* @__PURE__ */ wrapConstructor(() => new SHA224()); diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/sha3-addons.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/sha3-addons.ts deleted file mode 100644 index 1d5fbf9a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/sha3-addons.ts +++ /dev/null @@ -1,398 +0,0 @@ -import { number as assertNumber } from './_assert.js'; -import { Input, toBytes, wrapConstructorWithOpts, u32, Hash, HashXOF } from './utils.js'; -import { Keccak, ShakeOpts } from './sha3.js'; -// cSHAKE && KMAC (NIST SP800-185) -function leftEncode(n: number): Uint8Array { - const res = [n & 0xff]; - n >>= 8; - for (; n > 0; n >>= 8) res.unshift(n & 0xff); - res.unshift(res.length); - return new Uint8Array(res); -} - -function rightEncode(n: number): Uint8Array { - const res = [n & 0xff]; - n >>= 8; - for (; n > 0; n >>= 8) res.unshift(n & 0xff); - res.push(res.length); - return new Uint8Array(res); -} - -function chooseLen(opts: ShakeOpts, outputLen: number): number { - return opts.dkLen === undefined ? outputLen : opts.dkLen; -} - -const toBytesOptional = (buf?: Input) => (buf !== undefined ? toBytes(buf) : new Uint8Array([])); -// NOTE: second modulo is necessary since we don't need to add padding if current element takes whole block -const getPadding = (len: number, block: number) => new Uint8Array((block - (len % block)) % block); -export type cShakeOpts = ShakeOpts & { personalization?: Input; NISTfn?: Input }; - -// Personalization -function cshakePers(hash: Keccak, opts: cShakeOpts = {}): Keccak { - if (!opts || (!opts.personalization && !opts.NISTfn)) return hash; - // Encode and pad inplace to avoid unneccesary memory copies/slices (so we don't need to zero them later) - // bytepad(encode_string(N) || encode_string(S), 168) - const blockLenBytes = leftEncode(hash.blockLen); - const fn = toBytesOptional(opts.NISTfn); - const fnLen = leftEncode(8 * fn.length); // length in bits - const pers = toBytesOptional(opts.personalization); - const persLen = leftEncode(8 * pers.length); // length in bits - if (!fn.length && !pers.length) return hash; - hash.suffix = 0x04; - hash.update(blockLenBytes).update(fnLen).update(fn).update(persLen).update(pers); - let totalLen = blockLenBytes.length + fnLen.length + fn.length + persLen.length + pers.length; - hash.update(getPadding(totalLen, hash.blockLen)); - return hash; -} - -const gencShake = (suffix: number, blockLen: number, outputLen: number) => - wrapConstructorWithOpts((opts: cShakeOpts = {}) => - cshakePers(new Keccak(blockLen, suffix, chooseLen(opts, outputLen), true), opts) - ); - -export const cshake128 = /* @__PURE__ */ (() => gencShake(0x1f, 168, 128 / 8))(); -export const cshake256 = /* @__PURE__ */ (() => gencShake(0x1f, 136, 256 / 8))(); - -class KMAC extends Keccak implements HashXOF { - constructor( - blockLen: number, - outputLen: number, - enableXOF: boolean, - key: Input, - opts: cShakeOpts = {} - ) { - super(blockLen, 0x1f, outputLen, enableXOF); - cshakePers(this, { NISTfn: 'KMAC', personalization: opts.personalization }); - key = toBytes(key); - // 1. newX = bytepad(encode_string(K), 168) || X || right_encode(L). - const blockLenBytes = leftEncode(this.blockLen); - const keyLen = leftEncode(8 * key.length); - this.update(blockLenBytes).update(keyLen).update(key); - const totalLen = blockLenBytes.length + keyLen.length + key.length; - this.update(getPadding(totalLen, this.blockLen)); - } - protected finish() { - if (!this.finished) this.update(rightEncode(this.enableXOF ? 0 : this.outputLen * 8)); // outputLen in bits - super.finish(); - } - _cloneInto(to?: KMAC): KMAC { - // Create new instance without calling constructor since key already in state and we don't know it. - // Force "to" to be instance of KMAC instead of Sha3. - if (!to) { - to = Object.create(Object.getPrototypeOf(this), {}) as KMAC; - to.state = this.state.slice(); - to.blockLen = this.blockLen; - to.state32 = u32(to.state); - } - return super._cloneInto(to) as KMAC; - } - clone(): KMAC { - return this._cloneInto(); - } -} - -function genKmac(blockLen: number, outputLen: number, xof = false) { - const kmac = (key: Input, message: Input, opts?: cShakeOpts): Uint8Array => - kmac.create(key, opts).update(message).digest(); - kmac.create = (key: Input, opts: cShakeOpts = {}) => - new KMAC(blockLen, chooseLen(opts, outputLen), xof, key, opts); - return kmac; -} - -export const kmac128 = /* @__PURE__ */ (() => genKmac(168, 128 / 8))(); -export const kmac256 = /* @__PURE__ */ (() => genKmac(136, 256 / 8))(); -export const kmac128xof = /* @__PURE__ */ (() => genKmac(168, 128 / 8, true))(); -export const kmac256xof = /* @__PURE__ */ (() => genKmac(136, 256 / 8, true))(); - -// TupleHash -// Usage: tuple(['ab', 'cd']) != tuple(['a', 'bcd']) -class TupleHash extends Keccak implements HashXOF { - constructor(blockLen: number, outputLen: number, enableXOF: boolean, opts: cShakeOpts = {}) { - super(blockLen, 0x1f, outputLen, enableXOF); - cshakePers(this, { NISTfn: 'TupleHash', personalization: opts.personalization }); - // Change update after cshake processed - this.update = (data: Input) => { - data = toBytes(data); - super.update(leftEncode(data.length * 8)); - super.update(data); - return this; - }; - } - protected finish() { - if (!this.finished) super.update(rightEncode(this.enableXOF ? 0 : this.outputLen * 8)); // outputLen in bits - super.finish(); - } - _cloneInto(to?: TupleHash): TupleHash { - to ||= new TupleHash(this.blockLen, this.outputLen, this.enableXOF); - return super._cloneInto(to) as TupleHash; - } - clone(): TupleHash { - return this._cloneInto(); - } -} - -function genTuple(blockLen: number, outputLen: number, xof = false) { - const tuple = (messages: Input[], opts?: cShakeOpts): Uint8Array => { - const h = tuple.create(opts); - for (const msg of messages) h.update(msg); - return h.digest(); - }; - tuple.create = (opts: cShakeOpts = {}) => - new TupleHash(blockLen, chooseLen(opts, outputLen), xof, opts); - return tuple; -} - -export const tuplehash128 = /* @__PURE__ */ (() => genTuple(168, 128 / 8))(); -export const tuplehash256 = /* @__PURE__ */ (() => genTuple(136, 256 / 8))(); -export const tuplehash128xof = /* @__PURE__ */ (() => genTuple(168, 128 / 8, true))(); -export const tuplehash256xof = /* @__PURE__ */ (() => genTuple(136, 256 / 8, true))(); - -// ParallelHash (same as K12/M14, but without speedup for inputs less 8kb, reduced number of rounds and more simple) -type ParallelOpts = cShakeOpts & { blockLen?: number }; - -class ParallelHash extends Keccak implements HashXOF { - private leafHash?: Hash; - private chunkPos = 0; // Position of current block in chunk - private chunksDone = 0; // How many chunks we already have - private chunkLen: number; - constructor( - blockLen: number, - outputLen: number, - protected leafCons: () => Hash, - enableXOF: boolean, - opts: ParallelOpts = {} - ) { - super(blockLen, 0x1f, outputLen, enableXOF); - cshakePers(this, { NISTfn: 'ParallelHash', personalization: opts.personalization }); - let { blockLen: B } = opts; - B ||= 8; - assertNumber(B); - this.chunkLen = B; - super.update(leftEncode(B)); - // Change update after cshake processed - this.update = (data: Input) => { - data = toBytes(data); - const { chunkLen, leafCons } = this; - for (let pos = 0, len = data.length; pos < len; ) { - if (this.chunkPos == chunkLen || !this.leafHash) { - if (this.leafHash) { - super.update(this.leafHash.digest()); - this.chunksDone++; - } - this.leafHash = leafCons(); - this.chunkPos = 0; - } - const take = Math.min(chunkLen - this.chunkPos, len - pos); - this.leafHash.update(data.subarray(pos, pos + take)); - this.chunkPos += take; - pos += take; - } - return this; - }; - } - protected finish() { - if (this.finished) return; - if (this.leafHash) { - super.update(this.leafHash.digest()); - this.chunksDone++; - } - super.update(rightEncode(this.chunksDone)); - super.update(rightEncode(this.enableXOF ? 0 : this.outputLen * 8)); // outputLen in bits - super.finish(); - } - _cloneInto(to?: ParallelHash): ParallelHash { - to ||= new ParallelHash(this.blockLen, this.outputLen, this.leafCons, this.enableXOF); - if (this.leafHash) to.leafHash = this.leafHash._cloneInto(to.leafHash as Keccak); - to.chunkPos = this.chunkPos; - to.chunkLen = this.chunkLen; - to.chunksDone = this.chunksDone; - return super._cloneInto(to) as ParallelHash; - } - destroy() { - super.destroy.call(this); - if (this.leafHash) this.leafHash.destroy(); - } - clone(): ParallelHash { - return this._cloneInto(); - } -} - -function genPrl( - blockLen: number, - outputLen: number, - leaf: ReturnType, - xof = false -) { - const parallel = (message: Input, opts?: ParallelOpts): Uint8Array => - parallel.create(opts).update(message).digest(); - parallel.create = (opts: ParallelOpts = {}) => - new ParallelHash( - blockLen, - chooseLen(opts, outputLen), - () => leaf.create({ dkLen: 2 * outputLen }), - xof, - opts - ); - return parallel; -} - -export const parallelhash128 = /* @__PURE__ */ (() => genPrl(168, 128 / 8, cshake128))(); -export const parallelhash256 = /* @__PURE__ */ (() => genPrl(136, 256 / 8, cshake256))(); -export const parallelhash128xof = /* @__PURE__ */ (() => genPrl(168, 128 / 8, cshake128, true))(); -export const parallelhash256xof = /* @__PURE__ */ (() => genPrl(136, 256 / 8, cshake256, true))(); - -// Kangaroo -// Same as NIST rightEncode, but returns [0] for zero string -function rightEncodeK12(n: number): Uint8Array { - const res = []; - for (; n > 0; n >>= 8) res.unshift(n & 0xff); - res.push(res.length); - return new Uint8Array(res); -} - -export type KangarooOpts = { dkLen?: number; personalization?: Input }; -const EMPTY = new Uint8Array([]); - -class KangarooTwelve extends Keccak implements HashXOF { - readonly chunkLen = 8192; - private leafHash?: Keccak; - private personalization: Uint8Array; - private chunkPos = 0; // Position of current block in chunk - private chunksDone = 0; // How many chunks we already have - constructor( - blockLen: number, - protected leafLen: number, - outputLen: number, - rounds: number, - opts: KangarooOpts - ) { - super(blockLen, 0x07, outputLen, true, rounds); - const { personalization } = opts; - this.personalization = toBytesOptional(personalization); - } - update(data: Input) { - data = toBytes(data); - const { chunkLen, blockLen, leafLen, rounds } = this; - for (let pos = 0, len = data.length; pos < len; ) { - if (this.chunkPos == chunkLen) { - if (this.leafHash) super.update(this.leafHash.digest()); - else { - this.suffix = 0x06; // Its safe to change suffix here since its used only in digest() - super.update(new Uint8Array([3, 0, 0, 0, 0, 0, 0, 0])); - } - this.leafHash = new Keccak(blockLen, 0x0b, leafLen, false, rounds); - this.chunksDone++; - this.chunkPos = 0; - } - const take = Math.min(chunkLen - this.chunkPos, len - pos); - const chunk = data.subarray(pos, pos + take); - if (this.leafHash) this.leafHash.update(chunk); - else super.update(chunk); - this.chunkPos += take; - pos += take; - } - return this; - } - protected finish() { - if (this.finished) return; - const { personalization } = this; - this.update(personalization).update(rightEncodeK12(personalization.length)); - // Leaf hash - if (this.leafHash) { - super.update(this.leafHash.digest()); - super.update(rightEncodeK12(this.chunksDone)); - super.update(new Uint8Array([0xff, 0xff])); - } - super.finish.call(this); - } - destroy() { - super.destroy.call(this); - if (this.leafHash) this.leafHash.destroy(); - // We cannot zero personalization buffer since it is user provided and we don't want to mutate user input - this.personalization = EMPTY; - } - _cloneInto(to?: KangarooTwelve): KangarooTwelve { - const { blockLen, leafLen, leafHash, outputLen, rounds } = this; - to ||= new KangarooTwelve(blockLen, leafLen, outputLen, rounds, {}); - super._cloneInto(to); - if (leafHash) to.leafHash = leafHash._cloneInto(to.leafHash); - to.personalization.set(this.personalization); - to.leafLen = this.leafLen; - to.chunkPos = this.chunkPos; - to.chunksDone = this.chunksDone; - return to; - } - clone(): KangarooTwelve { - return this._cloneInto(); - } -} -// Default to 32 bytes, so it can be used without opts -export const k12 = /* @__PURE__ */ (() => - wrapConstructorWithOpts( - (opts: KangarooOpts = {}) => new KangarooTwelve(168, 32, chooseLen(opts, 32), 12, opts) - ))(); -// MarsupilamiFourteen -export const m14 = /* @__PURE__ */ (() => - wrapConstructorWithOpts( - (opts: KangarooOpts = {}) => new KangarooTwelve(136, 64, chooseLen(opts, 64), 14, opts) - ))(); - -// https://keccak.team/files/CSF-0.1.pdf -// + https://github.com/XKCP/XKCP/tree/master/lib/high/Keccak/PRG -class KeccakPRG extends Keccak { - protected rate: number; - constructor(capacity: number) { - assertNumber(capacity); - // Rho should be full bytes - if (capacity < 0 || capacity > 1600 - 10 || (1600 - capacity - 2) % 8) - throw new Error('KeccakPRG: Invalid capacity'); - // blockLen = rho in bytes - super((1600 - capacity - 2) / 8, 0, 0, true); - this.rate = 1600 - capacity; - this.posOut = Math.floor((this.rate + 7) / 8); - } - keccak() { - // Duplex padding - this.state[this.pos] ^= 0x01; - this.state[this.blockLen] ^= 0x02; // Rho is full bytes - super.keccak(); - this.pos = 0; - this.posOut = 0; - } - update(data: Input) { - super.update(data); - this.posOut = this.blockLen; - return this; - } - feed(data: Input) { - return this.update(data); - } - protected finish() {} - digestInto(_out: Uint8Array): Uint8Array { - throw new Error('KeccakPRG: digest is not allowed, please use .fetch instead.'); - } - fetch(bytes: number): Uint8Array { - return this.xof(bytes); - } - // Ensure irreversibility (even if state leaked previous outputs cannot be computed) - forget() { - if (this.rate < 1600 / 2 + 1) throw new Error('KeccakPRG: rate too low to use forget'); - this.keccak(); - for (let i = 0; i < this.blockLen; i++) this.state[i] = 0; - this.pos = this.blockLen; - this.keccak(); - this.posOut = this.blockLen; - } - _cloneInto(to?: KeccakPRG): KeccakPRG { - const { rate } = this; - to ||= new KeccakPRG(1600 - rate); - super._cloneInto(to); - to.rate = rate; - return to; - } - clone(): KeccakPRG { - return this._cloneInto(); - } -} - -export const keccakprg = (capacity = 254) => new KeccakPRG(capacity); diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/sha3.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/sha3.ts deleted file mode 100644 index c730b069..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/sha3.ts +++ /dev/null @@ -1,223 +0,0 @@ -import { bytes, exists, number, output } from './_assert.js'; -import { rotlBH, rotlBL, rotlSH, rotlSL, split } from './_u64.js'; -import { - Hash, - u32, - Input, - toBytes, - wrapConstructor, - wrapXOFConstructorWithOpts, - HashXOF, -} from './utils.js'; - -// SHA3 (keccak) is based on a new design: basically, the internal state is bigger than output size. -// It's called a sponge function. - -// Various per round constants calculations -const [SHA3_PI, SHA3_ROTL, _SHA3_IOTA]: [number[], number[], bigint[]] = [[], [], []]; -const _0n = /* @__PURE__ */ BigInt(0); -const _1n = /* @__PURE__ */ BigInt(1); -const _2n = /* @__PURE__ */ BigInt(2); -const _7n = /* @__PURE__ */ BigInt(7); -const _256n = /* @__PURE__ */ BigInt(256); -const _0x71n = /* @__PURE__ */ BigInt(0x71); -for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) { - // Pi - [x, y] = [y, (2 * x + 3 * y) % 5]; - SHA3_PI.push(2 * (5 * y + x)); - // Rotational - SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64); - // Iota - let t = _0n; - for (let j = 0; j < 7; j++) { - R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n; - if (R & _2n) t ^= _1n << ((_1n << /* @__PURE__ */ BigInt(j)) - _1n); - } - _SHA3_IOTA.push(t); -} -const [SHA3_IOTA_H, SHA3_IOTA_L] = /* @__PURE__ */ split(_SHA3_IOTA, true); - -// Left rotation (without 0, 32, 64) -const rotlH = (h: number, l: number, s: number) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s)); -const rotlL = (h: number, l: number, s: number) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s)); - -// Same as keccakf1600, but allows to skip some rounds -export function keccakP(s: Uint32Array, rounds: number = 24) { - const B = new Uint32Array(5 * 2); - // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js) - for (let round = 24 - rounds; round < 24; round++) { - // Theta θ - for (let x = 0; x < 10; x++) B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40]; - for (let x = 0; x < 10; x += 2) { - const idx1 = (x + 8) % 10; - const idx0 = (x + 2) % 10; - const B0 = B[idx0]; - const B1 = B[idx0 + 1]; - const Th = rotlH(B0, B1, 1) ^ B[idx1]; - const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1]; - for (let y = 0; y < 50; y += 10) { - s[x + y] ^= Th; - s[x + y + 1] ^= Tl; - } - } - // Rho (ρ) and Pi (π) - let curH = s[2]; - let curL = s[3]; - for (let t = 0; t < 24; t++) { - const shift = SHA3_ROTL[t]; - const Th = rotlH(curH, curL, shift); - const Tl = rotlL(curH, curL, shift); - const PI = SHA3_PI[t]; - curH = s[PI]; - curL = s[PI + 1]; - s[PI] = Th; - s[PI + 1] = Tl; - } - // Chi (χ) - for (let y = 0; y < 50; y += 10) { - for (let x = 0; x < 10; x++) B[x] = s[y + x]; - for (let x = 0; x < 10; x++) s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10]; - } - // Iota (ι) - s[0] ^= SHA3_IOTA_H[round]; - s[1] ^= SHA3_IOTA_L[round]; - } - B.fill(0); -} - -export class Keccak extends Hash implements HashXOF { - protected state: Uint8Array; - protected pos = 0; - protected posOut = 0; - protected finished = false; - protected state32: Uint32Array; - protected destroyed = false; - // NOTE: we accept arguments in bytes instead of bits here. - constructor( - public blockLen: number, - public suffix: number, - public outputLen: number, - protected enableXOF = false, - protected rounds: number = 24 - ) { - super(); - // Can be passed from user as dkLen - number(outputLen); - // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes - if (0 >= this.blockLen || this.blockLen >= 200) - throw new Error('Sha3 supports only keccak-f1600 function'); - this.state = new Uint8Array(200); - this.state32 = u32(this.state); - } - protected keccak() { - keccakP(this.state32, this.rounds); - this.posOut = 0; - this.pos = 0; - } - update(data: Input) { - exists(this); - const { blockLen, state } = this; - data = toBytes(data); - const len = data.length; - for (let pos = 0; pos < len; ) { - const take = Math.min(blockLen - this.pos, len - pos); - for (let i = 0; i < take; i++) state[this.pos++] ^= data[pos++]; - if (this.pos === blockLen) this.keccak(); - } - return this; - } - protected finish() { - if (this.finished) return; - this.finished = true; - const { state, suffix, pos, blockLen } = this; - // Do the padding - state[pos] ^= suffix; - if ((suffix & 0x80) !== 0 && pos === blockLen - 1) this.keccak(); - state[blockLen - 1] ^= 0x80; - this.keccak(); - } - protected writeInto(out: Uint8Array): Uint8Array { - exists(this, false); - bytes(out); - this.finish(); - const bufferOut = this.state; - const { blockLen } = this; - for (let pos = 0, len = out.length; pos < len; ) { - if (this.posOut >= blockLen) this.keccak(); - const take = Math.min(blockLen - this.posOut, len - pos); - out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); - this.posOut += take; - pos += take; - } - return out; - } - xofInto(out: Uint8Array): Uint8Array { - // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF - if (!this.enableXOF) throw new Error('XOF is not possible for this instance'); - return this.writeInto(out); - } - xof(bytes: number): Uint8Array { - number(bytes); - return this.xofInto(new Uint8Array(bytes)); - } - digestInto(out: Uint8Array) { - output(out, this); - if (this.finished) throw new Error('digest() was already called'); - this.writeInto(out); - this.destroy(); - return out; - } - digest() { - return this.digestInto(new Uint8Array(this.outputLen)); - } - destroy() { - this.destroyed = true; - this.state.fill(0); - } - _cloneInto(to?: Keccak): Keccak { - const { blockLen, suffix, outputLen, rounds, enableXOF } = this; - to ||= new Keccak(blockLen, suffix, outputLen, enableXOF, rounds); - to.state32.set(this.state32); - to.pos = this.pos; - to.posOut = this.posOut; - to.finished = this.finished; - to.rounds = rounds; - // Suffix can change in cSHAKE - to.suffix = suffix; - to.outputLen = outputLen; - to.enableXOF = enableXOF; - to.destroyed = this.destroyed; - return to; - } -} - -const gen = (suffix: number, blockLen: number, outputLen: number) => - wrapConstructor(() => new Keccak(blockLen, suffix, outputLen)); - -export const sha3_224 = /* @__PURE__ */ gen(0x06, 144, 224 / 8); -/** - * SHA3-256 hash function - * @param message - that would be hashed - */ -export const sha3_256 = /* @__PURE__ */ gen(0x06, 136, 256 / 8); -export const sha3_384 = /* @__PURE__ */ gen(0x06, 104, 384 / 8); -export const sha3_512 = /* @__PURE__ */ gen(0x06, 72, 512 / 8); -export const keccak_224 = /* @__PURE__ */ gen(0x01, 144, 224 / 8); -/** - * keccak-256 hash function. Different from SHA3-256. - * @param message - that would be hashed - */ -export const keccak_256 = /* @__PURE__ */ gen(0x01, 136, 256 / 8); -export const keccak_384 = /* @__PURE__ */ gen(0x01, 104, 384 / 8); -export const keccak_512 = /* @__PURE__ */ gen(0x01, 72, 512 / 8); - -export type ShakeOpts = { dkLen?: number }; - -const genShake = (suffix: number, blockLen: number, outputLen: number) => - wrapXOFConstructorWithOpts, ShakeOpts>( - (opts: ShakeOpts = {}) => - new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true) - ); - -export const shake128 = /* @__PURE__ */ genShake(0x1f, 168, 128 / 8); -export const shake256 = /* @__PURE__ */ genShake(0x1f, 136, 256 / 8); diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/sha512.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/sha512.ts deleted file mode 100644 index 27b7ac5e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/sha512.ts +++ /dev/null @@ -1,246 +0,0 @@ -import { SHA2 } from './_sha2.js'; -import u64 from './_u64.js'; -import { wrapConstructor } from './utils.js'; - -// Round contants (first 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409): -// prettier-ignore -const [SHA512_Kh, SHA512_Kl] = /* @__PURE__ */ (() => u64.split([ - '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc', - '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118', - '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2', - '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694', - '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65', - '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5', - '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4', - '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70', - '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df', - '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b', - '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30', - '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8', - '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8', - '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3', - '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec', - '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b', - '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178', - '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b', - '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c', - '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817' -].map(n => BigInt(n))))(); - -// Temporary buffer, not used to store anything between runs -const SHA512_W_H = /* @__PURE__ */ new Uint32Array(80); -const SHA512_W_L = /* @__PURE__ */ new Uint32Array(80); -export class SHA512 extends SHA2 { - // We cannot use array here since array allows indexing by variable which means optimizer/compiler cannot use registers. - // Also looks cleaner and easier to verify with spec. - // Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19): - // h -- high 32 bits, l -- low 32 bits - Ah = 0x6a09e667 | 0; - Al = 0xf3bcc908 | 0; - Bh = 0xbb67ae85 | 0; - Bl = 0x84caa73b | 0; - Ch = 0x3c6ef372 | 0; - Cl = 0xfe94f82b | 0; - Dh = 0xa54ff53a | 0; - Dl = 0x5f1d36f1 | 0; - Eh = 0x510e527f | 0; - El = 0xade682d1 | 0; - Fh = 0x9b05688c | 0; - Fl = 0x2b3e6c1f | 0; - Gh = 0x1f83d9ab | 0; - Gl = 0xfb41bd6b | 0; - Hh = 0x5be0cd19 | 0; - Hl = 0x137e2179 | 0; - - constructor() { - super(128, 64, 16, false); - } - // prettier-ignore - protected get(): [ - number, number, number, number, number, number, number, number, - number, number, number, number, number, number, number, number - ] { - const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; - return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl]; - } - // prettier-ignore - protected set( - Ah: number, Al: number, Bh: number, Bl: number, Ch: number, Cl: number, Dh: number, Dl: number, - Eh: number, El: number, Fh: number, Fl: number, Gh: number, Gl: number, Hh: number, Hl: number - ) { - this.Ah = Ah | 0; - this.Al = Al | 0; - this.Bh = Bh | 0; - this.Bl = Bl | 0; - this.Ch = Ch | 0; - this.Cl = Cl | 0; - this.Dh = Dh | 0; - this.Dl = Dl | 0; - this.Eh = Eh | 0; - this.El = El | 0; - this.Fh = Fh | 0; - this.Fl = Fl | 0; - this.Gh = Gh | 0; - this.Gl = Gl | 0; - this.Hh = Hh | 0; - this.Hl = Hl | 0; - } - protected process(view: DataView, offset: number) { - // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array - for (let i = 0; i < 16; i++, offset += 4) { - SHA512_W_H[i] = view.getUint32(offset); - SHA512_W_L[i] = view.getUint32((offset += 4)); - } - for (let i = 16; i < 80; i++) { - // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7) - const W15h = SHA512_W_H[i - 15] | 0; - const W15l = SHA512_W_L[i - 15] | 0; - const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7); - const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7); - // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6) - const W2h = SHA512_W_H[i - 2] | 0; - const W2l = SHA512_W_L[i - 2] | 0; - const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6); - const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6); - // SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16]; - const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]); - const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]); - SHA512_W_H[i] = SUMh | 0; - SHA512_W_L[i] = SUMl | 0; - } - let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; - // Compression function main loop, 80 rounds - for (let i = 0; i < 80; i++) { - // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41) - const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41); - const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41); - //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; - const CHIh = (Eh & Fh) ^ (~Eh & Gh); - const CHIl = (El & Fl) ^ (~El & Gl); - // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i] - // prettier-ignore - const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]); - const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]); - const T1l = T1ll | 0; - // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39) - const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39); - const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39); - const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch); - const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl); - Hh = Gh | 0; - Hl = Gl | 0; - Gh = Fh | 0; - Gl = Fl | 0; - Fh = Eh | 0; - Fl = El | 0; - ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0)); - Dh = Ch | 0; - Dl = Cl | 0; - Ch = Bh | 0; - Cl = Bl | 0; - Bh = Ah | 0; - Bl = Al | 0; - const All = u64.add3L(T1l, sigma0l, MAJl); - Ah = u64.add3H(All, T1h, sigma0h, MAJh); - Al = All | 0; - } - // Add the compressed chunk to the current hash value - ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0)); - ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0)); - ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0)); - ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0)); - ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0)); - ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0)); - ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0)); - ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0)); - this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl); - } - protected roundClean() { - SHA512_W_H.fill(0); - SHA512_W_L.fill(0); - } - destroy() { - this.buffer.fill(0); - this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - } -} - -class SHA512_224 extends SHA512 { - // h -- high 32 bits, l -- low 32 bits - Ah = 0x8c3d37c8 | 0; - Al = 0x19544da2 | 0; - Bh = 0x73e19966 | 0; - Bl = 0x89dcd4d6 | 0; - Ch = 0x1dfab7ae | 0; - Cl = 0x32ff9c82 | 0; - Dh = 0x679dd514 | 0; - Dl = 0x582f9fcf | 0; - Eh = 0x0f6d2b69 | 0; - El = 0x7bd44da8 | 0; - Fh = 0x77e36f73 | 0; - Fl = 0x04c48942 | 0; - Gh = 0x3f9d85a8 | 0; - Gl = 0x6a1d36c8 | 0; - Hh = 0x1112e6ad | 0; - Hl = 0x91d692a1 | 0; - - constructor() { - super(); - this.outputLen = 28; - } -} - -class SHA512_256 extends SHA512 { - // h -- high 32 bits, l -- low 32 bits - Ah = 0x22312194 | 0; - Al = 0xfc2bf72c | 0; - Bh = 0x9f555fa3 | 0; - Bl = 0xc84c64c2 | 0; - Ch = 0x2393b86b | 0; - Cl = 0x6f53b151 | 0; - Dh = 0x96387719 | 0; - Dl = 0x5940eabd | 0; - Eh = 0x96283ee2 | 0; - El = 0xa88effe3 | 0; - Fh = 0xbe5e1e25 | 0; - Fl = 0x53863992 | 0; - Gh = 0x2b0199fc | 0; - Gl = 0x2c85b8aa | 0; - Hh = 0x0eb72ddc | 0; - Hl = 0x81c52ca2 | 0; - - constructor() { - super(); - this.outputLen = 32; - } -} - -class SHA384 extends SHA512 { - // h -- high 32 bits, l -- low 32 bits - Ah = 0xcbbb9d5d | 0; - Al = 0xc1059ed8 | 0; - Bh = 0x629a292a | 0; - Bl = 0x367cd507 | 0; - Ch = 0x9159015a | 0; - Cl = 0x3070dd17 | 0; - Dh = 0x152fecd8 | 0; - Dl = 0xf70e5939 | 0; - Eh = 0x67332667 | 0; - El = 0xffc00b31 | 0; - Fh = 0x8eb44a87 | 0; - Fl = 0x68581511 | 0; - Gh = 0xdb0c2e0d | 0; - Gl = 0x64f98fa7 | 0; - Hh = 0x47b5481d | 0; - Hl = 0xbefa4fa4 | 0; - - constructor() { - super(); - this.outputLen = 48; - } -} - -export const sha512 = /* @__PURE__ */ wrapConstructor(() => new SHA512()); -export const sha512_224 = /* @__PURE__ */ wrapConstructor(() => new SHA512_224()); -export const sha512_256 = /* @__PURE__ */ wrapConstructor(() => new SHA512_256()); -export const sha384 = /* @__PURE__ */ wrapConstructor(() => new SHA384()); diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/utils.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/utils.ts deleted file mode 100644 index 81e52560..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/src/utils.ts +++ /dev/null @@ -1,215 +0,0 @@ -/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ - -// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+. -// node.js versions earlier than v19 don't declare it in global scope. -// For node.js, package.json#exports field mapping rewrites import -// from `crypto` to `cryptoNode`, which imports native module. -// Makes the utils un-importable in browsers without a bundler. -// Once node.js 18 is deprecated, we can just drop the import. -import { crypto } from '@noble/hashes/crypto'; - -// prettier-ignore -export type TypedArray = Int8Array | Uint8ClampedArray | Uint8Array | - Uint16Array | Int16Array | Uint32Array | Int32Array; - -const u8a = (a: any): a is Uint8Array => a instanceof Uint8Array; -// Cast array to different type -export const u8 = (arr: TypedArray) => new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength); -export const u32 = (arr: TypedArray) => - new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); - -// Cast array to view -export const createView = (arr: TypedArray) => - new DataView(arr.buffer, arr.byteOffset, arr.byteLength); - -// The rotate right (circular right shift) operation for uint32 -export const rotr = (word: number, shift: number) => (word << (32 - shift)) | (word >>> shift); - -// big-endian hardware is rare. Just in case someone still decides to run hashes: -// early-throw an error because we don't support BE yet. -export const isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44; -if (!isLE) throw new Error('Non little-endian hardware is not supported'); - -const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => - i.toString(16).padStart(2, '0') -); -/** - * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123' - */ -export function bytesToHex(bytes: Uint8Array): string { - if (!u8a(bytes)) throw new Error('Uint8Array expected'); - // pre-caching improves the speed 6x - let hex = ''; - for (let i = 0; i < bytes.length; i++) { - hex += hexes[bytes[i]]; - } - return hex; -} - -/** - * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23]) - */ -export function hexToBytes(hex: string): Uint8Array { - if (typeof hex !== 'string') throw new Error('hex string expected, got ' + typeof hex); - const len = hex.length; - if (len % 2) throw new Error('padded hex string expected, got unpadded hex of length ' + len); - const array = new Uint8Array(len / 2); - for (let i = 0; i < array.length; i++) { - const j = i * 2; - const hexByte = hex.slice(j, j + 2); - const byte = Number.parseInt(hexByte, 16); - if (Number.isNaN(byte) || byte < 0) throw new Error('Invalid byte sequence'); - array[i] = byte; - } - return array; -} - -// There is no setImmediate in browser and setTimeout is slow. -// call of async fn will return Promise, which will be fullfiled only on -// next scheduler queue processing step and this is exactly what we need. -export const nextTick = async () => {}; - -// Returns control to thread each 'tick' ms to avoid blocking -export async function asyncLoop(iters: number, tick: number, cb: (i: number) => void) { - let ts = Date.now(); - for (let i = 0; i < iters; i++) { - cb(i); - // Date.now() is not monotonic, so in case if clock goes backwards we return return control too - const diff = Date.now() - ts; - if (diff >= 0 && diff < tick) continue; - await nextTick(); - ts += diff; - } -} - -// Global symbols in both browsers and Node.js since v11 -// See https://github.com/microsoft/TypeScript/issues/31535 -declare const TextEncoder: any; - -/** - * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99]) - */ -export function utf8ToBytes(str: string): Uint8Array { - if (typeof str !== 'string') throw new Error(`utf8ToBytes expected string, got ${typeof str}`); - return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809 -} - -export type Input = Uint8Array | string; -/** - * Normalizes (non-hex) string or Uint8Array to Uint8Array. - * Warning: when Uint8Array is passed, it would NOT get copied. - * Keep in mind for future mutable operations. - */ -export function toBytes(data: Input): Uint8Array { - if (typeof data === 'string') data = utf8ToBytes(data); - if (!u8a(data)) throw new Error(`expected Uint8Array, got ${typeof data}`); - return data; -} - -/** - * Copies several Uint8Arrays into one. - */ -export function concatBytes(...arrays: Uint8Array[]): Uint8Array { - const r = new Uint8Array(arrays.reduce((sum, a) => sum + a.length, 0)); - let pad = 0; // walk through each item, ensure they have proper type - arrays.forEach((a) => { - if (!u8a(a)) throw new Error('Uint8Array expected'); - r.set(a, pad); - pad += a.length; - }); - return r; -} - -// For runtime check if class implements interface -export abstract class Hash> { - abstract blockLen: number; // Bytes per block - abstract outputLen: number; // Bytes in output - abstract update(buf: Input): this; - // Writes digest into buf - abstract digestInto(buf: Uint8Array): void; - abstract digest(): Uint8Array; - /** - * Resets internal state. Makes Hash instance unusable. - * Reset is impossible for keyed hashes if key is consumed into state. If digest is not consumed - * by user, they will need to manually call `destroy()` when zeroing is necessary. - */ - abstract destroy(): void; - /** - * Clones hash instance. Unsafe: doesn't check whether `to` is valid. Can be used as `clone()` - * when no options are passed. - * Reasons to use `_cloneInto` instead of clone: 1) performance 2) reuse instance => all internal - * buffers are overwritten => causes buffer overwrite which is used for digest in some cases. - * There are no guarantees for clean-up because it's impossible in JS. - */ - abstract _cloneInto(to?: T): T; - // Safe version that clones internal state - clone(): T { - return this._cloneInto(); - } -} - -/** - * XOF: streaming API to read digest in chunks. - * Same as 'squeeze' in keccak/k12 and 'seek' in blake3, but more generic name. - * When hash used in XOF mode it is up to user to call '.destroy' afterwards, since we cannot - * destroy state, next call can require more bytes. - */ -export type HashXOF> = Hash & { - xof(bytes: number): Uint8Array; // Read 'bytes' bytes from digest stream - xofInto(buf: Uint8Array): Uint8Array; // read buf.length bytes from digest stream into buf -}; - -const toStr = {}.toString; -type EmptyObj = {}; -export function checkOpts( - defaults: T1, - opts?: T2 -): T1 & T2 { - if (opts !== undefined && toStr.call(opts) !== '[object Object]') - throw new Error('Options should be object or undefined'); - const merged = Object.assign(defaults, opts); - return merged as T1 & T2; -} - -export type CHash = ReturnType; - -export function wrapConstructor>(hashCons: () => Hash) { - const hashC = (msg: Input): Uint8Array => hashCons().update(toBytes(msg)).digest(); - const tmp = hashCons(); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = () => hashCons(); - return hashC; -} - -export function wrapConstructorWithOpts, T extends Object>( - hashCons: (opts?: T) => Hash -) { - const hashC = (msg: Input, opts?: T): Uint8Array => hashCons(opts).update(toBytes(msg)).digest(); - const tmp = hashCons({} as T); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = (opts: T) => hashCons(opts); - return hashC; -} - -export function wrapXOFConstructorWithOpts, T extends Object>( - hashCons: (opts?: T) => HashXOF -) { - const hashC = (msg: Input, opts?: T): Uint8Array => hashCons(opts).update(toBytes(msg)).digest(); - const tmp = hashCons({} as T); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = (opts: T) => hashCons(opts); - return hashC; -} - -/** - * Secure PRNG. Uses `crypto.getRandomValues`, which defers to OS. - */ -export function randomBytes(bytesLength = 32): Uint8Array { - if (crypto && typeof crypto.getRandomValues === 'function') { - return crypto.getRandomValues(new Uint8Array(bytesLength)); - } - throw new Error('crypto.getRandomValues must be defined'); -} diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/utils.d.ts b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/utils.d.ts deleted file mode 100644 index a0017e4b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/utils.d.ts +++ /dev/null @@ -1,90 +0,0 @@ -/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -export type TypedArray = Int8Array | Uint8ClampedArray | Uint8Array | Uint16Array | Int16Array | Uint32Array | Int32Array; -export declare const u8: (arr: TypedArray) => Uint8Array; -export declare const u32: (arr: TypedArray) => Uint32Array; -export declare const createView: (arr: TypedArray) => DataView; -export declare const rotr: (word: number, shift: number) => number; -export declare const isLE: boolean; -/** - * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123' - */ -export declare function bytesToHex(bytes: Uint8Array): string; -/** - * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23]) - */ -export declare function hexToBytes(hex: string): Uint8Array; -export declare const nextTick: () => Promise; -export declare function asyncLoop(iters: number, tick: number, cb: (i: number) => void): Promise; -/** - * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99]) - */ -export declare function utf8ToBytes(str: string): Uint8Array; -export type Input = Uint8Array | string; -/** - * Normalizes (non-hex) string or Uint8Array to Uint8Array. - * Warning: when Uint8Array is passed, it would NOT get copied. - * Keep in mind for future mutable operations. - */ -export declare function toBytes(data: Input): Uint8Array; -/** - * Copies several Uint8Arrays into one. - */ -export declare function concatBytes(...arrays: Uint8Array[]): Uint8Array; -export declare abstract class Hash> { - abstract blockLen: number; - abstract outputLen: number; - abstract update(buf: Input): this; - abstract digestInto(buf: Uint8Array): void; - abstract digest(): Uint8Array; - /** - * Resets internal state. Makes Hash instance unusable. - * Reset is impossible for keyed hashes if key is consumed into state. If digest is not consumed - * by user, they will need to manually call `destroy()` when zeroing is necessary. - */ - abstract destroy(): void; - /** - * Clones hash instance. Unsafe: doesn't check whether `to` is valid. Can be used as `clone()` - * when no options are passed. - * Reasons to use `_cloneInto` instead of clone: 1) performance 2) reuse instance => all internal - * buffers are overwritten => causes buffer overwrite which is used for digest in some cases. - * There are no guarantees for clean-up because it's impossible in JS. - */ - abstract _cloneInto(to?: T): T; - clone(): T; -} -/** - * XOF: streaming API to read digest in chunks. - * Same as 'squeeze' in keccak/k12 and 'seek' in blake3, but more generic name. - * When hash used in XOF mode it is up to user to call '.destroy' afterwards, since we cannot - * destroy state, next call can require more bytes. - */ -export type HashXOF> = Hash & { - xof(bytes: number): Uint8Array; - xofInto(buf: Uint8Array): Uint8Array; -}; -type EmptyObj = {}; -export declare function checkOpts(defaults: T1, opts?: T2): T1 & T2; -export type CHash = ReturnType; -export declare function wrapConstructor>(hashCons: () => Hash): { - (msg: Input): Uint8Array; - outputLen: number; - blockLen: number; - create(): Hash; -}; -export declare function wrapConstructorWithOpts, T extends Object>(hashCons: (opts?: T) => Hash): { - (msg: Input, opts?: T): Uint8Array; - outputLen: number; - blockLen: number; - create(opts: T): Hash; -}; -export declare function wrapXOFConstructorWithOpts, T extends Object>(hashCons: (opts?: T) => HashXOF): { - (msg: Input, opts?: T): Uint8Array; - outputLen: number; - blockLen: number; - create(opts: T): HashXOF; -}; -/** - * Secure PRNG. Uses `crypto.getRandomValues`, which defers to OS. - */ -export declare function randomBytes(bytesLength?: number): Uint8Array; -export {}; diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/utils.js b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/utils.js deleted file mode 100644 index 2ffcbbee..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/utils.js +++ /dev/null @@ -1,174 +0,0 @@ -"use strict"; -/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.randomBytes = exports.wrapXOFConstructorWithOpts = exports.wrapConstructorWithOpts = exports.wrapConstructor = exports.checkOpts = exports.Hash = exports.concatBytes = exports.toBytes = exports.utf8ToBytes = exports.asyncLoop = exports.nextTick = exports.hexToBytes = exports.bytesToHex = exports.isLE = exports.rotr = exports.createView = exports.u32 = exports.u8 = void 0; -// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+. -// node.js versions earlier than v19 don't declare it in global scope. -// For node.js, package.json#exports field mapping rewrites import -// from `crypto` to `cryptoNode`, which imports native module. -// Makes the utils un-importable in browsers without a bundler. -// Once node.js 18 is deprecated, we can just drop the import. -const crypto_1 = require("@noble/hashes/crypto"); -const u8a = (a) => a instanceof Uint8Array; -// Cast array to different type -const u8 = (arr) => new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength); -exports.u8 = u8; -const u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); -exports.u32 = u32; -// Cast array to view -const createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength); -exports.createView = createView; -// The rotate right (circular right shift) operation for uint32 -const rotr = (word, shift) => (word << (32 - shift)) | (word >>> shift); -exports.rotr = rotr; -// big-endian hardware is rare. Just in case someone still decides to run hashes: -// early-throw an error because we don't support BE yet. -exports.isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44; -if (!exports.isLE) - throw new Error('Non little-endian hardware is not supported'); -const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0')); -/** - * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123' - */ -function bytesToHex(bytes) { - if (!u8a(bytes)) - throw new Error('Uint8Array expected'); - // pre-caching improves the speed 6x - let hex = ''; - for (let i = 0; i < bytes.length; i++) { - hex += hexes[bytes[i]]; - } - return hex; -} -exports.bytesToHex = bytesToHex; -/** - * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23]) - */ -function hexToBytes(hex) { - if (typeof hex !== 'string') - throw new Error('hex string expected, got ' + typeof hex); - const len = hex.length; - if (len % 2) - throw new Error('padded hex string expected, got unpadded hex of length ' + len); - const array = new Uint8Array(len / 2); - for (let i = 0; i < array.length; i++) { - const j = i * 2; - const hexByte = hex.slice(j, j + 2); - const byte = Number.parseInt(hexByte, 16); - if (Number.isNaN(byte) || byte < 0) - throw new Error('Invalid byte sequence'); - array[i] = byte; - } - return array; -} -exports.hexToBytes = hexToBytes; -// There is no setImmediate in browser and setTimeout is slow. -// call of async fn will return Promise, which will be fullfiled only on -// next scheduler queue processing step and this is exactly what we need. -const nextTick = async () => { }; -exports.nextTick = nextTick; -// Returns control to thread each 'tick' ms to avoid blocking -async function asyncLoop(iters, tick, cb) { - let ts = Date.now(); - for (let i = 0; i < iters; i++) { - cb(i); - // Date.now() is not monotonic, so in case if clock goes backwards we return return control too - const diff = Date.now() - ts; - if (diff >= 0 && diff < tick) - continue; - await (0, exports.nextTick)(); - ts += diff; - } -} -exports.asyncLoop = asyncLoop; -/** - * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99]) - */ -function utf8ToBytes(str) { - if (typeof str !== 'string') - throw new Error(`utf8ToBytes expected string, got ${typeof str}`); - return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809 -} -exports.utf8ToBytes = utf8ToBytes; -/** - * Normalizes (non-hex) string or Uint8Array to Uint8Array. - * Warning: when Uint8Array is passed, it would NOT get copied. - * Keep in mind for future mutable operations. - */ -function toBytes(data) { - if (typeof data === 'string') - data = utf8ToBytes(data); - if (!u8a(data)) - throw new Error(`expected Uint8Array, got ${typeof data}`); - return data; -} -exports.toBytes = toBytes; -/** - * Copies several Uint8Arrays into one. - */ -function concatBytes(...arrays) { - const r = new Uint8Array(arrays.reduce((sum, a) => sum + a.length, 0)); - let pad = 0; // walk through each item, ensure they have proper type - arrays.forEach((a) => { - if (!u8a(a)) - throw new Error('Uint8Array expected'); - r.set(a, pad); - pad += a.length; - }); - return r; -} -exports.concatBytes = concatBytes; -// For runtime check if class implements interface -class Hash { - // Safe version that clones internal state - clone() { - return this._cloneInto(); - } -} -exports.Hash = Hash; -const toStr = {}.toString; -function checkOpts(defaults, opts) { - if (opts !== undefined && toStr.call(opts) !== '[object Object]') - throw new Error('Options should be object or undefined'); - const merged = Object.assign(defaults, opts); - return merged; -} -exports.checkOpts = checkOpts; -function wrapConstructor(hashCons) { - const hashC = (msg) => hashCons().update(toBytes(msg)).digest(); - const tmp = hashCons(); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = () => hashCons(); - return hashC; -} -exports.wrapConstructor = wrapConstructor; -function wrapConstructorWithOpts(hashCons) { - const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest(); - const tmp = hashCons({}); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = (opts) => hashCons(opts); - return hashC; -} -exports.wrapConstructorWithOpts = wrapConstructorWithOpts; -function wrapXOFConstructorWithOpts(hashCons) { - const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest(); - const tmp = hashCons({}); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = (opts) => hashCons(opts); - return hashC; -} -exports.wrapXOFConstructorWithOpts = wrapXOFConstructorWithOpts; -/** - * Secure PRNG. Uses `crypto.getRandomValues`, which defers to OS. - */ -function randomBytes(bytesLength = 32) { - if (crypto_1.crypto && typeof crypto_1.crypto.getRandomValues === 'function') { - return crypto_1.crypto.getRandomValues(new Uint8Array(bytesLength)); - } - throw new Error('crypto.getRandomValues must be defined'); -} -exports.randomBytes = randomBytes; -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/utils.js.map b/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/utils.js.map deleted file mode 100644 index 4fc2171d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/node_modules/@noble/hashes/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources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,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACjG,MAAM,GAAG,GAAG,QAAQ,CAAC,EAAO,CAAC,CAAC;IAC9B,KAAK,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC;IAChC,KAAK,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;IAC9B,KAAK,CAAC,MAAM,GAAG,CAAC,IAAO,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC3C,OAAO,KAAK,CAAC;AACf,CAAC;AATD,gEASC;AAED;;GAEG;AACH,SAAgB,WAAW,CAAC,WAAW,GAAG,EAAE;IAC1C,IAAI,eAAM,IAAI,OAAO,eAAM,CAAC,eAAe,KAAK,UAAU,EAAE;QAC1D,OAAO,eAAM,CAAC,eAAe,CAAC,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC;KAC5D;IACD,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;AAC5D,CAAC;AALD,kCAKC"} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/ethers/package.json b/tools/mnemonic-test/node_modules/ethers/package.json deleted file mode 100644 index a4350950..00000000 --- a/tools/mnemonic-test/node_modules/ethers/package.json +++ /dev/null @@ -1,135 +0,0 @@ -{ - "author": "Richard Moore ", - "browser": { - "./lib.esm/crypto/crypto.js": "./lib.esm/crypto/crypto-browser.js", - "./lib.esm/providers/provider-ipcsocket.js": "./lib.esm/providers/provider-ipcsocket-browser.js", - "./lib.esm/providers/ws.js": "./lib.esm/providers/ws-browser.js", - "./lib.esm/utils/base64.js": "./lib.esm/utils/base64-browser.js", - "./lib.esm/utils/geturl.js": "./lib.esm/utils/geturl-browser.js", - "./lib.esm/wordlists/wordlists.js": "./lib.esm/wordlists/wordlists-browser.js" - }, - "dependencies": { - "@adraffy/ens-normalize": "1.10.1", - "@noble/curves": "1.2.0", - "@noble/hashes": "1.3.2", - "@types/node": "22.7.5", - "aes-js": "4.0.0-beta.5", - "tslib": "2.7.0", - "ws": "8.17.1" - }, - "description": "A complete and compact Ethereum library, for dapps, wallets and any other tools.", - "devDependencies": { - "@rollup/plugin-node-resolve": "15.3.0", - "@types/mocha": "10.0.9", - "@types/semver": "7.5.8", - "c8": "7.12.0", - "mocha": "10.7.3", - "rollup": "4.24.0", - "semver": "7.6.3", - "typescript": "5.0.4", - "uglify-js": "3.19.3" - }, - "engines": { - "node": ">=14.0.0" - }, - "ethereum": "donations.ethers.eth", - "exports": { - ".": { - "import": "./lib.esm/index.js", - "default": "./lib.commonjs/index.js" - }, - "./abi": { - "import": "./lib.esm/abi/index.js", - "default": "./lib.commonjs/abi/index.js" - }, - "./address": { - "import": "./lib.esm/address/index.js", - "default": "./lib.commonjs/address/index.js" - }, - "./constants": { - "import": "./lib.esm/constants/index.js", - "default": "./lib.commonjs/constants/index.js" - }, - "./contract": { - "import": "./lib.esm/contract/index.js", - "default": "./lib.commonjs/contract/index.js" - }, - "./crypto": { - "import": "./lib.esm/crypto/index.js", - "default": "./lib.commonjs/crypto/index.js" - }, - "./hash": { - "import": "./lib.esm/hash/index.js", - "default": "./lib.commonjs/hash/index.js" - }, - "./providers": { - "import": "./lib.esm/providers/index.js", - "default": "./lib.commonjs/providers/index.js" - }, - "./transaction": { - "import": "./lib.esm/transaction/index.js", - "default": "./lib.commonjs/transaction/index.js" - }, - "./utils": { - "import": "./lib.esm/utils/index.js", - "default": "./lib.commonjs/utils/index.js" - }, - "./wallet": { - "import": "./lib.esm/wallet/index.js", - "default": "./lib.commonjs/wallet/index.js" - }, - "./wordlists": { - "import": "./lib.esm/wordlists/index.js", - "default": "./lib.commonjs/wordlists/index.js" - } - }, - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/ethers-io/" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "gitHead": "88dfe96cf56ad41d0a18b1ef8cac4209aa80905e", - "homepage": "https://ethers.org", - "keywords": [ - "ethereum", - "ethers", - "ethersjs" - ], - "license": "MIT", - "main": "./lib.commonjs/index.js", - "module": "./lib.esm/index.js", - "name": "ethers", - "publishConfig": { - "access": "public", - "tag": "latest" - }, - "repository": { - "type": "git", - "url": "git://github.com/ethers-io/ethers.js.git" - }, - "scripts": { - "_build-dist": "rollup -c && uglifyjs ./dist/ethers.js -o ./dist/ethers.min.js && uglifyjs ./dist/ethers.umd.js -o ./dist/ethers.umd.min.js && uglifyjs ./dist/wordlists-extra.js -o ./dist/wordlists-extra.min.js", - "_dist-stats": "gzip -k9f -S '.gz' ./dist/ethers.min.js && gzip -k9f -S '.gz' ./dist/ethers.umd.min.js && gzip -k9f -S '.gz' ./dist/wordlists-extra.min.js && du -hs ./dist/*.gz && echo '' && du -hs ./dist/*.js", - "auto-build": "npm run build -- -w", - "build": "tsc --project tsconfig.esm.json", - "build-all": "npm run build && npm run build-commonjs", - "build-clean": "npm run clean && npm run build && node lib.esm/_admin/update-version.js && node lib.esm/_admin/update-changelog.js && npm run build-all && npm run _build-dist && npm run _dist-stats", - "build-commonjs": "tsc --project tsconfig.commonjs.json", - "build-dist": "npm run build && npm run _build-dist && npm run _dist-stats", - "clean": "rm -rf dist lib.esm lib.commonjs && cp -r misc/basedirs/* .", - "postpublish": "node lib.esm/_admin/create-release.js", - "stats": "echo 'Dependencies' && npm ls --all --omit=dev", - "test": "npm run test-esm", - "test-browser": "node lib.esm/_admin/test-browser", - "test-commonjs": "mocha --reporter ./reporter.cjs ./lib.commonjs/_tests/test-*.js", - "test-coverage": "c8 -o output -r lcov -r text mocha --no-color --reporter ./reporter.cjs ./lib.esm/_tests/test-*.js | tee output/summary.txt", - "test-esm": "mocha --trace-warnings --reporter ./reporter.cjs ./lib.esm/_tests/test-*.js" - }, - "sideEffects": false, - "version": "6.16.0" -} diff --git a/tools/mnemonic-test/node_modules/ethers/rollup.config.mjs b/tools/mnemonic-test/node_modules/ethers/rollup.config.mjs deleted file mode 100644 index 8a86d83f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/rollup.config.mjs +++ /dev/null @@ -1,50 +0,0 @@ - -import { nodeResolve } from '@rollup/plugin-node-resolve'; - -function getConfig(opts) { - if (opts == null) { opts = { }; } - - const file = `./dist/ethers${ (opts.suffix || "") }.js`; - const exportConditions = [ "import", "default" ]; - const mainFields = [ "module", "main" ]; - if (opts.browser) { mainFields.unshift("browser"); } - - return { - input: "./lib.esm/index.js", - output: { - file, - banner: "const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !== 'undefined' ? window: typeof global !== 'undefined' ? global: typeof self !== 'undefined' ? self: {});", - name: (opts.name || undefined), - format: (opts.format || "esm"), - sourcemap: true - }, - context: "__$G", - treeshake: true, - plugins: [ nodeResolve({ - exportConditions, - mainFields, - modulesOnly: true, - preferBuiltins: false - }) ], - }; -} - -export default [ - getConfig({ browser: true }), - getConfig({ browser: true, suffix: ".umd", format: "umd", name: "ethers" }), - { - input: "./lib.esm/wordlists/wordlists-extra.js", - output: { - file: "./dist/wordlists-extra.js", - format: "esm", - sourcemap: true - }, - treeshake: true, - plugins: [ nodeResolve({ - exportConditions: [ "default", "module", "import" ], - mainFields: [ "browser", "module", "main" ], - modulesOnly: true, - preferBuiltins: false - }) ], - } -]; diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/_version.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/_version.ts deleted file mode 100644 index d0b7cf03..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/_version.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* Do NOT modify this file; see /src.ts/_admin/update-version.ts */ - -/** - * The current version of Ethers. - */ -export const version: string = "6.16.0"; diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/abi/abi-coder.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/abi/abi-coder.ts deleted file mode 100644 index b19b443c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/abi/abi-coder.ts +++ /dev/null @@ -1,237 +0,0 @@ -/** - * When sending values to or receiving values from a [[Contract]], the - * data is generally encoded using the [ABI standard](link-solc-abi). - * - * The AbiCoder provides a utility to encode values to ABI data and - * decode values from ABI data. - * - * Most of the time, developers should favour the [[Contract]] class, - * which further abstracts a lot of the finer details of ABI data. - * - * @_section api/abi/abi-coder:ABI Encoding - */ - -// See: https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI - -import { assertArgumentCount, assertArgument } from "../utils/index.js"; - -import { Coder, Reader, Result, Writer } from "./coders/abstract-coder.js"; -import { AddressCoder } from "./coders/address.js"; -import { ArrayCoder } from "./coders/array.js"; -import { BooleanCoder } from "./coders/boolean.js"; -import { BytesCoder } from "./coders/bytes.js"; -import { FixedBytesCoder } from "./coders/fixed-bytes.js"; -import { NullCoder } from "./coders/null.js"; -import { NumberCoder } from "./coders/number.js"; -import { StringCoder } from "./coders/string.js"; -import { TupleCoder } from "./coders/tuple.js"; -import { ParamType } from "./fragments.js"; - -import { getAddress } from "../address/index.js"; -import { getBytes, hexlify, makeError } from "../utils/index.js"; - -import type { - BytesLike, - CallExceptionAction, CallExceptionError, CallExceptionTransaction -} from "../utils/index.js"; - -// https://docs.soliditylang.org/en/v0.8.17/control-structures.html -const PanicReasons: Map = new Map(); -PanicReasons.set(0x00, "GENERIC_PANIC"); -PanicReasons.set(0x01, "ASSERT_FALSE"); -PanicReasons.set(0x11, "OVERFLOW"); -PanicReasons.set(0x12, "DIVIDE_BY_ZERO"); -PanicReasons.set(0x21, "ENUM_RANGE_ERROR"); -PanicReasons.set(0x22, "BAD_STORAGE_DATA"); -PanicReasons.set(0x31, "STACK_UNDERFLOW"); -PanicReasons.set(0x32, "ARRAY_RANGE_ERROR"); -PanicReasons.set(0x41, "OUT_OF_MEMORY"); -PanicReasons.set(0x51, "UNINITIALIZED_FUNCTION_CALL"); - -const paramTypeBytes = new RegExp(/^bytes([0-9]*)$/); -const paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/); - - -let defaultCoder: null | AbiCoder = null; -let defaultMaxInflation = 1024; - -function getBuiltinCallException(action: CallExceptionAction, tx: { to?: null | string, from?: null | string, data?: string }, data: null | BytesLike, abiCoder: AbiCoder): CallExceptionError { - let message = "missing revert data"; - - let reason: null | string = null; - const invocation = null; - let revert: null | { signature: string, name: string, args: Array } = null; - - if (data) { - message = "execution reverted"; - - const bytes = getBytes(data); - data = hexlify(data); - - if (bytes.length === 0) { - message += " (no data present; likely require(false) occurred"; - reason = "require(false)"; - - } else if (bytes.length % 32 !== 4) { - message += " (could not decode reason; invalid data length)"; - - } else if (hexlify(bytes.slice(0, 4)) === "0x08c379a0") { - // Error(string) - try { - reason = abiCoder.decode([ "string" ], bytes.slice(4))[0] - revert = { - signature: "Error(string)", - name: "Error", - args: [ reason ] - }; - message += `: ${ JSON.stringify(reason) }`; - - } catch (error) { - message += " (could not decode reason; invalid string data)"; - } - - } else if (hexlify(bytes.slice(0, 4)) === "0x4e487b71") { - // Panic(uint256) - try { - const code = Number(abiCoder.decode([ "uint256" ], bytes.slice(4))[0]); - revert = { - signature: "Panic(uint256)", - name: "Panic", - args: [ code ] - }; - reason = `Panic due to ${ PanicReasons.get(code) || "UNKNOWN" }(${ code })`; - message += `: ${ reason }`; - } catch (error) { - message += " (could not decode panic code)"; - } - } else { - message += " (unknown custom error)"; - } - } - - const transaction: CallExceptionTransaction = { - to: (tx.to ? getAddress(tx.to): null), - data: (tx.data || "0x") - }; - if (tx.from) { transaction.from = getAddress(tx.from); } - - return makeError(message, "CALL_EXCEPTION", { - action, data, reason, transaction, invocation, revert - }); -} - -/** - * The **AbiCoder** is a low-level class responsible for encoding JavaScript - * values into binary data and decoding binary data into JavaScript values. - */ -export class AbiCoder { - - #getCoder(param: ParamType): Coder { - if (param.isArray()) { - return new ArrayCoder(this.#getCoder(param.arrayChildren), param.arrayLength, param.name); - } - - if (param.isTuple()) { - return new TupleCoder(param.components.map((c) => this.#getCoder(c)), param.name); - } - - switch (param.baseType) { - case "address": - return new AddressCoder(param.name); - case "bool": - return new BooleanCoder(param.name); - case "string": - return new StringCoder(param.name); - case "bytes": - return new BytesCoder(param.name); - case "": - return new NullCoder(param.name); - } - - // u?int[0-9]* - let match = param.type.match(paramTypeNumber); - if (match) { - let size = parseInt(match[2] || "256"); - assertArgument(size !== 0 && size <= 256 && (size % 8) === 0, - "invalid " + match[1] + " bit length", "param", param); - return new NumberCoder(size / 8, (match[1] === "int"), param.name); - } - - // bytes[0-9]+ - match = param.type.match(paramTypeBytes); - if (match) { - let size = parseInt(match[1]); - assertArgument(size !== 0 && size <= 32, "invalid bytes length", "param", param); - return new FixedBytesCoder(size, param.name); - } - - assertArgument(false, "invalid type", "type", param.type); - } - - /** - * Get the default values for the given %%types%%. - * - * For example, a ``uint`` is by default ``0`` and ``bool`` - * is by default ``false``. - */ - getDefaultValue(types: ReadonlyArray): Result { - const coders: Array = types.map((type) => this.#getCoder(ParamType.from(type))); - const coder = new TupleCoder(coders, "_"); - return coder.defaultValue(); - } - - /** - * Encode the %%values%% as the %%types%% into ABI data. - * - * @returns DataHexstring - */ - encode(types: ReadonlyArray, values: ReadonlyArray): string { - assertArgumentCount(values.length, types.length, "types/values length mismatch"); - - const coders = types.map((type) => this.#getCoder(ParamType.from(type))); - const coder = (new TupleCoder(coders, "_")); - - const writer = new Writer(); - coder.encode(writer, values); - return writer.data; - } - - /** - * Decode the ABI %%data%% as the %%types%% into values. - * - * If %%loose%% decoding is enabled, then strict padding is - * not enforced. Some older versions of Solidity incorrectly - * padded event data emitted from ``external`` functions. - */ - decode(types: ReadonlyArray, data: BytesLike, loose?: boolean): Result { - const coders: Array = types.map((type) => this.#getCoder(ParamType.from(type))); - const coder = new TupleCoder(coders, "_"); - return coder.decode(new Reader(data, loose, defaultMaxInflation)); - } - - static _setDefaultMaxInflation(value: number): void { - assertArgument(typeof(value) === "number" && Number.isInteger(value), "invalid defaultMaxInflation factor", "value", value); - defaultMaxInflation = value; - } - - /** - * Returns the shared singleton instance of a default [[AbiCoder]]. - * - * On the first call, the instance is created internally. - */ - static defaultAbiCoder(): AbiCoder { - if (defaultCoder == null) { - defaultCoder = new AbiCoder(); - } - return defaultCoder; - } - - /** - * Returns an ethers-compatible [[CallExceptionError]] Error for the given - * result %%data%% for the [[CallExceptionAction]] %%action%% against - * the Transaction %%tx%%. - */ - static getBuiltinCallException(action: CallExceptionAction, tx: { to?: null | string, from?: null | string, data?: string }, data: null | BytesLike): CallExceptionError { - return getBuiltinCallException(action, tx, data, AbiCoder.defaultAbiCoder()); - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/abi/bytes32.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/abi/bytes32.ts deleted file mode 100644 index 0a34d842..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/abi/bytes32.ts +++ /dev/null @@ -1,45 +0,0 @@ -/** - * About bytes32 strings... - * - * @_docloc: api/utils:Bytes32 Strings - */ - -import { - getBytes, toUtf8Bytes, toUtf8String, zeroPadBytes -} from "../utils/index.js"; - -import type { BytesLike } from "../utils/index.js"; - -/** - * Encodes %%text%% as a Bytes32 string. - */ -export function encodeBytes32String(text: string): string { - - // Get the bytes - const bytes = toUtf8Bytes(text); - - // Check we have room for null-termination - if (bytes.length > 31) { throw new Error("bytes32 string must be less than 32 bytes"); } - - // Zero-pad (implicitly null-terminates) - return zeroPadBytes(bytes, 32); -} - -/** - * Encodes the Bytes32-encoded %%bytes%% into a string. - */ -export function decodeBytes32String(_bytes: BytesLike): string { - const data = getBytes(_bytes, "bytes"); - - // Must be 32 bytes with a null-termination - if (data.length !== 32) { throw new Error("invalid bytes32 - not 32 bytes long"); } - if (data[31] !== 0) { throw new Error("invalid bytes32 string - no null terminator"); } - - // Find the null termination - let length = 31; - while (data[length - 1] === 0) { length--; } - - // Determine the string value - return toUtf8String(data.slice(0, length)); -} - diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/abi/coders/abstract-coder.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/abi/coders/abstract-coder.ts deleted file mode 100644 index 99f635ed..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/abi/coders/abstract-coder.ts +++ /dev/null @@ -1,541 +0,0 @@ - -import { - defineProperties, concat, getBytesCopy, getNumber, hexlify, - toBeArray, toBigInt, toNumber, - assert, assertArgument - /*, isError*/ -} from "../../utils/index.js"; - -import type { BigNumberish, BytesLike } from "../../utils/index.js"; - -/** - * @_ignore: - */ -export const WordSize: number = 32; -const Padding = new Uint8Array(WordSize); - -// Properties used to immediate pass through to the underlying object -// - `then` is used to detect if an object is a Promise for await -const passProperties = [ "then" ]; - -const _guard = { }; - -const resultNames: WeakMap> = new WeakMap(); - -function getNames(result: Result): ReadonlyArray { - return resultNames.get(result)!; -} -function setNames(result: Result, names: ReadonlyArray): void { - resultNames.set(result, names); -} - -function throwError(name: string, error: Error): never { - const wrapped = new Error(`deferred error during ABI decoding triggered accessing ${ name }`); - (wrapped).error = error; - throw wrapped; -} - -function toObject(names: ReadonlyArray, items: Result, deep?: boolean): Record | Array { - if (names.indexOf(null) >= 0) { - return items.map((item, index) => { - if (item instanceof Result) { - return toObject(getNames(item), item, deep); - } - return item; - }); - } - - return (>names).reduce((accum, name, index) => { - let item = items.getValue(name); - if (!(name in accum)) { - if (deep && item instanceof Result) { - item = toObject(getNames(item), item, deep); - } - accum[name] = item; - } - return accum; - }, >{ }); -} - - -/** - * A [[Result]] is a sub-class of Array, which allows accessing any - * of its values either positionally by its index or, if keys are - * provided by its name. - * - * @_docloc: api/abi - */ -export class Result extends Array { - // No longer used; but cannot be removed as it will remove the - // #private field from the .d.ts which may break backwards - // compatibility - readonly #names: ReadonlyArray; - - [ K: string | number ]: any - - /** - * @private - */ - constructor(...args: Array) { - // To properly sub-class Array so the other built-in - // functions work, the constructor has to behave fairly - // well. So, in the event we are created via fromItems() - // we build the read-only Result object we want, but on - // any other input, we use the default constructor - - // constructor(guard: any, items: Array, keys?: Array); - const guard = args[0]; - let items: Array = args[1]; - let names: Array = (args[2] || [ ]).slice(); - - let wrap = true; - if (guard !== _guard) { - items = args; - names = [ ]; - wrap = false; - } - - // Can't just pass in ...items since an array of length 1 - // is a special case in the super. - super(items.length); - items.forEach((item, index) => { this[index] = item; }); - - // Find all unique keys - const nameCounts = names.reduce((accum, name) => { - if (typeof(name) === "string") { - accum.set(name, (accum.get(name) || 0) + 1); - } - return accum; - }, >(new Map())); - - // Remove any key thats not unique - setNames(this, Object.freeze(items.map((item, index) => { - const name = names[index]; - if (name != null && nameCounts.get(name) === 1) { - return name; - } - return null; - }))); - - // Dummy operations to prevent TypeScript from complaining - this.#names = [ ]; - if (this.#names == null) { void(this.#names); } - - if (!wrap) { return; } - - // A wrapped Result is immutable - Object.freeze(this); - - // Proxy indices and names so we can trap deferred errors - const proxy = new Proxy(this, { - get: (target, prop, receiver) => { - if (typeof(prop) === "string") { - - // Index accessor - if (prop.match(/^[0-9]+$/)) { - const index = getNumber(prop, "%index"); - if (index < 0 || index >= this.length) { - throw new RangeError("out of result range"); - } - - const item = target[index]; - if (item instanceof Error) { - throwError(`index ${ index }`, item); - } - return item; - } - - // Pass important checks (like `then` for Promise) through - if (passProperties.indexOf(prop) >= 0) { - return Reflect.get(target, prop, receiver); - } - - const value = target[prop]; - if (value instanceof Function) { - // Make sure functions work with private variables - // See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy#no_private_property_forwarding - return function(this: any, ...args: Array) { - return value.apply((this === receiver) ? target: this, args); - }; - - } else if (!(prop in target)) { - // Possible name accessor - return target.getValue.apply((this === receiver) ? target: this, [ prop ]); - } - } - - return Reflect.get(target, prop, receiver); - } - }); - setNames(proxy, getNames(this)); - return proxy; - } - - /** - * Returns the Result as a normal Array. If %%deep%%, any children - * which are Result objects are also converted to a normal Array. - * - * This will throw if there are any outstanding deferred - * errors. - */ - toArray(deep?: boolean): Array { - const result: Array = [ ]; - this.forEach((item, index) => { - if (item instanceof Error) { throwError(`index ${ index }`, item); } - if (deep && item instanceof Result) { - item = item.toArray(deep); - } - result.push(item); - }); - return result; - } - - /** - * Returns the Result as an Object with each name-value pair. If - * %%deep%%, any children which are Result objects are also - * converted to an Object. - * - * This will throw if any value is unnamed, or if there are - * any outstanding deferred errors. - */ - toObject(deep?: boolean): Record { - const names = getNames(this); - return names.reduce((accum, name, index) => { - - assert(name != null, `value at index ${ index } unnamed`, "UNSUPPORTED_OPERATION", { - operation: "toObject()" - }); - - return toObject(names, this, deep); - }, >{}); - } - - /** - * @_ignore - */ - slice(start?: number | undefined, end?: number | undefined): Result { - if (start == null) { start = 0; } - if (start < 0) { - start += this.length; - if (start < 0) { start = 0; } - } - - if (end == null) { end = this.length; } - if (end < 0) { - end += this.length; - if (end < 0) { end = 0; } - } - if (end > this.length) { end = this.length; } - - const _names = getNames(this); - - const result: Array = [ ], names: Array = [ ]; - for (let i = start; i < end; i++) { - result.push(this[i]); - names.push(_names[i]); - } - - return new Result(_guard, result, names); - } - - /** - * @_ignore - */ - filter(callback: (el: any, index: number, array: Result) => boolean, thisArg?: any): Result { - const _names = getNames(this); - - const result: Array = [ ], names: Array = [ ]; - for (let i = 0; i < this.length; i++) { - const item = this[i]; - if (item instanceof Error) { - throwError(`index ${ i }`, item); - } - - if (callback.call(thisArg, item, i, this)) { - result.push(item); - names.push(_names[i]); - } - } - - return new Result(_guard, result, names); - } - - /** - * @_ignore - */ - map(callback: (el: any, index: number, array: Result) => T, thisArg?: any): Array { - const result: Array = [ ]; - for (let i = 0; i < this.length; i++) { - const item = this[i]; - if (item instanceof Error) { - throwError(`index ${ i }`, item); - } - - result.push(callback.call(thisArg, item, i, this)); - } - - return result; - } - - - /** - * Returns the value for %%name%%. - * - * Since it is possible to have a key whose name conflicts with - * a method on a [[Result]] or its superclass Array, or any - * JavaScript keyword, this ensures all named values are still - * accessible by name. - */ - getValue(name: string): any { - const index = getNames(this).indexOf(name); - if (index === -1) { return undefined; } - - const value = this[index]; - - if (value instanceof Error) { - throwError(`property ${ JSON.stringify(name) }`, (value).error); - } - - return value; - } - - /** - * Creates a new [[Result]] for %%items%% with each entry - * also accessible by its corresponding name in %%keys%%. - */ - static fromItems(items: Array, keys?: Array): Result { - return new Result(_guard, items, keys); - } -} - -/** - * Returns all errors found in a [[Result]]. - * - * Since certain errors encountered when creating a [[Result]] do - * not impact the ability to continue parsing data, they are - * deferred until they are actually accessed. Hence a faulty string - * in an Event that is never used does not impact the program flow. - * - * However, sometimes it may be useful to access, identify or - * validate correctness of a [[Result]]. - * - * @_docloc api/abi - */ -export function checkResultErrors(result: Result): Array<{ path: Array, error: Error }> { - // Find the first error (if any) - const errors: Array<{ path: Array, error: Error }> = [ ]; - - const checkErrors = function(path: Array, object: any): void { - if (!Array.isArray(object)) { return; } - for (let key in object) { - const childPath = path.slice(); - childPath.push(key); - - try { - checkErrors(childPath, object[key]); - } catch (error: any) { - errors.push({ path: childPath, error: error }); - } - } - } - checkErrors([ ], result); - - return errors; - -} - -function getValue(value: BigNumberish): Uint8Array { - let bytes = toBeArray(value); - - assert (bytes.length <= WordSize, "value out-of-bounds", - "BUFFER_OVERRUN", { buffer: bytes, length: WordSize, offset: bytes.length }); - - if (bytes.length !== WordSize) { - bytes = getBytesCopy(concat([ Padding.slice(bytes.length % WordSize), bytes ])); - } - - return bytes; -} - -/** - * @_ignore - */ -export abstract class Coder { - - // The coder name: - // - address, uint256, tuple, array, etc. - readonly name!: string; - - // The fully expanded type, including composite types: - // - address, uint256, tuple(address,bytes), uint256[3][4][], etc. - readonly type!: string; - - // The localName bound in the signature, in this example it is "baz": - // - tuple(address foo, uint bar) baz - readonly localName!: string; - - // Whether this type is dynamic: - // - Dynamic: bytes, string, address[], tuple(boolean[]), etc. - // - Not Dynamic: address, uint256, boolean[3], tuple(address, uint8) - readonly dynamic!: boolean; - - constructor(name: string, type: string, localName: string, dynamic: boolean) { - defineProperties(this, { name, type, localName, dynamic }, { - name: "string", type: "string", localName: "string", dynamic: "boolean" - }); - } - - _throwError(message: string, value: any): never { - assertArgument(false, message, this.localName, value); - } - - abstract encode(writer: Writer, value: any): number; - abstract decode(reader: Reader): any; - - abstract defaultValue(): any; -} - -/** - * @_ignore - */ -export class Writer { - // An array of WordSize lengthed objects to concatenation - #data: Array; - #dataLength: number; - - constructor() { - this.#data = [ ]; - this.#dataLength = 0; - } - - get data(): string { - return concat(this.#data); - } - get length(): number { return this.#dataLength; } - - #writeData(data: Uint8Array): number { - this.#data.push(data); - this.#dataLength += data.length; - return data.length; - } - - appendWriter(writer: Writer): number { - return this.#writeData(getBytesCopy(writer.data)); - } - - // Arrayish item; pad on the right to *nearest* WordSize - writeBytes(value: BytesLike): number { - let bytes = getBytesCopy(value); - const paddingOffset = bytes.length % WordSize; - if (paddingOffset) { - bytes = getBytesCopy(concat([ bytes, Padding.slice(paddingOffset) ])) - } - return this.#writeData(bytes); - } - - // Numeric item; pad on the left *to* WordSize - writeValue(value: BigNumberish): number { - return this.#writeData(getValue(value)); - } - - // Inserts a numeric place-holder, returning a callback that can - // be used to asjust the value later - writeUpdatableValue(): (value: BigNumberish) => void { - const offset = this.#data.length; - this.#data.push(Padding); - this.#dataLength += WordSize; - return (value: BigNumberish) => { - this.#data[offset] = getValue(value); - }; - } -} - -/** - * @_ignore - */ -export class Reader { - // Allows incomplete unpadded data to be read; otherwise an error - // is raised if attempting to overrun the buffer. This is required - // to deal with an old Solidity bug, in which event data for - // external (not public thoguh) was tightly packed. - readonly allowLoose!: boolean; - - readonly #data: Uint8Array; - #offset: number; - - #bytesRead: number; - #parent: null | Reader; - #maxInflation: number; - - constructor(data: BytesLike, allowLoose?: boolean, maxInflation?: number) { - defineProperties(this, { allowLoose: !!allowLoose }); - - this.#data = getBytesCopy(data); - this.#bytesRead = 0; - this.#parent = null; - this.#maxInflation = (maxInflation != null) ? maxInflation: 1024; - - this.#offset = 0; - } - - get data(): string { return hexlify(this.#data); } - get dataLength(): number { return this.#data.length; } - get consumed(): number { return this.#offset; } - get bytes(): Uint8Array { return new Uint8Array(this.#data); } - - #incrementBytesRead(count: number): void { - if (this.#parent) { return this.#parent.#incrementBytesRead(count); } - - this.#bytesRead += count; - - // Check for excessive inflation (see: #4537) - assert(this.#maxInflation < 1 || this.#bytesRead <= this.#maxInflation * this.dataLength, `compressed ABI data exceeds inflation ratio of ${ this.#maxInflation } ( see: https:/\/github.com/ethers-io/ethers.js/issues/4537 )`, "BUFFER_OVERRUN", { - buffer: getBytesCopy(this.#data), offset: this.#offset, - length: count, info: { - bytesRead: this.#bytesRead, - dataLength: this.dataLength - } - }); - } - - #peekBytes(offset: number, length: number, loose?: boolean): Uint8Array { - let alignedLength = Math.ceil(length / WordSize) * WordSize; - if (this.#offset + alignedLength > this.#data.length) { - if (this.allowLoose && loose && this.#offset + length <= this.#data.length) { - alignedLength = length; - } else { - assert(false, "data out-of-bounds", "BUFFER_OVERRUN", { - buffer: getBytesCopy(this.#data), - length: this.#data.length, - offset: this.#offset + alignedLength - }); - } - } - return this.#data.slice(this.#offset, this.#offset + alignedLength) - } - - // Create a sub-reader with the same underlying data, but offset - subReader(offset: number): Reader { - const reader = new Reader(this.#data.slice(this.#offset + offset), this.allowLoose, this.#maxInflation); - reader.#parent = this; - return reader; - } - - // Read bytes - readBytes(length: number, loose?: boolean): Uint8Array { - let bytes = this.#peekBytes(0, length, !!loose); - this.#incrementBytesRead(length); - this.#offset += bytes.length; - // @TODO: Make sure the length..end bytes are all 0? - return bytes.slice(0, length); - } - - // Read a numeric values - readValue(): bigint { - return toBigInt(this.readBytes(WordSize)); - } - - readIndex(): number { - return toNumber(this.readBytes(WordSize)); - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/abi/coders/address.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/abi/coders/address.ts deleted file mode 100644 index 160b1320..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/abi/coders/address.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { getAddress } from "../../address/index.js"; -import { toBeHex } from "../../utils/maths.js"; - -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; - -import type { Reader, Writer } from "./abstract-coder.js"; - - -/** - * @_ignore - */ -export class AddressCoder extends Coder { - - constructor(localName: string) { - super("address", "address", localName, false); - } - - defaultValue(): string { - return "0x0000000000000000000000000000000000000000"; - } - - encode(writer: Writer, _value: string | Typed): number { - let value = Typed.dereference(_value, "string"); - try { - value = getAddress(value); - } catch (error: any) { - return this._throwError(error.message, _value); - } - return writer.writeValue(value); - } - - decode(reader: Reader): any { - return getAddress(toBeHex(reader.readValue(), 20)); - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/abi/coders/anonymous.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/abi/coders/anonymous.ts deleted file mode 100644 index 16747c64..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/abi/coders/anonymous.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Coder } from "./abstract-coder.js"; - -import type { Reader, Writer } from "./abstract-coder.js"; - -/** - * Clones the functionality of an existing Coder, but without a localName - * - * @_ignore - */ -export class AnonymousCoder extends Coder { - private coder: Coder; - - constructor(coder: Coder) { - super(coder.name, coder.type, "_", coder.dynamic); - this.coder = coder; - } - - defaultValue(): any { - return this.coder.defaultValue(); - } - - encode(writer: Writer, value: any): number { - return this.coder.encode(writer, value); - } - - decode(reader: Reader): any { - return this.coder.decode(reader); - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/abi/coders/array.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/abi/coders/array.ts deleted file mode 100644 index 9323ed97..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/abi/coders/array.ts +++ /dev/null @@ -1,199 +0,0 @@ -import { - defineProperties, isError, assert, assertArgument, assertArgumentCount -} from "../../utils/index.js"; - -import { Typed } from "../typed.js"; - -import { Coder, Result, WordSize, Writer } from "./abstract-coder.js"; -import { AnonymousCoder } from "./anonymous.js"; - -import type { Reader } from "./abstract-coder.js"; - -/** - * @_ignore - */ -export function pack(writer: Writer, coders: ReadonlyArray, values: Array | { [ name: string ]: any }): number { - let arrayValues: Array = [ ]; - - if (Array.isArray(values)) { - arrayValues = values; - - } else if (values && typeof(values) === "object") { - let unique: { [ name: string ]: boolean } = { }; - - arrayValues = coders.map((coder) => { - const name = coder.localName; - assert(name, "cannot encode object for signature with missing names", - "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values }); - - assert(!unique[name], "cannot encode object for signature with duplicate names", - "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values }); - - unique[name] = true; - - return values[name]; - }); - - } else { - assertArgument(false, "invalid tuple value", "tuple", values); - } - - assertArgument(coders.length === arrayValues.length, "types/value length mismatch", "tuple", values); - - let staticWriter = new Writer(); - let dynamicWriter = new Writer(); - - let updateFuncs: Array<(baseOffset: number) => void> = []; - coders.forEach((coder, index) => { - let value = arrayValues[index]; - - if (coder.dynamic) { - // Get current dynamic offset (for the future pointer) - let dynamicOffset = dynamicWriter.length; - - // Encode the dynamic value into the dynamicWriter - coder.encode(dynamicWriter, value); - - // Prepare to populate the correct offset once we are done - let updateFunc = staticWriter.writeUpdatableValue(); - updateFuncs.push((baseOffset: number) => { - updateFunc(baseOffset + dynamicOffset); - }); - - } else { - coder.encode(staticWriter, value); - } - }); - - // Backfill all the dynamic offsets, now that we know the static length - updateFuncs.forEach((func) => { func(staticWriter.length); }); - - let length = writer.appendWriter(staticWriter); - length += writer.appendWriter(dynamicWriter); - return length; -} - -/** - * @_ignore - */ -export function unpack(reader: Reader, coders: ReadonlyArray): Result { - let values: Array = []; - let keys: Array = [ ]; - - // A reader anchored to this base - let baseReader = reader.subReader(0); - - coders.forEach((coder) => { - let value: any = null; - - if (coder.dynamic) { - let offset = reader.readIndex(); - let offsetReader = baseReader.subReader(offset); - try { - value = coder.decode(offsetReader); - } catch (error: any) { - // Cannot recover from this - if (isError(error, "BUFFER_OVERRUN")) { - throw error; - } - - value = error; - value.baseType = coder.name; - value.name = coder.localName; - value.type = coder.type; - } - - } else { - try { - value = coder.decode(reader); - } catch (error: any) { - // Cannot recover from this - if (isError(error, "BUFFER_OVERRUN")) { - throw error; - } - - value = error; - value.baseType = coder.name; - value.name = coder.localName; - value.type = coder.type; - } - } - - if (value == undefined) { - throw new Error("investigate"); - } - - values.push(value); - keys.push(coder.localName || null); - }); - - return Result.fromItems(values, keys); -} - -/** - * @_ignore - */ -export class ArrayCoder extends Coder { - readonly coder!: Coder; - readonly length!: number; - - constructor(coder: Coder, length: number, localName: string) { - const type = (coder.type + "[" + (length >= 0 ? length: "") + "]"); - const dynamic = (length === -1 || coder.dynamic); - super("array", type, localName, dynamic); - defineProperties(this, { coder, length }); - } - - defaultValue(): Array { - // Verifies the child coder is valid (even if the array is dynamic or 0-length) - const defaultChild = this.coder.defaultValue(); - - const result: Array = []; - for (let i = 0; i < this.length; i++) { - result.push(defaultChild); - } - return result; - } - - encode(writer: Writer, _value: Array | Typed): number { - const value = Typed.dereference(_value, "array"); - - if(!Array.isArray(value)) { - this._throwError("expected array value", value); - } - - let count = this.length; - - if (count === -1) { - count = value.length; - writer.writeValue(value.length); - } - - assertArgumentCount(value.length, count, "coder array" + (this.localName? (" "+ this.localName): "")); - - let coders: Array = [ ]; - for (let i = 0; i < value.length; i++) { coders.push(this.coder); } - - return pack(writer, coders, value); - } - - decode(reader: Reader): any { - let count = this.length; - if (count === -1) { - count = reader.readIndex(); - - // Check that there is *roughly* enough data to ensure - // stray random data is not being read as a length. Each - // slot requires at least 32 bytes for their value (or 32 - // bytes as a link to the data). This could use a much - // tighter bound, but we are erroring on the side of safety. - assert(count * WordSize <= reader.dataLength, "insufficient data length", - "BUFFER_OVERRUN", { buffer: reader.bytes, offset: count * WordSize, length: reader.dataLength }); - } - let coders: Array = []; - for (let i = 0; i < count; i++) { coders.push(new AnonymousCoder(this.coder)); } - - return unpack(reader, coders); - } -} - diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/abi/coders/boolean.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/abi/coders/boolean.ts deleted file mode 100644 index a1b96d3e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/abi/coders/boolean.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; - -import type { Reader, Writer } from "./abstract-coder.js"; - -/** - * @_ignore - */ -export class BooleanCoder extends Coder { - - constructor(localName: string) { - super("bool", "bool", localName, false); - } - - defaultValue(): boolean { - return false; - } - - encode(writer: Writer, _value: boolean | Typed): number { - const value = Typed.dereference(_value, "bool"); - return writer.writeValue(value ? 1: 0); - } - - decode(reader: Reader): any { - return !!reader.readValue(); - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/abi/coders/bytes.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/abi/coders/bytes.ts deleted file mode 100644 index 90b6a061..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/abi/coders/bytes.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { getBytesCopy, hexlify } from "../../utils/index.js"; - -import { Coder } from "./abstract-coder.js"; - -import type { Reader, Writer } from "./abstract-coder.js"; - - -/** - * @_ignore - */ -export class DynamicBytesCoder extends Coder { - constructor(type: string, localName: string) { - super(type, type, localName, true); - } - - defaultValue(): string { - return "0x"; - } - - encode(writer: Writer, value: any): number { - value = getBytesCopy(value); - let length = writer.writeValue(value.length); - length += writer.writeBytes(value); - return length; - } - - decode(reader: Reader): any { - return reader.readBytes(reader.readIndex(), true); - } -} - -/** - * @_ignore - */ -export class BytesCoder extends DynamicBytesCoder { - constructor(localName: string) { - super("bytes", localName); - } - - decode(reader: Reader): any { - return hexlify(super.decode(reader)); - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/abi/coders/fixed-bytes.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/abi/coders/fixed-bytes.ts deleted file mode 100644 index 149f9823..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/abi/coders/fixed-bytes.ts +++ /dev/null @@ -1,37 +0,0 @@ - -import { defineProperties, getBytesCopy, hexlify } from "../../utils/index.js"; - -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; - -import type { BytesLike } from "../../utils/index.js"; - -import type { Reader, Writer } from "./abstract-coder.js"; - - -/** - * @_ignore - */ -export class FixedBytesCoder extends Coder { - readonly size!: number; - - constructor(size: number, localName: string) { - let name = "bytes" + String(size); - super(name, name, localName, false); - defineProperties(this, { size }, { size: "number" }); - } - - defaultValue(): string { - return ("0x0000000000000000000000000000000000000000000000000000000000000000").substring(0, 2 + this.size * 2); - } - - encode(writer: Writer, _value: BytesLike | Typed): number { - let data = getBytesCopy(Typed.dereference(_value, this.type)); - if (data.length !== this.size) { this._throwError("incorrect data length", _value); } - return writer.writeBytes(data); - } - - decode(reader: Reader): any { - return hexlify(reader.readBytes(this.size)); - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/abi/coders/null.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/abi/coders/null.ts deleted file mode 100644 index 210eec28..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/abi/coders/null.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { Coder } from "./abstract-coder.js"; -import type { Reader, Writer } from "./abstract-coder.js"; - -const Empty = new Uint8Array([ ]); - -/** - * @_ignore - */ -export class NullCoder extends Coder { - - constructor(localName: string) { - super("null", "", localName, false); - } - - defaultValue(): null { - return null; - } - - encode(writer: Writer, value: any): number { - if (value != null) { this._throwError("not null", value); } - return writer.writeBytes(Empty); - } - - decode(reader: Reader): any { - reader.readBytes(0); - return null; - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/abi/coders/number.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/abi/coders/number.ts deleted file mode 100644 index 240351be..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/abi/coders/number.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { - defineProperties, fromTwos, getBigInt, mask, toTwos -} from "../../utils/index.js"; - -import { Typed } from "../typed.js"; -import { Coder, WordSize } from "./abstract-coder.js"; - -import type { BigNumberish } from "../../utils/index.js"; - -import type { Reader, Writer } from "./abstract-coder.js"; - - -const BN_0 = BigInt(0); -const BN_1 = BigInt(1); -const BN_MAX_UINT256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); - -/** - * @_ignore - */ -export class NumberCoder extends Coder { - readonly size!: number; - readonly signed!: boolean; - - constructor(size: number, signed: boolean, localName: string) { - const name = ((signed ? "int": "uint") + (size * 8)); - super(name, name, localName, false); - - defineProperties(this, { size, signed }, { size: "number", signed: "boolean" }); - } - - defaultValue(): number { - return 0; - } - - encode(writer: Writer, _value: BigNumberish | Typed): number { - let value = getBigInt(Typed.dereference(_value, this.type)); - - // Check bounds are safe for encoding - let maxUintValue = mask(BN_MAX_UINT256, WordSize * 8); - if (this.signed) { - let bounds = mask(maxUintValue, (this.size * 8) - 1); - if (value > bounds || value < -(bounds + BN_1)) { - this._throwError("value out-of-bounds", _value); - } - value = toTwos(value, 8 * WordSize); - } else if (value < BN_0 || value > mask(maxUintValue, this.size * 8)) { - this._throwError("value out-of-bounds", _value); - } - - return writer.writeValue(value); - } - - decode(reader: Reader): any { - let value = mask(reader.readValue(), this.size * 8); - - if (this.signed) { - value = fromTwos(value, this.size * 8); - } - - return value; - } -} - diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/abi/coders/string.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/abi/coders/string.ts deleted file mode 100644 index 17f3cf43..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/abi/coders/string.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { toUtf8Bytes, toUtf8String } from "../../utils/utf8.js"; - -import { Typed } from "../typed.js"; -import { DynamicBytesCoder } from "./bytes.js"; - -import type { Reader, Writer } from "./abstract-coder.js"; - - -/** - * @_ignore - */ -export class StringCoder extends DynamicBytesCoder { - - constructor(localName: string) { - super("string", localName); - } - - defaultValue(): string { - return ""; - } - - encode(writer: Writer, _value: string | Typed): number { - return super.encode(writer, toUtf8Bytes(Typed.dereference(_value, "string"))); - } - - decode(reader: Reader): any { - return toUtf8String(super.decode(reader)); - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/abi/coders/tuple.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/abi/coders/tuple.ts deleted file mode 100644 index 484f6a6a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/abi/coders/tuple.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { defineProperties } from "../../utils/properties.js"; - -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; - -import { pack, unpack } from "./array.js"; - -import type { Reader, Writer } from "./abstract-coder.js"; - -/** - * @_ignore - */ -export class TupleCoder extends Coder { - readonly coders!: ReadonlyArray; - - constructor(coders: Array, localName: string) { - let dynamic = false; - const types: Array = []; - coders.forEach((coder) => { - if (coder.dynamic) { dynamic = true; } - types.push(coder.type); - }); - const type = ("tuple(" + types.join(",") + ")"); - - super("tuple", type, localName, dynamic); - defineProperties(this, { coders: Object.freeze(coders.slice()) }); - } - - defaultValue(): any { - const values: any = [ ]; - this.coders.forEach((coder) => { - values.push(coder.defaultValue()); - }); - - // We only output named properties for uniquely named coders - const uniqueNames = this.coders.reduce((accum, coder) => { - const name = coder.localName; - if (name) { - if (!accum[name]) { accum[name] = 0; } - accum[name]++; - } - return accum; - }, <{ [ name: string ]: number }>{ }); - - // Add named values - this.coders.forEach((coder: Coder, index: number) => { - let name = coder.localName; - if (!name || uniqueNames[name] !== 1) { return; } - - if (name === "length") { name = "_length"; } - - if (values[name] != null) { return; } - - values[name] = values[index]; - }); - - return Object.freeze(values); - } - - encode(writer: Writer, _value: Array | { [ name: string ]: any } | Typed): number { - const value = Typed.dereference(_value, "tuple"); - return pack(writer, this.coders, value); - } - - decode(reader: Reader): any { - return unpack(reader, this.coders); - } -} - diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/abi/fragments.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/abi/fragments.ts deleted file mode 100644 index 202b7a93..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/abi/fragments.ts +++ /dev/null @@ -1,1617 +0,0 @@ -/** - * A fragment is a single item from an ABI, which may represent any of: - * - * - [Functions](FunctionFragment) - * - [Events](EventFragment) - * - [Constructors](ConstructorFragment) - * - Custom [Errors](ErrorFragment) - * - [Fallback or Receive](FallbackFragment) functions - * - * @_subsection api/abi/abi-coder:Fragments [about-fragments] - */ - -import { - defineProperties, getBigInt, getNumber, - assert, assertPrivate, assertArgument -} from "../utils/index.js"; -import { id } from "../hash/index.js"; - -/** - * A Type description in a [JSON ABI format](link-solc-jsonabi). - */ -export interface JsonFragmentType { - /** - * The parameter name. - */ - readonly name?: string; - - /** - * If the parameter is indexed. - */ - readonly indexed?: boolean; - - /** - * The type of the parameter. - */ - readonly type?: string; - - /** - * The internal Solidity type. - */ - readonly internalType?: string; - - /** - * The components for a tuple. - */ - readonly components?: ReadonlyArray; -} - -/** - * A fragment for a method, event or error in a [JSON ABI format](link-solc-jsonabi). - */ -export interface JsonFragment { - /** - * The name of the error, event, function, etc. - */ - readonly name?: string; - - /** - * The type of the fragment (e.g. ``event``, ``"function"``, etc.) - */ - readonly type?: string; - - /** - * If the event is anonymous. - */ - readonly anonymous?: boolean; - - /** - * If the function is payable. - */ - readonly payable?: boolean; - - /** - * If the function is constant. - */ - readonly constant?: boolean; - - /** - * The mutability state of the function. - */ - readonly stateMutability?: string; - - /** - * The input parameters. - */ - readonly inputs?: ReadonlyArray; - - /** - * The output parameters. - */ - readonly outputs?: ReadonlyArray; - - /** - * The gas limit to use when sending a transaction for this function. - */ - readonly gas?: string; -}; - -/** - * The format to serialize the output as. - * - * **``"sighash"``** - the bare formatting, used to compute the selector - * or topic hash; this format cannot be reversed (as it discards ``indexed``) - * so cannot by used to export an [[Interface]]. - * - * **``"minimal"``** - Human-Readable ABI with minimal spacing and without - * names, so it is compact, but will result in Result objects that cannot - * be accessed by name. - * - * **``"full"``** - Full Human-Readable ABI, with readable spacing and names - * intact; this is generally the recommended format. - * - * **``"json"``** - The [JSON ABI format](link-solc-jsonabi). - */ -export type FormatType = "sighash" | "minimal" | "full" | "json"; - -// [ "a", "b" ] => { "a": 1, "b": 1 } -function setify(items: Array): ReadonlySet { - const result: Set = new Set(); - items.forEach((k) => result.add(k)); - return Object.freeze(result); -} - -const _kwVisibDeploy = "external public payable override"; -const KwVisibDeploy = setify(_kwVisibDeploy.split(" ")); - -// Visibility Keywords -const _kwVisib = "constant external internal payable private public pure view override"; -const KwVisib = setify(_kwVisib.split(" ")); - -const _kwTypes = "constructor error event fallback function receive struct"; -const KwTypes = setify(_kwTypes.split(" ")); - -const _kwModifiers = "calldata memory storage payable indexed"; -const KwModifiers = setify(_kwModifiers.split(" ")); - -const _kwOther = "tuple returns"; - -// All Keywords -const _keywords = [ _kwTypes, _kwModifiers, _kwOther, _kwVisib ].join(" "); -const Keywords = setify(_keywords.split(" ")); - -// Single character tokens -const SimpleTokens: Record = { - "(": "OPEN_PAREN", ")": "CLOSE_PAREN", - "[": "OPEN_BRACKET", "]": "CLOSE_BRACKET", - ",": "COMMA", "@": "AT" -}; - -// Parser regexes to consume the next token -const regexWhitespacePrefix = new RegExp("^(\\s*)"); -const regexNumberPrefix = new RegExp("^([0-9]+)"); -const regexIdPrefix = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"); - -// Parser regexs to check validity -const regexId = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"); -const regexType = new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$"); - -/** - * @ignore: - */ -type Token = Readonly<{ - // Type of token (e.g. TYPE, KEYWORD, NUMBER, etc) - type: string; - - // Offset into the original source code - offset: number; - - // Actual text content of the token - text: string; - - // The parenthesis depth - depth: number; - - // If a parenthesis, the offset (in tokens) that balances it - match: number; - - // For parenthesis and commas, the offset (in tokens) to the - // previous/next parenthesis or comma in the list - linkBack: number; - linkNext: number; - - // If a BRACKET, the value inside - value: number; -}>; - -class TokenString { - #offset: number; - #tokens: ReadonlyArray; - - get offset(): number { return this.#offset; } - get length(): number { return this.#tokens.length - this.#offset; } - - constructor(tokens: ReadonlyArray) { - this.#offset = 0; - this.#tokens = tokens.slice(); - } - - clone(): TokenString { return new TokenString(this.#tokens); } - reset(): void { this.#offset = 0; } - - #subTokenString(from: number = 0, to: number = 0): TokenString { - return new TokenString(this.#tokens.slice(from, to).map((t) => { - return Object.freeze(Object.assign({ }, t, { - match: (t.match - from), - linkBack: (t.linkBack - from), - linkNext: (t.linkNext - from), - })); - })); - } - - // Pops and returns the value of the next token, if it is a keyword in allowed; throws if out of tokens - popKeyword(allowed: ReadonlySet): string { - const top = this.peek(); - if (top.type !== "KEYWORD" || !allowed.has(top.text)) { throw new Error(`expected keyword ${ top.text }`); } - return this.pop().text; - } - - // Pops and returns the value of the next token if it is `type`; throws if out of tokens - popType(type: string): string { - if (this.peek().type !== type) { - const top = this.peek(); - throw new Error(`expected ${ type }; got ${ top.type } ${ JSON.stringify(top.text) }`); - } - return this.pop().text; - } - - // Pops and returns a "(" TOKENS ")" - popParen(): TokenString { - const top = this.peek(); - if (top.type !== "OPEN_PAREN") { throw new Error("bad start"); } - const result = this.#subTokenString(this.#offset + 1, top.match + 1); - this.#offset = top.match + 1; - return result; - } - - // Pops and returns the items within "(" ITEM1 "," ITEM2 "," ... ")" - popParams(): Array { - const top = this.peek(); - - if (top.type !== "OPEN_PAREN") { throw new Error("bad start"); } - - const result: Array = [ ]; - - while(this.#offset < top.match - 1) { - const link = this.peek().linkNext; - result.push(this.#subTokenString(this.#offset + 1, link)); - this.#offset = link; - } - - this.#offset = top.match + 1; - - return result; - } - - // Returns the top Token, throwing if out of tokens - peek(): Token { - if (this.#offset >= this.#tokens.length) { - throw new Error("out-of-bounds"); - } - return this.#tokens[this.#offset]; - } - - // Returns the next value, if it is a keyword in `allowed` - peekKeyword(allowed: ReadonlySet): null | string { - const top = this.peekType("KEYWORD"); - return (top != null && allowed.has(top)) ? top: null; - } - - // Returns the value of the next token if it is `type` - peekType(type: string): null | string { - if (this.length === 0) { return null; } - const top = this.peek(); - return (top.type === type) ? top.text: null; - } - - // Returns the next token; throws if out of tokens - pop(): Token { - const result = this.peek(); - this.#offset++; - return result; - } - - toString(): string { - const tokens: Array = [ ]; - for (let i = this.#offset; i < this.#tokens.length; i++) { - const token = this.#tokens[i]; - tokens.push(`${ token.type }:${ token.text }`); - } - return `` - } -} - -type Writeable = { -readonly [P in keyof T]: T[P] }; - -function lex(text: string): TokenString { - const tokens: Array = [ ]; - - const throwError = (message: string) => { - const token = (offset < text.length) ? JSON.stringify(text[offset]): "$EOI"; - throw new Error(`invalid token ${ token } at ${ offset }: ${ message }`); - }; - - let brackets: Array = [ ]; - let commas: Array = [ ]; - - let offset = 0; - while (offset < text.length) { - - // Strip off any leading whitespace - let cur = text.substring(offset); - let match = cur.match(regexWhitespacePrefix); - if (match) { - offset += match[1].length; - cur = text.substring(offset); - } - - const token = { depth: brackets.length, linkBack: -1, linkNext: -1, match: -1, type: "", text: "", offset, value: -1 }; - tokens.push(token); - - let type = (SimpleTokens[cur[0]] || ""); - if (type) { - token.type = type; - token.text = cur[0]; - offset++; - - if (type === "OPEN_PAREN") { - brackets.push(tokens.length - 1); - commas.push(tokens.length - 1); - - } else if (type == "CLOSE_PAREN") { - if (brackets.length === 0) { throwError("no matching open bracket"); } - - token.match = brackets.pop() as number; - (>(tokens[token.match])).match = tokens.length - 1; - token.depth--; - - token.linkBack = commas.pop() as number; - (>(tokens[token.linkBack])).linkNext = tokens.length - 1; - - } else if (type === "COMMA") { - token.linkBack = commas.pop() as number; - (>(tokens[token.linkBack])).linkNext = tokens.length - 1; - commas.push(tokens.length - 1); - - } else if (type === "OPEN_BRACKET") { - token.type = "BRACKET"; - - } else if (type === "CLOSE_BRACKET") { - // Remove the CLOSE_BRACKET - let suffix = (tokens.pop() as Token).text; - if (tokens.length > 0 && tokens[tokens.length - 1].type === "NUMBER") { - const value = (tokens.pop() as Token).text; - suffix = value + suffix; - (>(tokens[tokens.length - 1])).value = getNumber(value); - } - if (tokens.length === 0 || tokens[tokens.length - 1].type !== "BRACKET") { - throw new Error("missing opening bracket"); - } - (>(tokens[tokens.length - 1])).text += suffix; - } - - continue; - } - - match = cur.match(regexIdPrefix); - if (match) { - token.text = match[1]; - offset += token.text.length; - - if (Keywords.has(token.text)) { - token.type = "KEYWORD"; - continue; - } - - if (token.text.match(regexType)) { - token.type = "TYPE"; - continue; - } - - token.type = "ID"; - continue; - } - - match = cur.match(regexNumberPrefix); - if (match) { - token.text = match[1]; - token.type = "NUMBER"; - offset += token.text.length; - continue; - } - - throw new Error(`unexpected token ${ JSON.stringify(cur[0]) } at position ${ offset }`); - } - - return new TokenString(tokens.map((t) => Object.freeze(t))); -} - -// Check only one of `allowed` is in `set` -function allowSingle(set: ReadonlySet, allowed: ReadonlySet): void { - let included: Array = [ ]; - for (const key in allowed.keys()) { - if (set.has(key)) { included.push(key); } - } - if (included.length > 1) { throw new Error(`conflicting types: ${ included.join(", ") }`); } -} - -// Functions to process a Solidity Signature TokenString from left-to-right for... - -// ...the name with an optional type, returning the name -function consumeName(type: string, tokens: TokenString): string { - if (tokens.peekKeyword(KwTypes)) { - const keyword = tokens.pop().text; - if (keyword !== type) { - throw new Error(`expected ${ type }, got ${ keyword }`); - } - } - - return tokens.popType("ID"); -} - -// ...all keywords matching allowed, returning the keywords -function consumeKeywords(tokens: TokenString, allowed?: ReadonlySet): ReadonlySet { - const keywords: Set = new Set(); - while (true) { - const keyword = tokens.peekType("KEYWORD"); - - if (keyword == null || (allowed && !allowed.has(keyword))) { break; } - tokens.pop(); - - if (keywords.has(keyword)) { throw new Error(`duplicate keywords: ${ JSON.stringify(keyword) }`); } - keywords.add(keyword); - } - - return Object.freeze(keywords); -} - -// ...all visibility keywords, returning the coalesced mutability -function consumeMutability(tokens: TokenString): "payable" | "nonpayable" | "view" | "pure" { - let modifiers = consumeKeywords(tokens, KwVisib); - - // Detect conflicting modifiers - allowSingle(modifiers, setify("constant payable nonpayable".split(" "))); - allowSingle(modifiers, setify("pure view payable nonpayable".split(" "))); - - // Process mutability states - if (modifiers.has("view")) { return "view"; } - if (modifiers.has("pure")) { return "pure"; } - if (modifiers.has("payable")) { return "payable"; } - if (modifiers.has("nonpayable")) { return "nonpayable"; } - - // Process legacy `constant` last - if (modifiers.has("constant")) { return "view"; } - - return "nonpayable"; -} - -// ...a parameter list, returning the ParamType list -function consumeParams(tokens: TokenString, allowIndexed?: boolean): Array { - return tokens.popParams().map((t) => ParamType.from(t, allowIndexed)); -} - -// ...a gas limit, returning a BigNumber or null if none -function consumeGas(tokens: TokenString): null | bigint { - if (tokens.peekType("AT")) { - tokens.pop(); - if (tokens.peekType("NUMBER")) { - return getBigInt(tokens.pop().text); - } - throw new Error("invalid gas"); - } - return null; -} - -function consumeEoi(tokens: TokenString): void { - if (tokens.length) { - throw new Error(`unexpected tokens at offset ${ tokens.offset }: ${ tokens.toString() }`); - } -} - -const regexArrayType = new RegExp(/^(.*)\[([0-9]*)\]$/); - -function verifyBasicType(type: string): string { - const match = type.match(regexType); - assertArgument(match, "invalid type", "type", type); - if (type === "uint") { return "uint256"; } - if (type === "int") { return "int256"; } - - if (match[2]) { - // bytesXX - const length = parseInt(match[2]); - assertArgument(length !== 0 && length <= 32, "invalid bytes length", "type", type); - - } else if (match[3]) { - // intXX or uintXX - const size = parseInt(match[3] as string); - assertArgument(size !== 0 && size <= 256 && (size % 8) === 0, "invalid numeric width", "type", type); - } - - return type; -} - -// Make the Fragment constructors effectively private -const _guard = { }; - - -/** - * When [walking](ParamType-walk) a [[ParamType]], this is called - * on each component. - */ -export type ParamTypeWalkFunc = (type: string, value: any) => any; - -/** - * When [walking asynchronously](ParamType-walkAsync) a [[ParamType]], - * this is called on each component. - */ -export type ParamTypeWalkAsyncFunc = (type: string, value: any) => any | Promise; - -const internal = Symbol.for("_ethers_internal"); - -const ParamTypeInternal = "_ParamTypeInternal"; -const ErrorFragmentInternal = "_ErrorInternal"; -const EventFragmentInternal = "_EventInternal"; -const ConstructorFragmentInternal = "_ConstructorInternal"; -const FallbackFragmentInternal = "_FallbackInternal"; -const FunctionFragmentInternal = "_FunctionInternal"; -const StructFragmentInternal = "_StructInternal"; - -/** - * Each input and output of a [[Fragment]] is an Array of **ParamType**. - */ -export class ParamType { - - /** - * The local name of the parameter (or ``""`` if unbound) - */ - readonly name!: string; - - /** - * The fully qualified type (e.g. ``"address"``, ``"tuple(address)"``, - * ``"uint256[3][]"``) - */ - readonly type!: string; - - /** - * The base type (e.g. ``"address"``, ``"tuple"``, ``"array"``) - */ - readonly baseType!: string; - - /** - * True if the parameters is indexed. - * - * For non-indexable types this is ``null``. - */ - readonly indexed!: null | boolean; - - /** - * The components for the tuple. - * - * For non-tuple types this is ``null``. - */ - readonly components!: null | ReadonlyArray; - - /** - * The array length, or ``-1`` for dynamic-lengthed arrays. - * - * For non-array types this is ``null``. - */ - readonly arrayLength!: null | number; - - /** - * The type of each child in the array. - * - * For non-array types this is ``null``. - */ - readonly arrayChildren!: null | ParamType; - - - /** - * @private - */ - constructor(guard: any, name: string, type: string, baseType: string, indexed: null | boolean, components: null | ReadonlyArray, arrayLength: null | number, arrayChildren: null | ParamType) { - assertPrivate(guard, _guard, "ParamType"); - Object.defineProperty(this, internal, { value: ParamTypeInternal }); - - if (components) { components = Object.freeze(components.slice()); } - - if (baseType === "array") { - if (arrayLength == null || arrayChildren == null) { - throw new Error(""); - } - } else if (arrayLength != null || arrayChildren != null) { - throw new Error(""); - } - - if (baseType === "tuple") { - if (components == null) { throw new Error(""); } - } else if (components != null) { - throw new Error(""); - } - - defineProperties(this, { - name, type, baseType, indexed, components, arrayLength, arrayChildren - }); - } - - /** - * Return a string representation of this type. - * - * For example, - * - * ``sighash" => "(uint256,address)"`` - * - * ``"minimal" => "tuple(uint256,address) indexed"`` - * - * ``"full" => "tuple(uint256 foo, address bar) indexed baz"`` - */ - format(format?: FormatType): string { - if (format == null) { format = "sighash"; } - if (format === "json") { - const name = this.name || ""; - - if (this.isArray()) { - const result = JSON.parse(this.arrayChildren.format("json")); - result.name = name; - result.type += `[${ (this.arrayLength < 0 ? "": String(this.arrayLength)) }]`; - return JSON.stringify(result); - } - - const result: any = { - type: ((this.baseType === "tuple") ? "tuple": this.type), - name - }; - - - if (typeof(this.indexed) === "boolean") { result.indexed = this.indexed; } - if (this.isTuple()) { - result.components = this.components.map((c) => JSON.parse(c.format(format))); - } - return JSON.stringify(result); - } - - let result = ""; - - // Array - if (this.isArray()) { - result += this.arrayChildren.format(format); - result += `[${ (this.arrayLength < 0 ? "": String(this.arrayLength)) }]`; - } else { - if (this.isTuple()) { - result += "(" + this.components.map( - (comp) => comp.format(format) - ).join((format === "full") ? ", ": ",") + ")"; - } else { - result += this.type; - } - } - - if (format !== "sighash") { - if (this.indexed === true) { result += " indexed"; } - if (format === "full" && this.name) { - result += " " + this.name; - } - } - - return result; - } - - /** - * Returns true if %%this%% is an Array type. - * - * This provides a type gaurd ensuring that [[arrayChildren]] - * and [[arrayLength]] are non-null. - */ - isArray(): this is (ParamType & { arrayChildren: ParamType, arrayLength: number }) { - return (this.baseType === "array") - } - - /** - * Returns true if %%this%% is a Tuple type. - * - * This provides a type gaurd ensuring that [[components]] - * is non-null. - */ - isTuple(): this is (ParamType & { components: ReadonlyArray }) { - return (this.baseType === "tuple"); - } - - /** - * Returns true if %%this%% is an Indexable type. - * - * This provides a type gaurd ensuring that [[indexed]] - * is non-null. - */ - isIndexable(): this is (ParamType & { indexed: boolean }) { - return (this.indexed != null); - } - - /** - * Walks the **ParamType** with %%value%%, calling %%process%% - * on each type, destructing the %%value%% recursively. - */ - walk(value: any, process: ParamTypeWalkFunc): any { - if (this.isArray()) { - if (!Array.isArray(value)) { throw new Error("invalid array value"); } - if (this.arrayLength !== -1 && value.length !== this.arrayLength) { - throw new Error("array is wrong length"); - } - const _this = this; - return value.map((v) => (_this.arrayChildren.walk(v, process))); - } - - if (this.isTuple()) { - if (!Array.isArray(value)) { throw new Error("invalid tuple value"); } - if (value.length !== this.components.length) { - throw new Error("array is wrong length"); - } - const _this = this; - return value.map((v, i) => (_this.components[i].walk(v, process))); - } - - return process(this.type, value); - } - - #walkAsync(promises: Array>, value: any, process: ParamTypeWalkAsyncFunc, setValue: (value: any) => void): void { - - if (this.isArray()) { - if (!Array.isArray(value)) { throw new Error("invalid array value"); } - if (this.arrayLength !== -1 && value.length !== this.arrayLength) { - throw new Error("array is wrong length"); - } - const childType = this.arrayChildren; - - const result = value.slice(); - result.forEach((value, index) => { - childType.#walkAsync(promises, value, process, (value: any) => { - result[index] = value; - }); - }); - setValue(result); - return; - } - - if (this.isTuple()) { - const components = this.components; - - // Convert the object into an array - let result: Array; - if (Array.isArray(value)) { - result = value.slice(); - - } else { - if (value == null || typeof(value) !== "object") { - throw new Error("invalid tuple value"); - } - - result = components.map((param) => { - if (!param.name) { throw new Error("cannot use object value with unnamed components"); } - if (!(param.name in value)) { - throw new Error(`missing value for component ${ param.name }`); - } - return value[param.name]; - }); - } - - if (result.length !== this.components.length) { - throw new Error("array is wrong length"); - } - - result.forEach((value, index) => { - components[index].#walkAsync(promises, value, process, (value: any) => { - result[index] = value; - }); - }); - setValue(result); - return; - } - - const result = process(this.type, value); - if (result.then) { - promises.push((async function() { setValue(await result); })()); - } else { - setValue(result); - } - } - - /** - * Walks the **ParamType** with %%value%%, asynchronously calling - * %%process%% on each type, destructing the %%value%% recursively. - * - * This can be used to resolve ENS names by walking and resolving each - * ``"address"`` type. - */ - async walkAsync(value: any, process: ParamTypeWalkAsyncFunc): Promise { - const promises: Array> = [ ]; - const result: [ any ] = [ value ]; - this.#walkAsync(promises, value, process, (value: any) => { - result[0] = value; - }); - if (promises.length) { await Promise.all(promises); } - return result[0]; - } - - /** - * Creates a new **ParamType** for %%obj%%. - * - * If %%allowIndexed%% then the ``indexed`` keyword is permitted, - * otherwise the ``indexed`` keyword will throw an error. - */ - static from(obj: any, allowIndexed?: boolean): ParamType { - if (ParamType.isParamType(obj)) { return obj; } - - if (typeof(obj) === "string") { - try { - return ParamType.from(lex(obj), allowIndexed); - } catch (error) { - assertArgument(false, "invalid param type", "obj", obj); - } - - } else if (obj instanceof TokenString) { - let type = "", baseType = ""; - let comps: null | Array = null; - - if (consumeKeywords(obj, setify([ "tuple" ])).has("tuple") || obj.peekType("OPEN_PAREN")) { - // Tuple - baseType = "tuple"; - comps = obj.popParams().map((t) => ParamType.from(t)); - type = `tuple(${ comps.map((c) => c.format()).join(",") })`; - } else { - // Normal - type = verifyBasicType(obj.popType("TYPE")); - baseType = type; - } - - // Check for Array - let arrayChildren: null | ParamType = null; - let arrayLength: null | number = null; - - while (obj.length && obj.peekType("BRACKET")) { - const bracket = obj.pop(); //arrays[i]; - arrayChildren = new ParamType(_guard, "", type, baseType, null, comps, arrayLength, arrayChildren); - arrayLength = bracket.value; - type += bracket.text; - baseType = "array"; - comps = null; - } - - let indexed: null | boolean = null; - const keywords = consumeKeywords(obj, KwModifiers); - if (keywords.has("indexed")) { - if (!allowIndexed) { throw new Error(""); } - indexed = true; - } - - const name = (obj.peekType("ID") ? obj.pop().text: ""); - - if (obj.length) { throw new Error("leftover tokens"); } - - return new ParamType(_guard, name, type, baseType, indexed, comps, arrayLength, arrayChildren); - } - - const name = obj.name; - assertArgument(!name || (typeof(name) === "string" && name.match(regexId)), - "invalid name", "obj.name", name); - - let indexed = obj.indexed; - if (indexed != null) { - assertArgument(allowIndexed, "parameter cannot be indexed", "obj.indexed", obj.indexed); - indexed = !!indexed; - } - - let type = obj.type; - - let arrayMatch = type.match(regexArrayType); - if (arrayMatch) { - const arrayLength = parseInt(arrayMatch[2] || "-1"); - const arrayChildren = ParamType.from({ - type: arrayMatch[1], - components: obj.components - }); - - return new ParamType(_guard, name || "", type, "array", indexed, null, arrayLength, arrayChildren); - } - - if (type === "tuple" || type.startsWith("tuple("/* fix: ) */) || type.startsWith("(" /* fix: ) */)) { - const comps = (obj.components != null) ? obj.components.map((c: any) => ParamType.from(c)): null; - const tuple = new ParamType(_guard, name || "", type, "tuple", indexed, comps, null, null); - // @TODO: use lexer to validate and normalize type - return tuple; - } - - type = verifyBasicType(obj.type); - - return new ParamType(_guard, name || "", type, type, indexed, null, null, null); - } - - /** - * Returns true if %%value%% is a **ParamType**. - */ - static isParamType(value: any): value is ParamType { - return (value && value[internal] === ParamTypeInternal); - } -} - -/** - * The type of a [[Fragment]]. - */ -export type FragmentType = "constructor" | "error" | "event" | "fallback" | "function" | "struct"; - -/** - * An abstract class to represent An individual fragment from a parse ABI. - */ -export abstract class Fragment { - /** - * The type of the fragment. - */ - readonly type!: FragmentType; - - /** - * The inputs for the fragment. - */ - readonly inputs!: ReadonlyArray; - - /** - * @private - */ - constructor(guard: any, type: FragmentType, inputs: ReadonlyArray) { - assertPrivate(guard, _guard, "Fragment"); - inputs = Object.freeze(inputs.slice()); - defineProperties(this, { type, inputs }); - } - - /** - * Returns a string representation of this fragment as %%format%%. - */ - abstract format(format?: FormatType): string; - - /** - * Creates a new **Fragment** for %%obj%%, wich can be any supported - * ABI frgament type. - */ - static from(obj: any): Fragment { - if (typeof(obj) === "string") { - - // Try parsing JSON... - try { - Fragment.from(JSON.parse(obj)); - } catch (e) { } - - // ...otherwise, use the human-readable lexer - return Fragment.from(lex(obj)); - } - - if (obj instanceof TokenString) { - // Human-readable ABI (already lexed) - - const type = obj.peekKeyword(KwTypes); - - switch (type) { - case "constructor": return ConstructorFragment.from(obj); - case "error": return ErrorFragment.from(obj); - case "event": return EventFragment.from(obj); - case "fallback": case "receive": - return FallbackFragment.from(obj); - case "function": return FunctionFragment.from(obj); - case "struct": return StructFragment.from(obj); - } - - } else if (typeof(obj) === "object") { - // JSON ABI - - switch (obj.type) { - case "constructor": return ConstructorFragment.from(obj); - case "error": return ErrorFragment.from(obj); - case "event": return EventFragment.from(obj); - case "fallback": case "receive": - return FallbackFragment.from(obj); - case "function": return FunctionFragment.from(obj); - case "struct": return StructFragment.from(obj); - } - - assert(false, `unsupported type: ${ obj.type }`, "UNSUPPORTED_OPERATION", { - operation: "Fragment.from" - }); - } - - assertArgument(false, "unsupported frgament object", "obj", obj); - } - - /** - * Returns true if %%value%% is a [[ConstructorFragment]]. - */ - static isConstructor(value: any): value is ConstructorFragment { - return ConstructorFragment.isFragment(value); - } - - /** - * Returns true if %%value%% is an [[ErrorFragment]]. - */ - static isError(value: any): value is ErrorFragment { - return ErrorFragment.isFragment(value); - } - - /** - * Returns true if %%value%% is an [[EventFragment]]. - */ - static isEvent(value: any): value is EventFragment { - return EventFragment.isFragment(value); - } - - /** - * Returns true if %%value%% is a [[FunctionFragment]]. - */ - static isFunction(value: any): value is FunctionFragment { - return FunctionFragment.isFragment(value); - } - - /** - * Returns true if %%value%% is a [[StructFragment]]. - */ - static isStruct(value: any): value is StructFragment { - return StructFragment.isFragment(value); - } -} - -/** - * An abstract class to represent An individual fragment - * which has a name from a parse ABI. - */ -export abstract class NamedFragment extends Fragment { - /** - * The name of the fragment. - */ - readonly name!: string; - - /** - * @private - */ - constructor(guard: any, type: FragmentType, name: string, inputs: ReadonlyArray) { - super(guard, type, inputs); - assertArgument(typeof(name) === "string" && name.match(regexId), - "invalid identifier", "name", name); - inputs = Object.freeze(inputs.slice()); - defineProperties(this, { name }); - } -} - -function joinParams(format: FormatType, params: ReadonlyArray): string { - return "(" + params.map((p) => p.format(format)).join((format === "full") ? ", ": ",") + ")"; -} - -/** - * A Fragment which represents a //Custom Error//. - */ -export class ErrorFragment extends NamedFragment { - /** - * @private - */ - constructor(guard: any, name: string, inputs: ReadonlyArray) { - super(guard, "error", name, inputs); - Object.defineProperty(this, internal, { value: ErrorFragmentInternal }); - } - - /** - * The Custom Error selector. - */ - get selector(): string { - return id(this.format("sighash")).substring(0, 10); - } - - /** - * Returns a string representation of this fragment as %%format%%. - */ - format(format?: FormatType): string { - if (format == null) { format = "sighash"; } - if (format === "json") { - return JSON.stringify({ - type: "error", - name: this.name, - inputs: this.inputs.map((input) => JSON.parse(input.format(format))), - }); - } - - const result: Array = [ ]; - if (format !== "sighash") { result.push("error"); } - result.push(this.name + joinParams(format, this.inputs)); - return result.join(" "); - } - - /** - * Returns a new **ErrorFragment** for %%obj%%. - */ - static from(obj: any): ErrorFragment { - if (ErrorFragment.isFragment(obj)) { return obj; } - - if (typeof(obj) === "string") { - return ErrorFragment.from(lex(obj)); - - } else if (obj instanceof TokenString) { - const name = consumeName("error", obj); - const inputs = consumeParams(obj); - consumeEoi(obj); - - return new ErrorFragment(_guard, name, inputs); - } - - return new ErrorFragment(_guard, obj.name, - obj.inputs ? obj.inputs.map(ParamType.from): [ ]); - } - - /** - * Returns ``true`` and provides a type guard if %%value%% is an - * **ErrorFragment**. - */ - static isFragment(value: any): value is ErrorFragment { - return (value && value[internal] === ErrorFragmentInternal); - } -} - -/** - * A Fragment which represents an Event. - */ -export class EventFragment extends NamedFragment { - /** - * Whether this event is anonymous. - */ - readonly anonymous!: boolean; - - /** - * @private - */ - constructor(guard: any, name: string, inputs: ReadonlyArray, anonymous: boolean) { - super(guard, "event", name, inputs); - Object.defineProperty(this, internal, { value: EventFragmentInternal }); - defineProperties(this, { anonymous }); - } - - /** - * The Event topic hash. - */ - get topicHash(): string { - return id(this.format("sighash")); - } - - /** - * Returns a string representation of this event as %%format%%. - */ - format(format?: FormatType): string { - if (format == null) { format = "sighash"; } - if (format === "json") { - return JSON.stringify({ - type: "event", - anonymous: this.anonymous, - name: this.name, - inputs: this.inputs.map((i) => JSON.parse(i.format(format))) - }); - } - - const result: Array = [ ]; - if (format !== "sighash") { result.push("event"); } - result.push(this.name + joinParams(format, this.inputs)); - if (format !== "sighash" && this.anonymous) { result.push("anonymous"); } - return result.join(" "); - } - - /** - * Return the topic hash for an event with %%name%% and %%params%%. - */ - static getTopicHash(name: string, params?: Array): string { - params = (params || []).map((p) => ParamType.from(p)); - const fragment = new EventFragment(_guard, name, params, false); - return fragment.topicHash; - } - - /** - * Returns a new **EventFragment** for %%obj%%. - */ - static from(obj: any): EventFragment { - if (EventFragment.isFragment(obj)) { return obj; } - - if (typeof(obj) === "string") { - try { - return EventFragment.from(lex(obj)); - } catch (error) { - assertArgument(false, "invalid event fragment", "obj", obj); - } - - } else if (obj instanceof TokenString) { - const name = consumeName("event", obj); - const inputs = consumeParams(obj, true); - const anonymous = !!consumeKeywords(obj, setify([ "anonymous" ])).has("anonymous"); - consumeEoi(obj); - - return new EventFragment(_guard, name, inputs, anonymous); - } - - return new EventFragment(_guard, obj.name, - obj.inputs ? obj.inputs.map((p: any) => ParamType.from(p, true)): [ ], !!obj.anonymous); - } - - /** - * Returns ``true`` and provides a type guard if %%value%% is an - * **EventFragment**. - */ - static isFragment(value: any): value is EventFragment { - return (value && value[internal] === EventFragmentInternal); - } -} - -/** - * A Fragment which represents a constructor. - */ -export class ConstructorFragment extends Fragment { - - /** - * Whether the constructor can receive an endowment. - */ - readonly payable!: boolean; - - /** - * The recommended gas limit for deployment or ``null``. - */ - readonly gas!: null | bigint; - - /** - * @private - */ - constructor(guard: any, type: FragmentType, inputs: ReadonlyArray, payable: boolean, gas: null | bigint) { - super(guard, type, inputs); - Object.defineProperty(this, internal, { value: ConstructorFragmentInternal }); - defineProperties(this, { payable, gas }); - } - - /** - * Returns a string representation of this constructor as %%format%%. - */ - format(format?: FormatType): string { - assert(format != null && format !== "sighash", "cannot format a constructor for sighash", - "UNSUPPORTED_OPERATION", { operation: "format(sighash)" }); - - if (format === "json") { - return JSON.stringify({ - type: "constructor", - stateMutability: (this.payable ? "payable": "undefined"), - payable: this.payable, - gas: ((this.gas != null) ? this.gas: undefined), - inputs: this.inputs.map((i) => JSON.parse(i.format(format))) - }); - } - - const result = [ `constructor${ joinParams(format, this.inputs) }` ]; - if (this.payable) { result.push("payable"); } - if (this.gas != null) { result.push(`@${ this.gas.toString() }`); } - return result.join(" "); - } - - /** - * Returns a new **ConstructorFragment** for %%obj%%. - */ - static from(obj: any): ConstructorFragment { - if (ConstructorFragment.isFragment(obj)) { return obj; } - - if (typeof(obj) === "string") { - try { - return ConstructorFragment.from(lex(obj)); - } catch (error) { - assertArgument(false, "invalid constuctor fragment", "obj", obj); - } - - } else if (obj instanceof TokenString) { - consumeKeywords(obj, setify([ "constructor" ])); - const inputs = consumeParams(obj); - const payable = !!consumeKeywords(obj, KwVisibDeploy).has("payable"); - const gas = consumeGas(obj); - consumeEoi(obj); - - return new ConstructorFragment(_guard, "constructor", inputs, payable, gas); - } - - return new ConstructorFragment(_guard, "constructor", - obj.inputs ? obj.inputs.map(ParamType.from): [ ], - !!obj.payable, (obj.gas != null) ? obj.gas: null); - } - - /** - * Returns ``true`` and provides a type guard if %%value%% is a - * **ConstructorFragment**. - */ - static isFragment(value: any): value is ConstructorFragment { - return (value && value[internal] === ConstructorFragmentInternal); - } -} - -/** - * A Fragment which represents a method. - */ -export class FallbackFragment extends Fragment { - - /** - * If the function can be sent value during invocation. - */ - readonly payable!: boolean; - - constructor(guard: any, inputs: ReadonlyArray, payable: boolean) { - super(guard, "fallback", inputs); - Object.defineProperty(this, internal, { value: FallbackFragmentInternal }); - defineProperties(this, { payable }); - } - - /** - * Returns a string representation of this fallback as %%format%%. - */ - format(format?: FormatType): string { - const type = ((this.inputs.length === 0) ? "receive": "fallback"); - - if (format === "json") { - const stateMutability = (this.payable ? "payable": "nonpayable"); - return JSON.stringify({ type, stateMutability }); - } - - return `${ type }()${ this.payable ? " payable": "" }`; - } - - /** - * Returns a new **FallbackFragment** for %%obj%%. - */ - static from(obj: any): FallbackFragment { - if (FallbackFragment.isFragment(obj)) { return obj; } - - if (typeof(obj) === "string") { - try { - return FallbackFragment.from(lex(obj)); - } catch (error) { - assertArgument(false, "invalid fallback fragment", "obj", obj); - } - - } else if (obj instanceof TokenString) { - const errorObj = obj.toString(); - - const topIsValid = obj.peekKeyword(setify([ "fallback", "receive" ])); - assertArgument(topIsValid, "type must be fallback or receive", "obj", errorObj); - - const type = obj.popKeyword(setify([ "fallback", "receive" ])); - - // receive() - if (type === "receive") { - const inputs = consumeParams(obj); - assertArgument(inputs.length === 0, `receive cannot have arguments`, "obj.inputs", inputs); - consumeKeywords(obj, setify([ "payable" ])); - consumeEoi(obj); - return new FallbackFragment(_guard, [ ], true); - } - - // fallback() [payable] - // fallback(bytes) [payable] returns (bytes) - let inputs = consumeParams(obj); - if (inputs.length) { - assertArgument(inputs.length === 1 && inputs[0].type === "bytes", - "invalid fallback inputs", "obj.inputs", - inputs.map((i) => i.format("minimal")).join(", ")); - } else { - inputs = [ ParamType.from("bytes") ]; - } - - const mutability = consumeMutability(obj); - assertArgument(mutability === "nonpayable" || mutability === "payable", "fallback cannot be constants", "obj.stateMutability", mutability); - - if (consumeKeywords(obj, setify([ "returns" ])).has("returns")) { - const outputs = consumeParams(obj); - assertArgument(outputs.length === 1 && outputs[0].type === "bytes", - "invalid fallback outputs", "obj.outputs", - outputs.map((i) => i.format("minimal")).join(", ")); - } - - consumeEoi(obj); - - return new FallbackFragment(_guard, inputs, mutability === "payable"); - } - - if (obj.type === "receive") { - return new FallbackFragment(_guard, [ ], true); - } - - if (obj.type === "fallback") { - const inputs = [ ParamType.from("bytes") ]; - const payable = (obj.stateMutability === "payable"); - return new FallbackFragment(_guard, inputs, payable); - } - - assertArgument(false, "invalid fallback description", "obj", obj); - } - - /** - * Returns ``true`` and provides a type guard if %%value%% is a - * **FallbackFragment**. - */ - static isFragment(value: any): value is FallbackFragment { - return (value && value[internal] === FallbackFragmentInternal); - } -} - - -/** - * A Fragment which represents a method. - */ -export class FunctionFragment extends NamedFragment { - /** - * If the function is constant (e.g. ``pure`` or ``view`` functions). - */ - readonly constant!: boolean; - - /** - * The returned types for the result of calling this function. - */ - readonly outputs!: ReadonlyArray; - - /** - * The state mutability (e.g. ``payable``, ``nonpayable``, ``view`` - * or ``pure``) - */ - readonly stateMutability!: "payable" | "nonpayable" | "view" | "pure"; - - /** - * If the function can be sent value during invocation. - */ - readonly payable!: boolean; - - /** - * The recommended gas limit to send when calling this function. - */ - readonly gas!: null | bigint; - - /** - * @private - */ - constructor(guard: any, name: string, stateMutability: "payable" | "nonpayable" | "view" | "pure", inputs: ReadonlyArray, outputs: ReadonlyArray, gas: null | bigint) { - super(guard, "function", name, inputs); - Object.defineProperty(this, internal, { value: FunctionFragmentInternal }); - outputs = Object.freeze(outputs.slice()); - const constant = (stateMutability === "view" || stateMutability === "pure"); - const payable = (stateMutability === "payable"); - defineProperties(this, { constant, gas, outputs, payable, stateMutability }); - } - - /** - * The Function selector. - */ - get selector(): string { - return id(this.format("sighash")).substring(0, 10); - } - - /** - * Returns a string representation of this function as %%format%%. - */ - format(format?: FormatType): string { - if (format == null) { format = "sighash"; } - if (format === "json") { - return JSON.stringify({ - type: "function", - name: this.name, - constant: this.constant, - stateMutability: ((this.stateMutability !== "nonpayable") ? this.stateMutability: undefined), - payable: this.payable, - gas: ((this.gas != null) ? this.gas: undefined), - inputs: this.inputs.map((i) => JSON.parse(i.format(format))), - outputs: this.outputs.map((o) => JSON.parse(o.format(format))), - }); - } - - const result: Array = []; - - if (format !== "sighash") { result.push("function"); } - - result.push(this.name + joinParams(format, this.inputs)); - - if (format !== "sighash") { - if (this.stateMutability !== "nonpayable") { - result.push(this.stateMutability); - } - - if (this.outputs && this.outputs.length) { - result.push("returns"); - result.push(joinParams(format, this.outputs)); - } - - if (this.gas != null) { result.push(`@${ this.gas.toString() }`); } - } - return result.join(" "); - } - - /** - * Return the selector for a function with %%name%% and %%params%%. - */ - static getSelector(name: string, params?: Array): string { - params = (params || []).map((p) => ParamType.from(p)); - const fragment = new FunctionFragment(_guard, name, "view", params, [ ], null); - return fragment.selector; - } - - /** - * Returns a new **FunctionFragment** for %%obj%%. - */ - static from(obj: any): FunctionFragment { - if (FunctionFragment.isFragment(obj)) { return obj; } - - if (typeof(obj) === "string") { - try { - return FunctionFragment.from(lex(obj)); - } catch (error) { - assertArgument(false, "invalid function fragment", "obj", obj); - } - - } else if (obj instanceof TokenString) { - const name = consumeName("function", obj); - const inputs = consumeParams(obj); - const mutability = consumeMutability(obj); - - let outputs: Array = [ ]; - if (consumeKeywords(obj, setify([ "returns" ])).has("returns")) { - outputs = consumeParams(obj); - } - - const gas = consumeGas(obj); - - consumeEoi(obj); - - return new FunctionFragment(_guard, name, mutability, inputs, outputs, gas); - } - - let stateMutability = obj.stateMutability; - - // Use legacy Solidity ABI logic if stateMutability is missing - if (stateMutability == null) { - stateMutability = "payable"; - - if (typeof(obj.constant) === "boolean") { - stateMutability = "view"; - if (!obj.constant) { - stateMutability = "payable" - if (typeof(obj.payable) === "boolean" && !obj.payable) { - stateMutability = "nonpayable"; - } - } - } else if (typeof(obj.payable) === "boolean" && !obj.payable) { - stateMutability = "nonpayable"; - } - } - - // @TODO: verifyState for stateMutability (e.g. throw if - // payable: false but stateMutability is "nonpayable") - - return new FunctionFragment(_guard, obj.name, stateMutability, - obj.inputs ? obj.inputs.map(ParamType.from): [ ], - obj.outputs ? obj.outputs.map(ParamType.from): [ ], - (obj.gas != null) ? obj.gas: null); - } - - /** - * Returns ``true`` and provides a type guard if %%value%% is a - * **FunctionFragment**. - */ - static isFragment(value: any): value is FunctionFragment { - return (value && value[internal] === FunctionFragmentInternal); - } -} - -/** - * A Fragment which represents a structure. - */ -export class StructFragment extends NamedFragment { - - /** - * @private - */ - constructor(guard: any, name: string, inputs: ReadonlyArray) { - super(guard, "struct", name, inputs); - Object.defineProperty(this, internal, { value: StructFragmentInternal }); - } - - /** - * Returns a string representation of this struct as %%format%%. - */ - format(): string { - throw new Error("@TODO"); - } - - /** - * Returns a new **StructFragment** for %%obj%%. - */ - static from(obj: any): StructFragment { - if (typeof(obj) === "string") { - try { - return StructFragment.from(lex(obj)); - } catch (error) { - assertArgument(false, "invalid struct fragment", "obj", obj); - } - - } else if (obj instanceof TokenString) { - const name = consumeName("struct", obj); - const inputs = consumeParams(obj); - consumeEoi(obj); - return new StructFragment(_guard, name, inputs); - } - - return new StructFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from): [ ]); - } - -// @TODO: fix this return type - /** - * Returns ``true`` and provides a type guard if %%value%% is a - * **StructFragment**. - */ - static isFragment(value: any): value is FunctionFragment { - return (value && value[internal] === StructFragmentInternal); - } -} - diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/abi/index.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/abi/index.ts deleted file mode 100644 index 5b1649f4..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/abi/index.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * The Application Binary Interface (ABI) describes how method input - * parameters should be encoded, their results decoded, and how to - * decode events and errors. - * - * See [About ABIs](docs-abi) for more details how they are used. - * - * @_section api/abi:Application Binary Interface [about-abi] - * @_navTitle: ABI - */ - - -////// -export { AbiCoder } from "./abi-coder.js"; - -export { decodeBytes32String, encodeBytes32String } from "./bytes32.js"; - -export { - ConstructorFragment, ErrorFragment, EventFragment, FallbackFragment, - Fragment, FunctionFragment, NamedFragment, ParamType, StructFragment, -} from "./fragments.js"; - -export { - checkResultErrors, - Indexed, - Interface, - ErrorDescription, LogDescription, TransactionDescription, - Result -} from "./interface.js"; - -export { Typed } from "./typed.js"; - -export type { - JsonFragment, JsonFragmentType, - FormatType, FragmentType, ParamTypeWalkAsyncFunc, ParamTypeWalkFunc -} from "./fragments.js"; - -export type { - InterfaceAbi, -} from "./interface.js"; - diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/abi/interface.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/abi/interface.ts deleted file mode 100644 index 2dcee74f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/abi/interface.ts +++ /dev/null @@ -1,1271 +0,0 @@ -/** - * The Interface class is a low-level class that accepts an - * ABI and provides all the necessary functionality to encode - * and decode paramaters to and results from methods, events - * and errors. - * - * It also provides several convenience methods to automatically - * search and find matching transactions and events to parse them. - * - * @_subsection api/abi:Interfaces [interfaces] - */ - -import { keccak256 } from "../crypto/index.js" -import { id } from "../hash/index.js" -import { - concat, dataSlice, getBigInt, getBytes, getBytesCopy, - hexlify, zeroPadBytes, zeroPadValue, isHexString, defineProperties, - assertArgument, toBeHex, assert -} from "../utils/index.js"; - -import { AbiCoder } from "./abi-coder.js"; -import { checkResultErrors, Result } from "./coders/abstract-coder.js"; -import { - ConstructorFragment, ErrorFragment, EventFragment, FallbackFragment, - Fragment, FunctionFragment, ParamType -} from "./fragments.js"; -import { Typed } from "./typed.js"; - -import type { BigNumberish, BytesLike, CallExceptionError, CallExceptionTransaction } from "../utils/index.js"; - -import type { JsonFragment } from "./fragments.js"; - - -export { checkResultErrors, Result }; - -/** - * When using the [[Interface-parseLog]] to automatically match a Log to its event - * for parsing, a **LogDescription** is returned. - */ -export class LogDescription { - /** - * The matching fragment for the ``topic0``. - */ - readonly fragment!: EventFragment; - - /** - * The name of the Event. - */ - readonly name!: string; - - /** - * The full Event signature. - */ - readonly signature!: string; - - /** - * The topic hash for the Event. - */ - readonly topic!: string; - - /** - * The arguments passed into the Event with ``emit``. - */ - readonly args!: Result - - /** - * @_ignore: - */ - constructor(fragment: EventFragment, topic: string, args: Result) { - const name = fragment.name, signature = fragment.format(); - defineProperties(this, { - fragment, name, signature, topic, args - }); - } -} - -/** - * When using the [[Interface-parseTransaction]] to automatically match - * a transaction data to its function for parsing, - * a **TransactionDescription** is returned. - */ -export class TransactionDescription { - /** - * The matching fragment from the transaction ``data``. - */ - readonly fragment!: FunctionFragment; - - /** - * The name of the Function from the transaction ``data``. - */ - readonly name!: string; - - /** - * The arguments passed to the Function from the transaction ``data``. - */ - readonly args!: Result; - - /** - * The full Function signature from the transaction ``data``. - */ - readonly signature!: string; - - /** - * The selector for the Function from the transaction ``data``. - */ - readonly selector!: string; - - /** - * The ``value`` (in wei) from the transaction. - */ - readonly value!: bigint; - - /** - * @_ignore: - */ - constructor(fragment: FunctionFragment, selector: string, args: Result, value: bigint) { - const name = fragment.name, signature = fragment.format(); - defineProperties(this, { - fragment, name, args, signature, selector, value - }); - } -} - -/** - * When using the [[Interface-parseError]] to automatically match an - * error for a call result for parsing, an **ErrorDescription** is returned. - */ -export class ErrorDescription { - /** - * The matching fragment. - */ - readonly fragment!: ErrorFragment; - - /** - * The name of the Error. - */ - readonly name!: string; - - /** - * The arguments passed to the Error with ``revert``. - */ - readonly args!: Result; - - /** - * The full Error signature. - */ - readonly signature!: string; - - /** - * The selector for the Error. - */ - readonly selector!: string; - - /** - * @_ignore: - */ - constructor(fragment: ErrorFragment, selector: string, args: Result) { - const name = fragment.name, signature = fragment.format(); - defineProperties(this, { - fragment, name, args, signature, selector - }); - } -} - -/** - * An **Indexed** is used as a value when a value that does not - * fit within a topic (i.e. not a fixed-length, 32-byte type). It - * is the ``keccak256`` of the value, and used for types such as - * arrays, tuples, bytes and strings. - */ -export class Indexed { - /** - * The ``keccak256`` of the value logged. - */ - readonly hash!: null | string; - - /** - * @_ignore: - */ - readonly _isIndexed!: boolean; - - /** - * Returns ``true`` if %%value%% is an **Indexed**. - * - * This provides a Type Guard for property access. - */ - static isIndexed(value: any): value is Indexed { - return !!(value && value._isIndexed); - } - - /** - * @_ignore: - */ - constructor(hash: null | string) { - defineProperties(this, { hash, _isIndexed: true }) - } -} - -type ErrorInfo = { - signature: string, - inputs: Array, - name: string, - reason: (...args: Array) => string; -}; - -// https://docs.soliditylang.org/en/v0.8.13/control-structures.html?highlight=panic#panic-via-assert-and-error-via-require -const PanicReasons: Record = { - "0": "generic panic", - "1": "assert(false)", - "17": "arithmetic overflow", - "18": "division or modulo by zero", - "33": "enum overflow", - "34": "invalid encoded storage byte array accessed", - "49": "out-of-bounds array access; popping on an empty array", - "50": "out-of-bounds access of an array or bytesN", - "65": "out of memory", - "81": "uninitialized function", -} - -const BuiltinErrors: Record = { - "0x08c379a0": { - signature: "Error(string)", - name: "Error", - inputs: [ "string" ], - reason: (message: string) => { - return `reverted with reason string ${ JSON.stringify(message) }`; - } - }, - "0x4e487b71": { - signature: "Panic(uint256)", - name: "Panic", - inputs: [ "uint256" ], - reason: (code: bigint) => { - let reason = "unknown panic code"; - if (code >= 0 && code <= 0xff && PanicReasons[code.toString()]) { - reason = PanicReasons[code.toString()]; - } - return `reverted with panic code 0x${ code.toString(16) } (${ reason })`; - } - } -} - -/* -function wrapAccessError(property: string, error: Error): Error { - const wrap = new Error(`deferred error during ABI decoding triggered accessing ${ property }`); - (wrap).error = error; - return wrap; -} -*/ -/* -function checkNames(fragment: Fragment, type: "input" | "output", params: Array): void { - params.reduce((accum, param) => { - if (param.name) { - if (accum[param.name]) { - logger.throwArgumentError(`duplicate ${ type } parameter ${ JSON.stringify(param.name) } in ${ fragment.format("full") }`, "fragment", fragment); - } - accum[param.name] = true; - } - return accum; - }, <{ [ name: string ]: boolean }>{ }); -} -*/ - -/** - * An **InterfaceAbi** may be any supported ABI format. - * - * A string is expected to be a JSON string, which will be parsed - * using ``JSON.parse``. This means that the value **must** be a valid - * JSON string, with no stray commas, etc. - * - * An array may contain any combination of: - * - Human-Readable fragments - * - Parsed JSON fragment - * - [[Fragment]] instances - * - * A **Human-Readable Fragment** is a string which resembles a Solidity - * signature and is introduced in [this blog entry](link-ricmoo-humanreadableabi). - * For example, ``function balanceOf(address) view returns (uint)``. - * - * A **Parsed JSON Fragment** is a JavaScript Object desribed in the - * [Solidity documentation](link-solc-jsonabi). - */ -export type InterfaceAbi = string | ReadonlyArray; - -/** - * An Interface abstracts many of the low-level details for - * encoding and decoding the data on the blockchain. - * - * An ABI provides information on how to encode data to send to - * a Contract, how to decode the results and events and how to - * interpret revert errors. - * - * The ABI can be specified by [any supported format](InterfaceAbi). - */ -export class Interface { - - /** - * All the Contract ABI members (i.e. methods, events, errors, etc). - */ - readonly fragments!: ReadonlyArray; - - /** - * The Contract constructor. - */ - readonly deploy!: ConstructorFragment; - - /** - * The Fallback method, if any. - */ - readonly fallback!: null | FallbackFragment; - - /** - * If receiving ether is supported. - */ - readonly receive!: boolean; - - #errors: Map; - #events: Map; - #functions: Map; -// #structs: Map; - - #abiCoder: AbiCoder; - - /** - * Create a new Interface for the %%fragments%%. - */ - constructor(fragments: InterfaceAbi) { - let abi: ReadonlyArray = [ ]; - if (typeof(fragments) === "string") { - abi = JSON.parse(fragments); - } else { - abi = fragments; - } - - this.#functions = new Map(); - this.#errors = new Map(); - this.#events = new Map(); -// this.#structs = new Map(); - - - const frags: Array = [ ]; - for (const a of abi) { - try { - frags.push(Fragment.from(a)); - } catch (error: any) { - console.log(`[Warning] Invalid Fragment ${ JSON.stringify(a) }:`, error.message); - } - } - - defineProperties(this, { - fragments: Object.freeze(frags) - }); - - let fallback: null | FallbackFragment = null; - let receive = false; - - this.#abiCoder = this.getAbiCoder(); - - // Add all fragments by their signature - this.fragments.forEach((fragment, index) => { - let bucket: Map; - switch (fragment.type) { - case "constructor": - if (this.deploy) { - console.log("duplicate definition - constructor"); - return; - } - //checkNames(fragment, "input", fragment.inputs); - defineProperties(this, { deploy: fragment }); - return; - - case "fallback": - if (fragment.inputs.length === 0) { - receive = true; - } else { - assertArgument(!fallback || (fragment).payable !== fallback.payable, - "conflicting fallback fragments", `fragments[${ index }]`, fragment); - fallback = fragment; - receive = fallback.payable; - } - return; - - case "function": - //checkNames(fragment, "input", fragment.inputs); - //checkNames(fragment, "output", (fragment).outputs); - bucket = this.#functions; - break; - - case "event": - //checkNames(fragment, "input", fragment.inputs); - bucket = this.#events; - break; - - case "error": - bucket = this.#errors; - break; - - default: - return; - } - - // Two identical entries; ignore it - const signature = fragment.format(); - if (bucket.has(signature)) { return; } - - bucket.set(signature, fragment); - }); - - // If we do not have a constructor add a default - if (!this.deploy) { - defineProperties(this, { - deploy: ConstructorFragment.from("constructor()") - }); - } - - defineProperties(this, { fallback, receive }); - } - - /** - * Returns the entire Human-Readable ABI, as an array of - * signatures, optionally as %%minimal%% strings, which - * removes parameter names and unneceesary spaces. - */ - format(minimal?: boolean): Array { - const format = (minimal ? "minimal": "full"); - const abi = this.fragments.map((f) => f.format(format)); - return abi; - } - - /** - * Return the JSON-encoded ABI. This is the format Solidiy - * returns. - */ - formatJson(): string { - const abi = this.fragments.map((f) => f.format("json")); - - // We need to re-bundle the JSON fragments a bit - return JSON.stringify(abi.map((j) => JSON.parse(j))); - } - - /** - * The ABI coder that will be used to encode and decode binary - * data. - */ - getAbiCoder(): AbiCoder { - return AbiCoder.defaultAbiCoder(); - } - - // Find a function definition by any means necessary (unless it is ambiguous) - #getFunction(key: string, values: null | Array, forceUnique: boolean): null | FunctionFragment { - - // Selector - if (isHexString(key)) { - const selector = key.toLowerCase(); - for (const fragment of this.#functions.values()) { - if (selector === fragment.selector) { return fragment; } - } - return null; - } - - // It is a bare name, look up the function (will return null if ambiguous) - if (key.indexOf("(") === -1) { - const matching: Array = [ ]; - for (const [ name, fragment ] of this.#functions) { - if (name.split("("/* fix:) */)[0] === key) { matching.push(fragment); } - } - - if (values) { - const lastValue = (values.length > 0) ? values[values.length - 1]: null; - - let valueLength = values.length; - let allowOptions = true; - if (Typed.isTyped(lastValue) && lastValue.type === "overrides") { - allowOptions = false; - valueLength--; - } - - // Remove all matches that don't have a compatible length. The args - // may contain an overrides, so the match may have n or n - 1 parameters - for (let i = matching.length - 1; i >= 0; i--) { - const inputs = matching[i].inputs.length; - if (inputs !== valueLength && (!allowOptions || inputs !== valueLength - 1)) { - matching.splice(i, 1); - } - } - - // Remove all matches that don't match the Typed signature - for (let i = matching.length - 1; i >= 0; i--) { - const inputs = matching[i].inputs; - for (let j = 0; j < values.length; j++) { - // Not a typed value - if (!Typed.isTyped(values[j])) { continue; } - - // We are past the inputs - if (j >= inputs.length) { - if (values[j].type === "overrides") { continue; } - matching.splice(i, 1); - break; - } - - // Make sure the value type matches the input type - if (values[j].type !== inputs[j].baseType) { - matching.splice(i, 1); - break; - } - } - } - } - - // We found a single matching signature with an overrides, but the - // last value is something that cannot possibly be an options - if (matching.length === 1 && values && values.length !== matching[0].inputs.length) { - const lastArg = values[values.length - 1]; - if (lastArg == null || Array.isArray(lastArg) || typeof(lastArg) !== "object") { - matching.splice(0, 1); - } - } - - if (matching.length === 0) { return null; } - - if (matching.length > 1 && forceUnique) { - const matchStr = matching.map((m) => JSON.stringify(m.format())).join(", "); - assertArgument(false, `ambiguous function description (i.e. matches ${ matchStr })`, "key", key); - } - - return matching[0]; - } - - // Normalize the signature and lookup the function - const result = this.#functions.get(FunctionFragment.from(key).format()); - if (result) { return result; } - - return null; - } - - /** - * Get the function name for %%key%%, which may be a function selector, - * function name or function signature that belongs to the ABI. - */ - getFunctionName(key: string): string { - const fragment = this.#getFunction(key, null, false); - assertArgument(fragment, "no matching function", "key", key); - return fragment.name; - } - - /** - * Returns true if %%key%% (a function selector, function name or - * function signature) is present in the ABI. - * - * In the case of a function name, the name may be ambiguous, so - * accessing the [[FunctionFragment]] may require refinement. - */ - hasFunction(key: string): boolean { - return !!this.#getFunction(key, null, false); - } - - /** - * Get the [[FunctionFragment]] for %%key%%, which may be a function - * selector, function name or function signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple functions match by name. - * - * If the %%key%% and %%values%% do not refine to a single function in - * the ABI, this will throw. - */ - getFunction(key: string, values?: Array): null | FunctionFragment { - return this.#getFunction(key, values || null, true); - } - - /** - * Iterate over all functions, calling %%callback%%, sorted by their name. - */ - forEachFunction(callback: (func: FunctionFragment, index: number) => void): void { - const names = Array.from(this.#functions.keys()); - names.sort((a, b) => a.localeCompare(b)); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - callback((this.#functions.get(name)), i); - } - } - - - // Find an event definition by any means necessary (unless it is ambiguous) - #getEvent(key: string, values: null | Array, forceUnique: boolean): null | EventFragment { - - // EventTopic - if (isHexString(key)) { - const eventTopic = key.toLowerCase(); - for (const fragment of this.#events.values()) { - if (eventTopic === fragment.topicHash) { return fragment; } - } - return null; - } - - // It is a bare name, look up the function (will return null if ambiguous) - if (key.indexOf("(") === -1) { - const matching: Array = [ ]; - for (const [ name, fragment ] of this.#events) { - if (name.split("("/* fix:) */)[0] === key) { matching.push(fragment); } - } - - if (values) { - // Remove all matches that don't have a compatible length. - for (let i = matching.length - 1; i >= 0; i--) { - if (matching[i].inputs.length < values.length) { - matching.splice(i, 1); - } - } - - // Remove all matches that don't match the Typed signature - for (let i = matching.length - 1; i >= 0; i--) { - const inputs = matching[i].inputs; - for (let j = 0; j < values.length; j++) { - // Not a typed value - if (!Typed.isTyped(values[j])) { continue; } - - // Make sure the value type matches the input type - if (values[j].type !== inputs[j].baseType) { - matching.splice(i, 1); - break; - } - } - } - } - - if (matching.length === 0) { return null; } - - if (matching.length > 1 && forceUnique) { - const matchStr = matching.map((m) => JSON.stringify(m.format())).join(", "); - assertArgument(false, `ambiguous event description (i.e. matches ${ matchStr })`, "key", key); - } - - return matching[0]; - } - - // Normalize the signature and lookup the function - const result = this.#events.get(EventFragment.from(key).format()); - if (result) { return result; } - - return null; - } - - /** - * Get the event name for %%key%%, which may be a topic hash, - * event name or event signature that belongs to the ABI. - */ - getEventName(key: string): string { - const fragment = this.#getEvent(key, null, false); - assertArgument(fragment, "no matching event", "key", key); - - return fragment.name; - } - - /** - * Returns true if %%key%% (an event topic hash, event name or - * event signature) is present in the ABI. - * - * In the case of an event name, the name may be ambiguous, so - * accessing the [[EventFragment]] may require refinement. - */ - hasEvent(key: string): boolean { - return !!this.#getEvent(key, null, false); - } - - /** - * Get the [[EventFragment]] for %%key%%, which may be a topic hash, - * event name or event signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple events match by name. - * - * If the %%key%% and %%values%% do not refine to a single event in - * the ABI, this will throw. - */ - getEvent(key: string, values?: Array): null | EventFragment { - return this.#getEvent(key, values || null, true) - } - - /** - * Iterate over all events, calling %%callback%%, sorted by their name. - */ - forEachEvent(callback: (func: EventFragment, index: number) => void): void { - const names = Array.from(this.#events.keys()); - names.sort((a, b) => a.localeCompare(b)); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - callback((this.#events.get(name)), i); - } - } - - /** - * Get the [[ErrorFragment]] for %%key%%, which may be an error - * selector, error name or error signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple errors match by name. - * - * If the %%key%% and %%values%% do not refine to a single error in - * the ABI, this will throw. - */ - getError(key: string, values?: Array): null | ErrorFragment { - if (isHexString(key)) { - const selector = key.toLowerCase(); - - if (BuiltinErrors[selector]) { - return ErrorFragment.from(BuiltinErrors[selector].signature); - } - - for (const fragment of this.#errors.values()) { - if (selector === fragment.selector) { return fragment; } - } - - return null; - } - - // It is a bare name, look up the function (will return null if ambiguous) - if (key.indexOf("(") === -1) { - const matching: Array = [ ]; - for (const [ name, fragment ] of this.#errors) { - if (name.split("("/* fix:) */)[0] === key) { matching.push(fragment); } - } - - if (matching.length === 0) { - if (key === "Error") { return ErrorFragment.from("error Error(string)"); } - if (key === "Panic") { return ErrorFragment.from("error Panic(uint256)"); } - return null; - } else if (matching.length > 1) { - const matchStr = matching.map((m) => JSON.stringify(m.format())).join(", "); - assertArgument(false, `ambiguous error description (i.e. ${ matchStr })`, "name", key); - } - - return matching[0]; - } - - // Normalize the signature and lookup the function - key = ErrorFragment.from(key).format() - if (key === "Error(string)") { return ErrorFragment.from("error Error(string)"); } - if (key === "Panic(uint256)") { return ErrorFragment.from("error Panic(uint256)"); } - - const result = this.#errors.get(key); - if (result) { return result; } - - return null; - } - - /** - * Iterate over all errors, calling %%callback%%, sorted by their name. - */ - forEachError(callback: (func: ErrorFragment, index: number) => void): void { - const names = Array.from(this.#errors.keys()); - names.sort((a, b) => a.localeCompare(b)); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - callback((this.#errors.get(name)), i); - } - } - - // Get the 4-byte selector used by Solidity to identify a function - /* - getSelector(fragment: ErrorFragment | FunctionFragment): string { - if (typeof(fragment) === "string") { - const matches: Array = [ ]; - - try { matches.push(this.getFunction(fragment)); } catch (error) { } - try { matches.push(this.getError(fragment)); } catch (_) { } - - if (matches.length === 0) { - logger.throwArgumentError("unknown fragment", "key", fragment); - } else if (matches.length > 1) { - logger.throwArgumentError("ambiguous fragment matches function and error", "key", fragment); - } - - fragment = matches[0]; - } - - return dataSlice(id(fragment.format()), 0, 4); - } - */ - - // Get the 32-byte topic hash used by Solidity to identify an event - /* - getEventTopic(fragment: EventFragment): string { - //if (typeof(fragment) === "string") { fragment = this.getEvent(eventFragment); } - return id(fragment.format()); - } - */ - - - _decodeParams(params: ReadonlyArray, data: BytesLike): Result { - return this.#abiCoder.decode(params, data) - } - - _encodeParams(params: ReadonlyArray, values: ReadonlyArray): string { - return this.#abiCoder.encode(params, values) - } - - /** - * Encodes a ``tx.data`` object for deploying the Contract with - * the %%values%% as the constructor arguments. - */ - encodeDeploy(values?: ReadonlyArray): string { - return this._encodeParams(this.deploy.inputs, values || [ ]); - } - - /** - * Decodes the result %%data%% (e.g. from an ``eth_call``) for the - * specified error (see [[getError]] for valid values for - * %%key%%). - * - * Most developers should prefer the [[parseCallResult]] method instead, - * which will automatically detect a ``CALL_EXCEPTION`` and throw the - * corresponding error. - */ - decodeErrorResult(fragment: ErrorFragment | string, data: BytesLike): Result { - if (typeof(fragment) === "string") { - const f = this.getError(fragment); - assertArgument(f, "unknown error", "fragment", fragment); - fragment = f; - } - - assertArgument(dataSlice(data, 0, 4) === fragment.selector, - `data signature does not match error ${ fragment.name }.`, "data", data); - - return this._decodeParams(fragment.inputs, dataSlice(data, 4)); - } - - /** - * Encodes the transaction revert data for a call result that - * reverted from the the Contract with the sepcified %%error%% - * (see [[getError]] for valid values for %%fragment%%) with the %%values%%. - * - * This is generally not used by most developers, unless trying to mock - * a result from a Contract. - */ - encodeErrorResult(fragment: ErrorFragment | string, values?: ReadonlyArray): string { - if (typeof(fragment) === "string") { - const f = this.getError(fragment); - assertArgument(f, "unknown error", "fragment", fragment); - fragment = f; - } - - return concat([ - fragment.selector, - this._encodeParams(fragment.inputs, values || [ ]) - ]); - } - - /** - * Decodes the %%data%% from a transaction ``tx.data`` for - * the function specified (see [[getFunction]] for valid values - * for %%fragment%%). - * - * Most developers should prefer the [[parseTransaction]] method - * instead, which will automatically detect the fragment. - */ - decodeFunctionData(fragment: FunctionFragment | string, data: BytesLike): Result { - if (typeof(fragment) === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - - assertArgument(dataSlice(data, 0, 4) === fragment.selector, - `data signature does not match function ${ fragment.name }.`, "data", data); - - return this._decodeParams(fragment.inputs, dataSlice(data, 4)); - } - - /** - * Encodes the ``tx.data`` for a transaction that calls the function - * specified (see [[getFunction]] for valid values for %%fragment%%) with - * the %%values%%. - */ - encodeFunctionData(fragment: FunctionFragment | string, values?: ReadonlyArray): string { - if (typeof(fragment) === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - - return concat([ - fragment.selector, - this._encodeParams(fragment.inputs, values || [ ]) - ]); - } - - /** - * Decodes the result %%data%% (e.g. from an ``eth_call``) for the - * specified function (see [[getFunction]] for valid values for - * %%key%%). - * - * Most developers should prefer the [[parseCallResult]] method instead, - * which will automatically detect a ``CALL_EXCEPTION`` and throw the - * corresponding error. - */ - decodeFunctionResult(fragment: FunctionFragment | string, data: BytesLike): Result { - if (typeof(fragment) === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - - let message = "invalid length for result data"; - - const bytes = getBytesCopy(data); - if ((bytes.length % 32) === 0) { - try { - return this.#abiCoder.decode(fragment.outputs, bytes); - } catch (error) { - message = "could not decode result data"; - } - } - - // Call returned data with no error, but the data is junk - assert(false, message, "BAD_DATA", { - value: hexlify(bytes), - info: { method: fragment.name, signature: fragment.format() } - }); - } - - makeError(_data: BytesLike, tx: CallExceptionTransaction): CallExceptionError { - const data = getBytes(_data, "data"); - - const error = AbiCoder.getBuiltinCallException("call", tx, data); - - // Not a built-in error; try finding a custom error - const customPrefix = "execution reverted (unknown custom error)"; - if (error.message.startsWith(customPrefix)) { - const selector = hexlify(data.slice(0, 4)); - - const ef = this.getError(selector); - if (ef) { - try { - const args = this.#abiCoder.decode(ef.inputs, data.slice(4)); - error.revert = { - name: ef.name, signature: ef.format(), args - }; - error.reason = error.revert.signature; - error.message = `execution reverted: ${ error.reason }` - } catch (e) { - error.message = `execution reverted (coult not decode custom error)` - } - } - } - - // Add the invocation, if available - const parsed = this.parseTransaction(tx); - if (parsed) { - error.invocation = { - method: parsed.name, - signature: parsed.signature, - args: parsed.args - }; - } - - return error; - } - - /** - * Encodes the result data (e.g. from an ``eth_call``) for the - * specified function (see [[getFunction]] for valid values - * for %%fragment%%) with %%values%%. - * - * This is generally not used by most developers, unless trying to mock - * a result from a Contract. - */ - encodeFunctionResult(fragment: FunctionFragment | string, values?: ReadonlyArray): string { - if (typeof(fragment) === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - return hexlify(this.#abiCoder.encode(fragment.outputs, values || [ ])); - } -/* - spelunk(inputs: Array, values: ReadonlyArray, processfunc: (type: string, value: any) => Promise): Promise> { - const promises: Array> = [ ]; - const process = function(type: ParamType, value: any): any { - if (type.baseType === "array") { - return descend(type.child - } - if (type. === "address") { - } - }; - - const descend = function (inputs: Array, values: ReadonlyArray) { - if (inputs.length !== values.length) { throw new Error("length mismatch"); } - - }; - - const result: Array = [ ]; - values.forEach((value, index) => { - if (value == null) { - topics.push(null); - } else if (param.baseType === "array" || param.baseType === "tuple") { - logger.throwArgumentError("filtering with tuples or arrays not supported", ("contract." + param.name), value); - } else if (Array.isArray(value)) { - topics.push(value.map((value) => encodeTopic(param, value))); - } else { - topics.push(encodeTopic(param, value)); - } - }); - } -*/ - // Create the filter for the event with search criteria (e.g. for eth_filterLog) - encodeFilterTopics(fragment: EventFragment | string, values: ReadonlyArray): Array> { - if (typeof(fragment) === "string") { - const f = this.getEvent(fragment); - assertArgument(f, "unknown event", "eventFragment", fragment); - fragment = f; - } - - assert(values.length <= fragment.inputs.length, `too many arguments for ${ fragment.format() }`, - "UNEXPECTED_ARGUMENT", { count: values.length, expectedCount: fragment.inputs.length }) - - const topics: Array> = []; - if (!fragment.anonymous) { topics.push(fragment.topicHash); } - - // @TODO: Use the coders for this; to properly support tuples, etc. - const encodeTopic = (param: ParamType, value: any): string => { - if (param.type === "string") { - return id(value); - } else if (param.type === "bytes") { - return keccak256(hexlify(value)); - } - - if (param.type === "bool" && typeof(value) === "boolean") { - value = (value ? "0x01": "0x00"); - } else if (param.type.match(/^u?int/)) { - value = toBeHex(value); // @TODO: Should this toTwos?? - } else if (param.type.match(/^bytes/)) { - value = zeroPadBytes(value, 32); - } else if (param.type === "address") { - // Check addresses are valid - this.#abiCoder.encode( [ "address" ], [ value ]); - } - - return zeroPadValue(hexlify(value), 32); - }; - - values.forEach((value, index) => { - - const param = (fragment).inputs[index]; - - if (!param.indexed) { - assertArgument(value == null, - "cannot filter non-indexed parameters; must be null", ("contract." + param.name), value); - return; - } - - if (value == null) { - topics.push(null); - } else if (param.baseType === "array" || param.baseType === "tuple") { - assertArgument(false, "filtering with tuples or arrays not supported", ("contract." + param.name), value); - } else if (Array.isArray(value)) { - topics.push(value.map((value) => encodeTopic(param, value))); - } else { - topics.push(encodeTopic(param, value)); - } - }); - - // Trim off trailing nulls - while (topics.length && topics[topics.length - 1] === null) { - topics.pop(); - } - - return topics; - } - - encodeEventLog(fragment: EventFragment | string, values: ReadonlyArray): { data: string, topics: Array } { - if (typeof(fragment) === "string") { - const f = this.getEvent(fragment); - assertArgument(f, "unknown event", "eventFragment", fragment); - fragment = f; - } - - const topics: Array = [ ]; - - const dataTypes: Array = [ ]; - const dataValues: Array = [ ]; - - if (!fragment.anonymous) { - topics.push(fragment.topicHash); - } - - assertArgument(values.length === fragment.inputs.length, - "event arguments/values mismatch", "values", values); - - fragment.inputs.forEach((param, index) => { - const value = values[index]; - if (param.indexed) { - if (param.type === "string") { - topics.push(id(value)) - } else if (param.type === "bytes") { - topics.push(keccak256(value)) - } else if (param.baseType === "tuple" || param.baseType === "array") { - // @TODO - throw new Error("not implemented"); - } else { - topics.push(this.#abiCoder.encode([ param.type] , [ value ])); - } - } else { - dataTypes.push(param); - dataValues.push(value); - } - }); - - return { - data: this.#abiCoder.encode(dataTypes , dataValues), - topics: topics - }; - } - - // Decode a filter for the event and the search criteria - decodeEventLog(fragment: EventFragment | string, data: BytesLike, topics?: ReadonlyArray): Result { - if (typeof(fragment) === "string") { - const f = this.getEvent(fragment); - assertArgument(f, "unknown event", "eventFragment", fragment); - fragment = f; - } - - if (topics != null && !fragment.anonymous) { - const eventTopic = fragment.topicHash; - assertArgument(isHexString(topics[0], 32) && topics[0].toLowerCase() === eventTopic, - "fragment/topic mismatch", "topics[0]", topics[0]); - topics = topics.slice(1); - } - - const indexed: Array = []; - const nonIndexed: Array = []; - const dynamic: Array = []; - - fragment.inputs.forEach((param, index) => { - if (param.indexed) { - if (param.type === "string" || param.type === "bytes" || param.baseType === "tuple" || param.baseType === "array") { - indexed.push(ParamType.from({ type: "bytes32", name: param.name })); - dynamic.push(true); - } else { - indexed.push(param); - dynamic.push(false); - } - } else { - nonIndexed.push(param); - dynamic.push(false); - } - }); - - const resultIndexed = (topics != null) ? this.#abiCoder.decode(indexed, concat(topics)): null; - const resultNonIndexed = this.#abiCoder.decode(nonIndexed, data, true); - - //const result: (Array & { [ key: string ]: any }) = [ ]; - const values: Array = [ ]; - const keys: Array = [ ]; - let nonIndexedIndex = 0, indexedIndex = 0; - fragment.inputs.forEach((param, index) => { - let value: null | Indexed | Error = null; - if (param.indexed) { - if (resultIndexed == null) { - value = new Indexed(null); - - } else if (dynamic[index]) { - value = new Indexed(resultIndexed[indexedIndex++]); - - } else { - try { - value = resultIndexed[indexedIndex++]; - } catch (error: any) { - value = error; - } - } - } else { - try { - value = resultNonIndexed[nonIndexedIndex++]; - } catch (error: any) { - value = error; - } - } - - values.push(value); - keys.push(param.name || null); - }); - - return Result.fromItems(values, keys); - } - - /** - * Parses a transaction, finding the matching function and extracts - * the parameter values along with other useful function details. - * - * If the matching function cannot be found, return null. - */ - parseTransaction(tx: { data: string, value?: BigNumberish }): null | TransactionDescription { - const data = getBytes(tx.data, "tx.data"); - const value = getBigInt((tx.value != null) ? tx.value: 0, "tx.value"); - - const fragment = this.getFunction(hexlify(data.slice(0, 4))); - - if (!fragment) { return null; } - - const args = this.#abiCoder.decode(fragment.inputs, data.slice(4)); - return new TransactionDescription(fragment, fragment.selector, args, value); - } - - parseCallResult(data: BytesLike): Result { - throw new Error("@TODO"); - } - - /** - * Parses a receipt log, finding the matching event and extracts - * the parameter values along with other useful event details. - * - * If the matching event cannot be found, returns null. - */ - parseLog(log: { topics: ReadonlyArray, data: string}): null | LogDescription { - const fragment = this.getEvent(log.topics[0]); - - if (!fragment || fragment.anonymous) { return null; } - - // @TODO: If anonymous, and the only method, and the input count matches, should we parse? - // Probably not, because just because it is the only event in the ABI does - // not mean we have the full ABI; maybe just a fragment? - - - return new LogDescription(fragment, fragment.topicHash, this.decodeEventLog(fragment, log.data, log.topics)); - } - - /** - * Parses a revert data, finding the matching error and extracts - * the parameter values along with other useful error details. - * - * If the matching error cannot be found, returns null. - */ - parseError(data: BytesLike): null | ErrorDescription { - const hexData = hexlify(data); - - const fragment = this.getError(dataSlice(hexData, 0, 4)); - - if (!fragment) { return null; } - - const args = this.#abiCoder.decode(fragment.inputs, dataSlice(hexData, 4)); - return new ErrorDescription(fragment, fragment.selector, args); - } - - /** - * Creates a new [[Interface]] from the ABI %%value%%. - * - * The %%value%% may be provided as an existing [[Interface]] object, - * a JSON-encoded ABI or any Human-Readable ABI format. - */ - static from(value: InterfaceAbi | Interface): Interface { - // Already an Interface, which is immutable - if (value instanceof Interface) { return value; } - - // JSON - if (typeof(value) === "string") { return new Interface(JSON.parse(value)); } - - // An Interface; possibly from another v6 instance - if (typeof((value).formatJson) === "function") { - return new Interface((value).formatJson()); - } - - // A legacy Interface; from an older version - if (typeof((value).format) === "function") { - return new Interface((value).format("json")); - } - - // Array of fragments - return new Interface(value); - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/abi/typed.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/abi/typed.ts deleted file mode 100644 index 346b2d57..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/abi/typed.ts +++ /dev/null @@ -1,796 +0,0 @@ -/** - * A Typed object allows a value to have its type explicitly - * specified. - * - * For example, in Solidity, the value ``45`` could represent a - * ``uint8`` or a ``uint256``. The value ``0x1234`` could represent - * a ``bytes2`` or ``bytes``. - * - * Since JavaScript has no meaningful way to explicitly inform any - * APIs which what the type is, this allows transparent interoperation - * with Soldity. - * - * @_subsection: api/abi:Typed Values - */ - -import { assertPrivate, defineProperties } from "../utils/index.js"; - -import type { Addressable } from "../address/index.js"; -import type { BigNumberish, BytesLike } from "../utils/index.js"; - -import type { Result } from "./coders/abstract-coder.js"; - -const _gaurd = { }; - -function n(value: BigNumberish, width: number): Typed { - let signed = false; - if (width < 0) { - signed = true; - width *= -1; - } - - // @TODO: Check range is valid for value - return new Typed(_gaurd, `${ signed ? "": "u" }int${ width }`, value, { signed, width }); -} - -function b(value: BytesLike, size?: number): Typed { - // @TODO: Check range is valid for value - return new Typed(_gaurd, `bytes${ (size) ? size: "" }`, value, { size }); -} - -// @TODO: Remove this in v7, it was replaced by TypedBigInt -/** - * @_ignore: - */ -export interface TypedNumber extends Typed { - value: number; - defaultValue(): number; - minValue(): number; - maxValue(): number; -} - -/** - * A **Typed** that represents a numeric value. - */ -export interface TypedBigInt extends Typed { - /** - * The value. - */ - value: bigint; - - /** - * The default value for all numeric types is ``0``. - */ - defaultValue(): bigint; - - /** - * The minimum value for this type, accounting for bit-width and signed-ness. - */ - minValue(): bigint; - - /** - * The minimum value for this type, accounting for bit-width. - */ - maxValue(): bigint; -} - -/** - * A **Typed** that represents a binary sequence of data as bytes. - */ -export interface TypedData extends Typed { - /** - * The value. - */ - value: string; - - /** - * The default value for this type. - */ - defaultValue(): string; -} - -/** - * A **Typed** that represents a UTF-8 sequence of bytes. - */ -export interface TypedString extends Typed { - /** - * The value. - */ - value: string; - - /** - * The default value for the string type is the empty string (i.e. ``""``). - */ - defaultValue(): string; -} - -const _typedSymbol = Symbol.for("_ethers_typed"); - -/** - * The **Typed** class to wrap values providing explicit type information. - */ -export class Typed { - - /** - * The type, as a Solidity-compatible type. - */ - readonly type!: string; - - /** - * The actual value. - */ - readonly value!: any; - - readonly #options: any; - - /** - * @_ignore: - */ - readonly _typedSymbol!: Symbol; - - /** - * @_ignore: - */ - constructor(gaurd: any, type: string, value: any, options?: any) { - if (options == null) { options = null; } - assertPrivate(_gaurd, gaurd, "Typed"); - defineProperties(this, { _typedSymbol, type, value }); - this.#options = options; - - // Check the value is valid - this.format(); - } - - /** - * Format the type as a Human-Readable type. - */ - format(): string { - if (this.type === "array") { - throw new Error(""); - } else if (this.type === "dynamicArray") { - throw new Error(""); - } else if (this.type === "tuple") { - return `tuple(${ this.value.map((v: Typed) => v.format()).join(",") })` - } - - return this.type; - } - - /** - * The default value returned by this type. - */ - defaultValue(): string | number | bigint | Result { - return 0; - } - - /** - * The minimum value for numeric types. - */ - minValue(): string | number | bigint { - return 0; - } - - /** - * The maximum value for numeric types. - */ - maxValue(): string | number | bigint { - return 0; - } - - /** - * Returns ``true`` and provides a type guard is this is a [[TypedBigInt]]. - */ - isBigInt(): this is TypedBigInt { - return !!(this.type.match(/^u?int[0-9]+$/)); - } - - /** - * Returns ``true`` and provides a type guard is this is a [[TypedData]]. - */ - isData(): this is TypedData { - return this.type.startsWith("bytes"); - } - - /** - * Returns ``true`` and provides a type guard is this is a [[TypedString]]. - */ - isString(): this is TypedString { - return (this.type === "string"); - } - - /** - * Returns the tuple name, if this is a tuple. Throws otherwise. - */ - get tupleName(): null | string { - if (this.type !== "tuple") { throw TypeError("not a tuple"); } - return this.#options; - } - - // Returns the length of this type as an array - // - `null` indicates the length is unforced, it could be dynamic - // - `-1` indicates the length is dynamic - // - any other value indicates it is a static array and is its length - - /** - * Returns the length of the array type or ``-1`` if it is dynamic. - * - * Throws if the type is not an array. - */ - get arrayLength(): null | number { - if (this.type !== "array") { throw TypeError("not an array"); } - if (this.#options === true) { return -1; } - if (this.#options === false) { return (>(this.value)).length; } - return null; - } - - /** - * Returns a new **Typed** of %%type%% with the %%value%%. - */ - static from(type: string, value: any): Typed { - return new Typed(_gaurd, type, value); - } - - /** - * Return a new ``uint8`` type for %%v%%. - */ - static uint8(v: BigNumberish): Typed { return n(v, 8); } - - /** - * Return a new ``uint16`` type for %%v%%. - */ - static uint16(v: BigNumberish): Typed { return n(v, 16); } - - /** - * Return a new ``uint24`` type for %%v%%. - */ - static uint24(v: BigNumberish): Typed { return n(v, 24); } - - /** - * Return a new ``uint32`` type for %%v%%. - */ - static uint32(v: BigNumberish): Typed { return n(v, 32); } - - /** - * Return a new ``uint40`` type for %%v%%. - */ - static uint40(v: BigNumberish): Typed { return n(v, 40); } - - /** - * Return a new ``uint48`` type for %%v%%. - */ - static uint48(v: BigNumberish): Typed { return n(v, 48); } - - /** - * Return a new ``uint56`` type for %%v%%. - */ - static uint56(v: BigNumberish): Typed { return n(v, 56); } - - /** - * Return a new ``uint64`` type for %%v%%. - */ - static uint64(v: BigNumberish): Typed { return n(v, 64); } - - /** - * Return a new ``uint72`` type for %%v%%. - */ - static uint72(v: BigNumberish): Typed { return n(v, 72); } - - /** - * Return a new ``uint80`` type for %%v%%. - */ - static uint80(v: BigNumberish): Typed { return n(v, 80); } - - /** - * Return a new ``uint88`` type for %%v%%. - */ - static uint88(v: BigNumberish): Typed { return n(v, 88); } - - /** - * Return a new ``uint96`` type for %%v%%. - */ - static uint96(v: BigNumberish): Typed { return n(v, 96); } - - /** - * Return a new ``uint104`` type for %%v%%. - */ - static uint104(v: BigNumberish): Typed { return n(v, 104); } - - /** - * Return a new ``uint112`` type for %%v%%. - */ - static uint112(v: BigNumberish): Typed { return n(v, 112); } - - /** - * Return a new ``uint120`` type for %%v%%. - */ - static uint120(v: BigNumberish): Typed { return n(v, 120); } - - /** - * Return a new ``uint128`` type for %%v%%. - */ - static uint128(v: BigNumberish): Typed { return n(v, 128); } - - /** - * Return a new ``uint136`` type for %%v%%. - */ - static uint136(v: BigNumberish): Typed { return n(v, 136); } - - /** - * Return a new ``uint144`` type for %%v%%. - */ - static uint144(v: BigNumberish): Typed { return n(v, 144); } - - /** - * Return a new ``uint152`` type for %%v%%. - */ - static uint152(v: BigNumberish): Typed { return n(v, 152); } - - /** - * Return a new ``uint160`` type for %%v%%. - */ - static uint160(v: BigNumberish): Typed { return n(v, 160); } - - /** - * Return a new ``uint168`` type for %%v%%. - */ - static uint168(v: BigNumberish): Typed { return n(v, 168); } - - /** - * Return a new ``uint176`` type for %%v%%. - */ - static uint176(v: BigNumberish): Typed { return n(v, 176); } - - /** - * Return a new ``uint184`` type for %%v%%. - */ - static uint184(v: BigNumberish): Typed { return n(v, 184); } - - /** - * Return a new ``uint192`` type for %%v%%. - */ - static uint192(v: BigNumberish): Typed { return n(v, 192); } - - /** - * Return a new ``uint200`` type for %%v%%. - */ - static uint200(v: BigNumberish): Typed { return n(v, 200); } - - /** - * Return a new ``uint208`` type for %%v%%. - */ - static uint208(v: BigNumberish): Typed { return n(v, 208); } - - /** - * Return a new ``uint216`` type for %%v%%. - */ - static uint216(v: BigNumberish): Typed { return n(v, 216); } - - /** - * Return a new ``uint224`` type for %%v%%. - */ - static uint224(v: BigNumberish): Typed { return n(v, 224); } - - /** - * Return a new ``uint232`` type for %%v%%. - */ - static uint232(v: BigNumberish): Typed { return n(v, 232); } - - /** - * Return a new ``uint240`` type for %%v%%. - */ - static uint240(v: BigNumberish): Typed { return n(v, 240); } - - /** - * Return a new ``uint248`` type for %%v%%. - */ - static uint248(v: BigNumberish): Typed { return n(v, 248); } - - /** - * Return a new ``uint256`` type for %%v%%. - */ - static uint256(v: BigNumberish): Typed { return n(v, 256); } - - /** - * Return a new ``uint256`` type for %%v%%. - */ - static uint(v: BigNumberish): Typed { return n(v, 256); } - - /** - * Return a new ``int8`` type for %%v%%. - */ - static int8(v: BigNumberish): Typed { return n(v, -8); } - - /** - * Return a new ``int16`` type for %%v%%. - */ - static int16(v: BigNumberish): Typed { return n(v, -16); } - - /** - * Return a new ``int24`` type for %%v%%. - */ - static int24(v: BigNumberish): Typed { return n(v, -24); } - - /** - * Return a new ``int32`` type for %%v%%. - */ - static int32(v: BigNumberish): Typed { return n(v, -32); } - - /** - * Return a new ``int40`` type for %%v%%. - */ - static int40(v: BigNumberish): Typed { return n(v, -40); } - - /** - * Return a new ``int48`` type for %%v%%. - */ - static int48(v: BigNumberish): Typed { return n(v, -48); } - - /** - * Return a new ``int56`` type for %%v%%. - */ - static int56(v: BigNumberish): Typed { return n(v, -56); } - - /** - * Return a new ``int64`` type for %%v%%. - */ - static int64(v: BigNumberish): Typed { return n(v, -64); } - - /** - * Return a new ``int72`` type for %%v%%. - */ - static int72(v: BigNumberish): Typed { return n(v, -72); } - - /** - * Return a new ``int80`` type for %%v%%. - */ - static int80(v: BigNumberish): Typed { return n(v, -80); } - - /** - * Return a new ``int88`` type for %%v%%. - */ - static int88(v: BigNumberish): Typed { return n(v, -88); } - - /** - * Return a new ``int96`` type for %%v%%. - */ - static int96(v: BigNumberish): Typed { return n(v, -96); } - - /** - * Return a new ``int104`` type for %%v%%. - */ - static int104(v: BigNumberish): Typed { return n(v, -104); } - - /** - * Return a new ``int112`` type for %%v%%. - */ - static int112(v: BigNumberish): Typed { return n(v, -112); } - - /** - * Return a new ``int120`` type for %%v%%. - */ - static int120(v: BigNumberish): Typed { return n(v, -120); } - - /** - * Return a new ``int128`` type for %%v%%. - */ - static int128(v: BigNumberish): Typed { return n(v, -128); } - - /** - * Return a new ``int136`` type for %%v%%. - */ - static int136(v: BigNumberish): Typed { return n(v, -136); } - - /** - * Return a new ``int144`` type for %%v%%. - */ - static int144(v: BigNumberish): Typed { return n(v, -144); } - - /** - * Return a new ``int52`` type for %%v%%. - */ - static int152(v: BigNumberish): Typed { return n(v, -152); } - - /** - * Return a new ``int160`` type for %%v%%. - */ - static int160(v: BigNumberish): Typed { return n(v, -160); } - - /** - * Return a new ``int168`` type for %%v%%. - */ - static int168(v: BigNumberish): Typed { return n(v, -168); } - - /** - * Return a new ``int176`` type for %%v%%. - */ - static int176(v: BigNumberish): Typed { return n(v, -176); } - - /** - * Return a new ``int184`` type for %%v%%. - */ - static int184(v: BigNumberish): Typed { return n(v, -184); } - - /** - * Return a new ``int92`` type for %%v%%. - */ - static int192(v: BigNumberish): Typed { return n(v, -192); } - - /** - * Return a new ``int200`` type for %%v%%. - */ - static int200(v: BigNumberish): Typed { return n(v, -200); } - - /** - * Return a new ``int208`` type for %%v%%. - */ - static int208(v: BigNumberish): Typed { return n(v, -208); } - - /** - * Return a new ``int216`` type for %%v%%. - */ - static int216(v: BigNumberish): Typed { return n(v, -216); } - - /** - * Return a new ``int224`` type for %%v%%. - */ - static int224(v: BigNumberish): Typed { return n(v, -224); } - - /** - * Return a new ``int232`` type for %%v%%. - */ - static int232(v: BigNumberish): Typed { return n(v, -232); } - - /** - * Return a new ``int240`` type for %%v%%. - */ - static int240(v: BigNumberish): Typed { return n(v, -240); } - - /** - * Return a new ``int248`` type for %%v%%. - */ - static int248(v: BigNumberish): Typed { return n(v, -248); } - - /** - * Return a new ``int256`` type for %%v%%. - */ - static int256(v: BigNumberish): Typed { return n(v, -256); } - - /** - * Return a new ``int256`` type for %%v%%. - */ - static int(v: BigNumberish): Typed { return n(v, -256); } - - /** - * Return a new ``bytes1`` type for %%v%%. - */ - static bytes1(v: BytesLike): Typed { return b(v, 1); } - - /** - * Return a new ``bytes2`` type for %%v%%. - */ - static bytes2(v: BytesLike): Typed { return b(v, 2); } - - /** - * Return a new ``bytes3`` type for %%v%%. - */ - static bytes3(v: BytesLike): Typed { return b(v, 3); } - - /** - * Return a new ``bytes4`` type for %%v%%. - */ - static bytes4(v: BytesLike): Typed { return b(v, 4); } - - /** - * Return a new ``bytes5`` type for %%v%%. - */ - static bytes5(v: BytesLike): Typed { return b(v, 5); } - - /** - * Return a new ``bytes6`` type for %%v%%. - */ - static bytes6(v: BytesLike): Typed { return b(v, 6); } - - /** - * Return a new ``bytes7`` type for %%v%%. - */ - static bytes7(v: BytesLike): Typed { return b(v, 7); } - - /** - * Return a new ``bytes8`` type for %%v%%. - */ - static bytes8(v: BytesLike): Typed { return b(v, 8); } - - /** - * Return a new ``bytes9`` type for %%v%%. - */ - static bytes9(v: BytesLike): Typed { return b(v, 9); } - - /** - * Return a new ``bytes10`` type for %%v%%. - */ - static bytes10(v: BytesLike): Typed { return b(v, 10); } - - /** - * Return a new ``bytes11`` type for %%v%%. - */ - static bytes11(v: BytesLike): Typed { return b(v, 11); } - - /** - * Return a new ``bytes12`` type for %%v%%. - */ - static bytes12(v: BytesLike): Typed { return b(v, 12); } - - /** - * Return a new ``bytes13`` type for %%v%%. - */ - static bytes13(v: BytesLike): Typed { return b(v, 13); } - - /** - * Return a new ``bytes14`` type for %%v%%. - */ - static bytes14(v: BytesLike): Typed { return b(v, 14); } - - /** - * Return a new ``bytes15`` type for %%v%%. - */ - static bytes15(v: BytesLike): Typed { return b(v, 15); } - - /** - * Return a new ``bytes16`` type for %%v%%. - */ - static bytes16(v: BytesLike): Typed { return b(v, 16); } - - /** - * Return a new ``bytes17`` type for %%v%%. - */ - static bytes17(v: BytesLike): Typed { return b(v, 17); } - - /** - * Return a new ``bytes18`` type for %%v%%. - */ - static bytes18(v: BytesLike): Typed { return b(v, 18); } - - /** - * Return a new ``bytes19`` type for %%v%%. - */ - static bytes19(v: BytesLike): Typed { return b(v, 19); } - - /** - * Return a new ``bytes20`` type for %%v%%. - */ - static bytes20(v: BytesLike): Typed { return b(v, 20); } - - /** - * Return a new ``bytes21`` type for %%v%%. - */ - static bytes21(v: BytesLike): Typed { return b(v, 21); } - - /** - * Return a new ``bytes22`` type for %%v%%. - */ - static bytes22(v: BytesLike): Typed { return b(v, 22); } - - /** - * Return a new ``bytes23`` type for %%v%%. - */ - static bytes23(v: BytesLike): Typed { return b(v, 23); } - - /** - * Return a new ``bytes24`` type for %%v%%. - */ - static bytes24(v: BytesLike): Typed { return b(v, 24); } - - /** - * Return a new ``bytes25`` type for %%v%%. - */ - static bytes25(v: BytesLike): Typed { return b(v, 25); } - - /** - * Return a new ``bytes26`` type for %%v%%. - */ - static bytes26(v: BytesLike): Typed { return b(v, 26); } - - /** - * Return a new ``bytes27`` type for %%v%%. - */ - static bytes27(v: BytesLike): Typed { return b(v, 27); } - - /** - * Return a new ``bytes28`` type for %%v%%. - */ - static bytes28(v: BytesLike): Typed { return b(v, 28); } - - /** - * Return a new ``bytes29`` type for %%v%%. - */ - static bytes29(v: BytesLike): Typed { return b(v, 29); } - - /** - * Return a new ``bytes30`` type for %%v%%. - */ - static bytes30(v: BytesLike): Typed { return b(v, 30); } - - /** - * Return a new ``bytes31`` type for %%v%%. - */ - static bytes31(v: BytesLike): Typed { return b(v, 31); } - - /** - * Return a new ``bytes32`` type for %%v%%. - */ - static bytes32(v: BytesLike): Typed { return b(v, 32); } - - - /** - * Return a new ``address`` type for %%v%%. - */ - static address(v: string | Addressable): Typed { return new Typed(_gaurd, "address", v); } - - /** - * Return a new ``bool`` type for %%v%%. - */ - static bool(v: any): Typed { return new Typed(_gaurd, "bool", !!v); } - - /** - * Return a new ``bytes`` type for %%v%%. - */ - static bytes(v: BytesLike): Typed { return new Typed(_gaurd, "bytes", v); } - - /** - * Return a new ``string`` type for %%v%%. - */ - static string(v: string): Typed { return new Typed(_gaurd, "string", v); } - - - /** - * Return a new ``array`` type for %%v%%, allowing %%dynamic%% length. - */ - static array(v: Array, dynamic?: null | boolean): Typed { - throw new Error("not implemented yet"); - return new Typed(_gaurd, "array", v, dynamic); - } - - - /** - * Return a new ``tuple`` type for %%v%%, with the optional %%name%%. - */ - static tuple(v: Array | Record, name?: string): Typed { - throw new Error("not implemented yet"); - return new Typed(_gaurd, "tuple", v, name); - } - - - /** - * Return a new ``uint8`` type for %%v%%. - */ - static overrides(v: Record): Typed { - return new Typed(_gaurd, "overrides", Object.assign({ }, v)); - } - - /** - * Returns true only if %%value%% is a [[Typed]] instance. - */ - static isTyped(value: any): value is Typed { - return (value - && typeof(value) === "object" - && "_typedSymbol" in value - && value._typedSymbol === _typedSymbol); - } - - /** - * If the value is a [[Typed]] instance, validates the underlying value - * and returns it, otherwise returns value directly. - * - * This is useful for functions that with to accept either a [[Typed]] - * object or values. - */ - static dereference(value: Typed | T, type: string): T { - if (Typed.isTyped(value)) { - if (value.type !== type) { - throw new Error(`invalid type: expecetd ${ type }, got ${ value.type }`); - } - return value.value; - } - return value; - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/address/address.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/address/address.ts deleted file mode 100644 index 9398027b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/address/address.ts +++ /dev/null @@ -1,173 +0,0 @@ -import { keccak256 } from "../crypto/index.js"; -import { getBytes, assertArgument } from "../utils/index.js"; - - -const BN_0 = BigInt(0); -const BN_36 = BigInt(36); - -function getChecksumAddress(address: string): string { -// if (!isHexString(address, 20)) { -// logger.throwArgumentError("invalid address", "address", address); -// } - - address = address.toLowerCase(); - - const chars = address.substring(2).split(""); - - const expanded = new Uint8Array(40); - for (let i = 0; i < 40; i++) { - expanded[i] = chars[i].charCodeAt(0); - } - - const hashed = getBytes(keccak256(expanded)); - - for (let i = 0; i < 40; i += 2) { - if ((hashed[i >> 1] >> 4) >= 8) { - chars[i] = chars[i].toUpperCase(); - } - if ((hashed[i >> 1] & 0x0f) >= 8) { - chars[i + 1] = chars[i + 1].toUpperCase(); - } - } - - return "0x" + chars.join(""); -} - -// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number - -// Create lookup table -const ibanLookup: { [character: string]: string } = { }; -for (let i = 0; i < 10; i++) { ibanLookup[String(i)] = String(i); } -for (let i = 0; i < 26; i++) { ibanLookup[String.fromCharCode(65 + i)] = String(10 + i); } - -// How many decimal digits can we process? (for 64-bit float, this is 15) -// i.e. Math.floor(Math.log10(Number.MAX_SAFE_INTEGER)); -const safeDigits = 15; - -function ibanChecksum(address: string): string { - address = address.toUpperCase(); - address = address.substring(4) + address.substring(0, 2) + "00"; - - let expanded = address.split("").map((c) => { return ibanLookup[c]; }).join(""); - - // Javascript can handle integers safely up to 15 (decimal) digits - while (expanded.length >= safeDigits){ - let block = expanded.substring(0, safeDigits); - expanded = parseInt(block, 10) % 97 + expanded.substring(block.length); - } - - let checksum = String(98 - (parseInt(expanded, 10) % 97)); - while (checksum.length < 2) { checksum = "0" + checksum; } - - return checksum; -}; - -const Base36 = (function() {; - const result: Record = { }; - for (let i = 0; i < 36; i++) { - const key = "0123456789abcdefghijklmnopqrstuvwxyz"[i]; - result[key] = BigInt(i); - } - return result; -})(); - -function fromBase36(value: string): bigint { - value = value.toLowerCase(); - - let result = BN_0; - for (let i = 0; i < value.length; i++) { - result = result * BN_36 + Base36[value[i]]; - } - return result; -} - -/** - * Returns a normalized and checksumed address for %%address%%. - * This accepts non-checksum addresses, checksum addresses and - * [[getIcapAddress]] formats. - * - * The checksum in Ethereum uses the capitalization (upper-case - * vs lower-case) of the characters within an address to encode - * its checksum, which offers, on average, a checksum of 15-bits. - * - * If %%address%% contains both upper-case and lower-case, it is - * assumed to already be a checksum address and its checksum is - * validated, and if the address fails its expected checksum an - * error is thrown. - * - * If you wish the checksum of %%address%% to be ignore, it should - * be converted to lower-case (i.e. ``.toLowercase()``) before - * being passed in. This should be a very rare situation though, - * that you wish to bypass the safegaurds in place to protect - * against an address that has been incorrectly copied from another - * source. - * - * @example: - * // Adds the checksum (via upper-casing specific letters) - * getAddress("0x8ba1f109551bd432803012645ac136ddd64dba72") - * //_result: - * - * // Converts ICAP address and adds checksum - * getAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36"); - * //_result: - * - * // Throws an error if an address contains mixed case, - * // but the checksum fails - * getAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72") - * //_error: - */ -export function getAddress(address: string): string { - - assertArgument(typeof(address) === "string", "invalid address", "address", address); - - if (address.match(/^(0x)?[0-9a-fA-F]{40}$/)) { - - // Missing the 0x prefix - if (!address.startsWith("0x")) { address = "0x" + address; } - - const result = getChecksumAddress(address); - - // It is a checksummed address with a bad checksum - assertArgument(!address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) || result === address, - "bad address checksum", "address", address); - - return result; - } - - // Maybe ICAP? (we only support direct mode) - if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) { - // It is an ICAP address with a bad checksum - assertArgument(address.substring(2, 4) === ibanChecksum(address), "bad icap checksum", "address", address); - - let result = fromBase36(address.substring(4)).toString(16); - while (result.length < 40) { result = "0" + result; } - return getChecksumAddress("0x" + result); - } - - assertArgument(false, "invalid address", "address", address); -} - -/** - * The [ICAP Address format](link-icap) format is an early checksum - * format which attempts to be compatible with the banking - * industry [IBAN format](link-wiki-iban) for bank accounts. - * - * It is no longer common or a recommended format. - * - * @example: - * getIcapAddress("0x8ba1f109551bd432803012645ac136ddd64dba72"); - * //_result: - * - * getIcapAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36"); - * //_result: - * - * // Throws an error if the ICAP checksum is wrong - * getIcapAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK37"); - * //_error: - */ -export function getIcapAddress(address: string): string { - //let base36 = _base16To36(getAddress(address).substring(2)).toUpperCase(); - let base36 = BigInt(getAddress(address)).toString(36).toUpperCase(); - while (base36.length < 30) { base36 = "0" + base36; } - return "XE" + ibanChecksum("XE00" + base36) + base36; -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/address/checks.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/address/checks.ts deleted file mode 100644 index 9bac6b8a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/address/checks.ts +++ /dev/null @@ -1,123 +0,0 @@ -import { assert, assertArgument } from "../utils/index.js"; - -import { getAddress } from "./address.js"; - -import type { Addressable, AddressLike, NameResolver } from "./index.js"; - - -/** - * Returns true if %%value%% is an object which implements the - * [[Addressable]] interface. - * - * @example: - * // Wallets and AbstractSigner sub-classes - * isAddressable(Wallet.createRandom()) - * //_result: - * - * // Contracts - * contract = new Contract("dai.tokens.ethers.eth", [ ], provider) - * isAddressable(contract) - * //_result: - */ -export function isAddressable(value: any): value is Addressable { - return (value && typeof(value.getAddress) === "function"); -} - -/** - * Returns true if %%value%% is a valid address. - * - * @example: - * // Valid address - * isAddress("0x8ba1f109551bD432803012645Ac136ddd64DBA72") - * //_result: - * - * // Valid ICAP address - * isAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36") - * //_result: - * - * // Invalid checksum - * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBa72") - * //_result: - * - * // Invalid ICAP checksum - * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72") - * //_result: - * - * // Not an address (an ENS name requires a provided and an - * // asynchronous API to access) - * isAddress("ricmoo.eth") - * //_result: - */ -export function isAddress(value: any): value is string { - try { - getAddress(value); - return true; - } catch (error) { } - return false; -} - -async function checkAddress(target: any, promise: Promise): Promise { - const result = await promise; - if (result == null || result === "0x0000000000000000000000000000000000000000") { - assert(typeof(target) !== "string", "unconfigured name", "UNCONFIGURED_NAME", { value: target }); - assertArgument(false, "invalid AddressLike value; did not resolve to a value address", "target", target); - } - return getAddress(result); -} - -/** - * Resolves to an address for the %%target%%, which may be any - * supported address type, an [[Addressable]] or a Promise which - * resolves to an address. - * - * If an ENS name is provided, but that name has not been correctly - * configured a [[UnconfiguredNameError]] is thrown. - * - * @example: - * addr = "0x6B175474E89094C44Da98b954EedeAC495271d0F" - * - * // Addresses are return synchronously - * resolveAddress(addr, provider) - * //_result: - * - * // Address promises are resolved asynchronously - * resolveAddress(Promise.resolve(addr)) - * //_result: - * - * // ENS names are resolved asynchronously - * resolveAddress("dai.tokens.ethers.eth", provider) - * //_result: - * - * // Addressable objects are resolved asynchronously - * contract = new Contract(addr, [ ]) - * resolveAddress(contract, provider) - * //_result: - * - * // Unconfigured ENS names reject - * resolveAddress("nothing-here.ricmoo.eth", provider) - * //_error: - * - * // ENS names require a NameResolver object passed in - * // (notice the provider was omitted) - * resolveAddress("nothing-here.ricmoo.eth") - * //_error: - */ -export function resolveAddress(target: AddressLike, resolver?: null | NameResolver): string | Promise { - - if (typeof(target) === "string") { - if (target.match(/^0x[0-9a-f]{40}$/i)) { return getAddress(target); } - - assert(resolver != null, "ENS resolution requires a provider", - "UNSUPPORTED_OPERATION", { operation: "resolveName" }); - - return checkAddress(target, resolver.resolveName(target)); - - } else if (isAddressable(target)) { - return checkAddress(target, target.getAddress()); - - } else if (target && typeof(target.then) === "function") { - return checkAddress(target, target); - } - - assertArgument(false, "unsupported addressable value", "target", target); -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/address/contract-address.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/address/contract-address.ts deleted file mode 100644 index 6d8aebe2..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/address/contract-address.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { keccak256 } from "../crypto/index.js"; -import { - concat, dataSlice, getBigInt, getBytes, encodeRlp, assertArgument -} from "../utils/index.js"; - -import { getAddress } from "./address.js"; - -import type { BigNumberish, BytesLike } from "../utils/index.js"; - - -// http://ethereum.stackexchange.com/questions/760/how-is-the-address-of-an-ethereum-contract-computed - -/** - * Returns the address that would result from a ``CREATE`` for %%tx%%. - * - * This can be used to compute the address a contract will be - * deployed to by an EOA when sending a deployment transaction (i.e. - * when the ``to`` address is ``null``). - * - * This can also be used to compute the address a contract will be - * deployed to by a contract, by using the contract's address as the - * ``to`` and the contract's nonce. - * - * @example - * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72"; - * nonce = 5; - * - * getCreateAddress({ from, nonce }); - * //_result: - */ -export function getCreateAddress(tx: { from: string, nonce: BigNumberish }): string { - const from = getAddress(tx.from); - const nonce = getBigInt(tx.nonce, "tx.nonce"); - - let nonceHex = nonce.toString(16); - if (nonceHex === "0") { - nonceHex = "0x"; - } else if (nonceHex.length % 2) { - nonceHex = "0x0" + nonceHex; - } else { - nonceHex = "0x" + nonceHex; - } - - return getAddress(dataSlice(keccak256(encodeRlp([ from, nonceHex ])), 12)); -} - -/** - * Returns the address that would result from a ``CREATE2`` operation - * with the given %%from%%, %%salt%% and %%initCodeHash%%. - * - * To compute the %%initCodeHash%% from a contract's init code, use - * the [[keccak256]] function. - * - * For a quick overview and example of ``CREATE2``, see [[link-ricmoo-wisps]]. - * - * @example - * // The address of the contract - * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72" - * - * // The salt - * salt = id("HelloWorld") - * - * // The hash of the initCode - * initCode = "0x6394198df16000526103ff60206004601c335afa6040516060f3"; - * initCodeHash = keccak256(initCode) - * - * getCreate2Address(from, salt, initCodeHash) - * //_result: - */ -export function getCreate2Address(_from: string, _salt: BytesLike, _initCodeHash: BytesLike): string { - const from = getAddress(_from); - const salt = getBytes(_salt, "salt"); - const initCodeHash = getBytes(_initCodeHash, "initCodeHash"); - - assertArgument(salt.length === 32, "salt must be 32 bytes", "salt", _salt); - - assertArgument(initCodeHash.length === 32, "initCodeHash must be 32 bytes", "initCodeHash", _initCodeHash); - - return getAddress(dataSlice(keccak256(concat([ "0xff", from, salt, initCodeHash ])), 12)) -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/address/index.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/address/index.ts deleted file mode 100644 index 4feb02b7..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/address/index.ts +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Addresses are a fundamental part of interacting with Ethereum. They - * represent the global identity of Externally Owned Accounts (accounts - * backed by a private key) and contracts. - * - * The Ethereum Naming Service (ENS) provides an interconnected ecosystem - * of contracts, standards and libraries which enable looking up an - * address for an ENS name. - * - * These functions help convert between various formats, validate - * addresses and safely resolve ENS names. - * - * @_section: api/address:Addresses [about-addresses] - */ - -null; - -/** - * An interface for objects which have an address, and can - * resolve it asyncronously. - * - * This allows objects such as [[Signer]] or [[Contract]] to - * be used most places an address can be, for example getting - * the [balance](Provider-getBalance). - */ -export interface Addressable { - /** - * Get the object address. - */ - getAddress(): Promise; -} - -/** - * Anything that can be used to return or resolve an address. - */ -export type AddressLike = string | Promise | Addressable; - -/** - * An interface for any object which can resolve an ENS name. - */ -export interface NameResolver { - /** - * Resolve to the address for the ENS %%name%%. - * - * Resolves to ``null`` if the name is unconfigued. Use - * [[resolveAddress]] (passing this object as %%resolver%%) to - * throw for names that are unconfigured. - */ - resolveName(name: string): Promise; -} - -export { getAddress, getIcapAddress } from "./address.js"; - -export { getCreateAddress, getCreate2Address } from "./contract-address.js"; - - -export { isAddressable, isAddress, resolveAddress } from "./checks.js"; diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/constants/addresses.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/constants/addresses.ts deleted file mode 100644 index 60aa9b25..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/constants/addresses.ts +++ /dev/null @@ -1,8 +0,0 @@ - -/** - * A constant for the zero address. - * - * (**i.e.** ``"0x0000000000000000000000000000000000000000"``) - */ -export const ZeroAddress: string = "0x0000000000000000000000000000000000000000"; - diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/constants/hashes.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/constants/hashes.ts deleted file mode 100644 index 92c39c3f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/constants/hashes.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * A constant for the zero hash. - * - * (**i.e.** ``"0x0000000000000000000000000000000000000000000000000000000000000000"``) - */ -export const ZeroHash: string = "0x0000000000000000000000000000000000000000000000000000000000000000"; - diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/constants/index.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/constants/index.ts deleted file mode 100644 index be2e67ec..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/constants/index.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Some common constants useful for Ethereum. - * - * @_section: api/constants: Constants [about-constants] - */ - -export { ZeroAddress } from "./addresses.js"; -export { ZeroHash } from "./hashes.js"; -export { - N, - WeiPerEther, - MaxUint256, - MinInt256, - MaxInt256 -} from "./numbers.js"; -export { EtherSymbol, MessagePrefix } from "./strings.js"; diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/constants/numbers.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/constants/numbers.ts deleted file mode 100644 index e94b6960..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/constants/numbers.ts +++ /dev/null @@ -1,35 +0,0 @@ - -/** - * A constant for the order N for the secp256k1 curve. - * - * (**i.e.** ``0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n``) - */ -export const N: bigint = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); - -/** - * A constant for the number of wei in a single ether. - * - * (**i.e.** ``1000000000000000000n``) - */ -export const WeiPerEther: bigint = BigInt("1000000000000000000"); - -/** - * A constant for the maximum value for a ``uint256``. - * - * (**i.e.** ``0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) - */ -export const MaxUint256: bigint = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); - -/** - * A constant for the minimum value for an ``int256``. - * - * (**i.e.** ``-8000000000000000000000000000000000000000000000000000000000000000n``) - */ -export const MinInt256: bigint = BigInt("0x8000000000000000000000000000000000000000000000000000000000000000") * BigInt(-1); - -/** - * A constant for the maximum value for an ``int256``. - * - * (**i.e.** ``0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) - */ -export const MaxInt256: bigint = BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/constants/strings.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/constants/strings.ts deleted file mode 100644 index 3439ca7b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/constants/strings.ts +++ /dev/null @@ -1,16 +0,0 @@ -// NFKC (composed) // (decomposed) - -/** - * A constant for the ether symbol (normalized using NFKC). - * - * (**i.e.** ``"\\u039e"``) - */ -export const EtherSymbol: string = "\u039e"; // "\uD835\uDF63"; - - -/** - * A constant for the [[link-eip-191]] personal message prefix. - * - * (**i.e.** ``"\\x19Ethereum Signed Message:\\n"``) - */ -export const MessagePrefix: string = "\x19Ethereum Signed Message:\n"; diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/contract/contract.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/contract/contract.ts deleted file mode 100644 index 34653299..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/contract/contract.ts +++ /dev/null @@ -1,1120 +0,0 @@ -import { Interface, Typed } from "../abi/index.js"; -import { isAddressable, resolveAddress } from "../address/index.js"; -// import from provider.ts instead of index.ts to prevent circular dep -// from EtherscanProvider -import { copyRequest, Log, TransactionResponse } from "../providers/provider.js"; -import { - defineProperties, getBigInt, isCallException, isHexString, resolveProperties, - isError, makeError, assert, assertArgument -} from "../utils/index.js"; - -import { - ContractEventPayload, ContractUnknownEventPayload, - ContractTransactionResponse, - EventLog, UndecodedEventLog -} from "./wrappers.js"; - -import type { EventFragment, FunctionFragment, InterfaceAbi, ParamType, Result } from "../abi/index.js"; -import type { Addressable, NameResolver } from "../address/index.js"; -import type { EventEmitterable, Listener } from "../utils/index.js"; -import type { - BlockTag, ContractRunner, Provider, TransactionRequest, TopicFilter -} from "../providers/index.js"; - -import type { - BaseContractMethod, - ContractEventName, - ContractInterface, - ContractMethodArgs, - ContractMethod, - ContractEventArgs, - ContractEvent, - ContractTransaction, - DeferredTopicFilter, - WrappedFallback -} from "./types.js"; - -const BN_0 = BigInt(0); - -interface ContractRunnerCaller extends ContractRunner { - call: (tx: TransactionRequest) => Promise; -} - -interface ContractRunnerEstimater extends ContractRunner { - estimateGas: (tx: TransactionRequest) => Promise; -} - -interface ContractRunnerSender extends ContractRunner { - sendTransaction: (tx: TransactionRequest) => Promise; -} - -interface ContractRunnerResolver extends ContractRunner { - resolveName: (name: string | Addressable) => Promise; -} - -function canCall(value: any): value is ContractRunnerCaller { - return (value && typeof(value.call) === "function"); -} - -function canEstimate(value: any): value is ContractRunnerEstimater { - return (value && typeof(value.estimateGas) === "function"); -} - -function canResolve(value: any): value is ContractRunnerResolver { - return (value && typeof(value.resolveName) === "function"); -} - -function canSend(value: any): value is ContractRunnerSender { - return (value && typeof(value.sendTransaction) === "function"); -} - -function getResolver(value: any): undefined | NameResolver { - if (value != null) { - if (canResolve(value)) { return value; } - if (value.provider) { return value.provider; } - } - return undefined; -} - -class PreparedTopicFilter implements DeferredTopicFilter { - #filter: Promise; - readonly fragment!: EventFragment; - - constructor(contract: BaseContract, fragment: EventFragment, args: Array) { - defineProperties(this, { fragment }); - if (fragment.inputs.length < args.length) { - throw new Error("too many arguments"); - } - - // Recursively descend into args and resolve any addresses - const runner = getRunner(contract.runner, "resolveName"); - const resolver = canResolve(runner) ? runner: null; - this.#filter = (async function() { - const resolvedArgs = await Promise.all(fragment.inputs.map((param, index) => { - const arg = args[index]; - if (arg == null) { return null; } - - return param.walkAsync(args[index], (type, value) => { - if (type === "address") { - if (Array.isArray(value)) { - return Promise.all(value.map((v) => resolveAddress(v, resolver))); - } - return resolveAddress(value, resolver); - } - return value; - }); - })); - - return contract.interface.encodeFilterTopics(fragment, resolvedArgs); - })(); - } - - getTopicFilter(): Promise { - return this.#filter; - } -} - - -// A = Arguments passed in as a tuple -// R = The result type of the call (i.e. if only one return type, -// the qualified type, otherwise Result) -// D = The type the default call will return (i.e. R for view/pure, -// TransactionResponse otherwise) -//export interface ContractMethod = Array, R = any, D extends R | ContractTransactionResponse = ContractTransactionResponse> { - -function getRunner(value: any, feature: keyof ContractRunner): null | T { - if (value == null) { return null; } - if (typeof(value[feature]) === "function") { return value; } - if (value.provider && typeof(value.provider[feature]) === "function") { - return value.provider; - } - return null; -} - -function getProvider(value: null | ContractRunner): null | Provider { - if (value == null) { return null; } - return value.provider || null; -} - -/** - * @_ignore: - */ -export async function copyOverrides(arg: any, allowed?: Array): Promise> { - - // Make sure the overrides passed in are a valid overrides object - const _overrides = Typed.dereference(arg, "overrides"); - assertArgument(typeof(_overrides) === "object", "invalid overrides parameter", "overrides", arg); - - // Create a shallow copy (we'll deep-ify anything needed during normalizing) - const overrides = copyRequest(_overrides); - - assertArgument(overrides.to == null || (allowed || [ ]).indexOf("to") >= 0, - "cannot override to", "overrides.to", overrides.to); - assertArgument(overrides.data == null || (allowed || [ ]).indexOf("data") >= 0, - "cannot override data", "overrides.data", overrides.data); - - // Resolve any from - if (overrides.from) { overrides.from = overrides.from; } - - return >overrides; -} - -/** - * @_ignore: - */ -export async function resolveArgs(_runner: null | ContractRunner, inputs: ReadonlyArray, args: Array): Promise> { - // Recursively descend into args and resolve any addresses - const runner = getRunner(_runner, "resolveName"); - const resolver = canResolve(runner) ? runner: null; - return await Promise.all(inputs.map((param, index) => { - return param.walkAsync(args[index], (type, value) => { - value = Typed.dereference(value, type); - if (type === "address") { return resolveAddress(value, resolver); } - return value; - }); - })); -} - -function buildWrappedFallback(contract: BaseContract): WrappedFallback { - - const populateTransaction = async function(overrides?: Omit): Promise { - // If an overrides was passed in, copy it and normalize the values - - const tx: ContractTransaction = (await copyOverrides<"data">(overrides, [ "data" ])); - tx.to = await contract.getAddress(); - - if (tx.from) { - tx.from = await resolveAddress(tx.from, getResolver(contract.runner)); - } - - const iface = contract.interface; - - const noValue = (getBigInt((tx.value || BN_0), "overrides.value") === BN_0); - const noData = ((tx.data || "0x") === "0x"); - - if (iface.fallback && !iface.fallback.payable && iface.receive && !noData && !noValue) { - assertArgument(false, "cannot send data to receive or send value to non-payable fallback", "overrides", overrides); - } - - assertArgument(iface.fallback || noData, - "cannot send data to receive-only contract", "overrides.data", tx.data); - - // Only allow payable contracts to set non-zero value - const payable = iface.receive || (iface.fallback && iface.fallback.payable); - assertArgument(payable || noValue, - "cannot send value to non-payable fallback", "overrides.value", tx.value); - - // Only allow fallback contracts to set non-empty data - assertArgument(iface.fallback || noData, - "cannot send data to receive-only contract", "overrides.data", tx.data); - - return tx; - } - - const staticCall = async function(overrides?: Omit): Promise { - const runner = getRunner(contract.runner, "call"); - assert(canCall(runner), "contract runner does not support calling", - "UNSUPPORTED_OPERATION", { operation: "call" }); - - const tx = await populateTransaction(overrides); - - try { - return await runner.call(tx); - } catch (error: any) { - if (isCallException(error) && error.data) { - throw contract.interface.makeError(error.data, tx); - } - throw error; - } - } - - const send = async function(overrides?: Omit): Promise { - const runner = contract.runner; - assert(canSend(runner), "contract runner does not support sending transactions", - "UNSUPPORTED_OPERATION", { operation: "sendTransaction" }); - - const tx = await runner.sendTransaction(await populateTransaction(overrides)); - const provider = getProvider(contract.runner); - // @TODO: the provider can be null; make a custom dummy provider that will throw a - // meaningful error - return new ContractTransactionResponse(contract.interface, provider, tx); - } - - const estimateGas = async function(overrides?: Omit): Promise { - const runner = getRunner(contract.runner, "estimateGas"); - assert(canEstimate(runner), "contract runner does not support gas estimation", - "UNSUPPORTED_OPERATION", { operation: "estimateGas" }); - - return await runner.estimateGas(await populateTransaction(overrides)); - } - - const method = async (overrides?: Omit) => { - return await send(overrides); - }; - - defineProperties(method, { - _contract: contract, - - estimateGas, - populateTransaction, - send, staticCall - }); - - return method; -} - -function buildWrappedMethod = Array, R = any, D extends R | ContractTransactionResponse = ContractTransactionResponse>(contract: BaseContract, key: string): BaseContractMethod { - - const getFragment = function(...args: ContractMethodArgs): FunctionFragment { - const fragment = contract.interface.getFunction(key, args); - assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", { - operation: "fragment", - info: { key, args } - }); - return fragment; - } - - const populateTransaction = async function(...args: ContractMethodArgs): Promise { - const fragment = getFragment(...args); - - // If an overrides was passed in, copy it and normalize the values - let overrides: Omit = { }; - if (fragment.inputs.length + 1 === args.length) { - overrides = await copyOverrides(args.pop()); - - if (overrides.from) { - overrides.from = await resolveAddress(overrides.from, getResolver(contract.runner)); - } - } - - if (fragment.inputs.length !== args.length) { - throw new Error("internal error: fragment inputs doesn't match arguments; should not happen"); - } - - const resolvedArgs = await resolveArgs(contract.runner, fragment.inputs, args); - - return Object.assign({ }, overrides, await resolveProperties({ - to: contract.getAddress(), - data: contract.interface.encodeFunctionData(fragment, resolvedArgs) - })); - } - - const staticCall = async function(...args: ContractMethodArgs): Promise { - const result = await staticCallResult(...args); - if (result.length === 1) { return result[0]; } - return result; - } - - const send = async function(...args: ContractMethodArgs): Promise { - const runner = contract.runner; - assert(canSend(runner), "contract runner does not support sending transactions", - "UNSUPPORTED_OPERATION", { operation: "sendTransaction" }); - - const tx = await runner.sendTransaction(await populateTransaction(...args)); - const provider = getProvider(contract.runner); - // @TODO: the provider can be null; make a custom dummy provider that will throw a - // meaningful error - return new ContractTransactionResponse(contract.interface, provider, tx); - } - - const estimateGas = async function(...args: ContractMethodArgs): Promise { - const runner = getRunner(contract.runner, "estimateGas"); - assert(canEstimate(runner), "contract runner does not support gas estimation", - "UNSUPPORTED_OPERATION", { operation: "estimateGas" }); - - return await runner.estimateGas(await populateTransaction(...args)); - } - - const staticCallResult = async function(...args: ContractMethodArgs): Promise { - const runner = getRunner(contract.runner, "call"); - assert(canCall(runner), "contract runner does not support calling", - "UNSUPPORTED_OPERATION", { operation: "call" }); - - const tx = await populateTransaction(...args); - - let result = "0x"; - try { - result = await runner.call(tx); - } catch (error: any) { - if (isCallException(error) && error.data) { - throw contract.interface.makeError(error.data, tx); - } - throw error; - } - - const fragment = getFragment(...args); - return contract.interface.decodeFunctionResult(fragment, result); - }; - - const method = async (...args: ContractMethodArgs) => { - const fragment = getFragment(...args); - if (fragment.constant) { return await staticCall(...args); } - return await send(...args); - }; - - defineProperties(method, { - name: contract.interface.getFunctionName(key), - _contract: contract, _key: key, - - getFragment, - - estimateGas, - populateTransaction, - send, staticCall, staticCallResult, - }); - - // Only works on non-ambiguous keys (refined fragment is always non-ambiguous) - Object.defineProperty(method, "fragment", { - configurable: false, - enumerable: true, - get: () => { - const fragment = contract.interface.getFunction(key); - assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", { - operation: "fragment", - info: { key } - }); - return fragment; - } - }); - - return >method; -} - -function buildWrappedEvent = Array>(contract: BaseContract, key: string): ContractEvent { - - const getFragment = function(...args: ContractEventArgs): EventFragment { - const fragment = contract.interface.getEvent(key, args); - - assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", { - operation: "fragment", - info: { key, args } - }); - - return fragment; - } - - const method = function(...args: ContractMethodArgs): PreparedTopicFilter { - return new PreparedTopicFilter(contract, getFragment(...args), args); - }; - - defineProperties(method, { - name: contract.interface.getEventName(key), - _contract: contract, _key: key, - - getFragment - }); - - // Only works on non-ambiguous keys (refined fragment is always non-ambiguous) - Object.defineProperty(method, "fragment", { - configurable: false, - enumerable: true, - get: () => { - const fragment = contract.interface.getEvent(key); - - assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", { - operation: "fragment", - info: { key } - }); - - return fragment; - } - }); - - return >method; -} - -type Sub = { - tag: string; - listeners: Array<{ listener: Listener, once: boolean }>, - start: () => void; - stop: () => void; -}; - - -// The combination of TypeScrype, Private Fields and Proxies makes -// the world go boom; so we hide variables with some trickery keeping -// a symbol attached to each BaseContract which its sub-class (even -// via a Proxy) can reach and use to look up its internal values. - -const internal = Symbol.for("_ethersInternal_contract"); -type Internal = { - addrPromise: Promise; - addr: null | string; - - deployTx: null | ContractTransactionResponse; - - subs: Map; -}; - -const internalValues: WeakMap = new WeakMap(); - -function setInternal(contract: BaseContract, values: Internal): void { - internalValues.set(contract[internal], values); -} - -function getInternal(contract: BaseContract): Internal { - return internalValues.get(contract[internal]) as Internal; -} - -function isDeferred(value: any): value is DeferredTopicFilter { - return (value && typeof(value) === "object" && ("getTopicFilter" in value) && - (typeof(value.getTopicFilter) === "function") && value.fragment); -} - -async function getSubInfo(contract: BaseContract, event: ContractEventName): Promise<{ fragment: null | EventFragment, tag: string, topics: TopicFilter }> { - let topics: Array>; - let fragment: null | EventFragment = null; - - // Convert named events to topicHash and get the fragment for - // events which need deconstructing. - - if (Array.isArray(event)) { - const topicHashify = function(name: string): string { - if (isHexString(name, 32)) { return name; } - const fragment = contract.interface.getEvent(name); - assertArgument(fragment, "unknown fragment", "name", name); - return fragment.topicHash; - } - - // Array of Topics and Names; e.g. `[ "0x1234...89ab", "Transfer(address)" ]` - topics = event.map((e) => { - if (e == null) { return null; } - if (Array.isArray(e)) { return e.map(topicHashify); } - return topicHashify(e); - }); - - } else if (event === "*") { - topics = [ null ]; - - } else if (typeof(event) === "string") { - if (isHexString(event, 32)) { - // Topic Hash - topics = [ event ]; - } else { - // Name or Signature; e.g. `"Transfer", `"Transfer(address)"` - fragment = contract.interface.getEvent(event); - assertArgument(fragment, "unknown fragment", "event", event); - topics = [ fragment.topicHash ]; - } - - } else if (isDeferred(event)) { - // Deferred Topic Filter; e.g. `contract.filter.Transfer(from)` - topics = await event.getTopicFilter(); - - } else if ("fragment" in event) { - // ContractEvent; e.g. `contract.filter.Transfer` - fragment = event.fragment; - topics = [ fragment.topicHash ]; - - } else { - assertArgument(false, "unknown event name", "event", event); - } - - // Normalize topics and sort TopicSets - topics = topics.map((t) => { - if (t == null) { return null; } - if (Array.isArray(t)) { - const items = Array.from(new Set(t.map((t) => t.toLowerCase())).values()); - if (items.length === 1) { return items[0]; } - items.sort(); - return items; - } - return t.toLowerCase(); - }); - - const tag = topics.map((t) => { - if (t == null) { return "null"; } - if (Array.isArray(t)) { return t.join("|"); } - return t; - }).join("&"); - - return { fragment, tag, topics } -} - -async function hasSub(contract: BaseContract, event: ContractEventName): Promise { - const { subs } = getInternal(contract); - return subs.get((await getSubInfo(contract, event)).tag) || null; -} - -async function getSub(contract: BaseContract, operation: string, event: ContractEventName): Promise { - // Make sure our runner can actually subscribe to events - const provider = getProvider(contract.runner); - assert(provider, "contract runner does not support subscribing", - "UNSUPPORTED_OPERATION", { operation }); - - const { fragment, tag, topics } = await getSubInfo(contract, event); - - const { addr, subs } = getInternal(contract); - - let sub = subs.get(tag); - if (!sub) { - const address: string | Addressable = (addr ? addr: contract); - const filter = { address, topics }; - const listener = (log: Log) => { - let foundFragment = fragment; - if (foundFragment == null) { - try { - foundFragment = contract.interface.getEvent(log.topics[0]); - } catch (error) { } - } - - // If fragment is null, we do not deconstruct the args to emit - - if (foundFragment) { - const _foundFragment = foundFragment; - const args = fragment ? contract.interface.decodeEventLog(fragment, log.data, log.topics): [ ]; - emit(contract, event, args, (listener: null | Listener) => { - return new ContractEventPayload(contract, listener, event, _foundFragment, log); - }); - } else { - emit(contract, event, [ ], (listener: null | Listener) => { - return new ContractUnknownEventPayload(contract, listener, event, log); - }); - } - }; - - let starting: Array> = [ ]; - const start = () => { - if (starting.length) { return; } - starting.push(provider.on(filter, listener)); - }; - - const stop = async () => { - if (starting.length == 0) { return; } - - let started = starting; - starting = [ ]; - await Promise.all(started); - provider.off(filter, listener); - }; - - sub = { tag, listeners: [ ], start, stop }; - subs.set(tag, sub); - } - return sub; -} - -// We use this to ensure one emit resolves before firing the next to -// ensure correct ordering (note this cannot throw and just adds the -// notice to the event queu using setTimeout). -let lastEmit: Promise = Promise.resolve(); - -type PayloadFunc = (listener: null | Listener) => ContractUnknownEventPayload; - -async function _emit(contract: BaseContract, event: ContractEventName, args: Array, payloadFunc: null | PayloadFunc): Promise { - await lastEmit; - - const sub = await hasSub(contract, event); - if (!sub) { return false; } - - const count = sub.listeners.length; - sub.listeners = sub.listeners.filter(({ listener, once }) => { - const passArgs = Array.from(args); - if (payloadFunc) { - passArgs.push(payloadFunc(once ? null: listener)); - } - try { - listener.call(contract, ...passArgs); - } catch (error) { } - return !once; - }); - - if (sub.listeners.length === 0) { - sub.stop(); - getInternal(contract).subs.delete(sub.tag); - } - - return (count > 0); -} - -async function emit(contract: BaseContract, event: ContractEventName, args: Array, payloadFunc: null | PayloadFunc): Promise { - try { - await lastEmit; - } catch (error) { } - - const resultPromise = _emit(contract, event, args, payloadFunc); - lastEmit = resultPromise; - return await resultPromise; -} - -const passProperties = [ "then" ]; -export class BaseContract implements Addressable, EventEmitterable { - /** - * The target to connect to. - * - * This can be an address, ENS name or any [[Addressable]], such as - * another contract. To get the resolved address, use the ``getAddress`` - * method. - */ - readonly target!: string | Addressable; - - /** - * The contract Interface. - */ - readonly interface!: Interface; - - /** - * The connected runner. This is generally a [[Provider]] or a - * [[Signer]], which dictates what operations are supported. - * - * For example, a **Contract** connected to a [[Provider]] may - * only execute read-only operations. - */ - readonly runner!: null | ContractRunner; - - /** - * All the Events available on this contract. - */ - readonly filters!: Record; - - /** - * @_ignore: - */ - readonly [internal]: any; - - /** - * The fallback or receive function if any. - */ - readonly fallback!: null | WrappedFallback; - - /** - * Creates a new contract connected to %%target%% with the %%abi%% and - * optionally connected to a %%runner%% to perform operations on behalf - * of. - */ - constructor(target: string | Addressable, abi: Interface | InterfaceAbi, runner?: null | ContractRunner, _deployTx?: null | TransactionResponse) { - assertArgument(typeof(target) === "string" || isAddressable(target), - "invalid value for Contract target", "target", target); - - if (runner == null) { runner = null; } - const iface = Interface.from(abi); - defineProperties(this, { target, runner, interface: iface }); - - Object.defineProperty(this, internal, { value: { } }); - - let addrPromise; - let addr: null | string = null; - - let deployTx: null | ContractTransactionResponse = null; - if (_deployTx) { - const provider = getProvider(runner); - // @TODO: the provider can be null; make a custom dummy provider that will throw a - // meaningful error - deployTx = new ContractTransactionResponse(this.interface, provider, _deployTx); - } - - let subs = new Map(); - - // Resolve the target as the address - if (typeof(target) === "string") { - if (isHexString(target)) { - addr = target; - addrPromise = Promise.resolve(target); - - } else { - const resolver = getRunner(runner, "resolveName"); - if (!canResolve(resolver)) { - throw makeError("contract runner does not support name resolution", "UNSUPPORTED_OPERATION", { - operation: "resolveName" - }); - } - - addrPromise = resolver.resolveName(target).then((addr) => { - if (addr == null) { - throw makeError("an ENS name used for a contract target must be correctly configured", "UNCONFIGURED_NAME", { - value: target - }); - } - getInternal(this).addr = addr; - return addr; - }); - } - } else { - addrPromise = target.getAddress().then((addr) => { - if (addr == null) { throw new Error("TODO"); } - getInternal(this).addr = addr; - return addr; - }); - } - - // Set our private values - setInternal(this, { addrPromise, addr, deployTx, subs }); - - // Add the event filters - const filters = new Proxy({ }, { - get: (target, prop, receiver) => { - // Pass important checks (like `then` for Promise) through - if (typeof(prop) === "symbol" || passProperties.indexOf(prop) >= 0) { - return Reflect.get(target, prop, receiver); - } - - try { - return this.getEvent(prop); - } catch (error) { - if (!isError(error, "INVALID_ARGUMENT") || error.argument !== "key") { - throw error; - } - } - - return undefined; - }, - has: (target, prop) => { - // Pass important checks (like `then` for Promise) through - if (passProperties.indexOf(prop) >= 0) { - return Reflect.has(target, prop); - } - - return Reflect.has(target, prop) || this.interface.hasEvent(String(prop)); - } - }); - defineProperties(this, { filters }); - - defineProperties(this, { - fallback: ((iface.receive || iface.fallback) ? (buildWrappedFallback(this)): null) - }); - - // Return a Proxy that will respond to functions - return new Proxy(this, { - get: (target, prop, receiver) => { - if (typeof(prop) === "symbol" || prop in target || passProperties.indexOf(prop) >= 0) { - return Reflect.get(target, prop, receiver); - } - - // Undefined properties should return undefined - try { - return target.getFunction(prop); - } catch (error) { - if (!isError(error, "INVALID_ARGUMENT") || error.argument !== "key") { - throw error; - } - } - - return undefined; - }, - has: (target, prop) => { - if (typeof(prop) === "symbol" || prop in target || passProperties.indexOf(prop) >= 0) { - return Reflect.has(target, prop); - } - - return target.interface.hasFunction(prop); - } - }); - - } - - /** - * Return a new Contract instance with the same target and ABI, but - * a different %%runner%%. - */ - connect(runner: null | ContractRunner): BaseContract { - return new BaseContract(this.target, this.interface, runner); - } - - /** - * Return a new Contract instance with the same ABI and runner, but - * a different %%target%%. - */ - attach(target: string | Addressable): BaseContract { - return new BaseContract(target, this.interface, this.runner); - } - - /** - * Return the resolved address of this Contract. - */ - async getAddress(): Promise { return await getInternal(this).addrPromise; } - - /** - * Return the deployed bytecode or null if no bytecode is found. - */ - async getDeployedCode(): Promise { - const provider = getProvider(this.runner); - assert(provider, "runner does not support .provider", - "UNSUPPORTED_OPERATION", { operation: "getDeployedCode" }); - - const code = await provider.getCode(await this.getAddress()); - if (code === "0x") { return null; } - return code; - } - - /** - * Resolve to this Contract once the bytecode has been deployed, or - * resolve immediately if already deployed. - */ - async waitForDeployment(): Promise { - // We have the deployment transaction; just use that (throws if deployment fails) - const deployTx = this.deploymentTransaction(); - if (deployTx) { - await deployTx.wait(); - return this; - } - - // Check for code - const code = await this.getDeployedCode(); - if (code != null) { return this; } - - // Make sure we can subscribe to a provider event - const provider = getProvider(this.runner); - assert(provider != null, "contract runner does not support .provider", - "UNSUPPORTED_OPERATION", { operation: "waitForDeployment" }); - - return new Promise((resolve, reject) => { - const checkCode = async () => { - try { - const code = await this.getDeployedCode(); - if (code != null) { return resolve(this); } - provider.once("block", checkCode); - } catch (error) { - reject(error); - } - }; - checkCode(); - }); - } - - /** - * Return the transaction used to deploy this contract. - * - * This is only available if this instance was returned from a - * [[ContractFactory]]. - */ - deploymentTransaction(): null | ContractTransactionResponse { - return getInternal(this).deployTx; - } - - /** - * Return the function for a given name. This is useful when a contract - * method name conflicts with a JavaScript name such as ``prototype`` or - * when using a Contract programmatically. - */ - getFunction(key: string | FunctionFragment): T { - if (typeof(key) !== "string") { key = key.format(); } - const func = buildWrappedMethod(this, key); - return func; - } - - /** - * Return the event for a given name. This is useful when a contract - * event name conflicts with a JavaScript name such as ``prototype`` or - * when using a Contract programmatically. - */ - getEvent(key: string | EventFragment): ContractEvent { - if (typeof(key) !== "string") { key = key.format(); } - return buildWrappedEvent(this, key); - } - - /** - * @_ignore: - */ - async queryTransaction(hash: string): Promise> { - throw new Error("@TODO"); - } - - /* - // @TODO: this is a non-backwards compatible change, but will be added - // in v7 and in a potential SmartContract class in an upcoming - // v6 release - async getTransactionReceipt(hash: string): Promise { - const provider = getProvider(this.runner); - assert(provider, "contract runner does not have a provider", - "UNSUPPORTED_OPERATION", { operation: "queryTransaction" }); - - const receipt = await provider.getTransactionReceipt(hash); - if (receipt == null) { return null; } - - return new ContractTransactionReceipt(this.interface, provider, receipt); - } - */ - - /** - * Provide historic access to event data for %%event%% in the range - * %%fromBlock%% (default: ``0``) to %%toBlock%% (default: ``"latest"``) - * inclusive. - */ - async queryFilter(event: ContractEventName, fromBlock?: BlockTag, toBlock?: BlockTag): Promise> { - if (fromBlock == null) { fromBlock = 0; } - if (toBlock == null) { toBlock = "latest"; } - const { addr, addrPromise } = getInternal(this); - const address = (addr ? addr: (await addrPromise)); - const { fragment, topics } = await getSubInfo(this, event); - const filter = { address, topics, fromBlock, toBlock }; - - const provider = getProvider(this.runner); - assert(provider, "contract runner does not have a provider", - "UNSUPPORTED_OPERATION", { operation: "queryFilter" }); - - return (await provider.getLogs(filter)).map((log) => { - let foundFragment = fragment; - if (foundFragment == null) { - try { - foundFragment = this.interface.getEvent(log.topics[0]); - } catch (error) { } - } - - if (foundFragment) { - try { - return new EventLog(log, this.interface, foundFragment); - } catch (error: any) { - return new UndecodedEventLog(log, error); - } - } - - return new Log(log, provider); - }); - } - - /** - * Add an event %%listener%% for the %%event%%. - */ - async on(event: ContractEventName, listener: Listener): Promise { - const sub = await getSub(this, "on", event); - sub.listeners.push({ listener, once: false }); - sub.start(); - return this; - } - - /** - * Add an event %%listener%% for the %%event%%, but remove the listener - * after it is fired once. - */ - async once(event: ContractEventName, listener: Listener): Promise { - const sub = await getSub(this, "once", event); - sub.listeners.push({ listener, once: true }); - sub.start(); - return this; - } - - /** - * Emit an %%event%% calling all listeners with %%args%%. - * - * Resolves to ``true`` if any listeners were called. - */ - async emit(event: ContractEventName, ...args: Array): Promise { - return await emit(this, event, args, null); - } - - /** - * Resolves to the number of listeners of %%event%% or the total number - * of listeners if unspecified. - */ - async listenerCount(event?: ContractEventName): Promise { - if (event) { - const sub = await hasSub(this, event); - if (!sub) { return 0; } - return sub.listeners.length; - } - - const { subs } = getInternal(this); - - let total = 0; - for (const { listeners } of subs.values()) { - total += listeners.length; - } - return total; - } - - /** - * Resolves to the listeners subscribed to %%event%% or all listeners - * if unspecified. - */ - async listeners(event?: ContractEventName): Promise> { - if (event) { - const sub = await hasSub(this, event); - if (!sub) { return [ ]; } - return sub.listeners.map(({ listener }) => listener); - } - - const { subs } = getInternal(this); - - let result: Array = [ ]; - for (const { listeners } of subs.values()) { - result = result.concat(listeners.map(({ listener }) => listener)); - } - return result; - } - - /** - * Remove the %%listener%% from the listeners for %%event%% or remove - * all listeners if unspecified. - */ - async off(event: ContractEventName, listener?: Listener): Promise { - const sub = await hasSub(this, event); - if (!sub) { return this; } - - if (listener) { - const index = sub.listeners.map(({ listener }) => listener).indexOf(listener); - if (index >= 0) { sub.listeners.splice(index, 1); } - } - - if (listener == null || sub.listeners.length === 0) { - sub.stop(); - getInternal(this).subs.delete(sub.tag); - } - - return this; - } - - /** - * Remove all the listeners for %%event%% or remove all listeners if - * unspecified. - */ - async removeAllListeners(event?: ContractEventName): Promise { - if (event) { - const sub = await hasSub(this, event); - if (!sub) { return this; } - sub.stop(); - getInternal(this).subs.delete(sub.tag); - } else { - const { subs } = getInternal(this); - for (const { tag, stop } of subs.values()) { - stop(); - subs.delete(tag); - } - } - - return this; - } - - /** - * Alias for [on]. - */ - async addListener(event: ContractEventName, listener: Listener): Promise { - return await this.on(event, listener); - } - - /** - * Alias for [off]. - */ - async removeListener(event: ContractEventName, listener: Listener): Promise { - return await this.off(event, listener); - } - - /** - * Create a new Class for the %%abi%%. - */ - static buildClass(abi: Interface | InterfaceAbi): new (target: string, runner?: null | ContractRunner) => BaseContract & Omit { - class CustomContract extends BaseContract { - constructor(address: string, runner: null | ContractRunner = null) { - super(address, abi, runner); - } - } - return CustomContract as any; - }; - - /** - * Create a new BaseContract with a specified Interface. - */ - static from(target: string, abi: Interface | InterfaceAbi, runner?: null | ContractRunner): BaseContract & Omit { - if (runner == null) { runner = null; } - const contract = new this(target, abi, runner ); - return contract as any; - } -} - -function _ContractBase(): new (target: string | Addressable, abi: Interface | InterfaceAbi, runner?: null | ContractRunner) => BaseContract & Omit { - return BaseContract as any; -} - -/** - * A [[BaseContract]] with no type guards on its methods or events. - */ -export class Contract extends _ContractBase() { } diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/contract/factory.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/contract/factory.ts deleted file mode 100644 index a39f5ea1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/contract/factory.ts +++ /dev/null @@ -1,143 +0,0 @@ - -import { Interface } from "../abi/index.js"; -import { getCreateAddress } from "../address/index.js"; -import { - concat, defineProperties, getBytes, hexlify, - assert, assertArgument -} from "../utils/index.js"; - -import { BaseContract, copyOverrides, resolveArgs } from "./contract.js"; - -import type { InterfaceAbi } from "../abi/index.js"; -import type { Addressable } from "../address/index.js"; -import type { ContractRunner } from "../providers/index.js"; -import type { BytesLike } from "../utils/index.js"; - -import type { - ContractInterface, ContractMethodArgs, ContractDeployTransaction, -} from "./types.js"; -import type { ContractTransactionResponse } from "./wrappers.js"; - - -// A = Arguments to the constructor -// I = Interface of deployed contracts - -/** - * A **ContractFactory** is used to deploy a Contract to the blockchain. - */ -export class ContractFactory = Array, I = BaseContract> { - - /** - * The Contract Interface. - */ - readonly interface!: Interface; - - /** - * The Contract deployment bytecode. Often called the initcode. - */ - readonly bytecode!: string; - - /** - * The ContractRunner to deploy the Contract as. - */ - readonly runner!: null | ContractRunner; - - /** - * Create a new **ContractFactory** with %%abi%% and %%bytecode%%, - * optionally connected to %%runner%%. - * - * The %%bytecode%% may be the ``bytecode`` property within the - * standard Solidity JSON output. - */ - constructor(abi: Interface | InterfaceAbi, bytecode: BytesLike | { object: string }, runner?: null | ContractRunner) { - const iface = Interface.from(abi); - - // Dereference Solidity bytecode objects and allow a missing `0x`-prefix - if (bytecode instanceof Uint8Array) { - bytecode = hexlify(getBytes(bytecode)); - } else { - if (typeof(bytecode) === "object") { bytecode = bytecode.object; } - if (!bytecode.startsWith("0x")) { bytecode = "0x" + bytecode; } - bytecode = hexlify(getBytes(bytecode)); - } - - defineProperties(this, { - bytecode, interface: iface, runner: (runner || null) - }); - } - - attach(target: string | Addressable): BaseContract & Omit { - return new (BaseContract)(target, this.interface, this.runner); - } - - /** - * Resolves to the transaction to deploy the contract, passing %%args%% - * into the constructor. - */ - async getDeployTransaction(...args: ContractMethodArgs): Promise { - let overrides: Omit = { }; - - const fragment = this.interface.deploy; - - if (fragment.inputs.length + 1 === args.length) { - overrides = await copyOverrides(args.pop()); - } - - if (fragment.inputs.length !== args.length) { - throw new Error("incorrect number of arguments to constructor"); - } - - const resolvedArgs = await resolveArgs(this.runner, fragment.inputs, args); - - const data = concat([ this.bytecode, this.interface.encodeDeploy(resolvedArgs) ]); - return Object.assign({ }, overrides, { data }); - } - - /** - * Resolves to the Contract deployed by passing %%args%% into the - * constructor. - * - * This will resolve to the Contract before it has been deployed to the - * network, so the [[BaseContract-waitForDeployment]] should be used before - * sending any transactions to it. - */ - async deploy(...args: ContractMethodArgs): Promise> { - const tx = await this.getDeployTransaction(...args); - - assert(this.runner && typeof(this.runner.sendTransaction) === "function", - "factory runner does not support sending transactions", "UNSUPPORTED_OPERATION", { - operation: "sendTransaction" }); - - const sentTx = await this.runner.sendTransaction(tx); - const address = getCreateAddress(sentTx); - return new (BaseContract)(address, this.interface, this.runner, sentTx); - } - - /** - * Return a new **ContractFactory** with the same ABI and bytecode, - * but connected to %%runner%%. - */ - connect(runner: null | ContractRunner): ContractFactory { - return new ContractFactory(this.interface, this.bytecode, runner); - } - - /** - * Create a new **ContractFactory** from the standard Solidity JSON output. - */ - static fromSolidity = Array, I = ContractInterface>(output: any, runner?: ContractRunner): ContractFactory { - assertArgument(output != null, "bad compiler output", "output", output); - - if (typeof(output) === "string") { output = JSON.parse(output); } - - const abi = output.abi; - - let bytecode = ""; - if (output.bytecode) { - bytecode = output.bytecode; - } else if (output.evm && output.evm.bytecode) { - bytecode = output.evm.bytecode; - } - - return new this(abi, bytecode, runner); - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/contract/index.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/contract/index.ts deleted file mode 100644 index c960f171..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/contract/index.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * A **Contract** object is a meta-class (a class whose definition is - * defined at runtime), which communicates with a deployed smart contract - * on the blockchain and provides a simple JavaScript interface to call - * methods, send transaction, query historic logs and listen for its events. - * - * @_section: api/contract:Contracts [about-contracts] - */ -export { - BaseContract, Contract -} from "./contract.js"; - -export { - ContractFactory -} from "./factory.js"; - -export { - ContractEventPayload, ContractUnknownEventPayload, - ContractTransactionReceipt, ContractTransactionResponse, - EventLog, UndecodedEventLog -} from "./wrappers.js"; - -export type { - BaseContractMethod, ConstantContractMethod, - PostfixOverrides, - ContractEvent, ContractEventArgs, ContractEventName, - ContractDeployTransaction, - ContractInterface, ContractMethod, ContractMethodArgs, ContractTransaction, - DeferredTopicFilter, Overrides, - WrappedFallback -} from "./types.js"; diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/contract/types.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/contract/types.ts deleted file mode 100644 index c58b6ef0..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/contract/types.ts +++ /dev/null @@ -1,236 +0,0 @@ -import type { - EventFragment, FunctionFragment, Result, Typed -} from "../abi/index.js"; -import type { - TransactionRequest, PreparedTransactionRequest, TopicFilter -} from "../providers/index.js"; - -import type { ContractTransactionResponse } from "./wrappers.js"; - - -/** - * The name for an event used for subscribing to Contract events. - * - * **``string``** - An event by name. The event must be non-ambiguous. - * The parameters will be dereferenced when passed into the listener. - * - * [[ContractEvent]] - A filter from the ``contract.filters``, which will - * pass only the EventPayload as a single parameter, which includes a - * ``.signature`` property that can be used to further filter the event. - * - * [[TopicFilter]] - A filter defined using the standard Ethereum API - * which provides the specific topic hash or topic hashes to watch for along - * with any additional values to filter by. This will only pass a single - * parameter to the listener, the EventPayload which will include additional - * details to refine by, such as the event name and signature. - * - * [[DeferredTopicFilter]] - A filter created by calling a [[ContractEvent]] - * with parameters, which will create a filter for a specific event - * signature and dereference each parameter when calling the listener. - */ -export type ContractEventName = string | ContractEvent | TopicFilter | DeferredTopicFilter; - -/** - * A Contract with no method constraints. - */ -export interface ContractInterface { - [ name: string ]: BaseContractMethod; -}; - -/** - * When creating a filter using the ``contract.filters``, this is returned. - */ -export interface DeferredTopicFilter { - getTopicFilter(): Promise; - fragment: EventFragment; -} - -/** - * When populating a transaction this type is returned. - */ -export interface ContractTransaction extends PreparedTransactionRequest { - /** - * The target address. - */ - to: string; - - /** - * The transaction data. - */ - data: string; - - /** - * The from address, if any. - */ - from?: string; -} - -/** - * A deployment transaction for a contract. - */ -export interface ContractDeployTransaction extends Omit { } - -/** - * The overrides for a contract transaction. - */ -export interface Overrides extends Omit { }; - - -/** - * Arguments to a Contract method can always include an additional and - * optional overrides parameter. - * - * @_ignore: - */ -export type PostfixOverrides> = A | [ ...A, Overrides ]; - -/** - * Arguments to a Contract method can always include an additional and - * optional overrides parameter, and each parameter can optionally be - * [[Typed]]. - * - * @_ignore: - */ -export type ContractMethodArgs> = PostfixOverrides<{ [ I in keyof A ]-?: A[I] | Typed }>; - -// A = Arguments passed in as a tuple -// R = The result type of the call (i.e. if only one return type, -// the qualified type, otherwise Result) -// D = The type the default call will return (i.e. R for view/pure, -// TransactionResponse otherwise) - -/** - * A Contract method can be called directly, or used in various ways. - */ -export interface BaseContractMethod = Array, R = any, D extends R | ContractTransactionResponse = R | ContractTransactionResponse> { - (...args: ContractMethodArgs): Promise; - - /** - * The name of the Contract method. - */ - name: string; - - /** - * The fragment of the Contract method. This will throw on ambiguous - * method names. - */ - fragment: FunctionFragment; - - /** - * Returns the fragment constrained by %%args%%. This can be used to - * resolve ambiguous method names. - */ - getFragment(...args: ContractMethodArgs): FunctionFragment; - - /** - * Returns a populated transaction that can be used to perform the - * contract method with %%args%%. - */ - populateTransaction(...args: ContractMethodArgs): Promise; - - /** - * Call the contract method with %%args%% and return the value. - * - * If the return value is a single type, it will be dereferenced and - * returned directly, otherwise the full Result will be returned. - */ - staticCall(...args: ContractMethodArgs): Promise; - - /** - * Send a transaction for the contract method with %%args%%. - */ - send(...args: ContractMethodArgs): Promise; - - /** - * Estimate the gas to send the contract method with %%args%%. - */ - estimateGas(...args: ContractMethodArgs): Promise; - - /** - * Call the contract method with %%args%% and return the Result - * without any dereferencing. - */ - staticCallResult(...args: ContractMethodArgs): Promise; -} - -/** - * A contract method on a Contract. - */ -export interface ContractMethod< - A extends Array = Array, - R = any, - D extends R | ContractTransactionResponse = R | ContractTransactionResponse -> extends BaseContractMethod { } - -/** - * A pure of view method on a Contract. - */ -export interface ConstantContractMethod< - A extends Array, - R = any -> extends ContractMethod { } - - -/** - * Each argument of an event is nullable (to indicate matching //any//. - * - * @_ignore: - */ -export type ContractEventArgs> = { [ I in keyof A ]?: A[I] | Typed | null }; - -export interface ContractEvent = Array> { - (...args: ContractEventArgs): DeferredTopicFilter; - - /** - * The name of the Contract event. - */ - name: string; - - /** - * The fragment of the Contract event. This will throw on ambiguous - * method names. - */ - fragment: EventFragment; - - /** - * Returns the fragment constrained by %%args%%. This can be used to - * resolve ambiguous event names. - */ - getFragment(...args: ContractEventArgs): EventFragment; -}; - -/** - * A Fallback or Receive function on a Contract. - */ -export interface WrappedFallback { - (overrides?: Omit): Promise; - - /** - * Returns a populated transaction that can be used to perform the - * fallback method. - * - * For non-receive fallback, ``data`` may be overridden. - */ - populateTransaction(overrides?: Omit): Promise; - - /** - * Call the contract fallback and return the result. - * - * For non-receive fallback, ``data`` may be overridden. - */ - staticCall(overrides?: Omit): Promise; - - /** - * Send a transaction to the contract fallback. - * - * For non-receive fallback, ``data`` may be overridden. - */ - send(overrides?: Omit): Promise; - - /** - * Estimate the gas to send a transaction to the contract fallback. - * - * For non-receive fallback, ``data`` may be overridden. - */ - estimateGas(overrides?: Omit): Promise; -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/contract/wrappers.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/contract/wrappers.ts deleted file mode 100644 index 38ec9edf..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/contract/wrappers.ts +++ /dev/null @@ -1,225 +0,0 @@ -// import from provider.ts instead of index.ts to prevent circular dep -// from EtherscanProvider -import { - Block, Log, TransactionReceipt, TransactionResponse -} from "../providers/provider.js"; -import { defineProperties, EventPayload } from "../utils/index.js"; - -import type { EventFragment, Interface, Result } from "../abi/index.js"; -import type { Listener } from "../utils/index.js"; -import type { - Provider -} from "../providers/index.js"; - -import type { BaseContract } from "./contract.js"; -import type { ContractEventName } from "./types.js"; - -/** - * An **EventLog** contains additional properties parsed from the [[Log]]. - */ -export class EventLog extends Log { - /** - * The Contract Interface. - */ - readonly interface!: Interface; - - /** - * The matching event. - */ - readonly fragment!: EventFragment; - - /** - * The parsed arguments passed to the event by ``emit``. - */ - readonly args!: Result; - - /** - * @_ignore: - */ - constructor(log: Log, iface: Interface, fragment: EventFragment) { - super(log, log.provider); - const args = iface.decodeEventLog(fragment, log.data, log.topics); - defineProperties(this, { args, fragment, interface: iface }); - } - - /** - * The name of the event. - */ - get eventName(): string { return this.fragment.name; } - - /** - * The signature of the event. - */ - get eventSignature(): string { return this.fragment.format(); } -} - -/** - * An **EventLog** contains additional properties parsed from the [[Log]]. - */ -export class UndecodedEventLog extends Log { - - /** - * The error encounted when trying to decode the log. - */ - readonly error!: Error; - - /** - * @_ignore: - */ - constructor(log: Log, error: Error) { - super(log, log.provider); - defineProperties(this, { error }); - } -} - -/** - * A **ContractTransactionReceipt** includes the parsed logs from a - * [[TransactionReceipt]]. - */ -export class ContractTransactionReceipt extends TransactionReceipt { - readonly #iface: Interface; - - /** - * @_ignore: - */ - constructor(iface: Interface, provider: Provider, tx: TransactionReceipt) { - super(tx, provider); - this.#iface = iface; - } - - /** - * The parsed logs for any [[Log]] which has a matching event in the - * Contract ABI. - */ - get logs(): Array { - return super.logs.map((log) => { - const fragment = log.topics.length ? this.#iface.getEvent(log.topics[0]): null; - if (fragment) { - try { - return new EventLog(log, this.#iface, fragment) - } catch (error: any) { - return new UndecodedEventLog(log, error); - } - } - - return log; - }); - } - -} - -/** - * A **ContractTransactionResponse** will return a - * [[ContractTransactionReceipt]] when waited on. - */ -export class ContractTransactionResponse extends TransactionResponse { - readonly #iface: Interface; - - /** - * @_ignore: - */ - constructor(iface: Interface, provider: Provider, tx: TransactionResponse) { - super(tx, provider); - this.#iface = iface; - } - - /** - * Resolves once this transaction has been mined and has - * %%confirms%% blocks including it (default: ``1``) with an - * optional %%timeout%%. - * - * This can resolve to ``null`` only if %%confirms%% is ``0`` - * and the transaction has not been mined, otherwise this will - * wait until enough confirmations have completed. - */ - async wait(confirms?: number, timeout?: number): Promise { - const receipt = await super.wait(confirms, timeout); - if (receipt == null) { return null; } - return new ContractTransactionReceipt(this.#iface, this.provider, receipt); - } -} - -/** - * A **ContractUnknownEventPayload** is included as the last parameter to - * Contract Events when the event does not match any events in the ABI. - */ -export class ContractUnknownEventPayload extends EventPayload { - /** - * The log with no matching events. - */ - readonly log!: Log; - - /** - * @_event: - */ - constructor(contract: BaseContract, listener: null | Listener, filter: ContractEventName, log: Log) { - super(contract, listener, filter); - defineProperties(this, { log }); - } - - /** - * Resolves to the block the event occured in. - */ - async getBlock(): Promise { - return await this.log.getBlock(); - } - - /** - * Resolves to the transaction the event occured in. - */ - async getTransaction(): Promise { - return await this.log.getTransaction(); - } - - /** - * Resolves to the transaction receipt the event occured in. - */ - async getTransactionReceipt(): Promise { - return await this.log.getTransactionReceipt(); - } -} - -/** - * A **ContractEventPayload** is included as the last parameter to - * Contract Events when the event is known. - */ -export class ContractEventPayload extends ContractUnknownEventPayload { - - /** - * The matching event. - */ - declare readonly fragment: EventFragment; - - /** - * The log, with parsed properties. - */ - declare readonly log: EventLog; - - /** - * The parsed arguments passed to the event by ``emit``. - */ - declare readonly args: Result; - - /** - * @_ignore: - */ - constructor(contract: BaseContract, listener: null | Listener, filter: ContractEventName, fragment: EventFragment, _log: Log) { - super(contract, listener, filter, new EventLog(_log, contract.interface, fragment)); - const args = contract.interface.decodeEventLog(fragment, this.log.data, this.log.topics); - defineProperties(this, { args, fragment }); - } - - /** - * The event name. - */ - get eventName(): string { - return this.fragment.name; - } - - /** - * The event signature. - */ - get eventSignature(): string { - return this.fragment.format(); - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/crypto-browser.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/crypto-browser.ts deleted file mode 100644 index e96f26cc..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/crypto-browser.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* Browser Crypto Shims */ - -import { hmac } from "@noble/hashes/hmac"; -import { pbkdf2 } from "@noble/hashes/pbkdf2"; -import { sha256 } from "@noble/hashes/sha256"; -import { sha512 } from "@noble/hashes/sha512"; - -import { assert, assertArgument } from "../utils/index.js"; - - -declare global { - interface Window { } - - const window: Window; - const self: Window; -} - - -function getGlobal(): any { - if (typeof self !== 'undefined') { return self; } - if (typeof window !== 'undefined') { return window; } - if (typeof global !== 'undefined') { return global; } - throw new Error('unable to locate global object'); -}; - -const anyGlobal = getGlobal(); -const crypto: any = anyGlobal.crypto || anyGlobal.msCrypto; - - -export interface CryptoHasher { - update(data: Uint8Array): CryptoHasher; - digest(): Uint8Array; -} - -export function createHash(algo: string): CryptoHasher { - switch (algo) { - case "sha256": return sha256.create(); - case "sha512": return sha512.create(); - } - assertArgument(false, "invalid hashing algorithm name", "algorithm", algo); -} - -export function createHmac(_algo: string, key: Uint8Array): CryptoHasher { - const algo = ({ sha256, sha512 }[_algo]); - assertArgument(algo != null, "invalid hmac algorithm", "algorithm", _algo); - return hmac.create(algo, key); -} - -export function pbkdf2Sync(password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, _algo: "sha256" | "sha512"): Uint8Array { - const algo = ({ sha256, sha512 }[_algo]); - assertArgument(algo != null, "invalid pbkdf2 algorithm", "algorithm", _algo); - return pbkdf2(algo, password, salt, { c: iterations, dkLen: keylen }); -} - -export function randomBytes(length: number): Uint8Array { - assert(crypto != null, "platform does not support secure random numbers", "UNSUPPORTED_OPERATION", { - operation: "randomBytes" }); - - assertArgument(Number.isInteger(length) && length > 0 && length <= 1024, "invalid length", "length", length); - - const result = new Uint8Array(length); - crypto.getRandomValues(result); - return result; -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/crypto.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/crypto.ts deleted file mode 100644 index 142ee3f0..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/crypto.ts +++ /dev/null @@ -1,4 +0,0 @@ - -export { - createHash, createHmac, pbkdf2Sync, randomBytes -} from "crypto"; diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/hmac.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/hmac.ts deleted file mode 100644 index fa4e1ba8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/hmac.ts +++ /dev/null @@ -1,51 +0,0 @@ -/** - * An **HMAC** enables verification that a given key was used - * to authenticate a payload. - * - * See: [[link-wiki-hmac]] - * - * @_subsection: api/crypto:HMAC [about-hmac] - */ -import { createHmac } from "./crypto.js"; -import { getBytes, hexlify } from "../utils/index.js"; - -import type { BytesLike } from "../utils/index.js"; - - -let locked = false; - -const _computeHmac = function(algorithm: "sha256" | "sha512", key: Uint8Array, data: Uint8Array): BytesLike { - return createHmac(algorithm, key).update(data).digest(); -} - -let __computeHmac = _computeHmac; - -/** - * Return the HMAC for %%data%% using the %%key%% key with the underlying - * %%algo%% used for compression. - * - * @example: - * key = id("some-secret") - * - * // Compute the HMAC - * computeHmac("sha256", key, "0x1337") - * //_result: - * - * // To compute the HMAC of UTF-8 data, the data must be - * // converted to UTF-8 bytes - * computeHmac("sha256", key, toUtf8Bytes("Hello World")) - * //_result: - * - */ -export function computeHmac(algorithm: "sha256" | "sha512", _key: BytesLike, _data: BytesLike): string { - const key = getBytes(_key, "key"); - const data = getBytes(_data, "data"); - return hexlify(__computeHmac(algorithm, key, data)); -} -computeHmac._ = _computeHmac; -computeHmac.lock = function() { locked = true; } -computeHmac.register = function(func: (algorithm: "sha256" | "sha512", key: Uint8Array, data: Uint8Array) => BytesLike) { - if (locked) { throw new Error("computeHmac is locked"); } - __computeHmac = func; -} -Object.freeze(computeHmac); diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/index.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/index.ts deleted file mode 100644 index 296bf81d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/index.ts +++ /dev/null @@ -1,59 +0,0 @@ -/** - * A fundamental building block of Ethereum is the underlying - * cryptographic primitives. - * - * @_section: api/crypto:Cryptographic Functions [about-crypto] - */ - -null - -// We import all these so we can export lock() -import { computeHmac } from "./hmac.js"; -import { keccak256 } from "./keccak.js"; -import { ripemd160 } from "./ripemd160.js"; -import { pbkdf2 } from "./pbkdf2.js"; -import { randomBytes } from "./random.js"; -import { scrypt, scryptSync } from "./scrypt.js"; -import { sha256, sha512 } from "./sha2.js"; - -export { - computeHmac, - - randomBytes, - - keccak256, - ripemd160, - sha256, sha512, - - pbkdf2, - scrypt, scryptSync -}; - -export { SigningKey } from "./signing-key.js"; -export { Signature } from "./signature.js"; - -/** - * Once called, prevents any future change to the underlying cryptographic - * primitives using the ``.register`` feature for hooks. - */ -function lock(): void { - computeHmac.lock(); - keccak256.lock(); - pbkdf2.lock(); - randomBytes.lock(); - ripemd160.lock(); - scrypt.lock(); - scryptSync.lock(); - sha256.lock(); - sha512.lock(); - randomBytes.lock(); -} - -export { lock }; - -///////////////////////////// -// Types - -export type { ProgressCallback } from "./scrypt.js"; - -export type { SignatureLike } from "./signature.js"; diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/keccak.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/keccak.ts deleted file mode 100644 index ab2ba9db..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/keccak.ts +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Cryptographic hashing functions - * - * @_subsection: api/crypto:Hash Functions [about-crypto-hashing] - */ - -import { keccak_256 } from "@noble/hashes/sha3"; - -import { getBytes, hexlify } from "../utils/index.js"; - -import type { BytesLike } from "../utils/index.js"; - - -let locked = false; - -const _keccak256 = function(data: Uint8Array): Uint8Array { - return keccak_256(data); -} - -let __keccak256: (data: Uint8Array) => BytesLike = _keccak256; - -/** - * Compute the cryptographic KECCAK256 hash of %%data%%. - * - * The %%data%% **must** be a data representation, to compute the - * hash of UTF-8 data use the [[id]] function. - * - * @returns DataHexstring - * @example: - * keccak256("0x") - * //_result: - * - * keccak256("0x1337") - * //_result: - * - * keccak256(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - * // Strings are assumed to be DataHexString, otherwise it will - * // throw. To hash UTF-8 data, see the note above. - * keccak256("Hello World") - * //_error: - */ -export function keccak256(_data: BytesLike): string { - const data = getBytes(_data, "data"); - return hexlify(__keccak256(data)); -} -keccak256._ = _keccak256; -keccak256.lock = function(): void { locked = true; } -keccak256.register = function(func: (data: Uint8Array) => BytesLike) { - if (locked) { throw new TypeError("keccak256 is locked"); } - __keccak256 = func; -} -Object.freeze(keccak256); diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/pbkdf2.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/pbkdf2.ts deleted file mode 100644 index b6188228..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/pbkdf2.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** - * A **Password-Based Key-Derivation Function** is designed to create - * a sequence of bytes suitible as a **key** from a human-rememberable - * password. - * - * @_subsection: api/crypto:Passwords [about-pbkdf] - */ - -import { pbkdf2Sync } from "./crypto.js"; - -import { getBytes, hexlify } from "../utils/index.js"; - -import type { BytesLike } from "../utils/index.js"; - - -let locked = false; - -const _pbkdf2 = function(password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, algo: "sha256" | "sha512"): BytesLike { - return pbkdf2Sync(password, salt, iterations, keylen, algo); -} - -let __pbkdf2 = _pbkdf2; - -/** - * Return the [[link-pbkdf2]] for %%keylen%% bytes for %%password%% using - * the %%salt%% and using %%iterations%% of %%algo%%. - * - * This PBKDF is outdated and should not be used in new projects, but is - * required to decrypt older files. - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the PBKDF2 - * pbkdf2(passwordBytes, salt, 1024, 16, "sha256") - * //_result: - */ -export function pbkdf2(_password: BytesLike, _salt: BytesLike, iterations: number, keylen: number, algo: "sha256" | "sha512"): string { - const password = getBytes(_password, "password"); - const salt = getBytes(_salt, "salt"); - return hexlify(__pbkdf2(password, salt, iterations, keylen, algo)); -} -pbkdf2._ = _pbkdf2; -pbkdf2.lock = function(): void { locked = true; } -pbkdf2.register = function(func: (password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, algo: "sha256" | "sha512") => BytesLike) { - if (locked) { throw new Error("pbkdf2 is locked"); } - __pbkdf2 = func; -} -Object.freeze(pbkdf2); diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/random.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/random.ts deleted file mode 100644 index ddf5f220..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/random.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * A **Cryptographically Secure Random Value** is one that has been - * generated with additional care take to prevent side-channels - * from allowing others to detect it and prevent others from through - * coincidence generate the same values. - * - * @_subsection: api/crypto:Random Values [about-crypto-random] - */ -import { randomBytes as crypto_random } from "./crypto.js"; - -let locked = false; - -const _randomBytes = function(length: number): Uint8Array { - return new Uint8Array(crypto_random(length)); -} - -let __randomBytes = _randomBytes; - -/** - * Return %%length%% bytes of cryptographically secure random data. - * - * @example: - * randomBytes(8) - * //_result: - */ -export function randomBytes(length: number): Uint8Array { - return __randomBytes(length); -} - -randomBytes._ = _randomBytes; -randomBytes.lock = function(): void { locked = true; } -randomBytes.register = function(func: (length: number) => Uint8Array) { - if (locked) { throw new Error("randomBytes is locked"); } - __randomBytes = func; -} -Object.freeze(randomBytes); diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/ripemd160.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/ripemd160.ts deleted file mode 100644 index 7074be02..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/ripemd160.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { ripemd160 as noble_ripemd160 } from "@noble/hashes/ripemd160"; - -import { getBytes, hexlify } from "../utils/index.js"; - -import type { BytesLike } from "../utils/index.js"; - - -let locked = false; - -const _ripemd160 = function(data: Uint8Array): Uint8Array { - return noble_ripemd160(data); -} - -let __ripemd160: (data: Uint8Array) => BytesLike = _ripemd160; - -/** - * Compute the cryptographic RIPEMD-160 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * ripemd160("0x") - * //_result: - * - * ripemd160("0x1337") - * //_result: - * - * ripemd160(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - */ -export function ripemd160(_data: BytesLike): string { - const data = getBytes(_data, "data"); - return hexlify(__ripemd160(data)); -} -ripemd160._ = _ripemd160; -ripemd160.lock = function(): void { locked = true; } -ripemd160.register = function(func: (data: Uint8Array) => BytesLike) { - if (locked) { throw new TypeError("ripemd160 is locked"); } - __ripemd160 = func; -} -Object.freeze(ripemd160); diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/scrypt.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/scrypt.ts deleted file mode 100644 index 2844cb91..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/scrypt.ts +++ /dev/null @@ -1,114 +0,0 @@ -import { scrypt as _nobleSync, scryptAsync as _nobleAsync } from "@noble/hashes/scrypt"; - -import { getBytes, hexlify as H } from "../utils/index.js"; - -import type { BytesLike } from "../utils/index.js"; - -/** - * A callback during long-running operations to update any - * UI or provide programatic access to the progress. - * - * The %%percent%% is a value between ``0`` and ``1``. - * - * @_docloc: api/crypto:Passwords - */ -export type ProgressCallback = (percent: number) => void; - - -let lockedSync = false, lockedAsync = false; - -const _scryptAsync = async function(passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number, onProgress?: ProgressCallback) { - return await _nobleAsync(passwd, salt, { N, r, p, dkLen, onProgress }); -} -const _scryptSync = function(passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number) { - return _nobleSync(passwd, salt, { N, r, p, dkLen }); -} - -let __scryptAsync: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number, onProgress?: ProgressCallback) => Promise = _scryptAsync; -let __scryptSync: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number) => BytesLike = _scryptSync - - -/** - * The [[link-wiki-scrypt]] uses a memory and cpu hard method of - * derivation to increase the resource cost to brute-force a password - * for a given key. - * - * This means this algorithm is intentionally slow, and can be tuned to - * become slower. As computation and memory speed improve over time, - * increasing the difficulty maintains the cost of an attacker. - * - * For example, if a target time of 5 seconds is used, a legitimate user - * which knows their password requires only 5 seconds to unlock their - * account. A 6 character password has 68 billion possibilities, which - * would require an attacker to invest over 10,000 years of CPU time. This - * is of course a crude example (as password generally aren't random), - * but demonstrates to value of imposing large costs to decryption. - * - * For this reason, if building a UI which involved decrypting or - * encrypting datsa using scrypt, it is recommended to use a - * [[ProgressCallback]] (as event short periods can seem lik an eternity - * if the UI freezes). Including the phrase //"decrypting"// in the UI - * can also help, assuring the user their waiting is for a good reason. - * - * @_docloc: api/crypto:Passwords - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the scrypt - * scrypt(passwordBytes, salt, 1024, 8, 1, 16) - * //_result: - */ -export async function scrypt(_passwd: BytesLike, _salt: BytesLike, N: number, r: number, p: number, dkLen: number, progress?: ProgressCallback): Promise { - const passwd = getBytes(_passwd, "passwd"); - const salt = getBytes(_salt, "salt"); - return H(await __scryptAsync(passwd, salt, N, r, p, dkLen, progress)); -} -scrypt._ = _scryptAsync; -scrypt.lock = function(): void { lockedAsync = true; } -scrypt.register = function(func: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number, progress?: ProgressCallback) => Promise) { - if (lockedAsync) { throw new Error("scrypt is locked"); } - __scryptAsync = func; -} -Object.freeze(scrypt); - -/** - * Provides a synchronous variant of [[scrypt]]. - * - * This will completely lock up and freeze the UI in a browser and will - * prevent any event loop from progressing. For this reason, it is - * preferred to use the [async variant](scrypt). - * - * @_docloc: api/crypto:Passwords - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the scrypt - * scryptSync(passwordBytes, salt, 1024, 8, 1, 16) - * //_result: - */ -export function scryptSync(_passwd: BytesLike, _salt: BytesLike, N: number, r: number, p: number, dkLen: number): string { - const passwd = getBytes(_passwd, "passwd"); - const salt = getBytes(_salt, "salt"); - return H(__scryptSync(passwd, salt, N, r, p, dkLen)); -} -scryptSync._ = _scryptSync; -scryptSync.lock = function(): void { lockedSync = true; } -scryptSync.register = function(func: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number) => BytesLike) { - if (lockedSync) { throw new Error("scryptSync is locked"); } - __scryptSync = func; -} -Object.freeze(scryptSync); diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/sha2.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/sha2.ts deleted file mode 100644 index 2fc8f8ac..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/sha2.ts +++ /dev/null @@ -1,78 +0,0 @@ -import { createHash } from "./crypto.js"; - -import { getBytes, hexlify } from "../utils/index.js"; - -import type { BytesLike } from "../utils/index.js"; - - -const _sha256 = function(data: Uint8Array): Uint8Array { - return createHash("sha256").update(data).digest(); -} - -const _sha512 = function(data: Uint8Array): Uint8Array { - return createHash("sha512").update(data).digest(); -} - -let __sha256: (data: Uint8Array) => BytesLike = _sha256; -let __sha512: (data: Uint8Array) => BytesLike = _sha512; - -let locked256 = false, locked512 = false; - - -/** - * Compute the cryptographic SHA2-256 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * sha256("0x") - * //_result: - * - * sha256("0x1337") - * //_result: - * - * sha256(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - */ -export function sha256(_data: BytesLike): string { - const data = getBytes(_data, "data"); - return hexlify(__sha256(data)); -} -sha256._ = _sha256; -sha256.lock = function(): void { locked256 = true; } -sha256.register = function(func: (data: Uint8Array) => BytesLike): void { - if (locked256) { throw new Error("sha256 is locked"); } - __sha256 = func; -} -Object.freeze(sha256); - - -/** - * Compute the cryptographic SHA2-512 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * sha512("0x") - * //_result: - * - * sha512("0x1337") - * //_result: - * - * sha512(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - */ -export function sha512(_data: BytesLike): string { - const data = getBytes(_data, "data"); - return hexlify(__sha512(data)); -} -sha512._ = _sha512; -sha512.lock = function(): void { locked512 = true; } -sha512.register = function(func: (data: Uint8Array) => BytesLike): void { - if (locked512) { throw new Error("sha512 is locked"); } - __sha512 = func; -} -Object.freeze(sha256); diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/signature.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/signature.ts deleted file mode 100644 index 292ddf4b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/signature.ts +++ /dev/null @@ -1,410 +0,0 @@ - -import { ZeroHash } from "../constants/index.js"; -import { - concat, dataLength, getBigInt, getBytes, getNumber, hexlify, - toBeArray, isHexString, zeroPadValue, - assertArgument, assertPrivate -} from "../utils/index.js"; - -import type { - BigNumberish, BytesLike, Numeric -} from "../utils/index.js"; - - -// Constants -const BN_0 = BigInt(0); -const BN_1 = BigInt(1); -const BN_2 = BigInt(2); -const BN_27 = BigInt(27); -const BN_28 = BigInt(28); -const BN_35 = BigInt(35); -const BN_N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); -const BN_N_2 = BN_N / BN_2; // Must be integer (floor) division; do NOT shifts - -const inspect = Symbol.for("nodejs.util.inspect.custom"); - -const _guard = { }; - -// @TODO: Allow Uint8Array - -/** - * A SignatureLike - * - * @_docloc: api/crypto:Signing - */ -export type SignatureLike = Signature | string | { - r: string; - s: string; - v: BigNumberish; - yParity?: 0 | 1; - yParityAndS?: string; -} | { - r: string; - yParityAndS: string; - yParity?: 0 | 1; - s?: string; - v?: number; -} | { - r: string; - s: string; - yParity: 0 | 1; - v?: BigNumberish; - yParityAndS?: string; -}; - -function toUint256(value: BigNumberish): string { - return zeroPadValue(toBeArray(value), 32); -} - -/** - * A Signature @TODO - * - * - * @_docloc: api/crypto:Signing - */ -export class Signature { - #r: string; - #s: string; - #v: 27 | 28; - #networkV: null | bigint; - - /** - * The ``r`` value for a signature. - * - * This represents the ``x`` coordinate of a "reference" or - * challenge point, from which the ``y`` can be computed. - */ - get r(): string { return this.#r; } - set r(value: BytesLike) { - assertArgument(dataLength(value) === 32, "invalid r", "value", value); - this.#r = hexlify(value); - } - - /** - * The ``s`` value for a signature. - */ - get s(): string { - assertArgument(parseInt(this.#s.substring(0, 3)) < 8, "non-canonical s; use ._s", "s", this.#s); - return this.#s; - } - set s(_value: BytesLike) { - assertArgument(dataLength(_value) === 32, "invalid s", "value", _value); - this.#s = hexlify(_value); - } - - /** - * Return the s value, unchecked for EIP-2 compliance. - * - * This should generally not be used and is for situations where - * a non-canonical S value might be relevant, such as Frontier blocks - * that were mined prior to EIP-2 or invalid Authorization List - * signatures. - */ - get _s(): string { return this.#s; } - - /** - * Returns true if the Signature is valid for [[link-eip-2]] signatures. - */ - isValid(): boolean { - const s = BigInt(this.#s); - return (s <= BN_N_2); - } - - /** - * The ``v`` value for a signature. - * - * Since a given ``x`` value for ``r`` has two possible values for - * its correspondin ``y``, the ``v`` indicates which of the two ``y`` - * values to use. - * - * It is normalized to the values ``27`` or ``28`` for legacy - * purposes. - */ - get v(): 27 | 28 { return this.#v; } - set v(value: BigNumberish) { - const v = getNumber(value, "value"); - assertArgument(v === 27 || v === 28, "invalid v", "v", value); - this.#v = v; - } - - /** - * The EIP-155 ``v`` for legacy transactions. For non-legacy - * transactions, this value is ``null``. - */ - get networkV(): null | bigint { return this.#networkV; } - - /** - * The chain ID for EIP-155 legacy transactions. For non-legacy - * transactions, this value is ``null``. - */ - get legacyChainId(): null | bigint { - const v = this.networkV; - if (v == null) { return null; } - return Signature.getChainId(v); - } - - /** - * The ``yParity`` for the signature. - * - * See ``v`` for more details on how this value is used. - */ - get yParity(): 0 | 1 { - return (this.v === 27) ? 0: 1; - } - - /** - * The [[link-eip-2098]] compact representation of the ``yParity`` - * and ``s`` compacted into a single ``bytes32``. - */ - get yParityAndS(): string { - // The EIP-2098 compact representation - const yParityAndS = getBytes(this.s); - if (this.yParity) { yParityAndS[0] |= 0x80; } - return hexlify(yParityAndS); - } - - /** - * The [[link-eip-2098]] compact representation. - */ - get compactSerialized(): string { - return concat([ this.r, this.yParityAndS ]); - } - - /** - * The serialized representation. - */ - get serialized(): string { - return concat([ this.r, this.s, (this.yParity ? "0x1c": "0x1b") ]); - } - - /** - * @private - */ - constructor(guard: any, r: string, s: string, v: 27 | 28) { - assertPrivate(guard, _guard, "Signature"); - this.#r = r; - this.#s = s; - this.#v = v; - this.#networkV = null; - } - - /** - * Returns the canonical signature. - * - * This is only necessary when dealing with legacy transaction which - * did not enforce canonical S values (i.e. [[link-eip-2]]. Most - * developers should never require this. - */ - getCanonical(): Signature { - if (this.isValid()) { return this; } - - // Compute the canonical signature; s' = N - s, v = !v - const s = BN_N - BigInt(this._s); - const v = <27 | 28>(55 - this.v); - const result = new Signature(_guard, this.r, toUint256(s), v); - - // Populate the networkV if necessary - if (this.networkV) { result.#networkV = this.networkV; } - - return result; - } - - /** - * Returns a new identical [[Signature]]. - */ - clone(): Signature { - const clone = new Signature(_guard, this.r, this._s, this.v); - if (this.networkV) { clone.#networkV = this.networkV; } - return clone; - } - - /** - * Returns a representation that is compatible with ``JSON.stringify``. - */ - toJSON(): any { - const networkV = this.networkV; - return { - _type: "signature", - networkV: ((networkV != null) ? networkV.toString(): null), - r: this.r, s: this._s, v: this.v, - }; - } - - [inspect](): string { - return this.toString(); - } - - toString(): string { - if (this.isValid()) { - return `Signature { r: ${ this.r }, s: ${ this._s }, v: ${ this.v } }`; - } - return `Signature { r: ${ this.r }, s: ${ this._s }, v: ${ this.v }, valid: false }`; - } - - /** - * Compute the chain ID from the ``v`` in a legacy EIP-155 transactions. - * - * @example: - * Signature.getChainId(45) - * //_result: - * - * Signature.getChainId(46) - * //_result: - */ - static getChainId(v: BigNumberish): bigint { - const bv = getBigInt(v, "v"); - - // The v is not an EIP-155 v, so it is the unspecified chain ID - if ((bv == BN_27) || (bv == BN_28)) { return BN_0; } - - // Bad value for an EIP-155 v - assertArgument(bv >= BN_35, "invalid EIP-155 v", "v", v); - - return (bv - BN_35) / BN_2; - } - - /** - * Compute the ``v`` for a chain ID for a legacy EIP-155 transactions. - * - * Legacy transactions which use [[link-eip-155]] hijack the ``v`` - * property to include the chain ID. - * - * @example: - * Signature.getChainIdV(5, 27) - * //_result: - * - * Signature.getChainIdV(5, 28) - * //_result: - * - */ - static getChainIdV(chainId: BigNumberish, v: 27 | 28): bigint { - return (getBigInt(chainId) * BN_2) + BigInt(35 + v - 27); - } - - /** - * Compute the normalized legacy transaction ``v`` from a ``yParirty``, - * a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction. - * - * @example: - * // The values 0 and 1 imply v is actually yParity - * Signature.getNormalizedV(0) - * //_result: - * - * // Legacy non-EIP-1559 transaction (i.e. 27 or 28) - * Signature.getNormalizedV(27) - * //_result: - * - * // Legacy EIP-155 transaction (i.e. >= 35) - * Signature.getNormalizedV(46) - * //_result: - * - * // Invalid values throw - * Signature.getNormalizedV(5) - * //_error: - */ - static getNormalizedV(v: BigNumberish): 27 | 28 { - const bv = getBigInt(v); - - if (bv === BN_0 || bv === BN_27) { return 27; } - if (bv === BN_1 || bv === BN_28) { return 28; } - - assertArgument(bv >= BN_35, "invalid v", "v", v); - - // Otherwise, EIP-155 v means odd is 27 and even is 28 - return (bv & BN_1) ? 27: 28; - } - - /** - * Creates a new [[Signature]]. - * - * If no %%sig%% is provided, a new [[Signature]] is created - * with default values. - * - * If %%sig%% is a string, it is parsed. - */ - static from(sig?: SignatureLike): Signature { - function assertError(check: unknown, message: string): asserts check { - assertArgument(check, message, "signature", sig); - }; - - if (sig == null) { - return new Signature(_guard, ZeroHash, ZeroHash, 27); - } - - if (typeof(sig) === "string") { - const bytes = getBytes(sig, "signature"); - if (bytes.length === 64) { - const r = hexlify(bytes.slice(0, 32)); - const s = bytes.slice(32, 64); - const v = (s[0] & 0x80) ? 28: 27; - s[0] &= 0x7f; - return new Signature(_guard, r, hexlify(s), v); - } - - if (bytes.length === 65) { - const r = hexlify(bytes.slice(0, 32)); - const s = hexlify(bytes.slice(32, 64)); - const v = Signature.getNormalizedV(bytes[64]); - return new Signature(_guard, r, s, v); - } - - assertError(false, "invalid raw signature length"); - } - - if (sig instanceof Signature) { return sig.clone(); } - - // Get r - const _r = sig.r; - assertError(_r != null, "missing r"); - const r = toUint256(_r); - - // Get s; by any means necessary (we check consistency below) - const s = (function(s?: string, yParityAndS?: string) { - if (s != null) { return toUint256(s); } - - if (yParityAndS != null) { - assertError(isHexString(yParityAndS, 32), "invalid yParityAndS"); - const bytes = getBytes(yParityAndS); - bytes[0] &= 0x7f; - return hexlify(bytes); - } - - assertError(false, "missing s"); - })(sig.s, sig.yParityAndS); - - // Get v; by any means necessary (we check consistency below) - const { networkV, v } = (function(_v?: BigNumberish, yParityAndS?: string, yParity?: Numeric): { networkV?: bigint, v: 27 | 28 } { - if (_v != null) { - const v = getBigInt(_v); - return { - networkV: ((v >= BN_35) ? v: undefined), - v: Signature.getNormalizedV(v) - }; - } - - if (yParityAndS != null) { - assertError(isHexString(yParityAndS, 32), "invalid yParityAndS"); - return { v: ((getBytes(yParityAndS)[0] & 0x80) ? 28: 27) }; - } - - if (yParity != null) { - switch (getNumber(yParity, "sig.yParity")) { - case 0: return { v: 27 }; - case 1: return { v: 28 }; - } - assertError(false, "invalid yParity"); - } - - assertError(false, "missing v"); - })(sig.v, sig.yParityAndS, sig.yParity); - - const result = new Signature(_guard, r, s, v); - if (networkV) { result.#networkV = networkV; } - - // If multiple of v, yParity, yParityAndS we given, check they match - assertError(sig.yParity == null || getNumber(sig.yParity, "sig.yParity") === result.yParity, "yParity mismatch"); - assertError(sig.yParityAndS == null || sig.yParityAndS === result.yParityAndS, "yParityAndS mismatch"); - - return result; - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/signing-key.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/signing-key.ts deleted file mode 100644 index 8ddd66fc..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/crypto/signing-key.ts +++ /dev/null @@ -1,196 +0,0 @@ -/** - * Add details about signing here. - * - * @_subsection: api/crypto:Signing [about-signing] - */ - -import { secp256k1 } from "@noble/curves/secp256k1"; - -import { - concat, dataLength, getBytes, getBytesCopy, hexlify, toBeHex, - assertArgument -} from "../utils/index.js"; - -import { Signature } from "./signature.js"; - -import type { BytesLike } from "../utils/index.js"; - -import type { SignatureLike } from "./index.js"; - - -/** - * A **SigningKey** provides high-level access to the elliptic curve - * cryptography (ECC) operations and key management. - */ -export class SigningKey { - #privateKey: string; - - /** - * Creates a new **SigningKey** for %%privateKey%%. - */ - constructor(privateKey: BytesLike) { - assertArgument(dataLength(privateKey) === 32, "invalid private key", "privateKey", "[REDACTED]"); - this.#privateKey = hexlify(privateKey); - } - - /** - * The private key. - */ - get privateKey(): string { return this.#privateKey; } - - /** - * The uncompressed public key. - * - * This will always begin with the prefix ``0x04`` and be 132 - * characters long (the ``0x`` prefix and 130 hexadecimal nibbles). - */ - get publicKey(): string { return SigningKey.computePublicKey(this.#privateKey); } - - /** - * The compressed public key. - * - * This will always begin with either the prefix ``0x02`` or ``0x03`` - * and be 68 characters long (the ``0x`` prefix and 33 hexadecimal - * nibbles) - */ - get compressedPublicKey(): string { return SigningKey.computePublicKey(this.#privateKey, true); } - - /** - * Return the signature of the signed %%digest%%. - */ - sign(digest: BytesLike): Signature { - assertArgument(dataLength(digest) === 32, "invalid digest length", "digest", digest); - - const sig = secp256k1.sign(getBytesCopy(digest), getBytesCopy(this.#privateKey), { - lowS: true - }); - - return Signature.from({ - r: toBeHex(sig.r, 32), - s: toBeHex(sig.s, 32), - v: (sig.recovery ? 0x1c: 0x1b) - }); - } - - /** - * Returns the [[link-wiki-ecdh]] shared secret between this - * private key and the %%other%% key. - * - * The %%other%% key may be any type of key, a raw public key, - * a compressed/uncompressed pubic key or aprivate key. - * - * Best practice is usually to use a cryptographic hash on the - * returned value before using it as a symetric secret. - * - * @example: - * sign1 = new SigningKey(id("some-secret-1")) - * sign2 = new SigningKey(id("some-secret-2")) - * - * // Notice that privA.computeSharedSecret(pubB)... - * sign1.computeSharedSecret(sign2.publicKey) - * //_result: - * - * // ...is equal to privB.computeSharedSecret(pubA). - * sign2.computeSharedSecret(sign1.publicKey) - * //_result: - */ - computeSharedSecret(other: BytesLike): string { - const pubKey = SigningKey.computePublicKey(other); - return hexlify(secp256k1.getSharedSecret(getBytesCopy(this.#privateKey), getBytes(pubKey), false)); - } - - /** - * Compute the public key for %%key%%, optionally %%compressed%%. - * - * The %%key%% may be any type of key, a raw public key, a - * compressed/uncompressed public key or private key. - * - * @example: - * sign = new SigningKey(id("some-secret")); - * - * // Compute the uncompressed public key for a private key - * SigningKey.computePublicKey(sign.privateKey) - * //_result: - * - * // Compute the compressed public key for a private key - * SigningKey.computePublicKey(sign.privateKey, true) - * //_result: - * - * // Compute the uncompressed public key - * SigningKey.computePublicKey(sign.publicKey, false); - * //_result: - * - * // Compute the Compressed a public key - * SigningKey.computePublicKey(sign.publicKey, true); - * //_result: - */ - static computePublicKey(key: BytesLike, compressed?: boolean): string { - let bytes = getBytes(key, "key"); - - // private key - if (bytes.length === 32) { - const pubKey = secp256k1.getPublicKey(bytes, !!compressed); - return hexlify(pubKey); - } - - // raw public key; use uncompressed key with 0x04 prefix - if (bytes.length === 64) { - const pub = new Uint8Array(65); - pub[0] = 0x04; - pub.set(bytes, 1); - bytes = pub; - } - - const point = secp256k1.ProjectivePoint.fromHex(bytes); - return hexlify(point.toRawBytes(compressed)); - } - - /** - * Returns the public key for the private key which produced the - * %%signature%% for the given %%digest%%. - * - * @example: - * key = new SigningKey(id("some-secret")) - * digest = id("hello world") - * sig = key.sign(digest) - * - * // Notice the signer public key... - * key.publicKey - * //_result: - * - * // ...is equal to the recovered public key - * SigningKey.recoverPublicKey(digest, sig) - * //_result: - * - */ - static recoverPublicKey(digest: BytesLike, signature: SignatureLike): string { - assertArgument(dataLength(digest) === 32, "invalid digest length", "digest", digest); - - const sig = Signature.from(signature); - - let secpSig = secp256k1.Signature.fromCompact(getBytesCopy(concat([ sig.r, sig.s ]))); - secpSig = secpSig.addRecoveryBit(sig.yParity); - - const pubKey = secpSig.recoverPublicKey(getBytesCopy(digest)); - assertArgument(pubKey != null, "invalid signature for digest", "signature", signature); - - return "0x" + pubKey.toHex(false); - } - - /** - * Returns the point resulting from adding the ellipic curve points - * %%p0%% and %%p1%%. - * - * This is not a common function most developers should require, but - * can be useful for certain privacy-specific techniques. - * - * For example, it is used by [[HDNodeWallet]] to compute child - * addresses from parent public keys and chain codes. - */ - static addPoints(p0: BytesLike, p1: BytesLike, compressed?: boolean): string { - const pub0 = secp256k1.ProjectivePoint.fromHex(SigningKey.computePublicKey(p0).substring(2)); - const pub1 = secp256k1.ProjectivePoint.fromHex(SigningKey.computePublicKey(p1).substring(2)); - return "0x" + pub0.add(pub1).toHex(!!compressed) - } -} - diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/ethers.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/ethers.ts deleted file mode 100644 index a88b6331..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/ethers.ts +++ /dev/null @@ -1,221 +0,0 @@ - - -///////////////////////////// -// - -export { version } from "./_version.js"; - -export { - decodeBytes32String, encodeBytes32String, - - AbiCoder, - ConstructorFragment, ErrorFragment, EventFragment, Fragment, FallbackFragment, FunctionFragment, NamedFragment, ParamType, StructFragment, - - checkResultErrors, ErrorDescription, Indexed, Interface, LogDescription, Result, TransactionDescription, - Typed, -} from "./abi/index.js"; - -export { - getAddress, getIcapAddress, - getCreateAddress, getCreate2Address, - isAddressable, isAddress, resolveAddress -} from "./address/index.js"; - -export { - ZeroAddress, - WeiPerEther, MaxUint256, MinInt256, MaxInt256, N, - ZeroHash, - EtherSymbol, MessagePrefix -} from "./constants/index.js"; - -export { - BaseContract, Contract, - ContractFactory, - ContractEventPayload, ContractTransactionReceipt, ContractTransactionResponse, ContractUnknownEventPayload, EventLog, UndecodedEventLog -} from "./contract/index.js"; - -export { - computeHmac, - randomBytes, - keccak256, - ripemd160, - sha256, sha512, - pbkdf2, - scrypt, scryptSync, - lock, - Signature, SigningKey -} from "./crypto/index.js"; - -export { - id, - ensNormalize, isValidName, namehash, dnsEncode, - hashAuthorization, verifyAuthorization, - hashMessage, verifyMessage, - solidityPacked, solidityPackedKeccak256, solidityPackedSha256, - TypedDataEncoder, - verifyTypedData -} from "./hash/index.js"; - -export { - getDefaultProvider, - - Block, FeeData, Log, TransactionReceipt, TransactionResponse, - - AbstractSigner, NonceManager, VoidSigner, - - AbstractProvider, - - FallbackProvider, - JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, - - BrowserProvider, - - AlchemyProvider, AnkrProvider, BlockscoutProvider, ChainstackProvider, - CloudflareProvider, EtherscanProvider, InfuraProvider, - InfuraWebSocketProvider, PocketProvider, QuickNodeProvider, - - IpcSocketProvider, SocketProvider, WebSocketProvider, - - EnsResolver, - Network, - - EnsPlugin, EtherscanPlugin, - FeeDataNetworkPlugin, FetchUrlFeeDataNetworkPlugin, - GasCostPlugin, NetworkPlugin, MulticoinProviderPlugin, - - SocketBlockSubscriber, SocketEventSubscriber, SocketPendingSubscriber, - SocketSubscriber, UnmanagedSubscriber, - - copyRequest, showThrottleMessage -} from "./providers/index.js"; - -export { - accessListify, authorizationify, - computeAddress, recoverAddress, - Transaction -} from "./transaction/index.js"; - -export { - decodeBase58, encodeBase58, - decodeBase64, encodeBase64, - concat, dataLength, dataSlice, getBytes, getBytesCopy, hexlify, - isHexString, isBytesLike, stripZerosLeft, zeroPadBytes, zeroPadValue, - defineProperties, resolveProperties, - assert, assertArgument, assertArgumentCount, assertNormalize, assertPrivate, - makeError, - isCallException, isError, - EventPayload, - FetchRequest, FetchResponse, FetchCancelSignal, - FixedNumber, - getBigInt, getNumber, getUint, toBeArray, toBigInt, toBeHex, toNumber, toQuantity, - fromTwos, toTwos, mask, - formatEther, parseEther, formatUnits, parseUnits, - toUtf8Bytes, toUtf8CodePoints, toUtf8String, - Utf8ErrorFuncs, - decodeRlp, encodeRlp, - uuidV4, -} from "./utils/index.js"; - -export { - Mnemonic, - BaseWallet, HDNodeWallet, HDNodeVoidWallet, - Wallet, - - defaultPath, - - getAccountPath, getIndexedAccountPath, - isCrowdsaleJson, isKeystoreJson, - - decryptCrowdsaleJson, decryptKeystoreJsonSync, decryptKeystoreJson, - encryptKeystoreJson, encryptKeystoreJsonSync, -} from "./wallet/index.js"; - -export { - Wordlist, LangEn, WordlistOwl, WordlistOwlA, wordlists -} from "./wordlists/index.js"; - - - -///////////////////////////// -// Types - -export type { - JsonFragment, JsonFragmentType, - FormatType, FragmentType, - InterfaceAbi, - ParamTypeWalkFunc, ParamTypeWalkAsyncFunc -} from "./abi/index.js"; - -export type { - Addressable, AddressLike, NameResolver -} from "./address/index.js"; - -export type { - ConstantContractMethod, ContractEvent, ContractEventArgs, ContractEventName, - ContractInterface, ContractMethod, ContractMethodArgs, ContractTransaction, - DeferredTopicFilter, Overrides, - BaseContractMethod, ContractDeployTransaction, PostfixOverrides, - WrappedFallback -} from "./contract/index.js"; - -export type { ProgressCallback, SignatureLike } from "./crypto/index.js"; - -export type { - AuthorizationRequest, TypedDataDomain, TypedDataField -} from "./hash/index.js"; - -export type { - Provider, Signer, - - CommunityResourcable, - - AbstractProviderOptions, BrowserProviderOptions, FallbackProviderOptions, - - AbstractProviderPlugin, BlockParams, BlockTag, BrowserDiscoverOptions, - ContractRunner, DebugEventBrowserProvider, Eip1193Provider, - Eip6963ProviderInfo, EventFilter, Filter, FilterByBlockHash, - GasCostParameters, JsonRpcApiProviderOptions, JsonRpcError, - JsonRpcPayload, JsonRpcResult, JsonRpcTransactionRequest, LogParams, - MinedBlock, MinedTransactionResponse, Networkish, OrphanFilter, - PerformActionFilter, PerformActionRequest, PerformActionTransaction, - PreparedTransactionRequest, ProviderEvent, Subscriber, Subscription, - TopicFilter, TransactionReceiptParams, TransactionRequest, - TransactionResponseParams, WebSocketCreator, WebSocketLike -} from "./providers/index.js"; - -export type { - AccessList, AccessListish, AccessListEntry, - Authorization, AuthorizationLike, - Blob, BlobLike, KzgLibrary, KzgLibraryLike, - TransactionLike -} from "./transaction/index.js"; - -export type { - BytesLike, - BigNumberish, Numeric, - ErrorCode, - FixedFormat, - Utf8ErrorFunc, UnicodeNormalizationForm, Utf8ErrorReason, - RlpStructuredData, RlpStructuredDataish, - - GetUrlResponse, - FetchPreflightFunc, FetchProcessFunc, FetchRetryFunc, - FetchGatewayFunc, FetchGetUrlFunc, - - EthersError, UnknownError, NotImplementedError, UnsupportedOperationError, NetworkError, - ServerError, TimeoutError, BadDataError, CancelledError, BufferOverrunError, - NumericFaultError, InvalidArgumentError, MissingArgumentError, UnexpectedArgumentError, - CallExceptionError, InsufficientFundsError, NonceExpiredError, OffchainFaultError, - ReplacementUnderpricedError, TransactionReplacedError, UnconfiguredNameError, - ActionRejectedError, - CodedEthersError, - - CallExceptionAction, CallExceptionTransaction, - EventEmitterable, Listener -} from "./utils/index.js"; - -export type { - CrowdsaleAccount, KeystoreAccount, EncryptOptions -} from "./wallet/index.js"; - -// dummy change; to pick-up ws security issue changes diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/hash/authorization.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/hash/authorization.ts deleted file mode 100644 index 8c0932fc..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/hash/authorization.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { getAddress } from "../address/index.js"; -import { keccak256 } from "../crypto/index.js"; -import { recoverAddress } from "../transaction/index.js"; -import { - assertArgument, concat, encodeRlp, toBeArray -} from "../utils/index.js"; - -import type { Addressable } from "../address/index.js"; -import type { SignatureLike } from "../crypto/index.js"; -import type { BigNumberish, Numeric } from "../utils/index.js"; - -export interface AuthorizationRequest { - address: string | Addressable; - nonce?: Numeric; - chainId?: BigNumberish; -} - -/** - * Computes the [[link-eip-7702]] authorization digest to sign. - */ -export function hashAuthorization(auth: AuthorizationRequest): string { - assertArgument(typeof(auth.address) === "string", "invalid address for hashAuthorization", "auth.address", auth); - return keccak256(concat([ - "0x05", encodeRlp([ - (auth.chainId != null) ? toBeArray(auth.chainId): "0x", - getAddress(auth.address), - (auth.nonce != null) ? toBeArray(auth.nonce): "0x", - ]) - ])); -} - -/** - * Return the address of the private key that produced - * the signature %%sig%% during signing for %%message%%. - */ -export function verifyAuthorization(auth: AuthorizationRequest, sig: SignatureLike): string { - return recoverAddress(hashAuthorization(auth), sig); -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/hash/id.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/hash/id.ts deleted file mode 100644 index 8780a693..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/hash/id.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { keccak256 } from "../crypto/index.js"; -import { toUtf8Bytes } from "../utils/index.js"; - -/** - * A simple hashing function which operates on UTF-8 strings to - * compute an 32-byte identifier. - * - * This simply computes the [UTF-8 bytes](toUtf8Bytes) and computes - * the [[keccak256]]. - * - * @example: - * id("hello world") - * //_result: - */ -export function id(value: string): string { - return keccak256(toUtf8Bytes(value)); -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/hash/index.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/hash/index.ts deleted file mode 100644 index 2c2289aa..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/hash/index.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Utilities for common tasks involving hashing. Also see - * [cryptographic hashing](about-crypto-hashing). - * - * @_section: api/hashing:Hashing Utilities [about-hashing] - */ - -export { hashAuthorization, verifyAuthorization } from "./authorization.js"; -export { id } from "./id.js" -export { ensNormalize, isValidName, namehash, dnsEncode } from "./namehash.js"; -export { hashMessage, verifyMessage } from "./message.js"; -export { - solidityPacked, solidityPackedKeccak256, solidityPackedSha256 -} from "./solidity.js"; -export { TypedDataEncoder, verifyTypedData } from "./typed-data.js"; - -export type { AuthorizationRequest } from "./authorization.js"; -export type { TypedDataDomain, TypedDataField } from "./typed-data.js"; diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/hash/message.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/hash/message.ts deleted file mode 100644 index 871a84bb..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/hash/message.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { keccak256 } from "../crypto/index.js"; -import { MessagePrefix } from "../constants/index.js"; -import { recoverAddress } from "../transaction/index.js"; -import { concat, toUtf8Bytes } from "../utils/index.js"; - -import type { SignatureLike } from "../crypto/index.js"; -/** - * Computes the [[link-eip-191]] personal-sign message digest to sign. - * - * This prefixes the message with [[MessagePrefix]] and the decimal length - * of %%message%% and computes the [[keccak256]] digest. - * - * If %%message%% is a string, it is converted to its UTF-8 bytes - * first. To compute the digest of a [[DataHexString]], it must be converted - * to [bytes](getBytes). - * - * @example: - * hashMessage("Hello World") - * //_result: - * - * // Hashes the SIX (6) string characters, i.e. - * // [ "0", "x", "4", "2", "4", "3" ] - * hashMessage("0x4243") - * //_result: - * - * // Hashes the TWO (2) bytes [ 0x42, 0x43 ]... - * hashMessage(getBytes("0x4243")) - * //_result: - * - * // ...which is equal to using data - * hashMessage(new Uint8Array([ 0x42, 0x43 ])) - * //_result: - * - */ -export function hashMessage(message: Uint8Array | string): string { - if (typeof(message) === "string") { message = toUtf8Bytes(message); } - return keccak256(concat([ - toUtf8Bytes(MessagePrefix), - toUtf8Bytes(String(message.length)), - message - ])); -} - -/** - * Return the address of the private key that produced - * the signature %%sig%% during signing for %%message%%. - */ -export function verifyMessage(message: Uint8Array | string, sig: SignatureLike): string { - const digest = hashMessage(message); - return recoverAddress(digest, sig); -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/hash/namehash.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/hash/namehash.ts deleted file mode 100644 index 759383ac..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/hash/namehash.ts +++ /dev/null @@ -1,101 +0,0 @@ - -import { keccak256 } from "../crypto/index.js"; -import { - concat, hexlify, assertArgument, toUtf8Bytes -} from "../utils/index.js"; - - -import { ens_normalize } from "@adraffy/ens-normalize"; - -const Zeros = new Uint8Array(32); -Zeros.fill(0); - -function checkComponent(comp: Uint8Array): Uint8Array { - assertArgument(comp.length !== 0, "invalid ENS name; empty component", "comp", comp) - return comp; -} - -function ensNameSplit(name: string): Array { - const bytes = toUtf8Bytes(ensNormalize(name)); - const comps: Array = [ ]; - - if (name.length === 0) { return comps; } - - let last = 0; - for (let i = 0; i < bytes.length; i++) { - const d = bytes[i]; - - // A separator (i.e. "."); copy this component - if (d === 0x2e) { - comps.push(checkComponent(bytes.slice(last, i))); - last = i + 1; - } - } - - // There was a stray separator at the end of the name - assertArgument(last < bytes.length, "invalid ENS name; empty component", "name", name); - - comps.push(checkComponent(bytes.slice(last))); - return comps; -} - -/** - * Returns the ENS %%name%% normalized. - */ -export function ensNormalize(name: string): string { - try { - if (name.length === 0) { throw new Error("empty label"); } - return ens_normalize(name); - } catch (error: any) { - assertArgument(false, `invalid ENS name (${ error.message })`, "name", name); - } -} - -/** - * Returns ``true`` if %%name%% is a valid ENS name. - */ -export function isValidName(name: string): name is string { - try { - return (ensNameSplit(name).length !== 0); - } catch (error) { } - return false; -} - -/** - * Returns the [[link-namehash]] for %%name%%. - */ -export function namehash(name: string): string { - assertArgument(typeof(name) === "string", "invalid ENS name; not a string", "name", name); - - assertArgument(name.length, `invalid ENS name (empty label)`, "name", name); - - let result: string | Uint8Array = Zeros; - - const comps = ensNameSplit(name); - while (comps.length) { - result = keccak256(concat([ result, keccak256((comps.pop()))] )); - } - - return hexlify(result); -} - -/** - * Returns the DNS encoded %%name%%. - * - * This is used for various parts of ENS name resolution, such - * as the wildcard resolution. - */ -export function dnsEncode(name: string, _maxLength?: number): string { - const length = (_maxLength != null) ? _maxLength: 63; - - assertArgument(length <= 255, "DNS encoded label cannot exceed 255", "length", length); - - return hexlify(concat(ensNameSplit(name).map((comp) => { - assertArgument(comp.length <= length, `label ${ JSON.stringify(name) } exceeds ${ length } bytes`, "name", name); - - const bytes = new Uint8Array(comp.length + 1); - bytes.set(comp, 1); - bytes[0] = bytes.length - 1; - return bytes; - }))) + "00"; -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/hash/solidity.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/hash/solidity.ts deleted file mode 100644 index 6bab1319..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/hash/solidity.ts +++ /dev/null @@ -1,117 +0,0 @@ -import { getAddress } from "../address/index.js"; -import { - keccak256 as _keccak256, sha256 as _sha256 -} from "../crypto/index.js"; -import { - concat, dataLength, getBytes, hexlify, toBeArray, toTwos, toUtf8Bytes, zeroPadBytes, zeroPadValue, - assertArgument -} from "../utils/index.js"; - - -const regexBytes = new RegExp("^bytes([0-9]+)$"); -const regexNumber = new RegExp("^(u?int)([0-9]*)$"); -const regexArray = new RegExp("^(.*)\\[([0-9]*)\\]$"); - - -function _pack(type: string, value: any, isArray?: boolean): Uint8Array { - switch(type) { - case "address": - if (isArray) { return getBytes(zeroPadValue(value, 32)); } - return getBytes(getAddress(value)); - case "string": - return toUtf8Bytes(value); - case "bytes": - return getBytes(value); - case "bool": - value = (!!value ? "0x01": "0x00"); - if (isArray) { return getBytes(zeroPadValue(value, 32)); } - return getBytes(value); - } - - let match = type.match(regexNumber); - if (match) { - let signed = (match[1] === "int"); - let size = parseInt(match[2] || "256") - - assertArgument((!match[2] || match[2] === String(size)) && (size % 8 === 0) && size !== 0 && size <= 256, "invalid number type", "type", type); - - if (isArray) { size = 256; } - - if (signed) { value = toTwos(value, size); } - - return getBytes(zeroPadValue(toBeArray(value), size / 8)); - } - - match = type.match(regexBytes); - if (match) { - const size = parseInt(match[1]); - - assertArgument(String(size) === match[1] && size !== 0 && size <= 32, "invalid bytes type", "type", type); - assertArgument(dataLength(value) === size, `invalid value for ${ type }`, "value", value); - - if (isArray) { return getBytes(zeroPadBytes(value, 32)); } - return value; - } - - match = type.match(regexArray); - if (match && Array.isArray(value)) { - const baseType = match[1]; - const count = parseInt(match[2] || String(value.length)); - assertArgument(count === value.length, `invalid array length for ${ type }`, "value", value); - - const result: Array = []; - value.forEach(function(value) { - result.push(_pack(baseType, value, true)); - }); - return getBytes(concat(result)); - } - - assertArgument(false, "invalid type", "type", type) -} - -// @TODO: Array Enum - -/** - * Computes the [[link-solc-packed]] representation of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPacked([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ -export function solidityPacked(types: ReadonlyArray, values: ReadonlyArray): string { - assertArgument(types.length === values.length, "wrong number of values; expected ${ types.length }", "values", values); - - const tight: Array = []; - types.forEach(function(type, index) { - tight.push(_pack(type, values[index])); - }); - return hexlify(concat(tight)); -} - -/** - * Computes the [[link-solc-packed]] [[keccak256]] hash of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPackedKeccak256([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ -export function solidityPackedKeccak256(types: ReadonlyArray, values: ReadonlyArray): string { - return _keccak256(solidityPacked(types, values)); -} - -/** - * Computes the [[link-solc-packed]] [[sha256]] hash of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPackedSha256([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ -export function solidityPackedSha256(types: ReadonlyArray, values: ReadonlyArray): string { - return _sha256(solidityPacked(types, values)); -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/hash/typed-data.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/hash/typed-data.ts deleted file mode 100644 index a2171078..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/hash/typed-data.ts +++ /dev/null @@ -1,658 +0,0 @@ -//import { TypedDataDomain, TypedDataField } from "@ethersproject/providerabstract-signer"; -import { getAddress } from "../address/index.js"; -import { keccak256 } from "../crypto/index.js"; -import { recoverAddress } from "../transaction/index.js"; -import { - concat, defineProperties, getBigInt, getBytes, hexlify, isHexString, mask, toBeHex, toQuantity, toTwos, zeroPadValue, - assertArgument -} from "../utils/index.js"; - -import { id } from "./id.js"; - -import type { SignatureLike } from "../crypto/index.js"; -import type { BigNumberish, BytesLike } from "../utils/index.js"; - - -const padding = new Uint8Array(32); -padding.fill(0); - -const BN__1 = BigInt(-1); -const BN_0 = BigInt(0); -const BN_1 = BigInt(1); -const BN_MAX_UINT256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); - -// @TODO: in v7, verifyingContract should be an AddressLike and use resolveAddress - -/** - * The domain for an [[link-eip-712]] payload. - */ -export interface TypedDataDomain { - /** - * The human-readable name of the signing domain. - */ - name?: null | string; - - /** - * The major version of the signing domain. - */ - version?: null | string; - - /** - * The chain ID of the signing domain. - */ - chainId?: null | BigNumberish; - - /** - * The the address of the contract that will verify the signature. - */ - verifyingContract?: null | string; - - /** - * A salt used for purposes decided by the specific domain. - */ - salt?: null | BytesLike; -}; - -/** - * A specific field of a structured [[link-eip-712]] type. - */ -export interface TypedDataField { - /** - * The field name. - */ - name: string; - - /** - * The type of the field. - */ - type: string; -}; - -function hexPadRight(value: BytesLike): string { - const bytes = getBytes(value); - const padOffset = bytes.length % 32 - if (padOffset) { - return concat([ bytes, padding.slice(padOffset) ]); - } - return hexlify(bytes); -} - -const hexTrue = toBeHex(BN_1, 32); -const hexFalse = toBeHex(BN_0, 32); - -const domainFieldTypes: Record = { - name: "string", - version: "string", - chainId: "uint256", - verifyingContract: "address", - salt: "bytes32" -}; - -const domainFieldNames: Array = [ - "name", "version", "chainId", "verifyingContract", "salt" -]; - -function checkString(key: string): (value: any) => string { - return function (value: any){ - assertArgument(typeof(value) === "string", `invalid domain value for ${ JSON.stringify(key) }`, `domain.${ key }`, value); - return value; - } -} - -const domainChecks: Record any> = { - name: checkString("name"), - version: checkString("version"), - chainId: function(_value: any) { - const value = getBigInt(_value, "domain.chainId"); - assertArgument(value >= 0, "invalid chain ID", "domain.chainId", _value); - if (Number.isSafeInteger(value)) { return Number(value); } - return toQuantity(value); - }, - verifyingContract: function(value: any) { - try { - return getAddress(value).toLowerCase(); - } catch (error) { } - assertArgument(false, `invalid domain value "verifyingContract"`, "domain.verifyingContract", value); - }, - salt: function(value: any) { - const bytes = getBytes(value, "domain.salt"); - assertArgument(bytes.length === 32, `invalid domain value "salt"`, "domain.salt", value); - return hexlify(bytes); - } -} - -function getBaseEncoder(type: string): null | ((value: any) => string) { - // intXX and uintXX - { - const match = type.match(/^(u?)int(\d+)$/); - if (match) { - const signed = (match[1] === ""); - - const width = parseInt(match[2]); - assertArgument(width % 8 === 0 && width !== 0 && width <= 256 && match[2] === String(width), "invalid numeric width", "type", type); - - const boundsUpper = mask(BN_MAX_UINT256, signed ? (width - 1): width); - const boundsLower = signed ? ((boundsUpper + BN_1) * BN__1): BN_0; - - return function(_value: BigNumberish) { - const value = getBigInt(_value, "value"); - - assertArgument(value >= boundsLower && value <= boundsUpper, `value out-of-bounds for ${ type }`, "value", value); - - return toBeHex(signed ? toTwos(value, 256): value, 32); - }; - } - } - - // bytesXX - { - const match = type.match(/^bytes(\d+)$/); - if (match) { - const width = parseInt(match[1]); - assertArgument(width !== 0 && width <= 32 && match[1] === String(width), "invalid bytes width", "type", type); - - return function(value: BytesLike) { - const bytes = getBytes(value); - assertArgument(bytes.length === width, `invalid length for ${ type }`, "value", value); - return hexPadRight(value); - }; - } - } - - switch (type) { - case "address": return function(value: string) { - return zeroPadValue(getAddress(value), 32); - }; - case "bool": return function(value: boolean) { - return ((!value) ? hexFalse: hexTrue); - }; - case "bytes": return function(value: BytesLike) { - return keccak256(value); - }; - case "string": return function(value: string) { - return id(value); - }; - } - - return null; -} - -function encodeType(name: string, fields: Array): string { - return `${ name }(${ fields.map(({ name, type }) => (type + " " + name)).join(",") })`; -} - -type ArrayResult = { - base: string; // The base type - index?: string; // the full Index (if any) - array?: { // The Array... (if index) - base: string; // ...base type (same as above) - prefix: string; // ...sans the final Index - count: number; // ...the final Index (-1 for dynamic) - } -}; - -// foo[][3] => { base: "foo", index: "[][3]", array: { -// base: "foo", prefix: "foo[]", count: 3 } } -function splitArray(type: string): ArrayResult { - const match = type.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/); - if (match) { - return { - base: match[1], - index: (match[2] + match[4]), - array: { - base: match[1], - prefix: (match[1] + match[2]), - count: (match[5] ? parseInt(match[5]): -1), - } - }; - } - - return { base: type }; -} - -/** - * A **TypedDataEncode** prepares and encodes [[link-eip-712]] payloads - * for signed typed data. - * - * This is useful for those that wish to compute various components of a - * typed data hash, primary types, or sub-components, but generally the - * higher level [[Signer-signTypedData]] is more useful. - */ -export class TypedDataEncoder { - /** - * The primary type for the structured [[types]]. - * - * This is derived automatically from the [[types]], since no - * recursion is possible, once the DAG for the types is consturcted - * internally, the primary type must be the only remaining type with - * no parent nodes. - */ - readonly primaryType!: string; - - readonly #types: string; - - /** - * The types. - */ - get types(): Record> { - return JSON.parse(this.#types); - } - - readonly #fullTypes: Map - - readonly #encoderCache: Map string>; - - /** - * Create a new **TypedDataEncoder** for %%types%%. - * - * This performs all necessary checking that types are valid and - * do not violate the [[link-eip-712]] structural constraints as - * well as computes the [[primaryType]]. - */ - constructor(_types: Record>) { - this.#fullTypes = new Map(); - this.#encoderCache = new Map(); - - // Link struct types to their direct child structs - const links: Map> = new Map(); - - // Link structs to structs which contain them as a child - const parents: Map> = new Map(); - - // Link all subtypes within a given struct - const subtypes: Map> = new Map(); - - const types: Record> = { }; - Object.keys(_types).forEach((type) => { - types[type] = _types[type].map(({ name, type }) => { - - // Normalize the base type (unless name conflict) - let { base, index } = splitArray(type); - if (base === "int" && !_types["int"]) { base = "int256"; } - if (base === "uint" && !_types["uint"]) { base = "uint256"; } - - return { name, type: (base + (index || "")) }; - }); - - links.set(type, new Set()); - parents.set(type, [ ]); - subtypes.set(type, new Set()); - }); - this.#types = JSON.stringify(types); - - for (const name in types) { - const uniqueNames: Set = new Set(); - - for (const field of types[name]) { - - // Check each field has a unique name - assertArgument(!uniqueNames.has(field.name), `duplicate variable name ${ JSON.stringify(field.name) } in ${ JSON.stringify(name) }`, "types", _types); - uniqueNames.add(field.name); - - // Get the base type (drop any array specifiers) - const baseType = splitArray(field.type).base; - assertArgument(baseType !== name, `circular type reference to ${ JSON.stringify(baseType) }`, "types", _types); - - // Is this a base encoding type? - const encoder = getBaseEncoder(baseType); - if (encoder) { continue; } - - assertArgument(parents.has(baseType), `unknown type ${ JSON.stringify(baseType) }`, "types", _types); - - // Add linkage - (parents.get(baseType) as Array).push(name); - (links.get(name) as Set).add(baseType); - } - } - - // Deduce the primary type - const primaryTypes = Array.from(parents.keys()).filter((n) => ((parents.get(n) as Array).length === 0)); - assertArgument(primaryTypes.length !== 0, "missing primary type", "types", _types); - assertArgument(primaryTypes.length === 1, `ambiguous primary types or unused types: ${ primaryTypes.map((t) => (JSON.stringify(t))).join(", ") }`, "types", _types); - - defineProperties(this, { primaryType: primaryTypes[0] }); - - // Check for circular type references - function checkCircular(type: string, found: Set) { - assertArgument(!found.has(type), `circular type reference to ${ JSON.stringify(type) }`, "types", _types); - - found.add(type); - - for (const child of (links.get(type) as Set)) { - if (!parents.has(child)) { continue; } - - // Recursively check children - checkCircular(child, found); - - // Mark all ancestors as having this decendant - for (const subtype of found) { - (subtypes.get(subtype) as Set).add(child); - } - } - - found.delete(type); - } - checkCircular(this.primaryType, new Set()); - - // Compute each fully describe type - for (const [ name, set ] of subtypes) { - const st = Array.from(set); - st.sort(); - this.#fullTypes.set(name, encodeType(name, types[name]) + st.map((t) => encodeType(t, types[t])).join("")); - } - } - - /** - * Returnthe encoder for the specific %%type%%. - */ - getEncoder(type: string): (value: any) => string { - let encoder = this.#encoderCache.get(type); - if (!encoder) { - encoder = this.#getEncoder(type); - this.#encoderCache.set(type, encoder); - } - return encoder; - } - - #getEncoder(type: string): (value: any) => string { - - // Basic encoder type (address, bool, uint256, etc) - { - const encoder = getBaseEncoder(type); - if (encoder) { return encoder; } - } - - // Array - const array = splitArray(type).array; - if (array) { - const subtype = array.prefix; - const subEncoder = this.getEncoder(subtype); - return (value: Array) => { - assertArgument(array.count === -1 || array.count === value.length, `array length mismatch; expected length ${ array.count }`, "value", value); - - let result = value.map(subEncoder); - if (this.#fullTypes.has(subtype)) { - result = result.map(keccak256); - } - - return keccak256(concat(result)); - }; - } - - // Struct - const fields = this.types[type]; - if (fields) { - const encodedType = id(this.#fullTypes.get(type) as string); - return (value: Record) => { - const values = fields.map(({ name, type }) => { - const result = this.getEncoder(type)(value[name]); - if (this.#fullTypes.has(type)) { return keccak256(result); } - return result; - }); - values.unshift(encodedType); - return concat(values); - } - } - - assertArgument(false, `unknown type: ${ type }`, "type", type); - } - - /** - * Return the full type for %%name%%. - */ - encodeType(name: string): string { - const result = this.#fullTypes.get(name); - assertArgument(result, `unknown type: ${ JSON.stringify(name) }`, "name", name); - return result; - } - - /** - * Return the encoded %%value%% for the %%type%%. - */ - encodeData(type: string, value: any): string { - return this.getEncoder(type)(value); - } - - /** - * Returns the hash of %%value%% for the type of %%name%%. - */ - hashStruct(name: string, value: Record): string { - return keccak256(this.encodeData(name, value)); - } - - /** - * Return the fulled encoded %%value%% for the [[types]]. - */ - encode(value: Record): string { - return this.encodeData(this.primaryType, value); - } - - /** - * Return the hash of the fully encoded %%value%% for the [[types]]. - */ - hash(value: Record): string { - return this.hashStruct(this.primaryType, value); - } - - /** - * @_ignore: - */ - _visit(type: string, value: any, callback: (type: string, data: any) => any): any { - // Basic encoder type (address, bool, uint256, etc) - { - const encoder = getBaseEncoder(type); - if (encoder) { return callback(type, value); } - } - - // Array - const array = splitArray(type).array; - if (array) { - assertArgument(array.count === -1 || array.count === value.length, `array length mismatch; expected length ${ array.count }`, "value", value); - return value.map((v: any) => this._visit(array.prefix, v, callback)); - } - - // Struct - const fields = this.types[type]; - if (fields) { - return fields.reduce((accum, { name, type }) => { - accum[name] = this._visit(type, value[name], callback); - return accum; - }, >{}); - } - - assertArgument(false, `unknown type: ${ type }`, "type", type); - } - - /** - * Call %%calback%% for each value in %%value%%, passing the type and - * component within %%value%%. - * - * This is useful for replacing addresses or other transformation that - * may be desired on each component, based on its type. - */ - visit(value: Record, callback: (type: string, data: any) => any): any { - return this._visit(this.primaryType, value, callback); - } - - /** - * Create a new **TypedDataEncoder** for %%types%%. - */ - static from(types: Record>): TypedDataEncoder { - return new TypedDataEncoder(types); - } - - /** - * Return the primary type for %%types%%. - */ - static getPrimaryType(types: Record>): string { - return TypedDataEncoder.from(types).primaryType; - } - - /** - * Return the hashed struct for %%value%% using %%types%% and %%name%%. - */ - static hashStruct(name: string, types: Record>, value: Record): string { - return TypedDataEncoder.from(types).hashStruct(name, value); - } - - /** - * Return the domain hash for %%domain%%. - */ - static hashDomain(domain: TypedDataDomain): string { - const domainFields: Array = [ ]; - for (const name in domain) { - if ((>domain)[name] == null) { continue; } - const type = domainFieldTypes[name]; - assertArgument(type, `invalid typed-data domain key: ${ JSON.stringify(name) }`, "domain", domain); - domainFields.push({ name, type }); - } - - domainFields.sort((a, b) => { - return domainFieldNames.indexOf(a.name) - domainFieldNames.indexOf(b.name); - }); - - return TypedDataEncoder.hashStruct("EIP712Domain", { EIP712Domain: domainFields }, domain); - } - - /** - * Return the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%. - */ - static encode(domain: TypedDataDomain, types: Record>, value: Record): string { - return concat([ - "0x1901", - TypedDataEncoder.hashDomain(domain), - TypedDataEncoder.from(types).hash(value) - ]); - } - - /** - * Return the hash of the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%. - */ - static hash(domain: TypedDataDomain, types: Record>, value: Record): string { - return keccak256(TypedDataEncoder.encode(domain, types, value)); - } - - // Replaces all address types with ENS names with their looked up address - /** - * Resolves to the value from resolving all addresses in %%value%% for - * %%types%% and the %%domain%%. - */ - static async resolveNames(domain: TypedDataDomain, types: Record>, value: Record, resolveName: (name: string) => Promise): Promise<{ domain: TypedDataDomain, value: any }> { - // Make a copy to isolate it from the object passed in - domain = Object.assign({ }, domain); - - // Allow passing null to ignore value - for (const key in domain) { - if ((>domain)[key] == null) { - delete (>domain)[key]; - } - } - - // Look up all ENS names - const ensCache: Record = { }; - - // Do we need to look up the domain's verifyingContract? - if (domain.verifyingContract && !isHexString(domain.verifyingContract, 20)) { - ensCache[domain.verifyingContract] = "0x"; - } - - // We are going to use the encoder to visit all the base values - const encoder = TypedDataEncoder.from(types); - - // Get a list of all the addresses - encoder.visit(value, (type: string, value: any) => { - if (type === "address" && !isHexString(value, 20)) { - ensCache[value] = "0x"; - } - return value; - }); - - // Lookup each name - for (const name in ensCache) { - ensCache[name] = await resolveName(name); - } - - // Replace the domain verifyingContract if needed - if (domain.verifyingContract && ensCache[domain.verifyingContract]) { - domain.verifyingContract = ensCache[domain.verifyingContract]; - } - - // Replace all ENS names with their address - value = encoder.visit(value, (type: string, value: any) => { - if (type === "address" && ensCache[value]) { return ensCache[value]; } - return value; - }); - - return { domain, value }; - } - - /** - * Returns the JSON-encoded payload expected by nodes which implement - * the JSON-RPC [[link-eip-712]] method. - */ - static getPayload(domain: TypedDataDomain, types: Record>, value: Record): any { - // Validate the domain fields - TypedDataEncoder.hashDomain(domain); - - // Derive the EIP712Domain Struct reference type - const domainValues: Record = { }; - const domainTypes: Array<{ name: string, type:string }> = [ ]; - - domainFieldNames.forEach((name) => { - const value = (domain)[name]; - if (value == null) { return; } - domainValues[name] = domainChecks[name](value); - domainTypes.push({ name, type: domainFieldTypes[name] }); - }); - - const encoder = TypedDataEncoder.from(types); - - // Get the normalized types - types = encoder.types; - - const typesWithDomain = Object.assign({ }, types); - assertArgument(typesWithDomain.EIP712Domain == null, "types must not contain EIP712Domain type", "types.EIP712Domain", types); - - typesWithDomain.EIP712Domain = domainTypes; - - // Validate the data structures and types - encoder.encode(value); - - return { - types: typesWithDomain, - domain: domainValues, - primaryType: encoder.primaryType, - message: encoder.visit(value, (type: string, value: any) => { - - // bytes - if (type.match(/^bytes(\d*)/)) { - return hexlify(getBytes(value)); - } - - // uint or int - if (type.match(/^u?int/)) { - return getBigInt(value).toString(); - } - - switch (type) { - case "address": - return value.toLowerCase(); - case "bool": - return !!value; - case "string": - assertArgument(typeof(value) === "string", "invalid string", "value", value); - return value; - } - - assertArgument(false, "unsupported type", "type", type); - }) - }; - } -} - -/** - * Compute the address used to sign the typed data for the %%signature%%. - */ -export function verifyTypedData(domain: TypedDataDomain, types: Record>, value: Record, signature: SignatureLike): string { - return recoverAddress(TypedDataEncoder.hash(domain, types, value), signature); -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/index.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/index.ts deleted file mode 100644 index 40496f1f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * The Application Programming Interface (API) is the collection of - * functions, classes and types offered by the Ethers library. - * - * @_section: api:Application Programming Interface [about-api] - * @_navTitle: API - */ -import * as ethers from "./ethers.js"; - -export { ethers }; - -export * from "./ethers.js"; diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/abstract-provider.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/abstract-provider.ts deleted file mode 100644 index 0d75b435..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/abstract-provider.ts +++ /dev/null @@ -1,1761 +0,0 @@ -/** - * The available providers should suffice for most developers purposes, - * but the [[AbstractProvider]] class has many features which enable - * sub-classing it for specific purposes. - * - * @_section: api/providers/abstract-provider: Subclassing Provider [abstract-provider] - */ - -// @TODO -// Event coalescence -// When we register an event with an async value (e.g. address is a Signer -// or ENS name), we need to add it immeidately for the Event API, but also -// need time to resolve the address. Upon resolving the address, we need to -// migrate the listener to the static event. We also need to maintain a map -// of Signer/ENS name to address so we can sync respond to listenerCount. - -import { getAddress, resolveAddress } from "../address/index.js"; -import { ZeroAddress } from "../constants/index.js"; -import { Contract } from "../contract/index.js"; -import { namehash } from "../hash/index.js"; -import { Transaction } from "../transaction/index.js"; -import { - concat, dataLength, dataSlice, hexlify, isHexString, - getBigInt, getBytes, getNumber, - isCallException, isError, makeError, assert, assertArgument, - FetchRequest, - toBeArray, toQuantity, - defineProperties, EventPayload, resolveProperties, - toUtf8String -} from "../utils/index.js"; - -import { EnsResolver } from "./ens-resolver.js"; -import { - formatBlock, formatLog, formatTransactionReceipt, formatTransactionResponse -} from "./format.js"; -import { Network } from "./network.js"; -import { copyRequest, Block, FeeData, Log, TransactionReceipt, TransactionResponse } from "./provider.js"; -import { - PollingBlockSubscriber, PollingBlockTagSubscriber, PollingEventSubscriber, - PollingOrphanSubscriber, PollingTransactionSubscriber -} from "./subscriber-polling.js"; - -import type { Addressable, AddressLike } from "../address/index.js"; -import type { BigNumberish, BytesLike } from "../utils/index.js"; -import type { FetchResponse, Listener } from "../utils/index.js"; - -import type { Networkish } from "./network.js"; -import type { FetchUrlFeeDataNetworkPlugin } from "./plugins-network.js"; -//import type { MaxPriorityFeePlugin } from "./plugins-network.js"; -import type { - BlockParams, LogParams, TransactionReceiptParams, - TransactionResponseParams -} from "./formatting.js"; - -import type { - BlockTag, EventFilter, Filter, FilterByBlockHash, OrphanFilter, - PreparedTransactionRequest, Provider, ProviderEvent, - TransactionRequest -} from "./provider.js"; - -type Timer = ReturnType; - - -// Constants -const BN_2 = BigInt(2); - -const MAX_CCIP_REDIRECTS = 10; - -function isPromise(value: any): value is Promise { - return (value && typeof(value.then) === "function"); -} - -function getTag(prefix: string, value: any): string { - return prefix + ":" + JSON.stringify(value, (k, v) => { - if (v == null) { return "null"; } - if (typeof(v) === "bigint") { return `bigint:${ v.toString() }`} - if (typeof(v) === "string") { return v.toLowerCase(); } - - // Sort object keys - if (typeof(v) === "object" && !Array.isArray(v)) { - const keys = Object.keys(v); - keys.sort(); - return keys.reduce((accum, key) => { - accum[key] = v[key]; - return accum; - }, { }); - } - - return v; - }); -} - -/** - * The types of additional event values that can be emitted for the - * ``"debug"`` event. - */ -export type DebugEventAbstractProvider = { - action: "sendCcipReadFetchRequest", - request: FetchRequest - index: number - urls: Array -} | { - action: "receiveCcipReadFetchResult", - request: FetchRequest, - result: any -} | { - action: "receiveCcipReadFetchError", - request: FetchRequest, - result: any -} | { - action: "sendCcipReadCall", - transaction: { to: string, data: string } -} | { - action: "receiveCcipReadCallResult", - transaction: { to: string, data: string } - result: string -} | { - action: "receiveCcipReadCallError", - transaction: { to: string, data: string } - error: Error -}; - - -/** - * The value passed to the [[AbstractProvider-_getSubscriber]] method. - * - * Only developers sub-classing [[AbstractProvider[[ will care about this, - * if they are modifying a low-level feature of how subscriptions operate. - */ -export type Subscription = { - type: "block" | "close" | "debug" | "error" | "finalized" | "network" | "pending" | "safe", - tag: string -} | { - type: "transaction", - tag: string, - hash: string -} | { - type: "event", - tag: string, - filter: EventFilter -} | { - type: "orphan", - tag: string, - filter: OrphanFilter -}; - -/** - * A **Subscriber** manages a subscription. - * - * Only developers sub-classing [[AbstractProvider[[ will care about this, - * if they are modifying a low-level feature of how subscriptions operate. - */ -export interface Subscriber { - /** - * Called initially when a subscriber is added the first time. - */ - start(): void; - - /** - * Called when there are no more subscribers to the event. - */ - stop(): void; - - /** - * Called when the subscription should pause. - * - * If %%dropWhilePaused%%, events that occur while paused should not - * be emitted [[resume]]. - */ - pause(dropWhilePaused?: boolean): void; - - /** - * Resume a paused subscriber. - */ - resume(): void; - - /** - * The frequency (in ms) to poll for events, if polling is used by - * the subscriber. - * - * For non-polling subscribers, this must return ``undefined``. - */ - pollingInterval?: number; -} - -/** - * An **UnmanagedSubscriber** is useful for events which do not require - * any additional management, such as ``"debug"`` which only requires - * emit in synchronous event loop triggered calls. - */ -export class UnmanagedSubscriber implements Subscriber { - /** - * The name fof the event. - */ - name!: string; - - /** - * Create a new UnmanagedSubscriber with %%name%%. - */ - constructor(name: string) { defineProperties(this, { name }); } - - start(): void { } - stop(): void { } - - pause(dropWhilePaused?: boolean): void { } - resume(): void { } -} - -type Sub = { - tag: string; - nameMap: Map - addressableMap: WeakMap; - listeners: Array<{ listener: Listener, once: boolean }>; - // @TODO: get rid of this, as it is (and has to be) - // tracked in subscriber - started: boolean; - subscriber: Subscriber; -}; - -function copy(value: T): T { - return JSON.parse(JSON.stringify(value)); -} - -function concisify(items: Array): Array { - items = Array.from((new Set(items)).values()) - items.sort(); - return items; -} - - -async function getSubscription(_event: ProviderEvent, provider: AbstractProvider): Promise { - if (_event == null) { throw new Error("invalid event"); } - - // Normalize topic array info an EventFilter - if (Array.isArray(_event)) { _event = { topics: _event }; } - - if (typeof(_event) === "string") { - switch (_event) { - case "block": - case "debug": - case "error": - case "finalized": - case "network": - case "pending": - case "safe": { - return { type: _event, tag: _event }; - } - } - } - - if (isHexString(_event, 32)) { - const hash = _event.toLowerCase(); - return { type: "transaction", tag: getTag("tx", { hash }), hash }; - } - - if ((_event).orphan) { - const event = _event; - // @TODO: Should lowercase and whatnot things here instead of copy... - return { type: "orphan", tag: getTag("orphan", event), filter: copy(event) }; - } - - if (((_event).address || (_event).topics)) { - const event = _event; - - const filter: any = { - topics: ((event.topics || []).map((t) => { - if (t == null) { return null; } - if (Array.isArray(t)) { - return concisify(t.map((t) => t.toLowerCase())); - } - return t.toLowerCase(); - })) - }; - - if (event.address) { - const addresses: Array = [ ]; - const promises: Array> = [ ]; - - const addAddress = (addr: AddressLike) => { - if (isHexString(addr)) { - addresses.push(addr); - } else { - promises.push((async () => { - addresses.push(await resolveAddress(addr, provider)); - })()); - } - } - - if (Array.isArray(event.address)) { - event.address.forEach(addAddress); - } else { - addAddress(event.address); - } - if (promises.length) { await Promise.all(promises); } - filter.address = concisify(addresses.map((a) => a.toLowerCase())); - } - - return { filter, tag: getTag("event", filter), type: "event" }; - } - - assertArgument(false, "unknown ProviderEvent", "event", _event); -} - -function getTime(): number { return (new Date()).getTime(); } - -/** - * An **AbstractPlugin** is used to provide additional internal services - * to an [[AbstractProvider]] without adding backwards-incompatible changes - * to method signatures or other internal and complex logic. - */ -export interface AbstractProviderPlugin { - /** - * The reverse domain notation of the plugin. - */ - readonly name: string; - - /** - * Creates a new instance of the plugin, connected to %%provider%%. - */ - connect(provider: AbstractProvider): AbstractProviderPlugin; -} - -/** - * A normalized filter used for [[PerformActionRequest]] objects. - */ -export type PerformActionFilter = { - address?: string | Array; - topics?: Array>; - fromBlock?: BlockTag; - toBlock?: BlockTag; -} | { - address?: string | Array; - topics?: Array>; - blockHash?: string; -}; - -/** - * A normalized transactions used for [[PerformActionRequest]] objects. - */ -export interface PerformActionTransaction extends PreparedTransactionRequest { - /** - * The ``to`` address of the transaction. - */ - to?: string; - - /** - * The sender of the transaction. - */ - from?: string; -} - -/** - * The [[AbstractProvider]] methods will normalize all values and pass this - * type to [[AbstractProvider-_perform]]. - */ -export type PerformActionRequest = { - method: "broadcastTransaction", - signedTransaction: string -} | { - method: "call", - transaction: PerformActionTransaction, blockTag: BlockTag -} | { - method: "chainId" -} | { - method: "estimateGas", - transaction: PerformActionTransaction -} | { - method: "getBalance", - address: string, blockTag: BlockTag -} | { - method: "getBlock", - blockTag: BlockTag, includeTransactions: boolean -} | { - method: "getBlock", - blockHash: string, includeTransactions: boolean -} | { - method: "getBlockNumber" -} | { - method: "getCode", - address: string, blockTag: BlockTag -} | { - method: "getGasPrice" -} | { - method: "getLogs", - filter: PerformActionFilter -} | { - method: "getPriorityFee" -} | { - method: "getStorage", - address: string, position: bigint, blockTag: BlockTag -} | { - method: "getTransaction", - hash: string -} | { - method: "getTransactionCount", - address: string, blockTag: BlockTag -} | { - method: "getTransactionReceipt", - hash: string -} | { - method: "getTransactionResult", - hash: string -}; - -type _PerformAccountRequest = { - method: "getBalance" | "getTransactionCount" | "getCode" -} | { - method: "getStorage", position: bigint -} - -/** - * Options for configuring some internal aspects of an [[AbstractProvider]]. - * - * **``cacheTimeout``** - how long to cache a low-level ``_perform`` - * for, based on input parameters. This reduces the number of calls - * to getChainId and getBlockNumber, but may break test chains which - * can perform operations (internally) synchronously. Use ``-1`` to - * disable, ``0`` will only buffer within the same event loop and - * any other value is in ms. (default: ``250``) - */ -export type AbstractProviderOptions = { - cacheTimeout?: number; - pollingInterval?: number; -}; - -const defaultOptions = { - cacheTimeout: 250, - pollingInterval: 4000 -}; - -type CcipArgs = { - sender: string; - urls: Array; - calldata: string; - selector: string; - extraData: string; - errorArgs: Array -}; - -/** - * An **AbstractProvider** provides a base class for other sub-classes to - * implement the [[Provider]] API by normalizing input arguments and - * formatting output results as well as tracking events for consistent - * behaviour on an eventually-consistent network. - */ -export class AbstractProvider implements Provider { - - #subs: Map; - #plugins: Map; - - // null=unpaused, true=paused+dropWhilePaused, false=paused - #pausedState: null | boolean; - - #destroyed: boolean; - - #networkPromise: null | Promise; - readonly #anyNetwork: boolean; - - #performCache: Map>; - - // The most recent block number if running an event or -1 if no "block" event - #lastBlockNumber: number; - - #nextTimer: number; - #timers: Map void, time: number }>; - - #disableCcipRead: boolean; - - #options: Required; - - /** - * Create a new **AbstractProvider** connected to %%network%%, or - * use the various network detection capabilities to discover the - * [[Network]] if necessary. - */ - constructor(_network?: "any" | Networkish, options?: AbstractProviderOptions) { - this.#options = Object.assign({ }, defaultOptions, options || { }); - - if (_network === "any") { - this.#anyNetwork = true; - this.#networkPromise = null; - } else if (_network) { - const network = Network.from(_network); - this.#anyNetwork = false; - this.#networkPromise = Promise.resolve(network); - setTimeout(() => { this.emit("network", network, null); }, 0); - } else { - this.#anyNetwork = false; - this.#networkPromise = null; - } - - this.#lastBlockNumber = -1; - - this.#performCache = new Map(); - - this.#subs = new Map(); - this.#plugins = new Map(); - this.#pausedState = null; - - this.#destroyed = false; - - this.#nextTimer = 1; - this.#timers = new Map(); - - this.#disableCcipRead = false; - } - - get pollingInterval(): number { return this.#options.pollingInterval; } - - /** - * Returns ``this``, to allow an **AbstractProvider** to implement - * the [[ContractRunner]] interface. - */ - get provider(): this { return this; } - - /** - * Returns all the registered plug-ins. - */ - get plugins(): Array { - return Array.from(this.#plugins.values()); - } - - /** - * Attach a new plug-in. - */ - attachPlugin(plugin: AbstractProviderPlugin): this { - if (this.#plugins.get(plugin.name)) { - throw new Error(`cannot replace existing plugin: ${ plugin.name } `); - } - this.#plugins.set(plugin.name, plugin.connect(this)); - return this; - } - - /** - * Get a plugin by name. - */ - getPlugin(name: string): null | T { - return (this.#plugins.get(name)) || null; - } - - /** - * Prevent any CCIP-read operation, regardless of whether requested - * in a [[call]] using ``enableCcipRead``. - */ - get disableCcipRead(): boolean { return this.#disableCcipRead; } - set disableCcipRead(value: boolean) { this.#disableCcipRead = !!value; } - - // Shares multiple identical requests made during the same 250ms - async #perform(req: PerformActionRequest): Promise { - const timeout = this.#options.cacheTimeout; - - // Caching disabled - if (timeout < 0) { return await this._perform(req); } - - // Create a tag - const tag = getTag(req.method, req); - - let perform = this.#performCache.get(tag); - if (!perform) { - perform = this._perform(req); - - this.#performCache.set(tag, perform); - - setTimeout(() => { - if (this.#performCache.get(tag) === perform) { - this.#performCache.delete(tag); - } - }, timeout); - } - - return await perform; - } - - /** - * Resolves to the data for executing the CCIP-read operations. - */ - async ccipReadFetch(tx: PerformActionTransaction, calldata: string, urls: Array): Promise { - if (this.disableCcipRead || urls.length === 0 || tx.to == null) { return null; } - - const sender = tx.to.toLowerCase(); - const data = calldata.toLowerCase(); - - const errorMessages: Array = [ ]; - - for (let i = 0; i < urls.length; i++) { - const url = urls[i]; - - // URL expansion - const href = url.replace("{sender}", sender).replace("{data}", data); - - // If no {data} is present, use POST; otherwise GET - //const json: string | null = (url.indexOf("{data}") >= 0) ? null: JSON.stringify({ data, sender }); - - //const result = await fetchJson({ url: href, errorPassThrough: true }, json, (value, response) => { - // value.status = response.statusCode; - // return value; - //}); - const request = new FetchRequest(href); - if (url.indexOf("{data}") === -1) { - request.body = { data, sender }; - } - - this.emit("debug", { action: "sendCcipReadFetchRequest", request, index: i, urls }); - - let errorMessage = "unknown error"; - - // Fetch the resource... - let resp: FetchResponse; - try { - resp = await request.send(); - } catch (error: any) { - // ...low-level fetch error (missing host, bad SSL, etc.), - // so try next URL - errorMessages.push(error.message); - this.emit("debug", { action: "receiveCcipReadFetchError", request, result: { error } }); - continue; - } - - try { - const result = resp.bodyJson; - if (result.data) { - this.emit("debug", { action: "receiveCcipReadFetchResult", request, result }); - return result.data; - } - if (result.message) { errorMessage = result.message; } - this.emit("debug", { action: "receiveCcipReadFetchError", request, result }); - } catch (error) { } - - // 4xx indicates the result is not present; stop - assert(resp.statusCode < 400 || resp.statusCode >= 500, `response not found during CCIP fetch: ${ errorMessage }`, - "OFFCHAIN_FAULT", { reason: "404_MISSING_RESOURCE", transaction: tx, info: { url, errorMessage } }); - - // 5xx indicates server issue; try the next url - errorMessages.push(errorMessage); - } - - assert(false, `error encountered during CCIP fetch: ${ errorMessages.map((m) => JSON.stringify(m)).join(", ") }`, "OFFCHAIN_FAULT", { - reason: "500_SERVER_ERROR", - transaction: tx, info: { urls, errorMessages } - }); - } - - /** - * Provides the opportunity for a sub-class to wrap a block before - * returning it, to add additional properties or an alternate - * sub-class of [[Block]]. - */ - _wrapBlock(value: BlockParams, network: Network): Block { - return new Block(formatBlock(value), this); - } - - /** - * Provides the opportunity for a sub-class to wrap a log before - * returning it, to add additional properties or an alternate - * sub-class of [[Log]]. - */ - _wrapLog(value: LogParams, network: Network): Log { - return new Log(formatLog(value), this); - } - - /** - * Provides the opportunity for a sub-class to wrap a transaction - * receipt before returning it, to add additional properties or an - * alternate sub-class of [[TransactionReceipt]]. - */ - _wrapTransactionReceipt(value: TransactionReceiptParams, network: Network): TransactionReceipt { - return new TransactionReceipt(formatTransactionReceipt(value), this); - } - - /** - * Provides the opportunity for a sub-class to wrap a transaction - * response before returning it, to add additional properties or an - * alternate sub-class of [[TransactionResponse]]. - */ - _wrapTransactionResponse(tx: TransactionResponseParams, network: Network): TransactionResponse { - return new TransactionResponse(formatTransactionResponse(tx), this); - } - - /** - * Resolves to the Network, forcing a network detection using whatever - * technique the sub-class requires. - * - * Sub-classes **must** override this. - */ - _detectNetwork(): Promise { - assert(false, "sub-classes must implement this", "UNSUPPORTED_OPERATION", { - operation: "_detectNetwork" - }); - } - - /** - * Sub-classes should use this to perform all built-in operations. All - * methods sanitizes and normalizes the values passed into this. - * - * Sub-classes **must** override this. - */ - async _perform(req: PerformActionRequest): Promise { - assert(false, `unsupported method: ${ req.method }`, "UNSUPPORTED_OPERATION", { - operation: req.method, - info: req - }); - } - - // State - - async getBlockNumber(): Promise { - const blockNumber = getNumber(await this.#perform({ method: "getBlockNumber" }), "%response"); - if (this.#lastBlockNumber >= 0) { this.#lastBlockNumber = blockNumber; } - return blockNumber; - } - - /** - * Returns or resolves to the address for %%address%%, resolving ENS - * names and [[Addressable]] objects and returning if already an - * address. - */ - _getAddress(address: AddressLike): string | Promise { - return resolveAddress(address, this); - } - - /** - * Returns or resolves to a valid block tag for %%blockTag%%, resolving - * negative values and returning if already a valid block tag. - */ - _getBlockTag(blockTag?: BlockTag): string | Promise { - if (blockTag == null) { return "latest"; } - - switch (blockTag) { - case "earliest": - return "0x0"; - case "finalized": - case "latest": - case "pending": - case "safe": - return blockTag; - } - - - if (isHexString(blockTag)) { - if (isHexString(blockTag, 32)) { return blockTag; } - return toQuantity(blockTag); - } - - if (typeof(blockTag) === "bigint") { - blockTag = getNumber(blockTag, "blockTag"); - } - - if (typeof(blockTag) === "number") { - if (blockTag >= 0) { return toQuantity(blockTag); } - if (this.#lastBlockNumber >= 0) { return toQuantity(this.#lastBlockNumber + blockTag); } - return this.getBlockNumber().then((b) => toQuantity(b + blockTag)); - } - - assertArgument(false, "invalid blockTag", "blockTag", blockTag); - } - - /** - * Returns or resolves to a filter for %%filter%%, resolving any ENS - * names or [[Addressable]] object and returning if already a valid - * filter. - */ - _getFilter(filter: Filter | FilterByBlockHash): PerformActionFilter | Promise { - - // Create a canonical representation of the topics - const topics = (filter.topics || [ ]).map((t) => { - if (t == null) { return null; } - if (Array.isArray(t)) { - return concisify(t.map((t) => t.toLowerCase())); - } - return t.toLowerCase(); - }); - - const blockHash = ("blockHash" in filter) ? filter.blockHash: undefined; - - const resolve = (_address: Array, fromBlock?: string, toBlock?: string) => { - let address: undefined | string | Array = undefined; - switch (_address.length) { - case 0: break; - case 1: - address = _address[0]; - break; - default: - _address.sort(); - address = _address; - } - - if (blockHash) { - if (fromBlock != null || toBlock != null) { - throw new Error("invalid filter"); - } - } - - const filter = { }; - if (address) { filter.address = address; } - if (topics.length) { filter.topics = topics; } - if (fromBlock) { filter.fromBlock = fromBlock; } - if (toBlock) { filter.toBlock = toBlock; } - if (blockHash) { filter.blockHash = blockHash; } - - return filter; - }; - - // Addresses could be async (ENS names or Addressables) - let address: Array> = [ ]; - if (filter.address) { - if (Array.isArray(filter.address)) { - for (const addr of filter.address) { address.push(this._getAddress(addr)); } - } else { - address.push(this._getAddress(filter.address)); - } - } - - let fromBlock: undefined | string | Promise = undefined; - if ("fromBlock" in filter) { fromBlock = this._getBlockTag(filter.fromBlock); } - - let toBlock: undefined | string | Promise = undefined; - if ("toBlock" in filter) { toBlock = this._getBlockTag(filter.toBlock); } - - if (address.filter((a) => (typeof(a) !== "string")).length || - (fromBlock != null && typeof(fromBlock) !== "string") || - (toBlock != null && typeof(toBlock) !== "string")) { - - return Promise.all([ Promise.all(address), fromBlock, toBlock ]).then((result) => { - return resolve(result[0], result[1], result[2]); - }); - } - - return resolve(>address, fromBlock, toBlock); - } - - /** - * Returns or resolves to a transaction for %%request%%, resolving - * any ENS names or [[Addressable]] and returning if already a valid - * transaction. - */ - _getTransactionRequest(_request: TransactionRequest): PerformActionTransaction | Promise { - const request = copyRequest(_request); - - const promises: Array> = [ ]; - [ "to", "from" ].forEach((key) => { - if ((request)[key] == null) { return; } - - const addr = resolveAddress((request)[key], this); - if (isPromise(addr)) { - promises.push((async function() { (request)[key] = await addr; })()); - } else { - (request)[key] = addr; - } - }); - - if (request.blockTag != null) { - const blockTag = this._getBlockTag(request.blockTag); - if (isPromise(blockTag)) { - promises.push((async function() { request.blockTag = await blockTag; })()); - } else { - request.blockTag = blockTag; - } - } - - if (promises.length) { - return (async function() { - await Promise.all(promises); - return request; - })(); - } - - return request; - } - - async getNetwork(): Promise { - - // No explicit network was set and this is our first time - if (this.#networkPromise == null) { - - // Detect the current network (shared with all calls) - const detectNetwork = (async () => { - try { - const network = await this._detectNetwork(); - this.emit("network", network, null); - return network; - } catch (error) { - if (this.#networkPromise === detectNetwork!) { - this.#networkPromise = null; - } - throw error; - } - })(); - - this.#networkPromise = detectNetwork; - return (await detectNetwork).clone(); - } - - const networkPromise = this.#networkPromise; - - const [ expected, actual ] = await Promise.all([ - networkPromise, // Possibly an explicit Network - this._detectNetwork() // The actual connected network - ]); - - if (expected.chainId !== actual.chainId) { - if (this.#anyNetwork) { - // The "any" network can change, so notify listeners - this.emit("network", actual, expected); - - // Update the network if something else hasn't already changed it - if (this.#networkPromise === networkPromise) { - this.#networkPromise = Promise.resolve(actual); - } - } else { - // Otherwise, we do not allow changes to the underlying network - assert(false, `network changed: ${ expected.chainId } => ${ actual.chainId } `, "NETWORK_ERROR", { - event: "changed" - }); - } - } - - return expected.clone(); - } - - async getFeeData(): Promise { - const network = await this.getNetwork(); - - const getFeeDataFunc = async () => { - const { _block, gasPrice, priorityFee } = await resolveProperties({ - _block: this.#getBlock("latest", false), - gasPrice: ((async () => { - try { - const value = await this.#perform({ method: "getGasPrice" }); - return getBigInt(value, "%response"); - } catch (error) { } - return null - })()), - priorityFee: ((async () => { - try { - const value = await this.#perform({ method: "getPriorityFee" }); - return getBigInt(value, "%response"); - } catch (error) { } - return null; - })()) - }); - - let maxFeePerGas: null | bigint = null; - let maxPriorityFeePerGas: null | bigint = null; - - // These are the recommended EIP-1559 heuristics for fee data - const block = this._wrapBlock(_block, network); - if (block && block.baseFeePerGas) { - maxPriorityFeePerGas = (priorityFee != null) ? priorityFee: BigInt("1000000000"); - maxFeePerGas = (block.baseFeePerGas * BN_2) + maxPriorityFeePerGas; - } - - return new FeeData(gasPrice, maxFeePerGas, maxPriorityFeePerGas); - }; - - // Check for a FeeDataNetWorkPlugin - const plugin = network.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin"); - if (plugin) { - const req = new FetchRequest(plugin.url); - const feeData = await plugin.processFunc(getFeeDataFunc, this, req); - return new FeeData(feeData.gasPrice, feeData.maxFeePerGas, feeData.maxPriorityFeePerGas); - } - - return await getFeeDataFunc(); - } - - - async estimateGas(_tx: TransactionRequest): Promise { - let tx = this._getTransactionRequest(_tx); - if (isPromise(tx)) { tx = await tx; } - return getBigInt(await this.#perform({ - method: "estimateGas", transaction: tx - }), "%response"); - } - - async #call(tx: PerformActionTransaction, blockTag: string, attempt: number): Promise { - assert (attempt < MAX_CCIP_REDIRECTS, "CCIP read exceeded maximum redirections", "OFFCHAIN_FAULT", { - reason: "TOO_MANY_REDIRECTS", - transaction: Object.assign({ }, tx, { blockTag, enableCcipRead: true }) - }); - - // This came in as a PerformActionTransaction, so to/from are safe; we can cast - const transaction = copyRequest(tx); - - try { - return hexlify(await this._perform({ method: "call", transaction, blockTag })); - - } catch (error: any) { - // CCIP Read OffchainLookup - if (!this.disableCcipRead && isCallException(error) && error.data && attempt >= 0 && blockTag === "latest" && transaction.to != null && dataSlice(error.data, 0, 4) === "0x556f1830") { - const data = error.data; - - const txSender = await resolveAddress(transaction.to, this); - - // Parse the CCIP Read Arguments - let ccipArgs: CcipArgs; - try { - ccipArgs = parseOffchainLookup(dataSlice(error.data, 4)); - } catch (error: any) { - assert(false, error.message, "OFFCHAIN_FAULT", { - reason: "BAD_DATA", transaction, info: { data } }); - } - - // Check the sender of the OffchainLookup matches the transaction - assert(ccipArgs.sender.toLowerCase() === txSender.toLowerCase(), - "CCIP Read sender mismatch", "CALL_EXCEPTION", { - action: "call", - data, - reason: "OffchainLookup", - transaction: transaction, // @TODO: populate data? - invocation: null, - revert: { - signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)", - name: "OffchainLookup", - args: ccipArgs.errorArgs - } - }); - - const ccipResult = await this.ccipReadFetch(transaction, ccipArgs.calldata, ccipArgs.urls); - assert(ccipResult != null, "CCIP Read failed to fetch data", "OFFCHAIN_FAULT", { - reason: "FETCH_FAILED", transaction, info: { data: error.data, errorArgs: ccipArgs.errorArgs } }); - - const tx = { - to: txSender, - data: concat([ ccipArgs.selector, encodeBytes([ ccipResult, ccipArgs.extraData ]) ]) - }; - - this.emit("debug", { action: "sendCcipReadCall", transaction: tx }); - try { - const result = await this.#call(tx, blockTag, attempt + 1); - this.emit("debug", { action: "receiveCcipReadCallResult", transaction: Object.assign({ }, tx), result }); - return result; - } catch (error) { - this.emit("debug", { action: "receiveCcipReadCallError", transaction: Object.assign({ }, tx), error }); - throw error; - } - } - - throw error; - } - } - - async #checkNetwork(promise: Promise): Promise { - const { value } = await resolveProperties({ - network: this.getNetwork(), - value: promise - }); - return value; - } - - async call(_tx: TransactionRequest): Promise { - const { tx, blockTag } = await resolveProperties({ - tx: this._getTransactionRequest(_tx), - blockTag: this._getBlockTag(_tx.blockTag) - }); - - return await this.#checkNetwork(this.#call(tx, blockTag, _tx.enableCcipRead ? 0: -1)); - } - - // Account - async #getAccountValue(request: _PerformAccountRequest, _address: AddressLike, _blockTag?: BlockTag): Promise { - let address: string | Promise = this._getAddress(_address); - let blockTag: string | Promise = this._getBlockTag(_blockTag); - - if (typeof(address) !== "string" || typeof(blockTag) !== "string") { - [ address, blockTag ] = await Promise.all([ address, blockTag ]); - } - - return await this.#checkNetwork(this.#perform(Object.assign(request, { address, blockTag }))); - } - - async getBalance(address: AddressLike, blockTag?: BlockTag): Promise { - return getBigInt(await this.#getAccountValue({ method: "getBalance" }, address, blockTag), "%response"); - } - - async getTransactionCount(address: AddressLike, blockTag?: BlockTag): Promise { - return getNumber(await this.#getAccountValue({ method: "getTransactionCount" }, address, blockTag), "%response"); - } - - async getCode(address: AddressLike, blockTag?: BlockTag): Promise { - return hexlify(await this.#getAccountValue({ method: "getCode" }, address, blockTag)); - } - - async getStorage(address: AddressLike, _position: BigNumberish, blockTag?: BlockTag): Promise { - const position = getBigInt(_position, "position"); - return hexlify(await this.#getAccountValue({ method: "getStorage", position }, address, blockTag)); - } - - // Write - async broadcastTransaction(signedTx: string): Promise { - const { blockNumber, hash, network } = await resolveProperties({ - blockNumber: this.getBlockNumber(), - hash: this._perform({ - method: "broadcastTransaction", - signedTransaction: signedTx - }), - network: this.getNetwork() - }); - - const tx = Transaction.from(signedTx); - if (tx.hash !== hash) { - throw new Error("@TODO: the returned hash did not match"); - } - - return this._wrapTransactionResponse(tx, network).replaceableTransaction(blockNumber); - } - - async #getBlock(block: BlockTag | string, includeTransactions: boolean): Promise { - // @TODO: Add CustomBlockPlugin check - - if (isHexString(block, 32)) { - return await this.#perform({ - method: "getBlock", blockHash: block, includeTransactions - }); - } - - let blockTag = this._getBlockTag(block); - if (typeof(blockTag) !== "string") { blockTag = await blockTag; } - - return await this.#perform({ - method: "getBlock", blockTag, includeTransactions - }); - } - - // Queries - async getBlock(block: BlockTag | string, prefetchTxs?: boolean): Promise { - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#getBlock(block, !!prefetchTxs) - }); - if (params == null) { return null; } - - return this._wrapBlock(params, network); - } - - async getTransaction(hash: string): Promise { - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#perform({ method: "getTransaction", hash }) - }); - if (params == null) { return null; } - - return this._wrapTransactionResponse(params, network); - } - - async getTransactionReceipt(hash: string): Promise { - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#perform({ method: "getTransactionReceipt", hash }) - }); - if (params == null) { return null; } - - // Some backends did not backfill the effectiveGasPrice into old transactions - // in the receipt, so we look it up manually and inject it. - if (params.gasPrice == null && params.effectiveGasPrice == null) { - const tx = await this.#perform({ method: "getTransaction", hash }); - if (tx == null) { throw new Error("report this; could not find tx or effectiveGasPrice"); } - params.effectiveGasPrice = tx.gasPrice; - } - - return this._wrapTransactionReceipt(params, network); - } - - async getTransactionResult(hash: string): Promise { - const { result } = await resolveProperties({ - network: this.getNetwork(), - result: this.#perform({ method: "getTransactionResult", hash }) - }); - if (result == null) { return null; } - return hexlify(result); - } - - // Bloom-filter Queries - async getLogs(_filter: Filter | FilterByBlockHash): Promise> { - let filter = this._getFilter(_filter); - if (isPromise(filter)) { filter = await filter; } - - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#perform>({ method: "getLogs", filter }) - }); - - return params.map((p) => this._wrapLog(p, network)); - } - - // ENS - _getProvider(chainId: number): AbstractProvider { - assert(false, "provider cannot connect to target network", "UNSUPPORTED_OPERATION", { - operation: "_getProvider()" - }); - } - - async getResolver(name: string): Promise { - return await EnsResolver.fromName(this, name); - } - - async getAvatar(name: string): Promise { - const resolver = await this.getResolver(name); - if (resolver) { return await resolver.getAvatar(); } - return null; - } - - async resolveName(name: string): Promise{ - const resolver = await this.getResolver(name); - if (resolver) { return await resolver.getAddress(); } - return null; - } - - async lookupAddress(address: string): Promise { - address = getAddress(address); - const node = namehash(address.substring(2).toLowerCase() + ".addr.reverse"); - - try { - - const ensAddr = await EnsResolver.getEnsAddress(this); - const ensContract = new Contract(ensAddr, [ - "function resolver(bytes32) view returns (address)" - ], this); - - const resolver = await ensContract.resolver(node); - if (resolver == null || resolver === ZeroAddress) { return null; } - - const resolverContract = new Contract(resolver, [ - "function name(bytes32) view returns (string)" - ], this); - const name = await resolverContract.name(node); - - // Failed forward resolution - const check = await this.resolveName(name); - if (check !== address) { return null; } - - return name; - - } catch (error) { - // No data was returned from the resolver - if (isError(error, "BAD_DATA") && error.value === "0x") { - return null; - } - - // Something reerted - if (isError(error, "CALL_EXCEPTION")) { return null; } - - throw error; - } - - return null; - } - - async waitForTransaction(hash: string, _confirms?: null | number, timeout?: null | number): Promise { - const confirms = (_confirms != null) ? _confirms: 1; - if (confirms === 0) { return this.getTransactionReceipt(hash); } - - return new Promise(async (resolve, reject) => { - let timer: null | Timer = null; - - const listener = (async (blockNumber: number) => { - try { - const receipt = await this.getTransactionReceipt(hash); - if (receipt != null) { - if (blockNumber - receipt.blockNumber + 1 >= confirms) { - resolve(receipt); - //this.off("block", listener); - if (timer) { - clearTimeout(timer); - timer = null; - } - return; - } - } - } catch (error) { - console.log("EEE", error); - } - this.once("block", listener); - }); - - if (timeout != null) { - timer = setTimeout(() => { - if (timer == null) { return; } - timer = null; - this.off("block", listener); - reject(makeError("timeout", "TIMEOUT", { reason: "timeout" })); - }, timeout); - } - - listener(await this.getBlockNumber()); - }); - } - - async waitForBlock(blockTag?: BlockTag): Promise { - assert(false, "not implemented yet", "NOT_IMPLEMENTED", { - operation: "waitForBlock" - }); - } - - /** - * Clear a timer created using the [[_setTimeout]] method. - */ - _clearTimeout(timerId: number): void { - const timer = this.#timers.get(timerId); - if (!timer) { return; } - if (timer.timer) { clearTimeout(timer.timer); } - this.#timers.delete(timerId); - } - - /** - * Create a timer that will execute %%func%% after at least %%timeout%% - * (in ms). If %%timeout%% is unspecified, then %%func%% will execute - * in the next event loop. - * - * [Pausing](AbstractProvider-paused) the provider will pause any - * associated timers. - */ - _setTimeout(_func: () => void, timeout?: number): number { - if (timeout == null) { timeout = 0; } - const timerId = this.#nextTimer++; - const func = () => { - this.#timers.delete(timerId); - _func(); - }; - - if (this.paused) { - this.#timers.set(timerId, { timer: null, func, time: timeout }); - } else { - const timer = setTimeout(func, timeout); - this.#timers.set(timerId, { timer, func, time: getTime() }); - } - - return timerId; - } - - /** - * Perform %%func%% on each subscriber. - */ - _forEachSubscriber(func: (s: Subscriber) => void): void { - for (const sub of this.#subs.values()) { - func(sub.subscriber); - } - } - - /** - * Sub-classes may override this to customize subscription - * implementations. - */ - _getSubscriber(sub: Subscription): Subscriber { - switch (sub.type) { - case "debug": - case "error": - case "network": - return new UnmanagedSubscriber(sub.type); - case "block": { - const subscriber = new PollingBlockSubscriber(this); - subscriber.pollingInterval = this.pollingInterval; - return subscriber; - } - case "safe": case "finalized": - return new PollingBlockTagSubscriber(this, sub.type); - case "event": - return new PollingEventSubscriber(this, sub.filter); - case "transaction": - return new PollingTransactionSubscriber(this, sub.hash); - case "orphan": - return new PollingOrphanSubscriber(this, sub.filter); - } - - throw new Error(`unsupported event: ${ sub.type }`); - } - - /** - * If a [[Subscriber]] fails and needs to replace itself, this - * method may be used. - * - * For example, this is used for providers when using the - * ``eth_getFilterChanges`` method, which can return null if state - * filters are not supported by the backend, allowing the Subscriber - * to swap in a [[PollingEventSubscriber]]. - */ - _recoverSubscriber(oldSub: Subscriber, newSub: Subscriber): void { - for (const sub of this.#subs.values()) { - if (sub.subscriber === oldSub) { - if (sub.started) { sub.subscriber.stop(); } - sub.subscriber = newSub; - if (sub.started) { newSub.start(); } - if (this.#pausedState != null) { newSub.pause(this.#pausedState); } - break; - } - } - } - - async #hasSub(event: ProviderEvent, emitArgs?: Array): Promise { - let sub = await getSubscription(event, this); - // This is a log that is removing an existing log; we actually want - // to emit an orphan event for the removed log - if (sub.type === "event" && emitArgs && emitArgs.length > 0 && emitArgs[0].removed === true) { - sub = await getSubscription({ orphan: "drop-log", log: emitArgs[0] }, this); - } - return this.#subs.get(sub.tag) || null; - } - - async #getSub(event: ProviderEvent): Promise { - const subscription = await getSubscription(event, this); - - // Prevent tampering with our tag in any subclass' _getSubscriber - const tag = subscription.tag; - - let sub = this.#subs.get(tag); - if (!sub) { - const subscriber = this._getSubscriber(subscription); - - const addressableMap = new WeakMap(); - const nameMap = new Map(); - sub = { subscriber, tag, addressableMap, nameMap, started: false, listeners: [ ] }; - this.#subs.set(tag, sub); - } - - return sub; - } - - async on(event: ProviderEvent, listener: Listener): Promise { - const sub = await this.#getSub(event); - sub.listeners.push({ listener, once: false }); - if (!sub.started) { - sub.subscriber.start(); - sub.started = true; - if (this.#pausedState != null) { sub.subscriber.pause(this.#pausedState); } - } - return this; - } - - async once(event: ProviderEvent, listener: Listener): Promise { - const sub = await this.#getSub(event); - sub.listeners.push({ listener, once: true }); - if (!sub.started) { - sub.subscriber.start(); - sub.started = true; - if (this.#pausedState != null) { sub.subscriber.pause(this.#pausedState); } - } - return this; - } - - async emit(event: ProviderEvent, ...args: Array): Promise { - const sub = await this.#hasSub(event, args); - // If there is not subscription or if a recent emit removed - // the last of them (which also deleted the sub) do nothing - if (!sub || sub.listeners.length === 0) { return false; }; - - const count = sub.listeners.length; - sub.listeners = sub.listeners.filter(({ listener, once }) => { - const payload = new EventPayload(this, (once ? null: listener), event); - try { - listener.call(this, ...args, payload); - } catch(error) { } - return !once; - }); - - if (sub.listeners.length === 0) { - if (sub.started) { sub.subscriber.stop(); } - this.#subs.delete(sub.tag); - } - - return (count > 0); - } - - async listenerCount(event?: ProviderEvent): Promise { - if (event) { - const sub = await this.#hasSub(event); - if (!sub) { return 0; } - return sub.listeners.length; - } - - let total = 0; - for (const { listeners } of this.#subs.values()) { - total += listeners.length; - } - return total; - } - - async listeners(event?: ProviderEvent): Promise> { - if (event) { - const sub = await this.#hasSub(event); - if (!sub) { return [ ]; } - return sub.listeners.map(({ listener }) => listener); - } - let result: Array = [ ]; - for (const { listeners } of this.#subs.values()) { - result = result.concat(listeners.map(({ listener }) => listener)); - } - return result; - } - - async off(event: ProviderEvent, listener?: Listener): Promise { - const sub = await this.#hasSub(event); - if (!sub) { return this; } - - if (listener) { - const index = sub.listeners.map(({ listener }) => listener).indexOf(listener); - if (index >= 0) { sub.listeners.splice(index, 1); } - } - - if (!listener || sub.listeners.length === 0) { - if (sub.started) { sub.subscriber.stop(); } - this.#subs.delete(sub.tag); - } - - return this; - } - - async removeAllListeners(event?: ProviderEvent): Promise { - if (event) { - const { tag, started, subscriber } = await this.#getSub(event); - if (started) { subscriber.stop(); } - this.#subs.delete(tag); - } else { - for (const [ tag, { started, subscriber } ] of this.#subs) { - if (started) { subscriber.stop(); } - this.#subs.delete(tag); - } - } - return this; - } - - // Alias for "on" - async addListener(event: ProviderEvent, listener: Listener): Promise { - return await this.on(event, listener); - } - - // Alias for "off" - async removeListener(event: ProviderEvent, listener: Listener): Promise { - return this.off(event, listener); - } - - /** - * If this provider has been destroyed using the [[destroy]] method. - * - * Once destroyed, all resources are reclaimed, internal event loops - * and timers are cleaned up and no further requests may be sent to - * the provider. - */ - get destroyed(): boolean { - return this.#destroyed; - } - - /** - * Sub-classes may use this to shutdown any sockets or release their - * resources and reject any pending requests. - * - * Sub-classes **must** call ``super.destroy()``. - */ - destroy(): void { - // Stop all listeners - this.removeAllListeners(); - - // Shut down all tiemrs - for (const timerId of this.#timers.keys()) { - this._clearTimeout(timerId); - } - - this.#destroyed = true; - } - - /** - * Whether the provider is currently paused. - * - * A paused provider will not emit any events, and generally should - * not make any requests to the network, but that is up to sub-classes - * to manage. - * - * Setting ``paused = true`` is identical to calling ``.pause(false)``, - * which will buffer any events that occur while paused until the - * provider is unpaused. - */ - get paused(): boolean { return (this.#pausedState != null); } - set paused(pause: boolean) { - if (!!pause === this.paused) { return; } - - if (this.paused) { - this.resume(); - } else { - this.pause(false); - } - } - - /** - * Pause the provider. If %%dropWhilePaused%%, any events that occur - * while paused are dropped, otherwise all events will be emitted once - * the provider is unpaused. - */ - pause(dropWhilePaused?: boolean): void { - this.#lastBlockNumber = -1; - - if (this.#pausedState != null) { - if (this.#pausedState == !!dropWhilePaused) { return; } - assert(false, "cannot change pause type; resume first", "UNSUPPORTED_OPERATION", { - operation: "pause" - }); - } - - this._forEachSubscriber((s) => s.pause(dropWhilePaused)); - this.#pausedState = !!dropWhilePaused; - - for (const timer of this.#timers.values()) { - // Clear the timer - if (timer.timer) { clearTimeout(timer.timer); } - - // Remaining time needed for when we become unpaused - timer.time = getTime() - timer.time; - } - } - - /** - * Resume the provider. - */ - resume(): void { - if (this.#pausedState == null) { return; } - - this._forEachSubscriber((s) => s.resume()); - this.#pausedState = null; - for (const timer of this.#timers.values()) { - // Remaining time when we were paused - let timeout = timer.time; - if (timeout < 0) { timeout = 0; } - - // Start time (in cause paused, so we con compute remaininf time) - timer.time = getTime(); - - // Start the timer - setTimeout(timer.func, timeout); - } - } -} - - -function _parseString(result: string, start: number): null | string { - try { - const bytes = _parseBytes(result, start); - if (bytes) { return toUtf8String(bytes); } - } catch(error) { } - return null; -} - -function _parseBytes(result: string, start: number): null | string { - if (result === "0x") { return null; } - try { - const offset = getNumber(dataSlice(result, start, start + 32)); - const length = getNumber(dataSlice(result, offset, offset + 32)); - - return dataSlice(result, offset + 32, offset + 32 + length); - } catch (error) { } - return null; -} - -function numPad(value: number): Uint8Array { - const result = toBeArray(value); - if (result.length > 32) { throw new Error("internal; should not happen"); } - - const padded = new Uint8Array(32); - padded.set(result, 32 - result.length); - return padded; -} - -function bytesPad(value: Uint8Array): Uint8Array { - if ((value.length % 32) === 0) { return value; } - - const result = new Uint8Array(Math.ceil(value.length / 32) * 32); - result.set(value); - return result; -} - -const empty: Uint8Array = new Uint8Array([ ]); - -// ABI Encodes a series of (bytes, bytes, ...) -function encodeBytes(datas: Array): string { - const result: Array = [ ]; - - let byteCount = 0; - - // Add place-holders for pointers as we add items - for (let i = 0; i < datas.length; i++) { - result.push(empty); - byteCount += 32; - } - - for (let i = 0; i < datas.length; i++) { - const data = getBytes(datas[i]); - - // Update the bytes offset - result[i] = numPad(byteCount); - - // The length and padded value of data - result.push(numPad(data.length)); - result.push(bytesPad(data)); - byteCount += 32 + Math.ceil(data.length / 32) * 32; - } - - return concat(result); -} - -const zeros = "0x0000000000000000000000000000000000000000000000000000000000000000" -function parseOffchainLookup(data: string): CcipArgs { - const result: CcipArgs = { - sender: "", urls: [ ], calldata: "", selector: "", extraData: "", errorArgs: [ ] - }; - - assert(dataLength(data) >= 5 * 32, "insufficient OffchainLookup data", "OFFCHAIN_FAULT", { - reason: "insufficient OffchainLookup data" - }); - - const sender = dataSlice(data, 0, 32); - assert(dataSlice(sender, 0, 12) === dataSlice(zeros, 0, 12), "corrupt OffchainLookup sender", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup sender" - }); - result.sender = dataSlice(sender, 12); - - // Read the URLs from the response - try { - const urls: Array = []; - const urlsOffset = getNumber(dataSlice(data, 32, 64)); - const urlsLength = getNumber(dataSlice(data, urlsOffset, urlsOffset + 32)); - const urlsData = dataSlice(data, urlsOffset + 32); - for (let u = 0; u < urlsLength; u++) { - const url = _parseString(urlsData, u * 32); - if (url == null) { throw new Error("abort"); } - urls.push(url); - } - result.urls = urls; - } catch (error) { - assert(false, "corrupt OffchainLookup urls", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup urls" - }); - } - - // Get the CCIP calldata to forward - try { - const calldata = _parseBytes(data, 64); - if (calldata == null) { throw new Error("abort"); } - result.calldata = calldata; - } catch (error) { - assert(false, "corrupt OffchainLookup calldata", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup calldata" - }); - } - - // Get the callbackSelector (bytes4) - assert(dataSlice(data, 100, 128) === dataSlice(zeros, 0, 28), "corrupt OffchainLookup callbaackSelector", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup callbaackSelector" - }); - result.selector = dataSlice(data, 96, 100); - - // Get the extra data to send back to the contract as context - try { - const extraData = _parseBytes(data, 128); - if (extraData == null) { throw new Error("abort"); } - result.extraData = extraData; - } catch (error) { - assert(false, "corrupt OffchainLookup extraData", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup extraData" - }); - } - - result.errorArgs = "sender,urls,calldata,selector,extraData".split(/,/).map((k) => (result)[k]) - - return result; -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/abstract-signer.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/abstract-signer.ts deleted file mode 100644 index f192dcce..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/abstract-signer.ts +++ /dev/null @@ -1,314 +0,0 @@ -/** - * Generally the [[Wallet]] and [[JsonRpcSigner]] and their sub-classes - * are sufficient for most developers, but this is provided to - * fascilitate more complex Signers. - * - * @_section: api/providers/abstract-signer: Subclassing Signer [abstract-signer] - */ -import { resolveAddress } from "../address/index.js"; -import { Transaction } from "../transaction/index.js"; -import { - defineProperties, getBigInt, resolveProperties, - assert, assertArgument -} from "../utils/index.js"; - -import { copyRequest } from "./provider.js"; - -import type { - AuthorizationRequest, TypedDataDomain, TypedDataField -} from "../hash/index.js"; -import type { Authorization, TransactionLike } from "../transaction/index.js"; - -import type { - BlockTag, Provider, TransactionRequest, TransactionResponse -} from "./provider.js"; -import type { Signer } from "./signer.js"; - -function checkProvider(signer: AbstractSigner, operation: string): Provider { - if (signer.provider) { return signer.provider; } - assert(false, "missing provider", "UNSUPPORTED_OPERATION", { operation }); -} - -async function populate(signer: AbstractSigner, tx: TransactionRequest): Promise> { - let pop: any = copyRequest(tx); - - if (pop.to != null) { pop.to = resolveAddress(pop.to, signer); } - - if (pop.from != null) { - const from = pop.from; - pop.from = Promise.all([ - signer.getAddress(), - resolveAddress(from, signer) - ]).then(([ address, from ]) => { - assertArgument(address.toLowerCase() === from.toLowerCase(), - "transaction from mismatch", "tx.from", from); - return address; - }); - } else { - pop.from = signer.getAddress(); - } - - return await resolveProperties(pop); -} - - -/** - * An **AbstractSigner** includes most of teh functionality required - * to get a [[Signer]] working as expected, but requires a few - * Signer-specific methods be overridden. - * - */ -export abstract class AbstractSigner

implements Signer { - /** - * The provider this signer is connected to. - */ - readonly provider!: P; - - /** - * Creates a new Signer connected to %%provider%%. - */ - constructor(provider?: P) { - defineProperties(this, { provider: (provider || null) }); - } - - /** - * Resolves to the Signer address. - */ - abstract getAddress(): Promise; - - /** - * Returns the signer connected to %%provider%%. - * - * This may throw, for example, a Signer connected over a Socket or - * to a specific instance of a node may not be transferrable. - */ - abstract connect(provider: null | Provider): Signer; - - async getNonce(blockTag?: BlockTag): Promise { - return checkProvider(this, "getTransactionCount").getTransactionCount(await this.getAddress(), blockTag); - } - - async populateCall(tx: TransactionRequest): Promise> { - const pop = await populate(this, tx); - return pop; - } - - async populateTransaction(tx: TransactionRequest): Promise> { - const provider = checkProvider(this, "populateTransaction"); - - const pop = await populate(this, tx); - - if (pop.nonce == null) { - pop.nonce = await this.getNonce("pending"); - } - - if (pop.gasLimit == null) { - pop.gasLimit = await this.estimateGas(pop); - } - - // Populate the chain ID - const network = await ((this.provider)).getNetwork(); - if (pop.chainId != null) { - const chainId = getBigInt(pop.chainId); - assertArgument(chainId === network.chainId, "transaction chainId mismatch", "tx.chainId", tx.chainId); - } else { - pop.chainId = network.chainId; - } - - // Do not allow mixing pre-eip-1559 and eip-1559 properties - const hasEip1559 = (pop.maxFeePerGas != null || pop.maxPriorityFeePerGas != null); - if (pop.gasPrice != null && (pop.type === 2 || hasEip1559)) { - assertArgument(false, "eip-1559 transaction do not support gasPrice", "tx", tx); - } else if ((pop.type === 0 || pop.type === 1) && hasEip1559) { - assertArgument(false, "pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas", "tx", tx); - } - - if ((pop.type === 2 || pop.type == null) && (pop.maxFeePerGas != null && pop.maxPriorityFeePerGas != null)) { - // Fully-formed EIP-1559 transaction (skip getFeeData) - pop.type = 2; - - } else if (pop.type === 0 || pop.type === 1) { - // Explicit Legacy or EIP-2930 transaction - - // We need to get fee data to determine things - const feeData = await provider.getFeeData(); - - assert(feeData.gasPrice != null, "network does not support gasPrice", "UNSUPPORTED_OPERATION", { - operation: "getGasPrice" }); - - // Populate missing gasPrice - if (pop.gasPrice == null) { pop.gasPrice = feeData.gasPrice; } - - } else { - - // We need to get fee data to determine things - const feeData = await provider.getFeeData(); - - if (pop.type == null) { - // We need to auto-detect the intended type of this transaction... - - if (feeData.maxFeePerGas != null && feeData.maxPriorityFeePerGas != null) { - // The network supports EIP-1559! - - // Upgrade transaction from null to eip-1559 - if (pop.authorizationList && pop.authorizationList.length) { - pop.type = 4; - } else { - pop.type = 2; - } - - if (pop.gasPrice != null) { - // Using legacy gasPrice property on an eip-1559 network, - // so use gasPrice as both fee properties - const gasPrice = pop.gasPrice; - delete pop.gasPrice; - pop.maxFeePerGas = gasPrice; - pop.maxPriorityFeePerGas = gasPrice; - - } else { - // Populate missing fee data - - if (pop.maxFeePerGas == null) { - pop.maxFeePerGas = feeData.maxFeePerGas; - } - - if (pop.maxPriorityFeePerGas == null) { - pop.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas; - } - } - - } else if (feeData.gasPrice != null) { - // Network doesn't support EIP-1559... - - // ...but they are trying to use EIP-1559 properties - assert(!hasEip1559, "network does not support EIP-1559", "UNSUPPORTED_OPERATION", { - operation: "populateTransaction" }); - - // Populate missing fee data - if (pop.gasPrice == null) { - pop.gasPrice = feeData.gasPrice; - } - - // Explicitly set untyped transaction to legacy - // @TODO: Maybe this shold allow type 1? - pop.type = 0; - - } else { - // getFeeData has failed us. - assert(false, "failed to get consistent fee data", "UNSUPPORTED_OPERATION", { - operation: "signer.getFeeData" }); - } - - } else if (pop.type === 2 || pop.type === 3 || pop.type === 4) { - // Explicitly using EIP-1559 or EIP-4844 - - // Populate missing fee data - if (pop.maxFeePerGas == null) { - pop.maxFeePerGas = feeData.maxFeePerGas; - } - - if (pop.maxPriorityFeePerGas == null) { - pop.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas; - } - } - } - -//@TOOD: Don't await all over the place; save them up for -// the end for better batching - return await resolveProperties(pop); - } - - async populateAuthorization(_auth: AuthorizationRequest): Promise { - const auth = Object.assign({ }, _auth); - - // Add a chain ID if not explicitly set to 0 - if (auth.chainId == null) { - auth.chainId = (await checkProvider(this, "getNetwork").getNetwork()).chainId; - } - - // @TODO: Take chain ID into account when populating noce? - - if (auth.nonce == null) { auth.nonce = await this.getNonce(); } - - return auth; - } - - async estimateGas(tx: TransactionRequest): Promise { - return checkProvider(this, "estimateGas").estimateGas(await this.populateCall(tx)); - } - - async call(tx: TransactionRequest): Promise { - return checkProvider(this, "call").call(await this.populateCall(tx)); - } - - async resolveName(name: string): Promise { - const provider = checkProvider(this, "resolveName"); - return await provider.resolveName(name); - } - - async sendTransaction(tx: TransactionRequest): Promise { - const provider = checkProvider(this, "sendTransaction"); - - const pop = await this.populateTransaction(tx); - delete pop.from; - const txObj = Transaction.from(pop); - return await provider.broadcastTransaction(await this.signTransaction(txObj)); - } - - // @TODO: in v7 move this to be abstract - authorize(authorization: AuthorizationRequest): Promise { - assert(false, "authorization not implemented for this signer", - "UNSUPPORTED_OPERATION", { operation: "authorize" }); - } - - abstract signTransaction(tx: TransactionRequest): Promise; - abstract signMessage(message: string | Uint8Array): Promise; - abstract signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise; -} - -/** - * A **VoidSigner** is a class designed to allow an address to be used - * in any API which accepts a Signer, but for which there are no - * credentials available to perform any actual signing. - * - * This for example allow impersonating an account for the purpose of - * static calls or estimating gas, but does not allow sending transactions. - */ -export class VoidSigner extends AbstractSigner { - /** - * The signer address. - */ - readonly address!: string; - - /** - * Creates a new **VoidSigner** with %%address%% attached to - * %%provider%%. - */ - constructor(address: string, provider?: null | Provider) { - super(provider); - defineProperties(this, { address }); - } - - async getAddress(): Promise { return this.address; } - - connect(provider: null | Provider): VoidSigner { - return new VoidSigner(this.address, provider); - } - - #throwUnsupported(suffix: string, operation: string): never { - assert(false, `VoidSigner cannot sign ${ suffix }`, "UNSUPPORTED_OPERATION", { operation }); - } - - async signTransaction(tx: TransactionRequest): Promise { - this.#throwUnsupported("transactions", "signTransaction"); - } - - async signMessage(message: string | Uint8Array): Promise { - this.#throwUnsupported("messages", "signMessage"); - } - - async signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise { - this.#throwUnsupported("typed-data", "signTypedData"); - } -} - diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/community.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/community.ts deleted file mode 100644 index 93166e24..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/community.ts +++ /dev/null @@ -1,49 +0,0 @@ -/** - * There are many awesome community services that provide Ethereum - * nodes both for developers just starting out and for large-scale - * communities. - * - * @_section: api/providers/thirdparty: Community Providers [thirdparty] - */ - -/** - * Providers which offer community credentials should extend this - * to notify any interested consumers whether community credentials - * are in-use. - */ -export interface CommunityResourcable { - /** - * Returns true if the instance is connected using the community - * credentials. - */ - isCommunityResource(): boolean; -} - -// Show the throttle message only once per service -const shown: Set = new Set(); - -/** - * Displays a warning in the console when the community resource is - * being used too heavily by the app, recommending the developer - * acquire their own credentials instead of using the community - * credentials. - * - * The notification will only occur once per service. - */ -export function showThrottleMessage(service: string): void { - if (shown.has(service)) { return; } - shown.add(service); - - console.log("========= NOTICE =========") - console.log(`Request-Rate Exceeded for ${ service } (this message will not be repeated)`); - console.log(""); - console.log("The default API keys for each service are provided as a highly-throttled,"); - console.log("community resource for low-traffic projects and early prototyping."); - console.log(""); - console.log("While your application will continue to function, we highly recommended"); - console.log("signing up for your own API keys to improve performance, increase your"); - console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."); - console.log(""); - console.log("For more details: https:/\/docs.ethers.org/api-keys/"); - console.log("=========================="); -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/contracts.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/contracts.ts deleted file mode 100644 index abb6d2b8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/contracts.ts +++ /dev/null @@ -1,42 +0,0 @@ -import type { - Provider, TransactionRequest, TransactionResponse -} from "./provider.js"; - -/** - * A **ContractRunner** is a generic interface which defines an object - * capable of interacting with a Contract on the network. - * - * The more operations supported, the more utility it is capable of. - * - * The most common ContractRunners are [Providers](Provider) which enable - * read-only access and [Signers](Signer) which enable write-access. - */ -export interface ContractRunner { - /** - * The provider used for necessary state querying operations. - * - * This can also point to the **ContractRunner** itself, in the - * case of an [[AbstractProvider]]. - */ - provider: null | Provider; - - /** - * Required to estimate gas. - */ - estimateGas?: (tx: TransactionRequest) => Promise; - - /** - * Required for pure, view or static calls to contracts. - */ - call?: (tx: TransactionRequest) => Promise; - - /** - * Required to support ENS names - */ - resolveName?: (name: string) => Promise; - - /** - * Required for state mutating calls - */ - sendTransaction?: (tx: TransactionRequest) => Promise; -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/default-provider.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/default-provider.ts deleted file mode 100644 index 9ee6cdfa..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/default-provider.ts +++ /dev/null @@ -1,202 +0,0 @@ - -import { assert } from "../utils/index.js"; - -import { AnkrProvider } from "./provider-ankr.js"; -import { AlchemyProvider } from "./provider-alchemy.js"; -//import { BlockscoutProvider } from "./provider-blockscout.js"; -import { ChainstackProvider } from "./provider-chainstack.js"; -import { CloudflareProvider } from "./provider-cloudflare.js"; -import { EtherscanProvider } from "./provider-etherscan.js"; -import { InfuraProvider } from "./provider-infura.js"; -//import { PocketProvider } from "./provider-pocket.js"; -import { QuickNodeProvider } from "./provider-quicknode.js"; - -import { FallbackProvider } from "./provider-fallback.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import { Network } from "./network.js"; -import { WebSocketProvider } from "./provider-websocket.js"; - -import type { AbstractProvider } from "./abstract-provider.js"; -import type { Networkish } from "./network.js"; -import { WebSocketLike } from "./provider-websocket.js"; - -function isWebSocketLike(value: any): value is WebSocketLike { - return (value && typeof(value.send) === "function" && - typeof(value.close) === "function"); -} - -const Testnets = "goerli kovan sepolia classicKotti optimism-goerli arbitrum-goerli matic-mumbai bnbt".split(" "); - -/** - * Returns a default provider for %%network%%. - * - * If %%network%% is a [[WebSocketLike]] or string that begins with - * ``"ws:"`` or ``"wss:"``, a [[WebSocketProvider]] is returned backed - * by that WebSocket or URL. - * - * If %%network%% is a string that begins with ``"HTTP:"`` or ``"HTTPS:"``, - * a [[JsonRpcProvider]] is returned connected to that URL. - * - * Otherwise, a default provider is created backed by well-known public - * Web3 backends (such as [[link-infura]]) using community-provided API - * keys. - * - * The %%options%% allows specifying custom API keys per backend (setting - * an API key to ``"-"`` will omit that provider) and ``options.exclusive`` - * can be set to either a backend name or and array of backend names, which - * will whitelist **only** those backends. - * - * Current backend strings supported are: - * - ``"alchemy"`` - * - ``"ankr"`` - * - ``"cloudflare"`` - * - ``"chainstack"`` - * - ``"etherscan"`` - * - ``"infura"`` - * - ``"publicPolygon"`` - * - ``"quicknode"`` - * - * @example: - * // Connect to a local Geth node - * provider = getDefaultProvider("http://localhost:8545/"); - * - * // Connect to Ethereum mainnet with any current and future - * // third-party services available - * provider = getDefaultProvider("mainnet"); - * - * // Connect to Polygon, but only allow Etherscan and - * // INFURA and use "MY_API_KEY" in calls to Etherscan. - * provider = getDefaultProvider("matic", { - * etherscan: "MY_API_KEY", - * exclusive: [ "etherscan", "infura" ] - * }); - */ -export function getDefaultProvider(network?: string | Networkish | WebSocketLike, options?: any): AbstractProvider { - if (options == null) { options = { }; } - - const allowService = (name: string) => { - if (options[name] === "-") { return false; } - if (typeof(options.exclusive) === "string") { - return (name === options.exclusive); - } - if (Array.isArray(options.exclusive)) { - return (options.exclusive.indexOf(name) !== -1); - } - return true; - }; - - if (typeof(network) === "string" && network.match(/^https?:/)) { - return new JsonRpcProvider(network); - } - - if (typeof(network) === "string" && network.match(/^wss?:/) || isWebSocketLike(network)) { - return new WebSocketProvider(network); - } - - // Get the network and name, if possible - let staticNetwork: null | Network = null; - try { - staticNetwork = Network.from(network); - } catch (error) { } - - - const providers: Array = [ ]; - - if (allowService("publicPolygon") && staticNetwork) { - if (staticNetwork.name === "matic") { - providers.push(new JsonRpcProvider("https:/\/polygon-rpc.com/", staticNetwork, { staticNetwork })); - } else if (staticNetwork.name === "matic-amoy") { - providers.push(new JsonRpcProvider("https:/\/rpc-amoy.polygon.technology/", staticNetwork, { staticNetwork })); - } - } - - if (allowService("alchemy")) { - try { - providers.push(new AlchemyProvider(network, options.alchemy)); - } catch (error) { } - } - - if (allowService("ankr") && options.ankr != null) { - try { - providers.push(new AnkrProvider(network, options.ankr)); - } catch (error) { } - } -/* Temporarily remove until custom error issue is fixed - if (allowService("blockscout")) { - try { - providers.push(new BlockscoutProvider(network, options.blockscout)); - } catch (error) { } - } -*/ - if (allowService("chainstack")) { - try { - providers.push(new ChainstackProvider(network, options.chainstack)); - } catch (error) { } - } - - if (allowService("cloudflare")) { - try { - providers.push(new CloudflareProvider(network)); - } catch (error) { } - } - - if (allowService("etherscan")) { - try { - providers.push(new EtherscanProvider(network, options.etherscan)); - } catch (error) { } - } - - if (allowService("infura")) { - try { - let projectId = options.infura; - let projectSecret: undefined | string = undefined; - if (typeof(projectId) === "object") { - projectSecret = projectId.projectSecret; - projectId = projectId.projectId; - } - providers.push(new InfuraProvider(network, projectId, projectSecret)); - } catch (error) { } - } -/* - if (options.pocket !== "-") { - try { - let appId = options.pocket; - let secretKey: undefined | string = undefined; - let loadBalancer: undefined | boolean = undefined; - if (typeof(appId) === "object") { - loadBalancer = !!appId.loadBalancer; - secretKey = appId.secretKey; - appId = appId.appId; - } - providers.push(new PocketProvider(network, appId, secretKey, loadBalancer)); - } catch (error) { console.log(error); } - } -*/ - if (allowService("quicknode")) { - try { - let token = options.quicknode; - providers.push(new QuickNodeProvider(network, token)); - } catch (error) { } - } - - assert(providers.length, "unsupported default network", "UNSUPPORTED_OPERATION", { - operation: "getDefaultProvider" - }); - - // No need for a FallbackProvider - if (providers.length === 1) { return providers[0]; } - - // We use the floor because public third-party providers can be unreliable, - // so a low number of providers with a large quorum will fail too often - let quorum = Math.floor(providers.length / 2); - if (quorum > 2) { quorum = 2; } - - // Testnets don't need as strong a security gaurantee and speed is - // more useful during testing - if (staticNetwork && Testnets.indexOf(staticNetwork.name) !== -1) { quorum = 1; } - - // Provided override qorum takes priority - if (options && options.quorum) { quorum = options.quorum; } - - return new FallbackProvider(providers, undefined, { quorum }); -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/ens-resolver.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/ens-resolver.ts deleted file mode 100644 index 5265be13..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/ens-resolver.ts +++ /dev/null @@ -1,606 +0,0 @@ -/** - * ENS is a service which allows easy-to-remember names to map to - * network addresses. - * - * @_section: api/providers/ens-resolver:ENS Resolver [about-ens-rsolver] - */ - -import { getAddress } from "../address/index.js"; -import { ZeroAddress } from "../constants/index.js"; -import { Contract } from "../contract/index.js"; -import { dnsEncode, namehash } from "../hash/index.js"; -import { - hexlify, isHexString, toBeHex, - defineProperties, encodeBase58, - assert, assertArgument, isError, - FetchRequest -} from "../utils/index.js"; - -import type { FunctionFragment } from "../abi/index.js"; - -import type { BytesLike } from "../utils/index.js"; - -import type { AbstractProvider, AbstractProviderPlugin } from "./abstract-provider.js"; -import type { EnsPlugin } from "./plugins-network.js"; -import type { Provider } from "./provider.js"; - -// @TODO: This should use the fetch-data:ipfs gateway -// Trim off the ipfs:// prefix and return the default gateway URL -function getIpfsLink(link: string): string { - if (link.match(/^ipfs:\/\/ipfs\//i)) { - link = link.substring(12); - } else if (link.match(/^ipfs:\/\//i)) { - link = link.substring(7); - } else { - assertArgument(false, "unsupported IPFS format", "link", link); - } - - return `https:/\/gateway.ipfs.io/ipfs/${ link }`; -} - -/** - * The type of data found during a steip during avatar resolution. - */ -export type AvatarLinkageType = "name" | "avatar" | "!avatar" | "url" | "data" | "ipfs" | - "erc721" | "erc1155" | "!erc721-caip" | "!erc1155-caip" | - "!owner" | "owner" | "!balance" | "balance" | - "metadata-url-base" | "metadata-url-expanded" | "metadata-url" | "!metadata-url" | - "!metadata" | "metadata" | - "!imageUrl" | "imageUrl-ipfs" | "imageUrl" | "!imageUrl-ipfs"; - -/** - * An individual record for each step during avatar resolution. - */ -export interface AvatarLinkage { - /** - * The type of linkage. - */ - type: AvatarLinkageType; - - /** - * The linkage value. - */ - value: string; -}; - -/** - * When resolving an avatar for an ENS name, there are many - * steps involved, fetching metadata, validating results, et cetera. - * - * Some applications may wish to analyse this data, or use this data - * to diagnose promblems, so an **AvatarResult** provides details of - * each completed step during avatar resolution. - */ -export interface AvatarResult { - /** - * How the [[url]] was arrived at, resolving the many steps required - * for an avatar URL. - */ - linkage: Array; - - /** - * The avatar URL or null if the avatar was not set, or there was - * an issue during validation (such as the address not owning the - * avatar or a metadata error). - */ - url: null | string; -}; - -/** - * A provider plugin super-class for processing multicoin address types. - */ -export abstract class MulticoinProviderPlugin implements AbstractProviderPlugin { - /** - * The name. - */ - readonly name!: string; - - /** - * Creates a new **MulticoinProviderPluing** for %%name%%. - */ - constructor(name: string) { - defineProperties(this, { name }); - } - - connect(proivder: Provider): MulticoinProviderPlugin { - return this; - } - - /** - * Returns ``true`` if %%coinType%% is supported by this plugin. - */ - supportsCoinType(coinType: number): boolean { - return false; - } - - /** - * Resolves to the encoded %%address%% for %%coinType%%. - */ - async encodeAddress(coinType: number, address: string): Promise { - throw new Error("unsupported coin"); - } - - /** - * Resolves to the decoded %%data%% for %%coinType%%. - */ - async decodeAddress(coinType: number, data: BytesLike): Promise { - throw new Error("unsupported coin"); - } -} - -const BasicMulticoinPluginId = "org.ethers.plugins.provider.BasicMulticoin"; - -/** - * A **BasicMulticoinProviderPlugin** provides service for common - * coin types, which do not require additional libraries to encode or - * decode. - */ -export class BasicMulticoinProviderPlugin extends MulticoinProviderPlugin { - /** - * Creates a new **BasicMulticoinProviderPlugin**. - */ - constructor() { - super(BasicMulticoinPluginId); - } -} - -const matcherIpfs = new RegExp("^(ipfs):/\/(.*)$", "i"); -const matchers = [ - new RegExp("^(https):/\/(.*)$", "i"), - new RegExp("^(data):(.*)$", "i"), - matcherIpfs, - new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$", "i"), -]; - -/** - * A connected object to a resolved ENS name resolver, which can be - * used to query additional details. - */ -export class EnsResolver { - /** - * The connected provider. - */ - provider!: AbstractProvider; - - /** - * The address of the resolver. - */ - address!: string; - - /** - * The name this resolver was resolved against. - */ - name!: string; - - // For EIP-2544 names, the ancestor that provided the resolver - #supports2544: null | Promise; - - #resolver: Contract; - - constructor(provider: AbstractProvider, address: string, name: string) { - defineProperties(this, { provider, address, name }); - this.#supports2544 = null; - - this.#resolver = new Contract(address, [ - "function supportsInterface(bytes4) view returns (bool)", - "function resolve(bytes, bytes) view returns (bytes)", - "function addr(bytes32) view returns (address)", - "function addr(bytes32, uint) view returns (bytes)", - "function text(bytes32, string) view returns (string)", - "function contenthash(bytes32) view returns (bytes)", - ], provider); - - } - - /** - * Resolves to true if the resolver supports wildcard resolution. - */ - async supportsWildcard(): Promise { - if (this.#supports2544 == null) { - this.#supports2544 = (async () => { - try { - return await this.#resolver.supportsInterface("0x9061b923"); - } catch (error) { - // Wildcard resolvers must understand supportsInterface - // and return true. - if (isError(error, "CALL_EXCEPTION")) { return false; } - - // Let future attempts try again... - this.#supports2544 = null; - - throw error; - } - })(); - } - - return await this.#supports2544; - } - - async #fetch(funcName: string, params?: Array): Promise { - params = (params || []).slice(); - const iface = this.#resolver.interface; - - // The first parameters is always the nodehash - params.unshift(namehash(this.name)) - - let fragment: null | FunctionFragment = null; - if (await this.supportsWildcard()) { - fragment = iface.getFunction(funcName); - assert(fragment, "missing fragment", "UNKNOWN_ERROR", { - info: { funcName } - }); - - params = [ - dnsEncode(this.name, 255), - iface.encodeFunctionData(fragment, params) - ]; - - funcName = "resolve(bytes,bytes)"; - } - - params.push({ - enableCcipRead: true - }); - - try { - const result = await this.#resolver[funcName](...params); - - if (fragment) { - return iface.decodeFunctionResult(fragment, result)[0]; - } - - return result; - } catch (error: any) { - if (!isError(error, "CALL_EXCEPTION")) { throw error; } - } - - return null; - } - - /** - * Resolves to the address for %%coinType%% or null if the - * provided %%coinType%% has not been configured. - */ - async getAddress(coinType?: number): Promise { - if (coinType == null) { coinType = 60; } - if (coinType === 60) { - try { - const result = await this.#fetch("addr(bytes32)"); - - // No address - if (result == null || result === ZeroAddress) { return null; } - - return result; - } catch (error: any) { - if (isError(error, "CALL_EXCEPTION")) { return null; } - throw error; - } - } - - // Try decoding its EVM canonical chain as an EVM chain address first - if (coinType >= 0 && coinType < 0x80000000) { - let ethCoinType = coinType + 0x80000000; - - const data = await this.#fetch("addr(bytes32,uint)", [ ethCoinType ]); - if (isHexString(data, 20)) { return getAddress(data); } - } - - let coinPlugin: null | MulticoinProviderPlugin = null; - for (const plugin of this.provider.plugins) { - if (!(plugin instanceof MulticoinProviderPlugin)) { continue; } - if (plugin.supportsCoinType(coinType)) { - coinPlugin = plugin; - break; - } - } - - if (coinPlugin == null) { return null; } - - // keccak256("addr(bytes32,uint256") - const data = await this.#fetch("addr(bytes32,uint)", [ coinType ]); - - // No address - if (data == null || data === "0x") { return null; } - - // Compute the address - const address = await coinPlugin.decodeAddress(coinType, data); - - if (address != null) { return address; } - - assert(false, `invalid coin data`, "UNSUPPORTED_OPERATION", { - operation: `getAddress(${ coinType })`, - info: { coinType, data } - }); - } - - /** - * Resolves to the EIP-634 text record for %%key%%, or ``null`` - * if unconfigured. - */ - async getText(key: string): Promise { - const data = await this.#fetch("text(bytes32,string)", [ key ]); - if (data == null || data === "0x") { return null; } - return data; - } - - /** - * Rsolves to the content-hash or ``null`` if unconfigured. - */ - async getContentHash(): Promise { - // keccak256("contenthash()") - const data = await this.#fetch("contenthash(bytes32)"); - - // No contenthash - if (data == null || data === "0x") { return null; } - - // IPFS (CID: 1, Type: 70=DAG-PB, 72=libp2p-key) - const ipfs = data.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/); - if (ipfs) { - const scheme = (ipfs[1] === "e3010170") ? "ipfs": "ipns"; - const length = parseInt(ipfs[4], 16); - if (ipfs[5].length === length * 2) { - return `${ scheme }:/\/${ encodeBase58("0x" + ipfs[2])}`; - } - } - - // Swarm (CID: 1, Type: swarm-manifest; hash/length hard-coded to keccak256/32) - const swarm = data.match(/^0xe40101fa011b20([0-9a-f]*)$/) - if (swarm && swarm[1].length === 64) { - return `bzz:/\/${ swarm[1] }`; - } - - assert(false, `invalid or unsupported content hash data`, "UNSUPPORTED_OPERATION", { - operation: "getContentHash()", - info: { data } - }); - } - - /** - * Resolves to the avatar url or ``null`` if the avatar is either - * unconfigured or incorrectly configured (e.g. references an NFT - * not owned by the address). - * - * If diagnosing issues with configurations, the [[_getAvatar]] - * method may be useful. - */ - async getAvatar(): Promise { - const avatar = await this._getAvatar(); - return avatar.url; - } - - /** - * When resolving an avatar, there are many steps involved, such - * fetching metadata and possibly validating ownership of an - * NFT. - * - * This method can be used to examine each step and the value it - * was working from. - */ - async _getAvatar(): Promise { - const linkage: Array = [ { type: "name", value: this.name } ]; - try { - // test data for ricmoo.eth - //const avatar = "eip155:1/erc721:0x265385c7f4132228A0d54EB1A9e7460b91c0cC68/29233"; - const avatar = await this.getText("avatar"); - if (avatar == null) { - linkage.push({ type: "!avatar", value: "" }); - return { url: null, linkage }; - } - linkage.push({ type: "avatar", value: avatar }); - - for (let i = 0; i < matchers.length; i++) { - const match = avatar.match(matchers[i]); - if (match == null) { continue; } - - const scheme = match[1].toLowerCase(); - - switch (scheme) { - case "https": - case "data": - linkage.push({ type: "url", value: avatar }); - return { linkage, url: avatar }; - case "ipfs": { - const url = getIpfsLink(avatar); - linkage.push({ type: "ipfs", value: avatar }); - linkage.push({ type: "url", value: url }); - return { linkage, url }; - } - - case "erc721": - case "erc1155": { - // Depending on the ERC type, use tokenURI(uint256) or url(uint256) - const selector = (scheme === "erc721") ? "tokenURI(uint256)": "uri(uint256)"; - linkage.push({ type: scheme, value: avatar }); - - // The owner of this name - const owner = await this.getAddress(); - if (owner == null) { - linkage.push({ type: "!owner", value: "" }); - return { url: null, linkage }; - } - - const comps = (match[2] || "").split("/"); - if (comps.length !== 2) { - linkage.push({ type: `!${ scheme }caip`, value: (match[2] || "") }); - return { url: null, linkage }; - } - - const tokenId = comps[1]; - - const contract = new Contract(comps[0], [ - // ERC-721 - "function tokenURI(uint) view returns (string)", - "function ownerOf(uint) view returns (address)", - - // ERC-1155 - "function uri(uint) view returns (string)", - "function balanceOf(address, uint256) view returns (uint)" - ], this.provider); - - // Check that this account owns the token - if (scheme === "erc721") { - const tokenOwner = await contract.ownerOf(tokenId); - - if (owner !== tokenOwner) { - linkage.push({ type: "!owner", value: tokenOwner }); - return { url: null, linkage }; - } - linkage.push({ type: "owner", value: tokenOwner }); - - } else if (scheme === "erc1155") { - const balance = await contract.balanceOf(owner, tokenId); - if (!balance) { - linkage.push({ type: "!balance", value: "0" }); - return { url: null, linkage }; - } - linkage.push({ type: "balance", value: balance.toString() }); - } - - // Call the token contract for the metadata URL - let metadataUrl = await contract[selector](tokenId); - if (metadataUrl == null || metadataUrl === "0x") { - linkage.push({ type: "!metadata-url", value: "" }); - return { url: null, linkage }; - } - - linkage.push({ type: "metadata-url-base", value: metadataUrl }); - - // ERC-1155 allows a generic {id} in the URL - if (scheme === "erc1155") { - metadataUrl = metadataUrl.replace("{id}", toBeHex(tokenId, 32).substring(2)); - linkage.push({ type: "metadata-url-expanded", value: metadataUrl }); - } - - // Transform IPFS metadata links - if (metadataUrl.match(/^ipfs:/i)) { - metadataUrl = getIpfsLink(metadataUrl); - } - linkage.push({ type: "metadata-url", value: metadataUrl }); - - // Get the token metadata - let metadata: any = { }; - const response = await (new FetchRequest(metadataUrl)).send(); - response.assertOk(); - - try { - metadata = response.bodyJson; - } catch (error) { - try { - linkage.push({ type: "!metadata", value: response.bodyText }); - } catch (error) { - const bytes = response.body; - if (bytes) { - linkage.push({ type: "!metadata", value: hexlify(bytes) }); - } - return { url: null, linkage }; - } - return { url: null, linkage }; - } - - if (!metadata) { - linkage.push({ type: "!metadata", value: "" }); - return { url: null, linkage }; - } - - linkage.push({ type: "metadata", value: JSON.stringify(metadata) }); - - // Pull the image URL out - let imageUrl = metadata.image; - if (typeof(imageUrl) !== "string") { - linkage.push({ type: "!imageUrl", value: "" }); - return { url: null, linkage }; - } - - if (imageUrl.match(/^(https:\/\/|data:)/i)) { - // Allow - } else { - // Transform IPFS link to gateway - const ipfs = imageUrl.match(matcherIpfs); - if (ipfs == null) { - linkage.push({ type: "!imageUrl-ipfs", value: imageUrl }); - return { url: null, linkage }; - } - - linkage.push({ type: "imageUrl-ipfs", value: imageUrl }); - imageUrl = getIpfsLink(imageUrl); - } - - linkage.push({ type: "url", value: imageUrl }); - - return { linkage, url: imageUrl }; - } - } - } - } catch (error) { } - - return { linkage, url: null }; - } - - static async getEnsAddress(provider: Provider): Promise { - const network = await provider.getNetwork(); - - const ensPlugin = network.getPlugin("org.ethers.plugins.network.Ens"); - - // No ENS... - assert(ensPlugin, "network does not support ENS", "UNSUPPORTED_OPERATION", { - operation: "getEnsAddress", info: { network } }); - - return ensPlugin.address; - } - - static async #getResolver(provider: Provider, name: string): Promise { - const ensAddr = await EnsResolver.getEnsAddress(provider); - - try { - const contract = new Contract(ensAddr, [ - "function resolver(bytes32) view returns (address)" - ], provider); - - const addr = await contract.resolver(namehash(name), { - enableCcipRead: true - }); - - if (addr === ZeroAddress) { return null; } - return addr; - - } catch (error) { - // ENS registry cannot throw errors on resolver(bytes32), - // so probably a link error - throw error; - } - - return null; - } - - /** - * Resolve to the ENS resolver for %%name%% using %%provider%% or - * ``null`` if unconfigured. - */ - static async fromName(provider: AbstractProvider, name: string): Promise { - - let currentName = name; - while (true) { - if (currentName === "" || currentName === ".") { return null; } - - // Optimization since the eth node cannot change and does - // not have a wildcard resolver - if (name !== "eth" && currentName === "eth") { return null; } - - // Check the current node for a resolver - const addr = await EnsResolver.#getResolver(provider, currentName); - - // Found a resolver! - if (addr != null) { - const resolver = new EnsResolver(provider, addr, name); - - // Legacy resolver found, using EIP-2544 so it isn't safe to use - if (currentName !== name && !(await resolver.supportsWildcard())) { return null; } - - return resolver; - } - - // Get the parent node - currentName = currentName.split(".").slice(1).join("."); - } - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/format.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/format.ts deleted file mode 100644 index 40720d1e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/format.ts +++ /dev/null @@ -1,335 +0,0 @@ -/** - * @_ignore - */ -import { getAddress, getCreateAddress } from "../address/index.js"; -import { Signature } from "../crypto/index.js" -import { accessListify } from "../transaction/index.js"; -import { - getBigInt, getNumber, hexlify, isHexString, zeroPadValue, - assert, assertArgument -} from "../utils/index.js"; - -import type { SignatureLike } from "../crypto/index.js" -import type { - BlockParams, LogParams, - TransactionReceiptParams, TransactionResponseParams, -} from "./formatting.js"; - - -const BN_0 = BigInt(0); - -export type FormatFunc = (value: any) => any; - -export function allowNull(format: FormatFunc, nullValue?: any): FormatFunc { - return (function(value: any) { - if (value == null) { return nullValue; } - return format(value); - }); -} - -export function arrayOf(format: FormatFunc, allowNull?: boolean): FormatFunc { - return ((array: any) => { - if (allowNull && array == null) { return null; } - if (!Array.isArray(array)) { throw new Error("not an array"); } - return array.map((i) => format(i)); - }); -} - -// Requires an object which matches a fleet of other formatters -// Any FormatFunc may return `undefined` to have the value omitted -// from the result object. Calls preserve `this`. -export function object(format: Record, altNames?: Record>): FormatFunc { - return ((value: any) => { - const result: any = { }; - for (const key in format) { - let srcKey = key; - if (altNames && key in altNames && !(srcKey in value)) { - for (const altKey of altNames[key]) { - if (altKey in value) { - srcKey = altKey; - break; - } - } - } - - try { - const nv = format[key](value[srcKey]); - if (nv !== undefined) { result[key] = nv; } - } catch (error) { - const message = (error instanceof Error) ? error.message: "not-an-error"; - assert(false, `invalid value for value.${ key } (${ message })`, "BAD_DATA", { value }) - } - } - return result; - }); -} - -export function formatBoolean(value: any): boolean { - switch (value) { - case true: case "true": - return true; - case false: case "false": - return false; - } - assertArgument(false, `invalid boolean; ${ JSON.stringify(value) }`, "value", value); -} - -export function formatData(value: string): string { - assertArgument(isHexString(value, true), "invalid data", "value", value); - return value; -} - -export function formatHash(value: any): string { - assertArgument(isHexString(value, 32), "invalid hash", "value", value); - return value; -} - -export function formatUint256(value: any): string { - if (!isHexString(value)) { - throw new Error("invalid uint256"); - } - return zeroPadValue(value, 32); -} - -const _formatLog = object({ - address: getAddress, - blockHash: formatHash, - blockNumber: getNumber, - data: formatData, - index: getNumber, - removed: allowNull(formatBoolean, false), - topics: arrayOf(formatHash), - transactionHash: formatHash, - transactionIndex: getNumber, -}, { - index: [ "logIndex" ] -}); - -export function formatLog(value: any): LogParams { - return _formatLog(value); -} - -const _formatBlock = object({ - hash: allowNull(formatHash), - parentHash: formatHash, - parentBeaconBlockRoot: allowNull(formatHash, null), - - number: getNumber, - - timestamp: getNumber, - nonce: allowNull(formatData), - difficulty: getBigInt, - - gasLimit: getBigInt, - gasUsed: getBigInt, - - stateRoot: allowNull(formatHash, null), - receiptsRoot: allowNull(formatHash, null), - - blobGasUsed: allowNull(getBigInt, null), - excessBlobGas: allowNull(getBigInt, null), - - miner: allowNull(getAddress), - prevRandao: allowNull(formatHash, null), - extraData: formatData, - - baseFeePerGas: allowNull(getBigInt) -}, { - prevRandao: [ "mixHash" ] -}); - -export function formatBlock(value: any): BlockParams { - const result = _formatBlock(value); - result.transactions = value.transactions.map((tx: string | TransactionResponseParams) => { - if (typeof(tx) === "string") { return tx; } - return formatTransactionResponse(tx); - }); - return result; -} - -const _formatReceiptLog = object({ - transactionIndex: getNumber, - blockNumber: getNumber, - transactionHash: formatHash, - address: getAddress, - topics: arrayOf(formatHash), - data: formatData, - index: getNumber, - blockHash: formatHash, -}, { - index: [ "logIndex" ] -}); - -export function formatReceiptLog(value: any): LogParams { - return _formatReceiptLog(value); -} - -const _formatTransactionReceipt = object({ - to: allowNull(getAddress, null), - from: allowNull(getAddress, null), - contractAddress: allowNull(getAddress, null), - // should be allowNull(hash), but broken-EIP-658 support is handled in receipt - index: getNumber, - root: allowNull(hexlify), - gasUsed: getBigInt, - blobGasUsed: allowNull(getBigInt, null), - logsBloom: allowNull(formatData), - blockHash: formatHash, - hash: formatHash, - logs: arrayOf(formatReceiptLog), - blockNumber: getNumber, - //confirmations: allowNull(getNumber, null), - cumulativeGasUsed: getBigInt, - effectiveGasPrice: allowNull(getBigInt), - blobGasPrice: allowNull(getBigInt, null), - status: allowNull(getNumber), - type: allowNull(getNumber, 0) -}, { - effectiveGasPrice: [ "gasPrice" ], - hash: [ "transactionHash" ], - index: [ "transactionIndex" ], -}); - -export function formatTransactionReceipt(value: any): TransactionReceiptParams { - return _formatTransactionReceipt(value); -} - -export function formatTransactionResponse(value: any): TransactionResponseParams { - - // Some clients (TestRPC) do strange things like return 0x0 for the - // 0 address; correct this to be a real address - if (value.to && getBigInt(value.to) === BN_0) { - value.to = "0x0000000000000000000000000000000000000000"; - } - - const result = object({ - hash: formatHash, - - // Some nodes do not return this, usually test nodes (like Ganache) - index: allowNull(getNumber, undefined), - - type: (value: any) => { - if (value === "0x" || value == null) { return 0; } - return getNumber(value); - }, - accessList: allowNull(accessListify, null), - blobVersionedHashes: allowNull(arrayOf(formatHash, true), null), - - authorizationList: allowNull(arrayOf((v: any) => { - let sig: SignatureLike; - if (v.signature) { - sig = v.signature; - - } else { - let yParity = v.yParity; - if (yParity === "0x1b") { - yParity = 0; - } else if (yParity === "0x1c") { - yParity = 1; - } - sig = Object.assign({ }, v, { yParity }); - } - - return { - address: getAddress(v.address), - chainId: getBigInt(v.chainId), - nonce: getBigInt(v.nonce), - signature: Signature.from(sig) - }; - }, false), null), - - blockHash: allowNull(formatHash, null), - blockNumber: allowNull(getNumber, null), - transactionIndex: allowNull(getNumber, null), - - from: getAddress, - - // either (gasPrice) or (maxPriorityFeePerGas + maxFeePerGas) must be set - gasPrice: allowNull(getBigInt), - maxPriorityFeePerGas: allowNull(getBigInt), - maxFeePerGas: allowNull(getBigInt), - maxFeePerBlobGas: allowNull(getBigInt, null), - - gasLimit: getBigInt, - to: allowNull(getAddress, null), - value: getBigInt, - nonce: getNumber, - data: formatData, - - creates: allowNull(getAddress, null), - - chainId: allowNull(getBigInt, null) - }, { - data: [ "input" ], - gasLimit: [ "gas" ], - index: [ "transactionIndex" ] - })(value); - - // If to and creates are empty, populate the creates from the value - if (result.to == null && result.creates == null) { - result.creates = getCreateAddress(result); - } - - // @TODO: Check fee data - - // Add an access list to supported transaction types - if ((value.type === 1 || value.type === 2) && value.accessList == null) { - result.accessList = [ ]; - } - - // Compute the signature - if (value.signature) { - result.signature = Signature.from(value.signature); - } else { - result.signature = Signature.from(value); - } - - // Some backends omit ChainId on legacy transactions, but we can compute it - if (result.chainId == null) { - const chainId = result.signature.legacyChainId; - if (chainId != null) { result.chainId = chainId; } - } - - - // @TODO: check chainID - /* - if (value.chainId != null) { - let chainId = value.chainId; - - if (isHexString(chainId)) { - chainId = BigNumber.from(chainId).toNumber(); - } - - result.chainId = chainId; - - } else { - let chainId = value.networkId; - - // geth-etc returns chainId - if (chainId == null && result.v == null) { - chainId = value.chainId; - } - - if (isHexString(chainId)) { - chainId = BigNumber.from(chainId).toNumber(); - } - - if (typeof(chainId) !== "number" && result.v != null) { - chainId = (result.v - 35) / 2; - if (chainId < 0) { chainId = 0; } - chainId = parseInt(chainId); - } - - if (typeof(chainId) !== "number") { chainId = 0; } - - result.chainId = chainId; - } - */ - - // 0x0000... should actually be null - if (result.blockHash && getBigInt(result.blockHash) === BN_0) { - result.blockHash = null; - } - - return result; -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/formatting.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/formatting.ts deleted file mode 100644 index 5497a058..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/formatting.ts +++ /dev/null @@ -1,418 +0,0 @@ -/** - * About provider formatting? - * - * @_section: api/providers/formatting:Formatting [provider-formatting] - */ - -import type { Signature } from "../crypto/index.js"; -import type { Authorization, AccessList } from "../transaction/index.js"; - - -////////////////////// -// Block - -/** - * a **BlockParams** encodes the minimal required properties for a - * formatted block. - */ -export interface BlockParams { - /** - * The block hash. - */ - hash?: null | string; - - /** - * The block number. - */ - number: number; - - /** - * The timestamp for this block, which is the number of seconds - * since epoch that this block was included. - */ - timestamp: number; - - /** - * The hash of the previous block in the blockchain. The genesis block - * has the parentHash of the [[ZeroHash]]. - */ - parentHash: string; - - /** - * The hash tree root of the parent beacon block for the given - * execution block. See [[link-eip-4788]]. - */ - parentBeaconBlockRoot?: null | string; - - /** - * A random sequence provided during the mining process for - * proof-of-work networks. - */ - nonce: string; - - /** - * For proof-of-work networks, the difficulty target is used to - * adjust the difficulty in mining to ensure an expected block rate. - */ - difficulty: bigint; - - /** - * The maximum amount of gas a block can consume. - */ - gasLimit: bigint; - - /** - * The amount of gas a block consumed. - */ - gasUsed: bigint; - - /** - * The total amount of BLOb gas consumed by transactions within - * the block. See [[link-eip4844]. - */ - blobGasUsed?: null | bigint; - - /** - * The running total of BLOb gas consumed in excess of the target - * prior to the block. See [[link-eip-4844]]. - */ - excessBlobGas?: null | bigint; - - /** - * The miner (or author) of a block. - */ - miner: string; - - /** - * The latest RANDAO mix of the post beacon state of - * the previous block. - */ - prevRandao?: null | string; - - /** - * Additional data the miner choose to include. - */ - extraData: string; - - /** - * The protocol-defined base fee per gas in an [[link-eip-1559]] - * block. - */ - baseFeePerGas: null | bigint; - - /** - * The root hash for the global state after applying changes - * in this block. - */ - stateRoot?: null | string; - - /** - * The hash of the transaction receipts trie. - */ - receiptsRoot?: null | string; - - /** - * The list of transactions in the block. - */ - transactions: ReadonlyArray; -}; - - -////////////////////// -// Log - -/** - * a **LogParams** encodes the minimal required properties for a - * formatted log. - */ -export interface LogParams { - /** - * The transaction hash for the transaxction the log occurred in. - */ - transactionHash: string; - - /** - * The block hash of the block that included the transaction for this - * log. - */ - blockHash: string; - - /** - * The block number of the block that included the transaction for this - * log. - */ - blockNumber: number; - - /** - * Whether this log was removed due to the transaction it was included - * in being removed dur to an orphaned block. - */ - removed: boolean; - - /** - * The address of the contract that emitted this log. - */ - address: string; - - /** - * The data emitted with this log. - */ - data: string; - - /** - * The topics emitted with this log. - */ - topics: ReadonlyArray; - - /** - * The index of this log. - */ - index: number; - - /** - * The transaction index of this log. - */ - transactionIndex: number; -} - - -////////////////////// -// Transaction Receipt - -/** - * a **TransactionReceiptParams** encodes the minimal required properties - * for a formatted transaction receipt. - */ -export interface TransactionReceiptParams { - /** - * The target of the transaction. If null, the transaction was trying - * to deploy a transaction with the ``data`` as the initi=code. - */ - to: null | string; - - /** - * The sender of the transaction. - */ - from: string; - - /** - * If the transaction was directly deploying a contract, the [[to]] - * will be null, the ``data`` will be initcode and if successful, this - * will be the address of the contract deployed. - */ - contractAddress: null | string; - - /** - * The transaction hash. - */ - hash: string; - - /** - * The transaction index. - */ - index: number; - - /** - * The block hash of the block that included this transaction. - */ - blockHash: string; - - /** - * The block number of the block that included this transaction. - */ - blockNumber: number; - - /** - * The bloom filter for the logs emitted during execution of this - * transaction. - */ - logsBloom: string; - - /** - * The logs emitted during the execution of this transaction. - */ - logs: ReadonlyArray; - - /** - * The amount of gas consumed executing this transaction. - */ - gasUsed: bigint; - - /** - * The amount of BLOb gas used. See [[link-eip-4844]]. - */ - blobGasUsed?: null | bigint; - - /** - * The total amount of gas consumed during the entire block up to - * and including this transaction. - */ - cumulativeGasUsed: bigint; - - /** - * The actual gas price per gas charged for this transaction. - */ - gasPrice?: null | bigint; - - /** - * The actual BLOb gas price that was charged. See [[link-eip-4844]]. - */ - blobGasPrice?: null | bigint; - - /** - * The actual gas price per gas charged for this transaction. - */ - effectiveGasPrice?: null | bigint; - - /** - * The [[link-eip-2718]] envelope type. - */ - type: number; - //byzantium: boolean; - - /** - * The status of the transaction execution. If ``1`` then the - * the transaction returned success, if ``0`` then the transaction - * was reverted. For pre-byzantium blocks, this is usually null, but - * some nodes may have backfilled this data. - */ - status: null | number; - - /** - * The root of this transaction in a pre-bazatium block. In - * post-byzantium blocks this is null. - */ - root: null | string; - -} - -/* -export interface LegacyTransactionReceipt { - byzantium: false; - status: null; - root: string; -} - -export interface ByzantiumTransactionReceipt { - byzantium: true; - status: number; - root: null; -} -*/ - - - -////////////////////// -// Transaction Response - -/** - * a **TransactionResponseParams** encodes the minimal required properties - * for a formatted transaction response. - */ -export interface TransactionResponseParams { - /** - * The block number of the block that included this transaction. - */ - blockNumber: null | number; - - /** - * The block hash of the block that included this transaction. - */ - blockHash: null | string; - - /** - * The transaction hash. - */ - hash: string; - - /** - * The transaction index. - */ - index: number; - - /** - * The [[link-eip-2718]] transaction type. - */ - type: number; - - /** - * The target of the transaction. If ``null``, the ``data`` is initcode - * and this transaction is a deployment transaction. - */ - to: null | string; - - /** - * The sender of the transaction. - */ - from: string; - - /** - * The nonce of the transaction, used for replay protection. - */ - nonce: number; - - /** - * The maximum amount of gas this transaction is authorized to consume. - */ - gasLimit: bigint; - - /** - * For legacy transactions, this is the gas price per gas to pay. - */ - gasPrice: bigint; - - /** - * For [[link-eip-1559]] transactions, this is the maximum priority - * fee to allow a producer to claim. - */ - maxPriorityFeePerGas: null | bigint; - - /** - * For [[link-eip-1559]] transactions, this is the maximum fee that - * will be paid. - */ - maxFeePerGas: null | bigint; - - /** - * For [[link-eip-4844]] transactions, this is the maximum fee that - * will be paid per BLOb. - */ - maxFeePerBlobGas?: null | bigint; - - /** - * The transaction data. - */ - data: string; - - /** - * The transaction value (in wei). - */ - value: bigint; - - /** - * The chain ID this transaction is valid on. - */ - chainId: bigint; - - /** - * The signature of the transaction. - */ - signature: Signature; - - /** - * The transaction access list. - */ - accessList: null | AccessList; - - /** - * The [[link-eip-4844]] BLOb versioned hashes. - */ - blobVersionedHashes?: null | Array; // @TODO: drop the "?"? (v7) - - /** - * The [[link-eip-7702]] authorizations (if any). - */ - authorizationList: null | Array; -}; - - diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/index.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/index.ts deleted file mode 100644 index 27a5460e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/index.ts +++ /dev/null @@ -1,135 +0,0 @@ -/** - * A **Provider** provides a connection to the blockchain, whch can be - * used to query its current state, simulate execution and send transactions - * to update the state. - * - * It is one of the most fundamental components of interacting with a - * blockchain application, and there are many ways to connect, such as over - * HTTP, WebSockets or injected providers such as [MetaMask](link-metamask). - * - * @_section: api/providers:Providers [about-providers] - */ - - -export { - AbstractProvider, UnmanagedSubscriber -} from "./abstract-provider.js"; - -export { - AbstractSigner, - VoidSigner, -} from "./abstract-signer.js"; - -export { - showThrottleMessage -} from "./community.js"; - -export { getDefaultProvider } from "./default-provider.js"; - -export { - EnsResolver, - MulticoinProviderPlugin -} from "./ens-resolver.js"; - -export { Network } from "./network.js"; - -export { NonceManager } from "./signer-noncemanager.js"; - -export { - NetworkPlugin, - GasCostPlugin, - EnsPlugin, - FeeDataNetworkPlugin, - FetchUrlFeeDataNetworkPlugin, -} from "./plugins-network.js"; - -export { - Block, - FeeData, - Log, - TransactionReceipt, - TransactionResponse, - - copyRequest, - //resolveTransactionRequest, -} from "./provider.js"; - -export { FallbackProvider } from "./provider-fallback.js"; -export { JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner } from "./provider-jsonrpc.js" - -export { BrowserProvider } from "./provider-browser.js"; - -export { AlchemyProvider } from "./provider-alchemy.js"; -export { BlockscoutProvider } from "./provider-blockscout.js"; -export { AnkrProvider } from "./provider-ankr.js"; -export { CloudflareProvider } from "./provider-cloudflare.js"; -export { ChainstackProvider } from "./provider-chainstack.js"; -export { EtherscanProvider, EtherscanPlugin } from "./provider-etherscan.js"; -export { InfuraProvider, InfuraWebSocketProvider } from "./provider-infura.js"; -export { PocketProvider } from "./provider-pocket.js"; -export { QuickNodeProvider } from "./provider-quicknode.js"; - -import { IpcSocketProvider } from "./provider-ipcsocket.js"; /*-browser*/ -export { IpcSocketProvider }; -export { SocketProvider } from "./provider-socket.js"; -export { WebSocketProvider } from "./provider-websocket.js"; - -export { - SocketSubscriber, SocketBlockSubscriber, SocketPendingSubscriber, - SocketEventSubscriber -} from "./provider-socket.js"; - -export type { - AbstractProviderOptions, Subscription, Subscriber, - AbstractProviderPlugin, - PerformActionFilter, PerformActionTransaction, PerformActionRequest, -} from "./abstract-provider.js" - -export type { ContractRunner } from "./contracts.js"; - -export type { - BlockParams, LogParams, TransactionReceiptParams, - TransactionResponseParams, -} from "./formatting.js"; - -export type { - CommunityResourcable -} from "./community.js"; - -/* -export type { - AvatarLinkageType, AvatarLinkage, AvatarResult -} from "./ens-resolver.js"; -*/ -export type { Networkish } from "./network.js"; - -export type { GasCostParameters } from "./plugins-network.js"; - -export type { - BlockTag, - TransactionRequest, PreparedTransactionRequest, - EventFilter, Filter, FilterByBlockHash, OrphanFilter, ProviderEvent, - TopicFilter, - Provider, - MinedBlock, MinedTransactionResponse -} from "./provider.js"; - -export type { - BrowserDiscoverOptions, BrowserProviderOptions, DebugEventBrowserProvider, - Eip1193Provider, Eip6963ProviderInfo -} from "./provider-browser.js"; - -export type { FallbackProviderOptions } from "./provider-fallback.js"; - -export type { - JsonRpcPayload, JsonRpcResult, JsonRpcError, - JsonRpcApiProviderOptions, - JsonRpcTransactionRequest, -} from "./provider-jsonrpc.js"; - -export type { - WebSocketCreator, WebSocketLike -} from "./provider-websocket.js"; - -export type { Signer } from "./signer.js"; - diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/network.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/network.ts deleted file mode 100644 index 2e99c25d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/network.ts +++ /dev/null @@ -1,438 +0,0 @@ -/** - * A **Network** encapsulates the various properties required to - * interact with a specific chain. - * - * @_subsection: api/providers:Networks [networks] - */ - -import { accessListify } from "../transaction/index.js"; -import { getBigInt, assert, assertArgument } from "../utils/index.js"; - -import { - EnsPlugin, FetchUrlFeeDataNetworkPlugin, GasCostPlugin -} from "./plugins-network.js"; - -import type { BigNumberish } from "../utils/index.js"; -import type { TransactionLike } from "../transaction/index.js"; - -import type { NetworkPlugin } from "./plugins-network.js"; - - -/** - * A Networkish can be used to allude to a Network, by specifing: - * - a [[Network]] object - * - a well-known (or registered) network name - * - a well-known (or registered) chain ID - * - an object with sufficient details to describe a network - */ -export type Networkish = Network | number | bigint | string | { - name?: string, - chainId?: number, - //layerOneConnection?: Provider, - ensAddress?: string, - ensNetwork?: number -}; - - - - -/* * * * -// Networks which operation against an L2 can use this plugin to -// specify how to access L1, for the purpose of resolving ENS, -// for example. -export class LayerOneConnectionPlugin extends NetworkPlugin { - readonly provider!: Provider; -// @TODO: Rename to ChainAccess and allow for connecting to any chain - constructor(provider: Provider) { - super("org.ethers.plugins.layer-one-connection"); - defineProperties(this, { provider }); - } - - clone(): LayerOneConnectionPlugin { - return new LayerOneConnectionPlugin(this.provider); - } -} -*/ - - -const Networks: Map Network> = new Map(); - - -/** - * A **Network** provides access to a chain's properties and allows - * for plug-ins to extend functionality. - */ -export class Network { - #name: string; - #chainId: bigint; - - #plugins: Map; - - /** - * Creates a new **Network** for %%name%% and %%chainId%%. - */ - constructor(name: string, chainId: BigNumberish) { - this.#name = name; - this.#chainId = getBigInt(chainId); - this.#plugins = new Map(); - } - - /** - * Returns a JSON-compatible representation of a Network. - */ - toJSON(): any { - return { name: this.name, chainId: String(this.chainId) }; - } - - /** - * The network common name. - * - * This is the canonical name, as networks migh have multiple - * names. - */ - get name(): string { return this.#name; } - set name(value: string) { this.#name = value; } - - /** - * The network chain ID. - */ - get chainId(): bigint { return this.#chainId; } - set chainId(value: BigNumberish) { this.#chainId = getBigInt(value, "chainId"); } - - /** - * Returns true if %%other%% matches this network. Any chain ID - * must match, and if no chain ID is present, the name must match. - * - * This method does not currently check for additional properties, - * such as ENS address or plug-in compatibility. - */ - matches(other: Networkish): boolean { - if (other == null) { return false; } - - if (typeof(other) === "string") { - try { - return (this.chainId === getBigInt(other)); - } catch (error) { } - return (this.name === other); - } - - if (typeof(other) === "number" || typeof(other) === "bigint") { - try { - return (this.chainId === getBigInt(other)); - } catch (error) { } - return false; - } - - if (typeof(other) === "object") { - if (other.chainId != null) { - try { - return (this.chainId === getBigInt(other.chainId)); - } catch (error) { } - return false; - } - if (other.name != null) { - return (this.name === other.name); - } - return false; - } - - return false; - } - - /** - * Returns the list of plugins currently attached to this Network. - */ - get plugins(): Array { - return Array.from(this.#plugins.values()); - } - - /** - * Attach a new %%plugin%% to this Network. The network name - * must be unique, excluding any fragment. - */ - attachPlugin(plugin: NetworkPlugin): this { - if (this.#plugins.get(plugin.name)) { - throw new Error(`cannot replace existing plugin: ${ plugin.name } `); - } - this.#plugins.set(plugin.name, plugin.clone()); - return this; - } - - /** - * Return the plugin, if any, matching %%name%% exactly. Plugins - * with fragments will not be returned unless %%name%% includes - * a fragment. - */ - getPlugin(name: string): null | T { - return (this.#plugins.get(name)) || null; - } - - /** - * Gets a list of all plugins that match %%name%%, with otr without - * a fragment. - */ - getPlugins(basename: string): Array { - return >(this.plugins.filter((p) => (p.name.split("#")[0] === basename))); - } - - /** - * Create a copy of this Network. - */ - clone(): Network { - const clone = new Network(this.name, this.chainId); - this.plugins.forEach((plugin) => { - clone.attachPlugin(plugin.clone()); - }); - return clone; - } - - /** - * Compute the intrinsic gas required for a transaction. - * - * A GasCostPlugin can be attached to override the default - * values. - */ - computeIntrinsicGas(tx: TransactionLike): number { - const costs = this.getPlugin("org.ethers.plugins.network.GasCost") || (new GasCostPlugin()); - - let gas = costs.txBase; - if (tx.to == null) { gas += costs.txCreate; } - if (tx.data) { - for (let i = 2; i < tx.data.length; i += 2) { - if (tx.data.substring(i, i + 2) === "00") { - gas += costs.txDataZero; - } else { - gas += costs.txDataNonzero; - } - } - } - - if (tx.accessList) { - const accessList = accessListify(tx.accessList); - for (const addr in accessList) { - gas += costs.txAccessListAddress + costs.txAccessListStorageKey * accessList[addr].storageKeys.length; - } - } - - return gas; - } - - /** - * Returns a new Network for the %%network%% name or chainId. - */ - static from(network?: Networkish): Network { - injectCommonNetworks(); - - // Default network - if (network == null) { return Network.from("mainnet"); } - - // Canonical name or chain ID - if (typeof(network) === "number") { network = BigInt(network); } - if (typeof(network) === "string" || typeof(network) === "bigint") { - const networkFunc = Networks.get(network); - if (networkFunc) { return networkFunc(); } - if (typeof(network) === "bigint") { - return new Network("unknown", network); - } - - assertArgument(false, "unknown network", "network", network); - } - - // Clonable with network-like abilities - if (typeof((network).clone) === "function") { - const clone = (network).clone(); - //if (typeof(network.name) !== "string" || typeof(network.chainId) !== "number") { - //} - return clone; - } - - // Networkish - if (typeof(network) === "object") { - assertArgument(typeof(network.name) === "string" && typeof(network.chainId) === "number", - "invalid network object name or chainId", "network", network); - - const custom = new Network((network.name), (network.chainId)); - - if ((network).ensAddress || (network).ensNetwork != null) { - custom.attachPlugin(new EnsPlugin((network).ensAddress, (network).ensNetwork)); - } - - //if ((network).layerOneConnection) { - // custom.attachPlugin(new LayerOneConnectionPlugin((network).layerOneConnection)); - //} - - return custom; - } - - assertArgument(false, "invalid network", "network", network); - } - - /** - * Register %%nameOrChainId%% with a function which returns - * an instance of a Network representing that chain. - */ - static register(nameOrChainId: string | number | bigint, networkFunc: () => Network): void { - if (typeof(nameOrChainId) === "number") { nameOrChainId = BigInt(nameOrChainId); } - const existing = Networks.get(nameOrChainId); - if (existing) { - assertArgument(false, `conflicting network for ${ JSON.stringify(existing.name) }`, "nameOrChainId", nameOrChainId); - } - Networks.set(nameOrChainId, networkFunc); - } -} - - -type Options = { - ensNetwork?: number; - altNames?: Array; - plugins?: Array; -}; - -// We don't want to bring in formatUnits because it is backed by -// FixedNumber and we want to keep Networks tiny. The values -// included by the Gas Stations are also IEEE 754 with lots of -// rounding issues and exceed the strict checks formatUnits has. -function parseUnits(_value: number | string, decimals: number): bigint { - const value = String(_value); - if (!value.match(/^[0-9.]+$/)) { - throw new Error(`invalid gwei value: ${ _value }`); - } - - // Break into [ whole, fraction ] - const comps = value.split("."); - if (comps.length === 1) { comps.push(""); } - - // More than 1 decimal point or too many fractional positions - if (comps.length !== 2) { - throw new Error(`invalid gwei value: ${ _value }`); - } - - // Pad the fraction to 9 decimalplaces - while (comps[1].length < decimals) { comps[1] += "0"; } - - // Too many decimals and some non-zero ending, take the ceiling - if (comps[1].length > 9) { - let frac = BigInt(comps[1].substring(0, 9)); - if (!comps[1].substring(9).match(/^0+$/)) { frac++; } - comps[1] = frac.toString(); - } - - return BigInt(comps[0] + comps[1]); -} - -// Used by Polygon to use a gas station for fee data -function getGasStationPlugin(url: string) { - return new FetchUrlFeeDataNetworkPlugin(url, async (fetchFeeData, provider, request) => { - - // Prevent Cloudflare from blocking our request in node.js - request.setHeader("User-Agent", "ethers"); - - let response; - try { - const [ _response, _feeData ] = await Promise.all([ - request.send(), fetchFeeData() - ]); - response = _response; - const payload = response.bodyJson.standard; - const feeData = { - gasPrice: _feeData.gasPrice, - maxFeePerGas: parseUnits(payload.maxFee, 9), - maxPriorityFeePerGas: parseUnits(payload.maxPriorityFee, 9), - }; - return feeData; - } catch (error: any) { - assert(false, `error encountered with polygon gas station (${ JSON.stringify(request.url) })`, "SERVER_ERROR", { request, response, error }); - } - }); -} - -// See: https://chainlist.org -let injected = false; -function injectCommonNetworks(): void { - if (injected) { return; } - injected = true; - - /// Register popular Ethereum networks - function registerEth(name: string, chainId: number, options: Options): void { - const func = function() { - const network = new Network(name, chainId); - - // We use 0 to disable ENS - if (options.ensNetwork != null) { - network.attachPlugin(new EnsPlugin(null, options.ensNetwork)); - } - - network.attachPlugin(new GasCostPlugin()); - - (options.plugins || []).forEach((plugin) => { - network.attachPlugin(plugin); - }); - - return network; - }; - - // Register the network by name and chain ID - Network.register(name, func); - Network.register(chainId, func); - - if (options.altNames) { - options.altNames.forEach((name) => { - Network.register(name, func); - }); - } - } - - registerEth("mainnet", 1, { ensNetwork: 1, altNames: [ "homestead" ] }); - registerEth("ropsten", 3, { ensNetwork: 3 }); - registerEth("rinkeby", 4, { ensNetwork: 4 }); - registerEth("goerli", 5, { ensNetwork: 5 }); - registerEth("kovan", 42, { ensNetwork: 42 }); - registerEth("sepolia", 11155111, { ensNetwork: 11155111 }); - registerEth("holesky", 17000, { ensNetwork: 17000 }); - - registerEth("classic", 61, { }); - registerEth("classicKotti", 6, { }); - - registerEth("arbitrum", 42161, { - ensNetwork: 1, - }); - registerEth("arbitrum-goerli", 421613, { }); - registerEth("arbitrum-sepolia", 421614, { }); - - registerEth("base", 8453, { ensNetwork: 1 }); - registerEth("base-goerli", 84531, { }); - registerEth("base-sepolia", 84532, { }); - - registerEth("bnb", 56, { ensNetwork: 1 }); - registerEth("bnbt", 97, { }); - - registerEth("filecoin", 314, { }); - registerEth("filecoin-calibration", 314159, { }); - - registerEth("linea", 59144, { ensNetwork: 1 }); - registerEth("linea-goerli", 59140, { }); - registerEth("linea-sepolia", 59141, { }); - - registerEth("matic", 137, { - ensNetwork: 1, - plugins: [ - getGasStationPlugin("https:/\/gasstation.polygon.technology/v2") - ] - }); - registerEth("matic-amoy", 80002, { }); - registerEth("matic-mumbai", 80001, { - altNames: [ "maticMumbai", "maticmum" ], // @TODO: Future remove these alts - plugins: [ - getGasStationPlugin("https:/\/gasstation-testnet.polygon.technology/v2") - ] - }); - - registerEth("optimism", 10, { - ensNetwork: 1, - plugins: [ ] - }); - registerEth("optimism-goerli", 420, { }); - registerEth("optimism-sepolia", 11155420, { }); - - registerEth("xdai", 100, { ensNetwork: 1 }); -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/pagination.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/pagination.ts deleted file mode 100644 index 022688c0..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/pagination.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface PaginationResult extends Array { - next(): Promise>; - - // The total number of results available or null if unknown - totalResults: null | number; - - done: boolean; -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/plugin-fallback.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/plugin-fallback.ts deleted file mode 100644 index 777b128a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/plugin-fallback.ts +++ /dev/null @@ -1,35 +0,0 @@ - -import { AbstractProviderPlugin } from "./abstract-provider.js"; -import { defineProperties } from "../utils/index.js"; - -import type { AbstractProvider, PerformActionRequest } from "./abstract-provider.js"; - - -export const PluginIdFallbackProvider = "org.ethers.plugins.provider.QualifiedPlugin"; - -export class CheckQualifiedPlugin implements AbstractProviderPlugin { - declare name: string; - - constructor() { - defineProperties(this, { name: PluginIdFallbackProvider }); - } - - connect(provider: AbstractProvider): CheckQualifiedPlugin { - return this; - } - - // Retruns true if this value should be considered qualified for - // inclusion in the quorum. - isQualified(action: PerformActionRequest, result: any): boolean { - return true; - } -} - -export class PossiblyPrunedTransactionPlugin extends CheckQualifiedPlugin { - isQualified(action: PerformActionRequest, result: any): boolean { - if (action.method === "getTransaction" || action.method === "getTransactionReceipt") { - if (result == null) { return false; } - } - return super.isQualified(action, result); - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/plugins-network.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/plugins-network.ts deleted file mode 100644 index 10df66f8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/plugins-network.ts +++ /dev/null @@ -1,281 +0,0 @@ -import { defineProperties } from "../utils/properties.js"; - -import { assertArgument } from "../utils/index.js"; - -import type { FeeData, Provider } from "./provider.js"; -import type { FetchRequest } from "../utils/fetch.js"; - - -const EnsAddress = "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"; - -/** - * A **NetworkPlugin** provides additional functionality on a [[Network]]. - */ -export class NetworkPlugin { - /** - * The name of the plugin. - * - * It is recommended to use reverse-domain-notation, which permits - * unique names with a known authority as well as hierarchal entries. - */ - readonly name!: string; - - /** - * Creates a new **NetworkPlugin**. - */ - constructor(name: string) { - defineProperties(this, { name }); - } - - /** - * Creates a copy of this plugin. - */ - clone(): NetworkPlugin { - return new NetworkPlugin(this.name); - } - -// validate(network: Network): NetworkPlugin { -// return this; -// } -} - - -/** - * The gas cost parameters for a [[GasCostPlugin]]. - */ -export type GasCostParameters = { - /** - * The transactions base fee. - */ - txBase?: number; - - /** - * The fee for creating a new account. - */ - txCreate?: number; - - /** - * The fee per zero-byte in the data. - */ - txDataZero?: number; - - /** - * The fee per non-zero-byte in the data. - */ - txDataNonzero?: number; - - /** - * The fee per storage key in the [[link-eip-2930]] access list. - */ - txAccessListStorageKey?: number; - - /** - * The fee per address in the [[link-eip-2930]] access list. - */ - txAccessListAddress?: number; -}; - -/** - * A **GasCostPlugin** allows a network to provide alternative values when - * computing the intrinsic gas required for a transaction. - */ -export class GasCostPlugin extends NetworkPlugin implements GasCostParameters { - /** - * The block number to treat these values as valid from. - * - * This allows a hardfork to have updated values included as well as - * mulutiple hardforks to be supported. - */ - readonly effectiveBlock!: number; - - /** - * The transactions base fee. - */ - readonly txBase!: number; - - /** - * The fee for creating a new account. - */ - readonly txCreate!: number; - - /** - * The fee per zero-byte in the data. - */ - readonly txDataZero!: number; - - /** - * The fee per non-zero-byte in the data. - */ - readonly txDataNonzero!: number; - - /** - * The fee per storage key in the [[link-eip-2930]] access list. - */ - readonly txAccessListStorageKey!: number; - - /** - * The fee per address in the [[link-eip-2930]] access list. - */ - readonly txAccessListAddress!: number; - - - /** - * Creates a new GasCostPlugin from %%effectiveBlock%% until the - * latest block or another GasCostPlugin supercedes that block number, - * with the associated %%costs%%. - */ - constructor(effectiveBlock?: number, costs?: GasCostParameters) { - if (effectiveBlock == null) { effectiveBlock = 0; } - super(`org.ethers.network.plugins.GasCost#${ (effectiveBlock || 0) }`); - - const props: Record = { effectiveBlock }; - function set(name: keyof GasCostParameters, nullish: number): void { - let value = (costs || { })[name]; - if (value == null) { value = nullish; } - assertArgument(typeof(value) === "number", `invalud value for ${ name }`, "costs", costs); - props[name] = value; - } - - set("txBase", 21000); - set("txCreate", 32000); - set("txDataZero", 4); - set("txDataNonzero", 16); - set("txAccessListStorageKey", 1900); - set("txAccessListAddress", 2400); - - defineProperties(this, props); - } - - clone(): GasCostPlugin { - return new GasCostPlugin(this.effectiveBlock, this); - } -} - -/** - * An **EnsPlugin** allows a [[Network]] to specify the ENS Registry - * Contract address and the target network to use when using that - * contract. - * - * Various testnets have their own instance of the contract to use, but - * in general, the mainnet instance supports multi-chain addresses and - * should be used. - */ -export class EnsPlugin extends NetworkPlugin { - - /** - * The ENS Registrty Contract address. - */ - readonly address!: string; - - /** - * The chain ID that the ENS contract lives on. - */ - readonly targetNetwork!: number; - - /** - * Creates a new **EnsPlugin** connected to %%address%% on the - * %%targetNetwork%%. The default ENS address and mainnet is used - * if unspecified. - */ - constructor(address?: null | string, targetNetwork?: null | number) { - super("org.ethers.plugins.network.Ens"); - defineProperties(this, { - address: (address || EnsAddress), - targetNetwork: ((targetNetwork == null) ? 1: targetNetwork) - }); - } - - clone(): EnsPlugin { - return new EnsPlugin(this.address, this.targetNetwork); - } -} - -/** - * A **FeeDataNetworkPlugin** allows a network to provide and alternate - * means to specify its fee data. - * - * For example, a network which does not support [[link-eip-1559]] may - * choose to use a Gas Station site to approximate the gas price. - */ -export class FeeDataNetworkPlugin extends NetworkPlugin { - readonly #feeDataFunc: (provider: Provider) => Promise; - - /** - * The fee data function provided to the constructor. - */ - get feeDataFunc(): (provider: Provider) => Promise { - return this.#feeDataFunc; - } - - /** - * Creates a new **FeeDataNetworkPlugin**. - */ - constructor(feeDataFunc: (provider: Provider) => Promise) { - super("org.ethers.plugins.network.FeeData"); - this.#feeDataFunc = feeDataFunc; - } - - /** - * Resolves to the fee data. - */ - async getFeeData(provider: Provider): Promise { - return await this.#feeDataFunc(provider); - } - - clone(): FeeDataNetworkPlugin { - return new FeeDataNetworkPlugin(this.#feeDataFunc); - } -} - -export class FetchUrlFeeDataNetworkPlugin extends NetworkPlugin { - readonly #url: string; - readonly #processFunc: (f: () => Promise, p: Provider, r: FetchRequest) => Promise<{ gasPrice?: null | bigint, maxFeePerGas?: null | bigint, maxPriorityFeePerGas?: null | bigint }>; - - /** - * The URL to initialize the FetchRequest with in %%processFunc%%. - */ - get url(): string { return this.#url; } - - /** - * The callback to use when computing the FeeData. - */ - get processFunc(): (f: () => Promise, p: Provider, r: FetchRequest) => Promise<{ gasPrice?: null | bigint, maxFeePerGas?: null | bigint, maxPriorityFeePerGas?: null | bigint }> { return this.#processFunc; } - - /** - * Creates a new **FetchUrlFeeDataNetworkPlugin** which will - * be used when computing the fee data for the network. - */ - constructor(url: string, processFunc: (f: () => Promise, p: Provider, r: FetchRequest) => Promise<{ gasPrice?: null | bigint, maxFeePerGas?: null | bigint, maxPriorityFeePerGas?: null | bigint }>) { - super("org.ethers.plugins.network.FetchUrlFeeDataPlugin"); - this.#url = url; - this.#processFunc = processFunc; - } - - // We are immutable, so we can serve as our own clone - clone(): FetchUrlFeeDataNetworkPlugin { return this; } -} - -/* -export class CustomBlockNetworkPlugin extends NetworkPlugin { - readonly #blockFunc: (provider: Provider, block: BlockParams) => Block; - readonly #blockWithTxsFunc: (provider: Provider, block: BlockParams) => Block; - - constructor(blockFunc: (provider: Provider, block: BlockParams) => Block, blockWithTxsFunc: (provider: Provider, block: BlockParams) => Block) { - super("org.ethers.network-plugins.custom-block"); - this.#blockFunc = blockFunc; - this.#blockWithTxsFunc = blockWithTxsFunc; - } - - async getBlock(provider: Provider, block: BlockParams): Promise> { - return await this.#blockFunc(provider, block); - } - - async getBlockions(provider: Provider, block: BlockParams): Promise> { - return await this.#blockWithTxsFunc(provider, block); - } - - clone(): CustomBlockNetworkPlugin { - return new CustomBlockNetworkPlugin(this.#blockFunc, this.#blockWithTxsFunc); - } -} -*/ diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-alchemy.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-alchemy.ts deleted file mode 100644 index 75292060..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-alchemy.ts +++ /dev/null @@ -1,166 +0,0 @@ -/** - * [[link-alchemy]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Arbitrum Sepolia Testnet (``arbitrum-sepolia``) - * - Base (``base``) - * - Base Goerlia Testnet (``base-goerli``) - * - Base Sepolia Testnet (``base-sepolia``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Optimism Sepolia Testnet (``optimism-sepolia``) - * - Polygon (``matic``) - * - Polygon Amoy Testnet (``matic-amoy``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:Alchemy [providers-alchemy] - */ - -import { - defineProperties, resolveProperties, assert, assertArgument, - FetchRequest -} from "../utils/index.js"; - -import { showThrottleMessage } from "./community.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; - -import type { AbstractProvider, PerformActionRequest } from "./abstract-provider.js"; -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; - - -const defaultApiKey = "_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC" - -function getHost(name: string): string { - switch(name) { - case "mainnet": - return "eth-mainnet.g.alchemy.com"; - case "goerli": - return "eth-goerli.g.alchemy.com"; - case "sepolia": - return "eth-sepolia.g.alchemy.com"; - - case "arbitrum": - return "arb-mainnet.g.alchemy.com"; - case "arbitrum-goerli": - return "arb-goerli.g.alchemy.com"; - case "arbitrum-sepolia": - return "arb-sepolia.g.alchemy.com"; - case "base": - return "base-mainnet.g.alchemy.com"; - case "base-goerli": - return "base-goerli.g.alchemy.com"; - case "base-sepolia": - return "base-sepolia.g.alchemy.com"; - case "matic": - return "polygon-mainnet.g.alchemy.com"; - case "matic-amoy": - return "polygon-amoy.g.alchemy.com"; - case "matic-mumbai": - return "polygon-mumbai.g.alchemy.com"; - case "optimism": - return "opt-mainnet.g.alchemy.com"; - case "optimism-goerli": - return "opt-goerli.g.alchemy.com"; - case "optimism-sepolia": - return "opt-sepolia.g.alchemy.com"; - } - - assertArgument(false, "unsupported network", "network", name); -} - -/** - * The **AlchemyProvider** connects to the [[link-alchemy]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-alchemy-signup). - * - * @_docloc: api/providers/thirdparty - */ -export class AlchemyProvider extends JsonRpcProvider implements CommunityResourcable { - readonly apiKey!: string; - - constructor(_network?: Networkish, apiKey?: null | string) { - if (_network == null) { _network = "mainnet"; } - const network = Network.from(_network); - if (apiKey == null) { apiKey = defaultApiKey; } - - const request = AlchemyProvider.getRequest(network, apiKey); - super(request, network, { staticNetwork: network }); - - defineProperties(this, { apiKey }); - } - - _getProvider(chainId: number): AbstractProvider { - try { - return new AlchemyProvider(chainId, this.apiKey); - } catch (error) { } - return super._getProvider(chainId); - } - - async _perform(req: PerformActionRequest): Promise { - - // https://docs.alchemy.com/reference/trace-transaction - if (req.method === "getTransactionResult") { - const { trace, tx } = await resolveProperties({ - trace: this.send("trace_transaction", [ req.hash ]), - tx: this.getTransaction(req.hash) - }); - if (trace == null || tx == null) { return null; } - - let data: undefined | string; - let error = false; - try { - data = trace[0].result.output; - error = (trace[0].error === "Reverted"); - } catch (error) { } - - if (data) { - assert(!error, "an error occurred during transaction executions", "CALL_EXCEPTION", { - action: "getTransactionResult", - data, - reason: null, - transaction: tx, - invocation: null, - revert: null // @TODO - }); - return data; - } - - assert(false, "could not parse trace result", "BAD_DATA", { value: trace }); - } - - return await super._perform(req); - } - - isCommunityResource(): boolean { - return (this.apiKey === defaultApiKey); - } - - static getRequest(network: Network, apiKey?: string): FetchRequest { - if (apiKey == null) { apiKey = defaultApiKey; } - - const request = new FetchRequest(`https:/\/${ getHost(network.name) }/v2/${ apiKey }`); - request.allowGzip = true; - - if (apiKey === defaultApiKey) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("alchemy"); - return true; - } - } - - return request; - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-ankr.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-ankr.ts deleted file mode 100644 index 780cd572..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-ankr.ts +++ /dev/null @@ -1,159 +0,0 @@ -/** - * [[link-ankr]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Arbitrum (``arbitrum``) - * - Base (``base``) - * - Base Goerlia Testnet (``base-goerli``) - * - Base Sepolia Testnet (``base-sepolia``) - * - BNB (``bnb``) - * - BNB Testnet (``bnbt``) - * - Filecoin (``filecoin``) - * - Filecoin Calibration Testnet (``filecoin-calibration``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Optimism Sepolia Testnet (``optimism-sepolia``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:Ankr [providers-ankr] - */ -import { - defineProperties, FetchRequest, assertArgument -} from "../utils/index.js"; - -import { AbstractProvider } from "./abstract-provider.js"; -import { showThrottleMessage } from "./community.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; - -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; -import type { JsonRpcError, JsonRpcPayload } from "./provider-jsonrpc.js"; - - -const defaultApiKey = "9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972"; - -function getHost(name: string): string { - switch (name) { - case "mainnet": - return "rpc.ankr.com/eth"; - case "goerli": - return "rpc.ankr.com/eth_goerli"; - case "sepolia": - return "rpc.ankr.com/eth_sepolia"; - - case "arbitrum": - return "rpc.ankr.com/arbitrum"; - case "base": - return "rpc.ankr.com/base"; - case "base-goerli": - return "rpc.ankr.com/base_goerli"; - case "base-sepolia": - return "rpc.ankr.com/base_sepolia"; - case "bnb": - return "rpc.ankr.com/bsc"; - case "bnbt": - return "rpc.ankr.com/bsc_testnet_chapel"; - case "filecoin": - return "rpc.ankr.com/filecoin"; - case "filecoin-calibration": - return "rpc.ankr.com/filecoin_testnet"; - case "matic": - return "rpc.ankr.com/polygon"; - case "matic-mumbai": - return "rpc.ankr.com/polygon_mumbai"; - case "optimism": - return "rpc.ankr.com/optimism"; - case "optimism-goerli": - return "rpc.ankr.com/optimism_testnet"; - case "optimism-sepolia": - return "rpc.ankr.com/optimism_sepolia"; - } - - assertArgument(false, "unsupported network", "network", name); -} - - -/** - * The **AnkrProvider** connects to the [[link-ankr]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-ankr-signup). - */ -export class AnkrProvider extends JsonRpcProvider implements CommunityResourcable { - - /** - * The API key for the Ankr connection. - */ - readonly apiKey!: string; - - /** - * Create a new **AnkrProvider**. - * - * By default connecting to ``mainnet`` with a highly throttled - * API key. - */ - constructor(_network?: Networkish, apiKey?: null | string) { - if (_network == null) { _network = "mainnet"; } - const network = Network.from(_network); - if (apiKey == null) { apiKey = defaultApiKey; } - - // Ankr does not support filterId, so we force polling - const options = { polling: true, staticNetwork: network }; - - const request = AnkrProvider.getRequest(network, apiKey); - super(request, network, options); - - defineProperties(this, { apiKey }); - } - - _getProvider(chainId: number): AbstractProvider { - try { - return new AnkrProvider(chainId, this.apiKey); - } catch (error) { } - return super._getProvider(chainId); - } - - /** - * Returns a prepared request for connecting to %%network%% with - * %%apiKey%%. - */ - static getRequest(network: Network, apiKey?: null | string): FetchRequest { - if (apiKey == null) { apiKey = defaultApiKey; } - - const request = new FetchRequest(`https:/\/${ getHost(network.name) }/${ apiKey }`); - request.allowGzip = true; - - if (apiKey === defaultApiKey) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("AnkrProvider"); - return true; - }; - } - - return request; - } - - getRpcError(payload: JsonRpcPayload, error: JsonRpcError): Error { - if (payload.method === "eth_sendRawTransaction") { - if (error && error.error && error.error.message === "INTERNAL_ERROR: could not replace existing tx") { - error.error.message = "replacement transaction underpriced"; - } - } - - return super.getRpcError(payload, error); - } - - isCommunityResource(): boolean { - return (this.apiKey === defaultApiKey); - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-blockscout.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-blockscout.ts deleted file mode 100644 index bdea74b4..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-blockscout.ts +++ /dev/null @@ -1,167 +0,0 @@ - -/** - * [[link-blockscout]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Sepolia Testnet (``sepolia``) - * - Holesky Testnet (``holesky``) - * - Ethereum Classic (``classic``) - * - Arbitrum (``arbitrum``) - * - Base (``base``) - * - Base Sepolia Testnet (``base-sepolia``) - * - Gnosis (``xdai``) - * - Optimism (``optimism``) - * - Optimism Sepolia Testnet (``optimism-sepolia``) - * - Polygon (``matic``) - * - * @_subsection: api/providers/thirdparty:Blockscout [providers-blockscout] - */ -import { - assertArgument, defineProperties, FetchRequest, isHexString -} from "../utils/index.js"; - -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; - -import type { AbstractProvider, PerformActionRequest } from "./abstract-provider.js"; -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; -import type { JsonRpcPayload, JsonRpcError } from "./provider-jsonrpc.js"; - - -function getUrl(name: string): string { - switch(name) { - case "mainnet": - return "https:/\/eth.blockscout.com/api/eth-rpc"; - case "sepolia": - return "https:/\/eth-sepolia.blockscout.com/api/eth-rpc"; - case "holesky": - return "https:/\/eth-holesky.blockscout.com/api/eth-rpc"; - - case "classic": - return "https:/\/etc.blockscout.com/api/eth-rpc"; - - case "arbitrum": - return "https:/\/arbitrum.blockscout.com/api/eth-rpc"; - - case "base": - return "https:/\/base.blockscout.com/api/eth-rpc"; - case "base-sepolia": - return "https:/\/base-sepolia.blockscout.com/api/eth-rpc"; - - case "matic": - return "https:/\/polygon.blockscout.com/api/eth-rpc"; - - case "optimism": - return "https:/\/optimism.blockscout.com/api/eth-rpc"; - case "optimism-sepolia": - return "https:/\/optimism-sepolia.blockscout.com/api/eth-rpc"; - - case "xdai": - return "https:/\/gnosis.blockscout.com/api/eth-rpc"; - } - - assertArgument(false, "unsupported network", "network", name); -} - - -/** - * The **BlockscoutProvider** connects to the [[link-blockscout]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-blockscout). - */ -export class BlockscoutProvider extends JsonRpcProvider implements CommunityResourcable { - /** - * The API key. - */ - readonly apiKey!: null | string; - - /** - * Creates a new **BlockscoutProvider**. - */ - constructor(_network?: Networkish, apiKey?: null | string) { - if (_network == null) { _network = "mainnet"; } - const network = Network.from(_network); - - if (apiKey == null) { apiKey = null; } - - const request = BlockscoutProvider.getRequest(network); - super(request, network, { staticNetwork: network }); - - defineProperties(this, { apiKey }); - } - - _getProvider(chainId: number): AbstractProvider { - try { - return new BlockscoutProvider(chainId, this.apiKey); - } catch (error) { } - return super._getProvider(chainId); - } - - isCommunityResource(): boolean { - return (this.apiKey === null); - } - - getRpcRequest(req: PerformActionRequest): null | { method: string, args: Array } { - // Blockscout enforces the TAG argument for estimateGas - const resp = super.getRpcRequest(req); - if (resp && resp.method === "eth_estimateGas" && resp.args.length == 1) { - resp.args = resp.args.slice(); - resp.args.push("latest"); - } - return resp; - } - - getRpcError(payload: JsonRpcPayload, _error: JsonRpcError): Error { - const error = _error ? _error.error: null; - - // Blockscout currently drops the VM result and replaces it with a - // human-readable string, so we need to make it machine-readable. - if (error && error.code === -32015 && !isHexString(error.data || "", true)) { - const panicCodes = >{ - "assert(false)": "01", - "arithmetic underflow or overflow": "11", - "division or modulo by zero": "12", - "out-of-bounds array access; popping on an empty array": "31", - "out-of-bounds access of an array or bytesN": "32" - }; - - let panicCode = ""; - if (error.message === "VM execution error.") { - // eth_call passes this message - panicCode = panicCodes[error.data] || ""; - } else if (panicCodes[error.message || ""]) { - panicCode = panicCodes[error.message || ""]; - } - - if (panicCode) { - error.message += ` (reverted: ${ error.data })`; - error.data = "0x4e487b7100000000000000000000000000000000000000000000000000000000000000" + panicCode; - } - - } else if (error && error.code === -32000) { - if (error.message === "wrong transaction nonce") { - error.message += " (nonce too low)"; - } - } - - return super.getRpcError(payload, _error); - } - - /** - * Returns a prepared request for connecting to %%network%% - * with %%apiKey%%. - */ - static getRequest(network: Network): FetchRequest { - const request = new FetchRequest(getUrl(network.name)); - request.allowGzip = true; - return request; - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-browser.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-browser.ts deleted file mode 100644 index e2f7fee9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-browser.ts +++ /dev/null @@ -1,334 +0,0 @@ - -import { assertArgument, makeError } from "../utils/index.js"; - -import { JsonRpcApiPollingProvider } from "./provider-jsonrpc.js"; - -import type { - JsonRpcApiProviderOptions, - JsonRpcError, JsonRpcPayload, JsonRpcResult, - JsonRpcSigner -} from "./provider-jsonrpc.js"; -import type { Network, Networkish } from "./network.js"; - -/** - * The interface to an [[link-eip-1193]] provider, which is a standard - * used by most injected providers, which the [[BrowserProvider]] accepts - * and exposes the API of. - */ -export interface Eip1193Provider { - /** - * See [[link-eip-1193]] for details on this method. - */ - request(request: { method: string, params?: Array | Record }): Promise; -}; - -/** - * The possible additional events dispatched when using the ``"debug"`` - * event on a [[BrowserProvider]]. - */ -export type DebugEventBrowserProvider = { - action: "sendEip1193Payload", - payload: { method: string, params: Array } -} | { - action: "receiveEip1193Result", - result: any -} | { - action: "receiveEip1193Error", - error: Error -}; - -/** - * Provider info provided by the [[link-eip-6963]] discovery mechanism. - */ -export interface Eip6963ProviderInfo { - uuid: string; - name: string; - icon: string; - rdns: string; -} - -interface Eip6963ProviderDetail { - info: Eip6963ProviderInfo; - provider: Eip1193Provider; -} - -interface Eip6963Announcement { - type: "eip6963:announceProvider"; - detail: Eip6963ProviderDetail -} - -export type BrowserProviderOptions = { - polling?: boolean; - staticNetwork?: null | boolean | Network; - - cacheTimeout?: number; - pollingInterval?: number; - - providerInfo?: Eip6963ProviderInfo; -}; - -/** - * Specifies how [[link-eip-6963]] discovery should proceed. - * - * See: [[BrowserProvider-discover]] - */ -export interface BrowserDiscoverOptions { - /** - * Override provider detection with this provider. - */ - provider?: Eip1193Provider; - - /** - * Duration to wait to detect providers. (default: 300ms) - */ - timeout?: number; - - /** - * Return the first detected provider. Otherwise wait for %%timeout%% - * and allowing filtering before selecting the desired provider. - */ - anyProvider?: boolean; - - /** - * Use the provided window context. Useful in non-standard - * environments or to hijack where a provider comes from. - */ - window?: any; - - /** - * Explicitly choose which provider to used once scanning is complete. - */ - filter?: (found: Array) => null | BrowserProvider | - Eip6963ProviderInfo; -} - - -/** - * A **BrowserProvider** is intended to wrap an injected provider which - * adheres to the [[link-eip-1193]] standard, which most (if not all) - * currently do. - */ -export class BrowserProvider extends JsonRpcApiPollingProvider { - #request: (method: string, params: Array | Record) => Promise; - - #providerInfo: null | Eip6963ProviderInfo; - - /** - * Connect to the %%ethereum%% provider, optionally forcing the - * %%network%%. - */ - constructor(ethereum: Eip1193Provider, network?: Networkish, _options?: BrowserProviderOptions) { - - // Copy the options - const options: JsonRpcApiProviderOptions = Object.assign({ }, - ((_options != null) ? _options: { }), - { batchMaxCount: 1 }); - - assertArgument(ethereum && ethereum.request, "invalid EIP-1193 provider", "ethereum", ethereum); - - super(network, options); - - this.#providerInfo = null; - if (_options && _options.providerInfo) { - this.#providerInfo = _options.providerInfo; - } - - this.#request = async (method: string, params: Array | Record) => { - const payload = { method, params }; - this.emit("debug", { action: "sendEip1193Request", payload }); - try { - const result = await ethereum.request(payload); - this.emit("debug", { action: "receiveEip1193Result", result }); - return result; - } catch (e: any) { - const error = new Error(e.message); - (error).code = e.code; - (error).data = e.data; - (error).payload = payload; - this.emit("debug", { action: "receiveEip1193Error", error }); - throw error; - } - }; - } - - get providerInfo(): null | Eip6963ProviderInfo { - return this.#providerInfo; - } - - async send(method: string, params: Array | Record): Promise { - await this._start(); - - return await super.send(method, params); - } - - async _send(payload: JsonRpcPayload | Array): Promise> { - assertArgument(!Array.isArray(payload), "EIP-1193 does not support batch request", "payload", payload); - - try { - const result = await this.#request(payload.method, payload.params || [ ]); - return [ { id: payload.id, result } ]; - } catch (e: any) { - return [ { - id: payload.id, - error: { code: e.code, data: e.data, message: e.message } - } ]; - } - } - - getRpcError(payload: JsonRpcPayload, error: JsonRpcError): Error { - - error = JSON.parse(JSON.stringify(error)); - - // EIP-1193 gives us some machine-readable error codes, so rewrite - // them into Ethers standard errors. - switch (error.error.code || -1) { - case 4001: - error.error.message = `ethers-user-denied: ${ error.error.message }`; - break; - case 4200: - error.error.message = `ethers-unsupported: ${ error.error.message }`; - break; - } - - return super.getRpcError(payload, error); - } - - /** - * Resolves to ``true`` if the provider manages the %%address%%. - */ - async hasSigner(address: number | string): Promise { - if (address == null) { address = 0; } - - const accounts = await this.send("eth_accounts", [ ]); - if (typeof(address) === "number") { - return (accounts.length > address); - } - - address = address.toLowerCase(); - return accounts.filter((a: string) => (a.toLowerCase() === address)).length !== 0; - } - - async getSigner(address?: number | string): Promise { - if (address == null) { address = 0; } - - if (!(await this.hasSigner(address))) { - try { - await this.#request("eth_requestAccounts", [ ]); - - } catch (error: any) { - const payload = error.payload; - throw this.getRpcError(payload, { id: payload.id, error }); - } - } - - return await super.getSigner(address); - } - - /** - * Discover and connect to a Provider in the Browser using the - * [[link-eip-6963]] discovery mechanism. If no providers are - * present, ``null`` is resolved. - */ - static async discover(options?: BrowserDiscoverOptions): Promise { - if (options == null) { options = { }; } - - if (options.provider) { - return new BrowserProvider(options.provider); - } - - const context = options.window ? options.window: - (typeof(window) !== "undefined") ? window: null; - - if (context == null) { return null; } - - const anyProvider = options.anyProvider; - if (anyProvider && context.ethereum) { - return new BrowserProvider(context.ethereum); - } - - if (!("addEventListener" in context && "dispatchEvent" in context - && "removeEventListener" in context)) { - return null; - } - - const timeout = options.timeout ? options.timeout: 300; - if (timeout === 0) { return null; } - - return await (new Promise((resolve, reject) => { - let found: Array = [ ]; - - const addProvider = (event: Eip6963Announcement) => { - found.push(event.detail); - if (anyProvider) { finalize(); } - }; - - const finalize = () => { - clearTimeout(timer); - - if (found.length) { - - // If filtering is provided: - if (options && options.filter) { - - // Call filter, with a copies of found provider infos - const filtered = options.filter(found.map(i => - Object.assign({ }, (i.info)))); - - if (filtered == null) { - // No provider selected - resolve(null); - - } else if (filtered instanceof BrowserProvider) { - // Custom provider created - resolve(filtered); - - } else { - // Find the matching provider - let match: null | Eip6963ProviderDetail = null; - if (filtered.uuid) { - const matches = found.filter(f => - (filtered.uuid === f.info.uuid)); - // @TODO: What should happen if multiple values - // for the same UUID? - match = matches[0]; - } - - if (match) { - const { provider, info } = match; - resolve(new BrowserProvider(provider, undefined, { - providerInfo: info - })); - } else { - reject(makeError("filter returned unknown info", "UNSUPPORTED_OPERATION", { - value: filtered - })); - } - } - - } else { - - // Pick the first found provider - const { provider, info } = found[0]; - resolve(new BrowserProvider(provider, undefined, { - providerInfo: info - })); - } - - } else { - // Nothing found - resolve(null); - } - - context.removeEventListener("eip6963:announceProvider", - addProvider); - }; - - const timer = setTimeout(() => { finalize(); }, timeout); - - context.addEventListener("eip6963:announceProvider", - addProvider); - - context.dispatchEvent(new Event("eip6963:requestProvider")); - })); - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-chainstack.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-chainstack.ts deleted file mode 100644 index 0daf8b79..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-chainstack.ts +++ /dev/null @@ -1,113 +0,0 @@ -/** - * [[link-chainstack]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Arbitrum (``arbitrum``) - * - BNB Smart Chain Mainnet (``bnb``) - * - Polygon (``matic``) - * - * @_subsection: api/providers/thirdparty:Chainstack [providers-chainstack] - */ -import { - defineProperties, FetchRequest, assertArgument -} from "../utils/index.js"; - -import { showThrottleMessage } from "./community.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; - -import type { AbstractProvider } from "./abstract-provider.js"; -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; - - -function getApiKey(name: string): string { - switch (name) { - case "mainnet": return "39f1d67cedf8b7831010a665328c9197"; - case "arbitrum": return "0550c209db33c3abf4cc927e1e18cea1" - case "bnb": return "98b5a77e531614387366f6fc5da097f8"; - case "matic": return "cd9d4d70377471aa7c142ec4a4205249"; - } - - assertArgument(false, "unsupported network", "network", name); -} - -function getHost(name: string): string { - switch(name) { - case "mainnet": - return "ethereum-mainnet.core.chainstack.com"; - case "arbitrum": - return "arbitrum-mainnet.core.chainstack.com"; - case "bnb": - return "bsc-mainnet.core.chainstack.com"; - case "matic": - return "polygon-mainnet.core.chainstack.com"; - } - - assertArgument(false, "unsupported network", "network", name); -} - -/** - * The **ChainstackProvider** connects to the [[link-chainstack]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-chainstack). - */ -export class ChainstackProvider extends JsonRpcProvider implements CommunityResourcable { - /** - * The API key for the Chainstack connection. - */ - readonly apiKey!: string; - - /** - * Creates a new **ChainstackProvider**. - */ - constructor(_network?: Networkish, apiKey?: null | string) { - if (_network == null) { _network = "mainnet"; } - const network = Network.from(_network); - - if (apiKey == null) { apiKey = getApiKey(network.name); } - - const request = ChainstackProvider.getRequest(network, apiKey); - super(request, network, { staticNetwork: network }); - - defineProperties(this, { apiKey }); - } - - _getProvider(chainId: number): AbstractProvider { - try { - return new ChainstackProvider(chainId, this.apiKey); - } catch (error) { } - return super._getProvider(chainId); - } - - isCommunityResource(): boolean { - return (this.apiKey === getApiKey(this._network.name)); - } - - /** - * Returns a prepared request for connecting to %%network%% - * with %%apiKey%% and %%projectSecret%%. - */ - static getRequest(network: Network, apiKey?: null | string): FetchRequest { - if (apiKey == null) { apiKey = getApiKey(network.name); } - - const request = new FetchRequest(`https:/\/${ getHost(network.name) }/${ apiKey }`); - request.allowGzip = true; - - if (apiKey === getApiKey(network.name)) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("ChainstackProvider"); - return true; - }; - } - - return request; - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-cloudflare.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-cloudflare.ts deleted file mode 100644 index 7e0d87e6..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-cloudflare.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * About Cloudflare - * - * @_subsection: api/providers/thirdparty:Cloudflare [providers-cloudflare] - */ - -import { assertArgument } from "../utils/index.js"; - -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; - -import type { Networkish } from "./network.js"; - -/** - * About Cloudflare... - */ -export class CloudflareProvider extends JsonRpcProvider { - constructor(_network?: Networkish) { - if (_network == null) { _network = "mainnet"; } - const network = Network.from(_network); - assertArgument(network.name === "mainnet", "unsupported network", "network", _network); - super("https:/\/cloudflare-eth.com/", network, { staticNetwork: network }); - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-etherscan.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-etherscan.ts deleted file mode 100644 index bd47425c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-etherscan.ts +++ /dev/null @@ -1,687 +0,0 @@ -/** - * [[link-etherscan]] provides a third-party service for connecting to - * various blockchains over a combination of JSON-RPC and custom API - * endpoints. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Holesky Testnet (``holesky``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Base (``base``) - * - Base Sepolia Testnet (``base-sepolia``) - * - BNB Smart Chain Mainnet (``bnb``) - * - BNB Smart Chain Testnet (``bnbt``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - Polygon Amoy Testnet (``matic-amoy``) - * - * @_subsection api/providers/thirdparty:Etherscan [providers-etherscan] - */ - -import { AbiCoder } from "../abi/index.js"; -import { Contract } from "../contract/index.js"; -import { accessListify, Transaction } from "../transaction/index.js"; -import { - defineProperties, - hexlify, toQuantity, - FetchRequest, - assert, assertArgument, isError, -// parseUnits, - toUtf8String - } from "../utils/index.js"; - -import { AbstractProvider } from "./abstract-provider.js"; -import { Network } from "./network.js"; -import { NetworkPlugin } from "./plugins-network.js"; -import { showThrottleMessage } from "./community.js"; - -import { PerformActionRequest } from "./abstract-provider.js"; -import type { Networkish } from "./network.js"; -//import type { } from "./pagination"; -import type { TransactionRequest } from "./provider.js"; - -// See: https://docs.etherscan.io/supported-chains -const Supported = ( - "1 11155111 17000 560048 2741 11124 33111 33139 42170 " + - "42161 421614 43114 43113 8453 84532 80069 80094 199 1029 81457 " + - "168587773 56 97 42220 11142220 252 2523 100 999 737373 747474 " + - "59144 59141 5000 5003 43521 143 10143 1287 1284 1285 10 " + - "11155420 204 5611 80002 137 534352 534351 1329 1328 146 14601 " + - "988 2201 1923 1924 167013 167000 130 1301 480 4801 51 50 324 300" -).split(/ /g); - -const THROTTLE = 2000; - -function isPromise(value: any): value is Promise { - return (value && typeof(value.then) === "function"); -} - - -/** - * When subscribing to the ``"debug"`` event on an Etherscan-based - * provider, the events receive a **DebugEventEtherscanProvider** - * payload. - * - * @_docloc: api/providers/thirdparty:Etherscan - */ -export type DebugEventEtherscanProvider = { - action: "sendRequest", - id: number, - url: string, - payload: Record -} | { - action: "receiveRequest", - id: number, - result: any -} | { - action: "receiveError", - id: number, - error: any -}; - -const EtherscanPluginId = "org.ethers.plugins.provider.Etherscan"; - -/** - * A Network can include an **EtherscanPlugin** to provide - * a custom base URL. - * - * @_docloc: api/providers/thirdparty:Etherscan - */ -export class EtherscanPlugin extends NetworkPlugin { - /** - * The Etherscan API base URL. - */ - readonly baseUrl!: string; - - /** - * Creates a new **EtherscanProvider** which will use - * %%baseUrl%%. - */ - constructor(baseUrl: string) { - super(EtherscanPluginId); - defineProperties(this, { baseUrl }); - } - - clone(): EtherscanPlugin { - return new EtherscanPlugin(this.baseUrl); - } -} - -const skipKeys = [ "enableCcipRead" ]; - -let nextId = 1; - -/** - * The **EtherscanBaseProvider** is the super-class of - * [[EtherscanProvider]], which should generally be used instead. - * - * Since the **EtherscanProvider** includes additional code for - * [[Contract]] access, in //rare cases// that contracts are not - * used, this class can reduce code size. - * - * @_docloc: api/providers/thirdparty:Etherscan - */ -export class EtherscanProvider extends AbstractProvider { - - /** - * The connected network. - */ - readonly network!: Network; - - /** - * The API key or null if using the community provided bandwidth. - */ - readonly apiKey!: null | string; - - readonly #plugin: null | EtherscanPlugin; - - /** - * Creates a new **EtherscanBaseProvider**. - */ - constructor(_network?: Networkish, _apiKey?: string) { - - const apiKey = (_apiKey != null) ? _apiKey: null; - - super(); - - const network = Network.from(_network); - - assertArgument(Supported.indexOf(`${ network.chainId }`) >= 0, - "unsupported network", "network", network); - - this.#plugin = network.getPlugin(EtherscanPluginId); - - defineProperties(this, { apiKey, network }); - } - - /** - * Returns the base URL. - * - * If an [[EtherscanPlugin]] is configured on the - * [[EtherscanBaseProvider_network]], returns the plugin's - * baseUrl. - * - * Deprecated; for Etherscan v2 the base is no longer a simply - * host, but instead a URL including a chainId parameter. Changing - * this to return a URL prefix could break some libraries, so it - * is left intact but will be removed in the future as it is unused. - */ - getBaseUrl(): string { - if (this.#plugin) { return this.#plugin.baseUrl; } - - switch(this.network.name) { - case "mainnet": - return "https:/\/api.etherscan.io"; - case "goerli": - return "https:/\/api-goerli.etherscan.io"; - case "sepolia": - return "https:/\/api-sepolia.etherscan.io"; - case "holesky": - return "https:/\/api-holesky.etherscan.io"; - - case "arbitrum": - return "https:/\/api.arbiscan.io"; - case "arbitrum-goerli": - return "https:/\/api-goerli.arbiscan.io"; - case "base": - return "https:/\/api.basescan.org"; - case "base-sepolia": - return "https:/\/api-sepolia.basescan.org"; - case "bnb": - return "https:/\/api.bscscan.com"; - case "bnbt": - return "https:/\/api-testnet.bscscan.com"; - case "matic": - return "https:/\/api.polygonscan.com"; - case "matic-amoy": - return "https:/\/api-amoy.polygonscan.com"; - case "matic-mumbai": - return "https:/\/api-testnet.polygonscan.com"; - case "optimism": - return "https:/\/api-optimistic.etherscan.io"; - case "optimism-goerli": - return "https:/\/api-goerli-optimistic.etherscan.io"; - - default: - } - - assertArgument(false, "unsupported network", "network", this.network); - } - - /** - * Returns the URL for the %%module%% and %%params%%. - */ - getUrl(module: string, params: Record): string { - let query = Object.keys(params).reduce((accum, key) => { - const value = params[key]; - if (value != null) { - accum += `&${ key }=${ value }` - } - return accum - }, ""); - if (this.apiKey) { query += `&apikey=${ this.apiKey }`; } - return `https:/\/api.etherscan.io/v2/api?chainid=${ this.network.chainId }&module=${ module }${ query }`; - } - - /** - * Returns the URL for using POST requests. - */ - getPostUrl(): string { - return `https:/\/api.etherscan.io/v2/api?chainid=${ this.network.chainId }`; - } - - /** - * Returns the parameters for using POST requests. - */ - getPostData(module: string, params: Record): Record { - params.module = module; - params.apikey = this.apiKey; - params.chainid = this.network.chainId; - return params; - } - - async detectNetwork(): Promise { - return this.network; - } - - /** - * Resolves to the result of calling %%module%% with %%params%%. - * - * If %%post%%, the request is made as a POST request. - */ - async fetch(module: string, params: Record, post?: boolean): Promise { - const id = nextId++; - - const url = (post ? this.getPostUrl(): this.getUrl(module, params)); - const payload = (post ? this.getPostData(module, params): null); - - this.emit("debug", { action: "sendRequest", id, url, payload: payload }); - - const request = new FetchRequest(url); - request.setThrottleParams({ slotInterval: 1000 }); - request.retryFunc = (req, resp, attempt: number) => { - if (this.isCommunityResource()) { - showThrottleMessage("Etherscan"); - } - return Promise.resolve(true); - }; - request.processFunc = async (request, response) => { - const result = response.hasBody() ? JSON.parse(toUtf8String(response.body)): { }; - const throttle = ((typeof(result.result) === "string") ? result.result: "").toLowerCase().indexOf("rate limit") >= 0; - if (module === "proxy") { - // This JSON response indicates we are being throttled - if (result && result.status == 0 && result.message == "NOTOK" && throttle) { - this.emit("debug", { action: "receiveError", id, reason: "proxy-NOTOK", error: result }); - response.throwThrottleError(result.result, THROTTLE); - } - } else { - if (throttle) { - this.emit("debug", { action: "receiveError", id, reason: "null result", error: result.result }); - response.throwThrottleError(result.result, THROTTLE); - } - } - return response; - }; - - if (payload) { - request.setHeader("content-type", "application/x-www-form-urlencoded; charset=UTF-8"); - request.body = Object.keys(payload).map((k) => `${ k }=${ payload[k] }`).join("&"); - } - - const response = await request.send(); - try { - response.assertOk(); - } catch (error) { - this.emit("debug", { action: "receiveError", id, error, reason: "assertOk" }); - assert(false, "response error", "SERVER_ERROR", { request, response }); - } - - if (!response.hasBody()) { - this.emit("debug", { action: "receiveError", id, error: "missing body", reason: "null body" }); - assert(false, "missing response", "SERVER_ERROR", { request, response }); - } - - const result = JSON.parse(toUtf8String(response.body)); - if (module === "proxy") { - if (result.jsonrpc != "2.0") { - this.emit("debug", { action: "receiveError", id, result, reason: "invalid JSON-RPC" }); - assert(false, "invalid JSON-RPC response (missing jsonrpc='2.0')", "SERVER_ERROR", { request, response, info: { result } }); - } - - if (result.error) { - this.emit("debug", { action: "receiveError", id, result, reason: "JSON-RPC error" }); - assert(false, "error response", "SERVER_ERROR", { request, response, info: { result } }); - } - - this.emit("debug", { action: "receiveRequest", id, result }); - - return result.result; - - } else { - // getLogs, getHistory have weird success responses - if (result.status == 0 && (result.message === "No records found" || result.message === "No transactions found")) { - this.emit("debug", { action: "receiveRequest", id, result }); - return result.result; - } - - if (result.status != 1 || (typeof(result.message) === "string" && !result.message.match(/^OK/))) { - this.emit("debug", { action: "receiveError", id, result }); - assert(false, "error response", "SERVER_ERROR", { request, response, info: { result } }); - } - - this.emit("debug", { action: "receiveRequest", id, result }); - - return result.result; - } - } - - /** - * Returns %%transaction%% normalized for the Etherscan API. - */ - _getTransactionPostData(transaction: TransactionRequest): Record { - const result: Record = { }; - for (let key in transaction) { - if (skipKeys.indexOf(key) >= 0) { continue; } - - if ((transaction)[key] == null) { continue; } - let value = (transaction)[key]; - if (key === "type" && value === 0) { continue; } - if (key === "blockTag" && value === "latest") { continue; } - - // Quantity-types require no leading zero, unless 0 - if (({ type: true, gasLimit: true, gasPrice: true, maxFeePerGs: true, maxPriorityFeePerGas: true, nonce: true, value: true })[key]) { - value = toQuantity(value); - - } else if (key === "accessList") { - value = "[" + accessListify(value).map((set) => { - return `{address:"${ set.address }",storageKeys:["${ set.storageKeys.join('","') }"]}`; - }).join(",") + "]"; - - } else if (key === "blobVersionedHashes") { - if (value.length === 0) { continue; } - - // @TODO: update this once the API supports blobs - assert(false, "Etherscan API does not support blobVersionedHashes", "UNSUPPORTED_OPERATION", { - operation: "_getTransactionPostData", - info: { transaction } - }); - - } else { - value = hexlify(value); - } - result[key] = value; - } - return result; - } - - /** - * Throws the normalized Etherscan error. - */ - _checkError(req: PerformActionRequest, error: Error, transaction: any): never { - // Pull any message out if, possible - let message = ""; - if (isError(error, "SERVER_ERROR")) { - // Check for an error emitted by a proxy call - try { - message = (error).info.result.error.message; - } catch (e) { } - - if (!message) { - try { - message = (error).info.message; - } catch (e) { } - } - } - - if (req.method === "estimateGas") { - if (!message.match(/revert/i) && message.match(/insufficient funds/i)) { - assert(false, "insufficient funds", "INSUFFICIENT_FUNDS", { - transaction: req.transaction - }); - } - } - - if (req.method === "call" || req.method === "estimateGas") { - if (message.match(/execution reverted/i)) { - let data = ""; - try { - data = (error).info.result.error.data; - } catch (error) { } - - const e = AbiCoder.getBuiltinCallException(req.method, req.transaction, data); - e.info = { request: req, error } - throw e; - } - } - - if (message) { - if (req.method === "broadcastTransaction") { - const transaction = Transaction.from(req.signedTransaction); - if (message.match(/replacement/i) && message.match(/underpriced/i)) { - assert(false, "replacement fee too low", "REPLACEMENT_UNDERPRICED", { - transaction - }); - } - - if (message.match(/insufficient funds/)) { - assert(false, "insufficient funds for intrinsic transaction cost", "INSUFFICIENT_FUNDS", { - transaction - }); - } - - if (message.match(/same hash was already imported|transaction nonce is too low|nonce too low/)) { - assert(false, "nonce has already been used", "NONCE_EXPIRED", { - transaction - }); - } - } - } - - // Something we could not process - throw error; - } - - async _detectNetwork(): Promise { - return this.network; - } - - async _perform(req: PerformActionRequest): Promise { - switch (req.method) { - case "chainId": - return this.network.chainId; - - case "getBlockNumber": - return this.fetch("proxy", { action: "eth_blockNumber" }); - - case "getGasPrice": - return this.fetch("proxy", { action: "eth_gasPrice" }); - - case "getPriorityFee": - // This is temporary until Etherscan completes support - if (this.network.name === "mainnet") { - return "1000000000"; - } else if (this.network.name === "optimism") { - return "1000000"; - } else { - throw new Error("fallback onto the AbstractProvider default"); - } - /* Working with Etherscan to get this added: - try { - const test = await this.fetch("proxy", { - action: "eth_maxPriorityFeePerGas" - }); - console.log(test); - return test; - } catch (e) { - console.log("DEBUG", e); - throw e; - } - */ - /* This might be safe; but due to rounding neither myself - or Etherscan are necessarily comfortable with this. :) - try { - const result = await this.fetch("gastracker", { action: "gasoracle" }); - console.log(result); - const gasPrice = parseUnits(result.SafeGasPrice, "gwei"); - const baseFee = parseUnits(result.suggestBaseFee, "gwei"); - const priorityFee = gasPrice - baseFee; - if (priorityFee < 0) { throw new Error("negative priority fee; defer to abstract provider default"); } - return priorityFee; - } catch (error) { - console.log("DEBUG", error); - throw error; - } - */ - - case "getBalance": - // Returns base-10 result - return this.fetch("account", { - action: "balance", - address: req.address, - tag: req.blockTag - }); - - case "getTransactionCount": - return this.fetch("proxy", { - action: "eth_getTransactionCount", - address: req.address, - tag: req.blockTag - }); - - case "getCode": - return this.fetch("proxy", { - action: "eth_getCode", - address: req.address, - tag: req.blockTag - }); - - case "getStorage": - return this.fetch("proxy", { - action: "eth_getStorageAt", - address: req.address, - position: req.position, - tag: req.blockTag - }); - - case "broadcastTransaction": - return this.fetch("proxy", { - action: "eth_sendRawTransaction", - hex: req.signedTransaction - }, true).catch((error) => { - return this._checkError(req, error, req.signedTransaction); - }); - - case "getBlock": - if ("blockTag" in req) { - return this.fetch("proxy", { - action: "eth_getBlockByNumber", - tag: req.blockTag, - boolean: (req.includeTransactions ? "true": "false") - }); - } - - assert(false, "getBlock by blockHash not supported by Etherscan", "UNSUPPORTED_OPERATION", { - operation: "getBlock(blockHash)" - }); - - case "getTransaction": - return this.fetch("proxy", { - action: "eth_getTransactionByHash", - txhash: req.hash - }); - - case "getTransactionReceipt": - return this.fetch("proxy", { - action: "eth_getTransactionReceipt", - txhash: req.hash - }); - - case "call": { - if (req.blockTag !== "latest") { - throw new Error("EtherscanProvider does not support blockTag for call"); - } - - const postData = this._getTransactionPostData(req.transaction); - postData.module = "proxy"; - postData.action = "eth_call"; - - try { - return await this.fetch("proxy", postData, true); - } catch (error) { - return this._checkError(req, error, req.transaction); - } - } - - case "estimateGas": { - const postData = this._getTransactionPostData(req.transaction); - postData.module = "proxy"; - postData.action = "eth_estimateGas"; - - try { - return await this.fetch("proxy", postData, true); - } catch (error) { - return this._checkError(req, error, req.transaction); - } - } -/* - case "getLogs": { - // Needs to complain if more than one address is passed in - const args: Record = { action: "getLogs" } - - if (params.filter.fromBlock) { - args.fromBlock = checkLogTag(params.filter.fromBlock); - } - - if (params.filter.toBlock) { - args.toBlock = checkLogTag(params.filter.toBlock); - } - - if (params.filter.address) { - args.address = params.filter.address; - } - - // @TODO: We can handle slightly more complicated logs using the logs API - if (params.filter.topics && params.filter.topics.length > 0) { - if (params.filter.topics.length > 1) { - logger.throwError("unsupported topic count", Logger.Errors.UNSUPPORTED_OPERATION, { topics: params.filter.topics }); - } - if (params.filter.topics.length === 1) { - const topic0 = params.filter.topics[0]; - if (typeof(topic0) !== "string" || topic0.length !== 66) { - logger.throwError("unsupported topic format", Logger.Errors.UNSUPPORTED_OPERATION, { topic0: topic0 }); - } - args.topic0 = topic0; - } - } - - const logs: Array = await this.fetch("logs", args); - - // Cache txHash => blockHash - let blocks: { [tag: string]: string } = {}; - - // Add any missing blockHash to the logs - for (let i = 0; i < logs.length; i++) { - const log = logs[i]; - if (log.blockHash != null) { continue; } - if (blocks[log.blockNumber] == null) { - const block = await this.getBlock(log.blockNumber); - if (block) { - blocks[log.blockNumber] = block.hash; - } - } - - log.blockHash = blocks[log.blockNumber]; - } - - return logs; - } -*/ - default: - break; - } - - return super._perform(req); - } - - async getNetwork(): Promise { - return this.network; - } - - /** - * Resolves to the current price of ether. - * - * This returns ``0`` on any network other than ``mainnet``. - */ - async getEtherPrice(): Promise { - if (this.network.name !== "mainnet") { return 0.0; } - return parseFloat((await this.fetch("stats", { action: "ethprice" })).ethusd); - } - - /** - * Resolves to a [Contract]] for %%address%%, using the - * Etherscan API to retreive the Contract ABI. - */ - async getContract(_address: string): Promise { - let address = this._getAddress(_address); - if (isPromise(address)) { address = await address; } - - try { - const resp = await this.fetch("contract", { - action: "getabi", address }); - const abi = JSON.parse(resp); - return new Contract(address, abi, this); - } catch (error) { - return null; - } - } - - isCommunityResource(): boolean { - return (this.apiKey == null); - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-fallback.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-fallback.ts deleted file mode 100644 index ed6349f5..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-fallback.ts +++ /dev/null @@ -1,801 +0,0 @@ -/** - * A **FallbackProvider** provides resilience, security and performance - * in a way that is customizable and configurable. - * - * @_section: api/providers/fallback-provider:Fallback Provider [about-fallback-provider] - */ -import { - assert, assertArgument, getBigInt, getNumber, isError -} from "../utils/index.js"; - -import { AbstractProvider } from "./abstract-provider.js"; -import { Network } from "./network.js" - -import type { PerformActionRequest } from "./abstract-provider.js"; -import type { Networkish } from "./network.js" - -const BN_1 = BigInt("1"); -const BN_2 = BigInt("2"); - -function shuffle(array: Array): void { - for (let i = array.length - 1; i > 0; i--) { - const j = Math.floor(Math.random() * (i + 1)); - const tmp = array[i]; - array[i] = array[j]; - array[j] = tmp; - } -} - -function stall(duration: number): Promise { - return new Promise((resolve) => { setTimeout(resolve, duration); }); -} - -function getTime(): number { return (new Date()).getTime(); } - -function stringify(value: any): string { - return JSON.stringify(value, (key, value) => { - if (typeof(value) === "bigint") { - return { type: "bigint", value: value.toString() }; - } - return value; - }); -} - -/** - * A configuration entry for how to use a [[Provider]]. - */ -export interface FallbackProviderConfig { - - /** - * The provider. - */ - provider: AbstractProvider; - - /** - * The amount of time to wait before kicking off the next provider. - * - * Any providers that have not responded can still respond and be - * counted, but this ensures new providers start. - */ - stallTimeout?: number; - - /** - * The priority. Lower priority providers are dispatched first. - */ - priority?: number; - - /** - * The amount of weight a provider is given against the quorum. - */ - weight?: number; -}; - -const defaultConfig = { stallTimeout: 400, priority: 1, weight: 1 }; - -// We track a bunch of extra stuff that might help debug problems or -// optimize infrastructure later on. -/** - * The statistics and state maintained for a [[Provider]]. - */ -export interface FallbackProviderState extends Required { - - /** - * The most recent blockNumber this provider has reported (-2 if none). - */ - blockNumber: number; - - /** - * The number of total requests ever sent to this provider. - */ - requests: number; - - /** - * The number of responses that errored. - */ - errorResponses: number; - - /** - * The number of responses that occured after the result resolved. - */ - lateResponses: number; - - /** - * How many times syncing was required to catch up the expected block. - */ - outOfSync: number; - - /** - * The number of requests which reported unsupported operation. - */ - unsupportedEvents: number; - - /** - * A rolling average (5% current duration) for response time. - */ - rollingDuration: number; - - /** - * The ratio of quorum-agreed results to total. - */ - score: number; -} - -interface Config extends FallbackProviderState { - _updateNumber: null | Promise; - _network: null | Network; - _totalTime: number; - _lastFatalError: null | Error; - _lastFatalErrorTimestamp: number; -} - -const defaultState = { - blockNumber: -2, requests: 0, lateResponses: 0, errorResponses: 0, - outOfSync: -1, unsupportedEvents: 0, rollingDuration: 0, score: 0, - _network: null, _updateNumber: null, _totalTime: 0, - _lastFatalError: null, _lastFatalErrorTimestamp: 0 -}; - - -async function waitForSync(config: Config, blockNumber: number): Promise { - while (config.blockNumber < 0 || config.blockNumber < blockNumber) { - if (!config._updateNumber) { - config._updateNumber = (async () => { - try { - const blockNumber = await config.provider.getBlockNumber(); - if (blockNumber > config.blockNumber) { - config.blockNumber = blockNumber; - } - } catch (error: any) { - config.blockNumber = -2; - config._lastFatalError = error; - config._lastFatalErrorTimestamp = getTime(); - } - config._updateNumber = null; - })(); - } - await config._updateNumber; - config.outOfSync++; - if (config._lastFatalError) { break; } - } -} - -/** - * Additional options to configure a [[FallbackProvider]]. - */ -export type FallbackProviderOptions = { - // How many providers must agree on a value before reporting - // back the response - quorum?: number; - - // How many providers must have reported the same event - // for it to be emitted (currently unimplmented) - eventQuorum?: number; - - // How many providers to dispatch each event to simultaneously. - // Set this to 0 to use getLog polling, which implies eventQuorum - // is equal to quorum. (currently unimplemented) - eventWorkers?: number; - - cacheTimeout?: number; - - pollingInterval?: number; -}; - -type RunnerResult = { result: any } | { error: Error }; - -type RunnerState = { - config: Config; - staller: null | Promise; - didBump: boolean; - perform: null | Promise; - result: null | RunnerResult; -} - -function _normalize(value: any): string { - if (value == null) { return "null"; } - - if (Array.isArray(value)) { - return "[" + (value.map(_normalize)).join(",") + "]"; - } - - if (typeof(value) === "object" && typeof(value.toJSON) === "function") { - return _normalize(value.toJSON()); - } - - switch (typeof(value)) { - case "boolean": case "symbol": - return value.toString(); - case "bigint": case "number": - return BigInt(value).toString(); - case "string": - return JSON.stringify(value); - case "object": { - const keys = Object.keys(value); - keys.sort(); - return "{" + keys.map((k) => `${ JSON.stringify(k) }:${ _normalize(value[k]) }`).join(",") + "}"; - } - } - - console.log("Could not serialize", value); - throw new Error("Hmm..."); -} - -function normalizeResult(method: string, value: RunnerResult): { tag: string, value: any } { - - if ("error" in value) { - const error = value.error; - - let tag: string; - if (isError(error, "CALL_EXCEPTION")) { - tag = _normalize(Object.assign({ }, error, { - shortMessage: undefined, reason: undefined, info: undefined - })); - } else { - tag = _normalize(error) - } - - return { tag, value: error }; - } - - const result = value.result; - return { tag: _normalize(result), value: result }; -} - -type TallyResult = { - tag: string; - value: any; - weight: number; -}; - -// This strategy picks the highest weight result, as long as the weight is -// equal to or greater than quorum -function checkQuorum(quorum: number, results: Array): any | Error { - const tally: Map = new Map(); - for (const { value, tag, weight } of results) { - const t = tally.get(tag) || { value, weight: 0 }; - t.weight += weight; - tally.set(tag, t); - } - - let best: null | { value: any, weight: number } = null; - for (const r of tally.values()) { - if (r.weight >= quorum && (!best || r.weight > best.weight)) { - best = r; - } - } - - if (best) { return best.value; } - - return undefined; -} - -function getMedian(quorum: number, results: Array): undefined | bigint | Error { - let resultWeight = 0; - - const errorMap: Map = new Map(); - let bestError: null | { weight: number, value: Error } = null; - - const values: Array = [ ]; - for (const { value, tag, weight } of results) { - if (value instanceof Error) { - const e = errorMap.get(tag) || { value, weight: 0 }; - e.weight += weight; - errorMap.set(tag, e); - - if (bestError == null || e.weight > bestError.weight) { bestError = e; } - } else { - values.push(BigInt(value)); - resultWeight += weight; - } - } - - if (resultWeight < quorum) { - // We have quorum for an error - if (bestError && bestError.weight >= quorum) { return bestError.value; } - - // We do not have quorum for a result - return undefined; - } - - // Get the sorted values - values.sort((a, b) => ((a < b) ? -1: (b > a) ? 1: 0)); - - const mid = Math.floor(values.length / 2); - - // Odd-length; take the middle value - if (values.length % 2) { return values[mid]; } - - // Even length; take the ceiling of the mean of the center two values - return (values[mid - 1] + values[mid] + BN_1) / BN_2; -} - -function getAnyResult(quorum: number, results: Array): undefined | any | Error { - // If any value or error meets quorum, that is our preferred result - const result = checkQuorum(quorum, results); - if (result !== undefined) { return result; } - - // Otherwise, do we have any result? - for (const r of results) { - if (r.value) { return r.value; } - } - - // Nope! - return undefined; -} - -function getFuzzyMode(quorum: number, results: Array): undefined | number { - if (quorum === 1) { return getNumber(getMedian(quorum, results), "%internal"); } - - const tally: Map = new Map(); - const add = (result: number, weight: number) => { - const t = tally.get(result) || { result, weight: 0 }; - t.weight += weight; - tally.set(result, t); - }; - - for (const { weight, value } of results) { - const r = getNumber(value); - add(r - 1, weight); - add(r, weight); - add(r + 1, weight); - } - - let bestWeight = 0; - let bestResult: undefined | number = undefined; - - for (const { weight, result } of tally.values()) { - // Use this result, if this result meets quorum and has either: - // - a better weight - // - or equal weight, but the result is larger - if (weight >= quorum && (weight > bestWeight || (bestResult != null && weight === bestWeight && result > bestResult))) { - bestWeight = weight; - bestResult = result; - } - } - - return bestResult; -} - -/** - * A **FallbackProvider** manages several [[Providers]] providing - * resilience by switching between slow or misbehaving nodes, security - * by requiring multiple backends to aggree and performance by allowing - * faster backends to respond earlier. - * - */ -export class FallbackProvider extends AbstractProvider { - - /** - * The number of backends that must agree on a value before it is - * accpeted. - */ - readonly quorum: number; - - /** - * @_ignore: - */ - readonly eventQuorum: number; - - /** - * @_ignore: - */ - readonly eventWorkers: number; - - readonly #configs: Array; - - #height: number; - #initialSyncPromise: null | Promise; - - /** - * Creates a new **FallbackProvider** with %%providers%% connected to - * %%network%%. - * - * If a [[Provider]] is included in %%providers%%, defaults are used - * for the configuration. - */ - constructor(providers: Array, network?: Networkish, options?: FallbackProviderOptions) { - super(network, options); - - this.#configs = providers.map((p) => { - if (p instanceof AbstractProvider) { - return Object.assign({ provider: p }, defaultConfig, defaultState ); - } else { - return Object.assign({ }, defaultConfig, p, defaultState ); - } - }); - - this.#height = -2; - this.#initialSyncPromise = null; - - if (options && options.quorum != null) { - this.quorum = options.quorum; - } else { - this.quorum = Math.ceil(this.#configs.reduce((accum, config) => { - accum += config.weight; - return accum; - }, 0) / 2); - } - - this.eventQuorum = 1; - this.eventWorkers = 1; - - assertArgument(this.quorum <= this.#configs.reduce((a, c) => (a + c.weight), 0), - "quorum exceed provider weight", "quorum", this.quorum); - } - - get providerConfigs(): Array { - return this.#configs.map((c) => { - const result: any = Object.assign({ }, c); - for (const key in result) { - if (key[0] === "_") { delete result[key]; } - } - return result; - }); - } - - async _detectNetwork(): Promise { - return Network.from(getBigInt(await this._perform({ method: "chainId" }))); - } - - // @TODO: Add support to select providers to be the event subscriber - //_getSubscriber(sub: Subscription): Subscriber { - // throw new Error("@TODO"); - //} - - /** - * Transforms a %%req%% into the correct method call on %%provider%%. - */ - async _translatePerform(provider: AbstractProvider, req: PerformActionRequest): Promise { - switch (req.method) { - case "broadcastTransaction": - return await provider.broadcastTransaction(req.signedTransaction); - case "call": - return await provider.call(Object.assign({ }, req.transaction, { blockTag: req.blockTag })); - case "chainId": - return (await provider.getNetwork()).chainId; - case "estimateGas": - return await provider.estimateGas(req.transaction); - case "getBalance": - return await provider.getBalance(req.address, req.blockTag); - case "getBlock": { - const block = ("blockHash" in req) ? req.blockHash: req.blockTag; - return await provider.getBlock(block, req.includeTransactions); - } - case "getBlockNumber": - return await provider.getBlockNumber(); - case "getCode": - return await provider.getCode(req.address, req.blockTag); - case "getGasPrice": - return (await provider.getFeeData()).gasPrice; - case "getPriorityFee": - return (await provider.getFeeData()).maxPriorityFeePerGas; - case "getLogs": - return await provider.getLogs(req.filter); - case "getStorage": - return await provider.getStorage(req.address, req.position, req.blockTag); - case "getTransaction": - return await provider.getTransaction(req.hash); - case "getTransactionCount": - return await provider.getTransactionCount(req.address, req.blockTag); - case "getTransactionReceipt": - return await provider.getTransactionReceipt(req.hash); - case "getTransactionResult": - return await provider.getTransactionResult(req.hash); - } - } - - // Grab the next (random) config that is not already part of - // the running set - #getNextConfig(running: Set): null | Config { - // @TODO: Maybe do a check here to favour (heavily) providers that - // do not require waitForSync and disfavour providers that - // seem down-ish or are behaving slowly - - const configs = Array.from(running).map((r) => r.config) - - // Shuffle the states, sorted by priority - const allConfigs = this.#configs.slice(); - shuffle(allConfigs); - allConfigs.sort((a, b) => (a.priority - b.priority)); - - for (const config of allConfigs) { - if (config._lastFatalError) { continue; } - if (configs.indexOf(config) === -1) { return config; } - } - - return null; - } - - // Adds a new runner (if available) to running. - #addRunner(running: Set, req: PerformActionRequest): null | RunnerState { - const config = this.#getNextConfig(running); - - // No runners available - if (config == null) { return null; } - - // Create a new runner - const runner: RunnerState = { - config, result: null, didBump: false, - perform: null, staller: null - }; - - const now = getTime(); - - // Start performing this operation - runner.perform = (async () => { - try { - config.requests++; - const result = await this._translatePerform(config.provider, req); - runner.result = { result }; - } catch (error: any) { - config.errorResponses++; - runner.result = { error }; - } - - const dt = (getTime() - now); - config._totalTime += dt; - - config.rollingDuration = 0.95 * config.rollingDuration + 0.05 * dt; - - runner.perform = null; - })(); - - // Start a staller; when this times out, it's time to force - // kicking off another runner because we are taking too long - runner.staller = (async () => { - await stall(config.stallTimeout); - runner.staller = null; - })(); - - running.add(runner); - return runner; - } - - // Initializes the blockNumber and network for each runner and - // blocks until initialized - async #initialSync(): Promise { - let initialSync = this.#initialSyncPromise; - if (!initialSync) { - const promises: Array> = [ ]; - this.#configs.forEach((config) => { - promises.push((async () => { - await waitForSync(config, 0); - if (!config._lastFatalError) { - config._network = await config.provider.getNetwork(); - } - })()); - }); - - this.#initialSyncPromise = initialSync = (async () => { - // Wait for all providers to have a block number and network - await Promise.all(promises); - - // Check all the networks match - let chainId: null | bigint = null; - for (const config of this.#configs) { - if (config._lastFatalError) { continue; } - const network = (config._network); - if (chainId == null) { - chainId = network.chainId; - } else if (network.chainId !== chainId) { - assert(false, "cannot mix providers on different networks", "UNSUPPORTED_OPERATION", { - operation: "new FallbackProvider" - }); - } - } - })(); - } - - await initialSync - } - - - async #checkQuorum(running: Set, req: PerformActionRequest): Promise { - // Get all the result objects - const results: Array = [ ]; - for (const runner of running) { - if (runner.result != null) { - const { tag, value } = normalizeResult(req.method, runner.result); - results.push({ tag, value, weight: runner.config.weight }); - } - } - - // Are there enough results to event meet quorum? - if (results.reduce((a, r) => (a + r.weight), 0) < this.quorum) { - return undefined; - } - - switch (req.method) { - case "getBlockNumber": { - // We need to get the bootstrap block height - if (this.#height === -2) { - this.#height = Math.ceil(getNumber(getMedian(this.quorum, this.#configs.filter((c) => (!c._lastFatalError)).map((c) => ({ - value: c.blockNumber, - tag: getNumber(c.blockNumber).toString(), - weight: c.weight - }))))); - } - - // Find the mode across all the providers, allowing for - // a little drift between block heights - const mode = getFuzzyMode(this.quorum, results); - if (mode === undefined) { return undefined; } - if (mode > this.#height) { this.#height = mode; } - return this.#height; - } - - case "getGasPrice": - case "getPriorityFee": - case "estimateGas": - return getMedian(this.quorum, results); - - case "getBlock": - // Pending blocks are in the mempool and already - // quite untrustworthy; just grab anything - if ("blockTag" in req && req.blockTag === "pending") { - return getAnyResult(this.quorum, results); - } - return checkQuorum(this.quorum, results); - - case "call": - case "chainId": - case "getBalance": - case "getTransactionCount": - case "getCode": - case "getStorage": - case "getTransaction": - case "getTransactionReceipt": - case "getLogs": - return checkQuorum(this.quorum, results); - - case "broadcastTransaction": - return getAnyResult(this.quorum, results); - } - - assert(false, "unsupported method", "UNSUPPORTED_OPERATION", { - operation: `_perform(${ stringify((req).method) })` - }); - } - - async #waitForQuorum(running: Set, req: PerformActionRequest): Promise { - if (running.size === 0) { throw new Error("no runners?!"); } - - // Any promises that are interesting to watch for; an expired stall - // or a successful perform - const interesting: Array> = [ ]; - - let newRunners = 0; - for (const runner of running) { - - // No responses, yet; keep an eye on it - if (runner.perform) { - interesting.push(runner.perform); - } - - // Still stalling... - if (runner.staller) { - interesting.push(runner.staller); - continue; - } - - // This runner has already triggered another runner - if (runner.didBump) { continue; } - - // Got a response (result or error) or stalled; kick off another runner - runner.didBump = true; - newRunners++; - } - - // Check if we have reached quorum on a result (or error) - const value = await this.#checkQuorum(running, req); - if (value !== undefined) { - if (value instanceof Error) { throw value; } - return value; - } - - // Add any new runners, because a staller timed out or a result - // or error response came in. - for (let i = 0; i < newRunners; i++) { - this.#addRunner(running, req); - } - - // All providers have returned, and we have no result - - assert(interesting.length > 0, "quorum not met", "SERVER_ERROR", { - request: "%sub-requests", - info: { request: req, results: Array.from(running).map((r) => stringify(r.result)) } - }); - - // Wait for someone to either complete its perform or stall out - await Promise.race(interesting); - - // This is recursive, but at worst case the depth is 2x the - // number of providers (each has a perform and a staller) - return await this.#waitForQuorum(running, req); - } - - async _perform(req: PerformActionRequest): Promise { - // Broadcasting a transaction is rare (ish) and already incurs - // a cost on the user, so spamming is safe-ish. Just send it to - // every backend. - if (req.method === "broadcastTransaction") { - // Once any broadcast provides a positive result, use it. No - // need to wait for anyone else - const results: Array = this.#configs.map((c) => null); - const broadcasts = this.#configs.map(async ({ provider, weight }, index) => { - try { - const result = await provider._perform(req); - results[index] = Object.assign(normalizeResult(req.method, { result }), { weight }); - } catch (error: any) { - results[index] = Object.assign(normalizeResult(req.method, { error }), { weight }); - } - }); - - // As each promise finishes... - while (true) { - // Check for a valid broadcast result - const done = >results.filter((r) => (r != null)); - for (const { value } of done) { - if (!(value instanceof Error)) { return value; } - } - - // Check for a legit broadcast error (one which we cannot - // recover from; some nodes may return the following red - // herring events: - // - alredy seend (UNKNOWN_ERROR) - // - NONCE_EXPIRED - // - REPLACEMENT_UNDERPRICED - const result = checkQuorum(this.quorum, >results.filter((r) => (r != null))); - if (isError(result, "INSUFFICIENT_FUNDS")) { - throw result; - } - - // Kick off the next provider (if any) - const waiting = broadcasts.filter((b, i) => (results[i] == null)); - if (waiting.length === 0) { break; } - await Promise.race(waiting); - } - - // Use standard quorum results; any result was returned above, - // so this will find any error that met quorum if any - const result = getAnyResult(this.quorum, >results); - assert(result !== undefined, "problem multi-broadcasting", "SERVER_ERROR", { - request: "%sub-requests", - info: { request: req, results: results.map(stringify) } - }) - if (result instanceof Error) { throw result; } - return result; - } - - await this.#initialSync(); - - // Bootstrap enough runners to meet quorum - const running: Set = new Set(); - let inflightQuorum = 0; - while (true) { - const runner = this.#addRunner(running, req); - if (runner == null) { break; } - inflightQuorum += runner.config.weight; - if (inflightQuorum >= this.quorum) { break; } - } - - const result = await this.#waitForQuorum(running, req); - - // Track requests sent to a provider that are still - // outstanding after quorum has been otherwise found - for (const runner of running) { - if (runner.perform && runner.result == null) { - runner.config.lateResponses++; - } - } - - return result; - } - - async destroy(): Promise { - for (const { provider } of this.#configs) { - provider.destroy(); - } - super.destroy(); - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-infura.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-infura.ts deleted file mode 100644 index 123c0663..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-infura.ts +++ /dev/null @@ -1,220 +0,0 @@ -/** - * [[link-infura]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Arbitrum Sepolia Testnet (``arbitrum-sepolia``) - * - Base (``base``) - * - Base Goerlia Testnet (``base-goerli``) - * - Base Sepolia Testnet (``base-sepolia``) - * - BNB Smart Chain Mainnet (``bnb``) - * - BNB Smart Chain Testnet (``bnbt``) - * - Linea (``linea``) - * - Linea Goerli Testnet (``linea-goerli``) - * - Linea Sepolia Testnet (``linea-sepolia``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Optimism Sepolia Testnet (``optimism-sepolia``) - * - Polygon (``matic``) - * - Polygon Amoy Testnet (``matic-amoy``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:INFURA [providers-infura] - */ -import { - defineProperties, FetchRequest, assert, assertArgument -} from "../utils/index.js"; - -import { showThrottleMessage } from "./community.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import { WebSocketProvider } from "./provider-websocket.js"; - -import type { AbstractProvider } from "./abstract-provider.js"; -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; - - -const defaultProjectId = "84842078b09946638c03157f83405213"; - -function getHost(name: string): string { - switch(name) { - case "mainnet": - return "mainnet.infura.io"; - case "goerli": - return "goerli.infura.io"; - case "sepolia": - return "sepolia.infura.io"; - - case "arbitrum": - return "arbitrum-mainnet.infura.io"; - case "arbitrum-goerli": - return "arbitrum-goerli.infura.io"; - case "arbitrum-sepolia": - return "arbitrum-sepolia.infura.io"; - case "base": - return "base-mainnet.infura.io"; - case "base-goerlia": // @TODO: Remove this typo in the future! - case "base-goerli": - return "base-goerli.infura.io"; - case "base-sepolia": - return "base-sepolia.infura.io"; - case "bnb": - return "bsc-mainnet.infura.io"; - case "bnbt": - return "bsc-testnet.infura.io"; - case "linea": - return "linea-mainnet.infura.io"; - case "linea-goerli": - return "linea-goerli.infura.io"; - case "linea-sepolia": - return "linea-sepolia.infura.io"; - case "matic": - return "polygon-mainnet.infura.io"; - case "matic-amoy": - return "polygon-amoy.infura.io"; - case "matic-mumbai": - return "polygon-mumbai.infura.io"; - case "optimism": - return "optimism-mainnet.infura.io"; - case "optimism-goerli": - return "optimism-goerli.infura.io"; - case "optimism-sepolia": - return "optimism-sepolia.infura.io"; - } - - assertArgument(false, "unsupported network", "network", name); -} - -/** - * The **InfuraWebSocketProvider** connects to the [[link-infura]] - * WebSocket end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-infura-signup). - */ -export class InfuraWebSocketProvider extends WebSocketProvider implements CommunityResourcable { - - /** - * The Project ID for the INFURA connection. - */ - readonly projectId!: string; - - /** - * The Project Secret. - * - * If null, no authenticated requests are made. This should not - * be used outside of private contexts. - */ - readonly projectSecret!: null | string; - - /** - * Creates a new **InfuraWebSocketProvider**. - */ - constructor(network?: Networkish, projectId?: string) { - const provider = new InfuraProvider(network, projectId); - - const req = provider._getConnection(); - assert(!req.credentials, "INFURA WebSocket project secrets unsupported", - "UNSUPPORTED_OPERATION", { operation: "InfuraProvider.getWebSocketProvider()" }); - - const url = req.url.replace(/^http/i, "ws").replace("/v3/", "/ws/v3/"); - super(url, provider._network); - - defineProperties(this, { - projectId: provider.projectId, - projectSecret: provider.projectSecret - }); - } - - isCommunityResource(): boolean { - return (this.projectId === defaultProjectId); - } -} - -/** - * The **InfuraProvider** connects to the [[link-infura]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-infura-signup). - */ -export class InfuraProvider extends JsonRpcProvider implements CommunityResourcable { - /** - * The Project ID for the INFURA connection. - */ - readonly projectId!: string; - - /** - * The Project Secret. - * - * If null, no authenticated requests are made. This should not - * be used outside of private contexts. - */ - readonly projectSecret!: null | string; - - /** - * Creates a new **InfuraProvider**. - */ - constructor(_network?: Networkish, projectId?: null | string, projectSecret?: null | string) { - if (_network == null) { _network = "mainnet"; } - const network = Network.from(_network); - if (projectId == null) { projectId = defaultProjectId; } - if (projectSecret == null) { projectSecret = null; } - - const request = InfuraProvider.getRequest(network, projectId, projectSecret); - super(request, network, { staticNetwork: network }); - - defineProperties(this, { projectId, projectSecret }); - } - - _getProvider(chainId: number): AbstractProvider { - try { - return new InfuraProvider(chainId, this.projectId, this.projectSecret); - } catch (error) { } - return super._getProvider(chainId); - } - - isCommunityResource(): boolean { - return (this.projectId === defaultProjectId); - } - - /** - * Creates a new **InfuraWebSocketProvider**. - */ - static getWebSocketProvider(network?: Networkish, projectId?: string): InfuraWebSocketProvider { - return new InfuraWebSocketProvider(network, projectId); - } - - /** - * Returns a prepared request for connecting to %%network%% - * with %%projectId%% and %%projectSecret%%. - */ - static getRequest(network: Network, projectId?: null | string, projectSecret?: null | string): FetchRequest { - if (projectId == null) { projectId = defaultProjectId; } - if (projectSecret == null) { projectSecret = null; } - - const request = new FetchRequest(`https:/\/${ getHost(network.name) }/v3/${ projectId }`); - request.allowGzip = true; - if (projectSecret) { request.setCredentials("", projectSecret); } - - if (projectId === defaultProjectId) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("InfuraProvider"); - return true; - }; - } - - return request; - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-ipcsocket-browser.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-ipcsocket-browser.ts deleted file mode 100644 index 4f11ba6a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-ipcsocket-browser.ts +++ /dev/null @@ -1,3 +0,0 @@ -const IpcSocketProvider = undefined; - -export { IpcSocketProvider }; diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-ipcsocket.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-ipcsocket.ts deleted file mode 100644 index 484a5e45..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-ipcsocket.ts +++ /dev/null @@ -1,81 +0,0 @@ - -import { connect } from "net"; -import { SocketProvider } from "./provider-socket.js"; - -import type { Socket } from "net"; - -import type { JsonRpcApiProviderOptions } from "./provider-jsonrpc.js"; -import type { Networkish } from "./network.js"; - - -// @TODO: Is this sufficient? Is this robust? Will newlines occur between -// all payloads and only between payloads? -function splitBuffer(data: Buffer): { messages: Array, remaining: Buffer } { - const messages: Array = [ ]; - - let lastStart = 0; - while (true) { - const nl = data.indexOf(10, lastStart); - if (nl === -1) { break; } - messages.push(data.subarray(lastStart, nl).toString().trim()); - lastStart = nl + 1; - } - - return { messages, remaining: data.subarray(lastStart) }; -} - -/** - * An **IpcSocketProvider** connects over an IPC socket on the host - * which provides fast access to the node, but requires the node and - * the script run on the same machine. - */ -export class IpcSocketProvider extends SocketProvider { - #socket: Socket; - - /** - * The connected socket. - */ - get socket(): Socket { return this.#socket; } - - constructor(path: string, network?: Networkish, options?: JsonRpcApiProviderOptions) { - super(network, options); - this.#socket = connect(path); - - this.socket.on("ready", async () => { - try { - await this._start(); - } catch (error) { - console.log("failed to start IpcSocketProvider", error); - // @TODO: Now what? Restart? - } - }); - - let response = Buffer.alloc(0); - this.socket.on("data", (data) => { - response = Buffer.concat([ response, data ]); - const { messages, remaining } = splitBuffer(response); - messages.forEach((message) => { - this._processMessage(message); - }); - response = remaining; - }); - - this.socket.on("end", () => { - this.emit("close"); - this.socket.destroy(); - this.socket.end(); - }); - } - - destroy(): void { - this.socket.destroy(); - this.socket.end(); - - super.destroy(); - } - - async _write(message: string): Promise { - if (!message.endsWith("\n")) { message += "\n"; } - this.socket.write(message); - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-jsonrpc.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-jsonrpc.ts deleted file mode 100644 index 301fa265..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-jsonrpc.ts +++ /dev/null @@ -1,1335 +0,0 @@ -/** - * One of the most common ways to interact with the blockchain is - * by a node running a JSON-RPC interface which can be connected to, - * based on the transport, using: - * - * - HTTP or HTTPS - [[JsonRpcProvider]] - * - WebSocket - [[WebSocketProvider]] - * - IPC - [[IpcSocketProvider]] - * - * @_section: api/providers/jsonrpc:JSON-RPC Provider [about-jsonrpcProvider] - */ - -// @TODO: -// - Add the batching API - -// https://playground.open-rpc.org/?schemaUrl=https://raw.githubusercontent.com/ethereum/eth1.0-apis/assembled-spec/openrpc.json&uiSchema%5BappBar%5D%5Bui:splitView%5D=true&uiSchema%5BappBar%5D%5Bui:input%5D=false&uiSchema%5BappBar%5D%5Bui:examplesDropdown%5D=false - -import { AbiCoder } from "../abi/index.js"; -import { getAddress, resolveAddress } from "../address/index.js"; -import { TypedDataEncoder } from "../hash/index.js"; -import { accessListify, authorizationify } from "../transaction/index.js"; -import { - defineProperties, getBigInt, hexlify, isHexString, toQuantity, toUtf8Bytes, - isError, makeError, assert, assertArgument, - FetchRequest, resolveProperties -} from "../utils/index.js"; - -import { AbstractProvider, UnmanagedSubscriber } from "./abstract-provider.js"; -import { AbstractSigner } from "./abstract-signer.js"; -import { Network } from "./network.js"; -import { FilterIdEventSubscriber, FilterIdPendingSubscriber } from "./subscriber-filterid.js"; -import { PollingEventSubscriber } from "./subscriber-polling.js"; - -import type { TypedDataDomain, TypedDataField } from "../hash/index.js"; -import type { TransactionLike } from "../transaction/index.js"; - -import type { PerformActionRequest, Subscriber, Subscription } from "./abstract-provider.js"; -import type { Networkish } from "./network.js"; -import type { Provider, TransactionRequest, TransactionResponse } from "./provider.js"; -import type { Signer } from "./signer.js"; - -type Timer = ReturnType; - -const Primitive = "bigint,boolean,function,number,string,symbol".split(/,/g); -//const Methods = "getAddress,then".split(/,/g); -function deepCopy(value: T): T { - if (value == null || Primitive.indexOf(typeof(value)) >= 0) { - return value; - } - - // Keep any Addressable - if (typeof((value).getAddress) === "function") { - return value; - } - - if (Array.isArray(value)) { return (value.map(deepCopy)); } - - if (typeof(value) === "object") { - return Object.keys(value).reduce((accum, key) => { - accum[key] = (value)[key]; - return accum; - }, { }); - } - - throw new Error(`should not happen: ${ value } (${ typeof(value) })`); -} - -function stall(duration: number): Promise { - return new Promise((resolve) => { setTimeout(resolve, duration); }); -} - -function getLowerCase(value: string): string { - if (value) { return value.toLowerCase(); } - return value; -} - -interface Pollable { - pollingInterval: number; -} - -function isPollable(value: any): value is Pollable { - return (value && typeof(value.pollingInterval) === "number"); -} - -/** - * A JSON-RPC payload, which are sent to a JSON-RPC server. - */ -export type JsonRpcPayload = { - /** - * The JSON-RPC request ID. - */ - id: number; - - /** - * The JSON-RPC request method. - */ - method: string; - - /** - * The JSON-RPC request parameters. - */ - params: Array | Record; - - /** - * A required constant in the JSON-RPC specification. - */ - jsonrpc: "2.0"; -}; - -/** - * A JSON-RPC result, which are returned on success from a JSON-RPC server. - */ -export type JsonRpcResult = { - /** - * The response ID to match it to the relevant request. - */ - id: number; - - /** - * The response result. - */ - result: any; -}; - -/** - * A JSON-RPC error, which are returned on failure from a JSON-RPC server. - */ -export type JsonRpcError = { - /** - * The response ID to match it to the relevant request. - */ - id: number; - - /** - * The response error. - */ - error: { - code: number; - message?: string; - data?: any; - } -}; - -/** - * When subscribing to the ``"debug"`` event, the [[Listener]] will - * receive this object as the first parameter. - */ -export type DebugEventJsonRpcApiProvider = { - action: "sendRpcPayload", - payload: JsonRpcPayload | Array -} | { - action: "receiveRpcResult", - result: Array -} | { - action: "receiveRpcError", - error: Error -}; - -/** - * Options for configuring a [[JsonRpcApiProvider]]. Much of this - * is targetted towards sub-classes, which often will not expose - * any of these options to their consumers. - * - * **``polling``** - use the polling strategy is used immediately - * for events; otherwise, attempt to use filters and fall back onto - * polling (default: ``false``) - * - * **``staticNetwork``** - do not request chain ID on requests to - * validate the underlying chain has not changed (default: ``null``) - * - * This should **ONLY** be used if it is **certain** that the network - * cannot change, such as when using INFURA (since the URL dictates the - * network). If the network is assumed static and it does change, this - * can have tragic consequences. For example, this **CANNOT** be used - * with MetaMask, since the user can select a new network from the - * drop-down at any time. - * - * **``batchStallTime``** - how long (ms) to aggregate requests into a - * single batch. ``0`` indicates batching will only encompass the current - * event loop. If ``batchMaxCount = 1``, this is ignored. (default: ``10``) - * - * **``batchMaxSize``** - target maximum size (bytes) to allow per batch - * request (default: 1Mb) - * - * **``batchMaxCount``** - maximum number of requests to allow in a batch. - * If ``batchMaxCount = 1``, then batching is disabled. (default: ``100``) - * - * **``cacheTimeout``** - passed as [[AbstractProviderOptions]]. - */ -export type JsonRpcApiProviderOptions = { - polling?: boolean; - staticNetwork?: null | boolean | Network; - batchStallTime?: number; - batchMaxSize?: number; - batchMaxCount?: number; - - cacheTimeout?: number; - pollingInterval?: number; -}; - -const defaultOptions = { - polling: false, - staticNetwork: null, - - batchStallTime: 10, // 10ms - batchMaxSize: (1 << 20), // 1Mb - batchMaxCount: 100, // 100 requests - - cacheTimeout: 250, - pollingInterval: 4000 -} - -/** - * A **JsonRpcTransactionRequest** is formatted as needed by the JSON-RPC - * Ethereum API specification. - */ -export interface JsonRpcTransactionRequest { - /** - * The sender address to use when signing. - */ - from?: string; - - /** - * The target address. - */ - to?: string; - - /** - * The transaction data. - */ - data?: string; - - /** - * The chain ID the transaction is valid on. - */ - chainId?: string; - - /** - * The [[link-eip-2718]] transaction type. - */ - type?: string; - - /** - * The maximum amount of gas to allow a transaction to consume. - * - * In most other places in ethers, this is called ``gasLimit`` which - * differs from the JSON-RPC Ethereum API specification. - */ - gas?: string; - - /** - * The gas price per wei for transactions prior to [[link-eip-1559]]. - */ - gasPrice?: string; - - /** - * The maximum fee per gas for [[link-eip-1559]] transactions. - */ - maxFeePerGas?: string; - - /** - * The maximum priority fee per gas for [[link-eip-1559]] transactions. - */ - maxPriorityFeePerGas?: string; - - /** - * The nonce for the transaction. - */ - nonce?: string; - - /** - * The transaction value (in wei). - */ - value?: string; - - /** - * The transaction access list. - */ - accessList?: Array<{ address: string, storageKeys: Array }>; - - /** - * The transaction authorization list. - */ - authorizationList?: Array<{ - address: string, nonce: string, chainId: string, - yParity: string, r: string, s: string - }>; -} - -// @TODO: Unchecked Signers - -export class JsonRpcSigner extends AbstractSigner { - address!: string; - - constructor(provider: JsonRpcApiProvider, address: string) { - super(provider); - address = getAddress(address); - defineProperties(this, { address }); - } - - connect(provider: null | Provider): Signer { - assert(false, "cannot reconnect JsonRpcSigner", "UNSUPPORTED_OPERATION", { - operation: "signer.connect" - }); - } - - async getAddress(): Promise { - return this.address; - } - - // JSON-RPC will automatially fill in nonce, etc. so we just check from - async populateTransaction(tx: TransactionRequest): Promise> { - return await this.populateCall(tx); - } - - // Returns just the hash of the transaction after sent, which is what - // the bare JSON-RPC API does; - async sendUncheckedTransaction(_tx: TransactionRequest): Promise { - const tx = deepCopy(_tx); - - const promises: Array> = []; - - // Make sure the from matches the sender - if (tx.from) { - const _from = tx.from; - promises.push((async () => { - const from = await resolveAddress(_from, this.provider); - assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(), - "from address mismatch", "transaction", _tx); - tx.from = from; - })()); - } else { - tx.from = this.address; - } - - // The JSON-RPC for eth_sendTransaction uses 90000 gas; if the user - // wishes to use this, it is easy to specify explicitly, otherwise - // we look it up for them. - if (tx.gasLimit == null) { - promises.push((async () => { - tx.gasLimit = await this.provider.estimateGas({ ...tx, from: this.address}); - })()); - } - - // The address may be an ENS name or Addressable - if (tx.to != null) { - const _to = tx.to; - promises.push((async () => { - tx.to = await resolveAddress(_to, this.provider); - })()); - } - - // Wait until all of our properties are filled in - if (promises.length) { await Promise.all(promises); } - - const hexTx = this.provider.getRpcTransaction(tx); - - return this.provider.send("eth_sendTransaction", [ hexTx ]); - } - - async sendTransaction(tx: TransactionRequest): Promise { - // This cannot be mined any earlier than any recent block - const blockNumber = await this.provider.getBlockNumber(); - - // Send the transaction - const hash = await this.sendUncheckedTransaction(tx); - - // Unfortunately, JSON-RPC only provides and opaque transaction hash - // for a response, and we need the actual transaction, so we poll - // for it; it should show up very quickly - return await (new Promise((resolve, reject) => { - const timeouts = [ 1000, 100 ]; - let invalids = 0; - - const checkTx = async () => { - - try { - // Try getting the transaction - const tx = await this.provider.getTransaction(hash); - - if (tx != null) { - resolve(tx.replaceableTransaction(blockNumber)); - return; - } - - } catch (error) { - - // If we were cancelled: stop polling. - // If the data is bad: the node returns bad transactions - // If the network changed: calling again will also fail - // If unsupported: likely destroyed - if (isError(error, "CANCELLED") || isError(error, "BAD_DATA") || - isError(error, "NETWORK_ERROR") || isError(error, "UNSUPPORTED_OPERATION")) { - - if (error.info == null) { error.info = { }; } - error.info.sendTransactionHash = hash; - - reject(error); - return; - } - - // Stop-gap for misbehaving backends; see #4513 - if (isError(error, "INVALID_ARGUMENT")) { - invalids++; - if (error.info == null) { error.info = { }; } - error.info.sendTransactionHash = hash; - if (invalids > 10) { - reject(error); - return; - } - } - - // Notify anyone that cares; but we will try again, since - // it is likely an intermittent service error - this.provider.emit("error", makeError("failed to fetch transation after sending (will try again)", "UNKNOWN_ERROR", { error })); - } - - // Wait another 4 seconds - this.provider._setTimeout(() => { checkTx(); }, timeouts.pop() || 4000); - }; - checkTx(); - })); - } - - async signTransaction(_tx: TransactionRequest): Promise { - const tx = deepCopy(_tx); - - // Make sure the from matches the sender - if (tx.from) { - const from = await resolveAddress(tx.from, this.provider); - assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(), - "from address mismatch", "transaction", _tx); - tx.from = from; - } else { - tx.from = this.address; - } - - const hexTx = this.provider.getRpcTransaction(tx); - return await this.provider.send("eth_signTransaction", [ hexTx ]); - } - - - async signMessage(_message: string | Uint8Array): Promise { - const message = ((typeof(_message) === "string") ? toUtf8Bytes(_message): _message); - return await this.provider.send("personal_sign", [ - hexlify(message), this.address.toLowerCase() ]); - } - - async signTypedData(domain: TypedDataDomain, types: Record>, _value: Record): Promise { - const value = deepCopy(_value); - - // Populate any ENS names (in-place) - const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (value: string) => { - const address = await resolveAddress(value); - assertArgument(address != null, "TypedData does not support null address", "value", value); - return address; - }); - - return await this.provider.send("eth_signTypedData_v4", [ - this.address.toLowerCase(), - JSON.stringify(TypedDataEncoder.getPayload(populated.domain, types, populated.value)) - ]); - } - - async unlock(password: string): Promise { - return this.provider.send("personal_unlockAccount", [ - this.address.toLowerCase(), password, null ]); - } - - // https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign - async _legacySignMessage(_message: string | Uint8Array): Promise { - const message = ((typeof(_message) === "string") ? toUtf8Bytes(_message): _message); - return await this.provider.send("eth_sign", [ - this.address.toLowerCase(), hexlify(message) ]); - } -} - -type ResolveFunc = (result: JsonRpcResult) => void; -type RejectFunc = (error: Error) => void; - -type Payload = { payload: JsonRpcPayload, resolve: ResolveFunc, reject: RejectFunc }; - -/** - * The JsonRpcApiProvider is an abstract class and **MUST** be - * sub-classed. - * - * It provides the base for all JSON-RPC-based Provider interaction. - * - * Sub-classing Notes: - * - a sub-class MUST override _send - * - a sub-class MUST call the `_start()` method once connected - */ -export abstract class JsonRpcApiProvider extends AbstractProvider { - - #options: Required; - - // The next ID to use for the JSON-RPC ID field - #nextId: number; - - // Payloads are queued and triggered in batches using the drainTimer - #payloads: Array; - #drainTimer: null | Timer; - - #notReady: null | { - promise: Promise, - resolve: null | ((v: void) => void) - }; - - #network: null | Network; - #pendingDetectNetwork: null | Promise; - - #scheduleDrain(): void { - if (this.#drainTimer) { return; } - - // If we aren't using batching, no harm in sending it immediately - const stallTime = (this._getOption("batchMaxCount") === 1) ? 0: this._getOption("batchStallTime"); - - this.#drainTimer = setTimeout(() => { - this.#drainTimer = null; - - const payloads = this.#payloads; - this.#payloads = [ ]; - - while (payloads.length) { - - // Create payload batches that satisfy our batch constraints - const batch = [ (payloads.shift()) ]; - while (payloads.length) { - if (batch.length === this.#options.batchMaxCount) { break; } - batch.push((payloads.shift())); - const bytes = JSON.stringify(batch.map((p) => p.payload)); - if (bytes.length > this.#options.batchMaxSize) { - payloads.unshift((batch.pop())); - break; - } - } - - // Process the result to each payload - (async () => { - const payload = ((batch.length === 1) ? batch[0].payload: batch.map((p) => p.payload)); - - this.emit("debug", { action: "sendRpcPayload", payload }); - - try { - const result = await this._send(payload); - this.emit("debug", { action: "receiveRpcResult", result }); - - // Process results in batch order - for (const { resolve, reject, payload } of batch) { - - if (this.destroyed) { - reject(makeError("provider destroyed; cancelled request", "UNSUPPORTED_OPERATION", { operation: payload.method })); - continue; - } - - // Find the matching result - const resp = result.filter((r) => (r.id === payload.id))[0]; - - // No result; the node failed us in unexpected ways - if (resp == null) { - const error = makeError("missing response for request", "BAD_DATA", { - value: result, info: { payload } - }); - this.emit("error", error); - reject(error); - continue; - } - - // The response is an error - if ("error" in resp) { - reject(this.getRpcError(payload, resp)); - continue; - } - - // All good; send the result - resolve(resp.result); - } - - } catch (error: any) { - this.emit("debug", { action: "receiveRpcError", error }); - - for (const { reject } of batch) { - // @TODO: augment the error with the payload - reject(error); - } - } - })(); - } - }, stallTime); - } - - constructor(network?: Networkish, options?: JsonRpcApiProviderOptions) { - super(network, options); - - this.#nextId = 1; - this.#options = Object.assign({ }, defaultOptions, options || { }); - - this.#payloads = [ ]; - this.#drainTimer = null; - - this.#network = null; - this.#pendingDetectNetwork = null; - - { - let resolve: null | ((value: void) => void) = null; - const promise = new Promise((_resolve: (value: void) => void) => { - resolve = _resolve; - }); - this.#notReady = { promise, resolve }; - } - - const staticNetwork = this._getOption("staticNetwork"); - if (typeof(staticNetwork) === "boolean") { - assertArgument(!staticNetwork || network !== "any", "staticNetwork cannot be used on special network 'any'", "options", options); - if (staticNetwork && network != null) { - this.#network = Network.from(network); - } - - } else if (staticNetwork) { - // Make sure any static network is compatbile with the provided netwrok - assertArgument(network == null || staticNetwork.matches(network), - "staticNetwork MUST match network object", "options", options); - this.#network = staticNetwork; - } - } - - /** - * Returns the value associated with the option %%key%%. - * - * Sub-classes can use this to inquire about configuration options. - */ - _getOption(key: K): JsonRpcApiProviderOptions[K] { - return this.#options[key]; - } - - /** - * Gets the [[Network]] this provider has committed to. On each call, the network - * is detected, and if it has changed, the call will reject. - */ - get _network(): Network { - assert (this.#network, "network is not available yet", "NETWORK_ERROR"); - return this.#network; - } - - /** - * Sends a JSON-RPC %%payload%% (or a batch) to the underlying channel. - * - * Sub-classes **MUST** override this. - */ - abstract _send(payload: JsonRpcPayload | Array): Promise>; - - - /** - * Resolves to the non-normalized value by performing %%req%%. - * - * Sub-classes may override this to modify behavior of actions, - * and should generally call ``super._perform`` as a fallback. - */ - async _perform(req: PerformActionRequest): Promise { - - // Legacy networks do not like the type field being passed along (which - // is fair), so we delete type if it is 0 and a non-EIP-1559 network - if (req.method === "call" || req.method === "estimateGas") { - let tx = req.transaction; - if (tx && tx.type != null && getBigInt(tx.type)) { - // If there are no EIP-1559 or newer properties, it might be pre-EIP-1559 - if (tx.maxFeePerGas == null && tx.maxPriorityFeePerGas == null) { - const feeData = await this.getFeeData(); - if (feeData.maxFeePerGas == null && feeData.maxPriorityFeePerGas == null) { - // Network doesn't know about EIP-1559 (and hence type) - req = Object.assign({ }, req, { - transaction: Object.assign({ }, tx, { type: undefined }) - }); - } - } - } - } - - const request = this.getRpcRequest(req); - - if (request != null) { - return await this.send(request.method, request.args); - } - - return super._perform(req); - } - - /** - * Sub-classes may override this; it detects the *actual* network that - * we are **currently** connected to. - * - * Keep in mind that [[send]] may only be used once [[ready]], otherwise the - * _send primitive must be used instead. - */ - async _detectNetwork(): Promise { - const network = this._getOption("staticNetwork"); - if (network) { - if (network === true) { - if (this.#network) { return this.#network; } - } else { - return network; - } - } - - if (this.#pendingDetectNetwork) { - return await this.#pendingDetectNetwork; - } - - // If we are ready, use ``send``, which enabled requests to be batched - if (this.ready) { - this.#pendingDetectNetwork = (async () => { - try { - const result = Network.from(getBigInt(await this.send("eth_chainId", [ ]))); - this.#pendingDetectNetwork = null; - return result; - } catch (error) { - this.#pendingDetectNetwork = null; - throw error; - } - })(); - return await this.#pendingDetectNetwork; - } - - // We are not ready yet; use the primitive _send - this.#pendingDetectNetwork = (async () => { - const payload: JsonRpcPayload = { - id: this.#nextId++, method: "eth_chainId", params: [ ], jsonrpc: "2.0" - }; - - this.emit("debug", { action: "sendRpcPayload", payload }); - - let result: JsonRpcResult | JsonRpcError; - try { - result = (await this._send(payload))[0]; - this.#pendingDetectNetwork = null; - } catch (error) { - this.#pendingDetectNetwork = null; - this.emit("debug", { action: "receiveRpcError", error }); - throw error; - } - - this.emit("debug", { action: "receiveRpcResult", result }); - - if ("result" in result) { - return Network.from(getBigInt(result.result)); - } - - throw this.getRpcError(payload, result); - })(); - - return await this.#pendingDetectNetwork; - } - - /** - * Sub-classes **MUST** call this. Until [[_start]] has been called, no calls - * will be passed to [[_send]] from [[send]]. If it is overridden, then - * ``super._start()`` **MUST** be called. - * - * Calling it multiple times is safe and has no effect. - */ - _start(): void { - if (this.#notReady == null || this.#notReady.resolve == null) { return; } - - this.#notReady.resolve(); - this.#notReady = null; - - (async () => { - - // Bootstrap the network - while (this.#network == null && !this.destroyed) { - try { - this.#network = await this._detectNetwork(); - } catch (error) { - if (this.destroyed) { break; } - console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"); - this.emit("error", makeError("failed to bootstrap network detection", "NETWORK_ERROR", { event: "initial-network-discovery", info: { error } })); - await stall(1000); - } - } - - // Start dispatching requests - this.#scheduleDrain(); - })(); - } - - /** - * Resolves once the [[_start]] has been called. This can be used in - * sub-classes to defer sending data until the connection has been - * established. - */ - async _waitUntilReady(): Promise { - if (this.#notReady == null) { return; } - return await this.#notReady.promise; - } - - - /** - * Return a Subscriber that will manage the %%sub%%. - * - * Sub-classes may override this to modify the behavior of - * subscription management. - */ - _getSubscriber(sub: Subscription): Subscriber { - - // Pending Filters aren't availble via polling - if (sub.type === "pending") { return new FilterIdPendingSubscriber(this); } - - if (sub.type === "event") { - if (this._getOption("polling")) { - return new PollingEventSubscriber(this, sub.filter); - } - return new FilterIdEventSubscriber(this, sub.filter); - } - - // Orphaned Logs are handled automatically, by the filter, since - // logs with removed are emitted by it - if (sub.type === "orphan" && sub.filter.orphan === "drop-log") { - return new UnmanagedSubscriber("orphan"); - } - - return super._getSubscriber(sub); - } - - /** - * Returns true only if the [[_start]] has been called. - */ - get ready(): boolean { return this.#notReady == null; } - - /** - * Returns %%tx%% as a normalized JSON-RPC transaction request, - * which has all values hexlified and any numeric values converted - * to Quantity values. - */ - getRpcTransaction(tx: TransactionRequest): JsonRpcTransactionRequest { - const result: JsonRpcTransactionRequest = {}; - - // JSON-RPC now requires numeric values to be "quantity" values - ["chainId", "gasLimit", "gasPrice", "type", "maxFeePerGas", "maxPriorityFeePerGas", "nonce", "value"].forEach((key) => { - if ((tx)[key] == null) { return; } - let dstKey = key; - if (key === "gasLimit") { dstKey = "gas"; } - (result)[dstKey] = toQuantity(getBigInt((tx)[key], `tx.${ key }`)); - }); - - // Make sure addresses and data are lowercase - ["from", "to", "data"].forEach((key) => { - if ((tx)[key] == null) { return; } - (result)[key] = hexlify((tx)[key]); - }); - - // Normalize the access list object - if (tx.accessList) { - result["accessList"] = accessListify(tx.accessList); - } - - if (tx.blobVersionedHashes) { - // @TODO: Remove this case once EIP-4844 added to prepared tx - (result)["blobVersionedHashes"] = tx.blobVersionedHashes.map(h => h.toLowerCase()); - } - - if (tx.authorizationList) { - result["authorizationList"] = tx.authorizationList.map((_a) => { - const a = authorizationify(_a); - return { - address: a.address, - nonce: toQuantity(a.nonce), - chainId: toQuantity(a.chainId), - yParity: toQuantity(a.signature.yParity), - r: toQuantity(a.signature.r), - s: toQuantity(a.signature.s), - } - }); - } - - // @TODO: blobs should probably also be copied over, optionally - // accounting for the kzg property to backfill blobVersionedHashes - // using the commitment. Or should that be left as an exercise to - // the caller? - - return result; - } - - /** - * Returns the request method and arguments required to perform - * %%req%%. - */ - getRpcRequest(req: PerformActionRequest): null | { method: string, args: Array } { - switch (req.method) { - case "chainId": - return { method: "eth_chainId", args: [ ] }; - - case "getBlockNumber": - return { method: "eth_blockNumber", args: [ ] }; - - case "getGasPrice": - return { method: "eth_gasPrice", args: [] }; - - case "getPriorityFee": - return { method: "eth_maxPriorityFeePerGas", args: [ ] }; - - case "getBalance": - return { - method: "eth_getBalance", - args: [ getLowerCase(req.address), req.blockTag ] - }; - - case "getTransactionCount": - return { - method: "eth_getTransactionCount", - args: [ getLowerCase(req.address), req.blockTag ] - }; - - case "getCode": - return { - method: "eth_getCode", - args: [ getLowerCase(req.address), req.blockTag ] - }; - - case "getStorage": - return { - method: "eth_getStorageAt", - args: [ - getLowerCase(req.address), - ("0x" + req.position.toString(16)), - req.blockTag - ] - }; - - case "broadcastTransaction": - return { - method: "eth_sendRawTransaction", - args: [ req.signedTransaction ] - }; - - case "getBlock": - if ("blockTag" in req) { - return { - method: "eth_getBlockByNumber", - args: [ req.blockTag, !!req.includeTransactions ] - }; - } else if ("blockHash" in req) { - return { - method: "eth_getBlockByHash", - args: [ req.blockHash, !!req.includeTransactions ] - }; - } - break; - - case "getTransaction": - return { - method: "eth_getTransactionByHash", - args: [ req.hash ] - }; - - case "getTransactionReceipt": - return { - method: "eth_getTransactionReceipt", - args: [ req.hash ] - }; - - case "call": - return { - method: "eth_call", - args: [ this.getRpcTransaction(req.transaction), req.blockTag ] - }; - - case "estimateGas": { - return { - method: "eth_estimateGas", - args: [ this.getRpcTransaction(req.transaction) ] - }; - } - - case "getLogs": - if (req.filter && req.filter.address != null) { - if (Array.isArray(req.filter.address)) { - req.filter.address = req.filter.address.map(getLowerCase); - } else { - req.filter.address = getLowerCase(req.filter.address); - } - } - return { method: "eth_getLogs", args: [ req.filter ] }; - } - - return null; - } - - /** - * Returns an ethers-style Error for the given JSON-RPC error - * %%payload%%, coalescing the various strings and error shapes - * that different nodes return, coercing them into a machine-readable - * standardized error. - */ - getRpcError(payload: JsonRpcPayload, _error: JsonRpcError): Error { - const { method } = payload; - const { error } = _error; - - if (method === "eth_estimateGas" && error.message) { - const msg = error.message; - if (!msg.match(/revert/i) && msg.match(/insufficient funds/i)) { - return makeError("insufficient funds", "INSUFFICIENT_FUNDS", { - transaction: ((payload).params[0]), - info: { payload, error } - }); - } else if (msg.match(/nonce/i) && msg.match(/too low/i)) { - return makeError("nonce has already been used", "NONCE_EXPIRED", { - transaction: ((payload).params[0]), - info: { payload, error } - }); - } - } - - if (method === "eth_call" || method === "eth_estimateGas") { - const result = spelunkData(error); - - const e = AbiCoder.getBuiltinCallException( - (method === "eth_call") ? "call": "estimateGas", - ((payload).params[0]), - (result ? result.data: null) - ); - e.info = { error, payload }; - return e; - } - - // Only estimateGas and call can return arbitrary contract-defined text, so now we - // we can process text safely. - - const message = JSON.stringify(spelunkMessage(error)); - - if (typeof(error.message) === "string" && error.message.match(/user denied|ethers-user-denied/i)) { - const actionMap: Record = { - eth_sign: "signMessage", - personal_sign: "signMessage", - eth_signTypedData_v4: "signTypedData", - eth_signTransaction: "signTransaction", - eth_sendTransaction: "sendTransaction", - eth_requestAccounts: "requestAccess", - wallet_requestAccounts: "requestAccess", - }; - - return makeError(`user rejected action`, "ACTION_REJECTED", { - action: (actionMap[method] || "unknown") , - reason: "rejected", - info: { payload, error } - }); - } - - if (method === "eth_sendRawTransaction" || method === "eth_sendTransaction") { - const transaction = >((payload).params[0]); - - if (message.match(/insufficient funds|base fee exceeds gas limit/i)) { - return makeError("insufficient funds for intrinsic transaction cost", "INSUFFICIENT_FUNDS", { - transaction, info: { error } - }); - } - - if (message.match(/nonce/i) && message.match(/too low/i)) { - return makeError("nonce has already been used", "NONCE_EXPIRED", { transaction, info: { error } }); - } - - // "replacement transaction underpriced" - if (message.match(/replacement transaction/i) && message.match(/underpriced/i)) { - return makeError("replacement fee too low", "REPLACEMENT_UNDERPRICED", { transaction, info: { error } }); - } - - if (message.match(/only replay-protected/i)) { - return makeError("legacy pre-eip-155 transactions not supported", "UNSUPPORTED_OPERATION", { - operation: method, info: { transaction, info: { error } } - }); - } - } - - let unsupported = !!message.match(/the method .* does not exist/i); - if (!unsupported) { - if (error && (error).details && (error).details.startsWith("Unauthorized method:")) { - unsupported = true; - } - } - - if (unsupported) { - return makeError("unsupported operation", "UNSUPPORTED_OPERATION", { - operation: payload.method, info: { error, payload } - }); - } - - return makeError("could not coalesce error", "UNKNOWN_ERROR", { error, payload }); - } - - - /** - * Requests the %%method%% with %%params%% via the JSON-RPC protocol - * over the underlying channel. This can be used to call methods - * on the backend that do not have a high-level API within the Provider - * API. - * - * This method queues requests according to the batch constraints - * in the options, assigns the request a unique ID. - * - * **Do NOT override** this method in sub-classes; instead - * override [[_send]] or force the options values in the - * call to the constructor to modify this method's behavior. - */ - send(method: string, params: Array | Record): Promise { - // @TODO: cache chainId?? purge on switch_networks - - // We have been destroyed; no operations are supported anymore - if (this.destroyed) { - return Promise.reject(makeError("provider destroyed; cancelled request", "UNSUPPORTED_OPERATION", { operation: method })); - } - - const id = this.#nextId++; - const promise = new Promise((resolve, reject) => { - this.#payloads.push({ - resolve, reject, - payload: { method, params, id, jsonrpc: "2.0" } - }); - }); - - // If there is not a pending drainTimer, set one - this.#scheduleDrain(); - - return >promise; - } - - /** - * Resolves to the [[Signer]] account for %%address%% managed by - * the client. - * - * If the %%address%% is a number, it is used as an index in the - * the accounts from [[listAccounts]]. - * - * This can only be used on clients which manage accounts (such as - * Geth with imported account or MetaMask). - * - * Throws if the account doesn't exist. - */ - async getSigner(address?: number | string): Promise { - if (address == null) { address = 0; } - - const accountsPromise = this.send("eth_accounts", [ ]); - - // Account index - if (typeof(address) === "number") { - const accounts = >(await accountsPromise); - if (address >= accounts.length) { throw new Error("no such account"); } - return new JsonRpcSigner(this, accounts[address]); - } - - const { accounts } = await resolveProperties({ - network: this.getNetwork(), - accounts: accountsPromise - }); - - // Account address - address = getAddress(address); - for (const account of accounts) { - if (getAddress(account) === address) { - return new JsonRpcSigner(this, address); - } - } - - throw new Error("invalid account"); - } - - async listAccounts(): Promise> { - const accounts: Array = await this.send("eth_accounts", [ ]); - return accounts.map((a) => new JsonRpcSigner(this, a)); - } - - destroy(): void { - - // Stop processing requests - if (this.#drainTimer) { - clearTimeout(this.#drainTimer); - this.#drainTimer = null; - } - - // Cancel all pending requests - for (const { payload, reject } of this.#payloads) { - reject(makeError("provider destroyed; cancelled request", "UNSUPPORTED_OPERATION", { operation: payload.method })); - } - - this.#payloads = [ ]; - - // Parent clean-up - super.destroy(); - - } -} - -// @TODO: remove this in v7, it is not exported because this functionality -// is exposed in the JsonRpcApiProvider by setting polling to true. It should -// be safe to remove regardless, because it isn't reachable, but just in case. -/** - * @_ignore: - */ -export abstract class JsonRpcApiPollingProvider extends JsonRpcApiProvider { - #pollingInterval: number; - constructor(network?: Networkish, options?: JsonRpcApiProviderOptions) { - super(network, options); - - let pollingInterval = this._getOption("pollingInterval"); - if (pollingInterval == null) { pollingInterval = defaultOptions.pollingInterval; } - - this.#pollingInterval = pollingInterval; - } - - _getSubscriber(sub: Subscription): Subscriber { - const subscriber = super._getSubscriber(sub); - if (isPollable(subscriber)) { - subscriber.pollingInterval = this.#pollingInterval; - } - return subscriber; - } - - /** - * The polling interval (default: 4000 ms) - */ - get pollingInterval(): number { return this.#pollingInterval; } - set pollingInterval(value: number) { - if (!Number.isInteger(value) || value < 0) { throw new Error("invalid interval"); } - this.#pollingInterval = value; - this._forEachSubscriber((sub) => { - if (isPollable(sub)) { - sub.pollingInterval = this.#pollingInterval; - } - }); - } -} - -/** - * The JsonRpcProvider is one of the most common Providers, - * which performs all operations over HTTP (or HTTPS) requests. - * - * Events are processed by polling the backend for the current block - * number; when it advances, all block-base events are then checked - * for updates. - */ -export class JsonRpcProvider extends JsonRpcApiPollingProvider { - #connect: FetchRequest; - - constructor(url?: string | FetchRequest, network?: Networkish, options?: JsonRpcApiProviderOptions) { - if (url == null) { url = "http:/\/localhost:8545"; } - super(network, options); - - if (typeof(url) === "string") { - this.#connect = new FetchRequest(url); - } else { - this.#connect = url.clone(); - } - } - - _getConnection(): FetchRequest { - return this.#connect.clone(); - } - - async send(method: string, params: Array | Record): Promise { - // All requests are over HTTP, so we can just start handling requests - // We do this here rather than the constructor so that we don't send any - // requests to the network (i.e. eth_chainId) until we absolutely have to. - await this._start(); - - return await super.send(method, params); - } - - async _send(payload: JsonRpcPayload | Array): Promise> { - // Configure a POST connection for the requested method - const request = this._getConnection(); - request.body = JSON.stringify(payload); - request.setHeader("content-type", "application/json"); - const response = await request.send(); - response.assertOk(); - - let resp = response.bodyJson; - if (!Array.isArray(resp)) { resp = [ resp ]; } - - return resp; - } -} - -function spelunkData(value: any): null | { message: string, data: string } { - if (value == null) { return null; } - - // These *are* the droids we're looking for. - if (typeof(value.message) === "string" && value.message.match(/revert/i) && isHexString(value.data)) { - return { message: value.message, data: value.data }; - } - - // Spelunk further... - if (typeof(value) === "object") { - for (const key in value) { - const result = spelunkData(value[key]); - if (result) { return result; } - } - return null; - } - - // Might be a JSON string we can further descend... - if (typeof(value) === "string") { - try { - return spelunkData(JSON.parse(value)); - } catch (error) { } - } - - return null; -} - -function _spelunkMessage(value: any, result: Array): void { - if (value == null) { return; } - - // These *are* the droids we're looking for. - if (typeof(value.message) === "string") { - result.push(value.message); - } - - // Spelunk further... - if (typeof(value) === "object") { - for (const key in value) { - _spelunkMessage(value[key], result); - } - } - - // Might be a JSON string we can further descend... - if (typeof(value) === "string") { - try { - return _spelunkMessage(JSON.parse(value), result); - } catch (error) { } - } -} - -function spelunkMessage(value: any): Array { - const result: Array = [ ]; - _spelunkMessage(value, result); - return result; -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-pocket.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-pocket.ts deleted file mode 100644 index 50f28640..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-pocket.ts +++ /dev/null @@ -1,121 +0,0 @@ -/** - * [[link-pocket]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Polygon (``matic``) - * - Arbitrum (``arbitrum``) - * - * @_subsection: api/providers/thirdparty:Pocket [providers-pocket] - */ -import { - defineProperties, FetchRequest, assertArgument -} from "../utils/index.js"; - -import { AbstractProvider } from "./abstract-provider.js"; -import { showThrottleMessage } from "./community.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; - -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; - -const defaultApplicationId = "62e1ad51b37b8e00394bda3b"; - -function getHost(name: string): string { - switch (name) { - case "mainnet": - return "eth-mainnet.gateway.pokt.network"; - case "goerli": - return "eth-goerli.gateway.pokt.network"; - - case "matic": - return "poly-mainnet.gateway.pokt.network"; - case "matic-mumbai": - return "polygon-mumbai-rpc.gateway.pokt.network"; - } - - assertArgument(false, "unsupported network", "network", name); -} - - -/** - * The **PocketProvider** connects to the [[link-pocket]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-pocket-signup). - */ -export class PocketProvider extends JsonRpcProvider implements CommunityResourcable { - - /** - * The Application ID for the Pocket connection. - */ - readonly applicationId!: string; - - /** - * The Application Secret for making authenticated requests - * to the Pocket connection. - */ - readonly applicationSecret!: null | string; - - /** - * Create a new **PocketProvider**. - * - * By default connecting to ``mainnet`` with a highly throttled - * API key. - */ - constructor(_network?: Networkish, applicationId?: null | string, applicationSecret?: null | string) { - if (_network == null) { _network = "mainnet"; } - const network = Network.from(_network); - if (applicationId == null) { applicationId = defaultApplicationId; } - if (applicationSecret == null) { applicationSecret = null; } - - const options = { staticNetwork: network }; - - const request = PocketProvider.getRequest(network, applicationId, applicationSecret); - super(request, network, options); - - defineProperties(this, { applicationId, applicationSecret }); - } - - _getProvider(chainId: number): AbstractProvider { - try { - return new PocketProvider(chainId, this.applicationId, this.applicationSecret); - } catch (error) { } - return super._getProvider(chainId); - } - - /** - * Returns a prepared request for connecting to %%network%% with - * %%applicationId%%. - */ - static getRequest(network: Network, applicationId?: null | string, applicationSecret?: null | string): FetchRequest { - if (applicationId == null) { applicationId = defaultApplicationId; } - - const request = new FetchRequest(`https:/\/${ getHost(network.name) }/v1/lb/${ applicationId }`); - request.allowGzip = true; - - if (applicationSecret) { - request.setCredentials("", applicationSecret); - } - - if (applicationId === defaultApplicationId) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("PocketProvider"); - return true; - }; - } - - return request; - } - - isCommunityResource(): boolean { - return (this.applicationId === defaultApplicationId); - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-quicknode.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-quicknode.ts deleted file mode 100644 index 71bb83b6..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-quicknode.ts +++ /dev/null @@ -1,177 +0,0 @@ -/** - * [[link-quicknode]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Ethereum Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Holesky Testnet (``holesky``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Arbitrum Sepolia Testnet (``arbitrum-sepolia``) - * - Base Mainnet (``base``); - * - Base Goerli Testnet (``base-goerli``); - * - Base Sepolia Testnet (``base-sepolia``); - * - BNB Smart Chain Mainnet (``bnb``) - * - BNB Smart Chain Testnet (``bnbt``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Optimism Sepolia Testnet (``optimism-sepolia``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:QuickNode [providers-quicknode] - */ - -import { - defineProperties, FetchRequest, assertArgument -} from "../utils/index.js"; - -import { showThrottleMessage } from "./community.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; - -import type { AbstractProvider } from "./abstract-provider.js"; -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; - - -const defaultToken = "919b412a057b5e9c9b6dce193c5a60242d6efadb"; - -function getHost(name: string): string { - switch(name) { - case "mainnet": - return "ethers.quiknode.pro"; - case "goerli": - return "ethers.ethereum-goerli.quiknode.pro"; - case "sepolia": - return "ethers.ethereum-sepolia.quiknode.pro"; - case "holesky": - return "ethers.ethereum-holesky.quiknode.pro"; - - case "arbitrum": - return "ethers.arbitrum-mainnet.quiknode.pro"; - case "arbitrum-goerli": - return "ethers.arbitrum-goerli.quiknode.pro"; - case "arbitrum-sepolia": - return "ethers.arbitrum-sepolia.quiknode.pro"; - case "base": - return "ethers.base-mainnet.quiknode.pro"; - case "base-goerli": - return "ethers.base-goerli.quiknode.pro"; - case "base-spolia": - return "ethers.base-sepolia.quiknode.pro"; - case "bnb": - return "ethers.bsc.quiknode.pro"; - case "bnbt": - return "ethers.bsc-testnet.quiknode.pro"; - case "matic": - return "ethers.matic.quiknode.pro"; - case "matic-mumbai": - return "ethers.matic-testnet.quiknode.pro"; - case "optimism": - return "ethers.optimism.quiknode.pro"; - case "optimism-goerli": - return "ethers.optimism-goerli.quiknode.pro"; - case "optimism-sepolia": - return "ethers.optimism-sepolia.quiknode.pro"; - case "xdai": - return "ethers.xdai.quiknode.pro"; - } - - assertArgument(false, "unsupported network", "network", name); -} - -/* -@TODO: - These networks are not currently present in the Network - default included networks. Research them and ensure they - are EVM compatible and work with ethers - - http://ethers.matic-amoy.quiknode.pro - - http://ethers.avalanche-mainnet.quiknode.pro - http://ethers.avalanche-testnet.quiknode.pro - http://ethers.blast-sepolia.quiknode.pro - http://ethers.celo-mainnet.quiknode.pro - http://ethers.fantom.quiknode.pro - http://ethers.imx-demo.quiknode.pro - http://ethers.imx-mainnet.quiknode.pro - http://ethers.imx-testnet.quiknode.pro - http://ethers.near-mainnet.quiknode.pro - http://ethers.near-testnet.quiknode.pro - http://ethers.nova-mainnet.quiknode.pro - http://ethers.scroll-mainnet.quiknode.pro - http://ethers.scroll-testnet.quiknode.pro - http://ethers.tron-mainnet.quiknode.pro - http://ethers.zkevm-mainnet.quiknode.pro - http://ethers.zkevm-testnet.quiknode.pro - http://ethers.zksync-mainnet.quiknode.pro - http://ethers.zksync-testnet.quiknode.pro -*/ - - - -/** - * The **QuickNodeProvider** connects to the [[link-quicknode]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API token is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-quicknode). - */ -export class QuickNodeProvider extends JsonRpcProvider implements CommunityResourcable { - /** - * The API token. - */ - readonly token!: string; - - /** - * Creates a new **QuickNodeProvider**. - */ - constructor(_network?: Networkish, token?: null | string) { - if (_network == null) { _network = "mainnet"; } - const network = Network.from(_network); - if (token == null) { token = defaultToken; } - - const request = QuickNodeProvider.getRequest(network, token); - super(request, network, { staticNetwork: network }); - - defineProperties(this, { token }); - } - - _getProvider(chainId: number): AbstractProvider { - try { - return new QuickNodeProvider(chainId, this.token); - } catch (error) { } - return super._getProvider(chainId); - } - - isCommunityResource(): boolean { - return (this.token === defaultToken); - } - - /** - * Returns a new request prepared for %%network%% and the - * %%token%%. - */ - static getRequest(network: Network, token?: null | string): FetchRequest { - if (token == null) { token = defaultToken; } - - const request = new FetchRequest(`https:/\/${ getHost(network.name) }/${ token }`); - request.allowGzip = true; - //if (projectSecret) { request.setCredentials("", projectSecret); } - - if (token === defaultToken) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("QuickNodeProvider"); - return true; - }; - } - - return request; - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-socket.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-socket.ts deleted file mode 100644 index db14b70e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-socket.ts +++ /dev/null @@ -1,352 +0,0 @@ -/** - * Generic long-lived socket provider. - * - * Sub-classing notes - * - a sub-class MUST call the `_start()` method once connected - * - a sub-class MUST override the `_write(string)` method - * - a sub-class MUST call `_processMessage(string)` for each message - * - * @_subsection: api/providers/abstract-provider:Socket Providers [about-socketProvider] - */ - -import { UnmanagedSubscriber } from "./abstract-provider.js"; -import { assert, assertArgument, makeError } from "../utils/index.js"; -import { JsonRpcApiProvider } from "./provider-jsonrpc.js"; - -import type { Subscriber, Subscription } from "./abstract-provider.js"; -import type { EventFilter } from "./provider.js"; -import type { - JsonRpcApiProviderOptions, JsonRpcError, JsonRpcPayload, JsonRpcResult -} from "./provider-jsonrpc.js"; -import type { Networkish } from "./network.js"; - - -type JsonRpcSubscription = { - method: string, - params: { - result: any, - subscription: string - } -}; - -/** - * A **SocketSubscriber** uses a socket transport to handle events and - * should use [[_emit]] to manage the events. - */ -export class SocketSubscriber implements Subscriber { - #provider: SocketProvider; - - #filter: string; - - /** - * The filter. - */ - get filter(): Array { return JSON.parse(this.#filter); } - - #filterId: null | Promise; - #paused: null | boolean; - - #emitPromise: null | Promise; - - /** - * Creates a new **SocketSubscriber** attached to %%provider%% listening - * to %%filter%%. - */ - constructor(provider: SocketProvider, filter: Array) { - this.#provider = provider; - this.#filter = JSON.stringify(filter); - this.#filterId = null; - this.#paused = null; - this.#emitPromise = null; - } - - start(): void { - this.#filterId = this.#provider.send("eth_subscribe", this.filter).then((filterId) => {; - this.#provider._register(filterId, this); - return filterId; - }); - } - - stop(): void { - (>(this.#filterId)).then((filterId) => { - if (this.#provider.destroyed) { return; } - this.#provider.send("eth_unsubscribe", [ filterId ]); - }); - this.#filterId = null; - } - - // @TODO: pause should trap the current blockNumber, unsub, and on resume use getLogs - // and resume - pause(dropWhilePaused?: boolean): void { - assert(dropWhilePaused, "preserve logs while paused not supported by SocketSubscriber yet", - "UNSUPPORTED_OPERATION", { operation: "pause(false)" }); - this.#paused = !!dropWhilePaused; - } - - resume(): void { - this.#paused = null; - } - - /** - * @_ignore: - */ - _handleMessage(message: any): void { - if (this.#filterId == null) { return; } - if (this.#paused === null) { - let emitPromise: null | Promise = this.#emitPromise; - if (emitPromise == null) { - emitPromise = this._emit(this.#provider, message); - } else { - emitPromise = emitPromise.then(async () => { - await this._emit(this.#provider, message); - }); - } - this.#emitPromise = emitPromise.then(() => { - if (this.#emitPromise === emitPromise) { - this.#emitPromise = null; - } - }); - } - } - - /** - * Sub-classes **must** override this to emit the events on the - * provider. - */ - async _emit(provider: SocketProvider, message: any): Promise { - throw new Error("sub-classes must implemente this; _emit"); - } -} - -/** - * A **SocketBlockSubscriber** listens for ``newHeads`` events and emits - * ``"block"`` events. - */ -export class SocketBlockSubscriber extends SocketSubscriber { - /** - * @_ignore: - */ - constructor(provider: SocketProvider) { - super(provider, [ "newHeads" ]); - } - - async _emit(provider: SocketProvider, message: any): Promise { - provider.emit("block", parseInt(message.number)); - } -} - -/** - * A **SocketPendingSubscriber** listens for pending transacitons and emits - * ``"pending"`` events. - */ -export class SocketPendingSubscriber extends SocketSubscriber { - - /** - * @_ignore: - */ - constructor(provider: SocketProvider) { - super(provider, [ "newPendingTransactions" ]); - } - - async _emit(provider: SocketProvider, message: any): Promise { - provider.emit("pending", message); - } -} - -/** - * A **SocketEventSubscriber** listens for event logs. - */ -export class SocketEventSubscriber extends SocketSubscriber { - #logFilter: string; - - /** - * The filter. - */ - get logFilter(): EventFilter { return JSON.parse(this.#logFilter); } - - /** - * @_ignore: - */ - constructor(provider: SocketProvider, filter: EventFilter) { - super(provider, [ "logs", filter ]); - this.#logFilter = JSON.stringify(filter); - } - - async _emit(provider: SocketProvider, message: any): Promise { - provider.emit(this.logFilter, provider._wrapLog(message, provider._network)); - } -} - -/** - * A **SocketProvider** is backed by a long-lived connection over a - * socket, which can subscribe and receive real-time messages over - * its communication channel. - */ -export class SocketProvider extends JsonRpcApiProvider { - #callbacks: Map void, reject: (e: Error) => void }>; - - // Maps each filterId to its subscriber - #subs: Map; - - // If any events come in before a subscriber has finished - // registering, queue them - #pending: Map>; - - /** - * Creates a new **SocketProvider** connected to %%network%%. - * - * If unspecified, the network will be discovered. - */ - constructor(network?: Networkish, _options?: JsonRpcApiProviderOptions) { - // Copy the options - const options = Object.assign({ }, (_options != null) ? _options: { }); - - // Support for batches is generally not supported for - // connection-base providers; if this changes in the future - // the _send should be updated to reflect this - assertArgument(options.batchMaxCount == null || options.batchMaxCount === 1, - "sockets-based providers do not support batches", "options.batchMaxCount", _options); - options.batchMaxCount = 1; - - // Socket-based Providers (generally) cannot change their network, - // since they have a long-lived connection; but let people override - // this if they have just cause. - if (options.staticNetwork == null) { options.staticNetwork = true; } - - super(network, options); - this.#callbacks = new Map(); - this.#subs = new Map(); - this.#pending = new Map(); - } - - // This value is only valid after _start has been called - /* - get _network(): Network { - if (this.#network == null) { - throw new Error("this shouldn't happen"); - } - return this.#network.clone(); - } - */ - - _getSubscriber(sub: Subscription): Subscriber { - switch (sub.type) { - case "close": - return new UnmanagedSubscriber("close"); - case "block": - return new SocketBlockSubscriber(this); - case "pending": - return new SocketPendingSubscriber(this); - case "event": - return new SocketEventSubscriber(this, sub.filter); - case "orphan": - // Handled auto-matically within AbstractProvider - // when the log.removed = true - if (sub.filter.orphan === "drop-log") { - return new UnmanagedSubscriber("drop-log"); - } - } - return super._getSubscriber(sub); - } - - /** - * Register a new subscriber. This is used internalled by Subscribers - * and generally is unecessary unless extending capabilities. - */ - _register(filterId: number | string, subscriber: SocketSubscriber): void { - this.#subs.set(filterId, subscriber); - const pending = this.#pending.get(filterId); - if (pending) { - for (const message of pending) { - subscriber._handleMessage(message); - } - this.#pending.delete(filterId); - } - } - - async _send(payload: JsonRpcPayload | Array): Promise> { - // WebSocket provider doesn't accept batches - assertArgument(!Array.isArray(payload), "WebSocket does not support batch send", "payload", payload); - - // @TODO: stringify payloads here and store to prevent mutations - - // Prepare a promise to respond to - const promise = new Promise((resolve, reject) => { - this.#callbacks.set(payload.id, { payload, resolve, reject }); - }); - - // Wait until the socket is connected before writing to it - await this._waitUntilReady(); - - // Write the request to the socket - await this._write(JSON.stringify(payload)); - - return >[ await promise ]; - } - - // Sub-classes must call this once they are connected - /* - async _start(): Promise { - if (this.#ready) { return; } - - for (const { payload } of this.#callbacks.values()) { - await this._write(JSON.stringify(payload)); - } - - this.#ready = (async function() { - await super._start(); - })(); - } - */ - - /** - * Sub-classes **must** call this with messages received over their - * transport to be processed and dispatched. - */ - async _processMessage(message: string): Promise { - const result = (JSON.parse(message)); - - if (result && typeof(result) === "object" && "id" in result) { - const callback = this.#callbacks.get(result.id); - if (callback == null) { - this.emit("error", makeError("received result for unknown id", "UNKNOWN_ERROR", { - reasonCode: "UNKNOWN_ID", - result - })); - return; - } - this.#callbacks.delete(result.id); - - callback.resolve(result); - - } else if (result && result.method === "eth_subscription") { - const filterId = result.params.subscription; - const subscriber = this.#subs.get(filterId); - if (subscriber) { - subscriber._handleMessage(result.params.result); - } else { - let pending = this.#pending.get(filterId); - if (pending == null) { - pending = [ ]; - this.#pending.set(filterId, pending); - } - pending.push(result.params.result); - } - - } else { - this.emit("error", makeError("received unexpected message", "UNKNOWN_ERROR", { - reasonCode: "UNEXPECTED_MESSAGE", - result - })); - return; - } - } - - /** - * Sub-classes **must** override this to send %%message%% over their - * transport. - */ - async _write(message: string): Promise { - throw new Error("sub-classes must override this"); - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-websocket.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-websocket.ts deleted file mode 100644 index ee1cf847..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider-websocket.ts +++ /dev/null @@ -1,103 +0,0 @@ - - -import { WebSocket as _WebSocket } from "./ws.js"; /*-browser*/ - -import { SocketProvider } from "./provider-socket.js"; - -import type { JsonRpcApiProviderOptions} from "./provider-jsonrpc.js"; -import type { Networkish } from "./network.js"; - -/** - * A generic interface to a Websocket-like object. - */ -export interface WebSocketLike { - onopen: null | ((...args: Array) => any); - onmessage: null | ((...args: Array) => any); - onerror: null | ((...args: Array) => any); - - readyState: number; - - send(payload: any): void; - close(code?: number, reason?: string): void; -} - -/** - * A function which can be used to re-create a WebSocket connection - * on disconnect. - */ -export type WebSocketCreator = () => WebSocketLike; - -/** - * A JSON-RPC provider which is backed by a WebSocket. - * - * WebSockets are often preferred because they retain a live connection - * to a server, which permits more instant access to events. - * - * However, this incurs higher server infrasturture costs, so additional - * resources may be required to host your own WebSocket nodes and many - * third-party services charge additional fees for WebSocket endpoints. - */ -export class WebSocketProvider extends SocketProvider { - #connect: null | WebSocketCreator; - - #websocket: null | WebSocketLike; - get websocket(): WebSocketLike { - if (this.#websocket == null) { throw new Error("websocket closed"); } - return this.#websocket; - } - - constructor(url: string | WebSocketLike | WebSocketCreator, network?: Networkish, options?: JsonRpcApiProviderOptions) { - super(network, options); - if (typeof(url) === "string") { - this.#connect = () => { return new _WebSocket(url); }; - this.#websocket = this.#connect(); - } else if (typeof(url) === "function") { - this.#connect = url; - this.#websocket = url(); - } else { - this.#connect = null; - this.#websocket = url; - } - - this.websocket.onopen = async () => { - try { - await this._start() - this.resume(); - } catch (error) { - console.log("failed to start WebsocketProvider", error); - // @TODO: now what? Attempt reconnect? - } - }; - - this.websocket.onmessage = (message: { data: string }) => { - this._processMessage(message.data); - }; -/* - this.websocket.onclose = (event) => { - // @TODO: What event.code should we reconnect on? - const reconnect = false; - if (reconnect) { - this.pause(true); - if (this.#connect) { - this.#websocket = this.#connect(); - this.#websocket.onopen = ... - // @TODO: this requires the super class to rebroadcast; move it there - } - this._reconnect(); - } - }; -*/ - } - - async _write(message: string): Promise { - this.websocket.send(message); - } - - async destroy(): Promise { - if (this.#websocket != null) { - this.#websocket.close(); - this.#websocket = null; - } - super.destroy(); - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider.ts deleted file mode 100644 index fb395d2f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/provider.ts +++ /dev/null @@ -1,2146 +0,0 @@ -//import { resolveAddress } from "@ethersproject/address"; -import { - defineProperties, getBigInt, getNumber, hexlify, isBytesLike, - resolveProperties, - assert, assertArgument, isError, makeError -} from "../utils/index.js"; -import { accessListify } from "../transaction/index.js"; - -import type { AddressLike, NameResolver } from "../address/index.js"; -import type { BigNumberish, EventEmitterable } from "../utils/index.js"; -import type { Signature } from "../crypto/index.js"; -import type { - AccessList, AccessListish, Authorization, AuthorizationLike, BlobLike, - KzgLibraryLike, TransactionLike -} from "../transaction/index.js"; - -import type { ContractRunner } from "./contracts.js"; -import type { Network } from "./network.js"; - - -const BN_0 = BigInt(0); - -/** - * A **BlockTag** specifies a specific block. - * - * **numeric value** - specifies the block height, where - * the genesis block is block 0; many operations accept a negative - * value which indicates the block number should be deducted from - * the most recent block. A numeric value may be a ``number``, ``bigint``, - * or a decimal of hex string. - * - * **blockhash** - specifies a specific block by its blockhash; this allows - * potentially orphaned blocks to be specifed, without ambiguity, but many - * backends do not support this for some operations. - */ -export type BlockTag = BigNumberish | string; - -import { - BlockParams, LogParams, TransactionReceiptParams, - TransactionResponseParams -} from "./formatting.js"; - -// ----------------------- - -function getValue(value: undefined | null | T): null | T { - if (value == null) { return null; } - return value; -} - -function toJson(value: null | bigint): null | string { - if (value == null) { return null; } - return value.toString(); -} - -// @TODO? implements Required - -/** - * A **FeeData** wraps all the fee-related values associated with - * the network. - */ -export class FeeData { - /** - * The gas price for legacy networks. - */ - readonly gasPrice!: null | bigint; - - /** - * The maximum fee to pay per gas. - * - * The base fee per gas is defined by the network and based on - * congestion, increasing the cost during times of heavy load - * and lowering when less busy. - * - * The actual fee per gas will be the base fee for the block - * and the priority fee, up to the max fee per gas. - * - * This will be ``null`` on legacy networks (i.e. [pre-EIP-1559](link-eip-1559)) - */ - readonly maxFeePerGas!: null | bigint; - - /** - * The additional amout to pay per gas to encourage a validator - * to include the transaction. - * - * The purpose of this is to compensate the validator for the - * adjusted risk for including a given transaction. - * - * This will be ``null`` on legacy networks (i.e. [pre-EIP-1559](link-eip-1559)) - */ - readonly maxPriorityFeePerGas!: null | bigint; - - /** - * Creates a new FeeData for %%gasPrice%%, %%maxFeePerGas%% and - * %%maxPriorityFeePerGas%%. - */ - constructor(gasPrice?: null | bigint, maxFeePerGas?: null | bigint, maxPriorityFeePerGas?: null | bigint) { - defineProperties(this, { - gasPrice: getValue(gasPrice), - maxFeePerGas: getValue(maxFeePerGas), - maxPriorityFeePerGas: getValue(maxPriorityFeePerGas) - }); - } - - /** - * Returns a JSON-friendly value. - */ - toJSON(): any { - const { - gasPrice, maxFeePerGas, maxPriorityFeePerGas - } = this; - return { - _type: "FeeData", - gasPrice: toJson(gasPrice), - maxFeePerGas: toJson(maxFeePerGas), - maxPriorityFeePerGas: toJson(maxPriorityFeePerGas), - }; - } -} - - -/** - * A **TransactionRequest** is a transactions with potentially various - * properties not defined, or with less strict types for its values. - * - * This is used to pass to various operations, which will internally - * coerce any types and populate any necessary values. - */ -export interface TransactionRequest { - /** - * The transaction type. - */ - type?: null | number; - - /** - * The target of the transaction. - */ - to?: null | AddressLike; - - /** - * The sender of the transaction. - */ - from?: null | AddressLike; - - /** - * The nonce of the transaction, used to prevent replay attacks. - */ - nonce?: null | number; - - /** - * The maximum amount of gas to allow this transaction to consume. - */ - gasLimit?: null | BigNumberish; - - /** - * The gas price to use for legacy transactions or transactions on - * legacy networks. - * - * Most of the time the ``max*FeePerGas`` is preferred. - */ - gasPrice?: null | BigNumberish; - - /** - * The [[link-eip-1559]] maximum priority fee to pay per gas. - */ - maxPriorityFeePerGas?: null | BigNumberish; - - /** - * The [[link-eip-1559]] maximum total fee to pay per gas. The actual - * value used is protocol enforced to be the block's base fee. - */ - maxFeePerGas?: null | BigNumberish; - - /** - * The transaction data. - */ - data?: null | string; - - /** - * The transaction value (in wei). - */ - value?: null | BigNumberish; - - /** - * The chain ID for the network this transaction is valid on. - */ - chainId?: null | BigNumberish; - - /** - * The [[link-eip-2930]] access list. Storage slots included in the access - * list are //warmed// by pre-loading them, so their initial cost to - * fetch is guaranteed, but then each additional access is cheaper. - */ - accessList?: null | AccessListish; - - /** - * A custom object, which can be passed along for network-specific - * values. - */ - customData?: any; - - // Only meaningful when used for call - - /** - * When using ``call`` or ``estimateGas``, this allows a specific - * block to be queried. Many backends do not support this and when - * unsupported errors are silently squelched and ``"latest"`` is used. - */ - blockTag?: BlockTag; - - /** - * When using ``call``, this enables CCIP-read, which permits the - * provider to be redirected to web-based content during execution, - * which is then further validated by the contract. - * - * There are potential security implications allowing CCIP-read, as - * it could be used to expose the IP address or user activity during - * the fetch to unexpected parties. - */ - enableCcipRead?: boolean; - - /** - * The blob versioned hashes (see [[link-eip-4844]]). - */ - blobVersionedHashes?: null | Array - - /** - * The maximum fee per blob gas (see [[link-eip-4844]]). - */ - maxFeePerBlobGas?: null | BigNumberish; - - /** - * Any blobs to include in the transaction (see [[link-eip-4844]]). - */ - blobs?: null | Array; - - /** - * An external library for computing the KZG commitments and - * proofs necessary for EIP-4844 transactions (see [[link-eip-4844]]). - * - * This is generally ``null``, unless you are creating BLOb - * transactions. - */ - kzg?: null | KzgLibraryLike; - - /** - * The [[link-eip-7594]] BLOb Wrapper Version used for PeerDAS. - * - * For networks that use EIP-7594, this property is required to - * serialize the sidecar correctly. - */ - blobWrapperVersion?: null | number; - - /** - * The [[link-eip-7702]] authorizations (if any). - */ - authorizationList?: null | Array; - - // Todo? - //gasMultiplier?: number; -}; - -/** - * A **PreparedTransactionRequest** is identical to a [[TransactionRequest]] - * except all the property types are strictly enforced. - */ -export interface PreparedTransactionRequest { - /** - * The transaction type. - */ - type?: number; - - - /** - * The target of the transaction. - */ - to?: AddressLike; - - /** - * The sender of the transaction. - */ - from?: AddressLike; - - /** - * The nonce of the transaction, used to prevent replay attacks. - */ - - nonce?: number; - - /** - * The maximum amount of gas to allow this transaction to consume. - */ - gasLimit?: bigint; - - /** - * The gas price to use for legacy transactions or transactions on - * legacy networks. - * - * Most of the time the ``max*FeePerGas`` is preferred. - */ - gasPrice?: bigint; - - /** - * The [[link-eip-1559]] maximum priority fee to pay per gas. - */ - maxPriorityFeePerGas?: bigint; - - /** - * The [[link-eip-1559]] maximum total fee to pay per gas. The actual - * value used is protocol enforced to be the block's base fee. - */ - maxFeePerGas?: bigint; - - /** - * The transaction data. - */ - data?: string; - - - /** - * The transaction value (in wei). - */ - value?: bigint; - - /** - * The chain ID for the network this transaction is valid on. - */ - chainId?: bigint; - - /** - * The [[link-eip-2930]] access list. Storage slots included in the access - * list are //warmed// by pre-loading them, so their initial cost to - * fetch is guaranteed, but then each additional access is cheaper. - */ - accessList?: AccessList; - - /** - * The [[link-eip-7702]] authorizations (if any). - */ - authorizationList?: Array; - - /** - * A custom object, which can be passed along for network-specific - * values. - */ - customData?: any; - - - - /** - * When using ``call`` or ``estimateGas``, this allows a specific - * block to be queried. Many backends do not support this and when - * unsupported errors are silently squelched and ``"latest"`` is used. - */ - blockTag?: BlockTag; - - /** - * When using ``call``, this enables CCIP-read, which permits the - * provider to be redirected to web-based content during execution, - * which is then further validated by the contract. - * - * There are potential security implications allowing CCIP-read, as - * it could be used to expose the IP address or user activity during - * the fetch to unexpected parties. - */ - enableCcipRead?: boolean; -} - -/** - * Returns a copy of %%req%% with all properties coerced to their strict - * types. - */ -export function copyRequest(req: TransactionRequest): PreparedTransactionRequest { - const result: any = { }; - - // These could be addresses, ENS names or Addressables - if (req.to) { result.to = req.to; } - if (req.from) { result.from = req.from; } - - if (req.data) { result.data = hexlify(req.data); } - - const bigIntKeys = "chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/); - for (const key of bigIntKeys) { - if (!(key in req) || (req)[key] == null) { continue; } - result[key] = getBigInt((req)[key], `request.${ key }`); - } - - const numberKeys = "type,nonce".split(/,/); - for (const key of numberKeys) { - if (!(key in req) || (req)[key] == null) { continue; } - result[key] = getNumber((req)[key], `request.${ key }`); - } - - if (req.accessList) { - result.accessList = accessListify(req.accessList); - } - - if (req.authorizationList) { - result.authorizationList = req.authorizationList.slice(); - } - - if ("blockTag" in req) { result.blockTag = req.blockTag; } - - if ("enableCcipRead" in req) { - result.enableCcipRead = !!req.enableCcipRead - } - - if ("customData" in req) { - result.customData = req.customData; - } - - if ("blobVersionedHashes" in req && req.blobVersionedHashes) { - result.blobVersionedHashes = req.blobVersionedHashes.slice(); - } - - if ("kzg" in req) { result.kzg = req.kzg; } - - if ("blobWrapperVersion" in req) { result.blobWrapperVersion = req.blobWrapperVersion; } - - if ("blobs" in req && req.blobs) { - result.blobs = req.blobs.map((b) => { - if (isBytesLike(b)) { return hexlify(b); } - return Object.assign({ }, b); - }); - } - - return result; -} - -////////////////////// -// Block - -/** - * An Interface to indicate a [[Block]] has been included in the - * blockchain. This asserts a Type Guard that necessary properties - * are non-null. - * - * Before a block is included, it is a //pending// block. - */ -export interface MinedBlock extends Block { - /** - * The block number also known as the block height. - */ - readonly number: number; - - /** - * The block hash. - */ - readonly hash: string; - - /** - * The block timestamp, in seconds from epoch. - */ - readonly timestamp: number; - - /** - * The block date, created from the [[timestamp]]. - */ - readonly date: Date; - - /** - * The miner of the block, also known as the ``author`` or - * block ``producer``. - */ - readonly miner: string; -} - -/** - * A **Block** represents the data associated with a full block on - * Ethereum. - */ -export class Block implements BlockParams, Iterable { - - /** - * The provider connected to the block used to fetch additional details - * if necessary. - */ - readonly provider!: Provider; - - /** - * The block number, sometimes called the block height. This is a - * sequential number that is one higher than the parent block. - */ - readonly number!: number; - - /** - * The block hash. - * - * This hash includes all properties, so can be safely used to identify - * an exact set of block properties. - */ - readonly hash!: null | string; - - /** - * The timestamp for this block, which is the number of seconds since - * epoch that this block was included. - */ - readonly timestamp!: number; - - /** - * The block hash of the parent block. - */ - readonly parentHash!: string; - - /** - * The hash tree root of the parent beacon block for the given - * execution block. See [[link-eip-4788]]. - */ - parentBeaconBlockRoot!: null | string; - - /** - * The nonce. - * - * On legacy networks, this is the random number inserted which - * permitted the difficulty target to be reached. - */ - readonly nonce!: string; - - /** - * The difficulty target. - * - * On legacy networks, this is the proof-of-work target required - * for a block to meet the protocol rules to be included. - * - * On modern networks, this is a random number arrived at using - * randao. @TODO: Find links? - */ - readonly difficulty!: bigint; - - - /** - * The total gas limit for this block. - */ - readonly gasLimit!: bigint; - - /** - * The total gas used in this block. - */ - readonly gasUsed!: bigint; - - - /** - * The root hash for the global state after applying changes - * in this block. - */ - readonly stateRoot!: null | string; - - /** - * The hash of the transaction receipts trie. - */ - readonly receiptsRoot!: null | string; - - /** - * The total amount of blob gas consumed by the transactions - * within the block. See [[link-eip-4844]]. - */ - readonly blobGasUsed!: null | bigint; - - /** - * The running total of blob gas consumed in excess of the - * target, prior to the block. See [[link-eip-4844]]. - */ - readonly excessBlobGas!: null | bigint; - - /** - * The miner coinbase address, wihch receives any subsidies for - * including this block. - */ - readonly miner!: string; - - /** - * The latest RANDAO mix of the post beacon state of - * the previous block. - */ - readonly prevRandao!: null | string; - - /** - * Any extra data the validator wished to include. - */ - readonly extraData!: string; - - /** - * The base fee per gas that all transactions in this block were - * charged. - * - * This adjusts after each block, depending on how congested the network - * is. - */ - readonly baseFeePerGas!: null | bigint; - - readonly #transactions: Array; - - /** - * Create a new **Block** object. - * - * This should generally not be necessary as the unless implementing a - * low-level library. - */ - constructor(block: BlockParams, provider: Provider) { - - this.#transactions = block.transactions.map((tx) => { - if (typeof(tx) !== "string") { - return new TransactionResponse(tx, provider); - } - return tx; - }); - - defineProperties(this, { - provider, - - hash: getValue(block.hash), - - number: block.number, - timestamp: block.timestamp, - - parentHash: block.parentHash, - parentBeaconBlockRoot: block.parentBeaconBlockRoot, - - nonce: block.nonce, - difficulty: block.difficulty, - - gasLimit: block.gasLimit, - gasUsed: block.gasUsed, - blobGasUsed: block.blobGasUsed, - excessBlobGas: block.excessBlobGas, - miner: block.miner, - prevRandao: getValue(block.prevRandao), - extraData: block.extraData, - - baseFeePerGas: getValue(block.baseFeePerGas), - - stateRoot: block.stateRoot, - receiptsRoot: block.receiptsRoot, - }); - } - - /** - * Returns the list of transaction hashes, in the order - * they were executed within the block. - */ - get transactions(): ReadonlyArray { - return this.#transactions.map((tx) => { - if (typeof(tx) === "string") { return tx; } - return tx.hash; - }); - } - - /** - * Returns the complete transactions, in the order they - * were executed within the block. - * - * This is only available for blocks which prefetched - * transactions, by passing ``true`` to %%prefetchTxs%% - * into [[Provider-getBlock]]. - */ - get prefetchedTransactions(): Array { - const txs = this.#transactions.slice(); - - // Doesn't matter... - if (txs.length === 0) { return [ ]; } - - // Make sure we prefetched the transactions - assert(typeof(txs[0]) === "object", "transactions were not prefetched with block request", "UNSUPPORTED_OPERATION", { - operation: "transactionResponses()" - }); - - return >txs; - } - - /** - * Returns a JSON-friendly value. - */ - toJSON(): any { - const { - baseFeePerGas, difficulty, extraData, gasLimit, gasUsed, hash, - miner, prevRandao, nonce, number, parentHash, parentBeaconBlockRoot, - stateRoot, receiptsRoot, timestamp, transactions - } = this; - - return { - _type: "Block", - baseFeePerGas: toJson(baseFeePerGas), - difficulty: toJson(difficulty), - extraData, - gasLimit: toJson(gasLimit), - gasUsed: toJson(gasUsed), - blobGasUsed: toJson(this.blobGasUsed), - excessBlobGas: toJson(this.excessBlobGas), - hash, miner, prevRandao, nonce, number, parentHash, timestamp, - parentBeaconBlockRoot, stateRoot, receiptsRoot, - transactions, - }; - } - - [Symbol.iterator](): Iterator { - let index = 0; - const txs = this.transactions; - return { - next: () => { - if (index < this.length) { - return { - value: txs[index++], done: false - } - } - return { value: undefined, done: true }; - } - }; - } - - /** - * The number of transactions in this block. - */ - get length(): number { return this.#transactions.length; } - - /** - * The [[link-js-date]] this block was included at. - */ - get date(): null | Date { - if (this.timestamp == null) { return null; } - return new Date(this.timestamp * 1000); - } - - /** - * Get the transaction at %%indexe%% within this block. - */ - async getTransaction(indexOrHash: number | string): Promise { - // Find the internal value by its index or hash - let tx: string | TransactionResponse | undefined = undefined; - if (typeof(indexOrHash) === "number") { - tx = this.#transactions[indexOrHash]; - - } else { - const hash = indexOrHash.toLowerCase(); - for (const v of this.#transactions) { - if (typeof(v) === "string") { - if (v !== hash) { continue; } - tx = v; - break; - } else { - if (v.hash !== hash) { continue; } - tx = v; - break; - } - } - } - if (tx == null) { throw new Error("no such tx"); } - - if (typeof(tx) === "string") { - return (await this.provider.getTransaction(tx)); - } else { - return tx; - } - } - - /** - * If a **Block** was fetched with a request to include the transactions - * this will allow synchronous access to those transactions. - * - * If the transactions were not prefetched, this will throw. - */ - getPrefetchedTransaction(indexOrHash: number | string): TransactionResponse { - const txs = this.prefetchedTransactions; - if (typeof(indexOrHash) === "number") { - return txs[indexOrHash]; - } - - indexOrHash = indexOrHash.toLowerCase(); - for (const tx of txs) { - if (tx.hash === indexOrHash) { return tx; } - } - - assertArgument(false, "no matching transaction", "indexOrHash", indexOrHash); - } - - /** - * Returns true if this block been mined. This provides a type guard - * for all properties on a [[MinedBlock]]. - */ - isMined(): this is MinedBlock { return !!this.hash; } - - /** - * Returns true if this block is an [[link-eip-2930]] block. - */ - isLondon(): this is (Block & { baseFeePerGas: bigint }) { - return !!this.baseFeePerGas; - } - - /** - * @_ignore: - */ - orphanedEvent(): OrphanFilter { - if (!this.isMined()) { throw new Error(""); } - return createOrphanedBlockFilter(this); - } -} - -////////////////////// -// Log - -/** - * A **Log** in Ethereum represents an event that has been included in a - * transaction using the ``LOG*`` opcodes, which are most commonly used by - * Solidity's emit for announcing events. - */ -export class Log implements LogParams { - - /** - * The provider connected to the log used to fetch additional details - * if necessary. - */ - readonly provider: Provider; - - /** - * The transaction hash of the transaction this log occurred in. Use the - * [[Log-getTransaction]] to get the [[TransactionResponse]]. - */ - readonly transactionHash!: string; - - /** - * The block hash of the block this log occurred in. Use the - * [[Log-getBlock]] to get the [[Block]]. - */ - readonly blockHash!: string; - - /** - * The block number of the block this log occurred in. It is preferred - * to use the [[Block-hash]] when fetching the related [[Block]], - * since in the case of an orphaned block, the block at that height may - * have changed. - */ - readonly blockNumber!: number; - - /** - * If the **Log** represents a block that was removed due to an orphaned - * block, this will be true. - * - * This can only happen within an orphan event listener. - */ - readonly removed!: boolean; - - /** - * The address of the contract that emitted this log. - */ - readonly address!: string; - - /** - * The data included in this log when it was emitted. - */ - readonly data!: string; - - /** - * The indexed topics included in this log when it was emitted. - * - * All topics are included in the bloom filters, so they can be - * efficiently filtered using the [[Provider-getLogs]] method. - */ - readonly topics!: ReadonlyArray; - - /** - * The index within the block this log occurred at. This is generally - * not useful to developers, but can be used with the various roots - * to proof inclusion within a block. - */ - readonly index!: number; - - /** - * The index within the transaction of this log. - */ - readonly transactionIndex!: number; - - /** - * @_ignore: - */ - constructor(log: LogParams, provider: Provider) { - this.provider = provider; - - const topics = Object.freeze(log.topics.slice()); - defineProperties(this, { - transactionHash: log.transactionHash, - blockHash: log.blockHash, - blockNumber: log.blockNumber, - - removed: log.removed, - - address: log.address, - data: log.data, - - topics, - - index: log.index, - transactionIndex: log.transactionIndex, - }); - } - - /** - * Returns a JSON-compatible object. - */ - toJSON(): any { - const { - address, blockHash, blockNumber, data, index, - removed, topics, transactionHash, transactionIndex - } = this; - - return { - _type: "log", - address, blockHash, blockNumber, data, index, - removed, topics, transactionHash, transactionIndex - }; - } - - /** - * Returns the block that this log occurred in. - */ - async getBlock(): Promise { - const block = await this.provider.getBlock(this.blockHash); - assert(!!block, "failed to find transaction", "UNKNOWN_ERROR", { }); - return block; - } - - /** - * Returns the transaction that this log occurred in. - */ - async getTransaction(): Promise { - const tx = await this.provider.getTransaction(this.transactionHash); - assert(!!tx, "failed to find transaction", "UNKNOWN_ERROR", { }); - return tx; - } - - /** - * Returns the transaction receipt fot the transaction that this - * log occurred in. - */ - async getTransactionReceipt(): Promise { - const receipt = await this.provider.getTransactionReceipt(this.transactionHash); - assert(!!receipt, "failed to find transaction receipt", "UNKNOWN_ERROR", { }); - return receipt; - } - - /** - * @_ignore: - */ - removedEvent(): OrphanFilter { - return createRemovedLogFilter(this); - } -} - -////////////////////// -// Transaction Receipt - -/* -export interface LegacyTransactionReceipt { - byzantium: false; - status: null; - root: string; -} - -export interface ByzantiumTransactionReceipt { - byzantium: true; - status: number; - root: null; -} -*/ - -/** - * A **TransactionReceipt** includes additional information about a - * transaction that is only available after it has been mined. - */ -export class TransactionReceipt implements TransactionReceiptParams, Iterable { - /** - * The provider connected to the log used to fetch additional details - * if necessary. - */ - readonly provider!: Provider; - - /** - * The address the transaction was sent to. - */ - readonly to!: null | string; - - /** - * The sender of the transaction. - */ - readonly from!: string; - - /** - * The address of the contract if the transaction was directly - * responsible for deploying one. - * - * This is non-null **only** if the ``to`` is empty and the ``data`` - * was successfully executed as initcode. - */ - readonly contractAddress!: null | string; - - /** - * The transaction hash. - */ - readonly hash!: string; - - /** - * The index of this transaction within the block transactions. - */ - readonly index!: number; - - /** - * The block hash of the [[Block]] this transaction was included in. - */ - readonly blockHash!: string; - - /** - * The block number of the [[Block]] this transaction was included in. - */ - readonly blockNumber!: number; - - /** - * The bloom filter bytes that represent all logs that occurred within - * this transaction. This is generally not useful for most developers, - * but can be used to validate the included logs. - */ - readonly logsBloom!: string; - - /** - * The actual amount of gas used by this transaction. - * - * When creating a transaction, the amount of gas that will be used can - * only be approximated, but the sender must pay the gas fee for the - * entire gas limit. After the transaction, the difference is refunded. - */ - readonly gasUsed!: bigint; - - /** - * The gas used for BLObs. See [[link-eip-4844]]. - */ - readonly blobGasUsed!: null | bigint; - - /** - * The amount of gas used by all transactions within the block for this - * and all transactions with a lower ``index``. - * - * This is generally not useful for developers but can be used to - * validate certain aspects of execution. - */ - readonly cumulativeGasUsed!: bigint; - - /** - * The actual gas price used during execution. - * - * Due to the complexity of [[link-eip-1559]] this value can only - * be caluclated after the transaction has been mined, snce the base - * fee is protocol-enforced. - */ - readonly gasPrice!: bigint; - - /** - * The price paid per BLOB in gas. See [[link-eip-4844]]. - */ - readonly blobGasPrice!: null | bigint; - - /** - * The [[link-eip-2718]] transaction type. - */ - readonly type!: number; - //readonly byzantium!: boolean; - - /** - * The status of this transaction, indicating success (i.e. ``1``) or - * a revert (i.e. ``0``). - * - * This is available in post-byzantium blocks, but some backends may - * backfill this value. - */ - readonly status!: null | number; - - /** - * The root hash of this transaction. - * - * This is no present and was only included in pre-byzantium blocks, but - * could be used to validate certain parts of the receipt. - */ - readonly root!: null | string; - - readonly #logs: ReadonlyArray; - - /** - * @_ignore: - */ - constructor(tx: TransactionReceiptParams, provider: Provider) { - this.#logs = Object.freeze(tx.logs.map((log) => { - return new Log(log, provider); - })); - - let gasPrice = BN_0; - if (tx.effectiveGasPrice != null) { - gasPrice = tx.effectiveGasPrice; - } else if (tx.gasPrice != null) { - gasPrice = tx.gasPrice; - } - - defineProperties(this, { - provider, - - to: tx.to, - from: tx.from, - contractAddress: tx.contractAddress, - - hash: tx.hash, - index: tx.index, - - blockHash: tx.blockHash, - blockNumber: tx.blockNumber, - - logsBloom: tx.logsBloom, - - gasUsed: tx.gasUsed, - cumulativeGasUsed: tx.cumulativeGasUsed, - blobGasUsed: tx.blobGasUsed, - gasPrice, - blobGasPrice: tx.blobGasPrice, - - type: tx.type, - //byzantium: tx.byzantium, - status: tx.status, - root: tx.root - }); - } - - /** - * The logs for this transaction. - */ - get logs(): ReadonlyArray { return this.#logs; } - - /** - * Returns a JSON-compatible representation. - */ - toJSON(): any { - const { - to, from, contractAddress, hash, index, - blockHash, blockNumber, logsBloom, - logs, //byzantium, - status, root - } = this; - - return { - _type: "TransactionReceipt", - blockHash, blockNumber, - //byzantium, - contractAddress, - cumulativeGasUsed: toJson(this.cumulativeGasUsed), - from, - gasPrice: toJson(this.gasPrice), - blobGasUsed: toJson(this.blobGasUsed), - blobGasPrice: toJson(this.blobGasPrice), - gasUsed: toJson(this.gasUsed), - hash, index, logs, logsBloom, root, status, to - }; - } - - /** - * @_ignore: - */ - get length(): number { return this.logs.length; } - - [Symbol.iterator](): Iterator { - let index = 0; - return { - next: () => { - if (index < this.length) { - return { value: this.logs[index++], done: false } - } - return { value: undefined, done: true }; - } - }; - } - - /** - * The total fee for this transaction, in wei. - */ - get fee(): bigint { - return this.gasUsed * this.gasPrice; - } - - /** - * Resolves to the block this transaction occurred in. - */ - async getBlock(): Promise { - const block = await this.provider.getBlock(this.blockHash); - if (block == null) { throw new Error("TODO"); } - return block; - } - - /** - * Resolves to the transaction this transaction occurred in. - */ - async getTransaction(): Promise { - const tx = await this.provider.getTransaction(this.hash); - if (tx == null) { throw new Error("TODO"); } - return tx; - } - - /** - * Resolves to the return value of the execution of this transaction. - * - * Support for this feature is limited, as it requires an archive node - * with the ``debug_`` or ``trace_`` API enabled. - */ - async getResult(): Promise { - return (await this.provider.getTransactionResult(this.hash)); - } - - /** - * Resolves to the number of confirmations this transaction has. - */ - async confirmations(): Promise { - return (await this.provider.getBlockNumber()) - this.blockNumber + 1; - } - - /** - * @_ignore: - */ - removedEvent(): OrphanFilter { - return createRemovedTransactionFilter(this); - } - - /** - * @_ignore: - */ - reorderedEvent(other?: TransactionResponse): OrphanFilter { - assert(!other || other.isMined(), "unmined 'other' transction cannot be orphaned", - "UNSUPPORTED_OPERATION", { operation: "reorderedEvent(other)" }); - return createReorderedTransactionFilter(this, other); - } -} - - -////////////////////// -// Transaction Response - -/** - * A **MinedTransactionResponse** is an interface representing a - * transaction which has been mined and allows for a type guard for its - * property values being defined. - */ -export interface MinedTransactionResponse extends TransactionResponse { - /** - * The block number this transaction occurred in. - */ - blockNumber: number; - - /** - * The block hash this transaction occurred in. - */ - blockHash: string; - - /** - * The date this transaction occurred on. - */ - date: Date; -} - - -/** - * A **TransactionResponse** includes all properties about a transaction - * that was sent to the network, which may or may not be included in a - * block. - * - * The [[TransactionResponse-isMined]] can be used to check if the - * transaction has been mined as well as type guard that the otherwise - * possibly ``null`` properties are defined. - */ -export class TransactionResponse implements TransactionLike, TransactionResponseParams { - /** - * The provider this is connected to, which will influence how its - * methods will resolve its async inspection methods. - */ - readonly provider: Provider; - - /** - * The block number of the block that this transaction was included in. - * - * This is ``null`` for pending transactions. - */ - readonly blockNumber: null | number; - - /** - * The blockHash of the block that this transaction was included in. - * - * This is ``null`` for pending transactions. - */ - readonly blockHash: null | string; - - /** - * The index within the block that this transaction resides at. - */ - readonly index!: number; - - /** - * The transaction hash. - */ - readonly hash!: string; - - /** - * The [[link-eip-2718]] transaction envelope type. This is - * ``0`` for legacy transactions types. - */ - readonly type!: number; - - /** - * The receiver of this transaction. - * - * If ``null``, then the transaction is an initcode transaction. - * This means the result of executing the [[data]] will be deployed - * as a new contract on chain (assuming it does not revert) and the - * address may be computed using [[getCreateAddress]]. - */ - readonly to!: null | string; - - /** - * The sender of this transaction. It is implicitly computed - * from the transaction pre-image hash (as the digest) and the - * [[signature]] using ecrecover. - */ - readonly from!: string; - - /** - * The nonce, which is used to prevent replay attacks and offer - * a method to ensure transactions from a given sender are explicitly - * ordered. - * - * When sending a transaction, this must be equal to the number of - * transactions ever sent by [[from]]. - */ - readonly nonce!: number; - - /** - * The maximum units of gas this transaction can consume. If execution - * exceeds this, the entries transaction is reverted and the sender - * is charged for the full amount, despite not state changes being made. - */ - readonly gasLimit!: bigint; - - /** - * The gas price can have various values, depending on the network. - * - * In modern networks, for transactions that are included this is - * the //effective gas price// (the fee per gas that was actually - * charged), while for transactions that have not been included yet - * is the [[maxFeePerGas]]. - * - * For legacy transactions, or transactions on legacy networks, this - * is the fee that will be charged per unit of gas the transaction - * consumes. - */ - readonly gasPrice!: bigint; - - /** - * The maximum priority fee (per unit of gas) to allow a - * validator to charge the sender. This is inclusive of the - * [[maxFeeFeePerGas]]. - */ - readonly maxPriorityFeePerGas!: null | bigint; - - /** - * The maximum fee (per unit of gas) to allow this transaction - * to charge the sender. - */ - readonly maxFeePerGas!: null | bigint; - - /** - * The [[link-eip-4844]] max fee per BLOb gas. - */ - readonly maxFeePerBlobGas!: null | bigint; - - /** - * The data. - */ - readonly data!: string; - - /** - * The value, in wei. Use [[formatEther]] to format this value - * as ether. - */ - readonly value!: bigint; - - /** - * The chain ID. - */ - readonly chainId!: bigint; - - /** - * The signature. - */ - readonly signature!: Signature; - - /** - * The [[link-eip-2930]] access list for transaction types that - * support it, otherwise ``null``. - */ - readonly accessList!: null | AccessList; - - /** - * The [[link-eip-4844]] BLOb versioned hashes. - */ - readonly blobVersionedHashes!: null | Array; - - /** - * The [[link-eip-7702]] authorizations (if any). - */ - readonly authorizationList!: null | Array; - - #startBlock: number; - - /** - * @_ignore: - */ - constructor(tx: TransactionResponseParams, provider: Provider) { - this.provider = provider; - - this.blockNumber = (tx.blockNumber != null) ? tx.blockNumber: null; - this.blockHash = (tx.blockHash != null) ? tx.blockHash: null; - - this.hash = tx.hash; - this.index = tx.index; - - this.type = tx.type; - - this.from = tx.from; - this.to = tx.to || null; - - this.gasLimit = tx.gasLimit; - this.nonce = tx.nonce; - this.data = tx.data; - this.value = tx.value; - - this.gasPrice = tx.gasPrice; - this.maxPriorityFeePerGas = (tx.maxPriorityFeePerGas != null) ? tx.maxPriorityFeePerGas: null; - this.maxFeePerGas = (tx.maxFeePerGas != null) ? tx.maxFeePerGas: null; - this.maxFeePerBlobGas = (tx.maxFeePerBlobGas != null) ? tx.maxFeePerBlobGas: null; - - this.chainId = tx.chainId; - this.signature = tx.signature; - - this.accessList = (tx.accessList != null) ? tx.accessList: null; - this.blobVersionedHashes = (tx.blobVersionedHashes != null) ? tx.blobVersionedHashes: null; - - this.authorizationList = (tx.authorizationList != null) ? tx.authorizationList: null; - - this.#startBlock = -1; - } - - /** - * Returns a JSON-compatible representation of this transaction. - */ - toJSON(): any { - const { - blockNumber, blockHash, index, hash, type, to, from, nonce, - data, signature, accessList, blobVersionedHashes - } = this; - - return { - _type: "TransactionResponse", - accessList, blockNumber, blockHash, - blobVersionedHashes, - chainId: toJson(this.chainId), - data, from, - gasLimit: toJson(this.gasLimit), - gasPrice: toJson(this.gasPrice), - hash, - maxFeePerGas: toJson(this.maxFeePerGas), - maxPriorityFeePerGas: toJson(this.maxPriorityFeePerGas), - maxFeePerBlobGas: toJson(this.maxFeePerBlobGas), - nonce, signature, to, index, type, - value: toJson(this.value), - }; - } - - /** - * Resolves to the Block that this transaction was included in. - * - * This will return null if the transaction has not been included yet. - */ - async getBlock(): Promise { - let blockNumber = this.blockNumber; - if (blockNumber == null) { - const tx = await this.getTransaction(); - if (tx) { blockNumber = tx.blockNumber; } - } - if (blockNumber == null) { return null; } - const block = this.provider.getBlock(blockNumber); - if (block == null) { throw new Error("TODO"); } - return block; - } - - /** - * Resolves to this transaction being re-requested from the - * provider. This can be used if you have an unmined transaction - * and wish to get an up-to-date populated instance. - */ - async getTransaction(): Promise { - return this.provider.getTransaction(this.hash); - } - - /** - * Resolve to the number of confirmations this transaction has. - */ - async confirmations(): Promise { - if (this.blockNumber == null) { - const { tx, blockNumber } = await resolveProperties({ - tx: this.getTransaction(), - blockNumber: this.provider.getBlockNumber() - }); - - // Not mined yet... - if (tx == null || tx.blockNumber == null) { return 0; } - - return blockNumber - tx.blockNumber + 1; - } - - const blockNumber = await this.provider.getBlockNumber(); - return blockNumber - this.blockNumber + 1; - } - - /** - * Resolves once this transaction has been mined and has - * %%confirms%% blocks including it (default: ``1``) with an - * optional %%timeout%%. - * - * This can resolve to ``null`` only if %%confirms%% is ``0`` - * and the transaction has not been mined, otherwise this will - * wait until enough confirmations have completed. - */ - async wait(_confirms?: number, _timeout?: number): Promise { - const confirms = (_confirms == null) ? 1: _confirms; - const timeout = (_timeout == null) ? 0: _timeout; - - let startBlock = this.#startBlock - let nextScan = -1; - let stopScanning = (startBlock === -1) ? true: false; - const checkReplacement = async () => { - // Get the current transaction count for this sender - if (stopScanning) { return null; } - const { blockNumber, nonce } = await resolveProperties({ - blockNumber: this.provider.getBlockNumber(), - nonce: this.provider.getTransactionCount(this.from) - }); - - // No transaction or our nonce has not been mined yet; but we - // can start scanning later when we do start - if (nonce < this.nonce) { - startBlock = blockNumber; - return; - } - - // We were mined; no replacement - if (stopScanning) { return null; } - const mined = await this.getTransaction(); - if (mined && mined.blockNumber != null) { return; } - - // We were replaced; start scanning for that transaction - - // Starting to scan; look back a few extra blocks for safety - if (nextScan === -1) { - nextScan = startBlock - 3; - if (nextScan < this.#startBlock) { nextScan = this.#startBlock; } - } - - while (nextScan <= blockNumber) { - // Get the next block to scan - if (stopScanning) { return null; } - const block = await this.provider.getBlock(nextScan, true); - - // This should not happen; but we'll try again shortly - if (block == null) { return; } - - // We were mined; no replacement - for (const hash of block) { - if (hash === this.hash) { return; } - } - - // Search for the transaction that replaced us - for (let i = 0; i < block.length; i++) { - const tx: TransactionResponse = await block.getTransaction(i); - - if (tx.from === this.from && tx.nonce === this.nonce) { - // Get the receipt - if (stopScanning) { return null; } - const receipt = await this.provider.getTransactionReceipt(tx.hash); - - // This should not happen; but we'll try again shortly - if (receipt == null) { return; } - - // We will retry this on the next block (this case could be optimized) - if ((blockNumber - receipt.blockNumber + 1) < confirms) { return; } - - // The reason we were replaced - let reason: "replaced" | "repriced" | "cancelled" = "replaced"; - if (tx.data === this.data && tx.to === this.to && tx.value === this.value) { - reason = "repriced"; - } else if (tx.data === "0x" && tx.from === tx.to && tx.value === BN_0) { - reason = "cancelled" - } - - assert(false, "transaction was replaced", "TRANSACTION_REPLACED", { - cancelled: (reason === "replaced" || reason === "cancelled"), - reason, - replacement: tx.replaceableTransaction(startBlock), - hash: tx.hash, - receipt - }); - } - } - - nextScan++; - } - return; - }; - - const checkReceipt = (receipt: null | TransactionReceipt) => { - if (receipt == null || receipt.status !== 0) { return receipt; } - assert(false, "transaction execution reverted", "CALL_EXCEPTION", { - action: "sendTransaction", - data: null, reason: null, invocation: null, revert: null, - transaction: { - to: receipt.to, - from: receipt.from, - data: "" // @TODO: in v7, split out sendTransaction properties - }, receipt - }); - }; - - const receipt = await this.provider.getTransactionReceipt(this.hash); - - if (confirms === 0) { return checkReceipt(receipt); } - - if (receipt) { - if (confirms === 1 || (await receipt.confirmations()) >= confirms) { - return checkReceipt(receipt); - } - - } else { - // Check for a replacement; throws if a replacement was found - await checkReplacement(); - - // Allow null only when the confirms is 0 - if (confirms === 0) { return null; } - } - - const waiter = new Promise((resolve, reject) => { - // List of things to cancel when we have a result (one way or the other) - const cancellers: Array<() => void> = [ ]; - const cancel = () => { cancellers.forEach((c) => c()); }; - - // On cancel, stop scanning for replacements - cancellers.push(() => { stopScanning = true; }); - - // Set up any timeout requested - if (timeout > 0) { - const timer = setTimeout(() => { - cancel(); - reject(makeError("wait for transaction timeout", "TIMEOUT")); - }, timeout); - cancellers.push(() => { clearTimeout(timer); }); - } - - const txListener = async (receipt: TransactionReceipt) => { - // Done; return it! - if ((await receipt.confirmations()) >= confirms) { - cancel(); - try { - resolve(checkReceipt(receipt)); - } catch (error) { reject(error); } - } - }; - cancellers.push(() => { this.provider.off(this.hash, txListener); }); - this.provider.on(this.hash, txListener); - // We support replacement detection; start checking - if (startBlock >= 0) { - const replaceListener = async () => { - try { - // Check for a replacement; this throws only if one is found - await checkReplacement(); - - } catch (error) { - // We were replaced (with enough confirms); re-throw the error - if (isError(error, "TRANSACTION_REPLACED")) { - cancel(); - reject(error); - return; - } - } - - // Rescheudle a check on the next block - if (!stopScanning) { - this.provider.once("block", replaceListener); - } - }; - cancellers.push(() => { this.provider.off("block", replaceListener); }); - this.provider.once("block", replaceListener); - } - }); - - return await >waiter; - } - - /** - * Returns ``true`` if this transaction has been included. - * - * This is effective only as of the time the TransactionResponse - * was instantiated. To get up-to-date information, use - * [[getTransaction]]. - * - * This provides a Type Guard that this transaction will have - * non-null property values for properties that are null for - * unmined transactions. - */ - isMined(): this is MinedTransactionResponse { - return (this.blockHash != null); - } - - /** - * Returns true if the transaction is a legacy (i.e. ``type == 0``) - * transaction. - * - * This provides a Type Guard that this transaction will have - * the ``null``-ness for hardfork-specific properties set correctly. - */ - isLegacy(): this is (TransactionResponse & { accessList: null, maxFeePerGas: null, maxPriorityFeePerGas: null }) { - return (this.type === 0) - } - - /** - * Returns true if the transaction is a Berlin (i.e. ``type == 1``) - * transaction. See [[link-eip-2070]]. - * - * This provides a Type Guard that this transaction will have - * the ``null``-ness for hardfork-specific properties set correctly. - */ - isBerlin(): this is (TransactionResponse & { accessList: AccessList, maxFeePerGas: null, maxPriorityFeePerGas: null }) { - return (this.type === 1); - } - - /** - * Returns true if the transaction is a London (i.e. ``type == 2``) - * transaction. See [[link-eip-1559]]. - * - * This provides a Type Guard that this transaction will have - * the ``null``-ness for hardfork-specific properties set correctly. - */ - isLondon(): this is (TransactionResponse & { accessList: AccessList, maxFeePerGas: bigint, maxPriorityFeePerGas: bigint }){ - return (this.type === 2); - } - - /** - * Returns true if hte transaction is a Cancun (i.e. ``type == 3``) - * transaction. See [[link-eip-4844]]. - */ - isCancun(): this is (TransactionResponse & { accessList: AccessList, maxFeePerGas: bigint, maxPriorityFeePerGas: bigint, maxFeePerBlobGas: bigint, blobVersionedHashes: Array }){ - return (this.type === 3); - } - - /** - * Returns a filter which can be used to listen for orphan events - * that evict this transaction. - */ - removedEvent(): OrphanFilter { - assert(this.isMined(), "unmined transaction canot be orphaned", - "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); - return createRemovedTransactionFilter(this); - } - - /** - * Returns a filter which can be used to listen for orphan events - * that re-order this event against %%other%%. - */ - reorderedEvent(other?: TransactionResponse): OrphanFilter { - assert(this.isMined(), "unmined transaction canot be orphaned", - "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); - - assert(!other || other.isMined(), "unmined 'other' transaction canot be orphaned", - "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); - - return createReorderedTransactionFilter(this, other); - } - - /** - * Returns a new TransactionResponse instance which has the ability to - * detect (and throw an error) if the transaction is replaced, which - * will begin scanning at %%startBlock%%. - * - * This should generally not be used by developers and is intended - * primarily for internal use. Setting an incorrect %%startBlock%% can - * have devastating performance consequences if used incorrectly. - */ - replaceableTransaction(startBlock: number): TransactionResponse { - assertArgument(Number.isInteger(startBlock) && startBlock >= 0, "invalid startBlock", "startBlock", startBlock); - const tx = new TransactionResponse(this, this.provider); - tx.#startBlock = startBlock; - return tx; - } -} - - -////////////////////// -// OrphanFilter - -/** - * An Orphan Filter allows detecting when an orphan block has - * resulted in dropping a block or transaction or has resulted - * in transactions changing order. - * - * Not currently fully supported. - */ -export type OrphanFilter = { - orphan: "drop-block", - hash: string, - number: number -} | { - orphan: "drop-transaction", - tx: { hash: string, blockHash: string, blockNumber: number }, - other?: { hash: string, blockHash: string, blockNumber: number } -} | { - orphan: "reorder-transaction", - tx: { hash: string, blockHash: string, blockNumber: number }, - other?: { hash: string, blockHash: string, blockNumber: number } -} | { - orphan: "drop-log", - log: { - transactionHash: string, - blockHash: string, - blockNumber: number, - address: string, - data: string, - topics: ReadonlyArray, - index: number - } -}; - -function createOrphanedBlockFilter(block: { hash: string, number: number }): OrphanFilter { - return { orphan: "drop-block", hash: block.hash, number: block.number }; -} - -function createReorderedTransactionFilter(tx: { hash: string, blockHash: string, blockNumber: number }, other?: { hash: string, blockHash: string, blockNumber: number }): OrphanFilter { - return { orphan: "reorder-transaction", tx, other }; -} - -function createRemovedTransactionFilter(tx: { hash: string, blockHash: string, blockNumber: number }): OrphanFilter { - return { orphan: "drop-transaction", tx }; -} - -function createRemovedLogFilter(log: { blockHash: string, transactionHash: string, blockNumber: number, address: string, data: string, topics: ReadonlyArray, index: number }): OrphanFilter { - return { orphan: "drop-log", log: { - transactionHash: log.transactionHash, - blockHash: log.blockHash, - blockNumber: log.blockNumber, - address: log.address, - data: log.data, - topics: Object.freeze(log.topics.slice()), - index: log.index - } }; -} - -////////////////////// -// EventFilter - -/** - * A **TopicFilter** provides a struture to define bloom-filter - * queries. - * - * Each field that is ``null`` matches **any** value, a field that is - * a ``string`` must match exactly that value and ``array`` is - * effectively an ``OR``-ed set, where any one of those values must - * match. - */ -export type TopicFilter = Array>; - -// @TODO: -//export type DeferableTopicFilter = Array | Array>>; - -/** - * An **EventFilter** allows efficiently filtering logs (also known as - * events) using bloom filters included within blocks. - */ -export interface EventFilter { - address?: AddressLike | Array; - topics?: TopicFilter; -} - -/** - * A **Filter** allows searching a specific range of blocks for mathcing - * logs. - */ -export interface Filter extends EventFilter { - - /** - * The start block for the filter (inclusive). - */ - fromBlock?: BlockTag; - - /** - * The end block for the filter (inclusive). - */ - toBlock?: BlockTag; -} - -/** - * A **FilterByBlockHash** allows searching a specific block for mathcing - * logs. - */ -export interface FilterByBlockHash extends EventFilter { - /** - * The blockhash of the specific block for the filter. - */ - blockHash?: string; -} - - -////////////////////// -// ProviderEvent - -/** - * A **ProviderEvent** provides the types of events that can be subscribed - * to on a [[Provider]]. - * - * Each provider may include additional possible events it supports, but - * the most commonly supported are: - * - * **``"block"``** - calls the listener with the current block number on each - * new block. - * - * **``"error"``** - calls the listener on each async error that occurs during - * the event loop, with the error. - * - * **``"debug"``** - calls the listener on debug events, which can be used to - * troubleshoot network errors, provider problems, etc. - * - * **``transaction hash``** - calls the listener on each block after the - * transaction has been mined; generally ``.once`` is more appropriate for - * this event. - * - * **``Array``** - calls the listener on each log that matches the filter. - * - * [[EventFilter]] - calls the listener with each matching log - */ -export type ProviderEvent = string | Array> | EventFilter | OrphanFilter; - - -////////////////////// -// Provider - -/** - * A **Provider** is the primary method to interact with the read-only - * content on Ethereum. - * - * It allows access to details about accounts, blocks and transactions - * and the ability to query event logs and simulate contract execution. - * - * Account data includes the [balance](getBalance), - * [transaction count](getTransactionCount), [code](getCode) and - * [state trie storage](getStorage). - * - * Simulating execution can be used to [call](call), - * [estimate gas](estimateGas) and - * [get transaction results](getTransactionResult). - * - * The [[broadcastTransaction]] is the only method which allows updating - * the blockchain, but it is usually accessed by a [[Signer]], since a - * private key must be used to sign the transaction before it can be - * broadcast. - */ -export interface Provider extends ContractRunner, EventEmitterable, NameResolver { - - /** - * The provider iteself. - * - * This is part of the necessary API for executing a contract, as - * it provides a common property on any [[ContractRunner]] that - * can be used to access the read-only portion of the runner. - */ - provider: this; - - /** - * Shutdown any resources this provider is using. No additional - * calls should be made to this provider after calling this. - */ - destroy(): void; - - //////////////////// - // State - - /** - * Get the current block number. - */ - getBlockNumber(): Promise; - - /** - * Get the connected [[Network]]. - */ - getNetwork(): Promise; - - /** - * Get the best guess at the recommended [[FeeData]]. - */ - getFeeData(): Promise; - - - //////////////////// - // Account - - /** - * Get the account balance (in wei) of %%address%%. If %%blockTag%% - * is specified and the node supports archive access for that - * %%blockTag%%, the balance is as of that [[BlockTag]]. - * - * @note On nodes without archive access enabled, the %%blockTag%% may be - * **silently ignored** by the node, which may cause issues if relied on. - */ - getBalance(address: AddressLike, blockTag?: BlockTag): Promise; - - /** - * Get the number of transactions ever sent for %%address%%, which - * is used as the ``nonce`` when sending a transaction. If - * %%blockTag%% is specified and the node supports archive access - * for that %%blockTag%%, the transaction count is as of that - * [[BlockTag]]. - * - * @note On nodes without archive access enabled, the %%blockTag%% may be - * **silently ignored** by the node, which may cause issues if relied on. - */ - getTransactionCount(address: AddressLike, blockTag?: BlockTag): Promise; - - /** - * Get the bytecode for %%address%%. - * - * @note On nodes without archive access enabled, the %%blockTag%% may be - * **silently ignored** by the node, which may cause issues if relied on. - */ - getCode(address: AddressLike, blockTag?: BlockTag): Promise - - /** - * Get the storage slot value for %%address%% at slot %%position%%. - * - * @note On nodes without archive access enabled, the %%blockTag%% may be - * **silently ignored** by the node, which may cause issues if relied on. - */ - getStorage(address: AddressLike, position: BigNumberish, blockTag?: BlockTag): Promise - - - //////////////////// - // Execution - - /** - * Estimates the amount of gas required to execute %%tx%%. - */ - estimateGas(tx: TransactionRequest): Promise; - - /** - * Simulate the execution of %%tx%%. If the call reverts, it will - * throw a [[CallExceptionError]] which includes the revert data. - */ - call(tx: TransactionRequest): Promise - - /** - * Broadcasts the %%signedTx%% to the network, adding it to the - * memory pool of any node for which the transaction meets the - * rebroadcast requirements. - */ - broadcastTransaction(signedTx: string): Promise; - - - //////////////////// - // Queries - - /** - * Resolves to the block for %%blockHashOrBlockTag%%. - * - * If %%prefetchTxs%%, and the backend supports including transactions - * with block requests, all transactions will be included and the - * [[Block]] object will not need to make remote calls for getting - * transactions. - */ - getBlock(blockHashOrBlockTag: BlockTag | string, prefetchTxs?: boolean): Promise; - - /** - * Resolves to the transaction for %%hash%%. - * - * If the transaction is unknown or on pruning nodes which - * discard old transactions this resolves to ``null``. - */ - getTransaction(hash: string): Promise; - - /** - * Resolves to the transaction receipt for %%hash%%, if mined. - * - * If the transaction has not been mined, is unknown or on - * pruning nodes which discard old transactions this resolves to - * ``null``. - */ - getTransactionReceipt(hash: string): Promise; - - /** - * Resolves to the result returned by the executions of %%hash%%. - * - * This is only supported on nodes with archive access and with - * the necessary debug APIs enabled. - */ - getTransactionResult(hash: string): Promise; - - - //////////////////// - // Bloom-filter Queries - - /** - * Resolves to the list of Logs that match %%filter%% - */ - getLogs(filter: Filter | FilterByBlockHash): Promise>; - - - //////////////////// - // ENS - - /** - * Resolves to the address configured for the %%ensName%% or - * ``null`` if unconfigured. - */ - resolveName(ensName: string): Promise; - - /** - * Resolves to the ENS name associated for the %%address%% or - * ``null`` if the //primary name// is not configured. - * - * Users must perform additional steps to configure a //primary name//, - * which is not currently common. - */ - lookupAddress(address: string): Promise; - - /** - * Waits until the transaction %%hash%% is mined and has %%confirms%% - * confirmations. - */ - waitForTransaction(hash: string, confirms?: number, timeout?: number): Promise; - - /** - * Resolves to the block at %%blockTag%% once it has been mined. - * - * This can be useful for waiting some number of blocks by using - * the ``currentBlockNumber + N``. - */ - waitForBlock(blockTag?: BlockTag): Promise; -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/signer-noncemanager.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/signer-noncemanager.ts deleted file mode 100644 index 724bfe89..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/signer-noncemanager.ts +++ /dev/null @@ -1,98 +0,0 @@ -import { defineProperties } from "../utils/index.js"; -import { AbstractSigner } from "./abstract-signer.js"; - -import type { TypedDataDomain, TypedDataField } from "../hash/index.js"; - -import type { - BlockTag, Provider, TransactionRequest, TransactionResponse -} from "./provider.js"; -import type { Signer } from "./signer.js"; - - -/** - * A **NonceManager** wraps another [[Signer]] and automatically manages - * the nonce, ensuring serialized and sequential nonces are used during - * transaction. - */ -export class NonceManager extends AbstractSigner { - /** - * The Signer being managed. - */ - signer!: Signer; - - #noncePromise: null | Promise; - #delta: number; - - /** - * Creates a new **NonceManager** to manage %%signer%%. - */ - constructor(signer: Signer) { - super(signer.provider); - defineProperties(this, { signer }); - - this.#noncePromise = null; - this.#delta = 0; - } - - async getAddress(): Promise { - return this.signer.getAddress(); - } - - connect(provider: null | Provider): NonceManager { - return new NonceManager(this.signer.connect(provider)); - } - - async getNonce(blockTag?: BlockTag): Promise { - if (blockTag === "pending") { - if (this.#noncePromise == null) { - this.#noncePromise = super.getNonce("pending"); - } - - const delta = this.#delta; - return (await this.#noncePromise) + delta; - } - - return super.getNonce(blockTag); - } - - /** - * Manually increment the nonce. This may be useful when managng - * offline transactions. - */ - increment(): void { - this.#delta++; - } - - /** - * Resets the nonce, causing the **NonceManager** to reload the current - * nonce from the blockchain on the next transaction. - */ - reset(): void { - this.#delta = 0; - this.#noncePromise = null; - } - - async sendTransaction(tx: TransactionRequest): Promise { - const noncePromise = this.getNonce("pending"); - this.increment(); - - tx = await this.signer.populateTransaction(tx); - tx.nonce = await noncePromise; - - // @TODO: Maybe handle interesting/recoverable errors? - // Like don't increment if the tx was certainly not sent - return await this.signer.sendTransaction(tx); - } - - signTransaction(tx: TransactionRequest): Promise { - return this.signer.signTransaction(tx); - } - - signMessage(message: string | Uint8Array): Promise { - return this.signer.signMessage(message); - } - - signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise { - return this.signer.signTypedData(domain, types, value); - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/signer.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/signer.ts deleted file mode 100644 index a3c3d6ba..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/signer.ts +++ /dev/null @@ -1,166 +0,0 @@ - -import type { Addressable, NameResolver } from "../address/index.js"; -import type { - AuthorizationRequest, TypedDataDomain, TypedDataField -} from "../hash/index.js"; -import type { Authorization, TransactionLike } from "../transaction/index.js"; - -import type { ContractRunner } from "./contracts.js"; -import type { BlockTag, Provider, TransactionRequest, TransactionResponse } from "./provider.js"; - -/** - * A Signer represents an account on the Ethereum Blockchain, and is most often - * backed by a private key represented by a mnemonic or residing on a Hardware Wallet. - * - * The API remains abstract though, so that it can deal with more advanced exotic - * Signing entities, such as Smart Contract Wallets or Virtual Wallets (where the - * private key may not be known). - */ -export interface Signer extends Addressable, ContractRunner, NameResolver { - - /** - * The [[Provider]] attached to this Signer (if any). - */ - provider: null | Provider; - - /** - * Returns a new instance of this Signer connected to //provider// or detached - * from any Provider if null. - */ - connect(provider: null | Provider): Signer; - - - //////////////////// - // State - - /** - * Get the address of the Signer. - */ - getAddress(): Promise; - - /** - * Gets the next nonce required for this Signer to send a transaction. - * - * @param blockTag - The blocktag to base the transaction count on, keep in mind - * many nodes do not honour this value and silently ignore it [default: ``"latest"``] - */ - getNonce(blockTag?: BlockTag): Promise; - - - //////////////////// - // Preparation - - /** - * Prepares a {@link TransactionRequest} for calling: - * - resolves ``to`` and ``from`` addresses - * - if ``from`` is specified , check that it matches this Signer - * - * @param tx - The call to prepare - */ - populateCall(tx: TransactionRequest): Promise>; - - /** - * Prepares a {@link TransactionRequest} for sending to the network by - * populating any missing properties: - * - resolves ``to`` and ``from`` addresses - * - if ``from`` is specified , check that it matches this Signer - * - populates ``nonce`` via ``signer.getNonce("pending")`` - * - populates ``gasLimit`` via ``signer.estimateGas(tx)`` - * - populates ``chainId`` via ``signer.provider.getNetwork()`` - * - populates ``type`` and relevant fee data for that type (``gasPrice`` - * for legacy transactions, ``maxFeePerGas`` for EIP-1559, etc) - * - * @note Some Signer implementations may skip populating properties that - * are populated downstream; for example JsonRpcSigner defers to the - * node to populate the nonce and fee data. - * - * @param tx - The call to prepare - */ - populateTransaction(tx: TransactionRequest): Promise>; - - - //////////////////// - // Execution - - /** - * Estimates the required gas required to execute //tx// on the Blockchain. This - * will be the expected amount a transaction will require as its ``gasLimit`` - * to successfully run all the necessary computations and store the needed state - * that the transaction intends. - * - * Keep in mind that this is **best efforts**, since the state of the Blockchain - * is in flux, which could affect transaction gas requirements. - * - * @throws UNPREDICTABLE_GAS_LIMIT A transaction that is believed by the node to likely - * fail will throw an error during gas estimation. This could indicate that it - * will actually fail or that the circumstances are simply too complex for the - * node to take into account. In these cases, a manually determined ``gasLimit`` - * will need to be made. - */ - estimateGas(tx: TransactionRequest): Promise; - - /** - * Evaluates the //tx// by running it against the current Blockchain state. This - * cannot change state and has no cost in ether, as it is effectively simulating - * execution. - * - * This can be used to have the Blockchain perform computations based on its state - * (e.g. running a Contract's getters) or to simulate the effect of a transaction - * before actually performing an operation. - */ - call(tx: TransactionRequest): Promise; - - /** - * Resolves an ENS Name to an address. - */ - resolveName(name: string): Promise; - - - //////////////////// - // Signing - - /** - * Signs %%tx%%, returning the fully signed transaction. This does not - * populate any additional properties within the transaction. - */ - signTransaction(tx: TransactionRequest): Promise; - - /** - * Sends %%tx%% to the Network. The ``signer.populateTransaction(tx)`` - * is called first to ensure all necessary properties for the - * transaction to be valid have been popualted first. - */ - sendTransaction(tx: TransactionRequest): Promise; - - /** - * Signs an [[link-eip-191]] prefixed personal message. - * - * If the %%message%% is a string, it is signed as UTF-8 encoded bytes. It is **not** - * interpretted as a [[BytesLike]]; so the string ``"0x1234"`` is signed as six - * characters, **not** two bytes. - * - * To sign that example as two bytes, the Uint8Array should be used - * (i.e. ``new Uint8Array([ 0x12, 0x34 ])``). - */ - signMessage(message: string | Uint8Array): Promise; - - /** - * Signs the [[link-eip-712]] typed data. - */ - signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise; - - /** - * Prepares an [[AuthorizationRequest]] for authorization by - * populating any missing properties: - * - resolves ``address`` (if an Addressable or ENS name) - * - populates ``nonce`` via ``signer.getNonce("pending")`` - * - populates ``chainId`` via ``signer.provider.getNetwork()`` - */ - populateAuthorization(auth: AuthorizationRequest): Promise; - - /** - * Signs an %%authorization%% to be used in [[link-eip-7702]] - * transactions. - */ - authorize(authorization: AuthorizationRequest): Promise; -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/subscriber-connection.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/subscriber-connection.ts deleted file mode 100644 index 2e9f73b3..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/subscriber-connection.ts +++ /dev/null @@ -1,74 +0,0 @@ - -import { getNumber } from "../utils/index.js"; - -import type { Subscriber } from "./abstract-provider.js"; - - -//#TODO: Temp -import type { Provider } from "./provider.js"; - -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export interface ConnectionRpcProvider extends Provider { - //send(method: string, params: Array): Promise; - _subscribe(param: Array, processFunc: (result: any) => void): number; - _unsubscribe(filterId: number): void; -} - -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export class BlockConnectionSubscriber implements Subscriber { - #provider: ConnectionRpcProvider; - #blockNumber: number; - - #running: boolean; - - #filterId: null | number; - - constructor(provider: ConnectionRpcProvider) { - this.#provider = provider; - this.#blockNumber = -2; - this.#running = false; - this.#filterId = null; - } - - start(): void { - if (this.#running) { return; } - this.#running = true; - - this.#filterId = this.#provider._subscribe([ "newHeads" ], (result: any) => { - const blockNumber = getNumber(result.number); - const initial = (this.#blockNumber === -2) ? blockNumber: (this.#blockNumber + 1) - for (let b = initial; b <= blockNumber; b++) { - this.#provider.emit("block", b); - } - this.#blockNumber = blockNumber; - }); - } - - stop(): void { - if (!this.#running) { return; } - this.#running = false; - - if (this.#filterId != null) { - this.#provider._unsubscribe(this.#filterId); - this.#filterId = null; - } - } - - pause(dropWhilePaused?: boolean): void { - if (dropWhilePaused) { this.#blockNumber = -2; } - this.stop(); - } - - resume(): void { - this.start(); - } -} - diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/subscriber-filterid.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/subscriber-filterid.ts deleted file mode 100644 index ecc1334d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/subscriber-filterid.ts +++ /dev/null @@ -1,199 +0,0 @@ -import { isError } from "../utils/index.js"; - -import { PollingEventSubscriber } from "./subscriber-polling.js"; - -import type { AbstractProvider, Subscriber } from "./abstract-provider.js"; -import type { Network } from "./network.js"; -import type { EventFilter } from "./provider.js"; -import type { JsonRpcApiProvider } from "./provider-jsonrpc.js"; - -function copy(obj: any): any { - return JSON.parse(JSON.stringify(obj)); -} - -/** - * Some backends support subscribing to events using a Filter ID. - * - * When subscribing with this technique, the node issues a unique - * //Filter ID//. At this point the node dedicates resources to - * the filter, so that periodic calls to follow up on the //Filter ID// - * will receive any events since the last call. - * - * @_docloc: api/providers/abstract-provider - */ -export class FilterIdSubscriber implements Subscriber { - #provider: JsonRpcApiProvider; - - #filterIdPromise: null | Promise; - #poller: (b: number) => Promise; - - #running: boolean; - - #network: null | Network; - - #hault: boolean; - - /** - * Creates a new **FilterIdSubscriber** which will used [[_subscribe]] - * and [[_emitResults]] to setup the subscription and provide the event - * to the %%provider%%. - */ - constructor(provider: JsonRpcApiProvider) { - this.#provider = provider; - - this.#filterIdPromise = null; - this.#poller = this.#poll.bind(this); - - this.#running = false; - - this.#network = null; - - this.#hault = false; - } - - /** - * Sub-classes **must** override this to begin the subscription. - */ - _subscribe(provider: JsonRpcApiProvider): Promise { - throw new Error("subclasses must override this"); - } - - /** - * Sub-classes **must** override this handle the events. - */ - _emitResults(provider: AbstractProvider, result: Array): Promise { - throw new Error("subclasses must override this"); - } - - /** - * Sub-classes **must** override this handle recovery on errors. - */ - _recover(provider: AbstractProvider): Subscriber { - throw new Error("subclasses must override this"); - } - - async #poll(blockNumber: number): Promise { - try { - // Subscribe if necessary - if (this.#filterIdPromise == null) { - this.#filterIdPromise = this._subscribe(this.#provider); - } - - // Get the Filter ID - let filterId: null | string = null; - try { - filterId = await this.#filterIdPromise; - } catch (error) { - if (!isError(error, "UNSUPPORTED_OPERATION") || error.operation !== "eth_newFilter") { - throw error; - } - } - - // The backend does not support Filter ID; downgrade to - // polling - if (filterId == null) { - this.#filterIdPromise = null; - this.#provider._recoverSubscriber(this, this._recover(this.#provider)); - return; - } - - const network = await this.#provider.getNetwork(); - if (!this.#network) { this.#network = network; } - - if ((this.#network as Network).chainId !== network.chainId) { - throw new Error("chaid changed"); - } - - if (this.#hault) { return; } - - const result = await this.#provider.send("eth_getFilterChanges", [ filterId ]); - await this._emitResults(this.#provider, result); - } catch (error) { console.log("@TODO", error); } - - this.#provider.once("block", this.#poller); - } - - #teardown(): void { - const filterIdPromise = this.#filterIdPromise; - if (filterIdPromise) { - this.#filterIdPromise = null; - filterIdPromise.then((filterId) => { - if (this.#provider.destroyed) { return; } - this.#provider.send("eth_uninstallFilter", [ filterId ]); - }); - } - } - - start(): void { - if (this.#running) { return; } - this.#running = true; - - this.#poll(-2); - } - - stop(): void { - if (!this.#running) { return; } - this.#running = false; - - this.#hault = true; - this.#teardown(); - this.#provider.off("block", this.#poller); - } - - pause(dropWhilePaused?: boolean): void { - if (dropWhilePaused){ this.#teardown(); } - this.#provider.off("block", this.#poller); - } - - resume(): void { this.start(); } -} - -/** - * A **FilterIdSubscriber** for receiving contract events. - * - * @_docloc: api/providers/abstract-provider - */ -export class FilterIdEventSubscriber extends FilterIdSubscriber { - #event: EventFilter; - - /** - * Creates a new **FilterIdEventSubscriber** attached to %%provider%% - * listening for %%filter%%. - */ - constructor(provider: JsonRpcApiProvider, filter: EventFilter) { - super(provider); - this.#event = copy(filter); - } - - _recover(provider: AbstractProvider): Subscriber { - return new PollingEventSubscriber(provider, this.#event); - } - - async _subscribe(provider: JsonRpcApiProvider): Promise { - const filterId = await provider.send("eth_newFilter", [ this.#event ]); - return filterId; - } - - async _emitResults(provider: JsonRpcApiProvider, results: Array): Promise { - for (const result of results) { - provider.emit(this.#event, provider._wrapLog(result, provider._network)); - } - } -} - -/** - * A **FilterIdSubscriber** for receiving pending transactions events. - * - * @_docloc: api/providers/abstract-provider - */ -export class FilterIdPendingSubscriber extends FilterIdSubscriber { - async _subscribe(provider: JsonRpcApiProvider): Promise { - return await provider.send("eth_newPendingTransactionFilter", [ ]); - } - - async _emitResults(provider: JsonRpcApiProvider, results: Array): Promise { - for (const result of results) { - provider.emit("pending", result); - } - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/subscriber-polling.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/subscriber-polling.ts deleted file mode 100644 index 6b048be8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/subscriber-polling.ts +++ /dev/null @@ -1,321 +0,0 @@ -import { assert, isHexString } from "../utils/index.js"; - -import type { AbstractProvider, Subscriber } from "./abstract-provider.js"; -import type { EventFilter, OrphanFilter, ProviderEvent } from "./provider.js"; - -function copy(obj: any): any { - return JSON.parse(JSON.stringify(obj)); -} - -/** - * Return the polling subscriber for common events. - * - * @_docloc: api/providers/abstract-provider - */ -export function getPollingSubscriber(provider: AbstractProvider, event: ProviderEvent): Subscriber { - if (event === "block") { return new PollingBlockSubscriber(provider); } - if (isHexString(event, 32)) { return new PollingTransactionSubscriber(provider, event); } - - assert(false, "unsupported polling event", "UNSUPPORTED_OPERATION", { - operation: "getPollingSubscriber", info: { event } - }); -} - -// @TODO: refactor this - -/** - * A **PollingBlockSubscriber** polls at a regular interval for a change - * in the block number. - * - * @_docloc: api/providers/abstract-provider - */ -export class PollingBlockSubscriber implements Subscriber { - #provider: AbstractProvider; - #poller: null | number; - - #interval: number; - - // The most recent block we have scanned for events. The value -2 - // indicates we still need to fetch an initial block number - #blockNumber: number; - - /** - * Create a new **PollingBlockSubscriber** attached to %%provider%%. - */ - constructor(provider: AbstractProvider) { - this.#provider = provider; - this.#poller = null; - this.#interval = 4000; - - this.#blockNumber = -2; - } - - /** - * The polling interval. - */ - get pollingInterval(): number { return this.#interval; } - set pollingInterval(value: number) { this.#interval = value; } - - async #poll(): Promise { - try { - const blockNumber = await this.#provider.getBlockNumber(); - - // Bootstrap poll to setup our initial block number - if (this.#blockNumber === -2) { - this.#blockNumber = blockNumber; - return; - } - - // @TODO: Put a cap on the maximum number of events per loop? - - if (blockNumber !== this.#blockNumber) { - for (let b = this.#blockNumber + 1; b <= blockNumber; b++) { - // We have been stopped - if (this.#poller == null) { return; } - - await this.#provider.emit("block", b); - } - - this.#blockNumber = blockNumber; - } - - } catch (error) { - // @TODO: Minor bump, add an "error" event to let subscribers - // know things went awry. - //console.log(error); - } - - // We have been stopped - if (this.#poller == null) { return; } - - this.#poller = this.#provider._setTimeout(this.#poll.bind(this), this.#interval); - } - - start(): void { - if (this.#poller) { return; } - this.#poller = this.#provider._setTimeout(this.#poll.bind(this), this.#interval); - this.#poll(); - } - - stop(): void { - if (!this.#poller) { return; } - this.#provider._clearTimeout(this.#poller); - this.#poller = null; - } - - pause(dropWhilePaused?: boolean): void { - this.stop(); - if (dropWhilePaused) { this.#blockNumber = -2; } - } - - resume(): void { - this.start(); - } -} - - -/** - * An **OnBlockSubscriber** can be sub-classed, with a [[_poll]] - * implmentation which will be called on every new block. - * - * @_docloc: api/providers/abstract-provider - */ -export class OnBlockSubscriber implements Subscriber { - #provider: AbstractProvider; - #poll: (b: number) => void; - #running: boolean; - - /** - * Create a new **OnBlockSubscriber** attached to %%provider%%. - */ - constructor(provider: AbstractProvider) { - this.#provider = provider; - this.#running = false; - this.#poll = (blockNumber: number) => { - this._poll(blockNumber, this.#provider); - } - } - - /** - * Called on every new block. - */ - async _poll(blockNumber: number, provider: AbstractProvider): Promise { - throw new Error("sub-classes must override this"); - } - - start(): void { - if (this.#running) { return; } - this.#running = true; - - this.#poll(-2); - this.#provider.on("block", this.#poll); - } - - stop(): void { - if (!this.#running) { return; } - this.#running = false; - - this.#provider.off("block", this.#poll); - } - - pause(dropWhilePaused?: boolean): void { this.stop(); } - resume(): void { this.start(); } -} - -export class PollingBlockTagSubscriber extends OnBlockSubscriber { - readonly #tag: string; - #lastBlock: number; - - constructor(provider: AbstractProvider, tag: string) { - super(provider); - this.#tag = tag; - this.#lastBlock = -2; - } - - pause(dropWhilePaused?: boolean): void { - if (dropWhilePaused) { this.#lastBlock = -2; } - super.pause(dropWhilePaused); - } - - async _poll(blockNumber: number, provider: AbstractProvider): Promise { - const block = await provider.getBlock(this.#tag); - if (block == null) { return; } - - if (this.#lastBlock === -2) { - this.#lastBlock = block.number; - } else if (block.number > this.#lastBlock) { - provider.emit(this.#tag, block.number); - this.#lastBlock = block.number; - } - } -} - - -/** - * @_ignore: - * - * @_docloc: api/providers/abstract-provider - */ -export class PollingOrphanSubscriber extends OnBlockSubscriber { - #filter: OrphanFilter; - - constructor(provider: AbstractProvider, filter: OrphanFilter) { - super(provider); - this.#filter = copy(filter); - } - - async _poll(blockNumber: number, provider: AbstractProvider): Promise { - throw new Error("@TODO"); - console.log(this.#filter); - } -} - -/** - * A **PollingTransactionSubscriber** will poll for a given transaction - * hash for its receipt. - * - * @_docloc: api/providers/abstract-provider - */ -export class PollingTransactionSubscriber extends OnBlockSubscriber { - #hash: string; - - /** - * Create a new **PollingTransactionSubscriber** attached to - * %%provider%%, listening for %%hash%%. - */ - constructor(provider: AbstractProvider, hash: string) { - super(provider); - this.#hash = hash; - } - - async _poll(blockNumber: number, provider: AbstractProvider): Promise { - const tx = await provider.getTransactionReceipt(this.#hash); - if (tx) { provider.emit(this.#hash, tx); } - } -} - -/** - * A **PollingEventSubscriber** will poll for a given filter for its logs. - * - * @_docloc: api/providers/abstract-provider - */ -export class PollingEventSubscriber implements Subscriber { - #provider: AbstractProvider; - #filter: EventFilter; - #poller: (b: number) => void; - - #running: boolean; - - // The most recent block we have scanned for events. The value -2 - // indicates we still need to fetch an initial block number - #blockNumber: number; - - /** - * Create a new **PollingTransactionSubscriber** attached to - * %%provider%%, listening for %%filter%%. - */ - constructor(provider: AbstractProvider, filter: EventFilter) { - this.#provider = provider; - this.#filter = copy(filter); - this.#poller = this.#poll.bind(this); - this.#running = false; - this.#blockNumber = -2; - } - - async #poll(blockNumber: number): Promise { - // The initial block hasn't been determined yet - if (this.#blockNumber === -2) { return; } - - const filter = copy(this.#filter); - filter.fromBlock = this.#blockNumber + 1; - filter.toBlock = blockNumber; - - const logs = await this.#provider.getLogs(filter); - - // No logs could just mean the node has not indexed them yet, - // so we keep a sliding window of 60 blocks to keep scanning - if (logs.length === 0) { - if (this.#blockNumber < blockNumber - 60) { - this.#blockNumber = blockNumber - 60; - } - return; - } - - for (const log of logs) { - this.#provider.emit(this.#filter, log); - - // Only advance the block number when logs were found to - // account for networks (like BNB and Polygon) which may - // sacrifice event consistency for block event speed - this.#blockNumber = log.blockNumber; - } - } - - start(): void { - if (this.#running) { return; } - this.#running = true; - - if (this.#blockNumber === -2) { - this.#provider.getBlockNumber().then((blockNumber) => { - this.#blockNumber = blockNumber; - }); - } - this.#provider.on("block", this.#poller); - } - - stop(): void { - if (!this.#running) { return; } - this.#running = false; - - this.#provider.off("block", this.#poller); - } - - pause(dropWhilePaused?: boolean): void { - this.stop(); - if (dropWhilePaused) { this.#blockNumber = -2; } - } - - resume(): void { - this.start(); - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/ws-browser.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/ws-browser.ts deleted file mode 100644 index 3e9281f4..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/ws-browser.ts +++ /dev/null @@ -1,11 +0,0 @@ - -function getGlobal(): any { - if (typeof self !== 'undefined') { return self; } - if (typeof window !== 'undefined') { return window; } - if (typeof global !== 'undefined') { return global; } - throw new Error('unable to locate global object'); -}; - -const _WebSocket = getGlobal().WebSocket; - -export { _WebSocket as WebSocket }; diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/ws.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/providers/ws.ts deleted file mode 100644 index 09d86da2..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/providers/ws.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { WebSocket } from "ws"; - - diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/thirdparty.d.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/thirdparty.d.ts deleted file mode 100644 index f3567332..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/thirdparty.d.ts +++ /dev/null @@ -1,16 +0,0 @@ - - -declare module "ws" { - export class WebSocket { - constructor(...args: Array); - - onopen: null | ((...args: Array) => any); - onmessage: null | ((...args: Array) => any); - onerror: null | ((...args: Array) => any); - - readyState: number; - - send(payload: any): void; - close(code?: number, reason?: string): void; - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/transaction/accesslist.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/transaction/accesslist.ts deleted file mode 100644 index 1b4ddf3c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/transaction/accesslist.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { getAddress } from "../address/index.js"; -import { assertArgument, isHexString } from "../utils/index.js"; - -import type { AccessList, AccessListish } from "./index.js"; - - -function accessSetify(addr: string, storageKeys: Array): { address: string,storageKeys: Array } { - return { - address: getAddress(addr), - storageKeys: storageKeys.map((storageKey, index) => { - assertArgument(isHexString(storageKey, 32), "invalid slot", `storageKeys[${ index }]`, storageKey); - return storageKey.toLowerCase(); - }) - }; -} - -/** - * Returns a [[AccessList]] from any ethers-supported access-list structure. - */ -export function accessListify(value: AccessListish): AccessList { - if (Array.isArray(value)) { - return (] | { address: string, storageKeys: Array}>>value).map((set, index) => { - if (Array.isArray(set)) { - assertArgument(set.length === 2, "invalid slot set", `value[${ index }]`, set); - return accessSetify(set[0], set[1]) - } - assertArgument(set != null && typeof(set) === "object", "invalid address-slot set", "value", value); - return accessSetify(set.address, set.storageKeys); - }); - } - - assertArgument(value != null && typeof(value) === "object", "invalid access list", "value", value); - - const result: Array<{ address: string, storageKeys: Array }> = Object.keys(value).map((addr) => { - const storageKeys: Record = value[addr].reduce((accum, storageKey) => { - accum[storageKey] = true; - return accum; - }, >{ }); - return accessSetify(addr, Object.keys(storageKeys).sort()) - }); - result.sort((a, b) => (a.address.localeCompare(b.address))); - return result; -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/transaction/address.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/transaction/address.ts deleted file mode 100644 index a5cf92bf..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/transaction/address.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { getAddress } from "../address/index.js"; -import { keccak256, SigningKey } from "../crypto/index.js"; - -import type { SignatureLike } from "../crypto/index.js"; -import type { BytesLike } from "../utils/index.js"; - -/** - * Returns the address for the %%key%%. - * - * The key may be any standard form of public key or a private key. - */ -export function computeAddress(key: string | SigningKey): string { - let pubkey: string; - if (typeof(key) === "string") { - pubkey = SigningKey.computePublicKey(key, false); - } else { - pubkey = key.publicKey; - } - return getAddress(keccak256("0x" + pubkey.substring(4)).substring(26)); -} - -/** - * Returns the recovered address for the private key that was - * used to sign %%digest%% that resulted in %%signature%%. - */ -export function recoverAddress(digest: BytesLike, signature: SignatureLike): string { - return computeAddress(SigningKey.recoverPublicKey(digest, signature)); -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/transaction/authorization.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/transaction/authorization.ts deleted file mode 100644 index ea323418..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/transaction/authorization.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { getAddress } from "../address/index.js"; -import { Signature } from "../crypto/index.js"; -import { getBigInt } from "../utils/index.js"; - -import type { Authorization, AuthorizationLike } from "./index.js"; - -export function authorizationify(auth: AuthorizationLike): Authorization { - return { - address: getAddress(auth.address), - nonce: getBigInt((auth.nonce != null) ? auth.nonce: 0), - chainId: getBigInt((auth.chainId != null)? auth.chainId: 0), - signature: Signature.from(auth.signature) - }; -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/transaction/index.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/transaction/index.ts deleted file mode 100644 index 1194c713..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/transaction/index.ts +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Each state-changing operation on Ethereum requires a transaction. - * - * @_section api/transaction:Transactions [about-transactions] - */ - -null; - -import type { BigNumberish } from "../utils/maths.js"; -import type { Signature, SignatureLike } from "../crypto/index.js"; - -/** - * A single [[AccessList]] entry of storage keys (slots) for an address. - */ -export type AccessListEntry = { address: string, storageKeys: Array }; - -/** - * An ordered collection of [[AccessList]] entries. - */ -export type AccessList = Array; - -/** - * Any ethers-supported access list structure. - */ -export type AccessListish = AccessList | - Array<[ string, Array ]> | - Record>; - -// Keep here? -export interface Authorization { - address: string; - nonce: bigint; - chainId: bigint; - signature: Signature; -} - -export type AuthorizationLike = { - address: string; - nonce: BigNumberish; - chainId: BigNumberish; - signature: SignatureLike -}; - -export { accessListify } from "./accesslist.js"; -export { authorizationify } from "./authorization.js"; -export { computeAddress, recoverAddress } from "./address.js"; -export { Transaction } from "./transaction.js"; - -export type { - Blob, BlobLike, KzgLibrary, KzgLibraryLike, TransactionLike -} from "./transaction.js"; diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/transaction/transaction.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/transaction/transaction.ts deleted file mode 100644 index ccf0f353..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/transaction/transaction.ts +++ /dev/null @@ -1,1556 +0,0 @@ - -import { getAddress } from "../address/index.js"; -import { ZeroAddress } from "../constants/addresses.js"; -import { - keccak256, sha256, Signature, SigningKey -} from "../crypto/index.js"; -import { - concat, decodeRlp, encodeRlp, getBytes, getBigInt, getNumber, hexlify, - assert, assertArgument, isBytesLike, isHexString, toBeArray, zeroPadValue -} from "../utils/index.js"; - -import { accessListify } from "./accesslist.js"; -import { authorizationify } from "./authorization.js"; -import { recoverAddress } from "./address.js"; - -import type { BigNumberish, BytesLike } from "../utils/index.js"; -import type { SignatureLike } from "../crypto/index.js"; - -import type { - AccessList, AccessListish, Authorization, AuthorizationLike -} from "./index.js"; - -const BN_0 = BigInt(0); -const BN_2 = BigInt(2); -const BN_27 = BigInt(27) -const BN_28 = BigInt(28) -const BN_35 = BigInt(35); -const BN_MAX_UINT = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); - -const inspect = Symbol.for("nodejs.util.inspect.custom"); - -const BLOB_SIZE = 4096 * 32; -const CELL_COUNT = 128; - - -/** - * Returns a BLOb proof as its cells for [[link-eip-7594]] BLOb. - * - * The default %%cellCount%% is 128. - */ -export function splitBlobCells(_proof: BytesLike, cellCount?: number): Array { - if (cellCount == null) { cellCount = CELL_COUNT; } - - const cellProofs: Array = [ ]; - const proof = getBytes(_proof); - - const cellSize = proof.length / cellCount; - for (let i = 0; i < proof.length; i += cellSize) { - cellProofs.push(hexlify(proof.subarray(i, i + cellSize))); - } - - return cellProofs; -} - -// The BLS Modulo; each field within a BLOb must be less than this -//const BLOB_BLS_MODULO = BigInt("0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001"); - -/** - * A **TransactionLike** is an object which is appropriate as a loose - * input for many operations which will populate missing properties of - * a transaction. - */ -export interface TransactionLike { - /** - * The type. - */ - type?: null | number; - - /** - * The recipient address or ``null`` for an ``init`` transaction. - */ - to?: null | A; - - /** - * The sender. - */ - from?: null | A; - - /** - * The nonce. - */ - nonce?: null | number; - - /** - * The maximum amount of gas that can be used. - */ - gasLimit?: null | BigNumberish; - - /** - * The gas price for legacy and berlin transactions. - */ - gasPrice?: null | BigNumberish; - - /** - * The maximum priority fee per gas for london transactions. - */ - maxPriorityFeePerGas?: null | BigNumberish; - - /** - * The maximum total fee per gas for london transactions. - */ - maxFeePerGas?: null | BigNumberish; - - /** - * The data. - */ - data?: null | string; - - /** - * The value (in wei) to send. - */ - value?: null | BigNumberish; - - /** - * The chain ID the transaction is valid on. - */ - chainId?: null | BigNumberish; - - /** - * The transaction hash. - */ - hash?: null | string; - - /** - * The signature provided by the sender. - */ - signature?: null | SignatureLike; - - /** - * The access list for berlin and london transactions. - */ - accessList?: null | AccessListish; - - /** - * The maximum fee per blob gas (see [[link-eip-4844]]). - */ - maxFeePerBlobGas?: null | BigNumberish; - - /** - * The versioned hashes (see [[link-eip-4844]]). - */ - blobVersionedHashes?: null | Array; - - /** - * The blobs (if any) attached to this transaction (see [[link-eip-4844]]). - */ - blobs?: null | Array - - /** - * An external library for computing the KZG commitments and - * proofs necessary for EIP-4844 transactions (see [[link-eip-4844]]). - * - * This is generally ``null``, unless you are creating BLOb - * transactions. - */ - kzg?: null | KzgLibraryLike; - - /** - * The [[link-eip-7594]] BLOb Wrapper Version used for PeerDAS. - * - * For networks that use EIP-7594, this property is required to - * serialize the sidecar correctly. - */ - blobWrapperVersion?: null | number; - - /** - * The [[link-eip-7702]] authorizations (if any). - */ - authorizationList?: null | Array; -} - -/** - * A full-valid BLOb object for [[link-eip-4844]] transactions. - * - * The commitment and proof should have been computed using a - * KZG library. - */ -export interface Blob { - /** - * The blob data. - */ - data: string; - - /** - * A EIP-4844 BLOb uses a string proof, while EIP-7594 use an - * array of strings representing the cells of the proof. - */ - proof: string; - - /** - * The BLOb commitment. - */ - commitment: string; -} - -/** - * A BLOb object that can be passed for [[link-eip-4844]] - * transactions. - * - * It may have had its commitment and proof already provided - * or rely on an attached [[KzgLibrary]] to compute them. - */ -export type BlobLike = BytesLike | { - data: BytesLike; - proof: BytesLike; - commitment: BytesLike; -}; - -/** - * A KZG Library with the necessary functions to compute - * BLOb commitments and proofs. - */ -export interface KzgLibrary { - blobToKzgCommitment: (blob: Uint8Array) => Uint8Array; - computeBlobKzgProof: (blob: Uint8Array, commitment: Uint8Array) => Uint8Array; -} - -/** - * A KZG Library with any of the various API configurations. - * As the library is still experimental and the API is not - * stable, depending on the version used the method names and - * signatures are still in flux. - * - * This allows any of the versions to be passed into Transaction - * while providing a stable external API. - */ -export type KzgLibraryLike = KzgLibrary | { - // kzg-wasm >= 0.5.0 - blobToKZGCommitment: (blob: string) => string; - computeBlobKZGProof: (blob: string, commitment: string) => string; -} | { - // micro-ecc-signer - blobToKzgCommitment: (blob: string) => string | Uint8Array; - computeBlobProof: (blob: string, commitment: string) => string | Uint8Array; -}; - -function getKzgLibrary(kzg: KzgLibraryLike): KzgLibrary { - - const blobToKzgCommitment = (blob: Uint8Array) => { - - if ("computeBlobProof" in kzg) { - // micro-ecc-signer; check for computeBlobProof since this API - // expects a string while the kzg-wasm below expects a Unit8Array - - if ("blobToKzgCommitment" in kzg && typeof(kzg.blobToKzgCommitment) === "function") { - return getBytes(kzg.blobToKzgCommitment(hexlify(blob))) - } - - } else if ("blobToKzgCommitment" in kzg && typeof(kzg.blobToKzgCommitment) === "function") { - // kzg-wasm <0.5.0; blobToKzgCommitment(Uint8Array) => Uint8Array - - return getBytes(kzg.blobToKzgCommitment(blob)); - } - - // kzg-wasm >= 0.5.0; blobToKZGCommitment(string) => string - if ("blobToKZGCommitment" in kzg && typeof(kzg.blobToKZGCommitment) === "function") { - return getBytes(kzg.blobToKZGCommitment(hexlify(blob))); - } - - assertArgument(false, "unsupported KZG library", "kzg", kzg); - }; - - const computeBlobKzgProof = (blob: Uint8Array, commitment: Uint8Array) => { - - // micro-ecc-signer - if ("computeBlobProof" in kzg && typeof(kzg.computeBlobProof) === "function") { - return getBytes(kzg.computeBlobProof(hexlify(blob), hexlify(commitment))) - } - - // kzg-wasm <0.5.0; computeBlobKzgProof(Uint8Array, Uint8Array) => Uint8Array - if ("computeBlobKzgProof" in kzg && typeof(kzg.computeBlobKzgProof) === "function") { - return kzg.computeBlobKzgProof(blob, commitment); - } - - // kzg-wasm >= 0.5.0; computeBlobKZGProof(string, string) => string - if ("computeBlobKZGProof" in kzg && typeof(kzg.computeBlobKZGProof) === "function") { - return getBytes(kzg.computeBlobKZGProof(hexlify(blob), hexlify(commitment))); - } - - assertArgument(false, "unsupported KZG library", "kzg", kzg); - }; - - return { blobToKzgCommitment, computeBlobKzgProof }; -} - -function getVersionedHash(version: number, hash: BytesLike): string { - let versioned = version.toString(16); - while (versioned.length < 2) { versioned = "0" + versioned; } - versioned += sha256(hash).substring(4); - return "0x" + versioned; -} - -function handleAddress(value: string): null | string { - if (value === "0x") { return null; } - return getAddress(value); -} - -function handleAccessList(value: any, param: string): AccessList { - try { - return accessListify(value); - } catch (error: any) { - assertArgument(false, error.message, param, value); - } -} - -function handleAuthorizationList(value: any, param: string): Array { - try { - if (!Array.isArray(value)) { throw new Error("authorizationList: invalid array"); } - const result: Array = [ ]; - for (let i = 0; i < value.length; i++) { - const auth: Array = value[i]; - if (!Array.isArray(auth)) { throw new Error(`authorization[${ i }]: invalid array`); } - if (auth.length !== 6) { throw new Error(`authorization[${ i }]: wrong length`); } - if (!auth[1]) { throw new Error(`authorization[${ i }]: null address`); } - result.push({ - address: handleAddress(auth[1]), - nonce: handleUint(auth[2], "nonce"), - chainId: handleUint(auth[0], "chainId"), - signature: Signature.from({ - yParity: <0 | 1>handleNumber(auth[3], "yParity"), - r: zeroPadValue(auth[4], 32), - s: zeroPadValue(auth[5], 32) - }) - }); - } - return result; - } catch (error: any) { - assertArgument(false, error.message, param, value); - } -} - -function handleNumber(_value: string, param: string): number { - if (_value === "0x") { return 0; } - return getNumber(_value, param); -} - -function handleUint(_value: string, param: string): bigint { - if (_value === "0x") { return BN_0; } - const value = getBigInt(_value, param); - assertArgument(value <= BN_MAX_UINT, "value exceeds uint size", param, value); - return value; -} - -function formatNumber(_value: BigNumberish, name: string): Uint8Array { - const value = getBigInt(_value, "value"); - const result = toBeArray(value); - assertArgument(result.length <= 32, `value too large`, `tx.${ name }`, value); - return result; -} - -function formatAccessList(value: AccessListish): Array<[ string, Array ]> { - return accessListify(value).map((set) => [ set.address, set.storageKeys ]); -} - -function formatAuthorizationList(value: Array): Array> { - return value.map((a) => { - return [ - formatNumber(a.chainId, "chainId"), - a.address, - formatNumber(a.nonce, "nonce"), - formatNumber(a.signature.yParity, "yParity"), - toBeArray(a.signature.r), - toBeArray(a.signature._s) - ]; - }); -} - -function formatHashes(value: Array, param: string): Array { - assertArgument(Array.isArray(value), `invalid ${ param }`, "value", value); - for (let i = 0; i < value.length; i++) { - assertArgument(isHexString(value[i], 32), "invalid ${ param } hash", `value[${ i }]`, value[i]); - } - return value; -} - -function _parseLegacy(data: Uint8Array): TransactionLike { - const fields: any = decodeRlp(data); - - assertArgument(Array.isArray(fields) && (fields.length === 9 || fields.length === 6), - "invalid field count for legacy transaction", "data", data); - - const tx: TransactionLike = { - type: 0, - nonce: handleNumber(fields[0], "nonce"), - gasPrice: handleUint(fields[1], "gasPrice"), - gasLimit: handleUint(fields[2], "gasLimit"), - to: handleAddress(fields[3]), - value: handleUint(fields[4], "value"), - data: hexlify(fields[5]), - chainId: BN_0 - }; - - // Legacy unsigned transaction - if (fields.length === 6) { return tx; } - - const v = handleUint(fields[6], "v"); - const r = handleUint(fields[7], "r"); - const s = handleUint(fields[8], "s"); - - if (r === BN_0 && s === BN_0) { - // EIP-155 unsigned transaction - tx.chainId = v; - - } else { - - // Compute the EIP-155 chain ID (or 0 for legacy) - let chainId = (v - BN_35) / BN_2; - if (chainId < BN_0) { chainId = BN_0; } - tx.chainId = chainId - - // Signed Legacy Transaction - assertArgument(chainId !== BN_0 || (v === BN_27 || v === BN_28), "non-canonical legacy v", "v", fields[6]); - - tx.signature = Signature.from({ - r: zeroPadValue(fields[7], 32), - s: zeroPadValue(fields[8], 32), - v - }); - - //tx.hash = keccak256(data); - } - - return tx; -} - -function _serializeLegacy(tx: Transaction, sig: null | Signature): string { - const fields: Array = [ - formatNumber(tx.nonce, "nonce"), - formatNumber(tx.gasPrice || 0, "gasPrice"), - formatNumber(tx.gasLimit, "gasLimit"), - (tx.to || "0x"), - formatNumber(tx.value, "value"), - tx.data, - ]; - - let chainId = BN_0; - if (tx.chainId != BN_0) { - // A chainId was provided; if non-zero we'll use EIP-155 - chainId = getBigInt(tx.chainId, "tx.chainId"); - - // We have a chainId in the tx and an EIP-155 v in the signature, - // make sure they agree with each other - assertArgument(!sig || sig.networkV == null || sig.legacyChainId === chainId, - "tx.chainId/sig.v mismatch", "sig", sig); - - } else if (tx.signature) { - // No explicit chainId, but EIP-155 have a derived implicit chainId - const legacy = tx.signature.legacyChainId; - if (legacy != null) { chainId = legacy; } - } - - // Requesting an unsigned transaction - if (!sig) { - // We have an EIP-155 transaction (chainId was specified and non-zero) - if (chainId !== BN_0) { - fields.push(toBeArray(chainId)); - fields.push("0x"); - fields.push("0x"); - } - - return encodeRlp(fields); - } - - // @TODO: We should probably check that tx.signature, chainId, and sig - // match but that logic could break existing code, so schedule - // this for the next major bump. - - // Compute the EIP-155 v - let v = BigInt(27 + sig.yParity); - if (chainId !== BN_0) { - v = Signature.getChainIdV(chainId, sig.v); - } else if (BigInt(sig.v) !== v) { - assertArgument(false, "tx.chainId/sig.v mismatch", "sig", sig); - } - - // Add the signature - fields.push(toBeArray(v)); - fields.push(toBeArray(sig.r)); - fields.push(toBeArray(sig._s)); - - return encodeRlp(fields); -} - -function _parseEipSignature(tx: TransactionLike, fields: Array): void { - let yParity: number; - try { - yParity = handleNumber(fields[0], "yParity"); - if (yParity !== 0 && yParity !== 1) { throw new Error("bad yParity"); } - } catch (error) { - assertArgument(false, "invalid yParity", "yParity", fields[0]); - } - - const r = zeroPadValue(fields[1], 32); - const s = zeroPadValue(fields[2], 32); - - const signature = Signature.from({ r, s, yParity }); - tx.signature = signature; -} - -function _parseEip1559(data: Uint8Array): TransactionLike { - const fields: any = decodeRlp(getBytes(data).slice(1)); - - assertArgument(Array.isArray(fields) && (fields.length === 9 || fields.length === 12), - "invalid field count for transaction type: 2", "data", hexlify(data)); - - const tx: TransactionLike = { - type: 2, - chainId: handleUint(fields[0], "chainId"), - nonce: handleNumber(fields[1], "nonce"), - maxPriorityFeePerGas: handleUint(fields[2], "maxPriorityFeePerGas"), - maxFeePerGas: handleUint(fields[3], "maxFeePerGas"), - gasPrice: null, - gasLimit: handleUint(fields[4], "gasLimit"), - to: handleAddress(fields[5]), - value: handleUint(fields[6], "value"), - data: hexlify(fields[7]), - accessList: handleAccessList(fields[8], "accessList"), - }; - - // Unsigned EIP-1559 Transaction - if (fields.length === 9) { return tx; } - - //tx.hash = keccak256(data); - - _parseEipSignature(tx, fields.slice(9)); - - return tx; -} - -function _serializeEip1559(tx: Transaction, sig: null | Signature): string { - const fields: Array = [ - formatNumber(tx.chainId, "chainId"), - formatNumber(tx.nonce, "nonce"), - formatNumber(tx.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"), - formatNumber(tx.maxFeePerGas || 0, "maxFeePerGas"), - formatNumber(tx.gasLimit, "gasLimit"), - (tx.to || "0x"), - formatNumber(tx.value, "value"), - tx.data, - formatAccessList(tx.accessList || [ ]) - ]; - - if (sig) { - fields.push(formatNumber(sig.yParity, "yParity")); - fields.push(toBeArray(sig.r)); - fields.push(toBeArray(sig.s)); - } - - return concat([ "0x02", encodeRlp(fields)]); -} - -function _parseEip2930(data: Uint8Array): TransactionLike { - const fields: any = decodeRlp(getBytes(data).slice(1)); - - assertArgument(Array.isArray(fields) && (fields.length === 8 || fields.length === 11), - "invalid field count for transaction type: 1", "data", hexlify(data)); - - const tx: TransactionLike = { - type: 1, - chainId: handleUint(fields[0], "chainId"), - nonce: handleNumber(fields[1], "nonce"), - gasPrice: handleUint(fields[2], "gasPrice"), - gasLimit: handleUint(fields[3], "gasLimit"), - to: handleAddress(fields[4]), - value: handleUint(fields[5], "value"), - data: hexlify(fields[6]), - accessList: handleAccessList(fields[7], "accessList") - }; - - // Unsigned EIP-2930 Transaction - if (fields.length === 8) { return tx; } - - //tx.hash = keccak256(data); - - _parseEipSignature(tx, fields.slice(8)); - - return tx; -} - -function _serializeEip2930(tx: Transaction, sig: null | Signature): string { - const fields: any = [ - formatNumber(tx.chainId, "chainId"), - formatNumber(tx.nonce, "nonce"), - formatNumber(tx.gasPrice || 0, "gasPrice"), - formatNumber(tx.gasLimit, "gasLimit"), - (tx.to || "0x"), - formatNumber(tx.value, "value"), - tx.data, - formatAccessList(tx.accessList || [ ]) - ]; - - if (sig) { - fields.push(formatNumber(sig.yParity, "recoveryParam")); - fields.push(toBeArray(sig.r)); - fields.push(toBeArray(sig.s)); - } - - return concat([ "0x01", encodeRlp(fields)]); -} - -function _parseEip4844(data: Uint8Array): TransactionLike { - let fields: any = decodeRlp(getBytes(data).slice(1)); - - let typeName = "3"; - - let blobWrapperVersion: null | number = null; - - let blobs: null | Array = null; - - // Parse the network format - if (fields.length === 4 && Array.isArray(fields[0])) { - // EIP-4844 format with sidecar - - typeName = "3 (network format)"; - - const fBlobs = fields[1], fCommits = fields[2], fProofs = fields[3]; - assertArgument(Array.isArray(fBlobs), "invalid network format: blobs not an array", "fields[1]", fBlobs); - assertArgument(Array.isArray(fCommits), "invalid network format: commitments not an array", "fields[2]", fCommits); - assertArgument(Array.isArray(fProofs), "invalid network format: proofs not an array", "fields[3]", fProofs); - assertArgument(fBlobs.length === fCommits.length, "invalid network format: blobs/commitments length mismatch", "fields", fields); - assertArgument(fBlobs.length === fProofs.length, "invalid network format: blobs/proofs length mismatch", "fields", fields); - - blobs = [ ]; - for (let i = 0; i < fields[1].length; i++) { - blobs.push({ - data: fBlobs[i], - commitment: fCommits[i], - proof: fProofs[i], - }); - } - - fields = fields[0]; - - } else if (fields.length === 5 && Array.isArray(fields[0])) { - // EIP-7594 format with sidecar - - typeName = "3 (EIP-7594 network format)"; - - blobWrapperVersion = getNumber(fields[1]); - const fBlobs = fields[2], fCommits = fields[3], fProofs = fields[4]; - - assertArgument(blobWrapperVersion === 1, `unsupported EIP-7594 network format version: ${ blobWrapperVersion }`, "fields[1]", blobWrapperVersion); - assertArgument(Array.isArray(fBlobs), "invalid EIP-7594 network format: blobs not an array", "fields[2]", fBlobs); - assertArgument(Array.isArray(fCommits), "invalid EIP-7594 network format: commitments not an array", "fields[3]", fCommits); - assertArgument(Array.isArray(fProofs), "invalid EIP-7594 network format: proofs not an array", "fields[4]", fProofs); - assertArgument(fBlobs.length === fCommits.length, "invalid network format: blobs/commitments length mismatch", "fields", fields); - assertArgument(fBlobs.length * CELL_COUNT === fProofs.length, "invalid network format: blobs/proofs length mismatch", "fields", fields); - - blobs = [ ]; - for (let i = 0; i < fBlobs.length; i++) { - const proof = [ ]; - for (let j = 0; j < CELL_COUNT; j++) { - proof.push(fProofs[(i * CELL_COUNT) + j]); - } - - blobs.push({ - data: fBlobs[i], - commitment: fCommits[i], - proof: concat(proof) - }); - } - - fields = fields[0]; - } - - assertArgument(Array.isArray(fields) && (fields.length === 11 || fields.length === 14), - `invalid field count for transaction type: ${ typeName }`, "data", hexlify(data)); - - const tx: TransactionLike = { - type: 3, - chainId: handleUint(fields[0], "chainId"), - nonce: handleNumber(fields[1], "nonce"), - maxPriorityFeePerGas: handleUint(fields[2], "maxPriorityFeePerGas"), - maxFeePerGas: handleUint(fields[3], "maxFeePerGas"), - gasPrice: null, - gasLimit: handleUint(fields[4], "gasLimit"), - to: handleAddress(fields[5]), - value: handleUint(fields[6], "value"), - data: hexlify(fields[7]), - accessList: handleAccessList(fields[8], "accessList"), - maxFeePerBlobGas: handleUint(fields[9], "maxFeePerBlobGas"), - blobVersionedHashes: fields[10], - blobWrapperVersion - }; - - if (blobs) { tx.blobs = blobs; } - - assertArgument(tx.to != null, `invalid address for transaction type: ${ typeName }`, "data", data); - - assertArgument(Array.isArray(tx.blobVersionedHashes), "invalid blobVersionedHashes: must be an array", "data", data); - for (let i = 0; i < tx.blobVersionedHashes.length; i++) { - assertArgument(isHexString(tx.blobVersionedHashes[i], 32), `invalid blobVersionedHash at index ${ i }: must be length 32`, "data", data); - } - - // Unsigned EIP-4844 Transaction - if (fields.length === 11) { return tx; } - - // @TODO: Do we need to do this? This is only called internally - // and used to verify hashes; it might save time to not do this - //tx.hash = keccak256(concat([ "0x03", encodeRlp(fields) ])); - - _parseEipSignature(tx, fields.slice(11)); - - return tx; -} - -function _serializeEip4844(tx: Transaction, sig: null | Signature, blobs: null | Array): string { - const fields: Array = [ - formatNumber(tx.chainId, "chainId"), - formatNumber(tx.nonce, "nonce"), - formatNumber(tx.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"), - formatNumber(tx.maxFeePerGas || 0, "maxFeePerGas"), - formatNumber(tx.gasLimit, "gasLimit"), - (tx.to || ZeroAddress), - formatNumber(tx.value, "value"), - tx.data, - formatAccessList(tx.accessList || [ ]), - formatNumber(tx.maxFeePerBlobGas || 0, "maxFeePerBlobGas"), - formatHashes(tx.blobVersionedHashes || [ ], "blobVersionedHashes") - ]; - - if (sig) { - fields.push(formatNumber(sig.yParity, "yParity")); - fields.push(toBeArray(sig.r)); - fields.push(toBeArray(sig.s)); - - // We have blobs; return the network wrapped format - if (blobs) { - - // Use EIP-7594 - if (tx.blobWrapperVersion != null) { - const wrapperVersion = toBeArray(tx.blobWrapperVersion); - - const cellProofs: Array = [ ]; - for (const { proof } of blobs) { - const p = getBytes(proof); - const cellSize = p.length / CELL_COUNT; - for (let i = 0; i < p.length; i += cellSize) { - cellProofs.push(p.subarray(i, i + cellSize)); - } - } - - return concat([ - "0x03", - encodeRlp([ - fields, - wrapperVersion, - blobs.map((b) => b.data), - blobs.map((b) => b.commitment), - cellProofs - ]) - ]); - } - - // Fall back onto classic EIP-4844 behavior - return concat([ - "0x03", - encodeRlp([ - fields, - blobs.map((b) => b.data), - blobs.map((b) => b.commitment), - blobs.map((b) => b.proof), - ]) - ]); - - } - - } - - return concat([ "0x03", encodeRlp(fields)]); -} - -function _parseEip7702(data: Uint8Array): TransactionLike { - const fields: any = decodeRlp(getBytes(data).slice(1)); - - assertArgument(Array.isArray(fields) && (fields.length === 10 || fields.length === 13), - "invalid field count for transaction type: 4", "data", hexlify(data)); - - const tx: TransactionLike = { - type: 4, - chainId: handleUint(fields[0], "chainId"), - nonce: handleNumber(fields[1], "nonce"), - maxPriorityFeePerGas: handleUint(fields[2], "maxPriorityFeePerGas"), - maxFeePerGas: handleUint(fields[3], "maxFeePerGas"), - gasPrice: null, - gasLimit: handleUint(fields[4], "gasLimit"), - to: handleAddress(fields[5]), - value: handleUint(fields[6], "value"), - data: hexlify(fields[7]), - accessList: handleAccessList(fields[8], "accessList"), - authorizationList: handleAuthorizationList(fields[9], "authorizationList"), - }; - - // Unsigned EIP-7702 Transaction - if (fields.length === 10) { return tx; } - - _parseEipSignature(tx, fields.slice(10)); - - return tx; -} - -function _serializeEip7702(tx: Transaction, sig: null | Signature): string { - const fields: Array = [ - formatNumber(tx.chainId, "chainId"), - formatNumber(tx.nonce, "nonce"), - formatNumber(tx.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"), - formatNumber(tx.maxFeePerGas || 0, "maxFeePerGas"), - formatNumber(tx.gasLimit, "gasLimit"), - (tx.to || "0x"), - formatNumber(tx.value, "value"), - tx.data, - formatAccessList(tx.accessList || [ ]), - formatAuthorizationList(tx.authorizationList || [ ]) - ]; - - if (sig) { - fields.push(formatNumber(sig.yParity, "yParity")); - fields.push(toBeArray(sig.r)); - fields.push(toBeArray(sig.s)); - } - - return concat([ "0x04", encodeRlp(fields)]); -} - -/** - * A **Transaction** describes an operation to be executed on - * Ethereum by an Externally Owned Account (EOA). It includes - * who (the [[to]] address), what (the [[data]]) and how much (the - * [[value]] in ether) the operation should entail. - * - * @example: - * tx = new Transaction() - * //_result: - * - * tx.data = "0x1234"; - * //_result: - */ -export class Transaction implements TransactionLike { - #type: null | number; - #to: null | string; - #data: string; - #nonce: number; - #gasLimit: bigint; - #gasPrice: null | bigint; - #maxPriorityFeePerGas: null | bigint; - #maxFeePerGas: null | bigint; - #value: bigint; - #chainId: bigint; - #sig: null | Signature; - #accessList: null | AccessList; - #maxFeePerBlobGas: null | bigint; - #blobVersionedHashes: null | Array; - #kzg: null | KzgLibrary; - #blobs: null | Array; - #auths: null | Array; - #blobWrapperVersion: null | number; - - /** - * The transaction type. - * - * If null, the type will be automatically inferred based on - * explicit properties. - */ - get type(): null | number { return this.#type; } - set type(value: null | number | string) { - switch (value) { - case null: - this.#type = null; - break; - case 0: case "legacy": - this.#type = 0; - break; - case 1: case "berlin": case "eip-2930": - this.#type = 1; - break; - case 2: case "london": case "eip-1559": - this.#type = 2; - break; - case 3: case "cancun": case "eip-4844": - this.#type = 3; - break; - case 4: case "pectra": case "eip-7702": - this.#type = 4; - break; - default: - assertArgument(false, "unsupported transaction type", "type", value); - } - } - - /** - * The name of the transaction type. - */ - get typeName(): null | string { - switch (this.type) { - case 0: return "legacy"; - case 1: return "eip-2930"; - case 2: return "eip-1559"; - case 3: return "eip-4844"; - case 4: return "eip-7702"; - } - - return null; - } - - /** - * The ``to`` address for the transaction or ``null`` if the - * transaction is an ``init`` transaction. - */ - get to(): null | string { - const value = this.#to; - if (value == null && this.type === 3) { return ZeroAddress; } - return value; - } - set to(value: null | string) { - this.#to = (value == null) ? null: getAddress(value); - } - - /** - * The transaction nonce. - */ - get nonce(): number { return this.#nonce; } - set nonce(value: BigNumberish) { this.#nonce = getNumber(value, "value"); } - - /** - * The gas limit. - */ - get gasLimit(): bigint { return this.#gasLimit; } - set gasLimit(value: BigNumberish) { this.#gasLimit = getBigInt(value); } - - /** - * The gas price. - * - * On legacy networks this defines the fee that will be paid. On - * EIP-1559 networks, this should be ``null``. - */ - get gasPrice(): null | bigint { - const value = this.#gasPrice; - if (value == null && (this.type === 0 || this.type === 1)) { return BN_0; } - return value; - } - set gasPrice(value: null | BigNumberish) { - this.#gasPrice = (value == null) ? null: getBigInt(value, "gasPrice"); - } - - /** - * The maximum priority fee per unit of gas to pay. On legacy - * networks this should be ``null``. - */ - get maxPriorityFeePerGas(): null | bigint { - const value = this.#maxPriorityFeePerGas; - if (value == null) { - if (this.type === 2 || this.type === 3) { return BN_0; } - return null; - } - return value; - } - set maxPriorityFeePerGas(value: null | BigNumberish) { - this.#maxPriorityFeePerGas = (value == null) ? null: getBigInt(value, "maxPriorityFeePerGas"); - } - - /** - * The maximum total fee per unit of gas to pay. On legacy - * networks this should be ``null``. - */ - get maxFeePerGas(): null | bigint { - const value = this.#maxFeePerGas; - if (value == null) { - if (this.type === 2 || this.type === 3) { return BN_0; } - return null; - } - return value; - } - set maxFeePerGas(value: null | BigNumberish) { - this.#maxFeePerGas = (value == null) ? null: getBigInt(value, "maxFeePerGas"); - } - - /** - * The transaction data. For ``init`` transactions this is the - * deployment code. - */ - get data(): string { return this.#data; } - set data(value: BytesLike) { this.#data = hexlify(value); } - - /** - * The amount of ether (in wei) to send in this transactions. - */ - get value(): bigint { return this.#value; } - set value(value: BigNumberish) { - this.#value = getBigInt(value, "value"); - } - - /** - * The chain ID this transaction is valid on. - */ - get chainId(): bigint { return this.#chainId; } - set chainId(value: BigNumberish) { this.#chainId = getBigInt(value); } - - /** - * If signed, the signature for this transaction. - */ - get signature(): null | Signature { return this.#sig || null; } - set signature(value: null | SignatureLike) { - this.#sig = (value == null) ? null: Signature.from(value); - } - - isValid(): boolean { - const sig = this.signature; - if (sig && !sig.isValid()) { return false; } - - const auths = this.authorizationList; - if (auths) { - for (const auth of auths) { - if (!auth.signature.isValid()) { return false; } - } - } - - return true; - } - - /** - * The access list. - * - * An access list permits discounted (but pre-paid) access to - * bytecode and state variable access within contract execution. - */ - get accessList(): null | AccessList { - const value = this.#accessList || null; - if (value == null) { - if (this.type === 1 || this.type === 2 || this.type === 3) { - // @TODO: in v7, this should assign the value or become - // a live object itself, otherwise mutation is inconsistent - return [ ]; - } - return null; - } - return value; - } - set accessList(value: null | AccessListish) { - this.#accessList = (value == null) ? null: accessListify(value); - } - - get authorizationList(): null | Array { - const value = this.#auths || null; - if (value == null) { - if (this.type === 4) { - // @TODO: in v7, this should become a live object itself, - // otherwise mutation is inconsistent - return [ ]; - } - } - return value; - } - set authorizationList(auths: null | Array) { - this.#auths = (auths == null) ? null: auths.map((a) => - authorizationify(a)); - } - - /** - * The max fee per blob gas for Cancun transactions. - */ - get maxFeePerBlobGas(): null | bigint { - const value = this.#maxFeePerBlobGas; - if (value == null && this.type === 3) { return BN_0; } - return value; - } - set maxFeePerBlobGas(value: null | BigNumberish) { - this.#maxFeePerBlobGas = (value == null) ? null: getBigInt(value, "maxFeePerBlobGas"); - } - - /** - * The BLOb versioned hashes for Cancun transactions. - */ - get blobVersionedHashes(): null | Array { - // @TODO: Mutation is inconsistent; if unset, the returned value - // cannot mutate the object, if set it can - let value = this.#blobVersionedHashes; - if (value == null && this.type === 3) { return [ ]; } - return value; - } - set blobVersionedHashes(value: null | Array) { - if (value != null) { - assertArgument(Array.isArray(value), "blobVersionedHashes must be an Array", "value", value); - value = value.slice(); - for (let i = 0; i < value.length; i++) { - assertArgument(isHexString(value[i], 32), "invalid blobVersionedHash", `value[${ i }]`, value[i]); - } - } - this.#blobVersionedHashes = value; - } - - /** - * The BLObs for the Transaction, if any. - * - * If ``blobs`` is non-``null``, then the [[seriailized]] - * will return the network formatted sidecar, otherwise it - * will return the standard [[link-eip-2718]] payload. The - * [[unsignedSerialized]] is unaffected regardless. - * - * When setting ``blobs``, either fully valid [[Blob]] objects - * may be specified (i.e. correctly padded, with correct - * committments and proofs) or a raw [[BytesLike]] may - * be provided. - * - * If raw [[BytesLike]] are provided, the [[kzg]] property **must** - * be already set. The blob will be correctly padded and the - * [[KzgLibrary]] will be used to compute the committment and - * proof for the blob. - * - * A BLOb is a sequence of field elements, each of which must - * be within the BLS field modulo, so some additional processing - * may be required to encode arbitrary data to ensure each 32 byte - * field is within the valid range. - * - * Setting this automatically populates [[blobVersionedHashes]], - * overwriting any existing values. Setting this to ``null`` - * does **not** remove the [[blobVersionedHashes]], leaving them - * present. - */ - get blobs(): null | Array { - if (this.#blobs == null) { return null; } - return this.#blobs.map((b) => Object.assign({ }, b)); - } - set blobs(_blobs: null | Array) { - if (_blobs == null) { - this.#blobs = null; - return; - } - - const blobs: Array = [ ]; - const versionedHashes: Array = [ ]; - for (let i = 0; i < _blobs.length; i++) { - const blob = _blobs[i]; - - if (isBytesLike(blob)) { - assert(this.#kzg, "adding a raw blob requires a KZG library", "UNSUPPORTED_OPERATION", { - operation: "set blobs()" - }); - - let data = getBytes(blob); - assertArgument(data.length <= BLOB_SIZE, "blob is too large", `blobs[${ i }]`, blob); - - // Pad blob if necessary - if (data.length !== BLOB_SIZE) { - const padded = new Uint8Array(BLOB_SIZE); - padded.set(data); - data = padded; - } - - const commit = this.#kzg.blobToKzgCommitment(data); - const proof = hexlify(this.#kzg.computeBlobKzgProof(data, commit)); - - blobs.push({ - data: hexlify(data), - commitment: hexlify(commit), - proof - }); - versionedHashes.push(getVersionedHash(1, commit)); - - } else { - const data = hexlify(blob.data); - const commitment = hexlify(blob.commitment); - const proof = hexlify(blob.proof); - blobs.push({ data, commitment, proof }); - - versionedHashes.push(getVersionedHash(1, commitment)); - } - } - - this.#blobs = blobs; - this.#blobVersionedHashes = versionedHashes; - } - - get kzg(): null | KzgLibrary { return this.#kzg; } - set kzg(kzg: null | KzgLibraryLike) { - if (kzg == null) { - this.#kzg = null; - } else { - this.#kzg = getKzgLibrary(kzg); - } - } - - get blobWrapperVersion(): null | number { - return this.#blobWrapperVersion; - } - set blobWrapperVersion(value: null | number) { - this.#blobWrapperVersion = value; - } - - /** - * Creates a new Transaction with default values. - */ - constructor() { - this.#type = null; - this.#to = null; - this.#nonce = 0; - this.#gasLimit = BN_0; - this.#gasPrice = null; - this.#maxPriorityFeePerGas = null; - this.#maxFeePerGas = null; - this.#data = "0x"; - this.#value = BN_0; - this.#chainId = BN_0; - this.#sig = null; - this.#accessList = null; - this.#maxFeePerBlobGas = null; - this.#blobVersionedHashes = null; - this.#kzg = null; - this.#blobs = null; - this.#auths = null; - this.#blobWrapperVersion = null; - } - - /** - * The transaction hash, if signed. Otherwise, ``null``. - */ - get hash(): null | string { - if (this.signature == null) { return null; } - return keccak256(this.#getSerialized(true, false)); - } - - /** - * The pre-image hash of this transaction. - * - * This is the digest that a [[Signer]] must sign to authorize - * this transaction. - */ - get unsignedHash(): string { - return keccak256(this.unsignedSerialized); - } - - /** - * The sending address, if signed. Otherwise, ``null``. - */ - get from(): null | string { - if (this.signature == null) { return null; } - return recoverAddress(this.unsignedHash, this.signature.getCanonical()); - } - - /** - * The public key of the sender, if signed. Otherwise, ``null``. - */ - get fromPublicKey(): null | string { - if (this.signature == null) { return null; } - return SigningKey.recoverPublicKey(this.unsignedHash, this.signature.getCanonical()); - } - - /** - * Returns true if signed. - * - * This provides a Type Guard that properties requiring a signed - * transaction are non-null. - */ - isSigned(): this is (Transaction & { type: number, typeName: string, from: string, signature: Signature }) { - return this.signature != null; - } - - #getSerialized(signed: boolean, sidecar: boolean): string { - assert(!signed || this.signature != null, "cannot serialize unsigned transaction; maybe you meant .unsignedSerialized", "UNSUPPORTED_OPERATION", { operation: ".serialized"}); - - const sig = signed ? this.signature: null; - switch (this.inferType()) { - case 0: - return _serializeLegacy(this, sig); - case 1: - return _serializeEip2930(this, sig); - case 2: - return _serializeEip1559(this, sig); - case 3: - return _serializeEip4844(this, sig, sidecar ? this.blobs: null); - case 4: - return _serializeEip7702(this, sig); - } - - assert(false, "unsupported transaction type", "UNSUPPORTED_OPERATION", { operation: ".serialized" }); - } - - /** - * The serialized transaction. - * - * This throws if the transaction is unsigned. For the pre-image, - * use [[unsignedSerialized]]. - */ - get serialized(): string { - return this.#getSerialized(true, true); - } - - /** - * The transaction pre-image. - * - * The hash of this is the digest which needs to be signed to - * authorize this transaction. - */ - get unsignedSerialized(): string { - return this.#getSerialized(false, false); - } - - /** - * Return the most "likely" type; currently the highest - * supported transaction type. - */ - inferType(): number { - const types = this.inferTypes(); - - // Prefer London (EIP-1559) over Cancun (BLOb) - if (types.indexOf(2) >= 0) { return 2; } - - // Return the highest inferred type - return (types.pop()); - } - - /** - * Validates the explicit properties and returns a list of compatible - * transaction types. - */ - inferTypes(): Array { - - // Checks that there are no conflicting properties set - const hasGasPrice = this.gasPrice != null; - const hasFee = (this.maxFeePerGas != null || this.maxPriorityFeePerGas != null); - const hasAccessList = (this.accessList != null); - const hasBlob = (this.#maxFeePerBlobGas != null || this.#blobVersionedHashes); - - //if (hasGasPrice && hasFee) { - // throw new Error("transaction cannot have gasPrice and maxFeePerGas"); - //} - - if (this.maxFeePerGas != null && this.maxPriorityFeePerGas != null) { - assert(this.maxFeePerGas >= this.maxPriorityFeePerGas, "priorityFee cannot be more than maxFee", "BAD_DATA", { value: this }); - } - - //if (this.type === 2 && hasGasPrice) { - // throw new Error("eip-1559 transaction cannot have gasPrice"); - //} - - assert(!hasFee || (this.type !== 0 && this.type !== 1), "transaction type cannot have maxFeePerGas or maxPriorityFeePerGas", "BAD_DATA", { value: this }); - assert(this.type !== 0 || !hasAccessList, "legacy transaction cannot have accessList", "BAD_DATA", { value: this }) - - const types: Array = [ ]; - - // Explicit type - if (this.type != null) { - types.push(this.type); - - } else { - if (this.authorizationList && this.authorizationList.length) { - types.push(4); - } else if (hasFee) { - types.push(2); - } else if (hasGasPrice) { - types.push(1); - if (!hasAccessList) { types.push(0); } - } else if (hasAccessList) { - types.push(1); - types.push(2); - } else if (hasBlob && this.to) { - types.push(3); - } else { - types.push(0); - types.push(1); - types.push(2); - types.push(3); - } - } - - types.sort(); - - return types; - } - - /** - * Returns true if this transaction is a legacy transaction (i.e. - * ``type === 0``). - * - * This provides a Type Guard that the related properties are - * non-null. - */ - isLegacy(): this is (Transaction & { type: 0, gasPrice: bigint }) { - return (this.type === 0); - } - - /** - * Returns true if this transaction is berlin hardform transaction (i.e. - * ``type === 1``). - * - * This provides a Type Guard that the related properties are - * non-null. - */ - isBerlin(): this is (Transaction & { type: 1, gasPrice: bigint, accessList: AccessList }) { - return (this.type === 1); - } - - /** - * Returns true if this transaction is london hardform transaction (i.e. - * ``type === 2``). - * - * This provides a Type Guard that the related properties are - * non-null. - */ - isLondon(): this is (Transaction & { type: 2, accessList: AccessList, maxFeePerGas: bigint, maxPriorityFeePerGas: bigint }) { - return (this.type === 2); - } - - /** - * Returns true if this transaction is an [[link-eip-4844]] BLOB - * transaction. - * - * This provides a Type Guard that the related properties are - * non-null. - */ - isCancun(): this is (Transaction & { type: 3, to: string, accessList: AccessList, maxFeePerGas: bigint, maxPriorityFeePerGas: bigint, maxFeePerBlobGas: bigint, blobVersionedHashes: Array }) { - return (this.type === 3); - } - - /** - * Create a copy of this transaciton. - */ - clone(): Transaction { - return Transaction.from(this); - } - - /** - * Return a JSON-friendly object. - */ - toJSON(): any { - const s = (v: null | bigint) => { - if (v == null) { return null; } - return v.toString(); - }; - - return { - type: this.type, - to: this.to, -// from: this.from, - data: this.data, - nonce: this.nonce, - gasLimit: s(this.gasLimit), - gasPrice: s(this.gasPrice), - maxPriorityFeePerGas: s(this.maxPriorityFeePerGas), - maxFeePerGas: s(this.maxFeePerGas), - value: s(this.value), - chainId: s(this.chainId), - sig: this.signature ? this.signature.toJSON(): null, - accessList: this.accessList - }; - } - - [inspect](): string { - return this.toString(); - } - - toString(): string { - const output: Array = [ ]; - const add = (key: string) => { - let value = (this)[key]; - if (typeof(value) === "string") { value = JSON.stringify(value); } - output.push(`${ key }: ${ value }`); - }; - - if (this.type) { add("type"); } - add("to"); - add("data"); - add("nonce"); - add("gasLimit"); - add("value"); - if (this.chainId != null) { add("chainId"); } - if (this.signature) { - add("from"); - output.push(`signature: ${ this.signature.toString() }`); - } - - // @TODO: accessList - - // @TODO: blobs (might make output huge; maybe just include a flag?) - - const auths = this.authorizationList; - if (auths) { - const outputAuths: Array = [ ]; - for (const auth of auths) { - const o: Array = [ ]; - o.push(`address: ${ JSON.stringify(auth.address) }`); - if (auth.nonce != null) { o.push(`nonce: ${ auth.nonce }`); } - if (auth.chainId != null) { o.push(`chainId: ${ auth.chainId }`); } - if (auth.signature) { - o.push(`signature: ${ auth.signature.toString() }`); - } - outputAuths.push(`Authorization { ${ o.join(", ") } }`); - } - output.push(`authorizations: [ ${ outputAuths.join(", ") } ]`); - } - - return `Transaction { ${ output.join(", ") } }`; - } - - /** - * Create a **Transaction** from a serialized transaction or a - * Transaction-like object. - */ - static from(tx?: string | TransactionLike): Transaction { - if (tx == null) { return new Transaction(); } - - if (typeof(tx) === "string") { - const payload = getBytes(tx); - - if (payload[0] >= 0x7f) { // @TODO: > vs >= ?? - return Transaction.from(_parseLegacy(payload)); - } - - switch(payload[0]) { - case 1: return Transaction.from(_parseEip2930(payload)); - case 2: return Transaction.from(_parseEip1559(payload)); - case 3: return Transaction.from(_parseEip4844(payload)); - case 4: return Transaction.from(_parseEip7702(payload)); - } - assert(false, "unsupported transaction type", "UNSUPPORTED_OPERATION", { operation: "from" }); - } - - const result = new Transaction(); - if (tx.type != null) { result.type = tx.type; } - if (tx.to != null) { result.to = tx.to; } - if (tx.nonce != null) { result.nonce = tx.nonce; } - if (tx.gasLimit != null) { result.gasLimit = tx.gasLimit; } - if (tx.gasPrice != null) { result.gasPrice = tx.gasPrice; } - if (tx.maxPriorityFeePerGas != null) { result.maxPriorityFeePerGas = tx.maxPriorityFeePerGas; } - if (tx.maxFeePerGas != null) { result.maxFeePerGas = tx.maxFeePerGas; } - if (tx.maxFeePerBlobGas != null) { result.maxFeePerBlobGas = tx.maxFeePerBlobGas; } - if (tx.data != null) { result.data = tx.data; } - if (tx.value != null) { result.value = tx.value; } - if (tx.chainId != null) { result.chainId = tx.chainId; } - if (tx.signature != null) { result.signature = Signature.from(tx.signature); } - if (tx.accessList != null) { result.accessList = tx.accessList; } - if (tx.authorizationList != null) { - result.authorizationList = tx.authorizationList; - } - - // This will get overwritten by blobs, if present - if (tx.blobVersionedHashes != null) { result.blobVersionedHashes = tx.blobVersionedHashes; } - - // Make sure we assign the kzg before assigning blobs, which - // require the library in the event raw blob data is provided. - if (tx.kzg != null) { result.kzg = tx.kzg; } - if (tx.blobWrapperVersion != null) { result.blobWrapperVersion = tx.blobWrapperVersion; } - if (tx.blobs != null) { result.blobs = tx.blobs; } - - if (tx.hash != null) { - assertArgument(result.isSigned(), "unsigned transaction cannot define '.hash'", "tx", tx); - assertArgument(result.hash === tx.hash, "hash mismatch", "tx", tx); - } - - if (tx.from != null) { - assertArgument(result.isSigned(), "unsigned transaction cannot define '.from'", "tx", tx); - assertArgument(result.from.toLowerCase() === (tx.from || "").toLowerCase(), "from mismatch", "tx", tx); - } - - return result; - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/base58.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/utils/base58.ts deleted file mode 100644 index b71f99d3..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/base58.ts +++ /dev/null @@ -1,73 +0,0 @@ -/** - * The [Base58 Encoding](link-base58) scheme allows a **numeric** value - * to be encoded as a compact string using a radix of 58 using only - * alpha-numeric characters. Confusingly similar characters are omitted - * (i.e. ``"l0O"``). - * - * Note that Base58 encodes a **numeric** value, not arbitrary bytes, - * since any zero-bytes on the left would get removed. To mitigate this - * issue most schemes that use Base58 choose specific high-order values - * to ensure non-zero prefixes. - * - * @_subsection: api/utils:Base58 Encoding [about-base58] - */ - -import { getBytes } from "./data.js"; -import { assertArgument } from "./errors.js"; -import { toBigInt } from "./maths.js"; - -import type { BytesLike } from "./index.js"; - - -const Alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; -let Lookup: null | Record = null; - -function getAlpha(letter: string): bigint { - if (Lookup == null) { - Lookup = { }; - for (let i = 0; i < Alphabet.length; i++) { - Lookup[Alphabet[i]] = BigInt(i); - } - } - const result = Lookup[letter]; - assertArgument(result != null, `invalid base58 value`, "letter", letter); - return result; -} - - -const BN_0 = BigInt(0); -const BN_58 = BigInt(58); - -/** - * Encode %%value%% as a Base58-encoded string. - */ -export function encodeBase58(_value: BytesLike): string { - const bytes = getBytes(_value); - - let value = toBigInt(bytes); - let result = ""; - while (value) { - result = Alphabet[Number(value % BN_58)] + result; - value /= BN_58; - } - - // Account for leading padding zeros - for (let i = 0; i < bytes.length; i++) { - if (bytes[i]) { break; } - result = Alphabet[0] + result; - } - - return result; -} - -/** - * Decode the Base58-encoded %%value%%. - */ -export function decodeBase58(value: string): bigint { - let result = BN_0; - for (let i = 0; i < value.length; i++) { - result *= BN_58; - result += getAlpha(value[i]); - } - return result; -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/base64-browser.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/utils/base64-browser.ts deleted file mode 100644 index 656012a2..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/base64-browser.ts +++ /dev/null @@ -1,25 +0,0 @@ - -// utils/base64-browser - -import { getBytes } from "./data.js"; - -import type { BytesLike } from "./data.js"; - - -export function decodeBase64(textData: string): Uint8Array { - textData = atob(textData); - const data = new Uint8Array(textData.length); - for (let i = 0; i < textData.length; i++) { - data[i] = textData.charCodeAt(i); - } - return getBytes(data); -} - -export function encodeBase64(_data: BytesLike): string { - const data = getBytes(_data); - let textData = ""; - for (let i = 0; i < data.length; i++) { - textData += String.fromCharCode(data[i]); - } - return btoa(textData); -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/base64.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/utils/base64.ts deleted file mode 100644 index 62778cfb..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/base64.ts +++ /dev/null @@ -1,56 +0,0 @@ -/** - * [Base64 encoding](link-wiki-base64) using 6-bit words to encode - * arbitrary bytes into a string using 65 printable symbols, the - * upper-case and lower-case alphabet, the digits ``0`` through ``9``, - * ``"+"`` and ``"/"`` with the ``"="`` used for padding. - * - * @_subsection: api/utils:Base64 Encoding [about-base64] - */ -import { getBytes, getBytesCopy } from "./data.js"; - -import type { BytesLike } from "./data.js"; - - -/** - * Decodes the base-64 encoded %%value%%. - * - * @example: - * // The decoded value is always binary data... - * result = decodeBase64("SGVsbG8gV29ybGQhIQ==") - * //_result: - * - * // ...use toUtf8String to convert it to a string. - * toUtf8String(result) - * //_result: - * - * // Decoding binary data - * decodeBase64("EjQ=") - * //_result: - */ -export function decodeBase64(value: string): Uint8Array { - return getBytesCopy(Buffer.from(value, "base64")); -}; - -/** - * Encodes %%data%% as a base-64 encoded string. - * - * @example: - * // Encoding binary data as a hexstring - * encodeBase64("0x1234") - * //_result: - * - * // Encoding binary data as a Uint8Array - * encodeBase64(new Uint8Array([ 0x12, 0x34 ])) - * //_result: - * - * // The input MUST be data... - * encodeBase64("Hello World!!") - * //_error: - * - * // ...use toUtf8Bytes for this. - * encodeBase64(toUtf8Bytes("Hello World!!")) - * //_result: - */ -export function encodeBase64(data: BytesLike): string { - return Buffer.from(getBytes(data)).toString("base64"); -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/data.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/utils/data.ts deleted file mode 100644 index c76d7992..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/data.ts +++ /dev/null @@ -1,200 +0,0 @@ -/** - * Some data helpers. - * - * - * @_subsection api/utils:Data Helpers [about-data] - */ -import { assert, assertArgument } from "./errors.js"; - -/** - * A [[HexString]] whose length is even, which ensures it is a valid - * representation of binary data. - */ -export type DataHexString = string; - -/** - * A string which is prefixed with ``0x`` and followed by any number - * of case-agnostic hexadecimal characters. - * - * It must match the regular expression ``/0x[0-9A-Fa-f]*\/``. - */ -export type HexString = string; - -/** - * An object that can be used to represent binary data. - */ -export type BytesLike = DataHexString | Uint8Array; - -function _getBytes(value: BytesLike, name?: string, copy?: boolean): Uint8Array { - if (value instanceof Uint8Array) { - if (copy) { return new Uint8Array(value); } - return value; - } - - if (typeof(value) === "string" && (value.length % 2) === 0 && - value.match(/^0x[0-9a-f]*$/i)) { - const result = new Uint8Array((value.length - 2) / 2); - let offset = 2; - for (let i = 0; i < result.length; i++) { - result[i] = parseInt(value.substring(offset, offset + 2), 16); - offset += 2; - } - return result; - } - - assertArgument(false, "invalid BytesLike value", name || "value", value); -} - -/** - * Get a typed Uint8Array for %%value%%. If already a Uint8Array - * the original %%value%% is returned; if a copy is required use - * [[getBytesCopy]]. - * - * @see: getBytesCopy - */ -export function getBytes(value: BytesLike, name?: string): Uint8Array { - return _getBytes(value, name, false); -} - -/** - * Get a typed Uint8Array for %%value%%, creating a copy if necessary - * to prevent any modifications of the returned value from being - * reflected elsewhere. - * - * @see: getBytes - */ -export function getBytesCopy(value: BytesLike, name?: string): Uint8Array { - return _getBytes(value, name, true); -} - - -/** - * Returns true if %%value%% is a valid [[HexString]]. - * - * If %%length%% is ``true`` or a //number//, it also checks that - * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//) - * bytes of data (e.g. ``0x1234`` is 2 bytes). - */ -export function isHexString(value: any, length?: number | boolean): value is `0x${ string }` { - if (typeof(value) !== "string" || !value.match(/^0x[0-9A-Fa-f]*$/)) { - return false - } - - if (typeof(length) === "number" && value.length !== 2 + 2 * length) { return false; } - if (length === true && (value.length % 2) !== 0) { return false; } - - return true; -} - -/** - * Returns true if %%value%% is a valid representation of arbitrary - * data (i.e. a valid [[DataHexString]] or a Uint8Array). - */ -export function isBytesLike(value: any): value is BytesLike { - return (isHexString(value, true) || (value instanceof Uint8Array)); -} - -const HexCharacters: string = "0123456789abcdef"; - -/** - * Returns a [[DataHexString]] representation of %%data%%. - */ -export function hexlify(data: BytesLike): string { - const bytes = getBytes(data); - - let result = "0x"; - for (let i = 0; i < bytes.length; i++) { - const v = bytes[i]; - result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f]; - } - return result; -} - -/** - * Returns a [[DataHexString]] by concatenating all values - * within %%data%%. - */ -export function concat(datas: ReadonlyArray): string { - return "0x" + datas.map((d) => hexlify(d).substring(2)).join(""); -} - -/** - * Returns the length of %%data%%, in bytes. - */ -export function dataLength(data: BytesLike): number { - if (isHexString(data, true)) { return (data.length - 2) / 2; } - return getBytes(data).length; -} - -/** - * Returns a [[DataHexString]] by slicing %%data%% from the %%start%% - * offset to the %%end%% offset. - * - * By default %%start%% is 0 and %%end%% is the length of %%data%%. - */ -export function dataSlice(data: BytesLike, start?: number, end?: number): string { - const bytes = getBytes(data); - if (end != null && end > bytes.length) { - assert(false, "cannot slice beyond data bounds", "BUFFER_OVERRUN", { - buffer: bytes, length: bytes.length, offset: end - }); - } - return hexlify(bytes.slice((start == null) ? 0: start, (end == null) ? bytes.length: end)); -} - -/** - * Return the [[DataHexString]] result by stripping all **leading** - ** zero bytes from %%data%%. - */ -export function stripZerosLeft(data: BytesLike): string { - let bytes = hexlify(data).substring(2); - while (bytes.startsWith("00")) { bytes = bytes.substring(2); } - return "0x" + bytes; -} - -function zeroPad(data: BytesLike, length: number, left: boolean): string { - const bytes = getBytes(data); - assert(length >= bytes.length, "padding exceeds data length", "BUFFER_OVERRUN", { - buffer: new Uint8Array(bytes), - length: length, - offset: length + 1 - }); - - const result = new Uint8Array(length); - result.fill(0); - if (left) { - result.set(bytes, length - bytes.length); - } else { - result.set(bytes, 0); - } - - return hexlify(result); -} - -/** - * Return the [[DataHexString]] of %%data%% padded on the **left** - * to %%length%% bytes. - * - * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is - * thrown. - * - * This pads data the same as **values** are in Solidity - * (e.g. ``uint128``). - */ -export function zeroPadValue(data: BytesLike, length: number): string { - return zeroPad(data, length, true); -} - -/** - * Return the [[DataHexString]] of %%data%% padded on the **right** - * to %%length%% bytes. - * - * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is - * thrown. - * - * This pads data the same as **bytes** are in Solidity - * (e.g. ``bytes16``). - */ -export function zeroPadBytes(data: BytesLike, length: number): string { - return zeroPad(data, length, false); -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/errors.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/utils/errors.ts deleted file mode 100644 index 8546d6bb..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/errors.ts +++ /dev/null @@ -1,797 +0,0 @@ -/** - * All errors in ethers include properties to ensure they are both - * human-readable (i.e. ``.message``) and machine-readable (i.e. ``.code``). - * - * The [[isError]] function can be used to check the error ``code`` and - * provide a type guard for the properties present on that error interface. - * - * @_section: api/utils/errors:Errors [about-errors] - */ - -import { version } from "../_version.js"; - -import { defineProperties } from "./properties.js"; - -import type { - TransactionRequest, TransactionReceipt, TransactionResponse -} from "../providers/index.js"; - -import type { FetchRequest, FetchResponse } from "./fetch.js"; - -/** - * An error may contain additional properties, but those must not - * conflict with any implicit properties. - */ -export type ErrorInfo = Omit & { shortMessage?: string }; - - -function stringify(value: any, seen?: Set): any { - if (value == null) { return "null"; } - - if (seen == null) { seen = new Set(); } - if (typeof(value) === "object") { - if (seen.has(value)) { return "[Circular]"; } - seen.add(value); - } - - if (Array.isArray(value)) { - return "[ " + (value.map((v) => stringify(v, seen))).join(", ") + " ]"; - } - - if (value instanceof Uint8Array) { - const HEX = "0123456789abcdef"; - let result = "0x"; - for (let i = 0; i < value.length; i++) { - result += HEX[value[i] >> 4]; - result += HEX[value[i] & 0xf]; - } - return result; - } - - if (typeof(value) === "object" && typeof(value.toJSON) === "function") { - return stringify(value.toJSON(), seen); - } - - switch (typeof(value)) { - case "boolean": case "number": case "symbol": - return value.toString(); - case "bigint": - return BigInt(value).toString(); - case "string": - return JSON.stringify(value); - case "object": { - const keys = Object.keys(value); - keys.sort(); - return "{ " + keys.map((k) => `${ stringify(k, seen) }: ${ stringify(value[k], seen) }`).join(", ") + " }"; - } - } - - return `[ COULD NOT SERIALIZE ]`; -} - -/** - * All errors emitted by ethers have an **ErrorCode** to help - * identify and coalesce errors to simplify programmatic analysis. - * - * Each **ErrorCode** is the %%code%% proerty of a coresponding - * [[EthersError]]. - * - * **Generic Errors** - * - * **``"UNKNOWN_ERROR"``** - see [[UnknownError]] - * - * **``"NOT_IMPLEMENTED"``** - see [[NotImplementedError]] - * - * **``"UNSUPPORTED_OPERATION"``** - see [[UnsupportedOperationError]] - * - * **``"NETWORK_ERROR"``** - see [[NetworkError]] - * - * **``"SERVER_ERROR"``** - see [[ServerError]] - * - * **``"TIMEOUT"``** - see [[TimeoutError]] - * - * **``"BAD_DATA"``** - see [[BadDataError]] - * - * **``"CANCELLED"``** - see [[CancelledError]] - * - * **Operational Errors** - * - * **``"BUFFER_OVERRUN"``** - see [[BufferOverrunError]] - * - * **``"NUMERIC_FAULT"``** - see [[NumericFaultError]] - * - * **Argument Errors** - * - * **``"INVALID_ARGUMENT"``** - see [[InvalidArgumentError]] - * - * **``"MISSING_ARGUMENT"``** - see [[MissingArgumentError]] - * - * **``"UNEXPECTED_ARGUMENT"``** - see [[UnexpectedArgumentError]] - * - * **``"VALUE_MISMATCH"``** - //unused// - * - * **Blockchain Errors** - * - * **``"CALL_EXCEPTION"``** - see [[CallExceptionError]] - * - * **``"INSUFFICIENT_FUNDS"``** - see [[InsufficientFundsError]] - * - * **``"NONCE_EXPIRED"``** - see [[NonceExpiredError]] - * - * **``"REPLACEMENT_UNDERPRICED"``** - see [[ReplacementUnderpricedError]] - * - * **``"TRANSACTION_REPLACED"``** - see [[TransactionReplacedError]] - * - * **``"UNCONFIGURED_NAME"``** - see [[UnconfiguredNameError]] - * - * **``"OFFCHAIN_FAULT"``** - see [[OffchainFaultError]] - * - * **User Interaction Errors** - * - * **``"ACTION_REJECTED"``** - see [[ActionRejectedError]] - */ -export type ErrorCode = - - // Generic Errors - "UNKNOWN_ERROR" | "NOT_IMPLEMENTED" | "UNSUPPORTED_OPERATION" | - "NETWORK_ERROR" | "SERVER_ERROR" | "TIMEOUT" | "BAD_DATA" | - "CANCELLED" | - - // Operational Errors - "BUFFER_OVERRUN" | "NUMERIC_FAULT" | - - // Argument Errors - "INVALID_ARGUMENT" | "MISSING_ARGUMENT" | "UNEXPECTED_ARGUMENT" | - "VALUE_MISMATCH" | - - // Blockchain Errors - "CALL_EXCEPTION" | "INSUFFICIENT_FUNDS" | "NONCE_EXPIRED" | - "REPLACEMENT_UNDERPRICED" | "TRANSACTION_REPLACED" | - "UNCONFIGURED_NAME" | "OFFCHAIN_FAULT" | - - // User Interaction - "ACTION_REJECTED" -; - -/** - * All errors in Ethers include properties to assist in - * machine-readable errors. - */ -export interface EthersError extends Error { - /** - * The string error code. - */ - code: ErrorCode; - - /** - * A short message describing the error, with minimal additional - * details. - */ - shortMessage: string; - - /** - * Additional info regarding the error that may be useful. - * - * This is generally helpful mostly for human-based debugging. - */ - info?: Record; - - /** - * Any related error. - */ - error?: Error; -} - -// Generic Errors - -/** - * This Error is a catch-all for when there is no way for Ethers to - * know what the underlying problem is. - */ -export interface UnknownError extends EthersError<"UNKNOWN_ERROR"> { - [ key: string ]: any; -} - -/** - * This Error is mostly used as a stub for functionality that is - * intended for the future, but is currently not implemented. - */ -export interface NotImplementedError extends EthersError<"NOT_IMPLEMENTED"> { - /** - * The attempted operation. - */ - operation: string; -} - -/** - * This Error indicates that the attempted operation is not supported. - * - * This could range from a specific JSON-RPC end-point not supporting - * a feature to a specific configuration of an object prohibiting the - * operation. - * - * For example, a [[Wallet]] with no connected [[Provider]] is unable - * to send a transaction. - */ -export interface UnsupportedOperationError extends EthersError<"UNSUPPORTED_OPERATION"> { - /** - * The attempted operation. - */ - operation: string; -} - -/** - * This Error indicates a problem connecting to a network. - */ -export interface NetworkError extends EthersError<"NETWORK_ERROR"> { - /** - * The network event. - */ - event: string; -} - -/** - * This Error indicates there was a problem fetching a resource from - * a server. - */ -export interface ServerError extends EthersError<"SERVER_ERROR"> { - /** - * The requested resource. - */ - request: FetchRequest | string; - - /** - * The response received from the server, if available. - */ - response?: FetchResponse; -} - -/** - * This Error indicates that the timeout duration has expired and - * that the operation has been implicitly cancelled. - * - * The side-effect of the operation may still occur, as this - * generally means a request has been sent and there has simply - * been no response to indicate whether it was processed or not. - */ -export interface TimeoutError extends EthersError<"TIMEOUT"> { - /** - * The attempted operation. - */ - operation: string; - - /** - * The reason. - */ - reason: string; - - /** - * The resource request, if available. - */ - request?: FetchRequest; -} - -/** - * This Error indicates that a provided set of data cannot - * be correctly interpreted. - */ -export interface BadDataError extends EthersError<"BAD_DATA"> { - /** - * The data. - */ - value: any; -} - -/** - * This Error indicates that the operation was cancelled by a - * programmatic call, for example to ``cancel()``. - */ -export interface CancelledError extends EthersError<"CANCELLED"> { -} - - -// Operational Errors - -/** - * This Error indicates an attempt was made to read outside the bounds - * of protected data. - * - * Most operations in Ethers are protected by bounds checks, to mitigate - * exploits when parsing data. - */ -export interface BufferOverrunError extends EthersError<"BUFFER_OVERRUN"> { - /** - * The buffer that was overrun. - */ - buffer: Uint8Array; - - /** - * The length of the buffer. - */ - length: number; - - /** - * The offset that was requested. - */ - offset: number; -} - -/** - * This Error indicates an operation which would result in incorrect - * arithmetic output has occurred. - * - * For example, trying to divide by zero or using a ``uint8`` to store - * a negative value. - */ -export interface NumericFaultError extends EthersError<"NUMERIC_FAULT"> { - /** - * The attempted operation. - */ - operation: string; - - /** - * The fault reported. - */ - fault: string; - - /** - * The value the operation was attempted against. - */ - value: any; -} - - -// Argument Errors - -/** - * This Error indicates an incorrect type or value was passed to - * a function or method. - */ -export interface InvalidArgumentError extends EthersError<"INVALID_ARGUMENT"> { - /** - * The name of the argument. - */ - argument: string; - - /** - * The value that was provided. - */ - value: any; - - info?: Record -} - -/** - * This Error indicates there were too few arguments were provided. - */ -export interface MissingArgumentError extends EthersError<"MISSING_ARGUMENT"> { - /** - * The number of arguments received. - */ - count: number; - - /** - * The number of arguments expected. - */ - expectedCount: number; -} - -/** - * This Error indicates too many arguments were provided. - */ -export interface UnexpectedArgumentError extends EthersError<"UNEXPECTED_ARGUMENT"> { - /** - * The number of arguments received. - */ - count: number; - - /** - * The number of arguments expected. - */ - expectedCount: number; -} - - -// Blockchain Errors - -/** - * The action that resulted in the call exception. - */ -export type CallExceptionAction = "call" | "estimateGas" | "getTransactionResult" | "sendTransaction" | "unknown"; - -/** - * The related transaction that caused the error. - */ -export type CallExceptionTransaction = { - to: null | string; - from?: string; - data: string; -}; - -/** - * This **Error** indicates a transaction reverted. - */ -export interface CallExceptionError extends EthersError<"CALL_EXCEPTION"> { - - /** - * The action being performed when the revert was encountered. - */ - action: CallExceptionAction; - - /** - * The revert data returned. - */ - data: null | string; - - /** - * A human-readable representation of data, if possible. - */ - reason: null | string; - - /** - * The transaction that triggered the exception. - */ - transaction: CallExceptionTransaction, - - /** - * The contract invocation details, if available. - */ - invocation: null | { - method: string; - signature: string; - args: Array; - } - - /** - * The built-in or custom revert error, if available - */ - revert: null | { - signature: string; - name: string; - args: Array; - } - - /** - * If the error occurred in a transaction that was mined - * (with a status of ``0``), this is the receipt. - */ - receipt?: TransactionReceipt; // @TODO: in v7, make this `null | TransactionReceipt` -} - - -/** - * The sending account has insufficient funds to cover the - * entire transaction cost. - */ -export interface InsufficientFundsError extends EthersError<"INSUFFICIENT_FUNDS"> { - /** - * The transaction. - */ - transaction: TransactionRequest; -} - -/** - * The sending account has already used this nonce in a - * transaction that has been included. - */ -export interface NonceExpiredError extends EthersError<"NONCE_EXPIRED"> { - /** - * The transaction. - */ - transaction: TransactionRequest; -} - -/** - * A CCIP-read exception, which cannot be recovered from or - * be further processed. - */ -export interface OffchainFaultError extends EthersError<"OFFCHAIN_FAULT"> { - /** - * The transaction. - */ - transaction?: TransactionRequest; - - /** - * The reason the CCIP-read failed. - */ - reason: string; -} - -/** - * An attempt was made to replace a transaction, but with an - * insufficient additional fee to afford evicting the old - * transaction from the memory pool. - */ -export interface ReplacementUnderpricedError extends EthersError<"REPLACEMENT_UNDERPRICED"> { - /** - * The transaction. - */ - transaction: TransactionRequest; -} - -/** - * A pending transaction was replaced by another. - */ -export interface TransactionReplacedError extends EthersError<"TRANSACTION_REPLACED"> { - /** - * If the transaction was cancelled, such that the original - * effects of the transaction cannot be assured. - */ - cancelled: boolean; - - /** - * The reason the transaction was replaced. - */ - reason: "repriced" | "cancelled" | "replaced"; - - /** - * The hash of the replaced transaction. - */ - hash: string; - - /** - * The transaction that replaced the transaction. - */ - replacement: TransactionResponse; - - /** - * The receipt of the transaction that replace the transaction. - */ - receipt: TransactionReceipt; -} - -/** - * This Error indicates an ENS name was used, but the name has not - * been configured. - * - * This could indicate an ENS name is unowned or that the current - * address being pointed to is the [[ZeroAddress]]. - */ -export interface UnconfiguredNameError extends EthersError<"UNCONFIGURED_NAME"> { - /** - * The ENS name that was requested - */ - value: string; -} - -/** - * This Error indicates a request was rejected by the user. - * - * In most clients (such as MetaMask), when an operation requires user - * authorization (such as ``signer.sendTransaction``), the client - * presents a dialog box to the user. If the user denies the request - * this error is thrown. - */ -export interface ActionRejectedError extends EthersError<"ACTION_REJECTED"> { - /** - * The requested action. - */ - action: "requestAccess" | "sendTransaction" | "signMessage" | "signTransaction" | "signTypedData" | "unknown", - - /** - * The reason the action was rejected. - * - * If there is already a pending request, some clients may indicate - * there is already a ``"pending"`` action. This prevents an app - * from spamming the user. - */ - reason: "expired" | "rejected" | "pending" -} - -// Coding; converts an ErrorCode its Typed Error - -/** - * A conditional type that transforms the [[ErrorCode]] T into - * its EthersError type. - * - * @flatworm-skip-docs - */ -export type CodedEthersError = - T extends "UNKNOWN_ERROR" ? UnknownError: - T extends "NOT_IMPLEMENTED" ? NotImplementedError: - T extends "UNSUPPORTED_OPERATION" ? UnsupportedOperationError: - T extends "NETWORK_ERROR" ? NetworkError: - T extends "SERVER_ERROR" ? ServerError: - T extends "TIMEOUT" ? TimeoutError: - T extends "BAD_DATA" ? BadDataError: - T extends "CANCELLED" ? CancelledError: - - T extends "BUFFER_OVERRUN" ? BufferOverrunError: - T extends "NUMERIC_FAULT" ? NumericFaultError: - - T extends "INVALID_ARGUMENT" ? InvalidArgumentError: - T extends "MISSING_ARGUMENT" ? MissingArgumentError: - T extends "UNEXPECTED_ARGUMENT" ? UnexpectedArgumentError: - - T extends "CALL_EXCEPTION" ? CallExceptionError: - T extends "INSUFFICIENT_FUNDS" ? InsufficientFundsError: - T extends "NONCE_EXPIRED" ? NonceExpiredError: - T extends "OFFCHAIN_FAULT" ? OffchainFaultError: - T extends "REPLACEMENT_UNDERPRICED" ? ReplacementUnderpricedError: - T extends "TRANSACTION_REPLACED" ? TransactionReplacedError: - T extends "UNCONFIGURED_NAME" ? UnconfiguredNameError: - - T extends "ACTION_REJECTED" ? ActionRejectedError: - - never; - - - -/** - * Returns true if the %%error%% matches an error thrown by ethers - * that matches the error %%code%%. - * - * In TypeScript environments, this can be used to check that %%error%% - * matches an EthersError type, which means the expected properties will - * be set. - * - * @See [ErrorCodes](api:ErrorCode) - * @example - * try { - * // code.... - * } catch (e) { - * if (isError(e, "CALL_EXCEPTION")) { - * // The Type Guard has validated this object - * console.log(e.data); - * } - * } - */ -export function isError>(error: any, code: K): error is T { - return (error && (error).code === code); -} - -/** - * Returns true if %%error%% is a [[CallExceptionError]. - */ -export function isCallException(error: any): error is CallExceptionError { - return isError(error, "CALL_EXCEPTION"); -} - -/** - * Returns a new Error configured to the format ethers emits errors, with - * the %%message%%, [[api:ErrorCode]] %%code%% and additional properties - * for the corresponding EthersError. - * - * Each error in ethers includes the version of ethers, a - * machine-readable [[ErrorCode]], and depending on %%code%%, additional - * required properties. The error message will also include the %%message%%, - * ethers version, %%code%% and all additional properties, serialized. - */ -export function makeError>(message: string, code: K, info?: ErrorInfo): T { - let shortMessage = message; - - { - const details: Array = []; - if (info) { - if ("message" in info || "code" in info || "name" in info) { - throw new Error(`value will overwrite populated values: ${ stringify(info) }`); - } - for (const key in info) { - if (key === "shortMessage") { continue; } - const value = (info[>key]); -// try { - details.push(key + "=" + stringify(value)); -// } catch (error: any) { -// console.log("MMM", error.message); -// details.push(key + "=[could not serialize object]"); -// } - } - } - details.push(`code=${ code }`); - details.push(`version=${ version }`); - - if (details.length) { - message += " (" + details.join(", ") + ")"; - } - } - - let error; - switch (code) { - case "INVALID_ARGUMENT": - error = new TypeError(message); - break; - case "NUMERIC_FAULT": - case "BUFFER_OVERRUN": - error = new RangeError(message); - break; - default: - error = new Error(message); - } - - defineProperties(error, { code }); - - if (info) { Object.assign(error, info); } - - if ((error).shortMessage == null) { - defineProperties(error, { shortMessage }); - } - - return error; -} - -/** - * Throws an EthersError with %%message%%, %%code%% and additional error - * %%info%% when %%check%% is falsish.. - * - * @see [[api:makeError]] - */ -export function assert>(check: unknown, message: string, code: K, info?: ErrorInfo): asserts check { - if (!check) { throw makeError(message, code, info); } -} - - -/** - * A simple helper to simply ensuring provided arguments match expected - * constraints, throwing if not. - * - * In TypeScript environments, the %%check%% has been asserted true, so - * any further code does not need additional compile-time checks. - */ -export function assertArgument(check: unknown, message: string, name: string, value: unknown): asserts check { - assert(check, message, "INVALID_ARGUMENT", { argument: name, value: value }); -} - -export function assertArgumentCount(count: number, expectedCount: number, message?: string): void { - if (message == null) { message = ""; } - if (message) { message = ": " + message; } - - assert(count >= expectedCount, "missing argument" + message, "MISSING_ARGUMENT", { - count: count, - expectedCount: expectedCount - }); - - assert(count <= expectedCount, "too many arguments" + message, "UNEXPECTED_ARGUMENT", { - count: count, - expectedCount: expectedCount - }); -} - -const _normalizeForms = ["NFD", "NFC", "NFKD", "NFKC"].reduce((accum, form) => { - try { - // General test for normalize - /* c8 ignore start */ - if ("test".normalize(form) !== "test") { throw new Error("bad"); }; - /* c8 ignore stop */ - - if (form === "NFD") { - const check = String.fromCharCode(0xe9).normalize("NFD"); - const expected = String.fromCharCode(0x65, 0x0301) - /* c8 ignore start */ - if (check !== expected) { throw new Error("broken") } - /* c8 ignore stop */ - } - - accum.push(form); - } catch(error) { } - - return accum; -}, >[]); - -/** - * Throws if the normalization %%form%% is not supported. - */ -export function assertNormalize(form: string): void { - assert(_normalizeForms.indexOf(form) >= 0, "platform missing String.prototype.normalize", "UNSUPPORTED_OPERATION", { - operation: "String.prototype.normalize", info: { form } - }); -} - -/** - * Many classes use file-scoped values to guard the constructor, - * making it effectively private. This facilitates that pattern - * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%, - * throwing if not, indicating the %%className%% if provided. - */ -export function assertPrivate(givenGuard: any, guard: any, className?: string): void { - if (className == null) { className = ""; } - if (givenGuard !== guard) { - let method = className, operation = "new"; - if (className) { - method += "."; - operation += " " + className; - } - assert(false, `private constructor; use ${ method }from* methods`, "UNSUPPORTED_OPERATION", { - operation - }); - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/events.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/utils/events.ts deleted file mode 100644 index 532cb404..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/events.ts +++ /dev/null @@ -1,105 +0,0 @@ -/** - * Events allow for applications to use the observer pattern, which - * allows subscribing and publishing events, outside the normal - * execution paths. - * - * @_section api/utils/events:Events [about-events] - */ -import { defineProperties } from "./properties.js"; - -/** - * A callback function called when a an event is triggered. - */ -export type Listener = (...args: Array) => void; - -/** - * An **EventEmitterable** behaves similar to an EventEmitter - * except provides async access to its methods. - * - * An EventEmitter implements the observer pattern. - */ -export interface EventEmitterable { - /** - * Registers a %%listener%% that is called whenever the - * %%event%% occurs until unregistered. - */ - on(event: T, listener: Listener): Promise; - - /** - * Registers a %%listener%% that is called the next time - * %%event%% occurs. - */ - once(event: T, listener: Listener): Promise; - - /** - * Triggers each listener for %%event%% with the %%args%%. - */ - emit(event: T, ...args: Array): Promise; - - /** - * Resolves to the number of listeners for %%event%%. - */ - listenerCount(event?: T): Promise; - - /** - * Resolves to the listeners for %%event%%. - */ - listeners(event?: T): Promise>; - - /** - * Unregister the %%listener%% for %%event%%. If %%listener%% - * is unspecified, all listeners are unregistered. - */ - off(event: T, listener?: Listener): Promise; - - /** - * Unregister all listeners for %%event%%. - */ - removeAllListeners(event?: T): Promise; - - /** - * Alias for [[on]]. - */ - addListener(event: T, listener: Listener): Promise; - - /** - * Alias for [[off]]. - */ - removeListener(event: T, listener: Listener): Promise; -} - -/** - * When an [[EventEmitterable]] triggers a [[Listener]], the - * callback always ahas one additional argument passed, which is - * an **EventPayload**. - */ -export class EventPayload { - /** - * The event filter. - */ - readonly filter!: T; - - /** - * The **EventEmitterable**. - */ - readonly emitter!: EventEmitterable; - - readonly #listener: null | Listener; - - /** - * Create a new **EventPayload** for %%emitter%% with - * the %%listener%% and for %%filter%%. - */ - constructor(emitter: EventEmitterable, listener: null | Listener, filter: T) { - this.#listener = listener; - defineProperties>(this, { emitter, filter }); - } - - /** - * Unregister the triggered listener for future events. - */ - async removeListener(): Promise { - if (this.#listener == null) { return; } - await this.emitter.off(this.filter, this.#listener); - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/fetch.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/utils/fetch.ts deleted file mode 100644 index 93c1a062..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/fetch.ts +++ /dev/null @@ -1,970 +0,0 @@ -/** - * Fetching content from the web is environment-specific, so Ethers - * provides an abstraction that each environment can implement to provide - * this service. - * - * On [Node.js](link-node), the ``http`` and ``https`` libs are used to - * create a request object, register event listeners and process data - * and populate the [[FetchResponse]]. - * - * In a browser, the [DOM fetch](link-js-fetch) is used, and the resulting - * ``Promise`` is waited on to retrieve the payload. - * - * The [[FetchRequest]] is responsible for handling many common situations, - * such as redirects, server throttling, authentication, etc. - * - * It also handles common gateways, such as IPFS and data URIs. - * - * @_section api/utils/fetching:Fetching Web Content [about-fetch] - */ -import { decodeBase64, encodeBase64 } from "./base64.js"; -import { hexlify } from "./data.js"; -import { assert, assertArgument } from "./errors.js"; -import { defineProperties } from "./properties.js"; -import { toUtf8Bytes, toUtf8String } from "./utf8.js"; - -import { createGetUrl } from "./geturl.js"; - -/** - * An environment's implementation of ``getUrl`` must return this type. - */ -export type GetUrlResponse = { - statusCode: number, - statusMessage: string, - headers: Record, - body: null | Uint8Array -}; - -/** - * This can be used to control how throttling is handled in - * [[FetchRequest-setThrottleParams]]. - */ -export type FetchThrottleParams = { - maxAttempts?: number; - slotInterval?: number; -}; - -/** - * Called before any network request, allowing updated headers (e.g. Bearer tokens), etc. - */ -export type FetchPreflightFunc = (req: FetchRequest) => Promise; - -/** - * Called on the response, allowing client-based throttling logic or post-processing. - */ -export type FetchProcessFunc = (req: FetchRequest, resp: FetchResponse) => Promise; - -/** - * Called prior to each retry; return true to retry, false to abort. - */ -export type FetchRetryFunc = (req: FetchRequest, resp: FetchResponse, attempt: number) => Promise; - -/** - * Called on Gateway URLs. - */ -export type FetchGatewayFunc = (url: string, signal?: FetchCancelSignal) => Promise; - -/** - * Used to perform a fetch; use this to override the underlying network - * fetch layer. In NodeJS, the default uses the "http" and "https" libraries - * and in the browser ``fetch`` is used. If you wish to use Axios, this is - * how you would register it. - */ -export type FetchGetUrlFunc = (req: FetchRequest, signal?: FetchCancelSignal) => Promise; - - -const MAX_ATTEMPTS = 12; -const SLOT_INTERVAL = 250; - -// The global FetchGetUrlFunc implementation. -let defaultGetUrlFunc: FetchGetUrlFunc = createGetUrl(); - -const reData = new RegExp("^data:([^;:]*)?(;base64)?,(.*)$", "i"); -const reIpfs = new RegExp("^ipfs:/\/(ipfs/)?(.*)$", "i"); - -// If locked, new Gateways cannot be added -let locked = false; - -// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs -async function dataGatewayFunc(url: string, signal?: FetchCancelSignal): Promise { - try { - const match = url.match(reData); - if (!match) { throw new Error("invalid data"); } - return new FetchResponse(200, "OK", { - "content-type": (match[1] || "text/plain"), - }, (match[2] ? decodeBase64(match[3]): unpercent(match[3]))); - } catch (error) { - return new FetchResponse(599, "BAD REQUEST (invalid data: URI)", { }, null, new FetchRequest(url)); - } -} - -/** - * Returns a [[FetchGatewayFunc]] for fetching content from a standard - * IPFS gateway hosted at %%baseUrl%%. - */ -function getIpfsGatewayFunc(baseUrl: string): FetchGatewayFunc { - async function gatewayIpfs(url: string, signal?: FetchCancelSignal): Promise { - try { - const match = url.match(reIpfs); - if (!match) { throw new Error("invalid link"); } - return new FetchRequest(`${ baseUrl }${ match[2] }`); - } catch (error) { - return new FetchResponse(599, "BAD REQUEST (invalid IPFS URI)", { }, null, new FetchRequest(url)); - } - } - - return gatewayIpfs; -} - -const Gateways: Record = { - "data": dataGatewayFunc, - "ipfs": getIpfsGatewayFunc("https:/\/gateway.ipfs.io/ipfs/") -}; - -const fetchSignals: WeakMap void> = new WeakMap(); - -/** - * @_ignore - */ -export class FetchCancelSignal { - #listeners: Array<() => void>; - #cancelled: boolean; - - constructor(request: FetchRequest) { - this.#listeners = [ ]; - this.#cancelled = false; - - fetchSignals.set(request, () => { - if (this.#cancelled) { return; } - this.#cancelled = true; - - for (const listener of this.#listeners) { - setTimeout(() => { listener(); }, 0); - } - this.#listeners = [ ]; - }); - } - - addListener(listener: () => void): void { - assert(!this.#cancelled, "singal already cancelled", "UNSUPPORTED_OPERATION", { - operation: "fetchCancelSignal.addCancelListener" - }); - this.#listeners.push(listener); - } - - get cancelled(): boolean { return this.#cancelled; } - - checkSignal(): void { - assert(!this.cancelled, "cancelled", "CANCELLED", { }); - } -} - -// Check the signal, throwing if it is cancelled -function checkSignal(signal?: FetchCancelSignal): FetchCancelSignal { - if (signal == null) { throw new Error("missing signal; should not happen"); } - signal.checkSignal(); - return signal; -} - -/** - * Represents a request for a resource using a URI. - * - * By default, the supported schemes are ``HTTP``, ``HTTPS``, ``data:``, - * and ``IPFS:``. - * - * Additional schemes can be added globally using [[registerGateway]]. - * - * @example: - * req = new FetchRequest("https://www.ricmoo.com") - * resp = await req.send() - * resp.body.length - * //_result: - */ -export class FetchRequest implements Iterable<[ key: string, value: string ]> { - #allowInsecure: boolean; - #gzip: boolean; - #headers: Record; - #method: string; - #timeout: number; - #url: string; - - #body?: Uint8Array; - #bodyType?: string; - #creds?: string; - - // Hooks - #preflight?: null | FetchPreflightFunc; - #process?: null | FetchProcessFunc; - #retry?: null | FetchRetryFunc; - - #signal?: FetchCancelSignal; - - #throttle: Required; - - #getUrlFunc: null | FetchGetUrlFunc; - - /** - * The fetch URL to request. - */ - get url(): string { return this.#url; } - set url(url: string) { - this.#url = String(url); - } - - /** - * The fetch body, if any, to send as the request body. //(default: null)// - * - * When setting a body, the intrinsic ``Content-Type`` is automatically - * set and will be used if **not overridden** by setting a custom - * header. - * - * If %%body%% is null, the body is cleared (along with the - * intrinsic ``Content-Type``). - * - * If %%body%% is a string, the intrinsic ``Content-Type`` is set to - * ``text/plain``. - * - * If %%body%% is a Uint8Array, the intrinsic ``Content-Type`` is set to - * ``application/octet-stream``. - * - * If %%body%% is any other object, the intrinsic ``Content-Type`` is - * set to ``application/json``. - */ - get body(): null | Uint8Array { - if (this.#body == null) { return null; } - return new Uint8Array(this.#body); - } - set body(body: null | string | Readonly | Readonly) { - if (body == null) { - this.#body = undefined; - this.#bodyType = undefined; - } else if (typeof(body) === "string") { - this.#body = toUtf8Bytes(body); - this.#bodyType = "text/plain"; - } else if (body instanceof Uint8Array) { - this.#body = body; - this.#bodyType = "application/octet-stream"; - } else if (typeof(body) === "object") { - this.#body = toUtf8Bytes(JSON.stringify(body)); - this.#bodyType = "application/json"; - } else { - throw new Error("invalid body"); - } - } - - /** - * Returns true if the request has a body. - */ - hasBody(): this is (FetchRequest & { body: Uint8Array }) { - return (this.#body != null); - } - - /** - * The HTTP method to use when requesting the URI. If no method - * has been explicitly set, then ``GET`` is used if the body is - * null and ``POST`` otherwise. - */ - get method(): string { - if (this.#method) { return this.#method; } - if (this.hasBody()) { return "POST"; } - return "GET"; - } - set method(method: null | string) { - if (method == null) { method = ""; } - this.#method = String(method).toUpperCase(); - } - - /** - * The headers that will be used when requesting the URI. All - * keys are lower-case. - * - * This object is a copy, so any changes will **NOT** be reflected - * in the ``FetchRequest``. - * - * To set a header entry, use the ``setHeader`` method. - */ - get headers(): Record { - const headers = Object.assign({ }, this.#headers); - - if (this.#creds) { - headers["authorization"] = `Basic ${ encodeBase64(toUtf8Bytes(this.#creds)) }`; - }; - - if (this.allowGzip) { - headers["accept-encoding"] = "gzip"; - } - - if (headers["content-type"] == null && this.#bodyType) { - headers["content-type"] = this.#bodyType; - } - if (this.body) { headers["content-length"] = String(this.body.length); } - - return headers; - } - - /** - * Get the header for %%key%%, ignoring case. - */ - getHeader(key: string): string { - return this.headers[key.toLowerCase()]; - } - - /** - * Set the header for %%key%% to %%value%%. All values are coerced - * to a string. - */ - setHeader(key: string, value: string | number): void { - this.#headers[String(key).toLowerCase()] = String(value); - } - - /** - * Clear all headers, resetting all intrinsic headers. - */ - clearHeaders(): void { - this.#headers = { }; - } - - [Symbol.iterator](): Iterator<[ key: string, value: string ]> { - const headers = this.headers; - const keys = Object.keys(headers); - let index = 0; - return { - next: () => { - if (index < keys.length) { - const key = keys[index++]; - return { - value: [ key, headers[key] ], done: false - } - } - return { value: undefined, done: true }; - } - }; - } - - /** - * The value that will be sent for the ``Authorization`` header. - * - * To set the credentials, use the ``setCredentials`` method. - */ - get credentials(): null | string { - return this.#creds || null; - } - - /** - * Sets an ``Authorization`` for %%username%% with %%password%%. - */ - setCredentials(username: string, password: string): void { - assertArgument(!username.match(/:/), "invalid basic authentication username", "username", "[REDACTED]"); - this.#creds = `${ username }:${ password }`; - } - - /** - * Enable and request gzip-encoded responses. The response will - * automatically be decompressed. //(default: true)// - */ - get allowGzip(): boolean { - return this.#gzip; - } - set allowGzip(value: boolean) { - this.#gzip = !!value; - } - - /** - * Allow ``Authentication`` credentials to be sent over insecure - * channels. //(default: false)// - */ - get allowInsecureAuthentication(): boolean { - return !!this.#allowInsecure; - } - set allowInsecureAuthentication(value: boolean) { - this.#allowInsecure = !!value; - } - - /** - * The timeout (in milliseconds) to wait for a complete response. - * //(default: 5 minutes)// - */ - get timeout(): number { return this.#timeout; } - set timeout(timeout: number) { - assertArgument(timeout >= 0, "timeout must be non-zero", "timeout", timeout); - this.#timeout = timeout; - } - - /** - * This function is called prior to each request, for example - * during a redirection or retry in case of server throttling. - * - * This offers an opportunity to populate headers or update - * content before sending a request. - */ - get preflightFunc(): null | FetchPreflightFunc { - return this.#preflight || null; - } - set preflightFunc(preflight: null | FetchPreflightFunc) { - this.#preflight = preflight; - } - - /** - * This function is called after each response, offering an - * opportunity to provide client-level throttling or updating - * response data. - * - * Any error thrown in this causes the ``send()`` to throw. - * - * To schedule a retry attempt (assuming the maximum retry limit - * has not been reached), use [[response.throwThrottleError]]. - */ - get processFunc(): null | FetchProcessFunc { - return this.#process || null; - } - set processFunc(process: null | FetchProcessFunc) { - this.#process = process; - } - - /** - * This function is called on each retry attempt. - */ - get retryFunc(): null | FetchRetryFunc { - return this.#retry || null; - } - set retryFunc(retry: null | FetchRetryFunc) { - this.#retry = retry; - } - - /** - * This function is called to fetch content from HTTP and - * HTTPS URLs and is platform specific (e.g. nodejs vs - * browsers). - * - * This is by default the currently registered global getUrl - * function, which can be changed using [[registerGetUrl]]. - * If this has been set, setting is to ``null`` will cause - * this FetchRequest (and any future clones) to revert back to - * using the currently registered global getUrl function. - * - * Setting this is generally not necessary, but may be useful - * for developers that wish to intercept requests or to - * configurege a proxy or other agent. - */ - get getUrlFunc(): FetchGetUrlFunc { - return this.#getUrlFunc || defaultGetUrlFunc; - } - set getUrlFunc(value: null | FetchGetUrlFunc) { - this.#getUrlFunc = value; - } - - /** - * Create a new FetchRequest instance with default values. - * - * Once created, each property may be set before issuing a - * ``.send()`` to make the request. - */ - constructor(url: string) { - this.#url = String(url); - - this.#allowInsecure = false; - this.#gzip = true; - this.#headers = { }; - this.#method = ""; - this.#timeout = 300000; - - this.#throttle = { - slotInterval: SLOT_INTERVAL, - maxAttempts: MAX_ATTEMPTS - }; - - this.#getUrlFunc = null; - } - - toString(): string { - return ``; - } - - /** - * Update the throttle parameters used to determine maximum - * attempts and exponential-backoff properties. - */ - setThrottleParams(params: FetchThrottleParams): void { - if (params.slotInterval != null) { - this.#throttle.slotInterval = params.slotInterval; - } - if (params.maxAttempts != null) { - this.#throttle.maxAttempts = params.maxAttempts; - } - } - - async #send(attempt: number, expires: number, delay: number, _request: FetchRequest, _response: FetchResponse): Promise { - if (attempt >= this.#throttle.maxAttempts) { - return _response.makeServerError("exceeded maximum retry limit"); - } - - assert(getTime() <= expires, "timeout", "TIMEOUT", { - operation: "request.send", reason: "timeout", request: _request - }); - - if (delay > 0) { await wait(delay); } - - let req = this.clone(); - const scheme = (req.url.split(":")[0] || "").toLowerCase(); - - // Process any Gateways - if (scheme in Gateways) { - const result = await Gateways[scheme](req.url, checkSignal(_request.#signal)); - if (result instanceof FetchResponse) { - let response = result; - - if (this.processFunc) { - checkSignal(_request.#signal); - try { - response = await this.processFunc(req, response); - } catch (error: any) { - - // Something went wrong during processing; throw a 5xx server error - if (error.throttle == null || typeof(error.stall) !== "number") { - response.makeServerError("error in post-processing function", error).assertOk(); - } - - // Ignore throttling - } - } - - return response; - } - req = result; - } - - // We have a preflight function; update the request - if (this.preflightFunc) { req = await this.preflightFunc(req); } - - const resp = await this.getUrlFunc(req, checkSignal(_request.#signal)); - let response = new FetchResponse(resp.statusCode, resp.statusMessage, resp.headers, resp.body, _request); - - if (response.statusCode === 301 || response.statusCode === 302) { - - // Redirect - try { - const location = response.headers.location || ""; - return req.redirect(location).#send(attempt + 1, expires, 0, _request, response); - } catch (error) { } - - // Things won't get any better on another attempt; abort - return response; - - } else if (response.statusCode === 429) { - - // Throttle - if (this.retryFunc == null || (await this.retryFunc(req, response, attempt))) { - const retryAfter = response.headers["retry-after"]; - let delay = this.#throttle.slotInterval * Math.trunc(Math.random() * Math.pow(2, attempt)); - if (typeof(retryAfter) === "string" && retryAfter.match(/^[1-9][0-9]*$/)) { - delay = parseInt(retryAfter); - } - return req.clone().#send(attempt + 1, expires, delay, _request, response); - } - } - - if (this.processFunc) { - checkSignal(_request.#signal); - try { - response = await this.processFunc(req, response); - } catch (error: any) { - - // Something went wrong during processing; throw a 5xx server error - if (error.throttle == null || typeof(error.stall) !== "number") { - response.makeServerError("error in post-processing function", error).assertOk(); - } - - // Throttle - let delay = this.#throttle.slotInterval * Math.trunc(Math.random() * Math.pow(2, attempt));; - if (error.stall >= 0) { delay = error.stall; } - - return req.clone().#send(attempt + 1, expires, delay, _request, response); - } - } - - return response; - } - - /** - * Resolves to the response by sending the request. - */ - send(): Promise { - assert(this.#signal == null, "request already sent", "UNSUPPORTED_OPERATION", { operation: "fetchRequest.send" }); - this.#signal = new FetchCancelSignal(this); - return this.#send(0, getTime() + this.timeout, 0, this, new FetchResponse(0, "", { }, null, this)); - } - - /** - * Cancels the inflight response, causing a ``CANCELLED`` - * error to be rejected from the [[send]]. - */ - cancel(): void { - assert(this.#signal != null, "request has not been sent", "UNSUPPORTED_OPERATION", { operation: "fetchRequest.cancel" }); - const signal = fetchSignals.get(this); - if (!signal) { throw new Error("missing signal; should not happen"); } - signal(); - } - - /** - * Returns a new [[FetchRequest]] that represents the redirection - * to %%location%%. - */ - redirect(location: string): FetchRequest { - // Redirection; for now we only support absolute locations - const current = this.url.split(":")[0].toLowerCase(); - const target = location.split(":")[0].toLowerCase(); - - // Don't allow redirecting: - // - non-GET requests - // - downgrading the security (e.g. https => http) - // - to non-HTTP (or non-HTTPS) protocols [this could be relaxed?] - assert(this.method === "GET" && (current !== "https" || target !== "http") && location.match(/^https?:/), `unsupported redirect`, "UNSUPPORTED_OPERATION", { - operation: `redirect(${ this.method } ${ JSON.stringify(this.url) } => ${ JSON.stringify(location) })` - }); - - // Create a copy of this request, with a new URL - const req = new FetchRequest(location); - req.method = "GET"; - req.allowGzip = this.allowGzip; - req.timeout = this.timeout; - req.#headers = Object.assign({ }, this.#headers); - if (this.#body) { req.#body = new Uint8Array(this.#body); } - req.#bodyType = this.#bodyType; - - // Do not forward credentials unless on the same domain; only absolute - //req.allowInsecure = false; - // paths are currently supported; may want a way to specify to forward? - //setStore(req.#props, "creds", getStore(this.#pros, "creds")); - - return req; - } - - /** - * Create a new copy of this request. - */ - clone(): FetchRequest { - const clone = new FetchRequest(this.url); - - // Preserve "default method" (i.e. null) - clone.#method = this.#method; - - // Preserve "default body" with type, copying the Uint8Array is present - if (this.#body) { clone.#body = this.#body; } - clone.#bodyType = this.#bodyType; - - // Preserve "default headers" - clone.#headers = Object.assign({ }, this.#headers); - - // Credentials is readonly, so we copy internally - clone.#creds = this.#creds; - - if (this.allowGzip) { clone.allowGzip = true; } - - clone.timeout = this.timeout; - if (this.allowInsecureAuthentication) { clone.allowInsecureAuthentication = true; } - - clone.#preflight = this.#preflight; - clone.#process = this.#process; - clone.#retry = this.#retry; - - clone.#throttle = Object.assign({ }, this.#throttle); - - clone.#getUrlFunc = this.#getUrlFunc; - - return clone; - } - - /** - * Locks all static configuration for gateways and FetchGetUrlFunc - * registration. - */ - static lockConfig(): void { - locked = true; - } - - /** - * Get the current Gateway function for %%scheme%%. - */ - static getGateway(scheme: string): null | FetchGatewayFunc { - return Gateways[scheme.toLowerCase()] || null; - } - - /** - * Use the %%func%% when fetching URIs using %%scheme%%. - * - * This method affects all requests globally. - * - * If [[lockConfig]] has been called, no change is made and this - * throws. - */ - static registerGateway(scheme: string, func: FetchGatewayFunc): void { - scheme = scheme.toLowerCase(); - if (scheme === "http" || scheme === "https") { - throw new Error(`cannot intercept ${ scheme }; use registerGetUrl`); - } - if (locked) { throw new Error("gateways locked"); } - Gateways[scheme] = func; - } - - /** - * Use %%getUrl%% when fetching URIs over HTTP and HTTPS requests. - * - * This method affects all requests globally. - * - * If [[lockConfig]] has been called, no change is made and this - * throws. - */ - static registerGetUrl(getUrl: FetchGetUrlFunc): void { - if (locked) { throw new Error("gateways locked"); } - defaultGetUrlFunc = getUrl; - } - - /** - * Creates a getUrl function that fetches content from HTTP and - * HTTPS URLs. - * - * The available %%options%% are dependent on the platform - * implementation of the default getUrl function. - * - * This is not generally something that is needed, but is useful - * when trying to customize simple behaviour when fetching HTTP - * content. - */ - static createGetUrlFunc(options?: Record): FetchGetUrlFunc { - return createGetUrl(options); - } - - /** - * Creates a function that can "fetch" data URIs. - * - * Note that this is automatically done internally to support - * data URIs, so it is not necessary to register it. - * - * This is not generally something that is needed, but may - * be useful in a wrapper to perfom custom data URI functionality. - */ - static createDataGateway(): FetchGatewayFunc { - return dataGatewayFunc; - } - - /** - * Creates a function that will fetch IPFS (unvalidated) from - * a custom gateway baseUrl. - * - * The default IPFS gateway used internally is - * ``"https:/\/gateway.ipfs.io/ipfs/"``. - */ - static createIpfsGatewayFunc(baseUrl: string): FetchGatewayFunc { - return getIpfsGatewayFunc(baseUrl); - } -} - - -interface ThrottleError extends Error { - stall: number; - throttle: true; -}; - -/** - * The response for a FetchRequest. - */ -export class FetchResponse implements Iterable<[ key: string, value: string ]> { - #statusCode: number; - #statusMessage: string; - #headers: Record; - #body: null | Readonly; - #request: null | FetchRequest; - - #error: { error?: Error, message: string }; - - toString(): string { - return ``; - } - - /** - * The response status code. - */ - get statusCode(): number { return this.#statusCode; } - - /** - * The response status message. - */ - get statusMessage(): string { return this.#statusMessage; } - - /** - * The response headers. All keys are lower-case. - */ - get headers(): Record { return Object.assign({ }, this.#headers); } - - /** - * The response body, or ``null`` if there was no body. - */ - get body(): null | Readonly { - return (this.#body == null) ? null: new Uint8Array(this.#body); - } - - /** - * The response body as a UTF-8 encoded string, or the empty - * string (i.e. ``""``) if there was no body. - * - * An error is thrown if the body is invalid UTF-8 data. - */ - get bodyText(): string { - try { - return (this.#body == null) ? "": toUtf8String(this.#body); - } catch (error) { - assert(false, "response body is not valid UTF-8 data", "UNSUPPORTED_OPERATION", { - operation: "bodyText", info: { response: this } - }); - } - } - - /** - * The response body, decoded as JSON. - * - * An error is thrown if the body is invalid JSON-encoded data - * or if there was no body. - */ - get bodyJson(): any { - try { - return JSON.parse(this.bodyText); - } catch (error) { - assert(false, "response body is not valid JSON", "UNSUPPORTED_OPERATION", { - operation: "bodyJson", info: { response: this } - }); - } - } - - [Symbol.iterator](): Iterator<[ key: string, value: string ]> { - const headers = this.headers; - const keys = Object.keys(headers); - let index = 0; - return { - next: () => { - if (index < keys.length) { - const key = keys[index++]; - return { - value: [ key, headers[key] ], done: false - } - } - return { value: undefined, done: true }; - } - }; - } - - constructor(statusCode: number, statusMessage: string, headers: Readonly>, body: null | Uint8Array, request?: FetchRequest) { - this.#statusCode = statusCode; - this.#statusMessage = statusMessage; - this.#headers = Object.keys(headers).reduce((accum, k) => { - accum[k.toLowerCase()] = String(headers[k]); - return accum; - }, >{ }); - this.#body = ((body == null) ? null: new Uint8Array(body)); - this.#request = (request || null); - - this.#error = { message: "" }; - } - - /** - * Return a Response with matching headers and body, but with - * an error status code (i.e. 599) and %%message%% with an - * optional %%error%%. - */ - makeServerError(message?: string, error?: Error): FetchResponse { - let statusMessage: string; - if (!message) { - message = `${ this.statusCode } ${ this.statusMessage }`; - statusMessage = `CLIENT ESCALATED SERVER ERROR (${ message })`; - } else { - statusMessage = `CLIENT ESCALATED SERVER ERROR (${ this.statusCode } ${ this.statusMessage }; ${ message })`; - } - const response = new FetchResponse(599, statusMessage, this.headers, - this.body, this.#request || undefined); - response.#error = { message, error }; - return response; - } - - /** - * If called within a [request.processFunc](FetchRequest-processFunc) - * call, causes the request to retry as if throttled for %%stall%% - * milliseconds. - */ - throwThrottleError(message?: string, stall?: number): never { - if (stall == null) { - stall = -1; - } else { - assertArgument(Number.isInteger(stall) && stall >= 0, "invalid stall timeout", "stall", stall); - } - - const error = new Error(message || "throttling requests"); - - defineProperties(error, { stall, throttle: true }); - - throw error; - } - - /** - * Get the header value for %%key%%, ignoring case. - */ - getHeader(key: string): string { - return this.headers[key.toLowerCase()]; - } - - /** - * Returns true if the response has a body. - */ - hasBody(): this is (FetchResponse & { body: Uint8Array }) { - return (this.#body != null); - } - - /** - * The request made for this response. - */ - get request(): null | FetchRequest { return this.#request; } - - /** - * Returns true if this response was a success statusCode. - */ - ok(): boolean { - return (this.#error.message === "" && this.statusCode >= 200 && this.statusCode < 300); - } - - /** - * Throws a ``SERVER_ERROR`` if this response is not ok. - */ - assertOk(): void { - if (this.ok()) { return; } - let { message, error } = this.#error; - if (message === "") { - message = `server response ${ this.statusCode } ${ this.statusMessage }`; - } - - let requestUrl: null | string = null; - if (this.request) { requestUrl = this.request.url; } - - let responseBody: null | string = null; - try { - if (this.#body) { responseBody = toUtf8String(this.#body); } - } catch (e) { } - - assert(false, message, "SERVER_ERROR", { - request: (this.request || "unknown request"), response: this, error, - info: { - requestUrl, responseBody, - responseStatus: `${ this.statusCode } ${ this.statusMessage }` } - }); - } -} - - -function getTime(): number { return (new Date()).getTime(); } - -function unpercent(value: string): Uint8Array { - return toUtf8Bytes(value.replace(/%([0-9a-f][0-9a-f])/gi, (all, code) => { - return String.fromCharCode(parseInt(code, 16)); - })); -} - -function wait(delay: number): Promise { - return new Promise((resolve) => setTimeout(resolve, delay)); -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/fixednumber.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/utils/fixednumber.ts deleted file mode 100644 index cc364af7..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/fixednumber.ts +++ /dev/null @@ -1,643 +0,0 @@ -/** - * The **FixedNumber** class permits using values with decimal places, - * using fixed-pont math. - * - * Fixed-point math is still based on integers under-the-hood, but uses an - * internal offset to store fractional components below, and each operation - * corrects for this after each operation. - * - * @_section: api/utils/fixed-point-math:Fixed-Point Maths [about-fixed-point-math] - */ -import { getBytes } from "./data.js"; -import { assert, assertArgument, assertPrivate } from "./errors.js"; -import { - getBigInt, getNumber, fromTwos, mask, toBigInt -} from "./maths.js"; -import { defineProperties } from "./properties.js"; - -import type { BigNumberish, BytesLike, Numeric } from "./index.js"; - -const BN_N1 = BigInt(-1); -const BN_0 = BigInt(0); -const BN_1 = BigInt(1); -const BN_5 = BigInt(5); - -const _guard = { }; - - -// Constant to pull zeros from for multipliers -let Zeros = "0000"; -while (Zeros.length < 80) { Zeros += Zeros; } - -// Returns a string "1" followed by decimal "0"s -function getTens(decimals: number): bigint { - let result = Zeros; - while (result.length < decimals) { result += result; } - return BigInt("1" + result.substring(0, decimals)); -} - - - - /* - * Returns a new FixedFormat for %%value%%. - * - * If %%value%% is specified as a ``number``, the bit-width is - * 128 bits and %%value%% is used for the ``decimals``. - * - * A string %%value%% may begin with ``fixed`` or ``ufixed`` - * for signed and unsigned respectfully. If no other properties - * are specified, the bit-width is 128-bits with 18 decimals. - * - * To specify the bit-width and demicals, append them separated - * by an ``"x"`` to the %%value%%. - * - * For example, ``ufixed128x18`` describes an unsigned, 128-bit - * wide format with 18 decimals. - * - * If %%value%% is an other object, its properties for ``signed``, - * ``width`` and ``decimals`` are checked. - */ - -/** - * A description of a fixed-point arithmetic field. - * - * When specifying the fixed format, the values override the default of - * a ``fixed128x18``, which implies a signed 128-bit value with 18 - * decimals of precision. - * - * The alias ``fixed`` and ``ufixed`` can be used for ``fixed128x18`` and - * ``ufixed128x18`` respectively. - * - * When a fixed format string begins with a ``u``, it indicates the field - * is unsigned, so any negative values will overflow. The first number - * indicates the bit-width and the second number indicates the decimal - * precision. - * - * When a ``number`` is used for a fixed format, it indicates the number - * of decimal places, and the default width and signed-ness will be used. - * - * The bit-width must be byte aligned and the decimals can be at most 80. - */ -export type FixedFormat = number | string | { - signed?: boolean, - width?: number, - decimals?: number -}; - -function checkValue(val: bigint, format: _FixedFormat, safeOp?: string): bigint { - const width = BigInt(format.width); - if (format.signed) { - const limit = (BN_1 << (width - BN_1)); - assert(safeOp == null || (val >= -limit && val < limit), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - - if (val > BN_0) { - val = fromTwos(mask(val, width), width); - } else { - val = -fromTwos(mask(-val, width), width); - } - - } else { - const limit = (BN_1 << width); - assert(safeOp == null || (val >= 0 && val < limit), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - val = (((val % limit) + limit) % limit) & (limit - BN_1); - } - - return val; -} - -type _FixedFormat = { signed: boolean, width: number, decimals: number, name: string } - -function getFormat(value?: FixedFormat): _FixedFormat { - if (typeof(value) === "number") { value = `fixed128x${value}` } - - let signed = true; - let width = 128; - let decimals = 18; - - if (typeof(value) === "string") { - // Parse the format string - if (value === "fixed") { - // defaults... - } else if (value === "ufixed") { - signed = false; - } else { - const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/); - assertArgument(match, "invalid fixed format", "format", value); - signed = (match[1] !== "u"); - width = parseInt(match[2]); - decimals = parseInt(match[3]); - } - } else if (value) { - // Extract the values from the object - const v: any = value; - const check = (key: string, type: string, defaultValue: any): any => { - if (v[key] == null) { return defaultValue; } - assertArgument(typeof(v[key]) === type, - "invalid fixed format (" + key + " not " + type +")", "format." + key, v[key]); - return v[key]; - } - signed = check("signed", "boolean", signed); - width = check("width", "number", width); - decimals = check("decimals", "number", decimals); - } - - assertArgument((width % 8) === 0, "invalid FixedNumber width (not byte aligned)", "format.width", width); - assertArgument(decimals <= 80, "invalid FixedNumber decimals (too large)", "format.decimals", decimals); - - const name = (signed ? "": "u") + "fixed" + String(width) + "x" + String(decimals); - - return { signed, width, decimals, name }; -} - -function toString(val: bigint, decimals: number) { - let negative = ""; - if (val < BN_0) { - negative = "-"; - val *= BN_N1; - } - - let str = val.toString(); - - // No decimal point for whole values - if (decimals === 0) { return (negative + str); } - - // Pad out to the whole component (including a whole digit) - while (str.length <= decimals) { str = Zeros + str; } - - // Insert the decimal point - const index = str.length - decimals; - str = str.substring(0, index) + "." + str.substring(index); - - // Trim the whole component (leaving at least one 0) - while (str[0] === "0" && str[1] !== ".") { - str = str.substring(1); - } - - // Trim the decimal component (leaving at least one 0) - while (str[str.length - 1] === "0" && str[str.length - 2] !== ".") { - str = str.substring(0, str.length - 1); - } - - return (negative + str); -} - - -/** - * A FixedNumber represents a value over its [[FixedFormat]] - * arithmetic field. - * - * A FixedNumber can be used to perform math, losslessly, on - * values which have decmial places. - * - * A FixedNumber has a fixed bit-width to store values in, and stores all - * values internally by multiplying the value by 10 raised to the power of - * %%decimals%%. - * - * If operations are performed that cause a value to grow too high (close to - * positive infinity) or too low (close to negative infinity), the value - * is said to //overflow//. - * - * For example, an 8-bit signed value, with 0 decimals may only be within - * the range ``-128`` to ``127``; so ``-128 - 1`` will overflow and become - * ``127``. Likewise, ``127 + 1`` will overflow and become ``-127``. - * - * Many operation have a normal and //unsafe// variant. The normal variant - * will throw a [[NumericFaultError]] on any overflow, while the //unsafe// - * variant will silently allow overflow, corrupting its value value. - * - * If operations are performed that cause a value to become too small - * (close to zero), the value loses precison and is said to //underflow//. - * - * For example, a value with 1 decimal place may store a number as small - * as ``0.1``, but the value of ``0.1 / 2`` is ``0.05``, which cannot fit - * into 1 decimal place, so underflow occurs which means precision is lost - * and the value becomes ``0``. - * - * Some operations have a normal and //signalling// variant. The normal - * variant will silently ignore underflow, while the //signalling// variant - * will thow a [[NumericFaultError]] on underflow. - */ -export class FixedNumber { - - /** - * The specific fixed-point arithmetic field for this value. - */ - readonly format!: string; - - readonly #format: _FixedFormat; - - // The actual value (accounting for decimals) - #val: bigint; - - // A base-10 value to multiple values by to maintain the magnitude - readonly #tens: bigint; - - /** - * This is a property so console.log shows a human-meaningful value. - * - * @private - */ - readonly _value!: string; - - // Use this when changing this file to get some typing info, - // but then switch to any to mask the internal type - //constructor(guard: any, value: bigint, format: _FixedFormat) { - - /** - * @private - */ - constructor(guard: any, value: bigint, format: any) { - assertPrivate(guard, _guard, "FixedNumber"); - - this.#val = value; - - this.#format = format; - - const _value = toString(value, format.decimals); - - defineProperties(this, { format: format.name, _value }); - - this.#tens = getTens(format.decimals); - } - - /** - * If true, negative values are permitted, otherwise only - * positive values and zero are allowed. - */ - get signed(): boolean { return this.#format.signed; } - - /** - * The number of bits available to store the value. - */ - get width(): number { return this.#format.width; } - - /** - * The number of decimal places in the fixed-point arithment field. - */ - get decimals(): number { return this.#format.decimals; } - - /** - * The value as an integer, based on the smallest unit the - * [[decimals]] allow. - */ - get value(): bigint { return this.#val; } - - #checkFormat(other: FixedNumber): void { - assertArgument(this.format === other.format, - "incompatible format; use fixedNumber.toFormat", "other", other); - } - - #checkValue(val: bigint, safeOp?: string): FixedNumber { -/* - const width = BigInt(this.width); - if (this.signed) { - const limit = (BN_1 << (width - BN_1)); - assert(safeOp == null || (val >= -limit && val < limit), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - - if (val > BN_0) { - val = fromTwos(mask(val, width), width); - } else { - val = -fromTwos(mask(-val, width), width); - } - - } else { - const masked = mask(val, width); - assert(safeOp == null || (val >= 0 && val === masked), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - val = masked; - } -*/ - val = checkValue(val, this.#format, safeOp); - return new FixedNumber(_guard, val, this.#format); - } - - #add(o: FixedNumber, safeOp?: string): FixedNumber { - this.#checkFormat(o); - return this.#checkValue(this.#val + o.#val, safeOp); - } - - /** - * Returns a new [[FixedNumber]] with the result of %%this%% added - * to %%other%%, ignoring overflow. - */ - addUnsafe(other: FixedNumber): FixedNumber { return this.#add(other); } - - /** - * Returns a new [[FixedNumber]] with the result of %%this%% added - * to %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - add(other: FixedNumber): FixedNumber { return this.#add(other, "add"); } - - #sub(o: FixedNumber, safeOp?: string): FixedNumber { - this.#checkFormat(o); - return this.#checkValue(this.#val - o.#val, safeOp); - } - - /** - * Returns a new [[FixedNumber]] with the result of %%other%% subtracted - * from %%this%%, ignoring overflow. - */ - subUnsafe(other: FixedNumber): FixedNumber { return this.#sub(other); } - - /** - * Returns a new [[FixedNumber]] with the result of %%other%% subtracted - * from %%this%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - sub(other: FixedNumber): FixedNumber { return this.#sub(other, "sub"); } - - #mul(o: FixedNumber, safeOp?: string): FixedNumber { - this.#checkFormat(o); - return this.#checkValue((this.#val * o.#val) / this.#tens, safeOp); - } - - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%, ignoring overflow and underflow (precision loss). - */ - mulUnsafe(other: FixedNumber): FixedNumber { return this.#mul(other); } - - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - mul(other: FixedNumber): FixedNumber { return this.#mul(other, "mul"); } - - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs or if underflow (precision loss) occurs. - */ - mulSignal(other: FixedNumber): FixedNumber { - this.#checkFormat(other); - const value = this.#val * other.#val; - assert((value % this.#tens) === BN_0, "precision lost during signalling mul", "NUMERIC_FAULT", { - operation: "mulSignal", fault: "underflow", value: this - }); - return this.#checkValue(value / this.#tens, "mulSignal"); - } - - #div(o: FixedNumber, safeOp?: string): FixedNumber { - assert(o.#val !== BN_0, "division by zero", "NUMERIC_FAULT", { - operation: "div", fault: "divide-by-zero", value: this - }); - this.#checkFormat(o); - return this.#checkValue((this.#val * this.#tens) / o.#val, safeOp); - } - - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%, ignoring underflow (precision loss). A - * [[NumericFaultError]] is thrown if overflow occurs. - */ - divUnsafe(other: FixedNumber): FixedNumber { return this.#div(other); } - - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%, ignoring underflow (precision loss). A - * [[NumericFaultError]] is thrown if overflow occurs. - */ - div(other: FixedNumber): FixedNumber { return this.#div(other, "div"); } - - - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%. A [[NumericFaultError]] is thrown if underflow - * (precision loss) occurs. - */ - divSignal(other: FixedNumber): FixedNumber { - assert(other.#val !== BN_0, "division by zero", "NUMERIC_FAULT", { - operation: "div", fault: "divide-by-zero", value: this - }); - this.#checkFormat(other); - const value = (this.#val * this.#tens); - assert((value % other.#val) === BN_0, "precision lost during signalling div", "NUMERIC_FAULT", { - operation: "divSignal", fault: "underflow", value: this - }); - return this.#checkValue(value / other.#val, "divSignal"); - } - - /** - * Returns a comparison result between %%this%% and %%other%%. - * - * This is suitable for use in sorting, where ``-1`` implies %%this%% - * is smaller, ``1`` implies %%this%% is larger and ``0`` implies - * both are equal. - */ - cmp(other: FixedNumber): number { - let a = this.value, b = other.value; - - // Coerce a and b to the same magnitude - const delta = this.decimals - other.decimals; - if (delta > 0) { - b *= getTens(delta); - } else if (delta < 0) { - a *= getTens(-delta); - } - - // Comnpare - if (a < b) { return -1; } - if (a > b) { return 1; } - return 0; - } - - /** - * Returns true if %%other%% is equal to %%this%%. - */ - eq(other: FixedNumber): boolean { return this.cmp(other) === 0; } - - /** - * Returns true if %%other%% is less than to %%this%%. - */ - lt(other: FixedNumber): boolean { return this.cmp(other) < 0; } - - /** - * Returns true if %%other%% is less than or equal to %%this%%. - */ - lte(other: FixedNumber): boolean { return this.cmp(other) <= 0; } - - /** - * Returns true if %%other%% is greater than to %%this%%. - */ - gt(other: FixedNumber): boolean { return this.cmp(other) > 0; } - - /** - * Returns true if %%other%% is greater than or equal to %%this%%. - */ - gte(other: FixedNumber): boolean { return this.cmp(other) >= 0; } - - /** - * Returns a new [[FixedNumber]] which is the largest **integer** - * that is less than or equal to %%this%%. - * - * The decimal component of the result will always be ``0``. - */ - floor(): FixedNumber { - let val = this.#val; - if (this.#val < BN_0) { val -= this.#tens - BN_1; } - val = (this.#val / this.#tens) * this.#tens; - return this.#checkValue(val, "floor"); - } - - /** - * Returns a new [[FixedNumber]] which is the smallest **integer** - * that is greater than or equal to %%this%%. - * - * The decimal component of the result will always be ``0``. - */ - ceiling(): FixedNumber { - let val = this.#val; - if (this.#val > BN_0) { val += this.#tens - BN_1; } - val = (this.#val / this.#tens) * this.#tens; - return this.#checkValue(val, "ceiling"); - } - - /** - * Returns a new [[FixedNumber]] with the decimal component - * rounded up on ties at %%decimals%% places. - */ - round(decimals?: number): FixedNumber { - if (decimals == null) { decimals = 0; } - - // Not enough precision to not already be rounded - if (decimals >= this.decimals) { return this; } - - const delta = this.decimals - decimals; - const bump = BN_5 * getTens(delta - 1); - - let value = this.value + bump; - const tens = getTens(delta); - value = (value / tens) * tens; - - checkValue(value, this.#format, "round"); - - return new FixedNumber(_guard, value, this.#format); - } - - /** - * Returns true if %%this%% is equal to ``0``. - */ - isZero(): boolean { return (this.#val === BN_0); } - - /** - * Returns true if %%this%% is less than ``0``. - */ - isNegative(): boolean { return (this.#val < BN_0); } - - /** - * Returns the string representation of %%this%%. - */ - toString(): string { return this._value; } - - /** - * Returns a float approximation. - * - * Due to IEEE 754 precission (or lack thereof), this function - * can only return an approximation and most values will contain - * rounding errors. - */ - toUnsafeFloat(): number { return parseFloat(this.toString()); } - - /** - * Return a new [[FixedNumber]] with the same value but has had - * its field set to %%format%%. - * - * This will throw if the value cannot fit into %%format%%. - */ - toFormat(format: FixedFormat): FixedNumber { - return FixedNumber.fromString(this.toString(), format); - } - - /** - * Creates a new [[FixedNumber]] for %%value%% divided by - * %%decimal%% places with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% (once adjusted - * for %%decimals%%) cannot fit in %%format%%, either due to overflow - * or underflow (precision loss). - */ - static fromValue(_value: BigNumberish, _decimals?: Numeric, _format?: FixedFormat): FixedNumber { - const decimals = (_decimals == null) ? 0: getNumber(_decimals); - const format = getFormat(_format); - - let value = getBigInt(_value, "value"); - const delta = decimals - format.decimals; - if (delta > 0) { - const tens = getTens(delta); - assert((value % tens) === BN_0, "value loses precision for format", "NUMERIC_FAULT", { - operation: "fromValue", fault: "underflow", value: _value - }); - value /= tens; - } else if (delta < 0) { - value *= getTens(-delta); - } - - checkValue(value, format, "fromValue"); - - return new FixedNumber(_guard, value, format); - } - - /** - * Creates a new [[FixedNumber]] for %%value%% with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% cannot fit - * in %%format%%, either due to overflow or underflow (precision loss). - */ - static fromString(_value: string, _format?: FixedFormat): FixedNumber { - const match = _value.match(/^(-?)([0-9]*)\.?([0-9]*)$/); - assertArgument(match && (match[2].length + match[3].length) > 0, "invalid FixedNumber string value", "value", _value); - - const format = getFormat(_format); - - let whole = (match[2] || "0"), decimal = (match[3] || ""); - - // Pad out the decimals - while (decimal.length < format.decimals) { decimal += Zeros; } - - // Check precision is safe - assert(decimal.substring(format.decimals).match(/^0*$/), "too many decimals for format", "NUMERIC_FAULT", { - operation: "fromString", fault: "underflow", value: _value - }); - - // Remove extra padding - decimal = decimal.substring(0, format.decimals); - - const value = BigInt(match[1] + whole + decimal) - - checkValue(value, format, "fromString"); - - return new FixedNumber(_guard, value, format); - } - - /** - * Creates a new [[FixedNumber]] with the big-endian representation - * %%value%% with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% cannot fit - * in %%format%% due to overflow. - */ - static fromBytes(_value: BytesLike, _format?: FixedFormat): FixedNumber { - let value = toBigInt(getBytes(_value, "value")); - const format = getFormat(_format); - - if (format.signed) { value = fromTwos(value, format.width); } - - checkValue(value, format, "fromBytes"); - - return new FixedNumber(_guard, value, format); - } -} - -//const f1 = FixedNumber.fromString("12.56", "fixed16x2"); -//const f2 = FixedNumber.fromString("0.3", "fixed16x2"); -//console.log(f1.divSignal(f2)); -//const BUMP = FixedNumber.from("0.5"); diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/geturl-browser.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/utils/geturl-browser.ts deleted file mode 100644 index af7efc3a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/geturl-browser.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { assert, makeError } from "./errors.js"; - -import type { - FetchGetUrlFunc, FetchRequest, FetchCancelSignal, GetUrlResponse -} from "./fetch.js"; - -export function createGetUrl(options?: Record): FetchGetUrlFunc { - - async function getUrl(req: FetchRequest, _signal?: FetchCancelSignal): Promise { - assert(_signal == null || !_signal.cancelled, "request cancelled before sending", "CANCELLED"); - - const protocol = req.url.split(":")[0].toLowerCase(); - - assert(protocol === "http" || protocol === "https", `unsupported protocol ${ protocol }`, "UNSUPPORTED_OPERATION", { - info: { protocol }, - operation: "request" - }); - - assert(protocol === "https" || !req.credentials || req.allowInsecureAuthentication, "insecure authorized connections unsupported", "UNSUPPORTED_OPERATION", { - operation: "request" - }); - - let error: null | Error = null; - - const controller = new AbortController(); - - const timer = setTimeout(() => { - error = makeError("request timeout", "TIMEOUT"); - controller.abort(); - }, req.timeout); - - if (_signal) { - _signal.addListener(() => { - error = makeError("request cancelled", "CANCELLED"); - controller.abort(); - }); - } - - const init = Object.assign({ }, options, { - method: req.method, - headers: new Headers(Array.from(req)), - body: req.body || undefined, - signal: controller.signal - }); - - let resp: Awaited>; - try { - resp = await fetch(req.url, init); - } catch (_error) { - clearTimeout(timer); - if (error) { throw error; } - throw _error; - } - - clearTimeout(timer); - - const headers: Record = { }; - resp.headers.forEach((value, key) => { - headers[key.toLowerCase()] = value; - }); - - const respBody = await resp.arrayBuffer(); - const body = (respBody == null) ? null: new Uint8Array(respBody); - - return { - statusCode: resp.status, - statusMessage: resp.statusText, - headers, body - }; - } - - return getUrl; -} - -// @TODO: remove in v7; provided for backwards compat -const defaultGetUrl: FetchGetUrlFunc = createGetUrl({ }); - -export async function getUrl(req: FetchRequest, _signal?: FetchCancelSignal): Promise { - return defaultGetUrl(req, _signal); -} - diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/geturl.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/utils/geturl.ts deleted file mode 100644 index fa3cb524..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/geturl.ts +++ /dev/null @@ -1,141 +0,0 @@ -import http from "http"; -import https from "https"; -import { gunzipSync } from "zlib"; - -import { assert, makeError } from "./errors.js"; -import { getBytes } from "./data.js"; - -import type { - FetchGetUrlFunc, FetchRequest, FetchCancelSignal, GetUrlResponse -} from "./fetch.js"; - -/** - * @_ignore: - */ -export function createGetUrl(options?: Record): FetchGetUrlFunc { - - async function getUrl(req: FetchRequest, signal?: FetchCancelSignal): Promise { - // Make sure we weren't cancelled before sending - assert(signal == null || !signal.cancelled, "request cancelled before sending", "CANCELLED"); - - const protocol = req.url.split(":")[0].toLowerCase(); - - assert(protocol === "http" || protocol === "https", `unsupported protocol ${ protocol }`, "UNSUPPORTED_OPERATION", { - info: { protocol }, - operation: "request" - }); - - assert(protocol === "https" || !req.credentials || req.allowInsecureAuthentication, "insecure authorized connections unsupported", "UNSUPPORTED_OPERATION", { - operation: "request" - }); - - const method = req.method; - const headers = Object.assign({ }, req.headers); - - const reqOptions: any = { method, headers }; - if (options) { - if (options.agent) { reqOptions.agent = options.agent; } - } - - // Create a Node-specific AbortController, if available - let abort: null | AbortController = null; - try { - abort = new AbortController(); - reqOptions.abort = abort.signal; - } catch (e) { console.log(e); } - - const request = ((protocol === "http") ? http: https).request(req.url, reqOptions); - - request.setTimeout(req.timeout); - - const body = req.body; - if (body) { request.write(Buffer.from(body)); } - - request.end(); - - return new Promise((resolve, reject) => { - - if (signal) { - signal.addListener(() => { - if (abort) { abort.abort(); } - reject(makeError("request cancelled", "CANCELLED")); - }); - } - - request.on("timeout", () => { - reject(makeError("request timeout", "TIMEOUT")); - }); - - request.once("response", (resp: http.IncomingMessage) => { - const statusCode = resp.statusCode || 0; - const statusMessage = resp.statusMessage || ""; - const headers = Object.keys(resp.headers || {}).reduce((accum, name) => { - let value = resp.headers[name] || ""; - if (Array.isArray(value)) { - value = value.join(", "); - } - accum[name] = value; - return accum; - }, <{ [ name: string ]: string }>{ }); - - let body: null | Uint8Array = null; - //resp.setEncoding("utf8"); - - resp.on("data", (chunk: Uint8Array) => { - if (signal) { - try { - signal.checkSignal(); - } catch (error) { - return reject(error); - } - } - - if (body == null) { - body = chunk; - } else { - const newBody = new Uint8Array(body.length + chunk.length); - newBody.set(body, 0); - newBody.set(chunk, body.length); - body = newBody; - } - }); - - resp.on("end", () => { - try { - if (headers["content-encoding"] === "gzip" && body) { - body = getBytes(gunzipSync(body)); - } - - resolve({ statusCode, statusMessage, headers, body }); - - } catch (error) { - reject(makeError("bad response data", "SERVER_ERROR", { - request: req, info: { response: resp, error } - })); - } - }); - - resp.on("error", (error) => { - //@TODO: Should this just return nornal response with a server error? - (error).response = { statusCode, statusMessage, headers, body }; - reject(error); - }); - }); - - request.on("error", (error) => { reject(error); }); - }); - } - - return getUrl; -} - -// @TODO: remove in v7; provided for backwards compat -const defaultGetUrl: FetchGetUrlFunc = createGetUrl({ }); - -/** - * @_ignore: - */ -export async function getUrl(req: FetchRequest, signal?: FetchCancelSignal): Promise { - return defaultGetUrl(req, signal); -} - diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/index.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/utils/index.ts deleted file mode 100644 index 88809348..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/index.ts +++ /dev/null @@ -1,95 +0,0 @@ -/** - * There are many simple utilities required to interact with - * Ethereum and to simplify the library, without increasing - * the library dependencies for simple functions. - * - * @_section api/utils:Utilities [about-utils] - */ - -export { decodeBase58, encodeBase58 } from "./base58.js"; - -export { decodeBase64, encodeBase64 } from "./base64.js"; - -export { - getBytes, getBytesCopy, isHexString, isBytesLike, hexlify, concat, dataLength, dataSlice, - stripZerosLeft, zeroPadValue, zeroPadBytes -} from "./data.js"; - -export { - isCallException, isError, - assert, assertArgument, assertArgumentCount, assertPrivate, assertNormalize, makeError -} from "./errors.js" - -export { EventPayload } from "./events.js"; - -export { - FetchRequest, FetchResponse, FetchCancelSignal, -} from "./fetch.js"; - -export { FixedNumber } from "./fixednumber.js" - -export { - fromTwos, toTwos, mask, - getBigInt, getNumber, getUint, toBigInt, toNumber, toBeHex, toBeArray, toQuantity -} from "./maths.js"; - -export { resolveProperties, defineProperties} from "./properties.js"; - -export { decodeRlp } from "./rlp-decode.js"; -export { encodeRlp } from "./rlp-encode.js"; - -export { formatEther, parseEther, formatUnits, parseUnits } from "./units.js"; - -export { - toUtf8Bytes, - toUtf8CodePoints, - toUtf8String, - - Utf8ErrorFuncs, -} from "./utf8.js"; - -export { uuidV4 } from "./uuid.js"; - -///////////////////////////// -// Types - -export type { BytesLike } from "./data.js"; - -export type { - - //ErrorFetchRequestWithBody, ErrorFetchRequest, - //ErrorFetchResponseWithBody, ErrorFetchResponse, - - ErrorCode, - - EthersError, UnknownError, NotImplementedError, UnsupportedOperationError, NetworkError, - ServerError, TimeoutError, BadDataError, CancelledError, BufferOverrunError, - NumericFaultError, InvalidArgumentError, MissingArgumentError, UnexpectedArgumentError, - CallExceptionError, InsufficientFundsError, NonceExpiredError, OffchainFaultError, - ReplacementUnderpricedError, TransactionReplacedError, UnconfiguredNameError, - ActionRejectedError, - - CallExceptionAction, CallExceptionTransaction, - - CodedEthersError -} from "./errors.js" - -export type { EventEmitterable, Listener } from "./events.js"; - -export type { - GetUrlResponse, - FetchPreflightFunc, FetchProcessFunc, FetchRetryFunc, - FetchGatewayFunc, FetchGetUrlFunc -} from "./fetch.js"; - -export type { FixedFormat } from "./fixednumber.js" - -export type { BigNumberish, Numeric } from "./maths.js"; - -export type { RlpStructuredData, RlpStructuredDataish } from "./rlp.js"; - -export type { - Utf8ErrorFunc, - UnicodeNormalizationForm, - Utf8ErrorReason -} from "./utf8.js"; diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/maths.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/utils/maths.ts deleted file mode 100644 index 37ee5532..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/maths.ts +++ /dev/null @@ -1,259 +0,0 @@ -/** - * Some mathematic operations. - * - * @_subsection: api/utils:Math Helpers [about-maths] - */ -import { hexlify, isBytesLike } from "./data.js"; -import { assert, assertArgument } from "./errors.js"; - -import type { BytesLike } from "./data.js"; - -/** - * Any type that can be used where a numeric value is needed. - */ -export type Numeric = number | bigint; - -/** - * Any type that can be used where a big number is needed. - */ -export type BigNumberish = string | Numeric; - - -const BN_0 = BigInt(0); -const BN_1 = BigInt(1); - -//const BN_Max256 = (BN_1 << BigInt(256)) - BN_1; - - -// IEEE 754 support 53-bits of mantissa -const maxValue = 0x1fffffffffffff; - -/** - * Convert %%value%% from a twos-compliment representation of %%width%% - * bits to its value. - * - * If the highest bit is ``1``, the result will be negative. - */ -export function fromTwos(_value: BigNumberish, _width: Numeric): bigint { - const value = getUint(_value, "value"); - const width = BigInt(getNumber(_width, "width")); - - assert((value >> width) === BN_0, "overflow", "NUMERIC_FAULT", { - operation: "fromTwos", fault: "overflow", value: _value - }); - - // Top bit set; treat as a negative value - if (value >> (width - BN_1)) { - const mask = (BN_1 << width) - BN_1; - return -(((~value) & mask) + BN_1); - } - - return value; -} - -/** - * Convert %%value%% to a twos-compliment representation of - * %%width%% bits. - * - * The result will always be positive. - */ -export function toTwos(_value: BigNumberish, _width: Numeric): bigint { - let value = getBigInt(_value, "value"); - const width = BigInt(getNumber(_width, "width")); - - const limit = (BN_1 << (width - BN_1)); - - if (value < BN_0) { - value = -value; - assert(value <= limit, "too low", "NUMERIC_FAULT", { - operation: "toTwos", fault: "overflow", value: _value - }); - const mask = (BN_1 << width) - BN_1; - return ((~value) & mask) + BN_1; - } else { - assert(value < limit, "too high", "NUMERIC_FAULT", { - operation: "toTwos", fault: "overflow", value: _value - }); - } - - return value; -} - -/** - * Mask %%value%% with a bitmask of %%bits%% ones. - */ -export function mask(_value: BigNumberish, _bits: Numeric): bigint { - const value = getUint(_value, "value"); - const bits = BigInt(getNumber(_bits, "bits")); - return value & ((BN_1 << bits) - BN_1); -} - -/** - * Gets a BigInt from %%value%%. If it is an invalid value for - * a BigInt, then an ArgumentError will be thrown for %%name%%. - */ -export function getBigInt(value: BigNumberish, name?: string): bigint { - switch (typeof(value)) { - case "bigint": return value; - case "number": - assertArgument(Number.isInteger(value), "underflow", name || "value", value); - assertArgument(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); - return BigInt(value); - case "string": - try { - if (value === "") { throw new Error("empty string"); } - if (value[0] === "-" && value[1] !== "-") { - return -BigInt(value.substring(1)); - } - return BigInt(value); - } catch(e: any) { - assertArgument(false, `invalid BigNumberish string: ${ e.message }`, name || "value", value); - } - } - assertArgument(false, "invalid BigNumberish value", name || "value", value); -} - -/** - * Returns %%value%% as a bigint, validating it is valid as a bigint - * value and that it is positive. - */ -export function getUint(value: BigNumberish, name?: string): bigint { - const result = getBigInt(value, name); - assert(result >= BN_0, "unsigned value cannot be negative", "NUMERIC_FAULT", { - fault: "overflow", operation: "getUint", value - }); - return result; -} - -const Nibbles = "0123456789abcdef"; - -/* - * Converts %%value%% to a BigInt. If %%value%% is a Uint8Array, it - * is treated as Big Endian data. - */ -export function toBigInt(value: BigNumberish | Uint8Array): bigint { - if (value instanceof Uint8Array) { - let result = "0x0"; - for (const v of value) { - result += Nibbles[v >> 4]; - result += Nibbles[v & 0x0f]; - } - return BigInt(result); - } - - return getBigInt(value); -} - -/** - * Gets a //number// from %%value%%. If it is an invalid value for - * a //number//, then an ArgumentError will be thrown for %%name%%. - */ -export function getNumber(value: BigNumberish, name?: string): number { - switch (typeof(value)) { - case "bigint": - assertArgument(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); - return Number(value); - case "number": - assertArgument(Number.isInteger(value), "underflow", name || "value", value); - assertArgument(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); - return value; - case "string": - try { - if (value === "") { throw new Error("empty string"); } - return getNumber(BigInt(value), name); - } catch(e: any) { - assertArgument(false, `invalid numeric string: ${ e.message }`, name || "value", value); - } - } - assertArgument(false, "invalid numeric value", name || "value", value); -} - - -/** - * Converts %%value%% to a number. If %%value%% is a Uint8Array, it - * is treated as Big Endian data. Throws if the value is not safe. - */ -export function toNumber(value: BigNumberish | Uint8Array): number { - return getNumber(toBigInt(value)); -} - -/** - * Converts %%value%% to a Big Endian hexstring, optionally padded to - * %%width%% bytes. - */ -export function toBeHex(_value: BigNumberish, _width?: Numeric): string { - const value = getUint(_value, "value"); - - let result = value.toString(16); - - if (_width == null) { - // Ensure the value is of even length - if (result.length % 2) { result = "0" + result; } - } else { - const width = getNumber(_width, "width"); - - // Special case when both value and width are 0 (see: #5025) - if (width === 0 && value === BN_0) { return "0x"; } - - assert(width * 2 >= result.length, `value exceeds width (${ width } bytes)`, "NUMERIC_FAULT", { - operation: "toBeHex", - fault: "overflow", - value: _value - }); - - // Pad the value to the required width - while (result.length < (width * 2)) { result = "0" + result; } - - } - - return "0x" + result; -} - -/** - * Converts %%value%% to a Big Endian Uint8Array. - */ -export function toBeArray(_value: BigNumberish, _width?: Numeric): Uint8Array { - const value = getUint(_value, "value"); - - if (value === BN_0) { - const width = (_width != null) ? getNumber(_width, "width"): 0; - return new Uint8Array(width); - } - - let hex = value.toString(16); - if (hex.length % 2) { hex = "0" + hex; } - - if (_width != null) { - const width = getNumber(_width, "width"); - - while (hex.length < (width * 2)) { hex = "00" + hex; } - - assert((width * 2) === hex.length, `value exceeds width (${ width } bytes)`, "NUMERIC_FAULT", { - operation: "toBeArray", - fault: "overflow", - value: _value - }); - } - - const result = new Uint8Array(hex.length / 2); - for (let i = 0; i < result.length; i++) { - const offset = i * 2; - result[i] = parseInt(hex.substring(offset, offset + 2), 16); - } - - return result; -} - -/** - * Returns a [[HexString]] for %%value%% safe to use as a //Quantity//. - * - * A //Quantity// does not have and leading 0 values unless the value is - * the literal value `0x0`. This is most commonly used for JSSON-RPC - * numeric values. - */ -export function toQuantity(value: BytesLike | BigNumberish): string { - let result = hexlify(isBytesLike(value) ? value: toBeArray(value)).substring(2); - while (result.startsWith("0")) { result = result.substring(1); } - if (result === "") { result = "0"; } - return "0x" + result; -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/properties.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/utils/properties.ts deleted file mode 100644 index 60c2541e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/properties.ts +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Property helper functions. - * - * @_subsection api/utils:Properties [about-properties] - */ - -function checkType(value: any, type: string, name: string): void { - const types = type.split("|").map(t => t.trim()); - for (let i = 0; i < types.length; i++) { - switch (type) { - case "any": - return; - case "bigint": - case "boolean": - case "number": - case "string": - if (typeof(value) === type) { return; } - } - } - - const error: any = new Error(`invalid value for type ${ type }`); - error.code = "INVALID_ARGUMENT"; - error.argument = `value.${ name }`; - error.value = value; - - throw error; -} - -/** - * Resolves to a new object that is a copy of %%value%%, but with all - * values resolved. - */ -export async function resolveProperties(value: { [ P in keyof T ]: T[P] | Promise}): Promise { - const keys = Object.keys(value); - const results = await Promise.all(keys.map((k) => Promise.resolve(value[k]))); - return results.reduce((accum: any, v, index) => { - accum[keys[index]] = v; - return accum; - }, <{ [ P in keyof T]: T[P] }>{ }); -} - -/** - * Assigns the %%values%% to %%target%% as read-only values. - * - * It %%types%% is specified, the values are checked. - */ -export function defineProperties( - target: T, - values: { [ K in keyof T ]?: T[K] }, - types?: { [ K in keyof T ]?: string }): void { - - for (let key in values) { - let value = values[key]; - - const type = (types ? types[key]: null); - if (type) { checkType(value, type, key); } - - Object.defineProperty(target, key, { enumerable: true, value, writable: false }); - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/rlp-decode.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/utils/rlp-decode.ts deleted file mode 100644 index 330ba5cf..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/rlp-decode.ts +++ /dev/null @@ -1,104 +0,0 @@ -//See: https://github.com/ethereum/wiki/wiki/RLP - -import { hexlify } from "./data.js"; -import { assert, assertArgument } from "./errors.js"; -import { getBytes } from "./data.js"; - -import type { BytesLike, RlpStructuredData } from "./index.js"; - - -function hexlifyByte(value: number): string { - let result = value.toString(16); - while (result.length < 2) { result = "0" + result; } - return "0x" + result; -} - -function unarrayifyInteger(data: Uint8Array, offset: number, length: number): number { - let result = 0; - for (let i = 0; i < length; i++) { - result = (result * 256) + data[offset + i]; - } - return result; -} - -type Decoded = { - result: any; - consumed: number; -}; - -function _decodeChildren(data: Uint8Array, offset: number, childOffset: number, length: number): Decoded { - const result: Array = []; - - while (childOffset < offset + 1 + length) { - const decoded = _decode(data, childOffset); - - result.push(decoded.result); - - childOffset += decoded.consumed; - assert(childOffset <= offset + 1 + length, "child data too short", "BUFFER_OVERRUN", { - buffer: data, length, offset - }); - } - - return {consumed: (1 + length), result: result}; -} - -// returns { consumed: number, result: Object } -function _decode(data: Uint8Array, offset: number): { consumed: number, result: any } { - assert(data.length !== 0, "data too short", "BUFFER_OVERRUN", { - buffer: data, length: 0, offset: 1 - }); - - const checkOffset = (offset: number) => { - assert(offset <= data.length, "data short segment too short", "BUFFER_OVERRUN", { - buffer: data, length: data.length, offset - }); - }; - - // Array with extra length prefix - if (data[offset] >= 0xf8) { - const lengthLength = data[offset] - 0xf7; - checkOffset(offset + 1 + lengthLength); - - const length = unarrayifyInteger(data, offset + 1, lengthLength); - checkOffset(offset + 1 + lengthLength + length); - - return _decodeChildren(data, offset, offset + 1 + lengthLength, lengthLength + length); - - } else if (data[offset] >= 0xc0) { - const length = data[offset] - 0xc0; - checkOffset(offset + 1 + length); - - return _decodeChildren(data, offset, offset + 1, length); - - } else if (data[offset] >= 0xb8) { - const lengthLength = data[offset] - 0xb7; - checkOffset(offset + 1 + lengthLength); - - const length = unarrayifyInteger(data, offset + 1, lengthLength); - checkOffset(offset + 1 + lengthLength + length); - - const result = hexlify(data.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length)); - return { consumed: (1 + lengthLength + length), result: result } - - } else if (data[offset] >= 0x80) { - const length = data[offset] - 0x80; - checkOffset(offset + 1 + length); - - const result = hexlify(data.slice(offset + 1, offset + 1 + length)); - return { consumed: (1 + length), result: result } - } - - return { consumed: 1, result: hexlifyByte(data[offset]) }; -} - -/** - * Decodes %%data%% into the structured data it represents. - */ -export function decodeRlp(_data: BytesLike): RlpStructuredData { - const data = getBytes(_data, "data"); - const decoded = _decode(data, 0); - assertArgument(decoded.consumed === data.length, "unexpected junk after rlp payload", "data", _data); - return decoded.result; -} - diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/rlp-encode.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/utils/rlp-encode.ts deleted file mode 100644 index a823cbbc..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/rlp-encode.ts +++ /dev/null @@ -1,64 +0,0 @@ -//See: https://github.com/ethereum/wiki/wiki/RLP - -import { getBytes } from "./data.js"; - -import type { RlpStructuredDataish } from "./rlp.js"; - - -function arrayifyInteger(value: number): Array { - const result: Array = []; - while (value) { - result.unshift(value & 0xff); - value >>= 8; - } - return result; -} - -function _encode(object: Array | string | Uint8Array): Array { - if (Array.isArray(object)) { - let payload: Array = []; - object.forEach(function(child) { - payload = payload.concat(_encode(child)); - }); - - if (payload.length <= 55) { - payload.unshift(0xc0 + payload.length) - return payload; - } - - const length = arrayifyInteger(payload.length); - length.unshift(0xf7 + length.length); - - return length.concat(payload); - - } - - const data: Array = Array.prototype.slice.call(getBytes(object, "object")); - - if (data.length === 1 && data[0] <= 0x7f) { - return data; - - } else if (data.length <= 55) { - data.unshift(0x80 + data.length); - return data; - } - - const length = arrayifyInteger(data.length); - length.unshift(0xb7 + length.length); - - return length.concat(data); -} - -const nibbles = "0123456789abcdef"; - -/** - * Encodes %%object%% as an RLP-encoded [[DataHexString]]. - */ -export function encodeRlp(object: RlpStructuredDataish): string { - let result = "0x"; - for (const v of _encode(object)) { - result += nibbles[v >> 4]; - result += nibbles[v & 0xf]; - } - return result; -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/rlp.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/utils/rlp.ts deleted file mode 100644 index 5c6551c4..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/rlp.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * The [[link-rlp]] (RLP) encoding is used throughout Ethereum - * to serialize nested structures of Arrays and data. - * - * @_subsection api/utils:Recursive-Length Prefix [about-rlp] - */ - -export { decodeRlp } from "./rlp-decode.js"; -export { encodeRlp } from "./rlp-encode.js"; - -/** - * An RLP-encoded structure. - */ -export type RlpStructuredData = string | Array; - -/** - * An RLP-encoded structure, which allows Uint8Array. - */ -export type RlpStructuredDataish = string | Uint8Array | Array; - diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/test.txt b/tools/mnemonic-test/node_modules/ethers/src.ts/utils/test.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/units.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/utils/units.ts deleted file mode 100644 index feb9fba5..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/units.ts +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Most interactions with Ethereum requires integer values, which use - * the smallest magnitude unit. - * - * For example, imagine dealing with dollars and cents. Since dollars - * are divisible, non-integer values are possible, such as ``$10.77``. - * By using the smallest indivisible unit (i.e. cents), the value can - * be kept as the integer ``1077``. - * - * When receiving decimal input from the user (as a decimal string), - * the value should be converted to an integer and when showing a user - * a value, the integer value should be converted to a decimal string. - * - * This creates a clear distinction, between values to be used by code - * (integers) and values used for display logic to users (decimals). - * - * The native unit in Ethereum, //ether// is divisible to 18 decimal places, - * where each individual unit is called a //wei//. - * - * @_subsection api/utils:Unit Conversion [about-units] - */ -import { assertArgument } from "./errors.js"; -import { FixedNumber } from "./fixednumber.js"; -import { getNumber } from "./maths.js"; - -import type { BigNumberish, Numeric } from "../utils/index.js"; - - -const names = [ - "wei", - "kwei", - "mwei", - "gwei", - "szabo", - "finney", - "ether", -]; - -/** - * Converts %%value%% into a //decimal string//, assuming %%unit%% decimal - * places. The %%unit%% may be the number of decimal places or the name of - * a unit (e.g. ``"gwei"`` for 9 decimal places). - * - */ -export function formatUnits(value: BigNumberish, unit?: string | Numeric): string { - let decimals = 18; - if (typeof(unit) === "string") { - const index = names.indexOf(unit); - assertArgument(index >= 0, "invalid unit", "unit", unit); - decimals = 3 * index; - } else if (unit != null) { - decimals = getNumber(unit, "unit"); - } - - return FixedNumber.fromValue(value, decimals, { decimals, width: 512 }).toString(); -} - -/** - * Converts the //decimal string// %%value%% to a BigInt, assuming - * %%unit%% decimal places. The %%unit%% may the number of decimal places - * or the name of a unit (e.g. ``"gwei"`` for 9 decimal places). - */ -export function parseUnits(value: string, unit?: string | Numeric): bigint { - assertArgument(typeof(value) === "string", "value must be a string", "value", value); - - let decimals = 18; - if (typeof(unit) === "string") { - const index = names.indexOf(unit); - assertArgument(index >= 0, "invalid unit", "unit", unit); - decimals = 3 * index; - } else if (unit != null) { - decimals = getNumber(unit, "unit"); - } - - return FixedNumber.fromString(value, { decimals, width: 512 }).value; -} - -/** - * Converts %%value%% into a //decimal string// using 18 decimal places. - */ -export function formatEther(wei: BigNumberish): string { - return formatUnits(wei, 18); -} - -/** - * Converts the //decimal string// %%ether%% to a BigInt, using 18 - * decimal places. - */ -export function parseEther(ether: string): bigint { - return parseUnits(ether, 18); -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/utf8.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/utils/utf8.ts deleted file mode 100644 index 7706c5b1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/utf8.ts +++ /dev/null @@ -1,325 +0,0 @@ -/** - * Using strings in Ethereum (or any security-basd system) requires - * additional care. These utilities attempt to mitigate some of the - * safety issues as well as provide the ability to recover and analyse - * strings. - * - * @_subsection api/utils:Strings and UTF-8 [about-strings] - */ -import { getBytes } from "./data.js"; -import { assertArgument, assertNormalize } from "./errors.js"; - -import type { BytesLike } from "./index.js"; - - -/////////////////////////////// - -/** - * The stanard normalization forms. - */ -export type UnicodeNormalizationForm = "NFC" | "NFD" | "NFKC" | "NFKD"; - -/** - * When using the UTF-8 error API the following errors can be intercepted - * and processed as the %%reason%% passed to the [[Utf8ErrorFunc]]. - * - * **``"UNEXPECTED_CONTINUE"``** - a continuation byte was present where there - * was nothing to continue. - * - * **``"BAD_PREFIX"``** - an invalid (non-continuation) byte to start a - * UTF-8 codepoint was found. - * - * **``"OVERRUN"``** - the string is too short to process the expected - * codepoint length. - * - * **``"MISSING_CONTINUE"``** - a missing continuation byte was expected but - * not found. The %%offset%% indicates the index the continuation byte - * was expected at. - * - * **``"OUT_OF_RANGE"``** - the computed code point is outside the range - * for UTF-8. The %%badCodepoint%% indicates the computed codepoint, which was - * outside the valid UTF-8 range. - * - * **``"UTF16_SURROGATE"``** - the UTF-8 strings contained a UTF-16 surrogate - * pair. The %%badCodepoint%% is the computed codepoint, which was inside the - * UTF-16 surrogate range. - * - * **``"OVERLONG"``** - the string is an overlong representation. The - * %%badCodepoint%% indicates the computed codepoint, which has already - * been bounds checked. - * - * - * @returns string - */ -export type Utf8ErrorReason = "UNEXPECTED_CONTINUE" | "BAD_PREFIX" | "OVERRUN" | - "MISSING_CONTINUE" | "OUT_OF_RANGE" | "UTF16_SURROGATE" | "OVERLONG"; - - -/** - * A callback that can be used with [[toUtf8String]] to analysis or - * recovery from invalid UTF-8 data. - * - * Parsing UTF-8 data is done through a simple Finite-State Machine (FSM) - * which calls the ``Utf8ErrorFunc`` if a fault is detected. - * - * The %%reason%% indicates where in the FSM execution the fault - * occurred and the %%offset%% indicates where the input failed. - * - * The %%bytes%% represents the raw UTF-8 data that was provided and - * %%output%% is the current array of UTF-8 code-points, which may - * be updated by the ``Utf8ErrorFunc``. - * - * The value of the %%badCodepoint%% depends on the %%reason%%. See - * [[Utf8ErrorReason]] for details. - * - * The function should return the number of bytes that should be skipped - * when control resumes to the FSM. - */ -export type Utf8ErrorFunc = (reason: Utf8ErrorReason, offset: number, bytes: Uint8Array, output: Array, badCodepoint?: number) => number; - - -function errorFunc(reason: Utf8ErrorReason, offset: number, bytes: Uint8Array, output: Array, badCodepoint?: number): number { - assertArgument(false, `invalid codepoint at offset ${ offset }; ${ reason }`, "bytes", bytes); -} - -function ignoreFunc(reason: Utf8ErrorReason, offset: number, bytes: Uint8Array, output: Array, badCodepoint?: number): number { - - // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes - if (reason === "BAD_PREFIX" || reason === "UNEXPECTED_CONTINUE") { - let i = 0; - for (let o = offset + 1; o < bytes.length; o++) { - if (bytes[o] >> 6 !== 0x02) { break; } - i++; - } - return i; - } - - // This byte runs us past the end of the string, so just jump to the end - // (but the first byte was read already read and therefore skipped) - if (reason === "OVERRUN") { - return bytes.length - offset - 1; - } - - // Nothing to skip - return 0; -} - -function replaceFunc(reason: Utf8ErrorReason, offset: number, bytes: Uint8Array, output: Array, badCodepoint?: number): number { - - // Overlong representations are otherwise "valid" code points; just non-deistingtished - if (reason === "OVERLONG") { - assertArgument(typeof(badCodepoint) === "number", "invalid bad code point for replacement", "badCodepoint", badCodepoint); - output.push(badCodepoint); - return 0; - } - - // Put the replacement character into the output - output.push(0xfffd); - - // Otherwise, process as if ignoring errors - return ignoreFunc(reason, offset, bytes, output, badCodepoint); -} - -/** - * A handful of popular, built-in UTF-8 error handling strategies. - * - * **``"error"``** - throws on ANY illegal UTF-8 sequence or - * non-canonical (overlong) codepoints (this is the default) - * - * **``"ignore"``** - silently drops any illegal UTF-8 sequence - * and accepts non-canonical (overlong) codepoints - * - * **``"replace"``** - replace any illegal UTF-8 sequence with the - * UTF-8 replacement character (i.e. ``"\\ufffd"``) and accepts - * non-canonical (overlong) codepoints - * - * @returns: Record<"error" | "ignore" | "replace", Utf8ErrorFunc> - */ -export const Utf8ErrorFuncs: Readonly> = Object.freeze({ - error: errorFunc, - ignore: ignoreFunc, - replace: replaceFunc -}); - -// http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499 -function getUtf8CodePoints(_bytes: BytesLike, onError?: Utf8ErrorFunc): Array { - if (onError == null) { onError = Utf8ErrorFuncs.error; } - - const bytes = getBytes(_bytes, "bytes"); - - const result: Array = []; - let i = 0; - - // Invalid bytes are ignored - while(i < bytes.length) { - - const c = bytes[i++]; - - // 0xxx xxxx - if (c >> 7 === 0) { - result.push(c); - continue; - } - - // Multibyte; how many bytes left for this character? - let extraLength: null | number = null; - let overlongMask: null | number = null; - - // 110x xxxx 10xx xxxx - if ((c & 0xe0) === 0xc0) { - extraLength = 1; - overlongMask = 0x7f; - - // 1110 xxxx 10xx xxxx 10xx xxxx - } else if ((c & 0xf0) === 0xe0) { - extraLength = 2; - overlongMask = 0x7ff; - - // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx - } else if ((c & 0xf8) === 0xf0) { - extraLength = 3; - overlongMask = 0xffff; - - } else { - if ((c & 0xc0) === 0x80) { - i += onError("UNEXPECTED_CONTINUE", i - 1, bytes, result); - } else { - i += onError("BAD_PREFIX", i - 1, bytes, result); - } - continue; - } - - // Do we have enough bytes in our data? - if (i - 1 + extraLength >= bytes.length) { - i += onError("OVERRUN", i - 1, bytes, result); - continue; - } - - // Remove the length prefix from the char - let res: null | number = c & ((1 << (8 - extraLength - 1)) - 1); - - for (let j = 0; j < extraLength; j++) { - let nextChar = bytes[i]; - - // Invalid continuation byte - if ((nextChar & 0xc0) != 0x80) { - i += onError("MISSING_CONTINUE", i, bytes, result); - res = null; - break; - }; - - res = (res << 6) | (nextChar & 0x3f); - i++; - } - - // See above loop for invalid continuation byte - if (res === null) { continue; } - - // Maximum code point - if (res > 0x10ffff) { - i += onError("OUT_OF_RANGE", i - 1 - extraLength, bytes, result, res); - continue; - } - - // Reserved for UTF-16 surrogate halves - if (res >= 0xd800 && res <= 0xdfff) { - i += onError("UTF16_SURROGATE", i - 1 - extraLength, bytes, result, res); - continue; - } - - // Check for overlong sequences (more bytes than needed) - if (res <= overlongMask) { - i += onError("OVERLONG", i - 1 - extraLength, bytes, result, res); - continue; - } - - result.push(res); - } - - return result; -} - -// http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array - -/** - * Returns the UTF-8 byte representation of %%str%%. - * - * If %%form%% is specified, the string is normalized. - */ -export function toUtf8Bytes(str: string, form?: UnicodeNormalizationForm): Uint8Array { - assertArgument(typeof(str) === "string", "invalid string value", "str", str); - - if (form != null) { - assertNormalize(form); - str = str.normalize(form); - } - - let result: Array = []; - for (let i = 0; i < str.length; i++) { - const c = str.charCodeAt(i); - - if (c < 0x80) { - result.push(c); - - } else if (c < 0x800) { - result.push((c >> 6) | 0xc0); - result.push((c & 0x3f) | 0x80); - - } else if ((c & 0xfc00) == 0xd800) { - i++; - const c2 = str.charCodeAt(i); - - assertArgument(i < str.length && ((c2 & 0xfc00) === 0xdc00), - "invalid surrogate pair", "str", str); - - // Surrogate Pair - const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff); - result.push((pair >> 18) | 0xf0); - result.push(((pair >> 12) & 0x3f) | 0x80); - result.push(((pair >> 6) & 0x3f) | 0x80); - result.push((pair & 0x3f) | 0x80); - - } else { - result.push((c >> 12) | 0xe0); - result.push(((c >> 6) & 0x3f) | 0x80); - result.push((c & 0x3f) | 0x80); - } - } - - return new Uint8Array(result); -}; - -//export -function _toUtf8String(codePoints: Array): string { - return codePoints.map((codePoint) => { - if (codePoint <= 0xffff) { - return String.fromCharCode(codePoint); - } - codePoint -= 0x10000; - return String.fromCharCode( - (((codePoint >> 10) & 0x3ff) + 0xd800), - ((codePoint & 0x3ff) + 0xdc00) - ); - }).join(""); -} - -/** - * Returns the string represented by the UTF-8 data %%bytes%%. - * - * When %%onError%% function is specified, it is called on UTF-8 - * errors allowing recovery using the [[Utf8ErrorFunc]] API. - * (default: [error](Utf8ErrorFuncs)) - */ -export function toUtf8String(bytes: BytesLike, onError?: Utf8ErrorFunc): string { - return _toUtf8String(getUtf8CodePoints(bytes, onError)); -} - -/** - * Returns the UTF-8 code-points for %%str%%. - * - * If %%form%% is specified, the string is normalized. - */ -export function toUtf8CodePoints(str: string, form?: UnicodeNormalizationForm): Array { - return getUtf8CodePoints(toUtf8Bytes(str, form)); -} - diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/uuid.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/utils/uuid.ts deleted file mode 100644 index d82a2d5c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/utils/uuid.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Explain UUID and link to RFC here. - * - * @_subsection: api/utils:UUID [about-uuid] - */ -import { getBytes, hexlify } from "./data.js"; - -import type { BytesLike } from "./index.js"; - -/** - * Returns the version 4 [[link-uuid]] for the %%randomBytes%%. - * - * @see: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4) - */ -export function uuidV4(randomBytes: BytesLike): string { - const bytes = getBytes(randomBytes, "randomBytes"); - - // Section: 4.1.3: - // - time_hi_and_version[12:16] = 0b0100 - bytes[6] = (bytes[6] & 0x0f) | 0x40; - - // Section 4.4 - // - clock_seq_hi_and_reserved[6] = 0b0 - // - clock_seq_hi_and_reserved[7] = 0b1 - bytes[8] = (bytes[8] & 0x3f) | 0x80; - - const value = hexlify(bytes); - - return [ - value.substring(2, 10), - value.substring(10, 14), - value.substring(14, 18), - value.substring(18, 22), - value.substring(22, 34), - ].join("-"); -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/wallet/base-wallet.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/wallet/base-wallet.ts deleted file mode 100644 index bb9f6807..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/wallet/base-wallet.ts +++ /dev/null @@ -1,160 +0,0 @@ -import { getAddress, resolveAddress } from "../address/index.js"; -import { - hashAuthorization, hashMessage, TypedDataEncoder -} from "../hash/index.js"; -import { AbstractSigner, copyRequest } from "../providers/index.js"; -import { computeAddress, Transaction } from "../transaction/index.js"; -import { - defineProperties, getBigInt, resolveProperties, assert, assertArgument -} from "../utils/index.js"; - -import type { SigningKey } from "../crypto/index.js"; -import type { - AuthorizationRequest, TypedDataDomain, TypedDataField -} from "../hash/index.js"; -import type { Provider, TransactionRequest } from "../providers/index.js"; -import type { Authorization, TransactionLike } from "../transaction/index.js"; - - -/** - * The **BaseWallet** is a stream-lined implementation of a - * [[Signer]] that operates with a private key. - * - * It is preferred to use the [[Wallet]] class, as it offers - * additional functionality and simplifies loading a variety - * of JSON formats, Mnemonic Phrases, etc. - * - * This class may be of use for those attempting to implement - * a minimal Signer. - */ -export class BaseWallet extends AbstractSigner { - /** - * The wallet address. - */ - readonly address!: string; - - readonly #signingKey: SigningKey; - - /** - * Creates a new BaseWallet for %%privateKey%%, optionally - * connected to %%provider%%. - * - * If %%provider%% is not specified, only offline methods can - * be used. - */ - constructor(privateKey: SigningKey, provider?: null | Provider) { - super(provider); - - assertArgument(privateKey && typeof(privateKey.sign) === "function", "invalid private key", "privateKey", "[ REDACTED ]"); - - this.#signingKey = privateKey; - - const address = computeAddress(this.signingKey.publicKey); - defineProperties(this, { address }); - } - - // Store private values behind getters to reduce visibility - // in console.log - - /** - * The [[SigningKey]] used for signing payloads. - */ - get signingKey(): SigningKey { return this.#signingKey; } - - /** - * The private key for this wallet. - */ - get privateKey(): string { return this.signingKey.privateKey; } - - async getAddress(): Promise { return this.address; } - - connect(provider: null | Provider): BaseWallet { - return new BaseWallet(this.#signingKey, provider); - } - - async signTransaction(tx: TransactionRequest): Promise { - tx = copyRequest(tx); - - // Replace any Addressable or ENS name with an address - const { to, from } = await resolveProperties({ - to: (tx.to ? resolveAddress(tx.to, this): undefined), - from: (tx.from ? resolveAddress(tx.from, this): undefined) - }); - - if (to != null) { tx.to = to; } - if (from != null) { tx.from = from; } - - if (tx.from != null) { - assertArgument(getAddress((tx.from)) === this.address, - "transaction from address mismatch", "tx.from", tx.from); - delete tx.from; - } - - // Build the transaction - const btx = Transaction.from(>tx); - btx.signature = this.signingKey.sign(btx.unsignedHash); - - return btx.serialized; - } - - async signMessage(message: string | Uint8Array): Promise { - return this.signMessageSync(message); - } - - // @TODO: Add a secialized signTx and signTyped sync that enforces - // all parameters are known? - /** - * Returns the signature for %%message%% signed with this wallet. - */ - signMessageSync(message: string | Uint8Array): string { - return this.signingKey.sign(hashMessage(message)).serialized; - } - - /** - * Returns the Authorization for %%auth%%. - */ - authorizeSync(auth: AuthorizationRequest): Authorization { - assertArgument(typeof(auth.address) === "string", - "invalid address for authorizeSync", "auth.address", auth); - - const signature = this.signingKey.sign(hashAuthorization(auth)); - return Object.assign({ }, { - address: getAddress(auth.address), - nonce: getBigInt(auth.nonce || 0), - chainId: getBigInt(auth.chainId || 0), - }, { signature }); - } - - /** - * Resolves to the Authorization for %%auth%%. - */ - async authorize(auth: AuthorizationRequest): Promise { - auth = Object.assign({ }, auth, { - address: await resolveAddress(auth.address, this) - }); - return this.authorizeSync(await this.populateAuthorization(auth)); - } - - async signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise { - - // Populate any ENS names - const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (name: string) => { - // @TODO: this should use resolveName; addresses don't - // need a provider - - assert(this.provider != null, "cannot resolve ENS names without a provider", "UNSUPPORTED_OPERATION", { - operation: "resolveName", - info: { name } - }); - - const address = await this.provider.resolveName(name); - assert(address != null, "unconfigured ENS name", "UNCONFIGURED_NAME", { - value: name - }); - - return address; - }); - - return this.signingKey.sign(TypedDataEncoder.hash(populated.domain, types, populated.value)).serialized; - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/wallet/hdwallet.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/wallet/hdwallet.ts deleted file mode 100644 index ce0cce4e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/wallet/hdwallet.ts +++ /dev/null @@ -1,586 +0,0 @@ -/** - * Explain HD Wallets.. - * - * @_subsection: api/wallet:HD Wallets [hd-wallets] - */ -import { computeHmac, randomBytes, ripemd160, SigningKey, sha256 } from "../crypto/index.js"; -import { VoidSigner } from "../providers/index.js"; -import { computeAddress } from "../transaction/index.js"; -import { - concat, dataSlice, decodeBase58, defineProperties, encodeBase58, - getBytes, hexlify, isBytesLike, - getNumber, toBeArray, toBigInt, toBeHex, - assertPrivate, assert, assertArgument -} from "../utils/index.js"; -import { LangEn } from "../wordlists/lang-en.js"; - -import { BaseWallet } from "./base-wallet.js"; -import { Mnemonic } from "./mnemonic.js"; -import { - encryptKeystoreJson, encryptKeystoreJsonSync, -} from "./json-keystore.js"; - -import type { ProgressCallback } from "../crypto/index.js"; -import type { Provider } from "../providers/index.js"; -import type { BytesLike, Numeric } from "../utils/index.js"; -import type { Wordlist } from "../wordlists/index.js"; - -import type { KeystoreAccount } from "./json-keystore.js"; - -/** - * The default derivation path for Ethereum HD Nodes. (i.e. ``"m/44'/60'/0'/0/0"``) - */ -export const defaultPath: string = "m/44'/60'/0'/0/0"; - - -// "Bitcoin seed" -const MasterSecret = new Uint8Array([ 66, 105, 116, 99, 111, 105, 110, 32, 115, 101, 101, 100 ]); - -const HardenedBit = 0x80000000; - -const N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); - -const Nibbles = "0123456789abcdef"; -function zpad(value: number, length: number): string { - let result = ""; - while (value) { - result = Nibbles[value % 16] + result; - value = Math.trunc(value / 16); - } - while (result.length < length * 2) { result = "0" + result; } - return "0x" + result; -} - -function encodeBase58Check(_value: BytesLike): string { - const value = getBytes(_value); - const check = dataSlice(sha256(sha256(value)), 0, 4); - const bytes = concat([ value, check ]); - return encodeBase58(bytes); -} - -const _guard = { }; - -function ser_I(index: number, chainCode: string, publicKey: string, privateKey: null | string): { IL: Uint8Array, IR: Uint8Array } { - const data = new Uint8Array(37); - - if (index & HardenedBit) { - assert(privateKey != null, "cannot derive child of neutered node", "UNSUPPORTED_OPERATION", { - operation: "deriveChild" - }); - - // Data = 0x00 || ser_256(k_par) - data.set(getBytes(privateKey), 1); - - } else { - // Data = ser_p(point(k_par)) - data.set(getBytes(publicKey)); - } - - // Data += ser_32(i) - for (let i = 24; i >= 0; i -= 8) { data[33 + (i >> 3)] = ((index >> (24 - i)) & 0xff); } - const I = getBytes(computeHmac("sha512", chainCode, data)); - - return { IL: I.slice(0, 32), IR: I.slice(32) }; -} - -type HDNodeLike = { depth: number, deriveChild: (i: number) => T }; -function derivePath>(node: T, path: string): T { - const components = path.split("/"); - - assertArgument(components.length > 0, "invalid path", "path", path); - - if (components[0] === "m") { - assertArgument(node.depth === 0, `cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${ node.depth }`, "path", path); - components.shift(); - } - - let result: T = node; - for (let i = 0; i < components.length; i++) { - const component = components[i]; - - if (component.match(/^[0-9]+'$/)) { - const index = parseInt(component.substring(0, component.length - 1)); - assertArgument(index < HardenedBit, "invalid path index", `path[${ i }]`, component); - result = result.deriveChild(HardenedBit + index); - - } else if (component.match(/^[0-9]+$/)) { - const index = parseInt(component); - assertArgument(index < HardenedBit, "invalid path index", `path[${ i }]`, component); - result = result.deriveChild(index); - - } else { - assertArgument(false, "invalid path component", `path[${ i }]`, component); - } - } - - return result; -} - -/** - * An **HDNodeWallet** is a [[Signer]] backed by the private key derived - * from an HD Node using the [[link-bip-32]] stantard. - * - * An HD Node forms a hierarchal structure with each HD Node having a - * private key and the ability to derive child HD Nodes, defined by - * a path indicating the index of each child. - */ -export class HDNodeWallet extends BaseWallet { - /** - * The compressed public key. - */ - readonly publicKey!: string; - - /** - * The fingerprint. - * - * A fingerprint allows quick qay to detect parent and child nodes, - * but developers should be prepared to deal with collisions as it - * is only 4 bytes. - */ - readonly fingerprint!: string; - - /** - * The parent fingerprint. - */ - readonly parentFingerprint!: string; - - /** - * The mnemonic used to create this HD Node, if available. - * - * Sources such as extended keys do not encode the mnemonic, in - * which case this will be ``null``. - */ - readonly mnemonic!: null | Mnemonic; - - /** - * The chaincode, which is effectively a public key used - * to derive children. - */ - readonly chainCode!: string; - - /** - * The derivation path of this wallet. - * - * Since extended keys do not provide full path details, this - * may be ``null``, if instantiated from a source that does not - * encode it. - */ - readonly path!: null | string; - - /** - * The child index of this wallet. Values over ``2 *\* 31`` indicate - * the node is hardened. - */ - readonly index!: number; - - /** - * The depth of this wallet, which is the number of components - * in its path. - */ - readonly depth!: number; - - /** - * @private - */ - constructor(guard: any, signingKey: SigningKey, parentFingerprint: string, chainCode: string, path: null | string, index: number, depth: number, mnemonic: null | Mnemonic, provider: null | Provider) { - super(signingKey, provider); - assertPrivate(guard, _guard, "HDNodeWallet"); - - defineProperties(this, { publicKey: signingKey.compressedPublicKey }); - - const fingerprint = dataSlice(ripemd160(sha256(this.publicKey)), 0, 4); - defineProperties(this, { - parentFingerprint, fingerprint, - chainCode, path, index, depth - }); - - defineProperties(this, { mnemonic }); - } - - connect(provider: null | Provider): HDNodeWallet { - return new HDNodeWallet(_guard, this.signingKey, this.parentFingerprint, - this.chainCode, this.path, this.index, this.depth, this.mnemonic, provider); - } - - #account(): KeystoreAccount { - const account: KeystoreAccount = { address: this.address, privateKey: this.privateKey }; - const m = this.mnemonic; - if (this.path && m && m.wordlist.locale === "en" && m.password === "") { - account.mnemonic = { - path: this.path, - locale: "en", - entropy: m.entropy - }; - } - - return account; - } - - /** - * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with - * %%password%%. - * - * If %%progressCallback%% is specified, it will receive periodic - * updates as the encryption process progreses. - */ - async encrypt(password: Uint8Array | string, progressCallback?: ProgressCallback): Promise { - return await encryptKeystoreJson(this.#account(), password, { progressCallback }); - } - - /** - * Returns a [JSON Keystore Wallet](json-wallets) encryped with - * %%password%%. - * - * It is preferred to use the [async version](encrypt) instead, - * which allows a [[ProgressCallback]] to keep the user informed. - * - * This method will block the event loop (freezing all UI) until - * it is complete, which may be a non-trivial duration. - */ - encryptSync(password: Uint8Array | string): string { - return encryptKeystoreJsonSync(this.#account(), password); - } - - /** - * The extended key. - * - * This key will begin with the prefix ``xpriv`` and can be used to - * reconstruct this HD Node to derive its children. - */ - get extendedKey(): string { - // We only support the mainnet values for now, but if anyone needs - // testnet values, let me know. I believe current sentiment is that - // we should always use mainnet, and use BIP-44 to derive the network - // - Mainnet: public=0x0488B21E, private=0x0488ADE4 - // - Testnet: public=0x043587CF, private=0x04358394 - - assert(this.depth < 256, "Depth too deep", "UNSUPPORTED_OPERATION", { operation: "extendedKey" }); - - return encodeBase58Check(concat([ - "0x0488ADE4", zpad(this.depth, 1), this.parentFingerprint, - zpad(this.index, 4), this.chainCode, - concat([ "0x00", this.privateKey ]) - ])); - } - - /** - * Returns true if this wallet has a path, providing a Type Guard - * that the path is non-null. - */ - hasPath(): this is { path: string } { return (this.path != null); } - - /** - * Returns a neutered HD Node, which removes the private details - * of an HD Node. - * - * A neutered node has no private key, but can be used to derive - * child addresses and other public data about the HD Node. - */ - neuter(): HDNodeVoidWallet { - return new HDNodeVoidWallet(_guard, this.address, this.publicKey, - this.parentFingerprint, this.chainCode, this.path, this.index, - this.depth, this.provider); - } - - /** - * Return the child for %%index%%. - */ - deriveChild(_index: Numeric): HDNodeWallet { - const index = getNumber(_index, "index"); - assertArgument(index <= 0xffffffff, "invalid index", "index", index); - - // Base path - let path = this.path; - if (path) { - path += "/" + (index & ~HardenedBit); - if (index & HardenedBit) { path += "'"; } - } - - const { IR, IL } = ser_I(index, this.chainCode, this.publicKey, this.privateKey); - const ki = new SigningKey(toBeHex((toBigInt(IL) + BigInt(this.privateKey)) % N, 32)); - - return new HDNodeWallet(_guard, ki, this.fingerprint, hexlify(IR), - path, index, this.depth + 1, this.mnemonic, this.provider); - - } - - /** - * Return the HDNode for %%path%% from this node. - */ - derivePath(path: string): HDNodeWallet { - return derivePath(this, path); - } - - static #fromSeed(_seed: BytesLike, mnemonic: null | Mnemonic): HDNodeWallet { - assertArgument(isBytesLike(_seed), "invalid seed", "seed", "[REDACTED]"); - - const seed = getBytes(_seed, "seed"); - assertArgument(seed.length >= 16 && seed.length <= 64 , "invalid seed", "seed", "[REDACTED]"); - - const I = getBytes(computeHmac("sha512", MasterSecret, seed)); - const signingKey = new SigningKey(hexlify(I.slice(0, 32))); - - return new HDNodeWallet(_guard, signingKey, "0x00000000", hexlify(I.slice(32)), - "m", 0, 0, mnemonic, null); - } - - /** - * Creates a new HD Node from %%extendedKey%%. - * - * If the %%extendedKey%% will either have a prefix or ``xpub`` or - * ``xpriv``, returning a neutered HD Node ([[HDNodeVoidWallet]]) - * or full HD Node ([[HDNodeWallet) respectively. - */ - static fromExtendedKey(extendedKey: string): HDNodeWallet | HDNodeVoidWallet { - const bytes = toBeArray(decodeBase58(extendedKey)); // @TODO: redact - - assertArgument(bytes.length === 82 || encodeBase58Check(bytes.slice(0, 78)) === extendedKey, - "invalid extended key", "extendedKey", "[ REDACTED ]"); - - const depth = bytes[4]; - const parentFingerprint = hexlify(bytes.slice(5, 9)); - const index = parseInt(hexlify(bytes.slice(9, 13)).substring(2), 16); - const chainCode = hexlify(bytes.slice(13, 45)); - const key = bytes.slice(45, 78); - - switch (hexlify(bytes.slice(0, 4))) { - // Public Key - case "0x0488b21e": case "0x043587cf": { - const publicKey = hexlify(key); - return new HDNodeVoidWallet(_guard, computeAddress(publicKey), publicKey, - parentFingerprint, chainCode, null, index, depth, null); - } - - // Private Key - case "0x0488ade4": case "0x04358394 ": - if (key[0] !== 0) { break; } - return new HDNodeWallet(_guard, new SigningKey(key.slice(1)), - parentFingerprint, chainCode, null, index, depth, null, null); - } - - - assertArgument(false, "invalid extended key prefix", "extendedKey", "[ REDACTED ]"); - } - - /** - * Creates a new random HDNode. - */ - static createRandom(password?: string, path?: string, wordlist?: Wordlist): HDNodeWallet { - if (password == null) { password = ""; } - if (path == null) { path = defaultPath; } - if (wordlist == null) { wordlist = LangEn.wordlist(); } - const mnemonic = Mnemonic.fromEntropy(randomBytes(16), password, wordlist) - return HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path); - } - - /** - * Create an HD Node from %%mnemonic%%. - */ - static fromMnemonic(mnemonic: Mnemonic, path?: string): HDNodeWallet { - if (!path) { path = defaultPath; } - return HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path); - } - - /** - * Creates an HD Node from a mnemonic %%phrase%%. - */ - static fromPhrase(phrase: string, password?: string, path?: string, wordlist?: Wordlist): HDNodeWallet { - if (password == null) { password = ""; } - if (path == null) { path = defaultPath; } - if (wordlist == null) { wordlist = LangEn.wordlist(); } - const mnemonic = Mnemonic.fromPhrase(phrase, password, wordlist) - return HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path); - } - - /** - * Creates an HD Node from a %%seed%%. - */ - static fromSeed(seed: BytesLike): HDNodeWallet { - return HDNodeWallet.#fromSeed(seed, null); - } -} - -/** - * A **HDNodeVoidWallet** cannot sign, but provides access to - * the children nodes of a [[link-bip-32]] HD wallet addresses. - * - * The can be created by using an extended ``xpub`` key to - * [[HDNodeWallet_fromExtendedKey]] or by - * [nuetering](HDNodeWallet-neuter) a [[HDNodeWallet]]. - */ -export class HDNodeVoidWallet extends VoidSigner { - /** - * The compressed public key. - */ - readonly publicKey!: string; - - /** - * The fingerprint. - * - * A fingerprint allows quick qay to detect parent and child nodes, - * but developers should be prepared to deal with collisions as it - * is only 4 bytes. - */ - readonly fingerprint!: string; - - /** - * The parent node fingerprint. - */ - readonly parentFingerprint!: string; - - /** - * The chaincode, which is effectively a public key used - * to derive children. - */ - readonly chainCode!: string; - - /** - * The derivation path of this wallet. - * - * Since extended keys do not provider full path details, this - * may be ``null``, if instantiated from a source that does not - * enocde it. - */ - readonly path!: null | string; - - /** - * The child index of this wallet. Values over ``2 *\* 31`` indicate - * the node is hardened. - */ - readonly index!: number; - - /** - * The depth of this wallet, which is the number of components - * in its path. - */ - readonly depth!: number; - - /** - * @private - */ - constructor(guard: any, address: string, publicKey: string, parentFingerprint: string, chainCode: string, path: null | string, index: number, depth: number, provider: null | Provider) { - super(address, provider); - assertPrivate(guard, _guard, "HDNodeVoidWallet"); - - defineProperties(this, { publicKey }); - - const fingerprint = dataSlice(ripemd160(sha256(publicKey)), 0, 4); - defineProperties(this, { - publicKey, fingerprint, parentFingerprint, chainCode, path, index, depth - }); - } - - connect(provider: null | Provider): HDNodeVoidWallet { - return new HDNodeVoidWallet(_guard, this.address, this.publicKey, - this.parentFingerprint, this.chainCode, this.path, this.index, this.depth, provider); - } - - /** - * The extended key. - * - * This key will begin with the prefix ``xpub`` and can be used to - * reconstruct this neutered key to derive its children addresses. - */ - get extendedKey(): string { - // We only support the mainnet values for now, but if anyone needs - // testnet values, let me know. I believe current sentiment is that - // we should always use mainnet, and use BIP-44 to derive the network - // - Mainnet: public=0x0488B21E, private=0x0488ADE4 - // - Testnet: public=0x043587CF, private=0x04358394 - - assert(this.depth < 256, "Depth too deep", "UNSUPPORTED_OPERATION", { operation: "extendedKey" }); - - return encodeBase58Check(concat([ - "0x0488B21E", - zpad(this.depth, 1), - this.parentFingerprint, - zpad(this.index, 4), - this.chainCode, - this.publicKey, - ])); - } - - /** - * Returns true if this wallet has a path, providing a Type Guard - * that the path is non-null. - */ - hasPath(): this is { path: string } { return (this.path != null); } - - /** - * Return the child for %%index%%. - */ - deriveChild(_index: Numeric): HDNodeVoidWallet { - const index = getNumber(_index, "index"); - assertArgument(index <= 0xffffffff, "invalid index", "index", index); - - // Base path - let path = this.path; - if (path) { - path += "/" + (index & ~HardenedBit); - if (index & HardenedBit) { path += "'"; } - } - - const { IR, IL } = ser_I(index, this.chainCode, this.publicKey, null); - const Ki = SigningKey.addPoints(IL, this.publicKey, true); - - const address = computeAddress(Ki); - - return new HDNodeVoidWallet(_guard, address, Ki, this.fingerprint, hexlify(IR), - path, index, this.depth + 1, this.provider); - - } - - /** - * Return the signer for %%path%% from this node. - */ - derivePath(path: string): HDNodeVoidWallet { - return derivePath(this, path); - } -} - -/* -export class HDNodeWalletManager { - #root: HDNodeWallet; - - constructor(phrase: string, password?: null | string, path?: null | string, locale?: null | Wordlist) { - if (password == null) { password = ""; } - if (path == null) { path = "m/44'/60'/0'/0"; } - if (locale == null) { locale = LangEn.wordlist(); } - this.#root = HDNodeWallet.fromPhrase(phrase, password, path, locale); - } - - getSigner(index?: number): HDNodeWallet { - return this.#root.deriveChild((index == null) ? 0: index); - } -} -*/ - -/** - * Returns the [[link-bip-32]] path for the account at %%index%%. - * - * This is the pattern used by wallets like Ledger. - * - * There is also an [alternate pattern](getIndexedAccountPath) used by - * some software. - */ -export function getAccountPath(_index: Numeric): string { - const index = getNumber(_index, "index"); - assertArgument(index >= 0 && index < HardenedBit, "invalid account index", "index", index); - return `m/44'/60'/${ index }'/0/0`; -} - -/** - * Returns the path using an alternative pattern for deriving accounts, - * at %%index%%. - * - * This derivation path uses the //index// component rather than the - * //account// component to derive sequential accounts. - * - * This is the pattern used by wallets like MetaMask. - */ -export function getIndexedAccountPath(_index: Numeric): string { - const index = getNumber(_index, "index"); - assertArgument(index >= 0 && index < HardenedBit, "invalid account index", "index", index); - return `m/44'/60'/0'/0/${ index}`; -} - diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/wallet/index.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/wallet/index.ts deleted file mode 100644 index 4a5f1b7b..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/wallet/index.ts +++ /dev/null @@ -1,47 +0,0 @@ -/** - * When interacting with Ethereum, it is necessary to use a private - * key authenticate actions by signing a payload. - * - * Wallets are the simplest way to expose the concept of an - * //Externally Owner Account// (EOA) as it wraps a private key - * and supports high-level methods to sign common types of interaction - * and send transactions. - * - * The class most developers will want to use is [[Wallet]], which - * can load a private key directly or from any common wallet format. - * - * The [[HDNodeWallet]] can be used when it is necessary to access - * low-level details of how an HD wallets are derived, exported - * or imported. - * - * @_section: api/wallet:Wallets [about-wallets] - */ - -export { BaseWallet } from "./base-wallet.js"; - -export { - defaultPath, - - getAccountPath, getIndexedAccountPath, - - HDNodeWallet, - HDNodeVoidWallet, -} from "./hdwallet.js"; - -export { isCrowdsaleJson, decryptCrowdsaleJson } from "./json-crowdsale.js"; - -export { - isKeystoreJson, - decryptKeystoreJsonSync, decryptKeystoreJson, - encryptKeystoreJson, encryptKeystoreJsonSync -} from "./json-keystore.js"; - -export { Mnemonic } from "./mnemonic.js"; - -export { Wallet } from "./wallet.js"; - - -export type { CrowdsaleAccount } from "./json-crowdsale.js"; -export type { - KeystoreAccount, EncryptOptions -} from "./json-keystore.js" diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/wallet/json-crowdsale.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/wallet/json-crowdsale.ts deleted file mode 100644 index 7a1180aa..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/wallet/json-crowdsale.ts +++ /dev/null @@ -1,74 +0,0 @@ -/** - * @_subsection: api/wallet:JSON Wallets [json-wallets] - */ - -import { CBC, pkcs7Strip } from "aes-js"; - -import { getAddress } from "../address/index.js"; -import { pbkdf2 } from "../crypto/index.js"; -import { id } from "../hash/index.js"; -import { getBytes, assertArgument } from "../utils/index.js"; - -import { getPassword, looseArrayify, spelunk } from "./utils.js"; - - -/** - * The data stored within a JSON Crowdsale wallet is fairly - * minimal. - */ -export type CrowdsaleAccount = { - privateKey: string; - address: string; -} - -/** - * Returns true if %%json%% is a valid JSON Crowdsale wallet. - */ -export function isCrowdsaleJson(json: string): boolean { - try { - const data = JSON.parse(json); - if (data.encseed) { return true; } - } catch (error) { } - return false; -} - -// See: https://github.com/ethereum/pyethsaletool - -/** - * Before Ethereum launched, it was necessary to create a wallet - * format for backers to use, which would be used to receive ether - * as a reward for contributing to the project. - * - * The [[link-crowdsale]] format is now obsolete, but it is still - * useful to support and the additional code is fairly trivial as - * all the primitives required are used through core portions of - * the library. - */ -export function decryptCrowdsaleJson(json: string, _password: string | Uint8Array): CrowdsaleAccount { - const data = JSON.parse(json); - const password = getPassword(_password); - - // Ethereum Address - const address = getAddress(spelunk(data, "ethaddr:string!")); - - // Encrypted Seed - const encseed = looseArrayify(spelunk(data, "encseed:string!")); - assertArgument(encseed && (encseed.length % 16) === 0, "invalid encseed", "json", json); - - const key = getBytes(pbkdf2(password, password, 2000, 32, "sha256")).slice(0, 16); - - const iv = encseed.slice(0, 16); - const encryptedSeed = encseed.slice(16); - - // Decrypt the seed - const aesCbc = new CBC(key, iv); - const seed = pkcs7Strip(getBytes(aesCbc.decrypt(encryptedSeed))); - - // This wallet format is weird... Convert the binary encoded hex to a string. - let seedHex = ""; - for (let i = 0; i < seed.length; i++) { - seedHex += String.fromCharCode(seed[i]); - } - - return { address, privateKey: id(seedHex) }; -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/wallet/json-keystore.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/wallet/json-keystore.ts deleted file mode 100644 index 0a53bbc9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/wallet/json-keystore.ts +++ /dev/null @@ -1,389 +0,0 @@ -/** - * The JSON Wallet formats allow a simple way to store the private - * keys needed in Ethereum along with related information and allows - * for extensible forms of encryption. - * - * These utilities facilitate decrypting and encrypting the most common - * JSON Wallet formats. - * - * @_subsection: api/wallet:JSON Wallets [json-wallets] - */ - -import { CTR } from "aes-js"; - -import { getAddress } from "../address/index.js"; -import { keccak256, pbkdf2, randomBytes, scrypt, scryptSync } from "../crypto/index.js"; -import { computeAddress } from "../transaction/index.js"; -import { - concat, getBytes, hexlify, uuidV4, assert, assertArgument -} from "../utils/index.js"; - -import { getPassword, spelunk, zpad } from "./utils.js"; - -import type { ProgressCallback } from "../crypto/index.js"; -import type { BytesLike } from "../utils/index.js"; - -import { version } from "../_version.js"; - - -const defaultPath = "m/44'/60'/0'/0/0"; - -/** - * The contents of a JSON Keystore Wallet. - */ -export type KeystoreAccount = { - address: string; - privateKey: string; - mnemonic?: { - path?: string; - locale?: string; - entropy: string; - } -}; - -/** - * The parameters to use when encrypting a JSON Keystore Wallet. - */ -export type EncryptOptions = { - progressCallback?: ProgressCallback; - iv?: BytesLike; - entropy?: BytesLike; - client?: string; - salt?: BytesLike; - uuid?: string; - scrypt?: { - N?: number; - r?: number; - p?: number; - } -} - -/** - * Returns true if %%json%% is a valid JSON Keystore Wallet. - */ -export function isKeystoreJson(json: string): boolean { - try { - const data = JSON.parse(json); - const version = ((data.version != null) ? parseInt(data.version): 0); - if (version === 3) { return true; } - } catch (error) { } - return false; -} - -function decrypt(data: any, key: Uint8Array, ciphertext: Uint8Array): string { - const cipher = spelunk(data, "crypto.cipher:string"); - if (cipher === "aes-128-ctr") { - const iv = spelunk(data, "crypto.cipherparams.iv:data!") - const aesCtr = new CTR(key, iv); - return hexlify(aesCtr.decrypt(ciphertext)); - } - - assert(false, "unsupported cipher", "UNSUPPORTED_OPERATION", { - operation: "decrypt" - }); -} - -function getAccount(data: any, _key: string): KeystoreAccount { - const key = getBytes(_key); - const ciphertext = spelunk(data, "crypto.ciphertext:data!"); - - const computedMAC = hexlify(keccak256(concat([ key.slice(16, 32), ciphertext ]))).substring(2); - assertArgument(computedMAC === spelunk(data, "crypto.mac:string!").toLowerCase(), - "incorrect password", "password", "[ REDACTED ]"); - - const privateKey = decrypt(data, key.slice(0, 16), ciphertext); - - const address = computeAddress(privateKey); - if (data.address) { - let check = data.address.toLowerCase(); - if (!check.startsWith("0x")) { check = "0x" + check; } - - assertArgument(getAddress(check) === address, "keystore address/privateKey mismatch", "address", data.address); - } - - const account: KeystoreAccount = { address, privateKey }; - - // Version 0.1 x-ethers metadata must contain an encrypted mnemonic phrase - const version = spelunk(data, "x-ethers.version:string"); - if (version === "0.1") { - const mnemonicKey = key.slice(32, 64); - - const mnemonicCiphertext = spelunk(data, "x-ethers.mnemonicCiphertext:data!"); - const mnemonicIv = spelunk(data, "x-ethers.mnemonicCounter:data!"); - - const mnemonicAesCtr = new CTR(mnemonicKey, mnemonicIv); - - account.mnemonic = { - path: (spelunk(data, "x-ethers.path:string") || defaultPath), - locale: (spelunk(data, "x-ethers.locale:string") || "en"), - entropy: hexlify(getBytes(mnemonicAesCtr.decrypt(mnemonicCiphertext))) - }; - } - - return account; -} - -type ScryptParams = { - name: "scrypt"; - salt: Uint8Array; - N: number; - r: number; - p: number; - dkLen: number; -}; - -type KdfParams = ScryptParams | { - name: "pbkdf2"; - salt: Uint8Array; - count: number; - dkLen: number; - algorithm: "sha256" | "sha512"; -}; - -function getDecryptKdfParams(data: any): KdfParams { - const kdf = spelunk(data, "crypto.kdf:string"); - if (kdf && typeof(kdf) === "string") { - if (kdf.toLowerCase() === "scrypt") { - const salt = spelunk(data, "crypto.kdfparams.salt:data!"); - const N = spelunk(data, "crypto.kdfparams.n:int!"); - const r = spelunk(data, "crypto.kdfparams.r:int!"); - const p = spelunk(data, "crypto.kdfparams.p:int!"); - - // Make sure N is a power of 2 - assertArgument(N > 0 && (N & (N - 1)) === 0, "invalid kdf.N", "kdf.N", N); - assertArgument(r > 0 && p > 0, "invalid kdf", "kdf", kdf); - - const dkLen = spelunk(data, "crypto.kdfparams.dklen:int!"); - assertArgument(dkLen === 32, "invalid kdf.dklen", "kdf.dflen", dkLen); - - return { name: "scrypt", salt, N, r, p, dkLen: 64 }; - - } else if (kdf.toLowerCase() === "pbkdf2") { - - const salt = spelunk(data, "crypto.kdfparams.salt:data!"); - - const prf = spelunk(data, "crypto.kdfparams.prf:string!"); - const algorithm = prf.split("-").pop(); - assertArgument(algorithm === "sha256" || algorithm === "sha512", "invalid kdf.pdf", "kdf.pdf", prf); - - const count = spelunk(data, "crypto.kdfparams.c:int!"); - - const dkLen = spelunk(data, "crypto.kdfparams.dklen:int!"); - assertArgument(dkLen === 32, "invalid kdf.dklen", "kdf.dklen", dkLen); - - return { name: "pbkdf2", salt, count, dkLen, algorithm }; - } - } - - assertArgument(false, "unsupported key-derivation function", "kdf", kdf); -} - - -/** - * Returns the account details for the JSON Keystore Wallet %%json%% - * using %%password%%. - * - * It is preferred to use the [async version](decryptKeystoreJson) - * instead, which allows a [[ProgressCallback]] to keep the user informed - * as to the decryption status. - * - * This method will block the event loop (freezing all UI) until decryption - * is complete, which can take quite some time, depending on the wallet - * paramters and platform. - */ -export function decryptKeystoreJsonSync(json: string, _password: string | Uint8Array): KeystoreAccount { - const data = JSON.parse(json); - - const password = getPassword(_password); - - const params = getDecryptKdfParams(data); - if (params.name === "pbkdf2") { - const { salt, count, dkLen, algorithm } = params; - const key = pbkdf2(password, salt, count, dkLen, algorithm); - return getAccount(data, key); - } - - assert(params.name === "scrypt", "cannot be reached", "UNKNOWN_ERROR", { params }) - - const { salt, N, r, p, dkLen } = params; - const key = scryptSync(password, salt, N, r, p, dkLen); - return getAccount(data, key); -} - -function stall(duration: number): Promise { - return new Promise((resolve) => { setTimeout(() => { resolve(); }, duration); }); -} - -/** - * Resolves to the decrypted JSON Keystore Wallet %%json%% using the - * %%password%%. - * - * If provided, %%progress%% will be called periodically during the - * decrpytion to provide feedback, and if the function returns - * ``false`` will halt decryption. - * - * The %%progressCallback%% will **always** receive ``0`` before - * decryption begins and ``1`` when complete. - */ -export async function decryptKeystoreJson(json: string, _password: string | Uint8Array, progress?: ProgressCallback): Promise { - const data = JSON.parse(json); - - const password = getPassword(_password); - - const params = getDecryptKdfParams(data); - if (params.name === "pbkdf2") { - if (progress) { - progress(0); - await stall(0); - } - const { salt, count, dkLen, algorithm } = params; - const key = pbkdf2(password, salt, count, dkLen, algorithm); - if (progress) { - progress(1); - await stall(0); - } - return getAccount(data, key); - } - - assert(params.name === "scrypt", "cannot be reached", "UNKNOWN_ERROR", { params }) - - const { salt, N, r, p, dkLen } = params; - const key = await scrypt(password, salt, N, r, p, dkLen, progress); - return getAccount(data, key); -} - -function getEncryptKdfParams(options: EncryptOptions): ScryptParams { - // Check/generate the salt - const salt = (options.salt != null) ? getBytes(options.salt, "options.salt"): randomBytes(32); - - // Override the scrypt password-based key derivation function parameters - let N = (1 << 17), r = 8, p = 1; - if (options.scrypt) { - if (options.scrypt.N) { N = options.scrypt.N; } - if (options.scrypt.r) { r = options.scrypt.r; } - if (options.scrypt.p) { p = options.scrypt.p; } - } - assertArgument(typeof(N) === "number" && N > 0 && Number.isSafeInteger(N) && (BigInt(N) & BigInt(N - 1)) === BigInt(0), "invalid scrypt N parameter", "options.N", N); - assertArgument(typeof(r) === "number" && r > 0 && Number.isSafeInteger(r), "invalid scrypt r parameter", "options.r", r); - assertArgument(typeof(p) === "number" && p > 0 && Number.isSafeInteger(p), "invalid scrypt p parameter", "options.p", p); - - return { name: "scrypt", dkLen: 32, salt, N, r, p }; -} - -function _encryptKeystore(key: Uint8Array, kdf: ScryptParams, account: KeystoreAccount, options: EncryptOptions): any { - - const privateKey = getBytes(account.privateKey, "privateKey"); - - // Override initialization vector - const iv = (options.iv != null) ? getBytes(options.iv, "options.iv"): randomBytes(16); - assertArgument(iv.length === 16, "invalid options.iv length", "options.iv", options.iv); - - // Override the uuid - const uuidRandom = (options.uuid != null) ? getBytes(options.uuid, "options.uuid"): randomBytes(16); - assertArgument(uuidRandom.length === 16, "invalid options.uuid length", "options.uuid", options.iv); - - // This will be used to encrypt the wallet (as per Web3 secret storage) - // - 32 bytes As normal for the Web3 secret storage (derivedKey, macPrefix) - // - 32 bytes AES key to encrypt mnemonic with (required here to be Ethers Wallet) - const derivedKey = key.slice(0, 16); - const macPrefix = key.slice(16, 32); - - // Encrypt the private key - const aesCtr = new CTR(derivedKey, iv); - const ciphertext = getBytes(aesCtr.encrypt(privateKey)); - - // Compute the message authentication code, used to check the password - const mac = keccak256(concat([ macPrefix, ciphertext ])) - - // See: https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition - const data: { [key: string]: any } = { - address: account.address.substring(2).toLowerCase(), - id: uuidV4(uuidRandom), - version: 3, - Crypto: { - cipher: "aes-128-ctr", - cipherparams: { - iv: hexlify(iv).substring(2), - }, - ciphertext: hexlify(ciphertext).substring(2), - kdf: "scrypt", - kdfparams: { - salt: hexlify(kdf.salt).substring(2), - n: kdf.N, - dklen: 32, - p: kdf.p, - r: kdf.r - }, - mac: mac.substring(2) - } - }; - - // If we have a mnemonic, encrypt it into the JSON wallet - if (account.mnemonic) { - const client = (options.client != null) ? options.client: `ethers/${ version }`; - - const path = account.mnemonic.path || defaultPath; - const locale = account.mnemonic.locale || "en"; - - const mnemonicKey = key.slice(32, 64); - - const entropy = getBytes(account.mnemonic.entropy, "account.mnemonic.entropy"); - const mnemonicIv = randomBytes(16); - const mnemonicAesCtr = new CTR(mnemonicKey, mnemonicIv); - const mnemonicCiphertext = getBytes(mnemonicAesCtr.encrypt(entropy)); - - const now = new Date(); - const timestamp = (now.getUTCFullYear() + "-" + - zpad(now.getUTCMonth() + 1, 2) + "-" + - zpad(now.getUTCDate(), 2) + "T" + - zpad(now.getUTCHours(), 2) + "-" + - zpad(now.getUTCMinutes(), 2) + "-" + - zpad(now.getUTCSeconds(), 2) + ".0Z"); - const gethFilename = ("UTC--" + timestamp + "--" + data.address); - - data["x-ethers"] = { - client, gethFilename, path, locale, - mnemonicCounter: hexlify(mnemonicIv).substring(2), - mnemonicCiphertext: hexlify(mnemonicCiphertext).substring(2), - version: "0.1" - }; - } - - return JSON.stringify(data); -} - -/** - * Return the JSON Keystore Wallet for %%account%% encrypted with - * %%password%%. - * - * The %%options%% can be used to tune the password-based key - * derivation function parameters, explicitly set the random values - * used. Any provided [[ProgressCallback]] is ignord. - */ -export function encryptKeystoreJsonSync(account: KeystoreAccount, password: string | Uint8Array, options?: EncryptOptions): string { - if (options == null) { options = { }; } - - const passwordBytes = getPassword(password); - const kdf = getEncryptKdfParams(options); - const key = scryptSync(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64); - return _encryptKeystore(getBytes(key), kdf, account, options); -} - -/** - * Resolved to the JSON Keystore Wallet for %%account%% encrypted - * with %%password%%. - * - * The %%options%% can be used to tune the password-based key - * derivation function parameters, explicitly set the random values - * used and provide a [[ProgressCallback]] to receive periodic updates - * on the completion status.. - */ -export async function encryptKeystoreJson(account: KeystoreAccount, password: string | Uint8Array, options?: EncryptOptions): Promise { - if (options == null) { options = { }; } - - const passwordBytes = getPassword(password); - const kdf = getEncryptKdfParams(options); - const key = await scrypt(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64, options.progressCallback); - return _encryptKeystore(getBytes(key), kdf, account, options); -} - diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/wallet/mnemonic.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/wallet/mnemonic.ts deleted file mode 100644 index e133888c..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/wallet/mnemonic.ts +++ /dev/null @@ -1,203 +0,0 @@ -import { pbkdf2, sha256 } from "../crypto/index.js"; -import { - defineProperties, getBytes, hexlify, assertNormalize, assertPrivate, assertArgument, toUtf8Bytes -} from "../utils/index.js"; -import { LangEn } from "../wordlists/lang-en.js"; - -import type { BytesLike } from "../utils/index.js"; -import type { Wordlist } from "../wordlists/index.js"; - - -// Returns a byte with the MSB bits set -function getUpperMask(bits: number): number { - return ((1 << bits) - 1) << (8 - bits) & 0xff; -} - -// Returns a byte with the LSB bits set -function getLowerMask(bits: number): number { - return ((1 << bits) - 1) & 0xff; -} - - -function mnemonicToEntropy(mnemonic: string, wordlist?: null | Wordlist): string { - assertNormalize("NFKD"); - - if (wordlist == null) { wordlist = LangEn.wordlist(); } - - const words = wordlist.split(mnemonic); - assertArgument((words.length % 3) === 0 && words.length >= 12 && words.length <= 24, - "invalid mnemonic length", "mnemonic", "[ REDACTED ]"); - - const entropy = new Uint8Array(Math.ceil(11 * words.length / 8)); - - let offset = 0; - for (let i = 0; i < words.length; i++) { - let index = wordlist.getWordIndex(words[i].normalize("NFKD")); - assertArgument(index >= 0, `invalid mnemonic word at index ${ i }`, "mnemonic", "[ REDACTED ]"); - - for (let bit = 0; bit < 11; bit++) { - if (index & (1 << (10 - bit))) { - entropy[offset >> 3] |= (1 << (7 - (offset % 8))); - } - offset++; - } - } - - const entropyBits = 32 * words.length / 3; - - - const checksumBits = words.length / 3; - const checksumMask = getUpperMask(checksumBits); - - const checksum = getBytes(sha256(entropy.slice(0, entropyBits / 8)))[0] & checksumMask; - - assertArgument(checksum === (entropy[entropy.length - 1] & checksumMask), - "invalid mnemonic checksum", "mnemonic", "[ REDACTED ]"); - - return hexlify(entropy.slice(0, entropyBits / 8)); -} - -function entropyToMnemonic(entropy: Uint8Array, wordlist?: null | Wordlist): string { - - assertArgument((entropy.length % 4) === 0 && entropy.length >= 16 && entropy.length <= 32, - "invalid entropy size", "entropy", "[ REDACTED ]"); - - if (wordlist == null) { wordlist = LangEn.wordlist(); } - - const indices: Array = [ 0 ]; - - let remainingBits = 11; - for (let i = 0; i < entropy.length; i++) { - - // Consume the whole byte (with still more to go) - if (remainingBits > 8) { - indices[indices.length - 1] <<= 8; - indices[indices.length - 1] |= entropy[i]; - - remainingBits -= 8; - - // This byte will complete an 11-bit index - } else { - indices[indices.length - 1] <<= remainingBits; - indices[indices.length - 1] |= entropy[i] >> (8 - remainingBits); - - // Start the next word - indices.push(entropy[i] & getLowerMask(8 - remainingBits)); - - remainingBits += 3; - } - } - - // Compute the checksum bits - const checksumBits = entropy.length / 4; - const checksum = parseInt(sha256(entropy).substring(2, 4), 16) & getUpperMask(checksumBits); - - // Shift the checksum into the word indices - indices[indices.length - 1] <<= checksumBits; - indices[indices.length - 1] |= (checksum >> (8 - checksumBits)); - - return wordlist.join(indices.map((index) => (wordlist).getWord(index))); -} - -const _guard = { }; - -/** - * A **Mnemonic** wraps all properties required to compute [[link-bip-39]] - * seeds and convert between phrases and entropy. - */ -export class Mnemonic { - /** - * The mnemonic phrase of 12, 15, 18, 21 or 24 words. - * - * Use the [[wordlist]] ``split`` method to get the individual words. - */ - readonly phrase!: string; - - /** - * The password used for this mnemonic. If no password is used this - * is the empty string (i.e. ``""``) as per the specification. - */ - readonly password!: string; - - /** - * The wordlist for this mnemonic. - */ - readonly wordlist!: Wordlist; - - /** - * The underlying entropy which the mnemonic encodes. - */ - readonly entropy!: string; - - /** - * @private - */ - constructor(guard: any, entropy: string, phrase: string, password?: null | string, wordlist?: null | Wordlist) { - if (password == null) { password = ""; } - if (wordlist == null) { wordlist = LangEn.wordlist(); } - assertPrivate(guard, _guard, "Mnemonic"); - defineProperties(this, { phrase, password, wordlist, entropy }); - } - - /** - * Returns the seed for the mnemonic. - */ - computeSeed(): string { - const salt = toUtf8Bytes("mnemonic" + this.password, "NFKD"); - return pbkdf2(toUtf8Bytes(this.phrase, "NFKD"), salt, 2048, 64, "sha512"); - } - - /** - * Creates a new Mnemonic for the %%phrase%%. - * - * The default %%password%% is the empty string and the default - * wordlist is the [English wordlists](LangEn). - */ - static fromPhrase(phrase: string, password?: null | string, wordlist?: null | Wordlist): Mnemonic { - // Normalize the case and space; throws if invalid - const entropy = mnemonicToEntropy(phrase, wordlist); - phrase = entropyToMnemonic(getBytes(entropy), wordlist); - return new Mnemonic(_guard, entropy, phrase, password, wordlist); - } - - /** - * Create a new **Mnemonic** from the %%entropy%%. - * - * The default %%password%% is the empty string and the default - * wordlist is the [English wordlists](LangEn). - */ - static fromEntropy(_entropy: BytesLike, password?: null | string, wordlist?: null | Wordlist): Mnemonic { - const entropy = getBytes(_entropy, "entropy"); - const phrase = entropyToMnemonic(entropy, wordlist); - return new Mnemonic(_guard, hexlify(entropy), phrase, password, wordlist); - } - - /** - * Returns the phrase for %%mnemonic%%. - */ - static entropyToPhrase(_entropy: BytesLike, wordlist?: null | Wordlist): string { - const entropy = getBytes(_entropy, "entropy"); - return entropyToMnemonic(entropy, wordlist); - } - - /** - * Returns the entropy for %%phrase%%. - */ - static phraseToEntropy(phrase: string, wordlist?: null | Wordlist): string { - return mnemonicToEntropy(phrase, wordlist); - } - - /** - * Returns true if %%phrase%% is a valid [[link-bip-39]] phrase. - * - * This checks all the provided words belong to the %%wordlist%%, - * that the length is valid and the checksum is correct. - */ - static isValidMnemonic(phrase: string, wordlist?: null | Wordlist): boolean { - try { - mnemonicToEntropy(phrase, wordlist); - return true; - } catch (error) { } - return false; - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/wallet/utils.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/wallet/utils.ts deleted file mode 100644 index 5c79d1b9..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/wallet/utils.ts +++ /dev/null @@ -1,147 +0,0 @@ -/** - * @_ignore - */ - -import { - getBytesCopy, assertArgument, toUtf8Bytes -} from "../utils/index.js"; - -export function looseArrayify(hexString: string): Uint8Array { - if (typeof(hexString) === "string" && !hexString.startsWith("0x")) { - hexString = "0x" + hexString; - } - return getBytesCopy(hexString); -} - -export function zpad(value: String | number, length: number): String { - value = String(value); - while (value.length < length) { value = '0' + value; } - return value; -} - -export function getPassword(password: string | Uint8Array): Uint8Array { - if (typeof(password) === 'string') { - return toUtf8Bytes(password, "NFKC"); - } - return getBytesCopy(password); -} - -export function spelunk(object: any, _path: string): T { - - const match = _path.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i); - assertArgument(match != null, "invalid path", "path", _path); - - const path = match[1]; - const type = match[3]; - const reqd = (match[4] === "!"); - - let cur = object; - for (const comp of path.toLowerCase().split('.')) { - - // Search for a child object with a case-insensitive matching key - if (Array.isArray(cur)) { - if (!comp.match(/^[0-9]+$/)) { break; } - cur = cur[parseInt(comp)]; - - } else if (typeof(cur) === "object") { - let found: any = null; - for (const key in cur) { - if (key.toLowerCase() === comp) { - found = cur[key]; - break; - } - } - cur = found; - - } else { - cur = null; - } - - if (cur == null) { break; } - } - - assertArgument(!reqd || cur != null, "missing required value", "path", path); - - if (type && cur != null) { - if (type === "int") { - if (typeof(cur) === "string" && cur.match(/^-?[0-9]+$/)) { - return parseInt(cur); - } else if (Number.isSafeInteger(cur)) { - return cur; - } - } - - if (type === "number") { - if (typeof(cur) === "string" && cur.match(/^-?[0-9.]*$/)) { - return parseFloat(cur); - } - } - - if (type === "data") { - if (typeof(cur) === "string") { return looseArrayify(cur); } - } - - if (type === "array" && Array.isArray(cur)) { return cur; } - if (type === typeof(cur)) { return cur; } - - assertArgument(false, `wrong type found for ${ type } `, "path", path); - } - - return cur; -} -/* -export function follow(object: any, path: string): null | string { - let currentChild = object; - - for (const comp of path.toLowerCase().split('/')) { - - // Search for a child object with a case-insensitive matching key - let matchingChild = null; - for (const key in currentChild) { - if (key.toLowerCase() === comp) { - matchingChild = currentChild[key]; - break; - } - } - - if (matchingChild === null) { return null; } - - currentChild = matchingChild; - } - - return currentChild; -} - -// "path/to/something:type!" -export function followRequired(data: any, path: string): string { - const value = follow(data, path); - if (value != null) { return value; } - return logger.throwArgumentError("invalid value", `data:${ path }`, - JSON.stringify(data)); -} -*/ -// See: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4) -/* -export function uuidV4(randomBytes: BytesLike): string { - const bytes = getBytes(randomBytes, "randomBytes"); - - // Section: 4.1.3: - // - time_hi_and_version[12:16] = 0b0100 - bytes[6] = (bytes[6] & 0x0f) | 0x40; - - // Section 4.4 - // - clock_seq_hi_and_reserved[6] = 0b0 - // - clock_seq_hi_and_reserved[7] = 0b1 - bytes[8] = (bytes[8] & 0x3f) | 0x80; - - const value = hexlify(bytes); - - return [ - value.substring(2, 10), - value.substring(10, 14), - value.substring(14, 18), - value.substring(18, 22), - value.substring(22, 34), - ].join("-"); -} -*/ diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/wallet/wallet.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/wallet/wallet.ts deleted file mode 100644 index ed17f79f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/wallet/wallet.ts +++ /dev/null @@ -1,163 +0,0 @@ -import { SigningKey } from "../crypto/index.js"; -import { assertArgument } from "../utils/index.js"; - -import { BaseWallet } from "./base-wallet.js"; -import { HDNodeWallet } from "./hdwallet.js"; -import { decryptCrowdsaleJson, isCrowdsaleJson } from "./json-crowdsale.js"; -import { - decryptKeystoreJson, decryptKeystoreJsonSync, - encryptKeystoreJson, encryptKeystoreJsonSync, - isKeystoreJson -} from "./json-keystore.js"; -import { Mnemonic } from "./mnemonic.js"; - -import type { ProgressCallback } from "../crypto/index.js"; -import type { Provider } from "../providers/index.js"; - -import type { CrowdsaleAccount } from "./json-crowdsale.js"; -import type { KeystoreAccount } from "./json-keystore.js"; - - -function stall(duration: number): Promise { - return new Promise((resolve) => { setTimeout(() => { resolve(); }, duration); }); -} - -/** - * A **Wallet** manages a single private key which is used to sign - * transactions, messages and other common payloads. - * - * This class is generally the main entry point for developers - * that wish to use a private key directly, as it can create - * instances from a large variety of common sources, including - * raw private key, [[link-bip-39]] mnemonics and encrypte JSON - * wallets. - */ -export class Wallet extends BaseWallet { - - /** - * Create a new wallet for the private %%key%%, optionally connected - * to %%provider%%. - */ - constructor(key: string | SigningKey, provider?: null | Provider) { - if (typeof(key) === "string" && !key.startsWith("0x")) { - key = "0x" + key; - } - - let signingKey = (typeof(key) === "string") ? new SigningKey(key): key; - super(signingKey, provider); - } - - connect(provider: null | Provider): Wallet { - return new Wallet(this.signingKey, provider); - } - - /** - * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with - * %%password%%. - * - * If %%progressCallback%% is specified, it will receive periodic - * updates as the encryption process progreses. - */ - async encrypt(password: Uint8Array | string, progressCallback?: ProgressCallback): Promise { - const account = { address: this.address, privateKey: this.privateKey }; - return await encryptKeystoreJson(account, password, { progressCallback }); - } - - /** - * Returns a [JSON Keystore Wallet](json-wallets) encryped with - * %%password%%. - * - * It is preferred to use the [async version](encrypt) instead, - * which allows a [[ProgressCallback]] to keep the user informed. - * - * This method will block the event loop (freezing all UI) until - * it is complete, which may be a non-trivial duration. - */ - encryptSync(password: Uint8Array | string): string { - const account = { address: this.address, privateKey: this.privateKey }; - return encryptKeystoreJsonSync(account, password); - } - - static #fromAccount(account: null | CrowdsaleAccount | KeystoreAccount): HDNodeWallet | Wallet { - assertArgument(account, "invalid JSON wallet", "json", "[ REDACTED ]"); - - if ("mnemonic" in account && account.mnemonic && account.mnemonic.locale === "en") { - const mnemonic = Mnemonic.fromEntropy(account.mnemonic.entropy); - const wallet = HDNodeWallet.fromMnemonic(mnemonic, account.mnemonic.path); - if (wallet.address === account.address && wallet.privateKey === account.privateKey) { - return wallet; - } - console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key"); - } - - const wallet = new Wallet(account.privateKey); - - assertArgument(wallet.address === account.address, - "address/privateKey mismatch", "json", "[ REDACTED ]"); - - return wallet; - } - - /** - * Creates (asynchronously) a **Wallet** by decrypting the %%json%% - * with %%password%%. - * - * If %%progress%% is provided, it is called periodically during - * decryption so that any UI can be updated. - */ - static async fromEncryptedJson(json: string, password: Uint8Array | string, progress?: ProgressCallback): Promise { - let account: null | CrowdsaleAccount | KeystoreAccount = null; - if (isKeystoreJson(json)) { - account = await decryptKeystoreJson(json, password, progress); - - } else if (isCrowdsaleJson(json)) { - if (progress) { progress(0); await stall(0); } - account = decryptCrowdsaleJson(json, password); - if (progress) { progress(1); await stall(0); } - - } - - return Wallet.#fromAccount(account); - } - - /** - * Creates a **Wallet** by decrypting the %%json%% with %%password%%. - * - * The [[fromEncryptedJson]] method is preferred, as this method - * will lock up and freeze the UI during decryption, which may take - * some time. - */ - static fromEncryptedJsonSync(json: string, password: Uint8Array | string): HDNodeWallet | Wallet { - let account: null | CrowdsaleAccount | KeystoreAccount = null; - if (isKeystoreJson(json)) { - account = decryptKeystoreJsonSync(json, password); - } else if (isCrowdsaleJson(json)) { - account = decryptCrowdsaleJson(json, password); - } else { - assertArgument(false, "invalid JSON wallet", "json", "[ REDACTED ]"); - } - - return Wallet.#fromAccount(account); - } - - /** - * Creates a new random [[HDNodeWallet]] using the available - * [cryptographic random source](randomBytes). - * - * If there is no crytographic random source, this will throw. - */ - static createRandom(provider?: null | Provider): HDNodeWallet { - const wallet = HDNodeWallet.createRandom(); - if (provider) { return wallet.connect(provider); } - return wallet; - } - - /** - * Creates a [[HDNodeWallet]] for %%phrase%%. - */ - static fromPhrase(phrase: string, provider?: Provider): HDNodeWallet { - const wallet = HDNodeWallet.fromPhrase(phrase); - if (provider) { return wallet.connect(provider); } - return wallet; - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/bit-reader.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/bit-reader.ts deleted file mode 100644 index bec9d474..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/bit-reader.ts +++ /dev/null @@ -1,35 +0,0 @@ -const Base64 = ")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_"; - -/** - * @_ignore - */ -export function decodeBits(width: number, data: string): Array { - const maxValue = (1 << width) - 1; - const result: Array = [ ]; - let accum = 0, bits = 0, flood = 0; - for (let i = 0; i < data.length; i++) { - - // Accumulate 6 bits of data - accum = ((accum << 6) | Base64.indexOf(data[i])); - bits += 6; - - // While we have enough for a word... - while (bits >= width) { - // ...read the word - const value = (accum >> (bits - width)); - accum &= (1 << (bits - width)) - 1; - bits -= width; - - // A value of 0 indicates we exceeded maxValue, it - // floods over into the next value - if (value === 0) { - flood += maxValue; - } else { - result.push(value + flood); - flood = 0; - } - } - } - - return result; -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/decode-owl.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/decode-owl.ts deleted file mode 100644 index c82ed7f8..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/decode-owl.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { assertArgument } from "../utils/index.js"; - - -const subsChrs = " !#$%&'()*+,-./<=>?@[]^_`{|}~"; -const Word = /^[a-z]*$/i; - -function unfold(words: Array, sep: string): Array { - let initial = 97; - return words.reduce((accum, word) => { - if (word === sep) { - initial++; - } else if (word.match(Word)) { - accum.push(String.fromCharCode(initial) + word); - } else { - initial = 97; - accum.push(word); - } - return accum; - }, >[]); -} - -/** - * @_ignore - */ -export function decode(data: string, subs: string): Array { - - // Replace all the substitutions with their expanded form - for (let i = subsChrs.length - 1; i >= 0; i--) { - data = data.split(subsChrs[i]).join(subs.substring(2 * i, 2 * i + 2)); - } - - // Get all tle clumps; each suffix, first-increment and second-increment - const clumps: Array = [ ]; - const leftover = data.replace(/(:|([0-9])|([A-Z][a-z]*))/g, (all, item, semi, word) => { - if (semi) { - for (let i = parseInt(semi); i >= 0; i--) { clumps.push(";"); } - } else { - clumps.push(item.toLowerCase()); - } - return ""; - }); - /* c8 ignore start */ - if (leftover) { throw new Error(`leftovers: ${ JSON.stringify(leftover) }`); } - /* c8 ignore stop */ - - return unfold(unfold(clumps, ";"), ":"); -} - -/** - * @_ignore - */ -export function decodeOwl(data: string): Array { - assertArgument(data[0] === "0", "unsupported auwl data", "data", data); - - return decode( - data.substring(1 + 2 * subsChrs.length), - data.substring(1, 1 + 2 * subsChrs.length)); -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/decode-owla.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/decode-owla.ts deleted file mode 100644 index d753395a..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/decode-owla.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { assertArgument } from "../utils/index.js"; - -import { decodeBits } from "./bit-reader.js"; -import { decodeOwl } from "./decode-owl.js"; - -/** - * @_ignore - */ -export function decodeOwlA(data: string, accents: string): Array { - let words = decodeOwl(data).join(","); - - // Inject the accents - accents.split(/,/g).forEach((accent) => { - - const match = accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/); - assertArgument(match !== null, "internal error parsing accents", "accents", accents); - - let posOffset = 0; - const positions = decodeBits(parseInt(match[3]), match[4]); - const charCode = parseInt(match[2]); - const regex = new RegExp(`([${ match[1] }])`, "g"); - words = words.replace(regex, (all, letter) => { - const rem = --positions[posOffset]; - if (rem === 0) { - letter = String.fromCharCode(letter.charCodeAt(0), charCode); - posOffset++; - } - return letter; - }); - }); - - return words.split(","); -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/generation/encode-latin.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/generation/encode-latin.ts deleted file mode 100644 index f662b316..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/generation/encode-latin.ts +++ /dev/null @@ -1,370 +0,0 @@ - -// OWL Data Format -// -// The Official WordList data format exported by this encoder -// encodes sorted latin-1 words (letters only) based on the -// fact that sorted words have prefixes with substantial -// overlap. -// -// For example, the words: -// [ Another, Apple, Apricot, Bread ] -// could be folded once with a single special character, such -// as ":" to yield: -// [ nother, pple, pricot, :, read ]. -// The First letter has been removed, but can be inferred by -// starting at A and incrementing to the next letter when ":" -// is encountered. -// -// The fold operation can be repeated for large sets as even within -// each folded set, there is substantial overlap in prefix. With the -// second special symbol ";", we get: -// [ ; x 13, other, :, ple, ricot, :, ; x 18, ead ] -// which can be further compressed by using numbers instead of the -// special character: -// [ 13, other, :, ple, ricot, :, 18, ead ] -// and to keep all values within a single byte, we only allow a -// maximum value of 10 (using 0 through 9 to represent 1 through 10), -// we get: -// [ 9, 2, other, :, ple, ricot, :, 9, 7, ead ] -// and we use camel-case to imply the bounrary, giving the final string: -// "92Other:PleRicot:97Ead" -// -// Once the entire latin-1 set has been collapsed, we use the remaining -// printable characters (except " and \, which require 2 bytes to represent -// in string) to substitute for the most common 2-letter pairs of letters -// in the string. -// -// OWLA Accent Format -// -// OWLA first removes all accents, and encodes that data using the OWL -// data format and encodes the accents as a base-64 series of 6-bit -// packed bits representing the distance from one followed letter to the -// next. -// -// For example, the acute accent in a given language may follow either -// a or e, in which case the follow-set is "ae". Each letter in the entire -// set is indexed, so the set of words with the accents: -// "thisA/ppleDoe/sNotMa/tterToMe/" -// " 1^ 2^ 3^ 4^ 5^ 6^ " <-- follow-set members, ALL a's and e's -// which gives the positions: -// [ 0, 2, 3, 4, 6 ] -// which then reduce to the distances -// [ 0, 2, 1, 1, 2 ] -// each of which fit into a 2-bit value, so this can be encoded as the -// base-64 encoded string: -// 00 10 01 01 10 = 001001 1010xx -// -// The base-64 set used has all number replaced with their -// shifted-counterparts to prevent conflicting with the numbers used in -// the fold operation to indicate the number of ";". - -import fs from "fs"; - -import { id } from "../../hash/id.js"; - -import { decodeOwl } from "../decode-owl.js"; -import { decodeOwlA } from "../decode-owla.js"; - -const subsChrs = " !#$%&'()*+,-./<=>?@[]^_`{|}~"; - -const Word = /^[a-z'`]*$/i; - -function fold(words: Array, sep: string): Array { - const output: Array = [ ]; - - let initial = 97; - for (const word of words) { - if (word.match(Word)) { - while (initial < word.charCodeAt(0)) { - initial++; - output.push(sep); - } - output.push(word.substring(1)); - } else { - initial = 97; - output.push(word); - } - } - - return output; -} - -function camelcase(words: Array): string { - return words.map((word) => { - if (word.match(Word)) { - return word[0].toUpperCase() + word.substring(1); - } else { - return word; - } - }).join(""); -} - -//let cc = 0, ce = 0; -/* -function getChar(c: string): string { - //if (c === "e") { ce++; } - if (c >= 'a' && c <= 'z') { return c; } - if (c.charCodeAt(1)) { - throw new Error(`bad char: "${ c }"`); - } - //cc++; - return ""; - if (c.charCodeAt(0) === 768) { return "`"; } - if (c.charCodeAt(0) === 769) { return "'"; } - if (c.charCodeAt(0) === 771) { return "~"; } - throw new Error(`Unsupported character: ${ c } (${ c.charCodeAt(0) }, ${ c.charCodeAt(1) })`); -} -function mangle(text: string): { word: string, special: string } { - const result: Array = [ ]; - for (let i = 0; i < text.length; i++) { - const c = getChar(text[i]); - result.push(c); - } - - const word = result.join(""); - if (word[1] >= 'a' && word[1] <= 'z') { return { word, special: " " }; } - return { word: word[0] + word.substring(2), special: word[1] }; -} -*/ -/* - Store: [ accent ][ targets ][ rle data; base64-tail ] - ` ae 3, 100 = (63, 37), 15 - ~ n 63, 64 = (63, 1), 27 -*/ - -const Base64 = ")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_"; -export class BitWriter { - readonly width: number; - readonly #data: Array; - - #bitLength: number; - - constructor(width: number) { - this.width = width; - this.#data = [ ]; - this.#bitLength = 0; - } - - write(value: number): void { - const maxValue = ((1 << this.width) - 1); - while (value > maxValue) { - this.#data.push(0); - this.#bitLength += this.width; - value -= maxValue; - } - this.#data.push(value); - this.#bitLength += this.width; - } - - get length(): number { - return 1 + Math.trunc((this.#bitLength + 5) / 6); - } - - get data(): string { - let result = String(this.width); - let bits = 0; - let accum = 0; - - const data = this.#data.slice(); - let bitMod = this.#bitLength % 6; - while (bitMod !== 0 && bitMod < 6) { - data.push(0); - bitMod += this.width; - } - - for (const value of data) { - accum <<= this.width; - accum |= value; - bits += this.width; - - if (bits < 6) { continue; } - - result += Base64[accum >> (bits - 6)]; - bits -= 6; - accum &= ((1 << bits) - 1); - } - - if (result.length !== this.length) { - throw new Error(`Hmm: ${ this.length } ${ result.length } ${ result }`); - } - return result; - } -} - -export interface AccentSet { - accent: number; - follows: string; - positions: Array; - positionsLength: number; - positionData: string; - positionDataLength: number; -}; - -function sorted(text: string): string { - const letters = text.split(""); - letters.sort(); - return letters.join(""); -} - -// if (c.charCodeAt(0) === 768) { return "`"; } -// if (c.charCodeAt(0) === 769) { return "'"; } -// if (c.charCodeAt(0) === 771) { return "~"; } -export function extractAccents(words: Array): { accents: Array, words: Array } { - - // Build a list that maps accents to the letters it can follow - const followsMap: Map = new Map(); - for (const word of words) { - for (let i = 0; i < word.length; i++) { - const c = word[i]; - if (c >= 'a' && c <= 'z') { continue; } - - // Make sure this positions and codepoint make sense - if (c.charCodeAt(1)) { throw new Error(`unsupported codepoint: "${ c }"`); } - if (i === 0) { throw new Error(`unmatched accent: ${ c }`); } - - const ac = c.charCodeAt(0), lastLetter = word[i - 1];; - const follows = (followsMap.get(ac) || ""); - if (follows.indexOf(lastLetter) === -1) { - followsMap.set(ac, sorted(follows + lastLetter)); - } - } - } - - // Build the positions of each follow-set for those accents - const positionsMap: Map> = new Map(); - for (const [ accent, follows ] of followsMap) { - let count = 0; - for (const word of words) { - for (let i = 0; i < word.length; i++) { - const c = word[i], ac = c.charCodeAt(0); - if (follows.indexOf(c) >= 0) { count++; } - if (ac === accent) { - const pos = positionsMap.get(ac) || [ ]; - pos.push(count); - positionsMap.set(ac, pos); - } - } - } - } - - const accents: Array = [ ]; - for (const [ accent, follows ] of followsMap) { - let last = -1; - const positions = (positionsMap.get(accent) || [ ]).map((value, index) => { - const delta = value - last; - last = value; - if (index === 0) { return value; } - return delta; - }); - - // Find the best encoding of the position data - let positionData = ""; - for (let i = 2; i < 7; i++) { - const bitWriter = new BitWriter(i); - for (const p of positions) { bitWriter.write(p); } - if (positionData === "" || bitWriter.length < positionData.length) { - positionData = bitWriter.data; - } - } - const positionsLength = positions.length; - const positionDataLength = positionData.length; - - accents.push({ accent, follows, positions, positionsLength, positionData, positionDataLength }); - } - - words = words.map((word) => { - let result = ""; - for (let i = 0; i < word.length; i++) { - const c = word[i]; - if (c >= 'a' && c <= 'z') { result += c } - } - return result; - }); - - return { accents, words }; -} - -// Encode Official WordList -export function encodeOwl(words: Array): { subs: string, data: string } { - - // Fold the sorted words by indicating delta for the first 2 letters - let data = camelcase(fold(fold(words, ":"), ";")); - - // Replace semicolons with counts (e.g. ";;;" with "3") - data = data.replace(/(;+)/g, (all, semis) => { - let result = ""; - while (semis.length) { - let count = semis.length; - if (count > 10) { count = 10; } - result += String(count - 1); - semis = semis.substring(count); - } - return result; - }); - - // Finds the best option for a shortcut replacement using the - // unused ascii7 characters - function findBest(): string { - const tally: Record = { }; - const l = 2; - for (let i = l; i < data.length; i++) { - const key = data.substring(i - l, i); - tally[key] = (tally[key] || 0) + 1; - } - - const sorted: Array<{ text: string, count: number, save: number }> = Object.keys(tally).map((text) => { - return { text, count: tally[text], save: (tally[text] * (text.length - 1)) } - }); - sorted.sort((a, b) => (b.save - a.save)); - - return sorted[0].text; - } - - // Make substitutions - let subs = ""; - for (let i = 0; i < subsChrs.length; i++) { - const n = subsChrs[i], o = findBest(); - subs += o; - data = data.split(o).join(n); - } - - return { data, subs }; -} - -// Returns either: -// - OWL data for accent-free latin-1: { data, accentds: "" } -// - OWLA data for accented latin-1: { data, accents } -function encodeWords(_words: Array): { data: string, accents: string } { - const { accents, words } = extractAccents(_words); - const { data, subs } = encodeOwl(words); - const accentData = accents.map(({ accent, follows, positionData }) => { - return `${ follows }${ accent }${ positionData }`; - }).join(","); - - return { - data: `0${ subs }${data}`, - accents: accentData - }; -} - -// CLI -const content = fs.readFileSync(process.argv[2]).toString(); -const words = content.split("\n").filter(Boolean); -const { data, accents } = encodeWords(words); - -if (accents) { - const rec = decodeOwlA(data, accents); - console.log("DATA: ", JSON.stringify(data)); - console.log("ACCENTS: ", JSON.stringify(accents)); - console.log("LENGTH: ", data.length); - console.log("CHECKSUM: ", id(content)); - console.log("RATIO: ", Math.trunc(100 * data.length / content.length) + "%"); - if (rec.join("\n") !== words.join("\n")) { throw new Error("no match!"); } -} else { - const rec = decodeOwl(data); - console.log("DATA: ", JSON.stringify(data)); - console.log("LENGTH: ", data.length); - console.log("CHECKSUM: ", id(content)); - console.log("RATIO: ", Math.trunc(100 * data.length / content.length) + "%"); - if (rec.join("\n") !== words.join("\n")) { throw new Error("no match!"); } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/index.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/index.ts deleted file mode 100644 index d4a8d74f..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/index.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * A Wordlist is a set of 2048 words used to encode private keys - * (or other binary data) that is easier for humans to write down, - * transcribe and dictate. - * - * The [[link-bip-39]] standard includes several checksum bits, - * depending on the size of the mnemonic phrase. - * - * A mnemonic phrase may be 12, 15, 18, 21 or 24 words long. For - * most purposes 12 word mnemonics should be used, as including - * additional words increases the difficulty and potential for - * mistakes and does not offer any effective improvement on security. - * - * There are a variety of [[link-bip39-wordlists]] for different - * languages, but for maximal compatibility, the - * [English Wordlist](LangEn) is recommended. - * - * @_section: api/wordlists:Wordlists [about-wordlists] - */ -export { Wordlist } from "./wordlist.js"; -export { LangEn } from "./lang-en.js"; - -export { WordlistOwl } from "./wordlist-owl.js"; -export { WordlistOwlA } from "./wordlist-owla.js"; - -export { wordlists } from "./wordlists.js"; diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/lang-cz.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/lang-cz.ts deleted file mode 100644 index c00bbf4e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/lang-cz.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { WordlistOwl } from "./wordlist-owl.js"; - -const words = "0itatkastcenaovo$taouleraeki&chor*teci%enbalodaeladet'!Chn=0Di#%E%^1Resa2Rese3CeT'#0EjKohol0Pu)%0A&sDul#Ekdo)Ke)Ti#Ul|3}aOgan%0FaltI$@tPi,%TmaTronom0LasL{i#Ol0Tobus4Yl:B#}R'?TaUb_U/!U^U+Ur!Xer2A^v#Ambo,An#AtrEp)Ike)KoLohOnzOskevUn{#Usin#Z^Zy2Bl.Bn|})D _D#D'aF{Jar(Kv?LdokLvaN^NkrRzaTikVolZola3D+tL.T'#0Ukot:PartRev&3DrDu+J/JnLaLerLkemLn?N.Nn(N'#NtrumNzZ(2O&2KolivUv!4It_N(0Dn(Ke)KrPot0Ak~AlIkRkot2Kli$a:L-oRe[T_Tum1E,1B!a}'#Cib_Fic Fla%KlKr{Mokr!PreseRbyS#T-tiv3Kob,zKt|O^P]mSkSp+jV`]Vo/2AhaOuhoUhopis1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L.N!:GonL/aL*nNaN^lNil#RanRhanyR|1ElkuHod0Ova0DroGe)%J%Lbl*dL{rhL _LmocLry[Nk'Ran^RzeS_#SkrzeSn?SpoduS)Ter.Ver#3B,%}rDeoh,D.D+LaN?S{Tal aZeZ #0Ezd0L`Us0Aj#AkAs>EvoHk(IvN'#Oup!1Uc|Uk0DaDiv(Doz&kD$voJ@skyJ&JskoLantL[L LnoSk'#Zid]Z'&0Ravo1Ab>A%tAhA)Ba}o+kH!StvaTu+0Ad T*p Tup0Ip4Bav Br!}|D!D,Fot H+d!H~Hod H,d Hub Jasn J{Jm=K]p Kon!L-!Maz!Mez Miz{Mys+tNe/!Nik!Nut P`!Pl! P,v Pu$ Raz R'n!Rv!Sl' SokoS)v Su~Syp!Tas Tes!Tr! Vi~Vol!Vrh_Zdob Zn!0AduBud }op DJ{Ji$ K+p!K*p Lep Mez Mot!Mys+tNe/!Nik!Pl! Poj Ps!Raz S)v Su~Taj Temn Tk~Ujm=Val Ve+tVin Vol!Vrt!Zvon 0Av RusuUd|Yt-1A+#ArmaAtn(IvoOb RojVihYm`]0L@.ManM.Pt!Z`uZdola2At Lt~Lubo#Ot' Ru[0MaMn?0Emn 0Lam!Oum!R!#Umav#0AtoEh#O[OmO$Ozvyk0Ap|ArAt-IjeIz{Ocn Odr!Rzl.Ut|0AkAl(Am@!Ovu0B,z Tav Ub-Ufa+0Lod Omal RavaR( Rud#Rvu1A^An C`]N (NoOv&Y/l Zav(1I/aR! 0B'.Br0Ed~EnkuEs_aOnR!Uk'odYk"; -const checksum = "0x25f44555f4af25b51a711136e1c7d6e50ce9f8917d39d6b1f076b2bb4d2fac1a"; - -let wordlist: null | LangCz = null; - -/** - * The [[link-bip39-cz]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export class LangCz extends WordlistOwl { - - /** - * Creates a new instance of the Czech language Wordlist. - * - * Using the constructor should be unnecessary, instead use the - * [[wordlist]] singleton method. - * - * @_ignore: - */ - constructor() { super("cz", words, checksum); } - - /** - * Returns a singleton instance of a ``LangCz``, creating it - * if this is the first time being called. - */ - static wordlist(): LangCz { - if (wordlist == null) { wordlist = new LangCz(); } - return wordlist; - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/lang-en.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/lang-en.ts deleted file mode 100644 index 88aacb6d..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/lang-en.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { WordlistOwl } from "./wordlist-owl.js"; - -const words = "0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>Nke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Ght5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurEAyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOgAyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NNGradeHoldOnP Set1BOng::Rd3Ar~ow9UUngU`:3BraRo9NeO"; -const checksum = "0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"; - -let wordlist: null | LangEn = null; - -/** - * The [[link-bip39-en]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export class LangEn extends WordlistOwl { - - /** - * Creates a new instance of the English language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langEn]] should suffice. - * - * @_ignore: - */ - constructor() { super("en", words, checksum); } - - /** - * Returns a singleton instance of a ``LangEn``, creating it - * if this is the first time being called. - */ - static wordlist(): LangEn { - if (wordlist == null) { wordlist = new LangEn(); } - return wordlist; - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/lang-es.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/lang-es.ts deleted file mode 100644 index 785cbfbf..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/lang-es.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { WordlistOwlA } from "./wordlist-owla.js"; - -const words = "0arertoiotadonoaRteirroenaNonaLsolocoiliaralaorrenadaChoN$n0A>Dom,EjaI!#Oga&O'Or#RazoR*Ue=U<0Ab Adem@CeLe%OmoRa!RozUn0DazD$GeLaM,#S,)T^0AlAnceA+EEl]`E`EstruzI.I<2ErU{U'0Af[nArO)Uc Uf_Ul:BaB^|eH@IleJ Lanz/c.LdeMbuN>Nd-oRb(>RnizR+Scu]S#nSu[Tal]T!@T*Tu%UlZ 3BeBid/=S SoSt@3|oEnNgo2An>OqueUsa2ABi`BoCaCi`DaDegaIn//!oLsaMb-{dNi#N}saiRdeRr SqueTeTinVe{Zal2AvoAzoEchaEveIl=In>IsaOcaOmaOnceO)UjaUs>U#2CeoCleE'EyFan{F.HoIt_L#Rbuj(l(+Sc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'MaM^Mp=NazNd!N!NisNRmi'Rnur(+rSisSo+StigoT!aX#Z3B$Bu+nEmpoEn{Er[EPoR(.TanT!eTu=Za5Al]B?=C Ci'DoG/&M N}#P PeQueRaxR!oRm,%RneoRoRpe&R_RS!Xi>2AbajoAc#rA!Afi>AgoAjeAmoAnceA#AumaAz EbolEguaEin%EnEp EsIbuIgoIpaIs)IunfoOfeoOmpaOn>OpaO)OzoU>Ue'Ufa2B!@BoEr#MbaM^NelNic(bin(ismoR'T^:0Ic 9C!a0B[l0I{dIrIv! = null; - -function hex(word: string): string { - return hexlify(toUtf8Bytes(word)); -} - -const KiYoKu = "0xe3818de38284e3818f"; -const KyoKu = "0xe3818de38283e3818f" - -function toString(data: Array): string { - return toUtf8String(new Uint8Array(data)); -} - -function loadWords(): Array { - if (_wordlist !== null) { return _wordlist; } - - const wordlist: Array = []; - - // Transforms for normalizing (sort is a not quite UTF-8) - const transform: { [key: string]: string | boolean } = {}; - - // Delete the diacritic marks - transform[toString([227, 130, 154])] = false; - transform[toString([227, 130, 153])] = false; - - // Some simple transforms that sort out most of the order - transform[toString([227, 130, 133])] = toString([227, 130, 134]); - transform[toString([227, 129, 163])] = toString([227, 129, 164]); - transform[toString([227, 130, 131])] = toString([227, 130, 132]); - transform[toString([227, 130, 135])] = toString([227, 130, 136]); - - - // Normalize words using the transform - function normalize(word: string) { - let result = ""; - for (let i = 0; i < word.length; i++) { - let kana = word[i]; - const target = transform[kana]; - if (target === false) { continue; } - if (target) { kana = target; } - result += kana; - } - return result; - } - - // Sort how the Japanese list is sorted - function sortJapanese(a: string, b: string) { - a = normalize(a); - b = normalize(b); - if (a < b) { return -1; } - if (a > b) { return 1; } - return 0; - } - - // Load all the words - for (let length = 3; length <= 9; length++) { - const d = data[length - 3]; - for (let offset = 0; offset < d.length; offset += length) { - const word: Array = []; - for (let i = 0; i < length; i++) { - const k = mapping.indexOf(d[offset + i]); - word.push(227); - word.push((k & 0x40) ? 130: 129); - word.push((k & 0x3f) + 128); - } - wordlist.push(toString(word)); - } - } - wordlist.sort(sortJapanese); - - // For some reason kyoku and kiyoku are flipped in node (!!). - // The order SHOULD be: - // - kyoku - // - kiyoku - - // This should ignore "if", but that doesn't work here?? - /* c8 ignore start */ - if (hex(wordlist[442]) === KiYoKu && hex(wordlist[443]) === KyoKu) { - const tmp = wordlist[442]; - wordlist[442] = wordlist[443]; - wordlist[443] = tmp; - } - /* c8 ignore stop */ - - // Verify the computed list matches the official list - /* istanbul ignore if */ - const checksum = id(wordlist.join("\n") + "\n"); - /* c8 ignore start */ - if (checksum !== "0xcb36b09e6baa935787fd762ce65e80b0c6a8dabdfbc3a7f86ac0e2c4fd111600") { - throw new Error("BIP39 Wordlist for ja (Japanese) FAILED"); - } - /* c8 ignore stop */ - - _wordlist = wordlist; - - return wordlist; -} - -let wordlist: null | LangJa = null; - -/** - * The [[link-bip39-ja]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export class LangJa extends Wordlist { - - /** - * Creates a new instance of the Japanese language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langJa]] should suffice. - * - * @_ignore: - */ - constructor() { super("ja"); } - - getWord(index: number): string { - const words = loadWords(); - assertArgument(index >= 0 && index < words.length, - `invalid word index: ${ index }`, "index", index); - return words[index]; - } - - getWordIndex(word: string): number { - return loadWords().indexOf(word); - } - - split(phrase: string): Array { - //logger.assertNormalize(); - return phrase.split(/(?:\u3000| )+/g); - } - - join(words: Array): string { - return words.join("\u3000"); - } - - /** - * Returns a singleton instance of a ``LangJa``, creating it - * if this is the first time being called. - */ - static wordlist(): LangJa { - if (wordlist == null) { wordlist = new LangJa(); } - return wordlist; - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/lang-ko.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/lang-ko.ts deleted file mode 100644 index 09721386..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/lang-ko.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { id } from "../hash/index.js"; -import { assertArgument, toUtf8String } from "../utils/index.js"; - -import { Wordlist } from "./wordlist.js"; - - -const data = [ - "OYAa", - "ATAZoATBl3ATCTrATCl8ATDloATGg3ATHT8ATJT8ATJl3ATLlvATLn4ATMT8ATMX8ATMboATMgoAToLbAToMTATrHgATvHnAT3AnAT3JbAT3MTAT8DbAT8JTAT8LmAT8MYAT8MbAT#LnAUHT8AUHZvAUJXrAUJX8AULnrAXJnvAXLUoAXLgvAXMn6AXRg3AXrMbAX3JTAX3QbAYLn3AZLgvAZrSUAZvAcAZ8AaAZ8AbAZ8AnAZ8HnAZ8LgAZ8MYAZ8MgAZ8OnAaAboAaDTrAaFTrAaJTrAaJboAaLVoAaMXvAaOl8AaSeoAbAUoAbAg8AbAl4AbGnrAbMT8AbMXrAbMn4AbQb8AbSV8AbvRlAb8AUAb8AnAb8HgAb8JTAb8NTAb8RbAcGboAcLnvAcMT8AcMX8AcSToAcrAaAcrFnAc8AbAc8MgAfGgrAfHboAfJnvAfLV8AfLkoAfMT8AfMnoAfQb8AfScrAfSgrAgAZ8AgFl3AgGX8AgHZvAgHgrAgJXoAgJX8AgJboAgLZoAgLn4AgOX8AgoATAgoAnAgoCUAgoJgAgoLXAgoMYAgoSeAgrDUAgrJTAhrFnAhrLjAhrQgAjAgoAjJnrAkMX8AkOnoAlCTvAlCV8AlClvAlFg4AlFl6AlFn3AloSnAlrAXAlrAfAlrFUAlrFbAlrGgAlrOXAlvKnAlvMTAl3AbAl3MnAnATrAnAcrAnCZ3AnCl8AnDg8AnFboAnFl3AnHX4AnHbrAnHgrAnIl3AnJgvAnLXoAnLX4AnLbrAnLgrAnLhrAnMXoAnMgrAnOn3AnSbrAnSeoAnvLnAn3OnCTGgvCTSlvCTvAUCTvKnCTvNTCT3CZCT3GUCT3MTCT8HnCUCZrCULf8CULnvCU3HnCU3JUCY6NUCbDb8CbFZoCbLnrCboOTCboScCbrFnCbvLnCb8AgCb8HgCb$LnCkLfoClBn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LkvMXo", - "AUoAcrMXoAZ8HboAg8AbOg6ATFgAg8AloMXoAl3AT8JTrAl8MX8MXoCT3SToJU8Cl8Db8MXoDT8HgrATrDboOT8MXoGTOTrATMnGT8LhrAZ8GnvFnGnQXHToGgvAcrHTvAXvLl3HbrAZoMXoHgBlFXLg3HgMnFXrSnHgrSb8JUoHn6HT8LgvITvATrJUoJUoLZrRnvJU8HT8Jb8JXvFX8QT8JXvLToJTrJYrQnGnQXJgrJnoATrJnoJU8ScvJnvMnvMXoLTCTLgrJXLTJlRTvQlLbRnJlQYvLbrMb8LnvLbvFn3RnoLdCVSTGZrLeSTvGXCnLg3MnoLn3MToLlrETvMT8SToAl3MbrDU6GTvMb8LX4LhrPlrLXGXCnSToLf8Rg3STrDb8LTrSTvLTHXMnSb3RYLnMnSgOg6ATFg", - "HUDlGnrQXrJTrHgLnrAcJYMb8DULc8LTvFgGnCk3Mg8JbAnLX4QYvFYHnMXrRUoJnGnvFnRlvFTJlQnoSTrBXHXrLYSUJgLfoMT8Se8DTrHbDb", - "AbDl8SToJU8An3RbAb8ST8DUSTrGnrAgoLbFU6Db8LTrMg8AaHT8Jb8ObDl8SToJU8Pb3RlvFYoJl" -] - -const codes = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*" - -function getHangul(code: number): string { - if (code >= 40) { - code = code + 168 - 40; - } else if (code >= 19) { - code = code + 97 - 19; - } - - return toUtf8String(new Uint8Array([ 225, (code >> 6) + 132, (code & 0x3f) + 128])); -} - -let _wordlist: null | Array = null; - -function loadWords(): Array { - if (_wordlist != null) { return _wordlist; } - - const wordlist: Array = [ ]; - - data.forEach((data, length) => { - length += 4; - for (let i = 0; i < data.length; i += length) { - let word = ""; - for (let j = 0; j < length; j++) { - word += getHangul(codes.indexOf(data[i + j])); - } - wordlist.push(word) - } - }); - - wordlist.sort(); - - // Verify the computed list matches the official list - /* istanbul ignore if */ - const checksum = id(wordlist.join("\n") + "\n"); - /* c8 ignore start */ - if (checksum !== "0xf9eddeace9c5d3da9c93cf7d3cd38f6a13ed3affb933259ae865714e8a3ae71a") { - throw new Error("BIP39 Wordlist for ko (Korean) FAILED"); - } - /* c8 ignore stop */ - - _wordlist = wordlist; - - return wordlist; -} - -let wordlist: null | LangKo = null; - -/** - * The [[link-bip39-ko]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export class LangKo extends Wordlist { - - /** - * Creates a new instance of the Korean language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langKo]] should suffice. - * - * @_ignore: - */ - constructor() { - super("ko"); - } - - getWord(index: number): string { - const words = loadWords(); - assertArgument(index >= 0 && index < words.length, - `invalid word index: ${ index }`, "index", index); - return words[index]; - } - - getWordIndex(word: string): number { - return loadWords().indexOf(word); - } - - /** - * Returns a singleton instance of a ``LangKo``, creating it - * if this is the first time being called. - */ - static wordlist(): LangKo { - if (wordlist == null) { wordlist = new LangKo(); } - return wordlist; - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/lang-pt.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/lang-pt.ts deleted file mode 100644 index 7448a01e..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/lang-pt.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { WordlistOwl } from "./wordlist-owl.js"; - -const words = "0arad!ototealirertainrasoent hoandoaR#riareha!aroele'oronul0Aca%AixoAl A%rDuz'El]Er$IsmoO$ Rum S-&T(i&TigoVo[=0F&.Il#P' S?S* So&/Sun$Tr&0Ac#Adu+Al/A[f E End(Er_EuIng'Ir?IvoOl{oRac Revi=RizU&Um0Di$rM-.R>o+TismoT|@Tu 0Ali An%Ar@Ent&Es,I?Is Ul,1Ila1Ar E=Ei%Ulejo:B BosaC&]uCh `C@GagemI+c>~/Se#S)n%Ta)Te=rTidaTomTuc Unil]3B(IjoIr^IsebolLd!eLezaLgaLisc Ndi$Ng&aNz(RimbauRl*d>_Sou_XigaZ(_3CoCu=En&Foc&Furc G|naLhe%Mest[Mo$rOlog@OmboOsf(aPol Rr-$Scoi$Sne$SpoSsex$TolaZ _2Ind#OcoOque 2A$BagemC#CejoChec]Ico.L^LetimL]LoMb{oNdeNecoNi)Rb~h>d>e&R+c]V*oXe?2AncoAsaAvezaEuIgaIl/Inc OaOchu+Onze O$Uxo2C]DismoF LeRacoScaS$Z*a:Bimb Rn{oRpe%R['>)zRv&/SacoScaSeb[S%loS~oT a)Tiv UleUs?U%l V&oV(na3BolaDil]G}]Lebr L~ Nou+N,N%ioRc Rr#R%'oRvejaTimV^2Aco)Al{aAm#Ap^ArmeAticeAveEfeEg^E'oEqueIco%If[In`oOc&/Ov(UmboU.Uva0CatrizCl}eD!eD['aEn%Gcui$Rurg@T 2A[zaE_Ic OneUbe2A=Ag'Ba@B($rBr C^El/Ent_E,Gum`oIb'IfaIo%L L{aLh(Lid'Lme@L}oLunaM<=Mb* M-.MitivaMov(MplexoMumNc]N=rNec.Nfu,Ng` Nhec(Njug Nsum'Nt+$Nvi%Op( P{oPi?PoQue%lRagemRdi&Rne)R}h>p|&R[ioR%joRuj>voSs-oS%laT}e%U_UveVilZ*]2A%+AvoEcheE=rEmeErEspoI^Im*&Io~oIseItic Os)UaUz{o2B+m SafioSbo.Sc<,S-/Sfi#Sgas%Sigu&SlizeSmam SovaSpesaS)queSvi T&h T-$rT} Tri$UsaV(Vi=Vot#Z-a3Ag+maAle$Da)Fu,Gi.Lat#Lu-%M*u'Nast@Nh{oOceseRe$Sc[)Sf ceSp oSque%Ssip S)n%T?UrnoV(,Vi,rV~g Z(5Br?L|i=M?M*#NativoNz`>m-%Rs&SagemUr#U$r2EnagemIbleOg @2El EndeE$PloQues><%Vi=,:1Lod'O Olog@0Ific It&Uc#1Ei$Etiv 3E.1Ab| Eg(Ei$rEncoEv?Im* Ogi 0B goBol#Br~/Buti=EndaErg'Is,rPat@P-/P*#Polg P[goPurr Ul?0CaixeC-#Ch-%C}t_De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ic~ L{oLhiceLu=Nce=rNdav&N( Nt[Rb&Rd!eRe?Rg}h>m`/RnizRs R%n%SpaSti=T|i&3Adu$AgemAj Atu+Br?D{aDr @ElaGaG-%Gi G| L ejoNcoNhe)NilOle)R!>tudeSi.S$Tr&V{oZ*/5A=rArG&L<%LeibolL)gemLumo,Nt!e5L$Vuz`a::D[zRope3QueRe.Rife3Ng ::Ng#Rp 3BuL?9Mb Olog@5Mbi="; -const checksum = "0x2219000926df7b50d8aa0a3d495826b988287df4657fbd100e6fe596c8f737ac"; - -let wordlist: null | LangPt = null; - -/** - * The [[link-bip39-pt]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export class LangPt extends WordlistOwl { - - /** - * Creates a new instance of the Portuguese language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langPt]] should suffice. - * - * @_ignore: - */ - constructor() { super("pt", words, checksum); } - - /** - * Returns a singleton instance of a ``LangPt``, creating it - * if this is the first time being called. - */ - static wordlist(): LangPt { - if (wordlist == null) { wordlist = new LangPt(); } - return wordlist; - } -} - diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/lang-zh.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/lang-zh.ts deleted file mode 100644 index cd96f693..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/lang-zh.ts +++ /dev/null @@ -1,112 +0,0 @@ -import { id } from "../hash/index.js"; -import { assertArgument, toUtf8String } from "../utils/index.js"; - -import { Wordlist } from "./wordlist.js"; - - -const data = "}aE#4A=Yv&co#4N#6G=cJ&SM#66|/Z#4t&kn~46#4K~4q%b9=IR#7l,mB#7W_X2*dl}Uo~7s}Uf&Iw#9c&cw~6O&H6&wx&IG%v5=IQ~8a&Pv#47$PR&50%Ko&QM&3l#5f,D9#4L|/H&tQ;v0~6n]nN> = { - zh_cn: null, - zh_tw: null -} - -const Checks: Record = { - zh_cn: "0x17bcc4d8547e5a7135e365d1ab443aaae95e76d8230c2782c67305d4f21497a1", - zh_tw: "0x51e720e90c7b87bec1d70eb6e74a21a449bd3ec9c020b01d3a40ed991b60ce5d" -} - -const codes = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; -const style = "~!@#$%^&*_-=[]{}|;:,.()<>?" - -function loadWords(locale: string): Array { - if (_wordlist[locale] != null) { return _wordlist[locale] as Array; } - - const wordlist: Array = []; - - let deltaOffset = 0; - for (let i = 0; i < 2048; i++) { - const s = style.indexOf(data[i * 3]); - const bytes = [ - 228 + (s >> 2), - 128 + codes.indexOf(data[i * 3 + 1]), - 128 + codes.indexOf(data[i * 3 + 2]), - ]; - - if (locale === "zh_tw") { - const common = s % 4; - for (let i = common; i < 3; i++) { - bytes[i] = codes.indexOf(deltaData[deltaOffset++]) + ((i == 0) ? 228: 128); - } - } - - wordlist.push(toUtf8String(new Uint8Array(bytes))); - } - - // Verify the computed list matches the official list - const checksum = id(wordlist.join("\n") + "\n"); - /* c8 ignore start */ - if (checksum !== Checks[locale]) { - throw new Error(`BIP39 Wordlist for ${ locale } (Chinese) FAILED`); - } - /* c8 ignore stop */ - - _wordlist[locale] = wordlist; - - return wordlist; -} - -const wordlists: Record = { }; - -/** - * The [[link-bip39-zh_cn]] and [[link-bip39-zh_tw]] for - * [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export class LangZh extends Wordlist { - - /** - * Creates a new instance of the Chinese language Wordlist for - * the %%dialect%%, either ``"cn"`` or ``"tw"`` for simplified - * or traditional, respectively. - * - * This should be unnecessary most of the time as the exported - * [[langZhCn]] and [[langZhTw]] should suffice. - * - * @_ignore: - */ - constructor(dialect: string) { super("zh_" + dialect); } - - getWord(index: number): string { - const words = loadWords(this.locale); - assertArgument(index >= 0 && index < words.length, - `invalid word index: ${ index }`, "index", index); - return words[index]; - } - - getWordIndex(word: string): number { - return loadWords(this.locale).indexOf(word); - } - - split(phrase: string): Array { - phrase = phrase.replace(/(?:\u3000| )+/g, ""); - return phrase.split(""); - } - - /** - * Returns a singleton instance of a ``LangZh`` for %%dialect%%, - * creating it if this is the first time being called. - * - * Use the %%dialect%% ``"cn"`` or ``"tw"`` for simplified or - * traditional, respectively. - */ - static wordlist(dialect: string): LangZh { - if (wordlists[dialect] == null) { - wordlists[dialect] = new LangZh(dialect); - } - return wordlists[dialect]; - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/wordlist-owl.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/wordlist-owl.ts deleted file mode 100644 index a7f2c922..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/wordlist-owl.ts +++ /dev/null @@ -1,77 +0,0 @@ - -// Use the encode-latin.js script to create the necessary -// data files to be consumed by this class - -import { id } from "../hash/index.js"; -import { assertArgument } from "../utils/index.js"; - -import { decodeOwl } from "./decode-owl.js"; -import { Wordlist } from "./wordlist.js"; - -/** - * An OWL format Wordlist is an encoding method that exploits - * the general locality of alphabetically sorted words to - * achieve a simple but effective means of compression. - * - * This class is generally not useful to most developers as - * it is used mainly internally to keep Wordlists for languages - * based on ASCII-7 small. - * - * If necessary, there are tools within the ``generation/`` folder - * to create the necessary data. - */ -export class WordlistOwl extends Wordlist { - #data: string; - #checksum: string; - - /** - * Creates a new Wordlist for %%locale%% using the OWL %%data%% - * and validated against the %%checksum%%. - */ - constructor(locale: string, data: string, checksum: string) { - super(locale); - this.#data = data; - this.#checksum = checksum; - this.#words = null; - } - - /** - * The OWL-encoded data. - */ - get _data(): string { return this.#data; } - - /** - * Decode all the words for the wordlist. - */ - _decodeWords(): Array { - return decodeOwl(this.#data); - } - - #words: null | Array; - #loadWords(): Array { - if (this.#words == null) { - const words = this._decodeWords(); - - // Verify the computed list matches the official list - const checksum = id(words.join("\n") + "\n"); - /* c8 ignore start */ - if (checksum !== this.#checksum) { - throw new Error(`BIP39 Wordlist for ${ this.locale } FAILED`); - } - /* c8 ignore stop */ - - this.#words = words; - } - return this.#words; - } - - getWord(index: number): string { - const words = this.#loadWords(); - assertArgument(index >= 0 && index < words.length, `invalid word index: ${ index }`, "index", index); - return words[index]; - } - - getWordIndex(word: string): number { - return this.#loadWords().indexOf(word); - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/wordlist-owla.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/wordlist-owla.ts deleted file mode 100644 index d29c2bb6..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/wordlist-owla.ts +++ /dev/null @@ -1,41 +0,0 @@ - -import { WordlistOwl } from "./wordlist-owl.js"; -import { decodeOwlA } from "./decode-owla.js"; - -/** - * An OWL-A format Wordlist extends the OWL format to add an - * overlay onto an OWL format Wordlist to support diacritic - * marks. - * - * This class is generally not useful to most developers as - * it is used mainly internally to keep Wordlists for languages - * based on latin-1 small. - * - * If necessary, there are tools within the ``generation/`` folder - * to create the necessary data. - */ -export class WordlistOwlA extends WordlistOwl { - #accent: string; - - - /** - * Creates a new Wordlist for %%locale%% using the OWLA %%data%% - * and %%accent%% data and validated against the %%checksum%%. - */ - constructor(locale: string, data: string, accent: string, checksum: string) { - super(locale, data, checksum); - this.#accent = accent; - } - - /** - * The OWLA-encoded accent data. - */ - get _accent(): string { return this.#accent; } - - /** - * Decode all the words for the wordlist. - */ - _decodeWords(): Array { - return decodeOwlA(this._data, this._accent); - } -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/wordlist.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/wordlist.ts deleted file mode 100644 index 1a6bc6df..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/wordlist.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { defineProperties } from "../utils/index.js"; - -/** - * A Wordlist represents a collection of language-specific - * words used to encode and devoce [[link-bip-39]] encoded data - * by mapping words to 11-bit values and vice versa. - */ -export abstract class Wordlist { - locale!: string; - - /** - * Creates a new Wordlist instance. - * - * Sub-classes MUST call this if they provide their own constructor, - * passing in the locale string of the language. - * - * Generally there is no need to create instances of a Wordlist, - * since each language-specific Wordlist creates an instance and - * there is no state kept internally, so they are safe to share. - */ - constructor(locale: string) { - defineProperties(this, { locale }); - } - - /** - * Sub-classes may override this to provide a language-specific - * method for spliting %%phrase%% into individual words. - * - * By default, %%phrase%% is split using any sequences of - * white-space as defined by regular expressions (i.e. ``/\s+/``). - */ - split(phrase: string): Array { - return phrase.toLowerCase().split(/\s+/g) - } - - /** - * Sub-classes may override this to provider a language-specific - * method for joining %%words%% into a phrase. - * - * By default, %%words%% are joined by a single space. - */ - join(words: Array): string { - return words.join(" "); - } - - /** - * Maps an 11-bit value into its coresponding word in the list. - * - * Sub-classes MUST override this. - */ - abstract getWord(index: number): string; - - /** - * Maps a word to its corresponding 11-bit value. - * - * Sub-classes MUST override this. - */ - abstract getWordIndex(word: string): number; -} diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/wordlists-browser.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/wordlists-browser.ts deleted file mode 100644 index 1cfda9e2..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/wordlists-browser.ts +++ /dev/null @@ -1,8 +0,0 @@ - -import { LangEn } from "./lang-en.js"; - -import type { Wordlist } from "./wordlist.js"; - -export const wordlists: Record = { - en: LangEn.wordlist(), -}; diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/wordlists-extra.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/wordlists-extra.ts deleted file mode 100644 index 9fde2721..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/wordlists-extra.ts +++ /dev/null @@ -1,9 +0,0 @@ - -export { LangCz } from "./lang-cz.js"; -export { LangEs } from "./lang-es.js"; -export { LangFr } from "./lang-fr.js"; -export { LangJa } from "./lang-ja.js"; -export { LangKo } from "./lang-ko.js"; -export { LangIt } from "./lang-it.js"; -export { LangPt } from "./lang-pt.js"; -export { LangZh } from "./lang-zh.js"; diff --git a/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/wordlists.ts b/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/wordlists.ts deleted file mode 100644 index 1a3b12f1..00000000 --- a/tools/mnemonic-test/node_modules/ethers/src.ts/wordlists/wordlists.ts +++ /dev/null @@ -1,38 +0,0 @@ - -import { LangCz } from "./lang-cz.js"; -import { LangEn } from "./lang-en.js"; -import { LangEs } from "./lang-es.js"; -import { LangFr } from "./lang-fr.js"; -import { LangJa } from "./lang-ja.js"; -import { LangKo } from "./lang-ko.js"; -import { LangIt } from "./lang-it.js"; -import { LangPt } from "./lang-pt.js"; -import { LangZh } from "./lang-zh.js"; - -import type { Wordlist } from "./wordlist.js"; - -/** - * The available Wordlists by their - * [ISO 639-1 Language Code](link-wiki-iso639). - * - * (**i.e.** [cz](LangCz), [en](LangEn), [es](LangEs), [fr](LangFr), - * [ja](LangJa), [ko](LangKo), [it](LangIt), [pt](LangPt), - * [zh_cn](LangZh), [zh_tw](LangZh)) - * - * The dist files (in the ``/dist`` folder) have had all languages - * except English stripped out, which reduces the library size by - * about 80kb. If required, they are available by importing the - * included ``wordlists-extra.min.js`` file. - */ -export const wordlists: Record = { - cz: LangCz.wordlist(), - en: LangEn.wordlist(), - es: LangEs.wordlist(), - fr: LangFr.wordlist(), - it: LangIt.wordlist(), - pt: LangPt.wordlist(), - ja: LangJa.wordlist(), - ko: LangKo.wordlist(), - zh_cn: LangZh.wordlist("cn"), - zh_tw: LangZh.wordlist("tw"), -}; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/.vscode/settings.json b/tools/mnemonic-test/node_modules/hash-wasm/.vscode/settings.json deleted file mode 100644 index ad92582b..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "editor.formatOnSave": true -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/CHANGELOG.md b/tools/mnemonic-test/node_modules/hash-wasm/CHANGELOG.md deleted file mode 100644 index f396cfb9..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/CHANGELOG.md +++ /dev/null @@ -1,187 +0,0 @@ -## 4.12.0 (November 19, 2024) - -- **BREAKING CHANGE**: crc32c() and createCRC32C() were removed. You can now do the same thing with crc32() and createCRC32() through setting the polynomial parameter to 0x82F63B78 -- Added CRC-64 hash function -- Exported IDataType, IHasher types from index.ts -- Update benchmarks -- Update dependencies, including Clang -- Migrate from ESLint to Biome and fix linting errors - -## 4.11.0 (November 13, 2023) - -- Added `secret` parameter to Argon2 (by [@malobre](https://github.com/malobre)) - -## 4.10.0 (October 15, 2023) - -- Add sideEffects: false to package.json -- Update dependencies, including Clang - -## 4.9.0 (July 22, 2021) - -- Add CRC32C -- Update dependencies, including Clang - -## 4.8.0 (June 27, 2021) - -- Optimized Adler-32 for WASM -- Add xxhash3() and xxhash128() hash functions -- Slightly faster xxhash32() and xxhash64() - -## 4.7.0 (June 5, 2021) - -- Add Adler-32 algorithm -- New feature: saving and loading the internal state of the hash (segmented hashing and rewinding) -- Faster builds using GNU Make -- Fix alignment of the main buffer (might result in better performance on some platforms) -- Updated dependencies -- _(Special thanks to Nicholas Sherlock for his contributions)_ - -## 4.6.0 (March 26, 2021) - -- Smaller CRC32 binary (now it computes the lookup table at the first run) -- Less RAM required for the WASM instances: it only allocates 128kB of RAM instead of 256kB -- Update dependencies - -## 4.5.0 (March 6, 2021) - -- Add BLAKE3 algorithm -- Performance improvements at BLAKE2 -- Update dependencies -- Update benchmarks - -## 4.4.1 (November 22, 2020) - -- Add JSDoc annotations - -## 4.4.0 (November 8, 2020) - -- Add Whirlpool and SM3 algorithms -- Fix block size at blake algorithms -- Switch compiler from Emscripten to Clang -- Fix cached seed invalidation at xxhash64 -- Added wasm binary hashes to build log -- Create minified bundles from each algorithm - -## 4.3.0 (October 10, 2020) - -- Add blake2s algorithm -- Add bundle sizes to README - -## 4.2.2 (September 19, 2020) - -- Add bcrypt algorithm -- Add argon2Validate() function - -## 4.1.0 (September 5, 2020) - -- Add scrypt algorithm -- Improve type signiture of key derivation functions. Now the return type depends on the parameters -- Update benchmarks, add relative performance -- Add section to README about string encoding pitfalls - -## 4.0.1 (August 29, 2020) - -- ~~**BREAKING CHANGE**: All APIs were converted to **synchronous** functions, so you don't need to use `await` or `.then()` anymore.~~ It turned out that Chrome does not allow synchronous WebAssembly instantiation of binaries larger than 4KB. So this change was reverted. -- **BREAKING CHANGE**: `argon2()` function was renamed to `argon2i()`, `argon2d()` and `argon2id()`. -- **BREAKING CHANGE**: `pbkdf2()` function requires now an object containing all parameters -- Update dependencies - -## 3.7.2 (August 15, 2020) - -- Add more badges to README -- Update dependencies -- Increase code coverage -- Consistent coding style in C files - -## 3.7.1 (August 2, 2020) - -- Allow returning Uint8Array from digest() -- Allow operation chaining in createXXXX() response -- Throw an error when an IHasher instance is reused without init() call. -- Add "binary" and "encoded" output types to argon2 -- Update benchmark results -- Remove all dependencies on Buffer object in standalone mode - -## 3.7.0 (August 1, 2020) - -- Added Argon2 -- Support hash lengths shorter than 16 bytes in Blake2b - -## 3.6.0 (July 25, 2020) - -- **Breaking change**: Drop support for String() objects (normal string literals are still supported of course) -- Node.js buffer polyfills are not needed anymore - -## 3.5.0 (July 19, 2020) - -- Added BLAKE2b algorithm -- Fixed a bug, where sha3() and keccak() gave incorrect results when the hash length was changed - -## 3.4.1 (June 27, 2020) - -- Add PBKDF2 example and benchmark results - -## 3.4.0 (June 27, 2020) - -- Add PBKDF2 algorithm - -## 3.3.0 (June 22, 2020) - -- Add RIPEMD-160 algorithm - -## 3.2.1 (June 5, 2020) - -- Fix buffer.copy() error in browsers - -## 3.2.0 (June 5, 2020) - -- Added HMAC -- Better examples in readme -- Updated dependencies - -## 3.1.2 (May 27, 2020) - -- Fixed example code in readme -- Better description and keywords - -## 3.1.1 (May 25, 2020) - -- ~3x faster when hashing small chunks of data (one WASM function call instead of three) -- Updated benchmark results in readme - -## 3.0.1 (May 24, 2020) - -- Updated benchmark results in readme -- Use new web-based tool for benchmarking - -## 3.0.0 (May 24, 2020) - -- Improved performance in smaller input buffers - -## 2.6.0 (April 18, 2020) - -- Allow concurrent hash calculations with multiple states -- Fix WebAssembly detection -- Cache WebAssembly modules -- Fix crash when starting many parallel hash calculations -- Allocate less memory for WASM modules - -## 2.5.1 (April 13, 2020) - -- Add React.js demo app - -## 2.5.0 (April 13, 2020) - -- Add xxhash32 and xxhash64 -- Add Keccak -- Bugfixes - -## 2.1.0 (April 12, 2020) - -- Use faster SHA256 and SHA512 implementations -- Allocate less memory in WASM modules -- Clean up C source codes - -## 2.0.0 (April 11, 2020) - -- Initial release diff --git a/tools/mnemonic-test/node_modules/hash-wasm/LICENSE b/tools/mnemonic-test/node_modules/hash-wasm/LICENSE deleted file mode 100644 index ffdbc891..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/LICENSE +++ /dev/null @@ -1,38 +0,0 @@ -MIT License - -Copyright (c) 2020 Dani Biró - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - -Embedded C implementations might use other, similarly permissive licenses. -Check the beginning of the files from the /src directory. - -Special thank you to the authors of original C algorithms: -- Alexander Peslyak -- Aleksey Kravchenko -- Colin Percival -- Stephan Brumme -- Steve Reid -- Samuel Neves -- Solar Designer -- Project Nayuki -- ARM Limited -- Yanbo Li dreamfly281@gmail.com, goldboar@163.comYanbo Li -- Mark Adler -- Yann Collet diff --git a/tools/mnemonic-test/node_modules/hash-wasm/README.md b/tools/mnemonic-test/node_modules/hash-wasm/README.md deleted file mode 100644 index 8bc3627b..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/README.md +++ /dev/null @@ -1,543 +0,0 @@ -# hash-wasm - -[![npm package](https://img.shields.io/npm/v/hash-wasm.svg)](http://npmjs.org/package/hash-wasm) -[![Bundle size](https://badgen.net/bundlephobia/minzip/hash-wasm)](https://bundlephobia.com/result?p=hash-wasm) -[![codecov](https://codecov.io/gh/Daninet/hash-wasm/branch/master/graph/badge.svg)](https://codecov.io/gh/Daninet/hash-wasm) -[![Build status](https://github.com/Daninet/hash-wasm/workflows/Build%20&%20publish/badge.svg?branch=master)](https://github.com/Daninet/hash-wasm/actions) -[![JSDelivr downloads](https://data.jsdelivr.com/v1/package/npm/hash-wasm/badge)](https://www.jsdelivr.com/package/npm/hash-wasm) - -Hash-WASM is a ⚡lightning fast⚡ hash function library for browsers and Node.js. -It is using hand-tuned WebAssembly binaries to calculate the hash faster than other libraries. - -# Supported algorithms - -| Name | Bundle size (gzipped) | -| ---------------------------------------------- | --------------------- | -| Adler-32 | 3 kB | -| Argon2: Argon2d, Argon2i, Argon2id (v1.3) | 11 kB | -| bcrypt | 11 kB | -| BLAKE2b | 6 kB | -| BLAKE2s | 5 kB | -| BLAKE3 | 9 kB | -| CRC32 | 3 kB | -| CRC64 | 4 kB | -| HMAC | - | -| MD4 | 4 kB | -| MD5 | 4 kB | -| PBKDF2 | - | -| RIPEMD-160 | 5 kB | -| scrypt | 10 kB | -| SHA-1 | 5 kB | -| SHA-2: SHA-224, SHA-256 | 7 kB | -| SHA-2: SHA-384, SHA-512 | 8 kB | -| SHA-3: SHA3-224, SHA3-256, SHA3-384, SHA3-512 | 4 kB | -| Keccak-224, Keccak-256, Keccak-384, Keccak-512 | 4 kB | -| SM3 | 4 kB | -| Whirlpool | 6 kB | -| xxHash32 | 3 kB | -| xxHash64 | 4 kB | -| xxHash3 | 7 kB | -| xxHash128 | 8 kB | - -# Features - -- A lot faster than other JS / WASM implementations (see [benchmarks](#benchmark) below) -- It's lightweight. See the table above -- Compiled from heavily optimized algorithms written in C -- Supports all modern browsers, Node.js and Deno -- Supports large data streams -- Supports UTF-8 strings and typed arrays -- Supports chunked input streams -- Modular architecture (the algorithms are compiled into individual WASM binaries) -- WASM modules are bundled as base64 strings (no problems with linking) -- Supports tree shaking (Webpack only bundles the hash algorithms you use) -- Works without Webpack or other bundlers -- Includes TypeScript type definitions -- Works in Web Workers -- Zero dependencies -- Supports concurrent hash calculations with multiple states -- Supports saving and loading the internal state of the hash (segmented hashing and rewinding) -- [Unit tests](https://github.com/Daninet/hash-wasm/tree/master/test) for all algorithms -- 100% open source & transparent [build process](https://github.com/Daninet/hash-wasm/actions) -- Easy to use, Promise-based API - -# Installation - -``` -npm i hash-wasm -``` - -It can also be used directly from HTML (via [jsDelivr](https://www.jsdelivr.com/package/npm/hash-wasm)): - -```html - - - - - - -``` - -# Examples - -### Demo apps - -[Hash calculator](https://3w4be.csb.app/) - [source code](https://codesandbox.io/s/hash-wasm-3w4be?file=/src/App.tsx) - -[MD5 file hasher using HTML5 File API](https://stackoverflow.com/a/63287199/6251760) - -### Usage with the shorthand form - -It is the easiest and the fastest way to calculate hashes. Use it when the input buffer is already in the memory. - -```javascript -import { md5, sha1, sha512, sha3 } from "hash-wasm"; - -async function run() { - console.log("MD5:", await md5("demo")); - - const int8Buffer = new Uint8Array([0, 1, 2, 3]); - console.log("SHA1:", await sha1(int8Buffer)); - console.log("SHA512:", await sha512(int8Buffer)); - - const int32Buffer = new Uint32Array([1056, 641]); - console.log("SHA3-256:", await sha3(int32Buffer, 256)); -} - -run(); -``` - -_\* See [String encoding pitfalls](#string-encoding-pitfalls)_ - -_\*\* See [API reference](#api)_ - -### Advanced usage with streaming input - -createXXXX() functions create new WASM instances with separate states, which can be used to calculate multiple hashes paralelly. They are slower compared to shorthand functions like md5(), which reuse the same WASM instance and state to do multiple calculations. For this reason, the shorthand form is always preferred when the data is already in the memory. - -For the best performance, avoid calling createXXXX() functions in loops. When calculating multiple hashes sequentially, the init() function can be used to reset the internal state between runs. It is faster than creating new instances with createXXXX(). - -```javascript -import { createSHA1 } from "hash-wasm"; - -async function run() { - const sha1 = await createSHA1(); - sha1.init(); - - while (hasMoreData()) { - const chunk = readChunk(); - sha1.update(chunk); - } - - const hash = sha1.digest("binary"); // returns Uint8Array - console.log("SHA1:", hash); -} - -run(); -``` - -_\* See [String encoding pitfalls](#string-encoding-pitfalls)_ - -_\*\* See [API reference](#api)_ - -### Hashing passwords with Argon2 - -The recommended process for choosing the parameters can be found here: https://tools.ietf.org/html/draft-irtf-cfrg-argon2-04#section-4 - -```javascript -import { argon2id, argon2Verify } from "hash-wasm"; - -async function run() { - const salt = new Uint8Array(16); - window.crypto.getRandomValues(salt); - - const key = await argon2id({ - password: "pass", - salt, // salt is a buffer containing random bytes - parallelism: 1, - iterations: 256, - memorySize: 512, // use 512KB memory - hashLength: 32, // output size = 32 bytes - outputType: "encoded", // return standard encoded string containing parameters needed to verify the key - }); - - console.log("Derived key:", key); - - const isValid = await argon2Verify({ - password: "pass", - hash: key, - }); - - console.log(isValid ? "Valid password" : "Invalid password"); -} - -run(); -``` - -_\* See [String encoding pitfalls](#string-encoding-pitfalls)_ - -_\*\* See [API reference](#api)_ - -### Hashing passwords with bcrypt - -```javascript -import { bcrypt, bcryptVerify } from "hash-wasm"; - -async function run() { - const salt = new Uint8Array(16); - window.crypto.getRandomValues(salt); - - const key = await bcrypt({ - password: "pass", - salt, // salt is a buffer containing 16 random bytes - costFactor: 11, - outputType: "encoded", // return standard encoded string containing parameters needed to verify the key - }); - - console.log("Derived key:", key); - - const isValid = await bcryptVerify({ - password: "pass", - hash: key, - }); - - console.log(isValid ? "Valid password" : "Invalid password"); -} - -run(); -``` - -_\* See [String encoding pitfalls](#string-encoding-pitfalls)_ - -_\*\* See [API reference](#api)_ - -### Calculating HMAC - -All supported hash functions can be used to calculate HMAC. For the best performance, avoid calling createXXXX() in loops (see `Advanced usage with streaming input` section above) - -```javascript -import { createHMAC, createSHA3 } from "hash-wasm"; - -async function run() { - const hashFunc = createSHA3(224); // SHA3-224 - const hmac = await createHMAC(hashFunc, "key"); - - const fruits = ["apple", "raspberry", "watermelon"]; - console.log("Input:", fruits); - - const codes = fruits.map((data) => { - hmac.init(); - hmac.update(data); - return hmac.digest(); - }); - - console.log("HMAC:", codes); -} - -run(); -``` - -_\* See [String encoding pitfalls](#string-encoding-pitfalls)_ - -_\*\* See [API reference](#api)_ - -### Calculating PBKDF2 - -All supported hash functions can be used to calculate PBKDF2. For the best performance, avoid calling createXXXX() in loops (see `Advanced usage with streaming input` section above) - -```javascript -import { pbkdf2, createSHA1 } from "hash-wasm"; - -async function run() { - const salt = new Uint8Array(16); - window.crypto.getRandomValues(salt); - - const key = await pbkdf2({ - password: "password", - salt, - iterations: 1000, - hashLength: 32, - hashFunction: createSHA1(), - outputType: "hex", - }); - - console.log("Derived key:", key); -} - -run(); -``` - -_\* See [String encoding pitfalls](#string-encoding-pitfalls)_ - -_\*\* See [API reference](#api)_ - -### String encoding pitfalls - -You should be aware that there may be multiple UTF-8 representations of a given string: - -```js -"\u00fc"; // encodes the ü character -"u\u0308"; // also encodes the ü character - -"\u00fc" === "u\u0308"; // false -"ü" === "ü"; // false -``` - -All algorithms defined in this library depend on the binary representation of the input string. Thus, it's highly recommended to normalize your strings before passing it to hash-wasm. You can use the `normalize()` built-in String function to archive this: - -```js -"\u00fc".normalize() === "u\u0308".normalize(); // true - -const te = new TextEncoder(); -te.encode("u\u0308"); // Uint8Array(3) [117, 204, 136] -te.encode("\u00fc"); // Uint8Array(2) [195, 188] - -te.encode("u\u0308".normalize("NFKC")); // Uint8Array(2) [195, 188] -te.encode("\u00fc".normalize("NFKC")); // Uint8Array(2) [195, 188] -``` - -You can read more about this issue here: https://en.wikipedia.org/wiki/Unicode_equivalence - -### Resumable hashing - -You can save the current internal state of the hash using the `.save()` function. This state may be written to disk or stored elsewhere in memory. -You can then use the `.load(state)` function to reload that state into a new instance of the hash, or back into the same instance. - -This allows you to span the work of hashing a file across multiple processes (e.g. in environments with limited execution times like AWS Lambda, where large jobs need to be split across multiple invocations), or rewind the hash to an earlier point in the stream. For example, the first process could: - -```js -// first process starts hashing -const md5 = await createMD5(); -md5.init(); -md5.update("Hello, "); -const state = md5.save(); // save this state - -// second process resumes hashing from the stored state -const md5 = await createMD5(); -md5.load(state); -md5.update("world!"); -console.log(md5.digest()); // Prints 6cd3556deb0da54bca060b4c39479839 = md5("Hello, world!") -``` - -_Note that both the saving and loading processes must be running compatible versions of the hash function (i.e. the hash function hasn't changed between the versions of hash-wasm used in the saving and loading processes). If the saved state is incompatible, `load()` will throw an exception._ - -_The saved state can contain information about the input, including plaintext input bytes, so from a security perspective it must be treated with the same care as the input data itself._ - -
- -# Browser support - -
- -| Chrome | Safari | Firefox | Edge | IE | Node.js | Deno | -| ------ | ------ | ------- | ---- | ------------- | ------- | ---- | -| 57+ | 11+ | 53+ | 16+ | Not supported | 8+ | 1+ | - -
- -# Benchmark - -You can make your own measurements here: [link](https://daninet.github.io/hash-wasm-benchmark/) - -Two scenarios were measured: - -- throughput with the short form (input size = 32 bytes) -- throughput with the short form (input size = 1MB) - -Results: - -| MD5 | throughput (32 bytes) | throughput (1MB) | -| --------------------------- | --------------------- | ---------------- | -| **hash-wasm 4.10.0** | **110.52 MB/s** | **850.31 MB/s** | -| spark-md5 3.0.2 (from npm) | 38.87 MB/s | 171.73 MB/s | -| md5-wasm 2.0.0 (from npm) | 37.36 MB/s | 131.77 MB/s | -| crypto-js 4.1.1 (from npm) | 9.30 MB/s | 46.71 MB/s | -| node-forge 1.3.1 (from npm) | 18.23 MB/s | 28.94 MB/s | -| md5 2.3.0 (from npm) | 14.50 MB/s | 21.65 MB/s | - -# - -| SHA1 | throughput (32 bytes) | throughput (1MB) | -| --------------------------- | --------------------- | ---------------- | -| **hash-wasm 4.10.0** | **83.80 MB/s** | **798.19 MB/s** | -| jsSHA 3.3.1 (from npm) | 34.93 MB/s | 78.12 MB/s | -| crypto-js 4.1.1 (from npm) | 9.50 MB/s | 69.02 MB/s | -| node-forge 1.3.1 (from npm) | 17.02 MB/s | 32.00 MB/s | -| sha1 1.1.1 (from npm) | 14.68 MB/s | 24.24 MB/s | - -# - -| SHA256 | throughput (32 bytes) | throughput (1MB) | -| ----------------------------- | --------------------- | ---------------- | -| **hash-wasm 4.10.0** | **63.99 MB/s** | **426.16 MB/s** | -| sha256-wasm 2.2.2 (from npm) | 20.37 MB/s | 308.39 MB/s | -| noble-hashes 1.3.2 (from npm) | 24.73 MB/s | 110.02 MB/s | -| crypto-js 4.1.1 (from npm) | 8.99 MB/s | 65.17 MB/s | -| jsSHA 3.3.1 (from npm) | 25.64 MB/s | 57.98 MB/s | -| node-forge 1.3.1 (from npm) | 13.93 MB/s | 28.19 MB/s | - -# - -| SHA3-512 | throughput (32 bytes) | throughput (1MB) | -| ----------------------------- | --------------------- | ---------------- | -| **hash-wasm 4.10.0** | **38.06 MB/s** | **234.40 MB/s** | -| sha3-wasm 1.0.0 (from npm) | 15.44 MB/s | 101.51 MB/s | -| noble-hashes 1.3.2 (from npm) | 5.74 MB/s | 14.19 MB/s | -| sha3 2.1.4 (from npm) | 3.80 MB/s | 10.73 MB/s | -| jsSHA 3.2.0 (from npm) | 2.08 MB/s | 3.82 MB/s | - -# - -| XXHash64 | throughput (32 bytes) | throughput (1MB) | -| ---------------------------- | --------------------- | ------------------ | -| **hash-wasm 4.10.0** | **101.66 MB/s** | **15 989 MB/s** | -| xxhash-wasm 1.0.2 (from npm) | 47.58 MB/s | 15 929 MB/s | -| xxhashjs 0.2.2 (from npm) | 0.92 MB/s | 42.26 MB/s | - -# - -| PBKDF2-SHA512 - 1000 iterations | operations per second (16 bytes) | -| ------------------------------- | -------------------------------- | -| **hash-wasm 4.10.0** | **588 ops** | -| noble-hashes 1.3.2 (from npm) | 395 ops | -| pbkdf2 3.1.2 (from npm) | 83 ops | -| crypto-js 4.1.1 (from npm) | 29 ops | - -# - -| Argon2id (m=512, t=8, p=1) | operations per second (16 bytes) | -| -------------------------------- | -------------------------------- | -| **hash-wasm 4.10.0** | **438 ops** | -| argon2-browser 1.18.0 (from npm) | 213 ops | -| argon2-wasm-pro 1.1.0 (from npm) | 203 ops | -| argon2-wasm 0.9.0 (from npm) | 195 ops | - -
- -\* These measurements were made with `Chrome v131` on a Ryzen 9 7900X desktop CPU. - -# API - -```ts -type IDataType = string | Buffer | Uint8Array | Uint16Array | Uint32Array; - -// all functions return hash in hex format -adler32(data: IDataType): Promise -blake2b(data: IDataType, bits?: number, key?: IDataType): Promise // default is 512 bits -blake2s(data: IDataType, bits?: number, key?: IDataType): Promise // default is 256 bits -blake3(data: IDataType, bits?: number, key?: IDataType): Promise // default is 256 bits -crc32(data: IDataType, polynomial?: number): Promise // default polynomial is 0xedb88320, for CRC32C use 0x82f63b78 -crc64(data: IDataType, polynomial?: string): Promise // default polynomial is 'c96c5795d7870f42' (ECMA) -keccak(data: IDataType, bits?: 224 | 256 | 384 | 512): Promise // default is 512 bits -md4(data: IDataType): Promise -md5(data: IDataType): Promise -ripemd160(data: IDataType): Promise -sha1(data: IDataType): Promise -sha224(data: IDataType): Promise -sha256(data: IDataType): Promise -sha3(data: IDataType, bits?: 224 | 256 | 384 | 512): Promise // default is 512 bits -sha384(data: IDataType): Promise -sha512(data: IDataType): Promise -sm3(data: IDataType): Promise -whirlpool(data: IDataType): Promise -xxhash32(data: IDataType, seed?: number): Promise -xxhash64(data: IDataType, seedLow?: number, seedHigh?: number): Promise -xxhash3(data: IDataType, seedLow?: number, seedHigh?: number): Promise -xxhash128(data: IDataType, seedLow?: number, seedHigh?: number): Promise - -interface IHasher { - init: () => IHasher; - update: (data: IDataType) => IHasher; - digest: (outputType: 'hex' | 'binary') => string | Uint8Array; // by default returns hex string - save: () => Uint8Array; // returns the internal state for later resumption - load: (state: Uint8Array) => IHasher; // loads a previously saved internal state - blockSize: number; // in bytes - digestSize: number; // in bytes -} - -createAdler32(): Promise -createBLAKE2b(bits?: number, key?: IDataType): Promise // default is 512 bits -createBLAKE2s(bits?: number, key?: IDataType): Promise // default is 256 bits -createBLAKE3(bits?: number, key?: IDataType): Promise // default is 256 bits -createCRC32(polynomial?: number): Promise // default polynomial is 0xedb88320, for CRC32C use 0x82f63b78 -createCRC64(polynomial?: number): Promise // default polynomial is 'c96c5795d7870f42' (ECMA) -createKeccak(bits?: 224 | 256 | 384 | 512): Promise // default is 512 bits -createMD4(): Promise -createMD5(): Promise -createRIPEMD160(): Promise -createSHA1(): Promise -createSHA224(): Promise -createSHA256(): Promise -createSHA3(bits?: 224 | 256 | 384 | 512): Promise // default is 512 bits -createSHA384(): Promise -createSHA512(): Promise -createSM3(): Promise -createWhirlpool(): Promise -createXXHash32(seed: number): Promise -createXXHash64(seedLow: number, seedHigh: number): Promise -createXXHash3(seedLow: number, seedHigh: number): Promise -createXXHash128(seedLow: number, seedHigh: number): Promise - -createHMAC(hashFunction: Promise, key: IDataType): Promise - -pbkdf2({ - password: IDataType, // password (or message) to be hashed - salt: IDataType, // salt (usually containing random bytes) - iterations: number, // number of iterations to perform - hashLength: number, // output size in bytes - hashFunction: Promise, // the return value of a function like createSHA1() - outputType?: 'hex' | 'binary', // by default returns hex string -}): Promise - -scrypt({ - password: IDataType, // password (or message) to be hashed - salt: IDataType, // salt (usually containing random bytes) - costFactor: number, // CPU/memory cost - must be a power of 2 (e.g. 1024) - blockSize: number, // block size parameter (8 is commonly used) - parallelism: number, // degree of parallelism - hashLength: number, // output size in bytes - outputType?: 'hex' | 'binary', // by default returns hex string -}): Promise - -interface IArgon2Options { - password: IDataType; // password (or message) to be hashed - salt: IDataType; // salt (usually containing random bytes) - secret?: IDataType; // secret for keyed hashing - iterations: number; // number of iterations to perform - parallelism: number; // degree of parallelism - memorySize: number; // amount of memory to be used in kibibytes (1024 bytes) - hashLength: number; // output size in bytes - outputType?: 'hex' | 'binary' | 'encoded'; // by default returns hex string -} - -argon2i(options: IArgon2Options): Promise -argon2d(options: IArgon2Options): Promise -argon2id(options: IArgon2Options): Promise - -argon2Verify({ - password: IDataType, // password - secret?: IDataType, // secret used on hash creation - hash: string, // encoded hash -}): Promise - -bcrypt({ - password: IDataType, // password - salt: IDataType, // salt (16 bytes long - usually containing random bytes) - costFactor: number, // number of iterations to perform (4 - 31) - outputType?: 'hex' | 'binary' | 'encoded', // by default returns encoded string -}): Promise - -bcryptVerify({ - password: IDataType, // password - hash: string, // encoded hash -}): Promise - -``` - -# Future plans - -- Add more well-known algorithms -- Write a polyfill which keeps bundle sizes low and enables running binaries containing newer WASM instructions -- Use WebAssembly Bulk Memory Operations -- Use WebAssembly SIMD instructions (expecting a 10-20% performance increase) -- Enable multithreading where it's possible (like at Argon2) diff --git a/tools/mnemonic-test/node_modules/hash-wasm/biome.json b/tools/mnemonic-test/node_modules/hash-wasm/biome.json deleted file mode 100644 index e05b70d9..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/biome.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", - "vcs": { - "enabled": false, - "clientKind": "git", - "useIgnoreFile": false - }, - "files": { - "ignoreUnknown": false, - "ignore": [] - }, - "formatter": { - "enabled": true, - "indentStyle": "tab" - }, - "organizeImports": { - "enabled": true - }, - "linter": { - "enabled": true, - "rules": { - "recommended": true - } - }, - "javascript": { - "formatter": { - "quoteStyle": "double" - } - }, - "overrides": [ - { - "include": ["test/**"], - "linter": { - "rules": { - "suspicious": { - "noExplicitAny": "off" - } - } - } - } - ] -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/adler32.umd.min.js b/tools/mnemonic-test/node_modules/hash-wasm/dist/adler32.umd.min.js deleted file mode 100644 index 85c728ab..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/adler32.umd.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * hash-wasm (https://www.npmjs.com/package/hash-wasm) - * (c) Dani Biro - * @license MIT - */ - -!function(A,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((A="undefined"!=typeof globalThis?globalThis:A||self).hashwasm=A.hashwasm||{})}(this,(function(A){"use strict";var e,t={name:"adler32",data:"AGFzbQEAAAABDANgAAF/YAAAYAF/AAMHBgABAgEAAgUEAQECAgYOAn8BQYCJBQt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQAAQtIYXNoX1VwZGF0ZQACCkhhc2hfRmluYWwAAw1IYXNoX0dldFN0YXRlAAQOSGFzaF9DYWxjdWxhdGUABQpTVEFURV9TSVpFAwEK6wkGBQBBgAkLCgBBAEEBNgKECAvjCAEHf0EAKAKECCIBQf//A3EhAiABQRB2IQMCQAJAIABBAUcNACACQQAtAIAJaiIBQY+AfGogASABQfD/A0sbIgEgA2oiBEEQdCIFQYCAPGogBSAEQfD/A0sbIAFyIQEMAQsCQAJAAkACQAJAIABBEEkNAEGACSEGIABBsCtJDQFBgAkhBgNAQQAhBQNAIAYgBWoiASgCACIEQf8BcSACaiICIANqIAIgBEEIdkH/AXFqIgJqIAIgBEEQdkH/AXFqIgJqIAIgBEEYdmoiAmogAiABQQRqKAIAIgRB/wFxaiICaiACIARBCHZB/wFxaiICaiACIARBEHZB/wFxaiICaiACIARBGHZqIgJqIAIgAUEIaigCACIEQf8BcWoiAmogAiAEQQh2Qf8BcWoiAmogAiAEQRB2Qf8BcWoiAmogAiAEQRh2aiIEaiAEIAFBDGooAgAiAUH/AXFqIgRqIAQgAUEIdkH/AXFqIgRqIAQgAUEQdkH/AXFqI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BBATYChAggABACQQBBACgChAgiAEEYdCAAQYD+A3FBCHRyIABBCHZBgP4DcSAAQRh2cnI2AoAJCwsVAgBBgAgLBAQAAAAAQYQICwQBAAAA",hash:"02ddbd17"};function n(A,e,t,n){return new(t||(t=Promise))((function(r,i){function o(A){try{s(n.next(A))}catch(A){i(A)}}function a(A){try{s(n.throw(A))}catch(A){i(A)}}function s(A){var e;A.done?r(A.value):(e=A.value,e instanceof t?e:new t((function(A){A(e)}))).then(o,a)}s((n=n.apply(A,e||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class r{constructor(){this.mutex=Promise.resolve()}lock(){let A=()=>{};return this.mutex=this.mutex.then((()=>new Promise(A))),new Promise((e=>{A=e}))}dispatch(A){return n(this,void 0,void 0,(function*(){const e=yield this.lock();try{return yield Promise.resolve(A())}finally{e()}}))}}const i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,o=null!==(e=i.Buffer)&&void 0!==e?e:null,a=i.TextEncoder?new i.TextEncoder:null;function s(A,e){return(15&A)+(A>>6|A>>3&8)<<4|(15&e)+(e>>6|e>>3&8)}const B="a".charCodeAt(0)-10,g="0".charCodeAt(0);function f(A,e,t){let n=0;for(let r=0;r>>4;A[n++]=t>9?t+B:t+g,t=15&e[r],A[n++]=t>9?t+B:t+g}return String.fromCharCode.apply(null,A)}const l=null!==o?A=>{if("string"==typeof A){const e=o.from(A,"utf8");return new Uint8Array(e.buffer,e.byteOffset,e.length)}if(o.isBuffer(A))return new Uint8Array(A.buffer,A.byteOffset,A.length);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")}:A=>{if("string"==typeof A)return a.encode(A);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")},c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",I=new Uint8Array(256);for(let A=0;A>4,r+=1,n[r]=(15&i)<<4|o>>2,r+=1,n[r]=(3&o)<<6|63&a,r+=1}return n}const h=16384,E=new r,u=new Map;function d(A,e){return n(this,void 0,void 0,(function*(){let t=null,r=null,i=!1;if("undefined"==typeof WebAssembly)throw new Error("WebAssembly is not supported in this environment!");const o=()=>new DataView(t.exports.memory.buffer).getUint32(t.exports.STATE_SIZE,!0),a=E.dispatch((()=>n(this,void 0,void 0,(function*(){if(!u.has(A.name)){const e=Q(A.data),t=WebAssembly.compile(e);u.set(A.name,t)}const e=yield u.get(A.name);t=yield WebAssembly.instantiate(e,{})})))),B=(A=null)=>{i=!0,t.exports.Hash_Init(A)},g=A=>{if(!i)throw new Error("update() called before init()");(A=>{let e=0;for(;e{if(!i)throw new Error("digest() called before init()");return i=!1,t.exports.Hash_Final(n),"binary"===A?r.slice(0,e):f(c,r,e)},d=A=>"string"==typeof A?A.length<4096:A.byteLength!0;break;case"blake2b":case"blake2s":C=(A,e)=>e<=512&&d(A);break;case"blake3":C=(A,e)=>0===e&&d(A);break;case"xxhash64":case"xxhash3":case"xxhash128":case"crc64":C=()=>!1}return yield(()=>n(this,void 0,void 0,(function*(){t||(yield a);const A=t.exports.Hash_GetBuffer(),e=t.exports.memory.buffer;r=new Uint8Array(e,A,h)})))(),{getMemory:()=>r,writeMemory:(A,e=0)=>{r.set(A,e)},getExports:()=>t.exports,setMemorySize:A=>{t.exports.Hash_SetMemorySize(A);const e=t.exports.Hash_GetBuffer(),n=t.exports.memory.buffer;r=new Uint8Array(n,e,A)},init:B,update:g,digest:I,save:()=>{if(!i)throw new Error("save() can only be called after init() and before digest()");const e=t.exports.Hash_GetState(),n=o(),r=t.exports.memory.buffer,a=new Uint8Array(r,e,n),B=new Uint8Array(4+n);return function(A,e){const t=e.length>>1;for(let n=0;n{if(!(e instanceof Uint8Array))throw new Error("load() expects an Uint8Array generated by save()");const n=t.exports.Hash_GetState(),r=o(),a=4+r,B=t.exports.memory.buffer;if(e.length!==a)throw new Error(`Bad state length (expected ${a} bytes, got ${e.length})`);if(!function(A,e){if(A.length!==2*e.length)return!1;for(let t=0;t{if(!C(A,n))return B(n),g(A),I("hex",i);const o=l(A);return r.set(o),t.exports.Hash_Calculate(o.length,n,i),f(c,r,e)},hashLength:e}}))}const C=new r;let y=null;A.adler32=function(A){if(null===y)return function(A,e,t){return n(this,void 0,void 0,(function*(){const n=yield A.lock(),r=yield d(e,t);return n(),r}))}(C,t,4).then((e=>(y=e,y.calculate(A))));try{const e=y.calculate(A);return Promise.resolve(e)}catch(A){return Promise.reject(A)}},A.createAdler32=function(){return d(t,4).then((A=>{A.init();const e={init:()=>(A.init(),e),update:t=>(A.update(t),e),digest:e=>A.digest(e),save:()=>A.save(),load:t=>(A.load(t),e),blockSize:4,digestSize:4};return e}))}})); diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/argon2.umd.min.js b/tools/mnemonic-test/node_modules/hash-wasm/dist/argon2.umd.min.js deleted file mode 100644 index ade8f218..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/argon2.umd.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * hash-wasm (https://www.npmjs.com/package/hash-wasm) - * (c) Dani Biro - * @license MIT - */ - -!function(A,I){"object"==typeof exports&&"undefined"!=typeof module?I(exports):"function"==typeof define&&define.amd?define(["exports"],I):I((A="undefined"!=typeof globalThis?globalThis:A||self).hashwasm=A.hashwasm||{})}(this,(function(A){"use strict";function I(A,I,i,C){return new(i||(i=Promise))((function(g,Q){function B(A){try{e(C.next(A))}catch(A){Q(A)}}function h(A){try{e(C.throw(A))}catch(A){Q(A)}}function e(A){var I;A.done?g(A.value):(I=A.value,I instanceof i?I:new i((function(A){A(I)}))).then(B,h)}e((C=C.apply(A,I||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;var i,C={name:"argon2",data:"AGFzbQEAAAABKQVgAX8Bf2AAAX9gEH9/f39/f39/f39/f39/f38AYAR/f39/AGACf38AAwYFAAECAwQFBgEBAoCAAgYIAX8BQZCoBAsHQQQGbWVtb3J5AgASSGFzaF9TZXRNZW1vcnlTaXplAAAOSGFzaF9HZXRCdWZmZXIAAQ5IYXNoX0NhbGN1bGF0ZQAECvEyBVgBAn9BACEBAkAgAEEAKAKICCICRg0AAkAgACACayIAQRB2IABBgIB8cSAASWoiAEAAQX9HDQBB/wHADwtBACEBQQBBACkDiAggAEEQdK18NwOICAsgAcALcAECfwJAQQAoAoAIIgANAEEAPwBBEHQiADYCgAhBACgCiAgiAUGAgCBGDQACQEGAgCAgAWsiAEEQdiAAQYCAfHEgAElqIgBAAEF/Rw0AQQAPC0EAQQApA4gIIABBEHStfDcDiAhBACgCgAghAAsgAAvcDgECfiAAIAQpAwAiECAAKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAMIBAgDCkDAIVCIIkiEDcDACAIIBAgCCkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgBCAQIAQpAwCFQiiJIhA3AwAgACAQIAApAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIAwgECAMKQMAhUIwiSIQNwMAIAggECAIKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAEIBAgBCkDAIVCAYk3AwAgASAFKQMAIhAgASkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgDSAQIA0pAwCFQiCJIhA3AwAgCSAQIAkpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAUgECAFKQMAhUIoiSIQNwMAIAEgECABKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACANIBAgDSkDAIVCMIkiEDcDACAJIBAgCSkDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgBSAQIAUpAwCFQgGJNwMAIAIgBikDACIQIAIpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIA4gECAOKQMAhUIgiSIQNwMAIAogECAKKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAGIBAgBikDAIVCKIkiEDcDACACIBAgAikDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgDiAQIA4pAwCFQjCJIhA3AwAgCiAQIAopAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIAYgECAGKQMAhUIBiTcDACADIAcpAwAiECADKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAPIBAgDykDAIVCIIkiEDcDACALIBAgCykDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgByAQIAcpAwCFQiiJIhA3AwAgAyAQIAMpAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIA8gECAPKQMAhUIwiSIQNwMAIAsgECALKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAHIBAgBykDAIVCAYk3AwAgACAFKQMAIhAgACkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgDyAQIA8pAwCFQiCJIhA3AwAgCiAQIAopAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAUgECAFKQMAhUIoiSIQNwMAIAAgECAAKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAPIBAgDykDAIVCMIkiEDcDACAKIBAgCikDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgBSAQIAUpAwCFQgGJNwMAIAEgBikDACIQIAEpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAwgECAMKQMAhUIgiSIQNwMAIAsgECALKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAGIBAgBikDAIVCKIkiEDcDACABIBAgASkDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgDCAQIAwpAwCFQjCJIhA3AwAgCyAQIAspAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIAYgECAGKQMAhUIBiTcDACACIAcpAwAiECACKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACANIBAgDSkDAIVCIIkiEDcDACAIIBAgCCkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgByAQIAcpAwCFQiiJIhA3AwAgAiAQIAIpAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIA0gECANKQMAhUIwiSIQNwMAIAggECAIKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAHIBAgBykDAIVCAYk3AwAgAyAEKQMAIhAgAykDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgDiAQIA4pAwCFQiCJIhA3AwAgCSAQIAkpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAQgECAEKQMAhUIoiSIQNwMAIAMgECADKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAOIBAgDikDAIVCMIkiEDcDACAJIBAgCSkDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgBCAQIAQpAwCFQgGJNwMAC98aAQN/QQAhBEEAIAIpAwAgASkDAIU3A5AIQQAgAikDCCABKQMIhTcDmAhBACACKQMQIAEpAxCFNwOgCEEAIAIpAxggASkDGIU3A6gIQQAgAikDICABKQMghTcDsAhBACACKQMoIAEpAyiFNwO4CEEAIAIpAzAgASkDMIU3A8AIQQAgAikDOCABKQM4hTcDyAhBACACKQNAIAEpA0CFNwPQCEEAIAIpA0ggASkDSIU3A9gIQQAgAikDUCABKQNQhTcD4AhBACACKQNYIAEpA1iFNwPoCEEAIAIpA2AgASkDYIU3A/AIQQAgAikDaCABKQNohTcD+AhBACACKQNwIAEpA3CFNwOACUEAIAIpA3ggASkDeIU3A4gJQQAgAikDgAEgASkDgAGFNwOQCUEAIAIpA4gBIAEpA4gBhTcDmAlBACACKQOQASABKQOQAYU3A6AJQQAgAikDmAEgASkDmAGFNwOoCUEAIAIpA6ABIAEpA6ABhTcDsAlBACACKQOoASABKQOoAYU3A7gJQQAgAikDsAEgASkDsAGFN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hGQNAQQBCADcDwBBBACAZNwOYECAYIQECQCASRQ0AQQBCATcDwBBBkBhBkBBBkCBBABADQZAYQZAYQZAgQQAQA0ECIQELAkAgASAITw0AIAQgGaciGmwgF2ogAWohAwNAIANBACAEIAEbQQAgEVAiGxtqQX9qIRwCQAJAIBQNAEEAKAKACCICIBxBCnQiHGohCgwBCwJAIAFB/wBxIgINAEEAQQApA8AQQgF8NwPAEEGQGEGQEEGQIEEAEANBkBhBkBhBkCBBABADCyAcQQp0IRwgAkEDdEGQGGohCkEAKAKACCECCyACIANBCnRqIAIgHGogAiAKKQMAIh1CIIinIAVwIBogFhsiHCAEbCABIAFBACAZIBytUSIcGyIKIBsbIBdqIAogC2ogExsgAUUgHHJrIhsgFWqtIB1C/////w+DIh0gHX5CIIggG61+QiCIfSAMgqdqQQp0akEBEAMgA0EBaiEDIAggAUEBaiIBRw0ACwsgGUIBfCIZIA1SDQALIBFCAXwiEachASARQgRSDQALIA9CAXwiDyAHUg0AC0EAKAKACCECCyAJQQx0QYB4aiEXIAVBf2oiCkUNAgwBC0EAQgM3A6AQQQAgBEF/aq03A5AQQYB4IRcLIAIgF2ohGyAIQQx0IQhBACEcA0AgCCAcQQFqIhxsQYB4aiEEQQAhAQNAIBsgAWoiAyADKQMAIAIgBCABamopAwCFNwMAIANBCGoiAyADKQMAIAIgBCABQQhyamopAwCFNwMAIAFBCGohAyABQRBqIQEgA0H4B0kNAAsgHCAKRw0ACwsgAiAXaiEbQXghAQNAIAIgAWoiA0EIaiAbIAFqIgRBCGopAwA3AwAgA0EQaiAEQRBqKQMANwMAIANBGGogBEEYaikDADcDACADQSBqIARBIGopAwA3AwAgAUEgaiIBQfgHSQ0ACwsL",hash:"e4cdc523"};class g{constructor(){this.mutex=Promise.resolve()}lock(){let A=()=>{};return this.mutex=this.mutex.then((()=>new Promise(A))),new Promise((I=>{A=I}))}dispatch(A){return I(this,void 0,void 0,(function*(){const I=yield this.lock();try{return yield Promise.resolve(A())}finally{I()}}))}}const Q="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,B=null!==(i=Q.Buffer)&&void 0!==i?i:null,h=Q.TextEncoder?new Q.TextEncoder:null;function e(A,I){return(15&A)+(A>>6|A>>3&8)<<4|(15&I)+(I>>6|I>>3&8)}function w(A,I){const i=I.length>>1;for(let C=0;C>>4;A[C++]=i>9?i+t:i+o,i=15&I[g],A[C++]=i>9?i+t:i+o}return String.fromCharCode.apply(null,A)}const n=null!==B?A=>{if("string"==typeof A){const I=B.from(A,"utf8");return new Uint8Array(I.buffer,I.byteOffset,I.length)}if(B.isBuffer(A))return new Uint8Array(A.buffer,A.byteOffset,A.length);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")}:A=>{if("string"==typeof A)return h.encode(A);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")},r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",D=new Uint8Array(256);for(let A=0;A>18&63)+r.charAt(i>>12&63)+r.charAt(i>>6&63)+r.charAt(63&i);g.push(C)}if(1===C){const C=A[i-1],Q=r.charAt(C>>2),B=r.charAt(C<<4&63);g.push(`${Q}${B}`),I&&g.push("==")}else if(2===C){const C=(A[i-2]<<8)+A[i-1],Q=r.charAt(C>>10),B=r.charAt(C>>4&63),h=r.charAt(C<<2&63);g.push(`${Q}${B}${h}`),I&&g.push("=")}return g.join("")}function f(A){let I=Math.floor(.75*A.length);const i=A.length;return"="===A[i-1]&&(I-=1,"="===A[i-2]&&(I-=1)),I}function k(A){const I=f(A),i=A.length,C=new Uint8Array(I);let g=0;for(let I=0;I>4,g+=1,C[g]=(15&Q)<<4|B>>2,g+=1,C[g]=(3&B)<<6|63&h,g+=1}return C}const a=16384,s=new g,S=new Map;function U(A,i){return I(this,void 0,void 0,(function*(){let C=null,g=null,Q=!1;if("undefined"==typeof WebAssembly)throw new Error("WebAssembly is not supported in this environment!");const B=()=>new DataView(C.exports.memory.buffer).getUint32(C.exports.STATE_SIZE,!0),h=s.dispatch((()=>I(this,void 0,void 0,(function*(){if(!S.has(A.name)){const I=k(A.data),i=WebAssembly.compile(I);S.set(A.name,i)}const I=yield S.get(A.name);C=yield WebAssembly.instantiate(I,{})})))),t=(A=null)=>{Q=!0,C.exports.Hash_Init(A)},o=A=>{if(!Q)throw new Error("update() called before init()");(A=>{let I=0;for(;I{if(!Q)throw new Error("digest() called before init()");return Q=!1,C.exports.Hash_Final(I),"binary"===A?g.slice(0,i):E(r,g,i)},F=A=>"string"==typeof A?A.length<4096:A.byteLength!0;break;case"blake2b":case"blake2s":f=(A,I)=>I<=512&&F(A);break;case"blake3":f=(A,I)=>0===I&&F(A);break;case"xxhash64":case"xxhash3":case"xxhash128":case"crc64":f=()=>!1}return yield(()=>I(this,void 0,void 0,(function*(){C||(yield h);const A=C.exports.Hash_GetBuffer(),I=C.exports.memory.buffer;g=new Uint8Array(I,A,a)})))(),{getMemory:()=>g,writeMemory:(A,I=0)=>{g.set(A,I)},getExports:()=>C.exports,setMemorySize:A=>{C.exports.Hash_SetMemorySize(A);const I=C.exports.Hash_GetBuffer(),i=C.exports.memory.buffer;g=new Uint8Array(i,I,A)},init:t,update:o,digest:D,save:()=>{if(!Q)throw new Error("save() can only be called after init() and before digest()");const I=C.exports.Hash_GetState(),i=B(),g=C.exports.memory.buffer,h=new Uint8Array(g,I,i),e=new Uint8Array(4+i);return w(e,A.hash),e.set(h,4),e},load:I=>{if(!(I instanceof Uint8Array))throw new Error("load() expects an Uint8Array generated by save()");const i=C.exports.Hash_GetState(),g=B(),h=4+g,w=C.exports.memory.buffer;if(I.length!==h)throw new Error(`Bad state length (expected ${h} bytes, got ${I.length})`);if(!function(A,I){if(A.length!==2*I.length)return!1;for(let i=0;i{if(!f(A,I))return t(I),o(A),D("hex",Q);const B=n(A);return g.set(B),C.exports.Hash_Calculate(B.length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EEAKQOgiwFC6/qG2r+19sEfhTcDsIkBQQBBACkDqIsBQvnC+JuRo7Pw2wCFNwO4iQFBACADp0H/AXE2AuSKAQJAIAFBAUgNACACQgA3A3ggAkIANwNwIAJCADcDaCACQgA3A2AgAkIANwNYIAJCADcDUCACQgA3A0ggAkIANwNAIAJCADcDOCACQgA3AzAgAkIANwMoIAJCADcDICACQgA3AxggAkIANwMQIAJCADcDCCACQgA3AwBBACEEA0AgAiAAaiAAQYAJai0AADoAACAAQQFqIQAgBEEBaiIEQf8BcSABSA0ACyACQYABEAELIAJBgAFqJAALEgAgAEEDdkH/P3EgAEEQdhAECwkAQYAJIAAQAQsGAEGAiQELGwAgAUEDdkH/P3EgAUEQdhAEQYAJIAAQARADCwsLAQBBgAgLBPAAAAA=",hash:"c6f286e6"};function G(A){return!Number.isInteger(A)||A<8||A>512||A%8!=0?new Error("Invalid variant! Valid values: 8, 16, ..., 512"):null}function p(A=512,I=null){if(G(A))return Promise.reject(G(A));let i=null,C=A;if(null!==I){if(i=n(I),i.length>64)return Promise.reject(new Error("Max key length is 64 bytes"));g=A,Q=i.length,C=g|Q<<16}var g,Q;const B=A/8;return U(c,B).then((A=>{C>512&&A.writeMemory(i),A.init(C);const I={init:C>512?()=>(A.writeMemory(i),A.init(C),I):()=>(A.init(C),I),update:i=>(A.update(i),I),digest:I=>A.digest(I),save:()=>A.save(),load:i=>(A.load(i),I),blockSize:128,digestSize:B};return I}))}new g;const y=new DataView(new ArrayBuffer(4));function J(A){return y.setInt32(0,A,!0),new Uint8Array(y.buffer)}function l(A,i,C){return I(this,void 0,void 0,(function*(){if(C<=64){const A=yield p(8*C);return A.update(J(C)),A.update(i),A.digest("binary")}const I=Math.ceil(C/32)-2,g=new Uint8Array(C);A.init(),A.update(J(C)),A.update(i);let Q=A.digest("binary");g.set(Q.subarray(0,32),0);for(let i=1;i{var I;if(!A||"object"!=typeof A)throw new Error("Invalid options parameter. It requires an object.");if(!A.password)throw new Error("Password must be specified");if(A.password=n(A.password),A.password.length<1)throw new Error("Password must be specified");if(!A.salt)throw new Error("Salt must be specified");if(A.salt=n(A.salt),A.salt.length<8)throw new Error("Salt should be at least 8 bytes long");if(A.secret=n(null!==(I=A.secret)&&void 0!==I?I:""),!Number.isInteger(A.iterations)||A.iterations<1)throw new Error("Iterations should be a positive number");if(!Number.isInteger(A.parallelism)||A.parallelism<1)throw new Error("Parallelism should be a positive number");if(!Number.isInteger(A.hashLength)||A.hashLength<4)throw new Error("Hash length should be at least 4 bytes.");if(!Number.isInteger(A.memorySize))throw new Error("Memory size should be specified.");if(A.memorySize<8*A.parallelism)throw new Error("Memory size should be at least 8 * parallelism.");if(void 0===A.outputType&&(A.outputType="hex"),!["hex","binary","encoded"].includes(A.outputType))throw new Error(`Insupported output type ${A.outputType}. Valid values: ['hex', 'binary', 'encoded']`)};A.argon2Verify=function(A){return I(this,void 0,void 0,(function*(){(A=>{if(!A||"object"!=typeof A)throw new Error("Invalid options parameter. It requires an object.");if(void 0===A.hash||"string"!=typeof A.hash)throw new Error("Hash should be specified")})(A);const I=((A,I,i)=>{const C=I.match(/^\$argon2(id|i|d)\$v=([0-9]+)\$((?:[mtp]=[0-9]+,){2}[mtp]=[0-9]+)\$([A-Za-z0-9+/]+)\$([A-Za-z0-9+/]+)$/);if(!C)throw new Error("Invalid hash");const[,g,Q,B,h,e]=C;if("19"!==Q)throw new Error(`Unsupported version: ${Q}`);const w={},t={m:"memorySize",p:"parallelism",t:"iterations"};for(const A of B.split(",")){const[I,i]=A.split("=");w[t[I]]=Number(i)}return Object.assign(Object.assign({},w),{password:A,secret:i,hashType:g,salt:k(h),hashLength:f(e),outputType:"encoded"})})(A.password,A.hash,A.secret);H(I);const i=A.hash.lastIndexOf("$")+1;return(yield u(I)).substring(i)===A.hash.substring(i)}))},A.argon2d=function(A){return I(this,void 0,void 0,(function*(){return H(A),u(Object.assign(Object.assign({},A),{hashType:"d"}))}))},A.argon2i=function(A){return I(this,void 0,void 0,(function*(){return H(A),u(Object.assign(Object.assign({},A),{hashType:"i"}))}))},A.argon2id=function(A){return I(this,void 0,void 0,(function*(){return H(A),u(Object.assign(Object.assign({},A),{hashType:"id"}))}))}})); diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/bcrypt.umd.min.js b/tools/mnemonic-test/node_modules/hash-wasm/dist/bcrypt.umd.min.js deleted file mode 100644 index bad62841..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/bcrypt.umd.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * hash-wasm (https://www.npmjs.com/package/hash-wasm) - * (c) Dani Biro - * @license MIT - */ - -!function(A,B){"object"==typeof exports&&"undefined"!=typeof module?B(exports):"function"==typeof define&&define.amd?define(["exports"],B):B((A="undefined"!=typeof globalThis?globalThis:A||self).hashwasm=A.hashwasm||{})}(this,(function(A){"use strict";function B(A,B,Q,g){return new(Q||(Q=Promise))((function(I,o){function C(A){try{H(g.next(A))}catch(A){o(A)}}function E(A){try{H(g.throw(A))}catch(A){o(A)}}function H(A){var B;A.done?I(A.value):(B=A.value,B instanceof Q?B:new Q((function(A){A(B)}))).then(C,E)}H((g=g.apply(A,B||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;var Q,g={name:"bcrypt",data:"AGFzbQEAAAABFwRgAAF/YAR/f39/AGADf39/AGABfwF/AwUEAAECAwUEAQECAgYIAX8BQZCrBQsHNAQGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAZiY3J5cHQAAg1iY3J5cHRfdmVyaWZ5AAMK9WAEBQBBgCsL21kEFH8Bfgh/AX4jAEHwAGshBCACQQA6AAIgAkGq4AA7AAACQCABLQAAQSpHDQAgAS0AAUEwRw0AIAJBMToAAQsCQCABLAAFIAEsAARBCmxqQfB7aiIFQQRJDQAgAS0AB0FgaiIGQd8ASw0AIAZBkAlqLQAAIgZBP0sNACABLQAIQWBqIgdB3wBLDQAgB0GQCWotAAAiB0E/Sw0AIAQgB0EEdiAGQQJ0cjoACCABLQAJQWBq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6H6B+yBzg9tHHvMMRAc/HquihSYeQGpq9T9TL3trQONoK1SrDOQNnNpHGfDH5jU8rseC3WZ73Orv1Q/8Z1fKcRdknLCKXvyr85hVx/JEPJRWUm2GT5frrnLbOWWSowtGouhJeB8G2DGoF42VQ0hBCpAPLDm7s4DvbmBa+oJhMZOl4MjKVH5/fktPgKzSg0x7ycYlBdAobjDSjSyBxvsXYMnbDjZ813y4vmZtHbwvmHfHjD1TaTOWR2Noez3lizm9+Ps1msRgWBR0s/cXSj4SZIvv2V/Mj9SN2MqYxNaiTAs3MVmKB8Ky163ValzYWbsxz0oiSYpbe0Em5gRuQUEwUVsZxvcfG5goUejIG0OFFmnvyw/1TqskAD6hi4r8lu/bSvTUFaRJxIgIEsnzPy7YrnHbNwD4RU9PjQBZgvas48K1HJZwgOLp2zkb3xaGvd2BgdSBO/suF2I3oirD5qnp+qvlMXMJIGYyK+wLkasMB+eHr1mn41JCg3lymLSUJP5/mCMIyYU63W+J3zuPfj1fmcsM6iGo/JNMIo4UuihkTRHNwAyI4CaTQMZ8pmPouCIlsTuzmIShFdxPQOM9mVL5sDOk0tymswN1QfMm11YQ/FwlHtdnVFpIb+3mJ",hash:"8bd8822d"};const I="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,o=null!==(Q=I.Buffer)&&void 0!==Q?Q:null,C=I.TextEncoder?new I.TextEncoder:null;function E(A,B){return(15&A)+(A>>6|A>>3&8)<<4|(15&B)+(B>>6|B>>3&8)}const H="a".charCodeAt(0)-10,i="0".charCodeAt(0);function n(A,B,Q){let g=0;for(let I=0;I>>4;A[g++]=Q>9?Q+H:Q+i,Q=15&B[I],A[g++]=Q>9?Q+H:Q+i}return String.fromCharCode.apply(null,A)}const t=null!==o?A=>{if("string"==typeof A){const B=o.from(A,"utf8");return new Uint8Array(B.buffer,B.byteOffset,B.length)}if(o.isBuffer(A))return new Uint8Array(A.buffer,A.byteOffset,A.length);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")}:A=>{if("string"==typeof A)return C.encode(A);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")},a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",w=new Uint8Array(256);for(let A=0;A>4,I+=1,g[I]=(15&o)<<4|C>>2,I+=1,g[I]=(3&C)<<6|63&E,I+=1}return g}const F=16384,e=new class{constructor(){this.mutex=Promise.resolve()}lock(){let A=()=>{};return this.mutex=this.mutex.then((()=>new Promise(A))),new Promise((B=>{A=B}))}dispatch(A){return B(this,void 0,void 0,(function*(){const B=yield this.lock();try{return yield Promise.resolve(A())}finally{B()}}))}},d=new Map;function f(A,Q){return B(this,void 0,void 0,(function*(){let g=null,I=null,o=!1;if("undefined"==typeof WebAssembly)throw new Error("WebAssembly is not supported in this environment!");const C=()=>new DataView(g.exports.memory.buffer).getUint32(g.exports.STATE_SIZE,!0),H=e.dispatch((()=>B(this,void 0,void 0,(function*(){if(!d.has(A.name)){const B=c(A.data),Q=WebAssembly.compile(B);d.set(A.name,Q)}const B=yield d.get(A.name);g=yield WebAssembly.instantiate(B,{})})))),i=(A=null)=>{o=!0,g.exports.Hash_Init(A)},a=A=>{if(!o)throw new Error("update() called before init()");(A=>{let B=0;for(;B{if(!o)throw new Error("digest() called before init()");return o=!1,g.exports.Hash_Final(B),"binary"===A?I.slice(0,Q):n(w,I,Q)},r=A=>"string"==typeof A?A.length<4096:A.byteLength!0;break;case"blake2b":case"blake2s":q=(A,B)=>B<=512&&r(A);break;case"blake3":q=(A,B)=>0===B&&r(A);break;case"xxhash64":case"xxhash3":case"xxhash128":case"crc64":q=()=>!1}return yield(()=>B(this,void 0,void 0,(function*(){g||(yield H);const A=g.exports.Hash_GetBuffer(),B=g.exports.memory.buffer;I=new Uint8Array(B,A,F)})))(),{getMemory:()=>I,writeMemory:(A,B=0)=>{I.set(A,B)},getExports:()=>g.exports,setMemorySize:A=>{g.exports.Hash_SetMemorySize(A);const B=g.exports.Hash_GetBuffer(),Q=g.exports.memory.buffer;I=new Uint8Array(Q,B,A)},init:i,update:a,digest:f,save:()=>{if(!o)throw new Error("save() can only be called after init() and before digest()");const B=g.exports.Hash_GetState(),Q=C(),I=g.exports.memory.buffer,H=new Uint8Array(I,B,Q),i=new Uint8Array(4+Q);return function(A,B){const Q=B.length>>1;for(let g=0;g{if(!(B instanceof Uint8Array))throw new Error("load() expects an Uint8Array generated by save()");const Q=g.exports.Hash_GetState(),I=C(),H=4+I,i=g.exports.memory.buffer;if(B.length!==H)throw new Error(`Bad state length (expected ${H} bytes, got ${B.length})`);if(!function(A,B){if(A.length!==2*B.length)return!1;for(let Q=0;Q{if(!q(A,B))return i(B),a(A),f("hex",o);const C=t(A);return I.set(C),g.exports.Hash_Calculate(C.length,B,o),n(w,I,Q)},hashLength:Q}}))}function r(A){return B(this,void 0,void 0,(function*(){const{costFactor:B,password:Q,salt:I}=A,o=yield f(g,0);o.writeMemory(t(I),0);const C=t(Q);o.writeMemory(C,16);const E="encoded"===A.outputType?1:0;o.getExports().bcrypt(C.length,B,E);const H=o.getMemory();if("encoded"===A.outputType)return i=H,a=60,String.fromCharCode(...i.subarray(0,a));var i,a;if("hex"===A.outputType){return n(new Uint8Array(48),H,24)}return H.slice(0,24)}))}const q=A=>{if(!A||"object"!=typeof A)throw new Error("Invalid options parameter. It requires an object.");if(void 0===A.hash||"string"!=typeof A.hash)throw new Error("Hash should be specified");if(60!==A.hash.length)throw new Error("Hash should be 60 bytes long");if(!(A=>!(!/^\$2[axyb]\$[0-3][0-9]\$[./A-Za-z0-9]{53}$/.test(A)||"0"===A[4]&&Number(A[5])<4||"3"===A[4]&&Number(A[5])>1))(A.hash))throw new Error("Invalid hash");if(A.password=t(A.password),A.password.length<1)throw new Error("Password should be at least 1 byte long");if(A.password.length>72)throw new Error("Password should be at most 72 bytes long")};A.bcrypt=function(A){return B(this,void 0,void 0,(function*(){return(A=>{if(!A||"object"!=typeof A)throw new Error("Invalid options parameter. It requires an object.");if(!Number.isInteger(A.costFactor)||A.costFactor<4||A.costFactor>31)throw new Error("Cost factor should be a number between 4 and 31");if(A.password=t(A.password),A.password.length<1)throw new Error("Password should be at least 1 byte long");if(A.password.length>72)throw new Error("Password should be at most 72 bytes long");if(A.salt=t(A.salt),16!==A.salt.length)throw new Error("Salt should be 16 bytes long");if(void 0===A.outputType&&(A.outputType="encoded"),!["hex","binary","encoded"].includes(A.outputType))throw new Error(`Insupported output type ${A.outputType}. Valid values: ['hex', 'binary', 'encoded']`)})(A),r(A)}))},A.bcryptVerify=function(A){return B(this,void 0,void 0,(function*(){q(A);const{hash:B,password:Q}=A,I=yield f(g,0);I.writeMemory(t(B),0);const o=t(Q);return I.writeMemory(o,60),!!I.getExports().bcrypt_verify(o.length)}))}})); diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/blake2b.umd.min.js b/tools/mnemonic-test/node_modules/hash-wasm/dist/blake2b.umd.min.js deleted file mode 100644 index c3071d85..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/blake2b.umd.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * hash-wasm (https://www.npmjs.com/package/hash-wasm) - * (c) Dani Biro - * @license MIT - */ - -!function(I,A){"object"==typeof exports&&"undefined"!=typeof module?A(exports):"function"==typeof define&&define.amd?define(["exports"],A):A((I="undefined"!=typeof globalThis?globalThis:I||self).hashwasm=I.hashwasm||{})}(this,(function(I){"use strict";var A,i={name:"blake2b",data:"AGFzbQEAAAABEQRgAAF/YAJ/fwBgAX8AYAAAAwoJAAECAwECAgABBQQBAQICBg4CfwFBsIsFC38AQYAICwdwCAZtZW1vcnkCAA5IYXNoX0dldEJ1ZmZlcgAACkhhc2hfRmluYWwAAwlIYXNoX0luaXQABQtIYXNoX1VwZGF0ZQAGDUhhc2hfR2V0U3RhdGUABw5IYXNoX0NhbGN1bGF0ZQAIClNU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ACAAQQFqIQAgBEEBaiIEQf8BcSABSA0ACyACQYABEAELIAJBgAFqJAALEgAgAEEDdkH/P3EgAEEQdhAECwkAQYAJIAAQAQsGAEGAiQELGwAgAUEDdkH/P3EgAUEQdhAEQYAJIAAQARADCwsLAQBBgAgLBPAAAAA=",hash:"c6f286e6"};function C(I,A,i,C){return new(i||(i=Promise))((function(g,h){function e(I){try{w(C.next(I))}catch(I){h(I)}}function B(I){try{w(C.throw(I))}catch(I){h(I)}}function w(I){var A;I.done?g(I.value):(A=I.value,A instanceof i?A:new i((function(I){I(A)}))).then(e,B)}w((C=C.apply(I,A||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class g{constructor(){this.mutex=Promise.resolve()}lock(){let I=()=>{};return this.mutex=this.mutex.then((()=>new Promise(I))),new Promise((A=>{I=A}))}dispatch(I){return C(this,void 0,void 0,(function*(){const A=yield this.lock();try{return yield Promise.resolve(I())}finally{A()}}))}}const h="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,e=null!==(A=h.Buffer)&&void 0!==A?A:null,B=h.TextEncoder?new h.TextEncoder:null;function w(I,A){return(15&I)+(I>>6|I>>3&8)<<4|(15&A)+(A>>6|A>>3&8)}const t="a".charCodeAt(0)-10,F="0".charCodeAt(0);function f(I,A,i){let C=0;for(let g=0;g>>4;I[C++]=i>9?i+t:i+F,i=15&A[g],I[C++]=i>9?i+t:i+F}return String.fromCharCode.apply(null,I)}const Q=null!==e?I=>{if("string"==typeof I){const A=e.from(I,"utf8");return new Uint8Array(A.buffer,A.byteOffset,A.length)}if(e.isBuffer(I))return new Uint8Array(I.buffer,I.byteOffset,I.length);if(ArrayBuffer.isView(I))return new Uint8Array(I.buffer,I.byteOffset,I.byteLength);throw new Error("Invalid data type!")}:I=>{if("string"==typeof I)return B.encode(I);if(ArrayBuffer.isView(I))return new Uint8Array(I.buffer,I.byteOffset,I.byteLength);throw new Error("Invalid data type!")},n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=new Uint8Array(256);for(let I=0;I>4,g+=1,C[g]=(15&h)<<4|e>>2,g+=1,C[g]=(3&e)<<6|63&B,g+=1}return C}const S=16384,U=new g,a=new Map;function J(I,A){return C(this,void 0,void 0,(function*(){let i=null,g=null,h=!1;if("undefined"==typeof WebAssembly)throw new Error("WebAssembly is not supported in this environment!");const e=()=>new DataView(i.exports.memory.buffer).getUint32(i.exports.STATE_SIZE,!0),B=U.dispatch((()=>C(this,void 0,void 0,(function*(){if(!a.has(I.name)){const A=r(I.data),i=WebAssembly.compile(A);a.set(I.name,i)}const A=yield a.get(I.name);i=yield WebAssembly.instantiate(A,{})})))),t=(I=null)=>{h=!0,i.exports.Hash_Init(I)},F=I=>{if(!h)throw new Error("update() called before init()");(I=>{let A=0;for(;A{if(!h)throw new Error("digest() called before init()");return h=!1,i.exports.Hash_Final(C),"binary"===I?g.slice(0,A):f(n,g,A)},J=I=>"string"==typeof I?I.length<4096:I.byteLength!0;break;case"blake2b":case"blake2s":s=(I,A)=>A<=512&&J(I);break;case"blake3":s=(I,A)=>0===A&&J(I);break;case"xxhash64":case"xxhash3":case"xxhash128":case"crc64":s=()=>!1}return yield(()=>C(this,void 0,void 0,(function*(){i||(yield B);const I=i.exports.Hash_GetBuffer(),A=i.exports.memory.buffer;g=new Uint8Array(A,I,S)})))(),{getMemory:()=>g,writeMemory:(I,A=0)=>{g.set(I,A)},getExports:()=>i.exports,setMemorySize:I=>{i.exports.Hash_SetMemorySize(I);const A=i.exports.Hash_GetBuffer(),C=i.exports.memory.buffer;g=new Uint8Array(C,A,I)},init:t,update:F,digest:o,save:()=>{if(!h)throw new Error("save() can only be called after init() and before digest()");const A=i.exports.Hash_GetState(),C=e(),g=i.exports.memory.buffer,B=new Uint8Array(g,A,C),t=new Uint8Array(4+C);return function(I,A){const i=A.length>>1;for(let C=0;C{if(!(A instanceof Uint8Array))throw new Error("load() expects an Uint8Array generated by save()");const C=i.exports.Hash_GetState(),g=e(),B=4+g,t=i.exports.memory.buffer;if(A.length!==B)throw new Error(`Bad state length (expected ${B} bytes, got ${A.length})`);if(!function(I,A){if(I.length!==2*A.length)return!1;for(let i=0;i{if(!s(I,C))return t(C),F(I),o("hex",h);const e=Q(I);return g.set(e),i.exports.Hash_Calculate(e.length,C,h),f(n,g,A)},hashLength:A}}))}const s=new g;let k=null;function V(I){return!Number.isInteger(I)||I<8||I>512||I%8!=0?new Error("Invalid variant! Valid values: 8, 16, ..., 512"):null}function G(I,A){return I|A<<16}I.blake2b=function(I,A=512,g=null){if(V(A))return Promise.reject(V(A));let h=null,e=A;if(null!==g){if(h=Q(g),h.length>64)return Promise.reject(new Error("Max key length is 64 bytes"));e=G(A,h.length)}const B=A/8;if(null===k||k.hashLength!==B)return function(I,A,i){return C(this,void 0,void 0,(function*(){const C=yield I.lock(),g=yield J(A,i);return C(),g}))}(s,i,B).then((A=>(k=A,e>512&&k.writeMemory(h),k.calculate(I,e))));try{e>512&&k.writeMemory(h);const A=k.calculate(I,e);return Promise.resolve(A)}catch(I){return Promise.reject(I)}},I.createBLAKE2b=function(I=512,A=null){if(V(I))return Promise.reject(V(I));let C=null,g=I;if(null!==A){if(C=Q(A),C.length>64)return Promise.reject(new Error("Max key length is 64 bytes"));g=G(I,C.length)}const h=I/8;return J(i,h).then((I=>{g>512&&I.writeMemory(C),I.init(g);const A={init:g>512?()=>(I.writeMemory(C),I.init(g),A):()=>(I.init(g),A),update:i=>(I.update(i),A),digest:A=>I.digest(A),save:()=>I.save(),load:i=>(I.load(i),A),blockSize:128,digestSize:h};return A}))}})); diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/blake2s.umd.min.js b/tools/mnemonic-test/node_modules/hash-wasm/dist/blake2s.umd.min.js deleted file mode 100644 index 6f224b9f..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/blake2s.umd.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * hash-wasm (https://www.npmjs.com/package/hash-wasm) - * (c) Dani Biro - * @license MIT - */ - -!function(I,A){"object"==typeof exports&&"undefined"!=typeof module?A(exports):"function"==typeof define&&define.amd?define(["exports"],A):A((I="undefined"!=typeof globalThis?globalThis:I||self).hashwasm=I.hashwasm||{})}(this,(function(I){"use strict";var A,i={name:"blake2s",data:"AGFzbQEAAAABEQRgAAF/YAJ/fwBgAX8AYAAAAwkIAAECAwICAAEFBAEBAgIGDgJ/AUGgigULfwBBgAgLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAKSGFzaF9GaW5hbAADCUhhc2hfSW5pdAAEC0hhc2hfVXBkYXRlAAUNSGFzaF9HZXRTdGF0ZQAGDkhhc2hfQ2FsY3VsYXRlAAcKU1RBVEVfU0laRQMBCr4yCAUAQYAJC6gFAQZ/AkAgAUEBSA0AAkACQAJAIAFBwABBACgC8IkBIgJrIgNKDQAgASEDDAELQQBBADYC8IkBAkAgAkHAAEYNACACQbCJAWohBAJAAkAgA0EHcSIFDQAgACEGIAMhBwwBCyAFIQcgACEGA0AgBCAGLQAAOgAAIARBAWohBCAGQQFqIQYgB0F/aiIHDQALQcAAIAIgBWprIQcLIAJBR2pBB0kNAANAIAQgBi0AADoAACAEIAYtAAE6AAEgBCAGLQACOgACIAQgBi0AAzoAAyAEIAYtAAQ6AAQgBCAGLQAFOgAFIAQgBi0ABjoABiAEIAYtAAc6AAcgBEEIaiEEIAZBCGohBiAHQXhqIgcNAAsLQQAhBEEAQQAoAqCJASIGQcAAajYCoIkBQQBBACgCpIkBIAZBv39LajYCpIkBQbCJARACIAAgA2ohAAJAIAEgA2siA0HBAEgNACACIAFqIQQDQEEAQQAoAqCJASIGQcAAajYCoIkBQQBBACgCpIkBIAZBv39LajYCpIkBIAAQAiAAQcAAaiEAIAQiBkFAaiIEQYABSw0ACyAGQYB/aiEDQQAoAvCJASECDAELQQAoAvCJASECIANFDQELIANBf2ohASACQbCJAWohBAJAAkAgA0EHcSIGDQAgAyEHDAELIANBeHEhBw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Qauzj/wBczYCmIkBQQAgBEH/AXE2AvSJAUEAQQAoApyKAUGZmoPfBXM2ApyJAQJAIABBgIAESQ0AIAFBOGpCADcDACABQTBqQgA3AwAgAUEoakIANwMAIAFBIGpCADcDACABQRhqQgA3AwAgAUEQakIANwMAIAFCADcDCCABQgA3AwBBACEAA0AgASADaiADQYAJai0AADoAACADQQFqIQMgAiAAQQFqIgBB/wFxSw0ACyABQcAAEAELIAFBwABqJAALCQBBgAkgABABCwYAQYCJAQsPACABEARBgAkgABABEAMLCwsBAEGACAsEfAAAAA==",hash:"5c0ff166"};function B(I,A,i,B){return new(i||(i=Promise))((function(g,o){function e(I){try{t(B.next(I))}catch(I){o(I)}}function c(I){try{t(B.throw(I))}catch(I){o(I)}}function t(I){var A;I.done?g(I.value):(A=I.value,A instanceof i?A:new i((function(I){I(A)}))).then(e,c)}t((B=B.apply(I,A||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class g{constructor(){this.mutex=Promise.resolve()}lock(){let I=()=>{};return this.mutex=this.mutex.then((()=>new Promise(I))),new Promise((A=>{I=A}))}dispatch(I){return B(this,void 0,void 0,(function*(){const A=yield this.lock();try{return yield Promise.resolve(I())}finally{A()}}))}}const o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,e=null!==(A=o.Buffer)&&void 0!==A?A:null,c=o.TextEncoder?new o.TextEncoder:null;function t(I,A){return(15&I)+(I>>6|I>>3&8)<<4|(15&A)+(A>>6|A>>3&8)}const a="a".charCodeAt(0)-10,n="0".charCodeAt(0);function Q(I,A,i){let B=0;for(let g=0;g>>4;I[B++]=i>9?i+a:i+n,i=15&A[g],I[B++]=i>9?i+a:i+n}return String.fromCharCode.apply(null,I)}const h=null!==e?I=>{if("string"==typeof I){const A=e.from(I,"utf8");return new Uint8Array(A.buffer,A.byteOffset,A.length)}if(e.isBuffer(I))return new Uint8Array(I.buffer,I.byteOffset,I.length);if(ArrayBuffer.isView(I))return new Uint8Array(I.buffer,I.byteOffset,I.byteLength);throw new Error("Invalid data type!")}:I=>{if("string"==typeof I)return c.encode(I);if(ArrayBuffer.isView(I))return new Uint8Array(I.buffer,I.byteOffset,I.byteLength);throw new Error("Invalid data type!")},C="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=new Uint8Array(256);for(let I=0;I>4,g+=1,B[g]=(15&o)<<4|e>>2,g+=1,B[g]=(3&e)<<6|63&c,g+=1}return B}const y=16384,H=new g,d=new Map;function l(I,A){return B(this,void 0,void 0,(function*(){let i=null,g=null,o=!1;if("undefined"==typeof WebAssembly)throw new Error("WebAssembly is not supported in this environment!");const e=()=>new DataView(i.exports.memory.buffer).getUint32(i.exports.STATE_SIZE,!0),c=H.dispatch((()=>B(this,void 0,void 0,(function*(){if(!d.has(I.name)){const A=E(I.data),i=WebAssembly.compile(A);d.set(I.name,i)}const A=yield d.get(I.name);i=yield WebAssembly.instantiate(A,{})})))),a=(I=null)=>{o=!0,i.exports.Hash_Init(I)},n=I=>{if(!o)throw new Error("update() called before init()");(I=>{let A=0;for(;A{if(!o)throw new Error("digest() called before init()");return o=!1,i.exports.Hash_Final(B),"binary"===I?g.slice(0,A):Q(C,g,A)},l=I=>"string"==typeof I?I.length<4096:I.byteLength!0;break;case"blake2b":case"blake2s":s=(I,A)=>A<=512&&l(I);break;case"blake3":s=(I,A)=>0===A&&l(I);break;case"xxhash64":case"xxhash3":case"xxhash128":case"crc64":s=()=>!1}return yield(()=>B(this,void 0,void 0,(function*(){i||(yield c);const I=i.exports.Hash_GetBuffer(),A=i.exports.memory.buffer;g=new Uint8Array(A,I,y)})))(),{getMemory:()=>g,writeMemory:(I,A=0)=>{g.set(I,A)},getExports:()=>i.exports,setMemorySize:I=>{i.exports.Hash_SetMemorySize(I);const A=i.exports.Hash_GetBuffer(),B=i.exports.memory.buffer;g=new Uint8Array(B,A,I)},init:a,update:n,digest:r,save:()=>{if(!o)throw new Error("save() can only be called after init() and before digest()");const A=i.exports.Hash_GetState(),B=e(),g=i.exports.memory.buffer,c=new Uint8Array(g,A,B),a=new Uint8Array(4+B);return function(I,A){const i=A.length>>1;for(let B=0;B{if(!(A instanceof Uint8Array))throw new Error("load() expects an Uint8Array generated by save()");const B=i.exports.Hash_GetState(),g=e(),c=4+g,a=i.exports.memory.buffer;if(A.length!==c)throw new Error(`Bad state length (expected ${c} bytes, got ${A.length})`);if(!function(I,A){if(I.length!==2*A.length)return!1;for(let i=0;i{if(!s(I,B))return a(B),n(I),r("hex",o);const e=h(I);return g.set(e),i.exports.Hash_Calculate(e.length,B,o),Q(C,g,A)},hashLength:A}}))}const s=new g;let q=null;function R(I){return!Number.isInteger(I)||I<8||I>256||I%8!=0?new Error("Invalid variant! Valid values: 8, 16, ..., 256"):null}function F(I,A){return I|A<<16}I.blake2s=function(I,A=256,g=null){if(R(A))return Promise.reject(R(A));let o=null,e=A;if(null!==g){if(o=h(g),o.length>32)return Promise.reject(new Error("Max key length is 32 bytes"));e=F(A,o.length)}const c=A/8;if(null===q||q.hashLength!==c)return function(I,A,i){return B(this,void 0,void 0,(function*(){const B=yield I.lock(),g=yield l(A,i);return B(),g}))}(s,i,c).then((A=>(q=A,e>512&&q.writeMemory(o),q.calculate(I,e))));try{e>512&&q.writeMemory(o);const A=q.calculate(I,e);return Promise.resolve(A)}catch(I){return Promise.reject(I)}},I.createBLAKE2s=function(I=256,A=null){if(R(I))return Promise.reject(R(I));let B=null,g=I;if(null!==A){if(B=h(A),B.length>32)return Promise.reject(new Error("Max key length is 32 bytes"));g=F(I,B.length)}const o=I/8;return l(i,o).then((I=>{g>512&&I.writeMemory(B),I.init(g);const A={init:g>512?()=>(I.writeMemory(B),I.init(g),A):()=>(I.init(g),A),update:i=>(I.update(i),A),digest:A=>I.digest(A),save:()=>I.save(),load:i=>(I.load(i),A),blockSize:64,digestSize:o};return A}))}})); diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/blake3.umd.min.js b/tools/mnemonic-test/node_modules/hash-wasm/dist/blake3.umd.min.js deleted file mode 100644 index 5f9edda6..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/blake3.umd.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * hash-wasm (https://www.npmjs.com/package/hash-wasm) - * (c) Dani Biro - * @license MIT - */ - -!function(A,I){"object"==typeof exports&&"undefined"!=typeof module?I(exports):"function"==typeof define&&define.amd?define(["exports"],I):I((A="undefined"!=typeof globalThis?globalThis:A||self).hashwasm=A.hashwasm||{})}(this,(function(A){"use strict";var I,g={name:"blake3",data:"AGFzbQEAAAABMQdgAAF/YAl/f39+f39/f38AYAZ/f39/fn8AYAF/AGADf39/AGABfgBgBX9/fn9/AX8DDg0AAQIDBAUGAwMDAwAEBQQBAQICBg4CfwFBgJgFC38AQYAICwdwCAZtZW1vcnkCAA5IYXNoX0dldEJ1ZmZlcgAACUhhc2hfSW5pdAAIC0hhc2hfVXBkYXRlAAkKSGFzaF9GaW5hbAAKDUhhc2hfR2V0U3RhdGUACw5IYXNoX0NhbGN1bGF0ZQAMClNUQVRFX1NJWkUDAQqQWw0FAEGACQufAwIDfwV+IwBB4ABrIgkkAAJAIAFFDQAgByAFciEKIAdBACACQQFGGyAGciAFciELIARBAEetIQwDQCAAKAIAIQcgCUEAKQOAiQE3AwAgCUEAKQOIiQE3AwggCUEAKQOQiQE3AxAgCUEAKQOYiQE3AxggCUEgaiAJIAdBwAAgAyALEAIgCSAJKQNAIAkpAyCFIg03AwAgCSAJKQNIIAkpAyiFIg43AwggCSAJKQNQIAkpAzCFIg83AxAgCSAJKQNYIAkpAziFIhA3AxggB0HAAGohByACIQQCQANAIAUhBgJAAkAgBEF/aiIEDgIDAAELIAohBgsgCUEgaiAJIAdBwAAgAyAGEAIgCSAJKQNAIAkpAyCFIg03AwAgCSAJKQNIIAkpAyiFIg43AwggCSAJKQNQIAkpAzCFIg83AxAgCSAJKQNYIAkpAziFIhA3AxggB0HAAGohBwwACwsgCCAQNwMYIAggDzc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xIQtBACEFAkAgCUEESQ0AIAAgBmohByAJQfwAcSEIQQAhBQNAIAcgBWoiAkEoaiABIAVqIgotAAA6AAAgAkEpaiAKQQFqLQAAOgAAIAJBKmogCkECai0AADoAACACQStqIApBA2otAAA6AAAgCCAFQQRqIgVHDQALCwJAIAtFDQAgASAFaiEBIAUgBmogAGpBKGohBQNAIAUgAS0AADoAACABQQFqIQEgBUEBaiEFIAtBf2oiCw0ACwsgAC0AaCEHCyAAIAcgCWo6AGggA0HAAGokAAveAwQFfwN+BX8GfiMAQdABayIBJAACQCAAe6ciAkEALQCQigEiA08NAEEALQCKigFBBHIhBCABQShqIQVBACkDmIkBIQBBACkDkIkBIQZBACkDiIkBIQdBACkDgIkBIQggAyEJA0AgASAANwMYIAEgBjcDECABIAc3AwggASAINwMAIAEgA0EFdCIDQdGJAWoiCikDADcDKCABIANB2YkBaiILKQMANwMwIAEgA0HhiQFqIgwpAwA3AzggASADQemJAWoiDSkDADcDQCABIANB8YkBaikDADcDSCABIANB+YkBaikDADcDUCABIANBgYoBaikDADcDWCADQYmKAWopAwAhDiABQcAAOgBoIAEgDjcDYCABQgA3AyAgASAEOgBpIAEgADcDiAEgASAGNwOAASABIAc3A3ggASAINwNwIAFBkAFqIAFB8ABqIAVBwABCACAEQf8BcRACIAEpA7ABIQ4gASkDkAEhDyABKQO4ASEQIAEpA5gBIREgASkDwAEhEiABKQOgASETIA0gASkDyAEgASkDqAGFNwMAIAwgEiAThTcDACALIBAgEYU3AwAgCiAOIA+FNwMAIAlBf2oiCUH/AXEiAyACSw0AC0EAIAk6AJCKAQsgAUHQAWokAAvHCQIKfwV+IwBB4AJrIgUkAAJAAkAgAUGACEsNACAFIAA2AvwBIAVB/AFqIAFBgAhGIgZBECACQQEgA0EBQQIgBBABIAZBCnQiByABTw0BIAVB4ABqIgZCADcDACAFQdgAaiIIQgA3AwAgBUHQAGoiCUIANwMAIAVByABqIgpCADcDACAFQcAAaiILQgA3AwAgBUE4aiIMQgA3AwAgBU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RqIABBwABqNgIAIABBgAJqIQAgAUEQaiEBIAggB0EEaiIHRw0ACwsgCkF+cSEIAkAgDkUNACAFIAdBBnRqIQEgBUGIAWogB0ECdGohAANAIAAgATYCACABQcAAaiEBIABBBGohACAOQX9qIg4NAAsLIAhBAmohAAsgBUGIAWogBkEBQgBBACADQQRyQQBBACAEEAEgACAJTw0AIAQgBkEFdGoiASAFIAZBBnRqIgApAwA3AwAgASAAKQMINwMIIAEgACkDEDcDECABIAApAxg3AxggBkEBaiEGCyAFQeACaiQAIAYLrRAIAn8EfgF/AX4EfwR+BH8EfiMAQfABayIBJAACQCAARQ0AAkBBAC0AkIoBIgINACABQTBqQQApA9CJATcDACABQThqQQApA9iJATcDACABQQApA6CJASIDNwMAIAFBACkDqIkBIgQ3AwggAUEAKQOwiQEiBTcDECABQQApA7iJASIGNwMYIAFBACkDyIkBNwMoQQAtAIqKASECQQAtAImKASEHQQApA8CJASEIQQAtAIiKASEJIAFBwABqQQApA+CJATcDACABQcgAakEAKQPoiQE3AwAgAUHQAGpBACkD8IkBNwMAIAFB2ABqQQApA/iJATcDACABQeAAakEAKQOAigE3AwAgASAJOgBoIAEgCDcDICABIAIgB0VyIgJBAnI6AGkgAUEoaiEKQgAhCEGACSELIAJBCnJB/wFxIQwDQCABQbABaiABIAogCUH/AXEgCCAMEAIgASABKQPQASINIAEpA7ABhTcDcCABIAEpA9gBIg4gASkDuAGFNwN4IAEgASkD4AEiDyABKQPAAYU3A4ABIAEgASkD6AEiECAGhTcDqAEgASAPIAWFNwOgASABIA4gBIU3A5gBIAEgDSADhTcDkAEgASAQIAEpA8gBhTcDiAEgAEHAACAAQcAASRsiEUF/aiESAkACQCARQQdxIhMNACABQfAAaiECIAshByARIRQMAQsgEUH4AHEhFCABQfAAaiECIAshBwNAIAcgAi0AADoAACAHQQFqIQcgAkEBaiECIBNBf2oiEw0ACwsCQCASQQdJDQADQCAHIAIpAAA3AAAgB0EIaiEHIAJBCGohAiAUQXhqIhQNAAsLIAhCAXwhCCALIBFqIQsgACARayIADQAMAgsLAkACQAJAQQAtAImKASIHQQZ0QQBBAC0AiIoBIhFrRg0AIAEgEToAaCABQQApA4CKATcDYCABQQApA/iJATcDWCABQQApA/CJATcDUCABQQApA+iJATcDSCABQQApA+CJATcDQCABQQApA9iJATcDOCABQQApA9CJATcDMCABQQApA8iJATcDKCABQQApA8CJASIINwMgIAFBACkDuIkBIgM3AxggAUEAKQOwiQEiBDcDECABQQApA6iJASIFNwMIIAFBACkDoIkBIgY3AwAgAUEALQCKigEiEyAHRXJBAnIiCzoAaSATQQRyIRNBACkDmIkBIQ1BACkDkIkBIQ5BACkDiIkBIQ9BACkDgIkBIRAMAQtBwAAhESABQcAAOgBoQgAhCCABQgA3AyAgAUEAKQOYiQEiDTcDGCABQQApA5CJASIONwMQIAFBACkDiIkBIg83AwggAUEAKQOAiQEiEDcDACABQQAtAIqKAUEEciITOgBpIAEgAkF+aiICQQV0IgdByYoBaikDADcDYCABIAdBwYoBaikDADcDWCABIAdBuYoBaikDADcDUCABIAdBsYoBaikDADcDSCABIAdBqYoBaikDADcDQCABIAdBoYoBaikDADcDOCABIAdBmYoBaikDADcDMCABIAdBkYoBaikDADcDKCATIQsgECEGIA8hBSAOIQQgDSEDIAJFDQELIAJBf2oiB0EFdCIUQZGKAWopAwAhFSAUQZmKAWopAwAhFiAUQaGKAWopAwAhFyAUQamKAWopAwAhGCABIAM3A4gBIAEgBDcDgAEgASAFNwN4IAEgBjcDcCABQbABaiABQfAAaiABQShqIhQgESAIIAtB/wFxEAIgASATOgBpIAFBwAA6AGggASAYNwNAIAEgFzcDOCABIBY3AzAgASAVNwMoIAFCADcDICABIA03AxggASAONwMQIAEgDzcDCCABIBA3AwAgASABKQPoASABKQPIAYU3A2AgASABKQPgASABKQPAAYU3A1ggASABKQPYASABKQO4AYU3A1AgASABKQPQASABKQOwAYU3A0ggB0UNACACQQV0QemJAWohAiATQf8BcSERA0AgAkFoaikDACEIIAJBcGopAwAhAyACQXhqKQMAIQQgAikDACEFIAEgDTcDiAEgASAONwOAASABIA83A3ggASAQNwNwIAFBsAFqIAFB8ABqIBRBwABCACAREAIgASATOgBpIAFBwAA6AGggASAFNwNAIAEgBDcDOCABIAM3AzAgASAINwMoIAFCADcDICABIA03AxggASAONwMQIAEgDzcDCCABIBA3AwAgASABKQPoASABKQPIAYU3A2AgASABKQPgASABKQPAAYU3A1ggASABKQPYASABKQO4AYU3A1AgASABKQPQASABKQOwAYU3A0ggAkFgaiECIAdBf2oiBw0ACwsgAUEoaiEJQgAhCEGACSELIBNBCHJB/wFxIQoDQCABQbABaiABIAlBwAAgCCAKEAIgASABKQPQASIDIAEpA7ABhTcDcCABIAEpA9gBIgQgASkDuAGFNwN4IAEgASkD4AEiBSABKQPAAYU3A4ABIAEgDSABKQPoASIGhTcDqAEgASAOIAWFNwOgASABIA8gBIU3A5gBIAEgECADhTcDkAEgASAGIAEpA8gBhTcDiAEgAEHAACAAQcAASRsiEUF/aiESAkACQCARQQdxIhMNACABQfAAaiECIAshByARIRQMAQsgEUH4AHEhFCABQfAAaiECIAshBwNAIAcgAi0AADoAACAHQQFqIQcgAkEBaiECIBNBf2oiEw0ACwsCQCASQQdJDQADQCAHIAIpAAA3AAAgB0EIaiEHIAJBCGohAiAUQXhqIhQNAAsLIAhCAXwhCCALIBFqIQsgACARayIADQALCyABQfABaiQAC6MCAQR+AkACQCAAQSBGDQBCq7OP/JGjs/DbACEBQv+kuYjFkdqCm38hAkLy5rvjo6f9p6V/IQNC58yn0NbQ67O7fyEEQQAhAAwBC0EAKQOYCSEBQQApA5AJIQJBACkDiAkhA0EAKQOACSEEQRAhAAtBACAAOgCKigFBAEIANwOAigFBAEIANwP4iQFBAEIANwPwiQFBAEIANwPoiQFBAEIANwPgiQFBAEIANwPYiQFBAEIANwPQiQFBAEIANwPIiQFBAEIANwPAiQFBACABNwO4iQFBACACNwOwiQFBACADNwOoiQFBACAENwOgiQFBACABNwOYiQFBACACNwOQiQFBACADNwOIiQFBACAENwOAiQFBAEEAOgCQigFBAEEAOwGIigELBgAgABADCwYAIAAQBwsGAEGAiQELqwIBBH4CQAJAIAFBIEYNAEKrs4/8kaOz8NsAIQNC/6S5iMWR2oKbfyEEQvLmu+Ojp/2npX8hBULnzKfQ1tDrs7t/IQZBACEBDAELQQApA5gJIQNBACkDkAkhBEEAKQOICSEFQQApA4AJIQZBECEBC0EAIAE6AIqKAUEAQgA3A4CKAUEAQgA3A/iJAUEAQgA3A/CJAUEAQgA3A+iJAUEAQgA3A+CJAUEAQgA3A9iJAUEAQgA3A9CJAUEAQgA3A8iJAUEAQgA3A8CJAUEAIAM3A7iJAUEAIAQ3A7CJAUEAIAU3A6iJAUEAIAY3A6CJAUEAIAM3A5iJAUEAIAQ3A5CJAUEAIAU3A4iJAUEAIAY3A4CJAUEAQQA6AJCKAUEAQQA7AYiKASAAEAMgAhAHCwsLAQBBgAgLBHgHAAA=",hash:"215d875f"};function i(A,I,g,i){return new(g||(g=Promise))((function(B,Q){function C(A){try{o(i.next(A))}catch(A){Q(A)}}function E(A){try{o(i.throw(A))}catch(A){Q(A)}}function o(A){var I;A.done?B(A.value):(I=A.value,I instanceof g?I:new g((function(A){A(I)}))).then(C,E)}o((i=i.apply(A,I||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class B{constructor(){this.mutex=Promise.resolve()}lock(){let A=()=>{};return this.mutex=this.mutex.then((()=>new Promise(A))),new Promise((I=>{A=I}))}dispatch(A){return i(this,void 0,void 0,(function*(){const I=yield this.lock();try{return yield Promise.resolve(A())}finally{I()}}))}}const Q="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,C=null!==(I=Q.Buffer)&&void 0!==I?I:null,E=Q.TextEncoder?new Q.TextEncoder:null;function o(A,I){return(15&A)+(A>>6|A>>3&8)<<4|(15&I)+(I>>6|I>>3&8)}const c="a".charCodeAt(0)-10,e="0".charCodeAt(0);function a(A,I,g){let i=0;for(let B=0;B>>4;A[i++]=g>9?g+c:g+e,g=15&I[B],A[i++]=g>9?g+c:g+e}return String.fromCharCode.apply(null,A)}const t=null!==C?A=>{if("string"==typeof A){const I=C.from(A,"utf8");return new Uint8Array(I.buffer,I.byteOffset,I.length)}if(C.isBuffer(A))return new Uint8Array(A.buffer,A.byteOffset,A.length);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")}:A=>{if("string"==typeof A)return E.encode(A);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")},D="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=new Uint8Array(256);for(let A=0;A>4,B+=1,i[B]=(15&Q)<<4|C>>2,B+=1,i[B]=(3&C)<<6|63&E,B+=1}return i}const w=16384,r=new B,y=new Map;function k(A,I){return i(this,void 0,void 0,(function*(){let g=null,B=null,Q=!1;if("undefined"==typeof WebAssembly)throw new Error("WebAssembly is not supported in this environment!");const C=()=>new DataView(g.exports.memory.buffer).getUint32(g.exports.STATE_SIZE,!0),E=r.dispatch((()=>i(this,void 0,void 0,(function*(){if(!y.has(A.name)){const I=h(A.data),g=WebAssembly.compile(I);y.set(A.name,g)}const I=yield y.get(A.name);g=yield WebAssembly.instantiate(I,{})})))),c=(A=null)=>{Q=!0,g.exports.Hash_Init(A)},e=A=>{if(!Q)throw new Error("update() called before init()");(A=>{let I=0;for(;I{if(!Q)throw new Error("digest() called before init()");return Q=!1,g.exports.Hash_Final(i),"binary"===A?B.slice(0,I):a(D,B,I)},k=A=>"string"==typeof A?A.length<4096:A.byteLength!0;break;case"blake2b":case"blake2s":N=(A,I)=>I<=512&&k(A);break;case"blake3":N=(A,I)=>0===I&&k(A);break;case"xxhash64":case"xxhash3":case"xxhash128":case"crc64":N=()=>!1}return yield(()=>i(this,void 0,void 0,(function*(){g||(yield E);const A=g.exports.Hash_GetBuffer(),I=g.exports.memory.buffer;B=new Uint8Array(I,A,w)})))(),{getMemory:()=>B,writeMemory:(A,I=0)=>{B.set(A,I)},getExports:()=>g.exports,setMemorySize:A=>{g.exports.Hash_SetMemorySize(A);const I=g.exports.Hash_GetBuffer(),i=g.exports.memory.buffer;B=new Uint8Array(i,I,A)},init:c,update:e,digest:n,save:()=>{if(!Q)throw new Error("save() can only be called after init() and before digest()");const I=g.exports.Hash_GetState(),i=C(),B=g.exports.memory.buffer,E=new Uint8Array(B,I,i),c=new Uint8Array(4+i);return function(A,I){const g=I.length>>1;for(let i=0;i{if(!(I instanceof Uint8Array))throw new Error("load() expects an Uint8Array generated by save()");const i=g.exports.Hash_GetState(),B=C(),E=4+B,c=g.exports.memory.buffer;if(I.length!==E)throw new Error(`Bad state length (expected ${E} bytes, got ${I.length})`);if(!function(A,I){if(A.length!==2*I.length)return!1;for(let g=0;g{if(!N(A,i))return c(i),e(A),n("hex",Q);const C=t(A);return B.set(C),g.exports.Hash_Calculate(C.length,i,Q),a(D,B,I)},hashLength:I}}))}const N=new B;let S=null;function s(A){return!Number.isInteger(A)||A<8||A%8!=0?new Error("Invalid variant! Valid values: 8, 16, ..."):null}A.blake3=function(A,I=256,B=null){if(s(I))return Promise.reject(s(I));let Q=null,C=0;if(null!==B){if(Q=t(B),32!==Q.length)return Promise.reject(new Error("Key length must be exactly 32 bytes"));C=32}const E=I/8,o=E;if(null===S||S.hashLength!==E)return function(A,I,g){return i(this,void 0,void 0,(function*(){const i=yield A.lock(),B=yield k(I,g);return i(),B}))}(N,g,E).then((I=>(S=I,32===C&&S.writeMemory(Q),S.calculate(A,C,o))));try{32===C&&S.writeMemory(Q);const I=S.calculate(A,C,o);return Promise.resolve(I)}catch(A){return Promise.reject(A)}},A.createBLAKE3=function(A=256,I=null){if(s(A))return Promise.reject(s(A));let i=null,B=0;if(null!==I){if(i=t(I),32!==i.length)return Promise.reject(new Error("Key length must be exactly 32 bytes"));B=32}const Q=A/8,C=Q;return k(g,Q).then((A=>{32===B&&A.writeMemory(i),A.init(B);const I={init:32===B?()=>(A.writeMemory(i),A.init(B),I):()=>(A.init(B),I),update:g=>(A.update(g),I),digest:I=>A.digest(I,C),save:()=>A.save(),load:g=>(A.load(g),I),blockSize:64,digestSize:Q};return I}))}})); diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/crc32.umd.min.js b/tools/mnemonic-test/node_modules/hash-wasm/dist/crc32.umd.min.js deleted file mode 100644 index 15c362dd..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/crc32.umd.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * hash-wasm (https://www.npmjs.com/package/hash-wasm) - * (c) Dani Biro - * @license MIT - */ - -!function(e,A){"object"==typeof exports&&"undefined"!=typeof module?A(exports):"function"==typeof define&&define.amd?define(["exports"],A):A((e="undefined"!=typeof globalThis?globalThis:e||self).hashwasm=e.hashwasm||{})}(this,(function(e){"use strict";var A,t={name:"crc32",data:"AGFzbQEAAAABEQRgAAF/YAF/AGAAAGACf38AAwgHAAEBAQIAAwUEAQECAgYOAn8BQZDJBQt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQAAgtIYXNoX1VwZGF0ZQADCkhhc2hfRmluYWwABA1IYXNoX0dldFN0YXRlAAUOSGFzaF9DYWxjdWxhdGUABgpTVEFURV9TSVpFAwEKkggHBQBBgAkLwwMBA39BgIkBIQFBACECA0AgAUEAQQBBAEEAQQBBAEEAQQAgAkEBcWsgAHEgAkEBdnMiA0EBcWsgAHEgA0EBdnMiA0EBcWsgAHEgA0EBdnMiA0EBcWsgAHEgA0EBdnMiA0EBcWsgAHEgA0EBdnMiA0EBcWsgAHEgA0EBdnMiA0EBcWsgAHEgA0EBdnMiA0EBcWsgAHEgA0EBdnM2AgAgAUEEaiEBIAJBAWoiAkGAAkcNAAtBACEAA0AgAEGEkQFqIABBhIkBaigCACICQf8BcUECdEGAiQFqKAIAIAJBCHZzIgI2AgAgAEGEmQFqIAJB/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e,A,t,n){return new(t||(t=Promise))((function(r,o){function i(e){try{a(n.next(e))}catch(e){o(e)}}function s(e){try{a(n.throw(e))}catch(e){o(e)}}function a(e){var A;e.done?r(e.value):(A=e.value,A instanceof t?A:new t((function(e){e(A)}))).then(i,s)}a((n=n.apply(e,A||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class r{constructor(){this.mutex=Promise.resolve()}lock(){let e=()=>{};return this.mutex=this.mutex.then((()=>new Promise(e))),new Promise((A=>{e=A}))}dispatch(e){return n(this,void 0,void 0,(function*(){const A=yield this.lock();try{return yield Promise.resolve(e())}finally{A()}}))}}const o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,i=null!==(A=o.Buffer)&&void 0!==A?A:null,s=o.TextEncoder?new o.TextEncoder:null;function a(e,A){return(15&e)+(e>>6|e>>3&8)<<4|(15&A)+(A>>6|A>>3&8)}const c="a".charCodeAt(0)-10,l="0".charCodeAt(0);function g(e,A,t){let n=0;for(let r=0;r>>4;e[n++]=t>9?t+c:t+l,t=15&A[r],e[n++]=t>9?t+c:t+l}return String.fromCharCode.apply(null,e)}const f=null!==i?e=>{if("string"==typeof e){const A=i.from(e,"utf8");return new Uint8Array(A.buffer,A.byteOffset,A.length)}if(i.isBuffer(e))return new Uint8Array(e.buffer,e.byteOffset,e.length);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Invalid data type!")}:e=>{if("string"==typeof e)return s.encode(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Invalid data type!")},B="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=new Uint8Array(256);for(let e=0;e>4,r+=1,n[r]=(15&o)<<4|i>>2,r+=1,n[r]=(3&i)<<6|63&s,r+=1}return n}const d=16384,E=new r,Q=new Map;function y(e,A){return n(this,void 0,void 0,(function*(){let t=null,r=null,o=!1;if("undefined"==typeof WebAssembly)throw new Error("WebAssembly is not supported in this environment!");const i=()=>new DataView(t.exports.memory.buffer).getUint32(t.exports.STATE_SIZE,!0),s=E.dispatch((()=>n(this,void 0,void 0,(function*(){if(!Q.has(e.name)){const A=u(e.data),t=WebAssembly.compile(A);Q.set(e.name,t)}const A=yield Q.get(e.name);t=yield WebAssembly.instantiate(A,{})})))),c=(e=null)=>{o=!0,t.exports.Hash_Init(e)},l=e=>{if(!o)throw new Error("update() called before init()");(e=>{let A=0;for(;A{if(!o)throw new Error("digest() called before init()");return o=!1,t.exports.Hash_Final(n),"binary"===e?r.slice(0,A):g(B,r,A)},y=e=>"string"==typeof e?e.length<4096:e.byteLength!0;break;case"blake2b":case"blake2s":C=(e,A)=>A<=512&&y(e);break;case"blake3":C=(e,A)=>0===A&&y(e);break;case"xxhash64":case"xxhash3":case"xxhash128":case"crc64":C=()=>!1}return yield(()=>n(this,void 0,void 0,(function*(){t||(yield s);const e=t.exports.Hash_GetBuffer(),A=t.exports.memory.buffer;r=new Uint8Array(A,e,d)})))(),{getMemory:()=>r,writeMemory:(e,A=0)=>{r.set(e,A)},getExports:()=>t.exports,setMemorySize:e=>{t.exports.Hash_SetMemorySize(e);const A=t.exports.Hash_GetBuffer(),n=t.exports.memory.buffer;r=new Uint8Array(n,A,e)},init:c,update:l,digest:h,save:()=>{if(!o)throw new Error("save() can only be called after init() and before digest()");const A=t.exports.Hash_GetState(),n=i(),r=t.exports.memory.buffer,s=new Uint8Array(r,A,n),c=new Uint8Array(4+n);return function(e,A){const t=A.length>>1;for(let n=0;n{if(!(A instanceof Uint8Array))throw new Error("load() expects an Uint8Array generated by save()");const n=t.exports.Hash_GetState(),r=i(),s=4+r,c=t.exports.memory.buffer;if(A.length!==s)throw new Error(`Bad state length (expected ${s} bytes, got ${A.length})`);if(!function(e,A){if(e.length!==2*A.length)return!1;for(let t=0;t{if(!C(e,n))return c(n),l(e),h("hex",o);const i=f(e);return r.set(i),t.exports.Hash_Calculate(i.length,n,o),g(B,r,A)},hashLength:A}}))}const C=new r;let I=null;function w(e){return!Number.isInteger(e)||e<0||e>4294967295?new Error("Polynomial must be a valid 32-bit long unsigned integer"):null}e.crc32=function(e,A=3988292384){if(w(A))return Promise.reject(w(A));if(null===I)return function(e,A,t){return n(this,void 0,void 0,(function*(){const n=yield e.lock(),r=yield y(A,t);return n(),r}))}(C,t,4).then((t=>(I=t,I.calculate(e,A))));try{const t=I.calculate(e,A);return Promise.resolve(t)}catch(e){return Promise.reject(e)}},e.createCRC32=function(e=3988292384){return w(e)?Promise.reject(w(e)):y(t,4).then((A=>{A.init(e);const t={init:()=>(A.init(e),t),update:e=>(A.update(e),t),digest:e=>A.digest(e),save:()=>A.save(),load:e=>(A.load(e),t),blockSize:4,digestSize:4};return t}))}})); diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/crc64.umd.min.js b/tools/mnemonic-test/node_modules/hash-wasm/dist/crc64.umd.min.js deleted file mode 100644 index b8821a5c..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/crc64.umd.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * hash-wasm (https://www.npmjs.com/package/hash-wasm) - * (c) Dani Biro - * @license MIT - */ - -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).hashwasm=e.hashwasm||{})}(this,(function(e){"use strict";var t,A={name:"crc64",data:"AGFzbQEAAAABDANgAAF/YAAAYAF/AAMHBgABAgEAAQUEAQECAgYOAn8BQZCJBgt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQAAQtIYXNoX1VwZGF0ZQACCkhhc2hfRmluYWwAAw1IYXNoX0dldFN0YXRlAAQOSGFzaF9DYWxjdWxhdGUABQpTVEFURV9TSVpFAwEKgwgGBQBBgAkL9QMDAX4BfwJ+AkBBACkDgIkCQQApA4AJIgBRD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AJBAWoxAACFp0EDdEGAiQFqKQMAIAFCCIiFIQEgAkECaiECIANBfmoiAw0ACwtBACABQn+FNwOIiQILZAEBfkEAQQApA4iJAiIAQjiGIABCgP4Dg0IohoQgAEKAgPwHg0IYhiAAQoCAgPgPg0IIhoSEIABCCIhCgICA+A+DIABCGIhCgID8B4OEIABCKIhCgP4DgyAAQjiIhISENwOACQsGAEGIiQILAgALCwsBAEGACAsECAAAAA==",hash:"c5ac6c16"};function r(e,t,A,r){return new(A||(A=Promise))((function(n,i){function o(e){try{a(r.next(e))}catch(e){i(e)}}function s(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?n(e.value):(t=e.value,t instanceof A?t:new A((function(e){e(t)}))).then(o,s)}a((r=r.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class n{constructor(){this.mutex=Promise.resolve()}lock(){let e=()=>{};return this.mutex=this.mutex.then((()=>new Promise(e))),new Promise((t=>{e=t}))}dispatch(e){return r(this,void 0,void 0,(function*(){const t=yield this.lock();try{return yield Promise.resolve(e())}finally{t()}}))}}const i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,o=null!==(t=i.Buffer)&&void 0!==t?t:null,s=i.TextEncoder?new i.TextEncoder:null;function a(e,t){return(15&e)+(e>>6|e>>3&8)<<4|(15&t)+(t>>6|t>>3&8)}const l="a".charCodeAt(0)-10,c="0".charCodeAt(0);function f(e,t,A){let r=0;for(let n=0;n>>4;e[r++]=A>9?A+l:A+c,A=15&t[n],e[r++]=A>9?A+l:A+c}return String.fromCharCode.apply(null,e)}const h=null!==o?e=>{if("string"==typeof e){const t=o.from(e,"utf8");return new Uint8Array(t.buffer,t.byteOffset,t.length)}if(o.isBuffer(e))return new Uint8Array(e.buffer,e.byteOffset,e.length);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Invalid data type!")}:e=>{if("string"==typeof e)return s.encode(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Invalid data type!")},g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",I=new Uint8Array(256);for(let e=0;e>4,n+=1,r[n]=(15&i)<<4|o>>2,n+=1,r[n]=(3&o)<<6|63&s,n+=1}return r}const B=16384,d=new n,C=new Map;function w(e,t){return r(this,void 0,void 0,(function*(){let A=null,n=null,i=!1;if("undefined"==typeof WebAssembly)throw new Error("WebAssembly is not supported in this environment!");const o=()=>new DataView(A.exports.memory.buffer).getUint32(A.exports.STATE_SIZE,!0),s=d.dispatch((()=>r(this,void 0,void 0,(function*(){if(!C.has(e.name)){const t=u(e.data),A=WebAssembly.compile(t);C.set(e.name,A)}const t=yield C.get(e.name);A=yield WebAssembly.instantiate(t,{})})))),l=(e=null)=>{i=!0,A.exports.Hash_Init(e)},c=e=>{if(!i)throw new Error("update() called before init()");(e=>{let t=0;for(;t{if(!i)throw new Error("digest() called before init()");return i=!1,A.exports.Hash_Final(r),"binary"===e?n.slice(0,t):f(g,n,t)},w=e=>"string"==typeof e?e.length<4096:e.byteLength!0;break;case"blake2b":case"blake2s":Q=(e,t)=>t<=512&&w(e);break;case"blake3":Q=(e,t)=>0===t&&w(e);break;case"xxhash64":case"xxhash3":case"xxhash128":case"crc64":Q=()=>!1}return yield(()=>r(this,void 0,void 0,(function*(){A||(yield s);const e=A.exports.Hash_GetBuffer(),t=A.exports.memory.buffer;n=new Uint8Array(t,e,B)})))(),{getMemory:()=>n,writeMemory:(e,t=0)=>{n.set(e,t)},getExports:()=>A.exports,setMemorySize:e=>{A.exports.Hash_SetMemorySize(e);const t=A.exports.Hash_GetBuffer(),r=A.exports.memory.buffer;n=new Uint8Array(r,t,e)},init:l,update:c,digest:I,save:()=>{if(!i)throw new Error("save() can only be called after init() and before digest()");const t=A.exports.Hash_GetState(),r=o(),n=A.exports.memory.buffer,s=new Uint8Array(n,t,r),l=new Uint8Array(4+r);return function(e,t){const A=t.length>>1;for(let r=0;r{if(!(t instanceof Uint8Array))throw new Error("load() expects an Uint8Array generated by save()");const r=A.exports.Hash_GetState(),n=o(),s=4+n,l=A.exports.memory.buffer;if(t.length!==s)throw new Error(`Bad state length (expected ${s} bytes, got ${t.length})`);if(!function(e,t){if(e.length!==2*t.length)return!1;for(let A=0;A{if(!Q(e,r))return l(r),c(e),I("hex",i);const o=h(e);return n.set(o),A.exports.Hash_Calculate(o.length,r,i),f(g,n,t)},hashLength:t}}))}const Q=new n;let y=null;const p=new Uint8Array(8);function b(e){const t="Polynomial must be provided as a 16 char long hex string";if("string"!=typeof e||16!==e.length)return{hi:0,lo:0,err:new Error(t)};const A=Number(`0x${e.slice(0,8)}`),r=Number(`0x${e.slice(8)}`);return Number.isNaN(A)||Number.isNaN(r)?{hi:A,lo:r,err:new Error(t)}:{hi:A,lo:r,err:null}}function m(e,t,A){const r=new DataView(e);r.setUint32(0,t,!0),r.setUint32(4,A,!0)}e.crc64=function(e,t="c96c5795d7870f42"){const{hi:n,lo:i,err:o}=b(t);if(null!==o)return Promise.reject(o);if(null===y)return function(e,t,A){return r(this,void 0,void 0,(function*(){const r=yield e.lock(),n=yield w(t,A);return r(),n}))}(Q,A,8).then((t=>(y=t,m(p.buffer,i,n),y.writeMemory(p),y.calculate(e))));try{m(p.buffer,i,n),y.writeMemory(p);const t=y.calculate(e);return Promise.resolve(t)}catch(o){return Promise.reject(o)}},e.createCRC64=function(e="c96c5795d7870f42"){const{hi:t,lo:r,err:n}=b(e);return null!==n?Promise.reject(n):w(A,8).then((e=>{const A=new Uint8Array(8);m(A.buffer,r,t),e.writeMemory(A),e.init();const n={init:()=>(e.writeMemory(A),e.init(),n),update:t=>(e.update(t),n),digest:t=>e.digest(t),save:()=>e.save(),load:t=>(e.load(t),n),blockSize:8,digestSize:8};return n}))}})); diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/hmac.umd.min.js b/tools/mnemonic-test/node_modules/hash-wasm/dist/hmac.umd.min.js deleted file mode 100644 index 4df38bb5..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/hmac.umd.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * hash-wasm (https://www.npmjs.com/package/hash-wasm) - * (c) Dani Biro - * @license MIT - */ - -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).hashwasm=e.hashwasm||{})}(this,(function(e){"use strict";var t;const n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,r=null!==(t=n.Buffer)&&void 0!==t?t:null,i=n.TextEncoder?new n.TextEncoder:null,f=null!==r?e=>{if("string"==typeof e){const t=r.from(e,"utf8");return new Uint8Array(t.buffer,t.byteOffset,t.length)}if(r.isBuffer(e))return new Uint8Array(e.buffer,e.byteOffset,e.length);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Invalid data type!")}:e=>{if("string"==typeof e)return i.encode(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Invalid data type!")},o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=new Uint8Array(256);for(let e=0;en){e.update(r);const t=e.digest("binary");return e.init(),t}return new Uint8Array(r.buffer,r.byteOffset,r.length)}(e,t),i=new Uint8Array(n);i.set(r);const o=new Uint8Array(n);for(let e=0;e(e.init(),e.update(i),s),update:t=>(e.update(t),s),digest:t=>{const n=e.digest("binary");return e.init(),e.update(o),e.update(n),e.digest(t)},save:()=>{throw new Error("save() not supported")},load:()=>{throw new Error("load() not supported")},blockSize:e.blockSize,digestSize:e.digestSize};return s}e.createHMAC=function(e,t){if(!e||!e.then)throw new Error('Invalid hash function is provided! Usage: createHMAC(createMD5(), "key").');return e.then((e=>a(e,t)))}})); diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/index.esm.js b/tools/mnemonic-test/node_modules/hash-wasm/dist/index.esm.js deleted file mode 100644 index 69c6925e..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/index.esm.js +++ /dev/null @@ -1,2671 +0,0 @@ -/*! - * hash-wasm (https://www.npmjs.com/package/hash-wasm) - * (c) Dani Biro - * @license MIT - */ - -var name$l = "adler32"; -var data$l = "AGFzbQEAAAABDANgAAF/YAAAYAF/AAMHBgABAgEAAgUEAQECAgYOAn8BQYCJBQt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQAAQtIYXNoX1VwZGF0ZQACCkhhc2hfRmluYWwAAw1IYXNoX0dldFN0YXRlAAQOSGFzaF9DYWxjdWxhdGUABQpTVEFURV9TSVpFAwEK6wkGBQBBgAkLCgBBAEEBNgKECAvjCAEHf0EAKAKECCIBQf//A3EhAiABQRB2IQMCQAJAIABBAUcNACACQQAtAIAJaiIBQY+AfGogASABQfD/A0sbIgEgA2oiBEEQdCIFQYCAPGogBSAEQfD/A0sbIAFyIQEMAQsCQAJAAkACQAJAIABBEEkNAEGACSEGIABBsCtJDQFBgAkhBgNAQQAhBQNAIAYgBWoiASgCACIEQf8BcSACaiICIANqIAIgBEEIdkH/AXFqIgJqIAIgBEEQdkH/AXFqIgJqIAIgBEEYdmoiAmogAiABQQRqKAIAIgRB/wFxaiICaiACIARBCHZB/wFxaiICaiACIARBEHZB/wFxaiICaiACIARBGHZqIgJqIAIgAUEIaigCACIEQf8BcWoiAmogAiAEQQh2Qf8BcWoiAmogAiAEQRB2Qf8BcWoiAmogAiAEQRh2aiIEaiAEIAFBDGooAgAiAUH/AXFqIgRqIAQgAUEIdkH/AXFqIgRqIAQgAUEQdkH/AXFqIgRqIAQgAUEYdmoiAmohAyAFQRBqIgVBsCtHDQALIANB8f8DcCEDIAJB8f8DcCECIAZBsCtqIQYgAEHQVGoiAEGvK0sNAAsgAEUNBCA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; -var hash$l = "02ddbd17"; -var wasmJson$l = { - name: name$l, - data: data$l, - hash: hash$l -}; - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global Reflect, Promise, SuppressedError, Symbol, Iterator */ - - -function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} - -typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; -}; - -class Mutex { - constructor() { - this.mutex = Promise.resolve(); - } - lock() { - let begin = () => { }; - this.mutex = this.mutex.then(() => new Promise(begin)); - return new Promise((res) => { - begin = res; - }); - } - dispatch(fn) { - return __awaiter(this, void 0, void 0, function* () { - const unlock = yield this.lock(); - try { - return yield Promise.resolve(fn()); - } - finally { - unlock(); - } - }); - } -} - -var _a; -function getGlobal() { - if (typeof globalThis !== "undefined") - return globalThis; - if (typeof self !== "undefined") - return self; - if (typeof window !== "undefined") - return window; - return global; -} -const globalObject = getGlobal(); -const nodeBuffer = (_a = globalObject.Buffer) !== null && _a !== void 0 ? _a : null; -const textEncoder = globalObject.TextEncoder - ? new globalObject.TextEncoder() - : null; -function intArrayToString(arr, len) { - return String.fromCharCode(...arr.subarray(0, len)); -} -function hexCharCodesToInt(a, b) { - return ((((a & 0xf) + ((a >> 6) | ((a >> 3) & 0x8))) << 4) | - ((b & 0xf) + ((b >> 6) | ((b >> 3) & 0x8)))); -} -function writeHexToUInt8(buf, str) { - const size = str.length >> 1; - for (let i = 0; i < size; i++) { - const index = i << 1; - buf[i] = hexCharCodesToInt(str.charCodeAt(index), str.charCodeAt(index + 1)); - } -} -function hexStringEqualsUInt8(str, buf) { - if (str.length !== buf.length * 2) { - return false; - } - for (let i = 0; i < buf.length; i++) { - const strIndex = i << 1; - if (buf[i] !== - hexCharCodesToInt(str.charCodeAt(strIndex), str.charCodeAt(strIndex + 1))) { - return false; - } - } - return true; -} -const alpha = "a".charCodeAt(0) - 10; -const digit = "0".charCodeAt(0); -function getDigestHex(tmpBuffer, input, hashLength) { - let p = 0; - for (let i = 0; i < hashLength; i++) { - let nibble = input[i] >>> 4; - tmpBuffer[p++] = nibble > 9 ? nibble + alpha : nibble + digit; - nibble = input[i] & 0xf; - tmpBuffer[p++] = nibble > 9 ? nibble + alpha : nibble + digit; - } - return String.fromCharCode.apply(null, tmpBuffer); -} -const getUInt8Buffer = nodeBuffer !== null - ? (data) => { - if (typeof data === "string") { - const buf = nodeBuffer.from(data, "utf8"); - return new Uint8Array(buf.buffer, buf.byteOffset, buf.length); - } - if (nodeBuffer.isBuffer(data)) { - return new Uint8Array(data.buffer, data.byteOffset, data.length); - } - if (ArrayBuffer.isView(data)) { - return new Uint8Array(data.buffer, data.byteOffset, data.byteLength); - } - throw new Error("Invalid data type!"); - } - : (data) => { - if (typeof data === "string") { - return textEncoder.encode(data); - } - if (ArrayBuffer.isView(data)) { - return new Uint8Array(data.buffer, data.byteOffset, data.byteLength); - } - throw new Error("Invalid data type!"); - }; -const base64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; -const base64Lookup = new Uint8Array(256); -for (let i = 0; i < base64Chars.length; i++) { - base64Lookup[base64Chars.charCodeAt(i)] = i; -} -function encodeBase64(data, pad = true) { - const len = data.length; - const extraBytes = len % 3; - const parts = []; - const len2 = len - extraBytes; - for (let i = 0; i < len2; i += 3) { - const tmp = ((data[i] << 16) & 0xff0000) + - ((data[i + 1] << 8) & 0xff00) + - (data[i + 2] & 0xff); - const triplet = base64Chars.charAt((tmp >> 18) & 0x3f) + - base64Chars.charAt((tmp >> 12) & 0x3f) + - base64Chars.charAt((tmp >> 6) & 0x3f) + - base64Chars.charAt(tmp & 0x3f); - parts.push(triplet); - } - if (extraBytes === 1) { - const tmp = data[len - 1]; - const a = base64Chars.charAt(tmp >> 2); - const b = base64Chars.charAt((tmp << 4) & 0x3f); - parts.push(`${a}${b}`); - if (pad) { - parts.push("=="); - } - } - else if (extraBytes === 2) { - const tmp = (data[len - 2] << 8) + data[len - 1]; - const a = base64Chars.charAt(tmp >> 10); - const b = base64Chars.charAt((tmp >> 4) & 0x3f); - const c = base64Chars.charAt((tmp << 2) & 0x3f); - parts.push(`${a}${b}${c}`); - if (pad) { - parts.push("="); - } - } - return parts.join(""); -} -function getDecodeBase64Length(data) { - let bufferLength = Math.floor(data.length * 0.75); - const len = data.length; - if (data[len - 1] === "=") { - bufferLength -= 1; - if (data[len - 2] === "=") { - bufferLength -= 1; - } - } - return bufferLength; -} -function decodeBase64(data) { - const bufferLength = getDecodeBase64Length(data); - const len = data.length; - const bytes = new Uint8Array(bufferLength); - let p = 0; - for (let i = 0; i < len; i += 4) { - const encoded1 = base64Lookup[data.charCodeAt(i)]; - const encoded2 = base64Lookup[data.charCodeAt(i + 1)]; - const encoded3 = base64Lookup[data.charCodeAt(i + 2)]; - const encoded4 = base64Lookup[data.charCodeAt(i + 3)]; - bytes[p] = (encoded1 << 2) | (encoded2 >> 4); - p += 1; - bytes[p] = ((encoded2 & 15) << 4) | (encoded3 >> 2); - p += 1; - bytes[p] = ((encoded3 & 3) << 6) | (encoded4 & 63); - p += 1; - } - return bytes; -} - -const MAX_HEAP = 16 * 1024; -const WASM_FUNC_HASH_LENGTH = 4; -const wasmMutex = new Mutex(); -const wasmModuleCache = new Map(); -function WASMInterface(binary, hashLength) { - return __awaiter(this, void 0, void 0, function* () { - let wasmInstance = null; - let memoryView = null; - let initialized = false; - if (typeof WebAssembly === "undefined") { - throw new Error("WebAssembly is not supported in this environment!"); - } - const writeMemory = (data, offset = 0) => { - memoryView.set(data, offset); - }; - const getMemory = () => memoryView; - const getExports = () => wasmInstance.exports; - const setMemorySize = (totalSize) => { - wasmInstance.exports.Hash_SetMemorySize(totalSize); - const arrayOffset = wasmInstance.exports.Hash_GetBuffer(); - const memoryBuffer = wasmInstance.exports.memory.buffer; - memoryView = new Uint8Array(memoryBuffer, arrayOffset, totalSize); - }; - const getStateSize = () => { - const view = new DataView(wasmInstance.exports.memory.buffer); - const stateSize = view.getUint32(wasmInstance.exports.STATE_SIZE, true); - return stateSize; - }; - const loadWASMPromise = wasmMutex.dispatch(() => __awaiter(this, void 0, void 0, function* () { - if (!wasmModuleCache.has(binary.name)) { - const asm = decodeBase64(binary.data); - const promise = WebAssembly.compile(asm); - wasmModuleCache.set(binary.name, promise); - } - const module = yield wasmModuleCache.get(binary.name); - wasmInstance = yield WebAssembly.instantiate(module, { - // env: { - // emscripten_memcpy_big: (dest, src, num) => { - // const memoryBuffer = wasmInstance.exports.memory.buffer; - // const memView = new Uint8Array(memoryBuffer, 0); - // memView.set(memView.subarray(src, src + num), dest); - // }, - // print_memory: (offset, len) => { - // const memoryBuffer = wasmInstance.exports.memory.buffer; - // const memView = new Uint8Array(memoryBuffer, 0); - // console.log('print_int32', memView.subarray(offset, offset + len)); - // }, - // }, - }); - // wasmInstance.exports._start(); - })); - const setupInterface = () => __awaiter(this, void 0, void 0, function* () { - if (!wasmInstance) { - yield loadWASMPromise; - } - const arrayOffset = wasmInstance.exports.Hash_GetBuffer(); - const memoryBuffer = wasmInstance.exports.memory.buffer; - memoryView = new Uint8Array(memoryBuffer, arrayOffset, MAX_HEAP); - }); - const init = (bits = null) => { - initialized = true; - wasmInstance.exports.Hash_Init(bits); - }; - const updateUInt8Array = (data) => { - let read = 0; - while (read < data.length) { - const chunk = data.subarray(read, read + MAX_HEAP); - read += chunk.length; - memoryView.set(chunk); - wasmInstance.exports.Hash_Update(chunk.length); - } - }; - const update = (data) => { - if (!initialized) { - throw new Error("update() called before init()"); - } - const Uint8Buffer = getUInt8Buffer(data); - updateUInt8Array(Uint8Buffer); - }; - const digestChars = new Uint8Array(hashLength * 2); - const digest = (outputType, padding = null) => { - if (!initialized) { - throw new Error("digest() called before init()"); - } - initialized = false; - wasmInstance.exports.Hash_Final(padding); - if (outputType === "binary") { - // the data is copied to allow GC of the original memory object - return memoryView.slice(0, hashLength); - } - return getDigestHex(digestChars, memoryView, hashLength); - }; - const save = () => { - if (!initialized) { - throw new Error("save() can only be called after init() and before digest()"); - } - const stateOffset = wasmInstance.exports.Hash_GetState(); - const stateLength = getStateSize(); - const memoryBuffer = wasmInstance.exports.memory.buffer; - const internalState = new Uint8Array(memoryBuffer, stateOffset, stateLength); - // prefix is 4 bytes from SHA1 hash of the WASM binary - // it is used to detect incompatible internal states between different versions of hash-wasm - const prefixedState = new Uint8Array(WASM_FUNC_HASH_LENGTH + stateLength); - writeHexToUInt8(prefixedState, binary.hash); - prefixedState.set(internalState, WASM_FUNC_HASH_LENGTH); - return prefixedState; - }; - const load = (state) => { - if (!(state instanceof Uint8Array)) { - throw new Error("load() expects an Uint8Array generated by save()"); - } - const stateOffset = wasmInstance.exports.Hash_GetState(); - const stateLength = getStateSize(); - const overallLength = WASM_FUNC_HASH_LENGTH + stateLength; - const memoryBuffer = wasmInstance.exports.memory.buffer; - if (state.length !== overallLength) { - throw new Error(`Bad state length (expected ${overallLength} bytes, got ${state.length})`); - } - if (!hexStringEqualsUInt8(binary.hash, state.subarray(0, WASM_FUNC_HASH_LENGTH))) { - throw new Error("This state was written by an incompatible hash implementation"); - } - const internalState = state.subarray(WASM_FUNC_HASH_LENGTH); - new Uint8Array(memoryBuffer, stateOffset, stateLength).set(internalState); - initialized = true; - }; - const isDataShort = (data) => { - if (typeof data === "string") { - // worst case is 4 bytes / char - return data.length < MAX_HEAP / 4; - } - return data.byteLength < MAX_HEAP; - }; - let canSimplify = isDataShort; - switch (binary.name) { - case "argon2": - case "scrypt": - canSimplify = () => true; - break; - case "blake2b": - case "blake2s": - // if there is a key at blake2 then cannot simplify - canSimplify = (data, initParam) => initParam <= 512 && isDataShort(data); - break; - case "blake3": - // if there is a key at blake3 then cannot simplify - canSimplify = (data, initParam) => initParam === 0 && isDataShort(data); - break; - case "xxhash64": // cannot simplify - case "xxhash3": - case "xxhash128": - case "crc64": - canSimplify = () => false; - break; - } - // shorthand for (init + update + digest) for better performance - const calculate = (data, initParam = null, digestParam = null) => { - if (!canSimplify(data, initParam)) { - init(initParam); - update(data); - return digest("hex", digestParam); - } - const buffer = getUInt8Buffer(data); - memoryView.set(buffer); - wasmInstance.exports.Hash_Calculate(buffer.length, initParam, digestParam); - return getDigestHex(digestChars, memoryView, hashLength); - }; - yield setupInterface(); - return { - getMemory, - writeMemory, - getExports, - setMemorySize, - init, - update, - digest, - save, - load, - calculate, - hashLength, - }; - }); -} - -function lockedCreate(mutex, binary, hashLength) { - return __awaiter(this, void 0, void 0, function* () { - const unlock = yield mutex.lock(); - const wasm = yield WASMInterface(binary, hashLength); - unlock(); - return wasm; - }); -} - -const mutex$l = new Mutex(); -let wasmCache$l = null; -/** - * Calculates Adler-32 hash. The resulting 32-bit hash is stored in - * network byte order (big-endian). - * - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ -function adler32(data) { - if (wasmCache$l === null) { - return lockedCreate(mutex$l, wasmJson$l, 4).then((wasm) => { - wasmCache$l = wasm; - return wasmCache$l.calculate(data); - }); - } - try { - const hash = wasmCache$l.calculate(data); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } -} -/** - * Creates a new Adler-32 hash instance - */ -function createAdler32() { - return WASMInterface(wasmJson$l, 4).then((wasm) => { - wasm.init(); - const obj = { - init: () => { - wasm.init(); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 4, - digestSize: 4, - }; - return obj; - }); -} - -var name$k = "argon2"; -var data$k = "AGFzbQEAAAABKQVgAX8Bf2AAAX9gEH9/f39/f39/f39/f39/f38AYAR/f39/AGACf38AAwYFAAECAwQFBgEBAoCAAgYIAX8BQZCoBAsHQQQGbWVtb3J5AgASSGFzaF9TZXRNZW1vcnlTaXplAAAOSGFzaF9HZXRCdWZmZXIAAQ5IYXNoX0NhbGN1bGF0ZQAECvEyBVgBAn9BACEBAkAgAEEAKAKICCICRg0AAkAgACACayIAQRB2IABBgIB8cSAASWoiAEAAQX9HDQBB/wHADwtBACEBQQBBACkDiAggAEEQdK18NwOICAsgAcALcAECfwJAQQAoAoAIIgANAEEAPwBBEHQiADYCgAhBACgCiAgiAUGAgCBGDQACQEGAgCAgAWsiAEEQdiAAQYCAfHEgAElqIgBAAEF/Rw0AQQAPC0EAQQApA4gIIABBEHStfDcDiAhBACgCgAghAAsgAAvcDgECfiAAIAQpAwAiECAAKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAMIBAgDCkDAIVCIIkiEDcDACAIIBAgCCkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgBCAQIAQpAwCFQiiJIhA3AwAgACAQIAApAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIAwgECAMKQMAhUIwiSIQNwMAIAggECAIKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAEIBAgBCkDAIVCAYk3AwAgASAFKQMAIhAgASkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgDSAQIA0pAwCFQiCJIhA3AwAgCSAQIAkpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAUgECAFKQMAhUIoiSIQNwMAIAEgECABKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACANIBAgDSkDAIVCMIkiEDcDACAJIBAgCSkDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgBSAQIAUpAwCFQgGJNwMAIAIgBikDACIQIAIpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIA4gECAOKQMAhUIgiSIQNwMAIAogECAKKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAGIBAgBikDAIVCKIkiEDcDACACIBAgAikDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgDiAQIA4pAwCFQjCJIhA3AwAgCiAQIAopAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIAYgECAGKQMAhUIBiTcDACADIAcpAwAiECADKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAPIBAgDykDAIVCIIkiEDcDACALIBAgCykDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgByAQIAcpAwCFQiiJIhA3AwAgAyAQIAMpAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIA8gECAPKQMAhUIwiSIQNwMAIAsgECALKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAHIBAgBykDAIVCAYk3AwAgACAFKQMAIhAgACkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgDyAQIA8pAwCFQiCJIhA3AwAgCiAQIAopAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAUgECAFKQMAhUIoiSIQNwMAIAAgECAAKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAPIBAgDykDAIVCMIkiEDcDACAKIBAgCikDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgBSAQIAUpAwCFQgGJNwMAIAEgBikDACIQIAEpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAwgECAMKQMAhUIgiSIQNwMAIAsgECALKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAGIBAgBikDAIVCKIkiEDcDACABIBAgASkDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgDCAQIAwpAwCFQjCJIhA3AwAgCyAQIAspAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIAYgECAGKQMAhUIBiTcDACACIAcpAwAiECACKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACANIBAgDSkDAIVCIIkiEDcDACAIIBAgCCkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgByAQIAcpAwCFQiiJIhA3AwAgAiAQIAIpAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIA0gECANKQMAhUIwiSIQNwMAIAggECAIKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAHIBAgBykDAIVCAYk3AwAgAyAEKQMAIhAgAykDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgDiAQIA4pAwCFQiCJIhA3AwAgCSAQIAkpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAQgECAEKQMAhUIoiSIQNwMAIAMgECADKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAOIBAgDikDAIVCMIkiEDcDACAJIBAgCSkDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgBCAQIAQpAwCFQgGJNwMAC98aAQN/QQAhBEEAIAIpAwA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AgwBC0EAQgM3A6AQQQAgBEF/aq03A5AQQYB4IRcLIAIgF2ohGyAIQQx0IQhBACEcA0AgCCAcQQFqIhxsQYB4aiEEQQAhAQNAIBsgAWoiAyADKQMAIAIgBCABamopAwCFNwMAIANBCGoiAyADKQMAIAIgBCABQQhyamopAwCFNwMAIAFBCGohAyABQRBqIQEgA0H4B0kNAAsgHCAKRw0ACwsgAiAXaiEbQXghAQNAIAIgAWoiA0EIaiAbIAFqIgRBCGopAwA3AwAgA0EQaiAEQRBqKQMANwMAIANBGGogBEEYaikDADcDACADQSBqIARBIGopAwA3AwAgAUEgaiIBQfgHSQ0ACwsL"; -var hash$k = "e4cdc523"; -var wasmJson$k = { - name: name$k, - data: data$k, - hash: hash$k -}; - -var name$j = "blake2b"; -var data$j = "AGFzbQEAAAABEQRgAAF/YAJ/fwBgAX8AYAAAAwoJAAECAwECAgABBQQBAQICBg4CfwFBsIsFC38AQYAICwdwCAZtZW1vcnkCAA5IYXNoX0dldEJ1ZmZlcgAACkhhc2hfRmluYWwAAwlIYXNoX0luaXQABQtIYXNoX1VwZGF0ZQAGDUhhc2hfR2V0U3RhdGUABw5IYXNoX0NhbGN1bGF0ZQAIClNUQVRFX1NJWkUDAQrTOAkFAEGACQvrAgIFfwF+AkAgAUEBSA0AAkACQAJAIAFBgAFBACgC4IoBIgJrIgNKDQAgASEEDAELQQBBADYC4IoBAkAgAkH/AEoNACACQeCJAWohBSAAIQRBACEGA0AgBSAELQAAOgAAIARBAWohBCAFQQFqIQUgAyAGQQFqIgZB/wFxSg0ACwtBAEEAKQPAiQEiB0KAAXw3A8CJAUEAQQApA8iJASAHQv9+Vq18NwPIiQFB4IkBEAIgACADaiEAAkAgASADayIEQYEBSA0AIAIgAWohBQNAQQBBACkDwIkBIgdCgAF8NwPAiQFBAEEAKQPIiQEgB0L/flatfDcDyIkBIAAQAiAAQYABaiEAIAVBgH9qIgVBgAJLDQALIAVBgH9qIQQMAQsgBEEATA0BC0EAIQUDQCAFQQAo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BSACQQFqIgJB/wFxSg0ACwsgAEHAAGokAAv9AwMBfwF+AX8jAEGAAWsiAiQAQQBBgQI7AfKKAUEAIAE6APGKAUEAIAA6APCKAUGQfiEAA0AgAEGAiwFqQgA3AAAgAEH4igFqQgA3AAAgAEHwigFqQgA3AAAgAEEYaiIADQALQQAhAEEAQQApA/CKASIDQoiS853/zPmE6gCFNwOAiQFBAEEAKQP4igFCu86qptjQ67O7f4U3A4iJAUEAQQApA4CLAUKr8NP0r+68tzyFNwOQiQFBAEEAKQOIiwFC8e30+KWn/aelf4U3A5iJAUEAQQApA5CLAULRhZrv+s+Uh9EAhTcDoIkBQQBBACkDmIsBQp/Y+dnCkdqCm3+FNwOoiQFBAEEAKQOgiwFC6/qG2r+19sEfhTcDsIkBQQBBACkDqIsBQvnC+JuRo7Pw2wCFNwO4iQFBACADp0H/AXE2AuSKAQJAIAFBAUgNACACQgA3A3ggAkIANwNwIAJCADcDaCACQgA3A2AgAkIANwNYIAJCADcDUCACQgA3A0ggAkIANwNAIAJCADcDOCACQgA3AzAgAkIANwMoIAJCADcDICACQgA3AxggAkIANwMQIAJCADcDCCACQgA3AwBBACEEA0AgAiAAaiAAQYAJai0AADoAACAAQQFqIQAgBEEBaiIEQf8BcSABSA0ACyACQYABEAELIAJBgAFqJAALEgAgAEEDdkH/P3EgAEEQdhAECwkAQYAJIAAQAQsGAEGAiQELGwAgAUEDdkH/P3EgAUEQdhAEQYAJIAAQARADCwsLAQBBgAgLBPAAAAA="; -var hash$j = "c6f286e6"; -var wasmJson$j = { - name: name$j, - data: data$j, - hash: hash$j -}; - -const mutex$k = new Mutex(); -let wasmCache$k = null; -function validateBits$4(bits) { - if (!Number.isInteger(bits) || bits < 8 || bits > 512 || bits % 8 !== 0) { - return new Error("Invalid variant! Valid values: 8, 16, ..., 512"); - } - return null; -} -function getInitParam$1(outputBits, keyBits) { - return outputBits | (keyBits << 16); -} -/** - * Calculates BLAKE2b hash - * @param data Input data (string, Buffer or TypedArray) - * @param bits Number of output bits, which has to be a number - * divisible by 8, between 8 and 512. Defaults to 512. - * @param key Optional key (string, Buffer or TypedArray). Maximum length is 64 bytes. - * @returns Computed hash as a hexadecimal string - */ -function blake2b(data, bits = 512, key = null) { - if (validateBits$4(bits)) { - return Promise.reject(validateBits$4(bits)); - } - let keyBuffer = null; - let initParam = bits; - if (key !== null) { - keyBuffer = getUInt8Buffer(key); - if (keyBuffer.length > 64) { - return Promise.reject(new Error("Max key length is 64 bytes")); - } - initParam = getInitParam$1(bits, keyBuffer.length); - } - const hashLength = bits / 8; - if (wasmCache$k === null || wasmCache$k.hashLength !== hashLength) { - return lockedCreate(mutex$k, wasmJson$j, hashLength).then((wasm) => { - wasmCache$k = wasm; - if (initParam > 512) { - wasmCache$k.writeMemory(keyBuffer); - } - return wasmCache$k.calculate(data, initParam); - }); - } - try { - if (initParam > 512) { - wasmCache$k.writeMemory(keyBuffer); - } - const hash = wasmCache$k.calculate(data, initParam); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } -} -/** - * Creates a new BLAKE2b hash instance - * @param bits Number of output bits, which has to be a number - * divisible by 8, between 8 and 512. Defaults to 512. - * @param key Optional key (string, Buffer or TypedArray). Maximum length is 64 bytes. - */ -function createBLAKE2b(bits = 512, key = null) { - if (validateBits$4(bits)) { - return Promise.reject(validateBits$4(bits)); - } - let keyBuffer = null; - let initParam = bits; - if (key !== null) { - keyBuffer = getUInt8Buffer(key); - if (keyBuffer.length > 64) { - return Promise.reject(new Error("Max key length is 64 bytes")); - } - initParam = getInitParam$1(bits, keyBuffer.length); - } - const outputSize = bits / 8; - return WASMInterface(wasmJson$j, outputSize).then((wasm) => { - if (initParam > 512) { - wasm.writeMemory(keyBuffer); - } - wasm.init(initParam); - const obj = { - init: initParam > 512 - ? () => { - wasm.writeMemory(keyBuffer); - wasm.init(initParam); - return obj; - } - : () => { - wasm.init(initParam); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 128, - digestSize: outputSize, - }; - return obj; - }); -} - -function encodeResult(salt, options, res) { - const parameters = [ - `m=${options.memorySize}`, - `t=${options.iterations}`, - `p=${options.parallelism}`, - ].join(","); - return `$argon2${options.hashType}$v=19$${parameters}$${encodeBase64(salt, false)}$${encodeBase64(res, false)}`; -} -const uint32View = new DataView(new ArrayBuffer(4)); -function int32LE(x) { - uint32View.setInt32(0, x, true); - return new Uint8Array(uint32View.buffer); -} -function hashFunc(blake512, buf, len) { - return __awaiter(this, void 0, void 0, function* () { - if (len <= 64) { - const blake = yield createBLAKE2b(len * 8); - blake.update(int32LE(len)); - blake.update(buf); - return blake.digest("binary"); - } - const r = Math.ceil(len / 32) - 2; - const ret = new Uint8Array(len); - blake512.init(); - blake512.update(int32LE(len)); - blake512.update(buf); - let vp = blake512.digest("binary"); - ret.set(vp.subarray(0, 32), 0); - for (let i = 1; i < r; i++) { - blake512.init(); - blake512.update(vp); - vp = blake512.digest("binary"); - ret.set(vp.subarray(0, 32), i * 32); - } - const partialBytesNeeded = len - 32 * r; - let blakeSmall; - if (partialBytesNeeded === 64) { - blakeSmall = blake512; - blakeSmall.init(); - } - else { - blakeSmall = yield createBLAKE2b(partialBytesNeeded * 8); - } - blakeSmall.update(vp); - vp = blakeSmall.digest("binary"); - ret.set(vp.subarray(0, partialBytesNeeded), r * 32); - return ret; - }); -} -function getHashType(type) { - switch (type) { - case "d": - return 0; - case "i": - return 1; - default: - return 2; - } -} -function argon2Internal(options) { - return __awaiter(this, void 0, void 0, function* () { - var _a; - const { parallelism, iterations, hashLength } = options; - const password = getUInt8Buffer(options.password); - const salt = getUInt8Buffer(options.salt); - const version = 0x13; - const hashType = getHashType(options.hashType); - const { memorySize } = options; // in KB - const secret = getUInt8Buffer((_a = options.secret) !== null && _a !== void 0 ? _a : ""); - const [argon2Interface, blake512] = yield Promise.all([ - WASMInterface(wasmJson$k, 1024), - createBLAKE2b(512), - ]); - // last block is for storing the init vector - argon2Interface.setMemorySize(memorySize * 1024 + 1024); - const initVector = new Uint8Array(24); - const initVectorView = new DataView(initVector.buffer); - initVectorView.setInt32(0, parallelism, true); - initVectorView.setInt32(4, hashLength, true); - initVectorView.setInt32(8, memorySize, true); - initVectorView.setInt32(12, iterations, true); - initVectorView.setInt32(16, version, true); - initVectorView.setInt32(20, hashType, true); - argon2Interface.writeMemory(initVector, memorySize * 1024); - blake512.init(); - blake512.update(initVector); - blake512.update(int32LE(password.length)); - blake512.update(password); - blake512.update(int32LE(salt.length)); - blake512.update(salt); - blake512.update(int32LE(secret.length)); - blake512.update(secret); - blake512.update(int32LE(0)); // associatedData length + associatedData - const segments = Math.floor(memorySize / (parallelism * 4)); // length of each lane - const lanes = segments * 4; - const param = new Uint8Array(72); - const H0 = blake512.digest("binary"); - param.set(H0); - for (let lane = 0; lane < parallelism; lane++) { - param.set(int32LE(0), 64); - param.set(int32LE(lane), 68); - let position = lane * lanes; - let chunk = yield hashFunc(blake512, param, 1024); - argon2Interface.writeMemory(chunk, position * 1024); - position += 1; - param.set(int32LE(1), 64); - chunk = yield hashFunc(blake512, param, 1024); - argon2Interface.writeMemory(chunk, position * 1024); - } - const C = new Uint8Array(1024); - writeHexToUInt8(C, argon2Interface.calculate(new Uint8Array([]), memorySize)); - const res = yield hashFunc(blake512, C, hashLength); - if (options.outputType === "hex") { - const digestChars = new Uint8Array(hashLength * 2); - return getDigestHex(digestChars, res, hashLength); - } - if (options.outputType === "encoded") { - return encodeResult(salt, options, res); - } - // return binary format - return res; - }); -} -const validateOptions$3 = (options) => { - var _a; - if (!options || typeof options !== "object") { - throw new Error("Invalid options parameter. It requires an object."); - } - if (!options.password) { - throw new Error("Password must be specified"); - } - options.password = getUInt8Buffer(options.password); - if (options.password.length < 1) { - throw new Error("Password must be specified"); - } - if (!options.salt) { - throw new Error("Salt must be specified"); - } - options.salt = getUInt8Buffer(options.salt); - if (options.salt.length < 8) { - throw new Error("Salt should be at least 8 bytes long"); - } - options.secret = getUInt8Buffer((_a = options.secret) !== null && _a !== void 0 ? _a : ""); - if (!Number.isInteger(options.iterations) || options.iterations < 1) { - throw new Error("Iterations should be a positive number"); - } - if (!Number.isInteger(options.parallelism) || options.parallelism < 1) { - throw new Error("Parallelism should be a positive number"); - } - if (!Number.isInteger(options.hashLength) || options.hashLength < 4) { - throw new Error("Hash length should be at least 4 bytes."); - } - if (!Number.isInteger(options.memorySize)) { - throw new Error("Memory size should be specified."); - } - if (options.memorySize < 8 * options.parallelism) { - throw new Error("Memory size should be at least 8 * parallelism."); - } - if (options.outputType === undefined) { - options.outputType = "hex"; - } - if (!["hex", "binary", "encoded"].includes(options.outputType)) { - throw new Error(`Insupported output type ${options.outputType}. Valid values: ['hex', 'binary', 'encoded']`); - } -}; -/** - * Calculates hash using the argon2i password-hashing function - * @returns Computed hash - */ -function argon2i(options) { - return __awaiter(this, void 0, void 0, function* () { - validateOptions$3(options); - return argon2Internal(Object.assign(Object.assign({}, options), { hashType: "i" })); - }); -} -/** - * Calculates hash using the argon2id password-hashing function - * @returns Computed hash - */ -function argon2id(options) { - return __awaiter(this, void 0, void 0, function* () { - validateOptions$3(options); - return argon2Internal(Object.assign(Object.assign({}, options), { hashType: "id" })); - }); -} -/** - * Calculates hash using the argon2d password-hashing function - * @returns Computed hash - */ -function argon2d(options) { - return __awaiter(this, void 0, void 0, function* () { - validateOptions$3(options); - return argon2Internal(Object.assign(Object.assign({}, options), { hashType: "d" })); - }); -} -const getHashParameters = (password, encoded, secret) => { - const regex = /^\$argon2(id|i|d)\$v=([0-9]+)\$((?:[mtp]=[0-9]+,){2}[mtp]=[0-9]+)\$([A-Za-z0-9+/]+)\$([A-Za-z0-9+/]+)$/; - const match = encoded.match(regex); - if (!match) { - throw new Error("Invalid hash"); - } - const [, hashType, version, parameters, salt, hash] = match; - if (version !== "19") { - throw new Error(`Unsupported version: ${version}`); - } - const parsedParameters = {}; - const paramMap = { m: "memorySize", p: "parallelism", t: "iterations" }; - for (const x of parameters.split(",")) { - const [n, v] = x.split("="); - parsedParameters[paramMap[n]] = Number(v); - } - return Object.assign(Object.assign({}, parsedParameters), { password, - secret, hashType: hashType, salt: decodeBase64(salt), hashLength: getDecodeBase64Length(hash), outputType: "encoded" }); -}; -const validateVerifyOptions$1 = (options) => { - if (!options || typeof options !== "object") { - throw new Error("Invalid options parameter. It requires an object."); - } - if (options.hash === undefined || typeof options.hash !== "string") { - throw new Error("Hash should be specified"); - } -}; -/** - * Verifies password using the argon2 password-hashing function - * @returns True if the encoded hash matches the password - */ -function argon2Verify(options) { - return __awaiter(this, void 0, void 0, function* () { - validateVerifyOptions$1(options); - const params = getHashParameters(options.password, options.hash, options.secret); - validateOptions$3(params); - const hashStart = options.hash.lastIndexOf("$") + 1; - const result = (yield argon2Internal(params)); - return result.substring(hashStart) === options.hash.substring(hashStart); - }); -} - -var name$i = "blake2s"; -var data$i = "AGFzbQEAAAABEQRgAAF/YAJ/fwBgAX8AYAAAAwkIAAECAwICAAEFBAEBAgIGDgJ/AUGgigULfwBBgAgLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAKSGFzaF9GaW5hbAADCUhhc2hfSW5pdAAEC0hhc2hfVXBkYXRlAAUNSGFzaF9HZXRTdGF0ZQAGDkhhc2hfQ2FsY3VsYXRlAAcKU1RBVEVfU0laRQMBCr4yCAUAQYAJC6gFAQZ/AkAgAUEBSA0AAkACQAJAIAFBwABBACgC8IkBIgJrIgNKDQAgASEDDAELQQBBADYC8IkBAkAgAkHAAEYNACACQbCJAWohBAJAAkAgA0EHcSIFDQAgACEGIAMhBwwBCyAFIQcgACEGA0AgBCAGLQAAOgAAIARBAWohBCAGQQFqIQYgB0F/aiIHDQALQcAAIAIgBWprIQcLIAJBR2pBB0kNAANAIAQgBi0AADoAACAEIAYtAAE6AAEgBCAGLQACOgACIAQgBi0AAzoAAyAEIAYtAAQ6AAQgBCAGLQ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gAWotAAA6AAAgAUEBaiEBIAMgAkEBaiICQf8BcUoNAAsLIABBIGokAAuyAwEEfyMAQcAAayIBJABBAEGBAjsBgooBQQAgAEEQdiICOgCBigFBACAAQQN2OgCAigFBiH8hAwJAA0AgA0H4iQFqQQA2AgAgA0UNASADQfyJAWpBADYCACADQQhqIQMMAAsLQQAhA0EAQQAoAoCKASIEQefMp9AGczYCgIkBQQBBACgChIoBQYXdntt7czYChIkBQQBBACgCiIoBQfLmu+MDczYCiIkBQQBBACgCjIoBQbrqv6p6czYCjIkBQQBBACgCkIoBQf+kuYgFczYCkIkBQQBBACgClIoBQYzRldh5czYClIkBQQBBACgCmIoBQauzj/wBczYCmIkBQQAgBEH/AXE2AvSJAUEAQQAoApyKAUGZmoPfBXM2ApyJAQJAIABBgIAESQ0AIAFBOGpCADcDACABQTBqQgA3AwAgAUEoakIANwMAIAFBIGpCADcDACABQRhqQgA3AwAgAUEQakIANwMAIAFCADcDCCABQgA3AwBBACEAA0AgASADaiADQYAJai0AADoAACADQQFqIQMgAiAAQQFqIgBB/wFxSw0ACyABQcAAEAELIAFBwABqJAALCQBBgAkgABABCwYAQYCJAQsPACABEARBgAkgABABEAMLCwsBAEGACAsEfAAAAA=="; -var hash$i = "5c0ff166"; -var wasmJson$i = { - name: name$i, - data: data$i, - hash: hash$i -}; - -const mutex$j = new Mutex(); -let wasmCache$j = null; -function validateBits$3(bits) { - if (!Number.isInteger(bits) || bits < 8 || bits > 256 || bits % 8 !== 0) { - return new Error("Invalid variant! Valid values: 8, 16, ..., 256"); - } - return null; -} -function getInitParam(outputBits, keyBits) { - return outputBits | (keyBits << 16); -} -/** - * Calculates BLAKE2s hash - * @param data Input data (string, Buffer or TypedArray) - * @param bits Number of output bits, which has to be a number - * divisible by 8, between 8 and 256. Defaults to 256. - * @param key Optional key (string, Buffer or TypedArray). Maximum length is 32 bytes. - * @returns Computed hash as a hexadecimal string - */ -function blake2s(data, bits = 256, key = null) { - if (validateBits$3(bits)) { - return Promise.reject(validateBits$3(bits)); - } - let keyBuffer = null; - let initParam = bits; - if (key !== null) { - keyBuffer = getUInt8Buffer(key); - if (keyBuffer.length > 32) { - return Promise.reject(new Error("Max key length is 32 bytes")); - } - initParam = getInitParam(bits, keyBuffer.length); - } - const hashLength = bits / 8; - if (wasmCache$j === null || wasmCache$j.hashLength !== hashLength) { - return lockedCreate(mutex$j, wasmJson$i, hashLength).then((wasm) => { - wasmCache$j = wasm; - if (initParam > 512) { - wasmCache$j.writeMemory(keyBuffer); - } - return wasmCache$j.calculate(data, initParam); - }); - } - try { - if (initParam > 512) { - wasmCache$j.writeMemory(keyBuffer); - } - const hash = wasmCache$j.calculate(data, initParam); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } -} -/** - * Creates a new BLAKE2s hash instance - * @param bits Number of output bits, which has to be a number - * divisible by 8, between 8 and 256. Defaults to 256. - * @param key Optional key (string, Buffer or TypedArray). Maximum length is 32 bytes. - */ -function createBLAKE2s(bits = 256, key = null) { - if (validateBits$3(bits)) { - return Promise.reject(validateBits$3(bits)); - } - let keyBuffer = null; - let initParam = bits; - if (key !== null) { - keyBuffer = getUInt8Buffer(key); - if (keyBuffer.length > 32) { - return Promise.reject(new Error("Max key length is 32 bytes")); - } - initParam = getInitParam(bits, keyBuffer.length); - } - const outputSize = bits / 8; - return WASMInterface(wasmJson$i, outputSize).then((wasm) => { - if (initParam > 512) { - wasm.writeMemory(keyBuffer); - } - wasm.init(initParam); - const obj = { - init: initParam > 512 - ? () => { - wasm.writeMemory(keyBuffer); - wasm.init(initParam); - return obj; - } - : () => { - wasm.init(initParam); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 64, - digestSize: outputSize, - }; - return obj; - }); -} - -var name$h = "blake3"; -var data$h = "AGFzbQEAAAABMQdgAAF/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hCkIBIABBAXKteUI/hYanIQIDQCACIhFBAXYhAiAKIBFBf2qtg0IAUg0ACyARQQp2rSESAkACQCARQYAISw0AIAFBADsB2AEgAUIANwPQASABQgA3A8gBIAFCADcDwAEgAUIANwO4ASABQgA3A7ABIAFCADcDqAEgAUIANwOgASABQgA3A5gBIAFBACkDgIkBNwNwIAFBACkDiIkBNwN4IAFBACkDkIkBNwOAASABQQAtAIqKAToA2gEgAUEAKQOYiQE3A4gBIAEgBDcDkAEgAUHwAGogAyAREAQgASABKQNwIgQ3AwAgASABKQN4IgU3AwggASABKQOAASIGNwMQIAEgASkDiAEiBzcDGCABIAEpA5gBNwMoIAEgASkDoAE3AzAgASABKQOoATcDOCABLQDaASECIAEtANkBIQsgASkDkAEhCiABIAEtANgBIgg6AGggASAKNwMgIAEgASkDsAE3A0AgASABKQO4ATcDSCABIAEpA8ABNwNQIAEgASkDyAE3A1ggASABKQPQATcDYCABIAIgC0VyQQJyIgI6AGkgASAHNwO4AiABIAY3A7ACIAEgBTcDqAIgASAENwOgAiABQeABaiABQaACaiAQIAggCiACQf8BcRACIAEpA4ACIQQgASkD4AEhBSABKQOIAiEGIAEpA+gBIQcgASkDkAIhDCABKQPwASENIAEpA5gCIQ4gASkD+AEhDyAKEAVBAEEALQCQigEiAkEBajoAkIoBIAJBBXQiAkGpigFqIA4gD4U3AwAgAkGhigFqIAwgDYU3AwAgAkGZigFqIAYgB4U3AwAgAkGRigFqIAQgBYU3AwAMAQsCQAJAIAMgESAEQQAtAIqKASICIAEQBiITQQJLDQAgASkDGCEKIAEpAxAhBCABKQMIIQUgASkDACEGDAELIAJBBHIhFEEAKQOYiQEhDUEAKQOQiQEhDkEAKQOIiQEhD0EAKQOAiQEhFQNAIBNBfmoiFkEBdiIXQQFqIhhBA3EhCEEAIQkCQCAWQQZJDQAgGEH8////B3EhGUEAIQkgAUHIAmohAiABIQsDQCACIAs2AgAgAkEMaiALQcABajYCACACQQhqIAtBgAFqNgIAIAJBBGogC0HAAGo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igFBBHIhBCABQShqIQVBACkDmIkBIQBBACkDkIkBIQZBACkDiIkBIQdBACkDgIkBIQggAyEJA0AgASAANwMYIAEgBjcDECABIAc3AwggASAINwMAIAEgA0EFdCIDQdGJAWoiCikDADcDKCABIANB2YkBaiILKQMANwMwIAEgA0HhiQFqIgwpAwA3AzggASADQemJAWoiDSkDADcDQCABIANB8YkBaikDADcDSCABIANB+YkBaikDADcDUCABIANBgYoBaikDADcDWCADQYmKAWopAwAhDiABQcAAOgBoIAEgDjcDYCABQgA3AyAgASAEOgBpIAEgADcDiAEgASAGNwOAASABIAc3A3ggASAINwNwIAFBkAFqIAFB8ABqIAVBwABCACAEQf8BcRACIAEpA7ABIQ4gASkDkAEhDyABKQO4ASEQIAEpA5gBIREgASkDwAEhEiABKQOgASETIA0gASkDyAEgASkDqAGFNwMAIAwgEiAThTcDACALIBAgEYU3AwAgCiAOIA+FNwMAIAlBf2oiCUH/AXEiAyACSw0AC0EAIAk6AJCKAQsgAUHQAWokAAvHCQIKfwV+IwBB4AJrIgUkAAJAAkAgAUGACEsNACAFIAA2AvwBIAVB/AFqIAFBgAhGIgZBECACQQEgA0EBQQIgBBABIAZBCnQiByABTw0BIAVB4ABqIgZCADcDACAFQdgAaiIIQgA3AwAgBUHQAGoiCUIANwMAIAVByABqIgpCADcDACAFQcAAaiILQgA3AwAgBUE4aiIMQgA3AwAgBUEwaiINQgA3AwAgBSADOgBqIAVCADcDKCAFQQA7AWggBUEAKQOAiQE3AwAgBUEAKQOIiQE3AwggBUEAKQOQiQE3AxAgBUEAKQOYiQE3AxggBSABQYAIRiIOrSACfDcDICAFIAAgB2pBACABIA4bEAQgBUGIAWpBMGogDSkDADcDACAFQYgBakE4aiAMKQMANwMAIAUgBSkDACIPNwOIASAFIAUpAwgiEDcDkAEgBSAFKQMQIhE3A5gBIAUgBSkDGCISNwOgASAFIAUpAyg3A7ABIAUtAGohACAFLQBpIQcgBSkDICECIAUtAGghASAFQYgBakHAAGogCykDADcDACAFQYg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CAARQ0AAkBBAC0AkIoBIgINACABQTBqQQApA9CJATcDACABQThqQQApA9iJATcDACABQQApA6CJASIDNwMAIAFBACkDqIkBIgQ3AwggAUEAKQOwiQEiBTcDECABQQApA7iJASIGNwMYIAFBACkDyIkBNwMoQQAtAIqKASECQQAtAImKASEHQQApA8CJASEIQQAtAIiKASEJIAFBwABqQQApA+CJATcDACABQcgAakEAKQPoiQE3AwAgAUHQAGpBACkD8IkBNwMAIAFB2ABqQQApA/iJATcDACABQeAAakEAKQOAigE3AwAgASAJOgBoIAEgCDcDICABIAIgB0VyIgJBAnI6AGkgAUEoaiEKQgAhCEGACSELIAJBCnJB/wFxIQwDQCABQbABaiABIAogCUH/AXEgCCAMEAIgASABKQPQASINIAEpA7ABhTcDcCABIAEpA9gBIg4gASkDuAGFNwN4IAEgASkD4AEiDyABKQPAAYU3A4ABIAEgASkD6AEiECAGhTcDqAEgASAPIAWFNwOgASABIA4gBIU3A5gBIAEgDSADhTcDkAEgASAQIAEpA8gBhTcDiAEgAEHAACAAQcAASRsiEUF/aiESAkACQCARQQdxIhMNACABQfAAaiECIAshByARIRQMAQsgEUH4AHEhFCABQfAAaiECIAshBwNAIAcgAi0AADoAACAHQQFqIQcgAkEBaiECIBNBf2oiEw0ACwsCQCASQQdJDQADQCAHIAIpAAA3AAAgB0EIaiEHIAJBCGohAiAUQXhqIhQNAAsLIAhCAXwhCCALIBFqIQsgACARayIADQAMAgsLAkACQAJAQQAtAImKASIHQQZ0QQBBAC0AiIoBIhFrRg0AIAEgEToAaCABQQApA4CKATcDYCABQQApA/iJATcDWCABQQApA/CJATcDUCABQQApA+iJATcDSCABQQApA+CJATcDQCABQQApA9iJATcDOCABQQApA9CJATcDMCABQQApA8iJATcDKCABQQApA8CJASIINwMgIAFBACkDuIkBIgM3AxggAUEAKQOwiQEiBDcDECABQQApA6iJASIFNwMIIAFBACkDoIkBIgY3AwAgAUEALQCKigEiEyAHRXJBAnIiCzoAaSATQQRyIRNBACkDmIkBIQ1BACkDkIkBIQ5BACkDiIkBIQ9BACkDgIkBIRAMAQtBwAAhESABQcAAOgBoQgAhCCABQgA3AyAgAUEAKQOYiQEiDTcDGCABQQApA5CJASIONwMQIAFBACkDiIkBIg83AwggAUEAKQOAiQEiEDcDACABQQAtAIqKAUEEciITOgBpIAEgAkF+aiICQQV0IgdByYoBaikDADcDYCABIAdBwYoBaikDADcDWCABIAdBuYoBaikDADcDUCABIAdBsYoBaikDADcDSCABIAdBqYoBaikDADcDQCABIAdBoYoBaikDADcDOCABIAdBmYoBaikDADcDMCABIAdBkYoBaikDADcDKCATIQsgECEGIA8hBSAOIQQgDSEDIAJFDQELIAJBf2oiB0EFdCIUQZGKAWopAwAhFSAUQZmKAWopAwAhFiAUQaGKAWopAwAhFyAUQamKAWopAwAhGCABIAM3A4gBIAEgBDcDgAEgASAFNwN4IAEgBjcDcCABQbABaiABQfAAaiABQShqIhQgESAIIAtB/wFxEAIgASATOgBpIAFBwAA6AGggASAYNwNAIAEgFzcDOCABIBY3AzAgASAVNwMoIAFCADcDICABIA03AxggASAONwMQIAEgDzcDCCABIBA3AwAgASABKQPoASABKQPIAYU3A2AgASABKQPgASABKQPAAYU3A1ggASABKQPYASABKQO4AYU3A1AgASABKQPQASABKQOwAYU3A0ggB0UNACACQQV0QemJAWohAiATQf8BcSERA0AgAkFoaikDACEIIAJBcGopAwAhAyACQXhqKQMAIQQgAikDACEFIAEgDTcDiAEgASAONwOAASABIA83A3ggASAQNwNwIAFBsAFqIAFB8ABqIBRBwABCACAREAIgASATOgBpIAFBwAA6AGggASAFNwNAIAEgBDcDOCABIAM3AzAgASAINwMoIAFCADcDICABIA03AxggASAONwMQIAEgDzcDCCABIBA3AwAgASABKQPoASABKQPIAYU3A2AgASABKQPgASABKQPAAYU3A1ggASABKQPYASABKQO4AYU3A1AgASABKQPQASABKQOwAYU3A0ggAkFgaiECIAdBf2oiBw0ACwsgAUEoaiEJQgAhCEGACSELIBNBCHJB/wFxIQoDQCABQbABaiABIAl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CJAUEAIAM3A7iJAUEAIAQ3A7CJAUEAIAU3A6iJAUEAIAY3A6CJAUEAIAM3A5iJAUEAIAQ3A5CJAUEAIAU3A4iJAUEAIAY3A4CJAUEAQQA6AJCKAUEAQQA7AYiKASAAEAMgAhAHCwsLAQBBgAgLBHgHAAA="; -var hash$h = "215d875f"; -var wasmJson$h = { - name: name$h, - data: data$h, - hash: hash$h -}; - -const mutex$i = new Mutex(); -let wasmCache$i = null; -function validateBits$2(bits) { - if (!Number.isInteger(bits) || bits < 8 || bits % 8 !== 0) { - return new Error("Invalid variant! Valid values: 8, 16, ..."); - } - return null; -} -/** - * Calculates BLAKE3 hash - * @param data Input data (string, Buffer or TypedArray) - * @param bits Number of output bits, which has to be a number - * divisible by 8. Defaults to 256. - * @param key Optional key (string, Buffer or TypedArray). Length should be 32 bytes. - * @returns Computed hash as a hexadecimal string - */ -function blake3(data, bits = 256, key = null) { - if (validateBits$2(bits)) { - return Promise.reject(validateBits$2(bits)); - } - let keyBuffer = null; - let initParam = 0; // key is empty by default - if (key !== null) { - keyBuffer = getUInt8Buffer(key); - if (keyBuffer.length !== 32) { - return Promise.reject(new Error("Key length must be exactly 32 bytes")); - } - initParam = 32; - } - const hashLength = bits / 8; - const digestParam = hashLength; - if (wasmCache$i === null || wasmCache$i.hashLength !== hashLength) { - return lockedCreate(mutex$i, wasmJson$h, hashLength).then((wasm) => { - wasmCache$i = wasm; - if (initParam === 32) { - wasmCache$i.writeMemory(keyBuffer); - } - return wasmCache$i.calculate(data, initParam, digestParam); - }); - } - try { - if (initParam === 32) { - wasmCache$i.writeMemory(keyBuffer); - } - const hash = wasmCache$i.calculate(data, initParam, digestParam); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } -} -/** - * Creates a new BLAKE3 hash instance - * @param bits Number of output bits, which has to be a number - * divisible by 8. Defaults to 256. - * @param key Optional key (string, Buffer or TypedArray). Length should be 32 bytes. - */ -function createBLAKE3(bits = 256, key = null) { - if (validateBits$2(bits)) { - return Promise.reject(validateBits$2(bits)); - } - let keyBuffer = null; - let initParam = 0; // key is empty by default - if (key !== null) { - keyBuffer = getUInt8Buffer(key); - if (keyBuffer.length !== 32) { - return Promise.reject(new Error("Key length must be exactly 32 bytes")); - } - initParam = 32; - } - const outputSize = bits / 8; - const digestParam = outputSize; - return WASMInterface(wasmJson$h, outputSize).then((wasm) => { - if (initParam === 32) { - wasm.writeMemory(keyBuffer); - } - wasm.init(initParam); - const obj = { - init: initParam === 32 - ? () => { - wasm.writeMemory(keyBuffer); - wasm.init(initParam); - return obj; - } - : () => { - wasm.init(initParam); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType, digestParam), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 64, - digestSize: outputSize, - }; - return obj; - }); -} - -var name$g = "crc32"; -var data$g = "AGFzbQEAAAABEQRgAAF/YAF/AGAAAGACf38AAwgHAAEBAQIAAwUEAQECAgYOAn8BQZDJBQt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQAAgtIYXNoX1VwZGF0ZQADCkhhc2hfRmluYWwABA1IYXNoX0dldFN0YXRlAAUOSGFzaF9DYWxjdWxhdGUABgpTVEFURV9TSVpFAwEKkggHBQBBgAkLwwMBA39BgIkBIQFBACECA0AgAUEAQQBBAEEAQQBBAEEAQQAgAkEBcWsgAHEgAkEBdnMiA0EBcWsgAHEgA0EBdnMiA0EBcWsgAHEgA0EBdnMiA0EBcWsgAHEgA0EBdnMiA0EBcWsgAHEgA0EBdnMiA0EBcWsgAHEgA0EBdnMiA0EBcWsgAHEgA0EBdnMiA0EBcWsgAHEgA0EBdnM2AgAgAUEEaiEBIAJBAWoiAkGAAkcNAAtBACEAA0AgAEGEkQFqIABBhIkBaigCACICQf8BcUECdEGAiQFqKAIAIAJBCHZzIgI2AgAgAE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hash$g = "d2eba587"; -var wasmJson$g = { - name: name$g, - data: data$g, - hash: hash$g -}; - -const mutex$h = new Mutex(); -let wasmCache$h = null; -function validatePoly(poly) { - if (!Number.isInteger(poly) || poly < 0 || poly > 0xffffffff) { - return new Error("Polynomial must be a valid 32-bit long unsigned integer"); - } - return null; -} -/** - * Calculates CRC-32 hash - * @param data Input data (string, Buffer or TypedArray) - * @param polynomial Input polynomial (defaults to 0xedb88320, for CRC32C use 0x82f63b78) - * @returns Computed hash as a hexadecimal string - */ -function crc32(data, polynomial = 0xedb88320) { - if (validatePoly(polynomial)) { - return Promise.reject(validatePoly(polynomial)); - } - if (wasmCache$h === null) { - return lockedCreate(mutex$h, wasmJson$g, 4).then((wasm) => { - wasmCache$h = wasm; - return wasmCache$h.calculate(data, polynomial); - }); - } - try { - const hash = wasmCache$h.calculate(data, polynomial); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } -} -/** - * Creates a new CRC-32 hash instance - * @param polynomial Input polynomial (defaults to 0xedb88320, for CRC32C use 0x82f63b78) - */ -function createCRC32(polynomial = 0xedb88320) { - if (validatePoly(polynomial)) { - return Promise.reject(validatePoly(polynomial)); - } - return WASMInterface(wasmJson$g, 4).then((wasm) => { - wasm.init(polynomial); - const obj = { - init: () => { - wasm.init(polynomial); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 4, - digestSize: 4, - }; - return obj; - }); -} - -var name$f = "crc64"; -var data$f = "AGFzbQEAAAABDANgAAF/YAAAYAF/AAMHBgABAgEAAQUEAQECAgYOAn8BQZCJBgt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQAAQtIYXNoX1VwZGF0ZQACCkhhc2hfRmluYWwAAw1IYXNoX0dldFN0YXRlAAQOSGF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iIhSEBIAJBAWohAiAAQX9qIQMLIABBAUYNAANAIAFC/wGDIAIxAACFp0EDdEGAiQFqKQMAIAFCCIiFIgFC/wGDIAJBAWoxAACFp0EDdEGAiQFqKQMAIAFCCIiFIQEgAkECaiECIANBfmoiAw0ACwtBACABQn+FNwOIiQILZAEBfkEAQQApA4iJAiIAQjiGIABCgP4Dg0IohoQgAEKAgPwHg0IYhiAAQoCAgPgPg0IIhoSEIABCCIhCgICA+A+DIABCGIhCgID8B4OEIABCKIhCgP4DgyAAQjiIhISENwOACQsGAEGIiQILAgALCwsBAEGACAsECAAAAA=="; -var hash$f = "c5ac6c16"; -var wasmJson$f = { - name: name$f, - data: data$f, - hash: hash$f -}; - -const mutex$g = new Mutex(); -let wasmCache$g = null; -const polyBuffer = new Uint8Array(8); -function parsePoly(poly) { - const errText = "Polynomial must be provided as a 16 char long hex string"; - if (typeof poly !== "string" || poly.length !== 16) { - return { hi: 0, lo: 0, err: new Error(errText) }; - } - const hi = Number(`0x${poly.slice(0, 8)}`); - const lo = Number(`0x${poly.slice(8)}`); - if (Number.isNaN(hi) || Number.isNaN(lo)) { - return { hi, lo, err: new Error(errText) }; - } - return { hi, lo, err: null }; -} -function writePoly(arr, lo, hi) { - // write in little-endian format - const buffer = new DataView(arr); - buffer.setUint32(0, lo, true); - buffer.setUint32(4, hi, true); -} -/** - * Calculates CRC-64 hash - * @param data Input data (string, Buffer or TypedArray) - * @param polynomial Input polynomial (defaults to 'c96c5795d7870f42' - ECMA) - * @returns Computed hash as a hexadecimal string - */ -function crc64(data, polynomial = "c96c5795d7870f42") { - const { hi, lo, err } = parsePoly(polynomial); - if (err !== null) { - return Promise.reject(err); - } - if (wasmCache$g === null) { - return lockedCreate(mutex$g, wasmJson$f, 8).then((wasm) => { - wasmCache$g = wasm; - writePoly(polyBuffer.buffer, lo, hi); - wasmCache$g.writeMemory(polyBuffer); - return wasmCache$g.calculate(data); - }); - } - try { - writePoly(polyBuffer.buffer, lo, hi); - wasmCache$g.writeMemory(polyBuffer); - const hash = wasmCache$g.calculate(data); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } -} -/** - * Creates a new CRC-64 hash instance - * @param polynomial Input polynomial (defaults to 'c96c5795d7870f42' - ECMA) - */ -function createCRC64(polynomial = "c96c5795d7870f42") { - const { hi, lo, err } = parsePoly(polynomial); - if (err !== null) { - return Promise.reject(err); - } - return WASMInterface(wasmJson$f, 8).then((wasm) => { - const instanceBuffer = new Uint8Array(8); - writePoly(instanceBuffer.buffer, lo, hi); - wasm.writeMemory(instanceBuffer); - wasm.init(); - const obj = { - init: () => { - wasm.writeMemory(instanceBuffer); - wasm.init(); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 8, - digestSize: 8, - }; - return obj; - }); -} - -var name$e = "md4"; -var data$e = "AGFzbQEAAAABEgRgAAF/YAAAYAF/AGACf38BfwMIBwABAgMBAAIFBAEBAgIGDgJ/AUGgigULfwBBgAgLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAJSGFzaF9Jbml0AAELSGFzaF9VcGRhdGUAAgpIYXNoX0ZpbmFsAAQNSGFzaF9HZXRTdGF0ZQAFDkhhc2hfQ2FsY3VsYXRlAAYKU1RBVEVfU0laRQMBCucUBwUAQYAJCy0AQQBC/rnrxemOlZkQNwKQiQFBAEKBxpS6lvHq5m83AoiJAUEAQgA3AoCJAQu+BQEHf0EAQQAoAoCJASIBIABqQf////8BcSICNgKAiQFBAEEAKAKEiQEgAiABSWogAEEddmo2AoSJAQJAAkACQAJAAkACQCABQT9xIgMNAEGACSEEDAELIABBwAAgA2siBUkNASAFQQNxIQZBACEBAkAgA0E/c0EDSQ0AIANBgIkBaiEEIAVB/ABxIQdBACEBA0AgBCABaiICQRhqIAFBgAlqLQAAOgAAIAJBGWog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DCASaiARIBNzIBVzakGh1+f2BmpBCXciEnNqQaHX5/YGakELdyITaiAUIBVqIBMgEnMgFyARaiASIBVzIBNzakGh1+f2BmpBD3ciEXNqQaHX5/YGakEDdyIVIBFzIAogEmogESATcyAVc2pBodfn9gZqQQl3IhJzakGh1+f2BmpBC3ciEyADaiEDIAkgEWogEiAVcyATc2pBodfn9gZqQQ93IARqIQQgEiACaiECIBUgBWohBSAAQcAAaiEAIAFBQGoiAQ0AC0EAIAI2ApSJAUEAIAM2ApCJAUEAIAQ2AoyJAUEAIAU2AoiJASAAC8gDAQV/QQAoAoCJAUE/cSIAQZiJAWpBgAE6AAAgAEEBaiEBAkACQAJAAkAgAEE/cyICQQdLDQAgAkUNASABQZiJAWpBADoAACACQQFGDQEgAEGaiQFqQQA6AAAgAkECRg0BIABBm4kBakEAOgAAIAJBA0YNASAAQZyJAWpBADoAACACQQRGDQEgAEGdiQFqQQA6AAAgAkEFRg0BIABBnokBakEAOgAAIAJBBkYNASAAQZ+JAWpBADoAAAwBCyACQQhGDQJBNiAAayIDIQQCQCACQQNxIgBFDQBBACAAayEEQQAhAANAIABBz4kBakEAOgAAIAQgAEF/aiIARw0ACyADIABqIQQLIANBA0kNAgwBC0GYiQFBwAAQAxpBACEBQTchBAsgAUGAiQFqIQBBfyECA0AgACAEakEVakEANgAAIABBfGohACAEIAJBBGoiAkcNAAsLQQBBACgChIkBNgLUiQFBAEEAKAKAiQEiAEEVdjoA04kBQQAgAEENdjoA0okBQQAgAEEFdjoA0YkBQQAgAEEDdCIAOgDQiQFBACAANgKAiQFBmIkBQcAAEAMaQQBBACkCiIkBNwOACUEAQQApApCJATcDiAkLBgBBgIkBCzMAQQBC/rnrxemOlZkQNwKQiQFBAEKBxpS6lvHq5m83AoiJAUEAQgA3AoCJASAAEAIQBAsLCwEAQYAICwSYAAAA"; -var hash$e = "bd8ce7c7"; -var wasmJson$e = { - name: name$e, - data: data$e, - hash: hash$e -}; - -const mutex$f = new Mutex(); -let wasmCache$f = null; -/** - * Calculates MD4 hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ -function md4(data) { - if (wasmCache$f === null) { - return lockedCreate(mutex$f, wasmJson$e, 16).then((wasm) => { - wasmCache$f = wasm; - return wasmCache$f.calculate(data); - }); - } - try { - const hash = wasmCache$f.calculate(data); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } -} -/** - * Creates a new MD4 hash instance - */ -function createMD4() { - return WASMInterface(wasmJson$e, 16).then((wasm) => { - wasm.init(); - const obj = { - init: () => { - wasm.init(); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 64, - digestSize: 16, - }; - return obj; - }); -} - -var name$d = "md5"; -var data$d = "AGFzbQEAAAABEgRgAAF/YAAAYAF/AGACf38BfwMIBwABAgMBAAIFBAEBAgIGDgJ/AUGgigULfwBBgAgLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAJSGFzaF9Jbml0AAELSGFzaF9VcGRhdGUAAgpIYXNoX0ZpbmFsAAQNSGFzaF9HZXRTdGF0ZQAFDkhhc2hfQ2FsY3VsYXRlAAYKU1RBVEVfU0laRQMBCoMaBwUAQYAJCy0AQQBC/rnrxemOlZkQNwKQiQFBAEKBxpS6lvHq5m83AoiJAUEAQgA3AoCJAQu+BQEHf0EAQQAoAoCJASIBIABqQf////8BcSICNgKAiQFBAEEAKAKEiQEgAiABSWogAEEddmo2AoSJAQJAAkACQAJAAkACQCABQT9xIgMNAEGACSEEDAELIABBwAAgA2siBUkNASAFQQNxIQZBACEBAkAgA0E/c0EDSQ0AIANBgIkBaiEEIAVB/ABxIQdBACEBA0AgBCABaiICQRhqIAFBgAlqLQAAOgAAIAJBGWogAUGBCWotAAA6AAAgAkEaaiABQYIJai0AADoAACACQRtqIAF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aiEFIABBwABqIQAgAUFAaiIBDQALQQAgAjYClIkBQQAgAzYCkIkBQQAgBDYCjIkBQQAgBTYCiIkBIAALyAMBBX9BACgCgIkBQT9xIgBBmIkBakGAAToAACAAQQFqIQECQAJAAkACQCAAQT9zIgJBB0sNACACRQ0BIAFBmIkBakEAOgAAIAJBAUYNASAAQZqJAWpBADoAACACQQJGDQEgAEGbiQFqQQA6AAAgAkEDRg0BIABBnIkBakEAOgAAIAJBBEYNASAAQZ2JAWpBADoAACACQQVGDQEgAEGeiQFqQQA6AAAgAkEGRg0BIABBn4kBakEAOgAADAELIAJBCEYNAkE2IABrIgMhBAJAIAJBA3EiAEUNAEEAIABrIQRBACEAA0AgAEHPiQFqQQA6AAAgBCAAQX9qIgBHDQALIAMgAGohBAsgA0EDSQ0CDAELQZiJAUHAABADGkEAIQFBNyEECyABQYCJAWohAEF/IQIDQCAAIARqQRVqQQA2AAAgAEF8aiEAIAQgAkEEaiICRw0ACwtBAEEAKAKEiQE2AtSJAUEAQQAoAoCJASIAQRV2OgDTiQFBACAAQQ12OgDSiQFBACAAQQV2OgDRiQFBACAAQQN0IgA6ANCJAUEAIAA2AoCJAUGYiQFBwAAQAxpBAEEAKQKIiQE3A4AJQQBBACkCkIkBNwOICQsGAEGAiQELMwBBAEL+uevF6Y6VmRA3ApCJAUEAQoHGlLqW8ermbzcCiIkBQQBCADcCgIkBIAAQAhAECwsLAQBBgAgLBJgAAAA="; -var hash$d = "e6508e4b"; -var wasmJson$d = { - name: name$d, - data: data$d, - hash: hash$d -}; - -const mutex$e = new Mutex(); -let wasmCache$e = null; -/** - * Calculates MD5 hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ -function md5(data) { - if (wasmCache$e === null) { - return lockedCreate(mutex$e, wasmJson$d, 16).then((wasm) => { - wasmCache$e = wasm; - return wasmCache$e.calculate(data); - }); - } - try { - const hash = wasmCache$e.calculate(data); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } -} -/** - * Creates a new MD5 hash instance - */ -function createMD5() { - return WASMInterface(wasmJson$d, 16).then((wasm) => { - wasm.init(); - const obj = { - init: () => { - wasm.init(); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 64, - digestSize: 16, - }; - return obj; - }); -} - -var name$c = "sha1"; -var data$c = "AGFzbQEAAAABEQRgAAF/YAF/AGAAAGACf38AAwkIAAECAwECAAEFBAEBAgIGDgJ/AUHgiQULfwBBgAgLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAJSGFzaF9Jbml0AAILSGFzaF9VcGRhdGUABApIYXNoX0ZpbmFsAAUNSGFzaF9HZXRTdGF0ZQAGDkhhc2hfQ2FsY3VsYXRlAAcKU1RBVEVfU0laRQMBCpoqCAUAQYAJC68iCgF+An8BfgF/AX4DfwF+AX8Bfkd/QQAgACkDECIBQiCIpyICQRh0IAJBgP4DcUEIdHIgAUIoiKdBgP4DcSABQjiIp3JyIgMgACkDCCIEQiCIpyICQRh0IAJBgP4DcUEIdHIgBEIoiKdBgP4DcSAEQjiIp3JyIgVzIAApAygiBkIgiKciAkEYdCACQYD+A3FBCHRyIAZCKIinQYD+A3EgBkI4iKdyciIHcyAEpyICQRh0IAJBgP4DcUEIdHIgAkEIdkGA/gNxIAJBGHZyciIIIAApAwAiBKciAkEYdCACQYD+A3FBCHRyIAJBCHZBgP4DcSACQRh2cnIiCXMgACkDICIKpyICQRh0IAJBgP4DcUEIdHIgAkEIdkGA/gNxIAJBGHZyciILcyAAKQMwIgxCIIinIgJBGHQgAkGA/gNxQQh0ciAMQiiIp0GA/gNxIAxCOIincnIiAnNBAXciDXNBAXciDiAFIARCIIinIg9BGHQgD0GA/gNxQQh0ciAEQiiIp0GA/gNxIARCOIincnIiEHMgCkIgiKciD0EYdCAP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QV3akHc+e74eGoiDkEedyIPaiA1IABBHnciAGogKyASaiANIAByIAJxIA0gAHFyaiAOQQV3akHc+e74eGoiEiAPciANQR53Ig1xIBIgD3FyaiAwIAJqIA4gDXIgAHEgDiANcXJqIBJBBXdqQdz57vh4aiIAQQV3akHc+e74eGoiAiAAQR53Ig5yIBJBHnciEnEgAiAOcXJqICwgDWogACASciAPcSAAIBJxcmogAkEFd2pB3Pnu+HhqIgBBBXdqQdz57vh4aiINQR53Ig9qIDwgAkEedyICaiA2IBJqIAAgAnIgDnEgACACcXJqIA1BBXdqQdz57vh4aiISIA9yIABBHnciAHEgEiAPcXJqIC0gDmogDSAAciACcSANIABxcmogEkEFd2pB3Pnu+HhqIgJBBXdqQdz57vh4aiINIAJBHnciDnIgEkEedyIScSANIA5xcmogNyAAaiACIBJyIA9xIAIgEnFyaiANQQV3akHc+e74eGoiAEEFd2pB3Pnu+HhqIgJBHnciD2ogMyANQR53Ig1qID0gEmogACANciAOcSAAIA1xcmogAkEFd2pB3Pnu+HhqIhIgD3IgAEEedyIAcSASIA9xcmogOCAOaiACIAByIA1xIAIgAHFyaiASQQV3akHc+e74eGoiAkEFd2pB3Pnu+HhqIg0gAkEedyIOciASQR53IhJxIA0gDnFyaiBCIABqIAIgEnIgD3EgAiAScXJqIA1BBXdqQdz57vh4aiIAQQV3akHc+e74eGoiAkEedyIPaiBDIA5qIAIgAEEedyIUciANQR53Ig1xIAIgFHFyaiA+IBJqIAAgDXIgDnEgACANcXJqIAJBBXdqQdz57vh4aiIAQQV3akHc+e74eGoiAkEedyISIABBHnciDnMgOiANaiAAIA9yIBRxIAAgD3FyaiACQQV3akHc+e74eGoiAHNqID8gFGogAiAOciAPcSACIA5xcmogAEEFd2pB3Pnu+HhqIgJBBXdqQdaDi9N8aiINQR53Ig9qIEogEmogAkEedyIUIABBHnciAHMgDXNqIDsgDmogACAScyACc2ogDUEFd2pB1oOL03xqIgJBBXdqQdaDi9N8aiINQR53Ig4gAkEedyIScyBFIABq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ngw3ApCJAUEAQQA2ApiJAUGACSAAEAMQBQsLCwEAQYAICwRcAAAA"; -var hash$c = "6b530c24"; -var wasmJson$c = { - name: name$c, - data: data$c, - hash: hash$c -}; - -const mutex$d = new Mutex(); -let wasmCache$d = null; -/** - * Calculates SHA-1 hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ -function sha1(data) { - if (wasmCache$d === null) { - return lockedCreate(mutex$d, wasmJson$c, 20).then((wasm) => { - wasmCache$d = wasm; - return wasmCache$d.calculate(data); - }); - } - try { - const hash = wasmCache$d.calculate(data); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } -} -/** - * Creates a new SHA-1 hash instance - */ -function createSHA1() { - return WASMInterface(wasmJson$c, 20).then((wasm) => { - wasm.init(); - const obj = { - init: () => { - wasm.init(); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 64, - digestSize: 20, - }; - return obj; - }); -} - -var name$b = "sha3"; -var data$b = "AGFzbQEAAAABFARgAAF/YAF/AGACf38AYAN/f38AAwgHAAEBAgEAAwUEAQECAgYOAn8BQZCNBQt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQAAQtIYXNoX1VwZGF0ZQACCkhhc2hfRmluYWwABA1IYXNoX0dldFN0YXRlAAUOSGFzaF9DYWxjdWxhdGUABgpTVEFURV9TSVpFAwEKpBwHBQBBgAoL1wMAQQBCADcDgI0BQQBCADcD+IwBQQBCADcD8IwBQQBCADcD6IwBQQBCADcD4IwBQQBCADcD2IwBQQBCADcD0IwBQQBCADcDyIwBQQBCADcDwIwBQQBCADcDuIwBQQBCADcDsIwBQQBCADcDqIwBQQBCADcDoIwBQQBCADcDmIwBQQBCADcDkIwBQQBCADcDiIwBQQBC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FQQAhBAJAIAFBf2pBA0kNACABQfz///8DcSEAQQAhAUEAIQQDQCABQYAKaiABQYCKAWooAgA2AgAgAUGECmogAUGEigFqKAIANgIAIAFBiApqIAFBiIoBaigCADYCACABQYwKaiABQYyKAWooAgA2AgAgAUEQaiEBIAAgBEEEaiIERw0ACwsgBUUNACAFQQJ0IQAgBEECdCEBA0AgAUGACmogAUGAigFqKAIANgIAIAFBBGohASAAQXxqIgANAAsLCwvYAQEAQYAIC9ABkAEAAAAAAAAAAAAAAAAAAAEAAAAAAAAAgoAAAAAAAACKgAAAAAAAgACAAIAAAACAi4AAAAAAAAABAACAAAAAAIGAAIAAAACACYAAAAAAAICKAAAAAAAAAIgAAAAAAAAACYAAgAAAAAAKAACAAAAAAIuAAIAAAAAAiwAAAAAAAICJgAAAAAAAgAOAAAAAAACAAoAAAAAAAICAAAAAAAAAgAqAAAAAAAAACgAAgAAAAICBgACAAAAAgICAAAAAAACAAQAAgAAAAAAIgACAAAAAgA=="; -var hash$b = "fb24e536"; -var wasmJson$b = { - name: name$b, - data: data$b, - hash: hash$b -}; - -const mutex$c = new Mutex(); -let wasmCache$c = null; -function validateBits$1(bits) { - if (![224, 256, 384, 512].includes(bits)) { - return new Error("Invalid variant! Valid values: 224, 256, 384, 512"); - } - return null; -} -/** - * Calculates SHA-3 hash - * @param data Input data (string, Buffer or TypedArray) - * @param bits Number of output bits. Valid values: 224, 256, 384, 512 - * @returns Computed hash as a hexadecimal string - */ -function sha3(data, bits = 512) { - if (validateBits$1(bits)) { - return Promise.reject(validateBits$1(bits)); - } - const hashLength = bits / 8; - if (wasmCache$c === null || wasmCache$c.hashLength !== hashLength) { - return lockedCreate(mutex$c, wasmJson$b, hashLength).then((wasm) => { - wasmCache$c = wasm; - return wasmCache$c.calculate(data, bits, 0x06); - }); - } - try { - const hash = wasmCache$c.calculate(data, bits, 0x06); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } -} -/** - * Creates a new SHA-3 hash instance - * @param bits Number of output bits. Valid values: 224, 256, 384, 512 - */ -function createSHA3(bits = 512) { - if (validateBits$1(bits)) { - return Promise.reject(validateBits$1(bits)); - } - const outputSize = bits / 8; - return WASMInterface(wasmJson$b, outputSize).then((wasm) => { - wasm.init(bits); - const obj = { - init: () => { - wasm.init(bits); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType, 0x06), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 200 - 2 * outputSize, - digestSize: outputSize, - }; - return obj; - }); -} - -const mutex$b = new Mutex(); -let wasmCache$b = null; -function validateBits(bits) { - if (![224, 256, 384, 512].includes(bits)) { - return new Error("Invalid variant! Valid values: 224, 256, 384, 512"); - } - return null; -} -/** - * Calculates Keccak hash - * @param data Input data (string, Buffer or TypedArray) - * @param bits Number of output bits. Valid values: 224, 256, 384, 512 - * @returns Computed hash as a hexadecimal string - */ -function keccak(data, bits = 512) { - if (validateBits(bits)) { - return Promise.reject(validateBits(bits)); - } - const hashLength = bits / 8; - if (wasmCache$b === null || wasmCache$b.hashLength !== hashLength) { - return lockedCreate(mutex$b, wasmJson$b, hashLength).then((wasm) => { - wasmCache$b = wasm; - return wasmCache$b.calculate(data, bits, 0x01); - }); - } - try { - const hash = wasmCache$b.calculate(data, bits, 0x01); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } -} -/** - * Creates a new Keccak hash instance - * @param bits Number of output bits. Valid values: 224, 256, 384, 512 - */ -function createKeccak(bits = 512) { - if (validateBits(bits)) { - return Promise.reject(validateBits(bits)); - } - const outputSize = bits / 8; - return WASMInterface(wasmJson$b, outputSize).then((wasm) => { - wasm.init(bits); - const obj = { - init: () => { - wasm.init(bits); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType, 0x01), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 200 - 2 * outputSize, - digestSize: outputSize, - }; - return obj; - }); -} - -var name$a = "sha256"; -var data$a = "AGFzbQEAAAABEQRgAAF/YAF/AGAAAGACf38AAwgHAAEBAQIAAwUEAQECAgYOAn8BQfCJBQt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQAAQtIYXNoX1VwZGF0ZQACCkhhc2hfRmluYWwABA1IYXNoX0dldFN0YXRlAAUOSGFzaF9DYWxjdWxhdGUABgpTVEFURV9TSVpFAwEKnEoHBQBBgAkLnQEAQQBCADcDwIkBQQBBHEEgIABB4AFGIgAbNgLoiQFBAEKnn+anxvST/b5/Qquzj/yRo7Pw2wAgABs3A+CJAUEAQrGWgP6fooWs6ABC/6S5iMWR2oKbfyAAGzcD2IkBQQBCl7rDg5Onlod3QvLmu+Ojp/2npX8gABs3A9CJAUEAQti9loj8oLW+NkLnzKfQ1tDrs7t/IAAbNwPIiQEL7wICAX4Gf0EAQQApA8CJASIBIACtfDcDwIkBAkACQAJAIAGnQT9xIgINAEGACSEDDAELAkBBwAAgAmsiBCAAIAQgAEkbIgNFDQAgA0EDcSEFIAJBgIkBaiEGQQAhAgJAIANBBEkNACADQfwAcSEHQQAhAgNAIAYgAmoiAyACQYAJai0AADoAACADQQFqIAJBgQlqLQAAOgAAIANBAmogAkGCCWotAAA6AAAgA0EDaiACQYMJai0AADoAACAHIAJBBGoiAkcNAAsLIAVFDQADQCAGIAJqIAJBgAlqLQAAOgAAIAJBAWohAiAFQX9qIgUNAAsLIAAgBEkNAUGAiQEQAyAAIARrIQAgBEGACWohAwsCQCAAQcAASQ0AA0AgAxADIANBwABqIQMgAEFAaiIAQT9LDQALCyAARQ0AQQAhAkEAIQUDQCACQYCJAWogAyACai0AADoAACACQQFqIQIgACAFQQFqIgVB/wFxSw0ACwsLoz4BRX9BACAAKAI8IgFBGHQgAUGA/gNxQQh0ci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ThHDQALC0EAIQFBAEEAKQPAiQEiBKciAEEbdCAAQQt0QYCA/AdxciAAQQV2QYD+A3EgAEEDdEEYdnJyNgK8iQFBACAEQh2IpyIAQRh0IABBgP4DcUEIdHIgAEEIdkGA/gNxIABBGHZycjYCuIkBQYCJARADQQBBACgC5IkBIgBBGHQgAEGA/gNxQQh0ciAAQQh2QYD+A3EgAEEYdnJyNgLkiQFBAEEAKALgiQEiAEEYdCAAQYD+A3FBCHRyIABBCHZBgP4DcSAAQRh2cnI2AuCJAUEAQQAoAtyJASIAQRh0IABBgP4DcUEIdHIgAEEIdkGA/gNxIABBGHZycjYC3IkBQQBBACgC2IkBIgBBGHQgAEGA/gNxQQh0ciAAQQh2QYD+A3EgAEEYdnJyNgLYiQFBAEEAKALUiQEiAEEYdCAAQYD+A3FBCHRyIABBCHZBgP4DcSAAQRh2cnI2AtSJAUEAQQAoAtCJASIAQRh0IABBgP4DcUEIdHIgAEEIdkGA/gNxIABBGHZycjYC0IkBQQBBACgCzIkBIgBBGHQgAEGA/gNxQQh0ciAAQQh2QYD+A3EgAEEYdnJyNgLMiQFBAEEAKALIiQEiAEEYdCAAQYD+A3FBCHRyIABBCHZBgP4DcSAAQRh2cnI2AsiJAQJAQQAoAuiJASICRQ0AQQAhAANAIAFBgAlqIAFByIkBai0AADoAACABQQFqIQEgAiAAQQFqIgBB/wFxSw0ACwsLBgBBgIkBC6MBAEEAQgA3A8CJAUEAQRxBICABQeABRiIBGzYC6IkBQQBCp5/mp8b0k/2+f0Krs4/8kaOz8NsAIAEbNwPgiQFBAEKxloD+n6KFrOgAQv+kuYjFkdqCm38gARs3A9iJAUEAQpe6w4OTp5aHd0Ly5rvjo6f9p6V/IAEbNwPQiQFBAELYvZaI/KC1vjZC58yn0NbQ67O7fyABGzcDyIkBIAAQAhAECwsLAQBBgAgLBHAAAAA="; -var hash$a = "8c18dd94"; -var wasmJson$a = { - name: name$a, - data: data$a, - hash: hash$a -}; - -const mutex$a = new Mutex(); -let wasmCache$a = null; -/** - * Calculates SHA-2 (SHA-224) hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ -function sha224(data) { - if (wasmCache$a === null) { - return lockedCreate(mutex$a, wasmJson$a, 28).then((wasm) => { - wasmCache$a = wasm; - return wasmCache$a.calculate(data, 224); - }); - } - try { - const hash = wasmCache$a.calculate(data, 224); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } -} -/** - * Creates a new SHA-2 (SHA-224) hash instance - */ -function createSHA224() { - return WASMInterface(wasmJson$a, 28).then((wasm) => { - wasm.init(224); - const obj = { - init: () => { - wasm.init(224); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 64, - digestSize: 28, - }; - return obj; - }); -} - -const mutex$9 = new Mutex(); -let wasmCache$9 = null; -/** - * Calculates SHA-2 (SHA-256) hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ -function sha256(data) { - if (wasmCache$9 === null) { - return lockedCreate(mutex$9, wasmJson$a, 32).then((wasm) => { - wasmCache$9 = wasm; - return wasmCache$9.calculate(data, 256); - }); - } - try { - const hash = wasmCache$9.calculate(data, 256); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } -} -/** - * Creates a new SHA-2 (SHA-256) hash instance - */ -function createSHA256() { - return WASMInterface(wasmJson$a, 32).then((wasm) => { - wasm.init(256); - const obj = { - init: () => { - wasm.init(256); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 64, - digestSize: 32, - }; - return obj; - }); -} - -var name$9 = "sha512"; -var data$9 = "AGFzbQEAAAAB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QgiIQoCAgPgPgyAAQhiIQoCA/AeDhCAAQiiIQoD+A4MgAEI4iISEhDcDoIoBQQBBACkDmIoBIgBCOIYgAEKA/gODQiiGhCAAQoCA/AeDQhiGIABCgICA+A+DQgiGhIQgAEIIiEKAgID4D4MgAEIYiEKAgPwHg4QgAEIoiEKA/gODIABCOIiEhIQ3A5iKAUEAQQApA5CKASIAQjiGIABCgP4Dg0IohoQgAEKAgPwHg0IYhiAAQoCAgPgPg0IIhoSEIABCCIhCgICA+A+DIABCGIhCgID8B4OEIABCKIhCgP4DgyAAQjiIhISENwOQigFBAEEAKQOIigEiAEI4hiAAQoD+A4NCKIaEIABCgID8B4NCGIYgAEKAgID4D4NCCIaEhCAAQgiIQoCAgPgPgyAAQhiIQoCA/AeDhCAAQiiIQoD+A4MgAEI4iISEhDcDiIoBAkBBACgCyIoBIgNFDQBBACECA0AgAUGACWogAUGIigFqLQAAOgAAIAFBAWohASADIAJBAWoiAkH/AXFLDQALCwsGAEGAiQELoQIAQQBCADcDgIoBQQBBMEHAACABQYADRiIBGzYCyIoBQQBCpJ/p99uD0trHAEL5wvibkaOz8NsAIAEbNwPAigFBAEKnn+an1sGLhltC6/qG2r+19sEfIAEbNwO4igFBAEKRquDC9tCS2o5/Qp/Y+dnCkdqCm38gARs3A7CKAUEAQrGWgP7/zMmZ5wBC0YWa7/rPlIfRACABGzcDqIoBQQBCubK5uI+b+5cVQvHt9Pilp/2npX8gARs3A6CKAUEAQpe6w4Ojq8CskX9Cq/DT9K/uvLc8IAEbNwOYigFBAEKHqvOzo6WKzeIAQrvOqqbY0Ouzu38gARs3A5CKAUEAQti9lojcq+fdS0KIkvOd/8z5hOoAIAEbNwOIigEgABACEAQLCwsBAEGACAsE0AAAAA=="; -var hash$9 = "f2e40eb1"; -var wasmJson$9 = { - name: name$9, - data: data$9, - hash: hash$9 -}; - -const mutex$8 = new Mutex(); -let wasmCache$8 = null; -/** - * Calculates SHA-2 (SHA-384) hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ -function sha384(data) { - if (wasmCache$8 === null) { - return lockedCreate(mutex$8, wasmJson$9, 48).then((wasm) => { - wasmCache$8 = wasm; - return wasmCache$8.calculate(data, 384); - }); - } - try { - const hash = wasmCache$8.calculate(data, 384); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } -} -/** - * Creates a new SHA-2 (SHA-384) hash instance - */ -function createSHA384() { - return WASMInterface(wasmJson$9, 48).then((wasm) => { - wasm.init(384); - const obj = { - init: () => { - wasm.init(384); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 128, - digestSize: 48, - }; - return obj; - }); -} - -const mutex$7 = new Mutex(); -let wasmCache$7 = null; -/** - * Calculates SHA-2 (SHA-512) hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ -function sha512(data) { - if (wasmCache$7 === null) { - return lockedCreate(mutex$7, wasmJson$9, 64).then((wasm) => { - wasmCache$7 = wasm; - return wasmCache$7.calculate(data, 512); - }); - } - try { - const hash = wasmCache$7.calculate(data, 512); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } -} -/** - * Creates a new SHA-2 (SHA-512) hash instance - */ -function createSHA512() { - return WASMInterface(wasmJson$9, 64).then((wasm) => { - wasm.init(512); - const obj = { - init: () => { - wasm.init(512); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 128, - digestSize: 64, - }; - return obj; - }); -} - -var name$8 = "xxhash32"; -var data$8 = "AGFzbQEAAAABEQRgAAF/YAF/AGAAAGACf38AAwcGAAEBAgADBQQBAQICBg4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asmJson$8 = { - name: name$8, - data: data$8, - hash: hash$8 -}; - -const mutex$6 = new Mutex(); -let wasmCache$6 = null; -function validateSeed$3(seed) { - if (!Number.isInteger(seed) || seed < 0 || seed > 0xffffffff) { - return new Error("Seed must be a valid 32-bit long unsigned integer."); - } - return null; -} -/** - * Calculates xxHash32 hash - * @param data Input data (string, Buffer or TypedArray) - * @param seed Number used to initialize the internal state of the algorithm (defaults to 0) - * @returns Computed hash as a hexadecimal string - */ -function xxhash32(data, seed = 0) { - if (validateSeed$3(seed)) { - return Promise.reject(validateSeed$3(seed)); - } - if (wasmCache$6 === null) { - return lockedCreate(mutex$6, wasmJson$8, 4).then((wasm) => { - wasmCache$6 = wasm; - return wasmCache$6.calculate(data, seed); - }); - } - try { - const hash = wasmCache$6.calculate(data, seed); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } -} -/** - * Creates a new xxHash32 hash instance - * @param data Input data (string, Buffer or TypedArray) - * @param seed Number used to initialize the internal state of the algorithm (defaults to 0) - */ -function createXXHash32(seed = 0) { - if (validateSeed$3(seed)) { - return Promise.reject(validateSeed$3(seed)); - } - return WASMInterface(wasmJson$8, 4).then((wasm) => { - wasm.init(seed); - const obj = { - init: () => { - wasm.init(seed); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 16, - digestSize: 4, - }; - return obj; - }); -} - -var name$7 = "xxhash64"; -var data$7 = "AGFzbQEAAAABDANgAAF/YAAAYAF/AAMHBgABAgEAAQUEAQECAgYOAn8BQdCJBQt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQAAQtIYXNoX1VwZGF0ZQACCkhhc2hfRmluYWwAAw1IYXNoX0dldFN0YXRlAAQOSGFzaF9DYWxjdWxhdGUABQpTVEFURV9T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oiQEhBSAJQQhJDQELA0AgBikDAELP1tO+0ser2UJ+Qh+JQoeVr6+Ytt6bnn9+IAUpAwBCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/fiAAhUIbiUKHla+vmLbem55/fkLj3MqV/M7y9YV/fIVCG4lCh5Wvr5i23puef35C49zKlfzO8vWFf3whACAGQQhqIQUgBkEQaiIGIAhNDQALIAZBeGohBQsCQAJAIAVBBGoiCSAITQ0AIAUhCQwBCyAFNQIAQoeVr6+Ytt6bnn9+IACFQheJQs/W077Sx6vZQn5C+fPd8Zn2masWfCEACwJAIAkgCEYNACAHQZ+JAWohBQJAAkAgByAJa0EBcQ0AIAkhBgwBCyAJQQFqIQYgCTEAAELFz9my8eW66id+IACFQguJQoeVr6+Ytt6bnn9+IQALIAUgCUYNAANAIAZBAWoxAABCxc/ZsvHluuonfiAGMQAAQsXP2bLx5brqJ34gAIVCC4lCh5Wvr5i23puef36FQguJQoeVr6+Ytt6bnn9+IQAgBkECaiIGIAhHDQALC0EAIABCIYggAIVCz9bTvtLHq9lCfiIAQh2IIACFQvnz3fGZ9pmrFn4iAEIgiCAAhSIBQjiGIAFCgP4Dg0IohoQgAUKAgPwHg0IYhiABQoCAgPgPg0IIhoSEIABCCIhCgICA+A+DIABCGIhCgID8B4OEIABCKIhCgP4DgyAAQjiIhISENwOACQsGAEGAiQELAgALCwsBAEGACAsEUAAAAA=="; -var hash$7 = "177fbfa3"; -var wasmJson$7 = { - name: name$7, - data: data$7, - hash: hash$7 -}; - -const mutex$5 = new Mutex(); -let wasmCache$5 = null; -const seedBuffer$2 = new Uint8Array(8); -function validateSeed$2(seed) { - if (!Number.isInteger(seed) || seed < 0 || seed > 0xffffffff) { - return new Error("Seed must be given as two valid 32-bit long unsigned integers (lo + high)."); - } - return null; -} -function writeSeed$2(arr, low, high) { - // write in little-endian format - const buffer = new DataView(arr); - buffer.setUint32(0, low, true); - buffer.setUint32(4, high, true); -} -/** - * Calculates xxHash64 hash - * @param data Input data (string, Buffer or TypedArray) - * @param seedLow Lower 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @param seedHigh Higher 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @returns Computed hash as a hexadecimal string - */ -function xxhash64(data, seedLow = 0, seedHigh = 0) { - if (validateSeed$2(seedLow)) { - return Promise.reject(validateSeed$2(seedLow)); - } - if (validateSeed$2(seedHigh)) { - return Promise.reject(validateSeed$2(seedHigh)); - } - if (wasmCache$5 === null) { - return lockedCreate(mutex$5, wasmJson$7, 8).then((wasm) => { - wasmCache$5 = wasm; - writeSeed$2(seedBuffer$2.buffer, seedLow, seedHigh); - wasmCache$5.writeMemory(seedBuffer$2); - return wasmCache$5.calculate(data); - }); - } - try { - writeSeed$2(seedBuffer$2.buffer, seedLow, seedHigh); - wasmCache$5.writeMemory(seedBuffer$2); - const hash = wasmCache$5.calculate(data); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } -} -/** - * Creates a new xxHash64 hash instance - * @param seedLow Lower 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @param seedHigh Higher 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - */ -function createXXHash64(seedLow = 0, seedHigh = 0) { - if (validateSeed$2(seedLow)) { - return Promise.reject(validateSeed$2(seedLow)); - } - if (validateSeed$2(seedHigh)) { - return Promise.reject(validateSeed$2(seedHigh)); - } - return WASMInterface(wasmJson$7, 8).then((wasm) => { - const instanceBuffer = new Uint8Array(8); - writeSeed$2(instanceBuffer.buffer, seedLow, seedHigh); - wasm.writeMemory(instanceBuffer); - wasm.init(); - const obj = { - init: () => { - wasm.writeMemory(instanceBuffer); - wasm.init(); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 32, - digestSize: 8, - }; - return obj; - }); -} - -var name$6 = "xxhash3"; -var data$6 = "AGFzbQEAAAABNAhgAAF/YAR/f39/AGAHf39/f39/fwBgBH9+fn4BfmAEf39/fgF+YAN/f34BfmAAAGABfwADDg0AAQIDBAUFBQYHBgAGBQQBAQICBg4CfwFBwI4FC38AQcAJCwdwCAZtZW1vcnkCAA5IYXNoX0dldEJ1ZmZlcgAACUhhc2hfSW5pdAAIC0hhc2hfVXBkYXRlAAkKSGFzaF9GaW5hbAAKDUhhc2hfR2V0U3RhdGUACw5IYXNoX0NhbGN1bGF0ZQAMClNUQVRFX1NJWkUDAQr6QQ0FAEGACgvkAwMPfgF/AX4CQCADRQ0AIAApAzAhBCAAKQM4IQUgACkDICEGIAApAyghByAAKQMQIQggACkDGCEJIAApAwAhCiAAKQMIIQsDQCAFIAFBMGopAwAiDHwgAkE4aikDACABQThqKQMAIg2FIgVCIIggBUL/////D4N+fCEFIAcgAUEgaikDACIOfCACQShqKQMAIAFBKGopAwAiD4UiB0IgiCAHQv////8Pg358IQcgCSABQRBqKQMAIhB8IAJBGGopAwAgAUEYaikDACIRhSIJQiCIIAlC/////w+DfnwhCSALIAEpAwAiEnwgAkEIaiITKQMAIAFBCGopAwAiFIUiC0IgiCALQv////8Pg358IQsgAkEwaikDACAMhSIMQiCIIAxC/////w+DfiAEfCANfCEEIAJBIGopAwAgDoUiDEIgiCAMQv////8Pg34gBnwgD3whBiACQRBqKQMAIBCFIgxCIIggDEL/////D4N+IAh8IBF8IQggAikDACAShSIMQiCIIAxC/////w+DfiAKfCAUfCEKIAFBwABqIQEgEyECIANBf2oiAw0ACyAAIAk3AxggACAKNwMAIAAgCzcDCCAAIAc3AyggACAINwMQIAAgBTcDOCAAIAY3AyAgACAENwMwCwveAgIBfwF+AkAgBCACIAEoAgAiB2siAkkNACAAIAMgBSAHQQN0aiACEAEgACAFIAZqIgcpAwAgACkDACIIQi+IhSAIhUKx893xCX43AwAgACAHKQMIIAApAwgiCEIviIUgCIVCsfPd8Ql+NwMIIAAgBykDECAAK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tO+0ser2UJ+IgNCHYggA4VC+fPd8Zn2masWfiIDQiCIIAOFC94IAQZ+IACtQoeVr6+Ytt6bnn9+IQMCQCAAQSFJDQACQCAAQcEASQ0AAkAgAEHhAEkNACABKQNoIAJ9QQApA7iMAYUiBEL/////D4MiBSABKQNgIAJ8QQApA7CMAYUiBkIgiCIHfiIIQv////8PgyAEQiCIIgQgBkL/////D4MiBn58IAUgBn4iBUIgiHwiBkIghiAFQv////8Pg4QgCEIgiCAEIAd+fCAGQiCIfIUgA3wgASkDeCACfSAAQciLAWopAwCFIgNC/////w+DIgQgASkDcCACfCAAQcCLAWopAwCFIgVCIIgiBn4iB0L/////D4MgA0IgiCIDIAVC/////w+DIgV+fCAEIAV+IgRCIIh8IgVCIIYgBEL/////D4OEIAdCIIggAyAGfnwgBUIgiHyFfCEDCyABKQNIIAJ9QQApA6iMAYUiBEL/////D4MiBSABKQNAIAJ8QQApA6CMAYUiBkIgiCIHfiIIQv////8PgyAEQiCIIgQgBkL/////D4MiBn58IAUgBn4iBUIgiHwiBkIghiAFQv////8Pg4QgCEIgiCAEIAd+fCAGQiCIfIUgA3wgASkDWCACfSAAQdiLAWopAwCFIgNC/////w+DIgQgASkDUCACfCAAQdCLAWopAwCFIgVCIIgiBn4iB0L/////D4MgA0IgiCIDIAVC/////w+DIgV+fCAEIAV+IgRCIIh8IgVCIIYgBEL/////D4OEIAdCIIggAyAGfnwgBUIgiHyFfCEDCyABKQMoIAJ9QQApA5iMAYUiBEL/////D4MiBSABKQMgIAJ8QQApA5CMAYUiBkIgiCIHfiIIQv////8PgyAEQiCIIgQgBkL/////D4MiBn58IAUgBn4iBUIgiHwiBkIghiAFQv////8Pg4QgCEIgiCAEIAd+fCAGQiCIfIUgA3wgASkDOCACfSAAQeiLAWopAwCFIgNC/////w+DIgQgASkDMCACfCAAQeCLAWopAwCFIgVCIIgiBn4iB0L/////D4MgA0IgiCIDIAVC/////w+DIgV+fCAEIAV+IgRCIIh8IgVCIIYgBEL/////D4OEIAdCIIggAyAGfnwgBUIgiHyFfCEDCyABKQMIIAJ9QQApA4iMAYUiBEL/////D4MiBSABKQMAIAJ8QQApA4CMAYUiBkIgiCIHfiIIQv////8PgyAEQiCIIgQgBkL/////D4MiBn58IAUgBn4iBUIgiHwiBkIghiAFQv////8Pg4QgCEIgiCAEIAd+fCAGQiCIfIUgA3wgASkDGCACfSAAQfiLAWopAwCFIgNC/////w+DIgQgASkDECACfCAAQfCLAWopAwCFIgJCIIgiBX4iBkL/////D4MgA0IgiCIDIAJC/////w+DIgJ+fCAEIAJ+IgJCIIh8IgRCIIYgAkL/////D4OEIAZCIIggAyAFfnwgBEIgiHyFfCICQiWIIAKFQvnz3fGZ8pmrFn4iAkIgiCAChQv8CgQBfwV+An8BfkEAIQMgASkDeCACfUEAKQP4jAGFIgRC/////w+DIgUgASkDcCACfEEAKQPwjAGFIgZCIIgiB34iCEL/////D4MgBEIgiCIEIAZC/////w+DIgZ+fCAFIAZ+IgVCIIh8IgZCIIYgBUL/////D4OEIAhCIIggBCAHfnwgBkIgiHyFIAEpA2ggAn1BACkD6IwBhSIEQv////8PgyIFIAEpA2AgAnxBACkD4IwBhSIGQiCIIgd+IghC/////w+DIARCIIgiBCAGQv////8PgyIGfnwgBSAGfiIFQiCIfCIGQiCGIAVC/////w+DhCAIQiCIIAQgB358IAZCIIh8hSABKQNYIAJ9QQApA9iMAYUiBEL/////D4MiBSABKQNQIAJ8QQApA9CMAYUiBkIgiCIHfiIIQv////8PgyAEQiCIIgQgBkL/////D4MiBn58IAUgBn4iBUIgiHwiBkIghiAFQv////8Pg4QgCEIgiCAEIAd+fCAGQiCIfIUgASkDSCACfUEAKQPIjAGFIgRC/////w+DIgUgASkDQCACfEEAKQPAjAGFIgZCIIgiB34iCEL/////D4MgBEIgiCIEIAZC/////w+DIgZ+fCAFIAZ+IgVCIIh8IgZCIIYgBUL/////D4OEIAhCIIggBCAHfnwgBkIgiHyFIAEpAzggAn1BACkDuIwBhSIEQv////8PgyIFIAEpAzAgAnxBACkDsIwBhSIGQiCIIgd+IghC/////w+DIARCIIgiBCAGQv////8PgyIGfnwgBSAGfiIFQiCIfCIGQiCGIAVC/////w+DhCAIQiCIIAQgB358IAZCIIh8hSABKQMoIAJ9QQApA6iMAYUiBEL/////D4MiBSABKQMgIAJ8QQApA6CMAYUiBkIgiCIHfiIIQv////8PgyAEQiCIIgQgBkL/////D4MiBn58IAUgBn4iBUIgiHwiBkIghiAFQv////8Pg4QgCEIgiCAEIAd+fCAGQiCIfIUgASkDGCACfUEAKQOYjAGFIgRC/////w+DIgUgASkDECACfEEAKQOQjAGFIgZCIIgiB34iCEL/////D4MgBEIgiCIEIAZC/////w+DIgZ+fCAFIAZ+IgVCIIh8IgZCIIYgBUL/////D4OEIAhCIIggBCAHfnwgBkIgiHyFIAEpAwggAn1BACkDiIwBhSIEQv////8PgyIFIAEpAwAgAnxBACkDgIwBhSIGQiCIIgd+IghC/////w+DIARCIIgiBCAGQv////8PgyIGfnwgBSAGfiIFQiCIfCIGQiCGIAVC/////w+DhCAIQiCIIAQgB358IAZCIIh8hSAArUKHla+vmLbem55/fnx8fHx8fHx8IgRCJYggBIVC+fPd8ZnymasWfiIEQiCIIASFIQQCQCAAQZABSA0AIABBBHZBeGohCQNAIAEgA2oiCkELaikDACACfSADQYiNAWopAwCFIgVC/////w+DIgYgCkEDaikDACACfCADQYCNAWopAwCFIgdCIIgiCH4iC0L/////D4MgBUIgiCIFIAdC/////w+DIgd+fCAGIAd+IgZCIIh8IgdCIIYgBkL/////D4OEIAtCIIggBSAIfnwgB0IgiHyFIAR8IQQgA0EQaiEDIAlBf2oiCQ0ACwsgASkDfyACfSAAQfiLAWopAwCFIgVC/////w+DIgYgASkDdyACfCAAQfCLAWopAwCFIgJCIIgiB34iCEL/////D4MgBUIgiCIFIAJC/////w+DIgJ+fCAGIAJ+IgJCIIh8IgZCIIYgAkL/////D4OEIAhCIIggBSAHfnwgBkIgiHyFIAR8IgJCJYggAoVC+fPd8Znymas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I0BQQAgAykD0AE3A9CNAUEAIAMpA9gBNwPYjQFBACADKQPgATcD4I0BQQAgAykD6AE3A+iNAUEAIAMpA/ABNwPwjQFBACADKQP4ATcD+I0BC0GAjAEhAwJAAkAgBSAEayICQQhPDQAgAiEGDAELQYCMASEDIAIhBgNAIAMgBCkDADcDACADQQhqIQMgBEEIaiEEIAZBeGoiBkEHSw0ACwsgBkUNAQNAIAMgBC0AADoAACADQQFqIQMgBEEBaiEEIAZBf2oiBg0ADAILCyABRQ0AAkACQCABQQdxIgYNACABIQIMAQsgAUF4cSECA0AgAyAELQAAOgAAIANBAWohAyAEQQFqIQQgBkF/aiIGDQALCwJAIAFBCEkNAANAIAMgBCkAADcAACADQQhqIQMgBEEIaiEEIAJBeGoiAg0ACwtBACgCgI4BIABqIQILQQAgAjYCgI4BC/ISBQR/A34BfxV+BX8jACIAIQEgAEGAAWtBQHEiAiQAQQAoArCOASIAQcCKASAAGyEDAkACQEEAKQOQjgEiBELxAVQNACACQQApA4CKATcDACACQQApA4iKATcDCCACQQApA5CKATcDECACQQApA5iKATcDGCACQQApA6CKATcDICACQQApA6iKATcDKCACQQApA7CKASIFNwMwIAJBACkDuIoBIgY3AzgCQAJAQQAoAoCOASIHQcAASQ0AIAJBACgCiI4BNgJAIAIgAkHAAGpBACgCmI4BQYCMASAHQX9qQQZ2IANBACgCnI4BIgAQAiADIABqIgBBeWopAwAhCCAAKQMJIQkgACkDGSEKIAApAykhCyAHQcCLAWopAwAhBSAAKQMBIQwgB0HIiwFqKQMAIQYgB0HQiwFqKQMAIQ0gACkDESEOIAdB2IsBaikDACEPIAdB4IsBaikDACEQIAApAyEhESAHQeiLAWopAwAhEiACKQMAIRMgAikDECEUIAIpAyAhFSACKQMwIRYgAikDCCEXIAIpAxghGCACKQMoIRkgAiACKQM4IAdB8IsBaikDACIafCAAKQMxIAdB+IsBaikDACIbhSIcQiCIIBxC/////w+Dfnw3AzggGSAQfCARIBKFIhFCIIggEUL/////D4N+fCERIBggDXw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DGSEUIAApAykhCyAAKQMBIQwgACkDESEOIAApAyEhESACKQMAIRUgAikDECEWIAIpAyAhFyACKQMIIRggAikDQCENIAIpA0ghDyACKQMYIRkgAikDUCESIAIpA1ghCCACKQMoIRogAikDYCEQIAIpA2ghCSACIAYgAikDcCIbfCAAKQMxIAIpA3giBoUiHEIgiCAcQv////8Pg358NwM4IBogEHwgESAJhSIRQiCIIBFC/////w+DfnwhESAZIBJ8IA4gCIUiDkIgiCAOQv////8Pg358IQ4gGCANfCAMIA+FIgxCIIggDEL/////D4N+fCEMIAYgCyAbhSILQiCIIAtC/////w+DfiAFfHwhCyAJIBcgFCAQhSIFQiCIIAVC/////w+Dfnx8IRAgCCAWIBMgEoUiBUIgiCAFQv////8Pg358fCESIA8gFSAKIA2FIgVCIIggBUL/////D4N+fHwhCAsgAykDQyACKQM4hSIFQv////8PgyIGIAMpAzsgC4UiC0IgiCINfiIPQv////8PgyAFQiCIIgUgC0L/////D4MiC358IAYgC34iBkIgiHwiC0IghiAGQv////8Pg4QgD0IgiCAFIA1+fCALQiCIfIUgAykDMyARhSIFQv////8PgyIGIAMpAysgEIUiC0IgiCINfiIPQv////8PgyAFQiCIIgUgC0L/////D4MiC358IAYgC34iBkIgiHwiC0IghiAGQv////8Pg4QgD0IgiCAFIA1+fCALQiCIfIUgAykDIyAOhSIFQv////8PgyIGIAMpAxsgEoUiC0IgiCINfiIPQv////8PgyAFQiCIIgUgC0L/////D4MiC358IAYgC34iBkIgiHwiC0IghiAGQv////8Pg4QgD0IgiCAFIA1+fCALQiCIfIUgAykDEyAMhSIFQv////8PgyIGIAMpAwsgCIUiC0IgiCINfiIPQv////8PgyAFQiCIIgUgC0L/////D4MiC358IAYgC34iBkIgiHwiC0IghiAGQv////8Pg4QgD0IgiCAFIA1+fCALQiCIfIUgBEKHla+vmLbem55/fnx8fHwiBEIliCAEhUL5893xmfKZqxZ+IgRCIIggBIUhBAwBCyAEpyEAAkBBACkDoI4BIgRQDQACQCAAQRBLDQAgAEGACCAEEAUhBAwCCwJAIABBgAFLDQAgAEGACCAEEAYhBAwCCyAAQYAIIAQQByEEDAELAkAgAEEQSw0AIAAgA0IAEAUhBAwBCwJAIABBgAFLDQAgACADQgAQBiEEDAELIAAgA0IAEAchBAtBACAEQjiGIARCgP4Dg0IohoQgBEKAgPwHg0IYhiAEQoCAgPgPg0IIhoSEIARCCIhCgICA+A+DIARCGIhCgID8B4OEIARCKIhCgP4DgyAEQjiIhISENwOACiABJAALBgBBgIoBCwIACwvMAQEAQYAIC8QBuP5sOSOkS758AYEs9yGtHN7UbemDkJfbckCkpLezZx/LeeZOzMDleIJa0H3M/3IhuAhGdPdDJI7gNZDmgTomTDwoUruRwwDLiNBlixtTLqNxZEiXog35TjgZ70ap3qzYqPp2P+OcND/53LvHxwtPHYpR4EvNtFkxyJ9+ydl4c2TqxayDNNPrw8WBoP/6E2PrFw3dUbfw2knTFlUmKdRonisWvlh9R6H8j/i40XrQMc5FyzqPlRYEKK/X+8q7S0B+QAIAAA=="; -var hash$6 = "5a2fbdbb"; -var wasmJson$6 = { - name: name$6, - data: data$6, - hash: hash$6 -}; - -const mutex$4 = new Mutex(); -let wasmCache$4 = null; -const seedBuffer$1 = new Uint8Array(8); -function validateSeed$1(seed) { - if (!Number.isInteger(seed) || seed < 0 || seed > 0xffffffff) { - return new Error("Seed must be given as two valid 32-bit long unsigned integers (lo + high)."); - } - return null; -} -function writeSeed$1(arr, low, high) { - // write in little-endian format - const buffer = new DataView(arr); - buffer.setUint32(0, low, true); - buffer.setUint32(4, high, true); -} -/** - * Calculates xxHash3 hash - * @param data Input data (string, Buffer or TypedArray) - * @param seedLow Lower 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @param seedHigh Higher 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @returns Computed hash as a hexadecimal string - */ -function xxhash3(data, seedLow = 0, seedHigh = 0) { - if (validateSeed$1(seedLow)) { - return Promise.reject(validateSeed$1(seedLow)); - } - if (validateSeed$1(seedHigh)) { - return Promise.reject(validateSeed$1(seedHigh)); - } - if (wasmCache$4 === null) { - return lockedCreate(mutex$4, wasmJson$6, 8).then((wasm) => { - wasmCache$4 = wasm; - writeSeed$1(seedBuffer$1.buffer, seedLow, seedHigh); - wasmCache$4.writeMemory(seedBuffer$1); - return wasmCache$4.calculate(data); - }); - } - try { - writeSeed$1(seedBuffer$1.buffer, seedLow, seedHigh); - wasmCache$4.writeMemory(seedBuffer$1); - const hash = wasmCache$4.calculate(data); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } -} -/** - * Creates a new xxHash3 hash instance - * @param seedLow Lower 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @param seedHigh Higher 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - */ -function createXXHash3(seedLow = 0, seedHigh = 0) { - if (validateSeed$1(seedLow)) { - return Promise.reject(validateSeed$1(seedLow)); - } - if (validateSeed$1(seedHigh)) { - return Promise.reject(validateSeed$1(seedHigh)); - } - return WASMInterface(wasmJson$6, 8).then((wasm) => { - const instanceBuffer = new Uint8Array(8); - writeSeed$1(instanceBuffer.buffer, seedLow, seedHigh); - wasm.writeMemory(instanceBuffer); - wasm.init(); - const obj = { - init: () => { - wasm.writeMemory(instanceBuffer); - wasm.init(); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 512, - digestSize: 8, - }; - return obj; - }); -} - -var name$5 = "xxhash128"; -var data$5 = "AGFzbQEAAAABKwdgAAF/YAR/f39/AGAHf39/f39/fwBgA39/fgF+YAR/f39+AGAAAGABfwADDQwAAQIDBAQEBQYFAAUFBAEBAgIGDgJ/AUHAjgULfwBBwAkLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAJSGFzaF9Jbml0AAcLSGFzaF9VcGRhdGUACApIYXNoX0ZpbmFsAAkNSGFzaF9HZXRTdGF0ZQAKDkhhc2hfQ2FsY3VsYXRlAAsKU1RBVEVfU0laRQMBCqBNDAUAQYAKC+QDAw9+AX8BfgJAIANFDQAgACkDMCEEIAApAzghBSAAKQMgIQYgACkDKCEHIAApAxAhCCAAKQMYIQkgACkDACEKIAApAwghCwNAIAUgAUEwaikDACIMfCACQThqKQMAIAFBOGopAwAiDYUiBUIgiCAFQv////8Pg358IQUgByABQSBqKQMAIg58IAJBKGopAwAgAUEoaikDACIPhSIHQiCIIAdC/////w+DfnwhByAJIAFBEGopAwAiEHwgAkEYaikDACABQRhqKQMAIhGFIglCIIggCUL/////D4N+fCEJIAsgASkDACISfCACQQhqIhMpAwAgAUEIaikDACIUhSILQiCIIAtC/////w+DfnwhCyACQTBqKQMAIAyFIgxCIIggDEL/////D4N+IAR8IA18IQQgAkEgaikDACAOhSIMQiCIIAxC/////w+DfiAGfCAPfCEGIAJBEGopAwAgEIUiDEIgiCAMQv////8Pg34gCHwgEXwhCCACKQMAIBKFIgxCIIggDEL/////D4N+IAp8IBR8IQogAUHAAGohASATIQIgA0F/aiIDDQALIAAgCTcDGCAAIAo3AwAgACALNwMIIAAgBzcDKCAAIAg3AxAgACAFNwM4IAAgBjcDICAAIAQ3AzALC94CAgF/AX4CQCAEIAIgASgCACIHayICSQ0AIAAgAyAFIAdBA3RqIAIQASAAIAUgBmoiBykDACAAKQMAIghCL4iFIAiFQrHz3fEJfjcDACAAIAcpAwggACkDCCIIQi+IhSAIhUKx893xCX43AwggACAHKQMQIAApAxAiCEIviIUgCIVCsfPd8Ql+NwMQIAAgBykDGCAAKQMYIghCL4iFIAiFQrHz3fEJfjcDGCAAIAcpAyAgACkDICIIQi+IhSAIhUKx893xCX43AyAgACAHKQMoIAApAygiCEIviIUgCIVCsfPd8Ql+NwMoIAAgBykDMCAAKQMwIghCL4iFIAiFQrHz3fEJfjcDMCAAIAcpAzggACkDOCIIQi+IhSAIhUKx893xCX43AzggACADIAJBBnRqIAUgBCACayIHEAEgASAHNgIADwsgACADIAUgB0EDdGogBBABIAEgByAEajYCAAvtAwEFfiABKQM4IAApAziFIgNC/////w+DIgQgASkDMCAAKQMwhSIFQiCIIgZ+IgdC/////w+DIANCIIgiAyAFQv////8PgyIFfnwgBCAFfiIEQiCIfCIFQiCGIARC/////w+DhCAHQiCIIAMgBn58IAVCIIh8hSABKQMoIAApAyiFIgNC/////w+DIgQgASkDICAAKQMghSIFQiCIIgZ+IgdC/////w+DIANCIIgiAyAFQv////8PgyIFfnwgBCAFfiIEQiCIfCIFQiCGIARC/////w+DhCAHQiCIIAMgBn58IAVCIIh8hSABKQMYIAApAxiFIgNC/////w+DIgQgASkDECAAKQMQhSIFQiCIIgZ+IgdC/////w+DIANCIIgiAyAFQv////8PgyIFfnwgBCAFfiIEQiCIfCIFQiCGIARC/////w+DhCAHQiCIIAMgBn58IAVCIIh8hSABKQMIIAApAwiFIgNC/////w+DIgQgASkDACAAKQMAhSIFQiCIIgZ+IgdC/////w+DIANCIIgiAyAFQv////8PgyIFfnwgBCAFfiIEQiCIfCIFQiCGIARC/////w+DhCAHQiCIIAMgBn58IAVCIIh8hSACfHx8fCICQiWIIAKFQvnz3fGZ8pmrFn4iAkIgiCAChQu6CAIFfgN/AkAgAUEJSQ0AIAAgAUH4iwFqKQMAIgQgAikDOCACKQMwhSADfIUiBUL/////D4NC95Svrwh+IAVCgICAgHCDfEEAKQOAjAEgAikDKCACKQMghSADfYUgBIUiA0IgiCIEQrHz3fEJfnwgBEKHla+vCH4iBEIgiHwgBEL/////D4MgA0L/////D4MiA0Kx893xCX58IANCh5Wvrwh+IgRCIIh8IgVCIIh8IgNCOIYgA0KA/gODQiiGhCADQoCA/AeDQhiGIANCgICA+A+DQgiGhIQgA0IIiEKAgID4D4MgA0IYiEKAgPwHg4QgA0IoiEKA/gODIANCOIiEhIQgBEL/////D4MgAUF/aq1CNoaEIAVCIIZ8hSIEQiCIIgVCz9bTvgJ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AhBwJAIAFBwQBJDQBCACEHAkAgAUHhAEkNACACQfgAaikDACADfSABQciLAWopAwAiCIUiB0L/////D4MiCSACKQNwIAN8IAFBwIsBaikDACIKhSILQiCIIgx+Ig1CIIggB0IgiCIHIAx+fCANQv////8PgyAHIAtC/////w+DIgt+fCAJIAt+IgdCIIh8IglCIIh8QQApA7iMASILQQApA7CMASIMfIUgCUIghiAHQv////8Pg4SFIQcgAkHoAGopAwAgA30gC4UiCUL/////D4MiCyACKQNgIAN8IAyFIgxCIIgiDX4iBkL/////D4MgCUIgiCIJIAxC/////w+DIgx+fCALIAx+IgtCIIh8IgxCIIYgC0L/////D4OEIAZCIIggCSANfnwgDEIgiHyFIAV8IAggCnyFIQULIAJB2ABqKQMAIAN9IAFB2IsBaikDACIIhSIJQv////8PgyIKIAIpA1AgA3wgAUHQiwFqKQMAIguFIgxCIIgiDX4iBkL/////D4MgCUIgiCIJIAxC/////w+DIgx+fCAKIAx+IgpCIIh8IgxCIIYgCkL/////D4OEIAZCIIggCSANfnwgDEIgiHyFIAd8QQApA6iMASIJQQApA6CMASIKfIUhByACQcgAaikDACADfSAJhSIJQv////8PgyIMIAIpA0AgA3wgCoUiCkIgiCINfiIGQv////8PgyAJQiCIIgkgCkL/////D4MiCn58IAwgCn4iCkIgiHwiDEIghiAKQv////8Pg4QgBkIgiCAJIA1+fCAMQiCIfIUgBXwgCCALfIUhBQsgAkE4aikDACADfSABQeiLAWopAwAiCIUiCUL/////D4MiCiACKQMwIAN8IAFB4IsBaikDACILhSIMQiCIIg1+IgZC/////w+DIAlCIIgiCSAMQv////8PgyIMfnwgCiAMfiIKQiCIfCIMQiCGIApC/////w+DhCAGQiCIIAkgDX58IAxCIIh8hSAHfEEAKQOYjAEiB0EAKQOQjAEiCXyFIQYgAkEoaikDACADfSAHhSIHQv////8PgyIKIAIpAyAgA3wgCYUiCUIgiCIMfiINQv////8PgyAHQiCIIgcgCUL/////D4MiCX58IAogCX4iCUIgiHwiCkIghiAJQv////8Pg4QgDUIgiCAHIAx+fCAKQiCIfIUgBXwgCCALfIUhBQsgACACQRhqKQMAIAN9IAFB+IsBaikDACIHhSIIQv////8PgyIJIAIpAxAgA3wgAUHwiwFqKQMAIgqFIgtCIIgiDH4iDUL/////D4MgCEIgiCIIIAtC/////w+DIgt+fCAJIAt+IglCIIh8IgtCIIYgCUL/////D4OEIA1CIIggCCAMfnwgC0IgiHyFIAZ8QQApA4iMASIIQQApA4CMASIJfIUiCyACQQhqKQMAIAN9IAiFIghC/////w+DIgwgAikDACADfCAJhSIJQiCIIg1+IgZC/////w+DIAhCIIgiCCAJQv////8PgyIJfnwgDCAJfiIJQiCIfCIMQiCGIAlC/////w+DhCAGQiCIIAggDX58IAxCIIh8hSAFfCAHIAp8hSIFfCIHQiWIIAeFQvnz3fGZ8pmrFn4iB0IgiCAHhTcDACAAQgAgBUKHla+vmLbem55/fiAEIAN9Qs/W077Sx6vZQn58IAtC49zKlfzO8vWFf358IgNCJYggA4VC+fPd8ZnymasWfiIDQiCIIAOFfTcDCAuhDwMBfxR+An9BACEEIAJB+ABqKQMAIAN9QQApA/iMASIFhSIGQv////8PgyIHIAIpA3AgA3xBACkD8IwBIgiFIglCIIgiCn4iC0L/////D4MgBkIgiCIGIAlC/////w+DIgl+fCAHIAl+IgdCIIh8IglCIIYgB0L/////D4OEIAtCIIggBiAKfnwgCUIgiHyFIAJB2ABqKQMAIAN9QQApA9iMASIHhSIGQv////8PgyIJIAIpA1AgA3xBACkD0IwBIgqFIgtCIIgiDH4iDUL/////D4MgBkIgiCIGIAtC/////w+DIgt+fCAJIAt+IglCIIh8IgtCIIYgCUL/////D4OEIA1CIIggBiAMfnwgC0IgiHyFIAJBOGopAwAgA31BACkDuIwBIgmFIgZC/////w+DIgsgAikDMCADfEEAKQOwjAEiDIUiDUIgiCIOfiIPQv////8PgyAGQiCIIgYgDUL/////D4MiDX58IAsgDX4iC0IgiHwiDUIghiALQv////8Pg4QgD0IgiCAGIA5+fCANQiCIfIUgAkEYaikDACADfUEAKQOYjAEiC4UiBkL/////D4MiDSACKQMQIAN8QQApA5CMASIOhSIPQiCIIhB+IhFC/////w+DIAZCIIgiBiAPQv////8PgyIPfnwgDSAPfiINQiCIfCIPQiCGIA1C/////w+DhCARQiCIIAYgEH58IA9CIIh8hUEAKQOIjAEiDUEAKQOAjAEiD3yFfEEAKQOojAEiEEEAKQOgjAEiEXyFfEEAKQPIjAEiEkEAKQPAjAEiE3yFfEEAKQPojAEiFEEAKQPgjAEiFXyFIgZCJYggBoVC+fPd8ZnymasWfiIGQiCIIAaFIQYgAkHoAGopAwAgA30gFIUiFEL/////D4MiFiACKQNgIAN8IBWFIhVCIIgiF34iGEL/////D4MgFEIgiCIUIBVC/////w+DIhV+fCAWIBV+IhVCIIh8IhZCIIYgFUL/////D4OEIBhCIIggFCAXfnwgFkIgiHyFIAJByABqKQMAIAN9IBKFIhJC/////w+DIhQgAikDQCADfCAThSITQiCIIhV+IhZC/////w+DIBJCIIgiEiATQv////8PgyITfnwgFCATfiITQiCIfCIUQiCGIBNC/////w+DhCAWQiCIIBIgFX58IBRCIIh8hSACQShqKQMAIAN9IBCFIhBC/////w+DIhIgAikDICADfCARhSIRQiCIIhN+IhRC/////w+DIBBCIIgiECARQv////8PgyIRfnwgEiARfiIRQiCIfCISQiCGIBFC/////w+DhCAUQiCIIBAgE358IBJCIIh8hSACQQhqKQMAIAN9IA2FIg1C/////w+DIhAgAikDACADfCAPhSIPQiCIIhF+IhJC/////w+DIA1CIIgiDSAPQv////8PgyIPfnwgECAPfiIPQiCIfCIQQiCGIA9C/////w+DhCASQiCIIA0gEX58IBBCIIh8hSABrSIPQoeVr6+Ytt6bnn9+fCALIA58hXwgCSAMfIV8IAcgCnyFfCAFIAh8hSIFQiWIIAWFQvnz3fGZ8pmrFn4iBUIgiCAFhSEFAkAgAUGgAUgNACABQQV2QXxqIRkDQCACIARqIhpBG2opAwAgA30gBEGYjQFqKQMAIgeFIghC/////w+DIgkgGkETaikDACADfCAEQZCNAWopAwAiCoUiC0IgiCIMfiINQv////8PgyAIQiCIIgggC0L/////D4MiC358IAkgC34iCUIgiHwiC0IghiAJQv////8Pg4QgDUIgiCAIIAx+fCALQiCIfIUgBnwgBEGIjQFqKQMAIgggBEGAjQFqKQMAIgl8hSEGIBpBC2opAwAgA30gCIUiCEL/////D4MiCyAaQQNqKQMAIAN8IAmFIglCIIgiDH4iDUL/////D4MgCEIgiCIIIAlC/////w+DIgl+fCALIAl+IglCIIh8IgtCIIYgCUL/////D4OEIA1CIIggCCAMfnwgC0IgiHyFIAV8IAcgCnyFIQUgBEEgaiEEIBlBf2oiGQ0ACwsgACACQf8AaikDACADfCABQeiLAWopAwAiB4UiCEL/////D4MiCSACKQN3IAN9IAFB4IsBaikDACIKhSILQiCIIgx+Ig1C/////w+DIAhCIIgiCCALQv////8PgyILfnwgCSALfiIJQiCIfCILQiCGIAlC/////w+DhCANQiCIIAggDH58IAtCIIh8hSAGfCABQfiLAWopAwAiBiABQfCLAWopAwAiCHyFIgkgAkHvAGopAwAgA3wgBoUiBkL/////D4MiCyACKQNnIAN9IAiFIghCIIgiDH4iDUL/////D4MgBkIgiCIGIAhC/////w+DIgh+fCALIAh+IghCIIh8IgtCIIYgCEL/////D4OEIA1CIIggBiAMfnwgC0IgiHyFIAV8IAcgCnyFIgZ8IgVCJYggBYVC+fPd8ZnymasWfiIFQiCIIAWFNwMAIABCACAGQoeVr6+Ytt6bnn9+IA8gA31Cz9bTvtLHq9lCfnwgCULj3MqV/M7y9YV/fnwiA0IliCADhUL5893xmfKZqxZ+IgNCIIggA4V9NwMIC98FAgF+AX8CQAJAQQApA4AKIgBQRQ0AQYAIIQFCACEADAELAkBBACkDoI4BIABSDQBBACEBDAELQQAhAUEAQq+v79e895Kg/gAgAH03A/iLAUEAIABCxZbr+djShYIofDcD8IsBQQBCj/Hjja2P9JhOIAB9NwPoiwFBACAAQqus+MXV79HQfHw3A+CLAUEAQtOt1LKShbW0nn8gAH03A9iLAUEAIABCl5r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oAACADQQFqIQMgBEEBaiEEIAZBf2oiBg0ADAILCyABRQ0AAkACQCABQQdxIgYNACABIQIMAQsgAUF4cSECA0AgAyAELQAAOgAAIANBAWohAyAEQQFqIQQgBkF/aiIGDQALCwJAIAFBCEkNAANAIAMgBCkAADcAACADQQhqIQMgBEEIaiEEIAJBeGoiAg0ACwtBACgCgI4BIABqIQILQQAgAjYCgI4BC90QBgR/A34BfwN+BX8CfiMAIgAhASAAQYABa0FAcSICJABBACgCsI4BIgBBwIoBIAAbIQMCQAJAQQApA5COASIEQvEBVA0AIAJBACkDgIoBNwMAIAJBACkDiIoBNwMIIAJBACkDkIoBNwMQIAJBACkDmIoBNwMYIAJBACkDoIoBNwMgIAJBACkDqIoBNwMoIAJBACkDsIoBIgU3AzAgAkEAKQO4igEiBjcDOAJAAkBBACgCgI4BIgdBwABJDQAgAkEAKAKIjgE2AkAgAiACQcAAakEAKAKYjgFBgIwBIAdBf2pBBnYgA0EAKAKcjgEiABACIAIgAikDCCAHQcCLAWopAwAiBXwgAyAAaiIAKQMBIAdByIsBaikDACIGhSIIQiCIIAhC/////w+Dfnw3AwggAiACKQMYIAdB0IsBaikDACIIfCAAKQMRIAdB2IsBaikDACIJhSIKQiCIIApC/////w+Dfnw3AxggAiAGIAUgAEF5aikDAIUiBUIgiCAFQv////8Pg34gAikDAHx8NwMAIAIgCSAIIAApAwmFIgVCIIggBUL/////D4N+IAIpAxB8fDcDECAAKQMZIQUgAikDICEGIAIgAikDKCAHQeCLAWopAwAiCHwgACkDISAHQeiLAWopAwAiCYUiCkIgiCAKQv////8Pg358NwMoIAIgCSAGIAUgCIUiBUIgiCAFQv////8Pg358fDcDICACIAIpAzggB0HwiwFqKQMAIgV8IAApAzEgB0H4iwFqKQMAIgaFIghCIIggCEL/////D4N+fDcDOCACIAYgBSAAKQMphSIFQiCIIAVC/////w+DfiACKQMwfHw3AzAMAQsgB0HAjQFqIQtBwAAgB2shDCACQcAAaiEAAkACQAJAIAdBOE0NACAMIQ0MAQsCQAJAQTggB2tBA3ZBAWpBB3EiDQ0AIAJBwABqIQAgDCENDAELIAJBwABqIQAgDUEDdCIOIQ0DQCAAIAspAwA3AwAgAEEIaiEAIAtBCGohCyANQXhqIg0NAAtBwAAgByAOamshDQsCQCAHDQADQCAAIAspAwA3AwAgAEEIaiALQQhqKQMANwMAIABBEGogC0EQaikDADcDACAAQRhqIAtBGGopAwA3AwAgAEEgaiALQSBqKQMANwMAIABBKGogC0EoaikDADcDACAAQTBqIAtBMGopAwA3AwAgAEE4aiALQThqKQMANwMAIABBwABqIQAgC0HAAGohCyANQUBqIg1BB0sNAAsLIA1FDQELIA1Bf2ohDwJAIA1BB3EiDkUNACANQXhxIQ0DQCAAIAstAAA6AAAgAEEBaiEAIAtBAWohCyAOQX9qIg4NAAsLIA9BB0kNAANAIAAgCykAADcAACAAQQhqIQAgC0EIaiELIA1BeGoiDQ0ACwsgAkHAAGogDGohC0GAjAEhAAJAAkACQCAHQQhJDQACQCAHQThqQQN2QQFqQQdxIg0NAAwCCyANQQN0IQ5BgIwBIQADQCALIAApAwA3AwAgC0EIaiELIABBCGohACANQX9qIg0NAAsgByAOayEHCyAHRQ0BAkACQCAHQQdxIg4NACAHIQ0MAQsgB0F4cSENA0AgCyAALQAAOgAAIAtBAWohCyAAQQFqIQAgDkF/aiIODQALCyAHQQhJDQELA0AgCyAAKQAANwAAIAtBCGohCyAAQQhqIQAgDUF4aiINDQALCyACIAIpAwggAikDQCIIfCADQQAoApyOAWoiACkDASACKQNIIgmFIgpCIIggCkL/////D4N+fDcDCCACIAIpAxggAikDUCIKfCAAKQMRIAIpA1giEIUiEUIgiCARQv////8Pg358NwMYIAIgECAKIAApAwmFIgpCIIggCkL/////D4N+IAIpAxB8fDcDECACIAkgCCAAQXlqKQMAhSIIQiCIIAhC/////w+DfiACKQMAfHw3AwAgACkDGSEIIAIpAyAhCSACIAIpAyggAikDYCIKfCAAKQMhIAIpA2giEIUiEUIgiCARQv////8Pg358NwMoIAIgECA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= "b9ab74e2"; -var wasmJson$5 = { - name: name$5, - data: data$5, - hash: hash$5 -}; - -const mutex$3 = new Mutex(); -let wasmCache$3 = null; -const seedBuffer = new Uint8Array(8); -function validateSeed(seed) { - if (!Number.isInteger(seed) || seed < 0 || seed > 0xffffffff) { - return new Error("Seed must be given as two valid 32-bit long unsigned integers (lo + high)."); - } - return null; -} -function writeSeed(arr, low, high) { - // write in little-endian format - const buffer = new DataView(arr); - buffer.setUint32(0, low, true); - buffer.setUint32(4, high, true); -} -/** - * Calculates xxHash128 hash - * @param data Input data (string, Buffer or TypedArray) - * @param seedLow Lower 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @param seedHigh Higher 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @returns Computed hash as a hexadecimal string - */ -function xxhash128(data, seedLow = 0, seedHigh = 0) { - if (validateSeed(seedLow)) { - return Promise.reject(validateSeed(seedLow)); - } - if (validateSeed(seedHigh)) { - return Promise.reject(validateSeed(seedHigh)); - } - if (wasmCache$3 === null) { - return lockedCreate(mutex$3, wasmJson$5, 16).then((wasm) => { - wasmCache$3 = wasm; - writeSeed(seedBuffer.buffer, seedLow, seedHigh); - wasmCache$3.writeMemory(seedBuffer); - return wasmCache$3.calculate(data); - }); - } - try { - writeSeed(seedBuffer.buffer, seedLow, seedHigh); - wasmCache$3.writeMemory(seedBuffer); - const hash = wasmCache$3.calculate(data); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } -} -/** - * Creates a new xxHash128 hash instance - * @param seedLow Lower 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @param seedHigh Higher 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - */ -function createXXHash128(seedLow = 0, seedHigh = 0) { - if (validateSeed(seedLow)) { - return Promise.reject(validateSeed(seedLow)); - } - if (validateSeed(seedHigh)) { - return Promise.reject(validateSeed(seedHigh)); - } - return WASMInterface(wasmJson$5, 16).then((wasm) => { - const instanceBuffer = new Uint8Array(8); - writeSeed(instanceBuffer.buffer, seedLow, seedHigh); - wasm.writeMemory(instanceBuffer); - wasm.init(); - const obj = { - init: () => { - wasm.writeMemory(instanceBuffer); - wasm.init(); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 512, - digestSize: 16, - }; - return obj; - }); -} - -var name$4 = "ripemd160"; -var data$4 = "AGFzbQEAAAABEQRgAAF/YAAAYAF/AGACf38AAwkIAAECAwIBAAIFBAEBAgIGDgJ/AUHgiQULfwBBgAgLB4MBCQZtZW1vcnkCAA5IYXNoX0dldEJ1ZmZlcgAACUhhc2hfSW5pdAABEHJpcGVtZDE2MF91cGRhdGUAAwtIYXNoX1VwZGF0ZQAECkhhc2hfRmluYWwABQ1IYXNoX0dldFN0YXRlAAYOSGFzaF9DYWxjdWxhdGUABwpTVEFURV9TSVpFAwEKzzIIBQBBgAkLOgBBAEHww8uefDYCmIkBQQBC/rnrxemOlZkQNwKQiQFBAEKBxpS6lvHq5m83AoiJAUEAQgA3AoCJAQuPLAEhf0EAIAAoAiQiASAAKAIAIgIgACgCECIDIAIgACgCLCIEIAAoAgwiBSAAKAIEIgYgACgCPCIHIAIgACgCMCIIIAcgACgCCCIJQQAoAoiJASIKQQAoApCJASILQQAoApSJASIMQX9zckEAKAKMiQEiDXNqIAAoAhQiDmpB5peKhQVqQQh3QQAoApiJASIPaiIQQQp3IhFqIAEgDUEKdyISaiACIAtBCnciE2ogDCAAKAIcIhRqIA8gACgCOCIVaiAQIA0gE0F/c3JzakHml4qFBWpBCXcgDGoiFiAQIBJBf3Nyc2pB5peKhQVqQQl3IBNqIhAgFiARQX9zcnNqQeaXioUFakELdyASaiIXIBAgFkEKdyIWQX9zcnNqQeaXioUFakENdyARaiIYIBcgEEEKdyIZQX9zcnNqQeaXioUFakEPdyAW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AEEBaiEAIANBAWohAyABIAJBAWoiAkH/AXFLDQALCwsJAEGACSAAEAMLggEBAn8jAEEQayIAJAAgAEEAKAKAiQEiAUEDdDYCCCAAQQAoAoSJAUEDdCABQR12cjYCDEGQCEE4QfgAIAFBP3EiAUE4SRsgAWsQAyAAQQhqQQgQA0EAQQAoAoiJATYCgAlBAEEAKQKMiQE3AoQJQQBBACkClIkBNwKMCSAAQRBqJAALBgBBgIkBC8EBAQF/IwBBEGsiASQAQQBB8MPLnnw2ApiJAUEAQv6568XpjpWZEDcCkIkBQQBCgcaUupbx6uZvNwKIiQFBAEIANwKAiQFBgAkgABADIAFBACgCgIkBIgBBA3Q2AgggAUEAKAKEiQFBA3QgAEEddnI2AgxBkAhBOEH4ACAAQT9xIgBBOEkbIABrEAMgAUEIakEIEANBAEEAKAKIiQE2AoAJQQBBACkCjIkBNwKECUEAQQApApSJATcCjAkgAUEQaiQACwtXAQBBgAgLUFwAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; -var hash$4 = "6abbce74"; -var wasmJson$4 = { - name: name$4, - data: data$4, - hash: hash$4 -}; - -const mutex$2 = new Mutex(); -let wasmCache$2 = null; -/** - * Calculates RIPEMD-160 hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ -function ripemd160(data) { - if (wasmCache$2 === null) { - return lockedCreate(mutex$2, wasmJson$4, 20).then((wasm) => { - wasmCache$2 = wasm; - return wasmCache$2.calculate(data); - }); - } - try { - const hash = wasmCache$2.calculate(data); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } -} -/** - * Creates a new RIPEMD-160 hash instance - */ -function createRIPEMD160() { - return WASMInterface(wasmJson$4, 20).then((wasm) => { - wasm.init(); - const obj = { - init: () => { - wasm.init(); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 64, - digestSize: 20, - }; - return obj; - }); -} - -function calculateKeyBuffer(hasher, key) { - const { blockSize } = hasher; - const buf = getUInt8Buffer(key); - if (buf.length > blockSize) { - hasher.update(buf); - const uintArr = hasher.digest("binary"); - hasher.init(); - return uintArr; - } - return new Uint8Array(buf.buffer, buf.byteOffset, buf.length); -} -function calculateHmac(hasher, key) { - hasher.init(); - const { blockSize } = hasher; - const keyBuf = calculateKeyBuffer(hasher, key); - const keyBuffer = new Uint8Array(blockSize); - keyBuffer.set(keyBuf); - const opad = new Uint8Array(blockSize); - for (let i = 0; i < blockSize; i++) { - const v = keyBuffer[i]; - opad[i] = v ^ 0x5c; - keyBuffer[i] = v ^ 0x36; - } - hasher.update(keyBuffer); - const obj = { - init: () => { - hasher.init(); - hasher.update(keyBuffer); - return obj; - }, - update: (data) => { - hasher.update(data); - return obj; - }, - digest: ((outputType) => { - const uintArr = hasher.digest("binary"); - hasher.init(); - hasher.update(opad); - hasher.update(uintArr); - return hasher.digest(outputType); - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - }), - save: () => { - throw new Error("save() not supported"); - }, - load: () => { - throw new Error("load() not supported"); - }, - blockSize: hasher.blockSize, - digestSize: hasher.digestSize, - }; - return obj; -} -/** - * Calculates HMAC hash - * @param hash Hash algorithm to use. It has to be the return value of a function like createSHA1() - * @param key Key (string, Buffer or TypedArray) - */ -function createHMAC(hash, key) { - if (!hash || !hash.then) { - throw new Error('Invalid hash function is provided! Usage: createHMAC(createMD5(), "key").'); - } - return hash.then((hasher) => calculateHmac(hasher, key)); -} - -function calculatePBKDF2(digest, salt, iterations, hashLength, outputType) { - return __awaiter(this, void 0, void 0, function* () { - const DK = new Uint8Array(hashLength); - const block1 = new Uint8Array(salt.length + 4); - const block1View = new DataView(block1.buffer); - const saltBuffer = getUInt8Buffer(salt); - const saltUIntBuffer = new Uint8Array(saltBuffer.buffer, saltBuffer.byteOffset, saltBuffer.length); - block1.set(saltUIntBuffer); - let destPos = 0; - const hLen = digest.digestSize; - const l = Math.ceil(hashLength / hLen); - let T = null; - let U = null; - for (let i = 1; i <= l; i++) { - block1View.setUint32(salt.length, i); - digest.init(); - digest.update(block1); - T = digest.digest("binary"); - U = T.slice(); - for (let j = 1; j < iterations; j++) { - digest.init(); - digest.update(U); - U = digest.digest("binary"); - for (let k = 0; k < hLen; k++) { - T[k] ^= U[k]; - } - } - DK.set(T.subarray(0, hashLength - destPos), destPos); - destPos += hLen; - } - if (outputType === "binary") { - return DK; - } - const digestChars = new Uint8Array(hashLength * 2); - return getDigestHex(digestChars, DK, hashLength); - }); -} -const validateOptions$2 = (options) => { - if (!options || typeof options !== "object") { - throw new Error("Invalid options parameter. It requires an object."); - } - if (!options.hashFunction || !options.hashFunction.then) { - throw new Error('Invalid hash function is provided! Usage: pbkdf2("password", "salt", 1000, 32, createSHA1()).'); - } - if (!Number.isInteger(options.iterations) || options.iterations < 1) { - throw new Error("Iterations should be a positive number"); - } - if (!Number.isInteger(options.hashLength) || options.hashLength < 1) { - throw new Error("Hash length should be a positive number"); - } - if (options.outputType === undefined) { - options.outputType = "hex"; - } - if (!["hex", "binary"].includes(options.outputType)) { - throw new Error(`Insupported output type ${options.outputType}. Valid values: ['hex', 'binary']`); - } -}; -/** - * Generates a new PBKDF2 hash for the supplied password - */ -function pbkdf2(options) { - return __awaiter(this, void 0, void 0, function* () { - validateOptions$2(options); - const hmac = yield createHMAC(options.hashFunction, options.password); - return calculatePBKDF2(hmac, options.salt, options.iterations, options.hashLength, options.outputType); - }); -} - -var name$3 = "scrypt"; -var data$3 = "AGFzbQEAAAABGwVgAX8Bf2AAAX9gBH9/f38AYAF/AGADf39/AAMGBQABAgMEBQYBAQKAgAIGCAF/AUGQiAQLBzkEBm1lbW9yeQIAEkhhc2hfU2V0TWVtb3J5U2l6ZQAADkhh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CKCALIARqQRJ3IAZzajYCKCAAIAAoAiwgCmo2AiwgACAAKAIwIAkgEmpBEncgEHMiBiACakEHdyAUcyILajYCMCAAIAAoAjQgCyAGakEJdyATcyIKajYCNCAAIAAoAjggCiALakENdyACcyICajYCOCAAIAAoAjwgAiAKakESdyAGc2o2AjwLvxIDFX8Bfg5/AkAgAkUNACAAQQd0IgNBQGoiBEEAKAKACCIFIAMgAmwiBmogAyABbGoiByADaiIIaiEJIAAgAkEHdCIKIAFBB3RqIgtsIQwgACALQYABamwhDSAAQQV0IgtBASALQQFLGyILQWBxIQ4gC0EBcSEPIAdBeGohECAHQXBqIREgB0FoaiESIAdBYGohEyAHQVhqIRQgB0FQaiEVIAdBSGohFiAHQUBqIRcgAa1Cf3whGCAEIAdqIRkgByAAQQh0IhpqIRsgACAKQYABamwhHCALQQRJIR1BACEeQQAhHwNAQQAoAoAIIiAgAyAfbGohIQJAIABFDQBBACEiAkAgHQ0AICAgHmohI0EAIQtBACEiA0AgByALaiIEICMgC2oiJCgCADYCACAEQQRqICRBBGooAgA2AgAgBEEIaiAkQQhqKAIANgIAIARBDGogJEEMaigCADYCACALQRBqIQsgDiAiQQRqIiJHDQALCyAPRQ0AIAcgIkECdCILaiAhIAtqKAIANgIACwJAIAFFDQBBACElIBwhIyAGISYDQCAFISQgACEiAkACQCAADQAgGyAXKQMANwMAIBsgFikDADcDCCAbIBUpAwA3AxAgGyAUKQMANwMYIBsgEykDADcDICAbIBIpAwA3AyggGyARKQMANwMwIBsgECkDADcDOAwBCwNAICQgJmoiCyAkIAxqIgQpAwA3AwAgC0EIaiAEQQhqKQMANwMAIAtBEGogBEEQaikDADcDACALQRhqIARBGGopAwA3AwAgC0EgaiAEQSBqKQMANwMAIAtBKGogBEEoaikDADcDACALQTBqIARBMGopAwA3AwAgC0E4aiAEQThqKQMANwMAIAtBwABqIARBwABqKQMANwMAIAtByABqIARByABqKQMANwMAIAtB0ABqIARB0ABqKQMANwMAIAtB2ABqIARB2ABqKQMANwMAIAtB4ABqIARB4ABqKQMANwMAIAtB6ABqIARB6ABqKQMANwMAIAtB8ABqIARB8ABqKQMANwMAIAtB+ABqIARB+ABqKQMANwMAICRBgAFqISQgIkF/aiIiDQALIAcgCCAbIAAQAiAFISQgACEiA0AgJCAjaiILICQgDWoiBCkDADcDACALQQhqIARBCGopAwA3AwAgC0EQaiAEQRBqKQMANwMAIAtBGGogBEEYaikDADcDACALQSBqIARBIGopAwA3AwAgC0EoaiAEQShqKQMANwMAIAtBMGogBEEwaikDADcDACALQThqIARBOGopAwA3AwAgC0HAAGogBEHAAGopAwA3AwAgC0HIAGogBEHIAGopAwA3AwAgC0HQAGogBEHQAGopAwA3AwAgC0HYAGogBEHYAGopAwA3AwAgC0HgAGogBEHgAGopAwA3AwAgC0HoAGogBEHoAGopAwA3AwAgC0HwAGogBEHwAGopAwA3AwAgC0H4AGogBEH4AGopAwA3AwAgJEGAAWohJCAiQX9qIiINAAsLIAggByAbIAAQAiAjIBpqISMgJiAaaiEmICVBAmoiJSABSQ0AC0EAISUDQAJAAkAgAA0AIBsgFykDADcDACAbIBYpAwA3AwggGyAVKQMANwMQIBsgFCkDADcDGCAbIBMpAwA3AyAgGyASKQMANwMoIBsgESkDADcDMCAbIBApAwA3AzgMAQsgACAKIBkpAgAgGIOnQQd0amwhJiAFISQgACEiA0AgJCAMaiILIAspAwAgJCAmaiIEKQMAhTcDACALQQhqIiMgIykDACAEQQhqKQMAhTcDACALQRBqIiMgIykDACAEQRBqKQMAhTcDACALQRhqIiMgIykDACAEQRhqKQMAhTcDACALQSBqIiMgIykDACAEQSBqKQMAhTcDACALQShqIiMgIykDACAEQShqKQMAhTcDACALQTBqIiMgIykDACAEQTBqKQMAhTcDACALQThqIiMgIykDACAEQThqKQMAhTcDACALQcAAaiIjICMpAwAgBEHAAGopAwCFNwMAIAtByABqIiMgIykDACAEQcgAaikDAIU3AwAgC0HQAGoiIyAjKQMAIARB0ABqKQMAhTcDACALQdgAaiIjICMpAwAgBEHYAGopAwCFNwMAIAtB4ABqIiMgIykDACAEQeAAaikDAIU3AwAgC0HoAGoiIyAjKQMAIARB6ABqKQMAhTcDACALQfAAaiIjICMpAwAgBEHwAGopAwCFNwMAIAtB+ABqIgsgCykDACAEQfgAaikDAIU3AwAgJEGAAWohJCAiQX9qIiINAAsgByAIIBsgABACIAAgCiAJKQIAIBiDp0EHdGpsISYgBSEkIAAhIgNAICQgDWoiCyALKQMAICQgJmoiBCkDAIU3AwAgC0EIaiIjICMpAwAgBEEIaikDAIU3AwAgC0EQaiIjICMpAwAgBEEQaikDAIU3AwAgC0EYaiIjICMpAwAgBEEYaikDAIU3AwAgC0EgaiIjICMpAwAgBEEgaikDAIU3AwAgC0EoaiIjICMpAwAgBEEoaikDAIU3AwAgC0EwaiIjICMpAwAgBEEwaikDAIU3AwAgC0E4aiIjICMpAwAgBEE4aikDAIU3AwAgC0HAAGoiIyAjKQMAIARBwABqKQMAhTcDACALQcgAaiIjICMpAwAgBEHIAGopAwCFNwMAIAtB0ABqIiMgIykDACAEQdAAaikDAIU3AwAgC0HYAGoiIyAjKQMAIARB2ABqKQMAhTcDACALQeAAaiIjICMpAwAgBEHgAGopAwCFNwMAIAtB6ABqIiMgIykDACAEQegAaikDAIU3AwAgC0HwAGoiIyAjKQMAIARB8ABqKQMAhTcDACALQfgAaiILIAspAwAgBEH4AGopAwCFNwMAICRBgAFqISQgIkF/aiIiDQALCyAIIAcgGyAAEAIgJUECaiIlIAFJDQALCwJAIABFDQBBACEiAkAgHQ0AICAgHmohI0EAIQtBACEiA0AgIyALaiIEIAcgC2oiJCgCADYCACAEQQRqICRBBGooAgA2AgAgBEEIaiAkQQhqKAIANgIAIARBDGogJEEMaigCADYCACALQRBqIQsgDiAiQQRqIiJHDQALCyAPRQ0AICEgIkECdCILaiAHIAtqKAIANgIACyAeIANqIR4gH0EBaiIfIAJHDQALCws="; -var hash$3 = "b32721f8"; -var wasmJson$3 = { - name: name$3, - data: data$3, - hash: hash$3 -}; - -function scryptInternal(options) { - return __awaiter(this, void 0, void 0, function* () { - const { costFactor, blockSize, parallelism, hashLength } = options; - const SHA256Hasher = createSHA256(); - const blockData = yield pbkdf2({ - password: options.password, - salt: options.salt, - iterations: 1, - hashLength: 128 * blockSize * parallelism, - hashFunction: SHA256Hasher, - outputType: "binary", - }); - const scryptInterface = yield WASMInterface(wasmJson$3, 0); - // last block is for storing the temporary vectors - const VSize = 128 * blockSize * costFactor; - const XYSize = 256 * blockSize; - scryptInterface.setMemorySize(blockData.length + VSize + XYSize); - scryptInterface.writeMemory(blockData, 0); - // mix blocks - scryptInterface.getExports().scrypt(blockSize, costFactor, parallelism); - const expensiveSalt = scryptInterface - .getMemory() - .subarray(0, 128 * blockSize * parallelism); - const outputData = yield pbkdf2({ - password: options.password, - salt: expensiveSalt, - iterations: 1, - hashLength, - hashFunction: SHA256Hasher, - outputType: "binary", - }); - if (options.outputType === "hex") { - const digestChars = new Uint8Array(hashLength * 2); - return getDigestHex(digestChars, outputData, hashLength); - } - // return binary format - return outputData; - }); -} -const isPowerOfTwo = (v) => v && !(v & (v - 1)); -const validateOptions$1 = (options) => { - if (!options || typeof options !== "object") { - throw new Error("Invalid options parameter. It requires an object."); - } - if (!Number.isInteger(options.blockSize) || options.blockSize < 1) { - throw new Error("Block size should be a positive number"); - } - if (!Number.isInteger(options.costFactor) || - options.costFactor < 2 || - !isPowerOfTwo(options.costFactor)) { - throw new Error("Cost factor should be a power of 2, greater than 1"); - } - if (!Number.isInteger(options.parallelism) || options.parallelism < 1) { - throw new Error("Parallelism should be a positive number"); - } - if (!Number.isInteger(options.hashLength) || options.hashLength < 1) { - throw new Error("Hash length should be a positive number."); - } - if (options.outputType === undefined) { - options.outputType = "hex"; - } - if (!["hex", "binary"].includes(options.outputType)) { - throw new Error(`Insupported output type ${options.outputType}. Valid values: ['hex', 'binary']`); - } -}; -/** - * Calculates hash using the scrypt password-based key derivation function - * @returns Computed hash as a hexadecimal string or as - * Uint8Array depending on the outputType option - */ -function scrypt(options) { - return __awaiter(this, void 0, void 0, function* () { - validateOptions$1(options); - return scryptInternal(options); - }); -} - -var name$2 = "bcrypt"; -var data$2 = "AGFzbQEAAAABFwRgAAF/YAR/f39/AGADf39/AGABfwF/AwUEAAECAwUEAQECAgYIAX8BQZCrBQsHNAQGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAZiY3J5cHQAAg1iY3J5cHRfdmVyaWZ5AAMK9WAEBQBBgCsL21kEFH8Bfgh/AX4jAEHwAGshBCACQQA6AAIgAkGq4AA7AAACQCABLQAAQSpHDQAgAS0AAUEwRw0AIAJBMToAAQsCQCABLAAFIAEsAARBCmxqQfB7aiIFQQRJDQAgAS0AB0FgaiIGQd8ASw0AIAZBkAlqLQAAIgZBP0sNACABLQAIQWBqIgdB3wBLDQAgB0GQCWotAAAiB0E/Sw0AIAQgB0EEdiAGQQJ0cjoACCABLQAJQWBqIgZB3wBLDQAgBkGQCWotAAAiBkE/Sw0AIAQgBkECdiAHQQR0cjoACSABLQAKQWBqIgdB3wBLDQAgB0GQCWotAAAiB0E/Sw0AIAQgByAGQQZ0cjoACiABLQALQWBqIgZB3wBLDQAgBkGQCWotAAAiBkE/Sw0AIAEtAAxBYGoiB0HfAEsNACAHQZAJai0AACIHQT9LDQAgBCAHQQR2IAZBAnRyOgALIAEtAA1BYGoiBkHfAEsNACAGQZAJai0AACIGQT9LDQAgBCAGQQJ2IAdBBHRyOgAMIAEtAA5BYGoiB0HfAEsNACAHQZAJai0AACIHQT9LDQAgBCAHIAZBBnRyOgANIAEtAA9BYGoiBkHfAEsNACAGQZAJai0AACIGQT9LDQAgAS0AEEFgaiIHQd8ASw0AIAdBkAlqLQAAIgdBP0sNACAEIAdBBHYgBkECdHI6AA4gAS0AEUFgaiIGQd8ASw0AIAZBkAlqLQAAIgZBP0sNACAEIAZBAnYgB0EEdHI6AA8gAS0AEkFgaiIHQd8ASw0AIAdBkAlqLQAAIgdBP0sNACAEIAcgBkEGdHI6ABAgAS0AE0Fga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OM9mVL5sDOk0tymswN1QfMm11YQ/FwlHtdnVFpIb+3mJ"; -var hash$2 = "8bd8822d"; -var wasmJson$2 = { - name: name$2, - data: data$2, - hash: hash$2 -}; - -function bcryptInternal(options) { - return __awaiter(this, void 0, void 0, function* () { - const { costFactor, password, salt } = options; - const bcryptInterface = yield WASMInterface(wasmJson$2, 0); - bcryptInterface.writeMemory(getUInt8Buffer(salt), 0); - const passwordBuffer = getUInt8Buffer(password); - bcryptInterface.writeMemory(passwordBuffer, 16); - const shouldEncode = options.outputType === "encoded" ? 1 : 0; - bcryptInterface - .getExports() - .bcrypt(passwordBuffer.length, costFactor, shouldEncode); - const memory = bcryptInterface.getMemory(); - if (options.outputType === "encoded") { - return intArrayToString(memory, 60); - } - if (options.outputType === "hex") { - const digestChars = new Uint8Array(24 * 2); - return getDigestHex(digestChars, memory, 24); - } - // return binary format - // the data is copied to allow GC of the original memory buffer - return memory.slice(0, 24); - }); -} -const validateOptions = (options) => { - if (!options || typeof options !== "object") { - throw new Error("Invalid options parameter. It requires an object."); - } - if (!Number.isInteger(options.costFactor) || - options.costFactor < 4 || - options.costFactor > 31) { - throw new Error("Cost factor should be a number between 4 and 31"); - } - options.password = getUInt8Buffer(options.password); - if (options.password.length < 1) { - throw new Error("Password should be at least 1 byte long"); - } - if (options.password.length > 72) { - throw new Error("Password should be at most 72 bytes long"); - } - options.salt = getUInt8Buffer(options.salt); - if (options.salt.length !== 16) { - throw new Error("Salt should be 16 bytes long"); - } - if (options.outputType === undefined) { - options.outputType = "encoded"; - } - if (!["hex", "binary", "encoded"].includes(options.outputType)) { - throw new Error(`Insupported output type ${options.outputType}. Valid values: ['hex', 'binary', 'encoded']`); - } -}; -/** - * Calculates hash using the bcrypt password-hashing function - * @returns Computed hash - */ -function bcrypt(options) { - return __awaiter(this, void 0, void 0, function* () { - validateOptions(options); - return bcryptInternal(options); - }); -} -const validateHashCharacters = (hash) => { - if (!/^\$2[axyb]\$[0-3][0-9]\$[./A-Za-z0-9]{53}$/.test(hash)) { - return false; - } - if (hash[4] === "0" && Number(hash[5]) < 4) { - return false; - } - if (hash[4] === "3" && Number(hash[5]) > 1) { - return false; - } - return true; -}; -const validateVerifyOptions = (options) => { - if (!options || typeof options !== "object") { - throw new Error("Invalid options parameter. It requires an object."); - } - if (options.hash === undefined || typeof options.hash !== "string") { - throw new Error("Hash should be specified"); - } - if (options.hash.length !== 60) { - throw new Error("Hash should be 60 bytes long"); - } - if (!validateHashCharacters(options.hash)) { - throw new Error("Invalid hash"); - } - options.password = getUInt8Buffer(options.password); - if (options.password.length < 1) { - throw new Error("Password should be at least 1 byte long"); - } - if (options.password.length > 72) { - throw new Error("Password should be at most 72 bytes long"); - } -}; -/** - * Verifies password using bcrypt password-hashing function - * @returns True if the encoded hash matches the password - */ -function bcryptVerify(options) { - return __awaiter(this, void 0, void 0, function* () { - validateVerifyOptions(options); - const { hash, password } = options; - const bcryptInterface = yield WASMInterface(wasmJson$2, 0); - bcryptInterface.writeMemory(getUInt8Buffer(hash), 0); - const passwordBuffer = getUInt8Buffer(password); - bcryptInterface.writeMemory(passwordBuffer, 60); - return !!bcryptInterface.getExports().bcrypt_verify(passwordBuffer.length); - }); -} - -var name$1 = "whirlpool"; -var data$1 = "AGFzbQEAAAABEQRgAAF/YAF/AGACf38AYAAAAwkIAAECAwEDAAEFBAEBAgIGDgJ/AUHQmwULfwBBgAgLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAJSGFzaF9Jbml0AAMLSGFzaF9VcGRhdGUABApIYXNoX0ZpbmFsAAUNSGFzaF9HZXRTdGF0ZQAGDkhhc2hfQ2FsY3VsYXRlAAcKU1RBVEVfU0laRQMBCu0bCAUAQYAZC8wGAQl+IAApAwAhAUEAQQApA4CbASICNwPAmQEgACkDGCEDIAApAxAhBCAAKQMIIQVBAEEAKQOYmwEiBjcD2JkBQQBBACkDkJsBIgc3A9CZAUEAQQApA4ibASIINwPImQFBACABIAKFNwOAmgFBACAFIAiFNwOImgFB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qV4RomJhamLTCLSykpKqkSQ5V7SgooChdiFB1XFxtXNoxuIb4+Mf4kz/ta4aGIoZEpBHC"; -var hash$1 = "8d8f6035"; -var wasmJson$1 = { - name: name$1, - data: data$1, - hash: hash$1 -}; - -const mutex$1 = new Mutex(); -let wasmCache$1 = null; -/** - * Calculates Whirlpool hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ -function whirlpool(data) { - if (wasmCache$1 === null) { - return lockedCreate(mutex$1, wasmJson$1, 64).then((wasm) => { - wasmCache$1 = wasm; - return wasmCache$1.calculate(data); - }); - } - try { - const hash = wasmCache$1.calculate(data); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } -} -/** - * Creates a new Whirlpool hash instance - */ -function createWhirlpool() { - return WASMInterface(wasmJson$1, 64).then((wasm) => { - wasm.init(); - const obj = { - init: () => { - wasm.init(); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 64, - digestSize: 64, - }; - return obj; - }); -} - -var name = "sm3"; -var data = "AGFzbQEAAAABDANgAAF/YAAAYAF/AAMIBwABAgIBAAIFBAEBAgIGDgJ/AUHwiQULfwBBgAgLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAJSGFzaF9Jbml0AAELSGFzaF9VcGRhdGUAAgpIYXNoX0ZpbmFsAAQNSGFzaF9HZXRTdGF0ZQAFDkhhc2hfQ2FsY3VsYXRlAAYKU1RBVEVfU0laRQMBCtodBwUAQYAJC1EAQQBCzdy3nO7Jw/2wfzcCoIkBQQBCvOG8y6qVzpgWNwKYiQFBAELXhZG5gcCBxVo3ApCJAUEAQu+sgJyX16yKyQA3AoiJAUEAQgA3AoCJAQvvAwEIfwJAIABFDQBBACEBQQBBACgCgIkBIgIgAGoiAzYCgIkBIAJBP3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AEEAKAKgiQEiAUEYdCABQYD+A3FBCHRyIAFBCHZBgP4DcSABQRh2cnI2ApgJQQBBACgCpIkBIgFBGHQgAUGA/gNxQQh0ciABQQh2QYD+A3EgAUEYdnJyNgKcCSAAQRBqJAALBgBBgIkBC5UCAQR/QQBCzdy3nO7Jw/2wfzcCoIkBQQBCvOG8y6qVzpgWNwKYiQFBAELXhZG5gcCBxVo3ApCJAUEAQu+sgJyX16yKyQA3AoiJAUEAQgA3AoCJAQJAIABFDQBBACAANgKAiQFBgAkhAQJAIABBwABJDQBBgAkhAQNAIAEQAyABQcAAaiEBIABBQGoiAEE/Sw0ACyAARQ0BCyAAQX9qIQICQAJAIABBB3EiAw0AQaiJASEEDAELIABBeHEhAEGoiQEhBANAIAQgAS0AADoAACAEQQFqIQQgAUEBaiEBIANBf2oiAw0ACwsgAkEHSQ0AA0AgBCABKQAANwAAIARBCGohBCABQQhqIQEgAEF4aiIADQALCxAECwtRAgBBgAgLBGgAAAAAQZAIC0CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; -var hash = "b6fb4b8e"; -var wasmJson = { - name: name, - data: data, - hash: hash -}; - -const mutex = new Mutex(); -let wasmCache = null; -/** - * Calculates SM3 hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ -function sm3(data) { - if (wasmCache === null) { - return lockedCreate(mutex, wasmJson, 32).then((wasm) => { - wasmCache = wasm; - return wasmCache.calculate(data); - }); - } - try { - const hash = wasmCache.calculate(data); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } -} -/** - * Creates a new SM3 hash instance - */ -function createSM3() { - return WASMInterface(wasmJson, 32).then((wasm) => { - wasm.init(); - const obj = { - init: () => { - wasm.init(); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 64, - digestSize: 32, - }; - return obj; - }); -} - -export { adler32, argon2Verify, argon2d, argon2i, argon2id, bcrypt, bcryptVerify, blake2b, blake2s, blake3, crc32, crc64, createAdler32, createBLAKE2b, createBLAKE2s, createBLAKE3, createCRC32, createCRC64, createHMAC, createKeccak, createMD4, createMD5, createRIPEMD160, createSHA1, createSHA224, createSHA256, createSHA3, createSHA384, createSHA512, createSM3, createWhirlpool, createXXHash128, createXXHash3, createXXHash32, createXXHash64, keccak, md4, md5, pbkdf2, ripemd160, scrypt, sha1, sha224, sha256, sha3, sha384, sha512, sm3, whirlpool, xxhash128, xxhash3, xxhash32, xxhash64 }; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/index.esm.min.js b/tools/mnemonic-test/node_modules/hash-wasm/dist/index.esm.min.js deleted file mode 100644 index 06a4951c..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/index.esm.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * hash-wasm (https://www.npmjs.com/package/hash-wasm) - * (c) Dani Biro - * @license MIT - */ - -var A,I={name:"adler32",data:"AGFzbQEAAAABDANgAAF/YAAAYAF/AAMHBgABAgEAAgUEAQECAgYOAn8BQYCJBQt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQAAQtIYXNoX1VwZGF0ZQACCkhhc2hfRmluYWwAAw1IYXNoX0dldFN0YXRlAAQOSGFzaF9DYWxjdWxhdGUABQpTVEFURV9TSVpFAwEK6wkGBQBBgAkLCgBBAEEBNgKECAvjCAEHf0EAKAKECCIBQf//A3EhAiABQRB2IQMCQAJAIABBAUcNACACQQAtAIAJaiIBQY+AfGogASABQfD/A0sbIgEgA2oiBEEQdCIFQYCAPGogBSAEQfD/A0sbIAFyIQEMAQsCQAJAAkACQAJAIABBEEkNAEGACSEGIABBsCtJDQFBgAkhBgNAQQ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VFDQAgAEF8cSEAIAUhBCAGIQEDQCACIAEtAABqIgIgA2ohAyABQQFqIQEgBEF/aiIEDQALIAYgBWohBgsgB0EDSQ0AA0AgAiAGLQAAaiIBIAYtAAFqIgQgBi0AAmoiBSAGQQNqLQAAaiICIAUgBCABIANqampqIQMgBkEEaiEGIABBfGoiAA0ACwsgA0Hx/wNwIQMgAkHx/wNwIQILIAIgA0EQdHIhAQtBACABNgKECAsxAQF/QQBBACgChAgiAEEYdCAAQYD+A3FBCHRyIABBCHZBgP4DcSAAQRh2cnI2AoAJCwUAQYQICzsAQQBBATYChAggABACQQBBACgChAgiAEEYdCAAQYD+A3FBCHRyIABBCHZBgP4DcSAAQRh2cnI2AoAJCwsVAgBBgAgLBAQAAAAAQYQICwQBAAAA",hash:"02ddbd17"};function B(A,I,B,g){return new(B||(B=Promise))((function(Q,C){function i(A){try{o(g.next(A))}catch(A){C(A)}}function E(A){try{o(g.throw(A))}catch(A){C(A)}}function o(A){var I;A.done?Q(A.value):(I=A.value,I instanceof B?I:new B((function(A){A(I)}))).then(i,E)}o((g=g.apply(A,I||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class g{constructor(){this.mutex=Promise.resolve()}lock(){let A=()=>{};return this.mutex=this.mutex.then((()=>new Promise(A))),new Promise((I=>{A=I}))}dispatch(A){return B(this,void 0,void 0,(function*(){const I=yield this.lock();try{return yield Promise.resolve(A())}finally{I()}}))}}const Q="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,C=null!==(A=Q.Buffer)&&void 0!==A?A:null,i=Q.TextEncoder?new Q.TextEncoder:null;function E(A,I){return(15&A)+(A>>6|A>>3&8)<<4|(15&I)+(I>>6|I>>3&8)}function o(A,I){const B=I.length>>1;for(let g=0;g>>4;A[g++]=B>9?B+F:B+D,B=15&I[Q],A[g++]=B>9?B+F:B+D}return String.fromCharCode.apply(null,A)}const h=null!==C?A=>{if("string"==typeof A){const I=C.from(A,"utf8");return new Uint8Array(I.buffer,I.byteOffset,I.length)}if(C.isBuffer(A))return new Uint8Array(A.buffer,A.byteOffset,A.length);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")}:A=>{if("string"==typeof A)return i.encode(A);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")},a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",w=new Uint8Array(256);for(let A=0;A>18&63)+a.charAt(B>>12&63)+a.charAt(B>>6&63)+a.charAt(63&B);Q.push(g)}if(1===g){const g=A[B-1],C=a.charAt(g>>2),i=a.charAt(g<<4&63);Q.push(`${C}${i}`),I&&Q.push("==")}else if(2===g){const g=(A[B-2]<<8)+A[B-1],C=a.charAt(g>>10),i=a.charAt(g>>4&63),E=a.charAt(g<<2&63);Q.push(`${C}${i}${E}`),I&&Q.push("=")}return Q.join("")}function G(A){let I=Math.floor(.75*A.length);const B=A.length;return"="===A[B-1]&&(I-=1,"="===A[B-2]&&(I-=1)),I}function n(A){const I=G(A),B=A.length,g=new Uint8Array(I);let Q=0;for(let I=0;I>4,Q+=1,g[Q]=(15&C)<<4|i>>2,Q+=1,g[Q]=(3&i)<<6|63&E,Q+=1}return g}const y=new g,H=new Map;function d(A,I){return B(this,void 0,void 0,(function*(){let g=null,Q=null,C=!1;if("undefined"==typeof WebAssembly)throw new Error("WebAssembly is not supported in this environment!");const i=()=>new DataView(g.exports.memory.buffer).getUint32(g.exports.STATE_SIZE,!0),F=y.dispatch((()=>B(this,void 0,void 0,(function*(){if(!H.has(A.name)){const I=n(A.data),B=WebAssembly.compile(I);H.set(A.name,B)}const I=yield H.get(A.name);g=yield WebAssembly.instantiate(I,{})})))),D=(A=null)=>{C=!0,g.exports.Hash_Init(A)},a=A=>{if(!C)throw new Error("update() called before init()");(A=>{let I=0;for(;I{if(!C)throw new Error("digest() called before init()");return C=!1,g.exports.Hash_Final(B),"binary"===A?Q.slice(0,I):c(w,Q,I)},G=A=>"string"==typeof A?A.length<4096:A.byteLength<16384;let d=G;switch(A.name){case"argon2":case"scrypt":d=()=>!0;break;case"blake2b":case"blake2s":d=(A,I)=>I<=512&&G(A);break;case"blake3":d=(A,I)=>0===I&&G(A);break;case"xxhash64":case"xxhash3":case"xxhash128":case"crc64":d=()=>!1}return yield(()=>B(this,void 0,void 0,(function*(){g||(yield F);const A=g.exports.Hash_GetBuffer(),I=g.exports.memory.buffer;Q=new Uint8Array(I,A,16384)})))(),{getMemory:()=>Q,writeMemory:(A,I=0)=>{Q.set(A,I)},getExports:()=>g.exports,setMemorySize:A=>{g.exports.Hash_SetMemorySize(A);const I=g.exports.Hash_GetBuffer(),B=g.exports.memory.buffer;Q=new Uint8Array(B,I,A)},init:D,update:a,digest:k,save:()=>{if(!C)throw new Error("save() can only be called after init() and before digest()");const I=g.exports.Hash_GetState(),B=i(),Q=g.exports.memory.buffer,E=new Uint8Array(Q,I,B),F=new Uint8Array(4+B);return o(F,A.hash),F.set(E,4),F},load:I=>{if(!(I instanceof Uint8Array))throw new Error("load() expects an Uint8Array generated by save()");const B=g.exports.Hash_GetState(),Q=i(),o=4+Q,F=g.exports.memory.buffer;if(I.length!==o)throw new Error(`Bad state length (expected ${o} bytes, got ${I.length})`);if(!function(A,I){if(A.length!==2*I.length)return!1;for(let B=0;B{if(!d(A,B))return D(B),a(A),k("hex",C);const i=h(A);return Q.set(i),g.exports.Hash_Calculate(i.length,B,C),c(w,Q,I)},hashLength:I}}))}function U(A,I,g){return B(this,void 0,void 0,(function*(){const B=yield A.lock(),Q=yield d(I,g);return B(),Q}))}const e=new g;let S=null;function N(A){if(null===S)return U(e,I,4).then((I=>(S=I,S.calculate(A))));try{const I=S.calculate(A);return Promise.resolve(I)}catch(A){return Promise.reject(A)}}function t(){return d(I,4).then((A=>{A.init();const I={init:()=>(A.init(),I),update:B=>(A.update(B),I),digest:I=>A.digest(I),save:()=>A.save(),load:B=>(A.load(B),I),blockSize:4,digestSize:4};return I}))}var J={name:"argon2",data:"AGFzbQEAAAABKQVgAX8Bf2AAAX9gEH9/f39/f39/f39/f39/f38AYAR/f39/AGACf38AAwYFAAECAwQFBgEBAoCAAgYIAX8BQZCoBAsHQQQGbWVtb3J5AgASSGFzaF9TZXRNZW1vcnlTaXplAAAOSGFzaF9HZXRCdWZmZXIAAQ5IYXNoX0NhbGN1bGF0ZQAECvEyBVgBAn9BACEBAkAgAEEAKAKICCICRg0AAkAgACACayIAQRB2IABBgIB8cSAASWoiAEAAQX9HDQBB/wHADwtBACEBQQBBACkDiAggAEEQdK18NwOICAsgAcALcAECfwJAQQAoAoAIIgANAEEAPwBBEHQiADYCgAhBACgCiAgiAUGAgCBGDQACQEGAgCAgAWsiAEEQdiAAQYCAfHEgAElqIgBAAEF/Rw0AQQAPC0EAQQApA4gIIABBEHStfDcDiAhBACgCgAghAAsgAAvcDgECfiAAIAQpAwAiECAAKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAMIBAgDCkDAIVCIIkiEDcDACAIIBAgCCkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgBCAQIAQpAwCFQiiJIhA3AwAgACAQIAApAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIAwgECAMKQMAhUIwiSIQNwMAIAggECAIKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAEIBAgBCkDAIVCAYk3AwAgASAFKQMAIhAgASkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgDSAQIA0pAwCFQiCJIhA3AwAgCSAQIAkpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAUgECAFKQMAhUIoiSIQNwMAIAEgECABKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACANIBAgDSkDAIVCMIkiEDcDACAJIBAgCSkDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgBSAQIAUpAwCFQgGJNwMAIAIgBikDACIQIAIpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIA4gECAOKQMAhUIgiSIQNwMAIAogECAKKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAGIBAgBikDAIVCKIkiEDcDACACIBAgAikDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgDiAQIA4pAwCFQjCJIhA3AwAgCiAQIAopAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIAYgECAGKQMAhUIBiTcDACADIAcpAwAiECADKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAPIBAgDykDAIVCIIkiEDcDACALIBAgCykDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgByAQIAcpAwCFQiiJIhA3AwAgAyAQIAMpAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIA8gECAPKQMAhUIwiSIQNwMAIAsgECALKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAHIBAgBykDAIVCAYk3AwAgACAFKQMAIhAgACkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgDyAQIA8pAwCFQiCJIhA3AwAgCiAQIAopAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAUgECAFKQMAhUIoiSIQNwMAIAAgECAAKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAPIBAgDykDAIVCMIkiEDcDACAKIBAgCikDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgBSAQIAUpAwCFQgGJNwMAIAEgBikDACIQIAEpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAwgECAMKQMAhUIgiSIQNwMAIAsgECALKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAGIBAgBikDAIVCKIkiEDcDACABIBAgASkDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgDCAQIAwpAwCFQjCJIhA3AwAgCyAQIAspAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIAYgECAGKQMAhUIBiTcDACACIAcpAwAiECACKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACANIBAgDSkDAIVCIIkiEDcDACAIIBAgCCkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgByAQIAcpAwCFQiiJIhA3AwAgAiAQIAIpAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIA0gECANKQMAhUIwiSIQNwMAIAggECAIKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAHIBAgBykDAIVCAYk3AwAgAyAEKQMAIhAgAykDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgDiAQIA4pAwCFQiCJIhA3AwAgCSAQIAkpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAQgECAEKQMAhUIoiSIQNwMAIAMgECADKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAOIBAgDikDAIVCMIkiEDcDACAJIBAgCSkDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgBCAQIAQpAwCFQgGJNwMAC98aAQN/QQAhBEEAIAIpAwAgASkDAIU3A5AIQQAgAikDCCABKQMIhTcDmAhBACACKQMQIAEpAxCFNwOgCEEAIAIpAxggASkDGIU3A6gIQQAgAikDICABKQMghTcDsAhBACACKQMoIAEpAyiFNwO4CEEAIAIpAzAgASkDMIU3A8AIQQAgAikDOCABKQM4hTcDyAhBACACKQNAIAEpA0CFNwPQCEEAIAIpA0ggASkDSIU3A9gIQQAgAikDUCABKQNQhTcD4AhBACACKQNYIAEpA1iFNwPoCEEAIAIpA2AgASkDYIU3A/AIQQAgAikDaCABKQNohTcD+AhBACACKQNwIAEpA3CFNwOACUEAIAIpA3ggASkDeIU3A4gJQQAgAikDgAEgASkDgAGFNwOQCUEAIAIpA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qIsBQvnC+JuRo7Pw2wCFNwO4iQFBACADp0H/AXE2AuSKAQJAIAFBAUgNACACQgA3A3ggAkIANwNwIAJCADcDaCACQgA3A2AgAkIANwNYIAJCADcDUCACQgA3A0ggAkIANwNAIAJCADcDOCACQgA3AzAgAkIANwMoIAJCADcDICACQgA3AxggAkIANwMQIAJCADcDCCACQgA3AwBBACEEA0AgAiAAaiAAQYAJai0AADoAACAAQQFqIQAgBEEBaiIEQf8BcSABSA0ACyACQYABEAELIAJBgAFqJAALEgAgAEEDdkH/P3EgAEEQdhAECwkAQYAJIAAQAQsGAEGAiQELGwAgAUEDdkH/P3EgAUEQdhAEQYAJIAAQARADCwsLAQBBgAgLBPAAAAA=",hash:"c6f286e6"};const q=new g;let M=null;function K(A){return!Number.isInteger(A)||A<8||A>512||A%8!=0?new Error("Invalid variant! Valid values: 8, 16, ..., 512"):null}function p(A,I){return A|I<<16}function s(A,I=512,B=null){if(K(I))return Promise.reject(K(I));let g=null,Q=I;if(null!==B){if(g=h(B),g.length>64)return Promise.reject(new Error("Max key length is 64 bytes"));Q=p(I,g.length)}const C=I/8;if(null===M||M.hashLength!==C)return U(q,f,C).then((I=>(M=I,Q>512&&M.writeMemory(g),M.calculate(A,Q))));try{Q>512&&M.writeMemory(g);const I=M.calculate(A,Q);return Promise.resolve(I)}catch(A){return Promise.reject(A)}}function Y(A=512,I=null){if(K(A))return Promise.reject(K(A));let B=null,g=A;if(null!==I){if(B=h(I),B.length>64)return Promise.reject(new Error("Max key length is 64 bytes"));g=p(A,B.length)}const Q=A/8;return d(f,Q).then((A=>{g>512&&A.writeMemory(B),A.init(g);const I={init:g>512?()=>(A.writeMemory(B),A.init(g),I):()=>(A.init(g),I),update:B=>(A.update(B),I),digest:I=>A.digest(I),save:()=>A.save(),load:B=>(A.load(B),I),blockSize:128,digestSize:Q};return I}))}const r=new DataView(new ArrayBuffer(4));function R(A){return r.setInt32(0,A,!0),new Uint8Array(r.buffer)}function l(A,I,g){return B(this,void 0,void 0,(function*(){if(g<=64){const A=yield Y(8*g);return A.update(R(g)),A.update(I),A.digest("binary")}const B=Math.ceil(g/32)-2,Q=new Uint8Array(g);A.init(),A.update(R(g)),A.update(I);let C=A.digest("binary");Q.set(C.subarray(0,32),0);for(let I=1;I{var I;if(!A||"object"!=typeof A)throw new Error("Invalid options parameter. It requires an object.");if(!A.password)throw new Error("Password must be specified");if(A.password=h(A.password),A.password.length<1)throw new Error("Password must be specified");if(!A.salt)throw new Error("Salt must be specified");if(A.salt=h(A.salt),A.salt.length<8)throw new Error("Salt should be at least 8 bytes long");if(A.secret=h(null!==(I=A.secret)&&void 0!==I?I:""),!Number.isInteger(A.iterations)||A.iterations<1)throw new Error("Iterations should be a positive number");if(!Number.isInteger(A.parallelism)||A.parallelism<1)throw new Error("Parallelism should be a positive number");if(!Number.isInteger(A.hashLength)||A.hashLength<4)throw new Error("Hash length should be at least 4 bytes.");if(!Number.isInteger(A.memorySize))throw new Error("Memory size should be specified.");if(A.memorySize<8*A.parallelism)throw new Error("Memory size should be at least 8 * parallelism.");if(void 0===A.outputType&&(A.outputType="hex"),!["hex","binary","encoded"].includes(A.outputType))throw new Error(`Insupported output type ${A.outputType}. Valid values: ['hex', 'binary', 'encoded']`)};function V(A){return B(this,void 0,void 0,(function*(){return z(A),X(Object.assign(Object.assign({},A),{hashType:"i"}))}))}function Z(A){return B(this,void 0,void 0,(function*(){return z(A),X(Object.assign(Object.assign({},A),{hashType:"id"}))}))}function m(A){return B(this,void 0,void 0,(function*(){return z(A),X(Object.assign(Object.assign({},A),{hashType:"d"}))}))}function L(A){return B(this,void 0,void 0,(function*(){(A=>{if(!A||"object"!=typeof A)throw new Error("Invalid options parameter. It requires an object.");if(void 0===A.hash||"string"!=typeof A.hash)throw new Error("Hash should be specified")})(A);const I=((A,I,B)=>{const g=I.match(/^\$argon2(id|i|d)\$v=([0-9]+)\$((?:[mtp]=[0-9]+,){2}[mtp]=[0-9]+)\$([A-Za-z0-9+/]+)\$([A-Za-z0-9+/]+)$/);if(!g)throw new Error("Invalid hash");const[,Q,C,i,E,o]=g;if("19"!==C)throw new Error(`Unsupported version: ${C}`);const F={},D={m:"memorySize",p:"parallelism",t:"iterations"};for(const A of i.split(",")){const[I,B]=A.split("=");F[D[I]]=Number(B)}return Object.assign(Object.assign({},F),{password:A,secret:B,hashType:Q,salt:n(E),hashLength:G(o),outputType:"encoded"})})(A.password,A.hash,A.secret);z(I);const B=A.hash.lastIndexOf("$")+1;return(yield X(I)).substring(B)===A.hash.substring(B)}))}var W={name:"blake2s",data:"AGFzbQEAAAABEQRgAAF/YAJ/fwBgAX8AYAAAAwkIAAECAwICAAEFBAEBAgIGDgJ/AUGgigULfwBBgAgLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAKSGFzaF9GaW5hbAADCUhhc2hfSW5pdAAEC0hhc2hfVXBkYXRlAAUNSGFzaF9HZXRTdGF0ZQAGDkhhc2hfQ2FsY3VsYXRlAAcKU1RBVEVfU0laRQMBCr4yCAUAQYAJC6gFAQZ/AkAgAUEBSA0AAkACQAJAIAFBwABBACgC8IkBIgJrIgNKDQAgASEDDAELQQBBADYC8IkBAkAgAkHAAEYNACACQbCJAWohBAJAAkAgA0EHcSIFDQAgACEGIAMhBwwBCyAFIQcgACEGA0AgBCAGLQAAOgAAIARBAWohBCAGQQFqIQYgB0F/aiIHDQALQcAAIAIgBWprIQcLIAJBR2pBB0kNAANAIAQgBi0AADoAACAEIAYtAAE6AAEgBCAGLQACOgACIAQgBi0AAzoAAyAEIAYtAAQ6AAQgBCAGLQAFOgAFIAQgBi0ABjoABiAEIAYtAAc6AAcgBEEIaiEEIAZBCGohBiAHQXhqIgcNAAsLQQAhBEEAQQAoAqCJASIGQcAAajYCoIkBQQBBACgCpIkBIAZBv39LajYCpIkBQbCJARACIAAgA2ohAAJAIAEgA2siA0HBAEgNACACIAFqIQQDQEEAQQAoAqCJASIGQcAAajYCoIkBQQBBACgCpIkBIAZBv39LajYCpIkBIAAQAiAA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t7czYChIkBQQBBACgCiIoBQfLmu+MDczYCiIkBQQBBACgCjIoBQbrqv6p6czYCjIkBQQBBACgCkIoBQf+kuYgFczYCkIkBQQBBACgClIoBQYzRldh5czYClIkBQQBBACgCmIoBQauzj/wBczYCmIkBQQAgBEH/AXE2AvSJAUEAQQAoApyKAUGZmoPfBXM2ApyJAQJAIABBgIAESQ0AIAFBOGpCADcDACABQTBqQgA3AwAgAUEoakIANwMAIAFBIGpCADcDACABQRhqQgA3AwAgAUEQakIANwMAIAFCADcDCCABQgA3AwBBACEAA0AgASADaiADQYAJai0AADoAACADQQFqIQMgAiAAQQFqIgBB/wFxSw0ACyABQcAAEAELIAFBwABqJAALCQBBgAkgABABCwYAQYCJAQsPACABEARBgAkgABABEAMLCwsBAEGACAsEfAAAAA==",hash:"5c0ff166"};const u=new g;let x=null;function O(A){return!Number.isInteger(A)||A<8||A>256||A%8!=0?new Error("Invalid variant! Valid values: 8, 16, ..., 256"):null}function P(A,I){return A|I<<16}function b(A,I=256,B=null){if(O(I))return Promise.reject(O(I));let g=null,Q=I;if(null!==B){if(g=h(B),g.length>32)return Promise.reject(new Error("Max key length is 32 bytes"));Q=P(I,g.length)}const C=I/8;if(null===x||x.hashLength!==C)return U(u,W,C).then((I=>(x=I,Q>512&&x.writeMemory(g),x.calculate(A,Q))));try{Q>512&&x.writeMemory(g);const I=x.calculate(A,Q);return Promise.resolve(I)}catch(A){return Promise.reject(A)}}function v(A=256,I=null){if(O(A))return Promise.reject(O(A));let B=null,g=A;if(null!==I){if(B=h(I),B.length>32)return Promise.reject(new Error("Max key length is 32 bytes"));g=P(A,B.length)}const Q=A/8;return d(W,Q).then((A=>{g>512&&A.writeMemory(B),A.init(g);const I={init:g>512?()=>(A.writeMemory(B),A.init(g),I):()=>(A.init(g),I),update:B=>(A.update(B),I),digest:I=>A.digest(I),save:()=>A.save(),load:B=>(A.load(B),I),blockSize:64,digestSize:Q};return I}))}var j={name:"blake3",data:"AGFzbQEAAAABMQdgAAF/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hCkIBIABBAXKteUI/hYanIQIDQCACIhFBAXYhAiAKIBFBf2qtg0IAUg0ACyARQQp2rSESAkACQCARQYAISw0AIAFBADsB2AEgAUIANwPQASABQgA3A8gBIAFCADcDwAEgAUIANwO4ASABQgA3A7ABIAFCADcDqAEgAUIANwOgASABQgA3A5gBIAFBACkDgIkBNwNwIAFBACkDiIkBNwN4IAFBACkDkIkBNwOAASABQQAtAIqKAToA2gEgAUEAKQOYiQE3A4gBIAEgBDcDkAEgAUHwAGogAyAREAQgASABKQNwIgQ3AwAgASABKQN4IgU3AwggASABKQOAASIGNwMQIAEgASkDiAEiBzcDGCABIAEpA5gBNwMoIAEgASkDoAE3AzAgASABKQOoATcDOCABLQDaASECIAEtANkBIQsgASkDkAEhCiABIAEtANgBIgg6AGggASAKNwMgIAEgASkDsAE3A0AgASABKQO4ATcDSCABIAEpA8ABNwNQIAEgASkDyAE3A1ggASABKQPQATcDYCABIAIgC0VyQQJyIgI6AGkgASAHNwO4AiABIAY3A7ACIAEgBTcDqAIgASAENwOgAiABQeABaiABQaACaiAQIAggCiACQf8BcRACIAEpA4ACIQQgASkD4AEhBSABKQOIAiEGIAEpA+gBIQcgASkDkAIhDCABKQPwASENIAEpA5gCIQ4gASkD+AEhDyAKEAVBAEEALQCQigEiAkEBajoAkIoBIAJBBXQiAkGpigFqIA4gD4U3AwAgAkGhigFqIAwgDYU3AwAgAkGZigFqIAYgB4U3AwAgAkGRigFqIAQgBYU3AwAMAQsCQAJAIAMgESAEQQAtAIqKASICIAEQBiITQQJLDQAgASkDGCEKIAEpAxAhBCABKQMIIQUgASkDACEGDAELIAJBBHIhFEEAKQOYiQEhDUEAKQOQiQEhDkEAKQOIiQEhD0EAKQOAiQEhFQNAIBNBfmoiFkEBdiIXQQFqIhhBA3EhCEEAIQkCQCAWQQZJDQAgGEH8////B3EhGUEAIQkgAUHIAmohAiABIQsDQCACIAs2AgAgAkEMaiALQcABajYCACACQQhqIAtBgAFqNgIAIAJBBGogC0HAAGo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igFBBHIhBCABQShqIQVBACkDmIkBIQBBACkDkIkBIQZBACkDiIkBIQdBACkDgIkBIQggAyEJA0AgASAANwMYIAEgBjcDECABIAc3AwggASAINwMAIAEgA0EFdCIDQdGJAWoiCikDADcDKCABIANB2YkBaiILKQMANwMwIAEgA0HhiQFqIgwpAwA3AzggASADQemJAWoiDSkDADcDQCABIANB8YkBaikDADcDSCABIANB+YkBaikDADcDUCABIANBgYoBaikDADcDWCADQYmKAWopAwAhDiABQcAAOgBoIAEgDjcDYCABQgA3AyAgASAEOgBpIAEgADcDiAEgASAGNwOAASABIAc3A3ggASAINwNwIAFBkAFqIAFB8ABqIAVBwABCACAEQf8BcRACIAEpA7ABIQ4gASkDkAEhDyABKQO4ASEQIAEpA5gBIREgASkDwAEhEiABKQOgASETIA0gASkDyAEgASkDqAGFNwMAIAwgEiAThTcDACALIBAgEYU3AwAgCiAOIA+FNwMAIAlBf2oiCUH/AXEiAyACSw0AC0EAIAk6AJCKAQsgAUHQAWokAAvHCQIKfwV+IwBB4AJrIgUkAAJAAkAgAUGACEsNACAFIAA2AvwBIAVB/AFqIAFBgAhGIgZBECACQQEgA0EBQQIgBBABIAZBCnQiByABTw0BIAVB4ABqIgZCADcDACAFQdgAaiIIQgA3AwAgBUHQAGoiCUIANwMAIAVByABqIgpCADcDACAFQcAAaiILQgA3AwAgBUE4aiIMQgA3AwAgBUEwaiINQgA3AwAgBSADOgBqIAVCADcDKCAFQQA7AWggBUEAKQOAiQE3AwAgBUEAKQOIiQE3AwggBUEAKQOQiQE3AxAgBUEAKQOYiQE3AxggBSABQYAIRiIOrSACfDcDICAFIAAgB2pBACABIA4bEAQgBUGIAWpBMGogDSkDADcDACAFQYgBakE4aiAMKQMANwMAIAUgBSkDACIPNwOIASAFIAUpAwgiEDcDkAEgBSAFKQMQIhE3A5gBIAUgBSkDGCISNwOgASAFIAUpAyg3A7ABIAUtAGohACAFLQBpIQcgBSkDICECIAUtAGghASAFQYgBakHAAGogCykDADcDACAFQYg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CAARQ0AAkBBAC0AkIoBIgINACABQTBqQQApA9CJATcDACABQThqQQApA9iJATcDACABQQApA6CJASIDNwMAIAFBACkDqIkBIgQ3AwggAUEAKQOwiQEiBTcDECABQQApA7iJASIGNwMYIAFBACkDyIkBNwMoQQAtAIqKASECQQAtAImKASEHQQApA8CJASEIQQAtAIiKASEJIAFBwABqQQApA+CJATcDACABQcgAakEAKQPoiQE3AwAgAUHQAGpBACkD8IkBNwMAIAFB2ABqQQApA/iJATcDACABQeAAakEAKQOAigE3AwAgASAJOgBoIAEgCDcDICABIAIgB0VyIgJBAnI6AGkgAUEoaiEKQgAhCEGACSELIAJBCnJB/wFxIQwDQCABQbABaiABIAogCUH/AXEgCCAMEAIgASABKQPQASINIAEpA7ABhTcDcCABIAEpA9gBIg4gASkDuAGFNwN4IAEgASkD4AEiDyABKQPAAYU3A4ABIAEgASkD6AEiECAGhTcDqAEgASAPIAWFNwOgASABIA4gBIU3A5gBIAEgDSADhTcDkAEgASAQIAEpA8gBhTcDiAEgAEHAACAAQcAASRsiEUF/aiESAkACQCARQQdxIhMNACABQfAAaiECIAshByARIRQMAQsgEUH4AHEhFCABQfAAaiECIAshBwNAIAcgAi0AADoAACAHQQFqIQcgAkEBaiECIBNBf2oiEw0ACwsCQCASQQdJDQADQCAHIAIpAAA3AAAgB0EIaiEHIAJBCGohAiAUQXhqIhQNAAsLIAhCAXwhCCALIBFqIQsgACARayIADQAMAgsLAkACQAJAQQAtAImKASIHQQZ0QQBBAC0AiIoBIhFrRg0AIAEgEToAaCABQQApA4CKATcDYCABQQApA/iJATcDWCABQQApA/CJATcDUCABQQApA+iJATcDSCABQQApA+CJATcDQCABQQApA9iJATcDOCABQQApA9CJATcDMCABQQApA8iJATcDKCABQQApA8CJASIINwMgIAFBACkDuIkBIgM3AxggAUEAKQOwiQEiBDcDECABQQApA6iJASIFNwMIIAFBACkDoIkBIgY3AwAgAUEALQCKigEiEyAHRXJBAnIiCzoAaSATQQRyIRNBACkDmIkBIQ1BACkDkIkBIQ5BACkDiIkBIQ9BACkDgIkBIRAMAQtBwAAhESABQcAAOgBoQgAhCCABQgA3AyAgAUEAKQOYiQEiDTcDGCABQQApA5CJASIONwMQIAFBACkDiIkBIg83AwggAUEAKQOAiQEiEDcDACABQQAtAIqKAUEEciITOgBpIAEgAkF+aiICQQV0IgdByYoBaikDADcDYCABIAdBwYoBaikDADcDWCABIAdBuYoBaikDADcDUCABIAdBsYoBaikDADcDSCABIAdBqYoBaikDADcDQCABIAdBoYoBaikDADcDOCABIAdBmYoBaikDADcDMCABIAdBkYoBaikDADcDKCATIQsgECEGIA8hBSAOIQQgDSEDIAJFDQELIAJBf2oiB0EFdCIUQZGKAWopAwAhFSAUQZmKAWopAwAhFiAUQaGKAWopAwAhFyAUQamKAWopAwAhGCABIAM3A4gBIAEgBDcDgAEgASAFNwN4IAEgBjcDcCABQbABaiABQfAAaiABQShqIhQgESAIIAtB/wFxEAIgASATOgBpIAFBwAA6AGggASAYNwNAIAEgFzcDOCABIBY3AzAgASAVNwMoIAFCADcDICABIA03AxggASAONwMQIAEgDzcDCCABIBA3AwAgASABKQPoASABKQPIAYU3A2AgASABKQPgASABKQPAAYU3A1ggASABKQPYASABKQO4AYU3A1AgASABKQPQASABKQOwAYU3A0ggB0UNACACQQV0QemJAWohAiATQf8BcSERA0AgAkFoaikDACEIIAJBcGopAwAhAyACQXhqKQMAIQQgAikDACEFIAEgDTcDiAEgASAONwOAASABIA83A3ggASAQNwNwIAFBsAFqIAFB8ABqIBRBwABCACAREAIgASATOgBpIAFBwAA6AGggASAFNwNAIAEgBDcDOCABIAM3AzAgASAINwMoIAFCADcDICABIA03AxggASAONwMQIAEgDzcDCCABIBA3AwAgASABKQPoASABKQPIAYU3A2AgASABKQPgASABKQPAAYU3A1ggASABKQPYASABKQO4AYU3A1AgASABKQPQASABKQOwAYU3A0ggAkFgaiECIAdBf2oiBw0ACwsgAUEoaiEJQgAhCEGACSELIBNBCHJB/wFxIQoDQCABQbABaiABIAl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CJAUEAIAM3A7iJAUEAIAQ3A7CJAUEAIAU3A6iJAUEAIAY3A6CJAUEAIAM3A5iJAUEAIAQ3A5CJAUEAIAU3A4iJAUEAIAY3A4CJAUEAQQA6AJCKAUEAQQA7AYiKASAAEAMgAhAHCwsLAQBBgAgLBHgHAAA=",hash:"215d875f"};const T=new g;let $=null;function _(A){return!Number.isInteger(A)||A<8||A%8!=0?new Error("Invalid variant! Valid values: 8, 16, ..."):null}function AA(A,I=256,B=null){if(_(I))return Promise.reject(_(I));let g=null,Q=0;if(null!==B){if(g=h(B),32!==g.length)return Promise.reject(new Error("Key length must be exactly 32 bytes"));Q=32}const C=I/8,i=C;if(null===$||$.hashLength!==C)return U(T,j,C).then((I=>($=I,32===Q&&$.writeMemory(g),$.calculate(A,Q,i))));try{32===Q&&$.writeMemory(g);const I=$.calculate(A,Q,i);return Promise.resolve(I)}catch(A){return Promise.reject(A)}}function IA(A=256,I=null){if(_(A))return Promise.reject(_(A));let B=null,g=0;if(null!==I){if(B=h(I),32!==B.length)return Promise.reject(new Error("Key length must be exactly 32 bytes"));g=32}const Q=A/8,C=Q;return d(j,Q).then((A=>{32===g&&A.writeMemory(B),A.init(g);const I={init:32===g?()=>(A.writeMemory(B),A.init(g),I):()=>(A.init(g),I),update:B=>(A.update(B),I),digest:I=>A.digest(I,C),save:()=>A.save(),load:B=>(A.load(B),I),blockSize:64,digestSize:Q};return I}))}var BA={name:"crc32",data:"AGFzbQEAAAABEQRgAAF/YAF/AGAAAGACf38AAwgHAAEBAQIAAwUEAQECAgYOAn8BQZDJBQt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQAAgtIYXNoX1VwZGF0ZQADCkhhc2hfRmluYWwABA1IYXNoX0dldFN0YXRlAAUOSGFzaF9DYWxjdWxhdGUABgpTVEFURV9TSVpFAwEKkggHBQBBgAkLwwMBA39BgIkBIQFBACECA0AgAUEAQQBBAEEAQQBBAEEAQQAgAkEBcWs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dnMhASACQQJqIQIgA0F+aiIDDQALC0EAIAFBf3M2AoTJAQsyAQF/QQBBACgChMkBIgBBGHQgAEGA/gNxQQh0ciAAQQh2QYD+A3EgAEEYdnJyNgKACQsGAEGEyQELWQACQEEAKAKAyQEgAUYNACABEAFBACABNgKAyQELQQBBADYChMkBIAAQA0EAQQAoAoTJASIBQRh0IAFBgP4DcUEIdHIgAUEIdkGA/gNxIAFBGHZycjYCgAkLCwsBAEGACAsEBAAAAA==",hash:"d2eba587"};const gA=new g;let QA=null;function CA(A){return!Number.isInteger(A)||A<0||A>4294967295?new Error("Polynomial must be a valid 32-bit long unsigned integer"):null}function iA(A,I=3988292384){if(CA(I))return Promise.reject(CA(I));if(null===QA)return U(gA,BA,4).then((B=>(QA=B,QA.calculate(A,I))));try{const B=QA.calculate(A,I);return Promise.resolve(B)}catch(A){return Promise.reject(A)}}function EA(A=3988292384){return CA(A)?Promise.reject(CA(A)):d(BA,4).then((I=>{I.init(A);const B={init:()=>(I.init(A),B),update:A=>(I.update(A),B),digest:A=>I.digest(A),save:()=>I.save(),load:A=>(I.load(A),B),blockSize:4,digestSize:4};return B}))}var oA={name:"crc64",data:"AGFzbQEAAAABDANgAAF/YAAAYAF/AAMHBgABAgEAAQUEAQECAgYOAn8BQZCJBgt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQAAQtIYXNoX1VwZGF0ZQACCkhhc2hfRmluYWwAAw1IYXNoX0dldFN0YXRlAAQOSGFzaF9DYWxjdWxhdGUABQpTVEFURV9TSVpFAwEKgwgGBQBBgAkL9QMDAX4BfwJ+AkBBACkDgIkCQQApA4AJIgBRDQBBgIkBIQFCACECA0AgAUIAQgBCAEIAQgBCAEIAQgAgAkIBg30gAIMgAkIBiIUiA0IBg30gAIMgA0IBiIUiA0IBg30gAIMgA0IBiIUiA0IBg30gAIMgA0IBiIUiA0IBg30gAIMgA0IBiIUiA0IBg30gAIMgA0IBiIUiA0IBg30g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CgID8B4OEIABCKIhCgP4DgyAAQjiIhISENwOACQsGAEGIiQILAgALCwsBAEGACAsECAAAAA==",hash:"c5ac6c16"};const FA=new g;let DA=null;const cA=new Uint8Array(8);function hA(A){const I="Polynomial must be provided as a 16 char long hex string";if("string"!=typeof A||16!==A.length)return{hi:0,lo:0,err:new Error(I)};const B=Number(`0x${A.slice(0,8)}`),g=Number(`0x${A.slice(8)}`);return Number.isNaN(B)||Number.isNaN(g)?{hi:B,lo:g,err:new Error(I)}:{hi:B,lo:g,err:null}}function aA(A,I,B){const g=new DataView(A);g.setUint32(0,I,!0),g.setUint32(4,B,!0)}function wA(A,I="c96c5795d7870f42"){const{hi:B,lo:g,err:Q}=hA(I);if(null!==Q)return Promise.reject(Q);if(null===DA)return U(FA,oA,8).then((I=>(DA=I,aA(cA.buffer,g,B),DA.writeMemory(cA),DA.calculate(A))));try{aA(cA.buffer,g,B),DA.writeMemory(cA);const I=DA.calculate(A);return Promise.resolve(I)}catch(Q){return Promise.reject(Q)}}function kA(A="c96c5795d7870f42"){const{hi:I,lo:B,err:g}=hA(A);return null!==g?Promise.reject(g):d(oA,8).then((A=>{const g=new Uint8Array(8);aA(g.buffer,B,I),A.writeMemory(g),A.init();const Q={init:()=>(A.writeMemory(g),A.init(),Q),update:I=>(A.update(I),Q),digest:I=>A.digest(I),save:()=>A.save(),load:I=>(A.load(I),Q),blockSize:8,digestSize:8};return Q}))}var GA={name:"md4",data:"AGFzbQEAAAABEgRgAAF/YAAAYAF/AGACf38BfwMIBwABAgMBAAIFBAEBAgIGDgJ/AUGgigULfwBBgAgLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAJSGFzaF9Jbml0AAELSGFzaF9VcGRhdGUAAgpIYXNoX0ZpbmFsAAQNSGFzaF9HZXRTdGF0ZQAFDkhhc2hfQ2FsY3VsYXRlAAYKU1RBVEVfU0laRQMBCucUBwUAQYAJCy0AQQBC/rnrxemOlZkQNwKQiQFBAEKBxpS6lvHq5m83Ao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QFBACAANgKAiQFBmIkBQcAAEAMaQQBBACkCiIkBNwOACUEAQQApApCJATcDiAkLBgBBgIkBCzMAQQBC/rnrxemOlZkQNwKQiQFBAEKBxpS6lvHq5m83AoiJAUEAQgA3AoCJASAAEAIQBAsLCwEAQYAICwSYAAAA",hash:"bd8ce7c7"};const nA=new g;let yA=null;function HA(A){if(null===yA)return U(nA,GA,16).then((I=>(yA=I,yA.calculate(A))));try{const I=yA.calculate(A);return Promise.resolve(I)}catch(A){return Promise.reject(A)}}function dA(){return d(GA,16).then((A=>{A.init();const I={init:()=>(A.init(),I),update:B=>(A.update(B),I),digest:I=>A.digest(I),save:()=>A.save(),load:B=>(A.load(B),I),blockSize:64,digestSize:16};return I}))}var UA={name:"md5",data:"AGFzbQEAAAABEgRgAAF/YAAAYAF/AGACf38BfwMIBwABAgMBAAIFBAEBAgIGDgJ/AUGgigULfwBBgAgLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAJSGFzaF9Jbml0AAELSGFzaF9VcGRhdGUAAgpIYXNoX0ZpbmFsAAQNSGFzaF9HZXRTdGF0ZQAFDkhhc2hfQ2FsY3VsYXRlAAYKU1RBVEVfU0laRQMBCoMaBwUAQYAJCy0AQQBC/rnrxemOlZkQNwKQiQFBAEKBxpS6lvHq5m83AoiJAUEAQgA3AoCJAQu+BQEHf0EAQQAoAoCJASIBIABqQf////8BcSICNgKAiQFBAEEAKAKEiQEgAiABSWogAEEddmo2AoSJAQJAAkACQAJAAkACQCABQT9xIgMNAEGACSEEDAELIABBwAAgA2siBUkNASAFQQNxIQZBACEBAkAgA0E/c0EDSQ0AIANBgIkBaiEEIAVB/ABxIQdBACEBA0AgBCABaiICQRhqIAFBgAlqLQAAOgAAIAJBGWogAUGBCWotAAA6AAAgAkEaaiABQYIJai0AADoAACACQRtqIAFBgwlqLQAAOgAAIAcgAUEEaiIBRw0ACwsCQCAGRQ0AIANBmIkBaiECA0AgAiABaiABQYAJai0AADoAACABQQFqIQEgBkF/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gIkBQT9xIgBBmIkBakGAAToAACAAQQFqIQECQAJAAkACQCAAQT9zIgJBB0sNACACRQ0BIAFBmIkBakEAOgAAIAJBAUYNASAAQZqJAWpBADoAACACQQJGDQEgAEGbiQFqQQA6AAAgAkEDRg0BIABBnIkBakEAOgAAIAJBBEYNASAAQZ2JAWpBADoAACACQQVGDQEgAEGeiQFqQQA6AAAgAkEGRg0BIABBn4kBakEAOgAADAELIAJBCEYNAkE2IABrIgMhBAJAIAJBA3EiAEUNAEEAIABrIQRBACEAA0AgAEHPiQFqQQA6AAAgBCAAQX9qIgBHDQALIAMgAGohBAsgA0EDSQ0CDAELQZiJAUHAABADGkEAIQFBNyEECyABQYCJAWohAEF/IQIDQCAAIARqQRVqQQA2AAAgAEF8aiEAIAQgAkEEaiICRw0ACwtBAEEAKAKEiQE2AtSJAUEAQQAoAoCJASIAQRV2OgDTiQFBACAAQQ12OgDSiQFBACAAQQV2OgDRiQFBACAAQQN0IgA6ANCJAUEAIAA2AoCJAUGYiQFBwAAQAxpBAEEAKQKIiQE3A4AJQQBBACkCkIkBNwOICQsGAEGAiQELMwBBAEL+uevF6Y6VmRA3ApCJAUEAQoHGlLqW8ermbzcCiIkBQQBCADcCgIkBIAAQAhAECwsLAQBBgAgLBJgAAAA=",hash:"e6508e4b"};const eA=new g;let SA=null;function NA(A){if(null===SA)return U(eA,UA,16).then((I=>(SA=I,SA.calculate(A))));try{const I=SA.calculate(A);return Promise.resolve(I)}catch(A){return Promise.reject(A)}}function tA(){return d(UA,16).then((A=>{A.init();const I={init:()=>(A.init(),I),update:B=>(A.update(B),I),digest:I=>A.digest(I),save:()=>A.save(),load:B=>(A.load(B),I),blockSize:64,digestSize:16};return I}))}var JA={name:"sha1",data:"AGFzbQEAAAABEQRgAAF/YAF/AGAAAGACf38AAwkIAAECAwECAAEFBAEBAgIGDgJ/AUHgiQULfwBBgAgLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAJSGFzaF9Jbml0AAILSGFz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/wFxSw0ACwsLCQBBgAkgABADC6YDAQJ/IwBBEGsiACQAIABBgAE6AAcgAEEAKAKYiQEiAUEYdCABQYD+A3FBCHRyIAFBCHZBgP4DcSABQRh2cnI2AAggAEEAKAKUiQEiAUEYdCABQYD+A3FBCHRyIAFBCHZBgP4DcSABQRh2cnI2AAwgAEEHakEBEAMCQEEAKAKUiQFB+ANxQcADRg0AA0AgAEEAOgAHIABBB2pBARADQQAoApSJAUH4A3FBwANHDQALCyAAQQhqQQgQA0EAQQAoAoCJASIBQRh0IAFBgP4DcUEIdHIgAUEIdkGA/gNxIAFBGHZycjYCgAlBAEEAKAKEiQEiAUEYdCABQYD+A3FBCHRyIAFBCHZBgP4DcSABQRh2cnI2AoQJQQBBACgCiIkBIgFBGHQgAUGA/gNxQQh0ciABQQh2QYD+A3EgAUEYdnJyNgKICUEAQQAoAoyJASIBQRh0IAFBgP4DcUEIdHIgAUEIdkGA/gNxIAFBGHZycjYCjAlBAEEAKAKQiQEiAUEYdCABQYD+A3FBCHRyIAFBCHZBgP4DcSABQRh2cnI2ApAJIABBEGokAAsGAEGAiQELQwBBAEL+uevF6Y6VmRA3AoiJAUEAQoHGlLqW8ermbzcCgIkBQQBC8MPLngw3ApCJAUEAQQA2ApiJAUGACSAAEAMQBQsLCwEAQYAICwRcAAAA",hash:"6b530c24"};const fA=new g;let qA=null;function MA(A){if(null===qA)return U(fA,JA,20).then((I=>(qA=I,qA.calculate(A))));try{const I=qA.calculate(A);return Promise.resolve(I)}catch(A){return Promise.reject(A)}}function KA(){return d(JA,20).then((A=>{A.init();const I={init:()=>(A.init(),I),update:B=>(A.update(B),I),digest:I=>A.digest(I),save:()=>A.save(),load:B=>(A.load(B),I),blockSize:64,digestSize:20};return I}))}var pA={name:"sha3",data:"AGFzbQEAAAABFARgAAF/YAF/AGACf38AYAN/f38AAwgHAAEBAgEAAwUEAQECAgYOAn8BQZCNBQt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAA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5iKAUEAQgA3A5CKAUEAQgA3A4iKAUEAQgA3A4CKAUEAQcAMIAFBAXRrQQN2NgKMjQFBAEEANgKIjQEgABACQeQAQQAoAoyNASIAQQF2ayEDAkBBACgCiI0BIgFBAEgNACAAIQQCQCAAIAFGDQAgAUHIiwFqIQVBACEBA0AgBSABakEAOgAAIAFBAWoiASAAQQAoAoiNASIEa0kNAAsLIARByIsBaiIBIAEtAAAgAnI6AAAgAEHHiwFqIgEgAS0AAEGAAXI6AABByIsBIAAQA0EAQYCAgIB4NgKIjQELAkAgA0EESQ0AIANBAnYiAUEDcSEFQQAhBAJAIAFBf2pBA0kNACABQfz///8DcSEAQQAhAUEAIQQDQCABQYAKaiABQYCKAWooAgA2AgAgAUGECmogAUGEigFqKAIANgIAIAFBiApqIAFBiIoBaigCADYCACABQYwKaiABQYyKAWooAgA2AgAgAUEQaiEBIAAgBEEEaiIERw0ACwsgBUUNACAFQQJ0IQAgBEECdCEBA0AgAUGACmogAUGAigFqKAIANgIAIAFBBGohASAAQXxqIgANAAsLCwvYAQEAQYAIC9ABkAEAAAAAAAAAAAAAAAAAAAEAAAAAAAAAgoAAAAAAAACKgAAAAAAAgACAAIAAAACAi4AAAAAAAAABAACAAAAAAIGAAIAAAACACYAAAAAAAICKAAAAAAAAAIgAAAAAAAAACYAAgAAAAAAKAACAAAAAAIuAAIAAAAAAiwAAAAAAAICJgAAAAAAAgAOAAAAAAACAAoAAAAAAAICAAAAAAAAAgAqAAAAAAAAACgAAgAAAAICBgACAAAAAgICAAAAAAACAAQAAgAAAAAAIgACAAAAAgA==",hash:"fb24e536"};const sA=new g;let YA=null;function rA(A){return[224,256,384,512].includes(A)?null:new Error("Invalid variant! Valid values: 224, 256, 384, 512")}function RA(A,I=512){if(rA(I))return Promise.reject(rA(I));const B=I/8;if(null===YA||YA.hashLength!==B)return U(sA,pA,B).then((B=>(YA=B,YA.calculate(A,I,6))));try{const B=YA.calculate(A,I,6);return Promise.resolve(B)}catch(A){return Promise.reject(A)}}function lA(A=512){if(rA(A))return Promise.reject(rA(A));const I=A/8;return d(pA,I).then((B=>{B.init(A);const g={init:()=>(B.init(A),g),update:A=>(B.update(A),g),digest:A=>B.digest(A,6),save:()=>B.save(),load:A=>(B.load(A),g),blockSize:200-2*I,digestSize:I};return g}))}const XA=new g;let zA=null;function VA(A){return[224,256,384,512].includes(A)?null:new Error("Invalid variant! Valid values: 224, 256, 384, 512")}function ZA(A,I=512){if(VA(I))return Promise.reject(VA(I));const B=I/8;if(null===zA||zA.hashLength!==B)return U(XA,pA,B).then((B=>(zA=B,zA.calculate(A,I,1))));try{const B=zA.calculate(A,I,1);return Promise.resolve(B)}catch(A){return Promise.reject(A)}}function mA(A=512){if(VA(A))return Promise.reject(VA(A));const I=A/8;return d(pA,I).then((B=>{B.init(A);const g={init:()=>(B.init(A),g),update:A=>(B.update(A),g),digest:A=>B.digest(A,1),save:()=>B.save(),load:A=>(B.load(A),g),blockSize:200-2*I,digestSize:I};return g}))}var LA={name:"sha256",data:"AGFzbQEAAAABEQRgAAF/YAF/AGAAAGACf38AAwgHAAEBAQIAAwUEAQECAgYOAn8BQfCJBQt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQAAQtIYXNoX1VwZGF0ZQACCkhhc2hfRmluYWwABA1IYXNoX0dldFN0YXRlAAUOSGFzaF9DYWxjdWxhdGUABgpTVEFURV9TSVpFAwEKnEoHBQBBgAkLnQEAQQBCADcDwIkBQQBBHEEgIABB4AFGIgAbNgLoiQFBAEKnn+anxvST/b5/Qquzj/yRo7Pw2wAgABs3A+CJAUEAQrGWgP6fooWs6ABC/6S5iMWR2oKbfyAAGzcD2IkBQQBCl7rDg5Onlod3QvLmu+Ojp/2npX8gABs3A9CJAUEAQti9loj8oLW+NkLnzKfQ1tDrs7t/IAAbNwPIiQEL7wICAX4Gf0EAQQApA8CJASIBIACtfDcDwIkBAkACQAJAIAGnQT9xIgINAEGACSEDDAELAkBBwAAg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AkEKd3NqIBdqIgNqIhIgESAJc3EgCXNqIBJBGncgEkEVd3MgEkEHd3NqQfOXgLd8aiIXIAMgAnMgAXEgAyACcXMgA0EedyADQRN3cyADQQp3c2ogGWoiAWoiE2ogICASaiAcIBFqIB8gCWogEyASIBFzcSARc2ogE0EadyATQRV3cyATQQd3c2pBx6KerX1qIhkgASADcyACcSABIANxcyABQR53IAFBE3dzIAFBCndzaiAaaiICaiIJIBMgEnNxIBJzaiAJQRp3IAlBFXdzIAlBB3dzakHRxqk2aiIaIAIgAXMgA3EgAiABcXMgAkEedyACQRN3cyACQQp3c2ogGGoiA2oiESAJIBNzcSATc2ogEUEadyARQRV3cyARQQd3c2pB59KkoQFqIhggAyACcyABcSADIAJxcyADQR53IANBE3dzIANBCndzaiAUaiIBaiISIBEgCXNxIAlzaiASQRp3IBJBFXdzIBJBB3dzakGFldy9AmoiFCABIANzIAJxIAEgA3FzIAFBHncgAUETd3MgAUEKd3NqIBdqIgJqIhMgI2ogJiASaiAiIBFqICUgCWogEyASIBFzcSARc2ogE0EadyATQRV3cyATQQd3c2pBuMLs8AJqIhcgAiABcyADcSACIAFxcyACQR53IAJBE3dzIAJBCndzaiAZaiIDaiIJIBMgEnNxIBJzaiAJQRp3IAlBFXdzIAlBB3dzakH827HpBGoiGSADIAJzIAFxIAMgAnFzIANBHncgA0ETd3MgA0EKd3NqIBpqIgFqIhEgCSATc3EgE3NqIBFBGncgEUEVd3MgEUEHd3NqQZOa4JkFaiIaIAEgA3MgAnEgASADcXMgAUEedyABQRN3cyABQQp3c2ogGGoiAmoiEiARIAlzcSAJc2ogEkEadyASQRV3cyASQQd3c2pB1OapqAZqIhggAiABcyADcSACIAFxcyACQR53IAJBE3dzIAJBCndzaiAUaiIDaiITaiAoIBJqICQgEWogJyAJaiATIBIgEXNxIBFzaiATQRp3IBNBFXdzIBNBB3dzakG7laizB2oiFCADIAJzIAFxIAMgAnFzIANBHncgA0ETd3MgA0EKd3NqIBdqIgFqIgkgEyASc3E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BCHZBgP4DcSAAQRh2cnI2AsiJAQJAQQAoAuiJASICRQ0AQQAhAANAIAFBgAlqIAFByIkBai0AADoAACABQQFqIQEgAiAAQQFqIgBB/wFxSw0ACwsLBgBBgIkBC6MBAEEAQgA3A8CJAUEAQRxBICABQeABRiIBGzYC6IkBQQBCp5/mp8b0k/2+f0Krs4/8kaOz8NsAIAEbNwPgiQFBAEKxloD+n6KFrOgAQv+kuYjFkdqCm38gARs3A9iJAUEAQpe6w4OTp5aHd0Ly5rvjo6f9p6V/IAEbNwPQiQFBAELYvZaI/KC1vjZC58yn0NbQ67O7fyABGzcDyIkBIAAQAhAECwsLAQBBgAgLBHAAAAA=",hash:"8c18dd94"};const WA=new g;let uA=null;function xA(A){if(null===uA)return U(WA,LA,28).then((I=>(uA=I,uA.calculate(A,224))));try{const I=uA.calculate(A,224);return Promise.resolve(I)}catch(A){return Promise.reject(A)}}function OA(){return d(LA,28).then((A=>{A.init(224);const I={init:()=>(A.init(224),I),update:B=>(A.update(B),I),digest:I=>A.digest(I),save:()=>A.save(),load:B=>(A.load(B),I),blockSize:64,digestSize:28};return I}))}const PA=new g;let bA=null;function vA(A){if(null===bA)return U(PA,LA,32).then((I=>(bA=I,bA.calculate(A,256))));try{const I=bA.calculate(A,256);return Promise.resolve(I)}catch(A){return Promise.reject(A)}}function jA(){return d(LA,32).then((A=>{A.init(256);const I={init:()=>(A.init(256),I),update:B=>(A.update(B),I),digest:I=>A.digest(I),save:()=>A.save(),load:B=>(A.load(B),I),blockSize:64,digestSize:32};return I}))}var TA={name:"sha512",data:"AGFzbQEAAAABEQRgAAF/YAF/AGAAAGACf38AAwgHAAEBAQIAAwUEAQECAgYOAn8BQdCKBQt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQAAQtIYXNoX1VwZGF0ZQACCkhhc2hfRmluYWwABA1IYXNoX0dldFN0YXRlAAUOSGFzaF9DYWxjdWxhdGUABgpTVEFURV9TSVpFA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g0IohoQgAEKAgPwHg0IYhiAAQoCAgPgPg0IIhoSEIABCCIhCgICA+A+DIABCGIhCgID8B4OEIABCKIhCgP4DgyAAQjiIhISENwOQigFBAEEAKQOIigEiAEI4hiAAQoD+A4NCKIaEIABCgID8B4NCGIYgAEKAgID4D4NCCIaEhCAAQgiIQoCAgPgPgyAAQhiIQoCA/AeDhCAAQiiIQoD+A4MgAEI4iISEhDcDiIoBAkBBACgCyIoBIgNFDQBBACECA0AgAUGACWogAUGIigFqLQAAOgAAIAFBAWohASADIAJBAWoiAkH/AXFLDQALCwsGAEGAiQELoQIAQQBCADcDgIoBQQBBMEHAACABQYADRiIBGzYCyIoBQQBCpJ/p99uD0trHAEL5wvibkaOz8NsAIAEbNwPAigFBAEKnn+an1sGLhltC6/qG2r+19sEfIAEbNwO4igFBAEKRquDC9tCS2o5/Qp/Y+dnCkdqCm38gARs3A7CKAUEAQrGWgP7/zMmZ5wBC0YWa7/rPlIfRACABGzcDqIoBQQBCubK5uI+b+5cVQvHt9Pilp/2npX8gARs3A6CKAUEAQpe6w4Ojq8CskX9Cq/DT9K/uvLc8IAEbNwOYigFBAEKHqvOzo6WKzeIAQrvOqqbY0Ouzu38gARs3A5CKAUEAQti9lojcq+fdS0KIkvOd/8z5hOoAIAEbNwOIigEgABACEAQLCwsBAEGACAsE0AAAAA==",hash:"f2e40eb1"};const $A=new g;let _A=null;function AI(A){if(null===_A)return U($A,TA,48).then((I=>(_A=I,_A.calculate(A,384))));try{const I=_A.calculate(A,384);return Promise.resolve(I)}catch(A){return Promise.reject(A)}}function II(){return d(TA,48).then((A=>{A.init(384);const I={init:()=>(A.init(384),I),update:B=>(A.update(B),I),digest:I=>A.digest(I),save:()=>A.save(),load:B=>(A.load(B),I),blockSize:128,digestSize:48};return I}))}const BI=new g;let gI=null;function QI(A){if(null===gI)return U(BI,TA,64).then((I=>(gI=I,gI.calculate(A,512))));try{const I=gI.calculate(A,512);return Promise.resolve(I)}catch(A){return Promise.reject(A)}}function CI(){return d(TA,64).then((A=>{A.init(512);const I={init:()=>(A.init(512),I),update:B=>(A.update(B),I),digest:I=>A.digest(I),save:()=>A.save(),load:B=>(A.load(B),I),blockSize:128,digestSize:64};return I}))}var iI={name:"xxhash32",data:"AGFzbQEAAAABEQRgAAF/YAF/AGAAAGACf38AAwcGAAEBAgADBQQBAQICBg4CfwFBsIkFC38AQYAICwdwCAZtZW1vcnkCAA5IYXNoX0dldEJ1ZmZlcgAACUhhc2hfSW5pdAABC0hhc2hfVXBkYXRlAAIKSGFzaF9GaW5hbAADDUhhc2hfR2V0U3RhdGUABA5IYXNoX0NhbGN1bGF0ZQAFClNUQVRFX1NJWkUDAQrvEQYFAEGACQtNAEEAQgA3A6iJAUEAIAA2AoiJAUEAIABBz4yijgZqNgKMiQFBACAAQfeUr694ajYChIkBQQAgAEGoiI2hAmo2AoCJAUEAQQA2AqCJAQu4CAEHfwJAIABFDQBBAEEAKQOoiQEgAK18NwOoiQECQEEAKAKgiQEiASAAakEPSw0AAkACQCAAQQNxIgINAEGACSEDIAAhBAwBCyAAQXxxIQRBgAkhAwNAQQBBACgCoIkBIgVBAWo2AqCJASAFQZCJAWogAy0AADoAACADQQFqIQMgAkF/aiICDQALCyAAQQRJDQEDQEEAQQAoAqCJASICQQFqNgKgiQEgAkGQiQFqIAMtAAA6AAAgA0EBai0AACECQQBBACgCoIkBIgVBAWo2AqCJASAFQZCJAWogAjoAACADQQJqLQAAIQJBAEEAKAKgiQEiBUEBajYCoIkBIAVBkIkBaiACOgAAIANBA2otAAAhAkEAQQAoAqCJASIFQQFqNgKgiQEgBUGQiQFqIAI6AAAgA0EEaiEDIARBfGoiBA0ADAILCyAAQfAIaiEGAkACQCABDQBBACgCjIkBIQJBACgCiIkBIQVBACgChIkBIQRBACgCgIkBIQFBgAkhAwwBC0GACSEDAkAgAUEPSw0AQYAJIQMCQAJAQQAgAWtBA3EiBA0AIAEhBQwBCyABIQIDQEEAIAJBAWoiBTYCoIkBIAJBkIkBaiADLQA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z3fF5bGpBC3dBsfPd8XlsIQAgAUECaiIBIAVHDQALC0EAIABBD3YgAHNB95Svr3hsIgFBDXYgAXNBvdzKlXxsIgFBEHYgAXMiAEEYdCAAQYD+A3FBCHRyIAFBCHZBgP4DcSABQRh2cnKtNwOACQsLCwEAQYAICwQwAAAA",hash:"4bb12485"};const EI=new g;let oI=null;function FI(A){return!Number.isInteger(A)||A<0||A>4294967295?new Error("Seed must be a valid 32-bit long unsigned integer."):null}function DI(A,I=0){if(FI(I))return Promise.reject(FI(I));if(null===oI)return U(EI,iI,4).then((B=>(oI=B,oI.calculate(A,I))));try{const B=oI.calculate(A,I);return Promise.resolve(B)}catch(A){return Promise.reject(A)}}function cI(A=0){return FI(A)?Promise.reject(FI(A)):d(iI,4).then((I=>{I.init(A);const B={init:()=>(I.init(A),B),update:A=>(I.update(A),B),digest:A=>I.digest(A),save:()=>I.save(),load:A=>(I.load(A),B),blockSize:16,digestSize:4};return B}))}var hI={name:"xxhash64",data:"AGFzbQEAAAABDANgAAF/YAAAYAF/AAMHBgABAgEAAQUEAQECAgYOAn8BQdCJBQt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQAAQtIYXNoX1VwZGF0ZQACCkhhc2hfRmluYWwAAw1IYXNoX0dldFN0YXRlAAQOSGFzaF9DYWxjdWxhdGUABQpTVEFURV9TSVpFAwEKmxEGBQBBgAkLYwEBfkEAQgA3A8iJAUEAQQApA4AJIgA3A5CJAUEAIABC+erQ0OfJoeThAHw3A5iJAUEAIABCz9bTvtLHq9lCfDcDiIkBQQAgAELW64Lu6v2J9eAAfDcDgIkBQQBBADYCwIkBC70IAwV/BH4CfwJAIABFDQBBAEEAKQPIiQEgAK18NwPIiQECQEEAKALAiQEiASAAakEfSw0AAkACQCAAQQNxIgINAEGACSEDIAAhAQwBCyAAQXxxIQFBgAkhAwNAQQBBACgCwIkBIgRBAWo2AsCJASAEQaCJAWogAy0AADoAACADQQFqIQMgA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+JAWohBQJAAkAgByAJa0EBcQ0AIAkhBgwBCyAJQQFqIQYgCTEAAELFz9my8eW66id+IACFQguJQoeVr6+Ytt6bnn9+IQALIAUgCUYNAANAIAZBAWoxAABCxc/ZsvHluuonfiAGMQAAQsXP2bLx5brqJ34gAIVCC4lCh5Wvr5i23puef36FQguJQoeVr6+Ytt6bnn9+IQAgBkECaiIGIAhHDQALC0EAIABCIYggAIVCz9bTvtLHq9lCfiIAQh2IIACFQvnz3fGZ9pmrFn4iAEIgiCAAhSIBQjiGIAFCgP4Dg0IohoQgAUKAgPwHg0IYhiABQoCAgPgPg0IIhoSEIABCCIhCgICA+A+DIABCGIhCgID8B4OEIABCKIhCgP4DgyAAQjiIhISENwOACQsGAEGAiQELAgALCwsBAEGACAsEUAAAAA==",hash:"177fbfa3"};const aI=new g;let wI=null;const kI=new Uint8Array(8);function GI(A){return!Number.isInteger(A)||A<0||A>4294967295?new Error("Seed must be given as two valid 32-bit long unsigned integers (lo + high)."):null}function nI(A,I,B){const g=new DataView(A);g.setUint32(0,I,!0),g.setUint32(4,B,!0)}function yI(A,I=0,B=0){if(GI(I))return Promise.reject(GI(I));if(GI(B))return Promise.reject(GI(B));if(null===wI)return U(aI,hI,8).then((g=>(wI=g,nI(kI.buffer,I,B),wI.writeMemory(kI),wI.calculate(A))));try{nI(kI.buffer,I,B),wI.writeMemory(kI);const g=wI.calculate(A);return Promise.resolve(g)}catch(A){return Promise.reject(A)}}function HI(A=0,I=0){return GI(A)?Promise.reject(GI(A)):GI(I)?Promise.reject(GI(I)):d(hI,8).then((B=>{const g=new Uint8Array(8);nI(g.buffer,A,I),B.writeMemory(g),B.init();const Q={init:()=>(B.writeMemory(g),B.init(),Q),update:A=>(B.update(A),Q),digest:A=>B.digest(A),save:()=>B.save(),load:A=>(B.load(A),Q),blockSize:32,digestSize:8};return Q}))}var dI={name:"xxhash3",data:"AGFzbQEAAAABNAhgAAF/YAR/f39/AGAHf39/f39/fwBgBH9+fn4BfmAEf39/fgF+YAN/f34BfmAAAGABfwADDg0AAQIDBAUFBQYHBgAGBQQBAQICBg4CfwFBwI4FC38AQcAJCwdwCAZtZW1vcnkCAA5IYXNoX0dldEJ1ZmZlcgAACUhhc2hfSW5pdAAIC0hhc2hfVXBkYXRlAAkKSGFzaF9GaW5hbAAKDUhhc2hfR2V0U3RhdGUACw5IYXNoX0NhbGN1bGF0ZQAMClNUQVRFX1NJWkUDAQr6QQ0FAEGACgvkAwMPfgF/AX4CQCADRQ0AIAApAzAhBCAAKQM4IQUgACkDICEGIAApAyghByAAKQMQIQggACkDGCEJIAApAwAhCiAAKQMIIQsDQCAFIAFBMGopAwAiDHwgAkE4aikDACABQThqKQMAIg2FIgVCIIggBUL/////D4N+fCEFIAcgAUEgaikDACIOfCACQShqKQMAIAFBKGopAwAiD4UiB0IgiCAHQv////8Pg358IQcgCSABQRBqKQMAIhB8IAJBGGopAwAgAUEYaikDACIRhSIJQiCIIAlC/////w+DfnwhCSALIAEpAwAiEnwgAkEIaiITKQMAIAFBCGopAwAiFIUiC0IgiCALQv////8Pg358IQsgAkEwaikDACAMhSIMQiCIIAxC/////w+DfiAEfCANfCEEIAJBIGopAwAgDoUiDEIgiCAMQv////8Pg34gBnwgD3whBiACQRBqKQMAIBCFIgxCIIggDEL/////D4N+IAh8IBF8IQggAikDACAShSIMQiCIIAxC/////w+DfiAKfCAUfCEKIAFBwABqIQEgEyECIANBf2oiAw0ACyAAIAk3AxggACAKNwMAIAAgCzcDCCAAIAc3AyggACAINwMQIAAgBTcDOCAAIAY3AyAgACAENwMwCwveAgIBfwF+AkAgBCACIAEoAgAiB2siAkkNACAAIAMgBSAHQQN0aiACEAEgACAFIAZqIgcpAwAgACkDACIIQi+IhSAIhUKx893xCX43AwAgACAHKQMIIAApAwgiCEIviIUgCIVCsfPd8Ql+NwMIIAAgBykDECAAKQMQIghCL4iFIAiFQrHz3fEJfjcDECAAIAcpAxggACkDGCIIQi+IhSAIhUKx893xCX43AxggACAHKQMgIAApAyA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CQCAAQSFJDQACQCAAQcEASQ0AAkAgAEHhAEkNACABKQNoIAJ9QQApA7iMAYUiBEL/////D4MiBSABKQNgIAJ8QQApA7CMAYUiBkIgiCIHfiIIQv////8PgyAEQiCIIgQgBkL/////D4MiBn58IAUgBn4iBUIgiHwiBkIghiAFQv////8Pg4QgCEIgiCAEIAd+fCAGQiCIfIUgA3wgASkDeCACfSAAQciLAWopAwCFIgNC/////w+DIgQgASkDcCACfCAAQcCLAWopAwCFIgVCIIgiBn4iB0L/////D4MgA0IgiCIDIAVC/////w+DIgV+fCAEIAV+IgRCIIh8IgVCIIYgBEL/////D4OEIAdCIIggAyAGfnwgBUIgiHyFfCEDCyABKQNIIAJ9QQApA6iMAYUiBEL/////D4MiBSABKQNAIAJ8QQApA6CMAYUiBkIgiCIHfiIIQv////8PgyAEQiCIIgQgBkL/////D4MiBn58IAUgBn4iBUIgiHwiBkIghiAFQv////8Pg4QgCEIgiCAEIAd+fCAGQiCIfIUgA3wgASkDWCACfSAAQdiLAWopAwCFIgNC/////w+DIgQgASkDUCACfCAAQdCLAWopAwCFIgVCIIgiBn4iB0L/////D4MgA0IgiCIDIAVC/////w+DIgV+fCAEIAV+IgRCIIh8IgVCIIYgBEL/////D4OEIAdCIIggAyAGfnwgBUIgiHyFfCEDCyABKQMoIAJ9QQApA5iMAYUiBEL/////D4MiBSABKQMgIAJ8QQApA5CMAYUiBkIgiCIHfiIIQv////8PgyAEQiCIIgQgBkL/////D4MiBn58IAUgBn4iBUIgiHwiBkIghiAFQv////8Pg4QgCEIgiCAEIAd+fCAGQiCIfIUgA3wgASkDOCACfSAAQeiLAWopAwCFIgNC/////w+DIgQgASkDMCACfCAAQeCLAWopAwCFIgVCIIgiBn4iB0L/////D4MgA0IgiCIDIAVC/////w+DIgV+fCAEIAV+IgRCIIh8IgVCIIYgBEL/////D4OEIAdCIIggAyAGfnwgBUIgiHyFfCEDCyABKQMIIAJ9QQApA4iMAYUiBEL/////D4MiBSABKQMAIAJ8QQApA4CMAYUiBkIgiCIHfiIIQv////8PgyAEQiCIIgQgBkL/////D4MiBn58IAUgBn4iBUIgiHwiBkIghiAFQv////8Pg4QgCEIgiCAEIAd+fCAGQiCIfIUgA3wgASkDGCACfSAAQfiLAWopAwCFIgNC/////w+DIgQgASkDECACfCAAQfCLAWopAwCFIgJCIIgiBX4iBkL/////D4MgA0IgiCIDIAJC/////w+DIgJ+fCAEIAJ+IgJCIIh8IgRCIIYgAkL/////D4OEIAZCIIggAyAFfnwgBEIgiHyFfCICQiWIIAKFQvnz3fGZ8pmrFn4iAkIgiCAChQv8CgQBfwV+An8BfkEAIQMgASkDeCACfUEAKQP4jAGFIgRC/////w+DIgUgASkDcCACfEEAKQPwjAGFIgZCIIgiB34iCEL/////D4MgBEIgiCIEIAZC/////w+DIgZ+fCAFIAZ+IgVCIIh8IgZCIIYgBUL/////D4OEIAhCIIggBCAHfnwgBkIgiHyFIAEpA2ggAn1BACkD6IwBhSIEQv////8PgyIFIAEpA2AgAnxBACkD4IwBhSIGQiCIIgd+IghC/////w+DIARCIIgiBCAGQv////8PgyIGfnwgBSAGfiIFQiCIfCIGQiCGIAVC/////w+DhCAIQiCIIAQgB358IAZCIIh8hSABKQNYIAJ9QQApA9iMAYUiBEL/////D4MiBSABKQNQIAJ8QQApA9CMAYUiBkIgiCIHfiIIQv////8PgyAEQiCIIgQgBkL/////D4MiBn58IAUgBn4iBUIgiHwiBkIghiAFQv////8Pg4QgCEIgiCAEIAd+fCAGQiCIfIUgASkDSCACfUEAKQPIjAGFIgRC/////w+DIgUgASkDQCACfEEAKQPAjAGFIgZCIIgiB34iCEL/////D4MgBEIgiCIEIAZC/////w+DIgZ+fCAFIAZ+IgVCIIh8IgZCIIYgBUL/////D4OEIAhCIIggBCAHfnwgBkIgiHyFIAEpAzggAn1BACkDuIwBhSIEQv////8PgyIFIAEpAzAgAnxBACkDsIwBhSIGQiCIIgd+IghC/////w+DIARCIIgiBCAGQv////8PgyIGfnwgBSAGfiIFQiCIfCIGQiCGIAVC/////w+DhCAIQiCIIAQgB358IAZCIIh8hSABKQMoIAJ9QQApA6iMAYUiBEL/////D4MiBSABKQMgIAJ8QQApA6CMAYUiBkIgiCIHfiIIQv////8PgyAEQiCIIgQgBkL/////D4MiBn58IAUgBn4iBUIgiHwiBkIghiAFQv////8Pg4QgCEIgiCAEIAd+fCAGQiCIfIUgASkDGCACfUEAKQOYjAGFIgRC/////w+DIgUgASkDECACfEEAKQOQjAGFIgZCIIgiB34iCEL/////D4MgBEIgiCIEIAZC/////w+DIgZ+fCAFIAZ+IgVCIIh8IgZCIIYgBUL/////D4OEIAhCIIggBCAHfnwgBkIgiHyFIAEpAwggAn1BACkDiIwBhSIEQv////8PgyIFIAEpAwAgAnxBACkDgIwBhSIGQiCIIgd+IghC/////w+DIARCIIgiBCAGQv////8PgyIGfnwgBSAGfiIFQiCIfCIGQiCGIAVC/////w+DhCAIQiCIIAQgB358IAZCIIh8hSAArUKHla+vmLbem55/fnx8fHx8fHx8IgRCJYggBIVC+fPd8ZnymasWfiIEQiCIIASFIQQCQCAAQZABSA0AIABBBHZBeGohCQNAIAEgA2oiCkELaikDACACfSADQYiNAWopAwCFIgVC/////w+DIgYgCkEDaikDACACfCADQYCNAWopAwCFIgdCIIgiCH4iC0L/////D4MgBUIgiCIFIAdC/////w+DIgd+fCAGIAd+IgZCIIh8IgdCIIYgBkL/////D4OEIAtCIIggBSAIfnwgB0IgiHyFIAR8IQQgA0EQaiEDIAlBf2oiCQ0ACwsgASkDfyACfSAAQfiLAWopAwCFIgVC/////w+DIgYgASkDdyACfCAAQfCLAWopAwCFIgJCIIgiB34iCEL/////D4MgBUIgiCIFIAJC/////w+DIgJ+fCAGIAJ+IgJCIIh8IgZCIIYgAkL/////D4OEIAhCIIggBSAHfnwgBkIgiHyFIAR8IgJCJYggAoVC+fPd8ZnymasWfiICQiCIIAKFC98FAgF+AX8CQAJAQQApA4AKIgBQRQ0AQYAIIQFCACEADAELAkBBACkDoI4BIABSDQBBACE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ABNwPwjQFBACADKQP4ATcD+I0BC0GAjAEhAwJAAkAgBSAEayICQQhPDQAgAiEGDAELQYCMASEDIAIhBgNAIAMgBCkDADcDACADQQhqIQMgBEEIaiEEIAZBeGoiBkEHSw0ACwsgBkUNAQNAIAMgBC0AADoAACADQQFqIQMgBEEBaiEEIAZBf2oiBg0ADAILCyABRQ0AAkACQCABQQdxIgYNACABIQIMAQsgAUF4cSECA0AgAyAELQAAOgAAIANBAWohAyAEQQFqIQQgBkF/aiIGDQALCwJAIAFBCEkNAANAIAMgBCkAADcAACADQQhqIQMgBEEIaiEEIAJBeGoiAg0ACwtBACgCgI4BIABqIQILQQAgAjYCgI4BC/ISBQR/A34BfxV+BX8jACIAIQEgAEGAAWtBQHEiAiQAQQAoArCOASIAQcCKASAAGyEDAkACQEEAKQOQjgEiBELxAVQNACACQQApA4CKATcDACACQQApA4iKATcDCCACQQApA5CKATcDECACQQApA5iKATcDGCACQQApA6CKATcDICACQQApA6iKATcDKCACQQApA7CKASIFNwMwIAJBACkDuIoBIgY3AzgCQAJAQQAoAoCOASIHQcAASQ0AIAJBACgCiI4BNgJAIAIgAkHAAGpBACgCmI4BQYCMASAHQX9qQQZ2IANBACgCnI4BIgAQAiADIABqIgBBeWopAwAhCCAAKQMJIQkgACkDGSEKIAApAykhCyAHQcCLAWopAwAhBSAAKQMBIQwgB0HIiwFqKQMAIQYgB0HQiwFqKQMAIQ0gACkDESEOIAdB2IsBaikDACEPIAdB4IsBaikDACEQIAApAyEhESAHQeiLAWopAwAhEiACKQMAIRMgAikDECEUIAIpAyAhFSACKQMwIRYgAikDCCEXIAIpAxghGCACKQMoIRkgAiACKQM4IAdB8IsBaikDACIafCAAKQMxIAdB+IsBaikDACIbhSIcQiCIIBxC/////w+Dfnw3AzggGSAQfCARIBKFIhFCIIggEUL/////D4N+fCERIBggDXwgDiAPhSIOQiCIIA5C/////w+DfnwhDiAXIAV8IAwgBoUiDEIgiCAMQv////8Pg358IQwgGyAWIAsgGoUiC0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IAIpA0ghDyACKQMYIRkgAikDUCESIAIpA1ghCCACKQMoIRogAikDYCEQIAIpA2ghCSACIAYgAikDcCIbfCAAKQMxIAIpA3giBoUiHEIgiCAcQv////8Pg358NwM4IBogEHwgESAJhSIRQiCIIBFC/////w+DfnwhESAZIBJ8IA4gCIUiDkIgiCAOQv////8Pg358IQ4gGCANfCAMIA+FIgxCIIggDEL/////D4N+fCEMIAYgCyAbhSILQiCIIAtC/////w+DfiAFfHwhCyAJIBcgFCAQhSIFQiCIIAVC/////w+Dfnx8IRAgCCAWIBMgEoUiBUIgiCAFQv////8Pg358fCESIA8gFSAKIA2FIgVCIIggBUL/////D4N+fHwhCAsgAykDQyACKQM4hSIFQv////8PgyIGIAMpAzsgC4UiC0IgiCINfiIPQv////8PgyAFQiCIIgUgC0L/////D4MiC358IAYgC34iBkIgiHwiC0IghiAGQv////8Pg4QgD0IgiCAFIA1+fCALQiCIfIUgAykDMyARhSIFQv////8PgyIGIAMpAysgEIUiC0IgiCINfiIPQv////8PgyAFQiCIIgUgC0L/////D4MiC358IAYgC34iBkIgiHwiC0IghiAGQv////8Pg4QgD0IgiCAFIA1+fCALQiCIfIUgAykDIyAOhSIFQv////8PgyIGIAMpAxsgEoUiC0IgiCINfiIPQv////8PgyAFQiCIIgUgC0L/////D4MiC358IAYgC34iBkIgiHwiC0IghiAGQv////8Pg4QgD0IgiCAFIA1+fCALQiCIfIUgAykDEyAMhSIFQv////8PgyIGIAMpAwsgCIUiC0IgiCINfiIPQv////8PgyAFQiCIIgUgC0L/////D4MiC358IAYgC34iBkIgiHwiC0IghiAGQv////8Pg4QgD0IgiCAFIA1+fCALQiCIfIUgBEKHla+vmLbem55/fnx8fHwiBEIliCAEhUL5893xmfKZqxZ+IgRCIIggBIUhBAwBCyAEpyEAAkBBACkDoI4BIgRQDQACQCAAQRBLDQAgAEGACCAEEAUhBAwCCwJAIABBgAFLDQAgAEGACCAEEAYhBAwCCyAAQYAIIAQQByEEDAELAkAgAEEQSw0AIAAgA0IAEAUhBAwBCwJAIABBgAFLDQAgACADQgAQBiEEDAELIAAgA0IAEAchBAtBACAEQjiGIARCgP4Dg0IohoQgBEKAgPwHg0IYhiAEQoCAgPgPg0IIhoSEIARCCIhCgICA+A+DIARCGIhCgID8B4OEIARCKIhCgP4DgyAEQjiIhISENwOACiABJAALBgBBgIoBCwIACwvMAQEAQYAIC8QBuP5sOSOkS758AYEs9yGtHN7UbemDkJfbckCkpLezZx/LeeZOzMDleIJa0H3M/3IhuAhGdPdDJI7gNZDmgTomTDwoUruRwwDLiNBlixtTLqNxZEiXog35TjgZ70ap3qzYqPp2P+OcND/53LvHxwtPHYpR4EvNtFkxyJ9+ydl4c2TqxayDNNPrw8WBoP/6E2PrFw3dUbfw2knTFlUmKdRonisWvlh9R6H8j/i40XrQMc5FyzqPlRYEKK/X+8q7S0B+QAIAAA==",hash:"5a2fbdbb"};const UI=new g;let eI=null;const SI=new Uint8Array(8);function NI(A){return!Number.isInteger(A)||A<0||A>4294967295?new Error("Seed must be given as two valid 32-bit long unsigned integers (lo + high)."):null}function tI(A,I,B){const g=new DataView(A);g.setUint32(0,I,!0),g.setUint32(4,B,!0)}function JI(A,I=0,B=0){if(NI(I))return Promise.reject(NI(I));if(NI(B))return Promise.reject(NI(B));if(null===eI)return U(UI,dI,8).then((g=>(eI=g,tI(SI.buffer,I,B),eI.writeMemory(SI),eI.calculate(A))));try{tI(SI.buffer,I,B),eI.writeMemory(SI);const g=eI.calculate(A);return Promise.resolve(g)}catch(A){return Promise.reject(A)}}function fI(A=0,I=0){return NI(A)?Promise.reject(NI(A)):NI(I)?Promise.reject(NI(I)):d(dI,8).then((B=>{const g=new Uint8Array(8);tI(g.buffer,A,I),B.writeMemory(g),B.init();const Q={init:()=>(B.writeMemory(g),B.init(),Q),update:A=>(B.update(A),Q),digest:A=>B.digest(A),save:()=>B.save(),load:A=>(B.load(A),Q),blockSize:512,digestSize:8};return Q}))}var qI={name:"xxhash128",data:"AGFzbQEAAAABKwdgAAF/YAR/f39/AGAHf39/f39/fwBgA39/fgF+YAR/f39+AGAAAGABfwADDQwAAQIDBAQEBQYFAAUFBAEBAgIGDgJ/AUHAjgULfwBBwAkLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAJSGFzaF9Jbml0AAcLSGFzaF9VcGRhdGUACApIYXNoX0ZpbmFsAAkNSGFzaF9HZXRTdGF0ZQAKDkhhc2hfQ2FsY3VsYXRlAAsKU1RBVEVfU0laRQMBCqBNDAUAQYAKC+QDAw9+AX8BfgJAIANFDQAgACkDMCEEIAApAzghBSAAKQMgIQYgACkDKCEHIAApAxAhCCAAKQMYIQkgACkDACEKIAApAwghCwNAIAUgAUEwaikDACIMfCACQThqKQMAIAFBOGopAwAiDYUiBUIgiCAFQv////8Pg358IQUgByABQSBqKQMAIg58IAJBKGopAwAgAUEoaikDACIPhSIHQiCIIAdC/////w+DfnwhByAJIAFBEGopAwAiEHwgAkEYaikDACABQRhqKQMAIhGFIglCIIggCUL/////D4N+fCEJIAsgASkDACISfCACQQhqIhMpAwAgAUEIaikDACIUhSILQiCIIAtC/////w+DfnwhCyACQTBqKQMAIAyFIgxCIIggDEL/////D4N+IAR8IA18IQQgAkEgaikDACAOhSIMQiCIIAxC/////w+DfiAGfCAPfCEGIAJBEGopAwAgEIUiDEIgiCAMQv////8Pg34gCHwgEXwhCCACKQMAIBKFIgxCIIggDEL/////D4N+IAp8IBR8IQogAUHAAGohASATIQIgA0F/aiIDDQALIAAgCTcDGCAAIAo3AwAgACALNwMIIAAgBzcDKCAAIAg3AxAgACAFNwM4IAAgBjcDICAAIAQ3AzALC94CAgF/AX4CQCAEIAIgASgCACIHayICSQ0AIAAgAyAFIAdBA3RqIAIQASAAIAUgBmoiBykDACAAKQMAIghCL4iFIAiFQrHz3fEJfjcDACAAIAcpAwggACkDCCIIQi+IhSAIhUKx893xCX43AwggACAHKQMQIAApAxAiCEIviIUgCIVCsfPd8Ql+NwMQIAAgBykDGCAAKQMYIghCL4iFIAiFQrHz3fEJfjcDGCAAIAcpAyAgACkDICIIQi+IhSAIhUKx893xCX43AyAgACAHKQMoIAApAygiCEIviIUgCIVCsfPd8Ql+NwMoIAAgBykDMCAAKQMwIghCL4iFIAiFQrHz3fEJfjcDMCAAIAcpAzggACkDOCIIQi+IhSAIhUKx893xCX43AzggACADIAJBBnRqIAUgBCACayIHEAEgASAHNgIADwsgACADIAUgB0EDdGogBBABIAEgByAEajYCAAvtAwEFfiABKQM4IAApAziFIgNC/////w+DIgQgASkDMCAAKQMwhSIFQiCIIgZ+IgdC/////w+DIANCIIgiAyAFQv////8PgyIFfnwgBCAFfiIEQiCIfCIFQiCGIARC/////w+DhCAHQiCIIAMgBn58IAVCIIh8hSABKQMoIAApAyiFIgNC/////w+DIgQgASkDICAAKQMghSIFQiCIIgZ+IgdC/////w+DIANCIIgiAyAFQv////8PgyIFfnwgBCAFfiIEQiCIfCIFQiCGIARC/////w+DhCAHQiCIIAMgBn58IAVCIIh8hSABKQMYIAApAxiFIgNC/////w+DIgQgASkDECAAKQMQhSIFQiCIIgZ+IgdC/////w+DIANCIIgiAyAFQv////8PgyIFfnwgBCAFfiIEQiCIfCIFQiCGIARC/////w+DhCAHQiCIIAMgBn58IAVCIIh8hSABKQMIIAApAwiFIgNC/////w+DIgQgASkDACAAKQMAhSIFQiCIIgZ+IgdC/////w+DIANCIIgiAyAFQv////8PgyIFfnwgBCAFfiIEQiCIfCIFQiCGIARC/////w+DhCAHQiCIIAMgBn58IAVCIIh8hSACfHx8fCICQiWIIAKFQvnz3fGZ8pmrFn4iAkIgiCAChQu6CAIFfgN/AkAgAUEJSQ0AIAAgAUH4iwFqKQMAIgQgAikDOCACKQMwhSADfIUiBUL/////D4NC95Svrwh+IAVCgICAgHCDfEEAKQOAjAEgAikDKCACKQMghSADfYUgBIUiA0IgiCIEQrHz3fEJfnwgBEKHla+vCH4iBEIgiHwgBEL/////D4MgA0L/////D4MiA0Kx893xCX58IANCh5Wvrwh+IgRCIIh8IgV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VC+fPd8Zn2masWfiIEQiCIIASFNwMIIAAgAikDQCACKQNIhSADhSIDQiGIIAOFQs/W077Sx6vZQn4iA0IdiCADhUL5893xmfaZqxZ+IgNCIIggA4U3AwALwwoBCn4gAa0iBEKHla+vmLbem55/fiEFAkACQCABQSFPDQBCACEGDAELQgAhBwJAIAFBwQBJDQBCACEHAkAgAUHhAEkNACACQfgAaikDACADfSABQciLAWopAwAiCIUiB0L/////D4MiCSACKQNwIAN8IAFBwIsBaikDACIKhSILQiCIIgx+Ig1CIIggB0IgiCIHIAx+fCANQv////8PgyAHIAtC/////w+DIgt+fCAJIAt+IgdCIIh8IglCIIh8QQApA7iMASILQQApA7CMASIMfIUgCUIghiAHQv////8Pg4SFIQcgAkHoAGopAwAgA30gC4UiCUL/////D4MiCyACKQNgIAN8IAyFIgxCIIgiDX4iBkL/////D4MgCUIgiCIJIAxC/////w+DIgx+fCALIAx+IgtCIIh8IgxCIIYgC0L/////D4OEIAZCIIggCSANfnwgDEIgiHyFIAV8IAggCnyFIQULIAJB2ABqKQMAIAN9IAFB2IsBaikDACIIhSIJQv////8PgyIKIAIpA1AgA3wgAUHQiwFqKQMAIguFIgxCIIgiDX4iBkL/////D4MgCUIgiCIJIAxC/////w+DIgx+fCAKIAx+IgpCIIh8IgxCIIYgCkL/////D4OEIAZCIIggCSANfnwgDEIgiHyFIAd8QQApA6iMASIJQQApA6CMASIKfIUhByACQcgAaikDACADfSAJhSIJQv////8PgyIMIAIpA0AgA3wgCoUiCkIgiCINfiIGQv////8PgyAJQiCIIgkgCkL/////D4MiCn58IAwgCn4iCkIgiHwiDEIghiAKQv////8Pg4QgBkIgiCAJIA1+fCAMQiCIfIUgBXwgCCALfIUhBQsgAkE4aikDACADfSABQeiLAWopAwAiCIUiCUL/////D4MiCiACKQMwIAN8IAFB4IsBaikDACILhSIMQiCIIg1+IgZC/////w+DIAlCIIgiCSAMQv////8PgyIMfnwgCiAMfiIKQiCIfCIMQiCGIApC/////w+DhCAGQiCIIAkgDX58IAxCIIh8hSAHfEEAKQOYjAEiB0EAKQOQjAEiCXyFIQYgAkEoaikDACADfSAHhSIHQv////8PgyIKIAIpAyAgA3wgCYUiCUIgiCIMfiINQv////8PgyAHQiCIIgcgCUL/////D4MiCX58IAogCX4iCUIgiHwiCkIghiAJQv////8Pg4QgDUIgiCAHIAx+fCAKQiCIfIUgBXwgCCALfIUhBQsgACACQRhqKQMAIAN9IAFB+IsBaikDACIHhSIIQv////8PgyIJIAIpAxAgA3wgAUHwiwFqKQMAIgqFIgtCIIgiDH4iDUL/////D4MgCEIgiCIIIAtC/////w+DIgt+fCAJIAt+IglCIIh8IgtCIIYgCUL/////D4OEIA1CIIggCCAMfnwgC0IgiHyFIAZ8QQApA4iMASIIQQApA4CMASIJfIUiCyACQQhqKQMAIAN9IAiFIghC/////w+DIgwgAikDACADfCAJhSIJQiCIIg1+IgZC/////w+DIAhCIIgiCCAJQv////8PgyIJfnwgDCAJfiIJQiCIfCIMQiCGIAlC/////w+DhCAGQiCIIAggDX58IAxCIIh8hSAFfCAHIAp8hSIFfCIHQiWIIAeFQvnz3fGZ8pmrFn4iB0IgiCAHhTcDACAAQgAgBUKHla+vmLbem55/fiAEIAN9Qs/W077Sx6vZQn58IAtC49zKlfzO8vWFf358IgNCJYggA4VC+fPd8ZnymasWfiIDQiCIIAOFfTcDCAuhDwMBfxR+An9BACEEIAJB+ABqKQMAIAN9QQApA/iMASIFhSIGQv////8PgyIHIAIpA3AgA3xBACkD8IwBIgiFIglCIIgiCn4iC0L/////D4MgBkIgiCIGIAlC/////w+DIgl+fCAHIAl+IgdCIIh8IglCIIYgB0L/////D4OEIAtCIIggBiAKfnwgCUIgiHyFIAJB2ABqKQMAIAN9QQApA9iMASIHhSIGQv////8PgyIJIAIpA1AgA3xBACkD0IwBIgqFIgtCIIgiDH4iDUL/////D4MgBkIgiCIGIAtC/////w+DIgt+fCAJIAt+IglCIIh8IgtCIIYgCUL/////D4OEIA1CIIggBiAMfnwgC0IgiHyFIAJBOGopAwAgA31BACkDuIwBIgmFIgZC/////w+DIgsgAikDMCADfEEAKQOwjAEiDIUiDUIgiCIOfiIPQv////8PgyAGQiCIIgYgDUL/////D4MiDX58IAsgDX4iC0IgiHwiDUIghiALQv////8Pg4QgD0IgiCAGIA5+fCANQiCIfIUgAkEYaikDACADfUEAKQOYjAEiC4UiBkL/////D4MiDSACKQMQIAN8QQApA5CMASIOhSIPQiCIIhB+IhFC/////w+DIAZCIIgiBiAPQv////8PgyIPfnwgDSAPfiINQiCIfCIPQiCGIA1C/////w+DhCARQiCIIAYgEH58IA9CIIh8hUEAKQOIjAEiDUEAKQOAjAEiD3yFfEEAKQOojAEiEEEAKQOgjAEiEXyFfEEAKQPIjAEiEkEAKQPAjAEiE3yFfEEAKQPojAEiFEEAKQPgjAEiFXyFIgZCJYggBoVC+fPd8ZnymasWfiIGQiCIIAaFIQYgAkHoAGopAwAgA30gFIUiFEL/////D4MiFiACKQNgIAN8IBWFIhVCIIgiF34iGEL/////D4MgFEIgiCIUIBVC/////w+DIhV+fCAWIBV+IhVCIIh8IhZCIIYgFUL/////D4OEIBhCIIggFCAXfnwgFkIgiHyFIAJByABqKQMAIAN9IBKFIhJC/////w+DIhQgAikDQCADfCAThSITQiCIIhV+IhZC/////w+DIBJCIIgiEiATQv////8PgyITfnwgFCATfiITQiCIfCIUQiCGIBNC/////w+DhCAWQiCIIBIgFX58IBRCIIh8hSACQShqKQMAIAN9IBCFIhBC/////w+DIhIgAikDICADfCARhSIRQiCIIhN+IhRC/////w+DIBBCIIgiECARQv////8PgyIRfnwgEiARfiIRQiCIfCISQiCGIBFC/////w+DhCAUQiCIIBAgE358IBJCIIh8hSACQQhqKQMAIAN9IA2FIg1C/////w+DIhAgAikDACADfCAPhSIPQiCIIhF+IhJC/////w+DIA1CIIgiDSAPQv////8PgyIPfnwgECAPfiIPQiCIfCIQQiCGIA9C/////w+DhCASQiCIIA0gEX58IBBCIIh8hSABrSIPQoeVr6+Ytt6bnn9+fCALIA58hXwgCSAMfIV8IAcgCnyFfCAFIAh8hSIFQiWIIAWFQvnz3fGZ8pmrFn4iBUIgiCAFhSEFAkAgAUGgAUgNACABQQV2QXxqIRkDQCACIARqIhpBG2opAwAgA30gBEGYjQFqKQMAIgeFIghC/////w+DIgkgGkETaikDACADfCAEQZCNAWopAwAiCoUiC0IgiCIMfiINQv////8PgyAIQiCIIgggC0L/////D4MiC358IAkgC34iCUIgiHwiC0IghiAJQv////8Pg4QgDUIgiCAIIAx+fCALQiCIfIUgBnwgBEGIjQFqKQMAIgggBEGAjQFqKQMAIgl8hSEGIBpBC2opAwAgA30gCIUiCEL/////D4MiCyAaQQNqKQMAIAN8IAmFIglCIIgiDH4iDUL/////D4MgCEIgiCIIIAlC/////w+DIgl+fCALIAl+IglCIIh8IgtCIIYgCUL/////D4OEIA1CIIggCCAMfnwgC0IgiHyFIAV8IAcgCnyFIQUgBEEgaiEEIBlBf2oiGQ0ACwsgACACQf8AaikDACADfCABQeiLAWopAwAiB4UiCEL/////D4MiCSACKQN3IAN9IAFB4IsBaikDACIKhSILQiCIIgx+Ig1C/////w+DIAhCIIgiCCALQv////8PgyILfnwgCSALfiIJQiCIfCILQiCGIAlC/////w+DhCANQiCIIAggDH58IAtCIIh8hSAGfCABQfiLAWopAwAiBiABQfCLAWopAwAiCHyFIgkgAkHvAGopAwAgA3wgBoUiBkL/////D4MiCyACKQNnIAN9IAiFIghCIIgiDH4iDUL/////D4MgBkIgiCIGIAhC/////w+DIgh+fCALIAh+IghCIIh8IgtCIIYgCEL/////D4OEIA1CIIggBiAMfnwgC0IgiHyFIAV8IAcgCnyFIgZ8IgVCJYggBYVC+fPd8ZnymasWfiIFQiCIIAWFNwMAIABCACAGQoeVr6+Ytt6bnn9+IA8gA31Cz9bTvtLHq9lCfnwgCULj3MqV/M7y9YV/fnwiA0IliCADhUL5893xmfKZqxZ+IgNCIIggA4V9NwMIC98FAgF+AX8CQAJAQQApA4AKIgBQRQ0AQYAIIQFCACEADAELAkB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0GWLG1Muo3FkSJeiDflOOBnvRqnerNio+nY/45w0P/ncu8fHC08dilHgS820WTHIn37J2XhzZOrFrIM00+vDxYGg//oTY+sXDd1Rt/DaSdMWVSYp1GieKxa+WH1HofyP+LjRetAxzkXLOo+VFgQor9f7yrtLQH5AAgAA",hash:"b9ab74e2"};const MI=new g;let KI=null;const pI=new Uint8Array(8);function sI(A){return!Number.isInteger(A)||A<0||A>4294967295?new Error("Seed must be given as two valid 32-bit long unsigned integers (lo + high)."):null}function YI(A,I,B){const g=new DataView(A);g.setUint32(0,I,!0),g.setUint32(4,B,!0)}function rI(A,I=0,B=0){if(sI(I))return Promise.reject(sI(I));if(sI(B))return Promise.reject(sI(B));if(null===KI)return U(MI,qI,16).then((g=>(KI=g,YI(pI.buffer,I,B),KI.writeMemory(pI),KI.calculate(A))));try{YI(pI.buffer,I,B),KI.writeMemory(pI);const g=KI.calculate(A);return Promise.resolve(g)}catch(A){return Promise.reject(A)}}function RI(A=0,I=0){return sI(A)?Promise.reject(sI(A)):sI(I)?Promise.reject(sI(I)):d(qI,16).then((B=>{const g=new Uint8Array(8);YI(g.buffer,A,I),B.writeMemory(g),B.init();const Q={init:()=>(B.writeMemory(g),B.init(),Q),update:A=>(B.update(A),Q),digest:A=>B.digest(A),save:()=>B.save(),load:A=>(B.load(A),Q),blockSize:512,digestSize:16};return Q}))}var lI={name:"ripemd160",data:"AGFzbQEAAAABEQRgAAF/YAAAYAF/AGACf38AAwkIAAECAwIBAAIFBAEBAgIGDgJ/AUHgiQULfwBBgAgLB4MBCQZtZW1vcnkCAA5IYXNoX0dldEJ1ZmZlcgAACUhhc2hfSW5pdAABEHJpcGVtZDE2MF91cGRhdGUAAwtIYXNoX1VwZGF0ZQAECkhhc2hfRmluYWwABQ1IYXNoX0dldFN0YXRlAAYOSGFzaF9DYWxjdWxhdGUABwpTVEFURV9TSVpFAwEKzzIIBQBBgAkLOgBBAEHww8uefDYCmIkBQQBC/rnrxemOlZkQNwKQiQFBAEKBxp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6abbce74"};const XI=new g;let zI=null;function VI(A){if(null===zI)return U(XI,lI,20).then((I=>(zI=I,zI.calculate(A))));try{const I=zI.calculate(A);return Promise.resolve(I)}catch(A){return Promise.reject(A)}}function ZI(){return d(lI,20).then((A=>{A.init();const I={init:()=>(A.init(),I),update:B=>(A.update(B),I),digest:I=>A.digest(I),save:()=>A.save(),load:B=>(A.load(B),I),blockSize:64,digestSize:20};return I}))}function mI(A,I){A.init();const{blockSize:B}=A,g=function(A,I){const{blockSize:B}=A,g=h(I);if(g.length>B){A.update(g);const I=A.digest("binary");return A.init(),I}return new Uint8Array(g.buffer,g.byteOffset,g.length)}(A,I),Q=new Uint8Array(B);Q.set(g);const C=new Uint8Array(B);for(let A=0;A(A.init(),A.update(Q),i),update:I=>(A.update(I),i),digest:I=>{const B=A.digest("binary");return A.init(),A.update(C),A.update(B),A.digest(I)},save:()=>{throw new Error("save() not supported")},load:()=>{throw new Error("load() not supported")},blockSize:A.blockSize,digestSize:A.digestSize};return i}function LI(A,I){if(!A||!A.then)throw new Error('Invalid hash function is provided! Usage: createHMAC(createMD5(), "key").');return A.then((A=>mI(A,I)))}function WI(A){return B(this,void 0,void 0,(function*(){(A=>{if(!A||"object"!=typeof A)throw new Error("Invalid options parameter. It requires an object.");if(!A.hashFunction||!A.hashFunction.then)throw new Error('Invalid hash function is provided! Usage: pbkdf2("password", "salt", 1000, 32, createSHA1()).');if(!Number.isInteger(A.iterations)||A.iterations<1)throw new Error("Iterations should be a positive number");if(!Number.isInteger(A.hashLength)||A.hashLength<1)throw new Error("Hash length should be a positive number");if(void 0===A.outputType&&(A.outputType="hex"),!["hex","binary"].includes(A.outputType))throw new Error(`Insupported output type ${A.outputType}. Valid values: ['hex', 'binary']`)})(A);return function(A,I,g,Q,C){return B(this,void 0,void 0,(function*(){const B=new Uint8Array(Q),i=new Uint8Array(I.length+4),E=new DataView(i.buffer),o=h(I),F=new Uint8Array(o.buffer,o.byteOffset,o.length);i.set(F);let D=0;const a=A.digestSize,w=Math.ceil(Q/a);let k=null,G=null;for(let C=1;C<=w;C++){E.setUint32(I.length,C),A.init(),A.update(i),k=A.digest("binary"),G=k.slice();for(let I=1;I{if(!A||"object"!=typeof A)throw new Error("Invalid options parameter. It requires an object.");if(!Number.isInteger(A.blockSize)||A.blockSize<1)throw new Error("Block size should be a positive number");if(!Number.isInteger(A.costFactor)||A.costFactor<2||!(I=A.costFactor)||I&I-1)throw new Error("Cost factor should be a power of 2, greater than 1");var I;if(!Number.isInteger(A.parallelism)||A.parallelism<1)throw new Error("Parallelism should be a positive number");if(!Number.isInteger(A.hashLength)||A.hashLength<1)throw new Error("Hash length should be a positive number.");if(void 0===A.outputType&&(A.outputType="hex"),!["hex","binary"].includes(A.outputType))throw new Error(`Insupported output type ${A.outputType}. Valid values: ['hex', 'binary']`)})(A),function(A){return B(this,void 0,void 0,(function*(){const{costFactor:I,blockSize:B,parallelism:g,hashLength:Q}=A,C=jA(),i=yield WI({password:A.password,salt:A.salt,iterations:1,hashLength:128*B*g,hashFunction:C,outputType:"binary"}),E=yield d(uI,0),o=128*B*I,F=256*B;E.setMemorySize(i.length+o+F),E.writeMemory(i,0),E.getExports().scrypt(B,I,g);const D=E.getMemory().subarray(0,128*B*g),h=yield WI({password:A.password,salt:D,iterations:1,hashLength:Q,hashFunction:C,outputType:"binary"});return"hex"===A.outputType?c(new Uint8Array(2*Q),h,Q):h}))}(A)}))}var OI={name:"bcrypt",data:"AGFzbQEAAAABFwRgAAF/YAR/f39/AGADf39/AGABfwF/AwUEAAECAwUEAQECAgYIAX8BQZCrBQsHNAQGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAZiY3J5cHQAAg1iY3J5cHRfdmVyaWZ5AAMK9WAEBQBBgCsL21kEFH8Bfgh/AX4jAEHwAGshBCACQQA6AAIgAkGq4AA7AAACQCABLQAAQSpHDQAgAS0AAUEwRw0AIAJBMToAAQsCQCABLAAFIAEsAARBCmxqQfB7aiIFQQRJDQAgAS0AB0FgaiIGQ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OvCMtAQMzitE5qRtI0hK8VASgEsOEdOpiVtJ+4Bkigbs6COz9vgqsgNUsdGgH4J3InsWAVYdw/k+creTq7vSVFNOE5iKBLec5Rt8kyL8m6H6B+yBzg9tHHvMMRAc/HquihSYeQGpq9T9TL3trQONoK1SrDOQNnNpHGfDH5jU8rseC3WZ73Orv1Q/8Z1fKcRdknLCKXvyr85hVx/JEPJRWUm2GT5frrnLbOWWSowtGouhJeB8G2DGoF42VQ0hBCpAPLDm7s4DvbmBa+oJhMZOl4MjKVH5/fktPgKzSg0x7ycYlBdAobjDSjSyBxvsXYMnbDjZ813y4vmZtHbwvmHfHjD1TaTOWR2Noez3lizm9+Ps1msRgWBR0s/cXSj4SZIvv2V/Mj9SN2MqYxNaiTAs3MVmKB8Ky163ValzYWbsxz0oiSYpbe0Em5gRuQUEwUVsZxvcfG5goUejIG0OFFmnvyw/1TqskAD6hi4r8lu/bSvTUFaRJxIgIEsnzPy7YrnHbNwD4RU9PjQBZgvas48K1HJZwgOLp2zkb3xaGvd2BgdSBO/suF2I3oirD5qnp+qvlMXMJIGYyK+wLkasMB+eHr1mn41JCg3lymLSUJP5/mCMIyYU63W+J3zuPfj1fmcsM6iGo/JNMIo4UuihkTRHNwAyI4CaTQMZ8pmPouCIlsTuzmIShFdxPQOM9mVL5sDOk0tymswN1QfMm11YQ/FwlHtdnVFpIb+3mJ",hash:"8bd8822d"};function PI(A){return B(this,void 0,void 0,(function*(){const{costFactor:I,password:B,salt:g}=A,Q=yield d(OI,0);Q.writeMemory(h(g),0);const C=h(B);Q.writeMemory(C,16);const i="encoded"===A.outputType?1:0;Q.getExports().bcrypt(C.length,I,i);const E=Q.getMemory();if("encoded"===A.outputType)return o=E,F=60,String.fromCharCode(...o.subarray(0,F));var o,F;if("hex"===A.outputType){return c(new Uint8Array(48),E,24)}return E.slice(0,24)}))}function bI(A){return B(this,void 0,void 0,(function*(){return(A=>{if(!A||"object"!=typeof A)throw new Error("Invalid options parameter. It requires an object.");if(!Number.isInteger(A.costFactor)||A.costFactor<4||A.costFactor>31)throw new Error("Cost factor should be a number between 4 and 31");if(A.password=h(A.password),A.password.length<1)throw new Error("Password should be at least 1 byte long");if(A.password.length>72)throw new Error("Password should be at most 72 bytes long");if(A.salt=h(A.salt),16!==A.salt.length)throw new Error("Salt should be 16 bytes long");if(void 0===A.outputType&&(A.outputType="encoded"),!["hex","binary","encoded"].includes(A.outputType))throw new Error(`Insupported output type ${A.outputType}. Valid values: ['hex', 'binary', 'encoded']`)})(A),PI(A)}))}const vI=A=>{if(!A||"object"!=typeof A)throw new Error("Invalid options parameter. It requires an object.");if(void 0===A.hash||"string"!=typeof A.hash)throw new Error("Hash should be specified");if(60!==A.hash.length)throw new Error("Hash should be 60 bytes long");if(!(A=>!(!/^\$2[axyb]\$[0-3][0-9]\$[./A-Za-z0-9]{53}$/.test(A)||"0"===A[4]&&Number(A[5])<4||"3"===A[4]&&Number(A[5])>1))(A.hash))throw new Error("Invalid hash");if(A.password=h(A.password),A.password.length<1)throw new Error("Password should be at least 1 byte long");if(A.password.length>72)throw new Error("Password should be at most 72 bytes long")};function jI(A){return B(this,void 0,void 0,(function*(){vI(A);const{hash:I,password:B}=A,g=yield d(OI,0);g.writeMemory(h(I),0);const Q=h(B);return g.writeMemory(Q,60),!!g.getExports().bcrypt_verify(Q.length)}))}var TI={name:"whirlpool",data:"AGFzbQEAAAABEQRgAAF/YAF/AGACf38AYAAAAwkIAAECAwEDAAEFBAEBAgIGDgJ/AUHQmwULfwBBgAgLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAJSGFzaF9Jbml0AAMLSGFzaF9VcGRhdGUABApIYXNoX0ZpbmFsAAUNSGFzaF9HZXRTdGF0ZQAGDkhhc2hfQ2FsY3VsYXRlAAcKU1RBVEVfU0laRQMBCu0bCAUAQYAZC8wGAQl+IAApAwAhAUEAQQApA4CbASICNwPAmQEgACkDGCEDIAApAxAhBCAAKQMIIQVBAEEAKQOYmwEiBjcD2JkBQQBB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lZeVnyILKrhIQqhFSuFdByctVyt6fkxTk55DnV3XLsTEwtTFphmBZeXmVeyju8lHh4/XjnhfCfODjgON3YcOWMjAqMFIYFmNHRY9HGsr8XpaWupUELV+Ti4q/iQ03ZoWFhmWEv+MJOs7P2s/FFe0IhIYQhFaVCNJycSpyU1iUIHh54HvBmPO5DQxFDIlKGYcfHO8d2/JOx/PzX/LMr5U8EBBAEIBQIJFFRWVGyCKLjmZlembzHLyVtbaltT8TaIg0NNA1oORpl+vrP+oM16Xnf31vftoSjaX5+5X7Xm/ypJCSQJD20SBk7O+w7xdd2/qurlqsxPUuazs4fzj7RgfAREUQRiFUimY+PBo8MiQODTk4lTkprnAS3t+a30VFzZuvri+sLYMvgPDzwPP3MeMGBgT6BfL8f/ZSUapTU/jVA9/f79+sM8xy5ud65oWdvGBMTTBOYXyaLLCywLH2cWFHT02vT1ri7Befnu+drXNOMbm6lblfL3DnExDfEbvOVqgMDDAMYDwYbVlZFVooTrNxERA1EGkmIXn9/4X/fnv6gqameqSE3T4gqKqgqTYJUZ7u71ruxbWsKwcEjwUbin4dTU1FTogKm8dzcV9yui6VyCwssC1gnFlOdnU6dnNMnAWxsrWxHwdgrMTHEMZX1YqR0dM10h7no8/b2//bjCfEVRkYFRgpDjEysrIqsCSZFpYmJHok8lw+1FBRQFKBEKLTh4aPhW0LfuhYWWBawTiymOjroOs3SdPdpablpb9DSBgkJJAlILRJBcHDdcKet4Ne2tuK22VRxb9DQZ9DOt70e7e2T7Tt+x9bMzBfMLtuF4kJCFUIqV4RomJhamLTCLSykpKqkSQ5V7SgooChdiFB1XFxtXNoxuIb4+Mf4kz/ta4aGIoZEpBHC",hash:"8d8f6035"};const $I=new g;let _I=null;function AB(A){if(null===_I)return U($I,TI,64).then((I=>(_I=I,_I.calculate(A))));try{const I=_I.calculate(A);return Promise.resolve(I)}catch(A){return Promise.reject(A)}}function IB(){return d(TI,64).then((A=>{A.init();const I={init:()=>(A.init(),I),update:B=>(A.update(B),I),digest:I=>A.digest(I),save:()=>A.save(),load:B=>(A.load(B),I),blockSize:64,digestSize:64};return I}))}var BB={name:"sm3",data:"AGFzbQEAAAABDANgAAF/YAAAYAF/AAMIBwABAgIBAAIFBAEBAgIGDgJ/AUHwiQULfwBBgAgLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAJSGFzaF9Jbml0AAELSGFzaF9VcGRhdGUAAgpIYXNoX0ZpbmFsAAQNSGFzaF9HZXRTdGF0ZQAFDkhhc2hfQ2FsY3VsYXRlAAYKU1RBVEVfU0laRQMBCtodBwUAQYAJC1EAQQBCzdy3nO7Jw/2wfzcCoIkBQQBCvOG8y6qVzpgWNwKYiQFBAELXhZG5gcCBxVo3ApCJAUEAQu+sgJyX16yKyQA3AoiJAUEAQgA3AoCJAQvvAwEIfwJAIABFDQBBACEBQQBBACgCgIkBIgIgAGoiAzYCgIkBIAJBP3EhBAJAIAMgAk8NAEEAQQAoAoSJAUEBajYChIkBC0GACSECAkAgBEUNAAJAIABBwAAgBGsiBU8NACAEIQEMAQsgBEE/cyEGIARBqIkBaiECQYAJIQMCQAJAIAVBB3EiBw0AIAUhCAwBCyAHIQgDQCACIAMtAAA6AAAgAkEBaiECIANBAWohAyAIQX9qIggNAAtBwAAgByAEamshCAsCQCAGQQdJDQADQCACIAMpAAA3AAAgAkEIaiECIANBCGohAyAIQXhqIggNAAsLQaiJARADIAVBgAlqIQIgACAFayEACwJAIABBwABJDQADQCACEAMgAkHAAGohAiAAQUBqIgBBP0sNAAsLIABFDQAgAUGoiQFqIQMCQAJAIABBB3EiCA0AIAAhBAwBCyAAQThxIQQDQCADIAItAAA6AAAgA0EBaiEDIAJBAWohAiAIQX9qIggNAAsLIABBCEkNAANAIAMgAi0AADoAACADIAItAAE6AAEgAyACLQACOgACIAMgAi0AAzoAAyADIAItAAQ6AAQgAyACLQAFOgAFIAMgAi0ABjoABiADIAItAAc6AAcgA0EIaiEDIAJBCGohAiAEQXhqIgQNAAsLC+wLARl/IwBBkAJ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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",hash:"b6fb4b8e"};const gB=new g;let QB=null;function CB(A){if(null===QB)return U(gB,BB,32).then((I=>(QB=I,QB.calculate(A))));try{const I=QB.calculate(A);return Promise.resolve(I)}catch(A){return Promise.reject(A)}}function iB(){return d(BB,32).then((A=>{A.init();const I={init:()=>(A.init(),I),update:B=>(A.update(B),I),digest:I=>A.digest(I),save:()=>A.save(),load:B=>(A.load(B),I),blockSize:64,digestSize:32};return I}))}export{N as adler32,L as argon2Verify,m as argon2d,V as argon2i,Z as argon2id,bI as bcrypt,jI as bcryptVerify,s as blake2b,b as blake2s,AA as blake3,iA as crc32,wA as crc64,t as createAdler32,Y as createBLAKE2b,v as createBLAKE2s,IA as createBLAKE3,EA as createCRC32,kA as createCRC64,LI as createHMAC,mA as createKeccak,dA as createMD4,tA as createMD5,ZI as createRIPEMD160,KA as createSHA1,OA as createSHA224,jA as createSHA256,lA as createSHA3,II as createSHA384,CI as createSHA512,iB as createSM3,IB as createWhirlpool,RI as createXXHash128,fI as createXXHash3,cI as createXXHash32,HI as createXXHash64,ZA as keccak,HA as md4,NA as md5,WI as pbkdf2,VI as ripemd160,xI as scrypt,MA as sha1,xA as sha224,vA as sha256,RA as sha3,AI as sha384,QI as sha512,CB as sm3,AB as whirlpool,rI as xxhash128,JI as xxhash3,DI as xxhash32,yI as xxhash64}; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/index.umd.js b/tools/mnemonic-test/node_modules/hash-wasm/dist/index.umd.js deleted file mode 100644 index dbd7ecf1..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/index.umd.js +++ /dev/null @@ -1,2731 +0,0 @@ -/*! - * hash-wasm (https://www.npmjs.com/package/hash-wasm) - * (c) Dani Biro - * @license MIT - */ - -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.hashwasm = {})); -})(this, (function (exports) { 'use strict'; - - var name$l = "adler32"; - var data$l = "AGFzbQEAAAABDANgAAF/YAAAYAF/AAMHBgABAgEAAgUEAQECAgYOAn8BQYCJBQt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQAAQtIYXNoX1VwZGF0ZQACCkhhc2hfRmluYWwAAw1IYXNoX0dldFN0YXRlAAQOSGFzaF9DYWxjdWxhdGUABQpTVEFURV9TSVpFAwEK6wkGBQBBgAkLCgBBAEEBNgKECAvjCAEHf0EAKAKECCIBQf//A3EhAiABQRB2IQMCQAJAIABBAUcNACACQQAtAIAJaiIBQY+AfGogASABQfD/A0sbIgEgA2oiBEEQdCIFQYCAPGogBSAEQfD/A0sbIAFyIQEMAQsCQAJAAkACQAJAIABBEEkNAEGACSEGIABBsCtJDQFBgAkhBgNAQQAhBQNAIAYgBWoiASgCACIEQf8BcSACaiICIANqIAIgBEEIdkH/AXFqIgJqIAIgBEEQdkH/AXFqIgJqIAIgBEEYdmoiAmogAiABQQRqKAIAIgRB/wFxaiICaiACIARBCHZB/wFxaiICaiACIARBEHZB/wFxaiICaiACIARBGHZqIgJqIAIgAUEIaigCACIEQf8BcWoiAmogAiAEQQh2Qf8BcWoiAmogAiAEQRB2Qf8BcWoiAmogAiAEQRh2aiIEaiAEIAFBDGooAgAiAUH/AXFqIgRqIAQgAUEIdkH/AXFqIgRqIAQgAUEQdkH/AXFqIgRqIAQgAUEYdmoiAmohAyAFQRBqIgVBsCtHDQALIANB8f8DcCEDIAJB8f8DcCECIAZBsCtqIQYgAEHQVGoiAEGvK0sNAAsgAEUNBCAAQQ9LDQEMAgsCQCAARQ0AAkACQCAAQQNxIgUNAEGACSEBIAAhBAwBCyAAQXxxIQRBACEBA0AgAiABQYAJai0AAGoiAiADaiEDIAUgAUEBaiIBRw0ACyAFQYAJaiEBCyAAQQRJDQADQCACIAEtAABqIgUgAS0AAWoiBiABLQACaiIAIAFBA2otAABqIgIgACAGIAUgA2pqamohAyABQQRqIQEgBEF8aiIEDQALCyACQY+AfGogAiACQfD/A0sbIANB8f8DcEEQdHIhAQwECwNAIAYoAgAiAUH/AXEgAmoiBCADaiAEIAFBCHZB/wFxaiIEaiAEIAFBEHZB/wFxaiIEaiAEIAFBGHZqIgRqIAQgBkEEaigCACIBQf8BcWoiBGogBCABQQh2Qf8BcWoiBGogBCABQRB2Qf8BcWoiBGogBCABQRh2aiIEaiAEIAZBCGooAgAiAUH/AXFqIgRqIAQgAUEIdkH/AXFqIgRqIAQgAUEQdkH/AXFqIgRqIAQgAUEYdmoiBGogBCAGQQxqKAIAIgFB/wFxaiIEaiAEIAFBCHZB/wFxaiIEaiAEIAFBEHZB/wFxaiIEaiAEIAFBGHZqIgJqIQMgBkEQaiEGIABBcGoiAEEPSw0ACyAARQ0BCyAAQX9qIQcCQCAAQQNxIgVFDQAgAEF8cSEAIAUhBCAGIQEDQCACIAEtAABqIgIgA2ohAyABQQFqIQEgBEF/aiIEDQALIAYgBWohBgsgB0EDSQ0AA0AgAiAGLQAAaiIBIAYtAAFqIgQgBi0AAmoiBSAGQQNqLQAAaiICIAUgBCABIANqampqIQMgBkEEaiEGIABBfGoiAA0ACwsgA0Hx/wNwIQMgAkHx/wNwIQILIAIgA0EQdHIhAQtBACABNgKECAsxAQF/QQBBACgChAgiAEEYdCAAQYD+A3FBCHRyIABBCHZBgP4DcSAAQRh2cnI2AoAJCwUAQYQICzsAQQBBATYChAggABACQQBBACgChAgiAEEYdCAAQYD+A3FBCHRyIABBCHZBgP4DcSAAQRh2cnI2AoAJCwsVAgBBgAgLBAQAAAAAQYQICwQBAAAA"; - var hash$l = "02ddbd17"; - var wasmJson$l = { - name: name$l, - data: data$l, - hash: hash$l - }; - - /****************************************************************************** - Copyright (c) Microsoft Corporation. - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. - ***************************************************************************** */ - /* global Reflect, Promise, SuppressedError, Symbol, Iterator */ - - - function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - } - - typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - class Mutex { - constructor() { - this.mutex = Promise.resolve(); - } - lock() { - let begin = () => { }; - this.mutex = this.mutex.then(() => new Promise(begin)); - return new Promise((res) => { - begin = res; - }); - } - dispatch(fn) { - return __awaiter(this, void 0, void 0, function* () { - const unlock = yield this.lock(); - try { - return yield Promise.resolve(fn()); - } - finally { - unlock(); - } - }); - } - } - - var _a; - function getGlobal() { - if (typeof globalThis !== "undefined") - return globalThis; - if (typeof self !== "undefined") - return self; - if (typeof window !== "undefined") - return window; - return global; - } - const globalObject = getGlobal(); - const nodeBuffer = (_a = globalObject.Buffer) !== null && _a !== void 0 ? _a : null; - const textEncoder = globalObject.TextEncoder - ? new globalObject.TextEncoder() - : null; - function intArrayToString(arr, len) { - return String.fromCharCode(...arr.subarray(0, len)); - } - function hexCharCodesToInt(a, b) { - return ((((a & 0xf) + ((a >> 6) | ((a >> 3) & 0x8))) << 4) | - ((b & 0xf) + ((b >> 6) | ((b >> 3) & 0x8)))); - } - function writeHexToUInt8(buf, str) { - const size = str.length >> 1; - for (let i = 0; i < size; i++) { - const index = i << 1; - buf[i] = hexCharCodesToInt(str.charCodeAt(index), str.charCodeAt(index + 1)); - } - } - function hexStringEqualsUInt8(str, buf) { - if (str.length !== buf.length * 2) { - return false; - } - for (let i = 0; i < buf.length; i++) { - const strIndex = i << 1; - if (buf[i] !== - hexCharCodesToInt(str.charCodeAt(strIndex), str.charCodeAt(strIndex + 1))) { - return false; - } - } - return true; - } - const alpha = "a".charCodeAt(0) - 10; - const digit = "0".charCodeAt(0); - function getDigestHex(tmpBuffer, input, hashLength) { - let p = 0; - for (let i = 0; i < hashLength; i++) { - let nibble = input[i] >>> 4; - tmpBuffer[p++] = nibble > 9 ? nibble + alpha : nibble + digit; - nibble = input[i] & 0xf; - tmpBuffer[p++] = nibble > 9 ? nibble + alpha : nibble + digit; - } - return String.fromCharCode.apply(null, tmpBuffer); - } - const getUInt8Buffer = nodeBuffer !== null - ? (data) => { - if (typeof data === "string") { - const buf = nodeBuffer.from(data, "utf8"); - return new Uint8Array(buf.buffer, buf.byteOffset, buf.length); - } - if (nodeBuffer.isBuffer(data)) { - return new Uint8Array(data.buffer, data.byteOffset, data.length); - } - if (ArrayBuffer.isView(data)) { - return new Uint8Array(data.buffer, data.byteOffset, data.byteLength); - } - throw new Error("Invalid data type!"); - } - : (data) => { - if (typeof data === "string") { - return textEncoder.encode(data); - } - if (ArrayBuffer.isView(data)) { - return new Uint8Array(data.buffer, data.byteOffset, data.byteLength); - } - throw new Error("Invalid data type!"); - }; - const base64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - const base64Lookup = new Uint8Array(256); - for (let i = 0; i < base64Chars.length; i++) { - base64Lookup[base64Chars.charCodeAt(i)] = i; - } - function encodeBase64(data, pad = true) { - const len = data.length; - const extraBytes = len % 3; - const parts = []; - const len2 = len - extraBytes; - for (let i = 0; i < len2; i += 3) { - const tmp = ((data[i] << 16) & 0xff0000) + - ((data[i + 1] << 8) & 0xff00) + - (data[i + 2] & 0xff); - const triplet = base64Chars.charAt((tmp >> 18) & 0x3f) + - base64Chars.charAt((tmp >> 12) & 0x3f) + - base64Chars.charAt((tmp >> 6) & 0x3f) + - base64Chars.charAt(tmp & 0x3f); - parts.push(triplet); - } - if (extraBytes === 1) { - const tmp = data[len - 1]; - const a = base64Chars.charAt(tmp >> 2); - const b = base64Chars.charAt((tmp << 4) & 0x3f); - parts.push(`${a}${b}`); - if (pad) { - parts.push("=="); - } - } - else if (extraBytes === 2) { - const tmp = (data[len - 2] << 8) + data[len - 1]; - const a = base64Chars.charAt(tmp >> 10); - const b = base64Chars.charAt((tmp >> 4) & 0x3f); - const c = base64Chars.charAt((tmp << 2) & 0x3f); - parts.push(`${a}${b}${c}`); - if (pad) { - parts.push("="); - } - } - return parts.join(""); - } - function getDecodeBase64Length(data) { - let bufferLength = Math.floor(data.length * 0.75); - const len = data.length; - if (data[len - 1] === "=") { - bufferLength -= 1; - if (data[len - 2] === "=") { - bufferLength -= 1; - } - } - return bufferLength; - } - function decodeBase64(data) { - const bufferLength = getDecodeBase64Length(data); - const len = data.length; - const bytes = new Uint8Array(bufferLength); - let p = 0; - for (let i = 0; i < len; i += 4) { - const encoded1 = base64Lookup[data.charCodeAt(i)]; - const encoded2 = base64Lookup[data.charCodeAt(i + 1)]; - const encoded3 = base64Lookup[data.charCodeAt(i + 2)]; - const encoded4 = base64Lookup[data.charCodeAt(i + 3)]; - bytes[p] = (encoded1 << 2) | (encoded2 >> 4); - p += 1; - bytes[p] = ((encoded2 & 15) << 4) | (encoded3 >> 2); - p += 1; - bytes[p] = ((encoded3 & 3) << 6) | (encoded4 & 63); - p += 1; - } - return bytes; - } - - const MAX_HEAP = 16 * 1024; - const WASM_FUNC_HASH_LENGTH = 4; - const wasmMutex = new Mutex(); - const wasmModuleCache = new Map(); - function WASMInterface(binary, hashLength) { - return __awaiter(this, void 0, void 0, function* () { - let wasmInstance = null; - let memoryView = null; - let initialized = false; - if (typeof WebAssembly === "undefined") { - throw new Error("WebAssembly is not supported in this environment!"); - } - const writeMemory = (data, offset = 0) => { - memoryView.set(data, offset); - }; - const getMemory = () => memoryView; - const getExports = () => wasmInstance.exports; - const setMemorySize = (totalSize) => { - wasmInstance.exports.Hash_SetMemorySize(totalSize); - const arrayOffset = wasmInstance.exports.Hash_GetBuffer(); - const memoryBuffer = wasmInstance.exports.memory.buffer; - memoryView = new Uint8Array(memoryBuffer, arrayOffset, totalSize); - }; - const getStateSize = () => { - const view = new DataView(wasmInstance.exports.memory.buffer); - const stateSize = view.getUint32(wasmInstance.exports.STATE_SIZE, true); - return stateSize; - }; - const loadWASMPromise = wasmMutex.dispatch(() => __awaiter(this, void 0, void 0, function* () { - if (!wasmModuleCache.has(binary.name)) { - const asm = decodeBase64(binary.data); - const promise = WebAssembly.compile(asm); - wasmModuleCache.set(binary.name, promise); - } - const module = yield wasmModuleCache.get(binary.name); - wasmInstance = yield WebAssembly.instantiate(module, { - // env: { - // emscripten_memcpy_big: (dest, src, num) => { - // const memoryBuffer = wasmInstance.exports.memory.buffer; - // const memView = new Uint8Array(memoryBuffer, 0); - // memView.set(memView.subarray(src, src + num), dest); - // }, - // print_memory: (offset, len) => { - // const memoryBuffer = wasmInstance.exports.memory.buffer; - // const memView = new Uint8Array(memoryBuffer, 0); - // console.log('print_int32', memView.subarray(offset, offset + len)); - // }, - // }, - }); - // wasmInstance.exports._start(); - })); - const setupInterface = () => __awaiter(this, void 0, void 0, function* () { - if (!wasmInstance) { - yield loadWASMPromise; - } - const arrayOffset = wasmInstance.exports.Hash_GetBuffer(); - const memoryBuffer = wasmInstance.exports.memory.buffer; - memoryView = new Uint8Array(memoryBuffer, arrayOffset, MAX_HEAP); - }); - const init = (bits = null) => { - initialized = true; - wasmInstance.exports.Hash_Init(bits); - }; - const updateUInt8Array = (data) => { - let read = 0; - while (read < data.length) { - const chunk = data.subarray(read, read + MAX_HEAP); - read += chunk.length; - memoryView.set(chunk); - wasmInstance.exports.Hash_Update(chunk.length); - } - }; - const update = (data) => { - if (!initialized) { - throw new Error("update() called before init()"); - } - const Uint8Buffer = getUInt8Buffer(data); - updateUInt8Array(Uint8Buffer); - }; - const digestChars = new Uint8Array(hashLength * 2); - const digest = (outputType, padding = null) => { - if (!initialized) { - throw new Error("digest() called before init()"); - } - initialized = false; - wasmInstance.exports.Hash_Final(padding); - if (outputType === "binary") { - // the data is copied to allow GC of the original memory object - return memoryView.slice(0, hashLength); - } - return getDigestHex(digestChars, memoryView, hashLength); - }; - const save = () => { - if (!initialized) { - throw new Error("save() can only be called after init() and before digest()"); - } - const stateOffset = wasmInstance.exports.Hash_GetState(); - const stateLength = getStateSize(); - const memoryBuffer = wasmInstance.exports.memory.buffer; - const internalState = new Uint8Array(memoryBuffer, stateOffset, stateLength); - // prefix is 4 bytes from SHA1 hash of the WASM binary - // it is used to detect incompatible internal states between different versions of hash-wasm - const prefixedState = new Uint8Array(WASM_FUNC_HASH_LENGTH + stateLength); - writeHexToUInt8(prefixedState, binary.hash); - prefixedState.set(internalState, WASM_FUNC_HASH_LENGTH); - return prefixedState; - }; - const load = (state) => { - if (!(state instanceof Uint8Array)) { - throw new Error("load() expects an Uint8Array generated by save()"); - } - const stateOffset = wasmInstance.exports.Hash_GetState(); - const stateLength = getStateSize(); - const overallLength = WASM_FUNC_HASH_LENGTH + stateLength; - const memoryBuffer = wasmInstance.exports.memory.buffer; - if (state.length !== overallLength) { - throw new Error(`Bad state length (expected ${overallLength} bytes, got ${state.length})`); - } - if (!hexStringEqualsUInt8(binary.hash, state.subarray(0, WASM_FUNC_HASH_LENGTH))) { - throw new Error("This state was written by an incompatible hash implementation"); - } - const internalState = state.subarray(WASM_FUNC_HASH_LENGTH); - new Uint8Array(memoryBuffer, stateOffset, stateLength).set(internalState); - initialized = true; - }; - const isDataShort = (data) => { - if (typeof data === "string") { - // worst case is 4 bytes / char - return data.length < MAX_HEAP / 4; - } - return data.byteLength < MAX_HEAP; - }; - let canSimplify = isDataShort; - switch (binary.name) { - case "argon2": - case "scrypt": - canSimplify = () => true; - break; - case "blake2b": - case "blake2s": - // if there is a key at blake2 then cannot simplify - canSimplify = (data, initParam) => initParam <= 512 && isDataShort(data); - break; - case "blake3": - // if there is a key at blake3 then cannot simplify - canSimplify = (data, initParam) => initParam === 0 && isDataShort(data); - break; - case "xxhash64": // cannot simplify - case "xxhash3": - case "xxhash128": - case "crc64": - canSimplify = () => false; - break; - } - // shorthand for (init + update + digest) for better performance - const calculate = (data, initParam = null, digestParam = null) => { - if (!canSimplify(data, initParam)) { - init(initParam); - update(data); - return digest("hex", digestParam); - } - const buffer = getUInt8Buffer(data); - memoryView.set(buffer); - wasmInstance.exports.Hash_Calculate(buffer.length, initParam, digestParam); - return getDigestHex(digestChars, memoryView, hashLength); - }; - yield setupInterface(); - return { - getMemory, - writeMemory, - getExports, - setMemorySize, - init, - update, - digest, - save, - load, - calculate, - hashLength, - }; - }); - } - - function lockedCreate(mutex, binary, hashLength) { - return __awaiter(this, void 0, void 0, function* () { - const unlock = yield mutex.lock(); - const wasm = yield WASMInterface(binary, hashLength); - unlock(); - return wasm; - }); - } - - const mutex$l = new Mutex(); - let wasmCache$l = null; - /** - * Calculates Adler-32 hash. The resulting 32-bit hash is stored in - * network byte order (big-endian). - * - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ - function adler32(data) { - if (wasmCache$l === null) { - return lockedCreate(mutex$l, wasmJson$l, 4).then((wasm) => { - wasmCache$l = wasm; - return wasmCache$l.calculate(data); - }); - } - try { - const hash = wasmCache$l.calculate(data); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } - } - /** - * Creates a new Adler-32 hash instance - */ - function createAdler32() { - return WASMInterface(wasmJson$l, 4).then((wasm) => { - wasm.init(); - const obj = { - init: () => { - wasm.init(); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 4, - digestSize: 4, - }; - return obj; - }); - } - - var name$k = "argon2"; - var data$k = "AGFzbQEAAAABKQVgAX8Bf2AAAX9gEH9/f39/f39/f39/f39/f38AYAR/f39/AGACf38AAwYFAAECAwQFBgEBAoCAAgYIAX8BQZCoBAsHQQQGbWVtb3J5AgASSGFzaF9TZXRNZW1vcnlTaXplAAAOSGFzaF9HZXRCdWZmZXIAAQ5IYXNoX0NhbGN1bGF0ZQAECvEyBVgBAn9BACEBAkAgAEEAKAKICCICRg0AAkAgACACayIAQRB2IABBgIB8cSAASWoiAEAAQX9HDQBB/wHADwtBACEBQQBBACkDiAggAEEQdK18NwOICAsgAcALcAECfwJAQQAoAoAIIgANAEEAPwBBEHQiADYCgAhBACgCiAgiAUGAgCBGDQACQEGAgCAgAWsiAEEQdiAAQYCAfHEgAElqIgBAAEF/Rw0AQQAPC0EAQQApA4gIIABBEHStfDcDiAhBACgCgAghAAsgAAvcDgECfiAAIAQpAwAiECAAKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAMIBAgDCkDAIVCIIkiEDcDACAIIBAgCCkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgBCAQIAQpAwCFQiiJIhA3AwAgACAQIAApAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIAwgECAMKQMAhUIwiSIQNwMAIAggECAIKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAEIBAgBCkDAIVCAYk3AwAgASAFKQMAIhAgASkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgDSAQIA0pAwCFQiCJIhA3AwAgCSAQIAkpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAUgECAFKQMAhUIoiSIQNwMAIAEgECABKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACANIBAgDSkDAIVCMIkiEDcDACAJIBAgCSkDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgBSAQIAUpAwCFQgGJNwMAIAIgBikDACIQIAIpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIA4gECAOKQMAhUIgiSIQNwMAIAogECAKKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAGIBAgBikDAIVCKIkiEDcDACACIBAgAikDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgDiAQIA4pAwCFQjCJIhA3AwAgCiAQIAopAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIAYgECAGKQMAhUIBiTcDACADIAcpAwAiECADKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAPIBAgDykDAIVCIIkiEDcDACALIBAgCykDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgByAQIAcpAwCFQiiJIhA3AwAgAyAQIAMpAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIA8gECAPKQMAhUIwiSIQNwMAIAsgECALKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAHIBAgBykDAIVCAYk3AwAgACAFKQMAIhAgACkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgDyAQIA8pAwCFQiCJIhA3AwAgCiAQIAopAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAUgECAFKQMAhUIoiSIQNwMAIAAgECAAKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAPIBAgDykDAIVCMIkiEDcDACAKIBAgCikDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgBSAQIAUpAwCFQgGJNwMAIAEgBikDACIQIAEpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAwgECAMKQMAhUIgiSIQNwMAIAsgECALKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAGIBAgBikDAIVCKIkiEDcDACABIBAgASkDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgDCAQIAwpAwCFQjCJIhA3AwAgCyAQIAspAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIAYgECAGKQMAhUIBiTcDACACIAcpAwAiECACKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACANIBAgDSkDAIVCIIkiEDcDACAIIBAgCCkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgByAQIAcpAwCFQiiJIhA3AwAgAiAQIAIpAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIA0gECANKQMAhUIwiSIQNwMAIAggECAIKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAHIBAgBykDAIVCAYk3AwAgAyAEKQMAIhAgAykDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgDiAQIA4pAwCFQiCJIhA3AwAgCSAQIAkpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAQgECAEKQMAhUIoiSIQNwMAIAMgECADKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAOIBAgDikDAIVCMIkiEDcDACAJIBAgCSkDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgBCAQIAQpAwCFQgGJNwMAC98aAQN/QQAhBEEAIAIpAwAgASkDAIU3A5AIQQAgAikDCCABKQMIhTcDmAhBACACKQMQIAEpAxCFNwOgCEEAIAIpAxggASkDGIU3A6gIQQAgAikDICABKQMghTcDsAhBACACKQMoIAEpAyiFNwO4CEEAIAIpAzAgASkDMIU3A8AIQQAgAikDOCABKQM4hTcDyAhBACACKQNAIA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CGohAyABQRBqIQEgA0H4B0kNAAsgHCAKRw0ACwsgAiAXaiEbQXghAQNAIAIgAWoiA0EIaiAbIAFqIgRBCGopAwA3AwAgA0EQaiAEQRBqKQMANwMAIANBGGogBEEYaikDADcDACADQSBqIARBIGopAwA3AwAgAUEgaiIBQfgHSQ0ACwsL"; - var hash$k = "e4cdc523"; - var wasmJson$k = { - name: name$k, - data: data$k, - hash: hash$k - }; - - var name$j = "blake2b"; - var data$j = "AGFzbQEAAAABEQRgAAF/YAJ/fwBgAX8AYAAAAwoJAAECAwECAgABBQQBAQICBg4CfwFBsIsFC38AQYAICwdwCAZtZW1vcnkCAA5IYXNoX0dldEJ1ZmZlcgAACkhhc2hfRmluYWwAAwlIYXNoX0luaXQABQtIYXNoX1VwZGF0ZQAGDUhhc2hfR2V0U3RhdGUABw5IYXNoX0NhbGN1bGF0ZQAIClNUQVRFX1NJWkUDAQrTOAkFAEGACQvrAgIFfwF+AkAgAUEBSA0AAkACQAJAIAFBgAFBACgC4IoBIgJrIgNKDQAgASEEDAELQQBBADYC4IoBAkAgAkH/AEoNACACQeCJAWohBSAAIQRBACEGA0AgBSAELQAAOgAAIARBAWohBCAFQQFqIQUgAyAGQQFqIgZB/wFxSg0ACwtBAEEAKQPAiQEiB0KAAXw3A8CJAUEAQQApA8iJASAHQv9+Vq18NwPIiQFB4IkBEAIgACADaiEAAkAgASADayIEQYEBSA0AIAIgAWohBQNAQQBBACkDwIkBIgdCgAF8NwPAiQFBAEEAKQPIiQEgB0L/flatfDcDyIkBIAAQAiAAQYABaiEAIAVBgH9qIgVBgAJLDQALIAVBgH9qIQQMAQsgBEEATA0BC0EAIQUDQCAFQQAoAuCKAWpB4IkBaiAAIAVqLQAAOgAAIAQgBUEBaiIFQf8BcUoNAAsLQQBBACgC4IoBIARqNgLgigELC78uASR+QQBBACkD0IkBQQApA7CJASIBQQApA5CJAXwgACkDICICfCIDhULr+obav7X2wR+FQiCJIgRCq/DT9K/uvLc8fCIFIAGFQiiJI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EEAQQApA/CKASIDQoiS853/zPmE6gCFNwOAiQFBAEEAKQP4igFCu86qptjQ67O7f4U3A4iJAUEAQQApA4CLAUKr8NP0r+68tzyFNwOQiQFBAEEAKQOIiwFC8e30+KWn/aelf4U3A5iJAUEAQQApA5CLAULRhZrv+s+Uh9EAhTcDoIkBQQBBACkDmIsBQp/Y+dnCkdqCm3+FNwOoiQFBAEEAKQOgiwFC6/qG2r+19sEfhTcDsIkBQQBBACkDqIsBQvnC+JuRo7Pw2wCFNwO4iQFBACADp0H/AXE2AuSKAQJAIAFBAUgNACACQgA3A3ggAkIANwNwIAJCADcDaCACQgA3A2AgAkIANwNYIAJCADcDUCACQgA3A0ggAkIANwNAIAJCADcDOCACQgA3AzAgAkIANwMoIAJCADcDICACQgA3AxggAkIANwMQIAJCADcDCCACQgA3AwBBACEEA0AgAiAAaiAAQYAJai0AADoAACAAQQFqIQAgBEEBaiIEQf8BcSABSA0ACyACQYABEAELIAJBgAFqJAALEgAgAEEDdkH/P3EgAEEQdhAECwkAQYAJIAAQAQsGAEGAiQELGwAgAUEDdkH/P3EgAUEQdhAEQYAJIAAQARADCwsLAQBBgAgLBPAAAAA="; - var hash$j = "c6f286e6"; - var wasmJson$j = { - name: name$j, - data: data$j, - hash: hash$j - }; - - const mutex$k = new Mutex(); - let wasmCache$k = null; - function validateBits$4(bits) { - if (!Number.isInteger(bits) || bits < 8 || bits > 512 || bits % 8 !== 0) { - return new Error("Invalid variant! Valid values: 8, 16, ..., 512"); - } - return null; - } - function getInitParam$1(outputBits, keyBits) { - return outputBits | (keyBits << 16); - } - /** - * Calculates BLAKE2b hash - * @param data Input data (string, Buffer or TypedArray) - * @param bits Number of output bits, which has to be a number - * divisible by 8, between 8 and 512. Defaults to 512. - * @param key Optional key (string, Buffer or TypedArray). Maximum length is 64 bytes. - * @returns Computed hash as a hexadecimal string - */ - function blake2b(data, bits = 512, key = null) { - if (validateBits$4(bits)) { - return Promise.reject(validateBits$4(bits)); - } - let keyBuffer = null; - let initParam = bits; - if (key !== null) { - keyBuffer = getUInt8Buffer(key); - if (keyBuffer.length > 64) { - return Promise.reject(new Error("Max key length is 64 bytes")); - } - initParam = getInitParam$1(bits, keyBuffer.length); - } - const hashLength = bits / 8; - if (wasmCache$k === null || wasmCache$k.hashLength !== hashLength) { - return lockedCreate(mutex$k, wasmJson$j, hashLength).then((wasm) => { - wasmCache$k = wasm; - if (initParam > 512) { - wasmCache$k.writeMemory(keyBuffer); - } - return wasmCache$k.calculate(data, initParam); - }); - } - try { - if (initParam > 512) { - wasmCache$k.writeMemory(keyBuffer); - } - const hash = wasmCache$k.calculate(data, initParam); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } - } - /** - * Creates a new BLAKE2b hash instance - * @param bits Number of output bits, which has to be a number - * divisible by 8, between 8 and 512. Defaults to 512. - * @param key Optional key (string, Buffer or TypedArray). Maximum length is 64 bytes. - */ - function createBLAKE2b(bits = 512, key = null) { - if (validateBits$4(bits)) { - return Promise.reject(validateBits$4(bits)); - } - let keyBuffer = null; - let initParam = bits; - if (key !== null) { - keyBuffer = getUInt8Buffer(key); - if (keyBuffer.length > 64) { - return Promise.reject(new Error("Max key length is 64 bytes")); - } - initParam = getInitParam$1(bits, keyBuffer.length); - } - const outputSize = bits / 8; - return WASMInterface(wasmJson$j, outputSize).then((wasm) => { - if (initParam > 512) { - wasm.writeMemory(keyBuffer); - } - wasm.init(initParam); - const obj = { - init: initParam > 512 - ? () => { - wasm.writeMemory(keyBuffer); - wasm.init(initParam); - return obj; - } - : () => { - wasm.init(initParam); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 128, - digestSize: outputSize, - }; - return obj; - }); - } - - function encodeResult(salt, options, res) { - const parameters = [ - `m=${options.memorySize}`, - `t=${options.iterations}`, - `p=${options.parallelism}`, - ].join(","); - return `$argon2${options.hashType}$v=19$${parameters}$${encodeBase64(salt, false)}$${encodeBase64(res, false)}`; - } - const uint32View = new DataView(new ArrayBuffer(4)); - function int32LE(x) { - uint32View.setInt32(0, x, true); - return new Uint8Array(uint32View.buffer); - } - function hashFunc(blake512, buf, len) { - return __awaiter(this, void 0, void 0, function* () { - if (len <= 64) { - const blake = yield createBLAKE2b(len * 8); - blake.update(int32LE(len)); - blake.update(buf); - return blake.digest("binary"); - } - const r = Math.ceil(len / 32) - 2; - const ret = new Uint8Array(len); - blake512.init(); - blake512.update(int32LE(len)); - blake512.update(buf); - let vp = blake512.digest("binary"); - ret.set(vp.subarray(0, 32), 0); - for (let i = 1; i < r; i++) { - blake512.init(); - blake512.update(vp); - vp = blake512.digest("binary"); - ret.set(vp.subarray(0, 32), i * 32); - } - const partialBytesNeeded = len - 32 * r; - let blakeSmall; - if (partialBytesNeeded === 64) { - blakeSmall = blake512; - blakeSmall.init(); - } - else { - blakeSmall = yield createBLAKE2b(partialBytesNeeded * 8); - } - blakeSmall.update(vp); - vp = blakeSmall.digest("binary"); - ret.set(vp.subarray(0, partialBytesNeeded), r * 32); - return ret; - }); - } - function getHashType(type) { - switch (type) { - case "d": - return 0; - case "i": - return 1; - default: - return 2; - } - } - function argon2Internal(options) { - return __awaiter(this, void 0, void 0, function* () { - var _a; - const { parallelism, iterations, hashLength } = options; - const password = getUInt8Buffer(options.password); - const salt = getUInt8Buffer(options.salt); - const version = 0x13; - const hashType = getHashType(options.hashType); - const { memorySize } = options; // in KB - const secret = getUInt8Buffer((_a = options.secret) !== null && _a !== void 0 ? _a : ""); - const [argon2Interface, blake512] = yield Promise.all([ - WASMInterface(wasmJson$k, 1024), - createBLAKE2b(512), - ]); - // last block is for storing the init vector - argon2Interface.setMemorySize(memorySize * 1024 + 1024); - const initVector = new Uint8Array(24); - const initVectorView = new DataView(initVector.buffer); - initVectorView.setInt32(0, parallelism, true); - initVectorView.setInt32(4, hashLength, true); - initVectorView.setInt32(8, memorySize, true); - initVectorView.setInt32(12, iterations, true); - initVectorView.setInt32(16, version, true); - initVectorView.setInt32(20, hashType, true); - argon2Interface.writeMemory(initVector, memorySize * 1024); - blake512.init(); - blake512.update(initVector); - blake512.update(int32LE(password.length)); - blake512.update(password); - blake512.update(int32LE(salt.length)); - blake512.update(salt); - blake512.update(int32LE(secret.length)); - blake512.update(secret); - blake512.update(int32LE(0)); // associatedData length + associatedData - const segments = Math.floor(memorySize / (parallelism * 4)); // length of each lane - const lanes = segments * 4; - const param = new Uint8Array(72); - const H0 = blake512.digest("binary"); - param.set(H0); - for (let lane = 0; lane < parallelism; lane++) { - param.set(int32LE(0), 64); - param.set(int32LE(lane), 68); - let position = lane * lanes; - let chunk = yield hashFunc(blake512, param, 1024); - argon2Interface.writeMemory(chunk, position * 1024); - position += 1; - param.set(int32LE(1), 64); - chunk = yield hashFunc(blake512, param, 1024); - argon2Interface.writeMemory(chunk, position * 1024); - } - const C = new Uint8Array(1024); - writeHexToUInt8(C, argon2Interface.calculate(new Uint8Array([]), memorySize)); - const res = yield hashFunc(blake512, C, hashLength); - if (options.outputType === "hex") { - const digestChars = new Uint8Array(hashLength * 2); - return getDigestHex(digestChars, res, hashLength); - } - if (options.outputType === "encoded") { - return encodeResult(salt, options, res); - } - // return binary format - return res; - }); - } - const validateOptions$3 = (options) => { - var _a; - if (!options || typeof options !== "object") { - throw new Error("Invalid options parameter. It requires an object."); - } - if (!options.password) { - throw new Error("Password must be specified"); - } - options.password = getUInt8Buffer(options.password); - if (options.password.length < 1) { - throw new Error("Password must be specified"); - } - if (!options.salt) { - throw new Error("Salt must be specified"); - } - options.salt = getUInt8Buffer(options.salt); - if (options.salt.length < 8) { - throw new Error("Salt should be at least 8 bytes long"); - } - options.secret = getUInt8Buffer((_a = options.secret) !== null && _a !== void 0 ? _a : ""); - if (!Number.isInteger(options.iterations) || options.iterations < 1) { - throw new Error("Iterations should be a positive number"); - } - if (!Number.isInteger(options.parallelism) || options.parallelism < 1) { - throw new Error("Parallelism should be a positive number"); - } - if (!Number.isInteger(options.hashLength) || options.hashLength < 4) { - throw new Error("Hash length should be at least 4 bytes."); - } - if (!Number.isInteger(options.memorySize)) { - throw new Error("Memory size should be specified."); - } - if (options.memorySize < 8 * options.parallelism) { - throw new Error("Memory size should be at least 8 * parallelism."); - } - if (options.outputType === undefined) { - options.outputType = "hex"; - } - if (!["hex", "binary", "encoded"].includes(options.outputType)) { - throw new Error(`Insupported output type ${options.outputType}. Valid values: ['hex', 'binary', 'encoded']`); - } - }; - /** - * Calculates hash using the argon2i password-hashing function - * @returns Computed hash - */ - function argon2i(options) { - return __awaiter(this, void 0, void 0, function* () { - validateOptions$3(options); - return argon2Internal(Object.assign(Object.assign({}, options), { hashType: "i" })); - }); - } - /** - * Calculates hash using the argon2id password-hashing function - * @returns Computed hash - */ - function argon2id(options) { - return __awaiter(this, void 0, void 0, function* () { - validateOptions$3(options); - return argon2Internal(Object.assign(Object.assign({}, options), { hashType: "id" })); - }); - } - /** - * Calculates hash using the argon2d password-hashing function - * @returns Computed hash - */ - function argon2d(options) { - return __awaiter(this, void 0, void 0, function* () { - validateOptions$3(options); - return argon2Internal(Object.assign(Object.assign({}, options), { hashType: "d" })); - }); - } - const getHashParameters = (password, encoded, secret) => { - const regex = /^\$argon2(id|i|d)\$v=([0-9]+)\$((?:[mtp]=[0-9]+,){2}[mtp]=[0-9]+)\$([A-Za-z0-9+/]+)\$([A-Za-z0-9+/]+)$/; - const match = encoded.match(regex); - if (!match) { - throw new Error("Invalid hash"); - } - const [, hashType, version, parameters, salt, hash] = match; - if (version !== "19") { - throw new Error(`Unsupported version: ${version}`); - } - const parsedParameters = {}; - const paramMap = { m: "memorySize", p: "parallelism", t: "iterations" }; - for (const x of parameters.split(",")) { - const [n, v] = x.split("="); - parsedParameters[paramMap[n]] = Number(v); - } - return Object.assign(Object.assign({}, parsedParameters), { password, - secret, hashType: hashType, salt: decodeBase64(salt), hashLength: getDecodeBase64Length(hash), outputType: "encoded" }); - }; - const validateVerifyOptions$1 = (options) => { - if (!options || typeof options !== "object") { - throw new Error("Invalid options parameter. It requires an object."); - } - if (options.hash === undefined || typeof options.hash !== "string") { - throw new Error("Hash should be specified"); - } - }; - /** - * Verifies password using the argon2 password-hashing function - * @returns True if the encoded hash matches the password - */ - function argon2Verify(options) { - return __awaiter(this, void 0, void 0, function* () { - validateVerifyOptions$1(options); - const params = getHashParameters(options.password, options.hash, options.secret); - validateOptions$3(params); - const hashStart = options.hash.lastIndexOf("$") + 1; - const result = (yield argon2Internal(params)); - return result.substring(hashStart) === options.hash.substring(hashStart); - }); - } - - var name$i = "blake2s"; - var data$i = "AGFzbQEAAAABEQRgAAF/YAJ/fwBgAX8AYAAAAwkIAAECAwICAAEFBAEBAgIGDgJ/AUGgigULfwBBgAgLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAKSGFzaF9GaW5hbAADCUhhc2hfSW5pdAAEC0hhc2hfVXBkYXRlAAUNSGFzaF9HZXRTdGF0ZQAGDkhhc2hfQ2FsY3VsYXRlAAcKU1RBVEVfU0laRQMBCr4yCAUAQYAJC6gFAQZ/AkAgAUEBSA0AAkACQAJAIAFBwABBACgC8IkBIgJrIgNKDQAgASEDDAELQQBBADYC8IkBAkAgAkHAAEYNACACQbCJAWohBAJAAkAgA0EHcSIFDQAgACEGIAMhBwwBCyAFIQcgACEGA0AgBCAGLQAAOgAAIARBAWohBCAGQQFqIQYgB0F/aiIHDQALQcAAIAIgBWprIQcLIAJBR2pBB0kNAANAIAQgBi0AADoAACAEIAYtAAE6AAEgBCAGLQACOgACIAQgBi0AAzoAAyAEIAYtAAQ6AAQgBCAGLQAFOgAFIAQgBi0ABjoABiAEIAYtAAc6AAcgBEEIaiEEIAZBCGohBiAHQXhqIgcNAAsLQQAhBEEAQQAoAqCJASIGQcAAajYCoIkBQQBBACgCpIkBIAZBv39LajYCpIkBQbCJARACIAAgA2ohAAJAIAEgA2siA0HBAEgNACACIAFqIQQDQEE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IQMMAAsLQQAhA0EAQQAoAoCKASIEQefMp9AGczYCgIkBQQBBACgChIoBQYXdntt7czYChIkBQQBBACgCiIoBQfLmu+MDczYCiIkBQQBBACgCjIoBQbrqv6p6czYCjIkBQQBBACgCkIoBQf+kuYgFczYCkIkBQQBBACgClIoBQYzRldh5czYClIkBQQBBACgCmIoBQauzj/wBczYCmIkBQQAgBEH/AXE2AvSJAUEAQQAoApyKAUGZmoPfBXM2ApyJAQJAIABBgIAESQ0AIAFBOGpCADcDACABQTBqQgA3AwAgAUEoakIANwMAIAFBIGpCADcDACABQRhqQgA3AwAgAUEQakIANwMAIAFCADcDCCABQgA3AwBBACEAA0AgASADaiADQYAJai0AADoAACADQQFqIQMgAiAAQQFqIgBB/wFxSw0ACyABQcAAEAELIAFBwABqJAALCQBBgAkgABABCwYAQYCJAQsPACABEARBgAkgABABEAMLCwsBAEGACAsEfAAAAA=="; - var hash$i = "5c0ff166"; - var wasmJson$i = { - name: name$i, - data: data$i, - hash: hash$i - }; - - const mutex$j = new Mutex(); - let wasmCache$j = null; - function validateBits$3(bits) { - if (!Number.isInteger(bits) || bits < 8 || bits > 256 || bits % 8 !== 0) { - return new Error("Invalid variant! Valid values: 8, 16, ..., 256"); - } - return null; - } - function getInitParam(outputBits, keyBits) { - return outputBits | (keyBits << 16); - } - /** - * Calculates BLAKE2s hash - * @param data Input data (string, Buffer or TypedArray) - * @param bits Number of output bits, which has to be a number - * divisible by 8, between 8 and 256. Defaults to 256. - * @param key Optional key (string, Buffer or TypedArray). Maximum length is 32 bytes. - * @returns Computed hash as a hexadecimal string - */ - function blake2s(data, bits = 256, key = null) { - if (validateBits$3(bits)) { - return Promise.reject(validateBits$3(bits)); - } - let keyBuffer = null; - let initParam = bits; - if (key !== null) { - keyBuffer = getUInt8Buffer(key); - if (keyBuffer.length > 32) { - return Promise.reject(new Error("Max key length is 32 bytes")); - } - initParam = getInitParam(bits, keyBuffer.length); - } - const hashLength = bits / 8; - if (wasmCache$j === null || wasmCache$j.hashLength !== hashLength) { - return lockedCreate(mutex$j, wasmJson$i, hashLength).then((wasm) => { - wasmCache$j = wasm; - if (initParam > 512) { - wasmCache$j.writeMemory(keyBuffer); - } - return wasmCache$j.calculate(data, initParam); - }); - } - try { - if (initParam > 512) { - wasmCache$j.writeMemory(keyBuffer); - } - const hash = wasmCache$j.calculate(data, initParam); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } - } - /** - * Creates a new BLAKE2s hash instance - * @param bits Number of output bits, which has to be a number - * divisible by 8, between 8 and 256. Defaults to 256. - * @param key Optional key (string, Buffer or TypedArray). Maximum length is 32 bytes. - */ - function createBLAKE2s(bits = 256, key = null) { - if (validateBits$3(bits)) { - return Promise.reject(validateBits$3(bits)); - } - let keyBuffer = null; - let initParam = bits; - if (key !== null) { - keyBuffer = getUInt8Buffer(key); - if (keyBuffer.length > 32) { - return Promise.reject(new Error("Max key length is 32 bytes")); - } - initParam = getInitParam(bits, keyBuffer.length); - } - const outputSize = bits / 8; - return WASMInterface(wasmJson$i, outputSize).then((wasm) => { - if (initParam > 512) { - wasm.writeMemory(keyBuffer); - } - wasm.init(initParam); - const obj = { - init: initParam > 512 - ? () => { - wasm.writeMemory(keyBuffer); - wasm.init(initParam); - return obj; - } - : () => { - wasm.init(initParam); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 64, - digestSize: outputSize, - }; - return obj; - }); - } - - var name$h = "blake3"; - var data$h = "AGFzbQEAAAABMQdgAAF/YAl/f39+f39/f38AYAZ/f39/fn8AYAF/AGADf39/AGABfgBgBX9/fn9/AX8DDg0AAQIDBAUGAwMDAwAEBQQBAQICBg4CfwFBgJgFC38AQYAICwdwCAZtZW1vcnkCAA5IYXNoX0dldEJ1ZmZlcgAACUhhc2hfSW5pdAAIC0hhc2hfVX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QALCyAALQBoIQQLIAAgBCAGaiIHOgBoIAEgBmohAQJAIAIgBmsiAg0AQQAhAgwCCyADIAAgAEEoakHAACAAKQMgIAAtAGogAEHpAGoiBS0AACIKRXIQAiAAIAMpAyAgAykDAIU3AwAgACADKQMoIAMpAwiFNwMIIAAgAykDMCADKQMQhTcDECAAIAMpAzggAykDGIU3AxggAEEAOgBoIAUgCkEBajoAACAAQeAAakIANwMAIABB2ABqQgA3AwAgAEHQAGpCADcDACAAQcgAakIANwMAIABBwABqQgA3AwAgAEE4akIANwMAIABBMGpCADcDACAAQgA3AygLQQAhByACQcEASQ0AIABB6QBqIgotAAAhBSAALQBqIQsgACkDICEMA0AgAyAAIAFBwAAgDCALIAVB/wFxRXJB/wFxEAIgACADKQMgIAMpAwCFNwMAIAAgAykDKCADKQMIhTcDCCAAIAMpAzAgAykDEIU3AxAgACADKQM4IAMpAxiFNwMYIAogBUEBaiIFOgAAIAFBwABqIQEgAkFAaiICQcAASw0ACwsCQEHAACAHQf8BcSIGayIFIAIgBSACSRsiCUUNACAJQQNxIQtBACEFAkAgCUEESQ0AIAAgBmohByAJQfwAcSEIQQAhBQNAIAcgBWoiAkEoaiABIAVqIgotAAA6AAAgAkEpaiAKQQFqLQAAOgAAIAJBKmogCkECai0AADoAACACQStqIApBA2otAAA6AAAgCCAFQQRqIgVHDQALCwJAIAtFDQAgASAFaiEBIAUgBmogAGpBKGohBQNAIAUgAS0AADoAACABQQFqIQEgBUEBaiEFIAtBf2oiCw0ACwsgAC0AaCEHCyAAIAcgCWo6AGggA0HAAGokAAveAwQFfwN+BX8GfiMAQdABayIBJAACQCAAe6ciAkEALQCQigEiA08NAEEALQCKigFBBHIhBCABQShqIQVBACkDmIkBIQBBACkDkIkBIQZBACkDiIkBIQdBACkDgIkBIQggAyEJA0AgASAANwMYIAEgBjcDECABIAc3AwggASAINwMAIAEgA0EFdCIDQdGJAWoiCikDADcDKCABIANB2YkBaiILKQMANwMwIAEgA0HhiQFqIgwpAwA3AzggASADQemJAWoiDSkDADcDQCABIANB8YkBaikDADcDSCABIANB+YkBaikDADcDUCABIANBgYoBaikDADcDWCADQYmKAWopAwAhDiABQcAAOgBoIAEgDjcDYCABQgA3AyAgASAEOgBpIAEgADcDiAEgASAGNwOAASABIAc3A3ggASAINwNwIAFBkAFqIAFB8ABqIAVBwABCACAEQf8BcRACIAEpA7ABIQ4gASkDkAEhDyABKQO4ASEQIAEpA5gBIREgASkDwAEhEiABKQOgASETIA0gASkDyAEgASkDqAGFNwMAIAwgEiAThTcDACALIBAgEYU3AwAgCiAOIA+FNwMAIAlBf2oiCUH/AXEiAyACSw0AC0EAIAk6AJCKAQsgAUHQAWokAAvHCQIKfwV+IwBB4AJrIgUkAAJAAkAgAUGACEsNACAFIAA2AvwBIAVB/AFqIAFBgAhGIgZBECACQQEgA0EBQQIgBBABIAZBCnQiByABTw0BIAVB4ABqIgZCADcDACAFQdgAaiIIQgA3AwAgBUHQAGoiCUIANwMAIAVByABqIgpCADcDACAFQcAAaiILQgA3AwAgBUE4aiIMQgA3AwAgBUEwaiINQgA3AwAgBSADOgBqIAVCADcDKCAFQQA7AWggBUEAKQOAiQE3AwAgBUEAKQOIiQE3AwggBUEAKQOQiQE3AxAgBUEAKQOYiQE3AxggBSABQYAIRiIOrSACfDcDICAFIAAgB2pBACABIA4bEAQgBUGIAWpBMGogDSkDADcDACAFQYgBakE4aiAMKQMANwMAIAUgBSkDACIPNwOIASAFIAUpAwgiEDcDkAEgBSAFKQMQIhE3A5gBIAUgBSkDGCISNwOgASAFIAUpAyg3A7ABIAUtAGohACAFLQBpIQcgBSkDICECIAUtAGghASAFQYgBakHAAGogCykDADcDACAFQYgBakHIAGogCikDADcDACAFQYgBakHQAGogCSkDADcDACAFQYgBakHYAGogCCkDADcDACAFQYgBakHgAGogBikDADcDACAFIAE6APABIAUgAjcDqAEgBSAAIAdFckECciIAOgDxASAFIBI3A5gCIAUgETcDkAIgBSAQNwOIAiAFIA83A4ACIAVBoAJqIAVBgA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QQAtAIiKASEJIAFBwABqQQApA+CJATcDACABQcgAakEAKQPoiQE3AwAgAUHQAGpBACkD8IkBNwMAIAFB2ABqQQApA/iJATcDACABQeAAakEAKQOAigE3AwAgASAJOgBoIAEgCDcDICABIAIgB0VyIgJBAnI6AGkgAUEoaiEKQgAhCEGACSELIAJBCnJB/wFxIQwDQCABQbABaiABIAogCUH/AXEgCCAMEAIgASABKQPQASINIAEpA7ABhTcDcCABIAEpA9gBIg4gASkDuAGFNwN4IAEgASkD4AEiDyABKQPAAYU3A4ABIAEgASkD6AEiECAGhTcDqAEgASAPIAWFNwOgASABIA4gBIU3A5gBIAEgDSADhTcDkAEgASAQIAEpA8gBhTcDiAEgAEHAACAAQcAASRsiEUF/aiESAkACQCARQQdxIhMNACABQfAAaiECIAshByARIRQMAQsgEUH4AHEhFCABQfAAaiECIAshBwNAIAcgAi0AADoAACAHQQFqIQcgAkEBaiECIBNBf2oiEw0ACwsCQCASQQdJDQADQCAHIAIpAAA3AAAgB0EIaiEHIAJBCGohAiAUQXhqIhQNAAsLIAhCAXwhCCALIBFqIQsgACARayIADQAMAgsLAkACQAJAQQAtAImKASIHQQZ0QQBBAC0AiIoBIhFrRg0AIAEgEToAaCABQQApA4CKATcDYCABQQApA/iJATcDWCABQQApA/CJATcDUCABQQApA+iJATcDSCABQQApA+CJATcDQCABQQApA9iJATcDOCABQQApA9CJATcDMCABQQApA8iJATcDKCABQQApA8CJASIINwMgIAFBACkDuIkBIgM3AxggAUEAKQOwiQEiBDcDECABQQApA6iJASIFNwMIIAFBACkDoIkBIgY3AwAgAUEALQCKigEiEyAHRXJBAnIiCzoAaSATQQRyIRNBACkDmIkBIQ1BACkDkIkBIQ5BACkDiIkBIQ9BACkDgIkBIRAMAQtBwAAhESABQcAAOgBoQgAhCCABQgA3AyAgAUEAKQOYiQEiDTcDGCABQQApA5CJASIONwMQIAFBACkDiIkBIg83AwggAUEAKQOAiQEiEDcDACABQQAtAIqKAUEEciITOgBpIAEgAkF+aiICQQV0IgdByYoBaikDADcDYCABIAdBwYoBaikDADcDWCABIAdBuYoBaikDADcDUCABIAdBsYoBaikDADcDSCABIAdBqYoBaikDADcDQCABIAdBoYoBaikDADcDOCABIAdBmYoBaikDADcDMCABIAdBkYoBaikDADcDKCATIQsgECEGIA8hBSAOIQQgDSEDIAJFDQELIAJBf2oiB0EFdCIUQZGKAWopAwAhFSAUQZmKAWopAwAhFiAUQaGKAWopAwAhFyAUQamKAWopAwAhGCABIAM3A4gBIAEgBDcDgAEgASAFNwN4IAEgBjcDcCABQbABaiABQfAAaiABQShqIhQgESAIIAtB/wFxEAIgASATOgBpIAFBwAA6AGggASAYNwNAIAEgFzcDOCABIBY3AzAgASAVNwMoIAFCADcDICABIA03AxggASAONwMQIAEgDzcDCCABIBA3AwAgASABKQPoASABKQPIAYU3A2AgASABKQPgASABKQPAAYU3A1ggASABKQPYASABKQO4AYU3A1AgASABKQPQASABKQOwAYU3A0ggB0UNACACQQV0QemJAWohAiATQf8BcSERA0AgAkFoaikDACEIIAJBcGopAwAhAyACQXhqKQMAIQQgAikDACEFIAEgDTcDiAEgASAONwOAASABIA83A3ggASAQNwNwIAFBsAFqIAFB8ABqIBRBwABCACAREAIgASATOgBpIAFBwAA6AGggASAFNwNAIAEgBDcDOCABIAM3AzAgASAINwMoIAFCADcDICABIA03AxggASAONwMQIAEgDzcDCCABIBA3AwAgASABKQPoASABKQPIAYU3A2AgASABKQPgASABKQPAAYU3A1ggASABKQPYASABKQO4AYU3A1AgASABKQPQASABKQOwAYU3A0ggAkFgaiECIAdBf2oiBw0ACwsgAUEoaiEJQgAhCEGACSELIBNBCHJB/wFxIQoDQCABQbABaiABIAlBwAAgCCAKEAIgASABKQPQASIDIAEpA7ABhTcDcCABIAEpA9gBIgQgASkDuAGFNwN4IAEgASkD4AEiBSABKQPAAYU3A4ABIAEgDSABKQPoASIGhTcDqAEgASAOIAWFNwOgASABIA8gBIU3A5gBIAEgECADhTcDkAEgASAGIAEpA8gBhTcDiAE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d875f"; - var wasmJson$h = { - name: name$h, - data: data$h, - hash: hash$h - }; - - const mutex$i = new Mutex(); - let wasmCache$i = null; - function validateBits$2(bits) { - if (!Number.isInteger(bits) || bits < 8 || bits % 8 !== 0) { - return new Error("Invalid variant! Valid values: 8, 16, ..."); - } - return null; - } - /** - * Calculates BLAKE3 hash - * @param data Input data (string, Buffer or TypedArray) - * @param bits Number of output bits, which has to be a number - * divisible by 8. Defaults to 256. - * @param key Optional key (string, Buffer or TypedArray). Length should be 32 bytes. - * @returns Computed hash as a hexadecimal string - */ - function blake3(data, bits = 256, key = null) { - if (validateBits$2(bits)) { - return Promise.reject(validateBits$2(bits)); - } - let keyBuffer = null; - let initParam = 0; // key is empty by default - if (key !== null) { - keyBuffer = getUInt8Buffer(key); - if (keyBuffer.length !== 32) { - return Promise.reject(new Error("Key length must be exactly 32 bytes")); - } - initParam = 32; - } - const hashLength = bits / 8; - const digestParam = hashLength; - if (wasmCache$i === null || wasmCache$i.hashLength !== hashLength) { - return lockedCreate(mutex$i, wasmJson$h, hashLength).then((wasm) => { - wasmCache$i = wasm; - if (initParam === 32) { - wasmCache$i.writeMemory(keyBuffer); - } - return wasmCache$i.calculate(data, initParam, digestParam); - }); - } - try { - if (initParam === 32) { - wasmCache$i.writeMemory(keyBuffer); - } - const hash = wasmCache$i.calculate(data, initParam, digestParam); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } - } - /** - * Creates a new BLAKE3 hash instance - * @param bits Number of output bits, which has to be a number - * divisible by 8. Defaults to 256. - * @param key Optional key (string, Buffer or TypedArray). Length should be 32 bytes. - */ - function createBLAKE3(bits = 256, key = null) { - if (validateBits$2(bits)) { - return Promise.reject(validateBits$2(bits)); - } - let keyBuffer = null; - let initParam = 0; // key is empty by default - if (key !== null) { - keyBuffer = getUInt8Buffer(key); - if (keyBuffer.length !== 32) { - return Promise.reject(new Error("Key length must be exactly 32 bytes")); - } - initParam = 32; - } - const outputSize = bits / 8; - const digestParam = outputSize; - return WASMInterface(wasmJson$h, outputSize).then((wasm) => { - if (initParam === 32) { - wasm.writeMemory(keyBuffer); - } - wasm.init(initParam); - const obj = { - init: initParam === 32 - ? () => { - wasm.writeMemory(keyBuffer); - wasm.init(initParam); - return obj; - } - : () => { - wasm.init(initParam); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType, digestParam), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 64, - digestSize: outputSize, - }; - return obj; - }); - } - - var name$g = "crc32"; - var data$g = "AGFzbQEAAAABEQRgAAF/YAF/AGAAAGACf38AAwgHAAEBAQIAAwUEAQECAgYOAn8BQZDJBQt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQAAgtIYXNoX1VwZGF0ZQADCkhhc2hfRmluYWwABA1IYXNoX0dldFN0YXRlAAUOSGFzaF9DYWxjdWxhdGUABgpTVEFURV9TSVpFAwEKkggHBQBBgAkLwwMBA39BgIkBIQFBACECA0AgAUEAQQBBAEEAQQBBAEEAQQAgAkEBcWsgAHEgAkEBdnMiA0EBcWsgAHEgA0EBdnMiA0EBcWsgAHEgA0EBdnMiA0EBcWsgAHEgA0EBdnMiA0EBcWsgAHEgA0EBdnMiA0EBcWsgAHEgA0EBdnMiA0EBcWsgAHEgA0EBdnMiA0EBcWsgAHEgA0EBdnM2AgAgAUEEaiEBIAJBAWoiAkGAAkcNAAtBACEAA0AgAEGEkQFqIABBhIkBaigCACICQf8BcUECdEGAiQFqKAIAIAJBCHZzIgI2AgAgAEGEmQFqIAJB/wFxQQJ0QYCJAWooAgAgAkEIdnMiAjYCACAAQYShAWogAkH/AXFBAnRBgIkBaigCACACQQh2cyICNgIAIABBhKkBaiACQf8BcUECdEGAiQFqKAIAIAJBCHZzIgI2AgAgAEGEsQFqIAJB/wFxQQJ0QYCJAWooAgAgAkEIdnMiAjYCACAAQYS5AWogAkH/AXFBAnRBgIkBaigCACACQQh2cyICNgIAIABBhMEBaiACQf8BcUECdEGAiQFqKAIAIAJBCHZzNgIAIABBBGoiAEH8B0cNAAsLJwACQEEAKAKAyQEgAEYNACAAEAFBACAANgKAyQELQQBBADYChMkBC4gDAQN/QQAoAoTJAUF/cyEBQYAJIQICQCAAQQhJDQBBgAkhAgNAIAJBBGooAgAiA0EOdkH8B3FBgJEBaigCACADQRZ2QfwHcUGAiQFqKAIAcyADQQZ2QfwHcUGAmQFqKAIAcyADQf8BcUECdEGAoQFqKAIAcyACKAIAIAFzIgFBFnZB/AdxQYCpAWooAgBzIAFBDnZB/AdxQYCxAWooAgBzIAFBBnZB/AdxQYC5AWooAgBzIAFB/wFxQQJ0QYDBAWooAgBzIQEgAkEIaiECIABBeGoiAEEHSw0ACwsCQCAARQ0AAkACQCAAQQFxDQAgACEDDAELIAFB/wFxIAItAABzQQJ0QYCJAWooAgAgAUEIdnMhASACQQFqIQIgAEF/aiEDCyAAQQFGDQADQCABQf8BcSACLQAAc0ECdEGAiQFqKAIAIAFBCHZzIgFB/wFxIAJBAWotAABzQQJ0QYCJAWooAgAgAUEIdnMhASACQQJqIQIgA0F+aiIDDQALC0EAIAFBf3M2AoTJAQsyAQF/QQBBACgChMkBIgBBGHQgAEGA/gNxQQh0ciAAQQh2QYD+A3EgAEEYdnJyNgKACQsGAEGEyQELWQACQEEAKAKAyQEgAUYNACABEAFBACABNgKAyQELQQBBADYChMkBIAAQA0EAQQAoAoTJASIBQRh0IAFBgP4DcUEIdHIgAUEIdkGA/gNxIAFBGHZycjYCgAkLCwsBAEGACAsEBAAAAA=="; - var hash$g = "d2eba587"; - var wasmJson$g = { - name: name$g, - data: data$g, - hash: hash$g - }; - - const mutex$h = new Mutex(); - let wasmCache$h = null; - function validatePoly(poly) { - if (!Number.isInteger(poly) || poly < 0 || poly > 0xffffffff) { - return new Error("Polynomial must be a valid 32-bit long unsigned integer"); - } - return null; - } - /** - * Calculates CRC-32 hash - * @param data Input data (string, Buffer or TypedArray) - * @param polynomial Input polynomial (defaults to 0xedb88320, for CRC32C use 0x82f63b78) - * @returns Computed hash as a hexadecimal string - */ - function crc32(data, polynomial = 0xedb88320) { - if (validatePoly(polynomial)) { - return Promise.reject(validatePoly(polynomial)); - } - if (wasmCache$h === null) { - return lockedCreate(mutex$h, wasmJson$g, 4).then((wasm) => { - wasmCache$h = wasm; - return wasmCache$h.calculate(data, polynomial); - }); - } - try { - const hash = wasmCache$h.calculate(data, polynomial); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } - } - /** - * Creates a new CRC-32 hash instance - * @param polynomial Input polynomial (defaults to 0xedb88320, for CRC32C use 0x82f63b78) - */ - function createCRC32(polynomial = 0xedb88320) { - if (validatePoly(polynomial)) { - return Promise.reject(validatePoly(polynomial)); - } - return WASMInterface(wasmJson$g, 4).then((wasm) => { - wasm.init(polynomial); - const obj = { - init: () => { - wasm.init(polynomial); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 4, - digestSize: 4, - }; - return obj; - }); - } - - var name$f = "crc64"; - var data$f = "AGFzbQEAAAABDANgAAF/YAAAYAF/AAMHBgABAgEAAQUEAQECAgYOAn8BQZCJBgt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQAAQtIYXNoX1VwZGF0ZQACCkhhc2hfRmluYWwAAw1IYXNoX0dldFN0YXRlAAQOSGFzaF9DYWxjdWxhdGUABQpTVEFURV9TSVpFAwEKgwgGBQBBgAkL9QMDAX4BfwJ+AkBBACkDgIkCQQApA4AJIgBRDQBBgIkBIQFCACECA0AgAUIAQgBCAEIAQgBCAEIAQgAgAkIBg30gAIMgAkIBiIUiA0IBg30gAIMgA0IBiIUiA0I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ApA4iJAiIAQjiGIABCgP4Dg0IohoQgAEKAgPwHg0IYhiAAQoCAgPgPg0IIhoSEIABCCIhCgICA+A+DIABCGIhCgID8B4OEIABCKIhCgP4DgyAAQjiIhISENwOACQsGAEGIiQILAgALCwsBAEGACAsECAAAAA=="; - var hash$f = "c5ac6c16"; - var wasmJson$f = { - name: name$f, - data: data$f, - hash: hash$f - }; - - const mutex$g = new Mutex(); - let wasmCache$g = null; - const polyBuffer = new Uint8Array(8); - function parsePoly(poly) { - const errText = "Polynomial must be provided as a 16 char long hex string"; - if (typeof poly !== "string" || poly.length !== 16) { - return { hi: 0, lo: 0, err: new Error(errText) }; - } - const hi = Number(`0x${poly.slice(0, 8)}`); - const lo = Number(`0x${poly.slice(8)}`); - if (Number.isNaN(hi) || Number.isNaN(lo)) { - return { hi, lo, err: new Error(errText) }; - } - return { hi, lo, err: null }; - } - function writePoly(arr, lo, hi) { - // write in little-endian format - const buffer = new DataView(arr); - buffer.setUint32(0, lo, true); - buffer.setUint32(4, hi, true); - } - /** - * Calculates CRC-64 hash - * @param data Input data (string, Buffer or TypedArray) - * @param polynomial Input polynomial (defaults to 'c96c5795d7870f42' - ECMA) - * @returns Computed hash as a hexadecimal string - */ - function crc64(data, polynomial = "c96c5795d7870f42") { - const { hi, lo, err } = parsePoly(polynomial); - if (err !== null) { - return Promise.reject(err); - } - if (wasmCache$g === null) { - return lockedCreate(mutex$g, wasmJson$f, 8).then((wasm) => { - wasmCache$g = wasm; - writePoly(polyBuffer.buffer, lo, hi); - wasmCache$g.writeMemory(polyBuffer); - return wasmCache$g.calculate(data); - }); - } - try { - writePoly(polyBuffer.buffer, lo, hi); - wasmCache$g.writeMemory(polyBuffer); - const hash = wasmCache$g.calculate(data); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } - } - /** - * Creates a new CRC-64 hash instance - * @param polynomial Input polynomial (defaults to 'c96c5795d7870f42' - ECMA) - */ - function createCRC64(polynomial = "c96c5795d7870f42") { - const { hi, lo, err } = parsePoly(polynomial); - if (err !== null) { - return Promise.reject(err); - } - return WASMInterface(wasmJson$f, 8).then((wasm) => { - const instanceBuffer = new Uint8Array(8); - writePoly(instanceBuffer.buffer, lo, hi); - wasm.writeMemory(instanceBuffer); - wasm.init(); - const obj = { - init: () => { - wasm.writeMemory(instanceBuffer); - wasm.init(); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 8, - digestSize: 8, - }; - return obj; - }); - } - - var name$e = "md4"; - var data$e = "AGFzbQEAAAABEgRgAAF/YAAAYAF/AGACf38BfwMIBwABAgMBAAIFBAEBAgIGDgJ/AUGgigULfwBBgAgLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAJSGFzaF9Jbml0AAELSGFzaF9VcGRhdGUAAgpIYXNoX0ZpbmFsAAQNSGFzaF9HZXRTdGF0ZQAFDkhhc2hfQ2FsY3VsYXRlAAYKU1RBVEVfU0laRQMBCucUBwUAQYAJCy0AQQBC/rnrxemOlZkQNwKQiQFBAEKBxpS6lvHq5m83AoiJAUEAQgA3AoCJAQu+BQEHf0EAQQAoAoCJASIBIABqQf////8BcSICNgKAiQFBAEEAKAKEiQEgAiABSWogAEEddmo2AoSJAQJAAkACQAJAAkACQCABQT9xIgMNAEGACSEEDAELIABBwAAgA2siBUkNASAFQQNxIQZBACEBAkAgA0E/c0EDSQ0AIANBgIkBaiEEIAVB/ABxIQdBACEBA0AgBCABaiICQRhqIAFBgAlqLQAAOgAAIAJBGWogAUGBCWotAAA6AAAgAkEaaiABQYIJai0AADoAACACQRtqIAFBgwlqLQAAOgAAIAcgAUEEaiIBRw0ACwsCQCAGRQ0AIANBmIkBaiECA0AgAiABaiABQYAJai0AADoAACABQQFqIQEgBkF/aiIGDQALC0GYiQFBwAAQAxogACAFayEAIAVBgAlqIQ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DIAkgEWogEiAVcyATc2pBodfn9gZqQQ93IARqIQQgEiACaiECIBUgBWohBSAAQcAAaiEAIAFBQGoiAQ0AC0EAIAI2ApSJAUEAIAM2ApCJAUEAIAQ2AoyJAUEAIAU2AoiJASAAC8gDAQV/QQAoAoCJAUE/cSIAQZiJAWpBgAE6AAAgAEEBaiEBAkACQAJAAkAgAEE/cyICQQdLDQAgAkUNASABQZiJAWpBADoAACACQQFGDQEgAEGaiQFqQQA6AAAgAkECRg0BIABBm4kBakEAOgAAIAJBA0YNASAAQZyJAWpBADoAACACQQRGDQEgAEGdiQFqQQA6AAAgAkEFRg0BIABBnokBakEAOgAAIAJBBkYNASAAQZ+JAWpBADoAAAwBCyACQQhGDQJBNiAAayIDIQQCQCACQQNxIgBFDQBBACAAayEEQQAhAANAIABBz4kBakEAOgAAIAQgAEF/aiIARw0ACyADIABqIQQLIANBA0kNAgwBC0GYiQFBwAAQAxpBACEBQTchBAsgAUGAiQFqIQBBfyECA0AgACAEakEVakEANgAAIABBfGohACAEIAJBBGoiAkcNAAsLQQBBACgChIkBNgLUiQFBAEEAKAKAiQEiAEEVdjoA04kBQQAgAEENdjoA0okBQQAgAEEFdjoA0YkBQQAgAEEDdCIAOgDQiQFBACAANgKAiQFBmIkBQcAAEAMaQQBBACkCiIkBNwOACUEAQQApApCJATcDiAkLBgBBgIkBCzMAQQBC/rnrxemOlZkQNwKQiQFBAEKBxpS6lvHq5m83AoiJAUEAQgA3AoCJASAAEAIQBAsLCwEAQYAICwSYAAAA"; - var hash$e = "bd8ce7c7"; - var wasmJson$e = { - name: name$e, - data: data$e, - hash: hash$e - }; - - const mutex$f = new Mutex(); - let wasmCache$f = null; - /** - * Calculates MD4 hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ - function md4(data) { - if (wasmCache$f === null) { - return lockedCreate(mutex$f, wasmJson$e, 16).then((wasm) => { - wasmCache$f = wasm; - return wasmCache$f.calculate(data); - }); - } - try { - const hash = wasmCache$f.calculate(data); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } - } - /** - * Creates a new MD4 hash instance - */ - function createMD4() { - return WASMInterface(wasmJson$e, 16).then((wasm) => { - wasm.init(); - const obj = { - init: () => { - wasm.init(); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 64, - digestSize: 16, - }; - return obj; - }); - } - - var name$d = "md5"; - var data$d = "AGFzbQEAAAABEgRgAAF/YAAAYAF/AGACf38BfwMIBwABAgMBAAIFBAEBAgIGDgJ/AUGgigULfwBBgAgLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAJSGFzaF9Jbml0AAELSGFzaF9VcGRhdGUAAgpIYXNoX0ZpbmFsAAQNSGFzaF9HZXRTdGF0ZQAFDkhhc2hfQ2FsY3VsYXRlAAYKU1RBVEVfU0laRQMBCoMaBwUAQYAJCy0AQQBC/rnrxemOlZkQNwKQiQFBAEKBxpS6lvHq5m83AoiJAUEAQgA3AoCJAQu+BQEHf0EAQQAoAoCJASIBIABqQf////8BcSICNgKAiQFBAEEAKAKEiQEgAiABSWogAEEddmo2AoSJAQJAAkACQAJAAkACQCABQT9xIgMNAEGACSEEDAELIABBwAAgA2siBUkNASAFQQNxIQZBACEBAkAgA0E/c0EDSQ0AIANBgIkBaiEEIAVB/ABxIQdBACEBA0AgBCABaiICQRhqIAFBgAlqLQAAOgAAIAJBGWogAUGBCWotAAA6AAAgAkEaaiABQYIJai0AADoAACACQRtqIAFBgwlqLQAAOgAAIAcgAUEEaiIBRw0ACwsCQCAGRQ0AIANBmIkBaiECA0AgAiABaiABQYAJai0AADoAACABQQFqIQEgBkF/aiIGDQALC0GYiQFBwAAQAxogACAFayEAIAVBgAlqIQQLIABBwABPDQEgACECDAILIABFDQIgAEEDcSEGQQAhAQJAI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JBAUYNASAAQZqJAWpBADoAACACQQJGDQEgAEGbiQFqQQA6AAAgAkEDRg0BIABBnIkBakEAOgAAIAJBBEYNASAAQZ2JAWpBADoAACACQQVGDQEgAEGeiQFqQQA6AAAgAkEGRg0BIABBn4kBakEAOgAADAELIAJBCEYNAkE2IABrIgMhBAJAIAJBA3EiAEUNAEEAIABrIQRBACEAA0AgAEHPiQFqQQA6AAAgBCAAQX9qIgBHDQALIAMgAGohBAsgA0EDSQ0CDAELQZiJAUHAABADGkEAIQFBNyEECyABQYCJAWohAEF/IQIDQCAAIARqQRVqQQA2AAAgAEF8aiEAIAQgAkEEaiICRw0ACwtBAEEAKAKEiQE2AtSJAUEAQQAoAoCJASIAQRV2OgDTiQFBACAAQQ12OgDSiQFBACAAQQV2OgDRiQFBACAAQQN0IgA6ANCJAUEAIAA2AoCJAUGYiQFBwAAQAxpBAEEAKQKIiQE3A4AJQQBBACkCkIkBNwOICQsGAEGAiQELMwBBAEL+uevF6Y6VmRA3ApCJAUEAQoHGlLqW8ermbzcCiIkBQQBCADcCgIkBIAAQAhAECwsLAQBBgAgLBJgAAAA="; - var hash$d = "e6508e4b"; - var wasmJson$d = { - name: name$d, - data: data$d, - hash: hash$d - }; - - const mutex$e = new Mutex(); - let wasmCache$e = null; - /** - * Calculates MD5 hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ - function md5(data) { - if (wasmCache$e === null) { - return lockedCreate(mutex$e, wasmJson$d, 16).then((wasm) => { - wasmCache$e = wasm; - return wasmCache$e.calculate(data); - }); - } - try { - const hash = wasmCache$e.calculate(data); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } - } - /** - * Creates a new MD5 hash instance - */ - function createMD5() { - return WASMInterface(wasmJson$d, 16).then((wasm) => { - wasm.init(); - const obj = { - init: () => { - wasm.init(); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 64, - digestSize: 16, - }; - return obj; - }); - } - - var name$c = "sha1"; - var data$c = "AGFzbQEAAAABEQRgAAF/YAF/AGAAAGACf38AAwkIAAECAwECAAEFBAEBAgIGDgJ/AUHgiQULfwBBgAgLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAJSGFzaF9Jbml0AAILSGFzaF9VcGRhdGUABApIYXNoX0ZpbmFsAAUNSGFzaF9HZXRTdGF0ZQAGDkhhc2hfQ2FsY3VsYXRlAAcKU1RBVEVfU0laRQMBCpoqCAUAQYAJC68iCgF+An8BfgF/AX4DfwF+AX8Bfkd/QQAgACkDECIBQiCIpyICQRh0IAJBgP4DcUEIdHIgAUIoiKdBgP4DcSABQjiIp3JyIgMgACkDCCIEQiCIpyICQRh0IAJBgP4DcUEIdHIgBEIoiKdBgP4DcSAEQjiIp3JyIgVzIAApAygiBkIgiKciAkEYdCACQYD+A3FBCHRyIAZCKIinQYD+A3EgBkI4iKdyciIHcyAEpyICQRh0IAJBgP4DcUEIdHIgAkEIdkGA/gNxIAJBGHZyciIIIAApAwAiBKciAkEYdCACQYD+A3FBCHRyIAJBCHZBgP4DcSACQRh2cnIiCXMgACkDICIKpyICQRh0IAJBgP4DcUEIdHIgAkEIdkGA/gNxIAJBGHZyciILcyAAKQMwIgxCIIinIgJBGHQgAkGA/gNxQQh0ciAMQiiIp0GA/gNxIAxCOIincnIiAnNBAXciDXNBAXciDiAFIARCIIinIg9BGHQgD0GA/gNxQQh0ciAEQiiIp0GA/gNxIARCOIincnIiEHMgCkIgiKciD0EYdCAPQYD+A3FBCHRyIApCKIinQYD+A3EgCkI4iKdyciIRcyAAKQM4IgSnIg9BGHQgD0GA/gNxQQh0ciAPQQh2QYD+A3EgD0EYdnJyIg9zQQF3IhJzIAcgEXMgEnMgCyAAKQMYIgqnIgBBGHQgAEGA/gNxQQh0ciAAQQh2QYD+A3Eg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ACADaiEEIAMgBWpBnIkBaiEDA0AgAyAELQAAOgAAIARBAWohBCADQQFqIQMgBkF/aiIGDQALC0GciQEQASAFQf8AcyEDQQAhBSADIAFPDQADQCAAIAJqEAEgAkH/AGohAyACQcAAaiIEIQIgAyABSQ0ACyAEIQILAkAgASACRg0AIAEgAmshCSAAIAJqIQIgBUGciQFqIQNBACEEA0AgAyACLQAAOgAAIAJBAWohAiADQQFqIQMgCSAEQQFqIgRB/wFxSw0ACwsLCQBBgAkgABADC6YDAQJ/IwBBEGsiACQAIABBgAE6AAcgAEEAKAKYiQEiAUEYdCABQYD+A3FBCHRyIAFBCHZBgP4DcSABQRh2cnI2AAggAEEAKAKUiQEiAUEYdCABQYD+A3FBCHRyIAFBCHZBgP4DcSABQRh2cnI2AAwgAEEHakEBEAMCQEEAKAKUiQFB+ANxQcADRg0AA0AgAEEAOgAHIABBB2pBARADQQAoApSJAUH4A3FBwANHDQALCyAAQQhqQQgQA0EAQQAoAoCJASIBQRh0IAFBgP4DcUEIdHIgAUEIdkGA/gNxIAFBGHZycjYCgAlBAEEAKAKEiQEiAUEYdCABQYD+A3FBCHRyIAFBCHZBgP4DcSABQRh2cnI2AoQJQQBBACgCiIkBIgFBGHQgAUGA/gNxQQh0ciABQQh2QYD+A3EgAUEYdnJyNgKICUEAQQAoAoyJASIBQRh0IAFBgP4DcUEIdHIgAUEIdkGA/gNxIAFBGHZycjYCjAlBAEEAKAKQiQEiAUEYdCABQYD+A3FBCHRyIAFBCHZBgP4DcSABQRh2cnI2ApAJIABBEGokAAsGAEGAiQELQwBBAEL+uevF6Y6VmRA3AoiJAUEAQoHGlLqW8ermbzcCgIkBQQBC8MPLngw3ApCJAUEAQQA2ApiJAUGACSAAEAMQBQsLCwEAQYAICwRcAAAA"; - var hash$c = "6b530c24"; - var wasmJson$c = { - name: name$c, - data: data$c, - hash: hash$c - }; - - const mutex$d = new Mutex(); - let wasmCache$d = null; - /** - * Calculates SHA-1 hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ - function sha1(data) { - if (wasmCache$d === null) { - return lockedCreate(mutex$d, wasmJson$c, 20).then((wasm) => { - wasmCache$d = wasm; - return wasmCache$d.calculate(data); - }); - } - try { - const hash = wasmCache$d.calculate(data); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } - } - /** - * Creates a new SHA-1 hash instance - */ - function createSHA1() { - return WASMInterface(wasmJson$c, 20).then((wasm) => { - wasm.init(); - const obj = { - init: () => { - wasm.init(); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 64, - digestSize: 20, - }; - return obj; - }); - } - - var name$b = "sha3"; - var data$b = "AGFzbQEAAAABFARgAAF/YAF/AGACf38AYAN/f38AAwgHAAEBAgEAAwUEAQECAgYOAn8BQZCNBQt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQAAQtIYXNoX1VwZGF0ZQACCkhhc2hfRmluYWwABA1IYXNoX0dldFN0YXRlAAUOSGFzaF9DYWxjdWxhdGUABgpTVEFURV9TSVpFAwEKpBwHBQBBgAoL1wMAQQBCADcDgI0BQQBCADcD+IwBQQBCADcD8IwBQQBCADcD6IwBQQBCADcD4IwBQQBCADcD2IwBQQBCADcD0IwBQQBCADcDyIwBQQBCADcDwIwBQQBCADcDuIwBQQBCADcDsIwBQQBCADcDqIwBQQBCADcDoIwBQQBCADcDmIwBQQBCADcDkIwBQQBCADcDiIwBQQBCADcDgIwBQQBCADcD+IsBQQBCADcD8IsBQQBCADcD6IsBQQBCADcD4IsBQQBCADcD2IsBQQBCADcD0IsBQQBCADcDyIsBQQBCADcDwIsBQQBCADcDuIsBQQBCADcDsIsBQQBCADcDqIsBQQBCADcDoIsBQQBCADcDmIsBQQBCADcDkIsBQQBCADcDiIsBQQBCADcDgIsBQQBCADcD+IoBQQBCADcD8IoBQQBCADcD6IoBQQBCADcD4IoBQQBCADcD2IoBQQBCADcD0IoBQQBCADcDyIoBQQBCADcDwIoBQQBCADcDuIoBQQBCADcDsIoBQQBCADcDqIoBQQBCADcDoIoBQQBCADcDmIoBQQBCADcDkIoBQQBCADcDiIoBQQBCADcDgIoBQQBBwAwgAEEBdGtBA3Y2AoyNAUEAQQA2AoiNAQuMAwEIfwJAQQAoAoiNASIBQQBIDQBBACABIABqQQAoAoyNASICcDYCiI0BAkACQCABDQBBgAohAwwBCwJAIAIgAWsiBCAAIAQgAEkbIgNFDQAgA0EDcSEFQQAhBgJAIANBBEkNACABQYCKAWohByADQXxxIQhBACEGA0AgByAGaiIDQcgBaiAGQYAKai0AADoAACADQckBaiAGQYEKai0AADoAACADQcoBaiAGQYIKai0AADoAACADQcsBaiAGQYMKai0AADoAACAIIAZBBGoiBkcNAAsLIAVFDQAgAUHIiwFqIQMDQCADIAZqIAZBgApqLQAAOgAAIAZBAWohBiAFQX9qIgUNAAsLIAAgBEkNAUHIiwEgAhADIAAgBGshACAEQYAKaiEDCwJAIAAgAkkNAANAIAMgAhADIAMgAmohAyAAIAJrIgAgAk8NAAsLIABFDQBBACECQcgBIQYDQCAGQYCKAWogAyAGakG4fmotAAA6AAAgBkEBaiEGIAAgAkEBaiICQf8BcUsNAAsLC+ALAS1+IAApA0AhAkEAKQPAigEhAyAAKQM4IQRBACkDuIoBIQUgACkDMCEGQQApA7CKASEHIAApAyghCEEAKQOoigEhCSAAKQMgIQpBACkDoIoBIQsgACkDGCEMQQApA5iKASENIAApAxAhDkEAKQOQigEhDyAAKQMIIRBBACkDiIoBIREgACkDACESQQApA4CKASETQQApA8iKASEUAkACQCABQcgASw0AQQApA+iKASEVQQApA/iKASEWQQApA/CKASEXQQApA4CLASEYQQApA9CKASEZQQApA+CKASEaQQApA9iKASEbDAELQQApA+CKASAAKQNghSEaQQApA9iKASAAKQNYhSEbQQAp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NACAFQQJ0IQAgBEECdCEBA0AgAUGACmogAUGAigFqKAIANgIAIAFBBGohASAAQXxqIgANAAsLCwvYAQEAQYAIC9ABkAEAAAAAAAAAAAAAAAAAAAEAAAAAAAAAgoAAAAAAAACKgAAAAAAAgACAAIAAAACAi4AAAAAAAAABAACAAAAAAIGAAIAAAACACYAAAAAAAICKAAAAAAAAAIgAAAAAAAAACYAAgAAAAAAKAACAAAAAAIuAAIAAAAAAiwAAAAAAAICJgAAAAAAAgAOAAAAAAACAAoAAAAAAAICAAAAAAAAAgAqAAAAAAAAACgAAgAAAAICBgACAAAAAgICAAAAAAACAAQAAgAAAAAAIgACAAAAAgA=="; - var hash$b = "fb24e536"; - var wasmJson$b = { - name: name$b, - data: data$b, - hash: hash$b - }; - - const mutex$c = new Mutex(); - let wasmCache$c = null; - function validateBits$1(bits) { - if (![224, 256, 384, 512].includes(bits)) { - return new Error("Invalid variant! Valid values: 224, 256, 384, 512"); - } - return null; - } - /** - * Calculates SHA-3 hash - * @param data Input data (string, Buffer or TypedArray) - * @param bits Number of output bits. Valid values: 224, 256, 384, 512 - * @returns Computed hash as a hexadecimal string - */ - function sha3(data, bits = 512) { - if (validateBits$1(bits)) { - return Promise.reject(validateBits$1(bits)); - } - const hashLength = bits / 8; - if (wasmCache$c === null || wasmCache$c.hashLength !== hashLength) { - return lockedCreate(mutex$c, wasmJson$b, hashLength).then((wasm) => { - wasmCache$c = wasm; - return wasmCache$c.calculate(data, bits, 0x06); - }); - } - try { - const hash = wasmCache$c.calculate(data, bits, 0x06); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } - } - /** - * Creates a new SHA-3 hash instance - * @param bits Number of output bits. Valid values: 224, 256, 384, 512 - */ - function createSHA3(bits = 512) { - if (validateBits$1(bits)) { - return Promise.reject(validateBits$1(bits)); - } - const outputSize = bits / 8; - return WASMInterface(wasmJson$b, outputSize).then((wasm) => { - wasm.init(bits); - const obj = { - init: () => { - wasm.init(bits); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType, 0x06), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 200 - 2 * outputSize, - digestSize: outputSize, - }; - return obj; - }); - } - - const mutex$b = new Mutex(); - let wasmCache$b = null; - function validateBits(bits) { - if (![224, 256, 384, 512].includes(bits)) { - return new Error("Invalid variant! Valid values: 224, 256, 384, 512"); - } - return null; - } - /** - * Calculates Keccak hash - * @param data Input data (string, Buffer or TypedArray) - * @param bits Number of output bits. Valid values: 224, 256, 384, 512 - * @returns Computed hash as a hexadecimal string - */ - function keccak(data, bits = 512) { - if (validateBits(bits)) { - return Promise.reject(validateBits(bits)); - } - const hashLength = bits / 8; - if (wasmCache$b === null || wasmCache$b.hashLength !== hashLength) { - return lockedCreate(mutex$b, wasmJson$b, hashLength).then((wasm) => { - wasmCache$b = wasm; - return wasmCache$b.calculate(data, bits, 0x01); - }); - } - try { - const hash = wasmCache$b.calculate(data, bits, 0x01); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } - } - /** - * Creates a new Keccak hash instance - * @param bits Number of output bits. Valid values: 224, 256, 384, 512 - */ - function createKeccak(bits = 512) { - if (validateBits(bits)) { - return Promise.reject(validateBits(bits)); - } - const outputSize = bits / 8; - return WASMInterface(wasmJson$b, outputSize).then((wasm) => { - wasm.init(bits); - const obj = { - init: () => { - wasm.init(bits); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType, 0x01), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 200 - 2 * outputSize, - digestSize: outputSize, - }; - return obj; - }); - } - - var name$a = "sha256"; - var data$a = "AGFzbQEAAAABEQRgAAF/YAF/AGAAAGACf38AAwgHAAEBAQIAAwUEAQECAgYOAn8BQfCJBQt/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2pB2pHmtwdqIhcgASADcyACcSABIANxcyABQR53IAFBE3dzIAFBCndzaiANaiICaiISIBEgCXNxIAlzaiASQRp3IBJBFXdzIBJBB3dzakHSovnBeWoiGSACIAFzIANxIAIgAXFzIAJBHncgAkETd3MgAkEKd3NqIA9qIgNqIhNqIB4gEmogGiARaiAdIAlqIBMgEiARc3EgEXNqIBNBGncgE0EVd3MgE0EHd3NqQe2Mx8F6aiIaIAMgAnMgAXEgAyACcXMgA0EedyADQRN3cyADQQp3c2ogGGoiAWoiCSATIBJzcSASc2ogCUEadyAJQRV3cyAJQQd3c2pByM+MgHtqIhggASADcyACcSABIANxcyABQR53IAFBE3dzIAFBCndzaiAUaiICaiIRIAkgE3NxIBNzaiARQRp3IBFBFXdzIBFBB3dzakHH/+X6e2oiFCACIAFzIANxIAIgAXFzIAJBHncgAkETd3MgAkEKd3NqIBdqIgNqIhIgESAJc3EgCXNqIBJBGncgEkEVd3MgEkEHd3NqQfOXgLd8aiIXIAMgAnMgAXEgAyACcXMgA0EedyADQRN3cyADQQp3c2ogGWoiAWoiE2ogICASaiAcIBFqIB8gCWogEyASIBFzcSARc2ogE0EadyATQRV3cyATQQd3c2pBx6KerX1qIhkgASADcyACcSABIANxcyABQR53IAFBE3dzIAFBCndzaiAaaiICaiIJIBMgEnNxIBJzaiAJQRp3IAlBFXdzIAlBB3dzakHRxqk2aiIaIAIgAXMgA3EgAiABcXMgAkEedyACQRN3cyACQQp3c2ogGGoiA2oiESAJIBNzcSATc2ogEUEadyARQRV3cyARQQd3c2pB59KkoQFqIhggAyACcyABcSADIAJxcyADQR53IANBE3dzIANBCndzaiAUaiIBaiISIBEgCXNxIAlzaiASQRp3IBJBFXdzIBJBB3dzakGFldy9AmoiFCABIANzIAJxIAEgA3FzIAFBHncgAUETd3MgAUEKd3NqIBdqIgJqIhMgI2ogJiASaiAiIBFqICUgCWogEyASIBFzcSARc2ogE0EadyATQRV3cyATQQd3c2pBuMLs8AJqIhcgAiABcyADcSACIAFxc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EGA/gNxQQh0ciAAQQh2QYD+A3EgAEEYdnJyNgLkiQFBAEEAKALgiQEiAEEYdCAAQYD+A3FBCHRyIABBCHZBgP4DcSAAQRh2cnI2AuCJAUEAQQAoAtyJASIAQRh0IABBgP4DcUEIdHIgAEEIdkGA/gNxIABBGHZycjYC3IkBQQBBACgC2IkBIgBBGHQgAEGA/gNxQQh0ciAAQQh2QYD+A3EgAEEYdnJyNgLYiQFBAEEAKALUiQEiAEEYdCAAQYD+A3FBCHRyIABBCHZBgP4DcSAAQRh2cnI2AtSJAUEAQQAoAtCJASIAQRh0IABBgP4DcUEIdHIgAEEIdkGA/gNxIABBGHZycjYC0IkBQQBBACgCzIkBIgBBGHQgAEGA/gNxQQh0ciAAQQh2QYD+A3EgAEEYdnJyNgLMiQFBAEEAKALIiQEiAEEYdCAAQYD+A3FBCHRyIABBCHZBgP4DcSAAQRh2cnI2AsiJAQJAQQAoAuiJASICRQ0AQQAhAANAIAFBgAlqIAFByIkBai0AADoAACABQQFqIQEgAiAAQQFqIgBB/wFxSw0ACwsLBgBBgIkBC6MBAEEAQgA3A8CJAUEAQRxBICABQeABRiIBGzYC6IkBQQBCp5/mp8b0k/2+f0Krs4/8kaOz8NsAIAEbNwPgiQFBAEKxloD+n6KFrOgAQv+kuYjFkdqCm38gARs3A9iJAUEAQpe6w4OTp5aHd0Ly5rvjo6f9p6V/IAEbNwPQiQFBAELYvZaI/KC1vjZC58yn0NbQ67O7fyABGzcDyIkBIAAQAhAECwsLAQBBgAgLBHAAAAA="; - var hash$a = "8c18dd94"; - var wasmJson$a = { - name: name$a, - data: data$a, - hash: hash$a - }; - - const mutex$a = new Mutex(); - let wasmCache$a = null; - /** - * Calculates SHA-2 (SHA-224) hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ - function sha224(data) { - if (wasmCache$a === null) { - return lockedCreate(mutex$a, wasmJson$a, 28).then((wasm) => { - wasmCache$a = wasm; - return wasmCache$a.calculate(data, 224); - }); - } - try { - const hash = wasmCache$a.calculate(data, 224); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } - } - /** - * Creates a new SHA-2 (SHA-224) hash instance - */ - function createSHA224() { - return WASMInterface(wasmJson$a, 28).then((wasm) => { - wasm.init(224); - const obj = { - init: () => { - wasm.init(224); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 64, - digestSize: 28, - }; - return obj; - }); - } - - const mutex$9 = new Mutex(); - let wasmCache$9 = null; - /** - * Calculates SHA-2 (SHA-256) hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ - function sha256(data) { - if (wasmCache$9 === null) { - return lockedCreate(mutex$9, wasmJson$a, 32).then((wasm) => { - wasmCache$9 = wasm; - return wasmCache$9.calculate(data, 256); - }); - } - try { - const hash = wasmCache$9.calculate(data, 256); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } - } - /** - * Creates a new SHA-2 (SHA-256) hash instance - */ - function createSHA256() { - return WASMInterface(wasmJson$a, 32).then((wasm) => { - wasm.init(256); - const obj = { - init: () => { - wasm.init(256); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 64, - digestSize: 32, - }; - return obj; - }); - } - - var name$9 = "sha512"; - var data$9 = "AGFzbQEAAAABEQRgAAF/YAF/AGAAAGACf38AAwgHAAEBAQIAAwUEAQECAgYOAn8BQdCKBQt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQAAQtIYXNoX1VwZGF0ZQACCkhhc2hfRmluYWwABA1IYXNoX0dldFN0Y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IABCOIiEhIQ3A5iKAUEAQQApA5CKASIAQjiGIABCgP4Dg0IohoQgAEKAgPwHg0IYhiAAQoCAgPgPg0IIhoSEIABCCIhCgICA+A+DIABCGIhCgID8B4OEIABCKIhCgP4DgyAAQjiIhISENwOQigFBAEEAKQOIigEiAEI4hiAAQoD+A4NCKIaEIABCgID8B4NCGIYgAEKAgID4D4NCCIaEhCAAQgiIQoCAgPgPgyAAQhiIQoCA/AeDhCAAQiiIQoD+A4MgAEI4iISEhDcDiIoBAkBBACgCyIoBIgNFDQBBACECA0AgAUGACWogAUGIigFqLQAAOgAAIAFBAWohASADIAJBAWoiAkH/AXFLDQALCwsGAEGAiQELoQIAQQBCADcDgIoBQQBBMEHAACABQYADRiIBGzYCyIoBQQBCpJ/p99uD0trHAEL5wvibkaOz8NsAIAEbNwPAigFBAEKnn+an1sGLhltC6/qG2r+19sEfIAEbNwO4igFBAEKRquDC9tCS2o5/Qp/Y+dnCkdqCm38gARs3A7CKAUEAQrGWgP7/zMmZ5wBC0YWa7/rPlIfRACABGzcDqIoBQQBCubK5uI+b+5cVQvHt9Pilp/2npX8gARs3A6CKAUEAQpe6w4Ojq8CskX9Cq/DT9K/uvLc8IAEbNwOYigFBAEKHqvOzo6WKzeIAQrvOqqbY0Ouzu38gARs3A5CKAUEAQti9lojcq+fdS0KIkvOd/8z5hOoAIAEbNwOIigEgABACEAQLCwsBAEGACAsE0AAAAA=="; - var hash$9 = "f2e40eb1"; - var wasmJson$9 = { - name: name$9, - data: data$9, - hash: hash$9 - }; - - const mutex$8 = new Mutex(); - let wasmCache$8 = null; - /** - * Calculates SHA-2 (SHA-384) hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ - function sha384(data) { - if (wasmCache$8 === null) { - return lockedCreate(mutex$8, wasmJson$9, 48).then((wasm) => { - wasmCache$8 = wasm; - return wasmCache$8.calculate(data, 384); - }); - } - try { - const hash = wasmCache$8.calculate(data, 384); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } - } - /** - * Creates a new SHA-2 (SHA-384) hash instance - */ - function createSHA384() { - return WASMInterface(wasmJson$9, 48).then((wasm) => { - wasm.init(384); - const obj = { - init: () => { - wasm.init(384); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 128, - digestSize: 48, - }; - return obj; - }); - } - - const mutex$7 = new Mutex(); - let wasmCache$7 = null; - /** - * Calculates SHA-2 (SHA-512) hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ - function sha512(data) { - if (wasmCache$7 === null) { - return lockedCreate(mutex$7, wasmJson$9, 64).then((wasm) => { - wasmCache$7 = wasm; - return wasmCache$7.calculate(data, 512); - }); - } - try { - const hash = wasmCache$7.calculate(data, 512); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } - } - /** - * Creates a new SHA-2 (SHA-512) hash instance - */ - function createSHA512() { - return WASMInterface(wasmJson$9, 64).then((wasm) => { - wasm.init(512); - const obj = { - init: () => { - wasm.init(512); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 128, - digestSize: 64, - }; - return obj; - }); - } - - var name$8 = "xxhash32"; - var data$8 = "AGFzbQEAAAABEQRgAAF/YAF/AGAAAGACf38AAwcGAAEBAgADBQQBAQICBg4CfwFBsIkFC38AQYAICwdwCAZtZW1vcnkCAA5IYXNoX0dldEJ1ZmZlcgAACUhhc2hfSW5pdAABC0hhc2hfVXBkYXRlAAIKSGFzaF9GaW5hbAADDUhhc2hfR2V0U3RhdGUABA5IYXNoX0NhbGN1bGF0ZQAFClNUQVRFX1NJWkUDA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FBEHYgAXMiAkEYdCACQYD+A3FBCHRyIAFBCHZBgP4DcSABQRh2cnKtNwOACQsGAEGAiQEL0gQCAX4Ef0EAQgA3A6iJAUEAIAE2AoiJAUEAIAFBz4yijgZqNgKMiQFBACABQfeUr694ajYChIkBQQAgAUGoiI2hAmo2AoCJAUEAQQA2AqCJASAAEAJBACkDqIkBIgKnIQECQAJAIAJCEFQNAEEAKAKEiQFBB3dBACgCgIkBQQF3akEAKAKIiQFBDHdqQQAoAoyJAUESd2ohAAwBC0EAKAKIiQFBsc/ZsgFqIQALIAAgAWohAEGQiQEhA0GUiQEhAQJAQQAoAqCJASIEQZCJAWoiBUGUiQFJDQBBkIkBIQMCQCAEQXxqIgZBBHENAEEAKAKQiQFBvdzKlXxsIABqQRF3Qa/W074CbCEAQZiJASEBQZSJASEDIAZBBEkNAQsDQCABKAIAQb3cypV8bCADKAIAQb3cypV8bCAAakERd0Gv1tO+AmxqQRF3Qa/W074CbCEAIAFBBGohAyABQQhqIgEgBU0NAAsgAUF8aiEDCwJAIAMgBUYNACAEQY+JAWohBgJAAkAgBCADa0EBcQ0AIAMhAQwBCyADQQFqIQEgAy0AAEGxz9myAWwgAGpBC3dBsfPd8XlsIQALIAYgA0YNAANAIAFBAWotAABBsc/ZsgFsIAEtAABBsc/ZsgFsIABqQQt3QbHz3fF5bGpBC3dBsfPd8XlsIQAgAUECaiIBIAVHDQALC0EAIABBD3YgAHNB95Svr3hsIgFBDXYgAXNBvdzKlXxsIgFBEHYgAXMiAEEYdCAAQYD+A3FBCHRyIAFBCHZBgP4DcSABQRh2cnKtNwOACQsLCwEAQYAICwQwAAAA"; - var hash$8 = "4bb12485"; - var wasmJson$8 = { - name: name$8, - data: data$8, - hash: hash$8 - }; - - const mutex$6 = new Mutex(); - let wasmCache$6 = null; - function validateSeed$3(seed) { - if (!Number.isInteger(seed) || seed < 0 || seed > 0xffffffff) { - return new Error("Seed must be a valid 32-bit long unsigned integer."); - } - return null; - } - /** - * Calculates xxHash32 hash - * @param data Input data (string, Buffer or TypedArray) - * @param seed Number used to initialize the internal state of the algorithm (defaults to 0) - * @returns Computed hash as a hexadecimal string - */ - function xxhash32(data, seed = 0) { - if (validateSeed$3(seed)) { - return Promise.reject(validateSeed$3(seed)); - } - if (wasmCache$6 === null) { - return lockedCreate(mutex$6, wasmJson$8, 4).then((wasm) => { - wasmCache$6 = wasm; - return wasmCache$6.calculate(data, seed); - }); - } - try { - const hash = wasmCache$6.calculate(data, seed); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } - } - /** - * Creates a new xxHash32 hash instance - * @param data Input data (string, Buffer or TypedArray) - * @param seed Number used to initialize the internal state of the algorithm (defaults to 0) - */ - function createXXHash32(seed = 0) { - if (validateSeed$3(seed)) { - return Promise.reject(validateSeed$3(seed)); - } - return WASMInterface(wasmJson$8, 4).then((wasm) => { - wasm.init(seed); - const obj = { - init: () => { - wasm.init(seed); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 16, - digestSize: 4, - }; - return obj; - }); - } - - var name$7 = "xxhash64"; - var data$7 = "AGFzbQEAAAABDANgAAF/YAAAYAF/AAMHBgABAgEAAQUEAQECAgYOAn8BQdCJBQt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQAAQtIYXNoX1VwZGF0ZQACCkhhc2hfRmluYWwAAw1IYXNoX0dldFN0YXRlAAQOSGFzaF9DYWxjdWxhdGUABQpTVEFURV9TSVpFAwEKmxEGBQBBgAkLYwEBfkEAQgA3A8iJAUEAQQApA4AJIgA3A5CJAUEAIABC+erQ0OfJoeThAHw3A5iJAUEAIABCz9bTvtLHq9lCfDcDiIkBQQAgAELW64Lu6v2J9eAAfDcDgIkBQQBBADYCwIkBC70IAwV/BH4CfwJAIABFD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Ff3whACAGQQhqIQUgBkEQaiIGIAhNDQALIAZBeGohBQsCQAJAIAVBBGoiCSAITQ0AIAUhCQwBCyAFNQIAQoeVr6+Ytt6bnn9+IACFQheJQs/W077Sx6vZQn5C+fPd8Zn2masWfCEACwJAIAkgCEYNACAHQZ+JAWohBQJAAkAgByAJa0EBcQ0AIAkhBgwBCyAJQQFqIQYgCTEAAELFz9my8eW66id+IACFQguJQoeVr6+Ytt6bnn9+IQALIAUgCUYNAANAIAZBAWoxAABCxc/ZsvHluuonfiAGMQAAQsXP2bLx5brqJ34gAIVCC4lCh5Wvr5i23puef36FQguJQoeVr6+Ytt6bnn9+IQAgBkECaiIGIAhHDQALC0EAIABCIYggAIVCz9bTvtLHq9lCfiIAQh2IIACFQvnz3fGZ9pmrFn4iAEIgiCAAhSIBQjiGIAFCgP4Dg0IohoQgAUKAgPwHg0IYhiABQoCAgPgPg0IIhoSEIABCCIhCgICA+A+DIABCGIhCgID8B4OEIABCKIhCgP4DgyAAQjiIhISENwOACQsGAEGAiQELAgALCwsBAEGACAsEUAAAAA=="; - var hash$7 = "177fbfa3"; - var wasmJson$7 = { - name: name$7, - data: data$7, - hash: hash$7 - }; - - const mutex$5 = new Mutex(); - let wasmCache$5 = null; - const seedBuffer$2 = new Uint8Array(8); - function validateSeed$2(seed) { - if (!Number.isInteger(seed) || seed < 0 || seed > 0xffffffff) { - return new Error("Seed must be given as two valid 32-bit long unsigned integers (lo + high)."); - } - return null; - } - function writeSeed$2(arr, low, high) { - // write in little-endian format - const buffer = new DataView(arr); - buffer.setUint32(0, low, true); - buffer.setUint32(4, high, true); - } - /** - * Calculates xxHash64 hash - * @param data Input data (string, Buffer or TypedArray) - * @param seedLow Lower 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @param seedHigh Higher 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @returns Computed hash as a hexadecimal string - */ - function xxhash64(data, seedLow = 0, seedHigh = 0) { - if (validateSeed$2(seedLow)) { - return Promise.reject(validateSeed$2(seedLow)); - } - if (validateSeed$2(seedHigh)) { - return Promise.reject(validateSeed$2(seedHigh)); - } - if (wasmCache$5 === null) { - return lockedCreate(mutex$5, wasmJson$7, 8).then((wasm) => { - wasmCache$5 = wasm; - writeSeed$2(seedBuffer$2.buffer, seedLow, seedHigh); - wasmCache$5.writeMemory(seedBuffer$2); - return wasmCache$5.calculate(data); - }); - } - try { - writeSeed$2(seedBuffer$2.buffer, seedLow, seedHigh); - wasmCache$5.writeMemory(seedBuffer$2); - const hash = wasmCache$5.calculate(data); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } - } - /** - * Creates a new xxHash64 hash instance - * @param seedLow Lower 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @param seedHigh Higher 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - */ - function createXXHash64(seedLow = 0, seedHigh = 0) { - if (validateSeed$2(seedLow)) { - return Promise.reject(validateSeed$2(seedLow)); - } - if (validateSeed$2(seedHigh)) { - return Promise.reject(validateSeed$2(seedHigh)); - } - return WASMInterface(wasmJson$7, 8).then((wasm) => { - const instanceBuffer = new Uint8Array(8); - writeSeed$2(instanceBuffer.buffer, seedLow, seedHigh); - wasm.writeMemory(instanceBuffer); - wasm.init(); - const obj = { - init: () => { - wasm.writeMemory(instanceBuffer); - wasm.init(); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 32, - digestSize: 8, - }; - return obj; - }); - } - - var name$6 = "xxhash3"; - var data$6 = "AGFzbQEAAAABNAhgAAF/YAR/f39/AGAHf39/f39/fwBgBH9+fn4BfmAEf39/fgF+YAN/f34BfmAAAGABfwADDg0AAQIDBAUFBQYHBgAGBQQBAQICBg4CfwFBwI4FC38AQcAJCwdwCAZtZW1vcnkCAA5IYXNoX0dldEJ1ZmZlcgAACUhhc2hfSW5pdAAIC0hhc2hfVXBkYXRlAAkKSGFzaF9GaW5hbAAKDUhhc2hfR2V0U3RhdGUACw5IYXNoX0NhbGN1bGF0ZQAMClNUQVRFX1NJWkUDAQr6QQ0FAEGACgvkAwMPfgF/AX4CQCADRQ0AIAApAzAhBCAAKQM4IQUgACkDICEGIAApAyghByAAKQMQIQggACkDGCEJIAApAwAhCiAAKQMIIQsDQCAFIAFBMGopAwAiDHwgAkE4aikDACABQThqKQMAIg2FIgVCIIggBUL/////D4N+fCEFIAcgAUEgaikDACIOfCACQShqKQMAIAFBKGopAwAiD4UiB0IgiCAHQv////8Pg358IQcgCSABQRBqKQMAIhB8IAJBGGopAwAgAUEYaikDACIRhSIJQiCIIAlC/////w+DfnwhCSALIAEpAwAiEnwgAkEIaiITKQMAIAFBCGopAwAiFIUiC0IgiCALQv////8Pg358IQsgAkEwaikDACAMhSIMQiCIIAxC/////w+DfiAEfCANfCEEIAJBIGopAwAgDoUiDEIgiCAMQv////8Pg34gBnwgD3whBiACQRBqKQMAIBCFIgxCIIggDEL/////D4N+IAh8IBF8IQggAikDACAShSIMQiCIIAxC/////w+DfiAKfCAUfCEKIAFBwABqIQEgEyECIANBf2oiAw0ACyAAIAk3AxggACAKNwMAIAAgCzcDCCAAIAc3AyggACAINwMQIAAgBTcDOCAAIAY3AyAgACAENwMwCwveAgIBfwF+AkAgBCACIAEoAgAiB2siAkkNACAAIAMgBSAHQQN0aiACEAEgACAFIAZqIgcpAwAgACkDACIIQi+IhSAIhUKx893xCX43AwAgACAHKQMIIAApAwgiCEIviIUgCIVCsfPd8Ql+NwMIIAAgBykDECAAKQMQIghCL4iFIAiFQrHz3fEJfjcDECAAIAcpAxggACkDGCIIQi+IhSAIhUKx893xCX43AxggACAHKQMgIAApAyAiCEIviIUgCIVCsfPd8Ql+NwMgIAAgBykDKCAAKQMoIghCL4iFIAiFQrHz3fEJfjcDKCAAIAcpAzAgACkDMCIIQi+IhSA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iBkIgiCIHfiIIQv////8PgyAEQiCIIgQgBkL/////D4MiBn58IAUgBn4iBUIgiHwiBkIghiAFQv////8Pg4QgCEIgiCAEIAd+fCAGQiCIfIUgA3wgASkDeCACfSAAQciLAWopAwCFIgNC/////w+DIgQgASkDcCACfCAAQcCLAWopAwCFIgVCIIgiBn4iB0L/////D4MgA0IgiCIDIAVC/////w+DIgV+fCAEIAV+IgRCIIh8IgVCIIYgBEL/////D4OEIAdCIIggAyAGfnwgBUIgiHyFfCEDCyABKQNIIAJ9QQApA6iMAYUiBEL/////D4MiBSABKQNAIAJ8QQApA6CMAYUiBkIgiCIHfiIIQv////8PgyAEQiCIIgQgBkL/////D4MiBn58IAUgBn4iBUIgiHwiBkIghiAFQv////8Pg4QgCEIgiCAEIAd+fCAGQiCIfIUgA3wgASkDWCACfSAAQdiLAWopAwCFIgNC/////w+DIgQgASkDUCACfCAAQdCLAWopAwCFIgVCIIgiBn4iB0L/////D4MgA0IgiCIDIAVC/////w+DIgV+fCAEIAV+IgRCIIh8IgVCIIYgBEL/////D4OEIAdCIIggAyAGfnwgBUIgiHyFfCEDCyABKQMoIAJ9QQApA5iMAYUiBEL/////D4MiBSABKQMgIAJ8QQApA5CMAYUiBkIgiCIHfiIIQv////8PgyAEQiCIIgQgBkL/////D4MiBn58IAUgBn4iBUIgiHwiBkIghiAFQv////8Pg4QgCEIgiCAEIAd+fCAGQiCIfIUgA3wgASkDOCACfSAAQeiLAWopAwCFIgNC/////w+DIgQgASkDMCACfCAAQeCLAWopAwCFIgVCIIgiBn4iB0L/////D4MgA0IgiCIDIAVC/////w+DIgV+fCAEIAV+IgRCIIh8IgVCIIYgBEL/////D4OEIAdCIIggAyAGfnwgBUIgiHyFfCEDCyABKQMIIAJ9QQApA4iMAYUiBEL/////D4MiBSABKQMAIAJ8QQApA4CMAYUiBkIgiCIHfiIIQv////8PgyAEQiCIIgQgBkL/////D4MiBn58IAUgBn4iBUIgiHwiBkIghiAFQv////8Pg4QgCEIgiCAEIAd+fCAGQiCIfIUgA3wgASkDGCACfSAAQfiLAWopAwCFIgNC/////w+DIgQgASkDECACfCAAQfCLAWopAwCFIgJCIIgiBX4iBkL/////D4MgA0IgiCIDIAJC/////w+DIgJ+fCAEIAJ+IgJCIIh8IgRCIIYgAkL/////D4OEIAZCIIggAyAFfnwgBEIgiHyFfCICQiWIIAKFQvnz3fGZ8pmrFn4iAkIgiCAChQv8CgQBfwV+An8BfkEAIQMgASkDeCACfUEAKQP4jAGFIgRC/////w+DIgUgASkDcCACfEEAKQPwjAGFIgZCIIgiB34iCEL/////D4MgBEIgiCIEIAZC/////w+DIgZ+fCAFIAZ+IgVCIIh8IgZCIIYgBUL/////D4OEIAhCIIggBCAHfnwgBkIgiHyFIAEpA2ggAn1BACkD6IwBhSIEQv////8PgyIFIAEpA2AgAnxBACkD4IwBhSIGQiCIIgd+IghC/////w+DIARCIIgiBCAGQv////8PgyIGfnwgBSAGfiIFQiCIfCIGQiCGIAVC/////w+DhCAIQiCIIAQgB358IAZCIIh8hSABKQNYIAJ9QQApA9iMAYUiBEL/////D4MiBSABKQNQIAJ8QQApA9CMAYUiBkIgiCIHfiIIQv////8PgyAEQiCIIgQgBkL/////D4MiBn58IAUgBn4iBUIgiHwiBkIghiAFQv////8Pg4QgCEIgiCAEIAd+fCAGQiCIfIUgASkDSCACfUEAKQPIjAGFIgRC/////w+DIgUgASkDQCACfEEAKQPAjAGFIgZCIIgiB34iCEL/////D4MgBEIgiCIEIAZC/////w+DIgZ+fCAFIAZ+IgVCIIh8IgZCIIYgBUL/////D4OEIAhCIIggBCAHfnwgBkIgiHyFIAEpAzggAn1BACkDuIwBhSIEQv////8PgyIFIAEpAzAgAnxBACkDsIwBhSIGQiCIIgd+IghC/////w+DIARCIIgiBCAGQv////8PgyIGfnwgBSAGfiIFQiCIfCIGQiCGIAVC/////w+DhCAIQiCIIAQgB358IAZCIIh8hSABKQMoIAJ9QQApA6iMAYUiBEL/////D4MiBSABKQMgIAJ8QQApA6CMAYUiBkIgiCIHfiIIQv////8PgyAEQiCIIgQgBkL/////D4MiBn58IAUgBn4iBUIgiHwiBkIghiAFQv////8Pg4QgCEIgiCAEIAd+fCAGQiCIfIUgASkDGCACfUEAKQOYjAGFIgRC/////w+DIgUgASkDECACfEEAKQOQjAGFIgZCIIgiB34iCEL/////D4MgBEIgiCIEIAZC/////w+DIgZ+fCAFIAZ+IgVCIIh8IgZCIIYgBUL/////D4OEIAhCIIggBCAHfnwgBkIgiHyFIAEpAwggAn1BACkDiIwBhSIEQv////8PgyIFIAEpAwAgAnxBACkDgIwBhSIGQiCIIgd+IghC/////w+DIARCIIgiBCAGQv////8PgyIGfnwgBSAGfiIFQiCIfCIGQiCGIAVC/////w+DhCAIQiCIIAQgB358IAZCIIh8hSAArUKHla+vmLbem55/fnx8fHx8fHx8IgRCJYggBIVC+fPd8ZnymasWfiIEQiCIIASFIQQCQCAAQZABSA0AIABBBHZBeGohCQNAIAEgA2oiCkELaikDACACfSADQYiNAWopAwCFIgVC/////w+DIgYgCkEDaikDACACfCADQYCNAWopAwCFIgdCIIgiCH4iC0L/////D4MgBUIgiCIFIAdC/////w+DIgd+fCAGIAd+IgZCIIh8IgdCIIYgBkL/////D4OEIAtCIIggBSAIfnwgB0IgiHyFIAR8IQQgA0EQaiEDIAlBf2oiCQ0ACwsgASkDfyACfSAAQfiLAWopAwCFIgVC/////w+DIgYgASkDdyACfCAAQfCLAWopAwCFIgJCIIgiB34iCEL/////D4MgBUIgiCIFIAJC/////w+DIgJ+fCAGIAJ+IgJCIIh8IgZCIIYgAkL/////D4OEIAhCIIggBSAHfnwgBkIgiHyFIAR8IgJCJYggAoVC+fPd8ZnymasWfiICQiCIIAKFC98FAgF+AX8CQAJAQQApA4AKIgBQRQ0AQYAIIQFCACEADAELAkBBACkDoI4BIABSDQBBACEBDAELQQAhAUEAQq+v79e895Kg/gAgAH03A/iLAUEAIABCxZbr+djShYIofDcD8IsBQQBCj/Hjja2P9JhOIAB9NwPoiwFBACAAQ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QQhqIQMgBEEIaiEEIAZBeGoiBkEHSw0ACwsgBkUNAQNAIAMgBC0AADoAACADQQFqIQMgBEEBaiEEIAZBf2oiBg0ADAILCyABRQ0AAkACQCABQQdxIgYNACABIQIMAQsgAUF4cSECA0AgAyAELQAAOgAAIANBAWohAyAEQQFqIQQgBkF/aiIGDQALCwJAIAFBCEkNAANAIAMgBCkAADcAACADQQhqIQMgBEEIaiEEIAJBeGoiAg0ACwtBACgCgI4BIABqIQILQQAgAjYCgI4BC/ISBQR/A34BfxV+BX8jACIAIQEgAEGAAWtBQHEiAiQAQQAoArCOASIAQcCKASAAGyEDAkACQEEAKQOQjgEiBELxAVQNACACQQApA4CKATcDACACQQApA4iKATcDCCACQQApA5CKATcDECACQQApA5iKATcDGCACQQApA6CKATcDICACQQApA6iKATcDKCACQQApA7CKASIFNwMwIAJBACkDuIoBIgY3AzgCQAJAQQAoAoCOASIHQcAASQ0AIAJBACgCiI4BNgJAIAIgAkHAAGpBACgCmI4BQYCMASAHQX9qQQZ2IANBACgCnI4BIgAQAiADIABqIgBBeWopAwAhCCAAKQMJIQkgACkDGSEKIAApAykhCyAHQcCLAWopAwAhBSAAKQMBIQwgB0HIiwFqKQMAIQYgB0HQiwFqKQMAIQ0gACkDESEOIAdB2IsBaikDACEPIAdB4IsBaikDACEQIAApAyEhESAHQeiLAWopAwAhEiACKQMAIRMgAikDECEUIAIpAyAhFSACKQMwIRYgAikDCCEXIAIpAxghGCACKQMoIRkgAiACKQM4IAdB8IsBaikDACIafCAAKQMxIAdB+IsBaikDACIbhSIcQiCIIBxC/////w+Dfnw3AzggGSAQfCARIBKFIhFCIIggEUL/////D4N+fCERIBggDXwgDiAPhSIOQiCIIA5C/////w+DfnwhDiAXIAV8IAwgBoUiDEIgiCAMQv////8Pg358IQwgGyAWIAsgGoUiC0IgiCALQv////8Pg358fCELIBIgFSAKIBCFIhBCIIggEEL/////D4N+fHwhECAPIBQgCSANhSINQiCIIA1C/////w+Dfnx8IRIgBiATIAgg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UiHEIgiCAcQv////8Pg358NwM4IBogEHwgESAJhSIRQiCIIBFC/////w+DfnwhESAZIBJ8IA4gCIUiDkIgiCAOQv////8Pg358IQ4gGCANfCAMIA+FIgxCIIggDEL/////D4N+fCEMIAYgCyAbhSILQiCIIAtC/////w+DfiAFfHwhCyAJIBcgFCAQhSIFQiCIIAVC/////w+Dfnx8IRAgCCAWIBMgEoUiBUIgiCAFQv////8Pg358fCESIA8gFSAKIA2FIgVCIIggBUL/////D4N+fHwhCAsgAykDQyACKQM4hSIFQv////8PgyIGIAMpAzsgC4UiC0IgiCINfiIPQv////8PgyAFQiCIIgUgC0L/////D4MiC358IAYgC34iBkIgiHwiC0IghiAGQv////8Pg4QgD0IgiCAFIA1+fCALQiCIfIUgAykDMyARhSIFQv////8PgyIGIAMpAysgEIUiC0IgiCINfiIPQv////8PgyAFQiCIIgUgC0L/////D4MiC358IAYgC34iBkIgiHwiC0IghiAGQv////8Pg4QgD0IgiCAFIA1+fCALQiCIfIUgAykDIyAOhSIFQv////8PgyIGIAMpAxsgEoUiC0IgiCINfiIPQv////8PgyAFQiCIIgUgC0L/////D4MiC358IAYgC34iBkIgiHwiC0IghiAGQv////8Pg4QgD0IgiCAFIA1+fCALQiCIfIUgAykDEyAMhSIFQv////8PgyIGIAMpAwsgCIUiC0IgiCINfiIPQv////8PgyAFQiCIIgUgC0L/////D4MiC358IAYgC34iBkIgiHwiC0IghiAGQv////8Pg4QgD0IgiCAFIA1+fCALQiCIfIUgBEKHla+vmLbem55/fnx8fHwiBEIliCAEhUL5893xmfKZqxZ+IgRCIIggBIUhBAwBCyAEpyEAAkBBACkDoI4BIgRQDQACQCAAQRBLDQAgAEGACCAEEAUhBAwCCwJAIABBgAFLDQAgAEGACCAEEAYhBAwCCyAAQYAIIAQQByEEDAELAkAgAEEQSw0AIAAgA0IAEAUhBAwBCwJAIABBgAFLDQAgACADQgAQBiEEDAELIAAgA0IAEAchBAtBACAEQjiGIARCgP4Dg0IohoQgBEKAgPwHg0IYhiAEQoCAgPgPg0IIhoSEIARCCIhCgICA+A+DIARCGIhCgID8B4OEIARCKIhCgP4DgyAEQjiIhISENwOACiABJAALBgBBgIoBCwIACwvMAQEAQYAIC8QBuP5sOSOkS758AYEs9yGtHN7UbemDkJfbckCkpLezZx/LeeZOzMDleIJa0H3M/3IhuAhGdPdDJI7gNZDmgTomTDwoUruRwwDLiNBlixtTLqNxZEiXog35TjgZ70ap3qzYqPp2P+OcND/53LvHxwtPHYpR4EvNtFkxyJ9+ydl4c2TqxayDNNPrw8WBoP/6E2PrFw3dUbfw2knTFlUmKdRonisWvlh9R6H8j/i40XrQMc5FyzqPlRYEKK/X+8q7S0B+QAIAAA=="; - var hash$6 = "5a2fbdbb"; - var wasmJson$6 = { - name: name$6, - data: data$6, - hash: hash$6 - }; - - const mutex$4 = new Mutex(); - let wasmCache$4 = null; - const seedBuffer$1 = new Uint8Array(8); - function validateSeed$1(seed) { - if (!Number.isInteger(seed) || seed < 0 || seed > 0xffffffff) { - return new Error("Seed must be given as two valid 32-bit long unsigned integers (lo + high)."); - } - return null; - } - function writeSeed$1(arr, low, high) { - // write in little-endian format - const buffer = new DataView(arr); - buffer.setUint32(0, low, true); - buffer.setUint32(4, high, true); - } - /** - * Calculates xxHash3 hash - * @param data Input data (string, Buffer or TypedArray) - * @param seedLow Lower 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @param seedHigh Higher 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @returns Computed hash as a hexadecimal string - */ - function xxhash3(data, seedLow = 0, seedHigh = 0) { - if (validateSeed$1(seedLow)) { - return Promise.reject(validateSeed$1(seedLow)); - } - if (validateSeed$1(seedHigh)) { - return Promise.reject(validateSeed$1(seedHigh)); - } - if (wasmCache$4 === null) { - return lockedCreate(mutex$4, wasmJson$6, 8).then((wasm) => { - wasmCache$4 = wasm; - writeSeed$1(seedBuffer$1.buffer, seedLow, seedHigh); - wasmCache$4.writeMemory(seedBuffer$1); - return wasmCache$4.calculate(data); - }); - } - try { - writeSeed$1(seedBuffer$1.buffer, seedLow, seedHigh); - wasmCache$4.writeMemory(seedBuffer$1); - const hash = wasmCache$4.calculate(data); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } - } - /** - * Creates a new xxHash3 hash instance - * @param seedLow Lower 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @param seedHigh Higher 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - */ - function createXXHash3(seedLow = 0, seedHigh = 0) { - if (validateSeed$1(seedLow)) { - return Promise.reject(validateSeed$1(seedLow)); - } - if (validateSeed$1(seedHigh)) { - return Promise.reject(validateSeed$1(seedHigh)); - } - return WASMInterface(wasmJson$6, 8).then((wasm) => { - const instanceBuffer = new Uint8Array(8); - writeSeed$1(instanceBuffer.buffer, seedLow, seedHigh); - wasm.writeMemory(instanceBuffer); - wasm.init(); - const obj = { - init: () => { - wasm.writeMemory(instanceBuffer); - wasm.init(); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 512, - digestSize: 8, - }; - return obj; - }); - } - - var name$5 = "xxhash128"; - var data$5 = "AGFzbQEAAAABKwdgAAF/YAR/f39/AGAHf39/f39/fwBgA39/fgF+YAR/f39+AGAAAGABfwADDQwAAQIDBAQEBQYFAAUFBAEBAgIGDgJ/AUHAjgULfwBBwAkLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAJSGFzaF9Jbml0AAcLSGFzaF9VcGRhdGUACApIYXNoX0ZpbmFsAAkNSGFzaF9HZXRTdGF0ZQAKDkhhc2hfQ2FsY3VsYXRlAAsKU1RBVEVfU0laRQMBCqBNDAUAQYAKC+QDAw9+AX8BfgJAIANFDQAgACkDMCEEIAApAzghBSAAKQMgIQYgACkDKCEHIAApAxAhCCAAKQMYIQkgACkDACEKIAApAwghCwNAIAUgAUEwaikDACIMfCACQThqKQMAIAFBOGopAwAiDYUiBUIgiCAFQv////8Pg358IQUgByABQSBqKQMAIg58IAJBKGopAwAgAUEoaikDACIPhSIHQiCIIAdC/////w+DfnwhByAJIAFBEGopAwAiEHwgAkEYaikDACABQRhqKQMAIhGFIglCIIggCUL/////D4N+fCEJIAsgASkDACISfCACQQhqIhMpAwAgAUEIaikDACIUhSILQiCIIAtC/////w+DfnwhCyACQTBqKQMAIAyFIgxCIIggDEL/////D4N+IAR8IA18IQQgAkEgaikDACAOhSIMQiCIIAxC/////w+DfiAGfCAPfCEGIAJBEGopAwAgEIUiDEIgiCAMQv////8Pg34gCHwgEXwhCCACKQMAIBKFIgxCIIggDEL/////D4N+IAp8IBR8IQogAUHAAGohASATIQIgA0F/aiIDDQALIAAgCTcDGCAAIAo3AwAgACALNwMIIAAgBzcDKCAAIAg3AxAgACAFNwM4IAAgBjcDICAAIAQ3AzALC94CAgF/AX4CQCAEIAIgASgCACIHayICSQ0AIAAgAyAFIAdBA3RqIAIQASAAIAUgBmoiBykDACAAKQMAIghCL4iFIAiFQrHz3fEJfjcDACAAIAcpAwggACkDCCIIQi+IhSAIhUKx893xCX43AwggACAHKQMQIAApAxAiCEIviIUgCIVCsfPd8Ql+NwMQIAAgBykDGCAAKQMYIghCL4iFIAiFQrHz3fEJfjcDGCAAIAcpAyAgACkDICIIQi+IhSAIhUKx893xCX43AyAgACAHKQMoIAApAygiCEIviIUgCIVCsfPd8Ql+NwMoIAAgBykDMCAAKQMwIghCL4iFIAiFQrHz3fEJfjcDMCAAIAcpAzggACkDOCIIQi+IhSAIhUKx893xCX43AzggACADIAJBBnRqIAUgBCACayIHEAEgASAHNgIADwsgACADIAUgB0EDdGogBBABIAEgByAEajYCAAvtAwEFfiABKQM4IAApAziFIgNC/////w+DIgQgASkDMCAAKQMwhSIFQiCIIgZ+IgdC/////w+DIANCIIgiAyAFQv////8PgyIFfnwgBCAFfiIEQiCIfCIFQiCGIARC/////w+DhCAHQiCIIAMgBn58IAVCIIh8hSABKQMoIAApAyiFIgNC/////w+DIgQgASkDICAAKQMghSIFQiCIIgZ+IgdC/////w+DIANCIIgiAyAFQv////8PgyIFfnwgBCAFfiIEQiCIfCIFQiCGIARC/////w+DhCAHQiCIIAMgBn58IAVCIIh8hSABKQMYIAApAxiFIgNC/////w+DIgQgASkDECAAKQMQhSIFQiCIIgZ+IgdC/////w+DIANCIIgiAyAFQv////8PgyIFfnwgBCAFfiIEQiCIfCIFQiCGIARC/////w+DhCAHQiCIIAMgBn58IAVCIIh8hSABKQMIIAApAwiFIgNC/////w+DIgQgASkDACAAKQMAhSIFQiCIIgZ+IgdC/////w+DIANCIIgiAyAFQv////8PgyIFfnwgBCAFfiIEQiCIfCIFQiCGIARC/////w+DhCAHQiCIIAMgBn58IAVCIIh8hSACfHx8fCICQiWIIAKFQvnz3fGZ8pmrFn4iAkIgiCAChQu6CAIFfgN/AkAgAUEJSQ0AIAAgAUH4iwFqKQMAIgQgAikDOCACKQMwhSADfIUiBUL/////D4NC95Svrwh+IAVCgICAgHCDfEEAKQOAjAEgAikDKCACKQMghSADfYUgBIUiA0IgiCIEQrHz3fEJfnwgBEKHla+vCH4iBEIgiHwgBEL/////D4MgA0L/////D4MiA0Kx893xCX58IANCh5Wvrwh+IgRCIIh8IgVCIIh8IgNCOIYgA0KA/gODQiiGhCADQoCA/AeDQhiGIANCgICA+A+DQgiGhIQgA0IIiEKAgID4D4MgA0IYiEKAgPwHg4QgA0IoiEKA/gODIANCOIiEhIQgBEL/////D4MgAUF/aq1CNoaEIAVCIIZ8hSIEQiCIIgVCz9bTvgJ+IgZC/////w+DIARC/////w+DIgRCvdzKlQx+fCAEQs/W074CfiIEQiCIfCIHQiCGIghCJYggCCAEQv////8Pg4SFQvnz3fGZ8pmrFn4iBEIgiCAEhTcDACAAIAVCvdzKlQx+IANCz9bTvtLHq9lCfnwgBkIgiHwgB0IgiHwiA0IliCADhUL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h8IglCIIh8QQApA7iMASILQQApA7CMASIMfIUgCUIghiAHQv////8Pg4SFIQcgAkHoAGopAwAgA30gC4UiCUL/////D4MiCyACKQNgIAN8IAyFIgxCIIgiDX4iBkL/////D4MgCUIgiCIJIAxC/////w+DIgx+fCALIAx+IgtCIIh8IgxCIIYgC0L/////D4OEIAZCIIggCSANfnwgDEIgiHyFIAV8IAggCnyFIQULIAJB2ABqKQMAIAN9IAFB2IsBaikDACIIhSIJQv////8PgyIKIAIpA1AgA3wgAUHQiwFqKQMAIguFIgxCIIgiDX4iBkL/////D4MgCUIgiCIJIAxC/////w+DIgx+fCAKIAx+IgpCIIh8IgxCIIYgCkL/////D4OEIAZCIIggCSANfnwgDEIgiHyFIAd8QQApA6iMASIJQQApA6CMASIKfIUhByACQcgAaikDACADfSAJhSIJQv////8PgyIMIAIpA0AgA3wgCoUiCkIgiCINfiIGQv////8PgyAJQiCIIgkgCkL/////D4MiCn58IAwgCn4iCkIgiHwiDEIghiAKQv////8Pg4QgBkIgiCAJIA1+fCAMQiCIfIUgBXwgCCALfIUhBQsgAkE4aikDACADfSABQeiLAWopAwAiCIUiCUL/////D4MiCiACKQMwIAN8IAFB4IsBaikDACILhSIMQiCIIg1+IgZC/////w+DIAlCIIgiCSAMQv////8PgyIMfnwgCiAMfiIKQiCIfCIMQiCGIApC/////w+DhCAGQiCIIAkgDX58IAxCIIh8hSAHfEEAKQOYjAEiB0EAKQOQjAEiCXyFIQYgAkEoaikDACADfSAHhSIHQv////8PgyIKIAIpAyAgA3wgCYUiCUIgiCIMfiINQv////8PgyAHQiCIIgcgCUL/////D4MiCX58IAogCX4iCUIgiHwiCkIghiAJQv////8Pg4QgDUIgiCAHIAx+fCAKQiCIfIUgBXwgCCALfIUhBQsgACACQRhqKQMAIAN9IAFB+IsBaikDACIHhSIIQv////8PgyIJIAIpAxAgA3wgAUHwiwFqKQMAIgqFIgtCIIgiDH4iDUL/////D4MgCEIgiCIIIAtC/////w+DIgt+fCAJIAt+IglCIIh8IgtCIIYgCUL/////D4OEIA1CIIggCCAMfnwgC0IgiHyFIAZ8QQApA4iMASIIQQApA4CMASIJfIUiCyACQQhqKQMAIAN9IAiFIghC/////w+DIgwgAikDACADfCAJhSIJQiCIIg1+IgZC/////w+DIAhCIIgiCCAJQv////8PgyIJfnwgDCAJfiIJQiCIfCIMQiCGIAlC/////w+DhCAGQiCIIAggDX58IAxCIIh8hSAFfCAHIAp8hSIFfCIHQiWIIAeFQvnz3fGZ8pmrFn4iB0IgiCAHhTcDACAAQgAgBUKHla+vmLbem55/fiAEIAN9Qs/W077Sx6vZQn58IAtC49zKlfzO8vWFf358IgNCJYggA4VC+fPd8ZnymasWfiIDQiCIIAOFfTcDCAuhDwMBfxR+An9BACEEIAJB+ABqKQMAIAN9QQApA/iMASIFhSIGQv////8PgyIHIAIpA3AgA3xBACkD8IwBIgiFIglCIIgiCn4iC0L/////D4MgBkIgiCIGIAlC/////w+DIgl+fCAHIAl+IgdCIIh8IglCIIYgB0L/////D4OEIAtCIIggBiAKfnwgCUIgiHyFIAJB2ABqKQMAIAN9QQApA9iMASIHhSIGQv////8PgyIJIAIpA1AgA3xBACkD0IwBIgqFIgtCIIgiDH4iDUL/////D4MgBkIgiCIGIAtC/////w+DIgt+fCAJIAt+IglCIIh8IgtCIIYgCUL/////D4OEIA1CIIggBiAMfnwgC0IgiHyFIAJBOGopAwAgA31BACkDuIwBIgmFIgZC/////w+DIgsgAikDMCADfEEAKQOwjAEiDIUiDUIgiCIOfiIPQv////8PgyAGQiCIIgYgDUL/////D4MiDX58IAsgDX4iC0IgiHwiDUIghiALQv////8Pg4QgD0IgiCAGIA5+fCANQiCIfIUgAkEYaikDACADfUEAKQOYjAEiC4UiBkL/////D4MiDSACKQMQIAN8QQApA5CMASIOhSIPQiCIIhB+IhFC/////w+DIAZCIIgiBiAPQv////8PgyIPfnwgDSAPfiINQiCIfCIPQiCGIA1C/////w+DhCARQiCIIAYgEH58IA9CIIh8hUEAKQOIjAEiDUEAKQOAjAEiD3yFfEEAKQOojAEiEEEAKQOgjAEiEXyFfEEAKQPIjAEiEkEAKQPAjAEiE3yFfEEAKQPojAEiFEEAKQPgjAEiFXyFIgZCJYggBoVC+fPd8ZnymasWfiIGQiCIIAaFIQYgAkHoAGopAwAgA30gFIUiFEL/////D4MiFiACKQNgIAN8IBWFIhVCIIgiF34iGEL/////D4MgFEIgiCIUIBVC/////w+DIhV+fCAWIBV+IhVCIIh8IhZCIIYgFUL/////D4OEIBhCIIggFCAXfnwgFkIgiHyFIAJByABqKQMAIAN9IBKFIhJC/////w+DIhQgAikDQCADfCAThSITQiCIIhV+IhZC/////w+DIBJCIIgiEiATQv////8PgyITfnwgFCATfiITQiCIfCIUQiCGIBNC/////w+DhCAWQiCIIBIgFX58IBRCIIh8hSACQShqKQMAIAN9IBCFIhBC/////w+DIhIgAikDICADfCARhSIRQiCIIhN+IhRC/////w+DIBBCIIgiECARQv////8PgyIRfnwgEiARfiIRQiCIfCISQiCGIBFC/////w+DhCAUQiCIIBAgE358IBJCIIh8hSACQQhqKQMAIAN9IA2FIg1C/////w+DIhAgAikDACADfCAPhSIPQiCIIhF+IhJC/////w+DIA1CIIgiDSAPQv////8PgyIPfnwgECAPfiIPQiCIfCIQQiCGIA9C/////w+DhCASQiCIIA0gEX58IBBCIIh8hSABrSIPQoeVr6+Ytt6bnn9+fCALIA58hXwgCSAMfIV8IAcgCnyFfCAFIAh8hSIFQiWIIAWFQvnz3fGZ8pmrFn4iBUIgiCAFhSEFAkAgAUGgAUgNACABQQV2QXxqIRkDQCACIARqIhpBG2opAwAgA30gBEGYjQFqKQMAIgeFIghC/////w+DIgkgGkETaikDACADfCAEQZCNAWopAwAiCoUiC0IgiCIMfiINQv////8PgyAIQiCIIgggC0L/////D4MiC358IAkgC34iCUIgiHwiC0IghiAJQv////8Pg4QgDUIgiCAIIAx+fCALQiCIfIUgBnwgBEGIjQFqKQMAIgggBEGAjQFqKQMAIgl8hSEGIBpBC2opAwAgA30gCIUiCEL/////D4MiCyAaQQNqKQMAIAN8IAmFIglCIIgiDH4iDUL/////D4MgCEIgiCIIIAlC/////w+DIgl+fCALIAl+IglCIIh8IgtCIIYgCUL/////D4OEIA1CIIggCCAMfnwgC0IgiHyFIAV8IAcgCnyFIQUgBEEgaiEEIBlBf2oiGQ0ACwsgACACQf8AaikDACADfCABQeiLAWopAwAiB4UiCEL/////D4MiCSACKQN3IAN9IAFB4IsBaikDACIKhSILQiCIIgx+Ig1C/////w+DIAhCIIgiCCALQv////8PgyILfnwgCSALfiIJQiCIfCILQiCGIAlC/////w+DhCANQiCIIAggDH58IAtCIIh8hSAGfCABQfiLAWopAwAiBiABQfCLAWopAwAiCHyFIgkgAkHvAGopAwAgA3wgBoUiBkL/////D4MiCyACKQNnIAN9IAiFIghCIIgiDH4iDUL/////D4MgBkIgiCIGIAhC/////w+DIgh+fCALIAh+IghCIIh8IgtCIIYgCEL/////D4OEIA1CIIggBiAMfnwgC0IgiHyFIAV8IAcgCnyFIgZ8IgVCJYggBYVC+fPd8ZnymasWfiIFQiCIIAWFNwMAIABCACAGQoeVr6+Ytt6bnn9+IA8gA31Cz9bTvtLHq9lCfnwgCULj3MqV/M7y9YV/fnwiA0IliCADhUL5893xmfKZqxZ+IgNCIIggA4V9NwMIC98FAgF+AX8CQAJAQQApA4AKIgBQRQ0AQYAIIQFCACEADAELAkBBACkDoI4BIABSDQBBACEBDAELQQAhAUEAQq+v79e895Kg/gAgAH03A/iLAUEAIABCxZbr+djShYIofDcD8IsBQQBCj/Hjja2P9JhOIAB9NwPoiwFBACAAQqus+MXV79HQfHw3A+CLAUEAQtOt1LKShbW0nn8gAH03A9iLAUEAIABCl5r0jvWWvO3JAHw3A9CLAUEAQsWDgv2v/8SxayAAfTcDyIsBQQAgAELqi7OdyOb09UN8NwPAiwFBAELIv/rLnJveueQAIAB9NwO4iwFBACAAQoqjgd/Ume2sMXw3A7CLAUEAQvm57738+MKnHSAAfTcDqIsBQQAgAEKo9dv7s5ynmj98NwO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hqKQMANwMAIABBEGogC0EQaikDADcDACAAQRhqIAtBGGopAwA3AwAgAEEgaiALQSBqKQMANwMAIABBKGogC0EoaikDADcDACAAQTBqIAtBMGopAwA3AwAgAEE4aiALQThqKQMANwMAIABBwABqIQAgC0HAAGohCyANQUBqIg1BB0sNAAsLIA1FDQELIA1Bf2ohDwJAIA1BB3EiDkUNACANQXhxIQ0DQCAAIAstAAA6AAAgAEEBaiEAIAtBAWohCyAOQX9qIg4NAAsLIA9BB0kNAANAIAAgCykAADcAACAAQQhqIQAgC0EIaiELIA1BeGoiDQ0ACwsgAkHAAGogDGohC0GAjAEhAAJAAkACQCAHQQhJDQACQCAHQThqQQN2QQFqQQdxIg0NAAwCCyANQQN0IQ5BgIwBIQADQCALIAApAwA3AwAgC0EIaiELIABBCGohACANQX9qIg0NAAsgByAOayEHCyAHRQ0BAkACQCAHQQdxIg4NACAHIQ0MAQsgB0F4cSENA0AgCyAALQAAOgAAIAtBAWohCyAAQQFqIQAgDkF/aiIODQALCyAHQQhJDQELA0AgCyAAKQAANwAAIAtBCGohCyAAQQhqIQAgDUF4aiINDQALCyACIAIpAwggAikDQCIIfCADQQAoApyOAWoiACkDASACKQNIIgmFIgpCIIggCkL/////D4N+fDcDCCACIAIpAxggAikDUCIKfCAAKQMRIAIpA1giEIUiEUIgiCARQv////8Pg358NwMYIAIgECAKIAApAwmFIgpCIIggCkL/////D4N+IAIpAxB8fDcDECACIAkgCCAAQXlqKQMAhSIIQiCIIAhC/////w+DfiACKQMAfHw3AwAgACkDGSEIIAIpAyAhCSACIAIpAyggAikDYCIKfCAAKQMhIAIpA2giEIUiEUIgiCARQv////8Pg358NwMoIAIgECAJIAggCoUiCEIgiCAIQv////8Pg358fDcDICACIAYgAikDcCIIfCAAKQMxIAIpA3giBoUiCUIgiCAJQv////8Pg358NwM4IAIgBiAIIAApAymFIghCIIggCEL/////D4N+IAV8fDcDMAsgAiACIANBC2ogBEKHla+vmLbem55/fhADNwNAIAIgAiADQQAoApyOAWpBdWogBELP1tO+0ser2UJ+Qn+FEAM3A0gMAQsgBKchAAJAQQApA6COASIEUA0AAkAgAEEQSw0AIAJBwABqIABBgAggBBAEDAILAkAgAEGAAUsNACACQcAAaiAAQYAIIAQQBQwCCyACQcAAaiAAQYAIIAQQBgwBCwJAIABBEEsNACACQcAAaiAAIANCABAEDAELAkAgAEGAAUsNACACQcAAaiAAIANCABAFDAELIAJBwABqIAAgA0IAEAYLQQAgAikDcDcDuApBACACKQNgNwOoCkEAIAIpA1A3A5gKQQAgAkH4AGopAwA3A8AKQQAgAkHoAGopAwA3A7AKQQAgAkHYAGopAwA3A6AKQQAgAikDSCIEQjiGIARCgP4Dg0IohoQgBEKAgPwHg0IYhiAEQoCAgPgPg0IIhoSEIARCCIhCgICA+A+DIARCGIhCgID8B4OEIARCKIhCgP4DgyAEQjiIhISEIgQ3A4AKQQAgBDcDkApBACACKQNAIgRCOIYgBEKA/gODQiiGhCAEQoCA/AeDQhiGIARCgICA+A+DQgiGhIQgBEIIiEKAgID4D4MgBEIYiEKAgPwHg4QgBEIoiEKA/gODIARCOIiEhIQ3A4gKIAEkAAsGAEGAigELAgALC8wBAQBBgAgLxAG4/mw5I6RLvnwBgSz3Ia0c3tRt6YOQl9tyQKSkt7NnH8t55k7MwOV4glrQfcz/ciG4CEZ090MkjuA1kOaBOiZMPChSu5HDAMuI0GWLG1Muo3FkSJeiDflOOBnvRqnerNio+nY/45w0P/ncu8fHC08dilHgS820WTHIn37J2XhzZOrFrIM00+vDxYGg//oTY+sXDd1Rt/DaSdMWVSYp1GieKxa+WH1HofyP+LjRetAxzkXLOo+VFgQor9f7yrtLQH5AAgAA"; - var hash$5 = "b9ab74e2"; - var wasmJson$5 = { - name: name$5, - data: data$5, - hash: hash$5 - }; - - const mutex$3 = new Mutex(); - let wasmCache$3 = null; - const seedBuffer = new Uint8Array(8); - function validateSeed(seed) { - if (!Number.isInteger(seed) || seed < 0 || seed > 0xffffffff) { - return new Error("Seed must be given as two valid 32-bit long unsigned integers (lo + high)."); - } - return null; - } - function writeSeed(arr, low, high) { - // write in little-endian format - const buffer = new DataView(arr); - buffer.setUint32(0, low, true); - buffer.setUint32(4, high, true); - } - /** - * Calculates xxHash128 hash - * @param data Input data (string, Buffer or TypedArray) - * @param seedLow Lower 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @param seedHigh Higher 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @returns Computed hash as a hexadecimal string - */ - function xxhash128(data, seedLow = 0, seedHigh = 0) { - if (validateSeed(seedLow)) { - return Promise.reject(validateSeed(seedLow)); - } - if (validateSeed(seedHigh)) { - return Promise.reject(validateSeed(seedHigh)); - } - if (wasmCache$3 === null) { - return lockedCreate(mutex$3, wasmJson$5, 16).then((wasm) => { - wasmCache$3 = wasm; - writeSeed(seedBuffer.buffer, seedLow, seedHigh); - wasmCache$3.writeMemory(seedBuffer); - return wasmCache$3.calculate(data); - }); - } - try { - writeSeed(seedBuffer.buffer, seedLow, seedHigh); - wasmCache$3.writeMemory(seedBuffer); - const hash = wasmCache$3.calculate(data); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } - } - /** - * Creates a new xxHash128 hash instance - * @param seedLow Lower 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @param seedHigh Higher 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - */ - function createXXHash128(seedLow = 0, seedHigh = 0) { - if (validateSeed(seedLow)) { - return Promise.reject(validateSeed(seedLow)); - } - if (validateSeed(seedHigh)) { - return Promise.reject(validateSeed(seedHigh)); - } - return WASMInterface(wasmJson$5, 16).then((wasm) => { - const instanceBuffer = new Uint8Array(8); - writeSeed(instanceBuffer.buffer, seedLow, seedHigh); - wasm.writeMemory(instanceBuffer); - wasm.init(); - const obj = { - init: () => { - wasm.writeMemory(instanceBuffer); - wasm.init(); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 512, - digestSize: 16, - }; - return obj; - }); - } - - var name$4 = "ripemd160"; - var data$4 = "AGFzbQEAAAABEQRgAAF/YAAAYAF/AGACf38AAwkIAAECAwIBAAIFBAEBAgIGDgJ/AUHgiQULfwBBgAgLB4MBCQZtZW1vcnkCAA5IYXNoX0dldEJ1ZmZlcgAACUhhc2hfSW5pdAABEHJpcGVtZDE2MF91cGRhdGUAAwtIYXNoX1VwZGF0ZQAECkhhc2hfRmluYWwABQ1IYXNoX0dldFN0YXRlAAYOSGFzaF9DYWxjdWxhdGUABwpTVEFURV9TSVpFAwEKzzIIBQBBgAkLOgBBAEHww8uefDYCmIkBQQBC/rnrxemOlZkQNwKQiQFBAEKBxpS6lvHq5m83AoiJAUEAQgA3AoCJAQuPLAEhf0EAIAAoAiQiASAAKAIAIgIgACgCECIDIAIgACgCLCIEIAAoAgwiBSAAKAIEIgYgACgCPCIHIAIgACgCMCIIIAcgACgCCCIJQQAoAoiJASIKQQAoApCJASILQQAoApSJASIMQX9zckEAKAKMiQEiDXNqIAAoAhQiDmpB5peKhQVqQQh3QQAoApiJASIPaiIQQQp3IhFqIAEgDUEKdyISaiACIAtBCnciE2ogDCAAKAIcIhRqIA8gACgCOCIVaiAQIA0gE0F/c3JzakHml4qFBWpBCXcgDGoiFiAQIBJBf3Nyc2pB5peKhQVqQQl3IBNqIhAgFiARQX9zcnNqQeaXioUFakELdyASaiIXIBAgFkEKdyIWQX9zcnNqQeaXioUFakENdyARaiIYIBcgEEEKdyIZQX9zcnNqQeaXioUFakEPdyAWaiIaQQp3IhtqIAAoAhgiECAYQQp3IhxqIAAoAjQiESAXQQp3IhdqIAMgGWogBCAWaiAaIBggF0F/c3JzakHml4qFBWpBD3cgGWoiFiAaIBxBf3Nyc2pB5peKhQVqQQV3IBdqIhcgFiAbQX9zcnNqQeaXioUFakEHdyAcaiIYIBcgF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AoAoiJATYCgAlBAEEAKQKMiQE3AoQJQQBBACkClIkBNwKMCSAAQRBqJAALBgBBgIkBC8EBAQF/IwBBEGsiASQAQQBB8MPLnnw2ApiJAUEAQv6568XpjpWZEDcCkIkBQQBCgcaUupbx6uZvNwKIiQFBAEIANwKAiQFBgAkgABADIAFBACgCgIkBIgBBA3Q2AgggAUEAKAKEiQFBA3QgAEEddnI2AgxBkAhBOEH4ACAAQT9xIgBBOEkbIABrEAMgAUEIakEIEANBAEEAKAKIiQE2AoAJQQBBACkCjIkBNwKECUEAQQApApSJATcCjAkgAUEQaiQACwtXAQBBgAgLUFwAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; - var hash$4 = "6abbce74"; - var wasmJson$4 = { - name: name$4, - data: data$4, - hash: hash$4 - }; - - const mutex$2 = new Mutex(); - let wasmCache$2 = null; - /** - * Calculates RIPEMD-160 hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ - function ripemd160(data) { - if (wasmCache$2 === null) { - return lockedCreate(mutex$2, wasmJson$4, 20).then((wasm) => { - wasmCache$2 = wasm; - return wasmCache$2.calculate(data); - }); - } - try { - const hash = wasmCache$2.calculate(data); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } - } - /** - * Creates a new RIPEMD-160 hash instance - */ - function createRIPEMD160() { - return WASMInterface(wasmJson$4, 20).then((wasm) => { - wasm.init(); - const obj = { - init: () => { - wasm.init(); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 64, - digestSize: 20, - }; - return obj; - }); - } - - function calculateKeyBuffer(hasher, key) { - const { blockSize } = hasher; - const buf = getUInt8Buffer(key); - if (buf.length > blockSize) { - hasher.update(buf); - const uintArr = hasher.digest("binary"); - hasher.init(); - return uintArr; - } - return new Uint8Array(buf.buffer, buf.byteOffset, buf.length); - } - function calculateHmac(hasher, key) { - hasher.init(); - const { blockSize } = hasher; - const keyBuf = calculateKeyBuffer(hasher, key); - const keyBuffer = new Uint8Array(blockSize); - keyBuffer.set(keyBuf); - const opad = new Uint8Array(blockSize); - for (let i = 0; i < blockSize; i++) { - const v = keyBuffer[i]; - opad[i] = v ^ 0x5c; - keyBuffer[i] = v ^ 0x36; - } - hasher.update(keyBuffer); - const obj = { - init: () => { - hasher.init(); - hasher.update(keyBuffer); - return obj; - }, - update: (data) => { - hasher.update(data); - return obj; - }, - digest: ((outputType) => { - const uintArr = hasher.digest("binary"); - hasher.init(); - hasher.update(opad); - hasher.update(uintArr); - return hasher.digest(outputType); - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - }), - save: () => { - throw new Error("save() not supported"); - }, - load: () => { - throw new Error("load() not supported"); - }, - blockSize: hasher.blockSize, - digestSize: hasher.digestSize, - }; - return obj; - } - /** - * Calculates HMAC hash - * @param hash Hash algorithm to use. It has to be the return value of a function like createSHA1() - * @param key Key (string, Buffer or TypedArray) - */ - function createHMAC(hash, key) { - if (!hash || !hash.then) { - throw new Error('Invalid hash function is provided! Usage: createHMAC(createMD5(), "key").'); - } - return hash.then((hasher) => calculateHmac(hasher, key)); - } - - function calculatePBKDF2(digest, salt, iterations, hashLength, outputType) { - return __awaiter(this, void 0, void 0, function* () { - const DK = new Uint8Array(hashLength); - const block1 = new Uint8Array(salt.length + 4); - const block1View = new DataView(block1.buffer); - const saltBuffer = getUInt8Buffer(salt); - const saltUIntBuffer = new Uint8Array(saltBuffer.buffer, saltBuffer.byteOffset, saltBuffer.length); - block1.set(saltUIntBuffer); - let destPos = 0; - const hLen = digest.digestSize; - const l = Math.ceil(hashLength / hLen); - let T = null; - let U = null; - for (let i = 1; i <= l; i++) { - block1View.setUint32(salt.length, i); - digest.init(); - digest.update(block1); - T = digest.digest("binary"); - U = T.slice(); - for (let j = 1; j < iterations; j++) { - digest.init(); - digest.update(U); - U = digest.digest("binary"); - for (let k = 0; k < hLen; k++) { - T[k] ^= U[k]; - } - } - DK.set(T.subarray(0, hashLength - destPos), destPos); - destPos += hLen; - } - if (outputType === "binary") { - return DK; - } - const digestChars = new Uint8Array(hashLength * 2); - return getDigestHex(digestChars, DK, hashLength); - }); - } - const validateOptions$2 = (options) => { - if (!options || typeof options !== "object") { - throw new Error("Invalid options parameter. It requires an object."); - } - if (!options.hashFunction || !options.hashFunction.then) { - throw new Error('Invalid hash function is provided! Usage: pbkdf2("password", "salt", 1000, 32, createSHA1()).'); - } - if (!Number.isInteger(options.iterations) || options.iterations < 1) { - throw new Error("Iterations should be a positive number"); - } - if (!Number.isInteger(options.hashLength) || options.hashLength < 1) { - throw new Error("Hash length should be a positive number"); - } - if (options.outputType === undefined) { - options.outputType = "hex"; - } - if (!["hex", "binary"].includes(options.outputType)) { - throw new Error(`Insupported output type ${options.outputType}. Valid values: ['hex', 'binary']`); - } - }; - /** - * Generates a new PBKDF2 hash for the supplied password - */ - function pbkdf2(options) { - return __awaiter(this, void 0, void 0, function* () { - validateOptions$2(options); - const hmac = yield createHMAC(options.hashFunction, options.password); - return calculatePBKDF2(hmac, options.salt, options.iterations, options.hashLength, options.outputType); - }); - } - - var name$3 = "scrypt"; - var data$3 = "AGFzbQEAAAABGwVgAX8Bf2AAAX9gBH9/f38AYAF/AGADf39/AAMGBQABAgMEBQYBAQKAgAIGCAF/AUGQiAQLBzkEBm1lbW9yeQIAEkhhc2hfU2V0TWVtb3J5U2l6ZQAADkhhc2hfR2V0QnVmZmVyAAEGc2NyeXB0AAQK7iYFWAECf0EAIQECQCAAQQAoAogIIgJGDQACQCAAIAJrIgBBEHYgAEGAgHxxIABJaiIAQABBf0cNAEH/AcAPC0EAIQFBAEEAKQOICCAAQRB0rXw3A4gICyABwAtwAQJ/AkBBACgCgAgiAA0AQQA/AEEQdCIANgKACEEAKAKICCIBQYCAIEYNAAJAQYCAICABayIAQRB2IABBgIB8cSAASWoiAEAAQX9HDQBBAA8LQQBBACkDiAggAEEQdK18NwOICEEAKAKACCEACyAAC6QFAQN/IAIgA0EHdCAAakFAaiIEKQMANwMAIAIgBCkDCDcDCCACIAQpAxA3AxAgAiAEKQMYNwMYIAIgBCkDIDcDICACIAQpAyg3AyggAiAEKQMwNwMwIAIgBCkDODcDOAJAIANFDQAgA0EBdCEFIANBBnQhBkEAIQMDQCACIAIpAwAgACkDAIU3AwAgAiACKQMIIABBCGopAwCFNwMIIAIgAikDECAAQRBqKQMAhTcDECACIAIpAxggAEEYaikDAIU3AxggAiACKQMgIABBIGopAwCFNwMgIAIgAikDKCAAQShqKQMAhTcDKCACIAIpAzAgAEEwaikDAIU3AzAgAiACKQM4IABBOGopAwCFNwM4IAIQAyABIAIpAwA3AwAgAUEIaiACKQMINwMAIAFBEGogAikDEDcDACABQRhqIAIpAxg3AwAgAUEgaiACKQMgNwMAIAFBKGogAikDKDcDACABQTBqIAIpAzA3AwAgAUE4aiACKQM4NwMAIAIgAikDACAAQcAAaikDAIU3AwAgAiACKQMIIABByABqKQMAhTcDCCACIAIpAxAgAEHQAGopAwCFNwMQIAIgAikDGCAAQdgAaikDAIU3AxggAiACKQMgIABB4ABqKQMAhTcDICACIAIpAyggAEHoAGopAwCFNwMoIAIgAikDMCAAQfAAaikDAIU3AzAgAiACKQM4IABB+ABqKQMAhTcDOCACEAMgASAGaiIEIAIpAwA3AwAgBEEIaiACKQMINwMAIARBEGogAikDEDcDACAEQRhqIAIpAxg3AwAgBEEgaiACKQMgNwMAIARBKGogAikDKDcDACAEQTBqIAIpAzA3AwAgBEE4aiACKQM4NwMAIABBgAFqIQAgAUHAAGohASADQQJqIgMgBUkNAAsLC7oNCAF+AX8BfgF/AX4BfwF+En8gACAAKAIEIAApAygiAUIgiKciAiAAKQM4IgNCIIinIgRqQQd3IAApAwgiBUIgiKdzIgY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FX8Bfg5/AkAgAkUNACAAQQd0IgNBQGoiBEEAKAKACCIFIAMgAmwiBmogAyABbGoiByADaiIIaiEJIAAgAkEHdCIKIAFBB3RqIgtsIQwgACALQYABamwhDSAAQQV0IgtBASALQQFLGyILQWBxIQ4gC0EBcSEPIAdBeGohECAHQXBqIREgB0FoaiESIAdBYGohEyAHQVhqIRQgB0FQaiEVIAdBSGohFiAHQUBqIRcgAa1Cf3whGCAEIAdqIRkgByAAQQh0IhpqIRsgACAKQYABamwhHCALQQRJIR1BACEeQQAhHwNAQQAoAoAIIiAgAyAfbGohIQJAIABFDQBBACEiAkAgHQ0AICAgHmohI0EAIQtBACEiA0AgByALaiIEICMgC2oiJCgCADYCACAEQQRqICRBBGooAgA2AgAgBEEIaiAkQQhqKAIANgIAIARBDGogJEEMaigCADYCACALQRBqIQsgDiAiQQRqIiJHDQALCyAPRQ0AIAcgIkECdCILaiAhIAtqKAIANgIACwJAIAFFDQBBACElIBwhIyAGISYDQCAFISQgACEiAkACQCAADQAgGyAXKQMANwMAIBsgFikDADcDCCAbIBUpAwA3AxAgGyAUKQMANwMYIBsgEykDADcDICAbIBIpAwA3AyggGyARKQMANwMwIBsgECkDADcDOAwBCwNAICQgJmoiCyAkIAxqIgQpAwA3AwAgC0EIaiAEQQhqKQMANwMAIAtBEGogBEEQaikDADcDACALQRhqIARBGGopAwA3AwAgC0EgaiAEQSBqKQMANwMAIAtBKGogBEEoaikDADcDACALQTBqIARBMGopAwA3AwAgC0E4aiAEQThqKQMANwMAIAtBwABqIARBwABqKQMANwMAIAtByABqIARByABqKQMANwMAIAtB0ABqIARB0ABqKQMANwMAIAtB2ABqIARB2ABqKQMANwMAIAtB4ABqIARB4ABqKQMANwMAIAtB6ABqIARB6ABqKQMANwMAIAtB8ABqIARB8ABqKQMANwMAIAtB+ABqIARB+ABqKQMANwMAICRBgAFqISQgIkF/aiIiDQALIAcgCCAbIAAQAiAFISQgACEiA0AgJCAjaiILICQgDWoiBCkDADcDACALQQhqIARBCGopAwA3AwAgC0EQaiAEQRBqKQMANwMAIAtBGGogBEEYaikDADcDACALQSBqIARBIGopAwA3AwAgC0EoaiAEQShqKQMANwMAIAtBMGogBEEwaikDADcDACALQThqIARBOGopAwA3AwAgC0HAAGogBEHAAGopAwA3AwAgC0HIAGogBEHIAGopAwA3AwAgC0HQAGogBEHQAGopAwA3AwAgC0HYAGogBEHYAGopAwA3AwAgC0HgAGogBEHgAGopAwA3AwAgC0HoAGogBEHoAGopAwA3AwAgC0HwAGogBEHwAGopAwA3AwAgC0H4AGogBEH4AGopAwA3AwAgJEGAAWohJCAiQX9qIiINAAsLIAggByAbIAAQAiAjIBpqISMgJiAaaiEmICVBAmoiJSABSQ0AC0EAISUDQAJAAkAgAA0AIBsgFykDADcDACAbIBYpAwA3AwggGyAVKQMANwMQIBsgFCkDADcDGCAbIBMpAwA3AyAgGyASKQMANwMoIBsgESkDADcDMCAbIBApAwA3AzgMAQsgACAKIBkpAgAgGIOnQQd0amwhJiAFISQgACEiA0AgJCAMaiILIAspAwAgJCAmaiIEKQMAhTcDACALQQhqIiMgIykDACAEQQhqKQMAhTcDACALQRBqIiMgIykDACAEQRBqKQMAhTcDACALQRhqIiMgIykDACAEQRhqKQMAhTcDACALQSBqIiMgIykDACAEQSBqKQMAhTcDACALQShqIiMgIykDACAEQShqKQMAhTcDACALQTBqIiMgIykDACAEQTBqKQMAhTcDACALQThqIiMgIykDACAEQThqKQMAhTcDACALQcAAaiIjICMpAwAgBEHAAGopAwCFNwMAIAtByABqIiMgIykDACAEQcgAaikDAIU3AwAgC0HQAGoiIyAjKQMAIARB0ABqKQMAhTcDACALQdgAaiIjICMpAwAgBEHYAGopAwCFNwMAIAtB4ABqIiMgIykDACAEQeAAaikDAIU3AwAgC0HoAGoiIyAjKQMAIARB6ABqKQMAhTcDACALQfAAaiIjICMpAwAgBEHwAGopAwCFNwMAIAtB+ABqIgsgCykDACAEQfgAaikDAIU3AwAgJEGAAWohJCAiQX9qIiINAAsgByAIIBsgABACIAAgCiAJKQIAIBiDp0EHdGpsISYgBSEkIAAhIgNAICQgDWoiCyALKQMAICQgJmoiBCkDAIU3AwAgC0EIaiIjICMpAwAgBEEIaikDAIU3AwAgC0EQaiIjICMpAwAgBEEQaikDAIU3AwAgC0EYaiIjICMpAwAgBEEYaikDAIU3AwAgC0EgaiIjICMpAwAgBEEgaikDAIU3AwAgC0EoaiIjICMpAwAgBEEoaikDAIU3AwAgC0EwaiIjICMpAwAgBEEwaikDAIU3AwAgC0E4aiIjICMpAwAgBEE4aikDAIU3AwAgC0HAAGoiIyAjKQMAIARBwABqKQMAhTcDACALQcgAaiIjICMpAwAgBEHIAGopAwCFNwMAIAtB0ABqIiMgIykDACAEQdAAaikDAIU3AwAgC0HYAGoiIyAjKQMAIARB2ABqKQMAhTcDACALQeAAaiIjICMpAwAgBEHgAGopAwCFNwMAIAtB6ABqIiMgIykDACAEQegAaikDAIU3AwAgC0HwAGoiIyAjKQMAIARB8ABqKQMAhTcDACALQfgAaiILIAspAwAgBEH4AGopAwCFNwMAICRBgAFqISQgIkF/aiIiDQALCyAIIAcgGyAAEAIgJUECaiIlIAFJDQALCwJAIABFDQBBACEiAkAgHQ0AICAgHmohI0EAIQtBACEiA0AgIyALaiIEIAcgC2oiJCgCADYCACAEQQRqICRBBGooAgA2AgAgBEEIaiAkQQhqKAIANgIAIARBDGogJEEMaigCADYCACALQRBqIQsgDiAiQQRqIiJHDQALCyAPRQ0AICEgIkECdCILaiAHIAtqKAIANgIACyAeIANqIR4gH0EBaiIfIAJHDQALCws="; - var hash$3 = "b32721f8"; - var wasmJson$3 = { - name: name$3, - data: data$3, - hash: hash$3 - }; - - function scryptInternal(options) { - return __awaiter(this, void 0, void 0, function* () { - const { costFactor, blockSize, parallelism, hashLength } = options; - const SHA256Hasher = createSHA256(); - const blockData = yield pbkdf2({ - password: options.password, - salt: options.salt, - iterations: 1, - hashLength: 128 * blockSize * parallelism, - hashFunction: SHA256Hasher, - outputType: "binary", - }); - const scryptInterface = yield WASMInterface(wasmJson$3, 0); - // last block is for storing the temporary vectors - const VSize = 128 * blockSize * costFactor; - const XYSize = 256 * blockSize; - scryptInterface.setMemorySize(blockData.length + VSize + XYSize); - scryptInterface.writeMemory(blockData, 0); - // mix blocks - scryptInterface.getExports().scrypt(blockSize, costFactor, parallelism); - const expensiveSalt = scryptInterface - .getMemory() - .subarray(0, 128 * blockSize * parallelism); - const outputData = yield pbkdf2({ - password: options.password, - salt: expensiveSalt, - iterations: 1, - hashLength, - hashFunction: SHA256Hasher, - outputType: "binary", - }); - if (options.outputType === "hex") { - const digestChars = new Uint8Array(hashLength * 2); - return getDigestHex(digestChars, outputData, hashLength); - } - // return binary format - return outputData; - }); - } - const isPowerOfTwo = (v) => v && !(v & (v - 1)); - const validateOptions$1 = (options) => { - if (!options || typeof options !== "object") { - throw new Error("Invalid options parameter. It requires an object."); - } - if (!Number.isInteger(options.blockSize) || options.blockSize < 1) { - throw new Error("Block size should be a positive number"); - } - if (!Number.isInteger(options.costFactor) || - options.costFactor < 2 || - !isPowerOfTwo(options.costFactor)) { - throw new Error("Cost factor should be a power of 2, greater than 1"); - } - if (!Number.isInteger(options.parallelism) || options.parallelism < 1) { - throw new Error("Parallelism should be a positive number"); - } - if (!Number.isInteger(options.hashLength) || options.hashLength < 1) { - throw new Error("Hash length should be a positive number."); - } - if (options.outputType === undefined) { - options.outputType = "hex"; - } - if (!["hex", "binary"].includes(options.outputType)) { - throw new Error(`Insupported output type ${options.outputType}. Valid values: ['hex', 'binary']`); - } - }; - /** - * Calculates hash using the scrypt password-based key derivation function - * @returns Computed hash as a hexadecimal string or as - * Uint8Array depending on the outputType option - */ - function scrypt(options) { - return __awaiter(this, void 0, void 0, function* () { - validateOptions$1(options); - return scryptInternal(options); - }); - } - - var name$2 = "bcrypt"; - var data$2 = "AGFzbQEAAAABFwRgAAF/YAR/f39/AGADf39/AGABfwF/AwUEAAECAwUEAQECAgYIAX8BQZCrBQsHNAQGbWVtb3J5AgAOSG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+hNjtwwOGJYnTeR+SCTwpB66s57PvtkziFRMr5Pd37jtqhGPSnDaVPeSIDmE2QQCK6iJLJt3f0thWlmIQcJCkaas93ARWTP3mxYrsggHN33vltAjVgbfwHSzLvjtGt+aqLdRf9ZOkQKNT7VzbS8qM7qcruEZPquEmaNR288v2Pkm9KeXS9UG3fCrnBjTvaNDQ50VxNb53EWcvhdfVOvCMtAQMzitE5qRtI0hK8VASgEsOEdOpiVtJ+4Bkigbs6COz9vgqsgNUsdGgH4J3InsWAVYdw/k+creTq7vSVFNOE5iKBLec5Rt8kyL8m6H6B+yBzg9tHHvMMRAc/HquihSYeQGpq9T9TL3trQONoK1SrDOQNnNpHGfDH5jU8rseC3WZ73Orv1Q/8Z1fKcRdknLCKXvyr85hVx/JEPJRWUm2GT5frrnLbOWWSowtGouhJeB8G2DGoF42VQ0hBCpAPLDm7s4DvbmBa+oJhMZOl4MjKVH5/fktPgKzSg0x7ycYlBdAobjDSjSyBxvsXYMnbDjZ813y4vmZtHbwvmHfHjD1TaTOWR2Noez3lizm9+Ps1msRgWBR0s/cXSj4SZIvv2V/Mj9SN2MqYxNaiTAs3MVmKB8Ky163ValzYWbsxz0oiSYpbe0Em5gRuQUEwUVsZxvcfG5goUejIG0OFFmnvyw/1TqskAD6hi4r8lu/bSvTUFaRJxIgIEsnzPy7YrnHbNwD4RU9PjQBZgvas48K1HJZwgOLp2zkb3xaGvd2BgdSBO/suF2I3oirD5qnp+qvlMXMJIGYyK+wLkasMB+eHr1mn41JCg3lymLSUJP5/mCMIyYU63W+J3zuPfj1fmcsM6iGo/JNMIo4UuihkTRHNwAyI4CaTQMZ8pmPouCIlsTuzmIShFdxPQOM9mVL5sDOk0tymswN1QfMm11YQ/FwlHtdnVFpIb+3mJ"; - var hash$2 = "8bd8822d"; - var wasmJson$2 = { - name: name$2, - data: data$2, - hash: hash$2 - }; - - function bcryptInternal(options) { - return __awaiter(this, void 0, void 0, function* () { - const { costFactor, password, salt } = options; - const bcryptInterface = yield WASMInterface(wasmJson$2, 0); - bcryptInterface.writeMemory(getUInt8Buffer(salt), 0); - const passwordBuffer = getUInt8Buffer(password); - bcryptInterface.writeMemory(passwordBuffer, 16); - const shouldEncode = options.outputType === "encoded" ? 1 : 0; - bcryptInterface - .getExports() - .bcrypt(passwordBuffer.length, costFactor, shouldEncode); - const memory = bcryptInterface.getMemory(); - if (options.outputType === "encoded") { - return intArrayToString(memory, 60); - } - if (options.outputType === "hex") { - const digestChars = new Uint8Array(24 * 2); - return getDigestHex(digestChars, memory, 24); - } - // return binary format - // the data is copied to allow GC of the original memory buffer - return memory.slice(0, 24); - }); - } - const validateOptions = (options) => { - if (!options || typeof options !== "object") { - throw new Error("Invalid options parameter. It requires an object."); - } - if (!Number.isInteger(options.costFactor) || - options.costFactor < 4 || - options.costFactor > 31) { - throw new Error("Cost factor should be a number between 4 and 31"); - } - options.password = getUInt8Buffer(options.password); - if (options.password.length < 1) { - throw new Error("Password should be at least 1 byte long"); - } - if (options.password.length > 72) { - throw new Error("Password should be at most 72 bytes long"); - } - options.salt = getUInt8Buffer(options.salt); - if (options.salt.length !== 16) { - throw new Error("Salt should be 16 bytes long"); - } - if (options.outputType === undefined) { - options.outputType = "encoded"; - } - if (!["hex", "binary", "encoded"].includes(options.outputType)) { - throw new Error(`Insupported output type ${options.outputType}. Valid values: ['hex', 'binary', 'encoded']`); - } - }; - /** - * Calculates hash using the bcrypt password-hashing function - * @returns Computed hash - */ - function bcrypt(options) { - return __awaiter(this, void 0, void 0, function* () { - validateOptions(options); - return bcryptInternal(options); - }); - } - const validateHashCharacters = (hash) => { - if (!/^\$2[axyb]\$[0-3][0-9]\$[./A-Za-z0-9]{53}$/.test(hash)) { - return false; - } - if (hash[4] === "0" && Number(hash[5]) < 4) { - return false; - } - if (hash[4] === "3" && Number(hash[5]) > 1) { - return false; - } - return true; - }; - const validateVerifyOptions = (options) => { - if (!options || typeof options !== "object") { - throw new Error("Invalid options parameter. It requires an object."); - } - if (options.hash === undefined || typeof options.hash !== "string") { - throw new Error("Hash should be specified"); - } - if (options.hash.length !== 60) { - throw new Error("Hash should be 60 bytes long"); - } - if (!validateHashCharacters(options.hash)) { - throw new Error("Invalid hash"); - } - options.password = getUInt8Buffer(options.password); - if (options.password.length < 1) { - throw new Error("Password should be at least 1 byte long"); - } - if (options.password.length > 72) { - throw new Error("Password should be at most 72 bytes long"); - } - }; - /** - * Verifies password using bcrypt password-hashing function - * @returns True if the encoded hash matches the password - */ - function bcryptVerify(options) { - return __awaiter(this, void 0, void 0, function* () { - validateVerifyOptions(options); - const { hash, password } = options; - const bcryptInterface = yield WASMInterface(wasmJson$2, 0); - bcryptInterface.writeMemory(getUInt8Buffer(hash), 0); - const passwordBuffer = getUInt8Buffer(password); - bcryptInterface.writeMemory(passwordBuffer, 60); - return !!bcryptInterface.getExports().bcrypt_verify(passwordBuffer.length); - }); - } - - var name$1 = "whirlpool"; - var data$1 = "AGFzbQEAAAABEQRgAAF/YAF/AGACf38AYAAAAwkIAAECAwEDAAEFBAEBAgIGDgJ/AUHQmwULfwBBgAgLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAJSGFzaF9Jbml0AAMLSGFzaF9VcGRhdGUABApIYXNoX0ZpbmFsAAUNSGFzaF9HZXRTdGF0ZQAGDkhhc2hfQ2FsY3VsYXRlAAcKU1RBVEVfU0laRQMBCu0bCAUAQYAZC8wGAQl+IAApAwAhAUEAQQApA4CbASICNwPAmQEgACkDGCEDIAApAxAhBCAAKQMIIQVBAEEAKQOYmwEiBjcD2JkBQQBBACkDkJsBIgc3A9CZAUEAQQApA4ibASIINwPImQFBACABIAKFNwOAmgFBACAFIAiFNwOImgFBACAEIAeFNwOQmgFBACADIAaFNwOYmgEgACkDICEDQQBBACkDoJsBIgE3A+CZAUEAIAMgAYU3A6CaASAAKQMoIQRBAEEAKQOomwEiAzcD6JkBQQAgBCADhTcDqJoBIAApAzAhBUEAQQApA7CbASIENwPwmQFBACAFIASFNwOwmgEgACkDOCEJQ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zHLyVtbaltT8TaIg0NNA1oORpl+vrP+oM16Xnf31vftoSjaX5+5X7Xm/ypJCSQJD20SBk7O+w7xdd2/qurlqsxPUuazs4fzj7RgfAREUQRiFUimY+PBo8MiQODTk4lTkprnAS3t+a30VFzZuvri+sLYMvgPDzwPP3MeMGBgT6BfL8f/ZSUapTU/jVA9/f79+sM8xy5ud65oWdvGBMTTBOYXyaLLCywLH2cWFHT02vT1ri7Befnu+drXNOMbm6lblfL3DnExDfEbvOVqgMDDAMYDwYbVlZFVooTrNxERA1EGkmIXn9/4X/fnv6gqameqSE3T4gqKqgqTYJUZ7u71ruxbWsKwcEjwUbin4dTU1FTogKm8dzcV9yui6VyCwssC1gnFlOdnU6dnNMnAWxsrWxHwdgrMTHEMZX1YqR0dM10h7no8/b2//bjCfEVRkYFRgpDjEysrIqsCSZFpYmJHok8lw+1FBRQFKBEKLTh4aPhW0LfuhYWWBawTiymOjroOs3SdPdpablpb9DSBgkJJAlILRJBcHDdcKet4Ne2tuK22VRxb9DQZ9DOt70e7e2T7Tt+x9bMzBfMLtuF4kJCFUIqV4RomJhamLTCLSykpKqkSQ5V7SgooChdiFB1XFxtXNoxuIb4+Mf4kz/ta4aGIoZEpBHC"; - var hash$1 = "8d8f6035"; - var wasmJson$1 = { - name: name$1, - data: data$1, - hash: hash$1 - }; - - const mutex$1 = new Mutex(); - let wasmCache$1 = null; - /** - * Calculates Whirlpool hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ - function whirlpool(data) { - if (wasmCache$1 === null) { - return lockedCreate(mutex$1, wasmJson$1, 64).then((wasm) => { - wasmCache$1 = wasm; - return wasmCache$1.calculate(data); - }); - } - try { - const hash = wasmCache$1.calculate(data); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } - } - /** - * Creates a new Whirlpool hash instance - */ - function createWhirlpool() { - return WASMInterface(wasmJson$1, 64).then((wasm) => { - wasm.init(); - const obj = { - init: () => { - wasm.init(); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 64, - digestSize: 64, - }; - return obj; - }); - } - - var name = "sm3"; - var data = "AGFzbQEAAAABDANgAAF/YAAAYAF/AAMIBwABAgIBAAIFBAEBAgIGDgJ/AUHwiQULfwBBgAgLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAJSGFzaF9Jbml0AAELSGFzaF9VcGRhdGUAAgpIYXNoX0ZpbmFsAAQNSGFzaF9HZXRTdGF0ZQAFDkhhc2hfQ2FsY3VsYXRlAAYKU1RBVEVfU0laRQMBCtodBwUAQYAJC1EAQQBCzdy3nO7Jw/2wfzcCoIkBQQBCvOG8y6qVzpgWNwKYiQFBAELXhZG5gcCBxVo3ApCJAUEAQu+sgJyX16yKyQA3AoiJAUEAQgA3AoCJAQvvAwEIfwJAIABFDQBBACEBQQBBACgCgIkBIgIgAGoiAzYCgIkBIAJBP3EhBAJAIAMgAk8NAEEAQQAoAoSJAUEBajYChIkBC0GACSECAkAgBEUNAAJAIABBwAAgBGsiBU8NACAEIQEMAQsgBEE/cyEGIARBqIkBaiECQYAJIQMCQAJAIAVBB3EiBw0AIAUhCAwBCyAHIQgDQCACIAMtAAA6AAAgAkEBaiECIANBAWohAyAIQX9qIggNAAtBwAAgByAEamshCAsCQCAGQQdJDQADQCACIAMpAAA3AAAgAkEIaiECIANBCGohAyAIQXhqIggNAAsLQaiJARADIAVBgAlqIQIgACAFayEACwJAIABBwABJDQADQCACEAMgAkHAAGohAiAAQUBqIgBBP0sNAAsLIABFDQAgAUGoiQFqIQMCQAJAIABBB3EiCA0AIAAhBAwBCyAAQThxIQQDQCADIAItAAA6AAAgA0EBaiEDIAJBAWohAiAIQX9qIggNAAsLIABBCEkNAANAIAMgAi0AADoAACADIAItAAE6AAEgAyACLQACOgACIAMgAi0A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qIQEgAEF4aiIADQALCxAECwtRAgBBgAgLBGgAAAAAQZAIC0CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; - var hash = "b6fb4b8e"; - var wasmJson = { - name: name, - data: data, - hash: hash - }; - - const mutex = new Mutex(); - let wasmCache = null; - /** - * Calculates SM3 hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ - function sm3(data) { - if (wasmCache === null) { - return lockedCreate(mutex, wasmJson, 32).then((wasm) => { - wasmCache = wasm; - return wasmCache.calculate(data); - }); - } - try { - const hash = wasmCache.calculate(data); - return Promise.resolve(hash); - } - catch (err) { - return Promise.reject(err); - } - } - /** - * Creates a new SM3 hash instance - */ - function createSM3() { - return WASMInterface(wasmJson, 32).then((wasm) => { - wasm.init(); - const obj = { - init: () => { - wasm.init(); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType), - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 64, - digestSize: 32, - }; - return obj; - }); - } - - exports.adler32 = adler32; - exports.argon2Verify = argon2Verify; - exports.argon2d = argon2d; - exports.argon2i = argon2i; - exports.argon2id = argon2id; - exports.bcrypt = bcrypt; - exports.bcryptVerify = bcryptVerify; - exports.blake2b = blake2b; - exports.blake2s = blake2s; - exports.blake3 = blake3; - exports.crc32 = crc32; - exports.crc64 = crc64; - exports.createAdler32 = createAdler32; - exports.createBLAKE2b = createBLAKE2b; - exports.createBLAKE2s = createBLAKE2s; - exports.createBLAKE3 = createBLAKE3; - exports.createCRC32 = createCRC32; - exports.createCRC64 = createCRC64; - exports.createHMAC = createHMAC; - exports.createKeccak = createKeccak; - exports.createMD4 = createMD4; - exports.createMD5 = createMD5; - exports.createRIPEMD160 = createRIPEMD160; - exports.createSHA1 = createSHA1; - exports.createSHA224 = createSHA224; - exports.createSHA256 = createSHA256; - exports.createSHA3 = createSHA3; - exports.createSHA384 = createSHA384; - exports.createSHA512 = createSHA512; - exports.createSM3 = createSM3; - exports.createWhirlpool = createWhirlpool; - exports.createXXHash128 = createXXHash128; - exports.createXXHash3 = createXXHash3; - exports.createXXHash32 = createXXHash32; - exports.createXXHash64 = createXXHash64; - exports.keccak = keccak; - exports.md4 = md4; - exports.md5 = md5; - exports.pbkdf2 = pbkdf2; - exports.ripemd160 = ripemd160; - exports.scrypt = scrypt; - exports.sha1 = sha1; - exports.sha224 = sha224; - exports.sha256 = sha256; - exports.sha3 = sha3; - exports.sha384 = sha384; - exports.sha512 = sha512; - exports.sm3 = sm3; - exports.whirlpool = whirlpool; - exports.xxhash128 = xxhash128; - exports.xxhash3 = xxhash3; - exports.xxhash32 = xxhash32; - exports.xxhash64 = xxhash64; - -})); diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/index.umd.min.js b/tools/mnemonic-test/node_modules/hash-wasm/dist/index.umd.min.js deleted file mode 100644 index 134fa2ac..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/index.umd.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * hash-wasm (https://www.npmjs.com/package/hash-wasm) - * (c) Dani Biro - * @license MIT - */ - -!function(A,I){"object"==typeof exports&&"undefined"!=typeof module?I(exports):"function"==typeof define&&define.amd?define(["exports"],I):I((A="undefined"!=typeof globalThis?globalThis:A||self).hashwasm={})}(this,(function(A){"use strict";var I,B={name:"adler32",data:"AGFzbQEAAAABDANgAAF/YAAAYAF/AAMHBgABAgEAAgUEAQECAgYOAn8BQYCJBQt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQAAQtIYXNoX1VwZGF0ZQACCkhhc2hfRmluYWwAAw1IYXNoX0dldFN0YXRlAAQOSGFzaF9DYWxjdWxhdGUABQpTVEFURV9TSVpFAwEK6wkGB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QgAUEIdkH/AXFqIgRqIAQgAUEQdkH/AXFqIgRqIAQgAUEYdmoiBGogBCAGQQxqKAIAIgFB/wFxaiIEaiAEIAFBCHZB/wFxaiIEaiAEIAFBEHZB/wFxaiIEaiAEIAFBGHZqIgJqIQMgBkEQaiEGIABBcGoiAEEPSw0ACyAARQ0BCyAAQX9qIQcCQCAAQQNxIgVFDQAgAEF8cSEAIAUhBCAGIQEDQCACIAEtAABqIgIgA2ohAyABQQFqIQEgBEF/aiIEDQALIAYgBWohBgsgB0EDSQ0AA0AgAiAGLQAAaiIBIAYtAAFqIgQgBi0AAmoiBSAGQQNqLQAAaiICIAUgBCABIANqampqIQMgBkEEaiEGIABBfGoiAA0ACwsgA0Hx/wNwIQMgAkHx/wNwIQILIAIgA0EQdHIhAQtBACABNgKECAsxAQF/QQBBACgChAgiAEEYdCAAQYD+A3FBCHRyIABBCHZBgP4DcSAAQRh2cnI2AoAJCwUAQYQICzsAQQBBATYChAggABACQQBBACgChAgiAEEYdCAAQYD+A3FBCHRyIABBCHZBgP4DcSAAQRh2cnI2AoAJCwsVAgBBgAgLBAQAAAAAQYQICwQBAAAA",hash:"02ddbd17"};function g(A,I,B,g){return new(B||(B=Promise))((function(Q,C){function i(A){try{o(g.next(A))}catch(A){C(A)}}function E(A){try{o(g.throw(A))}catch(A){C(A)}}function o(A){var I;A.done?Q(A.value):(I=A.value,I instanceof B?I:new B((function(A){A(I)}))).then(i,E)}o((g=g.apply(A,I||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class Q{constructor(){this.mutex=Promise.resolve()}lock(){let A=()=>{};return this.mutex=this.mutex.then((()=>new Promise(A))),new Promise((I=>{A=I}))}dispatch(A){return g(this,void 0,void 0,(function*(){const I=yield this.lock();try{return yield Promise.resolve(A())}finally{I()}}))}}const C="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,i=null!==(I=C.Buffer)&&void 0!==I?I:null,E=C.TextEncoder?new C.TextEncoder:null;function o(A,I){return(15&A)+(A>>6|A>>3&8)<<4|(15&I)+(I>>6|I>>3&8)}function F(A,I){const B=I.length>>1;for(let g=0;g>>4;A[g++]=B>9?B+D:B+c,B=15&I[Q],A[g++]=B>9?B+D:B+c}return String.fromCharCode.apply(null,A)}const a=null!==i?A=>{if("string"==typeof A){const I=i.from(A,"utf8");return new Uint8Array(I.buffer,I.byteOffset,I.length)}if(i.isBuffer(A))return new Uint8Array(A.buffer,A.byteOffset,A.length);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")}:A=>{if("string"==typeof A)return E.encode(A);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")},w="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",k=new Uint8Array(256);for(let A=0;A>18&63)+w.charAt(B>>12&63)+w.charAt(B>>6&63)+w.charAt(63&B);Q.push(g)}if(1===g){const g=A[B-1],C=w.charAt(g>>2),i=w.charAt(g<<4&63);Q.push(`${C}${i}`),I&&Q.push("==")}else if(2===g){const g=(A[B-2]<<8)+A[B-1],C=w.charAt(g>>10),i=w.charAt(g>>4&63),E=w.charAt(g<<2&63);Q.push(`${C}${i}${E}`),I&&Q.push("=")}return Q.join("")}function n(A){let I=Math.floor(.75*A.length);const B=A.length;return"="===A[B-1]&&(I-=1,"="===A[B-2]&&(I-=1)),I}function d(A){const I=n(A),B=A.length,g=new Uint8Array(I);let Q=0;for(let I=0;I>4,Q+=1,g[Q]=(15&C)<<4|i>>2,Q+=1,g[Q]=(3&i)<<6|63&E,Q+=1}return g}const y=16384,H=new Q,U=new Map;function e(A,I){return g(this,void 0,void 0,(function*(){let B=null,Q=null,C=!1;if("undefined"==typeof WebAssembly)throw new Error("WebAssembly is not supported in this environment!");const i=()=>new DataView(B.exports.memory.buffer).getUint32(B.exports.STATE_SIZE,!0),E=H.dispatch((()=>g(this,void 0,void 0,(function*(){if(!U.has(A.name)){const I=d(A.data),B=WebAssembly.compile(I);U.set(A.name,B)}const I=yield U.get(A.name);B=yield WebAssembly.instantiate(I,{})})))),D=(A=null)=>{C=!0,B.exports.Hash_Init(A)},c=A=>{if(!C)throw new Error("update() called before init()");(A=>{let I=0;for(;I{if(!C)throw new Error("digest() called before init()");return C=!1,B.exports.Hash_Final(g),"binary"===A?Q.slice(0,I):h(w,Q,I)},G=A=>"string"==typeof A?A.length<4096:A.byteLength!0;break;case"blake2b":case"blake2s":n=(A,I)=>I<=512&&G(A);break;case"blake3":n=(A,I)=>0===I&&G(A);break;case"xxhash64":case"xxhash3":case"xxhash128":case"crc64":n=()=>!1}return yield(()=>g(this,void 0,void 0,(function*(){B||(yield E);const A=B.exports.Hash_GetBuffer(),I=B.exports.memory.buffer;Q=new Uint8Array(I,A,y)})))(),{getMemory:()=>Q,writeMemory:(A,I=0)=>{Q.set(A,I)},getExports:()=>B.exports,setMemorySize:A=>{B.exports.Hash_SetMemorySize(A);const I=B.exports.Hash_GetBuffer(),g=B.exports.memory.buffer;Q=new Uint8Array(g,I,A)},init:D,update:c,digest:k,save:()=>{if(!C)throw new Error("save() can only be called after init() and before digest()");const I=B.exports.Hash_GetState(),g=i(),Q=B.exports.memory.buffer,E=new Uint8Array(Q,I,g),o=new Uint8Array(4+g);return F(o,A.hash),o.set(E,4),o},load:I=>{if(!(I instanceof Uint8Array))throw new Error("load() expects an Uint8Array generated by save()");const g=B.exports.Hash_GetState(),Q=i(),E=4+Q,F=B.exports.memory.buffer;if(I.length!==E)throw new Error(`Bad state length (expected ${E} bytes, got ${I.length})`);if(!function(A,I){if(A.length!==2*I.length)return!1;for(let B=0;B{if(!n(A,g))return D(g),c(A),k("hex",C);const i=a(A);return Q.set(i),B.exports.Hash_Calculate(i.length,g,C),h(w,Q,I)},hashLength:I}}))}function S(A,I,B){return g(this,void 0,void 0,(function*(){const g=yield A.lock(),Q=yield e(I,B);return g(),Q}))}const N=new Q;let t=null;var J={name:"argon2",data:"AGFzbQEAAAABKQVgAX8Bf2AAAX9gEH9/f39/f39/f39/f39/f38AYAR/f39/AGACf38AAwYFAAECAwQFBgEBAoCAAgYIAX8BQZCoBAsHQQQGbWVtb3J5AgASSGFzaF9TZXRNZW1vcnlTaXplAAAOSGFzaF9HZXRCdWZmZXIAAQ5IYXNoX0NhbGN1bGF0ZQAECvEyBVgBAn9BACEBAkAgAEEAKAKICCICRg0AAkAgACACayIAQRB2IABBgIB8cSAASWoiAEAAQX9HDQBB/wHADwtBACEBQQBBACkDiAggAEEQdK18NwOICAsgAcALcAECfwJAQQAoAoAIIgANAEEAPwBBEHQiADYCgAhBACgCiAgiAUGAgCBGDQACQEGAgCAgAWsiAEEQdiAAQYCAfHEgAElqIgBAAEF/Rw0AQQAPC0EAQQApA4gIIABBEHStfDcDiAhBACgCgAghAAsgAAvcDgECfiAAIAQpAwAiECAAKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAMIBAgDCkDAIVCIIkiEDcDACAIIBAgCCkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgBCAQIAQpAwCFQiiJIhA3AwAgACAQIAApAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIAwgECAMKQMAhUIwiSIQNwMAIAggECAIKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAEIBAgBCkDAIVCAYk3AwAgASAFKQMAIhAgASkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgDSAQIA0pAwCFQiCJIhA3AwAgCSAQIAkpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAUgECAFKQMAhUIoiSIQNwMAIAEgECABKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACANIBAgDSkDAIVCMIkiEDcDACAJIBAgCSkDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgBSAQIAUpAwCFQgGJNwMAIAIgBikDACIQIAIpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIA4gECAOKQMAhUIgiSIQNwMAIAogECAKKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAGIBAgBikDAIVCKIkiEDcDACACIBAgAikDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgDiAQIA4pAwCFQjCJIhA3AwAgCiAQIAopAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIAYgECAGKQMAhUIBiTcDACADIAcpAwAiECADKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAPIBAgDykDAIVCIIkiEDcDACALIBAgCykDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgByAQIAcpAwCFQiiJIhA3AwAgAyAQIAMpAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIA8gECAPKQMAhUIwiSIQNwMAIAsgECALKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAHIBAgBykDAIVCAYk3AwAgACAFKQMAIhAgACkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgDyAQIA8pAwCFQiCJIhA3AwAgCiAQIAopAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAUgECAFKQMAhUIoiSIQNwMAIAAgECAAKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAPIBAgDykDAIVCMIkiEDcDACAKIBAgCikDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgBSAQIAUpAwCFQgGJNwMAIAEgBikDACIQIAEpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAwgECAMKQMAhUIgiSIQNwMAIAsgECALKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAGIBAgBikDAIVCKIkiEDcDACABIBAgASkDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgDCAQIAwpAwCFQjCJIhA3AwAgCyAQIAspAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIAYgECAGKQMAhUIBiTcDACACIAcpAwAiECACKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACANIBAgDSkDAIVCIIkiEDcDACAIIBAgCCkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgByAQIAcpAwCFQiiJIhA3AwAgAiAQIAIpAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIA0gECANKQMAhUIwiSIQNwMAIAggECAIKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAHIBAgBykDAIVCAYk3AwAgAyAEKQMAIhAgAykDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgDiAQIA4pAwCFQiCJIhA3AwAgCSAQIAkpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAQgECAEKQMAhUIoiSIQNwMAIAMgECADKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAOIBAgDikDAIVCMIkiEDcDACAJIBAgCSkDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgBCAQIAQpAwCFQgGJNwMAC98aAQN/QQAhBEEAIAIpAwAgASkDAIU3A5AIQQAgAikDCCABKQMIhTcDmAhBACACKQMQIAEpAxCFNwOgCEEAIAIpAxggASkDGIU3A6gIQQAgAikDICABKQMghTcDsAhBACACKQMoIAEpAyiFNwO4CEEAIAIpAzAgASkDMIU3A8AIQQAgAikDOCABKQM4hTcDyAhBACACKQNAIAEpA0CFNwPQCEEAIAIpA0ggASkDSIU3A9gIQQAgAikDUCABKQNQhTcD4AhBACACKQNYIAEpA1iFNwPoCEEAIAIpA2AgASkDYIU3A/AIQQAgAikDaCABKQNohTcD+AhBACACKQNwIAEpA3CFNwOACUEAIAIpA3ggASkDeIU3A4gJQQAgAikDgAEgASkDgAGFNwOQCUEAIAIpA4gBIAEpA4gBhTcDmAlBACACKQOQASABKQ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ACADp0H/AXE2AuSKAQJAIAFBAUgNACACQgA3A3ggAkIANwNwIAJCADcDaCACQgA3A2AgAkIANwNYIAJCADcDUCACQgA3A0ggAkIANwNAIAJCADcDOCACQgA3AzAgAkIANwMoIAJCADcDICACQgA3AxggAkIANwMQIAJCADcDCCACQgA3AwBBACEEA0AgAiAAaiAAQYAJai0AADoAACAAQQFqIQAgBEEBaiIEQf8BcSABSA0ACyACQYABEAELIAJBgAFqJAALEgAgAEEDdkH/P3EgAEEQdhAECwkAQYAJIAAQAQsGAEGAiQELGwAgAUEDdkH/P3EgAUEQdhAEQYAJIAAQARADCwsLAQBBgAgLBPAAAAA=",hash:"c6f286e6"};const q=new Q;let M=null;function K(A){return!Number.isInteger(A)||A<8||A>512||A%8!=0?new Error("Invalid variant! Valid values: 8, 16, ..., 512"):null}function p(A,I){return A|I<<16}function s(A=512,I=null){if(K(A))return Promise.reject(K(A));let B=null,g=A;if(null!==I){if(B=a(I),B.length>64)return Promise.reject(new Error("Max key length is 64 bytes"));g=p(A,B.length)}const Q=A/8;return e(f,Q).then((A=>{g>512&&A.writeMemory(B),A.init(g);const I={init:g>512?()=>(A.writeMemory(B),A.init(g),I):()=>(A.init(g),I),update:B=>(A.update(B),I),digest:I=>A.digest(I),save:()=>A.save(),load:B=>(A.load(B),I),blockSize:128,digestSize:Q};return I}))}const r=new DataView(new ArrayBuffer(4));function Y(A){return r.setInt32(0,A,!0),new Uint8Array(r.buffer)}function R(A,I,B){return g(this,void 0,void 0,(function*(){if(B<=64){const A=yield s(8*B);return A.update(Y(B)),A.update(I),A.digest("binary")}const g=Math.ceil(B/32)-2,Q=new Uint8Array(B);A.init(),A.update(Y(B)),A.update(I);let C=A.digest("binary");Q.set(C.subarray(0,32),0);for(let I=1;I{var I;if(!A||"object"!=typeof A)throw new Error("Invalid options parameter. It requires an object.");if(!A.password)throw new Error("Password must be specified");if(A.password=a(A.password),A.password.length<1)throw new Error("Password must be specified");if(!A.salt)throw new Error("Salt must be specified");if(A.salt=a(A.salt),A.salt.length<8)throw new Error("Salt should be at least 8 bytes long");if(A.secret=a(null!==(I=A.secret)&&void 0!==I?I:""),!Number.isInteger(A.iterations)||A.iterations<1)throw new Error("Iterations should be a positive number");if(!Number.isInteger(A.parallelism)||A.parallelism<1)throw new Error("Parallelism should be a positive number");if(!Number.isInteger(A.hashLength)||A.hashLength<4)throw new Error("Hash length should be at least 4 bytes.");if(!Number.isInteger(A.memorySize))throw new Error("Memory size should be specified.");if(A.memorySize<8*A.parallelism)throw new Error("Memory size should be at least 8 * parallelism.");if(void 0===A.outputType&&(A.outputType="hex"),!["hex","binary","encoded"].includes(A.outputType))throw new Error(`Insupported output type ${A.outputType}. Valid values: ['hex', 'binary', 'encoded']`)};var z={name:"blake2s",data:"AGFzbQEAAAABEQRgAAF/YAJ/fwBgAX8AYAAAAwkIAAECAwICAAEFBAEBAgIGDgJ/AUGgigULfwBBgAgLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAKSGFzaF9GaW5hbAADCUhhc2hfSW5pdAAEC0hhc2hfVXBkYXRlAAUNSGFzaF9HZXRTdGF0ZQAGDkhhc2hfQ2FsY3VsYXRlAAcKU1RBVEVfU0laRQMBCr4yCAUAQYAJC6gFAQZ/AkAgAUEBSA0AAkACQAJAIAFBwABBACgC8IkBIgJrIgNKDQAgASEDDAELQQBBADYC8IkBAkAgAkHAAEYNACACQbCJAWohBAJAAkAgA0EHcSIFDQAgACEGIAMhBwwBCyAFIQcgACEGA0AgBCAGLQAAOgAAIARBAWohBCAGQQFqIQYgB0F/aiIHDQALQcAAIAIgBWprIQcLIAJBR2pBB0kNAANAIAQgBi0AADoAACAEIAYtAAE6AAEgBCAGLQACOgACIAQgBi0AAzoAAyAEIAYtAAQ6AAQgBCAGLQAFOgAFIAQgBi0ABjoABiAEIAYtAAc6AAcgBEEIaiEEIAZBCGohBiAHQXhqIgcNAAsLQQAhBEEAQQAoAqCJASIGQcAAajYCoIkBQQBBACgCpIkBIAZBv39L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FBiH8hAwJAA0AgA0H4iQFqQQA2AgAgA0UNASADQfyJAWpBADYCACADQQhqIQMMAAsLQQAhA0EAQQAoAoCKASIEQefMp9AGczYCgIkBQQBBACgChIoBQYXdntt7czYChIkBQQBBACgCiIoBQfLmu+MDczYCiIkBQQBBACgCjIoBQbrqv6p6czYCjIkBQQBBACgCkIoBQf+kuYgFczYCkIkBQQBBACgClIoBQYzRldh5czYClIkBQQBBACgCmIoBQauzj/wBczYCmIkBQQAgBEH/AXE2AvSJAUEAQQAoApyKAUGZmoPfBXM2ApyJAQJAIABBgIAESQ0AIAFBOGpCADcDACABQTBqQgA3AwAgAUEoakIANwMAIAFBIGpCADcDACABQRhqQgA3AwAgAUEQakIANwMAIAFCADcDCCABQgA3AwBBACEAA0AgASADaiADQYAJai0AADoAACADQQFqIQMgAiAAQQFqIgBB/wFxSw0ACyABQcAAEAELIAFBwABqJAALCQBBgAkgABABCwYAQYCJAQsPACABEARBgAkgABABEAMLCwsBAEGACAsEfAAAAA==",hash:"5c0ff166"};const V=new Q;let Z=null;function m(A){return!Number.isInteger(A)||A<8||A>256||A%8!=0?new Error("Invalid variant! Valid values: 8, 16, ..., 256"):null}function L(A,I){return A|I<<16}var x={name:"blake3",data:"AGFzbQEAAAABMQdgAAF/YAl/f39+f39/f38AYAZ/f39/fn8AYAF/AGADf39/AGABfgBgBX9/fn9/AX8DDg0AAQIDBAUGAwMDAwAEBQQBAQICBg4CfwFBgJgFC38AQYAICwdwCAZtZW1vcnkCAA5IYXNoX0dldEJ1ZmZlcgAACUhhc2hfSW5pdAAIC0hhc2hfVXBkYXRlAAkKSGFzaF9GaW5hbAAKDUhhc2hfR2V0U3RhdGUACw5IYXNoX0NhbGN1bGF0ZQAMClNUQVRFX1NJWkUDAQqQWw0FAEGACQufAwIDfwV+IwBB4ABrIgkkAAJAIAFFDQAgByAFciEKIAdBACACQQFGGyAGciAFciELIARBAEetIQwDQCAAKAIAIQcgCUEAKQOAiQE3AwAgCUEAKQOIiQE3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AAQeAAakIANwMAIABB2ABqQgA3AwAgAEHQAGpCADcDACAAQcgAakIANwMAIABBwABqQgA3AwAgAEE4akIANwMAIABBMGpCADcDACAAQgA3AygLQQAhByACQcEASQ0AIABB6QBqIgotAAAhBSAALQBqIQsgACkDICEMA0AgAyAAIAFBwAAgDCALIAVB/wFxRXJB/wFxEAIgACADKQMgIAMpAwCFNwMAIAAgAykDKCADKQMIhTcDCCAAIAMpAzAgAykDEIU3AxAgACADKQM4IAMpAxiFNwMYIAogBUEBaiIFOgAAIAFBwABqIQEgAkFAaiICQcAASw0ACwsCQEHAACAHQf8BcSIGayIFIAIgBSACSRsiCUUNACAJQQNxIQtBACEFAkAgCUEESQ0AIAAgBmohByAJQfwAcSEIQQAhBQNAIAcgBWoiAkEoaiABIAVqIgotAAA6AAAgAkEpaiAKQQFqLQAAOgAAIAJBKmogCkECai0AADoAACACQStqIApBA2otAAA6AAAgCCAFQQRqIgVHDQALCwJAIAtFDQAgASAFaiEBIAUgBmogAGpBKGohBQNAIAUgAS0AADoAACABQQFqIQEgBUEBaiEFIAtBf2oiCw0ACwsgAC0AaCEHCyAAIAcgCWo6AGggA0HAAGokAAveAwQFfwN+BX8GfiMAQdABayIBJAACQCAAe6ciAkEALQCQigEiA08NAEEALQCKigFBBHIhBCABQShqIQVBACkDmIkBIQBBACkDkIkBIQZBACkDiIkBIQdBACkDgIkBIQggAyEJA0AgASAANwMYIAEgBjcDECABIAc3AwggASAINwMAIAEgA0EFdCIDQdGJAWoiCikDADcDKCABIANB2YkBaiILKQMANwMwIAEgA0HhiQFqIgwpAwA3AzggASADQemJAWoiDSkDADcDQCABIANB8YkBaikDADcDSCABIANB+YkBaikDADcDUCABIANBgYoBaikDADcDWCADQYmKAWopAwAhDiABQcAAOgBoIAEgDjcDYCABQgA3AyAgASAEOgBpIAEgADcDiAEgASAGNwOAASABIAc3A3ggASAINwNwIAFBkAFqIAFB8ABqIAVBwABCACAEQf8BcRACIAEpA7ABIQ4gASkDkAEhDyAB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iDiACIAMgBRAGIQcgACAOaiABIA5rIA9C////AYMgAnwgAyAFQcAAQSAgDkGACEsbahAGIQECQCAHQQFHDQAgBCAFKQMANwMAIAQgBSkDCDcDCCAEIAUpAxA3AxAgBCAFKQMYNwMYIAQgBSkDIDcDICAEIAUpAyg3AyggBCAFKQMwNwMwIAQgBSkDODcDOEECIQYMAQtBACEGQQAhAAJAIAEgB2oiCUECSQ0AIAlBfmoiCkEBdkEBaiIGQQNxIQ5BACEHAkAgCkEGSQ0AIAZB/P///wdxIQhBACEHIAVBiAFqIQEgBSEAA0AgASAANgIAIAFBDGogAEHAAWo2AgAgAUEIaiAAQYABajYCACABQQRqIABBwABqNgIAIABBgAJqIQAgAUEQaiEBIAggB0EEaiIHRw0ACwsgCkF+cSEIAkAgDkUNACAFIAdBBnRqIQEgBUGIAWogB0ECdGohAANAIAAgATYCACABQcAAaiEBIABBBGohACAOQX9qIg4NAAsLIAhBAmohAAsgBUGIAWogBkEBQgBBACADQQRyQQBBACAEEAEgACAJTw0AIAQgBkEFdGoiASAFIAZBBnRqIgApAwA3AwAgASAAKQMINwMIIAEgACkDEDcDECABIAApAxg3AxggBkEBaiEGCyAFQeACaiQAIAYLrRAIAn8EfgF/AX4EfwR+BH8EfiMAQfABayIBJAACQCAARQ0AAkBBAC0AkIoBIgINACABQTBqQQApA9CJATcDACABQThqQQApA9iJATcDACABQQApA6CJASIDNwMAIAFBACkDqIkBIgQ3AwggAUEAKQOwiQEiBTcDECABQQApA7iJASIGNwMYIAFBACkDyIkBNwMoQQAtAIqKASECQQAtAImKASEHQQApA8CJASEIQQAtAIiKASEJIAFBwABqQQApA+CJATcDACABQcgAakEAKQPoiQE3AwAgAUHQAGpBACkD8IkBNwMAIAFB2ABqQQApA/iJATcDACABQeAAakEAKQOAigE3AwAgASAJOgBoIAEgCDcDICABIAIgB0VyIgJBAnI6AGkgAUEoaiEKQgAhCEGACSELIAJBCnJB/wFxIQwDQCABQbABaiABIAogCUH/AXEgCCAMEAIgASABKQPQASINIAEpA7ABhTcDcCABIAEpA9gBIg4gASkDuAGFNwN4IAEgASkD4AEiDyABKQPAAYU3A4ABIAEgASkD6AEiECAGhTcDqAEgASAPIAWFNwOgASABIA4gBIU3A5gBIAEgDSADhTcDkAEgASAQIAEpA8gBhTcDiAEgAEHAACAAQcAASRsiEUF/aiESAkACQCARQQdxIhMNACABQfAAaiECIAshByARIRQMAQsgEUH4AHEhFCABQfAAaiECIAshBwNAIAcgAi0AADoAACAHQQFqIQcgAkEBaiECIBNBf2oiEw0ACwsCQCASQQdJDQADQCAHIAIpAAA3AAAgB0EIaiEHIAJBCGohAiAUQXhqIhQNAAsLIAhCAXwhCCALIBFqIQsgACARayIADQAMAgsLAkACQAJAQQAtAImKASIHQQZ0QQBBAC0AiIoBIhFrRg0AIAEgEToAaCABQQApA4CKATcDYCABQQApA/iJATcDWCABQQApA/CJATcDUCABQQApA+iJATcDSCABQQApA+CJATcDQCABQQApA9iJATcDOCABQQApA9CJATcDMCABQQApA8iJATcDKCABQQApA8CJASIINwMgIAFBACkDuIkBIgM3AxggAUEAKQOwiQEiBDcDECABQQApA6iJASIFNwMIIAFBACkDoIkBIgY3AwAgAUEALQCKigEiEyAHRXJBAnIiCzoAaSATQQRyIRNBACkDmIkBIQ1BACkDkIkBIQ5BACkDiIkBIQ9BACkDgIkBIRAMAQtBwAAhESABQcAAOgBoQgAhCCABQgA3AyAgAUEAKQOYiQEiDTcDGCABQQApA5CJASIONwMQIAFBACkDiIkBIg83AwggAUEAKQOAiQEiEDcDACABQQAtAIqKAUEEciITOgBpIAEgAkF+aiICQQV0IgdByYoBaikDADcDYCABIAdBwYoBaikDADcDWCABIAdBuYoBaikDADcDUCABIAdBsYoBaikDADcDSCABIAdBqYoBaikDADcDQCABIAdBoYoBaikDADcDOCABIAdBmYoBaikDADcDMCABIAdBkYoBaikDADcDKCATIQsgECEGIA8hBSAOIQQgDSEDIAJFDQELIAJBf2oiB0EFdCIUQZGKAWopAwAhFSAUQZmKAWopAwAhFiAUQaGKAWopAwAhFyAUQamKAWopAwAhGCABIAM3A4gBIAEgBDcDgAEgASAFNwN4IAEgBjcDcCABQbABaiABQfAAaiABQShqIhQgESAIIAtB/wFxEAIgASATOgBpIAFBwAA6AGggASAYNwNAIAEgFzcDOCABIBY3AzAgASAVNwMoIAFCADcDICABIA03AxggASAONwMQIAEgDzcDCCABIBA3AwAgASABKQPoASABKQPIAYU3A2AgASABKQPgASABKQPAAYU3A1ggASABKQPYASABKQO4AYU3A1AgASABKQPQASABKQOwAYU3A0ggB0UNACACQQV0QemJAWohAiATQf8BcSERA0AgAkFoaikDACEIIAJBcGopAwAhAyACQXhqKQMAIQQgAikDACEFIAEgDTcDiAEgASAONwOAASABIA83A3ggASAQNwNwIAFBsAFqIAFB8ABqIBRBwABCACAREAIgASATOgBpIAFBwAA6AGggASAFNwNAIAEgBDcDOCABIAM3AzAgASAINwMoIAFCADcDICABIA03AxggASAONwMQIAEgDzcDCCABIBA3AwAgASABKQPoASABKQPIAYU3A2AgASABKQPgASABKQPAAYU3A1ggASABKQPYASABKQO4AYU3A1AgASABKQPQASABKQOwAYU3A0ggAkFgaiECIAdBf2oiBw0ACwsgAUEoaiEJQgAhCEGACSELIBNBCHJB/wFxIQoDQCABQbABaiABIAlBwAAgCCAKEAIgASABKQPQASIDIAEpA7ABhTcDcCABIAEpA9gBIgQgASkDuAGFNwN4IAEgASkD4AEiBSABKQPAAYU3A4ABIAEgDSABKQPoASIGhTcDqAEgASAOIAWFNwOgASABIA8gBIU3A5gBIAEgECADhTcDkAEgASAGIAEpA8gBhTcDiAEgAEHAACAAQcAASRsiEUF/aiESAkACQCARQQdxIhMNACABQfAAaiECIAshByARIRQMAQsgEUH4AHEhFCABQfAAaiECIAshBwNAIAcgAi0AADoAACAHQQFqIQcgAkEBaiECIBNBf2oiEw0ACwsCQCASQQdJDQADQCAHIAIpAAA3AAAgB0EIaiEHIAJBCGohAiAUQXhqIhQNAAsLIAhCAXwhCCALIBFqIQsgACARayIADQALCyABQfABaiQAC6MCAQR+AkACQCAAQSBGDQBCq7OP/JGjs/DbACEBQv+kuYjFkdqCm38hAkLy5rvjo6f9p6V/IQNC58yn0NbQ67O7fyEEQQAhAAwBC0EAKQOYCSEBQQApA5AJIQJBACkDiAkhA0EAKQOACSEEQRAhAAtBACAAOgCKigFBAEIANwOAigFBAEIANwP4iQFBAEIANwPwiQFBAEIANwPoiQFBAEIANwPgiQFBAEIANwPYiQFBAEIANwPQiQFBAEIANwPIiQFBAEIANwPAiQFBACABNwO4iQFBACACNwOwiQFBACADNwOoiQFBACAENwOgiQFBACABNwOYiQFBACACNwOQiQFBACADNwOIiQFBACAENwOAiQFBAEEAOgCQigFBAEEAOwGIigELBgAgABADCwYAIAAQBwsGAEGAiQELqwIBBH4CQAJAIAFBIEYNAEKrs4/8kaOz8NsAIQNC/6S5iMWR2oKbfyEEQvLmu+Ojp/2npX8hBULnzKfQ1tDrs7t/IQZBACEBDAELQQApA5gJIQNBACkDkAkhBEEAKQOICSEFQQApA4AJIQZBECEBC0EAIAE6AIqKAUEAQgA3A4CKAUEAQgA3A/iJAUEAQgA3A/CJAUEAQgA3A+iJAUEAQgA3A+CJAUEAQgA3A9iJAUEAQgA3A9CJAUEAQgA3A8iJAUEAQgA3A8CJAUEAIAM3A7iJAUEAIAQ3A7CJAUEAIAU3A6iJAUEAIAY3A6CJAUEAIAM3A5iJAUEAIAQ3A5CJAUEAIAU3A4iJAUEAIAY3A4CJAUEAQQA6AJCKAUEAQQA7AYiKASAAEAMgAhAHCwsLAQBBgAgLBHgHAAA=",hash:"215d875f"};const u=new Q;let W=null;function O(A){return!Number.isInteger(A)||A<8||A%8!=0?new Error("Invalid variant! Valid values: 8, 16, ..."):null}var P={name:"crc32",data:"AGFzbQEAAAABEQRgAAF/YAF/AGAAAGACf38AAwgHAAEBAQIAAwUEAQECAgYOAn8BQZDJBQt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0lua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QCAAQQFxDQAgACEDDAELIAFB/wFxIAItAABzQQJ0QYCJAWooAgAgAUEIdnMhASACQQFqIQIgAEF/aiEDCyAAQQFGDQADQCABQf8BcSACLQAAc0ECdEGAiQFqKAIAIAFBCHZzIgFB/wFxIAJBAWotAABzQQJ0QYCJAWooAgAgAUEIdnMhASACQQJqIQIgA0F+aiIDDQALC0EAIAFBf3M2AoTJAQsyAQF/QQBBACgChMkBIgBBGHQgAEGA/gNxQQh0ciAAQQh2QYD+A3EgAEEYdnJyNgKACQsGAEGEyQELWQACQEEAKAKAyQEgAUYNACABEAFBACABNgKAyQELQQBBADYChMkBIAAQA0EAQQAoAoTJASIBQRh0IAFBgP4DcUEIdHIgAUEIdkGA/gNxIAFBGHZycjYCgAkLCwsBAEGACAsEBAAAAA==",hash:"d2eba587"};const b=new Q;let v=null;function j(A){return!Number.isInteger(A)||A<0||A>4294967295?new Error("Polynomial must be a valid 32-bit long unsigned integer"):null}var T={name:"crc64",data:"AGFzbQEAAAABDANgAAF/YAAAYAF/AAMHBgABAgEAAQUEAQECAgYOAn8BQZCJBgt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQAAQtIYXNoX1VwZGF0ZQACCkhhc2hfRmluYWwAAw1IYXNoX0dldFN0YXRlAAQOSGFzaF9DYWxjdWxhdGUABQpTVEFURV9TSVpFAwEKgwgGBQBBgAkL9QMDAX4BfwJ+AkBBACkDgIkCQQApA4AJIgBRDQBBgIkBIQFCACECA0AgAUIAQgBCAEIAQgBCAEIAQgAgAkIBg30gAIMgAkIBiIUiA0IBg30gAIMgA0IBiIUiA0IBg30gAIMgA0IBiIUiA0IBg30gAIMgA0IBiIUiA0IBg30gAIMgA0IBiIUiA0IBg30gAIMgA0IBiIUiA0IBg30gAIMgA0IBiIUiA0IBg30gAIMgA0IBiIU3AwAgAUEIaiEBIAJCAXwiAkKAAlINAAtBACEBA0AgAUGImQFqIAFBiIkBaikDACICp0H/AXFBA3RBgIkBaikDACACQgiIhSICNwMAIAFBiKkBaiACp0H/AXFBA3RBgIkBaikDACACQgiIhSICNwMAIAFBiLkBaiACp0H/AXFBA3RBgIkBaikDACACQgiIhSICNwMAIAFBiMkBaiACp0H/AXFBA3RBgIkBaikDACACQgiIhSICNwMAIAFBiNkBaiACp0H/AXFBA3RBgIkBaikDACACQgiIhSICNwMAIAFBiOkBaiACp0H/AXFBA3RBgIkBaikDACACQgiIhSICNwMAIAFBiPkBaiACp0H/AXFBA3RBgIkBaikDACACQgiIhTcDACABQQhqIgFB+A9HDQALQQAgADcDgIkCC0EAQgA3A4iJAguUAwIBfgJ/QQApA4iJAkJ/hSEBQYAJIQICQCAAQQhJDQBBgAkhAgNAIAIpAwAgAYUiAUIwiKdB/wFxQQN0QYCZAWopAwAgAUI4iKdBA3RBgIkBaikDAIUgAUIoiKdB/wFxQQN0QYCpAWopAwCFIAFCIIinQf8BcUEDdEGAuQFqKQMAhSABpyIDQRV2QfgPcUGAyQFqKQMAhSADQQ12QfgPcUGA2QFqKQMAhSADQQV2QfgPcUGA6QFqKQMAhSADQf8BcUEDdEGA+QFqKQMAhSEBIAJBCGohAiAAQXhqIgBBB0sNAAsLAkAgAEUNAAJAAkAgAEEBcQ0AIAAhAwwBCyABQv8BgyACMQAAhadBA3RBgIkBaikDACABQgiIhSEBIAJBAWohAiAAQX9qIQMLIABBAUYNAANAIAFC/wGDIAIxAACFp0EDdEGAiQFqKQMAIAFCCIiFIgFC/wGDIAJBAWoxAACFp0EDdEGAiQFqKQMAIAFCCIiFIQEgAkECaiECIANBfmoiAw0ACwtBACABQn+FNwOIiQILZAEBfkEAQQApA4iJAiIAQjiGIABCgP4Dg0IohoQgAEKAgPwHg0IYhiAAQoCAgPgPg0IIhoSEIABCCIhCgICA+A+DIABCGIhCgID8B4OEIABCKIhCgP4DgyAAQjiIhISENwOACQsGAEGIiQILAgALCwsBAEGACAsECAAAAA==",hash:"c5ac6c16"};const $=new Q;let _=null;const AA=new Uint8Array(8);function IA(A){const I="Polynomial must be provided as a 16 char long hex string";if("string"!=typeof A||16!==A.length)return{hi:0,lo:0,err:new Error(I)};const B=Number(`0x${A.slice(0,8)}`),g=Number(`0x${A.slice(8)}`);return Number.isNaN(B)||Number.isNaN(g)?{hi:B,lo:g,err:new Error(I)}:{hi:B,lo:g,err:null}}function BA(A,I,B){const g=new DataView(A);g.setUint32(0,I,!0),g.setUint32(4,B,!0)}var gA={name:"md4",data:"AGFzbQEAAAABEgRgAAF/YAAAYAF/AGACf38BfwMIBwABAgMBAAIFBAEBAgIGDgJ/AUGgigULfwBBgAgLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAJSGFzaF9Jbml0AAELSGFzaF9VcGRhdGUAAgpIYXNoX0ZpbmFsAAQNSGFzaF9HZXRTdGF0ZQAFDkhhc2hfQ2FsY3VsYXRlAAYKU1RBVEVfU0laRQMBCucUBwUAQYAJCy0AQQBC/rnrxemOlZkQNwKQiQFBAEKBxpS6lvHq5m83AoiJAUEAQgA3AoCJAQu+BQEHf0EAQQAoAoCJASIBIABqQf////8BcSICNgKAiQFBAEEAKAKEiQEgAiABSWogAEEddmo2AoSJAQJAAkACQAJAAkACQCABQT9xIgMNAEGACSEEDAELIABBwAAgA2siBUkNASAFQQNxIQZBACEBAkAgA0E/c0EDSQ0AIANBgIkBaiEEIAVB/ABxIQdBACEBA0AgBCABaiICQRhqIAFBgAlqLQAAOgAAIAJBGWogAUGBCWotAAA6AAAgAkEaaiABQYIJai0AADoAACACQRtqIAFBgwlqLQAAOgAAIAcgAUEEaiIBRw0ACwsCQCAGRQ0AIANBmIkBaiECA0AgAiABaiABQYAJai0AADoAACABQQFqIQEgBkF/aiIGDQALC0GYiQFBwAAQAxogACAFayEAIAVBgAlqIQQLIABBwABPDQEgACECDAILIABFDQIgAEEDcSEGQQAhAQJAIABBBEkNACADQYCJAWohBCAAQXxxIQBBACEBA0AgBCABaiICQRhqIAFBgAlqLQAAOgAAIAJBGWogAUGBC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ANgKIjQEgABACQeQAQQAoAoyNASIAQQF2ayEDAkBBACgCiI0BIgFBAEgNACAAIQQCQCAAIAFGDQAgAUHIiwFqIQVBACEBA0AgBSABakEAOgAAIAFBAWoiASAAQQAoAoiNASIEa0kNAAsLIARByIsBaiIBIAEtAAAgAnI6AAAgAEHHiwFqIgEgAS0AAEGAAXI6AABByIsBIAAQA0EAQYCAgIB4NgKIjQELAkAgA0EESQ0AIANBAnYiAUEDcSEFQQAhBAJAIAFBf2pBA0kNACABQfz///8DcSEAQQAhAUEAIQQDQCABQYAKaiABQYCKAWooAgA2AgAgAUGECmogAUGEigFqKAIANgIAIAFBiApqIAFBiIoBaigCADYCACABQYwKaiABQYyKAWooAgA2AgAgAUEQaiEBIAAgBEEEaiIERw0ACwsgBUUNACAFQQJ0IQAgBEECdCEBA0AgAUGACmogAUGAigFqKAIANgIAIAFBBGohASAAQXxqIgANAAsLCwvYAQEAQYAIC9ABkAEAAAAAAAAAAAAAAAAAAAEAAAAAAAAAgoAAAAAAAACKgAAAAAAAgACAAIAAAACAi4AAAAAAAAABAACAAAAAAIGAAIAAAACACYAAAAAAAICKAAAAAAAAAIgAAAAAAAAACYAAgAAAAAAKAACAAAAAAIuAAIAAAAAAiwAAAAAAAICJgAAAAAAAgAOAAAAAAACAAoAAAAAAAICAAAAAAAAAgAqAAAAAAAAACgAAgAAAAICBgACAAAAAgICAAAAAAACAAQAAgAAAAAAIgACAAAAAgA==",hash:"fb24e536"};const aA=new Q;let wA=null;function kA(A){return[224,256,384,512].includes(A)?null:new Error("Invalid variant! Valid values: 224, 256, 384, 512")}const GA=new Q;let nA=null;function dA(A){return[224,256,384,512].includes(A)?null:new Error("Invalid variant! Valid values: 224, 256, 384, 512")}var yA={name:"sha256",data:"AGFzbQEAAAABEQRgAAF/YAF/AGAAAGACf38AAwgHAAEBAQIAAwUEAQECAgYOAn8BQfCJBQt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0lua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EEYdCAAQYD+A3FBCHRyIABBCHZBgP4DcSAAQRh2cnI2AuCJAUEAQQAoAtyJASIAQRh0IABBgP4DcUEIdHIgAEEIdkGA/gNxIABBGHZycjYC3IkBQQBBACgC2IkBIgBBGHQgAEGA/gNxQQh0ciAAQQh2QYD+A3EgAEEYdnJyNgLYiQFBAEEAKALUiQEiAEEYdCAAQYD+A3FBCHRyIABBCHZBgP4DcSAAQRh2cnI2AtSJAUEAQQAoAtCJASIAQRh0IABBgP4DcUEIdHIgAEEIdkGA/gNxIABBGHZycjYC0IkBQQBBACgCzIkBIgBBGHQgAEGA/gNxQQh0ciAAQQh2QYD+A3EgAEEYdnJyNgLMiQFBAEEAKALIiQEiAEEYdCAAQYD+A3FBCHRyIABBCHZBgP4DcSAAQRh2cnI2AsiJAQJAQQAoAuiJASICRQ0AQQAhAANAIAFBgAlqIAFByIkBai0AADoAACABQQFqIQEgAiAAQQFqIgBB/wFxSw0ACwsLBgBBgIkBC6MBAEEAQgA3A8CJAUEAQRxBICABQeABRiIBGzYC6IkBQQBCp5/mp8b0k/2+f0Krs4/8kaOz8NsAIAEbNwPgiQFBAEKxloD+n6KFrOgAQv+kuYjFkdqCm38gARs3A9iJAUEAQpe6w4OTp5aHd0Ly5rvjo6f9p6V/IAEbNwPQiQFBAELYvZaI/KC1vjZC58yn0NbQ67O7fyABGzcDyIkBIAAQAhAECwsLAQBBgAgLBHAAAAA=",hash:"8c18dd94"};const HA=new Q;let UA=null;const eA=new Q;let SA=null;function NA(){return e(yA,32).then((A=>{A.init(256);const I={init:()=>(A.init(256),I),update:B=>(A.update(B),I),digest:I=>A.digest(I),save:()=>A.save(),load:B=>(A.load(B),I),blockSize:64,digestSize:32};return I}))}var tA={name:"sha512",data:"AGFzbQEAAAABEQRgAAF/YAF/AGAAAGACf38AAwgHAAEBAQIAAwUEAQECAgYOAn8BQdCKBQt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQAAQt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GhIQgAEIIiEKAgID4D4MgAEIYiEKAgPwHg4QgAEIoiEKA/gODIABCOIiEhIQ3A5iKAUEAQQApA5CKASIAQjiGIABCgP4Dg0IohoQgAEKAgPwHg0IYhiAAQoCAgPgPg0IIhoSEIABCCIhCgICA+A+DIABCGIhCgID8B4OEIABCKIhCgP4DgyAAQjiIhISENwOQigFBAEEAKQOIigEiAEI4hiAAQoD+A4NCKIaEIABCgID8B4NCGIYgAEKAgID4D4NCCIaEhCAAQgiIQoCAgPgPgyAAQhiIQoCA/AeDhCAAQiiIQoD+A4MgAEI4iISEhDcDiIoBAkBBACgCyIoBIgNFDQBBACECA0AgAUGACWogAUGIigFqLQAAOgAAIAFBAWohASADIAJBAWoiAkH/AXFLDQALCwsGAEGAiQELoQIAQQBCADcDgIoBQQBBMEHAACABQYADRiIBGzYCyIoBQQBCpJ/p99uD0trHAEL5wvibkaOz8NsAIAEbNwPAigFBAEKnn+an1sGLhltC6/qG2r+19sEfIAEbNwO4igFBAEKRquDC9tCS2o5/Qp/Y+dnCkdqCm38gARs3A7CKAUEAQrGWgP7/zMmZ5wBC0YWa7/rPlIfRACABGzcDqIoBQQBCubK5uI+b+5cVQvHt9Pilp/2npX8gARs3A6CKAUEAQpe6w4Ojq8CskX9Cq/DT9K/uvLc8IAEbNwOYigFBAEKHqvOzo6WKzeIAQrvOqqbY0Ouzu38gARs3A5CKAUEAQti9lojcq+fdS0KIkvOd/8z5hOoAIAEbNwOIigEgABACEAQLCwsBAEGACAsE0AAAAA==",hash:"f2e40eb1"};const JA=new Q;let fA=null;const qA=new Q;let MA=null;var KA={name:"xxhash32",data:"AGFzbQEAAAABEQRgAAF/YAF/AGAAAGACf38AAwcGAAEBAgADBQQBAQICBg4CfwFBsIkFC38AQYAICwdwCAZtZW1vcnkCAA5IYXNoX0dldEJ1ZmZlcgAACUhhc2hfSW5pdAABC0hhc2hfVXBkYXRlAAIKSGFzaF9GaW5hbAADDUhhc2hfR2V0U3RhdGUABA5IYXNoX0Nh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95Svr3hsIgFBDXYgAXNBvdzKlXxsIgFBEHYgAXMiAkEYdCACQYD+A3FBCHRyIAFBCHZBgP4DcSABQRh2cnKtNwOACQsGAEGAiQEL0gQCAX4Ef0EAQgA3A6iJAUEAIAE2AoiJAUEAIAFBz4yijgZqNgKMiQFBACABQfeUr694ajYChIkBQQAgAUGoiI2hAmo2AoCJAUEAQQA2AqCJASAAEAJBACkDqIkBIgKnIQECQAJAIAJCEFQNAEEAKAKEiQFBB3dBACgCgIkBQQF3akEAKAKIiQFBDHdqQQAoAoyJAUESd2ohAAwBC0EAKAKIiQFBsc/ZsgFqIQALIAAgAWohAEGQiQEhA0GUiQEhAQJAQQAoAqCJASIEQZCJAWoiBUGUiQFJDQBBkIkBIQMCQCAEQXxqIgZBBHENAEEAKAKQiQFBvdzKlXxsIABqQRF3Qa/W074CbCEAQZiJASEBQZSJASEDIAZBBEkNAQsDQCABKAIAQb3cypV8bCADKAIAQb3cypV8bCAAakERd0Gv1tO+AmxqQRF3Qa/W074CbCEAIAFBBGohAyABQQhqIgEgBU0NAAsgAUF8aiEDCwJAIAMgBUYNACAEQY+JAWohBgJAAkAgBCADa0EBcQ0AIAMhAQwBCyADQQFqIQEgAy0AAEGxz9myAWwgAGpBC3dBsfPd8XlsIQALIAYgA0YNAANAIAFBAWotAABBsc/ZsgFsIAEtAABBsc/ZsgFsIABqQQt3QbHz3fF5bGpBC3dBsfPd8XlsIQAgAUECaiIBIAVHDQALC0EAIABBD3YgAHNB95Svr3hsIgFBDXYgAXNBvdzKlXxsIgFBEHYgAXMiAEEYdCAAQYD+A3FBCHRyIAFBCHZBgP4DcSABQRh2cnKtNwOACQsLCwEAQYAICwQwAAAA",hash:"4bb12485"};const pA=new Q;let sA=null;function rA(A){return!Number.isInteger(A)||A<0||A>4294967295?new Error("Seed must be a valid 32-bit long unsigned integer."):null}var YA={name:"xxhash64",data:"AGFzbQEAAAABDANgAAF/YAAAYAF/AAMHBgABAgEAAQUEAQECAgYOAn8BQdCJB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kBIQYCQEEAKALAiQEiB0GgiQFqIghBqIkBSQ0AQaCJASEFAkAgB0F4aiIJQQhxDQBBACkDoIkBQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef34gAIVCG4lCh5Wvr5i23puef35C49zKlfzO8vWFf3whAEGwiQEhBkGoiQEhBSAJQQhJDQELA0AgBikDAELP1tO+0ser2UJ+Qh+JQoeVr6+Ytt6bnn9+IAUpAwBCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/fiAAhUIbiUKHla+vmLbem55/fkLj3MqV/M7y9YV/fIVCG4lCh5Wvr5i23puef35C49zKlfzO8vWFf3whACAGQQhqIQUgBkEQaiIGIAhNDQALIAZBeGohBQsCQAJAIAVBBGoiCSAITQ0AIAUhCQwBCyAFNQIAQoeVr6+Ytt6bnn9+IACFQheJQs/W077Sx6vZQn5C+fPd8Zn2masWfCEACwJAIAkgCEYNACAHQZ+JAWohBQJAAkAgByAJa0EBcQ0AIAkhBgwBCyAJQQFqIQYgCTEAAELFz9my8eW66id+IACFQguJQoeVr6+Ytt6bnn9+IQALIAUgCUYNAANAIAZBAWoxAABCxc/ZsvHluuonfiAGMQAAQsXP2bLx5brqJ34gAIVCC4lCh5Wvr5i23puef36FQguJQoeVr6+Ytt6bnn9+IQAgBkECaiIGIAhHDQALC0EAIABCIYggAIVCz9bTvtLHq9lCfiIAQh2IIACFQvnz3fGZ9pmrFn4iAEIgiCAAhSIBQjiGIAFCgP4Dg0IohoQgAUKAgPwHg0IYhiABQoCAgPgPg0IIhoSEIABCCIhCgICA+A+DIABCGIhCgID8B4OEIABCKIhCgP4DgyAAQjiIhISENwOACQsGAEGAiQELAgALCwsBAEGACAsEUAAAAA==",hash:"177fbfa3"};const RA=new Q;let lA=null;const XA=new Uint8Array(8);function zA(A){return!Number.isInteger(A)||A<0||A>4294967295?new Error("Seed must be given as two valid 32-bit long unsigned integers (lo + high)."):null}function VA(A,I,B){const g=new DataView(A);g.setUint32(0,I,!0),g.setUint32(4,B,!0)}var ZA={name:"xxhash3",data:"AGFzbQEAAAABNAhgAAF/YAR/f39/AGAHf39/f39/fwBgBH9+fn4BfmAEf39/fgF+YAN/f34BfmAAAGABfwADDg0AAQIDBAUFBQYHBgAGBQQBAQICBg4CfwFBwI4FC38AQcAJCwdwCAZtZW1vcnkCAA5IYXNoX0dldEJ1ZmZlcgAACUhhc2hfSW5pdAAIC0hhc2hfVXBkYXRlAAkKSGFzaF9GaW5hbAAKDUhhc2hfR2V0U3RhdGUACw5IYXNoX0NhbGN1bGF0ZQAMClNUQVRFX1NJWkUDAQr6QQ0FAEGACgvkAwMPfgF/AX4CQCADRQ0AIAApAzAhBCAAKQM4IQUgACkDICEGIAApAyghByAAKQMQIQggACkDGCEJIAApAwAhCiAAKQMIIQsDQCAFIAFBMGopAwAiDHwgAkE4aikDACABQThqKQMAIg2FIgVCIIggBUL/////D4N+fCEFIAcgAUEgaikDACIOfCACQShqKQMAIAFBKGopAwAiD4UiB0IgiCAHQv////8Pg358IQcgCSABQRBqKQMAIhB8IAJBGGopAwAgAUEYaikDACIRhSIJQiCIIAlC/////w+DfnwhCSALIAEpAwAiEnwgAkEIaiITKQMAIAFBCGopAwAiFIUiC0IgiCALQv////8Pg358IQsgAkEwaikDACAMhSIMQiCIIAxC/////w+DfiAEfCANfCEEIAJBIGopAwAgDoUiDEIgiCAMQv////8Pg34gBnwgD3whBiACQRBqKQMAIBCFIgxCIIggDEL/////D4N+IAh8IBF8IQggAikDACAShSIMQiCIIAxC/////w+DfiAKfCAUfCEKIAFBwABqIQEgEyECIANBf2oiAw0ACyAAIAk3AxggACAKNwMAIAAgCzcDCCAAIAc3AyggACAINwMQIAAgBTcDOCAAIAY3AyAgACAENwMwCwveAgIBfwF+AkAgBCACIAEoAgAiB2siAkkNACAAIAMgBSAHQQN0aiACEAEgACAFIAZqIgcpAwAgACkDACIIQi+IhSAIhUKx893xCX43AwAgACAHKQMIIAApAwgiCEIviIUgCIVCsfPd8Ql+NwMIIAAgBykDECAAKQMQIghCL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UJ+IgNCHYggA4VC+fPd8Zn2masWfiIDQiCIIAOFC94IAQZ+IACtQoeVr6+Ytt6bnn9+IQMCQCAAQSFJDQACQCAAQcEASQ0AAkAgAEHhAEkNACABKQNoIAJ9QQApA7iMAYUiBEL/////D4MiBSABKQNgIAJ8QQApA7CMAYUiBkIgiCIHfiIIQv////8PgyAEQiCIIgQgBkL/////D4MiBn58IAUgBn4iBUIgiHwiBkIghiAFQv////8Pg4QgCEIgiCAEIAd+fCAGQiCIfIUgA3wgASkDeCACfSAAQciLAWopAwCFIgNC/////w+DIgQgASkDcCACfCAAQcCLAWopAwCFIgVCIIgiBn4iB0L/////D4MgA0IgiCIDIAVC/////w+DIgV+fCAEIAV+IgRCIIh8IgVCIIYgBEL/////D4OEIAdCIIggAyAGfnwgBUIgiHyFfCEDCyABKQNIIAJ9QQApA6iMAYUiBEL/////D4MiBSABKQNAIAJ8QQApA6CMAYUiBkIgiCIHfiIIQv////8PgyAEQiCIIgQgBkL/////D4MiBn58IAUgBn4iBUIgiHwiBkIghiAFQv////8Pg4QgCEIgiCAEIAd+fCAGQiCIfIUgA3wgASkDWCACfSAAQdiLAWopAwCFIgNC/////w+DIgQgASkDUCACfCAAQdCLAWopAwCFIgVCIIgiBn4iB0L/////D4MgA0IgiCIDIAVC/////w+DIgV+fCAEIAV+IgRCIIh8IgVCIIYgBEL/////D4OEIAdCIIggAyAGfnwgBUIgiHyFfCEDCyABKQMoIAJ9QQApA5iMAYUiBEL/////D4MiBSABKQMgIAJ8QQApA5CMAYUiBkIgiCIHfiIIQv////8PgyAEQiCIIgQgBkL/////D4MiBn58IAUgBn4iBUIgiHwiBkIghiAFQv////8Pg4QgCEIgiCAEIAd+fCAGQiCIfIUgA3wgASkDOCACfSAAQeiLAWopAwCFIgNC/////w+DIgQgASkDMCACfCAAQeCLAWopAwCFIgVCIIgiBn4iB0L/////D4MgA0IgiCIDIAVC/////w+DIgV+fCAEIAV+IgRCIIh8IgVCIIYgBEL/////D4OEIAdCIIggAyAGfnwgBUIgiHyFfCEDCyABKQMIIAJ9QQApA4iMAYUiBEL/////D4MiBSABKQMAIAJ8QQApA4CMAYUiBkIgiCIHfiIIQv////8PgyAEQiCIIgQgBkL/////D4MiBn58IAUgBn4iBUIgiHwiBkIghiAFQv////8Pg4QgCEIgiCAEIAd+fCAGQiCIfIUgA3wgASkDGCACfSAAQfiLAWopAwCFIgNC/////w+DIgQgASkDECACfCAAQfCLAWopAwCFIgJCIIgiBX4iBkL/////D4MgA0IgiCIDIAJC/////w+DIgJ+fCAEIAJ+IgJCIIh8IgRCIIYgAkL/////D4OEIAZCIIggAyAFfnwgBEIgiHyFfCICQiWIIAKFQvnz3fGZ8pmrFn4iAkIgiCAChQv8CgQBfwV+An8BfkEAIQMgASkDeCACfUEAKQP4jAGFIgRC/////w+DIgUgASkDcCACfEEAKQPwjAGFIgZCIIgiB34iCEL/////D4MgBEIgiCIEIAZC/////w+DIgZ+fCAFIAZ+IgVCIIh8IgZCIIYgBUL/////D4OEIAhCIIggBCAHfnwgBkIgiHyFIAEpA2ggAn1BACkD6IwBhSIEQv////8PgyIFIAEpA2AgAnxBACkD4IwBhSIGQiCIIgd+IghC/////w+DIARCIIgiBCAGQv////8PgyIGfnwgBSAGfiIFQiCIfCIGQiCGIAVC/////w+DhCAIQiCIIAQgB358IAZCIIh8hSABKQNYIAJ9QQApA9iMAYUiBEL/////D4MiBSABKQNQIAJ8QQApA9CMAYUiBkIgiCIHfiIIQv////8PgyAEQiCIIgQgBkL/////D4MiBn58IAUgBn4iBUIgiHwiBkIghiAFQv////8Pg4QgCEIgiCAEIAd+fCAGQiCIfIUgASkDSCACfUEAKQPIjAGFIgRC/////w+DIgUgASkDQCACfEEAKQPAjAGFIgZCIIgiB34iCEL/////D4MgBEIgiCIEIAZC/////w+DIgZ+fCAFIAZ+IgVCIIh8IgZCIIYgBUL/////D4OEIAhCIIggBCAHfnwgBkIgiHyFIAEpAzggAn1BACkDuIwBhSIEQv////8PgyIFIAEpAzAgAnxBACkDsIwBhSIGQiCIIgd+IghC/////w+DIARCIIgiBCAGQv////8PgyIGfnwgBSAGfiIFQiCIfCIGQiCGIAVC/////w+DhCAIQiCIIAQgB358IAZCIIh8hSABKQMoIAJ9QQApA6iMAYUiBEL/////D4MiBSABKQMgIAJ8QQApA6CMAYUiBkIgiCIHfiIIQv////8PgyAEQiCIIgQgBkL/////D4MiBn58IAUgBn4iBUIgiHwiBkIghiAFQv////8Pg4QgCEIgiCAEIAd+fCAGQiCIfIUgASkDGCACfUEAKQOYjAGFIgRC/////w+DIgUgASkDECACfEEAKQOQjAGFIgZCIIgiB34iCEL/////D4MgBEIgiCIEIAZC/////w+DIgZ+fCAFIAZ+IgVCIIh8IgZCIIYgBUL/////D4OEIAhCIIggBCAHfnwgBkIgiHyFIAEpAwggAn1BACkDiIwBhSIEQv////8PgyIFIAEpAwAgAnxBACkDgIwBhSIGQiCIIgd+IghC/////w+DIARCIIgiBCAGQv////8PgyIGfnwgBSAGfiIFQiCIfCIGQiCGIAVC/////w+DhCAIQiCIIAQgB358IAZCIIh8hSAArUKHla+vmLbem55/fnx8fHx8fHx8IgRCJYggBIVC+fPd8ZnymasWfiIEQiCIIASFIQQCQCAAQZABSA0AIABBBHZBeGohCQNAIAEgA2oiCkELaikDACACfSADQYiNAWopAwCFIgVC/////w+DIgYgCkEDaikDACACfCADQYCNAWopAwCFIgdCIIgiCH4iC0L/////D4MgBUIgiCIFIAdC/////w+DIgd+fCAGIAd+IgZCIIh8IgdCIIYgBkL/////D4OEIAtCIIggBSAIfnwgB0IgiHyFIAR8IQQgA0EQaiEDIAlBf2oiCQ0ACwsgASkDfyACfSAAQfiLAWopAwCFIgVC/////w+DIgYgASkDdyACfCAAQfCLAWopAwCFIgJCIIgiB34iCEL/////D4MgBUIgiCIFIAJC/////w+DIgJ+fCAGIAJ+IgJCIIh8IgZCIIYgAkL/////D4OEIAhCIIggBSAHfnwgBkIgiHyFIAR8IgJCJYggAoVC+fPd8ZnymasWfiICQiC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AykD0AE3A9CNAUEAIAMpA9gBNwPYjQFBACADKQPgATcD4I0BQQAgAykD6AE3A+iNAUEAIAMpA/ABNwPwjQFBACADKQP4ATcD+I0BC0GAjAEhAwJAAkAgBSAEayICQQhPDQAgAiEGDAELQYCMASEDIAIhBgNAIAMgBCkDADcDACADQQhqIQMgBEEIaiEEIAZBeGoiBkEHSw0ACwsgBkUNAQNAIAMgBC0AADoAACADQQFqIQMgBEEBaiEEIAZBf2oiBg0ADAILCyABRQ0AAkACQCABQQdxIgYNACABIQIMAQsgAUF4cSECA0AgAyAELQAAOgAAIANBAWohAyAEQQFqIQQgBkF/aiIGDQALCwJAIAFBCEkNAANAIAMgBCkAADcAACADQQhqIQMgBEEIaiEEIAJBeGoiAg0ACwtBACgCgI4BIABqIQILQQAgAjYCgI4BC/ISBQR/A34BfxV+BX8jACIAIQEgAEGAAWtBQHEiAiQAQQAoArCOASIAQcCKASAAGyEDAkACQEEAKQOQjgEiBELxAVQNACACQQApA4CKATcDACACQQApA4iKATcDCCACQQApA5CKATcDECACQQApA5iKATcDGCACQQApA6CKATcDICACQQApA6iKATcDKCACQQApA7CKASIFNwMwIAJBACkDuIoBIgY3AzgCQAJAQQAoAoCOASIHQcAASQ0AIAJBACgCiI4BNgJAIAIgAkHAAGpBACgCmI4BQYCMASAHQX9qQQZ2IANBACgCnI4BIgAQAiADIABqIgBBeWopAwAhCCAAKQMJIQkgACkDGSEKIAApAykhCyAHQcCLAWopAwAhBSAAKQMBIQwgB0HIiwFqKQMAIQYgB0HQiwFqKQMAIQ0gACkDESEOIAdB2IsBaikDACEPIAdB4IsBaikDACEQIAApAyEhESAHQeiLAWopAwAhEiACKQMAIRMgAikDECEUIAIpAyAhFSACKQMwIRYgAikDCCEXIAIpAxghGCACKQMoIRkgAiACKQM4IAdB8IsBaikDACIafCAAKQMxIAdB+IsBaikDACIbhSIcQiCIIBxC/////w+Dfnw3AzggGSAQfCARIBKFIhFCIIggEUL/////D4N+fCERIBggDXwgDiAPhS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ApAykhCyAAKQMBIQwgACkDESEOIAApAyEhESACKQMAIRUgAikDECEWIAIpAyAhFyACKQMIIRggAikDQCENIAIpA0ghDyACKQMYIRkgAikDUCESIAIpA1ghCCACKQMoIRogAikDYCEQIAIpA2ghCSACIAYgAikDcCIbfCAAKQMxIAIpA3giBoUiHEIgiCAcQv////8Pg358NwM4IBogEHwgESAJhSIRQiCIIBFC/////w+DfnwhESAZIBJ8IA4gCIUiDkIgiCAOQv////8Pg358IQ4gGCANfCAMIA+FIgxCIIggDEL/////D4N+fCEMIAYgCyAbhSILQiCIIAtC/////w+DfiAFfHwhCyAJIBcgFCAQhSIFQiCIIAVC/////w+Dfnx8IRAgCCAWIBMgEoUiBUIgiCAFQv////8Pg358fCESIA8gFSAKIA2FIgVCIIggBUL/////D4N+fHwhCAsgAykDQyACKQM4hSIFQv////8PgyIGIAMpAzsgC4UiC0IgiCINfiIPQv////8PgyAFQiCIIgUgC0L/////D4MiC358IAYgC34iBkIgiHwiC0IghiAGQv////8Pg4QgD0IgiCAFIA1+fCALQiCIfIUgAykDMyARhSIFQv////8PgyIGIAMpAysgEIUiC0IgiCINfiIPQv////8PgyAFQiCIIgUgC0L/////D4MiC358IAYgC34iBkIgiHwiC0IghiAGQv////8Pg4QgD0IgiCAFIA1+fCALQiCIfIUgAykDIyAOhSIFQv////8PgyIGIAMpAxsgEoUiC0IgiCINfiIPQv////8PgyAFQiCIIgUgC0L/////D4MiC358IAYgC34iBkIgiHwiC0IghiAGQv////8Pg4QgD0IgiCAFIA1+fCALQiCIfIUgAykDEyAMhSIFQv////8PgyIGIAMpAwsgCIUiC0IgiCINfiIPQv////8PgyAFQiCIIgUgC0L/////D4MiC358IAYgC34iBkIgiHwiC0IghiAGQv////8Pg4QgD0IgiCAFIA1+fCALQiCIfIUgBEKHla+vmLbem55/fnx8fHwiBEIliCAEhUL5893xmfKZqxZ+IgRCIIggBIUhBAwBCyAEpyEAAkBBACkDoI4BIgRQDQACQCAAQRBLDQAgAEGACCAEEAUhBAwCCwJAIABBgAFLDQAgAEGACCAEEAYhBAwCCyAAQYAIIAQQByEEDAELAkAgAEEQSw0AIAAgA0IAEAUhBAwBCwJAIABBgAFLDQAgACADQgAQBiEEDAELIAAgA0IAEAchBAtBACAEQjiGIARCgP4Dg0IohoQgBEKAgPwHg0IYhiAEQoCAgPgPg0IIhoSEIARCCIhCgICA+A+DIARCGIhCgID8B4OEIARCKIhCgP4DgyAEQjiIhISENwOACiABJAALBgBBgIoBCwIACwvMAQEAQYAIC8QBuP5sOSOkS758AYEs9yGtHN7UbemDkJfbckCkpLezZx/LeeZOzMDleIJa0H3M/3IhuAhGdPdDJI7gNZDmgTomTDwoUruRwwDLiNBlixtTLqNxZEiXog35TjgZ70ap3qzYqPp2P+OcND/53LvHxwtPHYpR4EvNtFkxyJ9+ydl4c2TqxayDNNPrw8WBoP/6E2PrFw3dUbfw2knTFlUmKdRonisWvlh9R6H8j/i40XrQMc5FyzqPlRYEKK/X+8q7S0B+QAIAAA==",hash:"5a2fbdbb"};const mA=new Q;let LA=null;const xA=new Uint8Array(8);function uA(A){return!Number.isInteger(A)||A<0||A>4294967295?new Error("Seed must be given as two valid 32-bit long unsigned integers (lo + high)."):null}function WA(A,I,B){const g=new DataView(A);g.setUint32(0,I,!0),g.setUint32(4,B,!0)}var OA={name:"xxhash128",data:"AGFzbQEAAAABKwdgAAF/YAR/f39/AGAHf39/f39/fwBgA39/fgF+YAR/f39+AGAAAGABfwADDQwAAQIDBAQEBQYFAAUFBAEBAgIGDgJ/AUHAjgULfwBBwAkLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAJSGFzaF9Jbml0AAcLSGFzaF9VcGRhdGUACApIYXNoX0ZpbmFsAAkNSGFzaF9HZXRTdGF0ZQAKDkhhc2hfQ2FsY3VsYXRlAAsKU1RBVEVfU0laRQMBCqBNDAUAQYAKC+QDAw9+AX8BfgJAIANFDQAgACkDMCEEIAApAzghBSAAKQMgIQYgACkDKCEHIAApAxAhCCAAKQMYIQkgACkDACEKIAApAwghCwNAIAUgAUEwaikDACIMfCACQThqKQMAIAFBOGopAwAiDYUiBUIgiCAFQv////8Pg358IQUgByABQSBqKQMAIg58IAJBKGopAwAgAUEoaikDACIPhSIHQiCIIAdC/////w+DfnwhByAJIAFBEGopAwAiEHwgAkEYaikDACABQRhqKQMAIhGFIglCIIggCUL/////D4N+fCEJIAsgASkDACISfCACQQhqIhMpAwAgAUEIaikDACIUhSILQiCIIAtC/////w+DfnwhCyACQTBqKQMAIAyFIgxCIIggDEL/////D4N+IAR8IA18IQQgAkEgaikDACAOhSIMQiCIIAxC/////w+DfiAGfCAPfCEGIAJBEGopAwAgEIUiDEIgiCAMQv////8Pg34gCHwgEXwhCCACKQMAIBKFIgxCIIggDEL/////D4N+IAp8IBR8IQogAUHAAGohASATIQIgA0F/aiIDDQALIAAgCTcDGCAAIAo3AwAgACALNwMIIAAgBzcDKCAAIAg3AxAgACAFNwM4IAAgBjcDICAAIAQ3AzALC94CAgF/AX4CQCAEIAIgASgCACIHayICSQ0AIAAgAyAFIAdBA3RqIAIQASAAIAUgBmoiBykDACAAKQMAIghCL4iFIAiFQrHz3fEJfjcDACAAIAcpAwggACkDCCIIQi+IhSAIhUKx893xCX43AwggACAHKQMQIAApAxAiCEIviIUgCIVCsfPd8Ql+NwMQIAAgBykDGCAAKQMYIghCL4iFIAiFQrHz3fEJfjcDGCAAIAcpAyAgACkDICIIQi+IhSAIhUKx893xCX43AyAgACAHKQMoIAApAygiCEIviIUgCIVCsfPd8Ql+NwMoIAAgBykDMCAAKQMwIghCL4iFIAiFQrHz3fEJfjcDMCAAIAcpAzggACkDOCIIQi+IhSAIhUKx893xCX43AzggACADIAJBBnRqIAUgBCACayIHEAEgASAHNgIADwsgACADIAUgB0EDdGogBBABIAEgByAEajYCAAvtAwEFfiABKQM4IAApAziFIgNC/////w+DIgQgASkDMCAAKQMwhSIFQiCIIgZ+IgdC/////w+DIANCIIgiAyAFQv////8PgyIFfnwgBCAFfiIEQiCIfCIFQiCGIARC/////w+DhCAHQiCIIAMgBn58IAVCIIh8hSABKQMoIAApAyiFIgNC/////w+DIgQgASkDICAAKQMghSIFQiCIIgZ+IgdC/////w+DIANCIIgiAyAFQv////8PgyIFfnwgBCAFfiIEQiCIfCIFQiCGIARC/////w+DhCAHQiCIIAMgBn58IAVCIIh8hSABKQMYIAApAxiFIgNC/////w+DIgQgASkDECAAKQMQhSIFQiCIIgZ+IgdC/////w+DIANCIIgiAyAFQv////8PgyIFfnwgBCAFfiIEQiCIfCIFQiCGIARC/////w+DhCAHQiCIIAMgBn58IAVCIIh8hSABKQMIIAApAwiFIgNC/////w+DIgQgASkDACAAKQMAhSIFQiCIIgZ+IgdC/////w+DIANCIIgiAyAFQv////8PgyIFfnwgBCAFfiIEQiCIfCIFQiCGIARC/////w+DhCAHQiCIIAMgBn58IAVCIIh8hSACfHx8fCICQiWIIAKFQvnz3fGZ8pmrFn4iAkIgiCAChQu6CAIFfgN/AkAgAUEJSQ0AIAAgAUH4iwFqKQMAIgQgAikDOCACKQMwhSADfIUiBUL/////D4NC95Svrwh+IAVCgICAgHCDfEEAKQOAjAEgAikDKCACKQMghSADfYUgBIUiA0IgiCIEQrHz3fEJfnwgBEKHla+vCH4iBEIgiHwgBEL/////D4MgA0L/////D4MiA0Kx893xCX58IANCh5Wvrwh+IgRCIIh8IgVCIIh8IgNCOIYgA0KA/gODQiiGhCADQoCA/AeDQhiGIANCgICA+A+DQgiGhIQgA0IIiEKAgID4D4MgA0IYiEKAgPwHg4QgA0IoiEKA/gODIANCOIiEhIQgBEL/////D4MgAUF/aq1CNoaEIAVCIIZ8hSIEQiCIIgVCz9bTvgJ+IgZC/////w+DIARC/////w+DIgRCvdzKlQx+fCAEQs/W074CfiIEQiCIfCIHQiCGIghCJYggCCAEQv////8Pg4SFQvnz3fGZ8pmrFn4iBEIgiCAEhTcDACAAIAVCvdzKlQx+IANCz9bTvtLHq9lCfnwgBkIgiHwgB0IgiHwiA0IliCADhU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Ih8IglCIIh8QQApA7iMASILQQApA7CMASIMfIUgCUIghiAHQv////8Pg4SFIQcgAkHoAGopAwAgA30gC4UiCUL/////D4MiCyACKQNgIAN8IAyFIgxCIIgiDX4iBkL/////D4MgCUIgiCIJIAxC/////w+DIgx+fCALIAx+IgtCIIh8IgxCIIYgC0L/////D4OEIAZCIIggCSANfnwgDEIgiHyFIAV8IAggCnyFIQULIAJB2ABqKQMAIAN9IAFB2IsBaikDACIIhSIJQv////8PgyIKIAIpA1AgA3wgAUHQiwFqKQMAIguFIgxCIIgiDX4iBkL/////D4MgCUIgiCIJIAxC/////w+DIgx+fCAKIAx+IgpCIIh8IgxCIIYgCkL/////D4OEIAZCIIggCSANfnwgDEIgiHyFIAd8QQApA6iMASIJQQApA6CMASIKfIUhByACQcgAaikDACADfSAJhSIJQv////8PgyIMIAIpA0AgA3wgCoUiCkIgiCINfiIGQv////8PgyAJQiCIIgkgCkL/////D4MiCn58IAwgCn4iCkIgiHwiDEIghiAKQv////8Pg4QgBkIgiCAJIA1+fCAMQiCIfIUgBXwgCCALfIUhBQsgAkE4aikDACADfSABQeiLAWopAwAiCIUiCUL/////D4MiCiACKQMwIAN8IAFB4IsBaikDACILhSIMQiCIIg1+IgZC/////w+DIAlCIIgiCSAMQv////8PgyIMfnwgCiAMfiIKQiCIfCIMQiCGIApC/////w+DhCAGQiCIIAkgDX58IAxCIIh8hSAHfEEAKQOYjAEiB0EAKQOQjAEiCXyFIQYgAkEoaikDACADfSAHhSIHQv////8PgyIKIAIpAyAgA3wgCYUiCUIgiCIMfiINQv////8PgyAHQiCIIgcgCUL/////D4MiCX58IAogCX4iCUIgiHwiCkIghiAJQv////8Pg4QgDUIgiCAHIAx+fCAKQiCIfIUgBXwgCCALfIUhBQsgACACQRhqKQMAIAN9IAFB+IsBaikDACIHhSIIQv////8PgyIJIAIpAxAgA3wgAUHwiwFqKQMAIgqFIgtCIIgiDH4iDUL/////D4MgCEIgiCIIIAtC/////w+DIgt+fCAJIAt+IglCIIh8IgtCIIYgCUL/////D4OEIA1CIIggCCAMfnwgC0IgiHyFIAZ8QQApA4iMASIIQQApA4CMASIJfIUiCyACQQhqKQMAIAN9IAiFIghC/////w+DIgwgAikDACADfCAJhSIJQiCIIg1+IgZC/////w+DIAhCIIgiCCAJQv////8PgyIJfnwgDCAJfiIJQiCIfCIMQiCGIAlC/////w+DhCAGQiCIIAggDX58IAxCIIh8hSAFfCAHIAp8hSIFfCIHQiWIIAeFQvnz3fGZ8pmrFn4iB0IgiCAHhTcDACAAQgAgBUKHla+vmLbem55/fiAEIAN9Qs/W077Sx6vZQn58IAtC49zKlfzO8vWFf358IgNCJYggA4VC+fPd8ZnymasWfiIDQiCIIAOFfTcDCAuhDwMBfxR+An9BACEEIAJB+ABqKQMAIAN9QQApA/iMASIFhSIGQv////8PgyIHIAIpA3AgA3xBACkD8IwBIgiFIglCIIgiCn4iC0L/////D4MgBkIgiCIGIAlC/////w+DIgl+fCAHIAl+IgdCIIh8IglCIIYgB0L/////D4OEIAtCIIggBiAKfnwgCUIgiHyFIAJB2ABqKQMAIAN9QQApA9iMASIHhSIGQv////8PgyIJIAIpA1AgA3xBACkD0IwBIgqFIgtCIIgiDH4iDUL/////D4MgBkIgiCIGIAtC/////w+DIgt+fCAJIAt+IglCIIh8IgtCIIYgCUL/////D4OEIA1CIIggBiAMfnwgC0IgiHyFIAJBOGopAwAgA31BACkDuIwBIgmFIgZC/////w+DIgsgAikDMCADfEEAKQOwjAEiDIUiDUIgiCIOfiIPQv////8PgyAGQiCIIgYgDUL/////D4MiDX58IAsgDX4iC0IgiHwiDUIghiALQv////8Pg4QgD0IgiCAGIA5+fCANQiCIfIUgAkEYaikDACADfUEAKQOYjAEiC4UiBkL/////D4MiDSACKQMQIAN8QQApA5CMASIOhSIPQiCIIhB+IhFC/////w+DIAZCIIgiBiAPQv////8PgyIPfnwgDSAPfiINQiCIfCIPQiCGIA1C/////w+DhCARQiCIIAYgEH58IA9CIIh8hUEAKQOIjAEiDUEAKQOAjAEiD3yFfEEAKQOojAEiEEEAKQOgjAEiEXyFfEEAKQPIjAEiEkEAKQPAjAEiE3yFfEEAKQPojAEiFEEAKQPgjAEiFXyFIgZCJYggBoVC+fPd8ZnymasWfiIGQiCIIAaFIQYgAkHoAGopAwAgA30gFIUiFEL/////D4MiFiACKQNgIAN8IBWFIhVCIIgiF34iGEL/////D4MgFEIgiCIUIBVC/////w+DIhV+fCAWIBV+IhVCIIh8IhZCIIYgFUL/////D4OEIBhCIIggFCAXfnwgFkIgiHyFIAJByABqKQMAIAN9IBKFIhJC/////w+DIhQgAikDQCADfCAThSITQiCIIhV+IhZC/////w+DIBJCIIgiEiATQv////8PgyITfnwgFCATfiITQiCIfCIUQiCGIBNC/////w+DhCAWQiCIIBIgFX58IBRCIIh8hSACQShqKQMAIAN9IBCFIhBC/////w+DIhIgAikDICADfCARhSIRQiCIIhN+IhRC/////w+DIBBCIIgiECARQv////8PgyIRfnwgEiARfiIRQiCIfCISQiCGIBFC/////w+DhCAUQiCIIBAgE358IBJCIIh8hSACQQhqKQMAIAN9IA2FIg1C/////w+DIhAgAikDACADfCAPhSIPQiCIIhF+IhJC/////w+DIA1CIIgiDSAPQv////8PgyIPfnwgECAPfiIPQiCIfCIQQiCGIA9C/////w+DhCASQiCIIA0gEX58IBBCIIh8hSABrSIPQoeVr6+Ytt6bnn9+fCALIA58hXwgCSAMfIV8IAcgCnyFfCAFIAh8hSIFQiWIIAWFQvnz3fGZ8pmrFn4iBUIgiCAFhSEFAkAgAUGgAUgNACABQQV2QXxqIRkDQCACIARqIhpBG2opAwAgA30gBEGYjQFqKQMAIgeFIghC/////w+DIgkgGkETaikDACADfCAEQZCNAWopAwAiCoUiC0IgiCIMfiINQv////8PgyAIQiCIIgggC0L/////D4MiC358IAkgC34iCUIgiHwiC0IghiAJQv////8Pg4QgDUIgiCAIIAx+fCALQiCIfIUgBnwgBEGIjQFqKQMAIgggBEGAjQFqKQMAIgl8hSEGIBpBC2opAwAgA30gCIUiCEL/////D4MiCyAaQQNqKQMAIAN8IAmFIglCIIgiDH4iDUL/////D4MgCEIgiCIIIAlC/////w+DIgl+fCALIAl+IglCIIh8IgtCIIYgCUL/////D4OEIA1CIIggCCAMfnwgC0IgiHyFIAV8IAcgCnyFIQUgBEEgaiEEIBlBf2oiGQ0ACwsgACACQf8AaikDACADfCABQeiLAWopAwAiB4UiCEL/////D4MiCSACKQN3IAN9IAFB4IsBaikDACIKhSILQiCIIgx+Ig1C/////w+DIAhCIIgiCCALQv////8PgyILfnwgCSALfiIJQiCIfCILQiCGIAlC/////w+DhCANQiCIIAggDH58IAtCIIh8hSAGfCABQfiLAWopAwAiBiABQfCLAWopAwAiCHyFIgkgAkHvAGopAwAgA3wgBoUiBkL/////D4MiCyACKQNnIAN9IAiFIghCIIgiDH4iDUL/////D4MgBkIgiCIGIAhC/////w+DIgh+fCALIAh+IghCIIh8IgtCIIYgCEL/////D4OEIA1CIIggBiAMfnwgC0IgiHyFIAV8IAcgCnyFIgZ8IgVCJYggBYVC+fPd8ZnymasWfiIFQiCIIAWFNwMAIABCACAGQoeVr6+Ytt6bnn9+IA8gA31Cz9bTvtLHq9lCfnwgCULj3MqV/M7y9YV/fnwiA0IliCADhUL5893xmfKZqxZ+IgNCIIggA4V9NwMIC98FAgF+AX8CQAJAQQApA4AKIgBQRQ0AQYAIIQFCACEADAELAkBBACkDoI4BIABSDQBBACEBDAELQQAhAUEAQq+v79e895Kg/gAgAH03A/iLAUEAIABCxZbr+djShYIofDcD8IsBQQBCj/Hjja2P9JhOIAB9NwPoiwFBACAAQqus+MXV79HQfHw3A+CLAUEAQtOt1LKShbW0nn8gAH03A9iLAUEAIABCl5r0jvWWvO3JAHw3A9CLAUEAQsWDgv2v/8SxayAAfTcDyIsBQQAgAELqi7OdyOb09UN8NwPAiwFBAELIv/rLnJveueQAIAB9NwO4iwFBACAAQoqjgd/Ume2sMXw3A7CLAUEAQvm57738+MKnHSAAfTcDqIsBQQAgAEKo9dv7s5ynmj98Nw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QhqKQMANwMAIABBEGogC0EQaikDADcDACAAQRhqIAtBGGopAwA3AwAgAEEgaiALQSBqKQMANwMAIABBKGogC0EoaikDADcDACAAQTBqIAtBMGopAwA3AwAgAEE4aiALQThqKQMANwMAIABBwABqIQAgC0HAAGohCyANQUBqIg1BB0sNAAsLIA1FDQELIA1Bf2ohDwJAIA1BB3EiDkUNACANQXhxIQ0DQCAAIAstAAA6AAAgAEEBaiEAIAtBAWohCyAOQX9qIg4NAAsLIA9BB0kNAANAIAAgCykAADcAACAAQQhqIQAgC0EIaiELIA1BeGoiDQ0ACwsgAkHAAGogDGohC0GAjAEhAAJAAkACQCAHQQhJDQACQCAHQThqQQN2QQFqQQdxIg0NAAwCCyANQQN0IQ5BgIwBIQADQCALIAApAwA3AwAgC0EIaiELIABBCGohACANQX9qIg0NAAsgByAOayEHCyAHRQ0BAkACQCAHQQdxIg4NACAHIQ0MAQsgB0F4cSENA0AgCyAALQAAOgAAIAtBAWohCyAAQQFqIQAgDkF/aiIODQALCyAHQQhJDQELA0AgCyAAKQAANwAAIAtBCGohCyAAQQhqIQAgDUF4aiINDQALCyACIAIpAwggAikDQCIIfCADQQAoApyOAWoiACkDASACKQNIIgmFIgpCIIggCkL/////D4N+fDcDCCACIAIpAxggAikDUCIKfCAAKQMRIAIpA1giEIUiEUIgiCARQv////8Pg358NwMYIAIgECAKIAApAwmFIgpCIIggCkL/////D4N+IAIpAxB8fDcDECACIAkgCCAAQXlqKQMAhSIIQiCIIAhC/////w+DfiACKQMAfHw3AwAgACkDGSEIIAIpAyAhCSACIAIpAyggAikDYCIKfCAAKQMhIAIpA2giEIUiEUIgiCARQv////8Pg358NwMoIAIgECAJIAggCoUiCEIgiCAIQv////8Pg358fDcDICACIAYgAikDcCIIfCAAKQMxIAIpA3giBoUiCUIgiCAJQv////8Pg358NwM4IAIgBiAIIAApAymFIghCIIggCEL/////D4N+IAV8fDcDMAsgAiACIANBC2ogBEKHla+vmLbem55/fhADNwNAIAIgAiADQQAoApyOAWpBdWogBELP1tO+0ser2UJ+Qn+FEAM3A0gMAQsgBKchAAJAQQApA6COASIEUA0AAkAgAEEQSw0AIAJBwABqIABBgAggBBAEDAILAkAgAEGAAUsNACACQcAAaiAAQYAIIAQQBQwCCyACQcAAaiAAQYAIIAQQBgwBCwJAIABBEEsNACACQcAAaiAAIANCABAEDAELAkAgAEGAAUsNACACQcAAaiAAIANCABAFDAELIAJBwABqIAAgA0IAEAYLQQAgAikDcDcDuApBACACKQNgNwOoCkEAIAIpA1A3A5gKQQAgAkH4AGopAwA3A8AKQQAgAkHoAGopAwA3A7AKQQAgAkHYAGopAwA3A6AKQQAgAikDSCIEQjiGIARCgP4Dg0IohoQgBEKAgPwHg0IYhiAEQoCAgPgPg0IIhoSEIARCCIhCgICA+A+DIARCGIhCgID8B4OEIARCKIhCgP4DgyAEQjiIhISEIgQ3A4AKQQAgBDcDkApBACACKQNAIgRCOIYgBEKA/gODQiiGhCAEQoCA/AeDQhiGIARCgICA+A+DQgiGhIQgBEIIiEKAgID4D4MgBEIYiEKAgPwHg4QgBEIoiEKA/gODIARCOIiEhIQ3A4gKIAEkAAsGAEGAigELAgALC8wBAQBBgAgLxAG4/mw5I6RLvnwBgSz3Ia0c3tRt6YOQl9tyQKSkt7NnH8t55k7MwOV4glrQfcz/ciG4CEZ090MkjuA1kOaBOiZMPChSu5HDAMuI0GWLG1Muo3FkSJeiDflOOBnvRqnerNio+nY/45w0P/ncu8fHC08dilHgS820WTHIn37J2XhzZOrFrIM00+vDxYGg//oTY+sXDd1Rt/DaSdMWVSYp1GieKxa+WH1HofyP+LjRetAxzkXLOo+VFgQor9f7yrtLQH5AAgAA",hash:"b9ab74e2"};const PA=new Q;let bA=null;const vA=new Uint8Array(8);function jA(A){return!Number.isInteger(A)||A<0||A>4294967295?new Error("Seed must be given as two valid 32-bit long unsigned integers (lo + high)."):null}function TA(A,I,B){const g=new DataView(A);g.setUint32(0,I,!0),g.setUint32(4,B,!0)}var $A={name:"ripemd160",data:"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QQBCgcaUupbx6uZvNwKIiQFBAEIANwKAiQFBgAkgABADIAFBACgCgIkBIgBBA3Q2AgggAUEAKAKEiQFBA3QgAEEddnI2AgxBkAhBOEH4ACAAQT9xIgBBOEkbIABrEAMgAUEIakEIEANBAEEAKAKIiQE2AoAJQQBBACkCjIkBNwKECUEAQQApApSJATcCjAkgAUEQaiQACwtXAQBBgAgLUFwAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",hash:"6abbce74"};const _A=new Q;let AI=null;function II(A,I){A.init();const{blockSize:B}=A,g=function(A,I){const{blockSize:B}=A,g=a(I);if(g.length>B){A.update(g);const I=A.digest("binary");return A.init(),I}return new Uint8Array(g.buffer,g.byteOffset,g.length)}(A,I),Q=new Uint8Array(B);Q.set(g);const C=new Uint8Array(B);for(let A=0;A(A.init(),A.update(Q),i),update:I=>(A.update(I),i),digest:I=>{const B=A.digest("binary");return A.init(),A.update(C),A.update(B),A.digest(I)},save:()=>{throw new Error("save() not supported")},load:()=>{throw new Error("load() not supported")},blockSize:A.blockSize,digestSize:A.digestSize};return i}function BI(A,I){if(!A||!A.then)throw new Error('Invalid hash function is provided! Usage: createHMAC(createMD5(), "key").');return A.then((A=>II(A,I)))}function gI(A){return g(this,void 0,void 0,(function*(){(A=>{if(!A||"object"!=typeof A)throw new Error("Invalid options parameter. It requires an object.");if(!A.hashFunction||!A.hashFunction.then)throw new Error('Invalid hash function is provided! Usage: pbkdf2("password", "salt", 1000, 32, createSHA1()).');if(!Number.isInteger(A.iterations)||A.iterations<1)throw new Error("Iterations should be a positive number");if(!Number.isInteger(A.hashLength)||A.hashLength<1)throw new Error("Hash length should be a positive number");if(void 0===A.outputType&&(A.outputType="hex"),!["hex","binary"].includes(A.outputType))throw new Error(`Insupported output type ${A.outputType}. Valid values: ['hex', 'binary']`)})(A);return function(A,I,B,Q,C){return g(this,void 0,void 0,(function*(){const g=new Uint8Array(Q),i=new Uint8Array(I.length+4),E=new DataView(i.buffer),o=a(I),F=new Uint8Array(o.buffer,o.byteOffset,o.length);i.set(F);let D=0;const c=A.digestSize,w=Math.ceil(Q/c);let k=null,G=null;for(let C=1;C<=w;C++){E.setUint32(I.length,C),A.init(),A.update(i),k=A.digest("binary"),G=k.slice();for(let I=1;I{if(!A||"object"!=typeof A)throw new Error("Invalid options parameter. It requires an object.");if(void 0===A.hash||"string"!=typeof A.hash)throw new Error("Hash should be specified");if(60!==A.hash.length)throw new Error("Hash should be 60 bytes long");if(!(A=>!(!/^\$2[axyb]\$[0-3][0-9]\$[./A-Za-z0-9]{53}$/.test(A)||"0"===A[4]&&Number(A[5])<4||"3"===A[4]&&Number(A[5])>1))(A.hash))throw new Error("Invalid hash");if(A.password=a(A.password),A.password.length<1)throw new Error("Password should be at least 1 byte long");if(A.password.length>72)throw new Error("Password should be at most 72 bytes long")};var oI={name:"whirlpool",data:"AGFzbQEAAAABEQRgAAF/YAF/AGACf38AYAAAAwkIAAECAwEDAAEFBAEBAgIGDgJ/AUHQmwULfwBBgAgLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAJSGFzaF9Jbml0AAMLSGFzaF9VcGRhdGUABApIYXNoX0ZpbmFsAAUNSGFzaF9HZXRTdGF0ZQAGDkhhc2hfQ2FsY3VsYXRlAAcKU1RBVEVfU0laRQMBCu0bCAUAQYAZC8wGAQl+IAApAwAhAUEAQQApA4CbASICNwPAmQEgACkDGCEDIAApAxAhBCAAKQMIIQVBAEEAKQOYmwEiBjcD2JkBQQBBACkDkJsBIgc3A9CZAUEAQQApA4ibASIINwPImQFBACABIAKFNwOAmgFBACAFIAiFNwOImgFBACAEIAeFNwOQmgFBACADIAaFNwOYmgEgACkDICEDQQBBACkDoJsBIgE3A+CZAUEAIAMgAYU3A6CaASAAKQMoIQRBAEEAKQOomwEiAzcD6JkBQQAgBCADhTcDqJoBIAApAzAhBUEAQQAp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UEYdnJyNgKQCUEAQQAoApyJASIBQRh0IAFBgP4DcUEIdHIgAUEIdkGA/gNxIAFBGHZycjYClAlBAEEAKAKgiQEiAUEYdCABQYD+A3FBCHRyIAFBCHZBgP4DcSABQRh2cnI2ApgJQQBBACgCpIkBIgFBGHQgAUGA/gNxQQh0ciABQQh2QYD+A3EgAUEYdnJyNgKcCSAAQRBqJAALBgBBgIkBC5UCAQR/QQBCzdy3nO7Jw/2wfzcCoIkBQQBCvOG8y6qVzpgWNwKYiQFBAELXhZG5gcCBxVo3ApCJAUEAQu+sgJyX16yKyQA3AoiJAUEAQgA3AoCJAQJAIABFDQBBACAANgKAiQFBgAkhAQJAIABBwABJDQBBgAkhAQNAIAEQAyABQcAAaiEBIABBQGoiAEE/Sw0ACyAARQ0BCyAAQX9qIQICQAJAIABBB3EiAw0AQaiJASEEDAELIABBeHEhAEGoiQEhBANAIAQgAS0AADoAACAEQQFqIQQgAUEBaiEBIANBf2oiAw0ACwsgAkEHSQ0AA0AgBCABKQAANwAAIARBCGohBCABQQhqIQEgAEF4aiIADQALCxAECwtRAgBBgAgLBGgAAAAAQZAIC0CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",hash:"b6fb4b8e"};const hI=new Q;let aI=null;A.adler32=function(A){if(null===t)return S(N,B,4).then((I=>(t=I,t.calculate(A))));try{const I=t.calculate(A);return Promise.resolve(I)}catch(A){return Promise.reject(A)}},A.argon2Verify=function(A){return g(this,void 0,void 0,(function*(){(A=>{if(!A||"object"!=typeof A)throw new Error("Invalid options parameter. It requires an object.");if(void 0===A.hash||"string"!=typeof A.hash)throw new Error("Hash should be specified")})(A);const I=((A,I,B)=>{const g=I.match(/^\$argon2(id|i|d)\$v=([0-9]+)\$((?:[mtp]=[0-9]+,){2}[mtp]=[0-9]+)\$([A-Za-z0-9+/]+)\$([A-Za-z0-9+/]+)$/);if(!g)throw new Error("Invalid hash");const[,Q,C,i,E,o]=g;if("19"!==C)throw new Error(`Unsupported version: ${C}`);const F={},D={m:"memorySize",p:"parallelism",t:"iterations"};for(const A of i.split(",")){const[I,B]=A.split("=");F[D[I]]=Number(B)}return Object.assign(Object.assign({},F),{password:A,secret:B,hashType:Q,salt:d(E),hashLength:n(o),outputType:"encoded"})})(A.password,A.hash,A.secret);X(I);const B=A.hash.lastIndexOf("$")+1;return(yield l(I)).substring(B)===A.hash.substring(B)}))},A.argon2d=function(A){return g(this,void 0,void 0,(function*(){return X(A),l(Object.assign(Object.assign({},A),{hashType:"d"}))}))},A.argon2i=function(A){return g(this,void 0,void 0,(function*(){return X(A),l(Object.assign(Object.assign({},A),{hashType:"i"}))}))},A.argon2id=function(A){return g(this,void 0,void 0,(function*(){return X(A),l(Object.assign(Object.assign({},A),{hashType:"id"}))}))},A.bcrypt=function(A){return g(this,void 0,void 0,(function*(){return(A=>{if(!A||"object"!=typeof A)throw new Error("Invalid options parameter. It requires an object.");if(!Number.isInteger(A.costFactor)||A.costFactor<4||A.costFactor>31)throw new Error("Cost factor should be a number between 4 and 31");if(A.password=a(A.password),A.password.length<1)throw new Error("Password should be at least 1 byte long");if(A.password.length>72)throw new Error("Password should be at most 72 bytes long");if(A.salt=a(A.salt),16!==A.salt.length)throw new Error("Salt should be 16 bytes long");if(void 0===A.outputType&&(A.outputType="encoded"),!["hex","binary","encoded"].includes(A.outputType))throw new Error(`Insupported output type ${A.outputType}. Valid values: ['hex', 'binary', 'encoded']`)})(A),iI(A)}))},A.bcryptVerify=function(A){return g(this,void 0,void 0,(function*(){EI(A);const{hash:I,password:B}=A,g=yield e(CI,0);g.writeMemory(a(I),0);const Q=a(B);return g.writeMemory(Q,60),!!g.getExports().bcrypt_verify(Q.length)}))},A.blake2b=function(A,I=512,B=null){if(K(I))return Promise.reject(K(I));let g=null,Q=I;if(null!==B){if(g=a(B),g.length>64)return Promise.reject(new Error("Max key length is 64 bytes"));Q=p(I,g.length)}const C=I/8;if(null===M||M.hashLength!==C)return S(q,f,C).then((I=>(M=I,Q>512&&M.writeMemory(g),M.calculate(A,Q))));try{Q>512&&M.writeMemory(g);const I=M.calculate(A,Q);return Promise.resolve(I)}catch(A){return Promise.reject(A)}},A.blake2s=function(A,I=256,B=null){if(m(I))return Promise.reject(m(I));let g=null,Q=I;if(null!==B){if(g=a(B),g.length>32)return Promise.reject(new Error("Max key length is 32 bytes"));Q=L(I,g.length)}const C=I/8;if(null===Z||Z.hashLength!==C)return S(V,z,C).then((I=>(Z=I,Q>512&&Z.writeMemory(g),Z.calculate(A,Q))));try{Q>512&&Z.writeMemory(g);const I=Z.calculate(A,Q);return Promise.resolve(I)}catch(A){return Promise.reject(A)}},A.blake3=function(A,I=256,B=null){if(O(I))return Promise.reject(O(I));let g=null,Q=0;if(null!==B){if(g=a(B),32!==g.length)return Promise.reject(new Error("Key length must be exactly 32 bytes"));Q=32}const C=I/8,i=C;if(null===W||W.hashLength!==C)return S(u,x,C).then((I=>(W=I,32===Q&&W.writeMemory(g),W.calculate(A,Q,i))));try{32===Q&&W.writeMemory(g);const I=W.calculate(A,Q,i);return Promise.resolve(I)}catch(A){return Promise.reject(A)}},A.crc32=function(A,I=3988292384){if(j(I))return Promise.reject(j(I));if(null===v)return S(b,P,4).then((B=>(v=B,v.calculate(A,I))));try{const B=v.calculate(A,I);return Promise.resolve(B)}catch(A){return Promise.reject(A)}},A.crc64=function(A,I="c96c5795d7870f42"){const{hi:B,lo:g,err:Q}=IA(I);if(null!==Q)return Promise.reject(Q);if(null===_)return S($,T,8).then((I=>(_=I,BA(AA.buffer,g,B),_.writeMemory(AA),_.calculate(A))));try{BA(AA.buffer,g,B),_.writeMemory(AA);const I=_.calculate(A);return Promise.resolve(I)}catch(Q){return Promise.reject(Q)}},A.createAdler32=function(){return e(B,4).then((A=>{A.init();const I={init:()=>(A.init(),I),update:B=>(A.update(B),I),digest:I=>A.digest(I),save:()=>A.save(),load:B=>(A.load(B),I),blockSize:4,digestSize:4};return I}))},A.createBLAKE2b=s,A.createBLAKE2s=function(A=256,I=null){if(m(A))return Promise.reject(m(A));let B=null,g=A;if(null!==I){if(B=a(I),B.length>32)return Promise.reject(new Error("Max key length is 32 bytes"));g=L(A,B.length)}const Q=A/8;return e(z,Q).then((A=>{g>512&&A.writeMemory(B),A.init(g);const I={init:g>512?()=>(A.writeMemory(B),A.init(g),I):()=>(A.init(g),I),update:B=>(A.update(B),I),digest:I=>A.digest(I),save:()=>A.save(),load:B=>(A.load(B),I),blockSize:64,digestSize:Q};return I}))},A.createBLAKE3=function(A=256,I=null){if(O(A))return Promise.reject(O(A));let B=null,g=0;if(null!==I){if(B=a(I),32!==B.length)return Promise.reject(new Error("Key length must be exactly 32 bytes"));g=32}const Q=A/8,C=Q;return e(x,Q).then((A=>{32===g&&A.writeMemory(B),A.init(g);const I={init:32===g?()=>(A.writeMemory(B),A.init(g),I):()=>(A.init(g),I),update:B=>(A.update(B),I),digest:I=>A.digest(I,C),save:()=>A.save(),load:B=>(A.load(B),I),blockSize:64,digestSize:Q};return I}))},A.createCRC32=function(A=3988292384){return j(A)?Promise.reject(j(A)):e(P,4).then((I=>{I.init(A);const B={init:()=>(I.init(A),B),update:A=>(I.update(A),B),digest:A=>I.digest(A),save:()=>I.save(),load:A=>(I.load(A),B),blockSize:4,digestSize:4};return B}))},A.createCRC64=function(A="c96c5795d7870f42"){const{hi:I,lo:B,err:g}=IA(A);return null!==g?Promise.reject(g):e(T,8).then((A=>{const g=new Uint8Array(8);BA(g.buffer,B,I),A.writeMemory(g),A.init();const Q={init:()=>(A.writeMemory(g),A.init(),Q),update:I=>(A.update(I),Q),digest:I=>A.digest(I),save:()=>A.save(),load:I=>(A.load(I),Q),blockSize:8,digestSize:8};return Q}))},A.createHMAC=BI,A.createKeccak=function(A=512){if(dA(A))return Promise.reject(dA(A));const I=A/8;return e(hA,I).then((B=>{B.init(A);const g={init:()=>(B.init(A),g),update:A=>(B.update(A),g),digest:A=>B.digest(A,1),save:()=>B.save(),load:A=>(B.load(A),g),blockSize:200-2*I,digestSize:I};return g}))},A.createMD4=function(){return e(gA,16).then((A=>{A.init();const I={init:()=>(A.init(),I),update:B=>(A.update(B),I),digest:I=>A.digest(I),save:()=>A.save(),load:B=>(A.load(B),I),blockSize:64,digestSize:16};return I}))},A.createMD5=function(){return e(iA,16).then((A=>{A.init();const I={init:()=>(A.init(),I),update:B=>(A.update(B),I),digest:I=>A.digest(I),save:()=>A.save(),load:B=>(A.load(B),I),blockSize:64,digestSize:16};return I}))},A.createRIPEMD160=function(){return e($A,20).then((A=>{A.init();const I={init:()=>(A.init(),I),update:B=>(A.update(B),I),digest:I=>A.digest(I),save:()=>A.save(),load:B=>(A.load(B),I),blockSize:64,digestSize:20};return I}))},A.createSHA1=function(){return e(FA,20).then((A=>{A.init();const I={init:()=>(A.init(),I),update:B=>(A.update(B),I),digest:I=>A.digest(I),save:()=>A.save(),load:B=>(A.load(B),I),blockSize:64,digestSize:20};return I}))},A.createSHA224=function(){return e(yA,28).then((A=>{A.init(224);const I={init:()=>(A.init(224),I),update:B=>(A.update(B),I),digest:I=>A.digest(I),save:()=>A.save(),load:B=>(A.load(B),I),blockSize:64,digestSize:28};return I}))},A.createSHA256=NA,A.createSHA3=function(A=512){if(kA(A))return Promise.reject(kA(A));const I=A/8;return e(hA,I).then((B=>{B.init(A);const g={init:()=>(B.init(A),g),update:A=>(B.update(A),g),digest:A=>B.digest(A,6),save:()=>B.save(),load:A=>(B.load(A),g),blockSize:200-2*I,digestSize:I};return g}))},A.createSHA384=function(){return e(tA,48).then((A=>{A.init(384);const I={init:()=>(A.init(384),I),update:B=>(A.update(B),I),digest:I=>A.digest(I),save:()=>A.save(),load:B=>(A.load(B),I),blockSize:128,digestSize:48};return I}))},A.createSHA512=function(){return e(tA,64).then((A=>{A.init(512);const I={init:()=>(A.init(512),I),update:B=>(A.update(B),I),digest:I=>A.digest(I),save:()=>A.save(),load:B=>(A.load(B),I),blockSize:128,digestSize:64};return I}))},A.createSM3=function(){return e(cI,32).then((A=>{A.init();const I={init:()=>(A.init(),I),update:B=>(A.update(B),I),digest:I=>A.digest(I),save:()=>A.save(),load:B=>(A.load(B),I),blockSize:64,digestSize:32};return I}))},A.createWhirlpool=function(){return e(oI,64).then((A=>{A.init();const I={init:()=>(A.init(),I),update:B=>(A.update(B),I),digest:I=>A.digest(I),save:()=>A.save(),load:B=>(A.load(B),I),blockSize:64,digestSize:64};return I}))},A.createXXHash128=function(A=0,I=0){return jA(A)?Promise.reject(jA(A)):jA(I)?Promise.reject(jA(I)):e(OA,16).then((B=>{const g=new Uint8Array(8);TA(g.buffer,A,I),B.writeMemory(g),B.init();const Q={init:()=>(B.writeMemory(g),B.init(),Q),update:A=>(B.update(A),Q),digest:A=>B.digest(A),save:()=>B.save(),load:A=>(B.load(A),Q),blockSize:512,digestSize:16};return Q}))},A.createXXHash3=function(A=0,I=0){return uA(A)?Promise.reject(uA(A)):uA(I)?Promise.reject(uA(I)):e(ZA,8).then((B=>{const g=new Uint8Array(8);WA(g.buffer,A,I),B.writeMemory(g),B.init();const Q={init:()=>(B.writeMemory(g),B.init(),Q),update:A=>(B.update(A),Q),digest:A=>B.digest(A),save:()=>B.save(),load:A=>(B.load(A),Q),blockSize:512,digestSize:8};return Q}))},A.createXXHash32=function(A=0){return rA(A)?Promise.reject(rA(A)):e(KA,4).then((I=>{I.init(A);const B={init:()=>(I.init(A),B),update:A=>(I.update(A),B),digest:A=>I.digest(A),save:()=>I.save(),load:A=>(I.load(A),B),blockSize:16,digestSize:4};return B}))},A.createXXHash64=function(A=0,I=0){return zA(A)?Promise.reject(zA(A)):zA(I)?Promise.reject(zA(I)):e(YA,8).then((B=>{const g=new Uint8Array(8);VA(g.buffer,A,I),B.writeMemory(g),B.init();const Q={init:()=>(B.writeMemory(g),B.init(),Q),update:A=>(B.update(A),Q),digest:A=>B.digest(A),save:()=>B.save(),load:A=>(B.load(A),Q),blockSize:32,digestSize:8};return Q}))},A.keccak=function(A,I=512){if(dA(I))return Promise.reject(dA(I));const B=I/8;if(null===nA||nA.hashLength!==B)return S(GA,hA,B).then((B=>(nA=B,nA.calculate(A,I,1))));try{const B=nA.calculate(A,I,1);return Promise.resolve(B)}catch(A){return Promise.reject(A)}},A.md4=function(A){if(null===CA)return S(QA,gA,16).then((I=>(CA=I,CA.calculate(A))));try{const I=CA.calculate(A);return Promise.resolve(I)}catch(A){return Promise.reject(A)}},A.md5=function(A){if(null===oA)return S(EA,iA,16).then((I=>(oA=I,oA.calculate(A))));try{const I=oA.calculate(A);return Promise.resolve(I)}catch(A){return Promise.reject(A)}},A.pbkdf2=gI,A.ripemd160=function(A){if(null===AI)return S(_A,$A,20).then((I=>(AI=I,AI.calculate(A))));try{const I=AI.calculate(A);return Promise.resolve(I)}catch(A){return Promise.reject(A)}},A.scrypt=function(A){return g(this,void 0,void 0,(function*(){return(A=>{if(!A||"object"!=typeof A)throw new Error("Invalid options parameter. It requires an object.");if(!Number.isInteger(A.blockSize)||A.blockSize<1)throw new Error("Block size should be a positive number");if(!Number.isInteger(A.costFactor)||A.costFactor<2||!(I=A.costFactor)||I&I-1)throw new Error("Cost factor should be a power of 2, greater than 1");var I;if(!Number.isInteger(A.parallelism)||A.parallelism<1)throw new Error("Parallelism should be a positive number");if(!Number.isInteger(A.hashLength)||A.hashLength<1)throw new Error("Hash length should be a positive number.");if(void 0===A.outputType&&(A.outputType="hex"),!["hex","binary"].includes(A.outputType))throw new Error(`Insupported output type ${A.outputType}. Valid values: ['hex', 'binary']`)})(A),function(A){return g(this,void 0,void 0,(function*(){const{costFactor:I,blockSize:B,parallelism:g,hashLength:Q}=A,C=NA(),i=yield gI({password:A.password,salt:A.salt,iterations:1,hashLength:128*B*g,hashFunction:C,outputType:"binary"}),E=yield e(QI,0),o=128*B*I,F=256*B;E.setMemorySize(i.length+o+F),E.writeMemory(i,0),E.getExports().scrypt(B,I,g);const D=E.getMemory().subarray(0,128*B*g),c=yield gI({password:A.password,salt:D,iterations:1,hashLength:Q,hashFunction:C,outputType:"binary"});return"hex"===A.outputType?h(new Uint8Array(2*Q),c,Q):c}))}(A)}))},A.sha1=function(A){if(null===cA)return S(DA,FA,20).then((I=>(cA=I,cA.calculate(A))));try{const I=cA.calculate(A);return Promise.resolve(I)}catch(A){return Promise.reject(A)}},A.sha224=function(A){if(null===UA)return S(HA,yA,28).then((I=>(UA=I,UA.calculate(A,224))));try{const I=UA.calculate(A,224);return Promise.resolve(I)}catch(A){return Promise.reject(A)}},A.sha256=function(A){if(null===SA)return S(eA,yA,32).then((I=>(SA=I,SA.calculate(A,256))));try{const I=SA.calculate(A,256);return Promise.resolve(I)}catch(A){return Promise.reject(A)}},A.sha3=function(A,I=512){if(kA(I))return Promise.reject(kA(I));const B=I/8;if(null===wA||wA.hashLength!==B)return S(aA,hA,B).then((B=>(wA=B,wA.calculate(A,I,6))));try{const B=wA.calculate(A,I,6);return Promise.resolve(B)}catch(A){return Promise.reject(A)}},A.sha384=function(A){if(null===fA)return S(JA,tA,48).then((I=>(fA=I,fA.calculate(A,384))));try{const I=fA.calculate(A,384);return Promise.resolve(I)}catch(A){return Promise.reject(A)}},A.sha512=function(A){if(null===MA)return S(qA,tA,64).then((I=>(MA=I,MA.calculate(A,512))));try{const I=MA.calculate(A,512);return Promise.resolve(I)}catch(A){return Promise.reject(A)}},A.sm3=function(A){if(null===aI)return S(hI,cI,32).then((I=>(aI=I,aI.calculate(A))));try{const I=aI.calculate(A);return Promise.resolve(I)}catch(A){return Promise.reject(A)}},A.whirlpool=function(A){if(null===DI)return S(FI,oI,64).then((I=>(DI=I,DI.calculate(A))));try{const I=DI.calculate(A);return Promise.resolve(I)}catch(A){return Promise.reject(A)}},A.xxhash128=function(A,I=0,B=0){if(jA(I))return Promise.reject(jA(I));if(jA(B))return Promise.reject(jA(B));if(null===bA)return S(PA,OA,16).then((g=>(bA=g,TA(vA.buffer,I,B),bA.writeMemory(vA),bA.calculate(A))));try{TA(vA.buffer,I,B),bA.writeMemory(vA);const g=bA.calculate(A);return Promise.resolve(g)}catch(A){return Promise.reject(A)}},A.xxhash3=function(A,I=0,B=0){if(uA(I))return Promise.reject(uA(I));if(uA(B))return Promise.reject(uA(B));if(null===LA)return S(mA,ZA,8).then((g=>(LA=g,WA(xA.buffer,I,B),LA.writeMemory(xA),LA.calculate(A))));try{WA(xA.buffer,I,B),LA.writeMemory(xA);const g=LA.calculate(A);return Promise.resolve(g)}catch(A){return Promise.reject(A)}},A.xxhash32=function(A,I=0){if(rA(I))return Promise.reject(rA(I));if(null===sA)return S(pA,KA,4).then((B=>(sA=B,sA.calculate(A,I))));try{const B=sA.calculate(A,I);return Promise.resolve(B)}catch(A){return Promise.reject(A)}},A.xxhash64=function(A,I=0,B=0){if(zA(I))return Promise.reject(zA(I));if(zA(B))return Promise.reject(zA(B));if(null===lA)return S(RA,YA,8).then((g=>(lA=g,VA(XA.buffer,I,B),lA.writeMemory(XA),lA.calculate(A))));try{VA(XA.buffer,I,B),lA.writeMemory(XA);const g=lA.calculate(A);return Promise.resolve(g)}catch(A){return Promise.reject(A)}}})); diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/keccak.umd.min.js b/tools/mnemonic-test/node_modules/hash-wasm/dist/keccak.umd.min.js deleted file mode 100644 index 8f0196c0..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/keccak.umd.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * hash-wasm (https://www.npmjs.com/package/hash-wasm) - * (c) Dani Biro - * @license MIT - */ - -!function(A,Q){"object"==typeof exports&&"undefined"!=typeof module?Q(exports):"function"==typeof define&&define.amd?define(["exports"],Q):Q((A="undefined"!=typeof globalThis?globalThis:A||self).hashwasm=A.hashwasm||{})}(this,(function(A){"use strict";var Q,e={name:"sha3",data:"AGFzbQEAAAABFARgAAF/YAF/AGACf38AYAN/f38AAwgHAAEBAgEAAwUEAQECAgYOAn8BQZCNBQt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX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gA3A5CKAUEAQgA3A4iKAUEAQgA3A4CKAUEAQcAMIAFBAXRrQQN2NgKMjQFBAEEANgKIjQEgABACQeQAQQAoAoyNASIAQQF2ayEDAkBBACgCiI0BIgFBAEgNACAAIQQCQCAAIAFGDQAgAUHIiwFqIQVBACEBA0AgBSABakEAOgAAIAFBAWoiASAAQQAoAoiNASIEa0kNAAsLIARByIsBaiIBIAEtAAAgAnI6AAAgAEHHiwFqIgEgAS0AAEGAAXI6AABByIsBIAAQA0EAQYCAgIB4NgKIjQELAkAgA0EESQ0AIANBAnYiAUEDcSEFQQAhBAJAIAFBf2pBA0kNACABQfz///8DcSEAQQAhAUEAIQQDQCABQYAKaiABQYCKAWooAgA2AgAgAUGECmogAUGEigFqKAIANgIAIAFBiApqIAFBiIoBaigCADYCACABQYwKaiABQYyKAWooAgA2AgAgAUEQaiEBIAAgBEEEaiIERw0ACwsgBUUNACAFQQJ0IQAgBEECdCEBA0AgAUGACmogAUGAigFqKAIANgIAIAFBBGohASAAQXxqIgANAAsLCwvYAQEAQYAIC9ABkAEAAAAAAAAAAAAAAAAAAAEAAAAAAAAAgoAAAAAAAACKgAAAAAAAgACAAIAAAACAi4AAAAAAAAABAACAAAAAAIGAAIAAAACACYAAAAAAAICKAAAAAAAAAIgAAAAAAAAACYAAgAAAAAAKAACAAAAAAIuAAIAAAAAAiwAAAAAAAICJgAAAAAAAgAOAAAAAAACAAoAAAAAAAICAAAAAAAAAgAqAAAAAAAAACgAAgAAAAICBgACAAAAAgICAAAAAAACAAQAAgAAAAAAIgACAAAAAgA==",hash:"fb24e536"};function I(A,Q,e,I){return new(e||(e=Promise))((function(g,t){function B(A){try{o(I.next(A))}catch(A){t(A)}}function i(A){try{o(I.throw(A))}catch(A){t(A)}}function o(A){var Q;A.done?g(A.value):(Q=A.value,Q instanceof e?Q:new e((function(A){A(Q)}))).then(B,i)}o((I=I.apply(A,Q||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class g{constructor(){this.mutex=Promise.resolve()}lock(){let A=()=>{};return this.mutex=this.mutex.then((()=>new Promise(A))),new Promise((Q=>{A=Q}))}dispatch(A){return I(this,void 0,void 0,(function*(){const Q=yield this.lock();try{return yield Promise.resolve(A())}finally{Q()}}))}}const t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,B=null!==(Q=t.Buffer)&&void 0!==Q?Q:null,i=t.TextEncoder?new t.TextEncoder:null;function o(A,Q){return(15&A)+(A>>6|A>>3&8)<<4|(15&Q)+(Q>>6|Q>>3&8)}const n="a".charCodeAt(0)-10,C="0".charCodeAt(0);function r(A,Q,e){let I=0;for(let g=0;g>>4;A[I++]=e>9?e+n:e+C,e=15&Q[g],A[I++]=e>9?e+n:e+C}return String.fromCharCode.apply(null,A)}const s=null!==B?A=>{if("string"==typeof A){const Q=B.from(A,"utf8");return new Uint8Array(Q.buffer,Q.byteOffset,Q.length)}if(B.isBuffer(A))return new Uint8Array(A.buffer,A.byteOffset,A.length);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")}:A=>{if("string"==typeof A)return i.encode(A);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")},E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",D=new Uint8Array(256);for(let A=0;A>4,g+=1,I[g]=(15&t)<<4|B>>2,g+=1,I[g]=(3&B)<<6|63&i,g+=1}return I}const a=16384,h=new g,f=new Map;function l(A,Q){return I(this,void 0,void 0,(function*(){let e=null,g=null,t=!1;if("undefined"==typeof WebAssembly)throw new Error("WebAssembly is not supported in this environment!");const B=()=>new DataView(e.exports.memory.buffer).getUint32(e.exports.STATE_SIZE,!0),i=h.dispatch((()=>I(this,void 0,void 0,(function*(){if(!f.has(A.name)){const Q=c(A.data),e=WebAssembly.compile(Q);f.set(A.name,e)}const Q=yield f.get(A.name);e=yield WebAssembly.instantiate(Q,{})})))),n=(A=null)=>{t=!0,e.exports.Hash_Init(A)},C=A=>{if(!t)throw new Error("update() called before init()");(A=>{let Q=0;for(;Q{if(!t)throw new Error("digest() called before init()");return t=!1,e.exports.Hash_Final(I),"binary"===A?g.slice(0,Q):r(E,g,Q)},l=A=>"string"==typeof A?A.length<4096:A.byteLength!0;break;case"blake2b":case"blake2s":U=(A,Q)=>Q<=512&&l(A);break;case"blake3":U=(A,Q)=>0===Q&&l(A);break;case"xxhash64":case"xxhash3":case"xxhash128":case"crc64":U=()=>!1}return yield(()=>I(this,void 0,void 0,(function*(){e||(yield i);const A=e.exports.Hash_GetBuffer(),Q=e.exports.memory.buffer;g=new Uint8Array(Q,A,a)})))(),{getMemory:()=>g,writeMemory:(A,Q=0)=>{g.set(A,Q)},getExports:()=>e.exports,setMemorySize:A=>{e.exports.Hash_SetMemorySize(A);const Q=e.exports.Hash_GetBuffer(),I=e.exports.memory.buffer;g=new Uint8Array(I,Q,A)},init:n,update:C,digest:D,save:()=>{if(!t)throw new Error("save() can only be called after init() and before digest()");const Q=e.exports.Hash_GetState(),I=B(),g=e.exports.memory.buffer,i=new Uint8Array(g,Q,I),n=new Uint8Array(4+I);return function(A,Q){const e=Q.length>>1;for(let I=0;I{if(!(Q instanceof Uint8Array))throw new Error("load() expects an Uint8Array generated by save()");const I=e.exports.Hash_GetState(),g=B(),i=4+g,n=e.exports.memory.buffer;if(Q.length!==i)throw new Error(`Bad state length (expected ${i} bytes, got ${Q.length})`);if(!function(A,Q){if(A.length!==2*Q.length)return!1;for(let e=0;e{if(!U(A,I))return n(I),C(A),D("hex",t);const B=s(A);return g.set(B),e.exports.Hash_Calculate(B.length,I,t),r(E,g,Q)},hashLength:Q}}))}const U=new g;let u=null;function y(A){return[224,256,384,512].includes(A)?null:new Error("Invalid variant! Valid values: 224, 256, 384, 512")}A.createKeccak=function(A=512){if(y(A))return Promise.reject(y(A));const Q=A/8;return l(e,Q).then((e=>{e.init(A);const I={init:()=>(e.init(A),I),update:A=>(e.update(A),I),digest:A=>e.digest(A,1),save:()=>e.save(),load:A=>(e.load(A),I),blockSize:200-2*Q,digestSize:Q};return I}))},A.keccak=function(A,Q=512){if(y(Q))return Promise.reject(y(Q));const g=Q/8;if(null===u||u.hashLength!==g)return function(A,Q,e){return I(this,void 0,void 0,(function*(){const I=yield A.lock(),g=yield l(Q,e);return I(),g}))}(U,e,g).then((e=>(u=e,u.calculate(A,Q,1))));try{const e=u.calculate(A,Q,1);return Promise.resolve(e)}catch(A){return Promise.reject(A)}}})); diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/WASMInterface.d.ts b/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/WASMInterface.d.ts deleted file mode 100644 index 9ae0a114..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/WASMInterface.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { type IDataType, type IEmbeddedWasm } from "./util"; -export declare const MAX_HEAP: number; -type ThenArg = T extends Promise ? U : T extends (...args: any[]) => Promise ? V : T; -export type IHasher = { - /** - * Initializes hash state to default value - */ - init: () => IHasher; - /** - * Updates the hash content with the given data - */ - update: (data: IDataType) => IHasher; - /** - * Calculates the hash of all of the data passed to be hashed with hash.update(). - * Defaults to hexadecimal string - * @param outputType If outputType is "binary", it returns Uint8Array. Otherwise it - * returns hexadecimal string - */ - digest: { - (outputType: "binary"): Uint8Array; - (outputType?: "hex"): string; - }; - /** - * Save the current internal state of the hasher for later resumption with load(). - * Cannot be called before .init() or after .digest() - * - * Note that this state can include arbitrary information about the value being hashed (e.g. - * could include N plaintext bytes from the value), so needs to be treated as being as - * sensitive as the input value itself. - */ - save: () => Uint8Array; - /** - * Resume a state that was created by save(). If this state was not created by a - * compatible build of hash-wasm, an exception will be thrown. - */ - load: (state: Uint8Array) => IHasher; - /** - * Block size in bytes - */ - blockSize: number; - /** - * Digest size in bytes - */ - digestSize: number; -}; -export declare function WASMInterface(binary: IEmbeddedWasm, hashLength: number): Promise<{ - getMemory: () => Uint8Array; - writeMemory: (data: Uint8Array, offset?: number) => void; - getExports: () => any; - setMemorySize: (totalSize: number) => void; - init: (bits?: number) => void; - update: (data: IDataType) => void; - digest: (outputType: "hex" | "binary", padding?: number) => Uint8Array | string; - save: () => Uint8Array; - load: (state: Uint8Array) => void; - calculate: (data: IDataType, initParam?: any, digestParam?: any) => string; - hashLength: number; -}>; -export type IWASMInterface = ThenArg>; -export {}; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/adler32.d.ts b/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/adler32.d.ts deleted file mode 100644 index 08381211..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/adler32.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { type IHasher } from "./WASMInterface"; -import type { IDataType } from "./util"; -/** - * Calculates Adler-32 hash. The resulting 32-bit hash is stored in - * network byte order (big-endian). - * - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ -export declare function adler32(data: IDataType): Promise; -/** - * Creates a new Adler-32 hash instance - */ -export declare function createAdler32(): Promise; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/argon2.d.ts b/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/argon2.d.ts deleted file mode 100644 index 8be0b934..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/argon2.d.ts +++ /dev/null @@ -1,74 +0,0 @@ -import { type IDataType } from "./util"; -export interface IArgon2Options { - /** - * Password (or message) to be hashed - */ - password: IDataType; - /** - * Salt (usually containing random bytes) - */ - salt: IDataType; - /** - * Secret for keyed hashing - */ - secret?: IDataType; - /** - * Number of iterations to perform - */ - iterations: number; - /** - * Degree of parallelism - */ - parallelism: number; - /** - * Amount of memory to be used in kibibytes (1024 bytes) - */ - memorySize: number; - /** - * Output size in bytes - */ - hashLength: number; - /** - * Desired output type. Defaults to 'hex' - */ - outputType?: "hex" | "binary" | "encoded"; -} -interface IArgon2OptionsBinary { - outputType: "binary"; -} -type Argon2ReturnType = T extends IArgon2OptionsBinary ? Uint8Array : string; -/** - * Calculates hash using the argon2i password-hashing function - * @returns Computed hash - */ -export declare function argon2i(options: T): Promise>; -/** - * Calculates hash using the argon2id password-hashing function - * @returns Computed hash - */ -export declare function argon2id(options: T): Promise>; -/** - * Calculates hash using the argon2d password-hashing function - * @returns Computed hash - */ -export declare function argon2d(options: T): Promise>; -export interface Argon2VerifyOptions { - /** - * Password to be verified - */ - password: IDataType; - /** - * Secret used on hash creation - */ - secret?: IDataType; - /** - * A previously generated argon2 hash in the 'encoded' output format - */ - hash: string; -} -/** - * Verifies password using the argon2 password-hashing function - * @returns True if the encoded hash matches the password - */ -export declare function argon2Verify(options: Argon2VerifyOptions): Promise; -export {}; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/bcrypt.d.ts b/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/bcrypt.d.ts deleted file mode 100644 index 47307db5..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/bcrypt.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { type IDataType } from "./util"; -export interface BcryptOptions { - /** - * Password to be hashed - */ - password: IDataType; - /** - * Salt (16 bytes long - usually containing random bytes) - */ - salt: IDataType; - /** - * Number of iterations to perform (4 - 31) - */ - costFactor: number; - /** - * Desired output type. Defaults to 'encoded' - */ - outputType?: "hex" | "binary" | "encoded"; -} -interface IBcryptOptionsBinary { - outputType: "binary"; -} -type BcryptReturnType = T extends IBcryptOptionsBinary ? Uint8Array : string; -/** - * Calculates hash using the bcrypt password-hashing function - * @returns Computed hash - */ -export declare function bcrypt(options: T): Promise>; -export interface BcryptVerifyOptions { - /** - * Password to be verified - */ - password: IDataType; - /** - * A previously generated bcrypt hash in the 'encoded' output format - */ - hash: string; -} -/** - * Verifies password using bcrypt password-hashing function - * @returns True if the encoded hash matches the password - */ -export declare function bcryptVerify(options: BcryptVerifyOptions): Promise; -export {}; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/blake2b.d.ts b/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/blake2b.d.ts deleted file mode 100644 index e1be8b41..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/blake2b.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { type IHasher } from "./WASMInterface"; -import { type IDataType } from "./util"; -/** - * Calculates BLAKE2b hash - * @param data Input data (string, Buffer or TypedArray) - * @param bits Number of output bits, which has to be a number - * divisible by 8, between 8 and 512. Defaults to 512. - * @param key Optional key (string, Buffer or TypedArray). Maximum length is 64 bytes. - * @returns Computed hash as a hexadecimal string - */ -export declare function blake2b(data: IDataType, bits?: number, key?: IDataType): Promise; -/** - * Creates a new BLAKE2b hash instance - * @param bits Number of output bits, which has to be a number - * divisible by 8, between 8 and 512. Defaults to 512. - * @param key Optional key (string, Buffer or TypedArray). Maximum length is 64 bytes. - */ -export declare function createBLAKE2b(bits?: number, key?: IDataType): Promise; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/blake2s.d.ts b/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/blake2s.d.ts deleted file mode 100644 index 8b260b17..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/blake2s.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { type IHasher } from "./WASMInterface"; -import { type IDataType } from "./util"; -/** - * Calculates BLAKE2s hash - * @param data Input data (string, Buffer or TypedArray) - * @param bits Number of output bits, which has to be a number - * divisible by 8, between 8 and 256. Defaults to 256. - * @param key Optional key (string, Buffer or TypedArray). Maximum length is 32 bytes. - * @returns Computed hash as a hexadecimal string - */ -export declare function blake2s(data: IDataType, bits?: number, key?: IDataType): Promise; -/** - * Creates a new BLAKE2s hash instance - * @param bits Number of output bits, which has to be a number - * divisible by 8, between 8 and 256. Defaults to 256. - * @param key Optional key (string, Buffer or TypedArray). Maximum length is 32 bytes. - */ -export declare function createBLAKE2s(bits?: number, key?: IDataType): Promise; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/blake3.d.ts b/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/blake3.d.ts deleted file mode 100644 index 5bfaa020..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/blake3.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { type IHasher } from "./WASMInterface"; -import { type IDataType } from "./util"; -/** - * Calculates BLAKE3 hash - * @param data Input data (string, Buffer or TypedArray) - * @param bits Number of output bits, which has to be a number - * divisible by 8. Defaults to 256. - * @param key Optional key (string, Buffer or TypedArray). Length should be 32 bytes. - * @returns Computed hash as a hexadecimal string - */ -export declare function blake3(data: IDataType, bits?: number, key?: IDataType): Promise; -/** - * Creates a new BLAKE3 hash instance - * @param bits Number of output bits, which has to be a number - * divisible by 8. Defaults to 256. - * @param key Optional key (string, Buffer or TypedArray). Length should be 32 bytes. - */ -export declare function createBLAKE3(bits?: number, key?: IDataType): Promise; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/crc32.d.ts b/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/crc32.d.ts deleted file mode 100644 index f45fee0f..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/crc32.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { type IHasher } from "./WASMInterface"; -import type { IDataType } from "./util"; -/** - * Calculates CRC-32 hash - * @param data Input data (string, Buffer or TypedArray) - * @param polynomial Input polynomial (defaults to 0xedb88320, for CRC32C use 0x82f63b78) - * @returns Computed hash as a hexadecimal string - */ -export declare function crc32(data: IDataType, polynomial?: number): Promise; -/** - * Creates a new CRC-32 hash instance - * @param polynomial Input polynomial (defaults to 0xedb88320, for CRC32C use 0x82f63b78) - */ -export declare function createCRC32(polynomial?: number): Promise; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/crc64.d.ts b/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/crc64.d.ts deleted file mode 100644 index dad998c9..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/crc64.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { type IHasher } from "./WASMInterface"; -import type { IDataType } from "./util"; -/** - * Calculates CRC-64 hash - * @param data Input data (string, Buffer or TypedArray) - * @param polynomial Input polynomial (defaults to 'c96c5795d7870f42' - ECMA) - * @returns Computed hash as a hexadecimal string - */ -export declare function crc64(data: IDataType, polynomial?: string): Promise; -/** - * Creates a new CRC-64 hash instance - * @param polynomial Input polynomial (defaults to 'c96c5795d7870f42' - ECMA) - */ -export declare function createCRC64(polynomial?: string): Promise; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/hmac.d.ts b/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/hmac.d.ts deleted file mode 100644 index f546454e..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/hmac.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { IHasher } from "./WASMInterface"; -import { type IDataType } from "./util"; -/** - * Calculates HMAC hash - * @param hash Hash algorithm to use. It has to be the return value of a function like createSHA1() - * @param key Key (string, Buffer or TypedArray) - */ -export declare function createHMAC(hash: Promise, key: IDataType): Promise; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/index.d.ts b/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/index.d.ts deleted file mode 100644 index 4bb4aaf4..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/index.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -export * from "./adler32"; -export * from "./argon2"; -export * from "./blake2b"; -export * from "./blake2s"; -export * from "./blake3"; -export * from "./crc32"; -export * from "./crc64"; -export * from "./md4"; -export * from "./md5"; -export * from "./sha1"; -export * from "./sha3"; -export * from "./keccak"; -export * from "./sha224"; -export * from "./sha256"; -export * from "./sha384"; -export * from "./sha512"; -export * from "./xxhash32"; -export * from "./xxhash64"; -export * from "./xxhash3"; -export * from "./xxhash128"; -export * from "./ripemd160"; -export * from "./hmac"; -export * from "./pbkdf2"; -export * from "./scrypt"; -export * from "./bcrypt"; -export * from "./whirlpool"; -export * from "./sm3"; -export type { IDataType } from "./util"; -export type { IHasher } from "./WASMInterface"; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/keccak.d.ts b/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/keccak.d.ts deleted file mode 100644 index f624eed8..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/keccak.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { type IHasher } from "./WASMInterface"; -import type { IDataType } from "./util"; -type IValidBits = 224 | 256 | 384 | 512; -/** - * Calculates Keccak hash - * @param data Input data (string, Buffer or TypedArray) - * @param bits Number of output bits. Valid values: 224, 256, 384, 512 - * @returns Computed hash as a hexadecimal string - */ -export declare function keccak(data: IDataType, bits?: IValidBits): Promise; -/** - * Creates a new Keccak hash instance - * @param bits Number of output bits. Valid values: 224, 256, 384, 512 - */ -export declare function createKeccak(bits?: IValidBits): Promise; -export {}; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/lockedCreate.d.ts b/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/lockedCreate.d.ts deleted file mode 100644 index ba83dcdd..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/lockedCreate.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { type IWASMInterface } from "./WASMInterface"; -import type Mutex from "./mutex"; -import type { IEmbeddedWasm } from "./util"; -export default function lockedCreate(mutex: Mutex, binary: IEmbeddedWasm, hashLength: number): Promise; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/md4.d.ts b/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/md4.d.ts deleted file mode 100644 index 47d31744..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/md4.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { type IHasher } from "./WASMInterface"; -import type { IDataType } from "./util"; -/** - * Calculates MD4 hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ -export declare function md4(data: IDataType): Promise; -/** - * Creates a new MD4 hash instance - */ -export declare function createMD4(): Promise; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/md5.d.ts b/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/md5.d.ts deleted file mode 100644 index 2b1bdfcb..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/md5.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { type IHasher } from "./WASMInterface"; -import type { IDataType } from "./util"; -/** - * Calculates MD5 hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ -export declare function md5(data: IDataType): Promise; -/** - * Creates a new MD5 hash instance - */ -export declare function createMD5(): Promise; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/mutex.d.ts b/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/mutex.d.ts deleted file mode 100644 index 83fd6ff1..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/mutex.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -declare class Mutex { - private mutex; - lock(): PromiseLike<() => void>; - dispatch(fn: () => PromiseLike): Promise; -} -export default Mutex; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/pbkdf2.d.ts b/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/pbkdf2.d.ts deleted file mode 100644 index 2d065bdc..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/pbkdf2.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import type { IHasher } from "./WASMInterface"; -import { type IDataType } from "./util"; -export interface IPBKDF2Options { - /** - * Password (or message) to be hashed - */ - password: IDataType; - /** - * Salt (usually containing random bytes) - */ - salt: IDataType; - /** - * Number of iterations to perform - */ - iterations: number; - /** - * Output size in bytes - */ - hashLength: number; - /** - * Hash algorithm to use. It has to be the return value of a function like createSHA1() - */ - hashFunction: Promise; - /** - * Desired output type. Defaults to 'hex' - */ - outputType?: "hex" | "binary"; -} -interface IPBKDF2OptionsBinary { - outputType: "binary"; -} -type PBKDF2ReturnType = T extends IPBKDF2OptionsBinary ? Uint8Array : string; -/** - * Generates a new PBKDF2 hash for the supplied password - */ -export declare function pbkdf2(options: T): Promise>; -export {}; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/ripemd160.d.ts b/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/ripemd160.d.ts deleted file mode 100644 index a600f7a9..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/ripemd160.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { type IHasher } from "./WASMInterface"; -import type { IDataType } from "./util"; -/** - * Calculates RIPEMD-160 hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ -export declare function ripemd160(data: IDataType): Promise; -/** - * Creates a new RIPEMD-160 hash instance - */ -export declare function createRIPEMD160(): Promise; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/scrypt.d.ts b/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/scrypt.d.ts deleted file mode 100644 index a4572f20..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/scrypt.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { type IDataType } from "./util"; -export interface ScryptOptions { - /** - * Password (or message) to be hashed - */ - password: IDataType; - /** - * Salt (usually containing random bytes) - */ - salt: IDataType; - /** - * CPU / memory cost - must be a power of 2 (e.g. 1024) - */ - costFactor: number; - /** - * Block size (8 is commonly used) - */ - blockSize: number; - /** - * Degree of parallelism - */ - parallelism: number; - /** - * Output size in bytes - */ - hashLength: number; - /** - * Output data type. Defaults to hexadecimal string - */ - outputType?: "hex" | "binary"; -} -interface IScryptOptionsBinary { - outputType: "binary"; -} -type ScryptReturnType = T extends IScryptOptionsBinary ? Uint8Array : string; -/** - * Calculates hash using the scrypt password-based key derivation function - * @returns Computed hash as a hexadecimal string or as - * Uint8Array depending on the outputType option - */ -export declare function scrypt(options: T): Promise>; -export {}; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/sha1.d.ts b/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/sha1.d.ts deleted file mode 100644 index 5bff40ca..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/sha1.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { type IHasher } from "./WASMInterface"; -import type { IDataType } from "./util"; -/** - * Calculates SHA-1 hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ -export declare function sha1(data: IDataType): Promise; -/** - * Creates a new SHA-1 hash instance - */ -export declare function createSHA1(): Promise; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/sha224.d.ts b/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/sha224.d.ts deleted file mode 100644 index 1d67e9e7..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/sha224.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { type IHasher } from "./WASMInterface"; -import type { IDataType } from "./util"; -/** - * Calculates SHA-2 (SHA-224) hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ -export declare function sha224(data: IDataType): Promise; -/** - * Creates a new SHA-2 (SHA-224) hash instance - */ -export declare function createSHA224(): Promise; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/sha256.d.ts b/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/sha256.d.ts deleted file mode 100644 index d4fb620c..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/sha256.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { type IHasher } from "./WASMInterface"; -import type { IDataType } from "./util"; -/** - * Calculates SHA-2 (SHA-256) hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ -export declare function sha256(data: IDataType): Promise; -/** - * Creates a new SHA-2 (SHA-256) hash instance - */ -export declare function createSHA256(): Promise; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/sha3.d.ts b/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/sha3.d.ts deleted file mode 100644 index ac304f14..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/sha3.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { type IHasher } from "./WASMInterface"; -import type { IDataType } from "./util"; -type IValidBits = 224 | 256 | 384 | 512; -/** - * Calculates SHA-3 hash - * @param data Input data (string, Buffer or TypedArray) - * @param bits Number of output bits. Valid values: 224, 256, 384, 512 - * @returns Computed hash as a hexadecimal string - */ -export declare function sha3(data: IDataType, bits?: IValidBits): Promise; -/** - * Creates a new SHA-3 hash instance - * @param bits Number of output bits. Valid values: 224, 256, 384, 512 - */ -export declare function createSHA3(bits?: IValidBits): Promise; -export {}; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/sha384.d.ts b/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/sha384.d.ts deleted file mode 100644 index f69f5c0c..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/sha384.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { type IHasher } from "./WASMInterface"; -import type { IDataType } from "./util"; -/** - * Calculates SHA-2 (SHA-384) hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ -export declare function sha384(data: IDataType): Promise; -/** - * Creates a new SHA-2 (SHA-384) hash instance - */ -export declare function createSHA384(): Promise; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/sha512.d.ts b/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/sha512.d.ts deleted file mode 100644 index c83ccd42..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/sha512.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { type IHasher } from "./WASMInterface"; -import type { IDataType } from "./util"; -/** - * Calculates SHA-2 (SHA-512) hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ -export declare function sha512(data: IDataType): Promise; -/** - * Creates a new SHA-2 (SHA-512) hash instance - */ -export declare function createSHA512(): Promise; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/sm3.d.ts b/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/sm3.d.ts deleted file mode 100644 index 807de5c3..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/sm3.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { type IHasher } from "./WASMInterface"; -import type { IDataType } from "./util"; -/** - * Calculates SM3 hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ -export declare function sm3(data: IDataType): Promise; -/** - * Creates a new SM3 hash instance - */ -export declare function createSM3(): Promise; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/util.d.ts b/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/util.d.ts deleted file mode 100644 index 43e5e452..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/util.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -export type ITypedArray = Uint8Array | Uint16Array | Uint32Array; -export type IDataType = string | Buffer | ITypedArray; -export type IEmbeddedWasm = { - name: string; - data: string; - hash: string; -}; -export declare function intArrayToString(arr: Uint8Array, len: number): string; -export declare function writeHexToUInt8(buf: Uint8Array, str: string): void; -export declare function hexStringEqualsUInt8(str: string, buf: Uint8Array): boolean; -export declare function getDigestHex(tmpBuffer: Uint8Array, input: Uint8Array, hashLength: number): string; -export declare const getUInt8Buffer: (data: IDataType) => Uint8Array; -export declare function encodeBase64(data: Uint8Array, pad?: boolean): string; -export declare function getDecodeBase64Length(data: string): number; -export declare function decodeBase64(data: string): Uint8Array; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/whirlpool.d.ts b/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/whirlpool.d.ts deleted file mode 100644 index bbaffec2..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/whirlpool.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { type IHasher } from "./WASMInterface"; -import type { IDataType } from "./util"; -/** - * Calculates Whirlpool hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ -export declare function whirlpool(data: IDataType): Promise; -/** - * Creates a new Whirlpool hash instance - */ -export declare function createWhirlpool(): Promise; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/xxhash128.d.ts b/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/xxhash128.d.ts deleted file mode 100644 index 3c92f054..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/xxhash128.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { type IHasher } from "./WASMInterface"; -import type { IDataType } from "./util"; -/** - * Calculates xxHash128 hash - * @param data Input data (string, Buffer or TypedArray) - * @param seedLow Lower 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @param seedHigh Higher 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @returns Computed hash as a hexadecimal string - */ -export declare function xxhash128(data: IDataType, seedLow?: number, seedHigh?: number): Promise; -/** - * Creates a new xxHash128 hash instance - * @param seedLow Lower 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @param seedHigh Higher 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - */ -export declare function createXXHash128(seedLow?: number, seedHigh?: number): Promise; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/xxhash3.d.ts b/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/xxhash3.d.ts deleted file mode 100644 index 83c6237c..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/xxhash3.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { type IHasher } from "./WASMInterface"; -import type { IDataType } from "./util"; -/** - * Calculates xxHash3 hash - * @param data Input data (string, Buffer or TypedArray) - * @param seedLow Lower 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @param seedHigh Higher 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @returns Computed hash as a hexadecimal string - */ -export declare function xxhash3(data: IDataType, seedLow?: number, seedHigh?: number): Promise; -/** - * Creates a new xxHash3 hash instance - * @param seedLow Lower 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @param seedHigh Higher 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - */ -export declare function createXXHash3(seedLow?: number, seedHigh?: number): Promise; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/xxhash32.d.ts b/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/xxhash32.d.ts deleted file mode 100644 index be113d15..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/xxhash32.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { type IHasher } from "./WASMInterface"; -import type { IDataType } from "./util"; -/** - * Calculates xxHash32 hash - * @param data Input data (string, Buffer or TypedArray) - * @param seed Number used to initialize the internal state of the algorithm (defaults to 0) - * @returns Computed hash as a hexadecimal string - */ -export declare function xxhash32(data: IDataType, seed?: number): Promise; -/** - * Creates a new xxHash32 hash instance - * @param data Input data (string, Buffer or TypedArray) - * @param seed Number used to initialize the internal state of the algorithm (defaults to 0) - */ -export declare function createXXHash32(seed?: number): Promise; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/xxhash64.d.ts b/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/xxhash64.d.ts deleted file mode 100644 index b8ee6885..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/lib/xxhash64.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { type IHasher } from "./WASMInterface"; -import type { IDataType } from "./util"; -/** - * Calculates xxHash64 hash - * @param data Input data (string, Buffer or TypedArray) - * @param seedLow Lower 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @param seedHigh Higher 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @returns Computed hash as a hexadecimal string - */ -export declare function xxhash64(data: IDataType, seedLow?: number, seedHigh?: number): Promise; -/** - * Creates a new xxHash64 hash instance - * @param seedLow Lower 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @param seedHigh Higher 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - */ -export declare function createXXHash64(seedLow?: number, seedHigh?: number): Promise; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/md4.umd.min.js b/tools/mnemonic-test/node_modules/hash-wasm/dist/md4.umd.min.js deleted file mode 100644 index df61434f..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/md4.umd.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * hash-wasm (https://www.npmjs.com/package/hash-wasm) - * (c) Dani Biro - * @license MIT - */ - -!function(A,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((A="undefined"!=typeof globalThis?globalThis:A||self).hashwasm=A.hashwasm||{})}(this,(function(A){"use strict";var e,t={name:"md4",data:"AGFzbQEAAAABEgRgAAF/YAAAYAF/AGACf38BfwMIBwABAgMBAAIFBAEBAgIGDgJ/AUGgigULfwBBgAgLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAJSGFzaF9Jbml0AAELSGFzaF9VcGRhdGUAAgpIYXNoX0ZpbmFsAAQNSGFzaF9HZXRTdGF0ZQAFDkhhc2hfQ2FsY3VsYXRlAAYKU1RBVEVfU0laRQMBCucUBwUAQYAJCy0AQQBC/rnrxemOlZkQNwKQiQFBAEKBxpS6lvHq5m83AoiJAUEAQgA3AoCJAQu+BQEHf0EAQQAoAoCJASIBIABqQf////8BcSICNgKAiQFBAEEAKAKEiQEgAiABSWogAEEddmo2AoSJAQJAAkACQAJAAkACQCABQT9xIg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BFzakETdyIRIBMgEnNxIBJzakEDdyISIBEgE3NxIBNzakEHdyITIBIgEXNxIBFzakELdyIVaiATIAxqIBIgDWogESAGaiAVIBMgEnNxIBJzakETdyIRIBUgE3NxIBNzakEDdyISIBEgFXNxIBVzakEHdyITIBIgEXNxIBFzakELdyIVIAAoAjgiFmogEyAAKAI0IhdqIBIgACgCMCIYaiARIApqIBUgEyASc3EgEnNqQRN3IhIgFSATc3EgE3NqQQN3IhMgEiAVc3EgFXNqQQd3IhUgEyASc3EgEnNqQQt3IhFqIAkgFWogECATaiASIAAoAjwiCWogESAVIBNzcSATc2pBE3ciEiARIBVycSARIBVxcmpBmfOJ1AVqQQN3IhMgEiARcnEgEiARcXJqQZnzidQFakEFdyIRIBMgEnJxIBMgEnFyakGZ84nUBWpBCXciFWogByARaiAPIBNqIBggEmogFSARIBNycSARIBNxcmpBmfOJ1AVqQQ13IhIgFSARcnEgFSARcXJqQZnzidQFakEDdyIRIBIgFXJxIBIgFXFyakGZ84nUBWpBBXciEyARIBJycSARIBJxcmpBmfOJ1AVqQQl3IhVqIAggE2ogDiARaiAXIBJqIBUgEyARcnEgEyARcXJqQZnzidQFakENdyIRIBUgE3JxIBUgE3FyakGZ84nUBWpBA3ciEiARIBVycSARIBVxcmpBmfOJ1AVqQQV3IhMgEiARcnEgEiARcXJqQZnzidQFakEJdyIVaiAGIBNqIBQgEmogFiARaiAVIBMgEnJxIBMgEnFyakGZ84nUBWpBDXciESAVIBNycSAVIBNxcmpBmfOJ1AVqQQN3IhIgESAVcnEgESAVcXJqQZnzidQFakEFdyITIBIgEXJxIBIgEXFyakGZ84nUBWpBCXciFWogECASaiAJIBFqIBUgEyAScnEgEyAScXJqQZnzidQFakENdyIGIBVzIhIgE3NqQaHX5/YGakEDdyIRIAZzIA0gE2ogEiARc2pBodfn9gZqQQl3IhJzakGh1+f2BmpBC3ciE2ogDiARaiATIBJzIBggBmogEiARcyATc2pBodfn9gZqQQ93IhFzakGh1+f2BmpBA3ciFSAR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iJAUEAQgA3AoCJASAAEAIQBAsLCwEAQYAICwSYAAAA",hash:"bd8ce7c7"};function n(A,e,t,n){return new(t||(t=Promise))((function(i,o){function B(A){try{a(n.next(A))}catch(A){o(A)}}function r(A){try{a(n.throw(A))}catch(A){o(A)}}function a(A){var e;A.done?i(A.value):(e=A.value,e instanceof t?e:new t((function(A){A(e)}))).then(B,r)}a((n=n.apply(A,e||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class i{constructor(){this.mutex=Promise.resolve()}lock(){let A=()=>{};return this.mutex=this.mutex.then((()=>new Promise(A))),new Promise((e=>{A=e}))}dispatch(A){return n(this,void 0,void 0,(function*(){const e=yield this.lock();try{return yield Promise.resolve(A())}finally{e()}}))}}const o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,B=null!==(e=o.Buffer)&&void 0!==e?e:null,r=o.TextEncoder?new o.TextEncoder:null;function a(A,e){return(15&A)+(A>>6|A>>3&8)<<4|(15&e)+(e>>6|e>>3&8)}const I="a".charCodeAt(0)-10,g="0".charCodeAt(0);function E(A,e,t){let n=0;for(let i=0;i>>4;A[n++]=t>9?t+I:t+g,t=15&e[i],A[n++]=t>9?t+I:t+g}return String.fromCharCode.apply(null,A)}const Q=null!==B?A=>{if("string"==typeof A){const e=B.from(A,"utf8");return new Uint8Array(e.buffer,e.byteOffset,e.length)}if(B.isBuffer(A))return new Uint8Array(A.buffer,A.byteOffset,A.length);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")}:A=>{if("string"==typeof A)return r.encode(A);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")},c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=new Uint8Array(256);for(let A=0;A>4,i+=1,n[i]=(15&o)<<4|B>>2,i+=1,n[i]=(3&B)<<6|63&r,i+=1}return n}const h=16384,l=new i,y=new Map;function d(A,e){return n(this,void 0,void 0,(function*(){let t=null,i=null,o=!1;if("undefined"==typeof WebAssembly)throw new Error("WebAssembly is not supported in this environment!");const B=()=>new DataView(t.exports.memory.buffer).getUint32(t.exports.STATE_SIZE,!0),r=l.dispatch((()=>n(this,void 0,void 0,(function*(){if(!y.has(A.name)){const e=f(A.data),t=WebAssembly.compile(e);y.set(A.name,t)}const e=yield y.get(A.name);t=yield WebAssembly.instantiate(e,{})})))),I=(A=null)=>{o=!0,t.exports.Hash_Init(A)},g=A=>{if(!o)throw new Error("update() called before init()");(A=>{let e=0;for(;e{if(!o)throw new Error("digest() called before init()");return o=!1,t.exports.Hash_Final(n),"binary"===A?i.slice(0,e):E(c,i,e)},d=A=>"string"==typeof A?A.length<4096:A.byteLength!0;break;case"blake2b":case"blake2s":C=(A,e)=>e<=512&&d(A);break;case"blake3":C=(A,e)=>0===e&&d(A);break;case"xxhash64":case"xxhash3":case"xxhash128":case"crc64":C=()=>!1}return yield(()=>n(this,void 0,void 0,(function*(){t||(yield r);const A=t.exports.Hash_GetBuffer(),e=t.exports.memory.buffer;i=new Uint8Array(e,A,h)})))(),{getMemory:()=>i,writeMemory:(A,e=0)=>{i.set(A,e)},getExports:()=>t.exports,setMemorySize:A=>{t.exports.Hash_SetMemorySize(A);const e=t.exports.Hash_GetBuffer(),n=t.exports.memory.buffer;i=new Uint8Array(n,e,A)},init:I,update:g,digest:s,save:()=>{if(!o)throw new Error("save() can only be called after init() and before digest()");const e=t.exports.Hash_GetState(),n=B(),i=t.exports.memory.buffer,r=new Uint8Array(i,e,n),I=new Uint8Array(4+n);return function(A,e){const t=e.length>>1;for(let n=0;n{if(!(e instanceof Uint8Array))throw new Error("load() expects an Uint8Array generated by save()");const n=t.exports.Hash_GetState(),i=B(),r=4+i,I=t.exports.memory.buffer;if(e.length!==r)throw new Error(`Bad state length (expected ${r} bytes, got ${e.length})`);if(!function(A,e){if(A.length!==2*e.length)return!1;for(let t=0;t{if(!C(A,n))return I(n),g(A),s("hex",o);const B=Q(A);return i.set(B),t.exports.Hash_Calculate(B.length,n,o),E(c,i,e)},hashLength:e}}))}const C=new i;let u=null;A.createMD4=function(){return d(t,16).then((A=>{A.init();const e={init:()=>(A.init(),e),update:t=>(A.update(t),e),digest:e=>A.digest(e),save:()=>A.save(),load:t=>(A.load(t),e),blockSize:64,digestSize:16};return e}))},A.md4=function(A){if(null===u)return function(A,e,t){return n(this,void 0,void 0,(function*(){const n=yield A.lock(),i=yield d(e,t);return n(),i}))}(C,t,16).then((e=>(u=e,u.calculate(A))));try{const e=u.calculate(A);return Promise.resolve(e)}catch(A){return Promise.reject(A)}}})); diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/md5.umd.min.js b/tools/mnemonic-test/node_modules/hash-wasm/dist/md5.umd.min.js deleted file mode 100644 index b4fd4ebc..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/md5.umd.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * hash-wasm (https://www.npmjs.com/package/hash-wasm) - * (c) Dani Biro - * @license MIT - */ - -!function(A,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((A="undefined"!=typeof globalThis?globalThis:A||self).hashwasm=A.hashwasm||{})}(this,(function(A){"use strict";var e,B={name:"md5",data:"AGFzbQEAAAABEgRgAAF/YAAAYAF/AGACf38BfwMIBwABAgMBAAIFBAEBAgIGDgJ/AUGgigULfwBBgAgLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAJSGFzaF9Jbml0AAELSGFzaF9VcGRhdGUAAgpIYXNoX0ZpbmFsAAQNSGFzaF9HZXRTdGF0ZQAFDkhhc2hfQ2FsY3VsYXRlAAYKU1RBVEVfU0laRQMBCoMaBwUAQYAJCy0AQQBC/rnrxemOlZkQNwKQiQFBAEKBxpS6lvHq5m83AoiJAUEAQgA3AoCJAQu+BQEHf0EAQQAoAoCJASIBIABqQ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c2pBlIaFmHpqQQ93IBJqIhVqIA0gEmogFCARaiAYIBBqIBUgEUF/c3IgEnNqQaGjoPAEakEVdyAVaiIQIBJBf3NyIBVzakGC/c26f2pBBncgEGoiESAVQX9zciAQc2pBteTr6XtqQQp3IBFqIhIgEEF/c3IgEXNqQbul39YCakEPdyASaiIVIARqIBYgEGogFSARQX9zciASc2pBkaeb3H5qQRV3aiEEIBUgA2ohAyASIAJqIQIgESAFaiEFIABBwABqIQAgAUFAaiIBDQALQQAgAjYClIkBQQAgAzYCkIkBQQAgBDYCjIkBQQAgBTYCiIkBIAALyAMBBX9BACgCgIkBQT9xIgBBmIkBakGAAToAACAAQQFqIQECQAJAAkACQCAAQT9zIgJBB0sNACACRQ0BIAFBmIkBakEAOgAAIAJBAUYNASAAQZqJAWpBADoAACACQQJGDQEgAEGbiQFqQQA6AAAgAkEDRg0BIABBnIkBakEAOgAAIAJBBEYNASAAQZ2JAWpBADoAACACQQVGDQEgAEGeiQFqQQA6AAAgAkEGRg0BIABBn4kBakEAOgAADAELIAJBCEYNAkE2IABrIgMhBAJAIAJBA3EiAEUNAEEAIABrIQRBACEAA0AgAEHPiQFqQQA6AAAgBCAAQX9qIgBHDQALIAMgAGohBAsgA0EDSQ0CDAELQZiJAUHAABADGkEAIQFBNyEECyABQYCJAWohAEF/IQIDQCAAIARqQRVqQQA2AAAgAEF8aiEAIAQgAkEEaiICRw0ACwtBAEEAKAKEiQE2AtSJAUEAQQAoAoCJASIAQRV2OgDTiQFBACAAQQ12OgDSiQFBACAAQQV2OgDRiQFBACAAQQN0IgA6ANCJAUEAIAA2AoCJAUGYiQFBwAAQAxpBAEEAKQKIiQE3A4AJQQBBACkCkIkBNwOICQsGAEGAiQELMwBBAEL+uevF6Y6VmRA3ApCJAUEAQoHGlLqW8ermbzcCiIkBQQBCADcCgIkBIAAQAhAECwsLAQBBgAgLBJgAAAA=",hash:"e6508e4b"};function t(A,e,B,t){return new(B||(B=Promise))((function(i,I){function o(A){try{n(t.next(A))}catch(A){I(A)}}function a(A){try{n(t.throw(A))}catch(A){I(A)}}function n(A){var e;A.done?i(A.value):(e=A.value,e instanceof B?e:new B((function(A){A(e)}))).then(o,a)}n((t=t.apply(A,e||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class i{constructor(){this.mutex=Promise.resolve()}lock(){let A=()=>{};return this.mutex=this.mutex.then((()=>new Promise(A))),new Promise((e=>{A=e}))}dispatch(A){return t(this,void 0,void 0,(function*(){const e=yield this.lock();try{return yield Promise.resolve(A())}finally{e()}}))}}const I="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,o=null!==(e=I.Buffer)&&void 0!==e?e:null,a=I.TextEncoder?new I.TextEncoder:null;function n(A,e){return(15&A)+(A>>6|A>>3&8)<<4|(15&e)+(e>>6|e>>3&8)}const g="a".charCodeAt(0)-10,Q="0".charCodeAt(0);function E(A,e,B){let t=0;for(let i=0;i>>4;A[t++]=B>9?B+g:B+Q,B=15&e[i],A[t++]=B>9?B+g:B+Q}return String.fromCharCode.apply(null,A)}const r=null!==o?A=>{if("string"==typeof A){const e=o.from(A,"utf8");return new Uint8Array(e.buffer,e.byteOffset,e.length)}if(o.isBuffer(A))return new Uint8Array(A.buffer,A.byteOffset,A.length);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")}:A=>{if("string"==typeof A)return a.encode(A);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")},c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=new Uint8Array(256);for(let A=0;A>4,i+=1,t[i]=(15&I)<<4|o>>2,i+=1,t[i]=(3&o)<<6|63&a,i+=1}return t}const h=16384,f=new i,l=new Map;function p(A,e){return t(this,void 0,void 0,(function*(){let B=null,i=null,I=!1;if("undefined"==typeof WebAssembly)throw new Error("WebAssembly is not supported in this environment!");const o=()=>new DataView(B.exports.memory.buffer).getUint32(B.exports.STATE_SIZE,!0),a=f.dispatch((()=>t(this,void 0,void 0,(function*(){if(!l.has(A.name)){const e=C(A.data),B=WebAssembly.compile(e);l.set(A.name,B)}const e=yield l.get(A.name);B=yield WebAssembly.instantiate(e,{})})))),g=(A=null)=>{I=!0,B.exports.Hash_Init(A)},Q=A=>{if(!I)throw new Error("update() called before init()");(A=>{let e=0;for(;e{if(!I)throw new Error("digest() called before init()");return I=!1,B.exports.Hash_Final(t),"binary"===A?i.slice(0,e):E(c,i,e)},p=A=>"string"==typeof A?A.length<4096:A.byteLength!0;break;case"blake2b":case"blake2s":y=(A,e)=>e<=512&&p(A);break;case"blake3":y=(A,e)=>0===e&&p(A);break;case"xxhash64":case"xxhash3":case"xxhash128":case"crc64":y=()=>!1}return yield(()=>t(this,void 0,void 0,(function*(){B||(yield a);const A=B.exports.Hash_GetBuffer(),e=B.exports.memory.buffer;i=new Uint8Array(e,A,h)})))(),{getMemory:()=>i,writeMemory:(A,e=0)=>{i.set(A,e)},getExports:()=>B.exports,setMemorySize:A=>{B.exports.Hash_SetMemorySize(A);const e=B.exports.Hash_GetBuffer(),t=B.exports.memory.buffer;i=new Uint8Array(t,e,A)},init:g,update:Q,digest:s,save:()=>{if(!I)throw new Error("save() can only be called after init() and before digest()");const e=B.exports.Hash_GetState(),t=o(),i=B.exports.memory.buffer,a=new Uint8Array(i,e,t),g=new Uint8Array(4+t);return function(A,e){const B=e.length>>1;for(let t=0;t{if(!(e instanceof Uint8Array))throw new Error("load() expects an Uint8Array generated by save()");const t=B.exports.Hash_GetState(),i=o(),a=4+i,g=B.exports.memory.buffer;if(e.length!==a)throw new Error(`Bad state length (expected ${a} bytes, got ${e.length})`);if(!function(A,e){if(A.length!==2*e.length)return!1;for(let B=0;B{if(!y(A,t))return g(t),Q(A),s("hex",I);const o=r(A);return i.set(o),B.exports.Hash_Calculate(o.length,t,I),E(c,i,e)},hashLength:e}}))}const y=new i;let q=null;A.createMD5=function(){return p(B,16).then((A=>{A.init();const e={init:()=>(A.init(),e),update:B=>(A.update(B),e),digest:e=>A.digest(e),save:()=>A.save(),load:B=>(A.load(B),e),blockSize:64,digestSize:16};return e}))},A.md5=function(A){if(null===q)return function(A,e,B){return t(this,void 0,void 0,(function*(){const t=yield A.lock(),i=yield p(e,B);return t(),i}))}(y,B,16).then((e=>(q=e,q.calculate(A))));try{const e=q.calculate(A);return Promise.resolve(e)}catch(A){return Promise.reject(A)}}})); diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/pbkdf2.umd.min.js b/tools/mnemonic-test/node_modules/hash-wasm/dist/pbkdf2.umd.min.js deleted file mode 100644 index 550aa285..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/pbkdf2.umd.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * hash-wasm (https://www.npmjs.com/package/hash-wasm) - * (c) Dani Biro - * @license MIT - */ - -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).hashwasm=e.hashwasm||{})}(this,(function(e){"use strict";function t(e,t,n,r){return new(n||(n=Promise))((function(i,o){function u(e){try{f(r.next(e))}catch(e){o(e)}}function a(e){try{f(r.throw(e))}catch(e){o(e)}}function f(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}f((r=r.apply(e,t||[])).next())}))}var n;"function"==typeof SuppressedError&&SuppressedError;const r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,i=null!==(n=r.Buffer)&&void 0!==n?n:null,o=r.TextEncoder?new r.TextEncoder:null,u="a".charCodeAt(0)-10,a="0".charCodeAt(0);const f=null!==i?e=>{if("string"==typeof e){const t=i.from(e,"utf8");return new Uint8Array(t.buffer,t.byteOffset,t.length)}if(i.isBuffer(e))return new Uint8Array(e.buffer,e.byteOffset,e.length);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Invalid data type!")}:e=>{if("string"==typeof e)return o.encode(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Invalid data type!")},s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=new Uint8Array(256);for(let e=0;en){e.update(r);const t=e.digest("binary");return e.init(),t}return new Uint8Array(r.buffer,r.byteOffset,r.length)}(e,t),i=new Uint8Array(n);i.set(r);const o=new Uint8Array(n);for(let e=0;e(e.init(),e.update(i),u),update:t=>(e.update(t),u),digest:t=>{const n=e.digest("binary");return e.init(),e.update(o),e.update(n),e.digest(t)},save:()=>{throw new Error("save() not supported")},load:()=>{throw new Error("load() not supported")},blockSize:e.blockSize,digestSize:e.digestSize};return u}function h(e,n,r,i,o){return t(this,void 0,void 0,(function*(){const t=new Uint8Array(i),s=new Uint8Array(n.length+4),d=new DataView(s.buffer),l=f(n),h=new Uint8Array(l.buffer,l.byteOffset,l.length);s.set(h);let p=0;const c=e.digestSize,y=Math.ceil(i/c);let w=null,b=null;for(let o=1;o<=y;o++){d.setUint32(n.length,o),e.init(),e.update(s),w=e.digest("binary"),b=w.slice();for(let t=1;t>>4;e[r++]=n>9?n+u:n+a,n=15&t[i],e[r++]=n>9?n+u:n+a}return String.fromCharCode.apply(null,e)}(new Uint8Array(2*i),t,i)}))}e.pbkdf2=function(e){return t(this,void 0,void 0,(function*(){(e=>{if(!e||"object"!=typeof e)throw new Error("Invalid options parameter. It requires an object.");if(!e.hashFunction||!e.hashFunction.then)throw new Error('Invalid hash function is provided! Usage: pbkdf2("password", "salt", 1000, 32, createSHA1()).');if(!Number.isInteger(e.iterations)||e.iterations<1)throw new Error("Iterations should be a positive number");if(!Number.isInteger(e.hashLength)||e.hashLength<1)throw new Error("Hash length should be a positive number");if(void 0===e.outputType&&(e.outputType="hex"),!["hex","binary"].includes(e.outputType))throw new Error(`Insupported output type ${e.outputType}. Valid values: ['hex', 'binary']`)})(e);return h(yield function(e,t){if(!e||!e.then)throw new Error('Invalid hash function is provided! Usage: createHMAC(createMD5(), "key").');return e.then((e=>l(e,t)))}(e.hashFunction,e.password),e.salt,e.iterations,e.hashLength,e.outputType)}))}})); diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/ripemd160.umd.min.js b/tools/mnemonic-test/node_modules/hash-wasm/dist/ripemd160.umd.min.js deleted file mode 100644 index 6ed0d732..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/ripemd160.umd.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * hash-wasm (https://www.npmjs.com/package/hash-wasm) - * (c) Dani Biro - * @license MIT - */ - -!function(A,I){"object"==typeof exports&&"undefined"!=typeof module?I(exports):"function"==typeof define&&define.amd?define(["exports"],I):I((A="undefined"!=typeof globalThis?globalThis:A||self).hashwasm=A.hashwasm||{})}(this,(function(A){"use strict";var I,B={name:"ripemd160",data:"AGFzbQEAAAABEQRgAAF/YAAAYAF/AGACf38AAwkIAAECAwIBAAIFBAEBAgIGDgJ/AUHgiQULfwBBgAgLB4MBCQZtZW1vcnkCAA5IYXNoX0dldEJ1ZmZlcgAACUhhc2hfSW5pdAABEHJpcGVtZDE2MF91cGRhdGUAAwtIYXNoX1VwZGF0ZQAECkhhc2hfRmluYWwABQ1IYXNoX0dldFN0YXRlAAYOSGFzaF9DYWxjdWxhdGUABwpTVEFURV9TSVpFAwEKzzIIBQBBgAkLOgBBAEHww8uefDYCmIkBQQBC/rnrxemOlZkQNwKQiQFBAEKBxpS6lvHq5m83AoiJAUEAQgA3AoCJAQuPLAEhf0EAIAAoAiQiASAAKAIAIgIgACgCECIDIAIgACgCLCIEIAAoAgwiBSAAKAIEIgYgACgCPCIHIAIgACgCMCIIIAcgACgCCCIJQQAoAoiJASIKQQAoApCJASILQQAoApSJASIMQX9zckEAKAKMiQEiDXNqIAAoAhQiDmpB5peKhQVqQ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AAAgAkEfaiAEQQNqLQAAOgAAIAkgA0EEaiIDRw0ACwsCQCAHRQ0AIAAgA2ohAiADIAVqQZyJAWohAwNAIAMgAi0AADoAACACQQFqIQIgA0EBaiEDIAdBf2oiBw0ACwtBnIkBEAIgASAGayEBIAAgBmohAEEAIQILAkAgAUHAAEkNAANAIAAQAiAAQcAAaiEAIAFBQGoiAUE/Sw0ACwsgAUUNACACQZyJAWohA0EAIQIDQCADIAAtAAA6AAAgAEEBaiEAIANBAWohAyABIAJBAWoiAkH/AXFLDQALCwsJAEGACSAAEAMLggEBAn8jAEEQayIAJAAgAEEAKAKAiQEiAUEDdDYCCCAAQQAoAoSJAUEDdCABQR12cjYCDEGQCEE4QfgAIAFBP3EiAUE4SRsgAWsQAyAAQQhqQQgQA0EAQQAoAoiJATYCgAlBAEEAKQKMiQE3AoQJQQBBACkClIkBNwKMCSAAQRBqJAALBgBBgIkBC8EBAQF/IwBBEGsiASQAQQBB8MPLnnw2ApiJAUEAQv6568XpjpWZEDcCkIkBQQBCgcaUupbx6uZvNwKIiQFBAEIANwKAiQFBgAkgABADIAFBACgCgIkBIgBBA3Q2AgggAUEAKAKEiQFBA3QgAEEddnI2AgxBkAhBOEH4ACAAQT9xIgBBOEkbIABrEAMgAUEIakEIEANBAEEAKAKIiQE2AoAJQQBBACkCjIkBNwKECUEAQQApApSJATcCjAkgAUEQaiQACwtXAQBBgAgLUFwAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",hash:"6abbce74"};function i(A,I,B,i){return new(B||(B=Promise))((function(a,g){function Q(A){try{c(i.next(A))}catch(A){g(A)}}function e(A){try{c(i.throw(A))}catch(A){g(A)}}function c(A){var I;A.done?a(A.value):(I=A.value,I instanceof B?I:new B((function(A){A(I)}))).then(Q,e)}c((i=i.apply(A,I||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class a{constructor(){this.mutex=Promise.resolve()}lock(){let A=()=>{};return this.mutex=this.mutex.then((()=>new Promise(A))),new Promise((I=>{A=I}))}dispatch(A){return i(this,void 0,void 0,(function*(){const I=yield this.lock();try{return yield Promise.resolve(A())}finally{I()}}))}}const g="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Q=null!==(I=g.Buffer)&&void 0!==I?I:null,e=g.TextEncoder?new g.TextEncoder:null;function c(A,I){return(15&A)+(A>>6|A>>3&8)<<4|(15&I)+(I>>6|I>>3&8)}const n="a".charCodeAt(0)-10,o="0".charCodeAt(0);function t(A,I,B){let i=0;for(let a=0;a>>4;A[i++]=B>9?B+n:B+o,B=15&I[a],A[i++]=B>9?B+n:B+o}return String.fromCharCode.apply(null,A)}const E=null!==Q?A=>{if("string"==typeof A){const I=Q.from(A,"utf8");return new Uint8Array(I.buffer,I.byteOffset,I.length)}if(Q.isBuffer(A))return new Uint8Array(A.buffer,A.byteOffset,A.length);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")}:A=>{if("string"==typeof A)return e.encode(A);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")},d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=new Uint8Array(256);for(let A=0;A>4,a+=1,i[a]=(15&g)<<4|Q>>2,a+=1,i[a]=(3&Q)<<6|63&e,a+=1}return i}const p=16384,y=new a,q=new Map;function F(A,I){return i(this,void 0,void 0,(function*(){let B=null,a=null,g=!1;if("undefined"==typeof WebAssembly)throw new Error("WebAssembly is not supported in this environment!");const Q=()=>new DataView(B.exports.memory.buffer).getUint32(B.exports.STATE_SIZE,!0),e=y.dispatch((()=>i(this,void 0,void 0,(function*(){if(!q.has(A.name)){const I=h(A.data),B=WebAssembly.compile(I);q.set(A.name,B)}const I=yield q.get(A.name);B=yield WebAssembly.instantiate(I,{})})))),n=(A=null)=>{g=!0,B.exports.Hash_Init(A)},o=A=>{if(!g)throw new Error("update() called before init()");(A=>{let I=0;for(;I{if(!g)throw new Error("digest() called before init()");return g=!1,B.exports.Hash_Final(i),"binary"===A?a.slice(0,I):t(d,a,I)},F=A=>"string"==typeof A?A.length<4096:A.byteLength!0;break;case"blake2b":case"blake2s":C=(A,I)=>I<=512&&F(A);break;case"blake3":C=(A,I)=>0===I&&F(A);break;case"xxhash64":case"xxhash3":case"xxhash128":case"crc64":C=()=>!1}return yield(()=>i(this,void 0,void 0,(function*(){B||(yield e);const A=B.exports.Hash_GetBuffer(),I=B.exports.memory.buffer;a=new Uint8Array(I,A,p)})))(),{getMemory:()=>a,writeMemory:(A,I=0)=>{a.set(A,I)},getExports:()=>B.exports,setMemorySize:A=>{B.exports.Hash_SetMemorySize(A);const I=B.exports.Hash_GetBuffer(),i=B.exports.memory.buffer;a=new Uint8Array(i,I,A)},init:n,update:o,digest:r,save:()=>{if(!g)throw new Error("save() can only be called after init() and before digest()");const I=B.exports.Hash_GetState(),i=Q(),a=B.exports.memory.buffer,e=new Uint8Array(a,I,i),n=new Uint8Array(4+i);return function(A,I){const B=I.length>>1;for(let i=0;i{if(!(I instanceof Uint8Array))throw new Error("load() expects an Uint8Array generated by save()");const i=B.exports.Hash_GetState(),a=Q(),e=4+a,n=B.exports.memory.buffer;if(I.length!==e)throw new Error(`Bad state length (expected ${e} bytes, got ${I.length})`);if(!function(A,I){if(A.length!==2*I.length)return!1;for(let B=0;B{if(!C(A,i))return n(i),o(A),r("hex",g);const Q=E(A);return a.set(Q),B.exports.Hash_Calculate(Q.length,i,g),t(d,a,I)},hashLength:I}}))}const C=new a;let f=null;A.createRIPEMD160=function(){return F(B,20).then((A=>{A.init();const I={init:()=>(A.init(),I),update:B=>(A.update(B),I),digest:I=>A.digest(I),save:()=>A.save(),load:B=>(A.load(B),I),blockSize:64,digestSize:20};return I}))},A.ripemd160=function(A){if(null===f)return function(A,I,B){return i(this,void 0,void 0,(function*(){const i=yield A.lock(),a=yield F(I,B);return i(),a}))}(C,B,20).then((I=>(f=I,f.calculate(A))));try{const I=f.calculate(A);return Promise.resolve(I)}catch(A){return Promise.reject(A)}}})); diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/scrypt.umd.min.js b/tools/mnemonic-test/node_modules/hash-wasm/dist/scrypt.umd.min.js deleted file mode 100644 index 2e86069f..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/scrypt.umd.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * hash-wasm (https://www.npmjs.com/package/hash-wasm) - * (c) Dani Biro - * @license MIT - */ - -!function(A,I){"object"==typeof exports&&"undefined"!=typeof module?I(exports):"function"==typeof define&&define.amd?define(["exports"],I):I((A="undefined"!=typeof globalThis?globalThis:A||self).hashwasm=A.hashwasm||{})}(this,(function(A){"use strict";function I(A,I,g,B){return new(g||(g=Promise))((function(E,i){function Q(A){try{d(B.next(A))}catch(A){i(A)}}function c(A){try{d(B.throw(A))}catch(A){i(A)}}function d(A){var I;A.done?E(A.value):(I=A.value,I instanceof g?I:new g((function(A){A(I)}))).then(Q,c)}d((B=B.apply(A,I||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;var g,B={name:"scrypt",data:"AGFzbQEAAAABGwVgAX8Bf2AAAX9gBH9/f38AYAF/AGADf39/AAMGBQABAgMEBQYBAQKAgAIGCAF/AUGQiAQLBzkEBm1lbW9yeQIAEkhhc2hfU2V0TWVtb3J5U2l6ZQAADkhhc2hfR2V0QnVmZmVyAAEGc2NyeXB0AAQK7iYFWAECf0EAIQECQCAAQQAoAogIIgJGDQACQCAAIAJrIgBBEHYgAEGAgHxxIABJaiIAQABBf0cNAEH/AcAPC0EAIQFBAEEAKQOICCAAQRB0rXw3A4gICyABwAtwAQJ/AkBBACgCgAgiAA0AQQA/AEEQdCIANgKACEEAKAKICCIBQYCAIEYNAAJAQYCAICABayIAQRB2IABBgIB8cSAASWoiAEAAQX9HDQBBAA8LQQBBACkDiAggAEEQdK18NwOICEEAKAKACCEACyAAC6QFAQN/IAIgA0EHdCAAakFAaiIEKQMANwMAIAIgBCkDCDcDCCACIAQpAxA3AxAgAiAEKQMYNwMYIAIgBCkDIDcDICACIAQpAyg3AyggAiAEKQMwNwMwIAIgBCkDODcDOAJAIANFDQAgA0EBdCEFIANBBnQhBkEAIQMDQCACIAIpAwAgACkDAIU3AwAgAiACKQMIIABBCGopAwCFNwMIIAIgAikDECAAQRBqKQMAhTcDECACIAIpAxggAEEYaikDAIU3AxggAiACKQMgIABBIGopAwCFNwMgIAIgAikDKCAAQShqKQMAhTcDKCACIAIpAzAgAEEwaikDAIU3AzAgAiACKQM4IABBOGopAwCFNwM4IAIQAyABIAIpAwA3AwAgAUEIaiACKQMINwMAIAFBEGogAikDEDcDACABQRhqIAIpAxg3AwAgAUEgaiACKQMgNwMAIAFBKGogAikDKDcDACABQTBqIAIpAzA3AwAgAUE4aiACKQM4NwMAIAIgAikDACAAQcAAaikDAIU3AwAgAiACKQMIIABByABqKQMAhTcDCCACIAIpAxAgAEHQAGopAwCFNwMQIAIgAikDGCAAQdgAaikDAIU3AxggAiACKQMgIABB4ABqKQMAhTcDICACIAIpAyggAEHoAGopAwCFNwMoIAIgAikDMCAAQfAAaikDAIU3AzAgAiACKQM4IABB+ABqKQMAhTcDOCACEAMgASAGaiIEIAIpAwA3AwAgBEEIaiACKQMINwMAIARBEGogAikDEDcDACAEQRhqIAIpAxg3AwAgBEEgaiACKQMgNwMAIARBKGogAikDKDcDACAEQTBqIAIpAzA3AwAgBEE4aiACKQM4NwMAIABBgAFqIQAgAUHAAGohASADQQJqIgMgBUkNAAsLC7oNCAF+AX8BfgF/AX4BfwF+En8gACAAKAIEIAApAygiAUIgiKciAiAAKQM4IgNCIIinIgRqQQd3IAApAwgiBUIgiKdzIgYgBGpBCXcgACkDGCIHQiCIp3MiCCAGakENdyACcyIJIAenIgogAaciC2pBB3cgA6dzIg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iByADaiIIaiEJIAAgAkEHdCIKIAFBB3RqIgtsIQwgACALQYABamwhDSAAQQV0IgtBASALQQFLGyILQWBxIQ4gC0EBcSEPIAdBeGohECAHQXBqIREgB0FoaiESIAdBYGohEyAHQVhqIRQgB0FQaiEVIAdBSGohFiAHQUBqIRcgAa1Cf3whGCAEIAdqIRkgByAAQQh0IhpqIRsgACAKQYABamwhHCALQQRJIR1BACEeQQAhHwNAQQAoAoAIIiAgAyAfbGohIQJAIABFDQBBACEiAkAgHQ0AICAgHmohI0EAIQtBACEiA0AgByALaiIEICMgC2oiJCgCADYCACAEQQRqICRBBGooAgA2AgAgBEEIaiAkQQhqKAIANgIAIARBDGogJEEMaigCADYCACALQRBqIQsgDiAiQQRqIiJHDQALCyAPRQ0AIAcgIkECdCILaiAhIAtqKAIANgIACwJAIAFFDQBBACElIBwhIyAGISYDQCAFISQgACEiAkACQCAADQAgGyAXKQMANwMAIBsgFikDADcDCCAbIBUpAwA3AxAgGyAUKQMANwMYIBsgEykDADcDICAbIBIpAwA3AyggGyARKQMANwMwIBsgECkDADcDOAwBCwNAICQgJmoiCyAkIAxqIgQpAwA3AwAgC0EIaiAEQQhqKQMANwMAIAtBEGogBEEQaikDADcDACALQRhqIARBGGopAwA3AwAgC0EgaiAEQSBqKQMANwMAIAtBKGogBEEoaikDADcDACALQTBqIARBMGopAwA3AwAgC0E4aiAEQThqKQMANwMAIAtBwABqIARBwABqKQMANwMAIAtByABqIARByABqKQMANwMAIAtB0ABqIARB0ABqKQMANwMAIAtB2ABqIARB2ABqKQMANwMAIAtB4ABqIARB4ABqKQMANwMAIAtB6ABqIARB6ABqKQMANwMAIAtB8ABqIARB8ABqKQMANwMAIAtB+ABqIARB+ABqKQMANwMAICRBgAFqISQgIkF/aiIiDQALIAcgCCAbIAAQAiAFISQgACEiA0AgJCAjaiILICQgDWoiBCkDADcDACALQQhqIARBCGopAwA3AwAgC0EQaiAEQRBqKQMANwMAIAtBGGogBEEYaikDADcDACALQSBqIARBIGopAwA3AwAgC0EoaiAEQShqKQMANwMAIAtBMGogBEEwaikDADcDACALQThqIARBOGopAwA3AwAgC0HAAGogBEHAAGopAwA3AwAgC0HIAGogBEHIAGopAwA3AwAgC0HQAGogBEHQAGopAwA3AwAgC0HYAGogBEHYAGopAwA3AwAgC0HgAGogBEHgAGopAwA3AwAgC0HoAGogBEHoAGopAwA3AwAgC0HwAGogBEHwAGopAwA3AwAgC0H4AGogBEH4AGopAwA3AwAgJEGAAWohJCAiQX9qIiINAAsLIAggByAbIAAQAiAjIBpqISMgJiAaaiEmICVBAmoiJSABSQ0AC0EAISUDQAJAAkAgAA0AIBsgFykDADcDACAbIBYpAwA3AwggGyAVKQMANwMQIBsgFCkDADcDGCAbIBMpAwA3AyAgGyASKQMANwMoIBsgESkDADcDMCAbIBApAwA3AzgMAQsgACAKIBkpAgAgGIOnQQd0amwhJiAFISQgACEiA0AgJCAMaiILIAspAwAgJCAmaiIEKQMAhTcDACALQQhqIiMgIykDACAEQQhqKQMAhTcDACALQRBqIiMgIykDACAEQRBqKQMAhTcDACALQRhqIiMgIykDACAEQRhqKQMAhTcDACALQSBqIiMgIykDACAEQSBqKQMAhTcDACALQShqIiMgIykDACAEQShqKQMAhTcDACALQTBqIiMgIykDACAEQTBqKQMAhTcDACALQThqIiMgIykDACAEQThqKQMAhTcDACALQcAAaiIjICMpAwAgBEHAAGopAwCFNwMAIAtByABqIiMgIykDACAEQcgAaikDAIU3AwAgC0HQAGoiIyAjKQMAIARB0ABqKQMAhTcDACALQdgAaiIjICMpAwAgBEHYAGopAwCFNwMAIAtB4ABqIiMgIykDACAEQeAAaikDAIU3AwAgC0HoAGoiIyAjKQMAIARB6ABqKQMAhTcDACALQfAAaiIjICMpAwAgBEHwAGopAwCFNwMAIAtB+ABqIgsgCykDACAEQfgAaikDAIU3AwAgJEGAAWohJCAiQX9qIiINAAsgByAIIBsgABACIAAgCiAJKQIAIBiDp0EHdGpsISYgBSEkIAAhIgNAICQgDWoiCyALKQMAICQgJmoiBCkDAIU3AwAgC0EIaiIjICMpAwAgBEEIaikDAIU3AwAgC0EQaiIjICMpAwAgBEEQaikDAIU3AwAgC0EYaiIjICMpAwAgBEEYaikDAIU3AwAgC0EgaiIjICMpAwAgBEEgaikDAIU3AwAgC0EoaiIjICMpAwAgBEEoaikDAIU3AwAgC0EwaiIjICMpAwAgBEEwaikDAIU3AwAgC0E4aiIjICMpAwAgBEE4aikDAIU3AwAgC0HAAGoiIyAjKQMAIARBwABqKQMAhTcDACALQcgAaiIjICMpAwAgBEHIAGopAwCFNwMAIAtB0ABqIiMgIykDACAEQdAAaikDAIU3AwAgC0HYAGoiIyAjKQMAIARB2ABqKQMAhTcDACALQeAAaiIjICMpAwAgBEHgAGopAwCFNwMAIAtB6ABqIiMgIykDACAEQegAaikDAIU3AwAgC0HwAGoiIyAjKQMAIARB8ABqKQMAhTcDACALQfgAaiILIAspAwAgBEH4AGopAwCFNwMAICRBgAFqISQgIkF/aiIiDQALCyAIIAcgGyAAEAIgJUECaiIlIAFJDQALCwJAIABFDQBBACEiAkAgHQ0AICAgHmohI0EAIQtBACEiA0AgIyALaiIEIAcgC2oiJCgCADYCACAEQQRqICRBBGooAgA2AgAgBEEIaiAkQQhqKAIANgIAIARBDGogJEEMaigCADYCACALQRBqIQsgDiAiQQRqIiJHDQALCyAPRQ0AICEgIkECdCILaiAHIAtqKAIANgIACyAeIANqIR4gH0EBaiIfIAJHDQALCws=",hash:"b32721f8"};class E{constructor(){this.mutex=Promise.resolve()}lock(){let A=()=>{};return this.mutex=this.mutex.then((()=>new Promise(A))),new Promise((I=>{A=I}))}dispatch(A){return I(this,void 0,void 0,(function*(){const I=yield this.lock();try{return yield Promise.resolve(A())}finally{I()}}))}}const i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Q=null!==(g=i.Buffer)&&void 0!==g?g:null,c=i.TextEncoder?new i.TextEncoder:null;function d(A,I){return(15&A)+(A>>6|A>>3&8)<<4|(15&I)+(I>>6|I>>3&8)}const C="a".charCodeAt(0)-10,o="0".charCodeAt(0);function a(A,I,g){let B=0;for(let E=0;E>>4;A[B++]=g>9?g+C:g+o,g=15&I[E],A[B++]=g>9?g+C:g+o}return String.fromCharCode.apply(null,A)}const n=null!==Q?A=>{if("string"==typeof A){const I=Q.from(A,"utf8");return new Uint8Array(I.buffer,I.byteOffset,I.length)}if(Q.isBuffer(A))return new Uint8Array(A.buffer,A.byteOffset,A.length);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")}:A=>{if("string"==typeof A)return c.encode(A);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")},e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=new Uint8Array(256);for(let A=0;A>4,E+=1,B[E]=(15&i)<<4|Q>>2,E+=1,B[E]=(3&Q)<<6|63&c,E+=1}return B}const D=16384,N=new E,r=new Map;function M(A,g){return I(this,void 0,void 0,(function*(){let B=null,E=null,i=!1;if("undefined"==typeof WebAssembly)throw new Error("WebAssembly is not supported in this environment!");const Q=()=>new DataView(B.exports.memory.buffer).getUint32(B.exports.STATE_SIZE,!0),c=N.dispatch((()=>I(this,void 0,void 0,(function*(){if(!r.has(A.name)){const I=y(A.data),g=WebAssembly.compile(I);r.set(A.name,g)}const I=yield r.get(A.name);B=yield WebAssembly.instantiate(I,{})})))),C=(A=null)=>{i=!0,B.exports.Hash_Init(A)},o=A=>{if(!i)throw new Error("update() called before init()");(A=>{let I=0;for(;I{if(!i)throw new Error("digest() called before init()");return i=!1,B.exports.Hash_Final(I),"binary"===A?E.slice(0,g):a(e,E,g)},M=A=>"string"==typeof A?A.length<4096:A.byteLength!0;break;case"blake2b":case"blake2s":h=(A,I)=>I<=512&&M(A);break;case"blake3":h=(A,I)=>0===I&&M(A);break;case"xxhash64":case"xxhash3":case"xxhash128":case"crc64":h=()=>!1}return yield(()=>I(this,void 0,void 0,(function*(){B||(yield c);const A=B.exports.Hash_GetBuffer(),I=B.exports.memory.buffer;E=new Uint8Array(I,A,D)})))(),{getMemory:()=>E,writeMemory:(A,I=0)=>{E.set(A,I)},getExports:()=>B.exports,setMemorySize:A=>{B.exports.Hash_SetMemorySize(A);const I=B.exports.Hash_GetBuffer(),g=B.exports.memory.buffer;E=new Uint8Array(g,I,A)},init:C,update:o,digest:t,save:()=>{if(!i)throw new Error("save() can only be called after init() and before digest()");const I=B.exports.Hash_GetState(),g=Q(),E=B.exports.memory.buffer,c=new Uint8Array(E,I,g),C=new Uint8Array(4+g);return function(A,I){const g=I.length>>1;for(let B=0;B{if(!(I instanceof Uint8Array))throw new Error("load() expects an Uint8Array generated by save()");const g=B.exports.Hash_GetState(),E=Q(),c=4+E,C=B.exports.memory.buffer;if(I.length!==c)throw new Error(`Bad state length (expected ${c} bytes, got ${I.length})`);if(!function(A,I){if(A.length!==2*I.length)return!1;for(let g=0;g{if(!h(A,I))return C(I),o(A),t("hex",i);const Q=n(A);return E.set(Q),B.exports.Hash_Calculate(Q.length,I,i),a(e,E,g)},hashLength:g}}))}function h(A,I){A.init();const{blockSize:g}=A,B=function(A,I){const{blockSize:g}=A,B=n(I);if(B.length>g){A.update(B);const I=A.digest("binary");return A.init(),I}return new Uint8Array(B.buffer,B.byteOffset,B.length)}(A,I),E=new Uint8Array(g);E.set(B);const i=new Uint8Array(g);for(let A=0;A(A.init(),A.update(E),Q),update:I=>(A.update(I),Q),digest:I=>{const g=A.digest("binary");return A.init(),A.update(i),A.update(g),A.digest(I)},save:()=>{throw new Error("save() not supported")},load:()=>{throw new Error("load() not supported")},blockSize:A.blockSize,digestSize:A.digestSize};return Q}function q(A){return I(this,void 0,void 0,(function*(){(A=>{if(!A||"object"!=typeof A)throw new Error("Invalid options parameter. It requires an object.");if(!A.hashFunction||!A.hashFunction.then)throw new Error('Invalid hash function is provided! Usage: pbkdf2("password", "salt", 1000, 32, createSHA1()).');if(!Number.isInteger(A.iterations)||A.iterations<1)throw new Error("Iterations should be a positive number");if(!Number.isInteger(A.hashLength)||A.hashLength<1)throw new Error("Hash length should be a positive number");if(void 0===A.outputType&&(A.outputType="hex"),!["hex","binary"].includes(A.outputType))throw new Error(`Insupported output type ${A.outputType}. Valid values: ['hex', 'binary']`)})(A);return function(A,g,B,E,i){return I(this,void 0,void 0,(function*(){const I=new Uint8Array(E),Q=new Uint8Array(g.length+4),c=new DataView(Q.buffer),d=n(g),C=new Uint8Array(d.buffer,d.byteOffset,d.length);Q.set(C);let o=0;const e=A.digestSize,t=Math.ceil(E/e);let y=null,D=null;for(let i=1;i<=t;i++){c.setUint32(g.length,i),A.init(),A.update(Q),y=A.digest("binary"),D=y.slice();for(let I=1;Ih(A,I)))}(A.hashFunction,A.password),A.salt,A.iterations,A.hashLength,A.outputType)}))}var p={name:"sha256",data:"AGFzbQEAAAABEQRgAAF/YAF/AGAAAGACf38AAwgHAAEBAQIAAwUEAQECAgYOAn8BQfCJBQt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQAAQtIYXNoX1VwZGF0ZQACCkhhc2hfRmluYWwABA1IYXNoX0dldFN0YXRlAAUOSGFzaF9DYWxjdWxhdGUABgpTVEFURV9TSVpFAwEKnEoHBQBBgAkLnQEAQQBCADcDwIkBQQBBHEEgIABB4AFGIgAbNgLoiQFBAEKnn+anxvST/b5/Qquzj/yRo7Pw2wAgABs3A+CJAUEAQrGWgP6fooWs6ABC/6S5iMWR2oKbfyAAGzcD2IkBQQBCl7rDg5Onlod3QvLmu+Ojp/2npX8gABs3A9CJAUEAQti9loj8oLW+NkLnzKfQ1tDrs7t/IAAbNwPIiQEL7wICAX4Gf0EAQQApA8CJASIBIACtfDcDwIkBAkACQAJAIAGnQT9xIgINAEGACSEDDAELAkBBwAAgAmsiBCAAIAQgAEkbIgNFDQAgA0EDcSEFIAJBgIkBaiEGQQAhAgJ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3NqQfOXgLd8aiIXIAMgAnMgAXEgAyACcXMgA0EedyADQRN3cyADQQp3c2ogGWoiAWoiE2ogICASaiAcIBFqIB8gCWogEyASIBFzcSARc2ogE0EadyATQRV3cyATQQd3c2pBx6KerX1qIhkgASADcyACcSABIANxcyABQR53IAFBE3dzIAFBCndzaiAaaiICaiIJIBMgEnNxIBJzaiAJQRp3IAlBFXdzIAlBB3dzakHRxqk2aiIaIAIgAXMgA3EgAiABcXMgAkEedyACQRN3cyACQQp3c2ogGGoiA2oiESAJIBNzcSATc2ogEUEadyARQRV3cyARQQd3c2pB59KkoQFqIhggAyACcyABcSADIAJxcyADQR53IANBE3dzIANBCndzaiAUaiIBaiISIBEgCXNxIAlzaiASQRp3IBJBFXdzIBJBB3dzakGFldy9AmoiFCABIANzIAJxIAEgA3FzIAFBHncgAUETd3MgAUEKd3NqIBdqIgJqIhMgI2ogJiASaiAiIBFqICUgCWogEyASIBFzcSARc2ogE0EadyATQRV3cyATQQd3c2pBuMLs8AJqIhcgAiABcyADcSACIAFxcyACQR53IAJBE3dzIAJBCndzaiAZaiIDaiIJIBMgEnNxIBJzaiAJQRp3IAlBFXdzIAlBB3dzakH827HpBGoiGSADIAJzIAFxIAMgAnFzIANBHncgA0ETd3MgA0EKd3NqIBpqIgFqIhEgCSATc3EgE3NqIBFBGncgEUEVd3MgEUEHd3NqQZOa4JkFaiIaIAEgA3MgAnEgASADcXMgAUEedyABQRN3cyABQQp3c2ogGGoiAmoiEiARIAlzcSAJc2ogEkEadyASQRV3cyASQQd3c2pB1OapqAZqIhggAiABcyADcSACIAFxcyACQR53IAJBE3dzIAJBCndzaiAUaiIDaiITaiAoIBJqICQgEWogJyAJaiATIBIgEXNxIBFzaiATQRp3IBNBFXdzIBNBB3dzakG7laizB2oiFCADIAJzIAFxIAMgAnFzIANBHncgA0ETd3MgA0EKd3NqIBdqIgFqIgkgEyASc3EgEnNqIAlBGncgCUEVd3MgCUEHd3NqQa6Si454aiIXIAEgA3MgAnEgAS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IAFBgAlqIAFByIkBai0AADoAACABQQFqIQEgAiAAQQFqIgBB/wFxSw0ACwsLBgBBgIkBC6MBAEEAQgA3A8CJAUEAQRxBICABQeABRiIBGzYC6IkBQQBCp5/mp8b0k/2+f0Krs4/8kaOz8NsAIAEbNwPgiQFBAEKxloD+n6KFrOgAQv+kuYjFkdqCm38gARs3A9iJAUEAQpe6w4OTp5aHd0Ly5rvjo6f9p6V/IAEbNwPQiQFBAELYvZaI/KC1vjZC58yn0NbQ67O7fyABGzcDyIkBIAAQAhAECwsLAQBBgAgLBHAAAAA=",hash:"8c18dd94"};function s(A){return I(this,void 0,void 0,(function*(){const{costFactor:I,blockSize:g,parallelism:E,hashLength:i}=A,Q=M(p,32).then((A=>{A.init(256);const I={init:()=>(A.init(256),I),update:g=>(A.update(g),I),digest:I=>A.digest(I),save:()=>A.save(),load:g=>(A.load(g),I),blockSize:64,digestSize:32};return I})),c=yield q({password:A.password,salt:A.salt,iterations:1,hashLength:128*g*E,hashFunction:Q,outputType:"binary"}),d=yield M(B,0),C=128*g*I,o=256*g;d.setMemorySize(c.length+C+o),d.writeMemory(c,0),d.getExports().scrypt(g,I,E);const n=d.getMemory().subarray(0,128*g*E),e=yield q({password:A.password,salt:n,iterations:1,hashLength:i,hashFunction:Q,outputType:"binary"});if("hex"===A.outputType){return a(new Uint8Array(2*i),e,i)}return e}))}new E;A.scrypt=function(A){return I(this,void 0,void 0,(function*(){return(A=>{if(!A||"object"!=typeof A)throw new Error("Invalid options parameter. It requires an object.");if(!Number.isInteger(A.blockSize)||A.blockSize<1)throw new Error("Block size should be a positive number");if(!Number.isInteger(A.costFactor)||A.costFactor<2||!(I=A.costFactor)||I&I-1)throw new Error("Cost factor should be a power of 2, greater than 1");var I;if(!Number.isInteger(A.parallelism)||A.parallelism<1)throw new Error("Parallelism should be a positive number");if(!Number.isInteger(A.hashLength)||A.hashLength<1)throw new Error("Hash length should be a positive number.");if(void 0===A.outputType&&(A.outputType="hex"),!["hex","binary"].includes(A.outputType))throw new Error(`Insupported output type ${A.outputType}. Valid values: ['hex', 'binary']`)})(A),s(A)}))}})); diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/sha1.umd.min.js b/tools/mnemonic-test/node_modules/hash-wasm/dist/sha1.umd.min.js deleted file mode 100644 index fc1be488..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/sha1.umd.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * hash-wasm (https://www.npmjs.com/package/hash-wasm) - * (c) Dani Biro - * @license MIT - */ - -!function(A,I){"object"==typeof exports&&"undefined"!=typeof module?I(exports):"function"==typeof define&&define.amd?define(["exports"],I):I((A="undefined"!=typeof globalThis?globalThis:A||self).hashwasm=A.hashwasm||{})}(this,(function(A){"use strict";var I,i={name:"sha1",data:"AGFzbQEAAAABEQRgAAF/YAF/AGAAAGACf38AAwkIAAECAwECAAEFBAEBAgIGDgJ/AUHgiQULfwBBgAgLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAJSGFzaF9Jbml0AAILSGFzaF9VcGRhdGUABApIYXNoX0ZpbmFsAAUNSGFzaF9HZXRTdGF0ZQAGDkhhc2hfQ2FsY3VsYXRlAAcKU1RBVEVfU0laRQMBCpoqCAUAQYAJC68iCgF+An8BfgF/AX4DfwF+AX8Bfkd/QQAgACkDECIBQiCIpyICQRh0IAJBgP4DcUEIdHIgAUIoiKdBgP4DcSABQjiIp3JyIgMgACkDCCIEQiCIpyICQRh0IAJBgP4DcUEIdHIgBEIoiKdBgP4DcSAEQjiIp3JyIgVzIAApAygiBkIgiKciAkEYdCACQYD+A3FBCHRyIAZCKIinQYD+A3EgBkI4iKdyciIHcyAEpyICQRh0IAJBgP4DcUEIdHIgAkEIdkGA/gNxIAJBGHZyciIIIAApAwAiBKciAkEYdCACQYD+A3FBCHRyIAJBCHZBgP4DcSACQRh2cnIiCXMgACkDICIKpyICQRh0IAJBgP4DcUEIdHIgAkEIdkGA/gNxIAJBGHZyciILcyAAK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AFBGHZycjYCjAlBAEEAKAKQiQEiAUEYdCABQYD+A3FBCHRyIAFBCHZBgP4DcSABQRh2cnI2ApAJIABBEGokAAsGAEGAiQELQwBBAEL+uevF6Y6VmRA3AoiJAUEAQoHGlLqW8ermbzcCgIkBQQBC8MPLngw3ApCJAUEAQQA2ApiJAUGACSAAEAMQBQsLCwEAQYAICwRcAAAA",hash:"6b530c24"};function g(A,I,i,g){return new(i||(i=Promise))((function(B,e){function n(A){try{Q(g.next(A))}catch(A){e(A)}}function c(A){try{Q(g.throw(A))}catch(A){e(A)}}function Q(A){var I;A.done?B(A.value):(I=A.value,I instanceof i?I:new i((function(A){A(I)}))).then(n,c)}Q((g=g.apply(A,I||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class B{constructor(){this.mutex=Promise.resolve()}lock(){let A=()=>{};return this.mutex=this.mutex.then((()=>new Promise(A))),new Promise((I=>{A=I}))}dispatch(A){return g(this,void 0,void 0,(function*(){const I=yield this.lock();try{return yield Promise.resolve(A())}finally{I()}}))}}const e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,n=null!==(I=e.Buffer)&&void 0!==I?I:null,c=e.TextEncoder?new e.TextEncoder:null;function Q(A,I){return(15&A)+(A>>6|A>>3&8)<<4|(15&I)+(I>>6|I>>3&8)}const t="a".charCodeAt(0)-10,o="0".charCodeAt(0);function a(A,I,i){let g=0;for(let B=0;B>>4;A[g++]=i>9?i+t:i+o,i=15&I[B],A[g++]=i>9?i+t:i+o}return String.fromCharCode.apply(null,A)}const E=null!==n?A=>{if("string"==typeof A){const I=n.from(A,"utf8");return new Uint8Array(I.buffer,I.byteOffset,I.length)}if(n.isBuffer(A))return new Uint8Array(A.buffer,A.byteOffset,A.length);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")}:A=>{if("string"==typeof A)return c.encode(A);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")},r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=new Uint8Array(256);for(let A=0;A>4,B+=1,g[B]=(15&e)<<4|n>>2,B+=1,g[B]=(3&n)<<6|63&c,B+=1}return g}const C=16384,h=new B,s=new Map;function F(A,I){return g(this,void 0,void 0,(function*(){let i=null,B=null,e=!1;if("undefined"==typeof WebAssembly)throw new Error("WebAssembly is not supported in this environment!");const n=()=>new DataView(i.exports.memory.buffer).getUint32(i.exports.STATE_SIZE,!0),c=h.dispatch((()=>g(this,void 0,void 0,(function*(){if(!s.has(A.name)){const I=y(A.data),i=WebAssembly.compile(I);s.set(A.name,i)}const I=yield s.get(A.name);i=yield WebAssembly.instantiate(I,{})})))),t=(A=null)=>{e=!0,i.exports.Hash_Init(A)},o=A=>{if(!e)throw new Error("update() called before init()");(A=>{let I=0;for(;I{if(!e)throw new Error("digest() called before init()");return e=!1,i.exports.Hash_Final(g),"binary"===A?B.slice(0,I):a(r,B,I)},F=A=>"string"==typeof A?A.length<4096:A.byteLength!0;break;case"blake2b":case"blake2s":f=(A,I)=>I<=512&&F(A);break;case"blake3":f=(A,I)=>0===I&&F(A);break;case"xxhash64":case"xxhash3":case"xxhash128":case"crc64":f=()=>!1}return yield(()=>g(this,void 0,void 0,(function*(){i||(yield c);const A=i.exports.Hash_GetBuffer(),I=i.exports.memory.buffer;B=new Uint8Array(I,A,C)})))(),{getMemory:()=>B,writeMemory:(A,I=0)=>{B.set(A,I)},getExports:()=>i.exports,setMemorySize:A=>{i.exports.Hash_SetMemorySize(A);const I=i.exports.Hash_GetBuffer(),g=i.exports.memory.buffer;B=new Uint8Array(g,I,A)},init:t,update:o,digest:d,save:()=>{if(!e)throw new Error("save() can only be called after init() and before digest()");const I=i.exports.Hash_GetState(),g=n(),B=i.exports.memory.buffer,c=new Uint8Array(B,I,g),t=new Uint8Array(4+g);return function(A,I){const i=I.length>>1;for(let g=0;g{if(!(I instanceof Uint8Array))throw new Error("load() expects an Uint8Array generated by save()");const g=i.exports.Hash_GetState(),B=n(),c=4+B,t=i.exports.memory.buffer;if(I.length!==c)throw new Error(`Bad state length (expected ${c} bytes, got ${I.length})`);if(!function(A,I){if(A.length!==2*I.length)return!1;for(let i=0;i{if(!f(A,g))return t(g),o(A),d("hex",e);const n=E(A);return B.set(n),i.exports.Hash_Calculate(n.length,g,e),a(r,B,I)},hashLength:I}}))}const f=new B;let H=null;A.createSHA1=function(){return F(i,20).then((A=>{A.init();const I={init:()=>(A.init(),I),update:i=>(A.update(i),I),digest:I=>A.digest(I),save:()=>A.save(),load:i=>(A.load(i),I),blockSize:64,digestSize:20};return I}))},A.sha1=function(A){if(null===H)return function(A,I,i){return g(this,void 0,void 0,(function*(){const g=yield A.lock(),B=yield F(I,i);return g(),B}))}(f,i,20).then((I=>(H=I,H.calculate(A))));try{const I=H.calculate(A);return Promise.resolve(I)}catch(A){return Promise.reject(A)}}})); diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/sha224.umd.min.js b/tools/mnemonic-test/node_modules/hash-wasm/dist/sha224.umd.min.js deleted file mode 100644 index 1dd30969..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/sha224.umd.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * hash-wasm (https://www.npmjs.com/package/hash-wasm) - * (c) Dani Biro - * @license MIT - */ - -!function(A,I){"object"==typeof exports&&"undefined"!=typeof module?I(exports):"function"==typeof define&&define.amd?define(["exports"],I):I((A="undefined"!=typeof globalThis?globalThis:A||self).hashwasm=A.hashwasm||{})}(this,(function(A){"use strict";var I,g={name:"sha256",data:"AGFzbQEAAAABEQRgAAF/YAF/AGAAAGACf38AAwgHAAEBAQIAAwUEAQECAgYOAn8BQfCJBQt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQAAQtIYXNoX1VwZGF0ZQACCkhhc2hfRmluYWwABA1IYXN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CJAUEAQQAoAtyJASIAQRh0IABBgP4DcUEIdHIgAEEIdkGA/gNxIABBGHZycjYC3IkBQQBBACgC2IkBIgBBGHQgAEGA/gNxQQh0ciAAQQh2QYD+A3EgAEEYdnJyNgLYiQFBAEEAKALUiQEiAEEYdCAAQYD+A3FBCHRyIABBCHZBgP4DcSAAQRh2cnI2AtSJAUEAQQAoAtCJASIAQRh0IABBgP4DcUEIdHIgAEEIdkGA/gNxIABBGHZycjYC0IkBQQBBACgCzIkBIgBBGHQgAEGA/gNxQQh0ciAAQQh2QYD+A3EgAEEYdnJyNgLMiQFBAEEAKALIiQEiAEEYdCAAQYD+A3FBCHRyIABBCHZBgP4DcSAAQRh2cnI2AsiJAQJAQQAoAuiJASICRQ0AQQAhAANAIAFBgAlqIAFByIkBai0AADoAACABQQFqIQEgAiAAQQFqIgBB/wFxSw0ACwsLBgBBgIkBC6MBAEEAQgA3A8CJAUEAQRxBICABQeABRiIBGzYC6IkBQQBCp5/mp8b0k/2+f0Krs4/8kaOz8NsAIAEbNwPgiQFBAEKxloD+n6KFrOgAQv+kuYjFkdqCm38gARs3A9iJAUEAQpe6w4OTp5aHd0Ly5rvjo6f9p6V/IAEbNwPQiQFBAELYvZaI/KC1vjZC58yn0NbQ67O7fyABGzcDyIkBIAAQAhAECwsLAQBBgAgLBHAAAAA=",hash:"8c18dd94"};function B(A,I,g,B){return new(g||(g=Promise))((function(E,Q){function c(A){try{i(B.next(A))}catch(A){Q(A)}}function d(A){try{i(B.throw(A))}catch(A){Q(A)}}function i(A){var I;A.done?E(A.value):(I=A.value,I instanceof g?I:new g((function(A){A(I)}))).then(c,d)}i((B=B.apply(A,I||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class E{constructor(){this.mutex=Promise.resolve()}lock(){let A=()=>{};return this.mutex=this.mutex.then((()=>new Promise(A))),new Promise((I=>{A=I}))}dispatch(A){return B(this,void 0,void 0,(function*(){const I=yield this.lock();try{return yield Promise.resolve(A())}finally{I()}}))}}const Q="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,c=null!==(I=Q.Buffer)&&void 0!==I?I:null,d=Q.TextEncoder?new Q.TextEncoder:null;function i(A,I){return(15&A)+(A>>6|A>>3&8)<<4|(15&I)+(I>>6|I>>3&8)}const n="a".charCodeAt(0)-10,o="0".charCodeAt(0);function a(A,I,g){let B=0;for(let E=0;E>>4;A[B++]=g>9?g+n:g+o,g=15&I[E],A[B++]=g>9?g+n:g+o}return String.fromCharCode.apply(null,A)}const e=null!==c?A=>{if("string"==typeof A){const I=c.from(A,"utf8");return new Uint8Array(I.buffer,I.byteOffset,I.length)}if(c.isBuffer(A))return new Uint8Array(A.buffer,A.byteOffset,A.length);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")}:A=>{if("string"==typeof A)return d.encode(A);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")},N="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",y=new Uint8Array(256);for(let A=0;A>4,E+=1,B[E]=(15&Q)<<4|c>>2,E+=1,B[E]=(3&c)<<6|63&d,E+=1}return B}const C=16384,D=new E,r=new Map;function q(A,I){return B(this,void 0,void 0,(function*(){let g=null,E=null,Q=!1;if("undefined"==typeof WebAssembly)throw new Error("WebAssembly is not supported in this environment!");const c=()=>new DataView(g.exports.memory.buffer).getUint32(g.exports.STATE_SIZE,!0),d=D.dispatch((()=>B(this,void 0,void 0,(function*(){if(!r.has(A.name)){const I=t(A.data),g=WebAssembly.compile(I);r.set(A.name,g)}const I=yield r.get(A.name);g=yield WebAssembly.instantiate(I,{})})))),n=(A=null)=>{Q=!0,g.exports.Hash_Init(A)},o=A=>{if(!Q)throw new Error("update() called before init()");(A=>{let I=0;for(;I{if(!Q)throw new Error("digest() called before init()");return Q=!1,g.exports.Hash_Final(B),"binary"===A?E.slice(0,I):a(N,E,I)},q=A=>"string"==typeof A?A.length<4096:A.byteLength!0;break;case"blake2b":case"blake2s":z=(A,I)=>I<=512&&q(A);break;case"blake3":z=(A,I)=>0===I&&q(A);break;case"xxhash64":case"xxhash3":case"xxhash128":case"crc64":z=()=>!1}return yield(()=>B(this,void 0,void 0,(function*(){g||(yield d);const A=g.exports.Hash_GetBuffer(),I=g.exports.memory.buffer;E=new Uint8Array(I,A,C)})))(),{getMemory:()=>E,writeMemory:(A,I=0)=>{E.set(A,I)},getExports:()=>g.exports,setMemorySize:A=>{g.exports.Hash_SetMemorySize(A);const I=g.exports.Hash_GetBuffer(),B=g.exports.memory.buffer;E=new Uint8Array(B,I,A)},init:n,update:o,digest:y,save:()=>{if(!Q)throw new Error("save() can only be called after init() and before digest()");const I=g.exports.Hash_GetState(),B=c(),E=g.exports.memory.buffer,d=new Uint8Array(E,I,B),n=new Uint8Array(4+B);return function(A,I){const g=I.length>>1;for(let B=0;B{if(!(I instanceof Uint8Array))throw new Error("load() expects an Uint8Array generated by save()");const B=g.exports.Hash_GetState(),E=c(),d=4+E,n=g.exports.memory.buffer;if(I.length!==d)throw new Error(`Bad state length (expected ${d} bytes, got ${I.length})`);if(!function(A,I){if(A.length!==2*I.length)return!1;for(let g=0;g{if(!z(A,B))return n(B),o(A),y("hex",Q);const c=e(A);return E.set(c),g.exports.Hash_Calculate(c.length,B,Q),a(N,E,I)},hashLength:I}}))}const z=new E;let F=null;A.createSHA224=function(){return q(g,28).then((A=>{A.init(224);const I={init:()=>(A.init(224),I),update:g=>(A.update(g),I),digest:I=>A.digest(I),save:()=>A.save(),load:g=>(A.load(g),I),blockSize:64,digestSize:28};return I}))},A.sha224=function(A){if(null===F)return function(A,I,g){return B(this,void 0,void 0,(function*(){const B=yield A.lock(),E=yield q(I,g);return B(),E}))}(z,g,28).then((I=>(F=I,F.calculate(A,224))));try{const I=F.calculate(A,224);return Promise.resolve(I)}catch(A){return Promise.reject(A)}}})); diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/sha256.umd.min.js b/tools/mnemonic-test/node_modules/hash-wasm/dist/sha256.umd.min.js deleted file mode 100644 index fcf82186..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/sha256.umd.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * hash-wasm (https://www.npmjs.com/package/hash-wasm) - * (c) Dani Biro - * @license MIT - */ - -!function(A,I){"object"==typeof exports&&"undefined"!=typeof module?I(exports):"function"==typeof define&&define.amd?define(["exports"],I):I((A="undefined"!=typeof globalThis?globalThis:A||self).hashwasm=A.hashwasm||{})}(this,(function(A){"use strict";var I,g={name:"sha256",data:"AGFzbQEAAAABEQRgAAF/YAF/AGAAAGACf38AAwgHAAEBAQIAAwUEAQECAgYOAn8BQfCJBQt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQAAQtIYXNoX1VwZGF0ZQACCkhhc2hfRmluYWwABA1IYXNoX0dldFN0YXRlAAUOSGFzaF9DYWxjdWxhdGUABgpTVEFURV9TSVpFAwEKnEoHBQBBgAkLnQEAQQBCADcDwIkBQQBBHEEgIABB4AFGIgAbNgLoiQFBAEKnn+anxvST/b5/Qquzj/yRo7Pw2wAgABs3A+CJAUEAQrGWgP6fooWs6ABC/6S5iMWR2oKbfyAAGzcD2IkBQQBCl7rDg5Onlod3QvLmu+Ojp/2npX8gABs3A9CJAUEAQti9loj8oLW+NkLnzKfQ1tDrs7t/IAAbNwPIiQEL7wICAX4Gf0EAQQApA8CJASIBIACtfDcDwIkBAkACQAJAIAGnQT9xIgINAEGACSEDDAELAkBBwAAgAmsiBCAAIAQgAEkbIgNFDQAgA0EDcSEFIAJBgIkBaiEGQQAhAgJAIANBBEkNACADQfwAcSEHQQAhAgNAIAYgAmoiAyACQYAJai0AADoAACADQQFqIAJBgQlqLQAAOgAAIANBAmogAkGCCWotAAA6AAAgA0EDaiACQYMJai0AADoAACAHIAJBBGoiAkcNAAs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qIhkgASADcyACcSABIANxcyABQR53IAFBE3dzIAFBCndzaiAaaiICaiIJIBMgEnNxIBJzaiAJQRp3IAlBFXdzIAlBB3dzakHRxqk2aiIaIAIgAXMgA3EgAiABcXMgAkEedyACQRN3cyACQQp3c2ogGGoiA2oiESAJIBNzcSATc2ogEUEadyARQRV3cyARQQd3c2pB59KkoQFqIhggAyACcyABcSADIAJxcyADQR53IANBE3dzIANBCndzaiAUaiIBaiISIBEgCXNxIAlzaiASQRp3IBJBFXdzIBJBB3dzakGFldy9AmoiFCABIANzIAJxIAEgA3FzIAFBHncgAUETd3MgAUEKd3NqIBdqIgJqIhMgI2ogJiASaiAiIBFqICUgCWogEyASIBFzcSARc2ogE0EadyATQRV3cyATQQd3c2pBuMLs8AJqIhcgAiABcyADcSACIAFxcyACQR53IAJBE3dzIAJBCndzaiAZaiIDaiIJIBMgEnNxIBJzaiAJQRp3IAlBFXdzIAlBB3dzakH827HpBGoiGSADIAJzIAFxIAMgAnFzIANBHncgA0ETd3MgA0EKd3NqIBpqIgFqIhEgCSATc3EgE3NqIBFBGncgEUEVd3MgEUEHd3NqQZOa4JkFaiIaIAEgA3MgAnEgASADcXMgAUEedyABQRN3cyABQQp3c2ogGGoiAmoiEiARIAlzcSAJc2ogEkEadyASQRV3cyASQQd3c2pB1OapqAZqIhggAiABcyADcSACIAFxcyACQR53IAJBE3dzIAJBCndzaiAUaiIDaiITaiAoIBJqICQgEWogJyAJaiATIBIgEXNxIBFzaiATQRp3IBNBFXdzIBNBB3dzakG7laizB2oiFCADIAJzIAFxIAMgAnFzIANBHncgA0ETd3MgA0EKd3NqIBdqIgFqIgkgEyASc3EgEnNqIAlBGncgCUEVd3MgCUEHd3NqQa6Si454aiIXIAEgA3MgAnEgASADcXMgAUEedyABQRN3cyABQQp3c2ogGWoiAmoiESAJIBNzcSATc2ogEUEadyARQRV3cyARQQd3c2pBhdnIk3lqIhkgAiABcyADcSACIAFxcyACQR53IAJBE3dzIAJBCndzaiAaaiIDai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4/8kaOz8NsAIAEbNwPgiQFBAEKxloD+n6KFrOgAQv+kuYjFkdqCm38gARs3A9iJAUEAQpe6w4OTp5aHd0Ly5rvjo6f9p6V/IAEbNwPQiQFBAELYvZaI/KC1vjZC58yn0NbQ67O7fyABGzcDyIkBIAAQAhAECwsLAQBBgAgLBHAAAAA=",hash:"8c18dd94"};function B(A,I,g,B){return new(g||(g=Promise))((function(E,Q){function c(A){try{i(B.next(A))}catch(A){Q(A)}}function d(A){try{i(B.throw(A))}catch(A){Q(A)}}function i(A){var I;A.done?E(A.value):(I=A.value,I instanceof g?I:new g((function(A){A(I)}))).then(c,d)}i((B=B.apply(A,I||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class E{constructor(){this.mutex=Promise.resolve()}lock(){let A=()=>{};return this.mutex=this.mutex.then((()=>new Promise(A))),new Promise((I=>{A=I}))}dispatch(A){return B(this,void 0,void 0,(function*(){const I=yield this.lock();try{return yield Promise.resolve(A())}finally{I()}}))}}const Q="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,c=null!==(I=Q.Buffer)&&void 0!==I?I:null,d=Q.TextEncoder?new Q.TextEncoder:null;function i(A,I){return(15&A)+(A>>6|A>>3&8)<<4|(15&I)+(I>>6|I>>3&8)}const n="a".charCodeAt(0)-10,o="0".charCodeAt(0);function a(A,I,g){let B=0;for(let E=0;E>>4;A[B++]=g>9?g+n:g+o,g=15&I[E],A[B++]=g>9?g+n:g+o}return String.fromCharCode.apply(null,A)}const e=null!==c?A=>{if("string"==typeof A){const I=c.from(A,"utf8");return new Uint8Array(I.buffer,I.byteOffset,I.length)}if(c.isBuffer(A))return new Uint8Array(A.buffer,A.byteOffset,A.length);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")}:A=>{if("string"==typeof A)return d.encode(A);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")},N="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",y=new Uint8Array(256);for(let A=0;A>4,E+=1,B[E]=(15&Q)<<4|c>>2,E+=1,B[E]=(3&c)<<6|63&d,E+=1}return B}const C=16384,D=new E,r=new Map;function q(A,I){return B(this,void 0,void 0,(function*(){let g=null,E=null,Q=!1;if("undefined"==typeof WebAssembly)throw new Error("WebAssembly is not supported in this environment!");const c=()=>new DataView(g.exports.memory.buffer).getUint32(g.exports.STATE_SIZE,!0),d=D.dispatch((()=>B(this,void 0,void 0,(function*(){if(!r.has(A.name)){const I=t(A.data),g=WebAssembly.compile(I);r.set(A.name,g)}const I=yield r.get(A.name);g=yield WebAssembly.instantiate(I,{})})))),n=(A=null)=>{Q=!0,g.exports.Hash_Init(A)},o=A=>{if(!Q)throw new Error("update() called before init()");(A=>{let I=0;for(;I{if(!Q)throw new Error("digest() called before init()");return Q=!1,g.exports.Hash_Final(B),"binary"===A?E.slice(0,I):a(N,E,I)},q=A=>"string"==typeof A?A.length<4096:A.byteLength!0;break;case"blake2b":case"blake2s":z=(A,I)=>I<=512&&q(A);break;case"blake3":z=(A,I)=>0===I&&q(A);break;case"xxhash64":case"xxhash3":case"xxhash128":case"crc64":z=()=>!1}return yield(()=>B(this,void 0,void 0,(function*(){g||(yield d);const A=g.exports.Hash_GetBuffer(),I=g.exports.memory.buffer;E=new Uint8Array(I,A,C)})))(),{getMemory:()=>E,writeMemory:(A,I=0)=>{E.set(A,I)},getExports:()=>g.exports,setMemorySize:A=>{g.exports.Hash_SetMemorySize(A);const I=g.exports.Hash_GetBuffer(),B=g.exports.memory.buffer;E=new Uint8Array(B,I,A)},init:n,update:o,digest:y,save:()=>{if(!Q)throw new Error("save() can only be called after init() and before digest()");const I=g.exports.Hash_GetState(),B=c(),E=g.exports.memory.buffer,d=new Uint8Array(E,I,B),n=new Uint8Array(4+B);return function(A,I){const g=I.length>>1;for(let B=0;B{if(!(I instanceof Uint8Array))throw new Error("load() expects an Uint8Array generated by save()");const B=g.exports.Hash_GetState(),E=c(),d=4+E,n=g.exports.memory.buffer;if(I.length!==d)throw new Error(`Bad state length (expected ${d} bytes, got ${I.length})`);if(!function(A,I){if(A.length!==2*I.length)return!1;for(let g=0;g{if(!z(A,B))return n(B),o(A),y("hex",Q);const c=e(A);return E.set(c),g.exports.Hash_Calculate(c.length,B,Q),a(N,E,I)},hashLength:I}}))}const z=new E;let F=null;A.createSHA256=function(){return q(g,32).then((A=>{A.init(256);const I={init:()=>(A.init(256),I),update:g=>(A.update(g),I),digest:I=>A.digest(I),save:()=>A.save(),load:g=>(A.load(g),I),blockSize:64,digestSize:32};return I}))},A.sha256=function(A){if(null===F)return function(A,I,g){return B(this,void 0,void 0,(function*(){const B=yield A.lock(),E=yield q(I,g);return B(),E}))}(z,g,32).then((I=>(F=I,F.calculate(A,256))));try{const I=F.calculate(A,256);return Promise.resolve(I)}catch(A){return Promise.reject(A)}}})); diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/sha3.umd.min.js b/tools/mnemonic-test/node_modules/hash-wasm/dist/sha3.umd.min.js deleted file mode 100644 index 3bdeb046..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/sha3.umd.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * hash-wasm (https://www.npmjs.com/package/hash-wasm) - * (c) Dani Biro - * @license MIT - */ - -!function(A,Q){"object"==typeof exports&&"undefined"!=typeof module?Q(exports):"function"==typeof define&&define.amd?define(["exports"],Q):Q((A="undefined"!=typeof globalThis?globalThis:A||self).hashwasm=A.hashwasm||{})}(this,(function(A){"use strict";var Q,e={name:"sha3",data:"AGFzbQEAAAABFARgAAF/YAF/AGACf38AYAN/f38AAwgHAAEBAgEAAwUEAQECAgYOAn8BQZCNBQt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQAAQtIYXNoX1VwZGF0ZQACCkhhc2hfRmluYWwABA1I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XRrQQN2NgKMjQFBAEEANgKIjQEgABACQeQAQQAoAoyNASIAQQF2ayEDAkBBACgCiI0BIgFBAEgNACAAIQQCQCAAIAFGDQAgAUHIiwFqIQVBACEBA0AgBSABakEAOgAAIAFBAWoiASAAQQAoAoiNASIEa0kNAAsLIARByIsBaiIBIAEtAAAgAnI6AAAgAEHHiwFqIgEgAS0AAEGAAXI6AABByIsBIAAQA0EAQYCAgIB4NgKIjQELAkAgA0EESQ0AIANBAnYiAUEDcSEFQQAhBAJAIAFBf2pBA0kNACABQfz///8DcSEAQQAhAUEAIQQDQCABQYAKaiABQYCKAWooAgA2AgAgAUGECmogAUGEigFqKAIANgIAIAFBiApqIAFBiIoBaigCADYCACABQYwKaiABQYyKAWooAgA2AgAgAUEQaiEBIAAgBEEEaiIERw0ACwsgBUUNACAFQQJ0IQAgBEECdCEBA0AgAUGACmogAUGAigFqKAIANgIAIAFBBGohASAAQXxqIgANAAsLCwvYAQEAQYAIC9ABkAEAAAAAAAAAAAAAAAAAAAEAAAAAAAAAgoAAAAAAAACKgAAAAAAAgACAAIAAAACAi4AAAAAAAAABAACAAAAAAIGAAIAAAACACYAAAAAAAICKAAAAAAAAAIgAAAAAAAAACYAAgAAAAAAKAACAAAAAAIuAAIAAAAAAiwAAAAAAAICJgAAAAAAAgAOAAAAAAACAAoAAAAAAAICAAAAAAAAAgAqAAAAAAAAACgAAgAAAAICBgACAAAAAgICAAAAAAACAAQAAgAAAAAAIgACAAAAAgA==",hash:"fb24e536"};function I(A,Q,e,I){return new(e||(e=Promise))((function(g,t){function B(A){try{o(I.next(A))}catch(A){t(A)}}function i(A){try{o(I.throw(A))}catch(A){t(A)}}function o(A){var Q;A.done?g(A.value):(Q=A.value,Q instanceof e?Q:new e((function(A){A(Q)}))).then(B,i)}o((I=I.apply(A,Q||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class g{constructor(){this.mutex=Promise.resolve()}lock(){let A=()=>{};return this.mutex=this.mutex.then((()=>new Promise(A))),new Promise((Q=>{A=Q}))}dispatch(A){return I(this,void 0,void 0,(function*(){const Q=yield this.lock();try{return yield Promise.resolve(A())}finally{Q()}}))}}const t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,B=null!==(Q=t.Buffer)&&void 0!==Q?Q:null,i=t.TextEncoder?new t.TextEncoder:null;function o(A,Q){return(15&A)+(A>>6|A>>3&8)<<4|(15&Q)+(Q>>6|Q>>3&8)}const n="a".charCodeAt(0)-10,C="0".charCodeAt(0);function r(A,Q,e){let I=0;for(let g=0;g>>4;A[I++]=e>9?e+n:e+C,e=15&Q[g],A[I++]=e>9?e+n:e+C}return String.fromCharCode.apply(null,A)}const s=null!==B?A=>{if("string"==typeof A){const Q=B.from(A,"utf8");return new Uint8Array(Q.buffer,Q.byteOffset,Q.length)}if(B.isBuffer(A))return new Uint8Array(A.buffer,A.byteOffset,A.length);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")}:A=>{if("string"==typeof A)return i.encode(A);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")},E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",D=new Uint8Array(256);for(let A=0;A>4,g+=1,I[g]=(15&t)<<4|B>>2,g+=1,I[g]=(3&B)<<6|63&i,g+=1}return I}const a=16384,h=new g,f=new Map;function l(A,Q){return I(this,void 0,void 0,(function*(){let e=null,g=null,t=!1;if("undefined"==typeof WebAssembly)throw new Error("WebAssembly is not supported in this environment!");const B=()=>new DataView(e.exports.memory.buffer).getUint32(e.exports.STATE_SIZE,!0),i=h.dispatch((()=>I(this,void 0,void 0,(function*(){if(!f.has(A.name)){const Q=c(A.data),e=WebAssembly.compile(Q);f.set(A.name,e)}const Q=yield f.get(A.name);e=yield WebAssembly.instantiate(Q,{})})))),n=(A=null)=>{t=!0,e.exports.Hash_Init(A)},C=A=>{if(!t)throw new Error("update() called before init()");(A=>{let Q=0;for(;Q{if(!t)throw new Error("digest() called before init()");return t=!1,e.exports.Hash_Final(I),"binary"===A?g.slice(0,Q):r(E,g,Q)},l=A=>"string"==typeof A?A.length<4096:A.byteLength!0;break;case"blake2b":case"blake2s":U=(A,Q)=>Q<=512&&l(A);break;case"blake3":U=(A,Q)=>0===Q&&l(A);break;case"xxhash64":case"xxhash3":case"xxhash128":case"crc64":U=()=>!1}return yield(()=>I(this,void 0,void 0,(function*(){e||(yield i);const A=e.exports.Hash_GetBuffer(),Q=e.exports.memory.buffer;g=new Uint8Array(Q,A,a)})))(),{getMemory:()=>g,writeMemory:(A,Q=0)=>{g.set(A,Q)},getExports:()=>e.exports,setMemorySize:A=>{e.exports.Hash_SetMemorySize(A);const Q=e.exports.Hash_GetBuffer(),I=e.exports.memory.buffer;g=new Uint8Array(I,Q,A)},init:n,update:C,digest:D,save:()=>{if(!t)throw new Error("save() can only be called after init() and before digest()");const Q=e.exports.Hash_GetState(),I=B(),g=e.exports.memory.buffer,i=new Uint8Array(g,Q,I),n=new Uint8Array(4+I);return function(A,Q){const e=Q.length>>1;for(let I=0;I{if(!(Q instanceof Uint8Array))throw new Error("load() expects an Uint8Array generated by save()");const I=e.exports.Hash_GetState(),g=B(),i=4+g,n=e.exports.memory.buffer;if(Q.length!==i)throw new Error(`Bad state length (expected ${i} bytes, got ${Q.length})`);if(!function(A,Q){if(A.length!==2*Q.length)return!1;for(let e=0;e{if(!U(A,I))return n(I),C(A),D("hex",t);const B=s(A);return g.set(B),e.exports.Hash_Calculate(B.length,I,t),r(E,g,Q)},hashLength:Q}}))}const U=new g;let u=null;function y(A){return[224,256,384,512].includes(A)?null:new Error("Invalid variant! Valid values: 224, 256, 384, 512")}A.createSHA3=function(A=512){if(y(A))return Promise.reject(y(A));const Q=A/8;return l(e,Q).then((e=>{e.init(A);const I={init:()=>(e.init(A),I),update:A=>(e.update(A),I),digest:A=>e.digest(A,6),save:()=>e.save(),load:A=>(e.load(A),I),blockSize:200-2*Q,digestSize:Q};return I}))},A.sha3=function(A,Q=512){if(y(Q))return Promise.reject(y(Q));const g=Q/8;if(null===u||u.hashLength!==g)return function(A,Q,e){return I(this,void 0,void 0,(function*(){const I=yield A.lock(),g=yield l(Q,e);return I(),g}))}(U,e,g).then((e=>(u=e,u.calculate(A,Q,6))));try{const e=u.calculate(A,Q,6);return Promise.resolve(e)}catch(A){return Promise.reject(A)}}})); diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/sha384.umd.min.js b/tools/mnemonic-test/node_modules/hash-wasm/dist/sha384.umd.min.js deleted file mode 100644 index 75840ae8..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/sha384.umd.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * hash-wasm (https://www.npmjs.com/package/hash-wasm) - * (c) Dani Biro - * @license MIT - */ - -!function(A,I){"object"==typeof exports&&"undefined"!=typeof module?I(exports):"function"==typeof define&&define.amd?define(["exports"],I):I((A="undefined"!=typeof globalThis?globalThis:A||self).hashwasm=A.hashwasm||{})}(this,(function(A){"use strict";var I,C={name:"sha512",data:"AGFzbQEAAAABEQRgAAF/YAF/AGAAAGACf38AAwgHAAEBAQIAAwUEAQECAgYOAn8BQdCKBQt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQAAQtIYXNoX1VwZGF0ZQACCkhhc2hfRmluYWwABA1IYXNoX0dldFN0YXRlAAUOSGFzaF9DYWxjdWxhdGUABgpTVEFURV9TSVpFAwEKlWgHBQBBgAkLmwIAQQBCADcDgIoBQQBBMEHAACAAQYADRiIAGzYCyIoBQQBCpJ/p99uD0trHAEL5wvibkaOz8NsAIAAbNwPAigFBAEKnn+an1sGLhltC6/qG2r+19sEfIAAbNwO4igFBAEKRquDC9tCS2o5/Qp/Y+dnCkdqCm38gABs3A7CKAUEAQrGWgP7/zMmZ5wBC0YWa7/rPlIfRACAAGz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hDcDiIoBAkBBACgCyIoBIgNFDQBBACECA0AgAUGACWogAUGIigFqLQAAOgAAIAFBAWohASADIAJBAWoiAkH/AXFLDQALCwsGAEGAiQELoQIAQQBCADcDgIoBQQBBMEHAACABQYADRiIBGzYCyIoBQQBCpJ/p99uD0trHAEL5wvibkaOz8NsAIAEbNwPAigFBAEKnn+an1sGLhltC6/qG2r+19sEfIAEbNwO4igFBAEKRquDC9tCS2o5/Qp/Y+dnCkdqCm38gARs3A7CKAUEAQrGWgP7/zMmZ5wBC0YWa7/rPlIfRACABGzcDqIoBQQBCubK5uI+b+5cVQvHt9Pilp/2npX8gARs3A6CKAUEAQpe6w4Ojq8CskX9Cq/DT9K/uvLc8IAEbNwOYigFBAEKHqvOzo6WKzeIAQrvOqqbY0Ouzu38gARs3A5CKAUEAQti9lojcq+fdS0KIkvOd/8z5hOoAIAEbNwOIigEgABACEAQLCwsBAEGACAsE0AAAAA==",hash:"f2e40eb1"};function g(A,I,C,g){return new(C||(C=Promise))((function(i,B){function F(A){try{Q(g.next(A))}catch(A){B(A)}}function h(A){try{Q(g.throw(A))}catch(A){B(A)}}function Q(A){var I;A.done?i(A.value):(I=A.value,I instanceof C?I:new C((function(A){A(I)}))).then(F,h)}Q((g=g.apply(A,I||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class i{constructor(){this.mutex=Promise.resolve()}lock(){let A=()=>{};return this.mutex=this.mutex.then((()=>new Promise(A))),new Promise((I=>{A=I}))}dispatch(A){return g(this,void 0,void 0,(function*(){const I=yield this.lock();try{return yield Promise.resolve(A())}finally{I()}}))}}const B="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,F=null!==(I=B.Buffer)&&void 0!==I?I:null,h=B.TextEncoder?new B.TextEncoder:null;function Q(A,I){return(15&A)+(A>>6|A>>3&8)<<4|(15&I)+(I>>6|I>>3&8)}const o="a".charCodeAt(0)-10,e="0".charCodeAt(0);function f(A,I,C){let g=0;for(let i=0;i>>4;A[g++]=C>9?C+o:C+e,C=15&I[i],A[g++]=C>9?C+o:C+e}return String.fromCharCode.apply(null,A)}const E=null!==F?A=>{if("string"==typeof A){const I=F.from(A,"utf8");return new Uint8Array(I.buffer,I.byteOffset,I.length)}if(F.isBuffer(A))return new Uint8Array(A.buffer,A.byteOffset,A.length);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")}:A=>{if("string"==typeof A)return h.encode(A);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")},D="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=new Uint8Array(256);for(let A=0;A>4,i+=1,g[i]=(15&B)<<4|F>>2,i+=1,g[i]=(3&F)<<6|63&h,i+=1}return g}const U=16384,J=new i,Y=new Map;function w(A,I){return g(this,void 0,void 0,(function*(){let C=null,i=null,B=!1;if("undefined"==typeof WebAssembly)throw new Error("WebAssembly is not supported in this environment!");const F=()=>new DataView(C.exports.memory.buffer).getUint32(C.exports.STATE_SIZE,!0),h=J.dispatch((()=>g(this,void 0,void 0,(function*(){if(!Y.has(A.name)){const I=S(A.data),C=WebAssembly.compile(I);Y.set(A.name,C)}const I=yield Y.get(A.name);C=yield WebAssembly.instantiate(I,{})})))),o=(A=null)=>{B=!0,C.exports.Hash_Init(A)},e=A=>{if(!B)throw new Error("update() called before init()");(A=>{let I=0;for(;I{if(!B)throw new Error("digest() called before init()");return B=!1,C.exports.Hash_Final(g),"binary"===A?i.slice(0,I):f(D,i,I)},w=A=>"string"==typeof A?A.length<4096:A.byteLength!0;break;case"blake2b":case"blake2s":n=(A,I)=>I<=512&&w(A);break;case"blake3":n=(A,I)=>0===I&&w(A);break;case"xxhash64":case"xxhash3":case"xxhash128":case"crc64":n=()=>!1}return yield(()=>g(this,void 0,void 0,(function*(){C||(yield h);const A=C.exports.Hash_GetBuffer(),I=C.exports.memory.buffer;i=new Uint8Array(I,A,U)})))(),{getMemory:()=>i,writeMemory:(A,I=0)=>{i.set(A,I)},getExports:()=>C.exports,setMemorySize:A=>{C.exports.Hash_SetMemorySize(A);const I=C.exports.Hash_GetBuffer(),g=C.exports.memory.buffer;i=new Uint8Array(g,I,A)},init:o,update:e,digest:t,save:()=>{if(!B)throw new Error("save() can only be called after init() and before digest()");const I=C.exports.Hash_GetState(),g=F(),i=C.exports.memory.buffer,h=new Uint8Array(i,I,g),o=new Uint8Array(4+g);return function(A,I){const C=I.length>>1;for(let g=0;g{if(!(I instanceof Uint8Array))throw new Error("load() expects an Uint8Array generated by save()");const g=C.exports.Hash_GetState(),i=F(),h=4+i,o=C.exports.memory.buffer;if(I.length!==h)throw new Error(`Bad state length (expected ${h} bytes, got ${I.length})`);if(!function(A,I){if(A.length!==2*I.length)return!1;for(let C=0;C{if(!n(A,g))return o(g),e(A),t("hex",B);const F=E(A);return i.set(F),C.exports.Hash_Calculate(F.length,g,B),f(D,i,I)},hashLength:I}}))}const n=new i;let m=null;A.createSHA384=function(){return w(C,48).then((A=>{A.init(384);const I={init:()=>(A.init(384),I),update:C=>(A.update(C),I),digest:I=>A.digest(I),save:()=>A.save(),load:C=>(A.load(C),I),blockSize:128,digestSize:48};return I}))},A.sha384=function(A){if(null===m)return function(A,I,C){return g(this,void 0,void 0,(function*(){const g=yield A.lock(),i=yield w(I,C);return g(),i}))}(n,C,48).then((I=>(m=I,m.calculate(A,384))));try{const I=m.calculate(A,384);return Promise.resolve(I)}catch(A){return Promise.reject(A)}}})); diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/sha512.umd.min.js b/tools/mnemonic-test/node_modules/hash-wasm/dist/sha512.umd.min.js deleted file mode 100644 index 6f9d03cd..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/sha512.umd.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * hash-wasm (https://www.npmjs.com/package/hash-wasm) - * (c) Dani Biro - * @license MIT - */ - -!function(A,I){"object"==typeof exports&&"undefined"!=typeof module?I(exports):"function"==typeof define&&define.amd?define(["exports"],I):I((A="undefined"!=typeof globalThis?globalThis:A||self).hashwasm=A.hashwasm||{})}(this,(function(A){"use strict";var I,C={name:"sha512",data:"AGFzbQEAAAABEQRgAAF/YAF/AGAAAGACf38AAwgHAAEBAQIAAwUEAQECAgYOAn8BQdCKBQt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQAAQtIYXNoX1VwZGF0ZQACCkhhc2hfRmluYWwABA1IYXNoX0dldFN0YXRlAAUOSGFzaF9DYWxjdWxhdGUABgpTVEFURV9TSVpFAwEKlWgHBQBBgAkLmwIAQQBCADcDgIoBQQBBMEHAACAAQYADRiIAGzYCyIoBQQBCpJ/p99uD0trHAEL5wvibkaOz8NsAIAAbNwPAigFBAEKnn+an1sGLhltC6/qG2r+19sEfIAAbNwO4igFBAEKRquDC9tCS2o5/Qp/Y+dnCkdqCm38gABs3A7CKAUEAQrGWgP7/zMmZ5wBC0YWa7/rPlIfRACAAGzcDqIoBQQBCubK5uI+b+5cVQvHt9Pilp/2npX8gABs3A6CKAUEAQpe6w4Ojq8CskX9Cq/DT9K/uvLc8IAAbNwOYigFBAEKHqvOzo6WKzeIAQrvOqqbY0Ouzu38gABs3A5CKAUEAQti9lojcq+fdS0KIkvOd/8z5hOoAIAAbNwOIigEL8gICAX4Gf0EAQQApA4CKASIBIACtfDcDgIoBAkACQAJAIAGnQf8AcSICDQBBgAkhAwwBCwJAQYABIAJrIgQgACAEIABJGyIDRQ0AIANBA3EhBSACQYCJAWohBkEAIQICQCADQQRJDQAgA0H8AXEhB0EAIQIDQCAGIAJqIgMgAkGACWotAAA6AAAgA0EBaiACQYEJai0AADoAACADQQJqIAJBgglqLQAAOgAAIANBA2ogAkGDCWotAAA6AAAgByACQQRqIgJHDQALCyAFRQ0AA0AgBiACaiACQYAJai0AADoAACACQQFqIQIgBUF/aiIFDQALCyAA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EGACAsE0AAAAA==",hash:"f2e40eb1"};function g(A,I,C,g){return new(C||(C=Promise))((function(i,B){function F(A){try{Q(g.next(A))}catch(A){B(A)}}function h(A){try{Q(g.throw(A))}catch(A){B(A)}}function Q(A){var I;A.done?i(A.value):(I=A.value,I instanceof C?I:new C((function(A){A(I)}))).then(F,h)}Q((g=g.apply(A,I||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class i{constructor(){this.mutex=Promise.resolve()}lock(){let A=()=>{};return this.mutex=this.mutex.then((()=>new Promise(A))),new Promise((I=>{A=I}))}dispatch(A){return g(this,void 0,void 0,(function*(){const I=yield this.lock();try{return yield Promise.resolve(A())}finally{I()}}))}}const B="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,F=null!==(I=B.Buffer)&&void 0!==I?I:null,h=B.TextEncoder?new B.TextEncoder:null;function Q(A,I){return(15&A)+(A>>6|A>>3&8)<<4|(15&I)+(I>>6|I>>3&8)}const o="a".charCodeAt(0)-10,e="0".charCodeAt(0);function f(A,I,C){let g=0;for(let i=0;i>>4;A[g++]=C>9?C+o:C+e,C=15&I[i],A[g++]=C>9?C+o:C+e}return String.fromCharCode.apply(null,A)}const E=null!==F?A=>{if("string"==typeof A){const I=F.from(A,"utf8");return new Uint8Array(I.buffer,I.byteOffset,I.length)}if(F.isBuffer(A))return new Uint8Array(A.buffer,A.byteOffset,A.length);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")}:A=>{if("string"==typeof A)return h.encode(A);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")},D="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=new Uint8Array(256);for(let A=0;A>4,i+=1,g[i]=(15&B)<<4|F>>2,i+=1,g[i]=(3&F)<<6|63&h,i+=1}return g}const U=16384,J=new i,Y=new Map;function w(A,I){return g(this,void 0,void 0,(function*(){let C=null,i=null,B=!1;if("undefined"==typeof WebAssembly)throw new Error("WebAssembly is not supported in this environment!");const F=()=>new DataView(C.exports.memory.buffer).getUint32(C.exports.STATE_SIZE,!0),h=J.dispatch((()=>g(this,void 0,void 0,(function*(){if(!Y.has(A.name)){const I=S(A.data),C=WebAssembly.compile(I);Y.set(A.name,C)}const I=yield Y.get(A.name);C=yield WebAssembly.instantiate(I,{})})))),o=(A=null)=>{B=!0,C.exports.Hash_Init(A)},e=A=>{if(!B)throw new Error("update() called before init()");(A=>{let I=0;for(;I{if(!B)throw new Error("digest() called before init()");return B=!1,C.exports.Hash_Final(g),"binary"===A?i.slice(0,I):f(D,i,I)},w=A=>"string"==typeof A?A.length<4096:A.byteLength!0;break;case"blake2b":case"blake2s":n=(A,I)=>I<=512&&w(A);break;case"blake3":n=(A,I)=>0===I&&w(A);break;case"xxhash64":case"xxhash3":case"xxhash128":case"crc64":n=()=>!1}return yield(()=>g(this,void 0,void 0,(function*(){C||(yield h);const A=C.exports.Hash_GetBuffer(),I=C.exports.memory.buffer;i=new Uint8Array(I,A,U)})))(),{getMemory:()=>i,writeMemory:(A,I=0)=>{i.set(A,I)},getExports:()=>C.exports,setMemorySize:A=>{C.exports.Hash_SetMemorySize(A);const I=C.exports.Hash_GetBuffer(),g=C.exports.memory.buffer;i=new Uint8Array(g,I,A)},init:o,update:e,digest:t,save:()=>{if(!B)throw new Error("save() can only be called after init() and before digest()");const I=C.exports.Hash_GetState(),g=F(),i=C.exports.memory.buffer,h=new Uint8Array(i,I,g),o=new Uint8Array(4+g);return function(A,I){const C=I.length>>1;for(let g=0;g{if(!(I instanceof Uint8Array))throw new Error("load() expects an Uint8Array generated by save()");const g=C.exports.Hash_GetState(),i=F(),h=4+i,o=C.exports.memory.buffer;if(I.length!==h)throw new Error(`Bad state length (expected ${h} bytes, got ${I.length})`);if(!function(A,I){if(A.length!==2*I.length)return!1;for(let C=0;C{if(!n(A,g))return o(g),e(A),t("hex",B);const F=E(A);return i.set(F),C.exports.Hash_Calculate(F.length,g,B),f(D,i,I)},hashLength:I}}))}const n=new i;let m=null;A.createSHA512=function(){return w(C,64).then((A=>{A.init(512);const I={init:()=>(A.init(512),I),update:C=>(A.update(C),I),digest:I=>A.digest(I),save:()=>A.save(),load:C=>(A.load(C),I),blockSize:128,digestSize:64};return I}))},A.sha512=function(A){if(null===m)return function(A,I,C){return g(this,void 0,void 0,(function*(){const g=yield A.lock(),i=yield w(I,C);return g(),i}))}(n,C,64).then((I=>(m=I,m.calculate(A,512))));try{const I=m.calculate(A,512);return Promise.resolve(I)}catch(A){return Promise.reject(A)}}})); diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/sm3.umd.min.js b/tools/mnemonic-test/node_modules/hash-wasm/dist/sm3.umd.min.js deleted file mode 100644 index f024d277..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/sm3.umd.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * hash-wasm (https://www.npmjs.com/package/hash-wasm) - * (c) Dani Biro - * @license MIT - */ - -!function(A,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((A="undefined"!=typeof globalThis?globalThis:A||self).hashwasm=A.hashwasm||{})}(this,(function(A){"use strict";var e,Q={name:"sm3",data:"AGFzbQEAAAABDANgAAF/YAAAYAF/AAMIBwABAgIBAAIFBAEBAgIGDgJ/AUHwiQULfwBBgAgLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAJSGFzaF9Jbml0AAELSGFzaF9VcGRhdGUAAgpIYXNoX0ZpbmFsAAQNSGFzaF9HZXRTdGF0ZQAFDkhhc2hfQ2FsY3VsYXRlAAYKU1RBVEVfU0laRQMBCtodBwUAQYAJC1EAQQBCzdy3nO7Jw/2wfzcCoIkBQQBCvOG8y6qVzpgWNwKYiQFBAELXhZG5gcCBxVo3ApCJAUEAQu+sgJyX16yKyQA3AoiJAUEAQgA3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UEAQQAoApyJASIBQRh0IAFBgP4DcUEIdHIgAUEIdkGA/gNxIAFBGHZycjYClAlBAEEAKAKgiQEiAUEYdCABQYD+A3FBCHRyIAFBCHZBgP4DcSABQRh2cnI2ApgJQQBBACgCpIkBIgFBGHQgAUGA/gNxQQh0ciABQQh2QYD+A3EgAUEYdnJyNgKcCSAAQRBqJAALBgBBgIkBC5UCAQR/QQBCzdy3nO7Jw/2wfzcCoIkBQQBCvOG8y6qVzpgWNwKYiQFBAELXhZG5gcCBxVo3ApCJAUEAQu+sgJyX16yKyQA3AoiJAUEAQgA3AoCJAQJAIABFDQBBACAANgKAiQFBgAkhAQJAIABBwABJDQBBgAkhAQNAIAEQAyABQcAAaiEBIABBQGoiAEE/Sw0ACyAARQ0BCyAAQX9qIQICQAJAIABBB3EiAw0AQaiJASEEDAELIABBeHEhAEGoiQEhBANAIAQgAS0AADoAACAEQQFqIQQgAUEBaiEBIANBf2oiAw0ACwsgAkEHSQ0AA0AgBCABKQAANwAAIARBCGohBCABQQhqIQEgAEF4aiIADQALCxAECwtRAgBBgAgLBGgAAAAAQZAIC0CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",hash:"b6fb4b8e"};function B(A,e,Q,B){return new(Q||(Q=Promise))((function(t,g){function i(A){try{I(B.next(A))}catch(A){g(A)}}function C(A){try{I(B.throw(A))}catch(A){g(A)}}function I(A){var e;A.done?t(A.value):(e=A.value,e instanceof Q?e:new Q((function(A){A(e)}))).then(i,C)}I((B=B.apply(A,e||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class t{constructor(){this.mutex=Promise.resolve()}lock(){let A=()=>{};return this.mutex=this.mutex.then((()=>new Promise(A))),new Promise((e=>{A=e}))}dispatch(A){return B(this,void 0,void 0,(function*(){const e=yield this.lock();try{return yield Promise.resolve(A())}finally{e()}}))}}const g="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,i=null!==(e=g.Buffer)&&void 0!==e?e:null,C=g.TextEncoder?new g.TextEncoder:null;function I(A,e){return(15&A)+(A>>6|A>>3&8)<<4|(15&e)+(e>>6|e>>3&8)}const n="a".charCodeAt(0)-10,o="0".charCodeAt(0);function E(A,e,Q){let B=0;for(let t=0;t>>4;A[B++]=Q>9?Q+n:Q+o,Q=15&e[t],A[B++]=Q>9?Q+n:Q+o}return String.fromCharCode.apply(null,A)}const r=null!==i?A=>{if("string"==typeof A){const e=i.from(A,"utf8");return new Uint8Array(e.buffer,e.byteOffset,e.length)}if(i.isBuffer(A))return new Uint8Array(A.buffer,A.byteOffset,A.length);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")}:A=>{if("string"==typeof A)return C.encode(A);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")},h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=new Uint8Array(256);for(let A=0;A>4,t+=1,B[t]=(15&g)<<4|i>>2,t+=1,B[t]=(3&i)<<6|63&C,t+=1}return B}const s=16384,d=new t,y=new Map;function l(A,e){return B(this,void 0,void 0,(function*(){let Q=null,t=null,g=!1;if("undefined"==typeof WebAssembly)throw new Error("WebAssembly is not supported in this environment!");const i=()=>new DataView(Q.exports.memory.buffer).getUint32(Q.exports.STATE_SIZE,!0),C=d.dispatch((()=>B(this,void 0,void 0,(function*(){if(!y.has(A.name)){const e=c(A.data),Q=WebAssembly.compile(e);y.set(A.name,Q)}const e=yield y.get(A.name);Q=yield WebAssembly.instantiate(e,{})})))),n=(A=null)=>{g=!0,Q.exports.Hash_Init(A)},o=A=>{if(!g)throw new Error("update() called before init()");(A=>{let e=0;for(;e{if(!g)throw new Error("digest() called before init()");return g=!1,Q.exports.Hash_Final(B),"binary"===A?t.slice(0,e):E(h,t,e)},l=A=>"string"==typeof A?A.length<4096:A.byteLength!0;break;case"blake2b":case"blake2s":D=(A,e)=>e<=512&&l(A);break;case"blake3":D=(A,e)=>0===e&&l(A);break;case"xxhash64":case"xxhash3":case"xxhash128":case"crc64":D=()=>!1}return yield(()=>B(this,void 0,void 0,(function*(){Q||(yield C);const A=Q.exports.Hash_GetBuffer(),e=Q.exports.memory.buffer;t=new Uint8Array(e,A,s)})))(),{getMemory:()=>t,writeMemory:(A,e=0)=>{t.set(A,e)},getExports:()=>Q.exports,setMemorySize:A=>{Q.exports.Hash_SetMemorySize(A);const e=Q.exports.Hash_GetBuffer(),B=Q.exports.memory.buffer;t=new Uint8Array(B,e,A)},init:n,update:o,digest:a,save:()=>{if(!g)throw new Error("save() can only be called after init() and before digest()");const e=Q.exports.Hash_GetState(),B=i(),t=Q.exports.memory.buffer,C=new Uint8Array(t,e,B),n=new Uint8Array(4+B);return function(A,e){const Q=e.length>>1;for(let B=0;B{if(!(e instanceof Uint8Array))throw new Error("load() expects an Uint8Array generated by save()");const B=Q.exports.Hash_GetState(),t=i(),C=4+t,n=Q.exports.memory.buffer;if(e.length!==C)throw new Error(`Bad state length (expected ${C} bytes, got ${e.length})`);if(!function(A,e){if(A.length!==2*e.length)return!1;for(let Q=0;Q{if(!D(A,B))return n(B),o(A),a("hex",g);const i=r(A);return t.set(i),Q.exports.Hash_Calculate(i.length,B,g),E(h,t,e)},hashLength:e}}))}const D=new t;let f=null;A.createSM3=function(){return l(Q,32).then((A=>{A.init();const e={init:()=>(A.init(),e),update:Q=>(A.update(Q),e),digest:e=>A.digest(e),save:()=>A.save(),load:Q=>(A.load(Q),e),blockSize:64,digestSize:32};return e}))},A.sm3=function(A){if(null===f)return function(A,e,Q){return B(this,void 0,void 0,(function*(){const B=yield A.lock(),t=yield l(e,Q);return B(),t}))}(D,Q,32).then((e=>(f=e,f.calculate(A))));try{const e=f.calculate(A);return Promise.resolve(e)}catch(A){return Promise.reject(A)}}})); diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/whirlpool.umd.min.js b/tools/mnemonic-test/node_modules/hash-wasm/dist/whirlpool.umd.min.js deleted file mode 100644 index 93b76639..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/whirlpool.umd.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * hash-wasm (https://www.npmjs.com/package/hash-wasm) - * (c) Dani Biro - * @license MIT - */ - -!function(A,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((A="undefined"!=typeof globalThis?globalThis:A||self).hashwasm=A.hashwasm||{})}(this,(function(A){"use strict";var e,Q={name:"whirlpool",data:"AGFzbQEAAAABEQRgAAF/YAF/AGACf38AYAAAAwkIAAECAwEDAAEFBAEBAgIGDgJ/AUHQmwULfwBBgAgLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAJSGFzaF9Jbml0AAMLSGFzaF9VcGRhdGUABApIYXNoX0ZpbmFsAAUNSGFzaF9HZXRTdGF0ZQAGDkhhc2hfQ2FsY3VsYXRlAAcKU1RBVEVfU0laRQMBCu0bCAUAQYAZC8wGAQl+IAApAwAhAUEAQQApA4CbASICNwPAmQEgACkDGCEDIAApAxAhBCAAKQMIIQVBAEEAKQOYmwEiBjcD2JkBQQBBACkDkJsBIgc3A9CZAUEAQQApA4ibASIINwPImQFBACABIAKFNwOAmgFBACAFIAiFNwOImgFBACAEIAeFNwOQmgFBACADIAaFNwOYmgEgACkDICEDQQBBACkDoJsBIgE3A+CZAUEAIAMgAYU3A6CaASAAKQMoIQRBAEEAKQOomwEiAzcD6JkBQQAgBCADhTcDqJoBIAApAzAhBUEAQQApA7CbASIENwPwmQFBACAFIASFNwOwmgEgACkDOCEJQQBBACkDuJsBIgU3A/iZAUEAIAkgBYU3A7iaAUEAQpjGmMb+kO6AzwA3A4CZAUHAmQFBgJkBEAJBgJoBQcCZARACQQBCtszKrp/v28jSADcDgJkBQcCZAUGAmQEQAkGAmgFBwJ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30VFzZuvri+sLYMvgPDzwPP3MeMGBgT6BfL8f/ZSUapTU/jVA9/f79+sM8xy5ud65oWdvGBMTTBOYXyaLLCywLH2cWFHT02vT1ri7Befnu+drXNOMbm6lblfL3DnExDfEbvOVqgMDDAMYDwYbVlZFVooTrNxERA1EGkmIXn9/4X/fnv6gqameqSE3T4gqKqgqTYJUZ7u71ruxbWsKwcEjwUbin4dTU1FTogKm8dzcV9yui6VyCwssC1gnFlOdnU6dnNMnAWxsrWxHwdgrMTHEMZX1YqR0dM10h7no8/b2//bjCfEVRkYFRgpDjEysrIqsCSZFpYmJHok8lw+1FBRQFKBEKLTh4aPhW0LfuhYWWBawTiymOjroOs3SdPdpablpb9DSBgkJJAlILRJBcHDdcKet4Ne2tuK22VRxb9DQZ9DOt70e7e2T7Tt+x9bMzBfMLtuF4kJCFUIqV4RomJhamLTCLSykpKqkSQ5V7SgooChdiFB1XFxtXNoxuIb4+Mf4kz/ta4aGIoZEpBHC",hash:"8d8f6035"};function B(A,e,Q,B){return new(Q||(Q=Promise))((function(t,i){function I(A){try{o(B.next(A))}catch(A){i(A)}}function n(A){try{o(B.throw(A))}catch(A){i(A)}}function o(A){var e;A.done?t(A.value):(e=A.value,e instanceof Q?e:new Q((function(A){A(e)}))).then(I,n)}o((B=B.apply(A,e||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class t{constructor(){this.mutex=Promise.resolve()}lock(){let A=()=>{};return this.mutex=this.mutex.then((()=>new Promise(A))),new Promise((e=>{A=e}))}dispatch(A){return B(this,void 0,void 0,(function*(){const e=yield this.lock();try{return yield Promise.resolve(A())}finally{e()}}))}}const i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,I=null!==(e=i.Buffer)&&void 0!==e?e:null,n=i.TextEncoder?new i.TextEncoder:null;function o(A,e){return(15&A)+(A>>6|A>>3&8)<<4|(15&e)+(e>>6|e>>3&8)}const r="a".charCodeAt(0)-10,C="0".charCodeAt(0);function g(A,e,Q){let B=0;for(let t=0;t>>4;A[B++]=Q>9?Q+r:Q+C,Q=15&e[t],A[B++]=Q>9?Q+r:Q+C}return String.fromCharCode.apply(null,A)}const E=null!==I?A=>{if("string"==typeof A){const e=I.from(A,"utf8");return new Uint8Array(e.buffer,e.byteOffset,e.length)}if(I.isBuffer(A))return new Uint8Array(A.buffer,A.byteOffset,A.length);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")}:A=>{if("string"==typeof A)return n.encode(A);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")},a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=new Uint8Array(256);for(let A=0;A>4,t+=1,B[t]=(15&i)<<4|I>>2,t+=1,B[t]=(3&I)<<6|63&n,t+=1}return B}const w=16384,h=new t,f=new Map;function l(A,e){return B(this,void 0,void 0,(function*(){let Q=null,t=null,i=!1;if("undefined"==typeof WebAssembly)throw new Error("WebAssembly is not supported in this environment!");const I=()=>new DataView(Q.exports.memory.buffer).getUint32(Q.exports.STATE_SIZE,!0),n=h.dispatch((()=>B(this,void 0,void 0,(function*(){if(!f.has(A.name)){const e=c(A.data),Q=WebAssembly.compile(e);f.set(A.name,Q)}const e=yield f.get(A.name);Q=yield WebAssembly.instantiate(e,{})})))),r=(A=null)=>{i=!0,Q.exports.Hash_Init(A)},C=A=>{if(!i)throw new Error("update() called before init()");(A=>{let e=0;for(;e{if(!i)throw new Error("digest() called before init()");return i=!1,Q.exports.Hash_Final(B),"binary"===A?t.slice(0,e):g(a,t,e)},l=A=>"string"==typeof A?A.length<4096:A.byteLength!0;break;case"blake2b":case"blake2s":k=(A,e)=>e<=512&&l(A);break;case"blake3":k=(A,e)=>0===e&&l(A);break;case"xxhash64":case"xxhash3":case"xxhash128":case"crc64":k=()=>!1}return yield(()=>B(this,void 0,void 0,(function*(){Q||(yield n);const A=Q.exports.Hash_GetBuffer(),e=Q.exports.memory.buffer;t=new Uint8Array(e,A,w)})))(),{getMemory:()=>t,writeMemory:(A,e=0)=>{t.set(A,e)},getExports:()=>Q.exports,setMemorySize:A=>{Q.exports.Hash_SetMemorySize(A);const e=Q.exports.Hash_GetBuffer(),B=Q.exports.memory.buffer;t=new Uint8Array(B,e,A)},init:r,update:C,digest:s,save:()=>{if(!i)throw new Error("save() can only be called after init() and before digest()");const e=Q.exports.Hash_GetState(),B=I(),t=Q.exports.memory.buffer,n=new Uint8Array(t,e,B),r=new Uint8Array(4+B);return function(A,e){const Q=e.length>>1;for(let B=0;B{if(!(e instanceof Uint8Array))throw new Error("load() expects an Uint8Array generated by save()");const B=Q.exports.Hash_GetState(),t=I(),n=4+t,r=Q.exports.memory.buffer;if(e.length!==n)throw new Error(`Bad state length (expected ${n} bytes, got ${e.length})`);if(!function(A,e){if(A.length!==2*e.length)return!1;for(let Q=0;Q{if(!k(A,B))return r(B),C(A),s("hex",i);const I=E(A);return t.set(I),Q.exports.Hash_Calculate(I.length,B,i),g(a,t,e)},hashLength:e}}))}const k=new t;let D=null;A.createWhirlpool=function(){return l(Q,64).then((A=>{A.init();const e={init:()=>(A.init(),e),update:Q=>(A.update(Q),e),digest:e=>A.digest(e),save:()=>A.save(),load:Q=>(A.load(Q),e),blockSize:64,digestSize:64};return e}))},A.whirlpool=function(A){if(null===D)return function(A,e,Q){return B(this,void 0,void 0,(function*(){const B=yield A.lock(),t=yield l(e,Q);return B(),t}))}(k,Q,64).then((e=>(D=e,D.calculate(A))));try{const e=D.calculate(A);return Promise.resolve(e)}catch(A){return Promise.reject(A)}}})); diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/xxhash128.umd.min.js b/tools/mnemonic-test/node_modules/hash-wasm/dist/xxhash128.umd.min.js deleted file mode 100644 index cfc4e718..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/xxhash128.umd.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * hash-wasm (https://www.npmjs.com/package/hash-wasm) - * (c) Dani Biro - * @license MIT - */ - -!function(A,I){"object"==typeof exports&&"undefined"!=typeof module?I(exports):"function"==typeof define&&define.amd?define(["exports"],I):I((A="undefined"!=typeof globalThis?globalThis:A||self).hashwasm=A.hashwasm||{})}(this,(function(A){"use strict";var I,C={name:"xxhash128",data:"AGFzbQEAAAABKwdgAAF/YAR/f39/AGAHf39/f39/fwBgA39/fgF+YAR/f39+AGAAAGABfwADDQwAAQIDBAQEBQYFAAUFBAEBAgIGDgJ/AUHAjgULfwBBwAkLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAJSGFzaF9Jbml0AAcLSGFzaF9VcGRhdGUACApIYXNoX0ZpbmFsAAkNSGFzaF9HZXRTdGF0ZQAKDkhhc2hfQ2FsY3VsYXRlAAsKU1RBVEVfU0laRQMBCqBNDAUAQYAKC+QDAw9+AX8BfgJAIANFDQAgACkDMCEEIAApAzghBSAAKQMgIQYgACkDKCEHIAApAxAhCCAAKQMYIQkgACkDACEKIAApAwghCwNAIAUgAUEwaikDACIMfCACQThqKQMAIAFBOGopAwAiDYUiBUIgiCAFQv////8Pg358IQUgByABQSBqKQMAIg58IAJBKGopAwAgAUEoaikDACIPhSIHQiCIIAdC/////w+DfnwhByAJIAFBEGopAwAiEHwgAkEYaikDACABQRhqKQMAIhGFIglCIIggCUL/////D4N+fCEJIAsgASkDACISfCACQQhqIhMpAwAgAUEIaikDACIUhSILQiCIIAtC/////w+DfnwhCyACQTBqKQMAIAyFIgxCIIggDEL/////D4N+IAR8IA18IQQgAkEgaikDACAOhSIMQiCIIAxC/////w+DfiAGfCAPfCEGIAJBEGopAwAgEIUiDEIgiCAMQv////8Pg34gCHwgEXwhCCACKQMAIBKFIgxCIIggDEL/////D4N+IAp8IBR8IQogAUHAAGohASATIQIgA0F/aiIDDQALIAAgCTcDGCAAIAo3AwAgACALNwMIIAAgBzcDKCAAIAg3AxAgACAFNwM4IAAgBjcDICAAIAQ3AzALC94CAgF/AX4CQCAEIAIgASgCACIHayICSQ0AIAAgAyAFIAdBA3RqIAIQASAAIAUgBmoiBykDACAAKQMAIghCL4iFIAiFQrHz3fEJfjcDACAAIAcpAwggACkDCCIIQi+IhSAIhUKx893xCX43AwggACAHKQMQIAApAxAiCEIviIUgCIVCsfPd8Ql+NwMQIAAgBykDGCAAKQMYIghCL4iFIAiFQrHz3fEJfjcDGCAAIAcpAyAgACkDICIIQi+IhSAIhUKx893xCX43AyAgACAHKQMoIAApAygiCEIviIUgCIVCsfPd8Ql+NwMoIAAgBykDMCAAKQMwIghCL4iFIAiFQrHz3fEJfjcDMCAAIAcpAzggACkDOCIIQi+IhSAIhUKx893xCX43AzggACADIAJBBnRqIAUgBCACayIHEAEgASAHNgIADwsgACADIAUgB0EDdGogBBABIAEgByAEajYCAAvtAwEFfiABKQM4IAApAziFIgNC/////w+DIgQgASkDMCAAKQMwhSIFQiCIIgZ+IgdC/////w+DIANCIIgiAyAFQv////8PgyIFfnwgBCAFfiIEQiCIfCIFQiCGIARC/////w+DhCAHQiCIIAMgBn58IAVCIIh8hSABKQMoIAApAyiFIgNC/////w+DIgQgASkDICAAKQMghSIFQiCIIgZ+IgdC/////w+DIANCIIgiAyAFQv////8PgyIFfnwgBCAFfiIEQiCIfCIFQiCGIARC/////w+DhCAHQiCIIAMgBn58IAVCIIh8hSABKQMYIAApAxiFIgNC/////w+DIgQgASkDECAAKQMQhSIFQiCIIgZ+IgdC/////w+DIANCIIgiAyAFQv////8PgyIFfnwgBCAFfiIEQiCIfCIFQiCGIARC/////w+DhCAHQiCIIAMgBn58IAVCIIh8hSABKQMIIAApAwiFIgNC/////w+DIgQgASkDACAAKQMAhSIFQiCIIgZ+IgdC/////w+DIANCIIgiAyAFQv////8PgyIFfnwgBCAFfiIEQiCIfCIFQiCGIARC/////w+DhCAHQiCIIAMgBn58IAVCIIh8hSACfHx8fCICQiWIIAKFQvnz3fGZ8pmrFn4iAkIgiCAChQu6CAI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8Zn2masWfiIEQiCIIASFNwMAIAAgAigCDCACKAIIc60gA30iA0IhiCABQRh0IAtBgP4DcUEIdHIgCUEIdkGA/gNxIApBGHZyckENd62FIAOFQs/W077Sx6vZQn4iA0IdiCADhUL5893xmfaZqxZ+IgNCIIggA4U3AwgPCyAAIAIpA1AgAikDWIUgA4UiBEIhiCAEhULP1tO+0ser2UJ+IgRCHYggBIVC+fPd8Zn2masWfiIEQiCIIASFNwMIIAAgAikDQCACKQNIhSADhSIDQiGIIAOFQs/W077Sx6vZQn4iA0IdiCADhUL5893xmfaZqxZ+IgNCIIggA4U3AwALwwoBCn4gAa0iBEKHla+vmLbem55/fiEFAkACQCABQSFPDQBCACEGDAELQgAhBwJAIAFBwQBJDQBCACEHAkAgAUHhAEkNACACQfgAaikDACADfSABQciLAWopAwAiCIUiB0L/////D4MiCSACKQNwIAN8IAFBwIsBaikDACIKhSILQiCIIgx+Ig1CIIggB0IgiCIHIAx+fCANQv////8PgyAHIAtC/////w+DIgt+fCAJIAt+IgdCIIh8IglCIIh8QQApA7iMASILQQApA7CMASIMfIUgCUIghiAHQv////8Pg4SFIQcgAkHoAGopAwAgA30gC4UiCUL/////D4MiCyACKQNgIAN8IAyFIgxCIIgiDX4iBkL/////D4MgCUIgiCIJIAxC/////w+DIgx+fCALIAx+IgtCIIh8IgxCIIYgC0L/////D4OEIAZCIIggCSANfnwgDEIgiHyFIAV8IAggCnyFIQULIAJB2ABqKQMAIAN9IAFB2IsBaikDACIIhSIJQv////8PgyIKIAIpA1AgA3wgAUHQiwFqKQMAIguFIgxCIIgiDX4iBkL/////D4MgCUIgiCIJIAxC/////w+DIgx+fCAKIAx+IgpCIIh8IgxCIIYgCkL/////D4OEIAZCIIggCSANfnwgDEIgiHyFIAd8QQApA6iMASIJQQApA6CMASIKfIUhByACQcgAaikDACADfSAJhSIJQv////8PgyIMIAIpA0AgA3wgCoUiCkIgiCINfiIGQv////8PgyAJQiCIIgkgCkL/////D4MiCn58IAwgCn4iCkIgiHwiDEIghiAKQv////8Pg4QgBkIgiCAJIA1+fCAMQiCIfIUgBXwgCCALfIUhBQsgAkE4aikDACADfSABQeiLAWopAwAiCIUiCUL/////D4MiCiACKQMwIAN8IAFB4IsBaikDACILhSIMQiCIIg1+IgZC/////w+DIAlCIIgiCSAMQv////8PgyIMfnwgCiAMfiIKQiCIfCIMQiCGIApC/////w+DhCAGQiCIIAkgDX58IAxCIIh8hSAHfEEAKQOYjAEiB0EAKQOQjAEiCXyFIQYgAkEoaikDACADfSAHhSIHQv////8PgyIKIAIpAyAgA3wgCYUiCUIgiCIMfiINQv////8PgyAHQiCIIgcgCUL/////D4MiCX58IAogCX4iCUIgiHwiCkIghiAJQv////8Pg4QgDUIgiCAHIAx+fCAKQiCIfIUgBXwgCCALfIUhBQsgACACQRhqKQMAIAN9IAFB+IsBaikDACIHhSIIQv////8PgyIJIAIpAxAgA3wgAUHwiwFqKQMAIgqFIgtCIIgiDH4iDUL/////D4MgCEIgiCIIIAtC/////w+DIgt+fCAJIAt+IglCIIh8IgtCIIYgCUL/////D4OEIA1CIIggCCAMfnwgC0IgiHyFIAZ8QQApA4iMASIIQQApA4CMASIJfIUiCyACQQhqKQMAIAN9IAiFIghC/////w+DIgwgAikDACADfCAJhSIJQiCIIg1+IgZC/////w+DIAhCIIgiCCAJQv////8PgyIJfnwgDCAJfiIJQiCIfCIMQiCGIAlC/////w+DhCAGQiCIIAggDX58IAxCIIh8hSAFfCAHIAp8hSIFfCIHQiWIIAeFQvnz3fGZ8pmrFn4iB0IgiCAHhTcDACAAQgAgBUKHla+vmLbem55/fiAEIAN9Qs/W077Sx6vZQn58IAtC49zKlfzO8vWFf358IgNCJYggA4VC+fPd8ZnymasWfiIDQiCIIAOFfTcDCAuhDwMBfxR+An9BACEEIAJB+ABqKQMAIAN9QQApA/iMASIFhSIGQv////8PgyIHIAIpA3AgA3xBACkD8IwBIgiFIglCIIgiCn4iC0L/////D4MgBkIgiCIGIAlC/////w+DIgl+fCAHIAl+IgdCIIh8IglCIIYgB0L/////D4OEIAtCIIggBiAKfnwgCUIgiHyFIAJB2ABqKQMAIAN9QQApA9iMASIHhSIGQv////8PgyIJIAIpA1AgA3xBACkD0IwBIgqFIgtCIIgiDH4iDUL/////D4MgBkIgiCIGIAtC/////w+DIgt+fCAJIAt+IglCIIh8IgtCIIYgCUL/////D4OEIA1CIIggBiAMfnwgC0IgiHyFIAJBOGopAwAgA31BACkDuIwBIgmFIgZC/////w+DIgsgAikDMCADfEEAKQOwjAEiDIUiDUIgiCIOfiIPQv////8PgyAGQiCIIgYgDUL/////D4MiDX58IAsgDX4iC0IgiHwiDUIghiALQv////8Pg4QgD0IgiCAGIA5+fCANQiCIfIUgAkEYaikDACADfUEAKQOYjAEiC4UiBkL/////D4MiDSACKQMQIAN8QQApA5CMASIOhSIPQiCIIhB+IhFC/////w+DIAZCIIgiBiAPQv////8PgyIPfnwgDSAPfiINQiCIfCIPQiCGIA1C/////w+DhCARQiCIIAYgEH58IA9CIIh8hUEAKQOIjAEiDUEAKQOAjAEiD3yFfEEAKQOojAEiEEEAKQOgjAEiEXyFfEEAKQPIjAEiEkEAKQPAjAEiE3yFfEEAKQPojAEiFEEAKQPgjAEiFXyFIgZCJYggBoVC+fPd8ZnymasWfiIGQiCIIAaFIQYgAkHoAGopAwAgA30gFIUiFEL/////D4MiFiACKQNgIAN8IBWFIhVCIIgiF34iGEL/////D4MgFEIgiCIUIBVC/////w+DIhV+fCAWIBV+IhVCIIh8IhZCIIYgFUL/////D4OEIBhCIIggFCAXfnwgFkIgiHyFIAJByABqKQMAIAN9IBKFIhJC/////w+DIhQgAikDQCADfCAThSITQiCIIhV+IhZC/////w+DIBJCIIgiEiATQv////8PgyITfnwgFCATfiITQiCIfCIUQiCGIBNC/////w+DhCAWQiCIIBIgFX58IBRCIIh8hSACQShqKQMAIAN9IBCFIhBC/////w+DIhIgAikDICADfCARhSIRQiCIIhN+IhRC/////w+DIBBCIIgiECARQv////8PgyIRfnwgEiARfiIRQiCIfCISQiCGIBFC/////w+DhCAUQiCIIBAgE358IBJCIIh8hSACQQhqKQMAIAN9IA2FIg1C/////w+DIhAgAikDACADfCAPhSIPQiCIIhF+IhJC/////w+DIA1CIIgiDSAPQv////8PgyIPfnwgECAPfiIPQiCIfCIQQiCGIA9C/////w+DhCASQiCIIA0gEX58IBBCIIh8hSABrSIPQoeVr6+Ytt6bnn9+fCALIA58hXwgCSAMfIV8IAcgCnyFfCAFIAh8hSIFQiWIIAWFQvnz3fGZ8pmrFn4iBUIgiCAFhSEFAkAgAUGgAUgNACABQQV2QXxqIRkDQCACIARqIhpBG2opAwAgA30gBEGYjQFqKQMAIgeFIghC/////w+DIgkgGkETaikDACADfCAEQZCNAWopAwAiCoUiC0IgiCIMfiINQv////8PgyAIQiCIIgggC0L/////D4MiC358IAkgC34iCUIgiHwiC0IghiAJQv////8Pg4QgDUIgiCAIIAx+fCALQiCIfIUgBnwgBEGIjQFqKQMAIgggBEGAjQFqKQMAIgl8hSEGIBpBC2opAwAgA30gCIUiCEL/////D4MiCyAaQQNqKQMAIAN8IAmFIglCIIgiDH4iDUL/////D4MgCEIgiCIIIAlC/////w+DIgl+fCALIAl+IglCIIh8IgtCIIYgCUL/////D4OEIA1CIIggCCAMfnwgC0IgiHyFIAV8IAcgCnyFIQUgBEEgaiEEIBlBf2oiGQ0ACwsgACACQf8AaikDACADfCABQeiLAWopAwAiB4UiCEL/////D4MiCSACKQN3IAN9IAFB4IsBaikDACIKhSILQiCIIgx+Ig1C/////w+DIAhCIIgiCCALQv////8PgyILfnwgCSALfiIJQiCIfCILQiCGIAlC/////w+DhCANQiCIIAggDH58IAtCIIh8hSAGfCABQfiLAWopAwAiBiABQfCLAWopAwAiCHyFIgkgAkHvAGopAwAgA3wgBoUiBkL/////D4MiCyACKQNnIAN9IAiFIghCIIgiDH4iDUL/////D4MgBkIgiCIGIAhC/////w+DIgh+fCALIAh+IghCIIh8IgtCIIYgCEL/////D4OEIA1CIIggBiAMfnwgC0IgiHyF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QQAgADcDoI4BQQAgATYCsI4BQQBCkICAgIAQNwOYjgEL9AkBCH9BAEEAKQOQjgEgAK18NwOQjgECQAJAAkBBACgCgI4BIgEgAGoiAkGAAksNACABQYCMAWohA0GACiEEAkAgAEEITw0AIAAhAQwCCwJAAkAgAEF4aiIFQQN2QQFqQQdxIgYNAEGACiEEIAAhAQwBCyAGQQN0IQFBgAohBANAIAMgBCkDADcDACADQQhqIQMgBEEIaiEEIAZBf2oiBg0ACyAAIAFrIQELIAVBOEkNAQNAIAMgBCkDADcDACADQQhqIARBCGopAwA3AwAgA0EQaiAEQRBqKQMANwMAIANBGGogBEEYaikDADcDACADQSBqIARBIGopAwA3AwAgA0EoaiAEQShqKQMANwMAIANBMGogBEEwaikDADcDACADQThqIARBOGopAwA3AwAgA0HAAGohAyAEQcAAaiEEIAFBQGoiAUEHSw0ADAILC0GACiEEIABBgApqIQVBACgCsI4BIgNBwIoBIAMbIQYCQCABRQ0AIAFBgIwBaiEDQYAKIQQCQAJAQYACIAFrIgdBCE8NACAHIQAMAQsCQAJAQfgBIAFrIghBA3ZBAWpBB3EiAg0AQYAKIQQgByEADAELQYAKIQQgAkEDdCIAIQIDQCADIAQpAwA3AwAgA0EIaiEDIARBCGohBCACQXhqIgINAAtBgAIgASAAamshAAsgCEE4SQ0AA0AgAyAEKQMANwMAIANBCGogBEEIaikDADcDACADQRBqIARBEGopAwA3AwAgA0EYaiAEQRhqKQMANwMAIANBIGogBEEgaikDADcDACADQShqIARBKGopAwA3AwAgA0EwaiAEQTBqKQMANwMAIANBOGogBEE4aikDADcDACADQcAAaiEDIARBwABqIQQgAEFAaiIAQQdLDQALCwJAIABFDQACQAJAIABBB3EiAg0AIAAhAQwBCyAAQXhxIQEDQCADIAQtAAA6AAAgA0EBaiEDIARBAWohBCACQX9qIgINAAsLIABBCEkNAANAIAMgBCkAADcAACADQQhqIQMgBEEIaiEEIAFBeGoiAQ0ACwtBgIoBQYiOAUEAKAKYjgFBgIwBQQQgBkEAKAK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yAAQQFqIQAgDkF/aiIODQALCyAHQQhJDQELA0AgCyAAKQAANwAAIAtBCGohCyAAQQhqIQAgDUF4aiINDQALCyACIAIpAwggAikDQCIIfCADQQAoApyOAWoiACkDASACKQNIIgmFIgpCIIggCkL/////D4N+fDcDCCACIAIpAxggAikDUCIKfCAAKQMRIAIpA1giEIUiEUIgiCARQv////8Pg358NwMYIAIgECAKIAApAwmFIgpCIIggCkL/////D4N+IAIpAxB8fDcDECACIAkgCCAAQXlqKQMAhSIIQiCIIAhC/////w+DfiACKQMAfHw3AwAgACkDGSEIIAIpAyAhCSACIAIpAyggAikDYCIKfCAAKQMhIAIpA2giEIUiEUIgiCARQv////8Pg358NwMoIAIgECAJIAggCoUiCEIgiCAIQv////8Pg358fDcDICACIAYgAikDcCIIfCAAKQMxIAIpA3giBoUiCUIgiCAJQv////8Pg358NwM4IAIgBiAIIAApAymFIghCIIggCEL/////D4N+IAV8fDcDMAsgAiACIANBC2ogBEKHla+vmLbem55/fhADNwNAIAIgAiADQQAoApyOAWpBdWogBELP1tO+0ser2UJ+Qn+FEAM3A0gMAQsgBKchAAJAQQApA6COASIEUA0AAkAgAEEQSw0AIAJBwABqIABBgAggBBAEDAILAkAgAEGAAUsNACACQcAAaiAAQYAIIAQQBQwCCyACQcAAaiAAQYAIIAQQBgwBCwJAIABBEEsNACACQcAAaiAAIANCABAEDAELAkAgAEGAAUsNACACQcAAaiAAIANCABAFDAELIAJBwABqIAAgA0IAEAYLQQAgAikDcDcDuApBACACKQNgNwOoCkEAIAIpA1A3A5gKQQAgAkH4AGopAwA3A8AKQQAgAkHoAGopAwA3A7AKQQAgAkHYAGopAwA3A6AKQQAgAikDSCIEQjiGIARCgP4Dg0IohoQgBEKAgPwHg0IYhiAEQoCAgPgPg0IIhoSEIARCCIhCgICA+A+DIARCGIhCgID8B4OEIARCKIhCgP4DgyAEQjiIhISEIgQ3A4AKQQAgBDcDkApBACACKQNAIgRCOIYgBEKA/gODQiiGhCAEQoCA/AeDQhiGIARCgICA+A+DQgiGhIQgBEIIiEKAgID4D4MgBEIYiEKAgPwHg4QgBEIoiEKA/gODIARCOIiEhIQ3A4gKIAEkAAsGAEGAigELAgALC8wBAQBBgAgLxAG4/mw5I6RLvnwBgSz3Ia0c3tRt6YOQl9tyQKSkt7NnH8t55k7MwOV4glrQfcz/ciG4CEZ090MkjuA1kOaBOiZMPChSu5HDAMuI0GWLG1Muo3FkSJeiDflOOBnvRqnerNio+nY/45w0P/ncu8fHC08dilHgS820WTHIn37J2XhzZOrFrIM00+vDxYGg//oTY+sXDd1Rt/DaSdMWVSYp1GieKxa+WH1HofyP+LjRetAxzkXLOo+VFgQor9f7yrtLQH5AAgAA",hash:"b9ab74e2"};function g(A,I,C,g){return new(C||(C=Promise))((function(i,Q){function B(A){try{e(g.next(A))}catch(A){Q(A)}}function D(A){try{e(g.throw(A))}catch(A){Q(A)}}function e(A){var I;A.done?i(A.value):(I=A.value,I instanceof C?I:new C((function(A){A(I)}))).then(B,D)}e((g=g.apply(A,I||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class i{constructor(){this.mutex=Promise.resolve()}lock(){let A=()=>{};return this.mutex=this.mutex.then((()=>new Promise(A))),new Promise((I=>{A=I}))}dispatch(A){return g(this,void 0,void 0,(function*(){const I=yield this.lock();try{return yield Promise.resolve(A())}finally{I()}}))}}const Q="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,B=null!==(I=Q.Buffer)&&void 0!==I?I:null,D=Q.TextEncoder?new Q.TextEncoder:null;function e(A,I){return(15&A)+(A>>6|A>>3&8)<<4|(15&I)+(I>>6|I>>3&8)}const t="a".charCodeAt(0)-10,E="0".charCodeAt(0);function w(A,I,C){let g=0;for(let i=0;i>>4;A[g++]=C>9?C+t:C+E,C=15&I[i],A[g++]=C>9?C+t:C+E}return String.fromCharCode.apply(null,A)}const n=null!==B?A=>{if("string"==typeof A){const I=B.from(A,"utf8");return new Uint8Array(I.buffer,I.byteOffset,I.length)}if(B.isBuffer(A))return new Uint8Array(A.buffer,A.byteOffset,A.length);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")}:A=>{if("string"==typeof A)return D.encode(A);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")},h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=new Uint8Array(256);for(let A=0;A>4,i+=1,g[i]=(15&Q)<<4|B>>2,i+=1,g[i]=(3&B)<<6|63&D,i+=1}return g}const r=16384,s=new i,a=new Map;function F(A,I){return g(this,void 0,void 0,(function*(){let C=null,i=null,Q=!1;if("undefined"==typeof WebAssembly)throw new Error("WebAssembly is not supported in this environment!");const B=()=>new DataView(C.exports.memory.buffer).getUint32(C.exports.STATE_SIZE,!0),D=s.dispatch((()=>g(this,void 0,void 0,(function*(){if(!a.has(A.name)){const I=f(A.data),C=WebAssembly.compile(I);a.set(A.name,C)}const I=yield a.get(A.name);C=yield WebAssembly.instantiate(I,{})})))),t=(A=null)=>{Q=!0,C.exports.Hash_Init(A)},E=A=>{if(!Q)throw new Error("update() called before init()");(A=>{let I=0;for(;I{if(!Q)throw new Error("digest() called before init()");return Q=!1,C.exports.Hash_Final(g),"binary"===A?i.slice(0,I):w(h,i,I)},F=A=>"string"==typeof A?A.length<4096:A.byteLength!0;break;case"blake2b":case"blake2s":c=(A,I)=>I<=512&&F(A);break;case"blake3":c=(A,I)=>0===I&&F(A);break;case"xxhash64":case"xxhash3":case"xxhash128":case"crc64":c=()=>!1}return yield(()=>g(this,void 0,void 0,(function*(){C||(yield D);const A=C.exports.Hash_GetBuffer(),I=C.exports.memory.buffer;i=new Uint8Array(I,A,r)})))(),{getMemory:()=>i,writeMemory:(A,I=0)=>{i.set(A,I)},getExports:()=>C.exports,setMemorySize:A=>{C.exports.Hash_SetMemorySize(A);const I=C.exports.Hash_GetBuffer(),g=C.exports.memory.buffer;i=new Uint8Array(g,I,A)},init:t,update:E,digest:o,save:()=>{if(!Q)throw new Error("save() can only be called after init() and before digest()");const I=C.exports.Hash_GetState(),g=B(),i=C.exports.memory.buffer,D=new Uint8Array(i,I,g),t=new Uint8Array(4+g);return function(A,I){const C=I.length>>1;for(let g=0;g{if(!(I instanceof Uint8Array))throw new Error("load() expects an Uint8Array generated by save()");const g=C.exports.Hash_GetState(),i=B(),D=4+i,t=C.exports.memory.buffer;if(I.length!==D)throw new Error(`Bad state length (expected ${D} bytes, got ${I.length})`);if(!function(A,I){if(A.length!==2*I.length)return!1;for(let C=0;C{if(!c(A,g))return t(g),E(A),o("hex",Q);const B=n(A);return i.set(B),C.exports.Hash_Calculate(B.length,g,Q),w(h,i,I)},hashLength:I}}))}const c=new i;let y=null;const M=new Uint8Array(8);function k(A){return!Number.isInteger(A)||A<0||A>4294967295?new Error("Seed must be given as two valid 32-bit long unsigned integers (lo + high)."):null}function N(A,I,C){const g=new DataView(A);g.setUint32(0,I,!0),g.setUint32(4,C,!0)}A.createXXHash128=function(A=0,I=0){return k(A)?Promise.reject(k(A)):k(I)?Promise.reject(k(I)):F(C,16).then((C=>{const g=new Uint8Array(8);N(g.buffer,A,I),C.writeMemory(g),C.init();const i={init:()=>(C.writeMemory(g),C.init(),i),update:A=>(C.update(A),i),digest:A=>C.digest(A),save:()=>C.save(),load:A=>(C.load(A),i),blockSize:512,digestSize:16};return i}))},A.xxhash128=function(A,I=0,i=0){if(k(I))return Promise.reject(k(I));if(k(i))return Promise.reject(k(i));if(null===y)return function(A,I,C){return g(this,void 0,void 0,(function*(){const g=yield A.lock(),i=yield F(I,C);return g(),i}))}(c,C,16).then((C=>(y=C,N(M.buffer,I,i),y.writeMemory(M),y.calculate(A))));try{N(M.buffer,I,i),y.writeMemory(M);const C=y.calculate(A);return Promise.resolve(C)}catch(A){return Promise.reject(A)}}})); diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/xxhash3.umd.min.js b/tools/mnemonic-test/node_modules/hash-wasm/dist/xxhash3.umd.min.js deleted file mode 100644 index bdcb6984..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/xxhash3.umd.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * hash-wasm (https://www.npmjs.com/package/hash-wasm) - * (c) Dani Biro - * @license MIT - */ - -!function(A,I){"object"==typeof exports&&"undefined"!=typeof module?I(exports):"function"==typeof define&&define.amd?define(["exports"],I):I((A="undefined"!=typeof globalThis?globalThis:A||self).hashwasm=A.hashwasm||{})}(this,(function(A){"use strict";var I,g={name:"xxhash3",data:"AGFzbQEAAAABNAhgAAF/YAR/f39/AGAHf39/f39/fwBgBH9+fn4BfmAEf39/fgF+YAN/f34BfmAAAGABfwADDg0AAQIDBAUFBQYHBgAGBQQBAQICBg4CfwFBwI4FC38AQcAJCwdwCAZtZW1vcnkCAA5IYXNoX0dldEJ1ZmZlcgAACUhhc2hfSW5pdAAIC0hhc2hfVXBkYXRlAAkKSGFzaF9GaW5hbAAKDUhhc2hfR2V0U3RhdGUACw5IYXNoX0NhbGN1bGF0ZQAMClNUQVRFX1NJWkUDAQr6QQ0FAEGACgvkAwMPfgF/AX4CQCADRQ0AIAApAzAhBCAAKQM4IQUgACkDICEGIAApAyghByAAKQMQIQggACkDGCEJIAApAwAhCiAAKQMIIQsDQCAFIAFBMGopAwAiDHwgAkE4aikDACABQThqKQMAIg2FIgVCIIggBUL/////D4N+fCEFIAcgAUEgaikDACIOfCACQShqKQMAIAFBKGopAwAiD4UiB0IgiCAHQv////8Pg358IQcgCSABQRBqKQMAIhB8IAJBGGopAwAgAUEYaikDACIRhSIJQiCIIAlC/////w+DfnwhCSALIAEpAwAiEnwgAkEIaiITKQMAIAFBCGopAwAiFIUiC0IgiCALQv////8Pg358IQsgAkEwaikDACAMhSIMQiCIIAxC/////w+DfiAEfCANfCEEIAJBIGopAwAgDoUiDEIgiCAMQv////8Pg34gBnwgD3whBiACQRBqKQMAIBCFIgx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MgA0I4iISEhCAArXwgAEH4iwFqKQMAIAEpAzAgASkDKIUgAn2FIgJ8IAJC/////w+DIgQgA0IgiCIFfiIGQv////8PgyACQiCIIgIgA0L/////D4MiA358IAQgA34iA0IgiHwiBEIghiADQv////8Pg4QgBkIgiCACIAV+fCAEQiCIfIV8IgNCJYggA4VC+fPd8ZnymasWfiIDQiCIIAOFDwsCQCAAQQRJDQAgACABQQhqKQMAIAFBEGopAwAgAhADDwsCQCAARQ0AIAAgASgCACABQQRqKAIAIAIQBA8LIAEpAzggASkDQIUgAoUiA0IhiCADhULP1tO+0ser2UJ+IgNCHYggA4VC+fPd8Zn2masWfiIDQiCIIAOFC94IAQZ+IACtQoeVr6+Ytt6bnn9+IQMCQCAAQSFJDQACQCAAQcEASQ0AAkAgAEHhAEkNACABKQNoIAJ9QQApA7iMAYUiBEL/////D4MiBSABKQNgIAJ8QQApA7CMAYUiBkIgiCIHfiIIQv////8PgyAEQiCIIgQgBkL/////D4MiBn58IAUgBn4iBUIgiHwiBkIghiAFQv////8Pg4QgCEIgiCAEIAd+fCAGQiCIfIUgA3wgASkDeCACfSAAQciLAWopAwCFIgNC/////w+DIgQgASkDcCACfCAAQcCLAWopAwCFIgVCIIgiBn4iB0L/////D4MgA0IgiCIDIAVC/////w+DIgV+fCAEIAV+IgRCIIh8IgVCIIYgBEL/////D4OEIAdCIIggAyAGfnwgBUIgiHyFfCEDCyABKQNIIAJ9QQApA6iMAYUiBEL/////D4MiBSABKQNAIAJ8QQApA6CMAYUiBkIgiCIHfiIIQv////8PgyAEQiCIIgQgBkL/////D4MiBn58IAUgBn4iBUIgiHwiBkIghiAFQv////8Pg4QgCEIgiCAEIAd+fCAGQiCIfIUgA3wgASkDWCACfSAAQdiLAWopAwCFIgNC/////w+DIgQgASkDUCACfCAAQdCLAWopAwCFIgVCIIgiBn4iB0L/////D4MgA0IgiCIDIAVC/////w+DIgV+fCAEIAV+IgRCIIh8IgVCIIYgBEL/////D4OEIAdCIIggAyAGfnwgBUIgiHyFfCEDCyABKQMoIAJ9QQApA5iMAYUiBEL/////D4MiBSABKQMgIAJ8QQApA5CMAYUiBkIgiCIHfiIIQv////8PgyAEQiCIIgQgBkL/////D4MiBn58IAUgBn4iBUIgiHwiBkIghiAFQv////8Pg4QgCEIgiCAEIAd+fCAGQiCIfIUgA3wgASkDOCACfSAAQeiLAWopAwCFIgNC/////w+DIgQgASkDMCACfCAAQeCLAWopAwCFIgVCIIgiBn4iB0L/////D4MgA0IgiCIDIAVC/////w+DIgV+fCAEIAV+IgRCIIh8IgVCIIYgBEL/////D4OEIAdCIIggAyAGfnwgBUIgiHyFfCEDCyABKQMIIAJ9QQApA4iMAYUiBEL/////D4MiBSABKQMAIAJ8QQApA4CMAYUiBkIgiCIHfiIIQv////8PgyAEQiCIIgQgBkL/////D4MiBn58IAUgBn4iBUIgiHwiBkIghiAFQv////8Pg4QgCEIgiCAEIAd+fCAGQiCIfIUgA3wgASkDGCACfSAAQfiLAWopAwCFIgNC/////w+DIgQgASkDECACfCAAQfCLAWopAwCFIgJCIIgiBX4iBkL/////D4MgA0IgiCIDIAJC/////w+DIgJ+fCAEIAJ+IgJCIIh8IgRCIIYgAkL/////D4OEIAZCIIggAyAFfnwgBEIgiHyFfCICQiWIIAKFQvnz3fGZ8pmrFn4iAkIgiCAChQv8CgQBfwV+An8BfkEAIQMgASkDeCACfUEAKQP4jAGFIgRC/////w+DIgUgASkDcCACfEEAKQPwjAGFIgZCIIgiB34iCEL/////D4MgBEIgiCIEIAZC/////w+DIgZ+fCAFIAZ+IgVCIIh8IgZCIIYgBUL/////D4OEIAhCIIggBCAHfnwgBkIgiHyFIAEpA2ggAn1BACkD6IwBhSIEQv////8PgyIFIAEpA2AgAnxBACkD4IwBhSIGQiCIIgd+IghC/////w+DIARCIIgiBCAGQv////8PgyIGfnwgBSAGfiIFQiCIfCIGQiCGIAVC/////w+DhCAIQiCIIAQgB358IAZCIIh8hSABKQNYIAJ9QQApA9iMAYUiBEL/////D4MiBSABKQNQIAJ8QQApA9CMAYUiBkIgiCIHfiIIQv////8PgyAEQiCIIgQgBkL/////D4MiBn58IAUgBn4iBUIgiHwiBkIghiAFQv////8Pg4QgCEIgiCAEIAd+fCAGQiCIfIUgASkDSCACfUEAKQPIjAGFIgRC/////w+DIgUgASkDQCACfEEAKQPAjAGFIgZCIIgiB34iCEL/////D4MgBEIgiCIEIAZC/////w+DIgZ+fCAFIAZ+IgVCIIh8IgZCIIYgBUL/////D4OEIAhCIIggBCAHfnwgBkIgiHyFIAEpAzggAn1BACkDuIwBhSIEQv////8PgyIFIAEpAzAgAnxBACkDsIwBhSIGQiCIIgd+IghC/////w+DIARCIIgiBCAGQv////8PgyIGfnwgBSAGfiIFQiCIfCIGQiCGIAVC/////w+DhCAIQiCIIAQgB358IAZCIIh8hSABKQMoIAJ9QQApA6iMAYUiBEL/////D4MiBSABKQMgIAJ8QQApA6CMAYUiBkIgiCIHfiIIQv////8PgyAEQiCIIgQgBkL/////D4MiBn58IAUgBn4iBUIgiHwiBkIghiAFQv////8Pg4QgCEIgiCAEIAd+fCAGQiCIfIUgASkDGCACfUEAKQOYjAGFIgRC/////w+DIgUgASkDECACfEEAKQOQjAGFIgZCIIgiB34iCEL/////D4MgBEIgiCIEIAZC/////w+DIgZ+fCAFIAZ+IgVCIIh8IgZCIIYgBUL/////D4OEIAhCIIggBCAHfnwgBkIgiHyFIAEpAwggAn1BACkDiIwBhSIEQv////8PgyIFIAEpAwAgAnxBACkDgIwBhSIGQiCIIgd+IghC/////w+DIARCIIgiBCAGQv////8PgyIGfnwgBSAGfiIFQiCIfCIGQiCGIAVC/////w+DhCAIQiCIIAQgB358IAZCIIh8hSAArUKHla+vmLbem55/fnx8fHx8fHx8IgRCJYggBIVC+fPd8ZnymasWfiIEQiCIIASFIQQCQCAAQZABSA0AIABBBHZBeGohCQNAIAEgA2oiCkELaikDACACfSADQYiNAWopAwCFIgVC/////w+DIgYgCkEDaikDACACfCADQYCNAWopAwCFIgdCIIgiCH4i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zKlQw3A4CKAUEAQoeVr6+Ytt6bnn83A4iKAUEAQs/W077Sx6vZQjcDkIoBQQBC+fPd8Zn2masWNwOYigFBAELj3MqV/M7y9YV/NwOgigFBAEL3lK+vCDcDqIoBQQBCxc/ZsvHluuonNwOwigFBAEKx893xCTcDuIoBQQAgADcDoI4BQQAgATYCsI4BQQBCkICAgIAQNwOYjgEL9AkBCH9BAEEAKQOQjgEgAK18NwOQjgECQAJAAkBBACgCgI4BIgEgAGoiAkGAAksNACABQYCMAWohA0GACiEEAkAgAEEITw0AIAAhAQwCCwJAAkAgAEF4aiIFQQN2QQFqQQdxIgYNAEGACiEEIAAhAQwBCyAGQQN0IQFBgAohBANAIAMgBCkDADcDACADQQhqIQMgBEEIaiEEIAZBf2oiBg0ACyAAIAFrIQELIAVBOEkNAQNAIAMgBCkDADcDACADQQhqIARBCGopAwA3AwAgA0EQaiAEQRBqKQMANwMAIANBGGogBEEYaikDADcDACADQSBqIARBIGopAwA3AwAgA0EoaiAEQShqKQMANwMAIANBMGogBEEwaikDADcDACADQThqIARBOGopAwA3AwAgA0HAAGohAyAEQcAAaiEEIAFBQGoiAUEHSw0ADAILC0GACiEEIABBgApqIQVBACgCsI4BIgNBwIoBIAMbIQYCQCABRQ0AIAFBgIwBaiEDQYAKIQQCQAJAQYACIAFrIgdBCE8NACAHIQAMAQsCQAJAQfgBIAFrIghBA3ZBAWpBB3EiAg0AQYAKIQQgByEADAELQYAKIQQgAkEDdCIAIQIDQCADIAQpAwA3AwAgA0EIaiEDIARBCGohBCACQXhqIgINAAtBgAIgASAAamshAAsgCEE4SQ0AA0AgAyAEKQMANwMAIANBCGogBEEIaikDADcDACADQRBqIARBEGopAwA3AwAgA0EYaiAEQRhqKQMANwMAIANBIGogBEEgaikDADcDACADQShqIARBKGopAwA3AwAgA0EwaiAEQTBqKQMANwMAIANBOGogBEE4aikDADcDACADQcAAaiEDIARBwABqIQQgAEFAaiIAQQdLDQALCwJAIABFDQACQAJAIABBB3EiAg0AI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MJIQkgACkDGSEKIAApAykhCyAHQcCLAWopAwAhBSAAKQMBIQwgB0HIiwFqKQMAIQYgB0HQiwFqKQMAIQ0gACkDESEOIAdB2IsBaikDACEPIAdB4IsBaikDACEQIAApAyEhESAHQeiLAWopAwAhEiACKQMAIRMgAikDECEUIAIpAyAhFSACKQMwIRYgAikDCCEXIAIpAxghGCACKQMoIRkgAiACKQM4IAdB8IsBaikDACIafCAAKQMxIAdB+IsBaikDACIbhSIcQiCIIBxC/////w+Dfnw3AzggGSAQfCARIBKFIhFCIIggEUL/////D4N+fCERIBggDXwgDiAPhSIOQiCIIA5C/////w+DfnwhDiAXIAV8IAwgBoUiDEIgiCAMQv////8Pg358IQwgGyAWIAsgGoUiC0IgiCALQv////8Pg358fCELIBIgFSAKIBCFIhBCIIggEEL/////D4N+fHwhECAPIBQgCSANhSINQiCIIA1C/////w+Dfnx8IRIgBiATIAggBYUiBUIgiCAFQv////8Pg358fCEIDAELIAdBwI0BaiEdQcAAIAdrIR4gAkHAAGohAAJAAkACQCAHQThNDQAgHiEfDAELAkACQEE4IAdrQQN2QQFqQQdxIh8NACACQcAAaiEAIB4hHwwBCyACQcAAaiEAIB9BA3QiICEfA0AgACAdKQMANwMAIABBCGohACAdQQhqIR0gH0F4aiIfDQALQcAAIAcgIGprIR8LAkAgBw0AA0AgACAdKQMANwMAIABBCGogHUEIaikDADcDACAAQRBqIB1BEGopAwA3AwAgAEEYaiAdQRhqKQMANwMAIABBIGogHUEgaikDADcDACAAQShqIB1BKGopAwA3AwAgAEEwaiAdQTBqKQMANwMAIABBOGogHUE4aikDADcDACAAQcAAaiEAIB1BwABqIR0gH0FAaiIfQQdLDQALCyAfRQ0BCyAfQX9qISECQCAfQQdxIiBFDQAgH0F4cSEfA0AgACAdLQAAOgAAIABBAWohACAdQQFqIR0gIEF/aiIgDQALCyAhQQdJDQADQCAAIB0pAAA3AAAgAEEIaiEAIB1BCGohHSAfQXhqIh8NAAsLIAJBwABqIB5qIR1BgIwBIQACQAJAAkAgB0EISQ0AAkAgB0E4akEDdkEBakEHcSIfDQAMAgsgH0EDdCEgQYCMASEAA0AgHSAAKQMANwMAIB1BCGohHSAAQQhqIQAgH0F/aiIfDQALIAcgIGshBwsgB0UNAQJAAkAgB0EHcSIgDQAgByEfDAELIAdBeHEhHwNAIB0gAC0AADoAACAdQQFqIR0gAEEBaiEAICBBf2oiIA0ACwsgB0EISQ0BCwNAIB0gACkAADcAACAdQQhqIR0gAEEIaiEAIB9BeGoiHw0ACwsgA0EAKAKcjgFqIgBBeWopAwAhCiAAKQMJIRMgACkDGSEUIAApAykhCyAAKQMBIQwgACkDESEOIAApAyEhESACKQMAIRUgAikDECEWIAIpAyAhFyACKQMIIRggAikDQCENIAIpA0ghDyACKQMYIRkgAikDUCESIAIpA1ghCCACKQMoIRogAikDYCEQIAIpA2ghCSACIAYgAikDcCIbfCAAKQMxIAIpA3giBoUiHEIgiCAcQv////8Pg358NwM4IBogEHwgESAJhSIRQiCIIBFC/////w+DfnwhESAZIBJ8IA4gCIUiDkIgiCAOQv////8Pg358IQ4gGCANfCAMIA+FIgxCIIggDEL/////D4N+fCEMIAYgCyAbhSILQiCIIAtC/////w+DfiAFfHwhCyAJIBcgFCAQhSIFQiCIIAVC/////w+Dfnx8IRAgCCAWIBMgEoUiBUIgiCAFQv////8Pg358fCESIA8gFSAKIA2FIgVCIIggBUL/////D4N+fHwhCAsgAykDQyACKQM4hSIFQv////8PgyIGIAMpAzsgC4UiC0IgiCINfiIPQv////8PgyAFQiCIIgUgC0L/////D4MiC358IAYgC34iBkIgiHwiC0IghiAGQv////8Pg4QgD0IgiCAFIA1+fCALQiCIfIUgAykDMyARhSIFQv////8PgyIGIAMpAysgEIUiC0IgiCINfiIPQv////8PgyAFQiCIIgUgC0L/////D4MiC358IAYgC34iBkIgiHwiC0IghiAGQv////8Pg4QgD0IgiCAFIA1+fCALQiCIfIUgAykDIyAOhSIFQv////8PgyIGIAMpAxsgEoUiC0IgiCINfiIPQv////8PgyAFQiCIIgUgC0L/////D4MiC358IAYgC34iBkIgiHwiC0IghiAGQv////8Pg4QgD0IgiCAFIA1+fCALQiCIfIUgAykDEyAMhSIFQv////8PgyIGIAMpAwsgCIUiC0IgiCINfiIPQv////8PgyAFQiCIIgUgC0L/////D4MiC358IAYgC34iBkIgiHwiC0IghiAGQv////8Pg4QgD0IgiCAFIA1+fCALQiCIfIUgBEKHla+vmLbem55/fnx8fHwiBEIliCAEhUL5893xmfKZqxZ+IgRCIIggBIUhBAwBCyAEpyEAAkBBACkDoI4BIgRQDQACQCAAQRBLDQAgAEGACCAEEAUhBAwCCwJAIABBgAFLDQAgAEGACCAEEAYhBAwCCyAAQYAIIAQQByEEDAELAkAgAEEQSw0AIAAgA0IAEAUhBAwBCwJAIABBgAFLDQAgACADQgAQBiEEDAELIAAgA0IAEAchBAtBACAEQjiGIARCgP4Dg0IohoQgBEKAgPwHg0IYhiAEQoCAgPgPg0IIhoSEIARCCIhCgICA+A+DIARCGIhCgID8B4OEIARCKIhCgP4DgyAEQjiIhISENwOACiABJAALBgBBgIoBCwIACwvMAQEAQYAIC8QBuP5sOSOkS758AYEs9yGtHN7UbemDkJfbckCkpLezZx/LeeZOzMDleIJa0H3M/3IhuAhGdPdDJI7gNZDmgTomTDwoUruRwwDLiNBlixtTLqNxZEiXog35TjgZ70ap3qzYqPp2P+OcND/53LvHxwtPHYpR4EvNtFkxyJ9+ydl4c2TqxayDNNPrw8WBoP/6E2PrFw3dUbfw2knTFlUmKdRonisWvlh9R6H8j/i40XrQMc5FyzqPlRYEKK/X+8q7S0B+QAIAAA==",hash:"5a2fbdbb"};function C(A,I,g,C){return new(g||(g=Promise))((function(Q,i){function B(A){try{E(C.next(A))}catch(A){i(A)}}function e(A){try{E(C.throw(A))}catch(A){i(A)}}function E(A){var I;A.done?Q(A.value):(I=A.value,I instanceof g?I:new g((function(A){A(I)}))).then(B,e)}E((C=C.apply(A,I||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class Q{constructor(){this.mutex=Promise.resolve()}lock(){let A=()=>{};return this.mutex=this.mutex.then((()=>new Promise(A))),new Promise((I=>{A=I}))}dispatch(A){return C(this,void 0,void 0,(function*(){const I=yield this.lock();try{return yield Promise.resolve(A())}finally{I()}}))}}const i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,B=null!==(I=i.Buffer)&&void 0!==I?I:null,e=i.TextEncoder?new i.TextEncoder:null;function E(A,I){return(15&A)+(A>>6|A>>3&8)<<4|(15&I)+(I>>6|I>>3&8)}const t="a".charCodeAt(0)-10,n="0".charCodeAt(0);function D(A,I,g){let C=0;for(let Q=0;Q>>4;A[C++]=g>9?g+t:g+n,g=15&I[Q],A[C++]=g>9?g+t:g+n}return String.fromCharCode.apply(null,A)}const o=null!==B?A=>{if("string"==typeof A){const I=B.from(A,"utf8");return new Uint8Array(I.buffer,I.byteOffset,I.length)}if(B.isBuffer(A))return new Uint8Array(A.buffer,A.byteOffset,A.length);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")}:A=>{if("string"==typeof A)return e.encode(A);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")},f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",w=new Uint8Array(256);for(let A=0;A>4,Q+=1,C[Q]=(15&i)<<4|B>>2,Q+=1,C[Q]=(3&B)<<6|63&e,Q+=1}return C}const h=16384,s=new Q,a=new Map;function c(A,I){return C(this,void 0,void 0,(function*(){let g=null,Q=null,i=!1;if("undefined"==typeof WebAssembly)throw new Error("WebAssembly is not supported in this environment!");const B=()=>new DataView(g.exports.memory.buffer).getUint32(g.exports.STATE_SIZE,!0),e=s.dispatch((()=>C(this,void 0,void 0,(function*(){if(!a.has(A.name)){const I=r(A.data),g=WebAssembly.compile(I);a.set(A.name,g)}const I=yield a.get(A.name);g=yield WebAssembly.instantiate(I,{})})))),t=(A=null)=>{i=!0,g.exports.Hash_Init(A)},n=A=>{if(!i)throw new Error("update() called before init()");(A=>{let I=0;for(;I{if(!i)throw new Error("digest() called before init()");return i=!1,g.exports.Hash_Final(C),"binary"===A?Q.slice(0,I):D(f,Q,I)},c=A=>"string"==typeof A?A.length<4096:A.byteLength!0;break;case"blake2b":case"blake2s":y=(A,I)=>I<=512&&c(A);break;case"blake3":y=(A,I)=>0===I&&c(A);break;case"xxhash64":case"xxhash3":case"xxhash128":case"crc64":y=()=>!1}return yield(()=>C(this,void 0,void 0,(function*(){g||(yield e);const A=g.exports.Hash_GetBuffer(),I=g.exports.memory.buffer;Q=new Uint8Array(I,A,h)})))(),{getMemory:()=>Q,writeMemory:(A,I=0)=>{Q.set(A,I)},getExports:()=>g.exports,setMemorySize:A=>{g.exports.Hash_SetMemorySize(A);const I=g.exports.Hash_GetBuffer(),C=g.exports.memory.buffer;Q=new Uint8Array(C,I,A)},init:t,update:n,digest:w,save:()=>{if(!i)throw new Error("save() can only be called after init() and before digest()");const I=g.exports.Hash_GetState(),C=B(),Q=g.exports.memory.buffer,e=new Uint8Array(Q,I,C),t=new Uint8Array(4+C);return function(A,I){const g=I.length>>1;for(let C=0;C{if(!(I instanceof Uint8Array))throw new Error("load() expects an Uint8Array generated by save()");const C=g.exports.Hash_GetState(),Q=B(),e=4+Q,t=g.exports.memory.buffer;if(I.length!==e)throw new Error(`Bad state length (expected ${e} bytes, got ${I.length})`);if(!function(A,I){if(A.length!==2*I.length)return!1;for(let g=0;g{if(!y(A,C))return t(C),n(A),w("hex",i);const B=o(A);return Q.set(B),g.exports.Hash_Calculate(B.length,C,i),D(f,Q,I)},hashLength:I}}))}const y=new Q;let k=null;const F=new Uint8Array(8);function M(A){return!Number.isInteger(A)||A<0||A>4294967295?new Error("Seed must be given as two valid 32-bit long unsigned integers (lo + high)."):null}function d(A,I,g){const C=new DataView(A);C.setUint32(0,I,!0),C.setUint32(4,g,!0)}A.createXXHash3=function(A=0,I=0){return M(A)?Promise.reject(M(A)):M(I)?Promise.reject(M(I)):c(g,8).then((g=>{const C=new Uint8Array(8);d(C.buffer,A,I),g.writeMemory(C),g.init();const Q={init:()=>(g.writeMemory(C),g.init(),Q),update:A=>(g.update(A),Q),digest:A=>g.digest(A),save:()=>g.save(),load:A=>(g.load(A),Q),blockSize:512,digestSize:8};return Q}))},A.xxhash3=function(A,I=0,Q=0){if(M(I))return Promise.reject(M(I));if(M(Q))return Promise.reject(M(Q));if(null===k)return function(A,I,g){return C(this,void 0,void 0,(function*(){const C=yield A.lock(),Q=yield c(I,g);return C(),Q}))}(y,g,8).then((g=>(k=g,d(F.buffer,I,Q),k.writeMemory(F),k.calculate(A))));try{d(F.buffer,I,Q),k.writeMemory(F);const g=k.calculate(A);return Promise.resolve(g)}catch(A){return Promise.reject(A)}}})); diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/xxhash32.umd.min.js b/tools/mnemonic-test/node_modules/hash-wasm/dist/xxhash32.umd.min.js deleted file mode 100644 index 957d4b94..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/xxhash32.umd.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * hash-wasm (https://www.npmjs.com/package/hash-wasm) - * (c) Dani Biro - * @license MIT - */ - -!function(A,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((A="undefined"!=typeof globalThis?globalThis:A||self).hashwasm=A.hashwasm||{})}(this,(function(A){"use strict";var e,t={name:"xxhash32",data:"AGFzbQEAAAABEQRgAAF/YAF/AGAAAGACf38AAwcGAAEBAgADBQQBAQICBg4CfwFBsIkFC38AQYAICwdwCAZtZW1vcnkCAA5IYXNoX0dldEJ1ZmZlcgAACUhhc2hfSW5pdAABC0hhc2hfVXBkYXRlAAIKSGFzaF9GaW5hbAADDUhhc2hfR2V0U3RhdGUABA5IYXNoX0NhbGN1bGF0ZQAFClNUQVRFX1NJWkUDAQ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BEHYgAXMiAkEYdCACQYD+A3FBCHRyIAFBCHZBgP4DcSABQRh2cnKtNwOACQsGAEGAiQEL0gQCAX4Ef0EAQgA3A6iJAUEAIAE2AoiJAUEAIAFBz4yijgZqNgKMiQFBACABQfeUr694ajYChIkBQQAgAUGoiI2hAmo2AoCJAUEAQQA2AqCJASAAEAJBACkDqIkBIgKnIQECQAJAIAJCEFQNAEEAKAKEiQFBB3dBACgCgIkBQQF3akEAKAKIiQFBDHdqQQAoAoyJAUESd2ohAAwBC0EAKAKIiQFBsc/ZsgFqIQALIAAgAWohAEGQiQEhA0GUiQEhAQJAQQAoAqCJASIEQZCJAWoiBUGUiQFJDQBBkIkBIQMCQCAEQXxqIgZBBHENAEEAKAKQiQFBvdzKlXxsIABqQRF3Qa/W074CbCEAQZiJASEBQZSJASEDIAZBBEkNAQsDQCABKAIAQb3cypV8bCADKAIAQb3cypV8bCAAakERd0Gv1tO+AmxqQRF3Qa/W074CbCEAIAFBBGohAyABQQhqIgEgBU0NAAsgAUF8aiEDCwJAIAMgBUYNACAEQY+JAWohBgJAAkAgBCADa0EBcQ0AIAMhAQwBCyADQQFqIQEgAy0AAEGxz9myAWwgAGpBC3dBsfPd8XlsIQALIAYgA0YNAANAIAFBAWotAABBsc/ZsgFsIAEtAABBsc/ZsgFsIABqQQt3QbHz3fF5bGpBC3dBsfPd8XlsIQAgAUECaiIBIAVHDQALC0EAIABBD3YgAHNB95Svr3hsIgFBDXYgAXNBvdzKlXxsIgFBEHYgAXMiAEEYdCAAQYD+A3FBCHRyIAFBCHZBgP4DcSABQRh2cnKtNwOACQsLCwEAQYAICwQwAAAA",hash:"4bb12485"};function n(A,e,t,n){return new(t||(t=Promise))((function(r,o){function i(A){try{s(n.next(A))}catch(A){o(A)}}function Q(A){try{s(n.throw(A))}catch(A){o(A)}}function s(A){var e;A.done?r(A.value):(e=A.value,e instanceof t?e:new t((function(A){A(e)}))).then(i,Q)}s((n=n.apply(A,e||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class r{constructor(){this.mutex=Promise.resolve()}lock(){let A=()=>{};return this.mutex=this.mutex.then((()=>new Promise(A))),new Promise((e=>{A=e}))}dispatch(A){return n(this,void 0,void 0,(function*(){const e=yield this.lock();try{return yield Promise.resolve(A())}finally{e()}}))}}const o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,i=null!==(e=o.Buffer)&&void 0!==e?e:null,Q=o.TextEncoder?new o.TextEncoder:null;function s(A,e){return(15&A)+(A>>6|A>>3&8)<<4|(15&e)+(e>>6|e>>3&8)}const B="a".charCodeAt(0)-10,a="0".charCodeAt(0);function E(A,e,t){let n=0;for(let r=0;r>>4;A[n++]=t>9?t+B:t+a,t=15&e[r],A[n++]=t>9?t+B:t+a}return String.fromCharCode.apply(null,A)}const C=null!==i?A=>{if("string"==typeof A){const e=i.from(A,"utf8");return new Uint8Array(e.buffer,e.byteOffset,e.length)}if(i.isBuffer(A))return new Uint8Array(A.buffer,A.byteOffset,A.length);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")}:A=>{if("string"==typeof A)return Q.encode(A);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")},g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",I=new Uint8Array(256);for(let A=0;A>4,r+=1,n[r]=(15&o)<<4|i>>2,r+=1,n[r]=(3&i)<<6|63&Q,r+=1}return n}const h=16384,f=new r,c=new Map;function d(A,e){return n(this,void 0,void 0,(function*(){let t=null,r=null,o=!1;if("undefined"==typeof WebAssembly)throw new Error("WebAssembly is not supported in this environment!");const i=()=>new DataView(t.exports.memory.buffer).getUint32(t.exports.STATE_SIZE,!0),Q=f.dispatch((()=>n(this,void 0,void 0,(function*(){if(!c.has(A.name)){const e=l(A.data),t=WebAssembly.compile(e);c.set(A.name,t)}const e=yield c.get(A.name);t=yield WebAssembly.instantiate(e,{})})))),B=(A=null)=>{o=!0,t.exports.Hash_Init(A)},a=A=>{if(!o)throw new Error("update() called before init()");(A=>{let e=0;for(;e{if(!o)throw new Error("digest() called before init()");return o=!1,t.exports.Hash_Final(n),"binary"===A?r.slice(0,e):E(g,r,e)},d=A=>"string"==typeof A?A.length<4096:A.byteLength!0;break;case"blake2b":case"blake2s":u=(A,e)=>e<=512&&d(A);break;case"blake3":u=(A,e)=>0===e&&d(A);break;case"xxhash64":case"xxhash3":case"xxhash128":case"crc64":u=()=>!1}return yield(()=>n(this,void 0,void 0,(function*(){t||(yield Q);const A=t.exports.Hash_GetBuffer(),e=t.exports.memory.buffer;r=new Uint8Array(e,A,h)})))(),{getMemory:()=>r,writeMemory:(A,e=0)=>{r.set(A,e)},getExports:()=>t.exports,setMemorySize:A=>{t.exports.Hash_SetMemorySize(A);const e=t.exports.Hash_GetBuffer(),n=t.exports.memory.buffer;r=new Uint8Array(n,e,A)},init:B,update:a,digest:I,save:()=>{if(!o)throw new Error("save() can only be called after init() and before digest()");const e=t.exports.Hash_GetState(),n=i(),r=t.exports.memory.buffer,Q=new Uint8Array(r,e,n),B=new Uint8Array(4+n);return function(A,e){const t=e.length>>1;for(let n=0;n{if(!(e instanceof Uint8Array))throw new Error("load() expects an Uint8Array generated by save()");const n=t.exports.Hash_GetState(),r=i(),Q=4+r,B=t.exports.memory.buffer;if(e.length!==Q)throw new Error(`Bad state length (expected ${Q} bytes, got ${e.length})`);if(!function(A,e){if(A.length!==2*e.length)return!1;for(let t=0;t{if(!u(A,n))return B(n),a(A),I("hex",o);const i=C(A);return r.set(i),t.exports.Hash_Calculate(i.length,n,o),E(g,r,e)},hashLength:e}}))}const u=new r;let y=null;function w(A){return!Number.isInteger(A)||A<0||A>4294967295?new Error("Seed must be a valid 32-bit long unsigned integer."):null}A.createXXHash32=function(A=0){return w(A)?Promise.reject(w(A)):d(t,4).then((e=>{e.init(A);const t={init:()=>(e.init(A),t),update:A=>(e.update(A),t),digest:A=>e.digest(A),save:()=>e.save(),load:A=>(e.load(A),t),blockSize:16,digestSize:4};return t}))},A.xxhash32=function(A,e=0){if(w(e))return Promise.reject(w(e));if(null===y)return function(A,e,t){return n(this,void 0,void 0,(function*(){const n=yield A.lock(),r=yield d(e,t);return n(),r}))}(u,t,4).then((t=>(y=t,y.calculate(A,e))));try{const t=y.calculate(A,e);return Promise.resolve(t)}catch(A){return Promise.reject(A)}}})); diff --git a/tools/mnemonic-test/node_modules/hash-wasm/dist/xxhash64.umd.min.js b/tools/mnemonic-test/node_modules/hash-wasm/dist/xxhash64.umd.min.js deleted file mode 100644 index e6450390..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/dist/xxhash64.umd.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * hash-wasm (https://www.npmjs.com/package/hash-wasm) - * (c) Dani Biro - * @license MIT - */ - -!function(A,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((A="undefined"!=typeof globalThis?globalThis:A||self).hashwasm=A.hashwasm||{})}(this,(function(A){"use strict";var e,t={name:"xxhash64",data:"AGFzbQEAAAABDANgAAF/YAAAYAF/AAMHBgABAgEAAQUEAQECAgYOAn8BQdCJBQt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQAAQtIYXNoX1VwZGF0ZQACCkhhc2hfRmluYWwAAw1IYXNoX0dldFN0YXRlAAQOSGFzaF9DYWxjdWxhdGUABQpTVEFURV9TSVpFAwEKmxEGBQBBgAkLYwEBfkEAQgA3A8iJAUEAQQApA4AJIgA3A5CJAUEAIABC+erQ0OfJoeThAHw3A5iJAUEAIABCz9bTvtLHq9lCfDcDiIkBQQAgAELW64Lu6v2J9eAAfDcDgIkBQQBBADYCwIkBC70IAwV/BH4CfwJAIABFDQBBAEEAKQPIiQEgAK18NwPIiQECQEEAKALAiQEiASAAakEfSw0AAkACQCAAQQ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AITQ0AIAUhCQwBCyAFNQIAQoeVr6+Ytt6bnn9+IACFQheJQs/W077Sx6vZQn5C+fPd8Zn2masWfCEACwJAIAkgCEYNACAHQZ+JAWohBQJAAkAgByAJa0EBcQ0AIAkhBgwBCyAJQQFqIQYgCTEAAELFz9my8eW66id+IACFQguJQoeVr6+Ytt6bnn9+IQALIAUgCUYNAANAIAZBAWoxAABCxc/ZsvHluuonfiAGMQAAQsXP2bLx5brqJ34gAIVCC4lCh5Wvr5i23puef36FQguJQoeVr6+Ytt6bnn9+IQAgBkECaiIGIAhHDQALC0EAIABCIYggAIVCz9bTvtLHq9lCfiIAQh2IIACFQvnz3fGZ9pmrFn4iAEIgiCAAhSIBQjiGIAFCgP4Dg0IohoQgAUKAgPwHg0IYhiABQoCAgPgPg0IIhoSEIABCCIhCgICA+A+DIABCGIhCgID8B4OEIABCKIhCgP4DgyAAQjiIhISENwOACQsGAEGAiQELAgALCwsBAEGACAsEUAAAAA==",hash:"177fbfa3"};function n(A,e,t,n){return new(t||(t=Promise))((function(r,i){function o(A){try{Q(n.next(A))}catch(A){i(A)}}function s(A){try{Q(n.throw(A))}catch(A){i(A)}}function Q(A){var e;A.done?r(A.value):(e=A.value,e instanceof t?e:new t((function(A){A(e)}))).then(o,s)}Q((n=n.apply(A,e||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class r{constructor(){this.mutex=Promise.resolve()}lock(){let A=()=>{};return this.mutex=this.mutex.then((()=>new Promise(A))),new Promise((e=>{A=e}))}dispatch(A){return n(this,void 0,void 0,(function*(){const e=yield this.lock();try{return yield Promise.resolve(A())}finally{e()}}))}}const i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,o=null!==(e=i.Buffer)&&void 0!==e?e:null,s=i.TextEncoder?new i.TextEncoder:null;function Q(A,e){return(15&A)+(A>>6|A>>3&8)<<4|(15&e)+(e>>6|e>>3&8)}const f="a".charCodeAt(0)-10,a="0".charCodeAt(0);function l(A,e,t){let n=0;for(let r=0;r>>4;A[n++]=t>9?t+f:t+a,t=15&e[r],A[n++]=t>9?t+f:t+a}return String.fromCharCode.apply(null,A)}const C=null!==o?A=>{if("string"==typeof A){const e=o.from(A,"utf8");return new Uint8Array(e.buffer,e.byteOffset,e.length)}if(o.isBuffer(A))return new Uint8Array(A.buffer,A.byteOffset,A.length);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")}:A=>{if("string"==typeof A)return s.encode(A);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")},h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",I=new Uint8Array(256);for(let A=0;A>4,r+=1,n[r]=(15&i)<<4|o>>2,r+=1,n[r]=(3&o)<<6|63&s,r+=1}return n}const B=16384,u=new r,c=new Map;function E(A,e){return n(this,void 0,void 0,(function*(){let t=null,r=null,i=!1;if("undefined"==typeof WebAssembly)throw new Error("WebAssembly is not supported in this environment!");const o=()=>new DataView(t.exports.memory.buffer).getUint32(t.exports.STATE_SIZE,!0),s=u.dispatch((()=>n(this,void 0,void 0,(function*(){if(!c.has(A.name)){const e=g(A.data),t=WebAssembly.compile(e);c.set(A.name,t)}const e=yield c.get(A.name);t=yield WebAssembly.instantiate(e,{})})))),f=(A=null)=>{i=!0,t.exports.Hash_Init(A)},a=A=>{if(!i)throw new Error("update() called before init()");(A=>{let e=0;for(;e{if(!i)throw new Error("digest() called before init()");return i=!1,t.exports.Hash_Final(n),"binary"===A?r.slice(0,e):l(h,r,e)},E=A=>"string"==typeof A?A.length<4096:A.byteLength!0;break;case"blake2b":case"blake2s":w=(A,e)=>e<=512&&E(A);break;case"blake3":w=(A,e)=>0===e&&E(A);break;case"xxhash64":case"xxhash3":case"xxhash128":case"crc64":w=()=>!1}return yield(()=>n(this,void 0,void 0,(function*(){t||(yield s);const A=t.exports.Hash_GetBuffer(),e=t.exports.memory.buffer;r=new Uint8Array(e,A,B)})))(),{getMemory:()=>r,writeMemory:(A,e=0)=>{r.set(A,e)},getExports:()=>t.exports,setMemorySize:A=>{t.exports.Hash_SetMemorySize(A);const e=t.exports.Hash_GetBuffer(),n=t.exports.memory.buffer;r=new Uint8Array(n,e,A)},init:f,update:a,digest:I,save:()=>{if(!i)throw new Error("save() can only be called after init() and before digest()");const e=t.exports.Hash_GetState(),n=o(),r=t.exports.memory.buffer,s=new Uint8Array(r,e,n),f=new Uint8Array(4+n);return function(A,e){const t=e.length>>1;for(let n=0;n{if(!(e instanceof Uint8Array))throw new Error("load() expects an Uint8Array generated by save()");const n=t.exports.Hash_GetState(),r=o(),s=4+r,f=t.exports.memory.buffer;if(e.length!==s)throw new Error(`Bad state length (expected ${s} bytes, got ${e.length})`);if(!function(A,e){if(A.length!==2*e.length)return!1;for(let t=0;t{if(!w(A,n))return f(n),a(A),I("hex",i);const o=C(A);return r.set(o),t.exports.Hash_Calculate(o.length,n,i),l(h,r,e)},hashLength:e}}))}const w=new r;let d=null;const y=new Uint8Array(8);function b(A){return!Number.isInteger(A)||A<0||A>4294967295?new Error("Seed must be given as two valid 32-bit long unsigned integers (lo + high)."):null}function m(A,e,t){const n=new DataView(A);n.setUint32(0,e,!0),n.setUint32(4,t,!0)}A.createXXHash64=function(A=0,e=0){return b(A)?Promise.reject(b(A)):b(e)?Promise.reject(b(e)):E(t,8).then((t=>{const n=new Uint8Array(8);m(n.buffer,A,e),t.writeMemory(n),t.init();const r={init:()=>(t.writeMemory(n),t.init(),r),update:A=>(t.update(A),r),digest:A=>t.digest(A),save:()=>t.save(),load:A=>(t.load(A),r),blockSize:32,digestSize:8};return r}))},A.xxhash64=function(A,e=0,r=0){if(b(e))return Promise.reject(b(e));if(b(r))return Promise.reject(b(r));if(null===d)return function(A,e,t){return n(this,void 0,void 0,(function*(){const n=yield A.lock(),r=yield E(e,t);return n(),r}))}(w,t,8).then((t=>(d=t,m(y.buffer,e,r),d.writeMemory(y),d.calculate(A))));try{m(y.buffer,e,r),d.writeMemory(y);const t=d.calculate(A);return Promise.resolve(t)}catch(A){return Promise.reject(A)}}})); diff --git a/tools/mnemonic-test/node_modules/hash-wasm/jest.config.js b/tools/mnemonic-test/node_modules/hash-wasm/jest.config.js deleted file mode 100644 index 6e937ca5..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/jest.config.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = { - roots: [ - '/test', - ], - transform: { - '^.+\\.ts$': 'ts-jest', - }, - cacheDirectory: '/.jest-cache', -}; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/lib/WASMInterface.ts b/tools/mnemonic-test/node_modules/hash-wasm/lib/WASMInterface.ts deleted file mode 100644 index 19829379..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/lib/WASMInterface.ts +++ /dev/null @@ -1,310 +0,0 @@ -import Mutex from "./mutex"; -import { - type IDataType, - type IEmbeddedWasm, - decodeBase64, - getDigestHex, - getUInt8Buffer, - hexStringEqualsUInt8, - writeHexToUInt8, -} from "./util"; - -export const MAX_HEAP = 16 * 1024; -const WASM_FUNC_HASH_LENGTH = 4; -const wasmMutex = new Mutex(); - -type ThenArg = T extends Promise - ? U - : // biome-ignore lint/suspicious/noExplicitAny: TS quirks - T extends (...args: any[]) => Promise - ? V - : T; - -export type IHasher = { - /** - * Initializes hash state to default value - */ - init: () => IHasher; - /** - * Updates the hash content with the given data - */ - update: (data: IDataType) => IHasher; - /** - * Calculates the hash of all of the data passed to be hashed with hash.update(). - * Defaults to hexadecimal string - * @param outputType If outputType is "binary", it returns Uint8Array. Otherwise it - * returns hexadecimal string - */ - digest: { - (outputType: "binary"): Uint8Array; - (outputType?: "hex"): string; - }; - /** - * Save the current internal state of the hasher for later resumption with load(). - * Cannot be called before .init() or after .digest() - * - * Note that this state can include arbitrary information about the value being hashed (e.g. - * could include N plaintext bytes from the value), so needs to be treated as being as - * sensitive as the input value itself. - */ - save: () => Uint8Array; - /** - * Resume a state that was created by save(). If this state was not created by a - * compatible build of hash-wasm, an exception will be thrown. - */ - load: (state: Uint8Array) => IHasher; - /** - * Block size in bytes - */ - blockSize: number; - /** - * Digest size in bytes - */ - digestSize: number; -}; - -const wasmModuleCache = new Map>(); - -export async function WASMInterface(binary: IEmbeddedWasm, hashLength: number) { - let wasmInstance = null; - let memoryView: Uint8Array = null; - let initialized = false; - - if (typeof WebAssembly === "undefined") { - throw new Error("WebAssembly is not supported in this environment!"); - } - - const writeMemory = (data: Uint8Array, offset = 0) => { - memoryView.set(data, offset); - }; - - const getMemory = () => memoryView; - const getExports = () => wasmInstance.exports; - - const setMemorySize = (totalSize: number) => { - wasmInstance.exports.Hash_SetMemorySize(totalSize); - const arrayOffset: number = wasmInstance.exports.Hash_GetBuffer(); - const memoryBuffer = wasmInstance.exports.memory.buffer; - memoryView = new Uint8Array(memoryBuffer, arrayOffset, totalSize); - }; - - const getStateSize = () => { - const view = new DataView(wasmInstance.exports.memory.buffer); - const stateSize = view.getUint32(wasmInstance.exports.STATE_SIZE, true); - return stateSize; - }; - - const loadWASMPromise = wasmMutex.dispatch(async () => { - if (!wasmModuleCache.has(binary.name)) { - const asm = decodeBase64(binary.data); - const promise = WebAssembly.compile(asm); - - wasmModuleCache.set(binary.name, promise); - } - - const module = await wasmModuleCache.get(binary.name); - wasmInstance = await WebAssembly.instantiate(module, { - // env: { - // emscripten_memcpy_big: (dest, src, num) => { - // const memoryBuffer = wasmInstance.exports.memory.buffer; - // const memView = new Uint8Array(memoryBuffer, 0); - // memView.set(memView.subarray(src, src + num), dest); - // }, - // print_memory: (offset, len) => { - // const memoryBuffer = wasmInstance.exports.memory.buffer; - // const memView = new Uint8Array(memoryBuffer, 0); - // console.log('print_int32', memView.subarray(offset, offset + len)); - // }, - // }, - }); - - // wasmInstance.exports._start(); - }); - - const setupInterface = async () => { - if (!wasmInstance) { - await loadWASMPromise; - } - - const arrayOffset: number = wasmInstance.exports.Hash_GetBuffer(); - const memoryBuffer = wasmInstance.exports.memory.buffer; - memoryView = new Uint8Array(memoryBuffer, arrayOffset, MAX_HEAP); - }; - - const init = (bits: number = null) => { - initialized = true; - wasmInstance.exports.Hash_Init(bits); - }; - - const updateUInt8Array = (data: Uint8Array): void => { - let read = 0; - while (read < data.length) { - const chunk = data.subarray(read, read + MAX_HEAP); - read += chunk.length; - memoryView.set(chunk); - wasmInstance.exports.Hash_Update(chunk.length); - } - }; - - const update = (data: IDataType) => { - if (!initialized) { - throw new Error("update() called before init()"); - } - const Uint8Buffer = getUInt8Buffer(data); - updateUInt8Array(Uint8Buffer); - }; - - const digestChars = new Uint8Array(hashLength * 2); - - const digest = ( - outputType: "hex" | "binary", - padding: number = null, - ): Uint8Array | string => { - if (!initialized) { - throw new Error("digest() called before init()"); - } - initialized = false; - - wasmInstance.exports.Hash_Final(padding); - - if (outputType === "binary") { - // the data is copied to allow GC of the original memory object - return memoryView.slice(0, hashLength); - } - - return getDigestHex(digestChars, memoryView, hashLength); - }; - - const save = (): Uint8Array => { - if (!initialized) { - throw new Error( - "save() can only be called after init() and before digest()", - ); - } - - const stateOffset: number = wasmInstance.exports.Hash_GetState(); - const stateLength: number = getStateSize(); - const memoryBuffer = wasmInstance.exports.memory.buffer; - const internalState = new Uint8Array( - memoryBuffer, - stateOffset, - stateLength, - ); - - // prefix is 4 bytes from SHA1 hash of the WASM binary - // it is used to detect incompatible internal states between different versions of hash-wasm - const prefixedState = new Uint8Array(WASM_FUNC_HASH_LENGTH + stateLength); - writeHexToUInt8(prefixedState, binary.hash); - prefixedState.set(internalState, WASM_FUNC_HASH_LENGTH); - return prefixedState; - }; - - const load = (state: Uint8Array) => { - if (!(state instanceof Uint8Array)) { - throw new Error("load() expects an Uint8Array generated by save()"); - } - - const stateOffset: number = wasmInstance.exports.Hash_GetState(); - const stateLength: number = getStateSize(); - const overallLength: number = WASM_FUNC_HASH_LENGTH + stateLength; - const memoryBuffer = wasmInstance.exports.memory.buffer; - - if (state.length !== overallLength) { - throw new Error( - `Bad state length (expected ${overallLength} bytes, got ${state.length})`, - ); - } - - if ( - !hexStringEqualsUInt8( - binary.hash, - state.subarray(0, WASM_FUNC_HASH_LENGTH), - ) - ) { - throw new Error( - "This state was written by an incompatible hash implementation", - ); - } - - const internalState = state.subarray(WASM_FUNC_HASH_LENGTH); - new Uint8Array(memoryBuffer, stateOffset, stateLength).set(internalState); - initialized = true; - }; - - const isDataShort = (data: IDataType) => { - if (typeof data === "string") { - // worst case is 4 bytes / char - return data.length < MAX_HEAP / 4; - } - - return data.byteLength < MAX_HEAP; - }; - - let canSimplify: (data: IDataType, initParam?: number) => boolean = - isDataShort; - - switch (binary.name) { - case "argon2": - case "scrypt": - canSimplify = () => true; - break; - - case "blake2b": - case "blake2s": - // if there is a key at blake2 then cannot simplify - canSimplify = (data, initParam) => initParam <= 512 && isDataShort(data); - break; - - case "blake3": - // if there is a key at blake3 then cannot simplify - canSimplify = (data, initParam) => initParam === 0 && isDataShort(data); - break; - - case "xxhash64": // cannot simplify - case "xxhash3": - case "xxhash128": - case "crc64": - canSimplify = () => false; - break; - - default: - break; - } - - // shorthand for (init + update + digest) for better performance - const calculate = ( - data: IDataType, - initParam = null, - digestParam = null, - ): string => { - if (!canSimplify(data, initParam)) { - init(initParam); - update(data); - return digest("hex", digestParam) as string; - } - - const buffer = getUInt8Buffer(data); - memoryView.set(buffer); - wasmInstance.exports.Hash_Calculate(buffer.length, initParam, digestParam); - - return getDigestHex(digestChars, memoryView, hashLength); - }; - - await setupInterface(); - - return { - getMemory, - writeMemory, - getExports, - setMemorySize, - init, - update, - digest, - save, - load, - calculate, - hashLength, - }; -} - -export type IWASMInterface = ThenArg>; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/lib/adler32.ts b/tools/mnemonic-test/node_modules/hash-wasm/lib/adler32.ts deleted file mode 100644 index ac2f8682..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/lib/adler32.ts +++ /dev/null @@ -1,64 +0,0 @@ -import wasmJson from "../wasm/adler32.wasm.json"; -import { - type IHasher, - type IWASMInterface, - WASMInterface, -} from "./WASMInterface"; -import lockedCreate from "./lockedCreate"; -import Mutex from "./mutex"; -import type { IDataType } from "./util"; - -const mutex = new Mutex(); -let wasmCache: IWASMInterface = null; - -/** - * Calculates Adler-32 hash. The resulting 32-bit hash is stored in - * network byte order (big-endian). - * - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ -export function adler32(data: IDataType): Promise { - if (wasmCache === null) { - return lockedCreate(mutex, wasmJson, 4).then((wasm) => { - wasmCache = wasm; - return wasmCache.calculate(data); - }); - } - - try { - const hash = wasmCache.calculate(data); - return Promise.resolve(hash); - } catch (err) { - return Promise.reject(err); - } -} - -/** - * Creates a new Adler-32 hash instance - */ -export function createAdler32(): Promise { - return WASMInterface(wasmJson, 4).then((wasm) => { - wasm.init(); - const obj: IHasher = { - init: () => { - wasm.init(); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType) as any, - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 4, - digestSize: 4, - }; - return obj; - }); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/lib/argon2.ts b/tools/mnemonic-test/node_modules/hash-wasm/lib/argon2.ts deleted file mode 100644 index 4357824e..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/lib/argon2.ts +++ /dev/null @@ -1,396 +0,0 @@ -import wasmJson from "../wasm/argon2.wasm.json"; -import { type IHasher, WASMInterface } from "./WASMInterface"; -import { createBLAKE2b } from "./blake2b"; -import { - type IDataType, - decodeBase64, - encodeBase64, - getDecodeBase64Length, - getDigestHex, - getUInt8Buffer, - writeHexToUInt8, -} from "./util"; - -export interface IArgon2Options { - /** - * Password (or message) to be hashed - */ - password: IDataType; - /** - * Salt (usually containing random bytes) - */ - salt: IDataType; - /** - * Secret for keyed hashing - */ - secret?: IDataType; - /** - * Number of iterations to perform - */ - iterations: number; - /** - * Degree of parallelism - */ - parallelism: number; - /** - * Amount of memory to be used in kibibytes (1024 bytes) - */ - memorySize: number; - /** - * Output size in bytes - */ - hashLength: number; - /** - * Desired output type. Defaults to 'hex' - */ - outputType?: "hex" | "binary" | "encoded"; -} - -interface IArgon2OptionsExtended extends IArgon2Options { - hashType: "i" | "d" | "id"; -} - -function encodeResult( - salt: Uint8Array, - options: IArgon2OptionsExtended, - res: Uint8Array, -): string { - const parameters = [ - `m=${options.memorySize}`, - `t=${options.iterations}`, - `p=${options.parallelism}`, - ].join(","); - - return `$argon2${options.hashType}$v=19$${parameters}$${encodeBase64( - salt, - false, - )}$${encodeBase64(res, false)}`; -} - -const uint32View = new DataView(new ArrayBuffer(4)); -function int32LE(x: number): Uint8Array { - uint32View.setInt32(0, x, true); - return new Uint8Array(uint32View.buffer); -} - -async function hashFunc( - blake512: IHasher, - buf: Uint8Array, - len: number, -): Promise { - if (len <= 64) { - const blake = await createBLAKE2b(len * 8); - blake.update(int32LE(len)); - blake.update(buf); - return blake.digest("binary"); - } - - const r = Math.ceil(len / 32) - 2; - const ret = new Uint8Array(len); - - blake512.init(); - blake512.update(int32LE(len)); - blake512.update(buf); - let vp = blake512.digest("binary"); - ret.set(vp.subarray(0, 32), 0); - - for (let i = 1; i < r; i++) { - blake512.init(); - blake512.update(vp); - vp = blake512.digest("binary"); - ret.set(vp.subarray(0, 32), i * 32); - } - - const partialBytesNeeded = len - 32 * r; - - let blakeSmall: IHasher; - if (partialBytesNeeded === 64) { - blakeSmall = blake512; - blakeSmall.init(); - } else { - blakeSmall = await createBLAKE2b(partialBytesNeeded * 8); - } - - blakeSmall.update(vp); - vp = blakeSmall.digest("binary"); - ret.set(vp.subarray(0, partialBytesNeeded), r * 32); - - return ret; -} - -function getHashType(type: IArgon2OptionsExtended["hashType"]): number { - switch (type) { - case "d": - return 0; - case "i": - return 1; - default: - return 2; - } -} - -async function argon2Internal( - options: IArgon2OptionsExtended, -): Promise { - const { parallelism, iterations, hashLength } = options; - const password = getUInt8Buffer(options.password); - const salt = getUInt8Buffer(options.salt); - const version = 0x13; - const hashType = getHashType(options.hashType); - const { memorySize } = options; // in KB - const secret = getUInt8Buffer(options.secret ?? ""); - - const [argon2Interface, blake512] = await Promise.all([ - WASMInterface(wasmJson, 1024), - createBLAKE2b(512), - ]); - - // last block is for storing the init vector - argon2Interface.setMemorySize(memorySize * 1024 + 1024); - - const initVector = new Uint8Array(24); - const initVectorView = new DataView(initVector.buffer); - initVectorView.setInt32(0, parallelism, true); - initVectorView.setInt32(4, hashLength, true); - initVectorView.setInt32(8, memorySize, true); - initVectorView.setInt32(12, iterations, true); - initVectorView.setInt32(16, version, true); - initVectorView.setInt32(20, hashType, true); - argon2Interface.writeMemory(initVector, memorySize * 1024); - - blake512.init(); - blake512.update(initVector); - blake512.update(int32LE(password.length)); - blake512.update(password); - blake512.update(int32LE(salt.length)); - blake512.update(salt); - blake512.update(int32LE(secret.length)); - blake512.update(secret); - blake512.update(int32LE(0)); // associatedData length + associatedData - - const segments = Math.floor(memorySize / (parallelism * 4)); // length of each lane - const lanes = segments * 4; - - const param = new Uint8Array(72); - const H0 = blake512.digest("binary"); - param.set(H0); - - for (let lane = 0; lane < parallelism; lane++) { - param.set(int32LE(0), 64); - param.set(int32LE(lane), 68); - - let position = lane * lanes; - let chunk = await hashFunc(blake512, param, 1024); - argon2Interface.writeMemory(chunk, position * 1024); - - position += 1; - param.set(int32LE(1), 64); - chunk = await hashFunc(blake512, param, 1024); - argon2Interface.writeMemory(chunk, position * 1024); - } - - const C = new Uint8Array(1024); - writeHexToUInt8(C, argon2Interface.calculate(new Uint8Array([]), memorySize)); - - const res = await hashFunc(blake512, C, hashLength); - - if (options.outputType === "hex") { - const digestChars = new Uint8Array(hashLength * 2); - return getDigestHex(digestChars, res, hashLength); - } - - if (options.outputType === "encoded") { - return encodeResult(salt, options, res); - } - - // return binary format - return res; -} - -const validateOptions = (options: IArgon2Options) => { - if (!options || typeof options !== "object") { - throw new Error("Invalid options parameter. It requires an object."); - } - - if (!options.password) { - throw new Error("Password must be specified"); - } - - options.password = getUInt8Buffer(options.password); - if (options.password.length < 1) { - throw new Error("Password must be specified"); - } - - if (!options.salt) { - throw new Error("Salt must be specified"); - } - - options.salt = getUInt8Buffer(options.salt); - if (options.salt.length < 8) { - throw new Error("Salt should be at least 8 bytes long"); - } - - options.secret = getUInt8Buffer(options.secret ?? ""); - - if (!Number.isInteger(options.iterations) || options.iterations < 1) { - throw new Error("Iterations should be a positive number"); - } - - if (!Number.isInteger(options.parallelism) || options.parallelism < 1) { - throw new Error("Parallelism should be a positive number"); - } - - if (!Number.isInteger(options.hashLength) || options.hashLength < 4) { - throw new Error("Hash length should be at least 4 bytes."); - } - - if (!Number.isInteger(options.memorySize)) { - throw new Error("Memory size should be specified."); - } - - if (options.memorySize < 8 * options.parallelism) { - throw new Error("Memory size should be at least 8 * parallelism."); - } - - if (options.outputType === undefined) { - options.outputType = "hex"; - } - - if (!["hex", "binary", "encoded"].includes(options.outputType)) { - throw new Error( - `Insupported output type ${options.outputType}. Valid values: ['hex', 'binary', 'encoded']`, - ); - } -}; - -interface IArgon2OptionsBinary { - outputType: "binary"; -} - -type Argon2ReturnType = T extends IArgon2OptionsBinary ? Uint8Array : string; - -/** - * Calculates hash using the argon2i password-hashing function - * @returns Computed hash - */ -export async function argon2i( - options: T, -): Promise> { - validateOptions(options); - - return argon2Internal({ - ...options, - hashType: "i", - }) as Promise>; -} - -/** - * Calculates hash using the argon2id password-hashing function - * @returns Computed hash - */ -export async function argon2id( - options: T, -): Promise> { - validateOptions(options); - - return argon2Internal({ - ...options, - hashType: "id", - }) as Promise>; -} - -/** - * Calculates hash using the argon2d password-hashing function - * @returns Computed hash - */ -export async function argon2d( - options: T, -): Promise> { - validateOptions(options); - - return argon2Internal({ - ...options, - hashType: "d", - }) as Promise>; -} - -export interface Argon2VerifyOptions { - /** - * Password to be verified - */ - password: IDataType; - /** - * Secret used on hash creation - */ - secret?: IDataType; - /** - * A previously generated argon2 hash in the 'encoded' output format - */ - hash: string; -} - -const getHashParameters = ( - password: IDataType, - encoded: string, - secret?: IDataType, -): IArgon2OptionsExtended => { - const regex = - /^\$argon2(id|i|d)\$v=([0-9]+)\$((?:[mtp]=[0-9]+,){2}[mtp]=[0-9]+)\$([A-Za-z0-9+/]+)\$([A-Za-z0-9+/]+)$/; - const match = encoded.match(regex); - if (!match) { - throw new Error("Invalid hash"); - } - - const [, hashType, version, parameters, salt, hash] = match; - if (version !== "19") { - throw new Error(`Unsupported version: ${version}`); - } - - const parsedParameters: Partial = {}; - const paramMap = { m: "memorySize", p: "parallelism", t: "iterations" }; - for (const x of parameters.split(",")) { - const [n, v] = x.split("="); - parsedParameters[paramMap[n]] = Number(v); - } - - return { - ...parsedParameters, - password, - secret, - hashType: hashType as IArgon2OptionsExtended["hashType"], - salt: decodeBase64(salt), - hashLength: getDecodeBase64Length(hash), - outputType: "encoded", - } as IArgon2OptionsExtended; -}; - -const validateVerifyOptions = (options: Argon2VerifyOptions) => { - if (!options || typeof options !== "object") { - throw new Error("Invalid options parameter. It requires an object."); - } - - if (options.hash === undefined || typeof options.hash !== "string") { - throw new Error("Hash should be specified"); - } -}; - -/** - * Verifies password using the argon2 password-hashing function - * @returns True if the encoded hash matches the password - */ -export async function argon2Verify( - options: Argon2VerifyOptions, -): Promise { - validateVerifyOptions(options); - - const params = getHashParameters( - options.password, - options.hash, - options.secret, - ); - validateOptions(params); - - const hashStart = options.hash.lastIndexOf("$") + 1; - const result = (await argon2Internal(params)) as string; - return result.substring(hashStart) === options.hash.substring(hashStart); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/lib/bcrypt.ts b/tools/mnemonic-test/node_modules/hash-wasm/lib/bcrypt.ts deleted file mode 100644 index c8d4b93a..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/lib/bcrypt.ts +++ /dev/null @@ -1,186 +0,0 @@ -import wasmJson from "../wasm/bcrypt.wasm.json"; -import { WASMInterface } from "./WASMInterface"; -import { - type IDataType, - getDigestHex, - getUInt8Buffer, - intArrayToString, -} from "./util"; - -export interface BcryptOptions { - /** - * Password to be hashed - */ - password: IDataType; - /** - * Salt (16 bytes long - usually containing random bytes) - */ - salt: IDataType; - /** - * Number of iterations to perform (4 - 31) - */ - costFactor: number; - /** - * Desired output type. Defaults to 'encoded' - */ - outputType?: "hex" | "binary" | "encoded"; -} - -async function bcryptInternal( - options: BcryptOptions, -): Promise { - const { costFactor, password, salt } = options; - - const bcryptInterface = await WASMInterface(wasmJson, 0); - bcryptInterface.writeMemory(getUInt8Buffer(salt), 0); - const passwordBuffer = getUInt8Buffer(password); - bcryptInterface.writeMemory(passwordBuffer, 16); - const shouldEncode = options.outputType === "encoded" ? 1 : 0; - bcryptInterface - .getExports() - .bcrypt(passwordBuffer.length, costFactor, shouldEncode); - const memory = bcryptInterface.getMemory(); - - if (options.outputType === "encoded") { - return intArrayToString(memory, 60); - } - - if (options.outputType === "hex") { - const digestChars = new Uint8Array(24 * 2); - return getDigestHex(digestChars, memory, 24); - } - - // return binary format - // the data is copied to allow GC of the original memory buffer - return memory.slice(0, 24); -} - -const validateOptions = (options: BcryptOptions) => { - if (!options || typeof options !== "object") { - throw new Error("Invalid options parameter. It requires an object."); - } - - if ( - !Number.isInteger(options.costFactor) || - options.costFactor < 4 || - options.costFactor > 31 - ) { - throw new Error("Cost factor should be a number between 4 and 31"); - } - - options.password = getUInt8Buffer(options.password); - if (options.password.length < 1) { - throw new Error("Password should be at least 1 byte long"); - } - - if (options.password.length > 72) { - throw new Error("Password should be at most 72 bytes long"); - } - - options.salt = getUInt8Buffer(options.salt); - if (options.salt.length !== 16) { - throw new Error("Salt should be 16 bytes long"); - } - - if (options.outputType === undefined) { - options.outputType = "encoded"; - } - - if (!["hex", "binary", "encoded"].includes(options.outputType)) { - throw new Error( - `Insupported output type ${options.outputType}. Valid values: ['hex', 'binary', 'encoded']`, - ); - } -}; - -interface IBcryptOptionsBinary { - outputType: "binary"; -} - -type BcryptReturnType = T extends IBcryptOptionsBinary ? Uint8Array : string; - -/** - * Calculates hash using the bcrypt password-hashing function - * @returns Computed hash - */ -export async function bcrypt( - options: T, -): Promise> { - validateOptions(options); - - return bcryptInternal(options) as Promise>; -} - -export interface BcryptVerifyOptions { - /** - * Password to be verified - */ - password: IDataType; - /** - * A previously generated bcrypt hash in the 'encoded' output format - */ - hash: string; -} - -const validateHashCharacters = (hash: string): boolean => { - if (!/^\$2[axyb]\$[0-3][0-9]\$[./A-Za-z0-9]{53}$/.test(hash)) { - return false; - } - - if (hash[4] === "0" && Number(hash[5]) < 4) { - return false; - } - - if (hash[4] === "3" && Number(hash[5]) > 1) { - return false; - } - - return true; -}; - -const validateVerifyOptions = (options: BcryptVerifyOptions) => { - if (!options || typeof options !== "object") { - throw new Error("Invalid options parameter. It requires an object."); - } - - if (options.hash === undefined || typeof options.hash !== "string") { - throw new Error("Hash should be specified"); - } - - if (options.hash.length !== 60) { - throw new Error("Hash should be 60 bytes long"); - } - - if (!validateHashCharacters(options.hash)) { - throw new Error("Invalid hash"); - } - - options.password = getUInt8Buffer(options.password); - if (options.password.length < 1) { - throw new Error("Password should be at least 1 byte long"); - } - - if (options.password.length > 72) { - throw new Error("Password should be at most 72 bytes long"); - } -}; - -/** - * Verifies password using bcrypt password-hashing function - * @returns True if the encoded hash matches the password - */ -export async function bcryptVerify( - options: BcryptVerifyOptions, -): Promise { - validateVerifyOptions(options); - - const { hash, password } = options; - - const bcryptInterface = await WASMInterface(wasmJson, 0); - bcryptInterface.writeMemory(getUInt8Buffer(hash), 0); - - const passwordBuffer = getUInt8Buffer(password); - bcryptInterface.writeMemory(passwordBuffer, 60); - - return !!bcryptInterface.getExports().bcrypt_verify(passwordBuffer.length); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/lib/blake2b.ts b/tools/mnemonic-test/node_modules/hash-wasm/lib/blake2b.ts deleted file mode 100644 index 39ea6454..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/lib/blake2b.ts +++ /dev/null @@ -1,135 +0,0 @@ -import wasmJson from "../wasm/blake2b.wasm.json"; -import { - type IHasher, - type IWASMInterface, - WASMInterface, -} from "./WASMInterface"; -import lockedCreate from "./lockedCreate"; -import Mutex from "./mutex"; -import { type IDataType, getUInt8Buffer } from "./util"; - -const mutex = new Mutex(); -let wasmCache: IWASMInterface = null; - -function validateBits(bits: number) { - if (!Number.isInteger(bits) || bits < 8 || bits > 512 || bits % 8 !== 0) { - return new Error("Invalid variant! Valid values: 8, 16, ..., 512"); - } - return null; -} - -function getInitParam(outputBits, keyBits) { - return outputBits | (keyBits << 16); -} - -/** - * Calculates BLAKE2b hash - * @param data Input data (string, Buffer or TypedArray) - * @param bits Number of output bits, which has to be a number - * divisible by 8, between 8 and 512. Defaults to 512. - * @param key Optional key (string, Buffer or TypedArray). Maximum length is 64 bytes. - * @returns Computed hash as a hexadecimal string - */ -export function blake2b( - data: IDataType, - bits = 512, - key: IDataType = null, -): Promise { - if (validateBits(bits)) { - return Promise.reject(validateBits(bits)); - } - - let keyBuffer = null; - let initParam = bits; - if (key !== null) { - keyBuffer = getUInt8Buffer(key); - if (keyBuffer.length > 64) { - return Promise.reject(new Error("Max key length is 64 bytes")); - } - initParam = getInitParam(bits, keyBuffer.length); - } - - const hashLength = bits / 8; - - if (wasmCache === null || wasmCache.hashLength !== hashLength) { - return lockedCreate(mutex, wasmJson, hashLength).then((wasm) => { - wasmCache = wasm; - if (initParam > 512) { - wasmCache.writeMemory(keyBuffer); - } - return wasmCache.calculate(data, initParam); - }); - } - - try { - if (initParam > 512) { - wasmCache.writeMemory(keyBuffer); - } - const hash = wasmCache.calculate(data, initParam); - return Promise.resolve(hash); - } catch (err) { - return Promise.reject(err); - } -} - -/** - * Creates a new BLAKE2b hash instance - * @param bits Number of output bits, which has to be a number - * divisible by 8, between 8 and 512. Defaults to 512. - * @param key Optional key (string, Buffer or TypedArray). Maximum length is 64 bytes. - */ -export function createBLAKE2b( - bits = 512, - key: IDataType = null, -): Promise { - if (validateBits(bits)) { - return Promise.reject(validateBits(bits)); - } - - let keyBuffer = null; - let initParam = bits; - if (key !== null) { - keyBuffer = getUInt8Buffer(key); - if (keyBuffer.length > 64) { - return Promise.reject(new Error("Max key length is 64 bytes")); - } - initParam = getInitParam(bits, keyBuffer.length); - } - - const outputSize = bits / 8; - - return WASMInterface(wasmJson, outputSize).then((wasm) => { - if (initParam > 512) { - wasm.writeMemory(keyBuffer); - } - wasm.init(initParam); - - const obj: IHasher = { - init: - initParam > 512 - ? () => { - wasm.writeMemory(keyBuffer); - wasm.init(initParam); - return obj; - } - : () => { - wasm.init(initParam); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType) as any, - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 128, - digestSize: outputSize, - }; - return obj; - }); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/lib/blake2s.ts b/tools/mnemonic-test/node_modules/hash-wasm/lib/blake2s.ts deleted file mode 100644 index ec10e43b..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/lib/blake2s.ts +++ /dev/null @@ -1,135 +0,0 @@ -import wasmJson from "../wasm/blake2s.wasm.json"; -import { - type IHasher, - type IWASMInterface, - WASMInterface, -} from "./WASMInterface"; -import lockedCreate from "./lockedCreate"; -import Mutex from "./mutex"; -import { type IDataType, getUInt8Buffer } from "./util"; - -const mutex = new Mutex(); -let wasmCache: IWASMInterface = null; - -function validateBits(bits: number) { - if (!Number.isInteger(bits) || bits < 8 || bits > 256 || bits % 8 !== 0) { - return new Error("Invalid variant! Valid values: 8, 16, ..., 256"); - } - return null; -} - -function getInitParam(outputBits, keyBits) { - return outputBits | (keyBits << 16); -} - -/** - * Calculates BLAKE2s hash - * @param data Input data (string, Buffer or TypedArray) - * @param bits Number of output bits, which has to be a number - * divisible by 8, between 8 and 256. Defaults to 256. - * @param key Optional key (string, Buffer or TypedArray). Maximum length is 32 bytes. - * @returns Computed hash as a hexadecimal string - */ -export function blake2s( - data: IDataType, - bits = 256, - key: IDataType = null, -): Promise { - if (validateBits(bits)) { - return Promise.reject(validateBits(bits)); - } - - let keyBuffer = null; - let initParam = bits; - if (key !== null) { - keyBuffer = getUInt8Buffer(key); - if (keyBuffer.length > 32) { - return Promise.reject(new Error("Max key length is 32 bytes")); - } - initParam = getInitParam(bits, keyBuffer.length); - } - - const hashLength = bits / 8; - - if (wasmCache === null || wasmCache.hashLength !== hashLength) { - return lockedCreate(mutex, wasmJson, hashLength).then((wasm) => { - wasmCache = wasm; - if (initParam > 512) { - wasmCache.writeMemory(keyBuffer); - } - return wasmCache.calculate(data, initParam); - }); - } - - try { - if (initParam > 512) { - wasmCache.writeMemory(keyBuffer); - } - const hash = wasmCache.calculate(data, initParam); - return Promise.resolve(hash); - } catch (err) { - return Promise.reject(err); - } -} - -/** - * Creates a new BLAKE2s hash instance - * @param bits Number of output bits, which has to be a number - * divisible by 8, between 8 and 256. Defaults to 256. - * @param key Optional key (string, Buffer or TypedArray). Maximum length is 32 bytes. - */ -export function createBLAKE2s( - bits = 256, - key: IDataType = null, -): Promise { - if (validateBits(bits)) { - return Promise.reject(validateBits(bits)); - } - - let keyBuffer = null; - let initParam = bits; - if (key !== null) { - keyBuffer = getUInt8Buffer(key); - if (keyBuffer.length > 32) { - return Promise.reject(new Error("Max key length is 32 bytes")); - } - initParam = getInitParam(bits, keyBuffer.length); - } - - const outputSize = bits / 8; - - return WASMInterface(wasmJson, outputSize).then((wasm) => { - if (initParam > 512) { - wasm.writeMemory(keyBuffer); - } - wasm.init(initParam); - - const obj: IHasher = { - init: - initParam > 512 - ? () => { - wasm.writeMemory(keyBuffer); - wasm.init(initParam); - return obj; - } - : () => { - wasm.init(initParam); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType) as any, - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 64, - digestSize: outputSize, - }; - return obj; - }); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/lib/blake3.ts b/tools/mnemonic-test/node_modules/hash-wasm/lib/blake3.ts deleted file mode 100644 index a8c2e9c0..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/lib/blake3.ts +++ /dev/null @@ -1,133 +0,0 @@ -import wasmJson from "../wasm/blake3.wasm.json"; -import { - type IHasher, - type IWASMInterface, - WASMInterface, -} from "./WASMInterface"; -import lockedCreate from "./lockedCreate"; -import Mutex from "./mutex"; -import { type IDataType, getUInt8Buffer } from "./util"; - -const mutex = new Mutex(); -let wasmCache: IWASMInterface = null; - -function validateBits(bits: number) { - if (!Number.isInteger(bits) || bits < 8 || bits % 8 !== 0) { - return new Error("Invalid variant! Valid values: 8, 16, ..."); - } - return null; -} - -/** - * Calculates BLAKE3 hash - * @param data Input data (string, Buffer or TypedArray) - * @param bits Number of output bits, which has to be a number - * divisible by 8. Defaults to 256. - * @param key Optional key (string, Buffer or TypedArray). Length should be 32 bytes. - * @returns Computed hash as a hexadecimal string - */ -export function blake3( - data: IDataType, - bits = 256, - key: IDataType = null, -): Promise { - if (validateBits(bits)) { - return Promise.reject(validateBits(bits)); - } - - let keyBuffer = null; - let initParam = 0; // key is empty by default - if (key !== null) { - keyBuffer = getUInt8Buffer(key); - if (keyBuffer.length !== 32) { - return Promise.reject(new Error("Key length must be exactly 32 bytes")); - } - initParam = 32; - } - - const hashLength = bits / 8; - const digestParam = hashLength; - - if (wasmCache === null || wasmCache.hashLength !== hashLength) { - return lockedCreate(mutex, wasmJson, hashLength).then((wasm) => { - wasmCache = wasm; - if (initParam === 32) { - wasmCache.writeMemory(keyBuffer); - } - return wasmCache.calculate(data, initParam, digestParam); - }); - } - - try { - if (initParam === 32) { - wasmCache.writeMemory(keyBuffer); - } - const hash = wasmCache.calculate(data, initParam, digestParam); - return Promise.resolve(hash); - } catch (err) { - return Promise.reject(err); - } -} - -/** - * Creates a new BLAKE3 hash instance - * @param bits Number of output bits, which has to be a number - * divisible by 8. Defaults to 256. - * @param key Optional key (string, Buffer or TypedArray). Length should be 32 bytes. - */ -export function createBLAKE3( - bits = 256, - key: IDataType = null, -): Promise { - if (validateBits(bits)) { - return Promise.reject(validateBits(bits)); - } - - let keyBuffer = null; - let initParam = 0; // key is empty by default - if (key !== null) { - keyBuffer = getUInt8Buffer(key); - if (keyBuffer.length !== 32) { - return Promise.reject(new Error("Key length must be exactly 32 bytes")); - } - initParam = 32; - } - - const outputSize = bits / 8; - const digestParam = outputSize; - - return WASMInterface(wasmJson, outputSize).then((wasm) => { - if (initParam === 32) { - wasm.writeMemory(keyBuffer); - } - wasm.init(initParam); - - const obj: IHasher = { - init: - initParam === 32 - ? () => { - wasm.writeMemory(keyBuffer); - wasm.init(initParam); - return obj; - } - : () => { - wasm.init(initParam); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType, digestParam) as any, - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 64, - digestSize: outputSize, - }; - return obj; - }); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/lib/crc32.ts b/tools/mnemonic-test/node_modules/hash-wasm/lib/crc32.ts deleted file mode 100644 index 1f294d2f..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/lib/crc32.ts +++ /dev/null @@ -1,82 +0,0 @@ -import wasmJson from "../wasm/crc32.wasm.json"; -import { - type IHasher, - type IWASMInterface, - WASMInterface, -} from "./WASMInterface"; -import lockedCreate from "./lockedCreate"; -import Mutex from "./mutex"; -import type { IDataType } from "./util"; - -const mutex = new Mutex(); -let wasmCache: IWASMInterface = null; - -function validatePoly(poly: number) { - if (!Number.isInteger(poly) || poly < 0 || poly > 0xffffffff) { - return new Error("Polynomial must be a valid 32-bit long unsigned integer"); - } - return null; -} - -/** - * Calculates CRC-32 hash - * @param data Input data (string, Buffer or TypedArray) - * @param polynomial Input polynomial (defaults to 0xedb88320, for CRC32C use 0x82f63b78) - * @returns Computed hash as a hexadecimal string - */ -export function crc32( - data: IDataType, - polynomial = 0xedb88320, -): Promise { - if (validatePoly(polynomial)) { - return Promise.reject(validatePoly(polynomial)); - } - - if (wasmCache === null) { - return lockedCreate(mutex, wasmJson, 4).then((wasm) => { - wasmCache = wasm; - return wasmCache.calculate(data, polynomial); - }); - } - - try { - const hash = wasmCache.calculate(data, polynomial); - return Promise.resolve(hash); - } catch (err) { - return Promise.reject(err); - } -} - -/** - * Creates a new CRC-32 hash instance - * @param polynomial Input polynomial (defaults to 0xedb88320, for CRC32C use 0x82f63b78) - */ -export function createCRC32(polynomial = 0xedb88320): Promise { - if (validatePoly(polynomial)) { - return Promise.reject(validatePoly(polynomial)); - } - - return WASMInterface(wasmJson, 4).then((wasm) => { - wasm.init(polynomial); - const obj: IHasher = { - init: () => { - wasm.init(polynomial); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType) as any, - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 4, - digestSize: 4, - }; - return obj; - }); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/lib/crc64.ts b/tools/mnemonic-test/node_modules/hash-wasm/lib/crc64.ts deleted file mode 100644 index fce594cb..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/lib/crc64.ts +++ /dev/null @@ -1,110 +0,0 @@ -import wasmJson from "../wasm/crc64.wasm.json"; -import { - type IHasher, - type IWASMInterface, - WASMInterface, -} from "./WASMInterface"; -import lockedCreate from "./lockedCreate"; -import Mutex from "./mutex"; -import type { IDataType } from "./util"; - -const mutex = new Mutex(); -let wasmCache: IWASMInterface = null; -const polyBuffer = new Uint8Array(8); - -function parsePoly(poly: string) { - const errText = "Polynomial must be provided as a 16 char long hex string"; - - if (typeof poly !== "string" || poly.length !== 16) { - return { hi: 0, lo: 0, err: new Error(errText) }; - } - - const hi = Number(`0x${poly.slice(0, 8)}`); - const lo = Number(`0x${poly.slice(8)}`); - - if (Number.isNaN(hi) || Number.isNaN(lo)) { - return { hi, lo, err: new Error(errText) }; - } - - return { hi, lo, err: null }; -} - -function writePoly(arr: ArrayBuffer, lo: number, hi: number) { - // write in little-endian format - const buffer = new DataView(arr); - buffer.setUint32(0, lo, true); - buffer.setUint32(4, hi, true); -} - -/** - * Calculates CRC-64 hash - * @param data Input data (string, Buffer or TypedArray) - * @param polynomial Input polynomial (defaults to 'c96c5795d7870f42' - ECMA) - * @returns Computed hash as a hexadecimal string - */ -export function crc64( - data: IDataType, - polynomial = "c96c5795d7870f42", -): Promise { - const { hi, lo, err } = parsePoly(polynomial); - if (err !== null) { - return Promise.reject(err); - } - - if (wasmCache === null) { - return lockedCreate(mutex, wasmJson, 8).then((wasm) => { - wasmCache = wasm; - writePoly(polyBuffer.buffer, lo, hi); - wasmCache.writeMemory(polyBuffer); - return wasmCache.calculate(data); - }); - } - - try { - writePoly(polyBuffer.buffer, lo, hi); - wasmCache.writeMemory(polyBuffer); - const hash = wasmCache.calculate(data); - return Promise.resolve(hash); - } catch (err) { - return Promise.reject(err); - } -} - -/** - * Creates a new CRC-64 hash instance - * @param polynomial Input polynomial (defaults to 'c96c5795d7870f42' - ECMA) - */ -export function createCRC64(polynomial = "c96c5795d7870f42"): Promise { - const { hi, lo, err } = parsePoly(polynomial); - if (err !== null) { - return Promise.reject(err); - } - - return WASMInterface(wasmJson, 8).then((wasm) => { - const instanceBuffer = new Uint8Array(8); - writePoly(instanceBuffer.buffer, lo, hi); - wasm.writeMemory(instanceBuffer); - wasm.init(); - const obj: IHasher = { - init: () => { - wasm.writeMemory(instanceBuffer); - wasm.init(); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType) as any, - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 8, - digestSize: 8, - }; - return obj; - }); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/lib/hmac.ts b/tools/mnemonic-test/node_modules/hash-wasm/lib/hmac.ts deleted file mode 100644 index 30d315cd..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/lib/hmac.ts +++ /dev/null @@ -1,86 +0,0 @@ -import type { IHasher } from "./WASMInterface"; -import { type IDataType, getUInt8Buffer } from "./util"; - -function calculateKeyBuffer(hasher: IHasher, key: IDataType): Uint8Array { - const { blockSize } = hasher; - - const buf = getUInt8Buffer(key); - - if (buf.length > blockSize) { - hasher.update(buf); - const uintArr = hasher.digest("binary"); - hasher.init(); - return uintArr; - } - - return new Uint8Array(buf.buffer, buf.byteOffset, buf.length); -} - -function calculateHmac(hasher: IHasher, key: IDataType): IHasher { - hasher.init(); - - const { blockSize } = hasher; - const keyBuf = calculateKeyBuffer(hasher, key); - const keyBuffer = new Uint8Array(blockSize); - keyBuffer.set(keyBuf); - - const opad = new Uint8Array(blockSize); - - for (let i = 0; i < blockSize; i++) { - const v = keyBuffer[i]; - opad[i] = v ^ 0x5c; - keyBuffer[i] = v ^ 0x36; - } - - hasher.update(keyBuffer); - - const obj: IHasher = { - init: () => { - hasher.init(); - hasher.update(keyBuffer); - return obj; - }, - - update: (data: IDataType) => { - hasher.update(data); - return obj; - }, - - digest: ((outputType) => { - const uintArr = hasher.digest("binary"); - hasher.init(); - hasher.update(opad); - hasher.update(uintArr); - return hasher.digest(outputType); - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - }) as any, - save: () => { - throw new Error("save() not supported"); - }, - load: () => { - throw new Error("load() not supported"); - }, - - blockSize: hasher.blockSize, - digestSize: hasher.digestSize, - }; - return obj; -} - -/** - * Calculates HMAC hash - * @param hash Hash algorithm to use. It has to be the return value of a function like createSHA1() - * @param key Key (string, Buffer or TypedArray) - */ -export function createHMAC( - hash: Promise, - key: IDataType, -): Promise { - if (!hash || !hash.then) { - throw new Error( - 'Invalid hash function is provided! Usage: createHMAC(createMD5(), "key").', - ); - } - - return hash.then((hasher) => calculateHmac(hasher, key)); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/lib/index.ts b/tools/mnemonic-test/node_modules/hash-wasm/lib/index.ts deleted file mode 100644 index ec5bfb6e..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/lib/index.ts +++ /dev/null @@ -1,30 +0,0 @@ -export * from "./adler32"; -export * from "./argon2"; -export * from "./blake2b"; -export * from "./blake2s"; -export * from "./blake3"; -export * from "./crc32"; -export * from "./crc64"; -export * from "./md4"; -export * from "./md5"; -export * from "./sha1"; -export * from "./sha3"; -export * from "./keccak"; -export * from "./sha224"; -export * from "./sha256"; -export * from "./sha384"; -export * from "./sha512"; -export * from "./xxhash32"; -export * from "./xxhash64"; -export * from "./xxhash3"; -export * from "./xxhash128"; -export * from "./ripemd160"; -export * from "./hmac"; -export * from "./pbkdf2"; -export * from "./scrypt"; -export * from "./bcrypt"; -export * from "./whirlpool"; -export * from "./sm3"; - -export type { IDataType } from "./util"; -export type { IHasher } from "./WASMInterface"; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/lib/keccak.ts b/tools/mnemonic-test/node_modules/hash-wasm/lib/keccak.ts deleted file mode 100644 index 6ffceef8..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/lib/keccak.ts +++ /dev/null @@ -1,88 +0,0 @@ -import wasmJson from "../wasm/sha3.wasm.json"; -import { - type IHasher, - type IWASMInterface, - WASMInterface, -} from "./WASMInterface"; -import lockedCreate from "./lockedCreate"; -import Mutex from "./mutex"; -import type { IDataType } from "./util"; - -type IValidBits = 224 | 256 | 384 | 512; -const mutex = new Mutex(); -let wasmCache: IWASMInterface = null; - -function validateBits(bits: IValidBits) { - if (![224, 256, 384, 512].includes(bits)) { - return new Error("Invalid variant! Valid values: 224, 256, 384, 512"); - } - - return null; -} - -/** - * Calculates Keccak hash - * @param data Input data (string, Buffer or TypedArray) - * @param bits Number of output bits. Valid values: 224, 256, 384, 512 - * @returns Computed hash as a hexadecimal string - */ -export function keccak( - data: IDataType, - bits: IValidBits = 512, -): Promise { - if (validateBits(bits)) { - return Promise.reject(validateBits(bits)); - } - - const hashLength = bits / 8; - - if (wasmCache === null || wasmCache.hashLength !== hashLength) { - return lockedCreate(mutex, wasmJson, hashLength).then((wasm) => { - wasmCache = wasm; - return wasmCache.calculate(data, bits, 0x01); - }); - } - - try { - const hash = wasmCache.calculate(data, bits, 0x01); - return Promise.resolve(hash); - } catch (err) { - return Promise.reject(err); - } -} - -/** - * Creates a new Keccak hash instance - * @param bits Number of output bits. Valid values: 224, 256, 384, 512 - */ -export function createKeccak(bits: IValidBits = 512): Promise { - if (validateBits(bits)) { - return Promise.reject(validateBits(bits)); - } - - const outputSize = bits / 8; - - return WASMInterface(wasmJson, outputSize).then((wasm) => { - wasm.init(bits); - const obj: IHasher = { - init: () => { - wasm.init(bits); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType, 0x01) as any, - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 200 - 2 * outputSize, - digestSize: outputSize, - }; - return obj; - }); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/lib/lockedCreate.ts b/tools/mnemonic-test/node_modules/hash-wasm/lib/lockedCreate.ts deleted file mode 100644 index 77e218a1..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/lib/lockedCreate.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { type IWASMInterface, WASMInterface } from "./WASMInterface"; -import type Mutex from "./mutex"; -import type { IEmbeddedWasm } from "./util"; - -export default async function lockedCreate( - mutex: Mutex, - binary: IEmbeddedWasm, - hashLength: number, -): Promise { - const unlock = await mutex.lock(); - const wasm = await WASMInterface(binary, hashLength); - unlock(); - return wasm; -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/lib/md4.ts b/tools/mnemonic-test/node_modules/hash-wasm/lib/md4.ts deleted file mode 100644 index 89744bd0..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/lib/md4.ts +++ /dev/null @@ -1,62 +0,0 @@ -import wasmJson from "../wasm/md4.wasm.json"; -import { - type IHasher, - type IWASMInterface, - WASMInterface, -} from "./WASMInterface"; -import lockedCreate from "./lockedCreate"; -import Mutex from "./mutex"; -import type { IDataType } from "./util"; - -const mutex = new Mutex(); -let wasmCache: IWASMInterface = null; - -/** - * Calculates MD4 hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ -export function md4(data: IDataType): Promise { - if (wasmCache === null) { - return lockedCreate(mutex, wasmJson, 16).then((wasm) => { - wasmCache = wasm; - return wasmCache.calculate(data); - }); - } - - try { - const hash = wasmCache.calculate(data); - return Promise.resolve(hash); - } catch (err) { - return Promise.reject(err); - } -} - -/** - * Creates a new MD4 hash instance - */ -export function createMD4(): Promise { - return WASMInterface(wasmJson, 16).then((wasm) => { - wasm.init(); - const obj: IHasher = { - init: () => { - wasm.init(); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType) as any, - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 64, - digestSize: 16, - }; - return obj; - }); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/lib/md5.ts b/tools/mnemonic-test/node_modules/hash-wasm/lib/md5.ts deleted file mode 100644 index 9befb05f..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/lib/md5.ts +++ /dev/null @@ -1,62 +0,0 @@ -import wasmJson from "../wasm/md5.wasm.json"; -import { - type IHasher, - type IWASMInterface, - WASMInterface, -} from "./WASMInterface"; -import lockedCreate from "./lockedCreate"; -import Mutex from "./mutex"; -import type { IDataType } from "./util"; - -const mutex = new Mutex(); -let wasmCache: IWASMInterface = null; - -/** - * Calculates MD5 hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ -export function md5(data: IDataType): Promise { - if (wasmCache === null) { - return lockedCreate(mutex, wasmJson, 16).then((wasm) => { - wasmCache = wasm; - return wasmCache.calculate(data); - }); - } - - try { - const hash = wasmCache.calculate(data); - return Promise.resolve(hash); - } catch (err) { - return Promise.reject(err); - } -} - -/** - * Creates a new MD5 hash instance - */ -export function createMD5(): Promise { - return WASMInterface(wasmJson, 16).then((wasm) => { - wasm.init(); - const obj: IHasher = { - init: () => { - wasm.init(); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType) as any, - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 64, - digestSize: 16, - }; - return obj; - }); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/lib/mutex.ts b/tools/mnemonic-test/node_modules/hash-wasm/lib/mutex.ts deleted file mode 100644 index af6f75d1..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/lib/mutex.ts +++ /dev/null @@ -1,24 +0,0 @@ -class Mutex { - private mutex = Promise.resolve(); - - lock(): PromiseLike<() => void> { - let begin: (unlock: () => void) => void = () => {}; - - this.mutex = this.mutex.then(() => new Promise(begin)); - - return new Promise((res) => { - begin = res; - }); - } - - async dispatch(fn: () => PromiseLike): Promise { - const unlock = await this.lock(); - try { - return await Promise.resolve(fn()); - } finally { - unlock(); - } - } -} - -export default Mutex; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/lib/pbkdf2.ts b/tools/mnemonic-test/node_modules/hash-wasm/lib/pbkdf2.ts deleted file mode 100644 index 31db2386..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/lib/pbkdf2.ts +++ /dev/null @@ -1,138 +0,0 @@ -import type { IHasher } from "./WASMInterface"; -import { createHMAC } from "./hmac"; -import { type IDataType, getDigestHex, getUInt8Buffer } from "./util"; - -export interface IPBKDF2Options { - /** - * Password (or message) to be hashed - */ - password: IDataType; - /** - * Salt (usually containing random bytes) - */ - salt: IDataType; - /** - * Number of iterations to perform - */ - iterations: number; - /** - * Output size in bytes - */ - hashLength: number; - /** - * Hash algorithm to use. It has to be the return value of a function like createSHA1() - */ - hashFunction: Promise; - /** - * Desired output type. Defaults to 'hex' - */ - outputType?: "hex" | "binary"; -} - -async function calculatePBKDF2( - digest: IHasher, - salt: IDataType, - iterations: number, - hashLength: number, - outputType?: "hex" | "binary", -): Promise { - const DK = new Uint8Array(hashLength); - const block1 = new Uint8Array(salt.length + 4); - const block1View = new DataView(block1.buffer); - const saltBuffer = getUInt8Buffer(salt); - const saltUIntBuffer = new Uint8Array( - saltBuffer.buffer, - saltBuffer.byteOffset, - saltBuffer.length, - ); - block1.set(saltUIntBuffer); - - let destPos = 0; - const hLen = digest.digestSize; - const l = Math.ceil(hashLength / hLen); - - let T: Uint8Array = null; - let U: Uint8Array = null; - - for (let i = 1; i <= l; i++) { - block1View.setUint32(salt.length, i); - - digest.init(); - digest.update(block1); - T = digest.digest("binary"); - U = T.slice(); - - for (let j = 1; j < iterations; j++) { - digest.init(); - digest.update(U); - U = digest.digest("binary"); - for (let k = 0; k < hLen; k++) { - T[k] ^= U[k]; - } - } - - DK.set(T.subarray(0, hashLength - destPos), destPos); - destPos += hLen; - } - - if (outputType === "binary") { - return DK; - } - - const digestChars = new Uint8Array(hashLength * 2); - return getDigestHex(digestChars, DK, hashLength); -} - -const validateOptions = (options: IPBKDF2Options) => { - if (!options || typeof options !== "object") { - throw new Error("Invalid options parameter. It requires an object."); - } - - if (!options.hashFunction || !options.hashFunction.then) { - throw new Error( - 'Invalid hash function is provided! Usage: pbkdf2("password", "salt", 1000, 32, createSHA1()).', - ); - } - - if (!Number.isInteger(options.iterations) || options.iterations < 1) { - throw new Error("Iterations should be a positive number"); - } - - if (!Number.isInteger(options.hashLength) || options.hashLength < 1) { - throw new Error("Hash length should be a positive number"); - } - - if (options.outputType === undefined) { - options.outputType = "hex"; - } - - if (!["hex", "binary"].includes(options.outputType)) { - throw new Error( - `Insupported output type ${options.outputType}. Valid values: ['hex', 'binary']`, - ); - } -}; - -interface IPBKDF2OptionsBinary { - outputType: "binary"; -} - -type PBKDF2ReturnType = T extends IPBKDF2OptionsBinary ? Uint8Array : string; - -/** - * Generates a new PBKDF2 hash for the supplied password - */ -export async function pbkdf2( - options: T, -): Promise> { - validateOptions(options); - - const hmac = await createHMAC(options.hashFunction, options.password); - return calculatePBKDF2( - hmac, - options.salt, - options.iterations, - options.hashLength, - options.outputType, - ) as Promise>; -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/lib/ripemd160.ts b/tools/mnemonic-test/node_modules/hash-wasm/lib/ripemd160.ts deleted file mode 100644 index 4dc73ceb..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/lib/ripemd160.ts +++ /dev/null @@ -1,62 +0,0 @@ -import wasmJson from "../wasm/ripemd160.wasm.json"; -import { - type IHasher, - type IWASMInterface, - WASMInterface, -} from "./WASMInterface"; -import lockedCreate from "./lockedCreate"; -import Mutex from "./mutex"; -import type { IDataType } from "./util"; - -const mutex = new Mutex(); -let wasmCache: IWASMInterface = null; - -/** - * Calculates RIPEMD-160 hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ -export function ripemd160(data: IDataType): Promise { - if (wasmCache === null) { - return lockedCreate(mutex, wasmJson, 20).then((wasm) => { - wasmCache = wasm; - return wasmCache.calculate(data); - }); - } - - try { - const hash = wasmCache.calculate(data); - return Promise.resolve(hash); - } catch (err) { - return Promise.reject(err); - } -} - -/** - * Creates a new RIPEMD-160 hash instance - */ -export function createRIPEMD160(): Promise { - return WASMInterface(wasmJson, 20).then((wasm) => { - wasm.init(); - const obj: IHasher = { - init: () => { - wasm.init(); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType) as any, - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 64, - digestSize: 20, - }; - return obj; - }); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/lib/scrypt.ts b/tools/mnemonic-test/node_modules/hash-wasm/lib/scrypt.ts deleted file mode 100644 index ba1cfeae..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/lib/scrypt.ts +++ /dev/null @@ -1,141 +0,0 @@ -import wasmJson from "../wasm/scrypt.wasm.json"; -import { WASMInterface } from "./WASMInterface"; -import { pbkdf2 } from "./pbkdf2"; -import { createSHA256 } from "./sha256"; -import { type IDataType, getDigestHex } from "./util"; - -export interface ScryptOptions { - /** - * Password (or message) to be hashed - */ - password: IDataType; - /** - * Salt (usually containing random bytes) - */ - salt: IDataType; - /** - * CPU / memory cost - must be a power of 2 (e.g. 1024) - */ - costFactor: number; - /** - * Block size (8 is commonly used) - */ - blockSize: number; - /** - * Degree of parallelism - */ - parallelism: number; - /** - * Output size in bytes - */ - hashLength: number; - /** - * Output data type. Defaults to hexadecimal string - */ - outputType?: "hex" | "binary"; -} - -async function scryptInternal( - options: ScryptOptions, -): Promise { - const { costFactor, blockSize, parallelism, hashLength } = options; - const SHA256Hasher = createSHA256(); - - const blockData = await pbkdf2({ - password: options.password, - salt: options.salt, - iterations: 1, - hashLength: 128 * blockSize * parallelism, - hashFunction: SHA256Hasher, - outputType: "binary", - }); - - const scryptInterface = await WASMInterface(wasmJson, 0); - - // last block is for storing the temporary vectors - const VSize = 128 * blockSize * costFactor; - const XYSize = 256 * blockSize; - scryptInterface.setMemorySize(blockData.length + VSize + XYSize); - scryptInterface.writeMemory(blockData, 0); - - // mix blocks - scryptInterface.getExports().scrypt(blockSize, costFactor, parallelism); - - const expensiveSalt = scryptInterface - .getMemory() - .subarray(0, 128 * blockSize * parallelism); - - const outputData = await pbkdf2({ - password: options.password, - salt: expensiveSalt, - iterations: 1, - hashLength, - hashFunction: SHA256Hasher, - outputType: "binary", - }); - - if (options.outputType === "hex") { - const digestChars = new Uint8Array(hashLength * 2); - return getDigestHex(digestChars, outputData, hashLength); - } - - // return binary format - return outputData; -} - -const isPowerOfTwo = (v: number): boolean => v && !(v & (v - 1)); - -const validateOptions = (options: ScryptOptions) => { - if (!options || typeof options !== "object") { - throw new Error("Invalid options parameter. It requires an object."); - } - - if (!Number.isInteger(options.blockSize) || options.blockSize < 1) { - throw new Error("Block size should be a positive number"); - } - - if ( - !Number.isInteger(options.costFactor) || - options.costFactor < 2 || - !isPowerOfTwo(options.costFactor) - ) { - throw new Error("Cost factor should be a power of 2, greater than 1"); - } - - if (!Number.isInteger(options.parallelism) || options.parallelism < 1) { - throw new Error("Parallelism should be a positive number"); - } - - if (!Number.isInteger(options.hashLength) || options.hashLength < 1) { - throw new Error("Hash length should be a positive number."); - } - - if (options.outputType === undefined) { - options.outputType = "hex"; - } - - if (!["hex", "binary"].includes(options.outputType)) { - throw new Error( - `Insupported output type ${options.outputType}. Valid values: ['hex', 'binary']`, - ); - } -}; - -interface IScryptOptionsBinary { - outputType: "binary"; -} - -type ScryptReturnType = T extends IScryptOptionsBinary ? Uint8Array : string; - -/** - * Calculates hash using the scrypt password-based key derivation function - * @returns Computed hash as a hexadecimal string or as - * Uint8Array depending on the outputType option - */ -export async function scrypt( - options: T, -): Promise> { - validateOptions(options); - - return scryptInternal(options) as Promise>; -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/lib/sha1.ts b/tools/mnemonic-test/node_modules/hash-wasm/lib/sha1.ts deleted file mode 100644 index b1549064..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/lib/sha1.ts +++ /dev/null @@ -1,62 +0,0 @@ -import wasmJson from "../wasm/sha1.wasm.json"; -import { - type IHasher, - type IWASMInterface, - WASMInterface, -} from "./WASMInterface"; -import lockedCreate from "./lockedCreate"; -import Mutex from "./mutex"; -import type { IDataType } from "./util"; - -const mutex = new Mutex(); -let wasmCache: IWASMInterface = null; - -/** - * Calculates SHA-1 hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ -export function sha1(data: IDataType): Promise { - if (wasmCache === null) { - return lockedCreate(mutex, wasmJson, 20).then((wasm) => { - wasmCache = wasm; - return wasmCache.calculate(data); - }); - } - - try { - const hash = wasmCache.calculate(data); - return Promise.resolve(hash); - } catch (err) { - return Promise.reject(err); - } -} - -/** - * Creates a new SHA-1 hash instance - */ -export function createSHA1(): Promise { - return WASMInterface(wasmJson, 20).then((wasm) => { - wasm.init(); - const obj: IHasher = { - init: () => { - wasm.init(); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType) as any, - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 64, - digestSize: 20, - }; - return obj; - }); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/lib/sha224.ts b/tools/mnemonic-test/node_modules/hash-wasm/lib/sha224.ts deleted file mode 100644 index 78efd1fe..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/lib/sha224.ts +++ /dev/null @@ -1,62 +0,0 @@ -import wasmJson from "../wasm/sha256.wasm.json"; -import { - type IHasher, - type IWASMInterface, - WASMInterface, -} from "./WASMInterface"; -import lockedCreate from "./lockedCreate"; -import Mutex from "./mutex"; -import type { IDataType } from "./util"; - -const mutex = new Mutex(); -let wasmCache: IWASMInterface = null; - -/** - * Calculates SHA-2 (SHA-224) hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ -export function sha224(data: IDataType): Promise { - if (wasmCache === null) { - return lockedCreate(mutex, wasmJson, 28).then((wasm) => { - wasmCache = wasm; - return wasmCache.calculate(data, 224); - }); - } - - try { - const hash = wasmCache.calculate(data, 224); - return Promise.resolve(hash); - } catch (err) { - return Promise.reject(err); - } -} - -/** - * Creates a new SHA-2 (SHA-224) hash instance - */ -export function createSHA224(): Promise { - return WASMInterface(wasmJson, 28).then((wasm) => { - wasm.init(224); - const obj: IHasher = { - init: () => { - wasm.init(224); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType) as any, - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 64, - digestSize: 28, - }; - return obj; - }); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/lib/sha256.ts b/tools/mnemonic-test/node_modules/hash-wasm/lib/sha256.ts deleted file mode 100644 index 830a5d6f..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/lib/sha256.ts +++ /dev/null @@ -1,62 +0,0 @@ -import wasmJson from "../wasm/sha256.wasm.json"; -import { - type IHasher, - type IWASMInterface, - WASMInterface, -} from "./WASMInterface"; -import lockedCreate from "./lockedCreate"; -import Mutex from "./mutex"; -import type { IDataType } from "./util"; - -const mutex = new Mutex(); -let wasmCache: IWASMInterface = null; - -/** - * Calculates SHA-2 (SHA-256) hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ -export function sha256(data: IDataType): Promise { - if (wasmCache === null) { - return lockedCreate(mutex, wasmJson, 32).then((wasm) => { - wasmCache = wasm; - return wasmCache.calculate(data, 256); - }); - } - - try { - const hash = wasmCache.calculate(data, 256); - return Promise.resolve(hash); - } catch (err) { - return Promise.reject(err); - } -} - -/** - * Creates a new SHA-2 (SHA-256) hash instance - */ -export function createSHA256(): Promise { - return WASMInterface(wasmJson, 32).then((wasm) => { - wasm.init(256); - const obj: IHasher = { - init: () => { - wasm.init(256); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType) as any, - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 64, - digestSize: 32, - }; - return obj; - }); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/lib/sha3.ts b/tools/mnemonic-test/node_modules/hash-wasm/lib/sha3.ts deleted file mode 100644 index 67ac692f..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/lib/sha3.ts +++ /dev/null @@ -1,84 +0,0 @@ -import wasmJson from "../wasm/sha3.wasm.json"; -import { - type IHasher, - type IWASMInterface, - WASMInterface, -} from "./WASMInterface"; -import lockedCreate from "./lockedCreate"; -import Mutex from "./mutex"; -import type { IDataType } from "./util"; - -type IValidBits = 224 | 256 | 384 | 512; -const mutex = new Mutex(); -let wasmCache: IWASMInterface = null; - -function validateBits(bits: IValidBits) { - if (![224, 256, 384, 512].includes(bits)) { - return new Error("Invalid variant! Valid values: 224, 256, 384, 512"); - } - return null; -} - -/** - * Calculates SHA-3 hash - * @param data Input data (string, Buffer or TypedArray) - * @param bits Number of output bits. Valid values: 224, 256, 384, 512 - * @returns Computed hash as a hexadecimal string - */ -export function sha3(data: IDataType, bits: IValidBits = 512): Promise { - if (validateBits(bits)) { - return Promise.reject(validateBits(bits)); - } - - const hashLength = bits / 8; - - if (wasmCache === null || wasmCache.hashLength !== hashLength) { - return lockedCreate(mutex, wasmJson, hashLength).then((wasm) => { - wasmCache = wasm; - return wasmCache.calculate(data, bits, 0x06); - }); - } - - try { - const hash = wasmCache.calculate(data, bits, 0x06); - return Promise.resolve(hash); - } catch (err) { - return Promise.reject(err); - } -} - -/** - * Creates a new SHA-3 hash instance - * @param bits Number of output bits. Valid values: 224, 256, 384, 512 - */ -export function createSHA3(bits: IValidBits = 512): Promise { - if (validateBits(bits)) { - return Promise.reject(validateBits(bits)); - } - - const outputSize = bits / 8; - - return WASMInterface(wasmJson, outputSize).then((wasm) => { - wasm.init(bits); - const obj: IHasher = { - init: () => { - wasm.init(bits); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType, 0x06) as any, - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 200 - 2 * outputSize, - digestSize: outputSize, - }; - return obj; - }); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/lib/sha384.ts b/tools/mnemonic-test/node_modules/hash-wasm/lib/sha384.ts deleted file mode 100644 index 70b01917..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/lib/sha384.ts +++ /dev/null @@ -1,62 +0,0 @@ -import wasmJson from "../wasm/sha512.wasm.json"; -import { - type IHasher, - type IWASMInterface, - WASMInterface, -} from "./WASMInterface"; -import lockedCreate from "./lockedCreate"; -import Mutex from "./mutex"; -import type { IDataType } from "./util"; - -const mutex = new Mutex(); -let wasmCache: IWASMInterface = null; - -/** - * Calculates SHA-2 (SHA-384) hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ -export function sha384(data: IDataType): Promise { - if (wasmCache === null) { - return lockedCreate(mutex, wasmJson, 48).then((wasm) => { - wasmCache = wasm; - return wasmCache.calculate(data, 384); - }); - } - - try { - const hash = wasmCache.calculate(data, 384); - return Promise.resolve(hash); - } catch (err) { - return Promise.reject(err); - } -} - -/** - * Creates a new SHA-2 (SHA-384) hash instance - */ -export function createSHA384(): Promise { - return WASMInterface(wasmJson, 48).then((wasm) => { - wasm.init(384); - const obj: IHasher = { - init: () => { - wasm.init(384); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType) as any, - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 128, - digestSize: 48, - }; - return obj; - }); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/lib/sha512.ts b/tools/mnemonic-test/node_modules/hash-wasm/lib/sha512.ts deleted file mode 100644 index beeb3e8b..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/lib/sha512.ts +++ /dev/null @@ -1,62 +0,0 @@ -import wasmJson from "../wasm/sha512.wasm.json"; -import { - type IHasher, - type IWASMInterface, - WASMInterface, -} from "./WASMInterface"; -import lockedCreate from "./lockedCreate"; -import Mutex from "./mutex"; -import type { IDataType } from "./util"; - -const mutex = new Mutex(); -let wasmCache: IWASMInterface = null; - -/** - * Calculates SHA-2 (SHA-512) hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ -export function sha512(data: IDataType): Promise { - if (wasmCache === null) { - return lockedCreate(mutex, wasmJson, 64).then((wasm) => { - wasmCache = wasm; - return wasmCache.calculate(data, 512); - }); - } - - try { - const hash = wasmCache.calculate(data, 512); - return Promise.resolve(hash); - } catch (err) { - return Promise.reject(err); - } -} - -/** - * Creates a new SHA-2 (SHA-512) hash instance - */ -export function createSHA512(): Promise { - return WASMInterface(wasmJson, 64).then((wasm) => { - wasm.init(512); - const obj: IHasher = { - init: () => { - wasm.init(512); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType) as any, - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 128, - digestSize: 64, - }; - return obj; - }); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/lib/sm3.ts b/tools/mnemonic-test/node_modules/hash-wasm/lib/sm3.ts deleted file mode 100644 index 9f5987be..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/lib/sm3.ts +++ /dev/null @@ -1,62 +0,0 @@ -import wasmJson from "../wasm/sm3.wasm.json"; -import { - type IHasher, - type IWASMInterface, - WASMInterface, -} from "./WASMInterface"; -import lockedCreate from "./lockedCreate"; -import Mutex from "./mutex"; -import type { IDataType } from "./util"; - -const mutex = new Mutex(); -let wasmCache: IWASMInterface = null; - -/** - * Calculates SM3 hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ -export function sm3(data: IDataType): Promise { - if (wasmCache === null) { - return lockedCreate(mutex, wasmJson, 32).then((wasm) => { - wasmCache = wasm; - return wasmCache.calculate(data); - }); - } - - try { - const hash = wasmCache.calculate(data); - return Promise.resolve(hash); - } catch (err) { - return Promise.reject(err); - } -} - -/** - * Creates a new SM3 hash instance - */ -export function createSM3(): Promise { - return WASMInterface(wasmJson, 32).then((wasm) => { - wasm.init(); - const obj: IHasher = { - init: () => { - wasm.init(); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType) as any, - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 64, - digestSize: 32, - }; - return obj; - }); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/lib/util.ts b/tools/mnemonic-test/node_modules/hash-wasm/lib/util.ts deleted file mode 100644 index 39a62172..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/lib/util.ts +++ /dev/null @@ -1,191 +0,0 @@ -function getGlobal() { - if (typeof globalThis !== "undefined") return globalThis; - if (typeof self !== "undefined") return self; - if (typeof window !== "undefined") return window; - return global; -} - -const globalObject = getGlobal(); -const nodeBuffer = globalObject.Buffer ?? null; -const textEncoder = globalObject.TextEncoder - ? new globalObject.TextEncoder() - : null; - -export type ITypedArray = Uint8Array | Uint16Array | Uint32Array; -export type IDataType = string | Buffer | ITypedArray; -export type IEmbeddedWasm = { name: string; data: string; hash: string }; - -export function intArrayToString(arr: Uint8Array, len: number): string { - return String.fromCharCode(...arr.subarray(0, len)); -} - -function hexCharCodesToInt(a: number, b: number): number { - return ( - (((a & 0xf) + ((a >> 6) | ((a >> 3) & 0x8))) << 4) | - ((b & 0xf) + ((b >> 6) | ((b >> 3) & 0x8))) - ); -} - -export function writeHexToUInt8(buf: Uint8Array, str: string) { - const size = str.length >> 1; - for (let i = 0; i < size; i++) { - const index = i << 1; - buf[i] = hexCharCodesToInt( - str.charCodeAt(index), - str.charCodeAt(index + 1), - ); - } -} - -export function hexStringEqualsUInt8(str: string, buf: Uint8Array): boolean { - if (str.length !== buf.length * 2) { - return false; - } - for (let i = 0; i < buf.length; i++) { - const strIndex = i << 1; - if ( - buf[i] !== - hexCharCodesToInt(str.charCodeAt(strIndex), str.charCodeAt(strIndex + 1)) - ) { - return false; - } - } - return true; -} - -const alpha = "a".charCodeAt(0) - 10; -const digit = "0".charCodeAt(0); -export function getDigestHex( - tmpBuffer: Uint8Array, - input: Uint8Array, - hashLength: number, -): string { - let p = 0; - for (let i = 0; i < hashLength; i++) { - let nibble = input[i] >>> 4; - tmpBuffer[p++] = nibble > 9 ? nibble + alpha : nibble + digit; - nibble = input[i] & 0xf; - tmpBuffer[p++] = nibble > 9 ? nibble + alpha : nibble + digit; - } - - return String.fromCharCode.apply(null, tmpBuffer); -} - -export const getUInt8Buffer = - nodeBuffer !== null - ? (data: IDataType): Uint8Array => { - if (typeof data === "string") { - const buf = nodeBuffer.from(data, "utf8"); - return new Uint8Array(buf.buffer, buf.byteOffset, buf.length); - } - - if (nodeBuffer.isBuffer(data)) { - return new Uint8Array(data.buffer, data.byteOffset, data.length); - } - - if (ArrayBuffer.isView(data)) { - return new Uint8Array(data.buffer, data.byteOffset, data.byteLength); - } - - throw new Error("Invalid data type!"); - } - : (data: IDataType): Uint8Array => { - if (typeof data === "string") { - return textEncoder.encode(data); - } - - if (ArrayBuffer.isView(data)) { - return new Uint8Array(data.buffer, data.byteOffset, data.byteLength); - } - - throw new Error("Invalid data type!"); - }; - -const base64Chars = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; -const base64Lookup = new Uint8Array(256); -for (let i = 0; i < base64Chars.length; i++) { - base64Lookup[base64Chars.charCodeAt(i)] = i; -} - -export function encodeBase64(data: Uint8Array, pad = true): string { - const len = data.length; - const extraBytes = len % 3; - const parts = []; - - const len2 = len - extraBytes; - for (let i = 0; i < len2; i += 3) { - const tmp = - ((data[i] << 16) & 0xff0000) + - ((data[i + 1] << 8) & 0xff00) + - (data[i + 2] & 0xff); - - const triplet = - base64Chars.charAt((tmp >> 18) & 0x3f) + - base64Chars.charAt((tmp >> 12) & 0x3f) + - base64Chars.charAt((tmp >> 6) & 0x3f) + - base64Chars.charAt(tmp & 0x3f); - - parts.push(triplet); - } - - if (extraBytes === 1) { - const tmp = data[len - 1]; - const a = base64Chars.charAt(tmp >> 2); - const b = base64Chars.charAt((tmp << 4) & 0x3f); - - parts.push(`${a}${b}`); - if (pad) { - parts.push("=="); - } - } else if (extraBytes === 2) { - const tmp = (data[len - 2] << 8) + data[len - 1]; - const a = base64Chars.charAt(tmp >> 10); - const b = base64Chars.charAt((tmp >> 4) & 0x3f); - const c = base64Chars.charAt((tmp << 2) & 0x3f); - parts.push(`${a}${b}${c}`); - if (pad) { - parts.push("="); - } - } - - return parts.join(""); -} - -export function getDecodeBase64Length(data: string): number { - let bufferLength = Math.floor(data.length * 0.75); - const len = data.length; - - if (data[len - 1] === "=") { - bufferLength -= 1; - if (data[len - 2] === "=") { - bufferLength -= 1; - } - } - - return bufferLength; -} - -export function decodeBase64(data: string): Uint8Array { - const bufferLength = getDecodeBase64Length(data); - const len = data.length; - - const bytes = new Uint8Array(bufferLength); - - let p = 0; - for (let i = 0; i < len; i += 4) { - const encoded1 = base64Lookup[data.charCodeAt(i)]; - const encoded2 = base64Lookup[data.charCodeAt(i + 1)]; - const encoded3 = base64Lookup[data.charCodeAt(i + 2)]; - const encoded4 = base64Lookup[data.charCodeAt(i + 3)]; - - bytes[p] = (encoded1 << 2) | (encoded2 >> 4); - p += 1; - bytes[p] = ((encoded2 & 15) << 4) | (encoded3 >> 2); - p += 1; - bytes[p] = ((encoded3 & 3) << 6) | (encoded4 & 63); - p += 1; - } - - return bytes; -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/lib/whirlpool.ts b/tools/mnemonic-test/node_modules/hash-wasm/lib/whirlpool.ts deleted file mode 100644 index 0dff891e..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/lib/whirlpool.ts +++ /dev/null @@ -1,62 +0,0 @@ -import wasmJson from "../wasm/whirlpool.wasm.json"; -import { - type IHasher, - type IWASMInterface, - WASMInterface, -} from "./WASMInterface"; -import lockedCreate from "./lockedCreate"; -import Mutex from "./mutex"; -import type { IDataType } from "./util"; - -const mutex = new Mutex(); -let wasmCache: IWASMInterface = null; - -/** - * Calculates Whirlpool hash - * @param data Input data (string, Buffer or TypedArray) - * @returns Computed hash as a hexadecimal string - */ -export function whirlpool(data: IDataType): Promise { - if (wasmCache === null) { - return lockedCreate(mutex, wasmJson, 64).then((wasm) => { - wasmCache = wasm; - return wasmCache.calculate(data); - }); - } - - try { - const hash = wasmCache.calculate(data); - return Promise.resolve(hash); - } catch (err) { - return Promise.reject(err); - } -} - -/** - * Creates a new Whirlpool hash instance - */ -export function createWhirlpool(): Promise { - return WASMInterface(wasmJson, 64).then((wasm) => { - wasm.init(); - const obj: IHasher = { - init: () => { - wasm.init(); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType) as any, - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 64, - digestSize: 64, - }; - return obj; - }); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/lib/xxhash128.ts b/tools/mnemonic-test/node_modules/hash-wasm/lib/xxhash128.ts deleted file mode 100644 index cf59dc51..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/lib/xxhash128.ts +++ /dev/null @@ -1,115 +0,0 @@ -import wasmJson from "../wasm/xxhash128.wasm.json"; -import { - type IHasher, - type IWASMInterface, - WASMInterface, -} from "./WASMInterface"; -import lockedCreate from "./lockedCreate"; -import Mutex from "./mutex"; -import type { IDataType } from "./util"; - -const mutex = new Mutex(); -let wasmCache: IWASMInterface = null; -const seedBuffer = new Uint8Array(8); - -function validateSeed(seed: number) { - if (!Number.isInteger(seed) || seed < 0 || seed > 0xffffffff) { - return new Error( - "Seed must be given as two valid 32-bit long unsigned integers (lo + high).", - ); - } - return null; -} - -function writeSeed(arr: ArrayBuffer, low: number, high: number) { - // write in little-endian format - const buffer = new DataView(arr); - buffer.setUint32(0, low, true); - buffer.setUint32(4, high, true); -} - -/** - * Calculates xxHash128 hash - * @param data Input data (string, Buffer or TypedArray) - * @param seedLow Lower 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @param seedHigh Higher 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @returns Computed hash as a hexadecimal string - */ -export function xxhash128( - data: IDataType, - seedLow = 0, - seedHigh = 0, -): Promise { - if (validateSeed(seedLow)) { - return Promise.reject(validateSeed(seedLow)); - } - - if (validateSeed(seedHigh)) { - return Promise.reject(validateSeed(seedHigh)); - } - - if (wasmCache === null) { - return lockedCreate(mutex, wasmJson, 16).then((wasm) => { - wasmCache = wasm; - writeSeed(seedBuffer.buffer, seedLow, seedHigh); - wasmCache.writeMemory(seedBuffer); - return wasmCache.calculate(data); - }); - } - - try { - writeSeed(seedBuffer.buffer, seedLow, seedHigh); - wasmCache.writeMemory(seedBuffer); - const hash = wasmCache.calculate(data); - return Promise.resolve(hash); - } catch (err) { - return Promise.reject(err); - } -} - -/** - * Creates a new xxHash128 hash instance - * @param seedLow Lower 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @param seedHigh Higher 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - */ -export function createXXHash128(seedLow = 0, seedHigh = 0): Promise { - if (validateSeed(seedLow)) { - return Promise.reject(validateSeed(seedLow)); - } - - if (validateSeed(seedHigh)) { - return Promise.reject(validateSeed(seedHigh)); - } - - return WASMInterface(wasmJson, 16).then((wasm) => { - const instanceBuffer = new Uint8Array(8); - writeSeed(instanceBuffer.buffer, seedLow, seedHigh); - wasm.writeMemory(instanceBuffer); - wasm.init(); - const obj: IHasher = { - init: () => { - wasm.writeMemory(instanceBuffer); - wasm.init(); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType) as any, - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 512, - digestSize: 16, - }; - return obj; - }); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/lib/xxhash3.ts b/tools/mnemonic-test/node_modules/hash-wasm/lib/xxhash3.ts deleted file mode 100644 index fabcb9f3..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/lib/xxhash3.ts +++ /dev/null @@ -1,115 +0,0 @@ -import wasmJson from "../wasm/xxhash3.wasm.json"; -import { - type IHasher, - type IWASMInterface, - WASMInterface, -} from "./WASMInterface"; -import lockedCreate from "./lockedCreate"; -import Mutex from "./mutex"; -import type { IDataType } from "./util"; - -const mutex = new Mutex(); -let wasmCache: IWASMInterface = null; -const seedBuffer = new Uint8Array(8); - -function validateSeed(seed: number) { - if (!Number.isInteger(seed) || seed < 0 || seed > 0xffffffff) { - return new Error( - "Seed must be given as two valid 32-bit long unsigned integers (lo + high).", - ); - } - return null; -} - -function writeSeed(arr: ArrayBuffer, low: number, high: number) { - // write in little-endian format - const buffer = new DataView(arr); - buffer.setUint32(0, low, true); - buffer.setUint32(4, high, true); -} - -/** - * Calculates xxHash3 hash - * @param data Input data (string, Buffer or TypedArray) - * @param seedLow Lower 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @param seedHigh Higher 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @returns Computed hash as a hexadecimal string - */ -export function xxhash3( - data: IDataType, - seedLow = 0, - seedHigh = 0, -): Promise { - if (validateSeed(seedLow)) { - return Promise.reject(validateSeed(seedLow)); - } - - if (validateSeed(seedHigh)) { - return Promise.reject(validateSeed(seedHigh)); - } - - if (wasmCache === null) { - return lockedCreate(mutex, wasmJson, 8).then((wasm) => { - wasmCache = wasm; - writeSeed(seedBuffer.buffer, seedLow, seedHigh); - wasmCache.writeMemory(seedBuffer); - return wasmCache.calculate(data); - }); - } - - try { - writeSeed(seedBuffer.buffer, seedLow, seedHigh); - wasmCache.writeMemory(seedBuffer); - const hash = wasmCache.calculate(data); - return Promise.resolve(hash); - } catch (err) { - return Promise.reject(err); - } -} - -/** - * Creates a new xxHash3 hash instance - * @param seedLow Lower 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @param seedHigh Higher 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - */ -export function createXXHash3(seedLow = 0, seedHigh = 0): Promise { - if (validateSeed(seedLow)) { - return Promise.reject(validateSeed(seedLow)); - } - - if (validateSeed(seedHigh)) { - return Promise.reject(validateSeed(seedHigh)); - } - - return WASMInterface(wasmJson, 8).then((wasm) => { - const instanceBuffer = new Uint8Array(8); - writeSeed(instanceBuffer.buffer, seedLow, seedHigh); - wasm.writeMemory(instanceBuffer); - wasm.init(); - const obj: IHasher = { - init: () => { - wasm.writeMemory(instanceBuffer); - wasm.init(); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType) as any, - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 512, - digestSize: 8, - }; - return obj; - }); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/lib/xxhash32.ts b/tools/mnemonic-test/node_modules/hash-wasm/lib/xxhash32.ts deleted file mode 100644 index 73e5e618..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/lib/xxhash32.ts +++ /dev/null @@ -1,79 +0,0 @@ -import wasmJson from "../wasm/xxhash32.wasm.json"; -import { - type IHasher, - type IWASMInterface, - WASMInterface, -} from "./WASMInterface"; -import lockedCreate from "./lockedCreate"; -import Mutex from "./mutex"; -import type { IDataType } from "./util"; - -const mutex = new Mutex(); -let wasmCache: IWASMInterface = null; - -function validateSeed(seed: number) { - if (!Number.isInteger(seed) || seed < 0 || seed > 0xffffffff) { - return new Error("Seed must be a valid 32-bit long unsigned integer."); - } - return null; -} -/** - * Calculates xxHash32 hash - * @param data Input data (string, Buffer or TypedArray) - * @param seed Number used to initialize the internal state of the algorithm (defaults to 0) - * @returns Computed hash as a hexadecimal string - */ -export function xxhash32(data: IDataType, seed = 0): Promise { - if (validateSeed(seed)) { - return Promise.reject(validateSeed(seed)); - } - - if (wasmCache === null) { - return lockedCreate(mutex, wasmJson, 4).then((wasm) => { - wasmCache = wasm; - return wasmCache.calculate(data, seed); - }); - } - - try { - const hash = wasmCache.calculate(data, seed); - return Promise.resolve(hash); - } catch (err) { - return Promise.reject(err); - } -} - -/** - * Creates a new xxHash32 hash instance - * @param data Input data (string, Buffer or TypedArray) - * @param seed Number used to initialize the internal state of the algorithm (defaults to 0) - */ -export function createXXHash32(seed = 0): Promise { - if (validateSeed(seed)) { - return Promise.reject(validateSeed(seed)); - } - - return WASMInterface(wasmJson, 4).then((wasm) => { - wasm.init(seed); - const obj: IHasher = { - init: () => { - wasm.init(seed); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType) as any, - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 16, - digestSize: 4, - }; - return obj; - }); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/lib/xxhash64.ts b/tools/mnemonic-test/node_modules/hash-wasm/lib/xxhash64.ts deleted file mode 100644 index 11c1549a..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/lib/xxhash64.ts +++ /dev/null @@ -1,115 +0,0 @@ -import wasmJson from "../wasm/xxhash64.wasm.json"; -import { - type IHasher, - type IWASMInterface, - WASMInterface, -} from "./WASMInterface"; -import lockedCreate from "./lockedCreate"; -import Mutex from "./mutex"; -import type { IDataType } from "./util"; - -const mutex = new Mutex(); -let wasmCache: IWASMInterface = null; -const seedBuffer = new Uint8Array(8); - -function validateSeed(seed: number) { - if (!Number.isInteger(seed) || seed < 0 || seed > 0xffffffff) { - return new Error( - "Seed must be given as two valid 32-bit long unsigned integers (lo + high).", - ); - } - return null; -} - -function writeSeed(arr: ArrayBuffer, low: number, high: number) { - // write in little-endian format - const buffer = new DataView(arr); - buffer.setUint32(0, low, true); - buffer.setUint32(4, high, true); -} - -/** - * Calculates xxHash64 hash - * @param data Input data (string, Buffer or TypedArray) - * @param seedLow Lower 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @param seedHigh Higher 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @returns Computed hash as a hexadecimal string - */ -export function xxhash64( - data: IDataType, - seedLow = 0, - seedHigh = 0, -): Promise { - if (validateSeed(seedLow)) { - return Promise.reject(validateSeed(seedLow)); - } - - if (validateSeed(seedHigh)) { - return Promise.reject(validateSeed(seedHigh)); - } - - if (wasmCache === null) { - return lockedCreate(mutex, wasmJson, 8).then((wasm) => { - wasmCache = wasm; - writeSeed(seedBuffer.buffer, seedLow, seedHigh); - wasmCache.writeMemory(seedBuffer); - return wasmCache.calculate(data); - }); - } - - try { - writeSeed(seedBuffer.buffer, seedLow, seedHigh); - wasmCache.writeMemory(seedBuffer); - const hash = wasmCache.calculate(data); - return Promise.resolve(hash); - } catch (err) { - return Promise.reject(err); - } -} - -/** - * Creates a new xxHash64 hash instance - * @param seedLow Lower 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - * @param seedHigh Higher 32 bits of the number used to - * initialize the internal state of the algorithm (defaults to 0) - */ -export function createXXHash64(seedLow = 0, seedHigh = 0): Promise { - if (validateSeed(seedLow)) { - return Promise.reject(validateSeed(seedLow)); - } - - if (validateSeed(seedHigh)) { - return Promise.reject(validateSeed(seedHigh)); - } - - return WASMInterface(wasmJson, 8).then((wasm) => { - const instanceBuffer = new Uint8Array(8); - writeSeed(instanceBuffer.buffer, seedLow, seedHigh); - wasm.writeMemory(instanceBuffer); - wasm.init(); - const obj: IHasher = { - init: () => { - wasm.writeMemory(instanceBuffer); - wasm.init(); - return obj; - }, - update: (data) => { - wasm.update(data); - return obj; - }, - // biome-ignore lint/suspicious/noExplicitAny: Conflict with IHasher type - digest: (outputType) => wasm.digest(outputType) as any, - save: () => wasm.save(), - load: (data) => { - wasm.load(data); - return obj; - }, - blockSize: 32, - digestSize: 8, - }; - return obj; - }); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/package.json b/tools/mnemonic-test/node_modules/hash-wasm/package.json deleted file mode 100644 index f7645366..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/package.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "name": "hash-wasm", - "version": "4.12.0", - "description": "Lightning fast hash functions for browsers and Node.js using hand-tuned WebAssembly binaries (MD4, MD5, SHA-1, SHA-2, SHA-3, Keccak, BLAKE2, BLAKE3, PBKDF2, Argon2, bcrypt, scrypt, Adler-32, CRC32, CRC32C, RIPEMD-160, HMAC, xxHash, SM3, Whirlpool)", - "main": "dist/index.umd.js", - "module": "dist/index.esm.js", - "types": "dist/lib/index.d.ts", - "scripts": { - "build": "sh -c ./scripts/build.sh", - "lint": "npx @biomejs/biome check lib test", - "prepublishOnly": "sh -c ./scripts/build.sh", - "test": "node --expose-gc ./node_modules/.bin/jest --coverage --logHeapUsage", - "webpack": "node webpack/webpack.js" - }, - "sideEffects": false, - "repository": { - "type": "git", - "url": "git+https://github.com/Daninet/hash-wasm.git" - }, - "keywords": [ - "hash", - "wasm", - "webassembly", - "md5", - "adler-32", - "crc32", - "crc64", - "sha-1", - "sha-2", - "sha-3", - "xxhash", - "keccak", - "ripemd", - "hmac", - "pbkdf2", - "blake2", - "blake2b", - "blake2s", - "blake3", - "fast", - "hashing", - "browser", - "key", - "derivation", - "password", - "md4", - "sha", - "sha1", - "sha2", - "sha224", - "sha-224", - "sha256", - "sha-256", - "sha384", - "sha-384", - "sha512", - "sha-512", - "sha3", - "sha3-224", - "sha3-256", - "sha3-384", - "sha3-512", - "xxhash32", - "xxhash64", - "ripemd160", - "argon2", - "argon2i", - "argon2d", - "argon2id", - "scrypt", - "bcrypt", - "sm3", - "whirlpool" - ], - "bugs": { - "url": "https://github.com/Daninet/hash-wasm/issues" - }, - "homepage": "https://github.com/Daninet/hash-wasm#readme", - "author": "Dani Biró (https://danibiro.com)", - "license": "MIT", - "devDependencies": { - "@biomejs/biome": "1.9.4", - "@rollup/plugin-json": "^6.1.0", - "@rollup/plugin-typescript": "^12.1.1", - "@types/estree": "^1.0.6", - "@types/jest": "^29.5.14", - "@types/node": "^22.9.0", - "binaryen": "^120.0.0", - "jest": "^29.7.0", - "rollup": "^4.27.3", - "rollup-plugin-gzip": "^4.0.1", - "rollup-plugin-license": "^3.5.3", - "rollup-plugin-terser": "^7.0.2", - "ts-jest": "^29.2.5", - "ts-loader": "^9.5.1", - "ts-node": "^10.9.2", - "tslib": "^2.8.1", - "typescript": "^5.6.3" - } -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/rollup.config.mjs b/tools/mnemonic-test/node_modules/hash-wasm/rollup.config.mjs deleted file mode 100644 index fbbfa8fc..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/rollup.config.mjs +++ /dev/null @@ -1,112 +0,0 @@ -import typescript from "@rollup/plugin-typescript"; -import json from "@rollup/plugin-json"; -import { terser } from "rollup-plugin-terser"; -// import gzipPlugin from 'rollup-plugin-gzip'; -import license from "rollup-plugin-license"; - -const ALGORITHMS = [ - "adler32", - "argon2", - "bcrypt", - "blake2b", - "blake2s", - "blake3", - "crc32", - "crc64", - "hmac", - "keccak", - "md4", - "md5", - "pbkdf2", - "ripemd160", - "scrypt", - "sha1", - "sha3", - "sha224", - "sha256", - "sha384", - "sha512", - "sm3", - "whirlpool", - "xxhash32", - "xxhash64", - "xxhash3", - "xxhash128", -]; - -const TERSER_CONFIG = { - output: { - comments: false, - }, -}; - -const LICENSE_CONFIG = { - banner: { - commentStyle: "ignored", - content: `hash-wasm (https://www.npmjs.com/package/hash-wasm) - (c) Dani Biro - @license MIT`, - }, -}; - -const MAIN_BUNDLE_CONFIG = { - input: "lib/index.ts", - output: [ - { - file: "dist/index.umd.js", - name: "hashwasm", - format: "umd", - }, - { - file: "dist/index.esm.js", - format: "es", - }, - ], - plugins: [json(), typescript(), license(LICENSE_CONFIG)], -}; - -const MINIFIED_MAIN_BUNDLE_CONFIG = { - input: "lib/index.ts", - output: [ - { - file: "dist/index.umd.min.js", - name: "hashwasm", - format: "umd", - }, - { - file: "dist/index.esm.min.js", - format: "es", - }, - ], - plugins: [ - json(), - typescript(), - terser(TERSER_CONFIG), - license(LICENSE_CONFIG), - ], -}; - -const INDIVIDUAL_BUNDLE_CONFIG = (algorithm) => ({ - input: `lib/${algorithm}.ts`, - output: [ - { - file: `dist/${algorithm}.umd.min.js`, - name: "hashwasm", - format: "umd", - extend: true, - }, - ], - plugins: [ - json(), - typescript(), - terser(TERSER_CONFIG), - license(LICENSE_CONFIG), - // gzipPlugin(), - ], -}); - -export default [ - MAIN_BUNDLE_CONFIG, - MINIFIED_MAIN_BUNDLE_CONFIG, - ...ALGORITHMS.map(INDIVIDUAL_BUNDLE_CONFIG), -]; diff --git a/tools/mnemonic-test/node_modules/hash-wasm/src/adler32.c b/tools/mnemonic-test/node_modules/hash-wasm/src/adler32.c deleted file mode 100644 index 40d52ab4..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/src/adler32.c +++ /dev/null @@ -1,143 +0,0 @@ -/* - adler32.c -- compute the Adler-32 checksum of a data stream - Copyright (C) 1995-2011, 2016 Mark Adler - - Licensed under the zlib license: - - Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu - - Modified for hash-wasm by Nicholas Sherlock and Dani Biro, 2021 -*/ - -#define WITH_BUFFER -#include "hash-wasm.h" - -#define bswap_32(x) __builtin_bswap32(x) - -#define BASE 65521U /* largest prime smaller than 65536 */ -#define NMAX 5552 -/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ - -#define DO1(b,i) adler += ((b) >> i) & 0xFF; sum2 += adler; -#define DO4(buf,i) { uint32_t b = ((uint32_t*)buf)[i]; DO1(b,0); DO1(b,8); DO1(b,16); DO1(b,24); } -#define DO16(buf) DO4(buf,0); DO4(buf,1); DO4(buf,2); DO4(buf,3); - - -#define MOD(a) a %= BASE -#define MOD28(a) a %= BASE -#define MOD63(a) a %= BASE - -uint32_t previousAdler = 1; - -WASM_EXPORT -void Hash_Init() { - previousAdler = 1; -} - -static uint32_t adler32(uint32_t adler, const uint8_t *buf, uint32_t len) { - /* split Adler-32 into component sums */ - uint32_t sum2 = (adler >> 16) & 0xffff; - adler &= 0xffff; - - /* in case user likes doing a byte at a time, keep it fast */ - if (len == 1) { - adler += buf[0]; - if (adler >= BASE) { - adler -= BASE; - } - sum2 += adler; - if (sum2 >= BASE) { - sum2 -= BASE; - } - return adler | (sum2 << 16); - } - - /* in case short lengths are provided, keep it somewhat fast */ - if (len < 16) { - while (len--) { - adler += *buf++; - sum2 += adler; - } - if (adler >= BASE) { - adler -= BASE; - } - MOD28(sum2); /* only added so many BASE's */ - return adler | (sum2 << 16); - } - - /* do length NMAX blocks -- requires just one modulo operation */ - while (len >= NMAX) { - len -= NMAX; - uint32_t n = NMAX / 16; /* NMAX is divisible by 16 */ - do { - DO16(buf); /* 16 sums unrolled */ - buf += 16; - } while (--n); - MOD(adler); - MOD(sum2); - } - - /* do remaining bytes (less than NMAX, still just one modulo) */ - if (len) { /* avoid modulos if none remaining */ - while (len >= 16) { - len -= 16; - DO16(buf); - buf += 16; - } - while (len--) { - adler += *buf++; - sum2 += adler; - } - MOD(adler); - MOD(sum2); - } - - /* return recombined sums */ - return adler | (sum2 << 16); -} - -WASM_EXPORT -void Hash_Update(uint32_t len) { - const uint8_t *buf = main_buffer; - - previousAdler = adler32(previousAdler, buf, len); -} - -WASM_EXPORT -void Hash_Final() { - ((uint32_t*)main_buffer)[0] = bswap_32(previousAdler); -} - -WASM_EXPORT -const uint32_t STATE_SIZE = sizeof(previousAdler); - -WASM_EXPORT -uint8_t* Hash_GetState() { - return (uint8_t*) &previousAdler; -} - -WASM_EXPORT -void Hash_Calculate(uint32_t length) { - Hash_Init(); - Hash_Update(length); - Hash_Final(); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/src/argon2.c b/tools/mnemonic-test/node_modules/hash-wasm/src/argon2.c deleted file mode 100644 index b40d6767..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/src/argon2.c +++ /dev/null @@ -1,237 +0,0 @@ -/* - Based on Golang's Argon2 implementation from crypto package - - Written for hash-wasm by Dani Biró -*/ - -#include "hash-wasm.h" - -#define BYTES_PER_PAGE 65536 - -uint8_t *B = NULL; -uint64_t B_size = 0; - -WASM_EXPORT -int8_t Hash_SetMemorySize(uint32_t total_bytes) { - uint32_t bytes_required = total_bytes - B_size; - - if (bytes_required > 0) { - uint32_t blocks = bytes_required / BYTES_PER_PAGE; - if (blocks * BYTES_PER_PAGE < bytes_required) { - blocks += 1; - } - - if (__builtin_wasm_memory_grow(0, blocks) == -1) { - return -1; - } - - B_size += blocks * BYTES_PER_PAGE; - } - - return 0; -} - -WASM_EXPORT -uint8_t *Hash_GetBuffer() { - if (B == NULL) { - // start of new memory - B = (uint8_t *)(__builtin_wasm_memory_size(0) * BYTES_PER_PAGE); - if (Hash_SetMemorySize(512 * 1024) == -1) { // always preallocate 16kb to not cause problems with the other hashes - return NULL; - } - } - - return B; -} - -static __inline__ uint64_t rotr64(const uint64_t w, const unsigned c) { - return (w >> c) | (w << (64 - c)); -} - -#define G(a, b, c, d) \ - do { \ - a = a + b + 2 * (a & 0xFFFFFFFF) * (b & 0xFFFFFFFF); \ - d = rotr64(d ^ a, 32); \ - c = c + d + 2 * (c & 0xFFFFFFFF) * (d & 0xFFFFFFFF); \ - b = rotr64(b ^ c, 24); \ - a = a + b + 2 * (a & 0xFFFFFFFF) * (b & 0xFFFFFFFF); \ - d = rotr64(d ^ a, 16); \ - c = c + d + 2 * (c & 0xFFFFFFFF) * (d & 0xFFFFFFFF); \ - b = rotr64(b ^ c, 63); \ - } while (0) - -void P( - uint64_t *a0, uint64_t *a1, uint64_t *a2, uint64_t *a3, - uint64_t *a4, uint64_t *a5, uint64_t *a6, uint64_t *a7, - uint64_t *a8, uint64_t *a9, uint64_t *a10, uint64_t *a11, - uint64_t *a12, uint64_t *a13, uint64_t *a14, uint64_t *a15 -) { - G(*a0, *a4, *a8, *a12); - G(*a1, *a5, *a9, *a13); - G(*a2, *a6, *a10, *a14); - G(*a3, *a7, *a11, *a15); - G(*a0, *a5, *a10, *a15); - G(*a1, *a6, *a11, *a12); - G(*a2, *a7, *a8, *a13); - G(*a3, *a4, *a9, *a14); -} - -uint32_t indexAlpha( - uint64_t rand, uint32_t lanes, uint32_t segments, - uint32_t parallelism, uint32_t k, uint32_t slice, - uint32_t lane, uint32_t index -) { - uint32_t rlane = ((uint32_t)(rand >> 32)) % parallelism; - - if (k == 0 && slice == 0) { - rlane = lane; - } - - uint32_t max = segments * 3; - uint32_t start = ((slice + 1) % 4) * segments; - - if (lane == rlane) { - max += index; - } - - if (k == 0) { - max = slice * segments; - start = 0; - if (slice == 0 || lane == rlane) { - max += index; - } - } - - if (index == 0 || lane == rlane) { - max--; - } - - uint64_t phi = rand & 0xFFFFFFFF; - phi = phi * phi >> 32; - phi = phi * max >> 32; - uint32_t ri = (start + max - 1 - phi) % (uint64_t)lanes; - - return rlane * lanes + ri; -} - -uint64_t t[128]; - -void block(uint64_t *z, uint64_t *a, uint64_t *b, int32_t xor) { - #pragma clang loop unroll(full) - for (int i = 0; i < 128; i++) { - t[i] = a[i] ^ b[i]; - } - - #pragma clang loop unroll(full) - for (int i = 0; i < 128; i += 16) { - P( - &t[i], &t[i + 1], &t[i + 2], &t[i + 3], &t[i + 4], &t[i + 5], &t[i + 6], &t[i + 7], - &t[i + 8], &t[i + 9], &t[i + 10], &t[i + 11], &t[i + 12], &t[i + 13], &t[i + 14], &t[i + 15] - ); - } - - #pragma clang loop unroll(full) - for (int i = 0; i < 16; i += 2) { - P( - &t[i], &t[i + 1], &t[i + 16], &t[i + 17], &t[i + 32], &t[i + 33], &t[i + 48], &t[i + 49], - &t[i + 64], &t[i + 65], &t[i + 80], &t[i + 81], &t[i + 96], &t[i + 97], &t[i + 112], &t[i + 113] - ); - } - - if (xor) { - for (int i = 0; i < 128; i++) { - z[i] ^= a[i] ^ b[i] ^ t[i]; - } - } else { - for (int i = 0; i < 128; i++) { - z[i] = a[i] ^ b[i] ^ t[i]; - } - } -} - -uint64_t addresses[128]; -uint64_t zero[128]; -uint64_t in[128]; - -WASM_EXPORT -void Hash_Calculate(uint32_t length, uint32_t memorySize) { - uint32_t *initVector = (uint32_t *)(B + 1024 * memorySize); - uint32_t parallelism = initVector[0]; - uint32_t hashLength = initVector[1]; - uint32_t memorySize2 = initVector[2]; - uint32_t iterations = initVector[3]; - uint32_t version = initVector[4]; - uint32_t hashType = initVector[5]; - if (memorySize2 != memorySize) { - return; - } - - uint32_t segments = memorySize / (parallelism * 4); - memorySize = segments * parallelism * 4; - uint32_t lanes = segments * 4; - - in[3] = memorySize; - in[4] = iterations; - in[5] = hashType; - - for (uint32_t k = 0; k < iterations; k++) { - in[0] = k; - for (uint8_t slice = 0; slice < 4; slice++) { - in[2] = slice; - for (uint32_t lane = 0; lane < parallelism; lane++) { - in[1] = lane; - in[6] = 0; - uint32_t index = 0; - if (k == 0 && slice == 0) { - index = 2; - if (hashType == 1 || hashType == 2) { - in[6]++; - block(addresses, in, zero, 0); - block(addresses, addresses, zero, 0); - } - } - uint32_t offset = lane * lanes + slice * segments + index; - while (index < segments) { - uint32_t prev = offset - 1; - if (index == 0 && slice == 0) { - prev += lanes; - } - - uint64_t rand; - if (hashType == 1 || (hashType == 2 && k == 0 && slice < 2)) { - if (index % 128 == 0) { - in[6]++; - block(addresses, in, zero, 0); - block(addresses, addresses, zero, 0); - } - rand = addresses[index % 128]; - } else { - rand = *(uint64_t *)(B + prev * 1024); - } - uint32_t newOffset = indexAlpha(rand, lanes, segments, parallelism, k, slice, lane, index); - - block( - (uint64_t *)&B[offset * 1024], - (uint64_t *)&B[prev * 1024], - (uint64_t *)&B[newOffset * 1024], - 1 - ); - index++; - offset++; - } - } - } - } - - uint32_t destIndex = (memorySize - 1) * 1024; - for (uint32_t lane = 0; lane < parallelism - 1; lane++) { - uint32_t sourceIndex = (lane * lanes + lanes - 1) * 1024; - for (uint32_t i = 0; i < 1024; i += 8) { - *(uint64_t *)&B[destIndex + i] ^= *(uint64_t *)&B[sourceIndex + i]; - } - } - - for (uint16_t i = 0; i < 1024; i += 8) { - *(uint64_t *)&B[i] = *(uint64_t *)&B[destIndex + i]; - } -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/src/bcrypt.c b/tools/mnemonic-test/node_modules/hash-wasm/src/bcrypt.c deleted file mode 100644 index f1e50d84..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/src/bcrypt.c +++ /dev/null @@ -1,787 +0,0 @@ -/* - * The crypt_blowfish homepage is: - * - * http://www.openwall.com/crypt/ - * - * This code comes from John the Ripper password cracker, with reentrant - * and crypt(3) interfaces added, but optimizations specific to password - * cracking removed. - * - * Written by Solar Designer in 1998-2014. - * No copyright is claimed, and the software is hereby placed in the public - * domain. In case this attempt to disclaim copyright and place the software - * in the public domain is deemed null and void, then the software is - * Copyright (c) 1998-2014 Solar Designer and it is hereby released to the - * general public under the following terms: - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted. - * - * There's ABSOLUTELY NO WARRANTY, express or implied. - * - * It is my intent that you should be able to use this on your system, - * as part of a software package, or anywhere else to improve security, - * ensure compatibility, or for any other purpose. I would appreciate - * it if you give credit where it is due and keep your modifications in - * the public domain as well, but I don't require that in order to let - * you place this code and any modifications you make under a license - * of your choice. - * - * This implementation is fully compatible with OpenBSD's bcrypt.c for prefix - * "$2b$", originally by Niels Provos , and it uses - * some of his ideas. The password hashing algorithm was designed by David - * Mazieres . For information on the level of - * compatibility for bcrypt hash prefixes other than "$2b$", please refer to - * the comments in BF_set_key() below and to the included crypt(3) man page. - * - * There's a paper on the algorithm that explains its design decisions: - * - * http://www.usenix.org/events/usenix99/provos.html - * - * Some of the tricks in BF_ROUND might be inspired by Eric Young's - * Blowfish library (I can't be sure if I would think of something if I - * hadn't seen his code). - * - * Modified for hash-wasm by Dani Biró - */ - -#define WITH_BUFFER -#include "hash-wasm.h" - -typedef unsigned int BF_word; -typedef signed int BF_word_signed; - -/* Number of Blowfish rounds, this is also hardcoded into a few places */ -#define BF_N 16 - -typedef BF_word BF_key[BF_N + 2]; - -typedef struct { - BF_word S[4][0x100]; - BF_key P; -} BF_ctx; - -/* - * Magic IV for 64 Blowfish encryptions that we do at the end. - * The string is "OrpheanBeholderScryDoubt" on big-endian. - */ -static BF_word BF_magic_w[6] = { - 0x4F727068, 0x65616E42, 0x65686F6C, - 0x64657253, 0x63727944, 0x6F756274 -}; - -/* - * P-box and S-box tables initialized with digits of Pi. - */ -BF_ctx ctx = { - { - { - 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, - 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, - 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, - 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, - 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee, - 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013, - 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, - 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e, - 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60, - 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, - 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, - 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a, - 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, - 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677, - 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, - 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, - 0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88, - 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239, - 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, - 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0, - 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, - 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, - 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88, - 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe, - 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, - 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d, - 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b, - 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, - 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba, - 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463, - 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, - 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09, - 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3, - 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, - 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, - 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8, - 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, - 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82, - 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db, - 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, - 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0, - 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, - 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, - 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8, - 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, - 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, - 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7, - 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c, - 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, - 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1, - 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, - 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, - 0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477, - 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf, - 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, - 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af, - 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, - 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, - 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41, - 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, - 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, - 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915, - 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, - 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a - }, { - 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, - 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, - 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, - 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, - 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6, - 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, - 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, - 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1, - 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, - 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, - 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff, - 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, - 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, - 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7, - 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, - 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, - 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf, - 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, - 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, - 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87, - 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, - 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, - 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16, - 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, - 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, - 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509, - 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, - 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, - 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f, - 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a, - 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, - 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960, - 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, - 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, - 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802, - 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, - 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, - 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf, - 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, - 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, - 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50, - 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, - 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, - 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281, - 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, - 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, - 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128, - 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, - 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, - 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0, - 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, - 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, - 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, - 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, - 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, - 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061, - 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, - 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, - 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735, - 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, - 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, - 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340, - 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, - 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7 - }, { - 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, - 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, - 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, - 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, - 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, - 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504, - 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, - 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb, - 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee, - 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, - 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42, - 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, - 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, - 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb, - 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527, - 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, - 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, - 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, - 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, - 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc, - 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17, - 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, - 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, - 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115, - 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, - 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728, - 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, - 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, - 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, - 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d, - 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, - 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, - 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, - 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, - 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, - 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c, - 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, - 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, - 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a, - 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, - 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d, - 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc, - 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, - 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61, - 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2, - 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, - 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, - 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, - 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, - 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633, - 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10, - 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, - 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, - 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027, - 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, - 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62, - 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, - 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, - 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, - 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc, - 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, - 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, - 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, - 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0 - }, { - 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, - 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, - 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, - 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, - 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8, - 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6, - 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, - 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22, - 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, - 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, - 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9, - 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59, - 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, - 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51, - 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, - 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, - 0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b, - 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, - 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, - 0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd, - 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a, - 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, - 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb, - 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, - 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, - 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32, - 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680, - 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, - 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, - 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, - 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, - 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47, - 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, - 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, - 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84, - 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048, - 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, - 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd, - 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, - 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, - 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38, - 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f, - 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, - 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525, - 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1, - 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, - 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964, - 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, - 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, - 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d, - 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f, - 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, - 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02, - 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, - 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, - 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a, - 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, - 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, - 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, - 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060, - 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, - 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9, - 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, - 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6 - } - }, { - 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, - 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, - 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, - 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, - 0x9216d5d9, 0x8979fb1b - } -}; - -static unsigned char BF_itoa64[64 + 1] = - "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; - -static unsigned char BF_atoi64[0x60] = { - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 0, 1, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 64, 64, 64, 64, 64, - 64, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 64, 64, 64, 64, 64, - 64, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 64, 64, 64, 64, 64 -}; - -union { - BF_word LR[2]; - uint64_t LR64; -} block; - -// EM_JS(void, print_memory, (uint32_t offset, uint32_t len), { -// console.log(x); -// }); - -#define BF_safe_atoi64(dst, src) \ -{ \ - tmp = (unsigned char)(src); \ - if ((unsigned int)(tmp -= 0x20) >= 0x60) return -1; \ - tmp = BF_atoi64[tmp]; \ - if (tmp > 63) return -1; \ - (dst) = tmp; \ -} - -static int BF_decode(BF_word *dst, const char *src, int size) -{ - unsigned char *dptr = (unsigned char *)dst; - unsigned char *end = dptr + size; - const unsigned char *sptr = (const unsigned char *)src; - unsigned int tmp, c1, c2, c3, c4; - - do { - BF_safe_atoi64(c1, *sptr++); - BF_safe_atoi64(c2, *sptr++); - *dptr++ = (c1 << 2) | ((c2 & 0x30) >> 4); - if (dptr >= end) break; - - BF_safe_atoi64(c3, *sptr++); - *dptr++ = ((c2 & 0x0F) << 4) | ((c3 & 0x3C) >> 2); - if (dptr >= end) break; - - BF_safe_atoi64(c4, *sptr++); - *dptr++ = ((c3 & 0x03) << 6) | c4; - } while (dptr < end); - - return 0; -} - -static void BF_encode(char *dst, const BF_word *src, int size) -{ - const unsigned char *sptr = (const unsigned char *)src; - const unsigned char *end = sptr + size; - unsigned char *dptr = (unsigned char *)dst; - unsigned int c1, c2; - - do { - c1 = *sptr++; - *dptr++ = BF_itoa64[c1 >> 2]; - c1 = (c1 & 0x03) << 4; - if (sptr >= end) { - *dptr++ = BF_itoa64[c1]; - break; - } - - c2 = *sptr++; - c1 |= c2 >> 4; - *dptr++ = BF_itoa64[c1]; - c1 = (c2 & 0x0f) << 2; - if (sptr >= end) { - *dptr++ = BF_itoa64[c1]; - break; - } - - c2 = *sptr++; - c1 |= c2 >> 6; - *dptr++ = BF_itoa64[c1]; - *dptr++ = BF_itoa64[c2 & 0x3f]; - } while (sptr < end); -} - -static void BF_swap(BF_word *x, int count) -{ - BF_word tmp; - - do { - tmp = *x; - tmp = (tmp << 16) | (tmp >> 16); - *x++ = ((tmp & 0x00FF00FF) << 8) | ((tmp >> 8) & 0x00FF00FF); - } while (--count); -} - -#define BF_ROUND(L, R, N) \ - tmp1 = ctx.S[3][L & 0xFF]; \ - tmp2 = ctx.S[2][(L >> 8) & 0xFF]; \ - tmp3 = ctx.S[1][(L >> 16) & 0xFF]; \ - tmp3 += ctx.S[0][L >> 24]; \ - tmp3 ^= tmp2; \ - R ^= ctx.P[N + 1]; \ - tmp3 += tmp1; \ - R ^= tmp3; - -/* - * Encrypt one block, BF_N is hardcoded here. - */ -#define BF_ENCRYPT \ - block.LR[0] ^= ctx.P[0]; \ - BF_ROUND(block.LR[0], block.LR[1], 0); \ - BF_ROUND(block.LR[1], block.LR[0], 1); \ - BF_ROUND(block.LR[0], block.LR[1], 2); \ - BF_ROUND(block.LR[1], block.LR[0], 3); \ - BF_ROUND(block.LR[0], block.LR[1], 4); \ - BF_ROUND(block.LR[1], block.LR[0], 5); \ - BF_ROUND(block.LR[0], block.LR[1], 6); \ - BF_ROUND(block.LR[1], block.LR[0], 7); \ - BF_ROUND(block.LR[0], block.LR[1], 8); \ - BF_ROUND(block.LR[1], block.LR[0], 9); \ - BF_ROUND(block.LR[0], block.LR[1], 10); \ - BF_ROUND(block.LR[1], block.LR[0], 11); \ - BF_ROUND(block.LR[0], block.LR[1], 12); \ - BF_ROUND(block.LR[1], block.LR[0], 13); \ - BF_ROUND(block.LR[0], block.LR[1], 14); \ - BF_ROUND(block.LR[1], block.LR[0], 15); \ - tmp4 = block.LR[1]; \ - block.LR[1] = block.LR[0]; \ - block.LR[0] = tmp4 ^ ctx.P[BF_N + 1]; - -#define BF_body() \ - block.LR64 = 0; \ - ptr = ctx.P; \ - do { \ - ptr += 2; \ - BF_ENCRYPT; \ - *(ptr - 2) = block.LR[0]; \ - *(ptr - 1) = block.LR[1]; \ - } while (ptr < &ctx.P[BF_N + 2]); \ -\ - ptr = ctx.S[0]; \ - do { \ - ptr += 2; \ - BF_ENCRYPT; \ - *(ptr - 2) = block.LR[0]; \ - *(ptr - 1) = block.LR[1]; \ - } while (ptr < &ctx.S[3][0xFF]); - -static void BF_set_key(const char *key, BF_key expanded, BF_key initial, - unsigned char flags) -{ - const char *ptr = key; - unsigned int bug, i, j; - BF_word safety, sign, diff, tmp[2]; - -/* - * There was a sign extension bug in older revisions of this function. While - * we would have liked to simply fix the bug and move on, we have to provide - * a backwards compatibility feature (essentially the bug) for some systems and - * a safety measure for some others. The latter is needed because for certain - * multiple inputs to the buggy algorithm there exist easily found inputs to - * the correct algorithm that produce the same hash. Thus, we optionally - * deviate from the correct algorithm just enough to avoid such collisions. - * While the bug itself affected the majority of passwords containing - * characters with the 8th bit set (although only a percentage of those in a - * collision-producing way), the anti-collision safety measure affects - * only a subset of passwords containing the '\xff' character (not even all of - * those passwords, just some of them). This character is not found in valid - * UTF-8 sequences and is rarely used in popular 8-bit character encodings. - * Thus, the safety measure is unlikely to cause much annoyance, and is a - * reasonable tradeoff to use when authenticating against existing hashes that - * are not reliably known to have been computed with the correct algorithm. - * - * We use an approach that tries to minimize side-channel leaks of password - * information - that is, we mostly use fixed-cost bitwise operations instead - * of branches or table lookups. (One conditional branch based on password - * length remains. It is not part of the bug aftermath, though, and is - * difficult and possibly unreasonable to avoid given the use of C strings by - * the caller, which results in similar timing leaks anyway.) - * - * For actual implementation, we set an array index in the variable "bug" - * (0 means no bug, 1 means sign extension bug emulation) and a flag in the - * variable "safety" (bit 16 is set when the safety measure is requested). - * Valid combinations of settings are: - * - * Prefix "$2a$": bug = 0, safety = 0x10000 - * Prefix "$2b$": bug = 0, safety = 0 - * Prefix "$2x$": bug = 1, safety = 0 - * Prefix "$2y$": bug = 0, safety = 0 - */ - bug = (unsigned int)flags & 1; - safety = ((BF_word)flags & 2) << 15; - - sign = diff = 0; - - for (i = 0; i < BF_N + 2; i++) { - tmp[0] = tmp[1] = 0; - for (j = 0; j < 4; j++) { - tmp[0] <<= 8; - tmp[0] |= (unsigned char)*ptr; /* correct */ - tmp[1] <<= 8; - tmp[1] |= (BF_word_signed)(signed char)*ptr; /* bug */ -/* - * Sign extension in the first char has no effect - nothing to overwrite yet, - * and those extra 24 bits will be fully shifted out of the 32-bit word. For - * chars 2, 3, 4 in each four-char block, we set bit 7 of "sign" if sign - * extension in tmp[1] occurs. Once this flag is set, it remains set. - */ - if (j) - sign |= tmp[1] & 0x80; - if (!*ptr) - ptr = key; - else - ptr++; - } - diff |= tmp[0] ^ tmp[1]; /* Non-zero on any differences */ - - expanded[i] = tmp[bug]; - initial[i] = ctx.P[i] ^ tmp[bug]; - } - -/* - * At this point, "diff" is zero iff the correct and buggy algorithms produced - * exactly the same result. If so and if "sign" is non-zero, which indicates - * that there was a non-benign sign extension, this means that we have a - * collision between the correctly computed hash for this password and a set of - * passwords that could be supplied to the buggy algorithm. Our safety measure - * is meant to protect from such many-buggy to one-correct collisions, by - * deviating from the correct algorithm in such cases. Let's check for this. - */ - diff |= diff >> 16; /* still zero iff exact match */ - diff &= 0xffff; /* ditto */ - diff += 0xffff; /* bit 16 set iff "diff" was non-zero (on non-match) */ - sign <<= 9; /* move the non-benign sign extension flag to bit 16 */ - sign &= ~diff & safety; /* action needed? */ - -/* - * If we have determined that we need to deviate from the correct algorithm, - * flip bit 16 in initial expanded key. (The choice of 16 is arbitrary, but - * let's stick to it now. It came out of the approach we used above, and it's - * not any worse than any other choice we could make.) - * - * It is crucial that we don't do the same to the expanded key used in the main - * Eksblowfish loop. By doing it to only one of these two, we deviate from a - * state that could be directly specified by a password to the buggy algorithm - * (and to the fully correct one as well, but that's a side-effect). - */ - initial[0] ^= sign; -} - -static const unsigned char flags_by_subtype[26] = - {2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0}; - -static char *BF_crypt(const char *key, const char *setting, - char *output, int size, - BF_word min, int should_encode) -{ - BF_key expanded_key; - union { - BF_word salt[4]; - BF_word output[6]; - } binary; - BF_word tmp1, tmp2, tmp3, tmp4; - BF_word *ptr; - uint64_t *ptr64; - BF_word count; - int i; - - count = (BF_word)1 << ((setting[4] - '0') * 10 + (setting[5] - '0')); - if (count < min || BF_decode(binary.salt, &setting[7], 16)) { - return NULL; - } - BF_swap(binary.salt, 4); - - BF_set_key(key, expanded_key, ctx.P, - flags_by_subtype[(unsigned int)(unsigned char)setting[2] - 'a']); - - block.LR64 = 0; - for (i = 0; i < BF_N + 2; i += 2) { - block.LR64 ^= *(uint64_t*)&binary.salt[i & 2]; - BF_ENCRYPT; - *(uint64_t*)&ctx.P[i] = block.LR64; - } - - ptr = ctx.S[0]; - do { - ptr += 4; - block.LR[0] ^= binary.salt[(BF_N + 2) & 3]; - block.LR[1] ^= binary.salt[(BF_N + 3) & 3]; - BF_ENCRYPT; - *(ptr - 4) = block.LR[0]; - *(ptr - 3) = block.LR[1]; - - block.LR[0] ^= binary.salt[(BF_N + 4) & 3]; - block.LR[1] ^= binary.salt[(BF_N + 5) & 3]; - BF_ENCRYPT; - *(ptr - 2) = block.LR[0]; - *(ptr - 1) = block.LR[1]; - } while (ptr < &ctx.S[3][0xFF]); - - do { - int done; - - for (i = 0; i < BF_N + 2; i += 2) { - ctx.P[i] ^= expanded_key[i]; - ctx.P[i + 1] ^= expanded_key[i + 1]; - } - - done = 0; - uint64_t tmp1x = ((uint64_t*)binary.salt)[0]; - uint64_t tmp3x = ((uint64_t*)binary.salt)[1]; - do { - BF_body(); - if (done) - break; - done = 1; - - for (i = 0; i < BF_N; i += 4) { - *(uint64_t*)(&ctx.P[i]) ^= tmp1x; - *(uint64_t*)(&ctx.P[i + 2]) ^= tmp3x; - } - *(uint64_t*)(&ctx.P[16]) ^= tmp1x; - } while (1); - } while (--count); - - for (i = 0; i < 6; i += 2) { - block.LR64 = *(uint64_t*)&BF_magic_w[i]; - - count = 64; - do { - BF_ENCRYPT; - } while (--count); - - *(uint64_t*)&(binary.output[i]) = block.LR64; - } - - // memcpy(output, setting, 7 + 22 - 1); - for (uint8_t z = 0; z < 7; z++) { - ((uint32_t*)output)[z] = ((uint32_t*)setting)[z]; - } - - output[28] = BF_itoa64[(int) - BF_atoi64[(int)setting[28] - 0x20] & 0x30]; - -/* This has to be bug-compatible with the original implementation, so - * only encode 23 of the 24 bytes. :-) */ - BF_swap(binary.output, 6); - - if (should_encode) { - BF_encode(&output[7 + 22], binary.output, 23); - } else { - uint8_t *source = (uint8_t*)binary.output; - for (uint8_t z = 0; z < 3; z++) { - ((uint64_t*)output)[z] = ((uint64_t*)source)[z]; - } - } - output[7 + 22 + 31] = '\0'; - - return output; -} - -int _crypt_output_magic(const char *setting, char *output, int size) -{ - if (size < 3) - return -1; - - output[0] = '*'; - output[1] = '0'; - output[2] = '\0'; - - if (setting[0] == '*' && setting[1] == '0') - output[1] = '1'; - - return 0; -} - -char *_crypt_blowfish_rn(const char *key, const char *setting, - char *output, int size, int should_encode) -{ - _crypt_output_magic(setting, output, size); - return BF_crypt(key, setting, output, size, 16, should_encode); -} - -char *_crypt_gensalt_blowfish_rn(const char *prefix, unsigned long count, - const char *input, char *output) -{ - output[0] = '$'; - output[1] = '2'; - output[2] = prefix[2]; - output[3] = '$'; - output[4] = '0' + count / 10; - output[5] = '0' + count % 10; - output[6] = '$'; - - BF_encode(&output[7], (const BF_word *)input, 16); - output[7 + 22] = '\0'; - - return output; -} - -WASM_EXPORT -void bcrypt(uint32_t password_length, uint32_t cost_factor, uint32_t should_encode) { - uint8_t *salt = &main_buffer[0]; - uint8_t *key = &main_buffer[16]; - key[password_length] = 0; - - uint8_t setting[30]; - _crypt_gensalt_blowfish_rn("$2a", cost_factor, (char*)salt, (char*)setting); - - uint8_t output[60]; - _crypt_blowfish_rn((char*)key, (char*)setting, (char*)output, 60, should_encode); - - for (uint8_t i = 0; i < 60; i++) { - main_buffer[i] = output[i]; - } -} - -WASM_EXPORT -uint32_t bcrypt_verify(uint32_t passwordLength) { - uint8_t *hash = &main_buffer[0]; - uint8_t *key = &main_buffer[60]; - key[passwordLength] = 0; - - uint8_t output[60]; - _crypt_blowfish_rn((char*)key, (char*)main_buffer, (char*)output, 60, 1); - - // 0-28 => setting - // 29-59 => hash - - uint8_t res = 0; - uint64_t *out64 = (uint64_t*)&output[28]; - uint64_t *hash64 = (uint64_t*)&hash[28]; - for (uint8_t i = 0; i < 4; i++) { - res += out64[i] != hash64[i]; - } - return res == 0; -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/src/blake2b.c b/tools/mnemonic-test/node_modules/hash-wasm/src/blake2b.c deleted file mode 100644 index 4b37641d..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/src/blake2b.c +++ /dev/null @@ -1,298 +0,0 @@ -/* - BLAKE2 reference source code package - reference C implementations - Copyright 2012, Samuel Neves . You may use this under the - terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at - your option. The terms of these licenses can be found at: - - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 - - OpenSSL license : https://www.openssl.org/source/license.html - - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 - - More information about the BLAKE2 hash function can be found at - https://blake2.net. - - Modified for hash-wasm by Dani Biró -*/ - -#define WITH_BUFFER -#include "hash-wasm.h" - -#define BLAKE2_PACKED(x) x __attribute__((packed)) - -enum blake2b_constant { - BLAKE2B_BLOCKBYTES = 128, - BLAKE2B_OUTBYTES = 64, - BLAKE2B_KEYBYTES = 64, - BLAKE2B_SALTBYTES = 16, - BLAKE2B_PERSONALBYTES = 16 -}; - -typedef struct blake2b_state__ { - uint64_t h[8]; - uint64_t t[2]; - uint64_t f[2]; - uint8_t buf[BLAKE2B_BLOCKBYTES]; - int buflen; - int outlen; - uint8_t last_node; -} blake2b_state; - -blake2b_state S[1]; - -BLAKE2_PACKED(struct blake2b_param__ { - uint8_t digest_length; /* 1 */ - uint8_t key_length; /* 2 */ - uint8_t fanout; /* 3 */ - uint8_t depth; /* 4 */ - uint32_t leaf_length; /* 8 */ - uint32_t node_offset; /* 12 */ - uint32_t xof_length; /* 16 */ - uint8_t node_depth; /* 17 */ - uint8_t inner_length; /* 18 */ - uint8_t reserved[14]; /* 32 */ - uint8_t salt[BLAKE2B_SALTBYTES]; /* 48 */ - uint8_t personal[BLAKE2B_PERSONALBYTES]; /* 64 */ -}); - -typedef struct blake2b_param__ blake2b_param; - -blake2b_param P[1]; - -static __inline__ uint64_t load64(const void *src) { - return *(uint64_t *)src; -} - -static __inline__ void store64(void *dst, uint64_t w) { - *(uint64_t *)dst = w; -} - -static __inline__ uint64_t rotr64(const uint64_t w, const unsigned c) { - return (w >> c) | (w << (64 - c)); -} - -static const uint64_t blake2b_IV[8] = { - 0x6a09e667f3bcc908ULL, 0xbb67ae8584caa73bULL, - 0x3c6ef372fe94f82bULL, 0xa54ff53a5f1d36f1ULL, - 0x510e527fade682d1ULL, 0x9b05688c2b3e6c1fULL, - 0x1f83d9abfb41bd6bULL, 0x5be0cd19137e2179ULL -}; - -static const uint8_t blake2b_sigma[12][16] = { - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, - { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }, - { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 }, - { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 }, - { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 }, - { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 }, - { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 }, - { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 }, - { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 }, - { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13 , 0 }, - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, - { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } -}; - -static __inline__ void blake2b_set_lastnode() { S->f[1] = (uint64_t)-1; } - -/* Some helper functions, not necessarily useful */ -static __inline__ int blake2b_is_lastblock() { return S->f[0] != 0; } - -static __inline__ void blake2b_set_lastblock() { - if (S->last_node) blake2b_set_lastnode(); - - S->f[0] = (uint64_t)-1; -} - -static __inline__ void blake2b_increment_counter(const uint64_t inc) { - S->t[0] += inc; - S->t[1] += (S->t[0] < inc); -} - -#define G(r, i, a, b, c, d) \ - do { \ - a = a + b + m[blake2b_sigma[r][2 * i + 0]]; \ - d = rotr64(d ^ a, 32); \ - c = c + d; \ - b = rotr64(b ^ c, 24); \ - a = a + b + m[blake2b_sigma[r][2 * i + 1]]; \ - d = rotr64(d ^ a, 16); \ - c = c + d; \ - b = rotr64(b ^ c, 63); \ - } while (0) - -static void round(uint32_t r, uint64_t m[16], uint64_t v[16]) { - G(r, 0, v[0], v[4], v[8], v[12]); - G(r, 1, v[1], v[5], v[9], v[13]); - G(r, 2, v[2], v[6], v[10], v[14]); - G(r, 3, v[3], v[7], v[11], v[15]); - G(r, 4, v[0], v[5], v[10], v[15]); - G(r, 5, v[1], v[6], v[11], v[12]); - G(r, 6, v[2], v[7], v[8], v[13]); - G(r, 7, v[3], v[4], v[9], v[14]); -}; - -static void blake2b_compress(const uint8_t block[BLAKE2B_BLOCKBYTES]) { - uint64_t m[16]; - uint64_t v[16]; - - #pragma clang loop unroll(full) - for (int i = 0; i < 16; ++i) { - m[i] = load64(block + i * sizeof(m[i])); - } - - #pragma clang loop unroll(full) - for (int i = 0; i < 8; ++i) { - v[i] = S->h[i]; - } - - v[8] = blake2b_IV[0]; - v[9] = blake2b_IV[1]; - v[10] = blake2b_IV[2]; - v[11] = blake2b_IV[3]; - v[12] = blake2b_IV[4] ^ S->t[0]; - v[13] = blake2b_IV[5] ^ S->t[1]; - v[14] = blake2b_IV[6] ^ S->f[0]; - v[15] = blake2b_IV[7] ^ S->f[1]; - - #pragma clang loop unroll(full) - for (int i = 0; i < 12; ++i) { - round(i, m, v); - } - - #pragma clang loop unroll(full) - for (int i = 0; i < 8; ++i) { - S->h[i] = S->h[i] ^ v[i] ^ v[i + 8]; - } -} - -#undef G - -void blake2b_update(const void *pin, int inlen) { - const unsigned char *in = (const unsigned char *)pin; - if (inlen > 0) { - int left = S->buflen; - int fill = BLAKE2B_BLOCKBYTES - left; - if (inlen > fill) { - S->buflen = 0; - /* Fill buffer */ - for (uint8_t i = 0; i < fill; i++) { - S->buf[left + i] = in[i]; - } - blake2b_increment_counter(BLAKE2B_BLOCKBYTES); - blake2b_compress(S->buf); /* Compress */ - in += fill; - inlen -= fill; - while (inlen > BLAKE2B_BLOCKBYTES) { - blake2b_increment_counter(BLAKE2B_BLOCKBYTES); - blake2b_compress(in); - in += BLAKE2B_BLOCKBYTES; - inlen -= BLAKE2B_BLOCKBYTES; - } - } - for (uint8_t i = 0; i < inlen; i++) { - S->buf[S->buflen + i] = in[i]; - } - S->buflen += inlen; - } -} - -WASM_EXPORT -void Hash_Final() { - int outlen = S->outlen; - uint8_t buffer[BLAKE2B_OUTBYTES] = {0}; - - if (blake2b_is_lastblock()) { - return; - } - - blake2b_increment_counter(S->buflen); - blake2b_set_lastblock(); - for (int i = 0; i < BLAKE2B_BLOCKBYTES - S->buflen; i++) { /* Padding */ - (S->buf + S->buflen)[i] = 0; - } - blake2b_compress(S->buf); - - for (int i = 0; i < 8; ++i) { - /* Output full hash to temp buffer */ - store64(buffer + sizeof(S->h[i]) * i, S->h[i]); - } - - for (uint8_t i = 0; i < S->outlen; i++) { - main_buffer[i] = buffer[i]; - } -} - -static void blake2b_init0() { - memset(S, 0, sizeof(blake2b_state)); - - for (int i = 0; i < 8; ++i) { - S->h[i] = blake2b_IV[i]; - } -} - -/* init xors IV with input parameter block */ -void blake2b_init_param() { - const uint8_t *p = (const uint8_t *)(P); - int i; - - blake2b_init0(); - - /* IV XOR ParamBlock */ - for (i = 0; i < 8; ++i) { - S->h[i] ^= load64(p + sizeof(S->h[i]) * i); - } - - S->outlen = P->digest_length; -} - -void blake2b_init_key(int outlen, const uint8_t *key, int keylen) { - P->digest_length = (uint8_t)outlen; - P->key_length = (uint8_t)keylen; - P->fanout = 1; - P->depth = 1; - // P->leaf_length = 0; - // P->node_offset = 0; - // P->xof_length = 0; - // P->node_depth = 0; - // P->inner_length = 0; - // memset(P->reserved, 0, sizeof(P->reserved)); - // memset(P->salt, 0, sizeof(P->salt)); - // memset(P->personal, 0, sizeof(P->personal)); - - blake2b_init_param(); - - if (keylen > 0) { - uint8_t block[BLAKE2B_BLOCKBYTES]; - memset128(block, 0); - for (uint8_t i = 0; i < keylen; i++) { - block[i] = key[i]; - } - blake2b_update(block, BLAKE2B_BLOCKBYTES); - } -} - -WASM_EXPORT -void Hash_Init(uint32_t bits) { - int outlen = bits & 0xFFFF; - int keylen = bits >> 16; - blake2b_init_key(outlen / 8, main_buffer, keylen); -} - -WASM_EXPORT -void Hash_Update(uint32_t size) { - blake2b_update(main_buffer, size); -} - -WASM_EXPORT -const uint32_t STATE_SIZE = sizeof(S); - -WASM_EXPORT -uint8_t* Hash_GetState() { - return (uint8_t*) S; -} - -WASM_EXPORT -void Hash_Calculate(uint32_t length, uint32_t initParam) { - Hash_Init(initParam); - Hash_Update(length); - Hash_Final(); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/src/blake2s.c b/tools/mnemonic-test/node_modules/hash-wasm/src/blake2s.c deleted file mode 100644 index 26b3afe5..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/src/blake2s.c +++ /dev/null @@ -1,284 +0,0 @@ -/* - BLAKE2 reference source code package - reference C implementations - Copyright 2012, Samuel Neves . You may use this under the - terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at - your option. The terms of these licenses can be found at: - - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 - - OpenSSL license : https://www.openssl.org/source/license.html - - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 - - More information about the BLAKE2 hash function can be found at - https://blake2.net. - - Modified for hash-wasm by Dani Biró -*/ - -#define WITH_BUFFER -#include "hash-wasm.h" - -#define BLAKE2_PACKED(x) x __attribute__((packed)) - -enum blake2s_constant { - BLAKE2S_BLOCKBYTES = 64, - BLAKE2S_OUTBYTES = 32, - BLAKE2S_KEYBYTES = 32, - BLAKE2S_SALTBYTES = 8, - BLAKE2S_PERSONALBYTES = 8 -}; - -typedef struct blake2s_state__ { - uint32_t h[8]; - uint32_t t[2]; - uint32_t f[2]; - uint8_t buf[BLAKE2S_BLOCKBYTES]; - int buflen; - int outlen; - uint8_t last_node; -} blake2s_state; - -blake2s_state S[1]; - -BLAKE2_PACKED(struct blake2s_param__ { - uint8_t digest_length; /* 1 */ - uint8_t key_length; /* 2 */ - uint8_t fanout; /* 3 */ - uint8_t depth; /* 4 */ - uint32_t leaf_length; /* 8 */ - uint32_t node_offset; /* 12 */ - uint16_t xof_length; /* 14 */ - uint8_t node_depth; /* 15 */ - uint8_t inner_length; /* 16 */ - uint8_t salt[BLAKE2S_SALTBYTES]; /* 24 */ - uint8_t personal[BLAKE2S_PERSONALBYTES]; /* 32 */ -}); - -typedef struct blake2s_param__ blake2s_param; - -blake2s_param P[1]; - -static __inline__ uint32_t load32(const void *src) { - return *(uint32_t *)src; -} - -static __inline__ void store32(void *dst, uint32_t w) { - *(uint32_t *)dst = w; -} - -static __inline__ uint64_t rotr32(const uint32_t w, const unsigned c) { - return (w >> c) | (w << (32 - c)); -} - -static const uint32_t blake2s_IV[8] = { - 0x6A09E667UL, 0xBB67AE85UL, 0x3C6EF372UL, 0xA54FF53AUL, - 0x510E527FUL, 0x9B05688CUL, 0x1F83D9ABUL, 0x5BE0CD19UL -}; - -static const uint8_t blake2s_sigma[10][16] = { - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } , - { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } , - { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 } , - { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 } , - { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 } , - { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 } , - { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 } , - { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 } , - { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 } , - { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13 , 0 } -}; - -static __inline__ void blake2s_set_lastnode() { S->f[1] = (uint32_t)-1; } - -/* Some helper functions, not necessarily useful */ -static __inline__ int blake2s_is_lastblock() { return S->f[0] != 0; } - -static __inline__ void blake2s_set_lastblock() { - if (S->last_node) blake2s_set_lastnode(); - - S->f[0] = (uint32_t)-1; -} - -static __inline__ void blake2s_increment_counter(const uint32_t inc) { - S->t[0] += inc; - S->t[1] += (S->t[0] < inc); -} - -#define G(r, i, a, b, c, d) \ - do { \ - a = a + b + m[blake2s_sigma[r][2 * i + 0]]; \ - d = rotr32(d ^ a, 16); \ - c = c + d; \ - b = rotr32(b ^ c, 12); \ - a = a + b + m[blake2s_sigma[r][2 * i + 1]]; \ - d = rotr32(d ^ a, 8); \ - c = c + d; \ - b = rotr32(b ^ c, 7); \ - } while (0) - -static void round(uint32_t r, uint32_t m[16], uint32_t v[16]) { - G(r, 0, v[0], v[4], v[8], v[12]); - G(r, 1, v[1], v[5], v[9], v[13]); - G(r, 2, v[2], v[6], v[10], v[14]); - G(r, 3, v[3], v[7], v[11], v[15]); - G(r, 4, v[0], v[5], v[10], v[15]); - G(r, 5, v[1], v[6], v[11], v[12]); - G(r, 6, v[2], v[7], v[8], v[13]); - G(r, 7, v[3], v[4], v[9], v[14]); -} - -static void blake2s_compress(const uint8_t block[BLAKE2S_BLOCKBYTES]) { - uint32_t m[16]; - uint32_t v[16]; - - memcpy64(m, block); - - memcpy32(v, S->h); - - uint64_t* v64 = (uint64_t*)v; - uint64_t* blake2s_IV64 = (uint64_t*)blake2s_IV; - uint64_t* st64 = (uint64_t*)S->t; - uint64_t* sf64 = (uint64_t*)S->f; - v64[4] = blake2s_IV64[0]; - v64[5] = blake2s_IV64[1]; - v64[6] = blake2s_IV64[2] ^ st64[0]; - v64[7] = blake2s_IV64[3] ^ sf64[0]; - - #pragma clang loop unroll(full) - for (int i = 0; i < 10; ++i) { - round(i, m, v); - } - - uint64_t* sh64 = (uint64_t*)S->h; - #pragma clang loop unroll(full) - for (int i = 0; i < 4; ++i) { - sh64[i] = sh64[i] ^ v64[i] ^ v64[i + 4]; - } -} - -#undef G - -void blake2s_update(const void *pin, int inlen) { - const unsigned char *in = (const unsigned char *)pin; - if (inlen > 0) { - int left = S->buflen; - int fill = BLAKE2S_BLOCKBYTES - left; - if (inlen > fill) { - S->buflen = 0; - /* Fill buffer */ - memcpy(&S->buf[left], in, fill); - blake2s_increment_counter(BLAKE2S_BLOCKBYTES); - blake2s_compress(S->buf); /* Compress */ - in += fill; - inlen -= fill; - while (inlen > BLAKE2S_BLOCKBYTES) { - blake2s_increment_counter(BLAKE2S_BLOCKBYTES); - blake2s_compress(in); - in += BLAKE2S_BLOCKBYTES; - inlen -= BLAKE2S_BLOCKBYTES; - } - } - memcpy(&S->buf[S->buflen], in, inlen); - S->buflen += inlen; - } -} - -WASM_EXPORT -void Hash_Final() { - int outlen = S->outlen; - uint8_t buffer[BLAKE2S_OUTBYTES] = {0}; - - if (blake2s_is_lastblock()) { - return; - } - - blake2s_increment_counter(S->buflen); - blake2s_set_lastblock(); - for (int i = 0; i < BLAKE2S_BLOCKBYTES - S->buflen; i++) { /* Padding */ - (S->buf + S->buflen)[i] = 0; - } - blake2s_compress(S->buf); - - for (int i = 0; i < 8; ++i) { - /* Output full hash to temp buffer */ - store32(buffer + sizeof(S->h[i]) * i, S->h[i]); - } - - for (uint8_t i = 0; i < S->outlen; i++) { - main_buffer[i] = buffer[i]; - } -} - -static void blake2s_init0() { - for (int i = 0; i < sizeof(blake2s_state); i++) { - ((uint8_t*)S)[i] = 0; - } - - for (int i = 0; i < 8; ++i) { - S->h[i] = blake2s_IV[i]; - } -} - -/* init xors IV with input parameter block */ -void blake2s_init_param() { - const uint8_t *p = (const uint8_t *)(P); - - blake2s_init0(); - - /* IV XOR ParamBlock */ - for (int i = 0; i < 8; ++i) { - S->h[i] ^= load32(p + sizeof(S->h[i]) * i); - } - - S->outlen = P->digest_length; -} - -void blake2s_init_key(int outlen, const uint8_t *key, int keylen) { - P->digest_length = (uint8_t)outlen; - P->key_length = (uint8_t)keylen; - P->fanout = 1; - P->depth = 1; - // P->leaf_length = 0; - // P->node_offset = 0; - // P->xof_length = 0; - // P->node_depth = 0; - // P->inner_length = 0; - // memset(P->reserved, 0, sizeof(P->reserved)); - // memset(P->salt, 0, sizeof(P->salt)); - // memset(P->personal, 0, sizeof(P->personal)); - - blake2s_init_param(); - - if (keylen > 0) { - uint8_t block[BLAKE2S_BLOCKBYTES] = { 0 }; - for (uint8_t i = 0; i < keylen; i++) { - block[i] = key[i]; - } - blake2s_update(block, BLAKE2S_BLOCKBYTES); - } -} - -WASM_EXPORT -void Hash_Init(uint32_t bits) { - int outlen = bits & 0xFFFF; - int keylen = bits >> 16; - blake2s_init_key(outlen / 8, main_buffer, keylen); -} - -WASM_EXPORT -void Hash_Update(uint32_t size) { - blake2s_update(main_buffer, size); -} - -WASM_EXPORT -const uint32_t STATE_SIZE = sizeof(S); - -WASM_EXPORT -uint8_t* Hash_GetState() { - return (uint8_t*) S; -} - -WASM_EXPORT -void Hash_Calculate(uint32_t length, uint32_t initParam) { - Hash_Init(initParam); - Hash_Update(length); - Hash_Final(); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/src/blake3.c b/tools/mnemonic-test/node_modules/hash-wasm/src/blake3.c deleted file mode 100644 index b234a878..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/src/blake3.c +++ /dev/null @@ -1,867 +0,0 @@ -/* - BLAKE3 - reference C implementation - https://github.com/BLAKE3-team/BLAKE3 - This work is released into the public domain with CC0 1.0. Alternatively, it - is licensed under the Apache License 2.0. - - Modified for hash-wasm by Dani Biró -*/ - -#define WITH_BUFFER -#include -#include - -#include "hash-wasm.h" - -#define BLAKE3_VERSION_STRING "0.3.7" -#define BLAKE3_KEY_LEN 32 -#define BLAKE3_OUT_LEN 32 -#define BLAKE3_BLOCK_LEN 64 -#define BLAKE3_CHUNK_LEN 1024 -#define BLAKE3_MAX_DEPTH 54 -#define MAX_SIMD_DEGREE 1 -#define MAX_SIMD_DEGREE_OR_2 (MAX_SIMD_DEGREE > 2 ? MAX_SIMD_DEGREE : 2) -#define bool uint8_t -#define true 1 -#define false 0 - -enum blake3_flags { - CHUNK_START = 1 << 0, - CHUNK_END = 1 << 1, - PARENT = 1 << 2, - ROOT = 1 << 3, - KEYED_HASH = 1 << 4, - DERIVE_KEY_CONTEXT = 1 << 5, - DERIVE_KEY_MATERIAL = 1 << 6, -}; - -static const uint32_t IV[8] = - { - 0x6A09E667UL, 0xBB67AE85UL, 0x3C6EF372UL, - 0xA54FF53AUL, 0x510E527FUL, 0x9B05688CUL, - 0x1F83D9ABUL, 0x5BE0CD19UL - }; - -static const uint8_t MSG_SCHEDULE[7][16] = { - {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, - {2, 6, 3, 10, 7, 0, 4, 13, 1, 11, 12, 5, 9, 14, 15, 8}, - {3, 4, 10, 12, 13, 2, 7, 14, 6, 5, 9, 0, 11, 15, 8, 1}, - {10, 7, 12, 9, 14, 3, 13, 15, 4, 0, 11, 2, 5, 8, 1, 6}, - {12, 13, 9, 11, 15, 10, 14, 8, 7, 2, 5, 3, 0, 1, 6, 4}, - {9, 14, 11, 5, 8, 12, 15, 1, 13, 3, 0, 10, 2, 6, 4, 7}, - {11, 15, 5, 0, 1, 9, 8, 6, 14, 10, 2, 12, 3, 4, 7, 13}, -}; - -size_t blake3_simd_degree(void) { return 1; } - -// This struct is a private implementation detail. It has to be here because -// it's part of blake3_hasher below. -typedef struct { - uint32_t cv[8]; - uint64_t chunk_counter; - uint8_t buf[BLAKE3_BLOCK_LEN]; - uint8_t buf_len; - uint8_t blocks_compressed; - uint8_t flags; -} blake3_chunk_state; - -typedef struct { - uint32_t key[8]; - blake3_chunk_state chunk; - uint8_t cv_stack_len; - // The stack size is MAX_DEPTH + 1 because we do lazy merging. For example, - // with 7 chunks, we have 3 entries in the stack. Adding an 8th chunk - // requires a 4th entry, rather than merging everything down to 1, because we - // don't know whether more input is coming. This is different from how the - // reference implementation does things. - uint8_t cv_stack[(BLAKE3_MAX_DEPTH + 1) * BLAKE3_OUT_LEN]; -} blake3_hasher; - -/* Find index of the highest set bit */ -/* x is assumed to be nonzero. */ -static unsigned int highest_one(uint64_t x) { - return 63 ^ __builtin_clzll(x); -} - -// Count the number of 1 bits. -static __inline__ unsigned int popcnt(uint64_t x) { - return __builtin_popcountll(x); -} - -static __inline__ uint64_t round_down_to_power_of_2(uint64_t x) { - return 1ULL << highest_one(x | 1); -} - -static __inline__ uint32_t counter_low(uint64_t counter) { - return (uint32_t)counter; -} - -static __inline__ uint32_t counter_high(uint64_t counter) { - return (uint32_t)(counter >> 32); -} - -static __inline__ uint32_t load32(const void *src) { - const uint32_t *p = (const uint32_t *)src; - return p[0]; -} - -static __inline__ uint32_t rotr32(uint32_t w, uint32_t c) { - return (w >> c) | (w << (32 - c)); -} - -static __inline__ void g( - uint32_t *state, size_t a, size_t b, size_t c, size_t d, uint32_t x, uint32_t y -) { - state[a] = state[a] + state[b] + x; - state[d] = rotr32(state[d] ^ state[a], 16); - state[c] = state[c] + state[d]; - state[b] = rotr32(state[b] ^ state[c], 12); - state[a] = state[a] + state[b] + y; - state[d] = rotr32(state[d] ^ state[a], 8); - state[c] = state[c] + state[d]; - state[b] = rotr32(state[b] ^ state[c], 7); -} - -static __inline__ void round_fn( - uint32_t state[16], const uint32_t *msg, size_t round -) { - // Select the message schedule based on the round. - const uint8_t *schedule = MSG_SCHEDULE[round]; - - // Mix the columns. - g(state, 0, 4, 8, 12, msg[schedule[0]], msg[schedule[1]]); - g(state, 1, 5, 9, 13, msg[schedule[2]], msg[schedule[3]]); - g(state, 2, 6, 10, 14, msg[schedule[4]], msg[schedule[5]]); - g(state, 3, 7, 11, 15, msg[schedule[6]], msg[schedule[7]]); - - // Mix the rows. - g(state, 0, 5, 10, 15, msg[schedule[8]], msg[schedule[9]]); - g(state, 1, 6, 11, 12, msg[schedule[10]], msg[schedule[11]]); - g(state, 2, 7, 8, 13, msg[schedule[12]], msg[schedule[13]]); - g(state, 3, 4, 9, 14, msg[schedule[14]], msg[schedule[15]]); -} - -static __inline__ void load_key_words( - const uint8_t key[BLAKE3_KEY_LEN], uint32_t key_words[8] -) { - memcpy32(key_words, key); -} - -static __inline__ void compress_pre( - uint32_t state[16], const uint32_t cv[8], const uint8_t block[BLAKE3_BLOCK_LEN], - uint8_t block_len, uint64_t counter, uint8_t flags -) { - uint32_t block_words[16]; - - memcpy64(block_words, block); - memcpy32(state, cv); - memcpy16(&state[8], IV); - - state[12] = counter_low(counter); - state[13] = counter_high(counter); - state[14] = (uint32_t)block_len; - state[15] = (uint32_t)flags; - - #pragma clang loop unroll(full) - for (int i = 0; i < 7; i++) { - // Select the message schedule based on the round. - round_fn(state, &block_words[0], i); - } -} - -static __inline__ void store32(void *dst, uint32_t w) { - uint32_t *p = (uint32_t *)dst; - p[0] = w; -} - -static __inline__ void store_cv_words(uint8_t bytes_out[32], uint32_t cv_words[8]) { - memcpy32(bytes_out, cv_words); -} - -void blake3_compress_xof_portable( - const uint32_t cv[8], const uint8_t block[BLAKE3_BLOCK_LEN], uint8_t block_len, - uint64_t counter, uint8_t flags, uint8_t out[64] -) { - uint32_t state[16]; - compress_pre(state, cv, block, block_len, counter, flags); - - uint64_t *state64 = (uint64_t *)state; - uint64_t *out64 = (uint64_t *)out; - uint64_t *cv64 = (uint64_t *)cv; - - out64[0] = state64[0] ^ state64[4]; - out64[1] = state64[1] ^ state64[5]; - out64[2] = state64[2] ^ state64[6]; - out64[3] = state64[3] ^ state64[7]; - out64[4] = state64[4] ^ cv64[0]; - out64[5] = state64[5] ^ cv64[1]; - out64[6] = state64[6] ^ cv64[2]; - out64[7] = state64[7] ^ cv64[3]; -} - -void blake3_compress_in_place_portable( - uint32_t cv[8], const uint8_t block[BLAKE3_BLOCK_LEN], uint8_t block_len, - uint64_t counter, uint8_t flags -) { - uint32_t state[16]; - compress_pre(state, cv, block, block_len, counter, flags); - - uint64_t *state64 = (uint64_t *)state; - uint64_t *cv64 = (uint64_t *)cv; - cv64[0] = state64[0] ^ state64[4]; - cv64[1] = state64[1] ^ state64[5]; - cv64[2] = state64[2] ^ state64[6]; - cv64[3] = state64[3] ^ state64[7]; -} - -static __inline__ void chunk_state_init(blake3_chunk_state *self, const uint32_t key[8], uint8_t flags) { - memcpy32(self->cv, key); - self->chunk_counter = 0; - memset64(self->buf, 0); - self->buf_len = 0; - self->blocks_compressed = 0; - self->flags = flags; -} - -static __inline__ void chunk_state_reset( - blake3_chunk_state *self, const uint32_t key[8], uint64_t chunk_counter -) { - memcpy32(self->cv, key); - self->chunk_counter = chunk_counter; - self->blocks_compressed = 0; - memset64(self->buf, 0); - self->buf_len = 0; -} - -static __inline__ size_t chunk_state_len(const blake3_chunk_state *self) { - return (BLAKE3_BLOCK_LEN * (size_t)self->blocks_compressed) + ((size_t)self->buf_len); -} - -static __inline__ size_t chunk_state_fill_buf( - blake3_chunk_state *self, const uint8_t *input, size_t input_len -) { - size_t take = BLAKE3_BLOCK_LEN - ((size_t)self->buf_len); - if (take > input_len) { - take = input_len; - } - uint8_t *dest = self->buf + ((size_t)self->buf_len); - for (size_t i = 0; i < take; i++) { - dest[i] = input[i]; - } - self->buf_len += (uint8_t)take; - return take; -} - -static __inline__ uint8_t chunk_state_maybe_start_flag(const blake3_chunk_state *self) { - if (self->blocks_compressed == 0) { - return CHUNK_START; - } else { - return 0; - } -} - -typedef struct { - uint32_t input_cv[8]; - uint64_t counter; - uint8_t block[BLAKE3_BLOCK_LEN]; - uint8_t block_len; - uint8_t flags; -} output_t; - -static __inline__ output_t make_output( - const uint32_t input_cv[8], const uint8_t block[BLAKE3_BLOCK_LEN], - uint8_t block_len, uint64_t counter, uint8_t flags -) { - output_t ret; - memcpy32(ret.input_cv, input_cv); - memcpy64(ret.block, block); - - ret.block_len = block_len; - ret.counter = counter; - ret.flags = flags; - return ret; -} - -// Chaining values within a given chunk (specifically the compress_in_place -// interface) are represented as words. This avoids unnecessary bytes<->words -// conversion overhead in the portable implementation. However, the hash_many -// interface handles both user input and parent node blocks, so it accepts -// bytes. For that reason, chaining values in the CV stack are represented as -// bytes. -static __inline__ void output_chaining_value(const output_t *self, uint8_t cv[32]) { - uint32_t cv_words[8]; - memcpy32(cv_words, self->input_cv); - blake3_compress_in_place_portable( - cv_words, self->block, self->block_len, self->counter, self->flags - ); - store_cv_words(cv, cv_words); -} - -static __inline__ void output_root_bytes( - const output_t *self, uint64_t seek, uint8_t *out, size_t out_len -) { - uint64_t output_block_counter = seek / 64; - size_t offset_within_block = seek % 64; - uint8_t wide_buf[64]; - while (out_len > 0) { - blake3_compress_xof_portable( - self->input_cv, self->block, self->block_len, output_block_counter, self->flags | ROOT, wide_buf - ); - size_t available_bytes = 64 - offset_within_block; - size_t memcpy_len; - if (out_len > available_bytes) { - memcpy_len = available_bytes; - } else { - memcpy_len = out_len; - } - memcpy(out, wide_buf + offset_within_block, memcpy_len); - out += memcpy_len; - out_len -= memcpy_len; - output_block_counter += 1; - offset_within_block = 0; - } -} - -static __inline__ void chunk_state_update( - blake3_chunk_state *self, const uint8_t *input, size_t input_len -) { - if (self->buf_len > 0) { - size_t take = chunk_state_fill_buf(self, input, input_len); - input += take; - input_len -= take; - if (input_len > 0) { - blake3_compress_in_place_portable( - self->cv, self->buf, BLAKE3_BLOCK_LEN, self->chunk_counter, - self->flags | chunk_state_maybe_start_flag(self) - ); - self->blocks_compressed += 1; - self->buf_len = 0; - memset64(self->buf, 0); - } - } - - while (input_len > BLAKE3_BLOCK_LEN) { - blake3_compress_in_place_portable( - self->cv, input, BLAKE3_BLOCK_LEN, self->chunk_counter, - self->flags | chunk_state_maybe_start_flag(self) - ); - self->blocks_compressed += 1; - input += BLAKE3_BLOCK_LEN; - input_len -= BLAKE3_BLOCK_LEN; - } - - size_t take = chunk_state_fill_buf(self, input, input_len); - input += take; - input_len -= take; -} - -static __inline__ output_t chunk_state_output(const blake3_chunk_state *self) { - uint8_t block_flags = - self->flags | chunk_state_maybe_start_flag(self) | CHUNK_END; - - return make_output(self->cv, self->buf, self->buf_len, self->chunk_counter, block_flags); -} - -static __inline__ output_t parent_output( - const uint8_t block[BLAKE3_BLOCK_LEN], const uint32_t key[8], uint8_t flags -) { - return make_output(key, block, BLAKE3_BLOCK_LEN, 0, flags | PARENT); -} - -// Given some input larger than one chunk, return the number of bytes that -// should go in the left subtree. This is the largest power-of-2 number of -// chunks that leaves at least 1 byte for the right subtree. -static __inline__ size_t left_len(size_t content_len) { - // Subtract 1 to reserve at least one byte for the right side. content_len - // should always be greater than BLAKE3_CHUNK_LEN. - size_t full_chunks = (content_len - 1) / BLAKE3_CHUNK_LEN; - return round_down_to_power_of_2(full_chunks) * BLAKE3_CHUNK_LEN; -} - -static __inline__ void hash_one_portable( - const uint8_t *input, size_t blocks, const uint32_t key[8], uint64_t counter, - uint8_t flags, uint8_t flags_start, uint8_t flags_end, uint8_t out[BLAKE3_OUT_LEN] -) { - uint32_t cv[8]; - memcpy32(cv, key); - uint8_t block_flags = flags | flags_start; - while (blocks > 0) { - if (blocks == 1) { - block_flags |= flags_end; - } - blake3_compress_in_place_portable(cv, input, BLAKE3_BLOCK_LEN, counter, block_flags); - input = &input[BLAKE3_BLOCK_LEN]; - blocks -= 1; - block_flags = flags; - } - store_cv_words(out, cv); -} - -void blake3_hash_many_portable( - const uint8_t *const *inputs, size_t num_inputs, size_t blocks, const uint32_t key[8], - uint64_t counter, bool increment_counter, uint8_t flags, uint8_t flags_start, - uint8_t flags_end, uint8_t *out -) { - while (num_inputs > 0) { - hash_one_portable(inputs[0], blocks, key, counter, flags, flags_start, flags_end, out); - if (increment_counter) { - counter += 1; - } - inputs += 1; - num_inputs -= 1; - out = &out[BLAKE3_OUT_LEN]; - } -} - -// Use SIMD parallelism to hash up to MAX_SIMD_DEGREE chunks at the same time -// on a single thread. Write out the chunk chaining values and return the -// number of chunks hashed. These chunks are never the root and never empty; -// those cases use a different codepath. -static __inline__ size_t compress_chunks_parallel( - const uint8_t *input, size_t input_len, const uint32_t key[8], - uint64_t chunk_counter, uint8_t flags, uint8_t *out -) { - const uint8_t *chunks_array[MAX_SIMD_DEGREE]; - size_t input_position = 0; - size_t chunks_array_len = 0; - while (input_len - input_position >= BLAKE3_CHUNK_LEN) { - chunks_array[chunks_array_len] = &input[input_position]; - input_position += BLAKE3_CHUNK_LEN; - chunks_array_len += 1; - } - - blake3_hash_many_portable( - chunks_array, chunks_array_len, BLAKE3_CHUNK_LEN / BLAKE3_BLOCK_LEN, key, - chunk_counter, true, flags, CHUNK_START, CHUNK_END, out - ); - - // Hash the remaining partial chunk, if there is one. Note that the empty - // chunk (meaning the empty message) is a different codepath. - if (input_len > input_position) { - uint64_t counter = chunk_counter + (uint64_t)chunks_array_len; - blake3_chunk_state chunk_state; - chunk_state_init(&chunk_state, key, flags); - chunk_state.chunk_counter = counter; - chunk_state_update( - &chunk_state, &input[input_position], input_len - input_position - ); - output_t output = chunk_state_output(&chunk_state); - output_chaining_value(&output, &out[chunks_array_len * BLAKE3_OUT_LEN]); - return chunks_array_len + 1; - } else { - return chunks_array_len; - } -} - -// Use SIMD parallelism to hash up to MAX_SIMD_DEGREE parents at the same time -// on a single thread. Write out the parent chaining values and return the -// number of parents hashed. (If there's an odd input chaining value left over, -// return it as an additional output.) These parents are never the root and -// never empty; those cases use a different codepath. -static __inline__ size_t compress_parents_parallel( - const uint8_t *child_chaining_values, size_t num_chaining_values, - const uint32_t key[8], uint8_t flags, uint8_t *out -) { - const uint8_t *parents_array[MAX_SIMD_DEGREE_OR_2]; - size_t parents_array_len = 0; - - while (num_chaining_values - (2 * parents_array_len) >= 2) { - parents_array[parents_array_len] = - &child_chaining_values[2 * parents_array_len * BLAKE3_OUT_LEN]; - parents_array_len += 1; - } - - blake3_hash_many_portable(parents_array, parents_array_len, 1, key, - 0, // Parents always use counter 0. - false, flags | PARENT, - 0, // Parents have no start flags. - 0, // Parents have no end flags. - out); - - // If there's an odd child left over, it becomes an output. - if (num_chaining_values > 2 * parents_array_len) { - memcpy32( - &out[parents_array_len * BLAKE3_OUT_LEN], - &child_chaining_values[2 * parents_array_len * BLAKE3_OUT_LEN] - ); - return parents_array_len + 1; - } else { - return parents_array_len; - } -} - -// The wide helper function returns (writes out) an array of chaining values -// and returns the length of that array. The number of chaining values returned -// is the dyanmically detected SIMD degree, at most MAX_SIMD_DEGREE. Or fewer, -// if the input is shorter than that many chunks. The reason for maintaining a -// wide array of chaining values going back up the tree, is to allow the -// implementation to hash as many parents in parallel as possible. -// -// As a special case when the SIMD degree is 1, this function will still return -// at least 2 outputs. This guarantees that this function doesn't perform the -// root compression. (If it did, it would use the wrong flags, and also we -// wouldn't be able to implement exendable ouput.) Note that this function is -// not used when the whole input is only 1 chunk long; that's a different -// codepath. -// -// Why not just have the caller split the input on the first update(), instead -// of implementing this special rule? Because we don't want to limit SIMD or -// multi-threading parallelism for that update(). -static size_t blake3_compress_subtree_wide( - const uint8_t *input, size_t input_len, const uint32_t key[8], - uint64_t chunk_counter, uint8_t flags, uint8_t *out -) { - // Note that the single chunk case does *not* bump the SIMD degree up to 2 - // when it is 1. If this implementation adds multi-threading in the future, - // this gives us the option of multi-threading even the 2-chunk case, which - // can help performance on smaller platforms. - if (input_len <= blake3_simd_degree() * BLAKE3_CHUNK_LEN) { - return compress_chunks_parallel(input, input_len, key, chunk_counter, flags, out); - } - - // With more than simd_degree chunks, we need to recurse. Start by dividing - // the input into left and right subtrees. (Note that this is only optimal - // as long as the SIMD degree is a power of 2. If we ever get a SIMD degree - // of 3 or something, we'll need a more complicated strategy.) - size_t left_input_len = left_len(input_len); - size_t right_input_len = input_len - left_input_len; - const uint8_t *right_input = &input[left_input_len]; - - uint64_t right_chunk_counter = - chunk_counter + (uint64_t)(left_input_len / BLAKE3_CHUNK_LEN); - - // Make space for the child outputs. Here we use MAX_SIMD_DEGREE_OR_2 to - // account for the special case of returning 2 outputs when the SIMD degree - // is 1. - uint8_t cv_array[2 * MAX_SIMD_DEGREE_OR_2 * BLAKE3_OUT_LEN]; - size_t degree = blake3_simd_degree(); - if (left_input_len > BLAKE3_CHUNK_LEN && degree == 1) { - // The special case: We always use a degree of at least two, to make - // sure there are two outputs. Except, as noted above, at the chunk - // level, where we allow degree=1. (Note that the 1-chunk-input case is - // a different codepath.) - degree = 2; - } - - uint8_t *right_cvs = &cv_array[degree * BLAKE3_OUT_LEN]; - - // Recurse! If this implementation adds multi-threading support in the - // future, this is where it will go. - size_t left_n = blake3_compress_subtree_wide(input, left_input_len, key, chunk_counter, flags, cv_array); - size_t right_n = blake3_compress_subtree_wide(right_input, right_input_len, key, right_chunk_counter, flags, right_cvs); - - // The special case again. If simd_degree=1, then we'll have left_n=1 and - // right_n=1. Rather than compressing them into a single output, return - // them directly, to make sure we always have at least two outputs. - if (left_n == 1) { - memcpy64(out, cv_array); - return 2; - } - - // Otherwise, do one layer of parent node compression. - size_t num_chaining_values = left_n + right_n; - return compress_parents_parallel(cv_array, num_chaining_values, key, flags, out); -} - -// Hash a subtree with compress_subtree_wide(), and then condense the resulting -// list of chaining values down to a single parent node. Don't compress that -// last parent node, however. Instead, return its message bytes (the -// concatenated chaining values of its children). This is necessary when the -// first call to update() supplies a complete subtree, because the topmost -// parent node of that subtree could end up being the root. It's also necessary -// for extended output in the general case. -// -// As with compress_subtree_wide(), this function is not used on inputs of 1 -// chunk or less. That's a different codepath. -static __inline__ void compress_subtree_to_parent_node( - const uint8_t *input, size_t input_len, const uint32_t key[8], - uint64_t chunk_counter, uint8_t flags, uint8_t out[2 * BLAKE3_OUT_LEN] -) { - uint8_t cv_array[MAX_SIMD_DEGREE_OR_2 * BLAKE3_OUT_LEN]; - size_t num_cvs = blake3_compress_subtree_wide(input, input_len, key, chunk_counter, flags, cv_array); - - // If MAX_SIMD_DEGREE is greater than 2 and there's enough input, - // compress_subtree_wide() returns more than 2 chaining values. Condense - // them into 2 by forming parent nodes repeatedly. - uint8_t out_array[MAX_SIMD_DEGREE_OR_2 * BLAKE3_OUT_LEN / 2]; - while (num_cvs > 2) { - num_cvs = - compress_parents_parallel(cv_array, num_cvs, key, flags, out_array); - if (num_cvs > 0) { - memcpy32(cv_array, out_array); - } - } - memcpy64(out, cv_array); -} - -static __inline__ void hasher_init_base(blake3_hasher *self, const uint32_t key[8], uint8_t flags) { - memcpy32(self->key, key); - chunk_state_init(&self->chunk, key, flags); - self->cv_stack_len = 0; -} - -void blake3_hasher_init(blake3_hasher *self) { - hasher_init_base(self, IV, 0); -} - -void blake3_hasher_init_keyed(blake3_hasher *self, const uint8_t key[BLAKE3_KEY_LEN]) { - uint32_t key_words[8]; - load_key_words(key, key_words); - hasher_init_base(self, key_words, KEYED_HASH); -} - -// As described in hasher_push_cv() below, we do "lazy merging", delaying -// merges until right before the next CV is about to be added. This is -// different from the reference implementation. Another difference is that we -// aren't always merging 1 chunk at a time. Instead, each CV might represent -// any power-of-two number of chunks, as long as the smaller-above-larger stack -// order is maintained. Instead of the "count the trailing 0-bits" algorithm -// described in the spec, we use a "count the total number of 1-bits" variant -// that doesn't require us to retain the subtree size of the CV on top of the -// stack. The principle is the same: each CV that should remain in the stack is -// represented by a 1-bit in the total number of chunks (or bytes) so far. -static __inline__ void hasher_merge_cv_stack(blake3_hasher *self, uint64_t total_len) { - size_t post_merge_stack_len = (size_t)popcnt(total_len); - while (self->cv_stack_len > post_merge_stack_len) { - uint8_t *parent_node = - &self->cv_stack[(self->cv_stack_len - 2) * BLAKE3_OUT_LEN]; - output_t output = parent_output(parent_node, self->key, self->chunk.flags); - output_chaining_value(&output, parent_node); - self->cv_stack_len -= 1; - } -} - -// In reference_impl.rs, we merge the new CV with existing CVs from the stack -// before pushing it. We can do that because we know more input is coming, so -// we know none of the merges are root. -// -// This setting is different. We want to feed as much input as possible to -// compress_subtree_wide(), without setting aside anything for the chunk_state. -// If the user gives us 64 KiB, we want to parallelize over all 64 KiB at once -// as a single subtree, if at all possible. -// -// This leads to two problems: -// 1) This 64 KiB input might be the only call that ever gets made to update. -// In this case, the root node of the 64 KiB subtree would be the root node -// of the whole tree, and it would need to be ROOT finalized. We can't -// compress it until we know. -// 2) This 64 KiB input might complete a larger tree, whose root node is -// similarly going to be the the root of the whole tree. For example, maybe -// we have 196 KiB (that is, 128 + 64) hashed so far. We can't compress the -// node at the root of the 256 KiB subtree until we know how to finalize it. -// -// The second problem is solved with "lazy merging". That is, when we're about -// to add a CV to the stack, we don't merge it with anything first, as the -// reference impl does. Instead we do merges using the *previous* CV that was -// added, which is sitting on top of the stack, and we put the new CV -// (unmerged) on top of the stack afterwards. This guarantees that we never -// merge the root node until finalize(). -// -// Solving the first problem requires an additional tool, -// compress_subtree_to_parent_node(). That function always returns the top -// *two* chaining values of the subtree it's compressing. We then do lazy -// merging with each of them separately, so that the second CV will always -// remain unmerged. (That also helps us support extendable output when we're -// hashing an input all-at-once.) -static __inline__ void hasher_push_cv( - blake3_hasher *self, uint8_t new_cv[BLAKE3_OUT_LEN], uint64_t chunk_counter -) { - hasher_merge_cv_stack(self, chunk_counter); - memcpy32(&self->cv_stack[self->cv_stack_len * BLAKE3_OUT_LEN], new_cv); - self->cv_stack_len += 1; -} - -void blake3_hasher_update(blake3_hasher *self, const void *input, size_t input_len) { - // Explicitly checking for zero avoids causing UB by passing a null pointer - // to memcpy. This comes up in practice with things like: - // std::vector v; - // blake3_hasher_update(&hasher, v.data(), v.size()); - if (input_len == 0) { - return; - } - - const uint8_t *input_bytes = (const uint8_t *)input; - - // If we have some partial chunk bytes in the internal chunk_state, we need - // to finish that chunk first. - if (chunk_state_len(&self->chunk) > 0) { - size_t take = BLAKE3_CHUNK_LEN - chunk_state_len(&self->chunk); - if (take > input_len) { - take = input_len; - } - chunk_state_update(&self->chunk, input_bytes, take); - input_bytes += take; - input_len -= take; - // If we've filled the current chunk and there's more coming, finalize this - // chunk and proceed. In this case we know it's not the root. - if (input_len > 0) { - output_t output = chunk_state_output(&self->chunk); - uint8_t chunk_cv[32]; - output_chaining_value(&output, chunk_cv); - hasher_push_cv(self, chunk_cv, self->chunk.chunk_counter); - chunk_state_reset(&self->chunk, self->key, self->chunk.chunk_counter + 1); - } else { - return; - } - } - - // Now the chunk_state is clear, and we have more input. If there's more than - // a single chunk (so, definitely not the root chunk), hash the largest whole - // subtree we can, with the full benefits of SIMD (and maybe in the future, - // multi-threading) parallelism. Two restrictions: - // - The subtree has to be a power-of-2 number of chunks. Only subtrees along - // the right edge can be incomplete, and we don't know where the right edge - // is going to be until we get to finalize(). - // - The subtree must evenly divide the total number of chunks up until this - // point (if total is not 0). If the current incomplete subtree is only - // waiting for 1 more chunk, we can't hash a subtree of 4 chunks. We have - // to complete the current subtree first. - // Because we might need to break up the input to form powers of 2, or to - // evenly divide what we already have, this part runs in a loop. - while (input_len > BLAKE3_CHUNK_LEN) { - size_t subtree_len = round_down_to_power_of_2(input_len); - uint64_t count_so_far = self->chunk.chunk_counter * BLAKE3_CHUNK_LEN; - // Shrink the subtree_len until it evenly divides the count so far. We know - // that subtree_len itself is a power of 2, so we can use a bitmasking - // trick instead of an actual remainder operation. (Note that if the caller - // consistently passes power-of-2 inputs of the same size, as is hopefully - // typical, this loop condition will always fail, and subtree_len will - // always be the full length of the input.) - // - // An aside: We don't have to shrink subtree_len quite this much. For - // example, if count_so_far is 1, we could pass 2 chunks to - // compress_subtree_to_parent_node. Since we'll get 2 CVs back, we'll still - // get the right answer in the end, and we might get to use 2-way SIMD - // parallelism. The problem with this optimization, is that it gets us - // stuck always hashing 2 chunks. The total number of chunks will remain - // odd, and we'll never graduate to higher degrees of parallelism. See - // https://github.com/BLAKE3-team/BLAKE3/issues/69. - while ((((uint64_t)(subtree_len - 1)) & count_so_far) != 0) { - subtree_len /= 2; - } - // The shrunken subtree_len might now be 1 chunk long. If so, hash that one - // chunk by itself. Otherwise, compress the subtree into a pair of CVs. - uint64_t subtree_chunks = subtree_len / BLAKE3_CHUNK_LEN; - if (subtree_len <= BLAKE3_CHUNK_LEN) { - blake3_chunk_state chunk_state; - chunk_state_init(&chunk_state, self->key, self->chunk.flags); - chunk_state.chunk_counter = self->chunk.chunk_counter; - chunk_state_update(&chunk_state, input_bytes, subtree_len); - output_t output = chunk_state_output(&chunk_state); - uint8_t cv[BLAKE3_OUT_LEN]; - output_chaining_value(&output, cv); - hasher_push_cv(self, cv, chunk_state.chunk_counter); - } else { - // This is the high-performance happy path, though getting here depends - // on the caller giving us a long enough input. - uint8_t cv_pair[2 * BLAKE3_OUT_LEN]; - compress_subtree_to_parent_node( - input_bytes, subtree_len, self->key, - self->chunk.chunk_counter, self->chunk.flags, cv_pair - ); - hasher_push_cv(self, cv_pair, self->chunk.chunk_counter); - hasher_push_cv( - self, &cv_pair[BLAKE3_OUT_LEN], self->chunk.chunk_counter + (subtree_chunks / 2) - ); - } - self->chunk.chunk_counter += subtree_chunks; - input_bytes += subtree_len; - input_len -= subtree_len; - } - - // If there's any remaining input less than a full chunk, add it to the chunk - // state. In that case, also do a final merge loop to make sure the subtree - // stack doesn't contain any unmerged pairs. The remaining input means we - // know these merges are non-root. This merge loop isn't strictly necessary - // here, because hasher_push_chunk_cv already does its own merge loop, but it - // simplifies blake3_hasher_finalize below. - if (input_len > 0) { - chunk_state_update(&self->chunk, input_bytes, input_len); - hasher_merge_cv_stack(self, self->chunk.chunk_counter); - } -} - -void blake3_hasher_finalize_seek( - const blake3_hasher *self, uint64_t seek, uint8_t *out, size_t out_len -) { - // Explicitly checking for zero avoids causing UB by passing a null pointer - // to memcpy. This comes up in practice with things like: - // std::vector v; - // blake3_hasher_finalize(&hasher, v.data(), v.size()); - if (out_len == 0) { - return; - } - - // If the subtree stack is empty, then the current chunk is the root. - if (self->cv_stack_len == 0) { - output_t output = chunk_state_output(&self->chunk); - output_root_bytes(&output, seek, out, out_len); - return; - } - // If there are any bytes in the chunk state, finalize that chunk and do a - // roll-up merge between that chunk hash and every subtree in the stack. In - // this case, the extra merge loop at the end of blake3_hasher_update - // guarantees that none of the subtrees in the stack need to be merged with - // each other first. Otherwise, if there are no bytes in the chunk state, - // then the top of the stack is a chunk hash, and we start the merge from - // that. - output_t output; - size_t cvs_remaining; - if (chunk_state_len(&self->chunk) > 0) { - cvs_remaining = self->cv_stack_len; - output = chunk_state_output(&self->chunk); - } else { - // There are always at least 2 CVs in the stack in this case. - cvs_remaining = self->cv_stack_len - 2; - output = parent_output(&self->cv_stack[cvs_remaining * 32], self->key, self->chunk.flags); - } - while (cvs_remaining > 0) { - cvs_remaining -= 1; - uint8_t parent_block[BLAKE3_BLOCK_LEN]; - memcpy32(parent_block, &self->cv_stack[cvs_remaining * 32]); - output_chaining_value(&output, &parent_block[32]); - output = parent_output(parent_block, self->key, self->chunk.flags); - } - output_root_bytes(&output, seek, out, out_len); -} - -void blake3_hasher_finalize(const blake3_hasher *self, uint8_t *out, size_t out_len) { - blake3_hasher_finalize_seek(self, 0, out, out_len); -} - -blake3_hasher hasher; - -WASM_EXPORT -void Hash_Init(uint32_t keyLen) { - if (keyLen == 32) { - blake3_hasher_init_keyed(&hasher, main_buffer); - } else { - blake3_hasher_init(&hasher); - } -} - -WASM_EXPORT -void Hash_Update(uint32_t len) { - blake3_hasher_update(&hasher, main_buffer, len); -} - -/* Add padding and return the message digest. */ -WASM_EXPORT -void Hash_Final(uint32_t digestBytes) { - blake3_hasher_finalize(&hasher, main_buffer, digestBytes); -} - -WASM_EXPORT -const uint32_t STATE_SIZE = sizeof(hasher); - -WASM_EXPORT -uint8_t* Hash_GetState() { - return (uint8_t*) &hasher; -} - -WASM_EXPORT -void Hash_Calculate(uint32_t length, uint32_t initParam, uint32_t digestBytes) { - Hash_Init(initParam); - Hash_Update(length); - Hash_Final(digestBytes); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/src/crc32.c b/tools/mnemonic-test/node_modules/hash-wasm/src/crc32.c deleted file mode 100644 index ea6df491..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/src/crc32.c +++ /dev/null @@ -1,94 +0,0 @@ -// ////////////////////////////////////////////////////////// -// Crc32.cpp -// Copyright (c) 2011-2019 Stephan Brumme. All rights reserved. -// Slicing-by-16 contributed by Bulat Ziganshin -// Tableless bytewise CRC contributed by Hagai Gold -// see http://create.stephan-brumme.com/disclaimer.html -// -// Modified for hash-wasm by Dani Biró -// - -#define WITH_BUFFER -#include "hash-wasm.h" - -#define bswap_32(x) __builtin_bswap32(x) - -alignas(128) static uint32_t crc32_lookup[8][256] = {0}; - -void init_lut(uint32_t polynomial) { - for (int i = 0; i < 256; ++i) { - uint32_t crc = i; - for (int j = 0; j < 8; ++j) { - crc = (crc >> 1) ^ (-(int32_t)(crc & 1) & polynomial); - } - crc32_lookup[0][i] = crc; - } - - for (int i = 1; i < 256; ++i) { - uint32_t lv = crc32_lookup[0][i]; - for (int j = 1; j < 8; ++j) { - lv = (lv >> 8) ^ crc32_lookup[0][lv & 255]; - crc32_lookup[j][i] = lv; - } - } -} - -uint32_t crc32_lut_initialized_to = 0; -uint32_t previous_crc32 = 0; - -WASM_EXPORT -void Hash_Init(uint32_t polynomial) { - if (crc32_lut_initialized_to != polynomial) { - init_lut(polynomial); - crc32_lut_initialized_to = polynomial; - } - - previous_crc32 = 0; -} - -WASM_EXPORT -void Hash_Update(uint32_t length) { - const uint8_t *data = main_buffer; - - uint32_t crc = ~previous_crc32; // same as previous_crc32 ^ 0xFFFFFFFF - const uint32_t *current = (const uint32_t *)data; - - // process eight bytes at once (Slicing-by-8) - while (length >= 8) { - uint32_t one = *current++ ^ crc; - uint32_t two = *current++; - crc = crc32_lookup[0][(two >> 24) & 0xFF] ^ - crc32_lookup[1][(two >> 16) & 0xFF] ^ - crc32_lookup[2][(two >> 8) & 0xFF] ^ crc32_lookup[3][two & 0xFF] ^ - crc32_lookup[4][(one >> 24) & 0xFF] ^ - crc32_lookup[5][(one >> 16) & 0xFF] ^ - crc32_lookup[6][(one >> 8) & 0xFF] ^ crc32_lookup[7][one & 0xFF]; - - length -= 8; - } - - const uint8_t *currentChar = (const uint8_t *)current; - - // remaining 1 to 7 bytes (standard algorithm) - while (length-- != 0) { - crc = (crc >> 8) ^ crc32_lookup[0][(crc & 0xFF) ^ *currentChar++]; - } - - previous_crc32 = ~crc; // same as crc ^ 0xFFFFFFFF -} - -WASM_EXPORT -void Hash_Final() { ((uint32_t *)main_buffer)[0] = bswap_32(previous_crc32); } - -WASM_EXPORT -const uint32_t STATE_SIZE = sizeof(previous_crc32); - -WASM_EXPORT -uint8_t *Hash_GetState() { return (uint8_t *)&previous_crc32; } - -WASM_EXPORT -void Hash_Calculate(uint32_t length, uint32_t initParam) { - Hash_Init(initParam); - Hash_Update(length); - Hash_Final(); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/src/crc64.c b/tools/mnemonic-test/node_modules/hash-wasm/src/crc64.c deleted file mode 100644 index 3be77f67..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/src/crc64.c +++ /dev/null @@ -1,86 +0,0 @@ -// Based on crc32.c implementation of Stephan Brumme -// Modified for hash-wasm by Dani Biró - -#include -#define WITH_BUFFER -#include "hash-wasm.h" - -#define bswap_64(x) __builtin_bswap64(x) - -alignas(128) static uint64_t crc64_lookup[8][256] = {0}; - -void init_lut(uint64_t polynomial) { - for (int i = 0; i < 256; ++i) { - uint64_t crc = i; - for (int j = 0; j < 8; ++j) { - crc = (crc >> 1) ^ (-(int64_t)(crc & 1) & polynomial); - } - crc64_lookup[0][i] = crc; - } - - for (int i = 1; i < 256; ++i) { - uint64_t lv = crc64_lookup[0][i]; - for (int j = 1; j < 8; ++j) { - lv = (lv >> 8) ^ crc64_lookup[0][lv & 255]; - crc64_lookup[j][i] = lv; - } - } -} - -uint64_t crc64_lut_initialized_to = 0; -uint64_t previous_crc64 = 0; - -WASM_EXPORT -void Hash_Init() { - // polynomial is at the memory object - uint64_t polynomial = *((uint64_t *)main_buffer); - - if (crc64_lut_initialized_to != polynomial) { - init_lut(polynomial); - crc64_lut_initialized_to = polynomial; - } - - previous_crc64 = 0; -} - -WASM_EXPORT -void Hash_Update(uint32_t length) { - const uint8_t *data = main_buffer; - - uint64_t crc = ~previous_crc64; // same as previous_crc64 ^ 0xFFFFFFFF - const uint64_t *current = (const uint64_t *)data; - - // process eight bytes at once (Slicing-by-8) - while (length >= 8) { - uint64_t val = *current++ ^ crc; - crc = crc64_lookup[0][(val >> 56)] ^ crc64_lookup[1][(val >> 48) & 0xFF] ^ - crc64_lookup[2][(val >> 40) & 0xFF] ^ - crc64_lookup[3][(val >> 32) & 0xFF] ^ - crc64_lookup[4][(val >> 24) & 0xFF] ^ - crc64_lookup[5][(val >> 16) & 0xFF] ^ - crc64_lookup[6][(val >> 8) & 0xFF] ^ crc64_lookup[7][val & 0xFF]; - - length -= 8; - } - - const uint8_t *currentChar = (const uint8_t *)current; - - // remaining 1 to 7 bytes (standard algorithm) - while (length-- != 0) { - crc = (crc >> 8) ^ crc64_lookup[0][(crc & 0xFF) ^ *currentChar++]; - } - - previous_crc64 = ~crc; -} - -WASM_EXPORT -void Hash_Final() { ((uint64_t *)main_buffer)[0] = bswap_64(previous_crc64); } - -WASM_EXPORT -const uint32_t STATE_SIZE = sizeof(previous_crc64); - -WASM_EXPORT -uint8_t *Hash_GetState() { return (uint8_t *)&previous_crc64; } - -WASM_EXPORT -void Hash_Calculate() { return; } diff --git a/tools/mnemonic-test/node_modules/hash-wasm/src/hash-wasm.h b/tools/mnemonic-test/node_modules/hash-wasm/src/hash-wasm.h deleted file mode 100644 index 5509845d..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/src/hash-wasm.h +++ /dev/null @@ -1,132 +0,0 @@ -#include -#include - -#ifndef NULL -#define NULL 0 -#endif - -#ifdef _MSC_VER -#define WASM_EXPORT -#define __inline__ -#else -#define WASM_EXPORT __attribute__((visibility("default"))) -#endif - -#ifdef WITH_BUFFER - -#define MAIN_BUFFER_SIZE 16 * 1024 -alignas(128) uint8_t main_buffer[MAIN_BUFFER_SIZE]; - -WASM_EXPORT -uint8_t *Hash_GetBuffer() { - return main_buffer; -} - -#endif - -// Sometimes LLVM emits these functions during the optimization step -// even with -nostdlib -fno-builtin flags -static __inline__ void* memcpy(void* dst, const void* src, uint32_t cnt) { - uint8_t *destination = dst; - const uint8_t *source = src; - while (cnt) { - *(destination++)= *(source++); - --cnt; - } - return dst; -} - -static __inline__ void* memset(void* dst, const uint8_t value, uint32_t cnt) { - uint8_t *p = dst; - while (cnt--) { - *p++ = value; - } - return dst; -} - -static __inline__ void* memcpy2(void* dst, const void* src, uint32_t cnt) { - uint64_t *destination64 = dst; - const uint64_t *source64 = src; - while (cnt >= 8) { - *(destination64++)= *(source64++); - cnt -= 8; - } - - uint8_t *destination = (uint8_t*)destination64; - const uint8_t *source = (uint8_t*)source64; - while (cnt) { - *(destination++)= *(source++); - --cnt; - } - return dst; -} - -static __inline__ void memcpy16(void* dst, const void* src) { - uint64_t* dst64 = (uint64_t*)dst; - uint64_t* src64 = (uint64_t*)src; - - dst64[0] = src64[0]; - dst64[1] = src64[1]; -} - -static __inline__ void memcpy32(void* dst, const void* src) { - uint64_t* dst64 = (uint64_t*)dst; - uint64_t* src64 = (uint64_t*)src; - - #pragma clang loop unroll(full) - for (int i = 0; i < 4; i++) { - dst64[i] = src64[i]; - } -} - -static __inline__ void memcpy64(void* dst, const void* src) { - uint64_t* dst64 = (uint64_t*)dst; - uint64_t* src64 = (uint64_t*)src; - - #pragma clang loop unroll(full) - for (int i = 0; i < 8; i++) { - dst64[i] = src64[i]; - } -} - -static __inline__ uint64_t widen8to64(const uint8_t value) { - return value | (value << 8) | (value << 16) | (value << 24); -} - -static __inline__ void memset16(void* dst, const uint8_t value) { - uint64_t val = widen8to64(value); - uint64_t* dst64 = (uint64_t*)dst; - - dst64[0] = val; - dst64[1] = val; -} - -static __inline__ void memset32(void* dst, const uint8_t value) { - uint64_t val = widen8to64(value); - uint64_t* dst64 = (uint64_t*)dst; - - #pragma clang loop unroll(full) - for (int i = 0; i < 4; i++) { - dst64[i] = val; - } -} - -static __inline__ void memset64(void* dst, const uint8_t value) { - uint64_t val = widen8to64(value); - uint64_t* dst64 = (uint64_t*)dst; - - #pragma clang loop unroll(full) - for (int i = 0; i < 8; i++) { - dst64[i] = val; - } -} - -static __inline__ void memset128(void* dst, const uint8_t value) { - uint64_t val = widen8to64(value); - uint64_t* dst64 = (uint64_t*)dst; - - #pragma clang loop unroll(full) - for (int i = 0; i < 16; i++) { - dst64[i] = val; - } -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/src/md4.c b/tools/mnemonic-test/node_modules/hash-wasm/src/md4.c deleted file mode 100644 index 1661724c..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/src/md4.c +++ /dev/null @@ -1,290 +0,0 @@ -/* - * This is an OpenSSL-compatible implementation of the RSA Data Security, Inc. - * MD4 Message-Digest Algorithm (RFC 1320). - * - * Homepage: - * http://openwall.info/wiki/people/solar/software/public-domain-source-code/md4 - * - * Author: - * Alexander Peslyak, better known as Solar Designer - * - * This software was written by Alexander Peslyak in 2001. No copyright is - * claimed, and the software is hereby placed in the public domain. - * In case this attempt to disclaim copyright and place the software in the - * public domain is deemed null and void, then the software is - * Copyright (c) 2001 Alexander Peslyak and it is hereby released to the - * general public under the following terms: - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted. - * - * There's ABSOLUTELY NO WARRANTY, express or implied. - * - * (This is a heavily cut-down "BSD license".) - * - * This differs from Colin Plumb's older public domain implementation in that - * no exactly 32-bit integer data type is required (any 32-bit or wider - * unsigned integer data type will do), there's no compile-time endianness - * configuration, and the function prototypes match OpenSSL's. No code from - * Colin Plumb's implementation has been reused; this comment merely compares - * the properties of the two independent implementations. - * - * The primary goals of this implementation are portability and ease of use. - * It is meant to be fast, but not as fast as possible. Some known - * optimizations are not included to reduce source code size and avoid - * compile-time configuration. - * - * Modified for hash-wasm by Dani Biró - */ - -#define WITH_BUFFER -#include "hash-wasm.h" - -struct MD4_CTX { - uint32_t lo, hi; - uint32_t a, b, c, d; - uint8_t buffer[64]; - uint32_t block[16]; -}; - -struct MD4_CTX sctx; -struct MD4_CTX *ctx = &sctx; - -/* - * The basic MD4 functions. - * - * F and G are optimized compared to their RFC 1320 definitions, with the - * optimization for F borrowed from Colin Plumb's MD5 implementation. - */ -#define F(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) -#define G(x, y, z) (((x) & ((y) | (z))) | ((y) & (z))) -#define H(x, y, z) ((x) ^ (y) ^ (z)) - -/* - * The MD4 transformation for all three rounds. - */ -#define STEP(f, a, b, c, d, x, s) \ - (a) += f((b), (c), (d)) + (x); \ - (a) = (((a) << (s)) | (((a) & 0xffffffff) >> (32 - (s)))); - -/* - * SET reads 4 input bytes in little-endian byte order and stores them in a - * properly aligned word in host byte order. - * - * The check for little-endian architectures that tolerate unaligned memory - * accesses is just an optimization. Nothing will break if it fails to detect - * a suitable architecture. - * - * Unfortunately, this optimization may be a C strict aliasing rules violation - * if the caller's data buffer has effective type that cannot be aliased by - * uint32_t. In practice, this problem may occur if these MD4 routines are - * inlined into a calling function, or with future and dangerously advanced - * link-time optimizations. For the time being, keeping these MD4 routines in - * their own translation unit avoids the problem. - */ - -#define SET(n) (*(uint32_t *)&ptr[(n)*4]) -#define GET(n) SET(n) - -/* - * This processes one or more 64-byte data blocks, but does NOT update the bit - * counters. There are no alignment requirements. - */ -static const void *body(const void *data, uint32_t size) { - const uint8_t *ptr; - uint32_t a, b, c, d; - uint32_t saved_a, saved_b, saved_c, saved_d; - const uint32_t ac1 = 0x5a827999, ac2 = 0x6ed9eba1; - - ptr = (const uint8_t *)data; - - a = ctx->a; - b = ctx->b; - c = ctx->c; - d = ctx->d; - - do { - saved_a = a; - saved_b = b; - saved_c = c; - saved_d = d; - - /* Round 1 */ - STEP(F, a, b, c, d, SET(0), 3) - STEP(F, d, a, b, c, SET(1), 7) - STEP(F, c, d, a, b, SET(2), 11) - STEP(F, b, c, d, a, SET(3), 19) - STEP(F, a, b, c, d, SET(4), 3) - STEP(F, d, a, b, c, SET(5), 7) - STEP(F, c, d, a, b, SET(6), 11) - STEP(F, b, c, d, a, SET(7), 19) - STEP(F, a, b, c, d, SET(8), 3) - STEP(F, d, a, b, c, SET(9), 7) - STEP(F, c, d, a, b, SET(10), 11) - STEP(F, b, c, d, a, SET(11), 19) - STEP(F, a, b, c, d, SET(12), 3) - STEP(F, d, a, b, c, SET(13), 7) - STEP(F, c, d, a, b, SET(14), 11) - STEP(F, b, c, d, a, SET(15), 19) - - /* Round 2 */ - STEP(G, a, b, c, d, GET(0) + ac1, 3) - STEP(G, d, a, b, c, GET(4) + ac1, 5) - STEP(G, c, d, a, b, GET(8) + ac1, 9) - STEP(G, b, c, d, a, GET(12) + ac1, 13) - STEP(G, a, b, c, d, GET(1) + ac1, 3) - STEP(G, d, a, b, c, GET(5) + ac1, 5) - STEP(G, c, d, a, b, GET(9) + ac1, 9) - STEP(G, b, c, d, a, GET(13) + ac1, 13) - STEP(G, a, b, c, d, GET(2) + ac1, 3) - STEP(G, d, a, b, c, GET(6) + ac1, 5) - STEP(G, c, d, a, b, GET(10) + ac1, 9) - STEP(G, b, c, d, a, GET(14) + ac1, 13) - STEP(G, a, b, c, d, GET(3) + ac1, 3) - STEP(G, d, a, b, c, GET(7) + ac1, 5) - STEP(G, c, d, a, b, GET(11) + ac1, 9) - STEP(G, b, c, d, a, GET(15) + ac1, 13) - - /* Round 3 */ - STEP(H, a, b, c, d, GET(0) + ac2, 3) - STEP(H, d, a, b, c, GET(8) + ac2, 9) - STEP(H, c, d, a, b, GET(4) + ac2, 11) - STEP(H, b, c, d, a, GET(12) + ac2, 15) - STEP(H, a, b, c, d, GET(2) + ac2, 3) - STEP(H, d, a, b, c, GET(10) + ac2, 9) - STEP(H, c, d, a, b, GET(6) + ac2, 11) - STEP(H, b, c, d, a, GET(14) + ac2, 15) - STEP(H, a, b, c, d, GET(1) + ac2, 3) - STEP(H, d, a, b, c, GET(9) + ac2, 9) - STEP(H, c, d, a, b, GET(5) + ac2, 11) - STEP(H, b, c, d, a, GET(13) + ac2, 15) - STEP(H, a, b, c, d, GET(3) + ac2, 3) - STEP(H, d, a, b, c, GET(11) + ac2, 9) - STEP(H, c, d, a, b, GET(7) + ac2, 11) - STEP(H, b, c, d, a, GET(15) + ac2, 15) - - a += saved_a; - b += saved_b; - c += saved_c; - d += saved_d; - - ptr += 64; - } while (size -= 64); - - ctx->a = a; - ctx->b = b; - ctx->c = c; - ctx->d = d; - - return ptr; -} - -WASM_EXPORT -void Hash_Init() { - ctx->a = 0x67452301; - ctx->b = 0xefcdab89; - ctx->c = 0x98badcfe; - ctx->d = 0x10325476; - - ctx->lo = 0; - ctx->hi = 0; -} - -WASM_EXPORT -void Hash_Update(uint32_t size) { - const uint8_t *data = main_buffer; - uint32_t saved_lo; - uint32_t used, available; - - saved_lo = ctx->lo; - if ((ctx->lo = (saved_lo + size) & 0x1fffffff) < saved_lo) { - ctx->hi++; - } - ctx->hi += size >> 29; - - used = saved_lo & 0x3f; - - if (used) { - available = 64 - used; - - if (size < available) { - for (uint32_t i = 0; i < size; i++) { - ctx->buffer[used + i] = data[i]; - } - return; - } - - for (uint32_t i = 0; i < available; i++) { - ctx->buffer[used + i] = data[i]; - } - data = (const uint8_t *)data + available; - size -= available; - body(ctx->buffer, 64); - } - - if (size >= 64) { - data = body(data, size & ~(uint32_t)0x3f); - size &= 0x3f; - } - - for (uint32_t i = 0; i < size; i++) { - ctx->buffer[i] = data[i]; - } -} - -#define OUT(dst, src) \ - (dst)[0] = (uint8_t)(src); \ - (dst)[1] = (uint8_t)((src) >> 8); \ - (dst)[2] = (uint8_t)((src) >> 16); \ - (dst)[3] = (uint8_t)((src) >> 24); - -WASM_EXPORT -void Hash_Final() { - uint8_t *result = main_buffer; - uint32_t used, available; - - used = ctx->lo & 0x3f; - - ctx->buffer[used++] = 0x80; - - available = 64 - used; - - if (available < 8) { - for (int i = 0; i < available; i++) { - ctx->buffer[used + i] = 0; - } - body(ctx->buffer, 64); - used = 0; - available = 64; - } - - for (int i = available - 9; i >= 0; i--) { - ctx->buffer[used + i] = 0; - } - - ctx->lo <<= 3; - OUT(&ctx->buffer[56], ctx->lo) - OUT(&ctx->buffer[60], ctx->hi) - - body(ctx->buffer, 64); - - OUT(&result[0], ctx->a) - OUT(&result[4], ctx->b) - OUT(&result[8], ctx->c) - OUT(&result[12], ctx->d) -} - -WASM_EXPORT -const uint32_t STATE_SIZE = sizeof(*ctx); - -WASM_EXPORT -uint8_t* Hash_GetState() { - return (uint8_t*) ctx; -} - -WASM_EXPORT -void Hash_Calculate(uint32_t length) { - Hash_Init(); - Hash_Update(length); - Hash_Final(); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/src/md5.c b/tools/mnemonic-test/node_modules/hash-wasm/src/md5.c deleted file mode 100644 index 54a91c8f..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/src/md5.c +++ /dev/null @@ -1,311 +0,0 @@ -/* - * This is an OpenSSL-compatible implementation of the RSA Data Security, Inc. - * MD5 Message-Digest Algorithm (RFC 1321). - * - * Homepage: - * http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5 - * - * Author: - * Alexander Peslyak, better known as Solar Designer - * - * This software was written by Alexander Peslyak in 2001. No copyright is - * claimed, and the software is hereby placed in the public domain. - * In case this attempt to disclaim copyright and place the software in the - * public domain is deemed null and void, then the software is - * Copyright (c) 2001 Alexander Peslyak and it is hereby released to the - * general public under the following terms: - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted. - * - * There's ABSOLUTELY NO WARRANTY, express or implied. - * - * (This is a heavily cut-down "BSD license".) - * - * This differs from Colin Plumb's older public domain implementation in that - * no exactly 32-bit integer data type is required (any 32-bit or wider - * unsigned integer data type will do), there's no compile-time endianness - * configuration, and the function prototypes match OpenSSL's. No code from - * Colin Plumb's implementation has been reused; this comment merely compares - * the properties of the two independent implementations. - * - * The primary goals of this implementation are portability and ease of use. - * It is meant to be fast, but not as fast as possible. Some known - * optimizations are not included to reduce source code size and avoid - * compile-time configuration. - * - * Modified for hash-wasm by Dani Biró - */ - -#define WITH_BUFFER -#include "hash-wasm.h" - -struct MD5_CTX { - uint32_t lo, hi; - uint32_t a, b, c, d; - uint8_t buffer[64]; - uint32_t block[16]; -}; - -struct MD5_CTX sctx; -struct MD5_CTX *ctx = &sctx; - -/* - * The basic MD5 functions. - * - * F and G are optimized compared to their RFC 1321 definitions for - * architectures that lack an AND-NOT instruction, just like in Colin Plumb's - * implementation. - */ -#define F(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) -#define G(x, y, z) ((y) ^ ((z) & ((x) ^ (y)))) -#define H(x, y, z) (((x) ^ (y)) ^ (z)) -#define H2(x, y, z) ((x) ^ ((y) ^ (z))) -#define I(x, y, z) ((y) ^ ((x) | ~(z))) - -/* - * The MD5 transformation for all four rounds. - */ -#define STEP(f, a, b, c, d, x, t, s) \ - (a) += f((b), (c), (d)) + (x) + (t); \ - (a) = (((a) << (s)) | (((a)&0xffffffff) >> (32 - (s)))); \ - (a) += (b); - -/* - * SET reads 4 input bytes in little-endian byte order and stores them in a - * properly aligned word in host byte order. - * - * The check for little-endian architectures that tolerate unaligned memory - * accesses is just an optimization. Nothing will break if it fails to detect - * a suitable architecture. - * - * Unfortunately, this optimization may be a C strict aliasing rules violation - * if the caller's data buffer has effective type that cannot be aliased by - * uint32_t. In practice, this problem may occur if these MD5 routines are - * inlined into a calling function, or with future and dangerously advanced - * link-time optimizations. For the time being, keeping these MD5 routines in - * their own translation unit avoids the problem. - */ - -#define SET(n) (*(uint32_t *)&ptr[(n)*4]) -#define GET(n) SET(n) - -/* - * This processes one or more 64-byte data blocks, but does NOT update the bit - * counters. There are no alignment requirements. - */ -static const void *body(const void *data, uint32_t size) { - const uint8_t *ptr; - uint32_t a, b, c, d; - uint32_t saved_a, saved_b, saved_c, saved_d; - - ptr = (const uint8_t *)data; - - a = ctx->a; - b = ctx->b; - c = ctx->c; - d = ctx->d; - - do { - saved_a = a; - saved_b = b; - saved_c = c; - saved_d = d; - - /* Round 1 */ - STEP(F, a, b, c, d, SET(0), 0xd76aa478, 7) - STEP(F, d, a, b, c, SET(1), 0xe8c7b756, 12) - STEP(F, c, d, a, b, SET(2), 0x242070db, 17) - STEP(F, b, c, d, a, SET(3), 0xc1bdceee, 22) - STEP(F, a, b, c, d, SET(4), 0xf57c0faf, 7) - STEP(F, d, a, b, c, SET(5), 0x4787c62a, 12) - STEP(F, c, d, a, b, SET(6), 0xa8304613, 17) - STEP(F, b, c, d, a, SET(7), 0xfd469501, 22) - STEP(F, a, b, c, d, SET(8), 0x698098d8, 7) - STEP(F, d, a, b, c, SET(9), 0x8b44f7af, 12) - STEP(F, c, d, a, b, SET(10), 0xffff5bb1, 17) - STEP(F, b, c, d, a, SET(11), 0x895cd7be, 22) - STEP(F, a, b, c, d, SET(12), 0x6b901122, 7) - STEP(F, d, a, b, c, SET(13), 0xfd987193, 12) - STEP(F, c, d, a, b, SET(14), 0xa679438e, 17) - STEP(F, b, c, d, a, SET(15), 0x49b40821, 22) - - /* Round 2 */ - STEP(G, a, b, c, d, GET(1), 0xf61e2562, 5) - STEP(G, d, a, b, c, GET(6), 0xc040b340, 9) - STEP(G, c, d, a, b, GET(11), 0x265e5a51, 14) - STEP(G, b, c, d, a, GET(0), 0xe9b6c7aa, 20) - STEP(G, a, b, c, d, GET(5), 0xd62f105d, 5) - STEP(G, d, a, b, c, GET(10), 0x02441453, 9) - STEP(G, c, d, a, b, GET(15), 0xd8a1e681, 14) - STEP(G, b, c, d, a, GET(4), 0xe7d3fbc8, 20) - STEP(G, a, b, c, d, GET(9), 0x21e1cde6, 5) - STEP(G, d, a, b, c, GET(14), 0xc33707d6, 9) - STEP(G, c, d, a, b, GET(3), 0xf4d50d87, 14) - STEP(G, b, c, d, a, GET(8), 0x455a14ed, 20) - STEP(G, a, b, c, d, GET(13), 0xa9e3e905, 5) - STEP(G, d, a, b, c, GET(2), 0xfcefa3f8, 9) - STEP(G, c, d, a, b, GET(7), 0x676f02d9, 14) - STEP(G, b, c, d, a, GET(12), 0x8d2a4c8a, 20) - - /* Round 3 */ - STEP(H, a, b, c, d, GET(5), 0xfffa3942, 4) - STEP(H2, d, a, b, c, GET(8), 0x8771f681, 11) - STEP(H, c, d, a, b, GET(11), 0x6d9d6122, 16) - STEP(H2, b, c, d, a, GET(14), 0xfde5380c, 23) - STEP(H, a, b, c, d, GET(1), 0xa4beea44, 4) - STEP(H2, d, a, b, c, GET(4), 0x4bdecfa9, 11) - STEP(H, c, d, a, b, GET(7), 0xf6bb4b60, 16) - STEP(H2, b, c, d, a, GET(10), 0xbebfbc70, 23) - STEP(H, a, b, c, d, GET(13), 0x289b7ec6, 4) - STEP(H2, d, a, b, c, GET(0), 0xeaa127fa, 11) - STEP(H, c, d, a, b, GET(3), 0xd4ef3085, 16) - STEP(H2, b, c, d, a, GET(6), 0x04881d05, 23) - STEP(H, a, b, c, d, GET(9), 0xd9d4d039, 4) - STEP(H2, d, a, b, c, GET(12), 0xe6db99e5, 11) - STEP(H, c, d, a, b, GET(15), 0x1fa27cf8, 16) - STEP(H2, b, c, d, a, GET(2), 0xc4ac5665, 23) - - /* Round 4 */ - STEP(I, a, b, c, d, GET(0), 0xf4292244, 6) - STEP(I, d, a, b, c, GET(7), 0x432aff97, 10) - STEP(I, c, d, a, b, GET(14), 0xab9423a7, 15) - STEP(I, b, c, d, a, GET(5), 0xfc93a039, 21) - STEP(I, a, b, c, d, GET(12), 0x655b59c3, 6) - STEP(I, d, a, b, c, GET(3), 0x8f0ccc92, 10) - STEP(I, c, d, a, b, GET(10), 0xffeff47d, 15) - STEP(I, b, c, d, a, GET(1), 0x85845dd1, 21) - STEP(I, a, b, c, d, GET(8), 0x6fa87e4f, 6) - STEP(I, d, a, b, c, GET(15), 0xfe2ce6e0, 10) - STEP(I, c, d, a, b, GET(6), 0xa3014314, 15) - STEP(I, b, c, d, a, GET(13), 0x4e0811a1, 21) - STEP(I, a, b, c, d, GET(4), 0xf7537e82, 6) - STEP(I, d, a, b, c, GET(11), 0xbd3af235, 10) - STEP(I, c, d, a, b, GET(2), 0x2ad7d2bb, 15) - STEP(I, b, c, d, a, GET(9), 0xeb86d391, 21) - - a += saved_a; - b += saved_b; - c += saved_c; - d += saved_d; - - ptr += 64; - } while (size -= 64); - - ctx->a = a; - ctx->b = b; - ctx->c = c; - ctx->d = d; - - return ptr; -} - -WASM_EXPORT -void Hash_Init() { - ctx->a = 0x67452301; - ctx->b = 0xefcdab89; - ctx->c = 0x98badcfe; - ctx->d = 0x10325476; - - ctx->lo = 0; - ctx->hi = 0; -} - -WASM_EXPORT -void Hash_Update(uint32_t size) { - const uint8_t *data = main_buffer; - uint32_t saved_lo; - uint32_t used, available; - - saved_lo = ctx->lo; - if ((ctx->lo = (saved_lo + size) & 0x1fffffff) < saved_lo) { - ctx->hi++; - } - ctx->hi += size >> 29; - - used = saved_lo & 0x3f; - - if (used) { - available = 64 - used; - - if (size < available) { - for (uint32_t i = 0; i < size; i++) { - ctx->buffer[used + i] = data[i]; - } - return; - } - - for (uint32_t i = 0; i < available; i++) { - ctx->buffer[used + i] = data[i]; - } - data = (const uint8_t *)data + available; - size -= available; - body(ctx->buffer, 64); - } - - if (size >= 64) { - data = body(data, size & ~(uint32_t)0x3f); - size &= 0x3f; - } - - for (uint32_t i = 0; i < size; i++) { - ctx->buffer[i] = data[i]; - } -} - -#define OUT(dst, src) \ - (dst)[0] = (uint8_t)(src); \ - (dst)[1] = (uint8_t)((src) >> 8); \ - (dst)[2] = (uint8_t)((src) >> 16); \ - (dst)[3] = (uint8_t)((src) >> 24); - -WASM_EXPORT -void Hash_Final() { - uint8_t *result = main_buffer; - uint32_t used, available; - - used = ctx->lo & 0x3f; - - ctx->buffer[used++] = 0x80; - - available = 64 - used; - - if (available < 8) { - for (int i = 0; i < available; i++) { - ctx->buffer[used + i] = 0; - } - body(ctx->buffer, 64); - used = 0; - available = 64; - } - - for (int i = available - 9; i >= 0; i--) { - ctx->buffer[used + i] = 0; - } - - ctx->lo <<= 3; - OUT(&ctx->buffer[56], ctx->lo) - OUT(&ctx->buffer[60], ctx->hi) - - body(ctx->buffer, 64); - - OUT(&result[0], ctx->a) - OUT(&result[4], ctx->b) - OUT(&result[8], ctx->c) - OUT(&result[12], ctx->d) -} - -WASM_EXPORT -const uint32_t STATE_SIZE = sizeof(*ctx); - -WASM_EXPORT -uint8_t* Hash_GetState() { - return (uint8_t*) ctx; -} - -WASM_EXPORT -void Hash_Calculate(uint32_t length) { - Hash_Init(); - Hash_Update(length); - Hash_Final(); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/src/ripemd160.c b/tools/mnemonic-test/node_modules/hash-wasm/src/ripemd160.c deleted file mode 100644 index 7d6f0e7e..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/src/ripemd160.c +++ /dev/null @@ -1,308 +0,0 @@ -/* - * RIPE MD-160 implementation - * - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - * - * Modified for hash-wasm by Dani Biró - */ - -/* - * The RIPEMD-160 algorithm was designed by RIPE in 1996 - * http://homes.esat.kuleuven.be/~bosselae/ripemd160.html - * http://ehash.iaik.tugraz.at/wiki/RIPEMD-160 - */ - -#define WITH_BUFFER -#include "hash-wasm.h" - -#define RIPEMD160_BLOCK_LENGTH 64 -#define RIPEMD160_DIGEST_LENGTH 20 - -struct RIPEMD160_CTX { - uint32_t total[2]; - uint32_t state[5]; - uint8_t buffer[RIPEMD160_BLOCK_LENGTH]; -}; - -struct RIPEMD160_CTX sctx; -struct RIPEMD160_CTX* ctx = &sctx; - - -WASM_EXPORT -void Hash_Init() { - ctx->total[0] = 0; - ctx->total[1] = 0; - ctx->state[0] = 0x67452301; - ctx->state[1] = 0xEFCDAB89; - ctx->state[2] = 0x98BADCFE; - ctx->state[3] = 0x10325476; - ctx->state[4] = 0xC3D2E1F0; -} - -void ripemd160_process(const uint8_t data[RIPEMD160_BLOCK_LENGTH]) { - uint32_t A, B, C, D, E, Ap, Bp, Cp, Dp, Ep, X[16]; - - #pragma clang loop unroll(full) - for (uint8_t i = 0; i < 16; i++) { - X[i] = ((uint32_t*)data)[i]; - } - - A = Ap = ctx->state[0]; - B = Bp = ctx->state[1]; - C = Cp = ctx->state[2]; - D = Dp = ctx->state[3]; - E = Ep = ctx->state[4]; - -#define F1(x, y, z) (x ^ y ^ z) -#define F2(x, y, z) ((x & y) | (~x & z)) -#define F3(x, y, z) ((x | ~y) ^ z) -#define F4(x, y, z) ((x & z) | (y & ~z)) -#define F5(x, y, z) (x ^ (y | ~z)) - -#define S(x, n) ((x << n) | (x >> (32 - n))) - -#define P(a, b, c, d, e, r, s, f, k) \ - a += f(b, c, d) + X[r] + k; \ - a = S(a, s) + e; \ - c = S(c, 10); - -#define P2(a, b, c, d, e, r, s, rp, sp) \ - P(a, b, c, d, e, r, s, F, K); \ - P(a ## p, b ## p, c ## p, d ## p, e ## p, rp, sp, Fp, Kp); - -#define F F1 -#define K 0x00000000 -#define Fp F5 -#define Kp 0x50A28BE6 - P2(A, B, C, D, E, 0, 11, 5, 8); - P2(E, A, B, C, D, 1, 14, 14, 9); - P2(D, E, A, B, C, 2, 15, 7, 9); - P2(C, D, E, A, B, 3, 12, 0, 11); - P2(B, C, D, E, A, 4, 5, 9, 13); - P2(A, B, C, D, E, 5, 8, 2, 15); - P2(E, A, B, C, D, 6, 7, 11, 15); - P2(D, E, A, B, C, 7, 9, 4, 5); - P2(C, D, E, A, B, 8, 11, 13, 7); - P2(B, C, D, E, A, 9, 13, 6, 7); - P2(A, B, C, D, E, 10, 14, 15, 8); - P2(E, A, B, C, D, 11, 15, 8, 11); - P2(D, E, A, B, C, 12, 6, 1, 14); - P2(C, D, E, A, B, 13, 7, 10, 14); - P2(B, C, D, E, A, 14, 9, 3, 12); - P2(A, B, C, D, E, 15, 8, 12, 6); -#undef F -#undef K -#undef Fp -#undef Kp - -#define F F2 -#define K 0x5A827999 -#define Fp F4 -#define Kp 0x5C4DD124 - P2(E, A, B, C, D, 7, 7, 6, 9); - P2(D, E, A, B, C, 4, 6, 11, 13); - P2(C, D, E, A, B, 13, 8, 3, 15); - P2(B, C, D, E, A, 1, 13, 7, 7); - P2(A, B, C, D, E, 10, 11, 0, 12); - P2(E, A, B, C, D, 6, 9, 13, 8); - P2(D, E, A, B, C, 15, 7, 5, 9); - P2(C, D, E, A, B, 3, 15, 10, 11); - P2(B, C, D, E, A, 12, 7, 14, 7); - P2(A, B, C, D, E, 0, 12, 15, 7); - P2(E, A, B, C, D, 9, 15, 8, 12); - P2(D, E, A, B, C, 5, 9, 12, 7); - P2(C, D, E, A, B, 2, 11, 4, 6); - P2(B, C, D, E, A, 14, 7, 9, 15); - P2(A, B, C, D, E, 11, 13, 1, 13); - P2(E, A, B, C, D, 8, 12, 2, 11); -#undef F -#undef K -#undef Fp -#undef Kp - -#define F F3 -#define K 0x6ED9EBA1 -#define Fp F3 -#define Kp 0x6D703EF3 - P2(D, E, A, B, C, 3, 11, 15, 9); - P2(C, D, E, A, B, 10, 13, 5, 7); - P2(B, C, D, E, A, 14, 6, 1, 15); - P2(A, B, C, D, E, 4, 7, 3, 11); - P2(E, A, B, C, D, 9, 14, 7, 8); - P2(D, E, A, B, C, 15, 9, 14, 6); - P2(C, D, E, A, B, 8, 13, 6, 6); - P2(B, C, D, E, A, 1, 15, 9, 14); - P2(A, B, C, D, E, 2, 14, 11, 12); - P2(E, A, B, C, D, 7, 8, 8, 13); - P2(D, E, A, B, C, 0, 13, 12, 5); - P2(C, D, E, A, B, 6, 6, 2, 14); - P2(B, C, D, E, A, 13, 5, 10, 13); - P2(A, B, C, D, E, 11, 12, 0, 13); - P2(E, A, B, C, D, 5, 7, 4, 7); - P2(D, E, A, B, C, 12, 5, 13, 5); -#undef F -#undef K -#undef Fp -#undef Kp - -#define F F4 -#define K 0x8F1BBCDC -#define Fp F2 -#define Kp 0x7A6D76E9 - P2(C, D, E, A, B, 1, 11, 8, 15); - P2(B, C, D, E, A, 9, 12, 6, 5); - P2(A, B, C, D, E, 11, 14, 4, 8); - P2(E, A, B, C, D, 10, 15, 1, 11); - P2(D, E, A, B, C, 0, 14, 3, 14); - P2(C, D, E, A, B, 8, 15, 11, 14); - P2(B, C, D, E, A, 12, 9, 15, 6); - P2(A, B, C, D, E, 4, 8, 0, 14); - P2(E, A, B, C, D, 13, 9, 5, 6); - P2(D, E, A, B, C, 3, 14, 12, 9); - P2(C, D, E, A, B, 7, 5, 2, 12); - P2(B, C, D, E, A, 15, 6, 13, 9); - P2(A, B, C, D, E, 14, 8, 9, 12); - P2(E, A, B, C, D, 5, 6, 7, 5); - P2(D, E, A, B, C, 6, 5, 10, 15); - P2(C, D, E, A, B, 2, 12, 14, 8); -#undef F -#undef K -#undef Fp -#undef Kp - -#define F F5 -#define K 0xA953FD4E -#define Fp F1 -#define Kp 0x00000000 - P2(B, C, D, E, A, 4, 9, 12, 8); - P2(A, B, C, D, E, 0, 15, 15, 5); - P2(E, A, B, C, D, 5, 5, 10, 12); - P2(D, E, A, B, C, 9, 11, 4, 9); - P2(C, D, E, A, B, 7, 6, 1, 12); - P2(B, C, D, E, A, 12, 8, 5, 5); - P2(A, B, C, D, E, 2, 13, 8, 14); - P2(E, A, B, C, D, 10, 12, 7, 6); - P2(D, E, A, B, C, 14, 5, 6, 8); - P2(C, D, E, A, B, 1, 12, 2, 13); - P2(B, C, D, E, A, 3, 13, 13, 6); - P2(A, B, C, D, E, 8, 14, 14, 5); - P2(E, A, B, C, D, 11, 11, 0, 15); - P2(D, E, A, B, C, 6, 8, 3, 13); - P2(C, D, E, A, B, 15, 5, 9, 11); - P2(B, C, D, E, A, 13, 6, 11, 11); -#undef F -#undef K -#undef Fp -#undef Kp - C = ctx->state[1] + C + Dp; - ctx->state[1] = ctx->state[2] + D + Ep; - ctx->state[2] = ctx->state[3] + E + Ap; - ctx->state[3] = ctx->state[4] + A + Bp; - ctx->state[4] = ctx->state[0] + B + Cp; - ctx->state[0] = C; -} - -WASM_EXPORT -void ripemd160_update(const uint8_t* input, uint32_t ilen) { - uint32_t fill; - uint32_t left; - - if (ilen == 0) { - return; - } - - left = ctx->total[0] & 0x3F; - fill = RIPEMD160_BLOCK_LENGTH - left; - - ctx->total[0] += (uint32_t)ilen; - ctx->total[0] &= 0xFFFFFFFF; - - if (ctx->total[0] < (uint32_t)ilen) { - ctx->total[1]++; - } - - if (left && ilen >= fill) { - for (uint8_t i = 0; i < fill; i++) { - ctx->buffer[left + i] = input[i]; - } - ripemd160_process(ctx->buffer); - input += fill; - ilen -= fill; - left = 0; - } - - while (ilen >= RIPEMD160_BLOCK_LENGTH) { - ripemd160_process(input); - input += RIPEMD160_BLOCK_LENGTH; - ilen -= RIPEMD160_BLOCK_LENGTH; - } - - if (ilen > 0) { - for (uint8_t i = 0; i < ilen; i++) { - ctx->buffer[left + i] = input[i]; - } - } -} - -WASM_EXPORT -void Hash_Update(uint32_t ilen) { - ripemd160_update(main_buffer, ilen); -} - -static const uint8_t ripemd160_padding[RIPEMD160_BLOCK_LENGTH] = { - 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -WASM_EXPORT -void Hash_Final() { - uint8_t* result = main_buffer; - uint32_t last, padn; - uint8_t msglen[8]; - - ((uint32_t*)msglen)[0] = (ctx->total[0] << 3); - ((uint32_t*)msglen)[1] = (ctx->total[0] >> 29) | (ctx->total[1] << 3); - - last = ctx->total[0] & 0x3F; - padn = (last < 56) ? (56 - last) : (120 - last); - - ripemd160_update(ripemd160_padding, padn); - ripemd160_update(msglen, 8); - - #pragma clang loop unroll(full) - for (int i = 0; i < 5; i++) { - ((uint32_t*)result)[i] = ctx->state[i]; - } -} - -WASM_EXPORT -const uint32_t STATE_SIZE = sizeof(*ctx); - -WASM_EXPORT -uint8_t* Hash_GetState() { - return (uint8_t*) ctx; -} - -WASM_EXPORT -void Hash_Calculate(uint32_t length) { - Hash_Init(); - Hash_Update(length); - Hash_Final(); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/src/scrypt.c b/tools/mnemonic-test/node_modules/hash-wasm/src/scrypt.c deleted file mode 100644 index 5271ed84..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/src/scrypt.c +++ /dev/null @@ -1,294 +0,0 @@ -/* - * Copyright 2009 Colin Percival - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file was originally written by Colin Percival as part of the Tarsnap - * online backup system. - * - * Modified for hash-wasm by Dani Biró - */ - -#include "hash-wasm.h" - -#define BYTES_PER_PAGE 65536 - -uint8_t *B = NULL; -uint64_t B_size = 0; - -WASM_EXPORT -int8_t Hash_SetMemorySize(uint32_t total_bytes) { - uint32_t bytes_required = total_bytes - B_size; - - if (bytes_required > 0) { - uint32_t blocks = bytes_required / BYTES_PER_PAGE; - if (blocks * BYTES_PER_PAGE < bytes_required) { - blocks += 1; - } - - if (__builtin_wasm_memory_grow(0, blocks) == -1) { - return -1; - } - - B_size += blocks * BYTES_PER_PAGE; - } - - return 0; -} - -WASM_EXPORT -uint8_t *Hash_GetBuffer() { - if (B == NULL) { - // start of new memory - B = (uint8_t *)(__builtin_wasm_memory_size(0) * BYTES_PER_PAGE); - // always preallocate 16kb to not cause problems with the other hashes - if (Hash_SetMemorySize(512 * 1024) == -1) { - return NULL; - } - } - - return B; -} - -static inline uint32_t le32dec(const void *pp) { - return ((uint32_t *)pp)[0]; -} - -static inline void le32enc(void *pp, uint32_t x) { - ((uint32_t *)pp)[0] = x; -} - -/** - * salsa20_8(B): - * Apply the salsa20/8 core to the provided block. - */ -static void salsa20_8(uint32_t B[16]) { - uint32_t x[16]; - - #pragma clang loop unroll(full) - for (uint8_t i = 0; i < 8; i++) { - ((uint64_t *)x)[i] = ((uint64_t *)B)[i]; - } - - #pragma clang loop unroll(full) - for (uint8_t i = 0; i < 8; i += 2) { - #define R(a, b) (((a) << (b)) | ((a) >> (32 - (b)))) - /* Operate on columns. */ - x[4] ^= R(x[0] + x[12], 7); - x[8] ^= R(x[4] + x[0], 9); - x[12] ^= R(x[8] + x[4], 13); - x[0] ^= R(x[12] + x[8], 18); - - x[9] ^= R(x[5] + x[1], 7); - x[13] ^= R(x[9] + x[5], 9); - x[1] ^= R(x[13] + x[9], 13); - x[5] ^= R(x[1] + x[13], 18); - - x[14] ^= R(x[10] + x[6], 7); - x[2] ^= R(x[14] + x[10], 9); - x[6] ^= R(x[2] + x[14], 13); - x[10] ^= R(x[6] + x[2], 18); - - x[3] ^= R(x[15] + x[11], 7); - x[7] ^= R(x[3] + x[15], 9); - x[11] ^= R(x[7] + x[3], 13); - x[15] ^= R(x[11] + x[7], 18); - - /* Operate on rows. */ - x[1] ^= R(x[0] + x[3], 7); - x[2] ^= R(x[1] + x[0], 9); - x[3] ^= R(x[2] + x[1], 13); - x[0] ^= R(x[3] + x[2], 18); - - x[6] ^= R(x[5] + x[4], 7); - x[7] ^= R(x[6] + x[5], 9); - x[4] ^= R(x[7] + x[6], 13); - x[5] ^= R(x[4] + x[7], 18); - - x[11] ^= R(x[10] + x[9], 7); - x[8] ^= R(x[11] + x[10], 9); - x[9] ^= R(x[8] + x[11], 13); - x[10] ^= R(x[9] + x[8], 18); - - x[12] ^= R(x[15] + x[14], 7); - x[13] ^= R(x[12] + x[15], 9); - x[14] ^= R(x[13] + x[12], 13); - x[15] ^= R(x[14] + x[13], 18); - #undef R - } - - #pragma clang loop unroll(full) - for (uint8_t i = 0; i < 16; i++) { - B[i] += x[i]; - } -} - -/** - * blockmix_salsa8(Bin, Bout, X, r): - * Compute Bout = BlockMix_{salsa20/8, r}(Bin). The input Bin must be 128r - * bytes in length; the output Bout must also be the same size. The - * temporary space X must be 64 bytes. - */ -static void blockmix_salsa8(const uint32_t *Bin, uint32_t *Bout, uint32_t *X, int r) { - /* 1: X <-- B_{2r - 1} */ - #pragma clang loop unroll(full) - for (uint8_t i = 0; i < 8; i++) { - ((uint64_t *)X)[i] = ((uint64_t *)&Bin[(2 * r - 1) * 16])[i]; - } - - /* 2: for i = 0 to 2r - 1 do */ - for (uint32_t i = 0; i < 2 * r; i += 2) { - /* 3: X <-- H(X \xor B_i) */ - #pragma clang loop unroll(full) - for (uint8_t j = 0; j < 8; j++) { - ((uint64_t *)X)[j] ^= ((uint64_t *)&Bin[i * 16])[j]; - } - salsa20_8(X); - - /* 4: Y_i <-- X */ - /* 6: B' <-- (Y_0, Y_2 ... Y_{2r-2}, Y_1, Y_3 ... Y_{2r-1}) */ - #pragma clang loop unroll(full) - for (uint8_t j = 0; j < 8; j++) { - ((uint64_t *)&Bout[i * 8])[j] = ((uint64_t *)X)[j]; - } - - /* 3: X <-- H(X \xor B_i) */ - #pragma clang loop unroll(full) - for (uint8_t j = 0; j < 8; j++) { - ((uint64_t *)X)[j] ^= ((uint64_t *)&Bin[i * 16 + 16])[j]; - } - salsa20_8(X); - - /* 4: Y_i <-- X */ - /* 6: B' <-- (Y_0, Y_2 ... Y_{2r-2}, Y_1, Y_3 ... Y_{2r-1}) */ - #pragma clang loop unroll(full) - for (uint8_t j = 0; j < 8; j++) { - ((uint64_t *)&Bout[i * 8 + r * 16])[j] = ((uint64_t *)X)[j]; - } - } -} - -/** - * integerify(B, r): - * Return the result of parsing B_{2r-1} as a little-endian integer. - */ -static inline uint64_t integerify(const void *B, int r) { - const uint32_t *X = (const void *)((uintptr_t)(B) + (2 * r - 1) * 64); - - return (((uint64_t)(X[1]) << 32) + X[0]); -} - -/** - * smix(B, r, N, V, XY): - * Compute B = SMix_r(B, N). The input B must be 128r bytes in length; - * the temporary storage V must be 128rN bytes in length; the temporary - * storage XY must be 256r + 64 bytes in length. The value N must be a - * power of 2 greater than 1. The arrays B, V, and XY must be aligned to a - * multiple of 64 bytes. - */ -void smix(uint8_t *B, int r, uint64_t N, void *_V, void *XY) { - uint32_t *X = XY; - uint32_t *Y = (void *)((uint8_t *)(XY) + 128 * r); - uint32_t *Z = (void *)((uint8_t *)(XY) + 256 * r); - uint32_t *V = _V; - - /* 1: X <-- B */ - for (uint32_t k = 0; k < 32 * r; k++) { - X[k] = le32dec(&B[4 * k]); - } - - /* 2: for i = 0 to N - 1 do */ - for (uint32_t i = 0; i < N; i += 2) { - /* 3: V_i <-- X */ - - for (uint32_t j = 0; j < r; j++) { - uint64_t *dest = &(((uint64_t *)&V[i * (32 * r)])[j * 16]); - uint64_t *src = &(((uint64_t *)X)[j * 16]); - #pragma clang loop unroll(full) - for (uint8_t jj = 0; jj < 16; jj++) { - dest[jj] = src[jj]; - } - } - /* 4: X <-- H(X) */ - blockmix_salsa8(X, Y, Z, r); - - /* 3: V_i <-- X */ - for (uint32_t j = 0; j < r; j++) { - uint64_t *dest = &(((uint64_t *)&V[(i + 1) * (32 * r)])[j * 16]); - uint64_t *src = &(((uint64_t *)Y)[j * 16]); - #pragma clang loop unroll(full) - for (uint8_t jj = 0; jj < 16; jj++) { - dest[jj] = src[jj]; - } - } - - /* 4: X <-- H(X) */ - blockmix_salsa8(Y, X, Z, r); - } - - /* 6: for i = 0 to N - 1 do */ - for (uint32_t i = 0; i < N; i += 2) { - /* 7: j <-- Integerify(X) mod N */ - uint32_t j = integerify(X, r) & (N - 1); - - /* 8: X <-- H(X \xor V_j) */ - for (uint32_t z = 0; z < r; z++) { - uint64_t *dest = &(((uint64_t *)X)[z * 16]); - uint64_t *src = &(((uint64_t *)&V[j * (32 * r)])[z * 16]); - #pragma clang loop unroll(full) - for (uint8_t zz = 0; zz < 16; zz++) { - dest[zz] ^= src[zz]; - } - } - blockmix_salsa8(X, Y, Z, r); - - /* 7: j <-- Integerify(X) mod N */ - j = integerify(Y, r) & (N - 1); - - /* 8: X <-- H(X \xor V_j) */ - for (uint32_t z = 0; z < r; z++) { - uint64_t *dest = &(((uint64_t *)Y)[z * 16]); - uint64_t *src = &(((uint64_t *)&V[j * (32 * r)])[z * 16]); - #pragma clang loop unroll(full) - for (uint8_t zz = 0; zz < 16; zz++) { - dest[zz] ^= src[zz]; - } - } - blockmix_salsa8(Y, X, Z, r); - } - - /* 10: B' <-- X */ - for (uint32_t k = 0; k < 32 * r; k++) { - le32enc(&B[4 * k], X[k]); - } -} - -WASM_EXPORT -void scrypt(uint32_t blockSize, uint32_t costFactor, uint32_t parallelism) { - uint8_t *V = &B[128 * blockSize * parallelism]; - uint8_t *XY = &V[128 * blockSize * costFactor]; - - for (uint32_t i = 0; i < parallelism; i++) { - smix(&B[i * 128 * blockSize], blockSize, costFactor, V, XY); - } -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/src/sha1.c b/tools/mnemonic-test/node_modules/hash-wasm/src/sha1.c deleted file mode 100644 index e56c8c81..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/src/sha1.c +++ /dev/null @@ -1,192 +0,0 @@ -/* -SHA-1 in C -By Steve Reid -100% Public Domain - -Modified for hash-wasm by Dani Biró -*/ - -#define WITH_BUFFER -#include "hash-wasm.h" - -#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) - -/* blk0() and blk() perform the initial expand. */ -/* I got the idea of expanding during the round function from SSLeay */ -#define blk0(i) \ - (block->l[i] = (rol(block->l[i], 24) & 0xFF00FF00) | \ - (rol(block->l[i], 8) & 0x00FF00FF)) - -#define blk(i) \ - (block->l[i & 15] = rol(block->l[(i + 13) & 15] ^ \ - block->l[(i + 8) & 15] ^ \ - block->l[(i + 2) & 15] ^ \ - block->l[i & 15], \ - 1)) - -struct SHA1_CTX { - uint32_t state[5]; - uint32_t count[2]; - uint8_t buffer[64]; -}; - -struct SHA1_CTX sctx; -struct SHA1_CTX* context = &sctx; - -/* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */ -#define R0(v, w, x, y, z, i) \ - z += ((w & (x ^ y)) ^ y) + blk0(i) + 0x5A827999 + rol(v, 5); \ - w = rol(w, 30); -#define R1(v, w, x, y, z, i) \ - z += ((w & (x ^ y)) ^ y) + blk(i) + 0x5A827999 + rol(v, 5); \ - w = rol(w, 30); -#define R2(v, w, x, y, z, i) \ - z += (w ^ x ^ y) + blk(i) + 0x6ED9EBA1 + rol(v, 5); \ - w = rol(w, 30); -#define R3(v, w, x, y, z, i) \ - z += (((w | x) & y) | (w & x)) + blk(i) + 0x8F1BBCDC + rol(v, 5); \ - w = rol(w, 30); -#define R4(v, w, x, y, z, i) \ - z += (w ^ x ^ y) + blk(i) + 0xCA62C1D6 + rol(v, 5); \ - w = rol(w, 30); - -/* Hash a single 512-bit block. This is the core of the algorithm. */ -void SHA1Transform(uint32_t state[5], const uint8_t buffer[64]) { - uint32_t a, b, c, d, e; - typedef union { - uint8_t c[64]; - uint32_t l[16]; - uint64_t ll[8]; - } CHAR64LONG16; - - CHAR64LONG16 block[1]; /* use array to appear as a pointer */ - - #pragma clang loop unroll(full) - for (uint8_t i = 0; i < 8; i++) { - block->ll[i] = *(uint64_t*)&buffer[i * 8]; - } - - /* Copy context->state[] to working vars */ - a = state[0]; - b = state[1]; - c = state[2]; - d = state[3]; - e = state[4]; - - /* 4 rounds of 20 operations each. Loop unrolled. */ - R0(a, b, c, d, e, 0); R0(e, a, b, c, d, 1); R0(d, e, a, b, c, 2); R0(c, d, e, a, b, 3); - R0(b, c, d, e, a, 4); R0(a, b, c, d, e, 5); R0(e, a, b, c, d, 6); R0(d, e, a, b, c, 7); - R0(c, d, e, a, b, 8); R0(b, c, d, e, a, 9); R0(a, b, c, d, e, 10); R0(e, a, b, c, d, 11); - R0(d, e, a, b, c, 12); R0(c, d, e, a, b, 13); R0(b, c, d, e, a, 14); R0(a, b, c, d, e, 15); - R1(e, a, b, c, d, 16); R1(d, e, a, b, c, 17); R1(c, d, e, a, b, 18); R1(b, c, d, e, a, 19); - R2(a, b, c, d, e, 20); R2(e, a, b, c, d, 21); R2(d, e, a, b, c, 22); R2(c, d, e, a, b, 23); - R2(b, c, d, e, a, 24); R2(a, b, c, d, e, 25); R2(e, a, b, c, d, 26); R2(d, e, a, b, c, 27); - R2(c, d, e, a, b, 28); R2(b, c, d, e, a, 29); R2(a, b, c, d, e, 30); R2(e, a, b, c, d, 31); - R2(d, e, a, b, c, 32); R2(c, d, e, a, b, 33); R2(b, c, d, e, a, 34); R2(a, b, c, d, e, 35); - R2(e, a, b, c, d, 36); R2(d, e, a, b, c, 37); R2(c, d, e, a, b, 38); R2(b, c, d, e, a, 39); - R3(a, b, c, d, e, 40); R3(e, a, b, c, d, 41); R3(d, e, a, b, c, 42); R3(c, d, e, a, b, 43); - R3(b, c, d, e, a, 44); R3(a, b, c, d, e, 45); R3(e, a, b, c, d, 46); R3(d, e, a, b, c, 47); - R3(c, d, e, a, b, 48); R3(b, c, d, e, a, 49); R3(a, b, c, d, e, 50); R3(e, a, b, c, d, 51); - R3(d, e, a, b, c, 52); R3(c, d, e, a, b, 53); R3(b, c, d, e, a, 54); R3(a, b, c, d, e, 55); - R3(e, a, b, c, d, 56); R3(d, e, a, b, c, 57); R3(c, d, e, a, b, 58); R3(b, c, d, e, a, 59); - R4(a, b, c, d, e, 60); R4(e, a, b, c, d, 61); R4(d, e, a, b, c, 62); R4(c, d, e, a, b, 63); - R4(b, c, d, e, a, 64); R4(a, b, c, d, e, 65); R4(e, a, b, c, d, 66); R4(d, e, a, b, c, 67); - R4(c, d, e, a, b, 68); R4(b, c, d, e, a, 69); R4(a, b, c, d, e, 70); R4(e, a, b, c, d, 71); - R4(d, e, a, b, c, 72); R4(c, d, e, a, b, 73); R4(b, c, d, e, a, 74); R4(a, b, c, d, e, 75); - R4(e, a, b, c, d, 76); R4(d, e, a, b, c, 77); R4(c, d, e, a, b, 78); R4(b, c, d, e, a, 79); - - /* Add the working vars back into context.state[] */ - state[0] += a; - state[1] += b; - state[2] += c; - state[3] += d; - state[4] += e; -} - -/* SHA1Init - Initialize new context */ -WASM_EXPORT -void Hash_Init() { - context->state[0] = 0x67452301; - context->state[1] = 0xEFCDAB89; - context->state[2] = 0x98BADCFE; - context->state[3] = 0x10325476; - context->state[4] = 0xC3D2E1F0; - context->count[0] = context->count[1] = 0; -} - -void SHA1Update(const uint8_t* data, uint32_t len) { - uint32_t i; - - uint32_t j = context->count[0]; - if ((context->count[0] += len << 3) < j) { - context->count[1]++; - } - - context->count[1] += (len >> 29); - j = (j >> 3) & 63; - - if ((j + len) > 63) { - uint8_t end = i = 64 - j; - for (uint8_t z = 0; z < end; z++) { - context->buffer[j + z] = data[z]; - } - SHA1Transform(context->state, context->buffer); - for (; i + 63 < len; i += 64) { - SHA1Transform(context->state, &data[i]); - } - j = 0; - } else { - i = 0; - } - - for (uint8_t z = 0; z < len - i; z++) { - context->buffer[j + z] = data[i + z]; - } -} - -WASM_EXPORT -void Hash_Update(uint32_t len) { - SHA1Update(main_buffer, len); -} - -/* Add padding and return the message digest. */ -WASM_EXPORT -void Hash_Final() { - uint8_t* result = main_buffer; - uint8_t finalcount[8]; - uint8_t c; - - for (uint8_t i = 0; i < 8; i++) { - finalcount[i] = (uint8_t)( - (context->count[(i >= 4 ? 0 : 1)] >> ((3 - (i & 3)) * 8)) & 255); - } - - c = 0200; - SHA1Update(&c, 1); - while ((context->count[0] & 504) != 448) { - c = 0000; - SHA1Update(&c, 1); - } - - SHA1Update(finalcount, 8); /* Should cause a SHA1Transform() */ - - for (uint8_t i = 0; i < 20; i++) { - result[i] = - (uint8_t)((context->state[i >> 2] >> ((3 - (i & 3)) * 8)) & 255); - } -} - -WASM_EXPORT -const uint32_t STATE_SIZE = sizeof(*context); - -WASM_EXPORT -uint8_t* Hash_GetState() { - return (uint8_t*) context; -} - -WASM_EXPORT -void Hash_Calculate(uint32_t length) { - Hash_Init(); - Hash_Update(length); - Hash_Final(); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/src/sha256.c b/tools/mnemonic-test/node_modules/hash-wasm/src/sha256.c deleted file mode 100644 index 0e2bb1ea..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/src/sha256.c +++ /dev/null @@ -1,295 +0,0 @@ -/* sha256.c - an implementation of SHA-256/224 hash functions - * based on FIPS 180-3 (Federal Information Processing Standart). - * - * Copyright (c) 2010, Aleksey Kravchenko - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - - * Modified for hash-wasm by Dani Biró - */ - -#define WITH_BUFFER -#include "hash-wasm.h" - -#define sha256_block_size 64 -#define sha256_hash_size 32 -#define sha224_hash_size 28 -#define ROTR32(dword, n) ((dword) >> (n) ^ ((dword) << (32 - (n)))) -#define bswap_32(x) __builtin_bswap32(x) - -struct sha256_ctx { - uint32_t message[16]; /* 512-bit buffer for leftovers */ - uint64_t length; /* number of processed bytes */ - uint32_t hash[8]; /* 256-bit algorithm internal hashing state */ - uint32_t digest_length; /* length of the algorithm digest in bytes */ -}; - -struct sha256_ctx sctx; -struct sha256_ctx* ctx = &sctx; - -/* SHA-224 and SHA-256 constants for 64 rounds. These words represent - * the first 32 bits of the fractional parts of the cube - * roots of the first 64 prime numbers. */ -static const uint32_t rhash_k256[64] = { - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, - 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, - 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, - 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, - 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, - 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, - 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, - 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, - 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 -}; - -/* The SHA256/224 functions defined by FIPS 180-3, 4.1.2 */ -/* Optimized version of Ch(x,y,z)=((x & y) | (~x & z)) */ -#define Ch(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) -/* Optimized version of Maj(x,y,z)=((x & y) ^ (x & z) ^ (y & z)) */ -#define Maj(x, y, z) (((x) & (y)) ^ ((z) & ((x) ^ (y)))) - -#define Sigma0(x) (ROTR32((x), 2) ^ ROTR32((x), 13) ^ ROTR32((x), 22)) -#define Sigma1(x) (ROTR32((x), 6) ^ ROTR32((x), 11) ^ ROTR32((x), 25)) -#define sigma0(x) (ROTR32((x), 7) ^ ROTR32((x), 18) ^ ((x) >> 3)) -#define sigma1(x) (ROTR32((x), 17) ^ ROTR32((x), 19) ^ ((x) >> 10)) - -/* Recalculate element n-th of circular buffer W using formula - * W[n] = sigma1(W[n - 2]) + W[n - 7] + sigma0(W[n - 15]) + W[n - 16]; */ -#define RECALCULATE_W(W, n) \ - (W[n] += \ - (sigma1(W[(n - 2) & 15]) + W[(n - 7) & 15] + sigma0(W[(n - 15) & 15]))) - -#define ROUND(a, b, c, d, e, f, g, h, k, data) \ - { \ - uint32_t T1 = h + Sigma1(e) + Ch(e, f, g) + k + (data); \ - d += T1, h = T1 + Sigma0(a) + Maj(a, b, c); \ - } -#define ROUND_1_16(a, b, c, d, e, f, g, h, n) \ - ROUND(a, b, c, d, e, f, g, h, rhash_k256[n], W[n] = bswap_32(block[n])) -#define ROUND_17_64(a, b, c, d, e, f, g, h, n) \ - ROUND(a, b, c, d, e, f, g, h, k[n], RECALCULATE_W(W, n)) - -/** - * Initialize context before calculaing hash. - * - */ -void sha256_init() { - /* Initial values. These words were obtained by taking the first 32 - * bits of the fractional parts of the square roots of the first - * eight prime numbers. */ - static const uint32_t SHA256_H0[8] = { - 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, - 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 - }; - - ctx->length = 0; - ctx->digest_length = sha256_hash_size; - - /* initialize algorithm state */ - - #pragma clang loop unroll(full) - for (uint8_t i = 0; i < 8; i += 2) { - *(uint64_t*)&ctx->hash[i] = *(uint64_t*)&SHA256_H0[i]; - } -} - -/** - * Initialize context before calculaing hash. - * - */ -void sha224_init() { - /* Initial values from FIPS 180-3. These words were obtained by taking - * bits from 33th to 64th of the fractional parts of the square - * roots of ninth through sixteenth prime numbers. */ - static const uint32_t SHA224_H0[8] = { - 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, - 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 - }; - - ctx->length = 0; - ctx->digest_length = sha224_hash_size; - - #pragma clang loop unroll(full) - for (uint8_t i = 0; i < 8; i += 2) { - *(uint64_t*)&ctx->hash[i] = *(uint64_t*)&SHA224_H0[i]; - } -} - -WASM_EXPORT -void Hash_Init(uint32_t bits) { - if (bits == 224) { - sha224_init(); - } else { - sha256_init(); - } -} - -/** - * The core transformation. Process a 512-bit block. - * - * @param hash algorithm state - * @param block the message block to process - */ -static void sha256_process_block(uint32_t hash[8], uint32_t block[16]) { - uint32_t A, B, C, D, E, F, G, H; - uint32_t W[16]; - const uint32_t* k; - int i; - - A = hash[0], B = hash[1], C = hash[2], D = hash[3]; - E = hash[4], F = hash[5], G = hash[6], H = hash[7]; - - /* Compute SHA using alternate Method: FIPS 180-3 6.1.3 */ - ROUND_1_16(A, B, C, D, E, F, G, H, 0); - ROUND_1_16(H, A, B, C, D, E, F, G, 1); - ROUND_1_16(G, H, A, B, C, D, E, F, 2); - ROUND_1_16(F, G, H, A, B, C, D, E, 3); - ROUND_1_16(E, F, G, H, A, B, C, D, 4); - ROUND_1_16(D, E, F, G, H, A, B, C, 5); - ROUND_1_16(C, D, E, F, G, H, A, B, 6); - ROUND_1_16(B, C, D, E, F, G, H, A, 7); - ROUND_1_16(A, B, C, D, E, F, G, H, 8); - ROUND_1_16(H, A, B, C, D, E, F, G, 9); - ROUND_1_16(G, H, A, B, C, D, E, F, 10); - ROUND_1_16(F, G, H, A, B, C, D, E, 11); - ROUND_1_16(E, F, G, H, A, B, C, D, 12); - ROUND_1_16(D, E, F, G, H, A, B, C, 13); - ROUND_1_16(C, D, E, F, G, H, A, B, 14); - ROUND_1_16(B, C, D, E, F, G, H, A, 15); - - #pragma clang loop unroll(full) - for (i = 16, k = &rhash_k256[16]; i < 64; i += 16, k += 16) { - ROUND_17_64(A, B, C, D, E, F, G, H, 0); - ROUND_17_64(H, A, B, C, D, E, F, G, 1); - ROUND_17_64(G, H, A, B, C, D, E, F, 2); - ROUND_17_64(F, G, H, A, B, C, D, E, 3); - ROUND_17_64(E, F, G, H, A, B, C, D, 4); - ROUND_17_64(D, E, F, G, H, A, B, C, 5); - ROUND_17_64(C, D, E, F, G, H, A, B, 6); - ROUND_17_64(B, C, D, E, F, G, H, A, 7); - ROUND_17_64(A, B, C, D, E, F, G, H, 8); - ROUND_17_64(H, A, B, C, D, E, F, G, 9); - ROUND_17_64(G, H, A, B, C, D, E, F, 10); - ROUND_17_64(F, G, H, A, B, C, D, E, 11); - ROUND_17_64(E, F, G, H, A, B, C, D, 12); - ROUND_17_64(D, E, F, G, H, A, B, C, 13); - ROUND_17_64(C, D, E, F, G, H, A, B, 14); - ROUND_17_64(B, C, D, E, F, G, H, A, 15); - } - - hash[0] += A, hash[1] += B, hash[2] += C, hash[3] += D; - hash[4] += E, hash[5] += F, hash[6] += G, hash[7] += H; -} - -/** - * Calculate message hash. - * Can be called repeatedly with chunks of the message to be hashed. - * - * @param size length of the message chunk - */ -WASM_EXPORT -void Hash_Update(uint32_t size) { - const uint8_t* msg = main_buffer; - uint32_t index = (uint32_t)ctx->length & 63; - ctx->length += size; - - /* fill partial block */ - if (index) { - uint32_t left = sha256_block_size - index; - uint32_t end = size < left ? size : left; - uint8_t* message8 = (uint8_t*)ctx->message; - for (uint8_t i = 0; i < end; i++) { - *(message8 + index + i) = msg[i]; - } - if (size < left) return; - - /* process partial block */ - sha256_process_block(ctx->hash, (uint32_t*)ctx->message); - msg += left; - size -= left; - } - - while (size >= sha256_block_size) { - uint32_t* aligned_message_block = (uint32_t*)msg; - - sha256_process_block(ctx->hash, aligned_message_block); - msg += sha256_block_size; - size -= sha256_block_size; - } - - if (size) { - /* save leftovers */ - for (uint8_t i = 0; i < size; i++) { - *(((uint8_t*)ctx->message) + i) = msg[i]; - } - } -} - -/** - * Store calculated hash into the given array. - * - */ -WASM_EXPORT -void Hash_Final() { - uint32_t index = ((uint32_t)ctx->length & 63) >> 2; - uint32_t shift = ((uint32_t)ctx->length & 3) * 8; - - /* pad message and run for last block */ - - /* append the byte 0x80 to the message */ - ctx->message[index] &= ~(0xFFFFFFFFu << shift); - ctx->message[index++] ^= 0x80u << shift; - - /* if no room left in the message to store 64-bit message length */ - if (index > 14) { - /* then fill the rest with zeros and process it */ - while (index < 16) { - ctx->message[index++] = 0; - } - sha256_process_block(ctx->hash, ctx->message); - index = 0; - } - - while (index < 14) { - ctx->message[index++] = 0; - } - - ctx->message[14] = bswap_32((uint32_t)(ctx->length >> 29)); - ctx->message[15] = bswap_32((uint32_t)(ctx->length << 3)); - sha256_process_block(ctx->hash, ctx->message); - - #pragma clang loop unroll(full) - for (int32_t i = 7; i >= 0; i--) { - ctx->hash[i] = bswap_32(ctx->hash[i]); - } - - for (uint8_t i = 0; i < ctx->digest_length; i++) { - main_buffer[i] = *(((uint8_t*)ctx->hash) + i); - } -} - -WASM_EXPORT -const uint32_t STATE_SIZE = sizeof(*ctx); - -WASM_EXPORT -uint8_t* Hash_GetState() { - return (uint8_t*) ctx; -} - -WASM_EXPORT -void Hash_Calculate(uint32_t length, uint32_t initParam) { - Hash_Init(initParam); - Hash_Update(length); - Hash_Final(); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/src/sha3.c b/tools/mnemonic-test/node_modules/hash-wasm/src/sha3.c deleted file mode 100644 index 80057c79..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/src/sha3.c +++ /dev/null @@ -1,332 +0,0 @@ -/* sha3.c - an implementation of Secure Hash Algorithm 3 (Keccak). - * based on the - * The Keccak SHA-3 submission. Submission to NIST (Round 3), 2011 - * by Guido Bertoni, Joan Daemen, Michaël Peeters and Gilles Van Assche - * - * Copyright (c) 2013, Aleksey Kravchenko - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - - * Modified for hash-wasm by Dani Biró - */ - -#define WITH_BUFFER -#include "hash-wasm.h" - -#define NumberOfRounds 24 -#define sha3_max_permutation_size 25 -#define sha3_max_rate_in_qwords 24 - -#define I64(x) x##ULL -#define ROTL64(qword, n) ((qword) << (n) ^ ((qword) >> (64 - (n)))) - -struct SHA3_CTX { - /* 1600 bits algorithm hashing state */ - uint64_t hash[sha3_max_permutation_size]; - /* 1536-bit buffer for leftovers */ - uint64_t message[sha3_max_rate_in_qwords]; - /* count of bytes in the message[] buffer */ - unsigned rest; - /* size of a message block processed at once */ - unsigned block_size; -}; - -struct SHA3_CTX sctx; -struct SHA3_CTX* ctx = &sctx; - -/* SHA3 (Keccak) constants for 24 rounds */ -static uint64_t keccak_round_constants[NumberOfRounds] = { - I64(0x0000000000000001), I64(0x0000000000008082), I64(0x800000000000808A), I64(0x8000000080008000), - I64(0x000000000000808B), I64(0x0000000080000001), I64(0x8000000080008081), I64(0x8000000000008009), - I64(0x000000000000008A), I64(0x0000000000000088), I64(0x0000000080008009), I64(0x000000008000000A), - I64(0x000000008000808B), I64(0x800000000000008B), I64(0x8000000000008089), I64(0x8000000000008003), - I64(0x8000000000008002), I64(0x8000000000000080), I64(0x000000000000800A), I64(0x800000008000000A), - I64(0x8000000080008081), I64(0x8000000000008080), I64(0x0000000080000001), I64(0x8000000080008008) -}; - -/* Initializing a sha3 context for given number of output bits */ -WASM_EXPORT -void Hash_Init(uint32_t bits) { - /* NB: The Keccak capacity parameter = bits * 2 */ - uint32_t rate = 1600 - bits * 2; - - for(int i = 0; i < sha3_max_permutation_size; i++) { - ctx->hash[i] = 0; - } - - for(int i = 0; i < sha3_max_rate_in_qwords; i++) { - ctx->message[i] = 0; - } - - ctx->rest = 0; - ctx->block_size = rate / 8; -} - -#define XORED_A(i) A[(i)] ^ A[(i) + 5] ^ A[(i) + 10] ^ A[(i) + 15] ^ A[(i) + 20] -#define THETA_STEP(i) \ - A[(i)] ^= D[(i)]; \ - A[(i) + 5] ^= D[(i)]; \ - A[(i) + 10] ^= D[(i)]; \ - A[(i) + 15] ^= D[(i)]; \ - A[(i) + 20] ^= D[(i)] - -/* Keccak theta() transformation */ -static void keccak_theta(uint64_t* A) { - uint64_t D[5]; - D[0] = ROTL64(XORED_A(1), 1) ^ XORED_A(4); - D[1] = ROTL64(XORED_A(2), 1) ^ XORED_A(0); - D[2] = ROTL64(XORED_A(3), 1) ^ XORED_A(1); - D[3] = ROTL64(XORED_A(4), 1) ^ XORED_A(2); - D[4] = ROTL64(XORED_A(0), 1) ^ XORED_A(3); - THETA_STEP(0); - THETA_STEP(1); - THETA_STEP(2); - THETA_STEP(3); - THETA_STEP(4); -} - -/* Keccak pi() transformation */ -static void keccak_pi(uint64_t* A) { - uint64_t A1; - A1 = A[1]; - A[1] = A[6]; - A[6] = A[9]; - A[9] = A[22]; - A[22] = A[14]; - A[14] = A[20]; - A[20] = A[2]; - A[2] = A[12]; - A[12] = A[13]; - A[13] = A[19]; - A[19] = A[23]; - A[23] = A[15]; - A[15] = A[4]; - A[4] = A[24]; - A[24] = A[21]; - A[21] = A[8]; - A[8] = A[16]; - A[16] = A[5]; - A[5] = A[3]; - A[3] = A[18]; - A[18] = A[17]; - A[17] = A[11]; - A[11] = A[7]; - A[7] = A[10]; - A[10] = A1; - /* note: A[ 0] is left as is */ -} - -#define CHI_STEP(i) \ - A0 = A[0 + (i)]; \ - A1 = A[1 + (i)]; \ - A[0 + (i)] ^= ~A1 & A[2 + (i)]; \ - A[1 + (i)] ^= ~A[2 + (i)] & A[3 + (i)]; \ - A[2 + (i)] ^= ~A[3 + (i)] & A[4 + (i)]; \ - A[3 + (i)] ^= ~A[4 + (i)] & A0; \ - A[4 + (i)] ^= ~A0 & A1 - -/* Keccak chi() transformation */ -static void keccak_chi(uint64_t* A) { - uint64_t A0, A1; - CHI_STEP(0); - CHI_STEP(5); - CHI_STEP(10); - CHI_STEP(15); - CHI_STEP(20); -} - -static void sha3_permutation(uint64_t* state) { - for (int round = 0; round < NumberOfRounds; round++) { - keccak_theta(state); - - /* apply Keccak rho() transformation */ - state[ 1] = ROTL64(state[ 1], 1); - state[ 2] = ROTL64(state[ 2], 62); - state[ 3] = ROTL64(state[ 3], 28); - state[ 4] = ROTL64(state[ 4], 27); - state[ 5] = ROTL64(state[ 5], 36); - state[ 6] = ROTL64(state[ 6], 44); - state[ 7] = ROTL64(state[ 7], 6); - state[ 8] = ROTL64(state[ 8], 55); - state[ 9] = ROTL64(state[ 9], 20); - state[10] = ROTL64(state[10], 3); - state[11] = ROTL64(state[11], 10); - state[12] = ROTL64(state[12], 43); - state[13] = ROTL64(state[13], 25); - state[14] = ROTL64(state[14], 39); - state[15] = ROTL64(state[15], 41); - state[16] = ROTL64(state[16], 45); - state[17] = ROTL64(state[17], 15); - state[18] = ROTL64(state[18], 21); - state[19] = ROTL64(state[19], 8); - state[20] = ROTL64(state[20], 18); - state[21] = ROTL64(state[21], 2); - state[22] = ROTL64(state[22], 61); - state[23] = ROTL64(state[23], 56); - state[24] = ROTL64(state[24], 14); - - keccak_pi(state); - keccak_chi(state); - - /* apply iota(state, round) */ - *state ^= keccak_round_constants[round]; - } -} - -/** - * The core transformation. Process the specified block of data. - * - * @param hash the algorithm state - * @param block the message block to process - * @param block_size the size of the processed block in bytes - */ -static void sha3_process_block( - uint64_t hash[25], const uint64_t* block, uint32_t block_size -) { - /* expanded loop */ - hash[0] ^= block[0]; - hash[1] ^= block[1]; - hash[2] ^= block[2]; - hash[3] ^= block[3]; - hash[4] ^= block[4]; - hash[5] ^= block[5]; - hash[6] ^= block[6]; - hash[7] ^= block[7]; - hash[8] ^= block[8]; - /* if not sha3-512 */ - if (block_size > 72) { - hash[9] ^= block[9]; - hash[10] ^= block[10]; - hash[11] ^= block[11]; - hash[12] ^= block[12]; - /* if not sha3-384 */ - if (block_size > 104) { - hash[13] ^= block[13]; - hash[14] ^= block[14]; - hash[15] ^= block[15]; - hash[16] ^= block[16]; - /* if not sha3-256 */ - if (block_size > 136) { - hash[17] ^= block[17]; -#ifdef FULL_SHA3_FAMILY_SUPPORT - /* if not sha3-224 */ - if (block_size > 144) { - hash[18] ^= block[18]; - hash[19] ^= block[19]; - hash[20] ^= block[20]; - hash[21] ^= block[21]; - hash[22] ^= block[22]; - hash[23] ^= block[23]; - hash[24] ^= block[24]; - } -#endif - } - } - } - /* make a permutation of the hash */ - sha3_permutation(hash); -} - -#define SHA3_FINALIZED 0x80000000 - -/** - * Calculate message hash. - * Can be called repeatedly with chunks of the message to be hashed. - * - * @param msg message chunk - * @param size length of the message chunk - */ -WASM_EXPORT -void Hash_Update(uint32_t size) { - const uint8_t* msg = main_buffer; - uint32_t index = (uint32_t)ctx->rest; - uint32_t block_size = (uint32_t)ctx->block_size; - - if (ctx->rest & SHA3_FINALIZED) return; /* too late for additional input */ - ctx->rest = (unsigned)((ctx->rest + size) % block_size); - - /* fill partial block */ - if (index) { - uint32_t left = block_size - index; - uint32_t end = size < left ? size : left; - uint8_t* msg_pointer = (uint8_t*)ctx->message + index; - for (uint32_t i = 0; i < end; i++) { - msg_pointer[i] = msg[i]; - } - if (size < left) return; - - /* process partial block */ - sha3_process_block(ctx->hash, ctx->message, block_size); - msg += left; - size -= left; - } - - while (size >= block_size) { - uint64_t* aligned_message_block = (uint64_t*)msg; - - sha3_process_block(ctx->hash, aligned_message_block, block_size); - msg += block_size; - size -= block_size; - } - - if (size) { - /* save leftovers */ - uint8_t* msg_pointer = (uint8_t*)ctx->message; - for (uint8_t i = 0; i < size; i++) { - msg_pointer[i] = msg[i]; - } - } -} - -/** - * Store calculated hash into the given array. - */ -WASM_EXPORT -void Hash_Final(uint8_t padding) { - uint32_t digest_length = 100 - ctx->block_size / 2; - const uint32_t block_size = ctx->block_size; - - if (!(ctx->rest & SHA3_FINALIZED)) { - /* clear the rest of the data queue */ - int8_t* start = (int8_t*)ctx->message + ctx->rest; - for (int i = 0; i < block_size - ctx->rest; i++) { - start[i] = 0; - } - ((int8_t*)ctx->message)[ctx->rest] |= padding; - ((int8_t*)ctx->message)[block_size - 1] |= 0x80; - - /* process final block */ - sha3_process_block(ctx->hash, ctx->message, block_size); - ctx->rest = SHA3_FINALIZED; /* mark context as finalized */ - } - - uint32_t* array32 = (uint32_t*)main_buffer; - uint32_t* hash32 = (uint32_t*)ctx->hash; - for (uint32_t i = 0; i < digest_length / 4; i++) { - array32[i] = hash32[i]; - } -} - -WASM_EXPORT -const uint32_t STATE_SIZE = sizeof(*ctx); - -WASM_EXPORT -uint8_t* Hash_GetState() { - return (uint8_t*) ctx; -} - -WASM_EXPORT -void Hash_Calculate(uint32_t length, uint32_t initParam, uint8_t finalParam) { - Hash_Init(initParam); - Hash_Update(length); - Hash_Final(finalParam); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/src/sha512.c b/tools/mnemonic-test/node_modules/hash-wasm/src/sha512.c deleted file mode 100644 index 3f7ad01e..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/src/sha512.c +++ /dev/null @@ -1,308 +0,0 @@ -/* sha512.c - an implementation of SHA-384/512 hash functions - * based on FIPS 180-3 (Federal Information Processing Standart). - * - * Copyright (c) 2010, Aleksey Kravchenko - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - - * Modified for hash-wasm by Dani Biró - */ - -#define WITH_BUFFER -#include "hash-wasm.h" - -#define sha512_block_size 128 -#define sha512_hash_size 64 -#define sha384_hash_size 48 -#define I64(x) x##ULL -#define ROTR64(qword, n) ((qword) >> (n) ^ ((qword) << (64 - (n)))) -#define bswap_64(x) __builtin_bswap64(x) - -struct sha512_ctx { - uint64_t message[16]; /* 1024-bit buffer for leftovers */ - uint64_t length; /* number of processed bytes */ - uint64_t hash[8]; /* 512-bit algorithm internal hashing state */ - uint32_t digest_length; /* length of the algorithm digest in bytes */ -}; - -struct sha512_ctx sctx; -struct sha512_ctx* ctx = &sctx; - -/* SHA-384 and SHA-512 constants for 80 rounds. These qwords represent - * the first 64 bits of the fractional parts of the cube - * roots of the first 80 prime numbers. */ -static const uint64_t rhash_k512[80] = { - I64(0x428a2f98d728ae22), I64(0x7137449123ef65cd), I64(0xb5c0fbcfec4d3b2f), - I64(0xe9b5dba58189dbbc), I64(0x3956c25bf348b538), I64(0x59f111f1b605d019), - I64(0x923f82a4af194f9b), I64(0xab1c5ed5da6d8118), I64(0xd807aa98a3030242), - I64(0x12835b0145706fbe), I64(0x243185be4ee4b28c), I64(0x550c7dc3d5ffb4e2), - I64(0x72be5d74f27b896f), I64(0x80deb1fe3b1696b1), I64(0x9bdc06a725c71235), - I64(0xc19bf174cf692694), I64(0xe49b69c19ef14ad2), I64(0xefbe4786384f25e3), - I64(0x0fc19dc68b8cd5b5), I64(0x240ca1cc77ac9c65), I64(0x2de92c6f592b0275), - I64(0x4a7484aa6ea6e483), I64(0x5cb0a9dcbd41fbd4), I64(0x76f988da831153b5), - I64(0x983e5152ee66dfab), I64(0xa831c66d2db43210), I64(0xb00327c898fb213f), - I64(0xbf597fc7beef0ee4), I64(0xc6e00bf33da88fc2), I64(0xd5a79147930aa725), - I64(0x06ca6351e003826f), I64(0x142929670a0e6e70), I64(0x27b70a8546d22ffc), - I64(0x2e1b21385c26c926), I64(0x4d2c6dfc5ac42aed), I64(0x53380d139d95b3df), - I64(0x650a73548baf63de), I64(0x766a0abb3c77b2a8), I64(0x81c2c92e47edaee6), - I64(0x92722c851482353b), I64(0xa2bfe8a14cf10364), I64(0xa81a664bbc423001), - I64(0xc24b8b70d0f89791), I64(0xc76c51a30654be30), I64(0xd192e819d6ef5218), - I64(0xd69906245565a910), I64(0xf40e35855771202a), I64(0x106aa07032bbd1b8), - I64(0x19a4c116b8d2d0c8), I64(0x1e376c085141ab53), I64(0x2748774cdf8eeb99), - I64(0x34b0bcb5e19b48a8), I64(0x391c0cb3c5c95a63), I64(0x4ed8aa4ae3418acb), - I64(0x5b9cca4f7763e373), I64(0x682e6ff3d6b2b8a3), I64(0x748f82ee5defb2fc), - I64(0x78a5636f43172f60), I64(0x84c87814a1f0ab72), I64(0x8cc702081a6439ec), - I64(0x90befffa23631e28), I64(0xa4506cebde82bde9), I64(0xbef9a3f7b2c67915), - I64(0xc67178f2e372532b), I64(0xca273eceea26619c), I64(0xd186b8c721c0c207), - I64(0xeada7dd6cde0eb1e), I64(0xf57d4f7fee6ed178), I64(0x06f067aa72176fba), - I64(0x0a637dc5a2c898a6), I64(0x113f9804bef90dae), I64(0x1b710b35131c471b), - I64(0x28db77f523047d84), I64(0x32caab7b40c72493), I64(0x3c9ebe0a15c9bebc), - I64(0x431d67c49c100d4c), I64(0x4cc5d4becb3e42b6), I64(0x597f299cfc657e2a), - I64(0x5fcb6fab3ad6faec), I64(0x6c44198c4a475817) -}; - -/* The SHA512/384 functions defined by FIPS 180-3, 4.1.3 */ -/* Optimized version of Ch(x,y,z)=((x & y) | (~x & z)) */ -#define Ch(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) -/* Optimized version of Maj(x,y,z)=((x & y) ^ (x & z) ^ (y & z)) */ -#define Maj(x, y, z) (((x) & (y)) ^ ((z) & ((x) ^ (y)))) - -#define Sigma0(x) (ROTR64((x), 28) ^ ROTR64((x), 34) ^ ROTR64((x), 39)) -#define Sigma1(x) (ROTR64((x), 14) ^ ROTR64((x), 18) ^ ROTR64((x), 41)) -#define sigma0(x) (ROTR64((x), 1) ^ ROTR64((x), 8) ^ ((x) >> 7)) -#define sigma1(x) (ROTR64((x), 19) ^ ROTR64((x), 61) ^ ((x) >> 6)) - -/* Recalculate element n-th of circular buffer W using formula - * W[n] = sigma1(W[n - 2]) + W[n - 7] + sigma0(W[n - 15]) + W[n - 16]; */ -#define RECALCULATE_W(W, n) \ - (W[n] += \ - (sigma1(W[(n - 2) & 15]) + W[(n - 7) & 15] + sigma0(W[(n - 15) & 15]))) - -#define ROUND(a, b, c, d, e, f, g, h, k, data) \ - { \ - uint64_t T1 = h + Sigma1(e) + Ch(e, f, g) + k + (data); \ - d += T1, h = T1 + Sigma0(a) + Maj(a, b, c); \ - } -#define ROUND_1_16(a, b, c, d, e, f, g, h, n) \ - ROUND(a, b, c, d, e, f, g, h, rhash_k512[n], W[n] = bswap_64(block[n])) -#define ROUND_17_80(a, b, c, d, e, f, g, h, n) \ - ROUND(a, b, c, d, e, f, g, h, k[n], RECALCULATE_W(W, n)) - -/** - * Initialize context before calculating hash. - * - */ -void sha512_init() { - /* Initial values. These words were obtained by taking the first 32 - * bits of the fractional parts of the square roots of the first - * eight prime numbers. */ - static const uint64_t SHA512_H0[8] = { - I64(0x6a09e667f3bcc908), I64(0xbb67ae8584caa73b), I64(0x3c6ef372fe94f82b), - I64(0xa54ff53a5f1d36f1), I64(0x510e527fade682d1), I64(0x9b05688c2b3e6c1f), - I64(0x1f83d9abfb41bd6b), I64(0x5be0cd19137e2179) - }; - - ctx->length = 0; - ctx->digest_length = sha512_hash_size; - - /* initialize algorithm state */ - #pragma clang loop unroll(full) - for (uint8_t i = 0; i < 8; i++) { - ctx->hash[i] = SHA512_H0[i]; - } -} - -/** - * Initialize context before calculaing hash. - * - */ -void sha384_init() { - /* Initial values from FIPS 180-3. These words were obtained by taking - * the first sixty-four bits of the fractional parts of the square - * roots of ninth through sixteenth prime numbers. */ - static const uint64_t SHA384_H0[8] = { - I64(0xcbbb9d5dc1059ed8), I64(0x629a292a367cd507), I64(0x9159015a3070dd17), - I64(0x152fecd8f70e5939), I64(0x67332667ffc00b31), I64(0x8eb44a8768581511), - I64(0xdb0c2e0d64f98fa7), I64(0x47b5481dbefa4fa4) - }; - - ctx->length = 0; - ctx->digest_length = sha384_hash_size; - - #pragma clang loop unroll(full) - for (uint8_t i = 0; i < 8; i++) { - ctx->hash[i] = SHA384_H0[i]; - } -} - -WASM_EXPORT -void Hash_Init(uint32_t bits) { - if (bits == 384) { - sha384_init(); - } else { - sha512_init(); - } -} - -/** - * The core transformation. Process a 512-bit block. - * - * @param hash algorithm state - * @param block the message block to process - */ -static void sha512_process_block(uint64_t hash[8], uint64_t block[16]) { - uint64_t A, B, C, D, E, F, G, H; - uint64_t W[16]; - const uint64_t* k; - int i; - - A = hash[0], B = hash[1], C = hash[2], D = hash[3]; - E = hash[4], F = hash[5], G = hash[6], H = hash[7]; - - /* Compute SHA using alternate Method: FIPS 180-3 6.1.3 */ - ROUND_1_16(A, B, C, D, E, F, G, H, 0); - ROUND_1_16(H, A, B, C, D, E, F, G, 1); - ROUND_1_16(G, H, A, B, C, D, E, F, 2); - ROUND_1_16(F, G, H, A, B, C, D, E, 3); - ROUND_1_16(E, F, G, H, A, B, C, D, 4); - ROUND_1_16(D, E, F, G, H, A, B, C, 5); - ROUND_1_16(C, D, E, F, G, H, A, B, 6); - ROUND_1_16(B, C, D, E, F, G, H, A, 7); - ROUND_1_16(A, B, C, D, E, F, G, H, 8); - ROUND_1_16(H, A, B, C, D, E, F, G, 9); - ROUND_1_16(G, H, A, B, C, D, E, F, 10); - ROUND_1_16(F, G, H, A, B, C, D, E, 11); - ROUND_1_16(E, F, G, H, A, B, C, D, 12); - ROUND_1_16(D, E, F, G, H, A, B, C, 13); - ROUND_1_16(C, D, E, F, G, H, A, B, 14); - ROUND_1_16(B, C, D, E, F, G, H, A, 15); - - #pragma clang loop unroll(full) - for (i = 16, k = &rhash_k512[16]; i < 80; i += 16, k += 16) { - ROUND_17_80(A, B, C, D, E, F, G, H, 0); - ROUND_17_80(H, A, B, C, D, E, F, G, 1); - ROUND_17_80(G, H, A, B, C, D, E, F, 2); - ROUND_17_80(F, G, H, A, B, C, D, E, 3); - ROUND_17_80(E, F, G, H, A, B, C, D, 4); - ROUND_17_80(D, E, F, G, H, A, B, C, 5); - ROUND_17_80(C, D, E, F, G, H, A, B, 6); - ROUND_17_80(B, C, D, E, F, G, H, A, 7); - ROUND_17_80(A, B, C, D, E, F, G, H, 8); - ROUND_17_80(H, A, B, C, D, E, F, G, 9); - ROUND_17_80(G, H, A, B, C, D, E, F, 10); - ROUND_17_80(F, G, H, A, B, C, D, E, 11); - ROUND_17_80(E, F, G, H, A, B, C, D, 12); - ROUND_17_80(D, E, F, G, H, A, B, C, 13); - ROUND_17_80(C, D, E, F, G, H, A, B, 14); - ROUND_17_80(B, C, D, E, F, G, H, A, 15); - } - - hash[0] += A, hash[1] += B, hash[2] += C, hash[3] += D; - hash[4] += E, hash[5] += F, hash[6] += G, hash[7] += H; -} - -/** - * Calculate message hash. - * Can be called repeatedly with chunks of the message to be hashed. - * - * @param size length of the message chunk - */ -WASM_EXPORT -void Hash_Update(uint32_t size) { - const uint8_t* msg = main_buffer; - uint32_t index = (uint32_t)ctx->length & 127; - ctx->length += size; - - /* fill partial block */ - if (index) { - uint32_t left = sha512_block_size - index; - uint32_t end = size < left ? size : left; - uint8_t* message8 = (uint8_t*)ctx->message; - for (uint8_t i = 0; i < end; i++) { - *(message8 + index + i) = msg[i]; - } - if (size < left) return; - - /* process partial block */ - sha512_process_block(ctx->hash, ctx->message); - msg += left; - size -= left; - } - - while (size >= sha512_block_size) { - uint64_t* aligned_message_block = (uint64_t*)msg; - - sha512_process_block(ctx->hash, aligned_message_block); - msg += sha512_block_size; - size -= sha512_block_size; - } - - if (size) { - /* save leftovers */ - for (uint8_t i = 0; i < size; i++) { - *(((uint8_t*)ctx->message) + i) = msg[i]; - } - } -} - -/** - * Store calculated hash into the given array. - */ -WASM_EXPORT -void Hash_Final() { - uint32_t index = ((uint32_t)ctx->length & 127) >> 3; - uint32_t shift = ((uint32_t)ctx->length & 7) * 8; - - /* pad message and process the last block */ - - /* append the byte 0x80 to the message */ - ctx->message[index] &= ~(I64(0xFFFFFFFFFFFFFFFF) << shift); - ctx->message[index++] ^= I64(0x80) << shift; - - /* if no room left in the message to store 128-bit message length */ - if (index >= 15) { - if (index == 15) ctx->message[index] = 0; - sha512_process_block(ctx->hash, ctx->message); - index = 0; - } - - while (index < 15) { - ctx->message[index++] = 0; - } - - ctx->message[15] = bswap_64(ctx->length << 3); - sha512_process_block(ctx->hash, ctx->message); - - #pragma clang loop unroll(full) - for (int32_t i = 7; i >= 0; i--) { - ctx->hash[i] = bswap_64(ctx->hash[i]); - } - - for (uint8_t i = 0; i < ctx->digest_length; i++) { - main_buffer[i] = *(((uint8_t*)ctx->hash) + i); - } -} - -WASM_EXPORT -const uint32_t STATE_SIZE = sizeof(*ctx); - -WASM_EXPORT -uint8_t* Hash_GetState() { - return (uint8_t*) ctx; -} - -WASM_EXPORT -void Hash_Calculate(uint32_t length, uint32_t initParam) { - Hash_Init(initParam); - Hash_Update(length); - Hash_Final(); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/src/sm3.c b/tools/mnemonic-test/node_modules/hash-wasm/src/sm3.c deleted file mode 100644 index c82fab04..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/src/sm3.c +++ /dev/null @@ -1,231 +0,0 @@ -/******************************************************************************* - * SM3 function implementation - * Copyright 2016 Yanbo Li dreamfly281@gmail.com, goldboar@163.com - * MIT License - * - * Modified for hash-wasm by Dani Biró - */ - - -#define WITH_BUFFER -#include "hash-wasm.h" - -#define SM3_DIGEST_LEN 32 - -#define u8 uint8_t -#define u32 uint32_t - -struct sm3_ctx { - u32 total[2]; - u32 state[8]; - u8 buffer[64]; -}; - -#define S(x,n) ((x << n) | (x >> (32 - n))) - -#define P0(x) (x ^ S(x, 9) ^ S(x,17)) -#define P1(x) (x ^ S(x,15) ^ S(x,23)) - -#define PW(t) \ -( \ - temp = W[t - 16] ^ W[t - 9] ^ (S(W[t - 3], 15)), \ - P1(temp) ^ W[t - 6] ^ (S(W[t - 13], 7)) \ -) - -#define FF1(x,y,z) (x ^ y ^ z) -#define FF2(x,y,z) ((x & y) | (x & z) | (y & z)) - -#define GG1(x,y,z) (x ^ y ^ z) -#define GG2(x,y,z) ((x & y) | ((~x) & z)) - -#define T1 0x79cc4519 -#define T2 0x7a879d8a - -#define bswap_32(x) __builtin_bswap32(x) - -void sm3_init(struct sm3_ctx *ctx) { - ctx->total[0] = 0; - ctx->total[1] = 0; - - ctx->state[0] = 0x7380166f; - ctx->state[1] = 0x4914b2b9; - ctx->state[2] = 0x172442d7; - ctx->state[3] = 0xda8a0600; - ctx->state[4] = 0xa96f30bc; - ctx->state[5] = 0x163138aa; - ctx->state[6] = 0xe38dee4d; - ctx->state[7] = 0xb0fb0e4e; -} - -static void sm3_process(struct sm3_ctx *ctx, const u8 data[64]) { - u32 temp, W[68], WP[64], A, B, C, D, E, F, G, H, SS1, SS2, TT1, TT2; - int j, k; - - #pragma clang loop unroll(full) - for (int i = 0; i < 16; i++) { - W[i] = bswap_32(((u32 *) data)[i]); - } - - W[16] = PW(16); - W[17] = PW(17); - W[18] = PW(18); - W[19] = PW(19); - - A = ctx->state[0]; - B = ctx->state[1]; - C = ctx->state[2]; - D = ctx->state[3]; - E = ctx->state[4]; - F = ctx->state[5]; - G = ctx->state[6]; - H = ctx->state[7]; - - // #pragma clang loop unroll(full) - for (int i = 0; i < 16; i++) { - WP[i] = W[i] ^ W[i+4]; - - SS1 = S(A, 12) + E + S(T1, i); - SS1 = S(SS1, 7); - SS2 = SS1 ^ S(A, 12); - TT1 = FF1(A, B, C) + D + SS2 + WP[i]; - TT2 = GG1(E, F, G) + H + SS1 + W[i]; - D = C; - C = S(B,9); - B = A; - A = TT1; - H = G; - G = S(F,19); - F = E; - E = P0(TT2); - } - - // #pragma clang loop unroll(full) - for (int i = 16; i < 64; i++) { - k = i + 4; - W[k] = PW(k); - WP[i] = W[i] ^ W[i + 4]; - - j = i % 32; - - SS1 = S(A, 12) + E + S(T2, j); - SS1 = S(SS1, 7); - SS2 = SS1 ^ S(A, 12); - TT1 = FF2(A, B, C) + D + SS2 + WP[i]; - TT2 = GG2(E, F, G) + H + SS1 + W[i]; - D = C; - C = S(B, 9); - B = A; - A = TT1; - H = G; - G = S(F, 19); - F = E; - E = P0(TT2); - } - - ctx->state[0] ^= A; - ctx->state[1] ^= B; - ctx->state[2] ^= C; - ctx->state[3] ^= D; - ctx->state[4] ^= E; - ctx->state[5] ^= F; - ctx->state[6] ^= G; - ctx->state[7] ^= H; -} - -static void sm3_update(struct sm3_ctx *ctx, const u8 *msg, u32 len) { - u32 left, fill; - - if (!len) { - return; - } - - left = ctx->total[0] & 0x3F; - fill = 64 - left; - - ctx->total[0] += len; - ctx->total[0] &= 0xFFFFFFFF; - - if (ctx->total[0] < len) { - ctx->total[1]++; - } - - if (left && (len >= fill)) { - memcpy((void *)(ctx->buffer + left), (void *)msg, fill); - sm3_process(ctx, ctx->buffer); - len -= fill; - msg += fill; - left = 0; - } - - while (len >= 64) { - sm3_process(ctx, msg); - len -= 64; - msg += 64; - } - - if (len) { - memcpy((void *)(ctx->buffer + left), (void *)msg, len); - } -} - -static u8 sm3_padding[64] = { - 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static void sm3_finish(struct sm3_ctx *ctx, u8 digest[32]) { - u32 last, padn; - u32 high, low; - u8 msglen[8]; - - high = (ctx->total[0] >> 29) - | (ctx->total[1] << 3); - low = (ctx->total[0] << 3); - - ((u32 *)msglen)[0] = bswap_32(high); - ((u32 *)msglen)[1] = bswap_32(low); - - last = ctx->total[0] & 0x3F; - padn = (last < 56 ) ? (56 - last) : (120 - last); - - sm3_update(ctx, sm3_padding, padn); - sm3_update(ctx, msglen, 8); - - for (int i = 0; i < 8; i++) { - ((u32 *)digest)[i] = bswap_32(ctx->state[i]); - } -} - -struct sm3_ctx ctx; - -WASM_EXPORT -void Hash_Init() { - sm3_init(&ctx); -} - -WASM_EXPORT -void Hash_Update(uint32_t size) { - sm3_update(&ctx, main_buffer, size); -} - -WASM_EXPORT -void Hash_Final() { - sm3_finish(&ctx, main_buffer); -} - -WASM_EXPORT -const uint32_t STATE_SIZE = sizeof(ctx); - -WASM_EXPORT -uint8_t* Hash_GetState() { - return (uint8_t*) &ctx; -} - -WASM_EXPORT -void Hash_Calculate(uint32_t length) { - Hash_Init(); - Hash_Update(length); - Hash_Final(); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/src/whirlpool.c b/tools/mnemonic-test/node_modules/hash-wasm/src/whirlpool.c deleted file mode 100644 index 2f5eb004..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/src/whirlpool.c +++ /dev/null @@ -1,243 +0,0 @@ -/** - * Whirlpool hash in C - * - * Copyright (c) 2017 Project Nayuki. (MIT License) - * https://www.nayuki.io/page/fast-whirlpool-hash-in-x86-assembly - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - The Software is provided "as is", without warranty of any kind, express or - * implied, including but not limited to the warranties of merchantability, - * fitness for a particular purpose and noninfringement. In no event shall the - * authors or copyright holders be liable for any claim, damages or other - * liability, whether in an action of contract, tort or otherwise, arising from, - * out of or in connection with the Software or the use or other dealings in the - * Software. - * - * Modified for hash-wasm by Dani Biró - */ - -#define WITH_BUFFER -#include "hash-wasm.h" - -#define BLOCK_LEN 64 // In bytes -#define STATE_LEN 64 // In bytes - -struct Whirlpool_CTX { - uint8_t buffer[BLOCK_LEN]; /* buffer of data to hash */ - uint8_t hash[STATE_LEN]; /* the hashing state */ - uint32_t rem; - uint64_t totalBytes; -}; - -static struct Whirlpool_CTX sctx; - -static void whirlpool_round(uint64_t block[static 8], const uint64_t key[static 8]); - -static uint64_t ROUND_CONSTANTS[32] = { - UINT64_C(0x4F01B887E8C62318), UINT64_C(0x52916F79F5D2A636), UINT64_C(0x357B0CA38E9BBC60), UINT64_C(0x57FE4B2EC2D7E01D), - UINT64_C(0xDA4AF09FE5377715), UINT64_C(0x856BA0B10A29C958), UINT64_C(0x67053ECBF4105DBD), UINT64_C(0xD8957DA78B4127E4), - UINT64_C(0x9E4717DD667CEEFB), UINT64_C(0x33835AAD07BF2DCA), UINT64_C(0xD94919C871AA0263), UINT64_C(0xB032269A885BE3F2), - UINT64_C(0x4834CDBE80D50FE9), UINT64_C(0xAE1A68205F907AFF), UINT64_C(0x1273F164229354B4), UINT64_C(0x3D8DA1DBECC30840), - UINT64_C(0x1BD682762BCF0097), UINT64_C(0xEF30F345506AAFB5), UINT64_C(0xC02FBA65EAA2553F), UINT64_C(0x8A0675924DFD1CDE), - UINT64_C(0x96A8D4621F0EE6B2), UINT64_C(0x4C3972845925C5F9), UINT64_C(0x61E2A5D18C38785E), UINT64_C(0x04FCC7431E9C21B3), - UINT64_C(0x247EDFFA0D6D9951), UINT64_C(0xEBB74E8F11CEAB3B), UINT64_C(0xD32C13B9F794813C), UINT64_C(0xA97F445603C46EE7), - UINT64_C(0x6C9D0BDC53C1BB2A), UINT64_C(0xE11489AC46F67431), UINT64_C(0xEDD0B67009693A16), UINT64_C(0x86F85C28A49842CC), -}; - -// Temporary state that doesn't need to be preserved between calls to _compress() -uint64_t tempState[8]; -uint64_t tempBlock[8]; -uint64_t rcon[8] = {0}; - -void whirlpool_compress(uint8_t state[static 64], const uint8_t block[static 64]) { - const int NUM_ROUNDS = 10; // Any number from 0 to 32 is allowed - - // Initialization - #pragma clang loop unroll(full) - for (int i = 0; i < 8; i++) { - int j = i << 3; - uint64_t x = *(uint64_t*)(state + j); - uint64_t y = *(uint64_t*)(block + j); - tempState[i] = x; - tempBlock[i] = x ^ y; - } - - // Hashing rounds - #pragma clang loop unroll(full) - for (int i = 0; i < NUM_ROUNDS; i++) { - rcon[0] = ROUND_CONSTANTS[i]; - whirlpool_round(tempState, rcon); - whirlpool_round(tempBlock, tempState); - } - - // Final combining - #pragma clang loop unroll(full) - for (uint8_t i = 0; i < 8; i++) { - ((uint64_t*)state)[i] ^= ((uint64_t*)block)[i] ^ tempBlock[i]; - } -} - -// The combined effect of gamma (SubBytes) and theta (MixRows) -static uint64_t MAGIC_TABLE[256] = { - UINT64_C(0xD83078C018601818), UINT64_C(0x2646AF05238C2323), UINT64_C(0xB891F97EC63FC6C6), UINT64_C(0xFBCD6F13E887E8E8), UINT64_C(0xCB13A14C87268787), UINT64_C(0x116D62A9B8DAB8B8), UINT64_C(0x0902050801040101), UINT64_C(0x0D9E6E424F214F4F), - UINT64_C(0x9B6CEEAD36D83636), UINT64_C(0xFF510459A6A2A6A6), UINT64_C(0x0CB9BDDED26FD2D2), UINT64_C(0x0EF706FBF5F3F5F5), UINT64_C(0x96F280EF79F97979), UINT64_C(0x30DECE5F6FA16F6F), UINT64_C(0x6D3FEFFC917E9191), UINT64_C(0xF8A407AA52555252), - UINT64_C(0x47C0FD27609D6060), UINT64_C(0x35657689BCCABCBC), UINT64_C(0x372BCDAC9B569B9B), UINT64_C(0x8A018C048E028E8E), UINT64_C(0xD25B1571A3B6A3A3), UINT64_C(0x6C183C600C300C0C), UINT64_C(0x84F68AFF7BF17B7B), UINT64_C(0x806AE1B535D43535), - UINT64_C(0xF53A69E81D741D1D), UINT64_C(0xB3DD4753E0A7E0E0), UINT64_C(0x21B3ACF6D77BD7D7), UINT64_C(0x9C99ED5EC22FC2C2), UINT64_C(0x435C966D2EB82E2E), UINT64_C(0x29967A624B314B4B), UINT64_C(0x5DE121A3FEDFFEFE), UINT64_C(0xD5AE168257415757), - UINT64_C(0xBD2A41A815541515), UINT64_C(0xE8EEB69F77C17777), UINT64_C(0x926EEBA537DC3737), UINT64_C(0x9ED7567BE5B3E5E5), UINT64_C(0x1323D98C9F469F9F), UINT64_C(0x23FD17D3F0E7F0F0), UINT64_C(0x20947F6A4A354A4A), UINT64_C(0x44A9959EDA4FDADA), - UINT64_C(0xA2B025FA587D5858), UINT64_C(0xCF8FCA06C903C9C9), UINT64_C(0x7C528D5529A42929), UINT64_C(0x5A1422500A280A0A), UINT64_C(0x507F4FE1B1FEB1B1), UINT64_C(0xC95D1A69A0BAA0A0), UINT64_C(0x14D6DA7F6BB16B6B), UINT64_C(0xD917AB5C852E8585), - UINT64_C(0x3C677381BDCEBDBD), UINT64_C(0x8FBA34D25D695D5D), UINT64_C(0x9020508010401010), UINT64_C(0x07F503F3F4F7F4F4), UINT64_C(0xDD8BC016CB0BCBCB), UINT64_C(0xD37CC6ED3EF83E3E), UINT64_C(0x2D0A112805140505), UINT64_C(0x78CEE61F67816767), - UINT64_C(0x97D55373E4B7E4E4), UINT64_C(0x024EBB25279C2727), UINT64_C(0x7382583241194141), UINT64_C(0xA70B9D2C8B168B8B), UINT64_C(0xF6530151A7A6A7A7), UINT64_C(0xB2FA94CF7DE97D7D), UINT64_C(0x4937FBDC956E9595), UINT64_C(0x56AD9F8ED847D8D8), - UINT64_C(0x70EB308BFBCBFBFB), UINT64_C(0xCDC17123EE9FEEEE), UINT64_C(0xBBF891C77CED7C7C), UINT64_C(0x71CCE31766856666), UINT64_C(0x7BA78EA6DD53DDDD), UINT64_C(0xAF2E4BB8175C1717), UINT64_C(0x458E460247014747), UINT64_C(0x1A21DC849E429E9E), - UINT64_C(0xD489C51ECA0FCACA), UINT64_C(0x585A99752DB42D2D), UINT64_C(0x2E637991BFC6BFBF), UINT64_C(0x3F0E1B38071C0707), UINT64_C(0xAC472301AD8EADAD), UINT64_C(0xB0B42FEA5A755A5A), UINT64_C(0xEF1BB56C83368383), UINT64_C(0xB666FF8533CC3333), - UINT64_C(0x5CC6F23F63916363), UINT64_C(0x12040A1002080202), UINT64_C(0x93493839AA92AAAA), UINT64_C(0xDEE2A8AF71D97171), UINT64_C(0xC68DCF0EC807C8C8), UINT64_C(0xD1327DC819641919), UINT64_C(0x3B92707249394949), UINT64_C(0x5FAF9A86D943D9D9), - UINT64_C(0x31F91DC3F2EFF2F2), UINT64_C(0xA8DB484BE3ABE3E3), UINT64_C(0xB9B62AE25B715B5B), UINT64_C(0xBC0D9234881A8888), UINT64_C(0x3E29C8A49A529A9A), UINT64_C(0x0B4CBE2D26982626), UINT64_C(0xBF64FA8D32C83232), UINT64_C(0x597D4AE9B0FAB0B0), - UINT64_C(0xF2CF6A1BE983E9E9), UINT64_C(0x771E33780F3C0F0F), UINT64_C(0x33B7A6E6D573D5D5), UINT64_C(0xF41DBA74803A8080), UINT64_C(0x27617C99BEC2BEBE), UINT64_C(0xEB87DE26CD13CDCD), UINT64_C(0x8968E4BD34D03434), UINT64_C(0x3290757A483D4848), - UINT64_C(0x54E324ABFFDBFFFF), UINT64_C(0x8DF48FF77AF57A7A), UINT64_C(0x643DEAF4907A9090), UINT64_C(0x9DBE3EC25F615F5F), UINT64_C(0x3D40A01D20802020), UINT64_C(0x0FD0D56768BD6868), UINT64_C(0xCA3472D01A681A1A), UINT64_C(0xB7412C19AE82AEAE), - UINT64_C(0x7D755EC9B4EAB4B4), UINT64_C(0xCEA8199A544D5454), UINT64_C(0x7F3BE5EC93769393), UINT64_C(0x2F44AA0D22882222), UINT64_C(0x63C8E907648D6464), UINT64_C(0x2AFF12DBF1E3F1F1), UINT64_C(0xCCE6A2BF73D17373), UINT64_C(0x82245A9012481212), - UINT64_C(0x7A805D3A401D4040), UINT64_C(0x4810284008200808), UINT64_C(0x959BE856C32BC3C3), UINT64_C(0xDFC57B33EC97ECEC), UINT64_C(0x4DAB9096DB4BDBDB), UINT64_C(0xC05F1F61A1BEA1A1), UINT64_C(0x9107831C8D0E8D8D), UINT64_C(0xC87AC9F53DF43D3D), - UINT64_C(0x5B33F1CC97669797), UINT64_C(0x0000000000000000), UINT64_C(0xF983D436CF1BCFCF), UINT64_C(0x6E5687452BAC2B2B), UINT64_C(0xE1ECB39776C57676), UINT64_C(0xE619B06482328282), UINT64_C(0x28B1A9FED67FD6D6), UINT64_C(0xC33677D81B6C1B1B), - UINT64_C(0x74775BC1B5EEB5B5), UINT64_C(0xBE432911AF86AFAF), UINT64_C(0x1DD4DF776AB56A6A), UINT64_C(0xEAA00DBA505D5050), UINT64_C(0x578A4C1245094545), UINT64_C(0x38FB18CBF3EBF3F3), UINT64_C(0xAD60F09D30C03030), UINT64_C(0xC4C3742BEF9BEFEF), - UINT64_C(0xDA7EC3E53FFC3F3F), UINT64_C(0xC7AA1C9255495555), UINT64_C(0xDB591079A2B2A2A2), UINT64_C(0xE9C96503EA8FEAEA), UINT64_C(0x6ACAEC0F65896565), UINT64_C(0x036968B9BAD2BABA), UINT64_C(0x4A5E93652FBC2F2F), UINT64_C(0x8E9DE74EC027C0C0), - UINT64_C(0x60A181BEDE5FDEDE), UINT64_C(0xFC386CE01C701C1C), UINT64_C(0x46E72EBBFDD3FDFD), UINT64_C(0x1F9A64524D294D4D), UINT64_C(0x7639E0E492729292), UINT64_C(0xFAEABC8F75C97575), UINT64_C(0x360C1E3006180606), UINT64_C(0xAE0998248A128A8A), - UINT64_C(0x4B7940F9B2F2B2B2), UINT64_C(0x85D15963E6BFE6E6), UINT64_C(0x7E1C36700E380E0E), UINT64_C(0xE73E63F81F7C1F1F), UINT64_C(0x55C4F73762956262), UINT64_C(0x3AB5A3EED477D4D4), UINT64_C(0x814D3229A89AA8A8), UINT64_C(0x5231F4C496629696), - UINT64_C(0x62EF3A9BF9C3F9F9), UINT64_C(0xA397F666C533C5C5), UINT64_C(0x104AB13525942525), UINT64_C(0xABB220F259795959), UINT64_C(0xD015AE54842A8484), UINT64_C(0xC5E4A7B772D57272), UINT64_C(0xEC72DDD539E43939), UINT64_C(0x1698615A4C2D4C4C), - UINT64_C(0x94BC3BCA5E655E5E), UINT64_C(0x9FF085E778FD7878), UINT64_C(0xE570D8DD38E03838), UINT64_C(0x980586148C0A8C8C), UINT64_C(0x17BFB2C6D163D1D1), UINT64_C(0xE4570B41A5AEA5A5), UINT64_C(0xA1D94D43E2AFE2E2), UINT64_C(0x4EC2F82F61996161), - UINT64_C(0x427B45F1B3F6B3B3), UINT64_C(0x3442A51521842121), UINT64_C(0x0825D6949C4A9C9C), UINT64_C(0xEE3C66F01E781E1E), UINT64_C(0x6186522243114343), UINT64_C(0xB193FC76C73BC7C7), UINT64_C(0x4FE52BB3FCD7FCFC), UINT64_C(0x2408142004100404), - UINT64_C(0xE3A208B251595151), UINT64_C(0x252FC7BC995E9999), UINT64_C(0x22DAC44F6DA96D6D), UINT64_C(0x651A39680D340D0D), UINT64_C(0x79E93583FACFFAFA), UINT64_C(0x69A384B6DF5BDFDF), UINT64_C(0xA9FC9BD77EE57E7E), UINT64_C(0x1948B43D24902424), - UINT64_C(0xFE76D7C53BEC3B3B), UINT64_C(0x9A4B3D31AB96ABAB), UINT64_C(0xF081D13ECE1FCECE), UINT64_C(0x9922558811441111), UINT64_C(0x8303890C8F068F8F), UINT64_C(0x049C6B4A4E254E4E), UINT64_C(0x667351D1B7E6B7B7), UINT64_C(0xE0CB600BEB8BEBEB), - UINT64_C(0xC178CCFD3CF03C3C), UINT64_C(0xFD1FBF7C813E8181), UINT64_C(0x4035FED4946A9494), UINT64_C(0x1CF30CEBF7FBF7F7), UINT64_C(0x186F67A1B9DEB9B9), UINT64_C(0x8B265F98134C1313), UINT64_C(0x51589C7D2CB02C2C), UINT64_C(0x05BBB8D6D36BD3D3), - UINT64_C(0x8CD35C6BE7BBE7E7), UINT64_C(0x39DCCB576EA56E6E), UINT64_C(0xAA95F36EC437C4C4), UINT64_C(0x1B060F18030C0303), UINT64_C(0xDCAC138A56455656), UINT64_C(0x5E88491A440D4444), UINT64_C(0xA0FE9EDF7FE17F7F), UINT64_C(0x884F3721A99EA9A9), - UINT64_C(0x6754824D2AA82A2A), UINT64_C(0x0A6B6DB1BBD6BBBB), UINT64_C(0x879FE246C123C1C1), UINT64_C(0xF1A602A253515353), UINT64_C(0x72A58BAEDC57DCDC), UINT64_C(0x531627580B2C0B0B), UINT64_C(0x0127D39C9D4E9D9D), UINT64_C(0x2BD8C1476CAD6C6C), - UINT64_C(0xA462F59531C43131), UINT64_C(0xF3E8B98774CD7474), UINT64_C(0x15F109E3F6FFF6F6), UINT64_C(0x4C8C430A46054646), UINT64_C(0xA5452609AC8AACAC), UINT64_C(0xB50F973C891E8989), UINT64_C(0xB42844A014501414), UINT64_C(0xBADF425BE1A3E1E1), - UINT64_C(0xA62C4EB016581616), UINT64_C(0xF774D2CD3AE83A3A), UINT64_C(0x06D2D06F69B96969), UINT64_C(0x41122D4809240909), UINT64_C(0xD7E0ADA770DD7070), UINT64_C(0x6F7154D9B6E2B6B6), UINT64_C(0x1EBDB7CED067D0D0), UINT64_C(0xD6C77E3BED93EDED), - UINT64_C(0xE285DB2ECC17CCCC), UINT64_C(0x6884572A42154242), UINT64_C(0x2C2DC2B4985A9898), UINT64_C(0xED550E49A4AAA4A4), UINT64_C(0x7550885D28A02828), UINT64_C(0x86B831DA5C6D5C5C), UINT64_C(0x6BED3F93F8C7F8F8), UINT64_C(0xC211A44486228686), -}; - -static void whirlpool_round(uint64_t block[static 8], const uint64_t key[static 8]) { - uint64_t a = block[0]; - uint64_t b = block[1]; - uint64_t c = block[2]; - uint64_t d = block[3]; - uint64_t e = block[4]; - uint64_t f = block[5]; - uint64_t g = block[6]; - uint64_t h = block[7]; - - uint64_t r; - #define ROTR64(x, n) (((0U + (x)) << (64 - (n))) | ((x) >> (n))) // Assumes that x is uint64_t and 0 < n < 64 - #define DOROW(i, s, t, u, v, w, x, y, z) \ - r = MAGIC_TABLE[(uint8_t)s]; r = ROTR64(r, 8); \ - r ^= MAGIC_TABLE[(uint8_t)(t >> 8)]; r = ROTR64(r, 8); \ - r ^= MAGIC_TABLE[(uint8_t)(u >> 16)]; r = ROTR64(r, 8); \ - r ^= MAGIC_TABLE[(uint8_t)(v >> 24)]; r = ROTR64(r, 8); \ - r ^= MAGIC_TABLE[(uint8_t)(w >> 32)]; r = ROTR64(r, 8); \ - r ^= MAGIC_TABLE[(uint8_t)(x >> 40)]; r = ROTR64(r, 8); \ - r ^= MAGIC_TABLE[(uint8_t)(y >> 48)]; r = ROTR64(r, 8); \ - r ^= MAGIC_TABLE[(uint8_t)(z >> 56)]; r = ROTR64(r, 8); \ - block[i] = r ^ key[i]; - - DOROW(0, a, h, g, f, e, d, c, b) - DOROW(1, b, a, h, g, f, e, d, c) - DOROW(2, c, b, a, h, g, f, e, d) - DOROW(3, d, c, b, a, h, g, f, e) - DOROW(4, e, d, c, b, a, h, g, f) - DOROW(5, f, e, d, c, b, a, h, g) - DOROW(6, g, f, e, d, c, b, a, h) - DOROW(7, h, g, f, e, d, c, b, a) -} - -WASM_EXPORT -void Hash_Init() { - for (uint32_t i = 0; i < 64; i+=8) { - *(uint64_t*)(sctx.hash + i) = 0; - } - sctx.totalBytes = 0; - sctx.rem = 0; -} - -inline uint32_t min(uint32_t a, uint32_t b) { - if (a < b) return a; - return b; -} - -WASM_EXPORT -void Hash_Update(uint32_t len) { - sctx.totalBytes += len; - uint32_t read = 0; - if (sctx.rem > 0) { - uint32_t end = min(64, sctx.rem + len); - for (uint8_t z = sctx.rem; z < end; z++) { - sctx.buffer[z] = main_buffer[read++]; - } - if (end == 64) { - whirlpool_compress(sctx.hash, sctx.buffer); - sctx.rem = 0; - } else { - sctx.rem = end; - } - } - - while (len - read >= 64) { - whirlpool_compress(sctx.hash, &main_buffer[read]); - read += 64; - } - - if (len - read > 0) { - sctx.rem = len - read; - for (uint8_t z = 0; z < sctx.rem; z++) { - sctx.buffer[z] = main_buffer[read + z]; - } - } -} - -WASM_EXPORT -void Hash_Final() { - const int LENGTH_SIZE = 32; - - uint8_t temp[64] = {0}; - for (uint8_t i = 0; i < sctx.rem; i++) { - temp[i] = sctx.buffer[i]; - } - temp[sctx.rem] = 0x80; - sctx.rem++; - - if (BLOCK_LEN - sctx.rem < LENGTH_SIZE) { - whirlpool_compress(sctx.hash, temp); - for (uint32_t i = 0; i < 32; i+=8) { - *(uint64_t*)(temp + i) = 0; - } - } - - temp[BLOCK_LEN - 1] = (uint8_t)((sctx.totalBytes & 0x1FU) << 3); - sctx.totalBytes >>= 5; - for (int i = 1; i < LENGTH_SIZE; i++, sctx.totalBytes >>= 8) { - temp[BLOCK_LEN - 1 - i] = (uint8_t)(sctx.totalBytes & 0xFFU); - } - whirlpool_compress(sctx.hash, temp); - - for (uint32_t i = 0; i < 64; i+=8) { - *(uint64_t*)(main_buffer + i) = *(uint64_t*)(sctx.hash + i); - } -} - -WASM_EXPORT -const uint32_t STATE_SIZE = sizeof(sctx); - -WASM_EXPORT -uint8_t* Hash_GetState() { - return (uint8_t*) &sctx; -} - -WASM_EXPORT -void Hash_Calculate(uint32_t length) { - Hash_Init(); - Hash_Update(length); - Hash_Final(); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/src/xxhash128.c b/tools/mnemonic-test/node_modules/hash-wasm/src/xxhash128.c deleted file mode 100644 index 9e5ab589..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/src/xxhash128.c +++ /dev/null @@ -1,1003 +0,0 @@ -/* - * xxHash - Extremely Fast Hash algorithm - * Header File - * Copyright (C) 2012-2020 Yann Collet - * - * BSD 2-Clause License (https://www.opensource.org/licenses/bsd-license.php) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * You can contact the author at: - * - xxHash homepage: https://www.xxhash.com - * - xxHash source repository: https://github.com/Cyan4973/xxHash - * - * Modified for hash-wasm by Dani Biró - */ - -#define WITH_BUFFER -#include - -#include "hash-wasm.h" - -typedef uint8_t xxh_u8; -typedef uint32_t XXH32_hash_t; -typedef XXH32_hash_t xxh_u32; -typedef uint64_t XXH64_hash_t; -typedef XXH64_hash_t xxh_u64; -typedef struct { - XXH64_hash_t low64; /*!< `value & 0xFFFFFFFFFFFFFFFF` */ - XXH64_hash_t high64; /*!< `value >> 64` */ -} XXH128_hash_t; - -#define XXH_RESTRICT restrict -#define XXH_NO_INLINE static -#define XXH_likely(x) __builtin_expect(x, 1) -#define XXH_unlikely(x) __builtin_expect(x, 0) -#define XXH_swap64 __builtin_bswap64 -#define XXH_swap32 __builtin_bswap32 -#define XXH_rotl32 __builtin_rotateleft32 -#define XXH_rotl64 __builtin_rotateleft64 -#define XXH_FORCE_INLINE inline static - -#define XXH_ALIGN(n) alignas(n) -#define XXH_ALIGN_MEMBER(align, type) XXH_ALIGN(align) type -#define XXH3_INTERNALBUFFER_SIZE 256 -#define XXH3_SECRET_DEFAULT_SIZE 192 -#define XXH3_SECRET_SIZE_MIN 136 -#define XXH_SECRET_DEFAULT_SIZE 192 /* minimum XXH3_SECRET_SIZE_MIN */ -#define XXH_STRIPE_LEN 64 -#define XXH_SECRET_CONSUME_RATE \ - 8 /* nb of secret bytes consumed at each accumulation */ -#define XXH_ASSERT(c) ((void)0) -#define XXH_STATIC_ASSERT(c) \ - do { \ - enum { XXH_sa = 1 / (int)(!!(c)) }; \ - } while (0) -#define XXH_ACC_ALIGN 64 -#define XXH_ACC_NB (XXH_STRIPE_LEN / sizeof(xxh_u64)) -#define XXH_SECRET_MERGEACCS_START 11 -#define XXH3_MIDSIZE_MAX 240 -#define XXH_SECRET_LASTACC_START 7 -#define XXH3_MIDSIZE_STARTOFFSET 3 -#define XXH3_MIDSIZE_LASTOFFSET 17 -#define XXH_SEC_ALIGN 64 - -XXH_FORCE_INLINE xxh_u64 XXH_mult32to64(xxh_u64 x, xxh_u64 y) { - return (x & 0xFFFFFFFF) * (y & 0xFFFFFFFF); -} - -XXH_FORCE_INLINE xxh_u32 XXH_read32(const void* memPtr) { - return *(const xxh_u32*)memPtr; -} - -XXH_FORCE_INLINE xxh_u32 XXH_readLE32(const void* ptr) { - return XXH_read32(ptr); -} - -XXH_FORCE_INLINE xxh_u64 XXH_read64(const void* memPtr) { - return *(const xxh_u64*)memPtr; -} - -XXH_FORCE_INLINE xxh_u64 XXH_readLE64(const void* ptr) { - return XXH_read64(ptr); -} - -XXH_FORCE_INLINE void XXH_writeLE64(void* dst, xxh_u64 v64) { - memcpy64(dst, &v64); -} - -XXH_FORCE_INLINE xxh_u64 XXH_xorshift64(xxh_u64 v64, int shift) { - XXH_ASSERT(0 <= shift && shift < 64); - return v64 ^ (v64 >> shift); -} - -XXH_FORCE_INLINE XXH128_hash_t XXH_mult64to128(xxh_u64 lhs, xxh_u64 rhs) { - /* First calculate all of the cross products. */ - xxh_u64 const lo_lo = XXH_mult32to64(lhs & 0xFFFFFFFF, rhs & 0xFFFFFFFF); - xxh_u64 const hi_lo = XXH_mult32to64(lhs >> 32, rhs & 0xFFFFFFFF); - xxh_u64 const lo_hi = XXH_mult32to64(lhs & 0xFFFFFFFF, rhs >> 32); - xxh_u64 const hi_hi = XXH_mult32to64(lhs >> 32, rhs >> 32); - - /* Now add the products together. These will never overflow. */ - xxh_u64 const cross = (lo_lo >> 32) + (hi_lo & 0xFFFFFFFF) + lo_hi; - xxh_u64 const upper = (hi_lo >> 32) + (cross >> 32) + hi_hi; - xxh_u64 const lower = (cross << 32) | (lo_lo & 0xFFFFFFFF); - - XXH128_hash_t r128; - r128.low64 = lower; - r128.high64 = upper; - return r128; -} - -#define XXH_PREFETCH(ptr) (void)(ptr) /* disabled */ -typedef XXH128_hash_t (*XXH3_hashLong128_f)(const void* XXH_RESTRICT, size_t, - XXH64_hash_t, - const void* XXH_RESTRICT, size_t); -#define XXH_PREFETCH_DIST 320 - -#define XXH_PRIME32_1 0x9E3779B1U /*!< 0b10011110001101110111100110110001 */ -#define XXH_PRIME32_2 0x85EBCA77U /*!< 0b10000101111010111100101001110111 */ -#define XXH_PRIME32_3 0xC2B2AE3DU /*!< 0b11000010101100101010111000111101 */ -#define XXH_PRIME32_4 0x27D4EB2FU /*!< 0b00100111110101001110101100101111 */ -#define XXH_PRIME32_5 0x165667B1U /*!< 0b00010110010101100110011110110001 */ - -#define XXH_PRIME64_1 0x9E3779B185EBCA87ULL -#define XXH_PRIME64_2 0xC2B2AE3D27D4EB4FULL -#define XXH_PRIME64_3 0x165667B19E3779F9ULL -#define XXH_PRIME64_4 0x85EBCA77C2B2AE63ULL -#define XXH_PRIME64_5 0x27D4EB2F165667C5ULL - -XXH_ALIGN(64) -static const xxh_u8 XXH3_kSecret[XXH_SECRET_DEFAULT_SIZE] = { - 0xb8, 0xfe, 0x6c, 0x39, 0x23, 0xa4, 0x4b, 0xbe, 0x7c, 0x01, 0x81, 0x2c, - 0xf7, 0x21, 0xad, 0x1c, 0xde, 0xd4, 0x6d, 0xe9, 0x83, 0x90, 0x97, 0xdb, - 0x72, 0x40, 0xa4, 0xa4, 0xb7, 0xb3, 0x67, 0x1f, 0xcb, 0x79, 0xe6, 0x4e, - 0xcc, 0xc0, 0xe5, 0x78, 0x82, 0x5a, 0xd0, 0x7d, 0xcc, 0xff, 0x72, 0x21, - 0xb8, 0x08, 0x46, 0x74, 0xf7, 0x43, 0x24, 0x8e, 0xe0, 0x35, 0x90, 0xe6, - 0x81, 0x3a, 0x26, 0x4c, 0x3c, 0x28, 0x52, 0xbb, 0x91, 0xc3, 0x00, 0xcb, - 0x88, 0xd0, 0x65, 0x8b, 0x1b, 0x53, 0x2e, 0xa3, 0x71, 0x64, 0x48, 0x97, - 0xa2, 0x0d, 0xf9, 0x4e, 0x38, 0x19, 0xef, 0x46, 0xa9, 0xde, 0xac, 0xd8, - 0xa8, 0xfa, 0x76, 0x3f, 0xe3, 0x9c, 0x34, 0x3f, 0xf9, 0xdc, 0xbb, 0xc7, - 0xc7, 0x0b, 0x4f, 0x1d, 0x8a, 0x51, 0xe0, 0x4b, 0xcd, 0xb4, 0x59, 0x31, - 0xc8, 0x9f, 0x7e, 0xc9, 0xd9, 0x78, 0x73, 0x64, 0xea, 0xc5, 0xac, 0x83, - 0x34, 0xd3, 0xeb, 0xc3, 0xc5, 0x81, 0xa0, 0xff, 0xfa, 0x13, 0x63, 0xeb, - 0x17, 0x0d, 0xdd, 0x51, 0xb7, 0xf0, 0xda, 0x49, 0xd3, 0x16, 0x55, 0x26, - 0x29, 0xd4, 0x68, 0x9e, 0x2b, 0x16, 0xbe, 0x58, 0x7d, 0x47, 0xa1, 0xfc, - 0x8f, 0xf8, 0xb8, 0xd1, 0x7a, 0xd0, 0x31, 0xce, 0x45, 0xcb, 0x3a, 0x8f, - 0x95, 0x16, 0x04, 0x28, 0xaf, 0xd7, 0xfb, 0xca, 0xbb, 0x4b, 0x40, 0x7e, -}; - -#define XXH3_INIT_ACC \ - { \ - XXH_PRIME32_3, XXH_PRIME64_1, XXH_PRIME64_2, XXH_PRIME64_3, XXH_PRIME64_4, \ - XXH_PRIME32_2, XXH_PRIME64_5, XXH_PRIME32_1 \ - } - -struct XXH3_state_s { - XXH_ALIGN_MEMBER(64, XXH64_hash_t acc[8]); - /*!< The 8 accumulators. Similar to `vN` in @ref XXH32_state_s::v1 and @ref - * XXH64_state_s */ - XXH_ALIGN_MEMBER(64, unsigned char customSecret[XXH3_SECRET_DEFAULT_SIZE]); - /*!< Used to store a custom secret generated from a seed. */ - XXH_ALIGN_MEMBER(64, unsigned char buffer[XXH3_INTERNALBUFFER_SIZE]); - /*!< The internal buffer. @see XXH32_state_s::mem32 */ - XXH32_hash_t bufferedSize; - /*!< The amount of memory in @ref buffer, @see XXH32_state_s::memsize */ - XXH32_hash_t reserved32; - /*!< Reserved field. Needed for padding on 64-bit. */ - size_t nbStripesSoFar; - /*!< Number or stripes processed. */ - XXH64_hash_t totalLen; - /*!< Total length hashed. 64-bit even on 32-bit targets. */ - size_t nbStripesPerBlock; - /*!< Number of stripes per block. */ - size_t secretLimit; - /*!< Size of @ref customSecret or @ref extSecret */ - XXH64_hash_t seed; - /*!< Seed for _withSeed variants. Must be zero otherwise, @see - * XXH3_INITSTATE() */ - XXH64_hash_t reserved64; - /*!< Reserved field. */ - const unsigned char* extSecret; - /*!< Reference to an external secret for the _withSecret variants, NULL - * for other variants. */ - /* note: there may be some padding at the end due to alignment on 64 bytes */ -}; /* typedef'd to XXH3_state_t */ - -typedef struct XXH3_state_s XXH3_state_t; - -XXH_FORCE_INLINE xxh_u64 XXH64_avalanche(xxh_u64 h64) { - h64 ^= h64 >> 33; - h64 *= XXH_PRIME64_2; - h64 ^= h64 >> 29; - h64 *= XXH_PRIME64_3; - h64 ^= h64 >> 32; - return h64; -} - -XXH_FORCE_INLINE xxh_u64 XXH3_mul128_fold64(xxh_u64 lhs, xxh_u64 rhs) { - XXH128_hash_t product = XXH_mult64to128(lhs, rhs); - return product.low64 ^ product.high64; -} - -XXH_FORCE_INLINE xxh_u64 XXH3_mix16B( - const xxh_u8* XXH_RESTRICT input, - const xxh_u8* XXH_RESTRICT secret, xxh_u64 seed64 -) { - xxh_u64 const input_lo = XXH_readLE64(input); - xxh_u64 const input_hi = XXH_readLE64(input + 8); - return XXH3_mul128_fold64( - input_lo ^ (XXH_readLE64(secret) + seed64), - input_hi ^ (XXH_readLE64(secret + 8) - seed64) - ); -} - -static void XXH3_reset_internal( - XXH3_state_t* statePtr, XXH64_hash_t seed, - const void* secret, size_t secretSize -) { - size_t const initStart = offsetof(XXH3_state_t, bufferedSize); - size_t const initLength = - offsetof(XXH3_state_t, nbStripesPerBlock) - initStart; - XXH_ASSERT(offsetof(XXH3_state_t, nbStripesPerBlock) > initStart); - XXH_ASSERT(statePtr != NULL); - /* set members from bufferedSize to nbStripesPerBlock (excluded) to 0 */ - memset((char*)statePtr + initStart, 0, initLength); - statePtr->acc[0] = XXH_PRIME32_3; - statePtr->acc[1] = XXH_PRIME64_1; - statePtr->acc[2] = XXH_PRIME64_2; - statePtr->acc[3] = XXH_PRIME64_3; - statePtr->acc[4] = XXH_PRIME64_4; - statePtr->acc[5] = XXH_PRIME32_2; - statePtr->acc[6] = XXH_PRIME64_5; - statePtr->acc[7] = XXH_PRIME32_1; - statePtr->seed = seed; - statePtr->extSecret = (const unsigned char*)secret; - XXH_ASSERT(secretSize >= XXH3_SECRET_SIZE_MIN); - statePtr->secretLimit = secretSize - XXH_STRIPE_LEN; - statePtr->nbStripesPerBlock = statePtr->secretLimit / XXH_SECRET_CONSUME_RATE; -} - -static void XXH3_128bits_reset(XXH3_state_t* statePtr) { - XXH3_reset_internal(statePtr, 0, XXH3_kSecret, XXH_SECRET_DEFAULT_SIZE); -} - -static void XXH3_initCustomSecret_scalar( - void* XXH_RESTRICT customSecret, xxh_u64 seed64 -) { - const xxh_u8* kSecretPtr = XXH3_kSecret; - XXH_STATIC_ASSERT((XXH_SECRET_DEFAULT_SIZE & 15) == 0); - - XXH_ASSERT(kSecretPtr == XXH3_kSecret); - - int const nbRounds = XXH_SECRET_DEFAULT_SIZE / 16; - for (int i = 0; i < nbRounds; i++) { - /* - * The asm hack causes Clang to assume that kSecretPtr aliases with - * customSecret, and on aarch64, this prevented LDP from merging two - * loads together for free. Putting the loads together before the stores - * properly generates LDP. - */ - xxh_u64 lo = XXH_readLE64(kSecretPtr + 16 * i) + seed64; - xxh_u64 hi = XXH_readLE64(kSecretPtr + 16 * i + 8) - seed64; - XXH_writeLE64((xxh_u8*)customSecret + 16 * i, lo); - XXH_writeLE64((xxh_u8*)customSecret + 16 * i + 8, hi); - } -} - -static void XXH3_128bits_reset_withSeed( - XXH3_state_t* statePtr, XXH64_hash_t seed -) { - if (seed == 0) return XXH3_128bits_reset(statePtr); - if (seed != statePtr->seed) - XXH3_initCustomSecret_scalar(statePtr->customSecret, seed); - XXH3_reset_internal(statePtr, seed, NULL, XXH_SECRET_DEFAULT_SIZE); -} - -void XXH3_accumulate_512_scalar( - void* XXH_RESTRICT acc, const void* XXH_RESTRICT input, const void* XXH_RESTRICT secret -) { - XXH_ALIGN(XXH_ACC_ALIGN) - xxh_u64* const xacc = (xxh_u64*)acc; /* presumed aligned */ - const xxh_u8* const xinput = - (const xxh_u8*)input; /* no alignment restriction */ - const xxh_u8* const xsecret = - (const xxh_u8*)secret; /* no alignment restriction */ - XXH_ASSERT(((size_t)acc & (XXH_ACC_ALIGN - 1)) == 0); - for (size_t i = 0; i < XXH_ACC_NB; i++) { - xxh_u64 const data_val = XXH_readLE64(xinput + 8 * i); - xxh_u64 const data_key = data_val ^ XXH_readLE64(xsecret + i * 8); - xacc[i ^ 1] += data_val; /* swap adjacent lanes */ - xacc[i] += XXH_mult32to64(data_key & 0xFFFFFFFF, data_key >> 32); - } -} - -void XXH3_scrambleAcc_scalar( - void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret -) { - XXH_ALIGN(XXH_ACC_ALIGN) - xxh_u64* const xacc = (xxh_u64*)acc; /* presumed aligned */ - const xxh_u8* const xsecret = - (const xxh_u8*)secret; /* no alignment restriction */ - XXH_ASSERT((((size_t)acc) & (XXH_ACC_ALIGN - 1)) == 0); - for (size_t i = 0; i < XXH_ACC_NB; i++) { - xxh_u64 const key64 = XXH_readLE64(xsecret + 8 * i); - xxh_u64 acc64 = xacc[i]; - acc64 = XXH_xorshift64(acc64, 47); - acc64 ^= key64; - acc64 *= XXH_PRIME32_1; - xacc[i] = acc64; - } -} - -/* - * XXH3_accumulate() - * Loops over XXH3_accumulate_512(). - * Assumption: nbStripes will not overflow the secret size - */ -void XXH3_accumulate( - xxh_u64* XXH_RESTRICT acc, - const xxh_u8* XXH_RESTRICT input, - const xxh_u8* XXH_RESTRICT secret, size_t nbStripes -) { - for (size_t n = 0; n < nbStripes; n++) { - const xxh_u8* const in = input + n * XXH_STRIPE_LEN; - XXH_PREFETCH(in + XXH_PREFETCH_DIST); - XXH3_accumulate_512_scalar(acc, in, secret + n * XXH_SECRET_CONSUME_RATE); - } -} - -/* Note : when XXH3_consumeStripes() is invoked, - * there must be a guarantee that at least one more byte must be consumed from - * input - * so that the function can blindly consume all stripes using the "normal" - * secret segment */ -void XXH3_consumeStripes( - xxh_u64* XXH_RESTRICT acc, - size_t* XXH_RESTRICT nbStripesSoFarPtr, - size_t nbStripesPerBlock, - const xxh_u8* XXH_RESTRICT input, size_t nbStripes, - const xxh_u8* XXH_RESTRICT secret, - size_t secretLimit -) { - XXH_ASSERT(nbStripes <= - nbStripesPerBlock); /* can handle max 1 scramble per invocation */ - XXH_ASSERT(*nbStripesSoFarPtr < nbStripesPerBlock); - if (nbStripesPerBlock - *nbStripesSoFarPtr <= nbStripes) { - /* need a scrambling operation */ - size_t const nbStripesToEndofBlock = nbStripesPerBlock - *nbStripesSoFarPtr; - size_t const nbStripesAfterBlock = nbStripes - nbStripesToEndofBlock; - XXH3_accumulate(acc, input, - secret + nbStripesSoFarPtr[0] * XXH_SECRET_CONSUME_RATE, - nbStripesToEndofBlock); - XXH3_scrambleAcc_scalar(acc, secret + secretLimit); - XXH3_accumulate(acc, input + nbStripesToEndofBlock * XXH_STRIPE_LEN, secret, - nbStripesAfterBlock); - *nbStripesSoFarPtr = nbStripesAfterBlock; - } else { - XXH3_accumulate(acc, input, - secret + nbStripesSoFarPtr[0] * XXH_SECRET_CONSUME_RATE, - nbStripes); - *nbStripesSoFarPtr += nbStripes; - } -} - -void XXH3_update(XXH3_state_t* state, const xxh_u8* input, size_t len) { - { - const xxh_u8* const bEnd = input + len; - const unsigned char* const secret = - (state->extSecret == NULL) ? state->customSecret : state->extSecret; - - state->totalLen += len; - XXH_ASSERT(state->bufferedSize <= XXH3_INTERNALBUFFER_SIZE); - - if (state->bufferedSize + len <= XXH3_INTERNALBUFFER_SIZE) { /* fill in tmp buffer */ - memcpy2(state->buffer + state->bufferedSize, input, len); - state->bufferedSize += (XXH32_hash_t)len; - return; - } - /* total input is now > XXH3_INTERNALBUFFER_SIZE */ - -#define XXH3_INTERNALBUFFER_STRIPES (XXH3_INTERNALBUFFER_SIZE / XXH_STRIPE_LEN) - XXH_STATIC_ASSERT(XXH3_INTERNALBUFFER_SIZE % XXH_STRIPE_LEN == - 0); /* clean multiple */ - - /* - * Internal buffer is partially filled (always, except at beginning) - * Complete it, then consume it. - */ - if (state->bufferedSize) { - size_t const loadSize = XXH3_INTERNALBUFFER_SIZE - state->bufferedSize; - memcpy2(state->buffer + state->bufferedSize, input, loadSize); - input += loadSize; - XXH3_consumeStripes( - state->acc, &state->nbStripesSoFar, - state->nbStripesPerBlock, state->buffer, - XXH3_INTERNALBUFFER_STRIPES, secret, - state->secretLimit - ); - state->bufferedSize = 0; - } - XXH_ASSERT(input < bEnd); - - /* Consume input by a multiple of internal buffer size */ - if (input + XXH3_INTERNALBUFFER_SIZE < bEnd) { - const xxh_u8* const limit = bEnd - XXH3_INTERNALBUFFER_SIZE; - do { - XXH3_consumeStripes( - state->acc, &state->nbStripesSoFar, state->nbStripesPerBlock, input, - XXH3_INTERNALBUFFER_STRIPES, secret, state->secretLimit - ); - input += XXH3_INTERNALBUFFER_SIZE; - } while (input < limit); - /* for last partial stripe */ - memcpy64( - state->buffer + sizeof(state->buffer) - XXH_STRIPE_LEN, - input - XXH_STRIPE_LEN - ); - } - XXH_ASSERT(input < bEnd); - - /* Some remaining input (always) : buffer it */ - memcpy2(state->buffer, input, (size_t)(bEnd - input)); - state->bufferedSize = (XXH32_hash_t)(bEnd - input); - } - - return; -} - -void XXH3_128bits_update(XXH3_state_t* state, const void* input, size_t len) { - XXH3_update(state, (const xxh_u8*)input, len); -} - -xxh_u64 XXH3_mix2Accs( - const xxh_u64* XXH_RESTRICT acc, - const xxh_u8* XXH_RESTRICT secret -) { - return XXH3_mul128_fold64(acc[0] ^ XXH_readLE64(secret), - acc[1] ^ XXH_readLE64(secret + 8)); -} - -/* - * This is a fast avalanche stage, - * suitable when input bits are already partially mixed - */ -XXH64_hash_t XXH3_avalanche(xxh_u64 h64) { - h64 = XXH_xorshift64(h64, 37); - h64 *= 0x165667919E3779F9ULL; - h64 = XXH_xorshift64(h64, 32); - return h64; -} - -XXH64_hash_t XXH3_mergeAccs( - const xxh_u64* XXH_RESTRICT acc, - const xxh_u8* XXH_RESTRICT secret, xxh_u64 start -) { - xxh_u64 result64 = start; - - for (size_t i = 0; i < 4; i++) { - result64 += XXH3_mix2Accs(acc + 2 * i, secret + 16 * i); - } - - return XXH3_avalanche(result64); -} - -void XXH3_digest_long( - XXH64_hash_t* acc, - const XXH3_state_t* state, - const unsigned char* secret -) { - /* - * Digest on a local copy. This way, the state remains unaltered, and it can - * continue ingesting more input afterwards. - */ - memcpy2(acc, state->acc, sizeof(state->acc)); - if (state->bufferedSize >= XXH_STRIPE_LEN) { - size_t const nbStripes = (state->bufferedSize - 1) / XXH_STRIPE_LEN; - size_t nbStripesSoFar = state->nbStripesSoFar; - XXH3_consumeStripes( - acc, &nbStripesSoFar, state->nbStripesPerBlock, - state->buffer, nbStripes, secret, state->secretLimit - ); - /* last stripe */ - XXH3_accumulate_512_scalar( - acc, state->buffer + state->bufferedSize - XXH_STRIPE_LEN, - secret + state->secretLimit - XXH_SECRET_LASTACC_START - ); - } else { /* bufferedSize < XXH_STRIPE_LEN */ - xxh_u8 lastStripe[XXH_STRIPE_LEN]; - size_t const catchupSize = XXH_STRIPE_LEN - state->bufferedSize; - XXH_ASSERT(state->bufferedSize > 0); /* there is always some input buffered */ - memcpy2(lastStripe, state->buffer + sizeof(state->buffer) - catchupSize, catchupSize); - memcpy2(lastStripe + catchupSize, state->buffer, state->bufferedSize); - XXH3_accumulate_512_scalar( - acc, lastStripe, - secret + state->secretLimit - XXH_SECRET_LASTACC_START - ); - } -} - -XXH128_hash_t XXH3_len_1to3_128b( - const xxh_u8* input, size_t len, - const xxh_u8* secret, XXH64_hash_t seed -) { - /* A doubled version of 1to3_64b with different constants. */ - XXH_ASSERT(input != NULL); - XXH_ASSERT(1 <= len && len <= 3); - XXH_ASSERT(secret != NULL); - /* - * len = 1: combinedl = { input[0], 0x01, input[0], input[0] } - * len = 2: combinedl = { input[1], 0x02, input[0], input[1] } - * len = 3: combinedl = { input[2], 0x03, input[0], input[1] } - */ - { - xxh_u8 const c1 = input[0]; - xxh_u8 const c2 = input[len >> 1]; - xxh_u8 const c3 = input[len - 1]; - xxh_u32 const combinedl = ((xxh_u32)c1 << 16) | ((xxh_u32)c2 << 24) | - ((xxh_u32)c3 << 0) | ((xxh_u32)len << 8); - xxh_u32 const combinedh = XXH_rotl32(XXH_swap32(combinedl), 13); - xxh_u64 const bitflipl = - (XXH_readLE32(secret) ^ XXH_readLE32(secret + 4)) + seed; - xxh_u64 const bitfliph = - (XXH_readLE32(secret + 8) ^ XXH_readLE32(secret + 12)) - seed; - xxh_u64 const keyed_lo = (xxh_u64)combinedl ^ bitflipl; - xxh_u64 const keyed_hi = (xxh_u64)combinedh ^ bitfliph; - XXH128_hash_t h128; - h128.low64 = XXH64_avalanche(keyed_lo); - h128.high64 = XXH64_avalanche(keyed_hi); - return h128; - } -} - -XXH128_hash_t XXH3_len_4to8_128b( - const xxh_u8* input, size_t len, - const xxh_u8* secret, XXH64_hash_t seed -) { - XXH_ASSERT(input != NULL); - XXH_ASSERT(secret != NULL); - XXH_ASSERT(4 <= len && len <= 8); - seed ^= (xxh_u64)XXH_swap32((xxh_u32)seed) << 32; - { - xxh_u32 const input_lo = XXH_readLE32(input); - xxh_u32 const input_hi = XXH_readLE32(input + len - 4); - xxh_u64 const input_64 = input_lo + ((xxh_u64)input_hi << 32); - xxh_u64 const bitflip = - (XXH_readLE64(secret + 16) ^ XXH_readLE64(secret + 24)) + seed; - xxh_u64 const keyed = input_64 ^ bitflip; - - /* Shift len to the left to ensure it is even, this avoids even multiplies. - */ - XXH128_hash_t m128 = XXH_mult64to128(keyed, XXH_PRIME64_1 + (len << 2)); - - m128.high64 += (m128.low64 << 1); - m128.low64 ^= (m128.high64 >> 3); - - m128.low64 = XXH_xorshift64(m128.low64, 35); - m128.low64 *= 0x9FB21C651E98DF25ULL; - m128.low64 = XXH_xorshift64(m128.low64, 28); - m128.high64 = XXH3_avalanche(m128.high64); - return m128; - } -} - -XXH128_hash_t XXH3_len_9to16_128b( - const xxh_u8* input, size_t len, - const xxh_u8* secret, XXH64_hash_t seed -) { - XXH_ASSERT(input != NULL); - XXH_ASSERT(secret != NULL); - XXH_ASSERT(9 <= len && len <= 16); - { - xxh_u64 const bitflipl = - (XXH_readLE64(secret + 32) ^ XXH_readLE64(secret + 40)) - seed; - xxh_u64 const bitfliph = - (XXH_readLE64(secret + 48) ^ XXH_readLE64(secret + 56)) + seed; - xxh_u64 const input_lo = XXH_readLE64(input); - xxh_u64 input_hi = XXH_readLE64(input + len - 8); - XXH128_hash_t m128 = - XXH_mult64to128(input_lo ^ input_hi ^ bitflipl, XXH_PRIME64_1); - /* - * Put len in the middle of m128 to ensure that the length gets mixed to - * both the low and high bits in the 128x64 multiply below. - */ - m128.low64 += (xxh_u64)(len - 1) << 54; - input_hi ^= bitfliph; - /* - * Add the high 32 bits of input_hi to the high 32 bits of m128, then - * add the long product of the low 32 bits of input_hi and XXH_PRIME32_2 to - * the high 64 bits of m128. - * - * The best approach to this operation is different on 32-bit and 64-bit. - */ - if (sizeof(void*) < sizeof(xxh_u64)) { /* 32-bit */ - /* - * 32-bit optimized version, which is more readable. - * - * On 32-bit, it removes an ADC and delays a dependency between the two - * halves of m128.high64, but it generates an extra mask on 64-bit. - */ - m128.high64 += (input_hi & 0xFFFFFFFF00000000ULL) + - XXH_mult32to64((xxh_u32)input_hi, XXH_PRIME32_2); - } else { - /* - * 64-bit optimized (albeit more confusing) version. - * - * Uses some properties of addition and multiplication to remove the mask: - * - * Let: - * a = input_hi.lo = (input_hi & 0x00000000FFFFFFFF) - * b = input_hi.hi = (input_hi & 0xFFFFFFFF00000000) - * c = XXH_PRIME32_2 - * - * a + (b * c) - * Inverse Property: x + y - x == y - * a + (b * (1 + c - 1)) - * Distributive Property: x * (y + z) == (x * y) + (x * z) - * a + (b * 1) + (b * (c - 1)) - * Identity Property: x * 1 == x - * a + b + (b * (c - 1)) - * - * Substitute a, b, and c: - * input_hi.hi + input_hi.lo + ((xxh_u64)input_hi.lo * (XXH_PRIME32_2 - - * 1)) - * - * Since input_hi.hi + input_hi.lo == input_hi, we get this: - * input_hi + ((xxh_u64)input_hi.lo * (XXH_PRIME32_2 - 1)) - */ - m128.high64 += - input_hi + XXH_mult32to64((xxh_u32)input_hi, XXH_PRIME32_2 - 1); - } - /* m128 ^= XXH_swap64(m128 >> 64); */ - m128.low64 ^= XXH_swap64(m128.high64); - - { /* 128x64 multiply: h128 = m128 * XXH_PRIME64_2; */ - XXH128_hash_t h128 = XXH_mult64to128(m128.low64, XXH_PRIME64_2); - h128.high64 += m128.high64 * XXH_PRIME64_2; - - h128.low64 = XXH3_avalanche(h128.low64); - h128.high64 = XXH3_avalanche(h128.high64); - return h128; - } - } -} - -XXH128_hash_t XXH3_len_0to16_128b( - const xxh_u8* input, size_t len, - const xxh_u8* secret, XXH64_hash_t seed -) { - XXH_ASSERT(len <= 16); - { - if (len > 8) return XXH3_len_9to16_128b(input, len, secret, seed); - if (len >= 4) return XXH3_len_4to8_128b(input, len, secret, seed); - if (len) return XXH3_len_1to3_128b(input, len, secret, seed); - { - XXH128_hash_t h128; - xxh_u64 const bitflipl = - XXH_readLE64(secret + 64) ^ XXH_readLE64(secret + 72); - xxh_u64 const bitfliph = - XXH_readLE64(secret + 80) ^ XXH_readLE64(secret + 88); - h128.low64 = XXH64_avalanche(seed ^ bitflipl); - h128.high64 = XXH64_avalanche(seed ^ bitfliph); - return h128; - } - } -} - -/* - * A bit slower than XXH3_mix16B, but handles multiply by zero better. - */ -XXH128_hash_t XXH128_mix32B( - XXH128_hash_t acc, const xxh_u8* input_1, - const xxh_u8* input_2, const xxh_u8* secret, - XXH64_hash_t seed -) { - acc.low64 += XXH3_mix16B(input_1, secret + 0, seed); - acc.low64 ^= XXH_readLE64(input_2) + XXH_readLE64(input_2 + 8); - acc.high64 += XXH3_mix16B(input_2, secret + 16, seed); - acc.high64 ^= XXH_readLE64(input_1) + XXH_readLE64(input_1 + 8); - return acc; -} - -XXH128_hash_t XXH3_len_17to128_128b( - const xxh_u8* XXH_RESTRICT input, - size_t len, - const xxh_u8* XXH_RESTRICT secret, - size_t secretSize, XXH64_hash_t seed -) { - XXH_ASSERT(secretSize >= XXH3_SECRET_SIZE_MIN); - (void)secretSize; - XXH_ASSERT(16 < len && len <= 128); - - { - XXH128_hash_t acc; - acc.low64 = len * XXH_PRIME64_1; - acc.high64 = 0; - if (len > 32) { - if (len > 64) { - if (len > 96) { - acc = XXH128_mix32B(acc, input + 48, input + len - 64, secret + 96, - seed); - } - acc = - XXH128_mix32B(acc, input + 32, input + len - 48, secret + 64, seed); - } - acc = XXH128_mix32B(acc, input + 16, input + len - 32, secret + 32, seed); - } - acc = XXH128_mix32B(acc, input, input + len - 16, secret, seed); - { - XXH128_hash_t h128; - h128.low64 = acc.low64 + acc.high64; - h128.high64 = (acc.low64 * XXH_PRIME64_1) + (acc.high64 * XXH_PRIME64_4) + - ((len - seed) * XXH_PRIME64_2); - h128.low64 = XXH3_avalanche(h128.low64); - h128.high64 = (XXH64_hash_t)0 - XXH3_avalanche(h128.high64); - return h128; - } - } -} - -XXH128_hash_t XXH3_len_129to240_128b( - const xxh_u8* XXH_RESTRICT input, - size_t len, - const xxh_u8* XXH_RESTRICT secret, - size_t secretSize, XXH64_hash_t seed -) { - XXH_ASSERT(secretSize >= XXH3_SECRET_SIZE_MIN); - (void)secretSize; - XXH_ASSERT(128 < len && len <= XXH3_MIDSIZE_MAX); - - { - XXH128_hash_t acc; - int const nbRounds = (int)len / 32; - int i; - acc.low64 = len * XXH_PRIME64_1; - acc.high64 = 0; - for (i = 0; i < 4; i++) { - acc = XXH128_mix32B(acc, input + (32 * i), input + (32 * i) + 16, - secret + (32 * i), seed); - } - acc.low64 = XXH3_avalanche(acc.low64); - acc.high64 = XXH3_avalanche(acc.high64); - XXH_ASSERT(nbRounds >= 4); - for (i = 4; i < nbRounds; i++) { - acc = XXH128_mix32B(acc, input + (32 * i), input + (32 * i) + 16, - secret + XXH3_MIDSIZE_STARTOFFSET + (32 * (i - 4)), - seed); - } - /* last bytes */ - acc = XXH128_mix32B( - acc, input + len - 16, input + len - 32, - secret + XXH3_SECRET_SIZE_MIN - XXH3_MIDSIZE_LASTOFFSET - 16, - 0ULL - seed); - - { - XXH128_hash_t h128; - h128.low64 = acc.low64 + acc.high64; - h128.high64 = (acc.low64 * XXH_PRIME64_1) + (acc.high64 * XXH_PRIME64_4) + - ((len - seed) * XXH_PRIME64_2); - h128.low64 = XXH3_avalanche(h128.low64); - h128.high64 = (XXH64_hash_t)0 - XXH3_avalanche(h128.high64); - return h128; - } - } -} - -void XXH3_hashLong_internal_loop( - xxh_u64* XXH_RESTRICT acc, - const xxh_u8* XXH_RESTRICT input, size_t len, - const xxh_u8* XXH_RESTRICT secret, - size_t secretSize -) { - size_t const nbStripesPerBlock = - (secretSize - XXH_STRIPE_LEN) / XXH_SECRET_CONSUME_RATE; - size_t const block_len = XXH_STRIPE_LEN * nbStripesPerBlock; - size_t const nb_blocks = (len - 1) / block_len; - - size_t n; - - XXH_ASSERT(secretSize >= XXH3_SECRET_SIZE_MIN); - - for (n = 0; n < nb_blocks; n++) { - XXH3_accumulate(acc, input + n * block_len, secret, nbStripesPerBlock); - XXH3_scrambleAcc_scalar(acc, secret + secretSize - XXH_STRIPE_LEN); - } - - /* last partial block */ - XXH_ASSERT(len > XXH_STRIPE_LEN); - { - size_t const nbStripes = - ((len - 1) - (block_len * nb_blocks)) / XXH_STRIPE_LEN; - XXH_ASSERT(nbStripes <= (secretSize / XXH_SECRET_CONSUME_RATE)); - XXH3_accumulate(acc, input + nb_blocks * block_len, secret, nbStripes); - - /* last stripe */ - { - const xxh_u8* const p = input + len - XXH_STRIPE_LEN; -#define XXH_SECRET_LASTACC_START \ - 7 /* not aligned on 8, last secret is different from acc & scrambler */ - XXH3_accumulate_512_scalar( - acc, p, - secret + secretSize - XXH_STRIPE_LEN - XXH_SECRET_LASTACC_START); - } - } -} - -XXH128_hash_t XXH3_hashLong_128b_internal( - const void* XXH_RESTRICT input, - size_t len, - const xxh_u8* XXH_RESTRICT secret, - size_t secretSize -) { - XXH_ALIGN(XXH_ACC_ALIGN) xxh_u64 acc[XXH_ACC_NB] = XXH3_INIT_ACC; - - XXH3_hashLong_internal_loop(acc, (const xxh_u8*)input, len, secret, - secretSize); - - /* converge into final hash */ - XXH_STATIC_ASSERT(sizeof(acc) == 64); - XXH_ASSERT(secretSize >= sizeof(acc) + XXH_SECRET_MERGEACCS_START); - { - XXH128_hash_t h128; - h128.low64 = XXH3_mergeAccs( - acc, secret + XXH_SECRET_MERGEACCS_START, - (xxh_u64)len * XXH_PRIME64_1 - ); - h128.high64 = XXH3_mergeAccs( - acc, secret + secretSize - sizeof(acc) - XXH_SECRET_MERGEACCS_START, - ~((xxh_u64)len * XXH_PRIME64_2) - ); - return h128; - } -} - -XXH128_hash_t XXH3_hashLong_128b_withSeed_internal( - const void* XXH_RESTRICT input, size_t len, XXH64_hash_t seed64 -) { - if (seed64 == 0) - return XXH3_hashLong_128b_internal( - input, len, XXH3_kSecret, sizeof(XXH3_kSecret) - ); - { - XXH_ALIGN(XXH_SEC_ALIGN) xxh_u8 secret[XXH_SECRET_DEFAULT_SIZE]; - XXH3_initCustomSecret_scalar(secret, seed64); - return XXH3_hashLong_128b_internal( - input, len, (const xxh_u8*)secret, sizeof(secret) - ); - } -} - -/* - * It's important for performance that XXH3_hashLong is not inlined. - */ - -XXH128_hash_t XXH3_hashLong_128b_withSeed( - const void* input, size_t len, - XXH64_hash_t seed64, - const void* XXH_RESTRICT secret, - size_t secretLen -) { - return XXH3_hashLong_128b_withSeed_internal(input, len, seed64); -} - -XXH128_hash_t XXH3_128bits_internal( - const void* input, size_t len, - XXH64_hash_t seed64, - const void* XXH_RESTRICT secret, - size_t secretLen, - XXH3_hashLong128_f f_hl128 -) { - XXH_ASSERT(secretLen >= XXH3_SECRET_SIZE_MIN); - /* - * If an action is to be taken if `secret` conditions are not respected, - * it should be done here. - * For now, it's a contract pre-condition. - * Adding a check and a branch here would cost performance at every hash. - */ - if (len <= 16) - return XXH3_len_0to16_128b( - (const xxh_u8*)input, len, (const xxh_u8*)secret, seed64 - ); - if (len <= 128) - return XXH3_len_17to128_128b( - (const xxh_u8*)input, len, (const xxh_u8*)secret, secretLen, seed64 - ); - if (len <= XXH3_MIDSIZE_MAX) - return XXH3_len_129to240_128b( - (const xxh_u8*)input, len, (const xxh_u8*)secret, secretLen, seed64 - ); - return f_hl128(input, len, seed64, secret, secretLen); -} - -XXH128_hash_t XXH3_128bits_withSeed( - const void* input, size_t len, XXH64_hash_t seed -) { - return XXH3_128bits_internal( - input, len, seed, XXH3_kSecret, sizeof(XXH3_kSecret), XXH3_hashLong_128b_withSeed - ); -} - -XXH128_hash_t XXH3_hashLong_128b_withSecret( - const void* XXH_RESTRICT input, - size_t len, XXH64_hash_t seed64, - const void* XXH_RESTRICT secret, - size_t secretLen -) { - return XXH3_hashLong_128b_internal( - input, len, (const xxh_u8*)secret, secretLen - ); -} - -XXH128_hash_t XXH3_128bits_withSecret( - const void* input, size_t len, const void* secret, size_t secretSize -) { - return XXH3_128bits_internal( - input, len, 0, (const xxh_u8*)secret, secretSize, XXH3_hashLong_128b_withSecret - ); -} - -XXH128_hash_t XXH3_128bits_digest(const XXH3_state_t* state) { - const unsigned char* const secret = - (state->extSecret == NULL) ? state->customSecret : state->extSecret; - if (state->totalLen > XXH3_MIDSIZE_MAX) { - XXH_ALIGN(XXH_ACC_ALIGN) XXH64_hash_t acc[XXH_ACC_NB]; - XXH3_digest_long(acc, state, secret); - XXH_ASSERT(state->secretLimit + XXH_STRIPE_LEN >= sizeof(acc) + XXH_SECRET_MERGEACCS_START); - { - XXH128_hash_t h128; - h128.low64 = XXH3_mergeAccs( - acc, secret + XXH_SECRET_MERGEACCS_START, (xxh_u64)state->totalLen * XXH_PRIME64_1 - ); - h128.high64 = - XXH3_mergeAccs( - acc, - secret + state->secretLimit + XXH_STRIPE_LEN - sizeof(acc) - XXH_SECRET_MERGEACCS_START, - ~((xxh_u64)state->totalLen * XXH_PRIME64_2) - ); - return h128; - } - } - /* len <= XXH3_MIDSIZE_MAX : short code */ - if (state->seed) - return XXH3_128bits_withSeed( - state->buffer, (size_t)state->totalLen, state->seed - ); - return XXH3_128bits_withSecret( - state->buffer, (size_t)(state->totalLen), secret, state->secretLimit + XXH_STRIPE_LEN - ); -} - -static struct XXH3_state_s sctx; -XXH3_state_t* state = &sctx; - -WASM_EXPORT -void Hash_Init() { - // seed is at the memory object - uint64_t seed = *((uint64_t*)main_buffer); - XXH3_128bits_reset_withSeed(state, seed); -} - -WASM_EXPORT -void Hash_Update(uint32_t length) { - const void* input = main_buffer; - XXH3_128bits_update(state, input, length); -} - -WASM_EXPORT -void Hash_Final() { - XXH128_hash_t result = XXH3_128bits_digest(state); - result.high64 = XXH_swap64(result.high64); - memcpy64(main_buffer, &result.high64); - result.low64 = XXH_swap64(result.low64); - memcpy64(main_buffer + 8, &result.low64); -} - -WASM_EXPORT -const uint32_t STATE_SIZE = sizeof(sctx); - -WASM_EXPORT -uint8_t* Hash_GetState() { return (uint8_t*)&sctx; } - -WASM_EXPORT -void Hash_Calculate() { return; } diff --git a/tools/mnemonic-test/node_modules/hash-wasm/src/xxhash3.c b/tools/mnemonic-test/node_modules/hash-wasm/src/xxhash3.c deleted file mode 100644 index fdb19543..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/src/xxhash3.c +++ /dev/null @@ -1,871 +0,0 @@ -/* - * xxHash - Extremely Fast Hash algorithm - * Header File - * Copyright (C) 2012-2020 Yann Collet - * - * BSD 2-Clause License (https://www.opensource.org/licenses/bsd-license.php) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * You can contact the author at: - * - xxHash homepage: https://www.xxhash.com - * - xxHash source repository: https://github.com/Cyan4973/xxHash - * - * Modified for hash-wasm by Dani Biró - */ - -#define WITH_BUFFER -#include - -#include "hash-wasm.h" - -typedef uint8_t xxh_u8; -typedef uint32_t XXH32_hash_t; -typedef XXH32_hash_t xxh_u32; -typedef uint64_t XXH64_hash_t; -typedef XXH64_hash_t xxh_u64; -typedef struct { - XXH64_hash_t low64; /*!< `value & 0xFFFFFFFFFFFFFFFF` */ - XXH64_hash_t high64; /*!< `value >> 64` */ -} XXH128_hash_t; - -#define XXH_RESTRICT restrict -#define XXH_NO_INLINE static -#define XXH_likely(x) __builtin_expect(x, 1) -#define XXH_unlikely(x) __builtin_expect(x, 0) -#define XXH_swap64 __builtin_bswap64 -#define XXH_swap32 __builtin_bswap32 -#define XXH_rotl32 __builtin_rotateleft32 -#define XXH_rotl64 __builtin_rotateleft64 -#define XXH_FORCE_INLINE inline static - -#define XXH_ALIGN(n) alignas(n) -#define XXH_ALIGN_MEMBER(align, type) XXH_ALIGN(align) type -#define XXH3_INTERNALBUFFER_SIZE 256 -#define XXH3_SECRET_DEFAULT_SIZE 192 -#define XXH3_SECRET_SIZE_MIN 136 -#define XXH_SECRET_DEFAULT_SIZE 192 /* minimum XXH3_SECRET_SIZE_MIN */ -#define XXH_STRIPE_LEN 64 -#define XXH_SECRET_CONSUME_RATE \ - 8 /* nb of secret bytes consumed at each accumulation */ -#define XXH_ASSERT(c) ((void)0) -#define XXH_STATIC_ASSERT(c) \ - do { \ - enum { XXH_sa = 1 / (int)(!!(c)) }; \ - } while (0) -#define XXH_ACC_ALIGN 64 -#define XXH_ACC_NB (XXH_STRIPE_LEN / sizeof(xxh_u64)) -#define XXH_SECRET_MERGEACCS_START 11 -#define XXH3_MIDSIZE_MAX 240 -#define XXH_SECRET_LASTACC_START 7 -#define XXH3_MIDSIZE_STARTOFFSET 3 -#define XXH3_MIDSIZE_LASTOFFSET 17 -#define XXH_SEC_ALIGN 64 - -XXH_FORCE_INLINE xxh_u64 XXH_mult32to64(xxh_u64 x, xxh_u64 y) { - return (x & 0xFFFFFFFF) * (y & 0xFFFFFFFF); -} - -XXH_FORCE_INLINE xxh_u32 XXH_read32(const void* memPtr) { - return *(const xxh_u32*)memPtr; -} - -XXH_FORCE_INLINE xxh_u32 XXH_readLE32(const void* ptr) { - return XXH_read32(ptr); -} - -XXH_FORCE_INLINE xxh_u64 XXH_read64(const void* memPtr) { - return *(const xxh_u64*)memPtr; -} - -XXH_FORCE_INLINE xxh_u64 XXH_readLE64(const void* ptr) { - return XXH_read64(ptr); -} - -XXH_FORCE_INLINE void XXH_writeLE64(void* dst, xxh_u64 v64) { - memcpy64(dst, &v64); -} - -XXH_FORCE_INLINE xxh_u64 XXH_xorshift64(xxh_u64 v64, int shift) { - XXH_ASSERT(0 <= shift && shift < 64); - return v64 ^ (v64 >> shift); -} - -/* - * This is a stronger avalanche, - * inspired by Pelle Evensen's rrmxmx - * preferable when input has not been previously mixed - */ -XXH_FORCE_INLINE XXH64_hash_t XXH3_rrmxmx(xxh_u64 h64, xxh_u64 len) { - /* this mix is inspired by Pelle Evensen's rrmxmx */ - h64 ^= XXH_rotl64(h64, 49) ^ XXH_rotl64(h64, 24); - h64 *= 0x9FB21C651E98DF25ULL; - h64 ^= (h64 >> 35) + len; - h64 *= 0x9FB21C651E98DF25ULL; - return XXH_xorshift64(h64, 28); -} - -XXH_FORCE_INLINE XXH128_hash_t XXH_mult64to128(xxh_u64 lhs, xxh_u64 rhs) { - /* First calculate all of the cross products. */ - xxh_u64 const lo_lo = XXH_mult32to64(lhs & 0xFFFFFFFF, rhs & 0xFFFFFFFF); - xxh_u64 const hi_lo = XXH_mult32to64(lhs >> 32, rhs & 0xFFFFFFFF); - xxh_u64 const lo_hi = XXH_mult32to64(lhs & 0xFFFFFFFF, rhs >> 32); - xxh_u64 const hi_hi = XXH_mult32to64(lhs >> 32, rhs >> 32); - - /* Now add the products together. These will never overflow. */ - xxh_u64 const cross = (lo_lo >> 32) + (hi_lo & 0xFFFFFFFF) + lo_hi; - xxh_u64 const upper = (hi_lo >> 32) + (cross >> 32) + hi_hi; - xxh_u64 const lower = (cross << 32) | (lo_lo & 0xFFFFFFFF); - - XXH128_hash_t r128; - r128.low64 = lower; - r128.high64 = upper; - return r128; -} - -#define XXH_PREFETCH(ptr) (void)(ptr) /* disabled */ -typedef XXH64_hash_t (*XXH3_hashLong64_f)( - const void* XXH_RESTRICT, size_t, - XXH64_hash_t, - const xxh_u8* XXH_RESTRICT, size_t -); -#define XXH_PREFETCH_DIST 320 - -#define XXH_PRIME32_1 0x9E3779B1U /*!< 0b10011110001101110111100110110001 */ -#define XXH_PRIME32_2 0x85EBCA77U /*!< 0b10000101111010111100101001110111 */ -#define XXH_PRIME32_3 0xC2B2AE3DU /*!< 0b11000010101100101010111000111101 */ -#define XXH_PRIME32_4 0x27D4EB2FU /*!< 0b00100111110101001110101100101111 */ -#define XXH_PRIME32_5 0x165667B1U /*!< 0b00010110010101100110011110110001 */ - -#define XXH_PRIME64_1 0x9E3779B185EBCA87ULL -#define XXH_PRIME64_2 0xC2B2AE3D27D4EB4FULL -#define XXH_PRIME64_3 0x165667B19E3779F9ULL -#define XXH_PRIME64_4 0x85EBCA77C2B2AE63ULL -#define XXH_PRIME64_5 0x27D4EB2F165667C5ULL - -XXH_ALIGN(64) -static const xxh_u8 XXH3_kSecret[XXH_SECRET_DEFAULT_SIZE] = { - 0xb8, 0xfe, 0x6c, 0x39, 0x23, 0xa4, 0x4b, 0xbe, 0x7c, 0x01, 0x81, 0x2c, - 0xf7, 0x21, 0xad, 0x1c, 0xde, 0xd4, 0x6d, 0xe9, 0x83, 0x90, 0x97, 0xdb, - 0x72, 0x40, 0xa4, 0xa4, 0xb7, 0xb3, 0x67, 0x1f, 0xcb, 0x79, 0xe6, 0x4e, - 0xcc, 0xc0, 0xe5, 0x78, 0x82, 0x5a, 0xd0, 0x7d, 0xcc, 0xff, 0x72, 0x21, - 0xb8, 0x08, 0x46, 0x74, 0xf7, 0x43, 0x24, 0x8e, 0xe0, 0x35, 0x90, 0xe6, - 0x81, 0x3a, 0x26, 0x4c, 0x3c, 0x28, 0x52, 0xbb, 0x91, 0xc3, 0x00, 0xcb, - 0x88, 0xd0, 0x65, 0x8b, 0x1b, 0x53, 0x2e, 0xa3, 0x71, 0x64, 0x48, 0x97, - 0xa2, 0x0d, 0xf9, 0x4e, 0x38, 0x19, 0xef, 0x46, 0xa9, 0xde, 0xac, 0xd8, - 0xa8, 0xfa, 0x76, 0x3f, 0xe3, 0x9c, 0x34, 0x3f, 0xf9, 0xdc, 0xbb, 0xc7, - 0xc7, 0x0b, 0x4f, 0x1d, 0x8a, 0x51, 0xe0, 0x4b, 0xcd, 0xb4, 0x59, 0x31, - 0xc8, 0x9f, 0x7e, 0xc9, 0xd9, 0x78, 0x73, 0x64, 0xea, 0xc5, 0xac, 0x83, - 0x34, 0xd3, 0xeb, 0xc3, 0xc5, 0x81, 0xa0, 0xff, 0xfa, 0x13, 0x63, 0xeb, - 0x17, 0x0d, 0xdd, 0x51, 0xb7, 0xf0, 0xda, 0x49, 0xd3, 0x16, 0x55, 0x26, - 0x29, 0xd4, 0x68, 0x9e, 0x2b, 0x16, 0xbe, 0x58, 0x7d, 0x47, 0xa1, 0xfc, - 0x8f, 0xf8, 0xb8, 0xd1, 0x7a, 0xd0, 0x31, 0xce, 0x45, 0xcb, 0x3a, 0x8f, - 0x95, 0x16, 0x04, 0x28, 0xaf, 0xd7, 0xfb, 0xca, 0xbb, 0x4b, 0x40, 0x7e, -}; - -#define XXH3_INIT_ACC \ - { \ - XXH_PRIME32_3, XXH_PRIME64_1, XXH_PRIME64_2, XXH_PRIME64_3, XXH_PRIME64_4, \ - XXH_PRIME32_2, XXH_PRIME64_5, XXH_PRIME32_1 \ - } - -struct XXH3_state_s { - XXH_ALIGN_MEMBER(64, XXH64_hash_t acc[8]); - /*!< The 8 accumulators. Similar to `vN` in @ref XXH32_state_s::v1 and @ref - * XXH64_state_s */ - XXH_ALIGN_MEMBER(64, unsigned char customSecret[XXH3_SECRET_DEFAULT_SIZE]); - /*!< Used to store a custom secret generated from a seed. */ - XXH_ALIGN_MEMBER(64, unsigned char buffer[XXH3_INTERNALBUFFER_SIZE]); - /*!< The internal buffer. @see XXH32_state_s::mem32 */ - XXH32_hash_t bufferedSize; - /*!< The amount of memory in @ref buffer, @see XXH32_state_s::memsize */ - XXH32_hash_t reserved32; - /*!< Reserved field. Needed for padding on 64-bit. */ - size_t nbStripesSoFar; - /*!< Number or stripes processed. */ - XXH64_hash_t totalLen; - /*!< Total length hashed. 64-bit even on 32-bit targets. */ - size_t nbStripesPerBlock; - /*!< Number of stripes per block. */ - size_t secretLimit; - /*!< Size of @ref customSecret or @ref extSecret */ - XXH64_hash_t seed; - /*!< Seed for _withSeed variants. Must be zero otherwise, @see - * XXH3_INITSTATE() */ - XXH64_hash_t reserved64; - /*!< Reserved field. */ - const unsigned char* extSecret; - /*!< Reference to an external secret for the _withSecret variants, NULL - * for other variants. */ - /* note: there may be some padding at the end due to alignment on 64 bytes */ -}; /* typedef'd to XXH3_state_t */ - -typedef struct XXH3_state_s XXH3_state_t; - -static xxh_u64 XXH64_avalanche(xxh_u64 h64) { - h64 ^= h64 >> 33; - h64 *= XXH_PRIME64_2; - h64 ^= h64 >> 29; - h64 *= XXH_PRIME64_3; - h64 ^= h64 >> 32; - return h64; -} - -static xxh_u64 XXH3_mul128_fold64(xxh_u64 lhs, xxh_u64 rhs) { - XXH128_hash_t product = XXH_mult64to128(lhs, rhs); - return product.low64 ^ product.high64; -} - -inline xxh_u64 XXH3_mix16B( - const xxh_u8* XXH_RESTRICT input, - const xxh_u8* XXH_RESTRICT secret, - xxh_u64 seed64 -) { - xxh_u64 const input_lo = XXH_readLE64(input); - xxh_u64 const input_hi = XXH_readLE64(input + 8); - return XXH3_mul128_fold64(input_lo ^ (XXH_readLE64(secret) + seed64), - input_hi ^ (XXH_readLE64(secret + 8) - seed64)); -} - -static void XXH3_reset_internal( - XXH3_state_t* statePtr, XXH64_hash_t seed, - const void* secret, size_t secretSize -) { - size_t const initStart = offsetof(XXH3_state_t, bufferedSize); - size_t const initLength = offsetof(XXH3_state_t, nbStripesPerBlock) - initStart; - XXH_ASSERT(offsetof(XXH3_state_t, nbStripesPerBlock) > initStart); - XXH_ASSERT(statePtr != NULL); - /* set members from bufferedSize to nbStripesPerBlock (excluded) to 0 */ - memset((char*)statePtr + initStart, 0, initLength); - statePtr->acc[0] = XXH_PRIME32_3; - statePtr->acc[1] = XXH_PRIME64_1; - statePtr->acc[2] = XXH_PRIME64_2; - statePtr->acc[3] = XXH_PRIME64_3; - statePtr->acc[4] = XXH_PRIME64_4; - statePtr->acc[5] = XXH_PRIME32_2; - statePtr->acc[6] = XXH_PRIME64_5; - statePtr->acc[7] = XXH_PRIME32_1; - statePtr->seed = seed; - statePtr->extSecret = (const unsigned char*)secret; - XXH_ASSERT(secretSize >= XXH3_SECRET_SIZE_MIN); - statePtr->secretLimit = secretSize - XXH_STRIPE_LEN; - statePtr->nbStripesPerBlock = statePtr->secretLimit / XXH_SECRET_CONSUME_RATE; -} - -static void XXH3_64bits_reset(XXH3_state_t* statePtr) { - XXH3_reset_internal(statePtr, 0, XXH3_kSecret, XXH_SECRET_DEFAULT_SIZE); -} - -static void XXH3_initCustomSecret_scalar( - void* XXH_RESTRICT customSecret, xxh_u64 seed64 -) { - const xxh_u8* kSecretPtr = XXH3_kSecret; - XXH_STATIC_ASSERT((XXH_SECRET_DEFAULT_SIZE & 15) == 0); - - XXH_ASSERT(kSecretPtr == XXH3_kSecret); - - int const nbRounds = XXH_SECRET_DEFAULT_SIZE / 16; - for (int i = 0; i < nbRounds; i++) { - /* - * The asm hack causes Clang to assume that kSecretPtr aliases with - * customSecret, and on aarch64, this prevented LDP from merging two - * loads together for free. Putting the loads together before the stores - * properly generates LDP. - */ - xxh_u64 lo = XXH_readLE64(kSecretPtr + 16 * i) + seed64; - xxh_u64 hi = XXH_readLE64(kSecretPtr + 16 * i + 8) - seed64; - XXH_writeLE64((xxh_u8*)customSecret + 16 * i, lo); - XXH_writeLE64((xxh_u8*)customSecret + 16 * i + 8, hi); - } -} - -static void XXH3_64bits_reset_withSeed( - XXH3_state_t* statePtr, XXH64_hash_t seed -) { - if (seed == 0) return XXH3_64bits_reset(statePtr); - if (seed != statePtr->seed) - XXH3_initCustomSecret_scalar(statePtr->customSecret, seed); - XXH3_reset_internal(statePtr, seed, NULL, XXH_SECRET_DEFAULT_SIZE); -} - -void XXH3_accumulate_512_scalar( - void* XXH_RESTRICT acc, - const void* XXH_RESTRICT input, - const void* XXH_RESTRICT secret -) { - XXH_ALIGN(XXH_ACC_ALIGN) - xxh_u64* const xacc = (xxh_u64*)acc; /* presumed aligned */ - const xxh_u8* const xinput = (const xxh_u8*)input; /* no alignment restriction */ - const xxh_u8* const xsecret = (const xxh_u8*)secret; /* no alignment restriction */ - XXH_ASSERT(((size_t)acc & (XXH_ACC_ALIGN - 1)) == 0); - for (size_t i = 0; i < XXH_ACC_NB; i++) { - xxh_u64 const data_val = XXH_readLE64(xinput + 8 * i); - xxh_u64 const data_key = data_val ^ XXH_readLE64(xsecret + i * 8); - xacc[i ^ 1] += data_val; /* swap adjacent lanes */ - xacc[i] += XXH_mult32to64(data_key & 0xFFFFFFFF, data_key >> 32); - } -} - -void XXH3_scrambleAcc_scalar( - void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret -) { - XXH_ALIGN(XXH_ACC_ALIGN) - xxh_u64* const xacc = (xxh_u64*)acc; /* presumed aligned */ - const xxh_u8* const xsecret = (const xxh_u8*)secret; /* no alignment restriction */ - XXH_ASSERT((((size_t)acc) & (XXH_ACC_ALIGN - 1)) == 0); - for (size_t i = 0; i < XXH_ACC_NB; i++) { - xxh_u64 const key64 = XXH_readLE64(xsecret + 8 * i); - xxh_u64 acc64 = xacc[i]; - acc64 = XXH_xorshift64(acc64, 47); - acc64 ^= key64; - acc64 *= XXH_PRIME32_1; - xacc[i] = acc64; - } -} - -/* - * XXH3_accumulate() - * Loops over XXH3_accumulate_512(). - * Assumption: nbStripes will not overflow the secret size - */ -void XXH3_accumulate( - xxh_u64* XXH_RESTRICT acc, - const xxh_u8* XXH_RESTRICT input, - const xxh_u8* XXH_RESTRICT secret, size_t nbStripes -) { - for (size_t n = 0; n < nbStripes; n++) { - const xxh_u8* const in = input + n * XXH_STRIPE_LEN; - XXH_PREFETCH(in + XXH_PREFETCH_DIST); - XXH3_accumulate_512_scalar(acc, in, secret + n * XXH_SECRET_CONSUME_RATE); - } -} - -/* Note : when XXH3_consumeStripes() is invoked, - * there must be a guarantee that at least one more byte must be consumed from - * input - * so that the function can blindly consume all stripes using the "normal" - * secret segment */ -void XXH3_consumeStripes( - xxh_u64* XXH_RESTRICT acc, - size_t* XXH_RESTRICT nbStripesSoFarPtr, - size_t nbStripesPerBlock, - const xxh_u8* XXH_RESTRICT input, - size_t nbStripes, - const xxh_u8* XXH_RESTRICT secret, - size_t secretLimit -) { - XXH_ASSERT(nbStripes <= nbStripesPerBlock); /* can handle max 1 scramble per invocation */ - XXH_ASSERT(*nbStripesSoFarPtr < nbStripesPerBlock); - if (nbStripesPerBlock - *nbStripesSoFarPtr <= nbStripes) { - /* need a scrambling operation */ - size_t const nbStripesToEndofBlock = nbStripesPerBlock - *nbStripesSoFarPtr; - size_t const nbStripesAfterBlock = nbStripes - nbStripesToEndofBlock; - XXH3_accumulate( - acc, - input, - secret + nbStripesSoFarPtr[0] * XXH_SECRET_CONSUME_RATE, - nbStripesToEndofBlock - ); - XXH3_scrambleAcc_scalar(acc, secret + secretLimit); - XXH3_accumulate( - acc, - input + nbStripesToEndofBlock * XXH_STRIPE_LEN, - secret, - nbStripesAfterBlock - ); - *nbStripesSoFarPtr = nbStripesAfterBlock; - } else { - XXH3_accumulate( - acc, - input, - secret + nbStripesSoFarPtr[0] * XXH_SECRET_CONSUME_RATE, - nbStripes - ); - *nbStripesSoFarPtr += nbStripes; - } -} - -void XXH3_update(XXH3_state_t* state, const xxh_u8* input, size_t len) { - { - const xxh_u8* const bEnd = input + len; - const unsigned char* const secret = - (state->extSecret == NULL) ? state->customSecret : state->extSecret; - - state->totalLen += len; - XXH_ASSERT(state->bufferedSize <= XXH3_INTERNALBUFFER_SIZE); - - if (state->bufferedSize + len <= XXH3_INTERNALBUFFER_SIZE) { /* fill in tmp buffer */ - memcpy2(state->buffer + state->bufferedSize, input, len); - state->bufferedSize += (XXH32_hash_t)len; - return; - } - /* total input is now > XXH3_INTERNALBUFFER_SIZE */ - -#define XXH3_INTERNALBUFFER_STRIPES (XXH3_INTERNALBUFFER_SIZE / XXH_STRIPE_LEN) - XXH_STATIC_ASSERT(XXH3_INTERNALBUFFER_SIZE % XXH_STRIPE_LEN == - 0); /* clean multiple */ - - /* - * Internal buffer is partially filled (always, except at beginning) - * Complete it, then consume it. - */ - if (state->bufferedSize) { - size_t const loadSize = XXH3_INTERNALBUFFER_SIZE - state->bufferedSize; - memcpy2(state->buffer + state->bufferedSize, input, loadSize); - input += loadSize; - XXH3_consumeStripes(state->acc, &state->nbStripesSoFar, - state->nbStripesPerBlock, state->buffer, - XXH3_INTERNALBUFFER_STRIPES, secret, - state->secretLimit); - state->bufferedSize = 0; - } - XXH_ASSERT(input < bEnd); - - /* Consume input by a multiple of internal buffer size */ - if (input + XXH3_INTERNALBUFFER_SIZE < bEnd) { - const xxh_u8* const limit = bEnd - XXH3_INTERNALBUFFER_SIZE; - do { - XXH3_consumeStripes( - state->acc, &state->nbStripesSoFar, state->nbStripesPerBlock, input, - XXH3_INTERNALBUFFER_STRIPES, secret, state->secretLimit); - input += XXH3_INTERNALBUFFER_SIZE; - } while (input < limit); - /* for last partial stripe */ - memcpy64(state->buffer + sizeof(state->buffer) - XXH_STRIPE_LEN, - input - XXH_STRIPE_LEN); - } - XXH_ASSERT(input < bEnd); - - /* Some remaining input (always) : buffer it */ - memcpy2(state->buffer, input, (size_t)(bEnd - input)); - state->bufferedSize = (XXH32_hash_t)(bEnd - input); - } - - return; -} - -void XXH3_64bits_update(XXH3_state_t* state, const void* input, size_t len) { - XXH3_update(state, (const xxh_u8*)input, len); -} - -xxh_u64 XXH3_mix2Accs( - const xxh_u64* XXH_RESTRICT acc, - const xxh_u8* XXH_RESTRICT secret -) { - return XXH3_mul128_fold64( - acc[0] ^ XXH_readLE64(secret), - acc[1] ^ XXH_readLE64(secret + 8) - ); -} - -/* - * This is a fast avalanche stage, - * suitable when input bits are already partially mixed - */ -XXH64_hash_t XXH3_avalanche(xxh_u64 h64) { - h64 = XXH_xorshift64(h64, 37); - h64 *= 0x165667919E3779F9ULL; - h64 = XXH_xorshift64(h64, 32); - return h64; -} - -XXH64_hash_t XXH3_mergeAccs( - const xxh_u64* XXH_RESTRICT acc, - const xxh_u8* XXH_RESTRICT secret, - xxh_u64 start -) { - xxh_u64 result64 = start; - - for (size_t i = 0; i < 4; i++) { - result64 += XXH3_mix2Accs(acc + 2 * i, secret + 16 * i); - } - - return XXH3_avalanche(result64); -} - -void XXH3_digest_long( - XXH64_hash_t* acc, - const XXH3_state_t* state, - const unsigned char* secret -) { - /* - * Digest on a local copy. This way, the state remains unaltered, and it can - * continue ingesting more input afterwards. - */ - memcpy2(acc, state->acc, sizeof(state->acc)); - if (state->bufferedSize >= XXH_STRIPE_LEN) { - size_t const nbStripes = (state->bufferedSize - 1) / XXH_STRIPE_LEN; - size_t nbStripesSoFar = state->nbStripesSoFar; - XXH3_consumeStripes(acc, &nbStripesSoFar, state->nbStripesPerBlock, - state->buffer, nbStripes, secret, state->secretLimit); - /* last stripe */ - XXH3_accumulate_512_scalar( - acc, state->buffer + state->bufferedSize - XXH_STRIPE_LEN, - secret + state->secretLimit - XXH_SECRET_LASTACC_START); - } else { /* bufferedSize < XXH_STRIPE_LEN */ - xxh_u8 lastStripe[XXH_STRIPE_LEN]; - size_t const catchupSize = XXH_STRIPE_LEN - state->bufferedSize; - XXH_ASSERT(state->bufferedSize > 0); /* there is always some input buffered */ - memcpy2(lastStripe, state->buffer + sizeof(state->buffer) - catchupSize, catchupSize); - memcpy2(lastStripe + catchupSize, state->buffer, state->bufferedSize); - XXH3_accumulate_512_scalar( - acc, - lastStripe, - secret + state->secretLimit - XXH_SECRET_LASTACC_START - ); - } -} - -XXH64_hash_t XXH3_len_9to16_64b( - const xxh_u8* input, - size_t len, - const xxh_u8* secret, - XXH64_hash_t seed -) { - XXH_ASSERT(input != NULL); - XXH_ASSERT(secret != NULL); - XXH_ASSERT(8 <= len && len <= 16); - xxh_u64 const bitflip1 = - (XXH_readLE64(secret + 24) ^ XXH_readLE64(secret + 32)) + seed; - xxh_u64 const bitflip2 = - (XXH_readLE64(secret + 40) ^ XXH_readLE64(secret + 48)) - seed; - xxh_u64 const input_lo = XXH_readLE64(input) ^ bitflip1; - xxh_u64 const input_hi = XXH_readLE64(input + len - 8) ^ bitflip2; - xxh_u64 const acc = - len + XXH_swap64(input_lo) + input_hi + XXH3_mul128_fold64(input_lo, input_hi); - return XXH3_avalanche(acc); -} - -XXH64_hash_t XXH3_len_4to8_64b( - const xxh_u8* input, - size_t len, - const xxh_u8* secret, - XXH64_hash_t seed -) { - XXH_ASSERT(input != NULL); - XXH_ASSERT(secret != NULL); - XXH_ASSERT(4 <= len && len <= 8); - seed ^= (xxh_u64)XXH_swap32((xxh_u32)seed) << 32; - xxh_u32 const input1 = XXH_readLE32(input); - xxh_u32 const input2 = XXH_readLE32(input + len - 4); - xxh_u64 const bitflip = - (XXH_readLE64(secret + 8) ^ XXH_readLE64(secret + 16)) - seed; - xxh_u64 const input64 = input2 + (((xxh_u64)input1) << 32); - xxh_u64 const keyed = input64 ^ bitflip; - return XXH3_rrmxmx(keyed, len); -} - -XXH64_hash_t XXH3_len_1to3_64b( - const xxh_u8* input, - size_t len, - const xxh_u8* secret, - XXH64_hash_t seed -) { - XXH_ASSERT(input != NULL); - XXH_ASSERT(1 <= len && len <= 3); - XXH_ASSERT(secret != NULL); - /* - * len = 1: combined = { input[0], 0x01, input[0], input[0] } - * len = 2: combined = { input[1], 0x02, input[0], input[1] } - * len = 3: combined = { input[2], 0x03, input[0], input[1] } - */ - xxh_u8 const c1 = input[0]; - xxh_u8 const c2 = input[len >> 1]; - xxh_u8 const c3 = input[len - 1]; - xxh_u32 const combined = ((xxh_u32)c1 << 16) | ((xxh_u32)c2 << 24) | - ((xxh_u32)c3 << 0) | ((xxh_u32)len << 8); - xxh_u64 const bitflip = - (XXH_readLE32(secret) ^ XXH_readLE32(secret + 4)) + seed; - xxh_u64 const keyed = (xxh_u64)combined ^ bitflip; - return XXH64_avalanche(keyed); -} - -XXH64_hash_t XXH3_len_0to16_64b( - const xxh_u8* input, - size_t len, - const xxh_u8* secret, - XXH64_hash_t seed -) { - XXH_ASSERT(len <= 16); - if (XXH_likely(len > 8)) - return XXH3_len_9to16_64b(input, len, secret, seed); - if (XXH_likely(len >= 4)) - return XXH3_len_4to8_64b(input, len, secret, seed); - if (len) return XXH3_len_1to3_64b(input, len, secret, seed); - return XXH64_avalanche( - seed ^ (XXH_readLE64(secret + 56) ^ XXH_readLE64(secret + 64))); -} - -/* For mid range keys, XXH3 uses a Mum-hash variant. */ -XXH64_hash_t XXH3_len_17to128_64b( - const xxh_u8* XXH_RESTRICT input, - size_t len, - const xxh_u8* XXH_RESTRICT secret, - size_t secretSize, - XXH64_hash_t seed -) { - XXH_ASSERT(secretSize >= XXH3_SECRET_SIZE_MIN); - (void)secretSize; - XXH_ASSERT(16 < len && len <= 128); - - xxh_u64 acc = len * XXH_PRIME64_1; - if (len > 32) { - if (len > 64) { - if (len > 96) { - acc += XXH3_mix16B(input + 48, secret + 96, seed); - acc += XXH3_mix16B(input + len - 64, secret + 112, seed); - } - acc += XXH3_mix16B(input + 32, secret + 64, seed); - acc += XXH3_mix16B(input + len - 48, secret + 80, seed); - } - acc += XXH3_mix16B(input + 16, secret + 32, seed); - acc += XXH3_mix16B(input + len - 32, secret + 48, seed); - } - acc += XXH3_mix16B(input + 0, secret + 0, seed); - acc += XXH3_mix16B(input + len - 16, secret + 16, seed); - - return XXH3_avalanche(acc); -} - -XXH64_hash_t XXH3_len_129to240_64b( - const xxh_u8* XXH_RESTRICT input, size_t len, - const xxh_u8* XXH_RESTRICT secret, - size_t secretSize, XXH64_hash_t seed -) { - XXH_ASSERT(secretSize >= XXH3_SECRET_SIZE_MIN); - (void)secretSize; - XXH_ASSERT(128 < len && len <= XXH3_MIDSIZE_MAX); - - { - xxh_u64 acc = len * XXH_PRIME64_1; - int const nbRounds = (int)len / 16; - int i; - for (i = 0; i < 8; i++) { - acc += XXH3_mix16B(input + (16 * i), secret + (16 * i), seed); - } - acc = XXH3_avalanche(acc); - XXH_ASSERT(nbRounds >= 8); - for (i = 8; i < nbRounds; i++) { - acc += - XXH3_mix16B(input + (16 * i), - secret + (16 * (i - 8)) + XXH3_MIDSIZE_STARTOFFSET, seed); - } - /* last bytes */ - acc += XXH3_mix16B(input + len - 16, - secret + XXH3_SECRET_SIZE_MIN - XXH3_MIDSIZE_LASTOFFSET, - seed); - return XXH3_avalanche(acc); - } -} - -void XXH3_hashLong_internal_loop( - xxh_u64* XXH_RESTRICT acc, - const xxh_u8* XXH_RESTRICT input, size_t len, - const xxh_u8* XXH_RESTRICT secret, - size_t secretSize -) { - size_t const nbStripesPerBlock = - (secretSize - XXH_STRIPE_LEN) / XXH_SECRET_CONSUME_RATE; - size_t const block_len = XXH_STRIPE_LEN * nbStripesPerBlock; - size_t const nb_blocks = (len - 1) / block_len; - - size_t n; - - XXH_ASSERT(secretSize >= XXH3_SECRET_SIZE_MIN); - - for (n = 0; n < nb_blocks; n++) { - XXH3_accumulate(acc, input + n * block_len, secret, nbStripesPerBlock); - XXH3_scrambleAcc_scalar(acc, secret + secretSize - XXH_STRIPE_LEN); - } - - /* last partial block */ - XXH_ASSERT(len > XXH_STRIPE_LEN); - { - size_t const nbStripes = - ((len - 1) - (block_len * nb_blocks)) / XXH_STRIPE_LEN; - XXH_ASSERT(nbStripes <= (secretSize / XXH_SECRET_CONSUME_RATE)); - XXH3_accumulate(acc, input + nb_blocks * block_len, secret, nbStripes); - - /* last stripe */ - { - const xxh_u8* const p = input + len - XXH_STRIPE_LEN; -#define XXH_SECRET_LASTACC_START \ - 7 /* not aligned on 8, last secret is different from acc & scrambler */ - XXH3_accumulate_512_scalar( - acc, p, - secret + secretSize - XXH_STRIPE_LEN - XXH_SECRET_LASTACC_START); - } - } -} - -XXH64_hash_t XXH3_hashLong_64b_internal( - const void* XXH_RESTRICT input, - size_t len, - const void* XXH_RESTRICT secret, - size_t secretSize -) { - XXH_ALIGN(XXH_ACC_ALIGN) xxh_u64 acc[XXH_ACC_NB] = XXH3_INIT_ACC; - - XXH3_hashLong_internal_loop(acc, (const xxh_u8*)input, len, - (const xxh_u8*)secret, secretSize); - - /* converge into final hash */ - XXH_STATIC_ASSERT(sizeof(acc) == 64); - /* do not align on 8, so that the secret is different from the accumulator */ - XXH_ASSERT(secretSize >= sizeof(acc) + XXH_SECRET_MERGEACCS_START); - return XXH3_mergeAccs(acc, (const xxh_u8*)secret + XXH_SECRET_MERGEACCS_START, (xxh_u64)len * XXH_PRIME64_1); -} - -XXH64_hash_t XXH3_hashLong_64b_withSeed_internal( - const void* input, size_t len, XXH64_hash_t seed -) { - if (seed == 0) - return XXH3_hashLong_64b_internal( - input, len, XXH3_kSecret, sizeof(XXH3_kSecret) - ); - { - XXH_ALIGN(XXH_SEC_ALIGN) xxh_u8 secret[XXH_SECRET_DEFAULT_SIZE]; - XXH3_initCustomSecret_scalar(secret, seed); - return XXH3_hashLong_64b_internal(input, len, secret, sizeof(secret)); - } -} - -/* - * It's important for performance that XXH3_hashLong is not inlined. - */ -XXH64_hash_t XXH3_hashLong_64b_withSeed( - const void* input, size_t len, - XXH64_hash_t seed, const xxh_u8* secret, - size_t secretLen -) { - return XXH3_hashLong_64b_withSeed_internal(input, len, seed); -} - -XXH64_hash_t XXH3_hashLong_64b_withSecret( - const void* XXH_RESTRICT input, - size_t len, XXH64_hash_t seed64, - const xxh_u8* XXH_RESTRICT secret, - size_t secretLen -) { - return XXH3_hashLong_64b_internal(input, len, secret, secretLen); -} - -XXH64_hash_t XXH3_64bits_internal( - const void* XXH_RESTRICT input, size_t len, - XXH64_hash_t seed64, - const void* XXH_RESTRICT secret, - size_t secretLen, - XXH3_hashLong64_f f_hashLong -) { - XXH_ASSERT(secretLen >= XXH3_SECRET_SIZE_MIN); - /* - * If an action is to be taken if `secretLen` condition is not respected, - * it should be done here. - * For now, it's a contract pre-condition. - * Adding a check and a branch here would cost performance at every hash. - * Also, note that function signature doesn't offer room to return an error. - */ - if (len <= 16) - return XXH3_len_0to16_64b( - (const xxh_u8*)input, len, (const xxh_u8*)secret, seed64 - ); - if (len <= 128) - return XXH3_len_17to128_64b( - (const xxh_u8*)input, len, (const xxh_u8*)secret, secretLen, seed64 - ); - if (len <= XXH3_MIDSIZE_MAX) - return XXH3_len_129to240_64b( - (const xxh_u8*)input, len, (const xxh_u8*)secret, secretLen, seed64 - ); - return f_hashLong(input, len, seed64, (const xxh_u8*)secret, secretLen); -} - -XXH64_hash_t XXH3_64bits_withSeed( - const void* input, size_t len, XXH64_hash_t seed -) { - return XXH3_64bits_internal(input, len, seed, XXH3_kSecret, sizeof(XXH3_kSecret), XXH3_hashLong_64b_withSeed); -} - -XXH64_hash_t XXH3_64bits_withSecret( - const void* input, size_t len, const void* secret, size_t secretSize -) { - return XXH3_64bits_internal(input, len, 0, secret, secretSize, XXH3_hashLong_64b_withSecret); -} - -XXH64_hash_t XXH3_64bits_digest(const XXH3_state_t* state) { - const unsigned char* const secret = - (state->extSecret == NULL) ? state->customSecret : state->extSecret; - if (state->totalLen > XXH3_MIDSIZE_MAX) { - XXH_ALIGN(XXH_ACC_ALIGN) XXH64_hash_t acc[XXH_ACC_NB]; - XXH3_digest_long(acc, state, secret); - return XXH3_mergeAccs( - acc, secret + XXH_SECRET_MERGEACCS_START, - (xxh_u64)state->totalLen * XXH_PRIME64_1 - ); - } - /* totalLen <= XXH3_MIDSIZE_MAX: digesting a short input */ - if (state->seed) - return XXH3_64bits_withSeed( - state->buffer, (size_t)state->totalLen, state->seed - ); - return XXH3_64bits_withSecret( - state->buffer, (size_t)(state->totalLen), - secret, state->secretLimit + XXH_STRIPE_LEN - ); -} - -static struct XXH3_state_s sctx; -XXH3_state_t* state = &sctx; - -WASM_EXPORT -void Hash_Init() { - // seed is at the memory object - uint64_t seed = *((uint64_t*)main_buffer); - XXH3_64bits_reset_withSeed(state, seed); -} - -WASM_EXPORT -void Hash_Update(uint32_t length) { - const void* input = main_buffer; - XXH3_64bits_update(state, input, length); -} - -WASM_EXPORT -void Hash_Final() { - XXH64_hash_t const result = XXH_swap64(XXH3_64bits_digest(state)); - memcpy64(main_buffer, &result); -} - -WASM_EXPORT -const uint32_t STATE_SIZE = sizeof(sctx); - -WASM_EXPORT -uint8_t* Hash_GetState() { - return (uint8_t*)&sctx; -} - -WASM_EXPORT -void Hash_Calculate() { - return; -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/src/xxhash32.c b/tools/mnemonic-test/node_modules/hash-wasm/src/xxhash32.c deleted file mode 100644 index 2506ffcf..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/src/xxhash32.c +++ /dev/null @@ -1,183 +0,0 @@ -// ////////////////////////////////////////////////////////// -// xxhash32.h -// Copyright (c) 2016 Stephan Brumme. All rights reserved. -// see http://create.stephan-brumme.com/disclaimer.html -// -// XXHash (32 bit), based on Yann Collet's descriptions, see -// http://cyan4973.github.io/xxHash/ -// -// Modified for hash-wasm by Dani Biró -// - -#define WITH_BUFFER -#include "hash-wasm.h" -#define bswap32 __builtin_bswap32 - -static const uint32_t Prime1 = 2654435761U; -static const uint32_t Prime2 = 2246822519U; -static const uint32_t Prime3 = 3266489917U; -static const uint32_t Prime4 = 668265263U; -static const uint32_t Prime5 = 374761393U; - -// temporarily store up to 15 bytes between multiple add() calls -#define MAX_BUFFER_SIZE (15 + 1) - -// internal state and temporary buffer -struct XXHash32_CTX { - uint32_t state[4]; // state[2] == seed if totalLength < MAX_BUFFER_SIZE - unsigned char buffer[MAX_BUFFER_SIZE]; - unsigned int bufferSize; - uint64_t totalLength; -}; - -static struct XXHash32_CTX sctx; - -// rotate bits, should compile to a single CPU instruction (ROL) -static inline uint32_t rotateLeft(uint32_t x, unsigned char bits) { - return (x << bits) | (x >> (32 - bits)); -} - -// process a block of 4x4 bytes, this is the main part of the XXHash32 -// algorithm -static inline void process( - const void* data, uint32_t* state0, uint32_t* state1, - uint32_t* state2, uint32_t* state3 -) { - const uint32_t* block = (const uint32_t*)data; - *state0 = rotateLeft(*state0 + block[0] * Prime2, 13) * Prime1; - *state1 = rotateLeft(*state1 + block[1] * Prime2, 13) * Prime1; - *state2 = rotateLeft(*state2 + block[2] * Prime2, 13) * Prime1; - *state3 = rotateLeft(*state3 + block[3] * Prime2, 13) * Prime1; -} - -// create new XXHash (32 bit) -/** @param seed your seed value, even zero is a valid seed and e.g. used by LZ4 - * **/ -WASM_EXPORT -void Hash_Init(uint32_t seed) { - sctx.state[0] = seed + Prime1 + Prime2; - sctx.state[1] = seed + Prime2; - sctx.state[2] = seed; - sctx.state[3] = seed - Prime1; - sctx.bufferSize = 0; - sctx.totalLength = 0; -} - -// add a chunk of bytes -/** @param length number of bytes - @return false if parameters are invalid / zero **/ - -WASM_EXPORT -void Hash_Update(uint32_t length) { - const void* input = main_buffer; - - // no data ? - if (!input || length == 0) return; - - sctx.totalLength += length; - // byte-wise access - const unsigned char* data = (const unsigned char*)input; - - // unprocessed old data plus new data still fit in temporary buffer ? - if (sctx.bufferSize + length < MAX_BUFFER_SIZE) { - // just add new data - while (length-- > 0) { - sctx.buffer[sctx.bufferSize++] = *data++; - } - return; - } - - // point beyond last byte - const unsigned char* stop = data + length; - const unsigned char* stopBlock = stop - MAX_BUFFER_SIZE; - - // some data left from previous update ? - if (sctx.bufferSize > 0) { - // make sure temporary buffer is full (16 bytes) - while (sctx.bufferSize < MAX_BUFFER_SIZE) { - sctx.buffer[sctx.bufferSize++] = *data++; - } - - // process these 16 bytes (4x4) - process(sctx.buffer, &sctx.state[0], &sctx.state[1], &sctx.state[2], &sctx.state[3]); - } - - // copying state to local variables helps optimizer A LOT - uint32_t s0 = sctx.state[0], s1 = sctx.state[1], s2 = sctx.state[2], s3 = sctx.state[3]; - // 16 bytes at once - while (data <= stopBlock) { - // local variables s0..s3 instead of state[0]..state[3] are much faster - process(data, &s0, &s1, &s2, &s3); - data += 16; - } - // copy back - sctx.state[0] = s0; - sctx.state[1] = s1; - sctx.state[2] = s2; - sctx.state[3] = s3; - - // copy remainder to temporary buffer - sctx.bufferSize = stop - data; - for (unsigned int i = 0; i < sctx.bufferSize; i++) { - sctx.buffer[i] = data[i]; - } -} - -// get current hash -/** @return 32 bit XXHash **/ -WASM_EXPORT -void Hash_Final() { - uint32_t result = (uint32_t)sctx.totalLength; - - // fold 128 bit state into one single 32 bit value - if (sctx.totalLength >= MAX_BUFFER_SIZE) { - result += rotateLeft(sctx.state[0], 1) + - rotateLeft(sctx.state[1], 7) + - rotateLeft(sctx.state[2], 12) + - rotateLeft(sctx.state[3], 18); - } else { - // internal state wasn't set in add(), therefore original seed is still - // stored in state2 - result += sctx.state[2] + Prime5; - } - - // process remaining bytes in temporary buffer - const unsigned char* data = sctx.buffer; - // point beyond last byte - const unsigned char* stop = data + sctx.bufferSize; - - // at least 4 bytes left ? => eat 4 bytes per step - for (; data + 4 <= stop; data += 4) { - result = rotateLeft(result + *(uint32_t*)data * Prime3, 17) * Prime4; - } - - // take care of remaining 0..3 bytes, eat 1 byte per step - while (data != stop) { - result = rotateLeft(result + (*data++) * Prime5, 11) * Prime1; - } - - // mix bits - result ^= result >> 15; - result *= Prime2; - result ^= result >> 13; - result *= Prime3; - result ^= result >> 16; - - result = bswap32(result); - memcpy32(main_buffer, &result); -} - -WASM_EXPORT -const uint32_t STATE_SIZE = sizeof(sctx); - -WASM_EXPORT -uint8_t* Hash_GetState() { - return (uint8_t*) &sctx; -} - -WASM_EXPORT -void Hash_Calculate(uint32_t length, uint32_t initParam) { - Hash_Init(initParam); - Hash_Update(length); - Hash_Final(); -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/src/xxhash64.c b/tools/mnemonic-test/node_modules/hash-wasm/src/xxhash64.c deleted file mode 100644 index 59a767dc..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/src/xxhash64.c +++ /dev/null @@ -1,199 +0,0 @@ -// ////////////////////////////////////////////////////////// -// xxhash64.h -// Copyright (c) 2016 Stephan Brumme. All rights reserved. -// see http://create.stephan-brumme.com/disclaimer.html -// -// XXHash (64 bit), based on Yann Collet's descriptions, see -// http://cyan4973.github.io/xxHash/ -// -// Modified for hash-wasm by Dani Biró -// - -#define WITH_BUFFER -#include "hash-wasm.h" -#define bswap64 __builtin_bswap64 - -const uint64_t Prime1 = 11400714785074694791ULL; -const uint64_t Prime2 = 14029467366897019727ULL; -const uint64_t Prime3 = 1609587929392839161ULL; -const uint64_t Prime4 = 9650029242287828579ULL; -const uint64_t Prime5 = 2870177450012600261ULL; - -// temporarily store up to 31 bytes between multiple add() calls -#define MAX_BUFFER_SIZE (31 + 1) - -struct XXHash64_CTX { - uint64_t state[4]; - unsigned char buffer[MAX_BUFFER_SIZE]; - unsigned int bufferSize; - uint64_t totalLength; -}; - -static struct XXHash64_CTX sctx; - -// rotate bits, should compile to a single CPU instruction (ROL) -static inline uint64_t rotateLeft(uint64_t x, unsigned char bits) { - return (x << bits) | (x >> (64 - bits)); -} - -// process a single 64 bit value -static inline uint64_t processSingle(uint64_t previous, uint64_t input) { - return rotateLeft(previous + input * Prime2, 31) * Prime1; -} - -// process a block of 4x4 bytes, this is the main part of the XXHash32 -// algorithm -static inline void process( - const void* data, uint64_t* state0, uint64_t* state1, - uint64_t* state2, uint64_t* state3 -) { - const uint64_t* block = (const uint64_t*)data; - *state0 = processSingle(*state0, block[0]); - *state1 = processSingle(*state1, block[1]); - *state2 = processSingle(*state2, block[2]); - *state3 = processSingle(*state3, block[3]); -} - -WASM_EXPORT -void Hash_Init() { - // seed is at the memory object - uint64_t seed = *((uint64_t*)main_buffer); - - sctx.state[0] = seed + Prime1 + Prime2; - sctx.state[1] = seed + Prime2; - sctx.state[2] = seed; - sctx.state[3] = seed - Prime1; - sctx.bufferSize = 0; - sctx.totalLength = 0; -} - -// add a chunk of bytes -/** @param length number of bytes - @return false if parameters are invalid / zero **/ - -WASM_EXPORT -void Hash_Update(uint32_t length) { - const void* input = main_buffer; - - // no data ? - if (length == 0) return; - - sctx.totalLength += length; - // byte-wise access - const unsigned char* data = (const unsigned char*)input; - - // unprocessed old data plus new data still fit in temporary buffer ? - if (sctx.bufferSize + length < MAX_BUFFER_SIZE) { - // just add new data - while (length-- > 0) { - sctx.buffer[sctx.bufferSize++] = *data++; - } - - return; - } - - // point beyond last byte - const unsigned char* stop = data + length; - const unsigned char* stopBlock = stop - MAX_BUFFER_SIZE; - - // some data left from previous update ? - if (sctx.bufferSize > 0) { - // make sure temporary buffer is full (16 bytes) - while (sctx.bufferSize < MAX_BUFFER_SIZE) { - sctx.buffer[sctx.bufferSize++] = *data++; - } - - // process these 32 bytes (4x8) - process(sctx.buffer, &sctx.state[0], &sctx.state[1], &sctx.state[2], &sctx.state[3]); - } - - // copying state to local variables helps optimizer A LOT - uint64_t s0 = sctx.state[0], s1 = sctx.state[1], s2 = sctx.state[2], s3 = sctx.state[3]; - // 32 bytes at once - while (data <= stopBlock) { - // local variables s0..s3 instead of state[0]..state[3] are much faster - process(data, &s0, &s1, &s2, &s3); - data += 32; - } - // copy back - sctx.state[0] = s0; - sctx.state[1] = s1; - sctx.state[2] = s2; - sctx.state[3] = s3; - - // copy remainder to temporary buffer - sctx.bufferSize = stop - data; - for (unsigned int i = 0; i < sctx.bufferSize; i++) { - sctx.buffer[i] = data[i]; - } - - return; -} - -/// get current hash -WASM_EXPORT -void Hash_Final() { - // fold 256 bit state into one single 64 bit value - uint64_t result; - if (sctx.totalLength >= MAX_BUFFER_SIZE) { - result = rotateLeft(sctx.state[0], 1) + rotateLeft(sctx.state[1], 7) + - rotateLeft(sctx.state[2], 12) + rotateLeft(sctx.state[3], 18); - result = (result ^ processSingle(0, sctx.state[0])) * Prime1 + Prime4; - result = (result ^ processSingle(0, sctx.state[1])) * Prime1 + Prime4; - result = (result ^ processSingle(0, sctx.state[2])) * Prime1 + Prime4; - result = (result ^ processSingle(0, sctx.state[3])) * Prime1 + Prime4; - } else { - // internal state wasn't set in add(), therefore original seed is still - // stored in state2 - result = sctx.state[2] + Prime5; - } - - result += sctx.totalLength; - - // process remaining bytes in temporary buffer - const unsigned char* data = sctx.buffer; - // point beyond last byte - const unsigned char* stop = data + sctx.bufferSize; - - // at least 8 bytes left ? => eat 8 bytes per step - for (; data + 8 <= stop; data += 8) { - result = - rotateLeft(result ^ processSingle(0, *(uint64_t*)data), 27) * Prime1 + - Prime4; - } - - // 4 bytes left ? => eat those - if (data + 4 <= stop) { - result = - rotateLeft(result ^ (*(uint32_t*)data) * Prime1, 23) * Prime2 + Prime3; - data += 4; - } - - // take care of remaining 0..3 bytes, eat 1 byte per step - while (data != stop) { - result = rotateLeft(result ^ (*data++) * Prime5, 11) * Prime1; - } - - // mix bits - result ^= result >> 33; - result *= Prime2; - result ^= result >> 29; - result *= Prime3; - result ^= result >> 32; - - result = bswap64(result); - memcpy64(main_buffer, &result); -} - -WASM_EXPORT -const uint32_t STATE_SIZE = sizeof(sctx); - -WASM_EXPORT -uint8_t* Hash_GetState() { - return (uint8_t*) &sctx; -} - -WASM_EXPORT -void Hash_Calculate() { - return; -} diff --git a/tools/mnemonic-test/node_modules/hash-wasm/tsconfig.json b/tools/mnemonic-test/node_modules/hash-wasm/tsconfig.json deleted file mode 100644 index c462cad3..00000000 --- a/tools/mnemonic-test/node_modules/hash-wasm/tsconfig.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "compilerOptions": { - "target": "ES6", - "module": "ES6", - "lib": ["es2017", "es7", "es6", "dom"], - "baseUrl": ".", - "strict": false, - "esModuleInterop": true, - "downlevelIteration": true, - "moduleResolution": "node", - "resolveJsonModule": true - }, - "include": [ - "lib", - ] -} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/readonly-date/.editorconfig b/tools/mnemonic-test/node_modules/readonly-date/.editorconfig deleted file mode 100644 index 0f178672..00000000 --- a/tools/mnemonic-test/node_modules/readonly-date/.editorconfig +++ /dev/null @@ -1,9 +0,0 @@ -root = true - -[*] -charset = utf-8 -end_of_line = lf -indent_size = 2 -indent_style = space -insert_final_newline = true -trim_trailing_whitespace = true diff --git a/tools/mnemonic-test/node_modules/readonly-date/LICENSE b/tools/mnemonic-test/node_modules/readonly-date/LICENSE deleted file mode 100644 index a8508656..00000000 --- a/tools/mnemonic-test/node_modules/readonly-date/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ -Apache License -Version 2.0, January 2004 -http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - -"License" shall mean the terms and conditions for use, reproduction, -and distribution as defined by Sections 1 through 9 of this document. - -"Licensor" shall mean the copyright owner or entity authorized by -the copyright owner that is granting the License. - -"Legal Entity" shall mean the union of the acting entity and all -other entities that control, are controlled by, or are under common -control with that entity. For the purposes of this definition, -"control" means (i) the power, direct or indirect, to cause the -direction or management of such entity, whether by contract or -otherwise, or (ii) ownership of fifty percent (50%) or more of the -outstanding shares, or (iii) beneficial ownership of such entity. - -"You" (or "Your") shall mean an individual or Legal Entity -exercising permissions granted by this License. - -"Source" form shall mean the preferred form for making modifications, -including but not limited to software source code, documentation -source, and configuration files. - -"Object" form shall mean any form resulting from mechanical -transformation or translation of a Source form, including but -not limited to compiled object code, generated documentation, -and conversions to other media types. - -"Work" shall mean the work of authorship, whether in Source or -Object form, made available under the License, as indicated by a -copyright notice that is included in or attached to the work -(an example is provided in the Appendix below). - -"Derivative Works" shall mean any work, whether in Source or Object -form, that is based on (or derived from) the Work and for which the -editorial revisions, annotations, elaborations, or other modifications -represent, as a whole, an original work of authorship. For the purposes -of this License, Derivative Works shall not include works that remain -separable from, or merely link (or bind by name) to the interfaces of, -the Work and Derivative Works thereof. - -"Contribution" shall mean any work of authorship, including -the original version of the Work and any modifications or additions -to that Work or Derivative Works thereof, that is intentionally -submitted to Licensor for inclusion in the Work by the copyright owner -or by an individual or Legal Entity authorized to submit on behalf of -the copyright owner. For the purposes of this definition, "submitted" -means any form of electronic, verbal, or written communication sent -to the Licensor or its representatives, including but not limited to -communication on electronic mailing lists, source code control systems, -and issue tracking systems that are managed by, or on behalf of, the -Licensor for the purpose of discussing and improving the Work, but -excluding communication that is conspicuously marked or otherwise -designated in writing by the copyright owner as "Not a Contribution." - -"Contributor" shall mean Licensor and any individual or Legal Entity -on behalf of whom a Contribution has been received by Licensor and -subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of -this License, each Contributor hereby grants to You a perpetual, -worldwide, non-exclusive, no-charge, royalty-free, irrevocable -copyright license to reproduce, prepare Derivative Works of, -publicly display, publicly perform, sublicense, and distribute the -Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of -this License, each Contributor hereby grants to You a perpetual, -worldwide, non-exclusive, no-charge, royalty-free, irrevocable -(except as stated in this section) patent license to make, have made, -use, offer to sell, sell, import, and otherwise transfer the Work, -where such license applies only to those patent claims licensable -by such Contributor that are necessarily infringed by their -Contribution(s) alone or by combination of their Contribution(s) -with the Work to which such Contribution(s) was submitted. If You -institute patent litigation against any entity (including a -cross-claim or counterclaim in a lawsuit) alleging that the Work -or a Contribution incorporated within the Work constitutes direct -or contributory patent infringement, then any patent licenses -granted to You under this License for that Work shall terminate -as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the -Work or Derivative Works thereof in any medium, with or without -modifications, and in Source or Object form, provided that You -meet the following conditions: - -(a) You must give any other recipients of the Work or -Derivative Works a copy of this License; and - -(b) You must cause any modified files to carry prominent notices -stating that You changed the files; and - -(c) You must retain, in the Source form of any Derivative Works -that You distribute, all copyright, patent, trademark, and -attribution notices from the Source form of the Work, -excluding those notices that do not pertain to any part of -the Derivative Works; and - -(d) If the Work includes a "NOTICE" text file as part of its -distribution, then any Derivative Works that You distribute must -include a readable copy of the attribution notices contained -within such NOTICE file, excluding those notices that do not -pertain to any part of the Derivative Works, in at least one -of the following places: within a NOTICE text file distributed -as part of the Derivative Works; within the Source form or -documentation, if provided along with the Derivative Works; or, -within a display generated by the Derivative Works, if and -wherever such third-party notices normally appear. The contents -of the NOTICE file are for informational purposes only and -do not modify the License. You may add Your own attribution -notices within Derivative Works that You distribute, alongside -or as an addendum to the NOTICE text from the Work, provided -that such additional attribution notices cannot be construed -as modifying the License. - -You may add Your own copyright statement to Your modifications and -may provide additional or different license terms and conditions -for use, reproduction, or distribution of Your modifications, or -for any such Derivative Works as a whole, provided Your use, -reproduction, and distribution of the Work otherwise complies with -the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, -any Contribution intentionally submitted for inclusion in the Work -by You to the Licensor shall be under the terms and conditions of -this License, without any additional terms or conditions. -Notwithstanding the above, nothing herein shall supersede or modify -the terms of any separate license agreement you may have executed -with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade -names, trademarks, service marks, or product names of the Licensor, -except as required for reasonable and customary use in describing the -origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or -agreed to in writing, Licensor provides the Work (and each -Contributor provides its Contributions) on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -implied, including, without limitation, any warranties or conditions -of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A -PARTICULAR PURPOSE. You are solely responsible for determining the -appropriateness of using or redistributing the Work and assume any -risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, -whether in tort (including negligence), contract, or otherwise, -unless required by applicable law (such as deliberate and grossly -negligent acts) or agreed to in writing, shall any Contributor be -liable to You for damages, including any direct, indirect, special, -incidental, or consequential damages of any character arising as a -result of this License or out of the use or inability to use the -Work (including but not limited to damages for loss of goodwill, -work stoppage, computer failure or malfunction, or any and all -other commercial damages or losses), even if such Contributor -has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing -the Work or Derivative Works thereof, You may choose to offer, -and charge a fee for, acceptance of support, warranty, indemnity, -or other liability obligations and/or rights consistent with this -License. However, in accepting such obligations, You may act only -on Your own behalf and on Your sole responsibility, not on behalf -of any other Contributor, and only if You agree to indemnify, -defend, and hold each Contributor harmless for any liability -incurred by, or claims asserted against, such Contributor by reason -of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - -To apply the Apache License to your work, attach the following -boilerplate notice, with the fields enclosed by brackets "[]" -replaced with your own identifying information. (Don't include -the brackets!) The text should be enclosed in the appropriate -comment syntax for the file format. We also recommend that a -file or class name and description of purpose be included on the -same "printed page" as the copyright notice for easier -identification within third-party archives. - -Copyright 2018 IOV SAS - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/tools/mnemonic-test/node_modules/readonly-date/NOTICE b/tools/mnemonic-test/node_modules/readonly-date/NOTICE deleted file mode 100644 index 7ba98b33..00000000 --- a/tools/mnemonic-test/node_modules/readonly-date/NOTICE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright 2018 IOV SAS - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/tools/mnemonic-test/node_modules/readonly-date/README.md b/tools/mnemonic-test/node_modules/readonly-date/README.md deleted file mode 100644 index e12cf4c8..00000000 --- a/tools/mnemonic-test/node_modules/readonly-date/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# readonly-date -An immutable drop-in replacement for JavaScript's Date type - -## License -This repository is licensed under the Apache License 2.0 (see NOTICE and LICENSE). diff --git a/tools/mnemonic-test/node_modules/readonly-date/index.d.ts b/tools/mnemonic-test/node_modules/readonly-date/index.d.ts deleted file mode 100644 index e9341597..00000000 --- a/tools/mnemonic-test/node_modules/readonly-date/index.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -/** - * An object like JavaScript's Date, but immutable. - * - * Immutability is enforced at compile time by removing - * all mutable methods in the type definition. - */ -export interface ReadonlyDate { - toString(): string; - toDateString(): string; - toTimeString(): string; - toLocaleString(): string; - toLocaleDateString(): string; - toLocaleTimeString(): string; - valueOf(): number; - getTime(): number; - getFullYear(): number; - getUTCFullYear(): number; - getMonth(): number; - getUTCMonth(): number; - getDate(): number; - getUTCDate(): number; - getDay(): number; - getUTCDay(): number; - getHours(): number; - getUTCHours(): number; - getMinutes(): number; - getUTCMinutes(): number; - getSeconds(): number; - getUTCSeconds(): number; - getMilliseconds(): number; - getUTCMilliseconds(): number; - getTimezoneOffset(): number; - toUTCString(): string; - toISOString(): string; - toJSON(key?: any): string; - - toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; - toLocaleDateString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; - toLocaleTimeString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; - - [Symbol.toPrimitive](hint: "default"): string; - [Symbol.toPrimitive](hint: "string"): string; - [Symbol.toPrimitive](hint: "number"): number; - [Symbol.toPrimitive](hint: string): string | number; -} - -interface ReadonlyDateConstructor { - new(): ReadonlyDate; - new(value: number | string): ReadonlyDate; - new(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): ReadonlyDate; - (): string; - readonly prototype: Date; - parse(s: string): number; - UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number; - now(): number; -} - -declare const ReadonlyDate: ReadonlyDateConstructor; diff --git a/tools/mnemonic-test/node_modules/readonly-date/index.js b/tools/mnemonic-test/node_modules/readonly-date/index.js deleted file mode 100644 index b8c371e2..00000000 --- a/tools/mnemonic-test/node_modules/readonly-date/index.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - ReadonlyDate: Date, -} diff --git a/tools/mnemonic-test/node_modules/readonly-date/package.json b/tools/mnemonic-test/node_modules/readonly-date/package.json deleted file mode 100644 index 7c1d4523..00000000 --- a/tools/mnemonic-test/node_modules/readonly-date/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "readonly-date", - "version": "1.0.0", - "description": "An immutable drop-in replacement for JavaScript's Date type", - "author": "IOV SAS ", - "license": "Apache-2.0", - "main": "index.js", - "types": "index.d.ts", - "repository": { - "type": "git", - "url": "https://github.com/iov-one/readonly-date" - } -} diff --git a/tools/mnemonic-test/node_modules/tslib/CopyrightNotice.txt b/tools/mnemonic-test/node_modules/tslib/CopyrightNotice.txt deleted file mode 100644 index 5d7d2d9c..00000000 --- a/tools/mnemonic-test/node_modules/tslib/CopyrightNotice.txt +++ /dev/null @@ -1,15 +0,0 @@ -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ - diff --git a/tools/mnemonic-test/node_modules/tslib/LICENSE.txt b/tools/mnemonic-test/node_modules/tslib/LICENSE.txt deleted file mode 100644 index fa7d1bdf..00000000 --- a/tools/mnemonic-test/node_modules/tslib/LICENSE.txt +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/tslib/README.md b/tools/mnemonic-test/node_modules/tslib/README.md deleted file mode 100644 index 14b9a83d..00000000 --- a/tools/mnemonic-test/node_modules/tslib/README.md +++ /dev/null @@ -1,164 +0,0 @@ -# tslib - -This is a runtime library for [TypeScript](https://www.typescriptlang.org/) that contains all of the TypeScript helper functions. - -This library is primarily used by the `--importHelpers` flag in TypeScript. -When using `--importHelpers`, a module that uses helper functions like `__extends` and `__assign` in the following emitted file: - -```ts -var __assign = (this && this.__assign) || Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; -}; -exports.x = {}; -exports.y = __assign({}, exports.x); - -``` - -will instead be emitted as something like the following: - -```ts -var tslib_1 = require("tslib"); -exports.x = {}; -exports.y = tslib_1.__assign({}, exports.x); -``` - -Because this can avoid duplicate declarations of things like `__extends`, `__assign`, etc., this means delivering users smaller files on average, as well as less runtime overhead. -For optimized bundles with TypeScript, you should absolutely consider using `tslib` and `--importHelpers`. - -# Installing - -For the latest stable version, run: - -## npm - -```sh -# TypeScript 3.9.2 or later -npm install tslib - -# TypeScript 3.8.4 or earlier -npm install tslib@^1 - -# TypeScript 2.3.2 or earlier -npm install tslib@1.6.1 -``` - -## yarn - -```sh -# TypeScript 3.9.2 or later -yarn add tslib - -# TypeScript 3.8.4 or earlier -yarn add tslib@^1 - -# TypeScript 2.3.2 or earlier -yarn add tslib@1.6.1 -``` - -## bower - -```sh -# TypeScript 3.9.2 or later -bower install tslib - -# TypeScript 3.8.4 or earlier -bower install tslib@^1 - -# TypeScript 2.3.2 or earlier -bower install tslib@1.6.1 -``` - -## JSPM - -```sh -# TypeScript 3.9.2 or later -jspm install tslib - -# TypeScript 3.8.4 or earlier -jspm install tslib@^1 - -# TypeScript 2.3.2 or earlier -jspm install tslib@1.6.1 -``` - -# Usage - -Set the `importHelpers` compiler option on the command line: - -``` -tsc --importHelpers file.ts -``` - -or in your tsconfig.json: - -```json -{ - "compilerOptions": { - "importHelpers": true - } -} -``` - -#### For bower and JSPM users - -You will need to add a `paths` mapping for `tslib`, e.g. For Bower users: - -```json -{ - "compilerOptions": { - "module": "amd", - "importHelpers": true, - "baseUrl": "./", - "paths": { - "tslib" : ["bower_components/tslib/tslib.d.ts"] - } - } -} -``` - -For JSPM users: - -```json -{ - "compilerOptions": { - "module": "system", - "importHelpers": true, - "baseUrl": "./", - "paths": { - "tslib" : ["jspm_packages/npm/tslib@2.x.y/tslib.d.ts"] - } - } -} -``` - -## Deployment - -- Choose your new version number -- Set it in `package.json` and `bower.json` -- Create a tag: `git tag [version]` -- Push the tag: `git push --tags` -- Create a [release in GitHub](https://github.com/microsoft/tslib/releases) -- Run the [publish to npm](https://github.com/microsoft/tslib/actions?query=workflow%3A%22Publish+to+NPM%22) workflow - -Done. - -# Contribute - -There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript. - -* [Submit bugs](https://github.com/Microsoft/TypeScript/issues) and help us verify fixes as they are checked in. -* Review the [source code changes](https://github.com/Microsoft/TypeScript/pulls). -* Engage with other TypeScript users and developers on [StackOverflow](http://stackoverflow.com/questions/tagged/typescript). -* Join the [#typescript](http://twitter.com/#!/search/realtime/%23typescript) discussion on Twitter. -* [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md). - -# Documentation - -* [Quick tutorial](http://www.typescriptlang.org/Tutorial) -* [Programming handbook](http://www.typescriptlang.org/Handbook) -* [Homepage](http://www.typescriptlang.org/) diff --git a/tools/mnemonic-test/node_modules/tslib/SECURITY.md b/tools/mnemonic-test/node_modules/tslib/SECURITY.md deleted file mode 100644 index 869fdfe2..00000000 --- a/tools/mnemonic-test/node_modules/tslib/SECURITY.md +++ /dev/null @@ -1,41 +0,0 @@ - - -## Security - -Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). - -If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below. - -## Reporting Security Issues - -**Please do not report security vulnerabilities through public GitHub issues.** - -Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report). - -If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey). - -You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). - -Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: - - * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) - * Full paths of source file(s) related to the manifestation of the issue - * The location of the affected source code (tag/branch/commit or direct URL) - * Any special configuration required to reproduce the issue - * Step-by-step instructions to reproduce the issue - * Proof-of-concept or exploit code (if possible) - * Impact of the issue, including how an attacker might exploit the issue - -This information will help us triage your report more quickly. - -If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs. - -## Preferred Languages - -We prefer all communications to be in English. - -## Policy - -Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd). - - diff --git a/tools/mnemonic-test/node_modules/tslib/modules/index.d.ts b/tools/mnemonic-test/node_modules/tslib/modules/index.d.ts deleted file mode 100644 index 0fedae88..00000000 --- a/tools/mnemonic-test/node_modules/tslib/modules/index.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -// Note: named reexports are used instead of `export *` because -// TypeScript itself doesn't resolve the `export *` when checking -// if a particular helper exists. -export { - __extends, - __assign, - __rest, - __decorate, - __param, - __esDecorate, - __runInitializers, - __propKey, - __setFunctionName, - __metadata, - __awaiter, - __generator, - __exportStar, - __values, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, - __classPrivateFieldIn, - __createBinding, - __addDisposableResource, - __disposeResources, -} from '../tslib.js'; -export * as default from '../tslib.js'; diff --git a/tools/mnemonic-test/node_modules/tslib/modules/index.js b/tools/mnemonic-test/node_modules/tslib/modules/index.js deleted file mode 100644 index 0c9dcd5f..00000000 --- a/tools/mnemonic-test/node_modules/tslib/modules/index.js +++ /dev/null @@ -1,68 +0,0 @@ -import tslib from '../tslib.js'; -const { - __extends, - __assign, - __rest, - __decorate, - __param, - __esDecorate, - __runInitializers, - __propKey, - __setFunctionName, - __metadata, - __awaiter, - __generator, - __exportStar, - __createBinding, - __values, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, - __classPrivateFieldIn, - __addDisposableResource, - __disposeResources, -} = tslib; -export { - __extends, - __assign, - __rest, - __decorate, - __param, - __esDecorate, - __runInitializers, - __propKey, - __setFunctionName, - __metadata, - __awaiter, - __generator, - __exportStar, - __createBinding, - __values, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, - __classPrivateFieldIn, - __addDisposableResource, - __disposeResources, -}; -export default tslib; diff --git a/tools/mnemonic-test/node_modules/tslib/modules/package.json b/tools/mnemonic-test/node_modules/tslib/modules/package.json deleted file mode 100644 index 96ae6e57..00000000 --- a/tools/mnemonic-test/node_modules/tslib/modules/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "module" -} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/tslib/package.json b/tools/mnemonic-test/node_modules/tslib/package.json deleted file mode 100644 index a068b42d..00000000 --- a/tools/mnemonic-test/node_modules/tslib/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "tslib", - "author": "Microsoft Corp.", - "homepage": "https://www.typescriptlang.org/", - "version": "2.7.0", - "license": "0BSD", - "description": "Runtime library for TypeScript helper functions", - "keywords": [ - "TypeScript", - "Microsoft", - "compiler", - "language", - "javascript", - "tslib", - "runtime" - ], - "bugs": { - "url": "https://github.com/Microsoft/TypeScript/issues" - }, - "repository": { - "type": "git", - "url": "https://github.com/Microsoft/tslib.git" - }, - "main": "tslib.js", - "module": "tslib.es6.js", - "jsnext:main": "tslib.es6.js", - "typings": "tslib.d.ts", - "sideEffects": false, - "exports": { - ".": { - "module": { - "types": "./modules/index.d.ts", - "default": "./tslib.es6.mjs" - }, - "import": { - "node": "./modules/index.js", - "default": { - "types": "./modules/index.d.ts", - "default": "./tslib.es6.mjs" - } - }, - "default": "./tslib.js" - }, - "./*": "./*", - "./": "./" - } -} diff --git a/tools/mnemonic-test/node_modules/tslib/tslib.d.ts b/tools/mnemonic-test/node_modules/tslib/tslib.d.ts deleted file mode 100644 index 7fdf69c1..00000000 --- a/tools/mnemonic-test/node_modules/tslib/tslib.d.ts +++ /dev/null @@ -1,453 +0,0 @@ -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ - -/** - * Used to shim class extends. - * - * @param d The derived class. - * @param b The base class. - */ -export declare function __extends(d: Function, b: Function): void; - -/** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * - * @param t The target object to copy to. - * @param sources One or more source objects from which to copy properties - */ -export declare function __assign(t: any, ...sources: any[]): any; - -/** - * Performs a rest spread on an object. - * - * @param t The source value. - * @param propertyNames The property names excluded from the rest spread. - */ -export declare function __rest(t: any, propertyNames: (string | symbol)[]): any; - -/** - * Applies decorators to a target object - * - * @param decorators The set of decorators to apply. - * @param target The target object. - * @param key If specified, the own property to apply the decorators to. - * @param desc The property descriptor, defaults to fetching the descriptor from the target object. - * @experimental - */ -export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; - -/** - * Creates an observing function decorator from a parameter decorator. - * - * @param paramIndex The parameter index to apply the decorator to. - * @param decorator The parameter decorator to apply. Note that the return value is ignored. - * @experimental - */ -export declare function __param(paramIndex: number, decorator: Function): Function; - -/** - * Applies decorators to a class or class member, following the native ECMAScript decorator specification. - * @param ctor For non-field class members, the class constructor. Otherwise, `null`. - * @param descriptorIn The `PropertyDescriptor` to use when unable to look up the property from `ctor`. - * @param decorators The decorators to apply - * @param contextIn The `DecoratorContext` to clone for each decorator application. - * @param initializers An array of field initializer mutation functions into which new initializers are written. - * @param extraInitializers An array of extra initializer functions into which new initializers are written. - */ -export declare function __esDecorate(ctor: Function | null, descriptorIn: object | null, decorators: Function[], contextIn: object, initializers: Function[] | null, extraInitializers: Function[]): void; - -/** - * Runs field initializers or extra initializers generated by `__esDecorate`. - * @param thisArg The `this` argument to use. - * @param initializers The array of initializers to evaluate. - * @param value The initial value to pass to the initializers. - */ -export declare function __runInitializers(thisArg: unknown, initializers: Function[], value?: any): any; - -/** - * Converts a computed property name into a `string` or `symbol` value. - */ -export declare function __propKey(x: any): string | symbol; - -/** - * Assigns the name of a function derived from the left-hand side of an assignment. - * @param f The function to rename. - * @param name The new name for the function. - * @param prefix A prefix (such as `"get"` or `"set"`) to insert before the name. - */ -export declare function __setFunctionName(f: Function, name: string | symbol, prefix?: string): Function; - -/** - * Creates a decorator that sets metadata. - * - * @param metadataKey The metadata key - * @param metadataValue The metadata value - * @experimental - */ -export declare function __metadata(metadataKey: any, metadataValue: any): Function; - -/** - * Converts a generator function into a pseudo-async function, by treating each `yield` as an `await`. - * - * @param thisArg The reference to use as the `this` value in the generator function - * @param _arguments The optional arguments array - * @param P The optional promise constructor argument, defaults to the `Promise` property of the global object. - * @param generator The generator function - */ -export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; - -/** - * Creates an Iterator object using the body as the implementation. - * - * @param thisArg The reference to use as the `this` value in the function - * @param body The generator state-machine based implementation. - * - * @see [./docs/generator.md] - */ -export declare function __generator(thisArg: any, body: Function): any; - -/** - * Creates bindings for all enumerable properties of `m` on `exports` - * - * @param m The source object - * @param o The `exports` object. - */ -export declare function __exportStar(m: any, o: any): void; - -/** - * Creates a value iterator from an `Iterable` or `ArrayLike` object. - * - * @param o The object. - * @throws {TypeError} If `o` is neither `Iterable`, nor an `ArrayLike`. - */ -export declare function __values(o: any): any; - -/** - * Reads values from an `Iterable` or `ArrayLike` object and returns the resulting array. - * - * @param o The object to read from. - * @param n The maximum number of arguments to read, defaults to `Infinity`. - */ -export declare function __read(o: any, n?: number): any[]; - -/** - * Creates an array from iterable spread. - * - * @param args The Iterable objects to spread. - * @deprecated since TypeScript 4.2 - Use `__spreadArray` - */ -export declare function __spread(...args: any[][]): any[]; - -/** - * Creates an array from array spread. - * - * @param args The ArrayLikes to spread into the resulting array. - * @deprecated since TypeScript 4.2 - Use `__spreadArray` - */ -export declare function __spreadArrays(...args: any[][]): any[]; - -/** - * Spreads the `from` array into the `to` array. - * - * @param pack Replace empty elements with `undefined`. - */ -export declare function __spreadArray(to: any[], from: any[], pack?: boolean): any[]; - -/** - * Creates an object that signals to `__asyncGenerator` that it shouldn't be yielded, - * and instead should be awaited and the resulting value passed back to the generator. - * - * @param v The value to await. - */ -export declare function __await(v: any): any; - -/** - * Converts a generator function into an async generator function, by using `yield __await` - * in place of normal `await`. - * - * @param thisArg The reference to use as the `this` value in the generator function - * @param _arguments The optional arguments array - * @param generator The generator function - */ -export declare function __asyncGenerator(thisArg: any, _arguments: any, generator: Function): any; - -/** - * Used to wrap a potentially async iterator in such a way so that it wraps the result - * of calling iterator methods of `o` in `__await` instances, and then yields the awaited values. - * - * @param o The potentially async iterator. - * @returns A synchronous iterator yielding `__await` instances on every odd invocation - * and returning the awaited `IteratorResult` passed to `next` every even invocation. - */ -export declare function __asyncDelegator(o: any): any; - -/** - * Creates a value async iterator from an `AsyncIterable`, `Iterable` or `ArrayLike` object. - * - * @param o The object. - * @throws {TypeError} If `o` is neither `AsyncIterable`, `Iterable`, nor an `ArrayLike`. - */ -export declare function __asyncValues(o: any): any; - -/** - * Creates a `TemplateStringsArray` frozen object from the `cooked` and `raw` arrays. - * - * @param cooked The cooked possibly-sparse array. - * @param raw The raw string content. - */ -export declare function __makeTemplateObject(cooked: string[], raw: string[]): TemplateStringsArray; - -/** - * Used to shim default and named imports in ECMAScript Modules transpiled to CommonJS. - * - * ```js - * import Default, { Named, Other } from "mod"; - * // or - * import { default as Default, Named, Other } from "mod"; - * ``` - * - * @param mod The CommonJS module exports object. - */ -export declare function __importStar(mod: T): T; - -/** - * Used to shim default imports in ECMAScript Modules transpiled to CommonJS. - * - * ```js - * import Default from "mod"; - * ``` - * - * @param mod The CommonJS module exports object. - */ -export declare function __importDefault(mod: T): T | { default: T }; - -/** - * Emulates reading a private instance field. - * - * @param receiver The instance from which to read the private field. - * @param state A WeakMap containing the private field value for an instance. - * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. - * - * @throws {TypeError} If `state` doesn't have an entry for `receiver`. - */ -export declare function __classPrivateFieldGet( - receiver: T, - state: { has(o: T): boolean, get(o: T): V | undefined }, - kind?: "f" -): V; - -/** - * Emulates reading a private static field. - * - * @param receiver The object from which to read the private static field. - * @param state The class constructor containing the definition of the static field. - * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. - * @param f The descriptor that holds the static field value. - * - * @throws {TypeError} If `receiver` is not `state`. - */ -export declare function __classPrivateFieldGet unknown, V>( - receiver: T, - state: T, - kind: "f", - f: { value: V } -): V; - -/** - * Emulates evaluating a private instance "get" accessor. - * - * @param receiver The instance on which to evaluate the private "get" accessor. - * @param state A WeakSet used to verify an instance supports the private "get" accessor. - * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. - * @param f The "get" accessor function to evaluate. - * - * @throws {TypeError} If `state` doesn't have an entry for `receiver`. - */ -export declare function __classPrivateFieldGet( - receiver: T, - state: { has(o: T): boolean }, - kind: "a", - f: () => V -): V; - -/** - * Emulates evaluating a private static "get" accessor. - * - * @param receiver The object on which to evaluate the private static "get" accessor. - * @param state The class constructor containing the definition of the static "get" accessor. - * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. - * @param f The "get" accessor function to evaluate. - * - * @throws {TypeError} If `receiver` is not `state`. - */ -export declare function __classPrivateFieldGet unknown, V>( - receiver: T, - state: T, - kind: "a", - f: () => V -): V; - -/** - * Emulates reading a private instance method. - * - * @param receiver The instance from which to read a private method. - * @param state A WeakSet used to verify an instance supports the private method. - * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. - * @param f The function to return as the private instance method. - * - * @throws {TypeError} If `state` doesn't have an entry for `receiver`. - */ -export declare function __classPrivateFieldGet unknown>( - receiver: T, - state: { has(o: T): boolean }, - kind: "m", - f: V -): V; - -/** - * Emulates reading a private static method. - * - * @param receiver The object from which to read the private static method. - * @param state The class constructor containing the definition of the static method. - * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. - * @param f The function to return as the private static method. - * - * @throws {TypeError} If `receiver` is not `state`. - */ -export declare function __classPrivateFieldGet unknown, V extends (...args: any[]) => unknown>( - receiver: T, - state: T, - kind: "m", - f: V -): V; - -/** - * Emulates writing to a private instance field. - * - * @param receiver The instance on which to set a private field value. - * @param state A WeakMap used to store the private field value for an instance. - * @param value The value to store in the private field. - * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. - * - * @throws {TypeError} If `state` doesn't have an entry for `receiver`. - */ -export declare function __classPrivateFieldSet( - receiver: T, - state: { has(o: T): boolean, set(o: T, value: V): unknown }, - value: V, - kind?: "f" -): V; - -/** - * Emulates writing to a private static field. - * - * @param receiver The object on which to set the private static field. - * @param state The class constructor containing the definition of the private static field. - * @param value The value to store in the private field. - * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. - * @param f The descriptor that holds the static field value. - * - * @throws {TypeError} If `receiver` is not `state`. - */ -export declare function __classPrivateFieldSet unknown, V>( - receiver: T, - state: T, - value: V, - kind: "f", - f: { value: V } -): V; - -/** - * Emulates writing to a private instance "set" accessor. - * - * @param receiver The instance on which to evaluate the private instance "set" accessor. - * @param state A WeakSet used to verify an instance supports the private "set" accessor. - * @param value The value to store in the private accessor. - * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. - * @param f The "set" accessor function to evaluate. - * - * @throws {TypeError} If `state` doesn't have an entry for `receiver`. - */ -export declare function __classPrivateFieldSet( - receiver: T, - state: { has(o: T): boolean }, - value: V, - kind: "a", - f: (v: V) => void -): V; - -/** - * Emulates writing to a private static "set" accessor. - * - * @param receiver The object on which to evaluate the private static "set" accessor. - * @param state The class constructor containing the definition of the static "set" accessor. - * @param value The value to store in the private field. - * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method. - * @param f The "set" accessor function to evaluate. - * - * @throws {TypeError} If `receiver` is not `state`. - */ -export declare function __classPrivateFieldSet unknown, V>( - receiver: T, - state: T, - value: V, - kind: "a", - f: (v: V) => void -): V; - -/** - * Checks for the existence of a private field/method/accessor. - * - * @param state The class constructor containing the static member, or the WeakMap or WeakSet associated with a private instance member. - * @param receiver The object for which to test the presence of the private member. - */ -export declare function __classPrivateFieldIn( - state: (new (...args: any[]) => unknown) | { has(o: any): boolean }, - receiver: unknown, -): boolean; - -/** - * Creates a re-export binding on `object` with key `objectKey` that references `target[key]`. - * - * @param object The local `exports` object. - * @param target The object to re-export from. - * @param key The property key of `target` to re-export. - * @param objectKey The property key to re-export as. Defaults to `key`. - */ -export declare function __createBinding(object: object, target: object, key: PropertyKey, objectKey?: PropertyKey): void; - -/** - * Adds a disposable resource to a resource-tracking environment object. - * @param env A resource-tracking environment object. - * @param value Either a Disposable or AsyncDisposable object, `null`, or `undefined`. - * @param async When `true`, `AsyncDisposable` resources can be added. When `false`, `AsyncDisposable` resources cannot be added. - * @returns The {@link value} argument. - * - * @throws {TypeError} If {@link value} is not an object, or if either `Symbol.dispose` or `Symbol.asyncDispose` are not - * defined, or if {@link value} does not have an appropriate `Symbol.dispose` or `Symbol.asyncDispose` method. - */ -export declare function __addDisposableResource(env: { stack: { value?: unknown, dispose?: Function, async: boolean }[]; error: unknown; hasError: boolean; }, value: T, async: boolean): T; - -/** - * Disposes all resources in a resource-tracking environment object. - * @param env A resource-tracking environment object. - * @returns A {@link Promise} if any resources in the environment were marked as `async` when added; otherwise, `void`. - * - * @throws {SuppressedError} if an error thrown during disposal would have suppressed a prior error from disposal or the - * error recorded in the resource-tracking environment object. - * @seealso {@link __addDisposableResource} - */ -export declare function __disposeResources(env: { stack: { value?: unknown, dispose?: Function, async: boolean }[]; error: unknown; hasError: boolean; }): any; diff --git a/tools/mnemonic-test/node_modules/tslib/tslib.es6.html b/tools/mnemonic-test/node_modules/tslib/tslib.es6.html deleted file mode 100644 index b122e41b..00000000 --- a/tools/mnemonic-test/node_modules/tslib/tslib.es6.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/tslib/tslib.es6.js b/tools/mnemonic-test/node_modules/tslib/tslib.es6.js deleted file mode 100644 index 6e2bd871..00000000 --- a/tools/mnemonic-test/node_modules/tslib/tslib.es6.js +++ /dev/null @@ -1,379 +0,0 @@ -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global Reflect, Promise, SuppressedError, Symbol, Iterator */ - -var extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); -}; - -export function __extends(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} - -export var __assign = function() { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - } - return __assign.apply(this, arguments); -} - -export function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; -} - -export function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -} - -export function __param(paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -} - -export function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -}; - -export function __runInitializers(thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; -}; - -export function __propKey(x) { - return typeof x === "symbol" ? x : "".concat(x); -}; - -export function __setFunctionName(f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); -}; - -export function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} - -export function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} - -export function __generator(thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); - return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -} - -export var __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}); - -export function __exportStar(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); -} - -export function __values(o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} - -export function __read(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -} - -/** @deprecated */ -export function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; -} - -/** @deprecated */ -export function __spreadArrays() { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; -} - -export function __spreadArray(to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -} - -export function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); -} - -export function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; - function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } - function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } -} - -export function __asyncDelegator(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } -} - -export function __asyncValues(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } -} - -export function __makeTemplateObject(cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; -}; - -var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}; - -export function __importStar(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -} - -export function __importDefault(mod) { - return (mod && mod.__esModule) ? mod : { default: mod }; -} - -export function __classPrivateFieldGet(receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -} - -export function __classPrivateFieldSet(receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; -} - -export function __classPrivateFieldIn(state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); -} - -export function __addDisposableResource(env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose, inner; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - if (async) inner = dispose; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - -} - -var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; -}; - -export function __disposeResources(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - var r, s = 0; - function next() { - while (r = env.stack.pop()) { - try { - if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); - if (r.dispose) { - var result = r.dispose.call(r.value); - if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - else s |= 1; - } - catch (e) { - fail(e); - } - } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} - -export default { - __extends: __extends, - __assign: __assign, - __rest: __rest, - __decorate: __decorate, - __param: __param, - __metadata: __metadata, - __awaiter: __awaiter, - __generator: __generator, - __createBinding: __createBinding, - __exportStar: __exportStar, - __values: __values, - __read: __read, - __spread: __spread, - __spreadArrays: __spreadArrays, - __spreadArray: __spreadArray, - __await: __await, - __asyncGenerator: __asyncGenerator, - __asyncDelegator: __asyncDelegator, - __asyncValues: __asyncValues, - __makeTemplateObject: __makeTemplateObject, - __importStar: __importStar, - __importDefault: __importDefault, - __classPrivateFieldGet: __classPrivateFieldGet, - __classPrivateFieldSet: __classPrivateFieldSet, - __classPrivateFieldIn: __classPrivateFieldIn, - __addDisposableResource: __addDisposableResource, - __disposeResources: __disposeResources, -}; diff --git a/tools/mnemonic-test/node_modules/tslib/tslib.es6.mjs b/tools/mnemonic-test/node_modules/tslib/tslib.es6.mjs deleted file mode 100644 index 17bb2ff8..00000000 --- a/tools/mnemonic-test/node_modules/tslib/tslib.es6.mjs +++ /dev/null @@ -1,378 +0,0 @@ -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global Reflect, Promise, SuppressedError, Symbol, Iterator */ - -var extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); -}; - -export function __extends(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} - -export var __assign = function() { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - } - return __assign.apply(this, arguments); -} - -export function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; -} - -export function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -} - -export function __param(paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -} - -export function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -}; - -export function __runInitializers(thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; -}; - -export function __propKey(x) { - return typeof x === "symbol" ? x : "".concat(x); -}; - -export function __setFunctionName(f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); -}; - -export function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} - -export function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} - -export function __generator(thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); - return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -} - -export var __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}); - -export function __exportStar(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); -} - -export function __values(o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} - -export function __read(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -} - -/** @deprecated */ -export function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; -} - -/** @deprecated */ -export function __spreadArrays() { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; -} - -export function __spreadArray(to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -} - -export function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); -} - -export function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; - function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } - function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } -} - -export function __asyncDelegator(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } -} - -export function __asyncValues(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } -} - -export function __makeTemplateObject(cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; -}; - -var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}; - -export function __importStar(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -} - -export function __importDefault(mod) { - return (mod && mod.__esModule) ? mod : { default: mod }; -} - -export function __classPrivateFieldGet(receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -} - -export function __classPrivateFieldSet(receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; -} - -export function __classPrivateFieldIn(state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); -} - -export function __addDisposableResource(env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose, inner; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - if (async) inner = dispose; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; -} - -var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; -}; - -export function __disposeResources(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - var r, s = 0; - function next() { - while (r = env.stack.pop()) { - try { - if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); - if (r.dispose) { - var result = r.dispose.call(r.value); - if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - else s |= 1; - } - catch (e) { - fail(e); - } - } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} - -export default { - __extends, - __assign, - __rest, - __decorate, - __param, - __metadata, - __awaiter, - __generator, - __createBinding, - __exportStar, - __values, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, - __classPrivateFieldIn, - __addDisposableResource, - __disposeResources, -}; diff --git a/tools/mnemonic-test/node_modules/tslib/tslib.html b/tools/mnemonic-test/node_modules/tslib/tslib.html deleted file mode 100644 index 44c9ba51..00000000 --- a/tools/mnemonic-test/node_modules/tslib/tslib.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/tslib/tslib.js b/tools/mnemonic-test/node_modules/tslib/tslib.js deleted file mode 100644 index bf17a4d8..00000000 --- a/tools/mnemonic-test/node_modules/tslib/tslib.js +++ /dev/null @@ -1,429 +0,0 @@ -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError, Iterator */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if (typeof module === "object" && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __awaiter = function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); - return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; - function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } - function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose, inner; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - if (async) inner = dispose; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - var r, s = 0; - function next() { - while (r = env.stack.pop()) { - try { - if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); - if (r.dispose) { - var result = r.dispose.call(r.value); - if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - else s |= 1; - } - catch (e) { - fail(e); - } - } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); diff --git a/tools/mnemonic-test/node_modules/undici-types/LICENSE b/tools/mnemonic-test/node_modules/undici-types/LICENSE deleted file mode 100644 index e7323bb5..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) Matteo Collina and Undici contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/tools/mnemonic-test/node_modules/undici-types/README.md b/tools/mnemonic-test/node_modules/undici-types/README.md deleted file mode 100644 index 20a721c4..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# undici-types - -This package is a dual-publish of the [undici](https://www.npmjs.com/package/undici) library types. The `undici` package **still contains types**. This package is for users who _only_ need undici types (such as for `@types/node`). It is published alongside every release of `undici`, so you can always use the same version. - -- [GitHub nodejs/undici](https://github.com/nodejs/undici) -- [Undici Documentation](https://undici.nodejs.org/#/) diff --git a/tools/mnemonic-test/node_modules/undici-types/agent.d.ts b/tools/mnemonic-test/node_modules/undici-types/agent.d.ts deleted file mode 100644 index 58081ce9..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/agent.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { URL } from 'url' -import Pool from './pool' -import Dispatcher from "./dispatcher"; - -export default Agent - -declare class Agent extends Dispatcher{ - constructor(opts?: Agent.Options) - /** `true` after `dispatcher.close()` has been called. */ - closed: boolean; - /** `true` after `dispatcher.destroyed()` has been called or `dispatcher.close()` has been called and the dispatcher shutdown has completed. */ - destroyed: boolean; - /** Dispatches a request. */ - dispatch(options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandlers): boolean; -} - -declare namespace Agent { - export interface Options extends Pool.Options { - /** Default: `(origin, opts) => new Pool(origin, opts)`. */ - factory?(origin: string | URL, opts: Object): Dispatcher; - /** Integer. Default: `0` */ - maxRedirections?: number; - - interceptors?: { Agent?: readonly Dispatcher.DispatchInterceptor[] } & Pool.Options["interceptors"] - } - - export interface DispatchOptions extends Dispatcher.DispatchOptions { - /** Integer. */ - maxRedirections?: number; - } -} diff --git a/tools/mnemonic-test/node_modules/undici-types/api.d.ts b/tools/mnemonic-test/node_modules/undici-types/api.d.ts deleted file mode 100644 index 400341dd..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/api.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { URL, UrlObject } from 'url' -import { Duplex } from 'stream' -import Dispatcher from './dispatcher' - -export { - request, - stream, - pipeline, - connect, - upgrade, -} - -/** Performs an HTTP request. */ -declare function request( - url: string | URL | UrlObject, - options?: { dispatcher?: Dispatcher } & Omit & Partial>, -): Promise; - -/** A faster version of `request`. */ -declare function stream( - url: string | URL | UrlObject, - options: { dispatcher?: Dispatcher } & Omit, - factory: Dispatcher.StreamFactory -): Promise; - -/** For easy use with `stream.pipeline`. */ -declare function pipeline( - url: string | URL | UrlObject, - options: { dispatcher?: Dispatcher } & Omit, - handler: Dispatcher.PipelineHandler -): Duplex; - -/** Starts two-way communications with the requested resource. */ -declare function connect( - url: string | URL | UrlObject, - options?: { dispatcher?: Dispatcher } & Omit -): Promise; - -/** Upgrade to a different protocol. */ -declare function upgrade( - url: string | URL | UrlObject, - options?: { dispatcher?: Dispatcher } & Omit -): Promise; diff --git a/tools/mnemonic-test/node_modules/undici-types/balanced-pool.d.ts b/tools/mnemonic-test/node_modules/undici-types/balanced-pool.d.ts deleted file mode 100644 index 7f930f41..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/balanced-pool.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import Pool from './pool' -import Dispatcher from './dispatcher' -import { URL } from 'url' - -export default BalancedPool - -type BalancedPoolConnectOptions = Omit; - -declare class BalancedPool extends Dispatcher { - constructor(url: string | string[] | URL | URL[], options?: Pool.Options); - - addUpstream(upstream: string | URL): BalancedPool; - removeUpstream(upstream: string | URL): BalancedPool; - upstreams: Array; - - /** `true` after `pool.close()` has been called. */ - closed: boolean; - /** `true` after `pool.destroyed()` has been called or `pool.close()` has been called and the pool shutdown has completed. */ - destroyed: boolean; - - // Override dispatcher APIs. - override connect( - options: BalancedPoolConnectOptions - ): Promise; - override connect( - options: BalancedPoolConnectOptions, - callback: (err: Error | null, data: Dispatcher.ConnectData) => void - ): void; -} diff --git a/tools/mnemonic-test/node_modules/undici-types/cache.d.ts b/tools/mnemonic-test/node_modules/undici-types/cache.d.ts deleted file mode 100644 index 4c333357..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/cache.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import type { RequestInfo, Response, Request } from './fetch' - -export interface CacheStorage { - match (request: RequestInfo, options?: MultiCacheQueryOptions): Promise, - has (cacheName: string): Promise, - open (cacheName: string): Promise, - delete (cacheName: string): Promise, - keys (): Promise -} - -declare const CacheStorage: { - prototype: CacheStorage - new(): CacheStorage -} - -export interface Cache { - match (request: RequestInfo, options?: CacheQueryOptions): Promise, - matchAll (request?: RequestInfo, options?: CacheQueryOptions): Promise, - add (request: RequestInfo): Promise, - addAll (requests: RequestInfo[]): Promise, - put (request: RequestInfo, response: Response): Promise, - delete (request: RequestInfo, options?: CacheQueryOptions): Promise, - keys (request?: RequestInfo, options?: CacheQueryOptions): Promise -} - -export interface CacheQueryOptions { - ignoreSearch?: boolean, - ignoreMethod?: boolean, - ignoreVary?: boolean -} - -export interface MultiCacheQueryOptions extends CacheQueryOptions { - cacheName?: string -} - -export declare const caches: CacheStorage diff --git a/tools/mnemonic-test/node_modules/undici-types/client.d.ts b/tools/mnemonic-test/node_modules/undici-types/client.d.ts deleted file mode 100644 index d0a5379f..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/client.d.ts +++ /dev/null @@ -1,108 +0,0 @@ -import { URL } from 'url' -import { TlsOptions } from 'tls' -import Dispatcher from './dispatcher' -import buildConnector from "./connector"; - -type ClientConnectOptions = Omit; - -/** - * A basic HTTP/1.1 client, mapped on top a single TCP/TLS connection. Pipelining is disabled by default. - */ -export class Client extends Dispatcher { - constructor(url: string | URL, options?: Client.Options); - /** Property to get and set the pipelining factor. */ - pipelining: number; - /** `true` after `client.close()` has been called. */ - closed: boolean; - /** `true` after `client.destroyed()` has been called or `client.close()` has been called and the client shutdown has completed. */ - destroyed: boolean; - - // Override dispatcher APIs. - override connect( - options: ClientConnectOptions - ): Promise; - override connect( - options: ClientConnectOptions, - callback: (err: Error | null, data: Dispatcher.ConnectData) => void - ): void; -} - -export declare namespace Client { - export interface OptionsInterceptors { - Client: readonly Dispatcher.DispatchInterceptor[]; - } - export interface Options { - /** TODO */ - interceptors?: OptionsInterceptors; - /** The maximum length of request headers in bytes. Default: Node.js' `--max-http-header-size` or `16384` (16KiB). */ - maxHeaderSize?: number; - /** The amount of time, in milliseconds, the parser will wait to receive the complete HTTP headers (Node 14 and above only). Default: `300e3` milliseconds (300s). */ - headersTimeout?: number; - /** @deprecated unsupported socketTimeout, use headersTimeout & bodyTimeout instead */ - socketTimeout?: never; - /** @deprecated unsupported requestTimeout, use headersTimeout & bodyTimeout instead */ - requestTimeout?: never; - /** TODO */ - connectTimeout?: number; - /** The timeout after which a request will time out, in milliseconds. Monitors time between receiving body data. Use `0` to disable it entirely. Default: `300e3` milliseconds (300s). */ - bodyTimeout?: number; - /** @deprecated unsupported idleTimeout, use keepAliveTimeout instead */ - idleTimeout?: never; - /** @deprecated unsupported keepAlive, use pipelining=0 instead */ - keepAlive?: never; - /** the timeout, in milliseconds, after which a socket without active requests will time out. Monitors time between activity on a connected socket. This value may be overridden by *keep-alive* hints from the server. Default: `4e3` milliseconds (4s). */ - keepAliveTimeout?: number; - /** @deprecated unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead */ - maxKeepAliveTimeout?: never; - /** the maximum allowed `idleTimeout`, in milliseconds, when overridden by *keep-alive* hints from the server. Default: `600e3` milliseconds (10min). */ - keepAliveMaxTimeout?: number; - /** A number of milliseconds subtracted from server *keep-alive* hints when overriding `idleTimeout` to account for timing inaccuracies caused by e.g. transport latency. Default: `1e3` milliseconds (1s). */ - keepAliveTimeoutThreshold?: number; - /** TODO */ - socketPath?: string; - /** The amount of concurrent requests to be sent over the single TCP/TLS connection according to [RFC7230](https://tools.ietf.org/html/rfc7230#section-6.3.2). Default: `1`. */ - pipelining?: number; - /** @deprecated use the connect option instead */ - tls?: never; - /** If `true`, an error is thrown when the request content-length header doesn't match the length of the request body. Default: `true`. */ - strictContentLength?: boolean; - /** TODO */ - maxCachedSessions?: number; - /** TODO */ - maxRedirections?: number; - /** TODO */ - connect?: buildConnector.BuildOptions | buildConnector.connector; - /** TODO */ - maxRequestsPerClient?: number; - /** TODO */ - localAddress?: string; - /** Max response body size in bytes, -1 is disabled */ - maxResponseSize?: number; - /** Enables a family autodetection algorithm that loosely implements section 5 of RFC 8305. */ - autoSelectFamily?: boolean; - /** The amount of time in milliseconds to wait for a connection attempt to finish before trying the next address when using the `autoSelectFamily` option. */ - autoSelectFamilyAttemptTimeout?: number; - /** - * @description Enables support for H2 if the server has assigned bigger priority to it through ALPN negotiation. - * @default false - */ - allowH2?: boolean; - /** - * @description Dictates the maximum number of concurrent streams for a single H2 session. It can be overridden by a SETTINGS remote frame. - * @default 100 - */ - maxConcurrentStreams?: number - } - export interface SocketInfo { - localAddress?: string - localPort?: number - remoteAddress?: string - remotePort?: number - remoteFamily?: string - timeout?: number - bytesWritten?: number - bytesRead?: number - } -} - -export default Client; diff --git a/tools/mnemonic-test/node_modules/undici-types/connector.d.ts b/tools/mnemonic-test/node_modules/undici-types/connector.d.ts deleted file mode 100644 index bd924339..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/connector.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { TLSSocket, ConnectionOptions } from 'tls' -import { IpcNetConnectOpts, Socket, TcpNetConnectOpts } from 'net' - -export default buildConnector -declare function buildConnector (options?: buildConnector.BuildOptions): buildConnector.connector - -declare namespace buildConnector { - export type BuildOptions = (ConnectionOptions | TcpNetConnectOpts | IpcNetConnectOpts) & { - allowH2?: boolean; - maxCachedSessions?: number | null; - socketPath?: string | null; - timeout?: number | null; - port?: number; - keepAlive?: boolean | null; - keepAliveInitialDelay?: number | null; - } - - export interface Options { - hostname: string - host?: string - protocol: string - port: string - servername?: string - localAddress?: string | null - httpSocket?: Socket - } - - export type Callback = (...args: CallbackArgs) => void - type CallbackArgs = [null, Socket | TLSSocket] | [Error, null] - - export interface connector { - (options: buildConnector.Options, callback: buildConnector.Callback): void - } -} diff --git a/tools/mnemonic-test/node_modules/undici-types/content-type.d.ts b/tools/mnemonic-test/node_modules/undici-types/content-type.d.ts deleted file mode 100644 index f2a87f1b..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/content-type.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/// - -interface MIMEType { - type: string - subtype: string - parameters: Map - essence: string -} - -/** - * Parse a string to a {@link MIMEType} object. Returns `failure` if the string - * couldn't be parsed. - * @see https://mimesniff.spec.whatwg.org/#parse-a-mime-type - */ -export function parseMIMEType (input: string): 'failure' | MIMEType - -/** - * Convert a MIMEType object to a string. - * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type - */ -export function serializeAMimeType (mimeType: MIMEType): string diff --git a/tools/mnemonic-test/node_modules/undici-types/cookies.d.ts b/tools/mnemonic-test/node_modules/undici-types/cookies.d.ts deleted file mode 100644 index aa38cae4..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/cookies.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -/// - -import type { Headers } from './fetch' - -export interface Cookie { - name: string - value: string - expires?: Date | number - maxAge?: number - domain?: string - path?: string - secure?: boolean - httpOnly?: boolean - sameSite?: 'Strict' | 'Lax' | 'None' - unparsed?: string[] -} - -export function deleteCookie ( - headers: Headers, - name: string, - attributes?: { name?: string, domain?: string } -): void - -export function getCookies (headers: Headers): Record - -export function getSetCookies (headers: Headers): Cookie[] - -export function setCookie (headers: Headers, cookie: Cookie): void diff --git a/tools/mnemonic-test/node_modules/undici-types/diagnostics-channel.d.ts b/tools/mnemonic-test/node_modules/undici-types/diagnostics-channel.d.ts deleted file mode 100644 index a037d1e0..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/diagnostics-channel.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { Socket } from "net"; -import { URL } from "url"; -import Connector from "./connector"; -import Dispatcher from "./dispatcher"; - -declare namespace DiagnosticsChannel { - interface Request { - origin?: string | URL; - completed: boolean; - method?: Dispatcher.HttpMethod; - path: string; - headers: any; - } - interface Response { - statusCode: number; - statusText: string; - headers: Array; - } - type Error = unknown; - interface ConnectParams { - host: URL["host"]; - hostname: URL["hostname"]; - protocol: URL["protocol"]; - port: URL["port"]; - servername: string | null; - } - type Connector = Connector.connector; - export interface RequestCreateMessage { - request: Request; - } - export interface RequestBodySentMessage { - request: Request; - } - export interface RequestHeadersMessage { - request: Request; - response: Response; - } - export interface RequestTrailersMessage { - request: Request; - trailers: Array; - } - export interface RequestErrorMessage { - request: Request; - error: Error; - } - export interface ClientSendHeadersMessage { - request: Request; - headers: string; - socket: Socket; - } - export interface ClientBeforeConnectMessage { - connectParams: ConnectParams; - connector: Connector; - } - export interface ClientConnectedMessage { - socket: Socket; - connectParams: ConnectParams; - connector: Connector; - } - export interface ClientConnectErrorMessage { - error: Error; - socket: Socket; - connectParams: ConnectParams; - connector: Connector; - } -} diff --git a/tools/mnemonic-test/node_modules/undici-types/dispatcher.d.ts b/tools/mnemonic-test/node_modules/undici-types/dispatcher.d.ts deleted file mode 100644 index 0aa2aba0..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/dispatcher.d.ts +++ /dev/null @@ -1,255 +0,0 @@ -import { URL } from 'url' -import { Duplex, Readable, Writable } from 'stream' -import { EventEmitter } from 'events' -import { Blob } from 'buffer' -import { IncomingHttpHeaders } from './header' -import BodyReadable from './readable' -import { FormData } from './formdata' -import Errors from './errors' - -type AbortSignal = unknown; - -export default Dispatcher - -/** Dispatcher is the core API used to dispatch requests. */ -declare class Dispatcher extends EventEmitter { - /** Dispatches a request. This API is expected to evolve through semver-major versions and is less stable than the preceding higher level APIs. It is primarily intended for library developers who implement higher level APIs on top of this. */ - dispatch(options: Dispatcher.DispatchOptions, handler: Dispatcher.DispatchHandlers): boolean; - /** Starts two-way communications with the requested resource. */ - connect(options: Dispatcher.ConnectOptions): Promise; - connect(options: Dispatcher.ConnectOptions, callback: (err: Error | null, data: Dispatcher.ConnectData) => void): void; - /** Compose a chain of dispatchers */ - compose(dispatchers: Dispatcher.DispatcherComposeInterceptor[]): Dispatcher.ComposedDispatcher; - compose(...dispatchers: Dispatcher.DispatcherComposeInterceptor[]): Dispatcher.ComposedDispatcher; - /** Performs an HTTP request. */ - request(options: Dispatcher.RequestOptions): Promise; - request(options: Dispatcher.RequestOptions, callback: (err: Error | null, data: Dispatcher.ResponseData) => void): void; - /** For easy use with `stream.pipeline`. */ - pipeline(options: Dispatcher.PipelineOptions, handler: Dispatcher.PipelineHandler): Duplex; - /** A faster version of `Dispatcher.request`. */ - stream(options: Dispatcher.RequestOptions, factory: Dispatcher.StreamFactory): Promise; - stream(options: Dispatcher.RequestOptions, factory: Dispatcher.StreamFactory, callback: (err: Error | null, data: Dispatcher.StreamData) => void): void; - /** Upgrade to a different protocol. */ - upgrade(options: Dispatcher.UpgradeOptions): Promise; - upgrade(options: Dispatcher.UpgradeOptions, callback: (err: Error | null, data: Dispatcher.UpgradeData) => void): void; - /** Closes the client and gracefully waits for enqueued requests to complete before invoking the callback (or returning a promise if no callback is provided). */ - close(): Promise; - close(callback: () => void): void; - /** Destroy the client abruptly with the given err. All the pending and running requests will be asynchronously aborted and error. Waits until socket is closed before invoking the callback (or returning a promise if no callback is provided). Since this operation is asynchronously dispatched there might still be some progress on dispatched requests. */ - destroy(): Promise; - destroy(err: Error | null): Promise; - destroy(callback: () => void): void; - destroy(err: Error | null, callback: () => void): void; - - on(eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this; - on(eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this; - on(eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this; - on(eventName: 'drain', callback: (origin: URL) => void): this; - - - once(eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this; - once(eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this; - once(eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this; - once(eventName: 'drain', callback: (origin: URL) => void): this; - - - off(eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this; - off(eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this; - off(eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this; - off(eventName: 'drain', callback: (origin: URL) => void): this; - - - addListener(eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this; - addListener(eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this; - addListener(eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this; - addListener(eventName: 'drain', callback: (origin: URL) => void): this; - - removeListener(eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this; - removeListener(eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this; - removeListener(eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this; - removeListener(eventName: 'drain', callback: (origin: URL) => void): this; - - prependListener(eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this; - prependListener(eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this; - prependListener(eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this; - prependListener(eventName: 'drain', callback: (origin: URL) => void): this; - - prependOnceListener(eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this; - prependOnceListener(eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this; - prependOnceListener(eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this; - prependOnceListener(eventName: 'drain', callback: (origin: URL) => void): this; - - listeners(eventName: 'connect'): ((origin: URL, targets: readonly Dispatcher[]) => void)[] - listeners(eventName: 'disconnect'): ((origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[]; - listeners(eventName: 'connectionError'): ((origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[]; - listeners(eventName: 'drain'): ((origin: URL) => void)[]; - - rawListeners(eventName: 'connect'): ((origin: URL, targets: readonly Dispatcher[]) => void)[] - rawListeners(eventName: 'disconnect'): ((origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[]; - rawListeners(eventName: 'connectionError'): ((origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[]; - rawListeners(eventName: 'drain'): ((origin: URL) => void)[]; - - emit(eventName: 'connect', origin: URL, targets: readonly Dispatcher[]): boolean; - emit(eventName: 'disconnect', origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError): boolean; - emit(eventName: 'connectionError', origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError): boolean; - emit(eventName: 'drain', origin: URL): boolean; -} - -declare namespace Dispatcher { - export interface ComposedDispatcher extends Dispatcher {} - export type DispatcherComposeInterceptor = (dispatch: Dispatcher['dispatch']) => Dispatcher['dispatch']; - export interface DispatchOptions { - origin?: string | URL; - path: string; - method: HttpMethod; - /** Default: `null` */ - body?: string | Buffer | Uint8Array | Readable | null | FormData; - /** Default: `null` */ - headers?: IncomingHttpHeaders | string[] | Iterable<[string, string | string[] | undefined]> | null; - /** Query string params to be embedded in the request URL. Default: `null` */ - query?: Record; - /** Whether the requests can be safely retried or not. If `false` the request won't be sent until all preceding requests in the pipeline have completed. Default: `true` if `method` is `HEAD` or `GET`. */ - idempotent?: boolean; - /** Whether the response is expected to take a long time and would end up blocking the pipeline. When this is set to `true` further pipelining will be avoided on the same connection until headers have been received. */ - blocking?: boolean; - /** Upgrade the request. Should be used to specify the kind of upgrade i.e. `'Websocket'`. Default: `method === 'CONNECT' || null`. */ - upgrade?: boolean | string | null; - /** The amount of time, in milliseconds, the parser will wait to receive the complete HTTP headers. Defaults to 300 seconds. */ - headersTimeout?: number | null; - /** The timeout after which a request will time out, in milliseconds. Monitors time between receiving body data. Use 0 to disable it entirely. Defaults to 300 seconds. */ - bodyTimeout?: number | null; - /** Whether the request should stablish a keep-alive or not. Default `false` */ - reset?: boolean; - /** Whether Undici should throw an error upon receiving a 4xx or 5xx response from the server. Defaults to false */ - throwOnError?: boolean; - /** For H2, it appends the expect: 100-continue header, and halts the request body until a 100-continue is received from the remote server*/ - expectContinue?: boolean; - } - export interface ConnectOptions { - origin: string | URL; - path: string; - /** Default: `null` */ - headers?: IncomingHttpHeaders | string[] | null; - /** Default: `null` */ - signal?: AbortSignal | EventEmitter | null; - /** This argument parameter is passed through to `ConnectData` */ - opaque?: unknown; - /** Default: 0 */ - maxRedirections?: number; - /** Default: false */ - redirectionLimitReached?: boolean; - /** Default: `null` */ - responseHeader?: 'raw' | null; - } - export interface RequestOptions extends DispatchOptions { - /** Default: `null` */ - opaque?: unknown; - /** Default: `null` */ - signal?: AbortSignal | EventEmitter | null; - /** Default: 0 */ - maxRedirections?: number; - /** Default: false */ - redirectionLimitReached?: boolean; - /** Default: `null` */ - onInfo?: (info: { statusCode: number, headers: Record }) => void; - /** Default: `null` */ - responseHeader?: 'raw' | null; - /** Default: `64 KiB` */ - highWaterMark?: number; - } - export interface PipelineOptions extends RequestOptions { - /** `true` if the `handler` will return an object stream. Default: `false` */ - objectMode?: boolean; - } - export interface UpgradeOptions { - path: string; - /** Default: `'GET'` */ - method?: string; - /** Default: `null` */ - headers?: IncomingHttpHeaders | string[] | null; - /** A string of comma separated protocols, in descending preference order. Default: `'Websocket'` */ - protocol?: string; - /** Default: `null` */ - signal?: AbortSignal | EventEmitter | null; - /** Default: 0 */ - maxRedirections?: number; - /** Default: false */ - redirectionLimitReached?: boolean; - /** Default: `null` */ - responseHeader?: 'raw' | null; - } - export interface ConnectData { - statusCode: number; - headers: IncomingHttpHeaders; - socket: Duplex; - opaque: unknown; - } - export interface ResponseData { - statusCode: number; - headers: IncomingHttpHeaders; - body: BodyReadable & BodyMixin; - trailers: Record; - opaque: unknown; - context: object; - } - export interface PipelineHandlerData { - statusCode: number; - headers: IncomingHttpHeaders; - opaque: unknown; - body: BodyReadable; - context: object; - } - export interface StreamData { - opaque: unknown; - trailers: Record; - } - export interface UpgradeData { - headers: IncomingHttpHeaders; - socket: Duplex; - opaque: unknown; - } - export interface StreamFactoryData { - statusCode: number; - headers: IncomingHttpHeaders; - opaque: unknown; - context: object; - } - export type StreamFactory = (data: StreamFactoryData) => Writable; - export interface DispatchHandlers { - /** Invoked before request is dispatched on socket. May be invoked multiple times when a request is retried when the request at the head of the pipeline fails. */ - onConnect?(abort: (err?: Error) => void): void; - /** Invoked when an error has occurred. */ - onError?(err: Error): void; - /** Invoked when request is upgraded either due to a `Upgrade` header or `CONNECT` method. */ - onUpgrade?(statusCode: number, headers: Buffer[] | string[] | null, socket: Duplex): void; - /** Invoked when response is received, before headers have been read. **/ - onResponseStarted?(): void; - /** Invoked when statusCode and headers have been received. May be invoked multiple times due to 1xx informational headers. */ - onHeaders?(statusCode: number, headers: Buffer[], resume: () => void, statusText: string): boolean; - /** Invoked when response payload data is received. */ - onData?(chunk: Buffer): boolean; - /** Invoked when response payload and trailers have been received and the request has completed. */ - onComplete?(trailers: string[] | null): void; - /** Invoked when a body chunk is sent to the server. May be invoked multiple times for chunked requests */ - onBodySent?(chunkSize: number, totalBytesSent: number): void; - } - export type PipelineHandler = (data: PipelineHandlerData) => Readable; - export type HttpMethod = 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'PATCH'; - - /** - * @link https://fetch.spec.whatwg.org/#body-mixin - */ - interface BodyMixin { - readonly body?: never; - readonly bodyUsed: boolean; - arrayBuffer(): Promise; - blob(): Promise; - formData(): Promise; - json(): Promise; - text(): Promise; - } - - export interface DispatchInterceptor { - (dispatch: Dispatcher['dispatch']): Dispatcher['dispatch'] - } -} diff --git a/tools/mnemonic-test/node_modules/undici-types/env-http-proxy-agent.d.ts b/tools/mnemonic-test/node_modules/undici-types/env-http-proxy-agent.d.ts deleted file mode 100644 index d6509dc6..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/env-http-proxy-agent.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import Agent from './agent' -import Dispatcher from './dispatcher' - -export default EnvHttpProxyAgent - -declare class EnvHttpProxyAgent extends Dispatcher { - constructor(opts?: EnvHttpProxyAgent.Options) - - dispatch(options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandlers): boolean; -} - -declare namespace EnvHttpProxyAgent { - export interface Options extends Agent.Options { - /** Overrides the value of the HTTP_PROXY environment variable */ - httpProxy?: string; - /** Overrides the value of the HTTPS_PROXY environment variable */ - httpsProxy?: string; - /** Overrides the value of the NO_PROXY environment variable */ - noProxy?: string; - } -} diff --git a/tools/mnemonic-test/node_modules/undici-types/errors.d.ts b/tools/mnemonic-test/node_modules/undici-types/errors.d.ts deleted file mode 100644 index f6fb73b5..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/errors.d.ts +++ /dev/null @@ -1,149 +0,0 @@ -import { IncomingHttpHeaders } from "./header"; -import Client from './client' - -export default Errors - -declare namespace Errors { - export class UndiciError extends Error { - name: string; - code: string; - } - - /** Connect timeout error. */ - export class ConnectTimeoutError extends UndiciError { - name: 'ConnectTimeoutError'; - code: 'UND_ERR_CONNECT_TIMEOUT'; - } - - /** A header exceeds the `headersTimeout` option. */ - export class HeadersTimeoutError extends UndiciError { - name: 'HeadersTimeoutError'; - code: 'UND_ERR_HEADERS_TIMEOUT'; - } - - /** Headers overflow error. */ - export class HeadersOverflowError extends UndiciError { - name: 'HeadersOverflowError' - code: 'UND_ERR_HEADERS_OVERFLOW' - } - - /** A body exceeds the `bodyTimeout` option. */ - export class BodyTimeoutError extends UndiciError { - name: 'BodyTimeoutError'; - code: 'UND_ERR_BODY_TIMEOUT'; - } - - export class ResponseStatusCodeError extends UndiciError { - constructor ( - message?: string, - statusCode?: number, - headers?: IncomingHttpHeaders | string[] | null, - body?: null | Record | string - ); - name: 'ResponseStatusCodeError'; - code: 'UND_ERR_RESPONSE_STATUS_CODE'; - body: null | Record | string - status: number - statusCode: number - headers: IncomingHttpHeaders | string[] | null; - } - - /** Passed an invalid argument. */ - export class InvalidArgumentError extends UndiciError { - name: 'InvalidArgumentError'; - code: 'UND_ERR_INVALID_ARG'; - } - - /** Returned an invalid value. */ - export class InvalidReturnValueError extends UndiciError { - name: 'InvalidReturnValueError'; - code: 'UND_ERR_INVALID_RETURN_VALUE'; - } - - /** The request has been aborted by the user. */ - export class RequestAbortedError extends UndiciError { - name: 'AbortError'; - code: 'UND_ERR_ABORTED'; - } - - /** Expected error with reason. */ - export class InformationalError extends UndiciError { - name: 'InformationalError'; - code: 'UND_ERR_INFO'; - } - - /** Request body length does not match content-length header. */ - export class RequestContentLengthMismatchError extends UndiciError { - name: 'RequestContentLengthMismatchError'; - code: 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'; - } - - /** Response body length does not match content-length header. */ - export class ResponseContentLengthMismatchError extends UndiciError { - name: 'ResponseContentLengthMismatchError'; - code: 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH'; - } - - /** Trying to use a destroyed client. */ - export class ClientDestroyedError extends UndiciError { - name: 'ClientDestroyedError'; - code: 'UND_ERR_DESTROYED'; - } - - /** Trying to use a closed client. */ - export class ClientClosedError extends UndiciError { - name: 'ClientClosedError'; - code: 'UND_ERR_CLOSED'; - } - - /** There is an error with the socket. */ - export class SocketError extends UndiciError { - name: 'SocketError'; - code: 'UND_ERR_SOCKET'; - socket: Client.SocketInfo | null - } - - /** Encountered unsupported functionality. */ - export class NotSupportedError extends UndiciError { - name: 'NotSupportedError'; - code: 'UND_ERR_NOT_SUPPORTED'; - } - - /** No upstream has been added to the BalancedPool. */ - export class BalancedPoolMissingUpstreamError extends UndiciError { - name: 'MissingUpstreamError'; - code: 'UND_ERR_BPL_MISSING_UPSTREAM'; - } - - export class HTTPParserError extends UndiciError { - name: 'HTTPParserError'; - code: string; - } - - /** The response exceed the length allowed. */ - export class ResponseExceededMaxSizeError extends UndiciError { - name: 'ResponseExceededMaxSizeError'; - code: 'UND_ERR_RES_EXCEEDED_MAX_SIZE'; - } - - export class RequestRetryError extends UndiciError { - constructor ( - message: string, - statusCode: number, - headers?: IncomingHttpHeaders | string[] | null, - body?: null | Record | string - ); - name: 'RequestRetryError'; - code: 'UND_ERR_REQ_RETRY'; - statusCode: number; - data: { - count: number; - }; - headers: Record; - } - - export class SecureProxyConnectionError extends UndiciError { - name: 'SecureProxyConnectionError'; - code: 'UND_ERR_PRX_TLS'; - } -} diff --git a/tools/mnemonic-test/node_modules/undici-types/eventsource.d.ts b/tools/mnemonic-test/node_modules/undici-types/eventsource.d.ts deleted file mode 100644 index eecda8c0..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/eventsource.d.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { MessageEvent, ErrorEvent } from './websocket' -import Dispatcher from './dispatcher' - -import { - EventTarget, - Event, - EventListenerOptions, - AddEventListenerOptions, - EventListenerOrEventListenerObject -} from './patch' - -interface EventSourceEventMap { - error: ErrorEvent - message: MessageEvent - open: Event -} - -interface EventSource extends EventTarget { - close(): void - readonly CLOSED: 2 - readonly CONNECTING: 0 - readonly OPEN: 1 - onerror: (this: EventSource, ev: ErrorEvent) => any - onmessage: (this: EventSource, ev: MessageEvent) => any - onopen: (this: EventSource, ev: Event) => any - readonly readyState: 0 | 1 | 2 - readonly url: string - readonly withCredentials: boolean - - addEventListener( - type: K, - listener: (this: EventSource, ev: EventSourceEventMap[K]) => any, - options?: boolean | AddEventListenerOptions - ): void - addEventListener( - type: string, - listener: EventListenerOrEventListenerObject, - options?: boolean | AddEventListenerOptions - ): void - removeEventListener( - type: K, - listener: (this: EventSource, ev: EventSourceEventMap[K]) => any, - options?: boolean | EventListenerOptions - ): void - removeEventListener( - type: string, - listener: EventListenerOrEventListenerObject, - options?: boolean | EventListenerOptions - ): void -} - -export declare const EventSource: { - prototype: EventSource - new (url: string | URL, init?: EventSourceInit): EventSource - readonly CLOSED: 2 - readonly CONNECTING: 0 - readonly OPEN: 1 -} - -interface EventSourceInit { - withCredentials?: boolean, - dispatcher?: Dispatcher -} diff --git a/tools/mnemonic-test/node_modules/undici-types/fetch.d.ts b/tools/mnemonic-test/node_modules/undici-types/fetch.d.ts deleted file mode 100644 index 7e94375e..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/fetch.d.ts +++ /dev/null @@ -1,209 +0,0 @@ -// based on https://github.com/Ethan-Arrowood/undici-fetch/blob/249269714db874351589d2d364a0645d5160ae71/index.d.ts (MIT license) -// and https://github.com/node-fetch/node-fetch/blob/914ce6be5ec67a8bab63d68510aabf07cb818b6d/index.d.ts (MIT license) -/// - -import { Blob } from 'buffer' -import { URL, URLSearchParams } from 'url' -import { ReadableStream } from 'stream/web' -import { FormData } from './formdata' - -import Dispatcher from './dispatcher' - -export type RequestInfo = string | URL | Request - -export declare function fetch ( - input: RequestInfo, - init?: RequestInit -): Promise - -export type BodyInit = - | ArrayBuffer - | AsyncIterable - | Blob - | FormData - | Iterable - | NodeJS.ArrayBufferView - | URLSearchParams - | null - | string - -export class BodyMixin { - readonly body: ReadableStream | null - readonly bodyUsed: boolean - - readonly arrayBuffer: () => Promise - readonly blob: () => Promise - /** - * @deprecated This method is not recommended for parsing multipart/form-data bodies in server environments. - * It is recommended to use a library such as [@fastify/busboy](https://www.npmjs.com/package/@fastify/busboy) as follows: - * - * @example - * ```js - * import { Busboy } from '@fastify/busboy' - * import { Readable } from 'node:stream' - * - * const response = await fetch('...') - * const busboy = new Busboy({ headers: { 'content-type': response.headers.get('content-type') } }) - * - * // handle events emitted from `busboy` - * - * Readable.fromWeb(response.body).pipe(busboy) - * ``` - */ - readonly formData: () => Promise - readonly json: () => Promise - readonly text: () => Promise -} - -export interface SpecIterator { - next(...args: [] | [TNext]): IteratorResult; -} - -export interface SpecIterableIterator extends SpecIterator { - [Symbol.iterator](): SpecIterableIterator; -} - -export interface SpecIterable { - [Symbol.iterator](): SpecIterator; -} - -export type HeadersInit = string[][] | Record> | Headers - -export declare class Headers implements SpecIterable<[string, string]> { - constructor (init?: HeadersInit) - readonly append: (name: string, value: string) => void - readonly delete: (name: string) => void - readonly get: (name: string) => string | null - readonly has: (name: string) => boolean - readonly set: (name: string, value: string) => void - readonly getSetCookie: () => string[] - readonly forEach: ( - callbackfn: (value: string, key: string, iterable: Headers) => void, - thisArg?: unknown - ) => void - - readonly keys: () => SpecIterableIterator - readonly values: () => SpecIterableIterator - readonly entries: () => SpecIterableIterator<[string, string]> - readonly [Symbol.iterator]: () => SpecIterableIterator<[string, string]> -} - -export type RequestCache = - | 'default' - | 'force-cache' - | 'no-cache' - | 'no-store' - | 'only-if-cached' - | 'reload' - -export type RequestCredentials = 'omit' | 'include' | 'same-origin' - -type RequestDestination = - | '' - | 'audio' - | 'audioworklet' - | 'document' - | 'embed' - | 'font' - | 'image' - | 'manifest' - | 'object' - | 'paintworklet' - | 'report' - | 'script' - | 'sharedworker' - | 'style' - | 'track' - | 'video' - | 'worker' - | 'xslt' - -export interface RequestInit { - method?: string - keepalive?: boolean - headers?: HeadersInit - body?: BodyInit | null - redirect?: RequestRedirect - integrity?: string - signal?: AbortSignal | null - credentials?: RequestCredentials - mode?: RequestMode - referrer?: string - referrerPolicy?: ReferrerPolicy - window?: null - dispatcher?: Dispatcher - duplex?: RequestDuplex -} - -export type ReferrerPolicy = - | '' - | 'no-referrer' - | 'no-referrer-when-downgrade' - | 'origin' - | 'origin-when-cross-origin' - | 'same-origin' - | 'strict-origin' - | 'strict-origin-when-cross-origin' - | 'unsafe-url'; - -export type RequestMode = 'cors' | 'navigate' | 'no-cors' | 'same-origin' - -export type RequestRedirect = 'error' | 'follow' | 'manual' - -export type RequestDuplex = 'half' - -export declare class Request extends BodyMixin { - constructor (input: RequestInfo, init?: RequestInit) - - readonly cache: RequestCache - readonly credentials: RequestCredentials - readonly destination: RequestDestination - readonly headers: Headers - readonly integrity: string - readonly method: string - readonly mode: RequestMode - readonly redirect: RequestRedirect - readonly referrer: string - readonly referrerPolicy: ReferrerPolicy - readonly url: string - - readonly keepalive: boolean - readonly signal: AbortSignal - readonly duplex: RequestDuplex - - readonly clone: () => Request -} - -export interface ResponseInit { - readonly status?: number - readonly statusText?: string - readonly headers?: HeadersInit -} - -export type ResponseType = - | 'basic' - | 'cors' - | 'default' - | 'error' - | 'opaque' - | 'opaqueredirect' - -export type ResponseRedirectStatus = 301 | 302 | 303 | 307 | 308 - -export declare class Response extends BodyMixin { - constructor (body?: BodyInit, init?: ResponseInit) - - readonly headers: Headers - readonly ok: boolean - readonly status: number - readonly statusText: string - readonly type: ResponseType - readonly url: string - readonly redirected: boolean - - readonly clone: () => Response - - static error (): Response - static json(data: any, init?: ResponseInit): Response - static redirect (url: string | URL, status: ResponseRedirectStatus): Response -} diff --git a/tools/mnemonic-test/node_modules/undici-types/file.d.ts b/tools/mnemonic-test/node_modules/undici-types/file.d.ts deleted file mode 100644 index c695b7ab..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/file.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -// Based on https://github.com/octet-stream/form-data/blob/2d0f0dc371517444ce1f22cdde13f51995d0953a/lib/File.ts (MIT) -/// - -import { Blob } from 'buffer' - -export interface BlobPropertyBag { - type?: string - endings?: 'native' | 'transparent' -} - -export interface FilePropertyBag extends BlobPropertyBag { - /** - * The last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight). Files without a known last modified date return the current date. - */ - lastModified?: number -} - -export declare class File extends Blob { - /** - * Creates a new File instance. - * - * @param fileBits An `Array` strings, or [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer), [`ArrayBufferView`](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView), [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) objects, or a mix of any of such objects, that will be put inside the [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File). - * @param fileName The name of the file. - * @param options An options object containing optional attributes for the file. - */ - constructor(fileBits: ReadonlyArray, fileName: string, options?: FilePropertyBag) - - /** - * Name of the file referenced by the File object. - */ - readonly name: string - - /** - * The last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight). Files without a known last modified date return the current date. - */ - readonly lastModified: number - - readonly [Symbol.toStringTag]: string -} diff --git a/tools/mnemonic-test/node_modules/undici-types/filereader.d.ts b/tools/mnemonic-test/node_modules/undici-types/filereader.d.ts deleted file mode 100644 index f05d231b..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/filereader.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -/// - -import { Blob } from 'buffer' -import { DOMException, Event, EventInit, EventTarget } from './patch' - -export declare class FileReader { - __proto__: EventTarget & FileReader - - constructor () - - readAsArrayBuffer (blob: Blob): void - readAsBinaryString (blob: Blob): void - readAsText (blob: Blob, encoding?: string): void - readAsDataURL (blob: Blob): void - - abort (): void - - static readonly EMPTY = 0 - static readonly LOADING = 1 - static readonly DONE = 2 - - readonly EMPTY = 0 - readonly LOADING = 1 - readonly DONE = 2 - - readonly readyState: number - - readonly result: string | ArrayBuffer | null - - readonly error: DOMException | null - - onloadstart: null | ((this: FileReader, event: ProgressEvent) => void) - onprogress: null | ((this: FileReader, event: ProgressEvent) => void) - onload: null | ((this: FileReader, event: ProgressEvent) => void) - onabort: null | ((this: FileReader, event: ProgressEvent) => void) - onerror: null | ((this: FileReader, event: ProgressEvent) => void) - onloadend: null | ((this: FileReader, event: ProgressEvent) => void) -} - -export interface ProgressEventInit extends EventInit { - lengthComputable?: boolean - loaded?: number - total?: number -} - -export declare class ProgressEvent { - __proto__: Event & ProgressEvent - - constructor (type: string, eventInitDict?: ProgressEventInit) - - readonly lengthComputable: boolean - readonly loaded: number - readonly total: number -} diff --git a/tools/mnemonic-test/node_modules/undici-types/formdata.d.ts b/tools/mnemonic-test/node_modules/undici-types/formdata.d.ts deleted file mode 100644 index e676b11e..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/formdata.d.ts +++ /dev/null @@ -1,108 +0,0 @@ -// Based on https://github.com/octet-stream/form-data/blob/2d0f0dc371517444ce1f22cdde13f51995d0953a/lib/FormData.ts (MIT) -/// - -import { File } from './file' -import { SpecIterableIterator } from './fetch' - -/** - * A `string` or `File` that represents a single value from a set of `FormData` key-value pairs. - */ -declare type FormDataEntryValue = string | File - -/** - * Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using fetch(). - */ -export declare class FormData { - /** - * Appends a new value onto an existing key inside a FormData object, - * or adds the key if it does not already exist. - * - * The difference between `set()` and `append()` is that if the specified key already exists, `set()` will overwrite all existing values with the new one, whereas `append()` will append the new value onto the end of the existing set of values. - * - * @param name The name of the field whose data is contained in `value`. - * @param value The field's value. This can be [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) - or [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File). If none of these are specified the value is converted to a string. - * @param fileName The filename reported to the server, when a Blob or File is passed as the second parameter. The default filename for Blob objects is "blob". The default filename for File objects is the file's filename. - */ - append(name: string, value: unknown, fileName?: string): void - - /** - * Set a new value for an existing key inside FormData, - * or add the new field if it does not already exist. - * - * @param name The name of the field whose data is contained in `value`. - * @param value The field's value. This can be [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) - or [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File). If none of these are specified the value is converted to a string. - * @param fileName The filename reported to the server, when a Blob or File is passed as the second parameter. The default filename for Blob objects is "blob". The default filename for File objects is the file's filename. - * - */ - set(name: string, value: unknown, fileName?: string): void - - /** - * Returns the first value associated with a given key from within a `FormData` object. - * If you expect multiple values and want all of them, use the `getAll()` method instead. - * - * @param {string} name A name of the value you want to retrieve. - * - * @returns A `FormDataEntryValue` containing the value. If the key doesn't exist, the method returns null. - */ - get(name: string): FormDataEntryValue | null - - /** - * Returns all the values associated with a given key from within a `FormData` object. - * - * @param {string} name A name of the value you want to retrieve. - * - * @returns An array of `FormDataEntryValue` whose key matches the value passed in the `name` parameter. If the key doesn't exist, the method returns an empty list. - */ - getAll(name: string): FormDataEntryValue[] - - /** - * Returns a boolean stating whether a `FormData` object contains a certain key. - * - * @param name A string representing the name of the key you want to test for. - * - * @return A boolean value. - */ - has(name: string): boolean - - /** - * Deletes a key and its value(s) from a `FormData` object. - * - * @param name The name of the key you want to delete. - */ - delete(name: string): void - - /** - * Executes given callback function for each field of the FormData instance - */ - forEach: ( - callbackfn: (value: FormDataEntryValue, key: string, iterable: FormData) => void, - thisArg?: unknown - ) => void - - /** - * Returns an [`iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) allowing to go through all keys contained in this `FormData` object. - * Each key is a `string`. - */ - keys: () => SpecIterableIterator - - /** - * Returns an [`iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) allowing to go through all values contained in this object `FormData` object. - * Each value is a [`FormDataValue`](https://developer.mozilla.org/en-US/docs/Web/API/FormDataEntryValue). - */ - values: () => SpecIterableIterator - - /** - * Returns an [`iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) allowing to go through the `FormData` key/value pairs. - * The key of each pair is a string; the value is a [`FormDataValue`](https://developer.mozilla.org/en-US/docs/Web/API/FormDataEntryValue). - */ - entries: () => SpecIterableIterator<[string, FormDataEntryValue]> - - /** - * An alias for FormData#entries() - */ - [Symbol.iterator]: () => SpecIterableIterator<[string, FormDataEntryValue]> - - readonly [Symbol.toStringTag]: string -} diff --git a/tools/mnemonic-test/node_modules/undici-types/global-dispatcher.d.ts b/tools/mnemonic-test/node_modules/undici-types/global-dispatcher.d.ts deleted file mode 100644 index 728f95ce..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/global-dispatcher.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import Dispatcher from "./dispatcher"; - -export { - getGlobalDispatcher, - setGlobalDispatcher -} - -declare function setGlobalDispatcher(dispatcher: DispatcherImplementation): void; -declare function getGlobalDispatcher(): Dispatcher; diff --git a/tools/mnemonic-test/node_modules/undici-types/global-origin.d.ts b/tools/mnemonic-test/node_modules/undici-types/global-origin.d.ts deleted file mode 100644 index 322542d6..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/global-origin.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export { - setGlobalOrigin, - getGlobalOrigin -} - -declare function setGlobalOrigin(origin: string | URL | undefined): void; -declare function getGlobalOrigin(): URL | undefined; \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/undici-types/handlers.d.ts b/tools/mnemonic-test/node_modules/undici-types/handlers.d.ts deleted file mode 100644 index afcda9a3..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/handlers.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import Dispatcher from "./dispatcher"; - -export declare class RedirectHandler implements Dispatcher.DispatchHandlers { - constructor( - dispatch: Dispatcher, - maxRedirections: number, - opts: Dispatcher.DispatchOptions, - handler: Dispatcher.DispatchHandlers, - redirectionLimitReached: boolean - ); -} - -export declare class DecoratorHandler implements Dispatcher.DispatchHandlers { - constructor(handler: Dispatcher.DispatchHandlers); -} diff --git a/tools/mnemonic-test/node_modules/undici-types/header.d.ts b/tools/mnemonic-test/node_modules/undici-types/header.d.ts deleted file mode 100644 index bfdb3296..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/header.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/** - * The header type declaration of `undici`. - */ -export type IncomingHttpHeaders = Record; diff --git a/tools/mnemonic-test/node_modules/undici-types/index.d.ts b/tools/mnemonic-test/node_modules/undici-types/index.d.ts deleted file mode 100644 index f6be35cd..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/index.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -import Dispatcher from'./dispatcher' -import { setGlobalDispatcher, getGlobalDispatcher } from './global-dispatcher' -import { setGlobalOrigin, getGlobalOrigin } from './global-origin' -import Pool from'./pool' -import { RedirectHandler, DecoratorHandler } from './handlers' - -import BalancedPool from './balanced-pool' -import Client from'./client' -import buildConnector from'./connector' -import errors from'./errors' -import Agent from'./agent' -import MockClient from'./mock-client' -import MockPool from'./mock-pool' -import MockAgent from'./mock-agent' -import mockErrors from'./mock-errors' -import ProxyAgent from'./proxy-agent' -import EnvHttpProxyAgent from './env-http-proxy-agent' -import RetryHandler from'./retry-handler' -import RetryAgent from'./retry-agent' -import { request, pipeline, stream, connect, upgrade } from './api' -import interceptors from './interceptors' - -export * from './util' -export * from './cookies' -export * from './eventsource' -export * from './fetch' -export * from './file' -export * from './filereader' -export * from './formdata' -export * from './diagnostics-channel' -export * from './websocket' -export * from './content-type' -export * from './cache' -export { Interceptable } from './mock-interceptor' - -export { Dispatcher, BalancedPool, Pool, Client, buildConnector, errors, Agent, request, stream, pipeline, connect, upgrade, setGlobalDispatcher, getGlobalDispatcher, setGlobalOrigin, getGlobalOrigin, interceptors, MockClient, MockPool, MockAgent, mockErrors, ProxyAgent, EnvHttpProxyAgent, RedirectHandler, DecoratorHandler, RetryHandler, RetryAgent } -export default Undici - -declare namespace Undici { - var Dispatcher: typeof import('./dispatcher').default - var Pool: typeof import('./pool').default; - var RedirectHandler: typeof import ('./handlers').RedirectHandler - var DecoratorHandler: typeof import ('./handlers').DecoratorHandler - var RetryHandler: typeof import ('./retry-handler').default - var createRedirectInterceptor: typeof import ('./interceptors').default.createRedirectInterceptor - var BalancedPool: typeof import('./balanced-pool').default; - var Client: typeof import('./client').default; - var buildConnector: typeof import('./connector').default; - var errors: typeof import('./errors').default; - var Agent: typeof import('./agent').default; - var setGlobalDispatcher: typeof import('./global-dispatcher').setGlobalDispatcher; - var getGlobalDispatcher: typeof import('./global-dispatcher').getGlobalDispatcher; - var request: typeof import('./api').request; - var stream: typeof import('./api').stream; - var pipeline: typeof import('./api').pipeline; - var connect: typeof import('./api').connect; - var upgrade: typeof import('./api').upgrade; - var MockClient: typeof import('./mock-client').default; - var MockPool: typeof import('./mock-pool').default; - var MockAgent: typeof import('./mock-agent').default; - var mockErrors: typeof import('./mock-errors').default; - var fetch: typeof import('./fetch').fetch; - var Headers: typeof import('./fetch').Headers; - var Response: typeof import('./fetch').Response; - var Request: typeof import('./fetch').Request; - var FormData: typeof import('./formdata').FormData; - var File: typeof import('./file').File; - var FileReader: typeof import('./filereader').FileReader; - var caches: typeof import('./cache').caches; - var interceptors: typeof import('./interceptors').default; -} diff --git a/tools/mnemonic-test/node_modules/undici-types/interceptors.d.ts b/tools/mnemonic-test/node_modules/undici-types/interceptors.d.ts deleted file mode 100644 index fab6da08..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/interceptors.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import Dispatcher from "./dispatcher"; -import RetryHandler from "./retry-handler"; - -export default Interceptors; - -declare namespace Interceptors { - export type DumpInterceptorOpts = { maxSize?: number } - export type RetryInterceptorOpts = RetryHandler.RetryOptions - export type RedirectInterceptorOpts = { maxRedirections?: number } - - export function createRedirectInterceptor(opts: RedirectInterceptorOpts): Dispatcher.DispatcherComposeInterceptor - export function dump(opts?: DumpInterceptorOpts): Dispatcher.DispatcherComposeInterceptor - export function retry(opts?: RetryInterceptorOpts): Dispatcher.DispatcherComposeInterceptor - export function redirect(opts?: RedirectInterceptorOpts): Dispatcher.DispatcherComposeInterceptor -} diff --git a/tools/mnemonic-test/node_modules/undici-types/mock-agent.d.ts b/tools/mnemonic-test/node_modules/undici-types/mock-agent.d.ts deleted file mode 100644 index 98cd645b..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/mock-agent.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -import Agent from './agent' -import Dispatcher from './dispatcher' -import { Interceptable, MockInterceptor } from './mock-interceptor' -import MockDispatch = MockInterceptor.MockDispatch; - -export default MockAgent - -interface PendingInterceptor extends MockDispatch { - origin: string; -} - -/** A mocked Agent class that implements the Agent API. It allows one to intercept HTTP requests made through undici and return mocked responses instead. */ -declare class MockAgent extends Dispatcher { - constructor(options?: MockAgent.Options) - /** Creates and retrieves mock Dispatcher instances which can then be used to intercept HTTP requests. If the number of connections on the mock agent is set to 1, a MockClient instance is returned. Otherwise a MockPool instance is returned. */ - get(origin: string): TInterceptable; - get(origin: RegExp): TInterceptable; - get(origin: ((origin: string) => boolean)): TInterceptable; - /** Dispatches a mocked request. */ - dispatch(options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandlers): boolean; - /** Closes the mock agent and waits for registered mock pools and clients to also close before resolving. */ - close(): Promise; - /** Disables mocking in MockAgent. */ - deactivate(): void; - /** Enables mocking in a MockAgent instance. When instantiated, a MockAgent is automatically activated. Therefore, this method is only effective after `MockAgent.deactivate` has been called. */ - activate(): void; - /** Define host matchers so only matching requests that aren't intercepted by the mock dispatchers will be attempted. */ - enableNetConnect(): void; - enableNetConnect(host: string): void; - enableNetConnect(host: RegExp): void; - enableNetConnect(host: ((host: string) => boolean)): void; - /** Causes all requests to throw when requests are not matched in a MockAgent intercept. */ - disableNetConnect(): void; - pendingInterceptors(): PendingInterceptor[]; - assertNoPendingInterceptors(options?: { - pendingInterceptorsFormatter?: PendingInterceptorsFormatter; - }): void; -} - -interface PendingInterceptorsFormatter { - format(pendingInterceptors: readonly PendingInterceptor[]): string; -} - -declare namespace MockAgent { - /** MockAgent options. */ - export interface Options extends Agent.Options { - /** A custom agent to be encapsulated by the MockAgent. */ - agent?: Agent; - } -} diff --git a/tools/mnemonic-test/node_modules/undici-types/mock-client.d.ts b/tools/mnemonic-test/node_modules/undici-types/mock-client.d.ts deleted file mode 100644 index 51d008cc..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/mock-client.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import Client from './client' -import Dispatcher from './dispatcher' -import MockAgent from './mock-agent' -import { MockInterceptor, Interceptable } from './mock-interceptor' - -export default MockClient - -/** MockClient extends the Client API and allows one to mock requests. */ -declare class MockClient extends Client implements Interceptable { - constructor(origin: string, options: MockClient.Options); - /** Intercepts any matching requests that use the same origin as this mock client. */ - intercept(options: MockInterceptor.Options): MockInterceptor; - /** Dispatches a mocked request. */ - dispatch(options: Dispatcher.DispatchOptions, handlers: Dispatcher.DispatchHandlers): boolean; - /** Closes the mock client and gracefully waits for enqueued requests to complete. */ - close(): Promise; -} - -declare namespace MockClient { - /** MockClient options. */ - export interface Options extends Client.Options { - /** The agent to associate this MockClient with. */ - agent: MockAgent; - } -} diff --git a/tools/mnemonic-test/node_modules/undici-types/mock-errors.d.ts b/tools/mnemonic-test/node_modules/undici-types/mock-errors.d.ts deleted file mode 100644 index 3d9e727d..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/mock-errors.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import Errors from './errors' - -export default MockErrors - -declare namespace MockErrors { - /** The request does not match any registered mock dispatches. */ - export class MockNotMatchedError extends Errors.UndiciError { - constructor(message?: string); - name: 'MockNotMatchedError'; - code: 'UND_MOCK_ERR_MOCK_NOT_MATCHED'; - } -} diff --git a/tools/mnemonic-test/node_modules/undici-types/mock-interceptor.d.ts b/tools/mnemonic-test/node_modules/undici-types/mock-interceptor.d.ts deleted file mode 100644 index 33f3f14d..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/mock-interceptor.d.ts +++ /dev/null @@ -1,93 +0,0 @@ -import { IncomingHttpHeaders } from './header' -import Dispatcher from './dispatcher'; -import { BodyInit, Headers } from './fetch' - -export { - Interceptable, - MockInterceptor, - MockScope -} - -/** The scope associated with a mock dispatch. */ -declare class MockScope { - constructor(mockDispatch: MockInterceptor.MockDispatch); - /** Delay a reply by a set amount of time in ms. */ - delay(waitInMs: number): MockScope; - /** Persist the defined mock data for the associated reply. It will return the defined mock data indefinitely. */ - persist(): MockScope; - /** Define a reply for a set amount of matching requests. */ - times(repeatTimes: number): MockScope; -} - -/** The interceptor for a Mock. */ -declare class MockInterceptor { - constructor(options: MockInterceptor.Options, mockDispatches: MockInterceptor.MockDispatch[]); - /** Mock an undici request with the defined reply. */ - reply(replyOptionsCallback: MockInterceptor.MockReplyOptionsCallback): MockScope; - reply( - statusCode: number, - data?: TData | Buffer | string | MockInterceptor.MockResponseDataHandler, - responseOptions?: MockInterceptor.MockResponseOptions - ): MockScope; - /** Mock an undici request by throwing the defined reply error. */ - replyWithError(error: TError): MockScope; - /** Set default reply headers on the interceptor for subsequent mocked replies. */ - defaultReplyHeaders(headers: IncomingHttpHeaders): MockInterceptor; - /** Set default reply trailers on the interceptor for subsequent mocked replies. */ - defaultReplyTrailers(trailers: Record): MockInterceptor; - /** Set automatically calculated content-length header on subsequent mocked replies. */ - replyContentLength(): MockInterceptor; -} - -declare namespace MockInterceptor { - /** MockInterceptor options. */ - export interface Options { - /** Path to intercept on. */ - path: string | RegExp | ((path: string) => boolean); - /** Method to intercept on. Defaults to GET. */ - method?: string | RegExp | ((method: string) => boolean); - /** Body to intercept on. */ - body?: string | RegExp | ((body: string) => boolean); - /** Headers to intercept on. */ - headers?: Record boolean)> | ((headers: Record) => boolean); - /** Query params to intercept on */ - query?: Record; - } - export interface MockDispatch extends Options { - times: number | null; - persist: boolean; - consumed: boolean; - data: MockDispatchData; - } - export interface MockDispatchData extends MockResponseOptions { - error: TError | null; - statusCode?: number; - data?: TData | string; - } - export interface MockResponseOptions { - headers?: IncomingHttpHeaders; - trailers?: Record; - } - - export interface MockResponseCallbackOptions { - path: string; - method: string; - headers?: Headers | Record; - origin?: string; - body?: BodyInit | Dispatcher.DispatchOptions['body'] | null; - maxRedirections?: number; - } - - export type MockResponseDataHandler = ( - opts: MockResponseCallbackOptions - ) => TData | Buffer | string; - - export type MockReplyOptionsCallback = ( - opts: MockResponseCallbackOptions - ) => { statusCode: number, data?: TData | Buffer | string, responseOptions?: MockResponseOptions } -} - -interface Interceptable extends Dispatcher { - /** Intercepts any matching requests that use the same origin as this mock client. */ - intercept(options: MockInterceptor.Options): MockInterceptor; -} diff --git a/tools/mnemonic-test/node_modules/undici-types/mock-pool.d.ts b/tools/mnemonic-test/node_modules/undici-types/mock-pool.d.ts deleted file mode 100644 index 39e709aa..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/mock-pool.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import Pool from './pool' -import MockAgent from './mock-agent' -import { Interceptable, MockInterceptor } from './mock-interceptor' -import Dispatcher from './dispatcher' - -export default MockPool - -/** MockPool extends the Pool API and allows one to mock requests. */ -declare class MockPool extends Pool implements Interceptable { - constructor(origin: string, options: MockPool.Options); - /** Intercepts any matching requests that use the same origin as this mock pool. */ - intercept(options: MockInterceptor.Options): MockInterceptor; - /** Dispatches a mocked request. */ - dispatch(options: Dispatcher.DispatchOptions, handlers: Dispatcher.DispatchHandlers): boolean; - /** Closes the mock pool and gracefully waits for enqueued requests to complete. */ - close(): Promise; -} - -declare namespace MockPool { - /** MockPool options. */ - export interface Options extends Pool.Options { - /** The agent to associate this MockPool with. */ - agent: MockAgent; - } -} diff --git a/tools/mnemonic-test/node_modules/undici-types/package.json b/tools/mnemonic-test/node_modules/undici-types/package.json deleted file mode 100644 index 4010eee6..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "undici-types", - "version": "6.19.8", - "description": "A stand-alone types package for Undici", - "homepage": "https://undici.nodejs.org", - "bugs": { - "url": "https://github.com/nodejs/undici/issues" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/nodejs/undici.git" - }, - "license": "MIT", - "types": "index.d.ts", - "files": [ - "*.d.ts" - ], - "contributors": [ - { - "name": "Daniele Belardi", - "url": "https://github.com/dnlup", - "author": true - }, - { - "name": "Ethan Arrowood", - "url": "https://github.com/ethan-arrowood", - "author": true - }, - { - "name": "Matteo Collina", - "url": "https://github.com/mcollina", - "author": true - }, - { - "name": "Matthew Aitken", - "url": "https://github.com/KhafraDev", - "author": true - }, - { - "name": "Robert Nagy", - "url": "https://github.com/ronag", - "author": true - }, - { - "name": "Szymon Marczak", - "url": "https://github.com/szmarczak", - "author": true - }, - { - "name": "Tomas Della Vedova", - "url": "https://github.com/delvedor", - "author": true - } - ] -} \ No newline at end of file diff --git a/tools/mnemonic-test/node_modules/undici-types/patch.d.ts b/tools/mnemonic-test/node_modules/undici-types/patch.d.ts deleted file mode 100644 index 3871acfe..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/patch.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -/// - -// See https://github.com/nodejs/undici/issues/1740 - -export type DOMException = typeof globalThis extends { DOMException: infer T } - ? T - : any - -export type EventTarget = typeof globalThis extends { EventTarget: infer T } - ? T - : { - addEventListener( - type: string, - listener: any, - options?: any, - ): void - dispatchEvent(event: Event): boolean - removeEventListener( - type: string, - listener: any, - options?: any | boolean, - ): void - } - -export type Event = typeof globalThis extends { Event: infer T } - ? T - : { - readonly bubbles: boolean - cancelBubble: () => void - readonly cancelable: boolean - readonly composed: boolean - composedPath(): [EventTarget?] - readonly currentTarget: EventTarget | null - readonly defaultPrevented: boolean - readonly eventPhase: 0 | 2 - readonly isTrusted: boolean - preventDefault(): void - returnValue: boolean - readonly srcElement: EventTarget | null - stopImmediatePropagation(): void - stopPropagation(): void - readonly target: EventTarget | null - readonly timeStamp: number - readonly type: string - } - -export interface EventInit { - bubbles?: boolean - cancelable?: boolean - composed?: boolean -} - -export interface EventListenerOptions { - capture?: boolean -} - -export interface AddEventListenerOptions extends EventListenerOptions { - once?: boolean - passive?: boolean - signal?: AbortSignal -} - -export type EventListenerOrEventListenerObject = EventListener | EventListenerObject - -export interface EventListenerObject { - handleEvent (object: Event): void -} - -export interface EventListener { - (evt: Event): void -} diff --git a/tools/mnemonic-test/node_modules/undici-types/pool-stats.d.ts b/tools/mnemonic-test/node_modules/undici-types/pool-stats.d.ts deleted file mode 100644 index 8b6d2bff..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/pool-stats.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import Pool from "./pool" - -export default PoolStats - -declare class PoolStats { - constructor(pool: Pool); - /** Number of open socket connections in this pool. */ - connected: number; - /** Number of open socket connections in this pool that do not have an active request. */ - free: number; - /** Number of pending requests across all clients in this pool. */ - pending: number; - /** Number of queued requests across all clients in this pool. */ - queued: number; - /** Number of currently active requests across all clients in this pool. */ - running: number; - /** Number of active, pending, or queued requests across all clients in this pool. */ - size: number; -} diff --git a/tools/mnemonic-test/node_modules/undici-types/pool.d.ts b/tools/mnemonic-test/node_modules/undici-types/pool.d.ts deleted file mode 100644 index bad5ba03..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/pool.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -import Client from './client' -import TPoolStats from './pool-stats' -import { URL } from 'url' -import Dispatcher from "./dispatcher"; - -export default Pool - -type PoolConnectOptions = Omit; - -declare class Pool extends Dispatcher { - constructor(url: string | URL, options?: Pool.Options) - /** `true` after `pool.close()` has been called. */ - closed: boolean; - /** `true` after `pool.destroyed()` has been called or `pool.close()` has been called and the pool shutdown has completed. */ - destroyed: boolean; - /** Aggregate stats for a Pool. */ - readonly stats: TPoolStats; - - // Override dispatcher APIs. - override connect( - options: PoolConnectOptions - ): Promise; - override connect( - options: PoolConnectOptions, - callback: (err: Error | null, data: Dispatcher.ConnectData) => void - ): void; -} - -declare namespace Pool { - export type PoolStats = TPoolStats; - export interface Options extends Client.Options { - /** Default: `(origin, opts) => new Client(origin, opts)`. */ - factory?(origin: URL, opts: object): Dispatcher; - /** The max number of clients to create. `null` if no limit. Default `null`. */ - connections?: number | null; - - interceptors?: { Pool?: readonly Dispatcher.DispatchInterceptor[] } & Client.Options["interceptors"] - } -} diff --git a/tools/mnemonic-test/node_modules/undici-types/proxy-agent.d.ts b/tools/mnemonic-test/node_modules/undici-types/proxy-agent.d.ts deleted file mode 100644 index 32e3acbd..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/proxy-agent.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import Agent from './agent' -import buildConnector from './connector'; -import Dispatcher from './dispatcher' -import { IncomingHttpHeaders } from './header' - -export default ProxyAgent - -declare class ProxyAgent extends Dispatcher { - constructor(options: ProxyAgent.Options | string) - - dispatch(options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandlers): boolean; - close(): Promise; -} - -declare namespace ProxyAgent { - export interface Options extends Agent.Options { - uri: string; - /** - * @deprecated use opts.token - */ - auth?: string; - token?: string; - headers?: IncomingHttpHeaders; - requestTls?: buildConnector.BuildOptions; - proxyTls?: buildConnector.BuildOptions; - clientFactory?(origin: URL, opts: object): Dispatcher; - } -} diff --git a/tools/mnemonic-test/node_modules/undici-types/readable.d.ts b/tools/mnemonic-test/node_modules/undici-types/readable.d.ts deleted file mode 100644 index a5fce8a2..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/readable.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { Readable } from "stream"; -import { Blob } from 'buffer' - -export default BodyReadable - -declare class BodyReadable extends Readable { - constructor( - resume?: (this: Readable, size: number) => void | null, - abort?: () => void | null, - contentType?: string - ) - - /** Consumes and returns the body as a string - * https://fetch.spec.whatwg.org/#dom-body-text - */ - text(): Promise - - /** Consumes and returns the body as a JavaScript Object - * https://fetch.spec.whatwg.org/#dom-body-json - */ - json(): Promise - - /** Consumes and returns the body as a Blob - * https://fetch.spec.whatwg.org/#dom-body-blob - */ - blob(): Promise - - /** Consumes and returns the body as an ArrayBuffer - * https://fetch.spec.whatwg.org/#dom-body-arraybuffer - */ - arrayBuffer(): Promise - - /** Not implemented - * - * https://fetch.spec.whatwg.org/#dom-body-formdata - */ - formData(): Promise - - /** Returns true if the body is not null and the body has been consumed - * - * Otherwise, returns false - * - * https://fetch.spec.whatwg.org/#dom-body-bodyused - */ - readonly bodyUsed: boolean - - /** - * If body is null, it should return null as the body - * - * If body is not null, should return the body as a ReadableStream - * - * https://fetch.spec.whatwg.org/#dom-body-body - */ - readonly body: never | undefined - - /** Dumps the response body by reading `limit` number of bytes. - * @param opts.limit Number of bytes to read (optional) - Default: 262144 - */ - dump(opts?: { limit: number }): Promise -} diff --git a/tools/mnemonic-test/node_modules/undici-types/retry-agent.d.ts b/tools/mnemonic-test/node_modules/undici-types/retry-agent.d.ts deleted file mode 100644 index 963cea99..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/retry-agent.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import Dispatcher from './dispatcher' -import RetryHandler from './retry-handler' - -export default RetryAgent - -declare class RetryAgent extends Dispatcher { - constructor(dispatcher: Dispatcher, options?: RetryHandler.RetryOptions) -} diff --git a/tools/mnemonic-test/node_modules/undici-types/retry-handler.d.ts b/tools/mnemonic-test/node_modules/undici-types/retry-handler.d.ts deleted file mode 100644 index e44b207c..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/retry-handler.d.ts +++ /dev/null @@ -1,116 +0,0 @@ -import Dispatcher from "./dispatcher"; - -export default RetryHandler; - -declare class RetryHandler implements Dispatcher.DispatchHandlers { - constructor( - options: Dispatcher.DispatchOptions & { - retryOptions?: RetryHandler.RetryOptions; - }, - retryHandlers: RetryHandler.RetryHandlers - ); -} - -declare namespace RetryHandler { - export type RetryState = { counter: number; }; - - export type RetryContext = { - state: RetryState; - opts: Dispatcher.DispatchOptions & { - retryOptions?: RetryHandler.RetryOptions; - }; - } - - export type OnRetryCallback = (result?: Error | null) => void; - - export type RetryCallback = ( - err: Error, - context: { - state: RetryState; - opts: Dispatcher.DispatchOptions & { - retryOptions?: RetryHandler.RetryOptions; - }; - }, - callback: OnRetryCallback - ) => number | null; - - export interface RetryOptions { - /** - * Callback to be invoked on every retry iteration. - * It receives the error, current state of the retry object and the options object - * passed when instantiating the retry handler. - * - * @type {RetryCallback} - * @memberof RetryOptions - */ - retry?: RetryCallback; - /** - * Maximum number of retries to allow. - * - * @type {number} - * @memberof RetryOptions - * @default 5 - */ - maxRetries?: number; - /** - * Max number of milliseconds allow between retries - * - * @type {number} - * @memberof RetryOptions - * @default 30000 - */ - maxTimeout?: number; - /** - * Initial number of milliseconds to wait before retrying for the first time. - * - * @type {number} - * @memberof RetryOptions - * @default 500 - */ - minTimeout?: number; - /** - * Factior to multiply the timeout factor between retries. - * - * @type {number} - * @memberof RetryOptions - * @default 2 - */ - timeoutFactor?: number; - /** - * It enables to automatically infer timeout between retries based on the `Retry-After` header. - * - * @type {boolean} - * @memberof RetryOptions - * @default true - */ - retryAfter?: boolean; - /** - * HTTP methods to retry. - * - * @type {Dispatcher.HttpMethod[]} - * @memberof RetryOptions - * @default ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'], - */ - methods?: Dispatcher.HttpMethod[]; - /** - * Error codes to be retried. e.g. `ECONNRESET`, `ENOTFOUND`, `ETIMEDOUT`, `ECONNREFUSED`, etc. - * - * @type {string[]} - * @default ['ECONNRESET','ECONNREFUSED','ENOTFOUND','ENETDOWN','ENETUNREACH','EHOSTDOWN','EHOSTUNREACH','EPIPE'] - */ - errorCodes?: string[]; - /** - * HTTP status codes to be retried. - * - * @type {number[]} - * @memberof RetryOptions - * @default [500, 502, 503, 504, 429], - */ - statusCodes?: number[]; - } - - export interface RetryHandlers { - dispatch: Dispatcher["dispatch"]; - handler: Dispatcher.DispatchHandlers; - } -} diff --git a/tools/mnemonic-test/node_modules/undici-types/util.d.ts b/tools/mnemonic-test/node_modules/undici-types/util.d.ts deleted file mode 100644 index 77cf1473..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/util.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -export namespace util { - /** - * Retrieves a header name and returns its lowercase value. - * @param value Header name - */ - export function headerNameToString(value: string | Buffer): string; - - /** - * Receives a header object and returns the parsed value. - * @param headers Header object - * @param obj Object to specify a proxy object. Used to assign parsed values. - * @returns If `obj` is specified, it is equivalent to `obj`. - */ - export function parseHeaders( - headers: (Buffer | string | (Buffer | string)[])[], - obj?: Record - ): Record; -} diff --git a/tools/mnemonic-test/node_modules/undici-types/webidl.d.ts b/tools/mnemonic-test/node_modules/undici-types/webidl.d.ts deleted file mode 100644 index 8a23a85b..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/webidl.d.ts +++ /dev/null @@ -1,222 +0,0 @@ -// These types are not exported, and are only used internally - -/** - * Take in an unknown value and return one that is of type T - */ -type Converter = (object: unknown) => T - -type SequenceConverter = (object: unknown, iterable?: IterableIterator) => T[] - -type RecordConverter = (object: unknown) => Record - -interface ConvertToIntOpts { - clamp?: boolean - enforceRange?: boolean -} - -interface WebidlErrors { - exception (opts: { header: string, message: string }): TypeError - /** - * @description Throw an error when conversion from one type to another has failed - */ - conversionFailed (opts: { - prefix: string - argument: string - types: string[] - }): TypeError - /** - * @description Throw an error when an invalid argument is provided - */ - invalidArgument (opts: { - prefix: string - value: string - type: string - }): TypeError -} - -interface WebidlUtil { - /** - * @see https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values - */ - Type (object: unknown): - | 'Undefined' - | 'Boolean' - | 'String' - | 'Symbol' - | 'Number' - | 'BigInt' - | 'Null' - | 'Object' - - /** - * @see https://webidl.spec.whatwg.org/#abstract-opdef-converttoint - */ - ConvertToInt ( - V: unknown, - bitLength: number, - signedness: 'signed' | 'unsigned', - opts?: ConvertToIntOpts - ): number - - /** - * @see https://webidl.spec.whatwg.org/#abstract-opdef-converttoint - */ - IntegerPart (N: number): number - - /** - * Stringifies {@param V} - */ - Stringify (V: any): string -} - -interface WebidlConverters { - /** - * @see https://webidl.spec.whatwg.org/#es-DOMString - */ - DOMString (V: unknown, prefix: string, argument: string, opts?: { - legacyNullToEmptyString: boolean - }): string - - /** - * @see https://webidl.spec.whatwg.org/#es-ByteString - */ - ByteString (V: unknown, prefix: string, argument: string): string - - /** - * @see https://webidl.spec.whatwg.org/#es-USVString - */ - USVString (V: unknown): string - - /** - * @see https://webidl.spec.whatwg.org/#es-boolean - */ - boolean (V: unknown): boolean - - /** - * @see https://webidl.spec.whatwg.org/#es-any - */ - any (V: Value): Value - - /** - * @see https://webidl.spec.whatwg.org/#es-long-long - */ - ['long long'] (V: unknown): number - - /** - * @see https://webidl.spec.whatwg.org/#es-unsigned-long-long - */ - ['unsigned long long'] (V: unknown): number - - /** - * @see https://webidl.spec.whatwg.org/#es-unsigned-long - */ - ['unsigned long'] (V: unknown): number - - /** - * @see https://webidl.spec.whatwg.org/#es-unsigned-short - */ - ['unsigned short'] (V: unknown, opts?: ConvertToIntOpts): number - - /** - * @see https://webidl.spec.whatwg.org/#idl-ArrayBuffer - */ - ArrayBuffer (V: unknown): ArrayBufferLike - ArrayBuffer (V: unknown, opts: { allowShared: false }): ArrayBuffer - - /** - * @see https://webidl.spec.whatwg.org/#es-buffer-source-types - */ - TypedArray ( - V: unknown, - TypedArray: NodeJS.TypedArray | ArrayBufferLike - ): NodeJS.TypedArray | ArrayBufferLike - TypedArray ( - V: unknown, - TypedArray: NodeJS.TypedArray | ArrayBufferLike, - opts?: { allowShared: false } - ): NodeJS.TypedArray | ArrayBuffer - - /** - * @see https://webidl.spec.whatwg.org/#es-buffer-source-types - */ - DataView (V: unknown, opts?: { allowShared: boolean }): DataView - - /** - * @see https://webidl.spec.whatwg.org/#BufferSource - */ - BufferSource ( - V: unknown, - opts?: { allowShared: boolean } - ): NodeJS.TypedArray | ArrayBufferLike | DataView - - ['sequence']: SequenceConverter - - ['sequence>']: SequenceConverter - - ['record']: RecordConverter - - [Key: string]: (...args: any[]) => unknown -} - -export interface Webidl { - errors: WebidlErrors - util: WebidlUtil - converters: WebidlConverters - - /** - * @description Performs a brand-check on {@param V} to ensure it is a - * {@param cls} object. - */ - brandCheck (V: unknown, cls: Interface, opts?: { strict?: boolean }): asserts V is Interface - - /** - * @see https://webidl.spec.whatwg.org/#es-sequence - * @description Convert a value, V, to a WebIDL sequence type. - */ - sequenceConverter (C: Converter): SequenceConverter - - illegalConstructor (): never - - /** - * @see https://webidl.spec.whatwg.org/#es-to-record - * @description Convert a value, V, to a WebIDL record type. - */ - recordConverter ( - keyConverter: Converter, - valueConverter: Converter - ): RecordConverter - - /** - * Similar to {@link Webidl.brandCheck} but allows skipping the check if third party - * interfaces are allowed. - */ - interfaceConverter (cls: Interface): ( - V: unknown, - opts?: { strict: boolean } - ) => asserts V is typeof cls - - // TODO(@KhafraDev): a type could likely be implemented that can infer the return type - // from the converters given? - /** - * Converts a value, V, to a WebIDL dictionary types. Allows limiting which keys are - * allowed, values allowed, optional and required keys. Auto converts the value to - * a type given a converter. - */ - dictionaryConverter (converters: { - key: string, - defaultValue?: () => unknown, - required?: boolean, - converter: (...args: unknown[]) => unknown, - allowedValues?: unknown[] - }[]): (V: unknown) => Record - - /** - * @see https://webidl.spec.whatwg.org/#idl-nullable-type - * @description allows a type, V, to be null - */ - nullableConverter ( - converter: Converter - ): (V: unknown) => ReturnType | null - - argumentLengthCheck (args: { length: number }, min: number, context: string): void -} diff --git a/tools/mnemonic-test/node_modules/undici-types/websocket.d.ts b/tools/mnemonic-test/node_modules/undici-types/websocket.d.ts deleted file mode 100644 index d1be4523..00000000 --- a/tools/mnemonic-test/node_modules/undici-types/websocket.d.ts +++ /dev/null @@ -1,152 +0,0 @@ -/// - -import type { Blob } from 'buffer' -import type { MessagePort } from 'worker_threads' -import { - EventTarget, - Event, - EventInit, - EventListenerOptions, - AddEventListenerOptions, - EventListenerOrEventListenerObject -} from './patch' -import Dispatcher from './dispatcher' -import { HeadersInit } from './fetch' - -export type BinaryType = 'blob' | 'arraybuffer' - -interface WebSocketEventMap { - close: CloseEvent - error: ErrorEvent - message: MessageEvent - open: Event -} - -interface WebSocket extends EventTarget { - binaryType: BinaryType - - readonly bufferedAmount: number - readonly extensions: string - - onclose: ((this: WebSocket, ev: WebSocketEventMap['close']) => any) | null - onerror: ((this: WebSocket, ev: WebSocketEventMap['error']) => any) | null - onmessage: ((this: WebSocket, ev: WebSocketEventMap['message']) => any) | null - onopen: ((this: WebSocket, ev: WebSocketEventMap['open']) => any) | null - - readonly protocol: string - readonly readyState: number - readonly url: string - - close(code?: number, reason?: string): void - send(data: string | ArrayBufferLike | Blob | ArrayBufferView): void - - readonly CLOSED: number - readonly CLOSING: number - readonly CONNECTING: number - readonly OPEN: number - - addEventListener( - type: K, - listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, - options?: boolean | AddEventListenerOptions - ): void - addEventListener( - type: string, - listener: EventListenerOrEventListenerObject, - options?: boolean | AddEventListenerOptions - ): void - removeEventListener( - type: K, - listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, - options?: boolean | EventListenerOptions - ): void - removeEventListener( - type: string, - listener: EventListenerOrEventListenerObject, - options?: boolean | EventListenerOptions - ): void -} - -export declare const WebSocket: { - prototype: WebSocket - new (url: string | URL, protocols?: string | string[] | WebSocketInit): WebSocket - readonly CLOSED: number - readonly CLOSING: number - readonly CONNECTING: number - readonly OPEN: number -} - -interface CloseEventInit extends EventInit { - code?: number - reason?: string - wasClean?: boolean -} - -interface CloseEvent extends Event { - readonly code: number - readonly reason: string - readonly wasClean: boolean -} - -export declare const CloseEvent: { - prototype: CloseEvent - new (type: string, eventInitDict?: CloseEventInit): CloseEvent -} - -interface MessageEventInit extends EventInit { - data?: T - lastEventId?: string - origin?: string - ports?: (typeof MessagePort)[] - source?: typeof MessagePort | null -} - -interface MessageEvent extends Event { - readonly data: T - readonly lastEventId: string - readonly origin: string - readonly ports: ReadonlyArray - readonly source: typeof MessagePort | null - initMessageEvent( - type: string, - bubbles?: boolean, - cancelable?: boolean, - data?: any, - origin?: string, - lastEventId?: string, - source?: typeof MessagePort | null, - ports?: (typeof MessagePort)[] - ): void; -} - -export declare const MessageEvent: { - prototype: MessageEvent - new(type: string, eventInitDict?: MessageEventInit): MessageEvent -} - -interface ErrorEventInit extends EventInit { - message?: string - filename?: string - lineno?: number - colno?: number - error?: any -} - -interface ErrorEvent extends Event { - readonly message: string - readonly filename: string - readonly lineno: number - readonly colno: number - readonly error: any -} - -export declare const ErrorEvent: { - prototype: ErrorEvent - new (type: string, eventInitDict?: ErrorEventInit): ErrorEvent -} - -interface WebSocketInit { - protocols?: string | string[], - dispatcher?: Dispatcher, - headers?: HeadersInit -} diff --git a/tools/mnemonic-test/node_modules/ws/LICENSE b/tools/mnemonic-test/node_modules/ws/LICENSE deleted file mode 100644 index 1da5b96a..00000000 --- a/tools/mnemonic-test/node_modules/ws/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2011 Einar Otto Stangvik -Copyright (c) 2013 Arnout Kazemier and contributors -Copyright (c) 2016 Luigi Pinca and contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/mnemonic-test/node_modules/ws/README.md b/tools/mnemonic-test/node_modules/ws/README.md deleted file mode 100644 index 21f10df1..00000000 --- a/tools/mnemonic-test/node_modules/ws/README.md +++ /dev/null @@ -1,548 +0,0 @@ -# ws: a Node.js WebSocket library - -[![Version npm](https://img.shields.io/npm/v/ws.svg?logo=npm)](https://www.npmjs.com/package/ws) -[![CI](https://img.shields.io/github/actions/workflow/status/websockets/ws/ci.yml?branch=master&label=CI&logo=github)](https://github.com/websockets/ws/actions?query=workflow%3ACI+branch%3Amaster) -[![Coverage Status](https://img.shields.io/coveralls/websockets/ws/master.svg?logo=coveralls)](https://coveralls.io/github/websockets/ws) - -ws is a simple to use, blazing fast, and thoroughly tested WebSocket client and -server implementation. - -Passes the quite extensive Autobahn test suite: [server][server-report], -[client][client-report]. - -**Note**: This module does not work in the browser. The client in the docs is a -reference to a backend with the role of a client in the WebSocket communication. -Browser clients must use the native -[`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) -object. To make the same code work seamlessly on Node.js and the browser, you -can use one of the many wrappers available on npm, like -[isomorphic-ws](https://github.com/heineiuo/isomorphic-ws). - -## Table of Contents - -- [Protocol support](#protocol-support) -- [Installing](#installing) - - [Opt-in for performance](#opt-in-for-performance) - - [Legacy opt-in for performance](#legacy-opt-in-for-performance) -- [API docs](#api-docs) -- [WebSocket compression](#websocket-compression) -- [Usage examples](#usage-examples) - - [Sending and receiving text data](#sending-and-receiving-text-data) - - [Sending binary data](#sending-binary-data) - - [Simple server](#simple-server) - - [External HTTP/S server](#external-https-server) - - [Multiple servers sharing a single HTTP/S server](#multiple-servers-sharing-a-single-https-server) - - [Client authentication](#client-authentication) - - [Server broadcast](#server-broadcast) - - [Round-trip time](#round-trip-time) - - [Use the Node.js streams API](#use-the-nodejs-streams-api) - - [Other examples](#other-examples) -- [FAQ](#faq) - - [How to get the IP address of the client?](#how-to-get-the-ip-address-of-the-client) - - [How to detect and close broken connections?](#how-to-detect-and-close-broken-connections) - - [How to connect via a proxy?](#how-to-connect-via-a-proxy) -- [Changelog](#changelog) -- [License](#license) - -## Protocol support - -- **HyBi drafts 07-12** (Use the option `protocolVersion: 8`) -- **HyBi drafts 13-17** (Current default, alternatively option - `protocolVersion: 13`) - -## Installing - -``` -npm install ws -``` - -### Opt-in for performance - -[bufferutil][] is an optional module that can be installed alongside the ws -module: - -``` -npm install --save-optional bufferutil -``` - -This is a binary addon that improves the performance of certain operations such -as masking and unmasking the data payload of the WebSocket frames. Prebuilt -binaries are available for the most popular platforms, so you don't necessarily -need to have a C++ compiler installed on your machine. - -To force ws to not use bufferutil, use the -[`WS_NO_BUFFER_UTIL`](./doc/ws.md#ws_no_buffer_util) environment variable. This -can be useful to enhance security in systems where a user can put a package in -the package search path of an application of another user, due to how the -Node.js resolver algorithm works. - -#### Legacy opt-in for performance - -If you are running on an old version of Node.js (prior to v18.14.0), ws also -supports the [utf-8-validate][] module: - -``` -npm install --save-optional utf-8-validate -``` - -This contains a binary polyfill for [`buffer.isUtf8()`][]. - -To force ws not to use utf-8-validate, use the -[`WS_NO_UTF_8_VALIDATE`](./doc/ws.md#ws_no_utf_8_validate) environment variable. - -## API docs - -See [`/doc/ws.md`](./doc/ws.md) for Node.js-like documentation of ws classes and -utility functions. - -## WebSocket compression - -ws supports the [permessage-deflate extension][permessage-deflate] which enables -the client and server to negotiate a compression algorithm and its parameters, -and then selectively apply it to the data payloads of each WebSocket message. - -The extension is disabled by default on the server and enabled by default on the -client. It adds a significant overhead in terms of performance and memory -consumption so we suggest to enable it only if it is really needed. - -Note that Node.js has a variety of issues with high-performance compression, -where increased concurrency, especially on Linux, can lead to [catastrophic -memory fragmentation][node-zlib-bug] and slow performance. If you intend to use -permessage-deflate in production, it is worthwhile to set up a test -representative of your workload and ensure Node.js/zlib will handle it with -acceptable performance and memory usage. - -Tuning of permessage-deflate can be done via the options defined below. You can -also use `zlibDeflateOptions` and `zlibInflateOptions`, which is passed directly -into the creation of [raw deflate/inflate streams][node-zlib-deflaterawdocs]. - -See [the docs][ws-server-options] for more options. - -```js -import WebSocket, { WebSocketServer } from 'ws'; - -const wss = new WebSocketServer({ - port: 8080, - perMessageDeflate: { - zlibDeflateOptions: { - // See zlib defaults. - chunkSize: 1024, - memLevel: 7, - level: 3 - }, - zlibInflateOptions: { - chunkSize: 10 * 1024 - }, - // Other options settable: - clientNoContextTakeover: true, // Defaults to negotiated value. - serverNoContextTakeover: true, // Defaults to negotiated value. - serverMaxWindowBits: 10, // Defaults to negotiated value. - // Below options specified as default values. - concurrencyLimit: 10, // Limits zlib concurrency for perf. - threshold: 1024 // Size (in bytes) below which messages - // should not be compressed if context takeover is disabled. - } -}); -``` - -The client will only use the extension if it is supported and enabled on the -server. To always disable the extension on the client, set the -`perMessageDeflate` option to `false`. - -```js -import WebSocket from 'ws'; - -const ws = new WebSocket('ws://www.host.com/path', { - perMessageDeflate: false -}); -``` - -## Usage examples - -### Sending and receiving text data - -```js -import WebSocket from 'ws'; - -const ws = new WebSocket('ws://www.host.com/path'); - -ws.on('error', console.error); - -ws.on('open', function open() { - ws.send('something'); -}); - -ws.on('message', function message(data) { - console.log('received: %s', data); -}); -``` - -### Sending binary data - -```js -import WebSocket from 'ws'; - -const ws = new WebSocket('ws://www.host.com/path'); - -ws.on('error', console.error); - -ws.on('open', function open() { - const array = new Float32Array(5); - - for (var i = 0; i < array.length; ++i) { - array[i] = i / 2; - } - - ws.send(array); -}); -``` - -### Simple server - -```js -import { WebSocketServer } from 'ws'; - -const wss = new WebSocketServer({ port: 8080 }); - -wss.on('connection', function connection(ws) { - ws.on('error', console.error); - - ws.on('message', function message(data) { - console.log('received: %s', data); - }); - - ws.send('something'); -}); -``` - -### External HTTP/S server - -```js -import { createServer } from 'https'; -import { readFileSync } from 'fs'; -import { WebSocketServer } from 'ws'; - -const server = createServer({ - cert: readFileSync('/path/to/cert.pem'), - key: readFileSync('/path/to/key.pem') -}); -const wss = new WebSocketServer({ server }); - -wss.on('connection', function connection(ws) { - ws.on('error', console.error); - - ws.on('message', function message(data) { - console.log('received: %s', data); - }); - - ws.send('something'); -}); - -server.listen(8080); -``` - -### Multiple servers sharing a single HTTP/S server - -```js -import { createServer } from 'http'; -import { WebSocketServer } from 'ws'; - -const server = createServer(); -const wss1 = new WebSocketServer({ noServer: true }); -const wss2 = new WebSocketServer({ noServer: true }); - -wss1.on('connection', function connection(ws) { - ws.on('error', console.error); - - // ... -}); - -wss2.on('connection', function connection(ws) { - ws.on('error', console.error); - - // ... -}); - -server.on('upgrade', function upgrade(request, socket, head) { - const { pathname } = new URL(request.url, 'wss://base.url'); - - if (pathname === '/foo') { - wss1.handleUpgrade(request, socket, head, function done(ws) { - wss1.emit('connection', ws, request); - }); - } else if (pathname === '/bar') { - wss2.handleUpgrade(request, socket, head, function done(ws) { - wss2.emit('connection', ws, request); - }); - } else { - socket.destroy(); - } -}); - -server.listen(8080); -``` - -### Client authentication - -```js -import { createServer } from 'http'; -import { WebSocketServer } from 'ws'; - -function onSocketError(err) { - console.error(err); -} - -const server = createServer(); -const wss = new WebSocketServer({ noServer: true }); - -wss.on('connection', function connection(ws, request, client) { - ws.on('error', console.error); - - ws.on('message', function message(data) { - console.log(`Received message ${data} from user ${client}`); - }); -}); - -server.on('upgrade', function upgrade(request, socket, head) { - socket.on('error', onSocketError); - - // This function is not defined on purpose. Implement it with your own logic. - authenticate(request, function next(err, client) { - if (err || !client) { - socket.write('HTTP/1.1 401 Unauthorized\r\n\r\n'); - socket.destroy(); - return; - } - - socket.removeListener('error', onSocketError); - - wss.handleUpgrade(request, socket, head, function done(ws) { - wss.emit('connection', ws, request, client); - }); - }); -}); - -server.listen(8080); -``` - -Also see the provided [example][session-parse-example] using `express-session`. - -### Server broadcast - -A client WebSocket broadcasting to all connected WebSocket clients, including -itself. - -```js -import WebSocket, { WebSocketServer } from 'ws'; - -const wss = new WebSocketServer({ port: 8080 }); - -wss.on('connection', function connection(ws) { - ws.on('error', console.error); - - ws.on('message', function message(data, isBinary) { - wss.clients.forEach(function each(client) { - if (client.readyState === WebSocket.OPEN) { - client.send(data, { binary: isBinary }); - } - }); - }); -}); -``` - -A client WebSocket broadcasting to every other connected WebSocket clients, -excluding itself. - -```js -import WebSocket, { WebSocketServer } from 'ws'; - -const wss = new WebSocketServer({ port: 8080 }); - -wss.on('connection', function connection(ws) { - ws.on('error', console.error); - - ws.on('message', function message(data, isBinary) { - wss.clients.forEach(function each(client) { - if (client !== ws && client.readyState === WebSocket.OPEN) { - client.send(data, { binary: isBinary }); - } - }); - }); -}); -``` - -### Round-trip time - -```js -import WebSocket from 'ws'; - -const ws = new WebSocket('wss://websocket-echo.com/'); - -ws.on('error', console.error); - -ws.on('open', function open() { - console.log('connected'); - ws.send(Date.now()); -}); - -ws.on('close', function close() { - console.log('disconnected'); -}); - -ws.on('message', function message(data) { - console.log(`Round-trip time: ${Date.now() - data} ms`); - - setTimeout(function timeout() { - ws.send(Date.now()); - }, 500); -}); -``` - -### Use the Node.js streams API - -```js -import WebSocket, { createWebSocketStream } from 'ws'; - -const ws = new WebSocket('wss://websocket-echo.com/'); - -const duplex = createWebSocketStream(ws, { encoding: 'utf8' }); - -duplex.on('error', console.error); - -duplex.pipe(process.stdout); -process.stdin.pipe(duplex); -``` - -### Other examples - -For a full example with a browser client communicating with a ws server, see the -examples folder. - -Otherwise, see the test cases. - -## FAQ - -### How to get the IP address of the client? - -The remote IP address can be obtained from the raw socket. - -```js -import { WebSocketServer } from 'ws'; - -const wss = new WebSocketServer({ port: 8080 }); - -wss.on('connection', function connection(ws, req) { - const ip = req.socket.remoteAddress; - - ws.on('error', console.error); -}); -``` - -When the server runs behind a proxy like NGINX, the de-facto standard is to use -the `X-Forwarded-For` header. - -```js -wss.on('connection', function connection(ws, req) { - const ip = req.headers['x-forwarded-for'].split(',')[0].trim(); - - ws.on('error', console.error); -}); -``` - -### How to detect and close broken connections? - -Sometimes, the link between the server and the client can be interrupted in a -way that keeps both the server and the client unaware of the broken state of the -connection (e.g. when pulling the cord). - -In these cases, ping messages can be used as a means to verify that the remote -endpoint is still responsive. - -```js -import { WebSocketServer } from 'ws'; - -function heartbeat() { - this.isAlive = true; -} - -const wss = new WebSocketServer({ port: 8080 }); - -wss.on('connection', function connection(ws) { - ws.isAlive = true; - ws.on('error', console.error); - ws.on('pong', heartbeat); -}); - -const interval = setInterval(function ping() { - wss.clients.forEach(function each(ws) { - if (ws.isAlive === false) return ws.terminate(); - - ws.isAlive = false; - ws.ping(); - }); -}, 30000); - -wss.on('close', function close() { - clearInterval(interval); -}); -``` - -Pong messages are automatically sent in response to ping messages as required by -the spec. - -Just like the server example above, your clients might as well lose connection -without knowing it. You might want to add a ping listener on your clients to -prevent that. A simple implementation would be: - -```js -import WebSocket from 'ws'; - -function heartbeat() { - clearTimeout(this.pingTimeout); - - // Use `WebSocket#terminate()`, which immediately destroys the connection, - // instead of `WebSocket#close()`, which waits for the close timer. - // Delay should be equal to the interval at which your server - // sends out pings plus a conservative assumption of the latency. - this.pingTimeout = setTimeout(() => { - this.terminate(); - }, 30000 + 1000); -} - -const client = new WebSocket('wss://websocket-echo.com/'); - -client.on('error', console.error); -client.on('open', heartbeat); -client.on('ping', heartbeat); -client.on('close', function clear() { - clearTimeout(this.pingTimeout); -}); -``` - -### How to connect via a proxy? - -Use a custom `http.Agent` implementation like [https-proxy-agent][] or -[socks-proxy-agent][]. - -## Changelog - -We're using the GitHub [releases][changelog] for changelog entries. - -## License - -[MIT](LICENSE) - -[`buffer.isutf8()`]: https://nodejs.org/api/buffer.html#bufferisutf8input -[bufferutil]: https://github.com/websockets/bufferutil -[changelog]: https://github.com/websockets/ws/releases -[client-report]: http://websockets.github.io/ws/autobahn/clients/ -[https-proxy-agent]: https://github.com/TooTallNate/node-https-proxy-agent -[node-zlib-bug]: https://github.com/nodejs/node/issues/8871 -[node-zlib-deflaterawdocs]: - https://nodejs.org/api/zlib.html#zlib_zlib_createdeflateraw_options -[permessage-deflate]: https://tools.ietf.org/html/rfc7692 -[server-report]: http://websockets.github.io/ws/autobahn/servers/ -[session-parse-example]: ./examples/express-session-parse -[socks-proxy-agent]: https://github.com/TooTallNate/node-socks-proxy-agent -[utf-8-validate]: https://github.com/websockets/utf-8-validate -[ws-server-options]: ./doc/ws.md#new-websocketserveroptions-callback diff --git a/tools/mnemonic-test/node_modules/ws/browser.js b/tools/mnemonic-test/node_modules/ws/browser.js deleted file mode 100644 index ca4f628a..00000000 --- a/tools/mnemonic-test/node_modules/ws/browser.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -module.exports = function () { - throw new Error( - 'ws does not work in the browser. Browser clients must use the native ' + - 'WebSocket object' - ); -}; diff --git a/tools/mnemonic-test/node_modules/ws/index.js b/tools/mnemonic-test/node_modules/ws/index.js deleted file mode 100644 index 41edb3b8..00000000 --- a/tools/mnemonic-test/node_modules/ws/index.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -const WebSocket = require('./lib/websocket'); - -WebSocket.createWebSocketStream = require('./lib/stream'); -WebSocket.Server = require('./lib/websocket-server'); -WebSocket.Receiver = require('./lib/receiver'); -WebSocket.Sender = require('./lib/sender'); - -WebSocket.WebSocket = WebSocket; -WebSocket.WebSocketServer = WebSocket.Server; - -module.exports = WebSocket; diff --git a/tools/mnemonic-test/node_modules/ws/lib/buffer-util.js b/tools/mnemonic-test/node_modules/ws/lib/buffer-util.js deleted file mode 100644 index f7536e28..00000000 --- a/tools/mnemonic-test/node_modules/ws/lib/buffer-util.js +++ /dev/null @@ -1,131 +0,0 @@ -'use strict'; - -const { EMPTY_BUFFER } = require('./constants'); - -const FastBuffer = Buffer[Symbol.species]; - -/** - * Merges an array of buffers into a new buffer. - * - * @param {Buffer[]} list The array of buffers to concat - * @param {Number} totalLength The total length of buffers in the list - * @return {Buffer} The resulting buffer - * @public - */ -function concat(list, totalLength) { - if (list.length === 0) return EMPTY_BUFFER; - if (list.length === 1) return list[0]; - - const target = Buffer.allocUnsafe(totalLength); - let offset = 0; - - for (let i = 0; i < list.length; i++) { - const buf = list[i]; - target.set(buf, offset); - offset += buf.length; - } - - if (offset < totalLength) { - return new FastBuffer(target.buffer, target.byteOffset, offset); - } - - return target; -} - -/** - * Masks a buffer using the given mask. - * - * @param {Buffer} source The buffer to mask - * @param {Buffer} mask The mask to use - * @param {Buffer} output The buffer where to store the result - * @param {Number} offset The offset at which to start writing - * @param {Number} length The number of bytes to mask. - * @public - */ -function _mask(source, mask, output, offset, length) { - for (let i = 0; i < length; i++) { - output[offset + i] = source[i] ^ mask[i & 3]; - } -} - -/** - * Unmasks a buffer using the given mask. - * - * @param {Buffer} buffer The buffer to unmask - * @param {Buffer} mask The mask to use - * @public - */ -function _unmask(buffer, mask) { - for (let i = 0; i < buffer.length; i++) { - buffer[i] ^= mask[i & 3]; - } -} - -/** - * Converts a buffer to an `ArrayBuffer`. - * - * @param {Buffer} buf The buffer to convert - * @return {ArrayBuffer} Converted buffer - * @public - */ -function toArrayBuffer(buf) { - if (buf.length === buf.buffer.byteLength) { - return buf.buffer; - } - - return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.length); -} - -/** - * Converts `data` to a `Buffer`. - * - * @param {*} data The data to convert - * @return {Buffer} The buffer - * @throws {TypeError} - * @public - */ -function toBuffer(data) { - toBuffer.readOnly = true; - - if (Buffer.isBuffer(data)) return data; - - let buf; - - if (data instanceof ArrayBuffer) { - buf = new FastBuffer(data); - } else if (ArrayBuffer.isView(data)) { - buf = new FastBuffer(data.buffer, data.byteOffset, data.byteLength); - } else { - buf = Buffer.from(data); - toBuffer.readOnly = false; - } - - return buf; -} - -module.exports = { - concat, - mask: _mask, - toArrayBuffer, - toBuffer, - unmask: _unmask -}; - -/* istanbul ignore else */ -if (!process.env.WS_NO_BUFFER_UTIL) { - try { - const bufferUtil = require('bufferutil'); - - module.exports.mask = function (source, mask, output, offset, length) { - if (length < 48) _mask(source, mask, output, offset, length); - else bufferUtil.mask(source, mask, output, offset, length); - }; - - module.exports.unmask = function (buffer, mask) { - if (buffer.length < 32) _unmask(buffer, mask); - else bufferUtil.unmask(buffer, mask); - }; - } catch (e) { - // Continue regardless of the error. - } -} diff --git a/tools/mnemonic-test/node_modules/ws/lib/constants.js b/tools/mnemonic-test/node_modules/ws/lib/constants.js deleted file mode 100644 index d691b30a..00000000 --- a/tools/mnemonic-test/node_modules/ws/lib/constants.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -module.exports = { - BINARY_TYPES: ['nodebuffer', 'arraybuffer', 'fragments'], - EMPTY_BUFFER: Buffer.alloc(0), - GUID: '258EAFA5-E914-47DA-95CA-C5AB0DC85B11', - kForOnEventAttribute: Symbol('kIsForOnEventAttribute'), - kListener: Symbol('kListener'), - kStatusCode: Symbol('status-code'), - kWebSocket: Symbol('websocket'), - NOOP: () => {} -}; diff --git a/tools/mnemonic-test/node_modules/ws/lib/event-target.js b/tools/mnemonic-test/node_modules/ws/lib/event-target.js deleted file mode 100644 index fea4cbc5..00000000 --- a/tools/mnemonic-test/node_modules/ws/lib/event-target.js +++ /dev/null @@ -1,292 +0,0 @@ -'use strict'; - -const { kForOnEventAttribute, kListener } = require('./constants'); - -const kCode = Symbol('kCode'); -const kData = Symbol('kData'); -const kError = Symbol('kError'); -const kMessage = Symbol('kMessage'); -const kReason = Symbol('kReason'); -const kTarget = Symbol('kTarget'); -const kType = Symbol('kType'); -const kWasClean = Symbol('kWasClean'); - -/** - * Class representing an event. - */ -class Event { - /** - * Create a new `Event`. - * - * @param {String} type The name of the event - * @throws {TypeError} If the `type` argument is not specified - */ - constructor(type) { - this[kTarget] = null; - this[kType] = type; - } - - /** - * @type {*} - */ - get target() { - return this[kTarget]; - } - - /** - * @type {String} - */ - get type() { - return this[kType]; - } -} - -Object.defineProperty(Event.prototype, 'target', { enumerable: true }); -Object.defineProperty(Event.prototype, 'type', { enumerable: true }); - -/** - * Class representing a close event. - * - * @extends Event - */ -class CloseEvent extends Event { - /** - * Create a new `CloseEvent`. - * - * @param {String} type The name of the event - * @param {Object} [options] A dictionary object that allows for setting - * attributes via object members of the same name - * @param {Number} [options.code=0] The status code explaining why the - * connection was closed - * @param {String} [options.reason=''] A human-readable string explaining why - * the connection was closed - * @param {Boolean} [options.wasClean=false] Indicates whether or not the - * connection was cleanly closed - */ - constructor(type, options = {}) { - super(type); - - this[kCode] = options.code === undefined ? 0 : options.code; - this[kReason] = options.reason === undefined ? '' : options.reason; - this[kWasClean] = options.wasClean === undefined ? false : options.wasClean; - } - - /** - * @type {Number} - */ - get code() { - return this[kCode]; - } - - /** - * @type {String} - */ - get reason() { - return this[kReason]; - } - - /** - * @type {Boolean} - */ - get wasClean() { - return this[kWasClean]; - } -} - -Object.defineProperty(CloseEvent.prototype, 'code', { enumerable: true }); -Object.defineProperty(CloseEvent.prototype, 'reason', { enumerable: true }); -Object.defineProperty(CloseEvent.prototype, 'wasClean', { enumerable: true }); - -/** - * Class representing an error event. - * - * @extends Event - */ -class ErrorEvent extends Event { - /** - * Create a new `ErrorEvent`. - * - * @param {String} type The name of the event - * @param {Object} [options] A dictionary object that allows for setting - * attributes via object members of the same name - * @param {*} [options.error=null] The error that generated this event - * @param {String} [options.message=''] The error message - */ - constructor(type, options = {}) { - super(type); - - this[kError] = options.error === undefined ? null : options.error; - this[kMessage] = options.message === undefined ? '' : options.message; - } - - /** - * @type {*} - */ - get error() { - return this[kError]; - } - - /** - * @type {String} - */ - get message() { - return this[kMessage]; - } -} - -Object.defineProperty(ErrorEvent.prototype, 'error', { enumerable: true }); -Object.defineProperty(ErrorEvent.prototype, 'message', { enumerable: true }); - -/** - * Class representing a message event. - * - * @extends Event - */ -class MessageEvent extends Event { - /** - * Create a new `MessageEvent`. - * - * @param {String} type The name of the event - * @param {Object} [options] A dictionary object that allows for setting - * attributes via object members of the same name - * @param {*} [options.data=null] The message content - */ - constructor(type, options = {}) { - super(type); - - this[kData] = options.data === undefined ? null : options.data; - } - - /** - * @type {*} - */ - get data() { - return this[kData]; - } -} - -Object.defineProperty(MessageEvent.prototype, 'data', { enumerable: true }); - -/** - * This provides methods for emulating the `EventTarget` interface. It's not - * meant to be used directly. - * - * @mixin - */ -const EventTarget = { - /** - * Register an event listener. - * - * @param {String} type A string representing the event type to listen for - * @param {(Function|Object)} handler The listener to add - * @param {Object} [options] An options object specifies characteristics about - * the event listener - * @param {Boolean} [options.once=false] A `Boolean` indicating that the - * listener should be invoked at most once after being added. If `true`, - * the listener would be automatically removed when invoked. - * @public - */ - addEventListener(type, handler, options = {}) { - for (const listener of this.listeners(type)) { - if ( - !options[kForOnEventAttribute] && - listener[kListener] === handler && - !listener[kForOnEventAttribute] - ) { - return; - } - } - - let wrapper; - - if (type === 'message') { - wrapper = function onMessage(data, isBinary) { - const event = new MessageEvent('message', { - data: isBinary ? data : data.toString() - }); - - event[kTarget] = this; - callListener(handler, this, event); - }; - } else if (type === 'close') { - wrapper = function onClose(code, message) { - const event = new CloseEvent('close', { - code, - reason: message.toString(), - wasClean: this._closeFrameReceived && this._closeFrameSent - }); - - event[kTarget] = this; - callListener(handler, this, event); - }; - } else if (type === 'error') { - wrapper = function onError(error) { - const event = new ErrorEvent('error', { - error, - message: error.message - }); - - event[kTarget] = this; - callListener(handler, this, event); - }; - } else if (type === 'open') { - wrapper = function onOpen() { - const event = new Event('open'); - - event[kTarget] = this; - callListener(handler, this, event); - }; - } else { - return; - } - - wrapper[kForOnEventAttribute] = !!options[kForOnEventAttribute]; - wrapper[kListener] = handler; - - if (options.once) { - this.once(type, wrapper); - } else { - this.on(type, wrapper); - } - }, - - /** - * Remove an event listener. - * - * @param {String} type A string representing the event type to remove - * @param {(Function|Object)} handler The listener to remove - * @public - */ - removeEventListener(type, handler) { - for (const listener of this.listeners(type)) { - if (listener[kListener] === handler && !listener[kForOnEventAttribute]) { - this.removeListener(type, listener); - break; - } - } - } -}; - -module.exports = { - CloseEvent, - ErrorEvent, - Event, - EventTarget, - MessageEvent -}; - -/** - * Call an event listener - * - * @param {(Function|Object)} listener The listener to call - * @param {*} thisArg The value to use as `this`` when calling the listener - * @param {Event} event The event to pass to the listener - * @private - */ -function callListener(listener, thisArg, event) { - if (typeof listener === 'object' && listener.handleEvent) { - listener.handleEvent.call(listener, event); - } else { - listener.call(thisArg, event); - } -} diff --git a/tools/mnemonic-test/node_modules/ws/lib/extension.js b/tools/mnemonic-test/node_modules/ws/lib/extension.js deleted file mode 100644 index 3d7895c1..00000000 --- a/tools/mnemonic-test/node_modules/ws/lib/extension.js +++ /dev/null @@ -1,203 +0,0 @@ -'use strict'; - -const { tokenChars } = require('./validation'); - -/** - * Adds an offer to the map of extension offers or a parameter to the map of - * parameters. - * - * @param {Object} dest The map of extension offers or parameters - * @param {String} name The extension or parameter name - * @param {(Object|Boolean|String)} elem The extension parameters or the - * parameter value - * @private - */ -function push(dest, name, elem) { - if (dest[name] === undefined) dest[name] = [elem]; - else dest[name].push(elem); -} - -/** - * Parses the `Sec-WebSocket-Extensions` header into an object. - * - * @param {String} header The field value of the header - * @return {Object} The parsed object - * @public - */ -function parse(header) { - const offers = Object.create(null); - let params = Object.create(null); - let mustUnescape = false; - let isEscaping = false; - let inQuotes = false; - let extensionName; - let paramName; - let start = -1; - let code = -1; - let end = -1; - let i = 0; - - for (; i < header.length; i++) { - code = header.charCodeAt(i); - - if (extensionName === undefined) { - if (end === -1 && tokenChars[code] === 1) { - if (start === -1) start = i; - } else if ( - i !== 0 && - (code === 0x20 /* ' ' */ || code === 0x09) /* '\t' */ - ) { - if (end === -1 && start !== -1) end = i; - } else if (code === 0x3b /* ';' */ || code === 0x2c /* ',' */) { - if (start === -1) { - throw new SyntaxError(`Unexpected character at index ${i}`); - } - - if (end === -1) end = i; - const name = header.slice(start, end); - if (code === 0x2c) { - push(offers, name, params); - params = Object.create(null); - } else { - extensionName = name; - } - - start = end = -1; - } else { - throw new SyntaxError(`Unexpected character at index ${i}`); - } - } else if (paramName === undefined) { - if (end === -1 && tokenChars[code] === 1) { - if (start === -1) start = i; - } else if (code === 0x20 || code === 0x09) { - if (end === -1 && start !== -1) end = i; - } else if (code === 0x3b || code === 0x2c) { - if (start === -1) { - throw new SyntaxError(`Unexpected character at index ${i}`); - } - - if (end === -1) end = i; - push(params, header.slice(start, end), true); - if (code === 0x2c) { - push(offers, extensionName, params); - params = Object.create(null); - extensionName = undefined; - } - - start = end = -1; - } else if (code === 0x3d /* '=' */ && start !== -1 && end === -1) { - paramName = header.slice(start, i); - start = end = -1; - } else { - throw new SyntaxError(`Unexpected character at index ${i}`); - } - } else { - // - // The value of a quoted-string after unescaping must conform to the - // token ABNF, so only token characters are valid. - // Ref: https://tools.ietf.org/html/rfc6455#section-9.1 - // - if (isEscaping) { - if (tokenChars[code] !== 1) { - throw new SyntaxError(`Unexpected character at index ${i}`); - } - if (start === -1) start = i; - else if (!mustUnescape) mustUnescape = true; - isEscaping = false; - } else if (inQuotes) { - if (tokenChars[code] === 1) { - if (start === -1) start = i; - } else if (code === 0x22 /* '"' */ && start !== -1) { - inQuotes = false; - end = i; - } else if (code === 0x5c /* '\' */) { - isEscaping = true; - } else { - throw new SyntaxError(`Unexpected character at index ${i}`); - } - } else if (code === 0x22 && header.charCodeAt(i - 1) === 0x3d) { - inQuotes = true; - } else if (end === -1 && tokenChars[code] === 1) { - if (start === -1) start = i; - } else if (start !== -1 && (code === 0x20 || code === 0x09)) { - if (end === -1) end = i; - } else if (code === 0x3b || code === 0x2c) { - if (start === -1) { - throw new SyntaxError(`Unexpected character at index ${i}`); - } - - if (end === -1) end = i; - let value = header.slice(start, end); - if (mustUnescape) { - value = value.replace(/\\/g, ''); - mustUnescape = false; - } - push(params, paramName, value); - if (code === 0x2c) { - push(offers, extensionName, params); - params = Object.create(null); - extensionName = undefined; - } - - paramName = undefined; - start = end = -1; - } else { - throw new SyntaxError(`Unexpected character at index ${i}`); - } - } - } - - if (start === -1 || inQuotes || code === 0x20 || code === 0x09) { - throw new SyntaxError('Unexpected end of input'); - } - - if (end === -1) end = i; - const token = header.slice(start, end); - if (extensionName === undefined) { - push(offers, token, params); - } else { - if (paramName === undefined) { - push(params, token, true); - } else if (mustUnescape) { - push(params, paramName, token.replace(/\\/g, '')); - } else { - push(params, paramName, token); - } - push(offers, extensionName, params); - } - - return offers; -} - -/** - * Builds the `Sec-WebSocket-Extensions` header field value. - * - * @param {Object} extensions The map of extensions and parameters to format - * @return {String} A string representing the given object - * @public - */ -function format(extensions) { - return Object.keys(extensions) - .map((extension) => { - let configurations = extensions[extension]; - if (!Array.isArray(configurations)) configurations = [configurations]; - return configurations - .map((params) => { - return [extension] - .concat( - Object.keys(params).map((k) => { - let values = params[k]; - if (!Array.isArray(values)) values = [values]; - return values - .map((v) => (v === true ? k : `${k}=${v}`)) - .join('; '); - }) - ) - .join('; '); - }) - .join(', '); - }) - .join(', '); -} - -module.exports = { format, parse }; diff --git a/tools/mnemonic-test/node_modules/ws/lib/limiter.js b/tools/mnemonic-test/node_modules/ws/lib/limiter.js deleted file mode 100644 index 3fd35784..00000000 --- a/tools/mnemonic-test/node_modules/ws/lib/limiter.js +++ /dev/null @@ -1,55 +0,0 @@ -'use strict'; - -const kDone = Symbol('kDone'); -const kRun = Symbol('kRun'); - -/** - * A very simple job queue with adjustable concurrency. Adapted from - * https://github.com/STRML/async-limiter - */ -class Limiter { - /** - * Creates a new `Limiter`. - * - * @param {Number} [concurrency=Infinity] The maximum number of jobs allowed - * to run concurrently - */ - constructor(concurrency) { - this[kDone] = () => { - this.pending--; - this[kRun](); - }; - this.concurrency = concurrency || Infinity; - this.jobs = []; - this.pending = 0; - } - - /** - * Adds a job to the queue. - * - * @param {Function} job The job to run - * @public - */ - add(job) { - this.jobs.push(job); - this[kRun](); - } - - /** - * Removes a job from the queue and runs it if possible. - * - * @private - */ - [kRun]() { - if (this.pending === this.concurrency) return; - - if (this.jobs.length) { - const job = this.jobs.shift(); - - this.pending++; - job(this[kDone]); - } - } -} - -module.exports = Limiter; diff --git a/tools/mnemonic-test/node_modules/ws/lib/permessage-deflate.js b/tools/mnemonic-test/node_modules/ws/lib/permessage-deflate.js deleted file mode 100644 index 77d918b5..00000000 --- a/tools/mnemonic-test/node_modules/ws/lib/permessage-deflate.js +++ /dev/null @@ -1,514 +0,0 @@ -'use strict'; - -const zlib = require('zlib'); - -const bufferUtil = require('./buffer-util'); -const Limiter = require('./limiter'); -const { kStatusCode } = require('./constants'); - -const FastBuffer = Buffer[Symbol.species]; -const TRAILER = Buffer.from([0x00, 0x00, 0xff, 0xff]); -const kPerMessageDeflate = Symbol('permessage-deflate'); -const kTotalLength = Symbol('total-length'); -const kCallback = Symbol('callback'); -const kBuffers = Symbol('buffers'); -const kError = Symbol('error'); - -// -// We limit zlib concurrency, which prevents severe memory fragmentation -// as documented in https://github.com/nodejs/node/issues/8871#issuecomment-250915913 -// and https://github.com/websockets/ws/issues/1202 -// -// Intentionally global; it's the global thread pool that's an issue. -// -let zlibLimiter; - -/** - * permessage-deflate implementation. - */ -class PerMessageDeflate { - /** - * Creates a PerMessageDeflate instance. - * - * @param {Object} [options] Configuration options - * @param {(Boolean|Number)} [options.clientMaxWindowBits] Advertise support - * for, or request, a custom client window size - * @param {Boolean} [options.clientNoContextTakeover=false] Advertise/ - * acknowledge disabling of client context takeover - * @param {Number} [options.concurrencyLimit=10] The number of concurrent - * calls to zlib - * @param {(Boolean|Number)} [options.serverMaxWindowBits] Request/confirm the - * use of a custom server window size - * @param {Boolean} [options.serverNoContextTakeover=false] Request/accept - * disabling of server context takeover - * @param {Number} [options.threshold=1024] Size (in bytes) below which - * messages should not be compressed if context takeover is disabled - * @param {Object} [options.zlibDeflateOptions] Options to pass to zlib on - * deflate - * @param {Object} [options.zlibInflateOptions] Options to pass to zlib on - * inflate - * @param {Boolean} [isServer=false] Create the instance in either server or - * client mode - * @param {Number} [maxPayload=0] The maximum allowed message length - */ - constructor(options, isServer, maxPayload) { - this._maxPayload = maxPayload | 0; - this._options = options || {}; - this._threshold = - this._options.threshold !== undefined ? this._options.threshold : 1024; - this._isServer = !!isServer; - this._deflate = null; - this._inflate = null; - - this.params = null; - - if (!zlibLimiter) { - const concurrency = - this._options.concurrencyLimit !== undefined - ? this._options.concurrencyLimit - : 10; - zlibLimiter = new Limiter(concurrency); - } - } - - /** - * @type {String} - */ - static get extensionName() { - return 'permessage-deflate'; - } - - /** - * Create an extension negotiation offer. - * - * @return {Object} Extension parameters - * @public - */ - offer() { - const params = {}; - - if (this._options.serverNoContextTakeover) { - params.server_no_context_takeover = true; - } - if (this._options.clientNoContextTakeover) { - params.client_no_context_takeover = true; - } - if (this._options.serverMaxWindowBits) { - params.server_max_window_bits = this._options.serverMaxWindowBits; - } - if (this._options.clientMaxWindowBits) { - params.client_max_window_bits = this._options.clientMaxWindowBits; - } else if (this._options.clientMaxWindowBits == null) { - params.client_max_window_bits = true; - } - - return params; - } - - /** - * Accept an extension negotiation offer/response. - * - * @param {Array} configurations The extension negotiation offers/reponse - * @return {Object} Accepted configuration - * @public - */ - accept(configurations) { - configurations = this.normalizeParams(configurations); - - this.params = this._isServer - ? this.acceptAsServer(configurations) - : this.acceptAsClient(configurations); - - return this.params; - } - - /** - * Releases all resources used by the extension. - * - * @public - */ - cleanup() { - if (this._inflate) { - this._inflate.close(); - this._inflate = null; - } - - if (this._deflate) { - const callback = this._deflate[kCallback]; - - this._deflate.close(); - this._deflate = null; - - if (callback) { - callback( - new Error( - 'The deflate stream was closed while data was being processed' - ) - ); - } - } - } - - /** - * Accept an extension negotiation offer. - * - * @param {Array} offers The extension negotiation offers - * @return {Object} Accepted configuration - * @private - */ - acceptAsServer(offers) { - const opts = this._options; - const accepted = offers.find((params) => { - if ( - (opts.serverNoContextTakeover === false && - params.server_no_context_takeover) || - (params.server_max_window_bits && - (opts.serverMaxWindowBits === false || - (typeof opts.serverMaxWindowBits === 'number' && - opts.serverMaxWindowBits > params.server_max_window_bits))) || - (typeof opts.clientMaxWindowBits === 'number' && - !params.client_max_window_bits) - ) { - return false; - } - - return true; - }); - - if (!accepted) { - throw new Error('None of the extension offers can be accepted'); - } - - if (opts.serverNoContextTakeover) { - accepted.server_no_context_takeover = true; - } - if (opts.clientNoContextTakeover) { - accepted.client_no_context_takeover = true; - } - if (typeof opts.serverMaxWindowBits === 'number') { - accepted.server_max_window_bits = opts.serverMaxWindowBits; - } - if (typeof opts.clientMaxWindowBits === 'number') { - accepted.client_max_window_bits = opts.clientMaxWindowBits; - } else if ( - accepted.client_max_window_bits === true || - opts.clientMaxWindowBits === false - ) { - delete accepted.client_max_window_bits; - } - - return accepted; - } - - /** - * Accept the extension negotiation response. - * - * @param {Array} response The extension negotiation response - * @return {Object} Accepted configuration - * @private - */ - acceptAsClient(response) { - const params = response[0]; - - if ( - this._options.clientNoContextTakeover === false && - params.client_no_context_takeover - ) { - throw new Error('Unexpected parameter "client_no_context_takeover"'); - } - - if (!params.client_max_window_bits) { - if (typeof this._options.clientMaxWindowBits === 'number') { - params.client_max_window_bits = this._options.clientMaxWindowBits; - } - } else if ( - this._options.clientMaxWindowBits === false || - (typeof this._options.clientMaxWindowBits === 'number' && - params.client_max_window_bits > this._options.clientMaxWindowBits) - ) { - throw new Error( - 'Unexpected or invalid parameter "client_max_window_bits"' - ); - } - - return params; - } - - /** - * Normalize parameters. - * - * @param {Array} configurations The extension negotiation offers/reponse - * @return {Array} The offers/response with normalized parameters - * @private - */ - normalizeParams(configurations) { - configurations.forEach((params) => { - Object.keys(params).forEach((key) => { - let value = params[key]; - - if (value.length > 1) { - throw new Error(`Parameter "${key}" must have only a single value`); - } - - value = value[0]; - - if (key === 'client_max_window_bits') { - if (value !== true) { - const num = +value; - if (!Number.isInteger(num) || num < 8 || num > 15) { - throw new TypeError( - `Invalid value for parameter "${key}": ${value}` - ); - } - value = num; - } else if (!this._isServer) { - throw new TypeError( - `Invalid value for parameter "${key}": ${value}` - ); - } - } else if (key === 'server_max_window_bits') { - const num = +value; - if (!Number.isInteger(num) || num < 8 || num > 15) { - throw new TypeError( - `Invalid value for parameter "${key}": ${value}` - ); - } - value = num; - } else if ( - key === 'client_no_context_takeover' || - key === 'server_no_context_takeover' - ) { - if (value !== true) { - throw new TypeError( - `Invalid value for parameter "${key}": ${value}` - ); - } - } else { - throw new Error(`Unknown parameter "${key}"`); - } - - params[key] = value; - }); - }); - - return configurations; - } - - /** - * Decompress data. Concurrency limited. - * - * @param {Buffer} data Compressed data - * @param {Boolean} fin Specifies whether or not this is the last fragment - * @param {Function} callback Callback - * @public - */ - decompress(data, fin, callback) { - zlibLimiter.add((done) => { - this._decompress(data, fin, (err, result) => { - done(); - callback(err, result); - }); - }); - } - - /** - * Compress data. Concurrency limited. - * - * @param {(Buffer|String)} data Data to compress - * @param {Boolean} fin Specifies whether or not this is the last fragment - * @param {Function} callback Callback - * @public - */ - compress(data, fin, callback) { - zlibLimiter.add((done) => { - this._compress(data, fin, (err, result) => { - done(); - callback(err, result); - }); - }); - } - - /** - * Decompress data. - * - * @param {Buffer} data Compressed data - * @param {Boolean} fin Specifies whether or not this is the last fragment - * @param {Function} callback Callback - * @private - */ - _decompress(data, fin, callback) { - const endpoint = this._isServer ? 'client' : 'server'; - - if (!this._inflate) { - const key = `${endpoint}_max_window_bits`; - const windowBits = - typeof this.params[key] !== 'number' - ? zlib.Z_DEFAULT_WINDOWBITS - : this.params[key]; - - this._inflate = zlib.createInflateRaw({ - ...this._options.zlibInflateOptions, - windowBits - }); - this._inflate[kPerMessageDeflate] = this; - this._inflate[kTotalLength] = 0; - this._inflate[kBuffers] = []; - this._inflate.on('error', inflateOnError); - this._inflate.on('data', inflateOnData); - } - - this._inflate[kCallback] = callback; - - this._inflate.write(data); - if (fin) this._inflate.write(TRAILER); - - this._inflate.flush(() => { - const err = this._inflate[kError]; - - if (err) { - this._inflate.close(); - this._inflate = null; - callback(err); - return; - } - - const data = bufferUtil.concat( - this._inflate[kBuffers], - this._inflate[kTotalLength] - ); - - if (this._inflate._readableState.endEmitted) { - this._inflate.close(); - this._inflate = null; - } else { - this._inflate[kTotalLength] = 0; - this._inflate[kBuffers] = []; - - if (fin && this.params[`${endpoint}_no_context_takeover`]) { - this._inflate.reset(); - } - } - - callback(null, data); - }); - } - - /** - * Compress data. - * - * @param {(Buffer|String)} data Data to compress - * @param {Boolean} fin Specifies whether or not this is the last fragment - * @param {Function} callback Callback - * @private - */ - _compress(data, fin, callback) { - const endpoint = this._isServer ? 'server' : 'client'; - - if (!this._deflate) { - const key = `${endpoint}_max_window_bits`; - const windowBits = - typeof this.params[key] !== 'number' - ? zlib.Z_DEFAULT_WINDOWBITS - : this.params[key]; - - this._deflate = zlib.createDeflateRaw({ - ...this._options.zlibDeflateOptions, - windowBits - }); - - this._deflate[kTotalLength] = 0; - this._deflate[kBuffers] = []; - - this._deflate.on('data', deflateOnData); - } - - this._deflate[kCallback] = callback; - - this._deflate.write(data); - this._deflate.flush(zlib.Z_SYNC_FLUSH, () => { - if (!this._deflate) { - // - // The deflate stream was closed while data was being processed. - // - return; - } - - let data = bufferUtil.concat( - this._deflate[kBuffers], - this._deflate[kTotalLength] - ); - - if (fin) { - data = new FastBuffer(data.buffer, data.byteOffset, data.length - 4); - } - - // - // Ensure that the callback will not be called again in - // `PerMessageDeflate#cleanup()`. - // - this._deflate[kCallback] = null; - - this._deflate[kTotalLength] = 0; - this._deflate[kBuffers] = []; - - if (fin && this.params[`${endpoint}_no_context_takeover`]) { - this._deflate.reset(); - } - - callback(null, data); - }); - } -} - -module.exports = PerMessageDeflate; - -/** - * The listener of the `zlib.DeflateRaw` stream `'data'` event. - * - * @param {Buffer} chunk A chunk of data - * @private - */ -function deflateOnData(chunk) { - this[kBuffers].push(chunk); - this[kTotalLength] += chunk.length; -} - -/** - * The listener of the `zlib.InflateRaw` stream `'data'` event. - * - * @param {Buffer} chunk A chunk of data - * @private - */ -function inflateOnData(chunk) { - this[kTotalLength] += chunk.length; - - if ( - this[kPerMessageDeflate]._maxPayload < 1 || - this[kTotalLength] <= this[kPerMessageDeflate]._maxPayload - ) { - this[kBuffers].push(chunk); - return; - } - - this[kError] = new RangeError('Max payload size exceeded'); - this[kError].code = 'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH'; - this[kError][kStatusCode] = 1009; - this.removeListener('data', inflateOnData); - this.reset(); -} - -/** - * The listener of the `zlib.InflateRaw` stream `'error'` event. - * - * @param {Error} err The emitted error - * @private - */ -function inflateOnError(err) { - // - // There is no need to call `Zlib#close()` as the handle is automatically - // closed when an error is emitted. - // - this[kPerMessageDeflate]._inflate = null; - err[kStatusCode] = 1007; - this[kCallback](err); -} diff --git a/tools/mnemonic-test/node_modules/ws/lib/receiver.js b/tools/mnemonic-test/node_modules/ws/lib/receiver.js deleted file mode 100644 index 70dfd993..00000000 --- a/tools/mnemonic-test/node_modules/ws/lib/receiver.js +++ /dev/null @@ -1,704 +0,0 @@ -'use strict'; - -const { Writable } = require('stream'); - -const PerMessageDeflate = require('./permessage-deflate'); -const { - BINARY_TYPES, - EMPTY_BUFFER, - kStatusCode, - kWebSocket -} = require('./constants'); -const { concat, toArrayBuffer, unmask } = require('./buffer-util'); -const { isValidStatusCode, isValidUTF8 } = require('./validation'); - -const FastBuffer = Buffer[Symbol.species]; - -const GET_INFO = 0; -const GET_PAYLOAD_LENGTH_16 = 1; -const GET_PAYLOAD_LENGTH_64 = 2; -const GET_MASK = 3; -const GET_DATA = 4; -const INFLATING = 5; -const DEFER_EVENT = 6; - -/** - * HyBi Receiver implementation. - * - * @extends Writable - */ -class Receiver extends Writable { - /** - * Creates a Receiver instance. - * - * @param {Object} [options] Options object - * @param {Boolean} [options.allowSynchronousEvents=true] Specifies whether - * any of the `'message'`, `'ping'`, and `'pong'` events can be emitted - * multiple times in the same tick - * @param {String} [options.binaryType=nodebuffer] The type for binary data - * @param {Object} [options.extensions] An object containing the negotiated - * extensions - * @param {Boolean} [options.isServer=false] Specifies whether to operate in - * client or server mode - * @param {Number} [options.maxPayload=0] The maximum allowed message length - * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or - * not to skip UTF-8 validation for text and close messages - */ - constructor(options = {}) { - super(); - - this._allowSynchronousEvents = - options.allowSynchronousEvents !== undefined - ? options.allowSynchronousEvents - : true; - this._binaryType = options.binaryType || BINARY_TYPES[0]; - this._extensions = options.extensions || {}; - this._isServer = !!options.isServer; - this._maxPayload = options.maxPayload | 0; - this._skipUTF8Validation = !!options.skipUTF8Validation; - this[kWebSocket] = undefined; - - this._bufferedBytes = 0; - this._buffers = []; - - this._compressed = false; - this._payloadLength = 0; - this._mask = undefined; - this._fragmented = 0; - this._masked = false; - this._fin = false; - this._opcode = 0; - - this._totalPayloadLength = 0; - this._messageLength = 0; - this._fragments = []; - - this._errored = false; - this._loop = false; - this._state = GET_INFO; - } - - /** - * Implements `Writable.prototype._write()`. - * - * @param {Buffer} chunk The chunk of data to write - * @param {String} encoding The character encoding of `chunk` - * @param {Function} cb Callback - * @private - */ - _write(chunk, encoding, cb) { - if (this._opcode === 0x08 && this._state == GET_INFO) return cb(); - - this._bufferedBytes += chunk.length; - this._buffers.push(chunk); - this.startLoop(cb); - } - - /** - * Consumes `n` bytes from the buffered data. - * - * @param {Number} n The number of bytes to consume - * @return {Buffer} The consumed bytes - * @private - */ - consume(n) { - this._bufferedBytes -= n; - - if (n === this._buffers[0].length) return this._buffers.shift(); - - if (n < this._buffers[0].length) { - const buf = this._buffers[0]; - this._buffers[0] = new FastBuffer( - buf.buffer, - buf.byteOffset + n, - buf.length - n - ); - - return new FastBuffer(buf.buffer, buf.byteOffset, n); - } - - const dst = Buffer.allocUnsafe(n); - - do { - const buf = this._buffers[0]; - const offset = dst.length - n; - - if (n >= buf.length) { - dst.set(this._buffers.shift(), offset); - } else { - dst.set(new Uint8Array(buf.buffer, buf.byteOffset, n), offset); - this._buffers[0] = new FastBuffer( - buf.buffer, - buf.byteOffset + n, - buf.length - n - ); - } - - n -= buf.length; - } while (n > 0); - - return dst; - } - - /** - * Starts the parsing loop. - * - * @param {Function} cb Callback - * @private - */ - startLoop(cb) { - this._loop = true; - - do { - switch (this._state) { - case GET_INFO: - this.getInfo(cb); - break; - case GET_PAYLOAD_LENGTH_16: - this.getPayloadLength16(cb); - break; - case GET_PAYLOAD_LENGTH_64: - this.getPayloadLength64(cb); - break; - case GET_MASK: - this.getMask(); - break; - case GET_DATA: - this.getData(cb); - break; - case INFLATING: - case DEFER_EVENT: - this._loop = false; - return; - } - } while (this._loop); - - if (!this._errored) cb(); - } - - /** - * Reads the first two bytes of a frame. - * - * @param {Function} cb Callback - * @private - */ - getInfo(cb) { - if (this._bufferedBytes < 2) { - this._loop = false; - return; - } - - const buf = this.consume(2); - - if ((buf[0] & 0x30) !== 0x00) { - const error = this.createError( - RangeError, - 'RSV2 and RSV3 must be clear', - true, - 1002, - 'WS_ERR_UNEXPECTED_RSV_2_3' - ); - - cb(error); - return; - } - - const compressed = (buf[0] & 0x40) === 0x40; - - if (compressed && !this._extensions[PerMessageDeflate.extensionName]) { - const error = this.createError( - RangeError, - 'RSV1 must be clear', - true, - 1002, - 'WS_ERR_UNEXPECTED_RSV_1' - ); - - cb(error); - return; - } - - this._fin = (buf[0] & 0x80) === 0x80; - this._opcode = buf[0] & 0x0f; - this._payloadLength = buf[1] & 0x7f; - - if (this._opcode === 0x00) { - if (compressed) { - const error = this.createError( - RangeError, - 'RSV1 must be clear', - true, - 1002, - 'WS_ERR_UNEXPECTED_RSV_1' - ); - - cb(error); - return; - } - - if (!this._fragmented) { - const error = this.createError( - RangeError, - 'invalid opcode 0', - true, - 1002, - 'WS_ERR_INVALID_OPCODE' - ); - - cb(error); - return; - } - - this._opcode = this._fragmented; - } else if (this._opcode === 0x01 || this._opcode === 0x02) { - if (this._fragmented) { - const error = this.createError( - RangeError, - `invalid opcode ${this._opcode}`, - true, - 1002, - 'WS_ERR_INVALID_OPCODE' - ); - - cb(error); - return; - } - - this._compressed = compressed; - } else if (this._opcode > 0x07 && this._opcode < 0x0b) { - if (!this._fin) { - const error = this.createError( - RangeError, - 'FIN must be set', - true, - 1002, - 'WS_ERR_EXPECTED_FIN' - ); - - cb(error); - return; - } - - if (compressed) { - const error = this.createError( - RangeError, - 'RSV1 must be clear', - true, - 1002, - 'WS_ERR_UNEXPECTED_RSV_1' - ); - - cb(error); - return; - } - - if ( - this._payloadLength > 0x7d || - (this._opcode === 0x08 && this._payloadLength === 1) - ) { - const error = this.createError( - RangeError, - `invalid payload length ${this._payloadLength}`, - true, - 1002, - 'WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH' - ); - - cb(error); - return; - } - } else { - const error = this.createError( - RangeError, - `invalid opcode ${this._opcode}`, - true, - 1002, - 'WS_ERR_INVALID_OPCODE' - ); - - cb(error); - return; - } - - if (!this._fin && !this._fragmented) this._fragmented = this._opcode; - this._masked = (buf[1] & 0x80) === 0x80; - - if (this._isServer) { - if (!this._masked) { - const error = this.createError( - RangeError, - 'MASK must be set', - true, - 1002, - 'WS_ERR_EXPECTED_MASK' - ); - - cb(error); - return; - } - } else if (this._masked) { - const error = this.createError( - RangeError, - 'MASK must be clear', - true, - 1002, - 'WS_ERR_UNEXPECTED_MASK' - ); - - cb(error); - return; - } - - if (this._payloadLength === 126) this._state = GET_PAYLOAD_LENGTH_16; - else if (this._payloadLength === 127) this._state = GET_PAYLOAD_LENGTH_64; - else this.haveLength(cb); - } - - /** - * Gets extended payload length (7+16). - * - * @param {Function} cb Callback - * @private - */ - getPayloadLength16(cb) { - if (this._bufferedBytes < 2) { - this._loop = false; - return; - } - - this._payloadLength = this.consume(2).readUInt16BE(0); - this.haveLength(cb); - } - - /** - * Gets extended payload length (7+64). - * - * @param {Function} cb Callback - * @private - */ - getPayloadLength64(cb) { - if (this._bufferedBytes < 8) { - this._loop = false; - return; - } - - const buf = this.consume(8); - const num = buf.readUInt32BE(0); - - // - // The maximum safe integer in JavaScript is 2^53 - 1. An error is returned - // if payload length is greater than this number. - // - if (num > Math.pow(2, 53 - 32) - 1) { - const error = this.createError( - RangeError, - 'Unsupported WebSocket frame: payload length > 2^53 - 1', - false, - 1009, - 'WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH' - ); - - cb(error); - return; - } - - this._payloadLength = num * Math.pow(2, 32) + buf.readUInt32BE(4); - this.haveLength(cb); - } - - /** - * Payload length has been read. - * - * @param {Function} cb Callback - * @private - */ - haveLength(cb) { - if (this._payloadLength && this._opcode < 0x08) { - this._totalPayloadLength += this._payloadLength; - if (this._totalPayloadLength > this._maxPayload && this._maxPayload > 0) { - const error = this.createError( - RangeError, - 'Max payload size exceeded', - false, - 1009, - 'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH' - ); - - cb(error); - return; - } - } - - if (this._masked) this._state = GET_MASK; - else this._state = GET_DATA; - } - - /** - * Reads mask bytes. - * - * @private - */ - getMask() { - if (this._bufferedBytes < 4) { - this._loop = false; - return; - } - - this._mask = this.consume(4); - this._state = GET_DATA; - } - - /** - * Reads data bytes. - * - * @param {Function} cb Callback - * @private - */ - getData(cb) { - let data = EMPTY_BUFFER; - - if (this._payloadLength) { - if (this._bufferedBytes < this._payloadLength) { - this._loop = false; - return; - } - - data = this.consume(this._payloadLength); - - if ( - this._masked && - (this._mask[0] | this._mask[1] | this._mask[2] | this._mask[3]) !== 0 - ) { - unmask(data, this._mask); - } - } - - if (this._opcode > 0x07) { - this.controlMessage(data, cb); - return; - } - - if (this._compressed) { - this._state = INFLATING; - this.decompress(data, cb); - return; - } - - if (data.length) { - // - // This message is not compressed so its length is the sum of the payload - // length of all fragments. - // - this._messageLength = this._totalPayloadLength; - this._fragments.push(data); - } - - this.dataMessage(cb); - } - - /** - * Decompresses data. - * - * @param {Buffer} data Compressed data - * @param {Function} cb Callback - * @private - */ - decompress(data, cb) { - const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName]; - - perMessageDeflate.decompress(data, this._fin, (err, buf) => { - if (err) return cb(err); - - if (buf.length) { - this._messageLength += buf.length; - if (this._messageLength > this._maxPayload && this._maxPayload > 0) { - const error = this.createError( - RangeError, - 'Max payload size exceeded', - false, - 1009, - 'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH' - ); - - cb(error); - return; - } - - this._fragments.push(buf); - } - - this.dataMessage(cb); - if (this._state === GET_INFO) this.startLoop(cb); - }); - } - - /** - * Handles a data message. - * - * @param {Function} cb Callback - * @private - */ - dataMessage(cb) { - if (!this._fin) { - this._state = GET_INFO; - return; - } - - const messageLength = this._messageLength; - const fragments = this._fragments; - - this._totalPayloadLength = 0; - this._messageLength = 0; - this._fragmented = 0; - this._fragments = []; - - if (this._opcode === 2) { - let data; - - if (this._binaryType === 'nodebuffer') { - data = concat(fragments, messageLength); - } else if (this._binaryType === 'arraybuffer') { - data = toArrayBuffer(concat(fragments, messageLength)); - } else { - data = fragments; - } - - if (this._allowSynchronousEvents) { - this.emit('message', data, true); - this._state = GET_INFO; - } else { - this._state = DEFER_EVENT; - setImmediate(() => { - this.emit('message', data, true); - this._state = GET_INFO; - this.startLoop(cb); - }); - } - } else { - const buf = concat(fragments, messageLength); - - if (!this._skipUTF8Validation && !isValidUTF8(buf)) { - const error = this.createError( - Error, - 'invalid UTF-8 sequence', - true, - 1007, - 'WS_ERR_INVALID_UTF8' - ); - - cb(error); - return; - } - - if (this._state === INFLATING || this._allowSynchronousEvents) { - this.emit('message', buf, false); - this._state = GET_INFO; - } else { - this._state = DEFER_EVENT; - setImmediate(() => { - this.emit('message', buf, false); - this._state = GET_INFO; - this.startLoop(cb); - }); - } - } - } - - /** - * Handles a control message. - * - * @param {Buffer} data Data to handle - * @return {(Error|RangeError|undefined)} A possible error - * @private - */ - controlMessage(data, cb) { - if (this._opcode === 0x08) { - if (data.length === 0) { - this._loop = false; - this.emit('conclude', 1005, EMPTY_BUFFER); - this.end(); - } else { - const code = data.readUInt16BE(0); - - if (!isValidStatusCode(code)) { - const error = this.createError( - RangeError, - `invalid status code ${code}`, - true, - 1002, - 'WS_ERR_INVALID_CLOSE_CODE' - ); - - cb(error); - return; - } - - const buf = new FastBuffer( - data.buffer, - data.byteOffset + 2, - data.length - 2 - ); - - if (!this._skipUTF8Validation && !isValidUTF8(buf)) { - const error = this.createError( - Error, - 'invalid UTF-8 sequence', - true, - 1007, - 'WS_ERR_INVALID_UTF8' - ); - - cb(error); - return; - } - - this._loop = false; - this.emit('conclude', code, buf); - this.end(); - } - - this._state = GET_INFO; - return; - } - - if (this._allowSynchronousEvents) { - this.emit(this._opcode === 0x09 ? 'ping' : 'pong', data); - this._state = GET_INFO; - } else { - this._state = DEFER_EVENT; - setImmediate(() => { - this.emit(this._opcode === 0x09 ? 'ping' : 'pong', data); - this._state = GET_INFO; - this.startLoop(cb); - }); - } - } - - /** - * Builds an error object. - * - * @param {function(new:Error|RangeError)} ErrorCtor The error constructor - * @param {String} message The error message - * @param {Boolean} prefix Specifies whether or not to add a default prefix to - * `message` - * @param {Number} statusCode The status code - * @param {String} errorCode The exposed error code - * @return {(Error|RangeError)} The error - * @private - */ - createError(ErrorCtor, message, prefix, statusCode, errorCode) { - this._loop = false; - this._errored = true; - - const err = new ErrorCtor( - prefix ? `Invalid WebSocket frame: ${message}` : message - ); - - Error.captureStackTrace(err, this.createError); - err.code = errorCode; - err[kStatusCode] = statusCode; - return err; - } -} - -module.exports = Receiver; diff --git a/tools/mnemonic-test/node_modules/ws/lib/sender.js b/tools/mnemonic-test/node_modules/ws/lib/sender.js deleted file mode 100644 index c81ec66f..00000000 --- a/tools/mnemonic-test/node_modules/ws/lib/sender.js +++ /dev/null @@ -1,497 +0,0 @@ -/* eslint no-unused-vars: ["error", { "varsIgnorePattern": "^Duplex" }] */ - -'use strict'; - -const { Duplex } = require('stream'); -const { randomFillSync } = require('crypto'); - -const PerMessageDeflate = require('./permessage-deflate'); -const { EMPTY_BUFFER } = require('./constants'); -const { isValidStatusCode } = require('./validation'); -const { mask: applyMask, toBuffer } = require('./buffer-util'); - -const kByteLength = Symbol('kByteLength'); -const maskBuffer = Buffer.alloc(4); -const RANDOM_POOL_SIZE = 8 * 1024; -let randomPool; -let randomPoolPointer = RANDOM_POOL_SIZE; - -/** - * HyBi Sender implementation. - */ -class Sender { - /** - * Creates a Sender instance. - * - * @param {Duplex} socket The connection socket - * @param {Object} [extensions] An object containing the negotiated extensions - * @param {Function} [generateMask] The function used to generate the masking - * key - */ - constructor(socket, extensions, generateMask) { - this._extensions = extensions || {}; - - if (generateMask) { - this._generateMask = generateMask; - this._maskBuffer = Buffer.alloc(4); - } - - this._socket = socket; - - this._firstFragment = true; - this._compress = false; - - this._bufferedBytes = 0; - this._deflating = false; - this._queue = []; - } - - /** - * Frames a piece of data according to the HyBi WebSocket protocol. - * - * @param {(Buffer|String)} data The data to frame - * @param {Object} options Options object - * @param {Boolean} [options.fin=false] Specifies whether or not to set the - * FIN bit - * @param {Function} [options.generateMask] The function used to generate the - * masking key - * @param {Boolean} [options.mask=false] Specifies whether or not to mask - * `data` - * @param {Buffer} [options.maskBuffer] The buffer used to store the masking - * key - * @param {Number} options.opcode The opcode - * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be - * modified - * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the - * RSV1 bit - * @return {(Buffer|String)[]} The framed data - * @public - */ - static frame(data, options) { - let mask; - let merge = false; - let offset = 2; - let skipMasking = false; - - if (options.mask) { - mask = options.maskBuffer || maskBuffer; - - if (options.generateMask) { - options.generateMask(mask); - } else { - if (randomPoolPointer === RANDOM_POOL_SIZE) { - /* istanbul ignore else */ - if (randomPool === undefined) { - // - // This is lazily initialized because server-sent frames must not - // be masked so it may never be used. - // - randomPool = Buffer.alloc(RANDOM_POOL_SIZE); - } - - randomFillSync(randomPool, 0, RANDOM_POOL_SIZE); - randomPoolPointer = 0; - } - - mask[0] = randomPool[randomPoolPointer++]; - mask[1] = randomPool[randomPoolPointer++]; - mask[2] = randomPool[randomPoolPointer++]; - mask[3] = randomPool[randomPoolPointer++]; - } - - skipMasking = (mask[0] | mask[1] | mask[2] | mask[3]) === 0; - offset = 6; - } - - let dataLength; - - if (typeof data === 'string') { - if ( - (!options.mask || skipMasking) && - options[kByteLength] !== undefined - ) { - dataLength = options[kByteLength]; - } else { - data = Buffer.from(data); - dataLength = data.length; - } - } else { - dataLength = data.length; - merge = options.mask && options.readOnly && !skipMasking; - } - - let payloadLength = dataLength; - - if (dataLength >= 65536) { - offset += 8; - payloadLength = 127; - } else if (dataLength > 125) { - offset += 2; - payloadLength = 126; - } - - const target = Buffer.allocUnsafe(merge ? dataLength + offset : offset); - - target[0] = options.fin ? options.opcode | 0x80 : options.opcode; - if (options.rsv1) target[0] |= 0x40; - - target[1] = payloadLength; - - if (payloadLength === 126) { - target.writeUInt16BE(dataLength, 2); - } else if (payloadLength === 127) { - target[2] = target[3] = 0; - target.writeUIntBE(dataLength, 4, 6); - } - - if (!options.mask) return [target, data]; - - target[1] |= 0x80; - target[offset - 4] = mask[0]; - target[offset - 3] = mask[1]; - target[offset - 2] = mask[2]; - target[offset - 1] = mask[3]; - - if (skipMasking) return [target, data]; - - if (merge) { - applyMask(data, mask, target, offset, dataLength); - return [target]; - } - - applyMask(data, mask, data, 0, dataLength); - return [target, data]; - } - - /** - * Sends a close message to the other peer. - * - * @param {Number} [code] The status code component of the body - * @param {(String|Buffer)} [data] The message component of the body - * @param {Boolean} [mask=false] Specifies whether or not to mask the message - * @param {Function} [cb] Callback - * @public - */ - close(code, data, mask, cb) { - let buf; - - if (code === undefined) { - buf = EMPTY_BUFFER; - } else if (typeof code !== 'number' || !isValidStatusCode(code)) { - throw new TypeError('First argument must be a valid error code number'); - } else if (data === undefined || !data.length) { - buf = Buffer.allocUnsafe(2); - buf.writeUInt16BE(code, 0); - } else { - const length = Buffer.byteLength(data); - - if (length > 123) { - throw new RangeError('The message must not be greater than 123 bytes'); - } - - buf = Buffer.allocUnsafe(2 + length); - buf.writeUInt16BE(code, 0); - - if (typeof data === 'string') { - buf.write(data, 2); - } else { - buf.set(data, 2); - } - } - - const options = { - [kByteLength]: buf.length, - fin: true, - generateMask: this._generateMask, - mask, - maskBuffer: this._maskBuffer, - opcode: 0x08, - readOnly: false, - rsv1: false - }; - - if (this._deflating) { - this.enqueue([this.dispatch, buf, false, options, cb]); - } else { - this.sendFrame(Sender.frame(buf, options), cb); - } - } - - /** - * Sends a ping message to the other peer. - * - * @param {*} data The message to send - * @param {Boolean} [mask=false] Specifies whether or not to mask `data` - * @param {Function} [cb] Callback - * @public - */ - ping(data, mask, cb) { - let byteLength; - let readOnly; - - if (typeof data === 'string') { - byteLength = Buffer.byteLength(data); - readOnly = false; - } else { - data = toBuffer(data); - byteLength = data.length; - readOnly = toBuffer.readOnly; - } - - if (byteLength > 125) { - throw new RangeError('The data size must not be greater than 125 bytes'); - } - - const options = { - [kByteLength]: byteLength, - fin: true, - generateMask: this._generateMask, - mask, - maskBuffer: this._maskBuffer, - opcode: 0x09, - readOnly, - rsv1: false - }; - - if (this._deflating) { - this.enqueue([this.dispatch, data, false, options, cb]); - } else { - this.sendFrame(Sender.frame(data, options), cb); - } - } - - /** - * Sends a pong message to the other peer. - * - * @param {*} data The message to send - * @param {Boolean} [mask=false] Specifies whether or not to mask `data` - * @param {Function} [cb] Callback - * @public - */ - pong(data, mask, cb) { - let byteLength; - let readOnly; - - if (typeof data === 'string') { - byteLength = Buffer.byteLength(data); - readOnly = false; - } else { - data = toBuffer(data); - byteLength = data.length; - readOnly = toBuffer.readOnly; - } - - if (byteLength > 125) { - throw new RangeError('The data size must not be greater than 125 bytes'); - } - - const options = { - [kByteLength]: byteLength, - fin: true, - generateMask: this._generateMask, - mask, - maskBuffer: this._maskBuffer, - opcode: 0x0a, - readOnly, - rsv1: false - }; - - if (this._deflating) { - this.enqueue([this.dispatch, data, false, options, cb]); - } else { - this.sendFrame(Sender.frame(data, options), cb); - } - } - - /** - * Sends a data message to the other peer. - * - * @param {*} data The message to send - * @param {Object} options Options object - * @param {Boolean} [options.binary=false] Specifies whether `data` is binary - * or text - * @param {Boolean} [options.compress=false] Specifies whether or not to - * compress `data` - * @param {Boolean} [options.fin=false] Specifies whether the fragment is the - * last one - * @param {Boolean} [options.mask=false] Specifies whether or not to mask - * `data` - * @param {Function} [cb] Callback - * @public - */ - send(data, options, cb) { - const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName]; - let opcode = options.binary ? 2 : 1; - let rsv1 = options.compress; - - let byteLength; - let readOnly; - - if (typeof data === 'string') { - byteLength = Buffer.byteLength(data); - readOnly = false; - } else { - data = toBuffer(data); - byteLength = data.length; - readOnly = toBuffer.readOnly; - } - - if (this._firstFragment) { - this._firstFragment = false; - if ( - rsv1 && - perMessageDeflate && - perMessageDeflate.params[ - perMessageDeflate._isServer - ? 'server_no_context_takeover' - : 'client_no_context_takeover' - ] - ) { - rsv1 = byteLength >= perMessageDeflate._threshold; - } - this._compress = rsv1; - } else { - rsv1 = false; - opcode = 0; - } - - if (options.fin) this._firstFragment = true; - - if (perMessageDeflate) { - const opts = { - [kByteLength]: byteLength, - fin: options.fin, - generateMask: this._generateMask, - mask: options.mask, - maskBuffer: this._maskBuffer, - opcode, - readOnly, - rsv1 - }; - - if (this._deflating) { - this.enqueue([this.dispatch, data, this._compress, opts, cb]); - } else { - this.dispatch(data, this._compress, opts, cb); - } - } else { - this.sendFrame( - Sender.frame(data, { - [kByteLength]: byteLength, - fin: options.fin, - generateMask: this._generateMask, - mask: options.mask, - maskBuffer: this._maskBuffer, - opcode, - readOnly, - rsv1: false - }), - cb - ); - } - } - - /** - * Dispatches a message. - * - * @param {(Buffer|String)} data The message to send - * @param {Boolean} [compress=false] Specifies whether or not to compress - * `data` - * @param {Object} options Options object - * @param {Boolean} [options.fin=false] Specifies whether or not to set the - * FIN bit - * @param {Function} [options.generateMask] The function used to generate the - * masking key - * @param {Boolean} [options.mask=false] Specifies whether or not to mask - * `data` - * @param {Buffer} [options.maskBuffer] The buffer used to store the masking - * key - * @param {Number} options.opcode The opcode - * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be - * modified - * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the - * RSV1 bit - * @param {Function} [cb] Callback - * @private - */ - dispatch(data, compress, options, cb) { - if (!compress) { - this.sendFrame(Sender.frame(data, options), cb); - return; - } - - const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName]; - - this._bufferedBytes += options[kByteLength]; - this._deflating = true; - perMessageDeflate.compress(data, options.fin, (_, buf) => { - if (this._socket.destroyed) { - const err = new Error( - 'The socket was closed while data was being compressed' - ); - - if (typeof cb === 'function') cb(err); - - for (let i = 0; i < this._queue.length; i++) { - const params = this._queue[i]; - const callback = params[params.length - 1]; - - if (typeof callback === 'function') callback(err); - } - - return; - } - - this._bufferedBytes -= options[kByteLength]; - this._deflating = false; - options.readOnly = false; - this.sendFrame(Sender.frame(buf, options), cb); - this.dequeue(); - }); - } - - /** - * Executes queued send operations. - * - * @private - */ - dequeue() { - while (!this._deflating && this._queue.length) { - const params = this._queue.shift(); - - this._bufferedBytes -= params[3][kByteLength]; - Reflect.apply(params[0], this, params.slice(1)); - } - } - - /** - * Enqueues a send operation. - * - * @param {Array} params Send operation parameters. - * @private - */ - enqueue(params) { - this._bufferedBytes += params[3][kByteLength]; - this._queue.push(params); - } - - /** - * Sends a frame. - * - * @param {Buffer[]} list The frame to send - * @param {Function} [cb] Callback - * @private - */ - sendFrame(list, cb) { - if (list.length === 2) { - this._socket.cork(); - this._socket.write(list[0]); - this._socket.write(list[1], cb); - this._socket.uncork(); - } else { - this._socket.write(list[0], cb); - } - } -} - -module.exports = Sender; diff --git a/tools/mnemonic-test/node_modules/ws/lib/stream.js b/tools/mnemonic-test/node_modules/ws/lib/stream.js deleted file mode 100644 index 230734b7..00000000 --- a/tools/mnemonic-test/node_modules/ws/lib/stream.js +++ /dev/null @@ -1,159 +0,0 @@ -'use strict'; - -const { Duplex } = require('stream'); - -/** - * Emits the `'close'` event on a stream. - * - * @param {Duplex} stream The stream. - * @private - */ -function emitClose(stream) { - stream.emit('close'); -} - -/** - * The listener of the `'end'` event. - * - * @private - */ -function duplexOnEnd() { - if (!this.destroyed && this._writableState.finished) { - this.destroy(); - } -} - -/** - * The listener of the `'error'` event. - * - * @param {Error} err The error - * @private - */ -function duplexOnError(err) { - this.removeListener('error', duplexOnError); - this.destroy(); - if (this.listenerCount('error') === 0) { - // Do not suppress the throwing behavior. - this.emit('error', err); - } -} - -/** - * Wraps a `WebSocket` in a duplex stream. - * - * @param {WebSocket} ws The `WebSocket` to wrap - * @param {Object} [options] The options for the `Duplex` constructor - * @return {Duplex} The duplex stream - * @public - */ -function createWebSocketStream(ws, options) { - let terminateOnDestroy = true; - - const duplex = new Duplex({ - ...options, - autoDestroy: false, - emitClose: false, - objectMode: false, - writableObjectMode: false - }); - - ws.on('message', function message(msg, isBinary) { - const data = - !isBinary && duplex._readableState.objectMode ? msg.toString() : msg; - - if (!duplex.push(data)) ws.pause(); - }); - - ws.once('error', function error(err) { - if (duplex.destroyed) return; - - // Prevent `ws.terminate()` from being called by `duplex._destroy()`. - // - // - If the `'error'` event is emitted before the `'open'` event, then - // `ws.terminate()` is a noop as no socket is assigned. - // - Otherwise, the error is re-emitted by the listener of the `'error'` - // event of the `Receiver` object. The listener already closes the - // connection by calling `ws.close()`. This allows a close frame to be - // sent to the other peer. If `ws.terminate()` is called right after this, - // then the close frame might not be sent. - terminateOnDestroy = false; - duplex.destroy(err); - }); - - ws.once('close', function close() { - if (duplex.destroyed) return; - - duplex.push(null); - }); - - duplex._destroy = function (err, callback) { - if (ws.readyState === ws.CLOSED) { - callback(err); - process.nextTick(emitClose, duplex); - return; - } - - let called = false; - - ws.once('error', function error(err) { - called = true; - callback(err); - }); - - ws.once('close', function close() { - if (!called) callback(err); - process.nextTick(emitClose, duplex); - }); - - if (terminateOnDestroy) ws.terminate(); - }; - - duplex._final = function (callback) { - if (ws.readyState === ws.CONNECTING) { - ws.once('open', function open() { - duplex._final(callback); - }); - return; - } - - // If the value of the `_socket` property is `null` it means that `ws` is a - // client websocket and the handshake failed. In fact, when this happens, a - // socket is never assigned to the websocket. Wait for the `'error'` event - // that will be emitted by the websocket. - if (ws._socket === null) return; - - if (ws._socket._writableState.finished) { - callback(); - if (duplex._readableState.endEmitted) duplex.destroy(); - } else { - ws._socket.once('finish', function finish() { - // `duplex` is not destroyed here because the `'end'` event will be - // emitted on `duplex` after this `'finish'` event. The EOF signaling - // `null` chunk is, in fact, pushed when the websocket emits `'close'`. - callback(); - }); - ws.close(); - } - }; - - duplex._read = function () { - if (ws.isPaused) ws.resume(); - }; - - duplex._write = function (chunk, encoding, callback) { - if (ws.readyState === ws.CONNECTING) { - ws.once('open', function open() { - duplex._write(chunk, encoding, callback); - }); - return; - } - - ws.send(chunk, callback); - }; - - duplex.on('end', duplexOnEnd); - duplex.on('error', duplexOnError); - return duplex; -} - -module.exports = createWebSocketStream; diff --git a/tools/mnemonic-test/node_modules/ws/lib/subprotocol.js b/tools/mnemonic-test/node_modules/ws/lib/subprotocol.js deleted file mode 100644 index d4381e88..00000000 --- a/tools/mnemonic-test/node_modules/ws/lib/subprotocol.js +++ /dev/null @@ -1,62 +0,0 @@ -'use strict'; - -const { tokenChars } = require('./validation'); - -/** - * Parses the `Sec-WebSocket-Protocol` header into a set of subprotocol names. - * - * @param {String} header The field value of the header - * @return {Set} The subprotocol names - * @public - */ -function parse(header) { - const protocols = new Set(); - let start = -1; - let end = -1; - let i = 0; - - for (i; i < header.length; i++) { - const code = header.charCodeAt(i); - - if (end === -1 && tokenChars[code] === 1) { - if (start === -1) start = i; - } else if ( - i !== 0 && - (code === 0x20 /* ' ' */ || code === 0x09) /* '\t' */ - ) { - if (end === -1 && start !== -1) end = i; - } else if (code === 0x2c /* ',' */) { - if (start === -1) { - throw new SyntaxError(`Unexpected character at index ${i}`); - } - - if (end === -1) end = i; - - const protocol = header.slice(start, end); - - if (protocols.has(protocol)) { - throw new SyntaxError(`The "${protocol}" subprotocol is duplicated`); - } - - protocols.add(protocol); - start = end = -1; - } else { - throw new SyntaxError(`Unexpected character at index ${i}`); - } - } - - if (start === -1 || end !== -1) { - throw new SyntaxError('Unexpected end of input'); - } - - const protocol = header.slice(start, i); - - if (protocols.has(protocol)) { - throw new SyntaxError(`The "${protocol}" subprotocol is duplicated`); - } - - protocols.add(protocol); - return protocols; -} - -module.exports = { parse }; diff --git a/tools/mnemonic-test/node_modules/ws/lib/validation.js b/tools/mnemonic-test/node_modules/ws/lib/validation.js deleted file mode 100644 index c352e6ea..00000000 --- a/tools/mnemonic-test/node_modules/ws/lib/validation.js +++ /dev/null @@ -1,130 +0,0 @@ -'use strict'; - -const { isUtf8 } = require('buffer'); - -// -// Allowed token characters: -// -// '!', '#', '$', '%', '&', ''', '*', '+', '-', -// '.', 0-9, A-Z, '^', '_', '`', a-z, '|', '~' -// -// tokenChars[32] === 0 // ' ' -// tokenChars[33] === 1 // '!' -// tokenChars[34] === 0 // '"' -// ... -// -// prettier-ignore -const tokenChars = [ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 15 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16 - 31 - 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, // 32 - 47 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // 48 - 63 - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 64 - 79 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, // 80 - 95 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 96 - 111 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0 // 112 - 127 -]; - -/** - * Checks if a status code is allowed in a close frame. - * - * @param {Number} code The status code - * @return {Boolean} `true` if the status code is valid, else `false` - * @public - */ -function isValidStatusCode(code) { - return ( - (code >= 1000 && - code <= 1014 && - code !== 1004 && - code !== 1005 && - code !== 1006) || - (code >= 3000 && code <= 4999) - ); -} - -/** - * Checks if a given buffer contains only correct UTF-8. - * Ported from https://www.cl.cam.ac.uk/%7Emgk25/ucs/utf8_check.c by - * Markus Kuhn. - * - * @param {Buffer} buf The buffer to check - * @return {Boolean} `true` if `buf` contains only correct UTF-8, else `false` - * @public - */ -function _isValidUTF8(buf) { - const len = buf.length; - let i = 0; - - while (i < len) { - if ((buf[i] & 0x80) === 0) { - // 0xxxxxxx - i++; - } else if ((buf[i] & 0xe0) === 0xc0) { - // 110xxxxx 10xxxxxx - if ( - i + 1 === len || - (buf[i + 1] & 0xc0) !== 0x80 || - (buf[i] & 0xfe) === 0xc0 // Overlong - ) { - return false; - } - - i += 2; - } else if ((buf[i] & 0xf0) === 0xe0) { - // 1110xxxx 10xxxxxx 10xxxxxx - if ( - i + 2 >= len || - (buf[i + 1] & 0xc0) !== 0x80 || - (buf[i + 2] & 0xc0) !== 0x80 || - (buf[i] === 0xe0 && (buf[i + 1] & 0xe0) === 0x80) || // Overlong - (buf[i] === 0xed && (buf[i + 1] & 0xe0) === 0xa0) // Surrogate (U+D800 - U+DFFF) - ) { - return false; - } - - i += 3; - } else if ((buf[i] & 0xf8) === 0xf0) { - // 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx - if ( - i + 3 >= len || - (buf[i + 1] & 0xc0) !== 0x80 || - (buf[i + 2] & 0xc0) !== 0x80 || - (buf[i + 3] & 0xc0) !== 0x80 || - (buf[i] === 0xf0 && (buf[i + 1] & 0xf0) === 0x80) || // Overlong - (buf[i] === 0xf4 && buf[i + 1] > 0x8f) || - buf[i] > 0xf4 // > U+10FFFF - ) { - return false; - } - - i += 4; - } else { - return false; - } - } - - return true; -} - -module.exports = { - isValidStatusCode, - isValidUTF8: _isValidUTF8, - tokenChars -}; - -if (isUtf8) { - module.exports.isValidUTF8 = function (buf) { - return buf.length < 24 ? _isValidUTF8(buf) : isUtf8(buf); - }; -} /* istanbul ignore else */ else if (!process.env.WS_NO_UTF_8_VALIDATE) { - try { - const isValidUTF8 = require('utf-8-validate'); - - module.exports.isValidUTF8 = function (buf) { - return buf.length < 32 ? _isValidUTF8(buf) : isValidUTF8(buf); - }; - } catch (e) { - // Continue regardless of the error. - } -} diff --git a/tools/mnemonic-test/node_modules/ws/lib/websocket-server.js b/tools/mnemonic-test/node_modules/ws/lib/websocket-server.js deleted file mode 100644 index 67b52ffd..00000000 --- a/tools/mnemonic-test/node_modules/ws/lib/websocket-server.js +++ /dev/null @@ -1,540 +0,0 @@ -/* eslint no-unused-vars: ["error", { "varsIgnorePattern": "^Duplex$", "caughtErrors": "none" }] */ - -'use strict'; - -const EventEmitter = require('events'); -const http = require('http'); -const { Duplex } = require('stream'); -const { createHash } = require('crypto'); - -const extension = require('./extension'); -const PerMessageDeflate = require('./permessage-deflate'); -const subprotocol = require('./subprotocol'); -const WebSocket = require('./websocket'); -const { GUID, kWebSocket } = require('./constants'); - -const keyRegex = /^[+/0-9A-Za-z]{22}==$/; - -const RUNNING = 0; -const CLOSING = 1; -const CLOSED = 2; - -/** - * Class representing a WebSocket server. - * - * @extends EventEmitter - */ -class WebSocketServer extends EventEmitter { - /** - * Create a `WebSocketServer` instance. - * - * @param {Object} options Configuration options - * @param {Boolean} [options.allowSynchronousEvents=true] Specifies whether - * any of the `'message'`, `'ping'`, and `'pong'` events can be emitted - * multiple times in the same tick - * @param {Boolean} [options.autoPong=true] Specifies whether or not to - * automatically send a pong in response to a ping - * @param {Number} [options.backlog=511] The maximum length of the queue of - * pending connections - * @param {Boolean} [options.clientTracking=true] Specifies whether or not to - * track clients - * @param {Function} [options.handleProtocols] A hook to handle protocols - * @param {String} [options.host] The hostname where to bind the server - * @param {Number} [options.maxPayload=104857600] The maximum allowed message - * size - * @param {Boolean} [options.noServer=false] Enable no server mode - * @param {String} [options.path] Accept only connections matching this path - * @param {(Boolean|Object)} [options.perMessageDeflate=false] Enable/disable - * permessage-deflate - * @param {Number} [options.port] The port where to bind the server - * @param {(http.Server|https.Server)} [options.server] A pre-created HTTP/S - * server to use - * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or - * not to skip UTF-8 validation for text and close messages - * @param {Function} [options.verifyClient] A hook to reject connections - * @param {Function} [options.WebSocket=WebSocket] Specifies the `WebSocket` - * class to use. It must be the `WebSocket` class or class that extends it - * @param {Function} [callback] A listener for the `listening` event - */ - constructor(options, callback) { - super(); - - options = { - allowSynchronousEvents: true, - autoPong: true, - maxPayload: 100 * 1024 * 1024, - skipUTF8Validation: false, - perMessageDeflate: false, - handleProtocols: null, - clientTracking: true, - verifyClient: null, - noServer: false, - backlog: null, // use default (511 as implemented in net.js) - server: null, - host: null, - path: null, - port: null, - WebSocket, - ...options - }; - - if ( - (options.port == null && !options.server && !options.noServer) || - (options.port != null && (options.server || options.noServer)) || - (options.server && options.noServer) - ) { - throw new TypeError( - 'One and only one of the "port", "server", or "noServer" options ' + - 'must be specified' - ); - } - - if (options.port != null) { - this._server = http.createServer((req, res) => { - const body = http.STATUS_CODES[426]; - - res.writeHead(426, { - 'Content-Length': body.length, - 'Content-Type': 'text/plain' - }); - res.end(body); - }); - this._server.listen( - options.port, - options.host, - options.backlog, - callback - ); - } else if (options.server) { - this._server = options.server; - } - - if (this._server) { - const emitConnection = this.emit.bind(this, 'connection'); - - this._removeListeners = addListeners(this._server, { - listening: this.emit.bind(this, 'listening'), - error: this.emit.bind(this, 'error'), - upgrade: (req, socket, head) => { - this.handleUpgrade(req, socket, head, emitConnection); - } - }); - } - - if (options.perMessageDeflate === true) options.perMessageDeflate = {}; - if (options.clientTracking) { - this.clients = new Set(); - this._shouldEmitClose = false; - } - - this.options = options; - this._state = RUNNING; - } - - /** - * Returns the bound address, the address family name, and port of the server - * as reported by the operating system if listening on an IP socket. - * If the server is listening on a pipe or UNIX domain socket, the name is - * returned as a string. - * - * @return {(Object|String|null)} The address of the server - * @public - */ - address() { - if (this.options.noServer) { - throw new Error('The server is operating in "noServer" mode'); - } - - if (!this._server) return null; - return this._server.address(); - } - - /** - * Stop the server from accepting new connections and emit the `'close'` event - * when all existing connections are closed. - * - * @param {Function} [cb] A one-time listener for the `'close'` event - * @public - */ - close(cb) { - if (this._state === CLOSED) { - if (cb) { - this.once('close', () => { - cb(new Error('The server is not running')); - }); - } - - process.nextTick(emitClose, this); - return; - } - - if (cb) this.once('close', cb); - - if (this._state === CLOSING) return; - this._state = CLOSING; - - if (this.options.noServer || this.options.server) { - if (this._server) { - this._removeListeners(); - this._removeListeners = this._server = null; - } - - if (this.clients) { - if (!this.clients.size) { - process.nextTick(emitClose, this); - } else { - this._shouldEmitClose = true; - } - } else { - process.nextTick(emitClose, this); - } - } else { - const server = this._server; - - this._removeListeners(); - this._removeListeners = this._server = null; - - // - // The HTTP/S server was created internally. Close it, and rely on its - // `'close'` event. - // - server.close(() => { - emitClose(this); - }); - } - } - - /** - * See if a given request should be handled by this server instance. - * - * @param {http.IncomingMessage} req Request object to inspect - * @return {Boolean} `true` if the request is valid, else `false` - * @public - */ - shouldHandle(req) { - if (this.options.path) { - const index = req.url.indexOf('?'); - const pathname = index !== -1 ? req.url.slice(0, index) : req.url; - - if (pathname !== this.options.path) return false; - } - - return true; - } - - /** - * Handle a HTTP Upgrade request. - * - * @param {http.IncomingMessage} req The request object - * @param {Duplex} socket The network socket between the server and client - * @param {Buffer} head The first packet of the upgraded stream - * @param {Function} cb Callback - * @public - */ - handleUpgrade(req, socket, head, cb) { - socket.on('error', socketOnError); - - const key = req.headers['sec-websocket-key']; - const upgrade = req.headers.upgrade; - const version = +req.headers['sec-websocket-version']; - - if (req.method !== 'GET') { - const message = 'Invalid HTTP method'; - abortHandshakeOrEmitwsClientError(this, req, socket, 405, message); - return; - } - - if (upgrade === undefined || upgrade.toLowerCase() !== 'websocket') { - const message = 'Invalid Upgrade header'; - abortHandshakeOrEmitwsClientError(this, req, socket, 400, message); - return; - } - - if (key === undefined || !keyRegex.test(key)) { - const message = 'Missing or invalid Sec-WebSocket-Key header'; - abortHandshakeOrEmitwsClientError(this, req, socket, 400, message); - return; - } - - if (version !== 8 && version !== 13) { - const message = 'Missing or invalid Sec-WebSocket-Version header'; - abortHandshakeOrEmitwsClientError(this, req, socket, 400, message); - return; - } - - if (!this.shouldHandle(req)) { - abortHandshake(socket, 400); - return; - } - - const secWebSocketProtocol = req.headers['sec-websocket-protocol']; - let protocols = new Set(); - - if (secWebSocketProtocol !== undefined) { - try { - protocols = subprotocol.parse(secWebSocketProtocol); - } catch (err) { - const message = 'Invalid Sec-WebSocket-Protocol header'; - abortHandshakeOrEmitwsClientError(this, req, socket, 400, message); - return; - } - } - - const secWebSocketExtensions = req.headers['sec-websocket-extensions']; - const extensions = {}; - - if ( - this.options.perMessageDeflate && - secWebSocketExtensions !== undefined - ) { - const perMessageDeflate = new PerMessageDeflate( - this.options.perMessageDeflate, - true, - this.options.maxPayload - ); - - try { - const offers = extension.parse(secWebSocketExtensions); - - if (offers[PerMessageDeflate.extensionName]) { - perMessageDeflate.accept(offers[PerMessageDeflate.extensionName]); - extensions[PerMessageDeflate.extensionName] = perMessageDeflate; - } - } catch (err) { - const message = - 'Invalid or unacceptable Sec-WebSocket-Extensions header'; - abortHandshakeOrEmitwsClientError(this, req, socket, 400, message); - return; - } - } - - // - // Optionally call external client verification handler. - // - if (this.options.verifyClient) { - const info = { - origin: - req.headers[`${version === 8 ? 'sec-websocket-origin' : 'origin'}`], - secure: !!(req.socket.authorized || req.socket.encrypted), - req - }; - - if (this.options.verifyClient.length === 2) { - this.options.verifyClient(info, (verified, code, message, headers) => { - if (!verified) { - return abortHandshake(socket, code || 401, message, headers); - } - - this.completeUpgrade( - extensions, - key, - protocols, - req, - socket, - head, - cb - ); - }); - return; - } - - if (!this.options.verifyClient(info)) return abortHandshake(socket, 401); - } - - this.completeUpgrade(extensions, key, protocols, req, socket, head, cb); - } - - /** - * Upgrade the connection to WebSocket. - * - * @param {Object} extensions The accepted extensions - * @param {String} key The value of the `Sec-WebSocket-Key` header - * @param {Set} protocols The subprotocols - * @param {http.IncomingMessage} req The request object - * @param {Duplex} socket The network socket between the server and client - * @param {Buffer} head The first packet of the upgraded stream - * @param {Function} cb Callback - * @throws {Error} If called more than once with the same socket - * @private - */ - completeUpgrade(extensions, key, protocols, req, socket, head, cb) { - // - // Destroy the socket if the client has already sent a FIN packet. - // - if (!socket.readable || !socket.writable) return socket.destroy(); - - if (socket[kWebSocket]) { - throw new Error( - 'server.handleUpgrade() was called more than once with the same ' + - 'socket, possibly due to a misconfiguration' - ); - } - - if (this._state > RUNNING) return abortHandshake(socket, 503); - - const digest = createHash('sha1') - .update(key + GUID) - .digest('base64'); - - const headers = [ - 'HTTP/1.1 101 Switching Protocols', - 'Upgrade: websocket', - 'Connection: Upgrade', - `Sec-WebSocket-Accept: ${digest}` - ]; - - const ws = new this.options.WebSocket(null, undefined, this.options); - - if (protocols.size) { - // - // Optionally call external protocol selection handler. - // - const protocol = this.options.handleProtocols - ? this.options.handleProtocols(protocols, req) - : protocols.values().next().value; - - if (protocol) { - headers.push(`Sec-WebSocket-Protocol: ${protocol}`); - ws._protocol = protocol; - } - } - - if (extensions[PerMessageDeflate.extensionName]) { - const params = extensions[PerMessageDeflate.extensionName].params; - const value = extension.format({ - [PerMessageDeflate.extensionName]: [params] - }); - headers.push(`Sec-WebSocket-Extensions: ${value}`); - ws._extensions = extensions; - } - - // - // Allow external modification/inspection of handshake headers. - // - this.emit('headers', headers, req); - - socket.write(headers.concat('\r\n').join('\r\n')); - socket.removeListener('error', socketOnError); - - ws.setSocket(socket, head, { - allowSynchronousEvents: this.options.allowSynchronousEvents, - maxPayload: this.options.maxPayload, - skipUTF8Validation: this.options.skipUTF8Validation - }); - - if (this.clients) { - this.clients.add(ws); - ws.on('close', () => { - this.clients.delete(ws); - - if (this._shouldEmitClose && !this.clients.size) { - process.nextTick(emitClose, this); - } - }); - } - - cb(ws, req); - } -} - -module.exports = WebSocketServer; - -/** - * Add event listeners on an `EventEmitter` using a map of - * pairs. - * - * @param {EventEmitter} server The event emitter - * @param {Object.} map The listeners to add - * @return {Function} A function that will remove the added listeners when - * called - * @private - */ -function addListeners(server, map) { - for (const event of Object.keys(map)) server.on(event, map[event]); - - return function removeListeners() { - for (const event of Object.keys(map)) { - server.removeListener(event, map[event]); - } - }; -} - -/** - * Emit a `'close'` event on an `EventEmitter`. - * - * @param {EventEmitter} server The event emitter - * @private - */ -function emitClose(server) { - server._state = CLOSED; - server.emit('close'); -} - -/** - * Handle socket errors. - * - * @private - */ -function socketOnError() { - this.destroy(); -} - -/** - * Close the connection when preconditions are not fulfilled. - * - * @param {Duplex} socket The socket of the upgrade request - * @param {Number} code The HTTP response status code - * @param {String} [message] The HTTP response body - * @param {Object} [headers] Additional HTTP response headers - * @private - */ -function abortHandshake(socket, code, message, headers) { - // - // The socket is writable unless the user destroyed or ended it before calling - // `server.handleUpgrade()` or in the `verifyClient` function, which is a user - // error. Handling this does not make much sense as the worst that can happen - // is that some of the data written by the user might be discarded due to the - // call to `socket.end()` below, which triggers an `'error'` event that in - // turn causes the socket to be destroyed. - // - message = message || http.STATUS_CODES[code]; - headers = { - Connection: 'close', - 'Content-Type': 'text/html', - 'Content-Length': Buffer.byteLength(message), - ...headers - }; - - socket.once('finish', socket.destroy); - - socket.end( - `HTTP/1.1 ${code} ${http.STATUS_CODES[code]}\r\n` + - Object.keys(headers) - .map((h) => `${h}: ${headers[h]}`) - .join('\r\n') + - '\r\n\r\n' + - message - ); -} - -/** - * Emit a `'wsClientError'` event on a `WebSocketServer` if there is at least - * one listener for it, otherwise call `abortHandshake()`. - * - * @param {WebSocketServer} server The WebSocket server - * @param {http.IncomingMessage} req The request object - * @param {Duplex} socket The socket of the upgrade request - * @param {Number} code The HTTP response status code - * @param {String} message The HTTP response body - * @private - */ -function abortHandshakeOrEmitwsClientError(server, req, socket, code, message) { - if (server.listenerCount('wsClientError')) { - const err = new Error(message); - Error.captureStackTrace(err, abortHandshakeOrEmitwsClientError); - - server.emit('wsClientError', err, socket, req); - } else { - abortHandshake(socket, code, message); - } -} diff --git a/tools/mnemonic-test/node_modules/ws/lib/websocket.js b/tools/mnemonic-test/node_modules/ws/lib/websocket.js deleted file mode 100644 index aa57bbad..00000000 --- a/tools/mnemonic-test/node_modules/ws/lib/websocket.js +++ /dev/null @@ -1,1338 +0,0 @@ -/* eslint no-unused-vars: ["error", { "varsIgnorePattern": "^Duplex|Readable$", "caughtErrors": "none" }] */ - -'use strict'; - -const EventEmitter = require('events'); -const https = require('https'); -const http = require('http'); -const net = require('net'); -const tls = require('tls'); -const { randomBytes, createHash } = require('crypto'); -const { Duplex, Readable } = require('stream'); -const { URL } = require('url'); - -const PerMessageDeflate = require('./permessage-deflate'); -const Receiver = require('./receiver'); -const Sender = require('./sender'); -const { - BINARY_TYPES, - EMPTY_BUFFER, - GUID, - kForOnEventAttribute, - kListener, - kStatusCode, - kWebSocket, - NOOP -} = require('./constants'); -const { - EventTarget: { addEventListener, removeEventListener } -} = require('./event-target'); -const { format, parse } = require('./extension'); -const { toBuffer } = require('./buffer-util'); - -const closeTimeout = 30 * 1000; -const kAborted = Symbol('kAborted'); -const protocolVersions = [8, 13]; -const readyStates = ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED']; -const subprotocolRegex = /^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/; - -/** - * Class representing a WebSocket. - * - * @extends EventEmitter - */ -class WebSocket extends EventEmitter { - /** - * Create a new `WebSocket`. - * - * @param {(String|URL)} address The URL to which to connect - * @param {(String|String[])} [protocols] The subprotocols - * @param {Object} [options] Connection options - */ - constructor(address, protocols, options) { - super(); - - this._binaryType = BINARY_TYPES[0]; - this._closeCode = 1006; - this._closeFrameReceived = false; - this._closeFrameSent = false; - this._closeMessage = EMPTY_BUFFER; - this._closeTimer = null; - this._extensions = {}; - this._paused = false; - this._protocol = ''; - this._readyState = WebSocket.CONNECTING; - this._receiver = null; - this._sender = null; - this._socket = null; - - if (address !== null) { - this._bufferedAmount = 0; - this._isServer = false; - this._redirects = 0; - - if (protocols === undefined) { - protocols = []; - } else if (!Array.isArray(protocols)) { - if (typeof protocols === 'object' && protocols !== null) { - options = protocols; - protocols = []; - } else { - protocols = [protocols]; - } - } - - initAsClient(this, address, protocols, options); - } else { - this._autoPong = options.autoPong; - this._isServer = true; - } - } - - /** - * This deviates from the WHATWG interface since ws doesn't support the - * required default "blob" type (instead we define a custom "nodebuffer" - * type). - * - * @type {String} - */ - get binaryType() { - return this._binaryType; - } - - set binaryType(type) { - if (!BINARY_TYPES.includes(type)) return; - - this._binaryType = type; - - // - // Allow to change `binaryType` on the fly. - // - if (this._receiver) this._receiver._binaryType = type; - } - - /** - * @type {Number} - */ - get bufferedAmount() { - if (!this._socket) return this._bufferedAmount; - - return this._socket._writableState.length + this._sender._bufferedBytes; - } - - /** - * @type {String} - */ - get extensions() { - return Object.keys(this._extensions).join(); - } - - /** - * @type {Boolean} - */ - get isPaused() { - return this._paused; - } - - /** - * @type {Function} - */ - /* istanbul ignore next */ - get onclose() { - return null; - } - - /** - * @type {Function} - */ - /* istanbul ignore next */ - get onerror() { - return null; - } - - /** - * @type {Function} - */ - /* istanbul ignore next */ - get onopen() { - return null; - } - - /** - * @type {Function} - */ - /* istanbul ignore next */ - get onmessage() { - return null; - } - - /** - * @type {String} - */ - get protocol() { - return this._protocol; - } - - /** - * @type {Number} - */ - get readyState() { - return this._readyState; - } - - /** - * @type {String} - */ - get url() { - return this._url; - } - - /** - * Set up the socket and the internal resources. - * - * @param {Duplex} socket The network socket between the server and client - * @param {Buffer} head The first packet of the upgraded stream - * @param {Object} options Options object - * @param {Boolean} [options.allowSynchronousEvents=false] Specifies whether - * any of the `'message'`, `'ping'`, and `'pong'` events can be emitted - * multiple times in the same tick - * @param {Function} [options.generateMask] The function used to generate the - * masking key - * @param {Number} [options.maxPayload=0] The maximum allowed message size - * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or - * not to skip UTF-8 validation for text and close messages - * @private - */ - setSocket(socket, head, options) { - const receiver = new Receiver({ - allowSynchronousEvents: options.allowSynchronousEvents, - binaryType: this.binaryType, - extensions: this._extensions, - isServer: this._isServer, - maxPayload: options.maxPayload, - skipUTF8Validation: options.skipUTF8Validation - }); - - this._sender = new Sender(socket, this._extensions, options.generateMask); - this._receiver = receiver; - this._socket = socket; - - receiver[kWebSocket] = this; - socket[kWebSocket] = this; - - receiver.on('conclude', receiverOnConclude); - receiver.on('drain', receiverOnDrain); - receiver.on('error', receiverOnError); - receiver.on('message', receiverOnMessage); - receiver.on('ping', receiverOnPing); - receiver.on('pong', receiverOnPong); - - // - // These methods may not be available if `socket` is just a `Duplex`. - // - if (socket.setTimeout) socket.setTimeout(0); - if (socket.setNoDelay) socket.setNoDelay(); - - if (head.length > 0) socket.unshift(head); - - socket.on('close', socketOnClose); - socket.on('data', socketOnData); - socket.on('end', socketOnEnd); - socket.on('error', socketOnError); - - this._readyState = WebSocket.OPEN; - this.emit('open'); - } - - /** - * Emit the `'close'` event. - * - * @private - */ - emitClose() { - if (!this._socket) { - this._readyState = WebSocket.CLOSED; - this.emit('close', this._closeCode, this._closeMessage); - return; - } - - if (this._extensions[PerMessageDeflate.extensionName]) { - this._extensions[PerMessageDeflate.extensionName].cleanup(); - } - - this._receiver.removeAllListeners(); - this._readyState = WebSocket.CLOSED; - this.emit('close', this._closeCode, this._closeMessage); - } - - /** - * Start a closing handshake. - * - * +----------+ +-----------+ +----------+ - * - - -|ws.close()|-->|close frame|-->|ws.close()|- - - - * | +----------+ +-----------+ +----------+ | - * +----------+ +-----------+ | - * CLOSING |ws.close()|<--|close frame|<--+-----+ CLOSING - * +----------+ +-----------+ | - * | | | +---+ | - * +------------------------+-->|fin| - - - - - * | +---+ | +---+ - * - - - - -|fin|<---------------------+ - * +---+ - * - * @param {Number} [code] Status code explaining why the connection is closing - * @param {(String|Buffer)} [data] The reason why the connection is - * closing - * @public - */ - close(code, data) { - if (this.readyState === WebSocket.CLOSED) return; - if (this.readyState === WebSocket.CONNECTING) { - const msg = 'WebSocket was closed before the connection was established'; - abortHandshake(this, this._req, msg); - return; - } - - if (this.readyState === WebSocket.CLOSING) { - if ( - this._closeFrameSent && - (this._closeFrameReceived || this._receiver._writableState.errorEmitted) - ) { - this._socket.end(); - } - - return; - } - - this._readyState = WebSocket.CLOSING; - this._sender.close(code, data, !this._isServer, (err) => { - // - // This error is handled by the `'error'` listener on the socket. We only - // want to know if the close frame has been sent here. - // - if (err) return; - - this._closeFrameSent = true; - - if ( - this._closeFrameReceived || - this._receiver._writableState.errorEmitted - ) { - this._socket.end(); - } - }); - - // - // Specify a timeout for the closing handshake to complete. - // - this._closeTimer = setTimeout( - this._socket.destroy.bind(this._socket), - closeTimeout - ); - } - - /** - * Pause the socket. - * - * @public - */ - pause() { - if ( - this.readyState === WebSocket.CONNECTING || - this.readyState === WebSocket.CLOSED - ) { - return; - } - - this._paused = true; - this._socket.pause(); - } - - /** - * Send a ping. - * - * @param {*} [data] The data to send - * @param {Boolean} [mask] Indicates whether or not to mask `data` - * @param {Function} [cb] Callback which is executed when the ping is sent - * @public - */ - ping(data, mask, cb) { - if (this.readyState === WebSocket.CONNECTING) { - throw new Error('WebSocket is not open: readyState 0 (CONNECTING)'); - } - - if (typeof data === 'function') { - cb = data; - data = mask = undefined; - } else if (typeof mask === 'function') { - cb = mask; - mask = undefined; - } - - if (typeof data === 'number') data = data.toString(); - - if (this.readyState !== WebSocket.OPEN) { - sendAfterClose(this, data, cb); - return; - } - - if (mask === undefined) mask = !this._isServer; - this._sender.ping(data || EMPTY_BUFFER, mask, cb); - } - - /** - * Send a pong. - * - * @param {*} [data] The data to send - * @param {Boolean} [mask] Indicates whether or not to mask `data` - * @param {Function} [cb] Callback which is executed when the pong is sent - * @public - */ - pong(data, mask, cb) { - if (this.readyState === WebSocket.CONNECTING) { - throw new Error('WebSocket is not open: readyState 0 (CONNECTING)'); - } - - if (typeof data === 'function') { - cb = data; - data = mask = undefined; - } else if (typeof mask === 'function') { - cb = mask; - mask = undefined; - } - - if (typeof data === 'number') data = data.toString(); - - if (this.readyState !== WebSocket.OPEN) { - sendAfterClose(this, data, cb); - return; - } - - if (mask === undefined) mask = !this._isServer; - this._sender.pong(data || EMPTY_BUFFER, mask, cb); - } - - /** - * Resume the socket. - * - * @public - */ - resume() { - if ( - this.readyState === WebSocket.CONNECTING || - this.readyState === WebSocket.CLOSED - ) { - return; - } - - this._paused = false; - if (!this._receiver._writableState.needDrain) this._socket.resume(); - } - - /** - * Send a data message. - * - * @param {*} data The message to send - * @param {Object} [options] Options object - * @param {Boolean} [options.binary] Specifies whether `data` is binary or - * text - * @param {Boolean} [options.compress] Specifies whether or not to compress - * `data` - * @param {Boolean} [options.fin=true] Specifies whether the fragment is the - * last one - * @param {Boolean} [options.mask] Specifies whether or not to mask `data` - * @param {Function} [cb] Callback which is executed when data is written out - * @public - */ - send(data, options, cb) { - if (this.readyState === WebSocket.CONNECTING) { - throw new Error('WebSocket is not open: readyState 0 (CONNECTING)'); - } - - if (typeof options === 'function') { - cb = options; - options = {}; - } - - if (typeof data === 'number') data = data.toString(); - - if (this.readyState !== WebSocket.OPEN) { - sendAfterClose(this, data, cb); - return; - } - - const opts = { - binary: typeof data !== 'string', - mask: !this._isServer, - compress: true, - fin: true, - ...options - }; - - if (!this._extensions[PerMessageDeflate.extensionName]) { - opts.compress = false; - } - - this._sender.send(data || EMPTY_BUFFER, opts, cb); - } - - /** - * Forcibly close the connection. - * - * @public - */ - terminate() { - if (this.readyState === WebSocket.CLOSED) return; - if (this.readyState === WebSocket.CONNECTING) { - const msg = 'WebSocket was closed before the connection was established'; - abortHandshake(this, this._req, msg); - return; - } - - if (this._socket) { - this._readyState = WebSocket.CLOSING; - this._socket.destroy(); - } - } -} - -/** - * @constant {Number} CONNECTING - * @memberof WebSocket - */ -Object.defineProperty(WebSocket, 'CONNECTING', { - enumerable: true, - value: readyStates.indexOf('CONNECTING') -}); - -/** - * @constant {Number} CONNECTING - * @memberof WebSocket.prototype - */ -Object.defineProperty(WebSocket.prototype, 'CONNECTING', { - enumerable: true, - value: readyStates.indexOf('CONNECTING') -}); - -/** - * @constant {Number} OPEN - * @memberof WebSocket - */ -Object.defineProperty(WebSocket, 'OPEN', { - enumerable: true, - value: readyStates.indexOf('OPEN') -}); - -/** - * @constant {Number} OPEN - * @memberof WebSocket.prototype - */ -Object.defineProperty(WebSocket.prototype, 'OPEN', { - enumerable: true, - value: readyStates.indexOf('OPEN') -}); - -/** - * @constant {Number} CLOSING - * @memberof WebSocket - */ -Object.defineProperty(WebSocket, 'CLOSING', { - enumerable: true, - value: readyStates.indexOf('CLOSING') -}); - -/** - * @constant {Number} CLOSING - * @memberof WebSocket.prototype - */ -Object.defineProperty(WebSocket.prototype, 'CLOSING', { - enumerable: true, - value: readyStates.indexOf('CLOSING') -}); - -/** - * @constant {Number} CLOSED - * @memberof WebSocket - */ -Object.defineProperty(WebSocket, 'CLOSED', { - enumerable: true, - value: readyStates.indexOf('CLOSED') -}); - -/** - * @constant {Number} CLOSED - * @memberof WebSocket.prototype - */ -Object.defineProperty(WebSocket.prototype, 'CLOSED', { - enumerable: true, - value: readyStates.indexOf('CLOSED') -}); - -[ - 'binaryType', - 'bufferedAmount', - 'extensions', - 'isPaused', - 'protocol', - 'readyState', - 'url' -].forEach((property) => { - Object.defineProperty(WebSocket.prototype, property, { enumerable: true }); -}); - -// -// Add the `onopen`, `onerror`, `onclose`, and `onmessage` attributes. -// See https://html.spec.whatwg.org/multipage/comms.html#the-websocket-interface -// -['open', 'error', 'close', 'message'].forEach((method) => { - Object.defineProperty(WebSocket.prototype, `on${method}`, { - enumerable: true, - get() { - for (const listener of this.listeners(method)) { - if (listener[kForOnEventAttribute]) return listener[kListener]; - } - - return null; - }, - set(handler) { - for (const listener of this.listeners(method)) { - if (listener[kForOnEventAttribute]) { - this.removeListener(method, listener); - break; - } - } - - if (typeof handler !== 'function') return; - - this.addEventListener(method, handler, { - [kForOnEventAttribute]: true - }); - } - }); -}); - -WebSocket.prototype.addEventListener = addEventListener; -WebSocket.prototype.removeEventListener = removeEventListener; - -module.exports = WebSocket; - -/** - * Initialize a WebSocket client. - * - * @param {WebSocket} websocket The client to initialize - * @param {(String|URL)} address The URL to which to connect - * @param {Array} protocols The subprotocols - * @param {Object} [options] Connection options - * @param {Boolean} [options.allowSynchronousEvents=true] Specifies whether any - * of the `'message'`, `'ping'`, and `'pong'` events can be emitted multiple - * times in the same tick - * @param {Boolean} [options.autoPong=true] Specifies whether or not to - * automatically send a pong in response to a ping - * @param {Function} [options.finishRequest] A function which can be used to - * customize the headers of each http request before it is sent - * @param {Boolean} [options.followRedirects=false] Whether or not to follow - * redirects - * @param {Function} [options.generateMask] The function used to generate the - * masking key - * @param {Number} [options.handshakeTimeout] Timeout in milliseconds for the - * handshake request - * @param {Number} [options.maxPayload=104857600] The maximum allowed message - * size - * @param {Number} [options.maxRedirects=10] The maximum number of redirects - * allowed - * @param {String} [options.origin] Value of the `Origin` or - * `Sec-WebSocket-Origin` header - * @param {(Boolean|Object)} [options.perMessageDeflate=true] Enable/disable - * permessage-deflate - * @param {Number} [options.protocolVersion=13] Value of the - * `Sec-WebSocket-Version` header - * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or - * not to skip UTF-8 validation for text and close messages - * @private - */ -function initAsClient(websocket, address, protocols, options) { - const opts = { - allowSynchronousEvents: true, - autoPong: true, - protocolVersion: protocolVersions[1], - maxPayload: 100 * 1024 * 1024, - skipUTF8Validation: false, - perMessageDeflate: true, - followRedirects: false, - maxRedirects: 10, - ...options, - socketPath: undefined, - hostname: undefined, - protocol: undefined, - timeout: undefined, - method: 'GET', - host: undefined, - path: undefined, - port: undefined - }; - - websocket._autoPong = opts.autoPong; - - if (!protocolVersions.includes(opts.protocolVersion)) { - throw new RangeError( - `Unsupported protocol version: ${opts.protocolVersion} ` + - `(supported versions: ${protocolVersions.join(', ')})` - ); - } - - let parsedUrl; - - if (address instanceof URL) { - parsedUrl = address; - } else { - try { - parsedUrl = new URL(address); - } catch (e) { - throw new SyntaxError(`Invalid URL: ${address}`); - } - } - - if (parsedUrl.protocol === 'http:') { - parsedUrl.protocol = 'ws:'; - } else if (parsedUrl.protocol === 'https:') { - parsedUrl.protocol = 'wss:'; - } - - websocket._url = parsedUrl.href; - - const isSecure = parsedUrl.protocol === 'wss:'; - const isIpcUrl = parsedUrl.protocol === 'ws+unix:'; - let invalidUrlMessage; - - if (parsedUrl.protocol !== 'ws:' && !isSecure && !isIpcUrl) { - invalidUrlMessage = - 'The URL\'s protocol must be one of "ws:", "wss:", ' + - '"http:", "https", or "ws+unix:"'; - } else if (isIpcUrl && !parsedUrl.pathname) { - invalidUrlMessage = "The URL's pathname is empty"; - } else if (parsedUrl.hash) { - invalidUrlMessage = 'The URL contains a fragment identifier'; - } - - if (invalidUrlMessage) { - const err = new SyntaxError(invalidUrlMessage); - - if (websocket._redirects === 0) { - throw err; - } else { - emitErrorAndClose(websocket, err); - return; - } - } - - const defaultPort = isSecure ? 443 : 80; - const key = randomBytes(16).toString('base64'); - const request = isSecure ? https.request : http.request; - const protocolSet = new Set(); - let perMessageDeflate; - - opts.createConnection = - opts.createConnection || (isSecure ? tlsConnect : netConnect); - opts.defaultPort = opts.defaultPort || defaultPort; - opts.port = parsedUrl.port || defaultPort; - opts.host = parsedUrl.hostname.startsWith('[') - ? parsedUrl.hostname.slice(1, -1) - : parsedUrl.hostname; - opts.headers = { - ...opts.headers, - 'Sec-WebSocket-Version': opts.protocolVersion, - 'Sec-WebSocket-Key': key, - Connection: 'Upgrade', - Upgrade: 'websocket' - }; - opts.path = parsedUrl.pathname + parsedUrl.search; - opts.timeout = opts.handshakeTimeout; - - if (opts.perMessageDeflate) { - perMessageDeflate = new PerMessageDeflate( - opts.perMessageDeflate !== true ? opts.perMessageDeflate : {}, - false, - opts.maxPayload - ); - opts.headers['Sec-WebSocket-Extensions'] = format({ - [PerMessageDeflate.extensionName]: perMessageDeflate.offer() - }); - } - if (protocols.length) { - for (const protocol of protocols) { - if ( - typeof protocol !== 'string' || - !subprotocolRegex.test(protocol) || - protocolSet.has(protocol) - ) { - throw new SyntaxError( - 'An invalid or duplicated subprotocol was specified' - ); - } - - protocolSet.add(protocol); - } - - opts.headers['Sec-WebSocket-Protocol'] = protocols.join(','); - } - if (opts.origin) { - if (opts.protocolVersion < 13) { - opts.headers['Sec-WebSocket-Origin'] = opts.origin; - } else { - opts.headers.Origin = opts.origin; - } - } - if (parsedUrl.username || parsedUrl.password) { - opts.auth = `${parsedUrl.username}:${parsedUrl.password}`; - } - - if (isIpcUrl) { - const parts = opts.path.split(':'); - - opts.socketPath = parts[0]; - opts.path = parts[1]; - } - - let req; - - if (opts.followRedirects) { - if (websocket._redirects === 0) { - websocket._originalIpc = isIpcUrl; - websocket._originalSecure = isSecure; - websocket._originalHostOrSocketPath = isIpcUrl - ? opts.socketPath - : parsedUrl.host; - - const headers = options && options.headers; - - // - // Shallow copy the user provided options so that headers can be changed - // without mutating the original object. - // - options = { ...options, headers: {} }; - - if (headers) { - for (const [key, value] of Object.entries(headers)) { - options.headers[key.toLowerCase()] = value; - } - } - } else if (websocket.listenerCount('redirect') === 0) { - const isSameHost = isIpcUrl - ? websocket._originalIpc - ? opts.socketPath === websocket._originalHostOrSocketPath - : false - : websocket._originalIpc - ? false - : parsedUrl.host === websocket._originalHostOrSocketPath; - - if (!isSameHost || (websocket._originalSecure && !isSecure)) { - // - // Match curl 7.77.0 behavior and drop the following headers. These - // headers are also dropped when following a redirect to a subdomain. - // - delete opts.headers.authorization; - delete opts.headers.cookie; - - if (!isSameHost) delete opts.headers.host; - - opts.auth = undefined; - } - } - - // - // Match curl 7.77.0 behavior and make the first `Authorization` header win. - // If the `Authorization` header is set, then there is nothing to do as it - // will take precedence. - // - if (opts.auth && !options.headers.authorization) { - options.headers.authorization = - 'Basic ' + Buffer.from(opts.auth).toString('base64'); - } - - req = websocket._req = request(opts); - - if (websocket._redirects) { - // - // Unlike what is done for the `'upgrade'` event, no early exit is - // triggered here if the user calls `websocket.close()` or - // `websocket.terminate()` from a listener of the `'redirect'` event. This - // is because the user can also call `request.destroy()` with an error - // before calling `websocket.close()` or `websocket.terminate()` and this - // would result in an error being emitted on the `request` object with no - // `'error'` event listeners attached. - // - websocket.emit('redirect', websocket.url, req); - } - } else { - req = websocket._req = request(opts); - } - - if (opts.timeout) { - req.on('timeout', () => { - abortHandshake(websocket, req, 'Opening handshake has timed out'); - }); - } - - req.on('error', (err) => { - if (req === null || req[kAborted]) return; - - req = websocket._req = null; - emitErrorAndClose(websocket, err); - }); - - req.on('response', (res) => { - const location = res.headers.location; - const statusCode = res.statusCode; - - if ( - location && - opts.followRedirects && - statusCode >= 300 && - statusCode < 400 - ) { - if (++websocket._redirects > opts.maxRedirects) { - abortHandshake(websocket, req, 'Maximum redirects exceeded'); - return; - } - - req.abort(); - - let addr; - - try { - addr = new URL(location, address); - } catch (e) { - const err = new SyntaxError(`Invalid URL: ${location}`); - emitErrorAndClose(websocket, err); - return; - } - - initAsClient(websocket, addr, protocols, options); - } else if (!websocket.emit('unexpected-response', req, res)) { - abortHandshake( - websocket, - req, - `Unexpected server response: ${res.statusCode}` - ); - } - }); - - req.on('upgrade', (res, socket, head) => { - websocket.emit('upgrade', res); - - // - // The user may have closed the connection from a listener of the - // `'upgrade'` event. - // - if (websocket.readyState !== WebSocket.CONNECTING) return; - - req = websocket._req = null; - - const upgrade = res.headers.upgrade; - - if (upgrade === undefined || upgrade.toLowerCase() !== 'websocket') { - abortHandshake(websocket, socket, 'Invalid Upgrade header'); - return; - } - - const digest = createHash('sha1') - .update(key + GUID) - .digest('base64'); - - if (res.headers['sec-websocket-accept'] !== digest) { - abortHandshake(websocket, socket, 'Invalid Sec-WebSocket-Accept header'); - return; - } - - const serverProt = res.headers['sec-websocket-protocol']; - let protError; - - if (serverProt !== undefined) { - if (!protocolSet.size) { - protError = 'Server sent a subprotocol but none was requested'; - } else if (!protocolSet.has(serverProt)) { - protError = 'Server sent an invalid subprotocol'; - } - } else if (protocolSet.size) { - protError = 'Server sent no subprotocol'; - } - - if (protError) { - abortHandshake(websocket, socket, protError); - return; - } - - if (serverProt) websocket._protocol = serverProt; - - const secWebSocketExtensions = res.headers['sec-websocket-extensions']; - - if (secWebSocketExtensions !== undefined) { - if (!perMessageDeflate) { - const message = - 'Server sent a Sec-WebSocket-Extensions header but no extension ' + - 'was requested'; - abortHandshake(websocket, socket, message); - return; - } - - let extensions; - - try { - extensions = parse(secWebSocketExtensions); - } catch (err) { - const message = 'Invalid Sec-WebSocket-Extensions header'; - abortHandshake(websocket, socket, message); - return; - } - - const extensionNames = Object.keys(extensions); - - if ( - extensionNames.length !== 1 || - extensionNames[0] !== PerMessageDeflate.extensionName - ) { - const message = 'Server indicated an extension that was not requested'; - abortHandshake(websocket, socket, message); - return; - } - - try { - perMessageDeflate.accept(extensions[PerMessageDeflate.extensionName]); - } catch (err) { - const message = 'Invalid Sec-WebSocket-Extensions header'; - abortHandshake(websocket, socket, message); - return; - } - - websocket._extensions[PerMessageDeflate.extensionName] = - perMessageDeflate; - } - - websocket.setSocket(socket, head, { - allowSynchronousEvents: opts.allowSynchronousEvents, - generateMask: opts.generateMask, - maxPayload: opts.maxPayload, - skipUTF8Validation: opts.skipUTF8Validation - }); - }); - - if (opts.finishRequest) { - opts.finishRequest(req, websocket); - } else { - req.end(); - } -} - -/** - * Emit the `'error'` and `'close'` events. - * - * @param {WebSocket} websocket The WebSocket instance - * @param {Error} The error to emit - * @private - */ -function emitErrorAndClose(websocket, err) { - websocket._readyState = WebSocket.CLOSING; - websocket.emit('error', err); - websocket.emitClose(); -} - -/** - * Create a `net.Socket` and initiate a connection. - * - * @param {Object} options Connection options - * @return {net.Socket} The newly created socket used to start the connection - * @private - */ -function netConnect(options) { - options.path = options.socketPath; - return net.connect(options); -} - -/** - * Create a `tls.TLSSocket` and initiate a connection. - * - * @param {Object} options Connection options - * @return {tls.TLSSocket} The newly created socket used to start the connection - * @private - */ -function tlsConnect(options) { - options.path = undefined; - - if (!options.servername && options.servername !== '') { - options.servername = net.isIP(options.host) ? '' : options.host; - } - - return tls.connect(options); -} - -/** - * Abort the handshake and emit an error. - * - * @param {WebSocket} websocket The WebSocket instance - * @param {(http.ClientRequest|net.Socket|tls.Socket)} stream The request to - * abort or the socket to destroy - * @param {String} message The error message - * @private - */ -function abortHandshake(websocket, stream, message) { - websocket._readyState = WebSocket.CLOSING; - - const err = new Error(message); - Error.captureStackTrace(err, abortHandshake); - - if (stream.setHeader) { - stream[kAborted] = true; - stream.abort(); - - if (stream.socket && !stream.socket.destroyed) { - // - // On Node.js >= 14.3.0 `request.abort()` does not destroy the socket if - // called after the request completed. See - // https://github.com/websockets/ws/issues/1869. - // - stream.socket.destroy(); - } - - process.nextTick(emitErrorAndClose, websocket, err); - } else { - stream.destroy(err); - stream.once('error', websocket.emit.bind(websocket, 'error')); - stream.once('close', websocket.emitClose.bind(websocket)); - } -} - -/** - * Handle cases where the `ping()`, `pong()`, or `send()` methods are called - * when the `readyState` attribute is `CLOSING` or `CLOSED`. - * - * @param {WebSocket} websocket The WebSocket instance - * @param {*} [data] The data to send - * @param {Function} [cb] Callback - * @private - */ -function sendAfterClose(websocket, data, cb) { - if (data) { - const length = toBuffer(data).length; - - // - // The `_bufferedAmount` property is used only when the peer is a client and - // the opening handshake fails. Under these circumstances, in fact, the - // `setSocket()` method is not called, so the `_socket` and `_sender` - // properties are set to `null`. - // - if (websocket._socket) websocket._sender._bufferedBytes += length; - else websocket._bufferedAmount += length; - } - - if (cb) { - const err = new Error( - `WebSocket is not open: readyState ${websocket.readyState} ` + - `(${readyStates[websocket.readyState]})` - ); - process.nextTick(cb, err); - } -} - -/** - * The listener of the `Receiver` `'conclude'` event. - * - * @param {Number} code The status code - * @param {Buffer} reason The reason for closing - * @private - */ -function receiverOnConclude(code, reason) { - const websocket = this[kWebSocket]; - - websocket._closeFrameReceived = true; - websocket._closeMessage = reason; - websocket._closeCode = code; - - if (websocket._socket[kWebSocket] === undefined) return; - - websocket._socket.removeListener('data', socketOnData); - process.nextTick(resume, websocket._socket); - - if (code === 1005) websocket.close(); - else websocket.close(code, reason); -} - -/** - * The listener of the `Receiver` `'drain'` event. - * - * @private - */ -function receiverOnDrain() { - const websocket = this[kWebSocket]; - - if (!websocket.isPaused) websocket._socket.resume(); -} - -/** - * The listener of the `Receiver` `'error'` event. - * - * @param {(RangeError|Error)} err The emitted error - * @private - */ -function receiverOnError(err) { - const websocket = this[kWebSocket]; - - if (websocket._socket[kWebSocket] !== undefined) { - websocket._socket.removeListener('data', socketOnData); - - // - // On Node.js < 14.0.0 the `'error'` event is emitted synchronously. See - // https://github.com/websockets/ws/issues/1940. - // - process.nextTick(resume, websocket._socket); - - websocket.close(err[kStatusCode]); - } - - websocket.emit('error', err); -} - -/** - * The listener of the `Receiver` `'finish'` event. - * - * @private - */ -function receiverOnFinish() { - this[kWebSocket].emitClose(); -} - -/** - * The listener of the `Receiver` `'message'` event. - * - * @param {Buffer|ArrayBuffer|Buffer[])} data The message - * @param {Boolean} isBinary Specifies whether the message is binary or not - * @private - */ -function receiverOnMessage(data, isBinary) { - this[kWebSocket].emit('message', data, isBinary); -} - -/** - * The listener of the `Receiver` `'ping'` event. - * - * @param {Buffer} data The data included in the ping frame - * @private - */ -function receiverOnPing(data) { - const websocket = this[kWebSocket]; - - if (websocket._autoPong) websocket.pong(data, !this._isServer, NOOP); - websocket.emit('ping', data); -} - -/** - * The listener of the `Receiver` `'pong'` event. - * - * @param {Buffer} data The data included in the pong frame - * @private - */ -function receiverOnPong(data) { - this[kWebSocket].emit('pong', data); -} - -/** - * Resume a readable stream - * - * @param {Readable} stream The readable stream - * @private - */ -function resume(stream) { - stream.resume(); -} - -/** - * The listener of the socket `'close'` event. - * - * @private - */ -function socketOnClose() { - const websocket = this[kWebSocket]; - - this.removeListener('close', socketOnClose); - this.removeListener('data', socketOnData); - this.removeListener('end', socketOnEnd); - - websocket._readyState = WebSocket.CLOSING; - - let chunk; - - // - // The close frame might not have been received or the `'end'` event emitted, - // for example, if the socket was destroyed due to an error. Ensure that the - // `receiver` stream is closed after writing any remaining buffered data to - // it. If the readable side of the socket is in flowing mode then there is no - // buffered data as everything has been already written and `readable.read()` - // will return `null`. If instead, the socket is paused, any possible buffered - // data will be read as a single chunk. - // - if ( - !this._readableState.endEmitted && - !websocket._closeFrameReceived && - !websocket._receiver._writableState.errorEmitted && - (chunk = websocket._socket.read()) !== null - ) { - websocket._receiver.write(chunk); - } - - websocket._receiver.end(); - - this[kWebSocket] = undefined; - - clearTimeout(websocket._closeTimer); - - if ( - websocket._receiver._writableState.finished || - websocket._receiver._writableState.errorEmitted - ) { - websocket.emitClose(); - } else { - websocket._receiver.on('error', receiverOnFinish); - websocket._receiver.on('finish', receiverOnFinish); - } -} - -/** - * The listener of the socket `'data'` event. - * - * @param {Buffer} chunk A chunk of data - * @private - */ -function socketOnData(chunk) { - if (!this[kWebSocket]._receiver.write(chunk)) { - this.pause(); - } -} - -/** - * The listener of the socket `'end'` event. - * - * @private - */ -function socketOnEnd() { - const websocket = this[kWebSocket]; - - websocket._readyState = WebSocket.CLOSING; - websocket._receiver.end(); - this.end(); -} - -/** - * The listener of the socket `'error'` event. - * - * @private - */ -function socketOnError() { - const websocket = this[kWebSocket]; - - this.removeListener('error', socketOnError); - this.on('error', NOOP); - - if (websocket) { - websocket._readyState = WebSocket.CLOSING; - this.destroy(); - } -} diff --git a/tools/mnemonic-test/node_modules/ws/package.json b/tools/mnemonic-test/node_modules/ws/package.json deleted file mode 100644 index 4abcf298..00000000 --- a/tools/mnemonic-test/node_modules/ws/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "name": "ws", - "version": "8.17.1", - "description": "Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js", - "keywords": [ - "HyBi", - "Push", - "RFC-6455", - "WebSocket", - "WebSockets", - "real-time" - ], - "homepage": "https://github.com/websockets/ws", - "bugs": "https://github.com/websockets/ws/issues", - "repository": { - "type": "git", - "url": "git+https://github.com/websockets/ws.git" - }, - "author": "Einar Otto Stangvik (http://2x.io)", - "license": "MIT", - "main": "index.js", - "exports": { - ".": { - "browser": "./browser.js", - "import": "./wrapper.mjs", - "require": "./index.js" - }, - "./package.json": "./package.json" - }, - "browser": "browser.js", - "engines": { - "node": ">=10.0.0" - }, - "files": [ - "browser.js", - "index.js", - "lib/*.js", - "wrapper.mjs" - ], - "scripts": { - "test": "nyc --reporter=lcov --reporter=text mocha --throw-deprecation test/*.test.js", - "integration": "mocha --throw-deprecation test/*.integration.js", - "lint": "eslint . && prettier --check --ignore-path .gitignore \"**/*.{json,md,yaml,yml}\"" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": ">=5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - }, - "devDependencies": { - "benchmark": "^2.1.4", - "bufferutil": "^4.0.1", - "eslint": "^9.0.0", - "eslint-config-prettier": "^9.0.0", - "eslint-plugin-prettier": "^5.0.0", - "globals": "^15.0.0", - "mocha": "^8.4.0", - "nyc": "^15.0.0", - "prettier": "^3.0.0", - "utf-8-validate": "^6.0.0" - } -} diff --git a/tools/mnemonic-test/node_modules/ws/wrapper.mjs b/tools/mnemonic-test/node_modules/ws/wrapper.mjs deleted file mode 100644 index 7245ad15..00000000 --- a/tools/mnemonic-test/node_modules/ws/wrapper.mjs +++ /dev/null @@ -1,8 +0,0 @@ -import createWebSocketStream from './lib/stream.js'; -import Receiver from './lib/receiver.js'; -import Sender from './lib/sender.js'; -import WebSocket from './lib/websocket.js'; -import WebSocketServer from './lib/websocket-server.js'; - -export { createWebSocketStream, Receiver, Sender, WebSocket, WebSocketServer }; -export default WebSocket; diff --git a/tools/testnet-setup/README.md b/tools/testnet-setup/README.md deleted file mode 100644 index d456961d..00000000 --- a/tools/testnet-setup/README.md +++ /dev/null @@ -1,121 +0,0 @@ -# 测试网设置指南 - -## 概述 - -本目录包含用于设置测试网环境的工具和合约。 - -## 测试网信息 - -### BSC Testnet -- **Chain ID**: 97 -- **RPC URL**: `https://data-seed-prebsc-1-s1.binance.org:8545` -- **区块浏览器**: https://testnet.bscscan.com -- **水龙头**: https://testnet.bnbchain.org/faucet-smart -- **官方测试 USDT**: `0x337610d27c682E347C9cD60BD4b3b107C9d34dDd` - -### KAVA Testnet -- **Chain ID**: 2221 -- **RPC URL**: `https://evm.testnet.kava.io` -- **区块浏览器**: https://testnet.kavascan.com -- **水龙头**: https://faucet.kava.io -- **测试 USDT**: 需要自行部署 - -## 快速开始 - -### 1. 切换到测试网模式 - -编辑 `backend/services/.env`: - -```bash -NETWORK_MODE=testnet -``` - -或在启动时设置环境变量: - -```bash -NETWORK_MODE=testnet docker compose up -d blockchain-service -``` - -### 2. 获取测试代币 - -#### BSC Testnet -1. 访问 https://testnet.bnbchain.org/faucet-smart -2. 连接钱包,获取 tBNB -3. BSC Testnet 上有官方测试 USDT,地址: `0x337610d27c682E347C9cD60BD4b3b107C9d34dDd` - -#### KAVA Testnet -1. 访问 https://faucet.kava.io -2. 输入钱包地址,获取 KAVA -3. 需要部署自定义测试 USDT 合约 (使用 TestUSDT.sol) - -### 3. 部署自定义测试 USDT (可选) - -如果需要完全控制测试代币,可以部署自定义合约: - -1. 打开 [Remix IDE](https://remix.ethereum.org) -2. 创建 `TestUSDT.sol`,粘贴合约代码 -3. 编译 (Solidity 0.8.20, Optimizer: 200) -4. 连接 MetaMask,切换到目标测试网 -5. 部署合约 -6. 记录合约地址,更新 `.env` - -### 4. 验证配置 - -启动服务后,检查日志确认网络配置: - -```bash -docker logs rwa-blockchain-service 2>&1 | grep "Network mode" -``` - -应该看到: -``` -[INIT] Network mode: testnet (testnet=true) -[INIT] KAVA: chainId=2221, rpc=https://evm.testnet.kava.io -[INIT] BSC: chainId=97, rpc=https://data-seed-prebsc-1-s1.binance.org:8545 -``` - -## 测试充值流程 - -### 1. 创建测试账户 - -```bash -curl -X POST http://localhost:3000/api/v1/user/auto-create \ - -H "Content-Type: application/json" \ - -d '{"deviceId": "test-device-001", "deviceName": {"model": "Test"}}' -``` - -### 2. 获取充值地址 - -使用返回的 token: - -```bash -curl http://localhost:3000/api/deposit/addresses \ - -H "Authorization: Bearer $TOKEN" -``` - -### 3. 发送测试 USDT - -在 MetaMask 中: -1. 切换到测试网 -2. 向充值地址发送测试 USDT -3. 等待确认 - -### 4. 检查充值状态 - -```bash -curl http://localhost:3000/api/deposit/balances \ - -H "Authorization: Bearer $TOKEN" -``` - -## 文件说明 - -- `TestUSDT.sol` - 测试 USDT 合约 (Solidity) -- `deploy-test-usdt.ts` - 部署脚本 (参考) -- `README.md` - 本文档 - -## 注意事项 - -1. **永远不要在主网使用测试私钥** -2. 测试网代币没有价值,仅供开发测试 -3. 测试网可能不稳定,出块速度可能变化 -4. 建议先在 BSC Testnet 测试,因为文档更完善 diff --git a/tools/testnet-setup/TestUSDT.sol b/tools/testnet-setup/TestUSDT.sol deleted file mode 100644 index 890d8dbe..00000000 --- a/tools/testnet-setup/TestUSDT.sol +++ /dev/null @@ -1,66 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.20; - -import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; -import "@openzeppelin/contracts/access/Ownable.sol"; - -/** - * @title TestUSDT - * @dev 用于测试环境的 USDT 代币合约 - * - * 特性: - * - 6 位小数 (与真实 USDT 一致) - * - 部署者可以自由 mint - * - 任何人都可以调用 faucet 获取测试代币 - * - * 部署到: - * - BSC Testnet (Chain ID: 97) - * - KAVA Testnet (Chain ID: 2221) - */ -contract TestUSDT is ERC20, Ownable { - uint256 public constant FAUCET_AMOUNT = 1000 * 10**6; // 1000 USDT - uint256 public constant FAUCET_COOLDOWN = 1 hours; - - mapping(address => uint256) public lastFaucetTime; - - constructor() ERC20("Test USDT", "tUSDT") Ownable(msg.sender) { - // 初始铸造 1,000,000 USDT 给部署者 - _mint(msg.sender, 1_000_000 * 10**6); - } - - /** - * @dev 返回 6 位小数 (与真实 USDT 一致) - */ - function decimals() public pure override returns (uint8) { - return 6; - } - - /** - * @dev Owner 可以铸造任意数量的代币 - */ - function mint(address to, uint256 amount) external onlyOwner { - _mint(to, amount); - } - - /** - * @dev 水龙头: 任何人都可以每小时领取 1000 tUSDT - */ - function faucet() external { - require( - block.timestamp >= lastFaucetTime[msg.sender] + FAUCET_COOLDOWN, - "Faucet: Please wait 1 hour between requests" - ); - - lastFaucetTime[msg.sender] = block.timestamp; - _mint(msg.sender, FAUCET_AMOUNT); - } - - /** - * @dev 批量空投 (Owner only) - */ - function airdrop(address[] calldata recipients, uint256 amount) external onlyOwner { - for (uint256 i = 0; i < recipients.length; i++) { - _mint(recipients[i], amount); - } - } -} diff --git a/tools/testnet-setup/deploy-test-usdt.ts b/tools/testnet-setup/deploy-test-usdt.ts deleted file mode 100644 index 94a16061..00000000 --- a/tools/testnet-setup/deploy-test-usdt.ts +++ /dev/null @@ -1,128 +0,0 @@ -/** - * 部署测试 USDT 合约到测试网 - * - * 使用方法: - * npx ts-node deploy-test-usdt.ts --network bsc-testnet - * npx ts-node deploy-test-usdt.ts --network kava-testnet - * - * 环境变量: - * DEPLOYER_PRIVATE_KEY - 部署者私钥 (必须有测试网原生代币用于 gas) - */ - -import { ethers } from 'ethers'; - -// 测试 USDT 合约 ABI (简化版) -const TEST_USDT_ABI = [ - 'constructor()', - 'function name() view returns (string)', - 'function symbol() view returns (string)', - 'function decimals() view returns (uint8)', - 'function totalSupply() view returns (uint256)', - 'function balanceOf(address) view returns (uint256)', - 'function transfer(address to, uint256 amount) returns (bool)', - 'function mint(address to, uint256 amount)', - 'function faucet()', - 'function airdrop(address[] recipients, uint256 amount)', -]; - -// 编译后的合约字节码 (需要先编译合约获得) -// 运行: solc --optimize --bin TestUSDT.sol -o ./build -// 或使用 Remix IDE 编译获取 -const TEST_USDT_BYTECODE = ` -注意: 这里需要填入编译后的字节码 -请使用 Remix IDE 或 solc 编译 TestUSDT.sol 获取字节码 -`; - -// 网络配置 -const NETWORKS = { - 'bsc-testnet': { - name: 'BSC Testnet', - chainId: 97, - rpcUrl: 'https://data-seed-prebsc-1-s1.binance.org:8545', - explorerUrl: 'https://testnet.bscscan.com', - faucet: 'https://testnet.bnbchain.org/faucet-smart', - }, - 'kava-testnet': { - name: 'KAVA Testnet', - chainId: 2221, - rpcUrl: 'https://evm.testnet.kava.io', - explorerUrl: 'https://testnet.kavascan.com', - faucet: 'https://faucet.kava.io', - }, -}; - -async function main() { - // 解析命令行参数 - const networkArg = process.argv.find((arg) => arg.startsWith('--network=')); - const networkName = networkArg?.split('=')[1] || 'bsc-testnet'; - - const network = NETWORKS[networkName as keyof typeof NETWORKS]; - if (!network) { - console.error(`Unknown network: ${networkName}`); - console.error(`Available networks: ${Object.keys(NETWORKS).join(', ')}`); - process.exit(1); - } - - console.log(`\n=== 部署测试 USDT 到 ${network.name} ===\n`); - - // 检查私钥 - const privateKey = process.env.DEPLOYER_PRIVATE_KEY; - if (!privateKey) { - console.error('错误: 请设置 DEPLOYER_PRIVATE_KEY 环境变量'); - console.error('\n获取测试网代币:'); - console.error(` ${network.faucet}`); - process.exit(1); - } - - // 连接网络 - const provider = new ethers.JsonRpcProvider(network.rpcUrl); - const wallet = new ethers.Wallet(privateKey, provider); - - console.log(`部署者地址: ${wallet.address}`); - - // 检查余额 - const balance = await provider.getBalance(wallet.address); - console.log(`余额: ${ethers.formatEther(balance)} ${networkName.includes('bsc') ? 'tBNB' : 'KAVA'}`); - - if (balance === 0n) { - console.error('\n错误: 余额为 0,请先从水龙头获取测试代币'); - console.error(`水龙头: ${network.faucet}`); - process.exit(1); - } - - // 部署合约 - console.log('\n正在部署合约...'); - - // 注意: 实际使用时需要先编译合约获取 bytecode - // 这里提供一个替代方案: 使用 Remix IDE 部署 - - console.log(` -======================================== -手动部署步骤 (使用 Remix IDE): -======================================== - -1. 打开 Remix IDE: https://remix.ethereum.org - -2. 创建新文件 TestUSDT.sol,复制合约代码 - -3. 编译合约: - - 选择 Solidity 0.8.20 - - 启用 Optimizer (runs: 200) - -4. 部署: - - Environment: Injected Provider (MetaMask) - - 切换 MetaMask 到 ${network.name} - - Chain ID: ${network.chainId} - - RPC: ${network.rpcUrl} - -5. 部署成功后,将合约地址更新到 .env: - ${networkName.includes('bsc') ? 'BSC_USDT_CONTRACT' : 'KAVA_USDT_CONTRACT'}=0x... - -6. 验证合约 (可选): - ${network.explorerUrl}/address/0x.../code - -======================================== -`); -} - -main().catch(console.error);